useblocks 1.1.85-dev.6 → 1.1.85-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/js/{discussHandlers.Ced_gtP0.js → discussHandlers.C5qc-xPl.js} +2 -2
- package/iframe/js/iframe-eblock.body.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.body.js +2 -2
- package/iframe/js/iframe.js +1 -1
- package/node_modules/useblocks-ui-kit/package.json +1 -1
- package/package.json +2 -2
- package/runtime/react/index.js +1 -1
- package/static/core/{6741eb70.js → 53bcd609.js} +2 -2
- package/static/core/{d0eece8b.js → 77d63e01.js} +1 -1
- package/static/core/{3a252a3c.js → 78b1e678.js} +1 -1
- package/static/core/{9600caf9.js → b49f995f.js} +3 -3
- package/static/core/{b6c5e3be.js → ea93d0cd.js} +2 -2
- package/static/umd-runtime/runtime.js +1 -1
- package/{useblocks-core.d62ebebc.js → useblocks-core.46f9d75a.js} +31 -31
- package/useblocks-esm.js +10 -10
- package/{useblocks-po.d62ebebc.js → useblocks-po.46f9d75a.js} +1 -1
- package/useblocks.d.ts +26 -6
- package/useblocks.js +11 -11
- /package/iframe/{iframe-eblock.d62ebebc.html → iframe-eblock.46f9d75a.html} +0 -0
- /package/iframe/{iframe.d62ebebc.html → iframe.46f9d75a.html} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__useblocks__.define("js/discussHandlers.Ced_gtP0.js",["require","exports","module","js/rolldown-runtime.BRlIiq3h.js"],function(Eo,_,IN){const F=Eo("./rolldown-runtime.BRlIiq3h.js");function Dr(e){"@babel/helpers - typeof";return Dr=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},Dr(e)}function Gm(e,t){if(Dr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Dr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xm(e){var t=Gm(e,"string");return Dr(t)=="symbol"?t:t+""}function k(e,t,r){return(t=Xm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ml;ml=Symbol.toStringTag;var _o=class{constructor(){k(this,"_valuesMap",new Map),k(this,ml,"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 pl(){const e=new _o;return new Proxy(e,{set:function(t,r,n){return typeof r=="string"&&_o.prototype.hasOwnProperty(r)?e[r]=n:typeof r=="string"&&e.setItem(r,String(n)),!0},get:function(t,r){if(typeof r=="string"){if(_o.prototype.hasOwnProperty(r)){const n=e[r];if(typeof n=="function"){const i=n;return(...o)=>i.apply(e,o)}return n}return e.getItem(r)}}})}function gl(){const e=pl(),t=pl();Object.defineProperty(window,"localStorage",{configurable:!0,enumerable:!0,get:()=>e}),Object.defineProperty(window,"sessionStorage",{configurable:!0,enumerable:!0,get:()=>t});let r=Object.create(null);Object.defineProperty(document,"cookie",{enumerable:!1,configurable:!0,get(){const n=[];for(var i in r)n.push(i+"="+r[i]);return n.join(";")},set(n){const i=n.indexOf("=");var o=n.substr(0,i),s=n.substring(i+1);return r[o]=s,o+"="+s}}),Object.defineProperty(document,"clearCookies",{enumerable:!1,configurable:!0,value:()=>r=Object.create(null)})}gl();function So(e,t){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object")return!1;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){const o=e,s=t;return o.length===s.length&&o.every((a,l)=>So(a,s[l]))}const n=Object.keys(e),i=Object.keys(t);return n.length!==i.length?!1:n.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&So(e[o],t[o]))}function bl(e,t){const r={watch(n){let i,o=!1;return e.watch(s=>{const a=t(s);o&&So(i,a)||(i=a,o=!0,n(a))})},select(n){return bl(r,n)}};return r}function Ym(...e){let t=e[0],r=e.length>0;const n=new Set,i={get(){return r?t:void 0},set(o){t=o,r=!0;for(const s of Array.from(n))s(o)},watch(o){return n.add(o),r&&o(t),{dispose:()=>n.delete(o)}},select(o){return bl(i,o)}};return i}var Z=class zm{constructor(t=[]){k(this,"_inner",void 0),k(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof zm&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(t){this.addDisposable({dispose:t})}removeDisposable(t){const r=this._inner.indexOf(t);r>=0&&this._inner.splice(r,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const t of[...this._inner])t.dispose()}}};function wo(e){return`service_container_${e}`}var Ir=new Set,Co;function Km(){if(!Co)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,yl.prototype.getInstanceAsync),e.stack}function Ao(e){Ir.delete(e)&&Co?.end(e)}var yl=class hl extends Z{_runCallbacks(t){this._injectCallbacks.forEach(r=>r(t))}constructor(t=null){super(),k(this,"_parent",void 0),k(this,"_injectCallbacks",[]),k(this,"_injections",Object.create(null)),k(this,"onInject",r=>(this._injectCallbacks.push(r),{dispose:()=>{const n=this._injectCallbacks.indexOf(r);n>=0&&this._injectCallbacks.splice(n,1)}})),this._parent=t,t&&this.addDisposable(t.onInject(r=>this._runCallbacks(r)))}inject(t,r){this._injections[t]=()=>r,this._runCallbacks(t)}injectFactory(t,r,n){const i=this._injections[t];let o=typeof i=="function"?i():i;const s=this._injections[t]=()=>(o=r(this,o),o);n&&s(),this._runCallbacks(t)}_find(t,r=!0){return this._injections[t]||r&&this._parent?._find(t)}_onInject(t,r,n=new Z){return n.addDisposable(this.onInject(i=>{t===i&&(n.dispose(),r(this.getInstance(i)))})),this._parent&&n.addDisposable(this._parent._onInject(t,r,n)),this.addDisposable(n),n}getInstance(t,r=!0){const n=this._find(t,r);if(typeof n=="function")return n()}getOrCreateInstance(t,r){const n=this._find(t);if(typeof n=="function")return n();const i=r(this);return this.inject(t,i),i}getInstanceAsync(t){const r=this._find(t);if(typeof r=="function")return Promise.resolve(r());const n=Km();return new Promise((i,o)=>{const s={id:String(t),startedAt:Date.now(),origin:n,container:this,reject:o};Ir.add(s),Co?.start(s),this._onInject(t,()=>{Ao(s),i(this.getInstance(t))})})}failPendingWaits(t){for(const r of Array.from(Ir))r.container===this&&(Ao(r),r.reject(t))}pendingWaits(){return[...Ir].filter(t=>t.container===this)}addService(t,r){const n=wo(t);this.injectFactory(n,(o,s=[])=>s.indexOf(r)<0?[...s,r]:s);const i=new Z;return i.addDispose(()=>{this.injectFactory(n,(o,s=[])=>s.filter(a=>a!==r))}),i}addServiceFactory(t,r,n){const i=wo(t);let o;this.injectFactory(i,(a,l=[])=>(o=r(a,o),o===void 0?l:l.indexOf(o)<0?[...l,o]:l),n);const s=new Z;return s.addDispose(()=>{this.injectFactory(i,(a,l=[])=>o===void 0?l:l.filter(c=>c!==o))}),s}getServices(t){const r=wo(t);return[...this.getInstance(r,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new hl(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const r=this._parent?.getOrCreateIsolatedContainer(t);return new hl(r)})}remove(t){const r=this._injections;delete r[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(Ir))t.container===this&&Ao(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function To(e){return e.startsWith("__")?e:`__${e}__`}function Qm(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=To(e),r=globalThis;return r[t]??(r[t]={})}function Zm(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function Jm(e){if(e)return To(e);const t="useblocks".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return To(t)}function ko(e){const t=Jm(e),r=Qm(t);if(Zm(r.container))return r.container;const n=new yl(null);return r.container=n,n}function ep(){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(r){let n=Math.random()*16;return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),(r==="x"?n:n&3|8).toString(16)})}function tp(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():ep()}function ge(e=tp()){return e}function vl(){return"iframe".trim()||"unknown"}function rp(e){if(typeof globalThis>"u")return;const t=vl(),r=globalThis[e]??{};globalThis[e]=r;const n=r.__diagnostics??(r.__diagnostics={}),i=n.diModuleEval??(n.diModuleEval={evalCount:0,records:[]});i.records.push({buildSource:t,timestamp:Date.now(),stack:new Error().stack}),i.evalCount+=1}function np(){const e="useblocks".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function ip(e,t){if(rp(t),typeof globalThis>"u")return e;const r=vl(),n=globalThis,i=n[t]=n[t]||{},o=i.__diagnostics=i.__diagnostics||{},s=o.dependencyResolver=o.dependencyResolver||{entries:[]},a={container:e,source:"packages/runtime-core/di/index.ts",buildSource:r,timestamp:Date.now(),stack:new Error().stack};return s.entries.push(a),e}var Bn;function op(){if(Bn)return Bn;const e=np();return Bn=ip(ko(e),e),Bn}var BN=new Proxy({},{get(e,t,r){const n=op(),i=Reflect.get(n,t,r);return typeof i=="function"?i.bind(n):i}}),sp=new Function("url","return import(url)");function ap(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function lp(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function cp(e){return e.type==="umd"||e.resolve==="registry"}function FN(e){return e}var up=class{constructor(e,t,r={}){k(this,"_context",void 0),k(this,"_pluginRegistry",void 0),k(this,"_options",void 0),k(this,"_map",new Map),k(this,"_optionsMap",new Map),k(this,"_readyMap",new Map),k(this,"_resolveMap",new Map),k(this,"_initializingPlugins",new Map),k(this,"_creatingPlugins",new Set),k(this,"_initializedPlugins",new Set),k(this,"_creationOrder",[]),k(this,"_lifecycleListeners",new Set),k(this,"_activated",!1),this._context=e,this._pluginRegistry=t,this._options=r}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,r]=e;if(typeof t=="function")return{ctor:t,options:r};const n=await this._pluginRegistry.getAsync(t);if(!n)throw new Error(`Plugin "${String(t)}" not registered.`);return{ctor:n,options:r}}if(lp(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(cp(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const r=await sp(e.url);if(t==="module")return{ctor:r.default??r};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 ESM load`);return{ctor:n}}}if(e.type==="umd"){if(await this._loadScript(e.url),t==="window"&&e.name){const r=globalThis[e.name];if(!r)throw new Error(`Plugin "${e.name}" not found on window after script load`);return{ctor:r}}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 script load`);return{ctor:r}}}throw new Error(`Cannot resolve descriptor: type=${e.type}, resolve=${t}, name=${e.name??"none"}`)}_loadScript(e){return new Promise((t,r)=>{if(typeof document>"u"){r(new Error("Cannot load UMD script in non-browser environment"));return}const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load script: ${e}`)),document.head.appendChild(n)})}initSync(e){const t=[];for(const r of e){const n=this._getOrCreate(r,void 0);t.push(n)}this._activated=!0,this._startPluginsBatch(t)}async init(e){const t=[],r=new Set;for(const n of e){const{ctor:i,options:o}=await this._resolveEntry(n),s=this._getOrCreate(i,o);r.has(s)||(r.add(s),t.push(s))}this._activated=!0,await this._startPluginsBatch(t)}async setPlugins(e){const t=new Set,r=[];for(const s of e){const a=await this._resolveEntry(s);t.add(a.ctor),r.push(a)}const n=[];this._map.forEach((s,a)=>{t.has(a)||n.push({key:a,plugin:s})});for(let s=n.length-1;s>=0;s--){const{key:a,plugin:l}=n[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 i=[],o=new Set;for(const{ctor:s,options:a}of r){const l=this._getOrCreate(s,a);o.has(l)||(o.add(l),i.push(l))}this._activated&&await this._startPluginsBatch(i)}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:r}=t??{};return await new Promise((n,i)=>{let o,s=!1;const a=()=>{s||(s=!0,o&&clearTimeout(o),this._pluginRegistry.off(e,a),n())};this._pluginRegistry.on(e,a),r!==void 0&&r>0&&(o=setTimeout(()=>{s||(s=!0,this._pluginRegistry.off(e,a),i(new Error(`waitFor("${String(e)}") timed out after ${r}ms`)))},r))}),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 r=this._getOrCreate(t);return this._activated&&this._startPluginsBatch([r]),r}async useByKeyAsync(e){const t=await this._pluginRegistry.getAsync(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered.`);const r=this._getOrCreate(t);return this._activated&&await this._startPluginsBatch([r]),r}useByCtor(e,t){const r=this._getOrCreate(e,t);return this._activated&&this._startPluginsBatch([r]),r}use(e){return typeof e=="function"?this.useByCtor(e):this.useByKey(e)}async useAsync(e){const{ctor:t,options:r}=await this._resolveEntry(e),n=this._getOrCreate(t,r);return this._activated&&await this._startPluginsBatch([n]),n}_getOrCreate(e,t){const r=e;if(!this._map.has(r)){t!==void 0&&this._optionsMap.set(r,t);const n=this._optionsMap.get(r),i=this._createPluginInstance(e,n),o=i.constructor.name;this._emitLifecycle({type:"created",plugin:i,name:o}),i.required?.(),this._map.set(r,i),this._creationOrder.push(i),this._setupReadyPromise(i)}return this._map.get(r)}_createPluginInstance(e,t){const r=e;if(this._creatingPlugins.has(r))throw new Error(`Cyclic dependency for plugin ${e.name}`);this._creatingPlugins.add(r);try{return ap(e)?new e(this._context,t):e(this._context,t)||{}}finally{this._creatingPlugins.delete(r)}}_setupReadyPromise(e){const t=new Promise(r=>{this._resolveMap.set(e,r)});this._readyMap.set(e,t)}async _startPluginsBatch(e){const t=Array.from(new Set(e)),r=new Set,n=[];for(const i of t){if(this._initializedPlugins.has(i))continue;const o=this._initializingPlugins.get(i);if(o){r.add(o);continue}n.push(i)}if(n.length>0){const i=this._runBatchLifecycle(n);for(const o of n)this._initializingPlugins.set(o,i);r.add(i),i.finally(()=>{for(const o of n)this._initializingPlugins.get(o)===i&&this._initializingPlugins.delete(o)})}await Promise.all(r)}async _runBatchLifecycle(e){const t=[];for(const r of e){const n=r.constructor.name;this._emitLifecycle({type:"init:start",plugin:r,name:n});try{await r.init?.(),this._emitLifecycle({type:"init:success",plugin:r,name:n}),t.push(r)}catch(i){this._emitLifecycle({type:"init:error",plugin:r,name:n,error:i})}}for(const r of t){const n=r.constructor.name;this._emitLifecycle({type:"afterInit:start",plugin:r,name:n});try{await r.afterInit?.(),this._emitLifecycle({type:"afterInit:success",plugin:r,name:n})}catch(i){this._emitLifecycle({type:"afterInit:error",plugin:r,name:n,error:i})}}for(const r of e)this._initializedPlugins.add(r),this._resolveMap.get(r)?.(),this._resolveMap.delete(r)}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(r){this._emitLifecycle({type:"dispose:error",plugin:e,name:t,error:r})}}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)}))}},El=class{constructor(){k(this,"_plugins",new Map),k(this,"_listeners",new Map)}_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){const r=this._plugins.get(e);if(r?.overrides)for(const n of r.overrides)t=n(t)||t;return t}_notifyListeners(e,t){const r=this._listeners.get(e);if(!r||r.length===0)return;for(const i of r)try{i.callback(t)}catch{}const n=r.filter(i=>!i.once);n.length>0?this._listeners.set(e,n):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 r=await t.loading;return this._applyOverrides(e,r)}if(t?.factory){const r=Promise.resolve(t.factory()).then(i=>(t.ctor=i,t.loading=void 0,this._notifyListeners(e,i),i));t.loading=r;const n=await r;return this._applyOverrides(e,n)}return new Promise(r=>{this.on(e,n=>r(this._applyOverrides(e,n)))})}add(e,t){const r=this._getOrCreateEntry(e);r.ctor=t,this._notifyListeners(e,t)}addAll(e){for(const t of Object.keys(e)){const r=e[t];r!==void 0&&this.add(t,r)}}addAsync(e,t){const r=this._getOrCreateEntry(e);return r.factory=t,{dispose:()=>{r.ctor||(r.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 r=this._getOrCreateEntry(e);return r.overrides.push(t),{dispose:()=>{const n=r.overrides.indexOf(t);n>=0&&r.overrides.splice(n,1)}}}on(e,t){const r=this.get(e);r&&t(r);let n=this._listeners.get(e);n||(n=[],this._listeners.set(e,n));const i={callback:t,once:!1};return n.push(i),{dispose:()=>this._removeListener(e,t)}}once(e,t){const r=this.get(e);if(r)return t(r),{dispose:()=>{}};let n=this._listeners.get(e);n||(n=[],this._listeners.set(e,n));const i={callback:t,once:!0};return n.push(i),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){const r=this._listeners.get(e);if(r){const n=r.findIndex(i=>i.callback===t);n>=0&&r.splice(n,1),r.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){const e=this;return{add(t,r){e.add(t,r)}}}},dp=class{constructor(e){k(this,"resolveRegistry",void 0),this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},_l=class extends Z{constructor(e={}){super(),k(this,"_options",void 0),k(this,"_listeners",[]),k(this,"on",this._addListener.bind(this)),k(this,"event",this._addListener.bind(this)),k(this,"once",(t,r=0,n)=>{const i=this._addListener((...o)=>(i?.dispose(),n?t.call(n,...o):t(...o)),r);return i}),k(this,"un",t=>{const r=this._listeners.findIndex(([n])=>n===t);r>=0&&(this._listeners.splice(r,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,r){if(this.isDisposed())return{dispose:()=>{}};const n=this._listeners,i=this._options;r&&typeof e=="function"&&(e=e.bind(r));const o=n.findIndex(([,a])=>a<t),s=[e,t];return n.splice(o>=0?o:n.length,0,s),n.length===1&&i.onFirstListenerAdd&&i.onFirstListenerAdd(),{dispose:()=>{const a=n.indexOf(s);a>=0&&(n.splice(a,1),!n.length&&i.onLastListenerRemove&&i.onLastListenerRemove())}}}dispose(){this._listeners.splice(0,this._listeners.length),this._options.onLastListenerRemove&&this._options.onLastListenerRemove(),super.dispose()}},fp=class extends _l{execute(e,t){for(const r of t)try{r(...e)}catch{}}fire(...e){if(!this.isDisposed()){const t=this.execute(e,this.getListeners(e));return t===void 0?void 0:t}}},ee=class extends fp{execute([e],t){for(const r of t)try{r(e)}catch{}}},hp=class extends _l{fire(e){if(this.isDisposed())return;let t=!1,r=!1;const n={value:e,preventDefault(){t=!0},stopPropagation(){r=!0}},i=this.getListeners([n]);for(const o of i){if(r)break;try{o(n)}catch{}}return t?!1:void 0}};function mp(e,t,r){let n;const i=new ee({onFirstListenerAdd(){n=i.addDisposable(new Z),n.addDisposable(e(o=>{t(o)!==!1&&i.fire(o)}))},onLastListenerRemove(){n?.dispose(),n=void 0}});return r?.addDisposable(i),i.event}var Fn={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},Br=Ym({...Fn});function Re(){return Br.get()}var jn=new ee,qt=new Map,_e={source:Br,get(e){return Re()[e]},getState(){return{...Re()}},getStateRef(){return Re()},set(e,t){if(Re()[e]===t)return;Br.set({...Re(),[e]:t}),jn.fire({[e]:t});const r=qt.get(e);r&&r.forEach(n=>n(t))},update(e){let t=!1;const r={};for(const n of Object.keys(e)){const i=e[n];if(Re()[n]!==i){Br.set({...Re(),[n]:i}),r[n]=i,t=!0;const o=qt.get(n);o&&o.forEach(s=>s(i))}}t&&jn.fire(r)},increment(e,t=1){const r=Re()[e];typeof r=="number"&&_e.set(e,r+t)},decrement(e,t=1){const r=Re()[e];typeof r=="number"&&_e.set(e,r-t)},subscribe(e){return jn.event(e)},subscribeToKey(e,t){qt.has(e)||qt.set(e,new Set);const r=qt.get(e),n=t;return r.add(n),()=>{r.delete(n),r.size===0&&qt.delete(e)}},reset(){Br.set({...Fn}),jn.fire(Re())},resetKey(e){this.set(e,Fn[e])},isEditingLocked(){const e=Re();return e.lockEdit||e.lockEditor||e.lockEditorInit},isActiveElementLocked(){return Re().activeElementLocked>0},getInitialState(){return Fn}},$n=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function Sl(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function At(e,t){return Array.from(e.classList).find(r=>r.includes(t))}function wl(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?wl(t):!1)}function z(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 r=typeof e.targetElement=="string"?document.querySelector(e.targetElement):e.targetElement;if(r)switch(e.insertType){case"append":r.append(t);break;case"prepend":r.prepend(t);break;case"before":r.before(t);break;case"after":r.after(t);break;case"replaceWith":r.replaceWith(t)}}return t}function pp(e){try{return JSON.parse(e),!0}catch{return!1}}function gp(e,t,r=2){const n=e.split(""),i=t.split("");if(Math.abs(n.length-i.length)>r)return!1;let o=0;if(n.length===i.length){for(let s=0;s<n.length;s++)if(n[s]!==i[s]&&(o++,o>r))return!1}else{const s=n.length>i.length?n:i,a=n.length>i.length?i:n;let l=0,c=0;for(;l<s.length&&c<a.length;)if(s[l]!==a[c]){if(o++,o>r)return!1;l++}else l++,c++;if(l<s.length&&o++,o>1)return!1}return!0}function bp(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function yp(e,t){let r=e;for(;r&&r!==document.body;){const n=r.style?.[t];if(n&&typeof n=="string")return n;if(r.tagName==="EDITOR")return null;r=r.parentElement}return null}function vp(e){const t=e.style?.fontWeight;if(typeof t=="number")return t>=600;if(typeof t=="string"){const r=t.toLowerCase();return r.includes("bold")||r.includes("black")||parseInt(r)>=600}return!1}function Cl(){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 Ep(e,t=null){const r=e?.innerText;for(;e!==null;){if(e.innerText===r){const n=e.parentElement;if(n===null||n.innerText!==r||n.tagName==="EDITOR"||e.tagName===t?.toUpperCase())return e.tagName===t?.toUpperCase()||!t?e:null}e=e.parentElement}return null}function Al(e,t=Cl()){e=$n(e)??"";const r=o=>$n(o?.textContent||"")??"",n=Array.from(t?.childNodes||[]).filter(o=>!!o&&o.nodeName!=="BR");let i=null;if(t&&t.nodeType===Node.TEXT_NODE&&r(t).includes(e)&&r(t)===e)return t;for(let o=0;o<n.length;o++){const s=n[o];if(s.nodeType===Node.TEXT_NODE&&r(s).includes(e)&&r(s)===e){i=s.parentNode;break}else if(s.nodeType===Node.ELEMENT_NODE&&(i=Al(e,s),i))break}return i}function Tl(e){const t=Array.from(e),r=t.map(o=>o.clientWidth),n=r.reduce((o,s)=>o+s,0),i=r.map(o=>((o||0)/n*100).toFixed(1));t.forEach((o,s)=>{o.setAttribute("data-percent",i[s])})}function Fr(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&&Fr({elem:e.elem.previousSibling,width:e.width})}function _p(e){let t="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i=0;for(;i<e;)t+=r.charAt(Math.floor(Math.random()*62)),i+=1;return t}var Hn=null,Lo=null,Sp=null,wp=null,jr=0;function Cp(e){Hn=e.htmlDocument,Lo=e.remoteDocument,Sp=e.textDocument,wp=e.documentMapping}function Oo(){if(!Hn)throw new Error("Documents not initialized. Call initDocuments first.");return Hn}function kl(){if(!Lo)throw new Error("Documents not initialized. Call initDocuments first.");return Lo}function Ap(e){Oo().commit(e)}async function Tp(e){const t=Oo();try{jr++,await t.commit(e,!0)}finally{jr--}}function kp(){return jr>0}function Lp(){jr++}function Op(){jr--}function xo(){return Hn!==null}var zn=null,Gt=void 0,Po=null;function xp(e){Po=e}function Pp(e){zn=e}function Np(e){if(Po){Po.setEditorFocus(e);return}if(zn&&zn.isEditorInFocus!==e){const t=e;e&&typeof Gt=="boolean"&&(xo()&&kl().saveChanges(Gt),Gt=void 0),zn.setFocus(t),!e&&typeof Gt=="boolean"&&(xo()&&kl().saveChanges(Gt),Gt=void 0)}}function Mp(e,t=window){return{peer:e,send(r){e.postMessage(r,"*")},subscribe(r){const n=i=>{r({data:i.data,source:i.source,ports:i.ports})};return t.addEventListener("message",n),{dispose:()=>t.removeEventListener("message",n)}},close(){}}}function Rp(e){let t=!1;return{peer:e,send(r){e.postMessage(r)},subscribe(r){const n=i=>{r({data:i.data,source:e})};return e.addEventListener("message",n),t||(t=!0,e.start()),{dispose:()=>e.removeEventListener("message",n)}},close(){e.close()}}}function jN(e){return e}function Dp(e){return e&&typeof e=="object"}function Ll(e,t){return e&&typeof e=="object"&&e.operationId===t}var Xe="INIT_MESSAGE",Ip="em:port-ready",Bp="em:window-drained",No="";function Ol(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var Fp=class extends Z{constructor(...e){super(...e),k(this,"_listeners",Object.create(null)),k(this,"addListenerAsync",(t,r,n=0,i)=>{const o=this._listeners[t]||(this._listeners[t]=[]);i&&typeof r=="function"&&(r=r.bind(i));const s=o.findIndex(([l,c])=>n<=c),a=[r,n];return this.isDisposed()||o.splice(s>=0?s:o.length,0,a),{dispose(){const l=o.indexOf(a);l>=0&&o.splice(l,1)}}}),k(this,"fireAsync",(t,r)=>{if(!this.isDisposed()){const n=this._listeners[t]||(this._listeners[t]=[]);let i;for(let o=0;o<n.length;o++){const s=n[o][0],a=i;i=l=>s(l,a)}if(i)return i(r)}}),k(this,"addListener",(t,r,n=0)=>this.addListenerAsync(t,(i,o)=>{try{r(i)}catch{}return o&&o(i)},n))}},jp=class extends Z{constructor(e,t){super(),k(this,"_singleton",void 0),k(this,"_target",void 0),k(this,"_transport",void 0),k(this,"_transportSubscription",void 0),k(this,"_ports",new Map),k(this,"_drained",new WeakSet),k(this,"_inited",!1),k(this,"_emitter",this.addDisposable(new Fp)),k(this,"_handshaken",new WeakSet),k(this,"_greeted",new WeakSet),k(this,"_outgoingFilter",void 0),k(this,"_onTransportMessage",r=>{const n=r,i=n.data,o=n.source,s=i?.port===!0?n.ports?.[0]:void 0,a=!this._isPortSource(n.source);if(a&&o&&i?.operationId==="em:window-drained"){this._drained.add(o);return}if(!(a&&o&&this._drained.has(o))){if(o&&o!==this._target&&this._greeted.has(o)&&Ll(i,Xe)){this._greeted.delete(o),this._handshaken.add(o),this._postMessage(o,{operationId:Xe,data:{}}),s&&this.usePort(s,!0,o);return}if(Dp(i)&&(n.source===this.target||this._isCurrentPort(n.source))||this._singleton&&Ll(i,Xe)){if(s){const d=this._target;Promise.resolve().then(()=>this.usePort(s,!0,d))}const l=this._emitter.fireAsync(i.operationId||No,i.operationId===void 0?n:i.data),c=i.result,u=i.error;c&&u&&Promise.resolve(l).then(d=>this._sendMessage(c,d),d=>this._sendMessage(u,d))}}}),this._singleton=t,this._transport=Mp({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(Xe,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(Xe))}),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(Xe,void 0);return}this._inited=!1,this._postMessage(e,{operationId:Xe,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:Xe,data:{},port:!0},[t])}setOutgoingFilter(e){return this._outgoingFilter=e,()=>{this._outgoingFilter===e&&(this._outgoingFilter=void 0)}}greet(e){this._handshaken.has(e)||this._greeted.has(e)||this._target===e||(this._greeted.add(e),this._postMessage(e,{operationId:Xe,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,r=this._target){if(!r||this._ports.has(r))return;const n=Rp(e),i=n.subscribe(this._onTransportMessage);this._ports.set(r,{transport:n,subscription:i}),t&&(n.send({operationId:Ip,data:{}}),this.drainWindow(r))}useWindow(e=this._target){e&&(this._closePort(e),this._drained.delete(e))}get usesPort(){return this._target!==void 0&&this._ports.has(this._target)}hasPort(e){return this._ports.has(e)}_closePort(e){const t=this._ports.get(e);t&&(t.subscription.dispose(),t.transport.close(),this._ports.delete(e))}drainWindow(e){this._ports.has(e)&&e.postMessage({operationId:Bp,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,r){let n=t;this._outgoingFilter&&!r?.length&&(n="data"in t?{...t,data:this._outgoingFilter(t.data)}:this._outgoingFilter(t));try{const i=this._ports.get(e);if(i){i.transport.send(n);return}if(r?.length){e.postMessage(n,"*",r);return}e.postMessage(n,"*")}catch(i){if(i?.name==="DataCloneError"){const o=typeof n?.data=="object"&&n?.data!==null?n.data:void 0}throw i}}_sendMessage(e,t,r=!0){if(!r&&!this.isInited())return;const n=this.addDisposable(this.onInit(i=>{const o=e?{operationId:e,data:t}:t;try{this._postMessage(i,{...o})}finally{n.dispose()}}))}send(e,t,r){return typeof e=="string"?this._sendMessage(e,t,r):this._sendMessage(No,e,t)}sendAsync(e,t,r=!0){if(!r&&!this.isInited())return Promise.resolve();const n=Ol(),i=Ol();return new Promise((o,s)=>{const a=this.addDisposable(new Z);a.addDisposable(this.onInit(l=>{try{this._postMessage(l,{operationId:e,data:t,result:n,error:i})}catch(c){a.dispose(),s(c);return}a.addDisposable(this._onMessage(n,c=>{o(c),a.dispose()})),a.addDisposable(this._onMessage(i,c=>{s(c),a.dispose()}))}))})}_onMessage(e,t,r=0){return this._emitter.addListener(e,t,r)}addListener(e,t,r){return t?this._onMessage(e,t,r):this._onMessage(No,e)}addListenerAsyncPipe(e,t,r=0){return this._emitter.addListenerAsync(e,t,r)}addListenerAsync(e,t,r=0){return this._emitter.addListenerAsync(e,async(n,i)=>{const o=await t(n);return i?i(n):o},r)}isInited(){return this._inited}get inited(){return this._inited}onInit(e,t=!0,r=0){const n=this.addDisposable(new Z);return this._inited&&this._target?t&&Promise.resolve().then(()=>{!this._inited||!this._target?n.addDisposable(this.onInit(e,t,r)):e(this._target)}):n.addDisposable(this._onMessage(Xe,()=>{e(this._target)},r)),n}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}},$p=/<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s[^<>]*)?\/?>/g;function Hp(e){return e.replace($p,t=>/^<br\b/i.test(t)?" ":"")}var zp="fonts.googleapis.com",Vp=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},Wp=e=>{const t=Vp(String(e??""));return t?t.hostname===zp&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},me={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_PREVIEW:"update_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_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_WINDOW_CHARACTERISTIC:"sandbox_window-characteristic",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_ADD_MERGETAG:"sandbox_add_mergetag",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"},Up=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")}),X=new jp(window.parent,!0);function xl(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function be(e,t,r=!1){for(const n of e.querySelectorAll(t))r||!n.childNodes.length?n.remove():n.replaceWith(...n.childNodes)}var Vn="em-element-list-ol",Wn="em-element-list-ul",qp="em-element-list-bullet",Gp=`.${Vn}, .${Wn}`,Xp=["DIV","P","TD","H1","H2","H3","H4","H5","H6"],Yp="div, p, td, h1, h2, h3, h4, h5, h6",Kp={LIST:"margin: 0; padding: 0 0 0 20px;",LIST_ITEM:"padding-bottom: 5px;"};function Qp(e,t,r){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(i=>{const o=i.querySelectorAll("td");if(o.length>1){const s=o[1],a=(s.getAttribute("style")||"").split(";").filter(u=>u.trim()!==""),l={};a.forEach(u=>{const[d,f]=u.split(":").map(h=>h.trim());l[d]=f}),l[t]=`${r}px`;const c=Object.entries(l).map(([u,d])=>`${u}: ${d}`).join("; ");s.setAttribute("style",c)}}),n.innerHTML}function Zp(e,t){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelector("td:first-child");if(i){const o=i.querySelector("div");o&&(o.innerHTML=t)}}),r.innerHTML}function Jp(e,t){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelector("td:first-child");if(i){const o=i.querySelector("div");if(o){const s=o.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);o.setAttribute("style",l.join("; "))}else o.setAttribute("style",s?`${s} color: ${t};`:`color: ${t};`)}}}),r.innerHTML}function eg(e,t){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelector("td:first-child");if(i){const o=i.querySelector("div");if(o){const s=o.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);o.setAttribute("style",l.join("; "))}else o.setAttribute("style",s?`${s} font-size: ${t}px;`:`font-size: ${t}px;`)}}}),r.innerHTML}function tg(e,t){if(typeof t!="boolean")throw new Error("Invalid isBold value: must be a boolean");const r=t?"bold":"normal",n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(i=>{const o=i.querySelector("td:first-child");if(o){const s=o.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: ${r};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-weight: ${r};`:`font-weight: ${r};`)}}}),n.innerHTML}function rg(e,t){if(typeof t!="boolean")throw new Error("Invalid isItalic value: must be a boolean");const r=t?"italic":"normal",n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(i=>{const o=i.querySelector("td:first-child");if(o){const s=o.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: ${r};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-style: ${r};`:`font-style: ${r};`)}}}),n.innerHTML}function ng(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldUnderline value: must be a boolean");const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelector("td:first-child");if(i){const o=i.querySelector("div");if(o){const s=o.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};`,o.setAttribute("style",a.join("; "))):o.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),r.innerHTML}function ig(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldStrikethrough value: must be a boolean");const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelector("td:first-child");if(i){const o=i.querySelector("div");if(o){const s=o.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};`,o.setAttribute("style",a.join("; "))):o.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),r.innerHTML}function og(e,t){if(!e)return!1;const r=e.closest("table");return r?r.classList.contains(t):!1}function sg(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 ag(e){if(!e||!(e instanceof Node))return null;const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:i=>i.nodeValue?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let r=null,n;for(;n=t.nextNode();)r=n;return r}function lg(e){if(!e||!(e instanceof HTMLElement))return"inside";const t=window.getSelection();if(!t||t.rangeCount===0)return"inside";const r=t.getRangeAt(0);if(!r.collapsed)return"inside";let{startContainer:n,startOffset:i}=r;if(n===e)return i===0?"start":i===e.childNodes.length?"end":"inside";const o=sg(e),s=ag(e);let a=n;return a&&a.nodeType===Node.ELEMENT_NODE&&(a=a.childNodes[0]),o&&a===o&&i===0?"start":s&&n===s&&(i===s?.nodeValue?.length||i===s?.nodeValue?.trim().length)?"end":"inside"}function Pl(e){const t=e.cloneNode(!0),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let n;for(;n=r.nextNode();)n.nodeValue="";return t}function Mo(e){let t="";for(const r of e.attributes)t+=` ${r.name}="${r.value}"`;return t}function cg(e,t){const r=e.closest(`table.${t}`);if(!r)return null;const n=r.querySelector("tbody"),i=n?n.innerHTML.trim():r.innerHTML.trim(),o=e.closest("tr");if(!o)return{rowHtml:i,firstCellText:"",secondCellText:"",firstCellHtmlNoText:"",secondCellHtmlNoText:"",secondCellWrapperHtml:"",secondCellInnerDivHtml:"",wrappedSecondCellHtml:"",secondCellInnerDivWrapperHtml:"",secondCellTextHTML:""};const s=o.querySelectorAll("td"),a=s[0]||null,l=s[1]||null,c=a?a.textContent.trim():"",u=l?l.textContent.trim():"",d=l?l.innerHTML.trim():"",f=a?Pl(a).outerHTML:"",h=l?Pl(l).outerHTML:"",g=l?`<td${Mo(l)}></td>`:"",y=l?l.querySelector("div"):null;return{rowHtml:i,firstCellText:c,secondCellText:u,firstCellHtmlNoText:f,secondCellHtmlNoText:h,secondCellWrapperHtml:g,secondCellInnerDivHtml:y?y.outerHTML:"",wrappedSecondCellHtml:l&&y?`<td${Mo(l)}>${y.outerHTML}</td>`:"",secondCellInnerDivWrapperHtml:y?`<div${Mo(y)}></div>`:"",secondCellTextHTML:d}}function Un(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function ug(e,t){const r=document.createElement("template");r.innerHTML=e;const n=r.content.firstElementChild;if(!n||n.tagName.toLowerCase()!=="td")return e;const i=n.querySelector("div");return i?i.textContent=Un(t)||" ":n.insertAdjacentText("afterbegin",Un(t)),n.outerHTML}function dg(e){const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("editor").forEach(r=>{r.replaceWith(...Array.from(r.childNodes))}),t.content.querySelectorAll('[em-edit="active"]').forEach(r=>{r.removeAttribute("em-edit")}),t.innerHTML}function fg(e){const t=window.getSelection();if(!t||!t.rangeCount)return null;const r=t.getRangeAt(0);if(!e.contains(r.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(r.startContainer,r.startOffset);const i=n.toString(),o=document.createRange();return o.selectNodeContents(e),o.setStart(r.startContainer,r.startOffset),{beforeCursorPosition:i,afterCursorPosition:o.toString()}}function hg(e,t){const r=document.createElement("template");return r.innerHTML=e,r.content.querySelectorAll(`div.${t}`).forEach(n=>{const i=n.closest("tr");i&&i.remove()}),r.innerHTML}function mg(e,t,r,n=!0){const i=document.createElement("template");i.innerHTML=e.trim();const o=i.content.querySelector(`div.${r}`);if(o){const s=o.closest("tr");if(s){const a=n?"beforebegin":"afterend";s.insertAdjacentHTML(a,t)}}return i.innerHTML}function pg(e){const t=/^(\s| )+|(\s| )+$/g,r=e.querySelectorAll("tr"),n=[];return r.forEach(i=>{const o=i.querySelectorAll("td");if(o.length>=2){const s=o[0].querySelector("div"),a=o[1].querySelector("div, editor"),l=s?s.textContent.trim():"";let c="";if(a)if(a.classList.contains("em-text")){const u=a.querySelector("div");c=u?u.innerHTML:""}else c=a.innerHTML;c=c.replace(t,""),n.push({cellOneText:l,cellTwoText:c})}}),n}function gg(e){let t=1;return e.map(r=>{if(r.cellOneText&&/^\d+\.$/.test(r.cellOneText.trim())){const i={...r,cellOneText:`${t}.`};return t++,i}if(!r.cellOneText||/^\s*$/.test(r.cellOneText))return{...r};const n={...r,cellOneText:`${t}.`};return t++,n})}function bg(e,t){if(typeof e!="string")return"";const r=document.createElement("template");r.innerHTML=e.toString().trim();const n=r.content.querySelector("table");return n?(n.querySelectorAll("tr").forEach((i,o)=>{if(o>=t.length)return;const s=i.querySelectorAll("td");if(s.length<2)return;const a=s[0].querySelector("div");a&&(a.textContent=Un(t[o].cellOneText));const l=s[1].querySelector("div");l&&(l.textContent=Un(t[o].cellTwoText))}),n.outerHTML):e}function yg(e){return e.map(t=>({...t,cellOneText:t.cellOneText===""?" ":t.cellOneText,cellTwoText:t.cellTwoText===""?" ":t.cellTwoText}))}function vg(e){if(!Array.isArray(e)||e.length===0)return e;const t=" ",r=e.map(i=>{if(!i.cellOneText)return i;let o=i.cellOneText.trim();return o.endsWith(t)||(o+=t),{...i,cellOneText:o}}),n=Math.max(...r.map(i=>i.cellOneText?i.cellOneText.length:0));return r.map(i=>{if(!i.cellOneText)return i;let o=i.cellOneText;for(;o.length<n;)o+=t;return{...i,cellOneText:o}})}function Eg(e,t,r,n){const i=new DOMParser().parseFromString(e,"text/html"),o=i.querySelector(`div.${t}`);if(!o)return e;const s=o.closest("tr");if(!s)return e;const a=n==="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(r)}}else o.classList.add(r);const l=i.querySelector("table");return l?l.outerHTML:e}function _g(e){const t=window.getSelection();if(!t||!t.rangeCount)return null;const r=t.getRangeAt(0);if(!e.contains(r.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(r.startContainer,r.startOffset);const i=n.cloneContents(),o=document.createRange();o.selectNodeContents(e),o.setStart(r.startContainer,r.startOffset);const s=o.cloneContents();function a(l){const c=document.createElement("div");return c.appendChild(l),c.childNodes.length===1&&c.firstChild.nodeType===Node.ELEMENT_NODE?c.firstChild.innerHTML:c.innerHTML}return{beforeHTML:a(i),afterHTML:a(s)}}function Sg(e,t,r,n){const i=e.closest(`table.${t}`)||e.closest(`table.${r}`);i&&i.querySelectorAll("tr").forEach(o=>{const s=o.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=" ",s.appendChild(l)}else a.forEach(l=>{let c=l.innerHTML.trim();!c||c.replace(n,"")===""?l.innerHTML=" ":(c=c.replace(n,""),c.endsWith(" ")||(c+=" "),c=c.replace(/ +$/," "),l.innerHTML=c)})})}function wg(e){const t=`<table><tbody><tr>${e}</tr></tbody></table>`,r=new DOMParser().parseFromString(t,"text/html"),n=r.querySelector("div");return n&&(n.classList.add("remove-new-editor-element"),n.innerHTML.trim()?n.innerHTML+=" ":n.innerHTML=" "),r.querySelector("td")?.outerHTML||""}function Cg(e,t){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelectorAll("td");if(i.length>1){const o=i[1],s=(o.getAttribute("class")||"").split(" ").map(l=>l.trim()).filter(l=>l!=="");s.includes(t)||s.push(t);const a=s.join(" ");o.setAttribute("class",a)}}),r.innerHTML}function ye(e){if(Ag(e))return Tg(e)?e.trim():kg(e)}var Nl={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},Ag=e=>typeof e=="string"&&e.trim()!=="",Tg=e=>Nl.HEX.test(e);function kg(e){const t=Nl.RGB.exec(e)?.groups;if(!t)return;const r=Lg(t);return xg(r)}var Lg=e=>({r:Ro(e.r),g:Ro(e.g),b:Ro(e.b),a:Og(e.a)}),Ro=e=>parseInt(e||"0",10),Og=e=>parseFloat(e||"1"),xg=e=>`#${Do(e.r)}${Do(e.g)}${Do(e.b)}`,Do=e=>e.toString(16).padStart(2,"0"),Pg=class extends Z{constructor(...e){super(...e),k(this,"_transforms",[]),k(this,"_byAttribute",new Map)}register(e){this._transforms.push(e);for(const t of e.attributes){const r=t.toLowerCase(),n=this._byAttribute.get(r);n?n.push(e):this._byAttribute.set(r,[e])}return{dispose:()=>this._remove(e)}}_remove(e){const t=this._transforms.indexOf(e);if(t!==-1){this._transforms.splice(t,1);for(const r of e.attributes){const n=r.toLowerCase(),i=this._byAttribute.get(n);if(!i)continue;const o=i.indexOf(e);o!==-1&&i.splice(o,1),i.length||this._byAttribute.delete(n)}}}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,r){const n=this._byAttribute.get(r.attribute.toLowerCase());if(!n?.length)return t;const i=e==="render"?n:[...n].reverse();let o=t;for(const s of i){if(o===null)break;const a=e==="render"?s.render?.(o,r):s.serialize?.(o,r);a!==void 0&&(o=a)}return o}dispose(){this._transforms.length=0,this._byAttribute.clear(),super.dispose()}},$r;function Ng(e){const t=$r;return $r=e,{dispose:()=>{$r===e&&($r=t)}}}function Io(){return $r}var qn=new WeakMap;function Mg(e,t,r){const n=qn.get(e);n?n.set(t.toLowerCase(),r):qn.set(e,new Map([[t.toLowerCase(),r]]))}function Rg(e,t){const r=qn.get(e);r?.size&&qn.set(t,new Map(r))}function Ml(e,t,r){const n=e.tagName.toLowerCase();for(const i of t.attributes){if(!e.hasAttribute(i))continue;const o=e.getAttribute(i)??"",s=t.serialize(o,{element:e,tag:n,attribute:i,stage:r});s===null?e.removeAttribute(i):s!==o&&e.setAttribute(i,s)}}function Bo(e,t={}){const r=t.pipeline??Io(),n=t.stage??"build";let i=e;if(t.clone&&(i=e.cloneNode(!0),r&&!r.isEmpty&&Rl(e,i)),!r||r.isEmpty)return i;i instanceof Element&&Ml(i,r,n);const o=i.querySelectorAll?.("*");if(o)for(const s of o)Ml(s,r,n);return i}function Dg(e,t={}){const r=t.pipeline??Io();return!r||r.isEmpty?e.outerHTML:Bo(e,{...t,pipeline:r,clone:!0}).outerHTML}function Rl(e,t){Rg(e,t);const r=e.childNodes,n=t.childNodes;for(let i=0;i<r.length&&i<n.length;i++)Rl(r[i],n[i])}function Fo(e,t,r,n={}){const i=jo(e,t,r,{stage:"settings",...n});i===null?e.removeAttribute(t):e.setAttribute(t,i)}function jo(e,t,r,n={}){const i=n.pipeline??Io();if(!i||!i.handles(t))return r;const o=e?.tagName.toLowerCase()??"",s=i.render(r,{element:e,tag:o,attribute:t,stage:n.stage??"build"});if(s!==r){const a=n.owner??e;a&&Mg(a,t,r)}return s}var Dl=class{constructor(e){k(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},Ce=(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})({}),Ig=class{constructor(e,t){k(this,"source",void 0),k(this,"len",void 0),k(this,"position",void 0),this.source=e,this.len=e.length,this.position=t}eos(){return this.len<=this.position}getSource(){return this.source}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}goToEnd(){this.position=this.source.length}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)?(this.position++,!0):!1}advanceIfChars(e){let t;if(this.position+e.length>this.source.length)return!1;for(t=0;t<e.length;t++)if(this.source.charCodeAt(this.position+t)!==e[t])return!1;return this.advance(t),!0}advanceIfRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index+t[0].length,t[0]):""}advanceUntilRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index,t[0]):(this.goToEnd(),"")}advanceUntilChar(e){for(;this.position<this.source.length;){if(this.source.charCodeAt(this.position)===e)return!0;this.advance(1)}return!1}advanceUntilChars(e){for(;this.position+e.length<=this.source.length;){let t=0;for(;t<e.length&&this.source.charCodeAt(this.position+t)===e[t];t++);if(t===e.length)return!0;this.advance(1)}return this.goToEnd(),!1}skipWhitespace(){return this.advanceWhileChar(e=>e===Vg||e===Wg||e===$g||e===zg||e===Hg)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},Il=33,Xt=45,Gn=60,Ye=62,$o=47,Bg=61,Fg=34,jg=39,$g=10,Hg=13,zg=12,Vg=32,Wg=9,Ug={"text/x-handlebars-template":!0,"text/html":!0};function qg(e,t=0,r=0,n=!1){const i=new Ig(e,t);let o=r,s=0,a=18,l,c,u,d,f;function h(){return i.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function g(){return i.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function y(C,O,E){return a=O,s=C,l=E,O}function A(){const C=i.pos(),O=o,E=L();return E!==21&&C===i.pos()&&!(n&&(E===4||E===8))?(i.advance(1),y(C,18)):E}function L(){const C=i.pos();if(i.eos())return y(C,21);let O;switch(o){case 6:return i.advanceIfChars([Xt,Xt,Ye])?(o=0,y(C,2)):(i.advanceUntilChars([Xt,Xt,Ye]),y(C,1));case 3:return i.advanceIfChar(Ye)?(o=0,y(C,15)):(i.advanceUntilChar(Ye),y(C,14));case 0:if(i.advanceIfChar(Gn)){if(!i.eos()&&i.peekChar()===Il){if(i.advanceIfChars([Il,Xt,Xt]))return o=6,y(C,0);if(i.advanceIfRegExp(/^!doctype/i))return o=3,y(C,13)}return i.advanceIfChar($o)?(o=2,y(C,7)):(o=1,y(C,3))}return i.advanceUntilChar(Gn),y(C,16);case 2:return h().length>0?(o=5,y(C,9)):i.skipWhitespace()?y(C,17,"Tag name must directly follow the open bracket."):(o=5,i.advanceUntilChar(Ye),C<i.pos()?y(C,18,"End tag name expected."):L());case 5:if(i.skipWhitespace())return y(C,17);if(i.advanceIfChar(Ye))return o=0,y(C,8);if(n&&i.peekChar()===Gn)return o=0,y(C,8,"Closing bracket missing.");O="Closing bracket expected.";break;case 1:return u=h(),f=void 0,d=void 0,u.length>0?(c=!1,o=4,y(C,6)):i.skipWhitespace()?y(C,17,"Tag name must directly follow the open bracket."):(o=4,i.advanceUntilChar(Ye),C<i.pos()?y(C,18,"Start tag name expected."):L());case 4:return i.skipWhitespace()?(c=!0,y(C,17)):c&&(d=g(),d.length>0)?(o=9,c=!1,y(C,11)):i.advanceIfChars([$o,Ye])?(o=0,y(C,5)):i.advanceIfChar(Ye)?(u==="script"?f&&Ug[f]?o=0:o=7:u==="style"?o=8:o=0,y(C,4)):n&&i.peekChar()===Gn?(o=0,y(C,4,"Closing bracket missing.")):(i.advance(1),y(C,18,"Unexpected character in tag."));case 9:return i.skipWhitespace()?(c=!0,y(C,17)):i.advanceIfChar(Bg)?(o=10,y(C,10)):(o=4,L());case 10:if(i.skipWhitespace())return y(C,17);let E=i.advanceIfRegExp(/^[^\s"'`=<>]+/);if(E.length>0)return i.peekChar()===Ye&&i.peekChar(-1)===$o&&(i.goBack(1),E=E.substr(0,E.length-1)),d==="type"&&(f=E),o=4,c=!1,y(C,12);const m=i.peekChar();return m===jg||m===Fg?(i.advance(1),i.advanceUntilChar(m)&&i.advance(1),d==="type"&&(f=i.getSource().substring(C+1,i.pos()-1)),o=4,c=!1,y(C,12)):(o=4,c=!1,L());case 7:let b=1;for(;!i.eos();){const S=i.advanceIfRegExp(/<!--|-->|<\/?script\s*\/?>?/i);if(S.length===0)return i.goToEnd(),y(C,19);if(S==="<!--")b===1&&(b=2);else if(S==="-->")b=1;else if(S[1]!=="/")b===2&&(b=3);else if(b===3)b=2;else{i.goBack(S.length);break}}return o=0,C<i.pos()?y(C,19):L();case 8:return i.advanceUntilRegExp(/<\/style/i),o=0,C<i.pos()?y(C,20):L()}return i.advance(1),o=0,y(C,18,O)}return{scan:A,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>i.pos()-s,getTokenEnd:()=>i.pos(),getTokenText:()=>i.getSource().substring(s,i.pos()),getScannerState:()=>o,getTokenError:()=>l}}function Gg(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function Xg(e,t){const r=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+r.length,r}function Yg(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function Kg(e,t){const r=`<!--${e.content}-->`;return e.start=t,e.startTagEnd=t+4,e.end=t+r.length,e.endTagStart=e.end-3,r}var Ho=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function Qg(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,r)=>r.toUpperCase())}var Bl=Object.create(null);function Zg(e,t){const r=Bl[e]||(Bl[e]=Object.create(null));let n=r[t];if(typeof n!="boolean"){const i=document.createElement(e)[Qg(t)];n=r[t]=typeof i<"u"&&typeof i!="boolean"}return n}function zo(e,t){if(e.start===e.end||t)return"";switch(e.type){case I.ELEMENT:return Wo(e,t);case I.ROOT:return[...e.children].map(r=>zo(r,t)).join("");case I.DOCTYPE:return Gg(e,t);case I.COMMENT:return Yg(e,t);default:return e.content||""}}function Vo(e,t=0){if(e.start===e.end)return"";switch(e.type){case I.ELEMENT:return eb(e,t);case I.ROOT:return jl(e,t);case I.DOCTYPE:return Xg(e,t);case I.COMMENT:return Kg(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function Fl(e){const t=e.tag?.toLowerCase();let r="";if(t){const n=e.attributes;if(n){const i=Object.keys(n);for(const o of i){const s=n[o]===null?"":n[o];typeof s=="string"&&(r+=s===""&&o!=="em"&&!Zg(t,o)?` ${o}`:` ${o}="${s.replaceAll('"',"'")}"`)}}}return r}function Jg(e,t){let r="";if(e.startTagEnd!==e.endTagStart||t)for(const n of e.children)r+=zo(n);return r}function jl(e,t){let r="";if(e.startTagEnd!==e.endTagStart)for(const n of e.children)r+=Vo(n,t+r.length);return r}function $l(e,t){if(e.start!==e.startTagEnd||t){const r=e.tag?.toLowerCase()||"div",n=Fl(e);return r==="vk-snippet-end"?`<${r}${n}/>`:`<${r}${n}>`}return""}function Hl(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function Wo(e,t,r=!0){const n=e.tag?.toLowerCase()||"div",i=$l(e,t);if(Ho.has(n))return i;{const o=Hl(e,t);return`${i}${r?Jg(e,t):""}${o}`}}function eb(e,t){const r=e.tag?.toLowerCase()||"div",n=$l(e);if(e.start=t,e.startTagEnd=t+n.length,Ho.has(r)){e.endTagStart=e.startTagEnd,e.end=e.startTagEnd;const i=o=>{for(const s of o.children)s.start=s.startTagEnd=s.endTagStart=s.end=o.end,i(s)};return i(e),n}else{const i=jl(e,e.startTagEnd);e.endTagStart=e.startTagEnd+i.length;const o=Hl(e);return e.end=e.endTagStart+o.length,`${n}${i}${o}`}}function Uo(e,t){let r=0,n=e.length;if(n===0)return 0;for(;r<n;){const i=Math.floor((r+n)/2);t(e[i])?n=i:r=i+1}return r}var I=(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})({}),Xn=e=>e.type===0?e.start-1:e.start,tb=e=>e.type===0?e.end+1:e.end,Oe=class Vm{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,r,n,i){k(this,"start",void 0),k(this,"end",void 0),k(this,"children",void 0),k(this,"parent",void 0),k(this,"content",void 0),k(this,"type",1),k(this,"tag",void 0),k(this,"closed",!1),k(this,"startTagEnd",void 0),k(this,"endTagStart",void 0),k(this,"attributes",void 0),k(this,"createdBy",void 0),k(this,"isDirty",void 0),this.start=t,this.end=r,this.children=n,this.parent=i}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 r=Uo(this.children,n=>t<=Xn(n))-1;if(r>=0){const n=this.children[r];if(t>Xn(n)){if(t<n.end)return n.findNodeBefore(t);const i=n.lastChild;return i&&i.end===n.end?n.findNodeBefore(t):n}}return this}findNodeAt(t){const r=Uo(this.children,n=>t<=Xn(n))-1;if(r>=0){const n=this.children[r];if(t>=Xn(n)&&t<=tb(n))return n.findNodeAt(t)}return this}find(t){if(t(this))return this;for(const r of this.children){const n=r.find(t);if(n)return n}}closest(t){let r=this;do if(t(r))return r;while(r=r.parent)}parents(){return this.parent?[this.parent,...this.parent.parents()]:[]}closestFromRoot(t,r=!0){const n=r?[this,...this.parents()]:this.parents();for(let i=n.length-1;i>=0;i--){const o=n[i];if(t(o))return o}}contains(t){return!!t.closest(r=>r===this)}clone(t=this.parent,r=this.start,n=!0){const i=this.start-r,o=new Vm(r,this.end-i,[],t);return o.children=n?this.children.map(s=>s.clone(o,s.start-i)):[],o.attributes={...this.attributes},o.closed=this.closed,o.content=this.content,o.startTagEnd=this.startTagEnd,o.endTagStart=this.endTagStart,o.tag=this.tag,o.type=this.type,o}};function rb(e){if(typeof e=="string"){const t=e.startsWith("'")||e.startsWith('"')?1:0,r=e.endsWith("'")||e.endsWith('"')?e.length-1:e.length;return e.substring(t,r)}return e}var zl=class{constructor(e,t){k(this,"text",void 0),k(this,"type",void 0),k(this,"node",void 0),k(this,"replaces",void 0),this.text=e,this.type=t}get hasNode(){return!!this.node}addReplace(e){this.replaces?.push(e)}start(e,t,r){if(!this.node){const n=this.node=new Oe(e,this.text.length,[],r);n.type=this.type,n.startTagEnd=t,this.replaces=[]}}finish(e,t){const r=this.replaces,n=this.node,i=e+(t||0);if(r){for(const o of r){const s=o.parent;if(!s)throw new Error("parent not defined");const a=s.children.indexOf(o);s.children.splice(a,1)}this.replaces=void 0}if(n){const o=n.parent;if(!o)throw new Error("parent not defined");o.children.push(n),n.closed=t!==void 0,n.endTagStart=e,n.end=i,n.content=this.text.substring(n.startTagEnd,e),this.node=void 0}}},Vl=class{constructor(e){k(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const r=qg(e,void 0,void 0,!0),n=new Oe(0,e.length,[],void 0);n.type=I.ROOT;let i=n,o=-1,s,a=null,l=r.scan();const c=()=>{if(!i.tag){const g=i.parent.children,y=g[g.length-2],A=e.substring(i.start,i.end);y?.type===I.HTML?(y.content=(y.content||"")+A,y.end=i.end,g.splice(g.length-1,1)):(i.type=I.HTML,i.content=A,i.children=[]),i.type=I.HTML}i=i.parent},u=new zl(e,I.COMMENT),d=new zl(e,I.DOCTYPE),f=g=>{i.children.push(g)};for(;l!==Ce.EOS;){switch(l){case Ce.StartDoctypeTag:d.start(r.getTokenOffset(),r.getTokenEnd(),i);break;case Ce.EndDoctypeTag:{const C=i.lastChild,O=d.node;if(!O)throw new Error("");const E=C?C.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(E!==O.start){const m=e.substring(E,O.start);if(m){const b=new Oe(E,O.start,[],i);b.type=I.HTML,b.content=m,f(b)}}d.finish(r.getTokenOffset(),r.getTokenLength());break}case Ce.StartCommentTag:u.start(r.getTokenOffset(),r.getTokenEnd(),i);break;case Ce.EndCommentTag:{const C=i.lastChild,O=u.node;if(!O)throw new Error("");const E=C?C.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(E!==O.start){const m=e.substring(E,O.start);if(m){const b=new Oe(E,O.start,[],i);b.type=I.HTML,b.content=m,f(b)}}u.finish(r.getTokenOffset(),r.getTokenLength());break}case Ce.StartTagOpen:const g=i.lastChild,y=new Oe(r.getTokenOffset(),e.length,[],i),A=g?g.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(A!==y.start){const C=e.substring(A,y.start);if(C){const O=new Oe(A,y.start,[],i);O.type=I.HTML,O.content=C,f(O)}}f(y),i=y;break;case Ce.StartTag:i.tag=r.getTokenText();break;case Ce.StartTagClose:i.parent&&(i.end=r.getTokenEnd(),r.getTokenLength()?(i.startTagEnd=r.getTokenEnd(),i.tag&&this.dataManager.isVoidElement(i.tag)&&(i.closed=!0,c())):c());break;case Ce.StartTagSelfClose:i.parent&&(i.closed=!0,i.end=r.getTokenEnd(),i.startTagEnd=r.getTokenEnd(),c());break;case Ce.EndTagOpen:o=r.getTokenOffset(),s=void 0;break;case Ce.EndTag:s=r.getTokenText().toLowerCase();break;case Ce.EndTagClose:let L=i;for(;!L.isSameTag(s)&&L.parent;)L=L.parent;if(L.parent){const C=i.lastChild,O=C?C.end:i.startTagEnd===void 0?i.start:i.startTagEnd;if(O!==o){const E=e.substring(O,o);if(E){const m=new Oe(O,o,[],i);m.type=I.HTML,m.content=E,f(m)}}for(;i!==L;)i.end=o,i.closed=!1,c();i.closed=!0,i.endTagStart=o,i.end=r.getTokenEnd(),c()}break;case Ce.AttributeName:{a=r.getTokenText();let C=i.attributes;C||(i.attributes=C={}),C[a]=null;break}case Ce.AttributeValue:{const C=r.getTokenText(),O=i.attributes;O&&a&&(O[a]=rb(C),a=null);break}}l=r.scan()}for(;i.parent;)i.end=e.length,i.closed=!1,c();u.hasNode,u.finish(e.length);const h=n.lastChild?.end||0;if(h<e.length){const g=e.substring(h);if(g){const y=new Oe(h,e.length,[],n);y.type=I.HTML,y.content=g,f(y)}}return{roots:n.children,findNodeBefore:n.findNodeBefore.bind(n),findNodeAt:n.findNodeAt.bind(n)}}},$N=new Vl(new Dl(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),nb=new Dl(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),ib=new Vl(nb);function Yt(e){return ib.parse(e)}function qo(e){if(e){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",e),t.firstChild||document.createTextNode("")}else return document.createTextNode("")}var Kt,Tt;function ob(e){const t=Kt;return Kt=e,()=>{Kt===e&&(Kt=t)}}function sb(e){const t=Tt;return Tt=e,()=>{Tt===e&&(Tt=t)}}function Wl(e,t,r){return Kt?Kt(e,t,r):r}function ab(){return Tt!==void 0}function Ul(e,t,r){return Tt?Tt(e,t,r):r}var Go;function lb(){return Go||(Go=document.implementation.createHTMLDocument("")),Go}function cb(e,t){let r;switch(t?.toLowerCase()){case"tr":r=e.createElement("table");break;case"td":r=e.createElement("tr");break;case"head":case"body":r=e.createElement("html");break;case"documenttype":case"html":{const n=e.implementation.createHTMLDocument();for(const i of[...n.childNodes])i.remove();return n}default:r=e.createElement("div")}return r}var ub=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),db=new Set(["script","style","xmp"]);function fb(e,t){return!(t&&db.has(t.toLowerCase())||ub.has(e.toLowerCase()))}var hb=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1};function ql(e,t,r){let n=e.tagName.toLowerCase();n==="html"&&(n="div");const i=`<${n} ${t}="${r}"/>`,o=cb(lb(),n);if(o instanceof Document)return;o.innerHTML=i;const s=o.querySelector(n);if(!s)throw new Error("targetElement is not defined");const a=s.getAttributeNode(t);a&&e.setAttributeNode(a.cloneNode())}function st(e,t,r){try{fb(t,e.tagName)&&!hb(r)?e.setAttribute(t,r):ql(e,t,r)}catch{ql(e,t,r)}}function Yn(e,t=!0){const r=e.content;switch(e.type){case I.ROOT:{const n=document.implementation.createHTMLDocument();for(const i of[...n.childNodes])n.removeChild(i);if(t)for(const i of e.children)n.appendChild(Yn(i));return n}case I.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case I.COMMENT:return document.createComment(r||"");case I.ELEMENT:if(e.tag){const n=document.createElement(e.tag);if(Object.defineProperty(n,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const i of e.attributeNames){const o=e.attributes[i];try{const s=Wl(n,i,typeof o=="string"?o:"");s!==null&&st(n,i,s)}catch{}}if(t)for(const i of e.children)n.appendChild(Yn(i));return n}return document.createTextNode("<");case I.HTML:return qo(r||"");default:throw new Error("unsupported node")}}function xe(e){return Yt(e).roots.map(t=>Yn(t))}function Gl(e,t,r){const n=xe(r);switch(t){case"afterend":e.after(...n);break;case"afterbegin":e.prepend(...n);break;case"beforeend":e.append(...n);break;case"beforebegin":e.before(...n)}}function $e(e,t){e.remove?.(t)}var Xo=ge("SandboxHtmlDocument"),Yo=ge("SandboxRemoteDocument"),Ko=ge("SandboxTextDocument"),Qo=ge("SandboxDocumentMapping"),Xl=ge("SandboxSyncCommit"),Yl=ge("SandboxLayoutProfile"),mb=ge("SandboxState"),Kl=ge("SandboxAttributePipeline"),Ql=ge("SandboxAmpService"),Zl=ge("SandboxImageReload"),Zo=ge("SandboxImageCache"),Jl=ge("SandboxFocus");function pb(e){const t=new Pg,r=Ng(t),n=ob((o,s,a)=>t.isEmpty?a:jo(o,s,a,{pipeline:t})),i=sb((o,s,a)=>t.isEmpty?a:t.serialize(a,{element:o,tag:o.tagName.toLowerCase(),attribute:s,stage:"apply"}));return e.inject(Kl,t),{pipeline:t,dispose(){i(),n(),r.dispose(),t.dispose(),$e(e,Kl)}}}function gb(e,t){if(!e)return;const{minify:r,cssbeautify:n,HTMLDocument:i}=t;let o=document.head.querySelector('style[em="styles"]'),s="";o?s=i.getInnerHtml(o):(o=document.createElement("style"),o.setAttribute("em","styles"),o=document.head.insertAdjacentElement("beforeend",o));const a=document.createElement("div");a.insertAdjacentHTML("afterbegin",e);let l=r(s+`
|
|
1
|
+
__useblocks__.define("js/discussHandlers.C5qc-xPl.js",["require","exports","module","js/rolldown-runtime.BRlIiq3h.js"],function(Eo,_,IN){const F=Eo("./rolldown-runtime.BRlIiq3h.js");function Dr(e){"@babel/helpers - typeof";return Dr=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},Dr(e)}function Gm(e,t){if(Dr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Dr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xm(e){var t=Gm(e,"string");return Dr(t)=="symbol"?t:t+""}function k(e,t,r){return(t=Xm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ml;ml=Symbol.toStringTag;var _o=class{constructor(){k(this,"_valuesMap",new Map),k(this,ml,"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 pl(){const e=new _o;return new Proxy(e,{set:function(t,r,n){return typeof r=="string"&&_o.prototype.hasOwnProperty(r)?e[r]=n:typeof r=="string"&&e.setItem(r,String(n)),!0},get:function(t,r){if(typeof r=="string"){if(_o.prototype.hasOwnProperty(r)){const n=e[r];if(typeof n=="function"){const i=n;return(...o)=>i.apply(e,o)}return n}return e.getItem(r)}}})}function gl(){const e=pl(),t=pl();Object.defineProperty(window,"localStorage",{configurable:!0,enumerable:!0,get:()=>e}),Object.defineProperty(window,"sessionStorage",{configurable:!0,enumerable:!0,get:()=>t});let r=Object.create(null);Object.defineProperty(document,"cookie",{enumerable:!1,configurable:!0,get(){const n=[];for(var i in r)n.push(i+"="+r[i]);return n.join(";")},set(n){const i=n.indexOf("=");var o=n.substr(0,i),s=n.substring(i+1);return r[o]=s,o+"="+s}}),Object.defineProperty(document,"clearCookies",{enumerable:!1,configurable:!0,value:()=>r=Object.create(null)})}gl();function So(e,t){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object")return!1;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){const o=e,s=t;return o.length===s.length&&o.every((a,l)=>So(a,s[l]))}const n=Object.keys(e),i=Object.keys(t);return n.length!==i.length?!1:n.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&So(e[o],t[o]))}function bl(e,t){const r={watch(n){let i,o=!1;return e.watch(s=>{const a=t(s);o&&So(i,a)||(i=a,o=!0,n(a))})},select(n){return bl(r,n)}};return r}function Ym(...e){let t=e[0],r=e.length>0;const n=new Set,i={get(){return r?t:void 0},set(o){t=o,r=!0;for(const s of Array.from(n))s(o)},watch(o){return n.add(o),r&&o(t),{dispose:()=>n.delete(o)}},select(o){return bl(i,o)}};return i}var Z=class zm{constructor(t=[]){k(this,"_inner",void 0),k(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof zm&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(t){this.addDisposable({dispose:t})}removeDisposable(t){const r=this._inner.indexOf(t);r>=0&&this._inner.splice(r,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const t of[...this._inner])t.dispose()}}};function wo(e){return`service_container_${e}`}var Ir=new Set,Co;function Km(){if(!Co)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,yl.prototype.getInstanceAsync),e.stack}function Ao(e){Ir.delete(e)&&Co?.end(e)}var yl=class hl extends Z{_runCallbacks(t){this._injectCallbacks.forEach(r=>r(t))}constructor(t=null){super(),k(this,"_parent",void 0),k(this,"_injectCallbacks",[]),k(this,"_injections",Object.create(null)),k(this,"onInject",r=>(this._injectCallbacks.push(r),{dispose:()=>{const n=this._injectCallbacks.indexOf(r);n>=0&&this._injectCallbacks.splice(n,1)}})),this._parent=t,t&&this.addDisposable(t.onInject(r=>this._runCallbacks(r)))}inject(t,r){this._injections[t]=()=>r,this._runCallbacks(t)}injectFactory(t,r,n){const i=this._injections[t];let o=typeof i=="function"?i():i;const s=this._injections[t]=()=>(o=r(this,o),o);n&&s(),this._runCallbacks(t)}_find(t,r=!0){return this._injections[t]||r&&this._parent?._find(t)}_onInject(t,r,n=new Z){return n.addDisposable(this.onInject(i=>{t===i&&(n.dispose(),r(this.getInstance(i)))})),this._parent&&n.addDisposable(this._parent._onInject(t,r,n)),this.addDisposable(n),n}getInstance(t,r=!0){const n=this._find(t,r);if(typeof n=="function")return n()}getOrCreateInstance(t,r){const n=this._find(t);if(typeof n=="function")return n();const i=r(this);return this.inject(t,i),i}getInstanceAsync(t){const r=this._find(t);if(typeof r=="function")return Promise.resolve(r());const n=Km();return new Promise((i,o)=>{const s={id:String(t),startedAt:Date.now(),origin:n,container:this,reject:o};Ir.add(s),Co?.start(s),this._onInject(t,()=>{Ao(s),i(this.getInstance(t))})})}failPendingWaits(t){for(const r of Array.from(Ir))r.container===this&&(Ao(r),r.reject(t))}pendingWaits(){return[...Ir].filter(t=>t.container===this)}addService(t,r){const n=wo(t);this.injectFactory(n,(o,s=[])=>s.indexOf(r)<0?[...s,r]:s);const i=new Z;return i.addDispose(()=>{this.injectFactory(n,(o,s=[])=>s.filter(a=>a!==r))}),i}addServiceFactory(t,r,n){const i=wo(t);let o;this.injectFactory(i,(a,l=[])=>(o=r(a,o),o===void 0?l:l.indexOf(o)<0?[...l,o]:l),n);const s=new Z;return s.addDispose(()=>{this.injectFactory(i,(a,l=[])=>o===void 0?l:l.filter(c=>c!==o))}),s}getServices(t){const r=wo(t);return[...this.getInstance(r,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new hl(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const r=this._parent?.getOrCreateIsolatedContainer(t);return new hl(r)})}remove(t){const r=this._injections;delete r[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(Ir))t.container===this&&Ao(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function To(e){return e.startsWith("__")?e:`__${e}__`}function Qm(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=To(e),r=globalThis;return r[t]??(r[t]={})}function Zm(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function Jm(e){if(e)return To(e);const t="useblocks".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return To(t)}function ko(e){const t=Jm(e),r=Qm(t);if(Zm(r.container))return r.container;const n=new yl(null);return r.container=n,n}function ep(){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(r){let n=Math.random()*16;return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),(r==="x"?n:n&3|8).toString(16)})}function tp(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():ep()}function ge(e=tp()){return e}function vl(){return"iframe".trim()||"unknown"}function rp(e){if(typeof globalThis>"u")return;const t=vl(),r=globalThis[e]??{};globalThis[e]=r;const n=r.__diagnostics??(r.__diagnostics={}),i=n.diModuleEval??(n.diModuleEval={evalCount:0,records:[]});i.records.push({buildSource:t,timestamp:Date.now(),stack:new Error().stack}),i.evalCount+=1}function np(){const e="useblocks".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function ip(e,t){if(rp(t),typeof globalThis>"u")return e;const r=vl(),n=globalThis,i=n[t]=n[t]||{},o=i.__diagnostics=i.__diagnostics||{},s=o.dependencyResolver=o.dependencyResolver||{entries:[]},a={container:e,source:"packages/runtime-core/di/index.ts",buildSource:r,timestamp:Date.now(),stack:new Error().stack};return s.entries.push(a),e}var Bn;function op(){if(Bn)return Bn;const e=np();return Bn=ip(ko(e),e),Bn}var BN=new Proxy({},{get(e,t,r){const n=op(),i=Reflect.get(n,t,r);return typeof i=="function"?i.bind(n):i}}),sp=new Function("url","return import(url)");function ap(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function lp(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function cp(e){return e.type==="umd"||e.resolve==="registry"}function FN(e){return e}var up=class{constructor(e,t,r={}){k(this,"_context",void 0),k(this,"_pluginRegistry",void 0),k(this,"_options",void 0),k(this,"_map",new Map),k(this,"_optionsMap",new Map),k(this,"_readyMap",new Map),k(this,"_resolveMap",new Map),k(this,"_initializingPlugins",new Map),k(this,"_creatingPlugins",new Set),k(this,"_initializedPlugins",new Set),k(this,"_creationOrder",[]),k(this,"_lifecycleListeners",new Set),k(this,"_activated",!1),this._context=e,this._pluginRegistry=t,this._options=r}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,r]=e;if(typeof t=="function")return{ctor:t,options:r};const n=await this._pluginRegistry.getAsync(t);if(!n)throw new Error(`Plugin "${String(t)}" not registered.`);return{ctor:n,options:r}}if(lp(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(cp(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const r=await sp(e.url);if(t==="module")return{ctor:r.default??r};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 ESM load`);return{ctor:n}}}if(e.type==="umd"){if(await this._loadScript(e.url),t==="window"&&e.name){const r=globalThis[e.name];if(!r)throw new Error(`Plugin "${e.name}" not found on window after script load`);return{ctor:r}}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 script load`);return{ctor:r}}}throw new Error(`Cannot resolve descriptor: type=${e.type}, resolve=${t}, name=${e.name??"none"}`)}_loadScript(e){return new Promise((t,r)=>{if(typeof document>"u"){r(new Error("Cannot load UMD script in non-browser environment"));return}const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load script: ${e}`)),document.head.appendChild(n)})}initSync(e){const t=[];for(const r of e){const n=this._getOrCreate(r,void 0);t.push(n)}this._activated=!0,this._startPluginsBatch(t)}async init(e){const t=[],r=new Set;for(const n of e){const{ctor:i,options:o}=await this._resolveEntry(n),s=this._getOrCreate(i,o);r.has(s)||(r.add(s),t.push(s))}this._activated=!0,await this._startPluginsBatch(t)}async setPlugins(e){const t=new Set,r=[];for(const s of e){const a=await this._resolveEntry(s);t.add(a.ctor),r.push(a)}const n=[];this._map.forEach((s,a)=>{t.has(a)||n.push({key:a,plugin:s})});for(let s=n.length-1;s>=0;s--){const{key:a,plugin:l}=n[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 i=[],o=new Set;for(const{ctor:s,options:a}of r){const l=this._getOrCreate(s,a);o.has(l)||(o.add(l),i.push(l))}this._activated&&await this._startPluginsBatch(i)}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:r}=t??{};return await new Promise((n,i)=>{let o,s=!1;const a=()=>{s||(s=!0,o&&clearTimeout(o),this._pluginRegistry.off(e,a),n())};this._pluginRegistry.on(e,a),r!==void 0&&r>0&&(o=setTimeout(()=>{s||(s=!0,this._pluginRegistry.off(e,a),i(new Error(`waitFor("${String(e)}") timed out after ${r}ms`)))},r))}),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 r=this._getOrCreate(t);return this._activated&&this._startPluginsBatch([r]),r}async useByKeyAsync(e){const t=await this._pluginRegistry.getAsync(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered.`);const r=this._getOrCreate(t);return this._activated&&await this._startPluginsBatch([r]),r}useByCtor(e,t){const r=this._getOrCreate(e,t);return this._activated&&this._startPluginsBatch([r]),r}use(e){return typeof e=="function"?this.useByCtor(e):this.useByKey(e)}async useAsync(e){const{ctor:t,options:r}=await this._resolveEntry(e),n=this._getOrCreate(t,r);return this._activated&&await this._startPluginsBatch([n]),n}_getOrCreate(e,t){const r=e;if(!this._map.has(r)){t!==void 0&&this._optionsMap.set(r,t);const n=this._optionsMap.get(r),i=this._createPluginInstance(e,n),o=i.constructor.name;this._emitLifecycle({type:"created",plugin:i,name:o}),i.required?.(),this._map.set(r,i),this._creationOrder.push(i),this._setupReadyPromise(i)}return this._map.get(r)}_createPluginInstance(e,t){const r=e;if(this._creatingPlugins.has(r))throw new Error(`Cyclic dependency for plugin ${e.name}`);this._creatingPlugins.add(r);try{return ap(e)?new e(this._context,t):e(this._context,t)||{}}finally{this._creatingPlugins.delete(r)}}_setupReadyPromise(e){const t=new Promise(r=>{this._resolveMap.set(e,r)});this._readyMap.set(e,t)}async _startPluginsBatch(e){const t=Array.from(new Set(e)),r=new Set,n=[];for(const i of t){if(this._initializedPlugins.has(i))continue;const o=this._initializingPlugins.get(i);if(o){r.add(o);continue}n.push(i)}if(n.length>0){const i=this._runBatchLifecycle(n);for(const o of n)this._initializingPlugins.set(o,i);r.add(i),i.finally(()=>{for(const o of n)this._initializingPlugins.get(o)===i&&this._initializingPlugins.delete(o)})}await Promise.all(r)}async _runBatchLifecycle(e){const t=[];for(const r of e){const n=r.constructor.name;this._emitLifecycle({type:"init:start",plugin:r,name:n});try{await r.init?.(),this._emitLifecycle({type:"init:success",plugin:r,name:n}),t.push(r)}catch(i){this._emitLifecycle({type:"init:error",plugin:r,name:n,error:i})}}for(const r of t){const n=r.constructor.name;this._emitLifecycle({type:"afterInit:start",plugin:r,name:n});try{await r.afterInit?.(),this._emitLifecycle({type:"afterInit:success",plugin:r,name:n})}catch(i){this._emitLifecycle({type:"afterInit:error",plugin:r,name:n,error:i})}}for(const r of e)this._initializedPlugins.add(r),this._resolveMap.get(r)?.(),this._resolveMap.delete(r)}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(r){this._emitLifecycle({type:"dispose:error",plugin:e,name:t,error:r})}}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)}))}},El=class{constructor(){k(this,"_plugins",new Map),k(this,"_listeners",new Map)}_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){const r=this._plugins.get(e);if(r?.overrides)for(const n of r.overrides)t=n(t)||t;return t}_notifyListeners(e,t){const r=this._listeners.get(e);if(!r||r.length===0)return;for(const i of r)try{i.callback(t)}catch{}const n=r.filter(i=>!i.once);n.length>0?this._listeners.set(e,n):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 r=await t.loading;return this._applyOverrides(e,r)}if(t?.factory){const r=Promise.resolve(t.factory()).then(i=>(t.ctor=i,t.loading=void 0,this._notifyListeners(e,i),i));t.loading=r;const n=await r;return this._applyOverrides(e,n)}return new Promise(r=>{this.on(e,n=>r(this._applyOverrides(e,n)))})}add(e,t){const r=this._getOrCreateEntry(e);r.ctor=t,this._notifyListeners(e,t)}addAll(e){for(const t of Object.keys(e)){const r=e[t];r!==void 0&&this.add(t,r)}}addAsync(e,t){const r=this._getOrCreateEntry(e);return r.factory=t,{dispose:()=>{r.ctor||(r.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 r=this._getOrCreateEntry(e);return r.overrides.push(t),{dispose:()=>{const n=r.overrides.indexOf(t);n>=0&&r.overrides.splice(n,1)}}}on(e,t){const r=this.get(e);r&&t(r);let n=this._listeners.get(e);n||(n=[],this._listeners.set(e,n));const i={callback:t,once:!1};return n.push(i),{dispose:()=>this._removeListener(e,t)}}once(e,t){const r=this.get(e);if(r)return t(r),{dispose:()=>{}};let n=this._listeners.get(e);n||(n=[],this._listeners.set(e,n));const i={callback:t,once:!0};return n.push(i),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){const r=this._listeners.get(e);if(r){const n=r.findIndex(i=>i.callback===t);n>=0&&r.splice(n,1),r.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){const e=this;return{add(t,r){e.add(t,r)}}}},dp=class{constructor(e){k(this,"resolveRegistry",void 0),this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},_l=class extends Z{constructor(e={}){super(),k(this,"_options",void 0),k(this,"_listeners",[]),k(this,"on",this._addListener.bind(this)),k(this,"event",this._addListener.bind(this)),k(this,"once",(t,r=0,n)=>{const i=this._addListener((...o)=>(i?.dispose(),n?t.call(n,...o):t(...o)),r);return i}),k(this,"un",t=>{const r=this._listeners.findIndex(([n])=>n===t);r>=0&&(this._listeners.splice(r,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,r){if(this.isDisposed())return{dispose:()=>{}};const n=this._listeners,i=this._options;r&&typeof e=="function"&&(e=e.bind(r));const o=n.findIndex(([,a])=>a<t),s=[e,t];return n.splice(o>=0?o:n.length,0,s),n.length===1&&i.onFirstListenerAdd&&i.onFirstListenerAdd(),{dispose:()=>{const a=n.indexOf(s);a>=0&&(n.splice(a,1),!n.length&&i.onLastListenerRemove&&i.onLastListenerRemove())}}}dispose(){this._listeners.splice(0,this._listeners.length),this._options.onLastListenerRemove&&this._options.onLastListenerRemove(),super.dispose()}},fp=class extends _l{execute(e,t){for(const r of t)try{r(...e)}catch{}}fire(...e){if(!this.isDisposed()){const t=this.execute(e,this.getListeners(e));return t===void 0?void 0:t}}},ee=class extends fp{execute([e],t){for(const r of t)try{r(e)}catch{}}},hp=class extends _l{fire(e){if(this.isDisposed())return;let t=!1,r=!1;const n={value:e,preventDefault(){t=!0},stopPropagation(){r=!0}},i=this.getListeners([n]);for(const o of i){if(r)break;try{o(n)}catch{}}return t?!1:void 0}};function mp(e,t,r){let n;const i=new ee({onFirstListenerAdd(){n=i.addDisposable(new Z),n.addDisposable(e(o=>{t(o)!==!1&&i.fire(o)}))},onLastListenerRemove(){n?.dispose(),n=void 0}});return r?.addDisposable(i),i.event}var Fn={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},Br=Ym({...Fn});function Re(){return Br.get()}var jn=new ee,qt=new Map,_e={source:Br,get(e){return Re()[e]},getState(){return{...Re()}},getStateRef(){return Re()},set(e,t){if(Re()[e]===t)return;Br.set({...Re(),[e]:t}),jn.fire({[e]:t});const r=qt.get(e);r&&r.forEach(n=>n(t))},update(e){let t=!1;const r={};for(const n of Object.keys(e)){const i=e[n];if(Re()[n]!==i){Br.set({...Re(),[n]:i}),r[n]=i,t=!0;const o=qt.get(n);o&&o.forEach(s=>s(i))}}t&&jn.fire(r)},increment(e,t=1){const r=Re()[e];typeof r=="number"&&_e.set(e,r+t)},decrement(e,t=1){const r=Re()[e];typeof r=="number"&&_e.set(e,r-t)},subscribe(e){return jn.event(e)},subscribeToKey(e,t){qt.has(e)||qt.set(e,new Set);const r=qt.get(e),n=t;return r.add(n),()=>{r.delete(n),r.size===0&&qt.delete(e)}},reset(){Br.set({...Fn}),jn.fire(Re())},resetKey(e){this.set(e,Fn[e])},isEditingLocked(){const e=Re();return e.lockEdit||e.lockEditor||e.lockEditorInit},isActiveElementLocked(){return Re().activeElementLocked>0},getInitialState(){return Fn}},$n=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function Sl(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function At(e,t){return Array.from(e.classList).find(r=>r.includes(t))}function wl(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?wl(t):!1)}function z(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 r=typeof e.targetElement=="string"?document.querySelector(e.targetElement):e.targetElement;if(r)switch(e.insertType){case"append":r.append(t);break;case"prepend":r.prepend(t);break;case"before":r.before(t);break;case"after":r.after(t);break;case"replaceWith":r.replaceWith(t)}}return t}function pp(e){try{return JSON.parse(e),!0}catch{return!1}}function gp(e,t,r=2){const n=e.split(""),i=t.split("");if(Math.abs(n.length-i.length)>r)return!1;let o=0;if(n.length===i.length){for(let s=0;s<n.length;s++)if(n[s]!==i[s]&&(o++,o>r))return!1}else{const s=n.length>i.length?n:i,a=n.length>i.length?i:n;let l=0,c=0;for(;l<s.length&&c<a.length;)if(s[l]!==a[c]){if(o++,o>r)return!1;l++}else l++,c++;if(l<s.length&&o++,o>1)return!1}return!0}function bp(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function yp(e,t){let r=e;for(;r&&r!==document.body;){const n=r.style?.[t];if(n&&typeof n=="string")return n;if(r.tagName==="EDITOR")return null;r=r.parentElement}return null}function vp(e){const t=e.style?.fontWeight;if(typeof t=="number")return t>=600;if(typeof t=="string"){const r=t.toLowerCase();return r.includes("bold")||r.includes("black")||parseInt(r)>=600}return!1}function Cl(){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 Ep(e,t=null){const r=e?.innerText;for(;e!==null;){if(e.innerText===r){const n=e.parentElement;if(n===null||n.innerText!==r||n.tagName==="EDITOR"||e.tagName===t?.toUpperCase())return e.tagName===t?.toUpperCase()||!t?e:null}e=e.parentElement}return null}function Al(e,t=Cl()){e=$n(e)??"";const r=o=>$n(o?.textContent||"")??"",n=Array.from(t?.childNodes||[]).filter(o=>!!o&&o.nodeName!=="BR");let i=null;if(t&&t.nodeType===Node.TEXT_NODE&&r(t).includes(e)&&r(t)===e)return t;for(let o=0;o<n.length;o++){const s=n[o];if(s.nodeType===Node.TEXT_NODE&&r(s).includes(e)&&r(s)===e){i=s.parentNode;break}else if(s.nodeType===Node.ELEMENT_NODE&&(i=Al(e,s),i))break}return i}function Tl(e){const t=Array.from(e),r=t.map(o=>o.clientWidth),n=r.reduce((o,s)=>o+s,0),i=r.map(o=>((o||0)/n*100).toFixed(1));t.forEach((o,s)=>{o.setAttribute("data-percent",i[s])})}function Fr(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&&Fr({elem:e.elem.previousSibling,width:e.width})}function _p(e){let t="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i=0;for(;i<e;)t+=r.charAt(Math.floor(Math.random()*62)),i+=1;return t}var Hn=null,Lo=null,Sp=null,wp=null,jr=0;function Cp(e){Hn=e.htmlDocument,Lo=e.remoteDocument,Sp=e.textDocument,wp=e.documentMapping}function Oo(){if(!Hn)throw new Error("Documents not initialized. Call initDocuments first.");return Hn}function kl(){if(!Lo)throw new Error("Documents not initialized. Call initDocuments first.");return Lo}function Ap(e){Oo().commit(e)}async function Tp(e){const t=Oo();try{jr++,await t.commit(e,!0)}finally{jr--}}function kp(){return jr>0}function Lp(){jr++}function Op(){jr--}function xo(){return Hn!==null}var zn=null,Gt=void 0,Po=null;function xp(e){Po=e}function Pp(e){zn=e}function Np(e){if(Po){Po.setEditorFocus(e);return}if(zn&&zn.isEditorInFocus!==e){const t=e;e&&typeof Gt=="boolean"&&(xo()&&kl().saveChanges(Gt),Gt=void 0),zn.setFocus(t),!e&&typeof Gt=="boolean"&&(xo()&&kl().saveChanges(Gt),Gt=void 0)}}function Mp(e,t=window){return{peer:e,send(r){e.postMessage(r,"*")},subscribe(r){const n=i=>{r({data:i.data,source:i.source,ports:i.ports})};return t.addEventListener("message",n),{dispose:()=>t.removeEventListener("message",n)}},close(){}}}function Rp(e){let t=!1;return{peer:e,send(r){e.postMessage(r)},subscribe(r){const n=i=>{r({data:i.data,source:e})};return e.addEventListener("message",n),t||(t=!0,e.start()),{dispose:()=>e.removeEventListener("message",n)}},close(){e.close()}}}function jN(e){return e}function Dp(e){return e&&typeof e=="object"}function Ll(e,t){return e&&typeof e=="object"&&e.operationId===t}var Xe="INIT_MESSAGE",Ip="em:port-ready",Bp="em:window-drained",No="";function Ol(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var Fp=class extends Z{constructor(...e){super(...e),k(this,"_listeners",Object.create(null)),k(this,"addListenerAsync",(t,r,n=0,i)=>{const o=this._listeners[t]||(this._listeners[t]=[]);i&&typeof r=="function"&&(r=r.bind(i));const s=o.findIndex(([l,c])=>n<=c),a=[r,n];return this.isDisposed()||o.splice(s>=0?s:o.length,0,a),{dispose(){const l=o.indexOf(a);l>=0&&o.splice(l,1)}}}),k(this,"fireAsync",(t,r)=>{if(!this.isDisposed()){const n=this._listeners[t]||(this._listeners[t]=[]);let i;for(let o=0;o<n.length;o++){const s=n[o][0],a=i;i=l=>s(l,a)}if(i)return i(r)}}),k(this,"addListener",(t,r,n=0)=>this.addListenerAsync(t,(i,o)=>{try{r(i)}catch{}return o&&o(i)},n))}},jp=class extends Z{constructor(e,t){super(),k(this,"_singleton",void 0),k(this,"_target",void 0),k(this,"_transport",void 0),k(this,"_transportSubscription",void 0),k(this,"_ports",new Map),k(this,"_drained",new WeakSet),k(this,"_inited",!1),k(this,"_emitter",this.addDisposable(new Fp)),k(this,"_handshaken",new WeakSet),k(this,"_greeted",new WeakSet),k(this,"_outgoingFilter",void 0),k(this,"_onTransportMessage",r=>{const n=r,i=n.data,o=n.source,s=i?.port===!0?n.ports?.[0]:void 0,a=!this._isPortSource(n.source);if(a&&o&&i?.operationId==="em:window-drained"){this._drained.add(o);return}if(!(a&&o&&this._drained.has(o))){if(o&&o!==this._target&&this._greeted.has(o)&&Ll(i,Xe)){this._greeted.delete(o),this._handshaken.add(o),this._postMessage(o,{operationId:Xe,data:{}}),s&&this.usePort(s,!0,o);return}if(Dp(i)&&(n.source===this.target||this._isCurrentPort(n.source))||this._singleton&&Ll(i,Xe)){if(s){const d=this._target;Promise.resolve().then(()=>this.usePort(s,!0,d))}const l=this._emitter.fireAsync(i.operationId||No,i.operationId===void 0?n:i.data),c=i.result,u=i.error;c&&u&&Promise.resolve(l).then(d=>this._sendMessage(c,d),d=>this._sendMessage(u,d))}}}),this._singleton=t,this._transport=Mp({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(Xe,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(Xe))}),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(Xe,void 0);return}this._inited=!1,this._postMessage(e,{operationId:Xe,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:Xe,data:{},port:!0},[t])}setOutgoingFilter(e){return this._outgoingFilter=e,()=>{this._outgoingFilter===e&&(this._outgoingFilter=void 0)}}greet(e){this._handshaken.has(e)||this._greeted.has(e)||this._target===e||(this._greeted.add(e),this._postMessage(e,{operationId:Xe,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,r=this._target){if(!r||this._ports.has(r))return;const n=Rp(e),i=n.subscribe(this._onTransportMessage);this._ports.set(r,{transport:n,subscription:i}),t&&(n.send({operationId:Ip,data:{}}),this.drainWindow(r))}useWindow(e=this._target){e&&(this._closePort(e),this._drained.delete(e))}get usesPort(){return this._target!==void 0&&this._ports.has(this._target)}hasPort(e){return this._ports.has(e)}_closePort(e){const t=this._ports.get(e);t&&(t.subscription.dispose(),t.transport.close(),this._ports.delete(e))}drainWindow(e){this._ports.has(e)&&e.postMessage({operationId:Bp,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,r){let n=t;this._outgoingFilter&&!r?.length&&(n="data"in t?{...t,data:this._outgoingFilter(t.data)}:this._outgoingFilter(t));try{const i=this._ports.get(e);if(i){i.transport.send(n);return}if(r?.length){e.postMessage(n,"*",r);return}e.postMessage(n,"*")}catch(i){if(i?.name==="DataCloneError"){const o=typeof n?.data=="object"&&n?.data!==null?n.data:void 0}throw i}}_sendMessage(e,t,r=!0){if(!r&&!this.isInited())return;const n=this.addDisposable(this.onInit(i=>{const o=e?{operationId:e,data:t}:t;try{this._postMessage(i,{...o})}finally{n.dispose()}}))}send(e,t,r){return typeof e=="string"?this._sendMessage(e,t,r):this._sendMessage(No,e,t)}sendAsync(e,t,r=!0){if(!r&&!this.isInited())return Promise.resolve();const n=Ol(),i=Ol();return new Promise((o,s)=>{const a=this.addDisposable(new Z);a.addDisposable(this.onInit(l=>{try{this._postMessage(l,{operationId:e,data:t,result:n,error:i})}catch(c){a.dispose(),s(c);return}a.addDisposable(this._onMessage(n,c=>{o(c),a.dispose()})),a.addDisposable(this._onMessage(i,c=>{s(c),a.dispose()}))}))})}_onMessage(e,t,r=0){return this._emitter.addListener(e,t,r)}addListener(e,t,r){return t?this._onMessage(e,t,r):this._onMessage(No,e)}addListenerAsyncPipe(e,t,r=0){return this._emitter.addListenerAsync(e,t,r)}addListenerAsync(e,t,r=0){return this._emitter.addListenerAsync(e,async(n,i)=>{const o=await t(n);return i?i(n):o},r)}isInited(){return this._inited}get inited(){return this._inited}onInit(e,t=!0,r=0){const n=this.addDisposable(new Z);return this._inited&&this._target?t&&Promise.resolve().then(()=>{!this._inited||!this._target?n.addDisposable(this.onInit(e,t,r)):e(this._target)}):n.addDisposable(this._onMessage(Xe,()=>{e(this._target)},r)),n}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}},$p=/<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s[^<>]*)?\/?>/g;function Hp(e){return e.replace($p,t=>/^<br\b/i.test(t)?" ":"")}var zp="fonts.googleapis.com",Vp=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},Wp=e=>{const t=Vp(String(e??""));return t?t.hostname===zp&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},me={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_PREVIEW:"update_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_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_WINDOW_CHARACTERISTIC:"sandbox_window-characteristic",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_ADD_MERGETAG:"sandbox_add_mergetag",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"},Up=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")}),X=new jp(window.parent,!0);function xl(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function be(e,t,r=!1){for(const n of e.querySelectorAll(t))r||!n.childNodes.length?n.remove():n.replaceWith(...n.childNodes)}var Vn="em-element-list-ol",Wn="em-element-list-ul",qp="em-element-list-bullet",Gp=`.${Vn}, .${Wn}`,Xp=["DIV","P","TD","H1","H2","H3","H4","H5","H6"],Yp="div, p, td, h1, h2, h3, h4, h5, h6",Kp={LIST:"margin: 0; padding: 0 0 0 20px;",LIST_ITEM:"padding-bottom: 5px;"};function Qp(e,t,r){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(i=>{const o=i.querySelectorAll("td");if(o.length>1){const s=o[1],a=(s.getAttribute("style")||"").split(";").filter(u=>u.trim()!==""),l={};a.forEach(u=>{const[d,f]=u.split(":").map(h=>h.trim());l[d]=f}),l[t]=`${r}px`;const c=Object.entries(l).map(([u,d])=>`${u}: ${d}`).join("; ");s.setAttribute("style",c)}}),n.innerHTML}function Zp(e,t){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelector("td:first-child");if(i){const o=i.querySelector("div");o&&(o.innerHTML=t)}}),r.innerHTML}function Jp(e,t){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelector("td:first-child");if(i){const o=i.querySelector("div");if(o){const s=o.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);o.setAttribute("style",l.join("; "))}else o.setAttribute("style",s?`${s} color: ${t};`:`color: ${t};`)}}}),r.innerHTML}function eg(e,t){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelector("td:first-child");if(i){const o=i.querySelector("div");if(o){const s=o.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);o.setAttribute("style",l.join("; "))}else o.setAttribute("style",s?`${s} font-size: ${t}px;`:`font-size: ${t}px;`)}}}),r.innerHTML}function tg(e,t){if(typeof t!="boolean")throw new Error("Invalid isBold value: must be a boolean");const r=t?"bold":"normal",n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(i=>{const o=i.querySelector("td:first-child");if(o){const s=o.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: ${r};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-weight: ${r};`:`font-weight: ${r};`)}}}),n.innerHTML}function rg(e,t){if(typeof t!="boolean")throw new Error("Invalid isItalic value: must be a boolean");const r=t?"italic":"normal",n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(i=>{const o=i.querySelector("td:first-child");if(o){const s=o.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: ${r};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-style: ${r};`:`font-style: ${r};`)}}}),n.innerHTML}function ng(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldUnderline value: must be a boolean");const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelector("td:first-child");if(i){const o=i.querySelector("div");if(o){const s=o.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};`,o.setAttribute("style",a.join("; "))):o.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),r.innerHTML}function ig(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldStrikethrough value: must be a boolean");const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelector("td:first-child");if(i){const o=i.querySelector("div");if(o){const s=o.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};`,o.setAttribute("style",a.join("; "))):o.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),r.innerHTML}function og(e,t){if(!e)return!1;const r=e.closest("table");return r?r.classList.contains(t):!1}function sg(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 ag(e){if(!e||!(e instanceof Node))return null;const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:i=>i.nodeValue?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let r=null,n;for(;n=t.nextNode();)r=n;return r}function lg(e){if(!e||!(e instanceof HTMLElement))return"inside";const t=window.getSelection();if(!t||t.rangeCount===0)return"inside";const r=t.getRangeAt(0);if(!r.collapsed)return"inside";let{startContainer:n,startOffset:i}=r;if(n===e)return i===0?"start":i===e.childNodes.length?"end":"inside";const o=sg(e),s=ag(e);let a=n;return a&&a.nodeType===Node.ELEMENT_NODE&&(a=a.childNodes[0]),o&&a===o&&i===0?"start":s&&n===s&&(i===s?.nodeValue?.length||i===s?.nodeValue?.trim().length)?"end":"inside"}function Pl(e){const t=e.cloneNode(!0),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let n;for(;n=r.nextNode();)n.nodeValue="";return t}function Mo(e){let t="";for(const r of e.attributes)t+=` ${r.name}="${r.value}"`;return t}function cg(e,t){const r=e.closest(`table.${t}`);if(!r)return null;const n=r.querySelector("tbody"),i=n?n.innerHTML.trim():r.innerHTML.trim(),o=e.closest("tr");if(!o)return{rowHtml:i,firstCellText:"",secondCellText:"",firstCellHtmlNoText:"",secondCellHtmlNoText:"",secondCellWrapperHtml:"",secondCellInnerDivHtml:"",wrappedSecondCellHtml:"",secondCellInnerDivWrapperHtml:"",secondCellTextHTML:""};const s=o.querySelectorAll("td"),a=s[0]||null,l=s[1]||null,c=a?a.textContent.trim():"",u=l?l.textContent.trim():"",d=l?l.innerHTML.trim():"",f=a?Pl(a).outerHTML:"",h=l?Pl(l).outerHTML:"",g=l?`<td${Mo(l)}></td>`:"",y=l?l.querySelector("div"):null;return{rowHtml:i,firstCellText:c,secondCellText:u,firstCellHtmlNoText:f,secondCellHtmlNoText:h,secondCellWrapperHtml:g,secondCellInnerDivHtml:y?y.outerHTML:"",wrappedSecondCellHtml:l&&y?`<td${Mo(l)}>${y.outerHTML}</td>`:"",secondCellInnerDivWrapperHtml:y?`<div${Mo(y)}></div>`:"",secondCellTextHTML:d}}function Un(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function ug(e,t){const r=document.createElement("template");r.innerHTML=e;const n=r.content.firstElementChild;if(!n||n.tagName.toLowerCase()!=="td")return e;const i=n.querySelector("div");return i?i.textContent=Un(t)||" ":n.insertAdjacentText("afterbegin",Un(t)),n.outerHTML}function dg(e){const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("editor").forEach(r=>{r.replaceWith(...Array.from(r.childNodes))}),t.content.querySelectorAll('[em-edit="active"]').forEach(r=>{r.removeAttribute("em-edit")}),t.innerHTML}function fg(e){const t=window.getSelection();if(!t||!t.rangeCount)return null;const r=t.getRangeAt(0);if(!e.contains(r.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(r.startContainer,r.startOffset);const i=n.toString(),o=document.createRange();return o.selectNodeContents(e),o.setStart(r.startContainer,r.startOffset),{beforeCursorPosition:i,afterCursorPosition:o.toString()}}function hg(e,t){const r=document.createElement("template");return r.innerHTML=e,r.content.querySelectorAll(`div.${t}`).forEach(n=>{const i=n.closest("tr");i&&i.remove()}),r.innerHTML}function mg(e,t,r,n=!0){const i=document.createElement("template");i.innerHTML=e.trim();const o=i.content.querySelector(`div.${r}`);if(o){const s=o.closest("tr");if(s){const a=n?"beforebegin":"afterend";s.insertAdjacentHTML(a,t)}}return i.innerHTML}function pg(e){const t=/^(\s| )+|(\s| )+$/g,r=e.querySelectorAll("tr"),n=[];return r.forEach(i=>{const o=i.querySelectorAll("td");if(o.length>=2){const s=o[0].querySelector("div"),a=o[1].querySelector("div, editor"),l=s?s.textContent.trim():"";let c="";if(a)if(a.classList.contains("em-text")){const u=a.querySelector("div");c=u?u.innerHTML:""}else c=a.innerHTML;c=c.replace(t,""),n.push({cellOneText:l,cellTwoText:c})}}),n}function gg(e){let t=1;return e.map(r=>{if(r.cellOneText&&/^\d+\.$/.test(r.cellOneText.trim())){const i={...r,cellOneText:`${t}.`};return t++,i}if(!r.cellOneText||/^\s*$/.test(r.cellOneText))return{...r};const n={...r,cellOneText:`${t}.`};return t++,n})}function bg(e,t){if(typeof e!="string")return"";const r=document.createElement("template");r.innerHTML=e.toString().trim();const n=r.content.querySelector("table");return n?(n.querySelectorAll("tr").forEach((i,o)=>{if(o>=t.length)return;const s=i.querySelectorAll("td");if(s.length<2)return;const a=s[0].querySelector("div");a&&(a.textContent=Un(t[o].cellOneText));const l=s[1].querySelector("div");l&&(l.textContent=Un(t[o].cellTwoText))}),n.outerHTML):e}function yg(e){return e.map(t=>({...t,cellOneText:t.cellOneText===""?" ":t.cellOneText,cellTwoText:t.cellTwoText===""?" ":t.cellTwoText}))}function vg(e){if(!Array.isArray(e)||e.length===0)return e;const t=" ",r=e.map(i=>{if(!i.cellOneText)return i;let o=i.cellOneText.trim();return o.endsWith(t)||(o+=t),{...i,cellOneText:o}}),n=Math.max(...r.map(i=>i.cellOneText?i.cellOneText.length:0));return r.map(i=>{if(!i.cellOneText)return i;let o=i.cellOneText;for(;o.length<n;)o+=t;return{...i,cellOneText:o}})}function Eg(e,t,r,n){const i=new DOMParser().parseFromString(e,"text/html"),o=i.querySelector(`div.${t}`);if(!o)return e;const s=o.closest("tr");if(!s)return e;const a=n==="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(r)}}else o.classList.add(r);const l=i.querySelector("table");return l?l.outerHTML:e}function _g(e){const t=window.getSelection();if(!t||!t.rangeCount)return null;const r=t.getRangeAt(0);if(!e.contains(r.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(r.startContainer,r.startOffset);const i=n.cloneContents(),o=document.createRange();o.selectNodeContents(e),o.setStart(r.startContainer,r.startOffset);const s=o.cloneContents();function a(l){const c=document.createElement("div");return c.appendChild(l),c.childNodes.length===1&&c.firstChild.nodeType===Node.ELEMENT_NODE?c.firstChild.innerHTML:c.innerHTML}return{beforeHTML:a(i),afterHTML:a(s)}}function Sg(e,t,r,n){const i=e.closest(`table.${t}`)||e.closest(`table.${r}`);i&&i.querySelectorAll("tr").forEach(o=>{const s=o.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=" ",s.appendChild(l)}else a.forEach(l=>{let c=l.innerHTML.trim();!c||c.replace(n,"")===""?l.innerHTML=" ":(c=c.replace(n,""),c.endsWith(" ")||(c+=" "),c=c.replace(/ +$/," "),l.innerHTML=c)})})}function wg(e){const t=`<table><tbody><tr>${e}</tr></tbody></table>`,r=new DOMParser().parseFromString(t,"text/html"),n=r.querySelector("div");return n&&(n.classList.add("remove-new-editor-element"),n.innerHTML.trim()?n.innerHTML+=" ":n.innerHTML=" "),r.querySelector("td")?.outerHTML||""}function Cg(e,t){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(n=>{const i=n.querySelectorAll("td");if(i.length>1){const o=i[1],s=(o.getAttribute("class")||"").split(" ").map(l=>l.trim()).filter(l=>l!=="");s.includes(t)||s.push(t);const a=s.join(" ");o.setAttribute("class",a)}}),r.innerHTML}function ye(e){if(Ag(e))return Tg(e)?e.trim():kg(e)}var Nl={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},Ag=e=>typeof e=="string"&&e.trim()!=="",Tg=e=>Nl.HEX.test(e);function kg(e){const t=Nl.RGB.exec(e)?.groups;if(!t)return;const r=Lg(t);return xg(r)}var Lg=e=>({r:Ro(e.r),g:Ro(e.g),b:Ro(e.b),a:Og(e.a)}),Ro=e=>parseInt(e||"0",10),Og=e=>parseFloat(e||"1"),xg=e=>`#${Do(e.r)}${Do(e.g)}${Do(e.b)}`,Do=e=>e.toString(16).padStart(2,"0"),Pg=class extends Z{constructor(...e){super(...e),k(this,"_transforms",[]),k(this,"_byAttribute",new Map)}register(e){this._transforms.push(e);for(const t of e.attributes){const r=t.toLowerCase(),n=this._byAttribute.get(r);n?n.push(e):this._byAttribute.set(r,[e])}return{dispose:()=>this._remove(e)}}_remove(e){const t=this._transforms.indexOf(e);if(t!==-1){this._transforms.splice(t,1);for(const r of e.attributes){const n=r.toLowerCase(),i=this._byAttribute.get(n);if(!i)continue;const o=i.indexOf(e);o!==-1&&i.splice(o,1),i.length||this._byAttribute.delete(n)}}}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,r){const n=this._byAttribute.get(r.attribute.toLowerCase());if(!n?.length)return t;const i=e==="render"?n:[...n].reverse();let o=t;for(const s of i){if(o===null)break;const a=e==="render"?s.render?.(o,r):s.serialize?.(o,r);a!==void 0&&(o=a)}return o}dispose(){this._transforms.length=0,this._byAttribute.clear(),super.dispose()}},$r;function Ng(e){const t=$r;return $r=e,{dispose:()=>{$r===e&&($r=t)}}}function Io(){return $r}var qn=new WeakMap;function Mg(e,t,r){const n=qn.get(e);n?n.set(t.toLowerCase(),r):qn.set(e,new Map([[t.toLowerCase(),r]]))}function Rg(e,t){const r=qn.get(e);r?.size&&qn.set(t,new Map(r))}function Ml(e,t,r){const n=e.tagName.toLowerCase();for(const i of t.attributes){if(!e.hasAttribute(i))continue;const o=e.getAttribute(i)??"",s=t.serialize(o,{element:e,tag:n,attribute:i,stage:r});s===null?e.removeAttribute(i):s!==o&&e.setAttribute(i,s)}}function Bo(e,t={}){const r=t.pipeline??Io(),n=t.stage??"build";let i=e;if(t.clone&&(i=e.cloneNode(!0),r&&!r.isEmpty&&Rl(e,i)),!r||r.isEmpty)return i;i instanceof Element&&Ml(i,r,n);const o=i.querySelectorAll?.("*");if(o)for(const s of o)Ml(s,r,n);return i}function Dg(e,t={}){const r=t.pipeline??Io();return!r||r.isEmpty?e.outerHTML:Bo(e,{...t,pipeline:r,clone:!0}).outerHTML}function Rl(e,t){Rg(e,t);const r=e.childNodes,n=t.childNodes;for(let i=0;i<r.length&&i<n.length;i++)Rl(r[i],n[i])}function Fo(e,t,r,n={}){const i=jo(e,t,r,{stage:"settings",...n});i===null?e.removeAttribute(t):e.setAttribute(t,i)}function jo(e,t,r,n={}){const i=n.pipeline??Io();if(!i||!i.handles(t))return r;const o=e?.tagName.toLowerCase()??"",s=i.render(r,{element:e,tag:o,attribute:t,stage:n.stage??"build"});if(s!==r){const a=n.owner??e;a&&Mg(a,t,r)}return s}var Dl=class{constructor(e){k(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},Ce=(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})({}),Ig=class{constructor(e,t){k(this,"source",void 0),k(this,"len",void 0),k(this,"position",void 0),this.source=e,this.len=e.length,this.position=t}eos(){return this.len<=this.position}getSource(){return this.source}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}goToEnd(){this.position=this.source.length}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)?(this.position++,!0):!1}advanceIfChars(e){let t;if(this.position+e.length>this.source.length)return!1;for(t=0;t<e.length;t++)if(this.source.charCodeAt(this.position+t)!==e[t])return!1;return this.advance(t),!0}advanceIfRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index+t[0].length,t[0]):""}advanceUntilRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index,t[0]):(this.goToEnd(),"")}advanceUntilChar(e){for(;this.position<this.source.length;){if(this.source.charCodeAt(this.position)===e)return!0;this.advance(1)}return!1}advanceUntilChars(e){for(;this.position+e.length<=this.source.length;){let t=0;for(;t<e.length&&this.source.charCodeAt(this.position+t)===e[t];t++);if(t===e.length)return!0;this.advance(1)}return this.goToEnd(),!1}skipWhitespace(){return this.advanceWhileChar(e=>e===Vg||e===Wg||e===$g||e===zg||e===Hg)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},Il=33,Xt=45,Gn=60,Ye=62,$o=47,Bg=61,Fg=34,jg=39,$g=10,Hg=13,zg=12,Vg=32,Wg=9,Ug={"text/x-handlebars-template":!0,"text/html":!0};function qg(e,t=0,r=0,n=!1){const i=new Ig(e,t);let o=r,s=0,a=18,l,c,u,d,f;function h(){return i.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function g(){return i.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function y(C,O,E){return a=O,s=C,l=E,O}function A(){const C=i.pos(),O=o,E=L();return E!==21&&C===i.pos()&&!(n&&(E===4||E===8))?(i.advance(1),y(C,18)):E}function L(){const C=i.pos();if(i.eos())return y(C,21);let O;switch(o){case 6:return i.advanceIfChars([Xt,Xt,Ye])?(o=0,y(C,2)):(i.advanceUntilChars([Xt,Xt,Ye]),y(C,1));case 3:return i.advanceIfChar(Ye)?(o=0,y(C,15)):(i.advanceUntilChar(Ye),y(C,14));case 0:if(i.advanceIfChar(Gn)){if(!i.eos()&&i.peekChar()===Il){if(i.advanceIfChars([Il,Xt,Xt]))return o=6,y(C,0);if(i.advanceIfRegExp(/^!doctype/i))return o=3,y(C,13)}return i.advanceIfChar($o)?(o=2,y(C,7)):(o=1,y(C,3))}return i.advanceUntilChar(Gn),y(C,16);case 2:return h().length>0?(o=5,y(C,9)):i.skipWhitespace()?y(C,17,"Tag name must directly follow the open bracket."):(o=5,i.advanceUntilChar(Ye),C<i.pos()?y(C,18,"End tag name expected."):L());case 5:if(i.skipWhitespace())return y(C,17);if(i.advanceIfChar(Ye))return o=0,y(C,8);if(n&&i.peekChar()===Gn)return o=0,y(C,8,"Closing bracket missing.");O="Closing bracket expected.";break;case 1:return u=h(),f=void 0,d=void 0,u.length>0?(c=!1,o=4,y(C,6)):i.skipWhitespace()?y(C,17,"Tag name must directly follow the open bracket."):(o=4,i.advanceUntilChar(Ye),C<i.pos()?y(C,18,"Start tag name expected."):L());case 4:return i.skipWhitespace()?(c=!0,y(C,17)):c&&(d=g(),d.length>0)?(o=9,c=!1,y(C,11)):i.advanceIfChars([$o,Ye])?(o=0,y(C,5)):i.advanceIfChar(Ye)?(u==="script"?f&&Ug[f]?o=0:o=7:u==="style"?o=8:o=0,y(C,4)):n&&i.peekChar()===Gn?(o=0,y(C,4,"Closing bracket missing.")):(i.advance(1),y(C,18,"Unexpected character in tag."));case 9:return i.skipWhitespace()?(c=!0,y(C,17)):i.advanceIfChar(Bg)?(o=10,y(C,10)):(o=4,L());case 10:if(i.skipWhitespace())return y(C,17);let E=i.advanceIfRegExp(/^[^\s"'`=<>]+/);if(E.length>0)return i.peekChar()===Ye&&i.peekChar(-1)===$o&&(i.goBack(1),E=E.substr(0,E.length-1)),d==="type"&&(f=E),o=4,c=!1,y(C,12);const m=i.peekChar();return m===jg||m===Fg?(i.advance(1),i.advanceUntilChar(m)&&i.advance(1),d==="type"&&(f=i.getSource().substring(C+1,i.pos()-1)),o=4,c=!1,y(C,12)):(o=4,c=!1,L());case 7:let b=1;for(;!i.eos();){const S=i.advanceIfRegExp(/<!--|-->|<\/?script\s*\/?>?/i);if(S.length===0)return i.goToEnd(),y(C,19);if(S==="<!--")b===1&&(b=2);else if(S==="-->")b=1;else if(S[1]!=="/")b===2&&(b=3);else if(b===3)b=2;else{i.goBack(S.length);break}}return o=0,C<i.pos()?y(C,19):L();case 8:return i.advanceUntilRegExp(/<\/style/i),o=0,C<i.pos()?y(C,20):L()}return i.advance(1),o=0,y(C,18,O)}return{scan:A,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>i.pos()-s,getTokenEnd:()=>i.pos(),getTokenText:()=>i.getSource().substring(s,i.pos()),getScannerState:()=>o,getTokenError:()=>l}}function Gg(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function Xg(e,t){const r=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+r.length,r}function Yg(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function Kg(e,t){const r=`<!--${e.content}-->`;return e.start=t,e.startTagEnd=t+4,e.end=t+r.length,e.endTagStart=e.end-3,r}var Ho=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function Qg(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,r)=>r.toUpperCase())}var Bl=Object.create(null);function Zg(e,t){const r=Bl[e]||(Bl[e]=Object.create(null));let n=r[t];if(typeof n!="boolean"){const i=document.createElement(e)[Qg(t)];n=r[t]=typeof i<"u"&&typeof i!="boolean"}return n}function zo(e,t){if(e.start===e.end||t)return"";switch(e.type){case I.ELEMENT:return Wo(e,t);case I.ROOT:return[...e.children].map(r=>zo(r,t)).join("");case I.DOCTYPE:return Gg(e,t);case I.COMMENT:return Yg(e,t);default:return e.content||""}}function Vo(e,t=0){if(e.start===e.end)return"";switch(e.type){case I.ELEMENT:return eb(e,t);case I.ROOT:return jl(e,t);case I.DOCTYPE:return Xg(e,t);case I.COMMENT:return Kg(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function Fl(e){const t=e.tag?.toLowerCase();let r="";if(t){const n=e.attributes;if(n){const i=Object.keys(n);for(const o of i){const s=n[o]===null?"":n[o];typeof s=="string"&&(r+=s===""&&o!=="em"&&!Zg(t,o)?` ${o}`:` ${o}="${s.replaceAll('"',"'")}"`)}}}return r}function Jg(e,t){let r="";if(e.startTagEnd!==e.endTagStart||t)for(const n of e.children)r+=zo(n);return r}function jl(e,t){let r="";if(e.startTagEnd!==e.endTagStart)for(const n of e.children)r+=Vo(n,t+r.length);return r}function $l(e,t){if(e.start!==e.startTagEnd||t){const r=e.tag?.toLowerCase()||"div",n=Fl(e);return r==="vk-snippet-end"?`<${r}${n}/>`:`<${r}${n}>`}return""}function Hl(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function Wo(e,t,r=!0){const n=e.tag?.toLowerCase()||"div",i=$l(e,t);if(Ho.has(n))return i;{const o=Hl(e,t);return`${i}${r?Jg(e,t):""}${o}`}}function eb(e,t){const r=e.tag?.toLowerCase()||"div",n=$l(e);if(e.start=t,e.startTagEnd=t+n.length,Ho.has(r)){e.endTagStart=e.startTagEnd,e.end=e.startTagEnd;const i=o=>{for(const s of o.children)s.start=s.startTagEnd=s.endTagStart=s.end=o.end,i(s)};return i(e),n}else{const i=jl(e,e.startTagEnd);e.endTagStart=e.startTagEnd+i.length;const o=Hl(e);return e.end=e.endTagStart+o.length,`${n}${i}${o}`}}function Uo(e,t){let r=0,n=e.length;if(n===0)return 0;for(;r<n;){const i=Math.floor((r+n)/2);t(e[i])?n=i:r=i+1}return r}var I=(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})({}),Xn=e=>e.type===0?e.start-1:e.start,tb=e=>e.type===0?e.end+1:e.end,Oe=class Vm{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,r,n,i){k(this,"start",void 0),k(this,"end",void 0),k(this,"children",void 0),k(this,"parent",void 0),k(this,"content",void 0),k(this,"type",1),k(this,"tag",void 0),k(this,"closed",!1),k(this,"startTagEnd",void 0),k(this,"endTagStart",void 0),k(this,"attributes",void 0),k(this,"createdBy",void 0),k(this,"isDirty",void 0),this.start=t,this.end=r,this.children=n,this.parent=i}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 r=Uo(this.children,n=>t<=Xn(n))-1;if(r>=0){const n=this.children[r];if(t>Xn(n)){if(t<n.end)return n.findNodeBefore(t);const i=n.lastChild;return i&&i.end===n.end?n.findNodeBefore(t):n}}return this}findNodeAt(t){const r=Uo(this.children,n=>t<=Xn(n))-1;if(r>=0){const n=this.children[r];if(t>=Xn(n)&&t<=tb(n))return n.findNodeAt(t)}return this}find(t){if(t(this))return this;for(const r of this.children){const n=r.find(t);if(n)return n}}closest(t){let r=this;do if(t(r))return r;while(r=r.parent)}parents(){return this.parent?[this.parent,...this.parent.parents()]:[]}closestFromRoot(t,r=!0){const n=r?[this,...this.parents()]:this.parents();for(let i=n.length-1;i>=0;i--){const o=n[i];if(t(o))return o}}contains(t){return!!t.closest(r=>r===this)}clone(t=this.parent,r=this.start,n=!0){const i=this.start-r,o=new Vm(r,this.end-i,[],t);return o.children=n?this.children.map(s=>s.clone(o,s.start-i)):[],o.attributes={...this.attributes},o.closed=this.closed,o.content=this.content,o.startTagEnd=this.startTagEnd,o.endTagStart=this.endTagStart,o.tag=this.tag,o.type=this.type,o}};function rb(e){if(typeof e=="string"){const t=e.startsWith("'")||e.startsWith('"')?1:0,r=e.endsWith("'")||e.endsWith('"')?e.length-1:e.length;return e.substring(t,r)}return e}var zl=class{constructor(e,t){k(this,"text",void 0),k(this,"type",void 0),k(this,"node",void 0),k(this,"replaces",void 0),this.text=e,this.type=t}get hasNode(){return!!this.node}addReplace(e){this.replaces?.push(e)}start(e,t,r){if(!this.node){const n=this.node=new Oe(e,this.text.length,[],r);n.type=this.type,n.startTagEnd=t,this.replaces=[]}}finish(e,t){const r=this.replaces,n=this.node,i=e+(t||0);if(r){for(const o of r){const s=o.parent;if(!s)throw new Error("parent not defined");const a=s.children.indexOf(o);s.children.splice(a,1)}this.replaces=void 0}if(n){const o=n.parent;if(!o)throw new Error("parent not defined");o.children.push(n),n.closed=t!==void 0,n.endTagStart=e,n.end=i,n.content=this.text.substring(n.startTagEnd,e),this.node=void 0}}},Vl=class{constructor(e){k(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const r=qg(e,void 0,void 0,!0),n=new Oe(0,e.length,[],void 0);n.type=I.ROOT;let i=n,o=-1,s,a=null,l=r.scan();const c=()=>{if(!i.tag){const g=i.parent.children,y=g[g.length-2],A=e.substring(i.start,i.end);y?.type===I.HTML?(y.content=(y.content||"")+A,y.end=i.end,g.splice(g.length-1,1)):(i.type=I.HTML,i.content=A,i.children=[]),i.type=I.HTML}i=i.parent},u=new zl(e,I.COMMENT),d=new zl(e,I.DOCTYPE),f=g=>{i.children.push(g)};for(;l!==Ce.EOS;){switch(l){case Ce.StartDoctypeTag:d.start(r.getTokenOffset(),r.getTokenEnd(),i);break;case Ce.EndDoctypeTag:{const C=i.lastChild,O=d.node;if(!O)throw new Error("");const E=C?C.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(E!==O.start){const m=e.substring(E,O.start);if(m){const b=new Oe(E,O.start,[],i);b.type=I.HTML,b.content=m,f(b)}}d.finish(r.getTokenOffset(),r.getTokenLength());break}case Ce.StartCommentTag:u.start(r.getTokenOffset(),r.getTokenEnd(),i);break;case Ce.EndCommentTag:{const C=i.lastChild,O=u.node;if(!O)throw new Error("");const E=C?C.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(E!==O.start){const m=e.substring(E,O.start);if(m){const b=new Oe(E,O.start,[],i);b.type=I.HTML,b.content=m,f(b)}}u.finish(r.getTokenOffset(),r.getTokenLength());break}case Ce.StartTagOpen:const g=i.lastChild,y=new Oe(r.getTokenOffset(),e.length,[],i),A=g?g.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(A!==y.start){const C=e.substring(A,y.start);if(C){const O=new Oe(A,y.start,[],i);O.type=I.HTML,O.content=C,f(O)}}f(y),i=y;break;case Ce.StartTag:i.tag=r.getTokenText();break;case Ce.StartTagClose:i.parent&&(i.end=r.getTokenEnd(),r.getTokenLength()?(i.startTagEnd=r.getTokenEnd(),i.tag&&this.dataManager.isVoidElement(i.tag)&&(i.closed=!0,c())):c());break;case Ce.StartTagSelfClose:i.parent&&(i.closed=!0,i.end=r.getTokenEnd(),i.startTagEnd=r.getTokenEnd(),c());break;case Ce.EndTagOpen:o=r.getTokenOffset(),s=void 0;break;case Ce.EndTag:s=r.getTokenText().toLowerCase();break;case Ce.EndTagClose:let L=i;for(;!L.isSameTag(s)&&L.parent;)L=L.parent;if(L.parent){const C=i.lastChild,O=C?C.end:i.startTagEnd===void 0?i.start:i.startTagEnd;if(O!==o){const E=e.substring(O,o);if(E){const m=new Oe(O,o,[],i);m.type=I.HTML,m.content=E,f(m)}}for(;i!==L;)i.end=o,i.closed=!1,c();i.closed=!0,i.endTagStart=o,i.end=r.getTokenEnd(),c()}break;case Ce.AttributeName:{a=r.getTokenText();let C=i.attributes;C||(i.attributes=C={}),C[a]=null;break}case Ce.AttributeValue:{const C=r.getTokenText(),O=i.attributes;O&&a&&(O[a]=rb(C),a=null);break}}l=r.scan()}for(;i.parent;)i.end=e.length,i.closed=!1,c();u.hasNode,u.finish(e.length);const h=n.lastChild?.end||0;if(h<e.length){const g=e.substring(h);if(g){const y=new Oe(h,e.length,[],n);y.type=I.HTML,y.content=g,f(y)}}return{roots:n.children,findNodeBefore:n.findNodeBefore.bind(n),findNodeAt:n.findNodeAt.bind(n)}}},$N=new Vl(new Dl(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),nb=new Dl(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),ib=new Vl(nb);function Yt(e){return ib.parse(e)}function qo(e){if(e){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",e),t.firstChild||document.createTextNode("")}else return document.createTextNode("")}var Kt,Tt;function ob(e){const t=Kt;return Kt=e,()=>{Kt===e&&(Kt=t)}}function sb(e){const t=Tt;return Tt=e,()=>{Tt===e&&(Tt=t)}}function Wl(e,t,r){return Kt?Kt(e,t,r):r}function ab(){return Tt!==void 0}function Ul(e,t,r){return Tt?Tt(e,t,r):r}var Go;function lb(){return Go||(Go=document.implementation.createHTMLDocument("")),Go}function cb(e,t){let r;switch(t?.toLowerCase()){case"tr":r=e.createElement("table");break;case"td":r=e.createElement("tr");break;case"head":case"body":r=e.createElement("html");break;case"documenttype":case"html":{const n=e.implementation.createHTMLDocument();for(const i of[...n.childNodes])i.remove();return n}default:r=e.createElement("div")}return r}var ub=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),db=new Set(["script","style","xmp"]);function fb(e,t){return!(t&&db.has(t.toLowerCase())||ub.has(e.toLowerCase()))}var hb=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1};function ql(e,t,r){let n=e.tagName.toLowerCase();n==="html"&&(n="div");const i=`<${n} ${t}="${r}"/>`,o=cb(lb(),n);if(o instanceof Document)return;o.innerHTML=i;const s=o.querySelector(n);if(!s)throw new Error("targetElement is not defined");const a=s.getAttributeNode(t);a&&e.setAttributeNode(a.cloneNode())}function st(e,t,r){try{fb(t,e.tagName)&&!hb(r)?e.setAttribute(t,r):ql(e,t,r)}catch{ql(e,t,r)}}function Yn(e,t=!0){const r=e.content;switch(e.type){case I.ROOT:{const n=document.implementation.createHTMLDocument();for(const i of[...n.childNodes])n.removeChild(i);if(t)for(const i of e.children)n.appendChild(Yn(i));return n}case I.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case I.COMMENT:return document.createComment(r||"");case I.ELEMENT:if(e.tag){const n=document.createElement(e.tag);if(Object.defineProperty(n,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const i of e.attributeNames){const o=e.attributes[i];try{const s=Wl(n,i,typeof o=="string"?o:"");s!==null&&st(n,i,s)}catch{}}if(t)for(const i of e.children)n.appendChild(Yn(i));return n}return document.createTextNode("<");case I.HTML:return qo(r||"");default:throw new Error("unsupported node")}}function xe(e){return Yt(e).roots.map(t=>Yn(t))}function Gl(e,t,r){const n=xe(r);switch(t){case"afterend":e.after(...n);break;case"afterbegin":e.prepend(...n);break;case"beforeend":e.append(...n);break;case"beforebegin":e.before(...n)}}function $e(e,t){e.remove?.(t)}var Xo=ge("SandboxHtmlDocument"),Yo=ge("SandboxRemoteDocument"),Ko=ge("SandboxTextDocument"),Qo=ge("SandboxDocumentMapping"),Xl=ge("SandboxSyncCommit"),Yl=ge("SandboxLayoutProfile"),mb=ge("SandboxState"),Kl=ge("SandboxAttributePipeline"),Ql=ge("SandboxAmpService"),Zl=ge("SandboxImageReload"),Zo=ge("SandboxImageCache"),Jl=ge("SandboxFocus");function pb(e){const t=new Pg,r=Ng(t),n=ob((o,s,a)=>t.isEmpty?a:jo(o,s,a,{pipeline:t})),i=sb((o,s,a)=>t.isEmpty?a:t.serialize(a,{element:o,tag:o.tagName.toLowerCase(),attribute:s,stage:"apply"}));return e.inject(Kl,t),{pipeline:t,dispose(){i(),n(),r.dispose(),t.dispose(),$e(e,Kl)}}}function gb(e,t){if(!e)return;const{minify:r,cssbeautify:n,HTMLDocument:i}=t;let o=document.head.querySelector('style[em="styles"]'),s="";o?s=i.getInnerHtml(o):(o=document.createElement("style"),o.setAttribute("em","styles"),o=document.head.insertAdjacentElement("beforeend",o));const a=document.createElement("div");a.insertAdjacentHTML("afterbegin",e);let l=r(s+`
|
|
2
2
|
`+[...a.querySelectorAll("style")].map(c=>c.innerHTML).join(`
|
|
3
3
|
`),{restructure:!0,forceMediaMerge:!0}).css;l=n(l,{indent:" ",autosemicolon:!0}),o.textContent=`
|
|
4
4
|
`+l+`
|
|
@@ -82,4 +82,4 @@ ${i.join("")}
|
|
|
82
82
|
`+Se(r)+`
|
|
83
83
|
`),t()},i.src=n.getAttribute("src")||"",!1}function XP(e){const t=e.blockHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");t.replaceChildren(...xe(e.blockHTML));const r=t.querySelector("img.em-countdown");if(!r)return Se(t);const n=r.getAttribute("em-cd-settings")||"",i=e.project==="useblocks"?"https://cdt3.useblocks.io/rndt?":"https://cdt3.emcdn.ru/rndt?",o=new URL(i+n),s=new Date;return o.searchParams.set("time",new Date(+s+432e6).toISOString()),Fo(r,"src",o.href),r.setAttribute("em-cd-settings",o.search.substring(1)),Se(t)}function YP(e){const t=e.blockIsTr?document.createElement("table"):document.createElement("div");return t.replaceChildren(...xe(e.blockHTML)),document.querySelector(".noresp-em-narrow-table")?t.querySelectorAll('[class^="em-mob-"], [class*=" em-mob-"]').forEach(r=>{r.className=r.className.split(" ").map(n=>n.startsWith("em-mob-")?"noresp-"+n:n).join(" ")}):t.querySelectorAll('[class^="noresp-"], [class*=" noresp-"]').forEach(r=>{r.className=r.className.split(" ").map(n=>n.startsWith("noresp-")?n.substring(7):n).join(" ")}),cl(t),Se(t)}function KP(e,t){const r=t.getOuterHtml(e),n=document.createElement("html").appendChild(document.createElement("body"));let i;e.tagName==="TR"?i=document.createElement("table"):i=document.createElement("div"),document.querySelectorAll("style").forEach(a=>{const l=t.getOuterHtml(a);l&&i.insertAdjacentHTML("beforeend",l)}),i.insertAdjacentHTML("beforeend",`
|
|
84
84
|
`);const o=xe(r)[0];if(!o)return null;o.querySelectorAll("style").forEach(a=>{a.remove()}),o.classList.remove("em-structure"),o.querySelectorAll(".em-structure").forEach(a=>a.classList.remove("em-structure")),i.appendChild(o),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}"]`;!i.querySelector(c)&&document.querySelector(c)&&(i.insertAdjacentHTML("afterbegin",`
|
|
85
|
-
`),i.prepend(document.querySelector(c).cloneNode(!0)))}}),n.append(i),mh(n,[...n.querySelectorAll("style")],{forceMediaMerge:!0});let s=Nt(n);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 QP(e,t){const{HTMLDocument:r,messageService:n}=t,i=e.closest('[em="block"]');if(!i)return;const o=KP(i,r);if(!o)return;DL(i);const s=i.getAttribute("em-block-id"),a=i.getAttribute("em-block-version");n.send({operation:"application_eblock_add",data:pn({html:o.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function ZP(e){const t=document.querySelector(".em-element-editor:not(.of-atom)");if(!t)return;const r=(t.closest('[em="block"]')||t.closest('[em="group"]'))?.getBoundingClientRect().top||0;if(e.scrollTop>r+55){const n=e.scrollTop-r;t.style.top=n+8+"px"}else t.style.removeProperty("top")}function JP(e){const t=document.querySelector(".em-element-editor");if(!t)return;const r=t.getBoundingClientRect(),n=document.querySelector(".em-element-editor-widget");n&&(r.top<0?n.classList.add("sticky"):n.classList.remove("sticky"),r.top+t.offsetHeight-10-n.offsetHeight<0&&n.classList.remove("sticky"),e(!1))}function Im(){return _e.get("emailWidth")}function eN(e){const t=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let r=0;r<t.length;r++){const n=t[r];if(n.classList.contains("em-insert-ignore"))continue;const i=n.getAttribute("width");if(i!=null&&i!=="")return!0}return!1}function tN(e,t){const r=Im(),n=document.createElement("table");n.replaceChildren(...xe(e.blockHTML));let i=660;if(e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){i=0;const a=n.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(document.body.clientWidth>(r||a))i=e.targetBlock.clientWidth;else{const l=e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(l&&l.parentElement){l.parentElement.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").forEach(f=>{i+=parseFloat(f.getAttribute("width")||"0")});const c=l.parentElement.closest("td"),u=parseFloat(c?.style.paddingLeft||"0")||0,d=parseFloat(c?.style.paddingRight||"0")||0;i+=u,i+=d}}}else if(e.targetBlock.closest(".container-td"))i=parseInt(String(e.targetBlock.offsetWidth));else{const a=e.targetBlock.querySelector('table[style*="max-width"]'),l=e.targetBlock.querySelector('div[style*="max-width"]'),c=e.targetBlock.querySelector('.row-content[style*="width"]');a?i=parseInt(String(a.offsetWidth)):l?i=parseInt(String(l.offsetWidth)):c?i=parseInt(String(c.offsetWidth)):i=e.targetBlock.style.maxWidth?parseFloat(e.targetBlock.style.maxWidth):e.targetBlock.getBoundingClientRect().width}let o=n.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){o=0;const a=n.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}}if(n.querySelector('div[style*="inline-block"]')){if(i<660&&n.querySelector('div[style*="inline-block"]'))if(n.querySelectorAll('div[style*="inline-block"]').length>1)n.querySelectorAll('div[style*="inline-block"]').forEach(a=>{const l=a,c=parseFloat(l.style.width),u=c/o,d=a.firstElementChild;if(!d)return;const f=c-parseFloat(d.getAttribute("width")||"0"),h=parseFloat(String(i*u));l.style.width=h+"px",d.setAttribute("width",String(h-f)),Fr({elem:l,width:h})});else{const a=n.querySelector('div[style*="inline-block"]');a.style.maxWidth=i+"px",Fr({elem:a,width:i}),a.firstElementChild&&(a.firstElementChild.setAttribute("width",String(Math.round(i*.91))),a.firstElementChild.style.maxWidth=Math.round(i*.91)+"px")}}else if(n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){const a=[];n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(function(l){const c=Sl(l);c&&a.indexOf(c)===-1&&a.push(c)}),a.forEach(l=>{const c=l.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(!c||!c.parentElement)return;const u=c.parentElement.closest("td"),d=parseFloat(u?.style.paddingLeft||"0")||0,f=parseFloat(u?.style.paddingRight||"0")||0;if(l.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length>1){if(!eN(l))return;const h=l.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),g=h?parseFloat(h.getAttribute("width")||"0"):0,y=l.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").length;let A=0,L=0;l.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(E=>{if(E.getAttribute("width")&&!E.classList.contains("em-insert-ignore")){const m=parseFloat(E.getAttribute("width"))/o,b=Math.round(parseFloat(String(i*m))-g/(y*2));E.setAttribute("width",String(b)),A+=b}});const C=i-(d+f+g*(y-1)+A);l.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(E=>{if(E.getAttribute("width")&&!E.classList.contains("em-insert-ignore")){const m=parseFloat(E.getAttribute("width"))+Math.round(C/y);L+=m,E.setAttribute("width",String(m)),E.querySelector("img")&&E.querySelectorAll("img").forEach(b=>{parseFloat(b.getAttribute("width")||"0")>parseFloat(E.getAttribute("width"))+Math.round(C/y)&&(b.setAttribute("width",E.getAttribute("width")),b.style.maxWidth=E.getAttribute("width")+"px")})}}),L=L+g*(y-1)+d+f;const O=i-L;if(O!==0&&A>0){const E=l.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(E&&!E.classList.contains("em-insert-ignore")){const m=parseFloat(E.getAttribute("width")||"0");E.setAttribute("width",String(m+O))}else{const m=l.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let b=m.length-1;b>=0;b--){const S=m[b];if(S.classList.contains("em-insert-ignore"))continue;const p=parseFloat(S.getAttribute("width")||"0");S.setAttribute("width",String(p+O));break}}}}else if(c.getAttribute("width")&&!c.classList.contains("em-insert-ignore")){const h=Math.round(i-d-f);c.setAttribute("width",String(h))}})}const s=n.querySelector("tr");return s?Nt(s):Se(n)}function rN(e,t){const r=Im(),n=document.createElement("table");n.replaceChildren(...xe(e.blockHTML));let i=660;const o=e.targetBlock.tagName==="TR"?document.createElement("table"):document.createElement("div");if(o.style.width=r+"px",o.style.height="1000px",o.style.borderCollapse="collapse",o.setAttribute("cellpadding","0"),o.setAttribute("cellspacing","0"),o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",document.body.appendChild(o),o.innerHTML=t.getOuterHtml(e.targetBlock),r)i=r;else{const l=o.querySelector('table[style*="max-width"]'),c=o.querySelector('div[style*="max-width"]'),u=o.querySelector('.row-content[style*="width"]');if(l)i=parseInt(String(l.offsetWidth));else if(c)i=parseInt(String(c.offsetWidth));else if(u)i=parseInt(String(u.offsetWidth));else{const d=o.querySelector(e.targetBlock.tagName);i=d?.style.maxWidth?parseFloat(d.style.maxWidth):d?.getBoundingClientRect().width||660}}document.body.removeChild(o);const s=n.querySelector("table:first-child");s?.style.maxWidth&&(s.style.maxWidth=i+"px",Fr({elem:s,width:i}));const a=n.querySelector("tr");return a?Nt(a):Se(n)}function ul(e){const t=e.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap");if(!t.length)return;const r=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),n=Array.from(r).filter(u=>!u.classList.contains("em-insert-ignore")&&u.getAttribute("width")!=null&&u.getAttribute("width")!=="");if(n.length===0)return;const i=e.parentElement?.getBoundingClientRect().width||0;let o=0,s=0;t.forEach(u=>{o+=parseFloat(u.getAttribute("width")||"0")});let a=e.querySelector(".em-mob-wrap");for(;a&&a!==e.parentElement?.parentElement;){const u=window.getComputedStyle(a),d=parseFloat(u.paddingLeft)||0,f=parseFloat(u.paddingRight)||0;(d>0||f>0)&&(s+=d+f),a=a.parentElement}const l=i-(o+s),c=n.length;n.forEach(u=>{const d=parseFloat(u.getAttribute("width")||"0")+Math.ceil(l/c);u.setAttribute("width",String(d))})}function nN(e){const t={all:null,top:null,right:null,bottom:null,left:null},r={all:null,top:null,right:null,bottom:null,left:null},n=ts({elem:e}),i=n.mobileWidth,o=n.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),(n.mobilePadding.all!==null||n.mobilePadding.top!==null||n.mobilePadding.right!==null||n.mobilePadding.bottom!==null||n.mobilePadding.left!==null)&&(n.mobilePadding.all?!n.mobilePadding.all&&n.mobilePadding.top&&n.mobilePadding.right&&n.mobilePadding.bottom&&n.mobilePadding.left&&n.mobilePadding.top===n.mobilePadding.right&&n.mobilePadding.right===n.mobilePadding.bottom&&n.mobilePadding.bottom===n.mobilePadding.left?r.all=parseFloat(String(n.mobilePadding.top)):r.all=n.mobilePadding.all!==null?parseFloat(String(n.mobilePadding.all)):null:r.all=null,r.top=n.mobilePadding.top!==null?parseFloat(String(n.mobilePadding.top)):n.mobilePadding.all===null?null:n.mobilePadding.all,r.right=n.mobilePadding.right!==null?parseFloat(String(n.mobilePadding.right)):n.mobilePadding.all===null?null:n.mobilePadding.all,r.bottom=n.mobilePadding.bottom!==null?parseFloat(String(n.mobilePadding.bottom)):n.mobilePadding.all===null?null:n.mobilePadding.all,r.left=n.mobilePadding.left!==null?parseFloat(String(n.mobilePadding.left)):n.mobilePadding.all===null?null:n.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:rc(e),backgroundColor:e.style.backgroundColor?ye(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:tc(e),boxShadow:nc(e),mobileWidth:{value:i!==null?i:null,dim:n.mobileWidthDim},mobileHeight:{value:o!==null?o:null,dim:n.mobileHeightDim},mobileBorder:n.mobileBorder,mobileBorderRadius:n.mobileBorderRadius,mobileBoxShadow:n.mobileBoxShadow,mobileAlign:n.mobileAlign,mobileVerticalAlign:n.mobileVerticalAlign,mobileDirection:n.mobileDirection,mobileBackgroundColor:n.mobileBackgroundColor,mobileBackgroundImage:n.mobileBackgroundImage,mobileBackgroundPositionX:n.mobileBackgroundPositionX,mobileBackgroundPositionY:n.mobileBackgroundPositionY,mobileBackgroundRepeat:n.mobileBackgroundRepeat,mobileBackgroundSize:n.mobileBackgroundSize,mobilePadding:r,show:n.show,exportAsPicture:e.getAttribute("em-operation")==="exportAsPicture",outlookBackground:is(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 iN(e){let t=[],r=null,n=null,i="",o,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(o=!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&&(r=parseFloat(c.nextElementSibling.getAttribute("width")||"0"),n=ts({elem:c.nextElementSibling}).mobileHeight||0),(l.classList.contains("em-mob-wrap-cancel")||l.classList.contains("noresp-em-mob-wrap-cancel"))&&(o=!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}],r=0}i=a.parentElement.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.getAttribute("valign")||"",(e.elem.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap").parentElement.closest("td"))?.getAttribute("dir")==="rtl"&&(s=!0)}else{const a=e.elem.closest('div[style*="inline-block"]');if(a&&a.parentElement.querySelectorAll('div[style*="inline-block"]').length>1)a.parentElement.querySelectorAll('div[style*="inline-block"]').forEach(l=>{const c=l;if(!c.style.fontFamily){const u=l.firstElementChild;t.push({width:parseFloat(u?.getAttribute("width")||"0"),current:l===a});const d=u?.getAttribute("width"),f=parseFloat(c.style.width);r=f-(!d||d.indexOf("%")>-1?f:parseFloat(d))}});else{const l=a?.parentElement?.querySelector('div[style*="inline-block"]');t=[{width:parseFloat(l?.firstElementChild?.getAttribute("width")||"0"),current:!0}],r=0}i=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:r,gapMobile:n,valign:i,wrap:o,dirRevers:s}}var oN='table[em-type="social"]';function sN(e){return e.closest(oN)}function aN(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 Bm(e){const t=sN(e);if(t&&e!==t&&aN(e,t))return t;const r=e.parentNode;if(!r)return!1;const n=r.tagName,i=r.style,o=r.parentNode;return n==="TD"||n==="TABLE"&&o?.style.display!=="inline-block"&&!e.closest(".em-narrow-table")&&r.getAttribute("em")!=="atom"||n==="DIV"&&(i.display==="inline-block"||i.display==="table-cell")&&i.verticalAlign||(n==="DIV"||n==="TABLE")&&lN(i)?r:Bm(r)}function lN(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 Ht(e,t){return{settings:e,elem:t}}var Q=null;function cN(e){Q=e}function uN(){return _e.get("emailWidth")||475}function bo(){return document.documentElement.clientWidth<=uN()}function dl(e,t,r,n){if(!Q)return;const i=e;i.style.cursor=r,i.mousemove=t,i.onmousedown=function(){window.getSelection()?.removeAllRanges(),Q.applicationElementSettingsSet({elem:e});const o=document.querySelector("[em-edit]");o&&Q.setCursorPosition(o),document.documentElement.classList.add("em-resize-start");try{document.documentElement.addEventListener("mousemove",i.doDrag,!1),document.documentElement.addEventListener("mouseup",i.stopDrag,!1)}catch{}},i.doDrag=function(o){if(o.which!=1){i.stopDrag();return}i.mousemove(o)},i.stopDrag=function(){document.documentElement.removeEventListener("mousemove",i.doDrag,!1),document.documentElement.removeEventListener("mouseup",i.stopDrag,!1),n&&n(),setTimeout(()=>{document.documentElement.classList.remove("em-resize-start"),Q.commit(!1)})}}function zt(e,t,r){dl(e,t,"ns-resize",r)}function Nn(e,t,r){dl(e,t,"ew-resize",r)}function dN(e,t,r){dl(e,t,"nwse-resize",r)}function Vt(e,t){if(!Q)return;let r=null,n=0;const i=bo();if(e.closest('div[style*="font-size"][style*="line-height"]')){if(r=e.closest('div[style*="height"][style*="line-height"]'),!r)return;n=r.clientHeight+t,i?ti(Ht({mobileHeight:{value:n>0?n:0,dim:"px",classNamePrefix:"em-mob-height-"}},r)):(r.style.height=n+"px",r.style.lineHeight=n+"px")}else if(e.closest(".em-gap")){if(r=e.closest(".em-gap"),!r)return;r.classList.add("em-hover"),n=r.clientHeight+t,r.closest("tr")?.querySelectorAll(".em-gap").forEach(o=>{const s={mobileHeight:{value:n>0?n:0,dim:"px",classNamePrefix:"em-mob-height-"}},a=o.closest(".em-mob-wrap, .noresp-em-mob-wrap");ti(Ht(s,a)),o.style.height=n+"px";const l=o.querySelector(".em-element-gap-value");l&&(l.innerHTML=n+"px")})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(r=e.closest(".em-vindent-paddingTop"),!r)return;const o=r.parentElement;r.classList.add("em-hover"),n=r.clientHeight+t,r.style.height=n+"px",i&&o?zr(Ht({mobilePadding:{top:n>0?n:0,classNamePrefix:"em-mob-padding_"}},o)):o&&(o.style.paddingTop=n+"px")}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(r=e.closest(".em-vindent-paddingBottom"),!r)return;const o=r.parentElement;r.classList.add("em-hover"),n=r.clientHeight+t,r.style.height=n+"px",i&&o?zr(Ht({mobilePadding:{bottom:n>0?n:0,classNamePrefix:"em-mob-padding_"}},o)):o&&(o.style.paddingBottom=n+"px")}else{if(r=e.closest("td"),!r)return;n=r.clientHeight+t,i?ti(Ht({mobileHeight:{value:n>0?n:0,dim:"px",classNamePrefix:"em-mob-height-"}},r)):r.setAttribute("height",String(n))}if(r&&!e.closest(".em-gap")){if(n>=0){const o=r.querySelector(".em-element-vindent-value");o&&(o.innerHTML=n+"px")}n<30?r.classList.add("em-vindent_low"):r.classList.remove("em-vindent_low")}r&&Q.commit()}function Wt(e){if(!Q)return;let t=null;const r=bo();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():Q.applicationElementSettingsSet({elem:t})}else if(e.closest(".em-gap")){if(t=e.closest(".em-gap"),!t)return;Q.applicationElementSettingsSet({elem:t.closest('[em="block"] > td')})}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 n=t.parentElement;parseInt(t.style.height)<=0?r&&n?Q.applicationElementSettingsSet({elem:n}):n&&n.style.removeProperty("padding-top"):n&&Q.applicationElementSettingsSet({elem:n})}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 n=t.parentElement;parseInt(t.style.height)<=0?r&&n?Q.applicationElementSettingsSet({elem:n}):n&&n.style.removeProperty("padding-bottom"):n&&Q.applicationElementSettingsSet({elem:n})}else{if(t=e.closest("td"),!t)return;const n=t.getAttribute("height");n&&parseInt(n)<=0?t.closest("table")?.remove():Q.applicationElementSettingsSet({elem:t})}t&&Q.commit()}function Pr(e,t){if(!Q)return;let r=null,n=0;const i=bo();if(e.closest(".em-element-resize-img-container")){const o=e.closest(".em-element-resize-img-container")?.querySelector("img");if(!o)return;const s=o.clientWidth+t;o.style.maxWidth=s+"px",o.setAttribute("width",String(s)),Q.commit()}else if(e.closest(".em-gap")){if(r=e.closest(".em-gap"),!r)return;if(r.classList.add("em-hover"),n=r.clientWidth+t,n>=0){const o=r.clientWidth,s=Array.from(r.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)*o,c=r.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(A=>A.dataset.percent).map(A=>A.dataset.percent);u.length||(u=s.map(A=>((A||0)/a*100).toFixed(1)),Tl(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")));const d=l-(s.length-1)*n,f=(A,L)=>Math.round(L*parseFloat(A)/100);let h=s.map((A,L)=>f(u[L],d));const g=l-(h.reduce((A,L)=>A+L,0)+(s.length-1)*n);if(g!==0){const A=h.length-Math.abs(g);h=h.map((L,C)=>A<=C?L+(g>0?1:-1):L)}const y=h;c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((A,L)=>{Array.from(A.querySelectorAll("table[width]")).filter(C=>!C.getAttribute("width")?.includes("%")).forEach(C=>{+(C.getAttribute("width")||0)<=y[L]&&(C.style.maxWidth=String(y[L]),C.setAttribute("width","100%"))})}),r.style.width=n+"px",c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((A,L)=>A.setAttribute("width",String(y[L]))),c.querySelectorAll(".em-gap").forEach(A=>{A.parentElement?.setAttribute("width",String(n)),A.style.width=n+"px";const L=A.querySelector(".em-element-gap-value");L&&(L.innerHTML=n+"px")})}}}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingLeft")){if(r=e.closest(".em-vindent-paddingLeft"),!r)return;const o=r.parentElement;r.classList.add("em-hover"),n=r.clientWidth+t,r.style.width=n+"px",i&&o?zr(Ht({mobilePadding:{left:n>0?n:0,classNamePrefix:"em-mob-padding_"}},o)):o&&(o.style.paddingLeft=n+"px",o.querySelectorAll(":scope > table").forEach(s=>ul(s)))}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingRight")){if(r=e.closest(".em-vindent-paddingRight"),!r)return;const o=r.parentElement;r.classList.add("em-hover"),n=r.clientWidth+t,r.style.width=n+"px",i&&o?zr(Ht({mobilePadding:{right:n>0?n:0,classNamePrefix:"em-mob-padding_"}},o)):o&&(o.style.paddingRight=n+"px",o.querySelectorAll(":scope > table").forEach(s=>ul(s)))}if(r&&!e.closest(".em-gap")){if(n>=0){const o=r.querySelector(".em-element-vindent-value, .em-element-gap-value");o&&(o.innerHTML=n+"px")}n<30?r.classList.add("em-vindent_low"):r.classList.remove("em-vindent_low")}r&&Q.commit()}function Nr(e){if(!Q)return;let t=null;const r=bo();if(e.closest(".em-element-resize-img-container")){const n=e.closest(".em-element-resize-img-container")?.querySelector("img");n&&(Q.applicationElementSettingsSet({elem:n}),Q.commit())}else if(e.closest(".em-gap"))t=e.closest(".em-gap"),t&&Q.applicationElementSettingsSet({elem:t.closest('[em="block"] > td')});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 n=t.parentElement;parseInt(t.style.width)<=0?r&&n?Q.applicationElementSettingsSet({elem:n}):n&&n.style.removeProperty("padding-left"):n&&Q.applicationElementSettingsSet({elem:n})}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 n=t.parentElement;parseInt(t.style.width)<=0?r&&n?Q.applicationElementSettingsSet({elem:n}):n&&n.style.removeProperty("padding-right"):n&&Q.applicationElementSettingsSet({elem:n})}t&&Q.commit()}var fN='<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>',hN='<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>',mN='<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>',pN='<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>',gN='<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>',fl='<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>',bN='<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>',yN='<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>',vN='<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 yo(e,t,r=""){const n=`class="${t}" width="1em" height="1em" fill="currentColor" aria-hidden="true"`;return e.replace("<svg",`<svg ${n}${r?` ${r}`:""}`)}var Mn=null;function EN(e){Mn=e}function _N(){if(!Mn)return;const e=_e.get("applicationTheme")||"light";let t=!1;try{Mn.textDocument.beginUpdate();const r=[...document.querySelectorAll('[em="css"]')].map(s=>s.getAttribute("href"));let n=document.getElementsByTagName("head")[0];if(!n)if(document.documentElement)n=document.createElement("head"),document.documentElement.insertBefore(n,document.documentElement.firstChild),t=!0;else return;const i="css/sandbox.css?d62ebebc";if(r.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),n.appendChild(s),t=!0}const o=`css/sandbox-${e}.css?d62ebebc`;if(r.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),n.appendChild(s),t=!0}}finally{Mn.textDocument.endUpdate()}t&&Mn.commit(!1)}var SN='<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>',vo=null,wN=".em-prevent-action",Fm=new WeakSet;function CN(e){vo=e}function AN(){return _e.get("emailWidth")||475}function TN(){return _e.get("isLeftButtonDown")||!1}function kN(){return _e.get("editImageControlEnabled")||!1}function jm(){return _e.get("imageCenterEditorEnabled")||!1}function LN(){return _e.get("imageCenterStockEnabled")||!1}function ON(){return _e.get("imageCenterGifEnabled")||!1}function xN(){return _e.get("elementAIimageEnabled")||!1}function PN(e){if(!vo||document.body?.classList.contains("em-native-file-drag"))return;const t=vo.getLocale(),r=AN(),n=TN(),i=jm(),o=document.documentElement.clientWidth<=(r||475);if(document.body&&!document.body.classList.contains("mceNonEditable")&&!n){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 g=z({targetElement:e,insertType:"append",className:"em-element-resize-height"});z({targetElement:e,insertType:"append",className:"em-element-vindent"}),z({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),zt(g,function(y){Vt(g,y.movementY)},function(){Wt(g)})}if(e.closest(wN))return;if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.getAttribute("height")&&!e.querySelector(".em-element-vindent-value")){const g=At(e,"em-mob-height"),y=g?parseFloat(g.substring(14,g.length-2)):void 0;z({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:o?(y||e.getAttribute("height"))+"px":e.getAttribute("height")+"px"}),!o||!y?parseInt(e.getAttribute("height")||"0")<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):y<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 g=z({targetElement:e,insertType:"append",className:"em-element-resize-height"}),y=z({targetElement:e,insertType:"append",className:"em-element-vindent"});z({targetElement:y,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),z({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),zt(g,function(A){Vt(g,A.movementY)},function(){Wt(g)})}if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.style.height&&e.style.fontSize&&!e.querySelector(".em-element-vindent-value")){const g=At(e,"em-mob-height"),y=g?parseFloat(g.substring(14,g.length-2)):void 0;z({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:o?(y||parseFloat(e.style.height))+"px":parseFloat(e.style.height)+"px"}),!o||!y?parseFloat(e.style.height)<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):y<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}const s=At(e,"em-mob-padding_top"),a=s?parseFloat(s.substring(19)):void 0,l=At(e,"em-mob-padding_bottom"),c=l?parseFloat(l.substring(22)):void 0,u=At(e,"em-mob-padding_left"),d=u?parseFloat(u.substring(20)):void 0,f=At(e,"em-mob-padding_right"),h=f?parseFloat(f.substring(21)):void 0;if((e.style.padding||e.style.paddingTop||e.style.paddingBottom||e.style.paddingLeft||e.style.paddingRight)&&!e.closest("editor")&&(e.tagName!=="A"||e.style.height)){if(e.style.paddingTop&&!e.querySelector(":scope > .em-vindent-paddingTop")&&!e.querySelector(":scope > editor > .em-vindent-paddingTop")&&(!a||!o)){const g=z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${e.style.paddingTop}`});e.getBoundingClientRect().top<30&&g.classList.add("top-crossed")}e.style.paddingBottom&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&!e.querySelector(":scope > editor > .em-vindent-paddingBottom")&&(!c||!o)&&z({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||!o)&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${e.style.paddingLeft}`}),e.style.paddingRight&&!e.querySelector(":scope > .em-vindent-paddingRight")&&!e.querySelector(":scope > editor > .em-vindent-paddingRight")&&(!h||!o)&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${e.style.paddingRight}`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(g=>{if(!g.querySelector(".em-element-resize-height")){const y=g;(parseFloat(y.style.height)<30||parseFloat(y.style.width)<30)&&g.classList.add("em-vindent_low");const A=z({targetElement:y,insertType:"append",className:"em-element-resize-height"});z({targetElement:y,insertType:"append",className:"em-element-vindent-marker"}),z({targetElement:y,insertType:"append",className:"em-element-vindent-bg"});const L=z({targetElement:y,insertType:"append",className:"em-element-vindent"});let C="";y.className.indexOf("paddingTop")>-1?(C=e.style.paddingTop,zt(A,function(O){Vt(A,O.movementY)},function(){Wt(A)})):y.className.indexOf("paddingBottom")>-1?(C=e.style.paddingBottom,zt(A,function(O){Vt(A,O.movementY)},function(){Wt(A)})):y.className.indexOf("paddingLeft")>-1?(C=e.style.paddingLeft,Nn(A,function(O){Pr(A,O.movementX)},function(){Nr(A)})):y.className.indexOf("paddingRight")>-1&&(C=e.style.paddingRight,Nn(A,function(O){Pr(A,-O.movementX)},function(){Nr(A)})),z({targetElement:L,insertType:"append",className:"em-element-vindent-value",HTMLcontent:C})}})}if(e.className.length&&e.className?.includes("em-mob-padding")&&!e.closest("editor")&&o&&(a&&!e.querySelector(":scope > .em-vindent-paddingTop")&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${a}px`}),c&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${c}px`}),d&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${d}px`}),h&&!e.querySelector(":scope > .em-vindent-paddingRight")&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${h}px`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(g=>{if(!g.querySelector(".em-element-resize-height")){const y=g;(parseFloat(y.style.height)<30||parseFloat(y.style.width)<30)&&g.classList.add("em-vindent_low");const A=z({targetElement:y,insertType:"append",className:"em-element-resize-height"});z({targetElement:y,insertType:"append",className:"em-element-vindent-marker"}),z({targetElement:y,insertType:"append",className:"em-element-vindent-bg"});const L=z({targetElement:y,insertType:"append",className:"em-element-vindent"});let C="";y.className.indexOf("paddingTop")>-1?(C=a,zt(A,function(O){Vt(A,O.movementY)},function(){Wt(A)})):y.className.indexOf("paddingBottom")>-1?(C=c,zt(A,function(O){Vt(A,O.movementY)},function(){Wt(A)})):y.className.indexOf("paddingLeft")>-1?(C=d,Nn(A,function(O){Pr(A,O.movementX)},function(){Nr(A)})):y.className.indexOf("paddingRight")>-1&&(C=h,Nn(A,function(O){Pr(A,-O.movementX)},function(){Nr(A)})),z({targetElement:L,insertType:"append",className:"em-element-vindent-value",HTMLcontent:String(C)})}})),e.closest('[em="block"]')?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length||0)>2&&!e.closest('[em="block"]')?.querySelector(".em-mob-wrap .em-gap, .noresp-em-mob-wrap .em-gap")){const g=At(e.closest('[em="block"]')?.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),"em-mob-height"),y=g?parseFloat(g.substring(14,g.length-2)):void 0;e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(A=>{z({targetElement:A,insertType:"append",className:"em-gap",style:o?`height: ${y}px;`:`width: ${A.getAttribute("width")}px;`})}),e.closest('[em="block"]')?.querySelectorAll(".em-gap").forEach(A=>{if(!A.querySelector(".em-element-resize-height")){const L=A,C=z({targetElement:L,insertType:"append",className:"em-element-resize-height"});z({targetElement:L,insertType:"append",className:"em-element-gap-marker"}),z({targetElement:L,insertType:"append",className:"em-element-gap-bg"});const O=z({targetElement:L,insertType:"append",className:"em-element-gap"});let E="";o?(E=L.style.height,zt(C,function(m){Vt(C,m.movementY)},function(){Wt(C)})):(E=L.style.width,Nn(C,function(m){Pr(C,m.movementX)},function(){Nr(C)})),z({targetElement:O,insertType:"append",className:"em-element-gap-value",HTMLcontent:E})}})}if(e.tagName==="IMG"){const g=e;if(g.closest("td[em-platform], td[data-em-platform]"))return;if(g.closest(".em-element-resize-img-container")||g.closest('div[style*="font-size"][style*="line-height"][style*="font-family"]')||g.closest("editor")||g.classList.contains("em-video")){if(g.closest(".em-element-resize-img-container")){const C=g.closest(".em-element-resize-img-container"),O=C.querySelector(".em-element-img-edit");!g.getAttribute("src")?.includes(".gif")&&i?O||z({targetElement:C.querySelector(".em-element-img-change-group"),insertType:"prepend",className:"em-element-img-edit",tag:"i",HTMLcontent:yo(fl,`${ii}`),title:t.CHANGE_IMAGE_EDIT}):C.querySelector(".em-element-img-edit")?.remove()}return}const y=document.createElement("span");y.classList.add("em-element-resize-img-container");const A=g.parentElement instanceof HTMLAnchorElement?g.parentElement:g;A.parentElement?.insertBefore(y,A),y.appendChild(A);const L=z({targetElement:y,insertType:"append",tag:"span",className:"em-element-resize-img"});dN(L,function(C){Pr(L,C.movementX)},function(){Nr(L)}),g?.style.maxWidth&&g?.style.display==="block"&&g.closest(".em-element-resize-img-container")?.classList.add("em-display-block"),$m(g,y)}}}function $m(e,t){const r=vo;if(!r||t.querySelector(".em-element-img-change-group"))return;const n=r.getLocale(),i=kN(),o=jm(),s=LN(),a=ON(),l=xN();if(i&&e.getBoundingClientRect().width>40&&e.getBoundingClientRect().height>40&&!e.classList.contains("em-countdown")){const c=z({targetElement:t,insertType:"append",className:"em-element-img-change-group"});if(z({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:n.CHANGE_IMAGE}),!e.getAttribute("src")?.includes(".gif")&&o&&z({targetElement:c,insertType:"append",className:"em-element-img-edit",tag:"i",HTMLcontent:yo(fl,`${ii}`),title:n.CHANGE_IMAGE_EDIT}),s&&z({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:n.CHANGE_IMAGE_STOCK}),z({targetElement:c,insertType:"append",className:"em-element-img-changeto",tag:"i",HTMLcontent:yo(SN,`${ii}`),title:n.CHANGE_IMAGE_CHANGETO}),a&&z({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:n.CHANGE_IMAGE_GIF}),l&&z({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:n.CHANGE_IMAGE_AI}),r.commit(!1),Fm.has(c))return;Fm.add(c),c.addEventListener("click",function(u){const d=u.target.closest('i[class*="em-element-img"]');let f={};e.classList.contains("em-ai-img")||d?.classList.contains("em-element-img-ai")?f={operation:"application_open-image-ai-popup"}:GL(e.getAttribute("src"))||d?.classList.contains("em-element-img-changeto")?f={operation:"application_open-image-upload-popup",src:e.getAttribute("src")}:d?.classList.contains("em-element-img-gif")?f={operation:"application_open-image-gif-popup",src:e.getAttribute("src")}:d?.classList.contains("em-element-img-stock")?f={operation:"application_open-image-stock-popup",src:e.getAttribute("src")}:f={operation:"application_open-image-edit-popup",src:e.getAttribute("src")},setTimeout(()=>{r.messageService.send(f)},100)})}}function NN(){return document.body?.classList.contains("em-sandbox-discuss")&&!document.body.classList.contains("em-sandbox-discuss_set-target")}function MN(){return document.body?.classList.contains("em-sandbox-discuss_set-target")??!1}function RN(e){const t=e.getAttribute("em-discuss-id");return t&&X.send({operation:"application_discuss_get_comment",settings:{targetId:t}}),!1}function DN(e,t){let r=e;const n=r.getAttribute("em-discuss-id"),i=r.classList.contains("em-discuss-id-new");if(!n||n&&i){if(document.querySelectorAll(".em-discuss-id-new").forEach(o=>{o!==r&&(o.removeAttribute("em-discuss-id"),o.removeAttribute("contenteditable"),o.removeAttribute("em-edit"))}),r.tagName==="EDITOR"&&(r=r.parentElement),r.getAttribute("em-discuss-id"))r.removeAttribute("em-discuss-id"),r.removeAttribute("contenteditable"),r.removeAttribute("em-edit"),X.send({operation:"application_discuss_set_id",settings:{value:""}});else{const o=t.makeId(5);r.setAttribute("em-discuss-id",o),r.setAttribute("em-edit","active"),r.setAttribute("contenteditable","true"),r.classList.add("em-discuss-id-new"),X.send({operation:"application_discuss_set_id",settings:{value:o}})}t.commit()}return{handled:!0,newClickedElement:r}}Object.defineProperty(_,"AppImpl",{enumerable:!0,get:function(){return Ui}}),Object.defineProperty(_,"CLASS_BACKGROUND_ACTIVE_CELL",{enumerable:!0,get:function(){return Ov}}),Object.defineProperty(_,"CLASS_FOR_BASIC_CELL",{enumerable:!0,get:function(){return kv}}),Object.defineProperty(_,"CLASS_FOR_BASIC_ROW",{enumerable:!0,get:function(){return Lv}}),Object.defineProperty(_,"CLASS_NAME_OL",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(_,"CLASS_NAME_UL",{enumerable:!0,get:function(){return Wn}}),Object.defineProperty(_,"DEFAULT_LINK_COLOR",{enumerable:!0,get:function(){return Rb}}),Object.defineProperty(_,"DOCUMENT_MAPPING_ID",{enumerable:!0,get:function(){return Qo}}),Object.defineProperty(_,"Disposable",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(_,"EVENT_TYPES",{enumerable:!0,get:function(){return me}}),Object.defineProperty(_,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return Xo}}),Object.defineProperty(_,"ICON_ROLE",{enumerable:!0,get:function(){return ni}}),Object.defineProperty(_,"ICON_SIZE",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(_,"IMAGE_CACHE_ID",{enumerable:!0,get:function(){return Zo}}),Object.defineProperty(_,"LIST_REGEX",{enumerable:!0,get:function(){return Sv}}),Object.defineProperty(_,"LIST_TEMP_CLASSES",{enumerable:!0,get:function(){return Rc}}),Object.defineProperty(_,"Node",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(_,"NodeType",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_,"REMOTE_DOCUMENT_ID",{enumerable:!0,get:function(){return Yo}}),Object.defineProperty(_,"STANDARD_LIST_CONTAINER_SELECTOR",{enumerable:!0,get:function(){return Yp}}),Object.defineProperty(_,"STANDARD_LIST_CONTAINER_TAGS",{enumerable:!0,get:function(){return Xp}}),Object.defineProperty(_,"STANDARD_LIST_STYLES",{enumerable:!0,get:function(){return Kp}}),Object.defineProperty(_,"TABLE_LIST_SELECTOR",{enumerable:!0,get:function(){return Gp}}),Object.defineProperty(_,"TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR",{enumerable:!0,get:function(){return ps}}),Object.defineProperty(_,"TEMPORARY_CELL_CLASS",{enumerable:!0,get:function(){return Pv}}),Object.defineProperty(_,"TEMPORARY_CLASS",{enumerable:!0,get:function(){return xv}}),Object.defineProperty(_,"TEXT_DOCUMENT_ID",{enumerable:!0,get:function(){return Ko}}),Object.defineProperty(_,"UpdateQueue",{enumerable:!0,get:function(){return dO}}),Object.defineProperty(_,"__vitePreload",{enumerable:!0,get:function(){return gs}}),Object.defineProperty(_,"_defineProperty",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_,"addBlockToProject",{enumerable:!0,get:function(){return QP}}),Object.defineProperty(_,"addClassToSecondCell",{enumerable:!0,get:function(){return Cg}}),Object.defineProperty(_,"addElement",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_,"addFontFamilyClass",{enumerable:!0,get:function(){return Wh}}),Object.defineProperty(_,"addNewRange",{enumerable:!0,get:function(){return bp}}),Object.defineProperty(_,"applyAttributesToTag",{enumerable:!0,get:function(){return SP}}),Object.defineProperty(_,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return Vh}}),Object.defineProperty(_,"applyVMLBackgroundToggle",{enumerable:!0,get:function(){return my}}),Object.defineProperty(_,"arrow_down_solid_default",{enumerable:!0,get:function(){return fN}}),Object.defineProperty(_,"arrow_up_solid_default",{enumerable:!0,get:function(){return hN}}),Object.defineProperty(_,"attachFocusService",{enumerable:!0,get:function(){return xp}}),Object.defineProperty(_,"braille_solid_default",{enumerable:!0,get:function(){return mN}}),Object.defineProperty(_,"buildEmFontClassName",{enumerable:!0,get:function(){return Qn}}),Object.defineProperty(_,"captionByRules",{enumerable:!0,get:function(){return Yx}}),Object.defineProperty(_,"changeBullets",{enumerable:!0,get:function(){return Zp}}),Object.defineProperty(_,"changeBulletsColor",{enumerable:!0,get:function(){return Jp}}),Object.defineProperty(_,"changeBulletsItalic",{enumerable:!0,get:function(){return rg}}),Object.defineProperty(_,"changeBulletsSize",{enumerable:!0,get:function(){return eg}}),Object.defineProperty(_,"changeBulletsStrikethrough",{enumerable:!0,get:function(){return ig}}),Object.defineProperty(_,"changeBulletsUnderline",{enumerable:!0,get:function(){return ng}}),Object.defineProperty(_,"changeBulletsWeight",{enumerable:!0,get:function(){return tg}}),Object.defineProperty(_,"checkBlockAdaptivity",{enumerable:!0,get:function(){return YP}}),Object.defineProperty(_,"checkForTextNodes",{enumerable:!0,get:function(){return Pm}}),Object.defineProperty(_,"checkForWorkClass",{enumerable:!0,get:function(){return fP}}),Object.defineProperty(_,"checkIsEditorInited",{enumerable:!0,get:function(){return LP}}),Object.defineProperty(_,"checkSandboxStyles",{enumerable:!0,get:function(){return _N}}),Object.defineProperty(_,"clearActiveEditElements",{enumerable:!0,get:function(){return OP}}),Object.defineProperty(_,"clearLinkTags",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(_,"clearPendingPaletteInsert",{enumerable:!0,get:function(){return Mc}}),Object.defineProperty(_,"clearProjectFontFaces",{enumerable:!0,get:function(){return Ji}}),Object.defineProperty(_,"commit",{enumerable:!0,get:function(){return Ap}}),Object.defineProperty(_,"commitLockedAsync",{enumerable:!0,get:function(){return Tp}}),Object.defineProperty(_,"commonStylesApply",{enumerable:!0,get:function(){return qO}}),Object.defineProperty(_,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return GO}}),Object.defineProperty(_,"compareStrings",{enumerable:!0,get:function(){return gp}}),Object.defineProperty(_,"container",{enumerable:!0,get:function(){return Xi}}),Object.defineProperty(_,"copy_solid_default",{enumerable:!0,get:function(){return pN}}),Object.defineProperty(_,"createBeforeInputHandler",{enumerable:!0,get:function(){return By}}),Object.defineProperty(_,"createFontClassName",{enumerable:!0,get:function(){return bb}}),Object.defineProperty(_,"createHandleChangesWithRemovedElementsOnly",{enumerable:!0,get:function(){return _O}}),Object.defineProperty(_,"createMapObj",{enumerable:!0,get:function(){return pO}}),Object.defineProperty(_,"createWrapEditor",{enumerable:!0,get:function(){return Iy}}),Object.defineProperty(_,"darkMode",{enumerable:!0,get:function(){return Eh}}),Object.defineProperty(_,"decrementLock",{enumerable:!0,get:function(){return Op}}),Object.defineProperty(_,"defaultVisibleTextMapFn",{enumerable:!0,get:function(){return EP}}),Object.defineProperty(_,"discuss_default",{enumerable:!0,get:function(){return Rv}}),Object.defineProperty(_,"display_default",{enumerable:!0,get:function(){return ML}}),Object.defineProperty(_,"editConditionalComment",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(_,"emFilter",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(_,"emFilterCSS",{enumerable:!0,get:function(){return PL}}),Object.defineProperty(_,"extractTableRowData",{enumerable:!0,get:function(){return cg}}),Object.defineProperty(_,"findElementWithSelectedText",{enumerable:!0,get:function(){return Al}}),Object.defineProperty(_,"findForeignButtonSpan",{enumerable:!0,get:function(){return us}}),Object.defineProperty(_,"findOutermostParentWithText",{enumerable:!0,get:function(){return Ep}}),Object.defineProperty(_,"findParentTr",{enumerable:!0,get:function(){return Sl}}),Object.defineProperty(_,"findParentWithExplicitStyle",{enumerable:!0,get:function(){return Tb}}),Object.defineProperty(_,"findParentWithExplicitStyle$1",{enumerable:!0,get:function(){return yp}}),Object.defineProperty(_,"findParentWithFontSizeAndTag",{enumerable:!0,get:function(){return vP}}),Object.defineProperty(_,"findRoundrectComment",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(_,"fontFamilyValues",{enumerable:!0,get:function(){return ac}}),Object.defineProperty(_,"fontValues",{enumerable:!0,get:function(){return Zn}}),Object.defineProperty(_,"formatCellOneText",{enumerable:!0,get:function(){return vg}}),Object.defineProperty(_,"getActiveEditElement",{enumerable:!0,get:function(){return kP}}),Object.defineProperty(_,"getAllComments",{enumerable:!0,get:function(){return iv}}),Object.defineProperty(_,"getCursorPositionType",{enumerable:!0,get:function(){return lg}}),Object.defineProperty(_,"getElementBorder",{enumerable:!0,get:function(){return tc}}),Object.defineProperty(_,"getElementBorderRadius",{enumerable:!0,get:function(){return rc}}),Object.defineProperty(_,"getElementBoxShadow",{enumerable:!0,get:function(){return nc}}),Object.defineProperty(_,"getElementInnerHTML",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_,"getElementMobileProps",{enumerable:!0,get:function(){return ts}}),Object.defineProperty(_,"getElementParent",{enumerable:!0,get:function(){return Bm}}),Object.defineProperty(_,"getElementTdDiv",{enumerable:!0,get:function(){return nN}}),Object.defineProperty(_,"getFontFamilyFromElement",{enumerable:!0,get:function(){return pP}}),Object.defineProperty(_,"getFontFamilyFromElement$1",{enumerable:!0,get:function(){return wb}}),Object.defineProperty(_,"getHtmlDocument",{enumerable:!0,get:function(){return Oo}}),Object.defineProperty(_,"getHtmlPartsAtCursor",{enumerable:!0,get:function(){return _g}}),Object.defineProperty(_,"getLineHeightInPixels",{enumerable:!0,get:function(){return mP}}),Object.defineProperty(_,"getLineHeightInPixels$1",{enumerable:!0,get:function(){return Sb}}),Object.defineProperty(_,"getListBullet",{enumerable:!0,get:function(){return Cv}}),Object.defineProperty(_,"getListContainer",{enumerable:!0,get:function(){return Av}}),Object.defineProperty(_,"getListContext",{enumerable:!0,get:function(){return wv}}),Object.defineProperty(_,"getOrCreateAfterSpan",{enumerable:!0,get:function(){return oP}}),Object.defineProperty(_,"getOuterHtml",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(_,"getParentElementOfSelection",{enumerable:!0,get:function(){return kb}}),Object.defineProperty(_,"getParentElementOfSelection$1",{enumerable:!0,get:function(){return Cl}}),Object.defineProperty(_,"getPendingPaletteInsert",{enumerable:!0,get:function(){return dv}}),Object.defineProperty(_,"getProjectFontEntries",{enumerable:!0,get:function(){return FO}}),Object.defineProperty(_,"getRangeFromSelection",{enumerable:!0,get:function(){return gP}}),Object.defineProperty(_,"getSelectedText",{enumerable:!0,get:function(){return bO}}),Object.defineProperty(_,"getSimpleBorderType",{enumerable:!0,get:function(){return xb}}),Object.defineProperty(_,"getStructureColumns",{enumerable:!0,get:function(){return iN}}),Object.defineProperty(_,"getTagNameForContainer",{enumerable:!0,get:function(){return _P}}),Object.defineProperty(_,"getTextPartsAtCursor",{enumerable:!0,get:function(){return fg}}),Object.defineProperty(_,"getVariableByIcon",{enumerable:!0,get:function(){return lv}}),Object.defineProperty(_,"getVariableIcon",{enumerable:!0,get:function(){return av}}),Object.defineProperty(_,"getVisibleText",{enumerable:!0,get:function(){return Nm}}),Object.defineProperty(_,"handleAddBlockMenu",{enumerable:!0,get:function(){return UP}}),Object.defineProperty(_,"handleAddGroup",{enumerable:!0,get:function(){return $P}}),Object.defineProperty(_,"handleArrowRight",{enumerable:!0,get:function(){return yv}}),Object.defineProperty(_,"handleCloneAtom",{enumerable:!0,get:function(){return PP}}),Object.defineProperty(_,"handleCloneBlock",{enumerable:!0,get:function(){return NP}}),Object.defineProperty(_,"handleCloneGroup",{enumerable:!0,get:function(){return HP}}),Object.defineProperty(_,"handleDeleteKey",{enumerable:!0,get:function(){return bv}}),Object.defineProperty(_,"handleDiscussGetTarget",{enumerable:!0,get:function(){return $c}}),Object.defineProperty(_,"handleDiscussRemoveTarget",{enumerable:!0,get:function(){return Fc}}),Object.defineProperty(_,"handleDiscussReset",{enumerable:!0,get:function(){return jc}}),Object.defineProperty(_,"handleDiscussSetTarget",{enumerable:!0,get:function(){return Bc}}),Object.defineProperty(_,"handleDiscussSetTargetClick",{enumerable:!0,get:function(){return DN}}),Object.defineProperty(_,"handleDiscussViewClick",{enumerable:!0,get:function(){return RN}}),Object.defineProperty(_,"handleDragCancel",{enumerable:!0,get:function(){return Ph}}),Object.defineProperty(_,"handleEnterForBr",{enumerable:!0,get:function(){return vv}}),Object.defineProperty(_,"handleEscapeKey",{enumerable:!0,get:function(){return gv}}),Object.defineProperty(_,"handleLockDiscuss",{enumerable:!0,get:function(){return Ic}}),Object.defineProperty(_,"handleMergeBlocks",{enumerable:!0,get:function(){return IP}}),Object.defineProperty(_,"handleMoveBlockDown",{enumerable:!0,get:function(){return RP}}),Object.defineProperty(_,"handleMoveBlockUp",{enumerable:!0,get:function(){return MP}}),Object.defineProperty(_,"handleMoveGroupDown",{enumerable:!0,get:function(){return jP}}),Object.defineProperty(_,"handleMoveGroupUp",{enumerable:!0,get:function(){return FP}}),Object.defineProperty(_,"handleRemoveAtom",{enumerable:!0,get:function(){return xP}}),Object.defineProperty(_,"handleRemoveBlock",{enumerable:!0,get:function(){return DP}}),Object.defineProperty(_,"handleRemoveGroup",{enumerable:!0,get:function(){return zP}}),Object.defineProperty(_,"handleSaveHotkey",{enumerable:!0,get:function(){return hv}}),Object.defineProperty(_,"handleToggleEditorHotkey",{enumerable:!0,get:function(){return pv}}),Object.defineProperty(_,"handleUndoRedoHotkey",{enumerable:!0,get:function(){return mv}}),Object.defineProperty(_,"handleUnmergeBlocks",{enumerable:!0,get:function(){return BP}}),Object.defineProperty(_,"handleVMLButtonInput",{enumerable:!0,get:function(){return Ev}}),Object.defineProperty(_,"handleVMLButtonText",{enumerable:!0,get:function(){return _v}}),Object.defineProperty(_,"hasClosestTrWithClass",{enumerable:!0,get:function(){return og}}),Object.defineProperty(_,"hasElementVMLBackground",{enumerable:!0,get:function(){return is}}),Object.defineProperty(_,"hasForeignButtonStructure",{enumerable:!0,get:function(){return _y}}),Object.defineProperty(_,"hasLinkInSelection",{enumerable:!0,get:function(){return Ob}}),Object.defineProperty(_,"hasOnlyTextNodesDeep",{enumerable:!0,get:function(){return wl}}),Object.defineProperty(_,"hasPendingPaletteAtom",{enumerable:!0,get:function(){return fv}}),Object.defineProperty(_,"hasProjectFonts",{enumerable:!0,get:function(){return BO}}),Object.defineProperty(_,"hasTextNodeInElement",{enumerable:!0,get:function(){return CP}}),Object.defineProperty(_,"icon",{enumerable:!0,get:function(){return yo}}),Object.defineProperty(_,"implementImageControls",{enumerable:!0,get:function(){return $m}}),Object.defineProperty(_,"implementPolyfills",{enumerable:!0,get:function(){return gl}}),Object.defineProperty(_,"implementResizableElems",{enumerable:!0,get:function(){return PN}}),Object.defineProperty(_,"incrementLock",{enumerable:!0,get:function(){return Lp}}),Object.defineProperty(_,"initDocuments",{enumerable:!0,get:function(){return Cp}}),Object.defineProperty(_,"initFocusManager",{enumerable:!0,get:function(){return Pp}}),Object.defineProperty(_,"initResizableElements",{enumerable:!0,get:function(){return CN}}),Object.defineProperty(_,"initResizer",{enumerable:!0,get:function(){return cN}}),Object.defineProperty(_,"initSandboxStyles",{enumerable:!0,get:function(){return EN}}),Object.defineProperty(_,"initSortable",{enumerable:!0,get:function(){return Cx}}),Object.defineProperty(_,"injectTextIntoFirstDiv",{enumerable:!0,get:function(){return ug}}),Object.defineProperty(_,"insertAdjacentHTML",{enumerable:!0,get:function(){return Gl}}),Object.defineProperty(_,"insertCountdown",{enumerable:!0,get:function(){return GP}}),Object.defineProperty(_,"insertRowRelativeToDivClass",{enumerable:!0,get:function(){return mg}}),Object.defineProperty(_,"isAddBlockMenuClick",{enumerable:!0,get:function(){return WP}}),Object.defineProperty(_,"isCaretAtEndOfEmReplace",{enumerable:!0,get:function(){return aP}}),Object.defineProperty(_,"isCaretAtEndOfStandardElement",{enumerable:!0,get:function(){return lP}}),Object.defineProperty(_,"isClickAtEndOfEmReplace",{enumerable:!0,get:function(){return iP}}),Object.defineProperty(_,"isComment",{enumerable:!0,get:function(){return Ss}}),Object.defineProperty(_,"isDiscussSetTargetMode",{enumerable:!0,get:function(){return MN}}),Object.defineProperty(_,"isDiscussViewMode",{enumerable:!0,get:function(){return NN}}),Object.defineProperty(_,"isEditorContentOnlyNbsp",{enumerable:!0,get:function(){return TP}}),Object.defineProperty(_,"isEditorContentOnlyNbsp$1",{enumerable:!0,get:function(){return rP}}),Object.defineProperty(_,"isElementHasBold",{enumerable:!0,get:function(){return Ab}}),Object.defineProperty(_,"isElementHasBold$1",{enumerable:!0,get:function(){return vp}}),Object.defineProperty(_,"isElementLocked",{enumerable:!0,get:function(){return kp}}),Object.defineProperty(_,"isInitialized",{enumerable:!0,get:function(){return xo}}),Object.defineProperty(_,"isJsonString",{enumerable:!0,get:function(){return pp}}),Object.defineProperty(_,"isPathElementByRules",{enumerable:!0,get:function(){return Xx}}),Object.defineProperty(_,"isRangeCoveringAllVisibleText",{enumerable:!0,get:function(){return nP}}),Object.defineProperty(_,"isShowOnMobile",{enumerable:!0,get:function(){return Lb}}),Object.defineProperty(_,"isSrcElement",{enumerable:!0,get:function(){return tu}}),Object.defineProperty(_,"isTableElement",{enumerable:!0,get:function(){return vE}}),Object.defineProperty(_,"isTextNode",{enumerable:!0,get:function(){return fi}}),Object.defineProperty(_,"isVariableComment",{enumerable:!0,get:function(){return Pc}}),Object.defineProperty(_,"isVariableText",{enumerable:!0,get:function(){return xc}}),Object.defineProperty(_,"logProjectFonts",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(_,"makeId",{enumerable:!0,get:function(){return _p}}),Object.defineProperty(_,"markProjectFontClass",{enumerable:!0,get:function(){return vb}}),Object.defineProperty(_,"messageService",{enumerable:!0,get:function(){return X}}),Object.defineProperty(_,"minifyStylesheet",{enumerable:!0,get:function(){return xa}}),Object.defineProperty(_,"modifyHtml",{enumerable:!0,get:function(){return Eg}}),Object.defineProperty(_,"normalizeSpaces",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(_,"object_group_solid_default",{enumerable:!0,get:function(){return gN}}),Object.defineProperty(_,"parseFromString",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(_,"parseTableToArray",{enumerable:!0,get:function(){return pg}}),Object.defineProperty(_,"pen_solid_default",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(_,"plus_solid_default",{enumerable:!0,get:function(){return bN}}),Object.defineProperty(_,"prepareEditorHTML",{enumerable:!0,get:function(){return Mm}}),Object.defineProperty(_,"processTableText",{enumerable:!0,get:function(){return Sg}}),Object.defineProperty(_,"provideAmp",{enumerable:!0,get:function(){return tP}}),Object.defineProperty(_,"provideAttributePipeline",{enumerable:!0,get:function(){return pb}}),Object.defineProperty(_,"provideDocumentSync",{enumerable:!0,get:function(){return cO}}),Object.defineProperty(_,"provideEmVersion",{enumerable:!0,get:function(){return HL}}),Object.defineProperty(_,"provideFocus",{enumerable:!0,get:function(){return dP}}),Object.defineProperty(_,"provideImageCache",{enumerable:!0,get:function(){return aO}}),Object.defineProperty(_,"provideSandboxState",{enumerable:!0,get:function(){return uO}}),Object.defineProperty(_,"registerCorrectVariableSelectionService",{enumerable:!0,get:function(){return cv}}),Object.defineProperty(_,"registerCrossDomainDD",{enumerable:!0,get:function(){return mO}}),Object.defineProperty(_,"registerExtensionScriptsService",{enumerable:!0,get:function(){return nL}}),Object.defineProperty(_,"registerLocalizationService",{enumerable:!0,get:function(){return AO}}),Object.defineProperty(_,"registerProjectFontsService",{enumerable:!0,get:function(){return HO}}),Object.defineProperty(_,"registerResetService",{enumerable:!0,get:function(){return Tx}}),Object.defineProperty(_,"registerResizeWatch",{enumerable:!0,get:function(){return Ax}}),Object.defineProperty(_,"registerThemeVariablesService",{enumerable:!0,get:function(){return DO}}),Object.defineProperty(_,"removeAllAttributes",{enumerable:!0,get:function(){return xl}}),Object.defineProperty(_,"removeBySelector",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_,"removeClassesByPrefix",{enumerable:!0,get:function(){return Mb}}),Object.defineProperty(_,"removeClassesByPrefix$1",{enumerable:!0,get:function(){return Eb}}),Object.defineProperty(_,"removeEditorTags",{enumerable:!0,get:function(){return dg}}),Object.defineProperty(_,"removeEmptyParents",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(_,"removeHiddenClasses",{enumerable:!0,get:function(){return Ra}}),Object.defineProperty(_,"removeLastWord",{enumerable:!0,get:function(){return AP}}),Object.defineProperty(_,"removeTemporaryListClasses",{enumerable:!0,get:function(){return Tv}}),Object.defineProperty(_,"removeTrContainingDivWithClass",{enumerable:!0,get:function(){return hg}}),Object.defineProperty(_,"renumberCellOneText",{enumerable:!0,get:function(){return gg}}),Object.defineProperty(_,"replaceEmptyWithNbsp",{enumerable:!0,get:function(){return yg}}),Object.defineProperty(_,"resolveActiveElement",{enumerable:!0,get:function(){return dc}}),Object.defineProperty(_,"rgbToHex",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(_,"save_solid_default",{enumerable:!0,get:function(){return yN}}),Object.defineProperty(_,"sendResizeEvent",{enumerable:!0,get:function(){return ym}}),Object.defineProperty(_,"serializeOuterHtml",{enumerable:!0,get:function(){return Dg}}),Object.defineProperty(_,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return ZP}}),Object.defineProperty(_,"setBlockMaxWidth",{enumerable:!0,get:function(){return rN}}),Object.defineProperty(_,"setContrastBlock",{enumerable:!0,get:function(){return oy}}),Object.defineProperty(_,"setCursorInsideSpan",{enumerable:!0,get:function(){return sP}}),Object.defineProperty(_,"setCursorPositionSimple",{enumerable:!0,get:function(){return cP}}),Object.defineProperty(_,"setCursorToElement",{enumerable:!0,get:function(){return wP}}),Object.defineProperty(_,"setCustomColor",{enumerable:!0,get:function(){return hP}}),Object.defineProperty(_,"setDocumentStyles",{enumerable:!0,get:function(){return gb}}),Object.defineProperty(_,"setEditorFocus",{enumerable:!0,get:function(){return Np}}),Object.defineProperty(_,"setElementBorder",{enumerable:!0,get:function(){return ic}}),Object.defineProperty(_,"setElementBorderRadius",{enumerable:!0,get:function(){return oc}}),Object.defineProperty(_,"setElementBoxShadow",{enumerable:!0,get:function(){return Pb}}),Object.defineProperty(_,"setElementMobileAlign",{enumerable:!0,get:function(){return qb}}),Object.defineProperty(_,"setElementMobileBackgroundColor",{enumerable:!0,get:function(){return Kb}}),Object.defineProperty(_,"setElementMobileBackgroundImage",{enumerable:!0,get:function(){return Qb}}),Object.defineProperty(_,"setElementMobileBackgroundPositionX",{enumerable:!0,get:function(){return Zb}}),Object.defineProperty(_,"setElementMobileBackgroundPositionY",{enumerable:!0,get:function(){return Jb}}),Object.defineProperty(_,"setElementMobileBackgroundRepeat",{enumerable:!0,get:function(){return ey}}),Object.defineProperty(_,"setElementMobileBackgroundSize",{enumerable:!0,get:function(){return ty}}),Object.defineProperty(_,"setElementMobileBorder",{enumerable:!0,get:function(){return Vb}}),Object.defineProperty(_,"setElementMobileBorderRadius",{enumerable:!0,get:function(){return Wb}}),Object.defineProperty(_,"setElementMobileBoxShadow",{enumerable:!0,get:function(){return Ub}}),Object.defineProperty(_,"setElementMobileContentWidth",{enumerable:!0,get:function(){return zb}}),Object.defineProperty(_,"setElementMobileDirection",{enumerable:!0,get:function(){return Yb}}),Object.defineProperty(_,"setElementMobileFontSize",{enumerable:!0,get:function(){return ry}}),Object.defineProperty(_,"setElementMobileHeight",{enumerable:!0,get:function(){return ti}}),Object.defineProperty(_,"setElementMobileLineHeight",{enumerable:!0,get:function(){return ny}}),Object.defineProperty(_,"setElementMobilePadding",{enumerable:!0,get:function(){return zr}}),Object.defineProperty(_,"setElementMobileTableAlign",{enumerable:!0,get:function(){return Gb}}),Object.defineProperty(_,"setElementMobileVerticalAlign",{enumerable:!0,get:function(){return Xb}}),Object.defineProperty(_,"setElementMobileWidth",{enumerable:!0,get:function(){return Hb}}),Object.defineProperty(_,"setElementShow",{enumerable:!0,get:function(){return iy}}),Object.defineProperty(_,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return _b}}),Object.defineProperty(_,"setFloatBlocksWidth",{enumerable:!0,get:function(){return tN}}),Object.defineProperty(_,"setImageWidth",{enumerable:!0,get:function(){return qP}}),Object.defineProperty(_,"setPendingPaletteInsert",{enumerable:!0,get:function(){return uv}}),Object.defineProperty(_,"setPercentsForColumns",{enumerable:!0,get:function(){return Tl}}),Object.defineProperty(_,"setRenderedAttribute",{enumerable:!0,get:function(){return Fo}}),Object.defineProperty(_,"setStructureBlocksWidth",{enumerable:!0,get:function(){return ul}}),Object.defineProperty(_,"state",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(_,"stickyCheck",{enumerable:!0,get:function(){return JP}}),Object.defineProperty(_,"stripButtonVML",{enumerable:!0,get:function(){return Oy}}),Object.defineProperty(_,"stripSubjectTags",{enumerable:!0,get:function(){return Hp}}),Object.defineProperty(_,"styleMenuElement",{enumerable:!0,get:function(){return Mv}}),Object.defineProperty(_,"styleMenuElementList",{enumerable:!0,get:function(){return Nv}}),Object.defineProperty(_,"syncButtonVML",{enumerable:!0,get:function(){return wc}}),Object.defineProperty(_,"takeEblockRootSavedToProject",{enumerable:!0,get:function(){return IL}}),Object.defineProperty(_,"textHasStyle",{enumerable:!0,get:function(){return bP}}),Object.defineProperty(_,"textHasStyle$1",{enumerable:!0,get:function(){return Cb}}),Object.defineProperty(_,"toEmFontClassToken",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(_,"trash_alt_solid_default",{enumerable:!0,get:function(){return vN}}),Object.defineProperty(_,"updateButtonVMLLabel",{enumerable:!0,get:function(){return cs}}),Object.defineProperty(_,"updateDivWithClassAndNbsp",{enumerable:!0,get:function(){return wg}}),Object.defineProperty(_,"updateTableNumbering",{enumerable:!0,get:function(){return bg}}),Object.defineProperty(_,"updateTableStyle",{enumerable:!0,get:function(){return Qp}}),Object.defineProperty(_,"uptimeCountdown",{enumerable:!0,get:function(){return XP}})});
|
|
85
|
+
`),i.prepend(document.querySelector(c).cloneNode(!0)))}}),n.append(i),mh(n,[...n.querySelectorAll("style")],{forceMediaMerge:!0});let s=Nt(n);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 QP(e,t){const{HTMLDocument:r,messageService:n}=t,i=e.closest('[em="block"]');if(!i)return;const o=KP(i,r);if(!o)return;DL(i);const s=i.getAttribute("em-block-id"),a=i.getAttribute("em-block-version");n.send({operation:"application_eblock_add",data:pn({html:o.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function ZP(e){const t=document.querySelector(".em-element-editor:not(.of-atom)");if(!t)return;const r=(t.closest('[em="block"]')||t.closest('[em="group"]'))?.getBoundingClientRect().top||0;if(e.scrollTop>r+55){const n=e.scrollTop-r;t.style.top=n+8+"px"}else t.style.removeProperty("top")}function JP(e){const t=document.querySelector(".em-element-editor");if(!t)return;const r=t.getBoundingClientRect(),n=document.querySelector(".em-element-editor-widget");n&&(r.top<0?n.classList.add("sticky"):n.classList.remove("sticky"),r.top+t.offsetHeight-10-n.offsetHeight<0&&n.classList.remove("sticky"),e(!1))}function Im(){return _e.get("emailWidth")}function eN(e){const t=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let r=0;r<t.length;r++){const n=t[r];if(n.classList.contains("em-insert-ignore"))continue;const i=n.getAttribute("width");if(i!=null&&i!=="")return!0}return!1}function tN(e,t){const r=Im(),n=document.createElement("table");n.replaceChildren(...xe(e.blockHTML));let i=660;if(e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){i=0;const a=n.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(document.body.clientWidth>(r||a))i=e.targetBlock.clientWidth;else{const l=e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(l&&l.parentElement){l.parentElement.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").forEach(f=>{i+=parseFloat(f.getAttribute("width")||"0")});const c=l.parentElement.closest("td"),u=parseFloat(c?.style.paddingLeft||"0")||0,d=parseFloat(c?.style.paddingRight||"0")||0;i+=u,i+=d}}}else if(e.targetBlock.closest(".container-td"))i=parseInt(String(e.targetBlock.offsetWidth));else{const a=e.targetBlock.querySelector('table[style*="max-width"]'),l=e.targetBlock.querySelector('div[style*="max-width"]'),c=e.targetBlock.querySelector('.row-content[style*="width"]');a?i=parseInt(String(a.offsetWidth)):l?i=parseInt(String(l.offsetWidth)):c?i=parseInt(String(c.offsetWidth)):i=e.targetBlock.style.maxWidth?parseFloat(e.targetBlock.style.maxWidth):e.targetBlock.getBoundingClientRect().width}let o=n.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){o=0;const a=n.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}}if(n.querySelector('div[style*="inline-block"]')){if(i<660&&n.querySelector('div[style*="inline-block"]'))if(n.querySelectorAll('div[style*="inline-block"]').length>1)n.querySelectorAll('div[style*="inline-block"]').forEach(a=>{const l=a,c=parseFloat(l.style.width),u=c/o,d=a.firstElementChild;if(!d)return;const f=c-parseFloat(d.getAttribute("width")||"0"),h=parseFloat(String(i*u));l.style.width=h+"px",d.setAttribute("width",String(h-f)),Fr({elem:l,width:h})});else{const a=n.querySelector('div[style*="inline-block"]');a.style.maxWidth=i+"px",Fr({elem:a,width:i}),a.firstElementChild&&(a.firstElementChild.setAttribute("width",String(Math.round(i*.91))),a.firstElementChild.style.maxWidth=Math.round(i*.91)+"px")}}else if(n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){const a=[];n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(function(l){const c=Sl(l);c&&a.indexOf(c)===-1&&a.push(c)}),a.forEach(l=>{const c=l.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(!c||!c.parentElement)return;const u=c.parentElement.closest("td"),d=parseFloat(u?.style.paddingLeft||"0")||0,f=parseFloat(u?.style.paddingRight||"0")||0;if(l.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length>1){if(!eN(l))return;const h=l.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),g=h?parseFloat(h.getAttribute("width")||"0"):0,y=l.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").length;let A=0,L=0;l.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(E=>{if(E.getAttribute("width")&&!E.classList.contains("em-insert-ignore")){const m=parseFloat(E.getAttribute("width"))/o,b=Math.round(parseFloat(String(i*m))-g/(y*2));E.setAttribute("width",String(b)),A+=b}});const C=i-(d+f+g*(y-1)+A);l.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(E=>{if(E.getAttribute("width")&&!E.classList.contains("em-insert-ignore")){const m=parseFloat(E.getAttribute("width"))+Math.round(C/y);L+=m,E.setAttribute("width",String(m)),E.querySelector("img")&&E.querySelectorAll("img").forEach(b=>{parseFloat(b.getAttribute("width")||"0")>parseFloat(E.getAttribute("width"))+Math.round(C/y)&&(b.setAttribute("width",E.getAttribute("width")),b.style.maxWidth=E.getAttribute("width")+"px")})}}),L=L+g*(y-1)+d+f;const O=i-L;if(O!==0&&A>0){const E=l.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(E&&!E.classList.contains("em-insert-ignore")){const m=parseFloat(E.getAttribute("width")||"0");E.setAttribute("width",String(m+O))}else{const m=l.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let b=m.length-1;b>=0;b--){const S=m[b];if(S.classList.contains("em-insert-ignore"))continue;const p=parseFloat(S.getAttribute("width")||"0");S.setAttribute("width",String(p+O));break}}}}else if(c.getAttribute("width")&&!c.classList.contains("em-insert-ignore")){const h=Math.round(i-d-f);c.setAttribute("width",String(h))}})}const s=n.querySelector("tr");return s?Nt(s):Se(n)}function rN(e,t){const r=Im(),n=document.createElement("table");n.replaceChildren(...xe(e.blockHTML));let i=660;const o=e.targetBlock.tagName==="TR"?document.createElement("table"):document.createElement("div");if(o.style.width=r+"px",o.style.height="1000px",o.style.borderCollapse="collapse",o.setAttribute("cellpadding","0"),o.setAttribute("cellspacing","0"),o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",document.body.appendChild(o),o.innerHTML=t.getOuterHtml(e.targetBlock),r)i=r;else{const l=o.querySelector('table[style*="max-width"]'),c=o.querySelector('div[style*="max-width"]'),u=o.querySelector('.row-content[style*="width"]');if(l)i=parseInt(String(l.offsetWidth));else if(c)i=parseInt(String(c.offsetWidth));else if(u)i=parseInt(String(u.offsetWidth));else{const d=o.querySelector(e.targetBlock.tagName);i=d?.style.maxWidth?parseFloat(d.style.maxWidth):d?.getBoundingClientRect().width||660}}document.body.removeChild(o);const s=n.querySelector("table:first-child");s?.style.maxWidth&&(s.style.maxWidth=i+"px",Fr({elem:s,width:i}));const a=n.querySelector("tr");return a?Nt(a):Se(n)}function ul(e){const t=e.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap");if(!t.length)return;const r=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),n=Array.from(r).filter(u=>!u.classList.contains("em-insert-ignore")&&u.getAttribute("width")!=null&&u.getAttribute("width")!=="");if(n.length===0)return;const i=e.parentElement?.getBoundingClientRect().width||0;let o=0,s=0;t.forEach(u=>{o+=parseFloat(u.getAttribute("width")||"0")});let a=e.querySelector(".em-mob-wrap");for(;a&&a!==e.parentElement?.parentElement;){const u=window.getComputedStyle(a),d=parseFloat(u.paddingLeft)||0,f=parseFloat(u.paddingRight)||0;(d>0||f>0)&&(s+=d+f),a=a.parentElement}const l=i-(o+s),c=n.length;n.forEach(u=>{const d=parseFloat(u.getAttribute("width")||"0")+Math.ceil(l/c);u.setAttribute("width",String(d))})}function nN(e){const t={all:null,top:null,right:null,bottom:null,left:null},r={all:null,top:null,right:null,bottom:null,left:null},n=ts({elem:e}),i=n.mobileWidth,o=n.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),(n.mobilePadding.all!==null||n.mobilePadding.top!==null||n.mobilePadding.right!==null||n.mobilePadding.bottom!==null||n.mobilePadding.left!==null)&&(n.mobilePadding.all?!n.mobilePadding.all&&n.mobilePadding.top&&n.mobilePadding.right&&n.mobilePadding.bottom&&n.mobilePadding.left&&n.mobilePadding.top===n.mobilePadding.right&&n.mobilePadding.right===n.mobilePadding.bottom&&n.mobilePadding.bottom===n.mobilePadding.left?r.all=parseFloat(String(n.mobilePadding.top)):r.all=n.mobilePadding.all!==null?parseFloat(String(n.mobilePadding.all)):null:r.all=null,r.top=n.mobilePadding.top!==null?parseFloat(String(n.mobilePadding.top)):n.mobilePadding.all===null?null:n.mobilePadding.all,r.right=n.mobilePadding.right!==null?parseFloat(String(n.mobilePadding.right)):n.mobilePadding.all===null?null:n.mobilePadding.all,r.bottom=n.mobilePadding.bottom!==null?parseFloat(String(n.mobilePadding.bottom)):n.mobilePadding.all===null?null:n.mobilePadding.all,r.left=n.mobilePadding.left!==null?parseFloat(String(n.mobilePadding.left)):n.mobilePadding.all===null?null:n.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:rc(e),backgroundColor:e.style.backgroundColor?ye(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:tc(e),boxShadow:nc(e),mobileWidth:{value:i!==null?i:null,dim:n.mobileWidthDim},mobileHeight:{value:o!==null?o:null,dim:n.mobileHeightDim},mobileBorder:n.mobileBorder,mobileBorderRadius:n.mobileBorderRadius,mobileBoxShadow:n.mobileBoxShadow,mobileAlign:n.mobileAlign,mobileVerticalAlign:n.mobileVerticalAlign,mobileDirection:n.mobileDirection,mobileBackgroundColor:n.mobileBackgroundColor,mobileBackgroundImage:n.mobileBackgroundImage,mobileBackgroundPositionX:n.mobileBackgroundPositionX,mobileBackgroundPositionY:n.mobileBackgroundPositionY,mobileBackgroundRepeat:n.mobileBackgroundRepeat,mobileBackgroundSize:n.mobileBackgroundSize,mobilePadding:r,show:n.show,exportAsPicture:e.getAttribute("em-operation")==="exportAsPicture",outlookBackground:is(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 iN(e){let t=[],r=null,n=null,i="",o,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(o=!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&&(r=parseFloat(c.nextElementSibling.getAttribute("width")||"0"),n=ts({elem:c.nextElementSibling}).mobileHeight||0),(l.classList.contains("em-mob-wrap-cancel")||l.classList.contains("noresp-em-mob-wrap-cancel"))&&(o=!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}],r=0}i=a.parentElement.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.getAttribute("valign")||"",(e.elem.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap").parentElement.closest("td"))?.getAttribute("dir")==="rtl"&&(s=!0)}else{const a=e.elem.closest('div[style*="inline-block"]');if(a&&a.parentElement.querySelectorAll('div[style*="inline-block"]').length>1)a.parentElement.querySelectorAll('div[style*="inline-block"]').forEach(l=>{const c=l;if(!c.style.fontFamily){const u=l.firstElementChild;t.push({width:parseFloat(u?.getAttribute("width")||"0"),current:l===a});const d=u?.getAttribute("width"),f=parseFloat(c.style.width);r=f-(!d||d.indexOf("%")>-1?f:parseFloat(d))}});else{const l=a?.parentElement?.querySelector('div[style*="inline-block"]');t=[{width:parseFloat(l?.firstElementChild?.getAttribute("width")||"0"),current:!0}],r=0}i=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:r,gapMobile:n,valign:i,wrap:o,dirRevers:s}}var oN='table[em-type="social"]';function sN(e){return e.closest(oN)}function aN(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 Bm(e){const t=sN(e);if(t&&e!==t&&aN(e,t))return t;const r=e.parentNode;if(!r)return!1;const n=r.tagName,i=r.style,o=r.parentNode;return n==="TD"||n==="TABLE"&&o?.style.display!=="inline-block"&&!e.closest(".em-narrow-table")&&r.getAttribute("em")!=="atom"||n==="DIV"&&(i.display==="inline-block"||i.display==="table-cell")&&i.verticalAlign||(n==="DIV"||n==="TABLE")&&lN(i)?r:Bm(r)}function lN(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 Ht(e,t){return{settings:e,elem:t}}var Q=null;function cN(e){Q=e}function uN(){return _e.get("emailWidth")||475}function bo(){return document.documentElement.clientWidth<=uN()}function dl(e,t,r,n){if(!Q)return;const i=e;i.style.cursor=r,i.mousemove=t,i.onmousedown=function(){window.getSelection()?.removeAllRanges(),Q.applicationElementSettingsSet({elem:e});const o=document.querySelector("[em-edit]");o&&Q.setCursorPosition(o),document.documentElement.classList.add("em-resize-start");try{document.documentElement.addEventListener("mousemove",i.doDrag,!1),document.documentElement.addEventListener("mouseup",i.stopDrag,!1)}catch{}},i.doDrag=function(o){if(o.which!=1){i.stopDrag();return}i.mousemove(o)},i.stopDrag=function(){document.documentElement.removeEventListener("mousemove",i.doDrag,!1),document.documentElement.removeEventListener("mouseup",i.stopDrag,!1),n&&n(),setTimeout(()=>{document.documentElement.classList.remove("em-resize-start"),Q.commit(!1)})}}function zt(e,t,r){dl(e,t,"ns-resize",r)}function Nn(e,t,r){dl(e,t,"ew-resize",r)}function dN(e,t,r){dl(e,t,"nwse-resize",r)}function Vt(e,t){if(!Q)return;let r=null,n=0;const i=bo();if(e.closest('div[style*="font-size"][style*="line-height"]')){if(r=e.closest('div[style*="height"][style*="line-height"]'),!r)return;n=r.clientHeight+t,i?ti(Ht({mobileHeight:{value:n>0?n:0,dim:"px",classNamePrefix:"em-mob-height-"}},r)):(r.style.height=n+"px",r.style.lineHeight=n+"px")}else if(e.closest(".em-gap")){if(r=e.closest(".em-gap"),!r)return;r.classList.add("em-hover"),n=r.clientHeight+t,r.closest("tr")?.querySelectorAll(".em-gap").forEach(o=>{const s={mobileHeight:{value:n>0?n:0,dim:"px",classNamePrefix:"em-mob-height-"}},a=o.closest(".em-mob-wrap, .noresp-em-mob-wrap");ti(Ht(s,a)),o.style.height=n+"px";const l=o.querySelector(".em-element-gap-value");l&&(l.innerHTML=n+"px")})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(r=e.closest(".em-vindent-paddingTop"),!r)return;const o=r.parentElement;r.classList.add("em-hover"),n=r.clientHeight+t,r.style.height=n+"px",i&&o?zr(Ht({mobilePadding:{top:n>0?n:0,classNamePrefix:"em-mob-padding_"}},o)):o&&(o.style.paddingTop=n+"px")}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(r=e.closest(".em-vindent-paddingBottom"),!r)return;const o=r.parentElement;r.classList.add("em-hover"),n=r.clientHeight+t,r.style.height=n+"px",i&&o?zr(Ht({mobilePadding:{bottom:n>0?n:0,classNamePrefix:"em-mob-padding_"}},o)):o&&(o.style.paddingBottom=n+"px")}else{if(r=e.closest("td"),!r)return;n=r.clientHeight+t,i?ti(Ht({mobileHeight:{value:n>0?n:0,dim:"px",classNamePrefix:"em-mob-height-"}},r)):r.setAttribute("height",String(n))}if(r&&!e.closest(".em-gap")){if(n>=0){const o=r.querySelector(".em-element-vindent-value");o&&(o.innerHTML=n+"px")}n<30?r.classList.add("em-vindent_low"):r.classList.remove("em-vindent_low")}r&&Q.commit()}function Wt(e){if(!Q)return;let t=null;const r=bo();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():Q.applicationElementSettingsSet({elem:t})}else if(e.closest(".em-gap")){if(t=e.closest(".em-gap"),!t)return;Q.applicationElementSettingsSet({elem:t.closest('[em="block"] > td')})}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 n=t.parentElement;parseInt(t.style.height)<=0?r&&n?Q.applicationElementSettingsSet({elem:n}):n&&n.style.removeProperty("padding-top"):n&&Q.applicationElementSettingsSet({elem:n})}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 n=t.parentElement;parseInt(t.style.height)<=0?r&&n?Q.applicationElementSettingsSet({elem:n}):n&&n.style.removeProperty("padding-bottom"):n&&Q.applicationElementSettingsSet({elem:n})}else{if(t=e.closest("td"),!t)return;const n=t.getAttribute("height");n&&parseInt(n)<=0?t.closest("table")?.remove():Q.applicationElementSettingsSet({elem:t})}t&&Q.commit()}function Pr(e,t){if(!Q)return;let r=null,n=0;const i=bo();if(e.closest(".em-element-resize-img-container")){const o=e.closest(".em-element-resize-img-container")?.querySelector("img");if(!o)return;const s=o.clientWidth+t;o.style.maxWidth=s+"px",o.setAttribute("width",String(s)),Q.commit()}else if(e.closest(".em-gap")){if(r=e.closest(".em-gap"),!r)return;if(r.classList.add("em-hover"),n=r.clientWidth+t,n>=0){const o=r.clientWidth,s=Array.from(r.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)*o,c=r.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(A=>A.dataset.percent).map(A=>A.dataset.percent);u.length||(u=s.map(A=>((A||0)/a*100).toFixed(1)),Tl(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")));const d=l-(s.length-1)*n,f=(A,L)=>Math.round(L*parseFloat(A)/100);let h=s.map((A,L)=>f(u[L],d));const g=l-(h.reduce((A,L)=>A+L,0)+(s.length-1)*n);if(g!==0){const A=h.length-Math.abs(g);h=h.map((L,C)=>A<=C?L+(g>0?1:-1):L)}const y=h;c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((A,L)=>{Array.from(A.querySelectorAll("table[width]")).filter(C=>!C.getAttribute("width")?.includes("%")).forEach(C=>{+(C.getAttribute("width")||0)<=y[L]&&(C.style.maxWidth=String(y[L]),C.setAttribute("width","100%"))})}),r.style.width=n+"px",c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((A,L)=>A.setAttribute("width",String(y[L]))),c.querySelectorAll(".em-gap").forEach(A=>{A.parentElement?.setAttribute("width",String(n)),A.style.width=n+"px";const L=A.querySelector(".em-element-gap-value");L&&(L.innerHTML=n+"px")})}}}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingLeft")){if(r=e.closest(".em-vindent-paddingLeft"),!r)return;const o=r.parentElement;r.classList.add("em-hover"),n=r.clientWidth+t,r.style.width=n+"px",i&&o?zr(Ht({mobilePadding:{left:n>0?n:0,classNamePrefix:"em-mob-padding_"}},o)):o&&(o.style.paddingLeft=n+"px",o.querySelectorAll(":scope > table").forEach(s=>ul(s)))}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingRight")){if(r=e.closest(".em-vindent-paddingRight"),!r)return;const o=r.parentElement;r.classList.add("em-hover"),n=r.clientWidth+t,r.style.width=n+"px",i&&o?zr(Ht({mobilePadding:{right:n>0?n:0,classNamePrefix:"em-mob-padding_"}},o)):o&&(o.style.paddingRight=n+"px",o.querySelectorAll(":scope > table").forEach(s=>ul(s)))}if(r&&!e.closest(".em-gap")){if(n>=0){const o=r.querySelector(".em-element-vindent-value, .em-element-gap-value");o&&(o.innerHTML=n+"px")}n<30?r.classList.add("em-vindent_low"):r.classList.remove("em-vindent_low")}r&&Q.commit()}function Nr(e){if(!Q)return;let t=null;const r=bo();if(e.closest(".em-element-resize-img-container")){const n=e.closest(".em-element-resize-img-container")?.querySelector("img");n&&(Q.applicationElementSettingsSet({elem:n}),Q.commit())}else if(e.closest(".em-gap"))t=e.closest(".em-gap"),t&&Q.applicationElementSettingsSet({elem:t.closest('[em="block"] > td')});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 n=t.parentElement;parseInt(t.style.width)<=0?r&&n?Q.applicationElementSettingsSet({elem:n}):n&&n.style.removeProperty("padding-left"):n&&Q.applicationElementSettingsSet({elem:n})}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 n=t.parentElement;parseInt(t.style.width)<=0?r&&n?Q.applicationElementSettingsSet({elem:n}):n&&n.style.removeProperty("padding-right"):n&&Q.applicationElementSettingsSet({elem:n})}t&&Q.commit()}var fN='<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>',hN='<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>',mN='<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>',pN='<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>',gN='<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>',fl='<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>',bN='<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>',yN='<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>',vN='<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 yo(e,t,r=""){const n=`class="${t}" width="1em" height="1em" fill="currentColor" aria-hidden="true"`;return e.replace("<svg",`<svg ${n}${r?` ${r}`:""}`)}var Mn=null;function EN(e){Mn=e}function _N(){if(!Mn)return;const e=_e.get("applicationTheme")||"light";let t=!1;try{Mn.textDocument.beginUpdate();const r=[...document.querySelectorAll('[em="css"]')].map(s=>s.getAttribute("href"));let n=document.getElementsByTagName("head")[0];if(!n)if(document.documentElement)n=document.createElement("head"),document.documentElement.insertBefore(n,document.documentElement.firstChild),t=!0;else return;const i="css/sandbox.css?46f9d75a";if(r.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),n.appendChild(s),t=!0}const o=`css/sandbox-${e}.css?46f9d75a`;if(r.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),n.appendChild(s),t=!0}}finally{Mn.textDocument.endUpdate()}t&&Mn.commit(!1)}var SN='<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>',vo=null,wN=".em-prevent-action",Fm=new WeakSet;function CN(e){vo=e}function AN(){return _e.get("emailWidth")||475}function TN(){return _e.get("isLeftButtonDown")||!1}function kN(){return _e.get("editImageControlEnabled")||!1}function jm(){return _e.get("imageCenterEditorEnabled")||!1}function LN(){return _e.get("imageCenterStockEnabled")||!1}function ON(){return _e.get("imageCenterGifEnabled")||!1}function xN(){return _e.get("elementAIimageEnabled")||!1}function PN(e){if(!vo||document.body?.classList.contains("em-native-file-drag"))return;const t=vo.getLocale(),r=AN(),n=TN(),i=jm(),o=document.documentElement.clientWidth<=(r||475);if(document.body&&!document.body.classList.contains("mceNonEditable")&&!n){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 g=z({targetElement:e,insertType:"append",className:"em-element-resize-height"});z({targetElement:e,insertType:"append",className:"em-element-vindent"}),z({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),zt(g,function(y){Vt(g,y.movementY)},function(){Wt(g)})}if(e.closest(wN))return;if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.getAttribute("height")&&!e.querySelector(".em-element-vindent-value")){const g=At(e,"em-mob-height"),y=g?parseFloat(g.substring(14,g.length-2)):void 0;z({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:o?(y||e.getAttribute("height"))+"px":e.getAttribute("height")+"px"}),!o||!y?parseInt(e.getAttribute("height")||"0")<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):y<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 g=z({targetElement:e,insertType:"append",className:"em-element-resize-height"}),y=z({targetElement:e,insertType:"append",className:"em-element-vindent"});z({targetElement:y,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),z({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),zt(g,function(A){Vt(g,A.movementY)},function(){Wt(g)})}if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.style.height&&e.style.fontSize&&!e.querySelector(".em-element-vindent-value")){const g=At(e,"em-mob-height"),y=g?parseFloat(g.substring(14,g.length-2)):void 0;z({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:o?(y||parseFloat(e.style.height))+"px":parseFloat(e.style.height)+"px"}),!o||!y?parseFloat(e.style.height)<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):y<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}const s=At(e,"em-mob-padding_top"),a=s?parseFloat(s.substring(19)):void 0,l=At(e,"em-mob-padding_bottom"),c=l?parseFloat(l.substring(22)):void 0,u=At(e,"em-mob-padding_left"),d=u?parseFloat(u.substring(20)):void 0,f=At(e,"em-mob-padding_right"),h=f?parseFloat(f.substring(21)):void 0;if((e.style.padding||e.style.paddingTop||e.style.paddingBottom||e.style.paddingLeft||e.style.paddingRight)&&!e.closest("editor")&&(e.tagName!=="A"||e.style.height)){if(e.style.paddingTop&&!e.querySelector(":scope > .em-vindent-paddingTop")&&!e.querySelector(":scope > editor > .em-vindent-paddingTop")&&(!a||!o)){const g=z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${e.style.paddingTop}`});e.getBoundingClientRect().top<30&&g.classList.add("top-crossed")}e.style.paddingBottom&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&!e.querySelector(":scope > editor > .em-vindent-paddingBottom")&&(!c||!o)&&z({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||!o)&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${e.style.paddingLeft}`}),e.style.paddingRight&&!e.querySelector(":scope > .em-vindent-paddingRight")&&!e.querySelector(":scope > editor > .em-vindent-paddingRight")&&(!h||!o)&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${e.style.paddingRight}`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(g=>{if(!g.querySelector(".em-element-resize-height")){const y=g;(parseFloat(y.style.height)<30||parseFloat(y.style.width)<30)&&g.classList.add("em-vindent_low");const A=z({targetElement:y,insertType:"append",className:"em-element-resize-height"});z({targetElement:y,insertType:"append",className:"em-element-vindent-marker"}),z({targetElement:y,insertType:"append",className:"em-element-vindent-bg"});const L=z({targetElement:y,insertType:"append",className:"em-element-vindent"});let C="";y.className.indexOf("paddingTop")>-1?(C=e.style.paddingTop,zt(A,function(O){Vt(A,O.movementY)},function(){Wt(A)})):y.className.indexOf("paddingBottom")>-1?(C=e.style.paddingBottom,zt(A,function(O){Vt(A,O.movementY)},function(){Wt(A)})):y.className.indexOf("paddingLeft")>-1?(C=e.style.paddingLeft,Nn(A,function(O){Pr(A,O.movementX)},function(){Nr(A)})):y.className.indexOf("paddingRight")>-1&&(C=e.style.paddingRight,Nn(A,function(O){Pr(A,-O.movementX)},function(){Nr(A)})),z({targetElement:L,insertType:"append",className:"em-element-vindent-value",HTMLcontent:C})}})}if(e.className.length&&e.className?.includes("em-mob-padding")&&!e.closest("editor")&&o&&(a&&!e.querySelector(":scope > .em-vindent-paddingTop")&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${a}px`}),c&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${c}px`}),d&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${d}px`}),h&&!e.querySelector(":scope > .em-vindent-paddingRight")&&z({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${h}px`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(g=>{if(!g.querySelector(".em-element-resize-height")){const y=g;(parseFloat(y.style.height)<30||parseFloat(y.style.width)<30)&&g.classList.add("em-vindent_low");const A=z({targetElement:y,insertType:"append",className:"em-element-resize-height"});z({targetElement:y,insertType:"append",className:"em-element-vindent-marker"}),z({targetElement:y,insertType:"append",className:"em-element-vindent-bg"});const L=z({targetElement:y,insertType:"append",className:"em-element-vindent"});let C="";y.className.indexOf("paddingTop")>-1?(C=a,zt(A,function(O){Vt(A,O.movementY)},function(){Wt(A)})):y.className.indexOf("paddingBottom")>-1?(C=c,zt(A,function(O){Vt(A,O.movementY)},function(){Wt(A)})):y.className.indexOf("paddingLeft")>-1?(C=d,Nn(A,function(O){Pr(A,O.movementX)},function(){Nr(A)})):y.className.indexOf("paddingRight")>-1&&(C=h,Nn(A,function(O){Pr(A,-O.movementX)},function(){Nr(A)})),z({targetElement:L,insertType:"append",className:"em-element-vindent-value",HTMLcontent:String(C)})}})),e.closest('[em="block"]')?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length||0)>2&&!e.closest('[em="block"]')?.querySelector(".em-mob-wrap .em-gap, .noresp-em-mob-wrap .em-gap")){const g=At(e.closest('[em="block"]')?.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),"em-mob-height"),y=g?parseFloat(g.substring(14,g.length-2)):void 0;e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(A=>{z({targetElement:A,insertType:"append",className:"em-gap",style:o?`height: ${y}px;`:`width: ${A.getAttribute("width")}px;`})}),e.closest('[em="block"]')?.querySelectorAll(".em-gap").forEach(A=>{if(!A.querySelector(".em-element-resize-height")){const L=A,C=z({targetElement:L,insertType:"append",className:"em-element-resize-height"});z({targetElement:L,insertType:"append",className:"em-element-gap-marker"}),z({targetElement:L,insertType:"append",className:"em-element-gap-bg"});const O=z({targetElement:L,insertType:"append",className:"em-element-gap"});let E="";o?(E=L.style.height,zt(C,function(m){Vt(C,m.movementY)},function(){Wt(C)})):(E=L.style.width,Nn(C,function(m){Pr(C,m.movementX)},function(){Nr(C)})),z({targetElement:O,insertType:"append",className:"em-element-gap-value",HTMLcontent:E})}})}if(e.tagName==="IMG"){const g=e;if(g.closest("td[em-platform], td[data-em-platform]"))return;if(g.closest(".em-element-resize-img-container")||g.closest('div[style*="font-size"][style*="line-height"][style*="font-family"]')||g.closest("editor")||g.classList.contains("em-video")){if(g.closest(".em-element-resize-img-container")){const C=g.closest(".em-element-resize-img-container"),O=C.querySelector(".em-element-img-edit");!g.getAttribute("src")?.includes(".gif")&&i?O||z({targetElement:C.querySelector(".em-element-img-change-group"),insertType:"prepend",className:"em-element-img-edit",tag:"i",HTMLcontent:yo(fl,`${ii}`),title:t.CHANGE_IMAGE_EDIT}):C.querySelector(".em-element-img-edit")?.remove()}return}const y=document.createElement("span");y.classList.add("em-element-resize-img-container");const A=g.parentElement instanceof HTMLAnchorElement?g.parentElement:g;A.parentElement?.insertBefore(y,A),y.appendChild(A);const L=z({targetElement:y,insertType:"append",tag:"span",className:"em-element-resize-img"});dN(L,function(C){Pr(L,C.movementX)},function(){Nr(L)}),g?.style.maxWidth&&g?.style.display==="block"&&g.closest(".em-element-resize-img-container")?.classList.add("em-display-block"),$m(g,y)}}}function $m(e,t){const r=vo;if(!r||t.querySelector(".em-element-img-change-group"))return;const n=r.getLocale(),i=kN(),o=jm(),s=LN(),a=ON(),l=xN();if(i&&e.getBoundingClientRect().width>40&&e.getBoundingClientRect().height>40&&!e.classList.contains("em-countdown")){const c=z({targetElement:t,insertType:"append",className:"em-element-img-change-group"});if(z({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:n.CHANGE_IMAGE}),!e.getAttribute("src")?.includes(".gif")&&o&&z({targetElement:c,insertType:"append",className:"em-element-img-edit",tag:"i",HTMLcontent:yo(fl,`${ii}`),title:n.CHANGE_IMAGE_EDIT}),s&&z({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:n.CHANGE_IMAGE_STOCK}),z({targetElement:c,insertType:"append",className:"em-element-img-changeto",tag:"i",HTMLcontent:yo(SN,`${ii}`),title:n.CHANGE_IMAGE_CHANGETO}),a&&z({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:n.CHANGE_IMAGE_GIF}),l&&z({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:n.CHANGE_IMAGE_AI}),r.commit(!1),Fm.has(c))return;Fm.add(c),c.addEventListener("click",function(u){const d=u.target.closest('i[class*="em-element-img"]');let f={};e.classList.contains("em-ai-img")||d?.classList.contains("em-element-img-ai")?f={operation:"application_open-image-ai-popup"}:GL(e.getAttribute("src"))||d?.classList.contains("em-element-img-changeto")?f={operation:"application_open-image-upload-popup",src:e.getAttribute("src")}:d?.classList.contains("em-element-img-gif")?f={operation:"application_open-image-gif-popup",src:e.getAttribute("src")}:d?.classList.contains("em-element-img-stock")?f={operation:"application_open-image-stock-popup",src:e.getAttribute("src")}:f={operation:"application_open-image-edit-popup",src:e.getAttribute("src")},setTimeout(()=>{r.messageService.send(f)},100)})}}function NN(){return document.body?.classList.contains("em-sandbox-discuss")&&!document.body.classList.contains("em-sandbox-discuss_set-target")}function MN(){return document.body?.classList.contains("em-sandbox-discuss_set-target")??!1}function RN(e){const t=e.getAttribute("em-discuss-id");return t&&X.send({operation:"application_discuss_get_comment",settings:{targetId:t}}),!1}function DN(e,t){let r=e;const n=r.getAttribute("em-discuss-id"),i=r.classList.contains("em-discuss-id-new");if(!n||n&&i){if(document.querySelectorAll(".em-discuss-id-new").forEach(o=>{o!==r&&(o.removeAttribute("em-discuss-id"),o.removeAttribute("contenteditable"),o.removeAttribute("em-edit"))}),r.tagName==="EDITOR"&&(r=r.parentElement),r.getAttribute("em-discuss-id"))r.removeAttribute("em-discuss-id"),r.removeAttribute("contenteditable"),r.removeAttribute("em-edit"),X.send({operation:"application_discuss_set_id",settings:{value:""}});else{const o=t.makeId(5);r.setAttribute("em-discuss-id",o),r.setAttribute("em-edit","active"),r.setAttribute("contenteditable","true"),r.classList.add("em-discuss-id-new"),X.send({operation:"application_discuss_set_id",settings:{value:o}})}t.commit()}return{handled:!0,newClickedElement:r}}Object.defineProperty(_,"AppImpl",{enumerable:!0,get:function(){return Ui}}),Object.defineProperty(_,"CLASS_BACKGROUND_ACTIVE_CELL",{enumerable:!0,get:function(){return Ov}}),Object.defineProperty(_,"CLASS_FOR_BASIC_CELL",{enumerable:!0,get:function(){return kv}}),Object.defineProperty(_,"CLASS_FOR_BASIC_ROW",{enumerable:!0,get:function(){return Lv}}),Object.defineProperty(_,"CLASS_NAME_OL",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(_,"CLASS_NAME_UL",{enumerable:!0,get:function(){return Wn}}),Object.defineProperty(_,"DEFAULT_LINK_COLOR",{enumerable:!0,get:function(){return Rb}}),Object.defineProperty(_,"DOCUMENT_MAPPING_ID",{enumerable:!0,get:function(){return Qo}}),Object.defineProperty(_,"Disposable",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(_,"EVENT_TYPES",{enumerable:!0,get:function(){return me}}),Object.defineProperty(_,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return Xo}}),Object.defineProperty(_,"ICON_ROLE",{enumerable:!0,get:function(){return ni}}),Object.defineProperty(_,"ICON_SIZE",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(_,"IMAGE_CACHE_ID",{enumerable:!0,get:function(){return Zo}}),Object.defineProperty(_,"LIST_REGEX",{enumerable:!0,get:function(){return Sv}}),Object.defineProperty(_,"LIST_TEMP_CLASSES",{enumerable:!0,get:function(){return Rc}}),Object.defineProperty(_,"Node",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(_,"NodeType",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_,"REMOTE_DOCUMENT_ID",{enumerable:!0,get:function(){return Yo}}),Object.defineProperty(_,"STANDARD_LIST_CONTAINER_SELECTOR",{enumerable:!0,get:function(){return Yp}}),Object.defineProperty(_,"STANDARD_LIST_CONTAINER_TAGS",{enumerable:!0,get:function(){return Xp}}),Object.defineProperty(_,"STANDARD_LIST_STYLES",{enumerable:!0,get:function(){return Kp}}),Object.defineProperty(_,"TABLE_LIST_SELECTOR",{enumerable:!0,get:function(){return Gp}}),Object.defineProperty(_,"TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR",{enumerable:!0,get:function(){return ps}}),Object.defineProperty(_,"TEMPORARY_CELL_CLASS",{enumerable:!0,get:function(){return Pv}}),Object.defineProperty(_,"TEMPORARY_CLASS",{enumerable:!0,get:function(){return xv}}),Object.defineProperty(_,"TEXT_DOCUMENT_ID",{enumerable:!0,get:function(){return Ko}}),Object.defineProperty(_,"UpdateQueue",{enumerable:!0,get:function(){return dO}}),Object.defineProperty(_,"__vitePreload",{enumerable:!0,get:function(){return gs}}),Object.defineProperty(_,"_defineProperty",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_,"addBlockToProject",{enumerable:!0,get:function(){return QP}}),Object.defineProperty(_,"addClassToSecondCell",{enumerable:!0,get:function(){return Cg}}),Object.defineProperty(_,"addElement",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_,"addFontFamilyClass",{enumerable:!0,get:function(){return Wh}}),Object.defineProperty(_,"addNewRange",{enumerable:!0,get:function(){return bp}}),Object.defineProperty(_,"applyAttributesToTag",{enumerable:!0,get:function(){return SP}}),Object.defineProperty(_,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return Vh}}),Object.defineProperty(_,"applyVMLBackgroundToggle",{enumerable:!0,get:function(){return my}}),Object.defineProperty(_,"arrow_down_solid_default",{enumerable:!0,get:function(){return fN}}),Object.defineProperty(_,"arrow_up_solid_default",{enumerable:!0,get:function(){return hN}}),Object.defineProperty(_,"attachFocusService",{enumerable:!0,get:function(){return xp}}),Object.defineProperty(_,"braille_solid_default",{enumerable:!0,get:function(){return mN}}),Object.defineProperty(_,"buildEmFontClassName",{enumerable:!0,get:function(){return Qn}}),Object.defineProperty(_,"captionByRules",{enumerable:!0,get:function(){return Yx}}),Object.defineProperty(_,"changeBullets",{enumerable:!0,get:function(){return Zp}}),Object.defineProperty(_,"changeBulletsColor",{enumerable:!0,get:function(){return Jp}}),Object.defineProperty(_,"changeBulletsItalic",{enumerable:!0,get:function(){return rg}}),Object.defineProperty(_,"changeBulletsSize",{enumerable:!0,get:function(){return eg}}),Object.defineProperty(_,"changeBulletsStrikethrough",{enumerable:!0,get:function(){return ig}}),Object.defineProperty(_,"changeBulletsUnderline",{enumerable:!0,get:function(){return ng}}),Object.defineProperty(_,"changeBulletsWeight",{enumerable:!0,get:function(){return tg}}),Object.defineProperty(_,"checkBlockAdaptivity",{enumerable:!0,get:function(){return YP}}),Object.defineProperty(_,"checkForTextNodes",{enumerable:!0,get:function(){return Pm}}),Object.defineProperty(_,"checkForWorkClass",{enumerable:!0,get:function(){return fP}}),Object.defineProperty(_,"checkIsEditorInited",{enumerable:!0,get:function(){return LP}}),Object.defineProperty(_,"checkSandboxStyles",{enumerable:!0,get:function(){return _N}}),Object.defineProperty(_,"clearActiveEditElements",{enumerable:!0,get:function(){return OP}}),Object.defineProperty(_,"clearLinkTags",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(_,"clearPendingPaletteInsert",{enumerable:!0,get:function(){return Mc}}),Object.defineProperty(_,"clearProjectFontFaces",{enumerable:!0,get:function(){return Ji}}),Object.defineProperty(_,"commit",{enumerable:!0,get:function(){return Ap}}),Object.defineProperty(_,"commitLockedAsync",{enumerable:!0,get:function(){return Tp}}),Object.defineProperty(_,"commonStylesApply",{enumerable:!0,get:function(){return qO}}),Object.defineProperty(_,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return GO}}),Object.defineProperty(_,"compareStrings",{enumerable:!0,get:function(){return gp}}),Object.defineProperty(_,"container",{enumerable:!0,get:function(){return Xi}}),Object.defineProperty(_,"copy_solid_default",{enumerable:!0,get:function(){return pN}}),Object.defineProperty(_,"createBeforeInputHandler",{enumerable:!0,get:function(){return By}}),Object.defineProperty(_,"createFontClassName",{enumerable:!0,get:function(){return bb}}),Object.defineProperty(_,"createHandleChangesWithRemovedElementsOnly",{enumerable:!0,get:function(){return _O}}),Object.defineProperty(_,"createMapObj",{enumerable:!0,get:function(){return pO}}),Object.defineProperty(_,"createWrapEditor",{enumerable:!0,get:function(){return Iy}}),Object.defineProperty(_,"darkMode",{enumerable:!0,get:function(){return Eh}}),Object.defineProperty(_,"decrementLock",{enumerable:!0,get:function(){return Op}}),Object.defineProperty(_,"defaultVisibleTextMapFn",{enumerable:!0,get:function(){return EP}}),Object.defineProperty(_,"discuss_default",{enumerable:!0,get:function(){return Rv}}),Object.defineProperty(_,"display_default",{enumerable:!0,get:function(){return ML}}),Object.defineProperty(_,"editConditionalComment",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(_,"emFilter",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(_,"emFilterCSS",{enumerable:!0,get:function(){return PL}}),Object.defineProperty(_,"extractTableRowData",{enumerable:!0,get:function(){return cg}}),Object.defineProperty(_,"findElementWithSelectedText",{enumerable:!0,get:function(){return Al}}),Object.defineProperty(_,"findForeignButtonSpan",{enumerable:!0,get:function(){return us}}),Object.defineProperty(_,"findOutermostParentWithText",{enumerable:!0,get:function(){return Ep}}),Object.defineProperty(_,"findParentTr",{enumerable:!0,get:function(){return Sl}}),Object.defineProperty(_,"findParentWithExplicitStyle",{enumerable:!0,get:function(){return Tb}}),Object.defineProperty(_,"findParentWithExplicitStyle$1",{enumerable:!0,get:function(){return yp}}),Object.defineProperty(_,"findParentWithFontSizeAndTag",{enumerable:!0,get:function(){return vP}}),Object.defineProperty(_,"findRoundrectComment",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(_,"fontFamilyValues",{enumerable:!0,get:function(){return ac}}),Object.defineProperty(_,"fontValues",{enumerable:!0,get:function(){return Zn}}),Object.defineProperty(_,"formatCellOneText",{enumerable:!0,get:function(){return vg}}),Object.defineProperty(_,"getActiveEditElement",{enumerable:!0,get:function(){return kP}}),Object.defineProperty(_,"getAllComments",{enumerable:!0,get:function(){return iv}}),Object.defineProperty(_,"getCursorPositionType",{enumerable:!0,get:function(){return lg}}),Object.defineProperty(_,"getElementBorder",{enumerable:!0,get:function(){return tc}}),Object.defineProperty(_,"getElementBorderRadius",{enumerable:!0,get:function(){return rc}}),Object.defineProperty(_,"getElementBoxShadow",{enumerable:!0,get:function(){return nc}}),Object.defineProperty(_,"getElementInnerHTML",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_,"getElementMobileProps",{enumerable:!0,get:function(){return ts}}),Object.defineProperty(_,"getElementParent",{enumerable:!0,get:function(){return Bm}}),Object.defineProperty(_,"getElementTdDiv",{enumerable:!0,get:function(){return nN}}),Object.defineProperty(_,"getFontFamilyFromElement",{enumerable:!0,get:function(){return pP}}),Object.defineProperty(_,"getFontFamilyFromElement$1",{enumerable:!0,get:function(){return wb}}),Object.defineProperty(_,"getHtmlDocument",{enumerable:!0,get:function(){return Oo}}),Object.defineProperty(_,"getHtmlPartsAtCursor",{enumerable:!0,get:function(){return _g}}),Object.defineProperty(_,"getLineHeightInPixels",{enumerable:!0,get:function(){return mP}}),Object.defineProperty(_,"getLineHeightInPixels$1",{enumerable:!0,get:function(){return Sb}}),Object.defineProperty(_,"getListBullet",{enumerable:!0,get:function(){return Cv}}),Object.defineProperty(_,"getListContainer",{enumerable:!0,get:function(){return Av}}),Object.defineProperty(_,"getListContext",{enumerable:!0,get:function(){return wv}}),Object.defineProperty(_,"getOrCreateAfterSpan",{enumerable:!0,get:function(){return oP}}),Object.defineProperty(_,"getOuterHtml",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(_,"getParentElementOfSelection",{enumerable:!0,get:function(){return kb}}),Object.defineProperty(_,"getParentElementOfSelection$1",{enumerable:!0,get:function(){return Cl}}),Object.defineProperty(_,"getPendingPaletteInsert",{enumerable:!0,get:function(){return dv}}),Object.defineProperty(_,"getProjectFontEntries",{enumerable:!0,get:function(){return FO}}),Object.defineProperty(_,"getRangeFromSelection",{enumerable:!0,get:function(){return gP}}),Object.defineProperty(_,"getSelectedText",{enumerable:!0,get:function(){return bO}}),Object.defineProperty(_,"getSimpleBorderType",{enumerable:!0,get:function(){return xb}}),Object.defineProperty(_,"getStructureColumns",{enumerable:!0,get:function(){return iN}}),Object.defineProperty(_,"getTagNameForContainer",{enumerable:!0,get:function(){return _P}}),Object.defineProperty(_,"getTextPartsAtCursor",{enumerable:!0,get:function(){return fg}}),Object.defineProperty(_,"getVariableByIcon",{enumerable:!0,get:function(){return lv}}),Object.defineProperty(_,"getVariableIcon",{enumerable:!0,get:function(){return av}}),Object.defineProperty(_,"getVisibleText",{enumerable:!0,get:function(){return Nm}}),Object.defineProperty(_,"handleAddBlockMenu",{enumerable:!0,get:function(){return UP}}),Object.defineProperty(_,"handleAddGroup",{enumerable:!0,get:function(){return $P}}),Object.defineProperty(_,"handleArrowRight",{enumerable:!0,get:function(){return yv}}),Object.defineProperty(_,"handleCloneAtom",{enumerable:!0,get:function(){return PP}}),Object.defineProperty(_,"handleCloneBlock",{enumerable:!0,get:function(){return NP}}),Object.defineProperty(_,"handleCloneGroup",{enumerable:!0,get:function(){return HP}}),Object.defineProperty(_,"handleDeleteKey",{enumerable:!0,get:function(){return bv}}),Object.defineProperty(_,"handleDiscussGetTarget",{enumerable:!0,get:function(){return $c}}),Object.defineProperty(_,"handleDiscussRemoveTarget",{enumerable:!0,get:function(){return Fc}}),Object.defineProperty(_,"handleDiscussReset",{enumerable:!0,get:function(){return jc}}),Object.defineProperty(_,"handleDiscussSetTarget",{enumerable:!0,get:function(){return Bc}}),Object.defineProperty(_,"handleDiscussSetTargetClick",{enumerable:!0,get:function(){return DN}}),Object.defineProperty(_,"handleDiscussViewClick",{enumerable:!0,get:function(){return RN}}),Object.defineProperty(_,"handleDragCancel",{enumerable:!0,get:function(){return Ph}}),Object.defineProperty(_,"handleEnterForBr",{enumerable:!0,get:function(){return vv}}),Object.defineProperty(_,"handleEscapeKey",{enumerable:!0,get:function(){return gv}}),Object.defineProperty(_,"handleLockDiscuss",{enumerable:!0,get:function(){return Ic}}),Object.defineProperty(_,"handleMergeBlocks",{enumerable:!0,get:function(){return IP}}),Object.defineProperty(_,"handleMoveBlockDown",{enumerable:!0,get:function(){return RP}}),Object.defineProperty(_,"handleMoveBlockUp",{enumerable:!0,get:function(){return MP}}),Object.defineProperty(_,"handleMoveGroupDown",{enumerable:!0,get:function(){return jP}}),Object.defineProperty(_,"handleMoveGroupUp",{enumerable:!0,get:function(){return FP}}),Object.defineProperty(_,"handleRemoveAtom",{enumerable:!0,get:function(){return xP}}),Object.defineProperty(_,"handleRemoveBlock",{enumerable:!0,get:function(){return DP}}),Object.defineProperty(_,"handleRemoveGroup",{enumerable:!0,get:function(){return zP}}),Object.defineProperty(_,"handleSaveHotkey",{enumerable:!0,get:function(){return hv}}),Object.defineProperty(_,"handleToggleEditorHotkey",{enumerable:!0,get:function(){return pv}}),Object.defineProperty(_,"handleUndoRedoHotkey",{enumerable:!0,get:function(){return mv}}),Object.defineProperty(_,"handleUnmergeBlocks",{enumerable:!0,get:function(){return BP}}),Object.defineProperty(_,"handleVMLButtonInput",{enumerable:!0,get:function(){return Ev}}),Object.defineProperty(_,"handleVMLButtonText",{enumerable:!0,get:function(){return _v}}),Object.defineProperty(_,"hasClosestTrWithClass",{enumerable:!0,get:function(){return og}}),Object.defineProperty(_,"hasElementVMLBackground",{enumerable:!0,get:function(){return is}}),Object.defineProperty(_,"hasForeignButtonStructure",{enumerable:!0,get:function(){return _y}}),Object.defineProperty(_,"hasLinkInSelection",{enumerable:!0,get:function(){return Ob}}),Object.defineProperty(_,"hasOnlyTextNodesDeep",{enumerable:!0,get:function(){return wl}}),Object.defineProperty(_,"hasPendingPaletteAtom",{enumerable:!0,get:function(){return fv}}),Object.defineProperty(_,"hasProjectFonts",{enumerable:!0,get:function(){return BO}}),Object.defineProperty(_,"hasTextNodeInElement",{enumerable:!0,get:function(){return CP}}),Object.defineProperty(_,"icon",{enumerable:!0,get:function(){return yo}}),Object.defineProperty(_,"implementImageControls",{enumerable:!0,get:function(){return $m}}),Object.defineProperty(_,"implementPolyfills",{enumerable:!0,get:function(){return gl}}),Object.defineProperty(_,"implementResizableElems",{enumerable:!0,get:function(){return PN}}),Object.defineProperty(_,"incrementLock",{enumerable:!0,get:function(){return Lp}}),Object.defineProperty(_,"initDocuments",{enumerable:!0,get:function(){return Cp}}),Object.defineProperty(_,"initFocusManager",{enumerable:!0,get:function(){return Pp}}),Object.defineProperty(_,"initResizableElements",{enumerable:!0,get:function(){return CN}}),Object.defineProperty(_,"initResizer",{enumerable:!0,get:function(){return cN}}),Object.defineProperty(_,"initSandboxStyles",{enumerable:!0,get:function(){return EN}}),Object.defineProperty(_,"initSortable",{enumerable:!0,get:function(){return Cx}}),Object.defineProperty(_,"injectTextIntoFirstDiv",{enumerable:!0,get:function(){return ug}}),Object.defineProperty(_,"insertAdjacentHTML",{enumerable:!0,get:function(){return Gl}}),Object.defineProperty(_,"insertCountdown",{enumerable:!0,get:function(){return GP}}),Object.defineProperty(_,"insertRowRelativeToDivClass",{enumerable:!0,get:function(){return mg}}),Object.defineProperty(_,"isAddBlockMenuClick",{enumerable:!0,get:function(){return WP}}),Object.defineProperty(_,"isCaretAtEndOfEmReplace",{enumerable:!0,get:function(){return aP}}),Object.defineProperty(_,"isCaretAtEndOfStandardElement",{enumerable:!0,get:function(){return lP}}),Object.defineProperty(_,"isClickAtEndOfEmReplace",{enumerable:!0,get:function(){return iP}}),Object.defineProperty(_,"isComment",{enumerable:!0,get:function(){return Ss}}),Object.defineProperty(_,"isDiscussSetTargetMode",{enumerable:!0,get:function(){return MN}}),Object.defineProperty(_,"isDiscussViewMode",{enumerable:!0,get:function(){return NN}}),Object.defineProperty(_,"isEditorContentOnlyNbsp",{enumerable:!0,get:function(){return TP}}),Object.defineProperty(_,"isEditorContentOnlyNbsp$1",{enumerable:!0,get:function(){return rP}}),Object.defineProperty(_,"isElementHasBold",{enumerable:!0,get:function(){return Ab}}),Object.defineProperty(_,"isElementHasBold$1",{enumerable:!0,get:function(){return vp}}),Object.defineProperty(_,"isElementLocked",{enumerable:!0,get:function(){return kp}}),Object.defineProperty(_,"isInitialized",{enumerable:!0,get:function(){return xo}}),Object.defineProperty(_,"isJsonString",{enumerable:!0,get:function(){return pp}}),Object.defineProperty(_,"isPathElementByRules",{enumerable:!0,get:function(){return Xx}}),Object.defineProperty(_,"isRangeCoveringAllVisibleText",{enumerable:!0,get:function(){return nP}}),Object.defineProperty(_,"isShowOnMobile",{enumerable:!0,get:function(){return Lb}}),Object.defineProperty(_,"isSrcElement",{enumerable:!0,get:function(){return tu}}),Object.defineProperty(_,"isTableElement",{enumerable:!0,get:function(){return vE}}),Object.defineProperty(_,"isTextNode",{enumerable:!0,get:function(){return fi}}),Object.defineProperty(_,"isVariableComment",{enumerable:!0,get:function(){return Pc}}),Object.defineProperty(_,"isVariableText",{enumerable:!0,get:function(){return xc}}),Object.defineProperty(_,"logProjectFonts",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(_,"makeId",{enumerable:!0,get:function(){return _p}}),Object.defineProperty(_,"markProjectFontClass",{enumerable:!0,get:function(){return vb}}),Object.defineProperty(_,"messageService",{enumerable:!0,get:function(){return X}}),Object.defineProperty(_,"minifyStylesheet",{enumerable:!0,get:function(){return xa}}),Object.defineProperty(_,"modifyHtml",{enumerable:!0,get:function(){return Eg}}),Object.defineProperty(_,"normalizeSpaces",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(_,"object_group_solid_default",{enumerable:!0,get:function(){return gN}}),Object.defineProperty(_,"parseFromString",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(_,"parseTableToArray",{enumerable:!0,get:function(){return pg}}),Object.defineProperty(_,"pen_solid_default",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(_,"plus_solid_default",{enumerable:!0,get:function(){return bN}}),Object.defineProperty(_,"prepareEditorHTML",{enumerable:!0,get:function(){return Mm}}),Object.defineProperty(_,"processTableText",{enumerable:!0,get:function(){return Sg}}),Object.defineProperty(_,"provideAmp",{enumerable:!0,get:function(){return tP}}),Object.defineProperty(_,"provideAttributePipeline",{enumerable:!0,get:function(){return pb}}),Object.defineProperty(_,"provideDocumentSync",{enumerable:!0,get:function(){return cO}}),Object.defineProperty(_,"provideEmVersion",{enumerable:!0,get:function(){return HL}}),Object.defineProperty(_,"provideFocus",{enumerable:!0,get:function(){return dP}}),Object.defineProperty(_,"provideImageCache",{enumerable:!0,get:function(){return aO}}),Object.defineProperty(_,"provideSandboxState",{enumerable:!0,get:function(){return uO}}),Object.defineProperty(_,"registerCorrectVariableSelectionService",{enumerable:!0,get:function(){return cv}}),Object.defineProperty(_,"registerCrossDomainDD",{enumerable:!0,get:function(){return mO}}),Object.defineProperty(_,"registerExtensionScriptsService",{enumerable:!0,get:function(){return nL}}),Object.defineProperty(_,"registerLocalizationService",{enumerable:!0,get:function(){return AO}}),Object.defineProperty(_,"registerProjectFontsService",{enumerable:!0,get:function(){return HO}}),Object.defineProperty(_,"registerResetService",{enumerable:!0,get:function(){return Tx}}),Object.defineProperty(_,"registerResizeWatch",{enumerable:!0,get:function(){return Ax}}),Object.defineProperty(_,"registerThemeVariablesService",{enumerable:!0,get:function(){return DO}}),Object.defineProperty(_,"removeAllAttributes",{enumerable:!0,get:function(){return xl}}),Object.defineProperty(_,"removeBySelector",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_,"removeClassesByPrefix",{enumerable:!0,get:function(){return Mb}}),Object.defineProperty(_,"removeClassesByPrefix$1",{enumerable:!0,get:function(){return Eb}}),Object.defineProperty(_,"removeEditorTags",{enumerable:!0,get:function(){return dg}}),Object.defineProperty(_,"removeEmptyParents",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(_,"removeHiddenClasses",{enumerable:!0,get:function(){return Ra}}),Object.defineProperty(_,"removeLastWord",{enumerable:!0,get:function(){return AP}}),Object.defineProperty(_,"removeTemporaryListClasses",{enumerable:!0,get:function(){return Tv}}),Object.defineProperty(_,"removeTrContainingDivWithClass",{enumerable:!0,get:function(){return hg}}),Object.defineProperty(_,"renumberCellOneText",{enumerable:!0,get:function(){return gg}}),Object.defineProperty(_,"replaceEmptyWithNbsp",{enumerable:!0,get:function(){return yg}}),Object.defineProperty(_,"resolveActiveElement",{enumerable:!0,get:function(){return dc}}),Object.defineProperty(_,"rgbToHex",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(_,"save_solid_default",{enumerable:!0,get:function(){return yN}}),Object.defineProperty(_,"sendResizeEvent",{enumerable:!0,get:function(){return ym}}),Object.defineProperty(_,"serializeOuterHtml",{enumerable:!0,get:function(){return Dg}}),Object.defineProperty(_,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return ZP}}),Object.defineProperty(_,"setBlockMaxWidth",{enumerable:!0,get:function(){return rN}}),Object.defineProperty(_,"setContrastBlock",{enumerable:!0,get:function(){return oy}}),Object.defineProperty(_,"setCursorInsideSpan",{enumerable:!0,get:function(){return sP}}),Object.defineProperty(_,"setCursorPositionSimple",{enumerable:!0,get:function(){return cP}}),Object.defineProperty(_,"setCursorToElement",{enumerable:!0,get:function(){return wP}}),Object.defineProperty(_,"setCustomColor",{enumerable:!0,get:function(){return hP}}),Object.defineProperty(_,"setDocumentStyles",{enumerable:!0,get:function(){return gb}}),Object.defineProperty(_,"setEditorFocus",{enumerable:!0,get:function(){return Np}}),Object.defineProperty(_,"setElementBorder",{enumerable:!0,get:function(){return ic}}),Object.defineProperty(_,"setElementBorderRadius",{enumerable:!0,get:function(){return oc}}),Object.defineProperty(_,"setElementBoxShadow",{enumerable:!0,get:function(){return Pb}}),Object.defineProperty(_,"setElementMobileAlign",{enumerable:!0,get:function(){return qb}}),Object.defineProperty(_,"setElementMobileBackgroundColor",{enumerable:!0,get:function(){return Kb}}),Object.defineProperty(_,"setElementMobileBackgroundImage",{enumerable:!0,get:function(){return Qb}}),Object.defineProperty(_,"setElementMobileBackgroundPositionX",{enumerable:!0,get:function(){return Zb}}),Object.defineProperty(_,"setElementMobileBackgroundPositionY",{enumerable:!0,get:function(){return Jb}}),Object.defineProperty(_,"setElementMobileBackgroundRepeat",{enumerable:!0,get:function(){return ey}}),Object.defineProperty(_,"setElementMobileBackgroundSize",{enumerable:!0,get:function(){return ty}}),Object.defineProperty(_,"setElementMobileBorder",{enumerable:!0,get:function(){return Vb}}),Object.defineProperty(_,"setElementMobileBorderRadius",{enumerable:!0,get:function(){return Wb}}),Object.defineProperty(_,"setElementMobileBoxShadow",{enumerable:!0,get:function(){return Ub}}),Object.defineProperty(_,"setElementMobileContentWidth",{enumerable:!0,get:function(){return zb}}),Object.defineProperty(_,"setElementMobileDirection",{enumerable:!0,get:function(){return Yb}}),Object.defineProperty(_,"setElementMobileFontSize",{enumerable:!0,get:function(){return ry}}),Object.defineProperty(_,"setElementMobileHeight",{enumerable:!0,get:function(){return ti}}),Object.defineProperty(_,"setElementMobileLineHeight",{enumerable:!0,get:function(){return ny}}),Object.defineProperty(_,"setElementMobilePadding",{enumerable:!0,get:function(){return zr}}),Object.defineProperty(_,"setElementMobileTableAlign",{enumerable:!0,get:function(){return Gb}}),Object.defineProperty(_,"setElementMobileVerticalAlign",{enumerable:!0,get:function(){return Xb}}),Object.defineProperty(_,"setElementMobileWidth",{enumerable:!0,get:function(){return Hb}}),Object.defineProperty(_,"setElementShow",{enumerable:!0,get:function(){return iy}}),Object.defineProperty(_,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return _b}}),Object.defineProperty(_,"setFloatBlocksWidth",{enumerable:!0,get:function(){return tN}}),Object.defineProperty(_,"setImageWidth",{enumerable:!0,get:function(){return qP}}),Object.defineProperty(_,"setPendingPaletteInsert",{enumerable:!0,get:function(){return uv}}),Object.defineProperty(_,"setPercentsForColumns",{enumerable:!0,get:function(){return Tl}}),Object.defineProperty(_,"setRenderedAttribute",{enumerable:!0,get:function(){return Fo}}),Object.defineProperty(_,"setStructureBlocksWidth",{enumerable:!0,get:function(){return ul}}),Object.defineProperty(_,"state",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(_,"stickyCheck",{enumerable:!0,get:function(){return JP}}),Object.defineProperty(_,"stripButtonVML",{enumerable:!0,get:function(){return Oy}}),Object.defineProperty(_,"stripSubjectTags",{enumerable:!0,get:function(){return Hp}}),Object.defineProperty(_,"styleMenuElement",{enumerable:!0,get:function(){return Mv}}),Object.defineProperty(_,"styleMenuElementList",{enumerable:!0,get:function(){return Nv}}),Object.defineProperty(_,"syncButtonVML",{enumerable:!0,get:function(){return wc}}),Object.defineProperty(_,"takeEblockRootSavedToProject",{enumerable:!0,get:function(){return IL}}),Object.defineProperty(_,"textHasStyle",{enumerable:!0,get:function(){return bP}}),Object.defineProperty(_,"textHasStyle$1",{enumerable:!0,get:function(){return Cb}}),Object.defineProperty(_,"toEmFontClassToken",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(_,"trash_alt_solid_default",{enumerable:!0,get:function(){return vN}}),Object.defineProperty(_,"updateButtonVMLLabel",{enumerable:!0,get:function(){return cs}}),Object.defineProperty(_,"updateDivWithClassAndNbsp",{enumerable:!0,get:function(){return wg}}),Object.defineProperty(_,"updateTableNumbering",{enumerable:!0,get:function(){return bg}}),Object.defineProperty(_,"updateTableStyle",{enumerable:!0,get:function(){return Qp}}),Object.defineProperty(_,"uptimeCountdown",{enumerable:!0,get:function(){return XP}})});
|