@emailmaker/emailmaker 1.2.0 → 1.2.5

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 (60) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +4 -0
  3. package/emailmaker-core.ee1618fa.js +859 -0
  4. package/emailmaker-esm.js +11 -11
  5. package/{emailmaker-po.fec11667.js → emailmaker-po.ee1618fa.js} +1 -1
  6. package/emailmaker.d.ts +34 -2
  7. package/emailmaker.js +12 -12
  8. package/iframe/.vite/manifest.json +4 -4
  9. package/iframe/{iframe-eblock.fec11667.html → iframe-eblock.ee1618fa.html} +2 -2
  10. package/iframe/{iframe.fec11667.html → iframe.ee1618fa.html} +2 -2
  11. package/iframe/js/elMarkupHelper.Buog1r0c.js +278 -0
  12. package/iframe/js/iframe-eblock.body.ee1618fa.js +9 -0
  13. package/iframe/js/iframe-eblock.js +2 -2
  14. package/iframe/js/iframe.body.ee1618fa.js +129 -0
  15. package/iframe/js/iframe.js +2 -2
  16. package/iframe/js/sanitize-html/sanitize-html.js +46 -21756
  17. package/package.json +1 -1
  18. package/runtime/react/index.js +1 -1
  19. package/static/core/155e871a.js +7 -0
  20. package/static/core/{7be64bf5.js → 17fba7af.js} +1 -1
  21. package/static/core/{a9235d9e.js → 2a042fe3.js} +1 -1
  22. package/static/core/{c5713f94.js → 32a14159.js} +1 -1
  23. package/static/core/{99c15a5d.js → 4de9c323.js} +1 -1
  24. package/static/core/{ec5f739e.js → 50ba806c.js} +10 -10
  25. package/static/core/{db685f4e.js → 5b6e2acb.js} +1 -1
  26. package/static/core/{f2ced98d.js → 63e7f8c1.js} +2 -2
  27. package/static/core/{790366d3.js → 64711257.js} +1 -1
  28. package/static/core/{f54ef492.js → 659796a7.js} +1 -1
  29. package/static/core/{b74171bd.js → 683a6a53.js} +1 -1
  30. package/static/core/{b27aec0b.js → 6b16159c.js} +1 -1
  31. package/static/core/{5c4239d8.js → 7e167222.js} +1 -1
  32. package/static/core/{8b89090c.js → 82f8beb4.js} +1 -1
  33. package/static/core/{a2c7aeb0.js → 987afc3f.js} +1 -1
  34. package/static/core/{44fac8d4.js → 9eaed676.js} +1 -1
  35. package/static/core/{9f7e0f94.js → a8b4352d.js} +1 -1
  36. package/static/core/{b7dee12b.js → b7289065.js} +2 -2
  37. package/static/core/b96e571d.js +2 -0
  38. package/static/core/c03be019.js +4 -0
  39. package/static/core/{7d006e7b.js → c3d00c5e.js} +1 -1
  40. package/static/core/{727a165f.js → c67df236.js} +1 -1
  41. package/static/core/{e15ab856.js → c8443fab.js} +1 -1
  42. package/static/core/{64c27f91.js → d2780737.js} +1 -1
  43. package/static/core/d503c406.js +1 -0
  44. package/static/core/{29b3ccef.js → dd230bbb.js} +1 -1
  45. package/static/core/e7fa68c2.js +28 -0
  46. package/static/core/{ccb090eb.js → f35181ec.js} +7 -7
  47. package/static/esm/b4f8dfdc.js +1 -0
  48. package/static/umd-runtime/{runtime.CunK0nEC.js → runtime.Bsid8PpY.js} +1 -1
  49. package/vendor/@emailmaker/ui-kit/package.json +1 -1
  50. package/emailmaker-core.fec11667.js +0 -859
  51. package/iframe/js/elMarkupHelper.Dv3AYDYP.js +0 -279
  52. package/iframe/js/iframe-eblock.body.fec11667.js +0 -9
  53. package/iframe/js/iframe.body.fec11667.js +0 -129
  54. package/iframe/js/sanitize-html/sanitize-html.min.js +0 -16923
  55. package/static/core/2e70fae0.js +0 -4
  56. package/static/core/83d2ca5d.js +0 -28
  57. package/static/core/8da91a53.js +0 -2
  58. package/static/core/bbb87124.js +0 -1
  59. package/static/core/e7bbe544.js +0 -7
  60. package/static/esm/ae0fe329.js +0 -1
@@ -1,279 +0,0 @@
1
- __emailmaker__.define("js/elMarkupHelper.Dv3AYDYP.js",["require","exports","module"],function(Ql,q,cq){var lf=Object.defineProperty,Yn=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ie=(e,t)=>{let n={};for(var r in e)lf(n,r,{get:e[r],enumerable:!0});return t||lf(n,Symbol.toStringTag,{value:"Module"}),n};function Xo(e){"@babel/helpers - typeof";return Xo=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},Xo(e)}function kS(e,t){if(Xo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LS(e){var t=kS(e,"string");return Xo(t)=="symbol"?t:t+""}function L(e,t,n){return(t=LS(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cf;cf=Symbol.toStringTag;var Jl=class{constructor(){L(this,"_valuesMap",new Map),L(this,cf,"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 uf(){const e=new Jl;return new Proxy(e,{set:function(t,n,r){return typeof n=="string"&&Jl.prototype.hasOwnProperty(n)?e[n]=r:typeof n=="string"&&e.setItem(n,String(r)),!0},get:function(t,n){if(typeof n=="string"){if(Jl.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 df(){const e=uf(),t=uf();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)})}df();function NS(e){return e}var xS=class extends Error{constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),L(this,"cycle",void 0),this.cycle=e}};function MS(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 RS(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 OS(e){const t=MS(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 xS([...o.slice(l),a].map(c=>c.name))}i.add(a),o.push(a);for(const l of RS(a,t))s(l);o.pop(),i.delete(a),r.add(a),n.push(a)}};for(const a of e)s(a);return n}var Ee=class wS{constructor(t=[]){L(this,"_inner",void 0),L(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof wS&&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 ec(e){return`service_container_${e}`}var Yo=new Set,tc;function PS(){if(!tc)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,mf.prototype.getInstanceAsync),e.stack}function nc(e){Yo.delete(e)&&tc?.end(e)}var mf=class af extends Ee{_runCallbacks(t){[...this._injectCallbacks].forEach(n=>n(t))}constructor(t=null){super(),L(this,"_parent",void 0),L(this,"_injectCallbacks",[]),L(this,"_injections",Object.create(null)),L(this,"onInject",n=>(this._injectCallbacks.push(n),{dispose:()=>{const r=this._injectCallbacks.indexOf(n);r>=0&&this._injectCallbacks.splice(r,1)}})),this._parent=t,t&&this.addDisposable(t.onInject(n=>this._runCallbacks(n)))}inject(t,n){this._injections[t]=()=>n,this._runCallbacks(t)}injectFactory(t,n,r){const o=this._injections[t];let i=typeof o=="function"?o():o;const s=this._injections[t]=()=>(i=n(this,i),i);r&&s(),this._runCallbacks(t)}_find(t,n=!0){return this._injections[t]||n&&this._parent?._find(t)}_onInject(t,n,r=new Ee){return r.addDisposable(this.onInject(o=>{t===o&&!r.isDisposed()&&(r.dispose(),n(this.getInstance(o)))})),this._parent&&r.addDisposable(this._parent._onInject(t,n,r)),this.addDisposable(r),r}getInstance(t,n=!0){const r=this._find(t,n);if(typeof r=="function")return r()}getOrCreateInstance(t,n){const r=this._find(t);if(typeof r=="function")return r();const o=n(this);return this.inject(t,o),o}getInstanceAsync(t){const n=this._find(t);if(typeof n=="function")return Promise.resolve(n());const r=PS();return new Promise((o,i)=>{const s={id:String(t),startedAt:Date.now(),origin:r,container:this,reject:i};Yo.add(s),tc?.start(s),this._onInject(t,()=>{nc(s),o(this.getInstance(t))})})}failPendingWaits(t){for(const n of Array.from(Yo))n.container===this&&(nc(n),n.reject(t))}pendingWaits(){return[...Yo].filter(t=>t.container===this)}addService(t,n){const r=ec(t);this.injectFactory(r,(i,s=[])=>s.indexOf(n)<0?[...s,n]:s);const o=new Ee;return o.addDispose(()=>{this.injectFactory(r,(i,s=[])=>s.filter(a=>a!==n))}),o}addServiceFactory(t,n,r){const o=ec(t);let i;this.injectFactory(o,(a,l=[])=>(i=n(a,i),i===void 0?l:l.indexOf(i)<0?[...l,i]:l),r);const s=new Ee;return s.addDispose(()=>{this.injectFactory(o,(a,l=[])=>i===void 0?l:l.filter(c=>c!==i))}),s}getServices(t){const n=ec(t);return[...this.getInstance(n,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new af(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const n=this._parent?.getOrCreateIsolatedContainer(t);return new af(n)})}remove(t){const n=this._injections;delete n[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(Yo))t.container===this&&nc(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function rc(e){return e.startsWith("__")?e:`__${e}__`}function IS(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=rc(e),n=globalThis;return n[t]??(n[t]={})}function DS(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function BS(e){if(e)return rc(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return rc(t)}function oc(e){const t=BS(e),n=IS(t);if(DS(n.container))return n.container;const r=new mf(null);return n.container=r,r}function HS(){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 FS(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():HS()}function de(e=FS()){return e}function ff(){return"iframe".trim()||"unknown"}function $S(e){if(typeof globalThis>"u")return;const t=ff(),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 WS(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function qS(e,t){if($S(t),typeof globalThis>"u")return e;const n=ff(),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 xs;function zS(){if(xs)return xs;const e=WS();return xs=qS(oc(e),e),xs}var uq=new Proxy({},{get(e,t,n){const r=zS(),o=Reflect.get(r,t,n);return typeof o=="function"?o.bind(r):o}}),VS=new Function("url","return import(url)");function US(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function ic(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function pf(e){return e.type==="umd"||e.resolve==="registry"}var jS="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 GS(e){const t=Array.isArray(e)?e[0]:e;return ic(t)?t.name??t.url:typeof t=="function"?t.name||"anonymous plugin":String(t)}function XS(e,t){const n=GS(e),r=ic(e)?e:void 0,o=t instanceof Error?t.message:String(t),i=r&&pf(r)&&!/compat/iu.test(o)?` ${jS}`:"",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 YS(e){return!e.filename&&!e.error&&/^Script error\.?$/.test(e.message)}function dq(e){return e}var KS=class{constructor(e,t,n={}){L(this,"_context",void 0),L(this,"_pluginRegistry",void 0),L(this,"_options",void 0),L(this,"_map",new Map),L(this,"_optionsMap",new Map),L(this,"_readyMap",new Map),L(this,"_resolveMap",new Map),L(this,"_initializingPlugins",new Map),L(this,"_creatingPlugins",new Set),L(this,"_initializedPlugins",new Set),L(this,"_creationOrder",[]),L(this,"_lifecycleListeners",new Set),L(this,"_activated",!1),this._context=e,this._pluginRegistry=t,this._options=n}activate(){return this._activated=!0,this._startPluginsBatch(Array.from(this._map.values()))}activateSync(){this._activated=!0,this._startPluginsBatch(Array.from(this._map.values()))}onLifecycle(e){return this._lifecycleListeners.add(e),{dispose:()=>this._lifecycleListeners.delete(e)}}_emitLifecycle(e){for(const t of Array.from(this._lifecycleListeners))try{t(e)}catch{}}async _resolveEntry(e){if(typeof e=="string"||typeof e=="symbol"){const t=await this._pluginRegistry.getAsync(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered.`);return{ctor:t}}if(typeof e=="function")return e.length===0?{ctor:await e()}:{ctor:e};if(Array.isArray(e)){const[t,n]=e;if(typeof t=="function")return{ctor:t,options:n};const r=await this._pluginRegistry.getAsync(t);if(!r)throw new Error(`Plugin "${String(t)}" not registered.`);return{ctor:r,options:n}}if(ic(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(pf(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const n=await VS(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):YS(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=XS(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 US(e)?new e(this._context,t):e(this._context,t)||{}}finally{r?.(),this._creatingPlugins.delete(n)}}_setupReadyPromise(e){const t=new Promise(n=>{this._resolveMap.set(e,n)});this._readyMap.set(e,t)}async _startPluginsBatch(e){const t=Array.from(new Set(e)),n=new Set,r=[];for(const o of t){if(this._initializedPlugins.has(o))continue;const i=this._initializingPlugins.get(o);if(i){n.add(i);continue}r.push(o)}if(r.length>0){const o=this._runBatchLifecycle(r);for(const i of r)this._initializingPlugins.set(i,o);n.add(o),o.finally(()=>{for(const i of r)this._initializingPlugins.get(i)===o&&this._initializingPlugins.delete(i)})}await Promise.all(n)}async _runBatchLifecycle(e){const t=[];for(const n of e){const r=n.constructor.name;this._emitLifecycle({type:"init:start",plugin:n,name:r});const o=this._options.openEarlyWindow?.();try{await n.init?.(),this._emitLifecycle({type:"init:success",plugin:n,name:r}),t.push(n)}catch(i){this._emitLifecycle({type:"init:error",plugin:n,name:r,error:i})}finally{o?.()}}for(const n of t){const r=n.constructor.name;this._emitLifecycle({type:"afterInit:start",plugin:n,name:r});try{await n.afterInit?.(),this._emitLifecycle({type:"afterInit:success",plugin:n,name:r})}catch(o){this._emitLifecycle({type:"afterInit:error",plugin:n,name:r,error:o})}}for(const n of e)this._initializedPlugins.add(n),this._resolveMap.get(n)?.(),this._resolveMap.delete(n)}async _disposePlugin(e,t){this._emitLifecycle({type:"dispose:start",plugin:e,name:t});try{await e.dispose?.(),this._emitLifecycle({type:"dispose:success",plugin:e,name:t})}catch(n){this._emitLifecycle({type:"dispose:error",plugin:e,name:t,error:n})}}async dispose(){for(let e=this._creationOrder.length-1;e>=0;e--){const t=this._creationOrder[e];await this._initializingPlugins.get(t),await this._disposePlugin(t,t.constructor.name)}this._map.clear(),this._optionsMap.clear(),this._readyMap.clear(),this._resolveMap.clear(),this._initializingPlugins.clear(),this._initializedPlugins.clear(),this._creationOrder.length=0,this._lifecycleListeners.clear()}getStatus(){return Array.from(this._map.values()).map(e=>({name:e.constructor.name,initialized:this._initializedPlugins.has(e)}))}},ZS=class{constructor(){L(this,"_plugins",new Map),L(this,"_listeners",new Map)}_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){const n=this._plugins.get(e);if(n?.overrides)for(const r of n.overrides)t=r(t)||t;return t}_notifyListeners(e,t){const n=this._listeners.get(e);if(!n||n.length===0)return;for(const o of n)try{o.callback(t)}catch{}const r=n.filter(o=>!o.once);r.length>0?this._listeners.set(e,r):this._listeners.delete(e)}get(e){const t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor)}async getAsync(e){const t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor);if(t?.loading){const n=await t.loading;return this._applyOverrides(e,n)}if(t?.factory){const n=Promise.resolve(t.factory()).then(o=>(t.ctor=o,t.loading=void 0,this._notifyListeners(e,o),o));t.loading=n;const r=await n;return this._applyOverrides(e,r)}return new Promise(n=>{this.on(e,r=>n(this._applyOverrides(e,r)))})}add(e,t){const n=this._getOrCreateEntry(e);n.ctor=t,this._notifyListeners(e,t)}addAll(e){for(const t of Object.keys(e)){const n=e[t];n!==void 0&&this.add(t,n)}}addAsync(e,t){const n=this._getOrCreateEntry(e);return n.factory=t,{dispose:()=>{n.ctor||(n.factory=void 0)}}}has(e){const t=this._plugins.get(e);return!!(t?.ctor||t?.factory)}isLoaded(e){return!!this._plugins.get(e)?.ctor}override(e,t){const n=this._getOrCreateEntry(e);return n.overrides.push(t),{dispose:()=>{const r=n.overrides.indexOf(t);r>=0&&n.overrides.splice(r,1)}}}on(e,t){const n=this.get(e);n&&t(n);let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));const o={callback:t,once:!1};return r.push(o),{dispose:()=>this._removeListener(e,t)}}once(e,t){const n=this.get(e);if(n)return t(n),{dispose:()=>{}};let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));const o={callback:t,once:!0};return r.push(o),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){const n=this._listeners.get(e);if(n){const r=n.findIndex(o=>o.callback===t);r>=0&&n.splice(r,1),n.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){const e=this;return{add(t,n){e.add(t,n)}}}},QS=class{constructor(e){L(this,"resolveRegistry",void 0),this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},te=de("SandboxHtmlDocument"),mt=de("SandboxRemoteDocument"),Ko=de("SandboxTextDocument"),Zt=de("SandboxDocumentMapping"),xe=de("SandboxSyncCommit"),Zo=de("SandboxLayoutProfile"),Ms=de("SandboxState"),qr=de("SandboxAttributePipeline"),sc=de("SandboxAmpService"),ac=de("SandboxImageReload"),Rs=de("SandboxImageCache"),at=de("SandboxFocus"),lc=de("SandboxLocalization"),He=de("SandboxElementSettings"),vt=de("SandboxSetCursor"),hf=de("SandboxStyleRoot"),gf=de("SandboxVmlWidthResolver"),Os=de("SandboxPrepareHtml"),Qo=de("SandboxSurfaceName"),Ps=de("SandboxDocumentSync"),zr=de("SandboxMapObj"),Vr=de("SandboxActiveElementFingerprint"),Is=de("SandboxToggleTextStyle"),Qt=de("SandboxWrapEditor"),Ur=de("SandboxInsertServices"),Jo=de("SandboxInitPreview"),cc=de("SandboxInsertPolicy"),bf=de("SandboxNarrowTableTextAtom"),yf=de("SandboxSettingsExtras"),vf=de("SandboxViewportHandlers"),Ef=de("SandboxOperations"),Ds=de("SandboxApplyElementSettings"),Kn=de("SandboxOperationEnvironment"),jr=de("SandboxHostFacts"),JS="__sandbox__",Et=oc(JS);function ew(e){return e}function tw(e,t=Et){t.inject(Qo,e.name),t.inject(Zo,e.profile);for(const n of OS(e.units))n.setup(t);return t}function Jt(e,t){e.remove?.(t)}function D(e,t){const n=e.getInstance(t);if(n===void 0)throw new Error(`[sandbox] служба «${String(t)}» не зарегистрирована: её фича не подключена или ещё не зарегистрирована`);return n}var Sf=class{constructor(e){L(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},St=(function(e){return e[e.StartCommentTag=0]="StartCommentTag",e[e.Comment=1]="Comment",e[e.EndCommentTag=2]="EndCommentTag",e[e.StartTagOpen=3]="StartTagOpen",e[e.StartTagClose=4]="StartTagClose",e[e.StartTagSelfClose=5]="StartTagSelfClose",e[e.StartTag=6]="StartTag",e[e.EndTagOpen=7]="EndTagOpen",e[e.EndTagClose=8]="EndTagClose",e[e.EndTag=9]="EndTag",e[e.DelimiterAssign=10]="DelimiterAssign",e[e.AttributeName=11]="AttributeName",e[e.AttributeValue=12]="AttributeValue",e[e.StartDoctypeTag=13]="StartDoctypeTag",e[e.Doctype=14]="Doctype",e[e.EndDoctypeTag=15]="EndDoctypeTag",e[e.Content=16]="Content",e[e.Whitespace=17]="Whitespace",e[e.Unknown=18]="Unknown",e[e.Script=19]="Script",e[e.Styles=20]="Styles",e[e.EOS=21]="EOS",e[e.AdvancedStart=100]="AdvancedStart",e[e.AdvancedEnd=101]="AdvancedEnd",e})({}),nw=class{constructor(e,t){L(this,"source",void 0),L(this,"len",void 0),L(this,"position",void 0),this.source=e,this.len=e.length,this.position=t}eos(){return this.len<=this.position}getSource(){return this.source}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}goToEnd(){this.position=this.source.length}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)?(this.position++,!0):!1}advanceIfChars(e){let t;if(this.position+e.length>this.source.length)return!1;for(t=0;t<e.length;t++)if(this.source.charCodeAt(this.position+t)!==e[t])return!1;return this.advance(t),!0}advanceIfRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index+t[0].length,t[0]):""}advanceUntilRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index,t[0]):(this.goToEnd(),"")}advanceUntilChar(e){for(;this.position<this.source.length;){if(this.source.charCodeAt(this.position)===e)return!0;this.advance(1)}return!1}advanceUntilChars(e){for(;this.position+e.length<=this.source.length;){let t=0;for(;t<e.length&&this.source.charCodeAt(this.position+t)===e[t];t++);if(t===e.length)return!0;this.advance(1)}return this.goToEnd(),!1}skipWhitespace(){return this.advanceWhileChar(e=>e===aw||e===lw||e===ow||e===sw||e===iw)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},wf=33,Gr=45,ei=60,en=62,Bs=47,rw=61,Cf=34,Af=39,ow=10,iw=13,sw=12,aw=32,lw=9,cw={"text/x-handlebars-template":!0,"text/html":!0};function uw(e,t=0,n=0,r=!1){const o=new nw(e,t);let i=n,s=0,a=18,l,c,u=!1,d,m,p;function f(){return o.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function h(){const S=o.pos();for(;!o.eos();){const b=o.nextChar();if(b===en)return!0;if(b===ei)break;if(b===Cf||b===Af){if(!o.advanceUntilChar(b))break;o.advance(1)}}return o.goBackTo(S),!1}function y(){return o.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function v(S,b,E){return a=b,s=S,l=E,b}function A(){const S=o.pos(),b=i,E=k();return E!==21&&S===o.pos()&&!(r&&(E===4||E===8))?(o.advance(1),v(S,18)):E}function k(){const S=o.pos();if(o.eos())return v(S,21);let b;switch(i){case 6:return o.advanceIfChars([Gr,Gr,en])?(i=0,v(S,2)):(o.advanceUntilChars([Gr,Gr,en]),v(S,1));case 3:return o.advanceIfChar(en)?(i=0,v(S,15)):(o.advanceUntilChar(en),v(S,14));case 0:if(o.advanceIfChar(ei)){if(!o.eos()&&o.peekChar()===wf){if(o.advanceIfChars([wf,Gr,Gr]))return i=6,v(S,0);if(o.advanceIfRegExp(/^!doctype/i))return i=3,v(S,13)}return o.advanceIfChar(Bs)?(i=2,v(S,7)):(i=1,v(S,3))}return o.advanceUntilChar(ei),v(S,16);case 2:return f().length>0?(i=5,u=!1,v(S,9)):o.skipWhitespace()?v(S,17,"Tag name must directly follow the open bracket."):(i=5,o.advanceUntilChar(en),S<o.pos()?v(S,18,"End tag name expected."):k());case 5:if(o.skipWhitespace())return u=!0,v(S,17);if(o.advanceIfChar(en))return i=0,v(S,8);if(r&&o.peekChar()===ei)return i=0,v(S,8,"Closing bracket missing.");if((u||o.peekChar()===Bs)&&h())return i=0,v(S,8);b="Closing bracket expected.";break;case 1:return d=f(),p=void 0,m=void 0,d.length>0?(c=!1,i=4,v(S,6)):o.skipWhitespace()?v(S,17,"Tag name must directly follow the open bracket."):(i=4,o.advanceUntilChar(en),S<o.pos()?v(S,18,"Start tag name expected."):k());case 4:return o.skipWhitespace()?(c=!0,v(S,17)):c&&(m=y(),m.length>0)?(i=9,c=!1,v(S,11)):o.advanceIfChars([Bs,en])?(i=0,v(S,5)):o.advanceIfChar(en)?(d==="script"?p&&cw[p]?i=0:i=7:d==="style"?i=8:i=0,v(S,4)):r&&o.peekChar()===ei?(i=0,v(S,4,"Closing bracket missing.")):(o.advance(1),v(S,18,"Unexpected character in tag."));case 9:return o.skipWhitespace()?(c=!0,v(S,17)):o.advanceIfChar(rw)?(i=10,v(S,10)):(i=4,k());case 10:if(o.skipWhitespace())return v(S,17);let E=o.advanceIfRegExp(/^[^\s"'`=<>]+/);if(E.length>0)return o.peekChar()===en&&o.peekChar(-1)===Bs&&(o.goBack(1),E=E.substr(0,E.length-1)),m==="type"&&(p=E),i=4,c=!1,v(S,12);const C=o.peekChar();return C===Af||C===Cf?(o.advance(1),o.advanceUntilChar(C)&&o.advance(1),m==="type"&&(p=o.getSource().substring(S+1,o.pos()-1)),i=4,c=!1,v(S,12)):(i=4,c=!1,k());case 7:let g=1;for(;!o.eos();){const w=o.advanceIfRegExp(/<!--|-->|<\/?script(?=[\s/>])\s*\/?>?/i);if(w.length===0)return o.goToEnd(),v(S,19);if(w==="<!--")g===1&&(g=2);else if(w==="-->")g=1;else if(w[1]!=="/")g===2&&(g=3);else if(g===3)g=2;else{o.goBack(w.length);break}}return i=0,S<o.pos()?v(S,19):k();case 8:return o.advanceUntilRegExp(/<\/style(?=[\s/>])/i),i=0,S<o.pos()?v(S,20):k()}return o.advance(1),i=0,v(S,18,b)}return{scan:A,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>o.pos()-s,getTokenEnd:()=>o.pos(),getTokenText:()=>o.getSource().substring(s,o.pos()),getScannerState:()=>i,getTokenError:()=>l}}function dw(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function mw(e,t){const n=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+n.length,n}function fw(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function pw(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 uc=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function hw(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}var Tf=Object.create(null);function gw(e,t){const n=Tf[e]||(Tf[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[hw(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function dc(e,t){if(e.start===e.end||t)return"";switch(e.type){case $.ELEMENT:return pc(e,t);case $.ROOT:return[...e.children].map(n=>dc(n,t)).join("");case $.DOCTYPE:return dw(e,t);case $.COMMENT:return fw(e,t);default:return e.content||""}}function mc(){return{exact:new WeakMap,collapsed:new WeakMap}}function fr(e,t=!1,n){if(e.start===e.end&&e.type!==$.ROOT)return"";const r=n&&(t?n.collapsed:n.exact),o=r?.get(e);if(o!==void 0)return o;const i=()=>e.children.map(a=>fr(a,t,n)).join("");let s;switch(e.type){case $.ELEMENT:{const a=e.tag?.toLowerCase();s=`<${a}${e.attributeNames.map(l=>` ${l}=${JSON.stringify(e.attributes?.[l]??null)}`).join("")}>${i()}</${a}>`;break}case $.ROOT:s=i();break;case $.COMMENT:s=`<!--${e.content??""}-->`;break;case $.DOCTYPE:s=`<!${e.content??""}>`;break;default:{const a=e.content??"";s=t?a.replace(/\s+/g," ").trim():a}}return r?.set(e,s),s}function fc(e,t=0){if(e.start===e.end)return"";switch(e.type){case $.ELEMENT:return yw(e,t);case $.ROOT:return kf(e,t);case $.DOCTYPE:return mw(e,t);case $.COMMENT:return pw(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function _f(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"&&!gw(t,i)?` ${i}`:` ${i}="${s.replaceAll('"',"'")}"`)}}}return n}function bw(e,t){let n="";if(e.startTagEnd!==e.endTagStart||t)for(const r of e.children)n+=dc(r);return n}function kf(e,t){let n="";if(e.startTagEnd!==e.endTagStart)for(const r of e.children)n+=fc(r,t+n.length);return n}function Lf(e,t){if(e.start!==e.startTagEnd||t){const n=e.tag?.toLowerCase()||"div",r=_f(e);return n==="vk-snippet-end"?`<${n}${r}/>`:`<${n}${r}>`}return""}function Nf(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function pc(e,t,n=!0){const r=e.tag?.toLowerCase()||"div",o=Lf(e,t);if(uc.has(r))return o;{const i=Nf(e,t);return`${o}${n?bw(e,t):""}${i}`}}function yw(e,t){const n=e.tag?.toLowerCase()||"div",r=Lf(e);if(e.start=t,e.startTagEnd=t+r.length,uc.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=kf(e,e.startTagEnd);e.endTagStart=e.startTagEnd+o.length;const i=Nf(e);return e.end=e.endTagStart+i.length,`${r}${o}${i}`}}function hc(e,t){let n=0,r=e.length;if(r===0)return 0;for(;n<r;){const o=Math.floor((n+r)/2);t(e[o])?r=o:n=o+1}return n}var $=(function(e){return e[e.HTML=0]="HTML",e[e.ELEMENT=1]="ELEMENT",e[e.ROOT=2]="ROOT",e[e.COMMENT=3]="COMMENT",e[e.DOCTYPE=4]="DOCTYPE",e[e.ADVANCED=5]="ADVANCED",e})({}),Hs=e=>e.type===0?e.start-1:e.start,vw=e=>e.type===0?e.end+1:e.end,wt=class CS{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,n,r,o){L(this,"start",void 0),L(this,"end",void 0),L(this,"children",void 0),L(this,"parent",void 0),L(this,"content",void 0),L(this,"type",1),L(this,"tag",void 0),L(this,"closed",!1),L(this,"startTagEnd",void 0),L(this,"endTagStart",void 0),L(this,"attributes",void 0),L(this,"createdBy",void 0),L(this,"isDirty",void 0),this.start=t,this.end=n,this.children=r,this.parent=o}isSameTag(t){return this.tag===void 0?t===void 0:t!==void 0&&this.tag.length===t.length&&this.tag.toLowerCase()===t}get firstChild(){return this.children[0]}get lastChild(){return this.children.length?this.children[this.children.length-1]:void 0}findNodeBefore(t){const n=hc(this.children,r=>t<=Hs(r))-1;if(n>=0){const r=this.children[n];if(t>Hs(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=hc(this.children,r=>t<=Hs(r))-1;if(n>=0){const r=this.children[n];if(t>=Hs(r)&&t<=vw(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 CS(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 Ew(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 xf=class{constructor(e,t){L(this,"text",void 0),L(this,"type",void 0),L(this,"node",void 0),L(this,"replaces",void 0),this.text=e,this.type=t}get hasNode(){return!!this.node}addReplace(e){this.replaces?.push(e)}start(e,t,n){if(!this.node){const r=this.node=new wt(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}}},Mf=class{constructor(e){L(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const n=uw(e,void 0,void 0,!0),r=new wt(0,e.length,[],void 0);r.type=$.ROOT;let o=r,i=-1,s,a=null,l=n.scan();const c=()=>{if(!o.tag){const f=o.parent.children,h=f[f.length-2],y=e.substring(o.start,o.end);h?.type===$.HTML?(h.content=(h.content||"")+y,h.end=o.end,f.splice(f.length-1,1)):(o.type=$.HTML,o.content=y,o.children=[]),o.type=$.HTML}o=o.parent},u=new xf(e,$.COMMENT),d=new xf(e,$.DOCTYPE),m=f=>{o.children.push(f)};for(;l!==St.EOS;){switch(l){case St.StartDoctypeTag:d.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case St.EndDoctypeTag:{const A=o.lastChild,k=d.node;if(!k)throw new Error("");const S=A?A.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(S!==k.start){const b=e.substring(S,k.start);if(b){const E=new wt(S,k.start,[],o);E.type=$.HTML,E.content=b,m(E)}}d.finish(n.getTokenOffset(),n.getTokenLength());break}case St.StartCommentTag:u.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case St.EndCommentTag:{const A=o.lastChild,k=u.node;if(!k)throw new Error("");const S=A?A.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(S!==k.start){const b=e.substring(S,k.start);if(b){const E=new wt(S,k.start,[],o);E.type=$.HTML,E.content=b,m(E)}}u.finish(n.getTokenOffset(),n.getTokenLength());break}case St.StartTagOpen:const f=o.lastChild,h=new wt(n.getTokenOffset(),e.length,[],o),y=f?f.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(y!==h.start){const A=e.substring(y,h.start);if(A){const k=new wt(y,h.start,[],o);k.type=$.HTML,k.content=A,m(k)}}m(h),o=h;break;case St.StartTag:o.tag=n.getTokenText();break;case St.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 St.StartTagSelfClose:o.parent&&(o.closed=!0,o.end=n.getTokenEnd(),o.startTagEnd=n.getTokenEnd(),c());break;case St.EndTagOpen:i=n.getTokenOffset(),s=void 0;break;case St.EndTag:s=n.getTokenText().toLowerCase();break;case St.EndTagClose:let v=o;for(;!v.isSameTag(s)&&v.parent;)v=v.parent;if(v.parent){const A=o.lastChild,k=A?A.end:o.startTagEnd===void 0?o.start:o.startTagEnd;if(k!==i){const S=e.substring(k,i);if(S){const b=new wt(k,i,[],o);b.type=$.HTML,b.content=S,m(b)}}for(;o!==v;)o.end=i,o.closed=!1,c();o.closed=!0,o.endTagStart=i,o.end=n.getTokenEnd(),c()}break;case St.AttributeName:{a=n.getTokenText();let A=o.attributes;A||(o.attributes=A={}),A[a]=null;break}case St.AttributeValue:{const A=n.getTokenText(),k=o.attributes;k&&a&&(k[a]=Ew(A),a=null);break}}l=n.scan()}for(;o.parent;)o.end=e.length,o.closed=!1,c();u.hasNode,u.finish(e.length);const p=r.lastChild?.end||0;if(p<e.length){const f=e.substring(p);if(f){const h=new wt(p,e.length,[],r);h.type=$.HTML,h.content=f,m(h)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}},mq=new Mf(new Sf(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),Sw=new Sf(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),ww=new Mf(Sw);function Xr(e){return ww.parse(e)}var Rf=class extends Ee{constructor(e={}){super(),L(this,"_options",void 0),L(this,"_listeners",[]),L(this,"on",this._addListener.bind(this)),L(this,"event",this._addListener.bind(this)),L(this,"once",(t,n=0,r)=>{const o=this._addListener((...i)=>(o?.dispose(),r?t.call(r,...i):t(...i)),n);return o}),L(this,"un",t=>{const n=this._listeners.findIndex(([r])=>r===t);n>=0&&(this._listeners.splice(n,1),this._listeners.length===0&&this._options.onLastListenerRemove&&this._options.onLastListenerRemove())}),this._options=e}getListeners(e){return this._listeners.flatMap(([t])=>typeof t=="function"?t:t.getListeners(e))}hasListeners(){for(const[e]of this._listeners){if(typeof e=="function")return!0;const t=e;if(typeof t.hasListeners=="function"){if(t.hasListeners())return!0;continue}return!0}return!1}_addListener(e,t=0,n){if(this.isDisposed())return{dispose:()=>{}};const r=this._listeners,o=this._options;n&&typeof e=="function"&&(e=e.bind(n));const i=r.findIndex(([,a])=>a<t),s=[e,t];return r.splice(i>=0?i:r.length,0,s),r.length===1&&o.onFirstListenerAdd&&o.onFirstListenerAdd(),{dispose:()=>{const a=r.indexOf(s);a>=0&&(r.splice(a,1),!r.length&&o.onLastListenerRemove&&o.onLastListenerRemove())}}}dispose(){this._listeners.splice(0,this._listeners.length),this._options.onLastListenerRemove&&this._options.onLastListenerRemove(),super.dispose()}},Cw=class extends Rf{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}}},Me=class extends Cw{execute([e],t){for(const n of t)try{n(e)}catch{}}},Aw=class extends Rf{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 Tw(e,t,n){let r;const o=new Me({onFirstListenerAdd(){r=o.addDisposable(new Ee),r.addDisposable(e(i=>{t(i)!==!1&&o.fire(i)}))},onLastListenerRemove(){r?.dispose(),r=void 0}});return n?.addDisposable(o),o.event}function _w(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 kw(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 fq(e){return e}function Lw(e){return e&&typeof e=="object"}function Of(e,t){return e&&typeof e=="object"&&e.operationId===t}var yn="INIT_MESSAGE",Nw="em:port-ready",xw="em:window-drained",gc="";function Pf(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var Mw=class extends Ee{constructor(...e){super(...e),L(this,"_listeners",Object.create(null)),L(this,"addListenerAsync",(t,n,r=0,o)=>{const i=this._listeners[t]||(this._listeners[t]=[]);o&&typeof n=="function"&&(n=n.bind(o));const s=i.findIndex(([l,c])=>r<=c),a=[n,r];return this.isDisposed()||i.splice(s>=0?s:i.length,0,a),{dispose(){const l=i.indexOf(a);l>=0&&i.splice(l,1)}}}),L(this,"fireAsync",(t,n)=>{if(!this.isDisposed()){const r=this._listeners[t]||(this._listeners[t]=[]);let o;for(let i=0;i<r.length;i++){const s=r[i][0],a=o;o=l=>s(l,a)}if(o)return o(n)}}),L(this,"addListener",(t,n,r=0)=>this.addListenerAsync(t,(o,i)=>{try{n(o)}catch{}return i&&i(o)},r))}},Rw=class extends Ee{constructor(e,t){super(),L(this,"_singleton",void 0),L(this,"_target",void 0),L(this,"_transport",void 0),L(this,"_transportSubscription",void 0),L(this,"_ports",new Map),L(this,"_drained",new WeakSet),L(this,"_portSendHeld",new WeakSet),L(this,"_inited",!1),L(this,"_emitter",this.addDisposable(new Mw)),L(this,"_handshaken",new WeakSet),L(this,"_greeted",new WeakSet),L(this,"_outgoingFilter",void 0),L(this,"_outgoingObservers",new Set),L(this,"_offTargetListeners",new Map),L(this,"_onTransportMessage",n=>{const r=n,o=r.data,i=r.source,s=o?.port===!0?r.ports?.[0]:void 0,a=!this._isPortSource(r.source);if(a&&i&&o?.operationId==="em:window-drained"){this._ports.has(i)&&this._drained.add(i);return}if(a&&i&&this._drained.has(i))return;if(i&&i!==this._target&&this._greeted.has(i)&&Of(o,yn)){this._greeted.delete(i),this._handshaken.add(i),this._postMessage(i,{operationId:yn,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),Lw(o)&&l||this._singleton&&Of(o,yn)){if(s&&l){const m=this._target;Promise.resolve().then(()=>this.usePort(s,!0,m))}const c=this._emitter.fireAsync(o.operationId||gc,o.operationId===void 0?r:o.data),u=o.result,d=o.error;u&&d&&Promise.resolve(c).then(m=>this._sendMessage(u,m),m=>this._sendMessage(d,m))}}),this._singleton=t,this._transport=_w({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(yn,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(yn))}),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(yn,void 0);return}this._inited=!1,this._postMessage(e,{operationId:yn,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:yn,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:yn,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=kw(e),o=r.subscribe(this._onTransportMessage);this._ports.set(n,{transport:r,subscription:o}),t&&(r.send({operationId:Nw,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:xw,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(gc,e,t)}sendAsync(e,t,n=!0){if(!n&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const r=Pf(),o=Pf();return new Promise((i,s)=>{const a=this.addDisposable(new Ee);a.addDisposable(this.onInit(l=>{try{this._postMessage(l,{operationId:e,data:t,result:r,error:o})}catch(c){a.dispose(),s(c);return}a.addDisposable(this._onMessage(r,c=>{i(c),a.dispose()})),a.addDisposable(this._onMessage(o,c=>{s(c),a.dispose()}))}))})}_onMessage(e,t,n=0){return this._emitter.addListener(e,t,n)}addListener(e,t,n){return t?this._onMessage(e,t,n):this._onMessage(gc,e)}addListenerAsyncPipe(e,t,n=0){return this._emitter.addListenerAsync(e,t,n)}addListenerAsync(e,t,n=0){return this._emitter.addListenerAsync(e,async(r,o)=>{const i=await t(r);return o?o(r):i},n)}isInited(){return this._inited}get inited(){return this._inited}onInit(e,t=!0,n=0){const r=this.addDisposable(new Ee);return this._inited&&this._target?t&&Promise.resolve().then(()=>{!this._inited||!this._target?r.addDisposable(this.onInit(e,t,n)):e(this._target)}):r.addDisposable(this._onMessage(yn,()=>{e(this._target)},n)),r}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}},Ow=/<\/?[a-zA-Z][a-zA-Z0-9:_.-]*(?:\s[^<>]*)?\/?>/g;function Pw(e){return e.replace(Ow,t=>/^<br\b/i.test(t)?" ":"")}var Iw={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"},Dw="fonts.googleapis.com",Bw=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},Hw=e=>{const t=Bw(String(e??""));return t?t.hostname===Dw&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},Pe={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_IMAGE_RESET:"sandbox_image_reset",SANDBOX_NATIVE_IMAGE_DROP_CLEAR:"sandbox_native-image-drop-clear",SANDBOX_EMAIL_SETTINGS_SET:"sandbox_email_settings_set",SANDBOX_BLOCK_SETTINGS_SET:"sandbox_block_settings_set",SANDBOX_ELEMENT_PARENT_GET:"sandbox_element_parent_get",SANDBOX_ELEMENT_PARENT_TABLE_GET:"sandbox_element_parent_table_get",SANDBOX_ELEMENT_PREV_GET:"sandbox_element_prev_get",SANDBOX_ELEMENT_NEXT_GET:"sandbox_element_next_get",SANDBOX_ELEMENT_REMOVE:"sandbox_element_remove",SANDBOX_ELEMENT_ACTIVE_RESET:"sandbox_element_active_reset",SANDBOX_ELEMENT_ACTIVE_SET:"sandbox_element_active_set",SANDBOX_ELEMENT_HOVER_SET:"sandbox_element_hover_set",SANDBOX_ELEMENT_IMG_LINK:"sandbox_element_img_link",SANDBOX_ELEMENT_TEXT:"sandbox_element_text",SANDBOX_EMAIL_CONTENT_GET:"sandbox_email_content_get",SANDBOX_SET_POSITION_TO_IMG:"sandbox_set_position_to_img",SANDBOX_SET_POSITION_TO_LINK:"sandbox_set_position_to_link",SANDBOX_ACCORDION_ADD_SECTION:"sandbox_accordion_add_section",SANDBOX_ACCORDION_REMOVE_SECTION:"sandbox_accordion_remove_section",APPLICATION_FOCUS_IN_IFRAME:"application_focus_in_iframe",APPLICATION_EMAIL_SETTINGS_SET:"application_email_settings_set",APPLICATION_BLOCK_SETTINGS_SET:"application_block_settings_set",APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",_APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",APPLICATION_ELEMENT_SETTINGS_CLOSE:"application_element_settings_close",APPLICATION_ACTION:"application_action",APPLICATION_EBLOCK_ADD:"application_eblock_add",SANDBOX_EBLOCK_SET_EM_BLOCK_ID:"sandbox_eblock_set_em_block_id",SANDBOX_GLOBAL_BLOCK_REPLACE:"sandbox_global_block_replace",APPLICATION_SCROLL_TO:"application_scroll-to",APPLICATION_SCROLL_BLOCK_SHOW:"application_scroll-block-show",APPLICATION_SCROLL_BLOCK_HIDE:"application_scroll-block-hide",APPLICATION_DISCUSS_SET_ID:"application_discuss_set_id",APPLICATION_DISCUSS_GET_COMMENT:"application_discuss_get_comment",APPLICATION_DISCUSS_NO_COMMENT:"application_discuss_no_comment",APPLICATION_DISCUSS_SAVE_TARGET:"application_discuss_save_target",APPLICATION_IFRAME_SET_HEIGHT:"application_iframe_set_height",APPLICATION_COMMON_STYLES_UPDATE:"application_commonStyles_update",APPLICATION_EMAIL_CONTENT_GET:"application_email_content_get",APPLICATION_OPEN_IMAGE_AI_POPUP:"application_open-image-ai-popup",APPLICATION_OPEN_IMAGE_UPLOAD_POPUP:"application_open-image-upload-popup",APPLICATION_OPEN_IMAGE_EDIT_POPUP:"application_open-image-edit-popup",APPLICATION_OPEN_IMAGE_GIF_POPUP:"application_open-image-gif-popup",APPLICATION_OPEN_IMAGE_STOCK_POPUP:"application_open-image-stock-popup",APPLICATION_CLOSE_IMAGE_EDIT_POPUP:"application_close-image-edit-popup",APPLICATION_NATIVE_IMAGE_DROP:"application_native-image-drop",APPLICATION_SUBJECT_UPDATE:"application_subject_update",APPLICATION_PREHEADER_UPDATE:"application_preheader_update",APPLICATION_DOMPARSER_ERROR:"application_domparser_error",APPLICATION_SYNC_DRIFT:"application_sync_drift",APPLICATION_UPDATE_ENTITY:"application_update_entity",APPLICATION_IFRAME_DRAG_EVENT:"application_iframe_drag_event",APPLICATION_HAS_AMP:"application_has_amp",APPLICATION_CANVAS_IMAGE_GET:"application_canvas_image_get",APPLICATION_PREVIEW_ALERT_SHOW:"application_preview_alert_show",APPLICATION_ATOM_INSERTED:"application_atom_inserted",APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW:"application_template_not_em_alert_show",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",SANDBOX_FLOATBLOCK_COPY:"sandbox_floatBlock_copy",SANDBOX_FLOATBLOCK_SWAP:"sandbox_floatBlock_swap",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:"SANDBOX_READY",SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_FLOATBLOCK_DIR:"sandbox_floatblock_dir",SANDBOX_SUBJECT_UPDATE:"sandbox_subject_update",SANDBOX_PREHEADER_UPDATE:"sandbox_preheader_update",SANDBOX_DRAG_EVENT:"sandbox_drag_event",SANDBOX_WHEEL:"sandbox_wheel",SANDBOX_TRANSLATIONS:"sandbox_send_translations",SANDBOX_SET_THEME_VARIABLES:"sandbox_send_theme_variables",SANDBOX_SET_PROJECT_FONTS:"sandbox_set_project_fonts",SANDBOX_CANVAS_IMAGE_CACHE_SETUP:"sandbox_canvas_image_cache_setup",SANDBOX_SET_ENTITY:"sandbox_set_entity",SANDBOX_INIT_START:"sandbox_init_start",SANDBOX_INITED:"sandbox_inited",SANDBOX_UPDATE_ENTITY:"sandbox_update_entity",RELOAD:"reload",SANDBOX_ADD_EXTENSIONS:"sandbox_add_extensions",SANDBOX_REMOVE_EXTENSIONS:"sandbox_remove_extensions",SANDBOX_ADD_SCRIPT:"sandbox_add_script",SANDBOX_IS_EMAIL_EMPTY:"sandbox_is_email_empty",SANDBOX_SWITCH_THEME:"sandbox_switch_theme",SANDBOX_CANVAS_HEALTH:"sandbox_canvas_health"},Fw=e=>({REORDER_ATOM:e("Reorder element"),CLONE_ATOM:e("Clone element"),REMOVE_ATOM:e("Remove element"),EDIT_ATOM:e("Edit element"),CHANGE_IMAGE:e("Change image"),CHANGE_IMAGE_EDIT:e("Edit"),CHANGE_IMAGE_STOCK:e("Stock"),CHANGE_IMAGE_CHANGETO:e("Upload"),CHANGE_IMAGE_GIF:e("GIF"),CHANGE_IMAGE_AI:e("Generate"),REORDER_BLOCK:e("Reorder block"),REORDER_BLOCK_UP:e("Move up"),REORDER_BLOCK_DOWN:e("Move down"),EDIT_BLOCK:e("Edit block"),CLONE_BLOCK:e("Clone block"),MERGE_BLOCK:e("Merge with the chosen block"),UNMERGE_BLOCK:e("Split blocks"),COPY_BLOCK_TO_CLIPBOARD:e("Copy block to clipboard"),PASTE_BLOCK_FROM_CLIPBOARD:e("Paste block from clipboard"),REMOVE_BLOCK:e("Remove block"),SAVE_TO_BLOCKS:e("Save to Blocks"),UPDATE_GLOBAL_BLOCK_IN_TEMPLATES:e("Push block update to all templates"),ADD_BLOCK:e("Add block"),ADD_EMPTY_BLOCK:e("Add an empty block"),ADD_SAVED_BLOCK:e("Add a saved block"),ADD_COMMON_BLOCK:e("Add a common block"),ADD_TEMPLATE_BLOCK:e("Add a template block"),ADD_SEARCH_BLOCK:e("Search a block"),REORDER_GROUP:e("Reorder group"),EDIT_GROUP:e("Edit group"),CLONE_GROUP:e("Clone group"),REMOVE_GROUP:e("Remove group"),ADD_GROUP:e("Add group"),LINK:e("link"),TABLE_COLUMN:e("cell"),TABLE:e("table"),FLOAT_BLOCK:e("column"),CONTAINER:e("container"),PICTURE:e("picture"),CAROUSEL:e("carousel"),ACCORDION:e("accordion"),SOCIAL:e("Social media"),VERTICAL_INDENT:e("indent"),TEXT:e("text"),BUTTON:e("button"),VAR:e("variable"),STRUCTURE:e("block"),EMAIL:e("email"),GROUP:e("group"),TYPOGRAF:e("Typograf"),COUNTDOWN:e("countdown"),ELEMENT:e("element"),VIDEO:e("video"),ELEMENT_PATH_LINK:e("Link"),ELEMENT_PATH_BLOCK:e("Block"),ELEMENT_PATH_ATOM:e("Element"),ELEMENT_PATH_TD:e("Cell"),ELEMENT_PATH_TABLE:e("Table"),ELEMENT_PATH_FLOATBLOCK:e("Column"),ELEMENT_PATH_TEXT:e("Text"),ELEMENT_PATH_DIV:e("Container"),ELEMENT_PATH_GROUP:e("Group"),ELEMENT_PATH_EMAIL:e("Email"),ELEMENT_PATH_IMG:e("Picture"),ELEMENT_PATH_VINDENT:e("Indent"),ELEMENT_PATH_BUTTON:e("Button"),ELEMENT_PATH_CAROUSEL:e("Carousel"),ELEMENT_PATH_ACCORDION:e("Accordion"),ELEMENT_PATH_SOCIAL:e("Social media"),ELEMENT_PATH_SECTION:e("Section"),TINYMCE_CHANGECASE:e("Case Change"),TINYMCE_UPPERCASE:e("Uppercase"),TINYMCE_LOWERCASE:e("Lowercase"),PASTE_HERE:e("Drop here"),INSERT_COLUMN_BEFORE_TABLE:e("Insert column before"),INSERT_COLUMN_AFTER_TABLE:e("Insert column after"),INSERT_ROW_BEFORE_TABLE:e("Insert row before"),INSERT_ROW_AFTER_TABLE:e("Insert row after"),MERGE_RIGHT_CELL_TABLE:e("Merge right cell"),MERGE_LEFT_CELL_TABLE:e("Merge left cell"),MERGE_TOP_CELL_TABLE:e("Merge top cell"),MERGE_BOTTOM_CELL_TABLE:e("Merge bottom cell"),SPLIT_CELL_TABLE:e("Split cell"),REMOVE_COLUMN_TABLE:e("Remove column"),REMOVE_ROW_TABLE:e("Remove row"),DROP_BLOCK_HINT:e("Click or drag a block")}),Z=new Rw(window.parent,!0),Fs,ti,If=Math.random().toString(36).slice(2,8),$w=0,$s;function Df(e,t){const n=Fs;Fs=e;try{return t()}finally{Fs=n}}function Ws(e,t){const n=ti;ti=e;try{return t()}finally{ti=n}}function Ww(){return ti}function qw(){try{return Fs?.()}catch{return}}function zw(){return $s||($s=`${If}:${++$w}`,Promise.resolve().then(()=>{$s=void 0})),$s}function nt(e,t){const n=qw();return Z.send(Pe.APPLICATION_DOMPARSER_ERROR,{message:e,stack:new Error().stack,...n?{mutation:n}:{},source:ti??"other",batch:zw(),instance:If}),t}function bc(e,t){let n=t.children,r=e(t)||0;if(r!=0||!n)return r!==1;for(const o of n)if(bc(e,o)===!1)return!1;return!0}function Bf(e,t,n=[t]){for(;t=t.parent;)if(e(n=[t,...n])===!1)return!1;return!0}function Vw(e,t){return Bf(([n,r])=>{const{children:o}=n;if(o){for(let i=o.indexOf(r)+1,s=o.length;i<s;i++)if(bc(e,o[i])===!1)return!1}},t)}function pr(e,t,n){bc(r=>{r.start+=t,r.startTagEnd!==void 0&&(r.startTagEnd+=t),r.end+=t,r.endTagStart!==void 0&&(r.endTagStart+=t)},e),n&&(Bf(([r])=>{r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e),Vw(r=>{r.start+=n,r.startTagEnd!==void 0&&(r.startTagEnd+=n),r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e))}var Uw=e=>e.type===$.HTML?e.start-1:e.start,jw=e=>e.type===$.HTML?e.end+1:e.end;function Gw(e,t){const{start:n,end:r}=e;let o=t.findNodeAt(n);for(;o&&(Uw(o)>=n||jw(o)<=r||o.start===o.startTagEnd);)o=o.parent;return o}function Xw(e){return{start:e.start+(e.tag?.length||0)+1,end:(e.startTagEnd!==void 0?e.startTagEnd:e.start)-1}}function Zn(e){let t=e;do t=Yw(t);while(t&&t.type===$.HTML&&!t.content);return t}function Yw(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n<0)return nt("parent and child not sync",e);if(n<t.length-1)return t[n+1]||null}return null}var hr=class{constructor(e,t,n,r){L(this,"originalStart",void 0),L(this,"originalLength",void 0),L(this,"modifiedStart",void 0),L(this,"modifiedLength",void 0),this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}};function Hf(e,t){return(t<<5)-t+e|0}function Kw(e,t){t=Hf(149417,t);for(let n=0,r=e.length;n<r;n++)t=Hf(e.charCodeAt(n),t);return t}var Ff=class{constructor(e){L(this,"source",void 0),this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=e.charCodeAt(n);return t}};function $f(e,t,n){return new Zw(new Ff(e),new Ff(t)).ComputeDiff(n).changes}var Yr=class{static Assert(e,t){if(!e)throw new Error(t)}},Kr=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]}},Wf=class{constructor(){L(this,"m_changes",void 0),L(this,"m_originalStart",void 0),L(this,"m_modifiedStart",void 0),L(this,"m_originalCount",void 0),L(this,"m_modifiedCount",void 0),this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new hr(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}},Zw=class Go{constructor(t,n,r=null){L(this,"ContinueProcessingPredicate",void 0),L(this,"_originalSequence",void 0),L(this,"_modifiedSequence",void 0),L(this,"_hasStrings",void 0),L(this,"_originalStringElements",void 0),L(this,"_originalElementsOrHash",void 0),L(this,"_modifiedStringElements",void 0),L(this,"_modifiedElementsOrHash",void 0),L(this,"m_forwardHistory",void 0),L(this,"m_reverseHistory",void 0),this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;const[o,i,s]=Go._getElements(t),[a,l,c]=Go._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(Go._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,i=n.length;o<i;o++)r[o]=Kw(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)?Go._getStrictElement(this._originalSequence,t)===Go._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?(Yr.Assert(t===n+1,"originalStart should only be one more than originalEnd"),c=[new hr(t,0,r,o-r+1)]):t<=n?(Yr.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[new hr(t,n-t+1,r,0)]):(Yr.Assert(t===n+1,"originalStart should only be one more than originalEnd"),Yr.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 hr(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,i,s,a,l,c,u,d,m,p,f,h,y,v,A){let k=null,S=null,b=new Wf,E=n,C=r,g=p[0]-y[0]-o,w=-1073741824,T=this.m_forwardHistory.length-1;do{const _=g+t;_===E||_<C&&c[_-1]<c[_+1]?(d=c[_+1],f=d-g-o,d<w&&b.MarkNextChange(),w=d,b.AddModifiedElement(d+1,f),g=_+1-t):(d=c[_-1]+1,f=d-g-o,d<w&&b.MarkNextChange(),w=d-1,b.AddOriginalElement(d,f+1),g=_-1-t),T>=0&&(c=this.m_forwardHistory[T],t=c[0],E=1,C=c.length-1)}while(--T>=-1);if(k=b.getReverseChanges(),A[0]){let _=p[0]+1,M=y[0]+1;if(k!==null&&k.length>0){const N=k[k.length-1];_=Math.max(_,N.getOriginalEnd()),M=Math.max(M,N.getModifiedEnd())}S=[new hr(_,m-_+1,M,h-M+1)]}else{b=new Wf,E=s,C=a,g=p[0]-y[0]-l,w=1073741824,T=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const _=g+i;_===E||_<C&&u[_-1]>=u[_+1]?(d=u[_+1]-1,f=d-g-l,d>w&&b.MarkNextChange(),w=d+1,b.AddOriginalElement(d+1,f+1),g=_+1-i):(d=u[_-1],f=d-g-l,d>w&&b.MarkNextChange(),w=d,b.AddModifiedElement(d+1,f+1),g=_-1-i),T>=0&&(u=this.m_reverseHistory[T],i=u[0],E=1,C=u.length-1)}while(--T>=-1);S=b.getChanges()}return this.ConcatenateChanges(k,S)}ComputeRecursionPoint(t,n,r,o,i,s,a){let l=0,c=0,u=0,d=0,m=0,p=0;t--,r--,i[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const f=n-t+(o-r),h=f+1,y=new Int32Array(h),v=new Int32Array(h),A=o-r,k=n-t,S=t-r,b=n-o,E=(k-A)%2===0;y[A]=t,v[k]=n,a[0]=!1;for(let C=1;C<=f/2+1;C++){let g=0,w=0;if(C>100)return null;u=this.ClipDiagonalBound(A-C,C,A,h),d=this.ClipDiagonalBound(A+C,C,A,h);for(let _=u;_<=d;_+=2){_===u||_<d&&y[_-1]<y[_+1]?l=y[_+1]:l=y[_-1]+1,c=l-(_-A)-S;const M=l;for(;l<n&&c<o&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(y[_]=l,l+c>g+w&&(g=l,w=c),!E&&Math.abs(_-k)<=C-1&&l>=v[_])return i[0]=l,s[0]=c,M<=v[_]&&C<=1448?this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,l,n,i,c,o,s,E,a):null}const T=(g-t+(w-r)-C)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(g,T))return a[0]=!0,i[0]=g,s[0]=w,T>0&&C<=1448?this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,l,n,i,c,o,s,E,a):(t++,r++,[new hr(t,n-t+1,r,o-r+1)]);m=this.ClipDiagonalBound(k-C,C,k,h),p=this.ClipDiagonalBound(k+C,C,k,h);for(let _=m;_<=p;_+=2){_===m||_<p&&v[_-1]>=v[_+1]?l=v[_+1]-1:l=v[_-1],c=l-(_-k)-b;const M=l;for(;l>t&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(v[_]=l,E&&Math.abs(_-A)<=C&&l<=y[_])return i[0]=l,s[0]=c,M>=y[_]&&C<=1448?this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,l,n,i,c,o,s,E,a):null}if(C<=1447){let _=new Int32Array(d-u+2);_[0]=A-u+1,Kr.Copy2(y,u,_,1,d-u+1),this.m_forwardHistory.push(_),_=new Int32Array(p-m+2),_[0]=k-m+1,Kr.Copy2(v,m,_,1,p-m+1),this.m_reverseHistory.push(_)}}return this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,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 m=r.originalStart-d,p=r.modifiedStart-d;if(m<o||p<i||s&&!this.OriginalElementsAreEqual(m,m+r.originalLength)||a&&!this.ModifiedElementsAreEqual(p,p+r.modifiedLength))break;const f=(m===o&&p===i?5:0)+this._boundaryScore(m,r.originalLength,p,r.modifiedLength);f>c&&(c=f,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,m=d-u;if(s<5&&c<20&&m<20){const p=this._findBetterContiguousSequence(a,c,u,m,s);if(p){const[f,h]=p;(f!==o.originalStart+o.originalLength||h!==o.modifiedStart+o.modifiedLength)&&(o.originalLength=f-o.originalStart,o.modifiedLength=h-o.modifiedStart,i.originalStart=f+s,i.modifiedStart=h+s,i.originalLength=l-i.originalStart,i.modifiedLength=d-i.modifiedStart)}}}return t}_findBetterContiguousSequence(t,n,r,o,i){if(n<i||o<i)return null;const s=t+n-i+1,a=r+o-i+1;let l=0,c=0,u=0;for(let d=t;d<s;d++)for(let m=r;m<a;m++){const p=this._contiguousSequenceScore(d,m,i);p>0&&p>l&&(l=p,c=d,u=m)}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 Kr.Copy(t,0,o,0,t.length-1),o[t.length-1]=r[0],Kr.Copy(n,1,o,t.length,n.length-1),o}else{const o=new Array(t.length+n.length);return Kr.Copy(t,0,o,0,t.length),Kr.Copy(n,0,o,t.length,n.length),o}}ChangesOverlap(t,n,r){if(Yr.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),Yr.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 hr(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 qs(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var zt=class{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,r){L(this,"oldPosition",void 0),L(this,"oldText",void 0),L(this,"newPosition",void 0),L(this,"newText",void 0),this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${qs(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${qs(this.oldText)}")`:`(replace@${this.oldPosition} "${qs(this.oldText)}" with "${qs(this.newText)}")`}};function tn(e,t){return e===null||e.length===0?t:new Qw(e,t).compress()}var Qw=class Xn{constructor(t,n){L(this,"_prevEdits",void 0),L(this,"_currEdits",void 0),L(this,"_result",void 0),L(this,"_resultLen",void 0),L(this,"_prevLen",void 0),L(this,"_prevDeltaOffset",void 0),L(this,"_currLen",void 0),L(this,"_currDeltaOffset",void 0),this._prevEdits=t,this._currEdits=n,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let t=0,n=0,r=this._getPrev(t),o=this._getCurr(n);for(;t<this._prevLen||n<this._currLen;){if(r===null){if(o===null)break;this._acceptCurr(o),o=this._getCurr(++n);continue}if(o===null){this._acceptPrev(r),r=this._getPrev(++t);continue}if(o.oldEnd<=r.newPosition){this._acceptCurr(o),o=this._getCurr(++n);continue}if(r.newEnd<=o.oldPosition){this._acceptPrev(r),r=this._getPrev(++t);continue}if(o.oldPosition<r.newPosition){const[l,c]=Xn._splitCurr(o,r.newPosition-o.oldPosition);this._acceptCurr(l),o=c;continue}if(r.newPosition<o.oldPosition){const[l,c]=Xn._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]=Xn._splitPrev(r,o.oldLength);s=l,a=o,r=c,o=this._getCurr(++n)}else{const[l,c]=Xn._splitCurr(o,r.newLength);s=r,a=l,r=this._getPrev(++t),o=c}this._result[this._resultLen++]=new zt(s.oldPosition,s.oldText,a.newPosition,a.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=a.newLength-a.oldLength}const i=Xn._merge(this._result);return Xn._removeNoOps(i)}_acceptCurr(t){this._result[this._resultLen++]=Xn._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++]=Xn._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 zt(n.oldPosition-t,n.oldText,n.newPosition,n.newText)}static _rebasePrev(t,n){return new zt(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 zt(t.oldPosition,t.oldText,t.newPosition,r),new zt(t.oldEnd,"",t.newPosition+n,o)]}static _splitCurr(t,n){const r=t.oldText.substr(0,n),o=t.oldText.substr(n);return[new zt(t.oldPosition,r,t.newPosition,t.newText),new zt(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 zt(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 qf(e){return new zt(e.newPosition,e.newText,e.oldPosition,e.oldText)}function Bn(e){return e.map(qf)}function Jw(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 zf(e,t,n){if(!t.length)return[...e];const r=[];let o=0;for(const i of e){const s=Jw({start:i.oldPosition,end:i.oldEnd},t,n);if(!s)return null;r.push(new zt(s.start,i.oldText,s.start+o,i.newText)),o+=i.newLength-i.oldLength}return r}function Vf(e,t,n=0){const r=e.range;return new zt(e.range.start,typeof t=="string"?t.substring(r.start,r.end):t.getText(r),r.start+n,e.text)}function Zr(e,t){let n=0;return e.map(({text:r,range:{start:o,end:i}})=>{let s=n;return n+=r.length-(i-o),Vf({text:r,range:{start:o,end:i}},t,s)})}function e0(e){return{range:{start:e.oldPosition,end:e.oldEnd},text:e.newText}}function gr(e){return e.map(t=>e0(t))}function t0(e,t=yc(e)){const n=e.getLength(),{start:r,end:o}=t;return r>n||o<0?null:{start:r,end:o}}var pq=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function n0(e,{start:t,end:n}){return{start:t,end:n+(e.newLength-e.oldLength)}}function yc(e){return{start:0,end:e.getLength()}}function r0(e,t,n){return`${e.substring(0,n.start)}${t}${e.substring(n.end)}`}function ni(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 o0(e,t){return t=zs(t).sort(({range:n},{range:r})=>n.start-r.start),ni(e,t)}function ri(e,t){return e>=t.start&&e<=t.end}function zs(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(ri(i.start,l)&&ri(i.start,l))c=l;else if(ri(l.start,i))ri(l.end,i)?c=i:c={start:i.start,end:l.end};else if(ri(l.end,i))c={start:l.start,end:i.end};else continue;const u=o.text;let d=l.start-i.start+u.length,m=l.end-i.start+u.length;const p=r0(u,a.text,{start:d,end:m});e[r]=o={range:i=c,text:p},e.splice(s--,1),n--}}return e}function i0(e,t){if(e.length<=1)return e[0]||null;e=zs(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:ni(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 s0(e,t){const n=Bn(e),r=i0(gr(n),t);if(r){const o=Vf(r,t);return qf(o)}return null}function a0(e,{range:t,text:n}){const r=e.getText(t);return $f(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 l0({oldText:e,newText:t,oldPosition:n,newPosition:r}){return $f(e,t,!0).map(o=>new zt(n+o.originalStart,e.substring(o.originalStart,o.originalStart+o.originalLength),r+o.modifiedStart,t.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)))}var c0=class{constructor(e,t){L(this,"index",void 0),L(this,"values",void 0),L(this,"type","insert"),this.index=e,this.values=t}},u0=class{constructor(e,t){L(this,"index",void 0),L(this,"howMany",void 0),L(this,"type","remove"),this.index=e,this.howMany=t}},d0=class{constructor(e,t,n){L(this,"from",void 0),L(this,"to",void 0),L(this,"howMany",void 0),L(this,"type","move"),this.from=e,this.to=t,this.howMany=n}};function m0(e,t){return e===t}function f0(e,t,n=m0){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,m=u,p=0;do s[l++]=a[u++]=!0,p++;while(l<r&&u<o&&n(e[l],t[u])&&!a[u]);i.push(new d0(d,m,p)),l--;break}var f=[];for(l=0;l<r;){if(s[l]){l++;continue}for(var h=l,p=0;l<r&&!s[l++];)p++;f.push(new u0(h,p))}for(var y=[],u=0;u<o;){if(a[u]){u++;continue}for(var h=u,p=0;u<o&&!a[u++];)p++;var v=t.slice(h,h+p);y.push(new c0(h,v))}var A=y.length,k=f.length,S=i.length,b,E,C=0;for(b=0;b<k;b++){var g=f[b];for(g.index-=C,C+=g.howMany,E=0;E<S;E++){var w=i[E];w.from>=g.index&&(w.from-=g.howMany)}}for(b=A;b--;){var T=y[b],p=T.values.length;for(E=S;E--;){var w=i[E];w.to>=T.index&&(w.to-=p)}}for(b=S;b-- >1;){var w=i[b];if(w.to!==w.from)for(E=b;E--;){var _=i[E];_.to>=w.to&&(_.to-=w.howMany),_.to>=w.from&&(_.to+=w.howMany)}}var M=[];for(b=0;b<S;b++){var w=i[b];if(w.to!==w.from)for(M.push(w),E=b+1;E<S;E++){var N=i[E];N.from>=w.from&&(N.from-=w.howMany),N.from>=w.to&&(N.from+=w.howMany)}}return[...f,...M,...y]}var Uf=class{constructor(){L(this,"_byKey",new Map),L(this,"_byValue",new Map)}set(e,t){this._byKey.set(e,t),this._byValue.set(t,e)}getByKey(e){return this._byKey.get(e)}getByValue(e){return this._byValue.get(e)}delete(e){const t=this._byKey.has(e);if(t){const n=this._byKey.get(e);this._byKey.delete(e),this._byValue.delete(n)}return t}deleteByValue(e){const t=this._byValue.has(e);if(t){const n=this._byValue.get(e);this._byValue.delete(e),this._byKey.delete(n)}return t}get size(){return this._byKey.size}},ue;(function(e){function t(d,m,p){return{type:"Add",node:m,nextSibling:p,parent:d}}e.add=t;function n(d){return{type:"Remove",node:d}}e.remove=n;function r(d,m,p){return{type:"Attribute",node:d,name:m,value:p}}e.attribute=r;function o(d,m,p){return p?{type:"Update",prev:d,next:m,soft:p}:{type:"Update",prev:d,next:m}}e.update=o;function i(d,m,p,f){return[{type:"Remove",node:d},{type:"Add",node:p,nextSibling:f,parent:m,replaces:d}]}e.recreate=i;function s(d,m,p){return{type:"Move",node:m,nextSibling:p,parent:d}}e.move=s;function a(d,m){return{type:"Set",node:d,data:m}}e.set=a;function l(d,m,p){return{type:"ClassList",node:d,addedClasses:m,removedClasses:p}}e.classList=l;function c(d,m){return{type:"Style",node:d,value:m}}e.style=c;function u(d,m){return{type:"Hidden",node:d,value:m}}e.hidden=u})(ue||(ue={}));function jf(e,t){return e.push(t),{dispose:()=>{const n=e.indexOf(t);n!==-1&&e.splice(n,1)}}}var Gf=[],Xf=[];function p0(e){return jf(Gf,e)}function vc(e){return e?Gf.some(t=>t(e)):!1}function h0(e){return jf(Xf,e)}function g0(e){return Xf.some(t=>t(e))}function b0(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 m=o[d];l.push(ue.attribute(t,m,void 0))}break}else r[u]!==n[u]&&l.push(ue.attribute(t,u,r[u]))}for(;c<a;c++){const u=i[c];l.push(ue.attribute(t,u,r[u]))}return l}function y0(e){let t=[];const n=e.children.filter(o=>o.type!==$.HTML||!!o.content);let r;for(let o=n.length-1;o>=0;o--)t.push(ue.add(e,n[o],r)),r=n[o];return t}function v0(e){return ue.remove(e)}var E0=new Set(["head","body","html"]),S0=e=>e.type===$.ROOT||e.type===$.DOCTYPE||e.type===$.ELEMENT&&e.tag&&E0.has(e.tag.toLowerCase());function Yf(e){const t=new Uf,n=Object.create(null);for(const r of e){const o=String(r.type===$.ELEMENT?r.tag:r.type)+(!S0(r)&&r.start===r.end?"_hidden":"");let i="";r.type===$.ELEMENT&&r.attributes?.id?i=`id_${r.attributes.id}`:i=n[o]=(n[o]||0)+1,t.set(`${o}_${i}`,r)}return t}function Ec(e,t,n=!1,r=mc()){let o=[];const i=Yf(e.children),s=Yf(t.children);for(let d=e.children.length-1;d>=0;d--){const m=e.children[d];if(m.type===$.ELEMENT&&m.start===m.end){const p=i.getByValue(m);if(!s.getByKey(p)){let f=!1;for(let h=d+1;d<e.children.length;d++)if(e.children[h]){const y=i.getByValue(m),v=s.getByKey(y);if(v){const A=v.start,k=m.clone();t.children.splice(t.children.indexOf(v),0,k),pr(k,A-m.start),k.parent=t,s.set(p,k),f=!0;break}}if(!f){const h=t.endTagStart===void 0?t.end:t.endTagStart,y=m.clone();t.children.push(y),s.set(p,y),pr(y,h-m.start),y.parent=t}}}}const a=e.children.filter(d=>d.type!==$.HTML||!!d.content),l=t.children.filter(d=>d.type!==$.HTML||!!d.content),c=f0(a,l,(d,m)=>i.getByValue(d)===s.getByValue(m)),u=new Set;for(const d of c)switch(d.type){case"insert":{const m=d.index;let p=a[m];for(const f of d.values.reverse())a.splice(m,0,f),u.add(f),o.push(ue.add(t,f,p)),p=f;break}case"remove":{const m=a.splice(d.index,d.howMany);for(const p of m)o.push(ue.remove(p));break}case"move":{const m=a.splice(d.from,d.howMany);let p=a[d.to];a.splice(d.to,0,...m);for(const f of m.reverse()){const h=i.getByValue(f),y=s.getByKey(h);u.add(y),o=[...o,...wc(f,y,n,r)],o.push(ue.move(t,y,p)),p=f}break}}l.length!==a.length&&nt("error while sync");for(let d=l.length-1;d>=0;d--){const m=l[d];u.has(m)||(o=[...o,...wc(a[d],m,n,r)])}return o}function Sc(e){return e.type===$.ELEMENT&&vc(e.tag)}function wc(e,t,n=!1,r=mc()){if(e.type===t.type&&!(e.isDirty||t.isDirty)){if(Sc(e)&&e.tag===t.tag){if(fr(e,!1,r)===fr(t,!1,r))return[ue.update(e,t,n),...Ec(e,t,!0,r)]}else if((e.type===$.ELEMENT||e.type===$.ROOT)&&e.tag===t.tag)return[ue.update(e,t,n),...b0(e,t),...Ec(e,t,n,r)];if(e.type===$.HTML||e.type===$.COMMENT)return e.content===t.content?[ue.update(e,t,n)]:[ue.update(e,t,n),ue.set(t,t.content)]}return!e.parent||!t.parent?nt("cannot replace document",[]):Sc(e)&&e.tag===t.tag?ue.recreate(e,t.parent,t,Zn(t)||void 0):[ue.remove(e),ue.add(t.parent,t,Zn(t)||void 0)]}var Qr="FROM_DOM",Jr="FROM_REMOTE",w0=/<\/.*>/gi,C0=class extends Ee{constructor(e,t){super(),L(this,"_baseDocument",void 0),L(this,"_createRoot",void 0),L(this,"_beforeTextChangeEmitter",this.addDisposable(new Me)),L(this,"_onTextChangeEmitter",this.addDisposable(new Me)),L(this,"_onMutateEmitter",this.addDisposable(new Me)),L(this,"_beforeRefreshEmitter",this.addDisposable(new Me)),L(this,"_onRefreshEmitter",this.addDisposable(new Me)),L(this,"_root",new wt(0,0,[])),L(this,"_applyingMutation",void 0),L(this,"beforeTextChange",this._beforeTextChangeEmitter.event),L(this,"beforeRefresh",this._beforeRefreshEmitter.event),L(this,"onTextChange",this._onTextChangeEmitter.event),L(this,"onRefresh",this._onRefreshEmitter.event),L(this,"onMutate",this._onMutateEmitter.event),this._baseDocument=e,this._createRoot=t,this._baseDocument.onChanged(this._onTextChange.bind(this));const n=this._root=new wt(0,0,[]);n.type=$.ROOT}get root(){return this._root}contains(e){return e.root===this.root}isAttached(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t===this.root}get applyingMutation(){return this._applyingMutation}initialize(e,t){const n=this._root;this._beforeRefreshEmitter.fire();let{roots:r}=Xr(e),o=this._root=this._createRoot?this._createRoot(r,e):new wt(0,e.length,r);o.type=$.ROOT,this._createRoot||r.forEach(i=>i.parent=o),t||this._onRefreshEmitter.fire(n?Ec(n,o):y0(o))}_onTextChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=s0(t,this._baseDocument.getText());if(n)try{this._beforeTextChangeEmitter.fire(),Ws("text",()=>this.replaceWithHtml(n,Jr))}finally{this._onTextChangeEmitter.fire()}}}insertBefore(e,t,n,r){if(t.parent){if(t.parent===e&&Zn(t)===n)return t;this.remove(t,r)}const o=this.contains(e),i=fc(t),s=e.children,a=n?s.indexOf(n):s.length;if(a<0)return nt("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,pr(t,l-t.start,i.length),o&&(r!=="FROM_DOM"&&this._onMutateEmitter.fire([ue.add(e,t,n||void 0)]),r!=="FROM_REMOTE"&&this._baseDocument.applyEdits(r,[{text:i,range:{start:l,end:l}}])),t}getContext(e){return e.closest(t=>vc(t.tag))}replaceWithHtml(e,t){const n=this._baseDocument,r=c=>{const u=this.getContext(c);if(u)return u.isDirty=!0,Promise.resolve().then(()=>{u.isDirty=!1}),!1;if(c.type!==$.HTML){if(!c.closed)return!1}else return!c.content||!w0.test(c.content);return!0};if(!this._root)return this.initialize(n.getText());let o={start:e.oldPosition,end:e.oldEnd},i=Gw(o,this._root);if(!i)return this.initialize(n.getText());let s,a,l;do{const c=n0(e,i);s=this._baseDocument.getText(c),[a,...l]=Xr(s).roots}while((!a||l.length||!r(i)||!r(a)||a.end-a.start!==s.length)&&(i=i.parent));if(!i||!i.parent)return this.initialize(n.getText());this.replaceChild(i.parent,{node:a,text:s},i,t)}replaceChild(e,t,n,r){const{text:o,node:i}=t,s=e.children,a=s.indexOf(n);if(a<0)return nt("referenced node is not a child of parent node",i);s.splice(a,1,i);const l=o.length-(n.end-n.start);return i.parent=e,pr(i,n.start-i.start,l),this._baseDocument.getText(i)!==o?(nt("Error while sync"),i):(r!=="FROM_DOM"&&this._onMutateEmitter.fire(wc(n,i)),n.parent=void 0,i)}remove(e,t){const n=this.contains(e),r=e.parent;if(!r)return nt("node is not in tree");const o=r.children,i=o.indexOf(e);if(i<0)return nt("referenced node is not a child of parent node");const s=e.end-e.start;pr(e,0,-s),o.splice(i,1),n&&(t!=="FROM_DOM"&&this._onMutateEmitter.fire([v0(e)]),t!=="FROM_REMOTE"&&this._baseDocument.applyEdits(t,[{text:"",range:{start:e.start,end:e.end}}])),e.parent=void 0}setAttribute(e,t,n,r){const o=this.contains(e),i=e.attributes||(e.attributes=Object.create(null));if(typeof n=="string"?i[t]=n:delete i[t],e.start===e.startTagEnd)return;const s=_f(e),a=e.startTagEnd===void 0?0:e.startTagEnd-e.start-(e.tag?.length||0)-2,l=Xw(e),c=s.length-a,u=e.start;pr(e,c,c),e.start=u,o&&this._baseDocument.applyEdits(r,[{text:s,range:l}])}setContent(e,t,n){const r=this.contains(e),o=e.start,i=e.end;e.content=t;const s=e.end-e.start;if(!s)return;const a=fc(e,o),l=a.length-s;pr(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=Zn(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=Xr(t).roots;i.length!==1&&nt("Error while replacing with string"),t=i[0]}const r=e.children;this.replaceWith(e,[t],n);let o=null;for(let i=r.length-1;i>=0;i--){let s=r[i];this.insertBefore(t,s,o,n),o=s}return t}setHidden(e,t,n){t?e.parent&&this.remove(e,n):this.replaceWith(e,[...e.children],n)}applyMutations(e){this._baseDocument.beginUpdate();try{for(const t of e)switch(this._applyingMutation=t,t.type){case"Add":this.insertBefore(t.parent||this.root,t.node,t.nextSibling||null,Qr);break;case"Remove":this.remove(t.node,Qr);break;case"Set":this.setContent(t.node,t.data,Qr);break;case"Hidden":this.setHidden(t.node,t.value,Qr);break;case"Attribute":this.setAttribute(t.node,t.name,t.value===void 0?null:t.value,Qr)}}finally{this._applyingMutation=void 0,this._baseDocument.endUpdate()}}getNodeByPosition(e){return this._root?.findNodeAt(e)}};function Cc(e){if(e){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",e),t.firstChild||document.createTextNode("")}else return document.createTextNode("")}var eo,br;function A0(e){const t=eo;return eo=e,()=>{eo===e&&(eo=t)}}function T0(e){const t=br;return br=e,()=>{br===e&&(br=t)}}function Kf(e,t,n){return eo?eo(e,t,n):n}function _0(){return br!==void 0}function Zf(e,t,n){return br?br(e,t,n):n}var Ac;function k0(){return Ac||(Ac=document.implementation.createHTMLDocument("")),Ac}function L0(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 N0=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),x0=new Set(["script","style","xmp"]);function M0(e,t){return!(t&&x0.has(t.toLowerCase())||N0.has(e.toLowerCase()))}var R0=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1},O0=new Set(["head","body"]);function Qf(e,t,n){let r=e.tagName.toLowerCase();r==="html"&&(r="div");const o=`<${r} ${t}="${n}"/>`,i=k0(),s=O0.has(r)?L0(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 Hn(e,t,n){try{M0(t,e.tagName)&&!R0(n)?e.setAttribute(t,n):Qf(e,t,n)}catch{Qf(e,t,n)}}function Vs(e,t=!0){const n=e.content;switch(e.type){case $.ROOT:{const r=document.implementation.createHTMLDocument();for(const o of[...r.childNodes])r.removeChild(o);if(t)for(const o of e.children)r.appendChild(Vs(o));return r}case $.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case $.COMMENT:return document.createComment(n||"");case $.ELEMENT:if(e.tag){const r=document.createElement(e.tag);if(Object.defineProperty(r,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const o of e.attributeNames){const i=e.attributes[o];try{const s=Kf(r,o,typeof i=="string"?i:"");s!==null&&Hn(r,o,s)}catch{}}if(t)for(const o of e.children)r.appendChild(Vs(o));return r}return document.createTextNode("<");case $.HTML:return Cc(n||"");default:throw new Error("unsupported node")}}function Te(e){return Xr(e).roots.map(t=>Vs(t))}function Qn(e,t){e.replaceChildren(...Te(t))}function qe(e,t,n){const r=Te(n);switch(t){case"afterend":e.after(...r);break;case"afterbegin":e.prepend(...r);break;case"beforeend":e.append(...r);break;case"beforebegin":e.before(...r)}}var P0=4,I0=3,D0=80,Jf={Add:"insertBefore",Remove:"remove",Set:"set",Hidden:"hidden",Attribute:"attribute",Update:"update",Move:"move"},B0={[$.HTML]:"text",[$.ELEMENT]:"element",[$.ROOT]:"root",[$.COMMENT]:"comment",[$.DOCTYPE]:"doctype",[$.ADVANCED]:"advanced"},H0=new Set(["head","body"]);function Tc(e){return(e??"").replace(/^(['"])(.*)\1$/s,"$2")}function ep(e,t,n,r){const o=n.split(/\s+/).filter(Boolean).slice(0,I0);return(e+(t?`#${t}`:"")+o.map(i=>`.${i}`).join("")+(r?`[em=${r}]`:"")).slice(0,D0)}function F0(e){if(!e.tag)return`#${e.type}`;const t=e.attributes??{};return ep(e.tag,Tc(t.id),Tc(t.class),Tc(t.em))}function tp(e){return e instanceof Element?ep(e.localName,e.id,e.getAttribute("class")??"",e.getAttribute("em")??""):e.nodeName.toLowerCase()}function _c(e,t,n){const r=[];let o=e;for(;o&&r.length<P0;)r.unshift(n(o)),o=t(o);return r.join(" > ")}function $0(e){let t,n=e;for(;;){const r=n.tag?.toLowerCase();if(!t&&r&&H0.has(r)?t=r:r==="html"&&(t??(t="html")),!n.parent)break;n=n.parent}return n.type!==$.ROOT?"outside":t??"top"}function kc(e,t,n){const r=t(e);return{path:_c(e,o=>o.parent,F0),inTree:n(e),inDom:!!r?.isConnected,...r?{domPath:_c(r,o=>o.parentNode,tp)}:{},inMap:!!r,hasParent:!!e.parent,kind:B0[e.type]??String(e.type),root:$0(e)}}function np(e,t,n){if(!e)return;const r=i=>kc(i,t,n);if(e.type==="Update")return{type:Jf.Update,node:r(e.prev),...e.next.parent?{parent:r(e.next.parent)}:{}};if(!("node"in e))return;const o={type:Jf[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 Lc(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t.type===$.ROOT}function W0(e,t,n,r){const o=s=>kc(s,a=>r.getByNode(a),Lc),i=_c(e,s=>s.parentNode,tp);return{type:"insertBefore",node:{path:i,inTree:!1,inDom:e.isConnected,domPath:i},parent:o(t),reference:o(n)}}function q0(e,t){const n=r=>kc(r,o=>t.getByNode(o),Lc);return{type:"remove",node:n(e),...e.parent?{parent:n(e.parent)}:{}}}function z0(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function rp(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var op=Object.create(null);function ip(e,t){const n=op[e]||(op[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[z0(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function vn(e){return e.nodeType===Node.ELEMENT_NODE}function sp(e){return vn(e)?e.tagName==="AMP-IMG"?!0:ip(e.tagName.toLowerCase(),"src"):!1}function Nc(e){return vn(e)&&!e.ownerSVGElement}function V0(e){return e.tagName==="IMG"}function U0(e){return e.tagName==="FORM"}function j0(e){return e.tagName==="SCRIPT"}function G0(e){return e.tagName==="STYLE"}function xc(e){return e.nodeType===Node.DOCUMENT_NODE}function ap(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var oi;(function(e){function t(m){return m.constructor.name==="CSSStyleRule"}e.isStyleRule=t;function n(m){return m.constructor.name==="CSSImportRule"}e.isImportRule=n;function r(m){return m.constructor.name==="CSSMediaRule"}e.isMediaRule=r;function o(m){return m.constructor.name==="CSSFontFaceRule"}e.isFontFaceRule=o;function i(m){return m.constructor.name==="CSSPageRule"}e.isPageRule=i;function s(m){return m.constructor.name==="CSSKeyframesRule"}e.isKeyframesRule=s;function a(m){return m.constructor.name==="CSSKeyframeRule"}e.isKeyframeRuleRule=a;function l(m){return m.constructor.name==="CSSNamespaceRule"}e.isNamespaceRule=l;function c(m){return m.constructor.name==="CSSCounterStyleRule"}e.isCounterStyleRule=c;function u(m){return m.constructor.name==="CSSSupportsRule"}e.isSupportsRule=u;function d(m){return m.constructor.name==="CSSFontFeatureValuesRule"}e.isFontFeatureValuesRuleRule=d})(oi||(oi={}));function Us(e){return e.nodeType===Node.COMMENT_NODE}function ii(e){return e.nodeType===Node.TEXT_NODE}function X0(e){return e.tagName==="TABLE"}async function Y0(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 Vt(e){if(vn(e))return lp(e);if(xc(e))return[...e.childNodes].map(n=>Vt(n)).join("");if(ap(e))return rp(e);const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function K0(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"&&!ip(t,o)?` ${o}`:` ${o}="${i.replaceAll('"',"'")}"`}return n}function Ct(e){let t="";for(const n of e.childNodes)t+=Vt(n);return t}function lp(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),n=K0(e);return uc.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${n}/>`:`<${t}${n}>`:G0(e)?`<${t}${n}>${e.innerHTML}</${t}>`:`<${t}${n}>${Ct(e)}</${t}>`}function Z0(e){return typeof e=="string"?e:""}function cp(e,t,n){if(n&&e.type===$.DOCTYPE&&n?.type!==$.ROOT){const o=document.createTextNode(e.content||"");return t.set(e,o),o}const r=Vs(e,!1);t.set(e,r);for(const o of e.children){const i=cp(o,t,e);r.appendChild(i)}return r}function Q0(e,t,n=Lc){let r,o;const i=new Map,s=()=>{const l=np(r,c=>t.getByNode(c)||i.get(c),n);return l&&{...l,stage:"dom",...o?{cause:o}:{}}},a=l=>{o=l;try{nt("Element node not in tree")}finally{o=void 0}};return Df(s,()=>J0(e,t,i,l=>r=l,a))}function J0(e,t,n,r,o){const i=[],s=new Map,a=c=>t.getByNode(c)||n.get(c),l=c=>{if(c){const u=c.lastChild;let d=(u?a(u)?.nextSibling:a(c)?.firstChild)||void 0;for(;d&&s.has(d);)d=d.nextSibling||void 0;return d?.parentNode===a(c)?d:void 0}};for(const c of e)switch(r(c),c.type){case"Add":{let{node:u,nextSibling:d}=c;const m=u.parent;if(m){const p=cp(u,n,m);if(m.type===$.ROOT)i.push(ue.add(null,p,d&&a(d)));else{const f=a(m);if(f){let h;for(;d;){const y=n.get(d);if(y){h=y;break}let v=t.getByNode(d);if(v&&!s.has(v)&&f.contains(v)){for(h=v;v.parentNode!==f&&v.parentNode;)v=v.parentNode,vn(v)&&v.replaceWith(...v.childNodes);break}d=Zn(d)||void 0}h||(h=l(m)),i.push(ue.add(f,p,h))}else o("parent-not-mapped")}}else o("no-parent");break}case"Move":{let{node:u,nextSibling:d}=c;const m=u.parent,p=a(u);if(m&&p)if(m.type===$.ROOT)i.push(ue.move(null,p,d&&a(d)));else{const f=a(m);if(f){let h;for(;d;){const y=n.get(d);if(y){h=y;break}let v=t.getByNode(d);if(v&&!s.has(v)&&f.contains(v)){for(;v.parentNode!==f&&v.parentNode;)v=v.parentNode;v||nt("error while calculating next sibling"),h=v;break}d=Zn(d)||void 0}h||(h=l(m)),i.push(ue.move(f,p,h))}else o("parent-not-mapped")}else o(m?"node-not-mapped":"no-parent");break}case"Remove":{const u=c.node,d=a(u);if(u.type===$.HTML&&!u.content)continue;d?(s.set(d,u),i.push(ue.remove(d))):o("node-not-mapped");break}case"Update":{const u=c.prev,d=a(u);d?n.set(c.next,d):c.soft||o("node-not-mapped");break}case"Attribute":{const u=a(c.node);u?i.push(ue.attribute(u,c.name,c.value)):o("node-not-mapped");break}case"Set":{const u=c.node,d=a(u);d?ii(d)&&u.type===$.HTML||Us(d)&&u.type===$.HTML||ap(d)&&u.type===$.DOCTYPE?i.push(ue.set(d,c.data||"")):e.push(ue.remove(u),ue.add(u.parent||null,u,Zn(u)||void 0)):o("node-not-mapped");break}}return{mutations:i,toAdd:n,toRemove:s}}function eC({mutations:e,toAdd:t,toRemove:n},r){const o=(i,s,a)=>{if(!i)return nt("Element node not in tree");if(!(i instanceof Element))return nt("node is not HTMLEement");const l=a===void 0?void 0:Kf(i,s,Z0(a));try{l!=null?Hn(i,s,l):i.removeAttribute(s)}catch{}};for(const i of e)switch(i.type){case"Add":{const{node:s,nextSibling:a,parent:l}=i;l?.insertBefore(s,a?.parentNode===l&&a||null);break}case"Move":{const{node:s,nextSibling:a,parent:l}=i;l?.insertBefore(s,a?.parentNode===l&&a||null);break}case"Remove":{const{node:s}=i;if(s instanceof Element)s.remove();else if(s instanceof Document)for(const a of[...s.childNodes])a.parentNode?.removeChild(a);else s.parentNode?.removeChild(s);break}case"Attribute":o(i.node,i.name,i.value);break;case"Set":{const{node:s,data:a}=i;s instanceof Comment?s.data=a:s instanceof Text&&(s.textContent=Cc(a).textContent);break}}for(const[i,s]of n)r.remove(s);for(const[i,s]of t){const a=r.getByElement(s);a&&r.remove(a),r.set(i,s)}}var tC=class{constructor(){L(this,"_byKey",new WeakMap),L(this,"_byValue",new WeakMap)}get(e){return this._byKey.get(e)}getByValue(e){return this._byValue.get(e)?.deref()}set(e,t){this._byKey.set(e,t),this._byValue.set(t,new WeakRef(e))}delete(e){const t=this.get(e);t&&(this._byKey.delete(e),this._byValue.delete(t))}deleteByValue(e){const t=this.getByValue(e);t&&(this._byKey.delete(t),this._byValue.delete(e))}},nC=class{constructor(){L(this,"_map",new tC)}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 up(e,t){for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function rC(e){let t;for(let n=e;n;n=n.parent)Sc(n)&&(t=n);return t}function oC(e){return e.type==="Update"?e.prev:e.node}function iC(e,t){const n=new Map;for(const o of e){if(o.type!=="Update"||!o.soft)continue;const i=rC(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=oC(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(up(i,l)||up(i,c)||s&&u?.contains(s)){a=!0,o.type==="Update"&&o.next===l&&l.parent&&r.push(...ue.recreate(c,l.parent,l,Zn(l)||void 0));break}}a||r.push(o)}return r}var Mc;(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})(Mc||(Mc={}));var js=new Set;function Gs(e,t){js.has(e)||(js.size||Promise.resolve().then(()=>js.clear()),js.add(e),Z.send(Pe.APPLICATION_SYNC_DRIFT,{reason:e,...t()}))}var dp=new WeakMap;function sC(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 aC(e,t){let n=dp.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=sC(o),n={added:o,removed:i},dp.set(e,n)}return n}var lC=new Set(["text/x-handlebars-template","text/html"]);function mp(e){return e.replace(/<(?=[A-Za-z!/?])/g,"&lt;")}function fp(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.tagName.toUpperCase();return t==="STYLE"||t==="SCRIPT"&&!lC.has(e.getAttribute("type")??"")}var pp=Object.getPrototypeOf(customElements),cC=Reflect.get(pp,"define"),Rc=new Me,Oc=new Me,uC=Rc.event,dC=Oc.event,mC=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","connectedMoveCallback","formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"];function fC(e){Rc.fire();try{return e()}finally{Oc.fire()}}pp.define=function(e,t,n){const r=t.prototype,o=class extends t{constructor(...i){Rc.fire();try{super(...i)}finally{Oc.fire()}}};Object.defineProperty(o,"name",{configurable:!0,value:t.name});for(const i of mC){const s=r[i];typeof s=="function"&&Object.defineProperty(o.prototype,i,{configurable:!0,writable:!0,value:function(...a){return fC(()=>s.call(this,...a))}})}cC.call(this,e,o,n)};function hp(e,t,n,r){const o=[...e.childNodes],i=t(e,r);for(const s of o)n(i,hp(s,t,n,i));return i}function to(e,t,n){if(t(e,n)!==!1)for(const r of[...e.childNodes])to(r,t,e)}var Fn="___em-internal";function Pc(e,t=!0,n=!1){let r=e.content;switch(e.type){case $.ROOT:{const o=document.implementation.createHTMLDocument();for(const i of[...o.childNodes])o.removeChild(i);if(t)for(const i of e.children)o.appendChild(Pc(i,t,n));return o}case $.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case $.COMMENT:return document.createComment(r||"");case $.ELEMENT:if(e.tag){if(n&&customElements.get(e.tag)){const i=document.createElement("div");return i.innerHTML=dc(e),i.firstChild}const o=document.createElement(e.tag);if(e.attributes)for(const i of e.attributeNames){const s=e.attributes[i];try{Hn(o,i,typeof s=="string"?s:"")}catch{}}if(t)for(const i of e.children)o.appendChild(Pc(i,t,n));return o}return document.createTextNode("<");case $.HTML:return Cc(r||"");default:throw new Error("unsupported node")}}function pC(e){return Xr(e).roots.map(t=>Pc(t,!0,!0))}function gp(){const e=document.implementation.createHTMLDocument();for(const t of[...e.childNodes])t.remove();return e}function hC(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 gp();default:t=document.createElement("div")}return t}function gC(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}function Xs(e){if(e instanceof Element)return lp(e);if(e instanceof Document)return[...e.childNodes].map(n=>Xs(n)).join("");if(e instanceof DocumentType)return gC(e);if(e instanceof DocumentFragment)return[...e.childNodes].map(n=>Xs(n)).join("");const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function bp(e,t=e.parentNode){return fp(t)?mp(e.textContent??""):Xs(e)}function bC(e,t,n){let r=1;const o=new Uf,i=new Map,s=new Map,a=new Map;let l=!1;const c=hp(e,p=>{const f=String(r++);let h;if(sp(p)||p instanceof Element&&p.hasAttribute("src")){const y=document.createElement(p.tagName);for(const{name:v,value:A}of p.attributes){const k=Zf(p,v,A);k!==null&&Hn(y,v==="src"?"___src":v,k)}h=y}else h=p.cloneNode(),LC(p,h);if(h)h instanceof DocumentType&&(l=!0),a.set(h,f),i.set(p,f);else return document.createDocumentFragment();return h},(p,f)=>p&&f&&p.appendChild(f));let u=l?gp():document.createDocumentFragment();u.appendChild(c),to(u,(p,f)=>{if(f){const h=a.get(p);if(f instanceof HTMLScriptElement||f instanceof HTMLStyleElement)return;if(!h)return nt("Error while mapping: not found element");p instanceof Element?p.setAttribute(Fn,h):f.insertBefore(document.createComment(`${Fn}${h}`),p)}});let d=pC(t(u)).filter(p=>!!p),m;if(!d.length)return o;if(u instanceof Document){const p=hC("html");for(const f of d)p.appendChild(f);m=p}else{m=document.createDocumentFragment();for(const p of d)m.appendChild(p)}return to(m,(p,f)=>{let h=null;if(p instanceof HTMLHtmlElement)s.set("1",p);else{if(p instanceof Element&&p.hasAttribute(Fn)){h=p.getAttribute(Fn),h&&s.set(h,p);return}const y=p.previousSibling;if(y instanceof Comment&&(!(p instanceof Comment)||p.data.indexOf(Fn)<0)){const v=y.data,A=v.indexOf(Fn);A>=0&&(h=v.substring(A+14),h&&s.set(h,p))}}}),to(m,p=>{if(p instanceof Element&&p.hasAttribute(Fn)){p.removeAttribute(Fn);return}p instanceof Comment&&p.data.indexOf(Fn)>=0&&p.remove()}),to(e,p=>{const f=i.get(p),h=s.get(f);h&&(o.set(p,h),(p instanceof HTMLScriptElement||p instanceof HTMLStyleElement)&&p.firstChild&&h.firstChild&&o.set(p.firstChild,h.firstChild))}),o}function yC(e){const t=yp(e.cloneNode()),n=pc(t),r=n.length;return t.startTagEnd=t.startTagEnd===void 0?void 0:n.indexOf(">",Math.max(n.lastIndexOf("'"),n.lastIndexOf('"')))+1,t.endTagStart=t.endTagStart===void 0?void 0:t.endTagStart+(r-t.end),t.end=r,t.type=$.ELEMENT,t}var no;(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})({})})(no||(no={}));function yp(e){if(ii(e)&&fp(e.parentNode))return vC(e.data);let t=Xr(Xs(e.cloneNode())).roots[0];return t||(t=new wt(0,0,[]),t.type=$.HTML,t.content=""),t}function vC(e){const t=mp(e),n=new wt(0,t.length,[]);return n.type=$.HTML,n.content=t,n}function vp(e,t=no.HiddenResult.node){if(t&no.HiddenResult.node&&(e.end=e.start=e.startTagEnd=e.endTagStart=e.end=0),t&no.HiddenResult.children)for(const n of e.children)vp(n,no.HiddenResult.all)}function EC(e,t=[],n){let r;return e instanceof Element?r=yC(e):r=yp(e),r.children=t,r.parent=void 0,n&&vp(r,n(r)),r}function Ic(e,t,n){let r=t.getByElement(e);if(r)return n?.(e)?void 0:r;for(const o of e.childNodes)if(r=Ic(o,t,n),r)return r}function Ep(e,t,n,r){Gs("tree-node-out-of-place",()=>({mutation:n()}))}function SC(e,t,n,r,o){let i=e.parentNode,s=e.nextSibling,a;const l=(c,u)=>!o||o(c,u)?!0:(Ep("insertBefore",c,()=>W0(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=Ic(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=Ic(s,t,r);if(u){a=u,s=s.nextSibling;break}s=s.nextSibling}s||(s=i.nextSibling),i=i.parentNode}}function wC(e,t){const n=[],r=e.attributeChanged;if(r)for(const o of Object.keys(r)){const i=r[o];for(const s of i){const a=t.getByElement(s);if(a){const l=s.getAttribute(o);n.push(ue.attribute(a,o,typeof l=="string"?l:void 0))}}}return n}function CC(e,t){const n=[],r=e.characterDataChanged;if(r)for(const o of r){const i=t.getByElement(o);i&&n.push(ue.set(i,Us(o)?o.data:bp(o)))}return n}function AC(e){return(e instanceof Element?e:e.parentElement)?.closest(".sortable-fallback")??null}function TC(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 _C(e,t,n){const r=[],o=new Set,i=new Map,s=(a,l)=>{const c=i.get(a);return c?c===l:a.parent===l&&l.children.includes(a)};for(const a of e){const{added:l,removed:c}=aC(a,u=>!!t.getByElement(u));for(const u of c)if(!o.has(u)){const d=t.getByElement(u);if(d){const m=i.get(d)??d.parent;!m||!s(d,m)?Ep("remove",d,()=>q0(d,t)):r.push(ue.remove(d)),i.delete(d),o.add(u)}}for(const u of l){if(TC(u))continue;const d=AC(u);if(d&&!t.getByElement(d))continue;const{parentTreeNode:m,nextSiblingTreeNode:p}=SC(u,t,n,f=>o.has(f),s)||{};if(m){let f=t.getByElement(u);f||(f=EC(u),t.set(f,u)),r.push(ue.add(m,f,p)),i.set(f,m),o.delete(u)}}r.push(...wC(a,t)),r.push(...CC(a,t))}return r}function kC(e,t,n){const r=[],o=t.attributes,i=n.attributes;for(const s of o){const a=s.name,l=i.getNamedItem(a==="src"?"___src":a);if(l){const c=l.value;c!==s.value&&r.push(ue.attribute(e,a,c))}else r.push(ue.attribute(e,a,void 0))}for(const s of i){const a=s.name==="___src"?"src":s.name;o.getNamedItem(a)||r.push(ue.attribute(e,a,s.value))}return r}function LC(e,t){if(!(!_0()||!(e instanceof Element)||!(t instanceof Element)))for(const{name:n,value:r}of Array.from(e.attributes)){const o=Zf(e,n,r);o===null?t.removeAttribute(n):o!==r&&Hn(t,n,o)}}function NC(e,t,n){const r=[],o=bC(e,n,t);return to(e,i=>{const s=t.getByElement(i);if(!s)return;const a=o.getByKey(i);if(a){if(a instanceof Element){if(!(i instanceof Element))return nt("CharacterData mapped to Element");r.push(...kC(s,i,a))}else if(a instanceof CharacterData){if(!(i instanceof CharacterData))return nt("Element mapped to CharacterData");a.data!==i.data&&r.push(ue.set(s,Us(a)?a.data:bp(a,i.parentNode)))}else if(a instanceof Document&&!(i instanceof Document))return nt("Node mapped to Document")}else{const l=u=>{for(const d of u.childNodes)if(o.getByKey(d)||!l(d))return!1;return!0};let c;return l(i)?(r.push(ue.hidden(s,!0)),c=!1):r.push(ue.hidden(s,!1)),c}}),r}function xC(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 MC(e){return[...new Set(e)]}function RC(e,t){return MC([...e.added,...e.reparented||[],...e.reordered||[],...Object.values(e.characterDataChanged||{}),...Object.values(e.attributeChanged||{})].flat().map(n=>xC(n,t)||n))}function OC(e,t){let n=[];for(const r of e){const o=RC(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 PC(e,t,n){return OC(e,t).flatMap(r=>NC(r,t,n))}function IC(e,t,n,r){return[..._C(e,t,r),...PC(e,t,n)]}function DC(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 BC=class{constructor(){L(this,"_map",new WeakMap)}getAttribute(e,t){return this._map.get(e)?.[t]}setAttribute(e,t,n){let r=this._map.get(e);r||this._map.set(e,r=Object.create(null)),r[t]=n}removeAttribute(e,t){let n=this._map.get(e);n&&delete n[t]}hasAttribute(e,t){return this._map.has(e)?.hasOwnProperty(t)}getAttributes(e){return this._map.get(e)}has(e){return this._map.has(e)}replaceNode(e,t){const n=this._map.get(e);n&&(this._map.delete(e),this._map.set(t,n))}},Sp=class{constructor(e=10){L(this,"_max",void 0),L(this,"_cache",new Map),this._max=e}get(e){let t=this._cache.get(e);return t!==void 0&&(this._cache.delete(e),this._cache.set(e,t)),t}put(e,t){this._cache.has(e)?this._cache.delete(e):this._cache.size==this._max&&this._cache.delete(this.first()),this._cache.set(e,t)}first(){return this._cache.keys().next().value}},wp=new Sp(1e3);function ro(e){if(e=e?.trim(),e){let t=wp.get(e);return t||(t=new Set(e.split(" ").filter(n=>!!n).map(n=>n)),wp.put(e,t)),t}else return new Set}function Ys(e){e||(e="");const t=document.createElement("div");return t.setAttribute("style",e),t.style}var Cp=new Sp(1e3);function si(e){e||(e="");let t=Cp.get(e);return t||(t=Ys(e),Cp.put(e,t)),t}function HC(e,t,n){const r=e?e.split(" "):[],o=ro(n),i=ro(t),s=r.filter(a=>(a=a.trim(),o.has(a)?i.has(a):!0));return s.length===r.length?e:s.join(" ")}function FC(e,t,n){const r=Ys(e),o=si(n),i=si(t);let s=!1;for(const a of o){const l=o.getPropertyValue(a);r.getPropertyValue(a)===l&&i.getPropertyValue(a)!==l&&(s=!0,r.removeProperty(a))}return s?r.cssText:e}function Ap(e,t,n,r){return typeof r!="string"?t:e==="class"?HC(t,n,r)||null:e==="style"?FC(t,n,r)||null:n!==t&&t===r?null:t}function $C(e,t){const n=ro(e),r=ro(t);for(const o of r)n.has(o)||(e=e?`${e.trimEnd()} ${o}`:o);return e}function WC(e,t){const n=Ys(e),r=si(t);let o=!1;for(const i of r){const s=r.getPropertyValue(i);n.getPropertyValue(i)!==s&&(o=!0,n.setProperty(i,s))}return o?n.cssText:e}function qC(e,t,n){return typeof n!="string"?t:e==="class"?$C(t,n)||null:e==="style"?WC(t,n)||null:t}function zC(e,t,n){if(!t)return t;const r=ro(e),o=ro(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 VC(e,t,n){if(!t)return t;const r=si(e),o=Ys(t),i=si(n);let s=!1;for(const a of o){const l=o.getPropertyValue(a);r.getPropertyValue(a)===l&&i.getPropertyValue(a)!==l&&(s=!0,o.removeProperty(a))}return s?o.cssText:t}function Tp(e){return e.type===$.ELEMENT&&e.start!==e.end}function _p(e){return e.filter(t=>t.type===$.ELEMENT)}function UC(e,t,n){const r=_p(e),o=_p(t),i=[],s=new Set,a=new Set,l=u=>{const d=(p,f)=>{const h=new Map;for(const y of p){const v=f.has(y)?void 0:u(y);v!==void 0&&h.set(v,h.has(v)?null:y)}return h},m=d(r,s);for(const[p,f]of d(o,a)){const h=m.get(p);f&&h&&(i.push([h,f,!0]),s.add(h),a.add(f))}};l(u=>typeof u.attributes?.id=="string"?`${u.tag}#${u.attributes.id}`:void 0),l(u=>fr(u,!1,n)),l(u=>fr(u,!0,n));const c=new Set(o.map(u=>u.tag));for(const u of c){const d=f=>f.filter(h=>h.tag===u),m=d(r).filter(f=>!s.has(f)),p=d(o).filter(f=>!a.has(f));if(m.length===p.length&&d(r).length===d(o).length){const f=m.length===1&&!m[0].attributes?.id&&!p[0].attributes?.id;p.forEach((h,y)=>i.push([m[y],h,f]))}}return i}var jC=class{constructor(e,t,n,r){L(this,"element",void 0),L(this,"name",void 0),L(this,"nextValue",void 0),L(this,"prevValue",void 0),this.element=e,this.name=t,this.nextValue=n,this.prevValue=r}},GC=class{constructor(e){L(this,"_nodeMap",void 0),L(this,"_map",new BC),L(this,"_hiddenMutations",[]),L(this,"_restore",[]),this._nodeMap=e}_onHiddenMutate(){try{for(const{name:e,element:t,prevValue:n,nextValue:r}of this._hiddenMutations){const o=this._nodeMap.getByElement(t);if(o)if(e==="class"){const i=zC(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=VC(n,r,this._map.getAttribute(o,e))||null;i===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,i)}else r===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,r)}}finally{this._hiddenMutations=[]}}onHiddenMutate(e){const t=this._hiddenMutations;for(const n of e){const r=n.attributeChanged;if(r)for(const o of Object.keys(r)){const i=r[o];for(const s of i)t.push(new jC(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=Ap(r,i,o.attributes?.[r]||null,this._map.getAttribute(o,r));if(s!==i){t.push(ue.attribute(o,r,s));continue}}if(t.push(n),n.type==="Add"){const{node:r}=n,o=r.attributes;if(o)for(const i of Object.keys(o)){const s=o[i],a=this._map.getAttribute(r,i);if(a){const l=Ap(i,s,null,a);l!==s&&t.push(ue.attribute(r,i,l))}}}}return t}onRemoteMutate(e){this._onHiddenMutate(),this._restore=[];const t=[];for(const n of e){if(n.type==="Attribute"){const{name:r,node:o,value:i}=n,s=qC(r,i,this._map.getAttribute(o,r));if(s!==i){t.push(ue.attribute(o,r,s));continue}}else n.type==="Update"?this._map.replaceNode(n.prev,n.next):n.type==="Add"&&n.replaces&&this._carryHidden(n.replaces,n.node,!0,mc());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&&!vc(t.tag)&&o){const i=[];for(const[s,a]of Object.entries(o))g0(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&&fr(e,!1,r)===fr(t,!1,r)){const i=t.children.filter(Tp);e.children.filter(Tp).forEach((s,a)=>{i[a]&&this._carryHidden(s,i[a],!0,r)});return}for(const[i,s,a]of UC(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)}}}},XC=class{constructor(e){L(this,"_isMapped",void 0),L(this,"_foreign",new WeakSet),L(this,"_movedTo",new WeakMap),L(this,"_removed",new WeakSet),L(this,"_hasForeign",!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);for(const n of t.removed)this._foreign.has(n)||this._removed.add(n)}}markForeign(e){this._hasForeign=!0,this._foreign.add(e)}isMarked(e){return this._foreign.has(e)}isForeign(e){if(!this._hasForeign)return!1;for(let t=e;t;t=t.parentNode){if(this._isMapped(t))return!1;if(this._foreign.has(t))return!0}return!1}isPlacedInForeign(e){return this._hasForeign&&this.isForeign(this._isMapped(e)?e.parentNode:e)}movedTo(e){return this._movedTo.get(e)}wasRemoved(e){return this._removed.has(e)}forget(e){this._movedTo.delete(e),this._removed.delete(e)}},kp="foreign-structure-in-commit";function YC(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 Ks(e){if(!(e instanceof Element))return{tag:e.nodeName.toLowerCase()};const t=e.getAttribute("class");return{tag:e.tagName.toLowerCase(),...t?{class:t}:{}}}var Lp="implicit-tbody-in-canvas";function KC(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 ZC(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:Ks(n),parent:n.parentNode?Ks(n.parentNode):void 0};t.add(Lp),Gs(Lp,()=>({foreign:r}))}function QC(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:Ks(n.node),parent:n.node.parentNode?Ks(n.node.parentNode):void 0};t.has("foreign-structure-in-commit")||(t.add(kp),Gs(kp,()=>({foreign:o})))}var JC=Yn(((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 S(){this._nodes=[],this._values=[]}return S._isIndex=function(b){return+b===b>>>0},S._nodeId=function(b){var E=b[S._ID_PROP];return E||(E=b[S._ID_PROP]=S._NEXT_ID++),E},S.prototype.set=function(b,E){var C=S._nodeId(b);this._nodes[C]=b,this._values[C]=E},S.prototype.get=function(b){var E=S._nodeId(b);return E!==void 0?this._values[E]:void 0},S.prototype.has=function(b){return S._nodeId(b)in this._nodes},S.prototype.delete=function(b){var E=S._nodeId(b);delete this._nodes[E],this._values[E]=void 0},S.prototype.keys=function(){var b=[];for(var E in this._nodes)S._isIndex(E)&&b.push(this._nodes[E]);return b},S._ID_PROP="__mutation_summary_node_map_id__",S._NEXT_ID=1,S})(),o=(function(){function S(){this.added=new r,this.removed=new r,this.maybeMoved=new r,this.oldPrevious=new r,this.moved=void 0}return S})();n.Movement=void 0,(function(S){S[S.STAYED_OUT=0]="STAYED_OUT",S[S.ENTERED=1]="ENTERED",S[S.STAYED_IN=2]="STAYED_IN",S[S.REPARENTED=3]="REPARENTED",S[S.REORDERED=4]="REORDERED",S[S.EXITED=5]="EXITED"})(n.Movement||(n.Movement={}));var i=function(S,b){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,C){E.__proto__=C}||function(E,C){for(var g in C)Object.prototype.hasOwnProperty.call(C,g)&&(E[g]=C[g])},i(S,b)};function s(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");i(S,b);function E(){this.constructor=S}S.prototype=b===null?Object.create(b):(E.prototype=b.prototype,new E)}var a=(function(){function S(b,E,C,g,w,T,_,M){E===void 0&&(E=!1),C===void 0&&(C=!1),g===void 0&&(g=!1),w===void 0&&(w=null),T===void 0&&(T=!1),_===void 0&&(_=null),M===void 0&&(M=null),this.node=b,this.childList=E,this.attributes=C,this.characterData=g,this.oldParentNode=w,this.added=T,this.attributeOldValues=_,this.characterDataOldValue=M,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return S.prototype.getAttributeOldValue=function(b){if(this.attributeOldValues)return this.isCaseInsensitive&&(b=b.toLowerCase()),this.attributeOldValues[b]},S.prototype.getAttributeNamesMutated=function(){var b=[];if(!this.attributeOldValues)return b;for(var E in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(E)&&b.push(E);return b},S.prototype.attributeMutated=function(b,E){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(b in this.attributeOldValues)&&(this.attributeOldValues[b]=E)},S.prototype.characterDataMutated=function(b){this.characterData||(this.characterData=!0,this.characterDataOldValue=b)},S.prototype.removedFromParent=function(b){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=b},S.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},S.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},S})(),l=(function(S){s(b,S);function b(E,C){var g=S.call(this)||this;g.rootNode=E,g.reachableCache=void 0,g.wasReachableCache=void 0,g.anyParentsChanged=!1,g.anyAttributesChanged=!1,g.anyCharacterDataChanged=!1;for(var w=0;w<C.length;w++){var T=C[w];switch(T.type){case"childList":g.anyParentsChanged=!0;for(var _=0;_<T.removedNodes.length;_++){var M=T.removedNodes[_];g.getChange(M).removedFromParent(T.target)}for(var _=0;_<T.addedNodes.length;_++){var M=T.addedNodes[_];g.getChange(M).insertedIntoParent()}break;case"attributes":g.anyAttributesChanged=!0;var N=g.getChange(T.target);N.attributeMutated(T.attributeName,T.oldValue);break;case"characterData":g.anyCharacterDataChanged=!0;var N=g.getChange(T.target);N.characterDataMutated(T.oldValue)}}return g}return b.prototype.getChange=function(E){var C=this.get(E);return C||(C=new a(E),this.set(E,C)),C},b.prototype.getOldParent=function(E){var C=this.get(E);return C?C.getOldParent():E.parentNode},b.prototype.getIsReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.reachableCache=this.reachableCache||new r;var C=this.reachableCache.get(E);return C===void 0&&(C=this.getIsReachable(E.parentNode),this.reachableCache.set(E,C)),C},b.prototype.getWasReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.wasReachableCache=this.wasReachableCache||new r;var C=this.wasReachableCache.get(E);return C===void 0&&(C=this.getWasReachable(this.getOldParent(E)),this.wasReachableCache.set(E,C)),C},b.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},b})(r),c=(function(){function S(b,E,C,g,w){this.rootNode=b,this.mutations=E,this.selectors=C,this.calcReordered=g,this.calcOldPreviousSibling=w,this.treeChanges=new l(b,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 S.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var b=this.treeChanges.keys(),E=0;E<b.length;E++)this.visitNode(b[E],void 0)},S.prototype.visitNode=function(b,E){if(!this.visited.has(b)){this.visited.set(b,!0);var C=this.treeChanges.get(b),g=E;if((C&&C.childList||g==null)&&(g=this.treeChanges.reachabilityChange(b)),g!==n.Movement.STAYED_OUT){if(this.matchabilityChange(b),g===n.Movement.ENTERED)this.entered.push(b);else if(g===n.Movement.EXITED)this.exited.push(b),this.ensureHasOldPreviousSiblingIfNeeded(b);else if(g===n.Movement.STAYED_IN){var w=n.Movement.STAYED_IN;C&&C.childList&&(C.oldParentNode!==b.parentNode?(w=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(b)):this.calcReordered&&this.wasReordered(b)&&(w=n.Movement.REORDERED)),this.stayedIn.set(b,w)}if(g!==n.Movement.STAYED_IN)for(var T=b.firstChild;T;T=T.nextSibling)this.visitNode(T,g)}}},S.prototype.ensureHasOldPreviousSiblingIfNeeded=function(b){if(this.calcOldPreviousSibling){this.processChildlistChanges();var E=b.parentNode,C=this.treeChanges.get(b);C&&C.oldParentNode&&(E=C.oldParentNode);var g=this.childListChangeMap.get(E);g||(g=new o,this.childListChangeMap.set(E,g)),g.oldPrevious.has(b)||g.oldPrevious.set(b,b.previousSibling)}},S.prototype.getChanged=function(b,E,C){this.selectors=E,this.characterDataOnly=C;for(var g=0;g<this.entered.length;g++){var w=this.entered[g],T=this.matchabilityChange(w);(T===n.Movement.ENTERED||T===n.Movement.STAYED_IN)&&b.added.push(w)}for(var _=this.stayedIn.keys(),g=0;g<_.length;g++){var w=_[g],T=this.matchabilityChange(w);if(T===n.Movement.ENTERED)b.added.push(w);else if(T===n.Movement.EXITED)b.removed.push(w);else if(T===n.Movement.STAYED_IN&&(b.reparented||b.reordered)){var M=this.stayedIn.get(w);b.reparented&&M===n.Movement.REPARENTED?b.reparented.push(w):b.reordered&&M===n.Movement.REORDERED&&b.reordered.push(w)}}for(var g=0;g<this.exited.length;g++){var w=this.exited[g],T=this.matchabilityChange(w);(T===n.Movement.EXITED||T===n.Movement.STAYED_IN)&&b.removed.push(w)}},S.prototype.getOldParentNode=function(b){var E=this.treeChanges.get(b);if(E&&E.childList)return E.oldParentNode?E.oldParentNode:null;var C=this.treeChanges.reachabilityChange(b);if(C===n.Movement.STAYED_OUT||C===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return b.parentNode},S.prototype.getOldPreviousSibling=function(b){var E=b.parentNode,C=this.treeChanges.get(b);C&&C.oldParentNode&&(E=C.oldParentNode);var g=this.childListChangeMap.get(E);if(!g)throw Error("getOldPreviousSibling requested on invalid node.");return g.oldPrevious.get(b)},S.prototype.getOldAttribute=function(b,E){var C=this.treeChanges.get(b);if(!C||!C.attributes)throw Error("getOldAttribute requested on invalid node.");var g=C.getAttributeOldValue(E);if(g===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return g},S.prototype.attributeChangedNodes=function(b){if(!this.treeChanges.anyAttributesChanged)return{};var E,C;if(b){E={},C={};for(var g=0;g<b.length;g++){var w=b[g];E[w]=!0,C[w.toLowerCase()]=w}}for(var T={},_=this.treeChanges.keys(),g=0;g<_.length;g++){var M=_[g],N=this.treeChanges.get(M);if(N.attributes&&!(n.Movement.STAYED_IN!==this.treeChanges.reachabilityChange(M)||n.Movement.STAYED_IN!==this.matchabilityChange(M)))for(var W=M,P=N.getAttributeNamesMutated(),R=0;R<P.length;R++){var w=P[R];E&&!E[w]&&!(N.isCaseInsensitive&&C[w])||N.getAttributeOldValue(w)!==W.getAttribute(w)&&(C&&N.isCaseInsensitive&&(w=C[w]),T[w]=T[w]||[],T[w].push(W))}}return T},S.prototype.getOldCharacterData=function(b){var E=this.treeChanges.get(b);if(!E||!E.characterData)throw Error("getOldCharacterData requested on invalid node.");return E.characterDataOldValue},S.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var b=this.treeChanges.keys(),E=[],C=0;C<b.length;C++){var g=b[C];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(g)){var w=this.treeChanges.get(g);!w.characterData||g.textContent==w.characterDataOldValue||E.push(g)}}return E},S.prototype.computeMatchabilityChange=function(b,E){this.matchCache||(this.matchCache=[]),this.matchCache[b.uid]||(this.matchCache[b.uid]=new r);var C=this.matchCache[b.uid],g=C.get(E);return g===void 0&&(g=b.matchabilityChange(E,this.treeChanges.get(E)),C.set(E,g)),g},S.prototype.matchabilityChange=function(b){var E=this;if(this.characterDataOnly)switch(b.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(b.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var C=b,g=this.selectors.map(function(_){return E.computeMatchabilityChange(_,C)}),w=n.Movement.STAYED_OUT,T=0;w!==n.Movement.STAYED_IN&&T<g.length;){switch(g[T]){case n.Movement.STAYED_IN:w=n.Movement.STAYED_IN;break;case n.Movement.ENTERED:w===n.Movement.EXITED?w=n.Movement.STAYED_IN:w=n.Movement.ENTERED;break;case n.Movement.EXITED:w===n.Movement.ENTERED?w=n.Movement.STAYED_IN:w=n.Movement.EXITED}T++}return w},S.prototype.getChildlistChange=function(b){var E=this.childListChangeMap.get(b);return E||(E=new o,this.childListChangeMap.set(b,E)),E},S.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r;for(var b=function(g){var w=E.mutations[g];if(w.type!="childList"||E.treeChanges.reachabilityChange(w.target)!==n.Movement.STAYED_IN&&!E.calcOldPreviousSibling)return"continue";for(var T=E.getChildlistChange(w.target),_=w.previousSibling,M=function(P,R){!P||T.oldPrevious.has(P)||T.added.has(P)||T.maybeMoved.has(P)||R&&(T.added.has(R)||T.maybeMoved.has(R))||T.oldPrevious.set(P,R)},N=0;N<w.removedNodes.length;N++){var W=w.removedNodes[N];M(W,_),T.added.has(W)?T.added.delete(W):(T.removed.set(W,!0),T.maybeMoved.delete(W)),_=W}M(w.nextSibling,_);for(var N=0;N<w.addedNodes.length;N++){var W=w.addedNodes[N];T.removed.has(W)?(T.removed.delete(W),T.maybeMoved.set(W,!0)):T.added.set(W,!0)}},E=this,C=0;C<this.mutations.length;C++)b(C)}},S.prototype.wasReordered=function(b){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var E=b.parentNode,C=this.treeChanges.get(b);C&&C.oldParentNode&&(E=C.oldParentNode);var g=this.childListChangeMap.get(E);if(!g)return!1;if(g.moved)return g.moved.get(b);g.moved=new r;var w=new r;function T(P){if(!P||!g.maybeMoved.has(P))return!1;var R=g.moved.get(P);return R!==void 0||(w.has(P)?R=!0:(w.set(P,!0),R=W(P)!==M(P)),w.has(P)?(w.delete(P),g.moved.set(P,R)):R=g.moved.get(P)),R}var _=new r;function M(P){var R=_.get(P);if(R!==void 0)return R;for(R=g.oldPrevious.get(P);R&&(g.removed.has(R)||T(R));)R=M(R);return R===void 0&&(R=P.previousSibling),_.set(P,R),R}var N=new r;function W(P){if(N.has(P))return N.get(P);for(var R=P.previousSibling;R&&(g.added.has(R)||T(R));)R=R.previousSibling;return N.set(P,R),R}return g.maybeMoved.keys().forEach(T),g.moved.get(b)},S})(),u=(function(){function S(b,E){var C=this;if(this.projection=b,this.added=[],this.removed=[],this.reparented=E.all||E.element||E.characterData?[]:void 0,this.reordered=E.all?[]:void 0,b.getChanged(this,E.elementFilter,E.characterData),E.all||E.attribute||E.attributeList){var g=E.attribute?[E.attribute]:E.attributeList,w=b.attributeChangedNodes(g);E.attribute?this.valueChanged=w[E.attribute]||[]:(this.attributeChanged=w,E.attributeList&&E.attributeList.forEach(function(_){C.attributeChanged.hasOwnProperty(_)||(C.attributeChanged[_]=[])}))}if(E.all||E.characterData){var T=b.getCharacterDataChanged();E.characterData?this.valueChanged=T:this.characterDataChanged=T}this.reordered&&(this.getOldPreviousSibling=b.getOldPreviousSibling.bind(b))}return S.prototype.getOldParentNode=function(b){return this.projection.getOldParentNode(b)},S.prototype.getOldAttribute=function(b,E){return this.projection.getOldAttribute(b,E)},S.prototype.getOldCharacterData=function(b){return this.projection.getOldCharacterData(b)},S.prototype.getOldPreviousSibling=function(b){return this.projection.getOldPreviousSibling(b)},S})(),d=(function(){function S(){}return S.prototype.matches=function(b){if(b===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==b;for(var E=b.split(" "),C=0;C<E.length;C++)if(this.attrValue===E[C])return!0;return!1},S.prototype.toString=function(){return this.attrName==="class"&&this.contains?"."+this.attrValue:this.attrName==="id"&&!this.contains?"#"+this.attrValue:this.contains?"["+this.attrName+"~="+m(this.attrValue)+"]":"attrValue"in this?"["+this.attrName+"="+m(this.attrValue)+"]":"["+this.attrName+"]"},S})();function m(S){return'"'+S.replace(/"/,'\\"')+'"'}var p=/[a-zA-Z_]+/,f=/[a-zA-Z0-9_\-]+/,h=(function(){function S(){this.uid=S.nextUid++,this.qualifiers=[]}return Object.defineProperty(S.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),S.prototype.isMatching=function(b){return b[S.matchesSelector](this.selectorString)},S.prototype.wasMatching=function(b,E,C){if(!E||!E.attributes)return C;var g=E.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(g!=="*"&&g!==b.tagName)return!1;for(var w=[],T=!1,_=0;_<this.qualifiers.length;_++){var M=this.qualifiers[_],N=E.getAttributeOldValue(M.attrName);w.push(N),T=T||N!==void 0}if(!T)return C;for(var _=0;_<this.qualifiers.length;_++){var M=this.qualifiers[_],N=w[_];if(N===void 0&&(N=b.getAttribute(M.attrName)),!M.matches(N))return!1}return!0},S.prototype.matchabilityChange=function(b,E){var C=this.isMatching(b);return C?this.wasMatching(b,E,C)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.wasMatching(b,E,C)?n.Movement.EXITED:n.Movement.STAYED_OUT},S.parseSelectors=function(b){var E=[],C,g;function w(){C&&(g&&(C.qualifiers.push(g),g=void 0),E.push(C)),C=new S}function T(){g&&C.qualifiers.push(g),g=new d}for(var _=/\s/,M=void 0,N="Invalid or unsupported selector syntax.",W=1,P=2,R=3,Y=4,V=5,G=6,Le=7,ae=8,ne=9,we=10,j=11,z=12,Se=13,Ae=14,Q=W,Lt=0;Lt<b.length;){var U=b[Lt++];switch(Q){case W:if(U.match(p)){w(),C.tagName=U,Q=P;break}if(U=="*"){w(),C.tagName="*",Q=R;break}if(U=="."){w(),T(),C.tagName="*",g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){w(),T(),C.tagName="*",g.attrName="id",Q=Y;break}if(U=="["){w(),T(),C.tagName="*",g.attrName="",Q=G;break}if(U.match(_))break;throw Error(N);case P:if(U.match(f)){C.tagName+=U;break}if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),g.attrName="",Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case R:if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),g.attrName="",Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case Y:if(U.match(p)){g.attrValue=U,Q=V;break}throw Error(N);case V:if(U.match(f)){g.attrValue+=U;break}if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case G:if(U.match(p)){g.attrName=U,Q=Le;break}if(U.match(_))break;throw Error(N);case Le:if(U.match(f)){g.attrName+=U;break}if(U.match(_)){Q=ae;break}if(U=="~"){g.contains=!0,Q=ne;break}if(U=="="){g.attrValue="",Q=j;break}if(U=="]"){Q=R;break}throw Error(N);case ae:if(U=="~"){g.contains=!0,Q=ne;break}if(U=="="){g.attrValue="",Q=j;break}if(U=="]"){Q=R;break}if(U.match(_))break;throw Error(N);case ne:if(U=="="){g.attrValue="",Q=j;break}throw Error(N);case we:if(U=="]"){Q=R;break}if(U.match(_))break;throw Error(N);case j:if(U.match(_))break;if(U=='"'||U=="'"){M=U,Q=Se;break}g.attrValue+=U,Q=z;break;case z:if(U.match(_)){Q=we;break}if(U=="]"){Q=R;break}if(U=="'"||U=='"')throw Error(N);g.attrValue+=U;break;case Se:if(U==M){Q=we;break}g.attrValue+=U;break;case Ae:if(U.match(_))break;if(U==","){Q=W;break}throw Error(N)}}switch(Q){case W:case P:case R:case V:case Ae:w();break;default:throw Error(N)}if(!E.length)throw Error(N);return E},S.nextUid=1,S.matchesSelector="matches",S})(),y=(function(){function S(){}return S.createObserverOptions=function(b){var E={childList:!0,subtree:!0},C;function g(w){if(!(E.attributes&&!C)){if(E.attributes=!0,E.attributeOldValue=!0,!w){C=void 0;return}C=C||{},w.forEach(function(T){C[T]=!0,C[T.toLowerCase()]=!0})}}return b.forEach(function(w){if(w.characterData){E.characterData=!0,E.characterDataOldValue=!0;return}if(w.all){g(),E.characterData=!0,E.characterDataOldValue=!0;return}if(w.attribute){g([w.attribute.trim()]);return}var T=S._elementFilterAttributes(w.elementFilter).concat(w.attributeList||[]);T.length&&g(T)}),C&&(E.attributeFilter=Object.keys(C)),E},S.validateOptions=function(b){for(var E in b)if(!(E in S._optionKeys))throw Error("Invalid option: "+E);if(typeof b.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!b.queries||!b.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var C={callback:b.callback,rootNode:b.rootNode||document,observeOwnChanges:!!b.observeOwnChanges,oldPreviousSibling:!!b.oldPreviousSibling,queries:[]},g=0;g<b.queries.length;g++){var w=b.queries[g];if(w.all){if(Object.keys(w).length>1)throw Error("Invalid request option. all has no options.");C.queries.push({all:!0});continue}if("attribute"in w){var T={attribute:S._validateAttribute(w.attribute)};if(T.elementFilter=h.parseSelectors("*["+T.attribute+"]"),Object.keys(w).length>1)throw Error("Invalid request option. attribute has no options.");C.queries.push(T);continue}if("element"in w){var _=Object.keys(w).length,T={element:w.element,elementFilter:h.parseSelectors(w.element)};if(w.hasOwnProperty("elementAttributes")&&(T.attributeList=S._validateElementAttributes(w.elementAttributes),_--),_>1)throw Error("Invalid request option. element only allows elementAttributes option.");C.queries.push(T);continue}if(w.characterData){if(Object.keys(w).length>1)throw Error("Invalid request option. characterData has no options.");C.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return C},S._validateElementAttributes=function(b){if(!b.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var E={},C={},g=b.split(/\s+/),w=0;w<g.length;w++){var T=g[w];if(T){T=S._validateAttribute(T);var _=T.toLowerCase();if(E[_])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");C[T]=!0,E[_]=!0}}return Object.keys(C)},S._elementFilterAttributes=function(b){var E={};return b.forEach(function(C){C.qualifiers.forEach(function(g){E[g.attrName]=!0})}),Object.keys(E)},S._validateAttribute=function(b){if(typeof b!="string"||(b=b.trim(),!b))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!b.match(S._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+b);return b},S._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,S._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},S})(),v=(function(){function S(b){var E=this;this._connected=!1,this._options=y.validateOptions(b),this._observerOptions=y.createObserverOptions(this._options.queries),this._root=this._options.rootNode,this._callback=this._options.callback,this._elementFilter=Array.prototype.concat.apply([],this._options.queries.map(function(C){return C.elementFilter?C.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(C){return C.all}),this._queryValidators=[],S.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(C){return S.createQueryValidator(E._root,C)})),this._observer=new MutationObserver(function(C){E._observerCallback(C)}),this.reconnect()}return S.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},S.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var b=this._createSummaries(this._observer.takeRecords());return this._changesToReport(b)?b:void 0},S.prototype.disconnect=function(){var b=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,b},S.prototype._observerCallback=function(b){this._options.observeOwnChanges||this._observer.disconnect();var E=this._createSummaries(b);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))},S.prototype._createSummaries=function(b){if(!b||!b.length)return[];for(var E=new c(this._root,b,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),C=[],g=0;g<this._options.queries.length;g++)C.push(new u(E,this._options.queries[g]));return C},S.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(b){b&&b.recordPreviousState()})},S.prototype._runQueryValidators=function(b){this._queryValidators.forEach(function(E,C){E&&E.validate(b[C])})},S.prototype._changesToReport=function(b){return b.some(function(E){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(C){return E[C]&&E[C].length})||E.attributeChanged&&Object.keys(E.attributeChanged).some(function(C){return!!E.attributeChanged[C].length}))})},S})(),A=(function(){function S(b,E){this.root=b,this.delegate=E,this.idMap={}}return S.prototype.initialize=function(b,E){this.idMap[b]=this.root;for(var C=0;C<E.length;C++)this.deserializeNode(E[C],this.root)},S.prototype.applyChanged=function(b,E,C,g){var w=this;E.forEach(function(T){var _=w.deserializeNode(T);w.deserializeNode(T.parentNode),w.deserializeNode(T.previousSibling),_.parentNode&&_.parentNode.removeChild(_)}),b.forEach(function(T){var _=w.deserializeNode(T);_.parentNode&&_.parentNode.removeChild(_)}),E.forEach(function(T){var _=w.deserializeNode(T),M=w.deserializeNode(T.parentNode),N=w.deserializeNode(T.previousSibling);M.insertBefore(_,N?N.nextSibling:M.firstChild)}),C.forEach(function(T){var _=w.deserializeNode(T);Object.keys(T.attributes).forEach(function(M){var N=T.attributes[M];N===null?_.removeAttribute(M):(!w.delegate||!w.delegate.setAttribute||!w.delegate.setAttribute(_,M,N))&&_.setAttribute(M,N)})}),g.forEach(function(T){var _=w.deserializeNode(T);_.textContent=T.textContent}),b.forEach(function(T){delete w.idMap[T.id]})},S.prototype.deserializeNode=function(b,E){var C=this;if(b===null)return null;var g=this.idMap[b.id];if(g)return g;var w=this.root.ownerDocument;switch(w===null&&(w=this.root),b.nodeType){case Node.COMMENT_NODE:g=w.createComment(b.textContent);break;case Node.TEXT_NODE:g=w.createTextNode(b.textContent);break;case Node.DOCUMENT_TYPE_NODE:g=w.implementation.createDocumentType(b.name,b.publicId,b.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(g=this.delegate.createElement(b.tagName)),g||(g=w.createElement(b.tagName)),Object.keys(b.attributes).forEach(function(_){(!C.delegate||!C.delegate.setAttribute||!C.delegate.setAttribute(g,_,b.attributes[_]))&&g.setAttribute(_,b.attributes[_])});break;default:throw"Unsupported node type: "+b.nodeType}if(this.idMap[b.id]=g,E&&E.appendChild(g),b.childNodes)for(var T=0;T<b.childNodes.length;T++)this.deserializeNode(b.childNodes[T],g);return g},S})(),k=(function(){function S(b,E,C){var g=this;this.target=b,this.mirror=E,this.nextId=1,this.knownNodes=new r;for(var w=this.serializeNode(b).id,T=[],_=b.firstChild;_;_=_.nextSibling)T.push(this.serializeNode(_,!0));this.mirror.initialize(w,T);var M=[{all:!0}];C&&(M=M.concat(C)),this.mutationSummary=new v({rootNode:b,callback:function(N){g.applyChanged(N)},queries:M})}return S.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},S.prototype.rememberNode=function(b){var E=this.nextId++;return this.knownNodes.set(b,E),E},S.prototype.forgetNode=function(b){this.knownNodes.delete(b)},S.prototype.serializeNode=function(b,E){if(b===null)return null;var C=this.knownNodes.get(b);if(C!==void 0)return{id:C};var g={nodeType:b.nodeType,id:this.rememberNode(b)};switch(g.nodeType){case Node.DOCUMENT_TYPE_NODE:var w=b;g.name=w.name,g.publicId=w.publicId,g.systemId=w.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:g.textContent=b.textContent;break;case Node.ELEMENT_NODE:var T=b;g.tagName=T.tagName,g.attributes={};for(var _=0;_<T.attributes.length;_++){var M=T.attributes[_];g.attributes[M.name]=M.value}if(E&&T.childNodes.length){g.childNodes=[];for(var N=T.firstChild;N;N=N.nextSibling)g.childNodes.push(this.serializeNode(N,!0))}}return g},S.prototype.serializeAddedAndMoved=function(b,E,C){var g=this,w=b.concat(E).concat(C),T=new r;w.forEach(function(M){var N=M.parentNode,W=T.get(N);W||(W=new r,T.set(N,W)),W.set(M,!0)});var _=[];return T.keys().forEach(function(M){for(var N=T.get(M),W=N.keys();W.length;){for(var P=W[0];P.previousSibling&&N.has(P.previousSibling);)P=P.previousSibling;for(;P&&N.has(P);){var R=g.serializeNode(P);R.previousSibling=g.serializeNode(P.previousSibling),R.parentNode=g.serializeNode(P.parentNode),_.push(R),N.delete(P),P=P.nextSibling}W=N.keys()}}),_},S.prototype.serializeAttributeChanges=function(b){var E=this,C=new r;return Object.keys(b).forEach(function(g){b[g].forEach(function(w){var T=C.get(w);T||(T=E.serializeNode(w),T.attributes={},C.set(w,T)),T.attributes[g]=w.getAttribute(g)})}),C.keys().map(function(g){return C.get(g)})},S.prototype.applyChanged=function(b){var E=this,C=b[0],g=C.removed.map(function(M){return E.serializeNode(M)}),w=this.serializeAddedAndMoved(C.added,C.reparented,C.reordered),T=this.serializeAttributeChanges(C.attributeChanged),_=C.characterDataChanged.map(function(M){var N=E.serializeNode(M);return N.textContent=M.textContent,N});this.mirror.applyChanged(g,w,T,_),C.removed.forEach(function(M){E.forgetNode(M)})},S})();if(MutationObserver===void 0)throw Error("DOM Mutation Observers are required");n.ChildListChange=o,n.MutationProjection=c,n.MutationSummary=v,n.NodeChange=a,n.NodeMap=r,n.Qualifier=d,n.Selector=h,n.Summary=u,n.TreeChanges=l,n.TreeMirror=A,n.TreeMirrorClient=k,Object.defineProperty(n,"__esModule",{value:!0})}))})),eA=JC(),oo=0,io=new Array(1e3);function tA(){for(let e=0;e<oo;e+=2){const t=io[e],n=io[e+1];t(...n),io[e]=void 0,io[e+1]=void 0}oo=0}function nA(e,...t){io[oo]=e,io[oo+1]=t,oo+=2,oo===2&&oA()}function rA(){let e=0;const t=new MutationObserver(tA),n=document.createTextNode("");return t.observe(n,{characterData:!0}),()=>{n.data=String(e=++e%2)}}var oA=rA();function Np(){nA(()=>{Dc.hasListeners()&&(Dc.fire(),Np())})}var Dc=new Me({onFirstListenerAdd:Np}),Zs=Dc.once;function iA(e,t,n){const r=new Me;let o=[];return r.addDisposable(e(i=>{Zs(()=>{r.fire(t(o)),o=[]}),o.push(i)})),n?.addDisposable(r),r.event}var sA=class extends Me{constructor(e={}){super(),L(this,"_mutationSummary",void 0),this._mutationSummary=new eA.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}},aA=class extends Ee{_nextTickHandler(){Zs(()=>{this.trigger(),this._summaries.length&&(this._innerEmitter.hasListeners()?this._innerEmitter.fire(this._summaries):this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)}constructor(e={}){super(),L(this,"_mutationEmitter",void 0),L(this,"_innerEmitter",this.addDisposable(new Me({onFirstListenerAdd:()=>{this._nextTickHandler()}}))),L(this,"_lostEmitter",this.addDisposable(new Me)),L(this,"_paused",0),L(this,"_stopped",0),L(this,"_summaries",[]),L(this,"onMutate",this._innerEmitter.event),L(this,"onLost",this._lostEmitter.event),L(this,"onNativeMutate",void 0),this._mutationEmitter=this.addDisposable(new sA(e)),this.onNativeMutate=this._mutationEmitter.event,this.addDisposable(this._mutationEmitter.event(t=>{this._stopped||(this._paused?this._lostEmitter.fire(t):(this._summaries.push(...t),Zs(()=>{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--}trigger(){this._mutationEmitter.trigger(!0)}},lA=Zs,cA=class extends Ee{beginTextUpdate(){this._baseDocument.beginUpdate()}endTextUpdate(){this._baseDocument.endUpdate()}constructor(e,t,n){super(),L(this,"_baseDocument",void 0),L(this,"_remoteDocument",void 0),L(this,"_parsedDocument",void 0),L(this,"_nodeMap",void 0),L(this,"_beforeChangeEmitter",this.addDisposable(new Me)),L(this,"_beforeCommitEmitter",this.addDisposable(new Me)),L(this,"_onRefreshEmitter",this.addDisposable(new Me)),L(this,"_documentElement",void 0),L(this,"_docType",void 0),L(this,"_parseFn",void 0),L(this,"_mapHTMLRoots",void 0),L(this,"_roots",void 0),L(this,"_getRootsParent",void 0),L(this,"_mutationCollector",this.addDisposable(new aA)),L(this,"_attributeMapper",void 0),L(this,"ownership",void 0),L(this,"_reportedDrifts",new Set),L(this,"_commitPromise",void 0),L(this,"_pushUndoStop",!1),L(this,"_locked",!1),L(this,"_treeMutations",[]),L(this,"beforeChange",this._beforeChangeEmitter.event),L(this,"beforeCommit",this._beforeCommitEmitter.event),L(this,"onChange",Tw(iA(this._mutationCollector.onNativeMutate,o=>o.flat(),this),o=>o.length>0,this)),L(this,"onRefresh",this._onRefreshEmitter.event),this._baseDocument=e,this._remoteDocument=t,this._parseFn=n.prepareHtml,this._mapHTMLRoots=n.mapHTMLRoots,this._getRootsParent=n.rootsParent,this._roots=[...document.childNodes];const r=this._parsedDocument=new C0(e,n.createRoot);this._nodeMap=new nC,this.addDisposable(r.onRefresh(this._onRefresh.bind(this))),this.addDisposable(r.onMutate(this._onRemoteMutate.bind(this))),this._attributeMapper=new GC(this._nodeMap),this.addDisposable(uC(()=>this._mutationCollector.pause())),this.addDisposable(dC(()=>this._mutationCollector.resume())),this.addDisposable(this._mutationCollector.onLost(o=>this._attributeMapper.onHiddenMutate(o))),this.ownership=new XC(o=>!!this._nodeMap.getByElement(o)),this.addDisposable(this._mutationCollector.onLost(o=>this.ownership.observeLost(o)))}isUntracked(e){return this.ownership.isMarked(e)}markUntracked(e){this.ownership.markForeign(e)}_reportForeignStructure(e){try{const t=n=>!!this._nodeMap.getByElement(n);QC(YC(e,this.ownership,t),this._reportedDrifts),ZC(KC(e,t),this._reportedDrifts)}catch{}}commit(e=!0,t=!1){if(e&&(this._pushUndoStop=!0),t&&(this._locked=!0),!this._commitPromise){const n=()=>new Promise(r=>{try{this._beforeCommitEmitter.fire()}catch{}const o=this._mutationCollector.onMutate(i=>{i.length&&(this._reportForeignStructure(i),Ws("commit",()=>{const s=IC(i,this._nodeMap,this._parseFn,this._rootsParent());this._commit(s)}))});lA(()=>{const i=()=>{this._pushUndoStop=!1,this._commitPromise=void 0,this._locked=!1,r()};t?this._remoteDocument.saveChangesAsync(this._pushUndoStop).finally(i):(this._remoteDocument.saveChanges(this._pushUndoStop),i()),o.dispose()})});this._commitPromise=n()}return this._commitPromise}whenSent(){return this._remoteDocument.whenSent()}renderOnly(e){this._mutationCollector.stop();try{return e()}finally{this._mutationCollector.start()}}applyHidden(e){this._mutationCollector.pause();try{return e()}finally{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=DC(e);try{this._baseDocument.beginUpdate();const t=this._parsedDocument;Df(()=>{const n=np(t.applyingMutation,r=>this._nodeMap.getByNode(r),r=>t.isAttached(r));return n&&{...n,stage:"tree"}},()=>t.applyMutations(e));for(const n of e)n.type==="Hidden"&&this._nodeMap.remove(n.node,n.value)}finally{this._baseDocument.endUpdate()}}}correctNodes(e){const t=new Map;for(const n of e)if(!t.has(n)&&this._parsedDocument.contains(n)&&n.type===$.ELEMENT){const r=pc(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,Qr),i=this._nodeMap.getByNode(n);i&&(this._nodeMap.remove(n),this._nodeMap.set(o,i))}}finally{this._baseDocument.endUpdate()}}_onRefresh(e){try{Ws("refresh",()=>this._onRemoteMutate(e,!0))}finally{this._onRefreshEmitter.fire()}}_onRemoteMutate(e,t){if(this._treeMutations.push([e,t,Ww()??"other"]),!(this._remoteDocument.hasChanges()&&!this._remoteDocument.isApplyingRemote()))for(const[n,r,o]of this._treeMutations)Ws(o,()=>this._doOnRemoteMutate(n,r))}_doOnRemoteMutate(e,t){try{if(this._mutationCollector.stop(),e=iC(this._attributeMapper.onRemoteMutate(e),this._nodeMap),this._treeMutations=[],!t){const r=this._parsedDocument.root;for(const o of e)if(o.type==="Add"){if(o.parent===r){t=!0;break}}else if(o.type==="Remove"){if(o.node.parent===r){t=!0;break}}else if(o.type==="Move"&&(o.node.parent===r||o.parent===r)){t=!0;break}}const n=Q0(e,this._nodeMap,r=>this._parsedDocument.isAttached(r));if(this._beforeChangeEmitter.fire({domMutations:n.mutations,treeMutations:e}),eC(n,this._nodeMap),this._attributeMapper.restoreHidden(),t){const r=this._parsedDocument.root?.children;if(r){const o=r.map(s=>this._nodeMap.getByNode(s)).filter(s=>!!s),i=this._roots=this._mapHTMLRoots(o,this);Mc.isEqual(o,i)}}}finally{this._mutationCollector.start()}}getLinks(e){const t=this._nodeMap.getByElement(e),n=t?[[t,e]]:[];for(const r of e.childNodes)n.push(...this.getLinks(r));return n}setLinks(e){for(const[t,n]of e)this._nodeMap.set(t,n)}_clearLinks(e){for(const[t]of e)this._nodeMap.remove(t)}_removeByLinks(e,t){const n=new Set,r=[];for(const[o,i]of e)o.parent&&!n.has(o.parent)&&(this._parsedDocument.remove(o,t),r.unshift(ue.remove(i))),n.add(o);return r}getInnerHtml(e){let t=this._nodeMap.getByElement(e);return t?this._baseDocument.getText({start:t.startTagEnd===void 0?t.start:t.startTagEnd,end:t.endTagStart===void 0?t.end:t.endTagStart}):""}getOuterHtml(e){let t=this._nodeMap.getByElement(e);return t?this._baseDocument.getText({start:t.start,end:t.end}):""}setInnerHtml(e,t){if(e instanceof Element)e.innerHTML=t;else if(e instanceof Comment)e.data=t;else if(e instanceof Document){nt("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}}}},uA=class{constructor(){L(this,"_changes",null)}get(){return this._changes}hasChanges(){return!!this._changes?.length}add(e){const t=tn(this._changes,e);this._changes=t.length?t:null}clear(){this._changes=null}replace(e){this._changes=e.length?e:null}correctOffset(e,t){const n=this._changes;if(n){let r=0;for(let o=0,i=n.length;o<i;o++){const s=n[o];if(s.oldPosition<e)r+=s.newLength-s.oldLength;else break}e=e+(t?1:-1)*r}return e}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}},xp=60;function dA(e,t){if(e===t)return;const n=Math.min(e.length,t.length);let r=0;for(;r<n&&e[r]===t[r];)r+=1;return{offset:r,ownLength:e.length,cachedLength:t.length,own:e.substring(r,r+xp),cached:t.substring(r,r+xp)}}var mA=class extends Ee{constructor(...e){super(...e),L(this,"_onApplyEmitter",this.addDisposable(new Me)),L(this,"_onEmptyEmitter",this.addDisposable(new Me)),L(this,"_dispatched",[]),L(this,"onApply",this._onApplyEmitter.event),L(this,"onEmpty",this._onEmptyEmitter.event)}_emit(e){e.length&&this._onApplyEmitter.fire(e),this.hasDispatched()||this._onEmptyEmitter.fire()}hasDispatched(){return!!this._dispatched.length}append(e,t){this._dispatched.unshift({changeId:t,textChanges:e})}apply(e,t){const n=t===void 0?-1:this._dispatched.findIndex(r=>r.changeId===t);if(n>=0){this._confirmEcho(n,e);return}this._applyExternal(e)}_confirmEcho(e,t){const[n]=this._dispatched.splice(e,1);this._emit(tn(Bn(n.textChanges),t))}_applyExternal(e){let t=[];for(const n of this._dispatched)t=tn(t,Bn(n.textChanges));this._dispatched=[],this._emit(tn(t,e))}clear(){this._dispatched=[]}},fA=class AS extends Ee{constructor(t=""){super(),L(this,"_text",void 0),this._text=t}getText(t){const n=t0(this,t);return n?this._text.substring(n.start,n.end):""}getLength(){return this._text.length}clone(){return new AS(this._text)}},Qs=class TS extends fA{constructor(t=""){super(t),L(this,"_eventQueue",void 0),L(this,"_lockCounter",0),L(this,"_onChangeEmitter",this.addDisposable(new Me)),L(this,"_onChangedEmitter",this.addDisposable(new Me)),L(this,"onChanged",this._onChangedEmitter.event)}applyEdits(t,n){if(n=n.flatMap(r=>a0(this,r)),n.length){const r=Zr(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=o0(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=tn(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 TS(this._text)}};function Mp(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function Js(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 pA(e){return(t,n,r)=>Js(t)?e(t,n,r):!1}function hA(e){return t=>Js(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function gA(e){return(t,n,r)=>Js(t)?Mp(t)?e(t,n,r):t:!1}function bA(e){return t=>{const n=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return Js(n)?Mp(n)?e(t):t:!1}}function yA(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function Bc(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 vA(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 EA=8,SA=class{constructor(){L(this,"_byKey",Object.create(null)),L(this,"_byValue",Object.create(null))}getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=vA(EA),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},ea=new SA;function Rp(e,t){return t!==void 0&&!Bc(e,t)?`%|{${ea.getOrCreateByKey(e)}}|%`:e}function wA(e){const t=ea.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function Ye(e,t,n){return t!==void 0?Bc(e,t)?e:`%|{${ea.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function CA(e){return e.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")}function ze(e){return e.startsWith("<!--")&&e.endsWith("-->")?CA(e.slice(4,-3)):e}function AA(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 TA(e,t,n){return t!==void 0?Bc(e,t)?e:`%|{${ea.getOrCreateByKey(e)}}|%`:n||yA(e)||AA(e)?`<!--${e}-->`:e}var yr=pA(Ye),vr=hA(ze),_A=gA(Ye),kA=bA(ze),LA=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",wA),e.escape("@{","}",Ye,!0).unescape("<!--@{","}-->",ze,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",Rp,!0),e.escape("{{","}}",Rp,!0),e.createSyntax("brace-percent").escape("{%","%}",Ye).unescape("<!--{%","%}-->",ze),e.createSyntax("brace-hash").escape("{#","#}",Ye).unescape("<!--{#","#}-->",ze),e.createSyntax("proscript").escape("[%","%]",TA,!0).unescape("<!--[%","%]-->",ze,!0),e.createSyntax("getresponse").escape("[[IF","]]",Ye).escape("[[if","]]",Ye).escape("[[ELSE]]","",Ye).escape("[[else]]","",Ye).escape("[[ENDIF]]","",Ye).escape("[[endif]]","",Ye).unescape("<!--[[IF","]]-->",ze).unescape("<!--[[if","]]-->",ze).unescape("<!--[[ELSE]]","-->",ze).unescape("<!--[[else]]","-->",ze).unescape("<!--[[ENDIF]]","-->",ze).unescape("<!--[[endif]]","-->",ze),e.createSyntax("expert-sender").escape("<if",">",Ye).escape("</if",">",Ye).escape("<else",">",Ye).escape("</else",">",Ye).escape("<var ",">",Ye,!0).unescape("<!--<if ",">-->",ze).unescape("<!--</if",">-->",ze).unescape("<!--<else ",">-->",ze).unescape("<!--</else",">-->",ze).unescape("<!--<var",">-->",ze,!0),e.createSyntax("velocity").escape("#if",")",yr).escape("#elseif",")",yr).escape("#else","",Ye).escape("#foreach",")",yr).escape("#macro",")",yr).escape("#set",")",_A,!0).escape("#parse",")",yr).escape("#include",")",yr).escape("#evaluate",")",yr).escape("#end","",Ye).escape("#break","",Ye).escape("#stop","",Ye).unescape("<!--#macro","-->",vr).unescape("<!--#if","-->",vr).unescape("<!--#elseif","-->",vr).unescape("<!--#else","-->",ze).unescape("<!--#foreach","-->",vr).unescape("<!--#parse","-->",vr).unescape("<!--#include","-->",vr).unescape("<!--#evaluate","-->",vr).unescape("<!--#end","-->",ze).unescape("<!--#break","-->",ze).unescape("<!--#stop","-->",ze).unescape("<!--#set","-->",kA,!0),e.createSyntax("mailchimp").escape("*|","|*",Ye).unescape("<!--*|","|*-->",ze)},Op="bare",Hc=new Map;function NA(e){for(const t of Object.keys(e)){const n=e[t];n&&Hc.set(t,n)}}function xA(e){return e?Hc.get(e)??Op:Op}function MA(){Hc.clear()}function Pp(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 ai(e,t){return e.start<t.end&&t.start<e.end}function Ip(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:m,syntax:p,isVariable:f}of i){if(r?(l.insideAttributeValue=!0,l.attributeQuoteChar='"'):Pp(e,c,u.start,l),c=u.end,a.some(A=>ai(A,u)))continue;const h=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,y=e.substring(u.start,u.end),v=d(y,h,l.insideTag);v!==!1&&v!==y&&(s.push({range:u,text:v,overrideBuiltins:m,syntax:p,isVariable:f}),a.push(u))}return s.sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end)}function RA(e,t){const n=t.reduce((a,{mapFn:l,start:c,end:u,syntax:d,isVariable:m})=>(a[c]||(a[c]=[]),a[c].push({value:u,mapFn:l,syntax:d,isVariable:m}),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 Fc(e,t,n,r,o=!1){const i=[];if(n&&(t=t.filter(c=>c.isVariable)),!t.length)return i;const s=RA(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:m}=s[c];r?(a.insideAttributeValue=!0,a.attributeQuoteChar='"'):Pp(e,l,u,a),l=u;const p=a.insideAttributeValue?a.attributeQuoteChar??"":void 0;let f=!1;for(const{mapFn:h,value:y,syntax:v,isVariable:A}of m){let k=u+d.length,S=e.indexOf(y,k);for(;S!==-1;){let b=S,E=u+d.length,C=0;for(;b!==-1;){const M=e.indexOf(d,E);if(M!==-1&&M<b)C++,E=M+d.length,b=e.indexOf(y,E);else if(C>0)C--,E=b+y.length,b=e.indexOf(y,E);else break}if(b<0)break;const g=b+y.length,w=e.substring(u,g),T=h(w,p,a.insideTag);if(T===!1){k=S+Math.max(y.length,1),S=e.indexOf(y,k);continue}(o||T!==w)&&i.push({range:{start:u,end:g},text:o?w:T,syntax:v,isVariable:A});const _=s.findIndex(({start:M})=>M>=g);_>c?c=_-1:c=s.length,f=!0;break}if(f)break}}return i}function ta(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 Dp=class{constructor(e=LA){L(this,"_disposables",[]),L(this,"_escapes",[]),L(this,"_unescapes",[]),L(this,"_escapeMatchers",[]),L(this,"_unescapeMatchers",[]);const{_escapes:t,_unescapes:n}=this;e({createSyntax(r){return{...this,syntax:r}},escape(r,o,i,s){return t.push({start:r,end:o,mapFn:i,isVariable:s,syntax:this.syntax||r}),this},unescape(r,o,i,s){return n.push({start:r,end:o,mapFn:i,isVariable:s,syntax:this.syntax||r}),this}})}registerMatcherPair(e){const t=e.syntax||"matcher",n={syntax:t,match:e.escape.match,mapFn:e.escape.mapFn,isVariable:e.escape.isVariable,overrideBuiltins:e.escape.overrideBuiltins},r={syntax:t,match:e.unescape.match,mapFn:e.unescape.mapFn,isVariable:e.unescape.isVariable,overrideBuiltins:e.unescape.overrideBuiltins};this._escapeMatchers.push(n),this._unescapeMatchers.push(r);let o=!1;const i={dispose:()=>{o||(o=!0,this._escapeMatchers=this._escapeMatchers.filter(s=>s!==n),this._unescapeMatchers=this._unescapeMatchers.filter(s=>s!==r))}};return this.addDisposable(i),i}_collectMappings(e,t,n){const r=Fc(e,this._escapes,t,n),o=Ip(e,this._escapeMatchers,t,n),i=o.filter(l=>l.overrideBuiltins).map(l=>l.range),s=r.filter(l=>!i.some(c=>ai(c,l.range))),a=o.filter(l=>l.overrideBuiltins||!s.some(c=>ai(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=Fc(e,this._unescapes,t),r=Ip(e,this._unescapeMatchers,t,!1),o=r.filter(a=>a.overrideBuiltins).map(a=>a.range),i=n.filter(a=>!o.some(l=>ai(l,a.range))),s=r.filter(a=>a.overrideBuiltins||!i.some(l=>ai(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=>xA(o)==="html-comment";return this._collectRevertMappings(e,t).filter(o=>o.isVariable||!r(o.syntax))}getDetectedMappings(e,t,n){return Fc(e,this._escapes,t,n,!0)}getEscapedText(e,t){return ta(e,this.getMappings(e,t))}getUnescapedText(e,t,n){return ta(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=ta(o,this._collectRevertMappings(o).filter(i=>n(i.syntax)==="bare"))),r.includes("html-comment")&&(o=ta(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()}},OA=class extends Qs{constructor(){super(),L(this,"_editStack",new uA),L(this,"_editLog",[]),L(this,"_entityId",void 0),L(this,"_versionController",this.addDisposable(new mA)),L(this,"_beforeSaveEmitter",this.addDisposable(new Aw)),L(this,"_onReadyEmitter",this.addDisposable(new Me)),L(this,"_onEntitySetEmitter",this.addDisposable(new Me)),L(this,"_onPendingSentEmitter",this.addDisposable(new Me)),L(this,"_cache",new Qs),L(this,"beforeSave",this._beforeSaveEmitter.event),L(this,"_reverting",!1),L(this,"_inited",!1),L(this,"_nextChangeId",1),L(this,"_rev",null),L(this,"_pendingSave",null),L(this,"_applyingRemote",!1),L(this,"_handleUpdateEntity",({edits:e,guid:t,changeId:n,rev:r})=>{if(t===this._entityId)return this._reportSyncDrift("update-entity"),this._onRemoteChange(e,n,r)}),L(this,"_handleSetEntity",e=>{this._reportSyncDrift("set-entity"),MA(),NA(e.templateDirectivesPolicy??{}),this._entityId=e.guid,this._onEntitySetEmitter.fire(e.guid),this._editStack.clear(),this._versionController.clear(),this._pendingSave=null,this._onPendingSentEmitter.fire();const t=[[{range:yc(this._cache),text:e.html}]];return this._onRemoteChange(t,void 0,e.rev)}),L(this,"_onRemoteChange",(e,t,n)=>new Promise((r,o)=>{const{_cache:i}=this;let s=[];for(const a of e){const l=a.reverse();s=tn(s,Zr(l,i)),i.applyEdits(Jr,l)}this._rev=n??null,this._versionController.apply(s,t),this._versionController.hasDispatched()||this._flushPendingSave(),this._versionController.hasDispatched()?this.addDisposable(this._versionController.onEmpty(()=>{r()})):(this._onReadyEmitter.fire(),r())})),L(this,"onReady",this._onReadyEmitter.event),L(this,"onEntitySet",this._onEntitySetEmitter.event),this.addDisposable(Z.addListenerAsync(Pe.SANDBOX_SET_ENTITY,this._handleSetEntity)),this.addDisposable(Z.addListenerAsync(Pe.SANDBOX_UPDATE_ENTITY,this._handleUpdateEntity)),this._versionController.onApply(this._onApply.bind(this))}loadState(e){this._entityId=e.entityId;const t=[[{range:yc(this._cache),text:e.text}]];this._onRemoteChange(t)}saveState(){return{entityId:this._entityId,text:this.getText()}}_onApply(e){const t=this._editStack.get();if(!t){super.applyEdits(Jr,gr(e));return}const n=zf(t,e,"after"),r=n&&zf(e,t,"before");if(!n||!r){this._editStack.clear(),super.applyEdits(Jr,gr(tn(Bn(t),e)));return}try{this._applyingRemote=!0,super.applyEdits(Jr,gr(r))}finally{this._applyingRemote=!1}this._editStack.replace(n)}isApplyingRemote(){return this._applyingRemote}_flushPendingSave(){if(this._pendingSave!==null){const e=this._pendingSave;this._pendingSave=null,this.saveChanges(e),this._onPendingSentEmitter.fire()}}whenSent(){return this._pendingSave===null?Promise.resolve():new Promise(e=>{const t=this._onPendingSentEmitter.event(()=>{t.dispose(),e()})})}_reportSyncDrift(e){if(this._editStack.hasChanges()||this._versionController.hasDispatched())return;const t=dA(this.getText(),this._cache.getText());if(t){const{offset:n,ownLength:r,cachedLength:o}=t;Gs("host-copy-drift",()=>({at:e,text:{offset:n,ownLength:r,cachedLength:o}}))}}applyEdits(e,t){if(!this._reverting){const n=Zr(t,this);this._editStack.add(n),super.applyEdits(e,t),this._editLog.push(t)}}correctOffset(e,t){return this._editStack.correctOffset(e,t)}correctRange(e,t){return this._editStack.correctRange(e,t)}saveChanges(e=!0){if(!this._reverting&&this._rev!==null&&this._versionController.hasDispatched())return this._editStack.hasChanges()&&(this._pendingSave=(this._pendingSave??!1)||e),!0;if(!this._reverting&&this._beforeSaveEmitter.fire(e)!==!1&&this._entityId){const t=this._editStack.get()?.flatMap(n=>l0(n));if(t){const n=this._nextChangeId++;this._editStack.clear(),this._versionController.append(t,n),Z.send(Pe.APPLICATION_UPDATE_ENTITY,{guid:this._entityId,pushUndoStop:e,edits:gr(t),changeId:n,...this._rev!==null?{baseRev:this._rev}:{}})}return!0}return!1}saveChangesAsync(e=!0){return new Promise(t=>{const n=setTimeout(()=>nt("error while async saving"),1e4);if(this.saveChanges(e)===!1&&clearTimeout(n),!this.hasChanges()||this._pendingSave!==null)clearTimeout(n),t();else{const r=this.onReady(()=>{r.dispose(),clearTimeout(n),t()})}})}hasChanges(){return this._editStack.hasChanges()}},PA=class extends Dp{constructor(e,t){super(),L(this,"_baseDocument",void 0),L(this,"_mappedDocument",void 0),L(this,"_mappings",[]),L(this,"_cachedMappedDocument",new Qs),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=Zr(this.getMappings(n),this._baseDocument),o=Bn(this._mappings);if(t=tn(o,t),t=tn(t,r),this._mappings=r,t.length){const i=gr(t);this._mappedDocument.applyEdits(e,zs(i))}}}correctOffset(e,t){const n=t?this._mappings:Bn(this._mappings),r=hc(n,({oldPosition:i})=>i>=e),o=r>0?n[r-1]:void 0;return o&&(o.oldEnd>e?e+=o.newPosition-o.oldPosition:e+=o.newEnd-o.oldEnd),e}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}getMappedReplacementRangeAtPosition(e){const t=Bn(this._mappings).find(({oldPosition:n,oldEnd:r})=>e>=n&&e<r);return t?{start:t.oldPosition,end:t.oldEnd}:null}hasMappedReplacementRangeInRange(e){return Bn(this._mappings).some(({oldPosition:t,oldEnd:n})=>t<e.end&&n>e.start)}isMappedElementInPosition(e){return!!this._mappings.find(t=>t.newPosition<e&&t.newEnd>e)}escape(e,t){const n=this.getMappings(e,!1,t);return ni(e,n)}unescape(e){const t=this.getRevertMappings(e);return ni(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=Jr){const t=this._baseDocument.getText(),n=this.getMappings(t),r=ni(t,n);this._mappings=Zr(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=Zr(this.getRevertMappings(n),this._mappedDocument),o=this._mappings;if(t=tn(o,t),t=tn(t,r),this._mappings=Bn(r),t.length){const i=gr(t);this._baseDocument.applyEdits(e,zs(i))}}}};function IA(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function li(e){let t=e.head;if(!t){t=e.createElement("head");const n=IA(e);n.insertBefore(t,n.firstChild)}return t}function DA(e){const t=Object.create(null),n=e.getAttributeNames();for(const r of n)t[r]=e.getAttribute(r);return t}function BA(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}function HA(e){const t=li(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 Bp="amp-custom";function FA(e,t){return`em-${e.replaceAll("-","_")}-${t.toLowerCase()}`}function Hp(e,t,n){for(const r of t)if(oi.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(Nc(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 oi.isMediaRule(r)&&Hp(e,r.cssRules,n)}function Fp(e,t){const n=t.sheet;if(n){const i=new Set;Hp(e,n.cssRules,(s,a)=>{const l=FA(s,a),c=[...n.cssRules],u=`.${l} { ${s}: ${a} }`;return!c.find(d=>oi.isStyleRule(d)&&d.selectorText===`.${l}`)&&!i.has(u)&&(i.add(u),t.innerHTML=`
2
- .${l} { ${s}: ${a} };
3
- ${t.innerHTML}`),l}),i.size&&(t.innerHTML=`
4
- ${[...i].join(`
5
- `)};
6
- ${t.innerHTML}`)}const r=t.innerHTML,o=r.replace(/!important/g,"");r!==o&&(t.innerHTML=o)}function $A(e){const t=li(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(Bp)===""){Fp(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=`
7
- ${o.join("")}
8
- `,i.setAttribute(Bp,""),t.append(i),Fp(e,i)}for(const i of n)i.remove()}var $c="<!doctype html>";function WA(e){const t=e.doctype;if(t){if(rp(t)===$c)return;const n=new DOMParser().parseFromString($c,"text/html").doctype;e.replaceChild(n,t)}else{const n=new DOMParser().parseFromString($c,"text/html").doctype;e.insertBefore(n,e.firstChild)}}async function $p(e,t={}){const n=document.createElement("amp-img"),r=await Y0(e)||void 0,o=[];try{let i=e;for(;i&&Nc(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=BA(e);let c=!1;if(l){const d=l.getAttribute("width");try{let m=a?`${a}px`:"";d||(l.setAttribute("width","720px"),m=getComputedStyle(e).width||""),l.setAttribute("width",!d||parseInt(d)>320?"320px":"720px"),m!==(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={...DA(e),alt:e.alt,width:a,height:s,src:u,layout:c?"responsive":"fixed",...t};for(const d of Object.keys(t))Hn(n,d,t[d])}finally{for(const[i,s]of o)i.style.display=s}return n}async function qA(e,t){const n=[...e.querySelectorAll("img")],r=[];for(const i of n)r.push($p(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($p(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 zA(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=li(e),r=e.createElement("meta");r.setAttribute("charset","utf-8"),n.insertBefore(r,n.firstChild)}function VA(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 Wp="https://cdn.ampproject.org/v0",qp=`${Wp}.js`,UA=`script[src='${qp}']`;function jA(e,t){return`${Wp}/${e.toLowerCase()}-${t}.js`}async function GA(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=li(e),a=n.createElementFn("script"),l=jA(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(`
9
- `))}}}var hq=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),gq=function(e,t){return new URL(e,t).href},bq={},Wc=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)})},zp=void 0;async function na(){return zp||(zp=await Wc(()=>Promise.resolve().then(()=>Ql("./rules.CnnzdMsj.js")).then(e=>e.default),void 0,{}.url))}var qc=new Map;async function XA(){if(!qc.size){const e=await na(),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))||[];qc.set(o,{...r,priority:n,attrs:new Map([...i,...a].map(l=>[l.name,l]))})}}return qc}var zc=new Map;async function YA(){if(!zc.size){const e=await na();for(const t of e.declarations)zc.set(t.name,t)}return zc}var KA="$GLOBAL_ATTRS",Vc=new Map;async function ZA(){if(!Vc.size){const e=(await na()).attrLists.find(t=>t.name===KA)?.attrs;if(e)for(const t of e)Vc.set(t.name,t)}return Vc}function QA(e){return vn(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function Vp(e){return j0(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}function Up(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--)Up(i[s],t,n)}if(vn(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 xc(e)?o():ii(e)&&(e.textContent?.trim()||e.nextSibling?.textContent?.trim()&&ii(e.nextSibling))&&r()}async function JA(e,t){const n=new Set,r=t.commit,o=p=>t.replaceSelectors(p.toLowerCase());if(t.replaceImages&&await qA(e,r),t.injectExtensions){const p=t.replaceSelectors(UA);if(!e.querySelector(p)){const f=t.createElementFn("script");f.setAttribute("src",qp),f.setAttribute("async",""),li(e).appendChild(f),r?.()}}t.injectRequiredTags&&(VA(e,t.createElementFn,o),WA(e),HA(e),zA(e),r?.()),t.replaceStylesAndLinks&&($A(e),r?.());const i=await na(),s=await XA(),a=new Set(t.removeUnsupportedTags?e.querySelectorAll("*"):[]),l=new Map;for(let[p,f]of s)if(!f.deprecation){p=o(p);let h=[...e.querySelectorAll(p)].filter(y=>!l.has(y));f.unique&&h.length&&(h=[h[0]]),t.injectRequiredTags&&f.required&&!h.length&&(h=[...h,t.createElementFn(f.name)]);for(const y of h){if(t.injectRequiredAttributes&&y.getAttribute("on")&&!y.getAttribute("tabindex")&&y.setAttribute("tabindex","0"),t.removeUnsupportedStyles){let A=!1;for(const k of[...y.classList])k.startsWith("i-amphtml")&&(A=!0,y.classList.remove(k));A&&!y.classList.length&&y.removeAttribute("class")}const v=l.get(y);v&&v.priority>f.priority||l.set(y,f)}}r?.();for(const[p,f]of l){if(t.injectExtensions&&f.requiresExtension)for(const v of f.requiresExtension)n.add(v);const h=f.requiredParent?f.requiredParent==="$ROOT"?e:e.querySelector(f.requiredParent):null;h&&(!p.parentNode||t.moveInvalidTagPosition)?h!==p.parentNode&&(f.name==="HEAD"||vn(h)&&h.tagName==="HEAD"?h.insertBefore(p,h.firstChild):h.appendChild(p)):p.parentNode||e.body.appendChild(p),t.removeUnsupportedTags&&a.delete(p),r?.();const y=await ZA();if(t.removeUnsupportedAttributes||t.injectRequiredAttributes){const v=f.attrs,A=t.injectRequiredAttributes?new Set([...v].map(([S,b])=>b).filter(S=>S.required&&S.value)):void 0,k=p.getAttributeNames();for(const S of k){const b=v.get(S)||y.get(S);if(b){if(S==="id"||S==="class"||S==="style"){A?.delete(b);continue}if(t.removeUnsupportedAttributes){const E=p.getAttribute(S);if(b.value&&b.value.indexOf(E)<0){p.removeAttribute(S);continue}if(b.valueRegex&&!new RegExp(b.valueRegex).test(E)){p.removeAttribute(S);continue}if(b.disallowedValueRegex&&new RegExp(b.disallowedValueRegex).test(E)){p.removeAttribute(S);continue}const C=b.valueUrl;if(C){if(E===""){if(!C.allowEmpty){p.removeAttribute(S);continue}}else if(!(E.indexOf("<!--")>0&&E.indexOf("-->")>0)){if(!C.allowRelative)if(E.startsWith("#")||E.startsWith("/")){p.removeAttribute(S);continue}else{const g=C.protocol.length?C.protocol:["https"],w=E.substring(0,E.indexOf(":"));if(w){if(g.indexOf(w)<0){const T=g[0]+E.substring(E.indexOf(":"));if(URL.canParse(T))Hn(p,S,T);else{p.removeAttribute(S);continue}}else if(!URL.canParse(E)){p.removeAttribute(S);continue}}else{const T=g[0]+E;if(URL.canParse(T))Hn(p,S,T);else{p.removeAttribute(S);continue}}}}}}A?.delete(b)}else{if(S==="id"||S==="class"||S==="style")continue;t.removeUnsupportedAttributes&&p.removeAttribute(S)}}if(A)for(const S of A)Hn(p,S.name,S.value[0])}r?.()}t.moveInvalidTagPosition&&(Up(e,e.body,o),r?.());for(const p of a)p.remove();if(r?.(),t.removeUnsupportedStyles){let h=function(S){const b=S.cssText.replaceAll(/\".*\"/g,"").replaceAll(/\'.*\'/g,"").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g,"").match(/[a-z-]+(?=:[^before|after|hover])/gi)||[];for(const E of b){if(!E)continue;const C=S.getPropertyValue(E);S.getPropertyPriority(E)==="important"&&S.setProperty(E,C);const g=f.get(E);g?g.value?g.value.indexOf(C)<0&&S.removeProperty(E):g.valueRegex&&(new RegExp(g.valueRegex).test(C)||S.removeProperty(E)):S.removeProperty(E)}r?.()},y=function(S){return S.constructor.name==="CSSStyleRule"},v=function(S){return S.constructor.name==="CSSMediaRule"},A=function(S){const b=S.cssRules;for(let E=b.length-1;E>=0;E--){const C=b[E];y(C)?C.selectorText.indexOf("[")>=0||C.selectorText.indexOf(":")>=0?S.deleteRule(E):(h(C.style),C.style.cssText||S.deleteRule(E)):v(C)?(A(C),C.cssRules.length||S.deleteRule(E)):S.deleteRule(E)}};var c=h,u=y,d=v,m=A;const p=e.querySelectorAll("*"),f=await YA();for(const S of p)if(Nc(S)){const b=S.getAttribute("style");b&&(h(S.style),S.style.length?S.style.cssText!==b&&S.setAttribute("style",S.style.cssText):S.removeAttribute("style"))}const k=e.querySelector("style[amp-custom]");if(k){const S=k.sheet;S&&(A(S),k.innerHTML=[...S.cssRules].map(b=>b.cssText).join(`
10
- `)),r?.()}}await GA(e,i.extensions.filter(({name:p})=>n.has(p)),t)}function eT(e,t){return Object.keys(t).reduce((n,r)=>n.replaceAll(r,t[r]),e)}function jp(e,t={}){const{correct:n=!0,injectExtensions:r=!0,mappedTags:o={}}=t;return JA(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=>eT(i.toLowerCase(),o),commit:t.commit})}var tT=/^(chrome-extension|moz-extension|safari-extension):\/\//i,nT=/local\.adguard\.org/i,rT=/^bis_/i,oT=new Set(["data-bis-config"]),so=/<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,iT=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,ra=/<style\b[^>]*>[\s\S]*?<\/style>/gi,Gp=/display:\s*none\s*!important/gi,sT=[".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; }"],Xp=new Set(["em","data-theme-varibalse","data-em-localization"]);function aT(e){return Gp.lastIndex=0,(e.match(Gp)||[]).length}function Uc(e){const t=e.trim(),n=aT(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=sT.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 lT(e){if(Xp.has("em")&&e.getAttribute("em")==="styles")return!1;for(const t of Xp)if(e.hasAttribute(t))return!1;return Uc(e.textContent||"")}function Yp(e){return tT.test(e.src)||nT.test(e.src)?!0:e.hasAttribute("bis_use")||e.hasAttribute("data-bis-config")}function Kp(e){let t=!1;for(const n of[...e.attributes])(rT.test(n.name)||oT.has(n.name))&&(e.removeAttribute(n.name),t=!0);return t}function cT(e){ra.lastIndex=0;for(const t of e.matchAll(ra))if(Uc(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function uT(e){let t=!1;return ra.lastIndex=0,{html:e.replace(ra,n=>Uc(n.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):n),found:t}}function Zp(e){let t=!1;return e instanceof Element&&Kp(e)&&(t=!0),e.querySelectorAll("script").forEach(n=>{Yp(n)&&(n.remove(),t=!0)}),e.querySelectorAll("style").forEach(n=>{n.tagName==="STYLE"&&lT(n)&&(n.remove(),t=!0)}),e.querySelectorAll("*").forEach(n=>{Kp(n)&&(t=!0)}),t}function dT(e){return so.lastIndex=0,so.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||cT(e)}function mT(e){if(!dT(e))return{html:e,found:!1};let t=!1,n=e;so.lastIndex=0,so.test(n)&&(so.lastIndex=0,n=n.replace(so,""),t=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(n)||/\sdata-bis-config\s*=/.test(n))&&(n=n.replace(iT,""),t=!0);const r=uT(n);return n=r.html,t=t||r.found,{html:n,found:t}}function jc(){Z.send(Pe.RELOAD),window.location.reload()}function fT(e){const t=new Ee;function n(){const o=new Set;for(const i of document.querySelectorAll("script"))i instanceof HTMLScriptElement&&Yp(i)||e.getOuterHtml(i)&&(i.src||i.innerHTML).trim()&&o.add((i.src||i.innerHTML).trim());return o}let r=n();return t.addDisposable(Z.addListener(Pe.RELOAD,jc)),t.addDisposable(e.onChange(()=>{let o=n();for(const i of r)o.has(i)||jc();r=o})),t}var oa=[];function pT(e){return oa.push(e),{dispose:()=>{const t=oa.indexOf(e);t!==-1&&oa.splice(t,1)}}}function Gc(e){for(const t of oa){const n=t(e);if(n)return n}return e}function hT(){const e=document.querySelector("[em-edit]");return e?Gc(e):null}var ia=new Set(["img","image","input","video","source","em-replace"]);function Qp(e){const t=e.toLowerCase(),n=ia.has(t);return ia.add(t),{dispose:()=>{n||ia.delete(t)}}}function gT(e){return ia.has(e.toLowerCase())}var ci=[];function bT(e){return ci.push(e),{dispose:()=>{const t=ci.indexOf(e);t!==-1&&ci.splice(t,1)}}}function Jp(e){return ci.some(t=>t.isPathElement?.(e))}function yT(e,t){let n;for(const r of ci){const o=r.caption?.(e,t);o&&(n={...n,...o})}return n}function eh(e){return e.tagName==="TD"&&e===e.closest("amp-accordion")?.querySelector(":scope > section header td")}var vT={isPathElement(e){return e.tagName==="AMP-ACCORDION"||e.tagName==="AMP-CAROUSEL"||eh(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(eh(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}}},ET=class extends Ee{constructor(...e){super(...e),L(this,"hasAmp",!1)}};function ST(e,t,n=""){for(const r of e.classList)if(r.startsWith(`${t}-`))return r.replaceAll(`${t}-`,"");return n}function wT(e,t,n){const r=ST(e,t);r!==n&&(e.classList.remove(`${t}-${r}`),n&&e.classList.add(`${t}-${n}`))}function CT(){const e=new Ee;return e.addDisposable(p0(t=>t.startsWith("amp"))),e.addDisposable(h0(t=>t==="class"||t==="style")),e}function AT(e){const t=o=>Vp(o)&&e.getOuterHtml(o)!==""||QA(o)||U0(o),n=o=>{if(t(o))return!0;if(vn(o)||xc(o)){for(const i of o.querySelectorAll("*"))if(t(i))return!0}return!1},r=new ET;return r.addDisposable(pT(o=>o.closest("amp-img"))),r.addDisposable(bT(vT)),r.addDisposable(CT()),r.addDisposable(Qp("amp-img")),r.addDisposable(Qp("amp-anim")),r.addDisposable(e.onChange(o=>{let i=r.hasAmp,s=!1;for(const a of o){if(a.added.some(l=>n(l))){s=!0,i=!0;break}if(a.removed.some(l=>n(l))){i=n(document);break}}r.hasAmp!==i?(r.hasAmp=i,Z.send(Pe.APPLICATION_HAS_AMP,i),setTimeout(()=>{if(i)jp(document,{correct:!1});else{const a=[...document.querySelectorAll("script")];for(const l of a)Vp(l)&&l.remove();jc()}})):s&&setTimeout(()=>{jp(document,{correct:!1})})})),r.addDisposable(Z.addListener(o=>{if(o.data?.operation==="sandbox_element_settings_set"){const i=document.querySelector("[em-edit]");if(i){const s=o.data?.settings?.ampShow;s!==void 0&&(wT(i,"em-amp-show",s==="amp"?"only":s==="html"?"disabled":void 0),e.commit())}}})),r}function TT(e,t){const n=AT(t);return e.inject(sc,n),{service:n,dispose(){n.dispose(),Jt(e,sc)}}}var _T={name:"sandbox.amp",provides:[sc],awaits:{services:[te]},setup(e){const{service:t}=TT(e,D(e,te));e.addService(yf,()=>({ampService:t}))}};(function(){"use strict";function e(t,n){var r,o=0,i=t.length,s,a="",l,c,u,d,m,p,f,h,y=!0,v=!1,A;r=arguments.length>1?n:{},typeof r.indent>"u"&&(r.indent=" "),typeof r.openbrace=="string"&&(y=r.openbrace==="end-of-line"),typeof r.autosemicolon=="boolean"&&(v=r.autosemicolon);function k(w){return w===" "||w===`
11
- `||w===" "||w==="\r"||w==="\f"}function S(w){return w==="'"||w==='"'}function b(w){return l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||"-_*.:#[]".indexOf(w)>=0}function E(){for(var w=p;w>0;w-=1)a+=r.indent}function C(){a=A(a),y?a+=" {":(a+=`
12
- `,E(),a+="{"),c!==`
13
- `&&(a+=`
14
- `),p+=1}function g(){var w;p-=1,a=A(a),a.length>0&&v&&(w=a.charAt(a.length-1),w!==";"&&w!=="{"&&(a+=";")),a+=`
15
- `,E(),a+="}",s.push(a),a=""}for(String.prototype.trimRight?A=function(w){return w.trimRight()}:A=function(w){return w.replace(/\s+$/,"")},m={Start:0,AtRule:1,Block:2,Selector:3,Ruleset:4,Property:5,Separator:6,Expression:7,URL:8},p=0,d=m.Start,h=!1,s=[],t=t.replace(/\r\n/g,`
16
- `);o<i;){if(l=t.charAt(o),c=t.charAt(o+1),o+=1,S(f)){a+=l,l===f&&(f=null),l==="\\"&&c===f&&(a+=c,o+=1);continue}if(S(l)){a+=l,f=l;continue}if(h){a+=l,l==="*"&&c==="/"&&(h=!1,a+=c,o+=1);continue}if(l==="/"&&c==="*"){h=!0,a+=l,a+=c,o+=1;continue}if(d===m.Start){if(s.length===0&&k(l)&&a.length===0)continue;if(l<=" "||l.charCodeAt(0)>=128){d=m.Start,a+=l;continue}if(b(l)||l==="@"){if(u=A(a),u.length===0)s.length>0&&(a=`
17
-
18
- `);else if(u.charAt(u.length-1)==="}"||u.charAt(u.length-1)===";")a=u+`
19
-
20
- `;else for(;c=a.charAt(a.length-1),!(c!==" "&&c.charCodeAt(0)!==9);)a=a.substr(0,a.length-1);a+=l,d=l==="@"?m.AtRule:m.Selector;continue}}if(d===m.AtRule){if(l===";"){a+=l,d=m.Start;continue}if(l==="{"){u=A(a),C(),d=u==="@font-face"?m.Ruleset:m.Block;continue}a+=l;continue}if(d===m.Block){if(b(l)){if(u=A(a),u.length===0)s.length>0&&(a=`
21
-
22
- `);else if(u.charAt(u.length-1)==="}")a=u+`
23
-
24
- `;else for(;c=a.charAt(a.length-1),!(c!==" "&&c.charCodeAt(0)!==9);)a=a.substr(0,a.length-1);E(),a+=l,d=m.Selector;continue}if(l==="}"){g(),d=m.Start;continue}a+=l;continue}if(d===m.Selector){if(l==="{"){C(),d=m.Ruleset;continue}if(l==="}"){g(),d=m.Start;continue}a+=l;continue}if(d===m.Ruleset){if(l==="}"){g(),d=m.Start,p>0&&(d=m.Block);continue}if(l===`
25
- `){a=A(a),a+=`
26
- `;continue}if(!k(l)){a=A(a),a+=`
27
- `,E(),a+=l,d=m.Property;continue}a+=l;continue}if(d===m.Property){if(l===":"){a=A(a),a+=": ",d=m.Expression,k(c)&&(d=m.Separator);continue}if(l==="}"){g(),d=m.Start,p>0&&(d=m.Block);continue}a+=l;continue}if(d===m.Separator){if(!k(l)){a+=l,d=m.Expression;continue}S(c)&&(d=m.Expression);continue}if(d===m.Expression){if(l==="}"){g(),d=m.Start,p>0&&(d=m.Block);continue}if(l===";"){a=A(a),a+=`;
28
- `,d=m.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=m.URL;continue}continue}if(d===m.URL&&l===")"&&a.charAt(a.length-1!=="\\")){a+=l,d=m.Expression;continue}a+=l}return a=s.join("")+a,a}window.cssbeautify=e})();function kT(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 LT=["transform","transform-origin","overflow-x","height"];function NT(e,t){return!(e>0)||!(t>0)||e<=t?1:t/e}function ui(e,t){const n=t<1?`scale(${t})`:"";if(e.style.transform===n)return!1;for(const r of LT)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 xT(e,t){const n=e,r=n?.querySelector("table:first-child"),o=Math.max(n?.offsetWidth??0,r?.offsetWidth??0);return o>0?o:(ui(t,1),t.scrollWidth)}function MT(e,t=window){const n=t.document.documentElement,r=n.style.transform,o=NT(xT(e,n),t.innerWidth);return ui(n,o),n.style.transform!==r&&t.parentIFrame?.size?.(),o}function RT(e,t){ui(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;ui(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 lt(e){const t=D(e,xe);return n=>{t.commit(n)}}function th(){return D(Et,te)}function OT(){return D(Et,mt)}function PT(){return D(Et,Zt)}function IT(){return Et.getInstance(te)!==void 0}function Er(e){D(Et,xe).commit(e)}function Xc(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)=>Xc(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)&&Xc(e[i],t[i]))}function nh(e,t){const n={watch(r){let o,i=!1;return e.watch(s=>{const a=t(s);i&&Xc(o,a)||(o=a,i=!0,r(a))})},select(r){return nh(n,r)}};return n}function rh(...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 nh(o,i)}};return o}var sa={lockEditorInit:!0,lockEdit:!1,lockEditor:!0,activeElementLocked:0,applicationTheme:"light",applicationMode:"default",previewHeight:0,emailWidth:0,previewPage:!1,globalHolder:null,elementPath:[],activeElementText:"",selectedElem:null,iframeOffsetTop:0,scrollTop:0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,elementAIimageEnabled:!0,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,blocksAddPanelEnabled:!0,codeMode:!0,appName:"",isLeftButtonDown:!1,isProgrammaticSelection:!1,isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1,actualTargetCount:0,activeCell:[],commonStyles:{},loadStylesTimer:!1,_pushUndoStop:!1},di=rh({...sa});function Ut(){return di.get()}var aa=new Me,ao=new Map,x={source:di,get(e){return Ut()[e]},getState(){return{...Ut()}},getStateRef(){return Ut()},set(e,t){if(Ut()[e]===t)return;di.set({...Ut(),[e]:t}),aa.fire({[e]:t});const n=ao.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(Ut()[r]!==o){di.set({...Ut(),[r]:o}),n[r]=o,t=!0;const i=ao.get(r);i&&i.forEach(s=>s(o))}}t&&aa.fire(n)},increment(e,t=1){const n=Ut()[e];typeof n=="number"&&x.set(e,n+t)},decrement(e,t=1){const n=Ut()[e];typeof n=="number"&&x.set(e,n-t)},subscribe(e){return aa.event(e)},subscribeToKey(e,t){ao.has(e)||ao.set(e,new Set);const n=ao.get(e),r=t;return n.add(r),()=>{n.delete(r),n.size===0&&ao.delete(e)}},reset(){di.set({...sa}),aa.fire(Ut())},resetKey(e){this.set(e,sa[e])},isEditingLocked(){const e=Ut();return e.lockEdit||e.lockEditor||e.lockEditorInit},isActiveElementLocked(){return Ut().activeElementLocked>0},getInitialState(){return sa}};function oh(e){const t=()=>{document.body?.classList.toggle("mceNonEditable",e),document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable",e?"false":"true")})};IT()?th().applyHidden(t):t()}function la(){return x.get("lockEdit")||x.get("lockEditor")}function DT(){return x.subscribe(e=>{"lockEditor"in e&&oh(la())})}function BT(e){return e.beforeChange(({domMutations:t})=>{const n=t.flatMap(r=>r.type==="Add"&&r.node instanceof Element?[r.node]:[]);n.length&&queueMicrotask(()=>{if(!la())return;const r=n.flatMap(o=>[...o.tagName==="EDITOR"?[o]:[],...Array.from(o.querySelectorAll("editor"))]);e.applyHidden(()=>{for(const o of r)o.isConnected&&o.setAttribute("contenteditable","false")})})})}function HT(e,t){const n=rh(),r=e.addListener(t,o=>n.set(o));return{source:n,dispose:()=>r.dispose()}}var FT=["copyPasteEnabled","saveBlockEnabled","editImageControlEnabled","elementAIimageEnabled","imageCenterStockEnabled","imageCenterGifEnabled","imageCenterEditorEnabled","blocksAddPanelEnabled"];function $T(e){const t="fec11667";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 WT={name:"sandbox.hostFacts",provides:[jr],setup(e){const t=Object.fromEntries(Object.entries(Iw).map(([n,r])=>[n,HT(Z,r).source]));e.inject(jr,t)}},qT={name:"sandbox.hostFactsToState",awaits:{services:[jr,xe,te]},setup(e){const t=D(e,jr),n=lt(e);t.theme.watch(r=>{x.set("applicationTheme",r),$T(r),n(!1)}),t.commonStyles.watch(r=>{r&&x.set("commonStyles",r)}),t.flags.watch(r=>{for(const o of FT)typeof r[o]<"u"&&x.set(o,r[o])}),DT(),BT(D(e,te)),t.lockEditor.watch(r=>x.set("lockEditor",r)),t.codeMode.watch(r=>x.set("codeMode",r)),t.appName.watch(r=>x.set("appName",r)),t.previewPage.watch(r=>{x.set("previewPage",r),document.body?.classList.toggle("em-sandbox-preview",r)})}},zT={name:"sandbox.viewport",awaits:{services:[jr]},setup(e){D(e,jr).viewport.watch(t=>kT(t,void 0,{state:x,previewHeight:t.previewHeight,iframeOffsetTop:t.iframeOffsetTop,scrollTop:t.scrollTop,globalHolder:x.get("globalHolder"),setBlockGroupControlsPosition:()=>e.getServices(vf).forEach(n=>n()),messageService:Z}))}};function Jn(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function ft(e,t,n=!1){for(const r of e.querySelectorAll(t))n||!r.childNodes.length?r.remove():r.replaceWith(...r.childNodes)}function VT(e,t){if(e.data.value)document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable","false")}),document.body.classList.add("em-sandbox-discuss");else{const n=la()?"false":"true";document.querySelectorAll("editor").forEach(r=>{r.setAttribute("contenteditable",n)}),document.body.classList.remove("em-sandbox-discuss","em-sandbox-discuss_set-target")}}function UT(e,t){e.data.value?document.body.classList.add("em-sandbox-discuss_set-target"):document.body.classList.remove("em-sandbox-discuss_set-target")}function jT(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}}),document.body.classList.remove("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 GT(e,t){document.body.classList.remove("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 XT(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 YT={sandbox_lock_discuss:VT,sandbox_discuss_set_target:UT,sandbox_discuss_remove_target:jT,sandbox_discuss_reset:GT,sandbox_discuss_get_target:XT};function KT(e,t){x.set("lockEdit",!!e.data.data),oh(la())}function ZT(e,t){t.setEditorFocus(e.data.data)}function QT(e,t){let n=e.data.data;if(typeof n!="number")return;n=OT().correctOffset(n,!0),n=PT().correctOffset(n,!0);let r=th().getElementByPosition(n);if(r&&!(r instanceof Element)&&(r=r.parentElement),!(r instanceof HTMLElement))return;const o=r.getBoundingClientRect();r.tagName!=="BODY"&&o.height&&o.width&&document.querySelector("[em-edit]")!==r&&t.applicationElementSettingsSet({elem:r});const i=r.getBoundingClientRect(),s=i.top-x.get("previewHeight")/2+i.height/2;t.messageService.send({operation:"application_scroll-to",settings:{value:x.get("applicationMode")==="default"?s+x.get("iframeOffsetTop"):s}})}var JT={sandbox_lock_edit:KT,editor_change_focus:ZT,update_position_from_editor:QT};function e_(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 t_(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 n_(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 r_(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 o_={sandbox_set_attr_to_images:e_,sandbox_set_attr_to_links:t_,sandbox_set_position_to_img:n_,sandbox_set_position_to_link:r_},i_={brightness:100,contrast:100,sepia:0},ca={DARK:"dark",LIGHT:"light"},ih=!1;function s_(e){ih||(e.setFetchMethod(t=>window.fetch(t)),ih=!0)}function a_(){let e=null,t=ca.LIGHT;return{set(n){if(t=n,n===ca.DARK){e??(e=Wc(()=>Promise.resolve().then(()=>Ql("./darkreader.CLd5EML2.js")),void 0,{}.url)),e.then(r=>{t===ca.DARK&&(s_(r),r.enable(i_))}).catch(r=>{e=null});return}e?.then(r=>{t===ca.LIGHT&&r.disable()})},clear(n){return n.replaceAll(/\s*?--darkreader.+?: .*?;/g,"")}}}var sh=a_();function l_(e,t){t.initPreview(!0)}function c_(e){const t=e.data?.data?.theme;(t==="light"||t==="dark")&&sh.set(t)}var u_={init_preview:l_,sandbox_switch_theme:c_},Yc={increment:e=>x.increment(e),decrement:e=>x.decrement(e)};function nn(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(Ef,{owner:e,handlers:s})}}}var d_={name:"sandbox.operationEnvironment",provides:[Kn],setup(e){const t={iframeOffsetTop:0,previewHeight:0,elementPath:[],lockEdit:!1};x.subscribe(n=>{for(const r of["iframeOffsetTop","previewHeight","elementPath","lockEdit"])r in n&&n[r]!==void 0&&Object.assign(t,{[r]:n[r]})}),e.inject(Kn,t)}},m_=nn("discuss",YT,{services:[xe,Kn]},e=>{const t=lt(e),n=D(e,Kn);return()=>({commit:t,iframeOffsetTop:n.iframeOffsetTop,previewHeight:n.previewHeight,messageService:Z,removeAllAttributes:Jn})}),f_=nn("editor",JT,{services:[He,at]},e=>{const t=D(e,He),n=D(e,at);return()=>({applicationElementSettingsSet:t,messageService:Z,setEditorFocus:r=>n.setEditorFocus(r)})}),p_=nn("images",o_,{services:[He,vt,xe,Kn]},e=>{const t=D(e,He),n=D(e,vt),r=lt(e),o=D(e,Kn);return()=>({applicationElementSettingsSet:t,commit:r,iframeOffsetTop:o.iframeOffsetTop,previewHeight:o.previewHeight,messageService:Z,setCursorPosition:i=>n(i)})}),h_=nn("preview",u_,{services:[Jo]},e=>()=>({initPreview:t=>D(e,Jo)(t)})),g_={name:"sandbox.operationsDispatcher",setup(e){Z.addListener(t=>{const n=t.data?.operation;if(!n)return;const r=e.getServices(Ef).map(o=>o.handlers[n]).filter(Boolean).pop();if(r)try{r(t)}catch{}})}},b_=[d_,m_,f_,p_,h_,g_],y_=["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"],v_=["style","class","align","href"],E_=new Set([...y_,"em-element-path_img"]);function S_(e){return e.split(/\s+/).filter(t=>t&&!E_.has(t)).join(" ")}var w_=32;function C_(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function A_(e){const t=[e.tagName];for(const n of v_){const r=e.getAttribute(n),o=n==="class"&&r!==null?S_(r):r;o!==null&&o!==""&&t.push(`${n}=${o}`)}return t.join("|")}function T_(e){if(!e||!e.isConnected)return"";const t=[];let n=e,r=0;for(;n&&r<w_&&(t.push(A_(n)),!C_(n));)n=n.parentElement,r++;return t.join("||")}function __(e){let t={text:"",ancestors:""};const n=r=>({text:r?e(r):"",ancestors:T_(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 k_(e){let t=x.get("activeElementLocked");x.subscribe(n=>{if(n.activeElementLocked===void 0)return;const r=t>0&&n.activeElementLocked===0;t=n.activeElementLocked,r&&Promise.resolve().then(()=>{x.get("activeElementLocked")===0&&e.remember(document.querySelector("[em-edit]"))})})}var ah=Promise.resolve(),lh=null;function L_(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 N_(e,t){lh=e,ah=ah.finally(()=>{lh===e&&L_(e,t)})}function x_(e,t="unknown"){const n=Et.getInstance(at);if(!n){e();return}n.controller.whenEditorLostFocus(e,t)}function M_(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 R_(e){window.getSelection();const t=e.startContainer,n=t.nodeType===Node.TEXT_NODE?t.parentElement:t instanceof Element?t:null;if(!n||!n.contains(e.commonAncestorContainer))return!1;const r=n.textContent??"",o=e.toString(),i=r.replace(/\s+/g," ").trim(),s=o.replace(/\s+/g," ").trim();return r===o||i===s}function X(e){if(O_(e))return P_(e)?e.trim():I_(e)}var ch={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},O_=e=>typeof e=="string"&&e.trim()!=="",P_=e=>ch.HEX.test(e);function I_(e){const t=ch.RGB.exec(e)?.groups;if(!t)return;const n=D_(t);return H_(n)}var D_=e=>({r:Kc(e.r),g:Kc(e.g),b:Kc(e.b),a:B_(e.a)}),Kc=e=>parseInt(e||"0",10),B_=e=>parseFloat(e||"1"),H_=e=>`#${Zc(e.r)}${Zc(e.g)}${Zc(e.b)}`,Zc=e=>e.toString(16).padStart(2,"0"),ua=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function uh(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function Sr(e,t){return Array.from(e.classList).find(n=>n.includes(t))}function dh(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?dh(t):!1)}function I(e){const t=document.createElement(e.tag||"div");if(t.setAttribute("contentEditable","false"),e.width&&(t.style.width=e.width+"px"),e.height&&(t.style.height=e.height+"px"),e.left&&(t.style.left=e.left+"px"),e.top&&(t.style.top=e.top+"px"),e.className&&(t.className=e.className),e.style&&t.setAttribute("style",e.style),e.HTMLcontent&&(t.innerHTML=e.HTMLcontent),e.title&&t.setAttribute("title",e.title),e["data-id"]&&t.setAttribute("data-id",e["data-id"]),e.targetElement){const n=typeof e.targetElement=="string"?document.querySelector(e.targetElement):e.targetElement;if(n)switch(e.insertType){case"append":n.append(t);break;case"prepend":n.prepend(t);break;case"before":n.before(t);break;case"after":n.after(t);break;case"replaceWith":n.replaceWith(t)}}return t}function F_(e){try{return JSON.parse(e),!0}catch{return!1}}function mh(e,t,n=2){const r=e.split(""),o=t.split("");if(Math.abs(r.length-o.length)>n)return!1;let i=0;if(r.length===o.length){for(let s=0;s<r.length;s++)if(r[s]!==o[s]&&(i++,i>n))return!1}else{const s=r.length>o.length?r:o,a=r.length>o.length?o:r;let l=0,c=0;for(;l<s.length&&c<a.length;)if(s[l]!==a[c]){if(i++,i>n)return!1;l++}else l++,c++;if(l<s.length&&i++,i>1)return!1}return!0}function lo(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function $_(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 da(){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 Qc(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 mi(e,t=da()){e=ua(e)??"";const n=i=>ua(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=mi(e,s),o))break}return o}function Jc(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 ma(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&&ma({elem:e.elem.previousSibling,width:e.width})}function W_(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 q_=e=>{if(e instanceof Text)return e.textContent||"";if(e instanceof Element){if(e.tagName==="BR")return`
29
- `;if(e.classList?.contains(".em-element-path"))return"";if(e.classList?.contains("em-code"))return"⃠";if(e.tagName==="EM-REPLACE")return"⃡"}};function fh(e,t){if(!e)return"";const n=t(e);return n===void 0?[...e.childNodes].map(r=>fh(r,t)).join(""):n}function z_(e){const t=e.firstElementChild||e;return t.tagName!=="EDITOR"?t.tagName:"div"}function V_(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 U_(e,t=!0){const n=document.createRange(),r=window.getSelection();r&&(n.selectNodeContents(e),n.collapse(t),r.removeAllRanges(),r.addRange(n))}function j_(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 G_(e){return e.trim().split(" ").slice(0,-1).join(" ")||""}function eu(){return hT()}function X_(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 ph(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)ph(r,t)}}function Y_(e=document){e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}var tu="data-em-caret",yq="​",fi=e=>e();function co(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-em-caret")}function pi(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.tagName==="EM-REPLACE"&&!e.hasAttribute("src")}function wr(e){return(e??"").replaceAll("​","")}function K_(e){return(e.nodeType===Node.TEXT_NODE||co(e))&&wr(e.textContent)===""}function hh(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)}function gh(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(!pi(r))return null;const o=document.createRange();if(o.selectNodeContents(r),o.setEnd(t,n),wr(o.toString())==="")return{em:r,side:"before"};const i=document.createRange();return i.selectNodeContents(r),i.setStart(t,n),wr(i.toString())===""?{em:r,side:"after"}:null}function bh(e,t){if(!e.collapsed)return null;const n=gh(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(wr(t==="backward"?s.slice(0,o):s.slice(o))!=="")return null;const a=r.parentNode,l=co(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&&K_(i);)i=t==="backward"?i.previousSibling:i.nextSibling;return pi(i)?i:null}function fa(e,t,n=fi){const r=t==="after"?e.nextSibling:e.previousSibling;let o;if(co(r))o=r;else{const s=document.createElement("span");s.setAttribute(tu,""),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 hh(i,i.length),o}function nu(e,t=fi,n){const r=Array.from(e.querySelectorAll(`[${tu}]`)).filter(o=>o!==n&&wr(o.textContent)==="");r.length&&t(()=>r.forEach(o=>o.remove()))}function Z_(e,t=fi){const n=wr(e.textContent);if(n==="")return null;const r=document.createTextNode(n);return e.before(r),t(()=>e.remove()),hh(r,r.length),r}function yh(e){e.querySelectorAll(`[${tu}]`).forEach(t=>{const n=wr(t.textContent);n===""?t.remove():t.replaceWith(t.ownerDocument.createTextNode(n))})}function Q_(e,t){const n=bh(e,t);if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o?.removeAllRanges(),o?.addRange(r),n}function J_(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 ek(){document.execCommand("delete")}function tk(e,t=fi,n=ek){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=>pi(l)&&J_(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;pi(l)?fa(l,"after",t):!l&&pi(c)&&fa(c,"before",t)}return!0}function vh(){const e=window.getSelection();return e?.rangeCount?bh(e.getRangeAt(0),"backward"):null}function nk(e,t=fi){const n=e.isConnected?e:vh();n&&(n.closest('[contenteditable="true"]')?.focus({preventScroll:!0}),fa(n,"after",t))}var rk=0;function it(e){return e>=48&&e<=57}function er(e){return it(e)||e>=65&&e<=70||e>=97&&e<=102}function ru(e){return e>=65&&e<=90}function ok(e){return e>=97&&e<=122}function ik(e){return ru(e)||ok(e)}function sk(e){return e>=128}function pa(e){return ik(e)||sk(e)||e===95}function Eh(e){return pa(e)||it(e)||e===45}function ak(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function ha(e){return e===10||e===13||e===12}function Cr(e){return ha(e)||e===32||e===9}function En(e,t){return!(e!==92||ha(t)||t===rk)}function ga(e,t,n){return e===45?pa(t)||t===45||En(t,n):pa(e)?!0:e===92?En(e,t):!1}function ou(e,t,n){return e===43||e===45?it(t)?2:t===46&&it(n)?3:0:e===46?it(t)?2:0:it(e)?1:0}function Sh(e){return e===65279||e===65534?1:0}var iu=new Array(128),vq=128,Eq=130,Sq=131,wq=132,Cq=133;for(let e=0;e<iu.length;e++)iu[e]=Cr(e)&&130||it(e)&&131||pa(e)&&132||ak(e)&&133||e||128;function su(e){return e<128?iu[e]:132}function uo(e,t){return t<e.length?e.charCodeAt(t):0}function au(e,t,n){return n===13&&uo(e,t+1)===10?2:1}function mo(e,t,n){let r=e.charCodeAt(t);return ru(r)&&(r=r|32),r===n}function hi(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(ru(s)&&(s=s|32),s!==i)return!1}return!0}function lk(e,t){for(;t>=0&&Cr(e.charCodeAt(t));t--);return t+1}function ba(e,t){for(;t<e.length&&Cr(e.charCodeAt(t));t++);return t}function lu(e,t){for(;t<e.length&&it(e.charCodeAt(t));t++);return t}function fo(e,t){if(t+=2,er(uo(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&er(uo(e,t));t++);const n=uo(e,t);Cr(n)&&(t+=au(e,t,n))}return t}function ya(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!Eh(n)){if(En(n,uo(e,t+1))){t=fo(e,t)-1;continue}break}}return t}function va(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),it(n)&&(t=lu(e,t+1),n=e.charCodeAt(t)),n===46&&it(e.charCodeAt(t+1))&&(t+=2,t=lu(e,t)),mo(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),it(n)&&(t=lu(e,t+1+r+1))}return t}function cu(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}En(n,uo(e,t+1))&&(t=fo(e,t))}return t}function wh(e){if(e.length===1&&!er(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 Ch=["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"],ck=16384;function Ea(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,ck)):e}var Ah=10,uk=12,Th=13;function _h(e){const t=e.source,n=t.length,r=t.length>0?Sh(t.charCodeAt(0)):0,o=Ea(e.lines,n),i=Ea(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===Ah||c===Th||c===uk)&&(c===Th&&l+1<n&&t.charCodeAt(l+1)===Ah&&(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 dk=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||_h(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||_h(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]}}}},jt=16777215,tr=24,mk=new Map([[2,22],[21,22],[19,20],[23,24]]),fk=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=Ea(this.offsetAndType,e.length+1),o=Ea(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 m=a&jt;for(a=o[m],s=a>>tr,o[i]=m,o[m++]=i;m<i;m++)o[m]===n&&(o[m]=i);break}case 21:case 2:case 19:case 23:o[i]=a,s=mk.get(c),a=s<<tr|i}r[i++]=c<<tr|d,l===-1&&(l=u)}),r[i]=0<<tr|n,o[i]=n,o[n]=n;a!==0;){const c=a&jt;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]>>tr:0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&jt:this.source.length}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?hi(this.source,this.offsetAndType[e-1]&jt,this.offsetAndType[e]&jt,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&jt:this.offsetAndType[this.tokenCount]&jt: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]&jt,t=this.offsetAndType[t],this.tokenType=t>>tr,this.tokenEnd=t&jt):(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>>tr,this.tokenEnd=e&jt):(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]&jt: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&jt,s=o>>tr;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:Ch[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}};function Sa(e,t){function n(d){return d<a?e.charCodeAt(d):0}function r(){if(c=va(e,c),ga(n(c),n(c+1),n(c+2))){u=12,c=ya(e,c);return}if(n(c)===37){u=11,c++;return}u=10}function o(){const d=c;if(c=ya(e,c),hi(e,d,c,"url")&&n(c)===40){if(c=ba(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 m=e.charCodeAt(c);switch(su(m)){case d:c++;return;case 130:if(ha(m)){c+=au(e,c,m),u=6;return}break;case 92:if(c===e.length-1)break;const p=n(c+1);ha(p)?c+=au(e,c+1,p):En(m,p)&&(c=fo(e,c)-1)}}}function s(){for(u=7,c=ba(e,c);c<e.length;c++){const d=e.charCodeAt(c);switch(su(d)){case 41:c++;return;case 130:if(c=ba(e,c),n(c)===41||c>=e.length){c<e.length&&c++;return}c=cu(e,c),u=8;return;case 34:case 39:case 40:case 133:c=cu(e,c),u=8;return;case 92:if(En(d,n(c+1))){c=fo(e,c)-1;break}c=cu(e,c),u=8;return}}}e=String(e||"");const a=e.length;let l=Sh(n(0)),c=l,u;for(;c<a;){const d=e.charCodeAt(c);switch(su(d)){case 130:u=13,c=ba(e,c+1);break;case 34:i();break;case 35:Eh(n(c+1))||En(n(c+1),n(c+2))?(u=4,c=ya(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:ou(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 44:u=18,c++;break;case 45:ou(d,n(c+1),n(c+2))?r():n(c+1)===45&&n(c+2)===62?(u=15,c=c+3):ga(d,n(c+1),n(c+2))?o():(u=9,c++);break;case 46:ou(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:ga(n(c+1),n(c+2),n(c+3))?(u=3,c=ya(e,c+1)):(u=9,c++);break;case 91:u=19,c++;break;case 92:En(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 po=null,Ve=class bn{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return bn.createItem(t)}allocateCursor(t,n){let r;return po!==null?(r=po,po=po.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=po,po=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=bn.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 bn;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 bn;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 bn;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(bn.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(bn.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(bn.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(bn.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(bn.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 wa(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}
30
- `)}})}var kh=100,pk=60,hk=" ";function Lh({source:e,line:t,column:n},r){function o(u,d){return i.slice(u,d).map((m,p)=>String(u+p+1).padStart(l)+" |"+m).join(`
31
- `)}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>kh&&(c=n-pk+3,n=58);for(let u=s;u<=a;u++)u>=0&&u<i.length&&(i[u]=i[u].replace(/\t/g,hk),i[u]=(c>0&&i[u].length>c?"…":"")+i[u].substr(c,98)+(i[u].length>c+kh-1?"…":""));return[o(s,t),new Array(n+l+2).join("-")+"^",o(t,a)].filter(Boolean).join(`
32
- `)}function Nh(e,t,n,r,o){return Object.assign(wa("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment(i){return Lh({source:t,line:r,column:o},isNaN(i)?0:i)},get formattedMessage(){return`Parse error: ${e}
33
- `+Lh({source:t,line:r,column:o},2)}})}function gk(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 xh=()=>{},bk=33,yk=35,uu=59,Mh=123,Rh=0;function vk(e){return function(){return this[e]()}}function du(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 Ek(e){const t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:du(e.atrule),pseudo:du(e.pseudo),node:du(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]=vk(e.parseContext[n])}return{config:t,...t,...t.node}}function Sk(e){let t="",n="<unknown>",r=!1,o=xh,i=!1;const s=new dk,a=Object.assign(new fk,Ek(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:gk,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(c){return c===Mh?1:0},consumeUntilLeftCurlyBracketOrSemicolon(c){return c===Mh||c===uu?1:0},consumeUntilExclamationMarkOrSemicolon(c){return c===bk||c===uu?1:0},consumeUntilSemicolonIncluded(c){return c===uu?2:0},createList(){return new Ve},createSingleNodeList(c){return new Ve().appendData(c)},getFirstListNode(c){return c&&c.first},getLastListNode(c){return c&&c.last},parseWithFallback(c,u){const d=this.tokenIndex;try{return c.call(this)}catch(m){if(i)throw m;const p=u.call(this,d);return i=!0,o(m,p),i=!1,p}},lookupNonWSType(c){let u;do if(u=this.lookupType(c++),u!==13)return u;while(u!==Rh);return Rh},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 mo(t,c,u)},cmpStr(c,u,d){return hi(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,va(t,this.tokenStart));return this.eat(c),u},eat(c){if(this.tokenType!==c){const u=Ch[c].slice(0,-6).replace(/-/g," ").replace(/^./,p=>p.toUpperCase());let d=`${/[[\](){}]/.test(u)?`"${u}"`:u} is expected`,m=this.tokenStart;switch(c){case 1:this.tokenType===2||this.tokenType===7?(m=this.tokenEnd-1,d="Identifier is expected but function found"):d="Identifier is expected";break;case 4:this.isDelim(yk)&&(this.next(),m++,d="Name is expected");break;case 11:this.tokenType===10&&(m=this.tokenEnd,d="Percent sign is expected")}this.error(d,m)}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(lk(t,t.length-1)):s.getLocation(this.tokenStart);throw new Nh(c||"Unexpected input",t,d.offset,d.line,d.column)}});return Object.assign(function(c,u){t=c,u=u||{},a.setSource(t,Sa),s.setSource(t,u.offset,u.line,u.column),n=u.filename||"<unknown>",r=!!u.positions,o=typeof u.onParseError=="function"?u.onParseError:xh,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:m}=u;if(!(d in a.context))throw new Error("Unknown context `"+d+"`");typeof m=="function"&&a.forEachToken((f,h,y)=>{if(f===25){const v=a.getLocation(h,y),A=hi(t,y-2,y,"*/")?t.slice(h+2,y-2):t.slice(h+2,y);m(A,v)}});const p=a.context[d].call(a,u);return a.eof||a.error(),p},{SyntaxError:Nh,config:a.config})}var wk=Yn((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,m=52;return r<=n&&n<=o?n-r:i<=n&&n<=s?n-i+d:a<=n&&n<=l?n-a+m:n==c?62:n==u?63:-1}})),Ck=Yn((e=>{var t=wk(),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,m=s(c);do d=m&o,m>>>=n,m>0&&(d|=i),u+=t.encode(d);while(m>0);return u},e.decode=function(c,u,d){var m=c.length,p=0,f=0,h,y;do{if(u>=m)throw new Error("Expected more digits in base 64 VLQ value.");if(y=t.decode(c.charCodeAt(u++)),y===-1)throw new Error("Invalid base64 digit: "+c.charAt(u-1));h=!!(y&i),y&=o,p=p+(y<<f),f+=n}while(h);d.value=a(p),d.rest=u}})),mu=Yn((e=>{function t(g,w,T){if(w in g)return g[w];if(arguments.length===3)return T;throw new Error('"'+w+'" is a required argument.')}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(g){var w=g.match(n);return w?{scheme:w[1],auth:w[2],host:w[3],port:w[4],path:w[5]}:null}e.urlParse=o;function i(g){var w="";return g.scheme&&(w+=g.scheme+":"),w+="//",g.auth&&(w+=g.auth+"@"),g.host&&(w+=g.host),g.port&&(w+=":"+g.port),g.path&&(w+=g.path),w}e.urlGenerate=i;var s=32;function a(g){var w=[];return function(T){for(var _=0;_<w.length;_++)if(w[_].input===T){var M=w[0];return w[0]=w[_],w[_]=M,w[0].result}var N=g(T);return w.unshift({input:T,result:N}),w.length>s&&w.pop(),N}}var l=a(function(w){var T=w,_=o(w);if(_){if(!_.path)return w;T=_.path}for(var M=e.isAbsolute(T),N=[],W=0,P=0;;)if(W=P,P=T.indexOf("/",W),P===-1){N.push(T.slice(W));break}else for(N.push(T.slice(W,P));P<T.length&&T[P]==="/";)P++;for(var R,Y=0,P=N.length-1;P>=0;P--)R=N[P],R==="."?N.splice(P,1):R===".."?Y++:Y>0&&(R===""?(N.splice(P+1,Y),Y=0):(N.splice(P,2),Y--));return T=N.join("/"),T===""&&(T=M?"/":"."),_?(_.path=T,i(_)):T});e.normalize=l;function c(g,w){g===""&&(g="."),w===""&&(w=".");var T=o(w),_=o(g);if(_&&(g=_.path||"/"),T&&!T.scheme)return _&&(T.scheme=_.scheme),i(T);if(T||w.match(r))return w;if(_&&!_.host&&!_.path)return _.host=w,i(_);var M=w.charAt(0)==="/"?w:l(g.replace(/\/+$/,"")+"/"+w);return _?(_.path=M,i(_)):M}e.join=c,e.isAbsolute=function(g){return g.charAt(0)==="/"||n.test(g)};function u(g,w){g===""&&(g="."),g=g.replace(/\/$/,"");for(var T=0;w.indexOf(g+"/")!==0;){var _=g.lastIndexOf("/");if(_<0||(g=g.slice(0,_),g.match(/^([^\/]+:\/)?\/*$/)))return w;++T}return Array(T+1).join("../")+w.substr(g.length+1)}e.relative=u;var d=(function(){return!("__proto__"in Object.create(null))})();function m(g){return g}function p(g){return h(g)?"$"+g:g}e.toSetString=d?m:p;function f(g){return h(g)?g.slice(1):g}e.fromSetString=d?m:f;function h(g){if(!g)return!1;var w=g.length;if(w<9||g.charCodeAt(w-1)!==95||g.charCodeAt(w-2)!==95||g.charCodeAt(w-3)!==111||g.charCodeAt(w-4)!==116||g.charCodeAt(w-5)!==111||g.charCodeAt(w-6)!==114||g.charCodeAt(w-7)!==112||g.charCodeAt(w-8)!==95||g.charCodeAt(w-9)!==95)return!1;for(var T=w-10;T>=0;T--)if(g.charCodeAt(T)!==36)return!1;return!0}function y(g,w,T){var _=S(g.source,w.source);return _!==0||(_=g.originalLine-w.originalLine,_!==0)||(_=g.originalColumn-w.originalColumn,_!==0||T)||(_=g.generatedColumn-w.generatedColumn,_!==0)||(_=g.generatedLine-w.generatedLine,_!==0)?_:S(g.name,w.name)}e.compareByOriginalPositions=y;function v(g,w,T){var _=g.originalLine-w.originalLine;return _!==0||(_=g.originalColumn-w.originalColumn,_!==0||T)||(_=g.generatedColumn-w.generatedColumn,_!==0)||(_=g.generatedLine-w.generatedLine,_!==0)?_:S(g.name,w.name)}e.compareByOriginalPositionsNoSource=v;function A(g,w,T){var _=g.generatedLine-w.generatedLine;return _!==0||(_=g.generatedColumn-w.generatedColumn,_!==0||T)||(_=S(g.source,w.source),_!==0)||(_=g.originalLine-w.originalLine,_!==0)||(_=g.originalColumn-w.originalColumn,_!==0)?_:S(g.name,w.name)}e.compareByGeneratedPositionsDeflated=A;function k(g,w,T){var _=g.generatedColumn-w.generatedColumn;return _!==0||T||(_=S(g.source,w.source),_!==0)||(_=g.originalLine-w.originalLine,_!==0)||(_=g.originalColumn-w.originalColumn,_!==0)?_:S(g.name,w.name)}e.compareByGeneratedPositionsDeflatedNoLine=k;function S(g,w){return g===w?0:g===null?1:w===null?-1:g>w?1:-1}function b(g,w){var T=g.generatedLine-w.generatedLine;return T!==0||(T=g.generatedColumn-w.generatedColumn,T!==0)||(T=S(g.source,w.source),T!==0)||(T=g.originalLine-w.originalLine,T!==0)||(T=g.originalColumn-w.originalColumn,T!==0)?T:S(g.name,w.name)}e.compareByGeneratedPositionsInflated=b;function E(g){return JSON.parse(g.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=E;function C(g,w,T){if(w=w||"",g&&(g[g.length-1]!=="/"&&w[0]!=="/"&&(g+="/"),w=g+w),T){var _=o(T);if(!_)throw new Error("sourceMapURL could not be parsed");if(_.path){var M=_.path.lastIndexOf("/");M>=0&&(_.path=_.path.substring(0,M+1))}w=c(i(_),w)}return l(w)}e.computeSourceURL=C})),Ak=Yn((e=>{var t=mu(),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})),Tk=Yn((e=>{var t=mu();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})),_k=Yn((e=>{var t=Ck(),n=mu(),r=Ak().ArraySet,o=Tk().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 m={generated:{line:d.generatedLine,column:d.generatedColumn}};d.source!=null&&(m.source=d.source,c!=null&&(m.source=n.relative(c,m.source)),m.original={line:d.originalLine,column:d.originalColumn},d.name!=null&&(m.name=d.name)),u.addMapping(m)}),a.sources.forEach(function(d){var m=d;c!==null&&(m=n.relative(c,d)),u._sources.has(m)||u._sources.add(m);var p=a.sourceContentFor(d);p!=null&&u.setSourceContent(d,p)}),u},i.prototype.addMapping=function(a){var l=n.getArg(a,"generated"),c=n.getArg(a,"original",null),u=n.getArg(a,"source",null),d=n.getArg(a,"name",null);!this._skipValidation&&this._validateMapping(l,c,u,d)===!1||(u!=null&&(u=String(u),this._sources.has(u)||this._sources.add(u)),d!=null&&(d=String(d),this._names.has(d)||this._names.add(d)),this._mappings.add({generatedLine:l.line,generatedColumn:l.column,originalLine:c!=null&&c.line,originalColumn:c!=null&&c.column,source:u,name:d}))},i.prototype.setSourceContent=function(a,l){var c=a;this._sourceRoot!=null&&(c=n.relative(this._sourceRoot,c)),l!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[n.toSetString(c)]=l):this._sourcesContents&&(delete this._sourcesContents[n.toSetString(c)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},i.prototype.applySourceMap=function(a,l,c){var u=l;if(l==null){if(a.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);u=a.file}var d=this._sourceRoot;d!=null&&(u=n.relative(d,u));var m=new r,p=new r;this._mappings.unsortedForEach(function(f){if(f.source===u&&f.originalLine!=null){var h=a.originalPositionFor({line:f.originalLine,column:f.originalColumn});h.source!=null&&(f.source=h.source,c!=null&&(f.source=n.join(c,f.source)),d!=null&&(f.source=n.relative(d,f.source)),f.originalLine=h.line,f.originalColumn=h.column,h.name!=null&&(f.name=h.name))}var y=f.source;y!=null&&!m.has(y)&&m.add(y);var v=f.name;v!=null&&!p.has(v)&&p.add(v)},this),this._sources=m,this._names=p,a.sources.forEach(function(f){var h=a.sourceContentFor(f);h!=null&&(c!=null&&(f=n.join(c,f)),d!=null&&(f=n.relative(d,f)),this.setSourceContent(f,h))},this)},i.prototype._validateMapping=function(a,l,c,u){if(l&&typeof l.line!="number"&&typeof l.column!="number"){var d="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return!1;throw new Error(d)}if(!(a&&"line"in a&&"column"in a&&a.line>0&&a.column>=0&&!l&&!c&&!u)){if(a&&"line"in a&&"column"in a&&l&&"line"in l&&"column"in l&&a.line>0&&a.column>=0&&l.line>0&&l.column>=0&&c)return;var d="Invalid mapping: "+JSON.stringify({generated:a,source:c,original:l,name:u});if(this._ignoreInvalidMapping)return!1;throw new Error(d)}},i.prototype._serializeMappings=function(){for(var a=0,l=1,c=0,u=0,d=0,m=0,p="",f,h,y,v,A=this._mappings.toArray(),k=0,S=A.length;k<S;k++){if(h=A[k],f="",h.generatedLine!==l)for(a=0;h.generatedLine!==l;)f+=";",l++;else if(k>0){if(!n.compareByGeneratedPositionsInflated(h,A[k-1]))continue;f+=","}f+=t.encode(h.generatedColumn-a),a=h.generatedColumn,h.source!=null&&(v=this._sources.indexOf(h.source),f+=t.encode(v-m),m=v,f+=t.encode(h.originalLine-1-u),u=h.originalLine-1,f+=t.encode(h.originalColumn-c),c=h.originalColumn,h.name!=null&&(y=this._names.indexOf(h.name),f+=t.encode(y-d),d=y)),p+=f}return p},i.prototype._generateSourcesContent=function(a,l){return a.map(function(c){if(!this._sourcesContents)return null;l!=null&&(c=n.relative(l,c));var u=n.toSetString(c);return Object.prototype.hasOwnProperty.call(this._sourcesContents,u)?this._sourcesContents[u]:null},this)},i.prototype.toJSON=function(){var a={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(a.file=this._file),this._sourceRoot!=null&&(a.sourceRoot=this._sourceRoot),this._sourcesContents&&(a.sourcesContent=this._generateSourcesContent(a.sources,a.sourceRoot)),a},i.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=i})),kk=_k(),Oh=new Set(["Atrule","Selector","Declaration"]);function Lk(e){const t=new kk.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(m){if(m.loc&&m.loc.start&&Oh.has(m.type)){const p=m.loc.start.line,f=m.loc.start.column-1;(r.line!==p||r.column!==f)&&(r.line=p,r.column=f,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:m.loc.source,original:r,generated:n}))}c.call(this,m),l&&Oh.has(m.type)&&(o.line=s,o.column=a)};const u=e.emit;e.emit=function(m,p,f){for(let h=0;h<m.length;h++)m.charCodeAt(h)===10?(s++,a=0):a++;u(m,p,f)};const d=e.result;return e.result=function(){return l&&t.addMapping(i),{css:d(),map:t}},e}var Ph=ie({safe:()=>Bh,spec:()=>Rk}),Nk=43,xk=45,fu=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},Ih=[[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],["/","*"]],Mk=Ih.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 Dh(e){const t=new Set(e.map(([n,r])=>fu(n)<<16|fu(r)));return function(n,r,o){const i=fu(r,o),s=o.charCodeAt(0);return(s===xk&&r!==1&&r!==2&&r!==15||s===Nk?t.has(n<<16|s<<8):t.has(n<<16|i))&&this.emit(" ",13,!0),i}}var Rk=Dh(Ih),Bh=Dh(Mk),Ok=92;function Pk(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 Ik(e){Sa(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}function Dk(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:Bh,token(l,c){i=this.tokenBefore(i,l,c),this.emit(c,l,!1),l===9&&c.charCodeAt(0)===Ok&&this.emit(`
34
- `,13,!0)},emit(l){o+=l},result(){return o}};r&&(typeof r.decorator=="function"&&(s=r.decorator(s)),r.sourceMap&&(s=Lk(s)),r.mode in Ph&&(s.tokenBefore=Ph[r.mode]));const a={node:l=>s.node(l),children:Pk,token:(l,c)=>s.token(l,c),tokenize:Ik};return s.node(n),s.result()}}function Bk(e){return{fromPlainObject(t){return e(t,{enter(n){n.children&&!(n.children instanceof Ve)&&(n.children=new Ve().fromArray(n.children))}}),t},toPlainObject(t){return e(t,{leave(n){n.children&&n.children instanceof Ve&&(n.children=n.children.toArray())}}),t}}}var{hasOwnProperty:pu}=Object.prototype,gi=function(){};function Hh(e){return typeof e=="function"?e:gi}function Fh(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function Hk(e,t){const n=t.structure,r=[];for(const o in n){if(pu.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 Fk(e){const t={};for(const n in e.node)if(pu.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]=Hk(n,r)}return t}function $h(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 Wh({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 $k(e){const t=Fk(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const c in t)pu.call(t,c)&&t[c]!==null&&(n[c]=$h(t[c],!1),r[c]=$h(t[c],!0));const s=Wh(n),a=Wh(r),l=function(c,u){function d(v,A,k){const S=m.call(y,v,A,k);return S===o?!0:S===i?!1:!!(f.hasOwnProperty(v.type)&&f[v.type](v,y,d,h)||p.call(y,v,A,k)===o)}let m=gi,p=gi,f=n,h=(v,A,k,S)=>v||d(A,k,S);const y={break:o,skip:i,root:c,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof u=="function")m=u;else if(u&&(m=Hh(u.enter),p=Hh(u.leave),u.reverse&&(f=r),u.visit)){if(s.hasOwnProperty(u.visit))f=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(", ")+")");m=Fh(m,u.visit),p=Fh(p,u.visit)}if(m===gi&&p===gi)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(m,p,f){if(u.call(this,m,p,f))return d=m,o}),d},l.findLast=function(c,u){let d=null;return l(c,{reverse:!0,enter(m,p,f){if(u.call(this,m,p,f))return d=m,o}}),d},l.findAll=function(c,u){const d=[];return l(c,function(m,p,f){u.call(this,m,p,f)&&d.push(m)}),d},l}function Wk(e){return e}function qk(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 zk(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 Vk(e,t,n,r){const o=e.combinator===" "||r?e.combinator:" "+e.combinator+" ",i=e.terms.map(s=>hu(s,t,n,r)).join(o);return e.explicit||n?(r||i[0]===","?"[":"[ ")+i+(r?"]":" ]"):i}function hu(e,t,n,r){let o;switch(e.type){case"Group":o=Vk(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return hu(e.term,t,n,r)+t(qk(e),e);case"Type":o="<"+e.name+(e.opts?t(zk(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 gu(e,t){let n=Wk,r=!1,o=!1;return typeof t=="function"?n=t:t&&(r=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(n=t.decorate)),hu(e,n,r,o)}var qh={offset:0,line:1,column:1};function Uk(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 m=0;m<n.length;m++){const p=n[m].value;m===r&&(a=p.length,s=c.length),i!==null&&n[m].node===i&&(m<=r?l++:l=0),c+=p}return r===n.length||l>1?(u=Ca(i||t,"end")||bi(qh,c),d=bi(u)):(u=Ca(i,"start")||bi(Ca(t,"start")||qh,c.slice(0,s)),d=Ca(i,"end")||bi(u,c.substr(s,a))),{css:c,mismatchOffset:s,mismatchLength:a,start:u,end:d}}function Ca(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?bi(n):n:null}function bi({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 yi=function(e,t){const n=wa("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},jk=function(e,t,n,r){const o=wa("SyntaxMatchError",e),{css:i,mismatchOffset:s,mismatchLength:a,start:l,end:c}=Uk(r,n);return o.rawMessage=e,o.syntax=t?gu(t):"<generic>",o.css=i,o.mismatchOffset=s,o.mismatchLength=a,o.message=e+`
35
- syntax: `+o.syntax+`
36
- value: `+(i||"<empty string>")+`
37
- --------`+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},Aa=new Map,ho=new Map,Ta=45,rn=Gk,go=Xk;function bu(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Ta&&e.charCodeAt(t+1)===Ta}function zh(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Ta&&e.charCodeAt(t+1)!==Ta){const n=e.indexOf("-",t+2);if(n!==-1)return e.substring(t,n+1)}return""}function Gk(e){if(Aa.has(e))return Aa.get(e);const t=e.toLowerCase();let n=Aa.get(t);if(n===void 0){const r=bu(t,0),o=r?"":zh(t,0);n=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:r})}return Aa.set(e,n),n}function Xk(e){if(ho.has(e))return ho.get(e);let t=e,n=e[0];n==="/"?n=e[1]==="/"?"//":"/":n!=="_"&&n!=="*"&&n!=="$"&&n!=="#"&&n!=="+"&&n!=="&"&&(n="");const r=bu(t,n.length);if(!r&&(t=t.toLowerCase(),ho.has(t))){const a=ho.get(t);return ho.set(e,a),a}const o=r?"":zh(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 ho.set(e,s),s}var Vh=["initial","inherit","unset","revert","revert-layer"],vi=43,Sn=45,yu=110,bo=!0,Yk=!1;function vu(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Ei(e,t,n){for(;e!==null&&(e.type===13||e.type===25);)e=n(++t);return t}function nr(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(o===vi||o===Sn){if(n)return 0;t++}for(;t<e.value.length;t++)if(!it(e.value.charCodeAt(t)))return 0;return r+1}function Eu(e,t,n){let r=!1,o=Ei(e,t,n);if(e=n(o),e===null)return t;if(e.type!==10)if(vu(e,vi)||vu(e,Sn)){if(r=!0,o=Ei(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!==vi&&i!==Sn)return 0}return nr(e,r?0:1,r,o)}function Kk(e,t){let n=0;if(!e)return 0;if(e.type===10)return nr(e,0,Yk,n);if(e.type===1&&e.value.charCodeAt(0)===Sn){if(!mo(e.value,1,yu))return 0;switch(e.value.length){case 2:return Eu(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==Sn?0:(n=Ei(t(++n),n,t),e=t(n),nr(e,0,bo,n));default:return e.value.charCodeAt(2)!==Sn?0:nr(e,3,bo,n)}}else if(e.type===1||vu(e,vi)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!mo(e.value,0,yu))return 0;switch(e.value.length){case 1:return Eu(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==Sn?0:(n=Ei(t(++n),n,t),e=t(n),nr(e,0,bo,n));default:return e.value.charCodeAt(1)!==Sn?0:nr(e,2,bo,n)}}else if(e.type===12){let r=e.value.charCodeAt(0),o=r===vi||r===Sn?1:0,i=o;for(;i<e.value.length&&it(e.value.charCodeAt(i));i++);return i===o||!mo(e.value,i,yu)?0:i+1===e.value.length?Eu(t(++n),n,t):e.value.charCodeAt(i+1)!==Sn?0:i+2===e.value.length?(n=Ei(t(++n),n,t),e=t(n),nr(e,0,bo,n)):nr(e,i+2,bo,n)}return 0}var Zk=43,Uh=45,jh=63,Qk=117;function Su(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Jk(e,t){return e.value.charCodeAt(0)===t}function Si(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(i===Uh&&n&&r!==0)return Si(e,t+r+1,!1),6;if(!er(i)||++r>6)return 0}return r}function _a(e,t,n){if(!e)return 0;for(;Su(n(t),jh);){if(++e>6)return 0;t++}return t}function eL(e,t){let n=0;if(e===null||e.type!==1||!mo(e.value,0,Qk)||(e=t(++n),e===null))return 0;if(Su(e,Zk))return e=t(++n),e===null?0:e.type===1?_a(Si(e,0,!0),++n,t):Su(e,jh)?_a(1,++n,t):0;if(e.type===10){const r=Si(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!Jk(e,Uh)||!Si(e,1,!1)?0:n+1:_a(r,n,t))}return e.type===12?_a(Si(e,1,!0),++n,t):0}var tL=["calc(","-moz-calc(","-webkit-calc("],wu=new Map([[2,22],[21,22],[19,20],[23,24]]),nL=["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"],rL=["deg","grad","rad","turn"],oL=["s","ms"],iL=["hz","khz"],sL=["dpi","dpcm","dppx","x"],aL=["fr"],lL=["db"],cL=["st"];function on(e,t){return t<e.length?e.charCodeAt(t):0}function Gh(e,t){return hi(e,0,e.length,t)}function Xh(e,t){for(let n=0;n<t.length;n++)if(Gh(e,t[n]))return!0;return!1}function Yh(e,t){return t!==e.length-2?!1:on(e,t)===92&&it(on(e,t+1))}function ka(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 uL(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=wu.get(e.type)}o++}while(e=t(o));return o}function Gt(e){return function(t,n,r){return t===null?0:t.type===2&&Xh(t.value,tL)?uL(t,n):e(t,n,r)}}function Re(e){return function(t){return t===null||t.type!==e?0:1}}function dL(e){if(e===null||e.type!==1)return 0;const t=e.value.toLowerCase();return Xh(t,Vh)||Gh(t,"default")?0:1}function mL(e){return e===null||e.type!==1||on(e.value,0)!==45||on(e.value,1)!==45?0:1}function fL(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(!er(on(e.value,n)))return 0;return 1}function pL(e){return e===null||e.type!==4||!ga(on(e.value,1),on(e.value,2),on(e.value,3))?0:1}function hL(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=wu.get(e.type)}o++}while(e=t(o));return o}function gL(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=wu.get(e.type)}o++}while(e=t(o));return o}function $n(e){return e&&(e=new Set(e)),function(t,n,r){if(t===null||t.type!==12)return 0;const o=va(t.value,0);if(e!==null){const i=t.value.indexOf("\\",o),s=i===-1||!Yh(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return ka(r,t.value,o)?0:1}}function bL(e,t,n){return e===null||e.type!==11||ka(n,e.value,e.value.length-1)?0:1}function Kh(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 yL(e,t,n){if(e===null)return 0;const r=va(e.value,0);return r!==e.value.length&&!Yh(e.value,r)||ka(n,e.value,r)?0:1}function vL(e,t,n){if(e===null||e.type!==10)return 0;let r=on(e.value,0)===43||on(e.value,0)===45?1:0;for(;r<e.value.length;r++)if(!it(on(e.value,r)))return 0;return ka(n,e.value,r)?0:1}var Zh={"ident-token":Re(1),"function-token":Re(2),"at-keyword-token":Re(3),"hash-token":Re(4),"string-token":Re(5),"bad-string-token":Re(6),"url-token":Re(7),"bad-url-token":Re(8),"delim-token":Re(9),"number-token":Re(10),"percentage-token":Re(11),"dimension-token":Re(12),"whitespace-token":Re(13),"CDO-token":Re(14),"CDC-token":Re(15),"colon-token":Re(16),"semicolon-token":Re(17),"comma-token":Re(18),"[-token":Re(19),"]-token":Re(20),"(-token":Re(21),")-token":Re(22),"{-token":Re(23),"}-token":Re(24),string:Re(5),ident:Re(1),"custom-ident":dL,"custom-property-name":mL,"hex-color":fL,"id-selector":pL,"an-plus-b":Kk,urange:eL,"declaration-value":hL,"any-value":gL,dimension:Gt($n(null)),angle:Gt($n(rL)),decibel:Gt($n(lL)),frequency:Gt($n(iL)),flex:Gt($n(aL)),length:Gt(Kh($n(nL))),resolution:Gt($n(sL)),semitones:Gt($n(cL)),time:Gt($n(oL)),percentage:Gt(bL),zero:Kh(),number:Gt(yL),integer:Gt(vL)};function EL(e,t,n){return Object.assign(wa("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+`
38
- `+t+`
39
- --`+new Array((n||t.length)+1).join("-")+"^"})}var SL=9,wL=10,CL=12,AL=13,TL=32,_L=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!==AL&&t!==wL&&t!==CL&&t!==TL&&t!==SL)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 EL(e,this.str,this.pos)}},kL=9,LL=10,NL=12,xL=13,ML=32,Qh=33,Cu=35,Jh=38,La=39,eg=40,RL=41,tg=42,Au=43,Tu=44,ng=45,_u=60,rg=62,ku=63,OL=64,Na=91,Lu=93,xa=123,og=124,ig=125,sg=8734,wi=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),ag={" ":1,"&&":2,"||":3,"|":4};function Ma(e){return e.substringToPos(e.findWsEnd(e.pos))}function yo(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n>=128||wi[n]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Ra(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 PL(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 lg(e){let t=null,n=null;return e.eat(xa),t=Ra(e),e.charCode()===Tu?(e.pos++,e.charCode()!==ig&&(n=Ra(e))):n=t,e.eat(ig),{min:Number(t),max:n?Number(n):0}}function IL(e){let t=null,n=!1;switch(e.charCode()){case tg:e.pos++,t={min:0,max:0};break;case Au:e.pos++,t={min:1,max:0};break;case ku:e.pos++,t={min:0,max:1};break;case Cu:e.pos++,n=!0,e.charCode()===xa?t=lg(e):e.charCode()===ku?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case xa:t=lg(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function vo(e,t){const n=IL(e);return n!==null?(n.term=t,e.charCode()===Cu&&e.charCodeAt(e.pos-1)===Au?vo(e,n):n):t}function Nu(e){const t=e.peek();return t===""?null:{type:"Token",value:t}}function DL(e){let t;return e.eat(_u),e.eat(La),t=yo(e),e.eat(La),e.eat(rg),vo(e,{type:"Property",name:t})}function BL(e){let t=null,n=null,r=1;return e.eat(Na),e.charCode()===ng&&(e.peek(),r=-1),r==-1&&e.charCode()===sg?e.peek():(t=r*Number(Ra(e)),wi[e.charCode()]!==0&&(t+=yo(e))),Ma(e),e.eat(Tu),Ma(e),e.charCode()===sg?e.peek():(r=1,e.charCode()===ng&&(e.peek(),r=-1),n=r*Number(Ra(e)),wi[e.charCode()]!==0&&(n+=yo(e))),e.eat(Lu),{type:"Range",min:t,max:n}}function HL(e){let t,n=null;return e.eat(_u),t=yo(e),e.charCode()===eg&&e.nextCharCode()===RL&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===Na&&(Ma(e),n=BL(e)),e.eat(rg),vo(e,{type:"Type",name:t,opts:n})}function FL(e){const t=yo(e);return e.charCode()===eg?(e.pos++,{type:"Function",name:t}):vo(e,{type:"Keyword",name:t})}function $L(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)=>ag[o]-ag[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 cg(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=qL(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:$L(t,n)||" ",disallowEmpty:!1,explicit:!1}}function WL(e){let t;return e.eat(Na),t=cg(e),e.eat(Lu),t.explicit=!0,e.charCode()===Qh&&(e.pos++,t.disallowEmpty=!0),t}function qL(e){let t=e.charCode();if(t<128&&wi[t]===1)return FL(e);switch(t){case Lu:break;case Na:return vo(e,WL(e));case _u:return e.nextCharCode()===La?DL(e):HL(e);case og:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===og?2:1))};case Jh:return e.pos++,e.eat(Jh),{type:"Combinator",value:"&&"};case Tu:return e.pos++,{type:"Comma"};case La:return vo(e,{type:"String",value:PL(e)});case ML:case kL:case LL:case xL:case NL:return{type:"Spaces",value:Ma(e)};case OL:return t=e.nextCharCode(),t<128&&wi[t]===1?(e.pos++,{type:"AtKeyword",name:yo(e)}):Nu(e);case tg:case Au:case ku:case Cu:case Qh:break;case xa:if(t=e.nextCharCode(),t<48||t>57)return Nu(e);break;default:return Nu(e)}}function ug(e){const t=new _L(e),n=cg(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var Ci=function(){};function dg(e){return typeof e=="function"?e:Ci}function zL(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=Ci,i=Ci;if(typeof t=="function"?o=t:t&&(o=dg(t.enter),i=dg(t.leave)),o===Ci&&i===Ci)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var VL={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 UL(e){const t=[];return Sa(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function jL(e,t){return typeof e=="string"?UL(e):t.generate(e,VL)}var ye={type:"Match"},Ce={type:"Mismatch"},xu={type:"DisallowEmpty"},GL=40,XL=41;function ut(e,t,n){return t===ye&&n===Ce||e===ye&&t===ye&&n===ye?e:(e.type==="If"&&e.else===Ce&&t===ye&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function mg(e){return e.length>2&&e.charCodeAt(e.length-2)===GL&&e.charCodeAt(e.length-1)===XL}function fg(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&mg(e.name)}function Mu(e,t,n){switch(e){case" ":{let r=ye;for(let o=t.length-1;o>=0;o--){const i=t[o];r=ut(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(fg(s)&&(o===null&&i>0&&fg(t[i-1])&&(o=Object.create(null),r=ut({type:"Enum",map:o},ye,r)),o!==null)){const a=(mg(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=ut(s,ye,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=Mu(e,t.filter(function(a){return a!==i}),!1):s=ye,r=ut(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?ye:Ce;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Mu(e,t.filter(function(a){return a!==i}),!0):s=ye,r=ut(i,s,r)}return r}}}function YL(e){let t=ye,n=Ru(e.term);if(e.max===0)n=ut(n,xu,Ce),t=ut(n,null,Ce),t.then=ut(ye,ye,t),e.comma&&(t.then.else=ut({type:"Comma",syntax:e},t,Ce));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==ye&&(t=ut({type:"Comma",syntax:e},t,Ce)),t=ut(n,ut(ye,ye,t),Ce);if(e.min===0)t=ut(ye,ye,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==ye&&(t=ut({type:"Comma",syntax:e},t,Ce)),t=ut(n,t,Ce);return t}function Ru(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Mu(e.combinator,e.terms.map(Ru),!1);return e.disallowEmpty&&(t=ut(t,xu,Ce)),t}case"Multiplier":return YL(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 Ou(e,t){return typeof e=="string"&&(e=ug(e)),{type:"MatchGraph",match:Ru(e),syntax:t||null,source:e}}var{hasOwnProperty:pg}=Object.prototype,KL=0,ZL=1,Pu=2,hg=3,gg="Match",QL="Mismatch",JL="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",e2=15e3,t2=0;function n2(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function Iu(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 r2(e){return e.type!==9?!1:e.value!=="?"}function bg(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||r2(e)}function yg(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function o2(e,t,n){function r(){do A++,v=A<e.length?e[A]:null;while(v!==null&&(v.type===13||v.type===25))}function o(b){const E=A+b;return E<e.length?e[E]:null}function i(b,E){return{nextState:b,matchStack:S,syntaxStack:d,thenStack:m,tokenIndex:A,prev:E}}function s(b){m={nextState:b,matchStack:S,syntaxStack:d,prev:m}}function a(b){p=i(b,p)}function l(){S={type:ZL,syntax:t.syntax,token:v,prev:S},r(),f=null,A>k&&(k=A)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},S={type:Pu,syntax:t.syntax,token:S.token,prev:S}}function u(){S.type===Pu?S=S.prev:S={type:hg,syntax:d.syntax,token:S.token,prev:S},d=d.prev}let d=null,m=null,p=null,f=null,h=0,y=null,v=null,A=-1,k=0,S={type:KL,syntax:null,token:null,prev:null};for(r();y===null&&++h<e2;)switch(t.type){case"Match":if(m===null){if(v!==null&&(A!==e.length-1||v.value!=="\\0"&&v.value!=="\\9")){t=Ce;break}y=gg;break}if(t=m.nextState,t===xu)if(m.matchStack===S){t=Ce;break}else t=ye;for(;m.syntaxStack!==d;)u();m=m.prev;break;case"Mismatch":if(f!==null&&f!==!1)(p===null||A>p.tokenIndex)&&(p=f,f=!1);else if(p===null){y=QL;break}t=p.nextState,m=p.thenStack,d=p.syntaxStack,S=p.matchStack,A=p.tokenIndex,v=A<e.length?e[A]:null,p=p.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==Ce&&a(t.else),t.then!==ye&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const C=t.syntax.terms;if(t.index===C.length){if(t.mask===0||t.syntax.all){t=Ce;break}t=ye;break}if(t.mask===(1<<C.length)-1){t=ye;break}for(;t.index<C.length;t.index++){const g=1<<t.index;if((t.mask&g)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|g}),t=C[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(v!==null){let C=v.value.toLowerCase();if(C.indexOf("\\")!==-1&&(C=C.replace(/\\[09].*$/,"")),pg.call(t.map,C)){t=t.map[C];break}}t=Ce;break;case"Generic":{const C=d!==null?d.opts:null,g=A+Math.floor(t.fn(v,o,C));if(!isNaN(g)&&g>A){for(;A<g;)l();t=ye}else t=Ce;break}case"Type":case"Property":{const C=t.type==="Type"?"types":"properties",g=pg.call(n,C)?n[C][t.name]:null;if(!g||!g.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(f!==!1&&v!==null&&t.type==="Type"&&(t.name==="custom-ident"&&v.type===1||t.name==="length"&&v.value==="0")){f===null&&(f=i(t,p)),t=Ce;break}c(),t=g.match;break}case"Keyword":{const C=t.name;if(v!==null){let g=v.value;if(g.indexOf("\\")!==-1&&(g=g.replace(/\\[09].*$/,"")),Iu(g,C)){l(),t=ye;break}}t=Ce;break}case"AtKeyword":case"Function":if(v!==null&&Iu(v.value,t.name)){l(),t=ye;break}t=Ce;break;case"Token":if(v!==null&&v.value===t.value){l(),t=ye;break}t=Ce;break;case"Comma":v!==null&&v.type===18?bg(S.token)?t=Ce:(l(),t=yg(v)?Ce:ye):t=bg(S.token)||yg(v)?ye:Ce;break;case"String":let b="",E=A;for(;E<e.length&&b.length<t.value.length;E++)b+=e[E].value;if(Iu(b,t.value)){for(;A<E;)l();t=ye}else t=Ce;break;default:throw new Error("Unknown node type: "+t.type)}switch(t2+=h,y){case null:y=JL,S=null;break;case gg:for(;d!==null;)u();break;default:S=null}return{tokens:e,reason:y,iterations:h,match:S,longestMatch:k}}function vg(e,t,n){const r=o2(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=n2(o).prev;o!==null;){switch(o.type){case Pu:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case hg: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 i2=ie({getTrace:()=>Eg,isKeyword:()=>l2,isProperty:()=>a2,isType:()=>s2});function Eg(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 s2(e,t){return Du(this,e,n=>n.type==="Type"&&n.name===t)}function a2(e,t){return Du(this,e,n=>n.type==="Property"&&n.name===t)}function l2(e){return Du(this,e,t=>t.type==="Keyword")}function Du(e,t,n){const r=Eg.call(e,t);return r===null?!1:r.some(n)}function Sg(e){return"node"in e?e.node:Sg(e.match[0])}function wg(e){return"node"in e?e.node:wg(e.match[e.match.length-1])}function Cg(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){const l=Sg(a),c=wg(a);e.syntax.walk(t,function(u,d,m){if(u===l){const p=new Ve;do{if(p.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:m,nodes:p})}})}Array.isArray(a.match)&&a.match.forEach(i)}const s=[];return n.matched!==null&&i(n.matched),s}var{hasOwnProperty:Ai}=Object.prototype;function Bu(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function Ag(e){return!!e&&Bu(e.offset)&&Bu(e.line)&&Bu(e.column)}function c2(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(Ai.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(!Ag(r.loc.start))i+=".start";else if(!Ag(r.loc.end))i+=".end";else continue;s=!1}else if(t.hasOwnProperty(i)){s=!1;for(let a=0;!s&&a<t[i].length;a++){const l=t[i][a];switch(l){case String:s=typeof r[i]=="string";break;case Boolean:s=typeof r[i]=="boolean";break;case null:s=r[i]===null;break;default:typeof l=="string"?s=r[i]&&r[i].type===l:Array.isArray(l)&&(s=r[i]instanceof Ve)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(const i in t)Ai.call(t,i)&&Ai.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function u2(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const i in n){if(Ai.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:c2(e,r)}}function d2(e){const t={};if(e.node){for(const n in e.node)if(Ai.call(e.node,n)){const r=e.node[n];if(r.structure)t[n]=u2(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var m2=Ou(Vh.join(" | "));function Hu(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:gu(e[o].syntax,{compact:t}));return r}function f2(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:gu(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&Hu(i.descriptors,t,n)};return r}function p2(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function sn(e,t,n){return{matched:e,iterations:n,error:t,...i2}}function Eo(e,t,n,r){const o=jL(n,e.syntax);let i;return p2(o)?sn(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=vg(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=vg(o,t.match,e),!i.match)?sn(null,new jk(i.reason,t.syntax,n,i),i.iterations):sn(i.match,null,i.iterations))}var Tg=class{constructor(e,t,n){if(this.cssWideKeywordsSyntax=m2,this.syntax=t,this.generic=!1,this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||d2(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 Zh)this.addType_(r,Zh[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=Ou(e,o):(typeof e=="string"?Object.defineProperty(i,"syntax",{get(){return Object.defineProperty(i,"syntax",{value:ug(e)}),i.syntax}}):i.syntax=e,Object.defineProperty(i,"match",{get(){return Object.defineProperty(i,"match",{value:Ou(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 yi("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&&!Eo(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=rn(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 yi("Unknown at-rule descriptor",t)}checkPropertyName(e){if(!this.getProperty(e))return new yi("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return sn(null,n);const r=this.getAtrule(e);return r.prelude?Eo(this,r.prelude,t||"",!1):sn(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return sn(null,r);const o=this.getAtrule(e),i=rn(t);return Eo(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return e.type!=="Declaration"?sn(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(go(e).custom)return sn(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?sn(null,n):Eo(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?Eo(this,n,t,!1):sn(null,new yi("Unknown type",e))}match(e,t){return typeof e!="string"&&(!e||!e.type)?sn(null,new yi("Bad syntax")):((typeof e=="string"||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),Eo(this,e,t,!1))}findValueFragments(e,t,n,r){return Cg(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return Cg(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=rn(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=go(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&&zL(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:Hu(this.types,!t,e),properties:Hu(this.properties,!t,e),atrules:f2(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}},{hasOwnProperty:So}=Object.prototype,h2={generic:!0,types:Fu,atrules:{prelude:Ng,descriptors:Ng},properties:Fu,parseContext:g2,scope:kg,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function Oa(e){return e&&e.constructor===Object}function _g(e){return Oa(e)?{...e}:e}function g2(e,t){return Object.assign(e,t)}function kg(e,t){for(const n in t)So.call(t,n)&&(Oa(e[n])?kg(e[n],t[n]):e[n]=_g(t[n]));return e}function Lg(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Fu(e,t){if(typeof t=="string")return Lg(e,t);const n={...e};for(let r in t)So.call(t,r)&&(n[r]=Lg(So.call(e,r)?e[r]:void 0,t[r]));return n}function Ng(e,t){const n=Fu(e,t);return!Oa(n)||Object.keys(n).length?n:null}function Ti(e,t,n){for(const r in n)if(So.call(n,r)!==!1){if(n[r]===!0)So.call(t,r)&&(e[r]=_g(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(Oa(n[r])){const o={};for(let i in e[r])o[i]=Ti({},e[r][i],n[r]);for(let i in t[r])o[i]=Ti(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&&Ti(o[s],a,i);for(const s in t[r])So.call(t[r],s)&&(o[s]||(o[s]={}),t[r]&&t[r][s]&&Ti(o[s],t[r][s],i));e[r]=o}}}return e}var $u=(e,t)=>Ti(e,t,h2);function xg(e){const t=Sk(e),n=$k(e),r=Dk(e),{fromPlainObject:o,toPlainObject:i}=Bk(n),s={lexer:null,createLexer:a=>new Tg(a,s,s.lexer.structure),tokenize:Sa,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){const l=$u({},e);return xg(typeof a=="function"?a(l,Object.assign):$u(l,a))}};return s.lexer=new Tg({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var b2=e=>xg($u({},e)),y2={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>"}}}},v2=ie({generate:()=>C2,name:()=>S2,parse:()=>Mg,structure:()=>w2}),wn=43,Mt=45,Pa=110,Ar=!0,E2=!1;function Ia(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===wn||r===Mt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)it(this.charCodeAt(n))||this.error("Integer is expected",n)}function wo(e){return Ia.call(this,0,e)}function rr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Pa:n="N is expected";break;case Mt:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function Wu(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(wn,e)||this.isDelim(Mt,e)){t=this.isDelim(wn,e)?wn:Mt;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),wo.call(this,Ar))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==wn&&n!==Mt&&this.error("Number sign is expected")),wo.call(this,t!==0),t===Mt?"-"+this.consume(10):this.consume(10)}var S2="AnPlusB",w2={a:[String,null],b:[String,null]};function Mg(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===10)wo.call(this,E2),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Mt))switch(t="-1",rr.call(this,1,Pa),this.tokenEnd-this.tokenStart){case 2:this.next(),n=Wu.call(this);break;case 3:rr.call(this,2,Mt),this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10);break;default:rr.call(this,2,Mt),Ia.call(this,3,Ar),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(wn)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(wn)&&(r=1,this.next()),rr.call(this,0,Pa),this.tokenEnd-this.tokenStart){case 1:this.next(),n=Wu.call(this);break;case 2:rr.call(this,1,Mt),this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10);break;default:rr.call(this,1,Mt),Ia.call(this,2,Ar),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){const r=this.charCodeAt(this.tokenStart),o=r===wn||r===Mt;let i=this.tokenStart+o;for(;i<this.tokenEnd&&it(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),rr.call(this,i-this.tokenStart,Pa),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=Wu.call(this)):(rr.call(this,i-this.tokenStart+1,Mt),i+2===this.tokenEnd?(this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10)):(Ia.call(this,i-this.tokenStart+2,Ar),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===wn&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===wn&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function C2(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 A2=ie({generate:()=>N2,name:()=>_2,parse:()=>Og,structure:()=>L2,walkContext:()=>k2});function Rg(e){return this.Raw(e,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function T2(){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 _2="Atrule",k2="atrule",L2={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function Og(){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),Rg):r=Rg.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(T2.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:r,block:o}}function N2(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var x2=ie({generate:()=>P2,name:()=>M2,parse:()=>Pg,structure:()=>O2,walkContext:()=>R2}),M2="AtrulePrelude",R2="atrulePrelude",O2={children:[[]]};function Pg(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 P2(e){this.children(e)}var I2=ie({generate:()=>z2,name:()=>W2,parse:()=>Dg,structure:()=>q2}),D2=36,Ig=42,Da=61,B2=94,qu=124,H2=126;function F2(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(Ig)?(t=!0,this.next()):this.isDelim(qu)||this.eat(1),this.isDelim(qu)?this.charCodeAt(this.tokenStart+1)!==Da?(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 $2(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==Da&&t!==H2&&t!==B2&&t!==D2&&t!==Ig&&t!==qu&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==Da&&(this.isDelim(Da)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var W2="AttributeSelector",q2={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Dg(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=F2.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=$2.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 z2(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 V2=ie({generate:()=>K2,name:()=>G2,parse:()=>Fg,structure:()=>Y2,walkContext:()=>X2});function Bg(e){return this.Raw(e,null,!0)}function U2(){return this.parseWithFallback(this.Rule,Bg)}function Hg(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function j2(){if(this.tokenType===17)return Hg.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Hg);return this.tokenType===17&&this.next(),e}var G2="Block",X2="block",Y2={children:[["Atrule","Rule","Declaration"]]};function Fg(e){const t=e?j2:U2,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,Bg));break;default:r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function K2(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var Z2=ie({generate:()=>eN,name:()=>Q2,parse:()=>$g,structure:()=>J2}),Q2="Brackets",J2={children:[[]]};function $g(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 eN(e){this.token(9,"["),this.children(e),this.token(9,"]")}var tN=ie({generate:()=>rN,name:()=>"CDC",parse:()=>Wg,structure:()=>nN}),Aq="CDC",nN=[];function Wg(){const e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function rN(){this.token(15,"-->")}var oN=ie({generate:()=>sN,name:()=>"CDO",parse:()=>qg,structure:()=>iN}),Tq="CDO",iN=[];function qg(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function sN(){this.token(14,"<!--")}var aN=ie({generate:()=>dN,name:()=>cN,parse:()=>zg,structure:()=>uN}),lN=46,cN="ClassSelector",uN={name:String};function zg(){return this.eatDelim(lN),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function dN(e){this.token(9,"."),this.token(1,e.name)}var mN=ie({generate:()=>yN,name:()=>gN,parse:()=>Ug,structure:()=>bN}),fN=43,Vg=47,pN=62,hN=126,gN="Combinator",bN={name:String};function Ug(){const e=this.tokenStart;let t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case pN:case fN:case hN:this.next();break;case Vg:this.next(),this.eatIdent("deep"),this.eatDelim(Vg);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function yN(e){this.tokenize(e.name)}var vN=ie({generate:()=>AN,name:()=>wN,parse:()=>jg,structure:()=>CN}),EN=42,SN=47,wN="Comment",CN={value:String};function jg(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===EN&&this.charCodeAt(t-1)===SN&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function AN(e){this.token(25,"/*"+e.value+"*/")}var TN=ie({generate:()=>BN,name:()=>PN,parse:()=>Yg,structure:()=>DN,walkContext:()=>IN}),Gg=33,_N=35,kN=36,LN=38,NN=42,xN=43,Xg=47;function MN(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function RN(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function ON(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(Gg)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var PN="Declaration",IN="declaration",DN={important:[Boolean,String],property:String,value:["Value","Raw"]};function Yg(){const e=this.tokenStart,t=this.tokenIndex,n=HN.call(this),r=bu(n),o=r?this.parseCustomProperty:this.parseValue,i=r?RN:MN;let s=!1,a;this.skipSC(),this.eat(16);const l=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(ON,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(Gg)&&(s=FN.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 BN(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 HN(){const e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case NN:case kN:case xN:case _N:case LN:this.next();break;case Xg:this.next(),this.isDelim(Xg)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function FN(){this.eat(9),this.skipSC();const e=this.consume(1);return e==="important"?!0:e}var $N=ie({generate:()=>VN,name:()=>qN,parse:()=>Kg,structure:()=>zN});function WN(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var qN="DeclarationList",zN={children:[["Declaration"]]};function Kg(){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,WN))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function VN(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var UN=ie({generate:()=>XN,name:()=>jN,parse:()=>Zg,structure:()=>GN}),jN="Dimension",GN={value:String,unit:String};function Zg(){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 XN(e){this.token(12,e.value+e.unit)}var YN=ie({generate:()=>JN,name:()=>KN,parse:()=>Qg,structure:()=>QN,walkContext:()=>ZN}),KN="Function",ZN="function",QN={name:String,children:[[]]};function Qg(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 JN(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var ex=ie({generate:()=>rx,name:()=>tx,parse:()=>Jg,structure:()=>nx,xxx:()=>"XXX"}),_q="XXX",tx="Hash",nx={value:String};function Jg(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function rx(e){this.token(4,"#"+e.value)}var ox=ie({generate:()=>ax,name:()=>ix,parse:()=>eb,structure:()=>sx}),ix="Identifier",sx={name:String};function eb(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function ax(e){this.token(1,e.name)}var lx=ie({generate:()=>dx,name:()=>cx,parse:()=>tb,structure:()=>ux}),cx="IdSelector",ux={name:String};function tb(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function dx(e){this.token(9,"#"+e.name)}var mx=ie({generate:()=>hx,name:()=>fx,parse:()=>nb,structure:()=>px}),fx="MediaFeature",px={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function nb(){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 hx(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var gx=ie({generate:()=>vx,name:()=>bx,parse:()=>rb,structure:()=>yx}),bx="MediaQuery",yx={children:[["Identifier","MediaFeature","WhiteSpace"]]};function rb(){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 vx(e){this.children(e)}var Ex=ie({generate:()=>Cx,name:()=>Sx,parse:()=>ob,structure:()=>wx}),Sx="MediaQueryList",wx={children:[["MediaQuery"]]};function ob(){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 Cx(e){this.children(e,()=>this.token(18,","))}var Ax=ie({generate:()=>_x,name:()=>"Nth",parse:()=>ib,structure:()=>Tx}),kq="Nth",Tx={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function ib(){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 _x(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var kx=ie({generate:()=>xx,name:()=>Lx,parse:()=>sb,structure:()=>Nx}),Lx="Number",Nx={value:String};function sb(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function xx(e){this.token(10,e.value)}var Mx=ie({generate:()=>Px,name:()=>Rx,parse:()=>ab,structure:()=>Ox}),Rx="Operator",Ox={value:String};function ab(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Px(e){this.tokenize(e.value)}var Ix=ie({generate:()=>Hx,name:()=>Dx,parse:()=>lb,structure:()=>Bx}),Dx="Parentheses",Bx={children:[[]]};function lb(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 Hx(e){this.token(21,"("),this.children(e),this.token(22,")")}var Fx=ie({generate:()=>qx,name:()=>$x,parse:()=>cb,structure:()=>Wx}),$x="Percentage",Wx={value:String};function cb(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function qx(e){this.token(11,e.value+"%")}var zx=ie({generate:()=>Gx,name:()=>Vx,parse:()=>ub,structure:()=>jx,walkContext:()=>Ux}),Vx="PseudoClassSelector",Ux="function",jx={name:String,children:[["Raw"],null]};function ub(){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 Gx(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var Xx=ie({generate:()=>Qx,name:()=>Yx,parse:()=>db,structure:()=>Zx,walkContext:()=>Kx}),Yx="PseudoElementSelector",Kx="function",Zx={name:String,children:[["Raw"],null]};function db(){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 Qx(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 Jx=ie({generate:()=>oM,name:()=>nM,parse:()=>fb,structure:()=>rM}),eM=47,tM=46;function mb(){this.skipSC();const e=this.consume(10);for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);!it(n)&&n!==tM&&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 nM="Ratio",rM={left:String,right:String};function fb(){const e=this.tokenStart,t=mb.call(this);let n;return this.skipSC(),this.eatDelim(eM),n=mb.call(this),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function oM(e){this.token(10,e.left),this.token(9,"/"),this.token(10,e.right)}var iM=ie({generate:()=>lM,name:()=>"Raw",parse:()=>pb,structure:()=>aM});function sM(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var Lq="Raw",aM={value:String};function pb(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?o=sM.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}function lM(e){this.tokenize(e.value)}var cM=ie({generate:()=>pM,name:()=>dM,parse:()=>gb,structure:()=>fM,walkContext:()=>mM});function hb(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function uM(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var dM="Rule",mM="rule",fM={prelude:["SelectorList","Raw"],block:["Block"]};function gb(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return this.parseRulePrelude?n=this.parseWithFallback(uM,hb):n=hb.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function pM(e){this.node(e.prelude),this.node(e.block)}var hM=ie({generate:()=>yM,name:()=>gM,parse:()=>bb,structure:()=>bM}),gM="Selector",bM={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function bb(){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 yM(e){this.children(e)}var vM=ie({generate:()=>CM,name:()=>EM,parse:()=>yb,structure:()=>wM,walkContext:()=>SM}),EM="SelectorList",SM="selector",wM={children:[["Selector","Raw"]]};function yb(){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 CM(e){this.children(e,()=>this.token(18,","))}var zu=92,vb=34,Eb=39;function Sb(e){const t=e.length,n=e.charCodeAt(0),r=n===vb||n===Eb?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===zu){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),En(zu,a)){const l=s-1,c=fo(e,l);s=c-1,i+=wh(e.substring(l+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function Vu(e,t){const n=t?"'":'"',r=t?Eb:vb;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===zu?(o+="\\"+e.charAt(s),i=!1):(i&&(er(a)||Cr(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var AM=ie({generate:()=>kM,name:()=>TM,parse:()=>wb,structure:()=>_M}),TM="String",_M={value:String};function wb(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Sb(this.consume(5))}}function kM(e){this.token(5,Vu(e.value))}var LM=ie({generate:()=>OM,name:()=>xM,parse:()=>Ab,structure:()=>RM,walkContext:()=>MM}),NM=33;function Cb(e){return this.Raw(e,null,!1)}var xM="StyleSheet",MM="stylesheet",RM={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function Ab(){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)!==NM){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,Cb);break;default:n=this.parseWithFallback(this.Rule,Cb)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function OM(e){this.children(e)}var PM=ie({generate:()=>HM,name:()=>DM,parse:()=>_b,structure:()=>BM}),IM=42,Tb=124;function Uu(){this.tokenType!==1&&this.isDelim(IM)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var DM="TypeSelector",BM={name:String};function _b(){const e=this.tokenStart;return this.isDelim(Tb)?(this.next(),Uu.call(this)):(Uu.call(this),this.isDelim(Tb)&&(this.next(),Uu.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function HM(e){this.tokenize(e.name)}var FM=ie({generate:()=>VM,name:()=>qM,parse:()=>Nb,structure:()=>zM}),kb=43,Lb=45,ju=63;function _i(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===Lb&&t&&n!==0)return _i.call(this,e+n+1,!1),-1;er(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 Ba(e){let t=0;for(;this.isDelim(ju);)++t>e&&this.error("Too many question marks"),this.next()}function $M(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===kb?"Plus sign":"Hyphen minus")+" is expected")}function WM(){let e=0;switch(this.tokenType){case 10:if(e=_i.call(this,1,!0),this.isDelim(ju)){Ba.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){$M.call(this,Lb),_i.call(this,1,!1);break}break;case 12:e=_i.call(this,1,!0),e>0&&Ba.call(this,6-e);break;default:if(this.eatDelim(kb),this.tokenType===1){e=_i.call(this,0,!0),e>0&&Ba.call(this,6-e);break}if(this.isDelim(ju)){this.next(),Ba.call(this,5);break}this.error("Hex digit or question mark is expected")}}var qM="UnicodeRange",zM={value:String};function Nb(){const e=this.tokenStart;return this.eatIdent("u"),WM.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function VM(e){this.tokenize(e.value)}var UM=32,Gu=92,jM=34,GM=39,XM=40,xb=41;function YM(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===xb?t-2:t-1,o="";for(;n<r&&Cr(e.charCodeAt(n));)n++;for(;n<r&&Cr(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===Gu){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),En(Gu,s)){const a=i-1,l=fo(e,a);i=l-1,o+=wh(e.substring(a+1,l))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function Mb(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===UM||o===Gu||o===jM||o===GM||o===XM||o===xb?(t+="\\"+e.charAt(r),n=!1):(n&&er(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var KM=ie({generate:()=>QM,name:()=>"Url",parse:()=>Rb,structure:()=>ZM}),Nq="Url",ZM={value:String};function Rb(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=YM(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=Sb(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 QM(e){this.token(7,Mb(e.value))}var JM=ie({generate:()=>nR,name:()=>eR,parse:()=>Ob,structure:()=>tR}),eR="Value",tR={children:[[]]};function Ob(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function nR(e){this.children(e)}var rR=ie({generate:()=>aR,name:()=>iR,parse:()=>Pb,structure:()=>sR}),oR=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),iR="WhiteSpace",sR={value:String};function Pb(){return this.eat(13),oR}function aR(e){this.token(13,e.value)}var Ib=ie({AnPlusB:()=>v2,Atrule:()=>A2,AtrulePrelude:()=>x2,AttributeSelector:()=>I2,Block:()=>V2,Brackets:()=>Z2,CDC:()=>tN,CDO:()=>oN,ClassSelector:()=>aN,Combinator:()=>mN,Comment:()=>vN,Declaration:()=>TN,DeclarationList:()=>$N,Dimension:()=>UN,Function:()=>YN,Hash:()=>ex,IdSelector:()=>lx,Identifier:()=>ox,MediaFeature:()=>mx,MediaQuery:()=>gx,MediaQueryList:()=>Ex,Nth:()=>Ax,Number:()=>kx,Operator:()=>Mx,Parentheses:()=>Ix,Percentage:()=>Fx,PseudoClassSelector:()=>zx,PseudoElementSelector:()=>Xx,Ratio:()=>Jx,Raw:()=>iM,Rule:()=>cM,Selector:()=>hM,SelectorList:()=>vM,String:()=>AM,StyleSheet:()=>LM,TypeSelector:()=>PM,UnicodeRange:()=>FM,Url:()=>KM,Value:()=>JM,WhiteSpace:()=>rR}),lR={generic:!0,...y2,node:Ib},cR=35,uR=42,Db=43,dR=45,mR=47,fR=117;function Bb(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,fR)&&this.cmpChar(this.tokenStart+1,Db)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(t===mR||t===uR||t===Db||t===dR)return this.Operator();t===cR&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var pR={getNode:Bb},hR=35,gR=42,bR=43,yR=47,Hb=46,vR=62,ER=124,SR=126;function wR(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function CR(){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)===Hb&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case bR:case vR:case SR:case yR:return this.Combinator();case Hb:return this.ClassSelector();case gR:case ER:return this.TypeSelector();case hR:return this.IdSelector()}}}var AR={onWhiteSpace:wR,getNode:CR};function TR(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function _R(){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 Fb(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var kR={getNode:Bb,onWhiteSpace(e,t){Fb(e)&&(e.value=" "+e.value),Fb(t.last)&&(t.last.value+=" ")},expression:TR,var:_R},LR=ie({AtrulePrelude:()=>pR,Selector:()=>AR,Value:()=>kR}),NR={parse:{prelude:null,block(){return this.Block(!0)}}},xR={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}},MR={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(!1)}}},RR={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function OR(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function PR(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):$b.call(this)}function $b(){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(OR,this.scope.AtrulePrelude);break;case 1:t=this.Identifier();break;case 21:t=this.Parentheses(PR,this.scope.AtrulePrelude);break;default:break e}e.push(t)}return e}var IR={parse:{prelude(){const e=$b.call(this);return this.getFirstListNode(e)===null&&this.error("Condition is expected"),e},block(){return this.Block(!1)}}},DR={"font-face":NR,import:xR,media:MR,page:RR,supports:IR},Tr={parse(){return this.createSingleNodeList(this.SelectorList())}},BR={parse(){return this.createSingleNodeList(this.Selector())}},Wb={parse(){return this.createSingleNodeList(this.Identifier())}},Ha={parse(){return this.createSingleNodeList(this.Nth())}},HR={dir:Wb,has:Tr,lang:Wb,matches:Tr,is:Tr,"-moz-any":Tr,"-webkit-any":Tr,where:Tr,not:Tr,"nth-child":Ha,"nth-last-child":Ha,"nth-last-of-type":Ha,"nth-of-type":Ha,slotted:BR},FR=ie({AnPlusB:()=>Mg,Atrule:()=>Og,AtrulePrelude:()=>Pg,AttributeSelector:()=>Dg,Block:()=>Fg,Brackets:()=>$g,CDC:()=>Wg,CDO:()=>qg,ClassSelector:()=>zg,Combinator:()=>Ug,Comment:()=>jg,Declaration:()=>Yg,DeclarationList:()=>Kg,Dimension:()=>Zg,Function:()=>Qg,Hash:()=>Jg,IdSelector:()=>tb,Identifier:()=>eb,MediaFeature:()=>nb,MediaQuery:()=>rb,MediaQueryList:()=>ob,Nth:()=>ib,Number:()=>sb,Operator:()=>ab,Parentheses:()=>lb,Percentage:()=>cb,PseudoClassSelector:()=>ub,PseudoElementSelector:()=>db,Ratio:()=>fb,Raw:()=>pb,Rule:()=>gb,Selector:()=>bb,SelectorList:()=>yb,String:()=>wb,StyleSheet:()=>Ab,TypeSelector:()=>_b,UnicodeRange:()=>Nb,Url:()=>Rb,Value:()=>Ob,WhiteSpace:()=>Pb}),$R={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:LR,atrule:DR,pseudo:HR,node:FR},WR={node:Ib},qR=b2({...lR,...$R,...WR});function Xu(e){const t={};for(const n in e){let r=e[n];r&&(Array.isArray(r)||r instanceof Ve?r=r.map(Xu):r.constructor===Object&&(r=Xu(r))),t[n]=r}return t}var{tokenize:xq,parse:zR,generate:Cn,lexer:qb,createLexer:Mq,walk:At,find:Rq,findLast:Oq,findAll:Pq,toPlainObject:Iq,fromPlainObject:Dq,fork:VR}=qR,{hasOwnProperty:UR}=Object.prototype;function Yu(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 zb(e){if(!e)return null;const t=Yu(e.tags,!0),n=Yu(e.ids),r=Yu(e.classes);return t===null&&n===null&&r===null?null:{tags:t,ids:n,classes:r}}function jR(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(UR.call(t,o))throw new Error(`Class can't be used for several scopes: ${o}`);t[o]=n+1}}}return{whitelist:zb(e),blacklist:zb(e.blacklist),scopes:t}}function _r(e){return!e||!e.children||e.children.isEmpty}function Vb(e,t){return e!==null&&e.children===t}function GR(e,t,n){if(e.block&&(this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=!1),_r(e.block))){n.remove(t);return}switch(e.name){case"charset":if(_r(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=rn(e.name).basename;(r==="keyframes"||r==="media"||r==="supports")&&(_r(e.prelude)||_r(e.block))&&n.remove(t)}}}function XR(e,t,n){n.remove(t)}function YR(e,t,n){if(e.value.children&&e.value.children.isEmpty){n.remove(t);return}go(e.property).custom&&/\S/.test(e.value.value)&&(e.value.value=e.value.value.trim())}function KR(e,t,n){(Vb(this.stylesheet,n)||Vb(this.block,n))&&n.remove(t)}var{hasOwnProperty:Co}=Object.prototype,ZR=new Set(["keyframes"]);function Ub(e,t){return e.children.forEach((n,r,o)=>{let i=!1;At(n,function(s){if(this.selector===null||this.selector===e)switch(s.type){case"SelectorList":(this.function===null||this.function.name.toLowerCase()!=="not")&&Ub(s,t)&&(i=!0);break;case"ClassSelector":t.whitelist!==null&&t.whitelist.classes!==null&&!Co.call(t.whitelist.classes,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.classes!==null&&Co.call(t.blacklist.classes,s.name)&&(i=!0);break;case"IdSelector":t.whitelist!==null&&t.whitelist.ids!==null&&!Co.call(t.whitelist.ids,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.ids!==null&&Co.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&&!Co.call(t.whitelist.tags,s.name.toLowerCase())&&(i=!0),t.blacklist!==null&&t.blacklist.tags!==null&&Co.call(t.blacklist.tags,s.name.toLowerCase())&&(i=!0))}}),i&&o.remove(r)}),e.children.isEmpty}function QR(e,t,n,r){if(_r(e.prelude)||_r(e.block)){n.remove(t);return}if(this.atrule&&ZR.has(rn(this.atrule.name).basename))return;const{usage:o}=r;if(o&&(o.whitelist!==null||o.blacklist!==null)&&(Ub(e.prelude,o),_r(e.prelude))){n.remove(t);return}}function JR(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 eO(e,t,n){n.remove(t)}var jb={Atrule:GR,Comment:XR,Declaration:YR,Raw:KR,Rule:QR,TypeSelector:JR,WhiteSpace:eO};function tO(e,t){At(e,{leave(n,r,o){jb.hasOwnProperty(n.type)&&jb[n.type].call(this,n,r,o,t)}})}function nO(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 rO(e){rn(e.name).basename==="keyframes"&&nO(e)}var oO=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;function iO(e){return e===""||e==="-"?!1:!oO.test(e)}function sO(e){const t=e.value;!t||t.type!=="String"||iO(t.value)&&(e.value={type:"Identifier",loc:t.loc,name:t.value})}function aO(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 lO(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 cO(e){function t(){r.length||r.unshift({type:"Number",loc:null,value:"0"},{type:"Number",loc:null,value:"0"}),n.push.apply(n,r),r=[]}let n=[],r=[];e.children.forEach(o=>{if(o.type==="Operator"&&o.value===","){t(),n.push(o);return}o.type==="Identifier"&&(o.name==="transparent"||o.name==="none"||o.name==="repeat"||o.name==="scroll")||r.push(o)}),t(),e.children=new Ve().fromArray(n)}function Gb(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 Xb={font:aO,"font-weight":lO,background:cO,border:Gb,outline:Gb};function uO(e){if(!this.declaration)return;const t=go(this.declaration.property);Xb.hasOwnProperty(t.basename)&&Xb[t.basename](e)}var dO=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,mO=/^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,fO=new Set(["Dimension","Hash","Identifier","Number","Raw","UnicodeRange"]);function Fa(e,t){const n=t&&t.prev!==null&&fO.has(t.prev.data.type)?mO:dO;return e=String(e).replace(n,"$1$2$3"),(e===""||e==="-")&&(e="0"),e}function pO(e){e.value=Fa(e.value)}var hO=new Set(["calc","min","max","clamp"]),gO=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]);function bO(e,t){const n=Fa(e.value);if(e.value=n,n==="0"&&this.declaration!==null&&this.atrulePrelude===null){const r=e.unit.toLowerCase();if(!gO.has(r)||this.declaration.property==="-ms-flex"||this.declaration.property==="flex"||this.function&&hO.has(this.function.name))return;t.data={type:"Number",loc:e.loc,value:n}}}var yO=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]);function vO(e,t){e.value=Fa(e.value),e.value==="0"&&this.declaration&&!yO.has(this.declaration.property)&&(t.data={type:"Number",loc:e.loc,value:e.value},qb.matchDeclaration(this.declaration).isType(t.data,"length")||(t.data=e))}function EO(e){e.value=e.value.replace(/\\/g,"/")}var Yb={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"},Kb={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 Ku(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 Zb(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=Ku(l,a,e+1/3),i=Ku(l,a,e),s=Ku(l,a,e-1/3)}return[Math.round(o*255),Math.round(i*255),Math.round(s*255),r]}function Zu(e){return e=e.toString(16),e.length===1?"0"+e:e}function Qu(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 SO(e,t){let n=e.name,r;if(n==="rgba"||n==="hsla"){if(r=Qu(e.children,4,n==="rgba"),!r)return;if(n==="hsla"&&(r=Zb(...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:Fa(r.shift())}});return}n="rgb"}if(n==="hsl"){if(r=r||Qu(e.children,3,!1),!r)return;r=Zb(...r),n="rgb"}if(n==="rgb"){if(r=r||Qu(e.children,3,!0),!r)return;t.data={type:"Hash",loc:e.loc,value:Zu(r[0])+Zu(r[1])+Zu(r[2])},Qb(t.data,t)}}function wO(e,t){if(this.declaration===null)return;let n=e.name.toLowerCase();if(Yb.hasOwnProperty(n)&&qb.matchDeclaration(this.declaration).isType(e,"color")){const r=Yb[n];r.length+1<=n.length?t.data={type:"Hash",loc:e.loc,value:r}:(n==="grey"&&(n="gray"),e.name=n)}}function Qb(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]),Kb[n]?t.data={type:"Identifier",loc:e.loc,name:Kb[n]}:e.value=n}var Jb={Atrule:rO,AttributeSelector:sO,Value:uO,Dimension:bO,Percentage:vO,Number:pO,Url:EO,Hash:Qb,Identifier:wO,Function:SO};function CO(e){At(e,{leave(t,n,r){Jb.hasOwnProperty(t.type)&&Jb[t.type].call(this,t,n,r)}})}var AO=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 TO(){const e=new AO;return function(n){const r=Cn(n);return n.id=e.resolve(r),n.length=r.length,n.fingerprint=null,n}}function _O(e){return e.type==="Raw"?zR(e.value,{context:"selectorList"}):e}function kO(e,t){for(let n=0;n<3;n++)if(e[n]!==t[n])return e[n]>t[n]?e:t;return e}function ey(e){return _O(e).children.reduce((t,n)=>kO(Ju(n),t),[0,0,0])}function Ju(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]=ey(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]=ey(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 LO=new Set(["first-letter","first-line","after","before"]),NO=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]);function xO(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: "+Cn(r));i=a}break;case"PseudoClassSelector":{const a=s.name.toLowerCase();NO.has(a)||n.add(`:${a}`);break}case"PseudoElementSelector":{const a=s.name.toLowerCase();LO.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=Ju(r).toString(),r.id=null,r.id=Cn(r),i&&(r.compareMarker+=":"+i),o!=="*"&&(r.compareMarker+=","+o)}),e.pseudoSignature=n.size>0?[...n].sort().join(","):!1}function MO(e,t){const n=TO();return At(e,{visit:"Rule",enter(r){r.block.children.forEach(n),xO(r,t.usage)}}),At(e,{visit:"Atrule",enter(r){r.prelude&&(r.prelude.id=null,r.prelude.id=Cn(r.prelude)),rn(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:ty}=Object.prototype;function ny(e,t,n,r){const o=t.data,i=rn(o.name).basename,s=o.name.toLowerCase()+"/"+(o.prelude?o.prelude.id:null);ty.call(e,i)||(e[i]=Object.create(null)),r&&delete e[i][s],ty.call(e[i],s)||(e[i][s]=new Ve),e[i][s].append(n.remove(t))}function RO(e,t){const n=Object.create(null);let r=null;e.children.forEach(function(o,i,s){if(o.type==="Atrule"){const a=rn(o.name).basename;switch(a){case"keyframes":ny(n,i,s,!0);return;case"media":if(t.forceMediaMerge){ny(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 ry(e){return e.type==="Atrule"&&e.name==="media"}function OO(e,t,n){if(!ry(e))return;const r=t.prev&&t.prev.data;!r||!ry(r)||e.prelude&&r.prelude&&e.prelude.id===r.prelude.id&&(r.block.children.appendList(e.block.children),n.remove(t))}function PO(e,t){RO(e,t),At(e,{visit:"Atrule",reverse:!0,enter:OO})}var{hasOwnProperty:IO}=Object.prototype;function oy(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 iy(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 DO(e,t){const n={eq:[],ne1:[],ne2:[],ne2overrided:[]},r=Object.create(null),o=Object.create(null);for(let i=t.head;i;i=i.next)o[i.data.id]=!0;for(let i=e.head;i;i=i.next){const s=i.data;s.fingerprint&&(r[s.fingerprint]=s.important),o[s.id]?(o[s.id]=!1,n.eq.push(s)):n.ne1.push(s)}for(let i=t.head;i;i=i.next){const s=i.data;o[s.id]&&((!IO.call(r,s.fingerprint)||!r[s.fingerprint]&&s.important)&&n.ne2.push(s),n.ne2overrided.push(s))}return n}function ki(e,t){return t.forEach(n=>{const r=n.id;let o=e.head;for(;o;){const i=o.data.id;if(i===r)return;if(i>r)break;o=o.next}e.insert(e.createItem(n),o)}),e}function sy(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 $a(e){switch(e.type){case"Rule":return sy(e.prelude.children,this);case"Atrule":if(e.block)return e.block.children.some($a,this);break;case"Declaration":return!1}return!0}function BO(e,t,n){const r=e.prelude.children,o=e.block.children;n.prevUntil(t.prev,function(i){if(i.type!=="Rule")return $a.call(r,i);const s=i.prelude.children,a=i.block.children;if(e.pseudoSignature===i.pseudoSignature){if(oy(s,r))return a.appendList(o),n.remove(t),!0;if(iy(o,a))return ki(s,r),n.remove(t),!0}return sy(r,s)})}function HO(e){At(e,{visit:"Rule",enter:BO})}function FO(e,t,n){const r=e.prelude.children;for(;r.head!==r.tail;){const o=new Ve;o.insert(r.remove(r.head)),n.insert(n.createItem({type:"Rule",loc:e.loc,prelude:{type:"SelectorList",loc:e.prelude.loc,children:o},block:{type:"Block",loc:e.block.loc,children:e.block.children.copy()},pseudoSignature:e.pseudoSignature}),t)}}function $O(e){At(e,{visit:"Rule",reverse:!0,enter:FO})}var ay=1,WO=2,Ao=0,Li=1,ed=2,Wa=3,ly=["top","right","bottom","left"],qO={"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"},cy={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"},zO=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=qO[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[Li]=i[Ao],i[ed]=i[Ao],i[Wa]=i[Ao];break;case 2:i[ed]=i[Ao],i[Wa]=i[Li];break;case 3:i[Wa]=i[Li]}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(ly[s],i[s])&&(r[ly[s]]=i[s]);return!0}}return n.call(this)?(this.loc||(this.loc=t.loc),!0):!1}isOkToMinimize(){const e=this.sides.top,t=this.sides.right,n=this.sides.bottom,r=this.sides.left;if(e&&t&&n&&r){const o=e.important+t.important+n.important+r.important;return o===0||o===4}return!1}getValue(){const e=new Ve,t=this.sides,n=[t.top,t.right,t.bottom,t.left],r=[Cn(t.top.node),Cn(t.right.node),Cn(t.bottom.node),Cn(t.left.node)];r[Wa]===r[Li]&&(n.pop(),r[ed]===r[Ao]&&(n.pop(),r[Li]===r[Ao]&&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 VO(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(!cy.hasOwnProperty(l))return;const c=cy[l];let u,d;if((!r||i===r)&&c in t&&(d=WO,u=t[c]),(!u||!u.add(l,s))&&(d=ay,u=new zO(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 UO(e,t){e.forEach(function(n){const r=n.shorthand;r.isOkToMinimize()&&(n.operation===ay?n.item.data=t(r.getDeclaration()):n.block.remove(n.item))})}function jO(e,t){const n={},r=[];At(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=VO.call(this,o,l,r,a.lastShortSelector)}}),UO(r,t.declaration)}var GO=1,XO=new Set(["src"]),uy={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},dy={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"]},my={"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 fy(e,t,n){const r=go(e).basename;if(r==="background")return e+":"+Cn(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:m}=d;a||(a=rn(m).vendor),/\\[09]/.test(m)&&(l=RegExp.lastMatch),dy.hasOwnProperty(r)?dy[r].indexOf(m)===-1&&(s[m]=!0):uy.hasOwnProperty(r)&&uy[r].test(m)&&(s[m]=!0);break}case"Function":{let{name:m}=d;a||(a=rn(m).vendor),m==="rect"&&(d.children.some(p=>p.type==="Operator"&&p.value===",")||(m="rect-backward")),s[m+"()"]=!0,d.children.forEach(u);break}case"Dimension":{const{unit:m}=d;switch(/\\[09]/.test(m)&&(l=RegExp.lastMatch),m){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":s[m]=!0}break}}}),i=c?"!"+GO++:"!"+Object.keys(s).sort()+"|"+l+a;break;case"Raw":i="!"+t.value.value;break;default:i=Cn(t.value)}n[o]=i}return e+i}function YO(e,t,n){const r=go(t.property);if(my.hasOwnProperty(r.basename)){const o=my[r.basename];for(const i of o){const s=fy(r.prefix+i,t,n),a=e.hasOwnProperty(s)?e[s]:null;if(a&&(!t.important||a.item.data.important))return a}}}function KO(e,t,n,r,o){const i=e.block.children;i.forEachRight(function(s,a){const{property:l}=s,c=fy(l,s,o),u=r[c];u&&!XO.has(l)?s.important&&!u.item.data.important?(r[c]={block:i,item:a},u.block.remove(u.item)):i.remove(a):YO(r,s,o)?i.remove(a):(s.fingerprint=c,r[c]={block:i,item:a})}),i.isEmpty&&n.remove(t)}function ZO(e){const t={},n=Object.create(null);At(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),KO.call(this,r,o,i,c,n)}})}function QO(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 $a.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(iy(o,u)){const m=c.data.id;r.some((p,f)=>{const h=p.id;if(m<h)return r.insert(c,f),!0;if(!f.next)return r.insert(c),!0}),n.remove(l);return}if(d===i)return!0;s[d]=!0})}function JO(e){At(e,{visit:"Rule",enter:QO})}function td(e){return e.reduce((t,n)=>t+n.id.length+1,0)-1}function nd(e){let t=0;for(const n of e)t+=n.length;return t+e.length-1}function e5(e,t,n){const r=this.block!==null?this.block.avoidRulesMerge:!1,o=e.prelude.children,i=e.block,s=Object.create(null);let a=!0,l=!0;n.prevUntil(t.prev,function(c,u){const d=c.block,m=c.type;if(m!=="Rule"){const h=$a.call(o,c);return!h&&m==="Atrule"&&d&&At(d,{visit:"Rule",enter(y){y.prelude.children.forEach(v=>{s[v.compareMarker]=!0})}}),h}if(e.pseudoSignature!==c.pseudoSignature)return!0;const p=c.prelude.children;if(l=!p.some(h=>h.compareMarker in s),!l&&!a)return!0;if(a&&oy(p,o))return d.children.appendList(i.children),n.remove(t),!0;const f=DO(i.children,d.children);if(f.eq.length){if(!f.ne1.length&&!f.ne2.length)return l&&(ki(o,p),n.remove(u)),!0;if(!r)if(f.ne1.length&&!f.ne2.length){const h=td(o),y=nd(f.eq);a&&h<y&&(ki(p,o),i.children.fromArray(f.ne1))}else if(!f.ne1.length&&f.ne2.length){const h=td(p),y=nd(f.eq);l&&h<y&&(ki(o,p),d.children.fromArray(f.ne2))}else{const h={type:"SelectorList",loc:null,children:ki(p.copy(),o)},y=td(h.children)+2;if(nd(f.eq)>=y){const v=n.createItem({type:"Rule",loc:null,prelude:h,block:{type:"Block",loc:null,children:new Ve().fromArray(f.eq)},pseudoSignature:e.pseudoSignature});return i.children.fromArray(f.ne1),d.children.fromArray(f.ne2overrided),a?n.insert(v,u):n.insert(v,t),!0}}}a&&(a=!p.some(h=>o.some(y=>y.compareMarker===h.compareMarker))),p.forEach(h=>{s[h.compareMarker]=!0})})}function t5(e){At(e,{visit:"Rule",reverse:!0,enter:e5})}function n5(e,t){const n=MO(e,t);t.logger("prepare",e),PO(e,t),t.logger("mergeAtrule",e),HO(e),t.logger("initialMergeRuleset",e),$O(e),t.logger("disjoinRuleset",e),jO(e,n),t.logger("restructShorthand",e),ZO(e),t.logger("restructBlock",e),JO(e),t.logger("mergeRuleset",e),t5(e),t.logger("restructRuleset",e)}function r5(e,t){const n=new Ve;let r=!1,o;return e.nextUntil(e.head,(i,s,a)=>{if(i.type==="Comment"){if(!t||i.value.charAt(0)!=="!"){a.remove(s);return}if(r||o)return!0;a.remove(s),o=i;return}i.type!=="WhiteSpace"&&(r=!0),n.insert(a.remove(s))}),{comment:o,stylesheet:{type:"StyleSheet",loc:null,children:n}}}function o5(e,t,n,r){r.logger(`Compress block #${n}`,null,!0);let o=1;return e.type==="StyleSheet"&&(e.firstAtrulesAllowed=t,e.id=o++),At(e,{visit:"Atrule",enter(i){i.block!==null&&(i.block.id=o++)}}),r.logger("init",e),tO(e,r),r.logger("clean",e),CO(e,r),r.logger("replace",e),r.restructuring&&n5(e,r),e}function i5(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 s5(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function a5(e){return new Ve().appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:new Ve().appendData({type:"Selector",loc:null,children:new Ve().appendData({type:"TypeSelector",loc:null,name:"x"})})},block:e})}function l5(e,t){e=e||{type:"StyleSheet",loc:null,children:new Ve},t=t||{};const n={logger:typeof t.logger=="function"?t.logger:function(){},restructuring:s5(t),forceMediaMerge:!!t.forceMediaMerge,usage:t.usage?jR(t.usage):!1},r=new Ve;let o=i5(t),i=!0,s,a,l=1,c;t.clone&&(e=Xu(e)),e.type==="StyleSheet"?(s=e.children,e.children=r):s=a5(e);do{if(a=r5(s,!!o),o5(a.stylesheet,i,l++,n),c=a.stylesheet.children,a.comment&&(r.isEmpty||r.insert(Ve.createItem({type:"Raw",value:`
40
- `})),r.insert(Ve.createItem(a.comment)),c.isEmpty||r.insert(Ve.createItem({type:"Raw",value:`
41
- `}))),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 c5=ie({compress:()=>l5,find:()=>h5,findAll:()=>b5,findLast:()=>g5,fromPlainObject:()=>y5,generate:()=>f5,lexer:()=>u5,parse:()=>m5,specificity:()=>Ju,toPlainObject:()=>v5,tokenize:()=>d5,walk:()=>p5});function py(e){const t=Vu(e,!0),n=Vu(e);return t.length<n.length?t:n}var{lexer:u5,tokenize:d5,parse:m5,generate:f5,walk:p5,find:h5,findLast:g5,findAll:b5,fromPlainObject:y5,toPlainObject:v5}=VR({node:{String:{generate(e){this.token(5,py(e.value))}},Url:{generate(e){const t=Mb(e.value),n=py(e.value);this.token(7,t.length<=n.length+5?t:"url("+n+")")}}}}),{parse:E5,generate:rd,compress:S5}=c5;function To(e,t,n,r){return t.debug,r}function w5(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=rd(o);e===2&&s.length>256&&(s=s.substr(0,256)+"..."),i+=`
42
- ${s}
43
- `}t=Date.now()}}function C5(e){return e={...e},typeof e.logger!="function"&&e.debug&&(e.logger=w5(e.debug)),e}function hy(e,t,n){Array.isArray(n)||(n=[n]),n.forEach(r=>r(e,t))}function A5(e,t,n){n=n||{};const r=n.filename||"<unknown>";let o;const i=To("parsing",n,Date.now(),E5(t,{context:e,filename:r,positions:!!n.sourceMap}));n.beforeCompress&&To("beforeCompress",n,Date.now(),hy(i,n,n.beforeCompress));const s=To("compress",n,Date.now(),S5(i,C5(n)));return n.afterCompress&&To("afterCompress",n,Date.now(),hy(s,n,n.afterCompress)),n.sourceMap?o=To("generate(sourceMap: true)",n,Date.now(),(()=>{const a=rd(s.ast,{sourceMap:!0});return a.map._file=r,a.map.setSourceContent(r,t),a})()):o=To("generate",n,Date.now(),{css:rd(s.ast),map:null}),o}function kr(e,t){return A5("stylesheet",e,t)}var gy={restructure:!0,forceMediaMerge:!0};function by(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=`
44
- `+cssbeautify(kr(s.innerHTML,gy).css,{indent:" ",autosemicolon:!0})+`
45
- `;s.innerHTML!==a&&(s.textContent=a,r=!0)}if(s.sheet&&yy(e,s.sheet,o,i)){let a=_5(s.sheet);a=kr(a,gy).css,a=`
46
- `+cssbeautify(a,{indent:" ",autosemicolon:!0})+`
47
- `,s.innerHTML!==a&&(s.textContent=a,r=!0)}}return r}function yy(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-")}`),T5(e,c,r)||(t.deleteRule(a),i=!0)}else if(l instanceof CSSGroupingRule)i=yy(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 T5(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 _5(e){return Array.from(e.cssRules,t=>t.cssText).join(`
48
- `)}var vy=/device-width/i,k5="not all",_o=new Map,od=!1;function L5(e){return"media"in e&&"cssRules"in e}function Ey(e,t){for(const n of Array.from(e))L5(n)&&t(n),"cssRules"in n&&Ey(n.cssRules,t)}function N5(e){try{return e.cssRules}catch{return}}function x5(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n&&!vy.test(n));return t.length?t.join(", "):k5}function id(e){_o.forEach((t,n)=>{n.parentStyleSheet?.ownerNode?.isConnected||_o.delete(n)});for(const t of Array.from(e.styleSheets)){const n=N5(t);n&&Ey(n,r=>{const o=r.media.mediaText;_o.has(r)||!vy.test(o)||(_o.set(r,o),r.media.mediaText=x5(o))})}}function Sy(){_o.forEach((e,t)=>{t.media.mediaText=e}),_o.clear()}function M5(e){if(!od)return e();Sy();try{return e()}finally{id(document)}}function R5(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 O5(e=window){if(!e.matchMedia("(pointer: coarse)").matches)return()=>{};const t=e.document;od=!0,id(t);const n=new MutationObserver(r=>{R5(r)&&id(t)});return n.observe(t.documentElement,{childList:!0,characterData:!0,subtree:!0}),()=>{n.disconnect(),Sy(),od=!1}}function Ni(e){return de(e)}var Bq=de("extensions.atomsHandlers"),Hq=Ni("HANDLE_ATOM_INSERT"),Fq=de("HeadlessMode"),$q=de("extensions.sandboxExtensions"),P5="SANDBOX_EXTENSION_SCRIPT_STATUS",Wq=de("MESSAGE_SERVICE"),qq=Ni("SETTINGS_PANEL_EVENT"),zq=Ni("MODAL_SHOW_EVENT"),Vq=Ni("MODAL_CLOSE_EVENT"),Uq=Ni("MODAL_UPDATE_EVENT");function jq(e){return e}var Gq="SandboxApp",I5="IframePluginRegistry",D5="__sandbox__";function wy(){return oc(D5)}function B5(e=wy()){return e.getOrCreateInstance(I5,()=>new ZS)}var sd=new QS(()=>B5()),qa=class _S{constructor(){L(this,"container",wy()),L(this,"pluginCollection",new KS(this,sd)),this.pluginCollection.activateSync()}static get instance(){return this._instance||(this._instance=new _S)}static registerPlugin(t,n){sd.add(t,n)}static registerAll(t){for(const n of Object.keys(t)){let r=n;const o=t[r];o&&sd.add(r,o)}}static use(t){return this.instance.pluginCollection.use(t)}static initFeatures(t){this.instance.initFeatures(t)}static onLifecycle(t){return this.instance.onLifecycle(t)}use(t){return typeof t=="function"?this.pluginCollection.useByCtor(t):this.pluginCollection.useByKey(t)}initFeatures(t){this.pluginCollection.initSync(t)}onLifecycle(t){return this.pluginCollection.onLifecycle(t)}dispose(){this.pluginCollection.dispose()}};L(qa,"_instance",void 0);var xi="data-extension";function Mi(e,t,n,r){Z.send(P5,{key:e,phase:t,status:n,error:r})}function H5(){if(typeof document>"u")return;const e=document.currentScript;if(e instanceof HTMLScriptElement)return e.getAttribute(xi)||void 0}function Cy(e){return{key:e,hasSyncPlugins:!1,pendingPlugins:new Set,loadedNotified:!1,readyNotified:!1,readyFailed:!1}}function ad(e){!e.loadedNotified||e.readyNotified||e.readyFailed||(!e.hasSyncPlugins||e.pendingPlugins.size===0)&&(e.readyNotified=!0,Mi(e.key,"ready","success"))}function F5({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(xi,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 $5(e,t={}){const n=new Ee,r=new Map,o=new Map,i=new Map,s=new WeakMap,a=c=>{let u=i.get(c);return u||(u=Cy(c),i.set(c,u)),u},l=c=>{if(c.type==="created"){const m=H5();if(!m)return;const p=a(m);p.hasSyncPlugins=!0,p.pendingPlugins.add(c.plugin),s.set(c.plugin,m);return}if(c.type==="create:error")return;const u=s.get(c.plugin);if(!u)return;const d=i.get(u);if(d){if(c.type==="afterInit:success"){d.pendingPlugins.delete(c.plugin),ad(d);return}(c.type==="init:error"||c.type==="afterInit:error")&&(d.pendingPlugins.delete(c.plugin),d.readyFailed=!0,Mi(u,"ready","error",`Sandbox plugin "${c.name}" failed during ${c.type==="init:error"?"init":"afterInit"}.`))}};return n.addDisposable(qa.onLifecycle(l)),n.addDisposable(Z.addListener(Pe.SANDBOX_ADD_EXTENSIONS,c=>{for(const u of c){if(t.surface&&u.surfaces&&!u.surfaces.includes(t.surface))continue;let d=r.get(u.key);d&&d.remove(),u.type==="script"&&i.set(u.key,Cy(u.key));const m=u.parent&&document.querySelector(u.parent)||document.head;if(d=F5(u),u.type==="script"){const p=d;p.src&&(p.onload=()=>{const f=a(u.key);f.loadedNotified=!0,Mi(u.key,"load","success"),ad(f)},p.onerror=()=>Mi(u.key,"load","error",`Failed to load sandbox script: ${p.src}`))}if(m.appendChild(d),u.type==="script"&&!d.src){const p=a(u.key);p.loadedNotified=!0,Mi(u.key,"load","success"),ad(p)}r.set(u.key,d),o.set(u.key,u)}})),n.addDisposable(Z.addListener(Pe.SANDBOX_REMOVE_EXTENSIONS,c=>{for(const u of c){const d=o.get(u),m=document.querySelector(`${d?.type}[${xi}]`);m&&m.remove(),r.delete(u),o.delete(u)}})),n.addDisposable(e.onChange(()=>{for(const[c,u]of r){const d=o.get(c),m=document.querySelector(`${d?.type}[${xi}]`);let p=d.parent?[...document.querySelectorAll(d.parent)]:[];p.length||(p=[document.head]),m?m!==u?r.set(c,m):p.some(f=>m.parentNode===f)||p[0]?.appendChild(m):p[0]?.appendChild(u)}})),n}function W5(e){e.querySelectorAll(`[${xi}]`).forEach(t=>t.remove())}var se="remove-basic-cell",Ay="remove-basic-row",oe="em-active-table-cell",An="em-temporary-class",Ue="em-temporary-active-cell-background-color",or="temporary-cell-class",Ty="cursor: pointer; margin: auto; margin-top: 5px",_y="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;",Ri="em_version";function za(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(Ri),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash):e}catch{return e}}function q5(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.set(Ri,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash}catch{return`${e}${e.includes("?")?"&":"?"}${Ri}=${Date.now()}`}}var z5=class extends Ee{constructor(...e){super(...e),L(this,"_transforms",[]),L(this,"_byAttribute",new Map)}register(e){this._transforms.push(e);for(const t of e.attributes){const n=t.toLowerCase(),r=this._byAttribute.get(n);r?r.push(e):this._byAttribute.set(n,[e])}return{dispose:()=>this._remove(e)}}_remove(e){const t=this._transforms.indexOf(e);if(t!==-1){this._transforms.splice(t,1);for(const n of e.attributes){const r=n.toLowerCase(),o=this._byAttribute.get(r);if(!o)continue;const i=o.indexOf(e);i!==-1&&o.splice(i,1),o.length||this._byAttribute.delete(r)}}}get isEmpty(){return this._transforms.length===0}handles(e){return this._byAttribute.has(e.toLowerCase())}get attributes(){return[...this._byAttribute.keys()]}render(e,t){return this._run("render",e,t)}serialize(e,t){return this._run("serialize",e,t)}_run(e,t,n){const r=this._byAttribute.get(n.attribute.toLowerCase());if(!r?.length)return t;const o=e==="render"?r:[...r].reverse();let i=t;for(const s of o){if(i===null)break;const a=e==="render"?s.render?.(i,n):s.serialize?.(i,n);a!==void 0&&(i=a)}return i}dispose(){this._transforms.length=0,this._byAttribute.clear(),super.dispose()}};function ld(){return Et.getInstance(qr)}var Va=new WeakMap;function V5(e,t,n){const r=Va.get(e);r?r.set(t.toLowerCase(),n):Va.set(e,new Map([[t.toLowerCase(),n]]))}function U5(e,t){const n=Va.get(e);n?.size&&Va.set(t,new Map(n))}function ky(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 cd(e,t={}){const n=t.pipeline??ld(),r=t.stage??"build";let o=e;if(t.clone&&(o=e.cloneNode(!0),n&&!n.isEmpty&&Ly(e,o)),!n||n.isEmpty)return o;o instanceof Element&&ky(o,n,r);const i=o.querySelectorAll?.("*");if(i)for(const s of i)ky(s,n,r);return o}function Ua(e,t={}){const n=t.pipeline??ld();return!n||n.isEmpty?e.outerHTML:cd(e,{...t,pipeline:n,clone:!0}).outerHTML}function Ly(e,t){U5(e,t);const n=e.childNodes,r=t.childNodes;for(let o=0;o<n.length&&o<r.length;o++)Ly(n[o],r[o])}function Tt(e,t,n,r={}){const o=ud(e,t,n,{stage:"settings",...r});o===null?e.removeAttribute(t):e.setAttribute(t,o)}function ud(e,t,n,r={}){const o=r.pipeline??ld();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&&V5(a,t,n)}return s}function j5(e){const t=new z5,n=A0((o,i,s)=>t.isEmpty?s:ud(o,i,s,{pipeline:t})),r=T0((o,i,s)=>t.isEmpty?s:t.serialize(s,{element:o,tag:o.tagName.toLowerCase(),attribute:i,stage:"apply"}));return e.inject(qr,t),{pipeline:t,dispose(){r(),n(),t.dispose(),Jt(e,qr)}}}function G5(e){return za(e)}function Ny(e){const t=(n,r)=>{const o=n.getAttribute(r);if(!o)return;const i=G5(o);i!==o&&n.setAttribute(r,i)};e.querySelectorAll("[src]").forEach(n=>t(n,"src")),e.querySelectorAll("[___src]").forEach(n=>t(n,"___src"))}var X5=new Set(["normal","400"]),Y5=new Set(["normal"]),K5=new Set(["baseline","unset","initial",""]),xy=new Set(["none",""]),Z5=["b","strong","em","i","u","s","strike","sup","sub"],Q5="___em-internal";function ja(e){e.querySelectorAll(".em-block-insert").forEach(n=>{n.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_top-document")}),e.querySelectorAll(".em-block-insert_bottom").forEach(n=>{n.classList.remove("em-block-insert_bottom")}),e.querySelectorAll(".em-block-insert_top").forEach(n=>{n.classList.remove("em-block-insert_top")}),e.querySelectorAll(".em-blockatom-insert").forEach(n=>{n.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_top-document")}),e.querySelectorAll(".em-atom-insert").forEach(n=>{n.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}),["em-block-insert-empty","em-atom-insert-empty","em-block-insert-body","em-atom-insert-body","em-resize-start","sortable-chosen","sortable-ghost","em-vindent-table","em-vindent_low","em-vindent","em-relative","em-display-block","em-sandbox-discuss_set-target","em-sandbox-discuss","em-native-img-uploading","em-native-img-drop-target","em-native-img-drop-loading","em-native-file-drag"].forEach(n=>{e.querySelectorAll(`.${n}`).forEach(r=>r.classList.remove(n))}),e.querySelectorAll(".em-powered-logo").forEach(n=>n.remove());for(const n of e.querySelectorAll("[class='']"))n.removeAttribute("class");const t=e instanceof Document?e.documentElement:e;t&&(ft(t,"[data-mce-caret=before]",!0),ft(t,"span.em-element-resize-img-container"),ft(t,"div.em-element-img-change-group",!0),ft(t,"div.em-element-block-add",!0),ft(t,"meta[http-equiv=Content-Security-Policy]",!0),ft(t,"[class*=mce-]"),ft(t,"script[em=initial]",!0),ft(t,".em-editor-wrapper",!0),ft(t,".em-element-resize-height",!0),ft(t,".em-element-vindent-remove",!0),ft(t,".em-element-vindent",!0),ft(t,".em-element-vindent-value",!0),ft(t,"div.iframe-resizer-inner"))}function J5(e){e.querySelectorAll("tbody").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll(".em-code").forEach(t=>t.remove()),e.querySelectorAll(':not(editor)[contenteditable="false"]').forEach(t=>t.remove()),e.querySelectorAll('.em-vindent[class*="em-vindent-padding"]').forEach(t=>t.remove()),e.querySelectorAll(".em-code").forEach(t=>t.remove()),e.querySelectorAll("[contenteditable]").forEach(t=>t.removeAttribute("contenteditable")),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")),e.querySelectorAll("[em-state]").forEach(t=>t.removeAttribute("em-state")),e.querySelectorAll("[em-hover]").forEach(t=>t.removeAttribute("em-hover")),e.querySelectorAll("#gtx-anchor").forEach(t=>t.remove()),e.querySelectorAll('[data-mce-bogus="1"]').forEach(t=>t.remove()),e.querySelectorAll("strike").forEach(t=>t.removeAttribute("style")),e.querySelectorAll("u").forEach(t=>t.removeAttribute("style")),e.querySelectorAll('style[data-theme-varibalse="true"]').forEach(t=>t.remove()),e.querySelectorAll('style[data-em-localization="true"]').forEach(t=>t.remove()),e.querySelectorAll(".em-element-img-change-group").forEach(t=>t.remove()),e.querySelectorAll(".em-element-resize-img").forEach(t=>t.remove()),e.querySelectorAll(".em-element-editor").forEach(t=>t.remove()),e.querySelectorAll(".em-element-vindent-bg").forEach(t=>t.remove()),e.querySelectorAll(".em-element-vindent-value").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap-marker").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap-bg").forEach(t=>t.remove()),e.querySelectorAll(".em-gap").forEach(t=>t.remove()),e.querySelectorAll(".em-just-inserted").forEach(t=>t.classList.remove("em-just-inserted")),e.querySelectorAll(".em-native-img-uploading").forEach(t=>t.classList.remove("em-native-img-uploading")),e.querySelectorAll(".em-native-img-drop-target").forEach(t=>t.classList.remove("em-native-img-drop-target")),e.querySelectorAll(".em-native-img-upload-spin-overlay").forEach(t=>t.remove()),e.querySelectorAll(".em-element-list-bullet").forEach(t=>t.classList.remove("em-element-list-bullet")),e.querySelectorAll(".remove-new-editor-element").forEach(t=>t.classList.remove("remove-new-editor-element")),e.querySelectorAll(`.${Ue}`).forEach(t=>t.classList.remove(Ue)),ja(e),yh(e),ft(e,"editor",!1),Ry(e),Ny(e),Zp(e)}function Oi(e){return(e??"").trim().toLowerCase()}function e3(e){const t=Oi(e.style.fontWeight);t&&X5.has(t)&&e.style.removeProperty("font-weight");const n=Oi(e.style.fontStyle);n&&Y5.has(n)&&e.style.removeProperty("font-style");const r=Oi(e.style.verticalAlign);r&&K5.has(r)&&e.style.removeProperty("vertical-align");const o=Oi(e.style.textDecorationLine);o&&xy.has(o)&&e.style.removeProperty("text-decoration-line");const i=Oi(e.style.textDecoration);i&&xy.has(i)&&e.style.removeProperty("text-decoration");const s=e.getAttribute("style");s!==null&&s.trim()===""&&e.removeAttribute("style")}function t3(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function My(e){if(e.attributes.length===0)return!0;for(const t of Array.from(e.attributes))if(t.name!==Q5)return!1;return!0}function Ry(e){const t=Array.from(e.querySelectorAll("span"));for(let n=t.length-1;n>=0;n-=1){const r=t[n];e3(r),My(r)&&t3(r)}for(const n of Z5){const r=Array.from(e.querySelectorAll(n));for(let o=r.length-1;o>=0;o-=1){const i=r[o];i.childNodes.length===0&&My(i)&&i.remove()}}}function n3(e){e=e.replaceAll(/\uFEFF/gmu,""),e=e.replaceAll(/<link[^>]*?em="css.*?>/gis,""),e=e.replaceAll(/draggable="false"|draggable="true"/gi,""),e=e.replaceAll(/ style="\s*"/gi,""),e=e.replaceAll(/<tbody.*?>/gi,"").replaceAll(/<\/tbody>/gi,""),e=e.replaceAll(/&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(/<script.*?editor.*?script>/gi,""),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[^>]*?ad-right-container.*?style>/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=sh.clear(e);const t=e.match(/((rgb)\(\d{1,3}(,\s?\d{1,3}){2}\))/gi);return t&&t.forEach(n=>{const r=X(n);r&&(e=e.replaceAll(n,r))}),e=e.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),e}function Oy(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 r3(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 Py(){const e=Array.from(document.querySelectorAll('style[em="styles"]'));return M5(()=>by(document,e,{forceMediaMerge:!0}))}function o3(e){let t=!1;return e.beforeCommit(()=>{try{t||(t=!0,Py())}finally{t=!1}})}function ko(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 ko({node:n});i=Oy(s),i.appendChild(n.cloneNode(!0))}else{const a=t.trim(),l=a.match(/<\!?([a-zA-Z]{1,})[^>]*>/i);if(s=l?l[1]:"div",s==="DOCTYPE"||s==="html")return ko({html:t});i=Oy(s);const c=Te(a);i.replaceChildren(...c)}cd(i,{stage:"apply"}),J5(i),t=Ct(i),s.toLowerCase()==="head"&&(t=t.replace("<body></body>","")),s.toLowerCase()==="body"&&(t=t.replace("<head></head>",""))}else{const i=document.implementation.createHTMLDocument();for(const s of[...i.childNodes])s.remove();t?r3(i,Te(t)):n&&i.appendChild(n.cloneNode(!0)),i.documentElement&&(i.querySelectorAll("tbody").forEach(s=>s.replaceWith(...Array.from(s.childNodes))),i.querySelectorAll(".em-code").forEach(s=>s.remove()),i.querySelectorAll(':not(editor)[contenteditable="false"]').forEach(s=>s.remove()),i.querySelectorAll(".em-code").forEach(s=>s.remove()),i.querySelectorAll("[contenteditable]").forEach(s=>s.removeAttribute("contenteditable")),i.querySelectorAll("[em-edit]").forEach(s=>s.removeAttribute("em-edit")),i.querySelectorAll("[em-state]").forEach(s=>s.removeAttribute("em-state")),i.querySelectorAll("[em-hover]").forEach(s=>s.removeAttribute("em-hover")),i.querySelectorAll(".em-just-inserted").forEach(s=>s.classList.remove("em-just-inserted")),i.querySelectorAll(".em-native-img-uploading").forEach(s=>s.classList.remove("em-native-img-uploading")),i.querySelectorAll(".em-native-img-drop-target").forEach(s=>s.classList.remove("em-native-img-drop-target")),i.querySelectorAll(".em-native-img-upload-spin-overlay").forEach(s=>s.remove()),i.body?.classList.remove("em-native-img-drop-loading"),i.body?.classList.remove("em-native-file-drag"),i.querySelectorAll("#gtx-anchor").forEach(s=>s.remove()),i.documentElement.removeAttribute("style"),i.querySelectorAll('style[data-theme-varibalse="true"]').forEach(s=>s.remove()),i.querySelectorAll('style[data-em-localization="true"]').forEach(s=>s.remove()),W5(i),ja(i),yh(i),i.documentElement&&ft(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())}),Ry(i)),cd(i,{stage:"apply"}),Ny(i),Zp(i),t=Vt(i)}return mT(n3(t)).html}var Iy="__emOwnEditor";function i3(e){e[Iy]=!0}function Dy(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[Iy]&&!o.contains(n)&&(o.replaceWith(...Array.from(o.childNodes)),r=!0);return r}var s3={deleteContentBackward:"backward",deleteContentForward:"forward"};function a3(e){const{element:t,getVisibleText:n,mapFn:r,getTagNameForContainer:o,applyAttributesToTag:i,setCursorToElement:s,removeLastWord:a,hasOnlyTextNodesDeep:l,isRangeCoveringAllVisibleText:c,isEditorContentOnlyNbsp:u,commit:d}=e;return function(p){const f=p.target,h=window.getSelection();if(!h||h.rangeCount===0)return;const y=s3[p.inputType];if(y&&Q_(h.getRangeAt(0),y)){p.preventDefault();return}const v=n(f,r).trim(),A=n(h.getRangeAt(0)?.cloneContents(),r).trim(),k=h.getRangeAt(0),S=k.startContainer,b=S.nodeType===Node.TEXT_NODE?S.parentNode:S,E=b.closest("sup, sub")||b,C=E.outerHTML,g=E?.tagName?.toLowerCase();if(p.inputType==="deleteContentBackward"&&!h?.isCollapsed&&A){if((g==="sup"||g==="sub")&&C&&(E?.insertAdjacentHTML("beforebegin","&nbsp;"),E?.removeAttribute("em-edit"),E.remove()),c(k)){p.preventDefault();const w=o(f),T=f.firstElementChild||f,_=document.createElement(w);_.innerHTML=" ",i(_,f,T),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=_.innerHTML:f.innerHTML=_.outerHTML;const M=f.firstChild||f;s(M.firstChild||M),t.setAttribute("em-edit","active"),d(!0);return}t.setAttribute("em-edit","active"),d(!0)}if(p.inputType==="deleteContentBackward"&&h?.isCollapsed&&!A){S.length===1&&((g==="sup"||g==="sub")&&C&&(E?.insertAdjacentHTML("beforebegin","&nbsp;"),E?.removeAttribute("em-edit"),E.remove()),t.setAttribute("em-edit","active"),d(!0));const w=()=>{By(p)&&d(!0)};if(S.nodeType!==Node.TEXT_NODE&&!c(k))return w();const T=k.startOffset;if(T===0&&!c(k))return w();const _=S.parentNode;if(!_)return w();const M=Array.prototype.indexOf.call(_.childNodes,S);if(_.childNodes[M-1]?.nodeType===Node.COMMENT_NODE){p.preventDefault(),S.deleteData(T-1,1);const N=document.createRange();N.setStart(S,T-1),N.collapse(!0),h.removeAllRanges(),h.addRange(N),d(!0);return}f&&u(f)&&(p.preventDefault(),p.stopImmediatePropagation())}if(p.inputType==="insertText"&&!h?.isCollapsed){p.preventDefault();let w=p.data||"";const T=h.anchorNode;c(k)&&(T.tagName==="A"||T?.parentNode&&T.parentNode.tagName==="A")&&(w=" "+p.data),k.deleteContents();const _=document.createTextNode(w||" ");k.insertNode(_),k.setStartAfter(_),k.collapse(!0),h.removeAllRanges(),h.addRange(k),d(!0);return}if(p.inputType.includes("deleteSoftLine")||p.inputType.includes("deleteHardLine")||p.inputType.includes("deleteWord")){if(p.preventDefault(),!h||h.rangeCount===0)return;const w=h.getRangeAt(0),T=document.createRange();T.setStart(f,0),T.setEnd(w.startContainer,w.startOffset);const _=T.toString(),M=document.createRange();M.setStart(w.endContainer,w.endOffset),f.lastChild?M.setEndAfter(f.lastChild):M.setEnd(f,f.childNodes.length);const N=M.toString();if(!_)return;let W="";if(p.inputType.includes("deleteWord")){const we=_.trimEnd().split(/\s+/);we.pop(),W=we.length>0?we.join(" ")+" ":""}const P=(W+N).trim(),R=o(f),Y=f.firstElementChild||f,V=document.createElement(R);V.innerHTML=P||" ",i(V,f,Y),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=V.innerHTML:f.innerHTML=V.outerHTML;const G=f.firstChild?.firstChild||f.firstChild||f,Le=(G.textContent||"").length,ae=Math.min(W.length,Le),ne=document.createRange();G.nodeType===Node.TEXT_NODE?ne.setStart(G,ae):G.firstChild&&G.firstChild.nodeType===Node.TEXT_NODE?ne.setStart(G.firstChild,Math.min(ae,(G.firstChild.textContent||"").length)):ne.setStart(G,0),ne.collapse(!0),h.removeAllRanges(),h.addRange(ne),d();return}if(p.inputType.includes("deleteContent")&&(v.length<2||v===A)&&l(f)){p.preventDefault();const w=o(f),T=f.firstElementChild||f,_=document.createElement(w);_.innerHTML=" ",i(_,f,T),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=_.innerHTML:f.innerHTML=_.outerHTML;const M=f.firstChild||f;s(M.firstChild||M),d(!0);return}if(p.inputType==="insertText"&&p.data){const w=h.anchorNode;if(w?.tagName==="A"&&!w.textContent?.trim().length){p.preventDefault(),p.stopImmediatePropagation(),w.insertAdjacentText("beforeend",p.data);const T=document.createRange();T.selectNodeContents(w),T.collapse(!1),h.removeAllRanges(),h.addRange(T),d(!0);return}if(w?.parentNode&&w.parentNode.tagName==="A"||w?.tagName==="A"){p.preventDefault(),p.stopImmediatePropagation();const T=h.getRangeAt(0),_=document.createTextNode(p.data||"");T.insertNode(_),T.setStartAfter(_),T.collapse(!0),h.removeAllRanges(),h.addRange(T),d(!0);return}}if(p.inputType==="deleteContentBackward"&&!h.isCollapsed&&!A&&f&&u(f)&&(p.preventDefault(),p.stopImmediatePropagation()),By(p)){d(!0);return}d()}}var l3={deleteContentBackward:"delete",deleteContentForward:"forwardDelete"},dd=!1;function By(e){const t=l3[e.inputType];if(!t||e.defaultPrevented||dd)return!1;e.preventDefault(),dd=!0;try{document.execCommand(t)}finally{dd=!1}return!0}function c3(e){return function(n,r){if(!n||(n.querySelectorAll("editor")?.forEach(s=>{s.onclick=null,s.onkeyup=null,s.onmousedown=null}),ja(n),document.querySelectorAll(":not(.em-element-path) .em-element-path").forEach(s=>s.remove()),Dy(n),X_(n,r)))return;ph(n,Te);const o=document.createElement("editor");if(i3(o),o.classList.add("em-text"),o.setAttribute("contenteditable","true"),r)n.before(o),o.replaceChildren(n);else{const s=[...n.childNodes];n.appendChild(o),o.replaceChildren(...s)}const i=o.parentElement;if(i&&!i.style.fontFamily&&!i.style.fontSize&&o.firstElementChild){const s=o.firstElementChild,a=s.getAttribute("style"),l=s.getAttribute("class"),c=s.getAttribute("href"),u=s.getAttribute("target"),d=s.getAttribute("align");a&&o.setAttribute("innerStyle",a),l&&o.setAttribute("innerClass",l),c!==null&&o.setAttribute("innerHref",c),u&&o.setAttribute("innerTarget",u),d&&o.setAttribute("innerAlign",d)}o.addEventListener("input",()=>e.commit(!0),!0),o.addEventListener("beforeinput",a3({element:n,getVisibleText:fh,mapFn:q_,getTagNameForContainer:z_,applyAttributesToTag:(s,a,l)=>V_(s,a,l,X),setCursorToElement:U_,removeLastWord:G_,hasOnlyTextNodesDeep:dh,isRangeCoveringAllVisibleText:R_,isEditorContentOnlyNbsp:M_,commit:e.commit}))}}function u3({commit:e,htmlDocument:t,documentMapping:n}){const r=c3({commit:e});return{now:r,deferred:(i,s)=>{const a=t.getRangeByElement(i,!0);a&&n.hasMappedReplacementRangeInRange(a)||x_(()=>r(i,s),"editor")}}}var Hy=e=>t=>t.some(n=>e(n).some(d3)),d3=e=>e instanceof Element&&(e.hasAttribute("em-edit")||e.querySelector("[em-edit]")),m3=Hy(({removed:e})=>e),f3=Hy(({added:e})=>e),p3=e=>t=>{m3(t)&&!f3(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){Jn("em-edit"),n.setAttribute("em-edit","active"),e({elem:n});return}e({elem:null})},0)},je={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"},_e="em-icon";function h3(e,t,n){return(t=v3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wn(){return Wn=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},Wn.apply(null,arguments)}function Fy(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 Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fy(Object(n),!0).forEach(function(r){h3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g3(e,t){if(e==null)return{};var n,r,o=b3(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 b3(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 y3(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 v3(e){var t=y3(e,"string");return typeof t=="symbol"?t:t+""}function md(e){"@babel/helpers - typeof";return md=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},md(e)}var E3="1.15.7";function qn(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var zn=qn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pi=qn(/Edge/i),$y=qn(/firefox/i),Ii=qn(/safari/i)&&!qn(/chrome/i)&&!qn(/android/i),fd=qn(/iP(ad|od|hone)/i),Wy=qn(/chrome/i)&&qn(/android/i),qy={capture:!1,passive:!1};function he(e,t,n){e.addEventListener(t,n,!zn&&qy)}function pe(e,t,n){e.removeEventListener(t,n,!zn&&qy)}function Ga(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 zy(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function an(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ga(e,t):Ga(e,t))||r&&e===n)return e;if(e===n)break}while(e=zy(e))}return null}var Vy=/\s+/g;function Rt(e,t,n){e&&t&&(e.classList?e.classList[n?"add":"remove"](t):e.className=((" "+e.className+" ").replace(Vy," ").replace(" "+t+" "," ")+(n?" "+t:"")).replace(Vy," "))}function re(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),r[t]=n+(typeof n=="string"?"":"px")}}function Lo(e,t){var n="";if(typeof e=="string")n=e;else do{var r=re(e,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function Uy(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 _n(){var e=document.scrollingElement;return e||document.documentElement}function Qe(e,t,n,r,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,s,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==_n()?(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,!zn))do if(o&&o.getBoundingClientRect&&(re(o,"transform")!=="none"||n&&re(o,"position")!=="static")){var m=o.getBoundingClientRect();s-=m.top+parseInt(re(o,"border-top-width")),a-=m.left+parseInt(re(o,"border-left-width")),l=s+i.height,c=a+i.width;break}while(o=o.parentNode);if(r&&e!==window){var p=Lo(o||e),f=p&&p.a,h=p&&p.d;p&&(s/=h,a/=f,d/=f,u/=h,l=s+u,c=a+d)}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}}function jy(e,t,n){for(var r=ir(e,!0),o=Qe(e)[t];r;){var i=Qe(r)[n],s=void 0;if(n==="top"||n==="left"?s=o>=i:s=o<=i,!s)return r;if(r===_n())break;r=ir(r,!1)}return!1}function No(e,t,n,r){for(var o=0,i=0,s=e.children;i<s.length;){if(s[i].style.display!=="none"&&s[i]!==ee.ghost&&(r||s[i]!==ee.dragged)&&an(s[i],n.draggable,e,!1)){if(o===t)return s[i];o++}i++}return null}function pd(e,t){for(var n=e.lastElementChild;n&&(n===ee.ghost||re(n,"display")==="none"||t&&!Ga(n,t));)n=n.previousElementSibling;return n||null}function Xt(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==ee.clone&&(!t||Ga(e,t))&&n++;return n}function Gy(e){var t=0,n=0,r=_n();if(e)do{var o=Lo(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 S3(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 ir(e,t){if(!e||!e.getBoundingClientRect)return _n();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=re(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return _n();if(r||t)return n;r=!0}}while(n=n.parentNode);return _n()}function w3(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function hd(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 Di;function Xy(e,t){return function(){if(!Di){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),Di=setTimeout(function(){Di=void 0},t)}}}function C3(){clearTimeout(Di),Di=void 0}function Yy(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Ky(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 Zy(e,t,n){var r={};return Array.from(e.children).forEach(function(o){var i,s,a,l;if(!(!an(o,t.draggable,e,!1)||o.animated||o===n)){var c=Qe(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 _t="Sortable"+new Date().getTime();function A3(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(r){if(!(re(r,"display")==="none"||r===ee.ghost)){e.push({target:r,rect:Qe(r)});var o=Tn({},e[e.length-1].rect);if(r.thisAnimationDuration){var i=Lo(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(S3(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=Qe(c),m=c.prevFromRect,p=c.prevToRect,f=a.rect,h=Lo(c,!0);h&&(d.top-=h.f,d.left-=h.e),c.toRect=d,c.thisAnimationDuration&&hd(m,d)&&!hd(u,d)&&(f.top-d.top)/(f.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=_3(f,m,p,o.options)),hd(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=o.options.animation),o.animate(c,f,d,l)),l&&(i=!0,s=Math.max(s,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),i?t=setTimeout(function(){typeof r=="function"&&r()},s):typeof r=="function"&&r(),e=[]},animate:function(r,o,i,s){if(s){re(r,"transition",""),re(r,"transform","");var a=Lo(this.el),l=a&&a.a,c=a&&a.d,u=(o.left-i.left)/(l||1),d=(o.top-i.top)/(c||1);r.animatingX=!!u,r.animatingY=!!d,re(r,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=T3(r),re(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),re(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){re(r,"transition",""),re(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function T3(e){return e.offsetWidth}function _3(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}var xo=[],gd={initializeByDefault:!0},Bi={mount:function(t){for(var n in gd)gd.hasOwnProperty(n)&&!(n in t)&&(t[n]=gd[n]);xo.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),xo.push(t)},pluginEvent:function(t,n,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var i=t+"Global";xo.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][i]&&n[s.pluginName][i](Tn({sortable:n},r)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](Tn({sortable:n},r)))})},initializePlugins:function(t,n,r,o){xo.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,n,t.options);c.sortable=t,c.options=t.options,t[l]=c,Wn(r,c.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var s=this.modifyOption(t,i,t.options[i]);typeof s<"u"&&(t.options[i]=s)}},getEventProperties:function(t,n){var r={};return xo.forEach(function(o){typeof o.eventProperties=="function"&&Wn(r,o.eventProperties.call(n[o.pluginName],t))}),r},modifyOption:function(t,n,r){var o;return xo.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],r))}),o}};function k3(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,m=e.originalEvent,p=e.putSortable,f=e.extraEventProperties;if(t=t||n&&n[_t],!!t){var h,y=t.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!zn&&!Pi?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent("Event"),h.initEvent(r,!0,!0)),h.to=s||n,h.from=a||n,h.item=o||n,h.clone=i,h.oldIndex=l,h.newIndex=c,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=m,h.pullMode=p?p.lastPutMode:void 0;var A=Tn(Tn({},f),Bi.getEventProperties(r,t));for(var k in A)h[k]=A[k];n&&n.dispatchEvent(h),y[v]&&y[v].call(t,h)}}var L3=["evt"],kt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=g3(r,L3);Bi.pluginEvent.bind(ee)(t,n,Tn({dragEl:B,parentEl:Ge,ghostEl:le,rootEl:De,nextEl:Lr,lastDownEl:Xa,cloneEl:Fe,cloneHidden:sr,dragStarted:Fi,putSortable:ct,activeSortable:ee.active,originalEvent:o,oldIndex:Mo,oldDraggableIndex:Hi,newIndex:Ot,newDraggableIndex:ar,hideGhostForTarget:ov,unhideGhostForTarget:iv,cloneNowHidden:function(){sr=!0},cloneNowShown:function(){sr=!1},dispatchSortableEvent:function(a){pt({sortable:n,name:a,originalEvent:o})}},i))};function pt(e){k3(Tn({putSortable:ct,cloneEl:Fe,targetEl:B,rootEl:De,oldIndex:Mo,oldDraggableIndex:Hi,newIndex:Ot,newDraggableIndex:ar},e))}var B,Ge,le,De,Lr,Xa,Fe,sr,Mo,Ot,Hi,ar,Ya,ct,Ro=!1,Ka=!1,Za=[],Nr,ln,bd,yd,Qy,Jy,Fi,Oo,$i,Wi=!1,Qa=!1,Ja,dt,vd=[],Ed=!1,el=[],tl=typeof document<"u",nl=fd,ev=Pi||zn?"cssFloat":"float",N3=tl&&!Wy&&!fd&&"draggable"in document.createElement("div"),tv=(function(){if(tl){if(zn)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),nv=function(t,n){var r=re(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=No(t,0,n),s=No(t,1,n),a=i&&re(i),l=s&&re(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Qe(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Qe(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[ev]==="none"||s&&r[ev]==="none"&&c+u>o)?"vertical":"horizontal"},x3=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},M3=function(t,n){var r;return Za.some(function(o){var i=o[_t].options.emptyInsertThreshold;if(!(!i||pd(o))){var s=Qe(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},rv=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 m=(s?a:l).options.group.name;return i===!0||typeof i=="string"&&i===m||i.join&&i.indexOf(m)>-1}}var r={},o=t.group;(!o||md(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},ov=function(){!tv&&le&&re(le,"display","none")},iv=function(){!tv&&le&&re(le,"display","")};tl&&!Wy&&document.addEventListener("click",function(e){if(Ka)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ka=!1,!1},!0);var xr=function(t){if(B){t=t.touches?t.touches[0]:t;var n=M3(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[_t]._onDragOver(r)}}},R3=function(t){B&&B.parentNode[_t]._isOutsideThisEl(t.target)};function ee(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=Wn({},t),e[_t]=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 nv(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:ee.supportPointer!==!1&&"PointerEvent"in window&&(!Ii||fd),emptyInsertThreshold:5};Bi.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);rv(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:N3,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?he(e,"pointerdown",this._onTapStart):(he(e,"mousedown",this._onTapStart),he(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(he(e,"dragover",this),he(e,"dragenter",this)),Za.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Wn(this,A3())}ee.prototype={constructor:ee,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Oo=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,B):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($3(r),!B&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Ii&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=an(l,o.draggable,r,!1),!(l&&l.animated)&&Xa!==l)){if(Mo=Xt(l),Hi=Xt(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){pt({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),kt("filter",n,{evt:t}),i&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=an(c,d.trim(),r,!1),d)return pt({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),kt("filter",n,{evt:t}),!0}),u)){i&&t.preventDefault();return}o.handle&&!an(c,o.handle,r,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,r){var o=this,i=o.el,s=o.options,a=i.ownerDocument,l;if(r&&!B&&r.parentNode===i){var c=Qe(r);if(De=i,B=r,Ge=B.parentNode,Lr=B.nextSibling,Xa=r,Ya=s.group,ee.dragged=B,Nr={target:B,clientX:(n||t).clientX,clientY:(n||t).clientY},Qy=Nr.clientX-c.left,Jy=Nr.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,B.style["will-change"]="all",l=function(){if(kt("delayEnded",o,{evt:t}),ee.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!$y&&o.nativeDraggable&&(B.draggable=!0),o._triggerDragStart(t,n),pt({sortable:o,name:"choose",originalEvent:t}),Rt(B,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){Uy(B,u.trim(),Sd)}),he(a,"dragover",xr),he(a,"mousemove",xr),he(a,"touchmove",xr),s.supportPointer?(he(a,"pointerup",o._onDrop),!this.nativeDraggable&&he(a,"pointercancel",o._onDrop)):(he(a,"mouseup",o._onDrop),he(a,"touchend",o._onDrop),he(a,"touchcancel",o._onDrop)),$y&&this.nativeDraggable&&(this.options.touchStartThreshold=4,B.draggable=!0),kt("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pi||zn))){if(ee.eventCanceled){this._onDrop();return}s.supportPointer?(he(a,"pointerup",o._disableDelayedDrag),he(a,"pointercancel",o._disableDelayedDrag)):(he(a,"mouseup",o._disableDelayedDrag),he(a,"touchend",o._disableDelayedDrag),he(a,"touchcancel",o._disableDelayedDrag)),he(a,"mousemove",o._delayedDragTouchMoveHandler),he(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&he(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(){B&&Sd(B),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;pe(t,"mouseup",this._disableDelayedDrag),pe(t,"touchend",this._disableDelayedDrag),pe(t,"touchcancel",this._disableDelayedDrag),pe(t,"pointerup",this._disableDelayedDrag),pe(t,"pointercancel",this._disableDelayedDrag),pe(t,"mousemove",this._delayedDragTouchMoveHandler),pe(t,"touchmove",this._delayedDragTouchMoveHandler),pe(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?he(document,"pointermove",this._onTouchMove):n?he(document,"touchmove",this._onTouchMove):he(document,"mousemove",this._onTouchMove):(he(B,"dragend",this),he(De,"dragstart",this._onDragStart));try{document.selection?ol(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Ro=!1,De&&B){kt("dragStarted",this,{evt:n}),this.nativeDraggable&&he(document,"dragover",R3);var r=this.options;!t&&Rt(B,r.dragClass,!1),Rt(B,r.ghostClass,!0),ee.active=this,t&&this._appendGhost(),pt({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(ln){this._lastX=ln.clientX,this._lastY=ln.clientY,ov();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(B.parentNode[_t]._isOutsideThisEl(t),n)do{if(n[_t]){var r=void 0;if(r=n[_t]._onDragOver({clientX:ln.clientX,clientY:ln.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=zy(n));iv()}},_onTouchMove:function(t){if(Nr){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,s=le&&Lo(le,!0),a=le&&s&&s.a,l=le&&s&&s.d,c=nl&&dt&&Gy(dt),u=(i.clientX-Nr.clientX+o.x)/(a||1)+(c?c[0]-vd[0]:0)/(a||1),d=(i.clientY-Nr.clientY+o.y)/(l||1)+(c?c[1]-vd[1]:0)/(l||1);if(!ee.active&&!Ro){if(r&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<r)return;this._onDragStart(t,!0)}if(le){s?(s.e+=u-(bd||0),s.f+=d-(yd||0)):s={a:1,b:0,c:0,d:1,e:u,f:d};var m="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");re(le,"webkitTransform",m),re(le,"mozTransform",m),re(le,"msTransform",m),re(le,"transform",m),bd=u,yd=d,ln=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!le){var t=this.options.fallbackOnBody?document.body:De,n=Qe(B,!0,nl,!0,t),r=this.options;if(nl){for(dt=t;re(dt,"position")==="static"&&re(dt,"transform")==="none"&&dt!==document;)dt=dt.parentNode;dt!==document.body&&dt!==document.documentElement?(dt===document&&(dt=_n()),n.top+=dt.scrollTop,n.left+=dt.scrollLeft):dt=_n(),vd=Gy(dt)}le=B.cloneNode(!0),Rt(le,r.ghostClass,!1),Rt(le,r.fallbackClass,!0),Rt(le,r.dragClass,!0),re(le,"transition",""),re(le,"transform",""),re(le,"box-sizing","border-box"),re(le,"margin",0),re(le,"top",n.top),re(le,"left",n.left),re(le,"width",n.width),re(le,"height",n.height),re(le,"opacity","0.8"),re(le,"position",nl?"absolute":"fixed"),re(le,"zIndex","100000"),re(le,"pointerEvents","none"),ee.ghost=le,t.appendChild(le),re(le,"transform-origin",Qy/parseInt(le.style.width)*100+"% "+Jy/parseInt(le.style.height)*100+"%")}},_onDragStart:function(t,n){var r=this,o=t.dataTransfer,i=r.options;if(kt("dragStart",this,{evt:t}),ee.eventCanceled){this._onDrop();return}kt("setupClone",this),ee.eventCanceled||(Fe=Ky(B),Fe.removeAttribute("id"),Fe.draggable=!1,Fe.style["will-change"]="",this._hideClone(),Rt(Fe,this.options.chosenClass,!1),ee.clone=Fe),r.cloneId=ol(function(){kt("clone",r),!ee.eventCanceled&&(r.options.removeCloneOnHide||De.insertBefore(Fe,B),r._hideClone(),pt({sortable:r,name:"clone"}))}),!n&&Rt(B,i.dragClass,!0),n?(Ka=!0,r._loopId=setInterval(r._emulateDragOver,50)):(pe(document,"mouseup",r._onDrop),pe(document,"touchend",r._onDrop),pe(document,"touchcancel",r._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(r,o,B)),he(document,"drop",r),re(B,"transform","translateZ(0)")),Ro=!0,r._dragStartId=ol(r._dragStarted.bind(r,n,t)),he(document,"selectstart",r),Fi=!0,window.getSelection().removeAllRanges(),Ii&&re(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,r=t.target,o,i,s,a=this.options,l=a.group,c=ee.active,u=Ya===l,d=a.sort,m=ct||c,p,f=this,h=!1;if(Ed)return;function y(V,G){kt(V,f,Tn({evt:t,isOwner:u,axis:p?"vertical":"horizontal",revert:s,dragRect:o,targetRect:i,canSort:d,fromSortable:m,target:r,completed:A,onMove:function(ae,ne){return rl(De,n,B,o,ae,Qe(ae),t,ne)},changed:k},G))}function v(){y("dragOverAnimationCapture"),f.captureAnimationState(),f!==m&&m.captureAnimationState()}function A(V){return y("dragOverCompleted",{insertion:V}),V&&(u?c._hideClone():c._showClone(f),f!==m&&(Rt(B,ct?ct.options.ghostClass:c.options.ghostClass,!1),Rt(B,a.ghostClass,!0)),ct!==f&&f!==ee.active?ct=f:f===ee.active&&ct&&(ct=null),m===f&&(f._ignoreWhileAnimating=r),f.animateAll(function(){y("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(r===B&&!B.animated||r===n&&!r.animated)&&(Oo=null),!a.dragoverBubble&&!t.rootEl&&r!==document&&(B.parentNode[_t]._isOutsideThisEl(t.target),!V&&xr(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),h=!0}function k(){Ot=Xt(B),ar=Xt(B,a.draggable),pt({sortable:f,name:"change",toEl:n,newIndex:Ot,newDraggableIndex:ar,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=an(r,a.draggable,n,!0),y("dragOver"),ee.eventCanceled)return h;if(B.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||f._ignoreWhileAnimating===r)return A(!1);if(Ka=!1,c&&!a.disabled&&(u?d||(s=Ge!==De):ct===this||(this.lastPutMode=Ya.checkPull(this,c,B,t))&&l.checkPut(this,c,B,t))){if(p=this._getDirection(t,r)==="vertical",o=Qe(B),y("dragOverValid"),ee.eventCanceled)return h;if(s)return Ge=De,v(),this._hideClone(),y("revert"),ee.eventCanceled||(Lr?De.insertBefore(B,Lr):De.appendChild(B)),A(!0);var S=pd(n,a.draggable);if(!S||D3(t,p,this)&&!S.animated){if(S===B)return A(!1);if(S&&n===t.target&&(r=S),r&&(i=Qe(r)),rl(De,n,B,o,r,i,t,!!r)!==!1)return v(),S&&S.nextSibling?n.insertBefore(B,S.nextSibling):n.appendChild(B),Ge=n,k(),A(!0)}else if(S&&I3(t,p,this)){var b=No(n,0,a,!0);if(b===B)return A(!1);if(r=b,i=Qe(r),rl(De,n,B,o,r,i,t,!1)!==!1)return v(),n.insertBefore(B,b),Ge=n,k(),A(!0)}else if(r.parentNode===n){i=Qe(r);var E=0,C,g=B.parentNode!==n,w=!x3(B.animated&&B.toRect||o,r.animated&&r.toRect||i,p),T=p?"top":"left",_=jy(r,"top","top")||jy(B,"top","top"),M=_?_.scrollTop:void 0;Oo!==r&&(C=i[T],Wi=!1,Qa=!w&&a.invertSwap||g),E=B3(t,r,i,p,w?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Qa,Oo===r);var N;if(E!==0){var W=Xt(B);do W-=E,N=Ge.children[W];while(N&&(re(N,"display")==="none"||N===le))}if(E===0||N===r)return A(!1);Oo=r,$i=E;var P=r.nextElementSibling,R=!1;R=E===1;var Y=rl(De,n,B,o,r,i,t,R);if(Y!==!1)return(Y===1||Y===-1)&&(R=Y===1),Ed=!0,setTimeout(P3,30),v(),R&&!P?n.appendChild(B):r.parentNode.insertBefore(B,R?P:r),_&&Yy(_,0,M-_.scrollTop),Ge=B.parentNode,C!==void 0&&!Qa&&(Ja=Math.abs(C-Qe(r)[T])),k(),A(!0)}if(n.contains(B))return A(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){pe(document,"mousemove",this._onTouchMove),pe(document,"touchmove",this._onTouchMove),pe(document,"pointermove",this._onTouchMove),pe(document,"dragover",xr),pe(document,"mousemove",xr),pe(document,"touchmove",xr)},_offUpEvents:function(){var t=this.el.ownerDocument;pe(t,"mouseup",this._onDrop),pe(t,"touchend",this._onDrop),pe(t,"pointerup",this._onDrop),pe(t,"pointercancel",this._onDrop),pe(t,"touchcancel",this._onDrop),pe(document,"selectstart",this)},_onDrop:function(t){var n=this.el,r=this.options;if(Ot=Xt(B),ar=Xt(B,r.draggable),kt("drop",this,{evt:t}),Ge=B&&B.parentNode,Ot=Xt(B),ar=Xt(B,r.draggable),ee.eventCanceled){this._nulling();return}Ro=!1,Qa=!1,Wi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),wd(this.cloneId),wd(this._dragStartId),this.nativeDraggable&&(pe(document,"drop",this),pe(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ii&&re(document.body,"user-select",""),re(B,"transform",""),t&&(Fi&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),le&&le.parentNode&&le.parentNode.removeChild(le),(De===Ge||ct&&ct.lastPutMode!=="clone")&&Fe&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),B&&(this.nativeDraggable&&pe(B,"dragend",this),Sd(B),B.style["will-change"]="",Fi&&!Ro&&Rt(B,ct?ct.options.ghostClass:this.options.ghostClass,!1),Rt(B,this.options.chosenClass,!1),pt({sortable:this,name:"unchoose",toEl:Ge,newIndex:null,newDraggableIndex:null,originalEvent:t}),De!==Ge?(Ot>=0&&(pt({rootEl:Ge,name:"add",toEl:Ge,fromEl:De,originalEvent:t}),pt({sortable:this,name:"remove",toEl:Ge,originalEvent:t}),pt({rootEl:Ge,name:"sort",toEl:Ge,fromEl:De,originalEvent:t}),pt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),ct&&ct.save()):Ot!==Mo&&Ot>=0&&(pt({sortable:this,name:"update",toEl:Ge,originalEvent:t}),pt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),ee.active&&((Ot==null||Ot===-1)&&(Ot=Mo,ar=Hi),pt({sortable:this,name:"end",toEl:Ge,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){kt("nulling",this),De=B=Ge=le=Lr=Fe=Xa=sr=Nr=ln=Fi=Ot=ar=Mo=Hi=Oo=$i=ct=Ya=ee.dragged=ee.ghost=ee.clone=ee.active=null;var t=this.el;el.forEach(function(n){t.contains(n)&&(n.checked=!0)}),el.length=bd=yd=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":B&&(this._onDragOver(t),O3(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t=[],n,r=this.el.children,o=0,i=r.length,s=this.options;o<i;o++)n=r[o],an(n,s.draggable,this.el,!1)&&t.push(n.getAttribute(s.dataIdAttr)||F3(n));return t},sort:function(t,n){var r={},o=this.el;this.toArray().forEach(function(i,s){var a=o.children[s];an(a,this.options.draggable,o,!1)&&(r[i]=a)},this),n&&this.captureAnimationState(),t.forEach(function(i){r[i]&&(o.removeChild(r[i]),o.appendChild(r[i]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return an(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var r=this.options;if(n===void 0)return r[t];var o=Bi.modifyOption(this,t,n);typeof o<"u"?r[t]=o:r[t]=n,t==="group"&&rv(r)},destroy:function(){kt("destroy",this);var t=this.el;t[_t]=null,pe(t,"mousedown",this._onTapStart),pe(t,"touchstart",this._onTapStart),pe(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(pe(t,"dragover",this),pe(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Za.splice(Za.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!sr){if(kt("hideClone",this),ee.eventCanceled)return;re(Fe,"display","none"),this.options.removeCloneOnHide&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),sr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(sr){if(kt("showClone",this),ee.eventCanceled)return;B.parentNode==De&&!this.options.group.revertClone?De.insertBefore(Fe,B):Lr?De.insertBefore(Fe,Lr):De.appendChild(Fe),this.options.group.revertClone&&this.animate(B,Fe),re(Fe,"display",""),sr=!1}}};function O3(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function rl(e,t,n,r,o,i,s,a){var l,c=e[_t],u=c.options.onMove,d;return window.CustomEvent&&!zn&&!Pi?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||Qe(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u&&(d=u.call(c,l,s)),d}function Sd(e){e.draggable=!1}function P3(){Ed=!1}function I3(e,t,n){var r=Qe(No(n.el,0,n.options,!0)),o=Zy(n.el,n.options,le),i=10;return t?e.clientX<o.left-i||e.clientY<r.top&&e.clientX<r.right:e.clientY<o.top-i||e.clientY<r.bottom&&e.clientX<r.left}function D3(e,t,n){var r=Qe(pd(n.el,n.options.draggable)),o=Zy(n.el,n.options,le),i=10;return t?e.clientX>o.right+i||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>o.bottom+i||e.clientX>r.right&&e.clientY>r.top}function B3(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,m=!1;if(!s){if(a&&Ja<c*o){if(!Wi&&($i===1?l>u+c*i/2:l<d-c*i/2)&&(Wi=!0),Wi)m=!0;else if($i===1?l<u+Ja:l>d-Ja)return-$i}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return H3(t)}return m=m||s,m&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function H3(e){return Xt(B)<Xt(e)?1:-1}function F3(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 $3(e){el.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&el.push(r)}}function ol(e){return setTimeout(e,0)}function wd(e){return clearTimeout(e)}tl&&he(document,"touchmove",function(e){(ee.active||Ro)&&e.cancelable&&e.preventDefault()}),ee.utils={on:he,off:pe,css:re,find:Uy,is:function(t,n){return!!an(t,n,t,!1)},extend:w3,throttle:Xy,closest:an,toggleClass:Rt,clone:Ky,index:Xt,nextTick:ol,cancelNextTick:wd,detectDirection:nv,getChild:No,expando:_t},ee.get=function(e){return e[_t]},ee.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&&(ee.utils=Tn(Tn({},ee.utils),r.utils)),Bi.mount(r)})},ee.create=function(e,t){return new ee(e,t)},ee.version=E3;var Je=[],qi,Cd,Ad=!1,Td,_d,il,zi;function W3(){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?he(document,"dragover",this._handleAutoScroll):this.options.supportPointer?he(document,"pointermove",this._handleFallbackAutoScroll):r.touches?he(document,"touchmove",this._handleFallbackAutoScroll):he(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?pe(document,"dragover",this._handleAutoScroll):(pe(document,"pointermove",this._handleFallbackAutoScroll),pe(document,"touchmove",this._handleFallbackAutoScroll),pe(document,"mousemove",this._handleFallbackAutoScroll)),sv(),sl(),C3()},nulling:function(){il=Cd=qi=Ad=zi=Td=_d=null,Je.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(il=n,r||this.options.forceAutoScrollFallback||Pi||zn||Ii){kd(n,this.options,a,r);var l=ir(a,!0);Ad&&(!zi||i!==Td||s!==_d)&&(zi&&sv(),zi=setInterval(function(){var c=ir(document.elementFromPoint(i,s),!0);c!==l&&(l=c,sl()),kd(n,o.options,c,r)},10),Td=i,_d=s)}else{if(!this.options.bubbleScroll||ir(a,!0)===_n()){sl();return}kd(n,this.options,ir(a,!1),!1)}}},Wn(e,{pluginName:"scroll",initializeByDefault:!0})}function sl(){Je.forEach(function(e){clearInterval(e.pid)}),Je=[]}function sv(){clearInterval(zi)}var kd=Xy(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=_n(),c=!1,u;Cd!==n&&(Cd=n,sl(),qi=t.scroll,u=t.scrollFn,qi===!0&&(qi=ir(n,!0)));var d=0,m=qi;do{var p=m,f=Qe(p),h=f.top,y=f.bottom,v=f.left,A=f.right,k=f.width,S=f.height,b=void 0,E=void 0,C=p.scrollWidth,g=p.scrollHeight,w=re(p),T=p.scrollLeft,_=p.scrollTop;p===l?(b=k<C&&(w.overflowX==="auto"||w.overflowX==="scroll"||w.overflowX==="visible"),E=S<g&&(w.overflowY==="auto"||w.overflowY==="scroll"||w.overflowY==="visible")):(b=k<C&&(w.overflowX==="auto"||w.overflowX==="scroll"),E=S<g&&(w.overflowY==="auto"||w.overflowY==="scroll"));var M=b&&(Math.abs(A-o)<=s&&T+k<C)-(Math.abs(v-o)<=s&&!!T),N=E&&(Math.abs(y-i)<=s&&_+S<g)-(Math.abs(h-i)<=s&&!!_);if(!Je[d])for(var W=0;W<=d;W++)Je[W]||(Je[W]={});(Je[d].vx!=M||Je[d].vy!=N||Je[d].el!==p)&&(Je[d].el=p,Je[d].vx=M,Je[d].vy=N,clearInterval(Je[d].pid),(M!=0||N!=0)&&(c=!0,Je[d].pid=setInterval(function(){r&&this.layer===0&&ee.active._onTouchMove(il);var P=Je[this.layer].vy?Je[this.layer].vy*a:0,R=Je[this.layer].vx?Je[this.layer].vx*a:0;typeof u=="function"&&u.call(ee.dragged.parentNode[_t],R,P,e,il,Je[this.layer].el)!=="continue"||Yy(Je[this.layer].el,R,P)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&m!==l&&(m=ir(m,!1)));Ad=c}},30),av=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 Ld(){}Ld.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=No(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:av},Wn(Ld,{pluginName:"revertOnSpill"});function Nd(){}Nd.prototype={onSpill:function(t){var n=t.dragEl,r=t.putSortable||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:av},Wn(Nd,{pluginName:"removeOnSpill"}),ee.mount(new W3),ee.mount(Nd,Ld);var lv=100,cv=Symbol("EMULATED_DRAG_EVENT");function q3(e,t){return e[cv]===t}var uv=class{constructor(){L(this,"_target",null),L(this,"_interval",0),L(this,"_x",0),L(this,"_y",0)}_fireDragEvent(e,t,n,r,o){const i=new DragEvent(t,{dataTransfer:o,clientX:n,clientY:r,bubbles:!0,cancelable:!0});return i[cv]=this,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)},lv),!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)},lv)))}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 al(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 Vi(e){const t=getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}function xd(e){const t=document.createElement("div");t.replaceChildren(...Te(e.atomHTML));const n=t.querySelector("img");if(!n)return Ct(t);let r=0;return e.targetAtom.classList.contains("em-block-insert-empty")?r=600:e.targetAtom.classList.contains("em-mob-wrap")||e.targetAtom.classList.contains("noresp-em-mob-wrap")?r=Vi(e.targetAtom):r=e.targetAtom.parentNode?Vi(e.targetAtom.parentNode):Vi(e.targetAtom),n.setAttribute("width",String(r)),document.querySelector(".noresp-em-narrow-table")?al(t):n.style.maxWidth=r+"px",Ct(t)}function z3(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=Vi(n);o.style.display=a;const c=s>=Vi(t)?l:Math.min(s,l);return!c||c===s?!1:(o.setAttribute("width",String(c)),document.querySelector(".noresp-em-narrow-table")?al(e):o.style.maxWidth=c+"px",!0)}function dv(e,t){const n=e.atomHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Te(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")?al(n):(r.style.maxWidth=i+"px",r.style.width="100%"),qe(e.targetElem,e.targetPlace,`
49
- `+Ct(n)+`
50
- `),t()},o.src=r.getAttribute("src")||"",!1}function Md(e){const t=e.blockHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");t.replaceChildren(...Te(e.blockHTML));const n=t.querySelector("img.em-countdown");if(!n)return Ct(t);const r=n.getAttribute("em-cd-settings")||"",o=e.project==="useblocks"?"https://cdt3.useblocks.io/rndt?":"https://cdt3.emcdn.ru/rndt?",i=new URL(o+r),s=new Date;return i.searchParams.set("time",new Date(+s+432e6).toISOString()),Tt(n,"src",i.href),n.setAttribute("em-cd-settings",i.search.substring(1)),Ct(t)}function ll(e){const t=e.blockIsTr?document.createElement("table"):document.createElement("div");return t.replaceChildren(...Te(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(" ")}),al(t),Ct(t)}function V3(e){e&&(e.removeAttribute("em-edit"),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")))}var U3=class{constructor(){L(this,"_items",new Map)}gc(){for(const[e,t]of[...this._items])e.isConnected||(this._items.delete(e),t.destroy())}get(e){return this._items.get(e)}create(e,t){const n=ee.create(e,t);return this._items.set(e,n),n}entries(){return[...this._items]}},lr=new U3,j3=Number.MAX_VALUE,G3=0;function mv(e){return typeof e=="object"?e.name:e}var X3=class{constructor(){L(this,"emulator",new uv),L(this,"x",0),L(this,"y",0),L(this,"_tracked",!1),L(this,"handleMouseMove",e=>{this.x=e.clientX,this.y=e.clientY,this.emulator.over(this.x,this.y)})}track(){this._tracked||(this._tracked=!0,window.addEventListener("mousedown",e=>{this.x=e.clientX,this.y=e.clientY}),window.addEventListener("mouseup",()=>this.emulator.end(this.x,this.y)))}},Yt=new X3;function Y3(e){lr.gc(),Yt.track();const t=document.querySelectorAll("[em=group]");ee.prototype._emulateDragOver=function(){};let n;const r=()=>{e.commit(!0)};function o(a,l){let c;function u(f,h){let y=null,v=Number.MAX_VALUE;const A=mv(ee.active?.options.group);for(const[k,S]of lr.entries())if(mv(S.options.group)===A&&(!a||c&&a(k,c)!==!1)){for(const b of k.children)if(!b.classList.contains("sortable-drag")){const E=b.getBoundingClientRect(),C=f<E.left?E.left-f:f>E.right?f-E.right:0,g=h<E.top?E.top-h:h>E.bottom?h-E.bottom:0;if(C<j3||g<G3){const w=Math.sqrt(C*C+g*g);w<v?(y=[S,b],v=w):w===v&&y[1].contains(b)&&(y=[S,b])}}}return y}function d(f){const h="TouchEvent"in window&&f instanceof TouchEvent?f.touches[0]:f,y=u(h.clientX,h.clientY);if(y){const[k,S]=y,b=S.getBoundingClientRect();var v={clientX:b.left+b.width/2,clientY:h.clientY};for(var A in f)f.hasOwnProperty(A)&&(v[A]=f[A]);v.target=S,v.rootEl=S.parentNode,v.preventDefault=void 0,v.stopPropagation=void 0,k._onDragOver(v)}}return{onStart:f=>{c=f.item,V3(ee.ghost),e.beginTextUpdate(),window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),Yt.emulator.start(Yt.x,Yt.y)?(window.addEventListener("mousemove",Yt.handleMouseMove),n&&(n.dispose(),n=void 0)):f.preventDefault()},onEnd:f=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d);let h=!1;f.from===f.to?Yt.emulator.end(Yt.x,Yt.y):(h=!!l?.(f),Yt.emulator.drop(Yt.x,Yt.y)),window.removeEventListener("mousemove",Yt.handleMouseMove),e.endTextUpdate(),f.from===f.to&&f.oldIndex!==f.newIndex&&e.commit(!0),h&&e.commit(!0),n&&(n.dispose(),n=void 0),c=void 0}}}if(t.length)for(const a of t){const l=a.parentElement;l&&!lr.get(l)&&lr.create(l,{forceFallback:!0,group:"groups-sorting",handle:`.of-group .${je.drag}`,...o(),onMove:r})}const i=[...document.querySelectorAll("[em=block]")],s=[...document.querySelectorAll("[em=atom]")].map(a=>a.parentElement);for(const a of i){const l=a.querySelectorAll("td");for(const c of l)!c.innerHTML&&!c.hasAttribute("height")&&[...c.parentElement?.children||[]].indexOf(c)%2===0&&s.push(c)}if(s.length){const a=new Set;for(const l of s)l&&!a.has(l)&&(a.add(l),lr.get(l)||lr.create(l,{forceFallback:!0,group:"atoms-sorting",handle:`.of-atom .${je.drag}`,...o((c,u)=>{if(u.tagName==="TR"){if(c.tagName!=="TABLE"&&c.tagName!=="TBODY")return!1}else if(u.tagName==="TD"){if(c.tagName!=="TR")return!1}else if(u.tagName==="TABLE"){const d=e.getContext(c);if(d&&vn(d)&&d.tagName==="AMP-ACCORDION"&&c.tagName==="DIV"&&[...d.querySelectorAll("section > div")].indexOf(c)>=0||e.isInExternal(c)&&c.tagName==="DIV")return!0;if(c.tagName!=="TD")return!1}},c=>z3(c.item,c.from,c.to)),onMove:r,onSort:function(){l.innerHTML.trim()===""&&(l.innerHTML="")}}))}if(i.length){const a=new Set;for(const l of i){const c=l.parentElement;c&&!a.has(c)&&(a.add(c),lr.get(c)||lr.create(c,{forceFallback:!0,group:"blocks-sorting",handle:`.of-block .${je.drag}`,...o(),onMove:r}))}}}var K3=class{constructor(){L(this,"_nodes",[])}add(e){const t=this._nodes,n=new Set;for(const r of t){if(r.contains(e))return;e.contains(r)&&n.add(r)}for(const r of n){const o=t.indexOf(r);o>=0&&t.splice(o,1)}t.push(e)}remove(e){const t=new Set;for(const n of this._nodes)(e===n||e.contains(n))&&t.add(n);for(const n of t){const r=this._nodes.indexOf(n);r>=0&&this._nodes.splice(r,1)}}get nodes(){return[...this._nodes]}clear(){this._nodes.splice(0,this._nodes.length)}},Rd={get textDocument(){return D(Et,Ko)},commit:Er};function Z3(){const e=x.get("applicationTheme")||"light";let t=!1;try{Rd.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?fec11667";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?fec11667`;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{Rd.textDocument.endUpdate()}t&&Rd.commit(!1)}var Xq=".em-prevent-action";function Q3(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 J3(){const e=document.body;if(!e)return;const t=x.get("lockEdit")||x.get("lockEditor");(x.get("lockEdit")!==e.classList.contains("mceNonEditable")||x.get("lockEditor"))&&e.classList.toggle("mceNonEditable",!!t),e.classList.toggle("em-sandbox-preview",!!x.get("previewPage"))}function eP(e){const{htmlDocument:t,commit:n,focusController:r}=e;t.onChange(s=>{s.some(a=>a.added.length||a.characterDataChanged||a.reordered?.length||a.reparented?.length)&&Y3(t)}),t.onChange(()=>{Z3()}),t.onRefresh(()=>e.initPreview()),t.onChange(s=>{s.some(a=>a.removed.some(l=>l instanceof HTMLHeadElement||l instanceof HTMLLinkElement&&l.hasAttribute("em")))&&document.querySelector(".em-editor-wrapper")?.remove()});const o=new K3;let i;t.onChange(s=>{for(const a of s)for(const l of a.added)o.add(l.parentElement??l);i||(i=setTimeout(()=>{r.whenEditorLostFocus(()=>{o.clear(),n(!1)}),i=void 0},1e3))}),t.onChange(p3(e.applicationElementSettingsSet)),t.onChange(()=>{x.get("activeElementLocked")>0||(Q3(e),J3())})}function tP(e,t){if(!(e instanceof Element)||!e.closest(".em-prevent-action"))return;const n=document.querySelector(".em-editor-wrapper");if(!(!document.querySelector("[em-edit]")&&!n))try{x.increment("activeElementLocked"),document.querySelectorAll("[em-edit]").forEach(r=>r.removeAttribute("em-edit")),n&&(n.style.display="none"),document.querySelectorAll("editor").forEach(r=>r.blur()),t.forget()}finally{Promise.resolve().then(()=>x.decrement("activeElementLocked"))}}function nP(e){const t=n=>tP(n.target,e);return window.addEventListener("mousedown",t,!0),window.addEventListener("click",t,!0),{dispose(){window.removeEventListener("mousedown",t,!0),window.removeEventListener("click",t,!0)}}}var rP={name:"sandbox.fingerprint",provides:[Vr],awaits:{services:[te]},setup(e){const t=D(e,te),n=__(r=>t.getOuterHtml(r));k_(n),nP(n),e.inject(Vr,n)}},oP={name:"sandbox.setCursor",provides:[vt],awaits:{services:[te,Zt,mt]},setup(e){const t={HTMLDocument:D(e,te),documentMapping:D(e,Zt),remoteDocument:D(e,mt),messageService:Z};e.inject(vt,n=>N_(n,t))}},iP={name:"sandbox.wrapEditor",provides:[Qt],awaits:{services:[te,Zt,xe]},setup:e=>e.inject(Qt,u3({commit:lt(e),htmlDocument:D(e,te),documentMapping:D(e,Zt)}))};function sP(e){const{container:t}=e;qa.registerAll({MessageService:()=>Z,FocusState:()=>e.focusController,SyncService:()=>t.getInstance(te),SyncServiceInternals:()=>t.getInstance(mt),TextDocument:()=>t.getInstance(Ko),Mapping:()=>t.getInstance(Zt),EditorSurface:()=>({surface:e.surface})}),e.features&&e.features.length>0&&qa.initFeatures(e.features)}var aP=e=>e,lP=e=>`table:empty::before {
51
- /*content: 'Paste block here';*/
52
- }
53
-
54
- table:is(:empty, :has(> tbody:only-child:empty))::after {
55
- content: '${e.DROP_BLOCK_HINT}' !important;
56
- }
57
-
58
- [em="block"].empty-structure td:not([height]):not([width]):empty::before {
59
- /*content: 'Paste atom here';*/
60
- }
61
-
62
- .em-block-insert:after {
63
- content: '${e.PASTE_HERE}' !important;
64
- }
65
-
66
- .em-atom-insert:after,
67
- .em-blockatom-insert:after {
68
- content: '${e.PASTE_HERE}' !important;
69
- }`,cP=class extends Ee{constructor(e){super(),L(this,"htmlDocument",void 0),L(this,"_localized",{...Fw(aP)}),L(this,"_styles",""),L(this,"_onChangeLocaleEmitter",new Me),L(this,"_onDomChanged",()=>{if(!document.querySelector('[data-em-localization="true"]')&&this._styles){const t=document.querySelector("head")||document.querySelector("body");if(t){const n=document.createElement("style");n.innerHTML=this._styles,n.dataset.emLocalization="true",t.insertBefore(n,t.firstChild)}}}),L(this,"onChangeLocale",this._onChangeLocaleEmitter.event),this.htmlDocument=e,this.addDisposable(e.onChange(this._onDomChanged))}get localized(){return this._localized}setTranslations({name:e,data:t}){this._localized=t;const n=document.createElement("style");n.dataset.emLocalization="true";const r=lP(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 uP(e){const t=new cP(e),n=r=>{t.setTranslations(r)};return t.addDisposable(Z.addListener(Pe.SANDBOX_TRANSLATIONS,n)),t}function dP(e,t,n){const r=new Ee;let o=[];return r.addDisposable(e.beforeChange(({treeMutations:i})=>{t.isEditorInFocus&&o.push(...i)})),r.addDisposable(t.editorLostFocus(()=>{if(o.length){const i=[];for(const s of o){const a=s.type;let l=null;a==="Add"?l=s.node:a==="Update"&&(l=s.next),l?.closed===!1&&i.push(l)}i.length&&(e.correctNodes(i),n.saveChanges(!1)),o=[]}})),r}function mP(e){const t=new Ee,n=r=>{q3(r,e)||Z.send(Pe.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 fP(){const e=new uv,t=r=>{const o=new DataTransfer;switch(o.setData("Text",r.value),r.type){case"dragenter":e.enter(r.clientX,r.clientY,o);break;case"dragover":e.over(r.clientX,r.clientY,o);break;case"dragleave":e.leave(r.clientX,r.clientY,o);break;case"dragend":e.end(r.clientX,r.clientY,o);break;case"drop":e.drop(r.clientX,r.clientY,o)}},n=new Ee;return n.addDisposable(Z.addListener(Pe.SANDBOX_DRAG_EVENT,t)),n.addDisposable(mP(e)),n}function pP(){return NodeFilter.FILTER_ACCEPT}function hP(e){if(e instanceof Comment)return[e];const t=[];if(e){const n=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,pP);let r;for(;r=n.nextNode();)t.push(r)}return t}var gP=new Dp,bP=new Set;function fv(e){return e?gP.getUnescapedText(e,!0,bP)!==e:!1}function pv(e){return e.nodeValue?fv(e.nodeValue):!1}function yP(e){const t=e.previousSibling;if(t instanceof HTMLSpanElement&&t.classList.contains("em-code")&&t.classList.contains("em-code_var"))return t}function cl(e){const t=e?.nextSibling;if(t instanceof Comment&&pv(t))return t}function hv(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 vP(){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(hv(r,i)===0&&hv(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 EP=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(),n.addRange(r);const o=e.closest('[contenteditable="true"]');o&&o.focus()},gv=e=>{const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n=null,r;for(;r=t.nextNode();)n=r;return n},SP=(e,t)=>{const n=e.startContainer,r=e.startOffset,o=gv(t);if(!o)return!1;const i=o.textContent?.length??0;return n===o&&r===i},wP=(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 bv(e){const t=e.startContainer;return co(t)?t:co(t.parentNode)?t.parentNode:null}function CP(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 AP(e){return document.createTreeWalker(e,NodeFilter.SHOW_TEXT).nextNode()}function TP({em:e,side:t}){const n=t==="after"?gv(e):AP(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),window.getSelection()?.removeAllRanges(),window.getSelection()?.addRange(r)}function _P(e){const t=y=>e.renderOnly(y);let n=null,r=null,o=!1;const i=y=>!!n&&n.em===y.em&&n.side===y.side&&r===(y.side==="after"?"ArrowLeft":"ArrowRight"),s=()=>{const y=window.getSelection();if(o||!y?.rangeCount)return;const v=y.getRangeAt(0),A=gh(v);if(A&&i(A)){n=null,TP(A),nu(document,t);return}if(A){const S=fa(A.em,A.side,t);n=A,nu(document,t,S);return}const k=v.collapsed?bv(v):null;n=k?CP(k):null,nu(document,t,k)},a=()=>{const y=window.getSelection(),v=y?.rangeCount?bv(y.getRangeAt(0)):null;v&&Z_(v,t)},l=y=>{y.isComposing||a()},c=()=>{o=!0},u=()=>{o=!1,a()},d=y=>{r=y.key},m=y=>{const v=window.getSelection();v?.rangeCount&&y?.closest?.('[contenteditable="true"]')&&tk(v.getRangeAt(0),t)},p=y=>{y.key?.length===1&&!y.ctrlKey&&!y.metaKey&&!y.altKey&&m(y.target)},f=y=>{y.inputType==="insertCompositionText"&&m(y.target)},h=()=>{r=null};return document.addEventListener("selectionchange",s),document.addEventListener("input",l,!0),document.addEventListener("compositionstart",c,!0),document.addEventListener("compositionend",u,!0),document.addEventListener("keydown",d,!0),document.addEventListener("pointerdown",h,!0),window.addEventListener("keydown",p,!0),window.addEventListener("beforeinput",f,!0),{dispose(){document.removeEventListener("selectionchange",s),document.removeEventListener("input",l,!0),document.removeEventListener("compositionstart",c,!0),document.removeEventListener("compositionend",u,!0),document.removeEventListener("keydown",d,!0),document.removeEventListener("pointerdown",h,!0),window.removeEventListener("keydown",p,!0),window.removeEventListener("beforeinput",f,!0)}}}function Od(){return x.get("commonStyles")}var ul={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"},kP={"Sans Serif":"sans-serif",Serif:"serif"},yv=":scope > td, :scope > tr > td, :scope > tbody > tr > td";function Po(e){return e.querySelector(yv)}function Ui(e){return Array.from(e.querySelectorAll(yv))}function Pd(e){const t=e.closest('[em="block"]');return t?Po(t)??t.querySelector("td"):null}function vv(e){const t=e.closest('[em="block"]');return!!t&&(e===t||Ui(t).includes(e))}var LP=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},cr=(e,t)=>{LP()},ur=new Map;function NP(e){return ur.get(e.toLowerCase())?.[0]}function Id(e){return ur.get(e.toLowerCase())??[]}function xP(){return ur.size>0}function Ev(){return[...ur.values()].map(e=>e[0])}function MP(e){ur=new Map;for(const t of e??[]){const n=t.family.toLowerCase();ur.set(n,[...ur.get(n)??[],t])}return ur}var RP=e=>{const t=MP(e);cr("iframe: project fonts map received",{count:t.size,families:[...t.keys()],entries:e})};function OP(){const e=new Ee;return e.addDisposable(Z.addListener(Pe.SANDBOX_SET_PROJECT_FONTS,RP)),e}var PP={"sans-serif":"Helvetica, Arial, sans-serif",serif:'"Times New Roman", Times, serif'};function Sv(e){return e.category==="serif"?"serif":"sans-serif"}function dl(e,t){const n=NP(t);return n?(e.style.fontFamily=PP[Sv(n)],!0):!1}var IP=/(?:\/\*\s*em-project-font-[^*]*\*\/\s*)?@font-face\s*\{([^}]*)\}\s*/g,DP=/url\(\s*(['"]?)(.*?)\1\s*\)/,BP=e=>e.trim().replace(/^(['"])(.*)\1$/,"$2");function Dd(e){return Array.from(e.matchAll(IP),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:BP(n.get("font-family")??""),src:DP.exec(n.get("src")??"")?.[2]??"",weight:n.get("font-weight")||"400",style:n.get("font-style")||"normal"}})}function wv(e){return[e.family.toLowerCase(),e.src,e.weight,e.style].join("|")}function Cv(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 Bd(){return Et.getInstance(hf)?.()??document.head}function Hd(){return Bd().querySelector('style[em="styles"]')??document.querySelector('style[em="styles"]')}function $e(){if(!Hd()){const e=document.createElement("style");e.setAttribute("em","styles"),Bd().append(e)}}function HP(){const e=Bd(),t=()=>{const r=Hd(),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 ml(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function Av(e){const t=e.elem.getAttribute("class");if(t){const n=t.split(" ");for(const r of n)r.indexOf("em-mob-padding_"+e.position)>-1&&e.elem.classList.remove(r)}}function Fd(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(`
70
- `));let l=n(s+`
71
- `+[...a.querySelectorAll("style")].map(c=>c.innerHTML).join(`
72
- `),{restructure:!0,forceMediaMerge:!0}).css;l=r(l,{indent:" ",autosemicolon:!0}),i.textContent=`
73
- `+l+`
74
- `}function Io(e){return(e||"").replace(/\s/g,"")}function fl(e,t){return`em-font-${Io(e)}-${Io(t)}`}function Tv(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function $d(e){return fl(e[2]||"",e[3]||"")}var Wd="em-font-custom";function FP(e){return e[1]==="Project Fonts"}function qd(e,t){FP(t)&&e.classList.add(Wd)}function zd(e,t){const n=[...e.classList].filter(r=>r.startsWith(t));n.length>0&&e.classList.remove(...n)}function $P(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+")",Tt(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 pl(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=X(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||(X(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=X(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=X(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=X(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=X(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=X(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=X(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=X(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=X(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=X(e.style.borderLeftColor)||null)}return t}function ji(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 Gi(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]&&X(n[0])||"",inset:n[3]==="inset"||n[4]==="inset"||n[5]==="inset"})}return t}function _v(e){if(!e)return null;const t=e.style;if(t.border&&parseInt(t.borderWidth||t.border)>0)return"all";const n=!!(t.borderTop||t.borderTopWidth&&parseInt(t.borderTopWidth)>0),r=!!(t.borderRight||t.borderRightWidth&&parseInt(t.borderRightWidth)>0),o=!!(t.borderBottom||t.borderBottomWidth&&parseInt(t.borderBottomWidth)>0),i=!!(t.borderLeft||t.borderLeftWidth&&parseInt(t.borderLeftWidth)>0);return n&&r&&o&&i?"all":n&&!r&&!o&&!i?"top":!n&&r&&!o&&!i?"right":!n&&!r&&o&&!i?"bottom":!n&&!r&&!o&&i?"left":n?"top":r?"right":o?"bottom":i?"left":null}function Pt(e){return e==null||e===""}function Vd(e){const{elem:t,settings:n}=e,{border:r}=n;r&&(r.all?!Pt(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&&(!Pt(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&&(!Pt(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&&(!Pt(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&&(!Pt(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 WP(e){const{elem:t,settings:n}=e,{boxShadow:r}=n;if(r)if(!Pt(r.hOffset)&&!Pt(r.vOffset)){let o="";o=r.inset?"inset ":"",o+=r.hOffset+"px ",o+=r.vOffset+"px ",o+=Pt(r.blurRadius)?"":r.blurRadius+"px ",o+=Pt(r.spreadRadius)?"":r.spreadRadius+"px ",o+=r.color?r.color:"",t.style.boxShadow=o}else t.style.removeProperty("box-shadow")}function Xi(e){const{elem:t,settings:n}=e,{borderRadius:r}=n;r&&(r.all?t.style.borderRadius=r.all+"px":(Pt(r.topLeft)?t.style.removeProperty("border-top-left-radius"):t.style.borderTopLeftRadius=r.topLeft+"px",Pt(r.topRight)?t.style.removeProperty("border-top-right-radius"):t.style.borderTopRightRadius=r.topRight+"px",Pt(r.bottomRight)?t.style.removeProperty("border-bottom-right-radius"):t.style.borderBottomRightRadius=r.bottomRight+"px",Pt(r.bottomLeft)?t.style.removeProperty("border-bottom-left-radius"):t.style.borderBottomLeftRadius=r.bottomLeft+"px"))}function kv(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+=kv(n)}),t}function Lv(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=>Lv(r,t,n))}function qP(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 Nv=/\[if[^\]]*mso[^\]]*\]/i,xv="[if gte mso 9]></v:textbox></v:rect><![endif]";function zP(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 VP(e){return(e.style.backgroundRepeat||"").trim().toLowerCase().startsWith("repeat")?"tile":"frame"}function UP(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 jP(e){const t=UP(e),n=Et.getInstance(gf);return n?n(e,t):t}function GP(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 Mv(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function Yi(e){if(!Mv(e))return!1;const t=e.nodeValue||"";return Nv.test(t)&&/src\s*=/i.test(t)&&/v:(fill|image|rect)/i.test(t)}function Ud(e){if(!Mv(e))return!1;const t=e.nodeValue||"";return Nv.test(t)&&/<\/v:(rect|image|textbox)>/i.test(t)&&!/src\s*=/i.test(t)}function jd(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function Rv(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function Ov(e){for(const t of Array.from(e.childNodes))(Yi(t)||Ud(t))&&e.removeChild(t)}function Ki(e,t="inside"){return t==="around"?Yi(jd(e)):Array.from(e.childNodes).some(n=>Yi(n))}function Pv(e,t="inside"){if(t==="around"){const n=e.parentNode;if(!n)return;const r=jd(e),o=Rv(e);Yi(r)&&n.removeChild(r),Ud(o)&&n.removeChild(o);return}Ov(e)}function Iv(e,t="inside"){const n=zP(e);if(!n){Pv(e,t);return}const r=GP(n,(e.style.backgroundColor||e.getAttribute("bgcolor")||"").trim(),VP(e),jP(e)),o=e.ownerDocument;if(o){if(t==="around"){const i=e.parentNode;if(!i)return;const s=jd(e);Yi(s)&&i.removeChild(s);const a=Rv(e);Ud(a)&&i.removeChild(a),i.insertBefore(o.createComment(r),e),i.insertBefore(o.createComment(xv),e.nextSibling);return}Ov(e),e.insertBefore(o.createComment(r),e.firstChild),e.appendChild(o.createComment(xv))}}function Zi(e,t,n="inside"){t?.outlookBackground===!0?Iv(e,n):t?.outlookBackground===!1?Pv(e,n):Ki(e,n)&&qP(t)&&Iv(e,n)}var Gd=/v:roundrect/i,Xd=/\[if\s*!\s*mso\]/i,Dv=/^\s*<!\[endif\]\s*$/i,Yd=["background-color","border-radius","border","border-top","border-right","border-bottom","border-left","border-color","border-style","border-width","box-shadow"],XP=[...Yd,"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 Do(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function Kd(e){const t=[],n=r=>{r.childNodes.forEach(o=>{Do(o)&&Gd.test(o.nodeValue||"")&&t.push(o),n(o)})};return n(e),t}function Bv(e,t){const n=dr(e);if(!n)return!1;const r=n.nodeValue||"";if(!/<center\b[^>]*>[\s\S]*?<\/center>/i.test(r))return!1;const o=Fv((t||"").replace(/\s+/g," ").trim());return n.nodeValue=r.replace(/(<center\b[^>]*>)[\s\S]*?(<\/center>)/i,(i,s,a)=>`${s}${o}${a}`),!0}function dr(e){for(const t of Array.from(e.childNodes)){if(Do(t)&&Gd.test(t.nodeValue||""))return t;const n=dr(t);if(n)return n}return null}function Hv(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function YP(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function kn(e){const t=parseInt(String(e??""),10);return Number.isFinite(t)?t:0}function KP(e,t){const n=(e.textContent||"").replace(/\s+/g," ").trim();if(n)return n;for(const r of t){const o=(r.nodeValue||"").match(/<center[^>]*>([\s\S]*?)<\/center>/i);if(o)return o[1].replace(/\s+/g," ").trim()}return""}function Fv(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ZP(e,t){const n=e.getAttribute("bgcolor");n&&(t.style.backgroundColor||(t.style.backgroundColor=n),e.removeAttribute("bgcolor"));for(const r of Yd){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 QP(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 Yd){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 JP(e){const t=e.style.display;return t!=="inline-block"&&t!=="block"?!1:!!(e.style.backgroundColor||e.style.borderRadius)}function Zd(e){if(!e)return null;for(const t of Array.from(e.querySelectorAll("[style]")))if(JP(t))return t;return null}function Qd(e){return e?!!Zd(e)||!!dr(e):!1}function e4(e,t){for(const n of XP){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 t4(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function $v(e,t){const n=Zd(t);return n?(e4(n,t),t4(n),Kd(t).forEach(r=>r.parentNode?.removeChild(r)),Jd(t),!0):!1}function n4(e){for(const t of e){const n=t.nodeValue||"";if(!Gd.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?kn(i[1]):0,height:s?kn(s[1]):0,arcsize:a?kn(a[1]):0}}return{width:0,height:0,arcsize:0}}function r4(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:X(o)||o||"#000000",weight:`${i}px`,dash:s}}var o4=new Set(["bold","bolder","600","700","800","900"]);function i4(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&&o4.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 s4(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}">${Fv(e.label)}</center></v:roundrect><![endif]`}function Jd(e){const t=[],n=r=>{r.childNodes.forEach(o=>{if(Do(o)){const i=o.nodeValue||"";(Xd.test(i)||Dv.test(i))&&t.push(o)}n(o)})};n(e),t.forEach(r=>r.parentNode?.removeChild(r))}function a4(e){const t=e.closest("td");if(!t)return;const n=e.closest("a")||t.querySelector("a");n&&$v(t,n),Kd(t).forEach(r=>r.parentNode?.removeChild(r)),Jd(t),n&&QP(t,n)}function l4(e){const t=e.ownerDocument;if(!t)return;const n=e.parentNode;if(!n)return;const r=Hv(e);Do(r)&&Xd.test(r.nodeValue||"")||n.insertBefore(t.createComment("[if !mso]><!"),e);const o=YP(e);Do(o)&&Dv.test(o.nodeValue||"")||n.insertBefore(t.createComment("<![endif]"),e.nextSibling)}function c4(e,t){return e?.backgroundColor!==void 0?e.backgroundColor===""?"none":e.backgroundColor:t.style.backgroundColor||t.getAttribute("bgcolor")||"none"}function u4(e,t){if(t?.width?.value&&t.width.dim==="px")return kn(t.width.value);const n=e?.getAttribute("width")||"";return n&&!n.includes("%")?kn(n):0}function d4(e,t){if(t?.height?.value&&t.height.dim==="px")return kn(t.height.value);const n=e.getAttribute("height")||"";return n&&!n.includes("%")?kn(n):kn(e.style.height)}function m4(e,t){return e?.borderRadius&&e.borderRadius.all!=null?kn(e.borderRadius.all):kn(t.style.borderRadius)}function f4(e,t,n){const r=[t,n].filter(i=>i>0);if(!r.length||e<=0)return 0;const o=Math.min(...r);return Math.max(0,Math.min(100,Math.round(e/o*100)))}function em(e,t){const n=e.closest("td");if(!n)return;const r=e.closest("a")||n.querySelector("a");if(!r)return;const o=Kd(n),i=KP(r,o),s=n4(o);$v(n,r),ZP(n,r),o.forEach(v=>v.parentNode?.removeChild(v)),Jd(n);const a=u4(n.closest("table"),t)||s.width,l=d4(n,t)||s.height,c=m4(t,r),u=i4(r),d=r4(r),m=f4(c,a,l)||s.arcsize,p={href:t?.href!==void 0?t.href:r.getAttribute("href")||"",fillcolor:c4(t,r),width:a,height:l,arcsize:m,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||""};l4(r);const f=n.ownerDocument;if(!f)return;const h=Hv(r),y=f.createComment(s4(p));Do(h)&&Xd.test(h.nodeValue||"")&&h.parentNode?h.parentNode.insertBefore(y,h):n.insertBefore(y,n.firstChild)}function hl(e,t){return e.replace(/(^|[;\s])color:\s*[^;]*;?/i,`$1color: ${t};`)}function Ln(e){return typeof e=="number"&&Number.isFinite(e)}function p4(e){return!e||typeof e!="object"?!1:Ln(e.all)||Ln(e.top)||Ln(e.right)||Ln(e.bottom)||Ln(e.left)}function h4(e,t){const n=Ln(t.all)?t.all:void 0,r=Ln(t.top)?t.top:n,o=Ln(t.right)?t.right:n,i=Ln(t.bottom)?t.bottom:n,s=Ln(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 Wv(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 qv(e){const t=document.querySelector("title");if(t){t.insertAdjacentElement("afterend",e);return}document.head.appendChild(e)}function zv(e){return e.stylesheet??Hw(e.source_url)}function g4(e){return`/* ${`em-project-font-${Io(e.family)}-${e.weight}-${e.style}`} */
75
- @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 b4=e=>wv({family:e.family,src:e.source_url,weight:e.weight,style:e.style});function y4(e,t){if(Wv(t,e))return;const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.setAttribute("em-class",t),qv(n)}function Qi(e,t){const n=e.fontFamilyArray[1],r=e.fontFamilyArray[2],o=e.fontFamilyArray[3],i=fl(r,o);if(n==="Project Fonts"){const d=Id(r),m=d[0];if(cr("iframe: addFontFamilyClass Project Fonts",{fontFamilyArray:e.fontFamilyArray,emClass:i,entryFound:!!m,faces:d}),m){$e();const p=document.querySelector('style[em="styles"]'),f=[...new Set(d.filter(zv).map(h=>h.source_url))];if(f.forEach(h=>y4(h,i)),p){const h=new Set(Dd(p.textContent??"").map(wv)),y=d.filter(S=>!zv(S)).filter(S=>!h.has(b4(S))).map(g4).join(`
76
- `),v=y!=="";v&&p.insertAdjacentHTML("afterbegin",`${y}
77
- `);const A=`.${Tv(i)} {`,k=!p.textContent?.includes(A);if(k){const S=ul[o],b=(S||m.weight).replace(/i$/g,""),E=S?S.endsWith("i"):m.style!=="normal";let C=`font-family: ${JSON.stringify(m.family)}, ${Sv(m)}!important;`;C+=` font-weight: ${b}!important;`,E&&(C+=" font-style: italic!important;"),p.insertAdjacentHTML("beforeend",`
78
- ${A} ${C} }`)}cr("iframe: project font attached",{emClass:i,stylesheetUrls:f,faceInserted:v,classInserted:k})}else cr("iframe: style[em=styles] not found — @font-face not injected");setTimeout(()=>{Mr({elem:document.documentElement},t),mr(t),t&&t(!1)},0);return}cr("iframe: Project Fonts entry missing in map — skip Google Fonts fallback",{fontFamily:r,mapSize:document.querySelectorAll('style[em="styles"]').length}),setTimeout(()=>{Mr({elem:document.documentElement},t),mr(t)},0);return}if(!Wv(i)){const d=document.createElement("link");d.setAttribute("rel","stylesheet");const m=ul[o]||"400",p=m.indexOf("i")>-1,f=m.replaceAll("i","");d.setAttribute("href",`https://fonts.googleapis.com/css2?family=${r}:ital,wght@${p?"1":"0"},${f}&display=swap`),d.setAttribute("em-class",i),qv(d)}$e();const s=ul[o]||"400",a=s.replaceAll("i",""),l=s.indexOf("i")>-1;let c=`font-family: '${r}', ${kP[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",`
79
- .${Tv(i)} { ${c} }`),setTimeout(()=>{Mr({elem:document.documentElement},t),mr(t)},0)}function v4(e){const t=Io(e);return!!document.querySelector(`[class*="em-font-${t}-"], [class*="em-font-${t.toLowerCase()}-"]`)}function mr(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=Dd(n).filter(o=>Id(o.family).length>0&&!v4(o.family));!t||r.length===0||(t.textContent=Cv(n,r),cr("iframe: clearProjectFontFaces removed stale @font-face",{removedFamilies:[...new Set(r.map(o=>o.family))]}),e&&e(!1))}function Mr(e,t){let n=!1;e.elem.querySelectorAll("link[em-class]").forEach(r=>{const o=r.getAttribute("em-class");o&&!document.querySelector("."+o)&&(n=!0,r.remove())}),n&&t&&t(!1)}function tm(e,t,n){t[0]==="Safe Fonts"?(e.style.fontFamily=t[1],Mr({elem:document.documentElement},n),mr(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"&&dl(e,t[2]),e.classList.remove(...[...e.classList].filter(r=>r.startsWith("em-font"))),e.classList.add(fl(t[2],t[3])),Qi({fontFamilyArray:t},n))}function Vv(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 Uv(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 jv(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 Ji(e,t){e&&e.tagName==="TABLE"&&(e.classList.contains("em-vindent-table")||e.querySelector("td")?.innerHTML==="")&&e.querySelector("td")?.setAttribute("height",String(t))}function Gv(e,t){const n=Od(),r=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");return r.replaceChildren(...Te(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=hl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.text?.fontSize||16}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${n.text?.lineHeight||24}px`),n.text?.color||"#000000");i.setAttribute("style",a),tm(i,s,t);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingBottom?l.style.paddingBottom=(n.text?.paddingBottom||0)+"px":Ji(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=hl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.headings?.fontSize||24}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${n.headings?.lineHeight||32}px`),n.headings?.color||"#000000");i.setAttribute("style",a),tm(i,s,t),jv(i,n.headings?.letterSpacing||0),Vv(i,n.headings?.bold||!1),Uv(i,n.headings?.italic||!1);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingTop?l.style.paddingTop=(n.headings?.paddingTop||0)+"px":Ji(i.previousElementSibling,n.headings?.paddingTop||0),l?.style.paddingBottom?l.style.paddingBottom=(n.headings?.paddingBottom||0)+"px":Ji(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=hl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.buttons?.fontSize||16}px`),n.buttons?.color||"#FFFFFF");i.setAttribute("style",a),tm(i,s,t);const l=i.closest("td"),c=!!l&&!!dr(l)&&!dr(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"),jv(i,n.buttons?.letterSpacing||0),Vv(i,n.buttons?.bold||!1),Uv(i,n.buttons?.italic||!1);const m=i.closest('[em="atom"] > tr > td'),p=i.closest("table");m?.style.paddingTop?m.style.paddingTop=(n.buttons?.marginTop||0)+"px":p?.previousElementSibling&&Ji(p.previousElementSibling,n.buttons?.marginTop||0),m?.style.paddingBottom?m.style.paddingBottom=(n.buttons?.marginBottom||0)+"px":p?.nextElementSibling&&Ji(p.nextElementSibling,n.buttons?.marginBottom||0);const f=n.buttons?.padding||{};f.all&&(i.style.padding=f.all+"px"),f.top&&(i.style.paddingTop=f.top+"px"),f.right&&(i.style.paddingRight=f.right+"px"),f.bottom&&(i.style.paddingBottom=f.bottom+"px"),f.left&&(i.style.paddingLeft=f.left+"px"),u&&(n.buttons?.border&&Vd({settings:{border:n.buttons.border},elem:u}),n.buttons?.borderRadius&&Xi({settings:{borderRadius:n.buttons.borderRadius},elem:u})),c&&em(i,{backgroundColor:d})}}else{const s=hl(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=>{Ui(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",n.block.backgroundColor),s.style.backgroundColor=n.block.backgroundColor})}),r.tagName==="DIV"?Ct(r):Ct(r.querySelector("tbody")||r)}function nm(e){const t=Od(),n=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Te(e.html)),n.querySelector('[em="block"]')&&t.block?.backgroundColor&&n.querySelectorAll('[em="block"]').forEach(o=>{Ui(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",t.block.backgroundColor),s.style.backgroundColor=t.block.backgroundColor})});const r=t.block?.padding;return p4(r)&&Array.from(n.querySelectorAll('[em="block"]')).flatMap(Ui).forEach(o=>{h4(o,r)}),n.tagName==="DIV"?Ct(n):Ct(n.querySelector("tbody")||n)}var E4=e=>{for(const t of Object.keys(ul))if(Io(t)===e)return t;return e};function S4(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=new Set(Id(e).filter(i=>i.stylesheet).map(i=>i.source_url)),o=Dd(n).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&r.has(i.src));t&&o.length&&(t.textContent=Cv(n,o),cr("iframe: dropped stylesheet @font-face",{family:e,count:o.length}))}function w4(e){if(!xP())return;const t=document.head.innerHTML,n=new Set;for(const r of Ev()){S4(r.family);const o=`em-font-${Io(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=E4(a);Qi({fontFamilyArray:["Google Fonts","Project Fonts",r.family,l]})})})}n.size>0&&cr("iframe: hydrated project @font-face from DOM classes",{classes:[...n],families:Ev().map(r=>r.family)}),mr(),e&&document.head.innerHTML!==t&&e(!1)}function C4(e,t){const n=new Ee,r=()=>{requestAnimationFrame(()=>{w4(t)})};return n.addDisposable(Z.addListener(Pe.SANDBOX_SET_PROJECT_FONTS,r)),n.addDisposable(e.onReady(r)),n}function Xv(){Z.send({operation:"sandbox_resized"})}function A4(e,t){const n=new Ee,r=0;let o=0;n.addDisposable(t.beforeSave(()=>{o&&(clearTimeout(o),o=0)}));function i(){o||(o=setTimeout(()=>{Xv(),o=0},r))}return n.addDisposable(e.onChange(s=>{const a=s.flatMap(function(l){return l.added.flatMap(c=>{if(vn(c))return V0(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 T4(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 _4=/^(?:ant|vscode|monaco|docs)-/;function k4(e){return _4.test(e)}function L4(){const e="em".trim();if(!/^[a-z][a-z0-9]*$/i.test(e))throw new Error(`[cssVars] REACT_APP_CSS_VAR_PREFIX="${e}" is not a valid CSS identifier fragment.`);return e}var N4=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function x4(){return N4}var M4=new Set;function R4(e,t,n=M4){return e.startsWith(`${t}-`)?!1:!k4(e)&&!n.has(e)}function O4(e,t){return`--${t}-${e}`}function P4(e){const t=L4();return R4(e,t,x4())?O4(e,t):`--${e}`}function I4(e){const t=new Ee;let n="";const r=o=>{document.querySelectorAll("style[em-variables]").forEach(a=>a.remove());const i=document.createElement("style");i.dataset.themeVaribalse="true";const s=Object.entries(o).map(([a,l])=>` ${P4(a)}: ${String(l)};
80
- `).join("");if(s&&n!==s){n=s,i.innerHTML=`:root {
81
- ${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 {
82
- ${n}}`;const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(o,i.firstChild),e.commit(!1)}})),t.addDisposable(Z.addListener(Pe.SANDBOX_SET_THEME_VARIABLES,r)),t}var D4={name:"sandbox.crossDomainDrag",setup:()=>fP()},B4={name:"sandbox.themeVariables",awaits:{services:[te]},setup:e=>I4(D(e,te))},H4={name:"sandbox.projectFonts",awaits:{services:[mt,xe]},setup(e){OP();const t=lt(e);C4(D(e,mt),n=>t(n))}},F4={name:"sandbox.variableSelection",setup:()=>vP()},$4={name:"sandbox.emReplaceCaret",awaits:{services:[te]},setup:e=>_P(D(e,te))},W4={name:"sandbox.resizeWatch",awaits:{services:[te,mt]},setup(e){A4(D(e,te),D(e,mt)),T4()}},q4={name:"sandbox.reset",awaits:{services:[te]},setup:e=>fT(D(e,te))},z4={name:"sandbox.correct",awaits:{services:[te,at,mt]},setup:e=>dP(D(e,te),D(e,at).controller,D(e,mt))},V4={name:"sandbox.extensionScripts",awaits:{services:[te,Qo]},setup:e=>$5(D(e,te),{surface:D(e,Qo)})},U4={name:"sandbox.localization",provides:[lc],awaits:{services:[te]},setup:e=>e.inject(lc,uP(D(e,te)))};function j4(e=[]){return{name:"sandbox.extensions",awaits:{services:[at,Qo,te]},setup:t=>sP({container:t,focusController:D(t,at).controller,surface:D(t,Qo),features:[...e]})}}function G4(e){const t=n=>function r(o,i=10){if(!X4(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 X4(e){return typeof e=="string"||typeof e=="object"&&e!==null&&!(e instanceof Element)}function Yv(e){return/^(data|blob):/i.test(e.trimStart())}function Kv(e,t){const n=/^(\s*)([\s\S]*?)(\s*)$/.exec(e);return!n||!n[2]?e:`${n[1]}${t(n[2])}${n[3]}`}function Y4(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 K4(e,t){return e.replaceAll(/url\((\s*['"]?)([^'")]+)(['"]?\s*)\)/gi,(n,r,o,i)=>`url(${r}${Kv(o,t)}${i})`)}function rm(e,t,n){const r=e.toLowerCase();return r==="srcset"?Y4(t,n):r==="style"?K4(t,n):Kv(t,n)}var Z4=["src","___src","background","poster","srcset","style"];function gl(e){return Yv(e)?e:za(e)}function Q4(){const e=new Map,t=n=>{if(Yv(n))return n;const r=gl(n),o=e.get(r);return o?q5(r).replace(new RegExp(`${Ri}=\\d+`),`${Ri}=${o}`):n};return{transform:{name:"em-version",attributes:Z4,render:(n,r)=>n&&rm(r.attribute,n,t),serialize:(n,r)=>n&&rm(r.attribute,n,gl)},requestReload(n){e.set(gl(n.trim()),String(Date.now()))},isPending(n){return e.has(gl(n.trim()))},clear(){e.clear()}}}var Zv=["src","background","poster","srcset","style"];function om(e,t=document){const n=Zv.map(o=>`[${o}]`).join(","),r=[...t.querySelectorAll(n)];for(const o of r){const i=o.tagName.toLowerCase();for(const s of Zv){const a=o.getAttribute(s);if(!a)continue;const l=e.serialize(a,{element:o,tag:i,attribute:s,stage:"apply"})??a,c=ud(o,s,l,{pipeline:e,stage:"apply"});c===null?a!==l&&o.removeAttribute(s):c!==a&&o.setAttribute(s,c)}}}function J4(e,t){const{pipeline:n,htmlDocument:r}=t,o=Q4(),i=n.register(o.transform),s={reload(a){a&&(o.requestReload(a),r.renderOnly(()=>om(n)))},clear(){o.clear()}};return e.inject(ac,s),{reload:s,dispose(){i.dispose(),o.clear(),Jt(e,ac)}}}var eI=["https://emcdn.ru/843/20220715_113006_18.png","https://cdn.useblocks.io/843/230110_18_kXn4Evf.png"],tI="/static/media/",nI="empty-image";function rI(e){return e.replace(/[.-][A-Za-z0-9_-]{7,20}$/,"")}function Qv(e){let t;try{t=new URL(e,document.baseURI).pathname}catch{return null}return t.includes(tI)?t:null}function oI(e){return!!e&&Qv(e)!==null}function iI(e){if(!e)return!1;if(eI.includes(e))return!0;const t=Qv(e);return t===null?!1:rI(t.slice(t.lastIndexOf("/")+1).replace(/\.[^.]+$/,""))===nI}var sI=1e4;function aI(e=sI){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 lI=3e3,cI=["src","___src","background","poster","srcset","style"],im=e=>e.startsWith("blob:"),bl="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 uI(e){const t=encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return`${bl}${t}`}var dI=new RegExp(String.raw`blob:[^\s"'()<>]+|`+bl.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+String.raw`[^\s"'()<>]*`,"g");function Jv(e){if(e.startsWith(bl))try{return decodeURIComponent(e.slice(130))}catch{return}}function mI(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:gT(n)}function fI(e){try{return new URL(e,document.baseURI).hostname}catch{return}}function pI(e){const t=e.store??aI(),n=e.answerTimeoutMs??lI,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=f=>{const h=fI(f);return h?h===window.location.hostname||i.sourceHosts.includes(h):!1},u=(f,h=!1)=>{if(r.has(f)||!h&&(o.has(f)||t.peek(f)))return;const y=Z.sendAsync(Pe.APPLICATION_CANVAS_IMAGE_GET,h?{url:f,fresh:h}:{url:f}).then(A=>{const k=A;if(k&&"blob"in k){t.acquire(f,k.blob),l.hits+=1;return}o.add(f),l.refused+=1}).catch(()=>{o.add(f),l.failed+=1}),v=Promise.race([y,new Promise(A=>{setTimeout(()=>{r.has(f)&&(s=!0,o.add(f),l.failed+=1),A()},n)})]).then(()=>{r.delete(f),e.refresh()});r.set(f,v)},d=f=>{const h=Jv(f);if(h!==void 0)return d(h);if(!f||a||im(f)||f.startsWith("data:")||oI(f))return f;const y=t.peek(f);return y||(s||!i.enabled||o.has(f)||!c(f)?f:(l.misses+=1,u(f),uI(f)))},m=f=>im(f)?t.sourceOf(f)??f:Jv(f)??f,p=(f,h,y)=>rm(h.attribute,f,y);return{configure(f){i={enabled:f.enabled,sourceHosts:[...f.sourceHosts??[]]}},transform:{name:"image-cache",attributes:cI,render:(f,h)=>f&&mI(h)?p(f,h,d):f,serialize:(f,h)=>f&&p(f,h,m)},forget(f){t.forget(f),o.delete(f),!a&&u(f,!0)},fail(f){const h=t.sourceOf(f);return h===void 0||t.peek(h)!==f?!1:(o.add(h),t.forget(h),l.failed+=1,!0)},block(){a=!0},restoreUrls(f){return sm(f,m)},stats(){return{...l,blobs:t.size}},dispose(){t.dispose(),r.clear(),o.clear()}}}function hI(e,t,n){let r=!1;const o=s=>{const a=s;r||!String(a.blockedURI??"").startsWith("blob")||a.effectiveDirective!=="img-src"||(r=!0,t.block(),n())},i=s=>{const a=s.target,l=a?.currentSrc||a?.src||"";im(l)&&t.fail(l)&&n()};return e.addEventListener("securitypolicyviolation",o),e.addEventListener("error",i,!0),{dispose:()=>{e.removeEventListener("securitypolicyviolation",o),e.removeEventListener("error",i,!0)}}}function gI(e,t){return!e.includes("blob:")&&!e.includes(bl)?e:e.replace(dI,n=>t(n))}function sm(e,t){if(typeof e=="string")return gI(e,t);if(Array.isArray(e)){let n=!1;const r=e.map(o=>{const i=sm(o,t);return n||(n=i!==o),i});return n?r:e}if(e&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype){let n=!1;const r={};for(const[o,i]of Object.entries(e)){const s=sm(i,t);n||(n=s!==i),r[o]=s}return n?r:e}return e}function bI(e,t){const{pipeline:n,htmlDocument:r}=t,o=()=>r.renderOnly(()=>om(n)),i=pI({refresh:o}),s=hI(document,i,o),a=n.register(i.transform),l=Z.addListener(Pe.SANDBOX_CANVAS_IMAGE_CACHE_SETUP,u=>{i.configure(u),r.renderOnly(()=>om(n))}),c=Z.setOutgoingFilter(u=>i.restoreUrls(u));return e.inject(Rs,i),{cache:i,dispose(){s.dispose(),c(),l.dispose(),a.dispose(),i.dispose(),Jt(e,Rs)}}}function yI(e,t){const n=new OA,r=new Qs,o=new PA(n,r),i=new cA(r,n,{prepareHtml:t.prepareHtml,mapHTMLRoots:e.mapHTMLRoots,...e.createRoot?{createRoot:e.createRoot}:{},...e.rootsParent?{rootsParent:e.rootsParent}:{}}),s=e.beforeCommit,a=s?i.beforeCommit(()=>s(i)):void 0;return{htmlDocument:i,remoteDocument:n,textDocument:r,documentMapping:o,onDocumentShown:l=>n.onReady(()=>l()),onDocumentReplaced:l=>n.onEntitySet(c=>l(c)),commit:l=>i.commit(l),commitLockedAsync:async l=>{try{t.lock?.increment(),await i.commit(l,!0)}finally{t.lock?.decrement()}},dispose(){a?.dispose(),i.dispose(),n.dispose(),r.dispose()}}}function vI(e,t){const n=e.getInstance(Ms),r=yI(t,{prepareHtml:D(e,Os),lock:n&&{increment:()=>n.increment("activeElementLocked"),decrement:()=>n.decrement("activeElementLocked")}}),o={commit:i=>r.commit(i),commitLockedAsync:i=>r.commitLockedAsync(i)};return e.inject(Zo,t),e.inject(mt,r.remoteDocument),e.inject(Ko,r.textDocument),e.inject(Zt,r.documentMapping),e.inject(te,r.htmlDocument),e.inject(xe,o),{...r,dispose(){r.dispose(),Jt(e,Zo),Jt(e,mt),Jt(e,Ko),Jt(e,Zt),Jt(e,te),Jt(e,xe)}}}function EI(e){e.inject(Ms,x)}var SI=class extends Ee{get isEditorInFocus(){return!!this._isEditorInFocus}constructor(e){super(),L(this,"_isEditorInFocus",!1),L(this,"_context",new Map),L(this,"_editorLostFocusEmitter",this.addDisposable(new Me)),L(this,"_summaries",[]),L(this,"_onChange",t=>{this._isEditorInFocus&&this._summaries.push(...t)}),L(this,"editorLostFocus",this._editorLostFocusEmitter.event),this.addDisposable(e.onChange(this._onChange))}setFocus(e){this._isEditorInFocus!==e&&(this._isEditorInFocus=e,e||(this._editorLostFocusEmitter.fire(this._summaries),this._summaries=[],this._context.clear()))}whenEditorLostFocusAsync(e){return new Promise(t=>this.whenEditorLostFocus(t,e))}whenEditorLostFocus(e,t){if(this._isEditorInFocus){const n=this._editorLostFocusEmitter.once(e);if(t!==void 0){const r=this._context.get(t);r&&r.dispose(),this._context.set(t,n)}}else e([])}};function wI(e,t){const{htmlDocument:n,remoteDocument:r}=t,o=new SI(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(),Jt(e,at)}};return e.inject(at,l),l}var CI={name:"sandbox.state",provides:[Ms],setup:EI},AI={name:"sandbox.attributePipeline",provides:[qr],setup:j5},TI={name:"sandbox.documentSync",provides:[te,mt,Ko,Zt,xe,Ps],awaits:{services:[Zo,Os,Ms]},setup:e=>e.inject(Ps,vI(e,D(e,Zo)))},_I={name:"sandbox.images",provides:[Rs,ac],awaits:{services:[qr,te,Ps]},setup(e){const t=D(e,qr),n=D(e,te);bI(e,{pipeline:t,htmlDocument:n});const r=J4(e,{pipeline:t,htmlDocument:n}).reload;D(e,Ps).onDocumentReplaced(()=>r.clear()),Z.addListener(Pe.SANDBOX_IMAGE_RESET,({url:o})=>{o&&(e.getInstance(Rs)?.forget(o),r.reload(o))})}},kI={name:"sandbox.mapObj",provides:[zr],awaits:{services:[Zt]},setup:e=>e.inject(zr,G4(D(e,Zt)))},LI={name:"sandbox.focus",provides:[at],awaits:{services:[te,mt]},setup:e=>wI(e,{htmlDocument:D(e,te),remoteDocument:D(e,mt)})},NI=[CI,AI,TI,_I,WT,qT,zT,kI,LI,D4,B4,H4,F4,$4,W4,q4,z4,V4,U4,rP,oP,iP,...b_],am=null,lm=0,xI=6e5;function MI(e){am=e,lm=e?Date.now():0}function RI(){const e=am,t=lm;return am=null,lm=0,!e||!t||Date.now()-t>xI||!e.isConnected||!e.matches('[em="block"]')?null:e}function OI(e,t){const n=t.getOuterHtml(e),r=document.createElement("html").appendChild(document.createElement("body"));let o;e.tagName==="TR"?o=document.createElement("table"):o=document.createElement("div"),document.querySelectorAll("style").forEach(a=>{const l=t.getOuterHtml(a);l&&o.insertAdjacentHTML("beforeend",l)}),o.insertAdjacentHTML("beforeend",`
83
- `);const i=Te(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",`
84
- `),o.prepend(document.querySelector(c).cloneNode(!0)))}}),r.append(o),by(r,[...r.querySelectorAll("style")],{forceMediaMerge:!0});let s=Vt(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 PI(e,t){const{HTMLDocument:n,messageService:r}=t,o=e.closest('[em="block"]');if(!o)return;const i=OI(o,n);if(!i)return;MI(o);const s=o.getAttribute("em-block-id"),a=o.getAttribute("em-block-version");r.send({operation:"application_eblock_add",data:ko({html:i.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function yl(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 vl(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 Ke=()=>ua(window.getSelection()?.toString())??"",II=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],DI={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:t=>window.getComputedStyle(t).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:t=>t.getAttribute(e)})},BI=/^#[\da-f]{6}$/i,e1=()=>[...new Set(II.flatMap(HI).map(X).filter(e=>BI.test(e)).map(e=>e.toUpperCase()))];function HI({type:e,name:t}){const n=DI[e],{selector:r,toColor:o}=n(t);return Array.from(document.querySelectorAll(r)).map(o)}var FI=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"],cm=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">&nbsp;</div>`;function $I(e){return!!e.closest("editor.em-text")}function t1(e){e.querySelectorAll(FI.join(",")).forEach(t=>{$I(t)||t.remove()})}function WI(e){const t=e.cloneNode(!0),n=t.querySelector("editor.em-text");if(n){t1(t);const o=n.querySelector("div");if(o)return o.outerHTML;const i=n.getAttribute("innerclass")??"",s=n.getAttribute("innerstyle")??"";return`<div${i?` class="${Nn(i)}"`:""}${s?` style="${Nn(s)}"`:""}>${n.innerHTML}</div>`}t1(t);const r=t.querySelector("div");return r?r.outerHTML:t.innerHTML}function Nn(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function cn(e){if(!e)return;const t=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}function es(e){if(!e)return;const t=e.trim().split(/\s+/);if(t.length<3)return;const n=cn(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 qI(e){const t=e.get("padding"),n=e.get("padding-top"),r=e.get("padding-right"),o=e.get("padding-bottom"),i=e.get("padding-left"),s={};if(t){const d=t.trim().split(/\s+/),m=cn(d[0]),p=cn(d[1]??d[0]),f=cn(d[2]??d[0]),h=cn(d[3]??d[1]??d[0]);m!==void 0&&(s.top=m),p!==void 0&&(s.right=p),f!==void 0&&(s.bottom=f),h!==void 0&&(s.left=h)}const a=cn(n??""),l=cn(r??""),c=cn(o??""),u=cn(i??"");return a!==void 0&&(s.top=a),l!==void 0&&(s.right=l),c!==void 0&&(s.bottom=c),u!==void 0&&(s.left=u),Object.keys(s).length?s:void 0}function n1(e){if(e)return e.trim()}function zI(e){if(!e)return;const t=e.trim().toLowerCase();return["left","center","right","justify"].includes(t)?t:void 0}function VI(e){if(!e)return;const t=e.trim().toLowerCase();if(t==="top"||t==="text-top")return"top";if(t==="bottom"||t==="text-bottom")return"bottom";if(t==="middle")return"middle"}function UI(e){const t=new Map;return e&&e.split(";").forEach(n=>{const[r,...o]=n.split(":");if(!r||o.length===0)return;const i=r.trim().toLowerCase(),s=o.join(":").trim();i&&t.set(i,s)}),t}function jI(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 GI(e){const t=UI(e.getAttribute("style")),n=t.get("font-family")??void 0,r=cn(t.get("font-size")??""),o=cn(t.get("line-height")??""),i=n1(t.get("color")??void 0),s=n1(t.get("background-color")??void 0),a=zI(t.get("text-align")??void 0),l=VI(t.get("vertical-align")??void 0),c={top:es(t.get("border-top")),right:es(t.get("border-right")),bottom:es(t.get("border-bottom")),left:es(t.get("border-left"))},u=es(t.get("border"));u&&(c.top=c.top??u,c.right=c.right??u,c.bottom=c.bottom??u,c.left=c.left??u);const d=qI(t),m=jI(t.get("border-radius")??void 0),p={};return n&&(p.fontFamily=n),r!==void 0&&(p.fontSize=r),o!==void 0&&(p.lineHeight=o),i&&(p.color=i),s&&(p.backgroundColor=s),a&&(p.textAlign=a),l&&(p.verticalAlign=l),d&&(p.padding=d),m&&(p.borderRadius=m),(c.top||c.right||c.bottom||c.left)&&(p.borders=c),Object.keys(p).length?p:void 0}function XI(e){const t=e.getAttribute("align")?.toLowerCase();if(t==="left"||t==="center"||t==="right")return t}function YI(e){const t=e.getAttribute("valign")?.toLowerCase();if(t==="top"||t==="middle"||t==="bottom")return t}function um(e){if(e==null)return;const t=Number(e);return Number.isFinite(t)?t:void 0}function ts(e){const t=Array.from(e.classList),n={};Array.from(e.attributes).forEach(c=>{const u=c.name.toLowerCase();u!=="class"&&(n[u]=c.value)});const r={width:e.getAttribute("width")??void 0,cellpadding:um(e.getAttribute("cellpadding")),cellspacing:um(e.getAttribute("cellspacing")),border:um(e.getAttribute("border")),classList:t.length?t:void 0,attrs:Object.keys(n).length?n:void 0},o=[],i=[];let s=0;const a=Array.from(e.querySelectorAll(":scope > tr, :scope > tbody > tr, :scope > thead > tr, :scope > tfoot > tr")).filter(c=>c.querySelectorAll("td, th").length!==0);a.forEach(c=>{let u=0;Array.from(c.querySelectorAll("td, th")).forEach(d=>{const m=Math.max(1,d.colSpan||1);u+=m}),u>s&&(s=u)});let l=0;for(const c of a){i[l]||(i[l]=Array(s).fill(null));let u=0;const d=Array.from(c.querySelectorAll("td, th"));for(const m of d){for(;u<s&&i[l][u]!==null&&i[l][u]!==void 0;)u++;if(u>=s)continue;const p=Math.max(1,m.colSpan||1),f=Math.max(1,m.rowSpan||1),h=Math.min(f,a.length-l),y=`cell-${o.length}`,v=Array.from(m.classList),A=WI(m),k=XI(m),S=YI(m),b=GI(m),E={id:y,row:l,col:u,rowspan:h,colspan:p,contentHtml:A,classList:v,align:k,valign:S,style:b};o.push(E);for(let C=0;C<h;C++){const g=l+C;i[g]||(i[g]=Array(s).fill(null));for(let w=0;w<p;w++){const T=u+w;T>=s||i[g][T]!==null&&i[g][T]!==void 0||(i[g][T]=y)}}u+=p}l++}for(let c=0;c<i.length;c++)for(let u=0;u<s;u++)(i[c][u]===null||i[c][u]===void 0)&&(i[c][u]=null);new Set(i.flat().filter(c=>c!==null)),new Set(o.map(c=>c.id));for(const c of o)for(let u=c.row;u<c.row+c.rowspan;u++)for(let d=c.col;d<c.col+c.colspan;d++)i[u]&&(i[u][d],c.id);return{rows:i.length,cols:s,cells:o,grid:i,meta:r}}function r1(e,t,n){const r=JSON.parse(JSON.stringify(e));let o=-1;const i=typeof t=="string"?t.trim():"";if(i){for(const p of r.cells)if(Array.isArray(p.classList)&&p.classList.includes(i)){o=p.row;break}}o===-1&&(r.rows===0?(o=0,n=!0):(o=r.rows-1,n=!1));const s=r.cells.filter(p=>p.row===o).sort((p,f)=>p.col-f.col),a=r.cells.length===0;if(s.length===0)if(a)s.push({id:"cell-0",row:0,col:0,rowspan:1,colspan:1,contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}}),r.cols=1;else for(let p=0;p<r.cols;p++)s.push({id:`template-${p}`,row:o,col:p,rowspan:1,colspan:1,contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}});let l=1;for(const p of s)p.rowspan>l&&(l=p.rowspan);let c=n?o:o+l;const u=new Array(r.cols).fill(!1);for(const p of r.cells)if(p.row<c&&p.row+p.rowspan>c)for(let f=p.col;f<p.col+p.colspan;f++)u[f]=!0;for(const p of r.cells)p.row>=c&&(p.row+=1);const d=[];let m=r.cells.length;for(let p=0;p<r.cols;p++){if(u[p])continue;const f=s.find(y=>y.col<=p&&p<y.col+y.colspan)||s[0]||{contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}},h=JSON.parse(JSON.stringify(f));h.id=`cell-${m++}`,h.contentHtml=El(f.contentHtml," "),h.classList=h.classList.filter(y=>y!==i),h.row=c,h.col=p,h.rowspan=1,h.colspan=1,d.push(h)}r.cells.push(...d),r.rows+=1,r.grid.splice(c,0,new Array(r.cols).fill(null));for(let p=0;p<r.rows;p++)for(let f=0;f<r.cols;f++){const h=r.cells.find(y=>y.row<=p&&y.row+y.rowspan>p&&y.col<=f&&y.col+y.colspan>f);r.grid[p][f]=h?h.id:null}for(let p=0;p<r.cols;p++)r.grid[c][p]===null&&u[p];return r}function KI(e){if(!e)return"";const t=[];if(e.fontFamily&&t.push(`font-family: ${e.fontFamily}`),e.fontSize!==void 0&&t.push(`font-size: ${e.fontSize}px`),e.lineHeight!==void 0&&t.push(`line-height: ${e.lineHeight}px`),e.color&&t.push(`color: ${e.color}`),e.backgroundColor&&t.push(`background-color: ${e.backgroundColor}`),e.textAlign&&t.push(`text-align: ${e.textAlign}`),e.verticalAlign&&t.push(`vertical-align: ${e.verticalAlign}`),e.borderRadius&&t.push(`border-radius: ${e.borderRadius}`),e.padding){const n=e.padding;n.top!==void 0&&n.right!==void 0&&n.bottom!==void 0&&n.left!==void 0&&n.top===n.right&&n.right===n.bottom&&n.bottom===n.left?t.push(`padding: ${n.top}px`):(n.top!==void 0&&t.push(`padding-top: ${n.top}px`),n.right!==void 0&&t.push(`padding-right: ${n.right}px`),n.bottom!==void 0&&t.push(`padding-bottom: ${n.bottom}px`),n.left!==void 0&&t.push(`padding-left: ${n.left}px`))}if(e.borders){const n=e.borders;n.border?t.push(`border: ${n.border.width}px ${n.border.style} ${n.border.color}`):(n.top&&t.push(`border-top: ${n.top.width}px ${n.top.style} ${n.top.color}`),n.right&&t.push(`border-right: ${n.right.width}px ${n.right.style} ${n.right.color}`),n.bottom&&t.push(`border-bottom: ${n.bottom.width}px ${n.bottom.style} ${n.bottom.color}`),n.left&&t.push(`border-left: ${n.left.width}px ${n.left.style} ${n.left.color}`))}return t.length?t.join("; "):""}function It(e){if(e.rows===0||e.cols===0||!e.cells.length)return"<table></table>";const t=[];if(e.meta&&(e.meta.width&&t.push(`width="${Nn(e.meta.width)}"`),e.meta.cellpadding!==void 0&&t.push(`cellpadding="${e.meta.cellpadding}"`),e.meta.cellspacing!==void 0&&t.push(`cellspacing="${e.meta.cellspacing}"`),e.meta.border!==void 0&&t.push(`border="${e.meta.border}"`),e.meta.classList?.length&&t.push(`class="${Nn(e.meta.classList.join(" "))}"`),e.meta.attrs))for(const[o,i]of Object.entries(e.meta.attrs))t.push(`${Nn(o)}="${Nn(i)}"`);const n=new Map;for(const o of e.cells)n.set(o.id,o);const r=[];for(let o=0;o<e.rows;o++){const i=[];for(let s=0;s<e.cols;s++){const a=e.grid[o][s];if(!a)continue;const l=n.get(a);if(!l||l.row!==o||l.col!==s)continue;const c=[];l.rowspan>1&&c.push(`rowspan="${l.rowspan}"`),l.colspan>1&&c.push(`colspan="${l.colspan}"`),l.align&&c.push(`align="${Nn(l.align)}"`),l.valign&&c.push(`valign="${Nn(l.valign)}"`),l.classList?.length&&c.push(`class="${Nn(l.classList.join(" "))}"`);const u=KI(l.style);u&&c.push(`style="${Nn(u)}"`),i.push(`<td${c.length?" "+c.join(" "):""}>${l.contentHtml}</td>`)}i.length&&r.push(`<tr>${i.join("")}</tr>`)}return`<table${t.length?" "+t.join(" "):""}>${r.join("")}</table>`}function ZI(e,t){const n=JSON.parse(JSON.stringify(e));let r=-1;const o=typeof t=="string"?t.trim():"";if(o){for(const i of n.cells)if(Array.isArray(i.classList)&&i.classList.includes(o)){r=i.row;break}}if(r===-1||n.rows<=1||n.cells.filter(i=>i.row===r).some(i=>i.rowspan>1))return n;n.cells=n.cells.filter(i=>i.row!==r);for(const i of n.cells)i.row>r&&(i.row-=1);return n.grid.splice(r,1),n.rows-=1,n}function El(e,t){if(typeof e!="string"||typeof t!="string")return e;const n=new DOMParser().parseFromString(e,"text/html").body.firstChild;if(!n)return e;let r=!1;function o(a){if(a.nodeType===Node.TEXT_NODE&&a.textContent?.trim()){r?a.textContent="":(a.textContent=t,r=!0);return}for(const l of Array.from(a.childNodes))o(l)}function i(a){if(a.nodeType===Node.TEXT_NODE){const l=a.textContent||"";return!l||/^\s*$/.test(l.replace(/\u00A0/g,"X"))}return a.nodeType!==Node.ELEMENT_NODE?!0:Array.from(a.childNodes).every(l=>i(l))}function s(a,l=!1){if(a.nodeType!==Node.ELEMENT_NODE)return;const c=Array.from(a.childNodes);for(const u of c)s(u);!l&&i(a)&&a.parentNode?.removeChild(a)}return o(n),s(n,!0),n.outerHTML||e}function o1(e,t,n){const r=JSON.parse(JSON.stringify(e));let o;const i=typeof t=="string"?t.trim():"";if(i){for(const u of r.cells)if(Array.isArray(u.classList)&&u.classList.includes(i)){o=u;break}}if(!o)return r;const s=o.col;let a=n?s:s+o.colspan;const l=[];let c=r.cells.length;for(let u=0;u<r.rows;u++){const d=JSON.parse(JSON.stringify(o));d.id=`cell-${c++}`,d.contentHtml=El(o.contentHtml," "),d.row=u,d.col=a,d.rowspan=1,d.colspan=1,d.classList=o.classList.filter(m=>m!==i),l.push(d)}for(const u of r.cells)u.col>=a&&(u.col+=1);r.cells.push(...l),r.cols+=1;for(let u=0;u<r.rows;u++)r.grid[u].splice(a,0,null),r.grid[u][a]=l[u].id;return r}function QI(e,t){const n=JSON.parse(JSON.stringify(e));let r;const o=typeof t=="string"?t.trim():"";if(o){for(const s of n.cells)if(Array.isArray(s.classList)&&s.classList.includes(o)){r=s;break}}if(!r)return n;const i=r.col;if(n.cols<=1||n.cells.filter(s=>s.col===i).some(s=>s.colspan>1))return n;n.cells=n.cells.filter(s=>s.col!==i);for(const s of n.cells)s.col>i&&(s.col-=1);for(let s=0;s<n.rows;s++)n.grid[s].splice(i,1);return n.cols-=1,n}function i1(e,t,n,r=1){const o=JSON.parse(JSON.stringify(e));if(r<=0)return o;let i;const s=typeof t=="string"?t.trim():"";if(s){for(const A of o.cells)if(Array.isArray(A.classList)&&A.classList.includes(s)){i=A;break}}if(!i)return o;const a=i.row,l=i.col,c=i.colspan,u=i.rowspan,d=[];if(n)for(let A=1;A<=r;A++)d.push(l-A);else for(let A=0;A<r;A++)d.push(l+c+A);for(const A of d)if(A<0||A>=o.cols)return o;const m=[];for(const A of d){const k=o.cells.find(S=>S.row===a&&S.col<=A&&A<S.col+S.colspan);if(!k)return o;m.push(k)}const p=Array.from(new Set(m));for(const A of p)if(A.rowspan!==u)return o;const f=c+p.reduce((A,k)=>A+k.colspan,0);let h=(n?[...p.reverse(),i]:[i,...p]).map(A=>{const k=new DOMParser().parseFromString(A.contentHtml,"text/html").body.firstChild,S=k?k.innerHTML:"";return S===""||/^\s*(&nbsp;)*\s*$/.test(S)?"":S}).filter(A=>A!=="").join("<br>");(h===""||/^\s*(&nbsp;|<br>)*\s*$/.test(h))&&(h="&nbsp;");const y=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;y?(y.innerHTML=h,i.contentHtml=y.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${h}</div>`,i.colspan=f,n&&d.length>0&&(i.col=Math.min(...d)),o.cells=o.cells.filter(A=>!p.includes(A));const v=n&&d.length>0?Math.min(...d):l;for(let A=v;A<v+f;A++)o.grid[a][A]=i.id;return o}function s1(e,t,n,r=1){const o=JSON.parse(JSON.stringify(e));if(r<=0)return o;let i;const s=typeof t=="string"?t.trim():"";if(s){for(const A of o.cells)if(Array.isArray(A.classList)&&A.classList.includes(s)){i=A;break}}if(!i)return o;const a=i.row,l=i.col,c=i.rowspan,u=i.colspan,d=[];if(n)for(let A=1;A<=r;A++)d.push(a-A);else for(let A=0;A<r;A++)d.push(a+c+A);for(const A of d)if(A<0||A>=o.rows)return o;const m=[];for(const A of d){const k=o.cells.find(S=>S.col===l&&S.row<=A&&A<S.row+S.rowspan);if(!k)return o;m.push(k)}const p=Array.from(new Set(m));for(const A of p)if(A.colspan!==u)return o;const f=c+p.reduce((A,k)=>A+k.rowspan,0);let h=(n?[...p.reverse(),i]:[i,...p]).map(A=>{const k=new DOMParser().parseFromString(A.contentHtml,"text/html").body.firstChild,S=k?k.innerHTML:"";return S===""||/^\s*(&nbsp;)*\s*$/.test(S)?"":S}).filter(A=>A!=="").join("<br>");h=h.replace(/&nbsp;$/g,""),(h===""||/^\s*(&nbsp;|<br>)*\s*$/.test(h))&&(h="&nbsp;");const y=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;y?(y.innerHTML=h,i.contentHtml=y.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${h}</div>`,i.rowspan=f,n&&d.length>0&&(i.row=Math.min(...d)),o.cells=o.cells.filter(A=>!p.includes(A));const v=n&&d.length>0?Math.min(...d):a;for(let A=v;A<v+f&&A<o.rows;A++)o.grid[A][l]=i.id;return o}function JI(e,t,n=1){const r=JSON.parse(JSON.stringify(e)),o=typeof t=="string"?t.trim():"";if(!o)return r;const i=r.cells.find(a=>Array.isArray(a.classList)&&a.classList.includes(o));if(!i||i.colspan<=1||n>=i.colspan)return r;i.colspan-=n;const s={id:`cell-${r.cells.length}`,row:i.row,col:i.col+i.colspan,colspan:n,rowspan:i.rowspan,contentHtml:El(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};r.cells.push(s);for(let a=0;a<r.rows;a++)for(let l=0;l<r.cols;l++){const c=r.cells.find(u=>u.row<=a&&u.row+u.rowspan>a&&u.col<=l&&u.col+u.colspan>l);r.grid[a][l]=c?c.id:null}return r}function eD(e,t,n=1){const r=JSON.parse(JSON.stringify(e)),o=typeof t=="string"?t.trim():"";if(!o)return r;const i=r.cells.find(a=>Array.isArray(a.classList)&&a.classList.includes(o));if(!i||i.rowspan<=1||n>=i.rowspan)return r;i.rowspan-=n;const s={id:`cell-${r.cells.length}`,row:i.row+i.rowspan,col:i.col,rowspan:n,colspan:i.colspan,contentHtml:El(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};r.cells.push(s);for(let a=0;a<r.rows;a++)for(let l=0;l<r.cols;l++){const c=r.cells.find(u=>u.row<=a&&u.row+u.rowspan>a&&u.col<=l&&u.col+u.colspan>l);r.grid[a][l]=c?c.id:null}for(let a=s.row;a<s.row+s.rowspan;a++)for(let l=s.col;l<s.col+s.colspan;l++)r.grid[a][l];return r}function dm(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return null;const r=e.cells.find(o=>Array.isArray(o.classList)&&o.classList.includes(n));return r?{row:r.row,col:r.col}:null}function a1(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return{row:null,col:null,isOverlapped:!1};const r=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(n));if(!r)return{row:null,col:null,isOverlapped:!1};const o=r.row;if(o<0||o>=e.rows)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.rowspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(n))&&i.row<=o&&o<i.row+i.rowspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function l1(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return{row:null,col:null,isOverlapped:!1};const r=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(n));if(!r)return{row:null,col:null,isOverlapped:!1};const o=r.col;if(o<0||o>=e.cols)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.colspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(n))&&i.col<=o&&o<i.col+i.colspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function c1(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=r.cells.find(c=>c.classList?.includes(t));if(!o)return r;const i=r.cells.filter(c=>c.classList?.includes(n)&&c.id!==o.id);let s=o.colspan||1;i.forEach(c=>{const u=c.colspan||1;s+=u,c.colspan=1}),o.colspan=s;const a=c=>{const u=c.match(/<div[^>]*>(.*?)<\/div>/);return u?u[1].replace(/&nbsp;/g,"").trim():""};o.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[a(o.contentHtml),...i.sort((c,u)=>c.col-u.col).map(c=>a(c.contentHtml)).filter(c=>c.length>0)].filter(c=>c.length>0).join("<br>")}</div>`;const l=new Set(i.map(c=>c.id));return r.cells.forEach(c=>{if(c.row===o.row&&c.col>o.col&&!l.has(c.id)){let u=0;i.forEach(d=>{d.row===c.row&&d.col<c.col&&(u+=(d.colspan||1)-1)}),c.col-=u}}),r.grid=r.grid.map((c,u)=>{const d=new Array(r.cols).fill(null);return r.cells.filter(m=>{const p=m.row,f=m.row+(m.rowspan||1)-1;return p<=u&&u<=f&&!l.has(m.id)}).sort((m,p)=>m.col-p.col).forEach(m=>{const p=m.id,f=m.colspan||1,h=m.col;for(let y=0;y<f&&h+y<r.cols;y++)d[h+y]=p}),d}),r}function u1(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=r.cells.find(u=>u.classList?.includes(t));if(!o)return r;const i=r.cells.filter(u=>u.classList?.includes(n)&&u.id!==o.id&&u.col===o.col);let s=o.rowspan||1;i.forEach(u=>{const d=u.rowspan||1;s+=d,u.rowspan=1}),o.rowspan=s;const a=u=>{const d=u.match(/<div[^>]*>(.*?)<\/div>/);return d?d[1].replace(/&nbsp;/g,"").trim():""};o.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[a(o.contentHtml),...i.sort((u,d)=>u.row-d.row).map(u=>a(u.contentHtml)).filter(u=>u.length>0)].filter(u=>u.length>0).join("<br>")}</div>`;const l=i.length>0?Math.min(...i.map(u=>u.row)):o.row;l<o.row&&(o.row=l);const c=new Set(i.map(u=>u.id));return r.cells.forEach(u=>{if(u.col===o.col&&u.id!==o.id&&!c.has(u.id)){let d=0;i.forEach(m=>{m.col===u.col&&m.row<=u.row&&(d+=(m.rowspan||1)-1)}),d>0&&(u.row-=d)}}),r.grid=r.grid.map((u,d)=>{const m=new Array(r.cols).fill(null);return r.cells.filter(p=>{const f=p.row,h=p.row+(p.rowspan||1)-1;return f<=d&&d<=h&&!c.has(p.id)}).sort((p,f)=>p.col-f.col).forEach(p=>{const f=p.col,h=p.colspan||1;for(let y=0;y<h&&f+y<r.cols;y++)m[f+y]=p.id}),m}),r}function Sl(e,t,n,r,o,i=!0){const{cells:s,grid:a}=e;function l(p,f){if(!a[p]||!a[p][f])return null;const h=a[p][f];return s.find(y=>y.id===h)}function c(p,f){const h=l(p,f);return h?{row:h.row,col:h.col,cell:h}:null}const u=c(t,n),d=c(r,o);if(!u||!d||u.cell.id===d.cell.id)return 0;function m(p,f,h,y){let v=0;const A=p<f?1:-1,k=new Set;for(let b=p;b!==f;b+=A){const E=l(y?h:b,y?b:h);E&&!k.has(E.id)&&(k.add(E.id),v++)}const S=l(y?h:f,y?f:h);return S&&!k.has(S.id)&&v++,v}return i?u.row===d.row?m(n,o,t,!0)-1:0:u.col===d.col?m(t,r,n,!1)-1:0}function tD(e,t){if(!t.settings)return e;const n=Object.keys(t.settings);if(n.length===0)return e;const r=["paddingLeftRight","paddingTopBottom","paddingLeft","paddingTop","paddingRight","paddingBottom"],o=n[0];if(!r.includes(o))return e;const i=t.settings[o];return typeof i!="number"||isNaN(i)||!e.cells||!Array.isArray(e.cells)||e.cells.forEach((s,a)=>{switch(s.id,s.style||(s.style={}),s.style.padding||(s.style.padding={top:0,right:0,bottom:0,left:0}),o){case"paddingLeftRight":s.style.padding.left=i,s.style.padding.right=i;break;case"paddingTopBottom":s.style.padding.top=i,s.style.padding.bottom=i;break;case"paddingLeft":s.style.padding.left=i;break;case"paddingTop":s.style.padding.top=i;break;case"paddingRight":s.style.padding.right=i;break;case"paddingBottom":s.style.padding.bottom=i}s.style.padding.top===0&&s.style.padding.right===0&&s.style.padding.bottom===0&&s.style.padding.left===0&&delete s.style.padding,Object.keys(s.style).length===0&&delete s.style}),e}function nD(e,t){const{backgroundPositionX:n,backgroundPositionY:r}=t.settings;if(n===void 0&&r===void 0)return e;const o=e.replace(/\s*;\s*/g,";").replace(/([^;])$/,"$1;").trim().split(";").filter(a=>a.trim());let i=!1;const s=o.map(a=>{const[l,c]=a.split(":").map(u=>u.trim());if(l==="background-position"){i=!0;const u=c.split(/\s+/).filter(p=>p.trim());let d=u[0],m=u[1]||u[0];return n!==void 0&&(d=`${n}px`),r!==void 0&&(m=`${r}px`),`background-position: ${d} ${m}`}return l==="background-position-x"&&n!==void 0?`background-position-x: ${n}px`:l==="background-position-y"&&r!==void 0?`background-position-y: ${r}px`:a});if(!i&&(n!==void 0||r!==void 0)){const a=n!==void 0?`${n}px`:"center",l=r!==void 0?`${r}px`:"center";s.push(`background-position: ${a} ${l}`)}return s.join("; ")}function rD(e){const t={};if(!e)return t;const n=e.split(";").map(r=>r.trim()).filter(r=>r.length>0);for(const r of n){const o=r.indexOf(":");if(o===-1)continue;const i=r.slice(0,o).trim(),s=r.slice(o+1).trim();if(!(!i||!s))switch(i.toLowerCase()){case"background-image":const a=s.match(/url\(['"]?(.+?)['"]?\)/i);a&&a[1]&&(t.backgroundImage=a[1]);break;case"background-size":t.backgroundSize=s;break;case"background-repeat":t.backgroundRepeat=s;break;case"background-position":const l=s.split(/\s+/).filter(c=>c.length>0);l.length>=1&&(t.backgroundPositionX=l[0]),l.length>=2&&(t.backgroundPositionY=l[1])}}return t}function oD(e,t){const n=[];for(const r of e.cells)t.some(o=>r.classList.includes(o))&&n.push(r.id);return n}function iD(e,t,n){const r={...e,cells:e.cells.map(o=>({...o,style:o.style?{...o.style}:void 0}))};for(const o of r.cells)t.includes(o.id)&&(o.style||(o.style={}),o.style.backgroundColor=n);return r}function sD(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 aD(e,t,n,r){const o={width:1,style:"solid",color:"#b9b1b1"},i={...e,cells:e.cells.map(s=>{const a={...s};return a.style&&(a.style={...a.style},a.style.borders&&(a.style.borders={...a.style.borders})),a})};for(const s of i.cells)if(t.includes(s.id)){s.style||(s.style={}),s.style.borders||(s.style.borders={});for(const a of n){const l=s.style.borders[a];l?s.style.borders[a]={...l,...r}:s.style.borders[a]={...o,...r}}}return i}function lD(e,t){const n=new Map(e.cells.map(u=>[u.id,u])),r=new Set,o=[];for(const u of t){const d=n.get(u);if(d)for(let m=0;m<d.rowspan;m++)for(let p=0;p<d.colspan;p++){const f=d.row+m,h=d.col+p,y=`${f}-${h}`;r.has(y)||(r.add(y),o.push({row:f,col:h,id:u}))}}const i=new Set(o.map(u=>u.row)),s=new Set(o.map(u=>u.col));let a=!1;if(i.size===1&&s.size===o.length)a=!0;else if(!(s.size===1&&i.size===o.length))return{};a?o.sort((u,d)=>u.col-d.col):o.sort((u,d)=>u.row-d.row);const l=new Map;for(const u of o)l.has(u.id)||l.set(u.id,[]),l.get(u.id).push({row:u.row,col:u.col});l.forEach((u,d)=>{const m=n.get(d);if(m.rowspan>1||m.colspan>1){const p=a?(f,h)=>f.col-h.col:(f,h)=>f.row-h.row;u.sort(p)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],m=d.id,p=n.get(m);let f=m;if(p.rowspan>1||p.colspan>1){const y=l.get(m).findIndex(v=>v.row===d.row&&v.col===d.col);y>0&&(f=`${m}-uni-${y+1}`)}const h=[];a?(h.push("top","bottom"),(u===0||o[u-1].col!==d.col-1)&&h.push("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&h.push("right")):(h.push("left","right"),(u===0||o[u-1].row!==d.row-1)&&h.push("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&h.push("bottom")),c[f]=h}return c}function cD(e,t,n,r){const o={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3},i={...e,cells:e.cells.map(s=>{const a={...s};return a.style&&(a.style={...a.style}),a})};for(const s of i.cells)if(t.includes(s.id)){s.style||(s.style={});let a=(s.style.borderRadius||"0px 0px 0px 0px").split(" ").map(l=>parseInt(l.replace("px",""),10));for(const l of n){const c=o[l];c!==void 0&&(a[c]=r)}a.every(l=>l===0)?delete s.style.borderRadius:s.style.borderRadius=a.map(l=>`${l}px`).join(" ")}return i}function uD(e,t){const n=new Map(e.cells.map(u=>[u.id,u])),r=new Set,o=[];for(const u of t){const d=n.get(u);if(d)for(let m=0;m<d.rowspan;m++)for(let p=0;p<d.colspan;p++){const f=d.row+m,h=d.col+p,y=`${f}-${h}`;r.has(y)||(r.add(y),o.push({row:f,col:h,id:u}))}}const i=new Set(o.map(u=>u.row)),s=new Set(o.map(u=>u.col));let a=!1;if(i.size===1&&s.size===o.length)a=!0;else if(!(s.size===1&&i.size===o.length))return{};a?o.sort((u,d)=>u.col-d.col):o.sort((u,d)=>u.row-d.row);const l=new Map;for(const u of o)l.has(u.id)||l.set(u.id,[]),l.get(u.id).push({row:u.row,col:u.col});l.forEach((u,d)=>{const m=n.get(d);if(m.rowspan>1||m.colspan>1){const p=a?(f,h)=>f.col-h.col:(f,h)=>f.row-h.row;u.sort(p)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],m=d.id,p=n.get(m);let f=m;if(p.rowspan>1||p.colspan>1){const v=l.get(m).findIndex(A=>A.row===d.row&&A.col===d.col);v>0&&(f=`${m}-uni-${v+1}`)}const h=new Set;a?(h.add("top"),h.add("bottom"),(u===0||o[u-1].col!==d.col-1)&&h.add("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&h.add("right")):(h.add("left"),h.add("right"),(u===0||o[u-1].row!==d.row-1)&&h.add("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&h.add("bottom"));const y=[];h.has("top")&&h.has("left")&&y.push("topLeft"),h.has("top")&&h.has("right")&&y.push("topRight"),h.has("bottom")&&h.has("left")&&y.push("bottomLeft"),h.has("bottom")&&h.has("right")&&y.push("bottomRight"),y.length>0&&(c[f]=y)}return c}function dD(e,t,n,r){const o={...e,cells:e.cells.map(i=>{const s={...i};return s.style&&(s.style={...s.style},s.style.padding&&(s.style.padding={...s.style.padding})),s})};for(const i of o.cells)if(t.includes(i.id)){i.style||(i.style={}),i.style.padding||(i.style.padding={top:0,right:0,bottom:0,left:0});for(const s of n){const a=s;i.style.padding[a]=r}["top","right","bottom","left"].forEach(s=>{i.style?.padding&&i.style.padding[s]===0&&delete i.style.padding[s]}),i.style.padding&&Object.keys(i.style.padding).length===0&&delete i.style.padding}return o}function mD(e,t){const n=new RegExp(`\\b${t}\\s*:[^;]*(;\\s*)?`,"gi");return e.replace(n,"").trim().replace(/\s*;\s*(?=;|$)/g,"").trim()}function fD(e){const t=e.match(/border-radius:\s*([^;]+)/);if(!t)return{full:null,first:null,firstNumber:null};const n=t[1].trim(),r=n.split(/\s+/)[0],o=parseInt(r),i=n.split(/\s+/)[1],s=parseInt(i),a=n.split(/\s+/)[2],l=parseInt(a),c=n.split(/\s+/)[3];return{full:n,first:r,firstNumber:o,second:i,secondNumber:s,third:a,thirdNumber:l,fourth:c,fourthNumber:parseInt(c)}}function pD(e,t,n){const r=/border-radius:\s*([^;]+)/,o=e.match(r);if(!o)return e+` border-radius: ${d1("0 0 0 0",t,n)};`;const i=d1(o[1].trim(),t,n);return e.replace(r,`border-radius: ${i}`)}function d1(e,t,n){const r=typeof n=="number"&&!isNaN(n)?Math.max(0,n):0;let o=e.split(/\s+/).filter(a=>a.trim()!=="").map(a=>{const l=parseFloat(a);return isNaN(l)?0:Math.max(0,l)}),i;if(o.length===0)i=[0,0,0,0];else if(o.length===1)i=[o[0],o[0],o[0],o[0]];else if(o.length===2)i=[o[0],o[1],o[0],o[1]];else if(o.length===3)i=[o[0],o[1],o[2],o[1]];else{const a=o.slice(0,4);i=[a[0]??0,a[1]??0,a[2]??0,a[3]??0]}const s={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3}[t];return s!==void 0&&(i[s]=r),i.map(a=>a===0?"0":`${a}px`).join(" ")}function hD(e){const t=JSON.parse(JSON.stringify(e)),n=t.rows,r=t.cols;return t.cells.forEach(o=>{const i=o.row===0,s=o.row+o.rowspan===n,a=o.col===0,l=o.col+o.colspan===r;i&&delete o.style.borders.top,s&&delete o.style.borders.bottom,a&&delete o.style.borders.left,l&&delete o.style.borders.right}),t}function gD(e){const t=JSON.parse(JSON.stringify(e));return t.cells.forEach(n=>{if(n.style?.borders?.top&&n.style?.borders?.bottom&&n.style?.borders?.left&&n.style?.borders?.right){const r=n.style.borders.top,o=n.style.borders.bottom,i=n.style.borders.left,s=n.style.borders.right;r?.width===o?.width&&r?.width===i?.width&&r?.width===s?.width&&r?.style===o?.style&&r?.style===i?.style&&r?.style===s?.style&&r?.color===o?.color&&r?.color===i?.color&&r?.color===s?.color&&(n.style.borders={border:{width:r.width,style:r.style,color:r.color}})}}),t}function bD(e,t){return typeof e!="string"&&(e=String(e||"")),typeof t!="string"&&(t=String(t||"")),e.split(" ").filter(n=>n&&!n.startsWith(t)).join(" ").trim()}function yD(e){const t={},n={};return Object.keys(e).forEach(r=>{const o=r.indexOf("-uni-");if(o===-1){const i=r;t[i]=[...e[r]],n[i]=new Set(e[r])}else{const i=r.substring(0,o);n[i]||(n[i]=new Set),e[r].forEach(s=>{n[i].add(s)}),e.hasOwnProperty(i)&&!t.hasOwnProperty(i)&&(t[i]=[...e[i]],e[i].forEach(s=>n[i].add(s)))}}),Object.keys(n).forEach(r=>{const o=r;t[o]||(t[o]=[]),t[o]=Array.from(n[o])}),t}var Yq="#1C52DC",Kq="#1C52DC",Zq="#1C52DC",wl="none",m1="b64_",vD=/^(\d+(?:_\d+)?)(px|perc)$/;function ED(e){if(e===wl)return wl;let t="";return new TextEncoder().encode(za(e)).forEach(n=>{t+=String.fromCharCode(n)}),m1+btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function SD(e){if(e===wl)return wl;if(!e.startsWith(m1))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 wD(e){return`url("${e.replace(/[\n\r\f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function f1(e){return e.replace(/\./g,"_").replace(/%/g,"perc")}function p1(e){const t=e.match(vD);return t?t[1].replace("_",".")+(t[2]==="perc"?"%":"px"):e}function CD(){return Hd()}function Ie(e,t){const n=CD();n&&n.insertAdjacentHTML("beforeend",`
85
- ${HP()}
86
- .${e} { ${t} }
87
- }
88
- `)}function ge(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function h1(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,ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim)Ie(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";Ie(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${r} !important;`)}}else ge(e.elem,t.classNamePrefix)}function AD(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,ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim?Ie(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`):Ie(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${t.value}${t.dim} !important;`)}else ge(e.elem,t.classNamePrefix)}function Bo(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,ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim?Ie(n,`height: ${t.value}${t.dim} !important;`):Ie(n,`height: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function TD(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; `:""),Ie(a,l)}})}function _D(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(),Ie(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)))&&ge(e.elem,"em-mob-border_radius_all-")}else e.elem.classList.forEach(s=>{s.indexOf(r)>-1&&e.elem.classList.remove(s)})}function kD(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":"");ge(e.elem,n),e.elem.classList.add(c),$e(),Ie(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,"-");ge(e.elem,t.classNamePrefix||"em-mob-boxshadow_"),e.elem.classList.add(r),$e(),Ie(r,`box-shadow: ${t.value} !important;`)}else ge(e.elem,n)}function g1(e){const t=e.fieldName??"mobileAlign",n=e.settings[t];if(n.value){const r=n.classNamePrefix+n.value;ge(e.elem,n.classNamePrefix),e.elem.classList.add(r),$e(),Ie(r,`text-align: ${n.value} !important;`)}else ge(e.elem,n.classNamePrefix)}function LD(e){const t=e.settings.mobileAlign;if(t.value){const n=t.classNamePrefix+t.value;ge(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",Ie(n,`${r} !important;`)}else ge(e.elem,t.classNamePrefix)}function b1(e){const t=e.settings.mobileVerticalAlign;if(t.value){const n=t.classNamePrefix+t.value;ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`vertical-align: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function ND(e){const t=e.settings.mobileDirection;if(t.value){const n=t.classNamePrefix+t.value;ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`direction: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function xD(e){const t=e.settings.mobileBackgroundColor;if(t.value){const n=t.value!=="none"?String(t.value).substring(1):"none",r=t.classNamePrefix+n;ge(e.elem,t.classNamePrefix),e.elem.classList.add(r),$e(),Ie(r,`background-color: ${t.value!=="none"?t.value:"transparent"} !important;`)}else ge(e.elem,t.classNamePrefix)}function MD(e){const t=e.settings.mobileBackgroundImage[0];if(t.value){const n=String(t.value),r=t.classNamePrefix+ED(n);ge(e.elem,t.classNamePrefix),e.elem.classList.add(r),$e(),Ie(r,`background-image: ${n!=="none"?wD(za(n)):"none"} !important;`)}else ge(e.elem,t.classNamePrefix)}function RD(e){const t=e.settings.mobileBackgroundPositionX;if(t.value){const n=t.classNamePrefix+f1(String(t.value));ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`background-position-x: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function OD(e){const t=e.settings.mobileBackgroundPositionY;if(t.value){const n=t.classNamePrefix+f1(String(t.value));ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`background-position-y: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function PD(e){const t=e.settings.mobileBackgroundRepeat;if(t.value&&t.value!=="none"){const n=t.classNamePrefix+t.value;ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`background-repeat: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function ID(e){const t=e.settings.mobileBackgroundSize;if(t.value){const n=t.classNamePrefix+t.value;ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`background-size: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function ns(e){const t=e.settings.mobilePadding;$e(),["top","right","bottom","left"].forEach(n=>{const r=t[n];if(r!=null){Av({elem:e.elem,position:n});const o=t.classNamePrefix+n+"-"+r;e.elem.classList.add(o),Ie(o,`padding-${n}: ${r}px !important;`)}else r===null&&Av({elem:e.elem,position:n})})}function y1(e){const t=e.settings.mobileFontSize;if(t.value!=null){const n=t.classNamePrefix+t.value+"px";ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`font-size: ${t.value}px !important;`)}else ge(e.elem,t.classNamePrefix)}function v1(e){const t=e.settings.mobileLineHeight;if(t&&t.value!==null){const n=t.classNamePrefix+t.value+"px";ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`line-height: ${t.value}px !important;`)}else t&&ge(e.elem,t.classNamePrefix)}function E1(e){const t=e.settings.show,n=()=>{e.elem.style.removeProperty("display"),e.elem.tagName==="IMG"&&(e.elem.style.display="block"),e.elem.previousSibling&&e.elem.previousSibling.textContent?.indexOf("mso")!==-1&&e.elem.previousSibling.remove(),e.elem.nextSibling&&e.elem.nextSibling.textContent?.indexOf("endif")!==-1&&e.elem.nextSibling.remove()};if(t!=="all"){const r="em-show-"+e.elem.tagName?.toLowerCase()+"-"+t;if(e.elem.classList.forEach(o=>{o.indexOf("em-show-")>-1&&e.elem.classList.remove(o)}),e.elem.classList.add(r),$e(),t==="mobile"){e.elem.style.display="none",(!e.elem.previousSibling||e.elem.previousSibling.textContent?.indexOf("mso")===-1)&&(e.elem.insertAdjacentHTML("beforebegin","<!--[if !mso]><!-->"),e.elem.insertAdjacentHTML("afterend","<!--<![endif]-->"));let o="block";e.elem.tagName==="TD"?o="table-cell":e.elem.tagName==="IMG"?o="block":e.elem.tagName==="TABLE"&&(o="table"),Ie(r,`display: ${o} !important;`)}t==="desktop"&&(n(),Ie(r,"display: none !important;"))}else n(),e.elem.classList.forEach(r=>{r.indexOf("em-show-")>-1&&e.elem.classList.remove(r)})}function DD(e){const t=e.settings.isContrastBlock,n=Od();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 BD(){return{mobileWidth:null,mobileWidthDim:"px",mobileHeight:null,mobileHeightDim:"px",mobileBorder:{all:{width:null,style:null,color:null},top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}},mobileBorderRadius:{all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},mobileBoxShadow:{hOffset:null,vOffset:null,blurRadius:null,spreadRadius:null,color:null,inset:null},mobileAlign:{value:""},mobileTextAlign:{value:""},mobileVerticalAlign:{value:""},mobileDirection:{value:""},mobileBackgroundColor:{value:""},mobileBackgroundImage:[{type:"url",value:""}],mobileBackgroundPositionX:{value:""},mobileBackgroundPositionY:{value:""},mobileBackgroundRepeat:{value:"none"},mobileBackgroundSize:{value:""},mobilePadding:{all:null,bottom:null,left:null,right:null,top:null},show:"all",mobileFontSize:null,mobileFontSizeDim:"px"}}function We(e,t=!1){const n=BD();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=SD(r.substring(24))),r.indexOf("em-mob-background_position_x")>-1&&(n.mobileBackgroundPositionX.value=p1(r.substring(29))),r.indexOf("em-mob-background_position_y")>-1&&(n.mobileBackgroundPositionY.value=p1(r.substring(29))),r.indexOf("em-mob-background_repeat")>-1&&(n.mobileBackgroundRepeat.value=r.substring(25)),r.indexOf("em-mob-background_size")>-1&&(n.mobileBackgroundSize.value=r.substring(23)),r.indexOf("em-mob-padding")>-1&&(r.substring(15,18)==="all"&&(n.mobilePadding.all=parseFloat(r.substring(19))),r.substring(15,18)==="top"&&(n.mobilePadding.top=parseFloat(r.substring(19))),r.substring(15,20)==="right"&&(n.mobilePadding.right=parseFloat(r.substring(21))),r.substring(15,21)==="bottom"&&(n.mobilePadding.bottom=parseFloat(r.substring(22))),r.substring(15,19)==="left"&&(n.mobilePadding.left=parseFloat(r.substring(20)))),r.indexOf("em-show")>-1&&(r.substring(r.length-6)==="mobile"?n.show="mobile":r.substring(r.length-7)==="desktop"&&(n.show="desktop")),t&&(r==="em-amp-show-only"?n.ampShow="amp":r==="em-amp-show-disabled"&&(n.ampShow="html")),r.indexOf("em-mob-font_size")>-1&&(n.mobileFontSizeDim="px",n.mobileFontSize=r.substring(17,r.length-2)),r.indexOf("em-mob-line_height")>-1&&(n.mobileLineHeight=r.substring(19,r.length-2))}),n}function HD(e){const t={all:null,top:null,right:null,bottom:null,left:null},n={all:null,top:null,right:null,bottom:null,left:null},r=We({elem:e}),o=r.mobileWidth,i=r.mobileHeight;(e.style.padding||e.style.paddingTop||e.style.paddingRight||e.style.paddingBottom||e.style.paddingLeft)&&(!e.style.padding||e.style.padding.indexOf(" ")>-1?t.all=null:!e.style.padding&&e.style.paddingTop&&e.style.paddingRight&&e.style.paddingBottom&&e.style.paddingLeft&&e.style.paddingTop===e.style.paddingRight&&e.style.paddingRight===e.style.paddingBottom&&e.style.paddingBottom===e.style.paddingLeft?t.all=parseFloat(e.style.paddingTop):t.all=parseFloat(e.style.padding),t.top=e.style.paddingTop?parseFloat(e.style.paddingTop):null,t.right=e.style.paddingRight?parseFloat(e.style.paddingRight):null,t.bottom=e.style.paddingBottom?parseFloat(e.style.paddingBottom):null,t.left=e.style.paddingLeft?parseFloat(e.style.paddingLeft):null),(r.mobilePadding.all!==null||r.mobilePadding.top!==null||r.mobilePadding.right!==null||r.mobilePadding.bottom!==null||r.mobilePadding.left!==null)&&(r.mobilePadding.all?!r.mobilePadding.all&&r.mobilePadding.top&&r.mobilePadding.right&&r.mobilePadding.bottom&&r.mobilePadding.left&&r.mobilePadding.top===r.mobilePadding.right&&r.mobilePadding.right===r.mobilePadding.bottom&&r.mobilePadding.bottom===r.mobilePadding.left?n.all=parseFloat(String(r.mobilePadding.top)):n.all=r.mobilePadding.all!==null?parseFloat(String(r.mobilePadding.all)):null:n.all=null,n.top=r.mobilePadding.top!==null?parseFloat(String(r.mobilePadding.top)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.right=r.mobilePadding.right!==null?parseFloat(String(r.mobilePadding.right)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.bottom=r.mobilePadding.bottom!==null?parseFloat(String(r.mobilePadding.bottom)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.left=r.mobilePadding.left!==null?parseFloat(String(r.mobilePadding.left)):r.mobilePadding.all===null?null:r.mobilePadding.all);let s=e.getAttribute("align")??"";e.parentElement?.getAttribute("em")!=="group"&&e.querySelector('[em="atom"]')&&e.querySelectorAll('[em="atom"] > tr > td').forEach(c=>{c.getAttribute("align")!==s&&(s="")});const a={padding:t,borderRadius:ji(e),backgroundColor:e.style.backgroundColor?X(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:pl(e),boxShadow:Gi(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:Ki(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 FD(e){let t=[],n=null,r=null,o="",i,s=!1;if(e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap")){const a=e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap");if(i=!0,a.parentElement.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1)a.parentElement.querySelectorAll(":scope > .em-mob-wrap:nth-child(odd), :scope > .noresp-em-mob-wrap:nth-child(odd)").forEach(l=>{t.push({width:parseFloat(l.getAttribute("width")||"0"),current:l===a});const c=a.parentElement.querySelector(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap");c?.nextElementSibling&&(n=parseFloat(c.nextElementSibling.getAttribute("width")||"0"),r=We({elem:c.nextElementSibling}).mobileHeight||0),(l.classList.contains("em-mob-wrap-cancel")||l.classList.contains("noresp-em-mob-wrap-cancel"))&&(i=!1)});else{const l=a.parentElement.querySelector(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap");t=[{width:parseFloat(l?.getAttribute("width")||"0"),current:!0}],n=0}o=a.parentElement.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.getAttribute("valign")||"",(e.elem.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap").parentElement.closest("td"))?.getAttribute("dir")==="rtl"&&(s=!0)}else{const a=e.elem.closest('div[style*="inline-block"]');if(a&&a.parentElement.querySelectorAll('div[style*="inline-block"]').length>1)a.parentElement.querySelectorAll('div[style*="inline-block"]').forEach(l=>{const c=l;if(!c.style.fontFamily){const u=l.firstElementChild;t.push({width:parseFloat(u?.getAttribute("width")||"0"),current:l===a});const d=u?.getAttribute("width"),m=parseFloat(c.style.width);n=m-(!d||d.indexOf("%")>-1?m:parseFloat(d))}});else{const l=a?.parentElement?.querySelector('div[style*="inline-block"]');t=[{width:parseFloat(l?.firstElementChild?.getAttribute("width")||"0"),current:!0}],n=0}o=a?.parentElement?.querySelector('div[style*="inline-block"]')?.style.verticalAlign||"",(e.elem.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.elem.closest('div[style*="inline-block"]')?.parentElement)?.getAttribute("dir")==="rtl"&&(s=!0)}return{items:t,gap:n,gapMobile:r,valign:o,wrap:i,dirRevers:s}}var $D='table[em-type="social"]';function WD(e){return e.closest($D)}function qD(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 Cl(e){const t=WD(e);if(t&&e!==t&&qD(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")&&zD(o)?n:Cl(n)}function zD(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 rs(){return Et.getInstance(lc)?.localized??{}}var S1=[];function VD(){return S1}function w1(e){const t=rs();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=yT(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 UD=new Set(["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"]);function jD(e){return Array.from(e.classList).some(t=>t.startsWith("em-element-"))}function GD(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(UD.has(r.tagName))return!1;return Array.from(e.children).every(r=>r===n||r.contains(n)||jD(r))}var C1='.em-narrow-table, [em="block-contaner"]';function XD(e){const t=e.style;return GD(e)?!1:!!(e.tagName==="A"&&!e.closest(".em-element-resize-img-container")&&!e.closest('table[em-type="social"]')||e.tagName==="TD"&&!e.closest(C1)||e.tagName==="TABLE"&&e.parentElement?.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(C1)&&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"))||Jp(e))}function YD(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||Jp(e))&&t.push(w1(e));let r=e;for(;r?.parentElement&&r.parentElement.tagName!=="BODY";)r=r.parentElement,XD(r)&&t.push(w1(r));return t=t.filter(o=>!(o.elem?.tagName==="TABLE"&&o.elem.parentElement?.tagName==="BODY")),t=t.reverse(),S1=t.map(o=>({...o})),t.map(o=>({title:o.title,className:o.className}))}function A1(e){const t=rs(),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 A1(n)}function KD(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 ZD(e){return e.tagName==="AMP-ACCORDION"}var T1="em-mob-text_align-",QD=":scope > tr > td, :scope > tbody > tr > td",JD='div[style*="font-family"][style*="font-size"]';function mm(e){return e.querySelector(QD)}function fm(e){return e.querySelector(JD)}function e8(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!0;return!1}function _1(e){const t=e.closest('table[em="atom"]');if(!t||e8(e,t))return null;const n=mm(t);return n?{atomTd:n,textDiv:fm(n)}:null}function os(e){const t=e.closest("div, p, td");if(!t)return null;if(t.style.textAlign)return t;const n=_1(e);return n?n.textDiv?.hasAttribute("align")?n.textDiv:n.atomTd:t}function k1(e){const t=os(e);return t&&(t.style.textAlign||t.getAttribute("align"))||"left"}function t8(e){const t=os(e);if(!t)return"";for(const n of t.classList)if(n.startsWith("em-mob-text_align-"))return n.slice(18);return""}function pm(e){return{value:t8(e)}}function n8(e,t,n=T1){const r=_1(e);if(r)for(const o of[r.atomTd,r.textDiv])o&&o!==t&&ml(o,n)}function r8(e){const t=mm(e);if(!t)return null;const n=fm(t);return n?.hasAttribute("align")?n:t}function o8(e,t){e.querySelectorAll('[em="atom"]').forEach(n=>{const r=r8(n);r&&t(r,n)})}function i8(e,t,n=T1){const r=mm(e),o=r?fm(r):null;for(const i of[r,o])i&&i!==t&&ml(i,n)}function Al(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 is(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(Wd),i=r.filter(s=>s!==Wd);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 Ze(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 Tl(e){if(!e)return!1;const t=e.style.fontWeight||getComputedStyle(e).fontWeight;return t==="bold"||t==="700"||parseInt(t,10)>=700}function Rr(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 s8(){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 ss(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 L1(){const e=window.getSelection();if(!e||e.rangeCount===0)return!1;let t=e.anchorNode,n=e.focusNode;t?.nodeType===3&&(t=t.parentNode),n?.nodeType===3&&(n=n.parentNode);const r=t?.closest?.("a"),o=n?.closest?.("a");return!!(r?.getAttribute("href")||o?.getAttribute("href"))}function hm(e){if(!e)return!1;for(const t of Array.from(e.childNodes))if(t.nodeType===Node.COMMENT_NODE&&t.nodeValue?.includes("[if mso]")&&t.nodeValue.includes("v:roundrect")||t.nodeType===Node.ELEMENT_NODE&&hm(t))return!0;return!1}function N1(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 x1(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function a8(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 l8(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 c8(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 u8(e,t){const n=e.elem.closest("a")||e.elem,r=e.elem.closest("td"),o=Zd(n),i=hm(r)&&!hm(n)||!!o,s=o??(i?n:r),a=e.elem.closest("table"),l=a?.closest("td")?.closest("table")?.closest("td"),c=a?.closest("div, p, td"),u=c?.style.textAlign||c?.getAttribute("align")||"left",d=We({elem:e.elem}),m=We({elem:r}),p=l?We({elem:l}):null,f=We({elem:a}),h=e.elem.closest("a"),y={type:"button",caption:t.BUTTON,fontFamily:is(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:Al(e.elem),lineHeightDim:"px",textStrong:Ze(e.elem,"strong","b")||Tl(e.elem),textItalic:Ze(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&(h?.style?.fontStyle==="italic"||e.elem.style?.fontStyle==="italic"),textStrikethrough:Ze(e.elem,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1)||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("line-through"),textUnderline:Ze(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:X(Rr(e.elem,"color"))||X(getComputedStyle(e.elem).color)||"",textBackgroundColor:X(Rr(e.elem,"background-color"))||"",padding:a8(o??n),borderRadius:ji(s),backgroundColor:s.style.backgroundColor?X(s.style.backgroundColor):s.getAttribute("bgcolor")||"",backgroundImage:c8(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:N1(a,"width"),height:N1(r,"height"),align:u,valign:r.getAttribute("valign")??"",textAlign:r.getAttribute("align")??"",border:pl(s),boxShadow:Gi(s),href:n.getAttribute("href")??"",outlookRounding:i,outlookBackground:Ki(r,"inside"),mobileWidth:{value:x1(f.mobileWidth),dim:f.mobileWidthDim??"px"},mobileHeight:{value:x1(m.mobileHeight),dim:m.mobileHeightDim??"px"},mobileBorder:m.mobileBorder,mobileBorderRadius:m.mobileBorderRadius,mobileBoxShadow:m.mobileBoxShadow,mobileAlign:f.mobileAlign,mobileFontSize:{value:d.mobileFontSize,dim:d.mobileFontSizeDim||"px"},mobileTextAlign:pm(e.elem),mobileVerticalAlign:p?.mobileVerticalAlign,mobileBackgroundColor:m.mobileBackgroundColor,mobileBackgroundImage:m.mobileBackgroundImage,mobileBackgroundPositionX:m.mobileBackgroundPositionX,mobileBackgroundPositionY:m.mobileBackgroundPositionY,mobileBackgroundRepeat:m.mobileBackgroundRepeat,mobileBackgroundSize:m.mobileBackgroundSize,mobilePadding:l8(d.mobilePadding),mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},show:f.show,exportAsPicture:a?.getAttribute("em-operation")==="exportAsPicture"};return ss(e.elem)&&(y.showOnMobile=!0),y}function d8(e){if(Qd(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 m8(e,t){return t?!1:e.tagName==="A"||e.tagName==="EM-REPLACE"&&!!e.closest("a")}function f8(e){const t=e.closest("a"),n=e.closest('a[style*="display"]');if(Qd(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 M1(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function R1(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function O1(e){return{src:e.getAttribute("src")??"",width:M1(e,"width"),height:M1(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 p8(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-carousel");r.setAttribute("em-edit","active");const o=r.querySelectorAll("amp-img"),i=h8(o),s=Array.from(o).map((u,d)=>{const m=We({elem:u}),p=O1(u);return{src:p.src,width:p.width,height:p.height,alt:p.alt,title:p.title,link:p.link,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:p.imgReplacer,mobileWidth:{value:R1(m.mobileWidth),dim:m.mobileWidthDim??"px"},mobileHeight:{value:R1(m.mobileHeight),dim:m.mobileHeightDim??"px"},mobileBorderRadius:m.mobileBorderRadius,slideIndex:d}}),a=We({elem:r}),l={type:"carousel",caption:t.CAROUSEL,carouselImages:s,borderRadius:ji(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 h8(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 g8(e){return!!e.closest("amp-carousel")}function as(e,t,n){const r=n==="All"?"border":`border-${n.toLowerCase()}`,o=e?.includes(`${r}:`);if(n==="All")return{color:t.getAttribute("bordercolor")?X(t.getAttribute("bordercolor")):t.style?.border?X(t.style.borderColor):"",width:t.getAttribute("border")||(t.style?.border?t.style.borderWidth:""),style:e?.includes("border:")?t.style.borderStyle:t.getAttribute("border")?"solid":""};const i=`border${n}Color`,s=`border${n}Width`,a=`border${n}Style`;return{color:o?X(t.style[i]):"",width:o?t.style[s]:"",style:o?t.style[a]:""}}function ls(e,t,n){const r=n==="All"?"border":`border-${n.toLowerCase()}`,o=!!e?.includes(`${r}:`);if(n==="All")return{color:o?X(t.style.borderColor):"",width:o?t.style.borderTopWidth:0,style:o?t.style.borderStyle:""};const i=`border${n}Color`,s=`border${n}Width`,a=`border${n}Style`;return{color:o?X(t.style[i]):"",width:o?t.style[s]:0,style:o?t.style[a]:""}}function b8(e){return!!e.closest(".em-element-custom-table")}function y8(e,t,n){const r=e.elem,o=r.tagName==="DIV"||r.querySelector(`.${n.CLASS_FOR_BASIC_CELL}`)||r.querySelector("EDITOR")?r.closest("TD"):r,i=o.closest("TABLE"),s=i.getAttribute("style"),a=o.getAttribute("style"),l=n.parseTableElementToModel(i);if(n.activeCell.length>1){const h=l.cells.find(y=>y.id===n.activeCell[0]);l.cells.find(y=>y.id===n.activeCell[n.activeCell.length-1])?.style,h?.style}const c=i?.style?.borderRadius?n.extractBorderRadius(s||""):null,u=c?c.firstNumber===c.secondNumber&&c.secondNumber===c.thirdNumber&&c.thirdNumber===c.fourthNumber:!1,d=n.parseBackgroundStyles(s||""),m=Gi(i),p=We({elem:i}),f={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none",show:p.show,outlookBackground:Ki(r.closest(".em-element-custom-table")??r,"around"),customTable:{paddingLeftRight:o.style.paddingLeft===o.style.paddingRight?o.style.paddingLeft:"",paddingTopBottom:o.style.paddingTop===o.style.paddingBottom?o.style.paddingTop:"",paddingLeft:o.style.paddingLeft,paddingRight:o.style.paddingRight,paddingTop:o.style.paddingTop,paddingBottom:o.style.paddingBottom,backgroundColor:i.getAttribute("bgcolor")?X(i.getAttribute("bgcolor")):"",backgroundImage:[{type:"url",value:d?.backgroundImage??""}],backgroundPositionX:d?.backgroundPositionX??"center",backgroundPositionY:d?.backgroundPositionY??"center",backgroundRepeat:d?.backgroundRepeat??"repeat",backgroundSize:d?.backgroundSize??"cover",borderAll:as(s,i,"All"),borderBottom:as(s,i,"Bottom"),borderTop:as(s,i,"Top"),borderRight:as(s,i,"Right"),borderLeft:as(s,i,"Left"),borderRadius:{all:s?.includes("border-radius:")&&u?+c.firstNumber:null,topLeft:s?.includes("border-radius:")&&!u?+c.firstNumber:null,topRight:s?.includes("border-radius:")&&!u?+c.secondNumber:null,bottomRight:s?.includes("border-radius:")&&!u?+c.thirdNumber:null,bottomLeft:s?.includes("border-radius:")&&!u?+c.fourthNumber:null},boxShadow:{color:m?.color??null,hOffset:m?.hOffset??null,vOffset:m?.vOffset??null,blurRadius:m?.blurRadius??null,spreadRadius:m?.spreadRadius??null,inset:m?.inset??null},mobileBoxShadow:p.mobileBoxShadow,mobileBackgroundColor:p.mobileBackgroundColor,mobileBackgroundImage:p.mobileBackgroundImage,mobileBackgroundPositionX:p.mobileBackgroundPositionX,mobileBackgroundPositionY:p.mobileBackgroundPositionY,mobileBackgroundRepeat:p.mobileBackgroundRepeat,mobileBackgroundSize:p.mobileBackgroundSize,mobileWidth:{value:p.mobileWidth!=null?p.mobileWidth:null,dim:p.mobileWidthDim},mobileHeight:{value:p.mobileHeight!=null?p.mobileHeight:null,dim:"px"},mobileBorderRadius:p.mobileBorderRadius,mobileBorder:p.mobileBorder,borderPosition:_v(i),cell_borderPosition:_v(o),cellBackgroundColor:a?.includes("background-color:")?X(o.style.backgroundColor):"",cell_borderAll:ls(a,o,"All"),cell_borderBottom:ls(a,o,"Bottom"),cell_borderTop:ls(a,o,"Top"),cell_borderRight:ls(a,o,"Right"),cell_borderLeft:ls(a,o,"Left"),cell_paddingLeftRight:o.style.paddingLeft===o.style.paddingRight?o.style.paddingLeft:"",cell_paddingTopBottom:o.style.paddingTop===o.style.paddingBottom?o.style.paddingTop:"",cell_paddingLeft:o.style.paddingLeft,cell_paddingRight:o.style.paddingRight,cell_paddingTop:o.style.paddingTop,cell_paddingBottom:o.style.paddingBottom,linkHref:r.getAttribute("href")?.trim()??"",textLink:!!r.closest("a"),target:r.getAttribute("target")??"",fontFamily:n.getFontFamilyFromElement(n.requestElemWithStyle?.closest('[style*="font-family"]')||r),fontSize:n.requestElemWithStyle?.style?.fontSize?parseInt(n.requestElemWithStyle.style.fontSize,10):n.requestElemWithStyle?.closest('div[style*="font-size"]')?.style?.fontSize?parseInt(n.requestElemWithStyle.closest('div[style*="font-size"]').style.fontSize,10):null,textStrikethrough:n.textHasStyle(r,"s","strike")||n.requestElemWithStyle?.style.textDecoration.includes("line-through"),textUnderline:n.textHasStyle(r,"u")||n.requestElemWithStyle.style.textDecoration.includes("underline")||!n.requestElemWithStyle.style.textDecoration&&r.tagName==="A",lineHeight:n.getLineHeghtInPixels(n.requestElemWithStyle),textStrong:n.textHasStyle(r,"strong","b")||n.isElementHasBold(n.requestElemWithStyle),textItalic:n.textHasStyle(r,"i","em")||!n.requestElemWithStyle.closest('[style*="font-style: normal"]')&&n.requestElemWithStyle?.style?.fontStyle==="italic",textAlign:r.style?.textAlign||r.getAttribute("align")||r.closest("[align]")?.getAttribute("align")||"",textColor:X(r.closest('[style*="color"]')?.style.color)||X(getComputedStyle(r).color),textBackgroundColor:X(r.closest('[style*="background-color"]')?.style.backgroundColor)||X(getComputedStyle(r).backgroundColor),textValign:r.style?.verticalAlign||r.getAttribute("valign")||r.closest("[valign]")?.getAttribute("valign")||""}};return r.getAttribute("new")&&(r.removeAttribute("new"),f.customTable.isNewLink=!0,r.setAttribute("em-edit","active")),{type:"customTable",caption:t.ELEMENT,settings:f}}function _l(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function v8(e,t,n){const r=e.elem;return{type:"div",caption:t.CONTAINER,...n.getElementTdDiv(r),width:_l(r.style.width),maxWidth:_l(r.style.maxWidth),minWidth:_l(r.style.minWidth),height:_l(r.style.height),valign:r.style.verticalAlign??"",align:r.style.textAlign??"",direction:r.getAttribute("dir")??"none"}}function P1(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 E8(e){return e.tagName==="TABLE"&&e.getAttribute("em")==="atom"}function I1(e,t,n){return e?{fontFamily:is(e.closest('[style*="font-family"]')||e),textStrong:Ze(e,"strong","b")||Tl(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:X(e.closest('[style*="color"]')?.style.color)||"",textBackgroundColor:X(e.closest('[style*="background-color"]')?.style.backgroundColor)||"",textStrikethrough:S8(e),textUnderline:w8(e)}:{}}function S8(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 w8(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 C8(e,t,n){const r=e.elem.querySelector(".em-element-list-ul")||e.elem.querySelector(".em-element-list-ol")||null,o=r?e.elem.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'):null,i=We({elem:e.elem}),s=e.elem.querySelector("td"),a=n.getElementTdDiv(s),l=r?I1(o,r,n):{};return{type:"td",caption:t.ELEMENT,...a,mobileWidth:P1(i.mobileWidth,i.mobileWidthDim),direction:s?.getAttribute("dir")??"none",elementName:r?"List":"",...l}}function A8(e,t,n){const r=e.elem.closest("table")?.closest("td"),o=e.elem.closest("table");if(!r&&!o)return{settings:null,editTargetTd:null,shouldResetProgrammaticSelection:!0};const i=r?.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'),s=!!(r?.querySelector(".em-element-list-ul")||r?.querySelector(".em-element-list-ol")),a=We({elem:r}),l=r?.querySelector("td"),c=n.getElementTdDiv(l),u=i?I1(i,o,n):{};return{settings:{type:"td",caption:t.ELEMENT,...c,mobileWidth:P1(a.mobileWidth,a.mobileWidthDim),direction:l?.getAttribute("dir")??"none",elementName:s?"List":"",...u},editTargetTd:l,shouldResetProgrammaticSelection:!0}}function D1(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function T8(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function B1(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function _8(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 k8(e,t){const n=e.elem,r=We({elem:n}),o=n.firstElementChild,i=o?We({elem:o}):null,s=D1(r.mobileWidth),a=i?D1(i.mobileWidth):null;return{type:"floatBlock",caption:t.FLOAT_BLOCK,width:T8(o?.getAttribute("width")),gap:{value:_8(n),dim:"px"},maxWidth:B1(n.style.maxWidth),minWidth:B1(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 L8(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 H1(e){return e.getAttribute("src")}function N8(e,t){const n=Gc(e.elem),r=H1(n),o=We({elem:n}),i=n.closest("td"),s=i?We({elem:i}):null;let a="img",l=t.PICTURE;e.elem.classList.contains("em-countdown")?(a="countdown",l=t.COUNTDOWN):e.elem.classList.contains("em-video")&&(a="video",l=t.VIDEO);const c=d=>d===null||d==="auto"?null:typeof d=="number"?d:null,u={type:a,caption:l,src:r??"",width:F1(n,"width"),height:F1(n,"height"),alt:n.getAttribute("alt")??"",title:n.getAttribute("title")??"",align:i?.getAttribute("align")??"undefined",valign:n.style?.verticalAlign??"undefined",border:pl(n),borderRadius:ji(n),boxShadow:Gi(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 ss(e.elem)&&(u.showOnMobile=!0),i&&(u.maxWidth=Math.round(i.getBoundingClientRect().width)),u}function F1(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function x8(e){return e.tagName==="IMG"||e.tagName==="AMP-IMG"}function cs(e){const t=String(e??"").trim();return t?X(t)??t:""}var gm={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function M8(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 R8(e,t){if(e.length===0)return t;let n=null;for(const r of e){const o=r.iconWidth;if(o==null||Number.isNaN(o)||o<=0)return t;if(n===null)n=o;else if(o!==n)return t}return n??t}function bm(e){return e.closest('table[em-type="social"]')}function O8(e){const t=e.ownerDocument;return t?Array.from(t.querySelectorAll('table[em-type="social"]')).indexOf(e):-1}function $1(e){const t=e.querySelector(":scope > tr");if(t){const r=t.querySelector(":scope > td");if(r instanceof HTMLElement)return r}const n=e.querySelector("tbody > tr");if(n){const r=n.querySelector(":scope > td");if(r instanceof HTMLElement)return r}return null}function Ho(e){if(!e||!(e instanceof HTMLElement))return"";const t=e.style?.backgroundColor?.trim()??"";return!t||t==="transparent"||t==="rgba(0, 0, 0, 0)"?"":t}function xn(e,t){return e.hasAttribute(t)||e.hasAttribute(`data-${t}`)}function ym(e,t){return e?e.getAttribute(t)??e.getAttribute(`data-${t}`):null}function P8(e){if(!(e instanceof HTMLElement))return null;const t=e.getAttribute("width")?.trim(),n=e.style.width?.trim(),r=t||n;if(!r)return null;const o=/^(\d+)/.exec(r);if(!o)return null;const i=parseInt(o[1],10);return Number.isNaN(i)||i<0?null:i}function I8(e,t){for(let n=1;n<e.length-1;n+=1){const r=e[n-1],o=e[n],i=e[n+1];if(r instanceof HTMLElement&&i instanceof HTMLElement&&xn(r,"em-platform")&&xn(i,"em-platform")&&o instanceof HTMLElement&&!xn(o,"em-platform")){const s=P8(o);if(s!=null){t.gap=s;return}}}}function W1(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 D8(e,t){const n=$1(e)?.getAttribute("align")?.trim().toLowerCase();(n==="left"||n==="right"||n==="center")&&(t.align=n)}function B8(e,t){for(const n of e){if(!(n instanceof HTMLElement)||!xn(n,"em-platform"))continue;const r=W1(n.getAttribute("style"));if(r!=null){t.borderRadius=r;return}const o=W1(n.querySelector("img")?.getAttribute("style")??null);if(o!=null){t.borderRadius=o;return}}}function H8(e,t){for(const n of e){if(!(n instanceof HTMLElement))continue;const r=n.querySelector("br"),o=r?.nextElementSibling?.tagName==="SPAN"?r.nextElementSibling:null;if(o&&o.textContent?.trim()){t.showLabel=!0;return}}t.showLabel=!1}function F8(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=Ho(r),s=Ho(o instanceof HTMLElement?o:null),a=Ho(e.querySelector("[em-social-tray], [data-em-social-tray]")),l=Ho(t),c=Ho(e),u=i||s||a||l||c;u&&(n.bgEnabled=!0,n.bgColor=u)}function $8(e){const t=$1(e);if(!(t instanceof HTMLElement))return"";const n=Ho(t);return n||(t.getAttribute("bgcolor")?.trim()??"")}function vm(e){if(!e)return null;const t=e.style.border?.trim()??"",n=/^(\d+)px\s+solid\s+(.+)$/i.exec(t);if(!n)return null;const r=parseInt(n[1],10),o=n[2].trim();return Number.isNaN(r)||r<=0||!o?null:{w:r,color:o}}function W8(e,t){const n=vm(e);n&&(t.borderWidth=n.w,t.borderColor=n.color)}function q8(e){const t=e.closest("td[em-platform], td[data-em-platform]");if(t)return!!bm(t);const n=e.closest("td"),r=n?.previousElementSibling,o=n?.nextElementSibling;return!!(n&&!xn(n,"em-platform")&&r instanceof HTMLElement&&o instanceof HTMLElement&&xn(r,"em-platform")&&xn(o,"em-platform")&&bm(n))}function z8(e,t){const n=bm(e.elem);if(!n)return{type:"social",caption:t.SOCIAL??"Social media",...gm,hostCellBgForIconLuminance:"",blockIndex:-1,items:[]};const r={...gm};D8(n,r),W8(n,r);const o=n.querySelector('table[role="presentation"]')||n.querySelector("table");F8(n,o,r);const i=o?.querySelector("tr"),s=i?Array.from(i.querySelectorAll(":scope > td")):[],a=s.filter(f=>f instanceof HTMLElement&&xn(f,"em-platform")),l=a.length>0?a:s.filter(f=>f.querySelector("img"));I8(s,r),B8(l,r),H8(l,r);let c=typeof r.buttonBorderWidth=="number"&&!Number.isNaN(r.buttonBorderWidth)?r.buttonBorderWidth:0;const u=n.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),d=u instanceof HTMLElement?vm(u):null;if(d)c=d.w;else for(const f of l){if(!(f instanceof HTMLElement))continue;const h=vm(f);if(h){c=h.w;break}}let m=l.map(f=>{if(!(f instanceof HTMLElement))return{platform:"unknown",customIcon:!1,href:"",alt:"",title:"",iconSrc:"",iconWidth:null,iconHeight:null,buttonBgColor:"",itemBorderColor:""};const h=f,y=ym(h,"em-platform")||"unknown",v=xn(h,"em-custom-icon"),A=h.querySelector("a"),k=h.querySelector("img"),S=A?.getAttribute("href")??"",b=A?.getAttribute("title")??k?.getAttribute("title")??"",E=k?.getAttribute("alt")??"",C=k?.getAttribute("src")??"",g=M8(k instanceof HTMLImageElement?k:null),w=k?.getAttribute("height")?.trim(),T=w?parseInt(w,10):NaN,_=!Number.isNaN(T)&&T>0,M=ym(h,"em-button-bg")?.trim()??"",N=!v&&xn(h,"em-tray-cell-bg");let W="",P="";if(!v&&(W=M,!W&&!N&&h.style?.backgroundColor&&(W=h.style.backgroundColor.trim()),P=ym(h,"em-item-border-color")?.trim()??"",!P)){const R=h.style.border?.trim()??"",Y=/^(\d+)px\s+solid\s+(.+)$/i.exec(R);Y?.[2]&&(P=Y[2].trim())}return{platform:y,customIcon:v,href:S,alt:E,title:b,iconSrc:C,iconWidth:g,iconHeight:_?T:g,buttonBgColor:W,itemBorderColor:P}});if(d&&m.length>0&&m.every(f=>f.customIcon||!String(f.itemBorderColor??"").trim())){const f=d.color;m=m.map(h=>h.customIcon?h:{...h,itemBorderColor:f})}const p=R8(m,gm.iconSize);return{type:"social",caption:t.SOCIAL??"Social media",align:r.align,iconSize:p,borderRadius:r.borderRadius,gap:r.gap,bgEnabled:r.bgEnabled,bgColor:cs(r.bgColor),borderWidth:r.borderWidth,borderColor:cs(r.borderColor),buttonBorderColor:"",buttonBorderWidth:c,showLabel:r.showLabel,hostCellBgForIconLuminance:cs($8(n)),blockIndex:O8(n),items:m.map(f=>({...f,buttonBgColor:cs(f.buttonBgColor),itemBorderColor:cs(f.itemBorderColor)}))}}function q1(e){return e.tagName==="TBODY"&&Array.from(e.childNodes).every(z1)}function V8(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function z1(e){return e.nodeType===Node.COMMENT_NODE}function un(e){if(e.tagName!=="TABLE")return!1;const t=Array.from(e.childNodes).filter(r=>!z1(r));if(t.length===0)return!0;const n=t.filter(r=>!V8(r));return n.length===1&&n[0]instanceof Element&&q1(n[0])}function V1(e=document){for(const t of Array.from(e.querySelectorAll("table")))if(un(t))return t;return null}function Vn(e){const t=e.children.length===1?e.children[0]:null;return t&&q1(t)?t:e}function U8(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function U1(e,t){const n=e.style[t];return n?{value:parseFloat(n),dim:n.includes("%")?"%":"px"}:{value:null,dim:"px"}}function j8(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function G8(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 X8(e,t){const n=e.elem;if(un(n))return{type:"emptyTable",caption:t.TABLE};n.setAttribute("em-edit","active");const r=We({elem:n}),o={type:"table",caption:t.TABLE,backgroundColor:n.style.backgroundColor?X(n.style.backgroundColor):"",backgroundImage:G8(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:U8(n,"width"),maxWidth:U1(n,"maxWidth"),minWidth:U1(n,"minWidth"),align:n.getAttribute("align")??"",border:pl(n),boxShadow:Gi(n),borderRadius:ji(n),mobileWidth:{value:j8(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:Ki(n,"around")};return ss(n)&&(o.showOnMobile=!0),o}function Y8(e){return e.tagName==="TABLE"&&e.getAttribute("em")!=="atom"}function K8(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 Z8(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 Q8(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 J8(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 e9(e){const t={items:[],gap:null,gapMobile:null,valign:"",wrap:void 0,dirRevers:!1},n=".em-mob-wrap, .noresp-em-mob-wrap",r=e.querySelector(n),o=e.querySelectorAll(n).length;if(r&&e.querySelectorAll(".em-mob-wrap:first-child, .noresp-em-mob-wrap:first-child").length===1)t.wrap=!0,e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(i=>{if(t.items.push({width:parseFloat(i.getAttribute("width")||"0"),current:!1}),o>1){const s=r.nextElementSibling;t.gap=parseFloat(s?.getAttribute("width")||"0");const a=We({elem:s});t.gapMobile=a.mobileHeight||0}else t.gap=0;(i.classList.contains("em-mob-wrap-cancel")||i.classList.contains("noresp-em-mob-wrap-cancel"))&&(t.wrap=!1)}),t.valign=r.getAttribute("valign")||"",(r?document.querySelector('[em-edit="active"]'):e.closest(n)?.parentElement?.closest("td"))?.getAttribute("dir")==="rtl"&&(t.dirRevers=!0);else if(e.querySelector('div[style*="inline-block"]')){const i=e.querySelectorAll('div[style*="inline-block"]');if(i.length>1)i.forEach(a=>{const l=a,c=l.firstElementChild;t.items.push({width:parseFloat(c?.getAttribute("width")||"0"),current:!1});const u=c?.getAttribute("width"),d=parseFloat(l.style.width);!u||u.includes("%")?t.gap=d-d:t.gap=d-parseFloat(u)});else{const a=e.querySelector('div[style*="inline-block"]');t.items=[{width:parseFloat(a.firstElementChild?.getAttribute("width")||"0"),current:!0}],t.gap=0}const s=e.querySelector('div[style*="inline-block"]');t.valign=s?.style.verticalAlign||"",(s?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement)?.getAttribute("dir")==="rtl"&&(t.dirRevers=!0)}return t}function t9(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 n9(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};return o.floatBlocks=e9(r),o.isContrastBlock=!!r.closest(".em-contrast-block"),{type:"structure",caption:t.STRUCTURE,settings:o}}function r9(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 o9(e,t,n){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(o=>{const i=o.querySelectorAll("td");if(i.length>1){const s=i[1],a=(s.getAttribute("style")||"").split(";").filter(u=>u.trim()!==""),l={};a.forEach(u=>{const[d,m]=u.split(":").map(p=>p.trim());l[d]=m}),l[t]=`${n}px`;const c=Object.entries(l).map(([u,d])=>`${u}: ${d}`).join("; ");s.setAttribute("style",c)}}),r.innerHTML}function i9(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");i&&(i.innerHTML=t)}}),n.innerHTML}function s9(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(l=>l.trim()).filter(l=>l);if(a.some(l=>l.startsWith("color"))){const l=a.map(c=>c.startsWith("color")?`color: ${t};`:c);i.setAttribute("style",l.join("; "))}else i.setAttribute("style",s?`${s} color: ${t};`:`color: ${t};`)}}}),n.innerHTML}function a9(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(l=>l.trim()).filter(l=>l);if(a.some(l=>l.startsWith("font-size"))){const l=a.map(c=>c.startsWith("font-size")?`font-size: ${t}px;`:c);i.setAttribute("style",l.join("; "))}else i.setAttribute("style",s?`${s} font-size: ${t}px;`:`font-size: ${t}px;`)}}}),n.innerHTML}function l9(e,t){if(typeof t!="boolean")throw new Error("Invalid isBold value: must be a boolean");const n=t?"bold":"normal",r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(o=>{const i=o.querySelector("td:first-child");if(i){const s=i.querySelector("div");if(s){const a=s.getAttribute("style")||"",l=a.split(";").map(c=>c.trim()).filter(c=>c);if(l.some(c=>c.startsWith("font-weight"))){const c=l.map(u=>u.startsWith("font-weight")?`font-weight: ${n};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-weight: ${n};`:`font-weight: ${n};`)}}}),r.innerHTML}function c9(e,t){if(typeof t!="boolean")throw new Error("Invalid isItalic value: must be a boolean");const n=t?"italic":"normal",r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(o=>{const i=o.querySelector("td:first-child");if(i){const s=i.querySelector("div");if(s){const a=s.getAttribute("style")||"",l=a.split(";").map(c=>c.trim()).filter(c=>c);if(l.some(c=>c.startsWith("font-style"))){const c=l.map(u=>u.startsWith("font-style")?`font-style: ${n};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-style: ${n};`:`font-style: ${n};`)}}}),r.innerHTML}function u9(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldUnderline value: must be a boolean");const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(d=>d.trim()).filter(d=>d);let l="none";const c=a.findIndex(d=>d.startsWith("text-decoration"));if(c!==-1){const d=a[c].match(/^text-decoration\s*:\s*(.*)$/);d&&(l=d[1].trim())}let u;t?l.includes("line-through")?u="underline line-through":u="underline":l.includes("line-through")?u="line-through":u="none",c!==-1?(a[c]=`text-decoration: ${u};`,i.setAttribute("style",a.join("; "))):i.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),n.innerHTML}function d9(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldStrikethrough value: must be a boolean");const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(d=>d.trim()).filter(d=>d);let l="none";const c=a.findIndex(d=>d.startsWith("text-decoration"));if(c!==-1){const d=a[c].match(/^text-decoration\s*:\s*(.*)$/);d&&(l=d[1].trim())}let u;t?l.includes("underline")?u="underline line-through":u="line-through":l.includes("underline")?u="underline":u="none",c!==-1?(a[c]=`text-decoration: ${u};`,i.setAttribute("style",a.join("; "))):i.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),n.innerHTML}function m9(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 f9(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 p9(e){if(!e||!(e instanceof HTMLElement))return"inside";const t=window.getSelection();if(!t||t.rangeCount===0)return"inside";const n=t.getRangeAt(0);if(!n.collapsed)return"inside";let{startContainer:r,startOffset:o}=n;if(r===e)return o===0?"start":o===e.childNodes.length?"end":"inside";const i=m9(e),s=f9(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 j1(e){const t=e.cloneNode(!0),n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let r;for(;r=n.nextNode();)r.nodeValue="";return t}function Em(e){let t="";for(const n of e.attributes)t+=` ${n.name}="${n.value}"`;return t}function h9(e,t){const n=e.closest(`table.${t}`);if(!n)return null;const r=n.querySelector("tbody"),o=r?r.innerHTML.trim():n.innerHTML.trim(),i=e.closest("tr");if(!i)return{rowHtml:o,firstCellText:"",secondCellText:"",firstCellHtmlNoText:"",secondCellHtmlNoText:"",secondCellWrapperHtml:"",secondCellInnerDivHtml:"",wrappedSecondCellHtml:"",secondCellInnerDivWrapperHtml:"",secondCellTextHTML:""};const s=i.querySelectorAll("td"),a=s[0]||null,l=s[1]||null,c=a?a.textContent.trim():"",u=l?l.textContent.trim():"",d=l?l.innerHTML.trim():"",m=a?j1(a).outerHTML:"",p=l?j1(l).outerHTML:"",f=l?`<td${Em(l)}></td>`:"",h=l?l.querySelector("div"):null;return{rowHtml:o,firstCellText:c,secondCellText:u,firstCellHtmlNoText:m,secondCellHtmlNoText:p,secondCellWrapperHtml:f,secondCellInnerDivHtml:h?h.outerHTML:"",wrappedSecondCellHtml:l&&h?`<td${Em(l)}>${h.outerHTML}</td>`:"",secondCellInnerDivWrapperHtml:h?`<div${Em(h)}></div>`:"",secondCellTextHTML:d}}function G1(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function X1(e,t){const n=document.createElement("template");n.innerHTML=e;const r=n.content.firstElementChild;if(!r||r.tagName.toLowerCase()!=="td")return e;const o=r.querySelector("div");return o?o.textContent=G1(t)||" ":r.insertAdjacentText("afterbegin",G1(t)),r.outerHTML}function Fo(e){const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("editor").forEach(n=>{n.replaceWith(...Array.from(n.childNodes))}),t.content.querySelectorAll('[em-edit="active"]').forEach(n=>{n.removeAttribute("em-edit")}),t.innerHTML}function g9(e,t,n,r=!0){const o=document.createElement("template");o.innerHTML=e.trim();const i=o.content.querySelector(`div.${n}`);if(i){const s=i.closest("tr");if(s){const a=r?"beforebegin":"afterend";s.insertAdjacentHTML(a,t)}}return o.innerHTML}function b9(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 y9(e){return e.map(t=>({...t,cellOneText:t.cellOneText===""?" ":t.cellOneText,cellTwoText:t.cellTwoText===""?" ":t.cellTwoText}))}function v9(e){if(!Array.isArray(e)||e.length===0)return e;const t=" ",n=e.map(o=>{if(!o.cellOneText)return o;let i=o.cellOneText.trim();return i.endsWith(t)||(i+=t),{...o,cellOneText:i}}),r=Math.max(...n.map(o=>o.cellOneText?o.cellOneText.length:0));return n.map(o=>{if(!o.cellOneText)return o;let i=o.cellOneText;for(;i.length<r;)i+=t;return{...o,cellOneText:i}})}function Sm(e){const t=Array.from(e.querySelectorAll("tr")).map(r=>r.querySelectorAll("td")).filter(r=>r.length>=2).map(r=>r[0].querySelector("div")),n=v9(y9(b9(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 E9(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function S9(e,t,n){const r=[];let o=t;for(;o!==e;){const c=o.parentNode;if(!c)return null;r.unshift(Array.from(c.childNodes).indexOf(o)),o=c}const i=document.createRange();i.selectNodeContents(t),i.setStart(n.startContainer,n.startOffset);const s=i.extractContents(),a=e.cloneNode(!0),l=r.reduce((c,u)=>c.childNodes[u],a);return l.replaceChildren(s),[t,l].forEach(c=>{(c.textContent??"").trim()||(c.textContent=" ")}),{row:a,content:l}}function w9(e,t,n,r){const o=new DOMParser().parseFromString(e,"text/html"),i=o.querySelector(`div.${t}`);if(!i)return e;const s=i.closest("tr");if(!s)return e;const a=r==="ArrowUp"?s.previousElementSibling:s.nextElementSibling;if(a&&a.tagName==="TR"){const c=a.querySelectorAll("td")[1]||null;if(c){const u=c.querySelector("div");u&&u.classList.add(n)}}else i.classList.add(n);const l=o.querySelector("table");return l?l.outerHTML:e}function C9(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=s.querySelectorAll("div, strong");if(a.length===0){const l=document.createElement("div");l.innerHTML="&nbsp;",s.appendChild(l)}else a.forEach(l=>{let c=l.innerHTML.trim();!c||c.replace(r,"")===""?l.innerHTML="&nbsp;":(c=c.replace(r,""),c.endsWith("&nbsp;")||(c+="&nbsp;"),c=c.replace(/&nbsp;+$/,"&nbsp;"),l.innerHTML=c)})})}function A9(e){const t=`<table><tbody><tr>${e}</tr></tbody></table>`,n=new DOMParser().parseFromString(t,"text/html"),r=n.querySelector("div");return r&&(r.classList.add("remove-new-editor-element"),r.innerHTML.trim()?r.innerHTML+="&nbsp;":r.innerHTML="&nbsp;"),n.querySelector("td")?.outerHTML||""}function T9(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelectorAll("td");if(o.length>1){const i=o[1],s=(i.getAttribute("class")||"").split(" ").map(l=>l.trim()).filter(l=>l!=="");s.includes(t)||s.push(t);const a=s.join(" ");i.setAttribute("class",a)}}),n.innerHTML}var wm="em-element-list-ol",Cm="em-element-list-ul",_9="em-element-list-bullet",k9=`.${wm}, .${Cm}`,L9=["DIV","P","TD","H1","H2","H3","H4","H5","H6"],N9="div, p, td, h1, h2, h3, h4, h5, h6",Mn={LIST:"margin: 0; padding: 0 0 0 20px;",LIST_ITEM:"padding-bottom: 5px;"},us=null;function Am(e){const t=window.getSelection();if(t&&t.rangeCount>0){const n=t.getRangeAt(0);if(e.contains(n.startContainer))return{container:n.startContainer,offset:n.startOffset}}return us&&us.container.isConnected&&e.contains(us.container)?us:null}function x9(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:kl(r),nodes:[...r],startIndex:o,endIndex:s-1}),r=[],o=s+1):r.push(i)}),r.length>0&&t.push({html:kl(r),nodes:[...r],startIndex:o,endIndex:n.length-1}),t}function M9(e){const t=[],n=Array.from(e.childNodes);let r=[],o=0;const i=a=>{r.length>0&&(t.push({html:kl(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:kl([a]),nodes:[a],startIndex:l,endIndex:l}),o=l+1):r.push(a)}),i(n.length),t}function kl(e){const t=document.createElement("div");return e.forEach(n=>t.appendChild(n.cloneNode(!0))),t.innerHTML}function Tm(e,t){const n=Am(t);if(!n)return 0;const r=n.container;if(!t.contains(r))return 0;for(let o=0;o<e.length;o++)for(const i of e[o].nodes)if(i===r||i.contains(r))return o;if(r===t){const o=n.offset;for(let i=0;i<e.length;i++)if(o>=e[i].startIndex&&o<=e[i].endIndex)return i;for(let i=0;i<e.length;i++)if(o===e[i].startIndex)return i;for(let i=0;i<e.length;i++)if(e[i].startIndex>=o)return i;if(e.length>0)return e.length-1}return 0}function Y1(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 R9(e,t){const n=window.getSelection();if(!n||n.rangeCount===0){const a=Tm(e,t);return{start:a,end:a}}const r=n.getRangeAt(0);if(r.collapsed){const a=Tm(e,t);return{start:a,end:a}}const o=Tm(e,t),i=Y1(e,r.startContainer,t,o),s=Y1(e,r.endContainer,t,o);return{start:Math.min(i,s),end:Math.max(i,s)}}function O9(e){return e.querySelector("br")!==null}function P9(e){const t=Am(e);if(!t)return null;const n=t.container.nodeType===Node.ELEMENT_NODE?t.container:t.container.parentElement;if(!n)return null;const r=n.closest("ol, ul");return r&&e.contains(r)?r:null}function I9(e){const t=Am(e);if(!t)return;const{container:n,offset:r}=t;if(n!==e)return;const o=Array.from(e.childNodes),i=r>0?o[r-1]:null,s=r<o.length?o[r]:null,a=h=>h!==null&&h.nodeType===Node.ELEMENT_NODE&&h.tagName==="BR",l=h=>h!==null&&h.nodeType===Node.TEXT_NODE&&h.data.trim()==="",c=a(i),u=a(s),d=l(s),m=r>=o.length;if(!(c&&u||c&&m||r===0&&u||c&&d))return;let p;d?(p=s,p.data=" "):(p=document.createTextNode(" "),s?e.insertBefore(p,s):e.appendChild(p));const f=window.getSelection();if(f){const h=document.createRange();h.setStart(p,0),h.collapse(!0),f.removeAllRanges(),f.addRange(h)}us={container:p,offset:0}}function D9(e,t){const n=t?"ol":"ul";if(e.querySelector("ol, ul")){const r=P9(e);if(r){if(r.tagName.toLowerCase()===n)return;const s=document.createElement(n);for(Array.from(r.attributes).forEach(a=>{a.name!=="style"&&s.setAttribute(a.name,a.value)}),s.setAttribute("style",Mn.LIST);r.firstChild;)s.appendChild(r.firstChild);r.parentNode?.replaceChild(s,r);return}const o=e.querySelector(":scope > ol, :scope > ul"),i=Array.from(e.childNodes).some(s=>s.nodeType===Node.ELEMENT_NODE&&s.tagName==="BR");if(o&&!i){if(o.tagName.toLowerCase()===n)return;const s=document.createElement(n);for(Array.from(o.attributes).forEach(a=>{a.name!=="style"&&s.setAttribute(a.name,a.value)}),s.setAttribute("style",Mn.LIST);o.firstChild;)s.appendChild(o.firstChild);o.parentNode?.replaceChild(s,o);return}}O9(e)||e.querySelector(":scope > ol, :scope > ul")?(I9(e),B9(e,n)):K1(e,n)}function K1(e,t){const n=document.createElement(t);n.setAttribute("style",Mn.LIST);const r=document.createElement("li");r.setAttribute("style",Mn.LIST_ITEM);const o=e.innerHTML.trim();o?r.innerHTML=o:r.innerHTML="&nbsp;",n.appendChild(r),e.innerHTML="",e.appendChild(n),Z1(r)}function B9(e,t){const n=M9(e);if(n.length===0){K1(e,t);return}const{start:r,end:o}=R9(n,e),i=document.createElement(t);i.setAttribute("style",Mn.LIST);let s=null;for(let c=r;c<=o;c++){const u=document.createElement("li");u.setAttribute("style",Mn.LIST_ITEM),u.innerHTML=n[c].html.trim()||"&nbsp;",i.appendChild(u),s=u}const a=n.slice(0,r).map(c=>c.html).join("<br>"),l=n.slice(o+1).map(c=>c.html).join("<br>");if(e.innerHTML="",a.trim()){const c=document.createElement("span");for(c.innerHTML=a;c.firstChild;)e.appendChild(c.firstChild);e.appendChild(document.createElement("br"))}if(e.appendChild(i),l.trim()){e.appendChild(document.createElement("br"));const c=document.createElement("span");for(c.innerHTML=l;c.firstChild;)e.appendChild(c.firstChild)}s&&Z1(s)}function Z1(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 H9(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 F9(e,t){const n=x9(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 $9(e){const t=e.querySelector("ol, ul");if(!t)return;const n=H9(e,t),r=t.querySelectorAll("li"),o=[];r.forEach(s=>{const a=s.innerHTML.trim();a&&a!=="&nbsp;"&&o.push(a)});const i=o.join("<br>");i?t.outerHTML=i:t.outerHTML="&nbsp;",F9(e,n)}function _m(e){if(!e)return!1;const t=e.closest("ul, ol");return t?!t.closest(k9):!1}function W9(e,t,n){const r=s8()||e.elem,o=r.tagName==="EDITOR"&&r.firstChild?.nodeType===1?r.firstChild:r,i=e.elem.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')||e.elem,s=o.style.fontFamily||o.style.fontSize||o.style.lineHeight||o.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')?o:i,a=e.elem.closest('[style*="line-height"]')||s.querySelector('[style*="line-height"]')||s,l=r.closest('[class*="em-mob-font_size"], [style*="font-size"]')||r,c=r.closest('[class*="em-mob-line_height"]')||r.closest('[style*="line-height"]')||r,u=We({elem:l}),d=We({elem:c}),m=Q1(e.elem,n),p=Ze(o,"strong","b"),f=s!==o?Ze(s,"strong","b"):!1,h=e.elem&&o&&e.elem.isConnected&&(o===e.elem||o.contains(e.elem))?Ze(e.elem,"strong","b"):!1,y=p||f||h,v=Tl(s),A=y||v,k={type:"text",caption:t.TEXT,fontFamily:is(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:Al(a),lineHeightDim:"px",textAlign:k1(e.elem),textStrong:A,textItalic:Ze(e.elem,"i","em")||!s.closest('[style*="font-style: normal"]')&&s.style?.fontStyle==="italic",textStrikethrough:Ze(e.elem,"s","strike")||(s.style?.textDecoration?.includes("line-through")??!1),textUnderline:Ze(e.elem,"u")||(s.style?.textDecoration?.includes("underline")??!1)||!s.style?.textDecoration&&(e.elem.tagName==="A"&&e.elem.hasAttribute("href")||L1()),textColor:X(e.elem.closest('[style*="color"]')?.style.color)||X(getComputedStyle(e.elem).color)||"",textBackgroundColor:U9(e.elem),mobileFontSize:{value:u.mobileFontSize,dim:u.mobileFontSizeDim||"px"},mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},mobileTextAlign:pm(e.elem),linkHref:(()=>{const S=s.closest("a");if(!S)return;const b=S.getAttribute("href");if(b!==null)return b})(),textAnchor:(()=>{const S=s.closest("a");if(S&&!S.hasAttribute("href"))return S.getAttribute("name")?.trim()||void 0})(),textLink:(()=>{const S=s.closest("a");return S?!!S.hasAttribute("href"):Ze(e.elem,"a")||L1()})(),textReplacer:n.variableElement(e.elem),list:m,standardList:J1(e.elem),textSuperscript:Ze(e.elem,"sup"),textSubscript:Ze(e.elem,"sub")};return ss(r)&&(k.showOnMobile=!0),k}function Q1(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?X(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?is(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 J1(e){return _m(e)?{listTypeOL:!!e.querySelector("ol")||!!e.closest("ol"),listTypeUL:!!e.querySelector("ul")||!!e.closest("ul")}:{listTypeOL:!1,listTypeUL:!1}}function km(e){if(!e)return!1;const t=e.trim().toLowerCase();return t!=="transparent"&&t!=="inherit"}var q9=new Set(["A","B","EM","I","MARK","S","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","U"]);function z9(e){let t=e;for(;t&&q9.has(t.tagName);){const n=t.style.backgroundColor;if(km(n))return n;t=t.parentElement}return""}function V9(e,t,n){let r=e;for(;r;){const o=r.style.getPropertyValue(t);if(km(o))return o;if(n&&r===n)break;r=r.parentElement}return""}function U9(e){const t=z9(e);if(km(t))return X(t)||"";if(e.closest(".em-element-custom-table"))return X(Rr(e,"background-color"))||"";const n=e.closest("div");return X(V9(e,"background-color",n))||""}function j9(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 G9(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,m=e.elem.closest('[class*="em-mob-line_height"]')||e.elem.closest('[style*="line-height"]')||e.elem,p=We({elem:d}),f=We({elem:m}),h=Q1(e.elem,n),y={type:"text",caption:t.TEXT,linkHref:(()=>{const v=e.elem.getAttribute("href");if(v!==null)return v})(),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:is(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:Al(e.elem),lineHeightDim:"px",textAlign:k1(e.elem),textStrong:Ze(u,"strong","b")||Tl(u),textItalic:Ze(u,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem.style?.fontStyle==="italic",textStrikethrough:Ze(u,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1),textUnderline:Ze(u,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"&&e.elem.hasAttribute("href"),textColor:X(e.elem.tagName==="A"?Rr(e.elem.querySelector('[style*="color"]'),"color"):Rr(e.elem,"color"))||X(getComputedStyle(e.elem).color)||"",textBackgroundColor:X(e.elem.tagName==="A"?Rr(e.elem.querySelector('[style*="background-color"]'),"background-color"):Rr(e.elem,"background-color"))||"",mobileFontSize:{value:p.mobileFontSize,dim:p.mobileFontSizeDim||"px"},mobileLineHeight:{value:f.mobileLineHeight,dim:"px"},mobileTextAlign:pm(e.elem),textReplacer:i(e.elem),list:h,standardList:J1(e.elem),textSuperscript:Ze(e.elem,"sup"),textSubscript:Ze(e.elem,"sub")};return ss(e.elem)&&(y.showOnMobile=!0),y}function eE(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function X9(e,t){const n=e.elem,r=We({elem:n}),o=eE(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 Y9(e,t){const n=e.elem,r=We({elem:n}),o=eE(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 K9(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 Z9(e){return e.tagName!=="DIV"?!1:!e.style.fontFamily&&!!e.style.height&&!!e.style.lineHeight&&!!e.style.fontSize}function Q9(e,t){return e.elem.tagName==="TD"?X9(e,t):Y9(e,t)}var tE={START_POSITION:"remove-start-element-position",NEW_EDITOR:"remove-new-editor-element",ACTIVE_ELEMENT:"remove-active-element"},nE={TRIM_SPACES:/^(\s|&nbsp;)+|(\s|&nbsp;)+$/g,LT:/&lt;/g,GT:/&gt;/g,EMPTY_TEXT:/^(?:\s|&nbsp;)*$/};function rE(e,t){if(!e)return!1;const n=e.closest("tr");return n?n.closest("table")?.classList.contains(t)??!1:!1}function Ll(e){const t=rE(e,wm),n=rE(e,Cm),r=t||n;let o=null;return e&&r&&(o=e.closest("table.em-element-list-ol")||e.closest("table.em-element-list-ul")),{classNameOl:wm,classNameUl:Cm,classNameBullet:_9,isListOL:t,isListUL:n,isList:r,listType:t?"ol":n?"ul":null,tableElement:o}}function J9(e){if(!e)return null;const t=e.closest("tr");return t?t.querySelector("td:first-child div:first-child"):null}function eB(e){return e?e.querySelector(".em-element-list-ol")||e.querySelector(".em-element-list-ul"):null}function tB(e=Object.values(tE)){e.forEach(t=>{document.querySelectorAll(`.${t}`).forEach(n=>{n.classList.remove(t)})})}function nB(e){for(const t of e.classList)if(t.startsWith("em-element-"))return!1;return!0}function oE(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&&oE(n,t)}}function rB(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 oB(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 iB(e){if(!e)return null;try{return e.rangeCount>0?e.getRangeAt(0):null}catch{return null}}var sB="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub";function aB(e,t=sB){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 lB(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 cB(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 uB(e,t,n,r){if(!document.body.classList.contains("mceNonEditable")&&!(!t&&n)){if(r.removeAllAttributes("em-edit"),e.tagName!=="TABLE"){Gc(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 dB(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 mB(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=Pd(n)??n),n}function fB(e,t){const{elem:n,isCellCustomTable:r,listContext:o,requestElemBullet:i,variableElement:s}=e,{isListOL:a,isListUL:l,isList:c}=o;return{Locale:t.Locale,isProgrammaticSelection:t.isProgrammaticSelection,isCellCustomTable:r,extractorContext:{variableElement:s,requestElemBullet:i,isElementListOL:a,isElementListUL:l,isElementList:c},customTableContext:{getElementTdDiv:t.getElementTdDiv,parseTableElementToModel:t.parseTableElementToModel,extractBorderRadius:t.extractBorderRadius,parseBackgroundStyles:t.parseBackgroundStyles,getFontFamilyFromElement:t.getFontFamilyFromElement,textHasStyle:t.textHasStyle,isElementHasBold:t.isElementHasBold,getLineHeghtInPixels:t.getLineHeghtInPixels,activeCell:t.activeCell,CLASS_FOR_BASIC_CELL:t.CLASS_FOR_BASIC_CELL,requestElemWithStyle:t.requestElemWithStyle},elementContext:{getElementTdDiv:t.getElementTdDiv,getLineHeghtInPixels:t.getLineHeghtInPixels},linkTextContext:{variableElement:s,requestElemBullet:i,isElementListOL:a,isElementListUL:l,isElementList:c,findElementWithSelectedText:t.findElementWithSelectedText,selectedText:t.getSelectedText()},_isCarouselElement:t._isCarouselElement,_isAccordionElement:t._isAccordionElement,_isSocialBlockElement:t._isSocialBlockElement,_isImageElement:t._isImageElement,_isLinkElement:t._isLinkElement,_isButtonElement:t._isButtonElement,_isTableElement:t._isTableElement,_isCustomTableElement:t._isCustomTableElement,_isAtomElement:t._isAtomElement,_isTdColumnGroup:t._isTdColumnGroup,_isTdStructure:t._isTdStructure,_isEmptyTd:t._isEmptyTd,_isTdCell:t._isTdCell,_isVindentTd:t._isVindentTd,_isVindentDiv:t._isVindentDiv,_isFloatBlockElement:t._isFloatBlockElement,_isDivTextElement:t._isDivTextElement,_isInlineButtonElement:t._isInlineButtonElement,_extractTextSettings:t._extractTextSettings,_extractCarouselSettings:t._extractCarouselSettings,_extractAccordionSettings:t._extractAccordionSettings,_extractSocialSettings:t._extractSocialSettings,_extractImgSettings:t._extractImgSettings,_extractButtonSettings:t._extractButtonSettings,_extractLinkTextSettings:t._extractLinkTextSettings,_extractTableSettings:t._extractTableSettings,_extractCustomTableSettings:t._extractCustomTableSettings,_extractAtomElementSettings:t._extractAtomElementSettings,_extractProgrammaticElementSettings:t._extractProgrammaticElementSettings,_extractTdColumnGroupSettings:t._extractTdColumnGroupSettings,_extractTdStructureSettings:t._extractTdStructureSettings,_extractTdCellSettings:t._extractTdCellSettings,_extractVindentSettings:t._extractVindentSettings,_extractFloatBlockSettings:t._extractFloatBlockSettings,_extractDivContainerSettings:t._extractDivContainerSettings,_clearActiveEditElements:t._clearActiveEditElements,HTMLDocument:t.HTMLDocument,parseFromString:t.parseFromString,getParentElementOfSelection:t.getParentElementOfSelection}}function pB(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 hB(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"&&_m(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(pB(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 gB={_isCarouselElement:g8,_isAccordionElement:ZD,_isSocialBlockElement:q8,_isImageElement:x8,_isLinkElement:m8,_isButtonElement:d8,_isTableElement:Y8,_isCustomTableElement:b8,_isAtomElement:E8,_isTdColumnGroup:K8,_isTdStructure:Z8,_isEmptyTd:Q8,_isTdCell:J8,_isVindentTd:K9,_isVindentDiv:Z9,_isFloatBlockElement:L8,_isDivTextElement:j9,_isInlineButtonElement:f8,_extractTextSettings:W9,_extractCarouselSettings:p8,_extractAccordionSettings:KD,_extractSocialSettings:z8,_extractImgSettings:N8,_extractButtonSettings:u8,_extractLinkTextSettings:G9,_extractTableSettings:X8,_extractCustomTableSettings:y8,_extractAtomElementSettings:C8,_extractProgrammaticElementSettings:A8,_extractTdColumnGroupSettings:t9,_extractTdStructureSettings:n9,_extractTdCellSettings:r9,_extractVindentSettings:Q9,_extractFloatBlockSettings:k8,_extractDivContainerSettings:v8,_clearActiveEditElements:Y_};function bB(e){const t=e.programmaticSelection??{get:()=>!!x.get("isProgrammaticSelection"),reset:()=>x.set("isProgrammaticSelection",!1)},n=()=>{const o={operation:"application_element_settings_set",settings:e.getMapObj().unescape({parent:void 0,nextElem:!1,prevElem:!1}),type:null};Z.send(o)},r=o=>{if(x.isActiveElementLocked())return;const i=o.elem??document.querySelector("[em-edit]");try{if(x.increment("activeElementLocked"),Jn("em-edit"),!i){setTimeout(()=>{const y=document.querySelector("[em-edit]");y?.isConnected?r({elem:y}):n()},0);return}if(i.closest(".em-prevent-action"))return;const s=mB(i,{getVariableByIcon:cl,htmlDocument:e.htmlDocument,findOutermostParentWithText:Qc,sendResizeEvent:Xv}),a=s.tagName==="EDITOR"&&s.firstChild?.nodeType===1?s.firstChild:s,l=Ll(s),c=window.getSelection()?.isCollapsed??!0;uB(s,c,!!s.querySelector("editor"),{removeAllAttributes:Jn});const u={...gB,HTMLDocument:e.htmlDocument,parseFromString:Te,getParentElementOfSelection:da,getSelectedText:Ke,findElementWithSelectedText:mi,parseTableElementToModel:ts,extractBorderRadius:fD,parseBackgroundStyles:rD,isElementHasBold:$_,Locale:rs(),isProgrammaticSelection:t.get(),getElementTdDiv:HD,getLineHeghtInPixels:Al,getFontFamilyFromElement:y=>oB(y,a),textHasStyle:Ze,activeCell:x.get("activeCell"),CLASS_FOR_BASIC_CELL:se,requestElemWithStyle:a},d=fB({elem:s,isCellCustomTable:!!s.closest(".em-element-custom-table"),listContext:{isListOL:l.isListOL,isListUL:l.isListUL,isList:l.isList},requestElemBullet:l.isList?J9(s):null,variableElement:(y,v=!1)=>dB(v,{getSelectedText:Ke,getRangeFromSelection:iB})},u),m=hB(s,c,d),p={operation:"application_element_settings_set",type:m.type,caption:m.caption,settings:m.settings},f=cB(s,m,p,{removeAllAttributes:Jn});if(f.isProgrammaticSelectionReset&&t.reset(),f.shouldReturn)return;const h=lB({elem:s,message:p,activateSection:o.activateSection},{getElementParentCaption:A1,getStructureColumns:FD,getUsedColors:e1,getElementPath:YD,getCurrentElementPath:VD,mapObj:e.getMapObj(),commonStyles:x.get("commonStyles"),...e.enrichExtras()});x.update({elementPath:h.elementPath}),e.fingerprint.remember(s),Z.send(h.message)}finally{Promise.resolve().then(()=>{e.fingerprint.remember(document.querySelector("[em-edit]")),x.decrement("activeElementLocked")})}};return r}function iE(){return x.get("emailWidth")}function yB(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 Lm(e){const t=[...e.children].filter(r=>r.tagName==="TR");if(t.length)return t.map(r=>Vt(r)).join(`
89
- `);const n=e.querySelector("tr");return n?Vt(n):Ct(e)}function Nm(e,t){const n=iE(),r=document.createElement("table");r.replaceChildren(...Te(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"),m=parseFloat(String(o*c));a.style.width=m+"px",u.setAttribute("width",String(m-d)),ma({elem:a,width:m})});else{const s=r.querySelector('div[style*="inline-block"]');s.style.maxWidth=o+"px",ma({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=uh(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(!yB(a))return;const m=a.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),p=m?parseFloat(m.getAttribute("width")||"0"):0,f=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").length;let h=0,y=0;a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(k=>{if(k.getAttribute("width")&&!k.classList.contains("em-insert-ignore")){const S=parseFloat(k.getAttribute("width"))/i,b=Math.round(parseFloat(String(o*S))-p/(f*2));k.setAttribute("width",String(b)),h+=b}});const v=o-(u+d+p*(f-1)+h);a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(k=>{if(k.getAttribute("width")&&!k.classList.contains("em-insert-ignore")){const S=parseFloat(k.getAttribute("width"))+Math.round(v/f);y+=S,k.setAttribute("width",String(S)),k.querySelector("img")&&k.querySelectorAll("img").forEach(b=>{parseFloat(b.getAttribute("width")||"0")>parseFloat(k.getAttribute("width"))+Math.round(v/f)&&(b.setAttribute("width",k.getAttribute("width")),b.style.maxWidth=k.getAttribute("width")+"px")})}}),y=y+p*(f-1)+u+d;const A=o-y;if(A!==0&&h>0){const k=a.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(k&&!k.classList.contains("em-insert-ignore")){const S=parseFloat(k.getAttribute("width")||"0");k.setAttribute("width",String(S+A))}else{const S=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let b=S.length-1;b>=0;b--){const E=S[b];if(E.classList.contains("em-insert-ignore"))continue;const C=parseFloat(E.getAttribute("width")||"0");E.setAttribute("width",String(C+A));break}}}}else if(l.getAttribute("width")&&!l.classList.contains("em-insert-ignore")){const m=Math.round(o-u-d);l.setAttribute("width",String(m))}})}return Lm(r)}function xm(e){const t=document.createElement("table");t.replaceChildren(...Te(e));const n=!!document.querySelector(".noresp-em-narrow-table");return t.querySelectorAll(".em-mob-wrap[width], .noresp-em-mob-wrap[width]").forEach(r=>{const o=parseFloat(r.getAttribute("width")||"0");o&&r.querySelectorAll('[em="atom"] img:not(.em-countdown)').forEach(i=>{parseFloat(i.getAttribute("width")||"0")<=o||(i.setAttribute("width",String(o)),n||(i.style.maxWidth=o+"px"))})}),Lm(t)}function Mm(e,t){const n=iE(),r=document.createElement("table");r.replaceChildren(...Te(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",ma({elem:s,width:o})),Lm(r)}function Nl(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,m=parseFloat(u.paddingRight)||0;(d>0||m>0)&&(s+=d+m),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 vB(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 sE(e,t,n){const r=document.createElement(n);try{if(typeof t=="string")r.textContent=t||e.toString();else if(t instanceof DocumentFragment)r.appendChild(t);else if(t instanceof HTMLElement)for(;t.firstChild;)r.appendChild(t.firstChild);else r.textContent=e.toString();e.deleteContents(),e.insertNode(r)}catch{return null}return r}function EB(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 SB(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 wB(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 CB(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 AB(e,t=10){const n=e.length;return n===0?!1:(e.match(/[а-яА-ЯёЁ]/g)||[]).length/n*100>t}var TB={bold:"strong|s|b",italic:"em|i",strike:"strike",underline:"u",strikeUnderline:"strike|u"};function ds(e,t){const n=TB[t]||t,r=new RegExp(`<\\/?(${n})>`,"gi");return e.replaceAll(r,"")}var _B=["strong","em","strike","sub","sup","b","i","s","u"];function kB(e,t){if(t)for(const n of _B)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 LB(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 NB=new Set(["alt","title","link"]);function xB(e,t,n){const r=Object.keys(n.settings??{});return n.type==="img"&&r.length>0&&r.every(o=>NB.has(o))&&e.parentNode===t.parent}function MB(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 RB(e,t,n,r,o){const i=o.getMappedParent(e);if(!i?.isConnected||xB(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"),m=>m.hasAttribute("expanded")):[],c=o.parseFromString(o.getOuterHtml(i))[0];i.parentNode?.replaceChild(c,i);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:()=>{c.querySelectorAll("section").forEach((m,p)=>{l[p]&&m.setAttribute("expanded","")})}}}function OB(e,t){const{activeElement:n}=t;let r=!1;if(!e)return r;const o=n.closest("a"),i=n.closest("td"),s=i?dr(i):null,a=o?dr(o):null,l=!!s&&!a,c=Qd(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 f=n.closest("td")?.closest("table")?.closest("div, p, td");f&&(f.style.textAlign?f.style.textAlign=e.align:f.setAttribute("align",e.align))}else if(e.align===""){const f=n.closest("td")?.closest("table")?.closest("div, p, td");f&&(f.style.textAlign?f.style.removeProperty("text-align"):f.removeAttribute("align"))}if(e.textAlign){const f=n.closest("td");f&&(f.style.textAlign?f.style.textAlign=e.textAlign:f.setAttribute("align",e.textAlign))}else if(e.textAlign===""){const f=n.closest("td");f&&(f.style.textAlign?f.style.removeProperty("text-align"):f.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 f=n.closest("table");f&&(e.width.value?(f.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),f.style.width=e.width.value+e.width.dim):(f.removeAttribute("width"),f.style.removeProperty("width")))}if(e.height){const f=n.closest("td"),h=n.closest("a");if(e.height.value){if(f&&(f.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),f.style.height=e.height.value+e.height.dim),h){const y=e.height.value+e.height.dim;h.style.height=y,h.style.lineHeight=y,h.firstElementChild&&(h.firstElementChild.style.lineHeight=y);const v=h.closest("editor")||h.querySelector("editor");v&&(v.style.height=y,v.style.lineHeight=y)}}else if(f&&(f.removeAttribute("height"),f.style.removeProperty("height")),h){h.style.removeProperty("height"),h.style.removeProperty("line-height");const y=h.closest("editor")||h.querySelector("editor");y&&(y.style.removeProperty("height"),y.style.removeProperty("line-height"))}}if(e.border&&u&&t.setElementBorder({settings:e,elem:u}),e.boxShadow&&u&&t.setElementBoxShadow({settings:e,elem:u}),e.backgroundColor!==void 0&&u&&(e.backgroundColor===""?(u.removeAttribute("bgcolor"),u.style.removeProperty("background-color")):(u.tagName==="TD"&&u.setAttribute("bgcolor",e.backgroundColor),u.style.backgroundColor=e.backgroundColor)),e.backgroundImage){const f=n.closest("td");f&&(e.backgroundImage[0].value===""?(f.style.removeProperty("background-image"),f.removeAttribute("background")):(f.style.removeProperty("background-image"),Tt(f,"background",IB(e))))}if(e.backgroundPositionX!==void 0){const f=n.closest("td");f&&(e.backgroundPositionX===""?f.style.removeProperty("background-position-x"):f.style.backgroundPositionX=e.backgroundPositionX)}if(e.backgroundPositionY!==void 0){const f=n.closest("td");f&&(e.backgroundPositionY===""?f.style.removeProperty("background-position-y"):f.style.backgroundPositionY=e.backgroundPositionY)}if(e.backgroundRepeat){const f=n.closest("td");f&&(e.backgroundRepeat==="none"?f.style.removeProperty("background-repeat"):f.style.backgroundRepeat=e.backgroundRepeat)}if(e.backgroundSize!==void 0){const f=n.closest("td");f&&(e.backgroundSize===""?f.style.removeProperty("background-size"):f.style.backgroundSize=e.backgroundSize)}if(e.padding){const f=n.closest("a");f&&(e.padding.all!==void 0?(f.style.paddingTop=e.padding.all+"px",f.style.paddingRight=e.padding.all+"px",f.style.paddingBottom=e.padding.all+"px",f.style.paddingLeft=e.padding.all+"px"):(e.padding.top!==void 0&&(f.style.paddingTop=e.padding.top+"px"),e.padding.right!==void 0&&(f.style.paddingRight=e.padding.right+"px"),e.padding.bottom!==void 0&&(f.style.paddingBottom=e.padding.bottom+"px"),e.padding.left!==void 0&&(f.style.paddingLeft=e.padding.left+"px")))}if(e.borderRadius&&u&&t.setElementBorderRadius({settings:e,elem:u}),e.mobileWidth){const f=n.closest("table");f&&t.setElementMobileWidth({settings:e,elem:f}),r=!0}if(e.mobileHeight){const f=n.closest("td");f&&t.setElementMobileHeight({settings:e,elem:f}),t.setElementMobileLineHeight({settings:e,elem:n}),r=!0}if(e.mobileBorder){const f=n.closest("td");f&&t.setElementMobileBorder({settings:e,elem:f}),r=!0}if(e.mobileBorderRadius){const f=n.closest("td");f&&t.setElementMobileBorderRadius({settings:e,elem:f}),r=!0}if(e.mobileBoxShadow){const f=n.closest("td");f&&t.setElementMobileBoxShadow({settings:e,elem:f}),r=!0}if(e.mobileTextAlign){const f=os(n);f&&t.setElementMobileAlign({settings:e,elem:f,fieldName:"mobileTextAlign"}),r=!0}if(e.mobileAlign){const f=n.closest("td")?.closest("table");f&&t.setElementMobileTableAlign({settings:e,elem:f}),r=!0}if(e.mobileVerticalAlign){const f=n.closest("td");f&&t.setElementMobileVerticalAlign({settings:e,elem:f}),r=!0}if(e.mobileBackgroundColor){const f=n.closest("td");f&&t.setElementMobileBackgroundColor({settings:e,elem:f}),r=!0}if(e.mobileBackgroundImage){const f=n.closest("td");f&&t.setElementMobileBackgroundImage({settings:e,elem:f}),r=!0}if(e.mobileBackgroundPositionX){const f=n.closest("td");f&&t.setElementMobileBackgroundPositionX({settings:e,elem:f}),r=!0}if(e.mobileBackgroundPositionY){const f=n.closest("td");f&&t.setElementMobileBackgroundPositionY({settings:e,elem:f}),r=!0}if(e.mobileBackgroundRepeat){const f=n.closest("td");f&&t.setElementMobileBackgroundRepeat({settings:e,elem:f}),r=!0}const d=e;if(d.mobileBackgroundSize){const f=n.closest("td");f&&t.setElementMobileBackgroundSize?.({settings:d,elem:f}),r=!0}if(e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show){const f=n.closest("table");f&&t.setElementShow({settings:e,elem:f}),r=!0}const m=n.closest("a");if(m&&e.textColor!==void 0){const f=String(e.textColor||"");m.style.color=f,m.querySelectorAll('span[style*="color"], font[color]').forEach(h=>{h.style.removeProperty("color"),h.removeAttribute("color")})}if(m&&e.textBackgroundColor!==void 0){const f=String(e.textBackgroundColor||"");m.style.backgroundColor=f,m.querySelectorAll('span[style*="background-color"]').forEach(h=>{h.style.removeProperty("background-color")})}const p=["textColor","textBackgroundColor"];if(t.textStyleProperties.filter(f=>!p.includes(f)&&e.hasOwnProperty(f)).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&&PB(e.textReplacer,n,t.compareStrings),e.outlookRounding===!0?em(n,e):e.outlookRounding===!1?a4(n):(s||c)&&em(n,e),i&&Zi(i,e,"inside"),r}function PB(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 m=e.replace(/~~.*$/,""),p=document.createElement("em-replace");p.setAttribute("text",m),o.surroundContents(p)}}if(!l&&r.rangeCount>0&&o.collapsed){let u=document.querySelector("em-replace");if(u){const d=document.querySelectorAll("em-replace"),m=/~$/;l=Array.prototype.find.call(d,p=>{const f=e,h=p.textContent||"";return f.length===1&&m.test(h)?!0:n(h,f)}),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 IB(e){return e.backgroundImage?.[0]?.value??""}function DB(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),Zi(n,e,"inside"),r}function Rm(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Rm({elem:e.elem.previousSibling,width:e.width})}function BB(e,t){const n=t.activeElement;let r=!1;if(!e)return r;e.exportAsPicture?n.setAttribute("em-operation","exportAsPicture"):n.getAttribute("em-operation")==="exportAsPicture"&&n.removeAttribute("em-operation"),e.align?n.setAttribute("align",e.align):e.align===""&&n.removeAttribute("align"),e.width&&(e.width.value?(n.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),n.style.width=e.width.value+e.width.dim,e.width.dim==="px"&&Rm({elem:n,width:e.width.value})):(n.removeAttribute("width"),n.style.removeProperty("width"))),e.maxWidth&&(e.maxWidth.value?(n.style.maxWidth=e.maxWidth.value+e.maxWidth.dim,Rm({elem:n,width:e.maxWidth.value})):n.style.removeProperty("max-width")),e.minWidth&&(e.minWidth.value?n.style.minWidth=e.minWidth.value+e.minWidth.dim:n.style.removeProperty("min-width")),e.border&&t.setElementBorder({settings:e,elem:n}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:n}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(n.removeAttribute("bgcolor"),n.style.removeProperty("background-color")):(n.setAttribute("bgcolor",e.backgroundColor),n.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(n.style.removeProperty("background-image"),n.removeAttribute("background")):(n.style.removeProperty("background-image"),n.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",Tt(n,"background",HB(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),Zi(n,e,"around"),r}function HB(e){return e.backgroundImage?.[0]?.value??""}function ms(e){return!(!e.startsWith("#")||e.indexOf("#",1)!==-1)}function FB(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),ms(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+")",Tt(n,"background",qB(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))&&WB(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&&($B(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}),Zi(n,e,"inside"),r}function $B(e,t,n){n.setElementMobileAlign({settings:e,elem:t});const r=e.mobileAlign?.classNamePrefix||"em-mob-text_align-";o8(t,(s,a)=>{i8(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 WB(e,t){const n=t.activeElement,r=t.removeEditorTags(t.isElementListContainer.outerHTML);n.innerHTML=`<td em-edit="active">${t.addClassToSecondCell(r,"em-list-temp-class")}</td>`;const o=window.getSelection();if(!o||o.rangeCount===0)return;let i=o.getRangeAt(0);const s=n.querySelectorAll(".em-list-temp-class");if(s.length>0){t.isProgrammaticSelection.value=!0;for(let a=0;a<s.length;a++){const l=s[a].querySelector("div");if(!l)continue;t.wrapEditor(l,!0),i=o.getRangeAt(0),i.selectNode(l),t.addNewRange(i);const c=l.innerHTML!=="&nbsp;"||l.innerHTML==="&nbsp;"&&(e.fontSize||e.textColor||e.lineHeight);if(t.textStyleProperties.some(u=>e.hasOwnProperty(u))&&c)try{t.toggleTextStyle(l,{settings:e})}catch{}}n.querySelectorAll(".em-list-temp-class").forEach(a=>a.classList.remove("em-list-temp-class")),n.removeAttribute("em-edit"),n.setAttribute("em-edit","active"),setTimeout(()=>{t.isProgrammaticSelection.value=!1},100),i=o.getRangeAt(0),i.selectNode(n),t.addNewRange(i)}}function qB(e){return e.backgroundImage?.[0]?.value??""}function Om(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Om({elem:e.elem.previousSibling,width:e.width})}function aE(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 zB(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,Om({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,Om({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,aE(n,n.style.verticalAlign)),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:n}),r=!0),e.mobileContentWidth&&(t.setElementMobileContentWidth({settings:e,elem:n.firstElementChild}),r=!0),e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),r}function Pm(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Pm({elem:e.elem.previousSibling,width:e.width})}function xl(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 Ml(e){return e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement||null}function Im(e){return e.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement||null}function VB(e,t){const n=t.activeElement;if(xl(n)){const r=Ml(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((o,i)=>{o.setAttribute("width",e.items[i])}),t.setPercentsForColumns(r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"))}else{const r=Im(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach((o,i)=>{const s=o;s.style.width=e.items[i]+e.gap+"px",Pm({elem:s.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",e.items[i])})}}function UB(e,t){const n=t.activeElement;if(!xl(n))return;const r=n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement:n.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement;if(!r)return;const o=r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),i=o.length,s=e.items.length,a=e.gap;i>=s?o.forEach((l,c)=>{if(c<s)l.setAttribute("width",e.items[c]);else{const u=l.previousElementSibling;(u?.classList.contains("em-mob-wrap")||u?.classList.contains("noresp-em-mob-wrap"))&&u?.remove(),l.remove()}}):(o.forEach((l,c)=>{l.setAttribute("width",e.items[c])}),e.items.forEach((l,c)=>{let u="";r.querySelector(".em-mob-wrap")?u=`<td width="${a}" class="em-mob-wrap"></td>
90
- <td width="${l}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:r.querySelector(".noresp-em-mob-wrap")&&(u=`<td width="${a}" class="noresp-em-mob-wrap"></td>
91
- <td width="${l}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`),c>=i&&u&&qe(r,"beforeend",u)}))}function jB(e,t){const n=t.activeElement;if(xl(n)){const r=Ml(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(o=>{o.setAttribute("valign",e.valign)})}else{const r=Im(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach(o=>{o.style.verticalAlign=e.valign,aE(o,o.style.verticalAlign)})}}function GB(e,t){const n=t.activeElement;if(xl(n)){const r=Ml(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((o,i)=>{o.setAttribute("width",e.items[i])}),t.setPercentsForColumns(r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)")),r.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(o=>{o.setAttribute("width",e.gap)})}else{const r=Im(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach((o,i)=>{const s=o;s.style.width=e.items[i]+e.gap+"px",Pm({elem:s.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",e.items[i])})}}function XB(e,t){const n=t.activeElement;let r=!1;const o=Ml(n);return o&&o.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(i=>{t.setElementMobileHeight({settings:e,elem:i}),r=!0}),r}var Dm="amp-img";function YB(e){const t=O1(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 lE(e){return e==null||e===""?null:Number(e)}function KB(e){return{src:e.src??"",alt:e.alt??"",title:e.title??"",width:lE(e.width?.value),height:lE(e.height?.value),link:e.link||null,imgReplacer:e.imgReplacer??""}}function Bm(e,t,n){const r=e.closest(n);return r&&r!==t&&t.contains(r)?r:null}function ZB(e,t){let n=e;for(;n.parentElement&&n.parentElement!==t;)n=n.parentElement;if(n.parentElement===t&&n.querySelectorAll(Dm).length<=1)return n;let r=e;for(;r.parentElement&&r.parentElement!==t&&(r.parentElement.tagName==="A"||r.parentElement.tagName==="EM-REPLACE");)r=r.parentElement;return r}function cE(e){e.replaceWith(...Array.from(e.childNodes))}function uE(e,t){e.parentNode?.insertBefore(t,e),t.appendChild(e)}function QB(e,t,n,r){if(r.src!==n.src&&Tt(e,"src",r.src),r.alt!==n.alt&&e.setAttribute("alt",r.alt),r.title!==n.title&&e.setAttribute("title",r.title),r.width!==n.width&&e.setAttribute("width",String(r.width??"")),r.height!==n.height&&e.setAttribute("height",String(r.height??"")),r.imgReplacer!==n.imgReplacer){const o=Bm(e,t,"em-replace");if(!r.imgReplacer)o&&cE(o);else if(o)Tt(o,"src",r.imgReplacer);else{const i=document.createElement("em-replace");Tt(i,"src",r.imgReplacer),uE(e,i)}}if(r.link!==n.link){const o=Bm(e,t,"a");if(!r.link)o&&cE(o);else if(o)o.setAttribute("href",r.link);else{const i=document.createElement("a");i.setAttribute("href",r.link),uE(Bm(e,t,"em-replace")??e,i)}}}function JB(e){const t=document.createElement(Dm);Tt(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");Tt(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 e6(e){return e.some(t=>t.slideIndex!==void 0)?e.map(t=>t.slideIndex):e.map((t,n)=>n)}function t6(e,t){const n=Array.from(e.querySelectorAll(Dm)),r=new Set,o=[];e6(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),QB(a,e,YB(a),KB(t[s]))}),n.filter(i=>!r.has(i)).forEach(i=>ZB(i,e).remove()),o.forEach(i=>e.appendChild(JB(i)))}function n6(e,t){const n=e,r=t.activeElement.closest("amp-carousel");if(!r)return;const o=t.HTMLDocument.getOuterHtml(r),i=t.parseFromString(o)[0];typeof n.loop=="boolean"&&(n.loop?i.setAttribute("loop",""):i.removeAttribute("loop")),typeof n.autoplay=="boolean"&&(n.autoplay?i.setAttribute("autoplay",""):i.removeAttribute("autoplay")),Array.isArray(n.carouselImages)&&t6(i,n.carouselImages),"borderRadius"in n&&t.setElementBorderRadius({settings:{borderRadius:n.borderRadius},elem:i}),i.setAttribute("em-edit","active"),r.replaceWith(i),t.commit(!0)}function r6(e,t){const n=e,r=t.activeElement.closest("amp-accordion");if(!r)return;const o=t.HTMLDocument.getOuterHtml(r),i=t.parseFromString(o)[0];n.animate?i.setAttribute("animate",""):i.removeAttribute("animate"),n.expandSingleSection?i.setAttribute("expand-single-section",""):i.removeAttribute("expand-single-section"),i.querySelectorAll("section").forEach((s,a)=>{n.sections[a]?.expanded?s.setAttribute("expanded",""):s.removeAttribute("expanded")}),i.setAttribute("em-edit","active"),r.replaceWith(i),t.commit(!0)}var Rn={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function o6(e){return e.closest('table[em-type="social"]')}function dE(e){const t=e.querySelector(":scope > tr");if(t){const r=t.querySelector(":scope > td");if(r instanceof HTMLElement)return r}const n=e.querySelector("tbody > tr");if(n){const r=n.querySelector(":scope > td");if(r instanceof HTMLElement)return r}return null}function i6(e,t,n){const r=dE(e),o=dE(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 On(e){return String(e??"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function s6(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function a6(){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 l6(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=a6();if(!n)return t;try{return new URL(t,n).href}catch{return t}}function c6(e){return e>0?`<td width="${e}">&nbsp;</td>`:""}function u6(e,t){const n=o6(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:Rn.align,i=typeof e.iconSize=="number"?e.iconSize:Rn.iconSize,s=typeof e.borderRadius=="number"?e.borderRadius:Rn.borderRadius,a=typeof e.gap=="number"?e.gap:Rn.gap,l=typeof e.bgEnabled=="boolean"?e.bgEnabled:Rn.bgEnabled,c=typeof e.bgColor=="string"?e.bgColor:Rn.bgColor,u=typeof e.borderWidth=="number"?e.borderWidth:Rn.borderWidth,d=typeof e.borderColor=="string"?e.borderColor:Rn.borderColor;let m=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:Rn.buttonBorderWidth;m=Math.max(0,Math.min(24,Math.round(m)));const p=typeof e.showLabel=="boolean"?e.showLabel:Rn.showLabel,f=[];u>0&&d&&f.push(`border:${u}px solid ${On(d)}`);const h=f.length?` style="${f.join(";")}"`:"",y=!!(l&&String(c).trim()),v=Math.max(0,Math.round(Number(a)||0)),A=r.length>1,k=`<table border="0" cellspacing="0" cellpadding="0">
92
- <tr>${r.map(E=>{const C=On(E.platform||"unknown"),g=!!E.customIcon,w=On(E.href||""),T=String(E.title??"").trim(),_=T?` title="${On(T)}"`:"",M=On(E.alt||""),N=On(l6(E.iconSrc||"")),W=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,R=g?"":typeof E.buttonBgColor=="string"?E.buttonBgColor.trim():"",Y=!g&&y&&!R?String(c).trim():"",V=g?"":R||Y,G=!g&&!!Y,Le=g?"":typeof E.itemBorderColor=="string"?E.itemBorderColor.trim():"",ae=!g&&!!(R||Le&&m>0||G);let ne=`<a href="${w}" target="_blank"${_} draggable="false"><img src="${N}" width="${W}" height="${P}" border="0" alt="${M}" draggable="false" style="display:block;${!g&&!ae&&s>0?`border-radius:${s}px;`:""}" /></a>`;if(p&&(E.title||E.alt)){const Q=s6(String(E.title||E.alt||""));ne+=`<br/><span style="display:block;font-size:11px;line-height:1.2;margin-top:4px;max-width:96px;word-break:break-word;">${Q}</span>`}const we=[];V&&we.push(`background-color:${On(V)}`),Le&&m>0&&we.push(`border:${m}px solid ${On(Le)}`),ae&&s>0&&we.push(`border-radius:${s}px`);const j=G?' em-tray-cell-bg="1"':"",z=g?' em-custom-icon="1"':"",Se=V&&/^#[0-9A-Fa-f]{3,8}$/.test(V)?` bgcolor="${On(V)}"`:"",Ae=A?' draggable="true"':"";return`<td em-platform="${C}"${z}${j}${Se}${we.length?` style="${we.join(";")}"`:""}${Ae}>${ne}</td>`}).filter(Boolean).reduce((E,C,g)=>(g>0&&E.push(c6(v)),E.push(C),E),[]).join("")}
93
- </tr>
94
- </table>`,S=`<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"${h}><tr><td align="${On(o)}">
95
- ${k}
96
- </td></tr></table>`,b=t.parseFromString(S)[0];return b?(b instanceof HTMLTableElement&&i6(n,b,o),b.setAttribute("em-edit","active"),n.replaceWith(b),t.commit(!0),b):null}function d6(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 m=!0;if(c&&t.isRangeMatching(c,r,r.collapsed))m=!1;else if(d)if(t.isRangeMatching(d,r,r.collapsed)){const p=t.unwrapTag(d);r.selectNodeContents(p)}else{const p=t.splitWrapper(d,r);r.selectNodeContents(p),setTimeout(()=>n.removeAllRanges(),100)}else if(c){const p=t.splitWrapper(c,r);r.selectNodeContents(p)}if(m)if(r.collapsed){const p=r.cloneRange();try{r.expand("word");const f=r.toString().trim();if(f){const h=t.wrapInTag(r,f,a),y=document.createRange();y.selectNodeContents(h),n.removeAllRanges(),n.addRange(y),t.cleanEmptyTags(h.parentNode)}else r.setStart(p.startContainer,p.startOffset),r.setEnd(p.endContainer,p.endOffset)}catch{r.setStart(p.startContainer,p.startOffset),r.setEnd(p.endContainer,p.endOffset)}}else{const p=r.cloneContents(),f=document.createElement("div");f.appendChild(p),t.unwrapNestedTags(f,a);const h=t.wrapInTag(r,f,a),y=document.createRange();y.selectNodeContents(h),n.removeAllRanges(),n.addRange(y),t.cleanEmptyTags(h.parentNode)}}else if(r.collapsed)if(c){const m=c.parentNode,p=t.unwrapTag(c),f=document.createRange();f.selectNodeContents(p),n.removeAllRanges(),n.addRange(f),t.cleanEmptyTags(m),c.parentNode||setTimeout(()=>n.removeAllRanges(),0)}else{const m=r.startContainer.parentElement?.closest(a);if(m){const p=t.unwrapTag(m),f=document.createRange();f.selectNodeContents(p),n.removeAllRanges(),n.addRange(f),t.cleanEmptyTags(m.parentNode)}}else{let m=[];const p=r.cloneContents(),f=document.createElement("div");if(f.appendChild(p),m=Array.from(f.querySelectorAll(a)),c){const y=Array.from(c.childNodes).some(k=>k.nodeType===1),v=t.unwrapTag(c),A=document.createRange();if(v.isConnected)A.selectNodeContents(v),n.removeAllRanges(),n.addRange(A);else{const k=c.parentNode;k&&(A.selectNodeContents(k),n.removeAllRanges(),n.addRange(A))}y&&t.applicationElementSettingsSet({elem:document.querySelector("[em-edit]")}),t.commit();return}else{const y=r.commonAncestorContainer.parentElement?.closest(a)||r.startContainer.parentElement?.closest(a);y&&m.push(y)}m.length>0&&m.forEach(y=>{y.parentNode&&t.unwrapTag(y)});const h=f.cloneNode(!0).querySelector('[em-edit="active"]');if(h){r.deleteContents(),r.insertNode(h);const y=document.createRange();y.selectNodeContents(h),n.removeAllRanges(),n.addRange(y),t.cleanEmptyTags(h.parentNode)}}t.commit()}typeof e.textSuperscript=="boolean"&&s("sup",e.textSuperscript),typeof e.textSubscript=="boolean"&&s("sub",e.textSubscript)}function m6(e,t){if(e!==void 0){if(e===""){f6(t.activeElement);return}p6(e,t)}}function f6(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 p6(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(/~~.*$/,""),m=document.createElement("em-replace");m.setAttribute("text",d),r.surroundContents(m)}}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,m=>{const p=e,f=m.textContent||"";return p.length===1&&d.test(f)?!0:t.compareStrings(f,p)}),a&&(a.setAttribute("text",e),a.textContent=e),a||(c=document.createElement("em-replace"),c.setAttribute("text",o),r.insertNode(c),c.innerHTML=o,r.collapse(!1))}else c=document.createElement("em-replace"),c.setAttribute("text",o),r.insertNode(c),c.innerHTML=o,r.collapse(!1)}a&&!l&&(a.getAttribute("text")===a.innerHTML&&(a.innerHTML=e),a.setAttribute("text",e))}function h6(e){return e.trim().replace(/\s+/g,"_").replace(/[^\p{L}\p{N}\-_:.]/gu,"")}function mE(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 g6(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 b6(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function y6(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=mE(r)),i||(i=t.activeElement?.closest?.("a[name]")),i){const s=i.firstChild,a=i.lastChild;b6(i),t.commit(),g6(s,a)}return}const o=h6(e);if(o&&!(!n||!r||r.collapsed))try{const i=mE(r);if(i){i.setAttribute("name",o),t.commit();return}const s=document.createElement("a");s.setAttribute("name",o);const a=r.extractContents();s.appendChild(a),r.insertNode(s);const l=document.createRange();l.selectNodeContents(s),n.removeAllRanges(),n.addRange(l),t.commit()}catch{}}function v6(e,t){let n=!1,{activeElement:r,activeCell:o}=t;if(r||(r=document.querySelector(".remove-basic-cell")||document.querySelector(".em-temporary-active-cell-background-color")||document.querySelector(".em-active-table-cell")),!r)return n;const i=Object.keys(e)[0],s=r.closest(".em-element-custom-table");if(!s)return n;let a=t.parseTableElementToModel(s);if(r.tagName==="TD"&&(r=r.querySelector("div"),r?.setAttribute("em-edit","active")),r?.tagName==="TR"&&(r=r.querySelector("EDITOR")?.querySelector("div"),r?.setAttribute("em-edit","active")),i.includes("padding")&&!i.includes("cell_")&&E6(e,s,a,t),e.backgroundColor&&S6(e.backgroundColor,s),i.includes("backgroundImage")&&w6(e,s),i.includes("backgroundPosition")){const l=t.updateBackgroundPosition(s.getAttribute("style"),{settings:e});s.setAttribute("style",l)}return i.includes("backgroundSize")&&(s.style.backgroundSize=e.backgroundSize),i.includes("backgroundRepeat")&&(s.style.backgroundRepeat=e.backgroundRepeat),(e.borderAll||e.borderTop||e.borderRight||e.borderBottom||e.borderLeft)&&C6(e,i,s,t),i.includes("borderRadius")&&A6(e,s,t),i.includes("boxShadow")&&T6(e,s,t),n=_6(e,s,t)||n,i.includes("cell")&&k6(e,i,s,a,o,t),new Set(["fontFamily","fontSize","lineHeight","textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor","linkHref","textAlign","valign"]).has(i)&&R6(e,i,s,a,o,r,t),O6(s,t),Zi(s,e,"around"),n}function E6(e,t,n,r){const o=r.updateTablePadding(n,{settings:e});t.innerHTML=r.tableModelToHtml(o)}function S6(e,t){t.getAttribute("data-bg-image")&&(t.removeAttribute("data-bg-image"),t.style.backgroundImage="",t.style.backgroundSize="",t.style.backgroundRepeat="",t.style.backgroundPosition=""),t.setAttribute("bgcolor",e)}function w6(e,t){if(t.getAttribute("bgcolor")&&t.removeAttribute("bgcolor"),e.backgroundImage?.[0]?.type==="url"){const n=e.backgroundImage[0].value;t.setAttribute("data-bg-image",n),t.style.backgroundImage=`url('${n}')`,t.style.backgroundSize="cover",t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="center"}}function C6(e,t,n,r){const o=t,i=e[o];let s="",a="";switch(o){case"borderAll":s="border",a=n.style.border;break;case"borderTop":s="border-top",a=n.style.borderTop;break;case"borderRight":s="border-right",a=n.style.borderRight;break;case"borderBottom":s="border-bottom",a=n.style.borderBottom;break;case"borderLeft":s="border-left",a=n.style.borderLeft;break;default:s="border",a=n.style.border}const l=n.getAttribute("border")||"",c=n.getAttribute("bordercolor")||"";let u=n.getAttribute("style")||"";const d=n.style.borderCollapse?`border-collapse: ${n.style.borderCollapse};`:"border-collapse: collapse;";if(["borderTop","borderRight","borderBottom","borderLeft"].includes(o)&&(n.style.border||l)){u=r.removeStyleProperty(u,"border");const p=n.style.border?n.style.border:`${l||"1"}px solid ${c||"#b9b1b1"}`;u=`border-top: ${p}; border-right: ${p}; border-bottom: ${p}; border-left: ${p}; ${u};`}let m=a?`${s}: ${a};`:`${s}: ${l||"1"}px solid ${c||"#b9b1b1"};`;n.removeAttribute("border"),n.removeAttribute("bordercolor"),n.removeAttribute("border-collapse"),u=r.removeStyleProperty(u,s),u=r.removeStyleProperty(u,"border-collapse"),s==="border"&&["border-top","border-right","border-bottom","border-left"].forEach(p=>{u=r.removeStyleProperty(u,p)}),["borderTop","borderRight","borderBottom","borderLeft"].includes(o)&&(u=r.removeStyleProperty(u,"border")),i?.style===""&&(m=""),i?.color&&m&&(m=m.replace(/(#([0-9A-Fa-f]{3}){1,2}\b)|(rgba?\([^)]*\))/g,i.color)),i?.width&&m&&(m=m.replace(/\b\d+(\.\d+)?px\b/g,`${i.width}px`)),i?.style&&m&&(m=m.replace(/solid|dashed|dotted/g,i.style)),m=`${m}${u?` ${u}`:""}`,n.setAttribute("style",m?`${d} ${m}`:"")}function A6(e,t,n){const r=e.borderRadius,o=t.getAttribute("border")||"",i=t.getAttribute("bordercolor")||"";let s=t.getAttribute("style")||"";if(r?.all){const l=`border-radius: ${r.all}px ${r.all}px ${r.all}px ${r.all}px;`;if(s)s=n.removeStyleProperty(s,"border-radius"),s=n.removeStyleProperty(s,"border-collapse"),t.setAttribute("style",`${s}; border-collapse: separate; ${l}`);else{const c=`border-collapse: separate; border: ${o||"1"}px solid ${i||"#b9b1b1"}; ${l}`;t.setAttribute("style",c),t.removeAttribute("border"),t.removeAttribute("bordercolor")}}const a=["topLeft","topRight","bottomRight","bottomLeft"];a.forEach(l=>{if(r?.[l])if(s){const c=n.updateBorderRadius(t.getAttribute("style"),l,r[l]);t.setAttribute("style",c)}else{const c={topLeft:"0",topRight:"1",bottomRight:"2",bottomLeft:"3"},u=["0","0","0","0"];u[parseInt(c[l])]=`${r[l]}px`;const d=`border-radius: ${u.join(" ")};`,m=`border-collapse: separate; border: ${o||"1"}px solid ${i||"#b9b1b1"}; ${d}`;t.setAttribute("style",m)}}),(r?.all||a.some(l=>r?.[l]))&&(t.removeAttribute("border"),t.removeAttribute("bordercolor"))}function T6(e,t,n){const r=e.boxShadow;if(!r)return;const o=t.getAttribute("border")||"",i=t.getAttribute("bordercolor")||"";let s=t.getAttribute("style")||"";const a=`box-shadow: ${r.color} ${r.hOffset}px ${r.vOffset}px ${r.blurRadius}px ${r.spreadRadius}px${r.inset?" inset":""};`;if(s)s=n.removeStyleProperty(s,"box-shadow"),s=n.removeStyleProperty(s,"border-collapse"),t.setAttribute("style",`${s}; border-collapse: separate;${r.color?` ${a}`:""}`);else{const l=`border-collapse: separate; border: ${o||"1"}px solid ${i||"#b9b1b1"}; ${a}`;t.setAttribute("style",l),t.removeAttribute("border"),t.removeAttribute("bordercolor")}}function _6(e,t,n){let r=!1;e.mobileWidth&&(n.setElementMobileWidth({settings:e,elem:t}),t.removeAttribute("width"),r=!0),e.mobileHeight&&(n.setElementMobileHeight({settings:e,elem:t}),r=!0),e.show&&(n.setElementShow({settings:e,elem:t}),r=!0),e.mobileBackgroundColor&&(n.setElementMobileBackgroundColor({settings:e,elem:t}),r=!0);const o=e;if(o.mobileBackgroundImage&&(n.setElementMobileBackgroundImage?.({settings:o,elem:t}),r=!0),o.mobileBackgroundPositionX&&(n.setElementMobileBackgroundPositionX?.({settings:o,elem:t}),r=!0),o.mobileBackgroundPositionY&&(n.setElementMobileBackgroundPositionY?.({settings:o,elem:t}),r=!0),o.mobileBackgroundRepeat&&(n.setElementMobileBackgroundRepeat?.({settings:o,elem:t}),r=!0),o.mobileBackgroundSize&&(n.setElementMobileBackgroundSize?.({settings:o,elem:t}),r=!0),e.mobileBoxShadow){if(e.mobileBoxShadow.color!==""&&n.setElementMobileBoxShadow({settings:e,elem:t}),e.mobileBoxShadow.color===""){const i=t.getAttribute("class")||"",s=n.removeClassByPrefix(i,e.mobileBoxShadow.classNamePrefix);t.setAttribute("class",s)}r=!0}if(e.mobileBorder&&(t.removeAttribute("border"),t.removeAttribute("bordercolor"),n.setElementMobileBorder({settings:e,elem:t}),r=!0),e.mobileBorderRadius){if(t.getAttribute("border")&&t.getAttribute("bordercolor")){const s={mobileBorder:{all:{collor:t.getAttribute("bordercolor"),width:t.getAttribute("border"),style:"solid",classNamePrefix:"em-mob-border_all-"}}};n.setElementMobileBorder({settings:s,elem:t}),t.removeAttribute("border"),t.removeAttribute("bordercolor")}n.setElementMobileBorderRadius({settings:e,elem:t});const i=Object.keys(e.mobileBorderRadius).find(s=>s!=="classNamePrefix");if(i&&e.mobileBorderRadius[i]===0){const s=t.getAttribute("class")||"";t.setAttribute("class",n.removeClassByPrefix(s,e.mobileBorderRadius.classNamePrefix))}r=!0}return r}function k6(e,t,n,r,o,i){const s=[se,oe];if(t.includes("cellBackgroundColor")){n.querySelector(".remove-basic-cell")&&(o=i.getCellsWithClasses(r,s),i.state.set("activeCell",o));const a=i.updateTableCellBackgroundByIds(r,o,e.cellBackgroundColor),l=i.addClassToCellsByIds(a,o,or);n.innerHTML=i.tableModelToHtml(l)}if(e.cell_borderPosition){n.querySelector(".remove-basic-cell")&&(o=i.getCellsWithClasses(r,s),i.state.set("activeCell",o),document.querySelectorAll(`.${Ue}`).forEach(l=>{l.classList.remove(Ue)})),r=i.parseTableElementToModel(n);const a=i.addClassToCellsByIds(r,o,Ue);n.innerHTML=i.tableModelToHtml(a)}(e.cell_borderAll||e.cell_borderTop||e.cell_borderRight||e.cell_borderBottom||e.cell_borderLeft)&&L6(e,n,r,o,i,s),t.includes("cell_borderRadiusAll")&&N6(e,n,r,o,i,s),t.includes("cell_padding")&&x6(e,n,r,o,i,s)}function L6(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${Ue}`).forEach(l=>{l.classList.remove(Ue)}));const s=o.getExternalBorders(n,r),a=o.mergeUniCells(s);if(e.cell_borderAll){for(const l of Object.keys(a)){if(l.includes("-uni-"))continue;n=o.parseTableElementToModel(t);const c=[l],u=o.updateCellBordersByIds(n,c,a[l],e.cell_borderAll);let d=o.addClassToCellsByIds(u,c,or);d=o.addClassToCellsByIds(d,c,Ue),t.innerHTML=o.tableModelToHtml(d)}(e.cell_borderAll.style===""||e.cell_borderAll.width===0||e.cell_borderAll.color==="")&&t.querySelectorAll(`.${or}`).forEach(l=>{const c=l;c.style.removeProperty("border-top"),c.style.removeProperty("border-right"),c.style.removeProperty("border-bottom"),c.style.removeProperty("border-left")})}[{setting:"cell_borderTop",value:"top"},{setting:"cell_borderRight",value:"right"},{setting:"cell_borderBottom",value:"bottom"},{setting:"cell_borderLeft",value:"left"}].forEach(({setting:l,value:c})=>{if(e[l]){n=o.parseTableElementToModel(t);const u=Object.keys(a).filter(p=>a[p].includes(c)),d=o.updateCellBordersByIds(n,u,[c],e[l]),m=o.addClassToCellsByIds(d,r,or);t.innerHTML=o.tableModelToHtml(m)}})}function N6(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${Ue}`).forEach(a=>{a.classList.remove(Ue)}));const s=o.getExternalCorners(n,r);for(const a of Object.keys(s)){if(a.includes("-uni-"))continue;n=o.parseTableElementToModel(t);const l=o.updateCellBorderRadiusByIds(n,a,s[a],e.cell_borderRadiusAll),c=o.addClassToCellsByIds(l,a,or);t.innerHTML=o.tableModelToHtml(c)}}function x6(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${Ue}`).forEach(l=>{l.classList.remove(Ue)})),n=o.parseTableElementToModel(t);let s=o.addClassToCellsByIds(n,r,Ue);t.innerHTML=o.tableModelToHtml(s),[{key:"cell_paddingTop",sides:["top"]},{key:"cell_paddingBottom",sides:["bottom"]},{key:"cell_paddingLeft",sides:["left"]},{key:"cell_paddingRight",sides:["right"]},{key:"cell_paddingLeftRight",sides:["left","right"]},{key:"cell_paddingTopBottom",sides:["top","bottom"]}].forEach(({key:l,sides:c})=>{e[l]!==void 0&&(n=o.parseTableElementToModel(t),s=o.updateCellPaddingByIds(n,r,c,e[l]))}),e.cell_padding&&(n=o.parseTableElementToModel(t),s=o.updateCellPaddingByIds(n,r,["top"],e.cell_padding.top),s=o.updateCellPaddingByIds(s,r,["bottom"],e.cell_padding.bottom),s=o.updateCellPaddingByIds(s,r,["left"],e.cell_padding.left),s=o.updateCellPaddingByIds(s,r,["right"],e.cell_padding.right));const a=o.addClassToCellsByIds(s,r,or);t.innerHTML=o.tableModelToHtml(a)}function M6(e,t){if(e.collapsed)return!1;const{startContainer:n,endContainer:r}=e;return!n.isConnected||!r.isConnected?!1:t.contains(n)&&t.contains(r)}function R6(e,t,n,r,o,i,s){const a=[se,oe],l=window.getSelection();if(!l||l.rangeCount===0)return;const c=l.getRangeAt(0).cloneRange();if(n.querySelector(".remove-basic-cell")&&(o=s.getCellsWithClasses(r,a),s.state.set("activeCell",o),document.querySelectorAll(`.${Ue}`).forEach(d=>{d.classList.remove(Ue)})),!o.length)return;if(o.length===1){const d=n.querySelector(`td.${oe}, td.${Ue}, td.${se}`),m=d?.querySelector(":scope > div")??d?.querySelector(":scope > editor > div");if(m){if(s.wrapEditor(m,!0),s.textStyleProperties.some(p=>Object.prototype.hasOwnProperty.call(e,p))){if(M6(c,m))s.addNewRange(c);else{const p=document.createRange();p.selectNodeContents(m),s.addNewRange(p)}try{s.toggleTextStyle(m,{settings:e})}catch{}}if(t==="linkHref"&&typeof e.linkHref=="string"){const p=m.tagName==="A"?m:m.querySelector("a");p&&p.setAttribute("href",e.linkHref)}t==="textAlign"&&(e.textAlign?m.setAttribute("align",e.textAlign):i?.style?.textAlign?i.style.removeProperty("text-align"):m.removeAttribute("align")),e.valign?m.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&m.closest("td")?.removeAttribute("valign");return}}r=s.parseTableElementToModel(n);const u=s.addClassToCellsByIds(r,o,Ue);n.innerHTML=s.tableModelToHtml(u),n.querySelectorAll(`td.${Ue} > div`).forEach(d=>{s.wrapEditor(d,!0);const m=l.getRangeAt(0);if(m.selectNode(d),s.addNewRange(m),s.textStyleProperties.some(p=>Object.prototype.hasOwnProperty.call(e,p)))try{s.toggleTextStyle(d,{settings:e})}catch{}if(t==="linkHref"&&typeof e.linkHref=="string"){const p=d.tagName==="A"?d:d.querySelector("a");p&&p.setAttribute("href",e.linkHref)}t==="textAlign"&&(e.textAlign?d.setAttribute("align",e.textAlign):i?.style?.textAlign?i.style.removeProperty("text-align"):d.removeAttribute("align")),e.valign?d.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&d.closest("td")?.removeAttribute("valign")})}function O6(e,t){document.querySelectorAll(`.${se}`).forEach(o=>{o.classList.remove(se)}),document.querySelectorAll(`.${oe}`).forEach(o=>{o.classList.remove(oe)});let n=t.parseTableElementToModel(e);e.getAttribute("style")?.includes("border-collapse:")&&(n=t.removeOuterBorders(n)),e.getAttribute("class")?.includes("em-mob-border_")&&(n=t.removeOuterBorders(n)),n=t.simplifyBorders(n),e.innerHTML=t.tableModelToHtml(n);const r=e.querySelectorAll(`.${or}`);r.length>0&&(r[0].setAttribute("em-edit",""),r.forEach(o=>{o.classList.remove(or)})),t.commit()}var Oe=e=>ua(e?.innerText);function P6(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 I6(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 D6=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,B6=/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)$/i,Hm=e=>e.toString(16).padStart(2,"0");function H6(e){const t=B6.exec(e)?.groups;if(!t)return;const n=Number.parseInt(t.r,10),r=Number.parseInt(t.g,10),o=Number.parseInt(t.b,10);if(![n,r,o].some(i=>!Number.isFinite(i)||i<0||i>255))return`#${Hm(n)}${Hm(r)}${Hm(o)}`}function fE(e){return e.split("").map(t=>`${t}${t}`).join("")}function Pn(e,t){if(!e)return;const n=e.trim();if(!n)return;if(D6.test(n)){const o=n.slice(1);return o.length===3?`#${fE(o).toLowerCase()}`:o.length===4?`#${fE(o.slice(0,3)).toLowerCase()}`:o.length===8?`#${o.slice(0,6).toLowerCase()}`:`#${o.toLowerCase()}`}const r=H6(n);if(r)return r;if(t){const o=t(n);if(o&&o!==n)return Pn(o)}}function F6(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function Fm(e,t,n){const r=t.parentElement;let o=e.parentElement;for(;o&&o!==r;){const i=Pn(o.style.color,n);if(i)return i;o=o.parentElement}}function $6(e,t){Array.from(e.querySelectorAll("span")).reverse().forEach(n=>{if(!n.style.color)return;const r=Pn(n.style.color,t);if(!r)return;const o=Fm(n,e,t);!o||o!==r||(n.style.removeProperty("color"),n.getAttribute("style")||n.removeAttribute("style"),n.attributes.length===0&&F6(n))})}function W6(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 q6(e,t,n){const r=Pn(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=W6(i);if(!s.length||s.every(c=>{const u=c.parentElement;return u?Pn(u.style.color,n)===r?!0:Fm(u,e,n)===r:!1}))return!1;const a=document.createElement("span");a.style.color=t;try{i.surroundContents(a)}catch{a.appendChild(i.extractContents()),i.insertNode(a)}const l=document.createRange();return l.selectNodeContents(a),o.removeAllRanges(),o.addRange(l),!0}function z6(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=Pn(o.style.color,t);if(!i)return;const s=Fm(o,e,t)||(n?Pn(n,t):void 0);s&&Array.from(o.querySelectorAll("span")).forEach(a=>{if(!a.style.color)return;const l=Pn(a.style.color,t);l&&l!==i&&l===s&&(a.style.color=o.style.color)})})}function V6(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 U6(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"&&dl(t,e.fontFamilyArray[2]),e.removeClassesByPrefix(t,"em-font"),t.classList.add(e.createFontClassName(e.fontFamilyArray)),qd(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 j6(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=>{n.innerHTML=e.removeFormattingTags(n.innerHTML,"bold"),n.tagName!=="STRONG"?e.currentSettings.value&&(n.innerHTML="<strong>"+n.innerHTML+"</strong>"):e.currentSettings.value||(n.outerHTML=n.innerHTML)})}if(e.currentSettings.value===!0)Array.from(e.parentNode?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");if(n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t),e.getInnerText(n)===e.selectedText){const r=n.closest("span");r?.textContent===n.innerText&&!r.getAttribute("style")&&r.childNodes[0]?.nodeType===3&&r.parentNode?.replaceChild(n,r),e.refreshElementSettings(n,e.selectedText),e.range.selectNode(n),e.addNewRange(e.range)}});else if(Array.from(e.parentWrapper?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t)}),e.getInnerText(e.parentWrapper)===e.selectedText){const t=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);t&&(e.range.selectNode(t),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function G6(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=>{n.innerHTML=e.removeFormattingTags(n.innerHTML,"italic"),n.tagName!=="EM"?e.currentSettings.value&&(n.innerHTML="<em>"+n.innerHTML+"</em>"):e.currentSettings.value||(n.outerHTML=n.innerHTML)})}if(e.currentSettings.value)Array.from(e.parentNode?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");if(n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t),e.getInnerText(n)===e.selectedText){const r=n.closest("span");r?.textContent===n.innerText&&!r.getAttribute("style")&&r.childNodes[0]?.nodeType===3&&r.parentNode?.replaceChild(n,r),e.refreshElementSettings(n,e.selectedText),e.range.selectNode(n),e.addNewRange(e.range)}});else if(Array.from(e.parentElement?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t)}),e.getInnerText(e.parentWrapper)===e.selectedText){const t=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);t&&(e.range.selectNode(t),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function X6(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=""),document.execCommand("fontSize",!1,"1"),i&&s&&(s.style.fontSize=i);const a=window.getSelection()?.getRangeAt(0).commonAncestorContainer;t.parentElement=t.parentNode.querySelector('[size="1"]')||(a?.nodeType===1?a:a?.parentElement),t.parentElement&&(t.parentElement.style.fontSize=e.currentSettings.value+"px")}let n=null;if(t.parentElement?.tagName==="FONT"){const i=document.createElement("span");i.innerHTML=t.parentElement.innerHTML,t.parentElement.getAttribute("size")?(i.style.fontSize=e.currentSettings.value+"px",i.removeAttribute("size")):Array.from(t.parentElement.attributes).forEach(s=>i.setAttribute(s.name,s.value)),t.parentElement.parentNode?.replaceChild(i,t.parentElement),e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range)}if((e.activeElement.tagName==="A"||e.activeElement.closest("a"))&&(t.parentWrapper=e.activeElement.closest("a")),e.getInnerText(t.parentWrapper)===e.selectedText){if(Array.from(t.parentWrapper?.getElementsByTagName("span")||[]).forEach(s=>s.style.fontSize=""),!t.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&t.parentWrapper&&e.isProgrammaticSelection){const s=t.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);s&&(s.style.fontSize=e.currentSettings.value+"px")}t.parentWrapper&&(t.parentWrapper.style.fontSize=e.currentSettings.value+"px");const i=t.parentWrapper?.firstChild;i?.nodeType===1&&i.tagName==="SPAN"&&i.innerText===e.selectedText&&(i.style.fontSize="")}else t.parentWrapper?.style.hasOwnProperty("font-size")&&(n=t.parentWrapper.style.fontSize,n&&t.parentWrapper.style.removeProperty("font-size"));n&&t.parentWrapper&&(t.parentWrapper.style.fontSize=n);const r=Array.from(t.parentNode?.querySelectorAll("font")||[]).reverse(),o=[];e.isEditorTagOutside?e.currentSettings.value||(t.selection=window.getSelection(),t.range=t.selection.getRangeAt(0),t.parentNode=t.selection.anchorNode?.nodeType===1?t.selection.anchorNode:t.selection.anchorNode?.parentElement,t.parentNode&&t.parentNode.style.removeProperty(e.currentStyle),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(t.parentNode,o),o.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.style.fontSize=e.currentSettings.value+"px",i.querySelectorAll('[style*="font-size"]').forEach(s=>{s.tagName!=="A"?s.style.removeProperty("font-size"):s.style.fontSize=e.currentSettings.value+"px"})})),e.isEditorTagOutside&&r.forEach(i=>{const s=document.createElement("span");s.innerHTML=i.innerHTML;const a=e.currentSettings.value+"px",l=i.children?.length===1&&i.firstChild?.nodeType===1?i.firstChild:null,c=[];if(e.checkForTextNodes(i,c),c.forEach(u=>{if(u.tagName==="FONT"){const d=document.createElement("span");d.innerHTML=u.innerHTML,u.getAttribute("size")?d.style.fontSize=e.getInnerText(u)===e.selectedText?a:"":Array.from(u.attributes).forEach(m=>d.setAttribute(m.name,m.value)),u.parentNode?.replaceChild(d,u)}}),l)i.parentNode?.replaceChild(l,i);else if(i.getAttribute("size")&&i.parentNode){const u=document.createElement("span");u.innerHTML=i.innerHTML,u.style.fontSize=a,i.parentNode.replaceChild(u,i)}if(!c.length&&i.tagName==="FONT"){const u=document.createElement("span");u.innerHTML=i.innerHTML,i.parentNode?.replaceChild(u,i)}}),Array.from(document.getElementsByTagName("span")).reverse().forEach(i=>{e.getInnerText(i)===e.selectedText&&i.closest('[em-edit="active"]')&&(e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range))}),e.cleanEmptySpans(e.selectedText)}function Y6(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=>{i.innerHTML=e.removeFormattingTags(i.innerHTML,"strike"),i.tagName!=="STRIKE"?e.currentSettings.value&&(i.innerHTML="<strike>"+i.innerHTML+"</strike>"):e.currentSettings.value||(i.outerHTML=i.innerHTML)})}if(e.currentSettings.value===!0){let o=n;Array.from(document?.getElementsByTagName("strike")||[]).reverse().forEach(i=>{if(e.getInnerText(i)===o&&(e.getInnerText(i.parentNode)===o&&i.parentNode.tagName==="U"&&(i.parentNode.outerHTML=i.parentNode.innerHTML),r=e.findElementWithSelectedText(o),r)){const s=e.findOutermostParentWithText(r,"A");s&&(s.style.textDecoration="none"),e.refreshElementSettings(r,o),t.range.selectNode(r),e.addNewRange(t.range)}})}else{let o=n;if(e.cleanEmptySpans(o),e.getInnerText(t.parentWrapper)===o){const i=window.getSelection();if(r=e.findElementWithSelectedText(o,e.activeElement),r&&(t.range.selectNode(r),e.addNewRange(t.range),t.range.cloneContents())){const s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||t.range.commonAncestorContainer;s&&e.request.type!=="button"&&e.refreshElementSettings(s,o)}if(i&&i.rangeCount>0&&e.isElementList&&!r){const s=i.getRangeAt(0);let a=s.commonAncestorContainer;a.nodeType!==Node.ELEMENT_NODE&&(a=a.parentNode),a.querySelectorAll("strike").forEach(l=>{l.outerHTML=l.innerHTML}),a.style.textDecoration="none",a.querySelectorAll('span[style*="text-decoration"]').forEach(l=>{l.style.textDecoration=""}),e.refreshElementSettings(a,o),s.selectNodeContents(a),i.removeAllRanges(),i.addRange(s),e.addNewRange(s)}}}if(e.request.type==="button"||e.activeElement.tagName==="A"){e.request.type!=="button"&&e.activeElement.tagName==="A"&&(t.parentWrapper=e.activeElement);let o=n;if(e.getInnerText(t.parentWrapper)===o&&t.parentWrapper)t.parentWrapper.style.textDecoration=e.currentSettings.value?"line-through":"none",Array.from(t.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),t.parentWrapper.innerHTML=e.removeFormattingTags(t.parentWrapper.innerHTML,"strikeUnderline"),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 K6(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=>{i.innerHTML=e.removeFormattingTags(i.innerHTML,"underline"),i.tagName!=="U"?e.currentSettings.value&&(i.innerHTML="<u>"+i.innerHTML+"</u>"):e.currentSettings.value||(i.outerHTML=i.innerHTML)})}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 Z6(e){if(!e.isColorChange)return;const{mutableState:t}=e;let n=[];if(e.tempColor&&e.isEditorTagOutside&&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");if(e.request.type==="button"||a)a&&(a.style.color=s,a.querySelectorAll('span[style*="color"]').forEach(l=>l.style.color=""));else{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));const l=t.parentWrapper.firstChild;l?.nodeType===1&&l.tagName==="SPAN"&&e.getInnerText(l)===e.selectedText&&(l.style[e.stylePropretyName]="")}}else if(!e.canselExecCommand){const a=document.createElement("span");a.style[e.stylePropretyName]=s;const l=t.parentWrapper.firstChild;if(l?.nodeType===1&&l.tagName==="SPAN"&&e.getInnerText(l)===e.selectedText)l.style[e.stylePropretyName]=s;else{for(;t.parentWrapper.firstChild;)a.appendChild(t.parentWrapper.firstChild);t.parentWrapper.appendChild(a)}}t.parentWrapper.querySelectorAll(`span[style*="${e.stylePropretyName}"]`).forEach(a=>{a.innerText!==t.parentWrapper.innerText&&a.style.removeProperty(e.stylePropretyName)})}e.isEditorTagOutside?!e.currentSettings.value&&t.selection.isCollapsed&&(t.parentNode=t.selection.anchorNode?.nodeType===1?t.selection.anchorNode:t.selection.anchorNode?.parentElement,t.parentNode&&t.parentNode.style.removeProperty(e.stylePropretyName),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(t.parentNode,n),n.forEach(s=>{s.classList&&s.classList.contains(e.classNameBullet)||e.checkForWorkClass(s)&&(s.style[e.stylePropretyName]=e.currentSettings.value,s.querySelectorAll(`[style*="${e.stylePropretyName}"]`).forEach(a=>{a.tagName!=="A"?a.style.removeProperty(e.currentStyle):a.style[e.stylePropretyName]=e.currentSettings.value}))}));const r=Array.from(t.parentNode?.querySelectorAll("font")||[]).reverse();e.isEditorTagOutside&&r.forEach(s=>{const a=document.createElement("span");a.innerHTML=s.innerHTML;const l=s.getAttribute(e.currentStyle),c=e.rgbToHex(l||"").toString(),u=s.children.length===1&&s.firstChild?.nodeType===1?s.firstChild:null;let d=[];if(e.checkForTextNodes(s,d),d.forEach(m=>{if(m.tagName==="FONT"){const p=document.createElement("span");p.innerHTML=m.innerHTML,p.style[e.stylePropretyName]=c,m.parentNode?.replaceChild(p,m),e.refreshElementSettings(p,e.selectedText),t.range.selectNode(p),e.addNewRange(t.range)}else m.style[e.stylePropretyName]=c}),u)s.parentNode?.replaceChild(u,s);else if(s.getAttribute(e.currentStyle)&&s.parentNode){const m=document.createElement("span");m.innerHTML=s.innerHTML,m.style[e.stylePropretyName]=c;const p=s.closest("a");p&&p.innerText===s.innerHTML&&(p.style[e.stylePropretyName]=c),s.parentNode.replaceChild(m,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&&(z6(i,e.rgbToHex,e.outerContextColor||e.tempColor),$6(i,e.rgbToHex)),i&&e.cleanEmptySpans(e.selectedText,i)}function Q6(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 pE(e,t){const n=e.style.color?.trim();if(!n)return null;const r=Pn(n),o=Pn(t??"");return!r||r===o?null:n}function J6(e){if(e.currentSettings.name!=="textLink")return;const{mutableState:t}=e;let n=t.parentNode.querySelector('a[href=" "]');if(e.isEditorTagOutside||(n=e.findOutermostParentWithText(e.activeElement,"a")),e.currentSettings.value){const r=e.findOutermostParentWithText(e.activeElement,"a")||e.findOutermostParentWithText(t.parentNode,"a")||e.findOutermostParentWithText(t.parentWrapper,"a");if(!(n||r))return;const o=e.commonStyles?.links?.underline===void 0||e.commonStyles?.links?.underline?"underline":"none";n||(n=r);const i=e.findOutermostParentWithText(n);if(i&&i!==n&&i!==t.parentWrapper&&["b","strong","a","em","i","s","strike","u","br","span"].includes(i?.tagName.toLowerCase())){const s=n.cloneNode(!1),a=n.innerHTML;n.parentNode&&(n.parentNode.innerHTML=a),s.appendChild(i.cloneNode(!0)),i.parentNode&&i.parentNode.replaceChild(s,i),n=s,t.range.selectNode(n),e.addNewRange(t.range)}if(n){n.setAttribute("target","_blank"),n.setAttribute("href","");const s=e.commonStyles?.links?.color||n.closest('[style*="color"]')?.style?.color||"";n.setAttribute("style",`color: ${s}; text-decoration: ${o};`),n.setAttribute("new","true"),e.refreshElementSettings(n,e.selectedText)}}else if(n=t.parentNode.closest("a")||t.parentNode.querySelector('a[em-edit="active"]')||e.findOutermostParentWithText(e.activeElement,"a"),n)if(n.style.fontFamily||n.style.fontSize){const r=Q6(n)?"div":"span",o=document.createElement(r);if(o.innerHTML=n.innerHTML,Array.from(n.attributes).forEach(s=>{s.name!=="href"&&s.name!=="target"&&s.name!=="color"&&o.setAttribute(s.name,s.value)}),!o.style.lineHeight){const s=n.closest('[style*="line-height"]');s?.style.lineHeight&&(o.style.lineHeight=s.style.lineHeight)}o.style.textDecoration="";const i=pE(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=pE(n,e.commonStyles?.links?.color);if(r){const o=document.createElement("span");for(o.style.color=r;n.firstChild;)o.appendChild(n.firstChild);n.parentNode?.replaceChild(o,n),t.range=document.createRange(),t.range.selectNodeContents(o)}else{const o=Array.from(n.childNodes);o.forEach(i=>{n.parentNode?.insertBefore(i,n)}),n.parentNode?.removeChild(n),t.range=document.createRange(),t.range.setStartBefore(o[0]),t.range.setEndAfter(o[o.length-1])}if(e.addNewRange(t.range),t.range.cloneContents()){t.range=t.selection.getRangeAt(0);const o=t.range.commonAncestorContainer,i=o.nodeType===1?o:o.parentElement,s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||i;s&&e.refreshElementSettings(s,e.selectedText)}}}var $m='[class*="em-mob-font_size"]',e7=`${$m}, [style*="font-size"]`,t7="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub",n7=new Set(["SPAN","STRONG","B","EM","I","U","S","STRIKE","FONT","SUP","SUB","A"]);function r7(e,t,n){const{classNamePrefix:r,value:o}=t.mobileFontSize,i=o!=null?`${r}${o}px`:null,s=e.closest(t7)||e;s.querySelectorAll(".em-element-path").forEach(d=>d.remove());const a=o7(s,i!==null);if(!a||Oe(s)===Ke()){n({settings:t,elem:s.closest("editor")?s:s.closest(e7)||s}),Wm(s,r,i);return}const l=i7(s,a);if(i===null){(l?[l]:Array.from(s.querySelectorAll($m)).filter(d=>a.intersectsNode(d))).forEach(d=>{Wm(d,r,null),hE(d,r)});return}const c=l||sE(a,a.extractContents(),"span");if(!c)return;s7(c),n({settings:t,elem:c}),Wm(c,r,i);const u=document.createRange();u.selectNodeContents(c),lo(u)}function o7(e,t){const n=window.getSelection();if(!n?.rangeCount)return null;const r=n.getRangeAt(0);if(!e.contains(r.commonAncestorContainer))return null;if(!r.collapsed)return r;if(!t){const i=(r.startContainer.nodeType===Node.ELEMENT_NODE?r.startContainer:r.startContainer.parentElement)?.closest($m);if(!i||i===e||!e.contains(i))return null;const s=document.createRange();return s.selectNodeContents(i),lo(s),s}I6(n,lo);const o=n.rangeCount?n.getRangeAt(0):null;return o&&!o.collapsed?o:null}function i7(e,t){const n=Ke(),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)&&Oe(o)===n;)i=o,o=o.parentElement;return i}function Wm(e,t,n){e.querySelectorAll("*").forEach(r=>{n&&r.style.fontSize?(ml(r,t),r.classList.add(n)):r.getAttribute("class")?.includes(t)&&hE(r,t)})}function hE(e,t){ml(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 s7(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"));n7.has(n.tagName)&&!r&&!n.querySelector("img, br, hr, table, video, iframe")&&n.remove()})}function a7(e,t){let n=!1;const{activeElement:r}=t;if(typeof e.linkHref=="string"&&c7(e.linkHref,t),t.textStyleProperties.some(o=>e.hasOwnProperty(o)))try{t.toggleTextStyle(r,{settings:e})}catch{}if(e.mobileFontSize&&(r7(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&&u7(e.textAlign,r),e.mobileTextAlign&&(d7(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"))&&l7(e,r),t.isElementList&&m7(e,t),n}function l7(e,t){const n=L9.includes(t.tagName)?t:t.closest(N9);if(!n)return;const r=e.listOL!==void 0;(r?e.listOL:e.listUL)?D9(n,r):$9(n)}function c7(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),ms(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 u7(e,t){const n=os(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 d7(e,t,n){const r=os(t);if(!r)return;const o=e.mobileTextAlign?.classNamePrefix||"em-mob-text_align-";n8(t,r,o),n.setElementMobileAlign({settings:e,elem:r,fieldName:"mobileTextAlign"})}function m7(e,t){const{activeElement:n,classNameOl:r,classNameUl:o}=t,i=n.closest(`table.${r}`)||n.closest(`table.${o}`);if(!i)return;const s=i.outerHTML,a=t.removeEditorTags(s);e.SpacingBetweenParagraphs&&(i.innerHTML=t.updateTableStyle(a,"padding-bottom",e.SpacingBetweenParagraphs)),e.SpacingBetweenBulletsAndText&&(i.innerHTML=t.updateTableStyle(a,"padding-left",e.SpacingBetweenBulletsAndText)),e.BulletType&&(i.innerHTML=t.changeBullets(a,e.BulletType)),e.ColorBullets&&(i.innerHTML=t.changeBulletsColor(a,e.ColorBullets)),e.BulletsSize&&(i.innerHTML=t.changeBulletsSize(a,e.BulletsSize)),e.hasOwnProperty("BulletTextItalic")&&(i.innerHTML=t.changeBulletsItalic(a,e.BulletTextItalic)),e.hasOwnProperty("BulletTextStrong")&&(i.innerHTML=t.changeBulletsWeight(a,e.BulletTextStrong)),e.hasOwnProperty("BulletTextStrikethrough")&&(i.innerHTML=t.changeBulletsStrikethrough(a,e.BulletTextStrikethrough)),e.hasOwnProperty("BulletTextUnderline")&&(i.innerHTML=t.changeBulletsUnderline(a,e.BulletTextUnderline)),e.hasOwnProperty("BulletsFontFamily")&&t.isElementListOL&&(i.innerHTML=f7(e.BulletsFontFamily,a,t));let l=t.findElementWithSelectedText(n.textContent||"",i);l===null&&(l=i),l.hasAttribute("em-edit")||l.setAttribute("em-edit","active"),t.commit()}function f7(e,t,n){const r=document.createElement("div");r.innerHTML=t;const o=r.querySelector("table.em-element-list-ol");return o?(o.querySelectorAll("tr").forEach(i=>{const s=i.querySelector("td:first-child > div");s&&(e?e[0]==="Safe Fonts"?(s.style.fontFamily=e[1],n.removeClassesByPrefix(s,"em-font"),n.clearLinkTags({elem:document.documentElement})):e[0]==="Google Fonts"&&(e[1]==="Sans Serif"?s.style.fontFamily="Helvetica, Arial, sans-serif":e[1]==="Serif"?s.style.fontFamily='"Times New Roman", Times, serif':e[1]==="Project Fonts"&&dl(s,e[2]),n.removeClassesByPrefix(s,"em-font"),s.classList.add(n.createFontClassName(e)),qd(s,e),n.addFontFamilyClass({fontFamilyArray:e})):s.style.removeProperty("font-family"))}),r.innerHTML):t}var Rl=null;function gE(e){Rl=e}function bE(){return Rl}function Un(){Rl=null}function p7(){return Rl?.kind==="atom"}var h7=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"],g7=["em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],b7=["em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function yE(){document.querySelectorAll(".em-block-insert").forEach(e=>{e.classList.remove(...h7)})}function y7(){document.querySelectorAll(".em-atom-insert").forEach(e=>{e.classList.remove(...g7)})}function Ol(){document.querySelectorAll(".em-blockatom-insert").forEach(e=>{e.classList.remove(...b7)})}function qm(e,t){const n=e.getBoundingClientRect();return t>n.top+n.height/2?"bottom":"top"}function vE(e,t){const n=e.getBoundingClientRect(),r=document.body.getBoundingClientRect();return t==="bottom"?n.bottom>r.height-21:n.top<2}function zm(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=vE(e,"bottom")?`${r}_bottom-document`:`${r}_bottom`;e.classList.add(i)}else{e.classList.remove(`${r}_bottom`,`${r}_bottom-document`);const i=vE(e,"top")?`${r}_top-document`:`${r}_top`;e.classList.add(i)}}function Pl(e){return e.tagName==="TABLE"||e.tagName==="TR"?e.querySelector("[data-template-content]")??e.querySelector("td"):e}function EE(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 v7(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 E7(e){const t=EE(e.dataTransfer?.files??null);return t||v7(e.dataTransfer??null)}function Vm(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 fs(e){const t=e.dataTransfer?.types;return!!t&&Array.from(t).includes("Files")}function Um(e){if(!fs(e))return!1;const t=e.dataTransfer;if(!t)return!1;if(t.files?.length)return!!EE(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 SE="em-native-img-drop-target",jm="em-native-img-uploading",S7="em-native-img-drop-loading",Il="em-native-file-drag",ps=null,Or=null;function wE(){Or&&(window.removeEventListener("scroll",Or.reposition,!0),window.removeEventListener("resize",Or.reposition),Or.resizeObserver?.disconnect(),Or.overlay.remove(),Or=null)}function w7(e){wE();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)),Or={overlay:t,reposition:r,resizeObserver:o}}function Gm(){ps&&(ps.classList.remove(SE),ps=null)}function Pr(){document.body.classList.remove(Il),Gm()}function C7(e){if(!fs(e)){Pr();return}if(!Um(e)){Pr();return}document.body.classList.add(Il);const t=Vm(e);if(!t){Gm();return}ps!==t&&(Gm(),ps=t,t.classList.add(SE))}function CE(){wE(),document.body.classList.remove(S7),document.body.classList.remove(Il),document.querySelectorAll(`.${jm}`).forEach(e=>{e.classList.remove(jm)})}function A7(e,t){if(t.lockEditor||!fs(e))return!1;const n=E7(e);if(!n)return!1;const r=Vm(e);return r?(t.applicationElementSettingsSet({elem:r}),Pr(),r.classList.add(jm),w7(r),t.messageService.send({operation:Pe.APPLICATION_NATIVE_IMAGE_DROP,file:n}),!0):!1}function T7(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"&&(document.body.classList.add("em-atom-insert-body-inside"),t.commit(!1),t.mutableState.atomReplaced=n)}function _7(e,t){t.lockEditor||(Pr(),e.preventDefault(),t.messageService.send({operation:"application_scroll-block-hide"}))}function k7(e,t){if(e.preventDefault(),t.lockEditor){Pr();return}fs(e)?(Um(e)&&Vm(e)&&(e.dataTransfer.dropEffect="copy"),C7(e)):Pr();const n=e.target;if(document.body.classList.contains("em-block-insert-body")){const r=un(n)?null:n.closest('[em="block"]');if(r){t.mutableState.targetBlock=r;const o=Pl(r);o&&zm(o,qm(o,e.pageY),"block")}else yE()}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,zm(r,qm(r,e.pageY),"atom"),Ol();else if(n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML)Ol();else{const o=n.closest('[em="block"]');if(o){t.mutableState.targetBlock=o;const i=Pl(o);i&&(zm(i,qm(i,e.pageY),"blockatom"),y7())}}}}function L7(e,t){if(t.lockEditor)return;fs(e)&&Um(e)&&document.body.classList.add(Il);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"]');un(n)?(n.classList.add("em-block-insert-empty"),yE()):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"]');un(n)?(n.classList.add("em-block-insert-empty"),Ol()):o?t.mutableState.targetBlock=o:Ol()}}var N7=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function x7(e){return e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight}function M7(e,t){if(t.lockEditor)return;const n=e.target;if(document.body.classList.contains("em-block-insert-body")){if(x7(e)){document.querySelectorAll(".em-block-insert").forEach(i=>i.classList.remove(...N7)),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 R7(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+`
97
- `+[...i.querySelectorAll("style")].map(a=>a.innerHTML).join(`
98
- `),{restructure:!0,forceMediaMerge:!0}).css;s=n.cssbeautify(s,{indent:" ",autosemicolon:!0}),r&&(r.textContent=`
99
- `+s+`
100
- `)}function O7(e){for(const t of e.reverse())document.head?.prepend(t),document.head?.insertAdjacentHTML("afterbegin",`
101
- `)}function P7(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 AE(){Un(),Pr(),document.body.classList.remove("em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>{e.classList.remove("em-block-insert-empty")}),document.body.classList.remove("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 TE(e,t,n){const r=e.target,o=n.parseFromString(t.settings.blockHTML||"");let i=o.filter(l=>l.tagName&&l.tagName!=="LINK"&&l.tagName!=="STYLE").map(l=>n.getOuterHtml(l)).join("");const s=o.filter(l=>l.tagName==="STYLE").map(l=>n.getOuterHtml(l)).join(""),a=o.filter(l=>l.tagName==="LINK"&&l.getAttribute("em-class")).filter(l=>!document.head?.querySelector(`link[em-class="${l.getAttribute("em-class")}"]`));if(R7(s,n.emailWidth,{minify:n.minify,cssbeautify:n.cssbeautify,HTMLDocument:n.HTMLDocument}),O7(a),t.settings.type!=="project"&&(i=n.commonStylesApplyToBlock({html:i})),i.match(/class="em-countdown"/gi)&&(i=n.uptimeCountdown({blockHTML:i})),n.isTableElement(r)&&un(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"?n.insertAdjacentHTML(Vn(r),"beforeend",`
102
- `+i+`
103
- `):n.insertAdjacentHTML(Vn(r),"beforeend",`
104
- <tr><td align="center">
105
- `+i+`
106
- </td></tr>
107
- `),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),Un());else if(r.tagName==="BODY"){const l=document.querySelector('[em="block"]:last-child'),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"});const u=document.createElement("table");u.replaceChildren(...n.parseFromString(`
108
- `+i+`
109
- `)),[...u.querySelectorAll(":scope> tr")].reverse().forEach(d=>l.insertAdjacentElement(c,d)),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),Un())}else{const l=r.closest('[em="block"]');if(l){const c=Pl(l),u=c?P7(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")if(i.substring(0,3)==="<tr"){const d=document.createElement("table");d.replaceChildren(...n.parseFromString(`
110
- `+i+`
111
- `)),[...d.querySelectorAll(":scope > tr")].reverse().forEach(m=>l.insertAdjacentElement(u,m))}else{const d=document.createElement("table");d.replaceChildren(...n.parseFromString(`
112
- <tr em="block"><td align="center">
113
- `+i+`
114
- </td></tr>
115
- `)),[...d.querySelectorAll(":scope > tr")].reverse().forEach(m=>l.insertAdjacentElement(u,m))}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"),Qn(d,`
116
- `+i+`
117
- `),d.querySelectorAll('tr[em="block"]').forEach(m=>m.removeAttribute("em")),l.insertAdjacentElement(u,d)}else{const d=document.createElement("div");d.setAttribute("align","center"),d.setAttribute("em","block"),Qn(d,`<table cellpadding="0" cellspacing="0" border="0" width="100%">
118
- `+i+`
119
- </table>`),d.querySelectorAll('tr[em="block"]').forEach(m=>m.removeAttribute("em")),l.insertAdjacentElement(u,d)}else n.insertAdjacentHTML(l,u,`
120
- `+i+`
121
- `);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}),Un())}}}function _E(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>'?`
122
- <tr em="block" class="em-structure">
123
- <td align="center">
124
- ${e}
125
- </td>
126
- </tr>`:`
127
- <style>
128
- @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
129
- .em-mob-wrap {
130
- display: block!important;
131
- }
132
- .em-mob-width-100perc {
133
- width: 100%!important;
134
- max-width: 100%!important;
135
- }
136
- .em-mob-padding_right-20 {
137
- padding-right: 20px!important;
138
- }
139
- .em-mob-padding_left-20 {
140
- padding-left: 20px!important;
141
- }
142
- </style>
143
- <tr em="block" class="em-structure">
144
- <td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
145
- <table align="center" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
146
- <tr>
147
- <td width="600" valign="top" class="em-mob-wrap em-mob-width-100perc">
148
- ${e}
149
- </td>
150
- </tr>
151
- </table>
152
- </td>
153
- </tr>`}function I7(e,t,n,r,o){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}):qe(e,"beforeend",`
154
- `+t+`
155
- `),n!=null&&(e.closest(".empty-structure")||e.closest(".em-structure"))&&n.remove(),r.settings?.name&&(o.messageService.send("application_atom_inserted",r.settings.name),Un())}function D7(e,t,n,r,o){const i=e.target,s=!!document.querySelector(".em-blockatom-insert"),a=s?i.closest('[em="block"]'):i,l=s?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:l}));let c=_E(t);t!=='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'&&o(c.match(/<style((.|\n|\r)*?)<\/style>/g)),n.settings?.type!=="project"&&(c=r.commonStylesApplyToBlock({html:c}));let u=null;a.tagName==="TABLE"||a.tagName==="TR"?u=a.querySelector("[data-template-content]")??a.querySelector("td"):u=a,(c.indexOf("empty-structure")>-1||c.indexOf("em-structure")>-1)&&(c=r.setFloatBlocksWidth({blockHTML:c,targetBlock:a,project:n.settings?.project}),c=r.fitImagesToColumns(c));let d="beforeend";s&&u&&(u.classList.contains("em-block-insert_bottom-document")||u.classList.contains("em-block-insert_bottom")?d="afterend":(u.classList.contains("em-block-insert_top-document")||u.classList.contains("em-block-insert_top"))&&(d="beforebegin"));const m=!!t.match(/class="em-countdown"/gi),p=c.substring(0,3)==="<tr";if(a.tagName==="TR")if(p)if(m)r.insertCountdown({targetElem:a,targetPlace:d,atomHTML:c});else{const f=document.createElement("tr");f.setAttribute("em","block"),f.classList.add("em-structure"),f.replaceChildren(...Te(`
156
- `+c+`
157
- `).flatMap(h=>h instanceof Element&&h.tagName==="TR"?Array.from(h.childNodes):[h])),a.insertAdjacentElement(d,f)}else if(m)r.insertCountdown({targetElem:a,targetPlace:d,atomHTML:`<tr em="block"><td align="center">
158
- `+c+`
159
- </td></tr>`});else{const f=document.createElement("tr");f.setAttribute("em","block"),Qn(f,`
160
- <td align="center">
161
- `+c+`
162
- </td>
163
- `),a.insertAdjacentElement(d,f)}else if(p)if(a.tagName==="TABLE")if(un(i))m?r.insertCountdown({targetElem:d==="beforeend"?Vn(a):a,targetPlace:d,atomHTML:c}):qe(d==="beforeend"?Vn(a):a,d,c);else{const f=document.createElement("table");f.setAttribute("cellspacing","0"),f.setAttribute("cellpadding","0"),f.setAttribute("align","center"),f.setAttribute("border","0"),f.setAttribute("em","block"),f.setAttribute("width",a.hasAttribute("width")?a.getAttribute("width"):String(a.getBoundingClientRect().width)),f.classList.add("em-mob-width-100perc"),Qn(f,`
164
- `+c+`
165
- `),f.querySelectorAll('tr[em="block"]').forEach(h=>h.removeAttribute("em")),m?r.insertCountdown({targetElem:a,targetPlace:d,atomHTML:r.getOuterHtml(f)}):a.insertAdjacentElement(d,f)}else m?r.insertCountdown({targetElem:a,targetPlace:d,atomHTML:`<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
166
- `+c+`
167
- </table></div>`}):qe(a,d,`
168
- <div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
169
- `+c+`
170
- </table></div>
171
- `);else m?r.insertCountdown({targetElem:a,targetPlace:d,atomHTML:c}):qe(a,d,`
172
- `+c+`
173
- `);document.querySelectorAll(".em-blockatom-insert").forEach(f=>{f.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),Un())}function B7(e,t,n){const r=document.querySelector(".em-atom-insert");if(e.match(/em="atom"><tr><td>\s*<img/gi)&&r&&(e=n.setImageWidth({atomHTML:e,targetAtom:r})),!r)return;let o="afterend";r.classList.contains("em-atom-insert_bottom-document")||r.classList.contains("em-atom-insert_bottom")?o="afterend":(r.classList.contains("em-atom-insert_top-document")||r.classList.contains("em-atom-insert_top"))&&(o="beforebegin");const i=!!e.match(/class="em-countdown"/gi);if(r.tagName==="TR"){const s=document.createElement("div");Qn(s,e);const a=s.querySelector('[em="atom"]');a&&a.removeAttribute("em");let l=0;const c=r.querySelector("[colspan]");c?l=c.getAttribute("colspan")||0:l=r.childElementCount,i?n.insertCountdown({targetElem:r,targetPlace:o,atomHTML:`
174
- <tr em="atom"><td colspan="`+l+`">
175
- `+s.innerHTML+`
176
- </td></tr>
177
- `}):qe(r,o,`
178
- <tr em="atom"><td colspan="`+l+`">
179
- `+s.innerHTML+`
180
- </td></tr>
181
- `)}else i?n.insertCountdown({targetElem:r,targetPlace:o,atomHTML:e}):qe(r,o,`
182
- `+e+`
183
- `);r.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),Un())}function kE(e,t){const n=t.mutableState.atomReplaced;let r={settings:{}};const o=e.target,i=u=>t._setDocumentStyles(u,{minify:t.minify,cssbeautify:t.cssbeautify,HTMLDocument:t.HTMLDocument}),s=e.dataTransfer?.getData("Text")||"";if(s&&t.isJsonString(s)?r=JSON.parse(s):n&&(r={settings:{atomHTML:Ua(n)}}),!r.settings?.atomHTML)return;let a=r.settings.atomHTML.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();i(r.settings.atomHTML.match(/<style((.|\n|\r)*?)<\/style>/g)),a=t.commonStylesApply({html:a});const l=o.closest('[em="block"]')&&o.tagName==="TD"&&!o.innerHTML&&!o.hasAttribute("height")&&(o.classList.contains("em-atom-insert-empty")||p7()),c=o.tagName==="DIV"&&o.closest("amp-accordion")&&!o.innerHTML;if(l||c){I7(o,a,n,r,t);return}if(document.querySelector(".em-blockatom-insert")||un(o)){D7(e,a,r,t,i);return}o.closest('[em="atom"]')&&B7(a,r,t)}var H7=/^[\t\n\f\r ]*$/;function F7(e,t){const n=[...e.childNodes],r=n.every(o=>o===t||o.nodeType===Node.TEXT_NODE&&H7.test(o.textContent??""));e.replaceWith(...r?[t]:n)}function $7(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&&(F7(i,o),t.setCursorPosition(o))}}if(e.src!==void 0&&sp(r)&&Tt(r,"src",e.src??""),e.src!==void 0&&CE(),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,Tt(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)Tt(i,"src",o);else{const s=document.createElement("em-replace");Tt(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 W7(e,t){const{activeElement:n,textStyleProperties:r,toggleTextStyle:o}=t;if(e.href!==void 0&&(n.setAttribute("href",e.href),ms(e.href)&&n.removeAttribute("target")),e.target&&!(e.href&&ms(e.href))&&n.setAttribute("target",e.target),r.some(i=>e.hasOwnProperty(i)))try{o(n,{settings:e})}catch{}}function q7(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 z7(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 V7(e){const t=e.settings.textReplacer;return typeof t=="string"&&t.includes("~~")}var hs=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];function U7(e){const t=i=>{e.commit(i)},n={addFontFamilyClass:i=>Qi(i,t),clearLinkTags:i=>{Mr(i,t),mr(t)}},r=(i,s)=>{const{settings:a}=i,l=Ll(s),c={setElementMobileWidth:h1,setElementMobileHeight:Bo,setElementMobileBorder:TD,setElementMobileBorderRadius:_D,setElementMobileBoxShadow:kD,setElementMobileAlign:g1,setElementMobileTableAlign:LD,setElementMobileVerticalAlign:b1,setElementMobileDirection:ND,setElementMobileBackgroundColor:xD,setElementMobileBackgroundImage:MD,setElementMobileBackgroundPositionX:RD,setElementMobileBackgroundPositionY:OD,setElementMobileBackgroundRepeat:PD,setElementMobileBackgroundSize:ID,setElementMobilePadding:ns,setElementMobileFontSize:y1,setElementMobileLineHeight:v1,setElementShow:E1},u={setElementBorder:Vd,setElementBoxShadow:WP,setElementBorderRadius:Xi},d={activeElement:s,setPercentsForColumns:Jc,setElementMobileHeight:Bo},m={parseTableElementToModel:ts,tableModelToHtml:It,updateTablePadding:tD,updateBackgroundPosition:nD,removeStyleProperty:mD,updateBorderRadius:pD,removeClassByPrefix:bD,getCellsWithClasses:oD,updateTableCellBackgroundByIds:iD,addClassToCellsByIds:sD,getExternalBorders:lD,mergeUniCells:yD,updateCellBordersByIds:aD,getExternalCorners:uD,updateCellBorderRadiusByIds:cD,updateCellPaddingByIds:dD,removeOuterBorders:hD,simplifyBorders:gD};switch(i.type){case"img":case"countdown":case"video":$7(a,{activeElement:s,getActiveEditElement:eu,setCursorPosition:e.setCursorPosition,...u,...c});break;case"a":W7(a,{activeElement:s,textStyleProperties:hs,toggleTextStyle:e.toggleTextStyle});break;case"table":BB(a,{activeElement:s,...u,...c});break;case"td":case"structure":case"group":case"column":FB(a,{activeElement:s,requestType:i.type,textStyleProperties:hs,isElementListContainer:eB(s),isProgrammaticSelection:e.programmaticSelection,...u,...c,setContrastBlock:DD,setStructureBlocksWidth:Nl,toggleTextStyle:e.toggleTextStyle,removeEditorTags:Fo,addClassToSecondCell:T9,wrapEditor:e.wrapEditor,addNewRange:lo});break;case"button":OB(a,{activeElement:s,textStyleProperties:hs,...u,...c,toggleTextStyle:e.toggleTextStyle,compareStrings:mh});break;case"div":DB(a,{activeElement:s,...u,...c});break;case"vindent":q7(a,{activeElement:s,setElementMobileHeight:Bo});break;case"var":z7(a,{activeElement:s,isVariableText:fv});break;case"floatBlock":zB(a,{activeElement:s,setElementMobileWidth:h1,setElementMobileContentWidth:AD,setElementMobileVerticalAlign:b1,setElementShow:E1});break;case"text":a7(a,{activeElement:s,textStyleProperties:hs,toggleTextStyle:e.toggleTextStyle,collectVMLContent:kv,updateVMLComments:Lv,removeClassesByPrefix:zd,createFontClassName:$d,...n,handleTextScriptSettings:d6,handleTextReplacer:m6,handleTextAnchor:y6,unwrapNestedTags:vB,wrapInTag:sE,unwrapTag:EB,isRangeMatching:SB,splitWrapper:wB,cleanEmptyTags:CB,applicationElementSettingsSet:e.applicationElementSettingsSet,compareStrings:mh,setElementMobileFontSize:y1,setElementMobileLineHeight:v1,setElementMobileAlign:g1,updateTableStyle:o9,changeBullets:i9,changeBulletsColor:s9,changeBulletsSize:a9,changeBulletsItalic:c9,changeBulletsWeight:l9,changeBulletsStrikethrough:d9,changeBulletsUnderline:u9,findElementWithSelectedText:mi,removeEditorTags:Fo,isElementList:l.isList,isElementListOL:l.isListOL,classNameOl:l.classNameOl,classNameUl:l.classNameUl,commit:t});break;case"floatBlocksWidths":VB(a,d);break;case"floatBlocksPreset":UB(a,d);break;case"floatBlocksValign":jB(a,d);break;case"floatBlocksGap":GB(a,d);break;case"floatBlocksGapMobile":XB(a,d);break;case"carousel":n6(a,{activeElement:s,HTMLDocument:e.htmlDocument,parseFromString:Te,setElementBorderRadius:Xi,commit:t});break;case"accordion":r6(a,{activeElement:s,HTMLDocument:e.htmlDocument,parseFromString:Te,setElementBorderRadius:Xi,commit:t});break;case"social":{const p=u6(a,{activeElement:s,parseFromString:Te,commit:t});if(p)return p;break}case"customTable":v6(a,{activeElement:s,activeCell:x.get("activeCell"),state:x,...m,wrapEditor:e.wrapEditor,addNewRange:lo,toggleTextStyle:e.toggleTextStyle,textStyleProperties:hs,commit:t,...c})}return s},o=(i,s,a,l)=>{x.increment("activeElementLocked");const c=i;let u=i;e.commitLockedAsync().finally(()=>{const d=RB(u,c,s,a,{getMappedParent:m=>e.htmlDocument.getMappedParent(m)??void 0,getOuterHtml:m=>e.htmlDocument.getOuterHtml(m),parseFromString:m=>Te(m)});if(!d){x.decrement("activeElementLocked"),e.setCursorPosition(u),l?.();return}u=d.active,e.commitLockedAsync().finally(()=>{d.afterCommit(),x.decrement("activeElementLocked"),e.setCursorPosition(u),l?.()})})};return i=>{try{x.increment("activeElementLocked");const s=i.data;s.settings=e.getMapObj().escape(s.settings);const a=eu();if(!a){s.type==="customTable"&&(r(s,null),e.commitLockedAsync());return}e.beforeApply?.(s,a);const l=MB(a),c=r(s,a);e.afterApply?.(s,c);const u=V7(s)?vh():null;try{Py()}catch{}o(c,l,s,u?()=>nk(u,d=>e.htmlDocument.renderOnly(d)):void 0)}catch{}finally{Promise.resolve().then(()=>x.decrement("activeElementLocked"))}}}function j7(e,t){if(t)return e.keyCode===90?e.shiftKey?"redo":"undo":e.keyCode===89&&!e.shiftKey?"redo":void 0}function G7(e,t,n,r){if(!((window.navigator.platform.match("Mac")?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&!t&&n!=="start"&&!e.ctrlKey&&!e.metaKey))return!1;const o=e.target,i=o.tagName==="EDITOR"?o:o.closest("editor");if(i){if(i.querySelectorAll(".em-code")?.length){const u=()=>{const d=r.getAllComments(o);for(const m of d)r.isVariableComment(m)&&(r.getVariableIcon(m)||m.remove());i.removeEventListener("input",u)};i.addEventListener("input",u)}return!0}const s=document.querySelector("[em-edit]");if(!s||s.closest("editor"))return!1;const a=r.getElementParent(s);let l=s.parentNode;const c=s.closest("editor");if(r.setCursorPosition(a),s.classList.contains("em-mob-wrap")){r.removeElementEditors();const u=s.closest("tr");if(u&&[...u.cells].every(d=>!d.textContent?.trim())){const d=s.closest("table");l=d?.parentNode||null,d?.remove()}}else if(s.classList.contains("em-code")){const u=r.getVariableByIcon(s);u&&(u.parentNode?.removeChild(u),s.remove())}else if(s.tagName==="TD"&&s.innerHTML===""&&s.hasAttribute("height")){const u=s.closest("table");if(u){const d=u.previousSibling;d&&d.textContent?.trim()===""&&d.remove(),u.remove()}}else if(s.closest(".em-element-resize-img-container")){const u=s.closest(".em-element-resize-img-container");l=u.parentNode;const d=s.closest("td")?.querySelector("editor");d&&d.innerHTML===""&&d.remove(),u.remove()}else if(s.closest('[em="atom"]')){const u=s.closest('[em="atom"]');l=u.parentNode;const d=s.closest(".em-mob-wrap, .noresp-em-mob-wrap");s.tagName==="TD"&&s.previousElementSibling===null&&s.nextElementSibling===null?u.remove():s.remove(),s.tagName!=="TD"&&d&&d.textContent?.trim()===""&&(d.textContent="")}else if(s.parentElement?.tagName==="TR"&&s.parentElement.getAttribute("em")==="group"&&document.querySelectorAll('[em="group"]').length===1)s.querySelector(".em-narrow-table")?.replaceChildren();else{s.remove();const u=s.previousSibling;u&&u.textContent?.trim()===""&&u.remove()}return c&&c.remove(),l&&r.removeEmptyParents(l),r.commit(),r.messageService.send({operation:"application_element_settings_close"}),!0}function X7(e,t){if(!(e.keyCode===39||e.key==="ArrowRight"))return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0),o=r.startContainer,i=o.nodeType===Node.TEXT_NODE?o.parentElement:o;if(i?.closest("em-replace"))return!1;const s=co(i)?i.parentElement:i,a=["strong","em","u","b","i","span","a","sub","sup","strike"];let l=null;for(const p of a){const f=s?.closest(p);if(f){l=f;break}}if(!l||!t.isCaretAtEndOfStandardElement(r,l))return!1;e.preventDefault();const c=l.nextSibling;if(c&&c.nodeType===Node.TEXT_NODE&&(c.textContent?.length||0)>0){const p=c.textContent||"";return p[0]===" "||p[0]===" "?(t.setCursorPositionSimple(c,1),!0):(c.textContent=" "+p,t.setCursorPositionSimple(c,1),t.commit(),!0)}const u=l.parentNode;if(!u)return!0;if(c&&c.nodeType===Node.ELEMENT_NODE&&c.tagName==="SPAN"&&c.textContent===" ")return t.setCursorInsideSpan(c),!0;const d=document.createElement("span"),m=document.createTextNode(" ");return d.appendChild(m),c?u.insertBefore(d,c):u.appendChild(d),t.setCursorInsideSpan(d),!0}function Y7(e,t,n,r,o){if(!(e.keyCode===13&&!n||(e.key==="Enter"||e.keyCode===13)&&e.shiftKey&&n&&r))return!1;if(e.preventDefault(),e.stopImmediatePropagation(),!t)return!0;const i=window.getSelection(),s=i&&i.rangeCount>0?i.getRangeAt(0):null;if(!s)return!0;const a=i.anchorNode,l=a?.parentNode,c=l?.tagName==="A";s.collapsed||s.deleteContents();const u=document.createElement("br");if(a?.nextSibling===null&&c&&a.nodeType===Node.TEXT_NODE){if(i.anchorOffset===0)return l.parentNode.insertBefore(u,l),o.commit(),!0;if(i.anchorOffset===(a.textContent?.length||0))return l.after(u),s.setStartAfter(u),s.setEndAfter(u),o.commit(),!0}if(n){const d=t.querySelector('div[em-edit="active"]');if(!(d&&d.contains(s.startContainer))&&d){const m=d.lastChild;m&&s.setStart(m,m.textContent?.length||0)}}return s.insertNode(u),s.setStartAfter(u),s.setEndAfter(u),i.removeAllRanges(),i.addRange(s),o.commit(),!0}function K7(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?Bv(r,n.textContent||""):!1}function Z7(e){const t=r=>{const o=r.target,i=o?.closest?.("a")||o?.querySelector?.("a"),s=i?.closest("td")||i?.parentElement;!i||!s||!dr(s)||e(!1).then(()=>{const a=!!i.closest("editor")||!!i.querySelector("editor")||!!s.querySelector("editor");s.isConnected&&i.isConnected&&a&&Bv(s,i.textContent||"")&&e(!1)})},n=r=>{K7(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 Q7=new Set(["textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor"]);function J7(e){const{commit:t,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:o,getParentElementOfSelection:i,findOutermostParentWithText:s,clearLinkTags:a,addFontFamilyClass:l,getIsProgrammaticSelection:c,getCommonStyles:u}=e,d=o,m=i,p=s;function f(b,E,C){const g=!!b&&!!E&&E.tagName==="DIV"&&b.tagName==="EDITOR"&&b.parentElement===E&&E.childElementCount===1&&E.firstElementChild===b&&!Array.from(E.childNodes).some(N=>N!==b&&N.nodeType===Node.TEXT_NODE&&!!N.textContent?.trim()),w=!!b&&b.childElementCount===0&&Array.from(b.childNodes).some(N=>N.nodeType===Node.TEXT_NODE&&!!N.textContent?.trim()),T=!!b&&Oe(b).trim()===C.trim();if(!g||!w||!T||!b.hasAttribute("em-edit")||!E.parentNode)return;const _=E.parentNode,M=b.getAttribute("em-edit")||"active";for(;b.firstChild;)E.appendChild(b.firstChild);b.remove(),b.removeAttribute("em-edit"),E.setAttribute("em-edit",M),_.replaceChild(b,E),b.appendChild(E)}function h(b,E){try{return E.intersectsNode(b)}catch{const C=document.createRange();return C.selectNodeContents(b),E.compareBoundaryPoints(Range.END_TO_START,C)<0&&E.compareBoundaryPoints(Range.START_TO_END,C)>0}}function y(b){const E=b?.links||{},C=E.underline,g=E.color,w=typeof C=="boolean"?C?"underline":"none":"underline";return{color:typeof g=="string"&&g.trim()?g.trim():"inherit",textDecoration:w}}function v(b,E){if(!b||!E)return null;const C=E,g=Array.from(C.querySelectorAll("a"));C.tagName==="A"&&g.unshift(C);const w=typeof window<"u"&&window.Range?window.Range.START_TO_START:0,T=typeof window<"u"&&window.Range?window.Range.END_TO_END:2;for(const _ of g){const M=document.createRange();M.selectNodeContents(_);const N=M.compareBoundaryPoints(w,b)<=0,W=M.compareBoundaryPoints(T,b)>=0;if(N&&W)return _}return null}function A(b,E,C){const g=Array.from(E?.getElementsByTagName("span")||[]).reverse();let w=!1;Oe(E)===b&&g.length&&(w=!0),g.forEach(T=>{const _=T.getAttribute("style"),M=!!_&&_.trim().length>0;let N=Array.from(T.attributes).filter(P=>P.name!=="style");if(!M&&N.length===1&&N[0].name==="em-edit"&&T.parentElement&&!T.parentElement.hasAttribute("em-edit")){const P=T.getAttribute("em-edit")||"active";T.parentElement.setAttribute("em-edit",P),T.removeAttribute("em-edit"),N=Array.from(T.attributes).filter(R=>R.name!=="style")}const W=N.length>0;if(!M&&!W){const P=Oe(T);if(T.childNodes.length===1&&T.childNodes[0].nodeType===3){const R=T.childNodes[0];T.parentNode?.replaceChild(R,T),C.isEditorTagOutside&&Oe(E)!==b&&R.parentNode&&(C.range?.selectNode(R),n(C.range))}else{const R=Array.from(T.childNodes);R.forEach(Y=>{T.parentNode?.insertBefore(Y,T)}),b===P&&(C.range=document.createRange(),C.range.setStartBefore(R[0]),C.range.setEndAfter(R[R.length-1]),n(C.range)),T.parentNode?.removeChild(T)}}}),w&&(r(E,b),C.range.selectNode(E),n(C.range))}function k(b,E){if(b?.rangeCount>0){const C=b.getRangeAt(0),g=C.commonAncestorContainer;let w=C.startOffset,T=C.endOffset;for(;g.data&&w>0&&!/\s/.test(g.data[w-1]);)w--;for(;g.data&&T<g.length&&!/\s/.test(g.data[T]);)T++;E.setStart(g,w),E.setEnd(g,T),n(E)}}function S(b,E,C){b.innerHTML=b.innerHTML.replaceAll(/<\/?strike[^>]*>/gi,""),b.parentNode&&(C.selectNode(b),n(C),r(b,E))}return function(E,C){const g=P6(C.settings,X),w=C.settings.textColor??C.settings.textBackgroundColor;if(typeof w=="string"&&w.trim()!==""&&!X(w))return!1;const T=Ll(E),{classNameOl:_,classNameUl:M,classNameBullet:N,isListOL:W,isListUL:P,isList:R}=T;R&&T.tableElement?.querySelectorAll("tbody > tr > td:first-child")?.forEach(F=>{const et=F.querySelector(":scope > div")||F.querySelector(":scope > editor div");et&&et.classList.add(`${N}`)}),E?.querySelectorAll(".em-element-path").forEach(F=>F.remove());const Y=Object.keys(C.settings)[0];let V=window.getSelection();if(!V||V.rangeCount===0){if(!E||!E.isConnected)return;const F=document.createRange();if(F.selectNodeContents(E),V=window.getSelection(),!V)return;V.removeAllRanges(),V.addRange(F)}let G=V.getRangeAt(0);const Le=G.commonAncestorContainer;let ae=Le.nodeType===1?Le:Le.parentElement,ne=V.anchorNode?.nodeType===1?V.anchorNode:V.anchorNode?.parentElement,we=!1,j=Ke();if(E||(E=V.anchorNode?.childNodes.length===1&&V.anchorNode.firstChild?.nodeType===1?V.anchorNode.firstChild:ae,E.tagName==="EDITOR"&&(E=E.parentElement)),g.name==="textLink"&&g.value===""){const F=ae?.closest?.("a, [href]")||null;F&&(G.selectNode(F),n(G),E=F)}if(g.name==="textUnderline"&&!g.value){let F=ae.closest(["u","strike","[style*=text-decoration]","span","a"].find(et=>ae?.closest(et))||"u");!F&&E?.tagName==="A"&&(F=E),F?.tagName==="A"&&(F.style.textDecoration="none",r(F,j),G.selectNode(F),n(G),E=F,we=!0)}let z=C.type==="button"?(E||ne)?.closest("a"):(E||ne)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");const Se=C.settings.fontFamily;let Ae=null;const Q=Array.from(z?.classList||[]).some(F=>(F.startsWith("em-font-")&&(Ae=F),F.startsWith("em-font-")&&F.includes(g.name==="textItalic"?"Italic":"Bold")));Q&&(g.name==="textItalic"||g.name==="textStrong")&&Ae&&z?.classList.remove(Ae);const Lt={range:G,isEditorTagOutside:!1},U=(F=Ke(),et=z)=>{A(F,et,Lt)},In=nB,gt=oE,Wr=(F,et)=>{S(F,j,Lt.range)};let mn,ot;Y==="textColor"?mn=ot="color":Y==="textBackgroundColor"&&(mn="backgroundColor",ot="background-color");const Bt=C.settings.hasOwnProperty("textColor")||C.settings.hasOwnProperty("textBackgroundColor"),Be=!!ae?.closest("editor")||Oe(ae)===j||Oe(ae.querySelector("editor"))===j;Lt.isEditorTagOutside=Be,C.settings.hasOwnProperty("textColor")&&g.value&&document.execCommand("styleWithCSS",!1,"true");const jn=rB,As=c(),Ts=u();if(V6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X})||U6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,fontFamilyArray:Se,removeClassesByPrefix:zd,createFontClassName:$d,clearLinkTags:a,addFontFamilyClass:l,cleanEmptySpans:U}))return!1;const Ht=ae.closest(g.tags.find(F=>ae?.closest(F))||"span");(G?.collapsed||!Ke())&&(g.value?g.value&&Be&&(C.type==="button"||E.tagName==="A"&&Ht?G.selectNodeContents(Ht):k(V,G)):Ht&&G.selectNodeContents(Ht)),(C.type==="button"||E.tagName==="A"||E?.closest("a"))&&Ke()&&Ke()!==Oe(E)&&Ht&&(C.settings.hasOwnProperty("textLink")||C.settings.hasOwnProperty("textUnderline"))&&(G.selectNode(Ht),n(G),C.settings.hasOwnProperty("textUnderline")&&E.tagName==="A"&&(E.style.textDecoration=g.value?"underline":"none",we=!0)),V=window.getSelection(),G=V.getRangeAt(0),Lt.range=G,j=Ke(),Array.from(z?.querySelectorAll("span,div")||[]).reverse().forEach(F=>{F.getAttribute("style")===""&&F.removeAttribute("style"),F.hasAttribute("contenteditable")&&F.removeAttribute("contenteditable"),F.hasAttribute("em-edit")&&F.removeAttribute("em-edit"),F.hasAttribute("em-relative")&&F.removeAttribute("em-relative"),F.hasAttribute("class")&&(F.classList.remove("em-relative"),F.classList.length===0&&F.removeAttribute("class"))});let _s=null;Bt&&ot&&z?.style?.getPropertyValue?.(ot)?.trim()&&(Oe(z)===j&&(z.style[mn]=X(g.value?.toString())||"",we=!0),mn==="color"&&(ae===z||E?.closest('[style*="color"]')===z)&&(_s=X(z.style[ot]),z.style.removeProperty(ot),!z?.hasAttribute("em-edit")&&R&&z&&As&&z.closest("tr")?.querySelector(`.${N}`)?.style.removeProperty(ot)));let of=null,ce=null;if(Bt&&mn==="color"&&z?.tagName==="A"){let F=z.parentElement;for(;F&&!["BODY","HTML","TD","TH"].includes(F.tagName);){const et=F.style.getPropertyValue("color")?.trim();if(et){of=X(et)||et,ce=F,F.style.removeProperty("color");break}F=F.parentElement}}ot&&!(g.value.length===7||g.value.length===4)&&(we=!0),Be&&(!g.value&&g.name!=="fontSize"&&g.name!=="textLink"||g.value)&&(!(g.name==="textUnderline"||g.name==="textStrikethrough")||C.type!=="button")&&!we&&(g.name!=="fontSize"&&!Bt&&Oe(z)===j?document.execCommand(g.command,!1,Bt?g.value:g.name==="textLink"?" ":void 0):Oe(z)!==j&&(C.settings.hasOwnProperty("textColor")&&document.execCommand("styleWithCSS",!1,"true"),document.execCommand(g.command,!1,Bt?String(g.value):g.name==="textLink"?" ":void 0),C.settings.hasOwnProperty("textColor")&&g.value&&q6(z||ae,String(g.value),X))),j=Ke();{const F={parentElement:ae,parentNode:ne,parentWrapper:z,selection:V,range:G};X6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,activeElement:E,hasItalicClass:Q,tempStyleClass:Ae,checkForWorkClass:In,removeFormattingTags:ds,cleanEmptySpans:U,mutableState:F,currentStyle:mn,isProgrammaticSelection:As,findParentWithFontSizeAndTag:aB}),ae=F.parentElement,ne=F.parentNode,z=F.parentWrapper,V=F.selection,G=F.range,Lt.range=G}j6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,activeElement:E,hasItalicClass:Q,tempStyleClass:Ae,checkForWorkClass:In,removeFormattingTags:ds,cleanEmptySpans:U}),G6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,activeElement:E,hasItalicClass:Q,tempStyleClass:Ae,checkForWorkClass:In,removeFormattingTags:ds,cleanEmptySpans:U});const Ft={parentWrapper:z,range:G,selection:V};Y6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,activeElement:E,hasItalicClass:Q,tempStyleClass:Ae,checkForWorkClass:In,removeFormattingTags:ds,cleanEmptySpans:U,request:C,findOutermostParentWithText:p,mutableState:Ft}),z=Ft.parentWrapper,G=Ft.range,Lt.range=G;const Kl={parentWrapper:z,range:G,selection:V};if(K6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,activeElement:E,hasItalicClass:Q,tempStyleClass:Ae,checkForWorkClass:In,removeFormattingTags:ds,cleanEmptySpans:U,request:C,findOutermostParentWithText:p,cleanStrikesInElement:Wr,mutableState:Kl}),z=Kl.parentWrapper,g.value===!1&&z){const F=window.getSelection(),et=F&&F.rangeCount>0?F.getRangeAt(0):G,fn={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]}[g.name];let Dn=!1;fn&&fn.forEach(be=>{Array.from(z.getElementsByTagName(be)).reverse().forEach(bt=>{if(!h(bt,et))return;const pn=Oe(bt);if(!pn||pn.trim().length===0)return;const tt=bt.parentElement;bt.hasAttribute("em-edit")&&tt&&!tt.hasAttribute("em-edit")&&tt.setAttribute("em-edit",bt.getAttribute("em-edit")||"active"),bt.outerHTML=bt.innerHTML,Dn=!0,f(tt,z,j)})}),Dn&&setTimeout(()=>{const be=document.querySelector("[em-edit]")||d(j)||(z?.isConnected?z:null);be&&r(be,j)},0)}if(g.value===!0&&z&&Be){const F={textStrong:"strong",textItalic:"em",textStrikethrough:"s",textUnderline:"u"},et={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]},fn=F[g.name],Dn=et[g.name];if(fn&&Dn&&j&&j.trim().length>0){const be=z,bt=Dn.some($t=>be.getElementsByTagName($t).length>0),pn=(be.style?.textDecoration||"").toLowerCase(),tt=(be.style?.textDecorationLine||"").toLowerCase(),hn=pn.includes("underline")||tt.includes("underline"),yt=pn.includes("line-through")||tt.includes("line-through"),Zl=g.name==="textUnderline"&&hn||g.name==="textStrikethrough"&&yt,sf=Oe(be)===j;if(!bt&&!Zl&&sf){const $t=document.createElement(fn);for(;be.firstChild;)$t.appendChild(be.firstChild);be.appendChild($t);try{const gn=document.createRange();gn.selectNodeContents($t),n(gn),G=gn,Lt.range=gn}catch{}setTimeout(()=>{const gn=document.querySelector("[em-edit]")||d(j)||(be.isConnected?be:null);gn&&r(gn,j)},0)}}}const ks={parentWrapper:z,parentNode:ne,range:G,selection:V};Z6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,isColorChange:Bt,tempColor:_s,outerContextColor:of,outerContextElement:ce,stylePropretyName:ot,currentStyle:mn,canselExecCommand:we,isProgrammaticSelection:As,request:C,setCustomColor:jn,checkForWorkClass:In,cleanEmptySpans:U,mutableState:ks}),z=ks.parentWrapper,ne=ks.parentNode;const Gn={parentWrapper:z,parentNode:ne,range:G,selection:V};if(J6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,findOutermostParentWithText:p,activeElement:E,commonStyles:Ts,cleanEmptySpansWithParent:U,mutableState:Gn}),G=Gn.range,g.name==="textLink"&&g.value===!0&&Be&&z&&j?.trim().length>0){const F=Gn.range||G,et=j.trim(),fn=[...z?Array.from(z.querySelectorAll("a")):[],...z?.parentElement?Array.from(z.parentElement.querySelectorAll("a")):[]],Dn=fn.find(be=>Oe(be)?.trim()===et)||fn[0]||null;if(!(v(F,z)||v(F,z.parentElement)||Dn)&&F&&!F.collapsed){const be=document.createElement("a"),{color:bt,textDecoration:pn}=y(Ts);be.setAttribute("target","_blank"),be.setAttribute("href",""),be.setAttribute("new","true"),be.setAttribute("style",`color: ${bt}; text-decoration: ${pn};`);let tt=!1;const hn=z.querySelector("editor");if(hn&&Oe(hn)===j&&hn.querySelector("a")===null){for(;hn.firstChild;)be.appendChild(hn.firstChild);hn.appendChild(be),tt=!0}try{if(!tt){const yt=F.extractContents();yt.childNodes.length>0&&(be.appendChild(yt),F.insertNode(be),tt=!0)}}catch{tt=!1}if(!tt&&Oe(z)===j){for(;z.firstChild;)be.appendChild(z.firstChild);z.appendChild(be),tt=!0}if(tt){try{const yt=document.createRange();yt.selectNodeContents(be),n(yt),G=yt,Gn.range=yt,Lt.range=yt}catch{}r(be,j)}}}const st=g.name==="textUnderline"&&!g.value;if((!Bt&&we||st)&&U(j),Q7.has(g.name)){const F=Gn.parentWrapper||z||d(j)||m();F&&U(j,F)}R&&ae.querySelectorAll(`tr td:first-child > div.${N}, tr td:first-child > editor div.${N}`).forEach(F=>{F.classList.remove(`${N}`)});const Ls=d(j);Ls?.hasAttribute("em-edit")||Ls?.setAttribute("em-edit","active"),t()}}function eH(e,t){e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state");const[n]=t.parseFromString(t.HTMLDocument.getOuterHtml(e));e.after(n),t.commit()}function tH(e,t){e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state");const[n]=t.parseFromString(t.HTMLDocument.getOuterHtml(e));e.after(n),t.commit(),t.setCursorPosition(n)}function nH(e,t){if(!e.previousElementSibling)return!1;const n=e.previousElementSibling;return n.before(e),t.commit(),Z.send({operation:"application_scroll-to",settings:{value:t.scrollTop-n.getBoundingClientRect().height}}),!0}function rH(e,t){if(!e.nextElementSibling)return!1;const n=e.nextElementSibling;return n.after(e),t.commit(),Z.send({operation:"application_scroll-to",settings:{value:t.scrollTop+n.getBoundingClientRect().height}}),!0}function LE(e){e.innerHTML="",e.getAttribute("em")==="block"&&e.removeAttribute("em")}function oH(e,t){const n=e.closest("table");e.querySelector("[em-edit]")&&Z.send({operation:"application_element_settings_close"});const r=e.closest('[em="group"]');r&&n&&r.querySelectorAll('[em="block"]').length===1?LE(n):e.remove(),t.commit(),n&&t.setCursorPosition(n)}function iH(e,t){if(!t.emFilter)return;const n=document.querySelector('[em-edit="active"]')?.closest('[em="block"]');if(!n)return;const r=[...n.parentElement.children].indexOf(n),o=Po(n),i=parseFloat(o?.style.paddingTop??"")||0,s=parseFloat(o?.style.paddingBottom??"")||0;if(e.tagName==="TR"||e.tagName==="TABLE"){const a=e.querySelector("td"),l=t.emFilter({html:a.innerHTML,isPartial:!0}),c=[...e.parentNode.children].indexOf(e),u=Po(e),d=parseFloat(u?.style.paddingTop??"")||0,m=parseFloat(u?.style.paddingBottom??"")||0,p=parseFloat(u?.style.borderTopLeftRadius??"")||0,f=parseFloat(u?.style.borderTopRightRadius??"")||0,h=parseFloat(u?.style.borderBottomLeftRadius??"")||0,y=parseFloat(u?.style.borderBottomRightRadius??"")||0,v=n.querySelector("td");r>c?(qe(v,"afterbegin",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${i+m}"></td></tr></table>`),qe(v,"afterbegin",l),o&&(o.style.paddingTop=d+"px",o.style.borderTopLeftRadius=p+"px",o.style.borderTopRightRadius=f+"px",o.querySelector(":scope > .em-vindent-paddingTop")?.remove())):(qe(v,"beforeend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${s+d}"></td></tr></table>`),qe(v,"beforeend",l),o&&(o.style.paddingBottom=m+"px",o.style.borderBottomLeftRadius=h+"px",o.style.borderBottomRightRadius=y+"px",o.querySelector(":scope > .em-vindent-paddingBottom")?.remove()))}else if(e.tagName==="DIV"){const a=t.emFilter({html:e.innerHTML,isPartial:!0}),l=Array.prototype.indexOf.call(e.parentElement.children,e);qe(n,r>l?"afterbegin":"beforeend",a)}e.remove(),document.querySelector(".em-element-editor-widget-merge")?.remove(),t.commit(),t.setCursorPosition(n)}function sH(e,t){const n=Po(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=n?.querySelectorAll(':scope > table:not([em="atom"])')??[],u=c.length;c.forEach((d,m)=>{const p=e.cloneNode(!0),f=Po(p);f.style.paddingTop="0",f.style.paddingBottom="0",f.style.borderRadius="0",Qn(f,d.outerHTML),m===0?(f.style.paddingTop=r+"px",f.style.borderTopLeftRadius=i+"px",f.style.borderTopRightRadius=s+"px"):m===u-1&&(f.style.paddingBottom=o+"px",f.style.borderBottomLeftRadius=a+"px",f.style.borderBottomRightRadius=l+"px");const h=d.nextElementSibling;if(h?.getAttribute("em")==="atom"&&h.querySelector("td")?.hasAttribute("height")){const v=parseFloat(h.querySelector("td").getAttribute("height"))/2;f.style.paddingBottom=v+"px"}const y=d.previousElementSibling;if(y?.getAttribute("em")==="atom"&&y.querySelector("td")?.hasAttribute("height")){const v=parseFloat(y.querySelector("td").getAttribute("height"))/2;f.style.paddingTop=v+"px"}e.insertAdjacentElement("beforebegin",p)}),e.remove(),t.commit()}function aH(e,t){return e.previousElementSibling?(e.previousElementSibling.before(e),t.commit(),!0):!1}function lH(e,t){return e.nextElementSibling?(e.nextElementSibling.after(e),t.commit(),!0):!1}function cH(e,t){const n=document.querySelector('[em="group"]')?.cloneNode(!0);if(!n)return;const r=n.querySelector("table");r&&LE(r),e.after(n),t.commit(),Z.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+n.getBoundingClientRect().height+(t.iframeOffsetTop||0)}})}function uH(e,t){e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state");const[n]=t.parseFromString(t.HTMLDocument.getOuterHtml(e));e.after(n),t.commit(),t.setCursorPosition(n)}function dH(e,t){e.querySelector("[em-edit]")&&Z.send({operation:"application_element_settings_close"}),e.remove(),t.commit()}function mH(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 fH(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 pH(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:mH(r)};try{n.state.increment("activeElementLocked"),Z.send(i)}finally{n.commitLockedAsync(!1).finally(()=>{n.state.decrement("activeElementLocked")})}}function hH(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=Ua(i)+`
184
- `+n.HTMLDocument.getOuterHtml(e);navigator.clipboard.writeText(s),setTimeout(()=>{r&&r.style.removeProperty("background-color")},2e3)}function gH(e,t,n){navigator.clipboard.readText().then(r=>{const o=n.parseFromString(r);let i=o.filter(c=>c.tagName&&c.tagName!=="LINK"&&c.tagName!=="STYLE").map(c=>n.getOuterHtml(c)).join(""),s=o.filter(c=>c.tagName==="STYLE").map(c=>n.getOuterHtml(c)).join("");const a=o.filter(c=>c.tagName==="LINK"&&c.getAttribute("em-class")).filter(c=>!document.head?.querySelector(`link[em-class="${c.getAttribute("em-class")}"]`));if(s){let c=document.head.querySelector('style[em="styles"]'),u="";c?u=n.HTMLDocument.getInnerHtml(c):(c=document.createElement("style"),c.setAttribute("em","styles"),c=document.head.insertAdjacentElement("beforeend",c));const d=document.createElement("div");n.emailWidth&&(s=s.replace(/(max-device-width:|max-width:)\d+px/g,p=>p.replace(/\d+/,String(n.emailWidth)))),n.insertAdjacentHTML(d,"afterbegin",s);let m=n.minify(u+`
185
- `+[...d.querySelectorAll("style")].map(p=>p.innerHTML).join(`
186
- `),{restructure:!0,forceMediaMerge:!0}).css;m=n.cssbeautify(m,{indent:" ",autosemicolon:!0}),c.textContent=`
187
- `+m+`
188
- `}for(const c of a.reverse())document.head?.prepend(c),document.head?.insertAdjacentHTML("afterbegin",`
189
- `);(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"});const l=t.parentNode;if(e.tagName==="TR"){const c=document.createElement("table");n.insertAdjacentHTML(c,"afterbegin",i),c.querySelector('[em="block"]')?(c.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),e.after(c.querySelector("tr")),n.commit(),n.setCursorPosition(e)):NE(l)}else{const c=document.createElement("div");n.insertAdjacentHTML(c,"afterbegin",i),c.querySelector('[em="block"]')?(c.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),e.after(c.querySelector('[em="block"]')),n.commit(),n.setCursorPosition(e)):NE(l)}}).catch(()=>{})}function NE(e){e&&(e.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(()=>{e.style.removeProperty("background-color")},2e3))}function bH(){return document.body?.classList.contains("em-sandbox-discuss")&&!document.body.classList.contains("em-sandbox-discuss_set-target")}function yH(){return document.body?.classList.contains("em-sandbox-discuss_set-target")??!1}function vH(e){const t=e.getAttribute("em-discuss-id");return t&&Z.send({operation:"application_discuss_get_comment",settings:{targetId:t}}),!1}function EH(e,t){let n=e;const r=n.getAttribute("em-discuss-id"),o=n.classList.contains("em-discuss-id-new");if(!r||r&&o){if(document.querySelectorAll(".em-discuss-id-new").forEach(i=>{i!==n&&(i.removeAttribute("em-discuss-id"),i.removeAttribute("contenteditable"),i.removeAttribute("em-edit"))}),n.tagName==="EDITOR"&&(n=n.parentElement),n.getAttribute("em-discuss-id"))n.removeAttribute("em-discuss-id"),n.removeAttribute("contenteditable"),n.removeAttribute("em-edit"),Z.send({operation:"application_discuss_set_id",settings:{value:""}});else{const i=t.makeId(5);n.setAttribute("em-discuss-id",i),n.setAttribute("em-edit","active"),n.setAttribute("contenteditable","true"),n.classList.add("em-discuss-id-new"),Z.send({operation:"application_discuss_set_id",settings:{value:i}})}t.commit()}return{handled:!0,newClickedElement:n}}function Dl(e){e.nodeName==="#comment"&&e.textContent?.indexOf("mso")!==-1?e.remove():e.previousSibling&&Dl(e.previousSibling)}function gs(e){if(!e)return;if(e.parentElement?.tagName==="SECTION"||e.classList.contains("em-narrow-table")&&Array.from(e.childNodes).every(n=>n.nodeType===Node.TEXT_NODE)){e.innerHTML="";return}e.querySelectorAll(".em-element-editor").forEach(n=>n.remove()),e.querySelectorAll(".em-element-path").forEach(n=>n.remove()),e.querySelectorAll(".em-element-block-add").forEach(n=>n.remove()),e.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(n=>n.remove());const t=e.parentElement;if(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))e.innerHTML.trim()===""&&(e.parentElement.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1?e.innerHTML="":(e.remove(),gs(t)));else if(e.innerHTML.trim()==="")Dl(e),e.remove(),gs(t);else if(t&&!t.querySelector('div[style*="display"]')){for(const n of Array.from(e.childNodes))n.nodeName==="#text"&&n.textContent?.trim()===""?(Dl(n),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(Dl(n),n.remove());e.innerHTML.trim()===""&&gs(e)}}function SH(e,t){const n=e;if(!n||n.closest("editor")||n.firstElementChild?.tagName==="EDITOR")return!1;const r=t.getElementParent(n);let o=n.parentNode;if(r&&t.setCursorPosition(r),n.classList.contains("em-code")){const i=t.getVariableByIcon(n);i&&(i.parentNode?.removeChild(i),n.remove())}else if(n.tagName==="TD"&&n.innerHTML===""&&n.hasAttribute("height")){const i=n.closest("table");if(i){const s=i.previousSibling;s&&s?.textContent?.trim()===""&&s.remove(),i.remove()}}else if(n.closest(".em-element-resize-img-container"))o=n.closest(".em-element-resize-img-container").parentNode,n.closest(".em-element-resize-img-container").remove();else if(n.closest('[em="atom"]')){const i=n.closest('[em="atom"]');o=i.parentNode;const s=n.closest(".em-mob-wrap, .noresp-em-mob-wrap");n.tagName==="TD"&&!n.previousElementSibling&&!n.nextElementSibling?i.remove():n.remove();const a=!!s&&Array.from(s.querySelectorAll('[em="atom"]')).some(l=>l!==i);n.tagName!=="TD"&&!a&&s?.textContent?.trim()===""&&(s.textContent="")}else{n.remove();const i=n.previousSibling;i&&i?.textContent?.trim()===""&&i.remove()}return gs(o),t.commit(),Z.send({operation:"application_element_settings_close"}),!0}function wH(e){return function(n){document.body&&!document.body.classList.contains("mceNonEditable")&&(n.stopPropagation(),n.preventDefault()),e.setEditorFocus(!1);const r=n.target;if(document.documentElement.classList.contains("em-resize-start")||r.classList.contains("em-element-editor-widget")||r.classList.contains("em-element-block-add"))return;let o=r;if(!e.getLockEditor()){const h=o.closest(".em-narrow-table");if(h&&(un(h)||!h.innerHTML.trim())&&e.insertTextAtomIntoEmptyNarrowTable(h))return}const i=o.closest("a");if(i instanceof HTMLAnchorElement){const h=i.getAttribute("href")||i.href||"";if(ms(h)){const y=h.slice(1),v=document.querySelector(`a[name="${y}"]`);v&&(n.preventDefault(),v.scrollIntoView({behavior:"smooth",block:"start"}))}else i.href&&document.referrer.includes("raw")&&window.open(i.href);n.stopPropagation(),n.preventDefault()}if(o.tagName==="HTML"||o.classList.contains(je.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 m=o.closest('[em="block"]');if(m&&o.classList.contains(je.moveUp)){e.handleMoveBlockUp(m);return}if(m&&o.classList.contains(je.moveDown)){e.handleMoveBlockDown(m);return}if(m&&o.closest(".em-element-editor-widget-edit")){const h=m.querySelector("td");h&&e.applicationElementSettingsSet({elem:h}),e.setCursorPosition(m);return}if(m&&o.closest(".em-element-editor-widget-remove")){e.handleRemoveBlock(m);return}if(m&&o.closest(".em-element-editor-widget-add-block")){e.addBlockToProject(o);return}if(m&&o.closest(".em-element-editor-widget-clone")){e.handleCloneBlock(m);return}if(m&&e.isAddBlockMenuClick(o)){e.handleAddBlockMenu(m,o);return}if(m&&o.closest(".em-element-editor-widget-copy")){e.handleCopyBlock(m,o);return}if(m&&o.closest(".em-element-editor-widget-paste")){e.handlePasteBlock(m,o);return}if(m&&o.classList.contains(je.merge)){e.handleMergeBlocks(m);return}if(m&&o.classList.contains(je.unmerge)){e.handleUnmergeBlocks(m);return}const p=o.closest('[em="group"]');if(p&&o.classList.contains(je.moveUp)){e.handleMoveGroupUp(p);return}if(p&&o.classList.contains(je.moveDown)){e.handleMoveGroupDown(p);return}if(p&&o.classList.contains(je.add)){e.handleAddGroup(p);return}if(p&&o.closest(".em-element-editor-widget-edit")){e.setCursorPosition(p);const h=p.tagName!=="TR"?p:p.querySelector("td");h&&e.applicationElementSettingsSet({elem:h});return}if(p&&o.closest(".em-element-editor-widget-clone")){e.handleCloneGroup(p);return}if(p&&o.closest(".em-element-editor-widget-remove")&&o.closest(".of-group")){e.handleRemoveGroup(p);return}if(!o.closest(".em-editor-wrapper")&&!o.closest(".em-element-path")&&!o.closest(".em-element-vindent-remove")){const h=window.getSelection();if(h?.isCollapsed)e.setCursorPosition(o);else if(h&&h.rangeCount>0){const v=h.getRangeAt(0).commonAncestorContainer,A=e.findOutermostParentWithText(v);A&&e.setCursorPosition(A);const k=e.getParentElementOfSelection();k&&(o=k)}e.applicationElementSettingsSet({elem:o});const y=document.querySelector(".em-editor-wrapper");y&&(y.style.display="none"),e.setBlockGroupControlsPosition()}const f=o?.tagName==="TD"?o?.querySelector("div"):o?.closest("div")||o;o.closest(".em-element-custom-table")&&f?.tagName==="DIV"&&e.handleCustomTableClick(o,n)}}function CH(e){const t=r=>{r.target?.closest(".em-element-editor-widget-clone")||(document.querySelectorAll('.em-element-editor-widget-clone[data-open="true"]').forEach(o=>{o.setAttribute("data-open","false");const i=o.querySelector("ul");i&&(i.style.display="none")}),vl(o=>{e.commit(o)}))},n=()=>{e.messageService.send({operation:"application_focus_in_iframe"})};return document.addEventListener("click",t),document.addEventListener("click",n),{dispose(){document.removeEventListener("click",t),document.removeEventListener("click",n)}}}function xE(e,t,n,r=!0){const o=document.querySelector(e);if(!o)return;const i=o.closest("td");if(!i)return;const s=i.parentElement;if(!s)return;const a=Array.from(s.cells),l=a.indexOf(i);let c=0,u=1;for(;c<t;){let d;if(r?d=l+u:d=l-u,d<0||d>=a.length)break;a[d].classList.add(n),c++,u++}}function ME(e,t,n,r=!0){const o=document.querySelector(e);if(!o)return;const i=o.closest("td");if(!i)return;const s=i.parentElement;if(!s||s.tagName!=="TR")return;const a=s.closest("table");if(!a)return;const l=Array.from(a.rows),c=l.indexOf(s);if(c===-1)return;const u=[],d=Math.max(...l.map(v=>Array.from(v.cells).reduce((A,k)=>A+(k.colSpan||1),0))),m=new Map;for(let v=0;v<l.length;v++){u[v]=[];let A=0;const k=Array.from(l[v].cells);for(const S of k){for(;m.has(`${v}:${A}`);){const C=m.get(`${v}:${A}`);u[v][A]=C.cell,A++}const b=S.colSpan||1,E=S.rowSpan||1;for(let C=0;C<b&&A<d;C++){u[v][A+C]=S;for(let g=0;g<E;g++)if(v+g<l.length){const w=`${v+g}:${A+C}`;m.set(w,{cell:S,rowSpan:E,colSpan:b,startRow:v})}}A+=b}for(;A<d;){if(m.has(`${v}:${A}`)){const S=m.get(`${v}:${A}`);u[v][A]=S.cell}else u[v][A]=null;A++}}let p=-1;for(let v=0;v<u[c].length;v++)if(u[c][v]===i){p=v;break}if(p===-1)return;let f=0,h=1;const y=new Set;for(;f<t;){const v=r?c+h:c-h;if(v<0||v>=l.length)break;const A=u[v][p];if(!A){h++;continue}const k=`${v}:${p}`,S=m.get(k);if(A.tagName!=="TD"){h++;continue}if(y.has(A)){h++;continue}if(S&&S.startRow!==v){h++;continue}A.classList.add(n),y.add(A),f++,h++}}var RE=`
190
- <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
191
- <path d="M2.21128 13.375C1.83241 13.375 1.51172 13.2438 1.24922 12.9813C0.986719 12.7188 0.855469 12.3981 0.855469 12.0192V1.98081C0.855469 1.60194 0.986719 1.28125 1.24922 1.01875C1.51172 0.75625 1.83241 0.625 2.21128 0.625H4.74966C5.12853 0.625 5.44922 0.75625 5.71172 1.01875C5.97422 1.28125 6.10547 1.60194 6.10547 1.98081V12.0192C6.10547 12.3981 5.97422 12.7188 5.71172 12.9813C5.44922 13.2438 5.12853 13.375 4.74966 13.375H2.21128ZM9.24966 13.375C8.87078 13.375 8.55009 13.2438 8.28759 12.9813C8.02509 12.7188 7.89384 12.3981 7.89384 12.0192V1.98081C7.89384 1.60194 8.02509 1.28125 8.28759 1.01875C8.55009 0.75625 8.87078 0.625 9.24966 0.625H11.788C12.1669 0.625 12.4876 0.75625 12.7501 1.01875C13.0126 1.28125 13.1438 1.60194 13.1438 1.98081V12.0192C13.1438 12.3981 13.0126 12.7188 12.7501 12.9813C12.4876 13.2438 12.1669 13.375 11.788 13.375H9.24966ZM12.0188 1.98081C12.0188 1.92306 11.9948 1.87019 11.9467 1.82219C11.8987 1.77406 11.8458 1.75 11.788 1.75H9.24966C9.19191 1.75 9.13903 1.77406 9.09103 1.82219C9.04291 1.87019 9.01884 1.92306 9.01884 1.98081V12.0192C9.01884 12.0769 9.04291 12.1298 9.09103 12.1778C9.13903 12.2259 9.19191 12.25 9.24966 12.25H11.788C11.8458 12.25 11.8987 12.2259 11.9467 12.1778C11.9948 12.1298 12.0188 12.0769 12.0188 12.0192V1.98081Z" fill="#344966"/>
192
- </svg>
193
- `,OE=`
194
- <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
195
- <path d="M1.98081 13.1442C1.60194 13.1442 1.28125 13.013 1.01875 12.7505C0.75625 12.488 0.625 12.1673 0.625 11.7884V9.25002C0.625 8.87115 0.75625 8.55046 1.01875 8.28796C1.28125 8.02546 1.60194 7.89421 1.98081 7.89421H12.0192C12.3981 7.89421 12.7188 8.02546 12.9813 8.28796C13.2438 8.55046 13.375 8.87115 13.375 9.25002V11.7884C13.375 12.1673 13.2438 12.488 12.9813 12.7505C12.7188 13.013 12.3981 13.1442 12.0192 13.1442H1.98081ZM1.98081 6.10583C1.60194 6.10583 1.28125 5.97459 1.01875 5.71209C0.75625 5.44958 0.625 5.1289 0.625 4.75002V2.21165C0.625 1.83277 0.75625 1.51208 1.01875 1.24958C1.28125 0.987085 1.60194 0.855835 1.98081 0.855835H12.0192C12.3981 0.855835 12.7188 0.987085 12.9813 1.24958C13.2438 1.51208 13.375 1.83277 13.375 2.21165V4.75002C13.375 5.1289 13.2438 5.44958 12.9813 5.71209C12.7188 5.97459 12.3981 6.10583 12.0192 6.10583H1.98081ZM12.0192 1.98083H1.98081C1.92306 1.98083 1.87019 2.0049 1.82219 2.05302C1.77406 2.10102 1.75 2.1539 1.75 2.21165V4.75002C1.75 4.80777 1.77406 4.86065 1.82219 4.90865C1.87019 4.95677 1.92306 4.98083 1.98081 4.98083H12.0192C12.0769 4.98083 12.1298 4.95677 12.1778 4.90865C12.2259 4.86065 12.25 4.80777 12.25 4.75002V2.21165C12.25 2.1539 12.2259 2.10102 12.1778 2.05302C12.1298 2.0049 12.0769 1.98083 12.0192 1.98083Z" fill="#344966"/>
196
- </svg>
197
- `,AH=`
198
- <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(-90deg); display: inline-block;">
199
- <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
200
- </svg>
201
- `,TH=`
202
- <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(90deg); display: inline-block;">
203
- <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
204
- </svg>
205
- `,_H=`
206
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(-90deg); display: inline-block;">
207
- <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
208
- <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
209
- <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
210
- </svg>
211
- `,kH=`
212
- <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
213
- <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
214
- </svg>
215
- `,LH=`
216
- <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(180deg); display: inline-block;">
217
- <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
218
- </svg>
219
- `,NH=`
220
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(90deg); display: inline-block;">
221
- <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
222
- <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
223
- <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
224
- </svg>
225
- `,xH=`
226
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
227
- <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
228
- <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
229
- <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
230
- </svg>
231
- `,MH=`
232
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(180deg); display: inline-block;">
233
- <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
234
- <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
235
- <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
236
- </svg>
237
- `,RH=`
238
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
239
- <path d="M3 9H3.00666M5.99833 9H6.005M11.995 9H12.0017M8.99667 9H9.00333M14.9933 9H15M14.9933 15V14.4667C14.9933 13.7199 14.9933 13.3465 14.8481 13.0613C14.7204 12.8105 14.5165 12.6065 14.2657 12.4787C13.9807 12.3333 13.6075 12.3333 12.8612 12.3333H5.13215C4.38583 12.3333 4.01266 12.3333 3.72761 12.4787C3.47687 12.6065 3.273 12.8105 3.14525 13.0613C3 13.3465 3 13.7199 3 14.4667V15M14.9933 3V3.53333C14.9933 4.28007 14.9933 4.65344 14.8481 4.93865C14.7204 5.18954 14.5165 5.39351 14.2657 5.52134C13.9807 5.66667 13.6075 5.66667 12.8612 5.66667H5.13215C4.38583 5.66667 4.01266 5.66667 3.72761 5.52134C3.47686 5.39351 3.273 5.18954 3.14525 4.93865C3 4.65344 3 4.28007 3 3.53333V3" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
240
- </svg>
241
- `,OH=`
242
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(90deg); display: inline-block;">
243
- <path d="M3 9H3.00666M5.99833 9H6.005M11.995 9H12.0017M8.99667 9H9.00333M14.9933 9H15M14.9933 15V14.4667C14.9933 13.7199 14.9933 13.3465 14.8481 13.0613C14.7204 12.8105 14.5165 12.6065 14.2657 12.4787C13.9807 12.3333 13.6075 12.3333 12.8612 12.3333H5.13215C4.38583 12.3333 4.01266 12.3333 3.72761 12.4787C3.47687 12.6065 3.273 12.8105 3.14525 13.0613C3 13.3465 3 13.7199 3 14.4667V15M14.9933 3V3.53333C14.9933 4.28007 14.9933 4.65344 14.8481 4.93865C14.7204 5.18954 14.5165 5.39351 14.2657 5.52134C13.9807 5.66667 13.6075 5.66667 12.8612 5.66667H5.13215C4.38583 5.66667 4.01266 5.66667 3.72761 5.52134C3.47686 5.39351 3.273 5.18954 3.14525 4.93865C3 4.65344 3 4.28007 3 3.53333V3" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
244
- </svg>
245
- `,PE=`
246
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
247
- <path d="M7 3H11M3 5H15M13.6667 5L13.1991 12.0129C13.129 13.065 13.0939 13.5911 12.8667 13.99C12.6666 14.3412 12.3648 14.6235 12.0011 14.7998C11.588 15 11.0607 15 10.0062 15H7.9938C6.93927 15 6.41202 15 5.99889 14.7998C5.63517 14.6235 5.33339 14.3412 5.13332 13.99C4.90607 13.5911 4.871 13.065 4.80086 12.0129L4.33333 5" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
248
- </svg>
249
- `;function PH(e,t,n,r){const o=document.querySelector(".table-menu"),i=o?.closest("table");if(!i)return;const s=i?.querySelector(`.${se}`),a=ts(i),{row:l}=dm(a,se),{row:c,isOverlapped:u}=a1(a,se),{isOverlapped:d}=l1(a,se);if(!i||!s)return;const m={addBottomRow:o.querySelector('[data-id="add-bottom-row"]'),addTopRow:o.querySelector('[data-id="add-top-row"]'),removeRow:o.querySelector('[data-id="remove-row"]'),mergeTopCell:o.querySelector('[data-id="merge-top-cell"]'),mergeBottomCell:o.querySelector('[data-id="merge-bottom-cell"]'),splitHorizontalCell:o.querySelector('[data-id="split-horizontal-cell"]'),addLeftColumn:o.querySelector('[data-id="add-left-column"]'),addRightColumn:o.querySelector('[data-id="add-right-column"]'),mergeRightCell:o.querySelector('[data-id="merge-right-cell"]'),mergeLeftCell:o.querySelector('[data-id="merge-left-cell"]'),splitVerticalCell:o.querySelector('[data-id="split-vertical-cell"]'),removeColumn:o.querySelector('[data-id="remove-column"]')};m.addBottomRow&&(m.addBottomRow.style.display="block"),m.addTopRow&&(m.addTopRow.style.display="block"),m.removeRow&&(m.removeRow.style.display="block"),m.mergeTopCell&&(m.mergeTopCell.style.display="block"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="block"),m.splitHorizontalCell&&(m.splitHorizontalCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="block"),m.addRightColumn&&(m.addRightColumn.style.display="block"),m.mergeRightCell&&(m.mergeRightCell.style.display="block"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="block"),m.splitVerticalCell&&(m.splitVerticalCell.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="block"),s.getAttribute("rowspan")&&m.splitHorizontalCell&&(m.splitHorizontalCell.style.display="block"),s.getAttribute("colspan")&&m.splitVerticalCell&&(m.splitVerticalCell.style.display="block"),e&&(m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addTopRow&&(m.addTopRow.style.display="none"),m.addBottomRow&&(m.addBottomRow.style.display="none"),m.removeRow&&(m.removeRow.style.display="none")),t&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addTopRow&&(m.addTopRow.style.display="none"),m.addBottomRow&&(m.addBottomRow.style.display="none"),m.removeRow&&(m.removeRow.style.display="none")),n&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="none"),m.addRightColumn&&(m.addRightColumn.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="none")),r&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="none"),m.addRightColumn&&(m.addRightColumn.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="none")),d&&m.removeColumn&&(m.removeColumn.style.display="none"),u&&c===l&&m.removeRow&&(m.removeRow.style.display="none"),s.getAttribute("colspan")&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none")),s.getAttribute("rowspan")&&(m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"))}var IH={INSERT_COLUMN_BEFORE_TABLE:"Insert column before",INSERT_COLUMN_AFTER_TABLE:"Insert column after",MERGE_RIGHT_CELL_TABLE:"Merge right",MERGE_LEFT_CELL_TABLE:"Merge left",SPLIT_CELL_TABLE:"Split cell",REMOVE_COLUMN_TABLE:"Remove column",INSERT_ROW_BEFORE_TABLE:"Insert row before",INSERT_ROW_AFTER_TABLE:"Insert row after",MERGE_TOP_CELL_TABLE:"Merge top",MERGE_BOTTOM_CELL_TABLE:"Merge bottom",REMOVE_ROW_TABLE:"Remove row",EDIT_ATOM:"Edit"},Dt=()=>window.Locale||IH;function DH(e,t){e.forEach(n=>{t.querySelectorAll(`.${n}`).forEach(r=>r.classList.remove(n))})}function BH(e,t){const n=e?.tagName==="TD"?e?.querySelector("div"):e?.closest("div")?e?.closest("div"):e;if(!e.closest(".em-element-custom-table")||n?.tagName!=="DIV")return!1;document.querySelectorAll(`.${Ue}`).forEach(v=>{v.classList.remove(Ue)});const r=[Ay,se];let o=!1,i=!1;const s=n,a=document.querySelector(`.${se}`),l=document.querySelector(".table-menu");a&&a.classList.remove(se),l&&l.remove();const c=s.closest(".em-element-custom-table"),u=c.closest('[em="block"]'),d=I({targetElement:c,insertType:"append",className:"of-atom table-menu",style:"width: 48px; height: 28px; display: flex; position: absolute; right: 0; top: -30px; background: #FFDCC7; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); pointer-events: auto; z-index: 1001;"});let m=!1,p=1;const f=()=>({isDirectionUP:x.get("isDirectionUP"),isDirectionDOWN:x.get("isDirectionDOWN"),isDirectionLEFT:x.get("isDirectionLEFT"),isDirectionRIGHT:x.get("isDirectionRIGHT"),actualTargetCount:x.get("actualTargetCount")});c.addEventListener("mousedown",v=>{const A=v.target.tagName.toUpperCase();if(v.button===0&&A!=="UL"&&A!=="LI"&&A!=="SVG"&&A!=="PATH"&&A!=="CIRCLE"){m=!0;const k=c.querySelector(`.${se}`);document.querySelectorAll(`.${oe}`)?.forEach(S=>{S.classList.remove(oe),k?.classList.remove(se)})}}),c.addEventListener("mouseup",v=>{m=!1,v.target.closest("td")?.classList.contains("remove-basic-cell")&&x.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1})}),c.addEventListener("mouseover",v=>{const A=c.querySelector(`.${se}`);p=c.querySelectorAll(`.${oe}`).length,p=p===0?1:p;const k=v.target;if(m&&k.closest("TD")&&A){const S=k.closest("TD");c.querySelectorAll(`.${An}`).forEach(j=>j.classList.remove(An)),p===1&&c.querySelectorAll(`.${oe}`).forEach(j=>j.classList.remove(oe)),S.classList.add(An);const b=S.closest(".em-element-custom-table");if(!b)return;let E=ts(b);const C=dm(E,se);if(!C)return;const{row:g,col:w}=C,{row:T,col:_,isOverlapped:M}=a1(E,se),{row:N,col:W,isOverlapped:P}=l1(E,se);!o&&!i&&p===1&&!(M||P)&&(b.querySelectorAll(`.${oe}`).forEach(j=>j.classList.remove(oe)),S.classList.add(oe));const R=dm(E,An);if(!R)return;const{row:Y,col:V}=R;if(b.querySelectorAll(`.${An}`).forEach(j=>j.classList.remove(An)),g!==Y&&w!==V){b.querySelectorAll(`.${oe}`).forEach(j=>j.classList.remove(oe)),o=!1,i=!1;return}const{isDirectionUP:G,isDirectionDOWN:Le,isDirectionLEFT:ae,isDirectionRIGHT:ne}=f();if(!o&&!i&&!S.classList.contains("remove-basic-cell")&&(x.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),g===Y?(o=!0,i=!1,w>V&&x.set("isDirectionLEFT",!0),w<V&&x.set("isDirectionRIGHT",!0)):w===V&&(i=!0,o=!1,g>Y&&x.set("isDirectionUP",!0),g<Y&&x.set("isDirectionDOWN",!0))),g===Y&&(Le||G)||w===V&&(ne||ae)||w===V&&g===Y){x.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),o=!1,i=!1;return}if(M&&_!==null){const{isDirectionRIGHT:j,isDirectionLEFT:z}=f();if(j&&_-V<=0&&_>w){b.querySelectorAll(`.${oe}`).forEach(Se=>Se.classList.remove(oe));return}if(z&&V-_<=0&&_<w){b.querySelectorAll(`.${oe}`).forEach(Se=>Se.classList.remove(oe));return}}if(P&&N!==null){const{isDirectionDOWN:j,isDirectionUP:z}=f();if(j&&N-Y<=0&&N>g){b.querySelectorAll(`.${oe}`).forEach(Se=>Se.classList.remove(oe));return}if(z&&Y-N<=0&&N<g){b.querySelectorAll(`.${oe}`).forEach(Se=>Se.classList.remove(oe));return}}if(g===Y&&o){i=!1;const{isDirectionRIGHT:j,isDirectionLEFT:z}=f();if(j){const Se=V-w;if(x.set("actualTargetCount",Sl(E,Y,V,g,w,!0)),Se<0){x.set("isDirectionRIGHT",!1),o=!1,i=!1;return}b.querySelectorAll(`.${oe}`).forEach(Ae=>Ae.classList.remove(oe)),xE(`.${se}`,x.get("actualTargetCount"),oe,!0)}if(z){const Se=w-V;if(x.set("actualTargetCount",Sl(E,g,w,Y,V,!0)),Se<0){x.set("isDirectionLEFT",!1),o=!1,i=!1;return}b.querySelectorAll(`.${oe}`).forEach(Ae=>Ae.classList.remove(oe)),xE(`.${se}`,x.get("actualTargetCount"),oe,!1)}b.querySelectorAll(`.${An}`).forEach(Se=>Se.classList.remove(An))}if(w===V&&i){o=!1;const{isDirectionDOWN:j,isDirectionUP:z}=f();if(j){const Se=Y-g;if(x.set("actualTargetCount",Sl(E,Y,V,g,w,!1)),Se<0){x.set("isDirectionDOWN",!1),o=!1,i=!1;return}b.querySelectorAll(`.${oe}`).forEach(Ae=>Ae.classList.remove(oe)),ME(`.${se}`,x.get("actualTargetCount"),oe,!0)}if(z){const Se=g-Y;x.set("actualTargetCount",Sl(E,g,w,Y,V,!1)),Se<0&&(x.set("isDirectionUP",!1),o=!1,i=!1),b.querySelectorAll(`.${oe}`).forEach(Ae=>Ae.classList.remove(oe)),ME(`.${se}`,x.get("actualTargetCount"),oe,!1)}b.querySelectorAll(`.${An}`).forEach(Se=>Se.classList.remove(An))}const we=b.querySelectorAll(`.${oe}`);S.classList.contains("remove-basic-cell")&&we?.length>1&&(we?.forEach(j=>{j.classList.remove(oe)}),o=!1,i=!1)}}),HH(d,c,u,t,r);const h=s.closest("td");h.classList.add(se);function y(v){const A=v.target;!u.contains(A)&&!d.contains(A)&&(d.remove(),h&&(document.querySelectorAll(`.${oe}`)?.forEach(k=>{k.classList.remove(oe)}),document.querySelectorAll(`.${Ue}`).forEach(k=>{k.classList.remove(Ue)}),h.classList.remove(se)),document.removeEventListener("click",y))}return document.addEventListener("click",y),!0}function HH(e,t,n,r,o){const i=PH;function s(v){const A=v.querySelector("ul"),k=v.getAttribute("data-open")==="true",S=r.target.closest("td")?.classList.contains(se),b=t.querySelectorAll(`.${oe}`);S&&b?.length===0&&x.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1});const{isDirectionUP:E,isDirectionDOWN:C,isDirectionLEFT:g,isDirectionRIGHT:w}={isDirectionUP:x.get("isDirectionUP"),isDirectionDOWN:x.get("isDirectionDOWN"),isDirectionLEFT:x.get("isDirectionLEFT"),isDirectionRIGHT:x.get("isDirectionRIGHT")};i(E,C,g,w),e.querySelectorAll("[data-open]").forEach(T=>{T!==v&&T.getAttribute("data-open")==="true"&&(T.setAttribute("data-open","false"),T.querySelector("ul").style.display="none")}),k||(v.setAttribute("data-open","true"),A.style.display="block")}function a(v){const A=v.querySelector("ul");v.getAttribute("data-open")==="true"&&(v.setAttribute("data-open","false"),A.style.display="none")}function l(v){v.stopPropagation(),v.preventDefault();const A=v.target,k=A.closest("li"),S=k?.getAttribute("data-id"),b=k?.closest("tr"),E=k?.closest("td");b?.classList.add(Ay),E?.classList.add(se);const C=A.closest("table");if(!k||!C)return;const g=ts(C),w=C.querySelectorAll(`.${oe}`).length;switch(S){case"add-bottom-row":{const N=r1(g,se,!1);C.innerHTML=It(N);break}case"add-top-row":{const N=r1(g,se,!0);C.innerHTML=It(N);break}case"remove-row":{const N=ZI(g,se);C.innerHTML=It(N);break}case"merge-top-cell":{const N=w===0?s1(g,se,!0,w+1):u1(g,se,oe);C.innerHTML=It(N);break}case"merge-bottom-cell":{const N=w===0?s1(g,se,!1,w+1):u1(g,se,oe);C.innerHTML=It(N);break}case"split-horizontal-cell":{const N=eD(g,se);C.innerHTML=It(N);break}case"add-left-column":{const N=o1(g,se,!0);C.innerHTML=It(N);break}case"add-right-column":{const N=o1(g,se,!1);C.innerHTML=It(N);break}case"merge-right-cell":{const N=w===0?i1(g,se,!1,w+1):c1(g,se,oe);C.innerHTML=It(N);break}case"merge-left-cell":{const N=w===0?i1(g,se,!0,w+1):c1(g,se,oe);C.innerHTML=It(N);break}case"split-vertical-cell":{const N=JI(g,se);C.innerHTML=It(N);break}case"remove-column":{const N=QI(g,se);C.innerHTML=It(N);break}}const T=k.closest("ul");T.parentElement.setAttribute("data-open","false"),T.style.display="none",e.querySelectorAll('[data-open="true"]').forEach(N=>{N.setAttribute("data-open","false"),N.querySelector("ul").style.display="none"});const _=document.querySelector(`.${se}`),M=document.querySelector(".table-menu");_?.classList.remove(se),M?.remove(),document.querySelectorAll(`.${oe}`).forEach(N=>{N.classList.remove(oe)}),DH(o,C),Er()}function c(v){s(v.currentTarget)}function u(v){a(v.currentTarget)}const d=I({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-edit",HTMLcontent:RE,title:"Колонки"});d.setAttribute("data-open","false");const m=I({targetElement:d,insertType:"append",tag:"ul",style:_y}),p={targetElement:m,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:Ty};I({...p,HTMLcontent:RE,title:"",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px","data-id":"menu-item"}),I({...p,HTMLcontent:AH,title:Dt().INSERT_COLUMN_BEFORE_TABLE,"data-id":"add-left-column"}),I({...p,HTMLcontent:TH,title:Dt().INSERT_COLUMN_AFTER_TABLE,"data-id":"add-right-column"}),I({...p,HTMLcontent:NH,title:Dt().MERGE_RIGHT_CELL_TABLE,"data-id":"merge-right-cell"}),I({...p,HTMLcontent:_H,title:Dt().MERGE_LEFT_CELL_TABLE,"data-id":"merge-left-cell"}),I({...p,HTMLcontent:OH,title:Dt().SPLIT_CELL_TABLE,"data-id":"split-vertical-cell"}),I({...p,HTMLcontent:PE,title:Dt().REMOVE_COLUMN_TABLE,"data-id":"remove-column"}),m.addEventListener("click",l),d.addEventListener("mouseenter",c),d.addEventListener("mouseleave",u);const f=I({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-clone",HTMLcontent:OE,title:"Строки"});f.setAttribute("data-open","false");const h=I({targetElement:f,insertType:"append",tag:"ul",style:_y}),y={targetElement:h,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:Ty};I({...y,HTMLcontent:OE,title:Dt().EDIT_ATOM||"Edit",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px"}),I({...y,HTMLcontent:kH,title:Dt().INSERT_ROW_BEFORE_TABLE,"data-id":"add-top-row"}),I({...y,HTMLcontent:LH,title:Dt().INSERT_ROW_AFTER_TABLE,"data-id":"add-bottom-row"}),I({...y,HTMLcontent:xH,title:Dt().MERGE_TOP_CELL_TABLE,"data-id":"merge-top-cell"}),I({...y,HTMLcontent:MH,title:Dt().MERGE_BOTTOM_CELL_TABLE,"data-id":"merge-bottom-cell"}),I({...y,HTMLcontent:RH,title:Dt().SPLIT_CELL_TABLE,"data-id":"split-horizontal-cell"}),I({...y,HTMLcontent:PE,title:Dt().REMOVE_ROW_TABLE,"data-id":"remove-row"}),h.addEventListener("click",l),f.addEventListener("mouseenter",c),f.addEventListener("mouseleave",u)}function FH(){yl({scrollTop:x.get("scrollTop")})}function $H(e){const{htmlDocument:t,commit:n}=e,r=()=>({parseFromString:o=>Te(o),HTMLDocument:t,commit:n,setCursorPosition:e.setCursorPosition,scrollTop:x.get("scrollTop"),iframeOffsetTop:x.get("iframeOffsetTop"),applicationElementSettingsSet:e.applicationElementSettingsSet,emFilter:ko});document.onclick=wH({getLockEditor:()=>!!x.get("lockEditor"),setEditorFocus:e.setEditorFocus,setCursorPosition:e.setCursorPosition,getParentElementOfSelection:da,findOutermostParentWithText:Qc,setBlockGroupControlsPosition:FH,applicationElementSettingsSet:e.applicationElementSettingsSet,insertTextAtomIntoEmptyNarrowTable:e.insertTextAtomIntoEmptyNarrowTable??(()=>!1),handleRemoveAtom:o=>SH(o,{getElementParent:i=>Cl(i),setCursorPosition:e.setCursorPosition,getVariableByIcon:cl,commit:n}),handleCloneAtom:o=>eH(o,r()),handleMoveBlockUp:o=>nH(o,r()),handleMoveBlockDown:o=>rH(o,r()),handleRemoveBlock:o=>oH(o,r()),handleCloneBlock:o=>tH(o,r()),handleCopyBlock:(o,i)=>hH(o,i,{HTMLDocument:t}),handlePasteBlock:(o,i)=>gH(o,i,{HTMLDocument:t,parseFromString:Te,getOuterHtml:Vt,minify:kr,cssbeautify,insertAdjacentHTML:qe,setBlockMaxWidth:s=>Mm(s,t),setFloatBlocksWidth:s=>Nm(s,t),checkBlockAdaptivity:ll,commit:n,setCursorPosition:e.setCursorPosition,emailWidth:x.get("emailWidth"),appName:x.get("appName")}),handleMergeBlocks:o=>iH(o,r()),handleUnmergeBlocks:o=>sH(o,r()),isAddBlockMenuClick:fH,handleAddBlockMenu:(o,i)=>pH(o,i,{removeAllAttributes:Jn,state:x,commitLockedAsync:e.commitLockedAsync}),addBlockToProject:o=>PI(o,{HTMLDocument:t,messageService:e.messageService}),handleMoveGroupUp:o=>aH(o,r()),handleMoveGroupDown:o=>lH(o,r()),handleAddGroup:o=>cH(o,r()),handleCloneGroup:o=>uH(o,r()),handleRemoveGroup:o=>dH(o,r()),isDiscussViewMode:bH,isDiscussSetTargetMode:yH,handleDiscussViewClick:vH,handleDiscussSetTargetClick:o=>EH(o,{makeId:W_,commit:n}),handleCustomTableClick:BH}),CH({commit:n,messageService:e.messageService})}function IE(e,t){const n=JSON.stringify({settings:t});return{target:e,dataTransfer:{getData:r=>r==="Text"?n:""},preventDefault:()=>{},stopPropagation:()=>{}}}function WH(e){return!e.closest(".em-element-editor-widget")}function qH(e,t){if(t.lockEditor)return!1;const n=bE();if(!n)return!1;const r=e.target;if(!(r instanceof HTMLElement)||!WH(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;kE(IE(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;TE(IE(r,o.settings),o,t.blockDropCtx)}else return!1;if(!bE())return e.preventDefault(),e.stopPropagation(),AE(),t.commit(),!0}catch{return!1}return!1}var DE="application/x-emailmaker-social-reorder";function Xm(e){return e.closest('table[em-type="social"]')}function BE(e){return(e.querySelector('table[role="presentation"]')||e.querySelector("table"))?.querySelector("tr")}function HE(e){return Array.from(e.querySelectorAll(":scope > td[em-platform], :scope > td[data-em-platform]"))}function zH(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 VH(e,t){const n=zH(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 UH(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=Xm(n);if(!r)return;const o=BE(r);if(!o)return;const i=HE(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(DE,l),a.effectAllowed="move"}function jH(e,t){const n=e.dataTransfer;if(!n||!Array.from(n.types||[]).includes("application/x-emailmaker-social-reorder"))return!1;let r=n.getData(DE);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=Xm(i);if(!s)return!1;const a=BE(s);if(!a)return!1;const l=HE(a);if(l.length<2)return!1;const c=l.indexOf(i);if(c<0)return!1;const u=l[o];if(!u||Xm(u)!==s)return!1;if(o===c)return!0;const d=[...l];return d.splice(o,1),d.splice(c,0,u),VH(a,d),s.setAttribute("em-edit","active"),t.applicationElementSettingsSet({elem:s}),!0}function GH(){return{targetBlock:null,newTargetblock:null,atomReplaced:null}}function Ir(){return!!x.get("lockEditor")}function XH(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=H1(t);setTimeout(()=>e.messageService.send({operation:"application_open-image-ai-popup",src:n}),1e3)}function YH(e,t,n){if(!Ir())try{e.preventDefault(),e.stopPropagation();const r=A7(e,{lockEditor:!1,applicationElementSettingsSet:t.applicationElementSettingsSet,messageService:t.messageService})||jH(e,{applicationElementSettingsSet:t.applicationElementSettingsSet});if(x.increment("activeElementLocked"),!r){if(document.body.classList.contains("em-block-insert-body"))try{const o=JSON.parse(e.dataTransfer?.getData("Text")||"{}");TE(e,o,{...t.blockDropContext(),mutableState:n})}catch{}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside"))try{kE(e,{...t.atomDropContext(),mutableState:n})}catch{}}AE(),t.commit()}finally{Promise.resolve().then(()=>{x.decrement("activeElementLocked"),XH(t)})}}function KH(e){const{dragState:t}=e;document.addEventListener("drag",n=>n.preventDefault(),!1),document.addEventListener("dragstart",n=>UH(n,{lockEditor:Ir()}),!0),document.addEventListener("dragstart",n=>T7(n,{lockEditor:Ir(),commit:r=>{e.commit(r)},messageService:e.messageService,mutableState:t}),!1),document.addEventListener("dragover",n=>k7(n,{lockEditor:Ir(),mutableState:t}),!1),document.addEventListener("dragenter",n=>L7(n,{lockEditor:Ir(),mutableState:t,requireEvenEmptyCell:e.requireEvenEmptyCell}),!1),document.addEventListener("dragleave",n=>M7(n,{lockEditor:Ir(),mutableState:t}),!1),document.addEventListener("drop",n=>YH(n,e,t),!1),document.addEventListener("dragend",n=>_7(n,{lockEditor:Ir(),messageService:e.messageService}),!1)}function ZH(e){const{htmlDocument:t}=e,n=m=>e.commit(m),r=GH(),o=e.commonStylesApply??(m=>Gv(m,p=>e.commit(p))),i=m=>{dv(m,()=>e.commit())},s=m=>Mm(m,t),a=m=>Nm(m,t),l=()=>({messageService:e.messageService,isJsonString:F_,getOuterHtml:Vt,minify:kr,cssbeautify,HTMLDocument:t,_setDocumentStyles:(m,p)=>Fd(m,p),commonStylesApply:o,commonStylesApplyToBlock:nm,setImageWidth:xd,setFloatBlocksWidth:a,fitImagesToColumns:xm,insertCountdown:i}),c=()=>({...l(),lockEditor:!!x.get("lockEditor"),state:x,commit:n,emailWidth:x.get("emailWidth")??null,parseFromString:m=>Te(m),isTableElement:X0,insertAdjacentHTML:qe,uptimeCountdown:Md,setBlockMaxWidth:s,checkBlockAdaptivity:ll,applicationElementSettingsSet:e.applicationElementSettingsSet});return{insertContext:()=>({state:x,commit:()=>e.commit(),lockEditor:!!x.get("lockEditor"),emailWidth:x.get("emailWidth"),iframeOffsetTop:x.get("iframeOffsetTop"),previewHeight:x.get("previewHeight"),parseFromString:m=>Te(m),getOuterHtml:Vt,HTMLDocument:t,minify:kr,cssbeautify,insertAdjacentHTML:qe,messageService:e.messageService,setDocumentStyles:m=>Fd(m,{minify:kr,cssbeautify,HTMLDocument:t}),setImageWidth:xd,commonStylesApply:o,commonStylesApplyToBlock:nm,insertCountdown:i,uptimeCountdown:Md,setBlockMaxWidth:s,setFloatBlocksWidth:a,fitImagesToColumns:xm,checkBlockAdaptivity:ll,setAtomReplaced:m=>{r.atomReplaced=m},assetsRoot:e.assetsRoot}),register:()=>{document.addEventListener("click",m=>{x.get("lockEditor")||qH(m,{lockEditor:!1,commit:n,atomDropCtx:{...l(),mutableState:r},blockDropCtx:{...c(),mutableState:r}})},!0),KH({dragState:r,commit:n,messageService:e.messageService,applicationElementSettingsSet:e.applicationElementSettingsSet,atomDropContext:l,blockDropContext:c,requireEvenEmptyCell:e.requireEvenEmptyCell})}}}var QH="./js/sanitize-html/sanitize-html.js",FE="data-sanitize-html-loader",Bl=null,bs=null;function JH(){return new URL(QH,document.baseURI||window.location.href).href}function Ym(){const e=globalThis.sanitizeHtml;return typeof e!="function"||!("defaults"in e)?null:e}function eF(){if(Ym())return Promise.resolve();const e=JH();return document.querySelector(`script[${FE}]`)?bs??Promise.resolve():(bs||(bs=new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.async=!0,r.setAttribute(FE,"true"),r.onload=()=>t(),r.onerror=()=>{r.remove(),bs=null,n(new Error(`Failed to load sanitize-html script: ${e}`))},document.head.appendChild(r)})),bs)}async function tF(){const e=Ym();return e||(Bl||(Bl=(async()=>{await eF();const t=Ym();if(t)return t;throw new Error("sanitizeHtml not available after script load")})().catch(t=>{throw Bl=null,t})),Bl)}async function $E(e,t=!1,n,r,o){e.preventDefault(),e.stopPropagation();try{const i=e.clipboardData||window.clipboardData;if(!i)return;let s=i.getData("text/html");if(!s||t)s=i.getData("text/plain"),s=s.replace(/\n/g,"<br>");else{const l=n?.text?.fontSize||16;let c=(await tF())(s,{allowedTags:["strong","em","i","a","br","span","ul","ol","li","strike","sub","sup","s"],allowedAttributes:{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"]},allowedStyles:{},transformTags:{span:function(y,v){let A="",k=!1,S=!1;if(v.style){const b=v.style.toLowerCase();(b.includes("font-weight: bold")||b.includes("font-weight:bold")||b.includes("font-weight: 700")||b.includes("font-weight:700"))&&(k=!0),(b.includes("font-style: italic")||b.includes("font-style:italic"))&&(S=!0),b.includes("text-decoration: underline")||b.includes("text-decoration:underline"),k&&S?(A="strong",v["data-italic"]="true"):k?A="strong":S&&(A="em")}return{tagName:A||"",attribs:v}},h1:function(y,v){return v["data-font-size"]=Math.round(1.5*l).toString(),v.style&&(v.style.toLowerCase().includes("font-style: italic")||v.style.toLowerCase().includes("font-style:italic"))&&(v["data-italic"]="true"),{tagName:"span",attribs:v}},h2:function(y,v){return v["data-font-size"]=Math.round(1.25*l).toString(),v.style&&(v.style.toLowerCase().includes("font-style: italic")||v.style.toLowerCase().includes("font-style:italic"))&&(v["data-italic"]="true"),{tagName:"span",attribs:v}},h3:function(y,v){return v["data-font-size"]=Math.round(1.125*l).toString(),v.style&&(v.style.toLowerCase().includes("font-style: italic")||v.style.toLowerCase().includes("font-style:italic"))&&(v["data-italic"]="true"),{tagName:"span",attribs:v}},h4:function(y,v){return v["data-font-size"]=l.toString(),v["data-bold"]="true",v.style&&(v.style.toLowerCase().includes("font-style: italic")||v.style.toLowerCase().includes("font-style:italic"))&&(v["data-italic"]="true"),{tagName:"span",attribs:v}},h5:function(y,v){return v["data-font-size"]=Math.round(.875*l).toString(),v.style&&(v.style.toLowerCase().includes("font-style: italic")||v.style.toLowerCase().includes("font-style:italic"))&&(v["data-italic"]="true"),{tagName:"span",attribs:v}},ul:function(y,v){return v["data-list-type"]="unordered",delete v.style,delete v["margin-top"],delete v["margin-bottom"],delete v["padding-inline-start"],{tagName:"ul",attribs:v}},ol:function(y,v){return v["data-list-type"]="ordered",v.start&&(v["data-list-start"]=v.start),delete v.style,delete v.start,{tagName:"ol",attribs:v}},li:function(y,v){return v["data-list-item"]="true",delete v.style,delete v.dir,delete v["aria-level"],delete v["list-style-type"],{tagName:"li",attribs:v}},p:function(y,v){return{tagName:"br",attribs:{}}},div:"br",b:function(y,v){if(v.style){const A=v.style.toLowerCase();return A.includes("font-weight: bold")||A.includes("font-weight:bold")||A.includes("font-weight: 700")||A.includes("font-weight:700")?{tagName:"strong"}:!1}return{tagName:"strong"}},i:function(y,v){if(v.style){const A=v.style.toLowerCase();return A.includes("font-style: italic")||A.includes("font-style:italic")?{tagName:"em"}:!1}return{tagName:"em"}},s:function(y,v){return{tagName:"strike",attribs:v}}},textFilter:function(y){return y.replace(/\s+/g," ")}});c=c.replace(/<[^\/>][^>]*>\s*<\/[^>]+>/g,"").replace(/(<br\s*\/?>){2,}/g,"<br>").trim();const u=document.createElement("div");u.innerHTML=c,(y=>{y.querySelectorAll("ul[data-list-type], ol[data-list-type]").forEach((v,A)=>{const k=v.getAttribute("data-list-type")==="ordered",S=v.querySelectorAll("li[data-list-item]");let b=1;k&&v.getAttribute("data-list-start")&&(b=parseInt(v.getAttribute("data-list-start"),10)||1);const E=document.createDocumentFragment(),C=v.previousSibling;C&&(C.nodeType===Node.TEXT_NODE&&C.textContent.trim()!==""||C.nodeType===Node.ELEMENT_NODE&&C.tagName!=="BR")&&E.appendChild(document.createElement("br")),S.forEach((g,w)=>{const T=document.createElement("span");T.innerHTML=k?`${b}. `:"• ",E.appendChild(T),(M=>{const N=document.createElement("div");N.innerHTML=M.innerHTML;let W=N.firstChild;for(;W&&W.nodeType===1&&W.tagName==="BR";)N.removeChild(W),W=N.firstChild;if(!N.hasChildNodes()){const P=document.createTextNode("");N.appendChild(P)}for(;N.firstChild;)E.appendChild(N.firstChild)})(g),w<S.length-1&&E.appendChild(document.createElement("br")),b++}),v.parentNode.replaceChild(E,v)}),y.querySelectorAll("[data-list-type], [data-list-item], [data-list-start]").forEach(v=>{v.removeAttribute("data-list-type"),v.removeAttribute("data-list-item"),v.removeAttribute("data-list-start")})})(u),u.firstChild&&u.firstChild.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="BR"&&u.removeChild(u.firstChild),u.querySelectorAll("[data-font-size]").forEach(y=>{let v=`font-size: ${y.getAttribute("data-font-size")}px;`;y.getAttribute("data-bold")==="true"&&(v+=" font-weight: bold;"),y.getAttribute("data-italic")==="true"&&(v+=" font-style: italic;"),y.setAttribute("style",v),y.removeAttribute("data-font-size"),y.removeAttribute("data-bold"),y.removeAttribute("data-italic")}),u.querySelectorAll("[data-italic]").forEach(y=>{const v=document.createElement("em");v.innerHTML=y.innerHTML,y.innerHTML="",y.appendChild(v),y.removeAttribute("data-italic")}),u.querySelectorAll("a").forEach(y=>{const v=y.getAttribute("href");if(!v||v.trim()==="")y.replaceWith(...y.childNodes);else{y.setAttribute("target","_blank");const A=n?.links?.color??"#1C52DC",k=n?.links?.underline??!0?"underline":"none";y.setAttribute("style",`color: ${A}; text-decoration: ${k};`)}});const m=u.querySelectorAll("*");let p=0;m.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),p++)}),u.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),p++)});const f=window.getSelection(),h=f?.anchorNode?.nodeType===Node.ELEMENT_NODE?f.anchorNode:f?.anchorNode?.parentElement||null;kB(u,h),LB(u,h),s=u.innerHTML}const a=window.getSelection();if(a&&a.rangeCount>0){const l=a.getRangeAt(0);l.deleteContents();const c=document.createRange().createContextualFragment(s);l.insertNode(c),l.collapse(!1)}}catch{const s=(e.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,s)}r(e),o()}function WE(e,t){const{target:n}=e;setTimeout(()=>{const r=n?.querySelector("a");if(!r)return;const o=r.closest("div, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");o&&(o.childNodes.forEach(i=>{if(i.nodeType===Node.COMMENT_NODE&&i.nodeValue?.includes("[if mso]")){const s=r.innerHTML.length*11+40;i.nodeValue=i.nodeValue.replace(/(<center[^>]*>)(.*?)(<\/center>)/s,(a,l,c,u)=>l+r.innerHTML+u).replace(/(width:)(\d+)(px)/,(a,l,c,u)=>`${l}${s}${u}`)}}),t(!1))},0)}function nF(e){let t=!1;const n=o=>{t=!!o.target?.nodeName},r=o=>{t&&e.handlePasteTextFragment(o,!1,e.getCommonStyles(),e.changeMsoValue,()=>{e.commit()})};return document.addEventListener("contextmenu",n),document.addEventListener("paste",r),{setFromContextMenu(o){t=o},dispose(){document.removeEventListener("contextmenu",n),document.removeEventListener("paste",r)}}}function rF(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 oF(e,t,n,r){try{if(!n||n.nodeType!==Node.TEXT_NODE)return!1;const o=n.textContent?n.textContent.length:0,i=Math.min(Math.max(0,r),o);return e.setStart(n,i),e.collapse(!0),t.removeAllRanges(),t.addRange(e),!0}catch{return!1}}var qE='<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>',zE='<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>',Km='<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>',iF='<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>',sF='<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>',Hl='<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>',aF='<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>',lF='<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>',ys='<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>',VE='<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>',cF='<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>',Zm='<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 ke(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 Fl={getLocale:rs,commit:Er},uF=".em-prevent-action";function dF(){return x.get("emailWidth")||475}function mF(){return x.get("copyPasteEnabled")||!1}function fF(){return x.get("saveBlockEnabled")||!1}function pF(){return x.get("blocksAddPanelEnabled")||!1}function hF(){return x.get("codeMode")||!1}var UE=".em-mob-wrap, .noresp-em-mob-wrap";function jE(e){return Array.from(document.querySelectorAll(e)).find(vv)??null}function $l(e,t){const n=Fl.getLocale(),r=dF(),o=mF(),i=fF(),s=pF(),a=hF();if(t==="atom"){e.setAttribute("em-state","active"),e.getBoundingClientRect().left<50&&e.setAttribute("em-state","active-inside");const l=I({targetElement:e,insertType:"append",className:"em-element-editor",width:82,height:26});l.classList.add("of-atom"),document.body.getBoundingClientRect().height>70&&e.getBoundingClientRect().top+70>document.body.getBoundingClientRect().height&&l.classList.add("out-of-iframe"),e.getBoundingClientRect().top<25&&l.classList.add("em-top-crossed");const c=I({targetElement:l,insertType:"append",className:"em-element-editor-widget"});I({targetElement:c,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:ke(Km,`${_e} ${je.drag}`,'style="transform: rotate(90deg)"'),title:n.REORDER_ATOM}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:ke(ys,`${_e} em-analytics__atoms-panel-edit`),title:n.EDIT_ATOM}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:ke(Hl,`${_e} em-analytics__atoms-panel-clone`),title:n.CLONE_ATOM}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:ke(Zm,`${_e} em-analytics__atoms-panel-remove`),title:n.REMOVE_ATOM}),vl(Fl.commit)}if(t==="block"){e.setAttribute("em-state","active");const l=I({targetElement:e,insertType:"append",className:"em-element-editor"});l.classList.add("of-block"),e.getBoundingClientRect().left<35&&e.setAttribute("em-state","active-inside"),(document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height||document.documentElement.clientWidth<r&&e.getBoundingClientRect().top-34<0)&&l.classList.add("out-of-iframe");const c=I({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=I({targetElement:c,insertType:"append",className:"em-element-editor-group"});if(I({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:ke(Km,`${_e} ${je.drag}`),title:n.REORDER_BLOCK}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:ke(zE,`${_e} ${je.moveUp}`),title:n.REORDER_BLOCK_UP}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:ke(qE,`${_e} ${je.moveDown}`),title:n.REORDER_BLOCK_DOWN}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:ke(ys,`${_e} em-analytics__blocks-panel-edit`),title:n.EDIT_BLOCK}),o){const f=I({targetElement:c,insertType:"append",className:"em-element-editor-group"});I({targetElement:f,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:ke(Hl,`${_e} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK}),I({targetElement:f,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:ke(sF,`${_e} em-analytics__blocks-panel-copy`),title:n.COPY_BLOCK_TO_CLIPBOARD}),I({targetElement:f,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:ke(iF,`${_e} em-analytics__blocks-panel-paste`),title:n.PASTE_BLOCK_FROM_CLIPBOARD})}else I({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:ke(Hl,`${_e} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK});if(e.closest(uF))return;const d=jE('[em-edit="active"]'),m=jE('[em-state^="active"]');if(d&&m&&(d.querySelector(UE)&&m.querySelector(UE)||d.closest(".em-structure")&&m.closest(".em-structure"))&&d!==c.closest('[em-edit="active"]')&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:ke(aF,`${_e} ${je.merge} em-analytics__blocks-panel-merge`),title:n.MERGE_BLOCK}),Ui(c.closest('[em="block"]')??c).flatMap(f=>Array.from(f.querySelectorAll(":scope > table"))).length>1&&c.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap")&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-unmerge",HTMLcontent:ke(lF,`${_e} ${je.unmerge} em-analytics__blocks-panel-unmerge`),title:n.UNMERGE_BLOCK}),i&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:ke(cF,`${_e} em-analytics__blocks-panel-save`),title:n.SAVE_TO_BLOCKS}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:ke(Zm,`${_e} em-analytics__blocks-panel-remove`),title:n.REMOVE_BLOCK}),s&&!e.querySelector(".em-element-block-add")&&!a){const f=I({targetElement:e,insertType:"append",className:"em-element-block-add"});e.getBoundingClientRect().bottom+1>document.body.getBoundingClientRect().height&&f.classList.add("out-of-iframe"),I({targetElement:f,insertType:"append",className:"em-element-block-add-plus",HTMLcontent:`${ke(VE,`${_e} ${je.add}`)} ${n.ADD_BLOCK}`,title:n.ADD_BLOCK}),I({targetElement:f,insertType:"append",className:"add-empty-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="border-outer" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM484 366h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM302 548h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm364 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-182 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm0 182h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8z"></path></svg>',title:n.ADD_EMPTY_BLOCK}),I({targetElement:f,insertType:"append",className:"add-saved-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore-add" width="1em" height="1em" fill="currentColor" aria-hidden="true"><defs><style></style></defs><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"></path></svg>',title:n.ADD_SAVED_BLOCK}),I({targetElement:f,insertType:"append",className:"add-common-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"></path></svg>',title:n.ADD_COMMON_BLOCK}),I({targetElement:f,insertType:"append",className:"add-template-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="build" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"></path></svg>',title:n.ADD_TEMPLATE_BLOCK}),I({targetElement:f,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})}vl(Fl.commit);const p=e.closest('[em="block"]');p&&(p.onmouseleave=function(){$o(void 0)})}if(t==="group"){e.tagName==="TR"?e.querySelector("td")?.setAttribute("em-state","active"):e.setAttribute("em-state","active");const l=I({targetElement:e,insertType:"append",className:"em-element-editor"});l.classList.add("of-group"),document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height&&l.classList.add("out-of-iframe");const c=I({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=I({targetElement:c,insertType:"append",className:"em-element-editor-group"});I({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:ke(Km,`${_e} ${je.drag}`),title:n.REORDER_BLOCK}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="group"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:ke(zE,`${_e} ${je.moveUp}`),title:n.REORDER_BLOCK_UP}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="group"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:ke(qE,`${_e} ${je.moveDown}`),title:n.REORDER_BLOCK_DOWN}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:ke(VE,`${_e} ${je.add} em-analytics__groups-panel-add`),title:n.ADD_GROUP}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:ke(ys,`${_e} em-analytics__groups-panel-edit`),title:n.EDIT_GROUP}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:ke(Hl,`${_e} em-analytics__groups-panel-clone`),title:n.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:ke(Zm,`${_e} em-analytics__groups-panel-remove`),title:n.REMOVE_GROUP}),vl(Fl.commit)}}function $o(e){if(document.documentElement.classList.contains("em-resize-start"))return;const t=x.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 gF(e,t){if(!e?.isConnected)return;let n;if(n=e.closest('[em="atom"]')){if($o(n),n.querySelector(".em-element-editor.of-atom")||$l(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&&$l(r.tagName==="TR"?r.querySelector("td"):r,"block"),t.setBlockGroupControlsPosition()}}else(n=e.closest('[em="block"]'))?($o(n),n.querySelector(".em-element-editor.of-block")||($l(n.tagName==="TR"?n.querySelector("td"):n,"block"),t.setBlockGroupControlsPosition())):(n=e.closest('[em="group"]'))&&($o(n),n.querySelector(".em-element-editor.of-group")||($l(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:Wl,NEW_EDITOR:Qm}=tE,{TRIM_SPACES:vs,EMPTY_TEXT:bF}=nE;function yF(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 m=n.closest(`table.${c}`)||n.closest(`table.${u}`),p=n.closest(`table.${c}`)?c:u;if(!m)return!0;const f=h9(n,p);if(!f)return!0;const{firstCellText:h,firstCellHtmlNoText:y,wrappedSecondCellHtml:v}=f;return o==="start"||o==="end"?vF(n,m,p,c,u,o,h,y,v,a):o==="inside"&&EF(n,m,p,c,a),l(),s(),!0}function vF(e,t,n,r,o,i,s,a,l,c){const u=e.querySelector("div");u&&u.classList.add(Wl);const d=X1(a,s),m=X1(l," "),p=i==="end"?A9(m):m,f=t.outerHTML,h="<tr>"+d+p+"</tr>",y=Fo(f),v=g9(y,h,Wl,i==="start");t.innerHTML=Fo(v),n===r&&Sm(t),C9(t,r,o,vs);const A=i==="start"?t.querySelector(".remove-start-element-position"):t.querySelector(".remove-new-editor-element");return A&&GE(A,t,c),A}function EF(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)?S9(s,a,l):null;return c?(s.after(c.row),E9(t),c.content.classList.add(Qm),n===r&&Sm(t),GE(c.content,t,o,!0),c.content):null}function GE(e,t,n,r=!1){e.textContent&&e.textContent.length>0&&(e.innerHTML=e.innerHTML.replace(vs,"")),bF.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),s.removeAllRanges(),s.addRange(a)}}r&&o&&o.focus()}function SF(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:m}=r,p=(e.keyCode===38||e.key==="ArrowUp")&&o==="start",f=(e.keyCode===40||e.key==="ArrowDown")&&(!s&&o==="end"||s&&o==="start");if(!(p||f)||!m||!i||!n)return!1;e.preventDefault(),e.stopImmediatePropagation();const h=e.key==="ArrowUp"?"ArrowUp":"ArrowDown",y=n.closest(`table.${u}`)||n.closest(`table.${d}`);if(!y)return!0;const v=n.querySelector("div");v&&v.classList.add(Wl);const A=y.outerHTML,k=Fo(A);y.innerHTML=w9(k,Wl,Qm,h);const S=y.querySelector(".remove-new-editor-element");if(S){l(S,!0);const b=y.querySelector("editor"),E=b?.querySelector("div")?.childNodes[0],C=window.getSelection();if(C&&C.rangeCount>0){const g=C.getRangeAt(0);if(E&&E.nodeType===Node.TEXT_NODE){const w=E.textContent||"";g.setStart(E,w.replace(vs,"").length)}else b&&g.selectNodeContents(b);g.collapse(!0),C.removeAllRanges(),C.addRange(g)}}return c(),a(),!0}function wF(e,t,n){return(e.keyCode===39||e.key==="ArrowRight")&&(t==="end"||n)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1}function CF(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:m,setCursorSafely:p}=t,{classNameOl:f,classNameUl:h,isList:y}=o;if(!((n?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&y)||!(!s||s&&(i==="start"||a&&i==="inside"||a&&i==="end"))||!r||!l)return!1;e.preventDefault(),e.stopImmediatePropagation();const v=r.closest(`table.${f}`)?f:h,A=l.closest("tr");if(!A)return!0;const k=A.previousElementSibling;if(!k&&!s)return!0;const S=s?r.querySelector("div"):A.querySelector("tr td:nth-child(2)")?.querySelector("div"),b=S?S.innerHTML:"",E=b?b.split(" ")[0]:"";E.replace(vs,"");const C=k?.querySelector("tr td:nth-of-type(2)");if(!C)return!0;const g=C.querySelector("div");if(!g)return!0;g.classList.add(Qm);const w=g.innerHTML,T=`${w}${b}`;A.remove();const _=g.closest(`table.${f}`)||g.closest(`table.${h}`);if(!_)return!0;const M=_.innerHTML;_.innerHTML=Fo(M),v===f&&Sm(_);const N=_.querySelector(".remove-new-editor-element");if(!N)return d(),c(),!0;N.innerHTML=`${T.replace(vs,"")}&nbsp;`||"&nbsp;",u(N,!0);const W=N.closest("editor");if(!W)return d(),c(),!0;const P=window.getSelection(),R=document.createRange(),Y=W.querySelector("div");if(!Y||!P)return d(),c(),!0;const V=W.textContent||"",G=E?V.indexOf(E):-1;if(G!==-1&&E){const Le=m(Y,G);if(Le)p(R,P,Le.node,Le.offset);else{const ae=Y.childNodes[0];ae&&p(R,P,ae,0)}}else{const Le=document.createElement("div");Le.innerHTML=w;const ae=(Le.textContent||"").length,ne=m(Y,ae);if(ne)p(R,P,ne.node,ne.offset);else{const we=document.createTreeWalker(Y,NodeFilter.SHOW_TEXT,null);let j=null;for(;we.nextNode();)j=we.currentNode;j&&p(R,P,j,(j.textContent||"").length)}}return W.focus(),d(),c(),!0}function AF(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 TF(e){if(!e)return!1;const t=e.closest("li");return _m(t)}function _F(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 kF(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 LF(e){const t=window.getSelection();if(!t||t.rangeCount===0)return e.innerHTML;const n=t.getRangeAt(0),r=document.createRange();r.selectNodeContents(e),r.setEnd(n.startContainer,n.startOffset);const o=r.cloneContents(),i=document.createElement("div");return i.appendChild(o),i.innerHTML}function NF(e){const t=window.getSelection();if(!t||t.rangeCount===0)return"";const n=t.getRangeAt(0),r=document.createRange();r.selectNodeContents(e),r.setStart(n.endContainer,n.endOffset);const o=r.cloneContents(),i=document.createElement("div");return i.appendChild(o),i.innerHTML}function Wo(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}function Es(e,t){e.hasAttribute("em-edit")&&(e.removeAttribute("em-edit"),t.setAttribute("em-edit","active"))}function xF(e,t){const n=document.createElement("br"),r=document.createElement("span");return r.innerHTML="&nbsp;",Es(e,r),t.parentNode?.insertBefore(r,t),t.parentNode?.insertBefore(n,r),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),Wo(r),r}function MF(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;",Es(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(),Wo(a),a}function RF(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(!TF(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=_F(i),l=kF(i,s);switch(a.position){case"empty":OF(i,s,l,t);break;case"start":PF(i,s,t);break;case"end":IF(i,s,t);break;case"middle":DF(i,s,t)}return t.commit(),!0}function OF(e,t,n,r){switch(n){case"last":const o=document.createElement("li");o.setAttribute("style",Mn.LIST_ITEM),o.innerHTML="&nbsp;",e.after(o),Es(e,o),Wo(o);break;case"first":xF(e,t);break;case"middle":MF(e,t)}}function PF(e,t,n){const r=document.createElement("li");r.setAttribute("style",Mn.LIST_ITEM),r.innerHTML="&nbsp;",e.before(r),Wo(e)}function IF(e,t,n){const r=document.createElement("li");r.setAttribute("style",Mn.LIST_ITEM),r.innerHTML="&nbsp;",e.after(r),Es(e,r),Wo(r)}function DF(e,t,n){const r=LF(e),o=NF(e);e.innerHTML=r||"&nbsp;";const i=document.createElement("li");i.setAttribute("style",Mn.LIST_ITEM),i.innerHTML=o||"&nbsp;",e.after(i),Es(e,i),Wo(i)}function BF(e){const t=r=>WE({target:r.target},o=>e.commit(o)),n=()=>x.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?p9(l):null,d=l?.closest("tr")?.querySelector("tr td:nth-of-type(2) div"),m=o.target,p=Ll(m),{isList:f}=p,h=d?.textContent===l?.textContent,y=l?nE.EMPTY_TEXT.test(l.textContent||""):!1,v=c?o.metaKey:o.ctrlKey;if(v&&o.keyCode===83){o.preventDefault(),e.messageService.send({operation:"application_action",action:"save_email"});return}const A=j7(o,!!v);if(A){o.preventDefault(),e.messageService.send({operation:"application_action",action:A});return}if(o.altKey&&o.keyCode===88){o.preventDefault(),e.messageService.send({operation:"application_action",action:"toggle_editor"});return}const k={getElementParent:g=>Cl(g),setCursorPosition:e.setCursorPosition,removeElementEditors:()=>$o(void 0),getVariableByIcon:cl,removeEmptyParents:gs,getAllComments:hP,isVariableComment:pv,getVariableIcon:g=>yP(g),commit:e.commit,messageService:e.messageService};if(G7(o,f,u,k))return;if(o.keyCode===27){const g=document.querySelector(".em-editor-wrapper");g?.style&&(g.style.display="none"),Jn("em-edit"),document.querySelectorAll("editor").forEach(w=>w.blur()),i?.removeAllRanges(),e.applicationElementSettingsSet({elem:null}),e.messageService.send({operation:"application_close-image-edit-popup"});return}v&&o.keyCode===66&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strong"}));const S=c?o.keyCode===88:o.keyCode===53;if((c?o.metaKey:o.altKey)&&o.shiftKey&&S&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strikethrough"})),v&&o.shiftKey&&o.keyCode===76&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_left"})),v&&o.shiftKey&&o.keyCode===82&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_right"})),v&&o.shiftKey&&o.keyCode===69&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_center"})),v&&o.keyCode===73&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_italic"})),v&&o.keyCode===85&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_underline"})),RF(o,{commit:e.commit})||Y7(o,l,f,h,{commit:e.commit}))return;if(v&&o.keyCode===86){e.setIsPasteFromContextMenu(!1);const g=w=>{$E(w,!1,n(),t,e.commit),document.removeEventListener("paste",g)};document.addEventListener("paste",g)}else t(o);const b={activeElem:l,listContext:p,cursorPositionType:u,isTargetCell:h,isEmptyText:y,commit:e.commit,wrapEditor:e.wrapEditor,removeTemporaryListClasses:()=>tB()};if(yF(o,b)||(wF(o,u,y),SF(o,b)))return;const E={...b,parentElement:a,findNodeAtPosition:rF,setCursorSafely:oF};if(CF(o,E)||AF(o,f,h))return;const C={setCursorInsideSpan:EP,isCaretAtEndOfStandardElement:SP,setCursorPositionSimple:wP,commit:e.commit};X7(o,C)&&e.commit()}}function XE(e){document.body?.classList.contains("mceNonEditable")||x.get("lockEditor")||!e.target?.closest?.('[contenteditable="true"]')||!e.key||e.ctrlKey||e.altKey||e.metaKey||e.key.length===1&&(e.preventDefault(),e.stopImmediatePropagation(),document.execCommand("insertText",!1,e.key))}function HF(){return document.addEventListener("keydown",XE,!0),{dispose(){document.removeEventListener("keydown",XE,!0)}}}function FF(e){const t=nF({handlePasteTextFragment:$E,getCommonStyles:()=>x.get("commonStyles"),changeMsoValue:n=>WE({target:n.target},r=>e.commit(r)),commit:e.commit});document.addEventListener("keydown",BF({...e,setIsPasteFromContextMenu:n=>t.setFromContextMenu(n)}),!1),HF()}var $F='<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>',ql=4;function WF(e,t){return e.left<ql||e.right-e.left>t-8?ql-e.left:e.right>t-ql?t-ql-e.right:0}var qo=null,Jm=null;function ef(e,t){if(typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))return;qo||(qo=new CSSStyleSheet),document.adoptedStyleSheets.includes(qo)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,qo]),qo.replaceSync("");const n=e.getBoundingClientRect();if(n.width===0)return;Jm=e;const r=Math.round(WF(n,document.documentElement.clientWidth));r!==0&&qo.replaceSync(`${t} { margin-left: ${r}px; }`)}function qF(e,t,n){e.addEventListener("mouseenter",()=>{Jm=null,ef(t,n)}),e.addEventListener("mousemove",()=>{Jm!==t&&ef(t,n)}),t.addEventListener("mouseenter",()=>ef(t,n))}function Dr(e,t){return{settings:e,elem:t}}var Xe={applicationElementSettingsSet:e=>D(Et,He)(e),setCursorPosition:e=>D(Et,vt)(e),commit:Er};function zF(){return x.get("emailWidth")||475}function zl(){return document.documentElement.clientWidth<=zF()}function tf(e,t,n,r){const o=e;o.style.cursor=n,o.mousemove=t;const i=()=>{window.getSelection()?.removeAllRanges(),Xe.applicationElementSettingsSet({elem:e});const s=document.querySelector("[em-edit]");s&&Xe.setCursorPosition(s),document.documentElement.classList.add("em-resize-start")};o.addEventListener("touchstart",s=>{const a=s.touches[0];if(s.touches.length!==1||!a)return;s.preventDefault(),i();let l={x:a.clientX,y:a.clientY};const c={x:0,y:0},u=document.documentElement,d=p=>{const f=p.touches[0];if(!f)return;p.preventDefault(),c.x+=f.clientX-l.x,c.y+=f.clientY-l.y,l={x:f.clientX,y:f.clientY};const h={x:Math.trunc(c.x),y:Math.trunc(c.y)};h.x===0&&h.y===0||(c.x-=h.x,c.y-=h.y,o.mousemove({movementX:h.x,movementY:h.y}))},m=()=>{u.removeEventListener("touchmove",d),u.removeEventListener("touchend",m),u.removeEventListener("touchcancel",m),o.stopDrag()};u.addEventListener("touchmove",d,{passive:!1}),u.addEventListener("touchend",m),u.addEventListener("touchcancel",m)},{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(()=>{document.documentElement.classList.remove("em-resize-start"),Xe.commit(!1)})}}function Br(e,t,n){tf(e,t,"ns-resize",n)}function Ss(e,t,n){tf(e,t,"ew-resize",n)}function VF(e,t,n){tf(e,t,"nwse-resize",n)}function Hr(e,t){let n=null,r=0;const o=zl();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?Bo(Dr({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");Bo(Dr(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?ns(Dr({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?ns(Dr({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?Bo(Dr({mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},n)):n.setAttribute("height",String(r))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Xe.commit()}function Fr(e){let t=null;const n=zl();if(e.closest('div[style*="height"][style*="line-height"]')){if(t=e.closest('div[style*="height"][style*="line-height"]'),!t)return;parseInt(t.style.height)<=0?t.remove():Xe.applicationElementSettingsSet({elem:t})}else if(e.closest(".em-gap")){if(t=e.closest(".em-gap"),!t)return;Xe.applicationElementSettingsSet({elem:Pd(t)})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(t=e.closest(".em-vindent-paddingTop"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.height)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-top"):r&&Xe.applicationElementSettingsSet({elem:r})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(t=e.closest(".em-vindent-paddingBottom"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.height)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-bottom"):r&&Xe.applicationElementSettingsSet({elem:r})}else{if(t=e.closest("td"),!t)return;const r=t.getAttribute("height");r&&parseInt(r)<=0?t.closest("table")?.remove():Xe.applicationElementSettingsSet({elem:t})}t&&Xe.commit()}function zo(e,t){let n=null,r=0;const o=zl();if(e.closest(".em-element-resize-img-container")){const i=e.closest(".em-element-resize-img-container")?.querySelector("img");if(!i)return;const s=i.clientWidth+t;i.style.maxWidth=s+"px",i.setAttribute("width",String(s)),Xe.commit()}else if(e.closest(".em-gap")){if(n=e.closest(".em-gap"),!n)return;if(n.classList.add("em-hover"),r=n.clientWidth+t,r>=0){const i=n.clientWidth,s=Array.from(n.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(odd)")||[]).map(u=>u.clientWidth),a=s.reduce((u,d)=>u+d,0),l=a+(s.length-1)*i,c=n.closest("tr");if(!c)return;if(l-3<=c.clientWidth||t<=0){let u=Array.from(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")).filter(y=>y.dataset.percent).map(y=>y.dataset.percent);u.length||(u=s.map(y=>((y||0)/a*100).toFixed(1)),Jc(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")));const d=l-(s.length-1)*r,m=(y,v)=>Math.round(v*parseFloat(y)/100);let p=s.map((y,v)=>m(u[v],d));const f=l-(p.reduce((y,v)=>y+v,0)+(s.length-1)*r);if(f!==0){const y=p.length-Math.abs(f);p=p.map((v,A)=>y<=A?v+(f>0?1:-1):v)}const h=p;c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((y,v)=>{Array.from(y.querySelectorAll("table[width]")).filter(A=>!A.getAttribute("width")?.includes("%")).forEach(A=>{+(A.getAttribute("width")||0)<=h[v]&&(A.style.maxWidth=String(h[v]),A.setAttribute("width","100%"))})}),n.style.width=r+"px",c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((y,v)=>y.setAttribute("width",String(h[v]))),c.querySelectorAll(".em-gap").forEach(y=>{y.parentElement?.setAttribute("width",String(r)),y.style.width=r+"px";const v=y.querySelector(".em-element-gap-value");v&&(v.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?ns(Dr({mobilePadding:{left:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingLeft=r+"px",i.querySelectorAll(":scope > table").forEach(s=>Nl(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?ns(Dr({mobilePadding:{right:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingRight=r+"px",i.querySelectorAll(":scope > table").forEach(s=>Nl(s)))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value, .em-element-gap-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Xe.commit()}function Vo(e){let t=null;const n=zl();if(e.closest(".em-element-resize-img-container")){const r=e.closest(".em-element-resize-img-container")?.querySelector("img");r&&(Xe.applicationElementSettingsSet({elem:r}),Xe.commit())}else if(e.closest(".em-gap"))t=e.closest(".em-gap"),t&&Xe.applicationElementSettingsSet({elem:Pd(t)});else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingLeft")){if(t=e.closest(".em-vindent-paddingLeft"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.width)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-left"):r&&Xe.applicationElementSettingsSet({elem:r})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingRight")){if(t=e.closest(".em-vindent-paddingRight"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.width)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-right"):r&&Xe.applicationElementSettingsSet({elem:r})}t&&Xe.commit()}var YE={getLocale:rs,commit:Er,messageService:Z},UF=".em-prevent-action",KE=new WeakSet;function jF(){return x.get("emailWidth")||475}function GF(){return x.get("isLeftButtonDown")||!1}function XF(){return x.get("editImageControlEnabled")||!1}function ZE(){return x.get("imageCenterEditorEnabled")||!1}function YF(){return x.get("imageCenterStockEnabled")||!1}function KF(){return x.get("imageCenterGifEnabled")||!1}function ZF(){return x.get("elementAIimageEnabled")||!1}function QF(e){if(document.body?.classList.contains("em-native-file-drag"))return;const t=YE.getLocale(),n=jF(),r=GF(),o=ZE(),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 f=I({targetElement:e,insertType:"append",className:"em-element-resize-height"});I({targetElement:e,insertType:"append",className:"em-element-vindent"}),I({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),Br(f,function(h){Hr(f,h.movementY)},function(){Fr(f)})}if(e.closest(UF))return;if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.getAttribute("height")&&!e.querySelector(".em-element-vindent-value")){const f=Sr(e,"em-mob-height"),h=f?parseFloat(f.substring(14,f.length-2)):void 0;I({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(h||e.getAttribute("height"))+"px":e.getAttribute("height")+"px"}),!i||!h?parseInt(e.getAttribute("height")||"0")<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):h<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}if(e.tagName==="DIV"&&e.style.height&&e.style.fontSize&&!e.classList.contains("em-vindent")&&!e.closest("editor")&&e.style.height&&e.style.lineHeight&&!e.style.fontFamily){e.classList.add("em-vindent"),parseFloat(e.style.height)<30&&e.classList.add("em-vindent_low");const f=I({targetElement:e,insertType:"append",className:"em-element-resize-height"}),h=I({targetElement:e,insertType:"append",className:"em-element-vindent"});I({targetElement:h,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),I({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),Br(f,function(y){Hr(f,y.movementY)},function(){Fr(f)})}if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.style.height&&e.style.fontSize&&!e.querySelector(".em-element-vindent-value")){const f=Sr(e,"em-mob-height"),h=f?parseFloat(f.substring(14,f.length-2)):void 0;I({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(h||parseFloat(e.style.height))+"px":parseFloat(e.style.height)+"px"}),!i||!h?parseFloat(e.style.height)<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):h<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}const s=Sr(e,"em-mob-padding_top"),a=s?parseFloat(s.substring(19)):void 0,l=Sr(e,"em-mob-padding_bottom"),c=l?parseFloat(l.substring(22)):void 0,u=Sr(e,"em-mob-padding_left"),d=u?parseFloat(u.substring(20)):void 0,m=Sr(e,"em-mob-padding_right"),p=m?parseFloat(m.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 f=I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${e.style.paddingTop}`});e.getBoundingClientRect().top<30&&f.classList.add("top-crossed")}e.style.paddingBottom&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&!e.querySelector(":scope > editor > .em-vindent-paddingBottom")&&(!c||!i)&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${e.style.paddingBottom}`}),e.style.paddingLeft&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&!e.querySelector(":scope > editor > .em-vindent-paddingLeft")&&(!d||!i)&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${e.style.paddingLeft}`}),e.style.paddingRight&&!e.querySelector(":scope > .em-vindent-paddingRight")&&!e.querySelector(":scope > editor > .em-vindent-paddingRight")&&(!p||!i)&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${e.style.paddingRight}`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(f=>{if(!f.querySelector(".em-element-resize-height")){const h=f;(parseFloat(h.style.height)<30||parseFloat(h.style.width)<30)&&f.classList.add("em-vindent_low");const y=I({targetElement:h,insertType:"append",className:"em-element-resize-height"});I({targetElement:h,insertType:"append",className:"em-element-vindent-marker"}),I({targetElement:h,insertType:"append",className:"em-element-vindent-bg"});const v=I({targetElement:h,insertType:"append",className:"em-element-vindent"});let A="";h.className.indexOf("paddingTop")>-1?(A=e.style.paddingTop,Br(y,function(k){Hr(y,k.movementY)},function(){Fr(y)})):h.className.indexOf("paddingBottom")>-1?(A=e.style.paddingBottom,Br(y,function(k){Hr(y,k.movementY)},function(){Fr(y)})):h.className.indexOf("paddingLeft")>-1?(A=e.style.paddingLeft,Ss(y,function(k){zo(y,k.movementX)},function(){Vo(y)})):h.className.indexOf("paddingRight")>-1&&(A=e.style.paddingRight,Ss(y,function(k){zo(y,-k.movementX)},function(){Vo(y)})),I({targetElement:v,insertType:"append",className:"em-element-vindent-value",HTMLcontent:A})}})}if(e.className.length&&e.className?.includes("em-mob-padding")&&!e.closest("editor")&&i&&(a&&!e.querySelector(":scope > .em-vindent-paddingTop")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${a}px`}),c&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${c}px`}),d&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${d}px`}),p&&!e.querySelector(":scope > .em-vindent-paddingRight")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${p}px`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(f=>{if(!f.querySelector(".em-element-resize-height")){const h=f;(parseFloat(h.style.height)<30||parseFloat(h.style.width)<30)&&f.classList.add("em-vindent_low");const y=I({targetElement:h,insertType:"append",className:"em-element-resize-height"});I({targetElement:h,insertType:"append",className:"em-element-vindent-marker"}),I({targetElement:h,insertType:"append",className:"em-element-vindent-bg"});const v=I({targetElement:h,insertType:"append",className:"em-element-vindent"});let A="";h.className.indexOf("paddingTop")>-1?(A=a,Br(y,function(k){Hr(y,k.movementY)},function(){Fr(y)})):h.className.indexOf("paddingBottom")>-1?(A=c,Br(y,function(k){Hr(y,k.movementY)},function(){Fr(y)})):h.className.indexOf("paddingLeft")>-1?(A=d,Ss(y,function(k){zo(y,k.movementX)},function(){Vo(y)})):h.className.indexOf("paddingRight")>-1&&(A=p,Ss(y,function(k){zo(y,-k.movementX)},function(){Vo(y)})),I({targetElement:v,insertType:"append",className:"em-element-vindent-value",HTMLcontent:String(A)})}})),e.closest('[em="block"]')?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length||0)>2&&!e.closest('[em="block"]')?.querySelector(".em-mob-wrap .em-gap, .noresp-em-mob-wrap .em-gap")){const f=Sr(e.closest('[em="block"]')?.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),"em-mob-height"),h=f?parseFloat(f.substring(14,f.length-2)):void 0;e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(y=>{I({targetElement:y,insertType:"append",className:"em-gap",style:i?`height: ${h}px;`:`width: ${y.getAttribute("width")}px;`})}),e.closest('[em="block"]')?.querySelectorAll(".em-gap").forEach(y=>{if(!y.querySelector(".em-element-resize-height")){const v=y,A=I({targetElement:v,insertType:"append",className:"em-element-resize-height"});I({targetElement:v,insertType:"append",className:"em-element-gap-marker"}),I({targetElement:v,insertType:"append",className:"em-element-gap-bg"});const k=I({targetElement:v,insertType:"append",className:"em-element-gap"});let S="";i?(S=v.style.height,Br(A,function(b){Hr(A,b.movementY)},function(){Fr(A)})):(S=v.style.width,Ss(A,function(b){zo(A,b.movementX)},function(){Vo(A)})),I({targetElement:k,insertType:"append",className:"em-element-gap-value",HTMLcontent:S})}})}if(e.tagName==="IMG"){const f=e;if(f.closest("td[em-platform], td[data-em-platform]"))return;if(f.closest(".em-element-resize-img-container")||f.closest('div[style*="font-size"][style*="line-height"][style*="font-family"]')||f.closest("editor")||f.classList.contains("em-video")){if(f.closest(".em-element-resize-img-container")){const A=f.closest(".em-element-resize-img-container"),k=A.querySelector(".em-element-img-edit");!f.getAttribute("src")?.includes(".gif")&&o?k||I({targetElement:A.querySelector(".em-element-img-change-group"),insertType:"prepend",className:"em-element-img-edit",tag:"i",HTMLcontent:ke(ys,`${_e}`),title:t.CHANGE_IMAGE_EDIT}):A.querySelector(".em-element-img-edit")?.remove()}return}const h=document.createElement("span");h.classList.add("em-element-resize-img-container");const y=f.parentElement instanceof HTMLAnchorElement?f.parentElement:f;y.parentElement?.insertBefore(h,y),h.appendChild(y);const v=I({targetElement:h,insertType:"append",tag:"span",className:"em-element-resize-img"});VF(v,function(A){zo(v,A.movementX)},function(){Vo(v)}),f?.style.maxWidth&&f?.style.display==="block"&&f.closest(".em-element-resize-img-container")?.classList.add("em-display-block"),JF(f,h)}}}function JF(e,t){const n=YE;if(!n||t.querySelector(".em-element-img-change-group"))return;const r=n.getLocale(),o=XF(),i=ZE(),s=YF(),a=KF(),l=ZF();if(o&&e.getBoundingClientRect().width>40&&e.getBoundingClientRect().height>40&&!e.classList.contains("em-countdown")){const c=I({targetElement:t,insertType:"append",className:"em-element-img-change-group"});if(I({targetElement:c,insertType:"append",className:"em-element-img-change",HTMLcontent:'<svg viewBox="0 0 20 20" focusable="false" data-icon="bg-colors" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M3.75 17.5C3.41667 17.5 3.125 17.375 2.875 17.125C2.625 16.875 2.5 16.5833 2.5 16.25V3.75C2.5 3.41667 2.625 3.125 2.875 2.875C3.125 2.625 3.41667 2.5 3.75 2.5H16.25C16.5833 2.5 16.875 2.625 17.125 2.875C17.375 3.125 17.5 3.41667 17.5 3.75V16.25C17.5 16.5833 17.375 16.875 17.125 17.125C16.875 17.375 16.5833 17.5 16.25 17.5H3.75ZM3.75 16.25H16.25V3.75H3.75V16.25ZM4.91667 14.2292H15.1042L12.0417 10.1458L9.29167 13.7083L7.35417 11.0625L4.91667 14.2292Z"></path></svg>',title:r.CHANGE_IMAGE}),!e.getAttribute("src")?.includes(".gif")&&i&&I({targetElement:c,insertType:"append",className:"em-element-img-edit",tag:"i",HTMLcontent:ke(ys,`${_e}`),title:r.CHANGE_IMAGE_EDIT}),s&&I({targetElement:c,insertType:"append",className:"em-element-img-stock",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M4.12726 7.18183H9.6909L7.86364 4.76364L6.44545 6.63637L5.4909 5.49092L4.12726 7.18183ZM0.909082 11.3636C0.659082 11.3636 0.445068 11.2746 0.267041 11.0966C0.0890136 10.9186 0 10.7046 0 10.4546V2.99999H0.909082V10.4546H10.7273V11.3636H0.909082ZM2.72726 9.54546C2.47726 9.54546 2.26325 9.45644 2.08522 9.27842C1.90719 9.10039 1.81818 8.88638 1.81818 8.63638V1.90908C1.81818 1.65908 1.90719 1.44507 2.08522 1.26704C2.26325 1.08901 2.47726 1 2.72726 1H5.81817L6.90908 2.09091H11.0909C11.3409 2.09091 11.5549 2.17992 11.733 2.35795C11.911 2.53598 12 2.74999 12 2.99999V8.63638C12 8.88638 11.911 9.10039 11.733 9.27842C11.5549 9.45644 11.3409 9.54546 11.0909 9.54546H2.72726ZM2.72726 8.63638H11.0909V2.99999H6.53182L5.44091 1.90908H2.72726V8.63638Z"></path></svg>',title:r.CHANGE_IMAGE_STOCK}),I({targetElement:c,insertType:"append",className:"em-element-img-changeto",tag:"i",HTMLcontent:ke($F,`${_e}`),title:r.CHANGE_IMAGE_CHANGETO}),a&&I({targetElement:c,insertType:"append",className:"em-element-img-gif",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><<path d="M5.68571 8.14286V3H6.79999V8.14286H5.68571ZM0.771429 8.14286C0.54 8.14286 0.353571 8.06786 0.212143 7.91786C0.0707142 7.76786 0 7.58571 0 7.37143V3.77143C0 3.55714 0.0707142 3.375 0.212143 3.225C0.353571 3.075 0.54 3 0.771429 3H3.40001C3.63144 3 3.81786 3.075 3.95929 3.225C4.10072 3.375 4.17144 3.55714 4.17144 3.77143V4.11429H1.11429V7.02857H3.05715V5.57143H4.17144V7.37143C4.17144 7.58571 4.10072 7.76786 3.95929 7.91786C3.81786 8.06786 3.63144 8.14286 3.40001 8.14286H0.771429ZM8.25714 8.14286V3H12V4.11429H9.37142V5.25714H11.1V6.37142H9.37142V8.14286H8.25714Z"></path></svg>',title:r.CHANGE_IMAGE_GIF}),l&&I({targetElement:c,insertType:"append",className:"em-element-img-ai",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"></path><path d="M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"></path><path d="M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"></path><path d="M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"></path></svg>',title:r.CHANGE_IMAGE_AI}),n.commit(!1),KE.has(c))return;KE.add(c),qF(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"]'),m=e.getAttribute("src");let p="application_open-image-edit-popup";e.classList.contains("em-ai-img")||d?.classList.contains("em-element-img-ai")?p="application_open-image-ai-popup":iI(m)||d?.classList.contains("em-element-img-changeto")?p="application_open-image-upload-popup":d?.classList.contains("em-element-img-gif")?p="application_open-image-gif-popup":d?.classList.contains("em-element-img-stock")&&(p="application_open-image-stock-popup");const f={operation:p,src:m};setTimeout(()=>{n.messageService.send(f)},100)})}}function e$(e){return function(n){let r=n.target;try{r=e.getVisibleNode(r);const o=e.isInExternal(r);e.incrementActiveElementLocked();const i=document.body;if(i?.classList.contains("mceNonEditable")&&!i.classList.contains("em-sandbox-discuss")||i?.classList.contains("em-sandbox-discuss")&&!i.classList.contains("em-sandbox-discuss_set-target"))return;if(i?.classList.contains("em-sandbox-discuss_set-target")){document.querySelectorAll('[em-hover="true"]').forEach(u=>{u.removeAttribute("em-hover"),u.removeAttribute("contenteditable")}),r.closest(".em-element-vindent")||(r.setAttribute("em-hover","true"),r.setAttribute("contenteditable","true"));return}if(r.tagName!=="BODY"){const u=r.parentElement;Dy(r)&&!r.isConnected&&u&&(r=u)}if(r&&(r?.closest('[em="atom"]')||!o)&&r.getAttribute("contenteditable")!=="false"&&r.parentElement?.getAttribute("contenteditable")!=="false"&&r.tagName!=="BODY"&&r.parentElement?.tagName!=="SECTION"){const u=!r.closest("editor"),d=!e.getLockEditorInit(),m=r.tagName!=="IMG",p=!(r.childElementCount===1&&r.firstElementChild?.tagName==="IMG"&&(r.textContent?.trim()??"")==="");if(u&&d&&m&&p){let f=r;do if(f=f.closest("div, p, h1, h2, h3, h4, h5")||f.closest("span, b, strong, i, em, s, a, sup, sub"),f)if(!e.isVisible(f))f=f.parentElement;else break;while(f);if(r.tagName==="LI"&&r.style.fontFamily&&r.style.fontSize){const h=r.closest("ul, ol");h&&e.wrapEditor(h,!0)}else if(r.tagName==="TD"&&r.style.fontFamily&&r.style.fontSize&&!r.querySelector("editor"))e.wrapEditor(r);else if(f&&f.style.fontFamily&&f.style.fontSize&&(r.tagName==="LI"||!r.querySelector("img")))if(r.tagName==="LI"){const h=r.closest("ul, ol");h&&e.wrapEditor(h,!0)}else r.querySelector("img")||e.wrapEditor(r,!0);else if(f&&f.closest('[style*="font-family"][style*="font-size"]')){const h=f.closest('[style*="font-family"][style*="font-size"]');h&&h.tagName!=="BODY"&&h.tagName!=="TD"&&h.tagName!=="TABLE"?e.wrapEditor(h,!1):h?.tagName==="TD"&&!h.querySelector("editor")&&!h.closest(".em-element-custom-table")&&e.wrapEditor(h)}else if(f&&f?.tagName==="DIV"&&!f.querySelector("table")){const h=!!f.style.height?.length,y=f.className.includes("em-element-img-change-group"),v=f.querySelector("img")?.parentNode,A=!!f.querySelector("img")&&v&&!e.hasTextNodeInElement(v);!h&&!y&&!A&&e.wrapEditor(f,!0)}else for(let h=0;h<r.childNodes.length;h++){const y=r.childNodes[h];if(y.nodeName==="#text"&&(y.textContent?.trim().length??0)>0&&!r.querySelector("table")){const v=r.tagName==="P"?r.parentElement:r;v&&e.wrapEditor(v);break}}}}(r?.closest('[em="atom"]')||!o)&&!e.getIsLeftButtonDown()&&e.implementElementsEditors(r),r?.classList.contains("em-element-vindent-bg")&&(r=r.closest(".em-vindent")),r?.closest(".em-gap")?r.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(even) .em-gap").forEach(u=>u.classList.add("em-hover")):e.getIsLeftButtonDown()||document.querySelectorAll(".em-gap").forEach(u=>u.classList.remove("em-hover"));const s=e.getLoadStylesTimer(),a=!!r.style.padding||!!r.style.paddingTop||!!r.style.paddingBottom||!!r.style.paddingLeft||!!r.style.paddingRight,l=r.closest('[em="block"]'),c=!!l?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(l?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length??0)>2;s&&(r.tagName==="TD"&&(r.innerHTML===""||r.querySelector(".em-element-vindent"))&&r.getAttribute("height")||r.tagName==="DIV"&&r.style.height&&r.style.fontSize||r.tagName==="IMG"||a||c)&&e.implementResizableElems(r)}catch{}finally{Promise.resolve().then(()=>e.decrementActiveElementLocked())}}}function t$(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 Vl(e){e.button===0&&x.set("isLeftButtonDown",!1)}function QE(e){e.shiftKey||e.button===2||window.getSelection()?.removeAllRanges(),e.button===0&&x.set("isLeftButtonDown",!0)}function JE(){x.set("lockEditorInit",!1)}function n$(){return document.addEventListener("mousedown",QE),document.addEventListener("mouseup",Vl),document.addEventListener("dragend",Vl),window.addEventListener("mousemove",JE),{dispose(){document.removeEventListener("mousedown",QE),document.removeEventListener("mouseup",Vl),document.removeEventListener("dragend",Vl),window.removeEventListener("mousemove",JE)}}}var r$=1e3;function o$(e){setTimeout(()=>x.set("loadStylesTimer",!0),r$);const t=e$({getVisibleNode:n=>e.htmlDocument.getVisibleNode(n),isInExternal:n=>e.htmlDocument.isInExternal(n),isVisible:n=>e.htmlDocument.isVisible(n),incrementActiveElementLocked:()=>x.increment("activeElementLocked"),decrementActiveElementLocked:()=>x.decrement("activeElementLocked"),getLockEditorInit:()=>!!x.get("lockEditorInit"),getIsLeftButtonDown:()=>!!x.get("isLeftButtonDown"),getLoadStylesTimer:()=>!!x.get("loadStylesTimer"),hasTextNodeInElement:j_,wrapEditor:e.wrapEditor,implementElementsEditors:n=>gF(n,{setBlockGroupControlsPosition:()=>yl({scrollTop:x.get("scrollTop")}),commit:e.commit}),implementResizableElems:n=>QF(e.htmlDocument.getVisibleNode(n)),commit:e.commit});document.onmouseover=n=>{t(n),e.onHover?.(n.target)},document.onmouseleave=t$({removeElementEditors:()=>$o(void 0),commit:e.commit}),n$()}function i$(e){return t=>D(e,Jo)(t)}function s$(e){return e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement??null}var a$={name:"sandbox.elementSettings",provides:[He],awaits:{services:[te,zr,Vr]},setup(e){const t=D(e,zr);e.inject(He,bB({htmlDocument:D(e,te),getMapObj:()=>t,fingerprint:D(e,Vr),enrichExtras:()=>e.getServices(yf).reduce((n,r)=>({...n,...r()}),{})}))}},l$={name:"sandbox.documentChange",awaits:{services:[te,Vr,He,at,xe,Jo]},setup:e=>eP({htmlDocument:D(e,te),fingerprint:D(e,Vr),initPreview:i$(e),applicationElementSettingsSet:D(e,He),commit:lt(e),focusController:D(e,at).controller})},c$={name:"sandbox.toggleTextStyle",provides:[Is],awaits:{services:[He,xe]},setup(e){const t=D(e,He),n=lt(e),r=(o,i=Ke())=>{let s=s$(mi(i,o)||o);if(s?.tagName==="EDITOR"&&(s=s.firstElementChild),!s)return;const a=x.get("activeElementLocked")>0;try{a&&x.decrement("activeElementLocked"),t({elem:s})}finally{a&&x.increment("activeElementLocked")}};e.inject(Is,J7({commit:n,addNewRange:lo,refreshElementSettings:r,findElementWithSelectedText:mi,getParentElementOfSelection:da,findOutermostParentWithText:Qc,clearLinkTags:o=>{Mr(o,n),mr(n)},addFontFamilyClass:o=>Qi(o,n),getIsProgrammaticSelection:()=>!!x.get("isProgrammaticSelection"),getCommonStyles:()=>x.get("commonStyles")??{}}))}},u$={name:"sandbox.insert",provides:[Ur],awaits:{services:[te,He,xe,cc]},setup:e=>e.inject(Ur,ZH({htmlDocument:D(e,te),commit:lt(e),messageService:Z,applicationElementSettingsSet:D(e,He),...D(e,cc)}))},d$={name:"sandbox.elementSettingsApply",provides:[Ds],awaits:{services:[te,zr,xe,vt,He,Is,Qt,at]},setup(e){const t=D(e,xe),n=D(e,zr),r=D(e,vt),o=D(e,He);let i=null;const s=l=>{i??(i=U7({htmlDocument:D(e,te),getMapObj:()=>n,commit:lt(e),commitLockedAsync:c=>t.commitLockedAsync(c),setCursorPosition:r,applicationElementSettingsSet:o,toggleTextStyle:D(e,Is),wrapEditor:D(e,Qt).now,programmaticSelection:{get value(){return!!x.get("isProgrammaticSelection")},set value(c){x.set("isProgrammaticSelection",c)}}})),i(l)},a=D(e,at).controller;e.inject(Ds,l=>a.whenEditorLostFocus(()=>s(l)))}},m$={name:"sandbox.mouse",awaits:{services:[te,Qt,xe]},setup:e=>o$({htmlDocument:D(e,te),commit:lt(e),wrapEditor:D(e,Qt).deferred})},f$={name:"sandbox.click",awaits:{services:[te,xe,vt,at,He,Qt]},setup(e){const t=D(e,xe),n=D(e,at);$H({htmlDocument:D(e,te),commit:lt(e),commitLockedAsync:r=>t.commitLockedAsync(r),messageService:Z,setCursorPosition:D(e,vt),setEditorFocus:r=>n.setEditorFocus(r),applicationElementSettingsSet:D(e,He),wrapEditor:D(e,Qt).now,insertTextAtomIntoEmptyNarrowTable:r=>e.getInstance(bf)?.(r)??!1})}},p$={name:"sandbox.keyboard",awaits:{services:[xe,vt,He,Qt]},setup:e=>FF({commit:lt(e),messageService:Z,setCursorPosition:D(e,vt),applicationElementSettingsSet:D(e,He),wrapEditor:D(e,Qt).now})},h$={name:"sandbox.cssFilterOnCommit",awaits:{services:[te]},setup:e=>o3(D(e,te))},g$={name:"sandbox.vmlButtonLabelSync",awaits:{services:[xe]},setup(e){const t=D(e,xe);Z7(n=>t.commit(n))}},b$={name:"sandbox.insertListeners",awaits:{services:[Ur]},setup:e=>D(e,Ur).register()};function y$(e,t){try{t.state.increment("activeElementLocked");const n=t.getActiveEditElement();if(!n)return;const r=n.closest("amp-accordion");if(!r)return;const o=t.HTMLDocument.getOuterHtml(r),i=t.parseFromString(o)[0];if(!i)return;const s=i.querySelector("section");if(!s)return;const a=s.cloneNode(!0),l=a.querySelector(":scope > header td div");if(l){const u=Array.from(l.childNodes).find(d=>d.nodeType===Node.TEXT_NODE);u&&(u.nodeValue=e.section)}const c=a.querySelector(":scope > div");c&&(c.innerHTML=`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom">
250
- <tr>
251
- <td style="padding: 10px 0;">
252
- <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${e.text}</div>
253
- </td>
254
- </tr></table>`),i.append(a),i.setAttribute("em-edit","active"),r.replaceWith(i),t.commit(!0)}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function v$(e,t){try{t.state.increment("activeElementLocked");const n=t.getActiveEditElement();if(!n)return;const r=n.closest("amp-accordion");if(!r)return;const o=t.HTMLDocument.getOuterHtml(r),i=t.parseFromString(o)[0];if(!i)return;const s=i.querySelectorAll("section");s[e.index]&&s[e.index].remove(),i.setAttribute("em-edit","active"),r.replaceWith(i),t.commit(!0)}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function eS(e){return{state:e.state,commit:e.commit,getActiveEditElement:e.getActiveEditElement,HTMLDocument:e.HTMLDocument,parseFromString:e.parseFromString}}function E$(e,t){!t.state||!t.HTMLDocument||!t.getActiveEditElement||!t.parseFromString||y$(e.data.settings,eS(t))}function S$(e,t){!t.state||!t.HTMLDocument||!t.getActiveEditElement||!t.parseFromString||v$(e.data.settings,eS(t))}var w$={sandbox_accordion_add_section:E$,sandbox_accordion_remove_section:S$};function C$(e,t){Un(),document.body?.classList.contains("em-block-insert-body")&&document.body.classList.remove("em-block-insert-body"),document.body?.classList.contains("em-atom-insert-body")&&document.body.classList.remove("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 A$(e,t){t.messageService.send({operation:"application_email_content_get",htmlCode:ko({node:document.body,isPartial:!0})})}var T$={"sandbox_drag-cancel":C$,sandbox_email_content_get:A$};function _$(e,t){const n=e.data.settings?.emBlockId;if(n==null||n==="")return;const r=e.data.settings?.emBlockVersion;let o=RI()??null;o||(o=(document.querySelector('[em-edit="active"]')||document.querySelector(".em-element-editor"))?.closest?.('[em="block"]')??document.querySelector('[em="block"]')),o&&(o.setAttribute("em-block-id",String(n)),r!=null&&r!==""&&o.setAttribute("em-block-version",String(r)),t.commit())}var k$={sandbox_eblock_set_em_block_id:_$},L$=`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 Ul(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem.previousSibling&&Ul({elem:e.elem.previousSibling})}function jl(e){if(!e.elem)return!1;if(e.elem.parentElement?.tagName==="SECTION"||e.elem.classList.contains("em-narrow-table")&&Array.from(e.elem.childNodes).every(n=>n.nodeType===Node.TEXT_NODE))return e.elem.innerHTML="",!1;e.elem.querySelector(".em-element-editor")&&e.elem.querySelector(".em-element-editor")?.remove(),e.elem.querySelector(".em-element-path")&&e.elem.querySelectorAll(".em-element-path").forEach(n=>n.remove()),e.elem.querySelector(".em-element-block-add")&&e.elem.querySelectorAll(".em-element-block-add").forEach(n=>n.remove()),e.elem.querySelector(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft")&&e.elem.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(n=>n.remove());const t=e.elem.parentElement;if(e.elem.classList.contains("em-mob-wrap")||e.elem.classList.contains("noresp-em-mob-wrap"))e.elem.innerHTML.trim()===""&&(e.elem.parentElement?.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1?e.elem.innerHTML="":(e.elem.remove(),jl({elem:t})));else if(e.elem.innerHTML.trim()==="")Ul({elem:e.elem}),e.elem.remove(),jl({elem:t});else if(t&&!t.querySelector('div[style*="display"]')){for(const n of e.elem.childNodes)n.nodeName==="#text"&&n.textContent?.trim()===""?(Ul({elem:n}),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(Ul({elem:n}),n.remove());e.elem.innerHTML.trim()===""&&jl({elem:e.elem})}return!0}function N$(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=e.getElementParent(t);let r=t.parentNode;const o=t.closest("editor");if(e.setCursorPosition(n),t.classList.contains("em-code")){const i=e.getVariableByIcon?.(t);i&&(i.parentNode?.removeChild(i),t.remove())}else if(t.tagName==="TD"&&t.innerHTML===""&&t.hasAttribute("height")){const i=t.closest("table");if(i){const s=i.previousSibling;s&&s?.textContent?.trim()===""&&s.remove(),i.remove()}}else if(t.closest(".em-element-resize-img-container"))r=t.closest(".em-element-resize-img-container").parentNode,t.closest("td")?.querySelector("editor")?.innerHTML===""&&t.closest("td")?.querySelector("editor")?.remove(),t.closest(".em-element-resize-img-container")?.remove();else if(t.closest('[em="atom"]')){const i=t.closest(".em-mob-wrap, .noresp-em-mob-wrap"),s=t.closest('[em="atom"]');t.tagName==="TD"&&t.previousElementSibling===null&&t.nextElementSibling===null?(r=s.parentNode,s?.remove()):(r=t.closest("td"),t.remove());const a=!!i&&Array.from(i.querySelectorAll('[em="atom"]')).some(l=>l!==s);t.tagName!=="TD"&&i&&!a&&i.textContent?.trim()===""&&(i.textContent="")}else{t.remove();const i=t.previousSibling;i&&i?.textContent?.trim()===""&&i.remove(),t.remove()}o&&o.remove(),jl({elem:r}),e.commit(),e.messageService.send({operation:"application_element_settings_close"})}function x$(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>`;qe(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",L$),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")&&M$(e,t).catch(r=>{})}async function M$(e,t){const{default:n}=await Wc(async()=>{const{default:l}=await Promise.resolve().then(()=>Ql("./typograf.all.Mun9CrLC.js"));return{default:l}},void 0,{}.url);let r=document.querySelector("[em-edit]")?.closest("div")||document.querySelector("[em-edit]")?.closest("editor")||null;const o=e.action==="typograf"?r?.innerText:document.body.innerText,i=t.hasRussianText?.(o||"")??!1,s=new n({locale:[e.locale==="ru_RU"||i?"ru":"en-US"],htmlEntity:{type:"name",onlyInvisible:!0,list:["nbsp","shy","mdash","ndash","laquo","raquo"]}});s.disableRule("ru/punctuation/*"),s.disableRule("common/punctuation/*"),s.enableRule("common/punctuation/quote"),s.setSetting("common/punctuation/quote","ru",{left:"«",right:"»",removeDuplicateQuotes:!0}),s.setSetting("common/punctuation/quote","en-US",{left:'"',right:'"',removeDuplicateQuotes:!0}),s.disableRule("ru/dash/kakto"),s.disableRule("ru/dash/taki"),s.disableRule("ru/dash/izpod"),s.disableRule("ru/dash/izza"),s.disableRule("ru/dash/ka"),s.disableRule("ru/dash/to"),s.disableRule("ru/dash/koe"),s.disableRule("common/nbsp/nowrap"),s.disableRule("common/nbsp/dpi"),s.disableRule("common/nbsp/afterParagraphMark"),s.enableRule("common/nbsp/afterNumber"),s.disableRule("common/html/quot"),s.disableRule("ru/date/*"),s.disableRule("common/number/mathSigns"),s.disableRule("ru/number/ordinals"),s.disableRule("ru/number/comma"),s.disableRule("ru/symbols/NN"),s.disableRule("common/symbols/cf"),s.disableRule("ru/other/phone-number"),s.addSafeTag('<[^>]+class="preheader"[^>]*>',"</[^>]+>"),s.addSafeTag("<!--","-->");function a(l){let c=s.execute(l);return c=c.replace(/\b(\d{1,3}(?:[ \u00A0]\d{3})*(?:[.,]\d+)?)\b/g,function(u){return u.replace(/[ \u00A0]/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,"&nbsp;")}),c=c.replace(/(\d[\d&nbsp;]*[.,]?\d+)(?:\s|&nbsp;)?(?=(?:руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB))/gi,"$1&nbsp;"),c=c.replace(/(\d[\d&nbsp;]*[.,]?\d+)&nbsp;(руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB)/gi,"$1&nbsp;$2"),c}if(e.action==="typograf_all"){const l=document.body;l&&(l.innerHTML=a(l.innerHTML))}else r?.parentElement&&(r=r.parentElement,r?.parentElement&&(r.parentElement.innerHTML=a(r.parentElement.innerHTML)));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 tS(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function nf(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 R$(e,t){const n=e.closest("a");if(nf(n))return n;if(!t)return null;const r=tS(t.anchorNode)?.closest("a")??null;if(nf(r))return r;const o=tS(t.focusNode)?.closest("a")??null;return nf(o)?o:null}function nS(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"&&vv(e)?e.closest('[em="block"]')??e:e}function rS(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"?Po(e)??e:e:null}function O$(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=window.getSelection();if(R$(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 P$(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=rS(nS(t).previousElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function I$(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=rS(nS(t).nextElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function D$(e,t){t.removeAllAttributes("em-edit");const n=document.querySelector(".em-editor-wrapper");n&&(n.style.display="none"),document.querySelectorAll("editor").forEach(r=>{r.blur()})}function B$(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 H$(e,t){t.removeAllAttributes("em-state");const n=t.elementPath[e.data.index??0];n?.elem&&n.elem.setAttribute("em-state","active")}function F$(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};O$(n)}function $$(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};P$(n)}function W$(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};I$(n)}function q$(e,t){if(!t.getElementParent||!t.state)return;const n={state:t.state,commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,getVariableByIcon:t.getVariableByIcon};N$(n)}function z$(e,t){if(!t.getElementParent||!t.state)return;const n={action:e.data.action,locale:e.data.locale},r={state:t.state,commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,HTMLDocument:t.HTMLDocument,hasRussianText:t.hasRussianText};x$(n,r)}var V$={sandbox_element_active_reset:D$,sandbox_element_active_set:B$,sandbox_element_hover_set:H$,sandbox_element_parent_get:F$,sandbox_element_prev_get:$$,sandbox_element_next_get:W$,sandbox_element_remove:q$,sandbox_element_text:z$},dn=".em-mob-wrap, .noresp-em-mob-wrap",ht=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",rt='div[style*="inline-block"]';function $r(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&&$r({elem:e.elem.previousSibling,width:e.width})}function oS(e){const t=e.removedBlockIndex===0?"nextSibling":"previousSibling";e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem[t]&&oS({elem:e.elem[t],removedBlockIndex:e.removedBlockIndex})}function Gl(e){return!!e.querySelector(dn)||!!e.closest(dn)}function ws(e){return e.querySelector(dn)?document.querySelector('[em-edit="active"]'):e.closest(dn).parentElement}function Xl(e){return e.querySelector(rt)?document.querySelector('[em-edit="active"]'):e.closest(rt).parentElement}function U$(e,t){const n=document.querySelector("[em-edit]");if(n)try{if(t.state.increment("activeElementLocked"),Gl(n)){const r=ws(n),o=e.minWidth,i=r.querySelectorAll(ht).length,s=i>1?parseFloat(String(e.gap)):20,a=i>1?parseFloat(String(e.gapMobile||e.gap)):20;let l="";r.querySelector(".em-mob-wrap")?l=`<td width="${s}" class="em-mob-wrap em-mob-height-${a}px"></td>
255
- <td width="${o}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:r.querySelector(".noresp-em-mob-wrap")&&(l=`<td width="${s}" class="noresp-em-mob-wrap noresp-em-mob-height-${a}px"></td>
256
- <td width="${o}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`);let c=0,u=0,d=0;r.querySelectorAll(ht).forEach(p=>{parseFloat(p.getAttribute("width")||"0")>o&&d++,c+=parseFloat(p.getAttribute("width")||"0")});const m=(o+s)/d;if(r.querySelectorAll(ht).forEach(p=>{if(parseFloat(p.getAttribute("width")||"0")>o){const f=Math.round(parseFloat(p.getAttribute("width")||"0")-m);p.setAttribute("width",String(f))}}),qe(r.querySelectorAll(ht)[i-1],"afterend",l),r.querySelectorAll(ht).forEach(p=>{u+=parseFloat(p.getAttribute("width")||"0")}),c-u-s!==0){const p=r.querySelector(dn),f=parseFloat(p.getAttribute("width")||"0")+(c-u-s);p.setAttribute("width",String(f))}t.setPercentsForColumns(r.querySelectorAll(ht)),t.commit()}else{const r=Xl(n),o=e.minWidth,i=r.querySelectorAll(rt).length,s=i>1?parseFloat(String(e.gap)):20,a='<!--[if (gte mso 9)|(IE)]></td><td width="'+(o+s)+`" valign="top"><![endif]-->
257
- <div style="display: inline-block; width: `+(o+s)+`px; vertical-align: top;" class="em-mob-width-100perc">
258
- <table width="`+o+`" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
259
- <tr>
260
- <td align="left"></td>
261
- </tr>
262
- </table>
263
- <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
264
- </div>`;let l=0,c=0,u=0;if(i===1){const m=n.querySelector(rt)?r.querySelector(rt):n.closest(rt);m.style.removeProperty("max-width"),m.firstElementChild?.style.removeProperty("max-width"),m.firstElementChild?.style.removeProperty("width")}r.querySelectorAll(rt).forEach(m=>{const p=parseFloat(m.firstElementChild?.getAttribute("width")||"0");p>o&&u++,l+=p});const d=(o+s)/u;if(r.querySelectorAll(rt).forEach(m=>{const p=m;if(parseFloat(p.firstElementChild?.getAttribute("width")||"0")>o){const f=Math.round(parseFloat(p.style.width)-d),h=f-s;p.style.width=f+"px",$r({elem:p,width:f}),p.firstElementChild?.tagName==="TABLE"&&p.firstElementChild.setAttribute("width",String(h))}}),qe(r.querySelectorAll(rt)[i-1],"afterend",a),r.querySelectorAll(rt).forEach(m=>{c+=parseFloat(m.firstElementChild?.getAttribute("width")||"0")}),l-c-s!==0){const m=r.querySelector(rt),p=parseFloat(m.style.width)+(l-c-s);m.style.width=p+"px",$r({elem:m,width:p}),m.firstElementChild?.tagName==="TABLE"&&m.firstElementChild.setAttribute("width",String(p-s))}t.commit()}}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function j$(e,t){const n=document.querySelector("[em-edit]");if(!n)return;let r=null;try{if(t.state.increment("activeElementLocked"),Gl(n)){const o=ws(n);let i=0;const s=parseFloat(String(e.gap));o.querySelectorAll(ht).forEach((c,u)=>{u===e.removedBlockIndex&&(i=parseFloat(c.getAttribute("width")||"0"),c===n.closest(dn)&&(n.closest(".em-structure > td")?.setAttribute("em-edit","active"),r=n.closest(".em-structure > td")),c.nextElementSibling&&c.previousElementSibling?c.previousElementSibling.remove():c.nextElementSibling&&!c.previousElementSibling?c.nextElementSibling.remove():!c.nextElementSibling&&c.previousElementSibling&&c.previousElementSibling.remove(),c.remove())});const a=o.querySelectorAll(ht).length,l=Math.floor((i+s)/a);if(o.querySelectorAll(ht).forEach(c=>{const u=Math.round(parseFloat(c.getAttribute("width")||"0")+l);c.setAttribute("width",String(u))}),a===1){const c=o.querySelector(dn),u=c.closest("table").parentElement;c.setAttribute("width",String(u.getBoundingClientRect().width-parseFloat(u.style.paddingLeft||"0")-parseFloat(u.style.paddingRight||"0")))}t.setPercentsForColumns(o.querySelectorAll(ht))}else{const o=Xl(n);let i=0;const s=parseFloat(String(e.gap));o.querySelectorAll(rt).forEach((c,u)=>{u===e.removedBlockIndex&&(i=parseFloat(c.style.width),c===n.closest(rt)&&n.closest(".em-structure > td")?.setAttribute("em-edit","active"),oS({elem:c,removedBlockIndex:e.removedBlockIndex}),c.remove())});const a=o.querySelectorAll(rt).length,l=Math.round(i/a);if(o.querySelectorAll(rt).forEach(c=>{const u=c,d=Math.round(parseFloat(u.style.width)+l),m=d-s;u.style.width=d+"px",$r({elem:u,width:d}),u.firstElementChild?.tagName==="TABLE"&&u.firstElementChild.setAttribute("width",String(m))}),a===1){const c=o.querySelector(rt);c.style.width="100%",c.style.maxWidth=o.closest("table")?.style.maxWidth||"",$r({elem:c,width:o.closest("table")?.style.maxWidth||""}),c.firstElementChild.style.width="91%",c.firstElementChild.style.maxWidth=parseFloat(c.firstElementChild?.getAttribute("width")||"0")+"px"}}}finally{t.commit(),Promise.resolve().then(()=>{t.state.decrement("activeElementLocked"),r&&t.applicationElementSettingsSet&&t.applicationElementSettingsSet({elem:r})})}}function iS(e,t){const n=document.createComment("em-swap");e.replaceWith(n),t.replaceWith(e),n.replaceWith(t)}function sS(e){const t=e.cloneNode(!0);return t.querySelectorAll("editor").forEach(n=>{n.replaceWith(...Array.from(n.childNodes))}),t.querySelectorAll("[em-edit]").forEach(n=>n.removeAttribute("em-edit")),t.hasAttribute("em-edit")&&t.removeAttribute("em-edit"),t.querySelectorAll("[em-temp]").forEach(n=>n.remove()),Ua(t)}function G$(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{copiedBlockIndex:r,widths:o}=e,i=parseFloat(String(e.gap))||0;try{if(t.state.increment("activeElementLocked"),Gl(n)){const s=ws(n),a=s.querySelectorAll(ht)[r];if(!a)return;const l=a.nextElementSibling||a.previousElementSibling,c=l?Ua(l):s.querySelector(".noresp-em-mob-wrap")?`<td width="${i}" class="noresp-em-mob-wrap noresp-em-mob-height-${i}px"></td>`:`<td width="${i}" class="em-mob-wrap em-mob-height-${i}px"></td>`;qe(a,"afterend",c+sS(a));const u=s.querySelectorAll(ht);u.forEach((d,m)=>{o[m]!=null&&d.setAttribute("width",String(o[m]))}),t.setPercentsForColumns(u),t.commit()}else{const s=Xl(n),a=s.querySelectorAll(rt)[r];if(!a)return;const l='<!--[if (gte mso 9)|(IE)]></td><td width="'+((o[r+1]??o[r]??0)+i)+`" valign="top"><![endif]-->
265
- `;qe(a,"afterend",l+sS(a)),s.querySelectorAll(rt).forEach((c,u)=>{const d=c,m=o[u];if(m==null)return;const p=m+i;d.style.width=p+"px",$r({elem:d,width:p}),d.firstElementChild?.tagName==="TABLE"&&d.firstElementChild.setAttribute("width",String(m))}),t.commit()}}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function X$(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{indexA:r,indexB:o}=e;if(r!==o)try{if(t.state.increment("activeElementLocked"),Gl(n)){const i=ws(n),s=i.querySelectorAll(ht),a=s[r],l=s[o];if(!a||!l)return;iS(a,l),t.setPercentsForColumns(i.querySelectorAll(ht)),t.commit()}else{const i=Xl(n).querySelectorAll(rt),s=i[r],a=i[o];if(!s||!a)return;iS(s,a),[s,a].forEach(l=>{$r({elem:l,width:parseFloat(l.style.width)})}),t.commit()}}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function Y$(e,t){try{t.state.increment("activeElementLocked");const n=document.querySelector("[em-edit]");if(!n)return;const r=ws(n);if(e.wrap)r.querySelectorAll(dn).forEach((o,i)=>{o.classList.remove("em-mob-wrap-cancel"),i%2===0&&(o.classList.forEach(s=>s.startsWith("em-mob-width-")&&o.classList.remove(s)),o.classList.add("em-mob-width-100perc"))});else{const o=r.querySelectorAll(ht).length,i=Math.round(100/o)-2;r.querySelectorAll(dn).forEach((a,l)=>{a.classList.add("em-mob-wrap-cancel"),a.classList.remove("em-mob-width-100perc"),l%2===0&&a.classList.add("em-mob-width-"+i+"perc")});const s=t.emailWidth||660;document.querySelector('style[em="styles"]')?.insertAdjacentHTML("beforeend",`
266
- @media only screen and (max-device-width:${s}px),only screen and (max-width:${s}px) {
267
- .em-mob-wrap.em-mob-wrap-cancel, .noresp-em-mob-wrap.em-mob-wrap-cancel { display: table-cell !important; }
268
- .em-mob-width-${i}perc { width: ${i}% !important; }
269
- }
270
- `)}t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function K$(e,t){try{t.state.increment("activeElementLocked");const n=document.querySelector("[em-edit]");if(!n)return;const r=n.querySelector(dn)?document.querySelector('[em-edit="active"]'):n.closest(dn)?.parentElement?.closest("td");if(!r)return;e.dirRevert?(r.setAttribute("dir","rtl"),r.querySelectorAll("td").forEach(o=>{for(let i=o.firstChild;i;i=i.nextSibling)if(i.nodeType===3){i.parentNode?.setAttribute("dir","ltr");break}})):(r.removeAttribute("dir"),r.querySelectorAll("[dir]").forEach(o=>o.removeAttribute("dir"))),t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function Uo(e){return{state:e.state,commit:e.commit,setPercentsForColumns:e.setPercentsForColumns,emailWidth:e.emailWidth,applicationElementSettingsSet:e.applicationElementSettingsSet}}function Z$(e,t){!t.state||!t.setPercentsForColumns||U$(e.data.settings,Uo(t))}function Q$(e,t){!t.state||!t.setPercentsForColumns||j$(e.data.settings,Uo(t))}function J$(e,t){!t.state||!t.setPercentsForColumns||G$(e.data.settings,Uo(t))}function eW(e,t){!t.state||!t.setPercentsForColumns||X$(e.data.settings,Uo(t))}function tW(e,t){!t.state||!t.setPercentsForColumns||Y$(e.data.settings,Uo(t))}function nW(e,t){!t.state||!t.setPercentsForColumns||K$(e.data.settings,Uo(t))}var rW={sandbox_floatBlock_add:Z$,sandbox_floatBlock_remove:Q$,sandbox_floatBlock_copy:J$,sandbox_floatBlock_swap:eW,sandbox_floatblock_wrap:tW,sandbox_floatblock_dir:nW},oW='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>',iW=['[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 aS(){Un(),document.body.classList.remove("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 sW(){const e=document.querySelectorAll('[em="block"]');return e.length?e[e.length-1]:null}function aW(){for(const e of iW){const t=document.querySelector(e);if(t)return t}return null}function lW(e){const t=e.querySelectorAll('[em="atom"]');return t.length?t[t.length-1]:e}function cW(e){const t=e.querySelectorAll('[em="atom"]');if(t.length)return t[t.length-1];const n=e.querySelector("td.em-mob-wrap")??e.querySelector("td.noresp-em-mob-wrap")??e.querySelector('td[em-edit="active"]:not([height]):not([width])');return n||(e instanceof HTMLElement?Pl(e):null)}function uW(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),dW(i,e,r)}function dW(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 lS(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}),uW(e,t,n)}function mW(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 fW(e,t){const n=V1();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=_E(e);if(e!==oW){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"||!un(n)?null:(o?t.insertCountdown({targetElem:Vn(n),targetPlace:"beforeend",atomHTML:r}):t.insertAdjacentHTML(Vn(n),"beforeend",r),n.querySelector('[em="block"]:last-child')??n.lastElementChild)}function cS(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.html=="string"?e.html:""}function pW(e,t){e&&t.messageService.send(Pe.APPLICATION_ATOM_INSERTED,e),aS()}function hW(e,t){t.messageService.send("application_block_inserted",{type:e.type,name:e.name,blockId:e.blockId,project:e.project}),aS()}function gW(e,t){const n=cS(e.atomHTML),r=n.match(/<style((.|\n|\r)*?)<\/style>/g);return t.setDocumentStyles(r),n.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim()}function bW(e,t){let n=gW(e,t);if(!n)return!1;let r=null;const o=aW();if(o)r=lS(lW(o),n,t);else{const i=sW();if(i){const s=cW(i);s&&(r=lS(s,n,t))}else r=fW(n,t)}return r?(mW(r,t),!0):!1}function yW(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}if(t.substring(0,3)==="<tr"){const r=document.createElement("table");r.setAttribute("cellspacing","0"),r.setAttribute("cellpadding","0"),r.setAttribute("align","center"),r.setAttribute("border","0"),r.setAttribute("em","block"),r.setAttribute("width",e.hasAttribute("width")?e.getAttribute("width"):String(e.getBoundingClientRect().width)),r.classList.add("em-mob-width-100perc"),Qn(r,`
271
- `+t+`
272
- `),r.querySelectorAll('tr[em="block"]').forEach(o=>o.removeAttribute("em")),e.insertAdjacentElement("afterend",r)}else n.insertAdjacentHTML(e,"afterend",t)}function uS(e,t,n){if(!e.blockHTML?.trim())return!1;const r=t.parseFromString(e.blockHTML);let o=r.filter(m=>m.tagName&&m.tagName!=="LINK"&&m.tagName!=="STYLE").map(m=>t.getOuterHtml(m)).join(""),i=r.filter(m=>m.tagName==="STYLE").map(m=>t.getOuterHtml(m)).join("");const s=t.assetsRoot?.()??document.head,a=r.filter(m=>m.tagName==="LINK"&&m.getAttribute("em-class")).filter(m=>!s?.querySelector(`link[em-class="${m.getAttribute("em-class")}"]`));if(i){let m=s?.querySelector('style[em="styles"]'),p="";m?p=t.HTMLDocument.getInnerHtml(m):(m=document.createElement("style"),m.setAttribute("em","styles"),m=s?.insertAdjacentElement("beforeend",m));const f=document.createElement("div");t.emailWidth&&(i=i.replace(/(max-device-width:|max-width:)\d+px/g,y=>y.replace(/\d+/,String(t.emailWidth)))),f.insertAdjacentHTML("afterbegin",i);let h=t.minify(p+`
273
- `+[...f.querySelectorAll("style")].map(y=>y.innerHTML).join(`
274
- `),{restructure:!0,forceMediaMerge:!0}).css;h=t.cssbeautify(h,{indent:" ",autosemicolon:!0}),m.textContent=`
275
- `+h+`
276
- `}for(const m of a.reverse())s?.prepend(m),s?.insertAdjacentHTML("afterbegin",`
277
- `);if(e.type!=="project"&&(o=t.commonStylesApplyToBlock({html:o})),o.match(/class="em-countdown"/gi)&&(o=t.uptimeCountdown({blockHTML:o})),n)return(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:n}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:n,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),yW(n,o,t),!0;let l=null,c=null,u=!1;const d=V1();if(d)l=d,c=l,(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:l}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:l,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),o.substring(0,3)==="<tr"?t.insertAdjacentHTML(Vn(d),"beforeend",o):t.insertAdjacentHTML(Vn(d),"beforeend",'<tr><td align="center">'+o+"</td></tr>"),u=!0;else if(document.querySelector('[em="group"]:last-child [em="block"]')||document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')){const m=document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]');if(l=m?m.closest('[em="block"]'):document.querySelector('[em="group"]:last-child [em="block"]:last-child'),(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:l}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:l,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),l?.tagName==="TR")o.substring(0,3)==="<tr"?t.insertAdjacentHTML(l,"afterend",o):t.insertAdjacentHTML(l,"afterend",'<tr em="block"><td align="center">'+o+"</td></tr>"),u=!0;else if(l){if(o.substring(0,3)==="<tr"){const p=document.createElement("table");p.setAttribute("cellspacing","0"),p.setAttribute("cellpadding","0"),p.setAttribute("align","center"),p.setAttribute("border","0"),p.setAttribute("em","block"),p.setAttribute("width",l.hasAttribute("width")?l.getAttribute("width"):String(l.getBoundingClientRect().width)),p.classList.add("em-mob-width-100perc"),Qn(p,`
278
- `+o+`
279
- `),p.querySelectorAll('tr[em="block"]').forEach(f=>f.removeAttribute("em")),l.insertAdjacentElement("afterend",p)}else t.insertAdjacentHTML(l,"afterend",o);u=!0}c=l?.nextSibling}return u&&!document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')&&document.documentElement.scrollHeight+(t.iframeOffsetTop||0)>(t.previewHeight||0)&&c&&t.messageService.send({operation:"application_scroll-to",settings:{value:c.getBoundingClientRect().top+c.getBoundingClientRect().height}}),u}function vW(e,t){if(!t.lockEditor&&cS(e.atomHTML).trim())try{t.state.increment("activeElementLocked"),t.setAtomReplaced?.(null),gE({kind:"atom",settings:e}),e.action!=="insert"&&document.body.classList.add("em-atom-insert-body"),e.action==="insert"&&bW(e,t)&&pW(e.name,t),t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function EW(e){return e.replace(/["\\]/g,"\\$&")}function SW(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="${EW(String(n))}"]`,o=Array.from(document.querySelectorAll(r));if(!o.length)return 0;let i=0;try{t.state.increment("activeElementLocked");for(const s of o)uS({action:"insert",blockHTML:e.blockHTML,type:e.type,project:e.project,name:e.name},t,s)&&(s.remove(),i+=1);t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}return i}function wW(e,t){if(!t.lockEditor&&e.blockHTML?.trim())try{t.state.increment("activeElementLocked"),gE({kind:"block",settings:e}),document.body.classList.add("em-block-insert-body"),e.action==="insert"&&uS(e,t)&&hW(e,t),t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function CW(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};vW({action:e.data.action,atomHTML:r.atomHTML,name:r.name},n)}function AW(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};wW({action:e.data.action,blockHTML:r.blockHTML,type:r.type,project:r.project,name:r.name,blockId:r.blockId},n)}function TW(e,t){t.setElementSettings?.(e)}var _W={"sandbox_atom-insert":CW,"sandbox_block-insert":AW,sandbox_element_settings_set:TW},kW=nn("elements",V$,{services:[He,vt,xe,Kn]},e=>{const t=D(e,He),n=D(e,vt),r=lt(e),o=D(e,Kn);return()=>({HTMLDocument:{getOuterHtml:Vt},applicationElementSettingsSet:t,commit:r,elementPath:o.elementPath,getElementParent:i=>Cl(i),getVariableByIcon:cl,hasRussianText:AB,messageService:Z,removeAllAttributes:Jn,setCursorPosition:i=>n(i),state:Yc})}),LW=nn("display",T$,void 0,()=>()=>({messageService:Z})),NW=nn("floatBlock",rW,{services:[He,xe]},e=>{const t=D(e,He),n=lt(e);let r=600;return x.subscribe(o=>{o.emailWidth!==void 0&&(r=o.emailWidth)}),()=>({applicationElementSettingsSet:t,commit:n,emailWidth:r,state:Yc,setPercentsForColumns:o=>Jc(o)})}),xW=nn("accordion",w$,{services:[xe]},e=>{const t=lt(e);return()=>({HTMLDocument:{getOuterHtml:Vt},commit:t,state:Yc,getActiveEditElement:eu,parseFromString:n=>Te(n)})}),MW=nn("eblock",k$,{services:[xe]},e=>{const t=lt(e);return()=>({commit:t})}),RW=nn("palette",_W,{services:[Ur,Ds]},e=>{const t=D(e,Ur),n=D(e,Ds);return()=>({getInsertContext:t.insertContext,setElementSettings:n})}),OW=nn("nativeImageDrop",{[Pe.SANDBOX_NATIVE_IMAGE_DROP_CLEAR]:()=>CE()},void 0,()=>()=>({})),PW=[kW,LW,NW,xW,MW,RW,OW],IW={name:"sandbox.prepareHtml",provides:[Os],setup:e=>e.inject(Os,t=>ko({node:t,isPartial:!0}))},DW={name:"sandbox.blockControlsViewport",setup:e=>e.addService(vf,()=>yl({scrollTop:x.get("scrollTop")}))},BW=[IW,DW,a$,l$,c$,u$,d$,...PW,m$,f$,p$,h$,g$,b$],HW="__emmDiagnostics__",FW="diagnostics";function $W(){try{const e=new URLSearchParams(window.location.search).get(FW);return e!==null&&e!=="0"}catch{return!1}}function rf(e){try{window.parent.postMessage({mark:HW,...e},"*")}catch{}}function WW(){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}});rf({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function jo(){return window.performance.timeOrigin+window.performance.now()}function qW(){return Array.from(document.images).every(e=>e.complete)}function zW(e,t){const r=window.setInterval(()=>{!qW()||jo()-e()<500||(window.clearInterval(r),rf({type:"settled",at:Math.max(e(),t)}),WW())},100)}function VW(){if(!$W()||typeof MutationObserver!="function")return;let e=!1,t=jo();new MutationObserver(()=>{t=jo(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const n=jo();rf({type:"paint",at:n}),zW(()=>t,n)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{t=jo()}),document.addEventListener("load",()=>{t=jo()},!0)}var UW=500,jW=300,Cs,Yl=!1;function dS(){if(Yl)return;Yl=!0;let e=!1;const t=window.setTimeout(()=>{e||(e=!0,Cs=!1,Yl=!1)},jW);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(t),Cs=!0,Yl=!1)})}function GW(){return Cs===!1?(dS(),Promise.resolve()):new Promise(e=>{let t=!1;const n=()=>{t||(t=!0,e())},r=window.setTimeout(()=>{Cs=!1,n()},UW);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(r),Cs=!0,n()})})})}var XW=1;function YW(){dS();const e=async(t,n)=>{await n?.(t),await GW()};Z.addListenerAsync(Pe.SANDBOX_INITED,e,XW)}var KW=16,mS=100,ZW=.95,fS=.02;function pS(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*KW:t===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function hS(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 gS(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(hS(o,"y",n)||hS(o,"x",t))return!0}return!1}function QW(){let e=0,t=0,n=!1;const r=()=>{n=!1;const d=e,m=t;e=0,t=0,!(d===0&&m===0)&&Z.send(Pe.SANDBOX_WHEEL,{deltaX:d,deltaY:m})},o=(d,m)=>{e+=d,t+=m,n||(n=!0,window.requestAnimationFrame(r))};window.addEventListener("wheel",d=>{d.ctrlKey||gS(d.target,d.deltaX,d.deltaY)||(d.preventDefault(),o(pS(d.deltaX,d.deltaMode),pS(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:m}=a,p=performance.now();const f=h=>{const y=h>p?Math.min(h-p,50):16;p=h;const v=Math.pow(ZW,y/16);if(d*=v,m*=v,Math.abs(d)<fS&&Math.abs(m)<fS){l=void 0;return}o(d*y,m*y),l=window.requestAnimationFrame(f)};l=window.requestAnimationFrame(f)};window.addEventListener("touchstart",d=>{c(),s=!1,a={x:0,y:0};const m=d.touches.length===1?d.touches[0]:void 0;i=m?{x:m.screenX,y:m.screenY,at:d.timeStamp}:void 0},{passive:!0}),window.addEventListener("touchmove",d=>{const m=d.touches.length===1?d.touches[0]:void 0;if(document.documentElement.classList.contains("em-resize-start")){i=void 0,s=!1;return}if(!m||!i){i=void 0,s=!1;return}const p=i.x-m.screenX,f=i.y-m.screenY,h=d.timeStamp-i.at;if(i={x:m.screenX,y:m.screenY,at:d.timeStamp},!gS(d.target,p,f)){if(d.cancelable&&d.preventDefault(),s=!0,h>0){const y=Math.min(h/mS,1);a={x:a.x*(1-y)+p/h*y,y:a.y*(1-y)+f/h*y}}o(p,f)}},{passive:!1}),window.addEventListener("touchend",d=>{const m=i?d.timeStamp-i.at:1/0;s&&d.touches.length===0&&m<mS&&u(),i=void 0,s=!1},{passive:!0}),window.addEventListener("touchcancel",()=>{i=void 0,s=!1})}var JW={name:"sandbox.diagnosticsAgent",setup:()=>VW()},eq={name:"sandbox.paintGate",setup:()=>YW()},tq={name:"sandbox.wheelBridge",setup:()=>QW()},nq={name:"sandbox.deviceWidthMediaGuard",setup:()=>O5()};function rq(){return Math.ceil(document.documentElement.getBoundingClientRect().height)}function oq(){return Math.max(document.body?.scrollWidth??0,document.documentElement?.scrollWidth??0)}window.iFrameResizer={heightCalculationMethod:rq,widthCalculationMethod:oq};var iq=Yn(((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},m=128,p=!0,f=1,h="bodyOffset",y=h,v=!0,A="",k={},S=32,b=null,E=!1,C=!1,g="[iFrameSizer]",w=g.length,T="",_={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="child",N=!0,W=window.parent,P="*",R=0,Y=!1,V=null,G=16,Le=1,ae="scroll",ne=ae,we=window,j=function(){Ft("onMessage function not defined")},z=function(){},Se=function(){},Ae={height:function(){return Ft("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return Ft("Custom width calculation function not defined"),document.body.scrollWidth}},Q={},Lt=!1;try{var U=Object.create({},{passive:{get:function(){Lt=!0}}});window.addEventListener("test",Ts,U),window.removeEventListener("test",Ts,U)}catch{}var In,gt,Wr,mn,ot,Bt,Be={bodyOffset:function(){return document.body.offsetHeight+bt("marginTop")+bt("marginBottom")},offset:function(){return Be.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return Ae.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,tt(Be))},min:function(){return Math.min.apply(null,tt(Be))},grow:function(){return Be.max()},lowestElement:function(){return Math.max(Be.bodyOffset()||Be.documentElementOffset(),pn("bottom",yt()))},taggedElement:function(){return hn("bottom","data-iframe-height")}},jn={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return Ae.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(jn.bodyScroll(),jn.documentElementScroll())},max:function(){return Math.max.apply(null,tt(jn))},min:function(){return Math.min.apply(null,tt(jn))},rightMostElement:function(){return pn("right",yt())},taggedElement:function(){return hn("right","data-iframe-width")}},As=(In=Zl,ot=null,Bt=0,function(){var O=Date.now(),H=G-(O-(Bt=Bt||O));return gt=this,Wr=arguments,H<=0||G<H?(ot&&(clearTimeout(ot),ot=null),Bt=O,mn=In.apply(gt,Wr),ot||(gt=Wr=null)):ot=ot||setTimeout(sf,H),mn});Ht(window,"message",function(O){var H={init:function(){A=O.data,W=O.source,Kl(),p=!1,setTimeout(function(){v=!1},m)},reset:function(){v?ce("Page reset ignored by init"):(ce("Page size reset by host page"),yS("resetPage"))},resize:function(){$t("resizeParent","Parent window requested size check")},moveToAnchor:function(){k.findTarget(ve())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var Ne=ve();ce("PageInfoFromParent called from parent: "+Ne),Se(JSON.parse(Ne)),ce(" --")},message:function(){var Ne=ve();ce("onMessage called from parent: "+Ne),j(JSON.parse(Ne)),ce(" --")}};function fe(){return O.data.split("]")[1].split(":")[0]}function ve(){return O.data.substr(O.data.indexOf(":")+1)}function K(){return O.data.split(":")[2]in{true:1,false:1}}function J(){var Ne=fe();Ne in H?H[Ne]():(typeof t>"u"||!t.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||K()||Ft("Unexpected message ("+O.data+")")}g===(""+O.data).substr(0,w)&&(p===!1?J():K()?H.init():ce('Ignored message of type "'+fe()+'". Received before initialization.'))}),Ht(window,"readystatechange",ES),ES()}function Ts(){}function Ht(O,H,fe,ve){O.addEventListener(H,fe,!!Lt&&(ve||{}))}function _s(O){return O.charAt(0).toUpperCase()+O.slice(1)}function of(O){return g+"["+T+"] "+O}function ce(O){E&&window.console}function Ft(O){window.console}function Kl(){function O(K){return K==="true"}var H;function fe(K){Kt(0,0,K.type,K.screenY+":"+K.screenX)}function ve(K,J){ce("Add event listener: "+J),Ht(window.document,K,fe)}H=A.substr(w).split(":"),T=H[0],s=n!==H[1]?Number(H[1]):s,u=n!==H[2]?O(H[2]):u,E=n!==H[3]?O(H[3]):E,S=n!==H[4]?Number(H[4]):S,r=n!==H[6]?O(H[6]):r,a=H[7],y=n!==H[8]?H[8]:y,i=H[9],c=H[10],R=n!==H[11]?Number(H[11]):R,k.enable=n!==H[12]&&O(H[12]),M=n!==H[13]?H[13]:M,ne=n!==H[14]?H[14]:ne,C=n!==H[15]?!!H[15]:C,ce("Initialising iFrame ("+window.location.href+")"),(function(){function K(J,Ne){return typeof J=="function"&&(ce("Setup custom "+Ne+"CalcMethod"),Ae[Ne]=J,J="custom"),J}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var J=window.iFrameResizer;ce("Reading data from page: "+JSON.stringify(J)),Object.keys(J).forEach(ks,J),j="onMessage"in J?J.onMessage:j,z="onReady"in J?J.onReady:z,P="targetOrigin"in J?J.targetOrigin:P,y="heightCalculationMethod"in J?J.heightCalculationMethod:y,ne="widthCalculationMethod"in J?J.widthCalculationMethod:ne})(),y=K(y,"height"),ne=K(ne,"width")),ce("TargetOrigin for parent set to: "+P)})(),(function(){n===a&&(a=s+"px"),Gn("margin",(function(K,J){return J.indexOf("-")!==-1&&(Ft("Negative CSS value ignored for "+K),J=""),J})("margin",a))})(),Gn("background",i),Gn("padding",c),(H=document.createElement("div")).style.clear="both",H.classList.add("iframe-resizer-inner"),H.style.display="block",H.style.height="0",document.body.appendChild(H),et(),fn(),document.documentElement.style.height="",document.body.style.height="",ce('HTML & body height set to "auto"'),ce("Enable public methods"),we.parentIFrame={autoResize:function(K){return K===!0&&r===!1?(r=!0,Dn()):K===!1&&r===!0&&(r=!1,Ls("remove"),l!==null&&l.disconnect(),clearInterval(b)),Kt(0,0,"autoResize",JSON.stringify(r)),r},close:function(){Kt(0,0,"close")},getId:function(){return T},getPageInfo:function(K){typeof K=="function"?(Se=K,Kt(0,0,"pageInfo")):(Se=function(){},Kt(0,0,"pageInfoStop"))},moveToAnchor:function(K){k.findTarget(K)},reset:function(){vS("parentIFrame.reset")},scrollTo:function(K,J){Kt(J,K,"scrollTo")},scrollToOffset:function(K,J){Kt(J,K,"scrollToOffset")},sendMessage:function(K,J){Kt(0,0,"message",JSON.stringify(K),J)},setHeightCalculationMethod:function(K){y=K,et()},setWidthCalculationMethod:function(K){ne=K,fn()},setTargetOrigin:function(K){ce("Set targetOrigin: "+K),P=K},size:function(K,J){$t("size","parentIFrame.size("+((K||"")+(J?","+J:""))+")",K,J)}},C===!0&&(ve("mouseenter","Mouse Enter"),ve("mouseleave","Mouse Leave")),Dn(),k=(function(){function K(xt){var me=xt.getBoundingClientRect(),xt={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(me.left,10)+parseInt(xt.x,10),y:parseInt(me.top,10)+parseInt(xt.y,10)}}function J(qt){var me,xt=qt.split("#")[1]||qt,qt=decodeURIComponent(xt),SS=document.getElementById(qt)||document.getElementsByName(qt)[0];n!==SS?(me=K(me=SS),ce("Moving to in page link (#"+xt+") at x: "+me.x+" y: "+me.y),Kt(me.y,me.x,"scrollToOffset")):(ce("In page link (#"+xt+") not found in iFrame, so sending to parent"),Kt(0,0,"inPageLink","#"+xt))}function Ne(){var Wt=window.location.hash,me=window.location.href;Wt!==""&&Wt!=="#"&&J(me)}function Nt(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Wt){Wt.getAttribute("href")!=="#"&&Ht(Wt,"click",function(me){me.preventDefault(),J(this.getAttribute("href"))})})}function Ns(){Array.prototype.forEach&&document.querySelectorAll?(ce("Setting up location.hash handlers"),Nt(),Ht(window,"hashchange",Ne),setTimeout(Ne,m)):Ft("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return k.enable?Ns():ce("In page linking not enabled"),{findTarget:J}})(),$t("init","Init message from host page"),z()}function ks(O){var H=O.split("Callback");H.length===2&&(this[H="on"+H[0].charAt(0).toUpperCase()+H[0].slice(1)]=this[O],delete this[O],Ft("Deprecated: '"+O+"' has been renamed '"+H+"'. The old method will be removed in the next major version."))}function Gn(O,H){n!==H&&H!==""&&H!=="null"&&ce("Body "+O+' set to "'+(document.body.style[O]=H)+'"')}function st(O){var H={add:function(fe){function ve(){$t(O.eventName,O.eventType)}Q[fe]=ve,Ht(window,fe,ve,{passive:!0})},remove:function(fe){var ve,K=Q[fe];delete Q[fe],ve=window,fe=fe,K=K,ve.removeEventListener(fe,K,!1)}};O.eventNames&&Array.prototype.map?(O.eventName=O.eventNames[0],O.eventNames.map(H[O.method])):H[O.method](O.eventName),ce(_s(O.method)+" event listener: "+O.eventType)}function Ls(O){st({method:O,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),st({method:O,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),st({method:O,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),st({method:O,eventType:"Input",eventName:"input"}),st({method:O,eventType:"Mouse Up",eventName:"mouseup"}),st({method:O,eventType:"Mouse Down",eventName:"mousedown"}),st({method:O,eventType:"Orientation Change",eventName:"orientationchange"}),st({method:O,eventType:"Print",eventNames:["afterprint","beforeprint"]}),st({method:O,eventType:"Ready State Change",eventName:"readystatechange"}),st({method:O,eventType:"Touch Start",eventName:"touchstart"}),st({method:O,eventType:"Touch End",eventName:"touchend"}),st({method:O,eventType:"Touch Cancel",eventName:"touchcancel"}),st({method:O,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),st({method:O,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),st({method:O,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),M==="child"&&st({method:O,eventType:"IFrame Resized",eventName:"resize"})}function F(O,H,fe,ve){return H!==O&&(O in fe||(Ft(O+" is not a valid option for "+ve+"CalculationMethod."),O=H),ce(ve+' calculation method set to "'+O+'"')),O}function et(){y=F(y,h,Be,"height")}function fn(){ne=F(ne,ae,jn,"width")}function Dn(){var O;r===!0?(Ls("add"),O=S<0,window.MutationObserver||window.WebKitMutationObserver?O?be():l=(function(){function H(me){function xt(qt){qt.complete===!1&&(ce("Attach listeners to "+qt.src),qt.addEventListener("load",K,!1),qt.addEventListener("error",J,!1),Nt.push(qt))}me.type==="attributes"&&me.attributeName==="src"?xt(me.target):me.type==="childList"&&Array.prototype.forEach.call(me.target.querySelectorAll("img"),xt)}function fe(me){ce("Remove listeners from "+me.src),me.removeEventListener("load",K,!1),me.removeEventListener("error",J,!1),me=me,Nt.splice(Nt.indexOf(me),1)}function ve(me,xt,qt){fe(me.target),$t(xt,qt+": "+me.target.src)}function K(me){ve(me,"imageLoad","Image loaded")}function J(me){ve(me,"imageLoadFailed","Image load failed")}function Ne(me){$t("mutationObserver","mutationObserver: "+me[0].target+" "+me[0].type),me.forEach(H)}var Nt=[],Ns=window.MutationObserver||window.WebKitMutationObserver,Wt=(function(){var me=document.querySelector("body");return Wt=new Ns(Ne),ce("Create body MutationObserver"),Wt.observe(me,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),Wt})();return{disconnect:function(){"disconnect"in Wt&&(ce("Disconnect body MutationObserver"),Wt.disconnect(),Nt.forEach(fe))}}})():(ce("MutationObserver not supported in this browser!"),be())):ce("Auto Resize disabled")}function be(){S!==0&&(ce("setInterval: "+S+"ms"),b=setInterval(function(){$t("interval","setInterval: "+S)},Math.abs(S)))}function bt(O,H){var fe=0;return H=H||document.body,fe=(fe=document.defaultView.getComputedStyle(H,null))!==null?fe[O]:0,parseInt(fe,o)}function pn(O,H){for(var fe,ve=H.length,K=0,J=_s(O),Ne=Date.now(),Nt=0;Nt<ve;Nt++)K<(fe=H[Nt].getBoundingClientRect()[O]+bt("margin"+J,H[Nt]))&&(K=fe);return Ne=Date.now()-Ne,ce("Parsed "+ve+" HTML elements"),ce("Element position calculated in "+Ne+"ms"),G/2<(Ne=Ne)&&ce("Event throttle increased to "+(G=2*Ne)+"ms"),K}function tt(O){return[O.bodyOffset(),O.bodyScroll(),O.documentElementOffset(),O.documentElementScroll()]}function hn(O,H){var fe=document.querySelectorAll("["+H+"]");return fe.length===0&&(Ft("No tagged elements ("+H+") found on page"),document.querySelectorAll("body *")),pn(O,fe)}function yt(){return document.querySelectorAll("body *")}function Zl(O,H,fe,ve){function K(){O in{init:1,interval:1,size:1}||!(y in _||u&&ne in _)?O in{interval:1}||ce("No change in size detected"):vS(H)}var J,Ne;function Nt(Ns,Wt){return!(Math.abs(Ns-Wt)<=R)}J=n!==fe?fe:Be[y](),Ne=n!==ve?ve:jn[ne](),Nt(f,J)||u&&Nt(Le,Ne)||O==="init"?(gn(),Kt(f=J,Le=Ne,O)):K()}function sf(){Bt=Date.now(),ot=null,mn=In.apply(gt,Wr),ot||(gt=Wr=null)}function $t(O,H,fe,ve){Y&&O in d?ce("Trigger event cancelled: "+O):(O in{reset:1,resetPage:1,init:1}||ce("Trigger event: "+H),(O==="init"?Zl:As)(O,H,fe,ve))}function gn(){Y||(Y=!0,ce("Trigger event lock on")),clearTimeout(V),V=setTimeout(function(){Y=!1,ce("Trigger event lock off"),ce("--")},m)}function yS(O){f=Be[y](),Le=jn[ne](),Kt(f,Le,O)}function vS(O){var H=y;y=h,ce("Reset trigger event: "+O),gn(),yS("reset"),y=H}function Kt(O,H,fe,ve,K){var J;N===!0&&(n===K?K=P:ce("Message targetOrigin: "+K),ce("Sending message to host page ("+(J=T+":"+(O+":"+H)+":"+fe+(n!==ve?":"+ve:""))+")"),W.postMessage(g+J,K))}function ES(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),sq=[{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 aq(){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 lq(e){const t=document.querySelector("[em=blocks]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","block");t.removeAttribute("em"),Er();return}if(e){let n=!1;for(const r of sq)if(r.detect()){r.apply(),n=!0;break}n||aq()}bS(),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||Z.send({operation:"application_template_not_em_alert_show"}),Er()}function bS(){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(q,"CANVAS_CORE_UNITS",{enumerable:!0,get:function(){return NI}}),Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(q,"EMAIL_LAYOUT_UNITS",{enumerable:!0,get:function(){return BW}}),Object.defineProperty(q,"EVENT_TYPES",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(q,"FOCUS_ID",{enumerable:!0,get:function(){return at}}),Object.defineProperty(q,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return te}}),Object.defineProperty(q,"INIT_PREVIEW_ID",{enumerable:!0,get:function(){return Jo}}),Object.defineProperty(q,"INSERT_POLICY_ID",{enumerable:!0,get:function(){return cc}}),Object.defineProperty(q,"NARROW_TABLE_TEXT_ATOM_ID",{enumerable:!0,get:function(){return bf}}),Object.defineProperty(q,"Node",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(q,"NodeType",{enumerable:!0,get:function(){return $}}),Object.defineProperty(q,"SET_CURSOR_ID",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(q,"STYLE_ROOT_ID",{enumerable:!0,get:function(){return hf}}),Object.defineProperty(q,"SYNC_COMMIT_ID",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(q,"VML_WIDTH_RESOLVER_ID",{enumerable:!0,get:function(){return gf}}),Object.defineProperty(q,"WRAP_EDITOR_ID",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(q,"_defineProperty",{enumerable:!0,get:function(){return L}}),Object.defineProperty(q,"addFontFamilyClass",{enumerable:!0,get:function(){return Qi}}),Object.defineProperty(q,"ampUnit",{enumerable:!0,get:function(){return _T}}),Object.defineProperty(q,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return dl}}),Object.defineProperty(q,"applyRootScale",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(q,"buildEmFontClassName",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(q,"checkBlockAdaptivity",{enumerable:!0,get:function(){return ll}}),Object.defineProperty(q,"clearLinkTags",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(q,"clearProjectFontFaces",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(q,"commitOf",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(q,"commonStylesApply",{enumerable:!0,get:function(){return Gv}}),Object.defineProperty(q,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return nm}}),Object.defineProperty(q,"createFontClassName",{enumerable:!0,get:function(){return $d}}),Object.defineProperty(q,"createIdentifier",{enumerable:!0,get:function(){return de}}),Object.defineProperty(q,"defineSurface",{enumerable:!0,get:function(){return ew}}),Object.defineProperty(q,"defineUnit",{enumerable:!0,get:function(){return NS}}),Object.defineProperty(q,"deviceWidthMediaGuardUnit",{enumerable:!0,get:function(){return nq}}),Object.defineProperty(q,"diagnosticsAgentUnit",{enumerable:!0,get:function(){return JW}}),Object.defineProperty(q,"elMarkupHelper",{enumerable:!0,get:function(){return lq}}),Object.defineProperty(q,"extensionsUnit",{enumerable:!0,get:function(){return j4}}),Object.defineProperty(q,"findParentTr",{enumerable:!0,get:function(){return uh}}),Object.defineProperty(q,"fitEmailToWidth",{enumerable:!0,get:function(){return MT}}),Object.defineProperty(q,"fitImagesToColumns",{enumerable:!0,get:function(){return xm}}),Object.defineProperty(q,"getElementInnerHTML",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(q,"getOuterHtml",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(q,"getUsedColors",{enumerable:!0,get:function(){return e1}}),Object.defineProperty(q,"globalBlockReplace",{enumerable:!0,get:function(){return SW}}),Object.defineProperty(q,"iframeSetSize",{enumerable:!0,get:function(){return RT}}),Object.defineProperty(q,"implementPolyfills",{enumerable:!0,get:function(){return df}}),Object.defineProperty(q,"insertAdjacentHTML",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(q,"insertCountdown",{enumerable:!0,get:function(){return dv}}),Object.defineProperty(q,"isComment",{enumerable:!0,get:function(){return Us}}),Object.defineProperty(q,"isEmptyTable",{enumerable:!0,get:function(){return un}}),Object.defineProperty(q,"isTextNode",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(q,"markAtomsAndClearRootHeight",{enumerable:!0,get:function(){return bS}}),Object.defineProperty(q,"markProjectFontClass",{enumerable:!0,get:function(){return qd}}),Object.defineProperty(q,"messageService",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(q,"minifyStylesheet",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(q,"paintGateUnit",{enumerable:!0,get:function(){return eq}}),Object.defineProperty(q,"parseFromString",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(q,"removeClassesByPrefix",{enumerable:!0,get:function(){return zd}}),Object.defineProperty(q,"removeHiddenClasses",{enumerable:!0,get:function(){return ja}}),Object.defineProperty(q,"requireService",{enumerable:!0,get:function(){return D}}),Object.defineProperty(q,"require_iframeResizer_contentWindow_min",{enumerable:!0,get:function(){return iq}}),Object.defineProperty(q,"rgbToHex",{enumerable:!0,get:function(){return X}}),Object.defineProperty(q,"rowsHost",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(q,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return yl}}),Object.defineProperty(q,"setBlockMaxWidth",{enumerable:!0,get:function(){return Mm}}),Object.defineProperty(q,"setDocumentStyles",{enumerable:!0,get:function(){return Fd}}),Object.defineProperty(q,"setElementBorder",{enumerable:!0,get:function(){return Vd}}),Object.defineProperty(q,"setElementBorderRadius",{enumerable:!0,get:function(){return Xi}}),Object.defineProperty(q,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return $P}}),Object.defineProperty(q,"setFloatBlocksWidth",{enumerable:!0,get:function(){return Nm}}),Object.defineProperty(q,"setImageWidth",{enumerable:!0,get:function(){return xd}}),Object.defineProperty(q,"setStructureBlocksWidth",{enumerable:!0,get:function(){return Nl}}),Object.defineProperty(q,"startSandbox",{enumerable:!0,get:function(){return tw}}),Object.defineProperty(q,"state",{enumerable:!0,get:function(){return x}}),Object.defineProperty(q,"stripSubjectTags",{enumerable:!0,get:function(){return Pw}}),Object.defineProperty(q,"uptimeCountdown",{enumerable:!0,get:function(){return Md}}),Object.defineProperty(q,"wheelBridgeUnit",{enumerable:!0,get:function(){return tq}})});