@emailmaker/emailmaker 1.1.109 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -1
- package/emailmaker-core.8c2b05d7.js +859 -0
- package/emailmaker-esm.js +11 -11
- package/{emailmaker-po.7b3c64f5.js → emailmaker-po.8c2b05d7.js} +1 -1
- package/emailmaker.d.ts +254 -3
- package/emailmaker.js +12 -12
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/{iframe-eblock.7b3c64f5.html → iframe-eblock.8c2b05d7.html} +2 -2
- package/iframe/{iframe.7b3c64f5.html → iframe.8c2b05d7.html} +2 -2
- package/iframe/js/elMarkupHelper.DnlKn-Lc.js +277 -0
- package/iframe/js/iframe-eblock.body.8c2b05d7.js +9 -0
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.8c2b05d7.js +129 -0
- package/iframe/js/iframe.js +2 -2
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/{efb5b933.js → 1687225b.js} +1 -1
- package/static/core/{86b377fd.js → 1912a30e.js} +1 -1
- package/static/core/{2f32a31d.js → 286097e2.js} +2 -2
- package/static/core/{874f77d2.js → 316f71b7.js} +1 -1
- package/static/core/{26971a74.js → 42ec1ce9.js} +2 -2
- package/static/core/466f98bb.js +28 -0
- package/static/core/{8c37b60d.js → 48e93de9.js} +1 -1
- package/static/core/{26473b73.js → 492992bb.js} +1 -1
- package/static/core/{98ab1508.js → 60b75c99.js} +1 -1
- package/static/core/{f115f982.js → 6535dd13.js} +7 -7
- package/static/core/{5c4304c8.js → 6e548251.js} +1 -1
- package/static/core/844fbb88.js +1 -0
- package/static/core/{9ef544f4.js → 97aabe39.js} +1 -1
- package/static/core/{cebc7ae2.js → 9e7c400d.js} +10 -10
- package/static/core/9ff19e12.js +4 -0
- package/static/core/{b35140b6.js → aab84cf4.js} +1 -1
- package/static/core/{a85c7f02.js → b6999cba.js} +1 -1
- package/static/core/{1157da89.js → b752ed52.js} +1 -1
- package/static/core/{ee6c9aa1.js → b99f4f42.js} +1 -1
- package/static/core/{213ffad0.js → bbb11e65.js} +1 -1
- package/static/core/{6314ae82.js → c2daae71.js} +1 -1
- package/static/core/{3bfab25b.js → c6cd3dc2.js} +1 -1
- package/static/core/{2e29db3c.js → c7b2d60e.js} +1 -1
- package/static/core/{850805d7.js → d2a90b69.js} +1 -1
- package/static/core/{756e184f.js → dfbe3ba4.js} +1 -1
- package/static/core/{87dcdb89.js → e13d6875.js} +1 -1
- package/static/core/{e8fa95c8.js → ed4586a5.js} +1 -1
- package/static/core/{dfcb8d34.js → ee6a6899.js} +1 -1
- package/static/esm/ea997fe3.js +1 -0
- package/static/umd-runtime/runtime.BqNyFZPj.js +1 -0
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- package/emailmaker-core.7b3c64f5.js +0 -859
- package/iframe/js/elMarkupHelper.BcpgksI_.js +0 -279
- package/iframe/js/iframe-eblock.body.7b3c64f5.js +0 -9
- package/iframe/js/iframe.body.7b3c64f5.js +0 -129
- package/static/core/6fb2f217.js +0 -4
- package/static/core/e4b8362a.js +0 -28
- package/static/core/e90908e7.js +0 -1
- package/static/esm/73c89921.js +0 -1
- package/static/umd-runtime/runtime.DaVzSc6X.js +0 -1
|
@@ -0,0 +1,859 @@
|
|
|
1
|
+
__emailmaker__.define("static/core/5dc34752.js",["require","exports","module"],function(M,o,w){var p=Object.create,_=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,O=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,v=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}},P=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),g=(e,t)=>{let r={};for(var n in e)_(r,n,{get:e[n],enumerable:!0});return t||_(r,Symbol.toStringTag,{value:"Module"}),r},c=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=f(t),l=0,m=i.length,u;l<m;l++)u=i[l],!a.call(e,u)&&u!==r&&_(e,u,{get:(y=>t[y]).bind(null,u),enumerable:!(n=b(t,u))||n.enumerable});return e},j=(e,t,r)=>(r=e!=null?p(O(e)):{},c(t||!e||!e.__esModule||!a.call(e,"default")?_(r,"default",{value:e,enumerable:!0}):r,e)),s=e=>a.call(e,"module.exports")?e["module.exports"]:c(_({},"__esModule",{value:!0}),e);Object.defineProperty(o,"__commonJSMin",{enumerable:!0,get:function(){return P}}),Object.defineProperty(o,"__esmMin",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"__exportAll",{enumerable:!0,get:function(){return g}}),Object.defineProperty(o,"__toCommonJS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"__toESM",{enumerable:!0,get:function(){return j}})});
|
|
2
|
+
|
|
3
|
+
__emailmaker__.define("static/core/422c8b42.js",["require","exports","module"],function(ho,u,fo){function Ie(e){return function(t){return{setOptions:()=>{},instance:{},dispose:()=>{},...e(t)||{}}}}function $t(e){return t=>{const r={},n=[];for(const i of e)n.push(i(t));for(const i of n)Object.assign(r,i.instance);return{instance:r,setOptions:async i=>{for(const c of n)await c.setOptions(i)},dispose:()=>{for(const i of n)i.dispose()}}}}var v=class kt{_inner;_isDisposed=!1;constructor(t=[]){this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof kt&&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 B(e){return`service_container_${e}`}var N=new Set,z;function Mt(){if(!z)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,ee.prototype.getInstanceAsync),e.stack}function Z(e){N.delete(e)&&z?.end(e)}var ee=class Te extends v{_parent;_injectCallbacks=[];_injections=Object.create(null);_runCallbacks(t){[...this._injectCallbacks].forEach(r=>r(t))}constructor(t=null){super(),this._parent=t,t&&this.addDisposable(t.onInject(r=>this._runCallbacks(r)))}onInject=t=>(this._injectCallbacks.push(t),{dispose:()=>{const r=this._injectCallbacks.indexOf(t);r>=0&&this._injectCallbacks.splice(r,1)}});inject(t,r){this._injections[t]=()=>r,this._runCallbacks(t)}injectFactory(t,r,n){const s=this._injections[t];let o=typeof s=="function"?s():s;const i=this._injections[t]=()=>(o=r(this,o),o);n&&i(),this._runCallbacks(t)}_find(t,r=!0){return this._injections[t]||r&&this._parent?._find(t)}_onInject(t,r,n=new v){return n.addDisposable(this.onInject(s=>{t===s&&!n.isDisposed()&&(n.dispose(),r(this.getInstance(s)))})),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 s=r(this);return this.inject(t,s),s}getInstanceAsync(t){const r=this._find(t);if(typeof r=="function")return Promise.resolve(r());const n=Mt();return new Promise((s,o)=>{const i={id:String(t),startedAt:Date.now(),origin:n,container:this,reject:o};N.add(i),z?.start(i),this._onInject(t,()=>{Z(i),s(this.getInstance(t))})})}failPendingWaits(t){for(const r of Array.from(N))r.container===this&&(Z(r),r.reject(t))}pendingWaits(){return[...N].filter(t=>t.container===this)}addService(t,r){const n=B(t);this.injectFactory(n,(o,i=[])=>i.indexOf(r)<0?[...i,r]:i);const s=new v;return s.addDispose(()=>{this.injectFactory(n,(o,i=[])=>i.filter(c=>c!==r))}),s}addServiceFactory(t,r,n){const s=B(t);let o;this.injectFactory(s,(c,a=[])=>(o=r(c,o),o===void 0?a:a.indexOf(o)<0?[...a,o]:a),n);const i=new v;return i.addDispose(()=>{this.injectFactory(s,(c,a=[])=>o===void 0?a:a.filter(l=>l!==o))}),i}getServices(t){const r=B(t);return[...this.getInstance(r,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new Te(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const r=this._parent?.getOrCreateIsolatedContainer(t);return new Te(r)})}remove(t){const r=this._injections;delete r[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(N))t.container===this&&Z(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function te(e){return e.startsWith("__")?e:`__${e}__`}function Ft(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=te(e),r=globalThis;return r[t]??={}}function Bt(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function Gt(e){if(e)return te(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return te(t)}function Ae(e){const t=Gt(e),r=Ft(t);if(Bt(r.container))return r.container;const n=new ee(null);return r.container=n,n}function Ht(e){return Ae(e)}function Wt(){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 Pe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Wt()}function p(e=Pe()){return e}function Se(){return"core".trim()||"unknown"}function Vt(e){if(typeof globalThis>"u")return;const t=Se(),r=globalThis[e]??{};globalThis[e]=r;const n=r.__diagnostics??={},s=n.diModuleEval??={evalCount:0,records:[]};s.records.push({buildSource:t,timestamp:Date.now(),stack:new Error().stack}),s.evalCount+=1}function Kt(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function Yt(e,t){if(Vt(t),typeof globalThis>"u")return e;const r=Se(),n=globalThis,s=n[t]=n[t]||{},o=s.__diagnostics=s.__diagnostics||{},i=o.dependencyResolver=o.dependencyResolver||{entries:[]},c={container:e,source:"packages/runtime-core/di/index.ts",buildSource:r,timestamp:Date.now(),stack:new Error().stack};return i.entries.push(c),e}var G;function Jt(){if(G)return G;const e=Kt();return G=Yt(Ae(e),e),G}var re=new Proxy({},{get(e,t,r){const n=Jt(),s=Reflect.get(n,t,r);return typeof s=="function"?s.bind(n):s}}),De=class extends v{_options;_listeners=[];constructor(e={}){super(),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,s=this._options;r&&typeof e=="function"&&(e=e.bind(r));const o=n.findIndex(([,c])=>c<t),i=[e,t];return n.splice(o>=0?o:n.length,0,i),n.length===1&&s.onFirstListenerAdd&&s.onFirstListenerAdd(),{dispose:()=>{const c=n.indexOf(i);c>=0&&(n.splice(c,1),!n.length&&s.onLastListenerRemove&&s.onLastListenerRemove())}}}on=this._addListener.bind(this);event=this._addListener.bind(this);once=(e,t=0,r)=>{const n=this._addListener((...s)=>(n?.dispose(),r?e.call(r,...s):e(...s)),t);return n};un=e=>{const t=this._listeners.findIndex(([r])=>r===e);t>=0&&(this._listeners.splice(t,1),this._listeners.length===0&&this._options.onLastListenerRemove&&this._options.onLastListenerRemove())};dispose(){this._listeners.splice(0,this._listeners.length),this._options.onLastListenerRemove&&this._options.onLastListenerRemove(),super.dispose()}},R=class extends De{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}}},Xt=class extends R{execute([e],t){for(const r of t)try{r(e)}catch{}}},Qt=class extends R{_suspendCounter=0;_wasFired=!1;execute([e],t){if(this._suspendCounter)this._wasFired=!0;else for(const r of t)try{r(e)}catch{}}suspend(){this._suspendCounter++}resume(){--this._suspendCounter===0&&this._wasFired&&(this.fire(),this._wasFired=!1)}},ne=class extends R{async execute([e],t){const r=[];for(const n of t)try{r.push(await n(e))}catch{}return r}async fireSettled(e){const t={results:[],errors:[]};if(this.isDisposed())return t;for(const r of this.getListeners([e]))try{t.results.push(await r(e))}catch(n){t.errors.push(n)}return t}};function zt(e,t=0){const r=new De,n=e(r,t);return n&&r.addDisposable(n),r.event}function Zt(e,t,r=0){const n=new R,s=e((...o)=>{if(t(...o))return n.fire(...o)},r);return s&&n.addDisposable(s),n.event}function f(e){return p(e)}var se;(function(e){e.BEFORE_SAVE_EMAIL=f("events.BEFORE_SAVE_EMAIL"),e.ON_SAVEBUTTON_CLICK_ID=f("events.ON_SAVEBUTTON_CLICK_ID"),e.ON_NEXTBUTTON_CLICK_ID=f("events.ON_NEXTBUTTON_CLICK_ID"),e.ON_PREVIOUSBUTTON_CLICK_ID=f("events.ON_PREVIOUSBUTTON_CLICK_ID"),e.ON_DOCUMENT_SESSION_CHANGE=f("events.ON_DOCUMENT_SESSION_CHANGE"),e.WILL_EMAIL_INIT_ID=f("events.WILL_EMAIL_INIT_ID"),e.ON_EMAIL_INIT_ID=f("events.ON_EMAIL_INIT_ID"),e.ON_BLOCK_INIT_ID=f("events.ON_BLOCK_INIT_ID"),e.ON_CONTENT_CHANGED_ID=f("events.ON_CONTENT_CHANGED_ID"),e.ON_PREHEADER_CHANGED_ID=f("events.ON_PREHEADER_CHANGED_ID"),e.ON_SUBJECT_CHANGED_ID=f("events.ON_SUBJECT_CHANGED_ID"),e.ON_EMAIL_CHANGED_ID=f("events.ON_EMAIL_CHANGED_ID"),e.ON_BLOCK_CHANGED_ID=f("events.ON_BLOCK_CHANGED_ID"),e.ON_BLOCK_OPEN_ID=f("events.ON_BLOCK_OPEN_ID"),e.ON_BLOCK_CLOSE_ID=f("events.ON_BLOCK_CLOSE_ID"),e.OPEN_BLOCK_REQUEST_ID=f("events.OPEN_BLOCK_REQUEST_ID"),e.ON_BLOCK_SAVEBUTTON_CLICK_ID=f("events.ON_BLOCK_SAVEBUTTON_CLICK_ID"),e.ON_BLOCK_CLONE_ID=f("events.ON_BLOCK_CLONE_ID"),e.ON_CHUNKS_LOADED=f("events.ON_CHUNKS_LOADED"),e.ON_SEND_TESTEMAIL_ID=f("events.ON_SEND_TESTEMAIL_ID"),e.ON_SEND_LIVEPREVIEW_ID=f("events.ON_SEND_LIVEPREVIEW_ID"),e.ON_SHARE_ID=f("events.ON_SHARE_ID"),e.ON_SHOW_PREVIEW_ID=f("events.ON_SHOW_PREVIEW_ID"),e.ON_EMAIL_CLONE_ID=f("events.ON_EMAIL_CLONE_ID"),e.ON_SEND_EMAIL_MODAL_ID=f("events.ON_SEND_EMAIL_MODAL_ID"),e.ON_ANALYTICS_EVENT=f("events.ON_ANALYTICS_EVENT"),e.ON_NOTIFICATION=f("events.ON_NOTIFICATION"),e.READ_LOCALE=f("events.READ_LOCALE"),e.ON_TRANSLATE_ID=f("events.ON_TRANSLATE_ID"),e.ON_CODE_VALIDATE_ID=f("events.ON_CODE_VALIDATE_ID"),e.ON_IMPORT_VALIDATE_ID=f("events.ON_IMPORT_VALIDATE_ID"),e.UPLOAD_EVENT_ID=f("events.UPLOAD_EVENT_ID"),e.PROXY_URL_EVENT_ID=f("events.PROXY_URL_EVENT_ID"),e.FILE_PROXY_EVENT_ID=f("events.FILE_PROXY_EVENT_ID"),e.ON_LIMIT_ID=f("events.ON_LIMIT_ID"),e.ON_BROWSER_EXTENSION_DETECTED_ID=f("events.ON_BROWSER_EXTENSION_DETECTED_ID"),e.ON_LAYOUT_CONVERT_REQUEST_ID=f("events.ON_LAYOUT_CONVERT_REQUEST_ID"),e.ON_BROWSER_TRANSLATE_DETECTED_ID=f("events.ON_BROWSER_TRANSLATE_DETECTED_ID"),e.AI_TEXT_REQUEST_ID=f("events.AI_TEXT_REQUEST_ID"),e.AI_IMAGE_REQUEST_ID=f("events.AI_IMAGE_REQUEST_ID"),e.AI_TEXT_PROGRESS_ID=f("events.AI_TEXT_PROGRESS_ID"),e.AI_IMAGE_PROGRESS_ID=f("events.AI_IMAGE_PROGRESS_ID"),e.AI_TEXT_STREAM_ID=f("events.AI_TEXT_STREAM_ID")})(se||(se={}));function er(e,t){return e.getOrCreateInstance(t,()=>new ne).event}function tr(e,t){return e.getOrCreateInstance(t,()=>new ne)}var rr="Not implemented in plugin",nr=p("plugin.app"),sr=p("plugin.disposable"),or=p("InitPipelineContext"),ir=p("plugin.instance"),po=p("plugin.lateSurfaceListeners"),we=p("plugin.optionsSource"),ar=p("plugin.store"),Ce=p("ConfigSource"),cr=p("plugin.standalone.project"),je=p("plugin.standalone.bootstrapToken"),_o=p("plugin.element"),Ne=p("plugin.securityModule"),ur=p("plugin.standalone.activated"),dr=p("plugin.standalone.fileProxyRegistered"),lr=p("plugin.jwt.token"),hr=p("plugin.jwt.error"),fr=p("PluginCollection"),mo=f("APP_LOAD_EVENT"),pr=f("CONFIG_CHANGED_EVENT");function w(e){if(e instanceof DOMException&&e.name==="AbortError")return e;const t=e===void 0?"The operation was aborted.":typeof e=="string"?e:e instanceof Error?e.message:String(e);return new DOMException(t,"AbortError")}function _r(e){return e instanceof DOMException&&e.name==="AbortError"}function oe(e){if(e?.aborted)throw w(e.reason)}function mr(e,t){return t?(t.aborted&&e.catch(()=>{}),oe(t),new Promise((r,n)=>{const s=()=>{o(),n(w(t.reason))},o=()=>{t.removeEventListener("abort",s)};t.addEventListener("abort",s),e.then(i=>{o(),r(i)},i=>{o(),n(i)})})):e}function yr(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/([^a-zA-Z0-9_-])/g,"\\$1")}function ie(e,t=document){try{const n=t.querySelector(e);if(n)return n}catch{return null}const r=t.querySelectorAll("*");for(let n=0;n<r.length;n++){const s=r[n]?.shadowRoot;if(!s)continue;const o=ie(e,s);if(o)return o}return null}function Re(e,t=[]){const r=e.querySelectorAll("*");for(let n=0;n<r.length;n++){const s=r[n]?.shadowRoot;s&&(t.push(s),Re(s,t))}return t}function Er(e,t,r){if(e.isConnected)return e;const n=e.id?.trim();return n?Le(`#${yr(n)}`,t,r):Promise.reject(w("Editor mount element was disconnected and has no id — pass a CSS selector or call init() again after the host remounts the container."))}function Le(e,t,r){if(oe(r),typeof e<"u"){if(typeof e=="string"){const n=e,s=ie(n);if(s)return s;const o=t.addDisposable(new v);return new Promise((i,c)=>{const a=E=>{o.dispose(),E()},l=()=>{a(()=>c(w(r?.reason)))};if(r?.aborted){l();return}r?.addEventListener("abort",l),o.addDispose(()=>r?.removeEventListener("abort",l));const h=document.body??document.documentElement;if(!h){a(()=>c(w("Document is not ready to observe mount element")));return}const _=new Set,y=new MutationObserver(()=>{const E=ie(n);if(E){a(()=>i(E));return}b()}),m=E=>{_.has(E)||(_.add(E),y.observe(E,{attributes:!0,childList:!0,subtree:!0}))},b=()=>{const E=document.documentElement;if(E)for(const P of Re(E))m(P)};m(h),b(),o.addDispose(()=>y.disconnect())})}return e instanceof Element?Er(e,t,r):e}return e}var gr=new Map;function br(e,t=window){return{peer:e,send(r){e.postMessage(r,"*")},subscribe(r){const n=s=>{r({data:s.data,source:s.source,ports:s.ports})};return t.addEventListener("message",n),{dispose:()=>t.removeEventListener("message",n)}},close(){}}}function vr(e){let t=!1;return{peer:e,send(r){e.postMessage(r)},subscribe(r){const n=s=>{r({data:s.data,source:e})};return e.addEventListener("message",n),t||(t=!0,e.start()),{dispose:()=>e.removeEventListener("message",n)}},close(){e.close()}}}function Or(e){return e}function Tr(e){return e&&typeof e=="object"}function Ue(e,t){return e&&typeof e=="object"&&e.operationId===t}var T="INIT_MESSAGE",Ir="em:port-ready",Ar="em:window-drained",ae="";function qe(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var Pr=class extends v{_listeners=Object.create(null);addListenerAsync=(e,t,r=0,n)=>{const s=this._listeners[e]||(this._listeners[e]=[]);n&&typeof t=="function"&&(t=t.bind(n));const o=s.findIndex(([c,a])=>r<=a),i=[t,r];return this.isDisposed()||s.splice(o>=0?o:s.length,0,i),{dispose(){const c=s.indexOf(i);c>=0&&s.splice(c,1)}}};fireAsync=(e,t)=>{if(!this.isDisposed()){const r=this._listeners[e]||(this._listeners[e]=[]);let n;for(let s=0;s<r.length;s++){const o=r[s][0],i=n;n=c=>o(c,i)}if(n)return n(t)}};addListener=(e,t,r=0)=>this.addListenerAsync(e,(n,s)=>{try{t(n)}catch{}return s&&s(n)},r)},Sr=class extends v{_singleton;_target;_transport;_transportSubscription;_ports=new Map;_drained=new WeakSet;_portSendHeld=new WeakSet;_inited=!1;_emitter=this.addDisposable(new Pr);_handshaken=new WeakSet;_greeted=new WeakSet;_outgoingFilter;_outgoingObservers=new Set;_offTargetListeners=new Map;constructor(e,t){super(),this._singleton=t,this._transport=br({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(T,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(T))}),e&&this.setTarget(e)}_onTransportMessage=e=>{const t=e,r=t.data,n=t.source,s=r?.port===!0?t.ports?.[0]:void 0,o=!this._isPortSource(t.source);if(o&&n&&r?.operationId==="em:window-drained"){this._ports.has(n)&&this._drained.add(n);return}if(o&&n&&this._drained.has(n))return;if(n&&n!==this._target&&this._greeted.has(n)&&Ue(r,T)){this._greeted.delete(n),this._handshaken.add(n),this._postMessage(n,{operationId:T,data:{}}),s&&this.usePort(s,!0,n);return}const i=t.source===this.target||this._isCurrentPort(t.source);if(i||this._notifyOffTarget(r?.operationId,t.source),Tr(r)&&i||this._singleton&&Ue(r,T)){if(s&&i){const h=this._target;Promise.resolve().then(()=>this.usePort(s,!0,h))}const c=this._emitter.fireAsync(r.operationId||ae,r.operationId===void 0?t:r.data),a=r.result,l=r.error;a&&l&&Promise.resolve(c).then(h=>this._sendMessage(a,h),h=>this._sendMessage(l,h))}};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(T,void 0);return}this._inited=!1,this._postMessage(e,{operationId:T,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:T,data:{},port:!0},[t])}observeOutgoing(e){return this._outgoingObservers.add(e),{dispose:()=>{this._outgoingObservers.delete(e)}}}_notifyOutgoing(e,t){for(const r of Array.from(this._outgoingObservers))try{r(e,t)}catch{}}addOffTargetListener(e,t){let r=this._offTargetListeners.get(e);return r||(r=new Set,this._offTargetListeners.set(e,r)),r.add(t),{dispose:()=>{r.delete(t)}}}_notifyOffTarget(e,t){const r=typeof e=="string"?this._offTargetListeners.get(e):void 0,n=r?.size?this._knownPeer(t):void 0;if(!(!r||!n))for(const s of Array.from(r))try{s(n)}catch{}}_knownPeer(e){for(const[r,n]of this._ports)if(n.transport.peer===e)return r;const t=e;return typeof e=="object"&&e!==null&&(this._handshaken.has(t)||this._greeted.has(t))?t:void 0}setOutgoingFilter(e){return this._outgoingFilter=e,()=>{this._outgoingFilter===e&&(this._outgoingFilter=void 0)}}sendNow(e){const t=this._target;return!this._inited||!t?!1:(this._postMessage(t,e),!0)}greet(e){this._handshaken.has(e)||this._greeted.has(e)||this._target===e||(this._greeted.add(e),this._postMessage(e,{operationId:T,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=vr(e),s=n.subscribe(this._onTransportMessage);this._ports.set(r,{transport:n,subscription:s}),t&&(n.send({operationId:Ir,data:{}}),this.drainWindow(r))}holdPort(e=this._target){!e||!this._ports.has(e)||(this._portSendHeld.add(e),this._drained.delete(e))}resumePort(e=this._target){e&&this._portSendHeld.delete(e)}useWindow(e=this._target){e&&(this._closePort(e),this._drained.delete(e))}get usesPort(){return this._target!==void 0&&this._ports.has(this._target)&&!this._portSendHeld.has(this._target)}hasPort(e,t){const r=this._ports.get(e);return r!==void 0&&(t===void 0||r.transport.peer===t)}_closePort(e){const t=this._ports.get(e);t&&(t.subscription.dispose(),t.transport.close(),this._ports.delete(e),this._portSendHeld.delete(e))}drainWindow(e){this._ports.has(e)&&e.postMessage({operationId:Ar,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 s=this._ports.get(e);if(s&&!this._portSendHeld.has(e)){s.transport.send(n);return}if(r?.length){e.postMessage(n,"*",r);return}e.postMessage(n,"*")}catch(s){if(s?.name==="DataCloneError"){const o=typeof n?.data=="object"&&n?.data!==null?n.data:void 0}throw s}}_sendMessage(e,t,r=!0){if(!r&&!this.isInited())return;e&&this._notifyOutgoing(e,t);const n=this.addDisposable(this.onInit(s=>{const o=e?{operationId:e,data:t}:t;try{this._postMessage(s,{...o})}finally{n.dispose()}}))}send(e,t,r){return typeof e=="string"?this._sendMessage(e,t,r):this._sendMessage(ae,e,t)}sendAsync(e,t,r=!0){if(!r&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const n=qe(),s=qe();return new Promise((o,i)=>{const c=this.addDisposable(new v);c.addDisposable(this.onInit(a=>{try{this._postMessage(a,{operationId:e,data:t,result:n,error:s})}catch(l){c.dispose(),i(l);return}c.addDisposable(this._onMessage(n,l=>{o(l),c.dispose()})),c.addDisposable(this._onMessage(s,l=>{i(l),c.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(ae,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,s)=>{const o=await t(n);return s?s(n):o},r)}isInited(){return this._inited}get inited(){return this._inited}onInit(e,t=!0,r=0){const n=this.addDisposable(new v);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(T,()=>{e(this._target)},r)),n}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}},xe="INJECTION";function ce(e){return e.getState}function ke(e){if(ce(e)){const t=e.getState()[xe];return t&&re.getOrCreateInstance(t,()=>re.createChild())}else return e}function Dr(e,t){for(const r of e)if(r&&t in r)return r[t]}var $e=["generic","stockImages","emFiles","cdn"];function Me(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Fe(e){return!Me(e)||"match"in e||"rewrite"in e||"proxyBase"in e?!1:Object.keys(e).some(t=>$e.includes(t))}function Be(e){return e.length===0?[]:e.length===1?e[0]:e}function wr(e){let t=!1,r=[];for(const n of e)if(n!==void 0){if(t=!0,Array.isArray(n)){r=[...n,...r];continue}r=[n,...r]}if(t)return Be(r)}function Cr(e){return Me(e)&&("value"in e||"replace"in e)}function Ge(e,t){return t===void 0?e:Array.isArray(t)?[...t,...e]:[t,...e]}function jr(e){let t=!1,r=[],n=!1;for(const o of e)if(o!==void 0){if(Cr(o)){t=!0,o.replace&&(r=[],n=!0),o.value!==void 0&&(r=Ge(r,o.value),n=!0);continue}r=Ge(r,o),n=!0}const s=n?Be(r):void 0;if(!t)return s;if(s!==void 0)return{value:s}}function Nr(e){const t=e.filter(n=>n!==void 0);if(t.length===0)return;if(!t.some(n=>Fe(n)))return wr(t);const r={};for(const n of $e){const s=jr(e.map(o=>{if(o!==void 0)return Fe(o)?o[n]:n==="generic"?o:void 0}));s!==void 0&&(r[n]=s)}return Object.keys(r).length>0?r:void 0}function L(e){return p(e)}var Rr=p("extensions.atomsHandlers"),Lr=L("HANDLE_ATOM_INSERT"),yo=p("HeadlessMode"),Eo=p("extensions.sandboxExtensions"),go="SANDBOX_EXTENSION_SCRIPT_STATUS",Ur=p("MESSAGE_SERVICE"),qr=L("SETTINGS_PANEL_EVENT"),xr="advanced",kr=L("MODAL_SHOW_EVENT"),$r=L("MODAL_CLOSE_EVENT"),Mr=L("MODAL_UPDATE_EVENT"),ue=p("client"),Fr=p("v2_client"),Br=p("ai_client"),Gr=p("app.cookieManager"),Hr=p("app.storageProvider"),Wr=p("image-blob-resolver"),Vr=p("template-directives");function H(e,t){if(e!==t){if(!e||!t||typeof e!="object"||typeof t!="object")return!1;const r=Array.isArray(e),n=Array.isArray(t);if(r){if(!n)return!1;const c=e.length;if(t.length!==c)return!1;for(let a=0;a<c;a++)if(!H(e[a],t[a]))return!1}else if(n)return!1;const s=Object.keys(e),o=Object.keys(t),i=s.length;if(i!==o.length)return!1;for(let c=0;c<i;c++){const a=s[c];if(!t.hasOwnProperty(a)||!H(e[a],t[a]))return!1}}return!0}function Kr(e){const t=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),r=atob(t),n=new Uint8Array(r.length);for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s);return new TextDecoder().decode(n)}function He(e){const[t,r,n]=e.split("."),s=JSON.parse(Kr(r));return{exp:s.exp,createdAt:s.iat,data:s}}var d=(function(e){return e.Json="application/json",e.FormData="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Text="text/plain",e})({}),Yr=class{baseUrl="https://api.emailmaker.ru/wp-json";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...e)=>fetch(...e);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(e={}){Object.assign(this,e)}setSecurityData=e=>{this.securityData=e};encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent(typeof t=="number"?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(r=>this.encodeQueryParam(t,r)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(r=>typeof t[r]<"u").map(r=>Array.isArray(t[r])?this.addArrayQueryParam(t,r):this.addQueryParam(t,r)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}contentFormatters={"application/json":e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,"text/plain":e=>e!==null&&typeof e!="string"?JSON.stringify(e):e,"multipart/form-data":e=>Object.keys(e||{}).reduce((t,r)=>{const n=e[r];return t.append(r,n instanceof Blob?n:typeof n=="object"&&n!==null?JSON.stringify(n):`${n}`),t},new FormData),"application/x-www-form-urlencoded":e=>this.toQueryString(e)};mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}createAbortSignal=e=>{if(this.abortControllers.has(e)){const r=this.abortControllers.get(e);return r?r.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal};abortRequest=e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))};async request({body:e,secure:t,path:r,type:n,query:s,format:o,baseUrl:i,cancelToken:c,extraQuery:a,proxyHandler:l,...h}){const _=(typeof t=="boolean"?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},y=this.mergeRequestParams(h,_);a&&(s=s?{...s,...a}:a);const m=s&&this.toQueryString(s),b=this.contentFormatters[n||"application/json"],E=o||y.format,P=`${i||this.baseUrl||""}${r}${m?`?${m}`:""}`,j=l?l(P,{body:e,secure:t,path:r,type:n,query:s,format:o,baseUrl:i,cancelToken:c,extraQuery:a,proxyHandler:l,...h}):P,qt=new Request(j,{...y,headers:{...y.headers||{},...n&&n!=="multipart/form-data"?{"Content-Type":n}:{}},signal:(c?this.createAbortSignal(c):y.signal)||null,body:typeof e>"u"||e===null?null:b(e)});return this.customFetch(qt).then(async xt=>{const O=xt;O.data=null,O.error=null,O.meta={request:qt,response:O};const lo=E?await xt[E]().then(Q=>(O.ok?O.data=Q:O.error={data:Q},O)).catch(Q=>(O.error=Q,O)):O;return c&&this.abortControllers.delete(c),lo})}},Jr=class{http;constructor(e){this.http=e}ai_create=(e,t={})=>this.http.request({path:"/ai-generator/v1/ai",method:"POST",body:e,type:d.UrlEncoded,...t})},Xr=class{http;constructor(e){this.http=e}ai_status_list=(e,t={})=>this.http.request({path:"/ai-generator/v1/ai-status",method:"GET",query:e,...t})},Qr=class{http;constructor(e){this.http=e}clear_history_list=(e,t={})=>this.http.request({path:"/ai-generator/v1/clear-history",method:"GET",query:e,...t})},zr=class{http;constructor(e){this.http=e}app_init_create=(e,t={})=>this.http.request({path:"/app/v1/app_init",method:"POST",body:e,type:d.UrlEncoded,...t})},Zr=class{http;constructor(e){this.http=e}get_list=(e,t={})=>this.http.request({path:"/cors-proxy/V1/get",method:"GET",query:e,...t})},en=class{http;constructor(e){this.http=e}token_create=(e={})=>this.http.request({path:"/jwt-auth/v1/token",method:"POST",...e});token_validate_create=(e={})=>this.http.request({path:"/jwt-auth/v1/token/validate",method:"POST",...e})},tn=class{http;constructor(e){this.http=e}top_used_list=(e,t={})=>this.http.request({path:"/projects/v1/top-used",method:"GET",query:e,...t})},rn=class{http;constructor(e){this.http=e}get_code_info_list=(e,t={})=>this.http.request({path:"/promo/v1/get_code_info",method:"GET",query:e,...t})},nn=class{http;constructor(e){this.http=e}set_code_create=(e,t={})=>this.http.request({path:"/promo/v1/set_code",method:"POST",body:e,type:d.UrlEncoded,...t})},sn=class{http;constructor(e){this.http=e}ai_create=(e,t={})=>this.http.request({path:"/save-file/v1/ai",method:"POST",body:e,type:d.UrlEncoded,...t})},on=class{http;constructor(e){this.http=e}ai_status_list=(e,t={})=>this.http.request({path:"/save-file/v1/ai-status",method:"GET",query:e,...t})},an=class{http;constructor(e){this.http=e}get_link_create=(e,t={})=>this.http.request({path:"/save-file/v1/get-link",method:"POST",body:e,type:d.UrlEncoded,...t})},cn=class{http;constructor(e){this.http=e}send_email_create=(e,t={})=>this.http.request({path:"/save-file/v1/send-email",method:"POST",body:e,type:d.UrlEncoded,...t})},un=class{http;constructor(e){this.http=e}shortener_create=(e,t={})=>this.http.request({path:"/save-file/v1/shortener",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t})},dn=class{http;constructor(e){this.http=e}upload_create=(e,t={})=>this.http.request({path:"/save-file/v1/upload",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t})},ln=class{http;constructor(e){this.http=e}get_translations2=({file:e,...t},r={})=>this.http.request({path:`/translations/v1/${e}`,method:"GET",...r});get_translations3=({id:e,file:t,...r},n={})=>this.http.request({path:`/translations/v1/${t}/${e}`,method:"GET",...n})},hn=class{http;constructor(e){this.http=e}add_user_create=(e,t={})=>this.http.request({path:"/user_to_project/v1/add_user",method:"POST",body:e,type:d.UrlEncoded,...t})},fn=class{http;constructor(e){this.http=e}blocktags_list=(e,t={})=>this.http.request({path:"/wp/v2/blocktags",method:"GET",query:e,format:"json",...t});blocktags_create=(e,t={})=>this.http.request({path:"/wp/v2/blocktags",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});blocktags_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/blocktags/${e}`,method:"GET",query:t,format:"json",...r});blocktags_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/blocktags/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});blocktags_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/blocktags/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});blocktags_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/blocktags/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});blocktags_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/blocktags/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n})},pn=class{http;constructor(e){this.http=e}comments_list=(e,t={})=>this.http.request({path:"/wp/v2/comments",method:"GET",query:e,format:"json",...t});comments_create=(e,t={})=>this.http.request({path:"/wp/v2/comments",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});comments_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/comments/${e}`,method:"GET",query:t,format:"json",...r});comments_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/comments/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});comments_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/comments/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});comments_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/comments/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});comments_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/comments/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n})},_n=class{http;constructor(e){this.http=e}confirmation_list=(e,t={})=>this.http.request({path:"/wp/v2/confirmation",method:"GET",query:e,...t})},We=class{http;constructor(e){this.http=e}eblock_list=(e,t={})=>this.http.request({path:"/wp/v2/eblock",method:"GET",query:e,format:"json",...t});eblock_create=(e,t={})=>this.http.request({path:"/wp/v2/eblock",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});eblock_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/eblock/${e}`,method:"GET",query:t,format:"json",...r});eblock_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/eblock/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});eblock_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/eblock/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});eblock_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/eblock/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});eblock_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/eblock/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n});eblock_revisions_list=({parent:e,...t},r={})=>this.http.request({path:`/wp/v2/eblock/${e}/revisions`,method:"GET",query:t,format:"json",...r});eblock_revisions_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/eblock/${e}/revisions/${t}`,method:"GET",query:r,format:"json",...n});eblock_revisions_delete=({parent:e,id:t,...r},n,s={})=>this.http.request({path:`/wp/v2/eblock/${e}/revisions/${t}`,method:"DELETE",body:n,type:d.UrlEncoded,format:"json",...s});eblock_autosaves_list=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/eblock/${e}/autosaves`,method:"GET",query:t,format:"json",...r});eblock_autosaves_create=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/eblock/${e}/autosaves`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});eblock_autosaves_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/eblock/${e}/autosaves/${t}`,method:"GET",query:r,format:"json",...n})},Ve=class{http;constructor(e){this.http=e}email_list=(e,t={})=>this.http.request({path:"/wp/v2/email",method:"GET",query:e,format:"json",...t});email_create=(e,t={})=>this.http.request({path:"/wp/v2/email",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});email_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/email/${e}`,method:"GET",query:t,format:"json",...r});email_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/email/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});email_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/email/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});email_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/email/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});email_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/email/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n});email_revisions_list=({parent:e,...t},r={})=>this.http.request({path:`/wp/v2/email/${e}/revisions`,method:"GET",query:t,format:"json",...r});email_revisions_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/email/${e}/revisions/${t}`,method:"GET",query:r,format:"json",...n});email_revisions_delete=({parent:e,id:t,...r},n,s={})=>this.http.request({path:`/wp/v2/email/${e}/revisions/${t}`,method:"DELETE",body:n,type:d.UrlEncoded,format:"json",...s});email_autosaves_list=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/email/${e}/autosaves`,method:"GET",query:t,format:"json",...r});email_autosaves_create=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/email/${e}/autosaves`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});email_autosaves_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/email/${e}/autosaves/${t}`,method:"GET",query:r,format:"json",...n})},mn=class{http;constructor(e){this.http=e}emailtags_list=(e,t={})=>this.http.request({path:"/wp/v2/emailtags",method:"GET",query:e,format:"json",...t});emailtags_create=(e,t={})=>this.http.request({path:"/wp/v2/emailtags",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});emailtags_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/emailtags/${e}`,method:"GET",query:t,format:"json",...r});emailtags_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/emailtags/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});emailtags_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/emailtags/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});emailtags_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/emailtags/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});emailtags_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/emailtags/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n})},yn=class{http;constructor(e){this.http=e}group_list=(e,t={})=>this.http.request({path:"/wp/v2/group",method:"GET",query:e,format:"json",...t});group_create=(e,t={})=>this.http.request({path:"/wp/v2/group",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});group_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/group/${e}`,method:"GET",query:t,format:"json",...r});group_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/group/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});group_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/group/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});group_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/group/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});group_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/group/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n})},En=class{http;constructor(e){this.http=e}notification_list=(e,t={})=>this.http.request({path:"/wp/v2/notification",method:"GET",query:e,format:"json",...t});notification_create=(e,t={})=>this.http.request({path:"/wp/v2/notification",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});notification_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/notification/${e}`,method:"GET",query:t,format:"json",...r});notification_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/notification/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});notification_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/notification/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});notification_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/notification/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});notification_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/notification/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n});notification_autosaves_list=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/notification/${e}/autosaves`,method:"GET",query:t,format:"json",...r});notification_autosaves_create=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/notification/${e}/autosaves`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});notification_autosaves_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/notification/${e}/autosaves/${t}`,method:"GET",query:r,format:"json",...n})},gn=class{http;constructor(e){this.http=e}project_list=(e,t={})=>this.http.request({path:"/wp/v2/project",method:"GET",query:e,format:"json",...t});project_create=(e,t={})=>this.http.request({path:"/wp/v2/project",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});project_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/project/${e}`,method:"GET",query:t,format:"json",...r});project_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/project/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});project_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/project/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});project_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/project/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});project_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/project/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n});project_revisions_list=({parent:e,...t},r={})=>this.http.request({path:`/wp/v2/project/${e}/revisions`,method:"GET",query:t,format:"json",...r});project_revisions_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/project/${e}/revisions/${t}`,method:"GET",query:r,format:"json",...n});project_revisions_delete=({parent:e,id:t,...r},n,s={})=>this.http.request({path:`/wp/v2/project/${e}/revisions/${t}`,method:"DELETE",body:n,type:d.UrlEncoded,format:"json",...s})},bn=class{http;constructor(e){this.http=e}subscription_list=(e,t={})=>this.http.request({path:"/wp/v2/subscription",method:"GET",query:e,format:"json",...t});subscription_create=(e,t={})=>this.http.request({path:"/wp/v2/subscription",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});subscription_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/subscription/${e}`,method:"GET",query:t,format:"json",...r});subscription_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/subscription/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});subscription_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/subscription/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});subscription_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/subscription/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});subscription_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/subscription/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n})},vn=class{http;constructor(e){this.http=e}users_register_create=(e={})=>this.http.request({path:"/wp/v2/users/register",method:"POST",...e});users_lostpassword_create=(e={})=>this.http.request({path:"/wp/v2/users/lostpassword",method:"POST",...e});users_lost_password_create=(e={})=>this.http.request({path:"/wp/v2/users/lost-password",method:"POST",...e});users_list=(e,t={})=>this.http.request({path:"/wp/v2/users",method:"GET",query:e,format:"json",...t});users_create=(e,t={})=>this.http.request({path:"/wp/v2/users",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});users_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/users/${e}`,method:"GET",query:t,format:"json",...r});users_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/users/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});users_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/users/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});users_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/users/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});users_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/users/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n});users_me_list=(e,t={})=>this.http.request({path:"/wp/v2/users/me",method:"GET",query:e,format:"json",...t});users_me_create=(e,t={})=>this.http.request({path:"/wp/v2/users/me",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});users_me_update=(e,t={})=>this.http.request({path:"/wp/v2/users/me",method:"PUT",body:e,type:d.UrlEncoded,format:"json",...t});users_me_partial_update=(e,t={})=>this.http.request({path:"/wp/v2/users/me",method:"PATCH",body:e,type:d.UrlEncoded,format:"json",...t});users_me_delete=(e,t={})=>this.http.request({path:"/wp/v2/users/me",method:"DELETE",body:e,type:d.UrlEncoded,format:"json",...t});users_application_passwords_list=({userId:e,...t},r={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords`,method:"GET",query:t,format:"json",...r});users_application_passwords_create=({userId:e,...t},r,n={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});users_application_passwords_delete=({userId:e,...t},r={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords`,method:"DELETE",format:"json",...r});users_application_passwords_introspect_list=({userId:e,...t},r={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/introspect`,method:"GET",query:t,format:"json",...r});users_application_passwords_detail=({userId:e,uuid:t,...r},n={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/${t}`,method:"GET",query:r,format:"json",...n});users_application_passwords_create2=({userId:e,uuid:t,...r},n,s={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/${t}`,method:"POST",body:n,type:d.UrlEncoded,format:"json",...s});users_application_passwords_update=({userId:e,uuid:t,...r},n,s={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/${t}`,method:"PUT",body:n,type:d.UrlEncoded,format:"json",...s});users_application_passwords_partial_update=({userId:e,uuid:t,...r},n,s={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/${t}`,method:"PATCH",body:n,type:d.UrlEncoded,format:"json",...s});users_application_passwords_delete2=({userId:e,uuid:t,...r},n={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/${t}`,method:"DELETE",format:"json",...n})},On={aiGenerator:[Jr,Xr,Qr],app:[zr],corsProxy:[Zr],jwtAuth:[en],projects:[tn],promo:[rn,nn],saveFile:[sn,on,an,cn,un,dn],translations:[ln],userToProject:[hn],wp:[fn,pn,_n,We,Ve,mn,yn,En,gn,bn,vn]},Tn=p("prewarm.networkActivity");function In(){let e=0;const t=new Set,r=()=>{t.forEach(n=>n())};return{begin(){e+=1,r();let n=!1;return()=>{n||(n=!0,e-=1,r())}},inFlight:()=>e,watch(n){return t.add(n),()=>t.delete(n)}}}function Ke(e){return e.getOrCreateInstance(Tn,()=>In())}var An=Symbol("rest.publicRequest"),Ye=p("rest.requestHandler"),Pn=p("rest.responseHandler"),de=p("rest.customFetch"),Je=(e,t)=>fetch(e,t),le=p("rest_transport"),Sn=e=>{e.inject(de,{execute:async(t,r={})=>{const n=e.getServices(Ye),s={public:r[An]===!0},o=Ke(e).begin();try{let i=t instanceof Request?t:new Request(t,r);for(const l of n){const h=await l.execute(i,s);h instanceof Request&&(i=h)}let c=await fetch(i);const a=e.getServices(Pn);for(const l of a)c=await l.execute(c,i);return c}finally{o()}}})};function Dn(e,t){const r=e.getInstance(le);if(!r)throw new Error("[restApi] транспорт не зарегистрирован в контейнере");return Object.assign({},...t.map(n=>new n(r)))}var wn=3e5,S=new Map,U=new Map,Xe=new Set(["generic","stockImages","emFiles","cdn"]),Cn=/^https:\/\/(?:media\d*|i)\.giphy\.com\/media/i,jn=/^https:\/\/api\.giphy\.com\/v1\/gifs/i,Nn=/^https:\/\/images\.unsplash\.com/i,Rn=/^https:\/\/api\.unsplash\.com/i,Ln=/^https:\/\/assets\.streamlinehq\.com/i,Un=/^https:\/\/public-api\.streamlinehq\.com/i;function W(e){return typeof e=="string"&&e.trim().length>0}function qn(){const e="https://px0.racs.rest/";if(W(e))return e;const t={}.REACT_APP_UNSPLASH_PROXY;return W(t)?t:void 0}function Qe(){return{stockImagesProxyUrl:"https://api.emailmaker.ru/services/stock_images",stockImagesProxyUrlApi:"https://api.emailmaker.ru/services/stock_images_api",genericProxyUrl:qn()}}function xn(e){const t=[],{stockImagesProxyUrl:r,stockImagesProxyUrlApi:n,genericProxyUrl:s}=Qe();return n&&t.push({id:"mode-default-stock-images-api",match:"https://api.unsplash.com/{path}",proxyBase:n,rewrite:"{path}?proxy_url={origin}{search}{hash}"}),r&&t.push({id:"mode-default-stock-images-cdn",match:"https://images.unsplash.com/{path}",proxyBase:r,rewrite:"{path}?proxy_url={origin}{search}{hash}"}),s&&t.push({id:"mode-default-generic",proxyBase:s,rewrite:"{path}?proxy_url={origin}{search}{hash}"}),t.length>0?t:void 0}function ze(e){return!!e}var kn=()=>{if(!(typeof window>"u"))return window.location.origin};function $n(e){const t=kn();if(!t)return!1;try{return new URL(e).origin===t}catch{return!1}}function Mn(e,t){try{const r=new URL(e).hostname.toLowerCase();return t.find(n=>n.toLowerCase()===r)??null}catch{return null}}function Fn(e,t){return t?!1:e==="downloadBlob"||e==="display"}function Bn(e){const t=e.trim();return t?t.replace(/:\d+$/,""):""}function Gn(e,t){if(!t.proxySameOrigin&&$n(e))try{return{skipReason:"same-origin",matchedHost:new URL(e).hostname}}catch{return null}const r=Mn(e,t.directHosts);return r?{skipReason:"direct-host",matchedHost:r}:null}function Hn(e){const t=[];for(const r of e){if(Array.isArray(r)){for(const n of r)t.push(n);continue}t.push(r)}return t}function Wn(e){const t=new Set,r=[];for(const n of e){const s=I(typeof n=="string"?n:n.proxyBase||"");s&&t.has(s)||(s&&t.add(s),r.push(n))}return r}function he(e){return e?.backendProxy}function I(e){return e.replace(/\/$/,"")}function fe(e){return/^https?:\/\//i.test(e)}function Vn(e){return e==="/"?"":e.replace(/\/$/,"")}function q(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function pe(e){const t=new Set;return e.filter(r=>!r.url||t.has(r.url)?!1:(t.add(r.url),!0))}function _e(){return"https://emcdn.ru"}function Ze(e){return!q(e)||"match"in e||"rewrite"in e||"proxyBase"in e?!1:Object.keys(e).some(t=>Xe.has(t))}function et(e){if(e!=null)return q(e)&&("value"in e||"replace"in e)?e.value:e}function tt(e,t="generic",r=!1){const n=ot(e,r);if(n)return Ze(n)?et(n[t]??n.generic):n}function rt(e,t=!1){const r=ot(e,t);return r?Ze(r)?Object.keys(r).filter(n=>Xe.has(n)).map(n=>et(r[n])).filter(Boolean):[r]:[]}function Kn(e){const t=he(e);return t?[t]:[]}function Yn(e,t=!1){if(ze(t))return{proxyBlobFetch:!0,proxyImgSrc:!0,proxyCdn:!0,proxyEmFiles:!0,proxyStockImages:!0};const{stockImagesProxyUrl:r,stockImagesProxyUrlApi:n}=Qe();return{proxyBlobFetch:!0,proxyImgSrc:!1,proxyCdn:!1,proxyEmFiles:!1,proxyStockImages:W(r)||W(n)}}function nt(e){const t=[],r=new Set;for(const n of e){const s=Bn(n);if(!s)continue;const o=s.toLowerCase();r.has(o)||(r.add(o),t.push(s))}return t}function st(e){return e?Array.isArray(e)?nt(e):nt(e.value??[]):[]}function Jn(e,t){return[...new Set([...e,...t])]}function Xn(e){const t=e?.canvasImageCache;if(t===!1)return[];const r=t===!0||t===void 0?{}:t;return r.enabled===!1?[]:r.sourceHosts===void 0?[]:st(r.sourceHosts)}function Qn(e,t){return{inheritDefaults:!e,proxySameOrigin:!1,directHosts:[],...Yn(t,e)}}function x(e,t=!1){const r=Qn(t,e),n=e?.resourceProxyPolicy??{};return{inheritDefaults:n.inheritDefaults??r.inheritDefaults,proxySameOrigin:n.proxySameOrigin??r.proxySameOrigin,directHosts:Jn(Xn(e),n.directHosts!==void 0?st(n.directHosts):r.directHosts),proxyBlobFetch:n.proxyBlobFetch??r.proxyBlobFetch,proxyImgSrc:n.proxyImgSrc??r.proxyImgSrc,proxyCdn:n.proxyCdn??r.proxyCdn,proxyEmFiles:n.proxyEmFiles??r.proxyEmFiles,proxyStockImages:n.proxyStockImages??r.proxyStockImages,recoveryTtlMs:n.recoveryTtlMs??r.recoveryTtlMs}}function zn(e,t=!1){return x(e,t).inheritDefaults}function Zn(e,t=!1){const r=x(e,t).recoveryTtlMs;return typeof r=="number"&&r>0?r:wn}function ot(e,t=!1){const r=e?.resourceProxy;if(!zn(e,t))return r;const n=xn(e);if(r===void 0)return n;const s=Nr([n,r]);return Array.isArray(s)?Wn(Hn(s)):s}function es(e){return{proxyEmFiles:!0,proxyAi:!1}}function me(e,t,r,n=!1){const s=x(r,n);if(t==="display")return e==="stockImages"?s.proxyStockImages:s.proxyImgSrc;switch(e){case"cdn":return s.proxyCdn;case"emFiles":return s.proxyEmFiles;case"stockImages":return s.proxyStockImages;default:return s.proxyBlobFetch}}function ts(e,t,r,n=!1){return e==="stockImages"&&me("stockImages",t,r,n)}function rs(e,t){const r=es(t),n=t?.backendProxyPolicy;switch(e){case"emFiles":return n?.proxyEmFiles??r.proxyEmFiles;case"ai":return n?.proxyAi??r.proxyAi;default:return!0}}var ns={url:".+",url_encoded:".+",origin:"https?:\\/\\/[^\\/?#]+",origin_encoded:".+",proxy_url:"https?:\\/\\/[^\\/?#]+",proxy_url_encoded:".+",path:"[^?#]*",pathname:"[^?#]*",path_with_slash:"\\/[^?#]*",pathname_with_slash:"\\/[^?#]*",query:"[^#]*",search:"\\?[^#]*",hash:"#.*",fragment:".*",pathname_after_wp_json:"[^?#]*",pathname_after_wp_json_with_slash:"\\/[^?#]*",rest_namespace:"[^/?#]*",rest_version:"[^/?#]*",rest_route:"[^?#]*",rest_route_with_slash:"\\/[^?#]*"};function ss(e){const t=[],r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\{([a-z_]+)\\\}/gi,(n,s)=>(t.push(s),`(${ns[s]||".+"})`));return{regex:new RegExp(`^${r}$`,"i"),tokens:t}}function os(e){return/[?#]/.test(e)||/\{(?:url|url_encoded|query|search|hash|fragment)\}/i.test(e)}function is(e,t){if(os(t))return e;try{const r=new URL(e);return`${r.origin}${r.pathname}`}catch{return e.split(/[?#]/)[0]||e}}function as(e,t,r){if(r.endsWith("_encoded"))return!0;const n=e.slice(0,t),s=n.lastIndexOf("#"),o=n.lastIndexOf("?"),i=n.lastIndexOf("&"),c=n.lastIndexOf("=");return c>Math.max(o,i)&&c>s}function cs(e){try{const t=new URL(e),r=t.pathname.replace(/^\/+/,""),n=t.search.replace(/^\?/,""),s=t.hash.replace(/^#/,""),o=r.replace(/^wp-json\/?/i,""),i=o?`/${o}`:"/",c=o.match(/^([^/]+)(?:\/([^/]+))?(?:\/(.*))?$/),a=c?.[1]||"",l=c?.[2]||"",h=c?.[3]||"";return{url:e,url_encoded:encodeURIComponent(e),origin:t.origin,origin_encoded:encodeURIComponent(t.origin),proxy_url:t.origin,proxy_url_encoded:encodeURIComponent(t.origin),path:r,pathname:r,path_with_slash:t.pathname||"/",pathname_with_slash:t.pathname||"/",query:n,search:t.search,hash:t.hash,fragment:s,pathname_after_wp_json:o,pathname_after_wp_json_with_slash:i,rest_namespace:a,rest_version:l,rest_route:h,rest_route_with_slash:h?`/${h}`:"/"}}catch{return}}function k(e,t){if(!e)return{};if(Array.isArray(e)){for(const c of e){const a=k(c,t);if(a!==void 0)return a}return}if(e==="*")return{};const r=is(t,e),{regex:n,tokens:s}=ss(e),o=n.exec(r);if(!o)return;const i={};return s.forEach((c,a)=>{i[`matched_${c}`]=o[a+1]||""}),i}function A(e,t,r={}){const n=cs(t);if(!n)return t;const s={...n,...r};let o="",i=0;const c=/\{([a-z_]+)\}/gi;let a;for(;a=c.exec(e);){o+=e.slice(i,a.index);const l=s[a[1]]??"",h=as(e,a.index,a[1])?encodeURIComponent(l):l;o+=h,i=a.index+a[0].length}o+=e.slice(i);try{const l=new URL(o),h=new URL(t);return!o.includes("{search}")&&!o.includes("{query}")&&h.search&&h.searchParams.forEach((_,y)=>{l.searchParams.has(y)||l.searchParams.append(y,_)}),!o.includes("{hash}")&&!o.includes("{fragment}")&&h.hash&&!l.hash&&(l.hash=h.hash),l.toString()}catch{return o}}function V(e,t){try{const r=new URL(t);return`${I(e)}/${r.pathname.replace(/^\//,"")}${r.search}${r.hash}`}catch{return t}}function K(e,t){const r=I(e);return t?fe(t)?t:t.startsWith("?")||t.startsWith("#")?`${r}${t}`:`${r}${t.startsWith("/")?"":"/"}${t}`:r}function it(e,t,r,n){const s=e.match;return s?Array.isArray(s)?s.some(o=>it({...e,match:o},t,r,n)):typeof s=="function"?!!s({url:t,resourceType:r,intent:n}):s==="*"?!0:k(s,t)!==void 0:!0}function us(e,t,r,n,s,o){if(e==null)return[];const i=Array.isArray(e)?e:[e],c=[];return i.forEach((a,l)=>{if(!a)return;if(typeof a=="string"){const m=a.includes("{")&&a.includes("}")?A(a,t):V(a,t);c.push({key:`${r}:${l}`,url:m,source:n});return}if(!q(a)||!("rewrite"in a))return;const h=a;if(!it(h,t,s,o))return;const _=typeof h.match=="string"||Array.isArray(h.match)?k(h.match,t)||{}:{},y=typeof h.proxyBase=="string"&&h.proxyBase.trim()?h.proxyBase.trim():void 0;(Array.isArray(h.rewrite)?h.rewrite:[h.rewrite]).filter(Boolean).forEach((m,b)=>{const E=typeof m=="function"?(()=>{const P=m({url:t,proxyBase:y,resourceType:s,intent:o,..._}),j=y&&!fe(P)?K(y,P):P;return j.includes("{")&&j.includes("}")?A(j,t,_):j})():y?A(K(y,m),t,_):m.includes("{")&&m.includes("}")?A(m,t,_):V(m,t);c.push({key:`${r}:${h.id||"rule"}:${l}:${b}`,url:E,source:n})})}),pe(c)}function at(e,t,r,n){const s=e.match;return s?Array.isArray(s)?s.some(o=>at({...e,match:o},t,r,n)):typeof s=="function"?!!s({url:t,method:n,requestType:r}):s==="*"?!0:k(s,t)!==void 0:!0}function ds(e,t,r,n="generic"){if(e==null)return[];const s=Array.isArray(e)?e:[e],o=[];return s.forEach((i,c)=>{if(!i)return;if(typeof i=="string"){const _=i.includes("{")&&i.includes("}")?A(i,t):V(i,t);o.push({key:`backend:${c}`,url:_,source:"resource"});return}if(!q(i)||!("rewrite"in i))return;const a=i;if(!at(a,t,n,r))return;const l=typeof a.match=="string"||Array.isArray(a.match)?k(a.match,t)||{}:{},h=typeof a.proxyBase=="string"&&a.proxyBase.trim()?a.proxyBase.trim():void 0;(Array.isArray(a.rewrite)?a.rewrite:[a.rewrite]).filter(Boolean).forEach((_,y)=>{const m=typeof _=="function"?(()=>{const b=_({url:t,proxyBase:h,method:r,requestType:n,...l}),E=h&&!fe(b)?K(h,b):b;return E.includes("{")&&E.includes("}")?A(E,t,l):E})():h?A(K(h,_),t,l):_.includes("{")&&_.includes("}")?A(_,t,l):V(_,t);o.push({key:`backend:${a.id||"rule"}:${c}:${y}`,url:m,source:"resource"})})}),pe(o)}function ls(e,t,r){return[e,...r.map(n=>n.url)].join("|")}function hs(e,t){if(!e||t.length<2)return t;const r=S.get(e);if(!r?.activeUrl)return t;const n=t.find(s=>s.url===r.activeUrl);return n?[n,...t.filter(s=>s.url!==r.activeUrl)]:t}function ct(e){e&&U.get(e)?.forEach(t=>{try{t()}catch{}})}function fs(e,t){if(!e)return()=>{};const r=U.get(e)||new Set;return r.add(t),U.set(e,r),()=>{const n=U.get(e);n&&(n.delete(t),n.size===0&&U.delete(e))}}function ut(e,t){if(!e)return!1;const r=S.get(e);return!!r?.failedUntil&&r.activeUrl===t.url&&r.failedUntil>Date.now()}function ps(e,t){const r=hs(e,t);if(!e||r.length<2)return r;const n=[],s=[];return r.forEach(o=>{ut(e,o)?s.push(o):n.push(o)}),[...n,...s]}function dt(e,t){if(!e)return;const r=S.get(e);S.set(e,{activeUrl:t.url}),(r?.activeUrl!==t.url||r?.failedUntil)&&ct(e)}function lt(e,t,r,n=!1){if(!e)return;const s=Zn(r,n),o={activeUrl:t.url,failedUntil:Date.now()+s},i=S.get(e);S.set(e,o),(i?.activeUrl!==o.activeUrl||i?.failedUntil!==o.failedUntil)&&ct(e)}function _s(e){return Ln.test(e)||Un.test(e)}function ms(e){return Cn.test(e)||jn.test(e)}function ye(e){return _s(e)||ms(e)}function Ee(e,t){const r=_e();return r&&e.startsWith(I(r))?"cdn":Nn.test(e)||Rn.test(e)?"stockImages":"generic"}function ys(e){try{const t=new URL(e);return/(?:^|\/)wp-json\/em-files\/v\d+(?:\/|$)/i.test(t.pathname)?"emFiles":/(?:^|\/)wp-json\/ai-generator\/v\d+(?:\/|$)/i.test(t.pathname)?"ai":"generic"}catch{return"generic"}}function Es(e,t){try{const r=new URL(e),n=new URL(t),s=Vn(n.pathname),o=s===""?!0:r.pathname===s||r.pathname.startsWith(`${s}/`);if(r.origin!==n.origin||!o)return null;const i=r.searchParams.get("url");if(i)return i;const c=r.searchParams.get("proxy_url");if(!c)return null;const a=new URL(c),l=s===""?r.pathname.replace(/^\/+/,""):r.pathname.slice(s.length).replace(/^\/+/,"");return a.pathname=l?`/${l}`:"/",r.searchParams.forEach((h,_)=>{_==="proxy_url"||_==="url"||a.searchParams.has(_)||a.searchParams.append(_,h)}),r.hash&&!a.hash&&(a.hash=r.hash),a.toString()}catch{return null}}function ge(e,t=[]){return e==null||(Array.isArray(e)?e:[e]).forEach(r=>{if(r){if(typeof r=="string"){const n=r.split("{")[0]?.trim();n&&t.push(I(n));return}!q(r)||!("rewrite"in r)||(typeof r.proxyBase=="string"&&r.proxyBase.trim()&&t.push(I(r.proxyBase.trim())),(Array.isArray(r.rewrite)?r.rewrite:[r.rewrite]).forEach(n=>{if(typeof n!="string")return;const s=n.split("{")[0]?.trim();s&&t.push(I(s))}))}}),t}function gs(e,t,r=!1){return rt(t,r).flatMap(n=>ge(n)).filter(Boolean).some(n=>n&&e.startsWith(n))}function bs(e,t){return Kn(t).flatMap(r=>ge(r)).filter(Boolean).some(r=>r&&e.startsWith(r))}function vs(e,t,r=!1){const n=rt(t,r).flatMap(s=>ge(s)).filter(Boolean);for(const s of n){const o=Es(e,s);if(o)return o}return null}function ht(e,t,r=!1){return gs(e,t,r)}function $(e,t,r=!1){return vs(e,t,r)||e}function Os(e,t,r,n=!1){return!!tt(r,e,n)&&me(e,t,r,n)}function Ts(e,t){return!!he(t)&&rs(e,t)}function Is(e,t,r,n=!1){return ze(n)||t==="downloadBlob"?!1:e==="stockImages"?me(e,t,r,n):!1}function As(e,t={}){const r=t.config,n=$(e,r,t.standalone),s=t.resourceType||Ee(n,r),o=t.intent||"display";if(ye(n))return{resourceType:"generic",intent:o,candidates:[]};const i=Os(s,o,r,t.standalone)?us(tt(r,s,t.standalone),n,s,"resource",s,o):[];return{resourceType:s,intent:o,candidates:i,stabilityKey:i.length?ls(s,o,i):void 0}}function Ps(e,t={}){const r=t.requestType||ys(e);return Ts(r,t.config)?ds(he(t.config),e,t.method,r):[]}function M(e,t={},r){const n=t.intent||r;if(ht(e,t.config,t.standalone)){const a=$(e,t.config,t.standalone),l=t.resourceType||Ee(a,t.config),h={key:"already-proxied",url:e,source:"direct"};return{chain:{resourceType:l,intent:n,candidates:[h]},candidates:[h]}}const s=$(e,t.config,t.standalone),o=t.resourceType||Ee(s,t.config),i=Is(o,n,t.config,t.standalone);if(Fn(n,i)&&!ye(s)&&!ts(o,n,t.config,t.standalone)){const a=Gn(s,x(t.config,t.standalone));if(a){const l={key:`direct-${a.skipReason}`,url:s,source:"direct"};return{chain:{resourceType:o,intent:n,candidates:[l],directShortCircuit:a},candidates:[l]}}}const c=As(s,{...t,intent:n,resourceType:o});return{chain:c,candidates:pe([...ps(c.stabilityKey,c.candidates),...i?[]:[{key:"direct",url:s,source:"direct"}]])}}function ft(e,t,r={},n){const{chain:s,candidates:o}=M(e,r,n),i=o.find(c=>c.url===t);return!i||i.source!=="resource"?null:{chain:s,candidate:i}}function Ss(e,t,r={}){const n=ft(e,t,r,"display");n&&dt(n.chain.stabilityKey,n.candidate)}function Ds(e,t,r={}){const n=ft(e,t,r,"display");n&<(n.chain.stabilityKey,n.candidate,r.config,r.standalone)}function Y(e,t,r,n=!1){return{src:e,changed:r,exhausted:n,reason:t}}var ws=class extends Error{final=!0;skipReason;hostname;constructor(e,t){super(`Direct resource fetch failed (${e}: ${t}). ${e==="same-origin"?"The same-origin asset is unreachable; check that the resource exists and is served by the editor origin.":"Add CORS headers for the editor origin or remove the host from directHosts."}`),this.name="DirectResourceFetchError",this.skipReason=e,this.hostname=t}};function Cs(e,t){return new ws(e,t)}function js(e){if(e instanceof Error&&e.name==="AbortError")return!1;if(e instanceof TypeError)return!0;if(e instanceof Error){if(e.message==="Proxy validation failed")return!1;if(e.message.startsWith("Proxy fetch failed with status"))return!0}return!0}function Ns(e,t=!1){const r=x(e,t);return{inheritDefaults:r.inheritDefaults,proxySameOrigin:r.proxySameOrigin,directHosts:[...r.directHosts]}}function Rs(e){return e.length>0&&e.every(t=>t.source==="direct")}function Ls(e,t,r){return e.directShortCircuit?e.directShortCircuit.skipReason:t.length===1&&t[0]?.source==="direct"&&ye(r)?"direct-only-vendor":null}function Us(e,t,r){return e.directShortCircuit||r==="direct-only-vendor"||Rs(t)?"direct":"proxy"}function qs(e,t={}){const{chain:r,candidates:n}=M(e,t,t.intent||"display"),s=r.stabilityKey?S.get(r.stabilityKey):void 0,o=n[0]?.url||e,i=Ls(r,n,$(e,t.config,t.standalone)),c=Ns(t.config,t.standalone);return{originalUrl:e,resourceType:r.resourceType,intent:r.intent,stabilityKey:r.stabilityKey,currentSrc:o,runtimeState:s?{...s}:void 0,decision:Us(r,n,i),skipReason:i,matchedHost:r.directShortCircuit?.matchedHost,policy:c,candidates:n.map(a=>({...a,isCurrent:a.url===o,isFailed:ut(r.stabilityKey,a),failedUntil:s?.activeUrl===a.url?s?.failedUntil:void 0}))}}function xs(e,t={}){let r=M(e,t,"display"),n=r.candidates,s=n[0]?.url||e,o=Math.max(0,n.findIndex(c=>c.url===s));const i=()=>{const c=M(e,t,"display"),a=c.candidates,l=a[0]?.url||e;return!l||l===s?(r=c,n=a,o=Math.max(0,a.findIndex(h=>h.url===s)),Y(s,"unchanged",!1)):(r=c,n=a,s=l,o=Math.max(0,a.findIndex(h=>h.url===s)),Y(s,"runtime-update",!0))};return{get src(){return s},get stabilityKey(){return r.chain.stabilityKey},handleChangeSrc:()=>i(),handleSuccess:()=>{Ss(e,s,t)},handleError:()=>{Ds(e,s,t);const c=i();if(c.changed&&c.src)return c;const a=n[o+1];return!a||a.url===s?Y(null,"exhausted",!1,!0):(s=a.url,o+=1,Y(s,"candidate-fallback",!0))},subscribeToSrcChange:c=>{const a=()=>{const l=i();l.changed&&c(l)};return fs(r.chain.stabilityKey,a)},getDebugSnapshot:()=>qs(e,t)}}async function ks(e,t={}){if(ht(e,t.config,t.standalone))return fetch(e,t.init);const r=t.config,{chain:n,candidates:s}=M(e,t,t.intent||"downloadBlob");let o;for(const i of s)try{const c=await fetch(i.url,t.init);if(!c.ok)throw new Error(`Proxy fetch failed with status ${c.status}`);if(t.validateBlob){const a=await c.clone().blob();if(!await t.validateBlob(a))throw new Error("Proxy validation failed")}return i.source==="resource"&&dt(n.stabilityKey,i),c}catch(c){o=c,i.source==="resource"&<(n.stabilityKey,i,r,t.standalone)}throw n.directShortCircuit&&s.length===1&&s[0]?.source==="direct"&&js(o)?Cs(n.directShortCircuit.skipReason,n.directShortCircuit.matchedHost):o instanceof Error?o:new Error("Failed to fetch resource through proxy chain")}function pt(e,t={}){return bs(e,t.config)?[e]:Ps(e,t).map(r=>r.url)}function $s(e,t){const r=_e(),n=t.filter(Boolean).map(s=>String(s).replace(/^\/+|\/+$/g,""));return r?`${I(r)}/${n.join("/")}`:n.join("/")}function Ms(e,t){const r=_e();return!!r&&e.startsWith(I(r))}function D(e){for(;e.endsWith("/");)e=e.slice(0,e.length-1);return/\/wp-json$/i.test(e)?e:`${e}/wp-json`}function Fs(...e){const t=e.filter(o=>o!=null);if(t.length===0)return;if(t.length===1)return t[0];const r=t.find(o=>o.aborted);if(r)return r;if(typeof AbortSignal<"u"&&typeof AbortSignal.any=="function")return AbortSignal.any(t);const n=new AbortController,s=o=>{n.signal.aborted||n.abort(o.reason)};for(const o of t)o.addEventListener("abort",()=>s(o),{once:!0});return n.signal}var _t=3e5,mt=15e3,g=null,yt=!1;function Bs(){return!0}function Gs(){const e=String({}.REACT_APP_OPENAPI_FAILOVER_TTL_MS||"").trim();if(!e)return _t;const t=Number(e);return Number.isFinite(t)&&t>0?t:_t}function Et(){const e=String({}.REACT_APP_OPENAPI_FAILOVER_ATTEMPT_TIMEOUT_MS||"").trim();if(!e)return mt;const t=Number(e);return Number.isFinite(t)&&t>0?t:mt}function Hs(){const e="https://app.emailmaker.ru/api/".trim();return e?D(e):void 0}function Ws(e){const t=e.trim();if(!t)return[];if(t.startsWith("["))try{const r=JSON.parse(t);if(!Array.isArray(r))throw new Error("expected JSON array");return r.map(n=>String(n).trim()).filter(Boolean)}catch{return yt||(yt=!0),[]}return t.split(",").map(r=>r.trim()).filter(Boolean)}function Vs(e){const t=new Set,r=[];for(const n of e){const s=D(n);t.has(s)||(t.add(s),r.push(s))}return r}function gt(e){const t=String(e||"").trim();return t?D(t):Hs()}function bt(e,t=[]){return e?Vs([e,...t]).slice(0,3):[]}function vt(){return Ws(String({}.REACT_APP_OPENAPI_FAILOVER_BASE_URLS||"").trim())}function Ks(e=Date.now()){return g?e-g.switchedAt>=Gs():!0}function Ot(e=Date.now()){g&&Ks(e)&&(g=null)}function J(e){if(!Bs())return!1;const t=gt(e);if(!t)return!1;const r=vt();return r.length===0?!1:bt(t,r).length>1}function F(e){const t=gt(e);if(!t)return[];const r=vt();return r.length===0?[t]:bt(t,r)}function be(e){const t=F(e);if(t.length===0)return"";if(Ot(),g){const r=t.indexOf(g.activeUrl);if(r>=0)return t[r]}return t[0]}function Tt(e){const t=F(e);if(t.length<=1||(Ot(),!g||!t.includes(g.activeUrl)))return t;const r=g.activeUrl;return[r,...t.filter(n=>n!==r)]}function Ys(){return Et()}function Js(e){return be(e)||void 0}function It(e){const t=e||void 0;if(typeof AbortController>"u")return{signal:t,timeoutError:()=>{},done:()=>{}};const r=Et(),n=new AbortController;let s;const o=setTimeout(()=>{s=Xs(r),n.abort(s)},r);return{signal:Fs(t,n.signal),timeoutError:()=>s,done:()=>clearTimeout(o)}}function Xs(e){const t=`[apiOriginFailover] origin attempt timed out after ${e}ms`;if(typeof DOMException=="function")return new DOMException(t,"TimeoutError");const r=new Error(t);return r.name="TimeoutError",r}function At(e){return e===502||e===503||e===504}function Pt(e){return!(e instanceof Error)&&!(e instanceof DOMException)?!1:e.name==="TimeoutError"?!0:e instanceof TypeError}var Qs;function ve(e,t){if(!J(t))return;const r=F(t);if(r.length<=1)return;const n=r.indexOf(D(e));if(n<0)return;const s=n+1;if(s>=r.length)return;const o=r[s],i=g?.activeUrl;g={activeUrl:o,switchedAt:Date.now()},i!==o&&Qs?.()}function St(e,t){if(!J(t))return;const r=D(e),n=F(t);if(n.includes(r)){if(r===n[0]){g=null;return}g?.activeUrl!==r&&(g={activeUrl:r,switchedAt:Date.now()})}}function Dt(){g=null}var zs=e=>{const t=new FormData,r=(n,s,o)=>{if(s!=null){if(s instanceof Blob){n.append(o,s);return}if(Array.isArray(s)){s.forEach((i,c)=>{const a=o?`${o}[${c}]`:`${c}`;r(n,i,a)});return}if(typeof s=="object"){Object.keys(s).forEach(i=>{const c=s[i],a=o?`${o}[${i}]`:i;r(n,c,a)});return}n.append(o,String(s))}};return r(t,e),t},Zs={baseUrl:D("https://app.emailmaker.ru/api/"),baseApiParams:{secure:!0,credentials:"same-origin",format:"json"},securityWorker:()=>({credentials:"same-origin"})},C=new Map;function eo(e){const t=e?.getInstance(Ce);return t?t.get()??t.bootstrap():void 0}var to=class extends Yr{container;constructor(e={},t){super(e),this.container=t}buildRequestUrl(e){const{path:t,baseUrl:r,extraQuery:n}=e;let{query:s}=e;n&&(s=s?{...s,...n}:n);const o=s&&this.toQueryString(s);return`${r||this.baseUrl||""}${t}${o?`?${o}`:""}`}buildRequestKey(e,t){return`${t.toUpperCase()} ${e}`}getBackendProxyCandidates(e,t){const r=eo(this.container),n=this.container?.getInstance(Ne)!==void 0,s=pt(e,{config:r,method:t,standalone:n}),o=s.length>0?s:[e],i=this.buildRequestKey(e,t),c=C.get(i);return!c||!o.includes(c)?o:[c,...o.filter(a=>a!==c)]}shouldRetryResponse(e){return e.status===502||e.status===503||e.status===504}resolveFailoverBaseUrl(){return String(this.baseUrl||"").trim()||void 0}async requestOnOrigin(e,t,r=!1){const n={...e,baseUrl:t},s=this.buildRequestUrl(n),o=n.method||"GET",i=this.buildRequestKey(s,o),c=this.getBackendProxyCandidates(s,o);let a,l;for(const h of c){const _=m=>m===s?h:m,y=r?It(e.signal):void 0;try{const m=await super.request({...n,proxyHandler:_,...y?{signal:y.signal}:{}});if(!m.ok&&this.shouldRetryResponse(m)&&h!==c[c.length-1]){l=m,C.get(i)===h&&C.delete(i);continue}return C.set(i,h),m}catch(m){C.get(i)===h&&C.delete(i);const b=y?.timeoutError();if(b)throw b;if(a=m,(m instanceof DOMException||m instanceof Error)&&m.name==="AbortError")throw m}finally{y?.done()}}if(l)return l;throw a instanceof Error?a:new Error("Backend proxy chain failed")}async request(e){const t=String(e.baseUrl||"").trim();if(t)return this.requestOnOrigin(e,t);const r=this.resolveFailoverBaseUrl(),n=J(r),s=e.failoverAttemptTimeout??n,o=n?Tt(r):r?[be(r)]:[this.baseUrl].filter(Boolean);if(o.length===0)return this.requestOnOrigin(e,this.baseUrl);let i,c;for(let a=0;a<o.length;a++){const l=o[a],h=a===o.length-1;try{const _=await this.requestOnOrigin(e,l,s);if(!_.ok&&At(_.status)){if(c=_,!h){ve(l,r);continue}break}return _.ok&&St(l,r),_}catch(_){if(!Pt(_))throw _;i=_,h||ve(l,r)}}if(n&&Dt(),c)return c;throw i instanceof Error?i:new Error("API origin failover chain failed")}};function wt(e){for(const[t,r]of Object.entries(On)){const n=r.map(o=>new o(e)),s=Object.assign({},...n);Object.assign(e,{[t]:s})}}function ro(e=Zs){const t=new Map;return{create(r,n){const s=new to({...e,...r},n);return s.contentFormatters["multipart/form-data"]=zs,wt(s),t.set(s,{options:r,container:n}),s},getOptions(){return e},setOptions(r){e=r;for(const[n,s]of t)Object.assign(n,{...e,...s.options})}}}var Ct=p("rest.clientFactory");function no(e){return e.getOrCreateInstance(Ct,()=>ro())}function so(e,t={}){const r=ce(e)?ke(e):e;return no(r).create(t,r)}var oo=e=>{const t=e.getInstance(le);if(!t){io(e);return}wt(t),e.inject(ue,t)},io=e=>{Sn(e);const t=so(e,{customFetch:e.getInstance(de)?.execute??Je});e.inject(ue,t),e.inject(le,t)},Oe;(function(e){const t="https://racs.emcdn.ru/v3";function r(s,o){const i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o)};return fetch(`${t}?resource=${s}&dataset=${document.location.hostname}`,i)}e.post=r;async function n(s,o=0){const i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:`{"filter":{},"limit":${o}}`};return await(await fetch(`${t}/get?resource=${s}&dataset=${document.location.hostname}`,i)).json()}e.getAll=n})(Oe||(Oe={}));var X=p("plugin.auth.token"),jt=new WeakMap,ao=3e4;function co(e){let t;try{t=He(e).exp}catch{return!0}return typeof t!="number"||!Number.isFinite(t)?!0:t*1e3<=Date.now()+ao}function Nt(e,t,r,n){const s=jt.get(e);s&&(s.stale=!0);const o={stale:!1};jt.set(e,o),e.injectFactory(X,async(i,c)=>{if(o.stale)return"";try{let a=await c||void 0;if(!a){const l=e.getInstance(je);l&&(a=await l)}return t?!a||co(a)?await t(r,n,a):a:""}catch{return""}},!0)}var Rt=p("auth.oauthProvided"),Lt=new WeakMap;function Ut(e,t){const r=Lt.get(e)??{applied:!1};(!r.applied||r.getAuthToken!==t.getAuthToken||!H(r.user,t.user)||r.project!==t.project)&&(Lt.set(e,{applied:!0,getAuthToken:t.getAuthToken,user:t.user,project:t.project}),Nt(e,t.getAuthToken,t.user,t.project))}function uo(e){if(e.getInstance(Rt))return;e.inject(Rt,!0);let t;e.getInstance(we)?.watch(r=>{t=r}),e.addService(Ye,{execute:async(r,n)=>{if(n?.public||!t?.getAuthToken)return;e.getInstance(X)===void 0&&Ut(e,t);const s=await e.getInstanceAsync(X);s&&r.headers.set("authorization",`Bearer ${s}`)}})}var bo=Ie(e=>(uo(e),{setOptions(t){Ut(e,t)}}));Object.defineProperty(u,"ADVANCED_SETTINGS_PANEL",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(u,"AIREST_CLIENT_ID",{enumerable:!0,get:function(){return Br}}),Object.defineProperty(u,"APP_ID",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(u,"ATOMS_HANDLERS_ID",{enumerable:!0,get:function(){return Rr}}),Object.defineProperty(u,"AsyncEmitter",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(u,"BaseEmitter",{enumerable:!0,get:function(){return R}}),Object.defineProperty(u,"CONFIG_CHANGED_EVENT_ID",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(u,"CONFIG_SOURCE_ID",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(u,"COOKIE_MANAGER_ID",{enumerable:!0,get:function(){return Gr}}),Object.defineProperty(u,"CUSTOM_FETCH_ID",{enumerable:!0,get:function(){return de}}),Object.defineProperty(u,"Container",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(u,"ContentType",{enumerable:!0,get:function(){return d}}),Object.defineProperty(u,"DISPOSABLE_ID",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(u,"DependencyResolver",{enumerable:!0,get:function(){return re}}),Object.defineProperty(u,"Disposable",{enumerable:!0,get:function(){return v}}),Object.defineProperty(u,"ELEMENT_MAP",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(u,"Emitter",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(u,"HANDLE_ATOM_INSERT_ID",{enumerable:!0,get:function(){return Lr}}),Object.defineProperty(u,"IMAGE_BLOB_RESOLVER_ID",{enumerable:!0,get:function(){return Wr}}),Object.defineProperty(u,"INIT_PIPELINE_ID",{enumerable:!0,get:function(){return or}}),Object.defineProperty(u,"INJECTION",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(u,"INSTANCE_ID",{enumerable:!0,get:function(){return ir}}),Object.defineProperty(u,"JWT_ERROR_ID",{enumerable:!0,get:function(){return hr}}),Object.defineProperty(u,"JWT_TOKEN_ID",{enumerable:!0,get:function(){return lr}}),Object.defineProperty(u,"MESSAGE_SERVICE_ID",{enumerable:!0,get:function(){return Ur}}),Object.defineProperty(u,"MODAL_CLOSE_EVENT",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(u,"MODAL_SHOW_EVENT",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(u,"MODAL_UPDATE_EVENT",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(u,"MessageService",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(u,"NOT_IMPLEMENTED_IN_PLUGIN",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(u,"OPTIONS_SOURCE_ID",{enumerable:!0,get:function(){return we}}),Object.defineProperty(u,"PLUGIN_COLLECTION_ID",{enumerable:!0,get:function(){return fr}}),Object.defineProperty(u,"RACS",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(u,"REST_CLIENT_FACTORY_ID",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(u,"REST_CLIENT_ID",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(u,"SECURITY_MODULE_ID",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(u,"SETTINGS_PANEL_EVENT",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(u,"STANDALONE_ACTIVATED_ID",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(u,"STANDALONE_BOOTSTRAP_TOKEN_ID",{enumerable:!0,get:function(){return je}}),Object.defineProperty(u,"STANDALONE_FILE_PROXY_REGISTERED_ID",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(u,"STANDALONE_PROJECT_ID",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(u,"STORAGE_PROVIDER_ID",{enumerable:!0,get:function(){return Hr}}),Object.defineProperty(u,"STORE_ID",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(u,"Signal",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(u,"TEMPLATE_DIRECTIVES_ID",{enumerable:!0,get:function(){return Vr}}),Object.defineProperty(u,"TOKEN_ID",{enumerable:!0,get:function(){return X}}),Object.defineProperty(u,"V2REST_CLIENT_ID",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(u,"WpEblockApi",{enumerable:!0,get:function(){return We}}),Object.defineProperty(u,"WpEmailApi",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(u,"abandonStickyOrigin",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(u,"beginFailoverAttempt",{enumerable:!0,get:function(){return It}}),Object.defineProperty(u,"buildCdnFileUrl",{enumerable:!0,get:function(){return $s}}),Object.defineProperty(u,"combineMixins",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(u,"createAbortError",{enumerable:!0,get:function(){return w}}),Object.defineProperty(u,"createIdentifier",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(u,"createIdentifier$1",{enumerable:!0,get:function(){return p}}),Object.defineProperty(u,"decodeJwt",{enumerable:!0,get:function(){return He}}),Object.defineProperty(u,"deepEqual",{enumerable:!0,get:function(){return H}}),Object.defineProperty(u,"defineMixin",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(u,"events",{enumerable:!0,get:function(){return se}}),Object.defineProperty(u,"fetchWithResourceProxy",{enumerable:!0,get:function(){return ks}}),Object.defineProperty(u,"filter",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(u,"generateUUID",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(u,"getActiveBaseUrl",{enumerable:!0,get:function(){return be}}),Object.defineProperty(u,"getApi",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(u,"getContainer",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(u,"getEmitter",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(u,"getEvent",{enumerable:!0,get:function(){return er}}),Object.defineProperty(u,"getFailoverAttemptTimeoutMs",{enumerable:!0,get:function(){return Ys}}),Object.defineProperty(u,"getNetworkActivity",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(u,"getOrderedOriginCandidates",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(u,"getOriginChain",{enumerable:!0,get:function(){return F}}),Object.defineProperty(u,"getProxiedUrl",{enumerable:!0,get:function(){return xs}}),Object.defineProperty(u,"getServiceContainerId",{enumerable:!0,get:function(){return B}}),Object.defineProperty(u,"globalFetch",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(u,"isAbortError",{enumerable:!0,get:function(){return _r}}),Object.defineProperty(u,"isCdnUrl",{enumerable:!0,get:function(){return Ms}}),Object.defineProperty(u,"isFailoverEnabled",{enumerable:!0,get:function(){return J}}),Object.defineProperty(u,"isStateContainer",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(u,"normalizeBaseUrl",{enumerable:!0,get:function(){return D}}),Object.defineProperty(u,"pickKey",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(u,"provideLegacyRestSections",{enumerable:!0,get:function(){return oo}}),Object.defineProperty(u,"raceWithAbortSignal",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(u,"recreateTokenProvider",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(u,"reportOriginFailure",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(u,"reportOriginSuccess",{enumerable:!0,get:function(){return St}}),Object.defineProperty(u,"resolveBackendProxyRequestCandidates",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(u,"resolveContainer",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(u,"resolveExplicitApiBaseUrl",{enumerable:!0,get:function(){return Js}}),Object.defineProperty(u,"shouldFailoverError",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(u,"shouldFailoverResponse",{enumerable:!0,get:function(){return At}}),Object.defineProperty(u,"snapshot",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(u,"throwIfAborted",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(u,"unwrapResourceProxyUrl",{enumerable:!0,get:function(){return $}}),Object.defineProperty(u,"waitForElement",{enumerable:!0,get:function(){return Le}})});
|
|
4
|
+
|
|
5
|
+
(function(){try{if(typeof document<"u"){var p='.blocks-app .selected-element-panel__columns-settings__controls__field{background:var(--em-colorBgElevated);border:calc(var(--em-borderWidth) * 1px) solid var(--em-colorFillSecondaryDarken);transition:all .2s linear .2s}.blocks-app .selected-element-panel__columns-settings__controls__field:hover{border-color:var(--em-borderColorHover)}.blocks-app .selected-element-panel__columns-settings__controls__field:focus,.blocks-app .selected-element-panel__columns-settings__controls__field:focus-within{border-color:var(--em-colorPrimaryBorder);box-shadow:0 0 0 2px #0591ff1a}.blocks-app .selected-element-panel__columns-settings__controls__column.current .selected-element-panel__columns-settings__controls__field{background:var(--em-colorPrimaryBg);border-color:var(--em-colorPrimaryBorder)}.blocks-app .structures{margin-left:-3px;margin-right:-3px;overflow:visible}.blocks-app .structures__list{margin-bottom:-10px}.blocks-app .structures__item{box-sizing:border-box;cursor:grab;flex-direction:row;justify-content:center;align-items:center;width:100%;min-width:100%;height:50px;margin-bottom:20px;padding:0;display:flex}.blocks-app .structures__item:hover .structures__item-row{background:var(--em-colorFillTertiary);border:#0000;box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #00000017}.dark .blocks-app .structures__item:hover .structures__item-row{background:var(--em-colorBgSpotlight)}.blocks-app .structures__item-row{background:var(--em-colorFillSecondary);border-radius:calc(var(--em-borderRadius) * 1.2px);width:97%;height:100%;padding:6px 3px;transition:box-shadow .3s,border-color .3s,background-color .3s}.blocks-app .structures__item-col{border-radius:calc(var(--em-borderRadius) * 1px);border:1px solid var(--em-controlItemBgActiveHover);background:var(--em-controlItemBgActive);width:100%;height:100%}.dark .blocks-app .structures__item-col{border-color:var(--em-colorBgElevated);background:var(--em-colorFillTertiary)}.blocks-app .em-dragging-element .structures__item .structures__item-row{background-color:var(--em-controlTmpOutline);box-shadow:none}.dark .blocks-app .em-dragging-element .structures__item .structures__item-row{background:var(--em-controlTmpOutline)}.blocks-app .em-dragging-element .structures__item .structures__item-row .structures__item-col{opacity:0;border-radius:calc(var(--em-borderRadius) * 1px)}.blocks-app .em-ghost-element{background-color:var(--em-colorBgContainer);border-radius:calc(var(--em-borderRadiusXL) * 1px)}.blocks-app .em-ghost-element .structures__item-col{opacity:1!important}.dark .blocks-app .em-ghost-element{background:var(--em-colorBgSpotlight)}@media (width<=1550px){.blocks-app .structures__item{margin-bottom:16px}.blocks-app .structures__item:last-child{margin-bottom:20px}}.blocks-app .ant-modal.premium-features-modal .ant-modal-container{border-radius:calc(var(--em-borderRadiusXL) * 2px);padding:20px 19px}.blocks-app .premium-features-modal .modal-title{text-align:center;margin-bottom:0;font-size:32px}.blocks-app .premium-features-modal .ant-carousel .slick-dots li button{opacity:.5;background:#fff}.blocks-app .premium-features-modal .ant-carousel .slick-dots li.slick-active button{opacity:1}.blocks-app .premium-features-modal .modal-subtitle{text-align:center;margin-bottom:20px;font-size:18px}.blocks-app .premium-features-modal .carousel-slider{margin-bottom:20px}.blocks-app .premium-features-modal .slick-list{border-radius:calc(var(--em-borderRadiusXL) * 1.5px)}.blocks-app .premium-features-modal .slick-slide{padding:0 5px}.blocks-app .premium-features-modal .carousel-slide{border-radius:calc(var(--em-borderRadiusXL) * 1.5px);justify-content:flex-end;align-items:center;height:480px;display:flex}.blocks-app .premium-features-modal .slide-item-image{width:50%;padding:24px 0 24px 32px}.blocks-app .premium-features-modal .slide-item-image img{border-radius:calc(var(--em-borderRadiusXL) * 1.3px);width:100%}.blocks-app .premium-features-modal .slide-item-content{width:50%;padding:48px}.blocks-app .premium-features-modal .slide-title{margin-bottom:48px;font-size:50px;font-weight:700;line-height:1}.blocks-app .premium-features-modal .slide-description{font-size:22px}.blocks-app .premium-features-modal .modal-buttons{justify-content:center;gap:10px;display:flex}.blocks-app .premium-features-modal .modal-buttons button{padding:0 30px}.blocks-app .trial-suggest-modal{max-width:calc(100vw - 24px)}.blocks-app .trial-suggest-modal .ant-modal-container{border-radius:16px;padding:0;overflow:hidden}.blocks-app .trial-suggest-modal__layout{align-items:stretch;display:flex}.blocks-app .trial-suggest-modal__gallery{background:var(--em-colorFillQuaternary);flex:0 0 300px;width:300px;max-width:300px;position:relative;overflow:hidden}.blocks-app .trial-suggest-modal__slide-image{border-right:1px solid var(--em-colorFillSecondary);background-repeat:no-repeat;background-size:cover;transition:opacity .4s;position:absolute;inset:0}.blocks-app .trial-suggest-modal__content{flex:auto;min-width:0;max-width:100%;padding:32px}.blocks-app .trial-suggest-modal__badge{background:var(--em-colorPrimaryBg);color:var(--em-colorPrimary);border-radius:12px;margin-bottom:12px;padding:2px 10px;font-size:12px;font-weight:600;line-height:20px;display:inline-block}.blocks-app .trial-suggest-modal__title{color:var(--em-colorText);margin:0 0 8px;font-size:22px;font-weight:600;line-height:1.25}.blocks-app .trial-suggest-modal__intro{color:var(--em-colorTextSecondary);margin:0 0 16px}.blocks-app .trial-suggest-modal__features{margin:0 0 20px;padding:0;list-style:none}.blocks-app .trial-suggest-modal__features li{color:var(--em-colorText);align-items:flex-start;gap:10px;margin-bottom:10px;display:flex}.blocks-app .trial-suggest-modal__feature-icon,.blocks-app .trial-suggest-modal__promise-icon{flex:none;width:20px;height:20px;margin-top:2px;font-size:20px;line-height:20px}.blocks-app .trial-suggest-modal__feature-icon svg,.blocks-app .trial-suggest-modal__promise-icon svg{width:100%;height:100%}.blocks-app .trial-suggest-modal__feature-icon{color:var(--em-colorPrimary)}.blocks-app .trial-suggest-modal__promise{background:var(--em-colorFillQuaternary);color:var(--em-colorText);border-radius:8px;align-items:flex-start;gap:10px;margin:0 0 8px;padding:12px;display:flex}.blocks-app .trial-suggest-modal__promise-icon{color:var(--em-colorSuccess)}.blocks-app .trial-suggest-modal__note{color:var(--em-colorTextTertiary);margin:0 0 24px;font-size:12px;line-height:140%}.blocks-app .trial-suggest-modal__buttons{justify-content:space-between;align-items:center;gap:8px;display:flex}.blocks-app .trial-suggest-modal__decline.ant-btn{box-shadow:none;color:var(--em-colorTextSecondary);border:1px solid #0000}.blocks-app .trial-suggest-modal__decline.ant-btn:hover,.blocks-app .trial-suggest-modal__decline.ant-btn:focus,.blocks-app .trial-suggest-modal__decline.ant-btn:focus-visible,.blocks-app .trial-suggest-modal__decline.ant-btn:active{box-shadow:none;border:1px solid #0000;transform:none}.blocks-app .trial-suggest-modal__decline.ant-btn:hover:not(:disabled){background:var(--em-colorFillTertiary);color:var(--em-colorText)}@media (width<=720px){.blocks-app .trial-suggest-modal__layout{flex-direction:column}.blocks-app .trial-suggest-modal__gallery{flex:none;width:auto;max-width:none;height:180px}.blocks-app .trial-suggest-modal__content{padding:24px}}.blocks-app .atoms{overflow:visible}.blocks-app .atoms__list{margin-bottom:20px;transition:opacity .2s}.blocks-app .atoms__item{font:inherit;text-align:center;appearance:none;box-sizing:border-box;border-radius:calc(var(--em-borderRadius) * 1px);width:109px;height:70px;color:var(--em-colorTextSecondary);background:var(--em-colorFillSecondary);border:0;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:5px;display:flex;position:relative}.blocks-app .atoms__item.ant-card-hoverable{cursor:grab!important}.blocks-app .atoms__item:hover{border-color:var(--em-colorBgElevated)}.dark .blocks-app .atoms__item:hover{border-color:var(--em-colorTextDisabled);background:var(--em-colorBorder)}.blocks-app .atoms__item_inactive{opacity:.5;cursor:default}.blocks-app .atoms__item_inactive:hover{border-color:var(--em-colorBorder)}.blocks-app .atoms__item_locked .atom-image{opacity:.55;margin-bottom:6px;display:inline-flex;position:relative}.blocks-app .atoms__item_locked .atom-image__lock{opacity:1;background-color:var(--em-colorBgContainer);border-radius:100%;position:absolute;bottom:-2px;right:-6px}.blocks-app .atoms__item_locked .atom-title{opacity:.55}.blocks-app .atoms__item.ai:before{content:"AI";color:#fff;background-color:var(--em-colorInfo);text-align:center;border-radius:0 calc(var(--em-borderRadius) * 1px) 0 calc(var(--em-borderRadiusSM) * 1px);width:36px;padding:1px 5px;font-size:12px;line-height:1.2;display:inline-block;position:absolute;top:0;right:0}.blocks-app .atoms__item.amp:before{content:"AMP";color:#fff;background-color:var(--em-colorPrimary);text-align:center;border-radius:0 8px 0 5px;width:36px;padding:1px 5px;font-size:12px;line-height:1.2;display:inline-block;position:absolute;top:0;right:0}.blocks-app .atoms .anticon{color:var(--em-colorTextSecondary);font-size:28px}.blocks-app .atoms .em-dragging-element .atoms__item{background-color:var(--em-controlTmpOutline)}.blocks-app .atoms .em-ghost-element{background-color:var(--em-colorBgContainer)!important;border:1px solid var(--em-colorBorder)!important}.blocks-app .atoms .atom-title{color:var(--em-colorTextTertiary);text-align:center;font-size:13px;line-height:1}.blocks-app #email_iframe{vertical-align:top;background-color:#f8f8f8;border:0;width:1px;min-width:100%}.blocks-app .iframe-provider+#email_iframe_slot{pointer-events:none}.blocks-app .iframe-provider{width:100%;height:100%;position:absolute;top:0;left:0}.blocks-app .browser-extension-warning-modal__footer,.blocks-app .browser-translate-warning-modal__footer{justify-content:center;margin-top:24px;display:flex}.blocks-app .user-list{z-index:10;background:#fff0;padding:1px;display:flex;position:absolute;bottom:10px;left:10px}.blocks-app .user{text-align:center;align-items:center;width:0;height:35px;margin-left:20px;transition:all .4s cubic-bezier(.645,.045,.355,1);display:flex;position:relative}.blocks-app .user:first-child{margin-left:0}.blocks-app .user-list.open .user:not(:first-child){margin-left:38px}.blocks-app .user:before{content:"";background:var(--em-user-color,white);border:1.5px solid var(--em-border-color,white);border-radius:50%;width:34px;height:34px;transition:all .2s cubic-bezier(.645,.045,.355,1);display:block;position:absolute}.blocks-app .user div{width:34px;color:var(--em-text-color,white);cursor:default;border-radius:50%;font-weight:600;line-height:40px;text-decoration:none;position:absolute}.blocks-app .email-pane{position:relative}.blocks-app .email-pane__loader{z-index:10;background-color:#fff6;width:100%;height:100%;position:fixed;top:0;left:0}.dark .blocks-app .email-pane__loader{background-color:#0006}.blocks-app .email-pane__paths{border-top:1px solid var(--em-colorBorder);z-index:10;background-color:var(--em-colorBgContainer);justify-content:space-between;align-items:center;width:100%;transition:all .5s;display:flex;position:sticky;bottom:0;left:0}.blocks-app .email-pane__paths>div{color:var(--em-colorTextTertiary);padding:3px 15px}.blocks-app .email-pane__paths .ant-breadcrumb{white-space:nowrap;overflow:auto hidden}.blocks-app .email-pane__paths .ant-breadcrumb ol{flex-wrap:nowrap;padding-right:10px}.blocks-app .email-pane__paths .ant-breadcrumb li{position:relative}.blocks-app .email-pane__paths .ant-breadcrumb li:hover>span{color:var(--em-colorPrimary)}.blocks-app .email-pane__paths .ant-breadcrumb li>span{color:var(--em-colorTextSecondary);cursor:pointer;padding:3px 15px;display:block}.blocks-app .email-pane__paths .ant-breadcrumb li>span span{align-items:center;gap:4px;display:flex}.blocks-app .email-pane__paths .ant-breadcrumb li:after{content:"";border-style:solid;border-width:15px 0 15px 10px;border-color:transparent transparent transparent var(--em-colorBgContainer);width:0;height:0;transition:all .5s;position:absolute;top:50%;right:-5px;transform:translateY(-50%)}.blocks-app .email-pane__paths .ant-breadcrumb li:before{content:"";border-style:solid;border-width:15px 0 15px 10px;border-color:transparent transparent transparent var(--em-colorBorder);width:0;height:0;transition:all .5s;position:absolute;top:50%;right:-6px;transform:translateY(-50%)}.blocks-app .email-pane__code-size{white-space:nowrap;margin-left:auto;padding:3px 15px;font-size:14px}.blocks-app .email-pane__code-size_exceeded{color:var(--em-colorError)}.blocks-app .email-pane .ant-btn-primary.mobile_view{background-color:var(--em-colorInfo)}.blocks-app .email-pane .ant-btn-primary.mobile_view:hover{background-color:var(--em-colorInfoHover)}.blocks-app .email-pane .ant-tabs .ant-tabs-tab-btn{transition:none}.blocks-app .email-pane .ant-tabs-extra-content{justify-content:center;align-items:center;display:flex}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode{margin-top:22px;transform:rotate(90deg)}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode .ant-segmented-item-label{min-height:40px;padding:0;line-height:40px}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode .ant-segmented-item-icon{width:28px;height:40px;display:inline-block;transform:rotate(-90deg)}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode .ant-segmented-item-icon .anticon{position:relative}.blocks-app .email-pane .email-pane_code-mode .email-pane__col-wrapper{transition:all .5s;padding-top:0!important}.blocks-app .blocks-plugin .email-pane .email-pane_code-mode .email-pane__resizable{padding-top:60px;transition:all .5s}.blocks-app .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__col-wrapper{padding-top:0!important}.blocks-app .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__left .email-pane__content-col_main{border-width:0;border-radius:0;margin-left:0;margin-right:0;border-top-width:0!important;border-bottom-width:0!important;border-right-width:0!important}.blocks-app .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__right .email-pane__content-col_main{border-width:0;border-radius:0;margin-left:0;margin-right:0;border-top-width:0!important;border-bottom-width:0!important;border-left-width:0!important}.blocks-app .blocks-plugin .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__resizable{max-width:calc(100% - 2px);margin-bottom:0;padding-top:0}.blocks-app .email-pane .selected-td-form__padding-input .ant-input-number-focused input{text-align:left}.blocks-app .email-pane .selected-td-form__padding-input input{text-align:center}.blocks-app .email-pane .email-pane__comment-counter{background-color:var(--em-colorInfo);color:var(--em-colorWhite);border:none}.blocks-app .email-pane .element-controls{width:100%;height:100%}.blocks-app .email-pane #selected_element_form_desktop_props{height:100%}.blocks-app .email-pane .ant-tabs .ant-divider-horizontal.selected-td-form__divider{border-top:1px solid var(--em-colorBorderSecondary);background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);width:calc(100% + 50px);margin:26px -23px}.dark .blocks-app .email-pane .ant-tabs .ant-divider-horizontal.selected-td-form__divider{background:linear-gradient(180deg, var(--em-colorBgBase), transparent 40%)}.blocks-app .email-pane .ant-tabs .element-controls .selected-td-form__divider{margin-top:0;margin-bottom:0}.blocks-app .email-pane .ant-tabs .blocks-search__divider{pointer-events:none;width:auto;height:20px;margin:24px 0 0;position:absolute;bottom:-20px;left:-24px;right:-13px}.blocks-app .email-pane .ant-tabs ::-webkit-scrollbar-thumb{box-shadow:inset 0 0 0 10px var(--em-colorFillSecondary)}.blocks-app .email-pane .ant-tabs ::-webkit-scrollbar-thumb:hover{box-shadow:inset 0 0 0 10px var(--em-colorFill)}.blocks-app .email-pane .ant-tabs .blocks-search__empty-shadow{height:100%;position:relative}.blocks-app .email-pane .ant-tabs .blocks-search__empty-shadow:after{content:"";background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);z-index:1;width:calc(100% + 48px);height:20px;margin-left:-24px;position:absolute;top:0;left:0}.blocks-app .email-pane .ant-tabs .blocks-search__empty-wrapper{height:calc(100% + 10px);margin:0 -24px;padding:24px 14px 0 24px;position:relative;overflow:scroll}.blocks-app .email-pane__container{scroll-behavior:smooth;min-height:100%;padding-top:0}.blocks-app .email-pane_code-mode .email-pane__container{overflow:unset;height:unset;padding-bottom:0;position:relative}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel{z-index:101;pointer-events:none;height:0;position:absolute;inset:0 0 auto}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel>div{pointer-events:auto}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel .selected-element-panel-content.selected-element-panel__content_abs{width:fit-content;max-width:calc(100% - 24px);min-height:auto;display:block}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel .selected-element-panel-content.selected-element-panel__content_abs form.element-controls{height:auto;min-height:auto}.blocks-app .email-pane__col-wrapper{flex-wrap:nowrap;gap:30px;display:flex;position:relative}.blocks-app .email-pane__col-wrapper .email-pane__col_settings{margin-top:30px}.blocks-app .email-pane__col-wrapper .email-pane__col_settings-inner{border-radius:8px;position:sticky;top:30px;left:0}.blocks-app .ant-app .email-pane__col-wrapper_reverse{flex-direction:row-reverse}.blocks-app .email-pane .email-pane__sizeSwitcher:not(.email-pane__pinch,.email-pane__right) .email-pane__col-wrapper{top:-114px}.blocks-app .email-pane_code-mode .email-pane__code-divider{z-index:10;opacity:0;cursor:ew-resize;background-color:var(--em-colorPrimary);width:5px;height:100%;transition:opacity .4s;position:absolute}.blocks-app .email-pane_code-mode .email-pane__code-divider:hover,.blocks-app .email-pane_code-mode .email-pane__code-divider:active{opacity:1;background-color:var(--em-colorPrimary)}.blocks-app .email-pane_code-mode.email-pane .email-pane__row:not(.email-pane__bottom,.email-pane__sizeSwitcher) .email-pane__content-col_main{border-radius:0;border:0 solid var(--em-colorBorder)!important;margin:0!important}.blocks-app .email-pane_code-mode.email-pane .email-pane__row:not(.email-pane__bottom,.email-pane__sizeSwitcher) [class^=device-width__] button{display:none}.blocks-app .email-pane_code-mode .email-pane__left{flex-direction:row}.blocks-app .email-pane_code-mode .email-pane__left>div:first-child{border-right:1px solid var(--em-colorBorder);overflow-y:auto!important}.blocks-app .email-pane_code-mode .email-pane__left .email-pane__handle.left{display:none}.blocks-app .email-pane_code-mode .email-pane__left .email-pane__code-divider{left:-2px}.blocks-app .email-pane_code-mode .email-pane__right{flex-direction:row-reverse}.blocks-app .email-pane_code-mode .email-pane__right>div:first-child{border-left:1px solid var(--em-colorBorder);overflow-y:auto!important}.blocks-app .email-pane_code-mode .email-pane__right .email-pane__handle.right{display:none}.blocks-app .email-pane_code-mode .email-pane__right .email-pane__code-divider{right:-2px}.blocks-app .email-pane_code-mode .email-pane__bottom{max-width:unset;flex-direction:column;margin:0}.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__col-wrapper{width:100%;margin:0 auto}.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__code-divider{opacity:0;cursor:ns-resize;z-index:10;width:100%;height:2px;top:-2px}.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__code-divider:hover,.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__code-divider:active{opacity:1;background-color:var(--em-colorPrimary)}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper{gap:0;height:100%;padding-left:3px}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col.email-pane__col_preview{overflow-y:scroll;height:100%!important}@media (width<=1590px){.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col.email-pane__col_preview{overflow-x:hidden}}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .ant-tabs-content-holder{border-radius:0}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper.email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-left:10px;padding-right:0}.blocks-app .email-pane__left .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper.email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-left:65px;padding-right:0}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .ant-tabs-right>.ant-tabs-nav .ant-tabs-tab{height:53px;padding-top:6px;padding-left:6px;padding-right:6px}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-right:0}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0}.blocks-app .email-pane .email-pane__right.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-left:0;padding-right:35px;overflow:visible}.blocks-app .email-pane .email-pane__right.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview .email-pane__content-col.email-pane__content-col_main{border-width:1px}.blocks-app .email-pane .email-pane__left.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-left:65px!important;padding-right:0!important}.blocks-app .email-pane .email-pane__right .email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview,.blocks-app .email-pane .email-pane__left.email-pane__sizeSwitcher .email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-left:0!important;padding-right:0!important}.blocks-app .email-pane .email-pane__right:not(.email-pane__pinch) .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0;padding-right:65px}.blocks-app .email-pane .email-pane__right.email-pane__pinch.email-pane__sizeSwitcher .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0}.blocks-app .email-pane .email-pane__right.email-pane__pinch.email-pane__sizeSwitcher .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col_preview{padding-left:0;padding-right:65px}.blocks-app .email-pane .email-pane__reverse .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0}.blocks-app .email-pane .email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-top:30px}.blocks-app .email-pane .email-pane__sizeSwitcher .email-pane__col-wrapper_pinch .email-pane__col.email-pane__col_preview{padding:60px 2px 0}.blocks-app .email-pane .email-pane__reverse.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-right:65px}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__right .email-pane__col.email-pane__col_preview,.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__left .email-pane__col.email-pane__col_preview{padding-top:0}.blocks-app .email-pane .email-pane__right .email-pane__col_preview,.blocks-app .email-pane .email-pane__left .email-pane__col_preview{padding-left:0;padding-right:0}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col.email-pane__col_preview{height:100%!important}.blocks-app .email-pane .email-pane__sizes-panel-wrapper{z-index:5;position:sticky;top:30px;left:15px}.blocks-app .email-pane .email-pane__right .email-pane__sizes-panel-wrapper{left:auto;right:15px}.blocks-app .email-pane .email-pane__right.email-pane__sizeSwitcher .email-pane__sizes-panel-wrapper{display:none}.blocks-app .email-pane .email-pane__pinch .email-pane__sizes-panel-wrapper{position:absolute;top:12px;left:calc(50% - 266px)}.blocks-app .email-pane .email-pane__reverse .email-pane__sizes-panel-wrapper{left:auto;right:calc(50% - 266px)}.blocks-app .email-pane .email-pane__reverse.email-pane__left.email-pane__pinch .email-pane__sizes-panel-wrapper{display:none;left:15px;right:auto}.blocks-app .email-pane .email-pane__sizes-panel{background-color:var(--em-colorBgElevated);border:1px solid var(--em-colorBorder);border-radius:34px}.blocks-app .email-pane__header{padding-right:10px}.blocks-app .email-pane__header .header__left{margin-left:0}.blocks-app .email-pane__header .header__logo{float:left;height:auto;margin-top:5px;margin-right:26px;padding-right:0;font-size:22px!important}.blocks-app .email-pane__header__title{align-items:center;width:100%;display:flex}.blocks-app .email-pane__header__title__project a{white-space:nowrap;text-overflow:ellipsis;flex:1;max-width:190px;display:flex;overflow:hidden}.blocks-app .email-pane__header__title__project{float:left;margin-top:10px}.blocks-app .email-pane__header__title__project a:hover{color:var(--em-colorPrimary)}.blocks-app .email-pane__header__title .ant-typography{white-space:nowrap;text-overflow:ellipsis;flex:1;margin:10px 0 10px 20px;padding:0;display:flex;overflow:hidden}.blocks-app .email-pane__row{flex-wrap:nowrap;justify-content:space-between;gap:30px;height:100%;position:relative}.blocks-app .email-pane_path-enabled .email-pane__row{height:calc(100% - 29px)}.blocks-app .email-pane_code-mode .email-pane__row{gap:0;height:calc(100% - 29px);padding:0}.blocks-app .email-pane__col_settings{border-color:var(--em-colorBorder);height:100%;margin-right:50px;position:sticky;top:0;bottom:60px;overflow:visible}.blocks-app .email-pane__col_disabled.email-pane__content-col_tabs.email-pane__content-col{width:68px;min-width:68px;margin-right:0}.blocks-app .email-pane__col_settings-inner{height:100%;max-height:100%;margin-right:0}.blocks-app .email-pane__col_settings-inner_reverse{flex-direction:row-reverse}.blocks-app .email-pane__col_settings-inner_reverse .email-pane__tab-bar.ant-tabs-nav{margin-left:0;margin-right:8px}.blocks-app .email-pane__col_settings-inner_reverse .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab-btn>span{line-height:1}.blocks-app .email-pane__col .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab-btn>span{height:24px;margin-right:0;font-size:20px}.blocks-app .email-pane__col-wrapper_pinch .email-pane__col .email-pane__tab-bar.ant-tabs-nav{border-left:1px solid var(--em-colorBorderSecondary);background:var(--em-colorBgContainer)}.blocks-app .email-pane__reverse .email-pane__col-wrapper_pinch .email-pane__col .email-pane__tab-bar.ant-tabs-nav{border-left:none}.blocks-app .email-pane__col .email-pane__col_settings-inner_reverse{border-right:1px solid var(--em-colorBorder)}.blocks-app .email-pane_view .email-pane__col{height:calc(100vh - 48px);top:0;bottom:0;overflow:auto}.blocks-app .email-pane__col_settings{height:calc(100vh - 76px);position:sticky;top:10px;bottom:60px;overflow:auto}.blocks-app .email-pane_view .email-pane__col_settings{height:calc(100vh - 48px)}.blocks-app .email-pane__col_settings-collapsed{flex:0 0;max-width:0}.blocks-app .email-pane__col_preview{scroll-behavior:smooth}.blocks-app .email-pane_code-mode .email-pane__row:not(.email-pane__bottom) .email-pane__col_preview{overflow:auto;width:100%!important}.blocks-app .email-pane__col_preview-collapsed{flex:0 0 100%;width:100%;max-width:100%}.blocks-app .email-pane__col_settings{z-index:11;height:100%;position:sticky;top:20px;bottom:60px;overflow:visible}.blocks-app .email-pane__col_settings-inner{height:100%;max-height:100%}.blocks-app .email-pane__col_menu{margin-left:20px}.blocks-app .email-pane__col .ant-modal-close{top:14px;width:34px;height:34px;font-size:16px;position:absolute;inset-inline-end:12px;padding:0!important}.blocks-app .email-pane__col_code-mode .ant-menu-vertical.element-preview-menu__list_discuss li.ant-menu-item{text-align:center}.blocks-app .email-pane__col__alert{z-index:100;width:40%;max-width:400px;bottom:40px;left:10px;position:absolute!important}.blocks-app .email-pane__collapse-wrapper{background-color:var(--em-colorBgContainer);border:1px solid var(--em-colorBgContainer);border-radius:calc(var(--em-borderRadiusXL) * 1px);flex-direction:column;align-self:flex-start;height:auto;min-height:0;max-height:100%;display:flex;overflow:hidden}.dark .blocks-app .email-pane__collapse-wrapper{border:1px solid var(--em-colorBorderSecondary)}.blocks-app .email-pane__collapse-wrapper_disabled{display:none}.blocks-app .email-pane__collapse-wrapper>*{min-height:0;max-height:100%}.blocks-app .email-pane__collapse-wrapper .ant-tabs-content-holder{border-radius:0 0 calc(var(--em-borderRadiusXL) * 1px) calc(var(--em-borderRadiusXL) * 1px);border:none;margin:0 -1px -1px;transition:all .3s;overflow:hidden}.blocks-app .email-pane__collapse-wrapper .selected_form-mobile-props-title,.blocks-app .email-pane__collapse-wrapper .selected_form-desktop-props-title{opacity:0;will-change:transform, height;padding-top:0;transition:height .45s cubic-bezier(.16,1,.3,1),margin-top .45s cubic-bezier(.16,1,.3,1),transform .45s cubic-bezier(.16,1,.3,1),opacity .3s ease-out;transform:translateY(-100%)}@keyframes em-mobile-props-title-slide-in{0%{opacity:0;height:0;transform:translateY(-100%)}to{opacity:1;height:32px;transform:translateY(0)}}.blocks-app .email-pane__collapse-wrapper #selected_element_form_desktop_props{transition:all .1s}.blocks-app .email-pane__collapse-wrapper .selected_form-props-wrapper_optimize{padding-top:0}.blocks-app .ant-app .email-pane__collapse-wrapper .selected_form-mobile-props-title,.blocks-app .ant-app .email-pane__collapse-wrapper .selected_form-desktop-props-title{background-color:var(--em-colorInfoBg);border:none;border-radius:0;height:0;padding:0 24px;top:0;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .panel-form__body{border:1px solid var(--em-colorInfo);border-radius:0 0 calc(var(--em-borderRadius) * 2px) calc(var(--em-borderRadius) * 2px);scrollbar-gutter:auto;flex-direction:column;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .panel-form__body-content{flex-direction:column;flex:1;min-height:0;padding:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .panel-form__body-content>div{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .ant-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{color:var(--em-colorInfo)}.blocks-app .email-pane__collapse-wrapper.mobile-properties .ant-tabs .ant-tabs-ink-bar{background:var(--em-colorInfo)}.blocks-app .email-pane__collapse-wrapper.mobile-properties .email-properties__collapse:after{display:none}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel-content{flex-direction:column;flex:1;min-height:0;padding:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel{flex-direction:column;flex:1;min-height:0;padding-left:0;padding-right:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel>div{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties form.element-controls{flex-direction:column;height:100%;min-height:0;display:flex}.blocks-app .email-pane__collapse-wrapper.mobile-properties #selected_element_form_desktop_props{min-height:0;padding:24px var(--em-panel-form-padding-x,24px) 0;flex:1;overflow:hidden auto}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props-wrapper{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props-header{flex-shrink:0}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props{scrollbar-gutter:stable;flex:1;min-height:0;overflow:hidden auto}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel__float-blocks-settings{display:none}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-desktop-props-title{opacity:1;height:32px;animation:.45s cubic-bezier(.16,1,.3,1) both em-mobile-props-title-slide-in;transform:translateY(0)}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props-title{z-index:1;border:none;border-bottom:1px solid var(--em-colorBorderSecondary);background-color:var(--em-colorInfoBg);padding:5px 24px;transform:translateY(0)}.blocks-app .email-pane__collapse-wrapper.mobile-view .ant-tabs-tab:first-child:hover{color:var(--em-colorInfo)}.blocks-app .email-pane__collapse-wrapper.mobile-view .selected_form-mobile-props-title{opacity:1;height:32px;animation:.45s cubic-bezier(.16,1,.3,1) both em-mobile-props-title-slide-in;transform:translateY(0)}.blocks-app .email-pane__collapse-wrapper.mobile-view .selected_form-mobile-props-title .ant-alert-title{color:var(--em-colorInfoText)}.blocks-app .email-pane__collapse-wrapper_build{flex:1;align-self:stretch;height:100%}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse{flex:1;min-height:0}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse>.ant-tabs-content-holder{flex:1;min-height:0;display:flex}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse>.ant-tabs-content-holder>.ant-tabs-content{height:100%;min-height:0}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane-active{flex-direction:column;flex:1;min-height:0;display:flex}.blocks-app .email-pane__col-wrapper_pinch .email-pane__collapse-wrapper{border:none;border-left:1px solid var(--em-colorBorder);border-radius:0;height:100%}.blocks-app .email-pane__collapse{flex-direction:column;flex:1;width:100%;height:100%;min-height:0;max-height:100%;display:flex;overflow:hidden}.blocks-app .email-pane__collapse.ant-collapse{border:0}.blocks-app .email-pane__collapse-panel.ant-collapse-item{min-height:50px;overflow:hidden}.blocks-app .email-pane__comment-counter{border-radius:10px;width:27px;height:16px;margin:5px;padding:0 6px;font-size:12px}.blocks-app .email-pane__add-new-element-btn{width:100%;margin-bottom:60px}.blocks-app .email-pane__tab-bar.ant-tabs-nav{z-index:1;width:60px;margin-bottom:0;margin-left:8px;margin-right:0;top:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab-active{border-radius:8px;border-right:none!important}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tabpane,.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab{padding-left:0}.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-top:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-list{background:var(--em-colorBgContainer);border-radius:8px;flex:none;padding:0 0 4px;box-shadow:0 2px 10px #0500380a}.blocks-app .email-pane__col-wrapper_pinch .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-list{box-shadow:none;border-radius:0;height:100%}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-wrap{overflow:unset;flex:none}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder{border-left:none;margin-left:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder .ant-tabs-content>.ant-tabs-tabpane{padding-left:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:first-child,.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:nth-child(2),.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:nth-child(3){display:none}.blocks-app .email-pane__col-wrapper_pinch .email-pane__tab-bar.ant-tabs-nav{margin-left:0;margin-right:0}.blocks-app .email-pane .ant-tabs-right>.ant-tabs-content-holder,.blocks-app .email-pane .ant-tabs-right>div>.ant-tabs-content-holder{border-right:none;margin-right:0}.blocks-app .email-pane .ant-tabs-left>.ant-tabs-nav .ant-tabs-tab{border:1px solid #0000;height:60px;padding:14px 24px}@media (width<=1550px){.blocks-app .email-pane .ant-tabs-left>.ant-tabs-nav .ant-tabs-tab{height:50px}}.blocks-app .email-pane .ant-collapse-panel{box-sizing:content-box;height:calc(100% - 50px);margin-top:-1px;overflow:auto}.blocks-app .email-pane .ant-tabs-content{height:100%;max-height:100%}.blocks-app .email-pane .ant-collapse-body,.blocks-app .email-pane .secondary-tabs .ant-tabs-content{height:100%;padding-bottom:0;position:relative;overflow:hidden scroll}.blocks-app .email-pane__comment-counter{position:absolute;top:-4px;right:0}@media (width<=1550px){.blocks-app .email-pane__comment-counter{right:-5px}}.blocks-app .email-pane__content-col_disable{pointer-events:none}.blocks-app .email-pane .header__project{vertical-align:middle;align-items:center;height:28px;padding-top:0;display:inline-flex}.blocks-app .email-pane .header__project .ant-avatar.ant-avatar-circle{min-width:28px}.blocks-app .email-pane_view .header__project{pointer-events:none}.blocks-app .email-pane__pane{height:100%;transition:height .2s cubic-bezier(0,0,.2,1);position:relative}.blocks-app .email-pane__panes{height:calc(100vh - 48px);display:flex;overflow:auto}.blocks-app .email-pane__panes-resizer{z-index:2;position:relative}.blocks-app .email-pane__panes-resizer:before{content:"";background-color:#0000;border-left:2px solid #0000;width:10px;height:100%;transition:border-color .2s;position:absolute;inset:0}.blocks-app .email-pane__panes-resizer:hover{cursor:col-resize}.blocks-app .email-pane__panes-resizer:hover:before{border-color:var(--em-colorPrimary)}.blocks-app .email-pane__footer{z-index:2;border-top:1px solid #d9d9d9;height:28px;display:none;position:relative}.blocks-app .email-pane:not(.email-pane_view) .email-pane__pane-content{height:100%;position:absolute;inset:0;overflow:hidden}.blocks-app .email-pane__pane_main .email-pane:not(.email-pane_view) .email-pane__pane-content{overflow:auto}.blocks-app .email-pane:not(.email-pane_view) .email-pane__pane-content .email-pane__pane_editor{height:100%;overflow:visible}.blocks-app .email-pane:not(.email-pane_view) .email-pane__pane-content .email-pane__pane_editor .email-pane__pane-content{height:100%}.blocks-app .email-pane__buttons{text-align:right}.blocks-app .email-pane__buttons .ant-space.ant-space-horizontal.ant-space-align-center{display:flex}.blocks-app .email-pane__buttons button{width:46px;height:24px;margin-left:8px;padding:0}.blocks-app .email-pane__iframe-scroll-bottom,.blocks-app .email-pane__iframe-scroll-top{z-index:10;width:100%;height:50px;display:none;position:sticky;left:0;right:0}.blocks-app .email-pane__iframe-scroll-top{margin-bottom:-50px;top:0}.blocks-app .email-pane__iframe-scroll-bottom{margin-top:-50px;bottom:0}.blocks-app .email-pane__list{border:none;line-height:20px}.blocks-app .email-pane__list.ant-menu-horizontal>.ant-menu-item{padding:0 14px}.blocks-app .email-pane__list.ant-menu-horizontal>.ant-menu-item:after{content:none}.blocks-app .email-pane__list-item_active{color:var(--em-colorPrimaryTextHover)}.blocks-app .ant-menu-item .email-pane__list-item-icon.anticon{font-size:20px}.blocks-app .email-pane__list-item:hover .email-pane__list-item-icon.anticon,.blocks-app .email-pane__list-item_active.ant-menu-item .email-pane__list-item-icon.anticon{color:var(--em-colorPrimaryTextHover)}.blocks-app .email-pane__list-item.ant-menu-item.ant-menu-item-selected,.blocks-app .email-pane__list-item.ant-menu-item-disabled:hover .email-pane__list-item-icon.anticon{color:inherit}.blocks-app .email-pane__content-col.email-pane__content-col_menu{min-width:462px;margin-left:0}.blocks-app .email-pane__content-col_menu-left{margin-right:10px}.blocks-app .email-pane__code-mode{margin-top:10px;display:flex}.blocks-app .email-pane__code-mode .email-pane__panes{width:100%}.blocks-app .email-pane__code-mode .email-pane__panes+.email-pane__content-col.email-pane__content-col_menu,.blocks-app .email-pane__code-mode .email-pane__content-col.email-pane__content-col_menu:not(.email-pane__content-col_menu-right){width:60px;min-width:60px;margin-top:5px;margin-left:10px;margin-right:10px}.blocks-app .email-pane__code-mode .email-pane__content-col.email-pane__content-col_menu.email-pane__content-col_menu-right{width:50px;min-width:50px;margin-top:5px;margin-left:10px;margin-right:10px}.blocks-app .email-pane__col_code-mode{top:0}.blocks-app .email-pane__comments-icon-wrapper{text-align:center;cursor:pointer;width:50px;height:60px;margin-right:5px;padding:13px 21px;position:relative}.blocks-app .email-pane__comments-icon-wrapper:hover{color:#999da0}.blocks-app .email-pane__comment-counter{color:#000000d9;width:auto;min-width:28px;height:18px;text-shadow:none;border:1px solid #fff;border-radius:10px;margin:5px;padding:0 6px;font-size:12px;position:absolute;top:-8px;right:-10px}.blocks-app body.dark .email-pane__comment-counter{color:#f0f0f0;border-color:#1f1f1f}.blocks-app .email-pane__col-wrapper_pinch .email-pane__comment-counter{right:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tabpane,.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab{padding-left:0}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab{padding-right:0}.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-top:0}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{z-index:1;margin-top:0}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab .ant-tabs-tab-btn{background:0 0;border-radius:6px;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{background:var(--em-controlItemBgActive)}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-list .ant-tabs-ink-bar{box-sizing:border-box;background:#fff;border:none;border-radius:6px;width:60px;margin:0 2px;display:none;box-shadow:0 2px 8px -2px #0000000d,0 1px 4px -1px #00000012,0 0 1px #00000014}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder{border-left:none;width:397px;margin-left:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder .ant-tabs-content>.ant-tabs-tabpane{padding-left:0;padding-right:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:first-child{display:none}.blocks-app .email-pane .ant-tabs-left>.ant-tabs-nav .ant-tabs-tab,.blocks-app .email-pane .ant-tabs-right>.ant-tabs-nav .ant-tabs-tab{border:none;height:56px;padding:4px 4px 0}.blocks-app .email-pane .ant-tabs-tab .anticon{margin-right:0;font-size:20px}.blocks-app .email-pane__code-mode:not(.email-pane__col_preview-collapsed){padding-left:60px}.blocks-app .email-pane__content-col_tabs.email-pane__content-col{margin-left:0;margin-right:0;transition:all .3s cubic-bezier(.075,.82,.165,1);top:30px}@media (width<=1350px){.blocks-app .email-pane__content-col_tabs.email-pane__content-col{transform-origin:0 0;transform:scale(.83)}}.blocks-app .email-pane__col-wrapper_pinch .email-pane__content-col_tabs.email-pane__content-col{margin-top:0;top:0;height:100%!important}.blocks-app .email-pane .email-pane__col-wrapper_pinch .blocks-search__empty-wrapper{height:calc(100% - 30px)}.blocks-app .email-pane__col_preview-collapsed{margin-left:70px}.blocks-app .email-pane .email-pane__content-col_main{border:1px solid var(--em-colorBorder);border-radius:calc(var(--em-borderRadiusXL) * 1px);margin-left:-2px;margin-right:-2px;transition:border-color .4s;overflow:hidden auto}.blocks-app .email-pane .secondary-tabs.secondary-tabs_unset_scroll .ant-tabs-nav:after{display:none}.blocks-app .email-pane .secondary-tabs.secondary-tabs_unset_scroll .ant-tabs-content{overflow-y:hidden;padding-top:0!important;padding-right:24px!important}.blocks-app .email-pane__col.email-pane__col_preview{flex-direction:column;justify-content:flex-start;align-items:center;max-width:1600px;margin:0;padding:0 2px;display:flex}.blocks-app .email-pane__sizes{border:1px solid var(--em-colorBorder);z-index:10;opacity:.9;border-top:none;border-radius:0 0 8px 8px;justify-content:center;width:100%;height:15px;min-height:15px;margin-bottom:15px;transition:all .5s;display:flex;position:sticky;top:0;left:0}.blocks-app .email-pane__sizes:hover{opacity:1}.blocks-app .email-pane_code-mode .email-pane__row:not(.email-pane__bottom) .email-pane__sizes{border-width:0;height:0;min-height:0;margin-bottom:0}.blocks-app .email-pane__sizes .email-pane__width-selectors-wrapper{justify-content:center;width:100%;display:flex}.blocks-app .email-pane__sizes .device-width__theme{border-right:1px solid var(--em-colorBorder);background-color:var(--em-colorBgElevated);flex-shrink:0;width:36px;transition:all .3s;position:relative}.blocks-app .email-pane__sizes .device-width__theme .email-pane__theme-toggle{margin:0}.blocks-app .email-pane__sizes .device-width__theme-placeholder{flex-shrink:0;width:36px;cursor:default!important}.blocks-app .email-pane__sizes [class^=device-width__]{border-right:1px solid var(--em-colorBorder);background-color:var(--em-colorBgElevated);cursor:pointer;transition:all .3s;position:relative}.blocks-app .email-pane__sizes [class^=device-width__]:first-child{border-bottom-left-radius:calc(var(--em-borderRadius) * 1px)}.blocks-app .email-pane__sizes [class^=device-width__]:last-child{border-bottom-right-radius:calc(var(--em-borderRadius) * 1px);border:none}.blocks-app .ant-app .email-pane__sizes [class^=device-width__] button{color:var(--em-colorTextDescription);width:24px;min-width:24px;height:24px;line-height:1}.blocks-app .ant-app .email-pane__sizes [class^=device-width__] button:hover{background:var(--em-colorPrimaryBg)}.blocks-app .email-pane__sizes .device-width__320{text-align:center;color:var(--em-colorText);font-size:12px;line-height:15px}.blocks-app .email-pane__sizes.device-width__full-hovered [class^=device-width__],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__768],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__425],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__375],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__320],.blocks-app .email-pane__sizes.device-width__425-hovered [class*=__425],.blocks-app .email-pane__sizes.device-width__425-hovered [class*=__375],.blocks-app .email-pane__sizes.device-width__425-hovered [class*=__320],.blocks-app .email-pane__sizes.device-width__375-hovered [class*=__375],.blocks-app .email-pane__sizes.device-width__375-hovered [class*=__320],.blocks-app .email-pane__sizes.device-width__320-hovered [class*=__320]{background:var(--em-colorPrimaryBg)}.blocks-app .email-pane__resizable{width:100%;margin-bottom:29px;transition:max-width .5s;position:relative}.blocks-app .blocks-plugin .email-pane__resizable{padding:0 2px}.blocks-app .email-pane__resizable_drag{transition:none}.blocks-app .email-pane__resizable .email-pane__handle{z-index:1;box-sizing:border-box;opacity:0;cursor:ew-resize;width:5px;height:100%;transition:opacity .4s;position:absolute}.blocks-app .email-pane_code-mode .email-pane__row:not(.email-pane__bottom) .email-pane__resizable .email-pane__handle{pointer-events:none}.blocks-app .email-pane__resizable .email-pane__handle:hover,.blocks-app .email-pane__resizable .email-pane__handle:active{opacity:1}.blocks-app .email-pane__resizable .email-pane__handle.left{left:0}.blocks-app .email-pane__resizable .email-pane__handle.right{right:0}.blocks-app .email-pane__left .email-pane__resizable,.blocks-app .email-pane__right .email-pane__resizable{margin-bottom:0}.blocks-app .email-pane__tooltip{margin-right:20px}.blocks-app .email-pane .ant-layout-content.container.email-pane__container{padding-bottom:0}.blocks-app .email-pane .ant-tabs-tabpane.ant-tabs-tabpane-active.em-analytics__email-tab-build{border-top-left-radius:0}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-nav-list{padding-left:24px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-nav{margin-bottom:0}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-tab .ant-tabs-tab-btn{font-size:14px;font-weight:400}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-tab+.ant-tabs-tab{margin:0 0 0 20px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-content{padding:24px 13px 4px 24px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs.secondary-tabs_optimise .ant-tabs-content{padding:0 25px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs.email-properties__collapse .ant-tabs-content{padding-bottom:0}.blocks-app .email-pane.email-pane_no-element-navigation .ant-tabs-large.secondary-tabs.email-properties__collapse .ant-tabs-content{padding-top:0}.blocks-app .email-pane .email-properties__collapse{position:relative}.blocks-app .email-pane .email-properties__collapse:after{content:"";background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);border-top:1px solid var(--em-colorBorderSecondary);z-index:1;width:100%;height:20px;position:absolute;top:58px;left:0}.dark .blocks-app .email-pane .email-properties__collapse:after{background:linear-gradient(180deg, var(--em-colorBgBase) -100%, transparent 50%)}.blocks-app .email-pane .ant-tooltip{pointer-events:none}.blocks-app .email-pane__blocks-search{overflow-clip-margin:40px;flex-direction:column;height:calc(100% - 44px);min-height:0;display:flex;overflow:clip}.blocks-app .email-pane__blocks-search label.ant-segmented-item{margin-top:0}.blocks-app .email-pane__blocks-panel,.blocks-app .email-pane__blocks-panel-body{height:100%}.blocks-app .email-pane__blocks-panel-header{flex-shrink:0}.blocks-app .email-pane__blocks-panel-results{display:none}.blocks-app .email-pane__blocks-panel-results_visible{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__blocks-panel_scrollable,.blocks-app .email-pane__blocks-panel_scrollable{overflow-clip-margin:40px;flex-direction:column;flex:1;min-height:0;display:flex;overflow:clip}.blocks-app .email-pane__blocks-panel_scrollable .email-pane__blocks-panel-body{flex-direction:column;flex:1;min-height:0;margin-left:-24px;margin-right:-24px;display:flex;overflow:hidden}.blocks-app .email-pane__blocks-panel_scrollable .blocks-search__empty-shadow{padding-left:24px;padding-right:24px}.blocks-app .email-pane .email-pane__blocks-search .ant-segmented{position:relative;top:-7px}@media screen and (width<=700px){.blocks-app .email-pane_view .email-pane__buttons{display:none}.blocks-app .email-pane__content{margin:0;padding-right:0}.blocks-app .email-pane__content .email-pane__content-col_main{min-width:100%}.blocks-app .email-pane__content .email-pane__content-col_menu{display:none}.blocks-app .email-pane__content .email-pane__content-col_menu+.email-pane__resizer{border-left:none;border-right:2px solid #0000}.blocks-app .email-pane__content .email-pane__content-col_menu+.email-pane__resizer:hover{border-color:var(--em-colorPrimary)}}.blocks-app .ant-menu-vertical.element-preview-menu__list_discuss li.ant-menu-item{text-align:right;padding:0 10px}.blocks-app .ant-tooltip{pointer-events:none}@media (width<=1550px){.blocks-app .email-pane .ant-tabs .secondary-tabs.email-pane__collapse:not(.secondary-tabs_unset_scroll):after{margin-top:44px}}.dark .blocks-app .email-pane .ant-tabs .blocks-search__empty-shadow:after{background:linear-gradient(180deg, var(--em-colorBgBase) -100%, transparent 50%)}.dark .blocks-app .ant-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode{background-color:#121212}.blocks-app .collaborator-list{position:absolute;bottom:30px}.blocks-app .ant-app .email-pane__col-wrapper_pinch .ant-switch.ant-switch_editor-mode{width:48px}.blocks-app .ant-app .email-pane__col-wrapper_pinch .ant-switch.ant-switch_editor-mode.ant-switch-checked{background:var(--em-controlItemBgActive)}.blocks-app .ant-app .email-pane__col-wrapper_pinch .ant-switch.ant-switch_editor-mode.ant-switch-checked .ant-switch-inner-checked{color:var(--em-colorPrimary)}.em-scaled-layout .email-pane__collapse-wrapper>.email-pane__collapse>.ant-tabs-content-holder{scrollbar-width:none;overflow-y:auto}.em-scaled-layout .email-pane__collapse-wrapper>.email-pane__collapse>.ant-tabs-content-holder::-webkit-scrollbar{display:none}.blocks-app .email-preview-menu__versions .ant-btn,.blocks-app .email-preview-menu__code .ant-btn,.blocks-app .email-preview-menu__preview .ant-btn,.blocks-app .email-preview-menu__test{justify-content:center;align-items:center;display:inline-flex}.blocks-app .email-preview-menu__list-item-icon{align-items:center;display:inline-flex}.blocks-app .email-preview-menu_right{margin-left:auto}.blocks-app .email-preview-menu_new{align-items:center;padding-right:22px;display:flex}.blocks-app .email-preview-menu .email-preview-menu__history *{pointer-events:none}.blocks-app .ant-menu.email-preview-menu__list{border:0}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item{margin-top:0;padding:0 10px}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item_disabled{cursor:not-allowed}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item:hover .ant-menu-item.email-preview-menu__list-item_disabled .anticon.email-preview-menu__list-item-icon{color:inherit}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item a{width:40px;height:40px;margin-left:-10px;display:block}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item a .email-preview-menu__list-item-icon{margin-left:10px}.blocks-app .ant-menu-item .anticon.email-preview-menu__list-item-icon{font-size:20px}.blocks-app .ant-menu-item .anticon.email-preview-menu__list-item-icon_revert{transform:scaleX(-1)}.blocks-app .email-preview-menu__list-item:hover .anticon.email-preview-menu__list-item-icon,.blocks-app .ant-menu-item.email-preview-menu__list-item_active .anticon.email-preview-menu__list-item-icon{color:var(--em-colorPrimaryHover)}.blocks-app .ant-menu-item.ant-menu-item-selected.email-preview-menu__list-item,.blocks-app .ant-menu-item-disabled.email-preview-menu__list-item:hover .anticon.email-preview-menu__list-item-icon{color:inherit}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons{cursor:default;text-align:center;height:auto;margin:0;padding:0}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons .ant-space{display:block}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons button{width:40px;height:40px;box-shadow:none;text-shadow:none;background:0 0;border:none;margin-bottom:8px;padding:0;display:block}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons button .anticon{font-size:20px;transition:color .3s}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons button .anticon :hover{color:var(--em-colorPrimaryHover)}.blocks-app .ant-menu-vertical .email-preview-menu__list__divider{border-top:2px solid var(--em-colorBorder);width:20px;min-width:auto;margin:20px 0}.blocks-app .ant-menu-vertical .email-preview-menu__list__divider.second-devider{margin-left:10px}.blocks-app .main__ribbon{background:var(--em-colorInfo);min-height:43px;color:var(--em-colorTextLightSolid);flex-direction:row;justify-content:center;align-items:center;font-size:16px;display:flex}.blocks-app .main__ribbon button{background:var(--em-colorInfoTextHover)}.blocks-app .main__ribbon button:hover{background:var(--em-colorInfoHover)!important}.blocks-app .main__ribbon .main__ribbon-resend.ant-btn.ant-btn-sm{padding-block:5px;padding-inline:14px}.blocks-app .header{box-sizing:content-box;border-bottom:1px solid;height:70px;min-height:70px}.blocks-app .header_blocks{padding-right:10px}.blocks-app .header_main{z-index:1}.blocks-app .header__container{justify-content:space-between;align-items:center;gap:30px;min-height:70px;transition:opacity .3s;display:flex}.blocks-app .header__logo,.blocks-app .header__project{white-space:nowrap;text-overflow:ellipsis;max-width:220px;display:block;overflow:hidden}.blocks-app .header__logo{padding-top:10px}.blocks-app .header h2,.blocks-app .header h3{margin:0}.blocks-app .header__right{max-height:40px}.blocks-app .header__right .header__action-btn.ant-btn{align-items:center;height:34px;min-height:34px;padding-block:0;display:inline-flex}.blocks-app .header__right .ant-space.ant-space-horizontal.ant-space-align-center{align-items:center;display:flex}.blocks-app .header__right,.blocks-app .header__left{display:flex}.blocks-app .header__left .ant-space,.blocks-app .header__left .ant-space .ant-space-item:last-child{flex-grow:1}.blocks-app .header .project-menu__list-item{cursor:pointer;transition:color .3s}.blocks-app .header .project-menu__list-item:hover{color:#40a9ff}.blocks-app .header .project-menu__list-item svg{width:1.2em;height:1.2em;vertical-align:inherit}.blocks-app .header .project-menu__list-item .anticon-bell svg{width:1.4em;height:1.4em}.blocks-app .header .ant-typography{margin-bottom:0}.blocks-app .foo-title{color:#fff;letter-spacing:1px;background:#9254de;border-radius:3px;margin-top:-10px;margin-left:-4px;padding:0 7px;font-size:13px;font-weight:500;position:absolute}',e=window.__emailmaker_styles__||(window.__emailmaker_styles__={sheets:{},order:[]}),t=p;if(!e.sheets[t]){var o=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(o=new CSSStyleSheet,o.replaceSync(p))}catch{o=null}if(o){if(!e.host||!e.host.isConnected||!e.host.sheet){var a=document.createElement("style");a.setAttribute("data-emailmaker","true"),document.head.appendChild(a),e.host=a}for(var n=e.host.sheet,l=0;l<o.cssRules.length;l++)try{n.insertRule(o.cssRules[l].cssText,n.cssRules.length)}catch{}(e.texts||(e.texts=[])).push(p),(e.listeners||[]).forEach(function(i){try{i(p)}catch{}})}else{var a=document.createElement("style");a.setAttribute("data-emailmaker","true"),a.appendChild(document.createTextNode(p)),document.head.appendChild(a)}e.sheets[t]=!0,e.order.push(t)}}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
6
|
+
__emailmaker__.define("static/core/c804e4dd.js",["require","exports","module","static/core/5dc34752.js","static/core/422c8b42.js","react","react/jsx-runtime","__delivery__/libs","react-dom","vite/preload-helper","classnames"],function(me,p,$q){const Q=me("./5dc34752.js"),C=me("./422c8b42.js");let b=me("react"),Z=Q.__toESM(b,1);b=Q.__toESM(b);let R=me("react/jsx-runtime"),B=me("__delivery__/libs"),Lt=me("react-dom");Lt=Q.__toESM(Lt);let ut=me("vite/preload-helper"),vt=me("classnames");vt=Q.__toESM(vt);var gc=class{capacity;items=[];constructor(e){this.capacity=e}push(e){this.items.length>=this.capacity&&this.items.shift(),this.items.push(e)}snapshot(){return this.items.slice()}size(){return this.items.length}clear(){this.items=[]}};function yc(e,t){return t+e}function Zv(){return typeof performance>"u"?Date.now():yc(performance.now(),performance.timeOrigin)}var eb="emailmaker:diagnostics",tb="diagnostics",ea;function rb(){try{const e=new URLSearchParams(window.location.search).get(tb);return e===null?void 0:e!=="0"}catch{return}}function nb(){const e=window.__DIAGNOSTICS__;return typeof e=="boolean"?e:void 0}function ib(){try{const e=window.localStorage.getItem(eb);return e===null?void 0:e==="1"}catch{return}}function _c(){return ea===void 0&&(ea=typeof window>"u"?!1:rb()??nb()??ib()??!1),ea}function vc(e){return`__${(e||"emailmaker").toLowerCase().replaceAll("-","")}__`}var dt={initStart:"loader:init:start",coreReady:"loader:core:ready",initEnd:"loader:init:end",chunksLoaded:"app:chunks:loaded",showStart:"show:start",showEnd:"show:end",canvasCreated:"canvas:created",canvasLoaded:"canvas:loaded",canvasPainted:"canvas:painted",appVisible:"app:visible",editorVisible:"editor:visible",canvasSettled:"canvas:settled"},ob="app:mount:headless";function bc(e){return e.some(t=>t.phase==="app:mount:headless")?"headless":"element"}var Ec=Object.values(dt),ab=[dt.canvasPainted,dt.canvasSettled,dt.appVisible,dt.editorVisible];function wc(e){return e==="headless"?Ec.filter(t=>!ab.includes(t)):Ec}function sb(e){const t=new Set(e.map(r=>r.phase));return wc(bc(e)).filter(r=>!t.has(r))}var lb=5e3,cb=3e3,Sc="diagnosticsStore",ai,Wr;function Pc(){return{marks:new gc(lb),resources:new gc(cb)}}function vr(){if(Wr)return Wr;const e=ta();return e?(Wr=e[Sc]??ai??Pc(),e[Sc]=Wr,ai=void 0,Wr):(ai??=Pc(),ai)}function ke(e,t){_c()&&vr().marks.push({phase:e,at:Zv(),...t})}function ub(){return Ic(),vr().marks.snapshot()}function db(){return vr().resources.snapshot()}function fb(){const e=vr();e.marks.clear(),e.resources.clear()}function ta(){if(typeof window.__emailmaker__<"u"&&window.__emailmaker__)return window.__emailmaker__;if(typeof window>"u")return;const e=window[vc()];return e!==null&&typeof e=="object"?e:void 0}function pb(e){const t=e.length,r=vr();return e.forEach(n=>r.marks.push(n)),e.length=0,t}function Ic(){const e=ta();return!e||!Array.isArray(e.diagnosticsBuffer)?0:pb(e.diagnosticsBuffer)}var qq="[show-pipeline]";function mb(e){return e instanceof Error?`${e.name}: ${e.message}`:typeof e=="string"?e:JSON.stringify(e)??"undefined"}function hb(e,t){}var Tc=class{_voidElements;constructor(e){this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},je=(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})({}),gb=class{source;len;position;constructor(e,t){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===Eb||e===wb||e===_b||e===bb||e===vb)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},Cc=33,br=45,Kr=60,nt=62,si=47,yb=61,Oc=34,Ac=39,_b=10,vb=13,bb=12,Eb=32,wb=9,Mc="(?=[\\s/>])",Sb=new RegExp(`<!--|-->|<\\/?script${Mc}\\s*\\/?>?`,"i"),Pb=new RegExp(`<\\/style${Mc}`,"i"),Ib={"text/x-handlebars-template":!0,"text/html":!0};function Tb(e,t=0,r=0,n=!1){const i=new gb(e,t);let o=r,a=0,s=18,c,l,u=!1,d,f,m;function g(){return i.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function h(){const y=i.pos();for(;!i.eos();){const I=i.nextChar();if(I===nt)return!0;if(I===Kr)break;if(I===Oc||I===Ac){if(!i.advanceUntilChar(I))break;i.advance(1)}}return i.goBackTo(y),!1}function E(){return i.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function S(y,I,_){return s=I,a=y,c=_,I}function T(){const y=i.pos(),I=o,_=w();return _!==21&&y===i.pos()&&!(n&&(_===4||_===8))?(i.advance(1),S(y,18)):_}function w(){const y=i.pos();if(i.eos())return S(y,21);let I;switch(o){case 6:return i.advanceIfChars([br,br,nt])?(o=0,S(y,2)):(i.advanceUntilChars([br,br,nt]),S(y,1));case 3:return i.advanceIfChar(nt)?(o=0,S(y,15)):(i.advanceUntilChar(nt),S(y,14));case 0:if(i.advanceIfChar(Kr)){if(!i.eos()&&i.peekChar()===Cc){if(i.advanceIfChars([Cc,br,br]))return o=6,S(y,0);if(i.advanceIfRegExp(/^!doctype/i))return o=3,S(y,13)}return i.advanceIfChar(si)?(o=2,S(y,7)):(o=1,S(y,3))}return i.advanceUntilChar(Kr),S(y,16);case 2:return g().length>0?(o=5,u=!1,S(y,9)):i.skipWhitespace()?S(y,17,"Tag name must directly follow the open bracket."):(o=5,i.advanceUntilChar(nt),y<i.pos()?S(y,18,"End tag name expected."):w());case 5:if(i.skipWhitespace())return u=!0,S(y,17);if(i.advanceIfChar(nt))return o=0,S(y,8);if(n&&i.peekChar()===Kr)return o=0,S(y,8,"Closing bracket missing.");if((u||i.peekChar()===si)&&h())return o=0,S(y,8);I="Closing bracket expected.";break;case 1:return d=g(),m=void 0,f=void 0,d.length>0?(l=!1,o=4,S(y,6)):i.skipWhitespace()?S(y,17,"Tag name must directly follow the open bracket."):(o=4,i.advanceUntilChar(nt),y<i.pos()?S(y,18,"Start tag name expected."):w());case 4:return i.skipWhitespace()?(l=!0,S(y,17)):l&&(f=E(),f.length>0)?(o=9,l=!1,S(y,11)):i.advanceIfChars([si,nt])?(o=0,S(y,5)):i.advanceIfChar(nt)?(d==="script"?m&&Ib[m]?o=0:o=7:d==="style"?o=8:o=0,S(y,4)):n&&i.peekChar()===Kr?(o=0,S(y,4,"Closing bracket missing.")):(i.advance(1),S(y,18,"Unexpected character in tag."));case 9:return i.skipWhitespace()?(l=!0,S(y,17)):i.advanceIfChar(yb)?(o=10,S(y,10)):(o=4,w());case 10:if(i.skipWhitespace())return S(y,17);let _=i.advanceIfRegExp(/^[^\s"'`=<>]+/);if(_.length>0)return i.peekChar()===nt&&i.peekChar(-1)===si&&(i.goBack(1),_=_.substr(0,_.length-1)),f==="type"&&(m=_),o=4,l=!1,S(y,12);const P=i.peekChar();return P===Ac||P===Oc?(i.advance(1),i.advanceUntilChar(P)&&i.advance(1),f==="type"&&(m=i.getSource().substring(y+1,i.pos()-1)),o=4,l=!1,S(y,12)):(o=4,l=!1,w());case 7:let v=1;for(;!i.eos();){const M=i.advanceIfRegExp(Sb);if(M.length===0)return i.goToEnd(),S(y,19);if(M==="<!--")v===1&&(v=2);else if(M==="-->")v=1;else if(M[1]!=="/")v===2&&(v=3);else if(v===3)v=2;else{i.goBack(M.length);break}}return o=0,y<i.pos()?S(y,19):w();case 8:return i.advanceUntilRegExp(Pb),o=0,y<i.pos()?S(y,20):w()}return i.advance(1),o=0,S(y,18,I)}return{scan:T,getTokenType:()=>s,getTokenOffset:()=>a,getTokenLength:()=>i.pos()-a,getTokenEnd:()=>i.pos(),getTokenText:()=>i.getSource().substring(a,i.pos()),getScannerState:()=>o,getTokenError:()=>c}}var Cb=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function Ob(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,r)=>r.toUpperCase())}var kc=Object.create(null);function Ab(e,t){const r=kc[e]||(kc[e]=Object.create(null));let n=r[t];if(typeof n!="boolean"){const i=document.createElement(e)[Ob(t)];n=r[t]=typeof i<"u"&&typeof i!="boolean"}return n}function Mb(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 a=n[o]===null?"":n[o];typeof a=="string"&&(r+=a===""&&o!=="em"&&!Ab(t,o)?` ${o}`:` ${o}="${a.replaceAll('"',"'")}"`)}}}return r}function kb(e,t){if(e.start!==e.startTagEnd||t){const r=e.tag?.toLowerCase()||"div",n=Mb(e);return r==="vk-snippet-end"?`<${r}${n}/>`:`<${r}${n}>`}return""}function jc(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 ge=(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})({}),li=e=>e.type===0?e.start-1:e.start,jb=e=>e.type===0?e.end+1:e.end,Ft=class Wv{start;end;children;parent;content;type=1;tag;closed=!1;startTagEnd;endTagStart;attributes;get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}createdBy;isDirty;get root(){return this.parent?this.parent.root:this}constructor(t,r,n,i){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=jc(this.children,n=>t<=li(n))-1;if(r>=0){const n=this.children[r];if(t>li(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=jc(this.children,n=>t<=li(n))-1;if(r>=0){const n=this.children[r];if(t>=li(n)&&t<=jb(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 Wv(r,this.end-i,[],t);return o.children=n?this.children.map(a=>a.clone(o,a.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 Rc=class{text;type;node=void 0;replaces=void 0;constructor(e,t){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 Ft(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 a=o.parent;if(!a)throw new Error("parent not defined");const s=a.children.indexOf(o);a.children.splice(s,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}}},Nc=class{dataManager;constructor(e){this.dataManager=e}parse(e,t=[]){const r=Tb(e,void 0,void 0,!0),n=new Ft(0,e.length,[],void 0);n.type=ge.ROOT;let i=n,o=-1,a,s=null,c=r.scan();const l=()=>{if(!i.tag){const g=i.parent.children,h=g[g.length-2],E=e.substring(i.start,i.end);h?.type===ge.HTML?(h.content=(h.content||"")+E,h.end=i.end,g.splice(g.length-1,1)):(i.type=ge.HTML,i.content=E,i.children=[]),i.type=ge.HTML}i=i.parent},u=new Rc(e,ge.COMMENT),d=new Rc(e,ge.DOCTYPE),f=g=>{i.children.push(g)};for(;c!==je.EOS;){switch(c){case je.StartDoctypeTag:d.start(r.getTokenOffset(),r.getTokenEnd(),i);break;case je.EndDoctypeTag:{const T=i.lastChild,w=d.node;if(!w)throw new Error("");const y=T?T.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(y!==w.start){const I=e.substring(y,w.start);if(I){const _=new Ft(y,w.start,[],i);_.type=ge.HTML,_.content=I,f(_)}}d.finish(r.getTokenOffset(),r.getTokenLength());break}case je.StartCommentTag:u.start(r.getTokenOffset(),r.getTokenEnd(),i);break;case je.EndCommentTag:{const T=i.lastChild,w=u.node;if(!w)throw new Error("");const y=T?T.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(y!==w.start){const I=e.substring(y,w.start);if(I){const _=new Ft(y,w.start,[],i);_.type=ge.HTML,_.content=I,f(_)}}u.finish(r.getTokenOffset(),r.getTokenLength());break}case je.StartTagOpen:const g=i.lastChild,h=new Ft(r.getTokenOffset(),e.length,[],i),E=g?g.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(E!==h.start){const T=e.substring(E,h.start);if(T){const w=new Ft(E,h.start,[],i);w.type=ge.HTML,w.content=T,f(w)}}f(h),i=h;break;case je.StartTag:i.tag=r.getTokenText();break;case je.StartTagClose:i.parent&&(i.end=r.getTokenEnd(),r.getTokenLength()?(i.startTagEnd=r.getTokenEnd(),i.tag&&this.dataManager.isVoidElement(i.tag)&&(i.closed=!0,l())):l());break;case je.StartTagSelfClose:i.parent&&(i.closed=!0,i.end=r.getTokenEnd(),i.startTagEnd=r.getTokenEnd(),l());break;case je.EndTagOpen:o=r.getTokenOffset(),a=void 0;break;case je.EndTag:a=r.getTokenText().toLowerCase();break;case je.EndTagClose:let S=i;for(;!S.isSameTag(a)&&S.parent;)S=S.parent;if(S.parent){const T=i.lastChild,w=T?T.end:i.startTagEnd===void 0?i.start:i.startTagEnd;if(w!==o){const y=e.substring(w,o);if(y){const I=new Ft(w,o,[],i);I.type=ge.HTML,I.content=y,f(I)}}for(;i!==S;)i.end=o,i.closed=!1,l();i.closed=!0,i.endTagStart=o,i.end=r.getTokenEnd(),l()}break;case je.AttributeName:{s=r.getTokenText();let T=i.attributes;T||(i.attributes=T={}),T[s]=null;break}case je.AttributeValue:{const T=r.getTokenText(),w=i.attributes;w&&s&&(w[s]=Rb(T),s=null);break}}c=r.scan()}for(;i.parent;)i.end=e.length,i.closed=!1,l();u.hasNode,u.finish(e.length);const m=n.lastChild?.end||0;if(m<e.length){const g=e.substring(m);if(g){const h=new Ft(m,e.length,[],n);h.type=ge.HTML,h.content=g,f(h)}}return{roots:n.children,findNodeBefore:n.findNodeBefore.bind(n),findNodeAt:n.findNodeAt.bind(n)}}},zq=new Nc(new Tc(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),Nb=new Tc(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),Db=new Nc(Nb);function Lb(e){return Db.parse(e)}function Dc(e){if(e){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",e),t.firstChild||document.createTextNode("")}else return document.createTextNode("")}var Fb=new Set(["text/x-handlebars-template","text/html"]);function xb(e,t){if(e.type!==ge.HTML||!t)return!1;const r=t.tag?.toLowerCase(),n=t.attributes?.type;return r==="style"||r==="script"&&!Fb.has(typeof n=="string"?n:"")}var Ub={amp:"&",lt:"<",gt:">",nbsp:String.fromCodePoint(160),quot:'"'};function Lc(e){return e.replaceAll(/&(amp|lt|gt|nbsp|quot);/g,(t,r)=>Ub[r])}var Fc=Symbol("rawTextSource");function Bb(e){const t=document.createTextNode(Lc(e));return $b(t,e),t}function $b(e,t){Object.defineProperty(e,Fc,{value:t,configurable:!0})}function qb(e){const t=e[Fc];return t!==void 0&&Lc(t)===e.textContent?t:void 0}var xc;function zb(e,t,r){return xc?xc(e,t,r):r}var ra;function Gb(){return ra||(ra=document.implementation.createHTMLDocument("")),ra}function Hb(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 Vb=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),Wb=new Set(["script","style","xmp"]);function Kb(e,t){return!(t&&Wb.has(t.toLowerCase())||Vb.has(e.toLowerCase()))}var Qb=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1},Yb=new Set(["head","body"]);function Uc(e,t,r){let n=e.tagName.toLowerCase();n==="html"&&(n="div");const i=`<${n} ${t}="${r}"/>`,o=Gb(),a=Yb.has(n)?Hb(o,n):o.createElement("template");if(a instanceof Document)return;a.innerHTML=i;const s=(a.tagName==="TEMPLATE"?a.content:a).querySelector(n);if(!s)throw new Error("targetElement is not defined");const c=s.getAttributeNode(t);c&&e.setAttributeNode(c.cloneNode())}function Bc(e,t,r){try{Kb(t,e.tagName)&&!Qb(r)?e.setAttribute(t,r):Uc(e,t,r)}catch{Uc(e,t,r)}}function Xb(){return Dc("<script><\/script>")}var Jb="text/x-em-dormant",Zb=Symbol("dormantScriptType");function eE(e){e[Zb]=e.getAttribute("type"),e.setAttribute("type",Jb)}function na(e,t=!0,r=!1){const n=e.content;switch(e.type){case ge.ROOT:{const i=document.implementation.createHTMLDocument();for(const o of[...i.childNodes])i.removeChild(o);if(t)for(const o of e.children)i.appendChild(na(o,!0,r));return i}case ge.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case ge.COMMENT:return document.createComment(n||"");case ge.ELEMENT:if(e.tag){const i=e.tag.toLowerCase()==="script",o=r===!0&&i?Xb():document.createElement(e.tag);if(Object.defineProperty(o,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const a of e.attributeNames){const s=e.attributes[a];try{const c=zb(o,a,typeof s=="string"?s:"");c!==null&&Bc(o,a,c)}catch{}}if(r==="dormant"&&i&&eE(o),t){const a=e.tag.toLowerCase()==="template"?!0:r;for(const s of e.children)o.appendChild(xb(s,e)?Bb(s.content||""):na(s,!0,a))}return o}return document.createTextNode("<");case ge.HTML:return Dc(n||"");default:throw new Error("unsupported node")}}function $c(e,t=!1){return Lb(e).roots.map(r=>na(r,!0,t))}function tE(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,r)=>r.toUpperCase())}function qc(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var zc=Object.create(null);function rE(e,t){const r=zc[e]||(zc[e]=Object.create(null));let n=r[t];if(typeof n!="boolean"){const i=document.createElement(e)[tE(t)];n=r[t]=typeof i<"u"&&typeof i!="boolean"}return n}function ci(e){return e.nodeType===Node.ELEMENT_NODE}function nE(e){return ci(e)&&!e.ownerSVGElement}function iE(e){return e.tagName==="IMG"}function oE(e){return e.tagName==="AMP-IMG"}function aE(e){return e.tagName==="BODY"}function sE(e){return e.tagName==="FORM"}function lE(e){return e.tagName==="HTML"}function cE(e){return e.tagName==="SCRIPT"}function Gc(e){return e.tagName==="STYLE"}function Hc(e){return e.nodeType===Node.DOCUMENT_NODE}function uE(e){return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function dE(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var ia;(function(e){function t(f){return f.constructor.name==="CSSStyleRule"}e.isStyleRule=t;function r(f){return f.constructor.name==="CSSImportRule"}e.isImportRule=r;function n(f){return f.constructor.name==="CSSMediaRule"}e.isMediaRule=n;function i(f){return f.constructor.name==="CSSFontFaceRule"}e.isFontFaceRule=i;function o(f){return f.constructor.name==="CSSPageRule"}e.isPageRule=o;function a(f){return f.constructor.name==="CSSKeyframesRule"}e.isKeyframesRule=a;function s(f){return f.constructor.name==="CSSKeyframeRule"}e.isKeyframeRuleRule=s;function c(f){return f.constructor.name==="CSSNamespaceRule"}e.isNamespaceRule=c;function l(f){return f.constructor.name==="CSSCounterStyleRule"}e.isCounterStyleRule=l;function u(f){return f.constructor.name==="CSSSupportsRule"}e.isSupportsRule=u;function d(f){return f.constructor.name==="CSSFontFeatureValuesRule"}e.isFontFeatureValuesRuleRule=d})(ia||(ia={}));function oa(e){return e.nodeType===Node.COMMENT_NODE}function fE(e){return e&&!!e.host&&!!e.mode}function aa(e){const t=e.getRootNode()||window.document;return fE(t)?t:null}var pE=/(<!(--)?\[if\s[()\w\s|&!]+\]>(?:<!--+>)?)((?:.|\r|\n)*?)((?:<!--)?<!\[endif\]\2>)/gi;function mE(e){const t=Qr(e).matchAll(pE);if(t)for(const r of t){const[,n,,i,o]=r;return{open:n,close:o,content:i}}}function sa(e){return e.nodeType===Node.TEXT_NODE}function hE(e){return e.tagName==="TABLE"}async function gE(e,t=5e3){return typeof e.complete<"u"&&!e.complete?new Promise((r,n)=>{setTimeout(r,t),e.onload=()=>r(getComputedStyle(e)),e.onerror=i=>{}}):getComputedStyle(e)}function Qr(e){if(ci(e))return _E(e);if(Hc(e))return[...e.childNodes].map(r=>Qr(r)).join("");if(dE(e))return qc(e);const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function yE(e){const t=e.tagName.toLowerCase();let r="";for(const n of e.attributes){const i=n.name,o=n.value;r+=o===""&&i!=="em"&&!rE(t,i)?` ${i}`:` ${i}="${o.replaceAll('"',"'")}"`}return r}function Vc(e){let t="";for(const r of e.childNodes)t+=qb(r)??Qr(r);return t}function _E(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),r=yE(e);return Cb.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${r}/>`:`<${t}${r}>`:Gc(e)?`<${t}${r}>${e.innerHTML}</${t}>`:`<${t}${r}>${Vc(e)}</${t}>`}function Wc(e,t){for(const o of[...e.childNodes])o.remove();let r=t.find(o=>lE(o)),n=t.find(o=>aE(o)),i=e;r||(r=document.createElement("html"),e.appendChild(r),i=r,n||(n=document.createElement("body"),r.appendChild(n),i=n));for(const o of t){if(i===e){if(sa(o)){i.appendChild(document.createComment(`%%%{{{${o.data}}}}%%%`));continue}if(ci(o)&&o!==r){(r.querySelector("body")??r).appendChild(o);continue}}i.appendChild(o)}}function la(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,a=t;return o.length===a.length&&o.every((s,c)=>la(s,a[c]))}const n=Object.keys(e),i=Object.keys(t);return n.length!==i.length?!1:n.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&la(e[o],t[o]))}function Kc(e,t){const r={watch(n){let i,o=!1;return e.watch(a=>{const s=t(a);o&&la(i,s)||(i=s,o=!0,n(s))})},select(n){return Kc(r,n)}};return r}function it(...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 a of Array.from(n))a(o)},watch(o){return n.add(o),r&&o(t),{dispose:()=>n.delete(o)}},select(o){return Kc(i,o)}};return i}var Qc=C.createIdentifier$1("HeadlessMode");function ui(e){return e.getOrCreateInstance(Qc,()=>it(!1))}function Yc(e){return e?.getInstance(Qc)?.get()??!1}function vE(e,t){ui(e).set(t)}var bE=C.createIdentifier$1("HiddenMount");function EE(e){return e.getOrCreateInstance(bE,()=>it(!1))}function wE(e,t){EE(e).set(t)}var SE=Q.__commonJSMin(((e,t)=>{var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r})),PE=Q.__commonJSMin(((e,t)=>{var r=SE();function n(){}function i(){}i.resetWarningCache=n,t.exports=function(){function o(c,l,u,d,f,m){if(m!==r){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}o.isRequired=o;function a(){return o}var s={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:a,element:o,elementType:o,instanceOf:a,node:o,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:i,resetWarningCache:n};return s.PropTypes=s,s}})),Xc=Q.__commonJSMin(((e,t)=>{t.exports=PE()()})),xt=b.default.createContext(null);function IE(e){e()}var Jc=IE,TE=function(t){return Jc=t},CE=function(){return Jc},Zc={notify:function(){}};function OE(){var e=CE(),t=null,r=null;return{clear:function(){t=null,r=null},notify:function(){e(function(){for(var i=t;i;)i.callback(),i=i.next})},get:function(){for(var i=[],o=t;o;)i.push(o),o=o.next;return i},subscribe:function(i){var o=!0,a=r={callback:i,next:null,prev:r};return a.prev?a.prev.next=a:t=a,function(){!o||t===null||(o=!1,a.next?a.next.prev=a.prev:r=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}var eu=(function(){function e(r,n){this.store=r,this.parentSub=n,this.unsubscribe=null,this.listeners=Zc,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(n){return this.trySubscribe(),this.listeners.subscribe(n)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return!!this.unsubscribe},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=OE())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=Zc)},e})(),ca=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?b.useLayoutEffect:b.useEffect;function AE(e){var t=e.store,r=e.context,n=e.children,i=(0,b.useMemo)(function(){var s=new eu(t);return s.onStateChange=s.notifyNestedSubs,{store:t,subscription:s}},[t]),o=(0,b.useMemo)(function(){return t.getState()},[t]);ca(function(){var s=i.subscription;return s.trySubscribe(),o!==t.getState()&&s.notifyNestedSubs(),function(){s.tryUnsubscribe(),s.onStateChange=null}},[i,o]);var a=r||xt;return b.default.createElement(a.Provider,{value:i},n)}function di(){return di=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},di.apply(null,arguments)}function ua(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var ME=Q.__commonJSMin((e=>{var t=typeof Symbol=="function"&&Symbol.for,r=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,i=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,a=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,m=t?Symbol.for("react.suspense_list"):60120,g=t?Symbol.for("react.memo"):60115,h=t?Symbol.for("react.lazy"):60116,E=t?Symbol.for("react.block"):60121,S=t?Symbol.for("react.fundamental"):60117,T=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function y(_){if(typeof _=="object"&&_!==null){var P=_.$$typeof;switch(P){case r:switch(_=_.type,_){case l:case u:case i:case a:case o:case f:return _;default:switch(_=_&&_.$$typeof,_){case c:case d:case h:case g:case s:return _;default:return P}}case n:return P}}}function I(_){return y(_)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=r,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=g,e.Portal=n,e.Profiler=a,e.StrictMode=o,e.Suspense=f,e.isAsyncMode=function(_){return I(_)||y(_)===l},e.isConcurrentMode=I,e.isContextConsumer=function(_){return y(_)===c},e.isContextProvider=function(_){return y(_)===s},e.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===r},e.isForwardRef=function(_){return y(_)===d},e.isFragment=function(_){return y(_)===i},e.isLazy=function(_){return y(_)===h},e.isMemo=function(_){return y(_)===g},e.isPortal=function(_){return y(_)===n},e.isProfiler=function(_){return y(_)===a},e.isStrictMode=function(_){return y(_)===o},e.isSuspense=function(_){return y(_)===f},e.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===i||_===u||_===a||_===o||_===f||_===m||typeof _=="object"&&_!==null&&(_.$$typeof===h||_.$$typeof===g||_.$$typeof===s||_.$$typeof===c||_.$$typeof===d||_.$$typeof===S||_.$$typeof===T||_.$$typeof===w||_.$$typeof===E)},e.typeOf=y})),kE=Q.__commonJSMin(((e,t)=>{t.exports=ME()})),jE=Q.__commonJSMin(((e,t)=>{var r=kE(),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[r.ForwardRef]=o,s[r.Memo]=a;function c(E){return r.isMemo(E)?a:s[E.$$typeof]||n}var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,m=Object.getPrototypeOf,g=Object.prototype;function h(E,S,T){if(typeof S!="string"){if(g){var w=m(S);w&&w!==g&&h(E,w,T)}var y=u(S);d&&(y=y.concat(d(S)));for(var I=c(E),_=c(S),P=0;P<y.length;++P){var v=y[P];if(!i[v]&&!(T&&T[v])&&!(_&&_[v])&&!(I&&I[v])){var M=f(S,v);try{l(E,v,M)}catch{}}}}return E}t.exports=h})),RE=Q.__commonJSMin((e=>{var t=typeof Symbol=="function"&&Symbol.for})),NE=Q.__commonJSMin(((e,t)=>{t.exports=RE()})),Gq=Q.__toESM(jE()),Hq=NE();function tu(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Yr(e,t){if(tu(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var i=0;i<r.length;i++)if(!Object.prototype.hasOwnProperty.call(t,r[i])||!tu(e[r[i]],t[r[i]]))return!1;return!0}function ye(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ru=typeof Symbol=="function"&&Symbol.observable||"@@observable",da=()=>Math.random().toString(36).substring(7).split("").join("."),fi={INIT:`@@redux/INIT${da()}`,REPLACE:`@@redux/REPLACE${da()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${da()}`};function Ut(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function nu(e,t,r){if(typeof e!="function")throw new Error(ye(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ye(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ye(1));return r(nu)(e,t)}let n=e,i=t,o=new Map,a=o,s=0,c=!1;function l(){a===o&&(a=new Map,o.forEach((h,E)=>{a.set(E,h)}))}function u(){if(c)throw new Error(ye(3));return i}function d(h){if(typeof h!="function")throw new Error(ye(4));if(c)throw new Error(ye(5));let E=!0;l();const S=s++;return a.set(S,h),function(){if(E){if(c)throw new Error(ye(6));E=!1,l(),a.delete(S),o=null}}}function f(h){if(!Ut(h))throw new Error(ye(7));if(typeof h.type>"u")throw new Error(ye(8));if(typeof h.type!="string")throw new Error(ye(17));if(c)throw new Error(ye(9));try{c=!0,i=n(i,h)}finally{c=!1}return(o=a).forEach(E=>{E()}),h}function m(h){if(typeof h!="function")throw new Error(ye(10));n=h,f({type:fi.REPLACE})}function g(){const h=d;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(ye(11));function S(){const T=E;T.next&&T.next(u())}return S(),{unsubscribe:h(S)}},[ru](){return this}}}return f({type:fi.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:m,[ru]:g}}function DE(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:fi.INIT})>"u")throw new Error(ye(12));if(typeof r(void 0,{type:fi.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ye(13))})}function fa(e){const t=Object.keys(e),r={};for(let o=0;o<t.length;o++){const a=t[o];typeof e[a]=="function"&&(r[a]=e[a])}const n=Object.keys(r);let i;try{DE(r)}catch(o){i=o}return function(a={},s){if(i)throw i;let c=!1;const l={};for(let u=0;u<n.length;u++){const d=n[u],f=r[d],m=a[d],g=f(m,s);if(typeof g>"u")throw s&&s.type,new Error(ye(14));l[d]=g,c=c||g!==m}return c=c||n.length!==Object.keys(a).length,c?l:a}}function pi(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function LE(...e){return t=>(r,n)=>{const i=t(r,n);let o=()=>{throw new Error(ye(15))};const a={getState:i.getState,dispatch:(s,...c)=>o(s,...c)};return o=pi(...e.map(s=>s(a)))(i.dispatch),{...i,dispatch:o}}}function iu(e){return Ut(e)&&"type"in e&&typeof e.type=="string"}function ou(){return(0,b.useContext)(xt)}function au(e){e===void 0&&(e=xt);var t=e===xt?ou:function(){return(0,b.useContext)(e)};return function(){return t().store}}var se=au();function FE(e){e===void 0&&(e=xt);var t=e===xt?se:au(e);return function(){return t().dispatch}}var ot=FE(),xE=function(t,r){return t===r};function UE(e,t,r,n){var i=(0,b.useReducer)(function(m){return m+1},0)[1],o=(0,b.useMemo)(function(){return new eu(r,n)},[r,n]),a=(0,b.useRef)(),s=(0,b.useRef)(),c=(0,b.useRef)(),l=(0,b.useRef)(),u=r.getState(),d;try{if(e!==s.current||u!==c.current||a.current){var f=e(u);l.current===void 0||!t(f,l.current)?d=f:d=l.current}else d=l.current}catch(m){throw a.current&&(m.message+=`
|
|
7
|
+
The error may be correlated with this previous error:
|
|
8
|
+
`+a.current.stack+`
|
|
9
|
+
|
|
10
|
+
`),m}return ca(function(){s.current=e,c.current=u,l.current=d,a.current=void 0}),ca(function(){function m(){try{var g=s.current(r.getState());if(t(g,l.current))return;l.current=g}catch(h){a.current=h}i()}return o.onStateChange=m,o.trySubscribe(),m(),function(){return o.tryUnsubscribe()}},[r,o]),d}function BE(e){e===void 0&&(e=xt);var t=e===xt?ou:function(){return(0,b.useContext)(e)};return function(n,i){i===void 0&&(i=xE);var o=t(),a=o.store,s=o.subscription,c=UE(n,i,a,s);return(0,b.useDebugValue)(c),c}}var at=BE();TE(Lt.unstable_batchedUpdates);var Yt,pa=Q.__esmMin((()=>{pa(),Yt=typeof Yt<"u"?Yt:typeof self<"u"?self:typeof window<"u"?window:{}}));function su(){throw new Error("setTimeout has not been defined")}function lu(){throw new Error("clearTimeout has not been defined")}function cu(e){if(bt===setTimeout)return setTimeout(e,0);if((bt===su||!bt)&&setTimeout)return bt=setTimeout,setTimeout(e,0);try{return bt(e,0)}catch{try{return bt.call(null,e,0)}catch{return bt.call(this,e,0)}}}function $E(e){if(Et===clearTimeout)return clearTimeout(e);if((Et===lu||!Et)&&clearTimeout)return Et=clearTimeout,clearTimeout(e);try{return Et(e)}catch{try{return Et.call(null,e)}catch{return Et.call(this,e)}}}function qE(){!Jt||!Zt||(Jt=!1,Zt.length?ft=Zt.concat(ft):Xr=-1,ft.length&&uu())}function uu(){if(!Jt){var e=cu(qE);Jt=!0;for(var t=ft.length;t;){for(Zt=ft,ft=[];++Xr<t;)Zt&&Zt[Xr].run();Xr=-1,t=ft.length}Zt=null,Jt=!1,$E(e)}}function zE(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];ft.push(new du(e,t)),ft.length===1&&!Jt&&cu(uu)}function du(e,t){this.fun=e,this.array=t}function Xt(){}function GE(e){throw new Error("process.binding is not supported")}function HE(){return"/"}function VE(e){throw new Error("process.chdir is not supported")}function WE(){return 0}function KE(e){var t=Tu.call(er)*.001,r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r=r-e[0],n=n-e[1],n<0&&(r--,n+=1e9)),[r,n]}function QE(){return(new Date-Cu)/1e3}var bt,Et,ft,Jt,Zt,Xr,fu,pu,YE,mu,hu,XE,gu,yu,_u,vu,bu,Eu,wu,Su,Pu,Iu,er,Tu,Cu,Ou,JE=Q.__esmMin((()=>{pa(),bt=su,Et=lu,typeof Yt.setTimeout=="function"&&(bt=setTimeout),typeof Yt.clearTimeout=="function"&&(Et=clearTimeout),ft=[],Jt=!1,Xr=-1,du.prototype.run=function(){this.fun.apply(null,this.array)},fu="browser",pu="browser",YE=!0,mu={},hu=[],XE="",gu={},yu={},_u={},vu=Xt,bu=Xt,Eu=Xt,wu=Xt,Su=Xt,Pu=Xt,Iu=Xt,er=Yt.performance||{},Tu=er.now||er.mozNow||er.msNow||er.oNow||er.webkitNow||function(){return new Date().getTime()},Cu=new Date,Ou={nextTick:zE,title:fu,browser:!0,env:mu,argv:hu,version:"",versions:gu,on:vu,addListener:bu,once:Eu,off:wu,removeListener:Su,removeAllListeners:Pu,emit:Iu,binding:GE,cwd:HE,chdir:VE,umask:WE,hrtime:KE,platform:pu,release:yu,config:_u,uptime:QE}})),ma=Symbol.for("immer-nothing"),Jr=Symbol.for("immer-draftable"),fe=Symbol.for("immer-state");function _e(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var $e=Object,tr=$e.getPrototypeOf,Zr="constructor",en="prototype",ha="configurable",mi="enumerable",hi="writable",tn="value",qe=e=>!!e&&!!e[fe];function Re(e){return e?Mu(e)||nn(e)||!!e[Jr]||!!e[Zr]?.[Jr]||on(e)||an(e):!1}var ZE=$e[en][Zr].toString(),Au=new WeakMap;function Mu(e){if(!e||!wr(e))return!1;const t=tr(e);if(t===null||t===$e[en])return!0;const r=$e.hasOwnProperty.call(t,Zr)&&t[Zr];if(r===Object)return!0;if(!nr(r))return!1;let n=Au.get(r);return n===void 0&&(n=Function.toString.call(r),Au.set(r,n)),n===ZE}function ew(e){return qe(e)||_e(15,e),e[fe].base_}function rn(e,t,r=!0){rr(e)===0?(r?Reflect.ownKeys(e):$e.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,i)=>t(i,n,e))}function rr(e){const t=e[fe];return t?t.type_:nn(e)?1:on(e)?2:an(e)?3:0}var Er=(e,t,r=rr(e))=>r===2?e.has(t):$e[en].hasOwnProperty.call(e,t),wt=(e,t,r=rr(e))=>r===2?e.get(t):e[t],gi=(e,t,r,n=rr(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function tw(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var nn=Array.isArray,on=e=>e instanceof Map,an=e=>e instanceof Set,wr=e=>typeof e=="object",nr=e=>typeof e=="function",ga=e=>typeof e=="boolean";function rw(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var nw=e=>wr(e)?e?.[fe]:null,St=e=>e.copy_||e.base_,ya=e=>e.modified_?e.copy_:e.base_;function _a(e,t){if(on(e))return new Map(e);if(an(e))return new Set(e);if(nn(e))return Array[en].slice.call(e);const r=Mu(e);if(t===!0||t==="class_only"&&!r){const n=$e.getOwnPropertyDescriptors(e);delete n[fe];let i=Reflect.ownKeys(n);for(let o=0;o<i.length;o++){const a=i[o],s=n[a];s[hi]===!1&&(s[hi]=!0,s[ha]=!0),(s.get||s.set)&&(n[a]={[ha]:!0,[hi]:!0,[mi]:s[mi],[tn]:e[a]})}return $e.create(tr(e),n)}else{const n=tr(e);if(n!==null&&r)return{...e};const i=$e.create(n);return $e.assign(i,e)}}function va(e,t=!1){return _i(e)||qe(e)||!Re(e)||(rr(e)>1&&$e.defineProperties(e,{set:yi,add:yi,clear:yi,delete:yi}),$e.freeze(e),t&&rn(e,(r,n)=>{va(n,!0)},!1)),e}function iw(){_e(2)}var yi={[tn]:iw};function _i(e){return e===null||!wr(e)?!0:$e.isFrozen(e)}var vi="MapSet",bi="Patches",ku="ArrayMethods",Ei={};function ir(e){const t=Ei[e];return t||_e(0,e),t}var ju=e=>!!Ei[e];function ow(e,t){Ei[e]||(Ei[e]=t)}var sn,Ru=()=>sn,aw=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ju(vi)?ir(vi):void 0,arrayMethodsPlugin_:ju(ku)?ir(ku):void 0});function Nu(e,t){t&&(e.patchPlugin_=ir(bi),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ba(e){Ea(e),e.drafts_.forEach(sw),e.drafts_=null}function Ea(e){e===sn&&(sn=e.parent_)}var Du=e=>sn=aw(sn,e);function sw(e){const t=e[fe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Lu(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[fe].modified_&&(ba(t),_e(4)),Re(e)&&(e=Fu(t,e));const{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[fe].base_,e,t)}else e=Fu(t,r);return lw(t,e,!0),ba(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ma?e:void 0}function Fu(e,t){if(_i(t))return t;const r=t[fe];if(!r)return Si(t,e.handledSet_,e);if(!wi(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Bu(r,e)}return r.copy_}function lw(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&va(t,r)}function xu(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var wi=(e,t)=>e.scope_===t,cw=[];function Uu(e,t,r,n){const i=St(e),o=e.type_;if(n!==void 0&&wt(i,n,o)===t){gi(i,n,r,o);return}if(!e.draftLocations_){const s=e.draftLocations_=new Map;rn(i,(c,l)=>{if(qe(l)){const u=s.get(l)||[];u.push(c),s.set(l,u)}})}const a=e.draftLocations_.get(t)??cw;for(const s of a)gi(i,s,r,o)}function uw(e,t,r){e.callbacks_.push(function(i){const o=t;if(!o||!wi(o,i))return;i.mapSetPlugin_?.fixSetContents(o);const a=ya(o);Uu(e,o.draft_??o,a,r),Bu(o,i)})}function Bu(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const n=r.getPath(e);n&&r.generatePatches_(e,n,t)}xu(e)}}function dw(e,t,r){const{scope_:n}=e;if(qe(r)){const i=r[fe];wi(i,n)&&i.callbacks_.push(function(){Ii(e),Uu(e,r,ya(i),t)})}else Re(r)&&e.callbacks_.push(function(){const o=St(e);e.type_===3?o.has(r)&&Si(r,n.handledSet_,n):wt(o,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Si(wt(e.copy_,t,e.type_),n.handledSet_,n)})}function Si(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||qe(e)||t.has(e)||!Re(e)||_i(e)||(t.add(e),rn(e,(n,i)=>{if(qe(i)){const o=i[fe];wi(o,r)&&(gi(e,n,ya(o),e.type_),xu(o))}else Re(i)&&Si(i,t,r)})),e}function fw(e,t){const r=nn(e),n={type_:r?1:0,scope_:t?t.scope_:Ru(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,o=Pi;r&&(i=[n],o=ln);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return n.draft_=s,n.revoke_=a,[s,n]}var Pi={get(e,t){if(t===fe)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=St(e);if(!Er(i,t,e.type_))return mw(e,i,t);const o=i[t];if(e.finalized_||!Re(o)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&rw(t))return o;if(o===wa(e.base_,t)||pw(e,t,o)){Ii(e);const a=e.type_===1?+t:t,s=Pa(e.scope_,o,e,a);return e.copy_[a]=s}return o},has(e,t){return t in St(e)},ownKeys(e){return Reflect.ownKeys(St(e))},set(e,t,r){const n=$u(St(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=wa(St(e),t),o=i?.[fe];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(tw(r,i)&&(r!==void 0||Er(e.base_,t,e.type_)))return!0;Ii(e),Sa(e)}return e.copy_[t]===r&&(r!==void 0||Er(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),dw(e,t,r)),!0},deleteProperty(e,t){return Ii(e),wa(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Sa(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=St(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[hi]:!0,[ha]:e.type_!==1||t!=="length",[mi]:n[mi],[tn]:r[t]}},defineProperty(){_e(11)},getPrototypeOf(e){return tr(e.base_)},setPrototypeOf(){_e(12)}},ln={};for(let e in Pi){let t=Pi[e];ln[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}ln.deleteProperty=function(e,t){return ln.set.call(this,e,t,void 0)},ln.set=function(e,t,r){return Pi.set.call(this,e[0],t,r,e[0])};function wa(e,t){const r=e[fe];return(r?St(r):e)[t]}function pw(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Re(r)||r[fe]?!1:e.baseRefs_.has(r)}function mw(e,t,r){const n=$u(t,r);return n?tn in n?n[tn]:n.get?.call(e.draft_):void 0}function $u(e,t){if(!(t in e))return;let r=tr(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=tr(r)}}function Sa(e){e.modified_||(e.modified_=!0,e.parent_&&Sa(e.parent_))}function Ii(e){e.copy_||(e.assigned_=new Map,e.copy_=_a(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var hw=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(nr(t)&&!nr(r)){const o=r;r=t;const a=this;return function(c=o,...l){return a.produce(c,u=>r.call(this,u,...l))}}nr(r)||_e(6),n!==void 0&&!nr(n)&&_e(7);let i;if(Re(t)){const o=Du(this),a=Pa(o,t,void 0);let s=!0;try{i=r(a),s=!1}finally{s?ba(o):Ea(o)}return Nu(o,n),Lu(i,o)}else if(!t||!wr(t)){if(i=r(t),i===void 0&&(i=t),i===ma&&(i=void 0),this.autoFreeze_&&va(i,!0),n){const o=[],a=[];ir(bi).generateReplacementPatches_(t,i,{patches_:o,inversePatches_:a}),n(o,a)}return i}else _e(1,t)},this.produceWithPatches=(t,r)=>{if(nr(t))return(o,...a)=>this.produceWithPatches(o,s=>t(s,...a));let n,i;return[this.produce(t,r,(o,a)=>{n=o,i=a}),n,i]},ga(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ga(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ga(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Re(e)||_e(8),qe(e)&&(e=qu(e));const t=Du(this),r=Pa(t,e,void 0);return r[fe].isManual_=!0,Ea(t),r}finishDraft(e,t){const r=e&&e[fe];(!r||!r.isManual_)&&_e(9);const{scope_:n}=r;return Nu(n,t),Lu(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=ir(bi).applyPatches_;return qe(e)?n(e,t):this.produce(e,i=>n(i,t))}};function Pa(e,t,r,n){const[i,o]=on(t)?ir(vi).proxyMap_(t,r):an(t)?ir(vi).proxySet_(t,r):fw(t,r);return(r?.scope_??Ru()).drafts_.push(i),o.callbacks_=r?.callbacks_??[],o.key_=n,r&&n!==void 0?uw(r,o,n):o.callbacks_.push(function(s){s.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:c}=s;o.modified_&&c&&c.generatePatches_(o,[],s)}),i}function qu(e){return qe(e)||_e(10,e),zu(e)}function zu(e){if(!Re(e)||_i(e))return e;const t=e[fe];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=_a(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=_a(e,!0);return rn(r,(i,o)=>{gi(r,i,zu(o))},n),t&&(t.finalized_=!1),r}function gw(){function t(g,h=[]){if(g.key_!==void 0){const E=g.parent_.copy_??g.parent_.base_,S=nw(wt(E,g.key_)),T=wt(E,g.key_);if(T===void 0||T!==g.draft_&&T!==g.base_&&T!==g.copy_||S!=null&&S.base_!==g.base_)return null;const w=g.parent_.type_===3;let y;if(w){const I=g.parent_;y=Array.from(I.drafts_.keys()).indexOf(g.key_)}else y=g.key_;if(!(w&&E.size>y||Er(E,y)))return null;h.push(y)}if(g.parent_)return t(g.parent_,h);h.reverse();try{r(g.copy_,h)}catch{return null}return h}function r(g,h){let E=g;for(let S=0;S<h.length-1;S++){const T=h[S];if(E=wt(E,T),!wr(E)||E===null)throw new Error(`Cannot resolve path at '${h.join("/")}'`)}return E}const n="replace",i="add",o="remove";function a(g,h,E){if(g.scope_.processedForPatches_.has(g))return;g.scope_.processedForPatches_.add(g);const{patches_:S,inversePatches_:T}=E;switch(g.type_){case 0:case 2:return c(g,h,S,T);case 1:return s(g,h,S,T);case 3:return l(g,h,S,T)}}function s(g,h,E,S){let{base_:T,assigned_:w}=g,y=g.copy_;y.length<T.length&&([T,y]=[y,T],[E,S]=[S,E]);const I=g.allIndicesReassigned_===!0;for(let _=0;_<T.length;_++){const P=y[_],v=T[_];if((I||w?.get(_.toString()))&&P!==v){const M=P?.[fe];if(M&&M.modified_)continue;const j=h.concat([_]);E.push({op:n,path:j,value:m(P)}),S.push({op:n,path:j,value:m(v)})}}for(let _=T.length;_<y.length;_++){const P=h.concat([_]);E.push({op:i,path:P,value:m(y[_])})}for(let _=y.length-1;T.length<=_;--_){const P=h.concat([_]);S.push({op:o,path:P})}}function c(g,h,E,S){const{base_:T,copy_:w,type_:y}=g;rn(g.assigned_,(I,_)=>{const P=wt(T,I,y),v=wt(w,I,y),M=_?Er(T,I)?n:i:o;if(P===v&&M===n)return;const j=h.concat(I);E.push(M===o?{op:M,path:j}:{op:M,path:j,value:m(v)}),S.push(M===i?{op:o,path:j}:M===o?{op:i,path:j,value:m(P)}:{op:n,path:j,value:m(P)})})}function l(g,h,E,S){let{base_:T,copy_:w}=g,y=0;T.forEach(I=>{if(!w.has(I)){const _=h.concat([y]);E.push({op:o,path:_,value:I}),S.unshift({op:i,path:_,value:I})}y++}),y=0,w.forEach(I=>{if(!T.has(I)){const _=h.concat([y]);E.push({op:i,path:_,value:I}),S.unshift({op:o,path:_,value:I})}y++})}function u(g,h,E){const{patches_:S,inversePatches_:T}=E;S.push({op:n,path:[],value:h===ma?void 0:h}),T.push({op:n,path:[],value:g})}function d(g,h){return h.forEach(E=>{const{path:S,op:T}=E;let w=g;for(let P=0;P<S.length-1;P++){const v=rr(w);let M=S[P];typeof M!="string"&&typeof M!="number"&&(M=""+M),(v===0||v===1)&&(M==="__proto__"||M===Zr)&&_e(19),nr(w)&&M===en&&_e(19),w=wt(w,M),(w===null||!wr(w))&&_e(18,S.join("/"))}const y=rr(w),I=f(E.value),_=S[S.length-1];switch(T){case n:switch(y){case 2:return w.set(_,I);case 3:_e(16);default:return w[_]=I}case i:switch(y){case 1:return _==="-"?w.push(I):w.splice(_,0,I);case 2:return w.set(_,I);case 3:return w.add(I);default:return w[_]=I}case o:switch(y){case 1:return w.splice(_,1);case 2:return w.delete(_);case 3:return w.delete(E.value);default:return delete w[_]}default:_e(17,T)}}),g}function f(g){if(!Re(g))return g;if(nn(g))return g.map(f);if(on(g))return new Map(Array.from(g.entries()).map(([E,S])=>[E,f(S)]));if(an(g))return new Set(Array.from(g).map(f));const h=Object.create(tr(g));for(const E in g)h[E]=f(g[E]);return Er(g,Jr)&&(h[Jr]=g[Jr]),h}function m(g){return qe(g)?f(g):g}ow(bi,{applyPatches_:d,generatePatches_:a,generateReplacementPatches_:u,getPath:t})}var cn=new hw,un=cn.produce,Gu=cn.produceWithPatches.bind(cn),Hu=cn.applyPatches.bind(cn);function yw(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function _w(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Vu=e=>Array.isArray(e)?e:[e];function vw(e){const t=Array.isArray(e[0])?e[0]:e;return _w(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function bw(e,t){const r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var Ew=class{constructor(e){this.value=e}deref(){return this.value}},ww=()=>typeof WeakRef>"u"?Ew:WeakRef,Wu=ww(),Sw=0,Ku=1;function Ti(){return{s:Sw,v:void 0,o:null,p:null}}function Pw(e){return e instanceof Wu?e.deref():e}function Ci(e,t={}){let r=Ti();const{resultEqualityCheck:n}=t;let i,o=0;function a(){let s=r;const{length:c}=arguments;for(let d=0,f=c;d<f;d++){const m=arguments[d];if(typeof m=="function"||typeof m=="object"&&m!==null){let g=s.o;g===null&&(s.o=g=new WeakMap);const h=g.get(m);h===void 0?(s=Ti(),g.set(m,s)):s=h}else{let g=s.p;g===null&&(s.p=g=new Map);const h=g.get(m);h===void 0?(s=Ti(),g.set(m,s)):s=h}}const l=s;let u;if(s.s===Ku)u=s.v;else if(u=e.apply(null,arguments),o++,n){const d=Pw(i);d!=null&&n(d,u)&&(u=d,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new Wu(u):u}return l.s=Ku,l.v=u,u}return a.clearCache=()=>{r=Ti(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function Iw(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,a=0,s,c={},l=i.pop();typeof l=="object"&&(c=l,l=i.pop()),yw(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const{memoize:u,memoizeOptions:d=[],argsMemoize:f=Ci,argsMemoizeOptions:m=[]}={...r,...c},g=Vu(d),h=Vu(m),E=vw(i),S=u(function(){return o++,l.apply(null,arguments)},...g),T=f(function(){a++;const y=bw(E,arguments);return s=S.apply(null,y),s},...h);return Object.assign(T,{resultFunc:l,memoizedResultFunc:S,dependencies:E,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:u,argsMemoize:f})};return Object.assign(n,{withTypes:()=>n}),n}var Qu=Iw(Ci);function Yu(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var Tw=Yu(),Cw=Yu,Ow=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?pi:pi.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Aw=e=>e&&typeof e.match=="function";function Ne(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Je(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>iu(n)&&n.type===e,r}var Xu=class oi extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,oi.prototype)}static get[Symbol.species](){return oi}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new oi(...t[0].concat(this)):new oi(...t.concat(this))}};function Ju(e){return Re(e)?un(e,()=>{}):e}function Oi(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Mw(e){return typeof e=="boolean"}var kw=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let a=new Xu;return r&&(Mw(r)?a.push(Tw):a.push(Cw(r.extraArgument))),a},Ai="RTK_autoBatch",dn=()=>e=>({payload:e,meta:{[Ai]:!0}}),Zu=e=>t=>{setTimeout(t,e)},jw=(e,t)=>r=>{let n=!1;const i=()=>{n||(n=!0,cancelAnimationFrame(o),clearTimeout(a),r())},o=e(i),a=setTimeout(i,t)},Rw=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,o=!1,a=!1;const s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?jw(window.requestAnimationFrame,100):Zu(10):e.type==="callback"?e.queueNotification:Zu(e.timeout),l=()=>{a=!1,o&&(o=!1,s.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const d=()=>i&&u(),f=n.subscribe(d);return s.add(u),()=>{f(),s.delete(u)}},dispatch(u){try{return i=!u?.meta?.[Ai],o=!i,o&&(a||(a=!0,c(l))),n.dispatch(u)}finally{i=!0}}})},Nw=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new Xu(e);return n&&i.push(Rw(typeof n=="object"?n:void 0)),i};function Dw(e){const t=kw(),{reducer:r=void 0,middleware:n,devTools:i=!0,duplicateMiddlewareCheck:o=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{};let c;if(typeof r=="function")c=r;else if(Ut(r))c=fa(r);else throw new Error(Je(1));let l;typeof n=="function"?l=n(t):l=t();let u=pi;i&&(u=Ow({trace:!1,...typeof i=="object"&&i}));const d=Nw(LE(...l));let f=typeof s=="function"?s(d):d();const m=u(...f);return nu(c,a,m)}function ed(e){const t={},r=[];let n;const i={addCase(o,a){const s=typeof o=="string"?o:o.type;if(!s)throw new Error(Je(28));if(s in t)throw new Error(Je(29));return t[s]=a,i},addAsyncThunk(o,a){return a.pending&&(t[o.pending.type]=a.pending),a.rejected&&(t[o.rejected.type]=a.rejected),a.fulfilled&&(t[o.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:o.settled,reducer:a.settled}),i},addMatcher(o,a){return r.push({matcher:o,reducer:a}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function Lw(e){return typeof e=="function"}function Fw(e,t){let[r,n,i]=ed(t),o;if(Lw(e))o=()=>Ju(e());else{const s=Ju(e);o=()=>s}function a(s=o(),c){let l=[r[c.type],...n.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return l.filter(u=>!!u).length===0&&(l=[i]),l.reduce((u,d)=>{if(d)if(qe(u)){const f=d(u,c);return f===void 0?u:f}else{if(Re(u))return un(u,f=>d(f,c));{const f=d(u,c);if(f===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return u},s)}return a.getInitialState=o,a}var td=(e,t)=>Aw(e)?e.match(t):e(t);function Pt(...e){return t=>e.some(r=>td(r,t))}function fn(...e){return t=>e.every(r=>td(r,t))}function Mi(e,t){if(!e||!e.meta)return!1;const r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function pn(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Ia(...e){return e.length===0?t=>Mi(t,["pending"]):pn(e)?Pt(...e.map(t=>t.pending)):Ia()(e[0])}function Sr(...e){return e.length===0?t=>Mi(t,["rejected"]):pn(e)?Pt(...e.map(t=>t.rejected)):Sr()(e[0])}function ki(...e){const t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?fn(Sr(...e),t):pn(e)?fn(Sr(...e),t):ki()(e[0])}function Bt(...e){return e.length===0?t=>Mi(t,["fulfilled"]):pn(e)?Pt(...e.map(t=>t.fulfilled)):Bt()(e[0])}function Ta(...e){return e.length===0?t=>Mi(t,["pending","fulfilled","rejected"]):pn(e)?Pt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Ta()(e[0])}var xw="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ca=(e=21)=>{let t="",r=e;for(;r--;)t+=xw[Math.random()*64|0];return t},Uw=["name","message","stack","code"],Oa=class{constructor(e,t){this.payload=e,this.meta=t}payload;meta;_type},rd=class{constructor(e,t){this.payload=e,this.meta=t}payload;meta;_type},Bw=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of Uw)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},nd="External signal was aborted",Aa=(()=>{function e(t,r,n){const i=Ne(t+"/fulfilled",(c,l,u,d)=>({payload:c,meta:{...d||{},arg:u,requestId:l,requestStatus:"fulfilled"}})),o=Ne(t+"/pending",(c,l,u)=>({payload:void 0,meta:{...u||{},arg:l,requestId:c,requestStatus:"pending"}})),a=Ne(t+"/rejected",(c,l,u,d,f)=>({payload:d,error:(n&&n.serializeError||Bw)(c||"Rejected"),meta:{...f||{},arg:u,requestId:l,rejectedWithValue:!!d,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c,{signal:l}={}){return(u,d,f)=>{const m=n?.idGenerator?n.idGenerator(c):Ca(),g=new AbortController;let h,E;function S(w){E=w,g.abort()}l&&(l.aborted?S(nd):l.addEventListener("abort",()=>S(nd),{once:!0}));const T=(async function(){let w;try{let y=n?.condition?.(c,{getState:d,extra:f});if(qw(y)&&(y=await y),y===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const I=new Promise((_,P)=>{h=()=>{P({name:"AbortError",message:E||"Aborted"})},g.signal.addEventListener("abort",h,{once:!0})});u(o(m,c,n?.getPendingMeta?.({requestId:m,arg:c},{getState:d,extra:f}))),w=await Promise.race([I,Promise.resolve(r(c,{dispatch:u,getState:d,extra:f,requestId:m,signal:g.signal,abort:S,rejectWithValue:((_,P)=>new Oa(_,P)),fulfillWithValue:((_,P)=>new rd(_,P))})).then(_=>{if(_ instanceof Oa)throw _;return _ instanceof rd?i(_.payload,m,c,_.meta):i(_,m,c)})])}catch(y){w=y instanceof Oa?a(null,m,c,y.payload,y.meta):a(y,m,c)}finally{h&&g.signal.removeEventListener("abort",h)}return n&&!n.dispatchConditionRejection&&a.match(w)&&w.meta.condition||u(w),w})();return Object.assign(T,{abort:S,requestId:m,arg:c,unwrap(){return T.then($w)}})}}return Object.assign(s,{pending:o,rejected:a,fulfilled:i,settled:Pt(a,i),typePrefix:t})}return e.withTypes=()=>e,e})();function $w(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function qw(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var zw=Symbol.for("rtk-slice-createasyncthunk");function Gw(e,t){return`${e}/${t}`}function Hw({creators:e}={}){const t=e?.asyncThunk?.[zw];return function(n){const{name:i,reducerPath:o=i}=n;if(!i)throw new Error(Je(11));const a=(typeof n.reducers=="function"?n.reducers(Ww()):n.reducers)||{},s=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(w,y){const I=typeof w=="string"?w:w.type;if(!I)throw new Error(Je(12));if(I in c.sliceCaseReducersByType)throw new Error(Je(13));return c.sliceCaseReducersByType[I]=y,l},addMatcher(w,y){return c.sliceMatchers.push({matcher:w,reducer:y}),l},exposeAction(w,y){return c.actionCreators[w]=y,l},exposeCaseReducer(w,y){return c.sliceCaseReducersByName[w]=y,l}};s.forEach(w=>{const y=a[w],I={reducerName:w,type:Gw(i,w),createNotation:typeof n.reducers=="function"};Qw(y)?Xw(I,y,l,t):Kw(I,y,l)});function u(){const[w={},y=[],I=void 0]=typeof n.extraReducers=="function"?ed(n.extraReducers):[n.extraReducers],_={...w,...c.sliceCaseReducersByType};return Fw(n.initialState,P=>{for(let v in _)P.addCase(v,_[v]);for(let v of c.sliceMatchers)P.addMatcher(v.matcher,v.reducer);for(let v of y)P.addMatcher(v.matcher,v.reducer);I&&P.addDefaultCase(I)})}const d=w=>w,f=new Map,m=new WeakMap;let g;function h(w,y){return g||(g=u()),g(w,y)}function E(){return g||(g=u()),g.getInitialState()}function S(w,y=!1){function I(P){let v=P[w];return typeof v>"u"&&y&&(v=Oi(m,I,E)),v}function _(P=d){return Oi(Oi(f,y,()=>new WeakMap),P,()=>{const v={};for(const[M,j]of Object.entries(n.selectors??{}))v[M]=Vw(j,P,()=>Oi(m,P,E),y);return v})}return{reducerPath:w,getSelectors:_,get selectors(){return _(I)},selectSlice:I}}const T={name:i,reducer:h,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:E,...S(o),injectInto(w,{reducerPath:y,...I}={}){const _=y??o;return w.inject({reducerPath:_,reducer:h},I),{...T,...S(_,!0)}}};return T}}function Vw(e,t,r,n){function i(o,...a){let s=t(o);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return i.unwrapped=e,i}var Te=Hw();function Ww(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Kw({type:e,reducerName:t,createNotation:r},n,i){let o,a;if("reducer"in n){if(r&&!Yw(n))throw new Error(Je(17));o=n.reducer,a=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,a?Ne(e,a):Ne(e))}function Qw(e){return e._reducerDefinitionType==="asyncThunk"}function Yw(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Xw({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Je(18));const{payloadCreator:o,fulfilled:a,pending:s,rejected:c,settled:l,options:u}=r,d=i(e,o,u);n.exposeAction(t,d),a&&n.addCase(d.fulfilled,a),s&&n.addCase(d.pending,s),c&&n.addCase(d.rejected,c),l&&n.addMatcher(d.settled,l),n.exposeCaseReducer(t,{fulfilled:a||ji,pending:s||ji,rejected:c||ji,settled:l||ji})}function ji(){}var id="listener",od="completed",ad="cancelled",Vq=`task-${ad}`,Wq=`task-${od}`,Kq=`${id}-${ad}`,Qq=`${id}-${od}`,{assign:sd}=Object,Ma="listenerMiddleware",Jw=sd(Ne(`${Ma}/add`),{withTypes:()=>Jw}),Yq=Ne(`${Ma}/removeAll`),Zw=sd(Ne(`${Ma}/remove`),{withTypes:()=>Zw});function Je(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}function e0(e){return e}function ld({data:e,...t},r){return t.error?t:{data:r(e,t.meta),...t}}function t0({data:e,...t},r){return t.error?t:{data:e.map(n=>r(n,t.meta)),...t}}function we(e){return t=>ld(t,e)}var r0=e=>!e||typeof e!="object"?e:"data"in e&&e.data!==void 0?e.data:e;function n0(e,t){if(e.error)return{error:{status:e.status||400,data:r0(e.error)}};try{return{data:t(e.data)}}catch(r){return{error:{status:e.status||500,data:{message:r instanceof Error?r.message:"Invalid response"}}}}}function i0(e){return!e.hasOwnProperty("previous")}function Ri(e){return t=>ld(t,(r,n)=>i0(r)?e(r,n):e(r.previous,n))}function ze(e){return t=>t0(t,e)}var cd={editorThemeColor:"light",isSettingsDisabled:!1,emailAutosaveTimestamps:{},settings:{backgroundColor:"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",textStrong:!1,textItalic:!1,textUnderline:!1},elementSettings:{},searchFilters:{},emailCommonStyles:"",saveTime:null,mobileViewActive:{shutdown:!0,styles:!0},isCodeMode:!1,codeModeDirection:void 0,emailViewType:void 0,changeKey:null,problemsList:[],codeErrors:[],activeProblemRange:null,emailGroups:{},projectGroups:[],isNeedUpdateAppearance:!1,isNeedUpdateContentAppearance:!1},pt="emailSlice",ud=Te({name:pt,initialState:cd,reducers:{setEditorThemeColor:(e,t)=>{e.editorThemeColor=t.payload},setEmailSettings:(e,{payload:t})=>{Object.assign(e,{...e,settings:{...t},isSettingsDisabled:!1})},setEmailSettingsDisable:(e,t)=>{e.isSettingsDisabled=t.payload},setElementSettings:(e,{payload:t})=>{e.elementSettings=t},setSearchFilters:(e,t)=>{e.searchFilters=t.payload},updateSearchFilters:(e,t)=>{e.searchFilters={...e.searchFilters,...t.payload}},resetEmailSlice:e=>{const t=e.emailAutosaveTimestamps;return{...cd,emailAutosaveTimestamps:t}},rememberAutosaveTime:(e,{payload:t})=>{e.emailAutosaveTimestamps[t.emailId]=t.modified},applyProjectGroups:(e,{payload:t})=>{const r=t.projectGroups;e.projectGroups=r;const n=t.emailGroup;if(!n)return;const i={};n.length&&r.length&&n.forEach(o=>{r.forEach(a=>{const s=(a.children||[]).find(c=>c.id===o);s&&(i.hasOwnProperty(a.id)||(i[a.id]=[]),i[a.id].push({label:s.name,value:s.id}))})}),e.emailGroups=i},setCodeErrors:(e,t)=>{e.codeErrors=t.payload},setProblemsList:(e,t)=>{e.problemsList=t.payload},setActiveProblemRange:(e,t)=>{e.activeProblemRange=t.payload},markAppearanceNeedsUpdate:e=>{e.isNeedUpdateAppearance=!0,e.isNeedUpdateContentAppearance=!0},setIsNeedUpdateContentAppearance:(e,t)=>{e.isNeedUpdateContentAppearance=t.payload},setIsNeedUpdateAppearance:(e,t)=>{e.isNeedUpdateAppearance=t.payload},setEmailGroups:(e,{payload:t})=>{const r=Object.keys(t)[0],n=e.emailGroups,i=e.projectGroups,o={};i.length&&(t[r]?.forEach(a=>{const s=i.find(l=>l.id===+r),c=(s?.children||[]).find(l=>l.id===+a);c?(o.hasOwnProperty(s.id)||(o[s.id]=[]),o[s.id].push({label:c.name,value:c.id})):(o.hasOwnProperty(r)||(o[r]=[]),o[r].push({label:a,value:null}))}),t[r].length===0&&(o[r]=[])),e.emailGroups={...n,...o}}}}),{setEditorThemeColor:o0,setEmailSettings:a0,setElementSettings:s0,setEmailSettingsDisable:l0,setSearchFilters:Xq,updateSearchFilters:Jq,resetEmailSlice:c0,rememberAutosaveTime:u0,applyProjectGroups:d0,setProblemsList:f0,setCodeErrors:Zq,setActiveProblemRange:p0,setEmailGroups:m0,markAppearanceNeedsUpdate:h0,setIsNeedUpdateAppearance:g0,setIsNeedUpdateContentAppearance:y0}=ud.actions;function _0(e,t){return d0({projectGroups:e??[],emailGroup:Array.isArray(t)?t:void 0})}var v0=e=>e[pt].isNeedUpdateContentAppearance,b0=e=>e[pt].settings,E0=e=>e[pt].problemsList,w0=e=>e[pt].projectGroups,dd=e=>e[pt].elementSettings,fd=e=>e[pt].editorThemeColor,S0=e=>e[pt].isSettingsDisabled,P0=e=>e[pt].activeProblemRange,I0=e=>e[pt].isNeedUpdateAppearance,T0=/<\/?[a-zA-Z][a-zA-Z0-9:_.-]*(?:\s[^<>]*)?\/?>/g;function C0(e){return e.replace(T0,t=>/^<br\b/i.test(t)?" ":"")}var ez={theme:C.createIdentifier("canvas_fact_theme"),flags:C.createIdentifier("canvas_fact_flags"),commonStyles:C.createIdentifier("canvas_fact_common_styles"),lockEditor:C.createIdentifier("canvas_fact_lock_editor"),codeMode:C.createIdentifier("canvas_fact_code_mode"),appName:C.createIdentifier("canvas_fact_app_name"),previewPage:C.createIdentifier("canvas_fact_preview_page"),viewport:C.createIdentifier("canvas_fact_viewport")},O0={text:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",lineHeight:21,lineHeightDim:"px",color:"#5a5a5a",contrastColor:"#FFFFFF",textAlign:"left",paddingBottom:10,paddingBottomDim:"px"},headings:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif"],fontSize:24,fontSizeDim:"px",lineHeight:32,lineHeightDim:"px",color:"#333333",contrastColor:"#FFFFFF",textAlign:"left",paddingTop:20,paddingTopDim:"px",paddingBottom:20,paddingBottomDim:"px",letterSpacing:0,letterSpacingDim:"px",bold:!0,italic:!1},links:{color:"#1C52DC",contrastColor:"#FFFFFF",underline:!0},buttons:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",letterSpacing:0,letterSpacingDim:"px",color:"#FFFFFF",contrastColor:"#1C52DC",bold:!1,italic:!1,backgroundColor:"#1C52DC",contrastBackgroundColor:"#FFFFFF",marginTop:10,marginTopDim:"px",marginBottom:10,marginBottomDim:"px",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},textAlign:"center",padding:{all:null,top:null,right:null,bottom:null,left:null}},block:{backgroundColor:"#FFFFFF",contrastBackgroundColor:"#1C52DC",padding:{all:null,top:null,right:null,bottom:null,left:null}},cards:{contrastBackgroundColor:"#1C52DC",contrastTextColor:"#FFFFFF",baseBackgroundColor:"#F8F8F8",baseTextColor:"#333333",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}}},A0="ERROR",M0="useblocks",Ni={em_token:"em_access_token",em_refresh_token:"em_refresh_token",em_admin_token:"em_admin_access_token",em_admin_refresh_token:"em_admin_refresh_token",em_impersonation:"em_impersonation",em_elements_view:"em_elements_view",em_new_block:"em_new_block",em_new_email:"em_new_email",em_id:"em_id",em_name:"em_name",em_email:"em_email",em_locale:"em_locale",em_carrotquest_hash:"em_carrotquest_hash",em_ducalis_hash:"em_ducalis_hash",em_email_subscription_consent:"em_email_subscription_consent",em_folder:"em_folder",promocode:"promocode",em_active_tab:"em_active_tab"},It={em_color_scheme:"em_color_scheme",em_code_mode_pane_sizes:"em_code_mode_pane_sizes",em_preview_pane_sizes:"em_preview_pane_sizes",em_default_sizes:"em_default_sizes",em_pane_sizes:"em_pane_sizes",em_test_emails:"em_test_emails",em_menu_is_locked:"em_menu_is_locked",em_code_mode_settings:"em_code_mode_settings",em_folder_is_open:"em_folder_is_open",em_active_tab:"em_active_tab",em_ai_settings:"em_ai_settings",em_last_active_page:"em_last_active_page",em_layout_convert_never_suggest:"em_layout_convert_never_suggest",em_filemanager_v2:"em_filemanager_v2",em_projects_v2:"em_projects_v2",em_translations_v2:"em_translations_v2",em_defer_chrome:"em_defer_chrome",em_stripo_import:"em_stripo_import",em_guest_locale:"em_guest_locale"},k0="not all",pd="light",md="dark",j0="system",R0="(prefers-color-scheme: light)",N0="(prefers-color-scheme: dark)",D0={auth:"/auth",projects_index:"/",projects:"/projects",project:"/projects/:projectId/emails",email:"/projects/:projectId/emails/:emailId",create_email:"/projects/:projectId/emails/new",create_page:"/projects/:projectId/emails/create",new_from:"/projects/:projectId/emails/new_from",blocks:"/projects/:projectId/blocks",block:"/projects/:projectId/blocks/:blockId",create_block:"/projects/:projectId/blocks/new",billing:"/billing",admin:"/admin",admin_users:"/admin/users",admin_user:"/admin/users/:id"},de={ADD_NEW_PROJECT_MODAL:"ADD_NEW_PROJECT_MODAL",BLOCKS_MODAL:"BLOCKS_MODAL",EDIT_PROFILE_MODAL:"EDIT_PROFILE_MODAL",SEND_TEST_EMAIL:"SEND_TEST_EMAIL",ADD_NEW_EBLOCK_MODAL:"ADD_NEW_EBLOCK_MODAL",UPDATE_GLOBAL_BLOCKS_MODAL:"UPDATE_GLOBAL_BLOCKS_MODAL",SAVE_GLOBAL_BLOCK_CHOICE_MODAL:"SAVE_GLOBAL_BLOCK_CHOICE_MODAL",ADD_NEW_EMAIL_MODAL:"ADD_NEW_EMAIL_MODAL",ADD_NEW_AI_EMAIL:"ADD_NEW_AI_EMAIL",STRIPO_IMPORT:"STRIPO_IMPORT",STRIPO_IMPORT_RESULT:"STRIPO_IMPORT_RESULT",SWITCH_TO_PLAN_MODAL:"SWITCH_TO_PLAN_MODAL",IMAGE_EDITOR_MODAL:"IMAGE_EDITOR_MODAL",ADD_NEW_FOLDER_MODAL:"ADD_NEW_FOLDER_MODAL",EDIT_FOLDER_NAME_MODAL:"EDIT_FOLDER_NAME_MODAL",ADD_NEW_GROUP_MODAL:"ADD_NEW_GROUP_MODAL",EDIT_GROUP_NAME_MODAL:"EDIT_GROUP_NAME_MODAL",RENAME_EMAIL_MODAL:"RENAME_EMAIL_MODAL",RENAME_BLOCK_MODAL:"RENAME_BLOCK_MODAL",UPLOAD_IMAGE_MODAL:"UPLOAD_IMAGE_MODAL",UPLOAD_BACKGROUND_MODAL:"UPLOAD_BACKGROUND_MODAL",UPLOAD_IMAGE_MODAL_AI:"UPLOAD_IMAGE_MODAL_AI",UPLOAD_BACKGROUND_MODAL_AI:"UPLOAD_BACKGROUND_MODAL_AI",UPLOAD_IMAGE_MODAL_STOCK:"UPLOAD_IMAGE_MODAL_STOCK",UPLOAD_BACKGROUND_MODAL_STOCK:"UPLOAD_BACKGROUND_MODAL_STOCK",UPLOAD_IMAGE_MODAL_GIF:"UPLOAD_IMAGE_MODAL_GIF",UPLOAD_BACKGROUND_MODAL_GIF:"UPLOAD_BACKGROUND_MODAL_GIF",UPLOAD_IMAGE_MODAL_EDIT:"UPLOAD_IMAGE_MODAL_EDIT",UPLOAD_BACKGROUND_MODAL_EDIT:"UPLOAD_BACKGROUND_MODAL_EDIT",UPLOAD_IMAGE_MODAL_UPLOAD:"UPLOAD_IMAGE_MODAL_UPLOAD",UPLOAD_BACKGROUND_MODAL_UPLOAD:"UPLOAD_BACKGROUND_MODAL_UPLOAD"},L0="application/x-emailmaker-social-reorder",hd="fonts.googleapis.com",gd=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},mn=e=>{const t=gd(String(e??""));return t?t.hostname===hd&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},F0=e=>{const t=gd(String(e??""));if(!t||t.hostname!==hd)return"";const r=t.searchParams.get("family");return r?r.split(":")[0].trim():""},ka=e=>{const t=Number(e);return Number.isInteger(t)&&t>=100&&t<=900&&t%100===0?String(t):null},x0=e=>{const[t,r]=e.split("..");if(r===void 0){const i=ka(t);return i?[i]:[]}const n=[];for(let i=Math.ceil(Number(t)/100)*100;i<=Number(r);i+=100){const o=ka(String(i));o&&n.push(o)}return n},U0=e=>{const[t,r=""]=e.split("@"),n=t.split(","),i=n.indexOf("ital"),o=n.indexOf("wght");return r.split(";").flatMap(a=>{const s=a.split(","),c=i<0?["0"]:(s[i]??"").split(".."),l=o<0?["400"]:x0(s[o]??"");return c.flatMap(u=>l.map(d=>({weight:d,style:u==="1"?"italic":"normal"})))})},B0={regular:"400",bold:"700"},$0=e=>e.split(",").flatMap(t=>{const r=/^(\d+|regular|bold)?(italic|i)?$/i.exec(t.trim());if(!r||!r[1]&&!r[2])return[];const n=ka(B0[r[1]?.toLowerCase()??""]??r[1]??"400");return n?[{weight:n,style:r[2]?"italic":"normal"}]:[]}),q0=(e,t)=>{if(!mn(e))return[];const r=new URL(String(e).trim()),n=r.pathname.startsWith("/css2"),i=r.searchParams.getAll("family").flatMap(l=>n?[l]:l.split("|")).map(l=>{const u=l.indexOf(":");return u<0?{name:l.trim(),spec:""}:{name:l.slice(0,u).trim(),spec:l.slice(u+1)}}),o=t?.trim().toLowerCase(),a=o?i.find(l=>l.name.toLowerCase()===o):i[0];if(!a?.spec)return[];const s=n?U0(a.spec):$0(a.spec),c=new Set;return s.filter(l=>{const u=`${l.weight}/${l.style}`;return c.has(u)?!1:(c.add(u),!0)})},ne={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_IMAGE_RESET:C.createIdentifier("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:C.createIdentifier("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:C.createIdentifier("application_subject_update"),APPLICATION_PREHEADER_UPDATE:C.createIdentifier("application_preheader_update"),APPLICATION_DOMPARSER_ERROR:C.createIdentifier("application_domparser_error"),APPLICATION_SYNC_DRIFT:C.createIdentifier("application_sync_drift"),APPLICATION_UPDATE_ENTITY:C.createIdentifier("application_update_entity"),APPLICATION_IFRAME_DRAG_EVENT:C.createIdentifier("application_iframe_drag_event"),APPLICATION_HAS_AMP:C.createIdentifier("application_has_amp"),APPLICATION_CANVAS_IMAGE_GET:C.createIdentifier("application_canvas_image_get"),APPLICATION_PREVIEW_ALERT_SHOW:"application_preview_alert_show",APPLICATION_ATOM_INSERTED:C.createIdentifier("application_atom_inserted"),APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW:"application_template_not_em_alert_show",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",SANDBOX_FLOATBLOCK_COPY:"sandbox_floatBlock_copy",SANDBOX_FLOATBLOCK_SWAP:"sandbox_floatBlock_swap",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:C.createIdentifier("SANDBOX_READY"),SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_FLOATBLOCK_DIR:"sandbox_floatblock_dir",SANDBOX_SUBJECT_UPDATE:C.createIdentifier("sandbox_subject_update"),SANDBOX_PREHEADER_UPDATE:C.createIdentifier("sandbox_preheader_update"),SANDBOX_DRAG_EVENT:C.createIdentifier("sandbox_drag_event"),SANDBOX_WHEEL:C.createIdentifier("sandbox_wheel"),SANDBOX_TRANSLATIONS:C.createIdentifier("sandbox_send_translations"),SANDBOX_SET_THEME_VARIABLES:C.createIdentifier("sandbox_send_theme_variables"),SANDBOX_SET_PROJECT_FONTS:C.createIdentifier("sandbox_set_project_fonts"),SANDBOX_CANVAS_IMAGE_CACHE_SETUP:C.createIdentifier("sandbox_canvas_image_cache_setup"),SANDBOX_SET_ENTITY:C.createIdentifier("sandbox_set_entity"),SANDBOX_INIT_START:C.createIdentifier("sandbox_init_start"),SANDBOX_INITED:C.createIdentifier("sandbox_inited"),SANDBOX_UPDATE_ENTITY:C.createIdentifier("sandbox_update_entity"),RELOAD:C.createIdentifier("reload"),SANDBOX_ADD_EXTENSIONS:C.createIdentifier("sandbox_add_extensions"),SANDBOX_REMOVE_EXTENSIONS:C.createIdentifier("sandbox_remove_extensions"),SANDBOX_ADD_SCRIPT:C.createIdentifier("sandbox_add_script"),SANDBOX_IS_EMAIL_EMPTY:C.createIdentifier("sandbox_is_email_empty"),SANDBOX_SWITCH_THEME:"sandbox_switch_theme",SANDBOX_CANVAS_HEALTH:C.createIdentifier("sandbox_canvas_health"),SANDBOX_CANVAS_SYNCED:C.createIdentifier("sandbox_canvas_synced")},z0={language:"html",detectIndentation:!1,wordWrap:"on",wrappingIndent:"same",smoothScrolling:!0,automaticLayout:!0,tabSize:2,indentSize:2},Pr=(function(e){return e.IMG="img",e.TEXT="text",e.LINK="a",e.TABLE="table",e.VINDENT="vindent",e.TD="td",e.STRUCTURE="structure",e.GROUP="group",e.BUTTON="button",e.DIV="div",e.FLOAT_BLOCK="floatBlock",e.VAR="var",e.EMPTY_TABLE="emptyTable",e.EMPTY_TD="emptyTd",e.COUNTDOWN="countdown",e.VIDEO="video",e.COLUMN="column",e.CAROUSEL="carousel",e.ACCORDION="accordion",e.CUSTOM_TABLE="customTable",e.SOCIAL="social",e})({}),G0={ALL:"All",STANDARD:"Standard",PROJECT:"Project"},H0="Appearance",V0="Structure",W0="Settings",yd="Properties",K0="History",Q0="Disabled_tab",_d="Edit selected element",Y0="UTM parameters",X0="Annotations parameters",J0="Table properties",Z0="Edit selected table cells",eS="#b9b1b1",tS="Edit",rS="AiChat",ja="Build",vd="Styles",nS="Discuss",iS="Blocks",oS="Atoms",aS="Optimise",sS={top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null},all:{width:null,style:null,color:null}},lS="block",bd="email",Ed="cards",cS="pending",uS="d41d8",dS="valid",fS="warnings",pS="errors",mS={LINKS:"Links",IMAGES:"Images",SPAM_ASSASSIN:"Spam assassin",PROBLEMS:"Problems"},hS="1865",wd=127017,Sd="desktop",Pd="mobile",gS="emailtags",yS="blocktags",_S=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")}),vS={Applications:"Apps",Articles:"Article",Banners:"Banners",Buttons:"Buttons","Call to Action":"Call to Action",Contacts:"Contacts",Content:"Content","E-Commerce":"E-Commerce",Feature:"Features",Footer:"Footers",Header:"Headers",Lists:"Lists",Menu:"Menus",Other:"Others",Polls:"Polls",Promocodes:"Promocodes",Separators:"Separators"},Id={maker:"https://ai-mail.emcdn.ru",blocks:"https://ai-mail.useblocks.io"},bS=/^(?:ant|vscode|monaco|docs)-/;function ES(e){return bS.test(e)}function wS(){const e="em".trim();if(!/^[a-z][a-z0-9]*$/i.test(e))throw new Error(`[cssVars] REACT_APP_CSS_VAR_PREFIX="${e}" is not a valid CSS identifier fragment.`);return e}var SS=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function PS(){return SS}var IS=new Set;function TS(e,t,r=IS){return e.startsWith(`${t}-`)?!1:!ES(e)&&!r.has(e)}function CS(e,t){return`--${t}-${e}`}function Ir(e){const t=wS();return TS(e,t,PS())?CS(e,t):`--${e}`}function OS(e,t){const r=Ir(e);return t!==void 0?`var(${r}, ${t})`:`var(${r})`}function AS(e,t){return OS(e,t)}function MS(e){return Ir(e)}var Td=C.INJECTION,kS=e=>e??C.createIdentifier$1();function Se(){const e=se();return(0,b.useMemo)(()=>C.getContainer(e),[e])}function jS(e,t){const r=se(),n=(0,b.useMemo)(()=>t||C.getContainer(r),[r,t]),[i,o]=(0,b.useState)(()=>n?.getInstance(e));return(0,b.useEffect)(()=>{const a=n?.onInject(s=>{s===e&&o(n.getInstance(e))});return()=>a?.dispose()},[e,n]),i}function RS(e,t){const r=se(),n=(0,b.useMemo)(()=>t||C.getContainer(r),[r,t]),[i,o]=(0,b.useState)(()=>n?.getServices(e)||[]);return(0,b.useEffect)(()=>{if(!n)return;const a=n.onInject(s=>{s===C.getServiceContainerId(e)&&o(n.getServices(e))});return()=>{a?.dispose()}},[e,n]),i}function Cd(e,t){return e.user.mode||e.serverSide.mode||t||"pro"}function NS(e,t){const r=Cd(e,t);return e.serverSide.advancedConfigs?.[r]||{}}function DS(e,t){const r=Cd(e,t),n=e.user?.advancedConfigs?.[r],i=n!==void 0?n:e.user?.advancedConfigs?.pro;return{...e.advancedConfigs?.[r],...i}}function Od(e,t,r){const n=NS(e,r),i=DS(e,r);return C.pickKey([i,e.user,n,e.serverSide],t)}var LS=C.createIdentifier$1("planFeatures.source");function FS(e){return e.getOrCreateInstance(LS,()=>it(void 0))}function xS(e,t){if(e&&Object.prototype.hasOwnProperty.call(e,t))return!!e[t]}function $t(e){return e?.getInstance(C.CONFIG_SOURCE_ID)?.get()??{}}function Ra(){const e=Se().getInstance(C.CONFIG_SOURCE_ID);if(!e)throw new Error("[config] источник конфигурации не зарегистрирован: нет provideConfig");return e}function st(){const e=Ra();if(e.get()===void 0)throw e.ready();const t=(0,b.useCallback)(i=>{const o=e.watch(i);return()=>o.dispose()},[e]),r=(0,b.useSyncExternalStore)(t,()=>e.get()),n=US();return(0,b.useMemo)(()=>r,[r,n])}function US(){const e=Se(),t=FS(e),r=(0,b.useCallback)(n=>{const i=t.watch(n);return()=>i.dispose()},[t]);return(0,b.useSyncExternalStore)(r,()=>t.get())}function Ad(e){const t=Ra();return st(),Od(t.layers(),e)}function Na(){const e=Se(),t=(0,b.useCallback)(n=>{if(!e)return()=>{};const i=ui(e).watch(n);return()=>i.dispose()},[e]),r=(0,b.useCallback)(()=>Yc(e),[e]);return(0,b.useSyncExternalStore)(t,r,r)}function BS(e){return e.hasOwnProperty("children")}function Md(e){return e?.length?e.map(t=>BS(t)?{key:C.generateUUID(),value:t.value,label:t.label,children:Md(t.children),type:"group"}:{key:C.generateUUID(),label:t.label,value:t.value}):void 0}var kd=(0,b.createContext)({element:void 0}),Da=()=>(0,b.useContext)(kd)?.element,jd=(0,b.createContext)(void 0),$S=()=>(0,b.useContext)(jd),Rd=(0,b.createContext)(!1),qS=()=>(0,b.useContext)(Rd);function Di(e){return C.createIdentifier$1(e)}function hn(e,t){return e.getOrCreateInstance(t,()=>new C.AsyncEmitter)}function zS(e,t){return e.getOrCreateInstance(t,()=>new C.AsyncEmitter).event}function Nd(e){return Tt(e).event}function Tt(e){const t=se();return(0,b.useMemo)(()=>hn(C.getContainer(t),e),[t,e])}var Dd=class{_listeners=[];add(e,t=0,r){const n={fn:r?e.bind(r):e,priority:t};return this._listeners.push(n),{dispose:()=>{const i=this._listeners.indexOf(n);i>=0&&this._listeners.splice(i,1)}}}async run(e){const t=[...this._listeners].sort((r,n)=>n.priority-r.priority);for(const{fn:r}of t){const n=await r(e);n!==null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof Date)&&!(n instanceof RegExp)&&Object.assign(e,n)}return e}},GS=C.createIdentifier$1("ELEMENT_INSERT_HTML_PIPELINE"),HS=C.createIdentifier$1("BLOCK_INSERT_HTML_PIPELINE");function VS(e){return e.getOrCreateInstance(GS,()=>new Dd)}function WS(e){return e.getOrCreateInstance(HS,()=>new Dd)}async function Ld(e,t){return e?VS(e).run({...t}):t}async function Fd(e,t){return e?WS(e).run({...t}):t}var xd=C.createIdentifier$1("ComponentRegistry"),KS=C.createIdentifier$1("ComponentRegistryGate");function Ud(){return C.DependencyResolver.getOrCreateInstance(KS,()=>({pending:[]}))}function QS(e){const t=Ud();t.factory=e;const r=t.pending.splice(0,t.pending.length);for(const n of r)try{n()}catch{}}function YS(e,t=xd){const r=C.DependencyResolver.getInstance(t);if(r)return r;const n=Ud().factory;if(!n)throw new Error("[extensions] component registry is not loaded yet — UI work starts at init()");return C.DependencyResolver.getOrCreateInstance(t,n)}var XS=class{_factories=new Map;add(e,t){const r=e;return this._factories.set(r,t),{dispose:()=>{this._factories.get(r)===t&&this._factories.delete(r)}}}get(e){return this._factories.get(e)}},Bd=C.createIdentifier$1("DomComponentRegistry");function JS(e,t=Bd){return C.DependencyResolver.getOrCreateInstance(t,()=>new XS)}function ZS(e){return typeof e=="function"}function Tr(e){return(0,b.isValidElement)(e)}function eP(e){return typeof e=="function"||Tr(e)}function tP(e){return typeof e=="object"&&e!==null&&"type"in e&&"props"in e&&!Tr(e)}function La(e,t){return(0,b.createElement)(e,t)}function rP(e){return class extends b.Component{_ref=(0,b.createRef)();_instance;componentDidMount(){this._ref.current&&(this._instance=e(this.props),this._ref.current.appendChild(this._instance.node))}componentDidUpdate(r){this._instance?.update&&this._instance.update(this.props)}componentWillUnmount(){this._instance?.dispose&&this._instance.dispose()}render(){return(0,b.createElement)("div",{ref:this._ref})}}}var nP=class{_domComponentRegistry;_components=new Map;_domAdapters=new Map;constructor(e){this._domComponentRegistry=e}add(e,t){return this.override(e,()=>t)}addDom(e,t){const r=e;this._domAdapters.delete(r);const n=this._domComponentRegistry.add(e,t);return{dispose:()=>{this._domAdapters.delete(r),n.dispose()}}}override(e,t){const r=e;let n=this._components.get(r);n||(n={replacers:[]},this._components.set(r,n));const i=()=>{const o=n.replacers.findIndex(a=>a.replacer===t);o>=0&&(n.replacers.splice(o,1),this._recomputeComponent(r,n))};return n.replacers.push({replacer:t,dispose:i}),this._recomputeComponent(r,n),{dispose:i}}_recomputeComponent(e,t){t.component=t.replacers.reduce((r,{replacer:n})=>n(r),void 0)}get(e){if(eP(e))return e;const t=e,r=this._components.get(t);if(r?.component)return r.component;const n=this._domComponentRegistry.get(e);if(n){let i=this._domAdapters.get(t);return i||(i=rP(n),this._domAdapters.set(t,i)),i}}_resolveComponentInput(e){if(e==null)return null;if(typeof e=="number"||typeof e=="boolean"||Tr(e))return e;if(typeof e=="string"){const t=this.get(e);return Tr(t)?t:t?La(t):e}if(ZS(e))return La(e);if(tP(e)){const t=this.get(e.type);return Tr(t)?t:t?La(t,e.props):null}return null}getReactNode(e){return this._resolveComponentInput(e)}getReactElement(e){const t=this._resolveComponentInput(e);return Tr(t)?t:typeof t=="string"||t==null||typeof t=="boolean"||typeof t=="number"?(0,b.createElement)(b.Fragment,null,t):(0,b.createElement)(b.Fragment,null)}},$d=()=>new nP(JS(C.DependencyResolver,Bd));QS($d),C.DependencyResolver.getOrCreateInstance(xd,$d);function Fa(e){"@babel/helpers - typeof";return Fa=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},Fa(e)}function qd(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}var iP=365.2425,oP=Math.pow(10,8)*24*60*60*1e3,zd=6e4,Gd=36e5,tz=-oP,aP=3600,Hd=aP*24,rz=Hd*7,sP=Hd*iP,lP=sP/12,nz=lP*3;function cP(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Vd(e,t){var r;qd(1,arguments);var n=cP((r=t?.additionalDigits)!==null&&r!==void 0?r:2);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var i=pP(e),o;if(i.date){var a=mP(i.date,n);o=hP(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),c=0,l;if(i.time&&(c=gP(i.time),isNaN(c)))return new Date(NaN);if(i.timezone){if(l=yP(i.timezone),isNaN(l))return new Date(NaN)}else{var u=new Date(s+c),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(s+c+l)}var Li={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},uP=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,dP=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,fP=/^([+-])(\d{2})(?::?(\d{2}))?$/;function pP(e){var t={},r=e.split(Li.dateTimeDelimiter),n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],Li.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Li.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){var i=Li.timezone.exec(n);i?(t.time=n.replace(i[1],""),t.timezone=i[1]):t.time=n}return t}function mP(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};var i=n[1]?parseInt(n[1]):null,o=n[2]?parseInt(n[2]):null;return{year:o===null?i:o*100,restDateString:e.slice((n[1]||n[2]).length)}}function hP(e,t){if(t===null)return new Date(NaN);var r=e.match(uP);if(!r)return new Date(NaN);var n=!!r[4],i=gn(r[1]),o=gn(r[2])-1,a=gn(r[3]),s=gn(r[4]),c=gn(r[5])-1;if(n)return wP(t,s,c)?_P(t,s,c):new Date(NaN);var l=new Date(0);return!bP(t,o,a)||!EP(t,i)?new Date(NaN):(l.setUTCFullYear(t,o,Math.max(i,a)),l)}function gn(e){return e?parseInt(e):1}function gP(e){var t=e.match(dP);if(!t)return NaN;var r=xa(t[1]),n=xa(t[2]),i=xa(t[3]);return SP(r,n,i)?r*Gd+n*zd+i*1e3:NaN}function xa(e){return e&&parseFloat(e.replace(",","."))||0}function yP(e){if(e==="Z")return 0;var t=e.match(fP);if(!t)return 0;var r=t[1]==="+"?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return PP(n,i)?r*(n*Gd+i*zd):NaN}function _P(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var i=n.getUTCDay()||7,o=(t-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}var vP=[31,null,31,30,31,30,31,31,30,31,30,31];function Wd(e){return e%400===0||e%4===0&&e%100!==0}function bP(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(vP[t]||(Wd(e)?29:28))}function EP(e,t){return t>=1&&t<=(Wd(e)?366:365)}function wP(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function SP(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function PP(e,t){return t>=0&&t<=59}var IP=Object.freeze({});function TP(){return null}function or(){return IP}function CP(){return""}function Ua(){return OP}function OP(){}function AP(){return(0,b.useMemo)(()=>({get:()=>null,set:()=>{}}),[])}function Ba(e){return e.getOrCreateInstance(C.MESSAGE_SERVICE_ID,()=>new C.MessageService)}var MP=new WeakMap,Kd=new WeakMap;function kP(e){return MP.get(e)??0}function jP(e,t){let r=Kd.get(e);return r||(r=new Set,Kd.set(e,r)),r.add(t),()=>{r?.delete(t)}}var Qd=new Set(["email","block"]),RP=new Set(["block","structure","atom"]),NP=new Set(["simple","editor","pro"]),DP=new Set(["code","visual"]),LP=new Set(["left","right","bottom","none","toggle"]),Yd=new Set(["element","icon","text"]),FP=new Set(["html","text","markdown","clipboard","image","outlook","zip"]),xP=new Set(["width","height","padding","margin","font_size","line_height","letter_spacing","border_radius","opacity","text_align","color","background_color","border_color","text_color"]),UP=/^[A-Za-z][\w-]{0,63}$/;function $a(e){return typeof e=="string"?e:""}function yn(e){return typeof e=="string"&&UP.test(e)?e:void 0}function Ct(e,t){return typeof t=="string"&&e.has(t)?t:void 0}function ve(e){return()=>({name:e,properties:{}})}function qt(e){return t=>({name:e,properties:{entity_type:Ct(Qd,t.entity_type)}})}function Cr(e,t){return r=>({name:e,properties:Object.fromEntries(Object.entries(t).map(([n,i])=>{const o=r[i];return[n,typeof o=="string"?yn(o):o]}))})}function BP(e,t){if(typeof t=="number"||typeof t=="boolean")return t;const r=e.replace(/^mobile_/,"");return xP.has(r)||r.endsWith("_unit")?t:void 0}var $P={"save/save_email":ve("editor_email_saved"),"click/save_block":ve("editor_block_saved"),"click/click_back_button":qt("editor_back_clicked"),"delete/delete_email":ve("editor_email_deleted"),"click/click_delete_email_menu_item":ve("editor_email_delete_clicked"),"open/open_delete_email_modal":ve("editor_email_delete_modal_opened"),"click/duplicate_email":ve("editor_email_duplicate_clicked"),"duplicate/duplicate_email_success":ve("editor_email_duplicated"),"click/import_email":ve("editor_email_import_clicked"),"upload_file/import_email":ve("editor_email_imported"),"click/export_email":e=>{const t=Ct(FP,typeof e.export_type=="string"?e.export_type.toLowerCase():void 0);return t?{name:"editor_email_exported",properties:{format:t}}:null},"lock/lock_email":ve("editor_email_locked"),"unlock/unlock_email":ve("editor_email_unlocked"),"lock/lock_block":ve("editor_block_locked"),"unlock/unlock_block":ve("editor_block_unlocked"),"add/add_element_to_email":e=>{const t=Ct(RP,e.element_type);return t?{name:"editor_element_added",properties:{element_type:t}}:null},"change/element_setting":e=>{const t=yn(e.element_type),r=yn(e.property);return!t||!r?null:{name:"editor_element_setting_changed",properties:{element_type:t,property:r,value:BP(r,e.property_value)},coalesceKey:`${t}:${r}`}},"change/change_email_size":e=>({name:"editor_canvas_resized",properties:{width:e.width,view_type:e.view_type},coalesceKey:$a(e.view_type)}),"navigate/navigate_email_pane_tab":e=>({name:"editor_pane_tab_opened",properties:{tab:e.tab_name==="DISABLED_TAB"?"disabled_tab":yn(e.tab_name)}}),"change/change_config_mode":e=>({name:"editor_config_mode_changed",properties:{mode:Ct(NP,e.config_mode)}}),"change/change_editor_mode":e=>({name:"editor_mode_changed",properties:{mode:Ct(DP,e.editor_mode)}}),"activate/activate_code_mode":e=>({name:"editor_code_mode_activated",properties:{entity_type:Ct(Qd,e.entity_type),direction:Ct(LP,e.code_mode_direction??"toggle")}}),"click/click_breadcrumb_email":e=>({name:"editor_breadcrumb_clicked",properties:{target:Ct(Yd,e.click_target)}}),"click/click_breadcrumb_element":e=>({name:"editor_breadcrumb_clicked",properties:{target:Ct(Yd,e.click_target),element_type:yn(e.element_type),element_index:e.element_index}}),"check/check_email_code":Cr("editor_code_checked",{problems_count:"problems_count"}),"check/check_email_links":Cr("editor_links_checked",{links_count:"links_count"}),"check/check_email_images":Cr("editor_images_checked",{images_count:"images_count"}),"check/check_email_spam":Cr("editor_spam_checked",{spam_score:"spam_score"}),"click/open_email_preview":qt("editor_preview_opened"),"open/open_test_email_modal":qt("editor_test_email_modal_opened"),"submit/send_test_email":Cr("editor_test_email_sent",{recipients_count:"recipients_count"}),"click/share_email":qt("editor_email_shared"),"click/open_email_inbox_tests":qt("editor_inbox_tests_opened"),"open/open_version_control":qt("editor_version_history_opened"),"click/open_web_version":qt("editor_web_version_opened"),"submit_form/chat_whit_ai_assistant":ve("editor_ai_message_sent"),"select/select_ai_assistant_role":Cr("editor_ai_role_selected",{role:"context"}),"submit/insert_generated_subject":ve("editor_ai_subject_inserted"),"submit/insert_generated_preheader":ve("editor_ai_preheader_inserted"),"submit/send_discussion_chat_message":qt("editor_ai_reply_received"),"submit_form/ai_image_generation":ve("editor_ai_image_generation_started")};function qP(e,t){const r=$P[`${$a(e.event)}/${$a(e.action)}`],n=r?.(e)??null;if(!n)return null;const i=Object.fromEntries(Object.entries(n.properties).filter(([,o])=>o!==void 0));return{...n,...t?{name:t}:{},properties:i}}var zP=/((^|[_ ])e-?mail$|hash$|token|passw|secret|^key$|^code$)/i,GP=/^(utm_[a-z_]+|gclid|signup|template|templateId)$/,HP=/^(https?:\/\/|\/)/;function VP(e){if(!HP.test(e))return e;const t=e.indexOf("#"),r=t===-1?"":e.slice(t),n=t===-1?e:e.slice(0,t),i=n.indexOf("?");if(i===-1)return e;const o=n.slice(i+1).split("&").filter(s=>GP.test(WP(s.split("=")[0]??""))),a=o.length===0?"":`?${o.join("&")}`;return`${n.slice(0,i)}${a}${r}`}function WP(e){try{return decodeURIComponent(e)}catch{return e}}function Xd(e){return typeof e=="string"?VP(e):Array.isArray(e)?e.map(Xd):e!==null&&typeof e=="object"?Jd(e):e}function Jd(e){const t={};for(const[r,n]of Object.entries(e))zP.test(r)||(t[r]=Xd(n));return t}var KP={editor_layout_convert_offered:["source","trigger"],editor_layout_convert_declined:["source","trigger","never_suggest"],editor_layout_convert_started:["source","method","trigger"],editor_layout_convert_succeeded:["source","method","trigger","duration_ms","fallback_to_ai"],editor_layout_convert_failed:["source","method","trigger","duration_ms","error_code"],editor_email_saved:[],editor_block_saved:[],editor_back_clicked:["entity_type"],editor_email_deleted:[],editor_email_delete_clicked:[],editor_email_delete_modal_opened:[],editor_email_duplicate_clicked:[],editor_email_duplicated:[],editor_email_import_clicked:[],editor_email_imported:[],editor_email_exported:["format"],editor_email_locked:[],editor_email_unlocked:[],editor_block_locked:[],editor_block_unlocked:[],editor_element_added:["element_type"],editor_element_setting_changed:["element_type","property","value"],editor_canvas_resized:["width","view_type"],editor_pane_tab_opened:["tab"],editor_config_mode_changed:["mode"],editor_mode_changed:["mode"],editor_code_mode_activated:["entity_type","direction"],editor_breadcrumb_clicked:["target","element_type","element_index"],editor_code_checked:["problems_count"],editor_links_checked:["links_count"],editor_images_checked:["images_count"],editor_spam_checked:["spam_score"],editor_preview_opened:["entity_type"],editor_test_email_modal_opened:["entity_type"],editor_test_email_sent:["recipients_count"],editor_email_shared:["entity_type"],editor_inbox_tests_opened:["entity_type"],editor_version_history_opened:["entity_type"],editor_web_version_opened:["entity_type"],editor_ai_message_sent:[],editor_ai_reply_received:[],editor_ai_role_selected:["role"],editor_ai_subject_inserted:[],editor_ai_preheader_inserted:[],editor_comment_sent:["entity_type"],editor_ai_image_generation_started:[]},iz=600,Zd=new WeakMap;function QP(e,t,r,n={}){ef(e,{name:t,properties:r,coalesceKey:n.coalesceKey})}function ef(e,t){try{YP(e,t.name,t.properties,t)}catch{}}function YP(e,t,r,n){const i={name:t,properties:XP(t,r)};if(n.coalesceKey===void 0){tf(e,i);return}const o=Zd.get(e)??new Map;Zd.set(e,o);const a=`${t}:${n.coalesceKey}`;clearTimeout(o.get(a)),o.set(a,setTimeout(()=>{o.delete(a),tf(e,i)},600))}function XP(e,t){const r=t,n={};for(const i of KP[e]){const o=r[i];(typeof o=="string"||typeof o=="number"||typeof o=="boolean")&&(n[i]=o)}return Jd(n)}function tf(e,t){hn(e,C.events.ON_ANALYTICS_EVENT).fire(t).catch(()=>{})}function JP(){const e=Se();return(0,b.useCallback)((t,r,n)=>{e&&QP(e,t,r,n)},[e])}function rf(){const e=Se();return(0,b.useCallback)((t,r)=>{const n=e&&qP(t,r);n&&ef(e,n)},[e])}var ZP=(e,t)=>{const r=()=>{try{const n={...e,appLabel:"blocks_app"};window.dataLayer&&typeof window.dataLayer.push=="function"&&window.dataLayer.push(n);const i=typeof n.event=="string"&&n.event.trim()?n.event.trim():null,o=(typeof n.action=="string"&&n.action.trim()?n.action.trim():null)||(typeof n.event_action=="string"&&n.event_action.trim()?n.event_action.trim():null);let a;i&&o?a=`${i}_${o}`:i?a=i:o?a=o:a="event";const{event:s,action:c,...l}=n;"event_action"in l&&delete l.event_action;const u={...l,...i?{event:i}:{},...o?{action:o}:{}};typeof window<"u"&&window.amplitude&&typeof window.amplitude.track=="function"&&window.amplitude.track(a,u)}catch{}};t?setTimeout(r,t):r()},mt=()=>{const e=st(),t=rf();return(0,b.useCallback)((r,n,i)=>{e.pushToGTM!==!1&&ZP(r,n),t(r,i?.analyticsName)},[e.pushToGTM,t])},eI="change",tI="element_setting",rI={textStrong:"bold",textItalic:"italic",textUnderline:"underline",textStrikethrough:"strikethrough",textSuperscript:"superscript",textSubscript:"subscript",widthDim:"width_unit",heightDim:"height_unit",fontSizeDim:"font_size_unit",lineHeightDim:"line_height_unit",letterSpacingDim:"letter_spacing_unit"},nI=new Set(["width","height","padding","margin","font_size","line_height","letter_spacing","border_radius","border","box_shadow","opacity","color","background_color","border_color","text_color"]),iI=new Set(["activateSection","changeKey","classNamePrefix","parent","path","type","caption","deletable","nextElem","prevElem","floatBlocks","usedColors"]),oI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").toLowerCase(),aI=e=>rI[e]??oI(e),qa=e=>e.length>100?e.slice(0,100):e,sI=e=>{if(e==null)return null;const t=typeof e;if(t==="boolean"||t==="number")return e;if(t==="string")return qa(e);if(t==="object"){const r=e;if("value"in r){const n=typeof r.dim=="string"?r.dim:"",i=r.value===null||r.value===void 0?"":String(r.value);return qa(`${i}${n}`)}try{return qa(JSON.stringify(r))}catch{return null}}return null},lI=(e,t)=>{if(!e||!t||typeof t!="object")return[];const r=[];for(const[n,i]of Object.entries(t))iI.has(n)||i===void 0||r.push({event:eI,action:tI,element_type:e,property:aI(n),property_value:sI(i)});return r},cI=e=>nI.has(e),uI=(e,t=600)=>{const r=new Map,n=new Map,i=s=>{const c=r.get(s);c&&(clearTimeout(c),r.delete(s));const l=n.get(s);l&&(n.delete(s),e(l))};return{track:(s,c)=>{const l=lI(s,c);for(const u of l){if(!cI(u.property)){e(u);continue}const d=`${u.element_type}:${u.property}`,f=r.get(d);f&&clearTimeout(f),n.set(d,u),r.set(d,setTimeout(()=>i(d),t))}},flush:()=>{Array.from(r.keys()).forEach(s=>i(s))}}},za=new Set;function dI(){za.forEach(e=>e())}function fI(e){return za.add(e),()=>{za.delete(e)}}function Ge(){const e=se();return(0,b.useMemo)(()=>Ba(C.getContainer(e)),[e])}function Or(){const e=Ge(),t=mt(),r=(0,b.useRef)(t);r.current=t;const n=(0,b.useRef)(void 0);return n.current||(n.current=uI(i=>r.current(i))),(0,b.useCallback)(function(i){e.send(i),i?.operation===ne.SANDBOX_ELEMENT_SETTINGS_SET&&dI(),i?.operation===ne.SANDBOX_ELEMENT_SETTINGS_SET&&i.type&&i.settings&&typeof i.settings=="object"&&n.current?.track(i.type,i.settings)},[e])}function pI(){const e=Ge();return(0,b.useCallback)(function(t,r){e.send(t,r)},[e])}var nf=["title","slug","type","tags","blocktags","modified","author","lock","subject","description","excerpt","status","is_template","link","renderGuid","date","date_gmt","modified_gmt","comment_status","ping_status","template","related_email","project_title","project_author","isAmp","meta"],mI=[...nf,"html","id","project","password"],Ga=new Set(["html",...nf,"global_block","project"]),hI=new Set(["title","slug","type","modified","author","subject","description","excerpt","status","link","renderGuid","date","date_gmt","modified_gmt","comment_status","ping_status","template","related_email","project_title","project_author"]),gI=new Set(["tags","blocktags","lock","is_template","isAmp","global_block"]);function of(e,t){return Ga.has(e)?e==="html"?typeof t=="string":e==="meta"?t!=null&&typeof t=="object":e==="project"?t!=null:hI.has(e)?t!=null&&t!=="":gI.has(e)?t!=null:t!==void 0:!1}function yI(e){if(!e||typeof e!="object")return{};const t={};e.id!=null&&e.id!==""&&(t.id=String(e.id)),e.title!=null&&e.title!==""&&(t.title=e.title),e.slug!=null&&e.slug!==""&&(t.slug=e.slug),e.type!=null&&e.type!==""&&(t.type=e.type),e.tags!=null&&(t.tags=e.tags),e.blocktags!=null&&(t.blocktags=e.blocktags),e.modified!=null&&e.modified!==""&&(t.modified=e.modified),e.author!=null&&e.author!==""&&(t.author=String(e.author)),e.lock!=null&&(t.lock=e.lock),e.subject!=null&&e.subject!==""&&(t.subject=e.subject),e.description!=null&&e.description!==""&&(t.description=e.description),e.excerpt!=null&&e.excerpt!==""&&(t.excerpt=e.excerpt),e.status!=null&&e.status!==""&&(t.status=e.status),e.is_template!=null&&(t.is_template=e.is_template),e.link!=null&&e.link!==""&&(t.link=e.link),e.renderGuid!=null&&e.renderGuid!==""&&(t.renderGuid=e.renderGuid),e.date!=null&&e.date!==""&&(t.date=e.date),e.date_gmt!=null&&e.date_gmt!==""&&(t.date_gmt=e.date_gmt),e.modified_gmt!=null&&e.modified_gmt!==""&&(t.modified_gmt=e.modified_gmt),e.comment_status!=null&&e.comment_status!==""&&(t.comment_status=e.comment_status),e.ping_status!=null&&e.ping_status!==""&&(t.ping_status=e.ping_status),e.template!=null&&e.template!==""&&(t.template=e.template),e.related_email!=null&&e.related_email!==""&&(t.related_email=e.related_email),e.project_title!=null&&e.project_title!==""&&(t.project_title=e.project_title),e.project_author!=null&&e.project_author!==""&&(t.project_author=e.project_author),e.isAmp!=null&&(t.isAmp=e.isAmp),e.meta!==void 0&&e.meta!==null&&typeof e.meta=="object"&&(t.meta=e.meta);const r=new Set(mI),n={};for(const i of Object.keys(e))r.has(i)||(n[i]=e[i]);return Object.keys(n).length>0&&(t.catalogExtra=n),t}function af(e,t){return{...yI(e),html:t.html||"",insertFrom:t.insertFrom,fragmentRole:t.fragmentRole,name:t.name,project:t.project}}var _I=class extends C.BaseEmitter{async execute([e],t){for(const r of t){const n=await r(e);n&&(n.id===void 0&&(n.id=e.value.id),e.value=n)}return e.value}},vI=class extends C.AsyncEmitter{};function oz(e){return e}var sf=class extends C.Disposable{_items=new Map;_onChangeEmitter=new C.Signal;async _getOrCreate(e,t){const r=this._items;let n;if(r.has(e))try{n=await r.get(e)}catch{t&&(n=await t())}else t&&(n=await t(),n&&this._onChangeEmitter.fire());return n}async _addOrUpdate(e,t){let r;const n=this._items;if(n.has(e))try{r=await n.get(e)}catch{}const i=await t(r);return C.deepEqual(r,i)||this._onChangeEmitter.fire(),i}entries(){return Promise.all([...this._items.entries()].map(([e,t])=>t.then(r=>[e,r]))).then(e=>e.filter(([t,r])=>!!r))}values(){return Promise.all([...this._items.values()].map(e=>e).filter(e=>!!e))}getOrCreate(e,t){const r=this._getOrCreate(e,()=>t(e));return this._items.set(e,r),r}addOrUpdate(e,t){const r=this._addOrUpdate(e,t);return this._items.set(e,r),r}async getIfPresent(e){if(this._items.has(e))try{return await this._items.get(e)}catch{return}}add(e,t){const r=Promise.resolve(t);return this._items.set(e,r),r}remove(e){if(this._items.has(e)){const t=this._items.get(e);return this._items.delete(e),this._onChangeEmitter.fire(),t}return Promise.resolve(void 0)}async setAll(e){try{this.suspendChange();const t=[],r=new Set(Array.from(e).map(([i,o])=>i)),n=(await this.entries()).filter(([i,o])=>!r.has(i));for(const[i,o]of e)t.push(this.addOrUpdate(i,()=>o)),r.add(i);for(const[i]of n)t.push(this.remove(i));return await Promise.all(t),n}finally{this.resumeChange()}}clear(){this._items.clear(),this._onChangeEmitter.fire()}suspendChange(){this._onChangeEmitter.suspend()}resumeChange(){this._onChangeEmitter.resume()}onChange=this._onChangeEmitter.event};function bI(e,{filter:t,order:r="asc",orderBy:n,page:i,pageSize:o=20}={}){const a=e.length;let s=e.length;if(t!==void 0){const c=Object.keys(t);e=e.filter(l=>{for(const u of c){const d=l[u],f=t[u];return u==="id"||typeof d!="string"?d===f:typeof f=="string"&&d.startsWith(f)}return!0}),s=e.length}return n&&(e=e.sort((c,l)=>(c[n]>l[n]?1:l[n]>c[n]?-1:0)*(r==="asc"?1:-1))),i!==void 0&&(e=e.slice(o*(i-1),o*i)),{data:e,filteredTotal:s,total:a,totalPages:Math.ceil(s/o)}}var EI=1e3;function lf(e,t,r=EI,n=0){if(n>r||e===t)return!0;if(typeof e!=typeof t||e===null||t===null)return!1;if(typeof e=="object"&&typeof t=="object"){if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(const a of i)if(!lf(e[a],t[a],r,n+1))return!1;return!0}return!1}function cf(e,t){if(!e||typeof e!="object")return t;if(!t||typeof t!="object")return{};const r={};for(const n of Object.keys(t)){const i=t[n],o=e[n];lf(i,o)||(r[n]=i)}return r}function wI(e=[]){if(e=e.filter(r=>r),e.length<=1)return e[0];const t=new Map;for(const r of e)for(const n of r)if(n.id!==void 0){const i=t.get(n.id)||{};t.set(n.id,{...i,...n})}return[...t].map(([r,n])=>n)}function SI(e,t){return uf(e)&&uf(t)?String(e)===String(t):e===t}function uf(e){return typeof e=="string"||typeof e=="number"}var PI=class extends C.Disposable{_cache=new sf;_readEmitter=new C.AsyncEmitter;_saveEmitter=this.addDisposable(new _I);_removeEmitter=this.addDisposable(new vI);_foreignCache=Object.create(null);async get(e){return this._cache.getOrCreate(e,async t=>Object.assign({id:e},...(await this._readEmitter.fire(e)).filter(r=>!!r)))}hasReadHandler(){return this._readEmitter.hasListeners()}get cache(){return this._cache}byForeignKey(e){let t=this._foreignCache[e];if(!t){const r=this.addDisposable(new C.Disposable);r.addDispose(()=>delete this._foreignCache[e]);const n=r.addDisposable(new sf),i=r.addDisposable(new C.AsyncEmitter);t=this._foreignCache[e]={get:async(o,a={})=>{await n.getOrCreate(o,async()=>{try{const c=wI(await i.fire(o))||[];for(const l of c)l[e]=o,await this._cache.add(l.id,l);return c}catch{return[]}});const s=(await this._cache.values()||[]).filter(c=>{const l=c[e];return l==null||SI(l,o)});return bI(s,a)},first(o,a={}){return t.get(o,{...a,page:1,pageSize:1}).then(({data:s})=>s[0])},handleRead:i.event,clear(){n.clear()},dispose(){r.dispose()}}}return t}async create(e,{source:t="",silent:r}={}){let n=e;return r||(n=await this._saveEmitter.fire({prev:void 0,patch:e,value:n,source:t})),n.id===void 0&&(n.id=C.generateUUID()),await this._cache.addOrUpdate(n.id,()=>n)}notifySave(e){return this._saveEmitter.fire(e)}async update(e,t,{source:r="",silent:n}={}){return this._cache.addOrUpdate(e,async i=>{const o=i?{...i,...t}:t;if(!n)return t=i?cf(i,t):t,await this._saveEmitter.fire({prev:i,patch:t,value:o,source:r})})}async remove(e,{source:t="",silent:r}={}){const n=await this._cache.remove(e);return r||await this._removeEmitter.fire({value:n,source:t}),n}refresh(){this._cache.clear();for(const e of Object.values(this._foreignCache))e.clear()}suspendChange(){this._cache.suspendChange()}resumeChange(){this._cache.resumeChange()}handlerRead=this._readEmitter.event;onSave=this._saveEmitter.event;onRemove=this._removeEmitter.event;onChange=this._cache.onChange};function _n(e){const t=C.createIdentifier$1(e);return r=>r.getOrCreateInstance(t,()=>new PI)}function II(e){const t=e.getInstance(C.STORE_ID);if(!t)throw new Error("Failed");return t}function df(e){const t=e.getInstance(C.DISPOSABLE_ID);if(!t)throw new Error("Failed");return t}var Ha=_n("plugin.dataSource.blocks"),ff=_n("plugin.dataSource.blockRevisions"),pf=_n("plugin.dataSource.comments"),TI=Di(),CI=Di(),mf=C.createIdentifier$1("EmailPort");function OI(e){return e.getInstance(mf)}function AI(e,t){e.inject(mf,t)}var Va={INIT_START:5e3,SET_ENTITY:12e3,PREHEADER:5e3,SUBJECT:5e3,INITED:5e3,UPDATE_ENTITY:5e3},hf=["INIT_START","SET_ENTITY","PREHEADER","SUBJECT","INITED"],Fi=2e4,MI=hf.reduce((e,t)=>e+Va[t],0),gf=Fi+MI+3e3;function kI(e){return hf.reduce((t,r)=>t+yf(r,e),0)}function yf(e,t){const r=t?.[e];return typeof r=="number"&&r>0?r:Va[e]}function jI(e){const t=e?.contentReady;return typeof t=="number"&&t>0?t:gf}function RI(e){const t=e?.sandboxReady;return typeof t=="number"&&t>0?t:Fi}function Wa(e=gf){return e+3e3}var _f=C.createIdentifier$1("EmailHistoryPort"),vf=C.createIdentifier$1("BlockHistoryPort");function bf(e){return e.getInstance(vf)}function NI(e,t){e.inject(vf,t)}function Ef(e){return e.getInstance(_f)}function DI(e,t){e.inject(_f,t)}var ar=class extends Error{reason;constructor(e){super(`[emailmaker] save refused: ${e}`),this.name="SaveRefusedError",this.reason=e}},wf=class extends Error{timeoutMs;constructor(e){super(`[emailmaker] handleEmailAutosave did not respond within ${e}ms — the autosave was not written`),this.timeoutMs=e,this.name="IntegratorAutosaveTimeoutError"}},Sf=class extends Error{timeoutMs;constructor(e,t="handleSaveEmail",r="email"){super(`[emailmaker] ${t} did not respond within ${e}ms — the ${r} was not saved`),this.timeoutMs=e,this.name="IntegratorSaveTimeoutError"}};function Pf(){return typeof navigator<"u"&&navigator.onLine===!1}function If(e){if(e==null)return[];const t=[e];if(typeof e!="object")return t;const r=e;if(r.error!=null&&(t.push(r.error),typeof r.error=="object")){const n=r.error;if(n.data!=null){t.push(n.data);const i=n.data;typeof n.data=="object"&&i.error!=null&&t.push(i.error)}n.error!=null&&t.push(n.error)}if(r.data!=null&&(t.push(r.data),typeof r.data=="object")){const n=r.data;n.error!=null&&t.push(n.error)}return r.innerException!=null&&t.push(r.innerException),t}function Tf(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("fetch")||r.includes("network")||r.includes("timeout")||r.includes("failed to fetch")||r.includes("load failed")||r.includes("networkerror")}if(e instanceof Error)return Tf(e.message);if(typeof e!="object")return!1;const t=e;return t.status==="FETCH_ERROR"||t.status==="TIMEOUT_ERROR"||t.status==="PARSING_ERROR"?!0:typeof t.status=="number"?t.status===0||t.status===408||t.status>=500:!1}function Cf(e){return Pf()?!0:If(e).some(Tf)}var Of=new WeakSet,Af=new WeakMap;function Mf(e){typeof e=="object"&&e!==null&&Of.add(e)}function LI(e,t){typeof e=="object"&&e!==null&&Af.set(e,t)}function FI(e){return typeof e=="object"&&e!==null?Af.get(e):void 0}function kf(e){return e instanceof Sf||e instanceof wf||typeof e=="object"&&e!==null&&Of.has(e)}function jf(e){return e instanceof ar||kf(e)}function xI(e){return e instanceof ar?e.reason==="canvas-not-synced":!jf(e)&&Cf(e)}var UI=({source:e,emailtags:t,group:r,tags:n,...i})=>i;async function BI(e,t){try{return{id:(await t(await e)).id}}catch{return}}async function $I({emails:e,saveTimeoutMs:t},r,n){const i=t?.()??Wa();let o;try{const a=e.notifySave(r);return await Promise.race([a,new Promise((s,c)=>{o=setTimeout(()=>{const l=new Sf(i);r.value.id,LI(l,BI(a,n)),c(l)},i)})])}catch(a){throw Mf(a),a}finally{o!==void 0&&clearTimeout(o)}}function qI(e){const{emails:t}=e,r=async(n,i)=>{const o=UI(i),a=n===void 0?void 0:await t.cache.getIfPresent(n),s=a?{...a,...o}:o,c=a?cf(a,o):o,l=u=>{const d=String(u.id??n??C.generateUUID()),f=u.id===void 0?{...u,id:d}:u;return t.cache.addOrUpdate(d,()=>f)};return await l(await $I(e,{prev:a,patch:c,value:s,source:i.source??""},l))};return{async readEmail(n){return await t.get(n)??null},async createEmail(n){const i=await r(void 0,n);return i?.renderGuid?i:{...i,renderGuid:C.generateUUID()}},async updateEmail(n,i){return await r(n,i)}}}var az=5e3,zI=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/;function GI(e){const t=e?.trim()??"";if(!zI.test(t))return Date.parse(t);const r=t.replace(" ","T");return Math.max(Date.parse(r),Date.parse(`${r}Z`))}function vn(e){return e?.length?[...e].sort((t,r)=>Date.parse(r.modified)-Date.parse(t.modified))[0]:null}function Ka(e,{freshSince:t}={}){return!(e?.isAutosave!==!0||!e?.html?.trim()||t!==void 0&&Date.parse(e.modified)<t-5e3)}function HI(e,t={}){const r=vn((e??[]).filter(n=>n?.html?.trim()));return Ka(r,t)?r:null}function Rf(e,t){const r=Date.parse(vn(e)?.modified??""),n=HI(e),i=Date.parse(n?.modified??""),o=t===void 0||Number.isFinite(i)&&i>t,a=[r,t??NaN].filter(s=>Number.isFinite(s));return{autosave:o?n:null,...a.length?{latestAt:Math.max(...a)}:{}}}function Qa(e,t,r){const n=vn((e??[]).filter(c=>c?.html?.trim())),i=Date.parse(n?.modified??""),o=Date.parse(vn((r??[]).filter(c=>c?.html?.trim()))?.modified??""),a=n&&Number.isFinite(i)&&(t===void 0||i>t)&&!(o>i),s=[Date.parse(vn(e??[])?.modified??""),t??NaN].filter(c=>Number.isFinite(c));return{autosave:a&&Ka(n)?n:null,...s.length?{latestAt:Math.max(...s)}:{}}}function VI({hasUnsavedUserEdit:e}){return e?"skip":"apply"}var Ya=e=>typeof e=="string"?e.trim():"";function WI(e,t,r,n){const{version:i,attributes:o}=e.get(),a=o,s=n==="snapshot"||n==="anchor",c=s?a.author:void 0,l=s?a.date_gmt:void 0,u=Ya(a.title)||Ya(a.subject)||Ya(t.fallbackTitle);return{version:i,payload:{html:e.getContent(),title:u,subject:a.subject,preheader:a.preheader,description:a.description,common_styles:a.common_styles||"",meta:a.meta,utm_parameters:a.utm_parameters,parent_email:a.parent_email,is_template:a.is_template||!1,is_inited:a.is_inited,tags:a.tags,emailtags:a.emailtags,group:a.group,renderGuid:e.get().docId,project:t.project??a.project,folder:t.folder,...r?.emailtags?{emailtags:r.emailtags}:{},...r?.group?{group:r.group}:{},source:t.source,...c!=null&&c!==""?{author:c}:{},...l?{excerpt:l}:{}}}}var KI=["meta","title","author","project","html","excerpt","subject","preheader","common_styles","parent_email"];function Nf(e){const t={};for(const r of KI)e[r]!==void 0&&(t[r]=e[r]);return t.excerpt||(t.excerpt=new Date().toISOString()),t}async function QI(e,t,r,n,i){if(r==="materialize"&&n!=null)throw new Error("Письмо уже создано на сервере");if(r==="materialize"||r==="publish"&&n==null)return e.createEmail(i);if(n==null)throw new Error("Письмо ещё не создано на сервере");return r==="publish"?e.updateEmail(n,i):t.saveAutosave(n,i)}var Xa=20;function YI(e){const t=XI(e);return e.saveTimeoutMs?JI(t,e.saveTimeoutMs):t}function XI({revisions:e,revisionsByEmail:t,readAutosave:r,savedAt:n,emailAuthor:i,integratorProject:o}){const a=async(s,c)=>(t.clear(),await t.get(s,{page:c}),(await e.cache.values()??[]).filter(l=>String(l?.parent)===String(s)));return{async readRevisions(s,c=1){const l=await a(s,c);return{revisions:l.slice(Xa*(c-1),Xa*c),page:c,hasMore:l.length>Xa*c}},async readAutosave(s){const c=await n?.(s)??NaN,l=Number.isFinite(c)?c:void 0,u=await r?.(s);if(!u?.asked)return Rf(await a(s,1),l);if(!u.revision)return Qa([],l);const d={...u.revision,parent:s,isAutosave:!0};return Qa([d],l,await a(s,1))},async saveAutosave(s,c){const l=await i?.(s),u=o?.();return await e.create({...Nf(c),...l!==void 0?{author:l}:{},...u!==void 0?{project:u}:{},parent:s,isAutosave:!0,modified:new Date().toString()})}}}function JI(e,t){return{...e,async saveAutosave(r,n){const i=t();let o;try{return await Promise.race([e.saveAutosave(r,n),new Promise((a,s)=>{o=setTimeout(()=>s(new wf(i)),i)})])}catch(a){throw Mf(a),a}finally{o!==void 0&&clearTimeout(o)}}}}function Ja(e){return Object.prototype.hasOwnProperty.call(e,"meta")}function Df(e,t){const r={...e};return t===void 0?(delete r.meta,r):(r.meta={...e.meta??{},...t},r)}function Lf(e,t,r){return e&&!Ja(t)&&Ja(e)?{...r,meta:e.meta}:r}var bn=C.createIdentifier$1("CurrentProject"),xi={};function Ar(e){return e.getOrCreateInstance(bn,()=>it(xi))}function ZI(e,t){const r=Ar(e),n=r.get()??xi;!!n.refreshing!==t&&r.set({...n,refreshing:t})}function eT(e,t){const r=Ar(e),n=r.get()??xi;n.card!==t&&r.set({...n,...t?{card:t}:{}})}async function tT(e,t){const r=e?.getInstance(bn),n=r?.get()?.pending;if(!(!r||n?.id!==t))return r.set({...r.get(),pending:void 0}),n.promise}async function rT(e,t){const r=e?.getInstance(bn),n=r?.get()?.planPending;if(!(!r||n?.id!==t))return r.set({...r.get(),planPending:void 0}),n.promise}function Mr(e){return e?.getInstance(bn)?.get()??xi}function nT(e){const t=Mr(e).card?.id,r=Number(t);return t!=null&&t!==""&&Number.isFinite(r)?r:void 0}var Ff=_n("plugin.dataSource.emails"),xf=_n("plugin.dataSource.emailRevisions"),iT=Di("plugin.readEmailAutosave"),Uf=C.createIdentifier$1("emailDocuments.provided");function oT(e){const t=Ff(e),r=xf(e),n=r.byForeignKey("parent");if(e.getInstance(Uf))return{emails:t,emailRevisions:r};e.inject(Uf,!0);const i=()=>Wa(e.getInstance(C.INIT_PIPELINE_ID)?.contentReadyTimeoutMs),o=qI({emails:t,saveTimeoutMs:i}),a=new Map,s=(c,l)=>u=>{const d=u?.id??l;return(typeof d=="string"||typeof d=="number")&&a.set(String(d),c),u};return AI(e,{...o,createEmail:c=>o.createEmail(c).then(s(Date.now())),updateEmail:(c,l)=>o.updateEmail(c,l).then(s(Date.now(),c))}),DI(e,YI({revisions:r,revisionsByEmail:n,readAutosave:async c=>{const l=await hn(e,iT).fire(c);return l.length===0?{asked:!1}:{asked:!0,revision:l[0]??null}},savedAt:async c=>{const l=GI((await t.cache.getIfPresent(c))?.modified),u=a.get(String(c))??NaN;return Number.isFinite(u)&&!(l>=u)?u:l},emailAuthor:async c=>(await t.cache.getIfPresent(c))?.author,saveTimeoutMs:i,integratorProject:()=>Mr(e).requested})),df(e).addDisposable(t.onSave(({prev:c,patch:l,value:u})=>Lf(c,l,u),Number.MIN_VALUE)),{emails:t,emailRevisions:r}}var aT=`<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
11
|
+
<html>
|
|
12
|
+
<head>
|
|
13
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
14
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
15
|
+
<title></title>
|
|
16
|
+
<style type="text/css">
|
|
17
|
+
html {
|
|
18
|
+
-webkit-text-size-adjust: none;
|
|
19
|
+
-ms-text-size-adjust: none;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
22
|
+
<style em="styles">
|
|
23
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
24
|
+
.em-narrow-table {
|
|
25
|
+
width: 100%!important;
|
|
26
|
+
max-width: 660px!important;
|
|
27
|
+
min-width: 320px!important;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
31
|
+
</head>
|
|
32
|
+
<body style="margin: 0; padding: 0;">
|
|
33
|
+
<span class="preheader" style="display: none !important; visibility: hidden; opacity: 0; color: #F8F8F8; height: 0; width: 0; font-size: 1px;"> </span>
|
|
34
|
+
<!--[if !mso]><!-->
|
|
35
|
+
<div style="font-size:0px;color:transparent;opacity:0;">⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀</div>
|
|
36
|
+
<!--<![endif]-->
|
|
37
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-size: 1px; line-height: normal;">
|
|
38
|
+
<tr em="group">
|
|
39
|
+
<td align="center" bgcolor="#F8F8F8">
|
|
40
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
41
|
+
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
42
|
+
<![endif]-->
|
|
43
|
+
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="max-width: 660px; min-width: 660px; width: 660px;" class="em-narrow-table"></table>
|
|
44
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
45
|
+
</td></tr></table>
|
|
46
|
+
<![endif]-->
|
|
47
|
+
</td>
|
|
48
|
+
</tr>
|
|
49
|
+
</table>
|
|
50
|
+
</body>
|
|
51
|
+
</html>`;function Bf(e){return{isNew:!0,is_inited:!1,subject:void 0,preheader:void 0,description:"",html:aT,project:e?.id,project_title:e?.title??"",tags:[],utm_parameters:{utm_source:"",utm_medium:"",utm_campaign:"",utm_term:"",utm_content:""},parent_email:null,common_styles:"{}",title:"",emailtags:[],isAmp:!1}}function sT(e,t){const r={...t,html:e.html??t.html,subject:e.subject,preheader:e.preheader,description:e.description??t.description,title:e.title??t.title,common_styles:e.common_styles||t.common_styles,utm_parameters:{...t.utm_parameters,...e.utm_parameters},isAmp:e.isAmp??t.isAmp,is_template:!1,parent_email:e.id??e.parent_email??null};return e.meta&&(r.meta=e.meta),r}var Ui=C.createIdentifier$1("documentSession.emailDocuments");function $f(e){return e?.getInstance(Ui)}var lT=C.createIdentifier$1("RevisionServiceFlag");function qf(e){return e.getOrCreateInstance(lT,()=>{let t=!1;return{isEnabled:()=>t,set:r=>{t=r}}})}function Bi(e){return qf(e).isEnabled()}var zf=C.createIdentifier$1("EmailRightsResolver");function cT(e,t){e.inject(zf,t)}function uT(e,t){const r=e.getInstance(zf);return r?r(t):!0}var dT=()=>Wa();function fT(e,t){let r;return Promise.race([e,new Promise(n=>{r=setTimeout(()=>{n()},t)})]).finally(()=>{r!==void 0&&clearTimeout(r)})}function pT(e){return t=>fT(e.getOrCreateInstance(C.events.BEFORE_SAVE_EMAIL,()=>new C.AsyncEmitter).fire(t),dT())}var mT=1e4;function hT(e,t=mT){return async()=>{const r=Ba(e);let n;const i=new Promise(o=>{n=setTimeout(()=>o("silent"),t)});try{const o=await Promise.race([r.sendAsync(ne.SANDBOX_CANVAS_SYNCED,void 0,!1),i]);if(o==="silent"||o&&!o.synced)throw o==="silent"||o?.unsent,new ar("canvas-not-synced")}finally{clearTimeout(n)}}}function gT(e){return e!=null&&e!==""}var Za;function es(e,t){return Za?.capture(e,t)}function ts(e,t){return Za?.captureMessage(e,t)}function yT(e){Za?.identify(e)}var _T=[["brace-percent",/<!--\{%/],["brace-hash",/<!--\{#/],["proscript",/<!--\[%/],["getresponse",/<!--\[\[(?:if|else\]\]|endif\]\])/i],["mailchimp",/<!--\*\|/],["expert-sender",/<!--<\/?(?:if|else|var)/i]],vT=200;function Gf(e=new Set){const t=new Set;return(r,n)=>{if(!_T.some(([o,a])=>!e.has(o)&&a.test(r)))return;const i=n??`new:${r.length}:${r.slice(0,200)}`;t.has(i)||(t.size>=vT&&t.clear(),t.add(i))}}function Hf(){return{isConfigured:()=>!1,toEditorForm:e=>e,toOutputForm:e=>e,keepWrappedOnOutput:new Set,editorPolicy:{},warnAboutUnconfiguredInput:Gf()}}var bT=Hf();function Vf(e){return e?.getInstance(C.TEMPLATE_DIRECTIVES_ID)??bT}function ET(e=""){let t=e;return{read:()=>t,write:r=>{t=r},dispose:()=>{t=""}}}function $i(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var He=class{oldPosition;oldText;newPosition;newText;get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,r,n){this.oldPosition=e,this.oldText=t,this.newPosition=r,this.newText=n}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${$i(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${$i(this.oldText)}")`:`(replace@${this.oldPosition} "${$i(this.oldText)}" with "${$i(this.newText)}")`}};function Wf(e,t){return e===null||e.length===0?t:new wT(e,t).compress()}var wT=class Dt{_prevEdits;_currEdits;_result;_resultLen;_prevLen;_prevDeltaOffset;_currLen;_currDeltaOffset;constructor(t,r){this._prevEdits=t,this._currEdits=r,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let t=0,r=0,n=this._getPrev(t),i=this._getCurr(r);for(;t<this._prevLen||r<this._currLen;){if(n===null){if(i===null)break;this._acceptCurr(i),i=this._getCurr(++r);continue}if(i===null){this._acceptPrev(n),n=this._getPrev(++t);continue}if(i.oldEnd<=n.newPosition){this._acceptCurr(i),i=this._getCurr(++r);continue}if(n.newEnd<=i.oldPosition){this._acceptPrev(n),n=this._getPrev(++t);continue}if(i.oldPosition<n.newPosition){const[c,l]=Dt._splitCurr(i,n.newPosition-i.oldPosition);this._acceptCurr(c),i=l;continue}if(n.newPosition<i.oldPosition){const[c,l]=Dt._splitPrev(n,i.oldPosition-n.newPosition);this._acceptPrev(c),n=l;continue}let a,s;if(i.oldEnd===n.newEnd)a=n,s=i,n=this._getPrev(++t),i=this._getCurr(++r);else if(i.oldEnd<n.newEnd){const[c,l]=Dt._splitPrev(n,i.oldLength);a=c,s=i,n=l,i=this._getCurr(++r)}else{const[c,l]=Dt._splitCurr(i,n.newLength);a=n,s=c,n=this._getPrev(++t),i=l}this._result[this._resultLen++]=new He(a.oldPosition,a.oldText,s.newPosition,s.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=s.newLength-s.oldLength}const o=Dt._merge(this._result);return Dt._removeNoOps(o)}_acceptCurr(t){this._result[this._resultLen++]=Dt._rebaseCurr(this._prevDeltaOffset,t),this._currDeltaOffset+=t.newLength-t.oldLength}_getCurr(t){return t<this._currLen?this._currEdits[t]:null}_acceptPrev(t){this._result[this._resultLen++]=Dt._rebasePrev(this._currDeltaOffset,t),this._prevDeltaOffset+=t.newLength-t.oldLength}_getPrev(t){return t<this._prevLen?this._prevEdits[t]:null}static _rebaseCurr(t,r){return new He(r.oldPosition-t,r.oldText,r.newPosition,r.newText)}static _rebasePrev(t,r){return new He(r.oldPosition,r.oldText,r.newPosition+t,r.newText)}static _splitPrev(t,r){const n=t.newText.substr(0,r),i=t.newText.substr(r);return[new He(t.oldPosition,t.oldText,t.newPosition,n),new He(t.oldEnd,"",t.newPosition+r,i)]}static _splitCurr(t,r){const n=t.oldText.substr(0,r),i=t.oldText.substr(r);return[new He(t.oldPosition,n,t.newPosition,t.newText),new He(t.oldPosition+r,i,t.newEnd,"")]}static _merge(t){if(t.length===0)return t;const r=[];let n=0,i=t[0];for(let o=1;o<t.length;o++){const a=t[o];i.oldEnd===a.oldPosition?i=new He(i.oldPosition,i.oldText+a.oldText,i.newPosition,i.newText+a.newText):(r[n++]=i,i=a)}return r[n++]=i,r}static _removeNoOps(t){if(t.length===0)return t;const r=[];let n=0;for(let i=0;i<t.length;i++){const o=t[i];o.oldText!==o.newText&&(r[n++]=o)}return r}};function ST(e){return new He(e.newPosition,e.newText,e.oldPosition,e.oldText)}function PT(e){return e.map(ST)}function Kf(e,t){return t.every(r=>e.slice(r.oldPosition,r.oldEnd)===r.oldText)}function IT(e,t){let r=e;for(let n=t.length-1;n>=0;n-=1){const i=t[n];r=r.slice(0,i.oldPosition)+i.newText+r.slice(i.oldEnd)}return r}var qi=class extends Error{reason;constructor(e){super("Открытие документа не удалось"),this.reason=e,this.name="DocumentOpenFailedError"}},Qf=0,TT=Math.random().toString(36).slice(2,8);function CT(){return Qf+=1,`doc-${TT}-${Qf}`}function OT(e){const t=e.createBuffer(),r=e.docId??CT();let n=e.serverId??null,i=0,o=null,a=e.attributes??{};const s=new Set;let c=!1,l=!1,u;const d=new Set;let f=null;const m=()=>(f?.version!==i&&(f={version:i,value:t.read()}),f.value),g=h=>Object.entries(h).some(([E,S])=>a[E]!==S);return{get:()=>({docId:r,serverId:n,version:i,savedVersion:o,attributes:a}),getContent:m,mutate(h,{source:E}){if(c)return i;const S=h.changes?.length?h.changes:void 0,T=S?IT(m(),S):h.content!==void 0?h.content:void 0,w=T!==void 0&&T!==m(),y=h.attributes!==void 0&&g(h.attributes);if(!w&&!y)return i;const I=!(i>(o??-1)),_=y?Object.keys(h.attributes).filter(v=>a[v]!==h.attributes[v]):[];w&&t.write(T),y&&(a={...a,...h.attributes}),i+=1,E!=="user"&&I&&(o=i);const P={source:E,version:i,changes:S,...w?{content:!0}:{},..._.length>0?{attributes:_}:{}};return s.forEach(v=>v(P)),i},markSaved(h,E){const S={serverId:n,savedVersion:o};E!==void 0&&(n=E),(o===null||h>o)&&(o=h),(S.serverId!==n||S.savedVersion!==o)&&s.forEach(T=>T({source:"system",version:i}))},markUnsaved(){c||o===null||o<i||(o=i-1,s.forEach(h=>h({source:"system",version:i})))},markReady(){l||u!==void 0||(l=!0,d.forEach(h=>h.resolve()),d.clear(),s.forEach(h=>h({source:"system",version:i})))},isReady:()=>l,markFailed(h){l||u!==void 0||c||(u=h,d.forEach(E=>E.reject(new qi(h))),d.clear(),s.forEach(E=>E({source:"system",version:i})))},failure:()=>u,whenReady(){return l?Promise.resolve():u!==void 0?Promise.reject(new qi(u)):c?Promise.reject(new Error("Документ закрыт до того, как наполнение закончилось")):new Promise((h,E)=>{d.add({resolve:h,reject:E})})},subscribe(h){return s.add(h),()=>s.delete(h)},isNew:()=>n===null,isDirty:()=>i>(o??-1),isDisposed:()=>c,dispose(){c=!0,d.forEach(h=>h.reject(new Error("Документ закрыт до того, как наполнение закончилось"))),d.clear(),s.clear(),t.dispose()}}}var AT=500,MT=100,rs=0;function kT(e,t={}){const r=t.groupIntervalMs??AT,n=t.maxSteps??MT,i=t.now??(()=>0);let o=[],a=0,s=rs+=1,c=null,l=!1,u=!1,d=!1;const f=new Set,m=()=>f.forEach(_=>_()),g=(_,P)=>{if(_.length){u=!0;try{e.mutate({changes:_},{source:P})}finally{u=!1}}},h=_=>g(_,"user"),E=_=>{const P=i();l&&c!==null&&P-c<r?o[a-1]=Wf(o[a-1],_):(o=o.slice(0,a),o.push(_),a=o.length,l=!0,o.length>n&&(o=o.slice(o.length-n),a=o.length,s=rs+=1)),c=P,m()},S=()=>{l=!1,c=null},T=_=>{if(!_.length)return;const P=o.length>a;P&&(o=o.slice(0,a)),a>0&&(o[a-1]=Wf(o[a-1],_)),S(),P&&m()},w=e.subscribe(({source:_,changes:P})=>{if(!(d||u||!P?.length)){if(_==="remote"){y();return}if(_!=="user"){T(P);return}E(P)}}),y=()=>{o=[],a=0,S(),s=rs+=1,m()},I=()=>{if(a===0)return!1;const _=PT(o[a-1]);return Kf(e.getContent(),_)?(h(_),a-=1,S(),!0):(o=o.slice(0,a-1),a=o.length,S(),m(),!1)};return{canUndo:()=>a>0,canRedo:()=>a<o.length,undo(){I()&&m()},redo(){if(!(a>=o.length)){if(!Kf(e.getContent(),o[a])){o=o.slice(0,a),S(),m();return}h(o[a]),a+=1,S(),m()}},clear:y,applyWithoutHistory(_){const P=e.get().version;if(g(_,"system"),e.get().version===P){S();return}T(_)},getPast:_=>o.slice(0,a).reverse().slice(0,_),getFuture:_=>o.slice(a).reverse().slice(0,_),createSnapshot:()=>({stackId:s,index:a}),restoreSnapshot(_){if(_.stackId!==s||_.index>a)return!1;for(;a>_.index;)if(!I())return m(),!1;return m(),!0},subscribe(_){return f.add(_),()=>f.delete(_)},dispose(){d=!0,w(),f.clear(),o=[],a=0}}}function jT(e){const t=new Map,r=new Set;let n=null,i=null;const o=(s,c)=>{const l={participantId:s.participant.id,acknowledgedVersion:s.acknowledged,documentVersion:e.get().version,error:c};r.forEach(u=>u(l))},a=s=>{if(s.detached)return;const c=e.get().version;if(s.acknowledged===c||s.skipVersion===c)return;if(s.pushing){s.stale=!0;return}s.pushing=!0;const{attributes:l}=e.get(),u=s.participant.applyChanges&&i?.version===c&&s.acknowledged===c-1?i:null;(u?s.participant.applyChanges(u.changes,c,l):s.participant.apply(e.getContent(),c,l)).then(()=>{s.acknowledged=c}).catch(d=>{o(s,d)}).finally(()=>{s.pushing=!1,s.stale&&(s.stale=!1,a(s))})};return e.subscribe(({version:s,changes:c})=>{i=c?.length?{version:s,changes:c}:null,t.forEach(a)}),{attach(s){const c={participant:s,acknowledged:null,pushing:!1,stale:!1,detached:!1,skipVersion:null};return t.set(s.id,c),a(c),{acknowledgedVersion:()=>c.acknowledged,reset(){c.acknowledged=null,c.skipVersion=null,a(c)},detach(){c.detached=!0,t.delete(s.id)}}},setPrimacy(s){n=s},getPrimacy:()=>n,mutateFrom(s,c,l){const u=t.get(s);if(l.echo!==!0&&n!==null&&n!==s)return u?.participant.dropUnsent?.(),null;const d=e.get().version;u&&(u.skipVersion=d+1);const f=e.mutate(c,{source:l.source});return u&&f===d?u.skipVersion=null:u&&(u.acknowledged=f),f},onOutOfSync(s){return r.add(s),()=>r.delete(s)}}}function RT(e){return e instanceof ar?e.reason:void 0}var zi=e=>e.replace(/\r\n?/g,`
|
|
52
|
+
`),Yf="draft";function En(e){return e==null||e===""?Yf:String(e)}function Xf(e){return e==null||e===""?`${ns}${Yf}`:`${ns}${String(e)}`}var ns="block:";function Ce(e){return e?.startsWith(ns)===!0}function NT(e,t){}function DT(e,t,r){const n=typeof performance<"u"?performance.now():Date.now();return ke(`show:gate:${e}`,{kind:"wait"}),t.then(i=>(ke(`show:gate:${e}:end`,{kind:"wait"}),i),i=>{const o=Math.round((typeof performance<"u"?performance.now():Date.now())-n);throw C.isAbortError(i)?(`${e}`,{...r}):(`${e}`,{error:mb(i),...r},void 0),i})}var Jf=["recovery","plugin","rest"],LT=["subject","preheader"];function FT(e){let t={},r;for(let i=Jf.length-1;i>=0;i--){const o=e.get(Jf[i]);o&&(o.attributes&&(t={...t,...o.attributes}),o.content!==void 0&&(r=o.content))}const n=e.get("plugin")?.attributes;for(const i of LT){const o=n?.[i];typeof o=="string"&&o!==""&&(t={...t,[i]:o})}return r!==void 0?{content:r,attributes:t}:{attributes:t}}function Gi(e,t){if(!e||!t)return;const r=e.getContent(),n=t.content!==void 0?zi(t.content):void 0,i=n!==void 0&&n!==r;e.get().docId,Object.keys(t.attributes??{}),e.mutate({attributes:t.attributes??{},...i?{changes:[new He(0,r,0,n)]}:{}},{source:"remote"})}function De(e,t=!1){const r={};for(const n of Object.keys(e)){let i=e[n];i!==void 0&&!(typeof i=="number"&&Number.isNaN(i))&&(t&&typeof i=="object"&&i!==null&&(i=De(i)),r[n]=i)}return r}function be(e){return typeof e=="object"&&e}function Pe(e){const t=Number(e);return isNaN(t)?e:t}function pe(e){return typeof e=="number"?String(e):e}function lt(e){return typeof e=="object"?e.rendered:e}function Zf(e){return typeof e=="string"&&e.includes("autosave")}var xT=new Set(["html","id","renderGuid","showToken","showId","isNew"]);function ep(e){return e?Object.fromEntries(Object.entries(e).filter(([t])=>!xT.has(t))):{}}function is(e,t,r={}){e&&e.mutate({attributes:UT(e.get().attributes,t)},{source:r.source??"user"})}function UT(e,t){return t.subject===void 0||t.title!==void 0?t:(e.title??"")===(e.subject??"")?{...t,title:t.subject}:t}function os(e,t){return e===void 0&&Object.keys(t).length===0?null:{...e!==void 0?{content:e}:{},attributes:t}}function BT(e){return typeof e=="string"&&e.startsWith("{")?e:"{}"}function tp(e){if(!e)return null;const t=ep(e);return e.common_styles!==void 0&&(t.common_styles=BT(e.common_styles)),os(e.html,t)}function rp(e){return e?os(e.html,De(ep(e))):null}var $T=["common_styles","subject","preheader","meta"];function as(e){if(!e?.html?.trim())return null;const t={};for(const r of $T)qT(r,e[r])&&(t[r]=e[r]);return os(e.html,t)}function qT(e,t){return e==="common_styles"?typeof t=="string"&&t.startsWith("{"):e==="meta"?typeof t=="object"&&t!==null&&!Array.isArray(t):typeof t=="string"}var zT=["modified","lock"];function np(e){if(!e)return null;const t={};for(const r of zT)e[r]!==void 0&&(t[r]=e[r]);return Object.keys(t).length===0?null:{attributes:t}}var GT=10,HT=(e,t)=>e.key===t.key&&VT(e.serverId,t.serverId),VT=(e,t)=>e==null||e===t;function WT(e){return typeof e?.then=="function"}var ip=e=>{e.timer!==void 0&&(clearTimeout(e.timer),e.timer=void 0)},op=e=>{e.request.serverId!=null&&!Hi(e)&&(e.document.markSaved(e.document.get().version),e.savedContent=e.document.getContent())},KT=e=>e.document.get().serverId!=null&&!e.document.getContent().trim()&&!!(e.savedContent??e.lastMerged?.content??"").trim(),Hi=e=>e.document.get().savedVersion!==null&&e.document.isDirty(),ap=(e,t)=>t?.content!==void 0&&VI({hasUnsavedUserEdit:Hi(e)})==="skip",sp=(e,t)=>{for(const r of["subject","preheader"]){const n=t.attributes?.[r];typeof n=="string"&&(e.shownHeaders[r]=n)}},QT=e=>e.document.subscribe(t=>{t.source==="user"&&(t.content&&e.userTouched.add("content"),t.attributes?.forEach(r=>e.userTouched.add(r))),e.document.isDirty()||e.userTouched.clear()}),YT=(e,t)=>{!e.ready||t.content===void 0||e.document.get().serverId==null||(e.contentShown=!0,!(![...e.userTouched].every(r=>r==="content"||r in(t.attributes??{}))||!e.document.isDirty())&&(e.document.markSaved(e.document.get().version),e.savedContent=e.document.getContent(),e.userTouched.clear(),e.document.get().docId))},XT=(e,t)=>{if(!e)return t;const r=Object.fromEntries(Object.entries(t.attributes).filter(([i,o])=>e.attributes[i]!==o)),n=t.content!==void 0&&t.content!==e.content?t.content:void 0;return n===void 0&&Object.keys(r).length===0?null:n===void 0?{attributes:r}:{content:n,attributes:r}},JT=e=>{const t=FT(e.reports),r=XT(e.lastMerged,t);e.lastMerged=t,e.broughtContent=Vi(t.content)??e.broughtContent,r&&(Gi(e.document,r),op(e))},ss=(e,t)=>{if(!e.ready&&!Hi(e)){JT(e);return}e.broughtContent=Vi(t?.content)??e.broughtContent,Gi(e.document,t)},Vi=e=>e===void 0?void 0:zi(e),ZT=(e,t)=>t.content===void 0||Vi(t.content)!==e.broughtContent||!Hi(e)?t:{...t,content:void 0},eC=e=>{const{attributes:t,serverId:r,docId:n}=e.document.get();return{...t,html:e.document.getContent(),id:r??void 0,isNew:r==null,renderGuid:n}};function tC(e){const{resolveAdapters:t,timeoutMs:r,resolveWritePort:n,resolveHistoryPort:i,resolveTerms:o,canEdit:a,notifyBeforeSave:s,awaitCanvasSynced:c,savedEchoForm:l=O=>O,onAdapterError:u,onTimeout:d}=e;let f,m;const g=new Set,h=new Set,E=()=>g.forEach(O=>O()),S=(O,L)=>{if(!(O.closed||O.ready)){if(O.error!==void 0){O.document.markFailed(O.error),O.document.get().docId;return}op(O),O.ready=!0,O.document.markReady(),O.document.get().docId,[...O.reports.keys()]}},T=(O,L,U)=>{u?.(L.id,U),!(!L.required||O.closed)&&(O.error=U,O.document.get().docId,L.id,E())},w=(O,L)=>{const U=new Set(L.map(V=>V.id));L.forEach(V=>{V.watch&&O.watchers.push(V.watch(G=>O.closed?!1:O.ready&&(ap(O,G)||O.contentShown===!0&&G?.content!==void 0)?(O.document.get().docId,V.id,!1):(G&&O.reports.set(V.id,G),ss(O,G),G?.content!==void 0&&(O.showFill=void 0),!0)))});const Y=(V,G)=>{if(!O.closed){if(!V.required&&ap(O,G)){O.document.get().docId,V.id,V.loaded?.(!1);return}G&&(O.reports.set(V.id,G),V.id==="plugin"&&sp(O,G)),ss(O,G),V.loaded?.(G!==null)}},X=()=>{U.size>0||O.closed||(ip(O),S(O,[]))},J=[];if(L.forEach(V=>{let G;try{G=V.load()}catch(K){T(O,V,K),U.delete(V.id);return}if(WT(G)){J.push({id:V.id,required:V.required,load:()=>G,...V.loaded?{loaded:K=>V.loaded?.(K)}:{}});return}Y(V,G),U.delete(V.id)}),J.length===0){X();return}O.timer=setTimeout(()=>{O.timer=void 0,d?.([...U]),O.document.get().docId,[...U],S(O,[...U])},r),O.timer.unref?.(),J.forEach(V=>{V.load().then(G=>Y(V,G)).catch(G=>{T(O,V,G)}).finally(()=>{U.delete(V.id),X()})})},y=async(O,L,U)=>{if(U==="snapshot"||U==="anchor")return;const Y=o?.();if(Y)return Y.resolve({project:L.project??O.project,tags:(O.tags??[]).map(X=>({name:X}))})},I=O=>{if(O.lock===!0&&a?.(O)===!1)return new ar("locked");const L=O.tags?.length??0,U=O.emailtags?.length??0;if(Math.max(L,U)>GT)return new ar("too-many-tags")},_=(O,L)=>{const U=O.document.get().serverId;L||U==null||(O.recoveryFacts={emailId:U,historyLoaded:!0,isRecovering:!1},Ce(O.request.key)||(O.request={...O.request,key:En(U),serverId:U}))},P=(O,L,U)=>{if(O.closed||U?.id==null)return;const Y=O.document.get().serverId,X=Y!=null;X&&Y!==String(U.id)||(O.document.markSaved(L,String(U.id)),_(O,X),O.document.get().serverId,E())},v=async(O,L,U)=>{try{await O.document.whenReady()}catch(G){return O.saveError=G,O.saveFailures+=1,O.failedIntent=L,O.saveFailures,!1}if(O.closed)return!1;const Y=I(O.document.get().attributes);if(Y)return O.saveError=Y,O.saveFailures+=1,O.failedIntent=L,Y.reason,E(),!1;if(s&&(await s(eC(O)).catch(()=>{}),O.closed))return!1;if(c){try{await c()}catch(G){return O.saveError=G,O.saveFailures+=1,O.failedIntent=L,O.saveFailures,E(),!1}if(O.closed)return!1}if(KT(O))return L==="snapshot"||(O.saveError=new ar("empty-content"),O.saveFailures+=1,O.failedIntent=L,E()),!1;let X;try{X=await y(O.document.get().attributes,U,L)}catch(G){return O.saveError=G,O.saveFailures+=1,O.failedIntent=L,O.saveFailures,E(),!1}if(O.closed)return!1;const{payload:J,version:V}=WI(O.document,U,X,L);O.document.get().docId;try{const G=O.document.get().serverId!=null,K=await QI(n(),i(O.request.key),L,O.document.get().serverId,J);if(O.closed)return!0;let ie;if(L==="snapshot"||L==="anchor"){const te=K?.modified!=null?Date.parse(K.modified):NaN;ie=Number.isFinite(te)?te:Date.now(),O.snapshotVersion=V,O.lastRevisionAt=ie}else O.document.markSaved(V,K?.id!=null?String(K.id):void 0),O.savedContent=J.html,O.broughtContent=Vi(l(J.html));_(O,G),O.saveError=void 0,O.saveFailures=0,O.failedIntent=void 0,O.document.get().serverId,E();const re={intent:L,serverId:O.document.get().serverId,created:!G,...ie!==void 0?{revisionAt:ie}:{}};return h.forEach(te=>te(re)),!0}catch(G){return(L==="publish"||L==="materialize")&&FI(G)?.then(K=>P(O,V,K)),O.saveError=G,O.saveFailures+=1,O.failedIntent=L,O.saveFailures,E(),!1}},M=O=>{O.closed=!0,O.watchers.forEach(L=>L()),O.watchers=[],ip(O),O.history.dispose(),O.document.dispose()},j=()=>{f&&(M(f),f=void 0)},A=()=>{m&&(M(m),m=void 0)},k=(O,L,U)=>{let Y=!1;L.show&&(O.show?.id!==L.show.id||O.show.token!==L.show.token)&&(O.show=L.show,Y=!0,{docId:O.document.get().docId,...L.show});const X=U==="show"?rp(L.patch):null;if(X){O.reports.set("plugin",X),sp(O,X);const J=ZT(O,X);ss(O,J),YT(O,J)}Y&&E()},D=(O,L={})=>F(f,O,L),N=()=>f&&Ce(f.request.key??"")?m:f,x=O=>({error:O?.saveError,failures:O?.saveFailures??0,saving:O?.saving===!0,failedIntent:O?.failedIntent}),F=(O,L,U)=>!O||O.closed||L==="materialize"&&O.document.get().serverId!=null?Promise.resolve(!1):O.saving?L==="snapshot"||L==="materialize"?Promise.resolve(!1):(O.inFlight??Promise.resolve(!1)).then(()=>F(O,L,U)):(O.saving=!0,E(),O.inFlight=v(O,L,U).finally(()=>{O.saving=!1,O.inFlight=void 0,f===O&&!O.closed&&E()}),O.inFlight),q=(O,L="open",U=!1)=>{if(f&&!f.closed&&L!=="new"&&HT(f.request,O))return k(f,O,L),f.document;j(),U||A();const Y=OT({createBuffer:()=>ET(""),serverId:O.serverId??null}),X={request:O,show:O.show,document:Y,history:kT(Y,{now:Date.now}),watchers:[],userTouched:new Set,shownHeaders:{},saveFailures:0,saving:!1,reports:new Map,ready:!1,closed:!1};return f=X,X.watchers.push(QT(X)),Y.get().docId,O.serverId,w(X,t(O,{publishRecoveryFacts(J){X.closed||(X.recoveryFacts=J,E())},readShownContent:()=>X.closed?null:X.document.getContent()})),E(),Y},$=(O,L,U)=>({key:Ce(O)?O:Xf(O),serverId:L?.id!=null?String(L.id):null,email:L,show:U});return{openWith:q,open:(O,L={})=>q({key:En(O),serverId:O,email:L.email,patch:L.patch,show:L.show},"open"),openDraft:(O,L={})=>q({key:En(void 0),serverId:null,email:O,patch:L.patch,show:L.show},"open"),startNewDraft:(O,L={})=>q({key:En(void 0),serverId:null,email:O,patch:L.patch,show:L.show},"new"),reload:(O,L={})=>q({key:En(O),serverId:O,email:L.email,patch:L.patch,show:L.show},"new"),openBlock:(O,L,U)=>q($(O,L,U),"open"),reloadBlock:(O,L,U)=>q($(O,L,U),"new"),openBlockOver:(O,L)=>{const U=$(O,L);return f&&!f.closed&&f.request.key===U.key?f.document:(f&&!f.closed&&!Ce(f.request.key)&&(A(),m=f,f=void 0),q(U,"open",!0))},resumeSuspended:()=>{if(m)return j(),f=m,m=void 0,E(),f.document},hasSuspended:()=>!!m,suspendedDocument:()=>m?.document,show:(O,L)=>{const U=f;if(!(!U||U.closed))return q({...U.request,patch:O,show:L},"show")},current:()=>f?.document,noteServerFacts:({serverId:O,block:L},U)=>{const Y=f;!Y||Y.closed||Y.request.serverId!==O||Ce(Y.request.key??"")===L&&Gi(Y.document,np(U))},save:D,saveEmail:(O,L={})=>F(N(),O,L),saveState:()=>x(f),emailSaveState:()=>x(N()),revisionFacts(){if(!f)return;const O=f.revisionFactsSnapshot;return O&&O.snapshotVersion===f.snapshotVersion&&O.lastRevisionAt===f.lastRevisionAt?O:(f.revisionFactsSnapshot={snapshotVersion:f.snapshotVersion,lastRevisionAt:f.lastRevisionAt},f.revisionFactsSnapshot)},recoveryFacts:()=>f?.recoveryFacts,history:()=>f?.history,forcedHeaders:()=>f?.forcedHeaders,beginForcedHeaders(O){f&&!f.closed&&(f.forcedHeaders=O)},endForcedHeaders(){for(const O of[f,m])O&&(O.forcedHeaders=void 0)},onSaved(O){return h.add(O),()=>h.delete(O)},showFacts:()=>f?.show,shownHeaders:()=>({...f?.shownHeaders}),showFill:()=>f?.showFill,beginShowFill(O){f&&!f.closed&&(f.showFill={showId:O,codeEdits:0})},noteCodeEdit(){f?.showFill&&(f.showFill.codeEdits+=1)},endShowFill(O){for(const L of[f,m])L?.showFill?.showId===O&&(L.showFill=void 0)},sessionKey:()=>f?.request.key,openError:()=>f?.error,subscribe(O){return g.add(O),()=>g.delete(O)},close(){!f&&!m||(j(),A(),E())}}}var wn=class extends Error{reason;constructor(e,t){super(`письмо не открылось: ${e}`),this.name="EmailOpenFailedError",this.reason=e,this.cause=t}};function rC(e){return e===404||e===410?"not-found":e===401||e===403?"forbidden":"unavailable"}function ls(e){if(e instanceof wn)return e.reason;if(e instanceof qi)return ls(e.reason)}function nC(e){return new wn(rC(e.status),e.error??e)}function iC(e){const t=e instanceof qi?e.reason:e;return t instanceof wn&&t.reason==="unavailable"&&t.cause instanceof TypeError}function oC(e){const t=ls(e);return t==="forbidden"||t==="not-found"}function aC(e,t){return{id:"rest",required:!0,load:async()=>{const r=await e.readEmail(t);if(!r)throw new wn("not-found");return tp(r)}}}var Wi=C.createIdentifier$1("documentSession.restEmailPortFactories");function sC(e,t){e.inject(Wi,t)}function lp(e){return e.getInstance(Wi)!==void 0}function sr(e){const t=e.getInstance(Wi);if(!t)throw new Error("[documentSession] порты поверх REST ещё не загружены — работа с сервером начинается с init()");return t}var cp=C.createIdentifier$1("EmailTermsResolver");function lC(e){return e.getInstance(cp)}function cC(e,t){e.inject(cp,t)}var uC="em_autosave_pending",sz=6e4;function Ki(e){return`${uC}_${e}`}function cs(e,t){try{sessionStorage.setItem(Ki(e),JSON.stringify(t))}catch{}}function up(e){try{const t=sessionStorage.getItem(Ki(e));if(!t)return null;const r=JSON.parse(t);return Date.now()-r.sentAt>6e4?(sessionStorage.removeItem(Ki(e)),null):r}catch{return null}}function Sn(e){try{sessionStorage.removeItem(Ki(e))}catch{}}var dC=2e3,fC=5e3,pC=5,mC=5e3,hC=4;function gC(){return typeof performance<"u"&&typeof performance.timeOrigin=="number"?performance.timeOrigin:Date.now()}function yC(e,t){return e==null||t==null?!1:e.replaceAll(`\r
|
|
53
|
+
`,`
|
|
54
|
+
`)===t.replaceAll(`\r
|
|
55
|
+
`,`
|
|
56
|
+
`)}function us(e,t){return Ka(e.autosave,t===void 0?{}:{freshSince:t})?e.autosave:null}function _C({emailId:e,readAutosave:t,revisionServiceEnabled:r,readShownContent:n,onFacts:i,onLate:o,onError:a,pageLoadTs:s=gC()}){let c=null,l=!1,u=!1,d=0,f={emailId:e,historyLoaded:!1,isRecovering:!1},m=null;const g=new Promise(k=>{m=k}),h=k=>{f={...f,...k},i(f)};let E;const S=k=>{d+=1,h({applied:{phase:k,seq:d}})},T=()=>{c?.timer&&clearTimeout(c.timer),c=null},w=k=>{if(!u){if(m){const D=m;m=null,D(k),E=k.revision?k.phase:void 0;return}o(k)&&k.revision&&S(k.phase)}},y=()=>{if(!c||u)return;const k=c.phase==="fast",D=k?dC:mC,N=k?pC:hC;c.timer=setTimeout(()=>{const x=c;if(!(!x||u)){if(x.attempts+=1,v(),k&&x.attempts>=N){const{pending:F}=x;Sn(e),h({isRecovering:!1}),w({revision:{html:F.html,common_styles:F.common_styles,subject:F.subject,preheader:F.preheader},phase:"timeout"}),l=!0,x.phase="bg",x.attempts=0,y();return}if(!k&&x.attempts>=N){Sn(e),T(),h({isRecovering:!1}),l=!0;return}y()}},D),c.timer.unref?.()},I=k=>{c={phase:"fast",attempts:0,pending:k,timer:null},h({isRecovering:!0}),y()},_=k=>{if(u)return;if(h({historyLoaded:!0,latestRevisionAt:k.latestAt!==void 0&&Number.isFinite(k.latestAt)?k.latestAt:void 0}),r&&c){const x=us(k,c.pending.sentAt);if(!x)return;const F=c.phase==="fast"?"found":"bg";Sn(e),T(),h({isRecovering:!1}),l=!0,w({revision:x,phase:F});return}if(l)return;const D=r?up(e):null,N=D&&(D.sentAt<s||!yC(D.html,n()))?D:null;if(N){const x=us(k,N.sentAt);if(x){Sn(e),l=!0,w({revision:x,phase:"found"});return}I(N);return}l=!0,w({revision:us(k),phase:"normal"})},P=k=>{u||(a?.(k),f.historyLoaded||(h({historyLoaded:!1,latestRevisionAt:void 0}),A()),!c&&w({revision:null,phase:"normal"}))},v=()=>t(e).then(_).catch(P);let M,j=!1;const A=()=>{j||c||u||(j=!0,M=setTimeout(()=>{M=void 0,!u&&!f.historyLoaded&&v()},fC))};return v(),{verdict:()=>g,confirmVerdict(k){const D=E;E=void 0,k&&D!==void 0&&!u&&S(D)},dispose(){u=!0,M!==void 0&&(clearTimeout(M),M=void 0),T()}}}function vC({port:e,revisionServiceEnabled:t,emailId:r,readShownContent:n,onFacts:i}){let o=null;const a=_C({emailId:r,readAutosave:s=>e.readAutosave(s),revisionServiceEnabled:t,readShownContent:n,onFacts:i,onLate:({revision:s,phase:c})=>{const l=as(s);return o?.(l)??!1},onError:s=>{s instanceof Error&&s.message}});return{id:"recovery",load:()=>a.verdict().then(({revision:s})=>as(s)),loaded(s){a.confirmVerdict(s)},watch(s){return o=s,()=>{o=null,a.dispose()}}}}function dp(e,t){return{readRevisions:(r,n)=>t.readRevisions(r,n),readAutosave:r=>t.readAutosave(r),async saveAutosave(r,n){cs(r,{sentAt:Date.now(),html:n.html??"",common_styles:n.common_styles??"",subject:n.subject,preheader:n.preheader});const i=await t.saveAutosave(r,n);return await e.saveAutosave(r,n),i}}}function bC(e,t){return{readEmail:r=>e.readEmail(r),createEmail:r=>e.createEmail(r),async updateEmail(r,n){const i=Date.now(),o=await t.updateEmail(r,n);return await e.updateEmail(r,n),(up(r)?.sentAt??Number.POSITIVE_INFINITY)<=i&&Sn(r),o}}}var ds=C.createIdentifier$1("CurrentUser"),fp={};function fs(e){return e.getOrCreateInstance(ds,()=>it(fp))}function Qi(e){return e?.getInstance(ds)?.get()??fp}async function EC(e){const t=e?.getInstance(ds),r=t?.get().promise;if(!(!t||r===void 0))return t.set({...t.get(),promise:void 0}),r}function wC(e){if(!e)return!1;try{return!!C.decodeJwt(e).data?.act_as}catch{return!1}}function ps(e){return wC(e?.getInstance(C.COOKIE_MANAGER_ID)?.get(Ni.em_token))}var SC=1.5;function PC(e){return e.isHeadless||!e.isEnabled||e.isUserBusy||!e.isReady||!e.isInited?"none":e.isNew?"create":!e.isDirty||e.isSnapshotSent||!e.isHistoryLoaded||e.latestRevisionAgeMs!==void 0&&e.latestRevisionAgeMs<=SC*e.autosaveTimeoutMs?"none":"revision"}var lz=5,cz=3;function IC(e){const{readDocument:t,readEnvironment:r,onCreate:n,onRevision:i}=e,o=e.readFailures??(()=>0),a=e.readFailureRetryable??(()=>!0);let s;const c=P=>s!==void 0&&s.version===P.get().version?o()-s.failuresAtStart:0,l=P=>{const v=c(P);if(v<=0)return!1;const M=r().retryMaxAttempts??5;return!a()||v>M},u=()=>{const{autosaveTimeoutMs:P,retryIntervalMs:v}=r(),M=t();return M!==void 0&&c(M)>0&&v!==void 0&&v>0?v:P},d=P=>P.isNew()&&o()>=3,f=()=>{const P=t();if(!P||P.isDisposed()||l(P))return"none";const{latestRevisionAt:v,snapshotVersion:M,...j}=r(),A=Date.now(),k=PC({...j,isDirty:P.isDirty(),isNew:P.isNew(),isReady:P.isReady(),latestRevisionAgeMs:v!=null&&v<=A?A-v:void 0,isSnapshotSent:M!=null&&M===P.get().version});return k==="create"&&d(P)?"none":k},m=()=>{const P=t();if(!P||P.isDisposed()||d(P)||l(P)||r().isHeadless)return!1;if(!P.isDirty())return P.isNew();const{snapshotVersion:v}=r();return!(v!=null&&v===P.get().version)};let g,h,E,S,T=!1;const w=()=>{h=void 0;const P=t();if(!P||P.isDisposed())return;if(P.get().docId!==g){y();return}const v=f();v!=="none"&&s?.version!==P.get().version&&(s={version:P.get().version,failuresAtStart:o()}),v==="create"?n():v==="revision"?i():m()&&(g=P.get().docId,h=setTimeout(w,u()))},y=()=>{const P=t();T||!P||h!==void 0||f()==="none"&&!m()||(g=P.get().docId,h=setTimeout(w,u()))},I=P=>{P.source==="user"&&h!==void 0&&(clearTimeout(h),h=void 0),y()},_=()=>{const P=t();P!==E&&(S?.(),E=P,s=void 0,S=P?.subscribe(I),h!==void 0&&(clearTimeout(h),h=void 0))};return _(),y(),{refresh:()=>{T||(_(),y())},stop:()=>{T=!0,S?.(),S=void 0,E=void 0,h!==void 0&&(clearTimeout(h),h=void 0)}}}var pp=C.createIdentifier$1("documentSession.autosaveUiFacts"),mp={isUserBusy:!1,saveContext:{}};function hp(e){return e.getOrCreateInstance(pp,()=>it(mp))}function ms(e){return e?.getInstance(pp)?.get()??mp}function TC(e){return ms(e).saveContext.fallbackTitle||"Untitled email."}var CC=1e4,OC=3e4;function AC(e,t){const r=u=>{const d=e.getInstance(C.CONFIG_SOURCE_ID)?.layers?.(),f=d?Od(d,u):void 0;return typeof f=="number"&&f>=0?f:void 0},n=()=>{const u=t.current(),d=u?.get().serverId??void 0,f=Ce(t.sessionKey()),m=t.recoveryFacts(),g=m?.emailId===d?m:void 0,h=t.revisionFacts(),E=g?.latestRevisionAt,S=h?.lastRevisionAt,T=Qi(e).profile;return{isInited:f||u?.get().attributes.is_inited===!0,isEnabled:!!T?.autosaves&&!ps(e),isHistoryLoaded:g?.historyLoaded===!0,isUserBusy:ms(e).isUserBusy,isHeadless:Yc(e),autosaveTimeoutMs:$t(e).autosaveTimeout||CC,latestRevisionAt:E!==void 0||S!==void 0?Math.max(E??0,S??0):void 0,snapshotVersion:h?.snapshotVersion,retryIntervalMs:r("autosaveRetryIntervalMs")??OC,retryMaxAttempts:r("autosaveRetryMaxAttempts")}},i=()=>{const u=ms(e).saveContext;return{...u,project:u.project??t.current()?.get().attributes.project,fallbackTitle:TC(e)}},o=IC({readDocument:()=>t.current(),readEnvironment:n,readFailures:()=>t.saveState().failures,readFailureRetryable:()=>xI(t.saveState().error),onCreate:()=>{Ce(t.sessionKey())||t.save("materialize",i())},onRevision:()=>{t.save("snapshot",{project:i().project})}}),a=t.subscribe(o.refresh),s=fs(e).watch(()=>o.refresh()),c=hp(e).watch(()=>o.refresh()),l=ui(e).watch(()=>o.refresh());return()=>{a(),s.dispose(),c.dispose(),l.dispose(),o.stop()}}var gp=12e3;function kr(e){return e.getOrCreateInstance(Ui,()=>{const t=tC({resolveAdapters:(n,i)=>kC(n,e,i),resolveWritePort:()=>gs(e),resolveHistoryPort:n=>Ce(n)?_s(e):ys(e),resolveTerms:()=>lC(e),canEdit:n=>uT(e,n),notifyBeforeSave:pT(e),awaitCanvasSynced:hT(e),savedEchoForm:n=>{const i=Vf(e);return i.toEditorForm(i.toOutputForm(n))},timeoutMs:gp,onAdapterError:(n,i)=>{i instanceof Error&&i.message;const o=oC(i),a=iC(i);es(i,{origin:"email-source-adapter",tags:{source:n,expected_refusal:String(o),network_failure:String(a)},level:o||a?"warning":"error"})},onTimeout:n=>{}}),r=AC(e,t);return e.getInstance(C.DISPOSABLE_ID)?.addDispose(r),t})}function hs(e){return e?.getInstance(Ui)}function gs(e){const t=OI(e);return t?vs(e)?bC(t,sr(e).email(e)):t:sr(e).email(e)}function MC(e){return Ef(e)!==void 0||lp(e)}function ys(e){const t=Ef(e);return t?vs(e)?(ke("port:history:server-backed"),dp(t,sr(e).history(e))):(ke("port:history:integrator"),t):(ke("port:history:rest (порт не зарегистрирован)"),sr(e).history(e))}function _s(e){const t=bf(e);return t?vs(e)?(ke("port:block-history:server-backed"),dp(t,sr(e).blockHistory(e))):(ke("port:block-history:integrator"),t):(ke("port:block-history:rest (порт не зарегистрирован)"),sr(e).blockHistory(e))}function yp(e){return bf(e)!==void 0||lp(e)}function vs(e){return Bi(e)}function kC({email:e,patch:t,serverId:r,key:n},i,o){const a=[];e?a.push({id:"rest",load:()=>tp(e),required:!0}):r&&a.push(aC(gs(i),r)),t&&a.push({id:"plugin",load:()=>rp(t)});const s=Ce(n);return gT(r)&&(s?yp(i):MC(i))&&a.push(vC({port:s?_s(i):ys(i),revisionServiceEnabled:Bi(i),emailId:r,readShownContent:()=>o.readShownContent(),onFacts:c=>o.publishRecoveryFacts(c)})),a}function _p(e){return{emails:Ff(e),blocks:Ha(e),emailRevisions:xf(e),blocksRevision:ff(e),comments:pf(e)}}function bs(e){const t=hs(e);return t&&Ce(t.sessionKey())?t.suspendedDocument():t?.current()}function jC(e){return bs(e)?.getContent()}function RC(e,t){const r=t??Bf(),n=bs(e)?.get();return n?{...r,...n.attributes,id:n.serverId??void 0,isNew:n.serverId===null,html:jC(e)??r.html}:r}async function vp(e){return(await e.getInstanceAsync(C.APP_ID))?.project}async function bp(e){return nT(e)??await vp(e)}async function NC(e,t){const r=Ha(e);if(r.hasReadHandler()){const n=await r.get(t);if(n&&Object.keys(n).some(i=>i!=="id"))return n;await r.remove(t,{silent:!0});return}return r.byForeignKey("project").first(await bp(e),{filter:{id:t}})}var Ep=new WeakMap,DC=32;function LC(e){return{...e}}function FC(e){let t=Ep.get(e);return t||(t={byId:new Map,fallback:[]},Ep.set(e,t)),t}function wp(e,t){const{byId:r,fallback:n}=FC(t),i=LC(e);i.id!=null&&i.id!==""&&r.set(String(i.id),i),n.push(i),n.length>DC&&n.shift()}function xC(e){if(!e)return{};const t={};for(const r of Object.keys(e))Ga.has(r)&&of(r,e[r])&&(t[r]=e[r]);return t}function Sp(e){const t={},r=e;for(const n of Ga){if(!(n in r))continue;const i=r[n];if(of(n,i)){if(n==="project"){const o=Number(i);t.project=Number.isNaN(o)?i:o;continue}if(n==="author"){t.author=String(i);continue}if(n==="status"||n==="comment_status"||n==="ping_status"){t[n]=i;continue}t[n]=i}}return Object.assign(t,xC(e.catalogExtra)),t}function UC(e,t){const{meta:r,...n}=t;let i={...e,...n};return r!==void 0&&(i=Df(i,r)),i}async function Pp(e,t,r){if(!e)return;const n=r.id!=null&&r.id!==""?String(r.id):void 0;if(!n)return;const i=Sp(t),o=Sp(r);if(C.deepEqual(i,o))return;const{blocks:a}=_p(e);await a.cache.addOrUpdate(n,s=>s&&UC(s,o))}var BC=()=>{};function Ve(){const e=Se(),t=(0,b.useCallback)(n=>{if(!e)return BC;const i=Ar(e).watch(n);return()=>i.dispose()},[e]),r=(0,b.useCallback)(()=>Mr(e).card,[e]);return(0,b.useSyncExternalStore)(t,r,r)}function Ip(e,t,r=!0){const n=e,i=t;for(const o of Object.keys(i)){const a=i[o];a!=null&&(r&&typeof a=="object"?n[o]=Ip(n[o]||{},a,!0):n[o]=a)}return e}async function $C(e){const t=(await(0,ut.__vitePreload)(()=>Promise.resolve().then(()=>Promise.resolve(me("./15ea858c.js")).then(r=>Q.__toESM(r.default))),void 0,{}.url)).default;return new Promise((r,n)=>{t.load({google:{families:[e]},classes:!1,active:()=>r(),inactive:()=>n(new Error(`Шрифт не загрузился: ${e}`))})})}function qC(e){const t=Vd(e);return isNaN(t)?new Date(e):t}var Tp=new Map;function zC(e){let t=Tp.get(e);return t||(t={shortDate:new Intl.DateTimeFormat(e,{dateStyle:"short"}),shortTime:new Intl.DateTimeFormat(e,{timeStyle:"short"})},Tp.set(e,t)),t}var GC=(e,t,r=!1)=>{e instanceof Date;const n=new Date,i=e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear();if(r&&i){const o=Math.floor((n-e)/1e3),a=Math.floor(o/60),s=Math.floor(a/60);if(o<60)return t("Just now");if(s>0){const c=a%60;return`${s} ${t("hour","hours",s)} ${c} ${t("minute","minutes",c)}`}else return`${a} ${t("minute","minutes",a)}`}else{const{shortDate:o,shortTime:a}=zC(navigator.language);return o.format(e)+" "+a.format(e)}},Cp=e=>{const t=e.match(/(\(copy\))( \d+)?$/),r=t?.[1],n=t?.[2];return r?n?`${e.slice(0,-n.length)} ${+n.slice(1)+1}`:`${e} 2`:`${e} (copy)`};function HC(e,t,r){const n=new Map,i=new RegExp(`(${t})(.*?)(${r})`,"gis");return e=e.replaceAll(i,(o,a,s,c)=>{const l=C.generateUUID();return n.set(l,s),a+l+c}),{escapes:n,html:e}}function Op(e,t){let r=[];for(const[n,i]of t){const{escapes:o,html:a}=HC(e,n,i);e=a,r.push([n,i,o])}return{escapes:r,html:e}}function VC(e,t,r,n){const i=new RegExp(`(${t})(.*?)(${r})`,"gis");return e.replaceAll(i,(o,a,s,c)=>{const l=n.get(s);return typeof l=="string"?a+l+c:o})}function WC(e,t){for(const[r,n,i]of t)e=VC(e,r,n,i);return e}var Ap=/<title>([\s\S]*?)<\/title>/gim;function Es(e){return e==null?"":String(e).replace(/\s+/g," ").trim()}var KC=(e,t)=>{const{escapes:r,html:n}=Op(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","-->"]]);let i=n;return i=i.replaceAll(Ap,(o,a)=>{if(t==null)return o;const s=Es(a);return s===Es(t)?`<title>${Cp(s)}</title>`:o}),WC(i,r.reverse())};function QC(e){let{html:t}=Op(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","-->"]]);return[...t.matchAll(Ap)].map(r=>Es(r[1])).find(r=>!!r)}var YC=/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/,ws=()=>{const e=Or(),t=Da(),r=se(),{projectId:n}=or(),i=Ve();return(0,b.useCallback)(async(o,a,s,c,l)=>{t.querySelectorAll(".block-search__preview").forEach(_=>_.remove());const u=t.querySelector("#iframe-scroll-top"),d=t.querySelector("#iframe-scroll-bottom"),f=t.querySelector("#email_iframe_slot"),m=document.body.getBoundingClientRect().height,g=f.getClientRects()[0];g.top<0&&(u.style.display="block"),g.top+g.height>m&&(d.style.display="block");const h=s==="project"||s==="template"||s==="common"?"block":"structure",E=C.getContainer(r),S=i?.id??n,T=af(l,{html:a||"",insertFrom:s,fragmentRole:h,name:c,project:S}),w=await Fd(E,{...T});await Pp(E,T,w),wp(w,E);const y=w.project!==void 0&&w.project!==null?String(w.project):String(S??""),I={operation:ne.SANDBOX_BLOCK_INSERT,settings:{blockHTML:w.html||null,targetBlock:null,project:y,type:s,name:w.name??c,blockId:w.id!=null?String(w.id):void 0}};o.dataTransfer.setData("Text",JSON.stringify(I)),e(I)},[e,t,r,n,i])},XC=()=>{const e=Or(),t=Da(),r=se();return(0,b.useCallback)(async(n,i,o)=>{if(!o(i))return;const a=t.querySelector("#iframe-scroll-top"),s=t.querySelector("#iframe-scroll-bottom"),c=t.querySelector("#email_iframe_slot"),l=document.body.getBoundingClientRect().height,u=c.getClientRects()[0];u.top<0&&(a.style.display="block"),u.top+u.height>l&&(s.style.display="block");const d=C.getContainer(r),f=await Ld(d,{name:i?.name??"",className:i?.className??"",html:i?.html??""}),m={operation:ne.SANDBOX_ATOM_INSERT,settings:{atomHTML:f.html||null,targetBlock:null,name:f.name??i.name}};n.dataTransfer.setData("Text",JSON.stringify(m)),e(m)},[e,t,r])},Ss=()=>{const e=Or(),t=mt(),{emailId:r,blockId:n,projectId:i}=or(),o=Ve(),a=se();return(0,b.useCallback)(async(s,c,l,u,d)=>{const f=l==="project"||l==="template"||l==="common"?"block":"structure",m=f==="block"?u||l||"block":u||l||"structure",g=f==="block"?"block":"structure",h=C.getContainer(a),E=o?.id??i,S=af(d,{html:c||"",insertFrom:l,fragmentRole:g,name:m,project:E}),T=await Fd(h,{...S});await Pp(h,S,T),wp(T,h);const w=T.project!==void 0&&T.project!==null?String(T.project):String(E??"");e({operation:ne.SANDBOX_BLOCK_INSERT,action:"insert",settings:{blockHTML:T.html,type:l,name:T.name??m,project:w,blockId:T.id!=null?String(T.id):void 0}}),t({event:"add",action:"add_element_to_email",element_type:f,element_name:m,entity_id:r||n,project_id:o?.id||i})},[e,t,r,n,i,o,a])},JC=()=>{const e=Or(),t=mt(),{emailId:r,blockId:n,projectId:i}=or(),o=Ve(),a=se();return(0,b.useCallback)(async(s,c)=>{const l=C.getContainer(a),u=await Ld(l,{name:c?.name??"",className:c?.className??"",html:c?.html??""});e({operation:ne.SANDBOX_ATOM_INSERT,action:"insert",settings:{atomHTML:u.html||null,targetBlock:null,name:u.name??c?.name}}),t({event:"add",action:"add_element_to_email",element_type:"atom",element_name:c.name||"atom",entity_id:r||n,project_id:o?.id||i})},[e,t,r,n,i,o,a])},ZC=(e,t)=>{t.success({mask:{closable:!0},centered:!0,title:e("Coming soon"),content:e("The feature is under development."),okText:e("Ok. I'll be waiting"),onOk:()=>{}})},eO=()=>{const e=Or();return(t,r)=>{e({operation:ne.SANDBOX_ELEMENT_SETTINGS_SET,settings:t,type:r})}},tO=(e,t="")=>{const r=[];return e&&e._embedded?.["wp:term"]?.filter(n=>!!n.length&&(t?n[0]?.taxonomy===t:!0)).forEach(n=>{const i=n[0].taxonomy;r[i]||(r[i]=[]),r[i]=n.map(o=>({id:o.id,name:o.name,children:o.children})),r[r.length]=r[i]}),t!==""&&r.length?r[t]:r},rO=class extends Error{issues;constructor(e){super(e[0].message),this.name="SchemaError",this.issues=e}},Mp=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Mp||{}),Ot="uninitialized",Ps="pending",Pn="fulfilled",In="rejected";function kp(e){return{status:e,isUninitialized:e===Ot,isLoading:e===Ps,isSuccess:e===Pn,isError:e===In}}var jp=Ut;function Is(e,t){if(e===t||!(jp(e)&&jp(t)||Array.isArray(e)&&Array.isArray(t)))return t;const r=Object.keys(t),n=Object.keys(e);let i=r.length===n.length;const o=Array.isArray(t)?[]:{};for(const a of r)o[a]=Is(e[a],t[a]),i&&(i=e[a]===o[a]);return i?e:o}function Ts(e,t,r){return e.reduce((n,i,o)=>(t(i,o)&&n.push(r(i,o)),n),[]).flat()}function nO(e){return new RegExp("(^|:)//").test(e)}function iO(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Cs(e){return e!=null}function Rp(e){return[...e?.values()??[]].filter(Cs)}function oO(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var aO=e=>e.replace(/\/$/,""),sO=e=>e.replace(/^\//,"");function lO(e,t){if(!e)return t;if(!t)return e;if(nO(t))return t;const r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=aO(e),t=sO(t),`${e}${r}${t}`}function Yi(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Os=()=>new Map,cO=e=>{const t=new AbortController;return setTimeout(()=>{const r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},uO=(...e)=>{for(const r of e)if(r.aborted)return AbortSignal.abort(r.reason);const t=new AbortController;for(const r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},Np=(...e)=>fetch(...e),dO=e=>e.status>=200&&e.status<=299,fO=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Dp(e){if(!Ut(e))return e;const t={...e};for(const[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var pO=e=>typeof e=="object"&&(Ut(e)||Array.isArray(e)||typeof e.toJSON=="function");function As({baseUrl:e,prepareHeaders:t=d=>d,fetchFn:r=Np,paramsSerializer:n,isJsonContentType:i=fO,jsonContentType:o="application/json",jsonReplacer:a,timeout:s,responseHandler:c,validateStatus:l,...u}={}){return async(f,m,g)=>{const{getState:h,extra:E,endpoint:S,forced:T,type:w}=m;let y,{url:I,headers:_=new Headers(u.headers),params:P=void 0,responseHandler:v=c??"json",validateStatus:M=l??dO,timeout:j=s,...A}=typeof f=="string"?{url:f}:f,k={...u,signal:j?uO(m.signal,cO(j)):m.signal,...A};_=new Headers(Dp(_)),k.headers=await t(_,{getState:h,arg:f,extra:E,endpoint:S,forced:T,type:w,extraOptions:g})||_;const D=pO(k.body);if(k.body!=null&&!D&&typeof k.body!="string"&&k.headers.delete("content-type"),!k.headers.has("content-type")&&D&&k.headers.set("content-type",o),D&&i(k.headers)&&(k.body=JSON.stringify(k.body,a)),k.headers.has("accept")||(v==="json"?k.headers.set("accept","application/json"):v==="text"&&k.headers.set("accept","text/plain, text/html, */*")),P){const O=~I.indexOf("?")?"&":"?",L=n?n(P):new URLSearchParams(Dp(P));I+=O+L}I=lO(e,I);const N=new Request(I,k);y={request:new Request(I,k)};let x;try{x=await r(N)}catch(O){return{error:{status:(O instanceof Error||typeof DOMException<"u"&&O instanceof DOMException)&&O.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(O)},meta:y}}const F=x.clone();y.response=F;let q,$="";try{let O;if(await Promise.all([d(x,v).then(L=>q=L,L=>O=L),F.text().then(L=>$=L,()=>{})]),O)throw O}catch(O){return{error:{status:"PARSING_ERROR",originalStatus:x.status,data:$,error:String(O)},meta:y}}return M(x,q)?{data:q,meta:y}:{error:{status:x.status,data:q},meta:y}};async function d(f,m){if(typeof m=="function")return m(f);if(m==="content-type"&&(m=i(f.headers)?"json":"text"),m==="json"){const g=await f.text();return g.length?JSON.parse(g):null}return f.text()}}var Lp=class{constructor(e,t=void 0){this.value=e,this.meta=t}value;meta},Xi="__rtkq/",Fp="online",xp="offline",mO="focus",Up="focused",hO="visibilitychange",Tn=Ne(`${Xi}${Up}`),Ji=Ne(`${Xi}un${Up}`),Cn=Ne(`${Xi}${Fp}`),Zi=Ne(`${Xi}${xp}`),gO={onFocus:Tn,onFocusLost:Ji,onOnline:Cn,onOffline:Zi},eo=!1;function yO(e,t){function r(){const[n,i,o,a]=[Tn,Ji,Cn,Zi].map(l=>()=>e(l())),s=()=>{window.document.visibilityState==="visible"?n():i()};let c=()=>{eo=!1};if(!eo&&typeof window<"u"&&window.addEventListener){let l=function(d){Object.entries(u).forEach(([f,m])=>{d?window.addEventListener(f,m,!1):window.removeEventListener(f,m)})};const u={[mO]:n,[hO]:s,[Fp]:o,[xp]:a};l(!0),eo=!0,c=()=>{l(!1),eo=!1}}return c}return t?t(e,gO):r()}var On="query",Bp="mutation",$p="infinitequery";function to(e){return e.type===On}function _O(e){return e.type===Bp}function ro(e){return e.type===$p}function no(e){return to(e)||ro(e)}function Ms(e,t,r,n,i,o){const a=vO(e)?e(t,r,n,i):e;return a?Ts(a,Cs,s=>o(qp(s))):[]}function vO(e){return typeof e=="function"}function qp(e){return typeof e=="string"?{type:e}:e}function bO(e,t){return e.catch(t)}var jr=(e,t)=>e.endpointDefinitions[t],An=Symbol("forceQueryFn"),ks=e=>typeof e[An]=="function";function EO({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:i,context:o,getInternalState:a}){const s=y=>a(y)?.runningQueries,c=y=>a(y)?.runningMutations,{unsubscribeQueryResult:l,removeMutationResult:u,updateSubscriptionOptions:d}=i.internalActions;return{buildInitiateQuery:S,buildInitiateInfiniteQuery:T,buildInitiateMutation:w,getRunningQueryThunk:f,getRunningMutationThunk:m,getRunningQueriesThunk:g,getRunningMutationsThunk:h};function f(y,I){return _=>{const P=e({queryArgs:I,endpointDefinition:jr(o,y),endpointName:y});return s(_)?.get(P)}}function m(y,I){return _=>c(_)?.get(I)}function g(){return y=>Rp(s(y))}function h(){return y=>Rp(c(y))}function E(y,I){const _=(P,{subscribe:v=!0,forceRefetch:M,subscriptionOptions:j,[An]:A,...k}={})=>(D,N)=>{const x=e({queryArgs:P,endpointDefinition:I,endpointName:y});let F;const q={...k,type:On,subscribe:v,forceRefetch:M,subscriptionOptions:j,endpointName:y,originalArgs:P,queryCacheKey:x,[An]:A};if(to(I))F=t(q);else{const{direction:K,initialPageParam:ie,refetchCachedPages:re}=k;F=r({...q,direction:K,initialPageParam:ie,refetchCachedPages:re})}const $=i.endpoints[y].select(P),O=D(F),L=$(N()),{requestId:U,abort:Y}=O,X=L.requestId!==U,J=s(D)?.get(x),V=()=>$(N()),G=Object.assign(A?O.then(V):X&&!J?Promise.resolve(L):Promise.all([J,O]).then(V),{arg:P,requestId:U,subscriptionOptions:j,queryCacheKey:x,abort:Y,async unwrap(){const K=await G;if(K.isError)throw K.error;return K.data},refetch:K=>D(_(P,{subscribe:!1,forceRefetch:!0,...K})),unsubscribe(){v&&D(l({queryCacheKey:x,requestId:U}))},updateSubscriptionOptions(K){G.subscriptionOptions=K,D(d({endpointName:y,requestId:U,queryCacheKey:x,options:K}))}});if(!J&&!X&&!A){const K=s(D);K.set(x,G),G.then(()=>{K.delete(x)})}return G};return _}function S(y,I){return E(y,I)}function T(y,I){return E(y,I)}function w(y){return(I,{track:_=!0,fixedCacheKey:P}={})=>(v,M)=>{const j=v(n({type:"mutation",endpointName:y,originalArgs:I,track:_,fixedCacheKey:P})),{requestId:A,abort:k,unwrap:D}=j,N=bO(j.unwrap().then($=>({data:$})),$=>({error:$})),x=()=>{v(u({requestId:A,fixedCacheKey:P}))},F=Object.assign(N,{arg:j.arg,requestId:A,abort:k,unwrap:D,reset:x}),q=c(v);return q.set(A,F),F.then(()=>{q.delete(A)}),P&&(q.set(P,F),F.then(()=>{q.get(P)===F&&q.delete(P)})),F}}}var zp=class extends rO{constructor(e,t,r,n){super(e),this.value=t,this.schemaName=r,this._bqMeta=n}value;schemaName;_bqMeta},lr=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function cr(e,t,r,n){const i=await e["~standard"].validate(t);if(i.issues)throw new zp(i.issues,t,r,n);return i.value}function Gp(e){return e}var Mn=(e={})=>({...e,[Ai]:!0});function wO({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:i,assertTagType:o,selectors:a,onSchemaFailure:s,catchSchemaFailure:c,skipSchemaValidation:l}){const u=(A,k,D,N)=>(x,F)=>{const q=r[A],$=n({queryArgs:k,endpointDefinition:q,endpointName:A});if(x(i.internalActions.queryResultPatched({queryCacheKey:$,patches:D})),!N)return;const O=i.endpoints[A].select(k)(F()),L=Ms(q.providesTags,O.data,void 0,k,{},o);x(i.internalActions.updateProvidedBy([{queryCacheKey:$,providedTags:L}]))};function d(A,k,D=0){const N=[k,...A];return D&&N.length>D?N.slice(0,-1):N}function f(A,k,D=0){const N=[...A,k];return D&&N.length>D?N.slice(1):N}const m=(A,k,D,N=!0)=>(x,F)=>{const q=i.endpoints[A].select(k)(F()),$={patches:[],inversePatches:[],undo:()=>x(i.util.patchQueryData(A,k,$.inversePatches,N))};if(q.status===Ot)return $;let O;if("data"in q)if(Re(q.data)){const[L,U,Y]=Gu(q.data,D);$.patches.push(...U),$.inversePatches.push(...Y),O=L}else O=D(q.data),$.patches.push({op:"replace",path:[],value:O}),$.inversePatches.push({op:"replace",path:[],value:q.data});return $.patches.length===0||x(i.util.patchQueryData(A,k,$.patches,N)),$},g=(A,k,D)=>N=>N(i.endpoints[A].initiate(k,{subscribe:!1,forceRefetch:!0,[An]:()=>({data:D})})),h=(A,k)=>A.query&&A[k]?A[k]:Gp,E=async(A,{signal:k,abort:D,rejectWithValue:N,fulfillWithValue:x,dispatch:F,getState:q,extra:$})=>{const O=r[A.endpointName],{metaSchema:L,skipSchemaValidation:U=l}=O,Y=A.type===On;try{let X=Gp;const J={signal:k,abort:D,dispatch:F,getState:q,extra:$,endpoint:A.endpointName,type:A.type,forced:Y?S(A,q()):void 0,queryCacheKey:Y?A.queryCacheKey:void 0},V=Y?A[An]:void 0;let G;const K=async(re,te,_t,Xe)=>{if(te==null&&re.pages.length)return Promise.resolve({data:re});const gr=await ie({queryArg:A.originalArgs,pageParam:te}),Nt=Xe?d:f;return{data:{pages:Nt(re.pages,gr.data,_t),pageParams:Nt(re.pageParams,te,_t)},meta:gr.meta}};async function ie(re){let te;const{extraOptions:_t,argSchema:Xe,rawResponseSchema:gr,responseSchema:Nt}=O;if(Xe&&!lr(U,"arg")&&(re=await cr(Xe,re,"argSchema",{})),V?te=V():O.query?(X=h(O,"transformResponse"),te=await t(O.query(re),J,_t)):te=await O.queryFn(re,J,_t,Zo=>t(Zo,J,_t)),te.error)throw new Lp(te.error,te.meta);let{data:yr}=te;gr&&!lr(U,"rawResponse")&&(yr=await cr(gr,te.data,"rawResponseSchema",te.meta));let Qt=await X(yr,te.meta,re);return Nt&&!lr(U,"response")&&(Qt=await cr(Nt,Qt,"responseSchema",te.meta)),{...te,data:Qt}}if(Y&&"infiniteQueryOptions"in O){const{infiniteQueryOptions:re}=O,{maxPages:te=1/0}=re,_t=A.refetchCachedPages??re.refetchCachedPages??!0;let Xe;const gr={pages:[],pageParams:[]},Nt=a.selectQueryEntry(q(),A.queryCacheKey)?.data,yr=S(A,q())&&!A.direction||!Nt?gr:Nt;if("direction"in A&&A.direction&&yr.pages.length){const Qt=A.direction==="backward";Xe=await K(yr,(Qt?Hp:js)(re,yr,A.originalArgs),te,Qt)}else{const{initialPageParam:Qt=re.initialPageParam}=A,Zo=Nt?.pageParams??[],xq=Zo[0]??Qt,Uq=Zo.length;if(Xe=await K(yr,xq,te),V&&(Xe={data:Xe.data.pages[0]}),_t)for(let Vv=1;Vv<Uq;Vv++){const Bq=js(re,Xe.data,A.originalArgs);Xe=await K(Xe.data,Bq,te)}}G=Xe}else G=await ie(A.originalArgs);return L&&!lr(U,"meta")&&G.meta&&(G.meta=await cr(L,G.meta,"metaSchema",G.meta)),x(G.data,Mn({fulfilledTimeStamp:Date.now(),baseQueryMeta:G.meta}))}catch(X){let J=X;if(J instanceof Lp){let V=h(O,"transformErrorResponse");const{rawErrorResponseSchema:G,errorResponseSchema:K}=O;let{value:ie,meta:re}=J;try{G&&!lr(U,"rawErrorResponse")&&(ie=await cr(G,ie,"rawErrorResponseSchema",re)),L&&!lr(U,"meta")&&(re=await cr(L,re,"metaSchema",re));let te=await V(ie,re,A.originalArgs);return K&&!lr(U,"errorResponse")&&(te=await cr(K,te,"errorResponseSchema",re)),N(te,Mn({baseQueryMeta:re}))}catch(te){J=te}}try{if(J instanceof zp){const V={endpoint:A.endpointName,arg:A.originalArgs,type:A.type,queryCacheKey:Y?A.queryCacheKey:void 0};O.onSchemaFailure?.(J,V),s?.(J,V);const{catchSchemaFailure:G=c}=O;if(G)return N(G(J,V),Mn({baseQueryMeta:J._bqMeta}))}}catch(V){J=V}throw J}};function S(A,k){const D=a.selectQueryEntry(k,A.queryCacheKey),N=a.selectConfig(k).refetchOnMountOrArgChange,x=D?.fulfilledTimeStamp,F=A.forceRefetch??(A.subscribe&&N);return F?F===!0||(Number(new Date)-Number(x))/1e3>=F:!1}const T=()=>Aa(`${e}/executeQuery`,E,{getPendingMeta({arg:A}){const k=r[A.endpointName];return Mn({startedTimeStamp:Date.now(),...ro(k)?{direction:A.direction}:{}})},condition(A,{getState:k}){const D=k(),N=a.selectQueryEntry(D,A.queryCacheKey),x=N?.fulfilledTimeStamp,F=A.originalArgs,q=N?.originalArgs,$=r[A.endpointName],O=A.direction;return ks(A)?!0:N?.status==="pending"?!1:S(A,D)||to($)&&$?.forceRefetch?.({currentArg:F,previousArg:q,endpointState:N,state:D})?!0:!(x&&!O)},dispatchConditionRejection:!0}),w=T(),y=T(),I=Aa(`${e}/executeMutation`,E,{getPendingMeta(){return Mn({startedTimeStamp:Date.now()})}}),_=A=>"force"in A,P=A=>"ifOlderThan"in A,v=(A,k,D={})=>(N,x)=>{const F=_(D)&&D.force,q=P(D)&&D.ifOlderThan,$=(L=!0)=>{const U={forceRefetch:L,subscribe:!1};return i.endpoints[A].initiate(k,U)},O=i.endpoints[A].select(k)(x());if(F)N($());else if(q){const L=O?.fulfilledTimeStamp;if(!L){N($());return}(Number(new Date)-Number(new Date(L)))/1e3>=q&&N($())}else N($(!1))};function M(A){return k=>k?.meta?.arg?.endpointName===A}function j(A,k){return{matchPending:fn(Ia(A),M(k)),matchFulfilled:fn(Bt(A),M(k)),matchRejected:fn(Sr(A),M(k))}}return{queryThunk:w,mutationThunk:I,infiniteQueryThunk:y,prefetch:v,updateQueryData:m,upsertQueryData:g,patchQueryData:u,buildMatchThunkActions:j}}function js(e,{pages:t,pageParams:r},n){const i=t.length-1;return e.getNextPageParam(t[i],t,r[i],r,n)}function Hp(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function Vp(e,t,r,n){return Ms(r[e.meta.arg.endpointName][t],Bt(e)?e.payload:void 0,ki(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Wp(e){return qe(e)?qu(e):e}function io(e,t,r){const n=e[t];n&&r(n)}function kn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Kp(e,t,r){const n=e[kn(t)];n&&r(n)}var oo={};function SO({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:i,apiUid:o,extractRehydrationInfo:a,hasRehydrationInfo:s},assertTagType:c,config:l}){const u=Ne(`${e}/resetApiState`);function d(P,v,M,j){P[v.queryCacheKey]??={status:Ot,endpointName:v.endpointName},io(P,v.queryCacheKey,A=>{A.status=Ps,A.requestId=M&&A.requestId?A.requestId:j.requestId,v.originalArgs!==void 0&&(A.originalArgs=v.originalArgs),A.startedTimeStamp=j.startedTimeStamp;const k=i[j.arg.endpointName];ro(k)&&"direction"in v&&(A.direction=v.direction)})}function f(P,v,M,j){io(P,v.arg.queryCacheKey,A=>{if(A.requestId!==v.requestId&&!j)return;const{merge:k}=i[v.arg.endpointName];if(A.status=Pn,k)if(A.data!==void 0){const{fulfilledTimeStamp:D,arg:N,baseQueryMeta:x,requestId:F}=v;A.data=un(A.data,q=>k(q,M,{arg:N.originalArgs,baseQueryMeta:x,fulfilledTimeStamp:D,requestId:F}))}else A.data=M;else A.data=i[v.arg.endpointName].structuralSharing??!0?Is(qe(A.data)?ew(A.data):A.data,M):M;delete A.error,A.fulfilledTimeStamp=v.fulfilledTimeStamp})}const m=Te({name:`${e}/queries`,initialState:oo,reducers:{removeQueryResult:{reducer(P,{payload:{queryCacheKey:v}}){delete P[v]},prepare:dn()},cacheEntriesUpserted:{reducer(P,v){for(const M of v.payload){const{queryDescription:j,value:A}=M;d(P,j,!0,{arg:j,requestId:v.meta.requestId,startedTimeStamp:v.meta.timestamp}),f(P,{arg:j,requestId:v.meta.requestId,fulfilledTimeStamp:v.meta.timestamp,baseQueryMeta:{}},A,!0)}},prepare:P=>({payload:P.map(v=>{const{endpointName:M,arg:j,value:A}=v,k=i[M];return{queryDescription:{type:On,endpointName:M,originalArgs:v.arg,queryCacheKey:n({queryArgs:j,endpointDefinition:k,endpointName:M})},value:A}}),meta:{[Ai]:!0,requestId:Ca(),timestamp:Date.now()}})},queryResultPatched:{reducer(P,{payload:{queryCacheKey:v,patches:M}}){io(P,v,j=>{j.data=Hu(j.data,M.concat())})},prepare:dn()}},extraReducers(P){P.addCase(t.pending,(v,{meta:M,meta:{arg:j}})=>{d(v,j,ks(j),M)}).addCase(t.fulfilled,(v,{meta:M,payload:j})=>{f(v,M,j,ks(M.arg))}).addCase(t.rejected,(v,{meta:{condition:M,arg:j,requestId:A},error:k,payload:D})=>{io(v,j.queryCacheKey,N=>{if(!M){if(N.requestId!==A)return;N.status=In,N.error=D??k}})}).addMatcher(s,(v,M)=>{const{queries:j}=a(M);for(const[A,k]of Object.entries(j))(k?.status===Pn||k?.status===In)&&(v[A]=k)})}}),g=Te({name:`${e}/mutations`,initialState:oo,reducers:{removeMutationResult:{reducer(P,{payload:v}){const M=kn(v);M in P&&delete P[M]},prepare:dn()}},extraReducers(P){P.addCase(r.pending,(v,{meta:M,meta:{requestId:j,arg:A,startedTimeStamp:k}})=>{A.track&&(v[kn(M)]={requestId:j,status:Ps,endpointName:A.endpointName,startedTimeStamp:k})}).addCase(r.fulfilled,(v,{payload:M,meta:j})=>{j.arg.track&&Kp(v,j,A=>{A.requestId===j.requestId&&(A.status=Pn,A.data=M,A.fulfilledTimeStamp=j.fulfilledTimeStamp)})}).addCase(r.rejected,(v,{payload:M,error:j,meta:A})=>{A.arg.track&&Kp(v,A,k=>{k.requestId===A.requestId&&(k.status=In,k.error=M??j)})}).addMatcher(s,(v,M)=>{const{mutations:j}=a(M);for(const[A,k]of Object.entries(j))(k?.status===Pn||k?.status===In)&&A!==k?.requestId&&(v[A]=k)})}}),h=Te({name:`${e}/invalidation`,initialState:{tags:{},keys:{}},reducers:{updateProvidedBy:{reducer(P,v){for(const{queryCacheKey:M,providedTags:j}of v.payload){E(P,M);for(const{type:A,id:k}of j){const D=(P.tags[A]??={})[k||"__internal_without_id"]??=[];D.includes(M)||D.push(M)}P.keys[M]=j}},prepare:dn()}},extraReducers(P){P.addCase(m.actions.removeQueryResult,(v,{payload:{queryCacheKey:M}})=>{E(v,M)}).addMatcher(s,(v,M)=>{const{provided:j}=a(M);for(const[A,k]of Object.entries(j.tags??{}))for(const[D,N]of Object.entries(k)){const x=(v.tags[A]??={})[D||"__internal_without_id"]??=[];for(const F of N)x.includes(F)||x.push(F),v.keys[F]=j.keys[F]}}).addMatcher(Pt(Bt(t),ki(t)),(v,M)=>{S(v,[M])}).addMatcher(m.actions.cacheEntriesUpserted.match,(v,M)=>{S(v,M.payload.map(({queryDescription:j,value:A})=>({type:"UNKNOWN",payload:A,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:j}})))})}});function E(P,v){const M=Wp(P.keys[v]??[]);for(const j of M){const A=j.type,k=j.id??"__internal_without_id",D=P.tags[A]?.[k];D&&(P.tags[A][k]=Wp(D).filter(N=>N!==v))}delete P.keys[v]}function S(P,v){const M=v.map(j=>{const A=Vp(j,"providesTags",i,c),{queryCacheKey:k}=j.meta.arg;return{queryCacheKey:k,providedTags:A}});h.caseReducers.updateProvidedBy(P,h.actions.updateProvidedBy(M))}const T=Te({name:`${e}/subscriptions`,initialState:oo,reducers:{updateSubscriptionOptions(P,v){},unsubscribeQueryResult(P,v){},internal_getRTKQSubscriptions(){}}}),w=Te({name:`${e}/internalSubscriptions`,initialState:oo,reducers:{subscriptionsUpdated:{reducer(P,v){return Hu(P,v.payload)},prepare:dn()}}}),y=Te({name:`${e}/config`,initialState:{online:oO(),focused:iO(),middlewareRegistered:!1,...l},reducers:{middlewareRegistered(P,{payload:v}){P.middlewareRegistered=P.middlewareRegistered==="conflict"||o!==v?"conflict":!0}},extraReducers:P=>{P.addCase(Cn,v=>{v.online=!0}).addCase(Zi,v=>{v.online=!1}).addCase(Tn,v=>{v.focused=!0}).addCase(Ji,v=>{v.focused=!1}).addMatcher(s,v=>({...v}))}}),I=fa({queries:m.reducer,mutations:g.reducer,provided:h.reducer,subscriptions:w.reducer,config:y.reducer});return{reducer:(P,v)=>I(u.match(v)?void 0:P,v),actions:{...y.actions,...m.actions,...T.actions,...w.actions,...g.actions,...h.actions,resetApiState:u}}}var ct=Symbol.for("RTKQ/skipToken"),Qp={status:Ot},Yp=un(Qp,()=>{}),Xp=un(Qp,()=>{});function PO({serializeQueryArgs:e,reducerPath:t,createSelector:r}){const n=w=>Yp,i=w=>Xp;return{buildQuerySelector:f,buildInfiniteQuerySelector:m,buildMutationSelector:g,selectInvalidatedBy:h,selectCachedArgsForQuery:E,selectApiState:a,selectQueries:s,selectMutations:l,selectQueryEntry:c,selectConfig:u};function o(w){return{...w,...kp(w.status)}}function a(w){return w[t]}function s(w){return a(w)?.queries}function c(w,y){return s(w)?.[y]}function l(w){return a(w)?.mutations}function u(w){return a(w)?.config}function d(w,y,I){return _=>{if(_===ct)return r(n,I);const P=e({queryArgs:_,endpointDefinition:y,endpointName:w});return r(M=>c(M,P)??Yp,I)}}function f(w,y){return d(w,y,o)}function m(w,y){const{infiniteQueryOptions:I}=y;function _(P){const v={...P,...kp(P.status)},{isLoading:M,isError:j,direction:A}=v,k=A==="forward",D=A==="backward";return{...v,hasNextPage:S(I,v.data,v.originalArgs),hasPreviousPage:T(I,v.data,v.originalArgs),isFetchingNextPage:M&&k,isFetchingPreviousPage:M&&D,isFetchNextPageError:j&&k,isFetchPreviousPageError:j&&D}}return d(w,y,_)}function g(){return(w=>{let y;return typeof w=="object"?y=kn(w)??ct:y=w,r(y===ct?i:_=>a(_)?.mutations?.[y]??Xp,o)})}function h(w,y){const I=w[t],_=new Set,P=Ts(y,Cs,qp);for(const v of P){const M=I.provided.tags[v.type];if(!M)continue;let j=(v.id!==void 0?M[v.id]:Object.values(M).flat())??[];for(const A of j)_.add(A)}return Array.from(_.values()).flatMap(v=>{const M=I.queries[v];return M?{queryCacheKey:v,endpointName:M.endpointName,originalArgs:M.originalArgs}:[]})}function E(w,y){return Ts(Object.values(s(w)),I=>I?.endpointName===y&&I.status!==Ot,I=>I.originalArgs)}function S(w,y,I){return y?js(w,y,I)!=null:!1}function T(w,y,I){return!y||!w.getPreviousPageParam?!1:Hp(w,y,I)!=null}}var Jp=WeakMap?new WeakMap:void 0,Zp=({endpointName:e,queryArgs:t})=>{let r="";const n=Jp?.get(t);if(typeof n=="string")r=n;else{const i=JSON.stringify(t,(o,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Ut(a)?Object.keys(a).sort().reduce((s,c)=>(s[c]=a[c],s),{}):a,a));Ut(t)&&Jp?.set(t,i),r=i}return`${e}(${r})`};function em(...e){return function(r){const n=Ci(l=>r.extractRehydrationInfo?.(l,{reducerPath:r.reducerPath??"api"})),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(l){let u=Zp;if("serializeQueryArgs"in l.endpointDefinition){const d=l.endpointDefinition.serializeQueryArgs;u=f=>{const m=d(f);return typeof m=="string"?m:Zp({...f,queryArgs:m})}}else r.serializeQueryArgs&&(u=r.serializeQueryArgs);return u(l)},tagTypes:[...r.tagTypes||[]]},o={endpointDefinitions:{},batch(l){l()},apiUid:Ca(),extractRehydrationInfo:n,hasRehydrationInfo:Ci(l=>n(l)!=null)},a={injectEndpoints:c,enhanceEndpoints({addTagTypes:l,endpoints:u}){if(l)for(const d of l)i.tagTypes.includes(d)||i.tagTypes.push(d);if(u)for(const[d,f]of Object.entries(u))typeof f=="function"?f(jr(o,d)):Object.assign(jr(o,d)||{},f);return a}},s=e.map(l=>l.init(a,i,o));function c(l){const u=l.endpoints({query:d=>({...d,type:On}),mutation:d=>({...d,type:Bp}),infiniteQuery:d=>({...d,type:$p})});for(const[d,f]of Object.entries(u)){if(l.overrideExisting!==!0&&d in o.endpointDefinitions){if(l.overrideExisting==="throw")throw new Error(Je(39));continue}o.endpointDefinitions[d]=f;for(const m of s)m.injectEndpoint(d,f)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function At(e,...t){return Object.assign(e,...t)}var IO=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{const i=`${e.reducerPath}/subscriptions`;let o=null,a=null;const{updateSubscriptionOptions:s,unsubscribeQueryResult:c}=e.internalActions,l=(h,E)=>{if(s.match(E)){const{queryCacheKey:T,requestId:w,options:y}=E.payload,I=h.get(T);return I?.has(w)&&I.set(w,y),!0}if(c.match(E)){const{queryCacheKey:T,requestId:w}=E.payload,y=h.get(T);return y&&y.delete(w),!0}if(e.internalActions.removeQueryResult.match(E))return h.delete(E.payload.queryCacheKey),!0;if(t.pending.match(E)){const{meta:{arg:T,requestId:w}}=E,y=Yi(h,T.queryCacheKey,Os);return T.subscribe&&y.set(w,T.subscriptionOptions??y.get(w)??{}),!0}let S=!1;if(t.rejected.match(E)){const{meta:{condition:T,arg:w,requestId:y}}=E;if(T&&w.subscribe){const I=Yi(h,w.queryCacheKey,Os);I.set(y,w.subscriptionOptions??I.get(y)??{}),S=!0}}return S},u=()=>r.currentSubscriptions,m={getSubscriptions:u,getSubscriptionCount:h=>u().get(h)?.size??0,isRequestSubscribed:(h,E)=>!!u()?.get(h)?.get(E)};function g(h){return JSON.parse(JSON.stringify(Object.fromEntries([...h].map(([E,S])=>[E,Object.fromEntries(S)]))))}return(h,E)=>{if(o||(o=g(r.currentSubscriptions)),e.util.resetApiState.match(h))return o={},r.currentSubscriptions.clear(),a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(h))return[!1,m];const S=l(r.currentSubscriptions,h);let T=!0;if(S){a||(a=setTimeout(()=>{const I=g(r.currentSubscriptions),[,_]=Gu(o,()=>I);E.next(e.internalActions.subscriptionsUpdated(_)),o=I,a=null},500));const w=typeof h.type=="string"&&!!h.type.startsWith(i),y=t.rejected.match(h)&&h.meta.condition&&!!h.meta.arg.subscribe;T=!w&&!y}return[T,!1]}},TO=2147483647/1e3-1,CO=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:i,selectors:{selectQueryEntry:o,selectConfig:a},getRunningQueryThunk:s,mwApi:c})=>{const{removeQueryResult:l,unsubscribeQueryResult:u,cacheEntriesUpserted:d}=t.internalActions,f=Pt(u.match,r.fulfilled,r.rejected,d.match);function m(w){const y=i.currentSubscriptions.get(w);return y?y.size>0:!1}const g={};function h(w){for(const y of w.values())y?.abort?.()}const E=(w,y)=>{const I=a(y.getState());if(f(w)){let _;if(d.match(w))_=w.payload.map(P=>P.queryDescription.queryCacheKey);else{const{queryCacheKey:P}=u.match(w)?w.payload:w.meta.arg;_=[P]}S(_,y,I)}if(t.util.resetApiState.match(w)){for(const[_,P]of Object.entries(g))P&&clearTimeout(P),delete g[_];h(i.runningQueries),h(i.runningMutations)}if(n.hasRehydrationInfo(w)){const{queries:_}=n.extractRehydrationInfo(w);S(Object.keys(_),y,I)}};function S(w,y,I){const _=y.getState();for(const P of w){const v=o(_,P);v?.endpointName&&T(P,v.endpointName,y,I)}}function T(w,y,I,_){const P=jr(n,y)?.keepUnusedDataFor??_.keepUnusedDataFor;if(P===1/0)return;const v=Math.max(0,Math.min(P,TO));if(!m(w)){const M=g[w];M&&clearTimeout(M),g[w]=setTimeout(()=>{if(!m(w)){const j=o(I.getState(),w);j?.endpointName&&I.dispatch(s(j.endpointName,j.originalArgs))?.abort(),I.dispatch(l({queryCacheKey:w}))}delete g[w]},v*1e3)}}return E},tm=new Error("Promise never resolved before cacheEntryRemoved."),OO=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:i,internalState:o,selectors:{selectQueryEntry:a,selectApiState:s}})=>{const c=Ta(n),l=Ta(i),u=Bt(n,i),d={},{removeQueryResult:f,removeMutationResult:m,cacheEntriesUpserted:g}=e.internalActions;function h(I,_,P){const v=d[I];v?.valueResolved&&(v.valueResolved({data:_,meta:P}),delete v.valueResolved)}function E(I){const _=d[I];_&&(delete d[I],_.cacheEntryRemoved())}function S(I){const{arg:_,requestId:P}=I.meta,{endpointName:v,originalArgs:M}=_;return[v,M,P]}const T=(I,_,P)=>{const v=w(I);function M(j,A,k,D){const N=a(P,A),x=a(_.getState(),A);!N&&x&&y(j,D,A,_,k)}if(n.pending.match(I)){const[j,A,k]=S(I);M(j,v,k,A)}else if(g.match(I))for(const{queryDescription:j,value:A}of I.payload){const{endpointName:k,originalArgs:D,queryCacheKey:N}=j;M(k,N,I.meta.requestId,D),h(N,A,{})}else if(i.pending.match(I)){if(_.getState()[t].mutations[v]){const[j,A,k]=S(I);y(j,A,v,_,k)}}else if(u(I))h(v,I.payload,I.meta.baseQueryMeta);else if(f.match(I)||m.match(I))E(v);else if(e.util.resetApiState.match(I))for(const j of Object.keys(d))E(j)};function w(I){return c(I)?I.meta.arg.queryCacheKey:l(I)?I.meta.arg.fixedCacheKey??I.meta.requestId:f.match(I)?I.payload.queryCacheKey:m.match(I)?kn(I.payload):""}function y(I,_,P,v,M){const j=jr(r,I),A=j?.onCacheEntryAdded;if(!A)return;const k={},D=new Promise($=>{k.cacheEntryRemoved=$}),N=Promise.race([new Promise($=>{k.valueResolved=$}),D.then(()=>{throw tm})]);N.catch(()=>{}),d[P]=k;const x=e.endpoints[I].select(no(j)?_:P),F=v.dispatch(($,O,L)=>L),q=A(_,{...v,getCacheEntry:()=>x(v.getState()),requestId:M,extra:F,updateCachedData:no(j)?$=>v.dispatch(e.util.updateQueryData(I,_,$)):void 0,cacheDataLoaded:N,cacheEntryRemoved:D});Promise.resolve(q).catch($=>{if($!==tm)throw $})}return T},AO=({api:e,context:{apiUid:t},reducerPath:r})=>(n,i)=>{e.util.resetApiState.match(n)&&i.dispatch(e.internalActions.middlewareRegistered(t))},MO=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:i,api:o,assertTagType:a,refetchQuery:s,internalState:c})=>{const{removeQueryResult:l}=o.internalActions,u=Pt(Bt(n),ki(n)),d=Pt(Bt(i,n),Sr(i,n));let f=[],m=0;const g=(S,T)=>{(i.pending.match(S)||n.pending.match(S))&&m++,d(S)&&(m=Math.max(0,m-1)),u(S)?E(Vp(S,"invalidatesTags",r,a),T):d(S)?E([],T):o.util.invalidateTags.match(S)&&E(Ms(S.payload,void 0,void 0,void 0,void 0,a),T)};function h(){return m>0}function E(S,T){const w=T.getState(),y=w[e];if(f.push(...S),y.config.invalidationBehavior==="delayed"&&h())return;const I=f;if(f=[],I.length===0)return;const _=o.util.selectInvalidatedBy(w,I);t.batch(()=>{const P=Array.from(_.values());for(const{queryCacheKey:v}of P){const M=y.queries[v],j=Yi(c.currentSubscriptions,v,Os);M&&(j.size===0?T.dispatch(l({queryCacheKey:v})):M.status!==Ot&&T.dispatch(s(M)))}})}return g},kO=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:i})=>{const{currentPolls:o,currentSubscriptions:a}=i,s=new Set;let c=null;const l=(E,S)=>{(r.internalActions.updateSubscriptionOptions.match(E)||r.internalActions.unsubscribeQueryResult.match(E))&&u(E.payload.queryCacheKey,S),(t.pending.match(E)||t.rejected.match(E)&&E.meta.condition)&&u(E.meta.arg.queryCacheKey,S),(t.fulfilled.match(E)||t.rejected.match(E)&&!E.meta.condition)&&d(E.meta.arg,S),r.util.resetApiState.match(E)&&(g(),c&&(clearTimeout(c),c=null),s.clear())};function u(E,S){s.add(E),c||(c=setTimeout(()=>{for(const T of s)f({queryCacheKey:T},S);s.clear(),c=null},0))}function d({queryCacheKey:E},S){const T=S.getState()[e],w=T.queries[E],y=a.get(E);if(!w||w.status===Ot)return;const{lowestPollingInterval:I,skipPollingIfUnfocused:_}=h(y);if(!Number.isFinite(I))return;const P=o.get(E);P?.timeout&&(clearTimeout(P.timeout),P.timeout=void 0);const v=Date.now()+I;o.set(E,{nextPollTimestamp:v,pollingInterval:I,timeout:setTimeout(()=>{(T.config.focused||!_)&&S.dispatch(n(w)),d({queryCacheKey:E},S)},I)})}function f({queryCacheKey:E},S){const T=S.getState()[e].queries[E],w=a.get(E);if(!T||T.status===Ot)return;const{lowestPollingInterval:y}=h(w);if(!Number.isFinite(y)){m(E);return}const I=o.get(E),_=Date.now()+y;(!I||_<I.nextPollTimestamp)&&d({queryCacheKey:E},S)}function m(E){const S=o.get(E);S?.timeout&&clearTimeout(S.timeout),o.delete(E)}function g(){for(const E of o.keys())m(E)}function h(E=new Map){let S=!1,T=Number.POSITIVE_INFINITY;for(const w of E.values())w.pollingInterval&&(T=Math.min(w.pollingInterval,T),S=w.skipPollingIfUnfocused||S);return{lowestPollingInterval:T,skipPollingIfUnfocused:S}}return l},jO=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{const i=Ia(r,n),o=Sr(r,n),a=Bt(r,n),s={};return(l,u)=>{if(i(l)){const{requestId:d,arg:{endpointName:f,originalArgs:m}}=l.meta,g=jr(t,f),h=g?.onQueryStarted;if(h){const E={},S=new Promise((y,I)=>{E.resolve=y,E.reject=I});S.catch(()=>{}),s[d]=E;const T=e.endpoints[f].select(no(g)?m:d),w=u.dispatch((y,I,_)=>_);h(m,{...u,getCacheEntry:()=>T(u.getState()),requestId:d,extra:w,updateCachedData:no(g)?y=>u.dispatch(e.util.updateQueryData(f,m,y)):void 0,queryFulfilled:S})}}else if(a(l)){const{requestId:d,baseQueryMeta:f}=l.meta;s[d]?.resolve({data:l.payload,meta:f}),delete s[d]}else if(o(l)){const{requestId:d,rejectedWithValue:f,baseQueryMeta:m}=l.meta;s[d]?.reject({error:l.payload??l.error,isUnhandledError:!f,meta:m}),delete s[d]}}},RO=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:i})=>{const{removeQueryResult:o}=r.internalActions,a=(c,l)=>{Tn.match(c)&&s(l,"refetchOnFocus"),Cn.match(c)&&s(l,"refetchOnReconnect")};function s(c,l){const u=c.getState()[e],d=u.queries,f=i.currentSubscriptions;t.batch(()=>{for(const m of f.keys()){const g=d[m],h=f.get(m);if(!h||!g)continue;const E=[...h.values()];(E.some(S=>S[l]===!0)||E.every(S=>S[l]===void 0)&&u.config[l])&&(h.size===0?c.dispatch(o({queryCacheKey:m})):g.status!==Ot&&c.dispatch(n(g)))}})}return a};function NO(e){const{reducerPath:t,queryThunk:r,api:n,context:i,getInternalState:o}=e,{apiUid:a}=i,s={invalidateTags:Ne(`${t}/invalidateTags`)},c=f=>f.type.startsWith(`${t}/`),l=[AO,CO,MO,kO,OO,jO];return{middleware:f=>{let m=!1;const g=o(f.dispatch),h={...e,internalState:g,refetchQuery:d,isThisApiSliceAction:c,mwApi:f},E=l.map(w=>w(h)),S=IO(h),T=RO(h);return w=>y=>{if(!iu(y))return w(y);m||(m=!0,f.dispatch(n.internalActions.middlewareRegistered(a)));const I={...f,next:w},_=f.getState(),[P,v]=S(y,I,_);let M;if(P?M=w(y):M=v,f.getState()[t]&&(T(y,I,_),c(y)||i.hasRehydrationInfo(y)))for(const j of E)j(y,I,_);return M}},actions:s};function d(f){return e.api.endpoints[f.endpointName].initiate(f.originalArgs,{subscribe:!1,forceRefetch:!0})}}var rm=Symbol(),nm=({createSelector:e=Qu}={})=>({name:rm,init(t,{baseQuery:r,tagTypes:n,reducerPath:i,serializeQueryArgs:o,keepUnusedDataFor:a,refetchOnMountOrArgChange:s,refetchOnFocus:c,refetchOnReconnect:l,invalidationBehavior:u,onSchemaFailure:d,catchSchemaFailure:f,skipSchemaValidation:m},g){gw();const h=K=>K;Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:Cn,onOffline:Zi,onFocus:Tn,onFocusLost:Ji},util:{}});const E=PO({serializeQueryArgs:o,reducerPath:i,createSelector:e}),{selectInvalidatedBy:S,selectCachedArgsForQuery:T,buildQuerySelector:w,buildInfiniteQuerySelector:y,buildMutationSelector:I}=E;At(t.util,{selectInvalidatedBy:S,selectCachedArgsForQuery:T});const{queryThunk:_,infiniteQueryThunk:P,mutationThunk:v,patchQueryData:M,updateQueryData:j,upsertQueryData:A,prefetch:k,buildMatchThunkActions:D}=wO({baseQuery:r,reducerPath:i,context:g,api:t,serializeQueryArgs:o,assertTagType:h,selectors:E,onSchemaFailure:d,catchSchemaFailure:f,skipSchemaValidation:m}),{reducer:N,actions:x}=SO({context:g,queryThunk:_,infiniteQueryThunk:P,mutationThunk:v,serializeQueryArgs:o,reducerPath:i,assertTagType:h,config:{refetchOnFocus:c,refetchOnReconnect:l,refetchOnMountOrArgChange:s,keepUnusedDataFor:a,reducerPath:i,invalidationBehavior:u}});At(t.util,{patchQueryData:M,updateQueryData:j,upsertQueryData:A,prefetch:k,resetApiState:x.resetApiState,upsertQueryEntries:x.cacheEntriesUpserted}),At(t.internalActions,x);const F=new WeakMap,q=K=>Yi(F,K,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:$,buildInitiateInfiniteQuery:O,buildInitiateMutation:L,getRunningMutationThunk:U,getRunningMutationsThunk:Y,getRunningQueriesThunk:X,getRunningQueryThunk:J}=EO({queryThunk:_,mutationThunk:v,infiniteQueryThunk:P,api:t,serializeQueryArgs:o,context:g,getInternalState:q});At(t.util,{getRunningMutationThunk:U,getRunningMutationsThunk:Y,getRunningQueryThunk:J,getRunningQueriesThunk:X});const{middleware:V,actions:G}=NO({reducerPath:i,context:g,queryThunk:_,mutationThunk:v,infiniteQueryThunk:P,api:t,assertTagType:h,selectors:E,getRunningQueryThunk:J,getInternalState:q});return At(t.util,G),At(t,{reducer:N,middleware:V}),{name:rm,injectEndpoint(K,ie){const re=t,te=re.endpoints[K]??={};to(ie)&&At(te,{name:K,select:w(K,ie),initiate:$(K,ie)},D(_,K)),_O(ie)&&At(te,{name:K,select:I(),initiate:L(K)},D(v,K)),ro(ie)&&At(te,{name:K,select:y(K,ie),initiate:O(K,ie)},D(_,K))}}}}),uz=em(nm()),DO=class{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...e)=>fetch(...e);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(e={}){Object.assign(this,e)}setSecurityData=e=>{this.securityData=e};encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent(typeof t=="number"?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(r=>this.encodeQueryParam(t,r)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(r=>typeof t[r]<"u").map(r=>Array.isArray(t[r])?this.addArrayQueryParam(t,r):this.addQueryParam(t,r)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}contentFormatters={"application/json":e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,"text/plain":e=>e!==null&&typeof e!="string"?JSON.stringify(e):e,"multipart/form-data":e=>Object.keys(e||{}).reduce((t,r)=>{const n=e[r];return t.append(r,n instanceof Blob?n:typeof n=="object"&&n!==null?JSON.stringify(n):`${n}`),t},new FormData),"application/x-www-form-urlencoded":e=>this.toQueryString(e)};mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}createAbortSignal=e=>{if(this.abortControllers.has(e)){const r=this.abortControllers.get(e);return r?r.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal};abortRequest=e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))};async request({body:e,secure:t,path:r,type:n,query:i,format:o,baseUrl:a,cancelToken:s,extraQuery:c,proxyHandler:l,...u}){const d=(typeof t=="boolean"?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},f=this.mergeRequestParams(u,d);c&&(i=i?{...i,...c}:c);const m=i&&this.toQueryString(i),g=this.contentFormatters[n||"application/json"],h=o||f.format,E=`${a||this.baseUrl||""}${r}${m?`?${m}`:""}`,S=l?l(E,{body:e,secure:t,path:r,type:n,query:i,format:o,baseUrl:a,cancelToken:s,extraQuery:c,proxyHandler:l,...u}):E,T=new Request(S,{...f,headers:{...f.headers||{},...n&&n!=="multipart/form-data"?{"Content-Type":n}:{}},signal:(s?this.createAbortSignal(s):f.signal)||null,body:typeof e>"u"||e===null?null:g(e)});return this.customFetch(T).then(async w=>{const y=w;y.data=null,y.error=null,y.meta={request:T,response:y};const I=h?await w[h]().then(_=>(y.ok?y.data=_:y.error={data:_},y)).catch(_=>(y.error=_,y)):y;return s&&this.abortControllers.delete(s),I})}},LO=class extends DO{unsplashTest={appControllerGetUnsplashTest:(e={})=>this.request({path:"/unsplash_test",method:"GET",...e})};tasks={tasksControllerCreateTask:(e,t={})=>this.request({path:"/tasks",method:"POST",body:e,type:"application/json",...t}),tasksControllerGetTask:({id:e,...t},r={})=>this.request({path:`/tasks/${e}`,method:"GET",...r}),tasksControllerGetEmail:({id:e,...t},r={})=>this.request({path:`/tasks/${e}/email`,method:"GET",...r}),tasksControllerGetEmailHtml:({id:e,...t},r={})=>this.request({path:`/tasks/${e}/html`,method:"GET",...r})};parsing={manParseControllerLogoGen:(e,t={})=>this.request({path:"/parsing/logo-gen",method:"GET",query:e,...t}),manParseControllerSite:(e,t={})=>this.request({path:"/parsing/site",method:"GET",query:e,...t}),manParseControllerColor:(e,t={})=>this.request({path:"/parsing/color",method:"GET",query:e,...t}),manParseControllerStyle:(e,t={})=>this.request({path:"/parsing/style",method:"GET",query:e,...t}),manParseControllerColorScheme:(e,t={})=>this.request({path:"/parsing/color-scheme",method:"GET",query:e,...t}),manParseControllerImage:(e,t={})=>this.request({path:"/parsing/image",method:"GET",query:e,...t})};maintenance={maintenanceControllerReloadBlocks:(e={})=>this.request({path:"/maintenance/reload-blocks",method:"GET",...e}),maintenanceControllerReloadUnsplashTopics:(e={})=>this.request({path:"/maintenance/reload-unsplash-topics",method:"GET",...e})};unsplash={unsplashControllerUnsplashTest:(e={})=>this.request({path:"/unsplash/test",method:"GET",...e}),unsplashControllerSearchPhotos:(e,t={})=>this.request({path:"/unsplash/search",method:"GET",query:e,...t}),unsplashControllerGetTopics:(e={})=>this.request({path:"/unsplash/topics",method:"GET",...e}),unsplashControllerGetPhoto:(e,t={})=>this.request({path:"/unsplash/photo",method:"GET",query:e,...t})}},W=(function(e){return e.Json="application/json",e.JsonApi="application/vnd.api+json",e.FormData="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Text="text/plain",e})({}),im=class{baseUrl="/api/v2";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...e)=>fetch(...e);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(e={}){Object.assign(this,e)}setSecurityData=e=>{this.securityData=e};encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent(typeof t=="number"?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(r=>this.encodeQueryParam(t,r)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(r=>typeof t[r]<"u").map(r=>Array.isArray(t[r])?this.addArrayQueryParam(t,r):this.addQueryParam(t,r)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}contentFormatters={"application/json":e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,"application/vnd.api+json":e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,"text/plain":e=>e!==null&&typeof e!="string"?JSON.stringify(e):e,"multipart/form-data":e=>e instanceof FormData?e:Object.keys(e||{}).reduce((t,r)=>{const n=e[r];return t.append(r,n instanceof Blob?n:typeof n=="object"&&n!==null?JSON.stringify(n):`${n}`),t},new FormData),"application/x-www-form-urlencoded":e=>this.toQueryString(e)};mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}createAbortSignal=e=>{if(this.abortControllers.has(e)){const r=this.abortControllers.get(e);return r?r.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal};abortRequest=e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))};request=async({body:e,secure:t,path:r,type:n,query:i,format:o,baseUrl:a,cancelToken:s,...c})=>{const l=(typeof t=="boolean"?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},u=this.mergeRequestParams(c,l),d=i&&this.toQueryString(i),f=this.contentFormatters[n||"application/json"],m=o||u.format;return this.customFetch(`${a||this.baseUrl||""}${r}${d?`?${d}`:""}`,{...u,headers:{...u.headers||{},...n&&n!=="multipart/form-data"?{"Content-Type":n}:{}},signal:(s?this.createAbortSignal(s):u.signal)||null,body:typeof e>"u"||e===null?null:f(e)}).then(async g=>{const h=g;h.data=null,h.error=null;const E=m?g.clone():g,S=m?await E[m]().then(T=>(h.ok?h.data=T:h.error=T,h)).catch(T=>(h.error=T,h)):h;return s&&this.abortControllers.delete(s),S})}},FO=class{http;constructor(e){this.http=e}appTokenCreate=(e,t={})=>this.http.request({path:"/auth/app/token",method:"POST",body:e,type:W.Json,format:"json",...t});captchaConfigList=(e={})=>this.http.request({path:"/auth/captcha-config",method:"GET",format:"json",...e});elamaCreate=(e,t={})=>this.http.request({path:"/auth/elama",method:"POST",body:e,type:W.Json,format:"json",...t});googleCreate=(e,t={})=>this.http.request({path:"/auth/google",method:"POST",body:e,type:W.Json,format:"json",...t});passwordChangeCreate=(e,t={})=>this.http.request({path:"/auth/password/change",method:"POST",body:e,secure:!0,type:W.Json,...t});passwordResetCreate=(e,t={})=>this.http.request({path:"/auth/password/reset",method:"POST",body:e,type:W.Json,...t});passwordResetConfirmCreate=(e,t={})=>this.http.request({path:"/auth/password/reset/confirm",method:"POST",body:e,type:W.Json,...t});registerCreate=(e,t={})=>this.http.request({path:"/auth/register",method:"POST",body:e,type:W.Json,format:"json",...t});tokenDelete=(e={})=>this.http.request({path:"/auth/token",method:"DELETE",secure:!0,...e});tokenCreate=(e,t={})=>this.http.request({path:"/auth/token",method:"POST",body:e,type:W.Json,format:"json",...t});tokenRefreshCreate=(e,t={})=>this.http.request({path:"/auth/token/refresh",method:"POST",body:e,type:W.Json,format:"json",...t});userList=(e={})=>this.http.request({path:"/auth/user",method:"GET",secure:!0,format:"json",...e});userPartialUpdate=(e,t={})=>this.http.request({path:"/auth/user",method:"PATCH",body:e,secure:!0,type:W.Json,format:"json",...t});yandexCreate=(e,t={})=>this.http.request({path:"/auth/yandex",method:"POST",body:e,type:W.Json,format:"json",...t})},xO=class{http;constructor(e){this.http=e}planInvalidateCreate=(e={})=>this.http.request({path:"/billing/plan/invalidate",method:"POST",secure:!0,format:"json",...e})},UO=class{http;constructor(e){this.http=e}projectsList=(e={},t={})=>this.http.request({path:"/projects",method:"GET",query:e,secure:!0,format:"json",...t});projectsCreate=(e,t={})=>this.http.request({path:"/projects",method:"POST",body:e,secure:!0,type:W.Json,format:"json",...t});projectsDelete=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}`,method:"DELETE",query:t,secure:!0,...r});projectsDetail=({id:e},t={})=>this.http.request({path:`/projects/${e}`,method:"GET",secure:!0,format:"json",...t});projectsPartialUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}`,method:"PATCH",body:t,secure:!0,type:W.Json,format:"json",...r});blockFoldersList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/block-folders`,method:"GET",query:t,secure:!0,format:"json",...r});blockFoldersCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/block-folders`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});blockFoldersDelete=({id:e,termId:t},r={})=>this.http.request({path:`/projects/${e}/block-folders/${t}`,method:"DELETE",secure:!0,...r});blockFoldersPartialUpdate=({id:e,termId:t},r,n={})=>this.http.request({path:`/projects/${e}/block-folders/${t}`,method:"PATCH",body:r,secure:!0,type:W.Json,format:"json",...n});blockTagsList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/block-tags`,method:"GET",query:t,secure:!0,format:"json",...r});blockTagsCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/block-tags`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});blockTagsDelete=({id:e,termId:t},r={})=>this.http.request({path:`/projects/${e}/block-tags/${t}`,method:"DELETE",secure:!0,...r});blockTagsPartialUpdate=({id:e,termId:t},r,n={})=>this.http.request({path:`/projects/${e}/block-tags/${t}`,method:"PATCH",body:r,secure:!0,type:W.Json,format:"json",...n});emailTagsList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/email-tags`,method:"GET",query:t,secure:!0,format:"json",...r});emailTagsCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/email-tags`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});emailTagsDelete=({id:e,termId:t},r={})=>this.http.request({path:`/projects/${e}/email-tags/${t}`,method:"DELETE",secure:!0,...r});emailTagsPartialUpdate=({id:e,termId:t},r,n={})=>this.http.request({path:`/projects/${e}/email-tags/${t}`,method:"PATCH",body:r,secure:!0,type:W.Json,format:"json",...n});foldersList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/folders`,method:"GET",query:t,secure:!0,format:"json",...r});foldersCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/folders`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});foldersDelete=({id:e,termId:t},r={})=>this.http.request({path:`/projects/${e}/folders/${t}`,method:"DELETE",secure:!0,...r});foldersPartialUpdate=({id:e,termId:t},r,n={})=>this.http.request({path:`/projects/${e}/folders/${t}`,method:"PATCH",body:r,secure:!0,type:W.Json,format:"json",...n});groupsList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/groups`,method:"GET",query:t,secure:!0,format:"json",...r});groupsCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/groups`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});groupsDelete=({id:e,termId:t},r={})=>this.http.request({path:`/projects/${e}/groups/${t}`,method:"DELETE",secure:!0,...r});groupsPartialUpdate=({id:e,termId:t},r,n={})=>this.http.request({path:`/projects/${e}/groups/${t}`,method:"PATCH",body:r,secure:!0,type:W.Json,format:"json",...n});integrationsList=({id:e},t={})=>this.http.request({path:`/projects/${e}/integrations`,method:"GET",secure:!0,format:"json",...t});integrationsDelete=({id:e,provider:t},r={})=>this.http.request({path:`/projects/${e}/integrations/${t}`,method:"DELETE",secure:!0,...r});integrationsDetail=({id:e,provider:t,...r},n={})=>this.http.request({path:`/projects/${e}/integrations/${t}`,method:"GET",query:r,secure:!0,format:"json",...n});integrationsUpdate=({id:e,provider:t},r,n={})=>this.http.request({path:`/projects/${e}/integrations/${t}`,method:"PUT",body:r,secure:!0,type:W.Json,format:"json",...n});integrationsCheckCreate=({id:e,provider:t},r={})=>this.http.request({path:`/projects/${e}/integrations/${t}/check`,method:"POST",secure:!0,format:"json",...r});invitesDelete=({id:e,email:t},r={})=>this.http.request({path:`/projects/${e}/invites/${t}`,method:"DELETE",secure:!0,...r});membersList=({id:e},t={})=>this.http.request({path:`/projects/${e}/members`,method:"GET",secure:!0,format:"json",...t});membersCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/members`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});membersDelete=({id:e,userId:t},r={})=>this.http.request({path:`/projects/${e}/members/${t}`,method:"DELETE",secure:!0,...r});membersPartialUpdate=({id:e,userId:t},r,n={})=>this.http.request({path:`/projects/${e}/members/${t}`,method:"PATCH",body:r,secure:!0,type:W.Json,format:"json",...n});membersMeDelete=({id:e},t={})=>this.http.request({path:`/projects/${e}/members/me`,method:"DELETE",secure:!0,...t});planList=({id:e},t={})=>this.http.request({path:`/projects/${e}/plan`,method:"GET",secure:!0,format:"json",...t});pluginInstancesList=({id:e},t={})=>this.http.request({path:`/projects/${e}/plugin/instances`,method:"GET",secure:!0,format:"json",...t});pluginInstancesCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/plugin/instances`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});pluginInstancesDelete=({id:e,instanceId:t},r={})=>this.http.request({path:`/projects/${e}/plugin/instances/${t}`,method:"DELETE",secure:!0,...r});pluginInstancesPartialUpdate=({id:e,instanceId:t},r,n={})=>this.http.request({path:`/projects/${e}/plugin/instances/${t}`,method:"PATCH",body:r,secure:!0,type:W.Json,format:"json",...n});pluginInstancesRotateSecretCreate=({id:e,instanceId:t},r={})=>this.http.request({path:`/projects/${e}/plugin/instances/${t}/rotate-secret`,method:"POST",secure:!0,format:"json",...r});profileList=({id:e},t={})=>this.http.request({path:`/projects/${e}/profile`,method:"GET",secure:!0,format:"json",...t});profilePartialUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/profile`,method:"PATCH",body:t,secure:!0,type:W.Json,format:"json",...r});restoreCreate=({id:e},t={})=>this.http.request({path:`/projects/${e}/restore`,method:"POST",secure:!0,...t});settingsUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/settings`,method:"PUT",body:t,secure:!0,type:W.Json,format:"json",...r});storageDelete=({id:e},t={})=>this.http.request({path:`/projects/${e}/storage`,method:"DELETE",secure:!0,format:"json",...t});storageList=({id:e},t={})=>this.http.request({path:`/projects/${e}/storage`,method:"GET",secure:!0,format:"json",...t});storageUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/storage`,method:"PUT",body:t,secure:!0,type:W.Json,format:"json",...r});storageTestCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/storage/test`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});stripoFoldersList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/stripo/folders`,method:"GET",query:t,secure:!0,format:"json",...r});stripoImportsCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/stripo/imports`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});stripoImportsDetail=({id:e,jobId:t},r={})=>this.http.request({path:`/projects/${e}/stripo/imports/${t}`,method:"GET",secure:!0,format:"json",...r});stripoImportsCurrentList=({id:e},t={})=>this.http.request({path:`/projects/${e}/stripo/imports/current`,method:"GET",secure:!0,format:"json",...t});stripoItemsList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/stripo/items`,method:"GET",query:t,secure:!0,format:"json",...r});stripoKeyUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/stripo/key`,method:"PUT",body:t,secure:!0,type:W.Json,...r});stylesList=({id:e},t={})=>this.http.request({path:`/projects/${e}/styles`,method:"GET",secure:!0,format:"json",...t});stylesPartialUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/styles`,method:"PATCH",body:t,secure:!0,type:W.Json,format:"json",...r});stylesFontsCreate=({id:e},t={})=>this.http.request({path:`/projects/${e}/styles/fonts`,method:"POST",secure:!0,format:"json",...t});templateCategoriesCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/template-categories`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});templateCategoriesDelete=({id:e,categoryId:t},r={})=>this.http.request({path:`/projects/${e}/template-categories/${t}`,method:"DELETE",secure:!0,...r});templateCategoriesPartialUpdate=({id:e,categoryId:t},r,n={})=>this.http.request({path:`/projects/${e}/template-categories/${t}`,method:"PATCH",body:r,secure:!0,type:W.Json,format:"json",...n});templateSectionsList=({id:e},t={})=>this.http.request({path:`/projects/${e}/template-sections`,method:"GET",secure:!0,format:"json",...t});templateSectionsCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/template-sections`,method:"POST",body:t,secure:!0,type:W.Json,format:"json",...r});templateSectionsDelete=({id:e,sectionId:t},r={})=>this.http.request({path:`/projects/${e}/template-sections/${t}`,method:"DELETE",secure:!0,...r});templateSectionsPartialUpdate=({id:e,sectionId:t},r,n={})=>this.http.request({path:`/projects/${e}/template-sections/${t}`,method:"PATCH",body:r,secure:!0,type:W.Json,format:"json",...n});testRecipientsList=({id:e},t={})=>this.http.request({path:`/projects/${e}/test-recipients`,method:"GET",secure:!0,format:"json",...t});testRecipientsUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/test-recipients`,method:"PUT",body:t,secure:!0,type:W.Json,format:"json",...r});webhookDelete=({id:e},t={})=>this.http.request({path:`/projects/${e}/webhook`,method:"DELETE",secure:!0,...t});webhookList=({id:e},t={})=>this.http.request({path:`/projects/${e}/webhook`,method:"GET",secure:!0,format:"json",...t});webhookUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/webhook`,method:"PUT",body:t,secure:!0,type:W.Json,format:"json",...r});profileOptionsList=(e={})=>this.http.request({path:"/projects/profile/options",method:"GET",secure:!0,format:"json",...e});topUsedList=(e={},t={})=>this.http.request({path:"/projects/top-used",method:"GET",query:e,secure:!0,format:"json",...t})},dz=C.createIdentifier$1("rest.v2.transport");function om(e,t){if(e!=null&&typeof e=="object"){const r=e[t];if(typeof r=="string"&&r!=="")return r}}function am(e){const t=e.error,r=t?.error;return r&&typeof r=="object"?{status:e.status,data:{code:om(r.details,"wp_code")??r.code,message:om(r.details,"wp_message")??r.message,details:r.details}}:t&&typeof t=="object"?{status:e.status,data:t}:{status:e.status,data:{message:e.statusText||"request failed"}}}function BO(e){return!e.ok||!!e.error}function $O(e){return BO(e)?{error:am(e)}:{data:e.data}}var qO=class extends im{auth=new FO(this);billing=new xO(this);projects=new UO(this)},zO=e=>e.getOrCreateInstance(C.V2REST_CLIENT_ID,()=>{const t=e.getInstance(C.CUSTOM_FETCH_ID);return new qO({baseUrl:"https://app.emailmaker.ru/api/v2",customFetch:t?.execute??C.globalFetch})}),Oe=e=>zO(e),GO=e=>am(e),Le=e=>$O(e),jn=e=>e.getInstance(C.REST_CLIENT_ID),HO=e=>e.getOrCreateInstance(C.AIREST_CLIENT_ID,()=>new LO({baseUrl:"https://ai-mail.emcdn.ru"}));function Fe(e){return(t,r,n)=>{const i=C.getContainer(r)?.getInstance(C.CUSTOM_FETCH_ID);return As({...e,fetchFn:i?.execute||fetch})(t,r,n)}}var Rr=e=>C.getContainer(e),H=e=>jn(C.getContainer(e)),Ze=e=>Oe(C.getContainer(e)),VO=e=>HO(C.getContainer(e));function ao(e){return e.replace(e[0],e[0].toUpperCase())}var WO="query",KO="mutation",QO="infinitequery";function YO(e){return e.type===WO}function XO(e){return e.type===KO}function sm(e){return e.type===QO}function Rn(e,...t){return Object.assign(e,...t)}var Rs=Symbol();function Ns(e){const t=(0,Z.useRef)(e),r=(0,Z.useMemo)(()=>Is(t.current,e),[e]);return(0,Z.useEffect)(()=>{t.current!==r&&(t.current=r)},[r]),r}function Nr(e){const t=(0,Z.useRef)(e);return(0,Z.useEffect)(()=>{Yr(t.current,e)||(t.current=e)},[e]),Yr(t.current,e)?t.current:e}var JO=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ZO=JO(),eA=()=>typeof navigator<"u"&&navigator.product==="ReactNative",tA=eA(),rA=()=>ZO||tA?Z.useLayoutEffect:Z.useEffect,nA=rA(),lm=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Mp.pending}:e;function Ds(e,...t){const r={};return t.forEach(n=>{r[n]=e[n]}),r}var Ls=["data","status","isLoading","isSuccess","isError","error"];function iA({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:i},unstable__sideEffectsInRender:o,createSelector:a},serializeQueryArgs:s,context:c}){const l=o?_=>_():Z.useEffect,u=_=>_.current?.unsubscribe?.(),d=c.endpointDefinitions;return{buildQueryHooks:w,buildInfiniteQueryHooks:y,buildMutationHook:I,usePrefetch:g};function f(_,P,v){if(P?.endpointName&&_.isUninitialized){const{endpointName:N}=P,x=d[N];v!==ct&&s({queryArgs:P.originalArgs,endpointDefinition:x,endpointName:N})===s({queryArgs:v,endpointDefinition:x,endpointName:N})&&(P=void 0)}let M=_.isSuccess?_.data:P?.data;M===void 0&&(M=_.data);const j=M!==void 0,A=_.isLoading,k=(!P||P.isLoading||P.isUninitialized)&&!j&&A,D=_.isSuccess||j&&(A&&!P?.isError||_.isUninitialized);return{..._,data:M,currentData:_.data,isFetching:A,isLoading:k,isSuccess:D}}function m(_,P,v){if(P?.endpointName&&_.isUninitialized){const{endpointName:N}=P,x=d[N];v!==ct&&s({queryArgs:P.originalArgs,endpointDefinition:x,endpointName:N})===s({queryArgs:v,endpointDefinition:x,endpointName:N})&&(P=void 0)}let M=_.isSuccess?_.data:P?.data;M===void 0&&(M=_.data);const j=M!==void 0,A=_.isLoading,k=(!P||P.isLoading||P.isUninitialized)&&!j&&A,D=_.isSuccess||j&&(A&&!P?.isError||_.isUninitialized);return{..._,data:M,currentData:_.data,isFetching:A,isLoading:k,isSuccess:D}}function g(_,P){const v=r(),M=Nr(P);return(0,Z.useCallback)((j,A)=>v(e.util.prefetch(_,j,{...M,...A})),[_,v,M])}function h(_,P,{refetchOnReconnect:v,refetchOnFocus:M,refetchOnMountOrArgChange:j,skip:A=!1,pollingInterval:k=0,skipPollingIfUnfocused:D=!1,...N}={}){const{initiate:x}=e.endpoints[_],F=r(),q=(0,Z.useRef)(void 0);q.current||(q.current=F(e.internalActions.internal_getRTKQSubscriptions()));const $=Ns(A?ct:P),O=Nr({refetchOnReconnect:v,refetchOnFocus:M,pollingInterval:k,skipPollingIfUnfocused:D}),L=N.initialPageParam,U=Nr(L),Y=N.refetchCachedPages,X=Nr(Y),J=(0,Z.useRef)(void 0);let{queryCacheKey:V,requestId:G}=J.current||{},K=!1;V&&G&&(K=q.current.isRequestSubscribed(V,G));const ie=!K&&J.current!==void 0;return l(()=>{ie&&(J.current=void 0)},[ie]),l(()=>{const re=J.current;if($===ct){re?.unsubscribe(),J.current=void 0;return}const te=J.current?.subscriptionOptions;if(!re||re.arg!==$){re?.unsubscribe();const _t=F(x($,{subscriptionOptions:O,forceRefetch:j,...sm(d[_])?{initialPageParam:U,refetchCachedPages:X}:{}}));J.current=_t}else O!==te&&re.updateSubscriptionOptions(O)},[F,x,j,$,O,ie,U,X,_]),[J,F,x,O]}function E(_,P){return(M,{skip:j=!1,selectFromResult:A}={})=>{const{select:k}=e.endpoints[_],D=Ns(j?ct:M),N=(0,Z.useRef)(void 0),x=(0,Z.useMemo)(()=>a([k(D),(O,L)=>L,O=>D],P,{memoizeOptions:{resultEqualityCheck:Yr}}),[k,D]),F=(0,Z.useMemo)(()=>A?a([x],A,{devModeChecks:{identityFunctionCheck:"never"}}):x,[x,A]),q=n(O=>F(O,N.current),Yr),$=x(i().getState(),N.current);return nA(()=>{N.current=$},[$]),q}}function S(_){(0,Z.useEffect)(()=>()=>{u(_),_.current=void 0},[_])}function T(_){if(!_.current)throw new Error(Je(38));return _.current.refetch()}function w(_){const P=(j,A={})=>{const[k]=h(_,j,A);return S(k),(0,Z.useMemo)(()=>({refetch:()=>T(k)}),[k])},v=({refetchOnReconnect:j,refetchOnFocus:A,pollingInterval:k=0,skipPollingIfUnfocused:D=!1}={})=>{const{initiate:N}=e.endpoints[_],x=r(),[F,q]=(0,Z.useState)(Rs),$=(0,Z.useRef)(void 0),O=Nr({refetchOnReconnect:j,refetchOnFocus:A,pollingInterval:k,skipPollingIfUnfocused:D});l(()=>{const X=$.current?.subscriptionOptions;O!==X&&$.current?.updateSubscriptionOptions(O)},[O]);const L=(0,Z.useRef)(O);l(()=>{L.current=O},[O]);const U=(0,Z.useCallback)(function(X,J=!1){let V;return t(()=>{u($),$.current=V=x(N(X,{subscriptionOptions:L.current,forceRefetch:!J})),q(X)}),V},[x,N]),Y=(0,Z.useCallback)(()=>{$.current?.queryCacheKey&&x(e.internalActions.removeQueryResult({queryCacheKey:$.current?.queryCacheKey}))},[x]);return(0,Z.useEffect)(()=>()=>{u($)},[]),(0,Z.useEffect)(()=>{F!==Rs&&!$.current&&U(F,!0)},[F,U]),(0,Z.useMemo)(()=>[U,F,{reset:Y}],[U,F,Y])},M=E(_,f);return{useQueryState:M,useQuerySubscription:P,useLazyQuerySubscription:v,useLazyQuery(j){const[A,k,{reset:D}]=v(j),N=M(k,{...j,skip:k===Rs}),x=(0,Z.useMemo)(()=>({lastArg:k}),[k]);return(0,Z.useMemo)(()=>[A,{...N,reset:D},x],[A,N,D,x])},useQuery(j,A){const k=P(j,A),D=M(j,{selectFromResult:j===ct||A?.skip?void 0:lm,...A}),N=Ds(D,...Ls);return(0,Z.useDebugValue)(N),(0,Z.useMemo)(()=>({...D,...k}),[D,k])}}}function y(_){const P=(M,j={})=>{const[A,k,D,N]=h(_,M,j),x=(0,Z.useRef)(N);l(()=>{x.current=N},[N]);const F=j.refetchCachedPages,q=Nr(F),$=(0,Z.useCallback)(function(U,Y){let X;return t(()=>{u(A),A.current=X=k(D(U,{subscriptionOptions:x.current,direction:Y}))}),X},[A,k,D]);S(A);const O=Ns(j.skip?ct:M),L=(0,Z.useCallback)(U=>{if(!A.current)throw new Error(Je(38));const Y={refetchCachedPages:U?.refetchCachedPages??q};return A.current.refetch(Y)},[A,q]);return(0,Z.useMemo)(()=>({trigger:$,refetch:L,fetchNextPage:()=>$(O,"forward"),fetchPreviousPage:()=>$(O,"backward")}),[L,$,O])},v=E(_,m);return{useInfiniteQueryState:v,useInfiniteQuerySubscription:P,useInfiniteQuery(M,j){const{refetch:A,fetchNextPage:k,fetchPreviousPage:D}=P(M,j),N=v(M,{selectFromResult:M===ct||j?.skip?void 0:lm,...j}),x=Ds(N,...Ls,"hasNextPage","hasPreviousPage");return(0,Z.useDebugValue)(x),(0,Z.useMemo)(()=>({...N,fetchNextPage:k,fetchPreviousPage:D,refetch:A}),[N,k,D,A])}}}function I(_){return({selectFromResult:P,fixedCacheKey:v}={})=>{const{select:M,initiate:j}=e.endpoints[_],A=r(),[k,D]=(0,Z.useState)();(0,Z.useEffect)(()=>()=>{k?.arg.fixedCacheKey||k?.reset()},[k]);const N=(0,Z.useCallback)(function(Y){const X=A(j(Y,{fixedCacheKey:v}));return D(X),X},[A,j,v]),{requestId:x}=k||{},F=(0,Z.useMemo)(()=>M({fixedCacheKey:v,requestId:k?.requestId}),[v,k,M]),q=n((0,Z.useMemo)(()=>P?a([F],P):F,[P,F]),Yr),$=v==null?k?.arg.originalArgs:void 0,O=(0,Z.useCallback)(()=>{t(()=>{k&&D(void 0),v&&A(e.internalActions.removeMutationResult({requestId:x,fixedCacheKey:v}))})},[A,v,k,x]),L=Ds(q,...Ls,"endpointName");(0,Z.useDebugValue)(L);const U=(0,Z.useMemo)(()=>({...q,originalArgs:$,reset:O}),[q,$,O]);return(0,Z.useMemo)(()=>[N,U],[N,U])}}}var oA=Symbol(),aA=({batch:e=Lt.unstable_batchedUpdates,hooks:t={useDispatch:ot,useSelector:at,useStore:se},createSelector:r=Qu,unstable__sideEffectsInRender:n=!1,...i}={})=>({name:oA,init(o,{serializeQueryArgs:a},s){const c=o,{buildQueryHooks:l,buildInfiniteQueryHooks:u,buildMutationHook:d,usePrefetch:f}=iA({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:a,context:s});return Rn(c,{usePrefetch:f}),Rn(s,{batch:e}),{injectEndpoint(m,g){if(YO(g)){const{useQuery:h,useLazyQuery:E,useLazyQuerySubscription:S,useQueryState:T,useQuerySubscription:w}=l(m);Rn(c.endpoints[m],{useQuery:h,useLazyQuery:E,useLazyQuerySubscription:S,useQueryState:T,useQuerySubscription:w}),o[`use${ao(m)}Query`]=h,o[`useLazy${ao(m)}Query`]=E}if(XO(g)){const h=d(m);Rn(c.endpoints[m],{useMutation:h}),o[`use${ao(m)}Mutation`]=h}else if(sm(g)){const{useInfiniteQuery:h,useInfiniteQuerySubscription:E,useInfiniteQueryState:S}=u(m);Rn(c.endpoints[m],{useInfiniteQuery:h,useInfiniteQuerySubscription:E,useInfiniteQueryState:S}),o[`use${ao(m)}InfiniteQuery`]=h}}}}}),Ie=em(nm(),aA());function Fs({title:e,members:t,projects_test_emails:r,inbox_email:n,ftp_settings:i,webhook:o,integrations:a,emails:s,blocks:c,...l}){const u=h=>Array.isArray(h)?h:h?[h]:[],d=h=>({ID:Pe(h.ID||h)}),f=h=>u(h).map(d),m=t,g=m&&{admins:f(m.admins),users:f(m.users),viewers:f(m.viewers),invited_users:u(m.invited_users),owner:m.owner&&d(m.owner)};return{...l,title:e,acf:{members:g,webhook:o,projects_test_emails:r,inbox_email:n,ftp_settings:i,integrations:a,emails:s,blocks:c}}}function sA(e){if(!e)return;const t=/src=['"]([^'"]+)['"]/.exec(e);return t?t[1]:void 0}function cm(e,t){return typeof e=="number"||typeof e=="string"?{userId:pe(e),role:t}:!be(e)||e.ID==null?null:{userId:pe(e.ID),role:t,email:e.user_email||void 0,firstName:e.user_firstname||void 0,lastName:e.user_lastname||void 0,displayName:e.display_name||void 0,avatarUrl:sA(e.user_avatar)}}function lA(e){return Array.isArray(e)?e:[]}function um(e){return Array.isArray(e)?e.length:0}function Nn(e){return Array.isArray(e)?e:void 0}function Dr(e,t={}){const r=e.acf??{},n=be(r.members)?r.members:{},i=[],o=n.owner;if(o&&(typeof o!="object"||be(o))){const d=cm(o,"owner");d&&i.push(d)}const a=[[n.admins,"admin"],[n.users,"user"],[n.viewers,"viewer"]];for(const[d,f]of a)for(const m of lA(d)){const g=cm(m,f);g&&i.push(g)}const s=(Array.isArray(n.invited_users)?n.invited_users:[]).filter(d=>be(d)&&d.invited_user_email).map(d=>({email:d.invited_user_email})),c=t.currentUserId!=null?pe(t.currentUserId):void 0,l=c?i.find(d=>d.userId===c)?.role??"":"",u=e;return{id:pe(e.id),name:lt(e.title)||"",myRole:l,members:i,invites:s,emailsCount:um(r.emails),blocksCount:um(r.blocks),createdAt:u.date_gmt||void 0,updatedAt:u.modified_gmt||void 0,inboxEmail:r.inbox_email||void 0,title:lt(e.title)||"",ftp_settings:be(r.ftp_settings)?r.ftp_settings:void 0,projects_test_emails:Array.isArray(r.projects_test_emails)?r.projects_test_emails:void 0,folder:Nn(u.folder),group:Nn(u.group),blockfolder:Nn(u.blockfolder),emailtags:Nn(u.emailtags),blocktags:Nn(u.blocktags),limits:be(u.limits)?u.limits:void 0}}var cA=["owner","admin","user","viewer"],uA=["admin","user","viewer"];function dm(e){return cA.includes(e)?e:""}function dA(e){return uA.includes(e)?e:void 0}function fA(e){return{userId:e.user_id||"",role:dm(e.role),email:e.email||void 0,firstName:e.first_name||void 0,lastName:e.last_name||void 0,displayName:e.display_name||void 0,avatarUrl:e.avatar_url||void 0,lastLogin:e.last_login||void 0,joinedAt:e.joined_at||void 0}}function pA(e){return{email:e.email,role:dA(e.role),invitedAt:e.invited_at||void 0}}function mA(e){if(e)return{slug:e.slug||"",name:e.name||"",isPaid:e.is_paid===!0}}function Dn(e){return{id:e.wp_id!=null?String(e.wp_id):e.id??"",nativeId:e.id||void 0,name:e.name||"",myRole:dm(e.my_role),members:(e.members??[]).map(fA),invites:(e.invites??[]).filter(t=>!!t.email).map(pA),emailsCount:e.emails_count??0,blocksCount:e.blocks_count??0,createdAt:e.created_at||void 0,updatedAt:e.updated_at||void 0,inboxEmail:e.inbox_email||void 0,ownerPlan:mA(e.owner_plan),title:e.name||""}}function hA(e,t){const r=e.members??[],n=e.invites??[],i=(a,s)=>String(a.userId)===String(s),o=(a,s)=>String(a.email).trim().toLowerCase()===String(s).trim().toLowerCase();switch(t.kind){case"changeRole":return{members:r.map(a=>i(a,t.userId)?{...a,role:t.role}:a),invites:n};case"removeMember":return{members:r.filter(a=>!i(a,t.userId)),invites:n};case"revokeInvite":return{members:r,invites:n.filter(a=>!o(a,t.email))};case"restoreMember":return{members:r.some(a=>i(a,t.userId))?r:[...r,{userId:String(t.userId),role:t.role}],invites:n};case"restoreInvite":return{members:r,invites:n.some(a=>o(a,t.email))?n:[...n,{email:t.email}]};default:return{members:r,invites:n}}}function gA(e,t){const r=i=>e.filter(o=>o.role===i).map(o=>o.userId),n=e.find(i=>i.role==="owner");return{...n?{owner:{ID:n.userId}}:{},admins:r("admin"),users:r("user"),viewers:r("viewer"),invited_users:t.map(i=>({invited_user_email:i.email}))}}function xs(e){try{const t=localStorage.getItem(e);if(t==="true")return!0;if(t==="false")return!1}catch{}}function We(){return xs(It.em_projects_v2)??!0}var xe="Projects",Ln="LIST",Us=12;function Lr(e){return{error:GO(e)}}function Fn(e){const t=Qi(Rr(e)).profile?.id;return t!=null&&t!==""?String(t):void 0}function yA(e){switch(e){case"modified":return"updated_at";case"title":return"name";case"author":return"owner";case"emails":return"emails";case"blocks":return"blocks";case"members_count":return"members";case"date":case void 0:return"created_at";default:return"created_at"}}function _A(e){const t=Math.max(1,e.per_page??Us),r={limit:t,offset:(Math.max(1,e.page??1)-1)*t};return e.search&&(r.search=e.search),e.orderby&&(r.order_by=yA(e.orderby)),(e.order==="asc"||e.order==="desc")&&(r.order=e.order),r}function vA(e){if(Array.isArray(e))return e;if(e!=null&&typeof e=="object"){const t=e.projects;if(Array.isArray(t))return t}return[]}function bA(e){if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.trunc(e);if(typeof e=="string"&&e.trim()!==""){const t=parseInt(e,10);if(Number.isFinite(t)&&t>=0)return t}}function fm(e){const t={id:"",name:"",title:"",myRole:"",members:[],invites:[],emailsCount:0,blocksCount:0};if(e==null||typeof e!="object"||Array.isArray(e))return t;const r=e,n=bA(r.emails_count);return{...t,id:r.id!=null?String(r.id):"",name:typeof r.title=="string"?r.title:"",title:typeof r.title=="string"?r.title:"",emailsCount:n??0}}function EA(e,t,r){const n=e.headers?.get?.("X-WP-Total"),i=e.headers?.get?.("X-WP-TotalPages"),o=n!=null&&n!==""?parseInt(String(n),10):NaN,a=i!=null&&i!==""?parseInt(String(i),10):NaN,s=Math.max(1,t.per_page??Us),c=Number.isFinite(a)?a:Number.isFinite(o)?Math.max(1,Math.ceil(o/s)):NaN,l=Math.max(1,t.page??1),u=s;let d=o,f=c;return Number.isFinite(d)?Number.isFinite(f)||(f=Math.max(1,Math.ceil(d/u))):l===1?r===0?(d=0,f=1):r<u?(d=r,f=1):(d=r+1,f=2):r===0?(d=Math.max(0,(l-1)*u),f=Math.max(1,l-1)):r<u?(d=(l-1)*u+r,f=l):(d=l*u+1,f=l+1),{total:d,totalPages:f}}var Fr=Ie({reducerPath:"projectsApi",tagTypes:[xe,"project"],baseQuery:Fe({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getProjects:e.query({async queryFn(t={page:1},r){if(We()){const a=await Ze(r).projects.projectsList(_A(t));if(!a.ok||a.error)return Lr(a);const s=(a.data?.data??[]).map(Dn),c=Math.max(1,t.per_page??Us),l=a.data?.page?.total??s.length;return{data:s,meta:{projectsListPagination:{total:l,totalPages:Math.max(1,Math.ceil(l/c))}}}}const n=H(r),i=Fn(r),o={status:["private"]};return t.page&&(o.page=t.page),t.order&&(o.order=t.order),t.orderby&&(o.orderby=t.orderby),t.search&&(o.search=t.search),t.after&&(o.after=t.after),t.before&&(o.before=t.before),t.per_page!=null&&(o.per_page=t.per_page),n.wp.project_list(o).then(a=>{const s=ze(c=>Dr(c,{currentUserId:i}))(a);return s.error?{error:s.error}:{data:s.data,meta:{projectsListPagination:EA(a,t,s.data.length)}}})},providesTags:t=>t?[...t.map(({id:r})=>({type:xe,id:r})),{type:xe,id:Ln}]:[{type:xe,id:Ln}]}),getProject:e.query({async queryFn(t,r){if(We()){const o=await tT(Rr(r),String(t));if(o)return{data:o};const a=await Ze(r).projects.projectsDetail({id:String(t)});return!a.ok||a.error?Lr(a):{data:Dn(a.data)}}const n=H(r),i=Fn(r);return n.wp.project_detail({id:Number(t)},{extraQuery:{_embed:"wp:term"}}).then(we(o=>Dr(o,{currentUserId:i})))},providesTags:(t,r,n)=>[{type:"project",id:n}]}),addProject:e.mutation({async queryFn(t,r){if(We()){const o=await Ze(r).projects.projectsCreate({name:t.title});return!o.ok||o.error?Lr(o):{data:Dn(o.data)}}const n=H(r),i=Fn(r);return n.wp.project_create({status:"private",...Fs(t)},{type:C.ContentType.Json}).then(we(o=>Dr(o,{currentUserId:i})))},invalidatesTags:[{type:xe,id:Ln}]}),editProject:e.mutation({async queryFn({projectId:t,...r},n){const i=Object.keys(r).filter(c=>c!=="title");if(We()&&i.length===0&&r.title!=null){const c=await Ze(n).projects.projectsPartialUpdate({id:String(t)},{name:r.title});return!c.ok||c.error?Lr(c):{data:Dn(c.data)}}const o=H(n),a=Fn(n),s=De(Fs(r),!0);return o.wp.project_partial_update({id:Number(t)},s,{type:C.ContentType.Json}).then(we(c=>Dr(c,{currentUserId:a})))},invalidatesTags:(t,r,{projectId:n})=>[{type:xe,id:n},{type:"project",id:n}]}),deleteProject:e.mutation({async queryFn(t,r){if(We()){const n=await Ze(r).projects.projectsDelete({id:String(t)});return!n.ok||n.error?Lr(n):{data:{...fm(null),id:String(t)}}}return H(r).wp.project_delete({id:Number(t)},{}).then(Ri(n=>Dr(n)))},invalidatesTags:(t,r,n)=>[{type:xe,id:n},{type:"project",id:n},{type:xe,id:Ln}]}),mutateProjectMembers:e.mutation({async queryFn({project:t,action:r},n){const i=t.id;if(We()){const l=Ze(n),u=String(i);switch(r.kind){case"changeRole":{const d=await l.projects.membersPartialUpdate({id:u,userId:String(r.userId)},{role:r.role});return Le(d)}case"removeMember":{const d=r.isSelf&&t.myRole!=="owner"?await l.projects.membersMeDelete({id:u}):await l.projects.membersDelete({id:u,userId:String(r.userId)});return Le(d)}case"revokeInvite":{const d=await l.projects.invitesDelete({id:u,email:r.email});return Le(d)}case"restoreMember":{const d=r.email??t.members.find(m=>String(m.userId)===String(r.userId))?.email;if(!d)return{error:{status:400,data:{message:"member email is unknown"}}};const f=await l.projects.membersCreate({id:u},{email:d,role:r.role==="admin"?"admin":"user"});return Le(f)}case"restoreInvite":{const d=await l.projects.membersCreate({id:u},{email:r.email,role:"user"});return Le(d)}default:return{data:void 0}}}const o=hA(t,r),a=H(n),s=De(Fs({members:gA(o.members,o.invites)}),!0),c=await a.wp.project_partial_update({id:Number(t.id)},s,{type:C.ContentType.Json});return{error:c.error,data:c.data}},invalidatesTags:(t,r,{project:n})=>[{type:xe,id:n.id},{type:"project",id:n.id}]}),addProjectMember:e.mutation({async queryFn({project:t,email:r,role:n},i){if(We()){const a=await Ze(i).projects.membersCreate({id:String(t.id)},{email:r,role:n??"user"});return Le(a)}const o=await H(i).userToProject.add_user_create({email:r,project_id:String(t.id),...n?{role:n}:{}},{type:C.ContentType.FormData});return{error:o.error,data:o.data}},invalidatesTags:(t,r,{project:n})=>[{type:xe,id:n.id},{type:xe,id:Ln},{type:"project",id:n.id}]}),getFrequentProjects:e.query({async queryFn(t,r){const n=typeof t=="number"&&t>0?t:5;if(We()){const a=await Ze(r).projects.topUsedList({limit:n});return!a.ok||a.error?Lr(a):{data:(a.data??[]).map(Dn)}}const i=H(r),o=Fn(r);try{const a=await i.projects.top_used_list({limit:n});if(!a.ok||a.error)throw a.error??new Error("top-used request failed");const s=vA(a.data);return ze(fm)({data:s,error:a.error,meta:a.meta})}catch{const a=await i.wp.project_list({per_page:n,order:"desc",orderby:"modified",status:["private"]});return ze(s=>Dr(s,{currentUserId:o}))({data:a.data,error:a.error,meta:a.meta})}},providesTags:t=>t&&t.length>0?[...t.map(({id:r})=>({type:xe,id:r})),{type:xe,id:"FREQUENT"}]:[{type:xe,id:"FREQUENT"}]})})});function wA(){const e=ot();return(0,b.useCallback)(t=>{t==null||t===""||e(Fr.util.invalidateTags([{type:"project",id:t}]))},[e])}var{useGetProjectsQuery:fz,useGetProjectQuery:pm,useAddProjectMutation:pz,useEditProjectMutation:SA,useGetFrequentProjectsQuery:mz,useMutateProjectMembersMutation:hz,useAddProjectMemberMutation:gz}=Fr,PA=class extends Error{kind;failed;constructor(e,t){super(`не удалось завести термы (${e}): ${t.map(({name:r})=>r).join(", ")}`),this.name="TermsFailedError",this.kind=e,this.failed=t}};function IA(e){return e instanceof PA?e:void 0}function mm(e){return e?.data?.term_id}function TA(e){const t=e;return mm(t?.data)??mm(t)}var CA="Taxonomies",OA={folder:"folders",group:"groups",blockfolder:"blockFolders",emailtags:"emailTags",blocktags:"blockTags"};function Bs(e,t){return t??e.getState?.()?.projectSlice?.project}function so(e,t){return{error:t??{status:400,data:{message:e}}}}function hm(e,t){return e?.[t]?.[0]}function AA(e){return e?.data?.term_id}async function MA(e,t,r){const n=hm(t,r);if(n)return{rootId:n};const i=await H(e).wp[`${r}_create`]({name:`project_${t.id}`}),o=i?.data?.id??AA(i?.error);return o==null?{error:i?.error}:(await e.dispatch(Fr.endpoints.editProject.initiate({projectId:t.id,[r]:[o]})),{rootId:o})}function lo(e){return{id:e.id,name:e.name,parent:e.parent_id??0,count:e.count??0,count_template:e.template_count??0,children:(e.children??[]).map(lo)}}function co(e,t){return{client:Ze(e),resource:OA[t]}}var uo=Ie({reducerPath:"taxonomiesApi",tagTypes:[CA,"folder","block_folder","Group"],baseQuery:Fe({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getTerms:e.query({async queryFn({project:t,kind:r,parent:n},i){if(We()){const{client:s,resource:c}=co(i,r),l=await s.projects[`${c}List`]({id:String(t.id),...n?{parent_id:n}:{}});return!l.ok||l.error?{error:l.error}:{data:(l.data??[]).map(lo)}}const o=H(i),a=n??hm(t,r);return a==null?{data:[]}:o.wp[`${r}_list`]({per_page:100,parent:a})},serializeQueryArgs:({endpointName:t,queryArgs:r})=>`${t}(${r?.project?.id}:${r?.kind}:${r?.parent??"root"})`,providesTags:(t,r,{kind:n,parent:i})=>[{type:"folder",id:n},{type:"folder",id:`${n}:${i??"root"}`}]}),addTerm:e.mutation({async queryFn({project:t,kind:r,name:n,parent:i},o){const a=Bs(o,t);if(!a?.id)return so("project is unknown");if(We()){const{client:l,resource:u}=co(o,r),d=await l.projects[`${u}Create`]({id:String(a.id)},{name:n,...i?{parent_id:i}:{}});return!d.ok||d.error?{error:d.error}:{data:lo(d.data)}}const s=H(o);let c=i;if(c==null){const l=await MA(o,a,r);if(l.rootId==null)return so("root term was not created",l.error);c=l.rootId}return s.wp[`${r}_create`]({name:n,parent:c})},invalidatesTags:(t,r,{kind:n})=>[{type:"folder",id:n}]}),editTerm:e.mutation({async queryFn({project:t,kind:r,id:n,name:i},o){const a=Bs(o,t);if(!a?.id)return so("project is unknown");if(We()){const{client:s,resource:c}=co(o,r),l=await s.projects[`${c}PartialUpdate`]({id:String(a.id),termId:Number(n)},{name:i});return!l.ok||l.error?{error:l.error}:{data:lo(l.data)}}return H(o).wp[`${r}_partial_update`]({id:n},{name:i})},invalidatesTags:(t,r,{kind:n})=>[{type:"folder",id:n}]}),getStandardGroups:e.query({queryFn(t,r){return H(r).wp.group_list({per_page:100})}}),deleteTerm:e.mutation({async queryFn({project:t,kind:r,id:n},i){const o=Bs(i,t);if(!o?.id)return so("project is unknown");if(We()){const{client:s,resource:c}=co(i,r),l=await s.projects[`${c}Delete`]({id:String(o.id),termId:Number(n)}),u=Le(l);return"error"in u?u:{data:{deleted:!0}}}const a=await H(i).wp[`${r}_delete`]({id:n},{force:!0});return a.error?{error:a.error}:{data:{deleted:!0}}},invalidatesTags:(t,r,{kind:n})=>[{type:"folder",id:n}]})})});function kA(){const e=ot();return(0,b.useCallback)(t=>{e(uo.util.invalidateTags([{type:"folder",id:t}]))},[e])}var{useGetTermsQuery:jA,useGetStandardGroupsQuery:yz,useLazyGetTermsQuery:_z,useAddTermMutation:RA,useEditTermMutation:NA,useDeleteTermMutation:DA}=uo,gm=new URLSearchParams(window.location.search),ym=gm.get("tag"),LA=gm.get("folder"),FA={activeModal:"",switchToPlanRequestTitle:"",secondModal:"",projectsTotal:"",projectsTotalPages:"",folders:[],activeTagId:ym||null,activeFolderId:LA||(ym?null:"all"),activeIntegration:null,addNewProjectInitialTitle:null},$s="projectsPageSlice",_m=Te({name:$s,initialState:FA,reducers:{openModal(e,t){e.activeModal=t.payload},openAddNewProjectModal(e,t){e.activeModal=de.ADD_NEW_PROJECT_MODAL,e.addNewProjectInitialTitle=t.payload??null},setSwitchToPlanRequestTitle(e,t){e.switchToPlanRequestTitle=typeof t.payload=="string"?t.payload:""},closeModal(e){e.activeModal="",e.activeIntegration=null,e.addNewProjectInitialTitle=null,e.switchToPlanRequestTitle=""},openSecondModal(e,t){e.secondModal=t.payload},closeSecondModal(e){e.secondModal=""},setFolders(e,{payload:t}){e.folders=t},setActiveTagId(e,{payload:t}){e.activeTagId=t},setActiveIntegration(e,t){e.activeIntegration=t.payload}},extraReducers:e=>{e.addMatcher(Fr.endpoints.getProjects.matchFulfilled,(t,r)=>{const n=r.meta,i=n.baseQueryMeta,o=n.projectsListPagination??i?.projectsListPagination;if(o!=null&&typeof o.total=="number"&&Number.isFinite(o.total)&&o.total>=0){t.projectsTotal=String(o.total),t.projectsTotalPages=String(typeof o.totalPages=="number"&&Number.isFinite(o.totalPages)?o.totalPages:"");return}const a=i?.response?.headers?.get?.("X-WP-Total"),s=i?.response?.headers?.get?.("X-WP-TotalPages");t.projectsTotal=a??"",t.projectsTotalPages=s??""}),e.addMatcher(uo.endpoints.getTerms.matchFulfilled,(t,{meta:r,payload:n})=>{const i=r.arg.originalArgs?.kind;(i==="folder"||i==="blockfolder")&&(t.folders=n)})}}),{openModal:vm,openAddNewProjectModal:vz,setSwitchToPlanRequestTitle:bz,closeModal:xA,openSecondModal:UA,closeSecondModal:BA,setFolders:Ez,setActiveTagId:wz,setActiveIntegration:Sz}=_m.actions,qs=e=>e[$s].activeModal,$A=e=>e[$s].secondModal,qA=new Set([de.UPLOAD_IMAGE_MODAL,de.UPLOAD_BACKGROUND_MODAL,de.UPLOAD_IMAGE_MODAL_AI,de.UPLOAD_BACKGROUND_MODAL_AI,de.UPLOAD_IMAGE_MODAL_STOCK,de.UPLOAD_BACKGROUND_MODAL_STOCK,de.UPLOAD_IMAGE_MODAL_GIF,de.UPLOAD_BACKGROUND_MODAL_GIF,de.UPLOAD_IMAGE_MODAL_EDIT,de.UPLOAD_BACKGROUND_MODAL_EDIT,de.UPLOAD_IMAGE_MODAL_UPLOAD,de.UPLOAD_BACKGROUND_MODAL_UPLOAD]),zA=new Set([de.UPLOAD_IMAGE_MODAL_EDIT,de.UPLOAD_BACKGROUND_MODAL_EDIT]);function GA(e){return!!e&&zA.has(e)}function bm(e){return!!e&&qA.has(e)}var HA={[de.UPLOAD_IMAGE_MODAL_EDIT]:de.UPLOAD_IMAGE_MODAL_UPLOAD,[de.UPLOAD_BACKGROUND_MODAL_EDIT]:de.UPLOAD_BACKGROUND_MODAL_UPLOAD};function VA(e,t){return t?e:HA[e]??e}var Em=(0,b.createContext)(null),WA=e=>e.includes("UPLOAD_IMAGE_")||e.includes("UPLOAD_BACKGROUND_"),KA=({children:e})=>{const t=ot(),r=at(qs),[n,i]=(0,b.useState)(null),o=(0,b.useRef)(null),a=(0,b.useCallback)(l=>{o.current?.(l),o.current=null},[]),s=(0,b.useCallback)(l=>{a(null);const u=VA(l.entryModal,!!(l.currentUrl||l.imageDataUrl));return i({...l,entryModal:u}),t(vm(u)),new Promise(d=>{o.current=d})},[t,a]);(0,b.useEffect)(()=>{WA(r)||(i(null),o.current&&a(null))},[r,a]);const c=(0,b.useMemo)(()=>({request:n,openImagePicker:s,resolveImagePicker:a}),[n,s,a]);return(0,R.jsx)(Em.Provider,{value:c,children:e})},QA=()=>{const e=(0,b.useContext)(Em);if(!e)throw new Error("useImagePicker must be used within ImagePickerProvider");return e},wm=ot,YA=typeof wm?.withTypes=="function"?wm.withTypes():ot,Sm=at,Pz=typeof Sm?.withTypes=="function"?Sm.withTypes():at,Pm=se,Im=typeof Pm?.withTypes=="function"?Pm.withTypes():se;function fo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)n!=="__proto__"&&(e[n]=r[n])}return e}var XA={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function zs(e,t){function r(i,o,a){if(!(typeof document>"u")){a=fo({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var c in a)a[c]&&(s+="; "+c,a[c]!==!0&&(s+="="+a[c].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var c=o[s].split("="),l=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(u in a||(a[u]=e.read(l,u)),i===u)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",fo({},o,{expires:-1}))},withAttributes:function(i){return zs(this.converter,fo({},this.attributes,i))},withConverter:function(i){return zs(fo({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Tm=zs(XA,{path:"/"}),JA={ru:"ru_RU",en:"en_US",de:"de_DE",fr:"fr_FR",es:"es_ES",it:"it_IT",pl:"pl_PL",pt:"pt_BR"};function ZA(e){const t=String(e??"").trim().replace("-","_");if(t)return JA[t]??t}var eM=["is_paying","is_paying_user","paying","paying_user"];function Gs(e){if(!e||typeof e!="object")return!1;const t=e;for(const r of eM){const n=t[r];if(n===!0||n===1||n==="1"||typeof n=="string"&&n.trim().toLowerCase()==="true")return!0}return!1}function po(e){if(e===void 0)return;if(e===null||e==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}function tM(e){if(!e)return!1;const t=e;return Cm(t.trial_enabled??t.trial??t.is_get_trial)}function Cm(e){return e===!0||e===1||e==="1"?!0:typeof e=="string"&&e.toLowerCase()==="true"}function Mt(e){return e||void 0}function rM(e){if(!e)return;const t={font_size:Mt(e.font_size),font_family:Mt(e.font_family),tab_size:Mt(e.tab_size),word_wrap:e.word_wrap,minimap:e.minimap,insert_spaces:e.insert_spaces};return Object.values(t).some(r=>r!==void 0)?t:void 0}function nM(e){const t=e?.match(/^(\d{4})-(\d{2})-(\d{2})$/);return t?`${t[3]}.${t[2]}.${t[1]}`:void 0}function iM(e){return e?De({subscription:{post_name:e.slug,post_title:e.name},subscription_end:nM(e.ends_at),trial_enabled:e.is_trial,is_paying:e.is_paying,recurring_payments:e.auto_renewal,subscription_id:e.subscription_id}):{}}function Om(e){const t=e.profile??{},r=e.preferences??{},n=e.id??"";return{id:e.wp_user_id!=null?String(e.wp_user_id):n,nativeId:n,username:t.username||"",email:e.email||"",password:"",name:Mt(t.display_name),first_name:Mt(t.first_name),last_name:Mt(t.last_name),avatar_url:Mt(t.avatar_url),roles:e.role?[e.role]:void 0,email_confirmation:e.email_confirmed,privacy_policy_agreement:e.privacy_policy_agreed,locale:ZA(r.locale),theme:Mt(r.theme),autosaves:r.autosaves,newsletter_consent:r.newsletter_consent,email_subscription_consent:r.newsletter_consent,email_builder_config:r.editor_mode,code_editor:rM(r.editor),last_used_project:Mt(e.last_used_project),...iM(e.plan)}}function oM(e){if(!e||typeof e!="object")return!1;const t=e;return t.profile!==void 0||t.preferences!==void 0}var Am=!1;function aM(e){Am||!e||typeof e!="object"||e.acf===void 0&&(Am=!0,ts("GET /auth/user: неизвестная форма ответа",{origin:"auth-user-shape",level:"warning",contexts:{auth_user_shape:{keys:Object.keys(e)}}}))}function sM(e,{reportShape:t=!0}={}){const r=Array.isArray(e)?e[0]:e;return oM(r)?Om(r):(t&&aM(r),mo(r??{}))}var lM=["pro","simple","editor"];function cM(e){return e!==void 0&&lM.includes(e)?e:void 0}function uM(e){return e==null?e:De({font_size:e.font_size,font_family:e.font_family,tab_size:e.tab_size,word_wrap:e.word_wrap,minimap:e.minimap,insert_spaces:e.insert_spaces})}function Hs(e){if(e!==void 0)return typeof e=="string"?e==="true"||e==="1":!!e}function dM(e){const t=De({display_name:e.name,first_name:e.first_name,last_name:e.last_name,username:e.username,avatar_url:e.avatar_url}),r=De({locale:e.locale,theme:e.theme,autosaves:Hs(e.autosaves),newsletter_consent:Hs(e.newsletter_consent),editor_mode:cM(e.email_builder_config),editor:uM(e.code_editor)});return De({profile:Object.keys(t).length>0?t:void 0,preferences:Object.keys(r).length>0?r:void 0})}function mo(e){const t=e.acf??{},{autosaves:r,hide_mergetags:n,theme:i,newsletter_consent:o,code_editor:a,counters:s,subscription:c,subscription_end:l,recurring_payments:u,subscription_id:d,promocode:f,subscription_amount:m,enterprise_users_limit:g,enterprise_price:h,enterprise_12_price:E,privacy_policy_agreement:S,last_used_project:T,email_confirmation:w,email_builder_config:y}=t,{id:I,acf:_,...P}=e,v=tM(t),M=s??{},j=Gs(t)||Gs(P)||Gs(e.meta);return{...P,id:pe(I),avatar_url:P.avatar_urls?.["96"]??P.avatar_urls?.["48"]??P.avatar_urls?.["24"],username:P.username||"",email:P.email||"",password:P.password||"",trial_enabled:v,is_paying:j,autosaves:r,hide_mergetags:n,theme:i,newsletter_consent:o,code_editor:a?{...a,font_size:Number(a.font_size)}:void 0,counters:Object.keys(M).reduce((A,k)=>(A[k]=Number(M[k]),A),{}),subscription:c,subscription_end:l,recurring_payments:u,subscription_id:d,promocode:f,subscription_amount:po(m),enterprise_users_limit:po(g),enterprise_price:po(h),enterprise_12_price:po(E),privacy_policy_agreement:S,last_used_project:T,email_confirmation:w,email_builder_config:y}}function fM({autosaves:e,theme:t,newsletter_consent:r,code_editor:n,counters:i,subscription:o,subscription_end:a,recurring_payments:s,subscription_id:c,promocode:l,subscription_amount:u,enterprise_users_limit:d,enterprise_price:f,enterprise_12_price:m,privacy_policy_agreement:g,locale:h,last_used_project:E,email_confirmation:S,email_builder_config:T,trial_enabled:w,is_paying:y,id:I,nativeId:_,...P}){return{...P,id:Pe(I),locale:h,acf:{autosaves:Hs(e),theme:t,newsletter_consent:r,code_editor:n?{...n,font_size:String(n.font_size)}:void 0,privacy_policy_agreement:g,last_used_project:E,email_confirmation:S,email_builder_config:T}}}function pM({title:e,acf:t,...r}){const{limits:n,price:i}=t??{limits:{}},o=t?.features;return{...r,title:lt(e)||"",limits:n,price:i,features:o}}function mM(){const e="https://app.emailmaker.ru/api/v2".replace(/\/+$/u,""),t=typeof window<"u"?window.location.origin:"";return{url:`${e.startsWith("http")?e:`${t}${e}`}/auth/user`,method:"GET"}}function Vs(e){return zt.endpoints.getMe.select("")(e).data}var Mm=new WeakMap;function ho(e){const t=Rr(e)??e.getState;let r=Mm.get(t);return r||(r={seq:0,fields:new Map,projectWrites:Promise.resolve(),goWritesFailed:new WeakSet},Mm.set(t,r)),r}function km(e,t){e.seq+=1;for(const r of t)e.fields.set(r,e.seq)}function jm(e,t,r,n){const i=Vs(n),o=i&&(i.nativeId||i.id)===(e.nativeId||e.id);if(t===r.seq||!o)return e;const a={...e};for(const[s,c]of r.fields)if(c>t){const l=i[s];Object.assign(a,{[s]:l})}return a}function Rm(e){return!!Vs(e)?.nativeId}async function hM(e){const t=Vs(e.getState());if(t)return t;const r=e.dispatch(zt.endpoints.getMe.initiate(""));try{return(await r).data}finally{r.unsubscribe()}}var gM=1e4;function yM(e,t){return new Promise(r=>{const n=setTimeout(r,t),i=()=>{clearTimeout(n),r()};e.then(i,i)})}async function _M(e,t){const r={last_used_project:t};try{const n=await Ze(e).auth.userPartialUpdate(r);return!!n?.ok&&!n.error}catch{return!1}}var zt=Ie({reducerPath:"authorizationApi",baseQuery:Fe({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/",prepareHeaders:e=>{const t=Tm.get(Ni.em_token);return t&&!e.has("authorization")&&e.set("authorization",`Bearer ${t}`),e}}),endpoints:e=>({getMailConfirmation:e.query({queryFn(t,r){return H(r).wp.confirmation_list({...t})}}),getSchema:e.query({queryFn(t,r){return H(r).wp.users_me_list(void 0,{method:"OPTIONS",extraQuery:{_fields:"schema"}})}}),getMe:e.query({async queryFn(t,r,n,i){const o=ho(r),a=o.seq,s=await EC(Rr(r));if(s)return{data:jm(s,a,o,r.getState())};const c=await i(mM());return c.error?{error:c.error}:{data:jm(sM(c.data),a,o,r.getState())}}}),getUser:e.query({queryFn(t,r){return H(r).wp.users_detail({id:t}).then(we(mo))}}),editMe:e.mutation({async queryFn(t,r){const n=await hM(r);if(!n?.nativeId){const a=await H(r).wp.users_me_create(De(fM(t),!0),{type:C.ContentType.Json});return n0(a,mo)}const i=dM(t);if(Object.keys(i).length===0)return{data:n};const o=Le(await Ze(r).auth.userPartialUpdate(i));return"error"in o?{error:o.error}:{data:Om(o.data??{})}},async onQueryStarted(t,r){const{dispatch:n,queryFulfilled:i}=r;try{const{data:o}=await i,a=Object.keys(t);(a.includes("first_name")||a.includes("last_name"))&&o.name&&a.push("name"),a.includes("newsletter_consent")&&a.push("email_subscription_consent"),km(ho(r),a),n(zt.util.updateQueryData("getMe","",s=>{for(const c of a){const l=c==="email_subscription_consent"?o.email_subscription_consent??o.newsletter_consent:o[c];Object.assign(s,{[c]:l})}}))}catch{}}}),setLastUsedProject:e.mutation({async queryFn(t,r){const{id:n,nativeId:i}=t;if(ps(Rr(r)))return{data:void 0};const o=ho(r),a=async()=>{const c=i&&Rm(r.getState())?_M(r,i):void 0,l={acf:{last_used_project:n}},[u,d]=await Promise.allSettled([H(r).wp.users_me_create(l,{type:C.ContentType.Json}).then(we(mo)),c]);if(u.status==="rejected")throw u.reason;return d.status==="fulfilled"&&d.value===!1&&o.goWritesFailed.add(t),u.value},s=yM(o.projectWrites,gM).then(a);return o.projectWrites=s.catch(()=>{}),s},async onQueryStarted(t,r){const{id:n,nativeId:i}=t,{dispatch:o,queryFulfilled:a}=r,s=Rm(r.getState())?i??n:n;try{await a;const c=ho(r);if(c.goWritesFailed.delete(t))return;km(c,["last_used_project"]),o(zt.util.updateQueryData("getMe","",l=>{l.last_used_project=s}))}catch{}}}),getSubscriptions:e.query({queryFn(t,r){return H(r).wp.subscription_list(void 0).then(ze(pM))}}),activateTrial:e.mutation({query:t=>({url:`${"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,"")}/wp-json/subscription/v2/activate_trial`,method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}})})})}),{useGetMeQuery:Iz,useLazyGetMeQuery:Nm,useEditMeMutation:vM,useSetLastUsedProjectMutation:Tz,useLazyGetSchemaQuery:Cz,useGetSubscriptionsQuery:Dm,useLazyGetMailConfirmationQuery:Oz,useActivateTrialMutation:bM}=zt;function EM(e,t){var r=0,n,i;t=t||{};function o(){var a=n,s=arguments.length,c,l;e:for(;a;){if(a.args.length!==arguments.length){a=a.next;continue}for(l=0;l<s;l++)if(a.args[l]!==arguments[l]){a=a.next;continue e}return a!==n&&(a===i&&(i=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=n,a.prev=null,n.prev=a,n=a),a.val}for(c=new Array(s),l=0;l<s;l++)c[l]=arguments[l];return a={args:c,val:e.apply(null,c)},n?(n.prev=a,a.next=n):i=a,r===t.maxSize?(i=i.prev,i.next=null):r++,n=a,a.val}return o.clear=function(){n=null,i=null,r=0},o}var wM=Q.__commonJSMin((e=>{(function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function r(s){return i(a(s),arguments)}function n(s,c){return r.apply(null,[s].concat(c||[]))}function i(s,c){for(var l=1,u=s.length,d,f="",m=0,g,h,E,S,T,w,y;m<u;m++)if(typeof s[m]=="string")f+=s[m];else if(typeof s[m]=="object"){if(h=s[m],h.keys)for(d=c[l],g=0;g<h.keys.length;g++){if(d==null)throw new Error(r('[sprintf] Cannot access property "%s" of undefined value "%s"',h.keys[g],h.keys[g-1]));d=d[h.keys[g]]}else h.param_no?d=c[h.param_no]:d=c[l++];if(t.not_type.test(h.type)&&t.not_primitive.test(h.type)&&d instanceof Function&&(d=d()),t.numeric_arg.test(h.type)&&typeof d!="number"&&isNaN(d))throw new TypeError(r("[sprintf] expecting number but found %T",d));switch(t.number.test(h.type)&&(w=d>=0),h.type){case"b":d=parseInt(d,10).toString(2);break;case"c":d=String.fromCharCode(parseInt(d,10));break;case"d":case"i":d=parseInt(d,10);break;case"j":d=JSON.stringify(d,null,h.width?parseInt(h.width):0);break;case"e":d=h.precision?parseFloat(d).toExponential(h.precision):parseFloat(d).toExponential();break;case"f":d=h.precision?parseFloat(d).toFixed(h.precision):parseFloat(d);break;case"g":d=h.precision?String(Number(d.toPrecision(h.precision))):parseFloat(d);break;case"o":d=(parseInt(d,10)>>>0).toString(8);break;case"s":d=String(d),d=h.precision?d.substring(0,h.precision):d;break;case"t":d=String(!!d),d=h.precision?d.substring(0,h.precision):d;break;case"T":d=Object.prototype.toString.call(d).slice(8,-1).toLowerCase(),d=h.precision?d.substring(0,h.precision):d;break;case"u":d=parseInt(d,10)>>>0;break;case"v":d=d.valueOf(),d=h.precision?d.substring(0,h.precision):d;break;case"x":d=(parseInt(d,10)>>>0).toString(16);break;case"X":d=(parseInt(d,10)>>>0).toString(16).toUpperCase()}t.json.test(h.type)?f+=d:(t.number.test(h.type)&&(!w||h.sign)?(y=w?"+":"-",d=d.toString().replace(t.sign,"")):y="",S=h.pad_char?h.pad_char==="0"?"0":h.pad_char.charAt(1):" ",T=h.width-(y+d).length,E=h.width&&T>0?S.repeat(T):"",f+=h.align?y+d+E:S==="0"?y+E+d:E+y+d)}return f}var o=Object.create(null);function a(s){if(o[s])return o[s];for(var c=s,l,u=[],d=0;c;){if((l=t.text.exec(c))!==null)u.push(l[0]);else if((l=t.modulo.exec(c))!==null)u.push("%");else if((l=t.placeholder.exec(c))!==null){if(l[2]){d|=1;var f=[],m=l[2],g=[];if((g=t.key.exec(m))!==null)for(f.push(g[1]);(m=m.substring(g[0].length))!=="";)if((g=t.key_access.exec(m))!==null)f.push(g[1]);else if((g=t.index_access.exec(m))!==null)f.push(g[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=f}else d|=2;if(d===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");u.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");c=c.substring(l[0].length)}return o[s]=u}typeof e<"u"&&(e.sprintf=r,e.vsprintf=n),typeof window<"u"&&(window.sprintf=r,window.vsprintf=n,typeof define=="function"&&define.amd&&define(function(){return{sprintf:r,vsprintf:n}}))})()})),SM=Q.__toESM(wM()),PM=EM(console.error);function IM(e,...t){try{return SM.sprintf(e,...t)}catch(r){return r instanceof Error&&PM(`sprintf error:
|
|
57
|
+
|
|
58
|
+
`+r.toString()),e}}var Lm={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},TM=["(","?"],go={")":["("],":":["?","?:"]},CM=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function OM(e){for(var t=[],r=[],n,i,o,a;n=e.match(CM);){for(i=n[0],o=e.substr(0,n.index).trim(),o&&t.push(o);a=r.pop();){if(go[i]){if(go[i][0]===a){i=go[i][1]||i;break}}else if(TM.indexOf(a)>=0||Lm[a]<Lm[i]){r.push(a);break}t.push(a)}go[i]||r.push(i),e=e.substr(n.index+i.length)}return e=e.trim(),e&&t.push(e),t.concat(r.reverse())}var AM={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,r){if(e)throw t;return r}};function MM(e,t){for(var r=[],n=0,i,o,a,s,c;n<e.length;n++){if(s=e[n],a=AM[s],a){for(i=a.length,o=Array(i);i--;)o[i]=r.pop();try{c=a.apply(null,o)}catch(l){return l}}else t.hasOwnProperty(s)?c=t[s]:c=+s;r.push(c)}return r[0]}function kM(e){var t=OM(e);return function(r){return MM(t,r)}}function jM(e){var t=kM(e);return function(r){return+t({n:r})}}var Fm={contextDelimiter:"",onMissingKey:null};function RM(e){for(var t=e.split(";"),r=0,n;r<t.length;r++)if(n=t[r].trim(),n.indexOf("plural=")===0)return n.substr(7)}function Ws(e,t){var r;this.data=e,this.pluralForms={},this.options={};for(r in Fm)this.options[r]=t!==void 0&&r in t?t[r]:Fm[r]}Ws.prototype.getPluralForm=function(e,t){var r=this.pluralForms[e],n,i,o;return r||(n=this.data[e][""],o=n["Plural-Forms"]||n["plural-forms"]||n.plural_forms,typeof o!="function"&&(i=RM(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),o=jM(i)),r=this.pluralForms[e]=o),r(t)},Ws.prototype.dcnpgettext=function(e,t,r,n,i){var o,a,s;return i===void 0?o=0:o=this.getPluralForm(e,i),a=r,t&&(a=t+this.options.contextDelimiter+r),s=this.data[e][a],s&&s[o]?s[o]:(this.options.onMissingKey&&this.options.onMissingKey(r,e),o===0?r:n)};var xm={"":{plural_forms(e){return e===1?0:1}}},NM=/^i18n\.(n?gettext|has_translation)(_|$)/,Ks=(e,t,r)=>{const n=new Ws({}),i=new Set,o=()=>{i.forEach(y=>y())},a=y=>(i.add(y),()=>i.delete(y)),s=(y="default")=>n.data[y],c=(y,I="default")=>{n.data[I]={...n.data[I],...y},n.data[I][""]={...xm[""],...n.data[I]?.[""]},delete n.pluralForms[I]},l=(y,I)=>{c(y,I),o()},u=(y,I="default")=>{n.data[I]={...n.data[I],...y,"":{...xm[""],...n.data[I]?.[""],...y?.[""]}},delete n.pluralForms[I],o()},d=(y,I)=>{n.data={},n.pluralForms={},l(y,I)},f=(y="default",I,_,P,v)=>(n.data[y]||c(void 0,y),n.dcnpgettext(y,I,_,P,v)),m=(y="default")=>y,g=(y,I)=>{let _=f(I,void 0,y);return r?(_=r.applyFilters("i18n.gettext",_,y,I),r.applyFilters("i18n.gettext_"+m(I),_,y,I)):_},h=(y,I,_)=>{let P=f(_,I,y);return r?(P=r.applyFilters("i18n.gettext_with_context",P,y,I,_),r.applyFilters("i18n.gettext_with_context_"+m(_),P,y,I,_)):P},E=(y,I,_,P)=>{let v=f(P,void 0,y,I,_);return r?(v=r.applyFilters("i18n.ngettext",v,y,I,_,P),r.applyFilters("i18n.ngettext_"+m(P),v,y,I,_,P)):v},S=(y,I,_,P,v)=>{let M=f(v,P,y,I,_);return r?(M=r.applyFilters("i18n.ngettext_with_context",M,y,I,_,P,v),r.applyFilters("i18n.ngettext_with_context_"+m(v),M,y,I,_,P,v)):M},T=()=>h("ltr","text direction")==="rtl",w=(y,I,_)=>{const P=I?I+""+y:y;let v=!!n.data?.[_??"default"]?.[P];return r&&(v=r.applyFilters("i18n.has_translation",v,y,I,_),v=r.applyFilters("i18n.has_translation_"+m(_),v,y,I,_)),v};if(e&&l(e,t),r){const y=I=>{NM.test(I)&&o()};r.addAction("hookAdded","core/i18n",y),r.addAction("hookRemoved","core/i18n",y)}return{getLocaleData:s,setLocaleData:l,addLocaleData:u,resetLocaleData:d,subscribe:a,__:g,_x:h,_n:E,_nx:S,isRTL:T,hasTranslation:w}},DM={ru_RU:{"Unlimited possibilities with the PRO plan":["Безграничные возможности с тарифом PRO"],"All plan features":["Все преимущества тарифов"],Free:["Free"],Personal:["Персональный"],Advanced:["Продвинутый"],"Advanced+":["Продвинутый+"],Pro:["Профессиональный"],"Pro+":["Профессиональный+"],Enterprise:["Корпоративный"],"Projects and emails":["Проекты и письма"],"Email editor":["Редактор писем"],"Additional features":["Дополнительные функции"],"Team collaboration":["Командная работа"],Support:["Поддержка"],Projects:["Проекты"],"Saved email templates":["Сохранённые шаблоны писем"],"Saved blocks":["Сохранённые блоки"],"Exports per month":["Экспорты в месяц"],"Export to HTML, ZIP and clipboard":["Экспорт в HTML, ZIP и буфер обмена"],"Export to PDF":["Экспорт в PDF"],"Export to PNG":["Экспорт в PNG"],"Export to webhook":["Экспорт в вебхук"],"Template import":["Импорт шаблона"],"Test emails":["Отправка тестовых писем"],"Preview mode":["Предпросмотр письма"],"Undo and redo":["Отмена и повтор действий"],"Export to Outlook":["Экспорт в Outlook"],"Email client tests":["Тесты в почтовиках"],"Block visibility control":["Управление видимостью блоков"],"Border control":["Управление рамками"],"Corner radius control":["Управление скруглением"],"Shadow control":["Управление тенью"],"Convert block to image":["Преобразование блока в изображение"],Typographer:["Типограф"],"Variables support":["Работа с переменными"],"Timer element":["Элемент «Таймер»"],"Video element":["Элемент «Видео»"],"AMP elements":["AMP элементы"],"AI image element":["Элемент «AI картинка»"],"AI image generation":["AI генерация изображений"],"Stock images and GIFs":["Стоковые изображения и GIF"],"Image editor":["Редактор изображений"],"AMP support":["Поддержка AMP"],"HTML code editing":["Правка HTML кода"],"Mobile adaptation":["Адаптация под мобильные устройства"],"Mobile element properties editor":["Редактор свойств элементов для мобильных"],"AI Assistant":["AI Ассистент"],"Link and image checks":["Проверка ссылок и изображений"],"Saved version history":["История сохранённых версий"],Users:["Пользователи"],"Template discussion":["Обсуждение шаблонов"],"User roles and access levels":["Роли пользователей и уровни доступа"],Chat:["Чат"],"Email support":["Электронная почта"],"Phone support":["Телефон"],"Video call":["Видеосозвон"],"Invoice payment and document flow":["Оплата по счёту, документооборот"],"Failed to load plan data":["Не удалось загрузить данные тарифа"],"Editor features depend on your plan. Check your connection and try again.":["Возможности редактора зависят от тарифа. Проверьте соединение и повторите попытку."],"Try again":["Повторить"]}};function LM(e,t){const r=t?DM[t]:void 0;return r&&e.setLocaleData(r),e}var FM={items_per_page:"/ стр.",jump_to:"Перейти",jump_to_confirm:"подтвердить",page:"Страница",prev_page:"Назад",next_page:"Вперед",prev_5:"Предыдущие 5",next_5:"Следующие 5",prev_3:"Предыдущие 3",next_3:"Следующие 3",page_size:"размер страницы"},Um={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0};function xn(e){"@babel/helpers - typeof";return xn=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},xn(e)}function Bm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $m(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bm(Object(r),!0).forEach(function(n){xM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bm(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xM(e,t,r){return t=UM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UM(e){var t=BM(e,"string");return xn(t)=="symbol"?t:String(t)}function BM(e,t){if(xn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $M=$m($m({},Um),{},{locale:"ru_RU",today:"Сегодня",now:"Сейчас",backToToday:"Текущая дата",ok:"ОК",clear:"Очистить",week:"Неделя",month:"Месяц",year:"Год",timeSelect:"Выбрать время",dateSelect:"Выбрать дату",monthSelect:"Выбрать месяц",yearSelect:"Выбрать год",decadeSelect:"Выбрать десятилетие",previousMonth:"Предыдущий месяц (PageUp)",nextMonth:"Следующий месяц (PageDown)",previousYear:"Предыдущий год (Control + left)",nextYear:"Следующий год (Control + right)",previousDecade:"Предыдущее десятилетие",nextDecade:"Следущее десятилетие",previousCentury:"Предыдущий век",nextCentury:"Следующий век"}),qm={placeholder:"Выберите время",rangePlaceholder:["Время начала","Время окончания"]},zm={lang:{placeholder:"Выберите дату",yearPlaceholder:"Выберите год",quarterPlaceholder:"Выберите квартал",monthPlaceholder:"Выберите месяц",weekPlaceholder:"Выберите неделю",rangePlaceholder:["Начальная дата","Конечная дата"],rangeYearPlaceholder:["Начальный год","Год окончания"],rangeMonthPlaceholder:["Начальный месяц","Конечный месяц"],rangeWeekPlaceholder:["Начальная неделя","Конечная неделя"],shortWeekDays:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],shortMonths:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],...$M},timePickerLocale:{...qm}},qM=zm,zM=Q.__exportAll({default:()=>Gm}),Ke="${label} не является типом ${type}",Gm={locale:"ru",Pagination:FM,DatePicker:zm,TimePicker:qm,Calendar:qM,global:{placeholder:"Пожалуйста выберите",close:"Закрыть",show:"Показать",hide:"Скрыть"},Table:{filterTitle:"Фильтр",filterConfirm:"OK",filterReset:"Сбросить",filterEmptyText:"Без фильтров",filterCheckAll:"Выбрать все элементы",filterSearchPlaceholder:"Поиск в фильтрах",emptyText:"Нет данных",selectAll:"Выбрать всё",selectInvert:"Инвертировать выбор",selectNone:"Очистить все данные",selectionAll:"Выбрать все данные",sortTitle:"Сортировка",expand:"Развернуть строку",collapse:"Свернуть строку",triggerDesc:"Нажмите для сортировки по убыванию",triggerAsc:"Нажмите для сортировки по возрастанию",cancelSort:"Нажмите, чтобы отменить сортировку"},Tour:{Next:"Далее",Previous:"Назад",Finish:"Завершить"},Modal:{okText:"OK",cancelText:"Отмена",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Отмена"},Transfer:{titles:["",""],searchPlaceholder:"Поиск",itemUnit:"элем.",itemsUnit:"элем.",remove:"Удалить",selectAll:"Выбрать все данные",deselectAll:"Очистить все данные",selectCurrent:"Выбрать текущую страницу",selectInvert:"Инвертировать выбор",removeAll:"Удалить все данные",removeCurrent:"Удалить текущую страницу"},Upload:{uploading:"Загрузка...",removeFile:"Удалить файл",uploadError:"При загрузке произошла ошибка",previewFile:"Предпросмотр файла",downloadFile:"Загрузить файл"},Empty:{description:"Нет данных"},Icon:{icon:"иконка"},Text:{edit:"Редактировать",copy:"Копировать",copied:"Скопировано",expand:"Раскрыть",collapse:"Свернуть"},Form:{optional:"(необязательно)",defaultValidateMessages:{default:"Ошибка проверки поля ${label}",required:"Пожалуйста, введите ${label}",enum:"${label} должен быть одним из [${enum}]",whitespace:"${label} не может быть пустым",date:{format:"${label} не правильный формат даты",parse:"${label} не может быть преобразовано в дату",invalid:"${label} не является корректной датой"},types:{string:Ke,method:Ke,array:Ke,object:Ke,number:Ke,date:Ke,boolean:Ke,integer:Ke,float:Ke,regexp:Ke,email:Ke,url:Ke,hex:Ke},string:{len:"${label} должна быть ${len} символов",min:"${label} должна быть больше или равна ${min} символов",max:"${label} должна быть меньше или равна ${max} символов",range:"Длина ${label} должна быть между ${min}-${max} символами"},number:{len:"${label} должна быть равна ${len}",min:"${label} должна быть больше или равна ${min}",max:"${label} должна быть меньше или равна ${max}",range:"${label} должна быть между ${min}-${max}"},array:{len:"Количество элементов ${label} должно быть равно ${len}",min:"Количество элементов ${label} должно быть больше или равно ${min}",max:"Количество элементов ${label} должно быть меньше или равно ${max}",range:"Количество элементов ${label} должно быть между ${min} и ${max}"},pattern:{mismatch:"${label} не соответствует шаблону ${pattern}"}}},QRCode:{expired:"QR-код устарел",refresh:"Обновить"},ColorPicker:{presetEmpty:"Пустой",transparent:"Прозрачный",singleColor:"Один цвет",gradientColor:"Градиент"}},Hm=Gm;function GM(e){const t=e?.[""];return typeof t?.lang=="string"?t.lang:void 0}function Vm(e){return e.id??GM(e.catalog)}var Wm=(e,t)=>{const r=(0,b.useRef)(void 0);r.current=e;const n=(0,b.useRef)(void 0);(0,b.useEffect)(()=>{n.current!==null&&r.current(n.current||[]),n.current=t},t)},Qs=Ks();function Km(e){return{__:e.__.bind(e),_x:e._x.bind(e),_n:e._n.bind(e),_nx:e._nx.bind(e),sprintf:IM,isRTL:e.isRTL.bind(e),hasTranslation:e.hasTranslation.bind(e)}}var Qm=(0,b.createContext)(Km(Qs));function HM(e){const{children:t,i18n:r=Qs}=e,[,n]=(0,b.useReducer)(()=>[],[]);(0,b.useEffect)(()=>r.subscribe(n),[r]);const i=(0,b.useMemo)(()=>Km(r),[r]);return(0,b.createElement)(Qm.Provider,{value:i},t)}var he=()=>(0,b.useContext)(Qm),yo=Qs;function VM(e){if(e==="uk"||e.startsWith("uk_"))return"uk";const t=e.search(/[_-]/);return t>0?e.slice(0,t):e}var Ys=class extends C.Disposable{_options;_listeners=[];constructor(e){super(),this._options=e}fire=e=>{if(!this.isDisposed()){let t;const r=[...this._listeners];for(const n of r){if(t===!1)return!1;t instanceof Promise?t=t.then(i=>i===!1||this.isDisposed()?!1:n(i)).catch(i=>{}):t=n(e)}return t}};addEventListener=e=>{const t=this._listeners,r=this._options;return t.push(e),t.length===1&&this._options?.onFirstListenerAdd&&this._options.onFirstListenerAdd(),{dispose:()=>{const n=t.indexOf(e);n>=0&&(t.splice(n,1),t.length||r?.onFirstListenerAdd&&r.onLastListenerRemove())}}};event=this.addEventListener},Ym;(function(e){function t(i){let o;const a=new Ys({onFirstListenerAdd(){o=i(a.fire)},onLastListenerRemove(){o.dispose()}});return a.event}e.snapshot=t;function r(i,o){return t(a=>i(s=>o(s)&&a(s)))}e.filter=r;function n(i,o){return t(a=>i(s=>a(o(s))))}e.map=n})(Ym||(Ym={}));var Xm=C.createIdentifier$1("helpers.commandEmitter");function WM(e,t,r){e instanceof C.Container||(e=C.getContainer(e)),e.getOrCreateInstance(Xm,()=>new Ys).fire({id:t,payload:r})}function KM(e,t){return C.getContainer(e).getOrCreateInstance(Xm,()=>new Ys).addEventListener}var Jm=(e,t)=>{const r=KM(Im(),e);(0,b.useEffect)(()=>{const n=r(({id:i,payload:o})=>{i===e&&t(o)});return()=>n.dispose()},[r,e,t])};function Az(e){return e}var QM="SAVE",Mz="SET_THEME",Zm="NOTIFY",kz="SET_CONFIG",jz="UPDATE_CONFIG",_o=e=>yo.__(e);function YM(e){return Pf()?{title:_o("No internet connection"),description:_o("Check your network connection and try again.")}:Cf(e)?{title:_o("Server is unavailable"),description:_o("Could not reach the server. Please try again later.")}:null}var Xs=()=>yo.__("Unknown error");function eh(e,t){return typeof e=="string"&&e.trim()?e:typeof e=="number"||typeof e=="boolean"?String(e):t}var XM=new Set(["uninitialized","pending","fulfilled","rejected"]);function th(e){return typeof e=="string"&&!XM.has(e)?e:void 0}function vo(...e){for(const t of e){if(typeof t=="string"&&t.trim())return t;if(typeof t=="number"||typeof t=="boolean")return String(t)}}function rh(e){const t=YM(e);if(t)return t;const r=If(e),n=e&&typeof e=="object"?e:{},i=vo(n.title,n.message),o=vo(n.description),a=i??vo(...r.flatMap(c=>{if(!c||typeof c!="object")return[c];const l=c,u=l.data;return[l.message,l.code,u?.code,u?.message,th(l.status)]}))??Xs(),s=o??vo(...r.flatMap(c=>{if(!c||typeof c!="object")return typeof c=="string"?[c]:[];const l=c,u=l.data;return[l.description,typeof l.error=="string"?l.error:void 0,u?.message,u?.code,th(l.status)]}))??a;return{title:eh(a,"")||Xs(),description:eh(s,"")||Xs()}}var nh="bottomRight";function JM(e){if(e.title!=null||e.message==null)return e;const{message:t,...r}=e;return{...r,title:t}}function ZM({node:e}){const t=(0,b.useCallback)(r=>r?.replaceWith(e),[e]);return(0,R.jsx)("div",{ref:t})}var ek=["title","message","description","actions","icon","closeIcon"];function tk(e){let t=e;for(const r of ek){const n=t[r];n instanceof HTMLElement&&(t===e&&(t={...e}),t[r]=(0,R.jsx)(ZM,{node:n}))}return t}function rk(e){return{id:e.id,code:e.html,title:e.title,subject:e.subject,preheader:e.preheader}}function nk(e){return{id:e.id,code:e.html,title:e.title}}function Gt(){const e=Tt(C.events.ON_NOTIFICATION),{notification:t}=B.ui_kit$App.useApp(),r=(0,b.useCallback)((l,u)=>{l.type||(l={...l,type:"info"});const d=De({...l});return e.fire(d).then(f=>f.every(m=>m!==!1)?(l={...l,...d},l.placement===void 0&&(l.placement=nh),l=Object.assign(l,...f.filter(m=>typeof m=="object")),u||(t[l.type]?t[l.type](tk(JM(l))):l.title),l):!1)},[t,e]),n=(0,b.useCallback)((l,u)=>{const{title:d,description:f}=rh(l);return r({...l&&typeof l=="object"?l:{},title:(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:d}}),description:(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:f}}),...f===d?{description:void 0}:{},type:"error"},u)},[r]),i=(0,b.useCallback)((l="Success",u)=>r({...typeof l=="string"?{title:l}:l,type:"success"},u),[r]),o=(0,b.useCallback)((l,u)=>r({...l,type:"warning"},u),[r]),a=(0,b.useCallback)((l,u)=>r({...l,type:"info"},u),[r]),s=(0,b.useCallback)(l=>{t.destroy(l)},[t]),c=(0,b.useCallback)((l,u,d,f,m=nh)=>{if(d){const{title:g,description:h}=rh(d);n({id:l,data:u,title:g,description:h,placement:m,innerException:d?.data instanceof Error?d.data:d,error:d},f)}},[n]);return(0,b.useMemo)(()=>({notify:r,success:i,error:n,warning:o,fromError:c,info:a,destroy:s}),[r,i,n,o,c,a,s])}function ik(){const{notify:e}=Gt();Jm(Zm,e)}var Rz="en_US",ih=C.createIdentifier$1("locale.service"),ok={ready:!1};function oh(){const e=Se().getInstance(ih),t=(0,b.useCallback)(r=>{if(!e)return()=>{};const n=e.state.watch(r);return()=>n.dispose()},[e]);return(0,b.useSyncExternalStore)(t,()=>e?.snapshot()??ok)}function ah(){return Vm(oh())}var ak=({children:e})=>{const t=oh(),r=Gt(),n=Vm(t),i=(0,b.useMemo)(()=>LM(Ks(t.catalog),t.catalog?n:void 0),[t.catalog,n]),o=t.antd,a=o&&o.locale!==Hm.locale?o:Hm;return(0,b.useEffect)(()=>{},[t.id]),Wm(([s])=>{!s&&t.failure&&r.fromError(t.failure.kind,void 0,t.failure.error??{status:"FETCH_ERROR"})},[t.failure,r]),(0,R.jsx)(HM,{i18n:i,children:(0,R.jsx)(sk,{children:(0,R.jsx)(Rd.Provider,{value:t.ready,children:(0,R.jsx)(B.ui_kit$ThemeProvider,{locale:a,children:e})})})})};function sk({children:e}){const t=he();return(0,R.jsx)(B.ui_kit$UiKitI18nProvider,{value:t,children:e})}function Ht({id:e,type:t,title:r,excerpt:n,author:i,acf:{subject:o,description:a,html:s,project:c,related_email:l,tags:u,type:d,is_template:f,global_block:m,lock:g},...h}){return{...h,id:String(e),author:String(i),renderGuid:C.generateUUID(),description:a,html:s,excerpt:lt(r),project:be(c)?c.ID:c,project_author:be(c)?c.post_author:void 0,project_title:be(c)?c.post_title:void 0,tags:u,is_template:f,global_block:m,type:d,related_email:pe(be(l)?l.ID:l),title:lt(r)||"",lock:g}}function sh({title:e,subject:t,description:r,renderGuid:n,html:i,project:o,tags:a,type:s,related_email:c,is_template:l,global_block:u,lock:d,author:f,...m}){return{...m,author:Pe(f),title:e,acf:{description:r,related_email:Pe(c),html:i,project:o,tags:a,type:s,is_template:l,...typeof u=="boolean"?{global_block:u}:{},lock:d}}}function lh({id:e,title:t,acf:{html:r},excerpt:n,parent:i,author:o,...a}){return{...a,isAutosave:Zf(a.slug),id:pe(e),author:pe(o),parent:pe(i),title:lt(t)||"",html:r,excerpt:be(n)?n.rendered:n}}function ch({parent:e,title:t,html:r,project:n,author:i,...o}){return{...o,author:Pe(i),parent:Pe(e),title:lt(t),"acf[html]":r,"acf[project]":be(n)?n.id||n.ID:n}}function Js(e){return(t,r,n,i)=>e(C.getContainer(r))(t,r,n,i)}var lk=new Set(["rest_already_trashed","rest_post_invalid_id"]);function ck(e){return e.error?.data?.code}async function uh(e,t){const r={deleted:[],failed:[]};for(const n of e)try{const i=await t(n);if(i.ok||lk.has(ck(i)))r.deleted.push(n);else{const o=i.error?.data??i.error;r.failed.push({id:n,error:{status:i.status,data:o}})}}catch(i){r.failed.push({id:n,error:{status:"FETCH_ERROR",error:String(i)}})}return r}var bo=[{type:"Blocks",id:"LIST"},{type:"ParentsBlocks",id:"LIST"},{type:"TemplatesBlocks",id:"LIST"}],Vt=Ie({reducerPath:"blocksApi",tagTypes:["Blocks","TemplatesBlocks","ParentsBlocks","Block"],baseQuery:Fe({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getBlocks:e.query({queryFn(t,r){const n=H(r),i={order:"desc",orderby:"modified"},o={};if(t.notEmbed||(o._embed=""),t.projectId&&(o._embed="author",o._fields="id,title,blocktags,blockfolder,group,modified,date,type,acf.lock,acf.project.ID,acf.type,author,acf.is_template,acf.global_block,acf.html,_embedded",i["filter[meta_key]"]="project",i["filter[meta_value]"]=t.projectId),t.fields&&(o._fields=t.fields),t.page&&(i.page=t.page),t.order&&(i.order=t.order),t.orderby&&(i.orderby=t.orderby),t.folderTag&&t.folderTag!=="all"?(i["filter[tax_query][relation]"]="AND",i["filter[tax_query][0][taxonomy]"]="blockfolder",i["filter[tax_query][0][field]"]="id",i["filter[tax_query][0][terms]"]=t.folderTag,i["filter[tax_query][0][include_children]"]="0"):t.hasOwnProperty("folderTag")&&(t.folderTag!=="all"||typeof t.folderTag=="object"&&t.folderTag===null)&&!t.tags?.length&&t.status&&t.status!=="trash"&&(i["filter[tax_query][0][taxonomy]"]="blockfolder",i["filter[tax_query][0][operator]"]="NOT EXISTS"),t.tags?.length>0&&t.status!=="trash"){i["filter[tax_query][relation]"]="AND";for(let a=0,s=t.tags.length;a<s;a++){const c=t.tags[a];i[`filter[tax_query][${a+1}][taxonomy]`]="blocktags",i[`filter[tax_query][${a+1}][field]`]="id",i[`filter[tax_query][${a+1}][terms]`]=c}}return t.type&&(i["filter[meta_query][2][key]"]="type",i["filter[meta_query][2][value]"]=t.type),t.name&&(i.search=t.name),t.pageSize&&(i.per_page=t.pageSize),t.status==="trash"&&(o.status="trash"),n.wp.eblock_list(i,{extraQuery:o}).then(ze(Ht))},providesTags:t=>t?[...t.map(({id:r})=>({type:"Blocks",id:r})),{type:"Blocks",id:"LIST"}]:[{type:"Blocks",id:"LIST"}]}),getBlocksSchema:e.query({queryFn(t,r){return H(r).wp.eblock_list(void 0,{method:"OPTIONS",extraQuery:{_fields:"schema.properties.acf"}})}}),getParentEmailBlocks:e.query({queryFn(t,r){const n=H(r),i={"filter[meta_query][0][compare]":"LIKE"},o={};if(t.notEmbed||(o._embed=""),t.emailId&&(i["filter[meta_query][0][key]"]="related_email",i["filter[meta_query][0][value]"]=t.emailId),t.fields&&(o._fields=t.fields),t.page&&(i.page=t.page),t.tags?.length>0){i["filter[tax_query][relation]"]="AND";for(let a=0,s=t.tags.length;a<s;a++){const c=t.tags[a];i[`filter[tax_query][${a}][taxonomy]`]="blocktags",i[`filter[tax_query][${a}][field]`]="id",i[`filter[tax_query][${a}][terms]`]=c}}return t.type&&(i["filter[meta_query][2][key]"]="type",i["filter[meta_query][2][value]"]=t.type),t.name&&(i.search=t.name),t.pageSize&&(i.per_page=t.pageSize),n.wp.eblock_list(i,{extraQuery:o}).then(ze(Ht))},providesTags:t=>t?[...t.map(({id:r})=>({type:"ParentsBlocks",id:r})),{type:"ParentsBlocks",id:"LIST"}]:[{type:"ParentsBlocks",id:"LIST"}]}),getTemplateBlocks:e.query({queryFn:(t,r)=>{const n=H(r),i={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1",orderby:"modified",order:"desc"},o={};if(t.notEmbed||(o._embed=""),t.fields&&(o._fields=t.fields),t.page&&(i.page=t.page),t.tags?.length>0){i["filter[tax_query][relation]"]="AND";for(let a=0,s=t.tags.length;a<s;a++){const c=t.tags[a];i[`filter[tax_query][${a}][taxonomy]`]="blocktags",i[`filter[tax_query][${a}][field]`]="id",i[`filter[tax_query][${a}][terms]`]=c}}return t.type&&(i["filter[meta_query][2][key]"]="type",i["filter[meta_query][2][value]"]=t.type),t.name&&(i.search=t.name),t.pageSize&&(i.per_page=t.pageSize),n.wp.eblock_list(i,{extraQuery:o}).then(ze(Ht))},providesTags:t=>t?[...t.map(({id:r})=>({type:"TemplatesBlocks",id:r})),{type:"TemplatesBlocks",id:"LIST"}]:[{type:"TemplatesBlocks",id:"LIST"}]}),getBlock:e.query({queryFn(t,r){return H(r).wp.eblock_detail({id:Pe(t)},{extraQuery:{_embed:""}}).then(we(Ht))},providesTags:(t,r,n)=>[{type:"Block",id:n}]}),addBlock:e.mutation({queryFn(t,r){return H(r).wp.eblock_create({...sh(t),status:"publish"},{type:C.ContentType.Json}).then(we(Ht))},invalidatesTags:[...bo]}),editBlock:e.mutation({queryFn:Js(t=>({blockId:r,source:n,...i},o)=>{const a=jn(t),s=De(sh(i));return a.wp.eblock_partial_update({id:r},s,{type:C.ContentType.Json,extraQuery:{_embed:"wp:term"}}).then(we(Ht))}),invalidatesTags:(t,r,n)=>[...bo,{type:"Blocks",id:n.blockId}]}),deleteBlock:e.mutation({queryFn(t,r){const n=H(r);let i,o;return typeof t=="object"?(i=t.id,o=t.force):(i=t,o=!1),n.wp.eblock_delete({id:i},{force:o}).then(Ri(Ht))},invalidatesTags:(t,r,n)=>[...bo,{type:"Blocks",id:typeof n=="object"?n.id:n}]}),deleteBlocks:e.mutation({async queryFn({ids:t,force:r},n){const i=H(n);return{data:await uh(t,o=>i.wp.eblock_delete({id:o},{force:r}))}},invalidatesTags:(t,r,{ids:n})=>[...bo,...n.map(i=>({type:"Blocks",id:i}))]}),addTag:e.mutation({queryFn(t,r){return H(r).wp.blocktags_create({...t},{type:C.ContentType.Json})}}),getDeletableTag:e.query({queryFn([t,r],n){return H(n).wp.eblock_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":t,blocktags:[r]},{extraQuery:{"_fields[]":"blocktags"}}).then(ze(Ht))}}),autoSaveBlock:e.mutation({queryFn({blockId:t,body:r},n){const i=H(n),o=ch(r);return i.wp.eblock_autosaves_create({id:t},o,{type:C.ContentType.FormData}).then(we(lh))}})})}),{useGetBlocksQuery:uk,useGetBlockQuery:dk,useLazyGetBlockQuery:Nz,useGetBlocksSchemaQuery:fk,useGetParentEmailBlocksQuery:pk,useAddBlockMutation:mk,useEditBlockMutation:dh,useDeleteBlocksMutation:Dz,useAddTagMutation:Lz,useAutoSaveBlockMutation:hk,useGetTemplateBlocksQuery:gk}=Vt,Zs={invalidateBlockId:null,isCodeMode:!1,codeModeDirection:"right",editorThemeColor:"light",isSettingsDisabled:!1,settings:{width:""},elementSettings:{},searchFilters:{},monacoDidMount:!1},xr="blockSlice",fh=Te({name:xr,initialState:Zs,reducers:{switchCodeMode:e=>{e.isCodeMode=!e.isCodeMode},setEditorThemeColor:(e,t)=>{e.editorThemeColor=t.payload},setBlockSettings:(e,t)=>{Object.assign(e,{...e,settings:t.payload,isSettingsDisabled:!1})},setBlockSettingsDisable:(e,t)=>{e.isSettingsDisabled=t.payload},setElementSettings:(e,t)=>{e.elementSettings=t.payload},setSearchFilters:(e,t)=>{e.searchFilters=t.payload},resetBlockSlice:()=>Zs},extraReducers:e=>{e.addMatcher(t=>t.type==="blocksApi/queries/queryResultPatched",(t,r)=>{const n=r.payload.queryCacheKey.match(/\(([0-9]+)\)/);n?.[1]&&(t.invalidateBlockId=n[1])}),e.addMatcher(t=>t.type==="blocksApi/invalidateTags",(t,r)=>{if(r.payload[0].id===+t.invalidateBlockId)return{...Zs,isCodeMode:t?.isCodeMode,codeModeDirection:t.codeModeDirection}}),e.addMatcher(Vt.endpoints.editBlock.matchFulfilled,t=>{t.invalidateBlockId=null})}}),{switchCodeMode:Fz,setEditorThemeColor:yk,setBlockSettings:_k,setElementSettings:vk,setBlockSettingsDisable:bk,setSearchFilters:xz,resetBlockSlice:Ek}=fh.actions,wk=e=>e[xr].isCodeMode,Sk=e=>e[xr].settings,ph=e=>e[xr].elementSettings,Pk=e=>e[xr].editorThemeColor,Ik=e=>e[xr].isSettingsDisabled,mh=C.createIdentifier$1("CodeMode");function el(){let e;try{const t=window.localStorage?.getItem(It.em_code_mode_settings);e=t?JSON.parse(t):void 0}catch{e=void 0}return{isCodeMode:!!(e?.isCodeMode||e?.isCodeMode===void 0),direction:e?.codeModeDirection||"left"}}function Tk(e){try{window.localStorage?.setItem(It.em_code_mode_settings,JSON.stringify({isCodeMode:e.isCodeMode,codeModeDirection:e.direction}))}catch{}}function Eo(e){return e.getOrCreateInstance(mh,()=>{const t=it(el());return t.watch(Tk),t})}function hh(e){return e?.getInstance(mh)?.get()??el()}function tl(e,t){const r=Eo(e);r.get().isCodeMode!==t&&r.set({...r.get(),isCodeMode:t})}function Ck(e){const t=Eo(e);t.set({...t.get(),isCodeMode:!t.get().isCodeMode})}function gh(e,t){const r=Eo(e);r.set({...r.get(),direction:t})}var Ok="100%",yh=el(),Ak={activeModal:"",lastActiveSettingsTab:ja,activeSettingsTab:ja,isPanelHistoryCollapsed:!0,monacoHeight:0,isCodeMode:yh.isCodeMode,codeModeDirection:yh.direction,isHeaderCodeMenuOpen:{current:!1,switched:!1},emailWidth:Ok,emailViewType:Sd,mobileViewActive:{shutdown:!0,styles:!0},emailMaxWidthSize:425,propertiesPanelKey:_d,parentBlocks:[],isGlobalLoading:!1},Qe="emailPageSlice",_h=Te({name:Qe,initialState:Ak,reducers:{openModal:(e,t)=>{e.activeModal=t.payload},closeModal:e=>{e.activeModal=""},setActiveSettingsTab:(e,t)=>{e.lastActiveSettingsTab=e.activeSettingsTab,e.activeSettingsTab=t.payload,t.payload!=="History"&&(e.isPanelHistoryCollapsed=!0)},resetToLastActiveSettingsTab:e=>{e.lastActiveSettingsTab==="Properties"?e.activeSettingsTab="Build":e.activeSettingsTab=e.lastActiveSettingsTab,e.lastActiveSettingsTab!=="History"&&(e.isPanelHistoryCollapsed=!0)},switchIsPanelHistoryCollapsed:(e,t)=>{e.isPanelHistoryCollapsed=t.payload||!e.isPanelHistoryCollapsed},setEmailWidth:(e,{payload:t})=>{e.emailWidth=t,e.emailViewType=typeof t=="number"&&t<=e.emailMaxWidthSize?Pd:Sd,window.localStorage.setItem(It.em_default_sizes,JSON.stringify(t))},setEmailMaxWidthSize:(e,{payload:t})=>{e.emailMaxWidthSize=t},setEmailViewType:(e,t)=>{e.emailViewType=t.payload},setCodeMode:(e,{payload:t})=>{e.isCodeMode=t},switchCodeModeDirection:(e,{payload:t})=>{e.codeModeDirection=t},setMobileViewActive:(e,t)=>{e.mobileViewActive=t.payload},setPropertiesPanelKey:(e,t)=>{e.propertiesPanelKey=t.payload},resetParentBlocks:e=>{e.parentBlocks=[]},setParentBlocks:(e,t)=>{e.parentBlocks=t.payload},setIsGlobalLoading:(e,t)=>{e.isGlobalLoading=t.payload},setHeaderCodeMenuOpen:(e,t)=>{e.isHeaderCodeMenuOpen.current&&!t.payload?e.isHeaderCodeMenuOpen.switched=!0:e.isHeaderCodeMenuOpen.switched=!1,e.isHeaderCodeMenuOpen.current=t.payload}},extraReducers:e=>{e.addMatcher(Vt.endpoints.getParentEmailBlocks.matchFulfilled,(t,r)=>{t.parentBlocks=r.payload})}}),{openModal:Mk,closeModal:kk,setActiveSettingsTab:rl,resetToLastActiveSettingsTab:vh,switchIsPanelHistoryCollapsed:jk,setEmailWidth:Rk,switchCodeModeDirection:Nk,setMobileViewActive:Dk,setEmailViewType:Uz,setCodeMode:Lk,setEmailMaxWidthSize:Bz,setPropertiesPanelKey:Fk,resetParentBlocks:xk,setIsGlobalLoading:Uk,setHeaderCodeMenuOpen:Bk}=_h.actions,$k=e=>e[Qe].isCodeMode,bh=e=>e[Qe].emailWidth,qk=e=>e[Qe].activeModal,zk=e=>e[Qe].parentBlocks,Gk=e=>e[Qe].emailViewType,Hk=e=>e[Qe].isGlobalLoading,Vk=e=>e[Qe].mobileViewActive,Wk=e=>e[Qe].codeModeDirection,Eh=e=>e[Qe].activeSettingsTab,Kk=e=>e[Qe].propertiesPanelKey,Qk=e=>e[Qe].isHeaderCodeMenuOpen,Yk=e=>e[Qe].isPanelHistoryCollapsed,wh=()=>jS(C.COOKIE_MANAGER_ID);function Sh(e){const t=e.getBoundingClientRect(),r=e.offsetWidth>0&&t.width>0?t.width/e.offsetWidth:1;return{x:r,y:e.offsetHeight>0&&t.height>0?t.height/e.offsetHeight:r}}var nl=1340,Xk="em-scaled-layout",Jk="pluginZoom";function Ph(e){const t=Math.min(e.screenWidth,e.screenHeight),r=Math.max(e.screenWidth,e.screenHeight),n=e.landscape?r:t;return e.windowWidth&&e.windowWidth>0?Math.min(n,e.windowWidth):n}function Zk(e){return e.coarsePointer&&Ph(e)<1340}function ej(e){const t=(Ph(e)/nl).toFixed(4);return`width=${nl}, initial-scale=${t}, user-scalable=1`}var Ih="(pointer: coarse)",Th="(orientation: landscape)";function tj(e=window){const t=e.screen.orientation?.type;return{coarsePointer:e.matchMedia(Ih).matches,screenWidth:e.screen.width,screenHeight:e.screen.height,landscape:t?t.startsWith("landscape"):e.matchMedia(Th).matches,windowWidth:e.outerWidth}}function il(e){const t=Sh(e).y;return Math.abs(t-1)<.01?1:t}function rj(e,t){const r=e?.getBoundingClientRect().top??NaN,n=t?.getBoundingClientRect(),i=t?il(t):1;return{scrollTop:((n?.top??NaN)-r)/i,previewHeight:(n?.height??NaN)/i,scale:i}}function nj(e,t){return t.closest(".em-scaled-layout")?Math.round(e/Sh(t).y):e}var ij=()=>{},oj={};function aj(){const e=Se(),t=(0,b.useCallback)(r=>{if(!e)return ij;const n=fs(e).watch(r);return()=>n.dispose()},[e]);return{read:(0,b.useCallback)(()=>Qi(e).profile??oj,[e]),subscribe:t}}function ur(){const{read:e,subscribe:t}=aj();return(0,b.useSyncExternalStore)(t,e,e)}function sj(){return ur().locale}var lj={toggle:()=>{},set:()=>{},setDirection:()=>{}};function cj(){const e=Se();return(0,b.useMemo)(()=>e?{toggle:()=>Ck(e),set:t=>tl(e,t),setDirection:t=>gh(e,t)}:lj,[e])}var Ch=(0,b.createContext)({document:void 0,history:void 0});function et(){return(0,b.useContext)(Ch)}function uj({document:e,history:t,children:r}){const n=(0,b.useMemo)(()=>({document:e,history:t}),[e,t]);return(0,R.jsx)(Ch.Provider,{value:n,children:r})}function Oh(){const{document:e}=et(),t=(0,b.useCallback)(n=>e?e.subscribe(n):()=>{},[e]),r=(0,b.useCallback)(()=>e?.get().serverId??void 0,[e]);return(0,b.useSyncExternalStore)(t,r)}var $z="new";function Ah(){const{emailId:e}=or(),t=Se(),r=Oh();if(e!==void 0)return e==="new"?void 0:e;const n=t?hs(t)?.sessionKey():void 0;return Ce(n)?void 0:r}function dj(e,t){return e==null||t==null?!1:String(e)===String(t)}function Mh(e,t){if(e?.myRole==="owner"||e?.myRole==="admin")return e.myRole;if(e?.myRole==="user"||e?.myRole==="viewer")return"user";const r=Array.isArray(e?.members)?e.members:[],n=Array.isArray(e?.invites)?e.invites:[];if(t?.id==null||t.id==="")return null;const i=r.find(a=>dj(a?.userId,t.id));if(i){if(i.role==="owner"||i.role==="admin")return i.role;if(i.role==="user"||i.role==="viewer")return"user"}const o=t.email?.trim().toLowerCase();return o&&n.some(a=>a?.email?.trim().toLowerCase()===o)?"invited":null}function ol(e,t){return t.isPlugin?!1:e?.ownerPlan?.isPaid!==!0}function fj(e,t){const r=Mh(e,t);return r===null||r==="owner"}var pj=3,mj=6,wo=new WeakMap,kh=new Map;function al(e){let t=e.parentElement;for(;t;){const r=getComputedStyle(t).overflowY;if(r==="auto"||r==="scroll")return t;t=t.parentElement}return null}function jh(e,t){const r=e?e.clientHeight:typeof window>"u"?0:window.innerHeight;return`${Math.round(r*t)}px 0px`}function hj(e){if(typeof IntersectionObserver>"u")return;const t=kh.get(e);if(t)return t;const r={fill:new IntersectionObserver(n=>{for(const i of n)i.isIntersecting&&wo.get(i.target)?.fill()},{root:e,rootMargin:jh(e,pj)}),drop:new IntersectionObserver(n=>{for(const i of n)i.isIntersecting||wo.get(i.target)?.drop()},{root:e,rootMargin:jh(e,mj)})};return kh.set(e,r),r}function gj(e,t){const r=hj(al(e));return r?(wo.set(e,t),r.fill.observe(e),r.drop.observe(e),()=>{r.fill.unobserve(e),r.drop.unobserve(e),wo.delete(e)}):!1}var sl=".blocks-search__result-body",Rh=`${sl}[data-block-preview="filled"]`,ll=new Map;function yj(e){const t=e.shadowRoot?.firstElementChild,r=t instanceof HTMLStyleElement?t.nextElementSibling:t;return r instanceof HTMLElement?r.offsetHeight:0}function cl(e){if(!e.length)return;const t=al(e[0].body),r=t?t.getBoundingClientRect().top:0,n=e.map(({body:o})=>o.getBoundingClientRect());let i=0;e.forEach(({body:o,height:a,placeholder:s},c)=>{const l=n[c];if(t&&l.top<r&&(i+=a-l.height),o.style.height=`${a}px`,s){o.dataset.previewPlaceholder="true";return}o.dataset.previewMeasured="true",ll.set(o,a)}),t&&i!==0&&(t.scrollTop+=i)}function _j(){let e=0,t=0;return ll.forEach((r,n)=>{if(!n.isConnected){ll.delete(n);return}e+=r,t+=1}),t?e/t:0}function Nh(e){const t=_j();if(!t||!e)return;const r=[...e.querySelectorAll(`${sl}:not([data-preview-measured])`)],n=new Map,i=a=>{const s=a.parentElement;if(!n.has(s)){const c=al(a);n.set(s,c?c.getBoundingClientRect().bottom:null)}return n.get(s)??null},o=[];r.forEach(a=>{if(!a.dataset.previewPlaceholder){o.push({body:a,height:t,placeholder:!0});return}if(Math.abs((parseFloat(a.style.height)||0)-t)<1)return;const s=i(a);s!==null&&a.getBoundingClientRect().top>=s&&o.push({body:a,height:t,placeholder:!0})}),cl(o)}function vj(e,t){e&&(cl(Dh([...e.querySelectorAll(`${Rh} .blocks-search__result-html`)].map(r=>[r,t]))),Nh(e))}function Dh(e){const t=e.map(([n,i])=>yj(n)*i),r=[];return e.forEach(([n],i)=>{const o=n.closest(sl);o&&t[i]>0&&r.push({body:o,height:t[i]})}),r}var ul=new Map,dl=0;function bj(){dl=0;const e=[...ul].filter(([t])=>t.closest(Rh)!==null);ul.clear(),cl(Dh(e)),Nh(e[0]?.[0].ownerDocument??null)}function Ej(e,t){ul.set(e,t),dl||(dl=requestAnimationFrame(bj))}function wj(e){return(0,b.useCallback)(t=>Ej(t,e),[e])}var Sj=`
|
|
59
|
+
<style>
|
|
60
|
+
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
61
|
+
.em-mob-width-100perc {
|
|
62
|
+
width: 100% !important;
|
|
63
|
+
max-width: 100% !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.em-mob-width-91perc {
|
|
67
|
+
width: 91% !important;
|
|
68
|
+
max-width: 91% !important;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
72
|
+
<tr em="block" class="em-structure">
|
|
73
|
+
<td align="center">
|
|
74
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
75
|
+
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
76
|
+
<![endif]-->
|
|
77
|
+
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
78
|
+
<tr>
|
|
79
|
+
<td align="center" valign="top">
|
|
80
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
81
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
82
|
+
<table border="0" cellspacing="0" cellpadding="0">
|
|
83
|
+
<tr><td width="660" valign="top" align="center"><![endif]-->
|
|
84
|
+
<div style="display: inline-block; width: 100%; max-width: 660px; vertical-align: top;" class="em-mob-width-100perc">
|
|
85
|
+
<table width="602" border="0" cellspacing="0" cellpadding="0" style="width: 91%; max-width: 602px;" class="em-mob-width-91perc">
|
|
86
|
+
<tr>
|
|
87
|
+
<td align="left"></td>
|
|
88
|
+
</tr>
|
|
89
|
+
</table>
|
|
90
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
91
|
+
</div>
|
|
92
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
93
|
+
</td></tr>
|
|
94
|
+
</table><![endif]-->
|
|
95
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
96
|
+
</td>
|
|
97
|
+
</tr>
|
|
98
|
+
</table>
|
|
99
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
100
|
+
</td></tr></table>
|
|
101
|
+
<![endif]-->
|
|
102
|
+
</td>
|
|
103
|
+
</tr>
|
|
104
|
+
|
|
105
|
+
`,Pj=`
|
|
106
|
+
<style>
|
|
107
|
+
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
108
|
+
.em-mob-width-100perc {
|
|
109
|
+
width: 100% !important;
|
|
110
|
+
max-width: 100% !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.em-mob-width-91perc {
|
|
114
|
+
width: 91% !important;
|
|
115
|
+
max-width: 91% !important;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
119
|
+
<tr em="block" class="em-structure">
|
|
120
|
+
<td align="center">
|
|
121
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
122
|
+
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
123
|
+
<![endif]-->
|
|
124
|
+
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
125
|
+
<tr>
|
|
126
|
+
<td align="center" valign="top">
|
|
127
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
128
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
129
|
+
<table border="0" cellspacing="0" cellpadding="0">
|
|
130
|
+
<tr><td width="207" valign="top" align="center"><![endif]-->
|
|
131
|
+
<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">
|
|
132
|
+
<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
133
|
+
<tr>
|
|
134
|
+
<td align="left"></td>
|
|
135
|
+
</tr>
|
|
136
|
+
</table>
|
|
137
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
138
|
+
</div>
|
|
139
|
+
<!--[if (gte mso 9)|(IE)]></td><td width="413" valign="top" align="center"><![endif]-->
|
|
140
|
+
<div style="display: inline-block; width: 413px; vertical-align: top;" class="em-mob-width-100perc">
|
|
141
|
+
<table width="393" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
142
|
+
<tr>
|
|
143
|
+
<td align="left"></td>
|
|
144
|
+
</tr>
|
|
145
|
+
</table>
|
|
146
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
147
|
+
</div>
|
|
148
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
149
|
+
</td></tr>
|
|
150
|
+
</table><![endif]-->
|
|
151
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
152
|
+
</td>
|
|
153
|
+
</tr>
|
|
154
|
+
</table>
|
|
155
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
156
|
+
</td></tr></table>
|
|
157
|
+
<![endif]-->
|
|
158
|
+
</td>
|
|
159
|
+
</tr>
|
|
160
|
+
|
|
161
|
+
`,Ij=`
|
|
162
|
+
<style>
|
|
163
|
+
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
164
|
+
.em-mob-width-100perc {
|
|
165
|
+
width: 100% !important;
|
|
166
|
+
max-width: 100% !important;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.em-mob-width-91perc {
|
|
170
|
+
width: 91% !important;
|
|
171
|
+
max-width: 91% !important;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
</style>
|
|
175
|
+
<tr em="block" class="em-structure">
|
|
176
|
+
<td align="center">
|
|
177
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
178
|
+
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
179
|
+
<![endif]-->
|
|
180
|
+
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
181
|
+
<tr>
|
|
182
|
+
<td align="center" valign="top">
|
|
183
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
184
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
185
|
+
<table border="0" cellspacing="0" cellpadding="0">
|
|
186
|
+
<tr><td width="413" valign="top" align="center"><![endif]-->
|
|
187
|
+
<div style="display: inline-block; width: 413px; vertical-align: top;" class="em-mob-width-100perc">
|
|
188
|
+
<table width="393" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
189
|
+
<tr>
|
|
190
|
+
<td align="left"></td>
|
|
191
|
+
</tr>
|
|
192
|
+
</table>
|
|
193
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
194
|
+
</div>
|
|
195
|
+
<!--[if (gte mso 9)|(IE)]></td><td width="207" valign="top" align="center"><![endif]-->
|
|
196
|
+
<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">
|
|
197
|
+
<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
198
|
+
<tr>
|
|
199
|
+
<td align="left"></td>
|
|
200
|
+
</tr>
|
|
201
|
+
</table>
|
|
202
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
203
|
+
</div>
|
|
204
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
205
|
+
</td></tr>
|
|
206
|
+
</table><![endif]-->
|
|
207
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
208
|
+
</td>
|
|
209
|
+
</tr>
|
|
210
|
+
</table>
|
|
211
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
212
|
+
</td></tr></table>
|
|
213
|
+
<![endif]-->
|
|
214
|
+
</td>
|
|
215
|
+
</tr>
|
|
216
|
+
|
|
217
|
+
`,Tj=`
|
|
218
|
+
<style>
|
|
219
|
+
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
220
|
+
.em-mob-width-100perc {
|
|
221
|
+
width: 100% !important;
|
|
222
|
+
max-width: 100% !important;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.em-mob-width-91perc {
|
|
226
|
+
width: 91% !important;
|
|
227
|
+
max-width: 91% !important;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
</style>
|
|
231
|
+
<tr em="block" class="em-structure">
|
|
232
|
+
<td align="center">
|
|
233
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
234
|
+
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
235
|
+
<![endif]-->
|
|
236
|
+
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
237
|
+
<tr>
|
|
238
|
+
<td align="center" valign="top">
|
|
239
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
240
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
241
|
+
<table border="0" cellspacing="0" cellpadding="0">
|
|
242
|
+
<tr><td width="311" valign="top" align="center"><![endif]-->
|
|
243
|
+
<div style="display: inline-block; width: 311px; vertical-align: top;" class="em-mob-width-100perc">
|
|
244
|
+
<table width="291" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
245
|
+
<tr>
|
|
246
|
+
<td align="left"></td>
|
|
247
|
+
</tr>
|
|
248
|
+
</table>
|
|
249
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
250
|
+
</div>
|
|
251
|
+
<!--[if (gte mso 9)|(IE)]></td><td width="311" valign="top" align="center"><![endif]-->
|
|
252
|
+
<div style="display: inline-block; width: 311px; vertical-align: top;" class="em-mob-width-100perc">
|
|
253
|
+
<table width="291" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
254
|
+
<tr>
|
|
255
|
+
<td align="left"></td>
|
|
256
|
+
</tr>
|
|
257
|
+
</table>
|
|
258
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
259
|
+
</div>
|
|
260
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
261
|
+
</td></tr>
|
|
262
|
+
</table><![endif]-->
|
|
263
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
264
|
+
</td>
|
|
265
|
+
</tr>
|
|
266
|
+
</table>
|
|
267
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
268
|
+
</td></tr></table>
|
|
269
|
+
<![endif]-->
|
|
270
|
+
</td>
|
|
271
|
+
</tr>
|
|
272
|
+
|
|
273
|
+
`,Cj=`
|
|
274
|
+
<style>
|
|
275
|
+
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
276
|
+
.em-mob-width-100perc {
|
|
277
|
+
width: 100% !important;
|
|
278
|
+
max-width: 100% !important;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.em-mob-width-91perc {
|
|
282
|
+
width: 91% !important;
|
|
283
|
+
max-width: 91% !important;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
</style>
|
|
287
|
+
<tr em="block" class="em-structure">
|
|
288
|
+
<td align="center">
|
|
289
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
290
|
+
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
291
|
+
<![endif]-->
|
|
292
|
+
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
293
|
+
<tr>
|
|
294
|
+
<td align="center" valign="top">
|
|
295
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
296
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
297
|
+
<table border="0" cellspacing="0" cellpadding="0">
|
|
298
|
+
<tr><td width="207" valign="top" align="center"><![endif]-->
|
|
299
|
+
<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">
|
|
300
|
+
<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
301
|
+
<tr>
|
|
302
|
+
<td align="left"></td>
|
|
303
|
+
</tr>
|
|
304
|
+
</table>
|
|
305
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
306
|
+
</div>
|
|
307
|
+
<!--[if (gte mso 9)|(IE)]></td><td width="207" valign="top" align="center"><![endif]-->
|
|
308
|
+
<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">
|
|
309
|
+
<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
310
|
+
<tr>
|
|
311
|
+
<td align="left"></td>
|
|
312
|
+
</tr>
|
|
313
|
+
</table>
|
|
314
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
315
|
+
</div>
|
|
316
|
+
<!--[if (gte mso 9)|(IE)]></td><td width="207" valign="top" align="center"><![endif]-->
|
|
317
|
+
<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">
|
|
318
|
+
<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
319
|
+
<tr>
|
|
320
|
+
<td align="left"></td>
|
|
321
|
+
</tr>
|
|
322
|
+
</table>
|
|
323
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
324
|
+
</div>
|
|
325
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
326
|
+
</td></tr>
|
|
327
|
+
</table><![endif]-->
|
|
328
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
329
|
+
</td>
|
|
330
|
+
</tr>
|
|
331
|
+
</table>
|
|
332
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
333
|
+
</td></tr></table>
|
|
334
|
+
<![endif]-->
|
|
335
|
+
</td>
|
|
336
|
+
</tr>
|
|
337
|
+
|
|
338
|
+
`,Oj=`
|
|
339
|
+
<style>
|
|
340
|
+
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
341
|
+
.em-mob-width-100perc {
|
|
342
|
+
width: 100% !important;
|
|
343
|
+
max-width: 100% !important;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.em-mob-width-91perc {
|
|
347
|
+
width: 91% !important;
|
|
348
|
+
max-width: 91% !important;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
</style>
|
|
352
|
+
<tr em="block" class="em-structure">
|
|
353
|
+
<td align="center">
|
|
354
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
355
|
+
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
356
|
+
<![endif]-->
|
|
357
|
+
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
358
|
+
<tr>
|
|
359
|
+
<td align="center" valign="top">
|
|
360
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
361
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
362
|
+
<table border="0" cellspacing="0" cellpadding="0">
|
|
363
|
+
<tr><td width="310" valign="top" align="center"><![endif]-->
|
|
364
|
+
<div style="display: inline-block; width: 310px; vertical-align: top;" class="em-mob-width-100perc">
|
|
365
|
+
<table width="290" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
366
|
+
<tr>
|
|
367
|
+
<td align="left"></td>
|
|
368
|
+
<td width="20"> </td>
|
|
369
|
+
<td align="left"></td>
|
|
370
|
+
</tr>
|
|
371
|
+
</table>
|
|
372
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
373
|
+
</div>
|
|
374
|
+
<!--[if (gte mso 9)|(IE)]></td><td width="310" valign="top" align="center"><![endif]-->
|
|
375
|
+
<div style="display: inline-block; width: 310px; vertical-align: top;" class="em-mob-width-100perc">
|
|
376
|
+
<table width="290" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
377
|
+
<tr>
|
|
378
|
+
<td align="left"></td>
|
|
379
|
+
<td width="20"> </td>
|
|
380
|
+
<td align="left"></td>
|
|
381
|
+
</tr>
|
|
382
|
+
</table>
|
|
383
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
384
|
+
</div>
|
|
385
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
386
|
+
</td></tr>
|
|
387
|
+
</table><![endif]-->
|
|
388
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
389
|
+
</td>
|
|
390
|
+
</tr>
|
|
391
|
+
</table>
|
|
392
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
393
|
+
</td></tr></table>
|
|
394
|
+
<![endif]-->
|
|
395
|
+
</td>
|
|
396
|
+
</tr>
|
|
397
|
+
|
|
398
|
+
`,Lh=[{sizeArray:[24],name:"column-one",html:Sj},{sizeArray:[12,12],name:"column-two-50",html:Tj},{sizeArray:[8,8,8],name:"column-three",html:Cj},{sizeArray:[6,6,6,6],name:"column-four",html:Oj},{sizeArray:[8,16],name:"column-two-33",html:Pj},{sizeArray:[16,8],name:"column-two-66",html:Ij}],Fh=()=>{const e=Ss(),t=ws();return(0,R.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,R.jsx)("div",{className:"structures__list",children:(0,R.jsx)("div",{children:Lh&&Lh.map(r=>(0,R.jsx)("div",{children:(0,R.jsx)("div",{className:"structures__item",draggable:!0,onClick:n=>e(n,r.html,void 0,r.name,{id:r.name,title:r.name,type:"structure"}),onDragStart:n=>t(n,r.html,void 0,r.name,{id:r.name,title:r.name,type:"structure"}),children:(0,R.jsx)(B.ui_kit$Row,{gutter:[6,6],className:"structures__item-row",children:r.sizeArray.map((n,i)=>(0,R.jsx)(B.ui_kit$Col,{span:n,children:(0,R.jsx)("div",{className:"structures__item-col"})},r.name+i))})})},r.name))})})})};Fh.propTypes={};var Aj=`<style em="styles">
|
|
399
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
400
|
+
.em-mob-width-100perc {
|
|
401
|
+
width: 100%!important;
|
|
402
|
+
max-width: 100%!important;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.em-mob-wrap {
|
|
406
|
+
display: block!important;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.em-mob-padding_right-20 {
|
|
410
|
+
padding-right: 20px!important;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.em-mob-padding_left-20 {
|
|
414
|
+
padding-left: 20px!important;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
</style>
|
|
418
|
+
<tr em="block" class="em-structure">
|
|
419
|
+
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
420
|
+
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
421
|
+
<tr>
|
|
422
|
+
<td width="580" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
423
|
+
</tr>
|
|
424
|
+
</table>
|
|
425
|
+
</td>
|
|
426
|
+
</tr>`,Mj=`<style em="styles">
|
|
427
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
428
|
+
.em-mob-width-100perc {
|
|
429
|
+
width: 100%!important;
|
|
430
|
+
max-width: 100%!important;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.em-mob-wrap {
|
|
434
|
+
display: block!important;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.em-mob-padding_right-20 {
|
|
438
|
+
padding-right: 20px!important;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.em-mob-padding_left-20 {
|
|
442
|
+
padding-left: 20px!important;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.em-mob-height-20px {
|
|
446
|
+
height: 20px!important;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
</style>
|
|
450
|
+
<tr em="block" class="em-structure">
|
|
451
|
+
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
452
|
+
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
453
|
+
<tr>
|
|
454
|
+
<td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
455
|
+
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
456
|
+
<td width="380" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
457
|
+
</tr>
|
|
458
|
+
</table>
|
|
459
|
+
</td>
|
|
460
|
+
</tr>`,kj=`<style em="styles">
|
|
461
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
462
|
+
.em-mob-width-100perc {
|
|
463
|
+
width: 100%!important;
|
|
464
|
+
max-width: 100%!important;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.em-mob-wrap {
|
|
468
|
+
display: block!important;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.em-mob-padding_right-20 {
|
|
472
|
+
padding-right: 20px!important;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.em-mob-padding_left-20 {
|
|
476
|
+
padding-left: 20px!important;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.em-mob-height-20px {
|
|
480
|
+
height: 20px!important;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
</style>
|
|
484
|
+
<tr em="block" class="em-structure">
|
|
485
|
+
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
486
|
+
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
487
|
+
<tr>
|
|
488
|
+
<td width="380" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
489
|
+
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
490
|
+
<td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
491
|
+
</tr>
|
|
492
|
+
</table>
|
|
493
|
+
</td>
|
|
494
|
+
</tr>`,jj=`<style em="styles">
|
|
495
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
496
|
+
.em-mob-width-100perc {
|
|
497
|
+
width: 100%!important;
|
|
498
|
+
max-width: 100%!important;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.em-mob-wrap {
|
|
502
|
+
display: block!important;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.em-mob-padding_right-20 {
|
|
506
|
+
padding-right: 20px!important;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.em-mob-padding_left-20 {
|
|
510
|
+
padding-left: 20px!important;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.em-mob-height-20px {
|
|
514
|
+
height: 20px!important;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
</style>
|
|
518
|
+
<tr em="block" class="em-structure">
|
|
519
|
+
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
520
|
+
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
521
|
+
<tr>
|
|
522
|
+
<td width="280" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
523
|
+
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
524
|
+
<td width="280" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
525
|
+
</tr>
|
|
526
|
+
</table>
|
|
527
|
+
</td>
|
|
528
|
+
</tr>`,Rj=`<style em="styles">
|
|
529
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
530
|
+
.em-mob-width-100perc {
|
|
531
|
+
width: 100%!important;
|
|
532
|
+
max-width: 100%!important;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.em-mob-wrap {
|
|
536
|
+
display: block!important;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.em-mob-padding_right-20 {
|
|
540
|
+
padding-right: 20px!important;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.em-mob-padding_left-20 {
|
|
544
|
+
padding-left: 20px!important;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.em-mob-height-20px {
|
|
548
|
+
height: 20px!important;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
</style>
|
|
552
|
+
<tr em="block" class="em-structure">
|
|
553
|
+
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
554
|
+
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
555
|
+
<tr>
|
|
556
|
+
<td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
557
|
+
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
558
|
+
<td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
559
|
+
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
560
|
+
<td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
561
|
+
</tr>
|
|
562
|
+
</table>
|
|
563
|
+
</td>
|
|
564
|
+
</tr>`,Nj=`<style em="styles">
|
|
565
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
566
|
+
.em-mob-width-100perc {
|
|
567
|
+
width: 100%!important;
|
|
568
|
+
max-width: 100%!important;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.em-mob-wrap {
|
|
572
|
+
display: block!important;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.em-mob-padding_right-20 {
|
|
576
|
+
padding-right: 20px!important;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.em-mob-padding_left-20 {
|
|
580
|
+
padding-left: 20px!important;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.em-mob-height-20px {
|
|
584
|
+
height: 20px!important;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
</style>
|
|
588
|
+
<tr em="block" class="em-structure">
|
|
589
|
+
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
590
|
+
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
591
|
+
<tr>
|
|
592
|
+
<td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
593
|
+
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
594
|
+
<td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
595
|
+
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
596
|
+
<td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
597
|
+
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
598
|
+
<td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
599
|
+
</tr>
|
|
600
|
+
</table>
|
|
601
|
+
</td>
|
|
602
|
+
</tr>`,xh=[{sizeArray:[24],name:"column-one",html:Aj},{sizeArray:[12,12],name:"column-two-50",html:jj},{sizeArray:[8,8,8],name:"column-three",html:Rj},{sizeArray:[6,6,6,6],name:"column-four",html:Nj},{sizeArray:[8,16],name:"column-two-33",html:Mj},{sizeArray:[16,8],name:"column-two-66",html:kj}],Uh=()=>{const e=Ss(),t=ws();return(0,R.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,R.jsx)("div",{className:"structures__list",children:(0,R.jsx)("div",{children:xh&&xh.map(r=>(0,R.jsx)("div",{children:(0,R.jsx)("div",{className:"structures__item",draggable:!0,onClick:n=>e(n,r.html,void 0,r.name,{id:r.name,title:r.name,type:"structure"}),onDragStart:n=>t(n,r.html,void 0,r.name,{id:r.name,title:r.name,type:"structure"}),children:(0,R.jsx)(B.ui_kit$Row,{gutter:[6,6],className:"structures__item-row",children:r.sizeArray.map((n,i)=>(0,R.jsx)(B.ui_kit$Col,{span:n,children:(0,R.jsx)("div",{className:"structures__item-col"})},r.name+i))})})},r.name))})})})};Uh.propTypes={};var Dj=`<style em="styles">
|
|
603
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
604
|
+
.em-mob-width-100perc {
|
|
605
|
+
width: 100%!important;
|
|
606
|
+
max-width: 100%!important;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
</style>
|
|
610
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
611
|
+
<img src=${__emailmaker__.assetUrl("empty-image.png")} width="150" border="0" alt="" style="display: block; width: 100%; max-width: 150px;" />
|
|
612
|
+
</td></tr></table>`,Lj=`<style em="styles">
|
|
613
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
614
|
+
.em-mob-width-100perc {
|
|
615
|
+
width: 100%!important;
|
|
616
|
+
max-width: 100%!important;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
</style>
|
|
620
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
621
|
+
<img class="em-ai-img em-just-inserted" src="${__emailmaker__.assetUrl("ai-image.png")}" width="150" border="0" alt="" style="display: block; width: 100%; max-width: 150px;" />
|
|
622
|
+
</td></tr></table>`,Fj=({__:e})=>`<style em="styles">
|
|
623
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
624
|
+
.em-mob-width-100perc {
|
|
625
|
+
width: 100%!important;
|
|
626
|
+
max-width: 100%!important;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
</style>
|
|
630
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding-bottom: 10px;">
|
|
631
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>
|
|
632
|
+
</td></tr></table>`,xj=({__:e})=>`<style em="styles">
|
|
633
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
634
|
+
.em-mob-width-100perc {
|
|
635
|
+
width: 100%!important;
|
|
636
|
+
max-width: 100%!important;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
</style>
|
|
640
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding: 20px 0 10px;">
|
|
641
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 24px; line-height: 32px; color: #333333;"><strong>${e("Header text")}</strong></div>
|
|
642
|
+
</td></tr></table>`,Uj=({__:e})=>`<style em="styles">
|
|
643
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
644
|
+
.em-mob-width-100perc {
|
|
645
|
+
width: 100%!important;
|
|
646
|
+
max-width: 100%!important;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
</style>
|
|
650
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding: 10px 0;">
|
|
651
|
+
<table cellpadding="0" cellspacing="0" border="0" width="200" class="em-mob-width-100perc">
|
|
652
|
+
<tr>
|
|
653
|
+
<td align="center" valign="middle" height="41" bgcolor="#1C52DC" style="height: 41px; background-color: #1C52DC; border-radius: 5px;">
|
|
654
|
+
<a href="" target="_blank" style="display: block; font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #FFFFFF; font-size: 16px; line-height: 41px; text-decoration: none; white-space: nowrap;">
|
|
655
|
+
${e("Button")}
|
|
656
|
+
</a>
|
|
657
|
+
</td>
|
|
658
|
+
</tr>
|
|
659
|
+
</table>
|
|
660
|
+
</td></tr></table>`,Bj=({__:e})=>`<style em="styles">
|
|
661
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
662
|
+
.em-mob-width-100perc {
|
|
663
|
+
width: 100%!important;
|
|
664
|
+
max-width: 100%!important;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
</style>
|
|
668
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
669
|
+
<table class="em-element-list-ul" cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
670
|
+
<tr>
|
|
671
|
+
<td align="left" valign="top" width="20">
|
|
672
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">•</div>
|
|
673
|
+
</td>
|
|
674
|
+
<td align="left" valign="top" style="padding-bottom: 5px; padding-left: 1px;">
|
|
675
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>
|
|
676
|
+
</td>
|
|
677
|
+
</tr>
|
|
678
|
+
</table>
|
|
679
|
+
</td></tr></table>`,$j=({__:e})=>`<style em="styles">
|
|
680
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
681
|
+
.em-mob-width-100perc {
|
|
682
|
+
width: 100%!important;
|
|
683
|
+
max-width: 100%!important;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
</style>
|
|
687
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
688
|
+
<table class="em-element-list-ol" cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
689
|
+
<tr>
|
|
690
|
+
<td align="left" valign="top" width="20">
|
|
691
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">1. </div>
|
|
692
|
+
</td>
|
|
693
|
+
<td align="left" valign="top" style="padding-bottom: 5px; padding-left: 1px;">
|
|
694
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>
|
|
695
|
+
</td>
|
|
696
|
+
</tr>
|
|
697
|
+
</table>
|
|
698
|
+
</td></tr></table>`,qj=`<style em="styles">
|
|
699
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
700
|
+
.em-mob-width-100perc {
|
|
701
|
+
width: 100%!important;
|
|
702
|
+
max-width: 100%!important;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
</style>
|
|
706
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="0" style="padding: 20px 0 0; border-top: 1px solid #BFBFBF;"> </td></tr></table>`,zj=`<style em="styles">
|
|
707
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
708
|
+
.em-mob-width-100perc {
|
|
709
|
+
width: 100%!important;
|
|
710
|
+
max-width: 100%!important;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
</style>
|
|
714
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>`,Gj="https://emcdn.ru/socnets";function Hj(e){let t=String(e??"");for(;t.endsWith("/");)t=t.slice(0,-1);return t}function Vj(e){let t=String(e??"");for(;t.startsWith("/");)t=t.slice(1);return t}function fl(e){return`${Hj(Gj)}/${Vj(e)}`}var Bh={telegram:"tg",youtube:"yt",vk:"vk",yandex_zen:"yd",x:"xa",pinterest:"pi",tiktok:"tt",ok:"ok",max:"max",rutube:"rutube",linkedin:"linkedin",viber:"viber",drbl:"drbl",fig:"fig",gh:"gh",ggl:"ggl",rdt:"rdt",sptf:"sptf",twitch:"twitch",vkv:"vkv"};function $h(e,t){return fl(`${e}${t?"-negative":""}.png`)}function Wj(e){const t=String(e.buttonBgColor??"").trim();return t||(e.blockBgEnabled&&String(e.blockBgColor??"").trim()?String(e.blockBgColor).trim():"")}function Kj(e){const t=Wj(e);return t||String(e.hostCellBgForIconLuminance??"").trim()}function qh(e){const t=String(e??"").trim();if(t.endsWith("%")){const n=parseFloat(t);return Number.isNaN(n)?null:Math.min(1,Math.max(0,n/100))}const r=parseFloat(t);return Number.isNaN(r)?null:Math.min(1,Math.max(0,r))}function pl(e){const t=String(e??"").trim();if(t.endsWith("%")){const n=parseFloat(t);return Number.isNaN(n)?null:Math.min(255,Math.max(0,Math.round(n/100*255)))}const r=parseFloat(t);return Number.isNaN(r)?null:Math.min(255,Math.max(0,Math.round(r)))}function Qj(e){const t=String(e??"").trim().toLowerCase();if(!t||t==="transparent")return null;if(t.startsWith("#")){let l=t.slice(1);return/^[0-9a-f]{3}$/i.test(l)&&(l=l.split("").map(u=>u+u).join("")),/^[0-9a-f]{6}$/i.test(l)?{r:parseInt(l.slice(0,2),16),g:parseInt(l.slice(2,4),16),b:parseInt(l.slice(4,6),16),a:1}:/^[0-9a-f]{8}$/i.test(l)?{r:parseInt(l.slice(0,2),16),g:parseInt(l.slice(2,4),16),b:parseInt(l.slice(4,6),16),a:parseInt(l.slice(6,8),16)/255}:null}const r=/^rgba?\(\s*([^)]+)\)$/i.exec(t);if(!r)return null;let n=1,i=r[1];if(i.includes("/")){const l=i.split(/\s*\/\s*/);if(i=l[0].trim(),!l[1])return null;const u=qh(l[1]);if(u===null)return null;n=u}const o=i.split(/[\s,]+/).map(l=>l.trim()).filter(Boolean);if(o.length<3)return null;const a=pl(o[0]),s=pl(o[1]),c=pl(o[2]);if(a===null||s===null||c===null)return null;if(o.length>=4&&!r[1].includes("/")){const l=qh(o[3]);if(l===null)return null;n=l}return{r:a,g:s,b:c,a:n}}function ml(e){const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function Yj(e){const t=Qj(e);if(!t)return null;const r=t.a,n=u=>Math.round(u*r+255*(1-r)),i=n(t.r),o=n(t.g),a=n(t.b),s=ml(i),c=ml(o),l=ml(a);return .2126*s+.7152*c+.0722*l}function Xj(e){const t=Yj(e);return t==null?!1:t>=.6}function zh(e){return Object.fromEntries(Object.entries(Bh).map(([t,r])=>[t,$h(r,e)]))}var Un=zh(!1),Gh=zh(!0);function Jj({blockBgEnabled:e,blockBgColor:t,buttonBgColor:r}){const n=!!(e&&String(t??"").trim()),i=!!String(r??"").trim();return n||i}function Zj(e,t={}){const r=Bh[e],n=Jj(t);if(r&&n){const i=Kj(t);return fl(`${r}${i&&Xj(i)?"-negative-black":"-negative"}.png`)}return r&&!n?fl(`${r}.png`):(n?Gh:Un)[e]??Un[e]}function eR(e,t){const r=Un[e];return t==="dark"?Gh[e]??r:r}var tR=Un;function rR(){return[{platform:"vk",label:"VK",href:""},{platform:"telegram",label:"Telegram",href:""},{platform:"max",label:"Max",href:""},{platform:"vkv",label:"VK Видео",href:""},{platform:"yandex_zen",label:"Яндекс Дзен",href:""}]}var qz=["tg","yt","vk","yd","xa","ig","fb"].map(e=>$h(e,!1)),nR="https://cdn.useblocks.io/socnets";function iR(e){let t=String(e??"");for(;t.endsWith("/");)t=t.slice(0,-1);return t}function oR(e){let t=String(e??"");for(;t.startsWith("/");)t=t.slice(1);return t}function aR(e){return`${iR(nR)}/${oR(e)}`}var sR={telegram:"tg",youtube:"yt",vk:"vk",yandex_zen:"yd",x:"xa",twitter:"tw",instagram:"ig",facebook:"fb",pinterest:"pi",tiktok:"tt",ok:"ok",max:"max",rutube:"rutube",whatsapp:"whatsapp",linkedin:"linkedin",viber:"viber",apple:"apple",dis:"dis",drbl:"drbl",fig:"fig",gh:"gh",ggl:"ggl",mdm:"mdm",rdt:"rdt",sgnl:"sgnl",sc:"sc",sptf:"sptf",tmblr:"tmblr",twitch:"twitch",thrds:"thrds",msngr:"msngr",bs:"bs"};function Hh(e,t){return aR(`${e}${t?"-negative":""}.png`)}function Vh(e){return Object.fromEntries(Object.entries(sR).map(([t,r])=>[t,Hh(r,e)]))}var zz=Vh(!1),Gz=Vh(!0),Hz=["tg","yt","vk","yd","xa","ig","fb"].map(e=>Hh(e,!1)),lR=tR;function Wh(e){return String(e??"").replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}function Kh(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const r=typeof window<"u"&&window.location?.origin?window.location.origin:"";if(!r)return t;try{return new URL(t,r).href}catch{return t}}function cR(e){return e>0?`<td width="${e}"> </td>`:""}var uR={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function Qh(e){const{iconSize:t,gap:r,align:n}=uR,i=Math.max(0,Math.round(Number(r)||0)),o=e.length>1;return`<style em="styles">
|
|
715
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
716
|
+
.em-mob-width-100perc {
|
|
717
|
+
width: 100%!important;
|
|
718
|
+
max-width: 100%!important;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
</style>
|
|
722
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"><tr><td align="${n}">
|
|
723
|
+
<table border="0" cellspacing="0" cellpadding="0">
|
|
724
|
+
<tr>${e.map(a=>{const s=Kh(a.iconSrc),c=s||Kh(lR[a.platform]);if(!c)return"";const l=Wh(a.label),u=Wh(a.href||""),d=o?' draggable="true"':"",f=s?" em-custom-icon":"";return`<td em-platform="${a.platform}"${f}${d}><a href="${u}" target="_blank" draggable="false"><img src="${c}" width="${t}" height="${t}" border="0" alt="${l}" draggable="false" style="display:block;" /></a></td>`}).filter(Boolean).reduce((a,s,c)=>(c>0&&a.push(cR(i)),a.push(s),a),[]).join("")}
|
|
725
|
+
</tr>
|
|
726
|
+
</table>
|
|
727
|
+
</td></tr></table>`}var dR=Qh(rR()),fR=({__:e})=>`<style em="styles">
|
|
728
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
729
|
+
.em-mob-width-100perc {
|
|
730
|
+
width: 100%!important;
|
|
731
|
+
max-width: 100%!important;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
</style>
|
|
735
|
+
<table cellpadding="0" cellspacing="0" width="100%" class="em-mob-width-100perc em-element-custom-table" em="atom" style="border: 1px solid #b9b1b1;" align="center">
|
|
736
|
+
<tr>
|
|
737
|
+
<td align="center" valign="top" style="border: 1px solid #b9b1b1;">
|
|
738
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Column")} 1</div>
|
|
739
|
+
</td>
|
|
740
|
+
<td align="center" valign="top" style="border: 1px solid #b9b1b1;">
|
|
741
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Column")} 2</div>
|
|
742
|
+
</td>
|
|
743
|
+
<td align="center" valign="top" style="border: 1px solid #b9b1b1;">
|
|
744
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Column")} 3</div>
|
|
745
|
+
</td>
|
|
746
|
+
</tr>
|
|
747
|
+
</table>`,pR="https://cdt3.emcdn.ru/rndt",Yh=new Date(+new Date+432e6).toISOString(),Xh=-new Date().getTimezoneOffset()/60,mR=e=>`${pR}?locale=${e.replace("_","-")}&bg=FFFFFF&tp=false&color1=000000&color2=959595&size1=72&size2=28&font1=roboto&font2=roboto&border=10&delimiter=:&spacing=10&time=${Yh}&timezone=${Xh}&frames=20`,hR=e=>`<style em="styles">
|
|
748
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
749
|
+
.em-mob-width-100perc {
|
|
750
|
+
width: 100%!important;
|
|
751
|
+
max-width: 100%!important;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
</style>
|
|
755
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td align="center"><img class="em-countdown" em-cd-settings="locale=${e.replace("_","-")}&bg=FFFFFF&tp=false&color1=000000&color2=959595&size1=72&size2=28&font1=roboto&font2=roboto&border=10&delimiter=:&spacing=10&time=${Yh}&timezone=${Xh}&frames=20" src="${mR(e)}" border="0" alt="" style="display: block;" /></td></tr></table>`,gR=`<style em="styles">
|
|
756
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
757
|
+
.em-mob-width-100perc {
|
|
758
|
+
width: 100%!important;
|
|
759
|
+
max-width: 100%!important;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
</style>
|
|
763
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
764
|
+
<img class="em-video" src="${__emailmaker__.assetUrl("video.png")}" width="150" border="0" alt="" style="display: inline-block; width: 100%; max-width: 150px;" />
|
|
765
|
+
</td></tr></table>`,yR=({__:e})=>`<style em="styles">
|
|
766
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
767
|
+
.em-mob-width-100perc {
|
|
768
|
+
width: 100%!important;
|
|
769
|
+
max-width: 100%!important;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
</style>
|
|
773
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
774
|
+
<amp-carousel width="800" height="600" layout="responsive" type="slides" controls>
|
|
775
|
+
<amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_JoH0f3E.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>
|
|
776
|
+
<amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_aJAY1Xz.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>
|
|
777
|
+
<amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_OQEyMEF.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>
|
|
778
|
+
</amp-carousel>
|
|
779
|
+
</td></tr></table>`,_R=({__:e})=>`<style em="styles">
|
|
780
|
+
amp-accordion > section > * {
|
|
781
|
+
background: none !important;
|
|
782
|
+
padding: 0 !important;
|
|
783
|
+
border: none !important;
|
|
784
|
+
overflow: visible !important;
|
|
785
|
+
}
|
|
786
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
787
|
+
.em-mob-width-100perc {
|
|
788
|
+
width: 100%!important;
|
|
789
|
+
max-width: 100%!important;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
</style>
|
|
793
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
794
|
+
<amp-accordion animate expand-single-section>
|
|
795
|
+
<section>
|
|
796
|
+
<header>
|
|
797
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
798
|
+
<tr>
|
|
799
|
+
<td style="padding: 10px 0; border-bottom: 1px solid #CCCCCC;">
|
|
800
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;"><strong>${e("Section title")}</strong></div>
|
|
801
|
+
</td>
|
|
802
|
+
</tr>
|
|
803
|
+
</table>
|
|
804
|
+
</header>
|
|
805
|
+
<div>
|
|
806
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom">
|
|
807
|
+
<tr>
|
|
808
|
+
<td style="padding: 10px 0;">
|
|
809
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>
|
|
810
|
+
</td>
|
|
811
|
+
</tr>
|
|
812
|
+
</table>
|
|
813
|
+
</div>
|
|
814
|
+
</section>
|
|
815
|
+
</amp-accordion>
|
|
816
|
+
</td></tr></table>`;function Jh(e){return e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?(?:script|embed|object|frameset|frame|iframe|applet|meta)[^>]*>/gi,""),e=e.replace(/ on\w+="[^"]*"/g,""),e=e.replace(/ on\w+='[^']*'/g,""),e}var ee=b.default.forwardRef(({icon:e,...t},r)=>{const n=st(),i=(0,b.useMemo)(()=>{if(!n?.icons)return;const o={};for(const[a,s]of Object.entries(n.icons))typeof s=="string"&&(o[a]=Jh(s));return Object.keys(o).length>0?o:void 0},[n?.icons]);return(0,R.jsx)(B.ui_kit$EmIcons,{ref:r,icon:e,configIcons:i,strokeWidth:n?.iconStrokeWidth,...t})});ee.displayName="EmIcons";function vR(e){const{isPlanLocked:t,trialEnabled:r,canStartTrial:n}=e;return!t||r||!n?"upsell":"trial"}var hl=Aa("config/changeConfigModeWithCodeCheck",async(e,{dispatch:t,getState:r})=>{const n=C.getContainer({getState:r}),i=n?.getInstance(C.CONFIG_SOURCE_ID);i?.setMode(e),ps(n)||t(zt.endpoints.editMe.initiate({email_builder_config:e}));const o=i?.get()?.codeEnabled;return n&&o===!1&&hh(n).isCodeMode&&tl(n,!1),e});function bR(e,t,r){const n=e.data?.status,i=typeof e.status=="number"?e.status:void 0;return n===403||i===403?{kind:"failure",userMessage:e.message&&String(e.message).trim()||t}:{kind:"success",title:e.code&&String(e.code).trim()||r,description:e.message&&String(e.message).trim()||void 0}}async function ER(e,t,r,n,i,o,a){const s=await t(e),c=r("Could not activate the trial. Please try again later or contact support.");if("error"in s&&s.error){const l=s.error,u="data"in l?l.data:void 0;return a((u&&typeof u=="object"&&u!==null&&"message"in u?String(u.message):void 0)||c),!1}if("data"in s&&s.data&&typeof s.data=="object"){const l=bR(s.data,c,r("Trial period activated."));return l.kind==="failure"?(a(l.userMessage),!1):(n(hl("pro")),await i(""),l.description?o({title:l.title,description:l.description}):o(l.title),!0)}return n(hl("pro")),await i(""),o(r("Trial period activated.")),!0}var wR="https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,""),gl="wp-json/limits/v1",SR="wp-json/subscription/v2",yl=Ie({reducerPath:"limitsApi",baseQuery:Fe({baseUrl:wR}),tagTypes:["LimitsStats","LimitsWarnings","SubscriptionMe"],endpoints:e=>({getLimitsStats:e.query({query:()=>({url:`${gl}/stats`,method:"GET"}),providesTags:["LimitsStats"]}),getLimitsStatsByType:e.query({query:t=>({url:`${gl}/stats/${t}`,method:"GET"}),providesTags:(t,r,n)=>[{type:"LimitsStats",id:n}]}),getLimitsWarnings:e.query({query:()=>({url:`${gl}/warnings`,method:"GET"}),providesTags:["LimitsWarnings"]}),getSubscriptionMeV2:e.query({query:()=>({url:`${SR}/me`,method:"GET"}),providesTags:["SubscriptionMe"]}),invalidatePlanCache:e.mutation({queryFn:async(t,r)=>Le(await Ze(r).billing.planInvalidateCreate())})})}),{useGetLimitsStatsQuery:Vz,useLazyGetLimitsStatsQuery:Wz,useGetLimitsStatsByTypeQuery:Kz,useLazyGetLimitsStatsByTypeQuery:PR,useGetLimitsWarningsQuery:Qz,useLazyGetLimitsWarningsQuery:Yz,useGetSubscriptionMeV2Query:IR,useLazyGetSubscriptionMeV2Query:Xz,useInvalidatePlanCacheMutation:TR}=yl,Bn="Integrations",So="Webhook",Po="TestRecipients",_l="Storage",Zh="Plan",ht=(e,t)=>{const r=Le(e);return"error"in r?{error:r.error}:{data:t(r.data)}},vl=Ie({reducerPath:"projectSettingsV2Api",tagTypes:[Bn,So,Po,_l,Zh],baseQuery:Fe({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({getProjectPlan:e.query({async queryFn(t,r,n,i){const o=await rT(C.getContainer(r),String(t));if(o)return{data:o};const a=await i(`/projects/${t}/plan`);return a.error?{error:a.error}:{data:a.data}},providesTags:(t,r,n)=>[{type:Zh,id:String(n)}]}),getProjectIntegrations:e.query({async queryFn(t,r){return ht(await Oe(C.getContainer(r)).projects.integrationsList({id:String(t)}),n=>Object.fromEntries((n?.items||[]).map(i=>[i.provider,i])))},providesTags:(t,r,n)=>[{type:Bn,id:String(n)}]}),getIntegrationCredentials:e.query({async queryFn({projectId:t,provider:r},n){return ht(await Oe(C.getContainer(n)).projects.integrationsDetail({id:String(t),provider:r,reveal:!0}),i=>i?.settings||{})},keepUnusedDataFor:0}),putProjectIntegration:e.mutation({async queryFn({projectId:t,provider:r,settings:n},i){return ht(await Oe(C.getContainer(i)).projects.integrationsUpdate({id:String(t),provider:r},{settings:n}),o=>o)},invalidatesTags:(t,r,{projectId:n})=>[{type:Bn,id:String(n)}]}),deleteProjectIntegration:e.mutation({async queryFn({projectId:t,provider:r},n){return ht(await Oe(C.getContainer(n)).projects.integrationsDelete({id:String(t),provider:r}),()=>{})},invalidatesTags:(t,r,{projectId:n})=>[{type:Bn,id:String(n)}]}),getProjectWebhook:e.query({async queryFn(t,r){return ht(await Oe(C.getContainer(r)).projects.webhookList({id:String(t)}),n=>n?.url||"")},providesTags:(t,r,n)=>[{type:So,id:String(n)}]}),putProjectWebhook:e.mutation({async queryFn({projectId:t,url:r},n){return ht(await Oe(C.getContainer(n)).projects.webhookUpdate({id:String(t)},{url:r}),i=>({url:i?.url||""}))},invalidatesTags:(t,r,{projectId:n})=>[{type:So,id:String(n)}]}),getProjectStorage:e.query({async queryFn(t,r){return ht(await Oe(C.getContainer(r)).projects.storageList({id:String(t)}),n=>n)},providesTags:(t,r,n)=>[{type:_l,id:String(n)}]}),putProjectSettings:e.mutation({async queryFn({projectId:t,body:r},n){return ht(await Oe(C.getContainer(n)).projects.settingsUpdate({id:String(t)},r),i=>i)},invalidatesTags:(t,r,{projectId:n})=>[{type:Bn,id:String(n)},{type:So,id:String(n)},{type:Po,id:String(n)},{type:_l,id:String(n)}]}),getProjectTestRecipients:e.query({async queryFn(t,r){return ht(await Oe(C.getContainer(r)).projects.testRecipientsList({id:String(t)}),n=>n?.emails||[])},providesTags:(t,r,n)=>[{type:Po,id:String(n)}]}),putProjectTestRecipients:e.mutation({async queryFn({projectId:t,emails:r},n){return ht(await Oe(C.getContainer(n)).projects.testRecipientsUpdate({id:String(t)},{emails:r}),i=>({emails:i?.emails||[]}))},invalidatesTags:(t,r,{projectId:n})=>[{type:Po,id:String(n)}]})})}),{useGetProjectPlanQuery:bl,useLazyGetProjectPlanQuery:CR,useGetProjectStorageQuery:Jz,usePutProjectSettingsMutation:Zz,useGetProjectIntegrationsQuery:OR,useLazyGetIntegrationCredentialsQuery:AR,usePutProjectIntegrationMutation:eG,useDeleteProjectIntegrationMutation:tG,useGetProjectWebhookQuery:MR,usePutProjectWebhookMutation:rG,useGetProjectTestRecipientsQuery:kR,usePutProjectTestRecipientsMutation:jR}=vl;function RR(){const{__:e}=he(),t=ot(),r=wh(),{success:n,notify:i}=Gt(),o=mt(),[a]=Nm(),[s,{isLoading:c}]=bM(),[l]=TR(),u=(0,b.useCallback)(g=>{i({title:g,type:"error"})},[i]),d=(0,b.useCallback)(async()=>{const g=r.get(Ni.em_token);if(!g)return u(e("Sign in to your account to activate the trial period.")),!1;try{const h=await ER(g,s,e,t,a,n,u);if(h){await l();const E=Date.now();a("").then(S=>{(S?.startedTimeStamp??0)<E&&a("")}),t(Fr.util.invalidateTags(["project"])),t(vl.util.invalidateTags(["Plan"])),t(yl.util.invalidateTags(["SubscriptionMe"])),o({event:"change",action:"activate_trial"})}return h}catch(h){return u(h?.data?.message||e("Could not activate the trial. Please try again later or contact support.")),!1}},[e,s,r,t,a,l,u,n,o]),[f,m]=(0,b.useState)(!1);return{activate:(0,b.useCallback)(async()=>{m(!0);try{return await d()}finally{m(!1)}},[d]),isActivating:c||f}}function NR(e){const t=!!e?.nativeId,{data:r,isSuccess:n,isError:i,isFetching:o,refetch:a}=IR(void 0,{skip:!t||!0}),s=(0,b.useCallback)(()=>{i&&a()},[i,a]);let c;return!t||e?.trial_enabled?c=e?.trial_enabled?"taken":"not-taken":o||!n&&!i?c="pending":n?c=Cm(r?.is_get_trial)?"taken":"not-taken":c="unknown",{status:c,retry:s}}var DR=({open:e,sideOnOk:t,onCancel:r,initialSlide:n=0})=>{const{__:i}=he(),o=Ua(),[a,s]=(0,b.useState)(n),c=(0,b.useRef)(null),l=mt(),u=()=>{t&&t(),o("/billing"),r(!1)};(0,b.useEffect)(()=>{e&&c.current&&(c.current.goTo(n,!0),s(n))},[e,n]);const d=(0,b.useMemo)(()=>[{image:i("https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png"),backgroundColor:"var(--em-blue-2)",title:i("More editing features"),description:i("Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.")},{image:i("https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png"),backgroundColor:"var(--em-purple-2)",title:i("Work with the HTML code"),description:i("Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!")},{image:i("https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png"),backgroundColor:"var(--em-cyan-2)",title:i("AI image generation"),description:i("Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.")},{image:i("https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png"),backgroundColor:"var(--em-green-2)",title:i("Stock photos and GIFs"),description:i("Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.")},{image:i("https://cdn.useblocks.io/1351/241017_18_NDYloAO.png"),backgroundColor:"var(--em-magenta-2)",title:i("Version history"),description:i("Check who and when made changes to the email template and, if necessary, restore one of the previous versions.")},{image:i("https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png"),backgroundColor:"var(--em-red-2)",title:i("Image editor"),description:i("Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.")},{image:i("https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png"),backgroundColor:"var(--em-orange-2)",title:i("Email optimization"),description:i("Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.")},{image:i("https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png"),backgroundColor:"var(--em-volcano-2)",title:i("Team collaboration"),description:i("Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.")},{image:i("https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png"),backgroundColor:"var(--em-geekblue-2)",title:i("Email testing"),description:i("Check how your email appears across various devices and email clients.")},{image:i("https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png"),backgroundColor:"var(--em-geekblue-2)",title:i("AI assistant"),description:i("Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!")}],[i]);return(0,b.useEffect)(()=>{if(e&&c.current){c.current.goTo(n,!0),s(n);const f=d[n];l({event:"open_modal",action:"open_premium-features_modal",modal_id:"premium-features",offer_id:f.title})}},[e,d,n,l]),(0,R.jsxs)(B.ui_kit$Modal,{open:e,footer:null,onCancel:r,closable:!1,className:"premium-features-modal",classNames:{mask:"premium-features-modal-mask"},styles:{mask:{background:"rgba(0, 0, 0, 0.65)"}},width:1100,style:{maxWidth:"80%"},children:[(0,R.jsx)(B.ui_kit$Carousel,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:"carousel-slider",draggable:!0,autoplaySpeed:5e3,initialSlide:a,ref:c,children:d.map((f,m)=>(0,R.jsx)("div",{children:(0,R.jsxs)("div",{className:"carousel-slide",style:{background:`${f.backgroundColor}`},children:[(0,R.jsx)("div",{className:"slide-item-image",children:(0,R.jsx)("img",{src:f.image,alt:`slide-${m}`})}),(0,R.jsxs)("div",{className:"slide-item-content",children:[(0,R.jsx)("h3",{className:"slide-title",children:f.title}),(0,R.jsx)("p",{className:"slide-description",children:f.description})]})]})},m))}),(0,R.jsx)("div",{className:"modal-subtitle",children:i("This and other features are available for you on a higher plan.")}),(0,R.jsxs)("div",{className:"modal-buttons",children:[(0,R.jsx)(B.ui_kit$Button,{size:"large",onClick:()=>r(!1),children:i("Cancel")}),(0,R.jsx)(B.ui_kit$Button,{type:"primary",size:"large",onClick:u,style:{padding:"0 30px"},children:i("Select plan")})]})]})},LR=(0,R.jsx)(ee,{icon:"CheckCircleVerified",component:B.icons$CheckCircleVerified,className:"trial-suggest-modal__feature-icon"}),FR=["Export to HTML, AMP, PDF and PNG","Code editing and version history","AI assistant and AI image generation","Stock photos, GIFs and icons, plus the image editor","Email checks and teamwork"],eg=["https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png","https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png","https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png","https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png","https://cdn.useblocks.io/1351/241017_18_NDYloAO.png","https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png","https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png","https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png","https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png","https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png"],xR=5e3,UR=({open:e,onCancel:t,onConfirm:r,loading:n=!1})=>{const{__:i}=he(),[o,a]=(0,b.useState)(0),s=(0,b.useMemo)(()=>eg.map(c=>({backgroundImage:`url(${i(c)})`})),[i]);return(0,b.useEffect)(()=>{if(!e){a(0);return}const c=setInterval(()=>a(l=>(l+1)%eg.length),xR);return()=>clearInterval(c)},[e]),(0,R.jsx)(B.ui_kit$Modal,{open:e,onCancel:t,footer:null,closable:!1,centered:!0,width:760,className:"trial-suggest-modal",children:(0,R.jsxs)("div",{className:"trial-suggest-modal__layout",children:[(0,R.jsx)("div",{className:"trial-suggest-modal__gallery",children:(0,R.jsx)("div",{className:"trial-suggest-modal__slide-image",style:s[o]})}),(0,R.jsxs)("div",{className:"trial-suggest-modal__content",children:[(0,R.jsxs)("span",{className:"trial-suggest-modal__badge",children:[i("14 days free")," "]}),(0,R.jsxs)("h2",{className:"trial-suggest-modal__title",children:[i("Try every editor feature — free")," "]}),(0,R.jsx)("p",{className:"trial-suggest-modal__intro",children:i("Turn on a 14-day trial and the whole editor opens up:")}),(0,R.jsx)("ul",{className:"trial-suggest-modal__features",children:FR.map(c=>(0,R.jsxs)("li",{children:[LR,(0,R.jsx)("span",{children:i(c)})]},c))}),(0,R.jsxs)("p",{className:"trial-suggest-modal__promise",children:[(0,R.jsx)(ee,{icon:"ShieldTickIcon",component:B.icons$ShieldTickIcon,className:"trial-suggest-modal__promise-icon"}),(0,R.jsx)("span",{children:i("No card required: we ask for no payment or personal details.")})]}),(0,R.jsx)("p",{className:"trial-suggest-modal__note",children:i("When the trial ends, the service switches to the free plan.")}),(0,R.jsxs)("div",{className:"trial-suggest-modal__buttons",children:[(0,R.jsxs)(B.ui_kit$Button,{type:"text",size:"large",onClick:t,className:"trial-suggest-modal__decline",children:[i("Not now")," "]}),(0,R.jsxs)(B.ui_kit$Button,{type:"primary",size:"large",loading:n,onClick:r,children:[i("Start the trial")," "]})]})]})]})})},tg=({open:e,onCancel:t,initialSlide:r=0,onTrialActivated:n,sideOnOk:i})=>{const o=ur(),a=Ve(),s=mt(),{activate:c,isActivating:l}=RR(),{status:u,retry:d}=NR(o),f=ol(a,{isPlugin:!0}),m=fj(a,o),g=vR({isPlanLocked:f,trialEnabled:u!=="not-taken",canStartTrial:m}),[h,E]=(0,b.useState)(g),[S,T]=(0,b.useState)(e);e!==S&&(T(e),e&&E(g));const w=(0,b.useRef)(d);(0,b.useEffect)(()=>{w.current=d}),(0,b.useEffect)(()=>{e&&w.current()},[e]);const y=h==="trial";(0,b.useEffect)(()=>{!e||!y||s({event:"open_modal",action:"open_trial-suggest_modal",modal_id:"trial-suggest"})},[e,y,s]);const I=(0,b.useCallback)(()=>{(async()=>{if(await c()){(n??t)();return}t()})()},[c,t,n]);return y?(0,R.jsx)(UR,{open:e,onCancel:t,onConfirm:I,loading:l}):(0,R.jsx)(DR,{open:e,onCancel:t,initialSlide:r,sideOnOk:i})},BR=["export_platforms","export_html","export_amp","export_webhook","export_pdf","export_png","element_image","element_ai_image","element_text","element_heading","element_button","element_spacer","element_lists","element_divider","element_social","element_table","element_timer","element_video","element_amp_carousel","element_amp_accordion","element_amp_form","block_save","block_visibility","block_border","block_radius","block_shadow","block_to_image","theme_editing","preheader_editing","desktop_mobile_toggle","undo_redo","typograph","variables","google_fonts","code_editor","version_history","preview_service","template_import","code_minify","mobile_props","discussion","utm_editor","stock_photo","stock_gif","stock_icons","image_editor"],rg={export_platforms:1,export_html:1,export_amp:1,export_webhook:1,export_pdf:1,export_png:1,element_image:1,element_ai_image:2,element_text:1,element_heading:1,element_button:1,element_spacer:1,element_lists:1,element_divider:1,element_social:1,element_table:1,element_timer:1,element_video:1,element_amp_carousel:1,element_amp_accordion:1,element_amp_form:1,block_save:1,block_visibility:1,block_border:1,block_radius:1,block_shadow:1,block_to_image:1,theme_editing:1,preheader_editing:1,desktop_mobile_toggle:1,undo_redo:1,typograph:1,variables:1,google_fonts:1,code_editor:1,version_history:4,preview_service:1,template_import:1,code_minify:1,mobile_props:1,discussion:7,utm_editor:1,stock_photo:3,stock_gif:3,stock_icons:3,image_editor:5};function $R(e){return BR.includes(e)}function ng(e){const{featureKey:t,features:r,isPlugin:n}=e,i=r!==void 0;return n?{isLocked:!1,isPlanDataReady:i}:t==null||!$R(t)?{isLocked:!1,isPlanDataReady:i}:{isLocked:xS(r,t)!==!0,isPlanDataReady:i}}function ig(){const e=Ve(),t=e?.id,{data:r}=bl(t,{skip:!0});return ol(e,{isPlugin:!0}),r?.features}function qR(){const e=ig();return(0,b.useCallback)(t=>ng({featureKey:t,features:e,isPlugin:!0}).isLocked,[e])}function zR(e){const t=ig();return(0,b.useMemo)(()=>{const r=ng({featureKey:e,features:t,isPlugin:!0});return{isLocked:r.isLocked,state:r.isLocked?{state:"locked_by_plan"}:{state:"allowed"},isPlanDataReady:r.isPlanDataReady}},[e,t])}var GR={image:"element_image","ai-image":"element_ai_image",text:"element_text",header:"element_heading",button:"element_button",spacer:"element_spacer","list-ul":"element_lists","list-ol":"element_lists",divider:"element_divider",social:"element_social",table:"element_table",countdown:"element_timer",video:"element_video","amp-carousel":"element_amp_carousel","amp-accordion":"element_amp_accordion","amp-form":"element_amp_form"};function og(e){return GR[e]??null}var ag=e=>Number(e)||void 0,HR={colors:[],fonts:[],socials:[]},El=(e="entity")=>{const t=typeof globalThis<"u"?globalThis.crypto:void 0;if(t?.randomUUID)return t.randomUUID();const r=typeof performance<"u"?performance.now().toString(36).replace(".",""):String(Date.now());return`${e}-${Date.now().toString(36)}-${r}`},VR=()=>El("soc"),WR=/^[a-z][a-z0-9+.-]*:/i,sg=e=>{const t=String(e??"").trim();return t?WR.test(t)?t:`https://${t}`:""},KR=e=>{const t=sg(e);if(!t)return!1;try{const r=new URL(t);return r.protocol==="https:"&&!!r.hostname}catch{return!1}},QR=e=>[...e].filter(t=>t.url.trim()!=="").sort((t,r)=>t.order-r.order),YR=e=>QR(e).map(t=>({platform:t.icon_key,href:t.url,label:t.name,...t.icon_url?{iconSrc:t.icon_url}:{}})),XR=/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,JR=/^#?([0-9a-f]{6})$/i,wl=e=>{if(!e)return null;const t=String(e).trim().toLowerCase(),r=JR.exec(t);if(r)return`#${r[1]}`;const n=XR.exec(t);if(n){const[,i,o,a]=n;return`#${i}${i}${o}${o}${a}${a}`}return null},lg=()=>El("bc"),ZR=/\.(woff2|woff|ttf|otf)$/i,eN=e=>{const t=ZR.exec(e.trim().toLowerCase());return t?`.${t[1]}`:null},tN={".woff":"application/x-font-woff",".woff2":"application/font-woff2",".ttf":"font/sfnt",".otf":"font/sfnt"},rN={".woff":["application/x-font-woff","font/woff","application/font-woff"],".woff2":["application/font-woff2","font/woff2"],".ttf":["font/sfnt","application/font-sfnt","application/x-font-ttf","font/ttf","application/x-font-truetype"],".otf":["font/sfnt","application/font-sfnt","application/vnd.ms-opentype","application/x-font-opentype","font/otf","font/opentype"]},nN=new Set(["","application/octet-stream","binary/octet-stream"]),iN=e=>{const t=eN(e.name);if(!t)return e;const r=e.type.trim().toLowerCase();return rN[t].includes(r)||!nN.has(r)?e:new File([e],e.name,{type:tN[t],lastModified:e.lastModified})},oN=()=>El("fnt"),aN=e=>e.family?.trim()||e.name.trim(),sN=e=>{const t=new Set;return e.filter(r=>r.source_url?.trim()).map(r=>({family:r.family?.trim()||r.name.trim(),source_url:r.source_url?.trim()??"",weight:r.weight?.trim()||"400",style:r.style??"normal",stylesheet:Sl(r),category:r.category})).filter(r=>{const n=`${r.family.toLowerCase()}/${r.weight}/${r.style}`;return t.has(n)?!1:(t.add(n),!0)})},lN=(e,t={})=>{const r=t.srcOverride?.trim()||e.source_url?.trim();if(!r||!t.srcOverride&&Sl(e)||t.srcOverride&&mn(r))return null;const n=t.familyOverride?.trim()||aN(e),i=e.weight?.trim()||"400",o=e.style??"normal";return`@font-face{font-family:${JSON.stringify(n)};src:url(${JSON.stringify(r)});font-weight:${i};font-style:${o};font-display:swap;}`},cN=e=>e.source_kind?e.source_kind:mn(e.source_url)?"google_stylesheet":e.file_name?.trim()?"uploaded":"remote_file",Sl=e=>e.source_kind?e.source_kind==="google_stylesheet"||e.source_kind==="remote_stylesheet":mn(e.source_url),cg="data-em-project-fonts-face",ug="data-em-project-font-link",uN=e=>{const t=e.filter(r=>Sl(r)).map(r=>r.source_url?.trim()??"").filter(Boolean);return[...new Set(t)]},dN=e=>e.map(t=>lN(t)).filter(t=>!!t).join(""),fN=(e,t=document)=>{const r=dN(e),{head:n}=t;let i=n.querySelector(`style[${cg}]`);if(!r){i?.remove();return}i||(i=t.createElement("style"),i.setAttribute(cg,""),n.appendChild(i)),i.textContent=r},pN=(e,t=document)=>{const r=new Set(uN(e)),{head:n}=t;n.querySelectorAll(`link[${ug}]`).forEach(i=>{const o=i.getAttribute("href")??"";r.has(o)?r.delete(o):i.remove()}),r.forEach(i=>{const o=t.createElement("link");o.setAttribute("rel","stylesheet"),o.setAttribute("href",i),o.setAttribute(ug,""),n.appendChild(o)})},mN=(e,t=document)=>{fN(e,t),pN(e,t)},hN=new Set(["normal","italic","oblique"]),gN=new Set(["sans-serif","serif"]),nG="[emailmaker] projectStyles:",gt=e=>{},Ye=e=>typeof e=="string"?e.trim():"",dg=e=>!e||e.startsWith("//")?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")?!0:e.toLowerCase().startsWith("https://"),yN=e=>{const t=typeof window<"u"?window.location?.href:void 0;if(!t||/^https:/i.test(e))return e;try{return new URL(e,t).href}catch{return e}},_N=e=>mn(e)?"google_stylesheet":(e.split(/[?#]/)[0]??"").toLowerCase().endsWith(".css")?"remote_stylesheet":"remote_file",fg=(e,t,r)=>e.length<=t?e:(gt(`${r} list is capped at ${t} entries, ${e.length-t} dropped`),e.slice(0,t)),vN=(e,t)=>{const r=wl(e?.hex);if(!r){gt(`colors[${t}] skipped: "${String(e?.hex)}" is not a hex color`);return}return{id:Ye(e.id)||lg(),name:Ye(e.name),hex:r,order:0}},bN=(e,t)=>{const r=Ye(e).toLowerCase();if(!r||gN.has(r))return r||void 0;gt(`fonts[${t}]: category must be sans-serif or serif, got "${r}" — sans-serif used`)},EN=(e,t)=>{const r=Ye(e?.family),n=Ye(e?.source_url);if(!r){gt(`fonts[${t}] skipped: family is required`);return}if(!n){gt(`fonts[${t}] skipped: source_url is required`);return}if(!dg(n)){gt(`fonts[${t}] skipped: source_url must be https or relative, got "${n}"`);return}const i=Ye(e.style),o=yN(n);return{id:Ye(e.id)||oN(),name:Ye(e.name)||r,family:r,source_url:o,source_kind:_N(o),weight:Ye(e.weight)||"400",style:hN.has(i)?i:"normal",category:bN(e.category,t),order:0}},wN=(e,t)=>{const r=sg(e?.url);if(!r||!KR(r)){gt(`socials[${t}] skipped: url must be https, got "${String(e?.url)}"`);return}const n=Ye(e.icon_key),i=Ye(e.icon_url);let o;if(i&&dg(i)?o=i:i&>(`socials[${t}]: icon_url must be https or relative, got "${i}" — icon dropped`),!n&&!o){gt(`socials[${t}] skipped: icon_key or icon_url is required`);return}return{id:Ye(e.id)||VR(),name:Ye(e.name),url:r,icon_key:n,...o?{icon_url:o}:{},enabled:!0,order:0}},SN=e=>{const t=new Set;return e.filter((r,n)=>{if(!r)return!1;const i=`${r.family?.toLowerCase()}/${r.weight}/${r.style}`;return t.has(i)?(gt(`fonts[${n}] skipped: duplicate face ${r.family} ${r.weight} ${r.style}`),!1):(t.add(i),!0)})},Pl=e=>e.map((t,r)=>({...t,order:r})),pg=e=>({colors:Pl(fg(e?.colors??[],32,"colors").map(vN).filter(t=>t!==void 0)),fonts:Pl(SN((e?.fonts??[]).map(EN))),socials:Pl(fg(e?.socials??[],20,"socials").map(wN).filter(t=>t!==void 0))}),mg=["vk","telegram","youtube","tiktok","ok","pinterest","max","rutube","yandex_zen","vkv","drbl","fig","gh","ggl","rdt","sptf","twitch"],PN=["telegram","whatsapp","instagram","facebook","youtube","tiktok","x","linkedin","pinterest","viber","apple","dis","drbl","fig","ggl","mdm","rdt","sgnl","sc","sptf","tmblr","twitch","thrds","msngr","bs"],IN=[{id:"vk",labelMsgid:"VK",brands:["em"]},{id:"telegram",labelMsgid:"Telegram",brands:["em","blocks"]},{id:"youtube",labelMsgid:"YouTube",brands:["em","blocks"]},{id:"tiktok",labelMsgid:"TikTok",brands:["em","blocks"]},{id:"ok",labelMsgid:"Одноклассники",brands:["em"]},{id:"pinterest",labelMsgid:"Pinterest",brands:["em","blocks"]},{id:"max",labelMsgid:"Макс",brands:["em"]},{id:"rutube",labelMsgid:"RuTube",brands:["em"]},{id:"yandex_zen",labelMsgid:"Яндекс Дзен",brands:["em"]},{id:"whatsapp",labelMsgid:"WhatsApp",brands:["blocks"]},{id:"instagram",labelMsgid:"Instagram",brands:["blocks"]},{id:"facebook",labelMsgid:"Facebook",brands:["blocks"]},{id:"x",labelMsgid:"X (Twitter)",brands:["blocks"]},{id:"linkedin",labelMsgid:"LinkedIn",brands:["blocks"]},{id:"viber",labelMsgid:"Viber",brands:["blocks"]},{id:"apple",labelMsgid:"Apple",brands:["blocks"]},{id:"dis",labelMsgid:"Discord",brands:["blocks"]},{id:"drbl",labelMsgid:"Dribbble",brands:["blocks","em"]},{id:"fig",labelMsgid:"Figma",brands:["blocks","em"]},{id:"gh",labelMsgid:"GitHub",brands:["blocks","em"]},{id:"ggl",labelMsgid:"Google",brands:["blocks","em"]},{id:"mdm",labelMsgid:"Medium",brands:["blocks"]},{id:"rdt",labelMsgid:"Reddit",brands:["blocks","em"]},{id:"sgnl",labelMsgid:"Signal",brands:["blocks"]},{id:"sc",labelMsgid:"Snapchat",brands:["blocks"]},{id:"sptf",labelMsgid:"Spotify",brands:["blocks","em"]},{id:"tmblr",labelMsgid:"Tumblr",brands:["blocks"]},{id:"twitch",labelMsgid:"Twitch",brands:["blocks","em"]},{id:"thrds",labelMsgid:"Threads",brands:["blocks"]},{id:"msngr",labelMsgid:"Messenger",brands:["blocks"]},{id:"bs",labelMsgid:"Bluesky",brands:["blocks"]},{id:"vkv",labelMsgid:"VK Видео",brands:["em"]}];function TN(e){const t=e==="em"?mg:PN,r=new Set(t),n=Object.fromEntries(IN.filter(i=>i.brands.includes(e)&&r.has(i.id)).map(i=>[i.id,i]));return t.map(i=>n[i]).filter(i=>!!i)}var CN={tg:"telegram",yt:"youtube",yd:"yandex_zen",tt:"tiktok",pi:"pinterest",ig:"instagram",fb:"facebook",xa:"x",tw:"twitter"},hg="vk",ON=new Set(mg),AN=e=>ON.has(e),gg=e=>{const t=String(e??"").trim().toLowerCase();return t?AN(t)?t:CN[t]??hg:hg},MN=e=>gg(e),kN=new Set(["normal","italic","oblique"]),jN=new Set(["sans-serif","serif"]),RN=new Set(["uploaded","remote_file","google_stylesheet"]),yt=e=>(e??"").trim(),$n=e=>yt(e)||void 0,yg=e=>typeof e=="number"&&e>0?e:void 0,NN=e=>kN.has(e)?e:void 0,DN=e=>jN.has(e)?e:void 0,LN=e=>RN.has(e)?e:void 0,FN=(e,t)=>{const r=wl(yt(e.hex));return r?{id:yt(e.id)||lg(),name:yt(e.name),hex:r,order:e.order??t}:null},_g=(e,t=0)=>({id:yt(e.id),name:yt(e.name),source_url:$n(e.source_url),source_kind:LN(e.source_kind),file_name:$n(e.file_name),family:$n(e.family),weight:$n(e.weight),style:NN(e.style),category:DN(e.category),preview_url:$n(e.preview_url),storage_fallback:e.storage_fallback||void 0,font_size_px:yg(e.font_size_px),line_height_px:yg(e.line_height_px),order:e.order??t}),xN=(e,t)=>{const r=yt(e.url);return r?{id:yt(e.id),name:yt(e.name),url:r,icon_key:gg(yt(e.icon_key)),enabled:e.enabled??!0,order:e.order??t}:null},Ur=e=>[...e].sort((t,r)=>t.order-r.order),vg=e=>e?{colors:Ur((e.colors??[]).map(FN).filter(t=>t!==null)),fonts:Ur((e.fonts??[]).map(_g)),socials:Ur((e.socials??[]).map(xN).filter(t=>t!==null))}:HR,UN=e=>e==="remote_stylesheet"?"remote_file":e,BN=e=>{const t={};return e.colors&&(t.colors=Ur(e.colors).map(r=>({id:r.id,name:r.name.trim(),hex:wl(r.hex)||r.hex}))),e.fonts&&(t.fonts=Ur(e.fonts).map(r=>({id:r.id,name:r.name.trim(),source_url:r.source_url??"",source_kind:UN(cN(r)),file_name:r.file_name??"",family:r.family??"",weight:r.weight??"",style:r.style??"",category:r.category??"",preview_url:r.preview_url??"",storage_fallback:r.storage_fallback??!1,font_size_px:r.font_size_px??0,line_height_px:r.line_height_px??0}))),e.socials&&(t.socials=Ur(e.socials).map(r=>({id:r.id,name:r.name.trim(),url:r.url,icon_key:MN(r.icon_key),enabled:r.enabled}))),t},bg="ProjectBrandStyles",qn=Ie({reducerPath:"projectSettingsStylesApi",baseQuery:Fe({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[bg],endpoints:e=>({getProjectStyles:e.query({async queryFn({projectId:t},r){const n=Le(await Oe(C.getContainer(r)).projects.stylesList({id:String(t)}));return"error"in n?{error:n.error}:{data:vg(n.data)}},providesTags:(t,r,{projectId:n})=>[{type:bg,id:String(n)}]}),updateProjectStyles:e.mutation({async queryFn({projectId:t,patch:r},n){const i=Le(await Oe(C.getContainer(n)).projects.stylesPartialUpdate({id:String(t)},BN(r)));return"error"in i?{error:i.error}:{data:vg(i.data)}},async onQueryStarted({projectId:t,patch:r},{dispatch:n,queryFulfilled:i}){const o=n(qn.util.updateQueryData("getProjectStyles",{projectId:t},a=>Object.assign(a,r)));try{const{data:a}=await i;n(qn.util.upsertQueryData("getProjectStyles",{projectId:t},a))}catch{o.undo()}}}),uploadProjectFont:e.mutation({async queryFn({projectId:t,file:r},n){const i=new FormData;i.append("file",iN(r));const o=Le(await Oe(C.getContainer(n)).request({path:`/projects/${String(t)}/styles/fonts`,method:"POST",body:i,secure:!0,type:W.FormData,format:"json"}));return"error"in o?{error:o.error}:{data:_g(o.data)}},async onQueryStarted({projectId:t},{dispatch:r,queryFulfilled:n}){try{const{data:i}=await n;r(qn.util.updateQueryData("getProjectStyles",{projectId:t},o=>{o.fonts=o.fonts.some(a=>a.id===i.id)?o.fonts.map(a=>a.id===i.id?i:a):[...o.fonts,i],o.fonts.sort((a,s)=>a.order-s.order)}))}catch{}}})})}),{useGetProjectStylesQuery:$N,useUpdateProjectStylesMutation:iG,useUploadProjectFontMutation:oG}=qn,Eg=new WeakMap,qN=e=>{if(!e)return pg(e);let t=Eg.get(e);return t||(t=pg(e),Eg.set(e,t)),t},wg=e=>{const t=Ad("projectStyles"),{data:r}=$N({projectId:e},{skip:!0});return(0,b.useMemo)(()=>qN(t),[t])};function Sg(){const e=ah(),t=sj();return e??t}function zN(){return at(fd)==="vs-dark"?md:pd}var GN=2.5,HN=({atom:e,onSelect:t,onDragStart:r,isDroppedAtom:n})=>{const i=(0,b.useCallback)(s=>t(s,e),[t,e]),o=(0,b.useCallback)(s=>r(s,e,n),[r,e,n]),a=(0,b.useCallback)(s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),t(s,e))},[t,e]);return(0,R.jsxs)("button",{type:"button",className:"ant-card-hoverable atoms__item "+e.className+(e.isLockedByPlan?" atoms__item_locked":""),draggable:!0,onClick:i,onKeyDown:a,onDragStart:o,"data-test-name":e.name,children:[(0,R.jsxs)("span",{className:"atom-image",children:[e.icon,e.isLockedByPlan&&(0,R.jsx)(ee,{icon:"Lock",component:B.icons$Lock,size:12,strokeWidth:GN,className:"atom-image__lock"})]}),(0,R.jsx)("span",{className:"atom-title",children:e.title})]})},Pg=()=>{const e=he(),{__:t}=e,r=st(),n=Ve(),i=Sg()||"ru_RU",o=JC(),a=XC(),[s,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)(0),d=Ge(),f=RS(C.ATOMS_HANDLERS_ID),m=Tt(C.HANDLE_ATOM_INSERT_ID),g=qR(),h=ag(n?.id),E=wg(h),S=E?YR(E.socials):[],T=S.length>0?Qh(S):dR;let w=[];if(r.elementImageEnabled&&w.push({title:t("Image"),icon:(0,R.jsx)(ee,{icon:"ElementImage",component:B.icons$ElementImage,size:24,strokeWidth:r.iconStrokeWidth}),html:Dj,className:"",name:"image"}),r.elementAIimageEnabled&&w.push({title:t("AI image"),icon:(0,R.jsx)(ee,{icon:"ElementImageAI",component:B.icons$ElementImageAI,size:24,strokeWidth:r.iconStrokeWidth}),html:Lj,className:"ai",name:"ai-image"}),r.elementTextEnabled&&w.push({title:t("Text"),icon:(0,R.jsx)(ee,{icon:"ElementText",component:B.icons$ElementText,size:24,strokeWidth:r.iconStrokeWidth}),html:Fj(e),className:"",name:"text"}),r.elementHeaderEnabled&&w.push({title:t("Header"),icon:(0,R.jsx)(ee,{icon:"ElementTitle",component:B.icons$ElementTitle,size:24,strokeWidth:r.iconStrokeWidth}),html:xj(e),className:"",name:"header"}),r.elementButtonEnabled&&w.push({title:t("Button"),icon:(0,R.jsx)(ee,{icon:"ElementButton",component:B.icons$ElementButton,size:24,strokeWidth:r.iconStrokeWidth}),html:Uj(e),className:"",name:"button"}),r.elementSpacerEnabled&&w.push({title:t("Spacer"),icon:(0,R.jsx)(ee,{icon:"ElementSpacer",component:B.icons$ElementSpacer,size:24,strokeWidth:r.iconStrokeWidth}),html:zj,className:"",name:"spacer"}),r.elementListULEnabled&&w.push({title:t("List UL"),icon:(0,R.jsx)(ee,{icon:"ElementListUL",component:B.icons$ElementListUL,size:24,strokeWidth:r.iconStrokeWidth}),html:Bj(e),className:"",name:"list-ul"}),r.elementListOLEnabled&&w.push({title:t("List OL"),icon:(0,R.jsx)(ee,{icon:"ElementListOL",component:B.icons$ElementListOL,size:24,strokeWidth:r.iconStrokeWidth}),html:$j(e),className:"",name:"list-ol"}),r.elementDividerEnabled&&w.push({title:t("Divider"),icon:(0,R.jsx)(ee,{icon:"ElementDivider",component:B.icons$ElementDivider,size:24,strokeWidth:r.iconStrokeWidth}),html:qj,className:"",name:"divider"}),r.elementSocialEnabled&&w.push({title:t("Social media"),icon:(0,R.jsx)(ee,{icon:"ElementSocial",component:B.icons$ElementSocial,size:24,strokeWidth:r.iconStrokeWidth}),html:T,className:"",name:"social"}),r.elementTableEnabled&&w.push({title:t("Table"),icon:(0,R.jsx)(ee,{icon:"ElementTable",component:B.icons$ElementTable,size:24,strokeWidth:r.iconStrokeWidth}),html:fR(e),className:"",name:"table"}),r.elementCountdownEnabled&&w.push({title:t("Countdown"),icon:(0,R.jsx)(ee,{icon:"ElementCountdown",component:B.icons$ElementCountdown,size:24,strokeWidth:r.iconStrokeWidth}),html:hR(i),className:"",name:"countdown"}),r.elementVideoEnabled&&w.push({title:t("Video"),icon:(0,R.jsx)(ee,{icon:"ElementVideo",component:B.icons$ElementVideo,size:24,strokeWidth:r.iconStrokeWidth}),html:gR,className:"",name:"video"}),r.elementCarouselEnabled&&w.push({title:t("Carousel"),icon:(0,R.jsx)(ee,{icon:"ElementCarousel",component:B.icons$ElementCarousel,size:24,strokeWidth:r.iconStrokeWidth}),html:yR(e),className:"amp",name:"amp-carousel"}),r.elementAccordionEnabled&&w.push({title:t("Accordion"),icon:(0,R.jsx)(ee,{icon:"ElementAccordion",component:B.icons$ElementAccordion,size:24,strokeWidth:r.iconStrokeWidth}),html:_R(e),className:"amp",name:"amp-accordion"}),r.elementFormEnabled&&w.push({title:t("Form"),icon:(0,R.jsx)(ee,{icon:"ElementForm",component:B.icons$ElementForm,size:24,strokeWidth:r.iconStrokeWidth}),html:null,className:"amp",name:"amp-form"}),w=w.map(v=>({...v,fallbackTooltip:t("Coming soon"),planFeature:og(v.name),isLockedByPlan:g(og(v.name))})),f){const v={value:w};for(const M of f)M.execute(v);w=v.value}(0,b.useEffect)(()=>{const{dispose:v}=d.addListener(ne.APPLICATION_ATOM_INSERTED,M=>{const j=w.find(A=>A.name===M);j&&m.fire(j)});return()=>v()},[d,w,m]);const y=(0,b.useCallback)(v=>{c(!0),u(v.planFeature?rg[v.planFeature]:1)},[]),I=(0,b.useCallback)(v=>v.isLockedByPlan?(setTimeout(()=>y(v),1e3),!1):!0,[y]),_=(0,b.useCallback)((v,M)=>{if(M.isLockedByPlan){y(M);return}o(v,M)},[y,o]),P=(0,b.useCallback)((v,M,j)=>{a(v,M,j)},[a]);return(0,R.jsxs)("div",{className:"atoms",children:[(0,R.jsx)("div",{className:"atoms__list",children:(0,R.jsx)(B.ui_kit$Space,{wrap:!0,style:{justifyContent:"space-between",rowGap:10},children:w&&w.map((v,M)=>v.html?(0,R.jsx)(HN,{atom:v,onSelect:_,onDragStart:P,isDroppedAtom:I},v.title+M.toString()):(0,R.jsx)(B.ui_kit$Tooltip,{title:v.fallbackTooltip||t("Coming soon"),placement:"top",children:(0,R.jsxs)("div",{className:"atoms__item atoms__item_inactive "+v.className,"data-test-name":v.name,children:[(0,R.jsx)("span",{className:"atom-image",children:v.icon}),(0,R.jsx)("span",{className:"atom-title",children:v.title})]},v.title+M.toString())},v.title+M.toString()))})}),(0,R.jsx)(tg,{open:s,onCancel:()=>c(!1),initialSlide:l})]})};Pg.propTypes={};var VN={full:{flexGrow:1},768:{width:171},425:{width:25},375:{width:28},320:{width:320}},Ig={right:-12,top:4,zIndex:999,padding:0,position:"absolute"},WN=[{kind:"full",width:1200},{kind:"768",width:768},{kind:"425",width:425},{kind:"375",width:375},{kind:"320",width:320,showLabel:!0},{kind:"375",width:375},{kind:"425",width:425,control:"mobile"},{kind:"768",width:768,control:"desktop"},{kind:"full",width:1200}];function KN({kind:e,width:t,label:r,onSelect:n,onHover:i,children:o}){const a=(0,b.useCallback)(()=>i(e,r),[i,e,r]),s=(0,b.useCallback)(()=>i(null,""),[i]),c=(0,b.useCallback)(()=>n(t),[n,t]),l=(0,b.useCallback)(u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(t))},[n,t]);return(0,R.jsx)("div",{className:`device-width__${e}`,style:VN[e],role:"button",tabIndex:0,"aria-label":r,onMouseEnter:a,onMouseLeave:s,onClick:c,onKeyDown:l,children:o})}function QN({onSelectWidth:e,themeToggle:t}){const{__:r}=he(),[n,i]=(0,b.useState)(""),[o,a]=(0,b.useState)(""),s={full:r("Desktop"),768:r("Small desktop – 768px"),425:r("Mobile L – 425px"),375:r("Mobile M – 375px"),320:r("Mobile S – 320px")},c=(0,b.useCallback)((l,u)=>{i(l?`device-width__${l}-hovered`:""),a(u)},[]);return(0,R.jsx)("div",{className:`email-pane__sizes ${n}`,children:(0,R.jsxs)("div",{className:"email-pane__width-selectors-wrapper",children:[(0,R.jsx)("div",{className:"device-width__theme",children:t}),WN.map((l,u)=>(0,R.jsxs)(KN,{kind:l.kind,width:l.width,label:s[l.kind],onSelect:e,onHover:c,children:[l.showLabel?o:null,l.control==="mobile"&&(0,R.jsx)(B.ui_kit$Tooltip,{title:r("Mobile view"),placement:"bottom",children:(0,R.jsx)(B.ui_kit$Button,{type:"default",icon:(0,R.jsx)(ee,{icon:"MobileOutlined",component:B.icons$MobileOutlined,size:16,strokeWidth:2}),size:"small",shape:"circle",style:Ig})}),l.control==="desktop"&&(0,R.jsx)(B.ui_kit$Tooltip,{title:r("Desktop view"),placement:"bottom",children:(0,R.jsx)(B.ui_kit$Button,{type:"default",icon:(0,R.jsx)(ee,{icon:"DesktopOutlined",component:B.icons$DesktopOutlined,size:16,strokeWidth:2}),size:"small",shape:"circle",style:Ig})})]},`${l.kind}-${u}`)),(0,R.jsx)("div",{className:"device-width__theme-placeholder"})]})})}var YN=C.createIdentifier$1("canvas.resizerBinder"),XN=C.createIdentifier$1("canvas.service"),aG={created:dt.canvasCreated,loaded:dt.canvasLoaded};function Tg(e){return e.getInstance(XN)}var JN=new Set([ne.APPLICATION_ELEMENT_SETTINGS_SET,ne.APPLICATION_BLOCK_SETTINGS_SET,ne.APPLICATION_EMAIL_SETTINGS_SET]);function zn(e,t){const r=Ge(),n=t??e,i=(0,b.useRef)(n);i.current=n,(0,b.useEffect)(()=>{if(t){const u=r.addListener(e,d=>i.current(d));return()=>{u.dispose()}}let o=null;const a=new Map,s=()=>{o=null,a.forEach(u=>i.current(u)),a.clear()},c=u=>{const d=u.data?.operation;if(d&&JN.has(d)){a.set(d,u),o===null&&(o=requestAnimationFrame(s));return}i.current(u)},l=r.addListener(c);return()=>{l.dispose(),o!==null&&(cancelAnimationFrame(o),o=null),a.clear()}},[r,e,t])}function ZN(e){return{undo:()=>e.undo(),redo:()=>e.redo(),clear:()=>e.clear(),canUndo:()=>e.canUndo(),canRedo:()=>e.canRedo(),createSnapshot:()=>e.createSnapshot(),restoreSnapshot:t=>{e.restoreSnapshot(t)},getPast:t=>e.getPast(t).map(r=>({changes:r})),getFuture:t=>e.getFuture(t).map(r=>({changes:r}))}}var eD={canUndo:!1,canRedo:!1},tD={undo:()=>{},redo:()=>{},clear:()=>{},canUndo:()=>!1,canRedo:()=>!1,createSnapshot:()=>{},restoreSnapshot:()=>{},getPast:()=>[],getFuture:()=>[]};function Cg(e){const t=et(),{history:r}=e??t;return(0,b.useMemo)(()=>r?ZN(r):tD,[r])}function rD(){const{history:e}=et(),t=(0,b.useCallback)(i=>e?e.subscribe(i):()=>{},[e]),r=(0,b.useRef)(null),n=(0,b.useCallback)(()=>{if(!e)return eD;const i={canUndo:e.canUndo(),canRedo:e.canRedo()},o=r.current;return o&&o.canUndo===i.canUndo&&o.canRedo===i.canRedo?o:(r.current=i,i)},[e]);return(0,b.useSyncExternalStore)(t,n)}var nD=2e3,Og=10,iD="iframe_errors",oD=5,aD=Fi,sD=6e4,lD=50;function cD(e,t){let r,n;const i=e.addListener(ne.RELOAD,()=>{i.dispose(),n=setTimeout(()=>{r=e.onInit(t)})});return{dispose:()=>{i.dispose(),clearTimeout(n),r?.dispose()}}}function Ag(){return document.location.pathname.indexOf("emails")>0?"email":"block"}function Mg(e,t){e.total++,e.last=t,e.errors.length<lD&&e.errors.push(t)}function uD({mutation:e,source:t,batch:r}){if(!t&&!r&&!e)return{origin:"iframe"};const n={},i=[["domparserSource",t],["domparserMutation",e?.type],["domparserStage",e?.stage],["domparserCause",e?.cause]];for(const[o,a]of i)a&&(n[o]=a);return{origin:"iframe",tags:n,contexts:{domparser:{source:t,batch:r,...e}}}}function dD(e){const{__:t}=he(),r=Ge(),n=Cg(),{error:i}=Gt(),{document:o}=et(),a=(0,b.useCallback)(()=>o?.getContent()??"",[o]),s=(0,b.useRef)(0),c=(0,b.useRef)(void 0),l=(0,b.useRef)(null),u=(0,b.useRef)(void 0),d=(0,b.useRef)(void 0),f=ur(),m=(0,b.useRef)(new Set),g=(0,b.useRef)(!1),h=(0,b.useRef)(void 0),E=(0,b.useRef)(!0);(0,b.useEffect)(()=>(E.current=!0,()=>{E.current=!1}),[]);const S=(0,b.useCallback)(j=>{const A={...j,errorResolved:!0,userId:f?.id};return C.RACS.post(iD,A).catch(()=>{}),A},[f?.id]),T=(0,b.useCallback)(()=>{const j=l.current;if(!j)return;l.current=null,c.current=null,s.current=0,clearTimeout(u.current),d.current?.dispose(),d.current=void 0;const A=j.last,k=new Error(A.message);A.stack&&(k.stack=A.stack);const D=es(k,uD(A)),N=S({past:j.past,future:j.future,text:j.text,errors:j.errors,errorsTotal:j.total,message:A.message,stack:A.stack,entityId:j.entityId,entityType:j.entityType,sentryEventId:D});i({id:"IFRAME_ERROR",data:N,title:t("Something went wrong")})},[i,S,t]),w=(0,b.useCallback)(()=>{l.current&&(m.current=l.current.instances),g.current=!1,clearTimeout(h.current),T()},[T]),y=(0,b.useRef)(w);y.current=w,(0,b.useEffect)(()=>()=>y.current(),[o]);const I=(0,b.useRef)(e?.id);(0,b.useEffect)(()=>{const j=I.current;I.current=e?.id,j!==void 0&&j!==e?.id&&y.current()},[e?.id]);const _=(0,b.useCallback)(j=>{clearTimeout(u.current),u.current=setTimeout(T,j)},[T]),P=(0,b.useCallback)(j=>{new Promise(A=>setTimeout(A)).then(()=>{Promise.resolve().then(()=>{if(!E.current)return;const A=l.current;A&&(A.sessionDocument!==o||A.entityId!==void 0&&A.entityId!==e?.id)&&w();const k=j.instance??j.batch?.split(":")[0];if(g.current||k&&m.current.has(k))return;const D={message:j.message,stack:j.stack,...j.mutation?{mutation:j.mutation}:{},...j.source?{source:j.source}:{},...j.batch?{batch:j.batch}:{},...j.instance?{instance:j.instance}:{}};if(k&&l.current?.instances.has(k)){Mg(l.current,D);return}if(s.current++,l.current||(l.current={past:n.getPast(Og),future:n.getFuture(),text:a(),errors:[],total:0,last:D,instances:new Set,entityId:e?.id,entityType:Ag(),sessionDocument:o}),k&&l.current.instances.add(k),Mg(l.current,D),s.current>=oD){m.current=l.current.instances,g.current=!0,clearTimeout(h.current),h.current=setTimeout(()=>{g.current=!1},sD),T();return}if(c.current){n.restoreSnapshot(c.current);for(let N=0;N<s.current;N++)n.undo()}else c.current=n.createSnapshot();r.send(ne.RELOAD),d.current?.dispose(),d.current=cD(r,()=>{d.current?.dispose(),d.current=void 0,_(nD)}),_(aD)})})},[n,a,e?.id,o,r,T,w,_]);zn(ne.APPLICATION_DOMPARSER_ERROR,P);const v=(0,b.useRef)({entityId:"",reasons:new Set}),M=(0,b.useCallback)(j=>{const A=String(e?.id??"");if(v.current.entityId!==A&&(v.current={entityId:A,reasons:new Set}),v.current.reasons.has(j.reason))return;v.current.reasons.add(j.reason);const k=`sync drift: ${j.reason}`,D=ts(k,{origin:"sync-drift",level:"warning",tags:{reason:j.reason},contexts:{syncDrift:{...j}}});j.reason!=="implicit-tbody-in-canvas"&&S({kind:"sync-drift",past:n.getPast(Og),future:n.getFuture(),text:a(),message:k,stack:"",drift:j,mutation:j.mutation,entityId:e?.id,entityType:Ag(),sentryEventId:D})},[n,a,S,e?.id]);zn(ne.APPLICATION_SYNC_DRIFT,M)}function kg(e){return e?.getContent()??""}function jg(e,t){return e?{dispose:e.subscribe(t)}:{dispose:()=>{}}}function fD(e,t){const r=JSON.stringify(t??{});pD(e?.get().attributes.common_styles,r)||is(e,{common_styles:r})}function pD(e,t){if(e===t)return!0;try{return C.deepEqual(JSON.parse(e||"{}"),JSON.parse(t||"{}"))}catch{return!1}}var Io=Symbol("isIframeEvent");function mD(e,t,r,n){return{x:(e.x-t.x-r.x)/n,y:(e.y-t.y-r.y)/n}}function hD(e,t,r,n){return{x:e.x*n+t.x+r.x,y:e.y*n+t.y+r.y}}var Rg=["dragenter","dragover","dragleave","drop","dragend"];function gD(e){const t=Array.from(document.querySelectorAll("[data-canvas-host]")).map(r=>{const n=document.createElement("div");return n.className="iframe-provider-shield",Object.assign(n.style,{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1",pointerEvents:"auto"}),Rg.forEach(i=>n.addEventListener(i,e)),r.appendChild(n),n});return()=>{t.forEach(r=>{Rg.forEach(n=>r.removeEventListener(n,e)),r.remove()})}}function yD({children:e}){const[t,r]=(0,b.useState)(),[n,i]=(0,b.useState)(),[o,a]=(0,b.useState)(!1),s=Ge();return(0,b.useEffect)(()=>{if(t){const c=s.addListener(ne.APPLICATION_IFRAME_DRAG_EVENT,l=>{if(l.type!=="drageleave"&&l.type!=="dragenter"){const u=t.getBoundingClientRect(),{x:d,y:f}=hD({x:l.clientX,y:l.clientY},u,{x:window.scrollX,y:window.scrollY},il(t)),m=document.elementFromPoint(d,f);if(m){const g=new DataTransfer,h=new DragEvent(l.type,{clientX:d,clientY:f,cancelable:!0,bubbles:!0,dataTransfer:g});h[Io]=!0,m.dispatchEvent(h)}}});return()=>c.dispose()}},[s,t]),(0,b.useEffect)(()=>{const c=u=>{u[Io]||a(!0)},l=u=>{u[Io]||a(!1)};return window.addEventListener("dragstart",c),window.addEventListener("dragend",l),()=>{window.removeEventListener("dragstart",c),window.removeEventListener("dragend",l)}},[n]),(0,b.useEffect)(()=>{const c=l=>{if(!l[Io]){const u=n.getBoundingClientRect(),d=mD({x:l.pageX,y:l.pageY},u,{x:window.scrollX,y:window.scrollY},il(n));s.send(ne.SANDBOX_DRAG_EVENT,{value:l.dataTransfer?.getData("Text")||"",type:l.type,clientX:d.x,clientY:d.y})}};if(n){n.addEventListener("dragenter",c),n.addEventListener("dragover",c),n.addEventListener("dragleave",c),n.addEventListener("drop",c),n.addEventListener("dragend",c);const l=gD(c);return()=>{n.removeEventListener("dragenter",c),n.removeEventListener("dragover",c),n.removeEventListener("dragleave",c),n.removeEventListener("drop",c),n.removeEventListener("dragend",c),l()}}},[n,s]),(0,R.jsxs)("div",{ref:r,children:[o&&(0,R.jsx)("div",{ref:i,className:"iframe-provider"}),e]})}var _D=["colorBgBase","colorBgElevated","colorError","colorInfo","colorInfoBg","colorInfoBgHover","colorInfoBorder","colorInfoBorderHover","colorLink","colorPrimary","colorPrimaryBg","colorPrimaryBgHover","colorPrimaryBorder","colorPrimaryBorderHover"];function vD(e){const t={};for(const r of _D){const n=e[r];typeof n=="string"&&(t[r]=n)}return t}function Il(e,t){const r=Ge(),n=t?.async??!1;(0,b.useEffect)(()=>{const i=n?r.addListenerAsync(ne.RELOAD,e):r.addListener(ne.RELOAD,e);return()=>i.dispose()},[r,e,n]),(0,b.useEffect)(()=>{},[e])}function bD(){const e=Ge(),{token:t}=(0,B.ui_kit$useToken)(),[r,n]=(0,b.useState)();(0,b.useEffect)(()=>{if(!C.deepEqual(r,t)){const o=e.onInit(()=>{e.send(ne.SANDBOX_SET_THEME_VARIABLES,vD(t)),n(t)});return()=>o.dispose()}},[t,r,n,e]);const i=(0,b.useCallback)(()=>{n(void 0)},[]);Il(i)}var kt=Q.__toESM(Xc()),ED={minHeight:600},wD="#pane-content-wrapper, .email-pane__col_preview, .preview-mode__pane-content";function Ng(e){e?.current?.resize?.()}var Dg=(0,b.forwardRef)(({className:e=null,email:t=null,handlerSendPosition:r=()=>{},surface:n,clip:i=null},o)=>{const a=st(),s=Se(),c=n??(t?.hasOwnProperty("type")?"block":"email"),l=(0,b.useMemo)(()=>Tg(s),[s]),u=(0,b.useMemo)(()=>l?.current(c),[l,c]),d=(0,b.useRef)(null),{document:f}=et(),m=c==="email"?f?.get().docId:void 0,g=(0,b.useCallback)(()=>{ke(dt.canvasLoaded),Ng(o),r()},[r,o]);(0,b.useImperativeHandle)(o,()=>({getIframeElement:()=>l?.current(c)?.element,resize:()=>l?.current(c)?.resize()}),[l,c]),(0,b.useEffect)(()=>{if(!(!l||c!=="email"))return l.want(m),()=>l.want(void 0)},[l,c,m]),(0,b.useEffect)(()=>{if(!l)return;const S=d.current,T=i??S?.closest(wD)??null;return l.alignSurface(c,S,T),()=>l.alignSurface(c,null)},[l,c,i,a.sidePanelFloating]);const h=(0,b.useRef)(g);h.current=g,(0,b.useEffect)(()=>{if(!u)return;let S=!1;const T=()=>{S||h.current({target:u.element})};return u.ready().then(T).catch(()=>{window.requestAnimationFrame(()=>{S||u.ready().then(T).catch(()=>{})})}),()=>{S=!0}},[u]),bD(),dD(t),(0,b.useEffect)(()=>{const S=jg(f,()=>{Ng(o)});return()=>S.dispose()},[f,o]);const E=(0,b.useCallback)(S=>{const{operation:T,settings:w}=S.data;T===ne.APPLICATION_COMMON_STYLES_UPDATE&&fD(f,w?.commonStyles)},[f]);return zn(E),(0,R.jsx)(yD,{children:(0,R.jsx)("div",{ref:d,className:(0,vt.default)("email-preview",e),id:"email_iframe_slot",style:ED})})});Dg.propTypes={className:kt.default.string,surface:kt.default.oneOf(["email","block","preview"]),email:kt.default.shape({html:kt.default.string}),handlerSendPosition:kt.default.func,clip:kt.default.object};var SD=/unable to preload css for/i,PD=[/chunkloaderror/i,/loading chunk [\d\w-]+ failed/i,/failed to fetch dynamically imported module/i,/importing a module script failed/i,/error loading dynamically imported module/i,SD];function Tl(e){if(!e)return!1;const t=ID(e);return PD.some(r=>r.test(t))||e instanceof Error&&e.name==="ChunkLoadError"?!0:CD(e)}function ID(e){return typeof e=="string"?e:e instanceof Error?`${e.name} ${e.message}`:typeof e=="object"&&e!==null&&"message"in e?String(e.message??e):String(e)}var TD=/(^|\/)(static\/js\/[\w.-]+|main\.[\w-]+)\.js$/i;function CD(e){if(typeof e!="object"||e===null||e.type!=="error")return!1;const t=e.target;if(!t||typeof t.src!="string"||t.tagName?.toLowerCase()!=="script")return!1;try{const r=new URL(t.src,window.location.href);return r.origin===window.location.origin&&TD.test(r.pathname)}catch{return!1}}var OD="/version.json",Lg="_rb",Cl="stale-build-reload-at",Ol="stale-build-reload-count",AD=5e3,MD=3,kD=3e4,jD=5e3,RD=1e4,Fg="stale-build-retry-reload-at",ND=6e4,dr=!1,xg=0,Gn=null,To=!1,Al=!1,Co=[];function Oo(){return!1}function DD(){return"8c2b05d7"}function LD(){return dr}function FD(){return Al}function xD(e){return Co.push(e),()=>{const t=Co.indexOf(e);t>=0&&Co.splice(t,1)}}function Ug(){return typeof sessionStorage>"u"?0:Number(sessionStorage.getItem(Ol)??0)}function UD(){typeof sessionStorage>"u"||sessionStorage.setItem(Ol,String(Ug()+1))}function BD(){typeof sessionStorage>"u"||(sessionStorage.removeItem(Ol),sessionStorage.removeItem(Cl),dr=!1,To=!1)}function $D(e){return typeof e.version!="string"||typeof e.entry!="string"||typeof e.buildId!="string"?!1:e.entry===`main.${e.buildId}.js`}async function qD(e){const t=await fetch(OD,{cache:"no-store",credentials:"same-origin",signal:e});if(!t.ok)return null;const r=await t.json();return $D(r)?r:null}async function zD(){const e=new AbortController;let t;const r=new Promise(n=>{t=setTimeout(()=>{e.abort(),n(null)},jD)});try{return await Promise.race([qD(e.signal),r])}catch{return null}finally{clearTimeout(t)}}function GD(e){const t=DD();return!!t&&e.buildId!==t}function HD(e){if(!Oo()||To)return!1;if(dr)return!0;if(typeof window>"u"||typeof sessionStorage>"u"||Ug()>=MD)return!1;const t=Number(sessionStorage.getItem(Cl)??0);if(t&&Date.now()-t<AD)return!1;Bg(),UD(),sessionStorage.setItem(Cl,String(Date.now()));const r=new URL(window.location.href);return r.searchParams.has(Lg)?(window.location.reload(),!0):(r.searchParams.set(Lg,String(Date.now())),window.location.replace(r.toString()),!0)}function Bg(){dr=!0,setTimeout(()=>{dr&&(dr=!1,Co.splice(0).forEach(e=>e()))},RD)}function VD(){if(!Oo()||typeof window>"u"||typeof sessionStorage>"u")return!1;if(dr)return!0;const e=Number(sessionStorage.getItem(Fg)??0);return e&&Date.now()-e<ND?!1:(sessionStorage.setItem(Fg,String(Date.now())),Bg(),window.location.reload(),!0)}async function WD(e){Al=!1;const t=await zD();return t?GD(t)?(To=!1,HD(e)):(BD(),To=!0,Al=!0,!1):!1}function KD(e,t={}){if(!Oo())return Promise.resolve(!1);if(Gn!==null)return Gn;const r=Date.now();return!t.force&&r-xg<kD?Promise.resolve(!1):(xg=r,Gn=WD(e).finally(()=>{Gn=null}),Gn)}var QD=[1e3,2e3,4e3],YD=15e3,XD=2e4,JD=/https?:\/\/[^\s'"()]+\.m?js\b(?:\?[^\s'"()#]*)?/i,$g,qg;function ZD(e){return $g?$g(e):(qg??=new Function("url","return import(url)"),qg(e))}function eL(e){return new Promise(t=>{const r=()=>{clearTimeout(n),window.removeEventListener("online",r),t()},n=setTimeout(r,e);window.addEventListener("online",r)})}var zg={fetch:(e,t)=>fetch(e,t),importModule:ZD,sleep:e=>new Promise(t=>setTimeout(t,e)),isOnline:()=>typeof window>"u"||window.navigator.onLine!==!1,waitForOnline:eL,isCancelled:LD};function tL(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";return JD.exec(t)?.[0]??null}async function Gg(e={}){const t={...zg,...e};t.isOnline()||await t.waitForOnline(YD)}async function rL(e,t,r={}){const n={...zg,...r},i=tL(e);for(const[o,a]of QD.entries()){if(await n.sleep(a),await Gg(n),n.isCancelled())return null;if(!i){const c=await Hg(t);if(c!=="retry")return{module:c.module,attempt:o+1};continue}if(!await nL(i,n))continue;const s=await iL(i,o+1,t,n);if(s==="stop")return null;if(s!=="retry")return{module:s.module,attempt:o+1}}return null}async function nL(e,t){const r=new AbortController,n=setTimeout(()=>r.abort(),XD);try{const i=await t.fetch(e,{cache:"reload",signal:r.signal});return i.ok?(await i.arrayBuffer(),!0):!1}catch{return!1}finally{clearTimeout(n)}}async function Hg(e){try{return{module:await e()}}catch(t){if(!Tl(t))throw t;return"retry"}}async function iL(e,t,r,n){const i=await Hg(r);if(i!=="retry")return i;let o;try{o=await n.importModule(`${e}${e.includes("?")?"&":"?"}retry=${t}`)}catch(a){return Tl(a)?"retry":"stop"}return oL(o)?{module:o}:"stop"}function oL(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);if(t.length!==1||t[0]!=="default")return!1;const r=e.default;return typeof r=="function"||typeof r=="object"&&r!==null&&"$$typeof"in r}function Ao(e,t){return(0,b.lazy)(()=>(t&&ke(`route:${t}:start`,{kind:"network"}),e().then(r=>(t&&ke(`route:${t}:end`,{kind:"network"}),r)).catch(async r=>{if(!Tl(r))throw r;if(!Oo())return new Promise(()=>{});if(await Gg(),await KD("lazy_import",{force:!0}))return Vg(r);if(!FD())throw r;const n=await rL(r,e);if(n)return ke(`route:${t??"chunk"}:retry:${n.attempt}`,{kind:"network"}),n.module;if(VD())return Vg(r);throw r})))}function Vg(e){return new Promise((t,r)=>{xD(()=>r(e))})}var Ml=new Map,aL=new Map;function sL(e,t){e.set(t,(e.get(t)??0)+1)}function lL(e,t){const r=e.get(t)??0;r<=1?e.delete(t):e.set(t,r-1)}function Wg(e,t){return(e.get(t)??0)>0}function cL(e){return Wg(Ml,e)||Wg(aL,e)}function uL(e){sL(Ml,e);let t=!1;return{dispose(){t||(t=!0,dL(e))}}}function dL(e){lL(Ml,e)}function fL(e,t){return mL([...e.changes].sort((r,n)=>r.rangeOffset-n.rangeOffset).map(r=>({start:r.rangeOffset,end:r.rangeOffset+r.rangeLength,text:r.text})),t)}function pL(e,t){return e.map(r=>{const n=t.getPositionAt(r.oldPosition),i=t.getPositionAt(r.oldEnd);return{text:r.newText,range:{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:i.lineNumber,endColumn:i.column}}})}function mL(e,t){let r=0;return e.map(({start:n,end:i,text:o})=>{const a=new He(n,t.slice(n,i),n+r,o);return r+=o.length-(i-n),a})}var Kg=new WeakMap;function hL(e){const t=Kg.get(e);if(t)return t;const r=jT(e);return Kg.set(e,r),r}var Qg="monaco";function gL(e,t,r){const n=(0,b.useRef)(r);n.current=r,(0,b.useEffect)(()=>{if(!e||!t)return;const i=hL(e);let o=!1;const a=l=>{o=!0;const u=uL(t);try{l()}finally{u.dispose(),o=!1}},s=i.attach({id:Qg,apply(l){return t.getValue()!==l&&a(()=>t.setValue(l)),Promise.resolve()},applyChanges(l){return a(()=>t.applyEdits(pL(l,t))),Promise.resolve()}}),c=t.onDidChangeContent(l=>{if(o)return;const u=cL(t)?"remote":"user";u==="user"&&n.current?.(),i.mutateFrom(Qg,{changes:fL(l,e.getContent())},{source:u})});return()=>{s.detach(),c.dispose()}},[e,t])}var yL=null,Yg=(0,b.createContext)(yL);function _L(){return(0,b.useContext)(Yg)}function vL(e,t){const[r,n]=(0,b.useState)(void 0),i=(0,b.useRef)(!1),{error:o}=Gt(),{__:a}=he(),s=(0,b.useRef)(t);s.current=t;const c=(0,b.useRef)({error:o,__:a});c.current={error:o,__:a},(0,b.useEffect)(()=>{if(!e||r||i.current)return;i.current=!0;let u=!1;return s.current().then(d=>{if(u){d.dispose();return}n(d)}).catch(()=>{const{error:d,__:f}=c.current;d({id:"CODE_EDITOR_LOAD_FAILED",title:f("Failed to load the code editor")})}).finally(()=>{i.current=!1}),()=>{u=!0}},[e,r]);const l=(0,b.useRef)(void 0);return l.current=r,(0,b.useEffect)(()=>()=>{l.current?.dispose()},[]),r}var Mo;function kl(){return Mo===void 0&&(Mo=(0,ut.__vitePreload)(()=>Promise.resolve().then(()=>me("./6535dd13.js")),void 0,{}.url).catch(e=>{throw Mo=void 0,e})),Mo}function bL(){return kl().then(e=>e.ensureMonaco())}var EL=Ao(()=>kl().then(e=>({default:e.MonacoEditor}))),wL=()=>kl().then(e=>e.loadEditorModel()),SL={height:"100%"};function PL(e){const t=vL(!0,wL),{document:r}=et(),n=Se();return(0,b.useEffect)(()=>{},[]),(0,b.useEffect)(()=>{},[t]),gL(r,t,()=>$f(n)?.noteCodeEdit()),(0,R.jsx)(Yg.Provider,{value:t,children:(0,R.jsx)(b.Suspense,{fallback:(0,R.jsx)(B.ui_kit$Flex,{justify:"center",align:"center",style:SL,children:(0,R.jsx)(B.ui_kit$Spin,{size:"large"})}),children:(0,R.jsx)(EL,{...e})})})}var Xg=(0,b.createContext)(bd);function IL({kind:e,children:t}){return(0,R.jsx)(Xg.Provider,{value:e,children:t})}function ko(){return(0,b.useContext)(Xg)}var Jg=()=>{};function TL(){const e=Se(),t=(0,b.useCallback)(n=>{if(!e)return Jg;const i=Ar(e).watch(n);return()=>i.dispose()},[e]),r=(0,b.useCallback)(()=>Mr(e).requested,[e]);return(0,b.useSyncExternalStore)(t,r,r)}function Zg(){const{projectId:e}=or(),t=Se(),r=(0,b.useCallback)(o=>{if(!t)return Jg;const a=Ar(t).watch(o);return()=>a.dispose()},[t]),n=(0,b.useCallback)(()=>Mr(t).card?.id,[t]),i=(0,b.useSyncExternalStore)(r,n,n);return e??(i!=null&&i!==""?String(i):void 0)}var CL=({elementPath:e})=>{const{__:t,_x:r}=he(),n=ko()==="block",i=n&&e?.[0]?.className?.includes("em-element-path-item-block"),o=ot(),a=Ge(),s=st(),{blockId:c}=or(),l=Zg(),u=Ah(),d=Ve(),f=mt(),m=(0,b.useCallback)(v=>{a.send({operation:ne.SANDBOX_ELEMENT_ACTIVE_SET,index:v})},[a]),g=(0,b.useCallback)(v=>{if(i){m(0);return}let M="element";v?.target?.closest("svg")||v?.target?.closest(".anticon")||v?.target?.closest('[class*="icon"]')?M="icon":v?.target?.textContent&&!v?.target?.closest("svg")&&!v?.target?.closest(".anticon")&&(M="text"),o(rl(vd)),a.send({operation:ne.SANDBOX_LOCK_EDIT,data:!1}),a.send({operation:ne.SANDBOX_ELEMENT_ACTIVE_RESET}),f({event:"click",action:"click_breadcrumb_email",email_id:u||c,project_id:d?.id||l,click_target:M})},[a,o,f,u,c,l,d,i,m]),h=(0,b.useCallback)(v=>{a.send({operation:ne.SANDBOX_ELEMENT_HOVER_SET,index:v})},[a]),E=(0,b.useRef)(null),S=(0,b.useCallback)(()=>{i&&h(0)},[i,h]),T=(0,b.useCallback)(v=>{E.current?.removeEventListener("mouseover",S),E.current?.removeEventListener("click",g),E.current=v,v?.addEventListener("mouseover",S),v?.addEventListener("click",g)},[S,g]),w=(0,b.useMemo)(()=>(0,R.jsxs)("span",{ref:T,children:[n?(0,R.jsx)(ee,{icon:"Block",component:B.icons$Block,size:16,strokeWidth:s.iconStrokeWidth}):(0,R.jsx)(ee,{icon:"Email",component:B.icons$Email,size:16,strokeWidth:s.iconStrokeWidth})," ",n?t("Block"):r("Email","letter")]}),[T,n,s.iconStrokeWidth,t,r]),[y,I]=(0,b.useState)([{title:w}]),_=v=>{if(v.includes("em-element-path-item-text"))return(0,R.jsx)(ee,{icon:"ElementText",component:B.icons$ElementText,size:16,strokeWidth:s.iconStrokeWidth});if(v.includes("em-element-path-item-image"))return(0,R.jsx)(ee,{icon:"ElementImage",component:B.icons$ElementImage,size:16,strokeWidth:s.iconStrokeWidth});if(v.includes("em-element-path-item-link"))return(0,R.jsx)(ee,{icon:"LinkOutlined",component:B.icons$LinkOutlined,size:16,strokeWidth:s.iconStrokeWidth});if(v.includes("em-element-path-item-atom"))return(0,R.jsx)(ee,{icon:"Atom",component:B.icons$Atom,size:16,strokeWidth:s.iconStrokeWidth});if(v.includes("em-element-path-item-column"))return(0,R.jsx)(ee,{icon:"Column",component:B.icons$Column,size:16,strokeWidth:s.iconStrokeWidth});if(v.includes("em-element-path-item-block"))return(0,R.jsx)(ee,{icon:"Block",component:B.icons$Block,size:16,strokeWidth:s.iconStrokeWidth});if(v.includes("em-element-path-item-group"))return(0,R.jsx)(ee,{icon:"Group",component:B.icons$Group,size:16,strokeWidth:s.iconStrokeWidth});if(v.includes("em-element-path-item-button"))return(0,R.jsx)(ee,{icon:"ElementButton",component:B.icons$ElementButton,size:16,strokeWidth:s.iconStrokeWidth});if(v.includes("em-element-path-item-table"))return(0,R.jsx)(ee,{icon:"ElementTable",component:B.icons$ElementTable,size:16,strokeWidth:s.iconStrokeWidth});if(v.includes("em-element-path-item-amp"))return(0,R.jsx)(ee,{icon:"AMP",component:B.icons$AMP,size:16,strokeWidth:s.iconStrokeWidth})},P=(0,b.useCallback)((v,M)=>{const j=A=>{let k="element";A.target.closest("svg")||A.target.closest(".anticon")||A.target.closest('[class*="icon"]')?k="icon":A.target.textContent&&!A.target.closest("svg")&&!A.target.closest(".anticon")&&(k="text");const D=e?.[M],N=D?.className?.replace("em-element-path-item-","")||"unknown";f({event:"click",action:"click_breadcrumb_element",email_id:u||c,project_id:d?.id||l,element_type:N,element_index:M,element_title:D?.title||"",click_target:k}),m(M)};return(0,R.jsxs)("span",{className:v.className,onClick:j,onMouseOver:()=>{h(M)},children:[_(v.className)," ",v.title]})},[m,h,e,f,u,c,l,d]);return(0,b.useEffect)(()=>{if(e){const v=e.map((M,j)=>({title:P(M,j)})).slice(i?1:0);I([{title:w},...v])}},[e,P,w,i]),(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(B.ui_kit$Breadcrumb,{items:y,type:"separator",separator:""})})},ey=e=>{if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(t)),r.length-1),i=r.at(n)??"B";return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+i},ty=e=>e?new TextEncoder().encode(e).length:0,ry=(e,t=90)=>e>t*1024,OL=e=>{const t=[];let r=e;r=r.replace(/<!--\[if[^\]]*\]>[\s\S]*?<!\[endif\]-->/gi,i=>{const o=t.length,a=i.replace(/\s+/g," ").replace(/> </g,"><").replace(/\s+>/g,">").replace(/<!--\[if([^\]]*)\]>\s+/g,"<!--[if$1]>").replace(/\s+<!\[endif\]-->/g,"<![endif]-->");return t.push(a),`___CONDITIONAL_COMMENT_${o}___`});let n=r.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/> </g,"><").replace(/\s+>/g,">").trim();return t.forEach((i,o)=>{n=n.replace(`___CONDITIONAL_COMMENT_${o}___`,i)}),n},AL=300,ML=({fallbackHtml:e})=>{const{__:t}=he(),{document:r}=et(),[n,i]=(0,b.useState)(()=>r?.getContent()??"");(0,b.useEffect)(()=>{if(!r)return;i(r.getContent());let c;const l=r.subscribe(()=>{clearTimeout(c),c=setTimeout(()=>i(r.getContent()),AL)});return()=>{clearTimeout(c),l()}},[r]);const o=(0,b.useMemo)(()=>ty(n||e||""),[e,n]),a=ey(o),s=ry(o);return(0,R.jsx)(B.ui_kit$Tooltip,{placement:"left",title:t(s?"The code size exceeds the recommended value 90kB":"Code size"),children:(0,R.jsx)("span",{className:(0,vt.default)("email-pane__code-size",{"email-pane__code-size_exceeded":s}),children:a})})},kL={email_10_30:{id:"email_10_30",titleKey:"You have used up the number of emails you can create on your current plan",subtitleKey:"You can increase the number of emails right now.",usageResource:"email_generate",previous:10,next:30,showSecondaryBuy:!1,debugLabelKey:"Limit modal: emails 10→30"},email_30_300:{id:"email_30_300",titleKey:"You have used up the number of emails you can create on your current plan",subtitleKey:"You can increase the number of emails right now.",usageResource:"email_generate",previous:30,next:300,showSecondaryBuy:!1,debugLabelKey:"Limit modal: emails 30→300"},email_300_inf:{id:"email_300_inf",titleKey:"You have used up the number of emails you can create on your current plan",subtitleKey:"You can increase the number of emails right now.",usageResource:"email_generate",previous:300,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: emails 300→∞"},ai_10_50:{id:"ai_10_50",titleKey:"You have used up your AI generations",subtitleKey:"You can add more generations right now; they are billed separately from the generations included in your plan.",usageResource:"ai",previous:10,next:50,showSecondaryBuy:!1,debugLabelKey:"Limit modal: AI 10→50"},ai_30_150:{id:"ai_30_150",titleKey:"You have used up your AI generations",subtitleKey:"You can add more generations right now; they are billed separately from the generations included in your plan.",usageResource:"ai",previous:30,next:150,showSecondaryBuy:!1,debugLabelKey:"Limit modal: AI 30→150"},ai_150_inf:{id:"ai_150_inf",titleKey:"You have used up your AI generations",subtitleKey:"You can add more generations right now; they are billed separately from the generations included in your plan.",usageResource:"ai",previous:150,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: AI 150→∞"},optimization_exceeded:{id:"optimization_exceeded",titleKey:"You have used up your optimisation limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"optimization",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: optimization exhausted"},image_generate_exceeded:{id:"image_generate_exceeded",titleKey:"You have used up your image generation limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"image_generate",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: image_generate exhausted"},preview_exceeded:{id:"preview_exceeded",titleKey:"You have used up your preview (test send) limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"preview",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: preview exhausted"},test_sends_exceeded:{id:"test_sends_exceeded",titleKey:"You have used up your test send limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"test_sends",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: test sends exhausted"},link_check_exceeded:{id:"link_check_exceeded",titleKey:"You have used up your link check limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"link_check",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: link_check exhausted"},image_check_exceeded:{id:"image_check_exceeded",titleKey:"You have used up your image check limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"image_check",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: image_check exhausted"},spam_check_exceeded:{id:"spam_check_exceeded",titleKey:"You have used up your spam check limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"spam_check",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: spam_check exhausted"}};function jL(e){return kL[e]}function RL(e){return e==="infinity"?"∞":e}var NL=[10,50,150];function DL(e,t){for(const r of t)if(r>e)return r;return"infinity"}function LL(e){return e<=10?"ai_10_50":e<=50?"ai_30_150":"ai_150_inf"}function FL(e){return{presetId:LL(e),previousLimit:e,nextLimit:DL(e,NL)}}var xL=/\s+\d+$/;function UL(e){return e.trim().replace(xL,"").toLowerCase().replaceAll("+","-plus").split(/\s+/).filter(Boolean).join("-")}function ny(e,t,r){if(!e||!t||!r)return;const n=e.filter(o=>UL(o.title??"")===t).map(o=>o.limits?.[r]);if(n.length===0)return;const i=n.findIndex(o=>String(o??"").trim()!=="0");return i===-1?"0":n[i]}function iy(e,t){if(!e||!e.is_unlimited||t==null)return e;const r=String(t).trim();return r===""||Number(r)!==0?e:{...e,is_unlimited:!1}}var oy={ai:"ai_limit",email_generate:"email_generate_limit",image_generate:"image_generate_limit",preview:"preview_limit",test_sends:"test_sends_limit",link_check:"link_check_limit",image_check:"image_check_limit",spam_check:"spam_check_limit"};function jl(){return!0}function ay(e){const{data:t}=Dm(void 0,{skip:jl()||e});return t}function sy(e){if(e)return{used:e.used??0,base_limit:e.base_limit??0,extra:e.extra??0,total_limit:e.total_limit??0,remaining:e.remaining??0,percent:e.percent??0,is_unlimited:e.is_unlimited??!1}}function BL(){const e=Ve()?.id,{data:t,isSuccess:r}=bl(e,{skip:jl()||!e}),n=ay(!t?.slug);return(0,b.useMemo)(()=>{const i=t?.limits??{},o={};return Object.entries(i).forEach(([a,s])=>{const c=a,l=iy(sy(s),ny(n,t?.slug,oy[c]));l&&(o[c]=l)}),{limits:o,isLoaded:!!r}},[n,t,r])}function $L(){const e=Ve()?.id,[t]=CR(),r=ay(!1);return(0,b.useCallback)(async n=>{if(jl()||!e)return;const i=await t(e,!1);return iy(sy(i.data?.limits?.[n]),ny(r,i.data?.slug,oy[n]))},[r,t,e])}function qL(e){const{limits:t,isLoaded:r}=BL();return Ve(),(0,b.useMemo)(()=>({isLocked:!1,state:{state:"allowed"},isPlanDataReady:r,exceeded:null}),[!1,e,t,r])}var zL=({open:e,onClose:t})=>{const{__:r}=he();return(0,R.jsxs)(B.ui_kit$Modal,{open:e,centered:!0,closable:!1,mask:{closable:!1},footer:null,width:520,className:"browser-extension-warning-modal",title:r("Browser extension detected"),onCancel:t,children:[(0,R.jsx)("p",{children:r("A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.")}),(0,R.jsx)("p",{children:r("We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.")}),(0,R.jsx)("div",{className:"browser-extension-warning-modal__footer",children:(0,R.jsxs)(B.ui_kit$Button,{type:"primary",onClick:t,children:[r("Got it")," "]})})]})},GL={closable:!1},HL=({open:e,onClose:t})=>{const{__:r}=he();return(0,R.jsxs)(B.ui_kit$Modal,{open:e,centered:!0,closable:!1,mask:GL,footer:null,width:520,className:"browser-translate-warning-modal",title:r("Browser translation detected"),children:[(0,R.jsx)("p",{children:r("Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.")}),(0,R.jsx)("p",{children:r("To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.")}),(0,R.jsx)("div",{className:"browser-translate-warning-modal__footer",children:(0,R.jsx)(B.ui_kit$Button,{type:"primary",onClick:t,children:r("Got it")})})]})},VL=C.createIdentifier$1("prewarm.editorVisible");function WL(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function KL(e={}){const t=e.paint??WL;let r=!1,n=!1,i=!1,o=!1,a=!1;const s=[],c=()=>{a||o||!r||!n||!i||(o=!0,t(()=>{a=!0,ke(dt.editorVisible);for(const l of s.splice(0))l()}))};return{noteShellVisible(){r=!0,c()},notePagePainted(){n=!0,c()},noteContentShown(){i=!0,c()},whenVisible(l){if(a){l();return}s.push(l)},contentShown:()=>i}}function Rl(e){return e.getOrCreateInstance(VL,()=>KL())}function ly(e){const t=(0,b.useRef)(!1);return e&&(t.current=!0),t.current}var cy=4e3;function uy(e){const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:cy});return}window.setTimeout(e,cy)}var jo,Nl;function Dl(){return jo===void 0&&(jo=(0,ut.__vitePreload)(()=>Promise.resolve().then(()=>me("./466f98bb.js")).then(e=>e.panels_exports).then(e=>(Nl=e,e),e=>{throw jo=void 0,e}),void 0,{}.url)),jo}function QL(e){(0,b.useEffect)(()=>{Rl(e).whenVisible(()=>{uy(()=>{Dl().catch(()=>{})})})},[e])}function Ae(e){const t=Ao(()=>Dl().then(n=>({default:n[e]})),"panels");function r(n){const[i]=(0,b.useState)(()=>Nl?Nl[e]:t);return(0,b.createElement)(i,n)}return r.displayName=`PanelDoor(${String(e)})`,r}var dy=Ae("EmailProperties"),YL=Ae("SelectedElementPanel"),XL=Ae("EmailSettings"),JL=Ae("EmailStyles"),ZL=Ae("DiscussAi"),eF=Ae("Optimise"),tF=Ae("FileManagerDataLayer"),rF=Ae("BlocksSearch"),nF=Ae("Discuss"),iF=Ae("HistoryPanel"),oF=Ae("AddNewBlockModal"),aF=Ae("AddAllBlocksModal"),sF=Ae("SendTestEmailModal"),lF=Ae("SaveBlockBtn"),cF=Ae("LimitUpgradeModal"),uF={height:"100%"},dF=()=>{const e=Se(),t=bm(at(qs)),[r,n]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{e&&Rl(e).whenVisible(()=>n(!0))},[e]),ly(r||t)?(0,R.jsx)(b.Suspense,{fallback:t?(0,R.jsx)(B.ui_kit$PageLoader,{style:uF}):null,children:(0,R.jsx)(tF,{})}):null},Ro;function fF(){return Ro===void 0&&(Ro=(0,ut.__vitePreload)(()=>Promise.resolve().then(()=>me("./df55e6fd.js")),void 0,{}.url).catch(e=>{throw Ro=void 0,e})),Ro}function Hn(e){return Ao(()=>fF().then(t=>({default:t[e]})),"form-panels")}var sG=Hn("FormEditorCalendarPanel"),lG=Hn("FormEditorCheckboxPanel"),cG=Hn("FormEditorDropdownListPanel"),uG=Hn("FormEditorInputPanel"),dG=Hn("FormEditorRadioPanel");function pF(e,t){const r=xs(It.em_defer_chrome);if(r!==void 0)return r;const n=t?.deferEditorChrome;return typeof n=="boolean"?n:n&&typeof n=="object"?n[e]??!0:{}.REACT_APP_DEFER_EDITOR_CHROME_DEFAULT!=="false"}function mF(e){const t=st(),[r,n]=(0,b.useState)(()=>!pF(e,t));return(0,b.useEffect)(()=>{if(r)return;let i=0;const o=window.requestAnimationFrame(()=>{i=window.requestAnimationFrame(()=>(0,b.startTransition)(()=>n(!0)))});return()=>{window.cancelAnimationFrame(o),window.cancelAnimationFrame(i)}},[r]),r}function hF(e){if(!(e==null||e===""))return e}async function gF(e,t){if(e){if(e.url)return e.url;if(typeof t.getFileById=="function"&&e.id){const r=await t.getFileById(e.id);if(r?.url)return r.url;if(r?.thumbnailUrl)return r.thumbnailUrl;if(r?.thumbnail)return r.thumbnail}if(typeof t.getFileUrl=="function"&&e.folderId!==void 0&&e.name){const r=await t.getFileUrl(e.folderId||"",e.name);if(r)return r}if(typeof t.getUrl=="function"&&e.name){const r=await t.getUrl(e);if(r)return r}return e.thumbnail||e.thumbnailUrl}}function yF(e){if(!(!e?.success||!Array.isArray(e.detailed)))return e.detailed.find(t=>t?.success&&t.data)?.data}function _F(e,t,r){if(e)return{id:e.id,name:e.name||t.name,size:e.size??t.size,type:e.type||t.type,folderId:e.folderId??r??"",url:e.url,thumbnail:e.thumbnail,thumbnailUrl:e.thumbnailUrl,date:e.date,dimensions:e.dimensions,aspectRatio:e.aspectRatio,extension:e.extension,selected:e.selected,isFolder:e.isFolder,lastEdited:e.lastEdited,childrenCount:e.childrenCount}}async function fy(e,t,r){if(!t)return;const n=hF(r??t.rootId);let i;typeof t.uploadFiles=="function"?i=yF(await t.uploadFiles({folderId:n,items:[{name:e.name,size:e.size,type:e.type,folderId:n,data:e}]})):typeof t.uploadFile=="function"&&(i=_F(await t.uploadFile({name:e.name,size:e.size,type:e.type,folderId:n,data:e}),e,n));const o=await gF(i,t);return o?{item:i,url:o}:void 0}function vF(e){for(let t=e.length-1;t>=0;t--){const r=e[t];if(typeof r=="string"&&r)return r}}function bF(e){for(let t=0;t<e.length;t++){const r=e[t];if(r instanceof Blob)return r}}function EF(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(typeof n=="string"&&n&&n!==t)return n}}var wF="Image upload rejected by handleLoadImage";async function py(e,t){const r=e.hasListeners(),n=await e.fireSettled(t);return{url:vF(n.results),hasHostListener:r,hostFailed:n.errors.length>0,error:n.errors[0]}}function my(e,t={}){return e.url||e.hostFailed?!1:t.isStandalone?!(e.hasHostListener||t.targetIsOurBackend):!0}function SF(e){return e?.imageCenterInsertUrlAsIs===!0}function PF(e,t,r){return e?t==="enter"||r?"insertAsIs":"wait":t==="timer"?"upload":"wait"}function hy(e){return e.error instanceof Error&&e.error.message?e.error:typeof e.error=="string"&&e.error?new Error(e.error):new Error(wF)}function gy(e){if(!e)return!1;try{return e.getInstance(C.SECURITY_MODULE_ID)!==void 0}catch{return!1}}function yy(){const e=se();return(0,b.useMemo)(()=>gy(C.getContainer(e)),[e])}var IF=class{http;constructor(e){this.http=e}cache_clear_create=(e,t={})=>this.http.request({path:"/em-files/v1/cache/clear",method:"POST",body:e,type:C.ContentType.UrlEncoded,...t})},TF=class{http;constructor(e){this.http=e}empty_trash_create=(e,t={})=>this.http.request({path:"/em-files/v1/empty-trash",method:"POST",body:e,type:C.ContentType.UrlEncoded,...t})},CF=class{http;constructor(e){this.http=e}files_list=(e,t={})=>this.http.request({path:"/em-files/v1/files",method:"GET",query:e,format:"json",...t});files_create=(e,t={})=>this.http.request({path:"/em-files/v1/files",method:"POST",body:e,type:C.ContentType.UrlEncoded,format:"json",...t});files_delete=(e,t={})=>this.http.request({path:"/em-files/v1/files",method:"DELETE",body:e,type:C.ContentType.UrlEncoded,format:"json",...t});files_partial_update=(e,t={})=>this.http.request({path:"/em-files/v1/files",method:"PATCH",body:e,type:C.ContentType.UrlEncoded,format:"json",...t});files_upload_by_url_create=(e,t={})=>this.http.request({path:"/em-files/v1/files/upload-by-url",method:"POST",body:e,type:C.ContentType.UrlEncoded,format:"json",...t});files_rename_partial_update=(e,t={})=>this.http.request({path:"/em-files/v1/files/rename",method:"PATCH",body:e,type:C.ContentType.UrlEncoded,format:"json",...t})},OF=class{http;constructor(e){this.http=e}folders_list=(e,t={})=>this.http.request({path:"/em-files/v1/folders",method:"GET",query:e,format:"json",...t});folders_create=(e,t={})=>this.http.request({path:"/em-files/v1/folders",method:"POST",body:e,type:C.ContentType.UrlEncoded,format:"json",...t});folders_delete=(e,t={})=>this.http.request({path:"/em-files/v1/folders",method:"DELETE",body:e,type:C.ContentType.UrlEncoded,format:"json",...t})},AF=class{http;constructor(e){this.http=e}items_move_partial_update=(e,t={})=>this.http.request({path:"/em-files/v1/items/move",method:"PATCH",body:e,type:C.ContentType.UrlEncoded,format:"json",...t})},_y=[IF,TF,CF,OF,AF];function vy(e){const t=xs(It.em_filemanager_v2);return t!==void 0?t:e?.fileManagerV2Enabled!==void 0?!!e.fileManagerV2Enabled:!0}var by=(e,t)=>t.some(r=>r instanceof RegExp?r.test(e):r===e),MF=new Set(["https:","http:","file:"]),kF=e=>{const t=e.indexOf(":");if(t<=0)return!1;const r=e.substring(0,t+1);return/^[a-zA-Z][a-zA-Z0-9+\-.]*:$/.test(r)?r.endsWith(":")&&!r.includes(".")&&!MF.has(r):!1};function No(e,t){if(t={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...t},!e)return"";if(Ey(e)&&(e=Ll(e)),typeof t.defaultProtocol=="string"&&!t.defaultProtocol.endsWith(":")&&(t.defaultProtocol=`${t.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e)||kF(e))return e;const r=e.startsWith("//"),n=!r&&/^\.*\//.test(e);let i;try{i=n?new URL(e,typeof document<"u"?document.baseURI:"http://localhost/").toString():e}catch{i=e}let o;try{o=new URL(i)}catch{const s=document.createElement("a");s.href=e,o=new URL(s.href)}if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&o.protocol==="https:"&&(o.protocol="http:"),t.forceHttps&&o.protocol==="http:"&&(o.protocol="https:"),t.stripAuthentication&&(o.username="",o.password=""),t.stripHash?o.hash="":t.stripTextFragment&&(o.hash=o.hash.replace(/#?:~:text.*?$/i,"")),o.pathname){const s=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let c=0,l="";for(;;){const d=s.exec(o.pathname);if(!d)break;const f=d.index,m=o.pathname.slice(c,f);l+=m.replace(/\/{2,}/g,"/"),l+=d[0],c=f+d[0].length}const u=o.pathname.slice(c);l+=u.replace(/\/{2,}/g,"/"),o.pathname=l;try{o.pathname=decodeURI(o.pathname)}catch{}}if(t.removeDirectoryIndex){let s=o.pathname.split("/");const c=s[s.length-1];Array.isArray(t.removeDirectoryIndex)&&by(c,t.removeDirectoryIndex)&&(s=s.slice(0,-1),o.pathname=s.join("/")+"/")}if(t.stripWWW&&/^www\.(?!www\.)[a-z\d\-]+(\.[a-z.\-]{2,63})+$/.test(o.hostname||"")&&(o.hostname=o.hostname.replace(/^www\./,"")),Array.isArray(t.removeQueryParameters))for(const s of[...o.searchParams.keys()])by(s,t.removeQueryParameters)&&o.searchParams.delete(s);if(t.sortQueryParameters){o.searchParams.sort();try{o.search=decodeURIComponent(o.search)}catch{}}t.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,"")),t.removeExplicitPort&&o.port&&(o.port="");let a=o.toString();return!t.removeSingleSlash&&o.pathname==="/"&&!e.endsWith("/")&&o.hash===""&&(a=a.replace(/\/$/,"")),(t.removeTrailingSlash||o.pathname==="/")&&o.hash===""&&t.removeSingleSlash&&(a=a.replace(/\/$/,"")),r&&!t.normalizeProtocol&&(a=a.replace(/^https?:\/\//,"//")),a}function Ey(e){if(!e)return!1;const t=e[0];return e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||jF(t)}function jF(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}function RF(e){return/^(mailto:|tel:|fax:|sms:|geo:|blob:|data:|javascript:)/i.test(e)}function Ll(e){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||!Ey(e)||RF(e))return e;if(e.startsWith("/"))return window.location.origin+e;const t=window.location.href,r=t.lastIndexOf("/");return(r!==-1?t.slice(0,r+1):t+"/")+e}var Fl=null;function wy(){return Fl===null&&(Fl=(0,ut.__vitePreload)(()=>Promise.resolve().then(()=>me("./8a5b1c18.js")).then(e=>e.default),void 0,{}.url)),Fl}async function Sy(e){return(await wy()).getType(e)}async function NF(e){return(await wy()).getExtension(e)}var le=class Kv extends Error{code;status;details;get httpStatus(){return this.status}constructor(t,r,n,i){super(t),this.name="FileManagerApiError",this.code=r,this.status=n,this.details=i,Error.captureStackTrace&&Error.captureStackTrace(this,Kv)}},DF="Edited",LF=1e4;function Do(e,t="BackendError"){switch(e){case 400:return"ValidationError";case 401:return"AuthenticationFailed";case 403:return"AuthorizationFailed";case 404:return"FileNotFound";case 409:return"FolderAlreadyExists";case 413:return"PayloadTooLarge";case 415:return"UnsupportedMediaType";case 429:return"RateLimitExceeded";case 500:return"BackendError";case 503:return"ServiceUnavailable";case 504:return"Timeout";default:return t}}var Py={file_too_large:"FileTooLarge",file_size_exceeded:"FileTooLarge",file_size_limit:"FileTooLarge",invalid_file_name:"FileInvalidName",file_name_invalid:"FileInvalidName",invalid_name:"FileInvalidName",invalid_folder_name:"FolderInvalidName",folder_name_invalid:"FolderInvalidName",folder_invalid_name:"FolderInvalidName",file_type_not_allowed:"FileTypeNotAllowed",unsupported_type:"FileTypeNotAllowed",invalid_format:"FileTypeNotAllowed",batch_limit_exceeded:"BatchItemLimitExceeded",exceeded_max_files:"BatchItemLimitExceeded",file_count_exceeded:"BatchItemLimitExceeded",upload_limit_exceeded:"BatchItemLimitExceeded",too_many_files:"BatchItemLimitExceeded"};function FF(e){if(typeof e=="string")return e;if(e!==null&&typeof e=="object"&&!Array.isArray(e)&&"400x400"in e){const t=e["400x400"];return typeof t=="string"?t:void 0}}function xF(e){const t=e.is_folder;if(t===!0||t===1)return!0;if(t===!1||t===0)return!1;if(typeof t=="string"){const n=t.trim().toLowerCase();if(n==="true"||n==="1"||n==="yes")return!0;if(n==="false"||n==="0"||n==="no"||n==="")return!1}if(String(e.item_type??"").toLowerCase()==="folder")return!0;const r=String(e.type??"").toLowerCase();return!!(r==="folder"||r==="directory"||r==="dir"||r==="inode/directory"||r==="application/x-directory"||r==="httpd/unix-directory"||r.endsWith("/directory"))}function Vn(e){if(!e)return["",""];const t=e.replaceAll("\\","/").split("/").filter(Boolean),r=t.pop()||"";return[t.join("/"),r]}function UF(e,t){if(!e)return"";const r=new RegExp(`^/?${t}/?`);return e.replace(r,"")}function BF(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{const i=n.result.toString().split(",")[1];t(i)},n.onerror=r,n.readAsDataURL(e)})}var $F=class{_api;_projectId;i18n;pathPostfix;appConfig;isStandalone;pathMode=!0;rootId="";trashPath="trash";tempPath=DF;constructor(e){this._api=e.restApi,this._projectId=e.projectId,this.i18n=e.i18n||yo,this.pathPostfix=e.pathPostfix,this.appConfig=e.appConfig,this.isStandalone=!!e.isStandalone}removePrefix(e){let t=UF(e,this._projectId);if(this.pathPostfix){const r=new RegExp(`^/?${this.pathPostfix}/?`);t=t.replace(r,"")}return t}handleError(e,t){const{__:r}=this.i18n;if(e instanceof Error)throw e instanceof le?e:new le(e.message,t||"BackendError");const n=e.data,i=n?.message||r("Unknown error"),o=n?.data?.status??n?.status,a=n?.code,s=t||(a?Py[a]:void 0)||(typeof o=="number"?Do(o):void 0)||"BackendError";throw new le(i,s,o)}convertRestError(e,t){const{__:r}=this.i18n;if(e instanceof le||e instanceof Error)return e;if(e&&typeof e=="object"&&"data"in e&&!(e instanceof Error)){const n=e.data,i=n?.message||r("Unknown error"),o=n?.data?.status??n?.status,a=n?.code;return{message:i,code:t||(a?Py[a]:void 0)||(o?Do(o):void 0)||"BackendError",status:o,raw:e}}return e??{message:r("Unknown error")}}async getFolders({parentId:e}){const t=await this._api.folders_list({project_id:this._projectId,path_folder:e,per_page:LF},{type:C.ContentType.Json});if(t.error){if(this.isPathFolderNotFound(t.error))return[];this.handleError(t.error)}return await t.data.folders.map(r=>({id:this.removePrefix(r.full_path),name:r.name,folderId:this.removePrefix(r.parent_folder),childrenCount:r.files_count+r.folders_count,isFolder:!0}))}async getItems(e){if(e.limit===void 0&&(e.limit=Number.MAX_SAFE_INTEGER),e.itemType==="folder")return{items:await this.getFolders({parentId:e.folderId})};let t;try{t=await this._api.files_list({project_id:this._projectId,path_folder:e.folderId,filter_name:e.search,sort_by:e.sortBy,sort_order:e.sortOrder,per_page:e.limit,page:e.page})}catch(a){if(this.isPathFolderNotFound(a)||a?.status===404)return{items:[],pagination:{limit:e.limit,page:1,total:0,totalPages:0}};throw a}const r=t,n=!r.ok&&r.status===404||this.isPathFolderNotFound(t.error);if(t.error||!r.ok){if(n)return{items:[],pagination:{limit:e.limit,page:1,total:0,totalPages:0}};t.error&&this.handleError(t.error)}const i=t.data;let o=(i?.files||[]).map(a=>{const s=a.thumbnail,c=xF(a);return{...a,id:`${this.removePrefix(a.folder)}/${a.name}`,size:Number(a.size),date:a.date||new Date().toISOString(),folderId:this.removePrefix(a.folder),selected:!1,isFolder:c,thumbnail:FF(s)}});return i.total===Number.MAX_SAFE_INTEGER&&(i.total=o.length),e.itemType==="file"&&(o=o.filter(a=>!a.isFolder)),{items:o,pagination:{limit:i.per_page,page:i.page,total:i.total,totalPages:i.total_pages}}}async getFile(e){const t=await C.fetchWithResourceProxy(C.buildCdnFileUrl(this.appConfig,[this._projectId,e]),{config:this.appConfig,standalone:this.isStandalone,resourceType:"cdn",intent:"downloadBlob"});if(t.ok)return t.blob();{const r=await t.text(),n=Do(t.status,"FileReadError"),{__:i}=this.i18n,o=r||i("Failed to get file: %s").replace("%s",t.statusText);throw new le(o,n,t.status)}}getFileData=async(e,t)=>{const r=e.url||(typeof this.getUrl=="function"?this.getUrl(e):""),n=await C.fetchWithResourceProxy(r,{config:this.appConfig,standalone:this.isStandalone,resourceType:C.isCdnUrl(r,this.appConfig)?"cdn":"generic",intent:"downloadBlob",init:t?.forceReload?{cache:"no-store"}:void 0});if(n.ok)return n.blob();const i=await n.text(),o=Do(n.status,"FileReadError"),{__:a}=this.i18n,s=i||a("Failed to get file: %s").replace("%s",n.statusText);throw new le(s,o,n.status)};isPathFolderNotFound(e){if(!e||typeof e!="object"||e instanceof Error)return!1;const t=e;return t.code==="path_folder_not_found"||t.data?.code==="path_folder_not_found"||t.data?.data?.status===404}async deleteItem(e,t){if(e.isFolder){const r=await this._api.folders_delete({path_folder:e.id,project_id:this._projectId,force:t.permanent},{type:C.ContentType.Json});if(r.error){if(this.isPathFolderNotFound(r.error)){await this.clearCache(e.folderId??void 0);return}this.handleError(r.error,"FolderNotFound")}await this.clearCache(e.folderId??void 0)}else{const r=await this._api.files_delete({project_id:this._projectId,path_folder:e.folderId??"",file_name:[e.name],force:t.permanent},{type:C.ContentType.Json});r.error&&this.handleError(r.error,"FileNotFound")}}async deleteItems(e,t){try{if(e.length===0)return{success:!0};const r=e.filter(i=>i.isFolder),n=e.filter(i=>!i.isFolder);if(r.length>0){const i=new Set(r.map(s=>s.id)),o=r.filter(s=>{const c=s.folderId??"";return!i.has(c)}).map(s=>s.id),a=await this._api.folders_delete({project_id:this._projectId,path_folder:o.length===1?o[0]:o,force:t.permanent},{type:C.ContentType.Json});if(a.error&&!this.isPathFolderNotFound(a.error))return{success:!1,error:this.convertRestError(a.error)};for(const s of r)try{await this.clearCache(s.folderId??void 0)}catch{}}if(n.length>0){const i=new Map;for(const o of n){const a=o.folderId??"";i.has(a)||i.set(a,[]),i.get(a).push(o)}for(const[o,a]of i){const s=await this._api.files_delete({project_id:this._projectId,path_folder:o,file_name:a.map(c=>c.name),force:t.permanent},{type:C.ContentType.Json});if(s.error)return{success:!1,error:this.convertRestError(s.error)}}}return{success:!0}}catch(r){return{success:!1,error:r}}}async createFolder(e,t,r){const{__:n}=this.i18n;if(!e)throw new le(n("Folder name is required"),"FolderInvalidName");const i=await this._api.folders_create({name:e,project_id:this._projectId,path_folder:t,is_force_create:r},{type:C.ContentType.Json});return i.error&&this.handleError(i.error),{id:this.removePrefix(i.data.full_path),name:i.data.name,folderId:this.removePrefix(i.data.parent_folder),childrenCount:i.data.files_count|i.data.folders_count,isFolder:!0}}async _uploadFile(e){const{__:t}=this.i18n;if(!e.name||!e.data)throw new le(t("Invalid file data"),"ValidationError");const r=await this._api.files_create({file:e.data instanceof File?e.data:new File([e.data],e.name,{type:e.type}),path_folder:e.folderId,project_id:this._projectId},{type:C.ContentType.FormData});r.error&&this.handleError(r.error);const n=r.data instanceof Array?r.data[0]:r.data;if(!n)throw new le(t("File upload failed"),"ValidationError");return{...n,id:this.removePrefix(n.folder)+"/"+n.name,size:Number(n.size),folderId:this.removePrefix(n.folder),date:n.date||new Date().toISOString(),selected:!1,isFolder:!1,thumbnail:n.thumbnail?.["400x400"]}}async uploadFiles(e){try{const t=e.items.map(n=>{if(n.data instanceof File)return n.data;const i=n.name||"file",o=n.data.type||n.type||"application/octet-stream";return new File([n.data],i,{type:o})}),r=await this._api.files_create({project_id:this._projectId,path_folder:e.folderId,file:t},{type:C.ContentType.FormData});return r.error?{success:!1,error:this.convertRestError(r.error)}:{success:!0,detailed:(Array.isArray(r.data)?r.data:[r.data]).map(n=>({success:!0,data:{id:[this.removePrefix(n.folder),n.name].filter(Boolean).join("/"),name:n.name,size:Number(n.size),folderId:this.removePrefix(n.folder),type:n.type,date:n.date||new Date().toISOString(),selected:!1,isFolder:!1,thumbnail:n.thumbnail?.["400x400"]}}))}}catch(t){return{success:!1,error:t}}}async renameItem(e,t){const{__:r}=this.i18n;if(!t){const s=e.isFolder?"FolderInvalidName":"FileInvalidName",c=e.isFolder?r("New folder name is required"):r("New file name is required");throw new le(c,s)}const[n,i]=Vn(e.id),o=await this._api.files_rename_partial_update({file_name:i,new_name:t,path_folder:n,project_id:this._projectId,is_folder:e.isFolder},{type:C.ContentType.Json});o.error&&this.handleError(o.error);const a=o.data;return{id:this.removePrefix(a.folder)+"/"+a.name,name:a.name,folderId:this.removePrefix(a.folder)}}async moveItems(e,t){try{const r=e.map(i=>Vn(i.id)),n=await this._api.items_move_partial_update({file_name:r.map(i=>i[1]),target_folder:t,path_folder:r[0][0],project_id:this._projectId},{type:C.ContentType.Json});return n.error?{success:!1,error:this.convertRestError(n.error)}:{success:!0,detailed:n.data.results.map(i=>({success:i.success,error:this.convertRestError(i.error),data:{id:[this.removePrefix(i.new_path||""),i.item_name].filter(o=>o).join("/")}}))}}catch(r){return this.convertRestError(r),{success:!1,error:r}}}async copyItem(e,t){const[r,n]=Vn(e.id),i=await this._api.items_move_partial_update({file_name:n,target_folder:t,path_folder:r,project_id:this._projectId,is_copy:!0},{type:C.ContentType.Json});return i.error&&this.handleError(i.error),{id:[t,n].filter(o=>o).join("/")}}async copyItems(e,t){try{const r=e.map(i=>Vn(i.id)),n=await this._api.items_move_partial_update({file_name:r.map(i=>i[1]),target_folder:t,path_folder:r[0][0],project_id:this._projectId,is_copy:!0},{type:C.ContentType.Json});return n.error?{success:!1,error:this.convertRestError(n.error)}:{success:!0,detailed:n.data.results.map((i,o)=>({success:i.success,error:this.convertRestError(i.error),requestId:e[o].id,data:{id:[this.removePrefix(i.new_path||""),i.item_name].filter(a=>a).join("/")}}))}}catch(r){return{success:!1,error:this.convertRestError(r)}}}async uploadFileByUrl(e,t,r){const n=Ll(e);try{if(n.startsWith("http://localhost")||n.startsWith("https://localhost")||this.appConfig?.resourceProxy||this.isStandalone){const a=await(await C.fetchWithResourceProxy(n,{config:this.appConfig,standalone:this.isStandalone,resourceType:r?.eventSource==="imageStock"?"stockImages":"generic",intent:"downloadBlob"})).blob();return this._uploadFile({name:n.split("/").pop()||"file",size:a.size,folderId:t,data:a,type:await Sy(n)||"application/octet-stream"})}const i=await this._api.files_upload_by_url_create({url:n,path_folder:t,project_id:this._projectId},{type:C.ContentType.Json});i.error&&this.handleError(i.error);const o=i.data instanceof Array?i.data[0]:i.data;return{id:`${this.removePrefix(o.folder)}/${o.name}`,name:o.name,size:Number(o.size),type:o.type,folderId:this.removePrefix(o.folder)||null,date:o.date||new Date().toISOString(),url:o.url}}catch(i){throw i}}async updateFile(e,t){const[r,n]=Vn(e.id),i=await this._api.files_partial_update({file_name:n,project_id:this._projectId,path_folder:r,updates:{data:typeof t.data=="string"?t.data:await BF(t.data),name:t.name}},{type:C.ContentType.Json});if(i.error)this.handleError(i.error);else{const o=i.data;return{...o,id:`${this.removePrefix(o.folder)}/${o.name}`,size:Number(o.size),folderId:this.removePrefix(o.folder),date:o.date||new Date().toISOString(),thumbnail:o.thumbnail?.["400x400"],selected:!1}}}findFileByUrl(e,t){const r=C.unwrapResourceProxyUrl(e,this.appConfig),n=C.buildCdnFileUrl(this.appConfig,[]);if(n&&No(r).startsWith(No(n))){const i=r.replace(No(n)+"/","").split("/").filter(Boolean);if(i[0]===this._projectId){const o=this.removePrefix(i.slice(1,-1).join("/")),a=i[i.length-1];if(!t||o===this.removePrefix(t))return{id:[o,a].filter(Boolean).join("/"),name:a,folderId:o,isFolder:!1,url:r}}}}async clearCache(e){const t={project_id:this._projectId,path_folder:e||void 0},r=await this._api.cache_clear_create(t);r.error&&this.handleError(r.error)}getUrl=e=>C.buildCdnFileUrl(this.appConfig,[this._projectId,this.pathPostfix,e.folderId,e.name]);getThumbnailUrl=e=>{const t=e.name.lastIndexOf("."),r=t>0?e.name.slice(0,t):e.name,n=t>0?e.name.slice(t+1):"";return C.buildCdnFileUrl(this.appConfig,[this._projectId,this.pathPostfix,".thumbs",e.folderId,r,r+"-400x400."+n])};async cleanTrash(){try{const e=await this._api.empty_trash_create({project_id:this._projectId},{type:C.ContentType.UrlEncoded});e.error&&this.handleError(e.error,"BackendError");const t=e.data;return{success:t?.success??!0,deletedCount:t?.deleted_count??0}}catch(e){if(e instanceof le)throw e;const{__:t}=this.i18n;throw new le(t("Failed to clean trash"),"BackendError")}}},z=class Qv extends Error{constructor(t,r,n,i){super(t),this.code=r,this.status=n,this.details=i,this.name="FileManagerApiError",Error.captureStackTrace&&Error.captureStackTrace(this,Qv)}},Wn="",Br=class{constructor(){this.map=new Map}static childrenViewKey(e,t){return`v${Wn}${e}${Wn}${t}`}static childrenCountKey(e){return`c${Wn}${e}`}getFreshError(e,t){let r=this.map.get(e);return r?t!==1/0&&Date.now()-r.updatedAt>t?(this.map.delete(e),null):r.error:null}setError(e,t){this.map.set(e,{error:t,updatedAt:Date.now()})}delete(e){this.map.delete(e)}clearChildrenViewErrorsForParent(e){let t=`v${Wn}${e}${Wn}`;for(let r of[...this.map.keys()])r.startsWith(t)&&this.map.delete(r)}clearAll(){this.map.clear()}},qF=class{constructor(){this.deletingIds=new Set}beginDeleting(e){for(let t of e)t&&this.deletingIds.add(t)}endDeleting(e){for(let t of e)t&&this.deletingIds.delete(t)}isDeleting(e){return!!e&&this.deletingIds.has(e)}};function Iy(e){return{sortBy:e?.sortBy??"name",sortOrder:e?.sortOrder==null?e?.sortBy!=null&&e.sortBy!==""?"desc":"asc":e.sortOrder==="desc"?"desc":"asc"}}function Ty(e,t,r){let{sortBy:n,sortOrder:i}=Iy(r),o=0;switch(n){case"name":o=(e.name||"").localeCompare(t.name||"");break;case"date":o=new Date(e.date||0).getTime()-new Date(t.date||0).getTime();break;case"size":o=(Number(e.size)||0)-(Number(t.size)||0);break;case"type":o=(e.extension||e.type||"").toLowerCase().localeCompare((t.extension||t.type||"").toLowerCase());break;default:o=(e.name||"").localeCompare(t.name||"")}return i==="desc"?-o:o}function Lo(e){return e!=null&&String(e).trim()!==""}function zF(e,t){let{sortBy:r}=Iy(t);switch(r){case"date":return Lo(e.date)?!Number.isNaN(new Date(e.date).getTime()):!1;case"size":return e.size!=null&&Number.isFinite(Number(e.size));case"type":return Lo(e.extension)||Lo(e.type);default:return Lo(e.name)}}function GF(e,t){let r=typeof t?.search=="string"?t.search.trim():"";if(!r)return!0;let n=r.toLowerCase();return(e.name?.toLowerCase().includes(n)??!1)||(e.type?.toLowerCase().includes(n)??!1)||(e.extension?.toLowerCase().includes(n)??!1)}var HF=Ty,VF=GF,WF=zF;function Cy(e={}){return{...e,comparator:e.comparator??HF,filterMatch:e.filterMatch??VF,hasSortValue:e.hasSortValue??WF}}var tt="Trash";function Ue(e){return e.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"")}function Oy(e,t,r=tt){let n=Ue(e);if(!n)return[];let i=[e,n];if(n===Ue(t)){i.push(t);let o=Ue(t);o==="Trash"||o.toLowerCase()==="trash"?i.push(r,tt,tt.toLowerCase()):r!=="Trash"&&Ue(r)!==o&&i.push(r)}return Array.from(new Set(i.map(Ue).filter(Boolean)))}function KF(e){let t=new Map;for(let[r,n]of Object.entries(e))n.id&&t.set(Ue(r),n);return r=>{let n=t.get(Ue(r));if(n)return{id:n.id,name:n.name??n.id,folderId:n.folderId??null,isFolder:!0}}}function Me(){if(typeof globalThis?.crypto?.randomUUID=="function")return globalThis.crypto.randomUUID();try{let e=globalThis.crypto||globalThis.msCrypto;if(e&&typeof e.getRandomValues=="function"){let t=new Uint8Array(16);e.getRandomValues(t);let r="";for(let n=0;n<t.length;n++)r+=t[n].toString(16).padStart(2,"0");return`id_${r}`}}catch{}return`id_fallback_${Date.now().toString(36)}_${Math.floor(Math.random()*(2**53-1)).toString(36).slice(0,8)}`}var QF=/^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;function Ay(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function YF(e){let t=new URL(e.trim());t.hash="",t.hostname=t.hostname.toLowerCase(),(t.protocol==="https:"&&t.port==="443"||t.protocol==="http:"&&t.port==="80")&&(t.port="");let r=(t.search.startsWith("?")?t.search.slice(1):t.search).split("&").filter(Boolean).map(n=>{let i=n.indexOf("="),o=i===-1?n:n.slice(0,i),a=i===-1?"":n.slice(i+1);return{pair:n,key:Ay(o),value:Ay(a)}}).filter(({key:n})=>!QF.test(n)).sort((n,i)=>{let o=n.key.localeCompare(i.key);return o===0?n.value.localeCompare(i.value):o});return t.search=r.length?`?${r.map(({pair:n})=>n).join("&")}`:"",t.toString()}function My(e){try{return YF(e)}catch{return e.trim()}}var ky="",xl=18e5;function Ee(e){return e==null||e===""?ky:e}function Ul(e){if(e==null)return 1/0;let t=Number(e);return Number.isFinite(t)&&t>=0?t:1/0}function XF(e){return!e||typeof e.search!="string"?!1:e.search.trim().length>0}function Be(e){if(!e)return null;let t=e.folderId;return t==null?null:String(t)}function oe(e){return!!e&&!!e.isFolder}function jy(e){if(!e||typeof e!="object")return!1;let t=e;return t.code==="path_folder_not_found"||t.code==="folder_not_found"||t.code==="FolderNotFound"||t.data?.code==="path_folder_not_found"||t.data?.code==="folder_not_found"||t.status===404||t.data?.data?.status===404}function JF(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t.toString(36)}function rt(e){if(!e||typeof e!="object")return String(e??"");let t=e,r=[],n={},i=["page","pageSize","sortBy","sortOrder","search","itemType","limit"];for(let c of Object.keys(t).sort()){let l=t[c];i.includes(c)?r.push(`${c}=${String(l??"")}`):n[c]=l}let o=Object.keys(n).length?JSON.stringify(n):"",a=r.join("|"),s=o?JF(o):"";return`${a}${s?`|${s}`:""}`}var Ry=class Yv{constructor(){this.entities=new Map,this.childrenByParent=new Map,this.maxCacheSize=1e4}now(){return Date.now()}checkCacheSize(){if(this.entities.size>this.maxCacheSize){let t=Array.from(this.entities.entries()).sort((n,i)=>n[1].updatedAt-i[1].updatedAt),r=Math.floor(this.maxCacheSize*.1);for(let n=0;n<r&&n<t.length;n++){let[i,o]=t[n];this.deleteEntityById(i)}}}getEntity(t){return this.entities.get(t)?.value}getRecord(t){return this.entities.get(t)}getFileSystemItem(t){let r=this.getEntity(t);return r&&!oe(r)?r:void 0}getFolder(t){let r=this.getEntity(t);return r&&oe(r)?r:void 0}getChildrenIds(t,r={}){let n=Ee(t),i=this.childrenByParent.get(n);return i?r.onlyFileSystemItems?Array.from(i.files):r.onlyFolders?Array.from(i.folders):[...Array.from(i.folders),...Array.from(i.files)]:[]}searchByUrl(t){let r=My(t);for(let n of this.entities.values()){let i=n.value.url;if(i&&(i===t||My(i)===r))return n.value}return null}upsertEntity(t){let r=this.entities.get(t.id)??null,n=r?r.value:null,i=n?Be(n):null,o=Be(t),a=n?oe(n):!1,s=oe(t),c;if(n&&oe(n)&&s){let f=n.childrenCount,m=t.childrenCount;f!==void 0&&m===void 0&&(c=f)}if(n&&(i!==o||a!==s)){let f=Ee(i),m=this.childrenByParent.get(f);m&&(a?m.folders.delete(t.id):m.files.delete(t.id),m.files.size===0&&m.folders.size===0&&this.childrenByParent.delete(f))}let l=t;c!==void 0&&(l={...t,childrenCount:c}),this.entities.set(t.id,{value:{...l},updatedAt:this.now()}),this.checkCacheSize();let u=Ee(o),d=this.childrenByParent.get(u);d||(d={files:new Set,folders:new Set},this.childrenByParent.set(u,d)),s?d.folders.add(t.id):d.files.add(t.id)}updateServerChildrenCount(t,r){if(t==null||r==null||Number.isNaN(r))return;let n=this.entities.get(t);if(!n||!oe(n.value))return;let i={...n.value,childrenCount:r};this.entities.set(t,{value:i,updatedAt:this.now()})}deleteEntityById(t){let r=this.entities.get(t)??null;if(!r)return{entity:null,parentId:null};let n=r.value,i=Be(n),o=Ee(i),a=this.childrenByParent.get(o);return a&&(oe(n)?a.folders.delete(t):a.files.delete(t),a.files.size===0&&a.folders.size===0&&this.childrenByParent.delete(o)),this.entities.delete(t),{entity:{...n},parentId:i}}deleteFolderRecursive(t){let r=this.entities.get(t);if(!r||!oe(r.value))return{deletedFolderRecords:[],deletedFileSystemItemRecords:[]};let n=[{id:t,parentId:Be(r.value)}],i=[],o=[];for(;n.length;){let c=n.shift();i.push(c);let l=this.childrenByParent.get(Ee(c.id));if(l){for(let u of Array.from(l.folders)){let d=this.entities.get(u);d&&n.push({id:u,parentId:Be(d.value)})}for(let u of Array.from(l.files))o.push(u)}}let a=[];for(let c of o){let l=this.entities.get(c);if(!l)continue;let u=l.value,d=Ee(Be(u)),f=this.childrenByParent.get(d);f&&(f.files.delete(c),f.files.size===0&&f.folders.size===0&&this.childrenByParent.delete(d)),this.entities.delete(c),a.push({...u})}let s=[];for(let c=i.length-1;c>=0;c--){let{id:l,parentId:u}=i[c],d=this.entities.get(l);if(!d)continue;let f=d.value,m=Ee(f.id);this.childrenByParent.delete(m);let g=Ee(u),h=this.childrenByParent.get(g);h&&(h.folders.delete(l),h.files.size===0&&h.folders.size===0&&this.childrenByParent.delete(g)),this.entities.delete(l),s.push({...f})}return{deletedFolderRecords:s,deletedFileSystemItemRecords:a}}moveEntityById(t,r){let n=this.entities.get(t)??null;if(!n)return null;let i=n.value,o=Ee(Be(i)),a=this.childrenByParent.get(o);a&&(oe(i)?a.folders.delete(t):a.files.delete(t),a.files.size===0&&a.folders.size===0&&this.childrenByParent.delete(o));let s={...i,folderId:r};if(oe(i)&&oe(s)){let u=i.childrenCount;u!==void 0&&(s.childrenCount=u)}this.entities.set(t,{value:s,updatedAt:this.now()});let c=Ee(r),l=this.childrenByParent.get(c);return l||(l={files:new Set,folders:new Set},this.childrenByParent.set(c,l)),oe(s)?l.folders.add(t):l.files.add(t),{...s}}copyFileSystemItem(t,r,n){let i=this.entities.get(t)??null;if(!i||oe(i.value))return null;let o={...i.value,id:r,folderId:n};return this.upsertEntity(o),{...o}}copyFolderShallow(t,r,n){let i=this.entities.get(t)??null;if(!i||!oe(i.value))return null;let o={...i.value,id:r,folderId:n};return this.upsertEntity(o),{...o}}isEntityStale(t,r){let n=this.entities.get(t)??null;return!n||r!==1/0&&this.now()-n.updatedAt>r}touch(t,r){let n=this.entities.get(t);n&&(n.updatedAt=r??this.now())}getEntitiesByIds(t){return t.map(r=>this.entities.get(r)?.value??null)}searchByName(t,r){if(!t||t.trim()==="")return[];let n=r?.parentId,i=r?.recursive??!1,o=r?.itemType??"all",a=r?.caseSensitive??!1,s=r?.limit??1/0,c=a?t.trim():t.trim().toLowerCase(),l=[],u=null;if(n!==void 0){u=new Set;let d=Ee(n);if(u.add(d),i){let f=[d],m=new Set;for(;f.length>0;){let g=f.shift();if(m.has(g))continue;m.add(g);let h=this.childrenByParent.get(g);if(h)for(let E of h.folders)u.add(E),f.push(E)}}}for(let[,d]of this.entities){if(l.length>=s)break;let f=d.value;if(u!==null){let g=Ee(Be(f));if(!u.has(g))continue}if(o==="file"&&oe(f)||o==="folder"&&!oe(f))continue;let m=f.name??"";(a?m:m.toLowerCase()).includes(c)&&l.push({...f})}return l}toJSON(){return{entities:Array.from(this.entities.entries()),childrenByParent:Array.from(this.childrenByParent.entries()).map(([t,r])=>[t,{files:Array.from(r.files),folders:Array.from(r.folders)}])}}static fromJSON(t){let r=new Yv;for(let[n,i]of t.entities??[])r.entities.set(n,{value:i.value,updatedAt:i.updatedAt});for(let[n,i]of t.childrenByParent??[])r.childrenByParent.set(n,{files:new Set(i.files),folders:new Set(i.folders)});return r}},Ny=class Xv{constructor(t={},r=xl,n,i,o=new Br,a=jy){this.views=new Map,this.maxViewsPerParent=50;let s=Cy(t);this.strategy={allowSortedInsert:s.allowSortedInsert??!0,allowSearchInsert:s.allowSearchInsert??!0,invalidateOnPaginationFull:s.invalidateOnPaginationFull??!0,preloadPagesBefore:s.preloadPagesBefore??0,preloadPagesAfter:s.preloadPagesAfter??1,comparator:s.comparator,filterMatch:s.filterMatch,hasSortValue:s.hasSortValue},this.ttl=r,this.errorTtl=n??r,this.entityTtl=i??r,this.failedRequests=o,this.isFolderNotFoundError=a}setServerChildrenCountHandler(t){this.serverChildrenCountHandler=t}setChildrenCountInvalidator(t){this.childrenCountInvalidator=t}now(){return Date.now()}parentKey(t){return Ee(t??null)}isExpired(t){return t==null||this.ttl!==1/0&&this.now()-t>this.ttl}areEntitiesStale(t,r){return!t||t.some(n=>!r.getEntity(n)||r.isEntityStale(n,this.entityTtl))}isEntityTypeCompatible(t,r){return!!(!r||r==="all"||r==="file"&&!oe(t)||r==="folder"&&oe(t))}markViewStaleForReload(t){t.view.meta={...t.view.meta??{},stale:!0},t.view.updatedAt=this.now(),t.view.loadId=Me(),t.view.abortController&&(t.view.abortController.abort(),t.view.abortController=void 0)}cleanupOldViews(t){if(t.size<=this.maxViewsPerParent)return;let r=Array.from(t.entries()).sort((n,i)=>(i[1].view.updatedAt||0)-(n[1].view.updatedAt||0));for(;t.size>this.maxViewsPerParent&&r.length>0;){let[n]=r.pop();t.delete(n)}}async getOrCreateChildren(t,r,n,i){let o=this.parentKey(t),a=rt(r??{}),s=this.views.get(o);s||(s=new Map,this.views.set(o,s));let c=Br.childrenViewKey(o,a),l=s.get(a);l||(l={params:r,view:{promise:null,value:void 0,meta:void 0,updatedAt:0,loadId:null}},s.set(a,l),this.cleanupOldViews(s));let u=this.failedRequests.getFreshError(c,this.errorTtl);if(u!=null)throw u;if(l.view.value&&!this.isExpired(l.view.updatedAt)&&!this.areEntitiesStale(l.view.value,i)&&!l.view.meta?.stale){let m=l.view.value.map(h=>i.getEntity(h)).filter(Boolean),g=l.params?.itemType||"all";return{items:m.filter(h=>this.isEntityTypeCompatible(h,g)),...l.view.meta??{}}}if(l.view.promise)return l.view.promise;let d=Me();l.view.loadId=d;let f=(async()=>{try{let m=await n(t,r),g=XF(r),h=g?{...m,total:void 0}:m,E=this.views.get(o)?.get(rt(r));if(!E||E.view.loadId!==d){let P=Error("StaleLoad");throw P.name="StaleLoad",P}for(let P of h.items)i.upsertEntity(P);l.view.value=h.items.map(P=>P.id);let{items:S,...T}=h,w={...T};l.view.meta=w,l.view.meta&&(l.view.meta.stale=!1),this.failedRequests.delete(c),l.view.updatedAt=this.now(),!g&&typeof w.total=="number"&&(this.serverChildrenCountHandler?this.serverChildrenCountHandler(t??null,w.total,i):i.updateServerChildrenCount(t,w.total));let y=this.strategy.preloadPagesAfter??0,I=this.strategy.preloadPagesBefore??0,_=Ul(r?.pageSize);if((y>0||I>0)&&Number.isFinite(_)){let P=t,v={...r},M=typeof w.totalPages=="number"?w.totalPages:1,j=r?.page??1,A=_,k=n,D=d;setTimeout(()=>{this.preloadPagesAsync(P,v,j,M,A,y,I,i,w,k,D)},0)}return h}catch(m){if(m?.name==="StaleLoad")throw this.failedRequests.delete(c),l.view.value=void 0,l.view.updatedAt=this.now(),m;if(this.isFolderNotFoundError(m))return this.failedRequests.delete(c),l.view.value=[],l.view.meta={total:0,totalPages:0},l.view.updatedAt=this.now(),{items:[],total:0,totalPages:0};throw this.failedRequests.setError(c,m),l.view.value=void 0,l.view.updatedAt=this.now(),m}finally{l.view.promise=null}})();return l.view.promise=f,f}async preloadPagesAsync(t,r,n,i,o,a,s,c,l,u,d){try{let f=this.parentKey(t),m=this.views.get(f);if(!m)return;let g=m.get(rt(r));if(!g||d!=null&&g.view.loadId!==d)return;let h=m.get(rt(r));if(!h?.view.meta)return;let E=typeof h.view.meta.totalPages=="number"?h.view.meta.totalPages:1;if(E!==i)return;let S=async T=>{let w={...r,page:T};try{let y=await u(t,w),I=this.views.get(f);if(!I)return;let _=I.get(rt(r));if(!_||d!=null&&_.view.loadId!==d||_.view.loadId!==d)return;for(let M of y.items)c.upsertEntity(M);let P=rt(w),v=I.get(P);if(v||(v={params:w,view:{promise:null,value:void 0,meta:void 0,updatedAt:0,loadId:_.view.loadId}},I.set(P,v),this.cleanupOldViews(I)),!v.view.value||this.isExpired(v.view.updatedAt)){v.view.value=y.items.map(A=>A.id);let{items:M,...j}=y;v.view.meta={...j,page:T,totalPages:E},v.view.updatedAt=this.now()}}catch{}};if(a>0&&n<E)for(let T=1;T<=Math.min(a,E-n);T++){let w=n+T,y=rt({...r,page:w}),I=m.get(y);(!I?.view.value||this.isExpired(I.view.updatedAt))&&S(w)}if(s>0&&n>1)for(let T=1;T<=Math.min(s,n-1);T++){let w=n-T,y=rt({...r,page:w}),I=m.get(y);(!I?.view.value||this.isExpired(I.view.updatedAt))&&S(w)}}catch{}}removeEmptyPageIfNeeded(t,r,n,i,o){if(r.view.value&&r.view.value.length===0&&n<i){let a=rt({...o,page:n});t.delete(a)}}updateTotalPagesForAllViews(t,r){for(let[,n]of t)n.view.meta&&(n.view.meta.totalPages=r)}isParamsSame(t,r){let n=Object.keys(t??{}).filter(o=>o!=="page").sort(),i=Object.keys(r??{}).filter(o=>o!=="page").sort();if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++){let a=n[o];if(a!==i[o]||t[a]!==r[a])return!1}return!0}syncTotalsInSameViews(t,r){let n=r.view.meta;if(!n||typeof n.total!="number")return;let i=Number(n.total),o=Ul(r.params?.pageSize),a=Number.isFinite(o)&&o>0?Math.max(1,Math.ceil(i/o)):void 0;for(let[,s]of t)this.isParamsSame(s.params??{},r.params??{})&&(s.view.meta||(s.view.meta={}),s.view.meta.total=i,a!==void 0&&(s.view.meta.totalPages=a))}cascadeShiftPages(t,r,n,i,o,a,s){let c=r,l=n,u=!1,d=0;for(;c.view.value&&c.view.value.length<i&&l<o&&d<100;){d++;let f=rt({...s,page:l+1}),m=t.get(f);if(!m?.view.value||this.isExpired(m.view.updatedAt)){c.view.meta={...c.view.meta??{},stale:!0};break}let g=i-c.view.value.length,h=m.view.value.slice(0,g).filter(E=>a.getEntity(E));if(h.length===0){c.view.meta={...c.view.meta??{},stale:!0};break}if(c.view.value=[...c.view.value,...h],c.view.updatedAt=Date.now(),m.view.value=m.view.value.slice(h.length),m.view.updatedAt=Date.now(),m.view.value.length===0){let E=l+1,S=m.view.meta;if(E<(S&&typeof S.totalPages=="number"?S.totalPages:1)){let T=rt({...s,page:E});t.delete(T),u=!0}break}c=m,l++}return(!c.view.value||c.view.value.length<i)&&l>=o&&(c.view.meta={...c.view.meta??{},stale:!0}),u}cascadeShiftToNextPage(t,r,n,i,o,a,s){if(!r.view.value||r.view.value.length<=i)return!1;if(n-(s.page||1)>=10)return r.view.meta={...r.view.meta??{},stale:!0},!1;let c={...s,page:n+1},l=rt(c),u=t.get(l),d=!1;if(!u?.view.value||this.isExpired(u.view.updatedAt))if(n>=o){u={params:c,view:{promise:null,value:void 0,meta:void 0,updatedAt:0,loadId:null}},t.set(l,u),this.cleanupOldViews(t);let g=r.view.meta;g&&(u.view.meta={...g,page:n+1}),d=!0}else return r.view.meta={...r.view.meta??{},stale:!0},!1;let f=r.view.value.slice(i).filter(g=>a.getEntity(g));if(f.length===0)return d&&t.delete(l),!1;r.view.value=r.view.value.slice(0,i),r.view.updatedAt=Date.now(),u.view.value=[...f,...u.view.value??[]],u.view.updatedAt=Date.now();let m=u.view.meta&&typeof u.view.meta.totalPages=="number"?u.view.meta.totalPages:o;if(!d&&this.cascadeShiftToNextPage(t,u,n+1,i,m,a,s))return!0;if(!u.view.value||u.view.value.length===0){let g=n+1,h=u.view.meta,E=h&&typeof h.totalPages=="number"?h.totalPages:1;this.removeEmptyPageIfNeeded(t,u,g,E,s)}return d}canCompareInSortedView(t,r){let n=t.params??{};return!n.sortBy&&!n.sortOrder||!this.strategy.hasSortValue||this.strategy.hasSortValue(r,t.params)}tryInsertSorted(t,r,n){let i=this.strategy.comparator;if(!i||!t.view.value)return!1;let o=t.params?.itemType||"all";if(!this.isEntityTypeCompatible(r,o)||!this.canCompareInSortedView(t,r))return!1;let a=t.view.value.map(l=>n.getEntity(l));if(a.some(l=>!l))return!1;if(a.length===0){let l=t.params??{};if(l.sortBy||l.sortOrder){let u=i(r,r,t.params);if(typeof u!="number"||Number.isNaN(u))return!1}return t.view.value.includes(r.id)?(t.view.updatedAt=this.now(),!0):(t.view.value=[r.id],t.view.updatedAt=this.now(),!0)}let s=0,c=a.length;for(;s<c;){let l=Math.floor((s+c)/2),u=i(r,a[l],t.params);if(typeof u!="number"||Number.isNaN(u))return!1;u>=0?s=l+1:c=l}return t.view.value.includes(r.id)?(t.view.updatedAt=this.now(),!0):(t.view.value=[...t.view.value.slice(0,s),r.id,...t.view.value.slice(s)],t.view.updatedAt=this.now(),!0)}updateChildrenCountForOperation(t,r,n,i){let o=Be(r);switch(t){case"delete":this.adjustChildrenCount(i,o,-1),this.childrenCountInvalidator?.(o);break;case"insert":case"copy":this.adjustChildrenCount(i,o,1),this.childrenCountInvalidator?.(o);break;case"move":this.adjustChildrenCount(i,n??null,-1),this.adjustChildrenCount(i,o,1),this.childrenCountInvalidator?.(n??null),this.childrenCountInvalidator?.(o)}}adjustChildrenCount(t,r,n){if(!r)return;let i=t.getFolder(r);if(i&&typeof i.childrenCount=="number"){let o=Math.max(0,i.childrenCount+n);t.updateServerChildrenCount(r,o)}}smartInvalidateChildrenViews(t,r,n,i,o,a){if(!r)return;this.updateChildrenCountForOperation(n,r,o,i);let s=this.parentKey(t),c=this.views.get(s);if(c)for(let[,l]of c){let u=l.params??{},d=u?.page??1,f=Ul(u?.pageSize),m=Number.isFinite(f),g=!!(u?.sortBy||u?.sortOrder),h=!!u?.search,E=u?.itemType||"all";if(this.isEntityTypeCompatible(r,E)){if(h&&this.strategy.filterMatch&&!this.strategy.filterMatch(r,l.params)){l.view.value?.includes(r.id)&&(l.view.value=l.view.value.filter(S=>S!==r.id),l.view.meta&&typeof l.view.meta.total=="number"&&(l.view.meta.total=Math.max(0,l.view.meta.total-1)),this.markViewStaleForReload(l));continue}if(!l.view.value){l.view.meta&&(l.view.meta.stale=!0),l.view.loadId=Me(),l.view.abortController&&(l.view.abortController.abort(),l.view.abortController=void 0);continue}if(l.view.value.includes(r.id),this.shouldInvalidateCompletely(l,n,r,g,m,d)){this.markViewStaleForReload(l);continue}switch(n){case"delete":this.handleDelete(c,l,d,f,m,r,i);break;case"insert":case"copy":this.handleInsert(c,l,d,f,m,g,r,i);break;case"update":this.handleUpdate(c,l,d,f,m,g,h,r,i);break;case"move":this.handleMove(c,l,d,f,m,g,r,o,i)}}}}shouldInvalidateCompletely(t,r,n,i,o,a){return!!(o&&a>1&&(r==="insert"||r==="delete"||r==="move")||this.isExpired(t.view.updatedAt))}tryReinsertEntity(t,r,n,i,o){let a=t.params?.itemType||"all";if(!this.isEntityTypeCompatible(r,a))return!1;let s=t.params??{};return this.strategy.filterMatch(r,s)?this.tryInsertSorted(t,r,n)?!0:s.sortBy||s.sortOrder?!1:!i||t.view.value.length<o?(t.view.value.push(r.id),!0):!1:!1}handleDelete(t,r,n,i,o,a,s){let c=r.view.value.includes(a.id);if(c&&(r.view.value=r.view.value.filter(l=>l!==a.id)),r.view.meta&&typeof r.view.meta.total=="number"){if(r.view.meta.total=Math.max(0,r.view.meta.total-1),o&&Number.isFinite(i)&&typeof r.view.meta.total=="number"){let l=i;l>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/l)))}this.syncTotalsInSameViews(t,r)}if(r.view.updatedAt=Date.now(),c&&o&&r.view.value.length<i&&s){let l=r.view.meta,u=l&&typeof l.totalPages=="number"?l.totalPages:1;if(this.cascadeShiftPages(t,r,n,i,u,s,r.params??{})&&r.view.meta&&typeof r.view.meta.totalPages=="number"){let d=Math.max(1,r.view.meta.totalPages-1);r.view.meta.totalPages=d,this.updateTotalPagesForAllViews(t,d)}}r.view.loadId=Me(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0)}handleInsert(t,r,n,i,o,a,s,c){if(!r.view.value.includes(s.id)){if(a&&this.strategy.allowSortedInsert&&this.strategy.comparator&&c)if(this.tryInsertSorted(r,s,c)){if(r.view.meta&&typeof r.view.meta.total=="number"){if(r.view.meta.total+=1,o&&Number.isFinite(i)){let l=i;l>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/l)))}this.syncTotalsInSameViews(t,r)}if(r.view.updatedAt=Date.now(),o&&(r.view.value?.length??0)>i&&c){let l=r.view.meta,u=l&&typeof l.totalPages=="number"?l.totalPages:1;if(this.cascadeShiftToNextPage(t,r,n,i,u,c,r.params??{})&&r.view.meta&&typeof r.view.meta.totalPages=="number"){let d=r.view.meta.totalPages+1;r.view.meta.totalPages=d,this.updateTotalPagesForAllViews(t,d)}}}else this.markViewStaleForReload(r);else if(!o||r.view.value.length<i){if(r.view.value.push(s.id),r.view.meta&&typeof r.view.meta.total=="number"){if(r.view.meta.total+=1,o&&Number.isFinite(i)){let l=i;l>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/l)))}this.syncTotalsInSameViews(t,r)}r.view.updatedAt=Date.now()}else this.markViewStaleForReload(r);r.view.loadId=Me(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0)}}handleUpdate(t,r,n,i,o,a,s,c,l){let u=r.view.value.includes(c.id),d=this.isEntityTypeCompatible(c,r.params?.itemType||"all");if(u&&!d){if(r.view.value=r.view.value.filter(f=>f!==c.id),r.view.meta&&typeof r.view.meta.total=="number"&&(r.view.meta.total=Math.max(0,r.view.meta.total-1),o&&Number.isFinite(i)&&typeof r.view.meta.total=="number")){let f=i;f>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/f)))}if(r.view.updatedAt=Date.now(),o&&r.view.value.length<i&&l){let f=r.view.meta,m=f&&typeof f.totalPages=="number"?f.totalPages:1;if(this.cascadeShiftPages(t,r,n,i,m,l,r.params??{})&&r.view.meta&&typeof r.view.meta.totalPages=="number"){let g=Math.max(1,r.view.meta.totalPages-1);r.view.meta.totalPages=g,this.updateTotalPagesForAllViews(t,g)}}r.view.loadId=Me(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0);return}if(u&&(a||s)){r.view.value=r.view.value.filter(f=>f!==c.id),this.tryReinsertEntity(r,c,l,o,i)?(r.view.updatedAt=Date.now(),r.view.loadId=Me(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0)):this.markViewStaleForReload(r);return}if(u){r.view.updatedAt=Date.now(),r.view.loadId=Me(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0);return}if(d&&!s){if(a&&this.strategy.allowSortedInsert&&this.strategy.comparator&&l)if(this.tryInsertSorted(r,c,l)){if(r.view.meta&&typeof r.view.meta.total=="number"){if(r.view.meta.total+=1,o&&Number.isFinite(i)){let f=i;f>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/f)))}this.syncTotalsInSameViews(t,r)}r.view.updatedAt=Date.now()}else this.markViewStaleForReload(r);else if(!o||r.view.value.length<i){if(r.view.value.push(c.id),r.view.meta&&typeof r.view.meta.total=="number"){if(r.view.meta.total+=1,o&&Number.isFinite(i)){let f=i;f>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/f)))}this.syncTotalsInSameViews(t,r)}r.view.updatedAt=Date.now()}else this.markViewStaleForReload(r);r.view.loadId=Me(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0)}}handleMove(t,r,n,i,o,a,s,c,l){if(r.view.value.includes(s.id)){if(r.view.value=r.view.value.filter(u=>u!==s.id),r.view.meta&&typeof r.view.meta.total=="number"&&(r.view.meta.total=Math.max(0,r.view.meta.total-1),o&&Number.isFinite(i)&&typeof r.view.meta.total=="number")){let u=i;u>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/u)))}if(r.view.updatedAt=Date.now(),o&&r.view.value.length<i&&l){let u=r.view.meta,d=u&&typeof u.totalPages=="number"?u.totalPages:1;if(this.cascadeShiftPages(t,r,n,i,d,l,r.params??{})&&r.view.meta&&typeof r.view.meta.totalPages=="number"){let f=Math.max(1,r.view.meta.totalPages-1);r.view.meta.totalPages=f,this.updateTotalPagesForAllViews(t,f)}}this.syncTotalsInSameViews(t,r)}r.view.loadId=Me(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0)}forceInvalidateChildrenViews(t){let r=this.parentKey(t??null);this.failedRequests.clearChildrenViewErrorsForParent(r);let n=this.views.get(r);if(n)for(let[,i]of n)i.view.value=void 0,i.view.meta=void 0,i.view.promise=null,i.view.updatedAt=0,i.view.loadId=Me(),i.view.abortController&&(i.view.abortController.abort(),i.view.abortController=void 0)}getKnownTotal(t){let r=this.parentKey(t??null),n=this.views.get(r);if(!n)return;let i=null;for(let[,o]of n){let a=o.view.meta;a&&typeof a.total=="number"&&(!i||(o.view.updatedAt??0)>i.updatedAt)&&(i={total:Number(a.total),updatedAt:o.view.updatedAt??0})}return i?i.total:void 0}toJSON(){return{views:Array.from(this.views.entries()).map(([t,r])=>[t,Array.from(r.entries())]),ttl:this.ttl,errorTtl:this.errorTtl,entityTtl:this.entityTtl,strategy:{allowSortedInsert:this.strategy.allowSortedInsert,allowSearchInsert:this.strategy.allowSearchInsert,invalidateOnPaginationFull:this.strategy.invalidateOnPaginationFull,preloadPagesBefore:this.strategy.preloadPagesBefore,preloadPagesAfter:this.strategy.preloadPagesAfter}}}static fromJSON(t,r){let n=r?.ttl??t?.ttl??18e5,i=r?.errorTtl??t?.errorTtl??n,o=r?.failedRequests??new Br,a=new Xv({},n,i,void 0,o,r?.isFolderNotFoundError);for(let[s,c]of t.views??[]){let l=new Map;for(let[u,d]of c){let f=d;f?.view&&"error"in f.view&&delete f.view.error,l.set(u,f)}a.views.set(s,l)}return a}},ZF=class Jv{invalidateChildrenCountCache(t){let r=Ee(t??"");this.childrenCountPromises.delete(r),this.failedRequests.delete(Br.childrenCountKey(r))}constructor(t={},r=xl,n,i){this.childrenCountPromises=new Map,this.isFolderNotFoundError=i?.isFolderNotFoundError??jy,this.failedRequests=new Br,this.ttl=i?.ttl??r,this.errorTtl=i?.errorTtl??n??this.ttl,this.entities=new Ry,this.views=new Ny(t,this.ttl,this.errorTtl,void 0,this.failedRequests,this.isFolderNotFoundError),this.views.setServerChildrenCountHandler((o,a,s)=>{this.handleServerReportedChildrenCount(o,a,s??this.entities)}),this.views.setChildrenCountInvalidator(o=>{this.invalidateChildrenCountCache(o)})}getEntity(t){return this.entities.getEntity(t)??null}getFileSystemItem(t){return this.entities.getFileSystemItem(t)??null}getFolder(t){return this.entities.getFolder(t)??null}async getOrCreateChildren(t,r,n){return this.views.getOrCreateChildren(t,r,n,this.entities)}upsertEntity(t){let r=this.entities.getEntity(t.id),n=r?Be(r):null,i=Be(t),o=r?oe(r):!1,a=oe(t);if(this.entities.upsertEntity(t),r){if(n!==i||o!==a){this.views.smartInvalidateChildrenViews(n,r,"delete",this.entities),this.views.smartInvalidateChildrenViews(i,t,"insert",this.entities);return}this.views.smartInvalidateChildrenViews(i,t,"update",this.entities,void 0,r)}else this.views.smartInvalidateChildrenViews(i,t,"insert",this.entities)}isAncestor(t,r){let n=r,i=new Set;for(;n&&!i.has(n);){if(i.add(n),Ee(n)===Ee(t))return!0;let o=this.entities.getEntity(n);if(!o)break;n=Be(o),n===null&&(n=ky)}return!1}moveEntity(t,r){let n=this.entities.getEntity(t);if(!n||oe(n)&&r!==null&&this.isAncestor(t,r))return null;let i=Be(n),o=this.entities.moveEntityById(t,r);return o?(this.views.smartInvalidateChildrenViews(i,n,"delete",this.entities),this.views.smartInvalidateChildrenViews(r,o,"insert",this.entities),o):null}copyEntity(t,r,n,i){let o=this.entities.getEntity(t);if(!o)return null;let a=null;if(oe(o)){let s=[t],c=[];for(;s.length;){let u=s.shift();c.push(u);let d=this.entities.getChildrenIds(u,{onlyFolders:!0});for(let f of d)s.push(f)}let l=new Map;for(let u of c)l.set(u,Me());for(let u of c){let d=this.entities.getFolder(u),f=l.get(u),m=Be(d),g=m===null?r:l.get(m)??null,h={...d,...u===t?i:void 0,id:f,folderId:(u===t?i?.folderId:void 0)??g};this.entities.upsertEntity(h)}for(let u of c){let d=l.get(u),f=this.entities.getChildrenIds(u,{onlyFileSystemItems:!0});for(let m of f){let g=this.entities.getFileSystemItem(m);if(!g)continue;let h=Me(),E={...g,id:h,folderId:d};this.entities.upsertEntity(E)}}a=this.entities.getEntity(l.get(t))??null}else{let s=n??Me();if(a=this.entities.copyFileSystemItem(t,s,r??null),a&&i){let c={...a,...i,id:s,folderId:i.folderId??r??null};this.entities.upsertEntity(c),a=c}}return a&&this.views.smartInvalidateChildrenViews(r,a,"copy",this.entities),a}searchByUrl(t){return this.entities.searchByUrl(t)??null}deleteEntity(t){let r=this.entities.getEntity(t);if(!r)return null;if(oe(r)){let{deletedFolderRecords:n,deletedFileSystemItemRecords:i}=this.entities.deleteFolderRecursive(t);for(let o of i)this.views.smartInvalidateChildrenViews(o.folderId,o,"delete",this.entities);for(let o of n)this.views.smartInvalidateChildrenViews(o.folderId,o,"delete",this.entities);for(let o of n)this.views.forceInvalidateChildrenViews(o.id);return r}{let{entity:n,parentId:i}=this.entities.deleteEntityById(t);return n&&this.views.smartInvalidateChildrenViews(i,n,"delete",this.entities),n}}deleteFolderRecursive(t){let{deletedFolderRecords:r,deletedFileSystemItemRecords:n}=this.entities.deleteFolderRecursive(t);for(let i of n)this.views.smartInvalidateChildrenViews(i.folderId,i,"delete",this.entities);for(let i of r)this.views.smartInvalidateChildrenViews(i.folderId,i,"delete",this.entities);for(let i of r)this.views.forceInvalidateChildrenViews(i.id);return{deletedFileSystemItemIds:n.map(i=>i.id),deletedFolderIds:r.map(i=>i.id)}}forceInvalidate(t){let r=this.entities.getEntity(t);if(!r){this.views.forceInvalidateChildrenViews(t??null),this.invalidateChildrenCountCache(t);return}let n=new Set;if(oe(r)){let i=[t];for(;i.length;){let o=i.pop();if(n.has(o))continue;n.add(o),this.views.forceInvalidateChildrenViews(o),this.invalidateChildrenCountCache(o);let a=this.entities.getChildrenIds(o,{onlyFolders:!0});for(let s of a)i.push(s)}}else{let i=r.folderId??null;this.views.forceInvalidateChildrenViews(i),this.invalidateChildrenCountCache(i)}}invalidateListingViews(t){this.views.forceInvalidateChildrenViews(t??null)}getChildrenIds(t){return this.entities.getChildrenIds(t)}searchByName(t,r){return this.entities.searchByName(t,r)}async getChildrenCount(t="",r){let n=Ee(t),i=Br.childrenCountKey(n),o=this.failedRequests.getFreshError(i,this.errorTtl);if(o!=null)return Promise.reject(o);let a=this.childrenCountPromises.get(n);if(a)return a;let s=(async()=>{try{let c=this.entities.getFolder(t);if(c&&typeof c.childrenCount=="number")return this.failedRequests.delete(i),c.childrenCount;let l=this.views.getKnownTotal(t);if(typeof l=="number")return c&&this.handleServerReportedChildrenCount(t,l,this.entities),this.failedRequests.delete(i),l;if(r){let u=await r(t);return this.entities.getFolder(t)&&this.handleServerReportedChildrenCount(t,u,this.entities),this.failedRequests.delete(i),u}return this.failedRequests.delete(i),this.entities.getChildrenIds(t).length}catch(c){if(this.childrenCountPromises.delete(n),this.isFolderNotFoundError(c))return this.failedRequests.delete(i),0;throw this.failedRequests.setError(i,c),c}finally{this.childrenCountPromises.delete(n)}})();return this.childrenCountPromises.set(n,s),s}toJSON(){return{entities:this.entities.toJSON(),views:this.views.toJSON(),ttl:this.ttl,errorTtl:this.errorTtl}}static fromJSON(t,r,n){let i=n?.ttl??t?.ttl??18e5,o=n?.errorTtl??t?.errorTtl??i,a=new Jv(r??{},i,o,n),s=Ry.fromJSON(t?.entities??{}),c=Ny.fromJSON(t?.views??{},{failedRequests:a.failedRequests,ttl:i,errorTtl:o,isFolderNotFoundError:n?.isFolderNotFoundError});if(r){let l=Cy(r);c.strategy={allowSortedInsert:l.allowSortedInsert??!0,allowSearchInsert:l.allowSearchInsert??!0,invalidateOnPaginationFull:l.invalidateOnPaginationFull??!0,preloadPagesBefore:l.preloadPagesBefore??0,preloadPagesAfter:l.preloadPagesAfter??1,comparator:l.comparator,filterMatch:l.filterMatch}}return a.entities=s,a.views=c,c.setServerChildrenCountHandler((l,u,d)=>{a.handleServerReportedChildrenCount(l,u,d??s)}),c.setChildrenCountInvalidator(l=>{a.invalidateChildrenCountCache(l)}),a}handleServerReportedChildrenCount(t,r,n){this.checkAndResolveChildrenCountConflict(t,r,n),this.invalidateChildrenCountCache(t)}checkAndResolveChildrenCountConflict(t,r,n){if(!n||r===void 0)return;let i=t??null;if(!i){n.updateServerChildrenCount(i,r);return}let o=n.getFolder(i)?.childrenCount;o!==void 0&&o!==r&&this.views.forceInvalidateChildrenViews(i),n.updateServerChildrenCount(i,r)}},e1="",t1="Trash",r1="Edited",Dy=1e4,Ly=1e4,Fy=25,xy=10,Kn=100,n1=1e3;function Fo(e,t){let r=e??{},n=Array.isArray(r.detailed)?r.detailed.map(i=>({requestId:i.requestId??i.id,success:!!i.success,data:t(i.data),error:i.error})):void 0;return{success:!!r.success,error:r.error,detailed:n}}function Bl(e){return e==null?"":String(e)}function ce(e){return{...e,name:Bl(e.name)}}function i1(e){return(e??[]).map(ce)}function jt(e){return!e||typeof e!="object"||!("name"in e)?e:{...e,name:Bl(e.name)}}function o1(e,t){let r=e.lastIndexOf("."),n=r>0?e.slice(0,r):e,i=r>0?e.slice(r):"";for(let o=1;;o++){let a=`${n} (${o})${i}`;if(!t(a))return a}}function a1(e){return e?e.replaceAll("\\","/").split("/").filter(Boolean):[]}var Uy=class{_getTrashPath(){return this._pathOptions.trashPath||t1}_getPathLookupCandidates(e){return Oy(e,this._getTrashPath(),tt)}_folderFromResolvedPath(e,t){if(e.isFolder!==!0)throw new z(e.isFolder===!1?"Path '%s' resolves to a file, not a folder".replace("%s",t):"Path '%s' resolved to an item that is not marked as a folder".replace("%s",t),"ValidationError");if(!e.id)throw new z("Path '%s' resolved to a folder without id".replace("%s",t),"ValidationError");let r={id:e.id,name:e.name||e.id,parentId:e.folderId};return this._cache.upsertEntity(ce({id:r.id,name:r.name,folderId:r.parentId??null,isFolder:!0})),r}async _resolveFolderByPath(e){if(typeof this._dataProvider.findItemByPath=="function")for(let t of this._getPathLookupCandidates(e)){let r=await this._dataProvider.findItemByPath(t);if(r)return this._folderFromResolvedPath(r,t)}}async _findOrCreateFolderByPath(e){let t=a1(e);if(t.length>xy)throw new z("Path depth exceeds maximum limit of %s".replace("%s",String(xy)),"ValidationError");let r=await this._resolveFolderByPath(e);if(r)return r;let n;for(let i of t){let{files:o}=await this.getFiles({folderId:n?.id||"",itemType:"folder"}),a=o.find(s=>s.name===i);if(a){if(!a.isFolder)throw new z("Path component '%s' in '%s' is not a folder".replace("%s",i).replace("%s",e),"ValidationError");n={id:a.id,name:a.name,parentId:a.folderId}}else{if(typeof this._dataProvider.createFolder!="function")throw new z("Create folder operation is not supported by data provider","UnsupportedOperation");n=await this.createFolder({name:i,parentId:n?.id})}}return n}async getTrashFolder(){let e=await this._findOrCreateFolderByPath(this._getTrashPath());if(!e)throw new z("Trash folder path '%s' could not be resolved".replace("%s",this._getTrashPath()),"FolderNotFound");return e}async getTempFolder(){let e=this._pathOptions.tempPath??r1;if(e)try{return await this._findOrCreateFolderByPath(e)}catch(t){if(t instanceof z&&t.code==="ValidationError")throw t;return}}constructor(e,t={},r,n={}){this._dataProvider=e,this._options=t,this._pathOptions=r,this._blobFetchForceReloadOnceIds=new Set,this._mutationRegistry=new qF,this._mapItem=async({childrenCount:o,...a})=>{let s=ce(a);if(s.isFolder)return{...s,childCount:o,url:"",thumbnailUrl:""};let[c,l]=await Promise.all([this._getUrl(s),this._getThumbnailUrl(s)]);return{...s,childCount:0,url:c,thumbnailUrl:l}},this._config=n,this._useSoftDelete=this._pathOptions.useSoftDelete,this._trashSupportsFolders=this._pathOptions.trashSupportsFolders!==!1,this._rootId=this._pathOptions.rootId||e1,this._enableTrash=this._options.enableTrash===void 0||this._options.enableTrash,this._validateDuplicates=this._dataProvider.validateDuplicates,this._cache=new ZF(t.cacheStrategy||{},t.cacheStrategy?.ttl,t.cacheStrategy?.errorTtl),this.setController({invalidateItemCache:o=>{this._cache.forceInvalidate(o)},getCachedItem:o=>this._cache.getEntity(o)});let i=Object.getPrototypeOf(this);for(let o of Object.getOwnPropertyNames(i)){let a=Object.getOwnPropertyDescriptor(i,o);o!=="constructor"&&typeof a?.value=="function"&&(this[o]=a.value.bind(this))}}setController(e){typeof this._dataProvider.setController=="function"&&this._dataProvider.setController(e)}async clearCache(e){let t=e??this._rootId;this._cache.forceInvalidate(t),this._cache.invalidateListingViews(t),typeof this._dataProvider.clearCache=="function"&&await this._dataProvider.clearCache(e)}markNextFileBlobFetchBypassHttpCache(e){this._blobFetchForceReloadOnceIds.add(this.normalizeId(e))}normalizeId(e){return!e||e==="root"||e==="folders"?this._rootId:e}_isDeletingId(e){return this._mutationRegistry.isDeleting(this.normalizeId(e))}_collectDeletingIds(e){let t=this.normalizeId(e),r=new Set([t]);if(!this._cache.getEntity(t)?.isFolder)return Array.from(r);let n=[t];for(;n.length>0;){let i=n.pop(),o=this._cache.getChildrenIds(i);for(let a of o)r.has(a)||(r.add(a),this._cache.getEntity(a)?.isFolder&&n.push(a))}return Array.from(r)}_emptyFilesResult(e,t){return{files:[],pagination:{...typeof e=="number"?{page:e}:{},...typeof t=="number"?{limit:t}:{},total:0,totalPages:1,hasNext:!1,hasPrev:!1}}}_validateName(e,t=!1){if(!e||e.trim().length===0)throw new z(t?"Folder name cannot be empty":"File name cannot be empty",t?"FolderInvalidName":"FileInvalidName");if(/[/\\:*?"<>|]/.test(e)){let r=t?"FolderInvalidName":"FileInvalidName";throw new z(t?"Folder name contains invalid characters: %s".replace("%s",e):"File name contains invalid characters: %s".replace("%s",e),r)}}_validateTargetFolderType(e){let t=this.normalizeId(e);if(t===this._rootId)return;let r=this._cache.getEntity(t);if(r&&!r.isFolder)throw new z("Target item with id '%s' is not a folder".replace("%s",e),"ValidationError")}_checkNameExistsInCache(e,t,r,n){let i=this.normalizeId(e),o=this._cache.getChildrenIds(i);for(let a of o){let s=this._cache.getEntity(a);if(s&&s.name===t&&!!s.isFolder===r&&(!n||s.id!==n))return!0}return!1}async _getUrl(e){if(e){if(e.url)return e.url;try{return typeof this._dataProvider?.getUrl=="function"&&this._dataProvider.getUrl(e)||void 0}catch{}}}async _getThumbnailUrl(e){if(e){if(e.thumbnailUrl)return e.thumbnailUrl;try{return typeof this._dataProvider?.getThumbnailUrl=="function"&&this._dataProvider.getThumbnailUrl(e)||void 0}catch{}}}_isAncestor(e,t){if(!t)return!1;let r=this.normalizeId(t),n=this.normalizeId(e);if(r===n)return!0;let i=this._cache.getEntity(r),o=new Set;for(;i&&i.folderId&&!o.has(i.id);){o.add(i.id);let a=this.normalizeId(i.folderId);if(a===n)return!0;if(i=this._cache.getEntity(a),!i||!i.isFolder)break}return!1}async getFile(e,t){return this._isDeletingId(e)?null:this._cache.searchByName(t,{parentId:this.normalizeId(e),caseSensitive:!0,recursive:!1,itemType:"file"})[0]||(await this.getFiles({folderId:e,itemType:"file",search:t})).files[0]}async getFileById(e){let t=this.normalizeId(e);if(this._isDeletingId(t))return null;let r=this._cache.getFileSystemItem(t);if(r&&!r.isFolder)return await this._mapItem(r);if(!this._dataProvider.pathMode)return null;let n=await this._getFileByPathStyleId(t);if(n&&!n.isFolder){let i=ce(n);return this._cache.upsertEntity(i),await this._mapItem(i)}return null}async _getFileByPathStyleId(e){let t=e.replace(/\\/g,"/").replace(/^\/+/,""),r=t.lastIndexOf("/"),n=r<0?"":t.slice(0,r),i=r<0?t:t.slice(r+1);return i?this.getFile(n,i):null}async getFileUrl(e,t){let r=await this.getFile(e??"",t);if(r)return await this._getUrl(r)||await this._getThumbnailUrl(r)||r.thumbnail}async getFiles({folderId:e,search:t,sortBy:r,sortOrder:n,page:i,limit:o,itemType:a="all",noFolder:s=!1}){s&&(e=(await this.getTempFolder())?.id);let c=this.normalizeId(e??this._rootId),l=this._options.enablePagination===!1,u=l?1:i,d=l?Dy:o,f=this._options.clientSideFilter,m=this._options.clientSideSorting,g=this._options.clientSidePaging,h=g?Math.max(1,i??1):void 0,E=g?typeof o=="number"&&Number.isFinite(o)&&o>0?o:Fy:void 0,S=this._emptyFilesResult(g?h:u,g?E:d);if(this._isDeletingId(c))return S;let T=this._options.unifiedCatalogFetch!==!1&&l&&(a==="folder"||a==="file"),w=T?"all":a,y={folderId:c,itemType:w};f||(y.search=t),m||(y.sortBy=r??(w==="folder"?void 0:"date"),y.sortOrder=n??(w==="folder"?void 0:"desc")),g||(y.page=u,y.limit=T?Ly:d);let I=T?Ly:g?void 0:d,_={folderId:c,itemType:w,search:f?void 0:t,sortBy:m?void 0:y.sortBy,sortOrder:m?void 0:y.sortOrder,page:g?void 0:u,pageSize:I},P;try{P=await this._cache.getOrCreateChildren(c,_,async(k,D)=>{let N=D.pageSize,x=N!=null&&Number.isFinite(Number(N))?Number(N):Dy,F=await this._dataProvider.getItems({...D,folderId:k,limit:x}),q=i1(F.items);return g?{items:q,total:typeof F.pagination?.total=="number"?F.pagination.total:q.length}:{items:q,...F.pagination}})}catch(k){if(this._isDeletingId(c))return S;throw k}let v=P.items;if(T&&(a==="folder"?v=v.filter(k=>k.isFolder):a==="file"&&(v=v.filter(k=>!k.isFolder))),f){if(typeof this._options.clientSideFilter=="function")v=this._options.clientSideFilter(v,t);else if(t){let k=t.toLowerCase();v=v.filter(D=>D.name?.toLowerCase().includes(k))}}m&&(v=typeof this._options.clientSideSorting=="function"?this._options.clientSideSorting(v,r,n):this._defaultClientSideSort(v,r,n));let M;M=g||f||T?v.length:P.total??v.length;let j=v;if(g)if(typeof this._options.clientSidePaging=="function")j=this._options.clientSidePaging(v,h,E);else{let k=(h-1)*E,D=k+E;j=v.slice(k,D)}if(typeof this._dataProvider.getUrl=="function"||typeof this._dataProvider.getThumbnailUrl=="function"){let k=j.map(async D=>{if(D.isFolder)return D;let[N,x]=await Promise.all([D.url?Promise.resolve(D.url):typeof this._dataProvider.getUrl=="function"?this._dataProvider.getUrl(D):Promise.resolve(void 0),D.thumbnailUrl?Promise.resolve(D.thumbnailUrl):typeof this._dataProvider.getThumbnailUrl=="function"?this._dataProvider.getThumbnailUrl(D):Promise.resolve(void 0)]);return{...D,url:N,thumbnailUrl:x}});j=await Promise.all(k)}let A=g?{page:h,limit:E,total:M,totalPages:Math.max(1,Math.ceil(M/E)),hasNext:h*E<M,hasPrev:h>1}:{page:u,limit:d,total:M,...!g&&P.totalPages&&{totalPages:P.totalPages},...!g&&P.hasNextPage&&{hasNextPage:P.hasNextPage}};return{files:await Promise.all(j.map(this._mapItem)),pagination:A}}_defaultClientSideSort(e,t,r){return e.sort((n,i)=>Ty(n,i,{sortBy:t,sortOrder:r}))}async getFileData(e,t){let r=this.normalizeId(typeof e=="string"?e:e.id),n=t;this._blobFetchForceReloadOnceIds.delete(r)&&(n={...t,forceReload:!0});let i=this._cache.getEntity(r)||(typeof e=="string"?{id:r,name:"",folderId:this._rootId,isFolder:!1}:{...e,childrenCount:e.childCount});if(typeof this._dataProvider.getFileData=="function")return await this._dataProvider.getFileData(i,n);if(!i.url&&typeof this._dataProvider.getUrl!="function")throw new z("Cannot read file","FileReadError");let o=i.url||(typeof this._dataProvider.getUrl=="function"?await this._dataProvider.getUrl(i):"");if(o)return(await(this._config.fetchWithProxy??fetch)(o,n?.forceReload?{cache:"no-store"}:void 0)).blob();throw new z("Unable to get file data","FileReadError")}async findFileByUrl(e){let t=this._cache.searchByUrl(e);if(t)return t;if(typeof this._dataProvider.findFileByUrl=="function")try{let r=await this._dataProvider.findFileByUrl(e);if(r){let n=ce(r);return this._cache.upsertEntity(n),n}}catch{}return null}async getChildrenCount(e){if(!e)return 0;let t=this.normalizeId(e??this._rootId);return this._isDeletingId(t)?0:this._cache.getChildrenCount(t,async()=>{try{if(this._options.clientSidePaging){let n=await this.getFiles({folderId:t,itemType:"all",page:1,limit:Fy});return n.pagination.total??n.files.length}let r=await this._dataProvider.getItems({folderId:t,limit:0,itemType:"all"});return r.pagination===void 0?this._options.enablePagination===!1?r.items.length:0:r.pagination.total||0}catch(r){if(this._isDeletingId(t)||this._isPathFolderNotFoundError(r))return 0;throw r}})}_isPathFolderNotFoundError(e){if(!e||typeof e!="object")return!1;let t=e;return t.code==="path_folder_not_found"||t.data?.code==="path_folder_not_found"||t.status===404||t.data?.data?.status===404}async _uploadFile(e){let t=this.normalizeId(e.folderId??this._rootId);if(typeof this._dataProvider.uploadFile!="function")throw new z("Upload file operation is not supported by data provider","UnsupportedOperation");if(this._validateName(e.name,!1),this._validateDuplicates&&this._checkNameExistsInCache(t,e.name,!1))throw new z("File '%s' already exists in target folder".replace("%s",e.name),"FileAlreadyExists");let r=await this._dataProvider.uploadFile({...e,folderId:t}),n=ce({name:e.name,size:e.size,...r,folderId:r.folderId??t});return this._cache.upsertEntity(n),n}async uploadFiles(e){let t=e.items.some(a=>a.noFolder)?await this.getTempFolder():null;e={...e,items:e.items?.map(a=>({...a,folderId:a.noFolder?t?.id:a.folderId}))};for(let a of e.items)a.folderId&&(e.folderId=a.folderId);let r=e.items||[],n=e.folderId??this._rootId,i=this.normalizeId(n);if(this._validateDuplicates){for(let a of r)if(a.name){this._validateName(a.name,!1);let s=this.normalizeId(a.folderId??i);if(this._checkNameExistsInCache(s,a.name,!1))throw new z("File '%s' already exists in target folder".replace("%s",a.name),"FileAlreadyExists")}}let o={detailed:Array(r.length),success:!0};if(typeof this._dataProvider.uploadFiles=="function"){let a=r.map(l=>({...l,folderId:this.normalizeId(l.folderId??i)})),s=await this._dataProvider.uploadFiles({folderId:i,items:a});o=Fo(s,l=>{if(l)return{id:l.id,name:Bl(l.name),folderId:l.folderId,url:l.url,thumbnailUrl:l.thumbnailUrl,thumbnail:l.thumbnail}});let c=s?.detailed;if(o.detailed&&o.detailed.length){for(let l=0;l<o.detailed.length;l++){let u=o.detailed[l];if(u&&u.success){let d=u.data,f=d?.id??u.requestId,m=c?.[l]?.data,g=ce({...m,...d,id:f,folderId:d?.folderId??m?.folderId??i,isFolder:!1});this._cache.upsertEntity(g),u.requestId=f}}o.success===void 0&&(o.success=!o.detailed.some(l=>!l.success))}else o.success=!o.error&&!!o.success}else if(typeof this._dataProvider.uploadFile=="function")o.detailed=await Promise.all(r.map(async a=>{let s=this.normalizeId(a.folderId??i);try{let c=await this._uploadFile({...a,folderId:s});return{requestId:c.id,data:c,success:!0}}catch(c){return{requestId:a?.id,success:!1,error:c}}})),o.success=!o.detailed.some(a=>!a.success);else throw new z("Upload files is not supported by data provider","UnsupportedOperation");if(o.success&&this._enableTrash)try{this._cache.forceInvalidate(i)}catch{}return o}async deleteFile(e){let t=this.normalizeId(e),r=[t];this._mutationRegistry.beginDeleting(r);try{if(this._useSoftDelete&&this._enableTrash){let n=await this.getTrashFolder();return await this.moveItem({itemId:t,targetFolderId:n.id,isFolder:!1})}return await this.hardDeleteItem(t)}finally{this._mutationRegistry.endDeleting(r)}}async deleteItems(e,t){let r=this._useSoftDelete&&this._enableTrash&&t.permanent!==!0,n=r&&!this._trashSupportsFolders?e.filter(a=>this._cache.getEntity(this.normalizeId(a))?.isFolder):[],i=await this._listFolderTreeFiles(n),o=Array.from(new Set(e.flatMap(a=>this._collectDeletingIds(this.normalizeId(a)))));this._mutationRegistry.beginDeleting(o);try{if(r){let a=await this.getTrashFolder(),s=e.filter(l=>!n.includes(l)),c=s.length>0?await this.moveItems(a.id,s):{success:!0,detailed:[]};for(let l of n){let u=await this._moveFolderFilesToTrash(l,i.get(l),a);c.detailed=[...c.detailed??[],u?{requestId:l,success:!0}:{requestId:l,success:!1,error:new z("Folder files could not be moved to trash","MoveNotAllowed")}],c.success=c.success&&u}return c}return await this.hardDeleteItems(e,t)}finally{this._mutationRegistry.endDeleting(o)}}async hardDeleteItems(e,t){let r={success:!0,detailed:[]},n=t.permanent?null:await this.getTrashFolder();if(typeof this._dataProvider.deleteItems=="function"){if(r=Fo(await this._dataProvider.deleteItems(e.map(i=>this._cache.getEntity(i)),t),i=>i),r.success){let i=r.detailed||e.map(o=>({requestId:o,success:!0,error:void 0}));for(let o of i)o.success&&(n?this._cache.moveEntity(o.requestId,n.id):this._cache.deleteEntity(o.requestId))}}else typeof this._dataProvider.deleteItem=="function"&&(r.detailed=await Promise.all(e.map(async i=>{let o=this._cache.getEntity(i);if(!o)return{requestId:i,success:!1,error:new z("Item with id '%s' not found".replace("%s",i),"FileNotFound")};try{return await this._dataProvider.deleteItem(o,t),n?this._cache.moveEntity(i,n.id):this._cache.deleteEntity(i),{requestId:i,success:!0}}catch(a){return{requestId:i,error:a,success:!1}}})),r.success=!r.detailed.some(i=>!i.success));if(r.success&&n)try{this._cache.forceInvalidate(n.id)}catch{}return r}async hardDeleteItem(e){let t=this._cache.getEntity(e);if(!t)throw new z("Item with id '%s' not found in cache".replace("%s",e),"FileNotFound");if(typeof this._dataProvider.deleteItem!="function")throw new z("Delete item operation is not supported by data provider","DeleteNotAllowed");if(await this._dataProvider.deleteItem(t,{permanent:!0}),this._cache.deleteEntity(e),this._enableTrash)try{let r=await this.getTrashFolder();r&&this._cache.forceInvalidate(r.id)}catch{}return!0}async cleanTrash(){if(!this._enableTrash)throw new z("Trash is not enabled","UnsupportedOperation");if(typeof this._dataProvider.cleanTrash=="function"){let e=await this._dataProvider.cleanTrash();try{let t=await this.getTrashFolder();t&&this._cache.forceInvalidate(t.id)}catch{}return e}if(typeof this._dataProvider.deleteItems=="function"||typeof this._dataProvider.deleteItem=="function")return this._cleanTrashByDeletingItems();throw new z("Clean trash is not supported by data provider","UnsupportedOperation")}async _listAllItems(e){let t=new Map;for(let r=1;r<=n1;r++){let{files:n,pagination:i}=await this.getFiles({folderId:e,itemType:"all",page:r,limit:Kn}),o=t.size;if(n.forEach(a=>t.set(a.id,a)),t.size===o||i.hasNext===!1||typeof i.totalPages=="number"&&r>=i.totalPages||typeof i.total=="number"&&t.size>=i.total)return{items:Array.from(t.values()),complete:!0}}return{items:Array.from(t.values()),complete:!1}}async _listFolderTreeFiles(e){let t=new Map;for(let r of e){let n={files:[],folders:[r]},i=!0;for(let o=0;o<n.folders.length&&i;o++){let a=await this._listAllItems(n.folders[o]);i=a.complete;for(let s of a.items)s.isFolder?n.folders.push(s.id):n.files.push(s)}t.set(r,i?n:void 0)}return t}async _moveFolderFilesToTrash(e,t,r){if(!t)return!1;try{return await this._moveFolderFilesToTrashUnsafe(e,t,r)}catch{return!1}}async _moveFolderFilesToTrashUnsafe(e,{files:t,folders:r},n){let i=await this._listAllItems(n.id);if(!i.complete)return!1;let o=new Set(i.items.filter(s=>!s.isFolder).map(s=>s.name));for(let s of t){let c=s.name;o.has(c)&&typeof this._dataProvider.renameItem=="function"&&(c=o1(s.name,l=>o.has(l)||this._checkNameExistsInCache(s.folderId,l,!1,s.id)),await this.renameFile(s.id,c)),o.add(c)}let a=t.map(s=>s.id);for(let s=0;s<a.length;s+=Kn){let c=await this.moveItems(n.id,a.slice(s,s+Kn));if(!c.success||c.detailed?.some(l=>!l.success))return!1}try{this._cache.forceInvalidate(n.id)}catch{}for(let s of[...r].reverse())if(!(await this.hardDeleteItems([s],{permanent:!0})).success)return!1;return this._cache.deleteFolderRecursive(e),!0}async _cleanTrashByDeletingItems(){let e=await this.getTrashFolder(),t=await this._listAllItems(e.id),r=new Set(t.items.map(a=>a.id)),n=0,i=t.complete,o=Array.from(r);for(let a=0;a<o.length;a+=Kn){let s=o.slice(a,a+Kn),c=await this.deleteItems(s,{permanent:!0}),l=c.detailed?c.detailed.filter(u=>u.success).length:c.success?s.length:0;n+=l,i=i&&c.success&&l===s.length}try{this._cache.forceInvalidate(e.id)}catch{}return{success:i,deletedCount:n}}async createFolder({name:e,parentId:t,is_force_create:r}){let n=this.normalizeId(t??this._rootId);if(this._validateName(e,!0),this._validateDuplicates&&this._checkNameExistsInCache(n,e,!0))throw new z("Folder '%s' already exists in parent folder".replace("%s",e),"FolderAlreadyExists");let i=await this._dataProvider.createFolder(e,n,r),o=ce({id:i.id,folderId:n,name:i.name,isFolder:!0,childrenCount:i.childrenCount});return this._cache.upsertEntity(o),{...i,name:o.name}}async deleteFolder(e){let t=this.normalizeId(e),r=this._useSoftDelete&&this._enableTrash&&!this._trashSupportsFolders,n=r?await this._listFolderTreeFiles([t]):void 0,i=this._collectDeletingIds(t);this._mutationRegistry.beginDeleting(i);try{if(r){let o=await this.getTrashFolder();return await this._moveFolderFilesToTrash(t,n?.get(t),o)}if(this._useSoftDelete&&this._enableTrash)try{let o=await this.getTrashFolder();return await this.moveItem({itemId:t,targetFolderId:o.id,isFolder:!0})?(this._cache.deleteFolderRecursive(t),!0):!1}catch{return await this.hardDeleteItem(t)}return await this.hardDeleteItem(t)}finally{this._mutationRegistry.endDeleting(i)}}async renameFolder(e,t){if(typeof this._dataProvider.renameItem!="function")throw new z("Rename folder is not supported","RenameNotAllowed");let r=this.normalizeId(e),n=this._cache.getEntity(r);if(!n)throw new z("Folder with id '%s' not found in cache".replace("%s",e),"FolderNotFound");if(this._validateName(t,!0),this._validateDuplicates){let o=this.normalizeId(n.folderId);if(this._checkNameExistsInCache(o,t,!0,r))throw new z("Folder '%s' already exists in parent folder".replace("%s",t),"FolderAlreadyExists")}let i=jt(await this._dataProvider.renameItem(n,t));return this._cache.upsertEntity(ce({...this._cache.getEntity(i.id),...i})),this._cache.getEntity(i.id)}async renameFile(e,t){if(typeof this._dataProvider.renameItem!="function")throw new z("Rename file is not supported","RenameNotAllowed");let r=this._cache.getEntity(e);if(!r)throw new z("File with id '%s' not found in cache".replace("%s",e),"FileNotFound");let n=this.normalizeId(e);if(this._validateName(t,!1),this._validateDuplicates){let o=this.normalizeId(r.folderId);if(this._checkNameExistsInCache(o,t,!1,n))throw new z("File '%s' already exists in parent folder".replace("%s",t),"FileAlreadyExists")}let i=jt(await this._dataProvider.renameItem(r,t));return i&&this._cache.upsertEntity(ce({...this._cache.getEntity(n),...i})),this._cache.getEntity(n)}async moveItem({itemId:e,targetFolderId:t,isFolder:r}){if(typeof this._dataProvider.moveItem!="function")throw new z("Move item operation is not supported by data provider","MoveNotAllowed");let n=this.normalizeId(t);this._validateTargetFolderType(t);let i=this._cache.getEntity(e);if(!i){let a=jt(await this._dataProvider.moveItem({id:e,folderId:n,isFolder:r},n));if(a.id===e)this._cache.upsertEntity(ce({...a,folderId:n}));else{try{this._cache.deleteEntity(e)}catch{}this._cache.upsertEntity(ce({...a,folderId:n}))}return!0}if(i.isFolder){if(e===n)throw new z("Cannot move folder into itself","MoveIntoSelf");if(this._isAncestor(e,n))throw new z("Cannot move folder into its descendant","MoveIntoDescendant")}if(this._validateDuplicates&&n!==this.normalizeId(i.folderId)&&i.name&&this._checkNameExistsInCache(n,i.name,!!i.isFolder,e)){let a=i.isFolder?"FolderAlreadyExists":"FileAlreadyExists";throw new z(`${i.isFolder?"Folder":"File"} '${i.name}' already exists in target folder`,a)}let o=jt(await this._dataProvider.moveItem(i,n));if(o.id===e){let a=this._cache.moveEntity(e,n);return this._cache.upsertEntity(ce({...a,...o})),!0}{let a=this._cache.deleteEntity(e);return this._cache.upsertEntity(ce({...a,...o,folderId:n})),!0}}async moveItems(e,t){let r=this.normalizeId(e);this._validateTargetFolderType(e);let n=t.map(o=>this._cache.getEntity(o));for(let o of n)if(o){if(o.isFolder){if(o.id===r)throw new z("Cannot move folder '%s' into itself".replace("%s",o.name),"MoveIntoSelf");if(this._isAncestor(o.id,r))throw new z("Cannot move folder '%s' into its descendant".replace("%s",o.name),"MoveIntoDescendant")}if(this._validateDuplicates&&r!==this.normalizeId(o.folderId)&&o.name&&this._checkNameExistsInCache(r,o.name,!!o.isFolder,o.id)){let a=o.isFolder?"FolderAlreadyExists":"FileAlreadyExists";throw new z(`${o.isFolder?"Folder":"File"} '${o.name}' already exists in target folder`,a)}}let i={detailed:Array(n.length),success:!0};if(typeof this._dataProvider.moveItems=="function")i=Fo(await this._dataProvider.moveItems(n,r),o=>o);else if(typeof this._dataProvider.moveItem=="function")i.detailed=await Promise.all(t.map(async(o,a)=>{let s=n[a]||{id:o,folderId:null,isFolder:!1,name:o};try{return{requestId:o,data:jt(await this._dataProvider.moveItem(s,r)),success:!0}}catch(c){return{requestId:o,success:!1,error:c}}}));else throw new z("Move items is not supported","MoveNotAllowed");if(i.success){let o=i.detailed||t.map(a=>({requestId:a,success:!0,data:void 0}));for(let a of o)if(a.success)if(!a.data||a.data.id===a.requestId)this._cache.moveEntity(a.requestId,r),a.data&&this._cache.upsertEntity(ce({...this._cache.getEntity(a.requestId),...a.data,folderId:r}));else{let s=this._cache.deleteEntity(a.requestId);this._cache.upsertEntity(ce({...s,...a.data,folderId:r}))}return i}return{success:!1,error:i.error||new z("Move items failed","MoveNotAllowed")}}async copyItem({itemId:e,targetFolderId:t}){if(typeof this._dataProvider.copyItem!="function")throw new z("Copy item is not supported","CopyNotAllowed");let r=this.normalizeId(t);this._validateTargetFolderType(t);let n=this._cache.getEntity(e);if(!n){let o=jt(await this._dataProvider.copyItem({id:e,folderId:r},r));return this._cache.copyEntity(e,r,o.id),this._cache.upsertEntity(ce({...o,folderId:r})),!0}if(this._validateDuplicates&&n.name){let o=r===this.normalizeId(n.folderId)?e:void 0;if(this._checkNameExistsInCache(r,n.name,!!n.isFolder,o)){let a=n.isFolder?"FolderAlreadyExists":"FileAlreadyExists";throw new z(`${n.isFolder?"Folder":"File"} '${n.name}' already exists in target folder`,a)}}let i=jt(await this._dataProvider.copyItem(n,r));return this._cache.copyEntity(e,r,i.id,{...i,folderId:r})||this._cache.upsertEntity(ce({...i,folderId:r})),!0}async copyItems(e,t){let r=this.normalizeId(e);this._validateTargetFolderType(e);let n=t.map(s=>typeof s=="string"?{id:s}:s),i=n.map(s=>s.id),o=i.map((s,c)=>{let l=this._cache.getEntity(s),u=n[c]?.newName;return l?u?{...l,name:u}:l:void 0});if(this._validateDuplicates)for(let s=0;s<o.length;s++){let c=o[s];if(c&&c.name){let l=r===this.normalizeId(c.folderId)?i[s]:void 0;if(this._checkNameExistsInCache(r,c.name,!!c.isFolder,l)){let u=c.isFolder?"FolderAlreadyExists":"FileAlreadyExists";throw new z(`${c.isFolder?"Folder":"File"} '${c.name}' already exists in target folder`,u)}}}let a={detailed:Array(o.length),success:!0};if(typeof this._dataProvider.copyItems=="function")a=Fo(await this._dataProvider.copyItems(o,r),s=>s);else if(typeof this._dataProvider.copyItem=="function")a.detailed=await Promise.all(i.map(async(s,c)=>{let l=o[c]||{id:s,folderId:null,isFolder:!1};try{return{requestId:s,data:jt(await this._dataProvider.copyItem(l,r)),success:!0}}catch(u){return{requestId:s,success:!1,error:u}}}));else throw new z("Copy items is not supported","CopyNotAllowed");if(a.success&&a.detailed)for(let s=0,c=a.detailed.length;s<c;s++){let l=a.detailed[s];if(l.success&&l.data?.id){let u=l.data.folderId||r;!this._cache.copyEntity(l.requestId,u,l.data.id,{...l.data,folderId:u})&&l.data&&this._cache.upsertEntity(ce({...l.data,folderId:u}))}}else if(!a.detailed)throw new z("batchResult in copy method must have detailed results","ValidationError");return a}async uploadFileByUrl(e){if(e.noFolder){let r=await this.getTempFolder();e={...e,folderId:r?.id}}let t=this.normalizeId(e.folderId??this._rootId);try{let r=ce({...await this._dataProvider.uploadFileByUrl(e.url,t,{eventSource:e.eventSource}),folderId:t});return this._cache.upsertEntity(r),r}catch(r){throw r}}async updateFile(e,t){if(typeof this._dataProvider.updateFile!="function")throw new z("Update file is not supported","UnsupportedOperation");let r=this.normalizeId(e),n=this._cache.getEntity(r);if(!n)throw new z("File with id '%s' not found in cache".replace("%s",e),"FileNotFound");if(t.name&&t.name!==n.name&&this._validateName(t.name,!1),this._validateDuplicates&&t.name&&t.name!==n.name){let o=this.normalizeId(n.folderId);if(this._checkNameExistsInCache(o,t.name,!1,r))throw new z("File '%s' already exists in parent folder".replace("%s",t.name),"FileAlreadyExists")}let i=jt(await this._dataProvider.updateFile(n,{...t}));return this._cache.upsertEntity(ce({...this._cache.getEntity(r),...i,...t})),this._cache.getEntity(r)}},s1="",l1="Trash",By=class{constructor(e,t=s1,r=tt,n=l1,i=!0){this._inner=e,this.rootPath=t,this.trashId=r,this.trashPath=n,this.ensureFolderTrailingSlash=i,this._pathToId=new Map,this._idToPath=new Map,this.validateDuplicates=this._inner.validateDuplicates??!1,typeof e.getUrl=="function"&&(this.getUrl=a=>e.getUrl({...a,id:this.pathForId(a.id,!1),folderId:a.folderId?this.pathForId(a.folderId,!0):this.rootPath})),typeof e.getThumbnailUrl=="function"&&(this.getThumbnailUrl=a=>e.getThumbnailUrl({...a,id:this.pathForId(a.id,!1),folderId:a.folderId?this.pathForId(a.folderId,!0):this.rootPath}));let o=this;typeof this._inner.deleteItems!="function"&&(o.deleteItems=void 0),typeof this._inner.deleteItem!="function"&&(o.deleteItem=void 0),typeof this._inner.moveItems=="function"?o.moveItem=void 0:o.moveItems=void 0,typeof this._inner.copyItems=="function"?o.copyItem=void 0:o.copyItems=void 0,typeof this._inner.uploadFiles=="function"?o.uploadFile=void 0:o.uploadFiles=void 0,typeof this._inner.clearCache!="function"&&(o.clearCache=void 0),typeof this._inner.cleanTrash!="function"&&(o.cleanTrash=void 0),this._getOrGenerateId(this.rootPath)}setController(e){typeof this._inner.setController=="function"&&this._inner.setController({invalidateItemCache:t=>{let r=t.replace(/^\/+|\/+$/g,""),n=this._pathToId.get(r);n&&e.invalidateItemCache(n)},getCachedItem:t=>{let r=t.replace(/^\/+|\/+$/g,""),n=this._pathToId.get(r);if(n){let i=e.getCachedItem(n);if(i)return{...i,id:this.pathForId(i.id,i.isFolder??!1),folderId:this.pathForId(i.folderId??"",i.isFolder??!1)}}}})}clearCache(e){if(typeof this._inner.clearCache=="function")return this._inner.clearCache(e)}findItemByPath(e){if(typeof this._inner.findItemByPath!="function")return;let t=(n,i,o)=>{if(!n)return;if(n.isFolder!==!0)return n;let a=Ue(Ue(o)===Ue(this.trashPath)?this.trashPath:i),s=n.folderId!=null&&n.folderId!==""?Ue(n.folderId):this.rootPath;return{...n,id:this._getOrGenerateId(a),name:n.name,folderId:s===Ue(this.rootPath)?this.rootPath||"":this._getOrGenerateId(s),isFolder:!0}},r=Oy(e,this.trashPath,this.trashId);return(async()=>{for(let n of r){let i=await Promise.resolve(this._inner.findItemByPath(n)),o=t(i,n,e);if(o)return o}})()}_getOrGenerateId(e){if(e===this.rootPath)return"";let t=Ue(e);if(t===Ue(this.trashPath))return this.trashId;if(this._pathToId.has(t))return this._pathToId.get(t);let r=Me();return this._pathToId.set(t,r),this._idToPath.set(r,t),r}pathForId(e,t,r){if(e===""||e===void 0)return this.rootPath;if(e===this.trashId)return this.trashPath;let n=this._idToPath.get(e);if(!n){if(r)return`unknown folder ${e}`;throw new z(`Path for id '${e}' not found in mapping`,"FileNotFound")}let i=0;for(;i<this.rootPath.length&&this.rootPath[i]==="/";)i++;if(i){let o=0;for(;o<n.length&&n[o]==="/";)o++;let a=n.slice(o);n="/".repeat(i)+a}return t&&this.ensureFolderTrailingSlash&&!n.endsWith("/")&&(n+="/"),n}_updateIdMapping(e,t){let r=t.replace(/^\/+|\/+$/g,""),n=this._idToPath.get(e);n&&this._pathToId.delete(n),this._idToPath.set(e,r),this._pathToId.set(r,e)}async getItems(e){let t=e.folderId?this.pathForId(e.folderId,!0):this.rootPath,r=await this._inner.getItems({...e,folderId:t}),n=r.items.map(i=>{let o=this._getOrGenerateId(i.id),a=i.folderId?this._getOrGenerateId(i.folderId):this._getOrGenerateId(this.rootPath);return{...i,id:o,folderId:a}});return{...r,items:n}}async createFolder(e,t,r){let n=t?this.pathForId(t,!0):this.rootPath,i=await this._inner.createFolder(e,n,r),o=this._getOrGenerateId(i.id),a=i.folderId?this._getOrGenerateId(i.folderId):this._getOrGenerateId(this.rootPath);return{...i,id:o,folderId:a}}async renameItem(e,t){if(typeof this._inner.renameItem!="function")throw new z("Rename item is not supported by inner storage","RenameNotAllowed");let r=this.pathForId(e.id,e.isFolder??!1),n=r,{...i}=await this._inner.renameItem({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},t);return this._updateIdMapping(e.id,i.id),e.isFolder&&this.remapCachedFolderContents(e.id,n,i.id),i.folderId&&(i={...i,folderId:this._getOrGenerateId(i.folderId)}),{...i,id:this._getOrGenerateId(i.id)}}async deleteItem(e,t){if(typeof this._inner.deleteItem!="function")throw new z("Delete item is not supported by inner storage","DeleteNotAllowed");let r=this.pathForId(e.id,e.isFolder??!1);await this._inner.deleteItem({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},t),this.recursivelyRemoveMappings(e.id,r)}async uploadFile(e){if(typeof this._inner.uploadFile!="function")throw new z("Upload file is not supported by inner storage","UnsupportedOperation");let t=e.folderId?this.pathForId(e.folderId,!0):this.rootPath,r=await this._inner.uploadFile({...e,folderId:t}),n=this._getOrGenerateId(r.id),i=r.folderId?this._getOrGenerateId(r.folderId):this._getOrGenerateId(this.rootPath);return{...r,id:n,folderId:i}}async uploadFiles(e){let t=e.folderId,r=e.items?.map(a=>a.folderId)??[],n=e.folderId?this.pathForId(e.folderId,!0):this.rootPath,i={...e,folderId:n,items:e.items?.map(a=>({...a,folderId:a.folderId?this.pathForId(a.folderId??"",!0):n}))??[]},o=await this._inner.uploadFiles(i);return{...o,detailed:o.detailed?.map((a,s)=>{if(!a?.data)return a;let c=a.data.id?this._getOrGenerateId(a.data.id):"",l=a.data.folderId?this._getOrGenerateId(a.data.folderId):r[s]??t??this._getOrGenerateId(this.rootPath);return{...a,data:{...a.data,id:c,folderId:l}}})}}async findFileByUrl(e,t){let r=t?this.pathForId(t,!0):this.rootPath;if(typeof this._inner.findFileByUrl=="function"){let n=await this._inner.findFileByUrl(e,r);if(!n)return;let i=this._getOrGenerateId(n.id),o=n.folderId?this._getOrGenerateId(n.folderId):this._getOrGenerateId(this.rootPath);return{...n,id:i,folderId:o}}}async uploadFileByUrl(e,t,r){let n=t?this.pathForId(t,!0):this.rootPath,i=await this._inner.uploadFileByUrl(e,n,r),o=this._getOrGenerateId(i.id),a=i.folderId?this._getOrGenerateId(i.folderId):this._getOrGenerateId(this.rootPath);return{...i,id:o,folderId:a}}async moveItem(e,t){if(typeof this._inner.moveItem!="function")throw new z("Move item is not supported by inner storage","MoveNotAllowed");let r=this.pathForId(e.id,e.isFolder??!1),n=t?this.pathForId(t,!0):this.rootPath,i=await this._inner.moveItem({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},n);this._updateIdMapping(e.id,i.id),e.isFolder&&this.remapCachedFolderContents(e.id,r,i.id);let o=this._getOrGenerateId(i.id),a=i.folderId?this._getOrGenerateId(i.folderId):t;return{...i,id:o,folderId:a}}async moveItems(e,t){if(typeof this._inner.moveItems!="function")throw new z("Move items is not supported by inner storage","MoveNotAllowed");let r=t?this.pathForId(t,!0):this.rootPath,n=e.map(a=>({...a,id:this.pathForId(a.id,a.isFolder??!1),folderId:a.folderId?this.pathForId(a.folderId??"",!0):this.rootPath})),i=await this._inner.moveItems(n,r),o=[];if(i.detailed&&i.detailed.length>0){let a=new Map;for(let s=0;s<i.detailed.length;s++){let c=i.detailed[s],l=c.requestId||(s<e.length?e[s].id:void 0);l&&a.set(l,c)}for(let s of e){let c=a.get(s.id)||(i.detailed.length===e.length?i.detailed[e.indexOf(s)]:void 0);if(c?.success&&c.data){if(this._updateIdMapping(s.id,c.data.id),s.isFolder){let l=this.pathForId(s.id,s.isFolder??!1);this.remapCachedFolderContents(s.id,l,c.data.id)}o.push({requestId:s.id,success:!0,data:{...c.data,id:this._getOrGenerateId(c.data.id),folderId:c.data.folderId?this._getOrGenerateId(c.data.folderId):t||this._getOrGenerateId(this.rootPath)}})}else o.push({requestId:s.id,success:!1,error:c?.error||{message:"Move operation failed - no detailed result",code:"MoveNotAllowed"}})}}else for(let a of e)o.push({requestId:a.id,success:!1,error:{message:"Move operation failed - no detailed results",code:"MoveNotAllowed"}});return{success:i.success,detailed:o,error:i.error}}async copyItems(e,t){if(typeof this._inner.copyItems!="function")throw new z("Copy items is not supported by inner storage","CopyNotAllowed");let r=t?this.pathForId(t,!0):this.rootPath,n=e.map(s=>({...s,id:this.pathForId(s.id,s.isFolder??!1),folderId:s.folderId?this.pathForId(s.folderId??"",!0):this.rootPath})),i=await this._inner.copyItems(n,r),o=[];if(i.detailed&&i.detailed.length>0){let s=new Map;for(let c=0;c<i.detailed.length;c++){let l=i.detailed[c],u=l.requestId||(c<e.length?e[c].id:void 0);u&&s.set(u,l)}for(let c of e){let l=s.get(c.id)||(i.detailed.length===e.length?i.detailed[e.indexOf(c)]:void 0);if(l?.success&&l.data?.id){let u=this._getOrGenerateId(l.data.id);o.push({requestId:c.id,success:!0,data:{...l.data,id:u,folderId:l.data.folderId?this._getOrGenerateId(l.data.folderId):t||this._getOrGenerateId(this.rootPath)}})}else{let u=l?l.success?l.data?l.data.id?{message:"Unknown copy error",code:"CopyNotAllowed"}:{message:"No ID in copied item data",code:"CopyNotAllowed"}:{message:"No data returned from copy operation",code:"CopyNotAllowed"}:l.error||{message:"Copy operation failed",code:"CopyNotAllowed"}:{message:"No detailed result from copy operation",code:"CopyNotAllowed"};o.push({requestId:c.id,success:!1,error:u})}}}else for(let s of e)o.push({requestId:s.id,success:!1,error:{message:"No detailed results from copy operation",code:"CopyNotAllowed"}});let a=o.every(s=>s.success);return{success:a,detailed:o,error:a?void 0:i.error||{message:"Copy operation completed with errors",code:"CopyNotAllowed"}}}async deleteItems(e,t){if(typeof this._inner.deleteItems!="function")throw new z("Delete items is not supported by inner storage","DeleteNotAllowed");let r=e.map(a=>({...a,id:this.pathForId(a.id,a.isFolder??!1),folderId:a.folderId?this.pathForId(a.folderId??"",!0):this.rootPath})),n=await this._inner.deleteItems(r,t),i=[];if(n.detailed&&n.detailed.length>0){let a=new Map;for(let s=0;s<n.detailed.length;s++){let c=n.detailed[s],l=c.requestId||(s<e.length?e[s].id:void 0);l&&a.set(l,c)}for(let s of e){let c=a.get(s.id)||(n.detailed.length===e.length?n.detailed[e.indexOf(s)]:void 0);if(c?.success){let l=this.pathForId(s.id,s.isFolder??!1);if(t.permanent)this.recursivelyRemoveMappings(s.id,l);else if(this._updateIdMapping(s.id,this.trashPath+"/"+l+(s.isFolder?"/":"")),s.isFolder){let u=this.pathForId(s.id,s.isFolder??!1);this.remapCachedFolderContents(s.id,u,this.trashPath+"/"+l+(s.isFolder?"/":""))}i.push({requestId:s.id,success:!0})}else i.push({requestId:s.id,success:!1,error:c?.error||{message:"Delete operation failed",code:"DeleteNotAllowed"}})}}else for(let a of e)if(n.success){let s=this.pathForId(a.id,a.isFolder??!1);if(t.permanent)this.recursivelyRemoveMappings(a.id,s);else if(this._updateIdMapping(a.id,this.trashPath+"/"+s+(a.isFolder?"/":"")),a.isFolder){let c=this.pathForId(a.id,a.isFolder??!1);this.remapCachedFolderContents(a.id,c,this.trashPath+"/"+s+(a.isFolder?"/":""))}i.push({requestId:a.id,success:!0})}else i.push({requestId:a.id,success:!1,error:n.error||{message:"Delete operation failed",code:"DeleteNotAllowed"}});let o=i.every(a=>a.success);return{success:o,detailed:i,error:o?void 0:n.error||{message:"Some items failed to delete",code:"DeleteNotAllowed"}}}remapCachedFolderContents(e,t,r){let n=t.replace(/\/+$/,""),i=r.replace(/\/+$/,""),o=[];for(let[a,s]of this._idToPath.entries()){let c=s.replace(/\/+$/,"");c!==n&&c.startsWith(n+"/")&&o.push({id:a,oldPath:c})}for(let{id:a,oldPath:s}of o){let c=i+s.substring(n.length);this._updateIdMapping(a,c)}}recursivelyRemoveMappings(e,t){let r=t.replace(/\/+$/,""),n=[],i=[];for(let[o,a]of this._idToPath.entries()){let s=a.replace(/\/+$/,"");(s===r||s.startsWith(r+"/"))&&(n.push(o),i.push(s))}for(let o=0;o<n.length;o++)this._idToPath.delete(n[o]),this._pathToId.delete(i[o])}async copyItem(e,t){if(typeof this._inner.copyItem!="function")throw new z("Copy item is not supported by inner storage","CopyNotAllowed");let r=this.pathForId(e.id,e.isFolder??!1),n=t?this.pathForId(t,!0):this.rootPath,i=await this._inner.copyItem({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},n),o=this._getOrGenerateId(i.id),a=i.folderId?this._getOrGenerateId(i.folderId):t??"";return{...i,id:o,folderId:a}}async updateFile(e,t){if(typeof this._inner.updateFile!="function")throw new z("Update file is not supported by inner storage","UnsupportedOperation");let r=this.pathForId(e.id,!1),{...n}=await this._inner.updateFile({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},t);return this._updateIdMapping(e.id,n.id),n.folderId&&(n={...n,folderId:this._getOrGenerateId(n.folderId)}),{...n,id:this._getOrGenerateId(n.id)}}async getFileData(e,t){let r=this.pathForId(e.id,!1);if(typeof this._inner.getFileData=="function")return this._inner.getFileData({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},t);let n=e.url||(typeof this.getUrl=="function"?await this.getUrl(e):void 0);if(!n)throw new z("Cannot get file data: no url and no inner.getFileData","FileReadError");return fetch(n,t?.forceReload?{cache:"no-store"}:void 0).then(i=>i.blob())}async cleanTrash(){if(typeof this._inner.cleanTrash!="function")throw new z("Clean trash is not supported by inner storage","UnsupportedOperation");return await this._inner.cleanTrash()}};function c1(e){return typeof e!="object"||!e?!1:"name"in e&&e.name==="DirectResourceFetchError"?!("final"in e)||e.final!==!1:"final"in e&&e.final===!0}function xo(e){if(c1(e)||e instanceof z)throw e}async function u1(e,t,r,n,i){let{fetchWithProxy:o,handleFileProxy:a,handleProxyUrl:s}=t,c={mode:"cors",...i?.fetchInit},l;if(a)try{let u=await Promise.resolve(a(e));if(u)return n(u)}catch(u){xo(u),l=u}if(s)try{let u=await Promise.resolve(s(e));if(u&&u!==e)return n(await r(u))}catch(u){xo(u),l=u}if(o)try{let u=await Promise.resolve(o(e,c,{intent:"downloadBlob"}));if(!u.ok)throw Error(`HTTP ${u.status}`);return n(await u.blob())}catch(u){xo(u),l=u}if(!o)try{return n(await r(e))}catch(u){xo(u),l=u}throw l instanceof Error?l:Error("Failed to download file from the URL")}var d1=1024,f1=d1/4096,$l=[137,80,78,71,13,10,26,10],p1=65536,m1=(e,t)=>String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);function h1(e){if(e.length<$l.length||$l.some((r,n)=>e[n]!==r))return!1;let t=$l.length;for(;t+8<=e.length;){let r=(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0,n=m1(e,t+4);if(n==="acTL")return!0;if(n==="IDAT"||n==="IEND")return!1;t+=12+r}return!1}async function g1(e){return h1(new Uint8Array(await e.slice(0,p1).arrayBuffer()))}function y1(e,t){return t.size<e.size?t:e}function $y(e){return e.replace(/\/+$/,"")}function _1(e,t){const r=$y(C.buildCdnFileUrl(t??{},[])),n=$y(e);if(!(!r||!n.startsWith(`${r}/`)))return n.slice(r.length+1).split("/").filter(Boolean)[0]}function v1(e,t={}){const r=t.projectId?.trim();if(!r)return!1;const n=C.unwrapResourceProxyUrl(e,t.appConfig,t.isStandalone);return C.isCdnUrl(n,t.appConfig)?_1(n,t.appConfig)===r:!1}function b1(e,t={}){return C.unwrapResourceProxyUrl(e,t.appConfig,t.isStandalone)}var E1=3,w1=/^(.+\.[a-zA-Z0-9]{1,8})\?[^?#]*$/;function S1(e){let t=e;for(let r=0;r<E1;r++)try{const n=decodeURIComponent(t);if(n===t)break;t=n}catch{break}return t.normalize("NFC")}function P1(e){const t=e.match(w1);return t?t[1]:e}function I1(e){if(/^https?:\/\//i.test(e))return new URL(e).pathname.split("/").filter(Boolean).pop();if(e.startsWith("//"))return new URL(e,"https://placeholder.invalid").pathname.split("/").filter(Boolean).pop()}function qy(e){const t=e.replaceAll("\\","/").trim();if(!t)return t;let r;try{r=I1(t)}catch{}if(!r){r=P1(t.split("/").pop()??"");const n=r.indexOf("#");n>=0&&(r=r.slice(0,n))}return S1(r)}function zy(e){const t=e.trim();if(t){if(!(/^https?:\/\//i.test(t)||t.startsWith("//")))try{new URL(t)}catch{return}return qy(t)||void 0}}var Gy={"platform.validation":"ValidationError","platform.malformed_body":"ValidationError","platform.invalid_uuid":"ValidationError","platform.invalid_field_value":"ValidationError","platform.unauthorized":"AuthenticationFailed","platform.forbidden":"AuthorizationFailed","platform.not_found":"FileNotFound","platform.conflict":"FolderAlreadyExists","platform.payload_too_large":"PayloadTooLarge","platform.unsupported_media_type":"FileTypeNotAllowed","platform.too_many_requests":"RateLimitExceeded","platform.unavailable":"ServiceUnavailable","platform.internal":"BackendError","filemanager.file_not_found":"FileNotFound","filemanager.folder_not_found":"FolderNotFound","filemanager.file_exists":"FileAlreadyExists","filemanager.folder_exists":"FolderAlreadyExists","filemanager.invalid_file_name":"FileInvalidName","filemanager.invalid_folder_name":"FolderInvalidName","filemanager.item_not_found":"FileNotFound","filemanager.no_project_access":"AuthorizationFailed","filemanager.project_required":"ValidationError","filemanager.invalid_project_id":"ValidationError","filemanager.file_too_large":"FileTooLarge","filemanager.upload_too_large":"PayloadTooLarge","filemanager.no_files":"ValidationError","filemanager.batch_limit_exceeded":"BatchItemLimitExceeded","filemanager.too_many_items":"BatchItemLimitExceeded","filemanager.items_required":"ValidationError","filemanager.unsupported_file_type":"FileTypeNotAllowed","filemanager.upload_url_rejected":"UploadUrlInvalid","filemanager.transfer_into_descendant":"MoveIntoDescendant","filemanager.legacy_file_unsupported":"UnsupportedOperation","filemanager.backfill_unsupported":"UnsupportedOperation","filemanager.backfill_already_done":"UnsupportedOperation","filemanager.storage_unavailable":"ServiceUnavailable"};function Hy(e){switch(e){case 400:return"ValidationError";case 401:return"AuthenticationFailed";case 403:return"AuthorizationFailed";case 404:return"FileNotFound";case 409:return"FolderAlreadyExists";case 413:return"PayloadTooLarge";case 415:return"FileTypeNotAllowed";case 429:return"RateLimitExceeded";case 503:return"ServiceUnavailable";case 504:return"Timeout";default:return"BackendError"}}function T1(e,t){return(e?Gy[e]:void 0)??Hy(t)}function C1(e){return(e?Gy[e]:void 0)??"FileWriteError"}var Vy=2e3,Wy=30,O1=Vy*Wy;function A1(e){return typeof e?.watchThumbnail=="function"}var Ky=200,M1=class _r{pathMode=!1;rootId="";trashPath=tt;useSoftDelete=!1;api;projectId;i18n;appConfig;isStandalone;onIndexingStateChange;pendingThumbnails=new Map;thumbWatchers=new Map;resolveSystemFolderByPath;constructor(t){this.api=t.restApi,this.projectId=t.projectId,this.i18n=t.i18n??yo,this.appConfig=t.appConfig,this.isStandalone=t.isStandalone,this.onIndexingStateChange=t.onIndexingStateChange,this.resolveSystemFolderByPath=KF({Trash:{id:tt,folderId:this.rootId}})}async getItems(t){const r=t.folderId===tt;if(t.itemType==="folder")return{items:await this.listFolders(t.folderId,r)};const n=t.itemType==="all"&&(t.page??1)<=1,[i,o]=await Promise.all([n?this.listFolders(t.folderId,r,t.search):[],this.listFiles(t,r)]);return{items:[...i,...o.items],pagination:o.pagination}}async listFolders(t,r,n){const i=await this.api.folders.foldersList({project_id:this.projectId,parent_id:r?void 0:this.normalizeFolderId(t),trashed:r||void 0});try{this.assertOk(i)}catch(a){if(_r.isNotFound(a))return[];throw a}let o=(i.data.items??[]).map(a=>this.mapFolder(a,t));if(n){const a=n.toLowerCase();o=o.filter(s=>s.name.toLowerCase().includes(a))}return o}async listFiles(t,r){const n=Math.min(t.limit??Ky,Ky),i=Math.max(t.page??1,1),o=await this.api.files.filesList({project_id:this.projectId,folder_id:r?void 0:this.normalizeFolderId(t.folderId),search:t.search||void 0,sort_by:t.sortBy,sort_order:t.sortOrder,limit:n,offset:(i-1)*n,trashed:r||void 0});try{this.assertOk(o)}catch(s){if(_r.isNotFound(s))return{items:[],pagination:{page:1,limit:n,total:0,totalPages:0,hasNext:!1,hasPrev:!1}};throw s}this.onIndexingStateChange?.(!!o.data.indexing);const a=r?tt:this.normalizeFolderId(t.folderId)??this.rootId;return{items:(o.data.data??[]).map(s=>this.mapFile(s,a)),pagination:this.mapPagination(o.data.page,n)}}async createFolder(t,r){const n=await this.api.folders.foldersCreate({project_id:this.projectId,name:t,parent_id:this.normalizeFolderId(r)});return this.assertOk(n),this.mapFolder(n.data.folder??{},r)}async uploadFileByUrl(t,r){const n=await this.api.files.uploadByUrlCreate({project_id:this.projectId,url:t,folder_id:this.normalizeFolderId(r)});return this.assertOk(n),this.mapFile(n.data.file??{},this.normalizeFolderId(r)??this.rootId)}async uploadFiles(t){if(t.items.length===0)return{success:!0,detailed:[]};const r=new Map;t.items.forEach((o,a)=>{const s=this.normalizeFolderId(o.folderId??t.folderId??void 0)??this.rootId,c=o.requestId??`item-${a}`,l=r.get(s)??[];l.push({item:o,requestId:c}),r.set(s,l)});const n=[];for(const[o,a]of r){const s=new FormData;s.append("project_id",this.projectId),o!==this.rootId&&s.append("folder_id",o);for(const{item:u,requestId:d}of a)s.append("request_id",d),s.append("file",u.data,u.name);let c;try{c=await this.api.request({path:"/files",method:"POST",body:s,type:W.FormData,format:"json",secure:!0}),this.assertOk(c)}catch(u){for(const{requestId:d}of a)n.push({requestId:d,success:!1,error:_r.toErrorInfo(u)});continue}const l=new Map((c.data.items??[]).map(u=>[u.request_id,u]));a.forEach(({requestId:u},d)=>{const f=l.get(u)??c.data.items?.[d];f?.file?n.push({requestId:u,success:!0,data:this.mapFile(f.file,o)}):n.push({requestId:u,success:!1,error:this.mapItemFail(f?.error)})})}const i=n.filter(o=>!o.success);return{success:i.length===0,error:i[0]?.error,detailed:n}}async uploadFile(t){const r=(await this.uploadFiles({items:[{name:t.name,size:t.size,type:t.type,folderId:t.folderId,data:t.data}]})).detailed?.[0];if(!r?.success||!r.data){const n=r?.error;throw n instanceof le?n:new le(String(n?.message??this.i18n.__("Unknown error")),n?.code||"FileWriteError",typeof n?.status=="number"?n.status:void 0)}return r.data}async updateFile(t,r){let n={id:t.id};if(r.data!==void 0){const i=typeof r.data=="string"?_r.base64ToBlob(r.data,t.type):r.data,o=new FormData;o.append("project_id",this.projectId),o.append("file",i,t.name);const a=await this.api.request({path:`/files/${t.id}/content`,method:"PUT",body:o,type:W.FormData,format:"json",secure:!0});this.assertOk(a);const s=a.data.file??{};n={...n,size:s.size,type:s.mime,url:s.url,thumbnail:s.thumbnail_url,thumbnailUrl:s.thumbnail_url,lastEdited:s.updated_at}}if(r.name&&r.name!==t.name){const i=await this.renameItem(t,r.name);n={...n,...i}}return n}getFileData=async(t,r)=>{const{__:n}=this.i18n;if(!t.url)throw new le(n("Failed to get file: %s").replace("%s",t.name),"FileReadError");const i=await C.fetchWithResourceProxy(t.url,{config:this.appConfig,standalone:this.isStandalone,resourceType:C.isCdnUrl(t.url,this.appConfig)?"cdn":"generic",intent:"downloadBlob",init:r?.forceReload?{cache:"no-store"}:void 0});if(i.ok)return i.blob();const o=await i.text();throw new le(o||n("Failed to get file: %s").replace("%s",i.statusText),Hy(i.status),i.status)};static base64ToBlob(t,r){const n=t.includes(",")?t.slice(t.indexOf(",")+1):t,i=atob(n),o=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)o[a]=i.charCodeAt(a);return new Blob([o],r?{type:r}:void 0)}mapItemFail(t){const{__:r}=this.i18n;return{message:t?.message||r("Unknown error"),code:C1(t?.code)}}async renameItem(t,r){if(t.isFolder){const o=await this.api.folders.foldersPartialUpdate({id:t.id},{project_id:this.projectId,name:r});this.assertOk(o);const a=o.data.folder??{};return{id:t.id,name:a.name??r,folderId:a.parent_id??t.folderId,isFolder:!0,lastEdited:a.updated_at}}const n=await this.api.files.filesPartialUpdate({id:t.id},{project_id:this.projectId,name:r,mode:"replace"});this.assertOk(n);const i=n.data.file??{};return{id:t.id,name:i.name??r,folderId:i.folder_id??t.folderId,isFolder:!1,url:i.url,thumbnail:i.thumbnail_url,thumbnailUrl:i.thumbnail_url,extension:i.ext,type:i.mime,lastEdited:i.updated_at}}async deleteItem(t,r){try{if(t.isFolder){const n=await this.api.folders.foldersDelete({id:t.id,project_id:this.projectId,permanent:r.permanent||void 0});this.assertOk(n)}else{const n=await this.api.files.filesDelete({id:t.id,project_id:this.projectId,permanent:r.permanent||void 0});this.assertOk(n)}}catch(n){if(!_r.isNotFound(n))throw n}}async deleteItems(t,r){if(t.length===0)return{success:!0};const n=new Set(t.filter(s=>s.isFolder).map(s=>s.id)),i=new Set(t.filter(s=>n.has(s.folderId))),o=[];for(const s of t){if(i.has(s)){o.push({requestId:s.id,success:!0});continue}try{await this.deleteItem(s,r),o.push({requestId:s.id,success:!0})}catch(c){o.push({requestId:s.id,success:!1,error:_r.toErrorInfo(c)})}}const a=o.filter(s=>!s.success);return{success:a.length===0,error:a[0]?.error,detailed:o}}async moveItems(t,r){if(t.length===0)return{success:!0,detailed:[]};const n=t.filter(s=>s.folderId===tt),i=t.filter(s=>s.folderId!==tt),o=[];if(n.length>0){const s=await this.api.trash.restoreCreate({project_id:this.projectId,ids:n.map(c=>c.id),target_folder_id:this.normalizeFolderId(r),on_conflict:"keep_both"});this.assertOk(s),o.push(...this.mapTransferResults(s.data.items,n))}if(i.length>0){const s=await this.api.items.moveCreate({project_id:this.projectId,ids:i.map(c=>c.id),target_folder_id:this.normalizeFolderId(r)});this.assertOk(s),o.push(...this.mapTransferResults(s.data.items,i))}const a=o.filter(s=>!s.success);return{success:a.length===0,error:a[0]?.error,detailed:o}}async moveItem(t,r){return this.unwrapSingleTransfer(await this.moveItems([t],r),t)}async copyItems(t,r){if(t.length===0)return{success:!0,detailed:[]};const n=await this.api.items.copyCreate({project_id:this.projectId,ids:t.map(a=>a.id),target_folder_id:this.normalizeFolderId(r)});this.assertOk(n);const i=this.mapTransferResults(n.data.items,t),o=i.filter(a=>!a.success);return{success:o.length===0,error:o[0]?.error,detailed:i}}async copyItem(t,r){return this.unwrapSingleTransfer(await this.copyItems([t],r),t)}async cleanTrash(){const t=await this.api.trash.emptyCreate({project_id:this.projectId});return this.assertOk(t),{success:!0,deletedCount:(t.data.deleted_files??0)+(t.data.deleted_folders??0)}}async clearCache(t){}findItemByPath(t){return this.resolveSystemFolderByPath(t)}async findFileByUrl(t,r){const n={appConfig:this.appConfig,isStandalone:this.isStandalone,projectId:this.projectId};if(!v1(t,n))return;const i=b1(t,n),o=zy(i);if(!o)return;const{items:a}=await this.listFiles({folderId:r,search:o},!1);return a.find(s=>s.url===t||s.url===i)}mapTransferResults(t,r){const n=new Map(r.map(i=>[i.id,i]));return(t??[]).map((i,o)=>{const a=i.id??r[o]?.id,s=a?n.get(a):r[o];return i.error?{requestId:a,success:!1,error:this.mapItemFail(i.error)}:{requestId:a,success:!0,data:i.file?this.mapFile(i.file,i.file.folder_id??this.rootId):i.folder?this.mapFolder(i.folder):s?{id:s.id}:{id:a??""}}})}unwrapSingleTransfer(t,r){const n=t.detailed?.[0];if(!n?.success){const i=n?.error??t.error;throw i instanceof le?i:new le(String(i?.message??this.i18n.__("Unknown error")),i?.code||"BackendError",typeof i?.status=="number"?i.status:void 0)}return n.data??{id:r.id}}mapFile(t,r){return this.trackThumbnailReadiness(t),{id:t.id??"",name:t.name??"",folderId:t.folder_id??r,isFolder:!1,size:t.size,date:t.created_at,lastEdited:t.updated_at,type:t.mime,extension:t.ext,url:t.url,thumbnail:t.thumbnail_url,thumbnailUrl:t.thumbnail_url,dimensions:t.width&&t.height?`${t.width}x${t.height}`:void 0,aspectRatio:t.width&&t.height?String(t.width/t.height):void 0,selected:!1}}trackThumbnailReadiness(t){if(!t.id||!t.url||!t.mime?.startsWith("image/"))return;if(t.thumbnail_url){this.pendingThumbnails.delete(t.url);return}const r=t.created_at?new Date(t.created_at).getTime():NaN;Number.isFinite(r)&&Date.now()-r<O1?this.pendingThumbnails.set(t.url,t.id):this.pendingThumbnails.delete(t.url)}watchThumbnail(t,r){const n=this.pendingThumbnails.get(t);if(!n)return()=>{};const i=this.thumbWatchers.get(n);if(i)return i.listeners.add(r),()=>i.listeners.delete(r);const o={listeners:new Set([r]),cancelled:!1};return this.thumbWatchers.set(n,o),this.pollThumbnail(n,t,o),()=>{o.listeners.delete(r),o.listeners.size===0&&(o.cancelled=!0,this.thumbWatchers.delete(n))}}async pollThumbnail(t,r,n){for(let i=0;i<Wy;i+=1){if(await new Promise(a=>setTimeout(a,Vy)),n.cancelled)return;let o;try{const a=await this.api.files.filesDetail({id:t,project_id:this.projectId});a.ok&&!a.error&&(o=a.data.file?.thumbnail_url)}catch{}if(n.cancelled)return;if(o){this.pendingThumbnails.delete(r),this.thumbWatchers.delete(t),n.listeners.forEach(a=>a(o));return}}this.thumbWatchers.delete(t),this.pendingThumbnails.delete(r)}mapFolder(t,r){return{id:t.id??"",name:t.name??"",folderId:t.parent_id??this.normalizeFolderId(r)??this.rootId,isFolder:!0,date:t.created_at,lastEdited:t.updated_at,selected:!1}}mapPagination(t,r){const n=t?.limit??r,i=t?.offset??0,o=t?.total??0,a=n>0?Math.floor(i/n)+1:1,s=n>0?Math.ceil(o/n):0;return{page:a,limit:n,total:o,totalPages:s,hasNext:a<s,hasPrev:a>1}}normalizeFolderId(t){if(!(!t||t===this.rootId))return t}assertOk(t){if(t.ok&&!t.error)return;const{__:r}=this.i18n,n=t.error?.error,i=T1(n?.code,t.status);throw new le(n?.message||r("Unknown error"),i,t.status)}static isNotFound(t){return t instanceof le&&(t.code==="FileNotFound"||t.code==="FolderNotFound")}static toErrorInfo(t){return t instanceof le||t instanceof Error?t:{message:String(t),raw:t}}};function Qy({storageProvider:e,projectId:t,restApi:r,restApiV2:n,i18n:i,pathPostfix:o,appConfig:a,isStandalone:s,onIndexingStateChange:c}){const l=a?.fileManager,u=l?{...l,enablePagination:l.enablePagination===!1?!!l.clientSidePaging:l.enablePagination}:void 0,d=!!n&&vy(a),f=e||(d&&n?new M1({projectId:t,restApi:n,i18n:i,appConfig:a,isStandalone:s,onIndexingStateChange:c}):new $F({projectId:t,restApi:r,i18n:i,pathPostfix:o,appConfig:a,isStandalone:s})),m=f.pathMode?new By(f,f.rootId??"",tt,f.trashPath,!0):null;return{storageProvider:f,pathProxy:m,dataProvider:new Uy(m??f,u,{...f,trashPath:f.pathMode?"trash":f.trashPath,rootId:f.pathMode?"":f.rootId??""},{fetchWithProxy:(g,h)=>C.fetchWithResourceProxy(g,{config:a,standalone:s,intent:"downloadBlob",init:h})}),usesBuiltInStorage:!e}}var k1=class{http;constructor(e){this.http=e}filesList=(e,t={})=>this.http.request({path:"/files",method:"GET",query:e,secure:!0,format:"json",...t});filesCreate=(e={})=>this.http.request({path:"/files",method:"POST",secure:!0,format:"json",...e});filesDelete=({id:e,...t},r={})=>this.http.request({path:`/files/${e}`,method:"DELETE",query:t,secure:!0,...r});filesDetail=({id:e,...t},r={})=>this.http.request({path:`/files/${e}`,method:"GET",query:t,secure:!0,format:"json",...r});filesPartialUpdate=({id:e},t,r={})=>this.http.request({path:`/files/${e}`,method:"PATCH",body:t,secure:!0,type:W.Json,format:"json",...r});contentList=({id:e,...t},r={})=>this.http.request({path:`/files/${e}/content`,method:"GET",query:t,secure:!0,...r});contentUpdate=({id:e},t={})=>this.http.request({path:`/files/${e}/content`,method:"PUT",secure:!0,format:"json",...t});backfillList=(e,t={})=>this.http.request({path:"/files/backfill",method:"GET",query:e,secure:!0,format:"json",...t});backfillCreate=(e,t={})=>this.http.request({path:"/files/backfill",method:"POST",body:e,secure:!0,type:W.Json,format:"json",...t});backfillCancelCreate=(e,t={})=>this.http.request({path:"/files/backfill/cancel",method:"POST",body:e,secure:!0,type:W.Json,format:"json",...t});uploadByUrlCreate=(e,t={})=>this.http.request({path:"/files/upload-by-url",method:"POST",body:e,secure:!0,type:W.Json,format:"json",...t})},j1=class{http;constructor(e){this.http=e}foldersList=(e,t={})=>this.http.request({path:"/folders",method:"GET",query:e,secure:!0,format:"json",...t});foldersCreate=(e,t={})=>this.http.request({path:"/folders",method:"POST",body:e,secure:!0,type:W.Json,format:"json",...t});foldersDelete=({id:e,...t},r={})=>this.http.request({path:`/folders/${e}`,method:"DELETE",query:t,secure:!0,...r});foldersPartialUpdate=({id:e},t,r={})=>this.http.request({path:`/folders/${e}`,method:"PATCH",body:t,secure:!0,type:W.Json,format:"json",...r})},R1=class{http;constructor(e){this.http=e}copyCreate=(e,t={})=>this.http.request({path:"/items/copy",method:"POST",body:e,secure:!0,type:W.Json,format:"json",...t});moveCreate=(e,t={})=>this.http.request({path:"/items/move",method:"POST",body:e,secure:!0,type:W.Json,format:"json",...t})},N1=class{http;constructor(e){this.http=e}emptyCreate=(e,t={})=>this.http.request({path:"/trash/empty",method:"POST",body:e,secure:!0,type:W.Json,format:"json",...t});restoreCreate=(e,t={})=>this.http.request({path:"/trash/restore",method:"POST",body:e,secure:!0,type:W.Json,format:"json",...t})},D1=class extends im{files=new k1(this);folders=new j1(this);items=new R1(this);trash=new N1(this)};function Yy(e){const t=(C.isStateContainer(e)?C.getContainer(e):e)?.getInstance(C.CUSTOM_FETCH_ID);return new D1({baseUrl:"https://app.emailmaker.ru/api/v2",customFetch:t?.execute??C.globalFetch})}function L1(){const e=st(),t=yy(),r=Ve(),n=se(),i=he(),o=ur(),a=Tt(C.events.UPLOAD_EVENT_ID),s=r?.id?String(r.id):"",c=o?.id!=="0"?String(o?.id??""):"";return(0,b.useCallback)(async l=>{const u=await py(a,{file:l,project:s});if(u.url)return u.url;const d=C.getContainer(n),{dataProvider:f,usesBuiltInStorage:m}=Qy({storageProvider:d.getInstance(C.STORAGE_PROVIDER_ID),projectId:s,restApi:C.getApi(d,_y),restApiV2:Yy(n),i18n:i,pathPostfix:c,appConfig:e,isStandalone:t,onIndexingStateChange:()=>{}});if(!my(u,{isStandalone:t,targetIsOurBackend:!!m}))throw hy(u);const g=await fy(l,f);if(!g?.url)throw new Error(i.__("The image could not be uploaded."));return g.url},[e,i,t,s,n,a,c])}var F1=({users:e,isEditor:t,isPlugin:r,token:n})=>{const[i,o]=(0,b.useState)(!1),a=window.localStorage.getItem(It.em_color_scheme),s=u=>{const{first_name:d,last_name:f,email:m}=u.user.name;return d?`${d.split("")[0]}${f?`${f.split("")[0]}`:""}`:m?.split("")[0].toUpperCase()||" "},c=u=>{const{first_name:d,last_name:f,email:m}=u.user.name;return d&&f?`${d} ${f}`:d||m},l=u=>{const d=c(u);return(0,R.jsx)("span",{children:d})};return(0,R.jsx)(R.Fragment,{children:e.length>0&&t&&(0,R.jsx)("div",{className:`user-list ${i?"open":""}`,style:r?{left:"60px",bottom:"10px"}:{},onMouseOver:()=>o(!0),onMouseOut:()=>o(!1),children:e.map(u=>(0,R.jsx)("div",{className:"user",style:{[Ir("user-color")]:u.user.color,[Ir("border-color")]:n?.colorBgContainer,[Ir("text-color")]:a==="dark"?n?.colorIconHover:n?.colorWhite},children:(0,R.jsx)(B.ui_kit$Tooltip,{title:l(u),placement:"topLeft",trigger:"hover",color:n?.colorBgSpotlight,children:(0,R.jsx)("div",{children:s(u)})})},u.user.color))})})},Uo="Ai",Xy=Ie({reducerPath:"AiApi",tagTypes:[Uo],baseQuery:Fe({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({sendMessage:e.mutation({queryFn({body:t},r){return H(r).aiGenerator.ai_create(t)}}),getDialog:e.query({queryFn({entity_id:t,connection:r="chat"},n){return $t(C.getContainer(n)).aiAssistentEnabled===!1?Promise.resolve({data:{documents:[],totalCount:0}}):H(n).aiGenerator.ai_status_list({connection:r,entity_id:t})},providesTags:t=>t?.documents?[...t.documents.map(({id:r})=>({type:Uo,id:r})),{type:Uo,id:"LIST"}]:[{type:Uo,id:"LIST"}]})})}),{useSendMessageMutation:x1,useGetDialogQuery:U1,useLazyGetDialogQuery:B1}=Xy,$1=async(e,t,r)=>{const n=H(t).baseUrl.replaceAll(/[\\/]$/g,""),i=await Fe({baseUrl:n})(e,t,r);if(i.error){let o=i.error;if(typeof o.json=="function")try{o=await o.json()}catch{o=await o}return{error:o}}return i};async function Jy(){const{EventSourcePolyfill:e}=await(0,ut.__vitePreload)(async()=>{const{EventSourcePolyfill:t}=await Promise.resolve().then(()=>Promise.resolve(me("./6933d533.js")).then(r=>Q.__toESM(r.default)));return{EventSourcePolyfill:t}},void 0,{}.url);if(typeof e!="function")throw new Error("event-source-polyfill: EventSourcePolyfill is not a constructor");return e}var Zy=Ie({reducerPath:"AiApiGenerator",baseQuery:$1,endpoints:e=>({generateIdForTask:e.mutation({queryFn(t,r){return VO(r).tasks.tasksControllerCreateTask(t).then(n=>n)}}),clearAiChat:e.query({queryFn(t,r){return H(r).aiGenerator.clear_history_list(t).then(n=>n)}}),getGeneratedContent:e.query({queryFn:t=>({data:[]}),async onCacheEntryAdded({id:t,setError:r},n){const{updateCachedData:i,cacheEntryRemoved:o}=n,a=H(n).baseUrl.indexOf("emailmaker")>=0?Id.maker:Id.blocks;let s;try{const c=await C.getContainer(n).getInstance(C.TOKEN_ID),l=c?{Authorization:`Bearer ${c}`}:{};s=new(await Jy())(`${a}/tasks/${t}`,{headers:l})}catch{r("Error connecting to EventSource");return}s.onmessage=c=>{const l=JSON.parse(c.data);i(u=>{u.push(l)})},s.onerror=c=>{r("Error connecting to EventSource"),s.close()},await o,s.close()}}),getAiGenerateStatus:e.mutation({query:t=>({url:"/constructor/v1/ai-save-task",method:"POST",body:t})})})}),{useGenerateIdForTaskMutation:fG,useGetGeneratedContentQuery:pG,useLazyClearAiChatQuery:q1,useLazyGetGeneratedContentQuery:z1,useGetAiGenerateStatusMutation:G1}=Zy;function Qn({id:e,post:t,parent:r,author:n,content:i,acf:{status:o,target_id:a},...s}){return{...s,id:pe(e),post:pe(t),parent:pe(r),author:pe(n),content:lt(i),target_id:a,comment_status:o}}var Wt="Comments",e_=Ie({reducerPath:"commentsApi",tagTypes:[Wt],baseQuery:Fe({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getComments:e.query({queryFn:function(t,r){return H(r).wp.comments_list({post:[Pe(t)],per_page:50,order:"asc"}).then(ze(Qn))},providesTags:t=>t?[...t.map(({id:r})=>({type:Wt,id:r})),{type:Wt,id:"LIST"}]:[{type:Wt,id:"LIST"}]}),addComment:e.mutation({queryFn({subjectId:t,author:r,parent:n,content:i,author_name:o,author_email:a,targetId:s},c){const l=H(c),u={post:Pe(t),author:Pe(r),author_name:o,author_email:a},d={};return i&&(u.content=i),n&&(u.parent=Pe(n)),s&&(d["acf[target_id]"]=s),l.wp.comments_create(u,{type:C.ContentType.UrlEncoded,extraQuery:d}).then(we(Qn))},invalidatesTags:[{type:Wt,id:"LIST"}]}),deleteComment:e.mutation({queryFn(t,r){return H(r).wp.comments_delete({id:t},{}).then(Ri(Qn))},invalidatesTags:[{type:Wt,id:"LIST"}]}),editComment:e.mutation({queryFn({commentId:t,content:r,status:n,targetId:i},o){const a=H(o),s={},c={};return r&&(s.content=r),n&&(c["acf[status]"]=n),i&&(c["acf[target_id]"]=i),a.wp.comments_update({id:t},s,{type:C.ContentType.UrlEncoded,extraQuery:c}).then(we(Qn))},invalidatesTags:[{type:Wt,id:"LIST"}]}),deleteTarget:e.mutation({queryFn(t,r){return H(r).wp.comments_update({id:t},{},{type:C.ContentType.UrlEncoded,extraQuery:{"acf[target_id]":""}}).then(we(Qn))},invalidatesTags:[{type:Wt,id:"LIST"}]})})}),{useGetCommentsQuery:H1,useAddCommentMutation:V1,useDeleteCommentMutation:W1,useEditCommentMutation:K1,useDeleteTargetMutation:Q1}=e_,t_={isCollapsed:!0,isMonacoFocusing:!1},r_="defaultModePanesSlice",n_=Te({name:r_,initialState:t_,reducers:{setMonacoFocusing:(e,t)=>{e.isMonacoFocusing=t.payload},resetPanes:()=>t_}}),{resetPanes:Y1,setMonacoFocusing:X1}=n_.actions,J1=e=>e[r_].isMonacoFocusing,i_={blocksTotal:null,blocksTotalPages:null,parentEmailBlocksTotal:null,parentEmailBlocksTotalPages:null,templateBlocks:[],templateBlocksTotal:null,templateBlocksTotalPages:null,elementsView:Ed,elementsList:[],customFolders:{},blocksTrashTotal:0,elementsTrashList:[]},Bo="blocksPageSlice",o_=Te({name:Bo,initialState:i_,reducers:{resetPagesAndTotal:()=>i_,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeBlockFromList:(e,{payload:t})=>{const r=e.customFolders;t.folder!=="all"&&r[t.folder]?.list&&(r[t.folder]={...r[t.folder],list:r[t.folder].list.filter(n=>n.id!==t.emailId),total:r[t.folder].total-1},e.customFolders=r)}},extraReducers:e=>{e.addMatcher(Vt.endpoints.getBlocks.matchFulfilled,(t,{meta:r,payload:n})=>{const i=r.baseQueryMeta?.response.headers.get("X-WP-Total")||n?.length,o=r.arg.originalArgs?.status==="trash",a=!!r.arg.originalArgs?.name?.length,s=r.arg.originalArgs?.page,c=r.arg.originalArgs?.folderTag||r.arg.originalArgs?.tags?.[0];o?(a||(t.blocksTrashTotal=i),t.elementsTrashList=n):c?t.customFolders={...t.customFolders,[c]:{list:n,page:s,total:i}}:(t.blocksTotal=i,t.elementsList=n)}),e.addMatcher(Vt.endpoints.getParentEmailBlocks.matchFulfilled,(t,{meta:r,payload:n})=>{const i=r.baseQueryMeta?.response.headers.get("X-WP-Total")||n?.length||null,o=r.baseQueryMeta?.response.headers.get("X-WP-TotalPages");t.parentEmailBlocksTotal=i,t.parentEmailBlocksTotalPages=o}),e.addMatcher(Vt.endpoints.getTemplateBlocks.matchFulfilled,(t,{meta:r,payload:n})=>{const i=r.baseQueryMeta?.response.headers.get("X-WP-Total")||n?.length||null,o=r.baseQueryMeta?.response.headers.get("X-WP-TotalPages");t.templateBlocks=n,t.templateBlocksTotal=i,t.templateBlocksTotalPages=o}),e.addMatcher(Vt.endpoints.editBlock.matchFulfilled,(t,{payload:r})=>{t.elementsList.map(n=>n.id?.toString()===r.id?.toString()?Object.assign(n,{lock:r.lock,title:r.title,blocktags:r.blocktags}):n)})}}),{resetPagesAndTotal:mG,resetElementsList:hG,toggleElementsView:gG,removeBlockFromList:yG}=o_.actions,Z1=e=>e[Bo].blocksTotal,ex=e=>e[Bo].templateBlocksTotal,tx=e=>e[Bo].parentEmailBlocksTotal,rx=C.createIdentifier$1("CanvasViewport"),_G=C.createIdentifier$1("CanvasPreviewPage"),nx=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},Yn=(e,t)=>{nx()},Xn=null,ql=[],Jn=null,a_="custom",ix=e=>{ql=e,Xn=null,Jn=null},s_=e=>{const t=e.weight?.trim()||"400",r=e.style??"normal";return r==="italic"||r==="oblique"?`${t}i`:t},ox=e=>{if(!ql.length)return e;const t=Array.isArray(e.familyMetadataList)?[...e.familyMetadataList]:[],r=new Map;for(const i of ql){const o=i.family?.trim()||F0(i.source_url)||i.name.trim();if(!o)continue;const a=q0(i.source_url,o),s=a.length?a.map(l=>s_({...i,...l})):[s_(i)];let c=r.get(o);c||(c={family:o,category:a_,subsets:["cyrillic","latin"],popularity:0,fonts:{}},r.set(o,c));for(const l of s)c.fonts[l]={}}if(!r.size)return e;const n=t.filter(i=>i?.category!==a_||!(typeof i.family=="string"&&r.has(i.family)));return{...e,familyMetadataList:[...r.values(),...n]}},ax=()=>Xn?Promise.resolve(Xn):(Jn!==null||(Jn=(0,ut.__vitePreload)(async()=>{const{default:e}=await Promise.resolve().then(()=>me("./8bf56b5b.js"));return{default:e}},void 0,{}.url).then(({default:e})=>(Xn=ox(e),Xn)).catch(e=>{throw e})),Jn),sx=e=>[...e].sort((t,r)=>t.order-r.order).map(t=>t.hex.toUpperCase()),lx=(e,t)=>{const r=Array.isArray(e?.usedColors)?e.usedColors:[],n=new Set,i=[];for(const o of[...r,...sx(t)]){const a=String(o??"").trim().toUpperCase();!a||n.has(a)||(n.add(a),i.push(o))}return{...e,usedColors:i}},l_,cx=e=>{l_=e},ux=e=>lx(e,l_?.colors??[]),dx=e=>{const t=Ge(),r=wg(e),[n,i]=(0,b.useState)("");(0,b.useEffect)(()=>{cx(r);const a=r?.fonts??[];ix(a),mN(a),Yn("parent: cache + host @font-face synced",{projectId:e,fontsCount:a.length,families:a.map(s=>s.family?.trim()||s.name)})},[r,e]),(0,b.useEffect)(()=>{const a=r?.fonts??[],s=sN(a),c=JSON.stringify(s);if(c===n){Yn("parent: iframe send skipped (unchanged)",{entriesCount:s.length});return}Yn("parent: scheduling SANDBOX_SET_PROJECT_FONTS",{entriesCount:s.length,entries:s});const l=()=>{t.send(ne.SANDBOX_SET_PROJECT_FONTS,s),i(c),Yn("parent: SANDBOX_SET_PROJECT_FONTS sent",{entriesCount:s.length})};if(t.inited){l();return}const u=t.onInit(()=>{l()});return()=>u.dispose()},[t,r,n]);const o=(0,b.useCallback)(()=>{Yn("parent: iframe reload — will resend project fonts map"),i("")},[]);Il(o)},zl="em_version";function c_(e){if(!e||!e.includes("em_version"))return e;try{const t=typeof document<"u"?document.baseURI:"http://localhost/",r=new URL(e,t);return r.searchParams.has("em_version")?(r.searchParams.delete(zl),/^https?:\/\//i.test(e)||e.startsWith("//")?r.href:r.pathname+r.search+r.hash):e}catch{return e}}function fx(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",r=new URL(e,t);return r.searchParams.set(zl,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?r.href:r.pathname+r.search+r.hash}catch{return`${e}${e.includes("?")?"&":"?"}${zl}=${Date.now()}`}}var px=[ne.APPLICATION_OPEN_IMAGE_AI_POPUP,ne.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP,ne.APPLICATION_OPEN_IMAGE_EDIT_POPUP,ne.APPLICATION_OPEN_IMAGE_GIF_POPUP,ne.APPLICATION_OPEN_IMAGE_STOCK_POPUP],mx=3e3,u_=new WeakMap;function d_(e){let t=u_.get(e);return t||(t={request:null,listeners:new Set},u_.set(e,t)),t}function f_(e){return c_(typeof e=="string"?e:"")}function hx(){const e=Ge();zn(t=>{const r=t.data;if(!r?.operation||!px.includes(r.operation))return;const n=d_(e);n.request={operation:r.operation,src:f_(r.src),at:Date.now()},n.listeners.forEach(i=>i())})}function gx(e,t){const r=Ge(),n=(0,b.useRef)(t);n.current=t,(0,b.useEffect)(()=>{const i=d_(r),o=f_(e),a=()=>{const s=i.request;!s||s.src!==o||Date.now()-s.at>mx||(i.request=null,n.current(s.operation))};return i.listeners.add(a),a(),()=>{i.listeners.delete(a)}},[r,e])}function yx(e){Promise.resolve(e).catch(t=>{})}var p_=new Set;function _x(e,t){p_.has(e)||(p_.add(e),t())}function vx(e){return e?.lockEditor===!0}function m_(){return vx(st())}function Gl(){const e=(0,b.useRef)(!1);return e.current=m_(),(0,b.useCallback)(()=>e.current,[])}function bx(e,t,r,n){const i=aa(e),o=Symbol(`once-handler-${t}`),a=i?s=>{s[o]||(s[o]=!0,r(s))}:r;return i?.addEventListener(t,a,n),window.addEventListener(t,a,n),{dispose:()=>{i?.removeEventListener(t,a,n),window.removeEventListener(t,a,n)}}}function Ex(e,t,r,n){const i=aa(e),o=Symbol(`once-handler-${t}`),a=i?s=>{s[o]||(s[o]=!0,r(s))}:r;return i?.addEventListener(t,a,n),document.addEventListener(t,a,n),{dispose:()=>{i?.removeEventListener(t,a,n),document.removeEventListener(t,a,n)}}}var wx=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Hl(e){return wx.test(e)||e.indexOf("//")===0}function Zn(e){return e&&(e.endsWith("/")?e:`${e}/`)}function h_(){return typeof document<"u"&&document.baseURI?document.baseURI:typeof window<"u"&&window.location?window.location.href:""}function g_(e,t){const r=e==null||e===""?"./":String(e);if(Hl(r))return Zn(r);const n=t??h_();if(!n)return Zn(r);try{return Zn(new URL(r,n).href)}catch{return Zn(r)}}function Sx(e,t){const r=t??h_();if(!r)return e;try{return new URL(e,r).href}catch{return e}}function Px(e,t){const r=String(e??"");if(!r)return"";if(Hl(r))return r;if(r.charAt(0)==="/")return Sx(r);const n=r.replace(/^\.\/+/,"").replace(/^\/+/,"");try{return new URL(n,t).href}catch{return Zn(t)+n}}function y_(){return typeof window.__emailmaker__<"u"&&window.__emailmaker__?.publicPath?g_(window.__emailmaker__.publicPath):g_("/")}function Ix(e){return Px(e,y_())}function __(e){const t=Ix(e);return Hl(t)?t:typeof window<"u"&&window.location?.origin?new URL(t.startsWith("/")?t:`/${t}`,window.location.origin).href:t}var Vl=e=>{if(!e)return"image/png";const t=e.toLowerCase();return t.includes("jpeg")||t.includes("jpg")||t.includes("pjpeg")?"image/jpeg":t.includes("png")?"image/png":t.includes("gif")?"image/gif":t.includes("webp")?"image/webp":t.includes("svg")?"image/svg+xml":"image/png"},v_=e=>{const t=Vl(e).split("/")[1];return t==="svg+xml"?"svg":t||"png"};function ei(e){switch(e.trim().split(".").pop()?.toLowerCase()){case"svg":return"image/svg+xml";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"webp":return"image/webp";default:return}}function Wl(e){if(e.type?.startsWith?.("image/"))return!0;const t=(e.name??"").trim();if(ei(t))return!0;const r=(e.type??"").toLowerCase();return r.includes("svg")?!0:r==="text/xml"||r==="application/xml"||r==="text/plain"?t.toLowerCase().endsWith(".svg"):!1}var Kt={MAX_SIZE_MB:.48,MAX_WIDTH_OR_HEIGHT:2e3,QUALITY:.8,KEEP_AS_IS_MAX_BITS_PER_PIXEL:1,MIN_SAVING:.1,KEEP_RESOLUTION_MAX_STEPS:5},Tx=["gif","svg"];function Cx(e){return!Tx.includes(e)}function Kl(e,t){if(e?.compressMaxSize===0||e?.compressMaxWidthOrHeight===0)return!1;const r=t?.trim()??"";return r.startsWith("image/")&&r!=="image/gif"}function Ql(e){return{maxSizeMB:e?.compressMaxSize??Kt.MAX_SIZE_MB,maxWidthOrHeight:e?.compressMaxWidthOrHeight??Kt.MAX_WIDTH_OR_HEIGHT}}function b_(e){if(!e)return null;const t=e.trim();if(t.endsWith("%"))return null;const r=parseFloat(t.replace(/px$/i,""));return Number.isFinite(r)&&r>0?r:null}function Ox(e){const t=e.match(/<\s*svg\b[\s\S]*?>/i)?.[0]??"",r=t.match(/\bwidth\s*=\s*["']([^"']*)["']/i)?.[1],n=t.match(/\bheight\s*=\s*["']([^"']*)["']/i)?.[1],i=b_(r),o=b_(n);if(i!=null&&o!=null)return{width:i,height:o};const a=e.match(/viewBox\s*=\s*["']([^"']+)["']/i)?.[1];if(a){const s=a.trim().split(/[\s,]+/);if(s.length===4){const c=parseFloat(s[2]),l=parseFloat(s[3]);if(Number.isFinite(c)&&Number.isFinite(l)&&c>0&&l>0)return{width:c,height:l}}}return i!=null?{width:i,height:i}:o!=null?{width:o,height:o}:{width:300,height:300}}function Ax(e,t=2,r=4096){const{width:n,height:i}=Ox(e);let o=Math.max(1,Math.round(n*t)),a=Math.max(1,Math.round(i*t));const s=Math.max(64,r),c=Math.max(o,a);if(c>s){const l=s/c;o=Math.max(1,Math.round(o*l)),a=Math.max(1,Math.round(a*l))}return{width:o,height:a}}function Mx(e){return new Promise((t,r)=>{e.toBlob(n=>{n?t(n):r(new Error("canvas.toBlob returned null"))},"image/png")})}async function kx(e,t,r){const n=new Blob([e],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(n);try{const o=new Image;await new Promise((u,d)=>{o.onload=()=>u(),o.onerror=()=>d(new Error("Failed to load SVG image")),o.src=i});const a=document.createElement("canvas"),s=Math.max(1,Math.round(t)),c=Math.max(1,Math.round(r));a.width=s,a.height=c;const l=a.getContext("2d");if(!l)throw new Error("Canvas 2D context is not available");return l.clearRect(0,0,s,c),l.drawImage(o,0,0,s,c),Mx(a)}finally{URL.revokeObjectURL(i)}}var jx=24e3;async function Rx(e,t=jx){const r=Math.min(t,Math.max(0,e.size));return e.slice(0,r).text()}function Nx(e){const t=e.trimStart().replace(/^\uFEFF/,"");return t.startsWith("<")?/<\s*svg[\s>/]/i.test(t):!1}async function Dx(e,t={}){const r=t.pixelScale??2,n=t.maxLongEdge??4096,i=await e.text(),{width:o,height:a}=Ax(i,r,n),s=await kx(i,o,a),c=t.outputFileName??e.name,l=/\.svg$/i.test(c)?c.replace(/\.svg$/i,".png"):`${c}.png`;return new File([s],l,{type:"image/png",lastModified:e.lastModified})}function $o(e,t,r,n){return new File([e],t,{type:r,lastModified:n})}function fr(e,t){return!t||t===e.name?e:$o(e,t,e.type,e.lastModified)}function Lx(e,t,r,n){const i=n??t.name;return e instanceof File?e.type!==r||e.lastModified!==t.lastModified||e.name!==i?$o(e,i,r,t.lastModified):e:$o(e,i,r,t.lastModified)}function Fx(e,t){const r=t.startsWith(".")?t.slice(1):t,n=e.lastIndexOf(".");return n>0?`${e.substring(0,n)}.${r}`:`${e}.${r}`}function xx(e){return e==="image/webp"?"image/jpeg":e}async function E_(e){if(typeof createImageBitmap!="function")return null;try{const t=await createImageBitmap(e),r={width:t.width,height:t.height};return t.close(),r}catch{return null}}async function Ux(e){const t=await E_(e);return t&&Math.max(t.width,t.height)}async function Bx(e,t,r){if(e.size>t*1024*1024)return null;const n=await E_(e);return n&&Math.max(n.width,n.height)<=r?n:null}function $x(e,{width:t,height:r}){return e.size*8/(t*r)<=Kt.KEEP_AS_IS_MAX_BITS_PER_PIXEL}async function Yl(e,t={}){const{maxSizeMB:r=Kt.MAX_SIZE_MB,maxWidthOrHeight:n=Kt.MAX_WIDTH_OR_HEIGHT,mimeType:i,fileName:o,libURL:a,enableCompression:s=!0,convertSvgToPng:c=!1}=t;if(!e||!(e instanceof File))return e;let l=e,u=!1;if(c){const P=(l.type||"").toLowerCase(),v=/\.svg$/i.test(l.name.trim()),M=P.includes("svg");let j=!1;if(!M&&!v)try{const A=await Rx(l);j=Nx(A)}catch{j=!1}if(M||v||j)try{l=await Dx(l,{maxLongEdge:n,outputFileName:o??l.name}),u=!0}catch{l=e}}const d=(l.type&&l.type.trim()!==""?l.type:ei(l.name))||(u?"image/png":i)||"image/jpeg",f=Vl(d),m=u?l.name:o??l.name;if(!f.startsWith("image/"))return fr(l,m);const g=xx(f),h=v_(f),E=v_(g),S=g!==f?Fx(m,E):m,T=s&&Cx(h),w=g!==f;if(!T&&!w)return fr(l,S);const y=g==="image/png",I=T&&!w&&!y?await Bx(l,r,n):null;if(I&&$x(l,I))return fr(l,S);const _=l.type===f?l:$o(l,l.name,f,l.lastModified);try{const P={libURL:a,useWebWorker:!0,fileType:g},{default:v}=await(0,ut.__vitePreload)(async()=>{const{default:k}=await Promise.resolve().then(()=>me("./a8cb6e27.js")).then(D=>D.browser_image_compression_exports);return{default:k}},void 0,{}.url);if(y&&await g1(_).catch(()=>!1))return fr(l,S);T?(P.maxSizeMB=r,P.maxWidthOrHeight=n,y?P.initialQuality=f1:(P.initialQuality=Kt.QUALITY,P.alwaysKeepResolution=!0,P.maxIteration=Kt.KEEP_RESOLUTION_MAX_STEPS)):(P.maxSizeMB=Math.max(_.size/1048576+1,1),P.initialQuality=1,P.alwaysKeepResolution=!0);let M=await v(_,P);P.alwaysKeepResolution&&T&&M.size>r*1024*1024&&(M=await v(_,{...P,alwaysKeepResolution:!1,maxIteration:void 0}));const j=Vl(M.type||g),A=Lx(M,_,j,S);return I&&A.size>l.size*(1-Kt.MIN_SAVING)?fr(l,S):y?y1(fr(_,S),A):A}catch{try{return fr(l,S)}catch{return l}}}var qx="js/browser-image-compression.js";function Xl(){return __(qx)}var w_=["image/jpeg"];async function zx(e,t,r=Xl(),n={}){if(n.compressBySize)return S_(e,t,r);if(!Wl(e))return e;const{maxWidthOrHeight:i}=Ql(t),o=e.type?.trim()||ei(e.name)||e.type||"",a=Kl(t,o),s=o.toLowerCase();if(!a&&(s==="image/png"||w_.includes(s)))return e;if(w_.includes(s)){const c=await Ux(e);if(c!==null&&c<=i)return e}return Yl(e,{maxSizeMB:Number.POSITIVE_INFINITY,maxWidthOrHeight:i,mimeType:o||void 0,fileName:e.name,libURL:r,enableCompression:a,convertSvgToPng:!0})}async function S_(e,t,r=Xl()){if(!Wl(e))return e;const{maxSizeMB:n,maxWidthOrHeight:i}=Ql(t),o=e.type?.trim()||ei(e.name)||e.type||"";return Yl(e,{maxSizeMB:n,maxWidthOrHeight:i,mimeType:o||void 0,fileName:e.name,libURL:r,enableCompression:Kl(t,o),convertSvgToPng:!0})}function Gx(e,t){const r=e,n=r?.data?.operation!==void 0?r.data:r;if(n?.operation===t)return n.file instanceof File?n.file:void 0}async function Hx(e,t){try{const r=await t.prepare(e),n=await t.upload(r);return n?{status:"uploaded",url:n}:{status:"failed",error:void 0}}catch(r){return{status:"failed",error:r}}}function Vx(){const[e,t]=(0,b.useState)(!1),r=Na(),n=Tt(C.events.ON_BROWSER_EXTENSION_DETECTED_ID),i=(0,b.useCallback)(()=>{t(!1)},[]);return(0,b.useEffect)(()=>{const o=n.event(()=>{r||t(!0)});return()=>o.dispose()},[n,r]),{open:e,close:i}}function Wx(){const[e,t]=(0,b.useState)(!1),r=Na(),n=Tt(C.events.ON_BROWSER_TRANSLATE_DETECTED_ID),i=(0,b.useCallback)(()=>{t(!1)},[]);return(0,b.useEffect)(()=>{const o=n.event(()=>{r||t(!0)});return()=>o.dispose()},[n,r]),{open:e,close:i}}var Kx=["translated-ltr","translated-rtl"],Qx=".goog-te-banner-frame",Jl=!1;function Yx(e){if(e)return e;if(!(typeof document>"u"))return document}function Xx(e){const t=Yx(e);if(!t?.documentElement)return!1;const r=t.documentElement.classList;return Kx.some(n=>r.contains(n))?!0:t.querySelector(Qx)!=null}function Jx(){Jl=!1}function Zx(e){const t=Xx();return t&&!Jl&&e(),Jl=t,t}var eU=500;function tU(){const e=Tt(C.events.ON_BROWSER_TRANSLATE_DETECTED_ID),t=(0,b.useRef)(null);(0,b.useEffect)(()=>{if(typeof window>"u")return;const r=()=>{Zx(()=>{e.fire()})},n=()=>{t.current!=null&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,r()},eU)};r();const i=()=>{n()},o=()=>{document.visibilityState==="visible"&&n()},a=new MutationObserver(()=>{n()});return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("focus",i),document.addEventListener("visibilitychange",o),()=>{t.current!=null&&clearTimeout(t.current),Jx(),a.disconnect(),window.removeEventListener("focus",i),document.removeEventListener("visibilitychange",o)}},[e])}function rU(){const e=Ua();return(0,b.useCallback)(()=>{document.body.classList.remove("editor"),e("/billing")},[e])}var Zl={},P_=(0,b.createContext)(Zl),I_=(0,b.createContext)({current:Zl}),T_=(0,b.createContext)(()=>{});function nU({children:e}){const t=ot(),r=at(Eh),n=Nd(C.SETTINGS_PANEL_EVENT),[i,o]=(0,b.useState)(Zl),a=(0,b.useRef)(i);return a.current=i,(0,b.useEffect)(()=>{const s=n(c=>{const l=c?.type===C.ADVANCED_SETTINGS_PANEL;if((!c||!c.type&&!c.content&&!c.advancedTabs?.length)&&r==="Properties")o({}),t(vh());else if(r!=="Properties"&&t(rl(yd)),c.advancedTabs?.length&&!l&&!c.content){const u=c.advancedTabs.map(d=>({content:d.content,label:d.label,key:d.key,className:d.className}));o(d=>({settings:{},extraTabs:u}))}else if(l&&c.content){const u=c.advancedTabs?.map(d=>({content:d.content,label:d.label,key:d.key,className:d.className}));o(d=>({settings:{},type:c.type,content:c.content,instanceKey:c.instanceKey,parent:c.parent,caption:c.caption,extraTabs:u,deletable:c.deletable}))}});return()=>s.dispose()},[n,o,t,r]),(0,R.jsx)(T_.Provider,{value:o,children:(0,R.jsx)(I_.Provider,{value:a,children:(0,R.jsx)(P_.Provider,{value:i,children:e})})})}function ec(){return(0,b.useContext)(P_)}function iU(){return(0,b.useContext)(I_)}function oU(){return(0,b.useContext)(T_)}var C_={widthCodeSplit:50,isResizing:!1,currentSide:null},O_=(0,b.createContext)({current:C_}),A_=(0,b.createContext)(C_.widthCodeSplit),M_=(0,b.createContext)({isResizing:!1,currentSide:null}),k_=(0,b.createContext)({setWidthCodeSplit:()=>{},setIsResizing:()=>{},setCurrentSide:()=>{},setBlockMaxHeight:()=>{}}),j_=(0,b.createContext)("unset");function aU({children:e}){const[t,r]=(0,b.useState)(()=>+window.localStorage.getItem(It.em_code_mode_pane_sizes)||50),[n,i]=(0,b.useState)(!1),[o,a]=(0,b.useState)(null),[s,c]=(0,b.useState)("unset"),l=(0,b.useMemo)(()=>({widthCodeSplit:t,isResizing:n,currentSide:o}),[t,n,o]),u=(0,b.useMemo)(()=>({isResizing:n,currentSide:o}),[n,o]),d=(0,b.useRef)(l);d.current=l;const f=(0,b.useMemo)(()=>({setWidthCodeSplit:r,setIsResizing:i,setCurrentSide:a,setBlockMaxHeight:c}),[]);return(0,R.jsx)(k_.Provider,{value:f,children:(0,R.jsx)(O_.Provider,{value:d,children:(0,R.jsx)(M_.Provider,{value:u,children:(0,R.jsx)(A_.Provider,{value:t,children:(0,R.jsx)(j_.Provider,{value:s,children:e})})})})})}function R_(){return(0,b.useContext)(M_)}function N_(){return(0,b.useContext)(A_)}function sU(){return(0,b.useContext)(O_)}function lU(){return(0,b.useContext)(j_)}function cU(){return(0,b.useContext)(k_)}var D_=(0,b.createContext)({previewAlertShow:!1,templateNotEmAlertShow:!1}),L_=(0,b.createContext)({setPreviewAlertShow:()=>{},setTemplateNotEmAlertShow:()=>{}});function uU({children:e}){const[t,r]=(0,b.useState)(!1),[n,i]=(0,b.useState)(!1),o=(0,b.useMemo)(()=>({previewAlertShow:t,templateNotEmAlertShow:n}),[t,n]),a=(0,b.useMemo)(()=>({setPreviewAlertShow:r,setTemplateNotEmAlertShow:i}),[]);return(0,R.jsx)(L_.Provider,{value:a,children:(0,R.jsx)(D_.Provider,{value:o,children:e})})}function dU(){return(0,b.useContext)(D_)}function fU(){return(0,b.useContext)(L_)}function pU({className:e,sidePanelFloating:t,isCodeMode:r,codeModeDirection:n,children:i}){const o=lU(),a=(0,b.useMemo)(()=>{const s=Number.isFinite(o)?`${o}px`:"unset";return{"--em-pane-block-height":t?r&&n==="bottom"?s:"calc(100% - 30px)":"100%"}},[t,r,n,o]);return(0,R.jsx)(B.ui_kit$Layout,{className:e,style:a,children:i})}function mU(){const[e,t]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{let r=0;const n=window.requestAnimationFrame(()=>{r=window.requestAnimationFrame(()=>t(!0))});return()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[]),e}function hU({maxPaneWidth:e,isCodeMode:t,codeModeDirection:r,isShowMobileSettings:n,desktopMobileSwitchPanel:i,children:o}){const a=at(bh),{isResizing:s,currentSide:c}=R_(),l=t&&r!=="bottom"&&!n&&i?"100%":a,u=mU(),d=(0,b.useMemo)(()=>({maxWidth:typeof l=="number"?Math.min(l,e):e,...u?{}:{transition:"none"}}),[l,e,u]);return(0,R.jsx)("div",{className:(0,vt.default)("email-pane__resizable",{"email-pane__resizable_drag":c||s}),style:d,children:o})}function gU({isCodeMode:e,codeModeDirection:t,sidePanelFloating:r,contentWrapperRef:n,children:i}){const o=N_(),a=(0,b.useMemo)(()=>({flexGrow:1,overflowY:r?"scroll":"hidden",overflowX:"hidden",height:e&&t==="bottom"?`calc(${o}%)`:"100%",width:`${t==="left"?100-o:t==="bottom"?100:o}%`}),[e,t,r,o]);return(0,R.jsx)(B.ui_kit$Col,{style:a,id:"pane-content-wrapper",ref:n,children:i})}function yU({isCodeMode:e,codeModeDirection:t,children:r}){const n=N_(),i=(0,b.useMemo)(()=>({width:`${t==="right"?100-n:t==="bottom"?100:n}%`,position:"relative",height:t==="bottom"?`calc(${100-n}%)`:"unset",display:e?"initial":"none"}),[e,t,n]);return(0,R.jsx)(B.ui_kit$Col,{style:i,children:r})}function _U({wrapperRef:e,children:t}){const{isResizing:r,currentSide:n}=R_();return(0,R.jsx)("div",{className:(0,vt.default)("email-pane__content-col email-pane__content-col_main",{"email-pane__content-col_disable":n||r}),ref:e,children:t})}function vU({isShowMobileSettings:e,headless:t,templateNotEmAlertEnabled:r}){const{__:n}=he(),{previewAlertShow:i,templateNotEmAlertShow:o}=dU();return(0,R.jsxs)(R.Fragment,{children:[i&&e&&(0,R.jsx)(B.ui_kit$Alert,{title:n("Template is not mobile-friendly"),description:n("While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices."),type:"warning",className:"email-pane__col__alert",closable:!0}),o&&!t&&r&&(0,R.jsx)(B.ui_kit$Alert,{title:n("Template from another editor"),description:n("This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control."),type:"warning",className:"email-pane__col__alert",closable:!0})]})}function F_(){const e=ko(),t=at(dd),r=at(ph);return e==="email"?t:r}function bU({isShowMobileSettings:e,propertiesPanelKey:t,onMouseLeave:r,email:n,onClosePanel:i}){const o=F_(),a=ec();return o?.type||a?.type||a?.content||a?.extraTabs?.length?(0,R.jsx)("div",{className:(0,vt.default)("email-pane__collapse-wrapper",{"mobile-view":e,"mobile-properties":e&&t!=="Structure"}),onMouseLeave:r,children:(0,R.jsx)(b.Suspense,{fallback:(0,R.jsx)(B.ui_kit$PageLoader,{}),children:(0,R.jsx)(dy,{email:n,formSettings:a,onClosePanel:i})})}):null}function EU({className:e,emailElementType:t}){return(0,R.jsx)(b.Suspense,{fallback:(0,R.jsx)(B.ui_kit$PageLoader,{}),children:(0,R.jsx)(YL,{className:e,emailElementType:t,formSettings:ec()})})}function wU({isCodeMode:e,codeModeDirection:t}){const r=ko(),n=F_()?.type;return!(n===Pr.TEXT||n===Pr.LINK||n===Pr.IMG||n===Pr.BUTTON)||!e||t==="bottom"?null:(0,R.jsx)(EU,{className:(0,vt.default)("selected-element-panel__content selected-element-panel__content_abs",{"selected-element-panel__hidden":n===Pr.IMG}),emailElementType:r})}function SU({isCodeMode:e,codeModeDirection:t,email:r,onClosePanel:n}){const i=ec();return i?.type!=="img"||!e||t==="bottom"?null:(0,R.jsx)("div",{className:"email-pane__collapse-wrapper email-pane__collapse-wrapper_disabled",children:(0,R.jsx)(b.Suspense,{fallback:(0,R.jsx)(B.ui_kit$PageLoader,{}),children:(0,R.jsx)(dy,{email:r,formSettings:i,onClosePanel:n})})})}function PU(e){return VM(e||"en_US")}var IU=Q.__commonJSMin(((e,t)=>{(function(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(i,o){return i<<o|i>>>32-o},rotr:function(i,o){return i<<32-o|i>>>o},endian:function(i){if(i.constructor==Number)return n.rotl(i,8)&16711935|n.rotl(i,24)&4278255360;for(var o=0;o<i.length;o++)i[o]=n.endian(i[o]);return i},randomBytes:function(i){for(var o=[];i>0;i--)o.push(Math.floor(Math.random()*256));return o},bytesToWords:function(i){for(var o=[],a=0,s=0;a<i.length;a++,s+=8)o[s>>>5]|=i[a]<<24-s%32;return o},wordsToBytes:function(i){for(var o=[],a=0;a<i.length*32;a+=8)o.push(i[a>>>5]>>>24-a%32&255);return o},bytesToHex:function(i){for(var o=[],a=0;a<i.length;a++)o.push((i[a]>>>4).toString(16)),o.push((i[a]&15).toString(16));return o.join("")},hexToBytes:function(i){for(var o=[],a=0;a<i.length;a+=2)o.push(parseInt(i.substr(a,2),16));return o},bytesToBase64:function(i){for(var o=[],a=0;a<i.length;a+=3)for(var s=i[a]<<16|i[a+1]<<8|i[a+2],c=0;c<4;c++)a*8+c*6<=i.length*8?o.push(r.charAt(s>>>6*(3-c)&63)):o.push("=");return o.join("")},base64ToBytes:function(i){i=i.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],a=0,s=0;a<i.length;s=++a%4)s!=0&&o.push((r.indexOf(i.charAt(a-1))&Math.pow(2,-2*s+8)-1)<<s*2|r.indexOf(i.charAt(a))>>>6-s*2);return o}};t.exports=n})()})),x_=Q.__commonJSMin(((e,t)=>{var r={utf8:{stringToBytes:function(n){return r.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(r.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var i=[],o=0;o<n.length;o++)i.push(n.charCodeAt(o)&255);return i},bytesToString:function(n){for(var i=[],o=0;o<n.length;o++)i.push(String.fromCharCode(n[o]));return i.join("")}}};t.exports=r})),TU=Q.__commonJSMin(((e,t)=>{t.exports=function(i){return i!=null&&(r(i)||n(i)||!!i._isBuffer)};function r(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function n(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&r(i.slice(0,0))}})),CU=Q.__commonJSMin(((e,t)=>{(function(){var r=IU(),n=x_().utf8,i=TU(),o=x_().bin,a=function(s,c){s.constructor==String?c&&c.encoding==="binary"?s=o.stringToBytes(s):s=n.stringToBytes(s):i(s)?s=Array.prototype.slice.call(s,0):!Array.isArray(s)&&s.constructor!==Uint8Array&&(s=s.toString());for(var l=r.bytesToWords(s),u=s.length*8,d=1732584193,f=-271733879,m=-1732584194,g=271733878,h=0;h<l.length;h++)l[h]=(l[h]<<8|l[h]>>>24)&16711935|(l[h]<<24|l[h]>>>8)&4278255360;l[u>>>5]|=128<<u%32,l[(u+64>>>9<<4)+14]=u;for(var E=a._ff,S=a._gg,T=a._hh,w=a._ii,h=0;h<l.length;h+=16){var y=d,I=f,_=m,P=g;d=E(d,f,m,g,l[h+0],7,-680876936),g=E(g,d,f,m,l[h+1],12,-389564586),m=E(m,g,d,f,l[h+2],17,606105819),f=E(f,m,g,d,l[h+3],22,-1044525330),d=E(d,f,m,g,l[h+4],7,-176418897),g=E(g,d,f,m,l[h+5],12,1200080426),m=E(m,g,d,f,l[h+6],17,-1473231341),f=E(f,m,g,d,l[h+7],22,-45705983),d=E(d,f,m,g,l[h+8],7,1770035416),g=E(g,d,f,m,l[h+9],12,-1958414417),m=E(m,g,d,f,l[h+10],17,-42063),f=E(f,m,g,d,l[h+11],22,-1990404162),d=E(d,f,m,g,l[h+12],7,1804603682),g=E(g,d,f,m,l[h+13],12,-40341101),m=E(m,g,d,f,l[h+14],17,-1502002290),f=E(f,m,g,d,l[h+15],22,1236535329),d=S(d,f,m,g,l[h+1],5,-165796510),g=S(g,d,f,m,l[h+6],9,-1069501632),m=S(m,g,d,f,l[h+11],14,643717713),f=S(f,m,g,d,l[h+0],20,-373897302),d=S(d,f,m,g,l[h+5],5,-701558691),g=S(g,d,f,m,l[h+10],9,38016083),m=S(m,g,d,f,l[h+15],14,-660478335),f=S(f,m,g,d,l[h+4],20,-405537848),d=S(d,f,m,g,l[h+9],5,568446438),g=S(g,d,f,m,l[h+14],9,-1019803690),m=S(m,g,d,f,l[h+3],14,-187363961),f=S(f,m,g,d,l[h+8],20,1163531501),d=S(d,f,m,g,l[h+13],5,-1444681467),g=S(g,d,f,m,l[h+2],9,-51403784),m=S(m,g,d,f,l[h+7],14,1735328473),f=S(f,m,g,d,l[h+12],20,-1926607734),d=T(d,f,m,g,l[h+5],4,-378558),g=T(g,d,f,m,l[h+8],11,-2022574463),m=T(m,g,d,f,l[h+11],16,1839030562),f=T(f,m,g,d,l[h+14],23,-35309556),d=T(d,f,m,g,l[h+1],4,-1530992060),g=T(g,d,f,m,l[h+4],11,1272893353),m=T(m,g,d,f,l[h+7],16,-155497632),f=T(f,m,g,d,l[h+10],23,-1094730640),d=T(d,f,m,g,l[h+13],4,681279174),g=T(g,d,f,m,l[h+0],11,-358537222),m=T(m,g,d,f,l[h+3],16,-722521979),f=T(f,m,g,d,l[h+6],23,76029189),d=T(d,f,m,g,l[h+9],4,-640364487),g=T(g,d,f,m,l[h+12],11,-421815835),m=T(m,g,d,f,l[h+15],16,530742520),f=T(f,m,g,d,l[h+2],23,-995338651),d=w(d,f,m,g,l[h+0],6,-198630844),g=w(g,d,f,m,l[h+7],10,1126891415),m=w(m,g,d,f,l[h+14],15,-1416354905),f=w(f,m,g,d,l[h+5],21,-57434055),d=w(d,f,m,g,l[h+12],6,1700485571),g=w(g,d,f,m,l[h+3],10,-1894986606),m=w(m,g,d,f,l[h+10],15,-1051523),f=w(f,m,g,d,l[h+1],21,-2054922799),d=w(d,f,m,g,l[h+8],6,1873313359),g=w(g,d,f,m,l[h+15],10,-30611744),m=w(m,g,d,f,l[h+6],15,-1560198380),f=w(f,m,g,d,l[h+13],21,1309151649),d=w(d,f,m,g,l[h+4],6,-145523070),g=w(g,d,f,m,l[h+11],10,-1120210379),m=w(m,g,d,f,l[h+2],15,718787259),f=w(f,m,g,d,l[h+9],21,-343485551),d=d+y>>>0,f=f+I>>>0,m=m+_>>>0,g=g+P>>>0}return r.endian([d,f,m,g])};a._ff=function(s,c,l,u,d,f,m){var g=s+(c&l|~c&u)+(d>>>0)+m;return(g<<f|g>>>32-f)+c},a._gg=function(s,c,l,u,d,f,m){var g=s+(c&u|l&~u)+(d>>>0)+m;return(g<<f|g>>>32-f)+c},a._hh=function(s,c,l,u,d,f,m){var g=s+(c^l^u)+(d>>>0)+m;return(g<<f|g>>>32-f)+c},a._ii=function(s,c,l,u,d,f,m){var g=s+(l^(c|~u))+(d>>>0)+m;return(g<<f|g>>>32-f)+c},a._blocksize=16,a._digestsize=16,t.exports=function(s,c){if(s==null)throw new Error("Illegal argument "+s);var l=r.wordsToBytes(a(s,c));return c&&c.asBytes?l:c&&c.asString?o.bytesToString(l):r.bytesToHex(l)}})()})),U_=Q.__toESM(CU());function OU(e){return e.replace(/\/+$/,"")}function B_(e,t){const r=OU(String(t||"").trim());if(!r)throw new Error(`[previewUrls] Missing ${e}`);return r}function $_(){return typeof window<"u"&&!window.location.host.includes("localhost")?window.location.origin:new URL(B_("REACT_APP_OPENAPI_BASE_URL","https://app.emailmaker.ru/api/")).origin}function AU(){return new URL($_()).hostname}function MU(){return $_()}function kU(){return new URL(B_("REACT_APP_IMAGE_INFO_TOOL","https://scr.emcdn.ru/imageinfo")).origin}function jU(){return typeof window<"u"&&window.location.host.includes("localhost"),kU()}function qo(e,t){return(0,U_.default)(`${e}${t}${uS}`)}function RU(e,t,r,n){const i=n??qo(r,t);return`https://${AU()}/get${e}/${t}?secret_hash=${i}&raw=true`}function NU(e,t,r){return`/get${e}/${t}?secret_hash=${qo(r,t)}&raw=true`}function DU(e,t){return`${MU()}/email/${e}/raw?key=${qo(t,e)}`}function LU(e,t){return`/email/${e}/raw?key=${qo(t,e)}`}function FU(e){return e==null||e===""?"":`&cacheControl=true&cache-hash=${(0,U_.default)(String(e))}`}var vG=800;function q_({type:e,projectId:t,elementId:r,cacheKey:n,clearCache:i=!0,pixelRatio:o=.8,selector:a,force:s,minHeight:c,targetUrl:l,width:u=800}){const d=jU(),f=FU(n),m=c?`minHeight=${c}&`:"",g=s===void 0?"":`&force=${s}`,h=l??RU(e,r,t);return`${d}/screenshot?${m}delay=1000&width=${u}${a?"":"&fullPage=true"}&deviceScaleFactor=${o}&format=jpg&clearCache=${i}${f}${g}&url=${encodeURIComponent(h)}${a?`&selector=${a}`:""}`}function xU(e,t,r=!0,n=.8,i,o,a){const s=`https://racs.emcdn.ru/v3/file/${e}?resource=exportPngApi`;return q_({type:"email",projectId:0,elementId:e,cacheKey:t??o??e,clearCache:r,pixelRatio:n,selector:i,targetUrl:s,width:a})}function UU(e,t,r,n){return q_({type:e,projectId:t,elementId:r,cacheKey:n??null,pixelRatio:.8,clearCache:!0})}function BU(){return"support@emailmaker.ru"}function $U(){return M0==="emailmaker"}var qU=({open:e,onClose:t})=>{const{__:r}=he(),n=BU(),[i,o=""]=r("To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.").split("{supportEmail}");return(0,R.jsx)(B.ui_kit$Modal,{width:440,open:e,onCancel:t,title:(0,R.jsxs)("div",{style:{paddingBottom:8},children:[(0,R.jsx)(ee,{icon:"EmailConfirmation",component:B.icons$EmailConfirmation,size:20,strokeWidth:2})," ",r("Email confirmation required")]}),footer:[(0,R.jsx)(B.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:r("Got it")},"ok")],children:(0,R.jsxs)("p",{children:[i,(0,R.jsx)("a",{href:`mailto:${n}`,children:n}),o]})})},z_={historyData:[],elementHistoryHasMore:!1},tc="revisionHistorySlice",rc=Te({name:tc,initialState:z_,reducers:{resetElementHistorySlice:()=>({...z_}),setElementHistory:(e,t)=>{t.payload.length!==0&&(e.historyData=t.payload)},setElementHistoryPage:(e,{payload:t})=>{e.historyData=t.revisions,e.elementHistoryHasMore=t.hasMore}}}),{resetElementHistorySlice:zU,setElementHistoryPage:zo}=rc.actions,{setElementHistory:bG}=rc.actions,GU=e=>e[tc].elementHistoryHasMore,HU=e=>e[tc].historyData,VU=C.createIdentifier$1("EmailHistoryAvailabilityResolver");async function WU(e){const t=e.getInstance(VU);if(!t)return!0;try{return await t()}catch{return!1}}function KU(){const e=se(),t=ot();return(0,b.useCallback)(async(r,n=1)=>{const i=C.getContainer(e),o=Ce(kr(i).sessionKey());try{if(o){if(!yp(i))return n===1&&t(zo({revisions:[],hasMore:!1})),{isSuccess:!0,data:{data:[],hasMore:!1}};const{revisions:c,hasMore:l}=await _s(i).readRevisions(String(r),n);return n===1&&t(zo({revisions:c,hasMore:l})),{isSuccess:!0,data:{data:c,hasMore:l}}}if(!await WU(i))return n===1&&t(zo({revisions:[],hasMore:!1})),{isSuccess:!0,data:{data:[],hasMore:!1}};const{revisions:a,hasMore:s}=await ys(i).readRevisions(String(r),n);return n===1&&t(zo({revisions:a,hasMore:s})),{isSuccess:!0,data:{data:a,hasMore:s}}}catch(a){return{isError:!0,error:a}}},[e,t])}var G_=Ie({reducerPath:"saveFileApi",tagTypes:["Images"],baseQuery:Fe({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({uploadImage:e.mutation({queryFn(t,r){return H(r).saveFile.upload_create(t,{type:C.ContentType.FormData})}}),sendTestEmail:e.mutation({queryFn(t,r){return H(r).saveFile.send_email_create(t,{type:C.ContentType.FormData})}}),sendLivePreview:e.mutation({queryFn(t,r){return H(r).saveFile.get_link_create(t,{type:C.ContentType.FormData})}}),sendShortLink:e.mutation({queryFn(t,r){return H(r).saveFile.shortener_create(t,{type:C.ContentType.FormData})}})})}),{useUploadImageMutation:QU,useSendTestEmailMutation:YU,useSendLivePreviewMutation:XU,useSendShortLinkMutation:JU}=G_,ZU="Not available for collaborative editing",eB="Problem with internet connection",tB=e=>{const t=ur(),[r,n]=(0,b.useState)({owner:!1,admin:!1,user:!1}),i=Ve(),{data:o}=pm(e,{skip:!e||!t.id||!!i}),a=i||o;return(0,b.useEffect)(()=>{if(a){const s=Mh(a,t);n({owner:s==="owner",admin:s==="admin",user:s==="user"})}},[a,t]),r};function rB(){const{document:e}=et();return(0,b.useCallback)(()=>kg(e),[e])}function nB(e){const t=Cg(e),r=Gl();return(0,b.useMemo)(()=>({...t,undo:()=>r()?void 0:t.undo(),redo:()=>r()?void 0:t.redo()}),[t,r])}function iB(e){const t={order:"desc",orderby:"modified"},r={};if(e.notEmbed||(r._embed=""),e.projectId&&(r._embed="author",r._fields="id,title,meta,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template,_embedded",t["filter[meta_key]"]="project",t["filter[meta_value]"]=e.projectId),e.fields&&(r._fields=e.fields),e.page&&(t.page=e.page),(e.order==="asc"||e.order==="desc")&&(t.order=e.order),e.orderby&&(t.orderby=e.orderby),e.folderTag&&e.folderTag!=="all"?(t["filter[tax_query][relation]"]="AND",t["filter[tax_query][0][taxonomy]"]="folder",t["filter[tax_query][0][field]"]="id",t["filter[tax_query][0][terms]"]=e.folderTag,t["filter[tax_query][0][include_children]"]="0"):(e.folderTag!=="all"||typeof e.folderTag=="object"&&e.folderTag===null)&&!e.tags?.length&&e.status&&e.status!=="trash"&&(t["filter[tax_query][0][taxonomy]"]="folder",t["filter[tax_query][0][operator]"]="NOT EXISTS"),e.tags?.length>0&&e.status!=="trash"){t["filter[tax_query][relation]"]="AND";for(let n=0,i=e.tags.length;n<i;n++){const o=e.tags[n];t[`filter[tax_query][${n+1}][taxonomy]`]="emailtags",t[`filter[tax_query][${n+1}][field]`]="id",t[`filter[tax_query][${n+1}][terms]`]=o}}return e.name&&(t.search=e.name),e.pageSize&&(t.per_page=e.pageSize),e.status==="trash"&&(r.status="trash"),{request:t,extraQuery:r}}var oB=C.createIdentifier$1("EmailsList"),aB={};function sB(e,t){return!!e&&JSON.stringify(e)===JSON.stringify(t)}async function lB(e,t){const r=e?.getInstance(oB),n=r?.get(),i=n?.promise;if(!(!r||i===void 0||!sB(n?.args,t)))return r.set(aB),i}function cB(e){return typeof e=="object"&&e!==null?e:void 0}function pr({id:e,title:t,meta:r,type:n,guid:i,acf:{lock:o,subject:a,description:s,html:c,project:l,tags:u,utm_parameters:d,parent_email:f,common_styles:m,is_template:g},author:h,...E}){const S=cB(r);return{...E,...S!==void 0?{meta:S}:{},id:pe(e),author:pe(h),title:lt(t)||"",lock:o,description:s,html:c,project:be(l)?l.ID:l,project_author:be(l)?l.post_author:void 0,project_title:be(l)?l.post_title:void 0,tags:u,utm_parameters:d,parent_email:pe(f instanceof Array&&f[0]?f[0].ID:f),common_styles:m,is_template:g}}function nc({title:e,lock:t,subject:r,description:n,html:i,project:o,tags:a,renderGuid:s,utm_parameters:c,parent_email:l,common_styles:u,is_template:d,author:f,meta:m,...g}){return{...g,author:Pe(f),title:e,acf:{lock:t,description:n,html:i,project:o,tags:a,utm_parameters:c,parent_email:Pe(l),common_styles:u,is_template:d}}}function uB(e){return typeof e=="object"&&e!==null?e:void 0}function H_({id:e,title:t,meta:r,acf:{html:n,common_styles:i},parent:o,excerpt:a,author:s,...c}){const l=uB(r);return{...c,isAutosave:Zf(c.slug),...l!==void 0?{meta:l}:{},author:pe(s),id:pe(e),parent:pe(o),title:lt(t)||"",html:n,common_styles:i,excerpt:be(a)?a.rendered:a}}function V_({parent:e,title:t,html:r,project:n,subject:i,preheader:o,common_styles:a,author:s,parent_email:c,meta:l,...u}){return{...u,author:Pe(s),title:t,parent:Pe(e),"acf[html]":r,"acf[project]":be(n)?n.id||n.ID:n,"acf[parent_email]":c,"acf[common_styles]":a}}var W_=Ie({reducerPath:"emailsApi",tagTypes:["Emails","Email"],baseQuery:Fe({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmails:e.query({async queryFn(t,r){const n=await lB(Rr(r),t);if(n)return n;const i=H(r),{request:o,extraQuery:a}=iB(t);return i.wp.email_list(o,{extraQuery:a}).then(s=>ze(pr)(s))},providesTags:(t,r,n)=>{const i={type:"Emails",id:n?.status==="trash"?"TRASH":"LIST"};return t?[...t.map(({id:o})=>({type:"Emails",id:o})),i]:[i]}}),getTemplateEmails:e.query({queryFn(t,r){const n=H(r),i={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1","filter[meta_query][0][compare]":"LIKE",orderby:"modified",order:"desc"},o={_embed:"author,wp:term",_fields:"_embedded,id,title,meta,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,acf.is_template"};if(t.emailId&&(i["filter[meta_query][0][key]"]="parent_email",i["filter[meta_query][0][value]"]=t.emailId),t.fields&&(o._fields=t.fields),t.group?.length>0||t.projectGroup?.length>0){const a=[...t.group||[],...t.projectGroup||[]].reduce((c,{key:l,parentId:u})=>(c[u]||(c[u]=[]),c[u].push(String(l)),c),{}),s=Object.values(a).map(c=>c.sort());i["filter[tax_query][relation]"]="AND",s.forEach((c,l)=>{i[`filter[tax_query][${l}][relation]`]="OR",c.forEach((u,d)=>{i[`filter[tax_query][${l}][${d}][taxonomy]`]="group",i[`filter[tax_query][${l}][${d}][field]`]="id",i[`filter[tax_query][${l}][${d}][terms]`]=u})})}if(t.tags?.length>0){i["filter[tax_query][relation]"]="AND";for(let a=0,s=t.tags.length;a<s;a++){const c=t.tags[a];i[`filter[tax_query][${a}][taxonomy]`]="emailtags",i[`filter[tax_query][${a}][field]`]="id",i[`filter[tax_query][${a}][terms]`]=c}}if(t.type&&(i["filter[meta_query][2][key]"]="type",i["filter[meta_query][2][value]"]=t.type),t.name&&(i.search=t.name),t.pageSize&&(i.per_page=t.pageSize),t.page){i.page=t.page;const{groupsTemplateProjectTotal:a,groupsTemplateProjectTotalPages:s}=r.getState()?.projectSlice;if(!t.projectGroup?.length&&!t.group?.length&&s<t.page&&t.groupType===G0.ALL&&a&&s&&!t.projectId){const c=24-a%24+(t.page-(s+1))*24;c&&(i.page=1,i.offset=c)}}return t.projectId&&(i["filter[meta_key]"]="project",i["filter[meta_value]"]=t.projectId),n.wp.email_list(i,{extraQuery:o}).then(ze(pr))},keepUnusedDataFor:0}),addEmail:e.mutation({queryFn:Js(t=>({source:r,...n})=>jn(t).wp.email_create({status:"publish",...nc(n)},{type:C.ContentType.Json}).then(we(pr))),invalidatesTags:[{type:"Emails",id:"LIST"}]}),editEmail:e.mutation({queryFn:Js(t=>({emailId:r,source:n,...i})=>{const o=jn(t),a=De(nc(i));return o.wp.email_partial_update({id:r},a,{type:C.ContentType.Json,extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,meta,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"}}).then(we(pr))}),invalidatesTags:(t,r,n)=>[{type:"Emails",id:"LIST"},{type:"Emails",id:n.emailId}]}),deleteEmail:e.mutation({queryFn(t,r){const n=H(r);let i,o;return typeof t=="object"?(i=t.id,o=t.force):(i=t,o=!1),n.wp.email_delete({id:i},{force:o}).then(Ri(pr))},invalidatesTags:(t,r,n)=>[{type:"Emails",id:"LIST"},{type:"Emails",id:"TRASH"},{type:"Emails",id:typeof n=="object"?n.id:n}]}),deleteEmails:e.mutation({async queryFn({ids:t,force:r},n){const i=H(n);return{data:await uh(t,o=>i.wp.email_delete({id:o},{force:r}))}},invalidatesTags:(t,r,{ids:n})=>[{type:"Emails",id:"LIST"},{type:"Emails",id:"TRASH"},...n.map(i=>({type:"Emails",id:i}))]}),addTag:e.mutation({queryFn(t,r){return H(r).wp.emailtags_create({...t},{type:C.ContentType.Json})}}),getDeletableTag:e.query({queryFn([t,r],n){return H(n).wp.email_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":t,emailtags:[r]},{extraQuery:{"_fields[]":"emailtags"}}).then(ze(pr))}}),autoSaveEmail:e.mutation({queryFn({emailId:t,body:r},n){const i=H(n),o=V_(r);return i.wp.email_autosaves_create({id:t},o,{type:C.ContentType.FormData}).then(we(H_))},onQueryStarted({emailId:t,body:r},n){Bi(C.getContainer(n))&&cs(t,{sentAt:Date.now(),html:r.html??"",common_styles:r.common_styles??"",subject:r.subject,preheader:r.preheader})}})})}),{useGetEmailsQuery:EG,useGetTemplateEmailsQuery:wG,useAddEmailMutation:dB,useEditEmailMutation:fB,useDeleteEmailMutation:SG,useDeleteEmailsMutation:PG,useGetDeletableTagQuery:IG,useAddTagMutation:TG,useAutoSaveEmailMutation:CG}=W_,K_=({element:e,context:t="list"})=>{const{__:r,_x:n}=he(),[i]=fB(),[o]=dh(),a=Gt(),s=mt(),c=se();e.hasOwnProperty("type");const l=(f,m)=>{f.error||e.id==null||kr(C.getContainer(c)).noteServerFacts({serverId:String(e.id),block:m},f.data)},u=(f,m)=>{if(f.error)return a.error(f),!1;a.success(r("The ")+(m.hasOwnProperty("type")?r("block"):n("email","letter"))+" "+r("“")+f.data.title+r("”")+r("was successfully")+" "+(m.lock?m.hasOwnProperty("type")?n("unlocked.","block"):n("unlocked.","email"):m.hasOwnProperty("type")?n("locked.","block"):n("locked.","email")))},d=()=>{const f=!e.lock,m=f?"lock_email":"unlock_email";e.hasOwnProperty("type")?o({blockId:e.id,lock:f}).then(g=>{u(g,e),l(g,!0),g.error||s({event:f?"lock":"unlock",action:f?"lock_block":"unlock_block",entity_type:"block",entity_id:e.id,project_id:e.project,context:t})}):i({emailId:e.id,lock:f}).then(g=>{u(g,e),l(g,!1),g.error||s({event:f?"lock":"unlock",action:m,entity_type:"email",entity_id:e.id,project_id:e.project,context:t})})};return(0,R.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:d,children:e.lock?r("Unlock"):r("Lock")})};K_.propTypes={element:kt.default.shape({lock:kt.default.bool,id:kt.default.string})};function pB(){const{document:e}=et();return(0,b.useCallback)(t=>is(e,t),[e])}function mB(e){const{document:t}=et(),r=(0,b.useCallback)(i=>t?t.subscribe(i):()=>{},[t]),n=(0,b.useCallback)(()=>t?.get().attributes?.[e],[t,e]);return(0,b.useSyncExternalStore)(r,n)}var Q_=()=>(0,ut.__vitePreload)(()=>Promise.resolve().then(()=>me("./abcacabc.js")),void 0,{}.url),hB=new TextDecoder("utf-8",{fatal:!0}),gB=new TextDecoder;async function Y_(e){return e instanceof Uint8Array?e:typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(await e.arrayBuffer())}function yB(e){let t=!1;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);if(i>255)return e;i>=128&&(t=!0)}if(!t)return e;const r=Uint8Array.from(e,n=>n.charCodeAt(0));try{return hB.decode(r)}catch{return new TextDecoder("cp866").decode(r)}}function X_(e){const t={};for(const r of Object.keys(e))r.endsWith("/")||(t[yB(r)]=e[r]);return t}async function _B(e){const{zip:t,zipSync:r}=await Q_(),n={};for(const i of Object.keys(e))n[i]=await Y_(e[i]);try{const i=await new Promise((o,a)=>{t(n,{level:6},(s,c)=>s?a(s):o(c))});return new Blob([i],{type:"application/zip"})}catch{return new Blob([r(n,{level:6})],{type:"application/zip"})}}async function J_(e){const{unzip:t,unzipSync:r}=await Q_(),n=await Y_(e);try{return X_(await new Promise((i,o)=>{t(n,(a,s)=>a?o(a):i(s))}))}catch{return X_(r(n))}}function vB(e){const t=atob(e);return J_(Uint8Array.from(t,r=>r.charCodeAt(0)))}function bB(e){return gB.decode(e)}function EB(e){return new Blob([e])}function Z_(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function Go(e){const t=e.indexOf("(");if(t<0)return!0;let r=0,n="",i=!1;for(let o=t;o<e.length;o++){const a=e[o];if(i){i=!1;continue}if(a==="\\"){i=!0;continue}if(n){a===n&&(n="");continue}if(a==='"'||a==="'"){n=a;continue}if(a==="("){r++;continue}if(a===")"&&(r--,r<0))return!1}return r===0}function wB(e){return(t,r,n)=>Go(t)?e(t,r,n):!1}function SB(e){return t=>Go(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function PB(e){return(t,r,n)=>Go(t)?Z_(t)?e(t,r,n):t:!1}function IB(e){return t=>{const r=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return Go(r)?Z_(r)?e(t):t:!1}}function TB(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function ic(e,t){const r=e.length;for(let n=0;n<r;n++){const i=e.charCodeAt(n);if(i===0||t==='"'&&i===34||t==="'"&&i===39||t===""&&(i===32||i===9||i===10||i===13||i===12||i===34||i===39||i===60||i===62||i===61||i===96))return!1}return!0}function CB(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",n=new Uint8Array(e);crypto.getRandomValues(n);let i="";for(let o=0;o<e;o++){const a=n[o]%62;i+=t.charAt(a)}return i}var OB=8,AB=class{_byKey=Object.create(null);_byValue=Object.create(null);getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=CB(OB),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},Ho=new AB;function ev(e,t){return t!==void 0&&!ic(e,t)?`%|{${Ho.getOrCreateByKey(e)}}|%`:e}function MB(e){const t=Ho.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function ue(e,t,r){return t!==void 0?ic(e,t)?e:`%|{${Ho.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function kB(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function ae(e){return e.startsWith("<!--")&&e.endsWith("-->")?kB(e.slice(4,-3)):e}function jB(e){const t=/^(IF|ELSE|ELSIF|ELSEIF|END|FOREACH|WHILE|NEXT|LAST|BREAK|DO|UNLESS|CONTINUE|SET|UNSET|DEFINE|INCLUDE)\b/i,r=/\w+\s*\(/;let n=e;const i=e.match(/\[%\s*([^%]*?)\s*%\]/);i&&(n=i[1]);const o=n.trim();return t.test(o)||r.test(o)}function RB(e,t,r){return t!==void 0?ic(e,t)?e:`%|{${Ho.getOrCreateByKey(e)}}|%`:r||TB(e)||jB(e)?`<!--${e}-->`:e}var mr=wB(ue),hr=SB(ae),NB=PB(ue),DB=IB(ae),tv=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",MB),e.escape("@{","}",ue,!0).unescape("<!--@{","}-->",ae,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",ev,!0),e.escape("{{","}}",ev,!0),e.createSyntax("brace-percent").escape("{%","%}",ue).unescape("<!--{%","%}-->",ae),e.createSyntax("brace-hash").escape("{#","#}",ue).unescape("<!--{#","#}-->",ae),e.createSyntax("proscript").escape("[%","%]",RB,!0).unescape("<!--[%","%]-->",ae,!0),e.createSyntax("getresponse").escape("[[IF","]]",ue).escape("[[if","]]",ue).escape("[[ELSE]]","",ue).escape("[[else]]","",ue).escape("[[ENDIF]]","",ue).escape("[[endif]]","",ue).unescape("<!--[[IF","]]-->",ae).unescape("<!--[[if","]]-->",ae).unescape("<!--[[ELSE]]","-->",ae).unescape("<!--[[else]]","-->",ae).unescape("<!--[[ENDIF]]","-->",ae).unescape("<!--[[endif]]","-->",ae),e.createSyntax("expert-sender").escape("<if",">",ue).escape("</if",">",ue).escape("<else",">",ue).escape("</else",">",ue).escape("<var ",">",ue,!0).unescape("<!--<if ",">-->",ae).unescape("<!--</if",">-->",ae).unescape("<!--<else ",">-->",ae).unescape("<!--</else",">-->",ae).unescape("<!--<var",">-->",ae,!0),e.createSyntax("velocity").escape("#if",")",mr).escape("#elseif",")",mr).escape("#else","",ue).escape("#foreach",")",mr).escape("#macro",")",mr).escape("#set",")",NB,!0).escape("#parse",")",mr).escape("#include",")",mr).escape("#evaluate",")",mr).escape("#end","",ue).escape("#break","",ue).escape("#stop","",ue).unescape("<!--#macro","-->",hr).unescape("<!--#if","-->",hr).unescape("<!--#elseif","-->",hr).unescape("<!--#else","-->",ae).unescape("<!--#foreach","-->",hr).unescape("<!--#parse","-->",hr).unescape("<!--#include","-->",hr).unescape("<!--#evaluate","-->",hr).unescape("<!--#end","-->",ae).unescape("<!--#break","-->",ae).unescape("<!--#stop","-->",ae).unescape("<!--#set","-->",DB,!0),e.createSyntax("mailchimp").escape("*|","|*",ue).unescape("<!--*|","|*-->",ae)},oc="bare",LB=new Map;function FB(e){return e?LB.get(e)??oc:oc}var rv=["brace-percent","brace-hash","proscript","getresponse","expert-sender","mailchimp","velocity"];function nv(e){return rv.includes(e)}function ti(e){return e==="bare"||e==="html-comment"}function ac(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xB(e,t=r=>{}){const r={output:{},editor:{}};if(e==null)return r;let n;if(typeof e=="string"){if(!ti(e))return t(`templateDirectives: unknown form "${String(e)}", falling back to the default ("bare").`),r;n={output:e}}else if(typeof e=="object"&&!Array.isArray(e))n=e;else return t(`templateDirectives: expected a string or an object, got ${typeof e}. Ignored.`),r;for(const[l,u]of[["output",n.output],["editor",n.editor]])if(u!==void 0&&!ti(u))return t(`templateDirectives.${l}: unknown form "${String(u)}", configuration ignored.`),r;if(n.syntaxes!==void 0&&!ac(n.syntaxes))return t("templateDirectives.syntaxes: expected an object, configuration ignored."),r;if(n.syntaxes){for(const[l,u]of Object.entries(n.syntaxes))if(!(!nv(l)||u===void 0||ti(u))){if(!ac(u))return t(`templateDirectives.syntaxes.${l}: expected a form or an object, configuration ignored.`),r;for(const d of["output","editor"]){const f=u[d];if(f!==void 0&&!ti(f))return t(`templateDirectives.syntaxes.${l}.${d}: unknown form "${String(f)}", configuration ignored.`),r}}}if(n.output===void 0&&n.editor===void 0&&n.syntaxes===void 0)return r;const i=n.output??oc;let o=n.editor;i==="bare"&&n.editor==="html-comment"&&(t('templateDirectives: editor="html-comment" requires output="html-comment"; editor was reset to match output.'),o=void 0);const a=[];if(n.syntaxes)for(const l of Object.keys(n.syntaxes)){if(!nv(l)){t(`templateDirectives.syntaxes: unknown syntax id "${l}", entry ignored.`);continue}a.push(l)}else a.push(...rv);const s={},c={};for(const l of a){const u=n.syntaxes?.[l],d=ac(u)?u:void 0,f=(ti(u)?u:d?.output)??i;let m=d?.editor??o??f;f==="bare"&&m==="html-comment"&&(t(`templateDirectives.syntaxes.${l}: editor="html-comment" requires output="html-comment" for this id; editor was reset to "bare" for it.`),m="bare"),s[l]=f,c[l]=m}return{output:s,editor:c}}function iv(e,t,r,n){for(let i=t;i<r;i++){const o=e[i];n.insideAttributeValue?n.attributeQuoteChar==='"'||n.attributeQuoteChar==="'"?o===n.attributeQuoteChar&&(n.insideAttributeValue=!1,n.attributeQuoteChar=void 0):n.unquotedAttr&&/[\s>]/.test(o)&&(n.insideAttributeValue=!1,n.attributeQuoteChar=void 0,n.unquotedAttr=!1):o==="<"?n.insideTag=!0:o===">"?n.insideTag=!1:n.insideTag&&(o==='"'||o==="'")?(n.insideAttributeValue=!0,n.attributeQuoteChar=o,n.unquotedAttr=!1):n.insideTag&&/\S/.test(o)&&n.attributeQuoteChar===void 0&&e[i-1]==="="&&!['"',"'","`"].includes(o)&&(n.insideAttributeValue=!0,n.attributeQuoteChar="",n.unquotedAttr=!0)}}function ri(e,t){return e.start<t.end&&t.start<e.end}function ov(e,t,r,n,i=[]){if(r&&(t=t.filter(u=>u.isVariable)),!t.length)return[];const o=t.flatMap(u=>u.match(e).flatMap(d=>!Number.isInteger(d.start)||!Number.isInteger(d.end)||d.start<0||d.end>e.length||d.start>=d.end?[]:[{range:d,mapFn:u.mapFn,overrideBuiltins:u.overrideBuiltins,syntax:u.syntax,isVariable:u.isVariable}])).sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end),a=[],s=i.slice().sort((u,d)=>u.start-d.start),c={insideTag:!1,insideAttributeValue:!1,attributeQuoteChar:void 0,unquotedAttr:!1};let l=0;for(const{range:u,mapFn:d,overrideBuiltins:f,syntax:m,isVariable:g}of o){if(n?(c.insideAttributeValue=!0,c.attributeQuoteChar='"'):iv(e,l,u.start,c),l=u.end,s.some(T=>ri(T,u)))continue;const h=c.insideAttributeValue?c.attributeQuoteChar??"":void 0,E=e.substring(u.start,u.end),S=d(E,h,c.insideTag);S!==!1&&S!==E&&(a.push({range:u,text:S,overrideBuiltins:f,syntax:m,isVariable:g}),s.push(u))}return a.sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end)}function UB(e,t){const r=t.reduce((s,{mapFn:c,start:l,end:u,syntax:d,isVariable:f})=>(s[l]||(s[l]=[]),s[l].push({value:u,mapFn:c,syntax:d,isVariable:f}),s),Object.create(null)),n=Object.keys(r).map(s=>s.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&")).join("|"),i=new RegExp(n,"g"),o=[];let a;for(;(a=i.exec(e))!==null;){const s=a[0];o.push({start:a.index,startToken:s,endTokens:r[s]})}return o}function sc(e,t,r,n,i=!1){const o=[];if(r&&(t=t.filter(l=>l.isVariable)),!t.length)return o;const a=UB(e,t),s={insideTag:!1,insideAttributeValue:!1,attributeQuoteChar:void 0,unquotedAttr:!1};let c=0;for(let l=0;l<a.length;l++){const{start:u,startToken:d,endTokens:f}=a[l];n?(s.insideAttributeValue=!0,s.attributeQuoteChar='"'):iv(e,c,u,s),c=u;const m=s.insideAttributeValue?s.attributeQuoteChar??"":void 0;let g=!1;for(const{mapFn:h,value:E,syntax:S,isVariable:T}of f){let w=u+d.length,y=e.indexOf(E,w);for(;y!==-1;){let I=y,_=u+d.length,P=0;for(;I!==-1;){const k=e.indexOf(d,_);if(k!==-1&&k<I)P++,_=k+d.length,I=e.indexOf(E,_);else if(P>0)P--,_=I+E.length,I=e.indexOf(E,_);else break}if(I<0)break;const v=I+E.length,M=e.substring(u,v),j=h(M,m,s.insideTag);if(j===!1){w=y+Math.max(E.length,1),y=e.indexOf(E,w);continue}(i||j!==M)&&o.push({range:{start:u,end:v},text:i?M:j,syntax:S,isVariable:T});const A=a.findIndex(({start:k})=>k>=v);A>l?l=A-1:l=a.length,g=!0;break}if(g)break}}return o}function Vo(e,t){if(!t.length)return e;const r=t.slice().sort((i,o)=>o.range.start-i.range.start);let n=e;for(const{text:i,range:o}of r)n=n.slice(0,o.start)+i+n.slice(o.end);return n}var BB=class{_disposables=[];_escapes=[];_unescapes=[];_escapeMatchers=[];_unescapeMatchers=[];constructor(e=tv){const{_escapes:t,_unescapes:r}=this;e({createSyntax(n){return{...this,syntax:n}},escape(n,i,o,a){return t.push({start:n,end:i,mapFn:o,isVariable:a,syntax:this.syntax||n}),this},unescape(n,i,o,a){return r.push({start:n,end:i,mapFn:o,isVariable:a,syntax:this.syntax||n}),this}})}registerMatcherPair(e){const t=e.syntax||"matcher",r={syntax:t,match:e.escape.match,mapFn:e.escape.mapFn,isVariable:e.escape.isVariable,overrideBuiltins:e.escape.overrideBuiltins},n={syntax:t,match:e.unescape.match,mapFn:e.unescape.mapFn,isVariable:e.unescape.isVariable,overrideBuiltins:e.unescape.overrideBuiltins};this._escapeMatchers.push(r),this._unescapeMatchers.push(n);let i=!1;const o={dispose:()=>{i||(i=!0,this._escapeMatchers=this._escapeMatchers.filter(a=>a!==r),this._unescapeMatchers=this._unescapeMatchers.filter(a=>a!==n))}};return this.addDisposable(o),o}_collectMappings(e,t,r){const n=sc(e,this._escapes,t,r),i=ov(e,this._escapeMatchers,t,r),o=i.filter(c=>c.overrideBuiltins).map(c=>c.range),a=n.filter(c=>!o.some(l=>ri(l,c.range))),s=i.filter(c=>c.overrideBuiltins||!a.some(l=>ri(c.range,l.range)));return[...a,...s].sort((c,l)=>c.range.start-l.range.start||c.range.end-l.range.end)}getMappings(e,t,r){return this._collectMappings(e,t,r)}_collectRevertMappings(e,t){const r=sc(e,this._unescapes,t),n=ov(e,this._unescapeMatchers,t,!1),i=n.filter(s=>s.overrideBuiltins).map(s=>s.range),o=r.filter(s=>!i.some(c=>ri(c,s.range))),a=n.filter(s=>s.overrideBuiltins||!o.some(c=>ri(s.range,c.range)));return[...o,...a].sort((s,c)=>s.range.start-c.range.start||s.range.end-c.range.end)}getRevertMappings(e,t,r){const n=r?i=>i!==void 0&&r.has(i):i=>FB(i)==="html-comment";return this._collectRevertMappings(e,t).filter(i=>i.isVariable||!n(i.syntax))}getDetectedMappings(e,t,r){return sc(e,this._escapes,t,r,!0)}getEscapedText(e,t){return Vo(e,this.getMappings(e,t))}getUnescapedText(e,t,r){return Vo(e,this.getRevertMappings(e,t,r))}normalizeToPolicy(e,t){const r=o=>o===void 0?void 0:t[o],n=Object.values(t);let i=e;return n.includes("bare")&&(i=Vo(i,this._collectRevertMappings(i).filter(o=>r(o.syntax)==="bare"))),n.includes("html-comment")&&(i=Vo(i,this._collectMappings(i).filter(o=>!o.isVariable&&r(o.syntax)==="html-comment"&&o.text.startsWith("<!--")&&o.text.endsWith("-->")))),i}hasDetectedMappings(e,t,r){return this.getDetectedMappings(e,t,r).length>0}addDisposable(e){this._disposables.push(e)}dispose(){for(const e of this._disposables)e.dispose()}};function av(e){return e.replace("<script","<___script").replace("<\/script>","</___script>")}var $B=new BB(e=>{e.escape("<script","<\/script>",t=>av(t)).unescape("<___script","</___script>",t=>t.replace("<___script","<script").replace("</___script>","<\/script>")),e.escape("<script","/>",t=>av(t)).unescape("<___script","/>",t=>t.replace("<___script","<script")),tv(e)}),sv=Symbol("Error");function qB(e){return Promise.all(e.map(t=>t instanceof Promise?t.catch(r=>sv):t)).then(t=>t.filter(r=>r!==sv))}var $r=/<script\b(?=[^>]*(?:\bbis_use(?:=|\s)|\bdata-bis-config(?:=|\s)|\bdata-dynamic-id(?:=|\s)|local\.adguard\.org|(?:chrome-extension|moz-extension|safari-extension):\/\/))[^>]*>[\s\S]*?<\/script>/gi,zB=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,qr=/<style\b[^>]*>[\s\S]*?<\/style>/gi,lv=/display:\s*none\s*!important/gi,GB=/((?:html\s*,\s*body|body\s*,\s*html)\s*\{)([^}]*)(\})/gi,HB=/\s*height\s*:\s*100%\s*!important\s*;?/gi,VB=/height\s*:\s*100%\s*!important/i,WB=[".socialshare,",".advertisment,",".adHolder,",".adsbygoogle-noablate","#ab_adblock","#popmechanic-snippet","filter_ads_by_classname","clever-core-ads","--gn-ov-ad-height","pub_728x90.text-ad.textAd","html-load.com/player","content-loader.com/player",".adblock","#advblock","body { overflow: visible!important; }"];function KB(e){return lv.lastIndex=0,(e.match(lv)||[]).length}function cv(e){const t=e.trim(),r=KB(t);if(r===0)return!1;if(t.includes(".advertisment,")&&t.includes(".adHolder,")&&(t.includes(".socialshare,")||r>=3||t.length>2e3))return!0;const n=WB.filter(i=>t.includes(i)).length;return n>=1&&(r>=3||t.length>2e3)||r>=5&&n>=1?!0:r>=20&&/\b(?:\.ad(?:s|vert|vertisment|Holder|banner|box|Container|Wrapper)?[,{]|#ad[-_]|ins\.adsbygoogle)/i.test(t)}function QB(e){qr.lastIndex=0;for(const t of e.matchAll(qr))if(cv(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function YB(e){let t=!1;return qr.lastIndex=0,{html:e.replace(qr,r=>cv(r.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):r),found:t}}function XB(e){return $r.lastIndex=0,$r.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||QB(e)}function uv(e){if(!XB(e))return{html:e,found:!1};let t=!1,r=e;$r.lastIndex=0,$r.test(r)&&($r.lastIndex=0,r=r.replace($r,""),t=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(r)||/\sdata-bis-config\s*=/.test(r))&&(r=r.replace(zB,""),t=!0);const n=YB(r);return r=n.html,t=t||n.found,{html:r,found:t}}function JB(e){return!e||!VB.test(e)?e:(qr.lastIndex=0,e.replace(qr,t=>t.replace(GB,(r,n,i,o)=>`${n}${i.replace(HB,"")}${o}`)))}function ZB(e){const t=uv(e.replaceAll(`\r
|
|
817
|
+
`,`
|
|
818
|
+
`));return{html:JB(t.html),hasBrowserExtensionArtifacts:t.found}}var ni=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeMap=void 0;var t=(function(){function r(){this._nodes=[],this._values=[]}return r._isIndex=function(n){return+n===n>>>0},r._nodeId=function(n){var i=n[r._ID_PROP];return i||(i=n[r._ID_PROP]=r._NEXT_ID++),i},r.prototype.set=function(n,i){var o=r._nodeId(n);this._nodes[o]=n,this._values[o]=i},r.prototype.get=function(n){var i=r._nodeId(n);return i!==void 0?this._values[i]:void 0},r.prototype.has=function(n){return r._nodeId(n)in this._nodes},r.prototype.delete=function(n){var i=r._nodeId(n);delete this._nodes[i],this._values[i]=void 0},r.prototype.keys=function(){var n=[];for(var i in this._nodes)r._isIndex(i)&&n.push(this._nodes[i]);return n},r._ID_PROP="__mutation_summary_node_map_id__",r._NEXT_ID=1,r})();e.NodeMap=t})),dv=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChildListChange=void 0;var t=ni(),r=(function(){function n(){this.added=new t.NodeMap,this.removed=new t.NodeMap,this.maybeMoved=new t.NodeMap,this.oldPrevious=new t.NodeMap,this.moved=void 0}return n})();e.ChildListChange=r})),e$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),t$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),r$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),n$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),i$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Wo=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Movement=void 0,(function(t){t[t.STAYED_OUT=0]="STAYED_OUT",t[t.ENTERED=1]="ENTERED",t[t.STAYED_IN=2]="STAYED_IN",t[t.REPARENTED=3]="REPARENTED",t[t.REORDERED=4]="REORDERED",t[t.EXITED=5]="EXITED"})(e.Movement||(e.Movement={}))})),fv=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeChange=void 0;var t=(function(){function r(n,i,o,a,s,c,l,u){i===void 0&&(i=!1),o===void 0&&(o=!1),a===void 0&&(a=!1),s===void 0&&(s=null),c===void 0&&(c=!1),l===void 0&&(l=null),u===void 0&&(u=null),this.node=n,this.childList=i,this.attributes=o,this.characterData=a,this.oldParentNode=s,this.added=c,this.attributeOldValues=l,this.characterDataOldValue=u,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return r.prototype.getAttributeOldValue=function(n){if(this.attributeOldValues)return this.isCaseInsensitive&&(n=n.toLowerCase()),this.attributeOldValues[n]},r.prototype.getAttributeNamesMutated=function(){var n=[];if(!this.attributeOldValues)return n;for(var i in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(i)&&n.push(i);return n},r.prototype.attributeMutated=function(n,i){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(n in this.attributeOldValues)&&(this.attributeOldValues[n]=i)},r.prototype.characterDataMutated=function(n){this.characterData||(this.characterData=!0,this.characterDataOldValue=n)},r.prototype.removedFromParent=function(n){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=n},r.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},r.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},r})();e.NodeChange=t})),pv=Q.__commonJSMin((e=>{var t=e&&e.__extends||(function(){var a=function(s,c){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(l[d]=u[d])},a(s,c)};return function(s,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");a(s,c);function l(){this.constructor=s}s.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.TreeChanges=void 0;var r=ni(),n=fv(),i=Wo(),o=(function(a){t(s,a);function s(c,l){var u=a.call(this)||this;u.rootNode=c,u.reachableCache=void 0,u.wasReachableCache=void 0,u.anyParentsChanged=!1,u.anyAttributesChanged=!1,u.anyCharacterDataChanged=!1;for(var d=0;d<l.length;d++){var f=l[d];switch(f.type){case"childList":u.anyParentsChanged=!0;for(var m=0;m<f.removedNodes.length;m++){var g=f.removedNodes[m];u.getChange(g).removedFromParent(f.target)}for(var m=0;m<f.addedNodes.length;m++){var g=f.addedNodes[m];u.getChange(g).insertedIntoParent()}break;case"attributes":u.anyAttributesChanged=!0;var h=u.getChange(f.target);h.attributeMutated(f.attributeName,f.oldValue);break;case"characterData":u.anyCharacterDataChanged=!0;var h=u.getChange(f.target);h.characterDataMutated(f.oldValue)}}return u}return s.prototype.getChange=function(c){var l=this.get(c);return l||(l=new n.NodeChange(c),this.set(c,l)),l},s.prototype.getOldParent=function(c){var l=this.get(c);return l?l.getOldParent():c.parentNode},s.prototype.getIsReachable=function(c){if(c===this.rootNode)return!0;if(!c)return!1;this.reachableCache=this.reachableCache||new r.NodeMap;var l=this.reachableCache.get(c);return l===void 0&&(l=this.getIsReachable(c.parentNode),this.reachableCache.set(c,l)),l},s.prototype.getWasReachable=function(c){if(c===this.rootNode)return!0;if(!c)return!1;this.wasReachableCache=this.wasReachableCache||new r.NodeMap;var l=this.wasReachableCache.get(c);return l===void 0&&(l=this.getWasReachable(this.getOldParent(c)),this.wasReachableCache.set(c,l)),l},s.prototype.reachabilityChange=function(c){return this.getIsReachable(c)?this.getWasReachable(c)?i.Movement.STAYED_IN:i.Movement.ENTERED:this.getWasReachable(c)?i.Movement.EXITED:i.Movement.STAYED_OUT},s})(r.NodeMap);e.TreeChanges=o})),mv=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MutationProjection=void 0;var t=pv(),r=ni(),n=Wo(),i=dv(),o=(function(){function a(s,c,l,u,d){this.rootNode=s,this.mutations=c,this.selectors=l,this.calcReordered=u,this.calcOldPreviousSibling=d,this.treeChanges=new t.TreeChanges(s,c),this.entered=[],this.exited=[],this.stayedIn=new r.NodeMap,this.visited=new r.NodeMap,this.childListChangeMap=void 0,this.characterDataOnly=void 0,this.matchCache=void 0,this.processMutations()}return a.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var s=this.treeChanges.keys(),c=0;c<s.length;c++)this.visitNode(s[c],void 0)},a.prototype.visitNode=function(s,c){if(!this.visited.has(s)){this.visited.set(s,!0);var l=this.treeChanges.get(s),u=c;if((l&&l.childList||u==null)&&(u=this.treeChanges.reachabilityChange(s)),u!==n.Movement.STAYED_OUT){if(this.matchabilityChange(s),u===n.Movement.ENTERED)this.entered.push(s);else if(u===n.Movement.EXITED)this.exited.push(s),this.ensureHasOldPreviousSiblingIfNeeded(s);else if(u===n.Movement.STAYED_IN){var d=n.Movement.STAYED_IN;l&&l.childList&&(l.oldParentNode!==s.parentNode?(d=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(s)):this.calcReordered&&this.wasReordered(s)&&(d=n.Movement.REORDERED)),this.stayedIn.set(s,d)}if(u!==n.Movement.STAYED_IN)for(var f=s.firstChild;f;f=f.nextSibling)this.visitNode(f,u)}}},a.prototype.ensureHasOldPreviousSiblingIfNeeded=function(s){if(this.calcOldPreviousSibling){this.processChildlistChanges();var c=s.parentNode,l=this.treeChanges.get(s);l&&l.oldParentNode&&(c=l.oldParentNode);var u=this.childListChangeMap.get(c);u||(u=new i.ChildListChange,this.childListChangeMap.set(c,u)),u.oldPrevious.has(s)||u.oldPrevious.set(s,s.previousSibling)}},a.prototype.getChanged=function(s,c,l){this.selectors=c,this.characterDataOnly=l;for(var u=0;u<this.entered.length;u++){var d=this.entered[u],f=this.matchabilityChange(d);(f===n.Movement.ENTERED||f===n.Movement.STAYED_IN)&&s.added.push(d)}for(var m=this.stayedIn.keys(),u=0;u<m.length;u++){var d=m[u],f=this.matchabilityChange(d);if(f===n.Movement.ENTERED)s.added.push(d);else if(f===n.Movement.EXITED)s.removed.push(d);else if(f===n.Movement.STAYED_IN&&(s.reparented||s.reordered)){var g=this.stayedIn.get(d);s.reparented&&g===n.Movement.REPARENTED?s.reparented.push(d):s.reordered&&g===n.Movement.REORDERED&&s.reordered.push(d)}}for(var u=0;u<this.exited.length;u++){var d=this.exited[u],f=this.matchabilityChange(d);(f===n.Movement.EXITED||f===n.Movement.STAYED_IN)&&s.removed.push(d)}},a.prototype.getOldParentNode=function(s){var c=this.treeChanges.get(s);if(c&&c.childList)return c.oldParentNode?c.oldParentNode:null;var l=this.treeChanges.reachabilityChange(s);if(l===n.Movement.STAYED_OUT||l===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return s.parentNode},a.prototype.getOldPreviousSibling=function(s){var c=s.parentNode,l=this.treeChanges.get(s);l&&l.oldParentNode&&(c=l.oldParentNode);var u=this.childListChangeMap.get(c);if(!u)throw Error("getOldPreviousSibling requested on invalid node.");return u.oldPrevious.get(s)},a.prototype.getOldAttribute=function(s,c){var l=this.treeChanges.get(s);if(!l||!l.attributes)throw Error("getOldAttribute requested on invalid node.");var u=l.getAttributeOldValue(c);if(u===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return u},a.prototype.attributeChangedNodes=function(s){if(!this.treeChanges.anyAttributesChanged)return{};var c,l;if(s){c={},l={};for(var u=0;u<s.length;u++){var d=s[u];c[d]=!0,l[d.toLowerCase()]=d}}for(var f={},m=this.treeChanges.keys(),u=0;u<m.length;u++){var g=m[u],h=this.treeChanges.get(g);if(h.attributes&&!(n.Movement.STAYED_IN!==this.treeChanges.reachabilityChange(g)||n.Movement.STAYED_IN!==this.matchabilityChange(g)))for(var E=g,S=h.getAttributeNamesMutated(),T=0;T<S.length;T++){var d=S[T];c&&!c[d]&&!(h.isCaseInsensitive&&l[d])||h.getAttributeOldValue(d)!==E.getAttribute(d)&&(l&&h.isCaseInsensitive&&(d=l[d]),f[d]=f[d]||[],f[d].push(E))}}return f},a.prototype.getOldCharacterData=function(s){var c=this.treeChanges.get(s);if(!c||!c.characterData)throw Error("getOldCharacterData requested on invalid node.");return c.characterDataOldValue},a.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var s=this.treeChanges.keys(),c=[],l=0;l<s.length;l++){var u=s[l];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(u)){var d=this.treeChanges.get(u);!d.characterData||u.textContent==d.characterDataOldValue||c.push(u)}}return c},a.prototype.computeMatchabilityChange=function(s,c){this.matchCache||(this.matchCache=[]),this.matchCache[s.uid]||(this.matchCache[s.uid]=new r.NodeMap);var l=this.matchCache[s.uid],u=l.get(c);return u===void 0&&(u=s.matchabilityChange(c,this.treeChanges.get(c)),l.set(c,u)),u},a.prototype.matchabilityChange=function(s){var c=this;if(this.characterDataOnly)switch(s.nodeType){case Node.COMMENT_NODE:case Node.TEXT_NODE:return n.Movement.STAYED_IN;default:return n.Movement.STAYED_OUT}if(!this.selectors)return n.Movement.STAYED_IN;if(s.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var l=s,u=this.selectors.map(function(m){return c.computeMatchabilityChange(m,l)}),d=n.Movement.STAYED_OUT,f=0;d!==n.Movement.STAYED_IN&&f<u.length;){switch(u[f]){case n.Movement.STAYED_IN:d=n.Movement.STAYED_IN;break;case n.Movement.ENTERED:d===n.Movement.EXITED?d=n.Movement.STAYED_IN:d=n.Movement.ENTERED;break;case n.Movement.EXITED:d===n.Movement.ENTERED?d=n.Movement.STAYED_IN:d=n.Movement.EXITED}f++}return d},a.prototype.getChildlistChange=function(s){var c=this.childListChangeMap.get(s);return c||(c=new i.ChildListChange,this.childListChangeMap.set(s,c)),c},a.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r.NodeMap;for(var s=function(u){var d=c.mutations[u];if(d.type!="childList"||c.treeChanges.reachabilityChange(d.target)!==n.Movement.STAYED_IN&&!c.calcOldPreviousSibling)return"continue";for(var f=c.getChildlistChange(d.target),m=d.previousSibling,g=function(S,T){!S||f.oldPrevious.has(S)||f.added.has(S)||f.maybeMoved.has(S)||T&&(f.added.has(T)||f.maybeMoved.has(T))||f.oldPrevious.set(S,T)},h=0;h<d.removedNodes.length;h++){var E=d.removedNodes[h];g(E,m),f.added.has(E)?f.added.delete(E):(f.removed.set(E,!0),f.maybeMoved.delete(E)),m=E}g(d.nextSibling,m);for(var h=0;h<d.addedNodes.length;h++){var E=d.addedNodes[h];f.removed.has(E)?(f.removed.delete(E),f.maybeMoved.set(E,!0)):f.added.set(E,!0)}},c=this,l=0;l<this.mutations.length;l++)s(l)}},a.prototype.wasReordered=function(s){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var c=s.parentNode,l=this.treeChanges.get(s);l&&l.oldParentNode&&(c=l.oldParentNode);var u=this.childListChangeMap.get(c);if(!u)return!1;if(u.moved)return u.moved.get(s);u.moved=new r.NodeMap;var d=new r.NodeMap;function f(S){if(!S||!u.maybeMoved.has(S))return!1;var T=u.moved.get(S);return T!==void 0||(d.has(S)?T=!0:(d.set(S,!0),T=E(S)!==g(S)),d.has(S)?(d.delete(S),u.moved.set(S,T)):T=u.moved.get(S)),T}var m=new r.NodeMap;function g(S){var T=m.get(S);if(T!==void 0)return T;for(T=u.oldPrevious.get(S);T&&(u.removed.has(T)||f(T));)T=g(T);return T===void 0&&(T=S.previousSibling),m.set(S,T),T}var h=new r.NodeMap;function E(S){if(h.has(S))return h.get(S);for(var T=S.previousSibling;T&&(u.added.has(T)||f(T));)T=T.previousSibling;return h.set(S,T),T}return u.maybeMoved.keys().forEach(f),u.moved.get(s)},a})();e.MutationProjection=o})),hv=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Summary=void 0;var t=(function(){function r(n,i){var o=this;if(this.projection=n,this.added=[],this.removed=[],this.reparented=i.all||i.element||i.characterData?[]:void 0,this.reordered=i.all?[]:void 0,n.getChanged(this,i.elementFilter,i.characterData),i.all||i.attribute||i.attributeList){var a=i.attribute?[i.attribute]:i.attributeList,s=n.attributeChangedNodes(a);i.attribute?this.valueChanged=s[i.attribute]||[]:(this.attributeChanged=s,i.attributeList&&i.attributeList.forEach(function(l){o.attributeChanged.hasOwnProperty(l)||(o.attributeChanged[l]=[])}))}if(i.all||i.characterData){var c=n.getCharacterDataChanged();i.characterData?this.valueChanged=c:this.characterDataChanged=c}this.reordered&&(this.getOldPreviousSibling=n.getOldPreviousSibling.bind(n))}return r.prototype.getOldParentNode=function(n){return this.projection.getOldParentNode(n)},r.prototype.getOldAttribute=function(n,i){return this.projection.getOldAttribute(n,i)},r.prototype.getOldCharacterData=function(n){return this.projection.getOldCharacterData(n)},r.prototype.getOldPreviousSibling=function(n){return this.projection.getOldPreviousSibling(n)},r})();e.Summary=t})),gv=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Qualifier=void 0;var t=(function(){function n(){}return n.prototype.matches=function(i){if(i===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==i;for(var o=i.split(" "),a=0;a<o.length;a++)if(this.attrValue===o[a])return!0;return!1},n.prototype.toString=function(){return this.attrName==="class"&&this.contains?"."+this.attrValue:this.attrName==="id"&&!this.contains?"#"+this.attrValue:this.contains?"["+this.attrName+"~="+r(this.attrValue)+"]":"attrValue"in this?"["+this.attrName+"="+r(this.attrValue)+"]":"["+this.attrName+"]"},n})();e.Qualifier=t;function r(n){return'"'+n.replace(/"/,'\\"')+'"'}})),yv=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Selector=void 0;var t=gv(),r=Wo(),n=/[a-zA-Z_]+/,i=/[a-zA-Z0-9_\-]+/,o=(function(){function a(){this.uid=a.nextUid++,this.qualifiers=[]}return Object.defineProperty(a.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),a.prototype.isMatching=function(s){return s[a.matchesSelector](this.selectorString)},a.prototype.wasMatching=function(s,c,l){if(!c||!c.attributes)return l;var u=c.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(u!=="*"&&u!==s.tagName)return!1;for(var d=[],f=!1,m=0;m<this.qualifiers.length;m++){var g=this.qualifiers[m],h=c.getAttributeOldValue(g.attrName);d.push(h),f=f||h!==void 0}if(!f)return l;for(var m=0;m<this.qualifiers.length;m++){var g=this.qualifiers[m],h=d[m];if(h===void 0&&(h=s.getAttribute(g.attrName)),!g.matches(h))return!1}return!0},a.prototype.matchabilityChange=function(s,c){var l=this.isMatching(s);return l?this.wasMatching(s,c,l)?r.Movement.STAYED_IN:r.Movement.ENTERED:this.wasMatching(s,c,l)?r.Movement.EXITED:r.Movement.STAYED_OUT},a.parseSelectors=function(s){var c=[],l,u;function d(){l&&(u&&(l.qualifiers.push(u),u=void 0),c.push(l)),l=new a}function f(){u&&l.qualifiers.push(u),u=new t.Qualifier}for(var m=/\s/,g=void 0,h="Invalid or unsupported selector syntax.",E=1,S=2,T=3,w=4,y=5,I=6,_=7,P=8,v=9,M=10,j=11,A=12,k=13,D=14,N=E,x=0;x<s.length;){var F=s[x++];switch(N){case E:if(F.match(n)){d(),l.tagName=F,N=S;break}if(F=="*"){d(),l.tagName="*",N=T;break}if(F=="."){d(),f(),l.tagName="*",u.attrName="class",u.contains=!0,N=w;break}if(F=="#"){d(),f(),l.tagName="*",u.attrName="id",N=w;break}if(F=="["){d(),f(),l.tagName="*",u.attrName="",N=I;break}if(F.match(m))break;throw Error(h);case S:if(F.match(i)){l.tagName+=F;break}if(F=="."){f(),u.attrName="class",u.contains=!0,N=w;break}if(F=="#"){f(),u.attrName="id",N=w;break}if(F=="["){f(),u.attrName="",N=I;break}if(F.match(m)){N=D;break}if(F==","){N=E;break}throw Error(h);case T:if(F=="."){f(),u.attrName="class",u.contains=!0,N=w;break}if(F=="#"){f(),u.attrName="id",N=w;break}if(F=="["){f(),u.attrName="",N=I;break}if(F.match(m)){N=D;break}if(F==","){N=E;break}throw Error(h);case w:if(F.match(n)){u.attrValue=F,N=y;break}throw Error(h);case y:if(F.match(i)){u.attrValue+=F;break}if(F=="."){f(),u.attrName="class",u.contains=!0,N=w;break}if(F=="#"){f(),u.attrName="id",N=w;break}if(F=="["){f(),N=I;break}if(F.match(m)){N=D;break}if(F==","){N=E;break}throw Error(h);case I:if(F.match(n)){u.attrName=F,N=_;break}if(F.match(m))break;throw Error(h);case _:if(F.match(i)){u.attrName+=F;break}if(F.match(m)){N=P;break}if(F=="~"){u.contains=!0,N=v;break}if(F=="="){u.attrValue="",N=j;break}if(F=="]"){N=T;break}throw Error(h);case P:if(F=="~"){u.contains=!0,N=v;break}if(F=="="){u.attrValue="",N=j;break}if(F=="]"){N=T;break}if(F.match(m))break;throw Error(h);case v:if(F=="="){u.attrValue="",N=j;break}throw Error(h);case M:if(F=="]"){N=T;break}if(F.match(m))break;throw Error(h);case j:if(F.match(m))break;if(F=='"'||F=="'"){g=F,N=k;break}u.attrValue+=F,N=A;break;case A:if(F.match(m)){N=M;break}if(F=="]"){N=T;break}if(F=="'"||F=='"')throw Error(h);u.attrValue+=F;break;case k:if(F==g){N=M;break}u.attrValue+=F;break;case D:if(F.match(m))break;if(F==","){N=E;break}throw Error(h)}}switch(N){case E:case S:case T:case y:case D:d();break;default:throw Error(h)}if(!c.length)throw Error(h);return c},a.nextUid=1,a.matchesSelector="matches",a})();e.Selector=o})),o$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MutationSummaryOptionProcessor=void 0;var t=yv(),r=(function(){function n(){}return n.createObserverOptions=function(i){var o={childList:!0,subtree:!0},a;function s(c){if(!(o.attributes&&!a)){if(o.attributes=!0,o.attributeOldValue=!0,!c){a=void 0;return}a=a||{},c.forEach(function(l){a[l]=!0,a[l.toLowerCase()]=!0})}}return i.forEach(function(c){if(c.characterData){o.characterData=!0,o.characterDataOldValue=!0;return}if(c.all){s(),o.characterData=!0,o.characterDataOldValue=!0;return}if(c.attribute){s([c.attribute.trim()]);return}var l=n._elementFilterAttributes(c.elementFilter).concat(c.attributeList||[]);l.length&&s(l)}),a&&(o.attributeFilter=Object.keys(a)),o},n.validateOptions=function(i){for(var o in i)if(!(o in n._optionKeys))throw Error("Invalid option: "+o);if(typeof i.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!i.queries||!i.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var a={callback:i.callback,rootNode:i.rootNode||document,observeOwnChanges:!!i.observeOwnChanges,oldPreviousSibling:!!i.oldPreviousSibling,queries:[]},s=0;s<i.queries.length;s++){var c=i.queries[s];if(c.all){if(Object.keys(c).length>1)throw Error("Invalid request option. all has no options.");a.queries.push({all:!0});continue}if("attribute"in c){var l={attribute:n._validateAttribute(c.attribute)};if(l.elementFilter=t.Selector.parseSelectors("*["+l.attribute+"]"),Object.keys(c).length>1)throw Error("Invalid request option. attribute has no options.");a.queries.push(l);continue}if("element"in c){var u=Object.keys(c).length,l={element:c.element,elementFilter:t.Selector.parseSelectors(c.element)};if(c.hasOwnProperty("elementAttributes")&&(l.attributeList=n._validateElementAttributes(c.elementAttributes),u--),u>1)throw Error("Invalid request option. element only allows elementAttributes option.");a.queries.push(l);continue}if(c.characterData){if(Object.keys(c).length>1)throw Error("Invalid request option. characterData has no options.");a.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return a},n._validateElementAttributes=function(i){if(!i.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var o={},a={},s=i.split(/\s+/),c=0;c<s.length;c++){var l=s[c];if(l){l=n._validateAttribute(l);var u=l.toLowerCase();if(o[u])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");a[l]=!0,o[u]=!0}}return Object.keys(a)},n._elementFilterAttributes=function(i){var o={};return i.forEach(function(a){a.qualifiers.forEach(function(s){o[s.attrName]=!0})}),Object.keys(o)},n._validateAttribute=function(i){if(typeof i!="string"||(i=i.trim(),!i))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!i.match(n._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+i);return i},n._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,n._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},n})();e.MutationSummaryOptionProcessor=r})),_v=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MutationSummary=void 0;var t=hv(),r=mv(),n=o$(),i=(function(){function o(a){var s=this;this._connected=!1,this._options=n.MutationSummaryOptionProcessor.validateOptions(a),this._observerOptions=n.MutationSummaryOptionProcessor.createObserverOptions(this._options.queries),this._root=this._options.rootNode,this._callback=this._options.callback,this._elementFilter=Array.prototype.concat.apply([],this._options.queries.map(function(c){return c.elementFilter?c.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(c){return c.all}),this._queryValidators=[],o.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(c){return o.createQueryValidator(s._root,c)})),this._observer=new MutationObserver(function(c){s._observerCallback(c)}),this.reconnect()}return o.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},o.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var a=this._createSummaries(this._observer.takeRecords());return this._changesToReport(a)?a:void 0},o.prototype.disconnect=function(){var a=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,a},o.prototype._observerCallback=function(a){this._options.observeOwnChanges||this._observer.disconnect();var s=this._createSummaries(a);this._runQueryValidators(s),this._options.observeOwnChanges&&this._checkpointQueryValidators(),this._changesToReport(s)&&this._callback(s),!this._options.observeOwnChanges&&this._connected&&(this._checkpointQueryValidators(),this._observer.observe(this._root,this._observerOptions))},o.prototype._createSummaries=function(a){if(!a||!a.length)return[];for(var s=new r.MutationProjection(this._root,a,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),c=[],l=0;l<this._options.queries.length;l++)c.push(new t.Summary(s,this._options.queries[l]));return c},o.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(a){a&&a.recordPreviousState()})},o.prototype._runQueryValidators=function(a){this._queryValidators.forEach(function(s,c){s&&s.validate(a[c])})},o.prototype._changesToReport=function(a){return a.some(function(s){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(c){return s[c]&&s[c].length})||s.attributeChanged&&Object.keys(s.attributeChanged).some(function(c){return!!s.attributeChanged[c].length}))})},o})();e.MutationSummary=i})),a$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),s$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),l$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),c$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),u$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeMirror=void 0;var t=(function(){function r(n,i){this.root=n,this.delegate=i,this.idMap={}}return r.prototype.initialize=function(n,i){this.idMap[n]=this.root;for(var o=0;o<i.length;o++)this.deserializeNode(i[o],this.root)},r.prototype.applyChanged=function(n,i,o,a){var s=this;i.forEach(function(c){var l=s.deserializeNode(c);s.deserializeNode(c.parentNode),s.deserializeNode(c.previousSibling),l.parentNode&&l.parentNode.removeChild(l)}),n.forEach(function(c){var l=s.deserializeNode(c);l.parentNode&&l.parentNode.removeChild(l)}),i.forEach(function(c){var l=s.deserializeNode(c),u=s.deserializeNode(c.parentNode),d=s.deserializeNode(c.previousSibling);u.insertBefore(l,d?d.nextSibling:u.firstChild)}),o.forEach(function(c){var l=s.deserializeNode(c);Object.keys(c.attributes).forEach(function(u){var d=c.attributes[u];d===null?l.removeAttribute(u):(!s.delegate||!s.delegate.setAttribute||!s.delegate.setAttribute(l,u,d))&&l.setAttribute(u,d)})}),a.forEach(function(c){var l=s.deserializeNode(c);l.textContent=c.textContent}),n.forEach(function(c){delete s.idMap[c.id]})},r.prototype.deserializeNode=function(n,i){var o=this;if(n===null)return null;var a=this.idMap[n.id];if(a)return a;var s=this.root.ownerDocument;switch(s===null&&(s=this.root),n.nodeType){case Node.COMMENT_NODE:a=s.createComment(n.textContent);break;case Node.TEXT_NODE:a=s.createTextNode(n.textContent);break;case Node.DOCUMENT_TYPE_NODE:a=s.implementation.createDocumentType(n.name,n.publicId,n.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(a=this.delegate.createElement(n.tagName)),a||(a=s.createElement(n.tagName)),Object.keys(n.attributes).forEach(function(l){(!o.delegate||!o.delegate.setAttribute||!o.delegate.setAttribute(a,l,n.attributes[l]))&&a.setAttribute(l,n.attributes[l])});break;default:throw"Unsupported node type: "+n.nodeType}if(this.idMap[n.id]=a,i&&i.appendChild(a),n.childNodes)for(var c=0;c<n.childNodes.length;c++)this.deserializeNode(n.childNodes[c],a);return a},r})();e.TreeMirror=t})),d$=Q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeMirrorClient=void 0;var t=_v(),r=ni(),n=(function(){function i(o,a,s){var c=this;this.target=o,this.mirror=a,this.nextId=1,this.knownNodes=new r.NodeMap;for(var l=this.serializeNode(o).id,u=[],d=o.firstChild;d;d=d.nextSibling)u.push(this.serializeNode(d,!0));this.mirror.initialize(l,u);var f=[{all:!0}];s&&(f=f.concat(s)),this.mutationSummary=new t.MutationSummary({rootNode:o,callback:function(m){c.applyChanged(m)},queries:f})}return i.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},i.prototype.rememberNode=function(o){var a=this.nextId++;return this.knownNodes.set(o,a),a},i.prototype.forgetNode=function(o){this.knownNodes.delete(o)},i.prototype.serializeNode=function(o,a){if(o===null)return null;var s=this.knownNodes.get(o);if(s!==void 0)return{id:s};var c={nodeType:o.nodeType,id:this.rememberNode(o)};switch(c.nodeType){case Node.DOCUMENT_TYPE_NODE:var l=o;c.name=l.name,c.publicId=l.publicId,c.systemId=l.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:c.textContent=o.textContent;break;case Node.ELEMENT_NODE:var u=o;c.tagName=u.tagName,c.attributes={};for(var d=0;d<u.attributes.length;d++){var f=u.attributes[d];c.attributes[f.name]=f.value}if(a&&u.childNodes.length){c.childNodes=[];for(var m=u.firstChild;m;m=m.nextSibling)c.childNodes.push(this.serializeNode(m,!0))}}return c},i.prototype.serializeAddedAndMoved=function(o,a,s){var c=this,l=o.concat(a).concat(s),u=new r.NodeMap;l.forEach(function(f){var m=f.parentNode,g=u.get(m);g||(g=new r.NodeMap,u.set(m,g)),g.set(f,!0)});var d=[];return u.keys().forEach(function(f){for(var m=u.get(f),g=m.keys();g.length;){for(var h=g[0];h.previousSibling&&m.has(h.previousSibling);)h=h.previousSibling;for(;h&&m.has(h);){var E=c.serializeNode(h);E.previousSibling=c.serializeNode(h.previousSibling),E.parentNode=c.serializeNode(h.parentNode),d.push(E),m.delete(h),h=h.nextSibling}g=m.keys()}}),d},i.prototype.serializeAttributeChanges=function(o){var a=this,s=new r.NodeMap;return Object.keys(o).forEach(function(c){o[c].forEach(function(l){var u=s.get(l);u||(u=a.serializeNode(l),u.attributes={},s.set(l,u)),u.attributes[c]=l.getAttribute(c)})}),s.keys().map(function(c){return s.get(c)})},i.prototype.applyChanged=function(o){var a=this,s=o[0],c=s.removed.map(function(f){return a.serializeNode(f)}),l=this.serializeAddedAndMoved(s.added,s.reparented,s.reordered),u=this.serializeAttributeChanges(s.attributeChanged),d=s.characterDataChanged.map(function(f){var m=a.serializeNode(f);return m.textContent=f.textContent,m});this.mirror.applyChanged(c,l,u,d),s.removed.forEach(function(f){a.forgetNode(f)})},i})();e.TreeMirrorClient=n})),f$=Q.__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[o]}})}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=e&&e.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(a$(),e),r(s$(),e),r(l$(),e),r(c$(),e),r(u$(),e),r(d$(),e)})),p$=Q.__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[o]}})}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=e&&e.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};if(Object.defineProperty(e,"__esModule",{value:!0}),MutationObserver===void 0)throw Error("DOM Mutation Observers are required");r(dv(),e),r(e$(),e),r(t$(),e),r(r$(),e),r(n$(),e),r(i$(),e),r(Wo(),e),r(mv(),e),r(_v(),e),r(fv(),e),r(ni(),e),r(gv(),e),r(yv(),e),r(hv(),e),r(pv(),e),r(f$(),e)})),m$=p$(),zr=0,Gr=new Array(1e3);function h$(){for(let e=0;e<zr;e+=2){const t=Gr[e],r=Gr[e+1];t(...r),Gr[e]=void 0,Gr[e+1]=void 0}zr=0}function g$(e,...t){Gr[zr]=e,Gr[zr+1]=t,zr+=2,zr===2&&_$()}function y$(){let e=0;const t=new MutationObserver(h$),r=document.createTextNode("");return t.observe(r,{characterData:!0}),()=>{r.data=String(e=++e%2)}}var _$=y$();function vv(){g$(()=>{lc.hasListeners()&&(lc.fire(),vv())})}var lc=new C.Emitter({onFirstListenerAdd:vv}),cc=lc.once,v$=class extends C.Emitter{_mutationSummary;constructor(e={}){super(),this._mutationSummary=new m$.MutationSummary({...e,observeOwnChanges:!0,callback:t=>this.fire(t),queries:[{all:!0}]})}dispose(){this._mutationSummary.disconnect(),super.dispose()}trigger(e){if(this.isDisposed())return;const t=this._mutationSummary.takeSummaries();return(e||t?.length)&&this.fire(t||[]),t}},b$=class extends C.Disposable{_mutationEmitter;_innerEmitter=this.addDisposable(new C.Emitter({onFirstListenerAdd:()=>{this._nextTickHandler()}}));_lostEmitter=this.addDisposable(new C.Emitter);_paused=0;_stopped=0;_foreignCode=0;_summaries=[];_nextTickHandler(){cc(()=>{this.trigger(),this._summaries.length&&(this._innerEmitter.hasListeners()?this._innerEmitter.fire(this._summaries):this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)}constructor(e={}){super(),this._mutationEmitter=this.addDisposable(new v$(e)),this.onNativeMutate=this._mutationEmitter.event,this.addDisposable(this._mutationEmitter.event(t=>{(!this._stopped||this._foreignCode)&&(this._paused?this._lostEmitter.fire(t):(this._summaries.push(...t),cc(()=>{this._summaries.length&&!this._innerEmitter.hasListeners()&&(this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)))}))}get isStoped(){return this._paused>0||this._stopped>0}stop(){this._mutationEmitter.trigger(),this._stopped++}start(){this._mutationEmitter.trigger(),this._stopped--}pause(){this._mutationEmitter.trigger(),this._paused++}resume(){this._mutationEmitter.trigger(),this._paused--}pauseForForeignCode(){this.pause(),this._foreignCode++}resumeAfterForeignCode(){this.resume(),this._foreignCode--}unpaused(e){if(!this._paused||this._stopped)return e();this._mutationEmitter.trigger();const t=this._paused;this._paused=0;try{return e()}finally{try{this._mutationEmitter.trigger()}finally{this._paused+=t}}}trigger(){this._mutationEmitter.trigger(!0)}takeRecords(){this._mutationEmitter.trigger()}flush(){if(this._mutationEmitter.trigger(),this._summaries.length&&this._innerEmitter.hasListeners()){const e=this._summaries;this._summaries=[],this._innerEmitter.fire(e)}}onMutate=this._innerEmitter.event;onLost=this._lostEmitter.event;onNativeMutate};function E$(e){for(const t of e){if(t.removed)for(const r of t.removed){const n=t.getOldParentNode(r),i=t.getOldPreviousSibling(r);if(n){const o=i?.nextSibling??null;n.insertBefore(r,o)}}if(t.added)for(const r of t.added)r.parentNode&&r.parentNode.removeChild(r);if(t.reordered)for(const r of t.reordered){const n=t.getOldParentNode(r),i=t.getOldPreviousSibling(r);if(n){const o=i?.nextSibling??null;n.insertBefore(r,o)}}if(t.attributeChanged)for(const r of Object.keys(t.attributeChanged))for(const n of t.attributeChanged[r]){const i=t.getOldAttribute(n,r);i==null?n.removeAttribute(r):n.setAttribute(r,i)}if(t.characterDataChanged)for(const r of t.characterDataChanged)(sa(r)||oa(r)||oa(r))&&(r.data=t.getOldCharacterData(r))}}var w$=class extends C.Disposable{_commitPromise;_mutationCollector;_onLostSummaries=e=>{try{this._mutationCollector.stop(),E$(e)}finally{this._mutationCollector.start()}};constructor(e){super(),this._mutationCollector=this.addDisposable(new b$({rootNode:e,oldPreviousSibling:!0})),this._mutationCollector.onLost(this._onLostSummaries)}commit(){if(this._commitPromise)return this._commitPromise;{const e=()=>new Promise(t=>{const r=this._mutationCollector.onMutate(n=>{this._commitPromise=void 0,t(),r.dispose()});cc(()=>{this._commitPromise=void 0,t(),r.dispose()})});return this._commitPromise=e().catch(t=>{})}}};function S$(e,t){const r=o=>{const a={contentDocument:o,html:Qr(o)};return a.html=uv(a.html).html,a},n=new C.AsyncEmitter,i=new C.AsyncEmitter;try{const o=$c(e),a=document.implementation.createHTMLDocument();return Wc(a,o),{document:a,handleRender:i.event,handleReadHtml:n.event,async run(){if(i.hasListeners()){const s=document.createElement("iframe");s.style.position="absolute",s.style.left="-10000px",document.body.appendChild(s);const c=s.contentWindow.document,l=new w$(s.contentDocument);let u;try{if(t){const[d,f]=t;d!==void 0&&s.setAttribute("width",String(d)),f!==void 0&&s.setAttribute("height",String(f))}Wc(c,[...a.childNodes]),l.commit()}catch(d){throw d}finally{try{try{await i.fire({managedNodeController:l,contentDocument:c})}catch{}const d=r(c);await n.fire(d),u=d.html}finally{s.parentNode===document.body&&document.body.removeChild(s)}}return u}else{const s=r(a);return await n.fire(s),s.html}}}}catch(o){throw o}}function P$(e,t){const r=document.createElement("input");r.type="file",r.accept=e,r.multiple=!1,r.setAttribute("data-testid","uploadFile"),r.style.position="absolute",r.style.opacity="0",r.style.pointerEvents="none",document.body.appendChild(r),r.onchange=()=>{r.files?.length&&t(r.files),document.body.removeChild(r)},r.click()}var bv=()=>(0,ut.__vitePreload)(()=>Promise.resolve().then(()=>me("./ed4586a5.js")),void 0,{}.url);async function I$(e,t){if(t==="amp")e.handleRender(async({contentDocument:r,managedNodeController:n})=>{for(const o of r.querySelectorAll(".em-amp-show-disabled"))o.remove();const{html2amp:i}=await bv();await i(r,{mappedTags:{script:"___script"},commit:()=>n.commit()})});else if(t==="html"){const r=e.document;for(const i of r.querySelectorAll(".em-amp-show-only"))i.remove();const{amp2html:n}=await bv();n(r,{mappedTags:{script:"___script"}})}}var T$={"doctype-html5":!1,"html-lang-require":!1,"head-script-disabled":!1,"style-disabled":!1,"script-disabled":!1,"attr-lowercase":!1,"attr-value-single-quotes":!1,"attr-value-not-empty":!1,"attr-sorted":!1,"attr-whitespace":!1,"input-requires-label":!1,"tag-self-close":!1,"tagname-lowercase":!1,"href-abs-or-rel":!1,"inline-style-disabled":!1,"space-tab-mixed-disabled":!1,"attr-no-unnecessary-whitespace":!0,"tags-check":{img:{selfclosing:!1,attrsRequired:["src","alt"]},a:{selfclosing:!1,attrsRequired:[]}},"empty-tag-not-self-closed":!1,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!1,"alt-require":!0,"inline-script-disabled":!0,"id-class-value":!1,"id-class-ad-disabled":!0,"attr-unsafe-chars":!0};function C$(e,t){e?.mutate({content:zi(t)},{source:"remote"})}function O$(e,t,r,{undoable:n}){if(!e)return;const i=e.getContent(),o=zi(r);i!==o&&(e.mutate({changes:[new He(0,i,0,o)]},{source:"user"}),n||t?.clear())}function Ev(){const{document:e,history:t}=et();return(0,b.useCallback)((r,n)=>O$(e,t,r,n),[e,t])}function Ko(e,t){return Ko=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ko(e,t)}function wv(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ko(e,t)}function A$(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function M$(e,t){e.classList?e.classList.add(t):A$(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function Sv(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function k$(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=Sv(e.className,t):e.setAttribute("class",Sv(e.className&&e.className.baseVal||"",t))}var Pv={disabled:!1},Iv=b.default.createContext(null),Tv=function(t){return t.scrollTop},uc="unmounted",Hr="exited",Qo="entering",Yo="entered",dc="exiting",Rt=(function(e){wv(t,e);function t(n,i){var o=e.call(this,n,i)||this,a=i,s=a&&!a.isMounting?n.enter:n.appear,c;return o.appearStatus=null,n.in?s?(c=Hr,o.appearStatus=Qo):c=Yo:n.unmountOnExit||n.mountOnEnter?c=uc:c=Hr,o.state={status:c},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){return i.in&&o.status==="unmounted"?{status:Hr}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!=="entering"&&a!=="entered"&&(o=Qo):(a==="entering"||a==="entered")&&(o=dc)}this.updateStatus(!1,o)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var i=this.props.timeout,o=a=s=i,a,s;return i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},r.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o==="entering"){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Lt.default.findDOMNode(this);a&&Tv(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status==="exited"&&this.setState({status:uc})},r.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,c=this.props.nodeRef?[s]:[Lt.default.findDOMNode(this),s],l=c[0],u=c[1],d=this.getTimeouts(),f=s?d.appear:d.enter;if(!i&&!a||Pv.disabled){this.safeSetState({status:Yo},function(){o.props.onEntered(l)});return}this.props.onEnter(l,u),this.safeSetState({status:Qo},function(){o.props.onEntering(l,u),o.onTransitionEnd(f,function(){o.safeSetState({status:Yo},function(){o.props.onEntered(l,u)})})})},r.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Lt.default.findDOMNode(this);if(!o||Pv.disabled){this.safeSetState({status:Hr},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:dc},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Hr},function(){i.props.onExited(s)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},r.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Lt.default.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],l=c[0],u=c[1];this.props.addEndListener(l,u)}i!=null&&setTimeout(this.nextCallback,i)},r.render=function(){var i=this.state.status;if(i==="unmounted")return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=ua(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return b.default.createElement(Iv.Provider,{value:null},typeof a=="function"?a(i,s):b.default.cloneElement(b.default.Children.only(a),s))},t})(b.default.Component);Rt.contextType=Iv,Rt.propTypes={};function Vr(){}Rt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vr,onEntering:Vr,onEntered:Vr,onExit:Vr,onExiting:Vr,onExited:Vr},Rt.UNMOUNTED=uc,Rt.EXITED=Hr,Rt.ENTERING=Qo,Rt.ENTERED=Yo,Rt.EXITING=dc;var j$=function(t,r){return t&&r&&r.split(" ").forEach(function(n){return M$(t,n)})},fc=function(t,r){return t&&r&&r.split(" ").forEach(function(n){return k$(t,n)})},Xo=(function(e){wv(t,e);function t(){for(var n,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=e.call.apply(e,[this].concat(o))||this,n.appliedClasses={appear:{},enter:{},exit:{}},n.onEnter=function(s,c){var l=n.resolveArguments(s,c),u=l[0],d=l[1];n.removeClasses(u,"exit"),n.addClass(u,d?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(s,c)},n.onEntering=function(s,c){var l=n.resolveArguments(s,c),u=l[0],d=l[1]?"appear":"enter";n.addClass(u,d,"active"),n.props.onEntering&&n.props.onEntering(s,c)},n.onEntered=function(s,c){var l=n.resolveArguments(s,c),u=l[0],d=l[1]?"appear":"enter";n.removeClasses(u,d),n.addClass(u,d,"done"),n.props.onEntered&&n.props.onEntered(s,c)},n.onExit=function(s){var c=n.resolveArguments(s)[0];n.removeClasses(c,"appear"),n.removeClasses(c,"enter"),n.addClass(c,"exit","base"),n.props.onExit&&n.props.onExit(s)},n.onExiting=function(s){var c=n.resolveArguments(s)[0];n.addClass(c,"exit","active"),n.props.onExiting&&n.props.onExiting(s)},n.onExited=function(s){var c=n.resolveArguments(s)[0];n.removeClasses(c,"exit"),n.addClass(c,"exit","done"),n.props.onExited&&n.props.onExited(s)},n.resolveArguments=function(s,c){return n.props.nodeRef?[n.props.nodeRef.current,s]:[s,c]},n.getClassNames=function(s){var c=n.props.classNames,l=typeof c=="string",u=l&&c?c+"-":"",d=l?""+u+s:c[s];return{baseClassName:d,activeClassName:l?d+"-active":c[s+"Active"],doneClassName:l?d+"-done":c[s+"Done"]}},n}var r=t.prototype;return r.addClass=function(i,o,a){var s=this.getClassNames(o)[a+"ClassName"],c=this.getClassNames("enter").doneClassName;o==="appear"&&a==="done"&&c&&(s+=" "+c),a==="active"&&i&&Tv(i),s&&(this.appliedClasses[o][a]=s,j$(i,s))},r.removeClasses=function(i,o){var a=this.appliedClasses[o],s=a.base,c=a.active,l=a.done;this.appliedClasses[o]={},s&&fc(i,s),c&&fc(i,c),l&&fc(i,l)},r.render=function(){var i=this.props;i.classNames;var o=ua(i,["classNames"]);return b.default.createElement(Rt,di({},o,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(b.default.Component);Xo.defaultProps={classNames:""},Xo.propTypes={};var Cv=Ie({reducerPath:"confirmationMailApi",baseQuery:As({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:t,email:r})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${t}&user_email=${r}`)}`})})})}),{useLazyGetConfirmationMailQuery:R$}=Cv,N$=()=>{const{__:e}=he(),t=Gt(),r=ur(),[n]=R$(),[i,o]=(0,b.useState)(!1),a=mt();(0,b.useEffect)(()=>{r.hasOwnProperty("email_confirmation")&&o(r.email_confirmation)},[r,i]);const s=()=>{a({event:"click",action:"click_resend_confirmation_email",user_email:r.email,user_id:r.id}),n({userId:r.id,email:r.email}).then(({data:c,error:l})=>{c?t.success(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",r.email)):l&&t.error(l)})};return r?.email_confirmation||!r?.privacy_policy_agreement?null:(0,R.jsx)("div",{className:"main__ribbon",children:(0,R.jsxs)("span",{children:[(0,R.jsx)(ee,{icon:"EmailConfirmation",component:B.icons$EmailConfirmation,size:16,style:{marginRight:10,verticalAlign:"-0.15em"}}),e("Confirmation email was sent to")," ",(0,R.jsx)("em",{children:r.email}),". ",e("Didn't receive an email?")," ",(0,R.jsxs)(B.ui_kit$Button,{type:"primary",size:"small",className:"main__ribbon-resend",style:{fontSize:16,lineHeight:1,display:"inline-flex",alignItems:"center",gap:8},onClick:s,children:[e("Resend"),(0,R.jsx)(ee,{icon:"SendOutlined",component:B.icons$SendOutlined,size:16,style:{flexShrink:0}})]})]})})},D$=({className:e,leftBlock:t,rightBlock:r,isHeaderCodeMenuOpen:n=!1})=>{const{token:i}=(0,B.ui_kit$useToken)(),o=(0,b.useRef)(),a=st();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(N$,{}),a.headerShow&&(0,R.jsx)("header",{className:(0,vt.default)("header",{[e]:e}),style:{borderColor:i.colorBorder},children:!n&&(0,R.jsx)(Xo,{nodeRef:o,in:!n,timeout:300,classNames:"transition",children:(0,R.jsxs)("div",{className:"header__container container",children:[(0,R.jsx)("div",{className:"header__left",style:{flexGrow:1},children:t}),(0,R.jsx)("div",{className:"header__right",children:(0,R.jsx)(B.ui_kit$Space,{size:10,children:r})})]})})})]})},L$=e=>{};function F$(e){return String(e).replace(/"/g,""")}function Ov(e=new Date){const t=r=>String(r).padStart(2,"0");return String(e.getFullYear())+t(e.getMonth()+1)+t(e.getDate())+t(e.getHours())+t(e.getMinutes())+t(e.getSeconds())}function x$(e){if(!e||!/^\d{12}(\d{2})?$/.test(e))return null;const t=Number(e.slice(0,4)),r=Number(e.slice(4,6))-1,n=Number(e.slice(6,8)),i=Number(e.slice(8,10)),o=Number(e.slice(10,12)),a=e.length>=14?Number(e.slice(12,14)):0,s=new Date(t,r,n,i,o,a);return Number.isNaN(s.getTime())?null:s}function Av(e){const t=/<(table|tr|div)(\s[^>]*)>/gi;let r;for(;(r=t.exec(e))!==null;){const n=r[2]??"";if(/\bem\s*=\s*["']block["']/i.test(n))return{full:r[0],index:r.index}}return null}function Mv(e,t,r){const n=new RegExp(`\\b${t}\\s*=\\s*["'][^"']*["']`,"i"),i=F$(r);return n.test(e)?e.replace(n,`${t}="${i}"`):e.replace(/>$/,` ${t}="${i}">`)}function kv(e,t){const r=new RegExp(`\\b${t}\\s*=\\s*["']([^"']*)["']`,"i").exec(e);return r?r[1]:void 0}function U$(e){if(!e?.trim())return{};const t=Av(e);return t?{emBlockId:kv(t.full,"em-block-id"),emBlockVersion:kv(t.full,"em-block-version")}:{}}function B$(e,t,r){if(!e?.trim()||!t)return e;const n=Av(e);if(!n)return e;const i=String(t),o=Ov(r??new Date);let{full:a,index:s}=n;const c=a.length;return/\bem-block-id\s*=/.test(a)||(a=Mv(a,"em-block-id",i)),a=Mv(a,"em-block-version",o),e.slice(0,s)+a+e.slice(s+c)}function $$(e){return{projectId:e,pageSize:1e3,page:1,tags:null,name:null,type:null,notEmbed:!0,order:"asc",orderby:"title"}}function q$(e){return z$(e)}function z$(e){return e===void 0?wd:e||null}function G$(e){return{emailId:e,pageSize:1e3,page:1,projectId:hS,notEmbed:!0,name:null,type:null}}function H$(){return{pageSize:1e3,page:1,notEmbed:!0,name:null,type:null}}var V$=`
|
|
819
|
+
:host > table { margin: 0 auto; }
|
|
820
|
+
table { border-collapse: initial; }
|
|
821
|
+
`;function jv(e){return e.shadowRoot??e.attachShadow({mode:"open"})}function W$(e,t){e.innerHTML=`<style>${V$}</style>${t}`}function K$(e){e.shadowRoot&&(e.shadowRoot.innerHTML="")}function Rv(e,t){const r=e.closest(".blocks-search__result-body");if(t){e.dataset.blockPreview="filled",r?.setAttribute("data-block-preview","filled");return}delete e.dataset.blockPreview,r?.removeAttribute("data-block-preview")}function Q$(e,t){const r=Array.from(e.querySelectorAll("img")).filter(n=>!n.complete);return r.forEach(n=>{n.addEventListener("load",t),n.addEventListener("error",t)}),()=>{r.forEach(n=>{n.removeEventListener("load",t),n.removeEventListener("error",t)})}}function Y$({html:e,className:t,style:r,onContentLoad:n}){const i=(0,b.useRef)(null);return(0,b.useEffect)(()=>{const o=i.current;if(!o)return;let a,s=!1;const c=()=>{if(s)return;const d=jv(o);W$(d,e),s=!0,Rv(o,!0),n?.(o),a=n?Q$(d,()=>n(o)):void 0},u=gj(o,{fill:c,drop:()=>{s&&(a?.(),a=void 0,K$(o),s=!1,Rv(o,!1))}});return u===!1?(c(),()=>a?.()):()=>{u(),a?.()}},[e,n]),(0,R.jsx)("div",{ref:i,className:t,style:r})}function X$(e){const t=e.cloneNode(!1),r=e.shadowRoot;return r?jv(t).innerHTML=r.innerHTML:t.innerHTML=e.innerHTML,t}function J$(){const e=Ev(),t=Gl();return(0,b.useCallback)((r,n)=>{t()||e(r,n)},[e,t])}function Z$(e,t){const r=Tt(C.events.ON_DOCUMENT_SESSION_CHANGE);(0,b.useEffect)(()=>{r.fire({document:e,history:t})},[e,t,r])}function eq(){const e=se(),t=kr(C.getContainer(e)),r=(0,b.useCallback)(n=>t.subscribe(n),[t]);return{document:(0,b.useSyncExternalStore)(r,()=>t.current()),show:(0,b.useSyncExternalStore)(r,()=>t.showFacts()),error:(0,b.useSyncExternalStore)(r,()=>t.openError())}}var tq={};function Nv(e){const t=(0,b.useCallback)(i=>e?e.subscribe(i):()=>{},[e]),r=(0,b.useRef)(null),n=(0,b.useCallback)(()=>{if(!e)return tq;const{docId:i,attributes:o}=e.get();return(r.current?.docId!==i||r.current.attributes!==o)&&(r.current={docId:i,attributes:o}),r.current.attributes},[e]);return(0,b.useSyncExternalStore)(t,n)}function pc({attributes:e,readContent:t,docId:r,hasSession:n,serverId:i,show:o}){if(!n)return;const a={id:i??void 0,renderGuid:r,showId:o?.id,isNew:i==null,showToken:o?.token},s={...e,...a};return Object.defineProperty(s,"html",{get:()=>t()??"",enumerable:!0,configurable:!0}),s}function rq(){const{document:e,show:t,error:r}=eq();return{document:e,email:Dv(e,t),error:r}}function Dv(e,t){const r=Nv(e),n=(0,b.useCallback)(o=>e?e.subscribe(o):()=>{},[e]),i=(0,b.useSyncExternalStore)(n,()=>e?.get().serverId??void 0);return(0,b.useMemo)(()=>pc({attributes:r,readContent:()=>e?.getContent(),docId:e?.get().docId,hasSession:!!e,serverId:i,show:t}),[r,e,t,i])}function nq(e){if(!e)return{status:"unknown"};if("status"in e){const t=e.data,r=t&&typeof t=="object"?t.message:void 0,n=typeof r=="string"?r:typeof t=="string"?t:void 0;return{status:String(e.status),message:n}}return{status:e.name??"unknown",message:e.message}}var iq=new Set(["403","404","410"]);function oq(e,t,r){const{status:n,message:i}=nq(r),o=iq.has(n);ts(`Failed to load ${e} ${t??"?"}: ${n}`,{origin:"entity-load-error",tags:{mechanism:"entity-load-error",entity_type:e,http_status:n,expected_refusal:String(o)},level:o?"warning":"error",contexts:{entity_load_error:{entityType:e,entityId:t,status:n,message:i,url:window.location.href}}})}function aq(e){const t=se();return(0,b.useMemo)(()=>e?C.getApi(C.getContainer(t),e):C.getContainer(t)?.getInstance(C.REST_CLIENT_ID),[t,e])}var sq=()=>{const e=se();return(0,b.useMemo)(()=>C.getContainer(e)?.getInstance(C.STORAGE_PROVIDER_ID),[e])},Lv=C.createIdentifier$1("EditorOptions"),mc=z0;function lq(e){const t=typeof e.font_family=="string"?`${e.font_family}, sans-serif`:void 0,r=e.word_wrap===void 0?void 0:e.word_wrap?"on":"off";return{tabSize:e.tab_size,fontFamily:t,fontSize:e.font_size,wordWrap:r,insertSpaces:e.insert_spaces,minimap:{enabled:e.minimap}}}function Fv(e){return e.getOrCreateInstance(Lv,()=>{const t=it(mc);let r=mc.fontFamily;return t.watch(n=>{!n.fontFamily||n.fontFamily===r||(r=n.fontFamily,Promise.resolve($C(n.fontFamily.split(",")[0])).catch(()=>{}))}),t})}function cq(e){return e?.getInstance(Lv)?.get()??mc}function uq(e,t={}){const r=Fv(e);r.set(Ip({...r.get()},lq(t)))}function xv(e){return{...pc({attributes:e.get().attributes,readContent:()=>e.getContent(),docId:e.get().docId,hasSession:!0,serverId:e.get().serverId,show:void 0}),html:e.getContent()}}function dq(e){const t=kr(e),r=t.current();if(!r||!Ce(t.sessionKey()))return;const n=xv(r),i=r.isDirty();hn(e,C.events.ON_BLOCK_CLOSE_ID).fire({block:n,hasUnsavedChanges:i})}function fq(e){const t=kr(e);return!t.current()||!Ce(t.sessionKey())?!1:(dq(e),t.hasSuspended()?t.resumeSuspended()!==void 0:!1)}function pq({candidates:e,headers:t,createEventSource:r,onMessage:n,onError:i}){const o=e.filter(Boolean);let a=!1,s=null;const c=()=>{s?.close(),s=null},l=u=>{if(a)return;const d=o[u];if(!d){i?.(new Error("Failed to connect to EventSource through proxy chain"));return}c();const f=r(d,{headers:t});s=f,f.onmessage=m=>{a||s!==f||n(m)},f.onerror=m=>{if(!(a||s!==f)){if(c(),u+1<o.length){l(u+1);return}i?.(m)}}};return l(0),{close(){a=!0,c()}}}var mq="https://api.unsplash.com",hq="https://api.giphy.com/v1/gifs";function ii(e){return{error:e instanceof Error?e:new Error(String(e))}}async function Jo(e){if(!e.ok)throw new Error(`Request failed with status ${e.status}`);const t=await e.text();try{return t?JSON.parse(t):null}catch(r){throw r}}function gq(e){return e&&Array.isArray(e.results)?e:e?.data&&Array.isArray(e.data.results)?e.data:e?.response&&Array.isArray(e.response.results)?e.response:{...e||{},results:[]}}var Uv=Ie({reducerPath:"imageApi",baseQuery:void 0,endpoints:e=>({getImageInfo:e.query({queryFn:async function(t,r){try{const n=$t(C.getContainer(r)).imageInfoToolUrl||"https://scr.emcdn.ru/imageinfo";return{data:await Jo(await fetch(`${n}?url=${encodeURIComponent(t)}`))}}catch(n){return ii(n)}}}),getSearchImage:e.query({queryFn:async function({query:t,page:r},n){const i=t.keywords.replace(/[^\w\d\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{const o=$t(C.getContainer(n)),a=C.getContainer(n).getInstance(C.SECURITY_MODULE_ID)!==void 0,s=new URL(`${mq}/search/photos`);return s.searchParams.set("client_id","S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o"),s.searchParams.set("lang","ru"),s.searchParams.set("per_page","18"),s.searchParams.set("query",i),s.searchParams.set("page",String(r)),t.color!==""&&s.searchParams.set("color",t.color),t.orientation!==""&&s.searchParams.set("orientation",t.orientation),{data:gq(await Jo(await C.fetchWithResourceProxy(s.toString(),{config:o,standalone:a,resourceType:"stockImages",intent:"metadata"})))}}catch(o){return ii(o)}}}),getUnsplashImage:e.query({queryFn:async function(t,r){try{const n=$t(C.getContainer(r)),i=C.getContainer(r).getInstance(C.SECURITY_MODULE_ID)!==void 0,o=new URL(t);return o.searchParams.set("client_id","S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o"),{data:await Jo(await C.fetchWithResourceProxy(o.toString(),{config:n,standalone:i,resourceType:"stockImages",intent:"metadata"}))}}catch(n){return ii(n)}}}),sendAiImageRequest:e.query({queryFn:async function({body:t},r){try{return await H(r).aiGenerator.ai_create(t)}catch(n){throw new Error(n)}}}),getAiImage:e.query({queryFn:async function(t,r){try{return await H(r).aiGenerator.ai_status_list(t)}catch(n){return ii(n)}}}),getAiImageSSE:e.query({queryFn:t=>({data:[]}),async onCacheEntryAdded({task_id:t,entity_id:r,setError:n},i){const{updateCachedData:o,cacheEntryRemoved:a}=i,s=H(i).baseUrl||C.normalizeBaseUrl("https://app.emailmaker.ru/api/"),c=$t(C.getContainer(i)),l=C.getContainer(i).getInstance(C.SECURITY_MODULE_ID)!==void 0,u=await C.getContainer(i).getInstance(C.TOKEN_ID),d=u?{Authorization:`Bearer ${u}`}:{},f=`${s}/ai-generator/v1/ai-status?entity_id=${r}&stream=1&task_id=${t}`,m=await Jy(),g=C.resolveBackendProxyRequestCandidates(f,{config:c,method:"GET",requestType:"ai",standalone:l}),h=pq({candidates:g.length>0?g:[f],headers:d,createEventSource:(E,S)=>new m(E,S),onMessage:E=>{const S=JSON.parse(E.data);o(T=>{T.push(S)}),S.progress===100&&h.close()},onError:()=>{h.close()}});await a,h.close()}}),getSearchGif:e.query({queryFn:async function({query:t,page:r},n){const i=t.keywords.replace(/[^\w\d\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{const o=$t(C.getContainer(n)),a=C.getContainer(n).getInstance(C.SECURITY_MODULE_ID)!==void 0;return{data:await Jo(await C.fetchWithResourceProxy(`${hq}/search?api_key=Nh77eBlPeMn1ed9MBAvL542NUGeNO26F&q=${encodeURIComponent(i)}&limit=25&offset=${r}&lang=en`,{config:o,standalone:a,resourceType:"generic",intent:"metadata"}))}}catch(o){return ii(o)}}})})}),{useLazyGetImageInfoQuery:yq,useGetImageInfoQuery:OG,useGetSearchImageQuery:AG,useLazyGetSearchImageQuery:_q,useSendAiImageRequestQuery:MG,useLazySendAiImageRequestQuery:vq,useGetAiImageQuery:kG,useLazyGetAiImageQuery:jG,useGetUnsplashImageQuery:RG,useLazyGetUnsplashImageQuery:bq,useGetSearchGifQuery:NG,useLazyGetSearchGifQuery:Eq,useGetAiImageSSEQuery:DG,useLazyGetAiImageSSEQuery:wq}=Uv,Bv="Optimise",Sq="usage_limit_exceeded",Pq=async(e,t,r)=>{const n=H(t).baseUrl.replaceAll(/[\\/]$/g,""),i=await Fe({baseUrl:`${n}/optimization/v1/validate`})(e,t,r);if(i.error){let o=i.error;if(typeof o.json=="function")try{o=await o.json()}catch{o=await o}return{error:o}}return i},$v=Ie({reducerPath:"optimiseApi",tagTypes:[Bv],baseQuery:Pq,endpoints:e=>({editLinks:e.mutation({query:t=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/links",body:t}),invalidatesTags:[Bv]}),editImages:e.mutation({query:t=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/images",body:t})}),editSpam:e.mutation({query:t=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/spamassasin",body:t})})})}),{useEditLinksMutation:Iq,useEditImagesMutation:Tq,useEditSpamMutation:Cq}=$v,Oq={currentSchema:{},monacoDidMount:!1},Aq="userSlice",qv=Te({name:Aq,initialState:Oq,reducers:{setMonacoDidMount:(e,{payload:t})=>{e.monacoDidMount=t}},extraReducers:e=>{e.addMatcher(zt.endpoints.getSchema.matchFulfilled,(t,r)=>{t.currentSchema=r.payload.schema})}}),{setMonacoDidMount:Mq}=qv.actions,kq={getContainer:C.getContainer,createIdentifier:C.createIdentifier$1,reducer:kS,reducerPath:Td},zv=C.createIdentifier$1("DefaultCommonStyles");function Gv(e){return e.getOrCreateInstance(zv,()=>it(void 0))}function jq(e){return e?.getInstance(zv)?.get()}function Rq(e,t){Gv(e).set(t)}var hc=C.createIdentifier$1("CodeErrors"),Hv=[];function Nq(e){return e.getOrCreateInstance(hc,()=>it(Hv))}function Dq(e){return e?.getInstance(hc)?.get()??Hv}function Lq(e){return e?.getInstance(hc)!==void 0}function Fq(e,t){Nq(e).set(t)}Object.defineProperty(p,"AICHAT",{enumerable:!0,get:function(){return rS}}),Object.defineProperty(p,"ANNOTATIONS_PARAMETERS",{enumerable:!0,get:function(){return X0}}),Object.defineProperty(p,"APPEARANCE",{enumerable:!0,get:function(){return H0}}),Object.defineProperty(p,"APP_COOKIES",{enumerable:!0,get:function(){return Ni}}),Object.defineProperty(p,"APP_ROUTES",{enumerable:!0,get:function(){return D0}}),Object.defineProperty(p,"ATOMS",{enumerable:!0,get:function(){return oS}}),Object.defineProperty(p,"AddAllBlocksModalLazy",{enumerable:!0,get:function(){return aF}}),Object.defineProperty(p,"AddNewBlockModalLazy",{enumerable:!0,get:function(){return oF}}),Object.defineProperty(p,"AiApi",{enumerable:!0,get:function(){return Xy}}),Object.defineProperty(p,"AiApiGenerator",{enumerable:!0,get:function(){return Zy}}),Object.defineProperty(p,"Atoms",{enumerable:!0,get:function(){return Pg}}),Object.defineProperty(p,"BASIC_BORDER_COLOR",{enumerable:!0,get:function(){return eS}}),Object.defineProperty(p,"BLOCK",{enumerable:!0,get:function(){return lS}}),Object.defineProperty(p,"BLOCKS",{enumerable:!0,get:function(){return iS}}),Object.defineProperty(p,"BLOCK_TAGS",{enumerable:!0,get:function(){return yS}}),Object.defineProperty(p,"BUILD",{enumerable:!0,get:function(){return ja}}),Object.defineProperty(p,"BlockAutoSaveToWpBlockAutoSave",{enumerable:!0,get:function(){return ch}}),Object.defineProperty(p,"BlockPreviewShadow",{enumerable:!0,get:function(){return Y$}}),Object.defineProperty(p,"BlocksSearchLazy",{enumerable:!0,get:function(){return rF}}),Object.defineProperty(p,"BrowserExtensionWarningModal",{enumerable:!0,get:function(){return zL}}),Object.defineProperty(p,"BrowserTranslateWarningModal",{enumerable:!0,get:function(){return HL}}),Object.defineProperty(p,"CANVAS_RESIZER_BINDER_ID",{enumerable:!0,get:function(){return YN}}),Object.defineProperty(p,"CANVAS_VIEWPORT_ID",{enumerable:!0,get:function(){return rx}}),Object.defineProperty(p,"CARDS",{enumerable:!0,get:function(){return Ed}}),Object.defineProperty(p,"COARSE_POINTER_QUERY",{enumerable:!0,get:function(){return Ih}}),Object.defineProperty(p,"COLLABORATION_EDITOR_WARNING_TEXT",{enumerable:!0,get:function(){return ZU}}),Object.defineProperty(p,"COMMON_STYLES",{enumerable:!0,get:function(){return O0}}),Object.defineProperty(p,"CSSTransition",{enumerable:!0,get:function(){return Xo}}),Object.defineProperty(p,"CURRENT_PROJECT_ID",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(p,"CanvasAlerts",{enumerable:!0,get:function(){return vU}}),Object.defineProperty(p,"CanvasAlertsProvider",{enumerable:!0,get:function(){return uU}}),Object.defineProperty(p,"CanvasColumn",{enumerable:!0,get:function(){return gU}}),Object.defineProperty(p,"CanvasWrapper",{enumerable:!0,get:function(){return _U}}),Object.defineProperty(p,"CodeColumn",{enumerable:!0,get:function(){return yU}}),Object.defineProperty(p,"CollaboratorList",{enumerable:!0,get:function(){return F1}}),Object.defineProperty(p,"D",{enumerable:!0,get:function(){return xl}}),Object.defineProperty(p,"DARK",{enumerable:!0,get:function(){return md}}),Object.defineProperty(p,"DEFAULT_SANDBOX_OP_TIMEOUT_MS",{enumerable:!0,get:function(){return Va}}),Object.defineProperty(p,"DEFAULT_SANDBOX_READY_TIMEOUT_MS",{enumerable:!0,get:function(){return Fi}}),Object.defineProperty(p,"DISABLED_TAB",{enumerable:!0,get:function(){return Q0}}),Object.defineProperty(p,"DISCONNECT_WARNING_TEXT",{enumerable:!0,get:function(){return eB}}),Object.defineProperty(p,"DISCUSS",{enumerable:!0,get:function(){return nS}}),Object.defineProperty(p,"DND_SOCIAL_LIST_REORDER_MIME",{enumerable:!0,get:function(){return L0}}),Object.defineProperty(p,"DiscussAiLazy",{enumerable:!0,get:function(){return ZL}}),Object.defineProperty(p,"DiscussLazy",{enumerable:!0,get:function(){return nF}}),Object.defineProperty(p,"DocumentSessionProvider",{enumerable:!0,get:function(){return uj}}),Object.defineProperty(p,"EDIT",{enumerable:!0,get:function(){return tS}}),Object.defineProperty(p,"EDIT_SELECTED_ELEMENT",{enumerable:!0,get:function(){return _d}}),Object.defineProperty(p,"EDIT_SELECTED_TABLE_CELLS",{enumerable:!0,get:function(){return Z0}}),Object.defineProperty(p,"ELEMENT_TYPES",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(p,"EMAIL",{enumerable:!0,get:function(){return bd}}),Object.defineProperty(p,"EMAIL_CODE_RULESET",{enumerable:!0,get:function(){return T$}}),Object.defineProperty(p,"EMAIL_DOCUMENTS_ID",{enumerable:!0,get:function(){return Ui}}),Object.defineProperty(p,"EMAIL_TAGS",{enumerable:!0,get:function(){return gS}}),Object.defineProperty(p,"EM_FILES_MODULES",{enumerable:!0,get:function(){return _y}}),Object.defineProperty(p,"ERROR",{enumerable:!0,get:function(){return A0}}),Object.defineProperty(p,"ERRORS",{enumerable:!0,get:function(){return pS}}),Object.defineProperty(p,"EVENT_TYPES",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(p,"ElementEntityKindProvider",{enumerable:!0,get:function(){return IL}}),Object.defineProperty(p,"ElementPath",{enumerable:!0,get:function(){return CL}}),Object.defineProperty(p,"EmIcons",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(p,"EmailAutoSaveToWpEmailAutoSave",{enumerable:!0,get:function(){return V_}}),Object.defineProperty(p,"EmailCodeSizeBadge",{enumerable:!0,get:function(){return ML}}),Object.defineProperty(p,"EmailConfirmationRequiredModal",{enumerable:!0,get:function(){return qU}}),Object.defineProperty(p,"EmailIframe",{enumerable:!0,get:function(){return Dg}}),Object.defineProperty(p,"EmailOpenFailedError",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(p,"EmailSettingsLazy",{enumerable:!0,get:function(){return XL}}),Object.defineProperty(p,"EmailStylesLazy",{enumerable:!0,get:function(){return JL}}),Object.defineProperty(p,"EmailToWpEmail",{enumerable:!0,get:function(){return nc}}),Object.defineProperty(p,"FEATURE_UPSELL_SLIDE",{enumerable:!0,get:function(){return rg}}),Object.defineProperty(p,"FileManagerLazy",{enumerable:!0,get:function(){return dF}}),Object.defineProperty(p,"GeometryProvider",{enumerable:!0,get:function(){return aU}}),Object.defineProperty(p,"HISTORY",{enumerable:!0,get:function(){return K0}}),Object.defineProperty(p,"Header",{enumerable:!0,get:function(){return D$}}),Object.defineProperty(p,"HiddenImageProperties",{enumerable:!0,get:function(){return SU}}),Object.defineProperty(p,"HistoryPanelLazy",{enumerable:!0,get:function(){return iF}}),Object.defineProperty(p,"ImagePickerProvider",{enumerable:!0,get:function(){return KA}}),Object.defineProperty(p,"LANDSCAPE_QUERY",{enumerable:!0,get:function(){return Th}}),Object.defineProperty(p,"LIGHT",{enumerable:!0,get:function(){return pd}}),Object.defineProperty(p,"LOCALE_SERVICE_ID",{enumerable:!0,get:function(){return ih}}),Object.defineProperty(p,"LOCAL_STORAGE_ITEMS",{enumerable:!0,get:function(){return It}}),Object.defineProperty(p,"LimitUpgradeModalLazy",{enumerable:!0,get:function(){return cF}}),Object.defineProperty(p,"LocaleProvider",{enumerable:!0,get:function(){return ak}}),Object.defineProperty(p,"MOBILE",{enumerable:!0,get:function(){return Pd}}),Object.defineProperty(p,"MODALS",{enumerable:!0,get:function(){return de}}),Object.defineProperty(p,"MOUNT_HEADLESS_MARK",{enumerable:!0,get:function(){return ob}}),Object.defineProperty(p,"ModalRootContext",{enumerable:!0,get:function(){return jd}}),Object.defineProperty(p,"MonacoEditorLazy",{enumerable:!0,get:function(){return PL}}),Object.defineProperty(p,"NOTIFY_COMMAND_ID",{enumerable:!0,get:function(){return Zm}}),Object.defineProperty(p,"NOT_ALL",{enumerable:!0,get:function(){return k0}}),Object.defineProperty(p,"OPTIMISE",{enumerable:!0,get:function(){return aS}}),Object.defineProperty(p,"OPTIMISE_TABS",{enumerable:!0,get:function(){return mS}}),Object.defineProperty(p,"OptimiseLazy",{enumerable:!0,get:function(){return eF}}),Object.defineProperty(p,"PENDING",{enumerable:!0,get:function(){return cS}}),Object.defineProperty(p,"PHASES",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(p,"PLUGIN_ZOOM_VAR",{enumerable:!0,get:function(){return Jk}}),Object.defineProperty(p,"PREFERS_COLOR_SCHEME_DARK",{enumerable:!0,get:function(){return N0}}),Object.defineProperty(p,"PREFERS_COLOR_SCHEME_LIGHT",{enumerable:!0,get:function(){return R0}}),Object.defineProperty(p,"PROPERTIES",{enumerable:!0,get:function(){return yd}}),Object.defineProperty(p,"PaneShell",{enumerable:!0,get:function(){return pU}}),Object.defineProperty(p,"PlanUpgradePrompt",{enumerable:!0,get:function(){return tg}}),Object.defineProperty(p,"PromiseAllCatched",{enumerable:!0,get:function(){return qB}}),Object.defineProperty(p,"PropertiesTabContent",{enumerable:!0,get:function(){return bU}}),Object.defineProperty(p,"Provider",{enumerable:!0,get:function(){return AE}}),Object.defineProperty(p,"READ_COMMON_BLOCKS_EVENT_ID",{enumerable:!0,get:function(){return CI}}),Object.defineProperty(p,"READ_TEMPLATE_BLOCKS_EVENT_ID",{enumerable:!0,get:function(){return TI}}),Object.defineProperty(p,"RESET_BORDER_PARAMS",{enumerable:!0,get:function(){return sS}}),Object.defineProperty(p,"REST_EMAIL_PORTS_ID",{enumerable:!0,get:function(){return Wi}}),Object.defineProperty(p,"ResizableArea",{enumerable:!0,get:function(){return hU}}),Object.defineProperty(p,"RootContext",{enumerable:!0,get:function(){return kd}}),Object.defineProperty(p,"RouteOutlet",{enumerable:!0,get:function(){return TP}}),Object.defineProperty(p,"SANDBOX_TRANSLATIONS_MAP",{enumerable:!0,get:function(){return _S}}),Object.defineProperty(p,"SAVE_COMMAND_ID",{enumerable:!0,get:function(){return QM}}),Object.defineProperty(p,"SCALED_LAYOUT_CLASS",{enumerable:!0,get:function(){return Xk}}),Object.defineProperty(p,"SCALED_LAYOUT_WIDTH",{enumerable:!0,get:function(){return nl}}),Object.defineProperty(p,"SETTINGS",{enumerable:!0,get:function(){return W0}}),Object.defineProperty(p,"SOCIAL_ICON_ORIGINAL_BY_PLATFORM",{enumerable:!0,get:function(){return Un}}),Object.defineProperty(p,"STRUCTURE",{enumerable:!0,get:function(){return V0}}),Object.defineProperty(p,"STYLES",{enumerable:!0,get:function(){return vd}}),Object.defineProperty(p,"SYSTEM",{enumerable:!0,get:function(){return j0}}),Object.defineProperty(p,"SaveBlockBtnLazy",{enumerable:!0,get:function(){return lF}}),Object.defineProperty(p,"SelectedElementPanelInCodeMode",{enumerable:!0,get:function(){return wU}}),Object.defineProperty(p,"SelectionProvider",{enumerable:!0,get:function(){return nU}}),Object.defineProperty(p,"SendTestEmailModalLazy",{enumerable:!0,get:function(){return sF}}),Object.defineProperty(p,"Structures",{enumerable:!0,get:function(){return Fh}}),Object.defineProperty(p,"StructuresMedia",{enumerable:!0,get:function(){return Uh}}),Object.defineProperty(p,"SwitchLockBtn",{enumerable:!0,get:function(){return K_}}),Object.defineProperty(p,"TABLE_PROPERTIES",{enumerable:!0,get:function(){return J0}}),Object.defineProperty(p,"TEMPLATE_EMAIL_ID",{enumerable:!0,get:function(){return wd}}),Object.defineProperty(p,"TYPES_TRANSLATE",{enumerable:!0,get:function(){return vS}}),Object.defineProperty(p,"TextChange",{enumerable:!0,get:function(){return He}}),Object.defineProperty(p,"USAGE_LIMIT_EXCEEDED_CODE",{enumerable:!0,get:function(){return Sq}}),Object.defineProperty(p,"UTM_PARAMETERS",{enumerable:!0,get:function(){return Y0}}),Object.defineProperty(p,"VALID",{enumerable:!0,get:function(){return dS}}),Object.defineProperty(p,"WARNINGS",{enumerable:!0,get:function(){return fS}}),Object.defineProperty(p,"WidthRuler",{enumerable:!0,get:function(){return QN}}),Object.defineProperty(p,"WpBlockRevisionToBlockRevision",{enumerable:!0,get:function(){return lh}}),Object.defineProperty(p,"WpEmailRevisionToEmailRevision",{enumerable:!0,get:function(){return H_}}),Object.defineProperty(p,"WpEmailToEmail",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(p,"_extends",{enumerable:!0,get:function(){return di}}),Object.defineProperty(p,"_objectWithoutPropertiesLoose",{enumerable:!0,get:function(){return ua}}),Object.defineProperty(p,"_polyfill_node_global_default",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(p,"_setPrototypeOf",{enumerable:!0,get:function(){return Ko}}),Object.defineProperty(p,"_typeof",{enumerable:!0,get:function(){return Fa}}),Object.defineProperty(p,"addDocumentListenerFromShadow",{enumerable:!0,get:function(){return Ex}}),Object.defineProperty(p,"addWindowListenerFromShadow",{enumerable:!0,get:function(){return bx}}),Object.defineProperty(p,"ae",{enumerable:!0,get:function(){return Uy}}),Object.defineProperty(p,"api",{enumerable:!0,get:function(){return Tm}}),Object.defineProperty(p,"appendEmVersionForPreviewReload",{enumerable:!0,get:function(){return fx}}),Object.defineProperty(p,"applyEditorOptions",{enumerable:!0,get:function(){return uq}}),Object.defineProperty(p,"applyMetaPatch",{enumerable:!0,get:function(){return Df}}),Object.defineProperty(p,"authorizationApi",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(p,"autosaveBody",{enumerable:!0,get:function(){return Nf}}),Object.defineProperty(p,"autosaveStateFromRevisions",{enumerable:!0,get:function(){return Rf}}),Object.defineProperty(p,"autosaveStateFromSlots",{enumerable:!0,get:function(){return Qa}}),Object.defineProperty(p,"blockPreviewHref",{enumerable:!0,get:function(){return UU}}),Object.defineProperty(p,"blockRevisionsDataSourceProvider",{enumerable:!0,get:function(){return ff}}),Object.defineProperty(p,"blockSessionKey",{enumerable:!0,get:function(){return Xf}}),Object.defineProperty(p,"blockSlice",{enumerable:!0,get:function(){return fh}}),Object.defineProperty(p,"blocksApi",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(p,"blocksDataSourceProvider",{enumerable:!0,get:function(){return Ha}}),Object.defineProperty(p,"blocksPageSlice",{enumerable:!0,get:function(){return o_}}),Object.defineProperty(p,"browser$1",{enumerable:!0,get:function(){return Ou}}),Object.defineProperty(p,"buildEmailRawSharePath",{enumerable:!0,get:function(){return LU}}),Object.defineProperty(p,"buildEmailRawShareUrl",{enumerable:!0,get:function(){return DU}}),Object.defineProperty(p,"buildGetElementPreviewPath",{enumerable:!0,get:function(){return NU}}),Object.defineProperty(p,"buildResolvedFileManagerProviders",{enumerable:!0,get:function(){return Qy}}),Object.defineProperty(p,"canvasPreviewMetrics",{enumerable:!0,get:function(){return rj}}),Object.defineProperty(p,"ce",{enumerable:!0,get:function(){return By}}),Object.defineProperty(p,"changeConfig",{enumerable:!0,get:function(){return hl}}),Object.defineProperty(p,"clearDiagnostics",{enumerable:!0,get:function(){return fb}}),Object.defineProperty(p,"clientFromApi",{enumerable:!0,get:function(){return H}}),Object.defineProperty(p,"cloneBlockPreviewForDrag",{enumerable:!0,get:function(){return X$}}),Object.defineProperty(p,"closeModal",{enumerable:!0,get:function(){return kk}}),Object.defineProperty(p,"closeModal$1",{enumerable:!0,get:function(){return xA}}),Object.defineProperty(p,"closeSecondModal",{enumerable:!0,get:function(){return BA}}),Object.defineProperty(p,"combineReducers",{enumerable:!0,get:function(){return fa}}),Object.defineProperty(p,"comingSoonHandler",{enumerable:!0,get:function(){return ZC}}),Object.defineProperty(p,"commentsApi",{enumerable:!0,get:function(){return e_}}),Object.defineProperty(p,"commentsDataSourceProvider",{enumerable:!0,get:function(){return pf}}),Object.defineProperty(p,"commonLocale",{enumerable:!0,get:function(){return Um}}),Object.defineProperty(p,"configureStore",{enumerable:!0,get:function(){return Dw}}),Object.defineProperty(p,"confirmationMailApi",{enumerable:!0,get:function(){return Cv}}),Object.defineProperty(p,"createApi",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(p,"createBaselinePolicy",{enumerable:!0,get:function(){return Hf}}),Object.defineProperty(p,"createDraftFromTemplate",{enumerable:!0,get:function(){return sT}}),Object.defineProperty(p,"createEventIdentifier",{enumerable:!0,get:function(){return Di}}),Object.defineProperty(p,"createI18n",{enumerable:!0,get:function(){return Ks}}),Object.defineProperty(p,"createIFrame",{enumerable:!0,get:function(){return S$}}),Object.defineProperty(p,"createNewEmailDraft",{enumerable:!0,get:function(){return Bf}}),Object.defineProperty(p,"createRestClientV2",{enumerable:!0,get:function(){return Yy}}),Object.defineProperty(p,"createSlice",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(p,"createSource",{enumerable:!0,get:function(){return it}}),Object.defineProperty(p,"createState",{enumerable:!0,get:function(){return e0}}),Object.defineProperty(p,"createUnconfiguredInputWarner",{enumerable:!0,get:function(){return Gf}}),Object.defineProperty(p,"createZip",{enumerable:!0,get:function(){return _B}}),Object.defineProperty(p,"css",{enumerable:!0,get:function(){return ia}}),Object.defineProperty(p,"cssVarName",{enumerable:!0,get:function(){return Ir}}),Object.defineProperty(p,"decodeFileNameFromPath",{enumerable:!0,get:function(){return qy}}),Object.defineProperty(p,"decodeFileNameFromUrl",{enumerable:!0,get:function(){return zy}}),Object.defineProperty(p,"defaultModePanesSlice",{enumerable:!0,get:function(){return n_}}),Object.defineProperty(p,"detectMount",{enumerable:!0,get:function(){return bc}}),Object.defineProperty(p,"di",{enumerable:!0,get:function(){return kq}}),Object.defineProperty(p,"drainLoaderMarks",{enumerable:!0,get:function(){return Ic}}),Object.defineProperty(p,"e",{enumerable:!0,get:function(){return z}}),Object.defineProperty(p,"emCssVar",{enumerable:!0,get:function(){return AS}}),Object.defineProperty(p,"emailOpenFailureReason",{enumerable:!0,get:function(){return ls}}),Object.defineProperty(p,"emailPageSlice",{enumerable:!0,get:function(){return _h}}),Object.defineProperty(p,"emailSlice",{enumerable:!0,get:function(){return ud}}),Object.defineProperty(p,"emailValidation",{enumerable:!0,get:function(){return YC}}),Object.defineProperty(p,"emailsApi",{enumerable:!0,get:function(){return W_}}),Object.defineProperty(p,"enrichEditorSettings",{enumerable:!0,get:function(){return ux}}),Object.defineProperty(p,"executeCommand",{enumerable:!0,get:function(){return WM}}),Object.defineProperty(p,"existingTermIdFromError",{enumerable:!0,get:function(){return TA}}),Object.defineProperty(p,"failedTerms",{enumerable:!0,get:function(){return IA}}),Object.defineProperty(p,"fetchBaseQuery",{enumerable:!0,get:function(){return As}}),Object.defineProperty(p,"fetchBaseQueryApp",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(p,"filterUndefined",{enumerable:!0,get:function(){return De}}),Object.defineProperty(p,"findShadowRoot",{enumerable:!0,get:function(){return aa}}),Object.defineProperty(p,"fireUploadImageEvent",{enumerable:!0,get:function(){return py}}),Object.defineProperty(p,"formatCodeSize",{enumerable:!0,get:function(){return ey}}),Object.defineProperty(p,"formatDate",{enumerable:!0,get:function(){return GC}}),Object.defineProperty(p,"formatEmBlockVersion",{enumerable:!0,get:function(){return Ov}}),Object.defineProperty(p,"fromRevision",{enumerable:!0,get:function(){return as}}),Object.defineProperty(p,"fromServerFacts",{enumerable:!0,get:function(){return np}}),Object.defineProperty(p,"generateCopyHtml",{enumerable:!0,get:function(){return KC}}),Object.defineProperty(p,"generateCopyTitle",{enumerable:!0,get:function(){return Cp}}),Object.defineProperty(p,"getAiTariffUpgradeStep",{enumerable:!0,get:function(){return FL}}),Object.defineProperty(p,"getAppConfig",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(p,"getAppNamespaceRoot",{enumerable:!0,get:function(){return vc}}),Object.defineProperty(p,"getAppProject",{enumerable:!0,get:function(){return vp}}),Object.defineProperty(p,"getBlockDesc",{enumerable:!0,get:function(){return nk}}),Object.defineProperty(p,"getBlocksProject",{enumerable:!0,get:function(){return bp}}),Object.defineProperty(p,"getBrandNamespace",{enumerable:!0,get:function(){return ta}}),Object.defineProperty(p,"getBrowserImageCompressionLibUrl",{enumerable:!0,get:function(){return Xl}}),Object.defineProperty(p,"getBundledHostAssetUrl",{enumerable:!0,get:function(){return __}}),Object.defineProperty(p,"getCanvasService",{enumerable:!0,get:function(){return Tg}}),Object.defineProperty(p,"getClient",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(p,"getClientV2",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(p,"getCodeErrors",{enumerable:!0,get:function(){return Dq}}),Object.defineProperty(p,"getCodeMode",{enumerable:!0,get:function(){return hh}}),Object.defineProperty(p,"getCodeSize",{enumerable:!0,get:function(){return ty}}),Object.defineProperty(p,"getComponentRegistry",{enumerable:!0,get:function(){return YS}}),Object.defineProperty(p,"getComputedStyleAsync",{enumerable:!0,get:function(){return gE}}),Object.defineProperty(p,"getConditionalComment",{enumerable:!0,get:function(){return mE}}),Object.defineProperty(p,"getCurrentProject",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(p,"getCurrentUser",{enumerable:!0,get:function(){return Qi}}),Object.defineProperty(p,"getDataSources",{enumerable:!0,get:function(){return _p}}),Object.defineProperty(p,"getDefaultCommonStyles",{enumerable:!0,get:function(){return jq}}),Object.defineProperty(p,"getDiagnosticsSnapshot",{enumerable:!0,get:function(){return ub}}),Object.defineProperty(p,"getDiagnosticsStore",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(p,"getDisposable",{enumerable:!0,get:function(){return df}}),Object.defineProperty(p,"getDocType",{enumerable:!0,get:function(){return qc}}),Object.defineProperty(p,"getEditorOptions",{enumerable:!0,get:function(){return cq}}),Object.defineProperty(p,"getEditorVisible",{enumerable:!0,get:function(){return Rl}}),Object.defineProperty(p,"getElementInnerHTML",{enumerable:!0,get:function(){return Vc}}),Object.defineProperty(p,"getElementStartHtml_VDOM",{enumerable:!0,get:function(){return kb}}),Object.defineProperty(p,"getEmailDesc",{enumerable:!0,get:function(){return rk}}),Object.defineProperty(p,"getEmailDocuments",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(p,"getEmitter",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(p,"getEvent",{enumerable:!0,get:function(){return zS}}),Object.defineProperty(p,"getLimitUpgradePresetDefinition",{enumerable:!0,get:function(){return jL}}),Object.defineProperty(p,"getMessageService",{enumerable:!0,get:function(){return Ba}}),Object.defineProperty(p,"getMimeExtension",{enumerable:!0,get:function(){return NF}}),Object.defineProperty(p,"getMimeType",{enumerable:!0,get:function(){return Sy}}),Object.defineProperty(p,"getOpenDocument",{enumerable:!0,get:function(){return bs}}),Object.defineProperty(p,"getOpenEmail",{enumerable:!0,get:function(){return RC}}),Object.defineProperty(p,"getOpenEmailDocuments",{enumerable:!0,get:function(){return $f}}),Object.defineProperty(p,"getOuterHtml",{enumerable:!0,get:function(){return Qr}}),Object.defineProperty(p,"getPublicPath",{enumerable:!0,get:function(){return y_}}),Object.defineProperty(p,"getRendererString",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(p,"getResourcesSnapshot",{enumerable:!0,get:function(){return db}}),Object.defineProperty(p,"getRestEmailPortFactories",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(p,"getRevisionServiceFlag",{enumerable:!0,get:function(){return qf}}),Object.defineProperty(p,"getSandboxGeneration",{enumerable:!0,get:function(){return kP}}),Object.defineProperty(p,"getSocialIcon",{enumerable:!0,get:function(){return eR}}),Object.defineProperty(p,"getSocialIconForBlockCell",{enumerable:!0,get:function(){return Zj}}),Object.defineProperty(p,"getSocialPresetsForBrand",{enumerable:!0,get:function(){return TN}}),Object.defineProperty(p,"getStore",{enumerable:!0,get:function(){return II}}),Object.defineProperty(p,"getTaxonomy",{enumerable:!0,get:function(){return tO}}),Object.defineProperty(p,"getTemplateDirectivesPolicy",{enumerable:!0,get:function(){return Vf}}),Object.defineProperty(p,"getTitleFromHtml",{enumerable:!0,get:function(){return QC}}),Object.defineProperty(p,"hasCheckedCode",{enumerable:!0,get:function(){return Lq}}),Object.defineProperty(p,"hasOwnMeta",{enumerable:!0,get:function(){return Ja}}),Object.defineProperty(p,"hasThumbnailWatcher",{enumerable:!0,get:function(){return A1}}),Object.defineProperty(p,"identifyUser",{enumerable:!0,get:function(){return yT}}),Object.defineProperty(p,"imageApi",{enumerable:!0,get:function(){return Uv}}),Object.defineProperty(p,"inferImageMimeFromFileName",{enumerable:!0,get:function(){return ei}}),Object.defineProperty(p,"init__polyfill_node_global",{enumerable:!0,get:function(){return pa}}),Object.defineProperty(p,"init__polyfill_node_process",{enumerable:!0,get:function(){return JE}}),Object.defineProperty(p,"injectBlockHistoryPort",{enumerable:!0,get:function(){return NI}}),Object.defineProperty(p,"injectEmBlockIdIntoBlockHtml",{enumerable:!0,get:function(){return B$}}),Object.defineProperty(p,"injectEmailRightsResolver",{enumerable:!0,get:function(){return cT}}),Object.defineProperty(p,"injectEmailTermsResolver",{enumerable:!0,get:function(){return cC}}),Object.defineProperty(p,"injectRestEmailPortFactories",{enumerable:!0,get:function(){return sC}}),Object.defineProperty(p,"isAMPImageElement",{enumerable:!0,get:function(){return oE}}),Object.defineProperty(p,"isAllowedImageUploadFile",{enumerable:!0,get:function(){return Wl}}),Object.defineProperty(p,"isBlockSessionKey",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(p,"isCodeSizeExceeded",{enumerable:!0,get:function(){return ry}}),Object.defineProperty(p,"isComment",{enumerable:!0,get:function(){return oa}}),Object.defineProperty(p,"isDiagnosticsEnabled",{enumerable:!0,get:function(){return _c}}),Object.defineProperty(p,"isDocument",{enumerable:!0,get:function(){return Hc}}),Object.defineProperty(p,"isDocumentFragment",{enumerable:!0,get:function(){return uE}}),Object.defineProperty(p,"isEditorLockedByPlan",{enumerable:!0,get:function(){return ol}}),Object.defineProperty(p,"isElement",{enumerable:!0,get:function(){return ci}}),Object.defineProperty(p,"isFileManagerV2Enabled",{enumerable:!0,get:function(){return vy}}),Object.defineProperty(p,"isForm",{enumerable:!0,get:function(){return sE}}),Object.defineProperty(p,"isHtmlElement",{enumerable:!0,get:function(){return nE}}),Object.defineProperty(p,"isImageCenterModal",{enumerable:!0,get:function(){return bm}}),Object.defineProperty(p,"isImageEditModal",{enumerable:!0,get:function(){return GA}}),Object.defineProperty(p,"isImageElement",{enumerable:!0,get:function(){return iE}}),Object.defineProperty(p,"isIntegratorRejection",{enumerable:!0,get:function(){return kf}}),Object.defineProperty(p,"isProjectsV2Enabled",{enumerable:!0,get:function(){return We}}),Object.defineProperty(p,"isRejectedSave",{enumerable:!0,get:function(){return jf}}),Object.defineProperty(p,"isRevisionServiceEnabled",{enumerable:!0,get:function(){return Bi}}),Object.defineProperty(p,"isScriptElement",{enumerable:!0,get:function(){return cE}}),Object.defineProperty(p,"isStandaloneRuntime",{enumerable:!0,get:function(){return gy}}),Object.defineProperty(p,"isStyleElement",{enumerable:!0,get:function(){return Gc}}),Object.defineProperty(p,"isTableElement",{enumerable:!0,get:function(){return hE}}),Object.defineProperty(p,"isTextNode",{enumerable:!0,get:function(){return sa}}),Object.defineProperty(p,"isUseBlocksBuild",{enumerable:!0,get:function(){return $U}}),Object.defineProperty(p,"lazyRoute",{enumerable:!0,get:function(){return Ao}}),Object.defineProperty(p,"leaveBlock",{enumerable:!0,get:function(){return fq}}),Object.defineProperty(p,"limitsApi",{enumerable:!0,get:function(){return yl}}),Object.defineProperty(p,"loadDocumentContent",{enumerable:!0,get:function(){return C$}}),Object.defineProperty(p,"loadGFonts",{enumerable:!0,get:function(){return ax}}),Object.defineProperty(p,"loadPanels",{enumerable:!0,get:function(){return Dl}}),Object.defineProperty(p,"logShowPipeline",{enumerable:!0,get:function(){return NT}}),Object.defineProperty(p,"logShowPipelineError",{enumerable:!0,get:function(){return hb}}),Object.defineProperty(p,"logShowPipelineWait",{enumerable:!0,get:function(){return DT}}),Object.defineProperty(p,"mapMargeTags",{enumerable:!0,get:function(){return Md}}),Object.defineProperty(p,"mapper",{enumerable:!0,get:function(){return $B}}),Object.defineProperty(p,"mark",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(p,"markAppearanceNeedsUpdate",{enumerable:!0,get:function(){return h0}}),Object.defineProperty(p,"measureBlockPreviews",{enumerable:!0,get:function(){return vj}}),Object.defineProperty(p,"mergeEntityPreservingMeta",{enumerable:!0,get:function(){return Lf}}),Object.defineProperty(p,"minifyHtml",{enumerable:!0,get:function(){return OL}}),Object.defineProperty(p,"missingRequiredPhases",{enumerable:!0,get:function(){return sb}}),Object.defineProperty(p,"normalizeUrl",{enumerable:!0,get:function(){return No}}),Object.defineProperty(p,"onPanelSettingsSent",{enumerable:!0,get:function(){return fI}}),Object.defineProperty(p,"onSandboxGenerationChange",{enumerable:!0,get:function(){return jP}}),Object.defineProperty(p,"openFailureFromResponse",{enumerable:!0,get:function(){return nC}}),Object.defineProperty(p,"openModal",{enumerable:!0,get:function(){return Mk}}),Object.defineProperty(p,"openModal$1",{enumerable:!0,get:function(){return vm}}),Object.defineProperty(p,"openSecondModal",{enumerable:!0,get:function(){return UA}}),Object.defineProperty(p,"optimiseApi",{enumerable:!0,get:function(){return $v}}),Object.defineProperty(p,"parentEmailBlocksArgs",{enumerable:!0,get:function(){return G$}}),Object.defineProperty(p,"parentEmailSource",{enumerable:!0,get:function(){return q$}}),Object.defineProperty(p,"parseEmBlockVersion",{enumerable:!0,get:function(){return x$}}),Object.defineProperty(p,"parseFromString",{enumerable:!0,get:function(){return $c}}),Object.defineProperty(p,"parseISO",{enumerable:!0,get:function(){return Vd}}),Object.defineProperty(p,"peekEmailDocuments",{enumerable:!0,get:function(){return hs}}),Object.defineProperty(p,"pickFileProxyBlobFromFireResults",{enumerable:!0,get:function(){return bF}}),Object.defineProperty(p,"pickProxyUrlOverrideFromFireResults",{enumerable:!0,get:function(){return EF}}),Object.defineProperty(p,"prepareEmailHtmlForEditor",{enumerable:!0,get:function(){return ZB}}),Object.defineProperty(p,"prepareImageForEditorResult",{enumerable:!0,get:function(){return zx}}),Object.defineProperty(p,"prepareImageForEditorUpload",{enumerable:!0,get:function(){return S_}}),Object.defineProperty(p,"prepareImageForUpload",{enumerable:!0,get:function(){return Yl}}),Object.defineProperty(p,"presetLimitDisplay",{enumerable:!0,get:function(){return RL}}),Object.defineProperty(p,"previewHrefForRacs",{enumerable:!0,get:function(){return xU}}),Object.defineProperty(p,"processAmp",{enumerable:!0,get:function(){return I$}}),Object.defineProperty(p,"projectBlocksArgs",{enumerable:!0,get:function(){return $$}}),Object.defineProperty(p,"projectGroupsLoaded",{enumerable:!0,get:function(){return _0}}),Object.defineProperty(p,"projectSettingsStylesApi",{enumerable:!0,get:function(){return qn}}),Object.defineProperty(p,"projectSettingsV2Api",{enumerable:!0,get:function(){return vl}}),Object.defineProperty(p,"projectsApi",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(p,"projectsPageSlice",{enumerable:!0,get:function(){return _m}}),Object.defineProperty(p,"provideAutosaveUiFacts",{enumerable:!0,get:function(){return hp}}),Object.defineProperty(p,"provideCodeMode",{enumerable:!0,get:function(){return Eo}}),Object.defineProperty(p,"provideCurrentProject",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(p,"provideCurrentUser",{enumerable:!0,get:function(){return fs}}),Object.defineProperty(p,"provideDefaultCommonStyles",{enumerable:!0,get:function(){return Gv}}),Object.defineProperty(p,"provideEditorOptions",{enumerable:!0,get:function(){return Fv}}),Object.defineProperty(p,"provideEmailDocuments",{enumerable:!0,get:function(){return oT}}),Object.defineProperty(p,"provideHeadlessMode",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(p,"readBlockById",{enumerable:!0,get:function(){return NC}}),Object.defineProperty(p,"readDocumentContent",{enumerable:!0,get:function(){return kg}}),Object.defineProperty(p,"readDroppedImage",{enumerable:!0,get:function(){return Gx}}),Object.defineProperty(p,"readRootEmBlockAttrs",{enumerable:!0,get:function(){return U$}}),Object.defineProperty(p,"readScreenFacts",{enumerable:!0,get:function(){return tj}}),Object.defineProperty(p,"readZip",{enumerable:!0,get:function(){return J_}}),Object.defineProperty(p,"readZipFromBase64",{enumerable:!0,get:function(){return vB}}),Object.defineProperty(p,"reducerPath",{enumerable:!0,get:function(){return Td}}),Object.defineProperty(p,"rememberAutosaveTime",{enumerable:!0,get:function(){return u0}}),Object.defineProperty(p,"reportEntityLoadError",{enumerable:!0,get:function(){return oq}}),Object.defineProperty(p,"reportError",{enumerable:!0,get:function(){return es}}),Object.defineProperty(p,"require_prop_types",{enumerable:!0,get:function(){return Xc}}),Object.defineProperty(p,"requiredArgs",{enumerable:!0,get:function(){return qd}}),Object.defineProperty(p,"requiredPhases",{enumerable:!0,get:function(){return wc}}),Object.defineProperty(p,"resetBlockSlice",{enumerable:!0,get:function(){return Ek}}),Object.defineProperty(p,"resetElementHistorySlice",{enumerable:!0,get:function(){return zU}}),Object.defineProperty(p,"resetEmailSlice",{enumerable:!0,get:function(){return c0}}),Object.defineProperty(p,"resetPanes",{enumerable:!0,get:function(){return Y1}}),Object.defineProperty(p,"resetParentBlocks",{enumerable:!0,get:function(){return xk}}),Object.defineProperty(p,"resetToLastActiveSettingsTab",{enumerable:!0,get:function(){return vh}}),Object.defineProperty(p,"resolveContentReadyTimeoutMs",{enumerable:!0,get:function(){return jI}}),Object.defineProperty(p,"resolveEmailPort",{enumerable:!0,get:function(){return gs}}),Object.defineProperty(p,"resolveImageCompressionLimits",{enumerable:!0,get:function(){return Ql}}),Object.defineProperty(p,"resolveOpenEmail",{enumerable:!0,get:function(){return pc}}),Object.defineProperty(p,"resolveSandboxOpTimeoutMs",{enumerable:!0,get:function(){return yf}}),Object.defineProperty(p,"resolveSandboxReadyTimeoutMs",{enumerable:!0,get:function(){return RI}}),Object.defineProperty(p,"resolveSequentialSandboxOpBudgetMs",{enumerable:!0,get:function(){return kI}}),Object.defineProperty(p,"resolveTemplateDirectivesConfig",{enumerable:!0,get:function(){return xB}}),Object.defineProperty(p,"resolveUploadLinkAction",{enumerable:!0,get:function(){return PF}}),Object.defineProperty(p,"revisionHistorySlice",{enumerable:!0,get:function(){return rc}}),Object.defineProperty(p,"ru_RU_exports",{enumerable:!0,get:function(){return zM}}),Object.defineProperty(p,"runOncePerSession",{enumerable:!0,get:function(){return _x}}),Object.defineProperty(p,"sanitizeHtml",{enumerable:!0,get:function(){return Jh}}),Object.defineProperty(p,"saveFileApi",{enumerable:!0,get:function(){return G_}}),Object.defineProperty(p,"saveRefusalReason",{enumerable:!0,get:function(){return RT}}),Object.defineProperty(p,"scaledViewportContent",{enumerable:!0,get:function(){return ej}}),Object.defineProperty(p,"selectActiveModal",{enumerable:!0,get:function(){return qk}}),Object.defineProperty(p,"selectActiveModal$1",{enumerable:!0,get:function(){return qs}}),Object.defineProperty(p,"selectActiveProblemRange",{enumerable:!0,get:function(){return P0}}),Object.defineProperty(p,"selectActiveSettingsTab",{enumerable:!0,get:function(){return Eh}}),Object.defineProperty(p,"selectBlockSettings",{enumerable:!0,get:function(){return Sk}}),Object.defineProperty(p,"selectBlocksTotal",{enumerable:!0,get:function(){return Z1}}),Object.defineProperty(p,"selectCodeModeDirection",{enumerable:!0,get:function(){return Wk}}),Object.defineProperty(p,"selectEditorThemeColor",{enumerable:!0,get:function(){return Pk}}),Object.defineProperty(p,"selectEditorThemeColor$1",{enumerable:!0,get:function(){return fd}}),Object.defineProperty(p,"selectElementHistoryHasMore",{enumerable:!0,get:function(){return GU}}),Object.defineProperty(p,"selectElementSettings",{enumerable:!0,get:function(){return ph}}),Object.defineProperty(p,"selectElementSettings$1",{enumerable:!0,get:function(){return dd}}),Object.defineProperty(p,"selectEmailSettings",{enumerable:!0,get:function(){return b0}}),Object.defineProperty(p,"selectEmailViewType",{enumerable:!0,get:function(){return Gk}}),Object.defineProperty(p,"selectEmailWidth",{enumerable:!0,get:function(){return bh}}),Object.defineProperty(p,"selectHistoryData",{enumerable:!0,get:function(){return HU}}),Object.defineProperty(p,"selectIsCodeMode",{enumerable:!0,get:function(){return $k}}),Object.defineProperty(p,"selectIsCodeMode$1",{enumerable:!0,get:function(){return wk}}),Object.defineProperty(p,"selectIsGlobalLoading",{enumerable:!0,get:function(){return Hk}}),Object.defineProperty(p,"selectIsHeaderCodeMenuOpen",{enumerable:!0,get:function(){return Qk}}),Object.defineProperty(p,"selectIsNeedUpdateAppearance",{enumerable:!0,get:function(){return I0}}),Object.defineProperty(p,"selectIsNeedUpdateContentAppearance",{enumerable:!0,get:function(){return v0}}),Object.defineProperty(p,"selectIsPanelHistoryCollapsed",{enumerable:!0,get:function(){return Yk}}),Object.defineProperty(p,"selectIsSettingsDisabled",{enumerable:!0,get:function(){return Ik}}),Object.defineProperty(p,"selectIsSettingsDisabled$1",{enumerable:!0,get:function(){return S0}}),Object.defineProperty(p,"selectMobileViewActive",{enumerable:!0,get:function(){return Vk}}),Object.defineProperty(p,"selectMonacoFocusing",{enumerable:!0,get:function(){return J1}}),Object.defineProperty(p,"selectParentBlocks",{enumerable:!0,get:function(){return zk}}),Object.defineProperty(p,"selectParentEmailBlocksTotal",{enumerable:!0,get:function(){return tx}}),Object.defineProperty(p,"selectProblemsList",{enumerable:!0,get:function(){return E0}}),Object.defineProperty(p,"selectProjectGroups",{enumerable:!0,get:function(){return w0}}),Object.defineProperty(p,"selectPropertiesPanelKey",{enumerable:!0,get:function(){return Kk}}),Object.defineProperty(p,"selectSecondModal",{enumerable:!0,get:function(){return $A}}),Object.defineProperty(p,"selectTemplateBlocksTotal",{enumerable:!0,get:function(){return ex}}),Object.defineProperty(p,"setActiveProblemRange",{enumerable:!0,get:function(){return p0}}),Object.defineProperty(p,"setActiveSettingsTab",{enumerable:!0,get:function(){return rl}}),Object.defineProperty(p,"setAttributeSafe",{enumerable:!0,get:function(){return Bc}}),Object.defineProperty(p,"setBlockSettings",{enumerable:!0,get:function(){return _k}}),Object.defineProperty(p,"setBlockSettingsDisable",{enumerable:!0,get:function(){return bk}}),Object.defineProperty(p,"setCodeErrors",{enumerable:!0,get:function(){return Fq}}),Object.defineProperty(p,"setCodeMode",{enumerable:!0,get:function(){return Lk}}),Object.defineProperty(p,"setCodeMode$1",{enumerable:!0,get:function(){return tl}}),Object.defineProperty(p,"setCodeModeDirection",{enumerable:!0,get:function(){return gh}}),Object.defineProperty(p,"setCurrentProjectCard",{enumerable:!0,get:function(){return eT}}),Object.defineProperty(p,"setCurrentProjectRefreshing",{enumerable:!0,get:function(){return ZI}}),Object.defineProperty(p,"setDefaultCommonStyles",{enumerable:!0,get:function(){return Rq}}),Object.defineProperty(p,"setEditorThemeColor",{enumerable:!0,get:function(){return yk}}),Object.defineProperty(p,"setEditorThemeColor$1",{enumerable:!0,get:function(){return o0}}),Object.defineProperty(p,"setElementSettings",{enumerable:!0,get:function(){return vk}}),Object.defineProperty(p,"setElementSettings$1",{enumerable:!0,get:function(){return s0}}),Object.defineProperty(p,"setEmailGroups",{enumerable:!0,get:function(){return m0}}),Object.defineProperty(p,"setEmailSettings",{enumerable:!0,get:function(){return a0}}),Object.defineProperty(p,"setEmailSettingsDisable",{enumerable:!0,get:function(){return l0}}),Object.defineProperty(p,"setEmailWidth",{enumerable:!0,get:function(){return Rk}}),Object.defineProperty(p,"setHeaderCodeMenuOpen",{enumerable:!0,get:function(){return Bk}}),Object.defineProperty(p,"setHeadlessMode",{enumerable:!0,get:function(){return vE}}),Object.defineProperty(p,"setHiddenMount",{enumerable:!0,get:function(){return wE}}),Object.defineProperty(p,"setIsGlobalLoading",{enumerable:!0,get:function(){return Uk}}),Object.defineProperty(p,"setIsNeedUpdateAppearance",{enumerable:!0,get:function(){return g0}}),Object.defineProperty(p,"setIsNeedUpdateContentAppearance",{enumerable:!0,get:function(){return y0}}),Object.defineProperty(p,"setMobileViewActive",{enumerable:!0,get:function(){return Dk}}),Object.defineProperty(p,"setMonacoDidMount",{enumerable:!0,get:function(){return Mq}}),Object.defineProperty(p,"setMonacoFocusing",{enumerable:!0,get:function(){return X1}}),Object.defineProperty(p,"setProblemsList",{enumerable:!0,get:function(){return f0}}),Object.defineProperty(p,"setPropertiesPanelKey",{enumerable:!0,get:function(){return Fk}}),Object.defineProperty(p,"setupListeners",{enumerable:!0,get:function(){return yO}}),Object.defineProperty(p,"shouldEnableImageCompression",{enumerable:!0,get:function(){return Kl}}),Object.defineProperty(p,"shouldFallbackToBuiltInUpload",{enumerable:!0,get:function(){return my}}),Object.defineProperty(p,"shouldInsertUploadLinkAsIs",{enumerable:!0,get:function(){return SF}}),Object.defineProperty(p,"shouldScaleLayout",{enumerable:!0,get:function(){return Zk}}),Object.defineProperty(p,"snapshotBlock",{enumerable:!0,get:function(){return xv}}),Object.defineProperty(p,"stripEmVersionFromUrlString",{enumerable:!0,get:function(){return c_}}),Object.defineProperty(p,"stripSubjectTags",{enumerable:!0,get:function(){return C0}}),Object.defineProperty(p,"subscribeToContent",{enumerable:!0,get:function(){return jg}}),Object.defineProperty(p,"swallowPromiseRejection",{enumerable:!0,get:function(){return yx}}),Object.defineProperty(p,"switchCodeModeDirection",{enumerable:!0,get:function(){return Nk}}),Object.defineProperty(p,"switchIsPanelHistoryCollapsed",{enumerable:!0,get:function(){return jk}}),Object.defineProperty(p,"taxonomiesApi",{enumerable:!0,get:function(){return uo}}),Object.defineProperty(p,"templateBlocksArgs",{enumerable:!0,get:function(){return H$}}),Object.defineProperty(p,"themeTokenCssVarName",{enumerable:!0,get:function(){return MS}}),Object.defineProperty(p,"toAbsolute",{enumerable:!0,get:function(){return yc}}),Object.defineProperty(p,"toAbsoluteUrl",{enumerable:!0,get:function(){return Ll}}),Object.defineProperty(p,"toLanguageCode",{enumerable:!0,get:function(){return PU}}),Object.defineProperty(p,"toNumberSafe",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(p,"toProjectStylesProjectId",{enumerable:!0,get:function(){return ag}}),Object.defineProperty(p,"toUploadImageError",{enumerable:!0,get:function(){return hy}}),Object.defineProperty(p,"transformListResponseFn",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(p,"transformResponseFn",{enumerable:!0,get:function(){return we}}),Object.defineProperty(p,"tryParseISO",{enumerable:!0,get:function(){return qC}}),Object.defineProperty(p,"ue",{enumerable:!0,get:function(){return u1}}),Object.defineProperty(p,"unscaledHeight",{enumerable:!0,get:function(){return nj}}),Object.defineProperty(p,"uploadDroppedImage",{enumerable:!0,get:function(){return Hx}}),Object.defineProperty(p,"uploadFile",{enumerable:!0,get:function(){return P$}}),Object.defineProperty(p,"uploadFileViaDataProvider",{enumerable:!0,get:function(){return fy}}),Object.defineProperty(p,"useAddBlockMutation",{enumerable:!0,get:function(){return mk}}),Object.defineProperty(p,"useAddCommentMutation",{enumerable:!0,get:function(){return V1}}),Object.defineProperty(p,"useAddEmailMutation",{enumerable:!0,get:function(){return dB}}),Object.defineProperty(p,"useAddTermMutation",{enumerable:!0,get:function(){return RA}}),Object.defineProperty(p,"useAnalyticsEvent",{enumerable:!0,get:function(){return JP}}),Object.defineProperty(p,"useAppConfig",{enumerable:!0,get:function(){return st}}),Object.defineProperty(p,"useAppDispatch",{enumerable:!0,get:function(){return YA}}),Object.defineProperty(p,"useAppNavigate",{enumerable:!0,get:function(){return Ua}}),Object.defineProperty(p,"useAppSearchParams",{enumerable:!0,get:function(){return AP}}),Object.defineProperty(p,"useAppStore",{enumerable:!0,get:function(){return Im}}),Object.defineProperty(p,"useAutoSaveBlockMutation",{enumerable:!0,get:function(){return hk}}),Object.defineProperty(p,"useBrowserExtensionWarning",{enumerable:!0,get:function(){return Vx}}),Object.defineProperty(p,"useBrowserTranslateDetection",{enumerable:!0,get:function(){return tU}}),Object.defineProperty(p,"useBrowserTranslateWarning",{enumerable:!0,get:function(){return Wx}}),Object.defineProperty(p,"useChromeReady",{enumerable:!0,get:function(){return mF}}),Object.defineProperty(p,"useCodeModeActions",{enumerable:!0,get:function(){return cj}}),Object.defineProperty(p,"useCommand",{enumerable:!0,get:function(){return Jm}}),Object.defineProperty(p,"useConfigSource",{enumerable:!0,get:function(){return Ra}}),Object.defineProperty(p,"useContainer",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(p,"useContentReader",{enumerable:!0,get:function(){return rB}}),Object.defineProperty(p,"useContentReplacer",{enumerable:!0,get:function(){return Ev}}),Object.defineProperty(p,"useCookieManager",{enumerable:!0,get:function(){return wh}}),Object.defineProperty(p,"useCurrentProjectRequested",{enumerable:!0,get:function(){return TL}}),Object.defineProperty(p,"useCurrentUser",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(p,"useDeleteCommentMutation",{enumerable:!0,get:function(){return W1}}),Object.defineProperty(p,"useDeleteTargetMutation",{enumerable:!0,get:function(){return Q1}}),Object.defineProperty(p,"useDeleteTermMutation",{enumerable:!0,get:function(){return DA}}),Object.defineProperty(p,"useDispatch",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(p,"useDocumentAttributes",{enumerable:!0,get:function(){return Nv}}),Object.defineProperty(p,"useDocumentHistoryReader",{enumerable:!0,get:function(){return KU}}),Object.defineProperty(p,"useDocumentSessionContext",{enumerable:!0,get:function(){return et}}),Object.defineProperty(p,"useDocumentUndoState",{enumerable:!0,get:function(){return rD}}),Object.defineProperty(p,"useDragStartBlockToIframeHandler",{enumerable:!0,get:function(){return ws}}),Object.defineProperty(p,"useEditBlockMutation",{enumerable:!0,get:function(){return dh}}),Object.defineProperty(p,"useEditCommentMutation",{enumerable:!0,get:function(){return K1}}),Object.defineProperty(p,"useEditImagesMutation",{enumerable:!0,get:function(){return Tq}}),Object.defineProperty(p,"useEditLinksMutation",{enumerable:!0,get:function(){return Iq}}),Object.defineProperty(p,"useEditMeMutation",{enumerable:!0,get:function(){return vM}}),Object.defineProperty(p,"useEditProjectMutation",{enumerable:!0,get:function(){return SA}}),Object.defineProperty(p,"useEditSpamMutation",{enumerable:!0,get:function(){return Cq}}),Object.defineProperty(p,"useEditTermMutation",{enumerable:!0,get:function(){return NA}}),Object.defineProperty(p,"useEditorImageUpload",{enumerable:!0,get:function(){return L1}}),Object.defineProperty(p,"useEditorLocale",{enumerable:!0,get:function(){return Sg}}),Object.defineProperty(p,"useEditorLockCheck",{enumerable:!0,get:function(){return Gl}}),Object.defineProperty(p,"useEditorLocked",{enumerable:!0,get:function(){return m_}}),Object.defineProperty(p,"useEditorProjectId",{enumerable:!0,get:function(){return Zg}}),Object.defineProperty(p,"useElementEntityKind",{enumerable:!0,get:function(){return ko}}),Object.defineProperty(p,"useEmailAttribute",{enumerable:!0,get:function(){return mB}}),Object.defineProperty(p,"useEmailAttributesWriter",{enumerable:!0,get:function(){return pB}}),Object.defineProperty(p,"useEmailOfDocument",{enumerable:!0,get:function(){return Dv}}),Object.defineProperty(p,"useEvent",{enumerable:!0,get:function(){return Nd}}),Object.defineProperty(p,"useEventEmitter",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(p,"useFitBlockPreviewHeight",{enumerable:!0,get:function(){return wj}}),Object.defineProperty(p,"useGeometryRef",{enumerable:!0,get:function(){return sU}}),Object.defineProperty(p,"useGetAiGenerateStatusMutation",{enumerable:!0,get:function(){return G1}}),Object.defineProperty(p,"useGetBlockQuery",{enumerable:!0,get:function(){return dk}}),Object.defineProperty(p,"useGetBlocksQuery",{enumerable:!0,get:function(){return uk}}),Object.defineProperty(p,"useGetBlocksSchemaQuery",{enumerable:!0,get:function(){return fk}}),Object.defineProperty(p,"useGetCommentsQuery",{enumerable:!0,get:function(){return H1}}),Object.defineProperty(p,"useGetDialogQuery",{enumerable:!0,get:function(){return U1}}),Object.defineProperty(p,"useGetParentEmailBlocksQuery",{enumerable:!0,get:function(){return pk}}),Object.defineProperty(p,"useGetProjectIntegrationsQuery",{enumerable:!0,get:function(){return OR}}),Object.defineProperty(p,"useGetProjectPlanQuery",{enumerable:!0,get:function(){return bl}}),Object.defineProperty(p,"useGetProjectQuery",{enumerable:!0,get:function(){return pm}}),Object.defineProperty(p,"useGetProjectTestRecipientsQuery",{enumerable:!0,get:function(){return kR}}),Object.defineProperty(p,"useGetProjectWebhookQuery",{enumerable:!0,get:function(){return MR}}),Object.defineProperty(p,"useGetSubscriptionsQuery",{enumerable:!0,get:function(){return Dm}}),Object.defineProperty(p,"useGetTemplateBlocksQuery",{enumerable:!0,get:function(){return gk}}),Object.defineProperty(p,"useGetTermsQuery",{enumerable:!0,get:function(){return jA}}),Object.defineProperty(p,"useHeadless",{enumerable:!0,get:function(){return Na}}),Object.defineProperty(p,"useI18n",{enumerable:!0,get:function(){return he}}),Object.defineProperty(p,"useIframeReload",{enumerable:!0,get:function(){return Il}}),Object.defineProperty(p,"useImageControlRequest",{enumerable:!0,get:function(){return gx}}),Object.defineProperty(p,"useImageControlRequestCollector",{enumerable:!0,get:function(){return hx}}),Object.defineProperty(p,"useImagePicker",{enumerable:!0,get:function(){return QA}}),Object.defineProperty(p,"useIntegratorConfigValue",{enumerable:!0,get:function(){return Ad}}),Object.defineProperty(p,"useInterfaceLocale",{enumerable:!0,get:function(){return ah}}),Object.defineProperty(p,"useInterfaceTheme",{enumerable:!0,get:function(){return zN}}),Object.defineProperty(p,"useInvalidateProject",{enumerable:!0,get:function(){return wA}}),Object.defineProperty(p,"useInvalidateTerms",{enumerable:!0,get:function(){return kA}}),Object.defineProperty(p,"useIsLocaleInited",{enumerable:!0,get:function(){return qS}}),Object.defineProperty(p,"useIsStandalone",{enumerable:!0,get:function(){return yy}}),Object.defineProperty(p,"useLazyClearAiChatQuery",{enumerable:!0,get:function(){return q1}}),Object.defineProperty(p,"useLazyGetAiImageSSEQuery",{enumerable:!0,get:function(){return wq}}),Object.defineProperty(p,"useLazyGetDialogQuery",{enumerable:!0,get:function(){return B1}}),Object.defineProperty(p,"useLazyGetGeneratedContentQuery",{enumerable:!0,get:function(){return z1}}),Object.defineProperty(p,"useLazyGetImageInfoQuery",{enumerable:!0,get:function(){return yq}}),Object.defineProperty(p,"useLazyGetIntegrationCredentialsQuery",{enumerable:!0,get:function(){return AR}}),Object.defineProperty(p,"useLazyGetLimitsStatsByTypeQuery",{enumerable:!0,get:function(){return PR}}),Object.defineProperty(p,"useLazyGetMeQuery",{enumerable:!0,get:function(){return Nm}}),Object.defineProperty(p,"useLazyGetSearchGifQuery",{enumerable:!0,get:function(){return Eq}}),Object.defineProperty(p,"useLazyGetSearchImageQuery",{enumerable:!0,get:function(){return _q}}),Object.defineProperty(p,"useLazyGetUnsplashImageQuery",{enumerable:!0,get:function(){return bq}}),Object.defineProperty(p,"useLazySendAiImageRequestQuery",{enumerable:!0,get:function(){return vq}}),Object.defineProperty(p,"useLegacyAnalyticsEvent",{enumerable:!0,get:function(){return rf}}),Object.defineProperty(p,"useListenPostMessage",{enumerable:!0,get:function(){return zn}}),Object.defineProperty(p,"useMessageService",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(p,"useModalRootElement",{enumerable:!0,get:function(){return $S}}),Object.defineProperty(p,"useModel",{enumerable:!0,get:function(){return _L}}),Object.defineProperty(p,"useMountOnFirstOpen",{enumerable:!0,get:function(){return ly}}),Object.defineProperty(p,"useMyRoles",{enumerable:!0,get:function(){return tB}}),Object.defineProperty(p,"useNotification",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(p,"useNotifyCommand",{enumerable:!0,get:function(){return ik}}),Object.defineProperty(p,"useOpenEmail",{enumerable:!0,get:function(){return rq}}),Object.defineProperty(p,"useOpenEmailId",{enumerable:!0,get:function(){return Oh}}),Object.defineProperty(p,"useOpenPlanCatalog",{enumerable:!0,get:function(){return rU}}),Object.defineProperty(p,"usePanelsPrewarm",{enumerable:!0,get:function(){return QL}}),Object.defineProperty(p,"usePlanFeatureGate",{enumerable:!0,get:function(){return zR}}),Object.defineProperty(p,"usePlanLimitGate",{enumerable:!0,get:function(){return qL}}),Object.defineProperty(p,"usePrevious",{enumerable:!0,get:function(){return Wm}}),Object.defineProperty(p,"useProjectData",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(p,"useProjectPlanLimitPreflight",{enumerable:!0,get:function(){return $L}}),Object.defineProperty(p,"usePublishDocumentSession",{enumerable:!0,get:function(){return Z$}}),Object.defineProperty(p,"usePushToDataLayer",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(p,"usePutProjectTestRecipientsMutation",{enumerable:!0,get:function(){return jR}}),Object.defineProperty(p,"useRestClient",{enumerable:!0,get:function(){return aq}}),Object.defineProperty(p,"useRootElement",{enumerable:!0,get:function(){return Da}}),Object.defineProperty(p,"useRouteEmailId",{enumerable:!0,get:function(){return Ah}}),Object.defineProperty(p,"useRouteParams",{enumerable:!0,get:function(){return or}}),Object.defineProperty(p,"useRoutePathname",{enumerable:!0,get:function(){return CP}}),Object.defineProperty(p,"useSelectionRef",{enumerable:!0,get:function(){return iU}}),Object.defineProperty(p,"useSelector",{enumerable:!0,get:function(){return at}}),Object.defineProperty(p,"useSendLivePreviewMutation",{enumerable:!0,get:function(){return XU}}),Object.defineProperty(p,"useSendMessageMutation",{enumerable:!0,get:function(){return x1}}),Object.defineProperty(p,"useSendPostMessage",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(p,"useSendPostMessageEx",{enumerable:!0,get:function(){return pI}}),Object.defineProperty(p,"useSendShortLinkMutation",{enumerable:!0,get:function(){return JU}}),Object.defineProperty(p,"useSendStyleToggleToIframe",{enumerable:!0,get:function(){return eO}}),Object.defineProperty(p,"useSendTestEmailMutation",{enumerable:!0,get:function(){return YU}}),Object.defineProperty(p,"useSetCanvasAlerts",{enumerable:!0,get:function(){return fU}}),Object.defineProperty(p,"useSetGeometry",{enumerable:!0,get:function(){return cU}}),Object.defineProperty(p,"useSetHtmlElementInIframeHandler",{enumerable:!0,get:function(){return Ss}}),Object.defineProperty(p,"useSetSelection",{enumerable:!0,get:function(){return oU}}),Object.defineProperty(p,"useSetTitle",{enumerable:!0,get:function(){return L$}}),Object.defineProperty(p,"useStorageProvider",{enumerable:!0,get:function(){return sq}}),Object.defineProperty(p,"useStore",{enumerable:!0,get:function(){return se}}),Object.defineProperty(p,"useSyncProjectBrandStylesToEditor",{enumerable:!0,get:function(){return dx}}),Object.defineProperty(p,"useUploadImageMutation",{enumerable:!0,get:function(){return QU}}),Object.defineProperty(p,"useUserContentReplacer",{enumerable:!0,get:function(){return J$}}),Object.defineProperty(p,"useUserUndo",{enumerable:!0,get:function(){return nB}}),Object.defineProperty(p,"userSlice",{enumerable:!0,get:function(){return qv}}),Object.defineProperty(p,"v2ResultOf",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(p,"warmCodeEditor",{enumerable:!0,get:function(){return bL}}),Object.defineProperty(p,"whenIdle",{enumerable:!0,get:function(){return uy}}),Object.defineProperty(p,"writeEmailAttributes",{enumerable:!0,get:function(){return is}}),Object.defineProperty(p,"writePendingData",{enumerable:!0,get:function(){return cs}}),Object.defineProperty(p,"writeSourceReport",{enumerable:!0,get:function(){return Gi}}),Object.defineProperty(p,"zipEntryToBlob",{enumerable:!0,get:function(){return EB}}),Object.defineProperty(p,"zipEntryToText",{enumerable:!0,get:function(){return bB}})});
|
|
822
|
+
|
|
823
|
+
__emailmaker__.define("static/core/b0620c65.js",["require","exports","module","static/core/5dc34752.js","static/core/422c8b42.js","static/core/c804e4dd.js","react","react/jsx-runtime","__delivery__/libs","classnames"],function(te,Nt,di){const Rt=te("./5dc34752.js"),be=te("./422c8b42.js"),e=te("./c804e4dd.js");let i=te("react");i=Rt.__toESM(i);let t=te("react/jsx-runtime"),o=te("__delivery__/libs"),D=te("classnames");D=Rt.__toESM(D);var ms="code",us=(c,$)=>(0,t.jsx)($,{className:"email-pane__tab-bar",...c}),{Content:_s}=o.ui_kit$Layout,hs=()=>{e.loadPanels().catch(()=>{})},se=c=>(0,i.memo)($=>(0,t.jsx)(i.Suspense,{fallback:(0,t.jsx)(o.ui_kit$PageLoader,{}),children:(0,t.jsx)(c,{...$})})),fs=se(e.DiscussAiLazy),gs=se(e.EmailStylesLazy),Es=se(e.OptimiseLazy),Ss=se(e.BlocksSearchLazy),ys=(0,i.memo)(c=>(0,t.jsx)(e.MonacoEditorLazy,{...c})),ks=(0,i.memo)((0,i.forwardRef)((c,$)=>(0,t.jsx)(e.EmailIframe,{...c,ref:$}))),bs=(0,i.memo)(c=>(0,t.jsx)(e.Atoms,{...c})),vs=se(e.EmailSettingsLazy),Ts=se(e.HistoryPanelLazy),ws=se(e.DiscussLazy),Dt=({emailElement:c,kind:$,isSuccess:f,setIsCollaborationEditor:W,isShowAddAllBlocksModal:ve,triggerOpenSavedBlocksTab:Te,setIsShowAddAllBlocksModal:De})=>{const{__:d,_x:V}=e.useI18n(),y=e.useMessageService(),{blockId:T}=e.useRouteParams(),b=e.useEditorProjectId(),w=e.useRouteEmailId(),r=e.useDispatch(),A=e.useCodeModeActions(),We=e.useOpenPlanCatalog(),{modal:nt}=o.ui_kit$App.useApp(),l=e.useAppConfig(),Be=e.useEditorLocked(),at=e.useConfigSource(),Z=e.useHeadless(),x=e.useContainer(),re=e.useChromeReady("panel");e.usePanelsPrewarm(x),(0,i.useEffect)(()=>{e.getEditorVisible(x).notePagePainted()},[x]);const{token:ie}=(0,o.ui_kit$useToken)(),U=e.useNotification(),p=e.usePushToDataLayer(),k=e.useProjectData(),M=e.toProjectStylesProjectId(k?.id||b);e.useSyncProjectBrandStylesToEditor(M);const lt=e.useCookieManager(),g=e.useSelector(e.selectActiveSettingsTab),J=e.useCurrentUser(),G=e.toLanguageCode(e.useInterfaceLocale()),oe=e.useStore(),L=e.useGeometryRef(),{setWidthCodeSplit:de,setIsResizing:ee,setCurrentSide:we,setBlockMaxHeight:pe}=e.useSetGeometry(),me=e.useSelector(e.selectActiveModal$1),m=e.useSelector(e.selectIsCodeMode),E=e.useSelector(e.selectCodeModeDirection),[ct,rt]=(0,i.useState)(m);(0,i.useEffect)(()=>{m&&rt(!0)},[m]);const $e=e.useSelector(e.selectBlocksTotal),ze=e.useSelector(e.selectTemplateBlocksTotal),Pe=e.useSelector(e.selectParentEmailBlocksTotal),Ue=e.useSelector(e.selectPropertiesPanelKey),[dt]=e.useLazyClearAiChatQuery(),Y=e.useEditorImageUpload(),O=e.useSelector(e.selectEmailViewType)===e.MOBILE,[N,P]=(0,i.useState)(e.LIGHT),[K,ue]=(0,i.useState)(void 0),[_e,He]=(0,i.useState)(l.defaultBuildPanel||"empty"),[Fe,pt]=(0,i.useState)("empty"),[X,Ce]=(0,i.useState)(!1),[mt,Le]=(0,i.useState)([]),[he,Ve]=(0,i.useState)([]),{setPreviewAlertShow:fe,setTemplateNotEmAlertShow:Ge}=e.useSetCanvasAlerts(),{open:ut,close:_t}=e.useBrowserExtensionWarning(),{open:ne,close:Ye}=e.useBrowserTranslateWarning();e.useBrowserTranslateDetection();const _=e.useRootElement(),C=e.isEditorLockedByPlan(k,{isPlugin:!0}),S=e.usePlanFeatureGate("discussion"),j=e.usePlanFeatureGate("code_editor"),q=e.usePlanLimitGate("ai"),Ke=q.exceeded?e.getLimitUpgradePresetDefinition(q.exceeded.presetId):null,Ls=l?.configSwither||!1;(0,i.useEffect)(()=>{r(e.resetParentBlocks())},[r]),(0,i.useEffect)(()=>{const s=window.localStorage.getItem(e.LOCAL_STORAGE_ITEMS.em_active_tab);s&&r(e.setActiveSettingsTab(s))},[lt,r]);const v=w||T,B=$??(c.hasOwnProperty("type")?"block":"email"),Xe=e.useSetSelection(),ht=e.useSelectionRef(),qe=(0,i.useRef)(null);(0,i.useEffect)(()=>e.onPanelSettingsSent(()=>{qe.current=null}),[]);const ft=(0,i.useRef)(null),gt=(0,i.useRef)(),ge=(0,i.useRef)(null),Ee=(0,i.useRef)(null),$t=(0,i.useRef)(),xe=(0,i.useRef)(),zt=(0,i.useRef)(null),Ut=(0,i.useRef)(!1),Et=(0,i.useRef)(!1),Qe=(0,i.useCallback)(()=>{Et.current=!1},[]),je=(0,i.useCallback)(()=>{Et.current=!0},[]),Ht=(0,i.useCallback)(s=>{s?.type===e.ELEMENT_TYPES.SOCIAL&&je()},[je]),[xs,js]=(0,i.useState)(!1),[Is,As]=(0,i.useState)(!1),[pi]=e.useEditMeMutation(),[Q,ae]=(0,i.useState)(!1),[Ms,Ze]=(0,i.useState)(0),[Os,St]=(0,i.useState)(!1),Ns=(0,i.useCallback)(()=>St(!1),[]),Rs=(0,i.useCallback)(()=>{St(!1),We()},[We]),[Ds,Ft]=(0,i.useState)(!1),Ws=l.configSwither?localStorage.getItem("configSwither")==="pro"?!0:localStorage.getItem("configSwither")==="editor"?!1:l.mode==="pro":!1,yt=(0,i.useCallback)(()=>{clearTimeout(zt.current);const s=".blocks-search__result-holder";_.querySelector(s)&&($e||ze||Pe)&&(_.querySelector(s).style.removeProperty("transition"),_.querySelector(s).style.opacity=0,zt.current=setTimeout(()=>{e.measureBlockPreviews(_,207/660),_.querySelector(s)&&(_.querySelector(s).style.transition="opacity 0.2s",_.querySelectorAll(s).forEach(n=>n.style.opacity=1))},200))},[ze,$e,Pe]),kt=(0,i.useRef)(void 0),Vt=(0,i.useCallback)(s=>{const n=s.target;n&&(window.clearTimeout(kt.current),kt.current=window.setTimeout(()=>{js(!!n.closest(".desktop_view")),As(!!n.closest(".mobile_view"))},100))},[]);(0,i.useEffect)(()=>()=>{window.clearTimeout(kt.current)},[]),(0,i.useEffect)(()=>{const s=e.addDocumentListenerFromShadow(_,"mouseover",Vt);return()=>{s.dispose()}},[_,Vt]),(0,i.useEffect)(()=>{typeof W=="function"&&(he.length>0?W(!0):W(!1))},[he]);const[Gt]=e.useSendMessageMutation(),{data:R={},refetch:le,status:Ie}=e.useGetDialogQuery({entity_id:v},{skip:!v||l.aiAssistentEnabled===!1||C}),Bs=e.useEventEmitter(be.events.AI_TEXT_REQUEST_ID).hasListeners(),$s=e.useIsStandalone(),Se=!Bs&&!$s,zs=(0,i.useMemo)(()=>Se?[{data:{role:"assistant",message:d("Typing..."),isLoading:!0}}]:[],[Se,d]),[Yt,bt]=(0,i.useState)([]),[vt,Je]=(0,i.useState)(l.defaultBuildPanel!==""?e.BLOCKS:e.ATOMS),Tt=(0,i.useRef)(null),Kt=(0,i.useMemo)(()=>x?.getInstance(e.CANVAS_VIEWPORT_ID),[x]),et=(0,i.useCallback)(()=>{const s=e.canvasPreviewMetrics(ge.current,K);Kt?.set({iframeOffsetTop:m&&E!=="bottom"?0:30,scrollTop:s.scrollTop+30,innerHeight:window.innerHeight/s.scale,previewHeight:s.previewHeight,mode:m&&E!=="bottom"?ms:"default"})},[E,m,K,Kt]),Xt=f&&c,wt=(0,i.useCallback)(s=>{const n=window.navigator.platform.match("Mac");l.codeEnabled&&l.codeSideEnabled&&s.altKey&&s.keyCode===88&&(A.toggle(),j.isLocked&&(ae(!0),Ze(e.FEATURE_UPSELL_SLIDE.code_editor))),((n?s.metaKey:s.ctrlKey)&&s.shiftKey&&s.keyCode===76||(n?s.metaKey:s.ctrlKey)&&s.shiftKey&&s.keyCode===69||(n?s.metaKey:s.ctrlKey)&&s.shiftKey&&s.keyCode===82)&&s.preventDefault()},[l.codeEnabled,j.isLocked,l.codeSideEnabled,A]),qt=me.includes("UPLOAD_IMAGE_")||me.includes("UPLOAD_BACKGROUND_"),Pt=(0,i.useRef)(!1),Qt=(0,i.useCallback)(s=>{const n=s.target,a=n.closest(".email-pane__content-col")||n.closest(".email-pane__collapse-wrapper")||n.closest(".selected-element-panel-content")||n.closest(".selected-element-panel")||n.closest(".em-analytics__email-tab-properties")||n.closest(".em-analytics__email-tab-styles")||n.closest(".em-analytics__email-tab-history")||n.closest(".blocks-modal-container")||n.closest(".email-pane__sizes")||n.closest(".email-preview-menu")||n.closest(".monaco-editor")||n.closest(".ant-modal-wrap");Pt.current=!!a},[]),Zt=(0,i.useCallback)(s=>{const n=Pt.current,a=window.getSelection().toString().length>0||document.activeElement&&document.activeElement.tagName==="INPUT"&&document.activeElement.selectionStart!==document.activeElement.selectionEnd;Pt.current=!1,!(n||a)&&(!document.querySelector(".easylogic-colorpicker")&&!_.querySelector(".easylogic-colorpicker")&&!s.target.closest(".email-pane__content-col")&&!s.target.closest(".blocks-modal-container")&&!s.target.closest(".email-pane__collapse-wrapper")&&!s.target.closest(".selected-element-panel__columns-settings__controls__column__remove")&&!s.target.closest(".email-preview__content-col_main")&&!s.target.closest(".email-preview-menu")&&!s.target.closest(".monaco-editor")&&!s.target.closest(".main__pane-close-btn")&&!s.target.closest(".main__pane-trigger")&&!s.target.closest(".ant-modal-wrap")&&!s.target.closest(".email-pane__sizes")&&!s.target.closest(".ant-input-clear-icon")&&!s.target.closest(".ant-color-picker")&&!s.target.closest(".control-font-family-dropdown")&&!Tt.current&&!s.target.closest(".email-preview-menu__history")&&!s.target.closest(".selected-element-panel-content")&&!s.target.closest(".ant-select-dropdown")&&!s.target.closest(".ant-picker-dropdown")&&!s.target.closest(".toggle_view")&&!s.target.closest(".upload-bg-image__menu")&&!s.target.closest(".email-pane__paths")&&!s.target.closest(".ant-tabs-extra-content")&&!s.target.closest(".anticon-delete")&&!qt&&me!==e.MODALS.IMAGE_EDITOR_MODAL&&(g==="Properties"&&(je(),r(e.resetToLastActiveSettingsTab()),y.send({operation:e.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),Le([])),g==="History"&&r(e.setActiveSettingsTab(e.BUILD)),r(e.switchIsPanelHistoryCollapsed(!0)),y.send({operation:e.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),setTimeout(()=>{c.type?r(e.setElementSettings({type:null})):r(e.setElementSettings$1({type:null}))},300)),Tt.current=null)},[r,c.type,me,g,y,qt]),[Us,Jt]=(0,i.useState)(!0),{data:Ct=[],refetch:tt}=e.useGetCommentsQuery(v,{skip:!v||C});(0,i.useEffect)(()=>{v&&!C&&tt()},[g,v,C,tt]),(0,i.useEffect)(()=>{v&&!Object.keys(R).length&&Ie==="fulfilled"&&le()},[g,v,le,R,Ie]),(0,i.useEffect)(()=>{const s=new be.Disposable,n=window.localStorage.getItem(e.LOCAL_STORAGE_ITEMS.em_active_tab);if(R?.totalCount===0&&Ie!=="pending"){const h={project_id:b,connection:"chat",entity_id:v,context:"default",locale:G};!n&&Se&&e.runOncePerSession(`${w?"email":"block"}-default-context:${v}`,()=>{e.swallowPromiseRejection(Gt({body:h}).then(()=>{s.isDisposed()||Ie==="fulfilled"&&le()}))})}const a={data:{role:"assistant",message:d("Typing..."),isLoading:!0}};return R?.documents?.length>0?(window.localStorage.removeItem(e.LOCAL_STORAGE_ITEMS.em_active_tab),bt(R?.documents),Se&&R?.documents[R?.documents?.length-1].data?.userInfo&&bt([...R?.documents,a])):n||bt(Se?[a]:[]),()=>s.dispose()},[v,w,G,R?.totalCount,R?.documents,Se,b,le,Gt,Ie]),(0,i.useEffect)(()=>{Xe({}),r(B==="email"?e.setElementSettings$1({}):e.setElementSettings({}))},[r,B]);const es=(0,i.useCallback)(s=>{r(e.setEmailSettings(e.enrichEditorSettings(s)))},[r]),ts=(0,i.useCallback)(s=>{r(e.setBlockSettings(e.enrichEditorSettings(s)))},[r]),Ae=(0,i.useCallback)(s=>{r(B==="email"?e.setElementSettings$1(e.enrichEditorSettings(s)):e.setElementSettings(e.enrichEditorSettings(s)))},[r,B]);(0,i.useEffect)(()=>{const s=$t.current,n=Ee.current;ue(m?n??s:s)},[m,E]);const[Hs,Fs]=(0,i.useState)(null),Vs=(0,i.useCallback)(s=>{l.sidePanelFloating&&(Ee.current=s),Fs(s)},[l.sidePanelFloating]),Me=(0,i.useCallback)(s=>{He(s),s==="search"?Ce(!0):(Ce(!1),pt(s)),setTimeout(yt,50)},[yt]),Gs=(0,i.useCallback)(s=>{const n=s.data.operation,a=s.data,h=s.data.action;if(n==="application_block_inserted"||s.data.operationId==="application_block_inserted"){const u=s.data.operationId?s.data.data:a||{},F=u.type==="project"||u.type==="template"||u.type==="common"?"block":"structure",ke=u.name||u.type||(F==="block"?"block":"structure");p({event:"add",action:"add_element_to_email",element_type:F,element_name:ke,entity_id:c?.id||w||T,project_id:k?.id||b})}if(n===e.EVENT_TYPES.APPLICATION_SCROLL_TO&&setTimeout(()=>{Ee.current?.scrollTo({top:s.data.settings.value,behavior:"smooth"})},100),n===e.EVENT_TYPES.APPLICATION_PREVIEW_ALERT_SHOW&&fe(a.settings.show),n===e.EVENT_TYPES.APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW&&Ge(!0),n===e.EVENT_TYPES.APPLICATION_ACTION&&h==="toggle_editor"&&A.toggle(),n===e.EVENT_TYPES.APPLICATION_EMAIL_SETTINGS_SET){let u=Object.assign({},a.settings);delete u.preheader,Object.values(u).every(F=>!F)?(r(e.setEmailSettingsDisable(!0)),r(e.resetToLastActiveSettingsTab())):es(a.settings),a.settings.noBlocks,r(e.setMobileViewActive(a.settings.responsive)),Jt(u.structuresMedia)}if(n===e.EVENT_TYPES.APPLICATION_BLOCK_SETTINGS_SET&&(Object.values(a.settings).every(u=>!u)?(r(e.setBlockSettingsDisable(!0)),r(e.resetToLastActiveSettingsTab())):(ts(a.settings),Jt(a.settings.structuresMedia))),n===e.EVENT_TYPES.APPLICATION_ELEMENT_SETTINGS_SET){const u=Object.values(e.ELEMENT_TYPES).includes(a.type),F=ht.current,ke=F?.type==="advanced"&&!!F.content,I=a.tab?!0:!u&&!ke,{type:ai,caption:li,settings:ci}=a,ds=JSON.stringify([ai,li,ci]),ri=ds!==qe.current;qe.current=ds,I&&g==="Properties"&&r(e.resetToLastActiveSettingsTab());const ps=g===e.HISTORY,{type:Ot}=a;if(!ps&&(Ot===e.ELEMENT_TYPES.EMPTY_TABLE||Ot===e.ELEMENT_TYPES.EMPTY_TD)?(r(e.setActiveSettingsTab(e.BUILD)),a.type===e.ELEMENT_TYPES.EMPTY_TABLE?(Je(e.BLOCKS),a.tab?Me(a.tab):Me("common")):a.type===e.ELEMENT_TYPES.EMPTY_TD&&Je(e.ATOMS)):!ps&&Ot&&g!=="Properties"?a.type===e.ELEMENT_TYPES.SOCIAL&&Et.current?Qe():(Qe(),r(e.setActiveSettingsTab(e.PROPERTIES))):a.type!==e.ELEMENT_TYPES.SOCIAL&&Qe(),!ri)return;a.type===e.ELEMENT_TYPES.CAROUSEL||a.type===e.ELEMENT_TYPES.ACCORDION||a.type===e.ELEMENT_TYPES.SOCIAL?(Xe(ce=>({settings:{...a.settings,type:I?null:a.type,caption:a.caption,parent:I?null:a.settings.parent},type:I?null:a.type,parent:I?null:a.settings.parent,caption:a.caption,extraTabs:ce.extraTabs})),Ae({})):(Ae({...a.settings,type:I?null:a.type,parent:I?null:a.settings.parent,caption:a.caption}),Xe(ce=>!u&&ce.type==="advanced"&&ce.content?{...ce,settings:{...a.settings,type:a.type,parent:a.settings?.parent,caption:a.caption}}:ce.extraTabs?.length?{extraTabs:ce.extraTabs}:{})),a.settings?.path?.length>0&&Le(a.settings?.path)}n===e.EVENT_TYPES.APPLICATION_ELEMENT_SETTINGS_CLOSE&&(qe.current=null,ht.current?.type===e.ELEMENT_TYPES.SOCIAL&&je(),r(e.resetToLastActiveSettingsTab()))},[r,es,ts,Ae,g,Me,_,p,c,w,T,k,Qe,je,A,b,ht,Xe,fe,Ge]);(0,i.useEffect)(()=>{e.identifyUser({id:J?.id,email:J?.email,username:J?.name})},[J]),(0,i.useEffect)(()=>{},[C,J.email_builder_config,J.id,r,oe,at]),(0,i.useEffect)(()=>{m&&j.isLocked&&A.toggle()},[]);const ss=s=>{setTimeout(()=>{if(C)r(e.changeConfig("pro")),Ft(!0),ae(!0),p({event:"change",action:"change_config_mode",config_mode:"pro",entity_id:c?.id||w||T,project_id:k?.id||b});else{let n=s?"pro":"editor";localStorage.setItem("configSwither",n),r(e.changeConfig(n)),p({event:"change",action:"change_config_mode",config_mode:n,entity_id:c?.id||w||T,project_id:k?.id||b})}},200)},Ys=()=>{m&&A.toggle(),r(e.resetToLastActiveSettingsTab()),r(e.changeConfig("simple")),Ft(!1),ae(!1),p({event:"change",action:"change_config_mode",config_mode:"simple",entity_id:c?.id||w||T,project_id:k?.id||b})},Ks=(0,i.useCallback)(()=>{ae(!1)},[]);e.useListenPostMessage(Gs),e.useImageControlRequestCollector(),(0,i.useEffect)(()=>{const s=y.addListener(n=>{const a=e.readDroppedImage(n,e.EVENT_TYPES.APPLICATION_NATIVE_IMAGE_DROP);if(!a)return;const h=()=>y.send({operation:e.EVENT_TYPES.SANDBOX_NATIVE_IMAGE_DROP_CLEAR});(async()=>{const u=await e.uploadDroppedImage(a,{prepare:I=>e.prepareImageForEditorUpload(I,l),upload:Y});if(u.status!=="uploaded"){const{error:I}=u;U.error({id:"IMAGE_UPLOAD_ERROR",data:a,title:d("Upload failed"),description:I instanceof Error&&I.message?I.message:d("The image could not be uploaded.")}),h();return}y.send({operation:e.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.ELEMENT_TYPES.IMG,settings:{src:u.url}});const F=oe.getState(),ke=B==="email"?e.selectElementSettings$1(F):e.selectElementSettings(F);ke?.type===e.ELEMENT_TYPES.IMG&&Ae({...ke,src:u.url,changeKey:"src"})})()});return()=>s.dispose()},[d,y,Y,l,U,Ae,oe,B]),(0,i.useEffect)(()=>{const s=y.addListener("application_atom_inserted",a=>{p({event:"add",action:"add_element_to_email",element_type:"atom",element_name:a||"atom",entity_id:c?.id||w||T,project_id:k?.id||b})}),n=y.addListener("application_block_inserted",a=>{const h=a?.type==="project"||a?.type==="template"||a?.type==="common"?"block":"structure",u=a?.name||a?.type||(h==="block"?"block":"structure");p({event:"add",action:"add_element_to_email",element_type:h,element_name:u,entity_id:c?.id||w||T,project_id:k?.id||b})});return()=>{s?.dispose(),n?.dispose()}},[y,p,c?.id,w,T,b,k?.id]);const Xs=s=>{let n=_.querySelector(".atoms__list");l.toggleSidePanel&&s===g?r(e.setActiveSettingsTab(e.DISABLED_TAB)):s==="Optimize"?e.comingSoonHandler(d,nt):s!=="Properties"&&s!=="History"?(r(e.setActiveSettingsTab(s)),p({event:"navigate",action:"navigate_email_pane_tab",tab_name:s==="Disabled_tab"?"DISABLED_TAB":s,entity_id:c?.id||w||T,project_id:k?.id||b}),y.send({operation:e.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),y.send({operation:e.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),Le([])):(s==="Properties"||s==="History")&&p({event:"navigate",action:"navigate_email_pane_tab",tab_name:s,entity_id:c?.id||w||T,project_id:k?.id||b}),S.isLocked&&s==="Discuss"&&(ae(!0),Ze(e.FEATURE_UPSELL_SLIDE.discussion)),C&&s==="Optimise"&&(ae(!0),Ze(6)),q.isLocked&&s==="AiChat"&&(q.state.state==="locked_by_limit"&&q.exceeded?St(!0):(ae(!0),Ze(9)))},st=(0,i.useRef)(null),Oe=(0,i.useRef)(void 0),H=(0,i.useCallback)(()=>{const s=Ee.current?.getBoundingClientRect();if(st?.current?.getBoundingClientRect().top>=0&&s){const n=e.unscaledHeight(Math.round(s.height-30),st.current);st.current.style.height=`${n}px`,pe(n-30)}Oe.current===void 0&&(Oe.current=window.requestAnimationFrame(()=>{Oe.current=void 0,et()}))},[et,pe]);(0,i.useEffect)(()=>()=>{Oe.current!==void 0&&window.cancelAnimationFrame(Oe.current)},[]),(0,i.useEffect)(()=>(g==="AiChat"&&!C?ft.current=setInterval(()=>{le({entity_id:v})},5e3):clearInterval(ft.current),clearInterval(ft.current)),[v,C,le,g]);const qs=s=>Je(s||""),Qs=()=>{Ce(!1),He(Fe)},Lt=()=>{let s=_.querySelector(".block-search__preview");s&&(s.style.opacity="0",s.style.transform="translateX(-99%)",setTimeout(function(){s.remove()},300))};let ye=[];const Ne={display:"flex",alignItems:"center",justifyContent:"center"};l.blocksEmptyEnabled&&ye.push({label:(0,t.jsx)(o.ui_kit$Tooltip,{placement:"top",title:d("Empty blocks"),children:(0,t.jsx)("div",{style:Ne,children:(0,t.jsx)(e.EmIcons,{icon:"BorderOuterOutlined",component:o.icons$BorderOuterOutlined,style:{fontSize:18}})})}),value:"empty"}),l.blocksSavedEnabled&&ye.push({label:(0,t.jsx)(o.ui_kit$Tooltip,{placement:"top",title:d("Saved blocks"),children:(0,t.jsx)("div",{style:Ne,children:(0,t.jsx)(e.EmIcons,{icon:"AppstoreAddOutlined",component:o.icons$AppstoreAddOutlined,style:{fontSize:18}})})}),value:"project"}),l.blocksCommonEnabled&&ye.push({label:(0,t.jsx)(o.ui_kit$Tooltip,{placement:"top",title:d("Common blocks"),children:(0,t.jsx)("div",{style:Ne,children:(0,t.jsx)(e.EmIcons,{icon:"AppstoreOutlined",component:o.icons$AppstoreOutlined,style:{fontSize:18}})})}),value:"common"}),l.blocksTemplateEnabled&&ye.push({label:(0,t.jsx)(o.ui_kit$Tooltip,{placement:"top",title:d("Template blocks"),children:(0,t.jsx)("div",{style:Ne,children:(0,t.jsx)(e.EmIcons,{icon:"BuildOutlined",component:o.icons$BuildOutlined,style:{fontSize:18}})})}),value:"template"}),l.blocksSearchEnabled&&ye.push({label:(0,t.jsx)(o.ui_kit$Tooltip,{placement:"top",title:d("Blocks search"),children:(0,t.jsx)("div",{style:Ne,children:(0,t.jsx)(e.EmIcons,{icon:"SearchOutlined",component:o.icons$SearchOutlined,style:{fontSize:18}})})}),value:"search"});const it=_e!=="empty"||X,Zs=!l.blocksSectionsShow||it?"100%":"calc(100% - 44px)";let Js=[{label:(0,t.jsx)("div",{className:"email-pane__tab",children:d("Elements")}),key:e.ATOMS,className:"email-pane__collapse-panel email-pane__atoms",children:(0,t.jsx)(bs,{})},{label:(0,t.jsx)("div",{className:"email-pane__tab",children:d("Blocks")}),key:e.BLOCKS,className:"email-pane__collapse-panel email-pane__blocks-search",style:{height:Zs},children:(0,t.jsxs)("div",{className:(0,D.default)("email-pane__blocks-panel",{"email-pane__blocks-panel_scrollable":it}),children:[l.blocksSectionsShow&&(0,t.jsxs)("div",{className:"email-pane__blocks-panel-header",children:[(0,t.jsxs)(o.ui_kit$Space.Compact,{block:!0,children:[!X&&(0,t.jsx)(o.ui_kit$Segmented,{block:!0,style:{width:"100%",marginTop:24},onChange:Me,value:_e,options:ye}),X&&(0,t.jsx)("div",{style:{width:"100%",height:36}}),X&&(0,t.jsx)("div",{style:{width:36,textAlign:"right",marginTop:22},children:(0,t.jsx)(e.EmIcons,{icon:"CloseOutlined",component:o.icons$CloseOutlined,style:{padding:"0 2px 0",cursor:"pointer"},onClick:Qs})})]}),(0,t.jsx)("div",{className:"blocks-search__divider-wrapper",style:{marginTop:X?28:12},children:(0,t.jsx)(o.ui_kit$Divider,{className:"blocks-search__divider"})})]}),(0,t.jsxs)("div",{className:"email-pane__blocks-panel-body",children:[(0,t.jsx)("div",{className:"blocks-search__empty-shadow",style:{display:_e==="empty"&&!X?"block":"none"},children:Us?(0,t.jsx)(e.StructuresMedia,{}):(0,t.jsx)(e.Structures,{})}),(0,t.jsx)("div",{className:(0,D.default)("email-pane__blocks-panel-results",{"email-pane__blocks-panel-results_visible":it}),children:(0,t.jsx)(Ss,{parentEmailId:c?.parent_email,blocksTab:_e,search:X,reloadBlockScreens:yt,setIsShowAddAllBlocksModal:De})})]})]})}];const Re=[{disabled:Q,key:e.PROPERTIES,style:{height:"var(--em-pane-block-height)"},className:"em-analytics__email-tab-properties",children:(0,t.jsx)(e.PropertiesTabContent,{isShowMobileSettings:O,propertiesPanelKey:Ue,onMouseLeave:Lt,email:c,onClosePanel:Ht})},{disabled:Q,key:e.HISTORY,style:{height:"var(--em-pane-block-height)"},className:"em-analytics__email-tab-history",children:Xt&&(0,t.jsx)("div",{className:"email-pane__collapse-wrapper",onMouseLeave:Lt,children:(0,t.jsx)(Ts,{setCollapsedHistory:()=>r(e.switchIsPanelHistoryCollapsed(!0)),emailElement:Xt})})},{key:e.DISABLED_TAB,className:"em-analytics__email-tab-properties"},{disabled:Q,label:(0,t.jsx)(o.ui_kit$Tooltip,{placement:"left",title:V("Build","tab"),children:(0,t.jsx)(e.EmIcons,{"data-testid":"contentIcon",icon:"PlusCircleOutlined",component:o.icons$PlusCircleOutlined,size:24,strokeWidth:l.iconStrokeWidth})}),key:e.BUILD,className:"em-analytics__email-tab-build",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,t.jsx)("div",{className:(0,D.default)("email-pane__collapse-wrapper",{"email-pane__collapse-wrapper_no-topleft-radius":g==="Build"||!g,"email-pane__collapse-wrapper_build":vt==="Blocks"&&it}),onMouseLeave:Lt,children:(0,t.jsx)(o.ui_kit$Tabs,{className:(0,D.default)("secondary-tabs email-pane__collapse",{"secondary-tabs_unset_scroll":vt===e.BLOCKS}),size:"large",activeKey:vt,onChange:qs,items:Js})})},{disabled:Q,label:(0,t.jsx)(o.ui_kit$Tooltip,{placement:"left",title:V("Styles","tab"),children:(0,t.jsx)(e.EmIcons,{"data-testid":"stylesIcon",icon:"Styles",component:o.icons$Styles,size:24,strokeWidth:l.iconStrokeWidth})}),key:e.STYLES,className:"em-analytics__email-tab-styles",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,t.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,t.jsx)(gs,{email:c})})}];l.commentsEnabled&&Re.push({disabled:Q,label:(0,t.jsxs)(o.ui_kit$Tooltip,{placement:"left",title:V("Discuss","tab"),children:[(0,t.jsx)(e.EmIcons,{"data-testid":"commentsIcon",icon:"CommentOutlined",component:o.icons$CommentOutlined,size:24,strokeWidth:l.iconStrokeWidth}),S.isLocked&&(0,t.jsx)(e.EmIcons,{icon:"Lock",component:o.icons$Lock,size:14,strokeWidth:l.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),!!Ct.length&&(0,t.jsx)("span",{className:"email-pane__comment-counter",children:Ct.filter(s=>s.comment_status!=="deleted").length})]}),key:"Discuss",className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,t.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,t.jsx)(o.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse discuss-wrapper",size:"large",activeKey:"Discuss",items:[{label:(0,t.jsx)(t.Fragment,{children:d("Discuss")}),key:"Discuss",forceRender:!0,className:"email-settings__collapse-panel",children:v?(0,t.jsx)(ws,{email:c,comments:Ct,subjectId:v,isLoggedIn:!0,emailElementType:B}):(0,t.jsx)("div",{className:"aside-content-wrapper",children:c.hasOwnProperty("type")?(0,t.jsx)(o.ui_kit$Alert,{description:d("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):(0,t.jsx)(o.ui_kit$Alert,{description:d("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}})})}]})})});const ei=()=>{dt({entity_id:v}).then(s=>{s.error?U.error({title:s.error.data.code,description:s.error.data.message}):s.data.success&&U.success({title:d("Success"),description:s.data.success}),C||le()})};l.aiAssistentEnabled&&Re.push({disabled:Q,label:(0,t.jsxs)(o.ui_kit$Tooltip,{placement:"left",title:V("AI assistant","tab"),children:[(0,t.jsx)(e.EmIcons,{"data-testid":"aiAssistentIcon",icon:"AI",component:o.icons$AI,size:24,strokeWidth:l.iconStrokeWidth}),q.isLocked&&(0,t.jsx)(e.EmIcons,{icon:"Lock",component:o.icons$Lock,size:14,strokeWidth:l.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),R?.totalCount>0&&v&&(0,t.jsx)("span",{className:"email-pane__comment-counter",children:R?.totalCount})]}),key:"AiChat",className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,t.jsx)(o.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse discuss-ai-wrapper",size:"large",activeKey:"AiChat",tabBarExtraContent:(0,t.jsx)(o.ui_kit$Tooltip,{placement:"top",title:d("Clear chat"),children:(0,t.jsx)(o.ui_kit$Popconfirm,{description:d("Clear chat history?"),onConfirm:ei,okText:d("Yes"),cancelText:d("No"),icon:"",placement:"leftTop",title:!1,children:(0,t.jsx)(o.ui_kit$Button,{type:"text",icon:(0,t.jsx)(e.EmIcons,{icon:"ClearChat",component:o.icons$ClearChat,style:{fontSize:16}}),style:{marginRight:16}})})}),items:[{label:(0,t.jsx)(t.Fragment,{children:d("AI assistant")}),key:"AiChat",forceRender:!0,className:"email-settings__collapse-panel",children:v||window.localStorage.getItem(e.LOCAL_STORAGE_ITEMS.em_active_tab)?(0,t.jsx)(fs,{messages:Yt.length>0?Yt:zs,newEmailAiGeneratorRef:Ut}):(0,t.jsx)("div",{className:"aside-content-wrapper",children:c.hasOwnProperty("type")?(0,t.jsx)(o.ui_kit$Alert,{description:d("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):(0,t.jsx)(o.ui_kit$Alert,{description:d("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}})})}]})})})}),l.optimizeEnabled&&Re.push({disabled:Q,label:(0,t.jsxs)(o.ui_kit$Tooltip,{placement:"left",title:V("Optimize","tab"),children:[(0,t.jsx)(e.EmIcons,{"data-testid":"optimizeIcon",icon:"Speed",component:o.icons$Speed,size:24,strokeWidth:l.iconStrokeWidth}),C&&(0,t.jsx)(e.EmIcons,{icon:"Lock",component:o.icons$Lock,size:14,strokeWidth:l.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"})]}),key:"Optimise",className:"em-analytics__email-tab-optimise",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,t.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,t.jsx)(o.ui_kit$Tabs,{className:"secondary-tabs secondary-tabs_optimise email-settings__collapse optimise-wrapper",size:"large",activeKey:"Optimise",items:[{label:(0,t.jsx)(t.Fragment,{children:d("Optimize")}),key:"Optimise",forceRender:!0,className:"email-settings__collapse-panel",children:(0,t.jsx)(Es,{})}]})})}),l.settingsEnabled&&Re.push({disabled:Q,label:(0,t.jsx)(o.ui_kit$Tooltip,{placement:"left",title:V("Settings","tab"),children:(0,t.jsx)(e.EmIcons,{"data-testid":"settingsIcon",icon:"SettingOutlined",component:o.icons$SettingOutlined,size:24,strokeWidth:l.iconStrokeWidth})}),key:"Edit",className:"em-analytics__email-tab-edit",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,t.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,t.jsx)(vs,{email:c})})});const is=g===e.DISCUSS,os=(0,i.useRef)(0),ns=(0,i.useRef)(0),as=(0,i.useRef)(0),ti=(0,i.useCallback)(()=>(_.querySelector(".email-pane__col_preview")?.getBoundingClientRect().width??0)-(l.sidePanelFloating?0:38),[_,l.sidePanelFloating]);(0,i.useEffect)(()=>{v&&!C&&tt()},[v,C,tt]),(0,i.useEffect)(()=>{const s=y.onInit(()=>{y.send({operation:e.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),y.send({operation:e.EVENT_TYPES.SANDBOX_LOCK_DISCUSS,value:is})});return()=>s.dispose()},[is,y]),(0,i.useEffect)(()=>{K&&et()},[K,et]);const xt=(0,i.useCallback)(s=>{const n=s??e.selectEmailWidth(oe.getState());y.send({operation:e.EVENT_TYPES.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:typeof n=="number"?n+2:n}}),gt.current?.resize()},[oe,y]);(0,i.useEffect)(()=>{if(!O&&g!=="Disabled_tab"){const s=_.querySelector(".email-pane__row")?.getBoundingClientRect().width;ge?.current?.getBoundingClientRect().width+540>s&&r(e.setEmailWidth("100%"))}},[r,g,_,O]);const jt=(0,i.useCallback)(()=>{const s=ge.current;s&&(s.style.borderWidth="1px",l.sidePanelFloating||(s.style.marginLeft="-1px",s.style.marginRight="-1px"),s.style.borderLeftColor=null,s.style.borderRightColor=null)},[l.sidePanelFloating]),ls=(0,i.useCallback)(s=>{const n=L.current.widthCodeSplit;ee(!1),L.current.currentSide&&(setTimeout(()=>xt(),50),we(null)),s.target.classList.contains("email-pane__handle")||jt(),window.localStorage.setItem(e.LOCAL_STORAGE_ITEMS.em_code_mode_pane_sizes,JSON.stringify(n))},[xt,L,ee,we,jt]),cs=s=>n=>{n.target.classList.contains("email-pane__handle")&&(n.preventDefault(),os.current=n.target.parentNode.offsetWidth,ns.current=n.pageX,as.current=ti(),we(s),Tt.current=s)},ot=s=>{const n=ge.current,{currentSide:a}=L.current;typeof s=="string"&&(!a||a===s)?(_.querySelector(".email-pane__iframe").style.width="calc(100% + 1px)",s==="right"?(n.style.borderRightColor=ie.colorPrimary,n.style.borderRightWidth="2px"):(n.style.borderLeftColor=ie.colorPrimary,n.style.borderLeftWidth="2px",_.querySelector(".email-pane__iframe").style.marginLeft="-1px")):a||(jt(),_.querySelector(".email-pane__iframe")?.style.removeProperty("width"),_.querySelector(".email-pane__iframe").style.removeProperty("margin-left"))},si=(0,i.useCallback)(()=>{ee(!0)},[ee]),It=(0,i.useCallback)(s=>{const{currentSide:n}=L.current;if(!n)return;const a=(s.pageX-ns.current)*2,h=os.current+(n==="left"?-a:a),u=Math.min(as.current,1200);h>318&&h<u&&(r(e.setEmailWidth(Math.min(h,1200))),gt.current?.resize())},[r,L]),At=(0,i.useCallback)(s=>{if(L.current.isResizing)if(E==="bottom"){const n=xe.current.getBoundingClientRect().height,a=xe.current.getBoundingClientRect().top,h=(s.clientY-a)/n*100;if(h<20||h>80)return;de(h),H()}else{const n=xe.current.getBoundingClientRect().width,a=xe.current.getBoundingClientRect().left,h=(s.clientX-a)/n*100,u=ge.current.getBoundingClientRect().width;if(l.desktopMobileSwitchPanel&&typeof u=="number"&&u<=425&&r(e.setEmailWidth(425)),h<20||h>80)return;de(h)}},[L,de,E,H,r,l.desktopMobileSwitchPanel]);(0,i.useEffect)(()=>{H()},[m,H]);const ii=s=>{s?.stopPropagation?.();const n=N==="light"?e.DARK:e.LIGHT;y.send({operation:e.EVENT_TYPES.SANDBOX_SWITCH_THEME,data:{theme:n}}),P(n)},rs=(s="panel")=>{const n=s==="panel",a=N===e.DARK,h={size:n?18:16,strokeWidth:n?l.iconStrokeWidth:2};return(0,t.jsx)(o.ui_kit$Tooltip,{title:d(a?"Light theme":"Dark theme"),placement:n?"top":"bottom",children:(0,t.jsx)(o.ui_kit$Button,{type:n?a?"primary":"text":"default",icon:a?(0,t.jsx)(e.EmIcons,{icon:"LightMode",component:o.icons$LightMode,...h}):(0,t.jsx)(e.EmIcons,{icon:"DarkMode",component:o.icons$DarkMode,...h}),shape:"circle",size:n?void 0:"small",onClick:ii,className:"toggle_view theme_view email-pane__theme-toggle",style:n?void 0:{left:4,top:4,zIndex:999,padding:0,position:"absolute"}})})},Mt=s=>{const n=typeof s=="number"?Math.min(s,1200):s;r(e.setEmailWidth(n)),setTimeout(()=>xt(n),700);const a=typeof n=="number"?n:n==="100%"?"full":n,h=typeof n=="number"&&n<=425?"mobile":"desktop";p({event:"change",action:"change_email_size",email_id:c?.id||w||T,project_id:k?.id||b,width:a,view_type:h})};(0,i.useEffect)(()=>{const s=new be.Disposable;return s.addDisposable(e.addWindowListenerFromShadow(_,"mousedown",Qt,!0)),s.addDisposable(e.addWindowListenerFromShadow(_,"click",Zt)),s.addDisposable(e.addWindowListenerFromShadow(_,"mouseup",n=>ls(n),!0)),()=>{s.dispose()}},[_,Zt,Qt,ls]),(0,i.useEffect)(()=>{const s=Ee.current;if(!s||typeof ResizeObserver!="function")return;const n=new ResizeObserver(H);return n.observe(s),()=>n.disconnect()},[H,l.sidePanelFloating]),(0,i.useEffect)(()=>(window.addEventListener("scroll",H,!0),window.addEventListener("mousemove",It,!0),window.addEventListener("mousemove",At),window.addEventListener("keydown",wt),()=>{window.removeEventListener("mousemove",It,!0),window.removeEventListener("mousemove",At),window.removeEventListener("scroll",H,!0),window.removeEventListener("keydown",wt)}),[H,It,At,wt]);const oi=s=>{const n=m?"visual":"code",a=!m;if(m?A.toggle():typeof s=="string"?(A.setDirection(s),!m&&A.toggle()):A.toggle(),a){const h=B==="block"?"block":"email",u=typeof s=="string"?s:E||"toggle";p({event:"activate",action:"activate_code_mode",entity_type:h,entity_id:c?.id||w||T,project_id:k?.id||b,code_mode_direction:u})}p({event:"change",action:"change_editor_mode",editor_mode:n,entity_id:c?.id||w||T,project_id:k?.id||b}),r(e.resetToLastActiveSettingsTab()),setTimeout(()=>{r(B==="block"?e.setElementSettings({type:null}):e.setElementSettings$1({type:null}))},300),y.send({operation:e.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),r(e.resetPanes())};(0,i.useEffect)(()=>{l.emailPaneDesktopSize&&r(e.setEmailWidth(l.emailPaneDesktopSize))},[r,l.emailPaneDesktopSize]);const ni=()=>{Je(e.BLOCKS),Me("project")};return(0,i.useEffect)(()=>{Te&&ni()},[Te]),(0,t.jsx)(e.ElementEntityKindProvider,{kind:B,children:(0,t.jsxs)(e.PaneShell,{className:(0,D.default)("email-pane",{"email-pane_code-mode":m,"email-pane_only_code_mode_mobile":l.onlyCodeModeInMobile,"email-pane_code-mode-bottom":m&&E==="bottom","email-pane_no-element-navigation":!l.switchDesktopMobilePropsEnabled&&!l.stepToOtherElementEnabled&&!l.deleteButtonEnabled,"email-pane_is-mobile":O,"email-pane_path-enabled":l.pathEnabled}),sidePanelFloating:!!l.sidePanelFloating,isCodeMode:!!m,codeModeDirection:String(E),children:[(0,t.jsxs)(_s,{className:"email-pane__container",ref:$t,children:[(0,t.jsx)(e.SelectedElementPanelInCodeMode,{isCodeMode:m,codeModeDirection:E}),(0,t.jsx)(e.CanvasAlerts,{isShowMobileSettings:O,headless:!!Z,templateNotEmAlertEnabled:!!l.templateNotEmAlertShow}),(0,t.jsxs)(o.ui_kit$Row,{ref:xe,className:(0,D.default)("email-pane__row",{"email-pane__left":m&&E==="right","email-pane__right":m&&E==="left","email-pane__bottom":m&&E==="bottom","email-pane__sizeSwitcher":l.desktopMobileSwitchPanel,"email-pane__reverse":l.menuDirection==="left","email-pane__pinch":!l.sidePanelFloating}),children:[(0,t.jsxs)(e.CanvasColumn,{isCodeMode:m,codeModeDirection:E,sidePanelFloating:l.sidePanelFloating,contentWrapperRef:Vs,children:[(0,t.jsx)("div",{className:"email-pane__iframe-scroll-top",id:"iframe-scroll-top"}),l.desktopMobileSwitchPanel&&(0,t.jsxs)(o.ui_kit$Space,{className:"email-pane__sizes-panel-wrapper",orientation:"vertical",size:10,children:[(0,t.jsxs)(o.ui_kit$Space,{className:"email-pane__sizes-panel",size:0,children:[rs("panel"),(0,t.jsx)(o.ui_kit$Tooltip,{title:d("Desktop view"),placement:"top",open:xs,children:(0,t.jsx)(o.ui_kit$Button,{type:O?"text":"primary",icon:(0,t.jsx)(e.EmIcons,{icon:"DesktopOutlined",component:o.icons$DesktopOutlined,size:18,strokeWidth:l.iconStrokeWidth}),shape:"circle",onClick:()=>Mt(l.emailPaneDesktopSize||1e3),className:"toggle_view desktop_view"})}),(0,t.jsx)(o.ui_kit$Tooltip,{title:d("Mobile view"),placement:"top",open:Is,children:(0,t.jsx)(o.ui_kit$Button,{type:O?"primary":"text",icon:(0,t.jsx)(e.EmIcons,{icon:"MobileOutlined",component:o.icons$MobileOutlined,size:18,strokeWidth:l.iconStrokeWidth}),shape:"circle",onClick:()=>Mt(425),className:"toggle_view mobile_view"})})]}),l.codeSideEnabled&&(0,t.jsx)(o.ui_kit$Tooltip,{title:d("Code mode"),placement:"right",children:(0,t.jsx)(o.ui_kit$Button,{type:m?"primary":"default",icon:(0,t.jsx)(e.EmIcons,{icon:"Code",component:o.icons$Code}),shape:"circle",onClick:()=>oi("right")})})]}),(0,t.jsxs)(o.ui_kit$Row,{className:(0,D.default)("email-pane__col-wrapper",{container:m&&E==="bottom"||!m,"email-pane__col-wrapper_reverse":l.menuDirection==="left","email-pane__col-wrapper_pinch":!l.sidePanelFloating}),style:{flexGrow:1,maxWidth:"unset",paddingTop:l.desktopMobileSwitchPanel&&m&&E!=="bottom"?"60px":""},children:[(0,t.jsxs)(o.ui_kit$Col,{className:"email-pane__col email-pane__col_preview",style:{flexGrow:1,maxWidth:"unset"},ref:l.sidePanelFloating?null:Ee,children:[l.desktopMobileSwitchRule&&(0,t.jsx)(e.WidthRuler,{onSelectWidth:Mt,themeToggle:rs("rule")}),(0,t.jsxs)(e.ResizableArea,{maxPaneWidth:1200,isCodeMode:m,codeModeDirection:E,isShowMobileSettings:O,desktopMobileSwitchPanel:l.desktopMobileSwitchPanel,children:[(0,t.jsx)("div",{className:"email-pane__handle left",onMouseDown:cs("left"),onMouseEnter:()=>ot("left"),onMouseLeave:ot}),(0,t.jsx)("div",{className:"email-pane__handle right",onMouseDown:cs("right"),onMouseEnter:()=>ot("right"),onMouseLeave:ot}),(0,t.jsx)(e.CanvasWrapper,{wrapperRef:ge,children:(0,t.jsx)(ks,{ref:gt,className:"email-pane__iframe",email:c,surface:B,handlerSendPosition:H,clip:Hs})})]})]}),(0,t.jsx)(o.ui_kit$Col,{style:{display:m&&E!=="bottom"||l.disableSideMenu?"none":"initial"},ref:st,onPointerEnter:hs,className:(0,D.default)("email-pane__content-col email-pane__content-col_menu email-pane__content-col_tabs email-pane__col email-pane__col_settings",{"email-pane__col_disabled":g===e.DISABLED_TAB}),children:(!m||E==="bottom")&&re&&(0,t.jsx)(o.ui_kit$Tabs,{className:(0,D.default)("email-pane__col_settings-inner",{"email-pane__col_settings-inner_reverse":l.menuDirection==="left"}),size:"medium",activeKey:g,onTabClick:Xs,renderTabBar:us,tabPlacement:"right",items:Re,tabBarExtraContent:Ls&&(0,t.jsx)("div",{style:{paddingTop:15,textAlign:"center"},children:C?(0,t.jsx)(o.ui_kit$Switch,{variant:"editorMode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:ss,checked:Ds}):(0,t.jsx)(o.ui_kit$Switch,{variant:"editorMode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:ss,defaultChecked:Ws})})})})]}),(0,t.jsx)("div",{className:"email-pane__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]}),(0,t.jsxs)(e.CodeColumn,{isCodeMode:m,codeModeDirection:E,children:[(0,t.jsx)("div",{className:"email-pane__code-divider",onMouseDown:si}),(0,t.jsx)("div",{className:"code-mode__pane code-mode__pane_editor email-pane__pane email-pane__pane_editor",children:(0,t.jsx)("div",{className:"code-mode__pane-content email-pane__pane-content",children:ct&&re&&(0,t.jsx)(ys,{email:c,setOtherUsers:Ve,readOnly:Be,newEmailAiGeneratorRef:Ut})})})]})]}),l.pathEnabled&&(0,t.jsxs)("div",{className:"email-pane__paths",children:[(0,t.jsx)(e.ElementPath,{elementPath:mt}),(0,t.jsx)(e.EmailCodeSizeBadge,{fallbackHtml:c?.html})]}),(0,t.jsx)("div",{className:"collaborator-list",children:(0,t.jsx)(e.CollaboratorList,{users:he,isEditor:!1,isPlugin:!0,token:ie})})]}),(0,t.jsx)(e.HiddenImageProperties,{isCodeMode:m,codeModeDirection:E,email:c,onClosePanel:Ht}),(0,t.jsx)(e.FileManagerLazy,{}),(0,t.jsx)(e.PlanUpgradePrompt,{open:Q,onCancel:Ys,onTrialActivated:Ks,initialSlide:Ms}),Ke&&q.exceeded?(0,t.jsx)(i.Suspense,{fallback:null,children:(0,t.jsx)(e.LimitUpgradeModalLazy,{open:Os,onClose:Ns,title:d(Ke.titleKey),subtitle:d(Ke.subtitleKey),usageResource:Ke.usageResource,previousDisplay:e.presetLimitDisplay(q.exceeded.previousLimit),nextDisplay:e.presetLimitDisplay(q.exceeded.nextLimit),onChangePlan:Rs})}):null,(0,t.jsx)(e.BrowserExtensionWarningModal,{open:ut,onClose:_t}),(0,t.jsx)(e.BrowserTranslateWarningModal,{open:ne,onClose:Ye})]})})};Dt.propTypes={};var Ps=c=>(0,t.jsx)(e.SelectionProvider,{children:(0,t.jsx)(e.GeometryProvider,{children:(0,t.jsx)(e.CanvasAlertsProvider,{children:(0,t.jsx)(Dt,{...c})})})}),Cs=(0,i.memo)(Ps),Wt=e.getLimitUpgradePresetDefinition("preview_exceeded"),Bt=({emailElement:c,isCollaborationEditor:$})=>{const{__:f}=e.useI18n(),W=e.useDispatch(),ve=e.useCodeModeActions(),Te=e.useOpenPlanCatalog(),De=e.useSendPostMessage(),{blockId:z}=e.useRouteParams(),d=e.useRouteEmailId(),V=e.useSelector(e.selectActiveModal$1)===e.MODALS.SEND_TEST_EMAIL,y=e.useMountOnFirstOpen(V),[T,b]=(0,i.useState)(!1),[w,r]=e.useSendLivePreviewMutation();e.useCurrentUser();const A=e.useDocumentHistoryReader(),We=e.useProjectPlanLimitPreflight(),{owner:nt}=e.useMyRoles(),l=e.useUserUndo(),Be=e.useDocumentUndoState(),at=e.useContentReader(),Z=e.useSelector(e.selectIsPanelHistoryCollapsed),x=e.useSelector(e.selectIsCodeMode),re=e.useSelector(e.selectCodeModeDirection),{token:ie}=(0,o.ui_kit$useToken)(),U=e.useNotification(),p=e.useAppConfig(),k=e.useEditorLocked(),M=c.hasOwnProperty("type")?e.BLOCK:e.EMAIL,lt=e.useEventEmitter(be.events.ON_SHARE_ID),g=e.useEventEmitter(be.events.ON_SHOW_PREVIEW_ID),[J,G]=(0,i.useState)(!1),[oe,L]=(0,i.useState)(0),[de,ee]=(0,i.useState)(!1),we=e.useMountOnFirstOpen(de),[pe,me]=(0,i.useState)(Wt),[m,E]=(0,i.useState)(f("—")),ct=(0,i.useCallback)(()=>{ee(!1),Te()},[Te]),[rt,$e]=(0,i.useState)(!1),ze=e.useProjectData(),Pe=e.usePlanFeatureGate("version_history"),Ue=e.usePlanFeatureGate("code_editor"),dt=e.usePlanFeatureGate("preview_service"),Y=e.usePlanFeatureGate("undo_redo"),O=e.isEditorLockedByPlan(ze,{isPlugin:!0}),N=e.usePushToDataLayer(),P=c?.project,K=S=>{const j=M==="block"?"block":"email";typeof S=="string"?(ve.setDirection(S),!x&&ve.toggle()):ve.toggle(),N({event:"activate",action:"activate_code_mode",entity_type:j,entity_id:c?.id||d||z,project_id:c?.project||P}),setTimeout(()=>{W(M==="block"?e.setElementSettings({type:null}):e.setElementSettings$1({type:null}))},300),De({operation:e.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),Ue.isLocked&&(G(!0),L(e.FEATURE_UPSELL_SLIDE.code_editor))},ue=(0,i.useCallback)(async S=>!0,[We]),_e=(0,i.useCallback)(()=>ee(!1),[]),He=async()=>{if(O){G(!0),L(8);return}await ue("test_sends")&&(W(e.openModal$1(e.MODALS.SEND_TEST_EMAIL)),N({event:"open",action:"open_test_email_modal",entity_type:M==="block"?"block":"email",entity_id:c?.id||d||z,project_id:c?.project||P}))},Fe=()=>{G(!0),L(e.FEATURE_UPSELL_SLIDE.undo_redo)},pt=()=>{l.undo()},X=()=>{l.redo()},Ce=async()=>{const S=(await lt.fire({project:P,id:d})).find(j=>j===!1||typeof j=="string");S!==!1&&navigator.clipboard.writeText(S||e.buildEmailRawShareUrl(d,P)).then(()=>{U.success(f("A shareable link to this page has been copied to the clipboard.")),N({event:"click",action:"share_email",entity_type:M==="block"?"block":"email",entity_id:c?.id||d||z,project_id:c?.project||P})})},mt=async()=>{if(!T){if(!await ue("preview"))return;const S={email:d,subject:encodeURIComponent("#"+c.project+" "+c.title).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A"),content:encodeURIComponent(at()).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A")};w(S),b(!0),N({event:"click",action:"open_email_inbox_tests",entity_type:M==="block"?"block":"email",entity_id:c?.id||d||z,project_id:c?.project||P})}},Le=(0,i.useCallback)(async()=>{await ue("preview")&&(me(Wt),E(f("—")),ee(!0))},[f,ue]);(0,i.useEffect)(()=>{r.isError&&(U.error(r),b(!1))},[r]),(0,i.useEffect)(()=>{if(r.isSuccess&&T){if(r.data?.status===401)U.error({title:r.data.code,description:r.data.message});else if(r.data){let S=document.createElement("A");S.setAttribute("target","_blank"),S.setAttribute("href",r.data.message),S.click()}b(!1)}},[r,T,U]);const[he,Ve]=(0,i.useState)(!1),fe=()=>{De({operation:e.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:Z}),W(e.switchIsPanelHistoryCollapsed(!Z))},Ge=()=>A(c?.id),ut=()=>{Z?(Ve(!0),Ge().then(S=>{S.isSuccess?S.data.data.length:S.isError&&U.error(S),fe(),W(e.setActiveSettingsTab(e.HISTORY)),Ve(!1),N({event:"open",action:"open_version_control",entity_type:M==="block"?"block":"email",entity_id:c?.id||d||z,project_id:c?.project||P}),Pe.isLocked&&(G(!0),L(e.FEATURE_UPSELL_SLIDE.version_history))})):(W(e.resetToLastActiveSettingsTab()),fe())},_t=()=>{Z||(fe(),W(e.resetToLastActiveSettingsTab())),x&&ve.toggle(),G(!1)};let ne=[];const Ye=(0,i.useCallback)(async()=>{const S=await g.fire({project:P,id:d});S.find(j=>j===!1||typeof j=="string")!==!1&&(window.open(S.find(j=>j)||e.buildEmailRawSharePath(d,P)),N({event:"click",action:"open_email_preview",entity_type:M==="block"?"block":"email",entity_id:c?.id||d||z,project_id:c?.project||P}))},[g,P,d,N,M,c,z]),_=(0,i.useCallback)(async()=>{window.open(e.buildGetElementPreviewPath(e.EMAIL,d,P)),N({event:"click",action:"open_web_version",entity_type:M==="block"?"block":"email",entity_id:c?.id||d||z,project_id:c?.project||P})},[P,d,N,M,c,z]);p.previewModeEnabled&&ne.push({key:"Preview_mode",icon:(0,t.jsx)(e.EmIcons,{icon:"EyeOutlined",component:o.icons$EyeOutlined,size:18,strokeWidth:p.iconStrokeWidth}),label:f("Preview mode"),onClick:Ye}),p.livePreviewEnabled&&ne.push({key:"Live_preview",icon:T?(0,t.jsx)(e.EmIcons,{icon:"LoadingOutlined",component:o.icons$LoadingOutlined,style:{fontSize:16}}):(0,t.jsx)(e.EmIcons,{icon:"CheckCircleVerified",component:o.icons$CheckCircleVerified,size:18,strokeWidth:p.iconStrokeWidth}),label:f("Live preview"),onClick:O&&nt?Le:mt}),p.webversionEnabled&&ne.push({key:"Web version",icon:(0,t.jsx)(e.EmIcons,{icon:"Web",component:o.icons$Web,size:18,strokeWidth:p.iconStrokeWidth}),label:f("Web version"),onClick:_}),p.sharePreviewEnabled&&ne.push({key:"Share",icon:(0,t.jsx)(e.EmIcons,{icon:"ShareAltOutlined",component:o.icons$ShareAltOutlined,size:18,strokeWidth:p.iconStrokeWidth}),label:f("Share"),onClick:Ce,className:"em-analytics__email-share"});const C=[{key:"Left_mode",icon:(0,t.jsx)(e.EmIcons,{icon:"PanelLeft",component:o.icons$PanelLeft,size:18,strokeWidth:p.iconStrokeWidth,style:{color:re==="left"&&x?ie.colorPrimary:"inherit"}}),label:f("Left Code panel"),onClick:()=>K("left")},{key:"Right_mode",icon:(0,t.jsx)(e.EmIcons,{icon:"PanelLeft",component:o.icons$PanelLeft,size:18,strokeWidth:p.iconStrokeWidth,style:{transform:"rotate(180deg)",color:re==="right"&&x?ie.colorPrimary:"inherit"}}),label:f("Right Code panel"),onClick:()=>K("right")},{key:"Bottom_mode",icon:(0,t.jsx)(e.EmIcons,{icon:"PanelLeft",component:o.icons$PanelLeft,size:18,strokeWidth:p.iconStrokeWidth,style:{transform:"rotate(-90deg)",color:re==="bottom"&&x?ie.colorPrimary:"inherit"}}),label:f("Bottom Code panel"),onClick:()=>K("bottom")}];return(0,t.jsxs)("div",{className:"email-preview-menu email-preview-menu_new",children:[(0,t.jsxs)(o.ui_kit$Space,{size:32,children:[(0,t.jsxs)(o.ui_kit$Space,{className:"email-preview-menu__versions",size:8,style:{borderRadius:`calc(${e.emCssVar("borderRadius")} * 1px)`},children:[(0,t.jsx)(o.ui_kit$Tooltip,{title:f($?e.COLLABORATION_EDITOR_WARNING_TEXT:k?"Read only":"Undo (Ctrl+Z)"),placement:"bottom",children:(0,t.jsx)(o.ui_kit$Button,{type:"text",icon:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.EmIcons,{icon:"UndoOutlined",component:o.icons$UndoOutlined,size:22,strokeWidth:p.iconStrokeWidth}),Y.isLocked&&(0,t.jsx)(e.EmIcons,{icon:"Lock",component:o.icons$Lock,size:14,strokeWidth:p.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:Y.isLocked?Fe:pt,disabled:k||!Y.isLocked&&!Be.canUndo})}),(0,t.jsx)(o.ui_kit$Tooltip,{title:f($?e.COLLABORATION_EDITOR_WARNING_TEXT:k?"Read only":"Redo (Ctrl+Shift+Z)"),placement:"bottom",children:(0,t.jsx)(o.ui_kit$Button,{type:"text",icon:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.EmIcons,{icon:"RedoOutlined",component:o.icons$RedoOutlined,size:22,strokeWidth:p.iconStrokeWidth}),Y.isLocked&&(0,t.jsx)(e.EmIcons,{icon:"Lock",component:o.icons$Lock,size:14,strokeWidth:p.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:Y.isLocked?Fe:X,disabled:k||!Y.isLocked&&!Be.canRedo})}),p.historyEnabled&&(0,t.jsx)(o.ui_kit$Tooltip,{title:f(k?"Read only":"Version history"),placement:"bottom",children:(0,t.jsx)(o.ui_kit$Button,{type:Z?"text":"primary",ghost:!Z,onClick:ut,disabled:k||!!c.isNew||he,className:"email-preview-menu__history",icon:he?(0,t.jsx)(o.ui_kit$Spin,{size:"small"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.EmIcons,{icon:"HistoryOutlined",component:o.icons$HistoryOutlined,size:22,strokeWidth:p.iconStrokeWidth,className:"email-preview-menu__list-item-icon email-preview-menu__list-item-icon_revert"}),Pe.isLocked&&(0,t.jsx)(e.EmIcons,{icon:"Lock",component:o.icons$Lock,size:14,strokeWidth:p.iconStrokeWidth,className:"free-mode-firewall-icon"})]})})})]}),(0,t.jsxs)(o.ui_kit$Space,{size:8,style:{borderRadius:`calc(${e.emCssVar("borderRadius")} * 1px)`},children:[p.codeEnabled&&(0,t.jsx)(o.ui_kit$Dropdown,{arrow:!0,placement:"bottom",menu:{items:C},trigger:"hover",mouseEnterDelay:0,className:"email-preview-menu__code",children:(0,t.jsx)(o.ui_kit$Button,{type:x?"primary":"text",ghost:x,icon:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.EmIcons,{icon:"Code",component:o.icons$Code,size:22,strokeWidth:p.iconStrokeWidth}),Ue.isLocked&&(0,t.jsx)(e.EmIcons,{icon:"Lock",component:o.icons$Lock,size:14,strokeWidth:p.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:K})},"Code mode"),p.previewIconEnabled&&(dt.isLocked?(0,t.jsx)(o.ui_kit$Tooltip,{title:f("Preview mode"),placement:"bottom",children:(0,t.jsx)(o.ui_kit$Button,{type:"text",icon:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.EmIcons,{icon:"EyeOutlined",component:o.icons$EyeOutlined,size:22,strokeWidth:p.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),(0,t.jsx)(e.EmIcons,{icon:"Lock",component:o.icons$Lock,size:14,strokeWidth:p.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:()=>{G(!0),L(e.FEATURE_UPSELL_SLIDE.preview_service)}})}):(0,t.jsx)(o.ui_kit$Dropdown,{arrow:!0,placement:"bottom",menu:{items:ne},className:"email-preview-menu__preview",children:(0,t.jsx)(o.ui_kit$Button,{type:"text",target:"_blank",rel:"noreferrer",icon:(0,t.jsx)(e.EmIcons,{icon:"EyeOutlined",component:o.icons$EyeOutlined,size:22,strokeWidth:p.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),onClick:p.previewModeEnabled?Ye:void 0})},"Preview")),p.sendTestEnabled&&(0,t.jsx)(o.ui_kit$Tooltip,{title:f("Send a test email"),placement:"bottom",children:(0,t.jsx)(o.ui_kit$Button,{className:"em-analytics__email-open-test email-preview-menu__test",type:"text",icon:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.EmIcons,{icon:"SendOutlined",component:o.icons$SendOutlined,size:22,strokeWidth:p.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),O&&(0,t.jsx)(e.EmIcons,{icon:"Lock",component:o.icons$Lock,size:14,strokeWidth:p.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:He})})]})]}),y&&(0,t.jsx)(i.Suspense,{fallback:null,children:(0,t.jsx)(e.SendTestEmailModalLazy,{isModalVisible:V,email:c})}),(0,t.jsx)(e.EmailConfirmationRequiredModal,{open:rt,onClose:()=>$e(!1)}),(0,t.jsx)(e.PlanUpgradePrompt,{open:J,onCancel:_t,initialSlide:oe}),we&&(0,t.jsx)(i.Suspense,{fallback:null,children:(0,t.jsx)(e.LimitUpgradeModalLazy,{open:de,onClose:_e,title:f(pe.titleKey),subtitle:f(pe.subtitleKey),usageResource:pe.usageResource,previousDisplay:m,nextDisplay:e.presetLimitDisplay("infinity"),onChangePlan:ct})})]})};Bt.propTypes={},Object.defineProperty(Nt,"EmailPane_default",{enumerable:!0,get:function(){return Cs}}),Object.defineProperty(Nt,"EmailPreviewMenu",{enumerable:!0,get:function(){return Bt}})});
|
|
824
|
+
|
|
825
|
+
__emailmaker__.define("static/core/abb243ca.js",["require","exports","module","static/core/422c8b42.js","static/core/c804e4dd.js"],function(P,b,rt){const $=P("./422c8b42.js"),l=P("./c804e4dd.js");var H=/url(?:\((['|"]?))(.*?\.(png|jpg|gif|jpeg|tiff){1})(?:['|"]?\))/gi;function v(t){return t.arrayBuffer().then(e=>{const i=new Uint8Array(e);let n="";for(let r=0;r<i.length;r++)n+=String.fromCharCode(i[r]);return btoa(n)})}function I(t,e=76){if(t=t.replace(/[\r\n\s]/g,""),!t)return t;const i=[];for(let n=0;n<t.length;n+=e)i.push(t.slice(n,n+e));return i.join(`
|
|
826
|
+
`)}function T(t){return t.replaceAll(/[\\\/:*?"<>|]/g,"_")}async function C(t,e,i,n,r,s,c){const a=[];s&&(s.attachments=a);let u="";typeof r=="function"?u=await U(e,i,n,r,s,c):u=(await l.PromiseAllCatched(Object.keys(r).map(async m=>`\r
|
|
827
|
+
--boundary-string\r
|
|
828
|
+
Content-Type: ${m}\r
|
|
829
|
+
\r
|
|
830
|
+
${await U(e,i,n,r[m],s,c)}\r
|
|
831
|
+
\r
|
|
832
|
+
`))).join("")+"----boundary_string--";const g=[`Subject: ${t}`,"X-Unsent: 1","MIME-Version: 1.0"];if(a.length>0){let m=`\r
|
|
833
|
+
--boundary-related\r
|
|
834
|
+
Content-Type: ${typeof r=="function"?"text/html; charset=utf-8":'multipart/alternative; boundary="boundary-string"'}\r
|
|
835
|
+
\r
|
|
836
|
+
${u}\r
|
|
837
|
+
`;for(const o of a)m+=`\r
|
|
838
|
+
--boundary-related\r
|
|
839
|
+
Content-Type: ${o.mimeType}\r
|
|
840
|
+
Content-Transfer-Encoding: base64\r
|
|
841
|
+
Content-ID: <${o.cid}>\r
|
|
842
|
+
\r
|
|
843
|
+
${o.base64}\r
|
|
844
|
+
`;m+=`\r
|
|
845
|
+
--boundary-related--\r
|
|
846
|
+
`,u=m,g.push('Content-Type: multipart/related; boundary="boundary-related"')}else g.push(`Content-Type: ${typeof r=="function"?"text/html; charset=utf-8":'multipart/alternative; boundary="boundary-string"'}`);return`${g.join(`\r
|
|
847
|
+
`)}\r
|
|
848
|
+
\r
|
|
849
|
+
${u}`}function R(t,e=!0){const i=l.decodeFileNameFromPath(t);return e?T(i):i}function W(t){return!(t.length>8||t.length<1||/[^\x00-\x7F]/.test(t)||/[\\\/:*?"<>|&=%]/.test(t)||!/[a-zA-Z]/.test(t)||/^\d+$/.test(t))}function j(t){const e=l.decodeFileNameFromPath(t),i=e.lastIndexOf("."),n=e.slice(i+1);return i===-1||!W(n)?[T(e),""]:[T(e.slice(0,i)),n]}function q(t){return O(t).then(e=>_(e))}async function D(t,e,i,n){t=l.mapper.getEscapedText(t);const r=l.createIFrame(t,i);try{const s=r.document,c=s.querySelectorAll("tbody");for(const a of c)a.replaceWith(...a.childNodes);s.querySelectorAll("em-replace").forEach(a=>{if(a.hasAttribute("text")&&(a.insertAdjacentHTML("beforebegin",a.getAttribute("text")),a.parentNode.removeChild(a)),a.hasAttribute("src")){const u=a.querySelector("img, amp-img");u?(u.setAttribute("src",a.getAttribute("src")),a.replaceWith(u)):a.replaceWith(...a.childNodes)}});try{await e(r,t)}catch{}t=await r.run()}catch(s){throw s}return l.mapper.getUnescapedText(t,!1,n)}function M(t,e,i){try{if(typeof i=="function"){const n=[];return String.prototype.replace.call(t,e,function(){return n.push(i.apply(void 0,arguments)),""}),l.PromiseAllCatched(n).then(function(r){return String.prototype.replace.call(t,e,function(){return r.shift()})})}else return Promise.resolve(String.prototype.replace.call(t,e,i))}catch(n){return Promise.reject(n)}}async function G(t,e,i=new Map,n){const r=o=>{let p=i.get(o);return p||(p=e(o),i.set(o,p)),p instanceof Promise?p:Promise.resolve(p)};function s(o){return M(o,H,async(p,f="",d)=>`url(${f}${await r(d)}${f})`)}async function c(o){const p=o.getAttribute("style");if(p){const f=await s(p);p!==f&&(o.setAttribute("style",f),n&&n())}}const a=t instanceof Document?t:t.ownerDocument;if(!a)return l.PromiseAllCatched([]);const u=t instanceof Document?t.body??t.documentElement??t:t;if(!u)return l.PromiseAllCatched([]);const g=a.createNodeIterator(u,NodeFilter.SHOW_ALL),m=[];for(;;){const o=g.nextNode();if(o===null)break;if(l.isElement(o)){m.push(c(o));const p=o.getAttribute("background");if(p&&m.push(r(p).then(f=>{o.setAttribute("background",f||p),n&&n()})),l.isImageElement(o)||l.isAMPImageElement(o)){const f=o.getAttribute("src"),d=f&&l.mapper.hasDetectedMappings(f,!0,!0)?f:("src"in o?o.src:"")||f;d&&m.push(r(d).then(y=>{y||(y=d),o.setAttribute("src",y),n&&n()}))}if(l.isStyleElement(o)){const f=o.innerHTML;f&&m.push(s(f).then(d=>{d!==f&&(o.innerHTML=d,n&&n())}))}}else if(l.isComment(o)){const p=l.getConditionalComment(o),f=p?.content;f&&m.push(M(f,/<v:fill.*>/gi,async d=>M(await M(d,/src="([^"]*)"/gi,async(y,h)=>`src="${await r(h)||h}"`),/src='([^']*)'/gi,async(y,h)=>`src='${await r(h)||h}'`)).then(d=>{f!==d&&(o.replaceWith(l.parseFromString(`${p.open}${d}${p.close}`)[0]),n&&n())}))}}return l.PromiseAllCatched(m)}async function N(t,e,i=new Map,n){await G(t,e,i,n)}var it=800;function Z(t){const e=new Map;let i=0;for(;i>=0;)if(i=t.indexOf("<!--",i),i>=0){const n=t.indexOf("-->",i);e.set(t.substring(i,n+3),$.generateUUID()),i=n}return e}function X(t){return!!t&&l.mapper.hasDetectedMappings(t,!0,!0)}function F(t,e){const i=t.indexOf("#"),n=i>=0?t.substring(i+1):"";let r=i>=0?t.substring(0,i):t;const s=r.indexOf("?"),c=s>=0?r.substring(s+1):"";r=s>=0?r.substring(0,s):r;const a=new Map(c.split("&").filter(g=>g.indexOf("=")>=0).map(g=>g.split("=")));let u=c;if(e)for(const g of Object.keys(e))e[g]&&!a.has(g)&&(u=u+(u?"&":"")+`${g}=${e[g]}`);return u===c?t:r+(u?`?${u}`:"")+(n?`#${n}`:"")}function z(t){const e=l.mapper.getDetectedMappings(t,!0,!0).slice().sort((s,c)=>c.range.start-s.range.start),i=[],n=[];let r=t;for(const{range:s}of e){const c=t.substring(s.start,s.end),a=`EMMVAR${$.generateUUID().replace(/-/g,"")}EMMVAR`;i.push(a),n.push({token:a,original:c}),r=r.slice(0,s.start)+a+r.slice(s.end)}return{masked:r,tokens:i,restore:s=>n.reduce((c,{token:a,original:u})=>c.split(a).join(u),s)}}function V(t,e,i,n){if(!/^https?:\/\//i.test(e.trimStart()))return;const{masked:r,tokens:s,restore:c}=z(e),a=r.replace(/^https?:\/\//i,""),u=a.search(/[/?#]/),g=u===-1?a:a.slice(0,u);if(!s.some(p=>g.includes(p))&&t.host===document.location.host)return;const m=F(r,i);if(m===r)return;const o=c(m);o!==e&&(t.setAttribute("href",o),n&&n())}function S(t,e,i){const n=t.getAttribute("href");if(X(n)){V(t,n,e,i);return}let r=t.href;if(r=l.toAbsoluteUrl(r),r&&t.protocol.startsWith("http")){const s=Z(r);if(s.forEach((c,a)=>{r=r.replaceAll(a,c)}),t.host!==document.location.host){const c=F(r,e);c!==r&&(r=c,s.forEach((a,u)=>{r=r.replaceAll(a,u)}),t.setAttribute("href",r),i&&i())}}}async function Q(t,e,i,n,r){let[s,c]=e||[800];return typeof s=="number"&&(s=s+"px"),typeof c=="number"&&(c=c+"px"),t=await D(t,async a=>{const u=a.document;await N(u,m=>l.mapper.getEscapedText(m)!==m?m:l.toAbsoluteUrl(m));const g=u.querySelectorAll("a");for(const m of g)S(m,i);if(n)return n(a)},[s,c],r),t}async function U(t,e,i,n,r,s){let[c,a]=e||[800];return typeof c=="number"&&(c=c+"px"),typeof a=="number"&&(a=a+"px"),t=await D(t,async u=>{const g=u.document;if(await N(g,m=>l.mapper.getEscapedText(m)!==m?m:l.toAbsoluteUrl(m)),u.handleRender(async({contentDocument:m,managedNodeController:o})=>{const p=m.querySelectorAll("*");for(const f of p)if(l.isImageElement(f)){const d=await l.getComputedStyleAsync(f);if(d){const y=parseInt(d.height),h=parseInt(d.width);isNaN(y)||f.setAttribute("height",String(y)),!isNaN(h)&&!f.getAttribute("width")&&f.setAttribute("width",String(h))}o.commit()}else if(l.isTableElement(f)){const d=parseInt(getComputedStyle(f).width);!isNaN(d)&&f.parentElement.tagName!=="BODY"&&f.setAttribute("width",String(d)),o.commit()}else f.tagName==="TD"||f.tagName==="A"&&S(f,i,()=>o.commit())}),r?.embedImagesAsBase64&&r.getImageBlob){const m=r.getImageBlob,o=r.attachments||[];u.handleReadHtml(async p=>{const f=new DOMParser().parseFromString(p.html,"text/html"),d=f.body??f.documentElement;if(!d)return;await N(d,async h=>{if(l.mapper.getEscapedText(h)!==h)return h;const w=h.trim();if(!w||/^cid:/i.test(w))return h;if(w.startsWith("data:")){const A=/^data:([^;]+);base64,(.+)$/i.exec(w);if(A){const E=`img-${$.generateUUID()}@emailmaker`;return o.push({cid:E,mimeType:A[1]||"application/octet-stream",base64:I(A[2])}),`cid:${E}`}return h}const x=l.toAbsoluteUrl(h);if(x.startsWith("data:")){const A=/^data:([^;]+);base64,(.+)$/i.exec(x);if(A){const E=`img-${$.generateUUID()}@emailmaker`;return o.push({cid:E,mimeType:A[1]||"application/octet-stream",base64:I(A[2])}),`cid:${E}`}return x}try{const A=await m(x),E=`img-${$.generateUUID()}@emailmaker`,L=await v(A);return o.push({cid:E,mimeType:A.type||"application/octet-stream",base64:I(L)}),`cid:${E}`}catch{return x}});const y=f.documentElement;p.html=y?l.getOuterHtml(y):p.html})}if(n)return n(u)},[c,a],s),t=t.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),t}var Y="images",J=40;function K(){const t=new Date;return`${t.toISOString().slice(2,10).replace(/-/g,"").concat("_",t.toTimeString().slice(0,5).replace(/:/g,""))}_${Array.from({length:8},()=>"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random()*62))).join("")}`}async function k(t,e,i,n=q,r,s){const c=Object.create(null);let[a,u]=e||[800];typeof a=="number"&&(a=a+"px"),typeof u=="number"&&(u=u+"px");const g=new Set,m=await D(t,async o=>{const p=o.document;await N(p,async d=>{l.mapper.getEscapedText(d)===d&&(d=l.toAbsoluteUrl(d));const y=await n(d);let[h,w]=j(d);if(h.length>J&&(h=K()),!w||!await l.getMimeType(w))try{w=await l.getMimeExtension(y.type)??w}catch{}let x=`${h}.${w}`,A=1;for(;g.has(x);)x=`${h}(${++A}).${w}`;g.add(x);const E=`${Y}/${x}`;return c[E]=y,E});const f=p.querySelectorAll("a");for(const d of f)S(d,i);if(r)return r(o)},[a,u],s);return c["index.html"]=new Blob([m],{type:"text/html;charset=utf-8"}),c}function tt(t){return l.createZip(t)}function O(t){const e=new Image;return e.crossOrigin="anonymous",new Promise((i,n)=>{e.onload=()=>i(e),e.onerror=n,e.src=t})}function _(t,e="image/png",i){const n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0),new Promise((r,s)=>n.toBlob(c=>c?r(c):s("blob is null"),e,Number(i)||0))}function et(t,e){do{if(t===e)return!0;t=t.parentNode}while(t);return!1}function B(t){const e=t.ownerDocument?.body;if(e&&et(t,e)){if(l.isElement(t)&&(t.tagName==="IMG"||t.tagName==="SPAN"&&t.classList.contains("preheader")))return"";if(t.nodeName==="#text")return t.textContent}return t.childNodes?[...t.childNodes].map(B).join(""):""}function nt(t){const{document:e}=l.createIFrame(t);try{return B(e).replace(/\u2800/g,"").replace(/(\r\n|\r|\n){2,}/g,`
|
|
850
|
+
`).trim()}catch{return""}}Object.defineProperty(b,"changeHtml",{enumerable:!0,get:function(){return D}}),Object.defineProperty(b,"extractDocumentTextContent",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(b,"getEML",{enumerable:!0,get:function(){return C}}),Object.defineProperty(b,"getFileNameAndExt",{enumerable:!0,get:function(){return j}}),Object.defineProperty(b,"getFileNameWithExt",{enumerable:!0,get:function(){return R}}),Object.defineProperty(b,"getImageByUrl",{enumerable:!0,get:function(){return O}}),Object.defineProperty(b,"htmlFilesToZip",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(b,"htmlToFilesData",{enumerable:!0,get:function(){return k}}),Object.defineProperty(b,"imageToBlob",{enumerable:!0,get:function(){return _}}),Object.defineProperty(b,"prepareHTML",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(b,"replaceImagesInDocument",{enumerable:!0,get:function(){return N}}),Object.defineProperty(b,"sanitizeFileName",{enumerable:!0,get:function(){return T}})});
|
|
851
|
+
|
|
852
|
+
(function(){try{if(typeof document<"u"){var t='html,body{width:100%;height:100%}.blocks-app input::-ms-clear{display:none}.blocks-app input::-ms-reveal{display:none}.blocks-app *,.blocks-app :before,.blocks-app :after{box-sizing:border-box}html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:#0000;font-family:sans-serif;line-height:1.15}.blocks-app [tabindex="-1"]:focus{outline:none}.blocks-app hr{box-sizing:content-box;height:0;overflow:visible}.blocks-app h1,.blocks-app h2,.blocks-app h3,.blocks-app h4,.blocks-app h5,.blocks-app h6{margin-top:0;margin-bottom:.5em;font-weight:500}.blocks-app p{margin-top:0;margin-bottom:1em}.blocks-app abbr[title],.blocks-app abbr[data-original-title]{cursor:help;border-bottom:0;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.blocks-app address{font-style:normal;line-height:inherit;margin-bottom:1em}.blocks-app input[type=text],.blocks-app input[type=password],.blocks-app input[type=number],.blocks-app textarea{-webkit-appearance:none}.blocks-app ol,.blocks-app ul,.blocks-app dl{margin-top:0;margin-bottom:1em}.blocks-app ol ol,.blocks-app ul ul,.blocks-app ol ul,.blocks-app ul ol{margin-bottom:0}.blocks-app dt{font-weight:500}.blocks-app dd{margin-bottom:.5em;margin-left:0}.blocks-app blockquote{margin:0 0 1em}.blocks-app dfn{font-style:italic}.blocks-app b,.blocks-app strong{font-weight:bolder}.blocks-app small{font-size:80%}.blocks-app sub,.blocks-app sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}.blocks-app sub{bottom:-.25em}.blocks-app sup{top:-.5em}.blocks-app pre,.blocks-app code,.blocks-app kbd,.blocks-app samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}.blocks-app pre{margin-top:0;margin-bottom:1em;overflow:auto}.blocks-app figure{margin:0 0 1em}.blocks-app img{vertical-align:middle;border-style:none}.blocks-app a,.blocks-app area,.blocks-app button,.blocks-app [role=button],.blocks-app input:not([type=range]),.blocks-app label,.blocks-app select,.blocks-app summary,.blocks-app textarea{touch-action:manipulation}.blocks-app table{border-collapse:collapse}.blocks-app caption{text-align:left;caption-side:bottom;padding-top:.75em;padding-bottom:.3em}.blocks-app input,.blocks-app button,.blocks-app select,.blocks-app optgroup,.blocks-app textarea{color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;margin:0}.blocks-app button,.blocks-app input{overflow:visible}.blocks-app button,.blocks-app select{text-transform:none}.blocks-app button,html [type=button],.blocks-app [type=reset],.blocks-app [type=submit]{-webkit-appearance:button}.blocks-app button::-moz-focus-inner{border-style:none;padding:0}.blocks-app [type=button]::-moz-focus-inner{border-style:none;padding:0}.blocks-app [type=reset]::-moz-focus-inner{border-style:none;padding:0}.blocks-app [type=submit]::-moz-focus-inner{border-style:none;padding:0}.blocks-app input[type=radio],.blocks-app input[type=checkbox]{box-sizing:border-box;padding:0}.blocks-app input[type=date],.blocks-app input[type=time],.blocks-app input[type=datetime-local],.blocks-app input[type=month]{-webkit-appearance:listbox}.blocks-app textarea{resize:vertical;overflow:auto}.blocks-app fieldset{border:0;min-width:0;margin:0;padding:0}.blocks-app legend{width:100%;max-width:100%;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal;margin-bottom:.5em;padding:0;display:block}.blocks-app progress{vertical-align:baseline}.blocks-app [type=number]::-webkit-inner-spin-button{height:auto}.blocks-app [type=number]::-webkit-outer-spin-button{height:auto}.blocks-app [type=search]{outline-offset:-2px;-webkit-appearance:none}.blocks-app [type=search]::-webkit-search-cancel-button{-webkit-appearance:none}.blocks-app [type=search]::-webkit-search-decoration{-webkit-appearance:none}.blocks-app ::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}.blocks-app output{display:inline-block}.blocks-app summary{display:list-item}.blocks-app template{display:none}.blocks-app [hidden]{display:none!important}.blocks-app .blocks-plugin{zoom:var(--em-appZoom)}.blocks-app .blocks-plugin .ant-layout-sider-children{display:none}.blocks-app *,.blocks-app ul.ai-roles-list *,.blocks-app .ai-response-variant[class*=ai-response] *,.blocks-app ul.buttons-variants [class*=ai-response]{-webkit-user-select:none;user-select:none}.codicon[class*=codicon-]{font:16px/1 codicon!important}.blocks-app .element-card__title,.blocks-app [class*=ai-response],.blocks-app [class*=ai-response] *,.blocks-app .ant-comment-content-detail{-webkit-user-select:text;user-select:text}.blocks-app .code-mode__pane *{-webkit-user-select:auto;user-select:auto}.blocks-app,.blocks-app .ant-app,.blocks-app .ant-app .main,.blocks-app .ant-app .main__pane-content{height:100%}@media (width<=1300px){.blocks-app .ant-app .main{min-width:1270px}}.blocks-app .ant-app [role=button],.blocks-app .ant-app a,.blocks-app .ant-app area,.blocks-app .ant-app button,.blocks-app .ant-app input:not([type=range]),.blocks-app .ant-app label,.blocks-app .ant-app select,.blocks-app .ant-app summary,.blocks-app .ant-app textarea{touch-action:manipulation}.blocks-app .ant-app ::-webkit-scrollbar{width:10px;height:10px}.blocks-app .ant-app ::-webkit-scrollbar-corner{background:0 0}.blocks-app .ant-app ::-webkit-scrollbar-track{background:0 0}.blocks-app .ant-app ::-webkit-scrollbar-thumb{min-height:20px;box-shadow:inset 0 0 0 10px var(--em-colorFillSecondaryDarken);background-clip:content-box;border:3px solid #0000;border-radius:8px;transition:all .2s}.blocks-app .ant-app ::-webkit-scrollbar-thumb:hover{box-shadow:inset 0 0 0 10px var(--em-colorTextDisabled)}.blocks-app .ant-app textarea::-webkit-scrollbar-track{margin:10px}.blocks-app .ant-app .ant-btn.ant-btn-icon-only .free-mode-firewall-icon,.blocks-app .ant-app .email-pane .ant-tabs-tab .free-mode-firewall-icon,.blocks-app .ant-app .free-mode-firewall-icon{background-color:var(--em-colorBgLayout);border-radius:100%;justify-content:center;display:flex;position:absolute;bottom:0;right:0}.blocks-app .ant-app .email-pane .ant-tabs-tab .free-mode-firewall-icon_emailpane{background-color:var(--em-colorBgContainer);bottom:13px;right:13px}.blocks-app .ant-app .ant-table-wrapper .ant-table{border-radius:calc(var(--em-borderRadiusXL) * 1px);overflow:hidden;background:0 0!important}.blocks-app .ant-app .ant-table-wrapper .ant-table .ant-table-thead>tr,.blocks-app .ant-app .ant-table-wrapper .ant-table .ant-table-thead>tr>th,.blocks-app .ant-app .ant-table-wrapper .ant-table .ant-table-thead>tr>td{background:0 0!important}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper,.blocks-app .ant-app .email-pane__content-col .selected-td-form__button:not(.ant-btn-text),.blocks-app .ant-app .email-pane__content-col .ant-btn-default{background:var(--em-colorFillSecondary);border:1px solid #0000!important}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){color:var(--em-colorPrimary);background:var(--em-colorFillSecondary);border-color:#0000}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button{min-height:calc(var(--em-formControlHeight) * 1px);min-width:calc(var(--em-formControlHeight) * 1px);padding:0 8px;line-height:1;position:relative}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button.ant-btn-icon-only .ant-btn-icon{justify-content:center;align-items:center;width:100%;height:100%;display:inline-flex}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button.ant-btn-icon-only .anticon{vertical-align:0;justify-content:center;align-items:center;line-height:1;display:inline-flex}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button.ghost-button:before{content:"";z-index:1;cursor:pointer;background-color:#0000;width:385px;height:50px;position:absolute;top:-9px;left:-338px}.blocks-app .ant-app .email-pane__content-col .ant-btn-default:not(:disabled,.ant-btn-disabled,.email-pane__content-col .selected-td-form__button--active):hover{background:var(--em-colorFillSecondaryDarken);color:inherit;border-color:#0000}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button--active,.blocks-app .ant-app .email-pane__content-col .ant-btn-default.selected-td-form__button--active{background:var(--em-colorPrimaryBg);color:var(--em-colorPrimary);border-color:#0000}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button--active:hover{background:var(--em-colorPrimaryBgHover);color:var(--em-colorPrimaryTextHover)}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper,.blocks-app .ant-app .email-page .ant-btn{min-width:calc(var(--em-formControlHeight) * 1px);height:calc(var(--em-formControlHeight) * 1px);line-height:calc((var(--em-formControlHeight) - 2) * 1px);text-align:center;padding:0 9px}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper{justify-content:center;align-items:center;padding:0 7px;display:flex}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper>span{display:inline-flex}.blocks-app .ant-app .ant-btn.ant-btn-icon-only.project-page__add-folder{margin-top:26px}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked):hover{color:inherit;background:var(--em-colorFillSecondaryDarken)}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper.ant-radio-button-wrapper-checked{background:var(--em-colorPrimaryBg)}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper.ant-radio-button-wrapper-checked:hover{background:var(--em-colorPrimaryBgHover);color:var(--em-colorPrimaryTextHover)}.blocks-app .ant-app .email-pane__content-col .ant-form-item{margin-bottom:calc(var(--em-formItemMarginBottomMD) * 1px)}.blocks-app .ant-app .email-pane__content-col .ant-form-item.form-item-margin-xs{margin-bottom:calc(var(--em-formItemMarginBottomXS) * 1px)}.blocks-app .ant-app .selected-td-form__br-input{margin-bottom:8px!important}.blocks-app .ant-app .addon-text-content{font-size:11px;font-weight:600}.blocks-app .ant-app .addon-text-content--icon{align-items:center;font-size:0;line-height:0;display:inline-flex}.blocks-app .ant-app .ant-btn.ant-btn-lg.project-page__folder_menu{text-align:center;width:32px;height:32px;padding:0;line-height:32px}.blocks-app .ant-app .editor .main__pane{overflow:hidden}.blocks-app .ant-app .element-card_block.ant-card-bordered .ant-card-cover .element-card__img-wrapper{background-color:#0000;background-image:linear-gradient(45deg,#0000001a 25%,#0000 0 75%,#0000001a 0),linear-gradient(45deg,#0000001a 25%,#0000 0 75%,#0000001a 0);background-position:0 0,4px 4px;background-repeat:repeat,repeat;background-size:8px 8px;background-attachment:scroll,scroll;background-origin:padding-box,padding-box;background-clip:border-box,border-box}.blocks-app .ant-app .ant-tabs-tabpane{width:100%}.blocks-app .ant-app .ant-tabs-large>.ant-tabs-nav .ant-tabs-tab{padding:18px 0}.blocks-app .ant-app .ant-tabs-content-holder{position:relative}.blocks-app .ant-app #filerobot-editor ::-webkit-scrollbar-thumb{border:none}.blocks-app .ant-app .email-pane__bottom .code-mode__pane{border-top:1px solid var(--em-colorBorder)}.blocks-app .ant-app .container{width:100%;margin:0 auto;padding:0 65px}@media (width<=1550px){.blocks-app .ant-app .container{gap:10px;padding:0 10px}}.blocks-app .ant-app .projects-page__container .container{padding-top:30px}.blocks-app .ant-app .container.email-pane__col-wrapper_pinch{padding-right:0}.blocks-app .ant-app body,.blocks-app .ant-app .ant-layout{transition:background-color .2s ease-in-out}.blocks-app .ant-app p{margin-top:0}.blocks-app .ant-app .ant-layout-content.container{padding-bottom:40px}.blocks-app .ant-app .ant-table-wrapper{width:100%}.blocks-app .ant-app .ant-table{border-radius:16px;overflow:hidden}.blocks-app .ant-app .verticalColorpicker.ant-color-picker .ant-color-picker-inner-content{width:340px}.blocks-app .ant-app .ant-color-picker .ant-color-picker-inner-content .ant-color-picker-panel .ant-color-picker-select .ant-color-picker-palette{min-height:160px}.blocks-app .ant-app .easylogic-colorpicker{border-radius:8px}.blocks-app .ant-app .easylogic-colorpicker .colorpicker-body .color{border-radius:8px 8px 0 0}.blocks-app .ant-app .ant-page-header-heading-title{max-width:700px;white-space:unset;box-shadow:none;align-items:baseline;padding:0;font-size:18px;line-height:24px}.blocks-app .ant-app .ant-page-header-heading-title.ant-typography-edit-content{overflow:unset;margin-top:0}.blocks-app .ant-app .ant-page-header-heading-title textarea{background:0 0;font-size:16px;font-weight:500;line-height:20px}.blocks-app .ant-app .ant-page-header-heading-preheader:disabled,.blocks-app .ant-app .ant-page-header-heading-title:disabled{cursor:not-allowed;-webkit-user-select:none;user-select:none;pointer-events:none}.blocks-app .ant-app .ant-menu{background:inherit}.blocks-app .ant-app .ant-page-header{background:inherit;margin-bottom:20px;padding:20px 0}@media (width<=1450px){.blocks-app .ant-app .ant-page-header{padding:10px 0}}.blocks-app .ant-app .ant-page-header-heading-left{margin:0;overflow:visible}.blocks-app .ant-app .ant-page-header-heading-extra{margin:0}.blocks-app .ant-app .ant-page-header-heading-sub-title{display:block;overflow:visible}.blocks-app .ant-app .ant-progress-inner{background-color:#fff}.blocks-app .ant-app .dark .ant-progress-inner{background-color:#ffffff14}.blocks-app .ant-app .ant-collapse>.ant-collapse-item>.ant-collapse-header{flex-direction:row-reverse}.blocks-app .ant-app .ant-tabs-tab{justify-content:center}.blocks-app .ant-app .nobr{white-space:nowrap}.blocks-app .ant-app .checkbox-horizontal .ant-row{flex-direction:row-reverse;justify-content:flex-end;align-items:center}.blocks-app .ant-app .checkbox-horizontal .ant-form-item-control{margin-right:10px;flex-grow:0!important;width:auto!important}.blocks-app .ant-app .checkbox-horizontal .ant-form-item-label{padding:0!important}.blocks-app .ant-app .ant-comment .ant-comment-nested{margin-left:24px}.blocks-app .ant-app .ant-comment .ant-comment-avatar{margin-top:-2px;margin-right:8px;position:relative}.blocks-app .ant-app .ant-comment .ant-comment-avatar img{width:24px;height:24px}.blocks-app .ant-app .ant-comment .ant-comment-inner{background:var(--em-colorBgLayout);border-radius:8px;margin-bottom:12px;padding:12px;display:flex}.blocks-app .ant-app img:not([srcset*=\\.],[src*=\\.],[src*=data\\:image]){display:none}.blocks-app .ant-app .dark .targetted-comment-item>.ant-comment-inner{background:#7030d43b}.blocks-app .ant-app .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before,.blocks-app .blocks-modal .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before{background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);border-top:1px solid var(--em-colorBorderSecondary);z-index:1;background-position:0 -2px;background-repeat:no-repeat;border-bottom:none;height:20px;bottom:-20px}.blocks-app .ant-app .ant-tabs-top[style*=vh]>.ant-tabs-nav:before,.blocks-app .blocks-modal .ant-tabs-top[style*=vh]>.ant-tabs-nav:before{background:0 0}.dark .blocks-app .ant-app .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before,.dark .blocks-app .blocks-modal .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before{background:linear-gradient(180deg, var(--em-colorBgBase) -100%, transparent 50%)}.blocks-app .ant-app .ant-tabs-top>.ant-tabs-nav,.blocks-app .blocks-modal .ant-tabs-top>.ant-tabs-nav{margin-bottom:20px}.blocks-app .ant-app .ant-tabs.email-pane__col_settings-inner>.ant-tabs-nav .ant-tabs-nav-operations,.blocks-app .ant-app .ant-tabs.email-pane__col_settings-inner>div>.ant-tabs-nav .ant-tabs-nav-operations,.blocks-app .blocks-modal .ant-tabs.email-pane__col_settings-inner>.ant-tabs-nav .ant-tabs-nav-operations,.blocks-app .blocks-modal .ant-tabs.email-pane__col_settings-inner>div>.ant-tabs-nav .ant-tabs-nav-operations{visibility:hidden;pointer-events:none;position:absolute}.blocks-app .transition-enter{opacity:0}.blocks-app .transition-enter-active{opacity:1;transition:opacity .3s ease-in}.blocks-app .transition-exit{opacity:1}.blocks-app .transition-exit-active{opacity:0;transition:opacity .3s ease-in}.blocks-app #carrotquest-messenger-collapsed-container{z-index:10!important}.blocks-app .carrot-messenger-frame-container{z-index:11!important}.blocks-app .default-mode__pane_editor,.blocks-app .code-mode{z-index:20}@media (height<=700px){.blocks-app .ant-color-picker-presets .ant-collapse-item:last-child{display:none}}@media only screen and (device-width<=480px),only screen and (width<=480px){.blocks-app .email-pane_only_code_mode_mobile .email-pane__row .ant-col:first-child{display:none}.blocks-app .email-pane_only_code_mode_mobile .email-pane__row .ant-col:last-child{width:100%!important}}.blocks-app .em-filemanager .uploadProgress{right:105px!important}.blocks-app.blocks-plugin{zoom:var(--em-pluginZoom,1)}body{margin:0}.blocks-app .ant-menu-submenu-placement-rightTop:before,.blocks-app .ant-menu-submenu-placement-rightTop:after{display:none!important}.blocks-app .main{overflow:hidden}.blocks-app .main__pane-layout{height:100%;min-height:100%}.blocks-app .main__pane{height:100%;transition:height .2s cubic-bezier(0,0,.2,1);position:relative}.blocks-app .main__pane_editor{z-index:2;box-shadow:0 10px 60px #2223}.blocks-app .main__pane .ant-layout-sider-trigger{flex-direction:column;justify-content:center;display:flex;overflow:hidden}.blocks-app .main__pane-trigger{box-sizing:border-box;justify-content:space-between;align-items:center;gap:8px;width:100%;min-width:0;max-width:100%;display:flex}.blocks-app .main__pane-trigger .anticon{flex-shrink:0}.blocks-app .main__pane-trigger .theme-switcher{flex:auto;min-width:0}.blocks-app .main__pane-trigger_compact{justify-content:center;gap:0}.blocks-app .main__pane-trigger .anticon-menu-unfold,.blocks-app .main__pane-trigger:hover .anticon-menu{display:none}.blocks-app .main__pane-trigger:hover .anticon-menu-unfold,.blocks-app .main__pane-trigger .anticon-menu{display:inline-flex}.blocks-app .main__panes-resizer{position:relative}.blocks-app .main__panes-resizer:before{content:"";background-color:#0000;border-bottom:2px solid #0000;width:100%;height:10px;transition:border-color .2s;position:absolute;bottom:0;left:0;right:0}.blocks-app .main__panes-resizer:hover{cursor:row-resize}.blocks-app .main__panes-resizer:hover:before{border-color:var(--em-colorPrimary)}.blocks-app .main__pane-close-btn{z-index:21;bottom:0;left:50%;transform:translate(-50%)}.blocks-app .main__pane-close-btn.ant-btn{border:0;border-radius:25px 25px 0 0;width:50px;height:25px;padding:0;position:absolute}.blocks-app .main__pane-close-btn .anticon{border-radius:50px 50px 0 0;outline:0 solid #188fff40;align-items:flex-end;height:100%;transition:all .1s cubic-bezier(0,0,.2,1)}.blocks-app .main__pane-close-btn .anticon.show-halo{outline-width:12px}.blocks-app .main__pane-close-btn .anticon.opened{align-items:flex-start;transform:rotate(180deg)}.blocks-app .main__pane-trigger .anticon.anticon-menu-fold{display:inline-flex}.blocks-app .main__pane-trigger.ant-btn{z-index:1;width:100%;height:70px;box-shadow:none;background:0 0;border:0;display:block;position:absolute;top:0;left:0;right:0}.blocks-app .main__pane-trigger.ant-btn:hover,.blocks-app .main__pane-trigger.ant-btn:focus{background:0 0}.blocks-app .main__pane-trigger.ant-btn:empty{visibility:visible;width:100%;display:block}.blocks-app .main__menu{z-index:11;height:100%;position:sticky;top:0}.blocks-app .main__menu .ant-layout-sider-children{box-sizing:border-box;max-height:100vh;overflow:hidden auto}.blocks-app .main__menu>div{border-right:1px solid;border-color:inherit}.blocks-app .main__menu:not(.ant-layout-sider-collapsed){margin-right:-180px;top:0;left:0;box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d}.blocks-app body.dark .main__menu:not(.ant-layout-sider-collapsed){box-shadow:0 3px 6px -4px #0000007a,0 6px 16px #00000052,0 9px 28px 8px #0003}.blocks-app .main__menu.main__menu_lock{box-shadow:none;margin-right:0}.blocks-app body.dark .main__menu.main__menu_lock{box-shadow:none}.blocks-app .main__menu *{text-overflow:unset!important}@media (width<=1400px){.blocks-app .main__menu .ant-layout-sider-zero-width-trigger{z-index:100000;top:50%;text-align:center;visibility:visible;width:20px;height:60px;font-size:16px;inset-inline-start:0;transform:translateY(-30px);box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #0000000f}.blocks-app .main__menu .ant-layout-sider-zero-width-trigger-right{visibility:hidden}}.blocks-app .main__content-wrapper{position:relative}@media (width<=1550px){.blocks-app .main__header{padding:0 20px 0 40px!important}}.blocks-app .ant-layout .ant-layout-sider-trigger{text-align:left;border-bottom:none;padding:0 30px}.blocks-app .ant-app .main__menu:not(.ant-layout-sider-collapsed) .ant-layout-sider-trigger{padding:0 30px}.blocks-app .ant-app .main__menu.ant-layout-sider-collapsed .ant-layout-sider-trigger{padding:0 10px}.blocks-app .ant-layout-sider-light .ant-layout-sider-trigger{background:0 0}@media (pointer:coarse) and (orientation:portrait){.blocks-app .ant-app .main__menu .ant-layout-sider-children{height:auto}.blocks-app .ant-app .main__menu .ant-layout-sider-trigger{position:static}.blocks-app .ant-app .main__menu .project-menu__bottom-stack{margin-top:32px}}.blocks-app .ant-btn.project-menu__block-button{padding:0!important}.blocks-app .code-size-warning-modal .ant-modal-container{padding:32px}.blocks-app .code-size-warning-modal__content{flex-direction:column;display:flex}.blocks-app .code-size-warning-modal__icon{color:var(--em-colorWarning);margin-bottom:16px;font-size:64px}.blocks-app .code-size-warning-modal__icon .anticon{display:block}.blocks-app .code-size-warning-modal__title{color:var(--em-colorText);margin:0 0 12px;font-size:18px;font-weight:600}.blocks-app .code-size-warning-modal__message{color:var(--em-colorTextSecondary);margin-bottom:24px;font-size:14px;line-height:1.6}.blocks-app .code-size-warning-modal__message p{margin:0 0 12px}.blocks-app .code-size-warning-modal__message p:last-child{margin-bottom:0}.blocks-app .code-size-warning-modal__message strong{color:var(--em-colorError);font-weight:600}.blocks-app .code-size-warning-modal__image{width:100%;margin-bottom:24px}.blocks-app .code-size-warning-modal__image-placeholder{border-radius:8px;width:100%;height:200px;display:flex}.blocks-app .code-size-warning-modal__image-placeholder img{object-fit:contain;max-width:100%;max-height:100%}.blocks-app .code-size-warning-modal__actions{width:100%;display:flex}.blocks-app .code-size-warning-modal__actions .ant-btn{min-width:140px}.blocks-app .integration-tile{border:1px solid var(--em-colorBorderSecondary);background:var(--em-colorBgContainer);border-radius:8px;flex-direction:column;min-height:254px;padding:16px;transition:border-color .2s;display:flex}.blocks-app .integration-tile--error{border-color:var(--em-colorError)}.blocks-app .integration-tile__body{flex:1;min-height:0}.blocks-app .integration-tile__icon{object-fit:contain;width:48px;height:48px;margin-bottom:12px}.blocks-app .integration-tile__icon-svg{margin-bottom:12px;font-size:48px;line-height:1}.blocks-app .integration-tile__title{color:var(--em-colorText);margin:0 0 4px;font-size:14px;font-weight:500;line-height:1.3;display:block}.blocks-app .integration-tile__description{color:var(--em-colorTextSecondary);margin:0;font-size:12px;font-weight:300;line-height:1.4;display:block}.blocks-app .integration-tile__footer{justify-content:space-between;align-items:flex-end;gap:8px;min-height:40px;margin-top:16px;display:flex}.blocks-app .integration-tile__badge{white-space:nowrap;border-radius:11px;align-items:center;height:22px;padding:0 8px;font-size:12px;font-weight:400;line-height:1;display:inline-flex}.blocks-app .integration-tile__badge--connected{color:var(--em-colorSuccess);background:var(--em-colorSuccessBg)}.blocks-app .integration-tile__badge--not_connected{color:var(--em-colorTextSecondary);background:var(--em-colorFillTertiary)}.blocks-app .integration-tile__badge--error{color:var(--em-colorError);background:var(--em-colorErrorBg)}.blocks-app .integration-tile__badge--coming_soon{color:var(--em-colorPrimary);background:var(--em-colorPrimaryBg)}.blocks-app .integration-tile__configure.ant-btn{box-sizing:border-box;width:40px;min-width:40px;height:40px;box-shadow:none;background:var(--em-colorFillQuaternary);color:var(--em-colorTextSecondary);border:none;border-radius:6px;flex-direction:row;flex:none;justify-content:center;align-items:center;gap:0;padding:0;display:inline-flex}.blocks-app .integration-tile__configure.ant-btn.ant-btn-icon-only{width:40px;min-width:40px;height:40px;padding:0}.blocks-app .integration-tile__configure.ant-btn .ant-btn-icon{justify-content:center;align-items:center;width:16px;height:16px;margin:0;line-height:0;display:inline-flex}.blocks-app .integration-tile__configure.ant-btn:not(:disabled):hover,.blocks-app .integration-tile__configure.ant-btn:not(:disabled):focus-visible{box-shadow:none;background:var(--em-colorFillTertiary);color:var(--em-colorTextSecondary);border:none}.blocks-app .integration-tile__configure.ant-btn:disabled,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled{cursor:not-allowed;box-shadow:none;opacity:1;background:var(--em-colorFillQuaternary);color:var(--em-colorTextQuaternary);border:none}.blocks-app .integration-tile__configure.ant-btn:disabled .ant-btn-icon,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled .ant-btn-icon{color:var(--em-colorTextQuaternary)}.blocks-app .integration-tile__configure.ant-btn:disabled:hover,.blocks-app .integration-tile__configure.ant-btn:disabled:focus-visible,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled:hover,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled:focus-visible{box-shadow:none;background:var(--em-colorFillQuaternary);color:var(--em-colorTextQuaternary);border:none}.blocks-app .ant-app .integration-tile__configure.ant-btn.ant-btn-icon-only{width:40px;min-width:40px;height:40px;padding:0}.blocks-app .ant-app .integration-tile__configure.ant-btn.ant-btn-icon-only:disabled,.blocks-app .ant-app .integration-tile__configure.ant-btn.ant-btn-icon-only.ant-btn-disabled{opacity:1;background:var(--em-colorFillQuaternary);color:var(--em-colorTextQuaternary)}.blocks-app .em-export-platforms-submenu .ant-dropdown-menu{max-height:420px;overflow-y:auto}.blocks-app .app-logo{color:#000;line-height:1.35;display:inline-block}.blocks-app .app-logo:hover{color:#000}.blocks-app .em-analytics__email-save .ant-btn-loading-icon .anticon,.blocks-app .em-analytics__block-save .ant-btn-loading-icon .anticon{font-size:16px}.blocks-app .email-page-header__dropdown-menu{top:10px}.blocks-app .email-page-header__email-id{color:var(--em-colorTextTertiary)}.blocks-app .email-page-header .button{cursor:pointer}.blocks-app .anticon.anticon-edit.email-page-header__icon-edit{color:#8c8c8c;margin-left:6px;font-size:16px}.blocks-app .ant-typography-edit:hover .anticon.anticon-edit.email-page-header__icon-edit{color:var(--em-colorPrimaryHover)}.blocks-app .ant-page-header-heading{max-width:700px;transition:all .2s;position:relative}.blocks-app .ant-page-header-heading svg{cursor:pointer;opacity:0;justify-content:center;width:0;height:0;transition:all .2s .2s;position:absolute;top:0;right:3px}.blocks-app .ant-page-header-heading svg:hover{color:var(--em-colorPrimaryHover)}.blocks-app .ant-page-header-heading.focus{background-color:var(--em-colorFillSecondary);border-radius:calc(var(--em-borderRadiusSM) * 1px);padding:0 8px}.blocks-app .ant-page-header-heading.focus svg{opacity:1;width:20px;height:20px;top:3px}.blocks-app .ant-page-header-heading.ant-page-header-heading_preheader.focus svg{top:3px}.blocks-app .ant-page-header-heading_preheader .anticon{top:-2px}.blocks-app .email-page-header .ant-page-header-heading-left{flex-grow:1;overflow:visible}.blocks-app .email-page-header .ant-page-header-back{align-self:flex-start;margin-right:0;padding-top:8px}.blocks-app div.ant-typography-edit-content.ant-page-header-heading-preheader,.blocks-app div.ant-typography-edit-content.ant-page-header-heading-title{margin-top:0;margin-bottom:0;inset-inline-start:0}.blocks-app .header__left .ant-form-item-control-input,.blocks-app .header__left .ant-form-item-control-input-content{line-height:normal;min-height:auto!important}.blocks-app .header__left .ant-page-header-heading-title{white-space:pre-wrap;text-overflow:ellipsis;border-radius:0;flex-grow:1;min-height:auto;font-weight:500;line-height:1;overflow:visible;height:auto!important;padding:3px 20px 3px 0!important}.blocks-app .header__left .ant-page-header-heading-preheader{max-width:700px;min-height:auto;box-shadow:none;text-overflow:ellipsis;white-space:nowrap;border-radius:0;display:block;overflow:hidden;height:auto!important;padding:3px 20px 3px 0!important;line-height:20px!important}.blocks-app .header__left .ant-skeleton.ant-skeleton-element{width:100%;display:block}.blocks-app .ant-page-header-heading-title,.blocks-app .ant-page-header-heading-preheader{background:0 0;padding:0;box-shadow:none!important;border:none!important;transition:none!important}.blocks-app .ant-page-header-heading-preheader{color:var(--em-colorTextSecondary);min-height:auto}.blocks-app .subject_preheader_form__title{width:80px;color:var(--em-colorTextTertiary);white-space:nowrap}.blocks-app .ant-page-header-heading-title{line-height:22px!important}.blocks-app .email-page-header .ant-typography{align-items:center;margin-bottom:0;padding:0 12px;display:flex}.blocks-app .email-page-header .ant-typography-edit-content{margin-top:-10px;padding:0;top:5px;left:auto}.blocks-app .email-page-header .ant-input{font-size:inherit;font-weight:inherit}.blocks-app .email-page-header .ant-page-header-heading-extra>*{margin-left:8px}.blocks-app header .ant-btn.email-page-header__btn_extra{width:32px;padding:0}.blocks-app .update-global-blocks-modal__hint{color:#000000a6;margin-bottom:16px}.blocks-app .update-global-blocks-modal__list{flex-direction:column;gap:12px;max-height:320px;display:flex;overflow-y:auto}.blocks-app .update-global-blocks-modal__row{align-items:center;gap:12px;display:flex}.blocks-app .update-global-blocks-modal__title{flex-direction:column;flex:auto;display:flex;overflow:hidden}.blocks-app .update-global-blocks-modal__version{color:#00000073;font-size:12px}.blocks-app .update-global-blocks-modal__count{color:#00000073;flex:none;font-size:12px}.blocks-app .update-global-blocks-modal__footer{justify-content:flex-end;gap:8px;display:flex}.blocks-app .convert-layout-modal .ant-modal-header{text-align:center;margin-top:16px;margin-bottom:8px}.blocks-app .convert-layout-modal .ant-modal-footer{margin-top:16px;padding:0 8px}.blocks-app .convert-layout-modal__title{color:var(--em-colorText);font-size:20px;font-weight:600}.blocks-app .convert-layout-modal__content{flex-direction:column;align-items:center;gap:24px;display:flex;overflow:hidden}.blocks-app .convert-layout-modal__text{font-size:14px;line-height:1.5}.blocks-app .convert-layout-modal__intro-text{text-align:center;color:var(--em-colorTextSecondary);padding:0 16px}.blocks-app .convert-layout-modal__image{border-radius:8px;width:100%;max-width:100%;height:auto;display:block}.blocks-app .convert-layout-modal__footer{justify-content:flex-end;gap:8px;margin-top:8px;display:flex}.blocks-app .convert-layout-modal__footer--between{justify-content:space-between}.blocks-app .convert-layout-modal__error-details{background-color:var(--em-colorErrorBg,#ff00000f);color:var(--em-colorTextSecondary);word-break:break-word;border-radius:8px;margin-top:12px;padding:8px 12px;font-size:12px}.blocks-app .conversion-overlay{z-index:2000;background-color:var(--em-colorBgMask,#00000073);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.blocks-app .conversion-overlay__content{background-color:var(--em-colorBgElevated);width:360px;max-width:80vw;box-shadow:var(--em-boxShadowSecondary);text-align:center;border-radius:12px;flex-direction:column;align-items:center;gap:16px;padding:32px;display:flex}.blocks-app .conversion-overlay__title{color:var(--em-colorText);font-size:16px;font-weight:600}.blocks-app .conversion-overlay__hint{color:var(--em-colorTextSecondary);font-size:13px}.blocks-app .conversion-overlay__progress{width:100%}@media (width<=1550px){.blocks-app .email-pane__col_settings{margin-left:48px;margin-right:32px}}.blocks-app .em-dragging-element{border-radius:8px}.blocks-app .em-dragging-element>div{box-shadow:none!important}.blocks-app .em-dragging-element .blocks-search__result-html,.blocks-app .em-dragging-element span,.blocks-app .em-dragging-element .atoms__item:before{visibility:hidden}.blocks-app .em-ghost-element.blocks-search__result-html,.blocks-app .em-ghost-element span,.blocks-app .em-ghost-element.atoms__item:before{visibility:visible!important}.blocks-app .em-ghost-element table{border-collapse:initial}',a=window.__emailmaker_styles__||(window.__emailmaker_styles__={sheets:{},order:[]}),p=t;if(!a.sheets[p]){var o=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(o=new CSSStyleSheet,o.replaceSync(t))}catch{o=null}if(o){if(!a.host||!a.host.isConnected||!a.host.sheet){var e=document.createElement("style");e.setAttribute("data-emailmaker","true"),document.head.appendChild(e),a.host=e}for(var r=a.host.sheet,i=0;i<o.cssRules.length;i++)try{r.insertRule(o.cssRules[i].cssText,r.cssRules.length)}catch{}(a.texts||(a.texts=[])).push(t),(a.listeners||[]).forEach(function(n){try{n(t)}catch{}})}else{var e=document.createElement("style");e.setAttribute("data-emailmaker","true"),e.appendChild(document.createTextNode(t)),document.head.appendChild(e)}a.sheets[p]=!0,a.order.push(p)}}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
|
|
853
|
+
__emailmaker__.define("core",["require","exports","module","static/core/5dc34752.js","static/core/422c8b42.js","static/core/c804e4dd.js","static/core/b0620c65.js","static/core/abb243ca.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper","react-dom/client","classnames","dayjs"],function(se,xt,Qm){Object.defineProperties(xt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const ft=se("./static/core/5dc34752.js"),d=se("./static/core/422c8b42.js"),n=se("./static/core/c804e4dd.js"),Pn=se("./static/core/b0620c65.js"),Ze=se("./static/core/abb243ca.js");let m=se("react");m=ft.__toESM(m);let h=se("react/jsx-runtime"),I=se("__delivery__/libs"),je=se("vite/preload-helper"),Ta=se("react-dom/client"),Nr=se("classnames");Nr=ft.__toESM(Nr);let Gt=se("dayjs");Gt=ft.__toESM(Gt);var Pa="Editor mount element was removed from the document. Call instance.destroy() on host unmount.";function xa(){return d.createAbortError(Pa)}function Ra(e,t,r){if(typeof document>"u")return;let o=!1,a;const i=()=>{o=!0,a?.disconnect(),a=void 0},s=()=>{o||(i(),t())};if(r.addDispose(i),!e.isConnected){queueMicrotask(s);return}a=new MutationObserver(()=>{e.isConnected||s()});let c=e.parentNode;for(;c;)a.observe(c,{childList:!0}),c=c.parentNode}var Oa="-host-mount";function Ma(){return`data-emailmaker${Oa}`}function ja(e,t){Array.from(e.children).forEach(r=>{r.nodeType===Node.ELEMENT_NODE&&r.hasAttribute(t)&&r.remove()})}function La(e){const t=Ma();ja(e,t);const r=document.createElement("div");r.setAttribute(t,"true"),r.setAttribute("translate","no"),r.classList.add("notranslate"),r.style.display="block",r.style.width="100%",r.style.height="100%",r.style.minHeight="100%";const o=e.querySelector(":scope > [data-canvas-host]");return o?e.insertBefore(r,o):e.appendChild(r),r}function Da(e,t,r){r.addDispose(()=>{t.parentNode===e&&t.remove()})}function Jt(e){return t=>{let r=null,o=!1;return{async setOptions(a){if(!r&&!o){r=await e(t);const i=await t.getInstanceAsync(d.INSTANCE_ID);Object.assign(i,r.instance||{})}r.setOptions&&await r.setOptions(a)},instance:{},dispose(){r?.dispose&&r?.dispose(),o=!0}}}}function Na(e){return`__${e.replace(/[^a-zA-Z0-9_]/gu,"_")}_styles__`}var Fa=class{shadowRoot;markerAttr;observer;addedKeys=new Set;stopSharedStyles;constructor({shadowRoot:e,markerAttr:t="data-emailmaker"}){this.shadowRoot=e,this.markerAttr=t,this.observer=new MutationObserver(this.handleMutations),this.observer.observe(document.head,{childList:!0,subtree:!1}),this.syncExistingStyles(),this.syncSharedStyles()}syncSharedStyles(){const e=window,t=Na("emailmaker"),r=e[t]??={},o=document.createElement("style");o.setAttribute(this.markerAttr,"shared"),o.textContent=(r.texts??[]).join(`
|
|
854
|
+
`),this.shadowRoot.insertBefore(o,this.shadowRoot.firstChild);const a=s=>{o.appendChild(document.createTextNode(`
|
|
855
|
+
${s}`))},i=r.listeners??=[];i.push(a),this.stopSharedStyles=()=>{const s=i.indexOf(a);s>=0&&i.splice(s,1)}}syncExistingStyles(){const e=document.querySelectorAll(`style[${this.markerAttr}], link[${this.markerAttr}]`);for(let t=e.length-1;t>=0;t--)this.cloneAndInjectNode(e[t])}getNodeKey(e){return e.tagName==="STYLE"?(e.textContent||"").trim():e.tagName==="LINK"?e.href:null}cloneAndInjectNode(e){const t=this.getNodeKey(e);if(!t||this.addedKeys.has(t))return;const r=e.cloneNode(!0);this.shadowRoot.insertBefore(r,this.shadowRoot.firstChild),this.addedKeys.add(t)}handleMutations=e=>{for(const t of e)for(const r of t.addedNodes)r.nodeType===1&&(r instanceof HTMLStyleElement||r instanceof HTMLLinkElement)&&r.hasAttribute(this.markerAttr)&&this.cloneAndInjectNode(r)};dispose(){this.observer.disconnect(),this.stopSharedStyles?.(),this.addedKeys.clear()}};function Ua(){let e,t,r=!1;const o=()=>{const a=e;if(!r||!a||a===t)return;t=a;const i=s=>{};try{const s=a.handleChunkLoaded?.();s instanceof Promise&&s.catch(i)}catch(s){i(s)}};return{use:a=>{e=a,o()},loaded:()=>{r=!0,o()}}}function Ba({children:e}){return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)("div",{className:"config-gate-fallback"}),children:e})}var $a=n.createSource(void 0);function Ga(e){$a.set(e)}var qa=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=dark]"),Ha=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=light]"),za=e=>{if(typeof e!="string")return!1;const t=e.trim();return t.length>0&&!/\s/.test(t)},Va=e=>{let t,r;e==="system"?(t=n.PREFERS_COLOR_SCHEME_LIGHT,r=n.PREFERS_COLOR_SCHEME_DARK):(t=e==="light"?"all":n.NOT_ALL,r=e==="dark"?"all":n.NOT_ALL),[...Ha].forEach(o=>{o.media=t}),[...qa].forEach(o=>{o.media=r})},Wa=(e={})=>{const t=document.querySelector("head"),r=document.createElement("style");if(r.type="text/css",r.dataset.themeVaribalse=!0,r.setAttribute("data-emailmaker","true"),Object.entries(e).length){let o="";Object.entries(e).forEach(([i,s])=>{typeof s!="object"&&(o+=` ${n.themeTokenCssVarName(i)}: ${s};
|
|
856
|
+
`)}),o=`.blocks-body, .blocks-app, .ant-modal-root, .ant-tooltip, .ant-notification {
|
|
857
|
+
${o}}`,r.appendChild(document.createTextNode(o));const a=t.querySelector('[data-theme-varibalse="true"]');a?t.replaceChild(r,a):t.insertBefore(r,t.firstChild)}},Ka=e=>{if(!za(e))return;const t=e.trim(),r=document.body,o=()=>Ga(r.classList.contains("dark")?n.DARK:r.classList.contains("light")?n.LIGHT:n.SYSTEM);r.classList.contains(t)?setTimeout(o,200):setTimeout(()=>{r.classList.remove(t==="dark"?n.LIGHT:n.DARK),r.classList.add(t),o()},200)},gt={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")},Jm={defaultMerge:gt.defaultMerge};function Ya(e,t){return t}function xn(e){return typeof e!="object"||e===null?0:Array.isArray(e)?2:Xa(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Qa(e){const t=new Set;for(const r of e)for(const o of[...Object.keys(r),...Object.getOwnPropertySymbols(r)])t.add(o);return t}function Ja(e,t){return typeof e=="object"&&Object.prototype.propertyIsEnumerable.call(e,t)}function Rn(e){return{*[Symbol.iterator](){for(const t of e)for(const r of t)yield r}}}var On=new Set(["[object Object]","[object Module]"]);function Xa(e){if(!On.has(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(t===void 0)return!0;const r=t.prototype;return!(r===null||typeof r!="object"||!On.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function Za(e,t,r){const o={};for(const a of Qa(e)){const i=[];for(const c of e)Ja(c,a)&&i.push(c[a]);if(i.length===0)continue;const s=jn(i,t,t.metaDataUpdater(r,{key:a,parents:e}));s!==gt.skip&&(a==="__proto__"?Object.defineProperty(o,a,{value:s,configurable:!0,enumerable:!0,writable:!0}):o[a]=s)}return o}function ei(e){return e.flat()}function ti(e){return new Set(Rn(e))}function ri(e){return new Map(Rn(e))}function Mn(e){return e.at(-1)}var Fr=Object.freeze({__proto__:null,mergeArrays:ei,mergeMaps:ri,mergeOthers:Mn,mergeRecords:Za,mergeSets:ti});function Ur(...e){return ni({})(...e)}function ni(e,t){const r=oi(e,o);function o(...a){return jn(a,r,t)}return o}function oi(e,t){return{defaultMergeFunctions:Fr,mergeFunctions:{...Fr,...Object.fromEntries(Object.entries(e).filter(([r,o])=>Object.hasOwn(Fr,r)).map(([r,o])=>o===!1?[r,Mn]:[r,o]))},metaDataUpdater:e.metaDataUpdater??Ya,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,actions:gt}}function jn(e,t,r){if(e.length===0)return;if(e.length===1)return Br(e,t,r);const o=xn(e[0]);if(o!==0&&o!==5){for(let a=1;a<e.length;a++)if(xn(e[a])!==o)return Br(e,t,r)}switch(o){case 1:return ai(e,t,r);case 2:return ii(e,t,r);case 3:return si(e,t,r);case 4:return ci(e,t,r);default:return Br(e,t,r)}}function ai(e,t,r){const o=t.mergeFunctions.mergeRecords(e,t,r);return o===gt.defaultMerge||t.useImplicitDefaultMerging&&o===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,r):o}function ii(e,t,r){const o=t.mergeFunctions.mergeArrays(e,t,r);return o===gt.defaultMerge||t.useImplicitDefaultMerging&&o===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):o}function si(e,t,r){const o=t.mergeFunctions.mergeSets(e,t,r);return o===gt.defaultMerge||t.useImplicitDefaultMerging&&o===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):o}function ci(e,t,r){const o=t.mergeFunctions.mergeMaps(e,t,r);return o===gt.defaultMerge||t.useImplicitDefaultMerging&&o===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):o}function Br(e,t,r){const o=t.mergeFunctions.mergeOthers(e,t,r);return o===gt.defaultMerge||t.useImplicitDefaultMerging&&o===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):o}function li(e){n.requiredArgs(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||n._typeof(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):new Date(NaN)}var di=({children:e})=>{const[t,r]=(0,m.useState)([]),o=n.useEvent(d.MODAL_SHOW_EVENT),a=n.useEvent(d.MODAL_CLOSE_EVENT),i=n.useEvent(d.MODAL_UPDATE_EVENT),s=n.useModalRootElement(),c=(0,m.useCallback)(g=>{r(y=>g===void 0?[]:y.filter(l=>l.id!==g))},[r]),u=(0,m.useCallback)(g=>{r(y=>{const l=y.find(v=>v.id===g.id);return l?y.map(v=>v===l?{...v,...l}:v):[...y,{...g,visible:!0}]})},[r]),p=(0,m.useCallback)(g=>{r(y=>{const l=y.find(v=>v.id===g.id);return l?y.map(v=>v===l?{...v,...l}:v):y})},[r]),f=(0,m.useCallback)(()=>s,[s]);return(0,m.useEffect)(()=>{const g=new d.Disposable;return g.addDisposable(o(u)),g.addDisposable(i(p)),g.addDisposable(a(c)),()=>g.dispose()},[o,a,i,u,c,p]),(0,h.jsxs)(h.Fragment,{children:[t.map(({id:g,content:y,props:l,visible:v,onOk:w,onClose:A,modalProps:P,...M})=>{const O=()=>c(g),D=async()=>{w&&await w(),c(g)};return(0,h.jsx)(I.ui_kit$Modal,{open:v,onCancel:O,onOk:D,afterClose:A,getContainer:f,...P,...M,children:typeof y!="function"?y:m.default.createElement(y,l)},g)}),e]})},ui=new Set;function Ln(e){const t=typeof e=="string"&&e?e:void 0;t?window.localStorage.setItem(n.LOCAL_STORAGE_ITEMS.em_color_scheme,t):window.localStorage.removeItem(n.LOCAL_STORAGE_ITEMS.em_color_scheme);for(const r of ui)r(t)}function $r(e,t){return e==="system"?t:e||"light"}var pi=[(0,I.ui_kit$createTransformer)()],mi={colorDarken1:"rgba(0, 0, 0, 0.08)",colorFillSecondaryDarken:"rgba(0, 0, 0, 0.1)",formControlHeight:34,borderWidth:1,borderColorHover:"#C5C5C5",formItemMarginBottomMD:20,formItemMarginBottomXS:8,colorSecondaryH:265.03,colorSecondaryS:"63.92%",colorSecondaryL:"50%",colorSecondaryBgH:273,colorSecondaryBgS:"100%",colorSecondaryBgL:"93%",appZoom:1},fi={colorDarken1:"rgba(0, 0, 0, 0.9)",colorFillSecondaryDarken:"rgba(255, 255, 255, 0.16)",formControlHeight:34,borderWidth:1,borderColorHover:"rgba(255, 255, 255, 0.3)",formItemMarginBottomMD:20,formItemMarginBottomXS:8,appZoom:1},gi=Ur(I.ui_kit$lightThemePreset,{token:mi}),hi=Ur(I.ui_kit$darkThemePreset,{token:fi});function yi(e){const t=matchMedia(n.PREFERS_COLOR_SCHEME_DARK);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}var vi=()=>matchMedia("(prefers-color-scheme: dark)").matches?n.DARK:n.LIGHT;function _i({children:e}){const t=n.useSelector(n.selectEditorThemeColor$1),r=(0,m.useSyncExternalStore)(yi,vi),o=n.useAppConfig(),[a,i]=(0,m.useState)($r(o.theme,r)),s=n.useDispatch();(0,m.useEffect)(()=>{const v=$r(o.theme,r);i(v),Ka(v),s(n.setEditorThemeColor$1(v==="dark"?`vs-${v}`:n.LIGHT))},[t,r,o.theme,o.pathEnabled,s]);const c=(0,m.useCallback)(v=>{v&&v!=="system"?(Va(v),Ln(v)):Ln(void 0)},[]);(0,m.useEffect)(()=>{const v=$r(o.theme,r),w=localStorage.getItem(n.LOCAL_STORAGE_ITEMS.em_color_scheme);v&&v!==w&&c(v)},[o.theme,r,c]);const u=(0,m.useCallback)(()=>{const v=localStorage.getItem(n.LOCAL_STORAGE_ITEMS.em_color_scheme);c(v)},[c]);(0,m.useEffect)(()=>{u()},[u]);const p=o.themes,[f]=(0,m.useState)(1),g=(0,m.useMemo)(()=>{const v=a==="light"?gi:hi,w=p[a],A=w?Ur(v,w):v;return{...A,token:{...A.token,appZoom:f}}},[a,p,f]),y=n.useModalRootElement(),l=(0,m.useCallback)(()=>y,[y]);return(0,h.jsx)(I.ui_kit$ThemeProvider,{theme:g,getPopupContainer:l,children:(0,h.jsx)(I.ui_kit$StyleProvider,{transformers:pi,children:(0,h.jsx)(di,{children:(0,h.jsx)(I.ui_kit$App,{children:(0,h.jsx)(n.ImagePickerProvider,{children:e})})})})})}var bi=({onLoad:e,children:t})=>{(0,m.useEffect)(()=>{e&&e()},[e]);const r=n.useAppDispatch();return(0,m.useEffect)(()=>{r(n.authorizationApi.endpoints.getMe.initiate(""))},[r]),t};function Dn({title:e,content:t,acf:{seen:r,type:o,event:a,data:i},...s}){return{...s,seen:r,type:o,event:a,data:i,title:n.getRendererString(e),content:t}}var qt="Notifications",Xt=n.createApi({reducerPath:"notificationsApi",tagTypes:[qt],baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getNotifications:e.query({queryFn(t,r){return n.clientFromApi(r).wp.notification_list({author:[Number(t)]}).then(n.transformListResponseFn(Dn))},providesTags:t=>t?[...t.map(({id:r})=>({type:qt,id:r})),{type:qt,id:"LIST"}]:[{type:qt,id:"LIST"}]}),notificationShown:e.mutation({queryFn({id:t,datetime:r},o){return n.clientFromApi(o).wp.notification_create2({id:t},{},{type:d.ContentType.Json,extraQuery:{"acf[seen]":r}}).then(n.transformResponseFn(Dn))},invalidatesTags:[{type:qt,id:"LIST"}]})})}),{useGetNotificationsQuery:Ei,useNotificationShownMutation:Si}=Xt,wi=()=>{const e=n.useCookieManager(),t=n.useContainer(),r=n.useRoutePathname();(0,m.useEffect)(()=>{r.endsWith("/new")||e.remove(n.APP_COOKIES.em_new_email)},[r,e,t])},ki=()=>{const e=n.useCookieManager(),t=n.useRoutePathname();(0,m.useEffect)(()=>{t.endsWith("/new")||e.remove(n.APP_COOKIES.em_new_block)},[t,e])};function Nn(e,t){e.getAttribute("content")!==t&&e.setAttribute("content",t)}function Ci(e){(0,m.useEffect)(()=>{const t=document.head.querySelector('meta[name="viewport"]');if(!e||!t)return;const r=t.getAttribute("content")??"",o=document.documentElement,a=()=>{const s=n.readScreenFacts(window),c=n.shouldScaleLayout(s);Nn(t,c?n.scaledViewportContent(s):r),o.classList.toggle(n.SCALED_LAYOUT_CLASS,c)};a();const i=[n.COARSE_POINTER_QUERY,n.LANDSCAPE_QUERY].map(s=>window.matchMedia(s));return i.forEach(s=>s.addEventListener("change",a)),window.screen.orientation?.addEventListener?.("change",a),()=>{i.forEach(s=>s.removeEventListener("change",a)),window.screen.orientation?.removeEventListener?.("change",a),Nn(t,r),o.classList.remove(n.SCALED_LAYOUT_CLASS)}},[e])}var Fn="em_notification_mark_seen_skipped_ids";function Un(){try{const e=sessionStorage.getItem(Fn),t=e?JSON.parse(e):[];return Array.isArray(t)?t.map(String):[]}catch{return[]}}function Ai(e){try{const t=String(e),r=new Set(Un());r.has(t)||(r.add(t),sessionStorage.setItem(Fn,JSON.stringify([...r])))}catch{}}var Ii=({children:e=void 0,sider:t=null,modals:r=null,hasEmail:o=!1,hasBlock:a=!1})=>{const{token:i}=(0,I.ui_kit$useToken)(),s=n.useDispatch(),c=n.useSelector(n.selectActiveModal$1),u=n.useCurrentUser();n.useSelector(n.selectIsCodeMode);const p=n.usePushToDataLayer(),[f]=Si(),g=n.useNotification();(0,m.useEffect)(()=>{Wa(i)},[i]);const{data:y=[],isSuccess:l}=Ei(u?.id??"",{pollingInterval:3e5,skip:!!c||!u?.id});return(0,m.useEffect)(()=>{const v=y.filter(w=>w.seen===""||w.seen===null);setTimeout(()=>{if(v.length&&l){const w=new Set(Un());v.forEach(A=>{if(w.has(String(A.id)))return;A.event==="subscription_payment"&&p({event:"payment",data:A.data}),g[A.type]({title:A.title?.rendered||A.title||"",description:A.content?.rendered||""});const P=new Date().toLocaleString();f({id:A.id,datetime:P}).unwrap().catch(M=>{const O=M&&typeof M=="object"?M:{};(O.data&&typeof O.data=="object"&&O.data!==null&&"code"in O.data?String(O.data.code):void 0)==="em_rest_notification_403"&&Ai(A.id)})})}},5e3)},[l,f,y,g]),wi(),ki(),Ci(!1),(0,m.useEffect)(()=>{a||s(n.resetBlockSlice()),o||s(n.resetEmailSlice())},[a,o,s]),(0,h.jsx)("div",{className:"main",children:(0,h.jsx)("div",{className:"main__pane main__pane_main",children:(0,h.jsx)("div",{className:"main__pane-content",id:"pane-content-iframe","data-scroll-area":"page",children:(0,h.jsxs)(I.ui_kit$Layout,{className:"main__pane-layout",hasSider:!!t,children:[t,r,e??(0,h.jsx)(n.RouteOutlet,{})]})})})})};function Ti({html:e,renderGuid:t,showToken:r,showId:o,...a},i){const{requested:s}=n.getCurrentProject(i),c=n.getAppConfig(i);return n.filterUndefined({...a,code:n.getTemplateDirectivesPolicy(i).toOutputForm(e),project:s===void 0?a.project:s,utm_parameters:c.UTMEnabled?a.utm_parameters:void 0,tags:void 0,template:void 0,guid:void 0,emailtags:void 0,project_title:void 0,project_author:void 0,is_template:void 0,is_inited:void 0})}var Pi=ft.__commonJSMin(((e,t)=>{n.init__polyfill_node_global(),(function(r,o){typeof define=="function"&&define.amd?define([],o):typeof e<"u"?o():(o(),r.FileSaver={})})(e,function(){"use strict";function r(p,f){return typeof f>"u"?f={autoBom:!1}:typeof f!="object"&&(f={autoBom:!f}),f.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(p.type)?new Blob(["\uFEFF",p],{type:p.type}):p}function o(p,f,g){var y=new XMLHttpRequest;y.open("GET",p),y.responseType="blob",y.onload=function(){u(y.response,f,g)},y.onerror=function(){},y.send()}function a(p){var f=new XMLHttpRequest;f.open("HEAD",p,!1);try{f.send()}catch{}return 200<=f.status&&299>=f.status}function i(p){try{p.dispatchEvent(new MouseEvent("click"))}catch{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),p.dispatchEvent(f)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof n._polyfill_node_global_default=="object"&&n._polyfill_node_global_default.global===n._polyfill_node_global_default?n._polyfill_node_global_default:void 0,c=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!c?function(p,f,g){var y=s.URL||s.webkitURL,l=document.createElement("a");f=f||p.name||"download",l.download=f,l.rel="noopener",typeof p=="string"?(l.href=p,l.origin===location.origin?i(l):a(l.href)?o(p,f,g):i(l,l.target="_blank")):(l.href=y.createObjectURL(p),setTimeout(function(){y.revokeObjectURL(l.href)},4e4),setTimeout(function(){i(l)},0))}:"msSaveOrOpenBlob"in navigator?function(p,f,g){if(f=f||p.name||"download",typeof p!="string")navigator.msSaveOrOpenBlob(r(p,g),f);else if(a(p))o(p,f,g);else{var y=document.createElement("a");y.href=p,y.target="_blank",setTimeout(function(){i(y)})}}:function(p,f,g,y){if(y=y||open("","_blank"),y&&(y.document.title=y.document.body.innerText="downloading..."),typeof p=="string")return o(p,f,g);var l=p.type==="application/octet-stream",v=/constructor/i.test(s.HTMLElement)||s.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||l&&v||c)&&typeof FileReader<"u"){var A=new FileReader;A.onloadend=function(){var O=A.result;O=w?O:O.replace(/^data:[^;]*;/,"data:attachment/file;"),y?y.location.href=O:location=O,y=null},A.readAsDataURL(p)}else{var P=s.URL||s.webkitURL,M=P.createObjectURL(p);y?y.location=M:location.href=M,y=null,setTimeout(function(){P.revokeObjectURL(M)},4e4)}});s.saveAs=u.saveAs=u,typeof t<"u"&&(t.exports=u)})})),ze=ft.__toESM(n.require_prop_types()),Rt=Pi(),Ht="NEXT_BUTTON",Gr="SAVE_BUTTON",qr="KEYBOARD",xi="EXTERNAL",Ri=new Set([Gr,Ht,qr]);function Oi(e){return e!=null&&e!==""&&Ri.has(e)}function Bn(e){if(!e||e==="all")return;const t=Number(e);return Number.isFinite(t)?[t]:void 0}var $n=(0,m.createContext)(null);function Mi(){const e=(0,m.useContext)($n);if(!e)throw new Error("useEmailSaveController must be used within EmailSaveContext.Provider");return e}var ji=2;function Gn(e){return{id:e?.id,title:e?.title,code:e?.html,preheader:e?.preheader,subject:e?.subject,common_styles:e?.common_styles,autosave:!0}}function Li({email:e,documentSession:t,save:r,saveState:o}){const a=n.useDispatch(),{__:i}=n.useI18n(),s=n.useEditorProjectId(),c=+s,u=Number.isFinite(c)&&c>0?c:e?.project,p=n.useCookieManager(),f=n.useContainer(),g=n.useNotification(),y=n.useAppConfig(),l=n.useConfigSource(),[v,w]=(0,m.useState)(0),A=(0,m.useRef)(""),[P,M]=(0,m.useState)(!1),O=n.useEventEmitter(d.events.ON_NEXTBUTTON_CLICK_ID),D=n.useEventEmitter(d.events.ON_SAVEBUTTON_CLICK_ID);n.useEvent(d.events.ON_EMAIL_INIT_ID);const G=y.activeNextButton===!1,S=y.disableDoubleClickNextButton!==!1,T=(0,m.useRef)(!1),Y=(0,m.useRef)(void 0),H=(0,m.useRef)(null),ie=(0,m.useRef)(null),oe=(0,m.useRef)(e);oe.current=e;const ee=(0,m.useRef)(t);ee.current=t;const me=(0,m.useCallback)(()=>{Y.current=void 0},[]),te=(0,m.useCallback)(_=>{l.merge({activeNextButton:!_},"user")},[l]),K=(0,m.useCallback)((_,b)=>{const C=n.saveRefusalReason(b);if(C==="locked"){g.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:n.getEmailDesc(_),message:i("No access to edit the letter.")});return}if(C==="empty-content"){g.error({id:"EMAIL_EMPTY_SAVE_BLOCKED",data:n.getEmailDesc(_),message:i("The email content is empty — saving was cancelled to prevent data loss.")});return}if(C==="too-many-tags"){g.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:n.getEmailDesc(_),message:i("Maximum 10 tags available.")});return}if(C==="canvas-not-synced"){g.error({id:"EMAIL_CANVAS_NOT_SYNCED_ERROR",data:n.getEmailDesc(_),message:i("Not all changes were saved. Please try again.")});return}const k=n.failedTerms(b);if(k){k.failed.forEach(R=>{if(k.kind==="group"){g.fromError("GROUP_CREATING_ERROR",{id:R.id??0,name:R.name,parent:R.parent??0},b);return}g.fromError("TAG_CREATING_ERROR",R.name,b)});return}g.fromError(_.isNew?"EMAIL_CREATING_ERROR":"EMAIL_EDITING_ERROR",n.getEmailDesc(_),b)},[g,i]),pe=(0,m.useCallback)(_=>{const b=Oi(_),C=()=>{M(!1),_===Ht&&(T.current=!1,te(!1))};if(!e){C();return}const k=async()=>{(E=>{r("publish",{project:E.isNew?u:E.project,folder:Bn(p.get(n.APP_COOKIES.em_folder)),source:_,fallbackTitle:i("Untitled email.")}).then(j=>{if(M(!1),T.current=!1,!j){_===Ht&&te(!1),b&&(K(E,o().error),me());return}b&&(g.success({id:"EMAIL_SAVING_SUCCESS",message:i("The email was successfully saved."),data:n.getEmailDesc(E)}),me())})})(e)};M(!0),k()},[e,a,s,i,t,p,u,g,K,r,o,te,me]);n.useCommand(n.SAVE_COMMAND_ID,(0,m.useCallback)(_=>pe(_||xi),[pe]));const ve=(0,m.useRef)(void 0),De=(0,m.useRef)(pe);De.current=pe;const ce=(0,m.useCallback)(_=>{A.current=_,w(b=>b+1)},[]);(0,m.useEffect)(()=>()=>{ve.current!==void 0&&clearTimeout(ve.current)},[]),(0,m.useEffect)(()=>{if(v===0)return;const _=A.current;oe.current?.isNew&&(Y.current=_),ve.current!==void 0&&clearTimeout(ve.current),ve.current=setTimeout(()=>{ve.current=void 0,De.current(_)})},[v]);const Se=y.saveHotkeyEnabled!==!1,Q=(0,m.useCallback)(_=>{(_.ctrlKey||_.metaKey)&&_.keyCode===83&&(_.preventDefault(),Se&&ce(qr))},[ce,Se]);(0,m.useEffect)(()=>(document.addEventListener("keydown",Q),()=>{document.removeEventListener("keydown",Q)}),[Q]);const be=(0,m.useCallback)(_=>{const b=_.data.operation,C=_.data.action;b===n.EVENT_TYPES.APPLICATION_ACTION&&C==="save_email"&&Se&&ce(qr)},[ce,Se]);n.useListenPostMessage(be),(0,m.useEffect)(()=>{e?.isNew&&(ie.current=null,H.current=null)},[e?.isNew,e?.renderGuid]),(0,m.useEffect)(()=>{T.current=!1},[e?.id]);const ne=p.get(n.APP_COOKIES.em_folder),Ne=f?n.provideAutosaveUiFacts(f):void 0;(0,m.useEffect)(()=>{Ne?.set({...Ne?.get()??{isUserBusy:!1,saveContext:{}},saveContext:{project:u,folder:Bn(ne),fallbackTitle:i("Untitled email.")}})},[Ne,u,ne,i]);const Ie=(0,m.useRef)(!1),we=o().failures,le=o().failedIntent,W=n.useIntegratorConfigValue("autosaveRetryMaxAttempts"),ue=typeof W=="number"&&W>=0?W+1:ji;(0,m.useEffect)(()=>{const _=o().error;(le==="snapshot"||le==="materialize")&&!Ie.current&&(we>=ue||we>0&&n.isIntegratorRejection(_))&&(Ie.current=!0,g.error({id:"EMAIL_AUTOSAVE_ERROR",data:Gn(e),message:i("Saving failed"),description:n.isRejectedSave(_)?i("Changes are not being saved: the save was rejected."):i("Changes are not being saved. Check your connection."),innerException:_,duration:0})),we===0&&(Ie.current=!1)},[we,le,ue,o,e,g,i]);const Z=n.getOpenEmailDocuments(f??void 0);(0,m.useEffect)(()=>Z?.onSaved(_=>{_.intent==="snapshot"&&g.success({id:"EMAIL_AUTOSAVE_SUCCESS",data:{...Gn(oe.current),code:ee.current?.getContent()},message:""},!0)}),[Z,g]);const ke=P,Ve=o().saving,Ye=(0,m.useCallback)(_=>{ce(_||Gr)},[ce]),Pe=(0,m.useCallback)(async(_,b)=>{if(_===Ht){if(T.current)return;T.current=!0;try{S&&te(!0),(await O.fire(b)).every(C=>C!==!1)?ce(Ht):(te(!1),T.current=!1)}catch(C){g.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",n.getEmailDesc(b),C,!0),te(!1),T.current=!1}return}try{(await D.fire(b)).every(C=>C!==!1)&&ce(_||Gr)}catch(C){g.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",n.getEmailDesc(b),C,!0)}},[S,O,D,g,te,ce]);return(0,m.useMemo)(()=>({requestSave:Ye,requestSaveWithEvents:Pe,isLoading:ke,isAutosaveLoading:Ve,nextButtonDisabled:G}),[Ye,Pe,ke,Ve,G])}var Di="NEXT_BUTTON",Ni="SAVE_BUTTON",qn=({email:e=null,disabled:t})=>{const{__:r}=n.useI18n(),o=n.useAppConfig(),a=n.useContentReader(),i=n.useNotification(),{requestSaveWithEvents:s,isLoading:c,nextButtonDisabled:u}=Mi(),[p,f]=(0,m.useState)(null);(0,m.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&f(!0)},[]);const g=o.saveButtonEnabled&&(0,h.jsx)(I.ui_kit$Tooltip,{title:r(p?"Save by ⌘S":"Save by Ctrl+S"),placement:"bottom",children:(0,h.jsx)("span",{className:"em-analytics__email-save-tooltip-target",children:(0,h.jsx)(I.ui_kit$Button,{disabled:t,type:o.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:c,icon:(0,h.jsx)(n.EmIcons,{icon:"SaveOutlined",component:I.icons$SaveOutlined,size:16,strokeWidth:o.iconStrokeWidth}),onClick:async l=>{const v=l.currentTarget,w={...e,html:a()};try{await s(Ni,w)}catch(A){i.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",n.getEmailDesc(w),A,!0)}finally{try{v?.blur?.()}catch{}}},children:o.saveButtonText||r("Save")})})},"save-button"),y=o.nextButtonEnabled&&(0,h.jsx)(I.ui_kit$Button,{disabled:t||u,type:"primary",block:"false",className:"em-analytics__email-save",icon:o.primaryCommandButtonIcon,loading:c,onClick:async()=>{const l={...e,html:a()};await s(Di,l)},children:o.nextButtonText||r("Continue")},"next-button");return(0,h.jsx)(h.Fragment,{children:o.saveButtonEnabled&&o.nextButtonEnabled?(0,h.jsx)(I.ui_kit$Space,{children:[g,y]}):[g,y]})};qn.propTypes={email:ze.default.shape({id:ze.default.string,isNew:ze.default.bool,title:ze.default.string,lock:ze.default.bool,subject:ze.default.string,html:ze.default.string,description:ze.default.string,utm_parameters:ze.default.shape({utm_source:ze.default.string,utm_medium:ze.default.string,utm_campaign:ze.default.string,utm_term:ze.default.string,utm_content:ze.default.string}),project:ze.default.number,is_template:ze.default.bool}),disabled:ze.default.bool};var Fi=({open:e,codeSize:t,onMinimize:r,onDownloadAsIs:o,onCancel:a})=>{const{__:i}=n.useI18n(),s=n.formatCodeSize(t);return(0,h.jsx)(I.ui_kit$Modal,{open:e,onCancel:a,footer:null,className:"code-size-warning-modal",width:480,children:(0,h.jsxs)("div",{className:"code-size-warning-modal__content",children:[(0,h.jsx)("h3",{className:"code-size-warning-modal__title",children:i("Code Size Warning")}),(0,h.jsxs)("div",{className:"code-size-warning-modal__message",children:[(0,h.jsxs)("p",{children:[i("The current code size is")," ",(0,h.jsx)("strong",{children:s}),","," ",i("which exceeds the recommended 90 KB limit.")]}),(0,h.jsx)("p",{children:i("Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.")})]}),(0,h.jsxs)(I.ui_kit$Space,{className:"code-size-warning-modal__actions",size:"medium",children:[(0,h.jsx)(I.ui_kit$Button,{type:"primary",onClick:r,size:"large",children:i("Minimize code")}),(0,h.jsx)(I.ui_kit$Button,{onClick:o,size:"large",children:i("Download as is")})]})]})})};function Ui(e){return e.includes("em-narrow-table")}function Bi(e){if(!e||Ui(e))return!1;const t=e.includes("nl-container"),r=/row-content\s+stack/.test(e)||/stack\s+row-content/.test(e),o=/\brow-\d/.test(e),a=/_block\s+block-\d/.test(e),i=e.includes('role="presentation"');return t&&r&&(o||a)&&i}function $i(e){return e?e.includes("em-narrow-table"):!1}function Gi(e){return e.includes("em-narrow-table")}function qi(e){return e.includes("i-amphtml")||e.includes("amp-runtime")||e.includes("amp-version")}function Hi(e){if(!e||Gi(e)||qi(e))return!1;const t=e.includes("es-wrapper"),r=/es-(?:header|content|footer)-body/.test(e);return t||r}function Hn(){n.useAppConfig();const e=n.useIntegratorConfigValue("beeFreeConverterEnabled"),t=n.useIntegratorConfigValue("stripoConverterEnabled"),r=n.useIntegratorConfigValue("aiLayoutConverterEnabled"),o=e===!0,a=t===!0,i=r===!0;return{beeFreeConverterEnabled:o,stripoConverterEnabled:a,aiLayoutConverterEnabled:i,anyConverterEnabled:o||a||i}}function zn(e,t){return!e||$i(e)?null:Bi(e)?t.beeFreeConverterEnabled?"beefree":null:Hi(e)?t.stripoConverterEnabled?"stripo":null:t.aiLayoutConverterEnabled?"ai":null}var zi=()=>"emailmaker",Vi={unisender:{id:"unisender",name:"Unisender",icon:"/images/integrations/unisender.svg",description:"Export emails to Unisender",cardDescription:"Mass mailing automation, audience segmentation, and campaign performance analytics.",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Unisender API key",helpUrl:"https://app.unisender.com/ru/v5/cp/user/info/api"},{name:"sender_email",type:"email",label:"Sender Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Unisender"},{name:"sender_name",type:"text",label:"Sender Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"number",label:"Contact List ID",required:!0,placeholder:"e.g., 123456"}]},mailganer:{id:"mailganer",name:"Mailganer",icon:"/images/integrations/mailganer.svg",description:"Export emails to Mailganer",cardDescription:"Contact sync, content personalization, and real-time campaign results tracking.",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Mailganer API key",helpUrl:"https://mailganer.com/app/profile/"},{name:"from_email",type:"email",label:"Sender Email",required:!1,placeholder:"sender@example.com",extra:"This email must be verified in Mailganer"},{name:"from_name",type:"text",label:"Sender Name",required:!1,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Mailing Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"theme",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},sendsay:{id:"sendsay",name:"Sendsay",icon:"/images/integrations/sendsay.svg",description:"Export emails to Sendsay",cardDescription:"Mailing automation, audience segmentation, and email personalization.",apps:["emailmaker"],settingsFields:[{name:"login",type:"text",label:"Account Login",required:!0,placeholder:"e.g., myaccount or myaccount/sublogin",extra:"Your Sendsay account login (not email). For sublogin use format: account/sublogin",fullWidth:!0},{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Sendsay API key",helpUrl:"https://docs.sendsay.ru/sendsay-api/how-to-get-apikey"},{name:"from_email",type:"email",label:"Sender Email",required:!1,placeholder:"sender@example.com",extra:"This email must be verified in Sendsay"},{name:"from_name",type:"text",label:"Sender Name",required:!1,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Draft Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!0,placeholder:"e.g., Special offer for you!"}]},klaviyo:{id:"klaviyo",name:"Klaviyo",icon:"/images/integrations/klaviyo.svg",description:"Export emails to Klaviyo",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"e.g., pk_xxxxxxxx",helpUrl:"https://help.klaviyo.com/hc/en-us/articles/7423954176283-How-to-create-a-private-API-key",extra:"Use a custom key with templates:write and campaigns:write (or Full access). Campaigns-only is not enough — export creates a template first."},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Klaviyo"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., ABC123",helpText:"Find your List ID in Klaviyo: Lists & Segments → List → Settings"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},campaign_monitor:{id:"campaign_monitor",name:"Campaign Monitor",icon:"/images/integrations/campaign_monitor.svg",description:"Export emails to Campaign Monitor",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://help.campaignmonitor.com/s/article/api-keys"},{name:"client_id",type:"text",label:"Client ID",required:!0,placeholder:"e.g., 4a397ccaaa55eb4e6aa1221e1e2d7122",helpText:"Find in Account Settings → API Keys"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Campaign Monitor"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",helpText:"Find in Lists → List ID"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},constant_contact:{id:"constant_contact",name:"Constant Contact",icon:"/images/integrations/constant_contact.svg",description:"Export emails to Constant Contact",apps:["useblocks"],settingsFields:[{name:"access_token",type:"password",label:"Access Token",required:!0,placeholder:"OAuth2 Bearer token",fullWidth:!0,helpText:"Get from Constant Contact Developer Portal. Token expires in 24 hours.",helpUrl:"https://developer.constantcontact.com/api_guide/getting_started.html"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be confirmed in Constant Contact"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"text",label:"Contact List ID",required:!0,placeholder:"e.g., fa32f620-6d82-11e8-8b59-fa163e56c9b0",helpText:"Find via GET /contact_lists API"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},bento:{id:"bento",name:"Bento",icon:"/images/integrations/bento.svg",description:"Export emails to Bento",apps:["useblocks"],settingsFields:[{name:"publishable_key",type:"password",label:"Publishable Key",required:!0,placeholder:"Enter Publishable Key",fullWidth:!0,helpUrl:"https://app.bentonow.com/account/teams"},{name:"secret_key",type:"password",label:"Secret Key",required:!0,placeholder:"Enter Secret Key",fullWidth:!0},{name:"site_uuid",type:"text",label:"Site UUID",required:!0,placeholder:"Your site UUID",helpText:"Find in Bento dashboard"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be an author in your Bento account"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Broadcast Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"},{name:"inclusive_tags",type:"text",label:"Tags (inclusive)",required:!1,placeholder:"e.g., subscribers,newsletter",helpText:"Comma-separated tags to send to. Default: subscribers"}]},dotdigital:{id:"dotdigital",name:"Dotdigital",icon:"/images/integrations/dotdigital.svg",description:"Export emails to Dotdigital",apps:["useblocks"],settingsFields:[{name:"username",type:"text",label:"API Username",required:!0,placeholder:"API user email",helpText:"API user email from Settings → Access → API users",helpUrl:"https://developer.dotdigital.com/docs/setting-up-an-api-user"},{name:"password",type:"password",label:"API Password",required:!0,placeholder:"API user password",fullWidth:!0},{name:"region",type:"text",label:"Region",required:!0,placeholder:"r1, r2, or r3",helpText:"r1=Europe, r2=North America, r3=Asia Pacific"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",fullWidth:!0,extra:"Use an email registered as a Custom from address in Dotdigital (see support.dotdigital.com — “Create a custom from address”). If it does not match, export uses your account default sender."},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},getresponse:{id:"getresponse",name:"GetResponse",icon:"/images/integrations/getresponse.svg",description:"Export emails to GetResponse",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://app.getresponse.com/api"},{name:"from_field_id",type:"text",label:"From Field ID",required:!0,placeholder:"e.g., V",helpText:"Find via GET /from-fields API"}],exportFields:[{name:"name",type:"text",label:"Newsletter Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"campaign_id",type:"text",label:"Campaign ID",required:!0,placeholder:"e.g., C",helpText:"List/campaign ID from GET /campaigns"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},brevo:{id:"brevo",name:"Brevo",icon:"/images/integrations/brevo.svg",description:"Export emails to Brevo",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://help.brevo.com/hc/en-us/articles/209467485-Create-and-manage-your-API-keys"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Brevo"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"number",label:"List ID",required:!0,placeholder:"e.g., 2",helpText:"Find in Contacts → Lists"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},activecampaign:{id:"activecampaign",name:"ActiveCampaign",icon:"/images/integrations/activecampaign.svg",description:"Export emails as draft campaigns to ActiveCampaign",apps:["useblocks"],settingsFields:[{name:"api_url",type:"text",label:"API URL",required:!0,placeholder:"e.g., https://youraccount.api-us1.com",helpText:"Find in Settings → Developer → API Access",helpUrl:"https://help.activecampaign.com/hc/en-us/articles/207317590-Getting-started-with-the-API"},{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0},{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., 1",extra:"Find in Lists → Click your list → The ID is in the URL (e.g., /app/contacts?listid=1)"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in ActiveCampaign"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},salesforce_mc:{id:"salesforce_mc",name:"Salesforce",icon:"/images/integrations/salesforce.svg",description:"Export emails to Salesforce",apps:["useblocks"],settingsFields:[{name:"subdomain",type:"text",label:"Tenant Subdomain",required:!0,placeholder:"e.g., mc563885gzs27c5t9-63k636ttgm",helpText:"Find in Installed Packages → API Integration → REST Base URI",helpUrl:"https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/your-subdomain-tenant-specific-endpoints.html"},{name:"client_id",type:"text",label:"Client ID",required:!0,placeholder:"From Installed Package"},{name:"client_secret",type:"password",label:"Client Secret",required:!0,placeholder:"From Installed Package"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Marketing Cloud"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Email Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},hubspot:{id:"hubspot",name:"HubSpot Email",icon:"/images/integrations/hubspot.svg",description:"Export emails to HubSpot",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"Private App Access Token",required:!0,placeholder:"e.g., pat-na1-xxxx",helpUrl:"https://developers.hubspot.com/docs/api/private-apps"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in HubSpot"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Email Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},mailchimp:{id:"mailchimp",name:"Mailchimp",icon:"/images/integrations/mailchimp.svg",description:"Export emails to Mailchimp",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"e.g., xxxxxxxx-us1",helpUrl:"https://mailchimp.com/help/about-api-keys/"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Mailchimp"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"text",label:"Audience ID",required:!0,placeholder:"e.g., a1b2c3d4e5",helpText:"Find your Audience ID in Audience settings → Audience name and defaults"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},enkod:{id:"enkod",name:"enKod",icon:"/images/integrations/enkod.svg",description:"Export emails to enKod",cardDescription:"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter enKod API key",helpUrl:"https://help.enkod.io/doku.php/api:start"},{name:"sender_email",type:"email",label:"Sender Email",required:!0,placeholder:"sender@example.com"},{name:"sender_name",type:"text",label:"Sender Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"subject",type:"text",label:"Email Subject",required:!0,placeholder:"e.g., Special offer for you!"}]}},Wi=(e,t)=>!e.apps||e.apps.length===0?!0:e.apps.includes(t),Hr=e=>{const t=Vi[e];if(t&&Wi(t,zi()))return t},Ki=(e,t)=>{const r={placeholder:e.placeholder?t(e.placeholder):void 0,style:{width:"100%"}};switch(e.type){case"number":return(0,h.jsx)(I.ui_kit$InputNumber,{...r,min:1});case"email":return(0,h.jsx)(I.ui_kit$Input,{...r,type:"email"});default:return(0,h.jsx)(I.ui_kit$Input,{...r})}},Yi=({integration:e,visible:t,loading:r=!1,onConfirm:o,onCancel:a,__:i})=>{const[s]=I.ui_kit$Form.useForm(),c=e.exportFields||[];(0,m.useEffect)(()=>{t||s.resetFields()},[t,s]);const u=()=>{r||s.validateFields().then(g=>{o(g)})},p=()=>{s.resetFields(),a()};if(c.length===0)return null;const f=c.find(g=>g.helpText);return(0,h.jsxs)(I.ui_kit$Modal,{title:i(`Export to ${e.name}`),open:t,onOk:u,onCancel:p,okText:i("Export"),cancelText:i("Cancel"),confirmLoading:r,cancelButtonProps:{disabled:r},children:[f&&(0,h.jsx)(I.ui_kit$Alert,{title:i(f.label),description:i(f.helpText),type:"info",showIcon:!0,style:{marginBottom:16}}),(0,h.jsx)(I.ui_kit$Form,{form:s,layout:"vertical",children:c.map(g=>(0,h.jsx)(I.ui_kit$Form.Item,{label:i(g.label),name:g.name,rules:[...g.required?[{required:!0,message:i(`Please enter ${g.label.toLowerCase()}`)}]:[],...g.type==="number"?[{type:"number",message:i(`${g.label} must be a number`)}]:[]],children:Ki(g,i)},g.name))})]})},Zt=n.createApi({reducerPath:"unisenderApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmailMessage:e.mutation({query:t=>{const r="https://api.unisender.com/ru/api/createEmailMessage",o=new URLSearchParams;return o.append("format","json"),Object.entries(t).forEach(([a,i])=>{o.append(a,String(i))}),{url:`?proxy_url=${encodeURIComponent(r)}`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o.toString()}}})})}),{useCreateEmailMessageMutation:Qi}=Zt,er=n.createApi({reducerPath:"mailganerApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://mailganer.com"}),endpoints:e=>({createMailing:e.mutation({query:t=>{const r=new URLSearchParams;return r.append("api_key",t.api_key),r.append("name",t.name),r.append("html-content",t.html_content),t.theme&&r.append("theme",t.theme),t.from_name&&r.append("from_name",t.from_name),t.from_email&&r.append("from_email",t.from_email),t.segment_id&&r.append("segment_id",String(t.segment_id)),t.utm_campaign&&r.append("utm_campaign",t.utm_campaign),t.utm_source&&r.append("utm_source",t.utm_source),t.utm_medium&&r.append("utm_medium",t.utm_medium),{url:"/api/v1/mailing/create/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()}}})})}),{useCreateMailingMutation:Ji}=er,tr=n.createApi({reducerPath:"sendsayApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://api.sendsay.ru"}),endpoints:e=>({createDraft:e.mutation({query:t=>{const r={action:"issue.draft.set",apikey:t.api_key,return_fresh_obj:1,obj:{name:t.name,letter:{subject:t.subject,"from.name":t.from_name||void 0,"from.email":t.from_email||void 0,message:{html:t.html_content}}}};return{url:`/general/api/v100/json/${t.login.split("/").map(o=>encodeURIComponent(o)).join("/")}`,method:"POST",headers:{"Content-Type":"application/json"},body:r}}})})}),{useCreateDraftMutation:Xi}=tr,rr=n.createApi({reducerPath:"altcraftApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({addTemplate:e.mutation({query:t=>{const r=`${t.api_url}/api/v1.1/templates/add`,o={token:t.api_key,name:t.name,channels:[{sid:"email",fields:{html:t.html_content,text:"",subject:t.subject||t.name,from_email:t.from_email||"",from_name:t.from_name||"",replyto_email:"",replyto_name:"",is_not_inline:!0}}],is_draft:t.is_draft??!1};return{url:`?proxy_url=${encodeURIComponent(r)}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}}})})}),{useAddTemplateMutation:Zi}=rr,es=e=>e.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/\s+/g," ").trim(),nr=n.createApi({reducerPath:"enkodApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://api.enkod.ru"}),endpoints:e=>({createMessage:e.mutation({query:t=>{const r=es(t.html_content)||t.subject,o={message:{subject:t.subject,fromEmail:t.sender_email||"",fromName:t.sender_name||"",html:t.html_content,plainText:r},isDraft:!0};return{url:"/v1/message/onetime/",method:"POST",headers:{"Content-Type":"application/json",Apikey:t.api_key},body:o}}})})}),{useCreateMessageMutation:ts}=nr,rs=e=>{const t=e.split("-");return t.length>1?t[1]:"us1"},ns=e=>`https://${rs(e)}.api.mailchimp.com/3.0`,or=n.createApi({reducerPath:"mailchimpApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,r,o,a)=>{const i=ns(t.api_key),s=btoa(`anystring:${t.api_key}`),c={type:"regular",recipients:{list_id:t.list_id},settings:{subject_line:t.subject,from_name:t.from_name,reply_to:t.from_email}},u=await a({url:`?proxy_url=${encodeURIComponent(`${i}/campaigns`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Basic ${s}`},body:JSON.stringify(c)});if(u.error){const y=u.error,l=y?.data?.detail||y?.error||String(u.error),v=y?.data?.errors;return{error:{status:"CUSTOM_ERROR",error:v?.length?v.map(w=>w.detail||w.title).join("; "):l}}}const p=u.data;if(!p?.id)return{error:{status:"CUSTOM_ERROR",error:u.data?.errors?.map(y=>y.detail||y.title).join("; ")||"Failed to create campaign"}};const f={html:t.html},g=await a({url:`?proxy_url=${encodeURIComponent(`${i}/campaigns/${p.id}/content`)}`,method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Basic ${s}`},body:JSON.stringify(f)});if(g.error){const y=g.error;return{error:{status:"CUSTOM_ERROR",error:y?.data?.detail||y?.error||String(g.error)}}}return{data:{id:p.id,status:p.status,web_id:p.web_id}}}})})}),{useCreateCampaignMutation:os}=or,zr="https://a.klaviyo.com/api",as="2025-04-15",is=e=>({"Content-Type":"application/json",Accept:"application/json",Authorization:`Klaviyo-API-Key ${e}`,revision:as}),ar=n.createApi({reducerPath:"klaviyoApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,r,o,a)=>{const i=is(t.api_key),s={data:{type:"template",attributes:{name:`Email ${Date.now()}`,editor_type:"CODE",html:t.html}}},c=await a({url:`?proxy_url=${encodeURIComponent(`${zr}/templates`)}`,method:"POST",headers:i,body:JSON.stringify(s)});if(c.error){const A=c.error,P=A?.data?.errors,M=A?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:P?.length?P.map(O=>O.detail||O.status).join("; "):M||A?.error||String(c.error)}}}const u=c.data?.data?.id;if(!u)return{error:{status:"CUSTOM_ERROR",error:"Failed to create template"}};const p={data:{type:"campaign",attributes:{name:`Campaign ${Date.now()}`,audiences:{included:[t.list_id],excluded:[]},send_strategy:{method:"immediate"},"campaign-messages":{data:[{type:"campaign-message",attributes:{definition:{channel:"email",label:t.subject,content:{subject:t.subject,from_email:t.from_email,from_label:t.from_name,reply_to_email:t.from_email}}}}]}}}},f=await a({url:`?proxy_url=${encodeURIComponent(`${zr}/campaigns`)}`,method:"POST",headers:i,body:JSON.stringify(p)});if(f.error){const A=f.error,P=A?.data?.errors,M=A?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:P?.length?P.map(O=>O.detail||O.status).join("; "):M||A?.error||String(f.error)}}}const g=f.data,y=g?.data?.relationships?.["campaign-messages"]?.data?.[0]?.id,l=g?.data?.id;if(!y)return{error:{status:"CUSTOM_ERROR",error:"Failed to get campaign message from campaign"}};const v={data:{type:"campaign-message",id:y,relationships:{template:{data:{type:"template",id:u}}}}},w=await a({url:`?proxy_url=${encodeURIComponent(`${zr}/campaign-message-assign-template`)}`,method:"POST",headers:i,body:JSON.stringify(v)});if(w.error){const A=w.error,P=A?.data?.errors,M=A?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:P?.length?P.map(O=>O.detail||O.status).join("; "):M||A?.error||String(w.error)}}}return{data:{id:l,campaign_message_id:y}}}})})}),{useCreateCampaignMutation:ss}=ar,cs="https://api.hubapi.com",ls=e=>({"Content-Type":"application/json",Authorization:`Bearer ${e}`}),ir=n.createApi({reducerPath:"hubspotApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmail:e.mutation({queryFn:async(t,r,o,a)=>{const i=ls(t.api_key),s={name:t.name,subject:t.subject,from:{fromName:t.from_name,replyTo:t.from_email},content:{templatePath:"@hubspot/email/dnd/plain_text.html",widgets:{"module-0-1-1":{body:{html:t.html,path:"@hubspot/rich_text",schema_version:2},child_css:{},css:{},id:"module-0-1-1",name:"module-0-1-1",order:2,styles:{},type:"module"},"module-1-1-1":{body:{align:"center",path:"@hubspot/email_footer",schema_version:2,unsubscribe_link_type:"both"},child_css:{},css:{},id:"module-1-1-1",name:"module-1-1-1",order:3,styles:{},type:"module"}}}},c=await a({url:`?proxy_url=${encodeURIComponent(`${cs}/marketing/v3/emails/`)}`,method:"POST",headers:i,body:JSON.stringify(s)});if(c.error){const p=c.error,f=p?.data?.errors,g=p?.data?.message;return{error:{status:"CUSTOM_ERROR",error:f?.length?f.map(y=>y.message||y.errorType).join("; "):g||p?.error||String(c.error)}}}const u=c.data;return u?.id?{data:{id:u.id}}:{error:{status:"CUSTOM_ERROR",error:c.data?.errors?.map(p=>p.message||p.errorType).join("; ")||"Failed to create email"}}}})})}),{useCreateEmailMutation:ds}=ir,sr=n.createApi({reducerPath:"salesforceMcApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmail:e.mutation({queryFn:async(t,r,o,a)=>{const i=`https://${t.subdomain}.auth.marketingcloudapis.com/v2/token`,s=await a({url:`?proxy_url=${encodeURIComponent(i)}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:t.client_id,client_secret:t.client_secret})});if(s.error){const l=s.error;return{error:{status:"CUSTOM_ERROR",error:l?.data?.error_description||l?.data?.error||l?.error||String(s.error)}}}const c=s.data,u=c?.access_token,p=c?.rest_instance_url;if(!u||!p)return{error:{status:"CUSTOM_ERROR",error:c?.error_description||c?.error||"Failed to get access token"}};const f={name:t.name,assetType:{id:208,name:"htmlemail"},views:{html:{content:t.html},text:{},subjectline:{content:t.subject},preheader:{}},data:{email:{options:{characterEncoding:"utf-8"}}}},g=await a({url:`?proxy_url=${encodeURIComponent(`${p.replace(/\/$/,"")}/asset/v1/content/assets`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify(f)});if(g.error){const l=g.error,v=l?.data?.errors,w=l?.data?.message;return{error:{status:"CUSTOM_ERROR",error:v?.length?v.map(A=>A.message||A.documentation).join("; "):w||l?.error||String(g.error)}}}const y=g.data;return y?.id?{data:{id:y.id}}:{error:{status:"CUSTOM_ERROR",error:g.data?.errors?.map(l=>l.message).join("; ")||"Failed to create email"}}}})})}),{useCreateEmailMutation:us}=sr,ps=e=>e.replace(/\/$/,""),ms=e=>e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim()||" ",cr=n.createApi({reducerPath:"activecampaignApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,r,o,a)=>{const i=ps(t.api_url),s=t.api_key,c={"Content-Type":"application/json","Api-Token":s},u=await a({url:`?proxy_url=${encodeURIComponent(`${i}/api/3/addresses`)}`,method:"GET",headers:{"Api-Token":s}});if(u.error)return{error:{status:"CUSTOM_ERROR",error:"Failed to load mailing addresses. Check your API URL and Key."}};const p=u.data?.addresses??[],f=p.find(O=>O.isDefault==="1")??p[0];if(!f?.id)return{error:{status:"CUSTOM_ERROR",error:"NO_MAILING_ADDRESS"}};const g={message:{name:t.name,fromname:t.from_name,fromemail:t.from_email,email:t.from_email,reply2:t.from_email,subject:t.subject,html:t.html,text:ms(t.html),preheader_text:"",format:"mime"}},y=await a({url:`?proxy_url=${encodeURIComponent(`${i}/api/3/messages`)}`,method:"POST",headers:c,body:JSON.stringify(g)});if(y.error){const O=y.error;return{error:{status:"CUSTOM_ERROR",error:O?.data?.message||O?.error||"Failed to create message."}}}const l=y.data?.message?.id;if(!l)return{error:{status:"CUSTOM_ERROR",error:"Message created but no ID returned."}};const v=`${i}/admin/api.php?api_action=campaign_create&api_output=json`,w=new URLSearchParams;w.append("type","single"),w.append("name",t.name),w.append("sdate","2099-12-31 12:00:00"),w.append("status","0"),w.append("public","1"),w.append("trackreads","1"),w.append("tracklinks","all"),w.append("htmlunsub","1"),w.append("textunsub","1"),w.append("addressid",String(f.id)),w.append(`p[${t.list_id}]`,t.list_id),w.append(`m[${l}]`,"100");const A=await a({url:`?proxy_url=${encodeURIComponent(v)}`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","Api-Token":s},body:w.toString()});if(A.error){const O=A.error;return{error:{status:"CUSTOM_ERROR",error:O?.data?.result_message||O?.error||"Message created, but campaign creation failed."}}}const P=A.data;if(Number(P?.result_code)===0)return{error:{status:"CUSTOM_ERROR",error:P?.result_message||"Campaign creation failed (v1 API)."}};const M=P?.id;return M?{data:{campaignId:String(M)}}:{error:{status:"CUSTOM_ERROR",error:P?.result_message||"Campaign created but no ID returned."}}}})})}),{useCreateCampaignMutation:fs}=cr,gs="https://api.brevo.com/v3",lr=n.createApi({reducerPath:"brevoApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,r,o,a)=>{const i={name:t.name,subject:t.subject,sender:{name:t.from_name,email:t.from_email},htmlContent:t.html,recipients:{listIds:[t.list_id]}},s=await a({url:`?proxy_url=${encodeURIComponent(`${gs}/emailCampaigns`)}`,method:"POST",headers:{"Content-Type":"application/json","api-key":t.api_key},body:JSON.stringify(i)});if(s.error){const u=s.error;return{error:{status:"CUSTOM_ERROR",error:u?.data?.message||u?.data?.code||u?.error||String(s.error)}}}const c=s.data;return c?.id?{data:{id:c.id}}:{error:{status:"CUSTOM_ERROR",error:s.data?.message||"Failed to create campaign"}}}})})}),{useCreateCampaignMutation:hs}=lr,ys="https://api.createsend.com/api/v3.3",vs=e=>`Basic ${btoa(`${e}:x`)}`,dr=n.createApi({reducerPath:"campaignMonitorApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,r,o,a)=>{const i={Name:t.name,Subject:t.subject,FromName:t.from_name,FromEmail:t.from_email,ReplyTo:t.from_email,HtmlUrl:t.html_url,ListIDs:[t.list_id],InlineCss:!0},s=await a({url:`?proxy_url=${encodeURIComponent(`${ys}/campaigns/${t.client_id}.json`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:vs(t.api_key)},body:JSON.stringify(i)});if(s.error){const p=s.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.Message||p?.error||String(s.error)}}}const c=s.data,u=typeof c=="string"?c:c?.id;return!u||typeof u!="string"?{error:{status:"CUSTOM_ERROR",error:c?.Message||"Failed to create campaign"}}:{data:{id:u}}}})})}),{useCreateCampaignMutation:_s}=dr,Vn="https://api.cc.email/v3",bs=e=>e.includes("[[trackingImage]]")?e:e.replace(/<body([^>]*)>/i,"<body$1>[[trackingImage]]"),ur=n.createApi({reducerPath:"constantContactApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,r,o,a)=>{const i=bs(t.html),s={name:t.name,email_campaign_activities:[{format_type:5,from_email:t.from_email,reply_to_email:t.from_email,from_name:t.from_name,subject:t.subject,html_content:i}]},c=await a({url:`?proxy_url=${encodeURIComponent(`${Vn}/emails`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify(s)});if(c.error){const l=c.error;return{error:{status:"CUSTOM_ERROR",error:l?.data?.error_message||l?.data?.error_key||l?.error||String(c.error)}}}const u=c.data,p=u?.campaign_activities?.find(l=>l.role==="primary_email")?.campaign_activity_id,f=u?.campaign_id;if(!p||!f)return{error:{status:"CUSTOM_ERROR",error:"Failed to create campaign"}};const g={campaign_activity_id:p,campaign_id:f,role:"primary_email",contact_list_ids:[t.list_id],segment_ids:[],current_status:"DRAFT",format_type:5,from_email:t.from_email,from_name:t.from_name,reply_to_email:t.from_email,subject:t.subject,html_content:i},y=await a({url:`?proxy_url=${encodeURIComponent(`${Vn}/emails/activities/${p}`)}`,method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify(g)});if(y.error){const l=y.error;return{error:{status:"CUSTOM_ERROR",error:l?.data?.error_message||l?.data?.error_key||l?.error||String(y.error)}}}return{data:{campaign_id:f}}}})})}),{useCreateCampaignMutation:Es}=ur,Ss="https://api.getresponse.com/v3",ws=e=>`api-key ${e}`,pr=n.createApi({reducerPath:"getresponseApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createNewsletter:e.mutation({queryFn:async(t,r,o,a)=>{const i=t.html.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),s={name:t.name,type:"draft",subject:t.subject,fromField:{fromFieldId:t.from_field_id},replyTo:{fromFieldId:t.from_field_id},campaign:{campaignId:t.campaign_id},content:{html:t.html,plain:i||"Newsletter"},flags:["openrate","clicktrack"],sendSettings:{selectedCampaigns:[t.campaign_id]}},c=await a({url:`?proxy_url=${encodeURIComponent(`${Ss}/newsletters`)}`,method:"POST",headers:{"Content-Type":"application/json","X-Auth-Token":ws(t.api_key)},body:JSON.stringify(s)});if(c.error){const p=c.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.message||p?.data?.code||p?.error||String(c.error)}}}const u=c.data;return u?.newsletterId?{data:{newsletterId:u.newsletterId}}:{error:{status:"CUSTOM_ERROR",error:c.data?.message||"Failed to create newsletter"}}}})})}),{useCreateNewsletterMutation:ks}=pr,Cs=e=>`https://${e||"r1"}-api.dotdigital.com/v2`,Wn=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,Kn=e=>e&&typeof e=="object"&&"data"in e&&e.data!==void 0?e.data:e,Yn=e=>e.trim().toLowerCase(),mr=n.createApi({reducerPath:"dotdigitalApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,r,o,a)=>{const i=t.html.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),s=Cs(t.region),c={"Content-Type":"application/json",Authorization:Wn(t.username,t.password)},u=await a({url:`?proxy_url=${encodeURIComponent(`${s}/custom-from-addresses`)}`,method:"GET",headers:{Authorization:Wn(t.username,t.password)}});let p=[];if(!u.error){const A=Kn(u.data);Array.isArray(A)?p=A:A&&typeof A=="object"&&Array.isArray(A.items)&&(p=A.items)}const f=Yn(t.from_email),g=p.find(A=>A.email&&Yn(A.email)===f),y={name:t.name,subject:t.subject,fromName:t.from_name,htmlContent:t.html,plainTextContent:i||"Newsletter"},l=!g?.id;g?.id!=null&&(y.fromAddress={id:g.id});const v=await a({url:`?proxy_url=${encodeURIComponent(`${s}/campaigns`)}`,method:"POST",headers:c,body:JSON.stringify(y)});if(v.error){const A=v.error;return{error:{status:"CUSTOM_ERROR",error:A?.data?.message||A?.error||String(v.error)}}}const w=Kn(v.data);return w?.id?{data:{id:w.id,usedAccountDefaultFromAddress:l}}:{error:{status:"CUSTOM_ERROR",error:v.data?.message||w?.message||"Failed to create campaign"}}}})})}),{useCreateCampaignMutation:As}=mr,Is="https://app.bentonow.com/api/v1",Ts=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,fr=n.createApi({reducerPath:"bentoApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createBroadcast:e.mutation({queryFn:async(t,r,o,a)=>{const i={broadcasts:[{name:t.name,subject:t.subject,content:t.html,type:"raw",from:{email:t.from_email,name:t.from_name},inclusive_tags:t.inclusive_tags||"subscribers",exclusive_tags:"",segment_id:t.segment_id||"",batch_size_per_hour:500,approved:!1}]},s=`${Is}/batch/broadcasts?site_uuid=${encodeURIComponent(t.site_uuid)}`,c=await a({url:`?proxy_url=${encodeURIComponent(s)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:Ts(t.publishable_key,t.secret_key),"User-Agent":"EmailMaker/1.0"},body:JSON.stringify(i)});if(c.error){const u=c.error;return{error:{status:"CUSTOM_ERROR",error:u?.data?.message||u?.error||String(c.error)}}}return{data:{count:c.data?.count??1}}}})})}),{useCreateBroadcastMutation:Ps}=fr,xs=()=>{const{__:e}=n.useI18n(),[t,{isLoading:r}]=Qi(),[o,{isLoading:a}]=Ji(),[i,{isLoading:s}]=Xi(),[c,{isLoading:u}]=Zi(),[p,{isLoading:f}]=ts(),[g,{isLoading:y}]=os(),[l,{isLoading:v}]=ss(),[w,{isLoading:A}]=ds(),[P,{isLoading:M}]=us(),[O,{isLoading:D}]=fs(),[G,{isLoading:S}]=hs(),[T,{isLoading:Y}]=_s(),[H,{isLoading:ie}]=Es(),[oe,{isLoading:ee}]=ks(),[me,{isLoading:te}]=As(),[K,{isLoading:pe}]=Ps(),ve=r||a||s||u||f||y||v||A||M||D||S||Y||ie||ee||te||pe,Pe={unisender:async(b,C,k,R)=>{try{const E=await t({api_key:b.api_key,sender_name:b.sender_name,sender_email:b.sender_email,subject:R,body:k,list_id:C.list_id,generate_text:1,lang:"ru"}).unwrap();return E.result?.message_id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.unisender.com/ru/v5/spa/email-campaign/editor/${E.result.message_id}?step=send`,text:e("Open in Unisender")}}:E.error?{success:!1,error:E.error+(E.code?` (${E.code})`:"")}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create email")}}},mailganer:async(b,C,k,R)=>{try{const E=await o({api_key:b.api_key,name:C.name,html_content:k,theme:C.theme||R,from_name:b.from_name,from_email:b.from_email}).unwrap();return E.status===1&&E.public_id?{success:!0,message:e("Mailing successfully created!"),link:E.step1_url?{url:E.step1_url,text:e("Open in Mailganer")}:void 0}:E.error?{success:!1,error:E.error}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create mailing")}}},sendsay:async(b,C,k,R)=>{try{const E=await i({login:b.login,api_key:b.api_key,name:C.name,subject:C.subject,html_content:k,from_name:b.from_name,from_email:b.from_email}).unwrap();return E.obj?.id?{success:!0,message:e("Draft successfully created!"),link:{url:`https://app.sendsay.ru/content/drafts/email/${E.obj.id}/settings`,text:e("Open in Sendsay")}}:E.errors&&E.errors.length>0?{success:!1,error:E.errors.map(j=>j.explain).join(", ")}:E.error?{success:!1,error:E.explain||E.error}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create draft")}}},altcraft:async(b,C,k,R)=>{try{const E=await c({api_url:b.api_url,api_key:b.api_key,name:C.name,html_content:k,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email}).unwrap();return E.error===0?{success:!0,message:e("Template successfully created!")}:{success:!1,error:E.error_text||e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create template")}}},enkod:async(b,C,k,R)=>{try{const E=await p({api_key:b.api_key,subject:C.subject,html_content:k,sender_name:b.sender_name,sender_email:b.sender_email}).unwrap();if(E.success||E.messageId||E.id){const j=E.messageId||E.id;return{success:!0,message:e("Draft successfully created!"),link:j?{url:`https://app.enkod.ru/ensend/messages/detail/${j}/preview`,text:e("Open in enKod")}:void 0}}else if(E.error||E.message)return{success:!1,error:E.error||E.message||e("Unknown error")};return{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create draft")}}},mailchimp:async(b,C,k,R)=>{try{const E=await g({api_key:b.api_key,list_id:C.list_id,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email,html:k}).unwrap();if(E.id){const j=b.api_key?.split("-")[1]||"us1";return{success:!0,message:e("Campaign successfully created!"),link:{url:`https://${j}.admin.mailchimp.com/campaigns/#r:campaignId=${E.id}`,text:e("Open in Mailchimp")}}}return{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create campaign")}}},klaviyo:async(b,C,k,R)=>{try{const E=await l({api_key:b.api_key,list_id:C.list_id,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email,html:k}).unwrap();return E.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://www.klaviyo.com/campaign/${E.id}/wizard/1`,text:e("Open in Klaviyo")}}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create campaign")}}},hubspot:async(b,C,k,R)=>{try{const E=await w({api_key:b.api_key,name:C.name,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email,html:k}).unwrap();return E.id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.hubspot.com/email/0/edit/${E.id}`,text:e("Open in HubSpot")}}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create email")}}},salesforce_mc:async(b,C,k,R)=>{try{const E=await P({subdomain:b.subdomain,client_id:b.client_id,client_secret:b.client_secret,name:C.name,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email,html:k}).unwrap();return E.id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.s7.exacttarget.com/ContentBuilder?app=contentbuilder&id=${E.id}`,text:e("Open in Marketing Cloud")}}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create email")}}},activecampaign:async(b,C,k,R)=>{try{const E=await O({api_url:b.api_url,api_key:b.api_key,list_id:b.list_id,name:C.name,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email,html:k}).unwrap();if(E.campaignId){const j=(b.api_url||"").replace(/\/$/,"").match(/https?:\/\/([^.]+)\.api-/),re=j?j[1]:"",Oe=re?`https://${re}.activehosted.com/app/campaigns/${E.campaignId}`:"https://www.activecampaign.com/app/campaigns";return{success:!0,message:e("Draft campaign created! Open it to review and schedule."),link:{url:Oe,text:e("Open draft campaign")}}}return{success:!1,error:e("Unknown error")}}catch(E){const j=E.message||E.error||"";if(j==="NO_MAILING_ADDRESS"){const re=(b.api_url||"").replace(/\/$/,"").match(/https?:\/\/([^.]+)\.api-/),Oe=re?re[1]:"",Ee=Oe?`https://${Oe}.activehosted.com/app/settings/addresses`:"https://www.activecampaign.com/app/settings/addresses";return{success:!1,error:e("No mailing address found. Add one in ActiveCampaign: ")+Ee}}return{success:!1,error:j||e("Failed to create campaign")}}},brevo:async(b,C,k,R)=>{try{const E=await G({api_key:b.api_key,list_id:Number(C.list_id),name:C.name,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email,html:k}).unwrap();return E.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://app.brevo.com/marketing-campaign/edit/${E.id}`,text:e("Open in Brevo")}}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create campaign")}}},campaign_monitor:async(b,C,k,R)=>{try{const E=C.html_url?.trim();if(!E)return{success:!1,error:e("HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.")};const j=await T({api_key:b.api_key,client_id:b.client_id,list_id:C.list_id,name:C.name,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email,html_url:E.trim()}).unwrap();return j.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://app.createsend.com/campaigns/#/${j.id}`,text:e("Open in Campaign Monitor")}}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create campaign")}}},constant_contact:async(b,C,k,R)=>{try{return(await H({access_token:b.access_token,list_id:C.list_id,name:C.name,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email,html:k}).unwrap()).campaign_id?{success:!0,message:e("Campaign successfully created!"),link:{url:"https://app.constantcontact.com/pages/email/campaigns",text:e("Open in Constant Contact")}}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create campaign")}}},getresponse:async(b,C,k,R)=>{try{const E=await oe({api_key:b.api_key,from_field_id:b.from_field_id,campaign_id:C.campaign_id,name:C.name,subject:C.subject||R,html:k}).unwrap();return E.newsletterId?{success:!0,message:e("Newsletter successfully created!"),link:{url:`https://app.getresponse.com/letter/${E.newsletterId}`,text:e("Open in GetResponse")}}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create newsletter")}}},dotdigital:async(b,C,k,R)=>{try{const E=await me({username:b.username,password:b.password,region:b.region||"r1",name:C.name,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email,html:k}).unwrap();return E.id?{success:!0,message:E.usedAccountDefaultFromAddress?e("Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it."):e("Campaign successfully created!"),link:{url:"https://login.dotdigital.com/",text:e("Open in Dotdigital")}}:{success:!1,error:e("Unknown error")}}catch(E){return{success:!1,error:E.message||e("Failed to create campaign")}}},bento:async(b,C,k,R)=>{try{return await K({publishable_key:b.publishable_key,secret_key:b.secret_key,site_uuid:b.site_uuid,name:C.name,subject:C.subject||R,from_name:b.from_name,from_email:b.from_email,html:k,inclusive_tags:C.inclusive_tags}).unwrap(),{success:!0,message:e("Broadcast successfully created!"),link:{url:"https://app.bentonow.com/",text:e("Open in Bento")}}}catch(E){return{success:!1,error:E.message||e("Failed to create broadcast")}}}};return{exportToIntegration:async(b,C,k,R,E)=>{const j=Pe[b];return j?j(C,k,R,E):{success:!1,error:e("Unknown integration")}},isLoading:ve}},st={INFO:"info",STORAGE:"storage",STYLES:"styles",MEMBERS:"members",INTEGRATIONS:"integrations",PLUGIN:"plugin"},Xm=st.INFO,Zm=[st.INFO,st.STORAGE,st.STYLES,st.MEMBERS,st.INTEGRATIONS,st.PLUGIN],ef={mainsettings:st.INFO,ftpsettings:st.STORAGE,webhooksettings:st.INTEGRATIONS},Rs=async(e,t,r)=>{try{const{notification:o,...a}=e,i=await n.fetchBaseQuery({baseUrl:"https://racs.emcdn.ru/v3"})(a,t,r);if(i.error)throw new Error;return i}catch(o){return(e?.notification).error(o),{error:o}}},gr=n.createApi({reducerPath:"exportPngApi",baseQuery:Rs,endpoints:e=>({makeTemporaryMailForPng:e.mutation({query:({file:t,title:r,notification:o})=>{const a=new Blob([t],{type:"text/html"}),i=new FormData;return i.append("file",a,"base.html"),i.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:i,notification:o}}}),deleteTemporaryMail:e.mutation({query:({id:t,notification:r})=>({url:`/${t}?resource=exportPngApi`,method:"DELETE",notification:r})})})}),{useMakeTemporaryMailForPngMutation:Os,useDeleteTemporaryMailMutation:Ms}=gr,hr=n.createApi({reducerPath:"webHookApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:t,body:r})=>({url:`?proxy_url=${encodeURIComponent(t)}`,method:"POST",body:r})})})}),{usePostDataByWebHookMutation:js}=hr,Ls=async(e,t,r)=>{try{const{notification:o,...a}=e,i=await n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"})(a,t,r);if(i.error)throw new Error;return i}catch(o){return(e?.notification).error(o),{error:o}}},yr=n.createApi({reducerPath:"htmlToPdfPlusApi",baseQuery:Ls,endpoints:e=>({generateHtmlToPdf:e.mutation({query:({htmlContent:t,notification:r})=>({url:"emails/pdf",method:"POST",body:t,notification:r,responseHandler:o=>o.blob()})})})}),{useGenerateHtmlToPdfMutation:Ds}=yr,vr=n.createApi({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:t,tryFetch:r=!0,type:o},a){const i=n.clientFromApi(a),s=r?fetch(t):Promise.reject(),c=p=>{switch(o){case"json":return p.json();case"text":return p.text();default:return p.blob()}},u=p=>c(p).then(f=>({data:f}));return s.then(p=>u(p)).catch(()=>i.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(t)}}))}})})}),{useGetFileQuery:tf,useLazyGetFileQuery:Ns}=vr,rf="email",nf=100;function Fs(e){return Ze.sanitizeFileName(String(e??"").trim()).slice(0,100).trimEnd()||"email"}function Qn(e){const t=Fs(e);return{archive:`${t}.zip`,desktop:`${t}-desktop.png`,mobile:`${t}-mobile.png`}}function Us(e,t){const r=Qn(e);return{[r.desktop]:t.desktop,[r.mobile]:t.mobile}}var Jn;function Bs(){return Jn??=(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/370f04c3.js")).then(e=>ft.__toESM(e.require_core())),void 0,{}.url),Jn}function $s(e){const t=[0],r=[];let o=0;for(;o<e.length;){const a=e.charCodeAt(o);a===10||a===13?(r.push(o-t[t.length-1]),o+=a===13&&e.charCodeAt(o+1)===10?2:1,t.push(o)):o+=1}return r.push(e.length-t[t.length-1]),{starts:t,lengths:r}}function Xn({starts:e,lengths:t},r,o){const a=Math.min(Math.max(r,1),e.length)-1;return e[a]+Math.min(Math.max(o,1),t[a]+1)-1}var Gs={error:8,warning:4,info:2};function qs(e,t){const r=e.evidence!==""?e.col+e.evidence.length:t.lengths[e.line-1]??e.col+1,o=Math.max(r,e.col);return{severity:Gs[e.type]??8,message:e.message,startLineNumber:e.line,startColumn:e.col,endLineNumber:e.line,endColumn:o,startOffset:Xn(t,e.line,e.col),endOffset:Xn(t,e.line,o)}}async function Zn(e){const{HTMLHint:t}=await Bs(),r=$s(e);return t.verify(e,n.EMAIL_CODE_RULESET).map(o=>qs(o,r))}async function Hs(e,t,r){if(!e.hasListeners())return;const o=await Zn(t);await e.fire({errors:o,fileName:r})}var Vr=()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/ffc6c926.js")).then(e=>e.import_exports),void 0,{}.url),zs=1,Vs=2,Ws=375,ht={fontSize:"16px"},Ks={position:"absolute",bottom:-4,right:-4,borderRadius:"100%",backgroundColor:n.emCssVar("colorBgContainer")},Ys={position:"relative",display:"inline-flex"},yt=({icon:e,locked:t,strokeWidth:r,className:o})=>(0,h.jsxs)("span",{className:o,style:Ys,children:[e,t&&(0,h.jsx)(n.EmIcons,{icon:"Lock",component:I.icons$Lock,size:12,strokeWidth:r,style:Ks})]}),Qs=({email:e,autoSaveBlockResult:t})=>{const{__:r,_x:o}=n.useI18n(),a=n.useDispatch(),i=n.useEmailAttributesWriter(),[s]=Ns(),[c]=n.useUploadImageMutation(),u=n.useAppNavigate(),{owner:p,admin:f}=n.useMyRoles(),g=n.useCurrentUser(),y=n.useProjectData(),{modal:l}=I.ui_kit$App.useApp(),v=n.useNotification(),{confirm:w}=l,A=n.useAppStore(),P=()=>n.getTemplateDirectivesPolicy(d.getContainer(A)).keepWrappedOnOutput,M=(x,U,B,$)=>Ze.prepareHTML(x,U,B,$,P()),O=(x,U,B,$,X,F)=>Ze.getEML(x,U,B,$,X,F,P()),D=(x,U,B,$,X)=>Ze.htmlToFilesData(x,U,B,$,X,P()),G=n.useCookieManager(),S=n.useAppConfig(),T=n.useEditorLocked(),Y=n.useEditorLockCheck(),H=Hn(),ie=n.useEditorProjectId(),oe=n.useEventEmitter(d.events.ON_EMAIL_CLONE_ID),ee=n.useEventEmitter(d.events.ON_BROWSER_EXTENSION_DETECTED_ID),me=n.useEventEmitter(d.events.ON_IMPORT_VALIDATE_ID),[te]=js(),K=!0,{data:pe}=n.useGetProjectIntegrationsQuery(y?.id??0,{skip:K}),{data:ve}=n.useGetProjectWebhookQuery(y?.id??0,{skip:K}),[De]=n.useLazyGetIntegrationCredentialsQuery(),{exportToIntegration:ce,isLoading:Se}=xs(),Q=n.usePushToDataLayer(),[be,ne]=(0,m.useState)(()=>!n.getEditorVisible(d.getContainer(A)).contentShown()),[Ne,Ie]=(0,m.useState)(!1),[we,le]=(0,m.useState)(null),[W,ue]=(0,m.useState)(""),[Z,ke]=(0,m.useState)(!1),[Ve,Ye]=(0,m.useState)(0),[Pe,_]=(0,m.useState)(null),[b,C]=(0,m.useState)(""),[k,R]=(0,m.useState)(!1),E=n.usePlanFeatureGate("export_html"),j=n.usePlanFeatureGate("export_pdf"),re=n.usePlanFeatureGate("export_png");n.usePlanFeatureGate("export_webhook");const Oe=n.usePlanFeatureGate("export_platforms"),Ee=n.usePlanFeatureGate("export_amp"),$e=n.usePlanFeatureGate("template_import"),kt=n.usePlanFeatureGate("code_minify"),Ge=x=>{ke(!0),Ye(n.FEATURE_UPSELL_SLIDE[x])},[Ct]=n.emailsApi.useDeleteEmailMutation(),At=async(x,U)=>{try{const B=await Ct(x.id).unwrap();x.project,v.success(r('The email "')+B.title+o('" was successfully removed.',"email")),Q({event:"delete",action:"delete_email",entity_type:"email",entity_id:x.id,project_id:x.project,context:"editor"})}catch(B){v.error(B)}},[et,q]=n.useAddEmailMutation(),[z]=Os(),[xe]=Ms(),[Ue]=Ds(),Be=n.useProjectData(),nt=n.useInvalidateTerms(),ut=n.useSelector(n.selectIsHeaderCodeMenuOpen);(0,m.useEffect)(()=>{ut.switched&&ne(!1)},[ut]);const Me=()=>{const{title:x}=e;return x===null?r("New email title"):x},Qe=(x,U,B=!1)=>{const $=n.getCodeSize(x);B&&n.isCodeSizeExceeded($)?(ue(x),le(()=>U),Ie(!0)):U(x)},bt=()=>{if(Ie(!1),kt.isLocked){Ge("code_minify");return}if(we&&W){n.getCodeSize(W);const x=n.minifyHtml(W);n.getCodeSize(x),we(x),le(null),ue("")}},Je=()=>{Ie(!1),we&&W&&(we(W),le(null),ue(""))},ae=()=>{Ie(!1),le(null),ue("")},N=n.useContentReader(),L=n.useContentReplacer(),J=n.useEvent(d.events.ON_EMAIL_INIT_ID),fe=n.useEventEmitter(d.events.ON_LAYOUT_CONVERT_REQUEST_ID);(0,m.useEffect)(()=>{const x=J(()=>{ne(!1)});return()=>x.dispose()},[J]);const ge=async(x,U=N())=>{const B=document.querySelector(".email-preview"),$=getComputedStyle(B);return U=await M(U,[$.width],e.utm_parameters,async X=>{at(X)}),z({file:U,title:Me(),notification:v}).unwrap().then(X=>{const F={id:X._id,...X};return x(F,()=>xe({id:F.id,notification:v}))}).catch(X=>{v.error({title:X.data?.code,description:X.data?.message})})},Fe=(x,U=1)=>ge((B,$)=>({hrefs:x.map(X=>n.previewHrefForRacs(B.id,void 0,!1,U,void 0,void 0,X)),dispose:$})),qe=(x,U,B=2)=>ge(($,X)=>({data:x.map(F=>({selector:F,href:n.previewHrefForRacs($.id,void 0,!1,B,F)})),dispose:X}),U),Xe=async(x,U)=>{const B=typeof x=="string"?(await s({url:x}))?.data:x;if(!B)return typeof x=="string"?x:"";let $=n.decodeFileNameFromPath(U);if(typeof x=="string"&&/^https?:\/\//i.test(x)){const he=n.decodeFileNameFromUrl(x);he&&($=he)}const X=B,{ensureFileExtension:F,extractUploadResult:de}=await Vr();$=await F($,X.type||"");const Re=new File([X],$.toLowerCase(),{type:X.type||""});try{const he=de(await c({user_id:g.id,folder:String(Be.id),file:Re}).unwrap());if(he.error)return typeof x=="string"?x:"";if(he.file_url)return he.file_url}catch{}return typeof x=="string"?x:""},ot=async x=>{const U=x.document.querySelectorAll("[em-operation=exportAsPicture]"),B=new Map;for(let $=0,X=U.length;$<X;$++){const F=U[$];F.setAttribute("em-export-id",String($)),B.set(`[em-export-id='${$}']`,F)}B.size&&x.handleRender(async({contentDocument:$,managedNodeController:X})=>{try{const{data:F,dispose:de}=await qe([...B.keys()],n.getOuterHtml($),Vs);try{const Re=F.map(async({href:he,selector:Pt},Ca)=>{const lt=B.get(Pt);if(lt.tagName==="TD"){lt.removeAttribute("style");for(const it of[...lt.classList])it.startsWith("em-mob-")&<.classList.remove(it)}X.commit();const Ym=await Xe(he,`${Ca}-${lt.tagName.toLowerCase()}.png`),Aa=parseInt(getComputedStyle(lt).width);let mt=new Image(Aa);mt.setAttribute("border","0"),mt.setAttribute("style",`display: block; width: 100%; max-width: ${Aa}px;`),mt.alt="",mt.src=Ym;const Ia=lt.querySelector("a");if(Ia){const it=document.createElement("a");it.setAttribute("target","_blank"),it.setAttribute("href",Ia.getAttribute("href")),it.appendChild(mt),mt=it}if(lt.tagName==="TD"){const it=lt.cloneNode();it.removeAttribute("em-operation"),it.appendChild(mt),mt=it}lt.replaceWith(mt),X.commit()});await Promise.all(Re)}catch{}finally{de()}}catch{}})},at=x=>{const U=x.document;if(Be?.limits?.preview_limit==="0"&&ie&&(g?.counters?.emails_counter??1/0)>2&&!U.querySelector(".em-powered-logo")){const B=`<a href="${`https://https://racs.emcdn.ru/v3/v3/link?app=emailmaker&project=${ie}&email=${e.id}&link=https%3A%2F%2Femailmaker.ru`}" target="_blank"><img src="https://https://racs.emcdn.ru/v3/v3/pixel/123.png?image=https://emcdn.ru/emailmaker/powered.png&project=${ie}&email=${e.id}" width="150" height="50" border="0" alt="" style="display: inline-block; width: 100%; max-width: 150px;"></a>`;U.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child")&&U.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child").insertAdjacentHTML("afterend",`<tr em="block" class="em-powered-logo">
|
|
858
|
+
<td align="center" bgcolor="#FFFFFF">${B}</td>
|
|
859
|
+
</tr>`)}},In=async()=>{const x=N();Qe(x,async U=>{try{const B=document.querySelector(".email-preview"),$=getComputedStyle(B),X=await M(U,[$.width],e.utm_parameters,async he=>{at(he)}),F=await Ue({htmlContent:X,notification:v}).unwrap(),de=window.URL.createObjectURL(new Blob([F],{type:"application/pdf"})),Re=document.createElement("a");Re.href=de,Re.setAttribute("download",`${Me()}.pdf`),document.body.appendChild(Re),Re.click(),document.body.removeChild(Re),window.URL.revokeObjectURL(de)}catch{}})},Ut=x=>{const U=N();Qe(U,B=>{Q({event:"click",action:"export_email",export_type:"HTML"});const $=document.querySelector(".email-preview"),X=getComputedStyle($);M(B,[X.width],e.utm_parameters,async F=>{await ot(F),at(F),await n.processAmp(F,x)}).then(F=>{const de=new Blob([F],{type:"text/html;charset=utf-8"});(0,Rt.saveAs)(de,`${Me()}.html`)}).catch(F=>{})},!0)},V=x=>{const U=N();Qe(U,B=>{Q({event:"click",action:"export_email",export_type:"TEXT"});const $=document.querySelector(".email-preview"),X=getComputedStyle($);M(B,[X.width],e.utm_parameters,async F=>{await ot(F),at(F),await n.processAmp(F,x);const[{htmlToText:de},{EmailTextPlainConvertOptions:Re}]=await Promise.all([(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/1912a30e.js")),void 0,{}.url),(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/60b75c99.js")),void 0,{}.url)]);F.handleReadHtml(he=>{he.html=de(he.contentDocument,Re)})}).then(F=>{const de=new Blob([F],{type:"text/plain;charset=utf-8"});(0,Rt.saveAs)(de,`${Me()}.txt`)}).catch(F=>{})})},ye=()=>{const x=N();Qe(x,U=>{Q({event:"click",action:"export_email",export_type:"MARKDOWN"});const B=document.querySelector(".email-preview"),$=getComputedStyle(B),{utm_parameters:X}=e;M(U,[$.width],X,async F=>{at(F),await n.processAmp(F,"html");const{htmlToMarkdown:de}=await(0,je.__vitePreload)(async()=>{const{htmlToMarkdown:Re}=await Promise.resolve().then(()=>se("./static/core/48e93de9.js"));return{htmlToMarkdown:Re}},void 0,{}.url);F.handleReadHtml(Re=>{Re.html=de(Re.contentDocument)})}).then(F=>{const de=new Blob([F],{type:"text/markdown;charset=utf-8"});(0,Rt.saveAs)(de,`${Me()}.md`)}).catch(F=>n.reportError(F,{origin:"markdown-export"}))})},_e=x=>{const U=N();Qe(U,B=>{Q({event:"click",action:"export_email",export_type:"Clipboard"});const $=document.querySelector(".email-preview"),X=getComputedStyle($);M(B,[X.width],e.utm_parameters,async F=>{await ot(F),at(F),await n.processAmp(F,x)}).then(F=>navigator.clipboard.writeText(F).then(function(){v.success(r("The email has been copied to the clipboard."))})).catch(F=>{})},!0)},We=async x=>{Pe&&Hr(Pe)},Ce=()=>{_(null),C("")},Bt=async()=>{if(!k){R(!0);try{const x=await Fe([800,Ws],zs);if(!x)return;const{hrefs:U,dispose:B}=x;try{const[$,X]=await Promise.all(U.map(Re=>Ze.getImageByUrl(Re).then(he=>Ze.imageToBlob(he)))),F=Me(),de=await Ze.htmlFilesToZip(Us(F,{desktop:$,mobile:X}));(0,Rt.saveAs)(de,Qn(F).archive),Q({event:"click",action:"export_email",export_type:"Image"})}finally{B()}}catch{v.error({title:r("Error"),description:r("Failed to export the email as images. Please try again.")})}finally{R(!1)}}},It=x=>{const U=G.get(n.APP_COOKIES.em_token);return fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(x)}`,{headers:{authorization:`Bearer ${U}`}}).then(B=>B.blob())},pt=x=>new Promise((U,B)=>{const $=()=>It(x).then(U,B);fetch(x).then(X=>U(X.blob()),$).catch(()=>{})}),Dr=(x,U)=>{const B=N();Qe(B,$=>{Q({event:"click",action:"export_email",export_type:"Outlook"});const X=document.querySelector(".email-preview"),F=getComputedStyle(X),de=async(he,Pt)=>{he.document,await n.processAmp(he,Pt),await ot(he),at(he)},{subject:Re}=e;O(Re||Me(),$,[F.width,F.height],e.utm_parameters,x?he=>de(he,"html"):he=>de(he),U?{embedImagesAsBase64:!0,getImageBlob:pt}:void 0).then(he=>{const Pt=new Blob([he],{type:"text/html;charset=utf-8"});(0,Rt.saveAs)(Pt,`${Me()}.eml`)}).catch(he=>{})})},Qt=x=>{w({centered:!0,mask:{closable:!0},title:r("Embed images in the file?"),content:r('If "Yes", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If "No", images will be loaded from external links.'),okText:r("Yes"),cancelText:r("No"),onOk:()=>Dr(x,!0),onCancel:()=>Dr(x,!1)})},Um=async()=>{const x=N();Qe(x,async U=>{Q({event:"click",action:"export_email",export_type:"ZIP"});const B=document.querySelector(".email-preview"),$=getComputedStyle(B),X=await D(U,[$.width,void 0],e.utm_parameters,pt,async de=>{await ot(de),at(de),Tt&&await n.processAmp(de,"html")});Tt&&(X["amp.html"]=await M(U,[$.width],e.utm_parameters,async de=>{await ot(de),at(de),await n.processAmp(de,"amp")}));const F=await Ze.htmlFilesToZip(X);(0,Rt.saveAs)(F,`${Me()}.zip`)},!0)},Bm=async()=>{if(Q({event:"click",action:"duplicate_email",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew)v.warning({title:r("To create a copy, you need to save the email.")});else{if((await oe.fire(e)).some($=>$===!1))return;const{title:x,subject:U}=e,B=x||U||r("Untitled email.").replace(/\.$/,"");et({title:n.generateCopyTitle(B),...e.meta!==void 0?{meta:e.meta}:{},project:Number(Be?.id),description:e.description,html:n.generateCopyHtml(N()||"",String(e.title)),parent_email:e.parent_email||127017,common_styles:e.common_styles||"",utm_parameters:{utm_source:e.utm_parameters?.utm_source,utm_medium:e.utm_parameters?.utm_medium,utm_campaign:e.utm_parameters?.utm_campaign,utm_term:e.utm_parameters?.utm_term,utm_content:e.utm_parameters?.utm_content},emailtags:e.emailtags,folder:e.folder}).unwrap().then($=>{u(`/projects/${Be.id}/emails/${$.id}`),v.success({title:r('The copy of email "')+B+r('" was successfully created.')}),Q({event:"duplicate",action:"duplicate_email_success",entity_type:"email",entity_id:e.id,cloned_entity_id:$.id,project_id:e.project,context:"editor"}),nt("folder")}).catch($=>{v.error({title:$.data.code,description:$.data.message})})}},$m=()=>{Q({event:"click",action:"click_delete_email_menu_item",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew?v.success(r("The draft of the email has been deleted.")):Gm(e,u)},Gm=(x,U)=>{Q({event:"open",action:"open_delete_email_modal",entity_type:"email",entity_id:x.id,project_id:x.project,context:"editor"}),w({mask:{closable:!0},centered:!0,title:o('Are you sure to delete "',"email")+x.title+r('" email?'),icon:(0,h.jsx)(n.EmIcons,{icon:"DeleteOutlined",component:I.icons$DeleteOutlined,size:22,style:{color:I.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:r("Yes"),cancelText:r("No"),onOk:()=>At(x,U)})},Tn=()=>{Y()||(Vr().catch(()=>{}),n.uploadFile("application/zip, message/rfc822, text/html",qm))},qm=async x=>{if(Y())return;const U=x[0];try{a(n.setIsGlobalLoading(!0));const{createDocumentProcessor:B,createFileProcessor:$,importEmail:X}=await Vr(),F=await X(U,$(s,c,g,Be,S),B(U)),{html:de,hasBrowserExtensionArtifacts:Re}=F??{html:"",hasBrowserExtensionArtifacts:!1};if(F&&Hs(me,F.sourceHtml,U.name).catch(Ca=>{}),Re&&ee.fire(),Y()){a(n.setIsGlobalLoading(!1));return}const[he]=Ze.getFileNameAndExt(U.name.replaceAll(" "," ")),Pt=he||n.getTitleFromHtml(de)||"";L(de,{undoable:!0}),i({title:Pt}),a(n.setIsGlobalLoading(!1)),fe.fire({html:de})}catch(B){a(n.setIsGlobalLoading(!1));const $=B instanceof Error?B.message:B;v.error({title:$})}Q({event:"upload_file",action:"import_email"})},Hm=()=>{const x=N();x&&(Q({event:"click",action:"convert_layout"}),fe.fire({html:x,explicit:!0}))},$t=[];S.emailDropdownMenuClone&&$t.push({label:r("Clone"),icon:(0,h.jsx)(n.EmIcons,{icon:"CopyOutlined",component:I.icons$CopyOutlined,size:16,strokeWidth:S.iconStrokeWidth}),key:"Clone",className:"em-analytics__email-clone",disabled:q.isLoading,onClick:Bm}),S.emailDropdownMenuImport&&$t.push({label:o("Import","verb"),icon:(0,h.jsx)(yt,{icon:(0,h.jsx)(n.EmIcons,{icon:"CloudUploadOutlined",component:I.icons$CloudUploadOutlined,size:16,strokeWidth:S.iconStrokeWidth}),locked:$e.isLocked,strokeWidth:S.iconStrokeWidth}),key:"Import",disabled:T,className:"em-analytics__editor-page__import",onClick:()=>{if($e.isLocked){Ge("template_import");return}Q({event:"click",action:"import_email"}),Tn()}});const zm=N(),Vm=!e.hasOwnProperty("type")&&zn(zm,H)!==null;S.emailDropdownMenuConvert&&Vm&&$t.push({label:r("Convert"),icon:(0,h.jsx)(n.EmIcons,{icon:"SwapOutlined",component:I.icons$SwapOutlined,size:16,strokeWidth:S.iconStrokeWidth}),key:"ConvertLayout",disabled:T,className:"em-analytics__email-convert",onClick:Hm}),(p||f||g.id?.toString()===e.author?.toString())&&(S.emailDropdownMenuLock&&$t.push({label:(0,h.jsx)(n.SwitchLockBtn,{element:e,context:"editor"},"Lock"),icon:e.lock?(0,h.jsx)(n.EmIcons,{icon:"UnLock",component:I.icons$UnLock,size:16,strokeWidth:S.iconStrokeWidth}):(0,h.jsx)(n.EmIcons,{icon:"Lock",component:I.icons$Lock,size:16,strokeWidth:S.iconStrokeWidth}),disabled:e.isNew}),S.emailDropdownMenuRemove&&$t.push({label:r("Remove"),icon:(0,h.jsx)(n.EmIcons,{icon:"DeleteOutlined",component:I.icons$DeleteOutlined,size:16,strokeWidth:S.iconStrokeWidth}),key:"Remove",className:"em-analytics__email-remove",style:{color:"#ff4d4f"},onClick:$m}));const Tt=e.isAmp,Et=[],Wm=()=>[...Tt?[{key:"html_txt",label:`${r("Plain text")} (HTML)`,onClick:()=>V("html")},{key:"сode_txt",label:`${r("Plain text")} (AMP)`,onClick:()=>V("amp")}]:[{key:"plain_txt",label:r("Plain text"),onClick:()=>V()}],{key:"markdown",label:r("Markdown"),onClick:()=>ye()}];S.exportHtmlEnabled&&Et.push({key:"html",label:r("Code"),icon:(0,h.jsx)(yt,{icon:(0,h.jsx)(n.EmIcons,{icon:"FileTextOutlined",component:I.icons$FileTextOutlined,style:ht}),locked:E.isLocked,strokeWidth:S.iconStrokeWidth}),...E.isLocked?{onClick:()=>Ge("export_html")}:Tt?{children:[{key:"сode_html",label:r("AMP"),onClick:()=>Ee.isLocked?Ge("export_amp"):Ut("amp")},{key:"html_amp",label:r("HTML"),onClick:()=>Ut("html")}]}:{onClick:()=>Ut()}}),S.exportZipEnabled&&Et.push({key:"zip",label:r("ZIP"),icon:(0,h.jsx)(yt,{icon:(0,h.jsx)(n.EmIcons,{icon:"FileZipOutlined",component:I.icons$FileZipOutlined,style:ht}),locked:E.isLocked,strokeWidth:S.iconStrokeWidth}),...E.isLocked?{onClick:()=>Ge("export_html")}:{onClick:()=>Um().catch(x=>{})}}),S.exportClipboardEnabled&&Et.push({key:"clipboard",label:r("Clipboard"),icon:(0,h.jsx)(yt,{icon:(0,h.jsx)(n.EmIcons,{icon:"SnippetsOutlined",component:I.icons$SnippetsOutlined,style:ht}),locked:E.isLocked,strokeWidth:S.iconStrokeWidth}),...E.isLocked?{onClick:()=>Ge("export_html")}:Tt?{children:[{key:"clipboard_html",label:r("AMP"),onClick:()=>Ee.isLocked?Ge("export_amp"):_e("amp")},{key:"clipboard_amp",label:r("HTML"),onClick:()=>_e("html")}]}:{onClick:()=>_e()}}),S.exportTextEnabled&&Et.push({key:"text",label:r("Text"),icon:(0,h.jsx)(yt,{icon:(0,h.jsx)(n.EmIcons,{icon:"FileOutlined",component:I.icons$FileOutlined,style:ht}),locked:E.isLocked,strokeWidth:S.iconStrokeWidth}),...E.isLocked?{onClick:()=>Ge("export_html")}:S.exportMarkdownEnabled?{children:Wm()}:Tt?{children:[{key:"сode_txt",label:r("AMP"),onClick:()=>Ee.isLocked?Ge("export_amp"):V("amp")},{key:"html_txt",label:r("HTML"),onClick:()=>V("html")}]}:{onClick:()=>V()}}),S.exportOutlookEnabled&&Et.push({key:"outlook",icon:(0,h.jsx)(yt,{icon:(0,h.jsx)(n.EmIcons,{icon:"FileWordOutlined",component:I.icons$FileWordOutlined,style:ht}),locked:Oe.isLocked,strokeWidth:S.iconStrokeWidth}),label:r("Outlook"),onClick:()=>Oe.isLocked?Ge("export_platforms"):Qt(!!Tt)}),S.exportPdfEnabled&&Et.push({key:"pdf",icon:(0,h.jsx)(yt,{icon:(0,h.jsx)(n.EmIcons,{icon:"FilePdfOutlined",component:I.icons$FilePdfOutlined,style:ht}),locked:j.isLocked,strokeWidth:S.iconStrokeWidth}),label:r("PDF"),onClick:()=>j.isLocked?Ge("export_pdf"):In()}),S.exportPngEnabled&&Et.push({key:"img",icon:(0,h.jsx)(yt,{icon:k?(0,h.jsx)(n.EmIcons,{icon:"LoadingOutlined",component:I.icons$LoadingOutlined,spin:!0,style:ht}):(0,h.jsx)(n.EmIcons,{icon:"FileImageOutlined",component:I.icons$FileImageOutlined,style:ht}),locked:re.isLocked,strokeWidth:S.iconStrokeWidth}),label:r("PNG"),disabled:!re.isLocked&&k,onClick:()=>re.isLocked?Ge("export_png"):Bt()});const Km=e.author;return(0,h.jsxs)(I.ui_kit$Space,{children:[S.emailDropdownMenuEnabled?(0,h.jsx)(I.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:$t},children:(0,h.jsx)(I.ui_kit$Button,{type:"default",block:!1,className:"email-page-header__btn email-page-header__btn_extra",onClick:()=>{},children:(0,h.jsx)(n.EmIcons,{icon:"DotsHoriz",component:I.icons$DotsHoriz,size:18,strokeWidth:S.iconStrokeWidth})})},"Actions"):S.emailDropdownMenuImport&&(0,h.jsx)(I.ui_kit$Tooltip,{title:T?r("Read only"):o("Import","verb"),placement:"bottom",children:S.emailDropdownMenuImportButton?(0,h.jsx)(I.ui_kit$Button,{className:"em-analytics__editor-page__import",disabled:T,icon:(0,h.jsx)(n.EmIcons,{icon:"CloudUploadOutlined",component:I.icons$CloudUploadOutlined,size:16,strokeWidth:S.iconStrokeWidth}),onClick:()=>{Q({event:"click",action:"import_email"}),Tn()},children:r("Import")}):(0,h.jsx)(I.ui_kit$Button,{className:"em-analytics__editor-page__import",type:"text",disabled:T,icon:(0,h.jsx)(n.EmIcons,{icon:"CloudUploadOutlined",component:I.icons$CloudUploadOutlined,size:22,strokeWidth:S.iconStrokeWidth}),onClick:()=>{Q({event:"click",action:"import_email"}),Tn()}})}),S.emailExportEnabled&&(0,h.jsx)(I.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:Et},children:(0,h.jsx)(I.ui_kit$Button,{className:"em-analytics__email-page__export",type:"default",icon:(0,h.jsx)(n.EmIcons,{icon:"CloudDownloadOutlined",component:I.icons$CloudDownloadOutlined,size:16,strokeWidth:S.iconStrokeWidth}),children:r("Export")},"Export")},"Export"),!e.hasOwnProperty("type")&&(0,h.jsx)(qn,{disabled:be,email:e},"Save"),!!e.hasOwnProperty("type")&&(0,h.jsx)(m.Suspense,{fallback:null,children:(0,h.jsx)(n.SaveBlockBtnLazy,{disabled:be,rightCol:void 0,block:e,isEditableRights:p||f||g.id?.toString()===Km?.toString(),autoSaveBlockResult:t})},"Save"),(0,h.jsx)(Fi,{open:Ne,codeSize:n.getCodeSize(W),onMinimize:bt,onDownloadAsIs:Je,onCancel:ae}),Pe&&Hr(Pe)&&(0,h.jsx)(Yi,{integration:Hr(Pe),visible:!!Pe,loading:Se,onConfirm:We,onCancel:Ce,__:r}),(0,h.jsx)(n.PlanUpgradePrompt,{open:Z,sideOnOk:void 0,onCancel:()=>ke(!1),initialSlide:Ve})]})},Js=d.createIdentifier$1("canvas.headerFlow");function Xs(e){const t=(0,m.useCallback)(r=>e?e.subscribe(r):()=>{},[e]);return(0,m.useSyncExternalStore)(t,()=>e?.isReady()===!0)}function eo(e,t,r){const o=n.useEmailAttribute(t);(0,m.useEffect)(()=>{r&&typeof o=="string"&&e.getFieldValue(t)!==o&&e.setFieldValue(t,o)},[e,t,r,o])}function Zs(e,t){eo(e,"subject",t),eo(e,"preheader",t)}var to=({email:e,isCollaborationEditor:t})=>{const[r]=I.ui_kit$Form.useForm(),{__:o}=n.useI18n();let a=n.useDispatch();const i=n.useEmailAttributesWriter(),s=n.useAppNavigate(),c=n.useOpenPlanCatalog(),u=n.useChromeReady("header"),p=n.useCurrentUser(),f=n.useContainer().getInstance(Js),g=n.useProjectData(),{owner:y,admin:l}=n.useMyRoles(),{token:v}=(0,I.ui_kit$useToken)(),w=n.useAppConfig(),A=n.useEditorLocked(),P=n.usePushToDataLayer(),M=(0,m.useRef)(),O=(0,m.useRef)(),D=(0,m.useRef)(),G=n.useEventEmitter(d.events.ON_PREVIOUSBUTTON_CLICK_ID),S=n.useEventEmitter(d.events.ON_PREHEADER_CHANGED_ID),T=n.useEventEmitter(d.events.ON_SUBJECT_CHANGED_ID),Y=n.useSelector(n.selectCodeModeDirection),H=e.hasOwnProperty("type")?n.BLOCK:n.EMAIL,ie=n.useSelector(n.selectElementSettings$1),oe=n.useSelector(n.selectElementSettings),ee=H==="email"?ie:oe,me=n.useSelector(n.selectIsCodeMode),[te,K]=(0,m.useState)(!1),[pe,ve]=(0,m.useState)(!1),De=(0,m.useCallback)(()=>ve(!1),[]),[ce,Se]=(0,m.useState)(!1),Q=(0,m.useCallback)(()=>Se(!1),[]),be=(0,m.useCallback)(()=>{Se(!1),c()},[c]),ne=n.usePlanLimitGate("email_generate"),Ne=ne.exceeded?n.getLimitUpgradePresetDefinition(ne.exceeded.presetId):null;(0,m.useEffect)(()=>{const j=!!ee?.type&&(ee?.type===n.ELEMENT_TYPES.TEXT||ee?.type===n.ELEMENT_TYPES.LINK||ee.type===n.ELEMENT_TYPES.BUTTON)&&me&&Y!=="bottom";K(j),a(n.setHeaderCodeMenuOpen(j))},[ee,Y,me]);const Ie=(0,m.useCallback)(()=>{P({event:"click",action:"click_back_button",entity_type:H==="block"?"block":"email",entity_id:e?.id,project_id:e?.project||g?.id,context:"editor"}),G.fire(e)},[s,G,e,g?.id,P,H]),{document:we}=n.useDocumentSessionContext(),le=Xs(we);n.usePrevious(([j])=>{le&&j!==e.subject&&T.fire(e.subject)},[e.subject,le]);const W=(0,m.useCallback)(j=>{const re=j.target.value;T.fire(re)},[T]),ue=(0,m.useCallback)(j=>{const re=j.target.value;S.fire(re)},[S]);n.usePrevious(([j])=>{le&&j!==e.preheader&&S.fire(e.preheader)},[e.preheader,le]);const Z=(0,m.useCallback)((j,re="?")=>{j.subject?.length,j.preheader?.length,r.setFieldValue("subject",j.subject??""),r.setFieldValue("preheader",j.preheader??"")},[r]),ke=(0,m.useRef)(void 0);(0,m.useEffect)(()=>{const j=e?.renderGuid??(e?.id!=null?String(e.id):void 0);!le||!j||ke.current===j||(ke.current=j,Z(e,"identity"))},[le,e,Z]);const Ve=(0,m.useCallback)(j=>{const re=n.stripSubjectTags(j.value).trim();return re!==j.value&&r.setFieldValue("subject",re),re},[r]),Ye=(0,m.useCallback)(j=>{const re=Ve(j.target);i({subject:re})},[i,Ve]),Pe=n.useEvent(d.events.BEFORE_SAVE_EMAIL),_=(0,m.useCallback)(async j=>{const re=O.current?.input;if(document.activeElement===re){const Ee=Ve(re);Ee!==j.subject&&(j.subject=Ee,i({subject:Ee}))}const Oe=D.current?.input;if(document.activeElement===Oe){const Ee=Oe.value.trim();Ee!==j.preheader&&(j.preheader=Ee,i({preheader:Ee}))}await f?.whenDelivered()},[f,i,Ve]);(0,m.useEffect)(()=>{const j=Pe(_);return()=>j.dispose()},[Pe,_]);const b=(0,m.useCallback)(j=>{const re=j.target.value.trim();i({preheader:re})},[i]);Zs(r,le),n.useSetTitle(e.title===null?o("New email title"):e.title);const C=(0,m.useCallback)(()=>{a(n.setActiveSettingsTab(n.AICHAT)),setTimeout(()=>{const j=document.querySelector('li.ai-response-change-context[role="theme-and-preheader-generator"]');j&&j.click()},100)},[a]),k=(0,m.useCallback)(()=>{ne.isLocked?ne.state.state==="locked_by_limit"&&ne.exceeded?Se(!0):ve(!0):C()},[ne,C]),R=(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)(I.ui_kit$Space,{ref:M,size:10,children:[w.headerArrowBackVisible&&(0,h.jsx)(I.ui_kit$Tooltip,{title:o("Back"),placement:"left",children:(0,h.jsx)(I.ui_kit$Button,{type:"text",icon:(0,h.jsx)(n.EmIcons,{icon:"ArrowLeftOutlined",component:I.icons$ArrowLeftOutlined,size:22,strokeWidth:w.iconStrokeWidth}),onClick:Ie,shape:"circle"})}),(0,h.jsx)("div",{children:(w.headerTitleVisible||w.headerPreheaderVisible)&&(0,h.jsxs)(I.ui_kit$Form,{form:r,layout:"vertical",name:"subject_preheader_form",autoComplete:"off",initialValues:{subject:"",preheader:""},children:[w.headerTitleVisible&&(0,h.jsx)("div",{style:{marginTop:le?-3:0},children:(0,h.jsxs)(I.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,h.jsx)("div",{className:"subject_preheader_form__title",children:o("Subject")}),le?(0,h.jsxs)("div",{className:"ant-page-header-heading",children:[(0,h.jsx)(I.ui_kit$Form.Item,{name:"subject",noStyle:!0,children:(0,h.jsx)(I.ui_kit$Input,{className:"ant-page-header-heading-title",ref:O,placeholder:o("Enter subject line here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:W,onPressEnter:Ye,onBlur:j=>{Ye(j),document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.add("focus")},disabled:w.lockPreheaderAndTitle||A})}),w.aiAssistentEnabled&&!A&&(0,h.jsx)(I.ui_kit$Tooltip,{title:o("Generate with AI"),children:(0,h.jsx)(n.EmIcons,{icon:"AI",component:I.icons$AI,size:12,strokeWidth:w.iconStrokeWidth,onClick:k})})]}):(0,h.jsx)(I.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"40%",marginTop:3}})]})}),w.headerPreheaderVisible&&(0,h.jsx)("div",{children:(0,h.jsxs)(I.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,h.jsx)("div",{className:"subject_preheader_form__title",children:o("Preheader")}),le?(0,h.jsxs)("div",{className:"ant-page-header-heading ant-page-header-heading_preheader",children:[(0,h.jsx)(I.ui_kit$Form.Item,{name:"preheader",noStyle:!0,children:(0,h.jsx)(I.ui_kit$Input,{className:"ant-page-header-heading-preheader",ref:D,placeholder:o("Enter preheader here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:ue,onPressEnter:b,onBlur:j=>{b(j),document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.add("focus")},disabled:w.lockPreheaderAndTitle||A})}),w.aiAssistentEnabled&&!A&&(0,h.jsx)(I.ui_kit$Tooltip,{title:o("Generate with AI"),children:(0,h.jsx)(n.EmIcons,{icon:"AI",component:I.icons$AI,size:12,strokeWidth:w.iconStrokeWidth,onClick:k})})]}):(0,h.jsx)(I.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"80%",marginTop:2}})]})})]})})]})}),E=(0,h.jsxs)(h.Fragment,{children:[w.emailIdShow&&!!e.id&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{className:"email-page-header__email-id",children:"ID"+e.id}),(0,h.jsx)(I.ui_kit$Divider,{orientation:"vertical"})]}),(0,h.jsx)(Pn.EmailPreviewMenu,{emailElement:e,isCollaborationEditor:t}),w.commandButtonsEnabled&&(0,h.jsxs)(h.Fragment,{children:[e.lock?(0,h.jsx)(n.EmIcons,{icon:"Lock",component:I.icons$Lock,size:18,strokeWidth:w.iconStrokeWidth,className:(0,Nr.default)("lock-icon",{"lock-icon__disabled":!(y||l||p.id?.toString()===e.author?.toString())}),style:{color:v.colorPrimary,verticalAlign:"sub"}},"Lock"):null,(0,h.jsx)(Qs,{email:e,isHeaderCodeMenuOpen:te},"Buttons")]})]});return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(n.Header,{className:"email-pane__header",leftBlock:u?R:null,rightBlock:u?E:null,isHeaderCodeMenuOpen:te}),pe&&(0,h.jsx)(n.PlanUpgradePrompt,{open:!0,onCancel:De,initialSlide:9}),Ne&&ne.exceeded?(0,h.jsx)(m.Suspense,{fallback:null,children:(0,h.jsx)(n.LimitUpgradeModalLazy,{open:ce,onClose:Q,title:o(Ne.titleKey),subtitle:o(Ne.subtitleKey),usageResource:Ne.usageResource,previousDisplay:n.presetLimitDisplay(ne.exceeded.previousLimit),nextDisplay:n.presetLimitDisplay(ne.exceeded.nextLimit),onChangePlan:be})}):null]})};to.propTypes={};function ec(e){const t=n.parseEmBlockVersion(e);if(!t)return e;const r=o=>String(o).padStart(2,"0");return`${r(t.getDate())}.${r(t.getMonth()+1)}.${t.getFullYear()} ${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`}var tc=({open:e,blocks:t,projectId:r,onClose:o})=>{const{__:a,_n:i}=n.useI18n(),s=n.useSendPostMessage(),c=n.useNotification(),[u,p]=(0,m.useState)({});(0,m.useEffect)(()=>{e&&p(Object.fromEntries(t.map(l=>[l.emBlockId,!0])))},[e,t]);const f=(0,m.useMemo)(()=>Object.values(u).filter(Boolean).length,[u]),g=(l,v)=>{p(w=>({...w,[l]:v}))},y=()=>{const l=t.filter(v=>u[v.emBlockId]);l.length&&(l.forEach(v=>{s({operation:n.EVENT_TYPES.SANDBOX_GLOBAL_BLOCK_REPLACE,settings:{emBlockId:v.emBlockId,blockHTML:v.savedHtml,type:"project",...r?{project:String(r)}:{}}})}),c.success({message:a("Updated")+" "+l.length+" "+i("block","blocks",l.length),placement:"bottomRight"}),o())};return(0,h.jsxs)(I.ui_kit$Modal,{title:(0,h.jsx)("div",{className:"ant-modal-title",children:a("Update global blocks")}),open:e,onOk:y,onCancel:o,footer:(0,h.jsxs)("div",{className:"update-global-blocks-modal__footer",children:[(0,h.jsx)(I.ui_kit$Button,{size:"large",onClick:o,children:a("Cancel")}),(0,h.jsx)(I.ui_kit$Button,{size:"large",type:"primary",disabled:f===0,onClick:y,children:a("Update")})]}),children:[(0,h.jsx)("div",{className:"update-global-blocks-modal__hint",children:a("These global blocks have a newer saved version. Select the ones to update in the template.")}),(0,h.jsx)("div",{className:"update-global-blocks-modal__list",children:t.map(l=>(0,h.jsxs)("div",{className:"update-global-blocks-modal__row",children:[(0,h.jsx)(I.ui_kit$Switch,{checked:!!u[l.emBlockId],onChange:v=>g(l.emBlockId,v)}),(0,h.jsxs)("span",{className:"update-global-blocks-modal__title",title:l.title,children:[l.title,(0,h.jsxs)("span",{className:"update-global-blocks-modal__version",children:[a("Version of")," ",ec(l.savedVersion)]})]}),l.instances>1&&(0,h.jsxs)("span",{className:"update-global-blocks-modal__count",children:[l.instances," ",i("instance","instances",l.instances)]})]},l.emBlockId))})]})};function rc(e){const t=new Map;return e?.trim()&&new DOMParser().parseFromString(e,"text/html").querySelectorAll('[em="block"][em-block-id]').forEach(r=>{const o=r.getAttribute("em-block-id");if(!o)return;const a=r.getAttribute("em-block-version")??void 0,i=t.get(o);i?(i.versions.add(a),i.count+=1):t.set(o,{versions:new Set([a]),count:1})}),t}function nc(e,t){const r=rc(e);if(!r.size||!t?.length)return[];const o=[];for(const a of t){if(!a.global_block||!a.id||!a.html)continue;const i=String(a.id),s=r.get(i);if(!s)continue;const c=n.readRootEmBlockAttrs(a.html).emBlockVersion;c&&[...s.versions].some(u=>u!==c)&&o.push({emBlockId:i,title:a.title?.trim()||i,savedHtml:a.html,savedVersion:c,templateVersion:[...s.versions][0],instances:s.count})}return o}var ro="em-block-id";function oc({projectId:e,document:t}){const r=n.useEvent(d.events.ON_EMAIL_INIT_ID),o=n.useHeadless(),[a,i]=(0,m.useState)([]),[s,c]=(0,m.useState)(!1),[u,p]=(0,m.useState)(null),f=(0,m.useCallback)(v=>t?.subscribe(v)??(()=>{}),[t]),g=(0,m.useSyncExternalStore)(f,()=>!!t?.getContent().includes(ro)),{data:y}=n.blocksApi.endpoints.getBlocks.useQuery(n.projectBlocksArgs(e),{skip:!e||!g}),l=(0,m.useRef)(!1);return(0,m.useEffect)(()=>{g&&l.current&&t&&(l.current=!1,p(t.getContent()))},[g,t]),(0,m.useEffect)(()=>{const v=new d.Disposable;return v.addDisposable(r(w=>{if(w?.reset)return;const A=w?.html??"",P=A.includes(ro);l.current=!P,p(P?A:null)})),()=>v.dispose()},[r]),(0,m.useEffect)(()=>{if(u==null||!y)return;if(o){p(null);return}const v=nc(u,y);v.length&&(i(v),c(!0)),p(null)},[u,y,o]),{outdatedBlocks:a,isOpen:s,close:(0,m.useCallback)(()=>c(!1),[])}}var ac=({open:e,html:t,emBlockId:r,onSaveAsNew:o,onClose:a})=>{const{__:i}=n.useI18n(),s=n.useSendPostMessage(),c=n.useNotification(),[u]=n.useEditBlockMutation(),[p,f]=(0,m.useState)(!1),g=async()=>{if(!r||!t){a();return}f(!0);const y=new Date,l=n.formatEmBlockVersion(y),v=n.injectEmBlockIdIntoBlockHtml(t,String(r),y),w=await u({blockId:String(r),html:v});if(f(!1),"error"in w&&w.error){c.error({message:i("Failed to update the global block."),placement:"bottomRight"});return}s({operation:n.EVENT_TYPES.SANDBOX_EBLOCK_SET_EM_BLOCK_ID,settings:{emBlockId:String(r),emBlockVersion:l}}),c.success({message:i("The global block was updated."),placement:"bottomRight"}),a()};return(0,h.jsx)(I.ui_kit$Modal,{title:(0,h.jsx)("div",{className:"ant-modal-title",children:i("Saving changes in the block")}),open:e,onCancel:a,footer:(0,h.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[(0,h.jsx)(I.ui_kit$Button,{size:"large",disabled:p,onClick:o,children:i("Create new block")}),(0,h.jsx)(I.ui_kit$Button,{size:"large",type:"primary",loading:p,onClick:g,children:i("Update current block")})]}),children:(0,h.jsx)("div",{children:i("This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.")})})},ic=(function(){var e=window.__emailmaker__;if(e&&e.assetUrl)return e.assetUrl("converter-intro.bf4ee74d750b35ae2c10.png");if(e&&e.publicPath)try{return new URL("static/media/converter-intro.bf4ee74d750b35ae2c10.png",e.publicPath).href}catch{}try{return new URL("/static/media/converter-intro.bf4ee74d750b35ae2c10.png",typeof document<"u"&&document.baseURI?document.baseURI:typeof window<"u"&&window.location?window.location.href:"").href}catch{return"/static/media/converter-intro.bf4ee74d750b35ae2c10.png"}})(),sc={closable:!1},cc=ic,lc=({open:e,onConfirm:t,onCancel:r,neverSuggestAgain:o,onNeverSuggestAgainChange:a})=>{const{__:i}=n.useI18n();return(0,h.jsx)(I.ui_kit$Modal,{className:"convert-layout-modal",title:(0,h.jsx)("div",{className:"convert-layout-modal__title",children:i("Template conversion")}),open:e,onOk:t,onCancel:r,mask:sc,width:480,footer:(0,h.jsxs)("div",{className:"convert-layout-modal__footer",style:{display:"flex",flexDirection:"column",gap:16},children:[(0,h.jsx)(I.ui_kit$Switch,{size:"small",checked:o,onChange:a,label:i("Don't suggest again"),labelSize:"small"}),(0,h.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,h.jsx)(I.ui_kit$Button,{size:"large",onClick:r,children:i("Cancel")}),(0,h.jsx)(I.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:i("Convert")})]})]}),children:(0,h.jsxs)("div",{className:"convert-layout-modal__content",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:24,padding:"0 8px",overflow:"hidden"},children:[(0,h.jsx)("div",{className:"convert-layout-modal__text convert-layout-modal__intro-text",style:{textAlign:"center"},children:i("This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.")}),(0,h.jsx)("img",{src:cc,alt:"Converter Intro",className:"convert-layout-modal__image",style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",borderRadius:8}})]})})},dc={closable:!1},uc=({open:e,message:t,onRetry:r,onCancel:o})=>{const{__:a}=n.useI18n();return(0,h.jsx)(I.ui_kit$Modal,{title:(0,h.jsx)("div",{className:"ant-modal-title",children:a("Conversion failed")}),open:e,onOk:r,onCancel:o,mask:dc,footer:(0,h.jsxs)("div",{className:"convert-layout-modal__footer",children:[(0,h.jsx)(I.ui_kit$Button,{size:"large",onClick:o,children:a("Cancel")}),(0,h.jsx)(I.ui_kit$Button,{size:"large",type:"primary",onClick:r,children:a("Try again")})]}),children:(0,h.jsxs)("div",{className:"convert-layout-modal__text",children:[a("Something went wrong during layout conversion. You can try running the conversion again."),t?(0,h.jsx)("div",{className:"convert-layout-modal__error-details",children:t}):null]})})},pc=({open:e,progress:t})=>{const{__:r}=n.useI18n();return e?(0,h.jsx)("div",{className:"conversion-overlay",children:(0,h.jsxs)("div",{className:"conversion-overlay__content",children:[(0,h.jsx)(I.ui_kit$Spin,{size:"large"}),(0,h.jsx)("div",{className:"conversion-overlay__title",children:r("Converting layout…")}),(0,h.jsx)("div",{className:"conversion-overlay__hint",children:r("This may take several minutes. Please keep this tab open.")}),(0,h.jsx)(I.ui_kit$Progress,{className:"conversion-overlay__progress",percent:Math.round(t),status:"active",strokeColor:n.emCssVar("colorPrimary")})]})}):null},_r=n.createApi({reducerPath:"layoutConverterApi",baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({createConvertJob:e.mutation({query:({html:t})=>({url:"/ai/converter/jobs",method:"POST",body:{html:t}})}),getConvertJobStatus:e.query({query:t=>({url:`/ai/converter/jobs/${t}`,method:"GET"})})})}),{useCreateConvertJobMutation:mc,useLazyGetConvertJobStatusQuery:fc}=_r;function gc(){try{return window.localStorage.getItem(n.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)==="true"}catch{return!1}}function hc(e){try{e?window.localStorage.setItem(n.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest,"true"):window.localStorage.removeItem(n.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)}catch{}}function no(e){return e==="beefree"?(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/4797d4f7.js")).then(t=>t.convertBeeFreeToEmailMaker),void 0,{}.url):(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/7452d34b.js")).then(t=>t.convertStripoToEmailMaker),void 0,{}.url)}var yc=5,oo=95,vc=35e3,_c=1e3,bc=e=>new Promise(t=>setTimeout(t,e)),Wr={beefree:"beefree",stripo:"stripo",ai:"unknown"},Ec={init:"prompt",import:"import",explicit:"menu"},Sc=new Set(["ai_disabled","html_too_large","too_many_active","hourly_limit_reached"]);function wc(e){const t=e??{},r=t.data?.error?.code??t.code;return typeof r=="string"&&Sc.has(r)?r:t.status==="FETCH_ERROR"?"network":t.status==="TIMEOUT_ERROR"?"timeout":"unknown"}function kc(e,t){if(e&&typeof e=="object"){const r=e,o=r.data;if(o&&typeof o=="object"){const a=o.error;if(typeof a=="object"&&a?.message)return a.message;if(typeof a=="string"&&a)return a;if(o.message)return o.message}if(typeof o=="string"&&o)return o;if(r.error)return r.error;if(r.message)return r.message}return t}function Cc(){const{__:e}=n.useI18n(),t=n.useUserContentReplacer(),r=n.useNotification(),o=Hn(),{aiLayoutConverterEnabled:a,anyConverterEnabled:i}=o,s=n.useHeadless(),c=n.useEditorLocked(),u=n.useEditorLockCheck(),p=n.useAnalyticsEvent(),f=n.useEvent(d.events.ON_EMAIL_INIT_ID),g=n.useEvent(d.events.ON_LAYOUT_CONVERT_REQUEST_ID),[y]=mc(),[l]=fc(),[v,w]=(0,m.useState)(gc),A=(0,m.useRef)(v),P=(0,m.useCallback)(W=>{A.current=W,w(W),hc(W)},[]),[M,O]=(0,m.useState)(!1),[D,G]=(0,m.useState)(!1),[S,T]=(0,m.useState)(0),[Y,H]=(0,m.useState)(!1),[ie,oe]=(0,m.useState)(""),ee=(0,m.useRef)(""),me=(0,m.useRef)(null),te=(0,m.useRef)("prompt"),K=(0,m.useRef)(null),pe=(0,m.useRef)(!1),ve=(0,m.useRef)({cancelled:!0}),De=(0,m.useRef)(null);(0,m.useEffect)(()=>{pe.current=D},[D]);const ce=(0,m.useCallback)(()=>{De.current!==null&&(clearInterval(De.current),De.current=null)},[]),Se=(0,m.useCallback)(()=>{ce();const W=Date.now();De.current=setInterval(()=>{const ue=Date.now()-W,Z=oo*(1-Math.exp(-ue/vc));T(ke=>Math.max(ke,Math.min(oo,Z)))},_c)},[ce]),Q=(0,m.useCallback)(W=>u()?!1:(W&&(t(W,{undoable:!0}),K.current=W),!0),[t,u]),be=(0,m.useCallback)(async(W,ue)=>{const Z={cancelled:!1};ve.current=Z,H(!1);const ke=me.current,Ve=Wr[ke??"ai"],Ye=Date.now();let Pe=ke==="beefree"||ke==="stripo"?"algorithm":"ai",_=!1;p("editor_layout_convert_started",{source:Ve,method:Pe,trigger:ue});const b=()=>p("editor_layout_convert_succeeded",{source:Ve,method:Pe,trigger:ue,duration_ms:Date.now()-Ye,fallback_to_ai:_}),C=k=>p("editor_layout_convert_failed",{source:Ve,method:Pe,trigger:ue,duration_ms:Date.now()-Ye,error_code:k});if(ke==="beefree"||ke==="stripo"){try{const k=await no(ke),R=Z.cancelled?"":k(W);if(R&&!Z.cancelled){if(!Q(R))return;b(),r.success({message:n.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"});return}}catch{}if(!a){Z.cancelled||(C("algorithm_failed"),oe(e("Layout conversion failed")),H(!0));return}Pe="ai",_=!0}if(a){G(!0),T(0),Se();try{const k=await y({html:W}).unwrap();if(Z.cancelled)return;let R=k.retry_after>0?k.retry_after:yc;for(;!Z.cancelled;){if(await bc(R*1e3),Z.cancelled)return;const E=await l(k.job_id).unwrap();if(Z.cancelled)return;if(E.retry_after&&E.retry_after>0&&(R=E.retry_after),E.status==="completed"){if(ce(),!Q(E.html??"")){G(!1),T(0);return}T(100),b(),r.success({message:n.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"}),setTimeout(()=>{Z.cancelled||(G(!1),T(0))},400);return}if(E.status==="failed")throw Object.assign(new Error(E.error?.message||e("Layout conversion failed")),{code:E.error?.code})}}catch(k){if(Z.cancelled)return;C(wc(k)),ce(),G(!1),T(0),oe(kc(k,e("Layout conversion failed"))),H(!0)}}},[e,a,Q,y,r,l,p,Se,ce]),ne=(0,m.useCallback)(()=>{O(!1);const W=ee.current;W&&!u()&&be(W,te.current)},[be,u]);(0,m.useEffect)(()=>{c&&O(!1)},[c]);const Ne=(0,m.useCallback)(()=>{O(!1),K.current=ee.current,p("editor_layout_convert_declined",{source:Wr[me.current??"ai"],trigger:te.current,never_suggest:A.current})},[p]),Ie=(0,m.useCallback)(()=>{H(!1);const W=ee.current;W&&be(W,"retry")},[be]),we=(0,m.useCallback)(()=>{H(!1),K.current=ee.current},[]),le=(0,m.useCallback)((W,ue="init")=>{const Z=zn(W,o);if(i&&!(s||u())&&Z&&!pe.current){if(ue==="explicit")K.current=null;else{if(A.current)return;if(ue==="import")K.current=null;else if(K.current===W)return}ee.current=W,me.current=Z,Z!=="ai"&&no(Z).catch(()=>{}),O(!0),te.current=Ec[ue],p("editor_layout_convert_offered",{source:Wr[Z],trigger:te.current})}},[i,o,s,p,u]);return(0,m.useEffect)(()=>{if(!i)return;const W=new d.Disposable;return W.addDisposable(f(ue=>{if(ue?.reset)return;const Z=ue?.html??"";pe.current&&Z!==ee.current&&(ve.current.cancelled=!0,pe.current=!1,ce(),G(!1),T(0)),O(!1),H(!1),le(Z)})),()=>W.dispose()},[i,f,le,ce]),(0,m.useEffect)(()=>{if(!i)return;const W=new d.Disposable;return W.addDisposable(g(ue=>{le(ue?.html??"",ue?.explicit?"explicit":"import")})),()=>W.dispose()},[i,g,le]),(0,m.useEffect)(()=>()=>{ve.current.cancelled=!0,ce()},[ce]),{isPromptOpen:M,isConverting:D,progress:S,isErrorOpen:Y,errorMessage:ie,confirmConversion:ne,cancelPrompt:Ne,retryConversion:Ie,closeError:we,neverSuggestAgain:v,setNeverSuggestAgain:P}}function Ac(){const{isPromptOpen:e,isConverting:t,progress:r,isErrorOpen:o,errorMessage:a,confirmConversion:i,cancelPrompt:s,retryConversion:c,closeError:u,neverSuggestAgain:p,setNeverSuggestAgain:f}=Cc();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(lc,{open:e,onConfirm:i,onCancel:s,neverSuggestAgain:p,onNeverSuggestAgainChange:f}),(0,h.jsx)(pc,{open:t,progress:r}),(0,h.jsx)(uc,{open:o,message:a,onRetry:c,onCancel:u})]})}var Ic=6e4,ao=new Map;function Tc(e){const t=e?String(e):"",r=ao.get(t);if(r&&(ao.delete(t),!(Date.now()-r.at>Ic)))return r.promise}var Kr={data:void 0,isSuccess:!1,isError:!1,error:void 0,isLoading:!1};function Pc(e){const t=n.useStore(),r=(0,m.useRef)(t);r.current=t;const[o,a]=(0,m.useState)(Kr),i=e?String(e):void 0;return(0,m.useEffect)(()=>{if(!i){a(Kr);return}let s=!1;return a({...Kr,isLoading:!0}),(Tc(i)??n.resolveEmailPort(d.getContainer(r.current)).readEmail(i)).then(c=>{s||a({data:c??void 0,isSuccess:!0,isError:!1,error:void 0,isLoading:!1})}).catch(c=>{s||a({data:void 0,isSuccess:!1,isError:!0,error:c,isLoading:!1})}),()=>{s=!0}},[i]),o}var of=2;function xc(){const e=n.useProjectData()?.id,t=!0,{data:r,isError:o,isFetching:a,refetch:i}=n.useGetProjectPlanQuery(e,{skip:t}),[s,c]=(0,m.useState)(0),u=(0,m.useRef)(!1),p=!!o,f=s>=2,g=(0,m.useCallback)(()=>{u.current=!1,c(0),i()},[i]);(0,m.useEffect)(()=>{},[p,a,i,s,t]),(0,m.useEffect)(()=>{},[p,e,f,t]);const y="ready";return(0,m.useMemo)(()=>({status:y,retry:g}),[y,g])}var af=300,Rc=d.createIdentifier$1("prewarm.queue");function Oc(e){const t=[];let r=!1,o=!1,a;const i=()=>{a&&(a.unwatch(),e.clearTimer(a.timer),a=void 0)},s=()=>{const p=t.shift();if(!p)return;o=!0;const f=()=>{o=!1,u()};p.start().then(f,f)},c=()=>{i(),e.idle(()=>{if(!(o||t.length===0)){if(e.activity.inFlight()>0){u();return}s()}})};function u(){if(!r||o||a||t.length===0)return;const p=()=>e.setTimer(c,300),f={timer:e.activity.inFlight()===0?p():void 0,unwatch:e.activity.watch(()=>{e.clearTimer(f.timer),f.timer=e.activity.inFlight()===0?p():void 0})};a=f}return e.whenVisible(()=>{r=!0,u()}),{add(p){t.some(f=>f.name===p.name)||(t.push(p),u())},remove(p){const f=t.findIndex(g=>g.name===p);f>=0&&t.splice(f,1),t.length===0&&i()}}}function Mc(e){return e.getOrCreateInstance(Rc,()=>Oc({activity:d.getNetworkActivity(e),whenVisible:t=>n.getEditorVisible(e).whenVisible(t),idle:n.whenIdle,setTimer:(t,r)=>window.setTimeout(t,r),clearTimer:t=>window.clearTimeout(t)}))}function jc(e){return Object.assign(Promise.all(e),{unsubscribe:()=>e.forEach(t=>t.unsubscribe())})}function Lc({projectId:e,project:t,emailProjectId:r,parentEmailId:o}){const a=n.useContainer(),i=n.useAppDispatch(),c=!!n.useCookieManager().get(n.APP_COOKIES.em_token);(0,m.useEffect)(()=>{const u=Mc(a),p=[],f=[],g=(l,v)=>{f.push(l),u.add({name:l,start:()=>{const w=v();return p.push(w),Promise.resolve(w)}})},y=n.parentEmailSource(o);return g("blocks.panel",()=>jc([...y?[i(n.blocksApi.endpoints.getParentEmailBlocks.initiate(n.parentEmailBlocksArgs(y)))]:[],i(n.blocksApi.endpoints.getTemplateBlocks.initiate(n.templateBlocksArgs()))])),e&&g("blocks.list",()=>i(n.blocksApi.endpoints.getBlocks.initiate(n.projectBlocksArgs(e)))),g("blocks.schema",()=>i(n.blocksApi.endpoints.getBlocksSchema.initiate(void 0))),t?.id&&g("blocks.tags",()=>i(n.taxonomiesApi.endpoints.getTerms.initiate({project:t,kind:n.BLOCK_TAGS}))),()=>{f.forEach(l=>u.remove(l)),p.forEach(l=>l.unsubscribe())}},[a,i,e,t,r,o,c])}var Yr="AUTOSAVE_RECOVERY";function Dc(e,t,r=!1,o){const a=t?.get().serverId??void 0,{__:i}=n.useI18n(),s=n.useNotification(),c=n.useAppConfig(),u=n.useSelector(n.selectMonacoFocusing),p=n.useContainer(),f=n.useSelector(n.selectIsPanelHistoryCollapsed),g=n.useSelector(n.selectActiveSettingsTab),y=n.useDispatch(),l=(0,m.useSyncExternalStore)((0,m.useCallback)(G=>o?.subscribe(G)??(()=>{}),[o]),()=>o?.recoveryFacts()),v=c?.revisionService===!0,w=l?.isRecovering===!0,A=l?.applied,P=(0,m.useCallback)(()=>{y(n.markAppearanceNeedsUpdate())},[y]);(0,m.useEffect)(()=>{v&&w&&s.info({key:Yr,title:i("Loading latest changes..."),duration:0})},[v,w,s,i]);const M=(0,m.useRef)({emailId:void 0,seq:0});(0,m.useEffect)(()=>{if(!A||l?.emailId!==a||(M.current.emailId!==a&&(M.current={emailId:a,seq:0}),A.seq<=M.current.seq))return;M.current={emailId:a,seq:A.seq},P();const{phase:G}=A;!v||G==="normal"||(G==="found"?s.success({key:Yr,title:i("Changes loaded"),duration:3}):G==="timeout"?s.warning({key:Yr,title:i("Locally saved version applied"),description:i("Syncing with the server in the background..."),duration:5}):G==="bg"&&s.info({key:"AUTOSAVE_BG_SYNCED",title:i("Email synced with the server"),duration:3}))},[v,A,l?.emailId,a,P,s,i]),(0,m.useEffect)(()=>{if(!r)return;const G=S=>{S.preventDefault()};return window.addEventListener("beforeunload",G),()=>window.removeEventListener("beforeunload",G)},[r]);const O=!f||u||g==="Discuss",D=p?n.provideAutosaveUiFacts(p):void 0;(0,m.useEffect)(()=>{D?.set({...D.get()??{isUserBusy:!1,saveContext:{}},isUserBusy:O})},[D,O])}var Nc=class extends Error{label;timeoutMs;constructor(e){super(`[sandbox:ready] iframe handshake timed out after ${e}ms`),this.name="SandboxReadyTimeoutError",this.label="sandbox:ready",this.timeoutMs=e}};function Fc(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.isInited=="function"&&typeof t.getTarget=="function"&&typeof t.onInit=="function"}function Uc(e,t,r){return e.isInited()&&e.getTarget()?Promise.resolve():(d.throwIfAborted(r),new Promise((o,a)=>{let i=!1,s,c;const u=f=>{i||(i=!0,s!==void 0&&(clearTimeout(s),s=void 0),c?.dispose(),r?.removeEventListener("abort",p),f())},p=()=>{u(()=>a(d.createAbortError(r?.reason)))};if(c=e.onInit(()=>{e.isInited()&&e.getTarget()&&u(()=>o())}),e.isInited()&&e.getTarget()){u(()=>o());return}t>0&&(s=setTimeout(()=>{u(()=>a(new Nc(t)))},t)),r?.addEventListener("abort",p)}))}var Bc=class extends Error{label;timeoutMs;constructor(e,t){super(`[${e}] timed out after ${t}ms`),this.name="OperationTimeoutError",this.label=e,this.timeoutMs=t}};function $c(e,t,r){return t<=0?e:new Promise((o,a)=>{let i=!1,s;const c=u=>{i||(i=!0,s!==void 0&&(clearTimeout(s),s=void 0),u())};s=setTimeout(()=>{c(()=>a(new Bc(r,t)))},t),e.then(u=>{c(()=>o(u))},u=>{c(()=>a(u))})})}var Gc=2,zt=Symbol("sandbox:frame-replaced");function io(e){return e===zt}function Ot(e,t,r,o,a,i,s){const c=`sandbox:${t}`,u=i?.getSandboxTimeoutMs(t)??n.DEFAULT_SANDBOX_OP_TIMEOUT_MS[t],p=()=>{let v=$c(e.sendAsync(r,o),u,c);return v=d.raceWithAbortSignal(v,i?.signal),n.logShowPipelineWait(c,v,a)};if(t==="INIT_START"&&Fc(e)){const v=i?.getSandboxReadyTimeoutMs()??2e4,w=e,A=P=>{const M=Uc(w,v,i?.signal);return n.logShowPipelineWait("sandbox:INIT_START:ready-wait",M,a).then(()=>{if(!s||P<=0)return p();const O=s.getGeneration();let D;const G=new Promise((T,Y)=>{D=s.onChange(()=>{s.getGeneration()!==O&&Y(zt)})}),S=p();return S.catch(()=>{}),Promise.race([S,G]).finally(()=>D?.()).catch(T=>{if(T!==zt)throw T;return{...a},A(P-1)})})};return A(Gc)}if(!s)return p();const f=s.getGeneration();let g;const y=new Promise((v,w)=>{g=s.onChange(()=>{s.getGeneration()!==f&&w(zt)})}),l=p();return l.catch(()=>{}),Promise.race([l,y]).finally(()=>g?.()).catch(v=>{throw v===zt&&{...a},v})}function so(e,t,r,o){return{html:e,guid:t,...Object.keys(r).length>0?{templateDirectivesPolicy:r}:{},...o!==void 0?{rev:o}:{}}}var co="self-init:";function qc(e){return e.startsWith(co)}function lo(e,t){const r=e.getActiveShowRequest();return qc(t)?r===null:r?.showId===t&&e.hasPendingShow(t)}function Hc(e){const t=()=>e.initPipeline(),r=e.messageService,o=()=>e.waitScope?.()??t(),a=()=>e.frameWatch?.();let i="",s;const c=v=>{s={target:e.readTarget?.(),docId:v}},u=()=>e.readDocument()?n.readDocumentContent(e.readDocument()):i,p=()=>n.getTemplateDirectivesPolicy(e.container).editorPolicy,f=()=>e.readEmail(),g=()=>{const v=f();return{...v,id:e.isTemplate()||v.isNew?void 0:v.id,html:u()}};let y=!1;const l={readContent:u,publicEmail:g,sendInitStart:()=>Ot(r,"INIT_START",n.EVENT_TYPES.SANDBOX_INIT_START,{guid:f().renderGuid},void 0,o()),sendInited:()=>Ot(r,"INITED",n.EVENT_TYPES.SANDBOX_INITED,{guid:f().renderGuid},void 0,o(),a()),async sendContent(){const v=f(),{html:w,hasBrowserExtensionArtifacts:A}=n.prepareEmailHtmlForEditor(v?.html||"");A&&e.events.browserExtensionDetected(),n.loadDocumentContent(e.readDocument(),w),i=w,c(v.renderGuid),await Ot(r,"SET_ENTITY",n.EVENT_TYPES.SANDBOX_SET_ENTITY,so(u(),v.renderGuid,p(),e.readDocument()?.get().version),{guid:v.renderGuid,emailId:v.id??null},o(),a())},refreshContent:()=>(c(f().renderGuid),Ot(r,"SET_ENTITY",n.EVENT_TYPES.SANDBOX_SET_ENTITY,so(u(),f().renderGuid,p(),e.readDocument()?.get().version),void 0,o(),a())),sendPreheader:async()=>{const v=f();if(v.preheader!==void 0)return Ot(r,"PREHEADER",n.EVENT_TYPES.SANDBOX_PREHEADER_UPDATE,{value:v.preheader,guid:v.renderGuid,force:!0},void 0,o(),a())},sendSubject:async()=>{const v=f();if(v.subject!==void 0)return Ot(r,"SUBJECT",n.EVENT_TYPES.SANDBOX_SUBJECT_UPDATE,{value:v.subject,guid:v.renderGuid,force:!0},void 0,o(),a())},revealFilled:()=>e.revealFilled?.()??Promise.resolve(),showFilled:v=>e.showFilled?.(v),noteFilled:(v,w)=>e.noteFilled?.(v,w),contentSent:()=>s,readTarget:()=>e.readTarget?.(),fireWillInit:()=>e.events.willInit(g()),fireInit(v,w){if(!lo(t(),v)){t().getActiveShowRequest()?.showId;return}const A=f();A.id,A.renderGuid,t().completeShow(v);const P=e.readDocument();n.writeEmailAttributes(P,{is_inited:!0},{source:"system"});const M=()=>{const D=g();w&&(D.reset=!0);const G=e.events.inited(D);return w||(y&&l.fireEmailChanged(),y=!0),G};if(!P||P.isReady())return M();const{docId:O}=P.get();return P.whenReady().then(()=>e.readDocument()?.get().docId===O?M():void 0,()=>{})},fireEmailChanged(){e.events.emailChanged(g())},fireContentChanged(){e.events.contentChanged(u())}};return l}var zc=2;function uo(){return new Error("[sandbox] document reloaded during fill")}function Vc(e,t,r){return{showId:e,reset:t,emailId:r?.id,renderGuid:r?.renderGuid}}function Qr(e){try{e()}catch{}}function Wc(e){let t;return Qr(()=>{t=e()}),{stage:r=>Qr(()=>t?.stage(r)),end:(r,o)=>Qr(()=>t?.end(r,o))}}function Kc(e){const t=()=>e.initPipeline();let r=!1,o,a,i,s=0,c,u;const p=()=>{const S=e.readTarget?.(),T=e.readSandboxGeneration?.();return S===void 0||T===void 0?void 0:{target:S,generation:T}},f=()=>{const S=p();return S&&{...S,canvasReplaced:e.trackDocument?.(S.target)}},g=S=>{if(S?.canvasReplaced?.())return!0;const T=p();return S!==void 0&&T?.target===S.target&&T.generation!==S.generation},l=Hc({...e,waitScope:()=>({getSandboxTimeoutMs:S=>t().getSandboxTimeoutMs(S),getSandboxReadyTimeoutMs:()=>t().getSandboxReadyTimeoutMs(),signal:c?.signal??t().signal}),frameWatch:()=>{const S=u;if(!(!S||!e.onSandboxGenerationChange))return{getGeneration:()=>p()?.generation??S.generation,onChange:T=>e.onSandboxGenerationChange?.(()=>{(e.readTarget?.()===S.target||S.canvasReplaced?.())&&T()})??(()=>{})}}});let v;const w=(S,T)=>{if(v===S)return;v=S;const Y=s;setTimeout(()=>{s!==Y||t().signal.aborted||O(S,T).catch(()=>{})},0)},A=()=>{c?.abort(),c=void 0};let P;const M=()=>{const S=t().signal;S!==P&&(P?.removeEventListener("abort",A),P=S,S.addEventListener("abort",A))};async function O(S,T,Y=0){const H=++s;A(),c=new AbortController,u=void 0,M();const ie=()=>s!==H,oe=l.readTarget(),ee=t().generation,me=()=>ee===t().generation&&!t().signal.aborted,te=T?"init:reset-":"init:",K=Wc(()=>e.observeShow?.(Vc(S,T,e.readEmail())));if(!T){const be=l.publicEmail();be?.id,be?.renderGuid,be?.preheader}let pe=!1,ve=!1,De,ce=!1;const Se=()=>{if(g(De))throw uo()},Q=()=>{if(ie())throw d.createAbortError("Fill superseded")};try{r=!0,await l.sendInitStart(),Q(),De=f(),u=De,Y===0&&l.fireWillInit(),await(T||Y>0?l.refreshContent():l.sendContent()),pe=!0,Q(),Se();const be=l.contentSent();l.noteFilled(be?.target,be?.docId),K.stage("content"),T||l.publicEmail()?.id;try{await l.sendPreheader()}catch(ne){if(io(ne)||ie())throw ne;n.logShowPipelineError(`${te}preheader-failed`,{showId:S,error:String(ne)})}Q();try{await l.sendSubject()}catch(ne){if(io(ne)||ie())throw ne;n.logShowPipelineError(`${te}subject-failed`,{showId:S,error:String(ne)})}if(Q(),Se(),l.showFilled(oe),await l.sendInited(),Q(),Se(),ve=!0,a===S){const ne=e.readSandboxGeneration?.()??i;ne!==void 0&&(o=ne)}K.stage("reveal"),await l.revealFilled(),Se(),K.end("revealed")}catch(be){const ne=!ie()&&me()&&g(De),Ne=ne?uo():void 0,Ie=Ne??be,we=ne&&Y<zc?G(S,T,Y+1):void 0;ce=ne&&we===void 0;const le=ie()?void 0:{showId:S,contentApplied:pe,sandboxInitedAcked:ve,superseded:!1,...e.describeSurface?.(),error:String(Ne??be)};le&&n.logShowPipelineError(`${te}failed`,le);const W=!ie()&&e.recoverFailedFill?.(oe)===!0;if(K.end(ie()?"superseded":W?"recovered":d.isAbortError(Ie)||!me()?"aborted":"failed",le),!W&&!ie()&&lo(t(),S)&&t().failShow(S,Ie),we!==void 0)return we;throw Ie}finally{D(S,T,te,{superseded:ie(),sessionGeneration:ee,contentApplied:pe,sandboxInitedAcked:ve&&!ce,retry:!ce,commit:me()})}}function D(S,T,Y,H){const{superseded:ie,contentApplied:oe,sandboxInitedAcked:ee}=H;if(ie){`${Y}`;return}ee&&H.commit?l.fireInit(S,T||void 0):ee?n.logShowPipelineError(`${Y}aborted (stale session or signal)`,{showId:S,sessionGeneration:H.sessionGeneration,currentGeneration:t().generation,aborted:t().signal.aborted}):oe?n.logShowPipelineError(`${Y}aborted (sandbox INITED ack missing)`,{showId:S}):n.logShowPipelineError(`${Y}aborted (content not applied)`,{showId:S}),r=!1,c=void 0,!ee&&a===S&&(a=void 0,o===i&&(o=void 0)),!ee&&oe&&H.retry&&w(S,T)}function G(S,T,Y){return O(S,T,Y)}return{channel:l,isEventsLocked:()=>r,filledGeneration:()=>o,markFilled:S=>{o=S},lastCorrelation:()=>a,markCorrelation:S=>{a=S},bumpRunSeq:()=>{s+=1},noteSandboxGeneration:S=>{i=S},fill:S=>O(S,!1),refill:S=>O(S,!0),stop:()=>{s+=1,A(),r=!1,P?.removeEventListener("abort",A),P=void 0}}}function Yc(e,t,r){if(!e?.renderGuid||!e.showId||e.showId!==t.showId)return!1;if(t.isNew)return e.id==null;const o=t.emailId??t.navId;return o!=null&&String(e.id??"")!==String(o)?!1:po(e,r)}function po(e,t){return t?e?.id==null?!1:String(e.id)===String(t):!0}function Qc(e){const{pipeline:t,readEmail:r,readDocument:o,readRouteEmailId:a,readSandboxGeneration:i}=e,s=f=>{const g=r(),y=a();if(!Yc(g,f,y)){f.showId,f.navId,f.emailId,g?.id,g?.showId,g?.renderGuid;return}f.showId,g?.id,g?.renderGuid,t.markFilled(i()),t.markCorrelation(f.showId),t.fill(f.showId).catch(()=>{})};return{showRequested:f=>{s(f)},showRequestIdentityChanged:()=>{const f=e.initPipeline().getActiveShowRequest();f&&s(f)},selfInitChanged:()=>{if(e.initPipeline().getActiveShowRequest())return;const f=i();if(t.filledGeneration()===f)return;const g=r(),y=a();if(!g?.renderGuid||!po(g,y))return;const l=`${co}${g.renderGuid}`;t.markFilled(f),t.markCorrelation(l);const v=o()?.isReady()===!0;g.id,g.renderGuid,(v?w=>t.refill(w):w=>t.fill(w))(l).catch(()=>{t.lastCorrelation()===l&&t.markFilled(void 0)})},saasChanged:()=>{const f=r();f?.renderGuid,f?.showToken,f?.id,o()}}}var mo=d.createIdentifier$1("canvas.sandboxFill"),Jc=class extends Error{showId;constructor(e,t){super(`[emailmaker] show() timed out after ${t}ms waiting for editor init (showId=${e}). Check earlier console errors: wrong host-plugin publicPath (chunks return HTML), mount element removed without destroy(), or sandbox init never completed. Search for [show-pipeline] and [AMD] messages.`),this.name="ShowPipelineTimeoutError",this.showId=e}},Xc=class{_activeRequest=null;_pending=new Map;_listeners=new Set;getActiveShowRequest(){return this._activeRequest}onShowRequested(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}requestShow(e,t,r){return this._rejectPending(d.createAbortError("Superseded by newer show()")),r.aborted?Promise.reject(d.createAbortError(r.reason)):(this._activeRequest=e,new Promise((o,a)=>{const i=setTimeout(()=>{this._settle(e.showId,()=>{a(new Jc(e.showId,t))})},t);i.unref?.();const s=()=>{this._settle(e.showId,()=>{a(d.createAbortError(r.reason))})};r.addEventListener("abort",s,{once:!0});const c=()=>{clearTimeout(i),r.removeEventListener("abort",s)};this._pending.set(e.showId,{request:e,resolve:o,reject:a,timeoutId:i,dispose:c});for(const u of this._listeners)u(e)}))}completeShow(e){this._settle(e,t=>{t.resolve()})}hasPendingShow(e){return this._pending.has(e)}failShow(e,t){this._settle(e,r=>{r.reject(t)})}rejectAll(e){this._rejectPending(e),this._activeRequest=null}_settle(e,t){const r=this._pending.get(e);r&&(r.dispose(),this._pending.delete(e),this._activeRequest?.showId===e&&(this._activeRequest=null),t(r))}_rejectPending(e){for(const[,t]of this._pending)t.dispose(),t.reject(e);this._pending.clear()}};function Zc(e,t){return{contentReady:t.contentReady??e?.contentReady,sandboxReady:t.sandboxReady??e?.sandboxReady,sandbox:t.sandbox?{...e?.sandbox,...t.sandbox}:e?.sandbox}}function el(e){if(!e||!(e.contentReady!==void 0||e.sandboxReady!==void 0||e.sandbox!==void 0))return;const t=n.resolveContentReadyTimeoutMs(e),r=n.resolveSandboxReadyTimeoutMs(e),o=n.resolveSequentialSandboxOpBudgetMs(e.sandbox);t<r+o}var tl=class{_controller=new AbortController;_externalSignalDisposable=new d.Disposable;_sessionChangeListeners=new Set;_showRegistry=new Xc;_timeouts;_generation=0;_sessionStarted=!1;_externalSignal;get signal(){return this._controller.signal}get externalSignal(){return this._externalSignal}get generation(){return this._generation}get contentReadyTimeoutMs(){return n.resolveContentReadyTimeoutMs(this._timeouts)}getSandboxTimeoutMs(e){return n.resolveSandboxOpTimeoutMs(e,this._timeouts?.sandbox)}getSandboxReadyTimeoutMs(){return n.resolveSandboxReadyTimeoutMs(this._timeouts)}bumpGeneration(){this._generation+=1}getActiveShowRequest(){return this._showRegistry.getActiveShowRequest()}onShowRequested(e){return this._showRegistry.onShowRequested(e)}requestShow(e){return this._showRegistry.requestShow(e,this.contentReadyTimeoutMs,this._controller.signal)}completeShow(e){this._showRegistry.completeShow(e)}hasPendingShow(e){return this._showRegistry.hasPendingShow(e)}failShow(e,t){this._showRegistry.failShow(e,t)}rejectAllPendingShows(e){this._showRegistry.rejectAll(e)}onSessionReplaced(e){return this._sessionChangeListeners.add(e),()=>{this._sessionChangeListeners.delete(e)}}configure(e){e.timeouts!==void 0&&(this._timeouts=Zc(this._timeouts,e.timeouts),el(this._timeouts));const t=e.replaceSession===!0||!this._sessionStarted||e.timeouts!==void 0||e.signal!==void 0;this._sessionStarted=!0,e.signal!==void 0&&(this._externalSignal=e.signal),t&&(this._replaceSessionController(),this.bumpGeneration()),(e.signal!==void 0||t)&&this._linkExternalSignal(e.signal)}relinkExternalSignal(e){this._externalSignal=e,this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new d.Disposable,this._linkExternalSignal(e)}abort(e){const t=e??d.createAbortError("Editor instance destroyed");this._showRegistry.rejectAll(t),this._controller.signal.aborted||(this._controller.abort(t),this.bumpGeneration()),this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new d.Disposable}_replaceSessionController(){this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new d.Disposable,this._showRegistry.rejectAll(d.createAbortError("Init session replaced")),this._controller.signal.aborted||this._controller.abort(d.createAbortError("Init session replaced")),this._controller=new AbortController,this._emitSessionReplaced()}_emitSessionReplaced(){for(const e of this._sessionChangeListeners)e()}_linkExternalSignal(e){if(!e)return;if(e.aborted){this._controller.signal.aborted||(this._controller.abort(e.reason??d.createAbortError()),this.bumpGeneration());return}const t=()=>{this._controller.signal.aborted||(this._controller.abort(e.reason??d.createAbortError()),this.bumpGeneration())};e.addEventListener("abort",t),this._externalSignalDisposable.addDispose(()=>{e.removeEventListener("abort",t)})}},rl=(()=>{const e=new tl;return e.configure({}),e})();function Jr(){const e=n.useStore();return(0,m.useMemo)(()=>d.getContainer(e)?.getInstance(d.INIT_PIPELINE_ID)??rl,[e])}function nl(e){const t=Jr(),r=(0,m.useRef)(e);r.current=e,(0,m.useEffect)(()=>{let o;const a=()=>{o?.();const s=t.signal;if(s.aborted){r.current();return}const c=()=>r.current();s.addEventListener("abort",c),o=()=>s.removeEventListener("abort",c)};a();const i=t.onSessionReplaced(a);return()=>{i(),o?.()}},[t])}function ol(e){const t=Jr(),r=(0,m.useRef)(e);r.current=e,(0,m.useEffect)(()=>t.onShowRequested(o=>r.current(o)),[t])}var al=(e,t,r,o,a)=>{const i=n.useStore(),s=n.useMessageService(),c=Jr(),u=(0,m.useRef)(c);u.current=c;const p=n.useEventEmitter(d.events.WILL_EMAIL_INIT_ID),f=n.useEventEmitter(d.events.ON_EMAIL_INIT_ID),g=n.useEventEmitter(d.events.ON_CONTENT_CHANGED_ID),y=n.useEventEmitter(d.events.ON_EMAIL_CHANGED_ID),l=n.useEventEmitter(d.events.ON_BROWSER_EXTENSION_DETECTED_ID),v=e?.id!==void 0,w=e?.showToken??0,A=w,P=(0,m.useRef)(A);P.current=A;const M=(0,m.useRef)(void 0);M.current=e;const[O,D]=(0,m.useState)(()=>n.getSandboxGeneration(s)),G=(0,m.useRef)(O);G.current=O,(0,m.useEffect)(()=>(D(n.getSandboxGeneration(s)),n.onSandboxGenerationChange(s,()=>{D(n.getSandboxGeneration(s))})),[s]);const S=(0,m.useRef)(o);S.current=o;const T=(0,m.useRef)(t);T.current=t;const Y=a?.standalone?void 0:d.getContainer(i)?.getInstance(mo),H=!Y,ie=(0,m.useRef)(Y?.pipeline);ie.current||(ie.current=Kc({container:d.getContainer(i),messageService:s,initPipeline:()=>u.current,readDocument:()=>S.current,readEmail:()=>M.current,isTemplate:()=>!!T.current,readSandboxGeneration:()=>G.current,events:{willInit:K=>p.fire(K),inited:K=>f.fire(K),contentChanged:K=>g.fire(K),emailChanged:K=>y.fire(K),browserExtensionDetected:()=>l.fire()}}));const oe=ie.current,ee=(0,m.useRef)(r);ee.current=r;const me=(0,m.useRef)(void 0);H&&!me.current&&(me.current=Qc({pipeline:oe,initPipeline:()=>u.current,readEmail:()=>M.current,readDocument:()=>S.current,readRouteEmailId:()=>ee.current,readSandboxGeneration:()=>G.current}));const te=me.current;oe.noteSandboxGeneration(G.current),(0,m.useEffect)(()=>{if(H)return()=>ie.current?.stop()},[H]),(0,m.useEffect)(()=>{Y?.setRoute({emailId:r,isTemplate:t})},[Y,r,t]),(0,m.useEffect)(()=>{const K=M.current;if(H&&!oe.isEventsLocked()&&e?.renderGuid===K?.renderGuid&&K?.is_inited&&K){const pe=oe.channel.readContent();y.fire({...K,id:t||K.isNew?void 0:K.id,html:pe})}},[oe,e?.renderGuid,e?.preheader,e?.common_styles,e?.meta,e?.subject,e?.utm_parameters?.utm_campaign||"",e?.utm_parameters?.utm_content||"",e?.utm_parameters?.utm_medium||"",e?.utm_parameters?.utm_source||"",e?.utm_parameters?.utm_term||"",y,t,H]),(0,m.useEffect)(()=>{if(H){const K=n.subscribeToContent(o,()=>{const pe=M.current;if(!oe.isEventsLocked()&&e?.renderGuid===pe?.renderGuid&&pe){const ve=oe.channel.readContent();g.fire(ve),y.fire({...pe,id:t||pe.isNew?void 0:pe.id,html:ve})}});return()=>K.dispose()}},[o,oe,g,y,e,t,H]),nl(()=>{H&&oe.stop()}),ol(K=>{te?.showRequested(K)}),(0,m.useEffect)(()=>{te?.showRequestIdentityChanged()},[te,c,e?.renderGuid,e?.showId,e?.id,r]),(0,m.useEffect)(()=>{te?.selfInitChanged()},[te,c,e?.renderGuid,e?.showId,e?.id,r,o,O]),n.usePrevious(()=>{te?.saasChanged()},[e?.renderGuid,w,v,te]),n.useIframeReload(async()=>{if(!H)return;const K=c.getActiveShowRequest()?.showId;K&&(oe.markFilled(G.current),await oe.refill(K))},{async:!0})};function il(e){const t=n.useEvent(d.events.ON_EMAIL_INIT_ID);(0,m.useEffect)(()=>{if(!e)return;const r=t(()=>e.clear());return()=>r.dispose()},[e,t])}function sl(e){return{saving:(0,m.useSyncExternalStore)(e.subscribe,()=>e.saveState().saving),failures:(0,m.useSyncExternalStore)(e.subscribe,()=>e.saveState().failures)}}function cl({templateEmailId:e,templateEmail:t,templateRead:r,newEmail:o}){return e?t?n.createDraftFromTemplate(t,o):r?o:void 0:o}function ll(e,t){const[r,o]=(0,m.useState)(()=>({routeEmailId:e,templateId:e?void 0:t()||void 0}));if(r.routeEmailId!==e){const a={routeEmailId:e,templateId:e?void 0:t()||void 0};return o(a),a.templateId}return r.templateId}function dl({templateEmailId:e,templateEmail:t,templateRead:r,newEmail:o}){return(0,m.useMemo)(()=>cl({templateEmailId:e,templateEmail:t,templateRead:r,newEmail:o}),[e,t,r,o])}var ul={"not-found":404,forbidden:403,unavailable:500};function fo(e){const t=n.emailOpenFailureReason(e);return t?ul[t]:e?.status}function pl(e){const t=e,r=t?.data?.message??t?.error;return typeof r=="string"&&r!==""?r:void 0}function ml(e,t){return fl(e,t)??pl(e)??t("Unknown error")}function fl(e,t){switch(n.emailOpenFailureReason(e)){case"not-found":return t("This email no longer exists. It may have been deleted.");case"forbidden":return t("You do not have access to this email.");case"unavailable":return t("The email could not be loaded. Please try again.");default:return}}function gl({routeEmailId:e,draft:t}){const r=n.useStore();(0,m.useRef)(0);const o=(0,m.useRef)(void 0),[,a]=(0,m.useReducer)(i=>i+1,0);return(0,m.useEffect)(()=>{},[r,e,e?void 0:t]),o}function hl({routeEmailId:e,draft:t}){const r=n.useStore(),o=n.getEmailDocuments(d.getContainer(r)),a=gl({routeEmailId:e,draft:t}),i=n.useOpenEmail(),s=(0,m.useCallback)(u=>o.subscribe(u),[o]);(0,m.useSyncExternalStore)(s,()=>o.showFacts()),(0,m.useSyncExternalStore)(s,()=>o.sessionKey());const c=(0,m.useCallback)(()=>!0,[o,a,e]);return{...i,history:o.history(),ownsSession:c}}function yl(e,t){return t}function vl(e){return!1}function _l({documents:e,push:t,projectId:r,subscription:o}){(0,m.useEffect)(()=>e.onSaved(a=>{a.intent==="publish"&&t({event:"save",action:"save_email",email_id:a.serverId??void 0,project_id:r,subscription:o})}),[e,t,r,o])}function bl(e){const t=n.useStore();(0,m.useEffect)(()=>{},[t,e])}function El(e,t,r,o=()=>!0){const a=n.useAppNavigate(),i=n.useContainer();(0,m.useEffect)(()=>{},[a,e,t,r,i,o])}var{Content:go}=I.ui_kit$Layout,Sl={paddingTop:"40px"},wl=()=>{const{__:e}=n.useI18n(),{owner:t,admin:r}=n.useMyRoles(),o=n.useDispatch(),a=n.useCodeModeActions(),i=n.useAppNavigate(),{modal:s}=I.ui_kit$App.useApp(),c=n.useAppConfig(),u=n.useRootElement(),p=n.useCookieManager(),f=n.useMessageService(),{emailId:g,preview:y}=n.useRouteParams(),l=n.useEditorProjectId(),v=n.useAppSearchParams(),w=n.useSelector(n.selectIsCodeMode),A=n.useSelector(n.selectActiveModal),P=n.useCurrentUser(),M=n.useProjectData(),O=(0,m.useMemo)(()=>n.createNewEmailDraft(M?{id:Number(M.id),title:M.name}:void 0),[M]),D=n.useSelector(n.selectIsGlobalLoading),[G]=n.useLazyGetMeQuery(),{isSuccess:S,data:T}=n.useGetSubscriptionsQuery(),Y=xc(),[H,ie]=(0,m.useState)(!1),[oe,ee]=(0,m.useState)(),[me,te]=(0,m.useState)(null),[K,pe]=(0,m.useState)(!1),[ve,De]=(0,m.useState)(!1),[ce,Se]=(0,m.useState)(!1),[Q,be]=(0,m.useState)(!1),[ne,Ne]=(0,m.useState)(!1),Ie=(0,m.useRef)(),{confirm:we}=s,{counters:le,subscription:W}=P,ue=le?.emails_counter;p.get(n.APP_COOKIES.em_template_email);const Z=ll(g,()=>v.get("template")||p.get(n.APP_COOKIES.em_new_email)),{isSuccess:ke,isLoading:Ve,isError:Ye,error:Pe,data:_}=Pc(g?void 0:Z),b=dl({templateEmailId:Z,templateEmail:_,templateRead:ke,newEmail:O}),{document:C,email:k,error:R,history:E,ownsSession:j}=hl({routeEmailId:g,draft:b}),re=k?.id!=null?String(k.id):void 0,Oe=yl(g,re);(0,m.useEffect)(()=>{},[g,re,C,Z]),El(g,k?.id,l,j);const Ee=n.useStore(),$e=n.getEmailDocuments(d.getContainer(Ee)),kt=(0,m.useCallback)((V,ye)=>$e.save(V,ye),[$e]),{saving:Ge}=sl($e),Ct=(0,m.useCallback)(()=>$e.saveState(),[$e]),At=n.usePushToDataLayer();_l({documents:$e,push:At,projectId:l,subscription:W?.post_title}),n.usePublishDocumentSession(C,E),il(E),al(k,vl(g),Oe,C);const et=n.useUserUndo({document:C,history:E});Dc(k,C,Ge,$e),bl(l),(0,m.useEffect)(()=>{n.injectEmailRightsResolver(d.getContainer(Ee),V=>!!(t||r||P.id?.toString()===V?.author?.toString()))},[Ee,t,r,P.id]);const q=Li({email:k,save:kt,saveState:Ct,documentSession:C}),{outdatedBlocks:z,isOpen:xe,close:Ue}=oc({projectId:l,document:C});Lc({projectId:l,project:M,emailProjectId:k?.project,parentEmailId:k?.parent_email});const Be=A===n.MODALS.ADD_NEW_EBLOCK_MODAL,nt=n.useMountOnFirstOpen(Be),ut=n.useMountOnFirstOpen(ce),Me=R??(Z?Pe:void 0),Qe=!!Me,bt=Qe&&!1,Je=!k&&!Qe,ae=!!k;(0,m.useEffect)(()=>{Qe&&Me&&n.emailOpenFailureReason(Me)===void 0&&n.reportEntityLoadError("email",g||Z,Me)},[Qe,Me,g,Z]),(0,m.useEffect)(()=>{Z&&ke&&v.get("template")&&v.set({},{replace:!0})},[Z,ke,v]),(0,m.useEffect)(()=>(o(n.switchIsPanelHistoryCollapsed(!0)),()=>o(n.switchIsPanelHistoryCollapsed(!0))),[o]);const N=(0,m.useCallback)(()=>{a.toggle(),o(n.resetPanes())},[o,a]);(0,m.useEffect)(()=>{y&&!w&&N()},[w,y,N]),(0,m.useEffect)(()=>{document.body.classList.add("editor"),o(n.setActiveSettingsTab(n.BUILD))},[o]),(0,m.useEffect)(()=>{},[G,ue,H]);const L=(0,m.useCallback)(()=>{et.undo()},[et]),J=(0,m.useCallback)(()=>{et.redo()},[et]);(0,m.useEffect)(()=>{Ie.current!==k?.id&&(et.clear(),Ie.current=k?.id)},[k,et]);const fe=(0,m.useCallback)(V=>{(window.navigator.appVersion.indexOf("Mac")&&V.metaKey||V.ctrlKey)&&(V.code==="KeyZ"?(V.preventDefault(),V.shiftKey?J():L()):V.code==="KeyY"&&!V.shiftKey&&(V.preventDefault(),J()))},[L,J]),ge=()=>{i(`/projects/${l}/emails`)};(0,m.useEffect)(()=>()=>{o(n.resetPanes()),o(n.closeModal()),o(n.closeModal$1()),o(n.resetElementHistorySlice())},[o]);const Fe=(0,m.useCallback)(V=>{const ye=()=>{o(n.openModal(n.MODALS.ADD_NEW_EBLOCK_MODAL))},_e=V.data.operation,We=V.data,Ce=V.data.action,Bt=u.querySelector("#iframe-scroll-top"),It=u.querySelector("#iframe-scroll-bottom");if(_e===n.EVENT_TYPES.APPLICATION_EBLOCK_ADD){const pt=We.settings?.emBlockId;pt?te({html:We.data,emBlockId:String(pt)}):(ee(We.data),ye())}if(_e===n.EVENT_TYPES.APPLICATION_ACTION&&(Ce==="undo"?L():Ce==="redo"&&J()),_e===n.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_SHOW){const pt=u.querySelector("#email_iframe_slot"),Dr=document.body.getBoundingClientRect().height,Qt=pt.getClientRects()[0];Qt.top<0&&(Bt.style.display="block"),Qt.top+Qt.height>Dr&&(It.style.display="block")}_e===n.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_HIDE&&(Bt.style.display="none",It.style.display="none")},[o,L,J,u]);n.useListenPostMessage(Fe);const qe=V=>{if(V.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const ye=V.dataTransfer,_e=(ye?Array.from(ye.types||[]):[]).includes(n.DND_SOCIAL_LIST_REORDER_MIME),We=typeof V.composedPath=="function"?V.composedPath():[];V.target?.closest?.(".selected-social-form")||We.some(Ce=>Ce&&Ce.nodeType===1&&typeof Ce.classList?.contains=="function"&&Ce.classList.contains("selected-social-form"))||_e||(V.preventDefault(),V.target&&f.send({operation:n.EVENT_TYPES.SANDBOX_DRAG_CANCEL}),u.querySelectorAll(".em-dragging-element").forEach(Ce=>{Ce.classList.remove("em-dragging-element")}))},Xe=(0,m.useRef)({});(0,m.useEffect)(()=>{const V=new d.Disposable,ye=_e=>We=>Xe.current[_e]?.(We);return V.addDisposable(n.addWindowListenerFromShadow(u,"drop",ye("drop"))),V.addDisposable(n.addWindowListenerFromShadow(u,"dragover",ye("dragover"))),V.addDisposable(n.addWindowListenerFromShadow(u,"dragstart",ye("dragstart"))),V.addDisposable(n.addWindowListenerFromShadow(u,"dragend",ye("dragend"))),()=>{V.dispose()}},[u]),(0,m.useEffect)(()=>(window.addEventListener("keydown",fe),()=>{window.removeEventListener("keydown",fe)}),[fe]);const ot=V=>{if(V.preventDefault(),V.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const ye=u.querySelector("#iframe-scroll-top"),_e=u.querySelector("#iframe-scroll-bottom"),We=c.sidePanelFloating?u.querySelector("#pane-content-wrapper"):u.querySelector(".email-pane__col_preview"),Ce=u.querySelector(".blocks-app").getBoundingClientRect().top,{height:Bt,top:It}=u.querySelector("#email_iframe_slot").getBoundingClientRect(),pt=We.getBoundingClientRect().height;It>96?ye.style.display==="block"&&(ye.style.display="none"):(ye.style.display==="none"||ye.style.display==="")&&(ye.style.display="block"),Bt-pt+It-Ce<44?_e.style.display==="block"&&(_e.style.display="none"):_e.style.display==="none"&&(_e.style.display="block"),V.target===ye&&We.scrollBy(0,-15),V.target===_e&&We.scrollBy(0,15)},at=()=>{const V=u.querySelector("#iframe-scroll-top"),ye=u.querySelector("#iframe-scroll-bottom");V&&ye&&(V.style.display="none",ye.style.display="none"),u.querySelectorAll(".em-dragging-element").forEach(_e=>{_e.classList.remove("em-dragging-element")})},In=V=>{const ye=V.target,_e=ye instanceof Element?ye:ye.parentElement;if(!(_e instanceof Element)||_e.closest(".selected-social-form"))return;_e.parentElement?.classList.add("em-dragging-element");const We=!!_e.closest(".blocks-search__result-wrapper");var Ce=We?n.cloneBlockPreviewForDrag(_e.querySelector(".blocks-search__result-html")):_e.cloneNode(!0);Ce.classList.add("em-ghost-element"),Ce.style.height=We?"auto":"70px",Ce.style.width=We?"600px":"109px",Ce.style.position="absolute",Ce.style.top="0",Ce.style.left="0",Ce.style.zIndex="-1",_e.appendChild(Ce),V.dataTransfer.setDragImage(Ce,0,0),window.setTimeout(function(){Ce.parentNode.removeChild(Ce)},1e3)};Xe.current={drop:qe,dragover:ot,dragstart:In,dragend:at};const Ut=(0,m.useCallback)(()=>{we({title:e("You reached the plan limit"),icon:(0,h.jsx)(n.EmIcons,{icon:"ExclamationCircleOutlined",component:I.icons$ExclamationCircleOutlined}),content:(0,h.jsx)("div",{style:{maxWidth:"330px"},children:e("Switch to a different plan to save more emails.")}),centered:!0,okText:e("Choose a plan"),cancelText:e("Continue without saving"),width:"unset",onOk(){i("/billing")},onCancel(){}})},[i,e,we]);return(0,m.useEffect)(()=>{if(S&&T){const V=T?.find(ye=>ye.id?.toString()===W?.ID?.toString())?.limits?.emails_limit;V&&ue>=V&&!K&&!g&&t&&(Ut(),pe(!0))}},[T,S,W,ue,K,Ut,g,t]),(0,m.useEffect)(()=>{const V=f.onInit(()=>{f.send({operation:n.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1})});return()=>V.dispose()},[f]),(0,h.jsx)(n.DocumentSessionProvider,{document:C,history:E,children:(0,h.jsx)($n.Provider,{value:q,children:(0,h.jsxs)(I.ui_kit$Layout,{className:"email-page",children:[Je&&(0,h.jsx)(I.ui_kit$PageLoader,{}),!Je&&Y.status==="pending"&&(0,h.jsx)(I.ui_kit$PageLoader,{}),Y.status==="error"&&(0,h.jsx)(go,{style:Sl,children:(0,h.jsx)("div",{className:"container",children:(0,h.jsx)(I.ui_kit$Result,{status:"warning",title:e("Failed to load plan data"),subTitle:e("Editor features depend on your plan. Check your connection and try again."),extra:(0,h.jsx)(I.ui_kit$Button,{type:"primary",onClick:Y.retry,children:e("Try again")})})})}),bt&&(0,h.jsx)(go,{style:{paddingTop:"40px"},children:(0,h.jsx)("div",{className:"container",children:(0,h.jsx)(I.ui_kit$Result,{status:fo(Me),title:fo(Me),subTitle:ml(Me,e),extra:(0,h.jsx)(I.ui_kit$Button,{type:"primary",onClick:ge,children:e("Back To Project")})})})}),k&&!Je&&!bt&&Y.status==="ready"&&(0,h.jsxs)(I.ui_kit$Layout,{className:"email-pane",children:[D&&(0,h.jsx)("div",{className:"email-pane__loader",children:(0,h.jsx)(I.ui_kit$PageLoader,{small:!0})}),(0,h.jsx)(to,{email:k,isCollaborationEditor:ve}),(0,h.jsx)(Pn.EmailPane_default,{emailElement:k,isSuccess:ae,setIsCollaborationEditor:De,setIsShowAddAllBlocksModal:Se,triggerOpenSavedBlocksTab:Q})]}),nt&&(0,h.jsx)(m.Suspense,{fallback:null,children:(0,h.jsx)(n.AddNewBlockModalLazy,{isModalVisible:Be,htmlContent:oe,projectId:l,setIsShowAddAllBlocksModal:Se,setIsShowAddAllBlocksModalForNewEmail:Ne,currentEmail:k})}),(0,h.jsx)(tc,{open:xe,blocks:z,projectId:l,onClose:Ue}),(0,h.jsx)(ac,{open:!!me,html:me?.html,emBlockId:me?.emBlockId,onSaveAsNew:()=>{ee(me?.html),te(null),o(n.openModal(n.MODALS.ADD_NEW_EBLOCK_MODAL))},onClose:()=>te(null)}),ut&&(0,h.jsx)(m.Suspense,{fallback:null,children:(0,h.jsx)(n.AddAllBlocksModalLazy,{isModalVisible:ce,currentEmail:k,setIsShowAddAllBlocksModal:Se,setTriggerOpenSavedBlocksTab:be,autoStart:!ne,projectId:l})}),(0,h.jsx)(Ac,{})]})})})};function kl(){const e=n.useStore(),t=n.getEmailDocuments(d.getContainer(e)),r=(0,m.useCallback)(o=>t.subscribe(o),[t]);return{kind:(0,m.useSyncExternalStore)(r,()=>{if(t.current())return n.isBlockSessionKey(t.sessionKey())?"block":"email"}),hasSuspended:(0,m.useSyncExternalStore)(r,()=>t.hasSuspended())}}function Cl(e,t){const r=n.useStore(),o=n.useAppConfig(),a=n.useStorageProvider();(0,m.useRef)(new Set),(0,m.useEffect)(()=>{},[e,t,o,r,a])}var Al=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;function Il(e){return typeof e=="string"&&Al.test(e)}function ho(e,t){return!e||t===void 0?!1:String(e.id)===String(t)||e.nativeId!==void 0&&e.nativeId.toLowerCase()===String(t).toLowerCase()}var Tl=30;function Pl(e){const t=n.useContainer(),r=Il(e),o=n.useGetProjectQuery(r?e:+e,{skip:!e,refetchOnMountOrArgChange:Tl}),{isSuccess:a,isError:i,error:s,data:c,isFetching:u}=o;Cl(r?void 0:e,a),(0,m.useEffect)(()=>{t&&n.setCurrentProjectRefreshing(t,u)},[t,u]),(0,m.useEffect)(()=>{t&&a&&c&&ho(c,e)&&n.setCurrentProjectCard(t,c)},[a,c,t,e]),(0,m.useEffect)(()=>{i&&s&&n.reportEntityLoadError("project",e,s)},[i,s,e]);const p=n.useProjectData(),f=ho(p,e);return{...o,projectReady:f}}var Vt=n.createApi({reducerPath:"promoApi",baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:t,type:r},o)=>n.clientFromApi(o).promo.set_code_create({code:t,type:r})}),getPromoInfo:e.query({queryFn({code:t},r){return n.clientFromApi(r).promo.get_code_info_list({code:t})}})})}),{useCheckPromoMutation:sf,useGetPromoInfoQuery:cf}=Vt,xl=n.lazyRoute(()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/316f71b7.js")),void 0,{}.url),"plugin-block-page");function Rl(){const e=n.useContainer(),[t,r]=(0,m.useState)();return(0,m.useEffect)(()=>{if(!e)return;let o=!0;return n.getAppProject(e).then(a=>{o&&a!=null&&r(String(a))},()=>{}),()=>{o=!1}},[e]),t}var Ol=()=>{const e=n.useDispatch(),t=n.useCookieManager(),r=n.useCurrentUser(),o=n.useContainer();(0,m.useEffect)(()=>{const s=r?.code_editor;s&&o&&n.applyEditorOptions(o,s)},[r,o]),(0,m.useEffect)(()=>{const s=t.get(n.APP_COOKIES.em_token),c=t.get(n.APP_COOKIES.promocode);s&&c&&(e(Vt.endpoints.checkPromo.initiate({code:c,type:"by_link"})),t.remove(n.APP_COOKIES.promocode))},[e,t]),n.useNotifyCommand();const{kind:a,hasSuspended:i}=kl();return Pl(Rl()),a?(0,h.jsx)(Ii,{hasEmail:a==="email"||i,hasBlock:a==="block",children:(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(I.ui_kit$PageLoader,{}),children:a==="block"?(0,h.jsx)(xl,{}):(0,h.jsx)(wl,{})})}):null};function Ml(e,t){const r=(0,m.useRef)(!1);(0,m.useEffect)(()=>{!e||r.current||(r.current=!0,n.mark(n.PHASES.appVisible),t&&n.getEditorVisible(t).noteShellVisible())},[e,t])}var Wt=new WeakMap,jl="data-emailmaker-config-styles";function Ll(e){return typeof e=="string"?e.trim():""}function yo(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function Dl(e,t,r){if(!e||typeof document>"u")return null;const o=Ll(t),a=Wt.get(e),i=r||e;if(!o)return a&&(a.remove(),Wt.delete(e)),null;if(a)return a.textContent!==o&&(a.textContent=o),(a.parentNode!==i||a!==i.firstChild)&&yo(i,a),a;const s=document.createElement("style");return s.setAttribute(jl,"true"),s.textContent=o,yo(i,s),Wt.set(e,s),s}function Xr(e){if(!e)return;const t=Wt.get(e);t&&(t.remove(),Wt.delete(e))}function Nl(e,t){return!t||e<=0||e>=1340?1:Math.round(e/n.SCALED_LAYOUT_WIDTH*1e4)/1e4}function Fl(e){if(e)return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host??void 0:e.nodeType===Node.ELEMENT_NODE?e:void 0}function Ul(e,t,r=window){const o=n.cssVarName(n.PLUGIN_ZOOM_VAR),a=r.matchMedia(n.COARSE_POINTER_QUERY),i=()=>{const c=Nl(e.getBoundingClientRect().width,a.matches);c<1?e.style.setProperty(o,String(c)):e.style.removeProperty(o),t.classList.toggle(n.SCALED_LAYOUT_CLASS,c<1)};i();const s=new r.ResizeObserver(i);return s.observe(e),a.addEventListener("change",i),()=>{s.disconnect(),a.removeEventListener("change",i),e.style.removeProperty(o),t.classList.remove(n.SCALED_LAYOUT_CLASS)}}var Bl={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},$l=({children:e,handleBeforeRender:t})=>{const[r,o]=(0,m.useState)(),a=n.useIsLocaleInited();Ml(a,n.useContainer());const i=n.useAppConfig().styles,s=(0,m.useRef)(null),c=(0,m.useRef)(!1),u=(0,m.useRef)(void 0),p=n.useRootElement();return(0,m.useLayoutEffect)(()=>{c.current||(c.current=!0,t&&t())},[]),(0,m.useLayoutEffect)(()=>{if(!p){u.current&&(Xr(u.current),u.current=void 0);return}u.current&&u.current!==p&&Xr(u.current),Dl(p,i,s.current||void 0),u.current=p},[p,i]),(0,m.useLayoutEffect)(()=>{const f=Fl(p),g=s.current;if(!(!f||!g))return Ul(f,g)},[p]),(0,m.useLayoutEffect)(()=>()=>{u.current&&(Xr(u.current),u.current=void 0)},[]),(0,h.jsxs)(I.ui_kit$StyleProvider,{container:n.findShadowRoot(p)||document.head,children:[(0,h.jsxs)("div",{ref:s,className:"App blocks-app blocks-plugin",style:a?{}:{visibility:"hidden"},children:[(0,h.jsx)(n.ModalRootContext.Provider,{value:r,children:e}),(0,h.jsx)("div",{ref:o,className:"blocks-modal-container"})]}),!a&&(0,h.jsx)(I.ui_kit$Space,{size:"large",style:Bl,children:(0,h.jsx)(I.ui_kit$Spin,{size:"large"})})]})};async function Gl({container:e,renderTarget:t,mapKey:r,disposable:o,chunkLoadedFire:a}){const i=await e.getInstanceAsync(d.STORE_ID);return new Promise(s=>{if(o.isDisposed()){s();return}const c=(0,Ta.createRoot)(t),u=(0,h.jsx)(n.Provider,{store:i,children:(0,h.jsx)(bi,{onLoad:s,children:(0,h.jsx)(n.RootContext.Provider,{value:{element:r},children:(0,h.jsx)(I.ui_kit$StyleProvider,{container:n.isDocumentFragment(r)?document.head:r,children:(0,h.jsx)(n.LocaleProvider,{children:(0,h.jsx)($l,{handleBeforeRender:a,children:(0,h.jsx)(Ba,{children:(0,h.jsx)(_i,{children:(0,h.jsx)(Ol,{})})})})})})})})});c.render(u),o.addDispose(s),o.addDispose(()=>{try{c.unmount()}catch(p){if(p instanceof DOMException&&p.name==="NotFoundError"||p instanceof Error&&p.name==="NotFoundError"&&/removeChild/i.test(p.message)){n.logShowPipelineError("mount:unmount-dom-mismatch (host container was already removed)",{hint:"Usually harmless during host React StrictMode teardown. Ensure instance.destroy() runs before the host removes the mount container."});return}throw p}}),o.addDispose(()=>{d.ELEMENT_MAP.delete(r)})})}var ql=d.createIdentifier$1("plugin.mountElement");function Hl(e){const t=e.getInstance(d.OPTIONS_SOURCE_ID)?.get()?.element;if(typeof Element<"u"&&t instanceof Element||typeof DocumentFragment<"u"&&t instanceof DocumentFragment)return t}function zl(e){return e.getOrCreateInstance(ql,()=>{let t=!1,r;return{get:()=>t?r:Hl(e),set(o){t=!0,r=o}}})}var lf="multiple init call on single HTMLELEMENT",Vl=Jt(async e=>{let t=null;const r=zl(e),o=y=>{t=y,r.set(y)};let a=!1;const i=d.getEmitter(e,d.events.ON_CHUNKS_LOADED),s=e.getInstance(d.DISPOSABLE_ID);let c,u=!1;const p=()=>{u||(u=!0,n.mark(n.PHASES.chunksLoaded),i.fire())},f=Ua();s.addDisposable(i.event(()=>f.loaded()));const g=(y,l)=>Gl({container:e,renderTarget:y,mapKey:l,disposable:c,chunkLoadedFire:p});return{instance:{},async setOptions(y){f.use(y);const l=e.getInstance(d.INIT_PIPELINE_ID),v=await d.waitForElement(y.element,s,l.signal),w=e.getInstance(d.INSTANCE_ID),A=!!y.hidden&&!!v;if(t===v&&a===A)return;const P=t===v&&a&&!A;a=A,t&&d.ELEMENT_MAP.delete(t),v&&d.ELEMENT_MAP.has(v),c&&c.dispose(),c=s.addDisposable(new d.Disposable);const M=y.element!==void 0;if(n.setHeadlessMode(e,!v||A),n.setHiddenMount(e,A),!v){n.mark(n.MOUNT_HEADLESS_MARK);const D=document.createElement("div");D.style.position="absolute",D.style.left="-10000px",D.style.top="-10000px",D.style.width="1600px",D.style.height="1000px",document.body.appendChild(D),o(D),p(),c.addDispose(()=>{D.parentNode===document.body&&D.remove()});return}const O=n.findShadowRoot(v);if(O&&c.addDisposable(new Fa({shadowRoot:O})),M&&v instanceof Element){const D=v;Ra(D,()=>{s.isDisposed()||c?.isDisposed()||(n.logShowPipelineError("mount:detached (host removed element without destroy)",{elementId:D.id||null}),l.abort(xa()))},c)}if(A){n.mark(n.MOUNT_HEADLESS_MARK),o(v),p();return}if(M&&v instanceof Element){const D=v,G=La(D);o(D);const S=g(G,D);return Da(D,G,c),S}return o(v),g(v,v)},dispose(){c&&!c.isDisposed()&&c.dispose()}}});function Zr(e){return Jt(async t=>(await t.getInstanceAsync(d.STORE_ID),await e(t)))}function vo({html:e,renderGuid:t,...r},o){const{requested:a}=n.getCurrentProject(o);return n.filterUndefined({...r,code:n.getTemplateDirectivesPolicy(o).toOutputForm(e),project:a===void 0?r.project:a,guid:void 0,link:void 0,status:void 0,slug:void 0,password:void 0,comment_status:void 0,template:void 0,blocktags:void 0,project_title:void 0,ping_status:void 0,lock:void 0,tag:void 0,is_template:void 0})}function Wl(e,t){return n.filterUndefined({...e,link:void 0,comment_status:void 0})}function Kl({html:e,isAutosave:t,...r},o){return n.filterUndefined({...r,autosave:t?!0:void 0,code:e,guid:void 0,compiled:n.filterUndefined({html:e,ampHtml:e&&""})})}var _o=e=>{const t={current:Promise.resolve(),state:e,decorate:(r,o)=>(o&&(r=r.bind(o)),function(...a){const i=t.current.then(()=>r(...a));return t.current=i.then(s=>{t.state=s},s=>{}),i})};return t},en=d.createIdentifier$1("NotificationService"),Yl=d.createIdentifier$1("emailTemplate.reads");async function Ql(e,t){try{return await n.getRestEmailPortFactories(e).email(e).readEmail(t)??void 0}catch(r){n.logShowPipelineError("show:template-read-failed",{templateId:t,error:r instanceof Error?r.message:"неизвестная ошибка"}),Xl(e,t,r);return}}var Jl=d.createIdentifier$1("emailTemplate.notifiedFailures");function Xl(e,t,r){if(r instanceof DOMException&&r.name==="AbortError")return;const o=e.getOrCreateInstance(Jl,()=>new Set);o.has(t)||(o.add(t),e.getInstanceAsync(en).then(()=>{d.getEmitter(e,d.events.ON_NOTIFICATION).fire({type:"warning",id:"TEMPLATE_READ_ERROR",data:{templateId:t},innerException:r})},()=>{}))}function Zl(e,t){const r=e.getOrCreateInstance(Yl,()=>new Map),o=r.get(t);if(o!==void 0)return o;const a=Ql(e,t).then(i=>(i===void 0&&r.delete(t),i));return r.set(t,a),a}var tt=class extends d.Disposable{_event;_listener;_disposeEvent;constructor(e){super(),this._event=e}setListener(e){this._listener!==e&&(this._listener=e,this._disposeEvent&&this._disposeEvent(),e?this._disposeEvent=this._event(e):this._disposeEvent=void 0)}dispose(){this._disposeEvent&&this._disposeEvent(),super.dispose()}};function rt(e,t,r){const o=d.snapshot(e);return(a,i,s)=>{const c=o(async u=>{const p=t?t(u):u;s&&a.bind(s);const f=await a(p);return r?r(f):f},i,s);return()=>c.dispose()}}var df=d.createIdentifier("application_block_inserted"),tn=20,ed=({source:e,emailtags:t,group:r,tags:o,...a})=>a;function td({revisions:e,revisionsByBlock:t,readAutosave:r,savedAt:o}){const a=async(i,s)=>(t.clear(),await t.get(i,{page:s}),(await e.cache.values()??[]).filter(c=>String(c?.parent)===String(i)));return{async readRevisions(i,s=1){const c=await a(i,s);return{revisions:c.slice(tn*(s-1),tn*s),page:s,hasMore:c.length>tn*s}},async readAutosave(i){const s=await o?.(i)??NaN,c=Number.isFinite(s)?s:void 0,u=await r?.(i);if(u?.asked){const p=u.revision?[{...u.revision,parent:i,isAutosave:!0}]:[];return n.autosaveStateFromSlots(p,c)}return n.autosaveStateFromRevisions(await a(i,1),c)},async saveAutosave(i,s){const c=ed(s);return await e.create({...c,parent:i,isAutosave:!0,modified:new Date().toString()})}}}var rd=n.createEventIdentifier("plugin.readBlockAutosave"),bo=d.createIdentifier$1("blockDocuments.provided");function nd(e){if(e.getInstance(bo))return;e.inject(bo,!0);const t=n.blockRevisionsDataSourceProvider(e),r=n.blocksDataSourceProvider(e);n.injectBlockHistoryPort(e,td({revisions:t,revisionsByBlock:t.byForeignKey("parent"),readAutosave:async o=>{const a=await n.getEmitter(e,rd).fire(o);return a.length===0?{asked:!1}:{asked:!0,revision:a[0]??null}},savedAt:async o=>Date.parse((await r.cache.getIfPresent(o))?.modified??"")}))}var uf=d.createIdentifier$1("plugin.earlyWindow"),pf=d.createIdentifier$1("DataController"),mf=d.createIdentifier$1("DataEvents"),od=d.createIdentifier$1("plugin.pluginStart");function ad(e){return e.getOrCreateInstance(od,()=>{let t;const r=new Promise(o=>{t=o});return e.getInstance(d.DISPOSABLE_ID)?.addDispose(()=>t()),{done:r,finish:t}})}function id(e){const t=ad(e);return t.run===void 0&&(t.run=(e.getInstance(d.PLUGIN_COLLECTION_ID)?.activate()??Promise.resolve()).finally(t.finish)),t.run}var sd=d.createIdentifier$1("plugin.startupShow");function cd(e){return e.getInstance(sd)?.current??Promise.resolve()}var Eo=Zr(async()=>({instance:{}})),So=Zr(async e=>({instance:{},async setOptions(){await id(e),await cd(e)}})),ff=d.combineMixins([Eo,So]),wo=()=>({title:"",description:"",website:"",company_size:"",industry:"",email:"",phone:"",logo_url:""}),ld={title:"title",description:"description",website:"website",company_size:"company_size",industry:"industry",email:"email",phone:"phone",logo_url:"logo"},ko=e=>({...wo(),title:e?.title??"",description:e?.description??"",website:e?.website??"",company_size:e?.company_size??"",industry:e?.industry??"",email:e?.email??"",phone:e?.phone??"",logo_url:e?.logo??""}),Co=e=>(e??[]).filter(t=>!!t?.code).map(({code:t,label:r})=>({value:t,label:r??t})),dd=e=>({company_sizes:Co(e?.company_sizes),industries:Co(e?.industries)}),gf=Object.keys(wo()),Ao="ProjectProfile",Kt=n.createApi({reducerPath:"projectSettingsProfileApi",baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Ao],endpoints:e=>({getProjectProfile:e.query({async queryFn(t,r){const o=n.v2ResultOf(await n.getClientV2(d.getContainer(r)).projects.profileList({id:String(t)}));return"error"in o?{error:o.error}:{data:ko(o.data)}},providesTags:(t,r,o)=>[{type:Ao,id:String(o)}]}),getProjectProfileOptions:e.query({async queryFn(t,r){const o=n.v2ResultOf(await n.getClientV2(d.getContainer(r)).projects.profileOptionsList());return"error"in o?{error:o.error}:{data:dd(o.data)}}}),updateProjectProfileField:e.mutation({async queryFn({projectId:t,field:r,value:o},a){const i={[ld[r]]:o},s=n.v2ResultOf(await n.getClientV2(d.getContainer(a)).projects.profilePartialUpdate({id:String(t)},i));return"error"in s?{error:s.error}:{data:ko(s.data)}},async onQueryStarted({projectId:t},{dispatch:r,queryFulfilled:o}){try{const{data:a}=await o;r(Kt.util.updateQueryData("getProjectProfile",t,()=>a))}catch{}}})})}),{useGetProjectProfileQuery:hf,useGetProjectProfileOptionsQuery:yf,useUpdateProjectProfileFieldMutation:vf}=Kt,Io="ProjectStorage",Yt=n.createApi({reducerPath:"projectSettingsStorageApi",baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Io],endpoints:e=>({getProjectStorage:e.query({async queryFn(t,r){const o=n.v2ResultOf(await n.getClientV2(d.getContainer(r)).projects.storageList({id:String(t)}));return"error"in o?{error:o.error}:{data:o.data}},providesTags:(t,r,o)=>[{type:Io,id:String(o)}]}),updateProjectStorage:e.mutation({async queryFn({projectId:t,body:r},o){const a=n.v2ResultOf(await n.getClientV2(d.getContainer(o)).projects.storageUpdate({id:String(t)},r));return"error"in a?{error:a.error}:{data:a.data}},async onQueryStarted({projectId:t},{dispatch:r,queryFulfilled:o}){const{data:a}=await o;r(Yt.util.upsertQueryData("getProjectStorage",t,a))}}),testProjectStorageConnection:e.mutation({async queryFn({projectId:t,body:r},o){const a=n.v2ResultOf(await n.getClientV2(d.getContainer(o)).projects.storageTestCreate({id:String(t)},r));return"error"in a?{error:a.error}:{data:a.data}}})})}),{useGetProjectStorageQuery:_f,useUpdateProjectStorageMutation:bf,useTestProjectStorageConnectionMutation:Ef}=Yt,ud=class{http;constructor(e){this.http=e}settings_summary_detail=({projectId:e,...t},r={})=>this.http.request({path:`/projects/v1/settings-summary/${e}`,method:"GET",...r})},To=class{http;constructor(e){this.http=e}developer_credentials_detail=({projectId:e,...t},r={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"GET",...r});developer_credentials_partial_update=({projectId:e,...t},r={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"PATCH",...r});developer_credentials_rotate_secret_create=({projectId:e,...t},r={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/rotate-secret`,method:"POST",...r});developer_credentials_verify_secret_create=({projectId:e,...t},r={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/verify-secret`,method:"POST",...r})},pd=class{http;constructor(e){this.http=e}developer_kit_postman_collection_list=(e={})=>this.http.request({path:"/projects/v1/developer-kit/postman-collection",method:"GET",...e})},md=class{http;constructor(e){this.http=e}billing_context_detail=({projectId:e,...t},r={})=>this.http.request({path:`/projects/v1/billing-context/${e}`,method:"GET",...r});billing_context_payments_list=({projectId:e,...t},r={})=>this.http.request({path:`/projects/v1/billing-context/${e}/payments`,method:"GET",query:t,...r})},fd=class{http;constructor(e){this.http=e}usage_detail=({projectId:e,...t},r={})=>this.http.request({path:`/projects/v1/usage/${e}`,method:"GET",...r});usage_timeseries_list=({projectId:e,...t},r={})=>this.http.request({path:`/projects/v1/usage/${e}/timeseries`,method:"GET",query:t,...r})},Ae={PLUGIN_INIT:"plugin_init",LINK_CHECK:"link_check",IMAGE_CHECK:"image_check",SPAM_ASSASSIN:"spam_assassin",AI_IMAGE:"ai_image",AI_WRITE:"ai_write",AI_REPHRASE:"ai_rephrase"},St={TODAY:"today",WEEK:"week",MONTH:"month",CUSTOM:"custom"},Sf=[Ae.PLUGIN_INIT,Ae.LINK_CHECK,Ae.IMAGE_CHECK,Ae.SPAM_ASSASSIN,Ae.AI_IMAGE,Ae.AI_WRITE],Mt={current:0,limit:null},gd=()=>({pluginInit:{...Mt},aiAssistant:{...Mt},aiImage:{...Mt},linkCheck:{...Mt},imageCheck:{...Mt},spamAssassin:{...Mt}}),Le=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Te=(e,t,r="")=>{for(const o of t){const a=e[o];if(typeof a=="string")return a;if(typeof a=="number"&&Number.isFinite(a))return String(a)}return r},dt=(e,t,r=0)=>{for(const o of t){const a=e[o];if(typeof a=="number"&&Number.isFinite(a))return a;if(typeof a=="string"&&a.trim()&&Number.isFinite(Number(a)))return Number(a)}return r},rn=(e,t,r=!1)=>{for(const o of t){const a=e[o];if(typeof a=="boolean")return a}return r},br=(e,t)=>{for(const r of t){const o=e[r];if(o===null)return null;if(typeof o=="number"&&Number.isFinite(o))return o;if(typeof o=="string"&&o.trim()&&Number.isFinite(Number(o)))return Number(o)}return null},hd=new Set(Object.values(Ae)),yd=e=>hd.has(e)?e:null,wt=e=>Le(e)&&"data"in e&&(e.ok===!0||typeof e.success=="boolean"||e.success===void 0)?e.data:e,jt=(e,t)=>{for(const r of t){const o=e[r];if(Le(o))return o}return null},vd=(e,t)=>{for(const r of t){const o=e[r];if(!Array.isArray(o))continue;const a=o.filter(i=>typeof i=="string");if(a.length>0)return a}},_d=e=>Le(e)?{clientId:Te(e,["clientId","client_id"]),clientSecretConfigured:rn(e,["clientSecretConfigured","client_secret_configured"]),rotatedAt:Te(e,["rotatedAt","rotated_at"])||void 0,scopesSuggested:vd(e,["scopesSuggested","scopes_suggested"])}:{clientId:"",clientSecretConfigured:!1},Po=(e,t)=>{for(const r of t){const o=e[r];if(typeof o=="boolean")return o}},bd=e=>{const t=Po(e,["pluginConnected","plugin_connected","connected","is_connected"]);if(t!==void 0)return t;for(const r of["plugin","developer_credentials","developerCredentials"]){const o=jt(e,[r]);if(!o)continue;const a=Po(o,["connected","plugin_connected","is_connected"]);if(a!==void 0)return a;const i=Te(o,["clientId","client_id"]),s=rn(o,["clientSecretConfigured","client_secret_configured"]);if(i)return s}},Ed=e=>{const t=wt(e);if(!Le(t))return{};const r=jt(t,["members"]);return{myRole:Te(t,["myRole","my_role","role"])||(r?Te(r,["myRole","my_role","role"]):"")||void 0,pluginConnected:bd(t)}},Sd=e=>Le(e)?{clientId:Te(e,["clientId","client_id"]),secret:Te(e,["secret","clientSecret","client_secret"])}:{clientId:"",secret:""},wd=e=>{if(!Le(e))return null;const t=Te(e,["event","type","key"]),r=yd(t);if(!r)return null;const o=e.delta??e.change??e.trend,a=o==null?null:typeof o=="number"&&Number.isFinite(o)?o:Number.isFinite(Number(o))?Number(o):null;return{event:r,total:dt(e,["total","count","value"],0),delta:a}},xo=e=>{if(!Le(e))return null;const t=Te(e,["date","day","x"]);if(!t)return null;const r={date:t},o=e.event_counts??e.eventCounts;if(Le(o)){for(const[a,i]of Object.entries(o))typeof i=="number"&&Number.isFinite(i)&&(r[a]=i);return r}for(const[a,i]of Object.entries(e))a==="date"||a==="day"||a==="x"||a==="event_counts"||a==="eventCounts"||typeof i=="number"&&Number.isFinite(i)&&(r[a]=i);return r},kd=e=>{const t=wt(e);return Le(t)?(Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:Array.isArray(t.time_series)?t.time_series:Array.isArray(t.history)?t.history:[]).map(xo).filter(r=>r!==null):[]},Cd=e=>{if(!Le(e))return{current:0,limit:null};const t=dt(e,["current","count","used","value","total"],0),r=br(e,["limit","max","quota","cap"]);return{current:t,limit:r===null?null:r}},Lt=(e,t)=>{for(const r of t)if(r in e)return Cd(e[r]);return{current:0,limit:null}},Dt={pluginInit:[Ae.PLUGIN_INIT,"plugin_init","pluginInit"],aiAssistant:["ai_assistant","aiAssistant","ai"],aiImage:[Ae.AI_IMAGE,"ai_image","ai_img","aiImg"],linkCheck:[Ae.LINK_CHECK,"link_check","linkCheck"],imageCheck:[Ae.IMAGE_CHECK,"image_check","imageCheck"],spamAssassin:[Ae.SPAM_ASSASSIN,"spam_assassin","spamAssassin","spam_check","spamCheck"]},nn=e=>{const t=gd(),r=wt(e),o=Le(r)&&Le(r.usage)?r.usage:r;if(!Le(o))return t;const a=dt(o,["operationsTotal","operations_total"],0),i=dt(o,["operationsLast30d","operations_last_30d"],0),s=jt(o,["metrics","counters","limits","events","usage_by_event","usageByEvent"])??o;return{pluginInit:Lt(s,Dt.pluginInit),aiAssistant:Lt(s,Dt.aiAssistant),aiImage:Lt(s,Dt.aiImage),linkCheck:Lt(s,Dt.linkCheck),imageCheck:Lt(s,Dt.imageCheck),spamAssassin:Lt(s,Dt.spamAssassin),lastActivityAt:Te(o,["lastActivityAt","last_activity_at"])||void 0,operationsTotal:a>0?a:void 0,operationsLast30d:i>0?i:void 0}},Ro=(e,t)=>{const r=[{event:Ae.LINK_CHECK,total:e.linkCheck.current,delta:null},{event:Ae.IMAGE_CHECK,total:e.imageCheck.current,delta:null},{event:Ae.SPAM_ASSASSIN,total:e.spamAssassin.current,delta:null},{event:Ae.AI_IMAGE,total:e.aiImage.current,delta:null}],o=t?kd(t):[];return o.length>0?{cards:r,chart:o}:{cards:r,chart:[]}},Ad=e=>{const t=wt(e);if(!Le(t))return Ro(nn(e),e);const r=Array.isArray(t.cards)?t.cards:Array.isArray(t.summary)?t.summary:[],o=Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:[];return r.length>0||o.length>0?{cards:r.map(wd).filter(a=>a!==null),chart:o.map(xo).filter(a=>a!==null)}:Ro(nn(t),t)},Id=e=>{if(!Le(e))return null;const t=Te(e,["id","payment_id"]);return t?{id:t,date:Te(e,["date","created_at","paid_at"]),amount:dt(e,["amount","sum"],0),currency:Te(e,["currency"],"RUB"),status:Te(e,["status"],"unknown"),receiptUrl:Te(e,["receiptUrl","receipt_url","pdf_url"])||void 0}:null},Td=e=>{const t=wt(e),r=Le(t)&&Array.isArray(t.payments)?t.payments:[];return{payments:r.map(Id).filter(o=>o!==null),page:Le(t)?dt(t,["page"],1):1,perPage:Le(t)?dt(t,["perPage","per_page"],20):20,total:Le(t)?dt(t,["total"],r.length):r.length,totalPages:Le(t)?dt(t,["totalPages","total_pages"],1):1}},Pd=e=>{const t=wt(e);if(!Le(t))return{viewerSeesBilling:!1};const r=jt(t,["endpoints"])??{},o=jt(t,["documentLinks","document_links"]),a=o?Object.fromEntries(Object.entries(o).filter(f=>typeof f[1]=="string")):void 0,i=br(t,["ownerUserId","owner_user_id"]),s=jt(t,["tariff","plan","subscription"]),c=Te(t,["planDescription","plan_description"])||(s?Te(s,["description","about","plan_description"]):"")||void 0,u=br(t,["planPrice","plan_price","price","amount"])??(s?br(s,["price","amount"]):null),p=Te(t,["planCurrency","plan_currency","currency"])||(s?Te(s,["currency"]):"")||void 0;return{viewerSeesBilling:rn(t,["viewerSeesBilling","viewer_sees_billing"]),ownerUserId:i??void 0,planName:Te(t,["planName","plan_name"])||void 0,planDescription:c,planPrice:u??void 0,planCurrency:p||void 0,endpoints:{limitsStats:Te(r,["limitsStats","limits_stats"])||void 0,subscriptionMe:Te(r,["subscriptionMe","subscription_me"])||void 0,payments:Te(r,["payments"])||void 0},documentLinks:a&&Object.keys(a).length>0?a:void 0}},xd={myRole:"owner"},Rd=()=>({...xd}),Od={clientId:"rust-awkward-bear",clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"},Oo=()=>({...Od,clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"}),Mo=Object.values(Ae),Md={[Ae.PLUGIN_INIT]:42,[Ae.LINK_CHECK]:-15,[Ae.IMAGE_CHECK]:28,[Ae.SPAM_ASSASSIN]:9,[Ae.AI_IMAGE]:6,[Ae.AI_WRITE]:-11,[Ae.AI_REPHRASE]:4},jd=(e,t)=>{const r={date:e};return Mo.forEach((o,a)=>{const i=Math.sin(t*.65+a*.9),s=t*(a%2===0?.35:.2),c=2+a;r[o]=Math.max(0,Math.round(c+i*4+s))}),r},Ld=e=>Mo.map(t=>({event:t,total:e.reduce((r,o)=>r+(typeof o[t]=="number"?o[t]:0),0),delta:Md[t]})),Dd=({period:e,dateFrom:t,dateTo:r})=>{const o=(0,Gt.default)().startOf("day");if(e===St.WEEK)return{startDate:o.subtract(6,"day"),days:7};if(e===St.MONTH)return{startDate:o.subtract(29,"day"),days:30};if(e===St.CUSTOM&&t&&r){const a=(0,Gt.default)(t),i=(0,Gt.default)(r);return{startDate:a,days:Math.max(1,i.diff(a,"day")+1)}}return{startDate:o,days:1}},on=(e={period:St.TODAY})=>{const{startDate:t,days:r}=Dd(e),o=Array.from({length:r},(a,i)=>jd(t.add(i,"day").format("YYYY-MM-DD"),i));return{cards:Ld(o),chart:o}},wf=on({period:St.WEEK}),Nd={pluginInit:{current:0,limit:null},aiAssistant:{current:0,limit:null},aiImage:{current:42,limit:100},linkCheck:{current:128,limit:500},imageCheck:{current:64,limit:200},spamAssassin:{current:31,limit:150},lastActivityAt:"2026-05-02T12:00:00Z"},jo={payments:[{id:"98765",date:"2026-05-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success",receiptUrl:"https://receipts.example/98765.pdf"},{id:"98764",date:"2026-04-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success"},{id:"98763",date:"2026-03-12T10:15:00+00:00",amount:990,currency:"RUB",status:"failed"}],page:1,perPage:20,total:3,totalPages:1},Fd={viewerSeesBilling:!0,ownerUserId:1,planName:"Corporate",planDescription:"For fully addressing all necessary tasks in any field.",planPrice:3200,planCurrency:"RUB",endpoints:{limitsStats:"/wp-json/limits/v1/stats",subscriptionMe:"/wp-json/subscription/v2/me",payments:"/wp-json/projects/v1/billing-context/2581/payments"}},Ud={info:{name:"EmailMaker Plugin Requests",schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:[]},Bd=e=>e,$d=()=>!1,Gd=()=>!1,qd=e=>e,Nt="ProjectPlugin",Hd=()=>({}).REACT_APP_PLUGIN_SETTINGS_USE_MOCK==="true",vt=(e,t,r)=>e.error&&Hd()?{data:r(t)}:n.transformResponseFn(r)(e),zd=e=>Bd(_d(e)),Vd=e=>qd(Pd(e)),Wd=({period:e,dateFrom:t,dateTo:r})=>{if(e===St.CUSTOM){const o={};return t&&(o.date_from=t),r&&(o.date_to=r),o}return{period:e??St.TODAY}},Er=n.createApi({reducerPath:"projectSettingsPluginApi",baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,"")}),tagTypes:[Nt],endpoints:e=>({getPluginSummary:e.query({queryFn({projectId:t},r){return d.getApi(d.getContainer(r),[ud]).settings_summary_detail({projectId:t}).then(o=>vt(o,Rd(),Ed))},providesTags:(t,r,{projectId:o})=>[{type:Nt,id:o}]}),getPluginCredentials:e.query({queryFn({projectId:t},r){return d.getApi(d.getContainer(r),[To]).developer_credentials_detail({projectId:t}).then(o=>vt(o,Oo(),zd))},providesTags:(t,r,{projectId:o})=>[{type:Nt,id:`credentials-${o}`}]}),rotatePluginSecret:e.mutation({queryFn({projectId:t},r){return d.getApi(d.getContainer(r),[To]).developer_credentials_rotate_secret_create({projectId:t}).then(o=>vt(o,{clientId:Oo().clientId,secret:"mock-rotated-secret"},Sd))},invalidatesTags:(t,r,{projectId:o})=>[{type:Nt,id:`credentials-${o}`}]}),getPostmanCollection:e.query({queryFn({projectId:t},r){return d.getApi(d.getContainer(r),[pd]).developer_kit_postman_collection_list({extraQuery:{project_id:String(t)}}).then(o=>vt(o,Ud,a=>wt(a)??a))}}),getPluginAnalytics:e.query({queryFn({projectId:t,period:r,dateFrom:o,dateTo:a},i){const s={period:r,dateFrom:o,dateTo:a};return $d()?Promise.resolve({data:on(s)}):n.getClient(d.getContainer(i)).request({path:`/projects/v1/usage/${t}/timeseries`,method:"GET",query:Wd(s)}).then(c=>vt(c,on(s),Ad))}}),getPluginBillingContext:e.query({queryFn({projectId:t},r){return d.getApi(d.getContainer(r),[md]).billing_context_detail({projectId:t}).then(o=>vt(o,Fd,Vd))},providesTags:(t,r,{projectId:o})=>[{type:Nt,id:`billing-${o}`}]}),getPluginUsage:e.query({queryFn({projectId:t},r){return d.getApi(d.getContainer(r),[fd]).usage_detail({projectId:t}).then(o=>vt(o,Nd,nn))}}),getPluginPayments:e.query({queryFn({projectId:t,page:r=1,perPage:o=20},a){return Gd()?Promise.resolve({data:jo}):n.getClient(d.getContainer(a)).request({path:`/projects/v1/billing-context/${t}/payments`,method:"GET",query:{page:String(r),per_page:String(o)}}).then(i=>vt(i,jo,Td))},providesTags:(t,r,{projectId:o})=>[{type:Nt,id:`payments-${o}`}]})})}),{useGetPluginSummaryQuery:kf,useGetPluginCredentialsQuery:Cf,useRotatePluginSecretMutation:Af,useLazyGetPostmanCollectionQuery:If,useGetPluginAnalyticsQuery:Tf,useGetPluginBillingContextQuery:Pf,useGetPluginPaymentsQuery:xf,useGetPluginUsageQuery:Rf}=Er,Lo="EmailRaw",Sr=n.createApi({reducerPath:"emailRawApi",tagTypes:[Lo],baseQuery:n.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmailRaw:e.query({queryFn:function({emailId:t,secret_hash:r},o){return d.getApi(d.getContainer(o),[d.WpEmailApi]).email_detail({id:t},{extraQuery:{secret_hash:r}}).then(n.transformResponseFn(n.WpEmailToEmail))},providesTags:(t,r,o)=>[{type:Lo,id:o}]})})}),{useGetEmailRawQuery:Of}=Sr,wr=n.createApi({reducerPath:"yandexAuthApi",baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateYandexToken:e.mutation({query:t=>({url:"/auth/yandex",method:"POST",body:t})})})}),{useValidateYandexTokenMutation:Mf}=wr,kr=n.createApi({reducerPath:"elamaAuthApi",baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateElamaCode:e.mutation({query:t=>({url:"/auth/elama",method:"POST",body:t})})})}),{useValidateElamaCodeMutation:jf}=kr,Cr=n.createApi({reducerPath:"googleAuthApi",baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateGoogleToken:e.mutation({query:t=>({url:"/auth/google",method:"POST",body:t})})})}),{useValidateGoogleTokenMutation:Lf}=Cr,Do=async e=>{const t=await e.text();let r=t;try{r=JSON.parse(t)}catch{r=t}return r},Kd=(e,t,r)=>{if(!e)throw new Error(`Set ${r}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",headers:{"Content-Type":"application/json"},body:t,responseHandler:Do}},Yd=(e,t,r)=>{if(!e)throw new Error(`Set ${r}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t,responseHandler:Do}},Ar=n.createApi({reducerPath:"requestPlaneApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRequest:e.mutation({query:t=>Yd("https://webhook.latenode.com/5868/prod/9e7a6445-2244-4dd5-bda4-5bca82997bf8",t,"REACT_APP_PIPEDREAM_REQUEST_PLANE_SRC")}),getInvoiceRequest:e.mutation({query:t=>Kd("https://webhook.latenode.com/5868/prod/6e2d04a8-6cd9-4ec3-b884-ee2fd67267a3",t,"REACT_APP_REQUEST_PLANE_WEBHOOK_URL")})})}),{useGetRequestMutation:Df,useGetInvoiceRequestMutation:Nf}=Ar,Ir=n.createApi({reducerPath:"getCheckoutUrlApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({GetCheckoutUrl:e.mutation({query:t=>({url:`?proxy_url=${encodeURIComponent({}.REACT_APP_PIPEDREAM_GET_CHECKOUT_URL)}`,method:"POST",body:t})})})}),{useGetCheckoutUrlMutation:Ff}=Ir,an=n.createApi({reducerPath:"recoverPasswordApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/bdpwr/v1/"}),endpoints:()=>({})}),Tr=n.createApi({reducerPath:"addUserToProjectApi",baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/user_to_project/v1/add_user"}),endpoints:e=>({addUserToProject:e.mutation({queryFn(t,r){return n.clientFromApi(r).userToProject.add_user_create(t,{type:d.ContentType.FormData})}})})}),{useAddUserToProjectMutation:Uf}=Tr,Pr=n.createApi({reducerPath:"recurrenceSubscriptionsOffApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getCanselRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/07ae4159-132b-4a00-998b-bc47c20365ba?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetCanselRecurrenceQuery:Bf,useGetCanselRecurrenceQuery:$f}=Pr,xr=n.createApi({reducerPath:"recurrenceSubscriptionsOnApi",baseQuery:n.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/e1dd37b1-c3d4-4441-b329-d6b3aa51bfe7?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetRecurrenceQuery:Gf,useGetRecurrenceQuery:qf}=xr,Qd="https://app.emailmaker.ru/api/v2",Rr=n.createApi({reducerPath:"authApi",baseQuery:n.fetchBaseQueryApp({baseUrl:Qd,prepareHeaders:e=>{const t=n.api.get(n.APP_COOKIES.em_token);return t&&!e.has("authorization")&&e.set("authorization",`Bearer ${t}`),e}}),endpoints:e=>({login:e.mutation({query:t=>({url:"/auth/token",method:"POST",body:t})}),register:e.mutation({query:t=>({url:"/auth/register",method:"POST",body:t})}),refreshToken:e.mutation({query:t=>({url:"/auth/token/refresh",method:"POST",body:t})}),logout:e.mutation({query:()=>({url:"/auth/token",method:"DELETE"})}),getUser:e.query({query:()=>"/auth/user"}),changePassword:e.mutation({query:t=>({url:"/auth/password/change",method:"POST",body:t})}),resetPassword:e.mutation({query:t=>({url:"/auth/password/reset",method:"POST",body:t})}),resetPasswordConfirm:e.mutation({query:t=>({url:"/auth/password/reset/confirm",method:"POST",body:t})})})}),{useLoginMutation:Hf,useRegisterMutation:zf,useRefreshTokenMutation:Vf,useLogoutMutation:Wf,useGetUserQuery:Kf,useLazyGetUserQuery:Yf,useChangePasswordMutation:Qf,useResetPasswordMutation:Jf,useResetPasswordConfirmMutation:Xf}=Rr;function No(e){return{id:e.id??0,name:e.name??"",children:(e.children??[]).map(No)}}function Jd(e){return(e?.folders??[]).map(No)}function Xd(e){return{items:(e?.items??[]).flatMap(t=>t.id?[{kind:t.kind??"email",id:t.id,name:t.name??"",title:t.title??"",preheader:t.preheader??"",folderId:t.folder_id??0,hasAmp:t.has_amp??!1,previewImage:t.preview_image??"",updatedAt:t.updated_at??"",imported:t.imported??!1}]:[]),total:e?.total??0}}function sn(e){const t=e.status??"pending";return{id:e.id??"",status:t,outcome:e.outcome,total:e.total??0,imported:e.imported??0,warnings:e.warnings??0,failed:e.failed??0,finished:t==="done"||t==="failed",items:(e.items??[]).map(r=>({kind:r.kind??"email",stripoId:r.stripo_id??0,name:r.name??"",status:r.status??"failed",reason:r.reason,emailId:r.email_id})),createdAt:e.created_at??"",finishedAt:e.finished_at}}function Zd(e){return{selectors:e.map(t=>({kind:t.kind,...t.ids?.length?{ids:t.ids}:{},...t.all?{all:!0}:{},...t.folderId?{folder_id:t.folderId}:{},...t.rootOnly?{root_only:!0}:{},...t.search?{search:t.search}:{}}))}}var cn="StripoItems",ln="StripoFolders",Or="StripoImportJob",Ft=(e,t)=>{const r=n.v2ResultOf(e);return"error"in r?{error:r.error}:{data:t(r.data)}},Mr=n.createApi({reducerPath:"stripoImportApi",tagTypes:[cn,ln,Or],baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({saveStripoKey:e.mutation({async queryFn({projectId:t,apiKey:r},o){return Ft(await n.getClientV2(d.getContainer(o)).projects.stripoKeyUpdate({id:String(t)},{api_key:r}),()=>{})},invalidatesTags:[cn,ln]}),getStripoFolders:e.query({async queryFn({projectId:t,kind:r},o){return Ft(await n.getClientV2(d.getContainer(o)).projects.stripoFoldersList({id:String(t),kind:r}),Jd)},providesTags:[ln]}),getStripoItems:e.query({async queryFn({projectId:t,kind:r,folderId:o,rootOnly:a,search:i,page:s,limit:c},u){return Ft(await n.getClientV2(d.getContainer(u)).projects.stripoItemsList({id:String(t),kind:r,...o?{folder_id:o}:{},...a?{root_only:!0}:{},...i?{search:i}:{},page:s,limit:c}),Xd)},providesTags:[cn]}),startStripoImport:e.mutation({async queryFn({projectId:t,selectors:r},o){return Ft(await n.getClientV2(d.getContainer(o)).projects.stripoImportsCreate({id:String(t)},Zd(r)),sn)},invalidatesTags:[Or]}),getCurrentStripoImport:e.query({async queryFn(t,r){const o=await n.getClientV2(d.getContainer(r)).projects.stripoImportsCurrentList({id:String(t)});return o.status===204?{data:null}:Ft(o,sn)},providesTags:[Or]}),getStripoImport:e.query({async queryFn({projectId:t,jobId:r},o){return Ft(await n.getClientV2(d.getContainer(o)).projects.stripoImportsDetail({id:String(t),jobId:r}),sn)},providesTags:[Or]})})}),{useSaveStripoKeyMutation:Zf,useGetStripoFoldersQuery:eg,useGetStripoItemsQuery:tg,useLazyGetStripoItemsQuery:rg,useStartStripoImportMutation:ng,useGetCurrentStripoImportQuery:og,useGetStripoImportQuery:ag}=Mr,eu=n.createState({activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),tu="projectSlice",dn=n.createSlice({name:tu,initialState:eu,reducers:{setActiveGroupsTags:(e,{payload:t})=>{e.activeGroupsTags=t,t.length&&(e.activeProjectGroupsTags=[])},setActiveProjectGroupsTags:(e,{payload:t})=>{e.activeProjectGroupsTags=t,t.length&&(e.activeGroupsTags=[])},resetAllTags:e=>{e.activeProjectGroupsTags=[],e.activeGroupsTags=[]}},extraReducers:e=>{e.addMatcher(n.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{payload:r,meta:o})=>{const{projectId:a}=o.arg.originalArgs;a?(t.groupsTemplateProjectTotal=+o.baseQueryMeta?.response.headers.get("X-WP-Total"),t.groupsTemplateProjectTotalPages=+o.baseQueryMeta?.response.headers.get("X-WP-TotalPages")):t.groupsTemplateTotal=+o.baseQueryMeta?.response.headers.get("X-WP-Total")})}}),{setActiveGroupsTags:ig,setActiveProjectGroupsTags:sg,resetAllTags:cg}=dn.actions,ru=n.createState({emailsTotal:0,elementsList:[],emailsTrashTotal:0,elementsTrashList:[],customFolders:{},elementsView:n.CARDS}),nu="emailsPageSlice";function ou(e){const t=e?.baseQueryMeta?.response;return Number(t?.headers?.get("X-WP-Total"))||0}function Fo(e,t){const{emails:r,total:o,isSearch:a,page:i,tagOrFolderId:s}=t;if(t.status==="trash")!a&&o!==void 0&&(e.emailsTrashTotal=o),e.elementsTrashList=r;else if(s){const c=e.customFolders[s];e.customFolders={...e.customFolders,[s]:{list:r,page:i,total:o??c?.total??0}}}else o!==void 0&&(e.emailsTotal=o),e.elementsList=r}var un=n.createSlice({name:nu,initialState:ru,reducers:{resetElementsList:e=>{e.elementsList=[]},syncElementsList:(e,{payload:t})=>{Fo(e,t)},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeEmailFromList:(e,{payload:t})=>{const r=e.customFolders;t.folder!=="all"&&r[t.folder]?.list&&(r[t.folder]={...r[t.folder],list:r[t.folder].list.filter(o=>o.id!==t.emailId),total:r[t.folder].total-1},e.customFolders=r)}},extraReducers:e=>{e.addMatcher(n.emailsApi.endpoints.getEmails.matchFulfilled,(t,{meta:r,payload:o})=>{const a=r.arg.originalArgs;Fo(t,{emails:o,total:ou(r),status:a?.status,page:a?.page,isSearch:!!a?.name?.length,tagOrFolderId:a?.folderTag||a?.tags?.[0]})}),e.addMatcher(n.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{meta:r,payload:o})=>{const a=+r.baseQueryMeta?.response.headers.get("X-WP-Total")||0;t.elementsList=o,t.emailsTotal=a;const{projectGroup:i,projectId:s,tags:c}=r.arg.originalArgs;(i?.length&&s||c?.length||!c?.length&&!i?.length)&&(t.emailsTotal=a)}),e.addMatcher(n.emailsApi.endpoints.editEmail.matchFulfilled,(t,{payload:r})=>{t.elementsList.map(o=>o.id?.toString()===r.id?.toString()?Object.assign(o,{lock:r.lock,title:r.title,emailtags:r.emailtags}):o)})}}),{toggleElementsView:lg,resetElementsList:dg,syncElementsList:ug,removeEmailFromList:pg}=un.actions,Uo=n.combineReducers({[n.di.reducerPath]:n.di.reducer,[n.AiApi.reducerPath]:n.AiApi.reducer,[n.userSlice.name]:n.userSlice.reducer,[n.emailSlice.name]:n.emailSlice.reducer,[n.blockSlice.name]:n.blockSlice.reducer,[n.imageApi.reducerPath]:n.imageApi.reducer,[Vt.reducerPath]:Vt.reducer,[vr.reducerPath]:vr.reducer,[dn.name]:dn.reducer,[n.blocksApi.reducerPath]:n.blocksApi.reducer,[n.emailsApi.reducerPath]:n.emailsApi.reducer,[hr.reducerPath]:hr.reducer,[Zt.reducerPath]:Zt.reducer,[er.reducerPath]:er.reducer,[tr.reducerPath]:tr.reducer,[rr.reducerPath]:rr.reducer,[nr.reducerPath]:nr.reducer,[or.reducerPath]:or.reducer,[ar.reducerPath]:ar.reducer,[ir.reducerPath]:ir.reducer,[sr.reducerPath]:sr.reducer,[cr.reducerPath]:cr.reducer,[lr.reducerPath]:lr.reducer,[dr.reducerPath]:dr.reducer,[ur.reducerPath]:ur.reducer,[pr.reducerPath]:pr.reducer,[mr.reducerPath]:mr.reducer,[fr.reducerPath]:fr.reducer,[n.emailPageSlice.name]:n.emailPageSlice.reducer,[n.projectsApi.reducerPath]:n.projectsApi.reducer,[Kt.reducerPath]:Kt.reducer,[n.projectSettingsStylesApi.reducerPath]:n.projectSettingsStylesApi.reducer,[Yt.reducerPath]:Yt.reducer,[Er.reducerPath]:Er.reducer,[n.saveFileApi.reducerPath]:n.saveFileApi.reducer,[Sr.reducerPath]:Sr.reducer,[n.commentsApi.reducerPath]:n.commentsApi.reducer,[n.optimiseApi.reducerPath]:n.optimiseApi.reducer,[n.blocksPageSlice.name]:n.blocksPageSlice.reducer,[un.name]:un.reducer,[gr.reducerPath]:gr.reducer,[Cr.reducerPath]:Cr.reducer,[wr.reducerPath]:wr.reducer,[kr.reducerPath]:kr.reducer,[n.taxonomiesApi.reducerPath]:n.taxonomiesApi.reducer,[n.projectsPageSlice.name]:n.projectsPageSlice.reducer,[n.AiApiGenerator.reducerPath]:n.AiApiGenerator.reducer,[Ar.reducerPath]:Ar.reducer,[yr.reducerPath]:yr.reducer,[_r.reducerPath]:_r.reducer,[Xt.reducerPath]:Xt.reducer,[n.authorizationApi.reducerPath]:n.authorizationApi.reducer,[n.limitsApi.reducerPath]:n.limitsApi.reducer,[n.revisionHistorySlice.name]:n.revisionHistorySlice.reducer,[Ir.reducerPath]:Ir.reducer,[n.defaultModePanesSlice.name]:n.defaultModePanesSlice.reducer,[an.reducerPath]:an.reducer,[Tr.reducerPath]:Tr.reducer,[n.confirmationMailApi.reducerPath]:n.confirmationMailApi.reducer,[xr.reducerPath]:xr.reducer,[Pr.reducerPath]:Pr.reducer,[Rr.reducerPath]:Rr.reducer,[n.projectSettingsV2Api.reducerPath]:n.projectSettingsV2Api.reducer,[Mr.reducerPath]:Mr.reducer}),au=(e,t)=>t.type==="authorizationApi/resetApiState"?Uo({[n.reducerPath]:e[n.reducerPath]},t):Uo(e,t),Bo=[n.AiApi,n.imageApi,vr,n.emailsApi,Vt,n.blocksApi,hr,Zt,er,tr,rr,nr,or,ar,ir,sr,cr,lr,dr,ur,pr,mr,fr,Sr,n.projectsApi,Kt,n.projectSettingsStylesApi,Yt,Er,n.commentsApi,n.optimiseApi,n.saveFileApi,gr,Cr,n.taxonomiesApi,wr,kr,n.AiApiGenerator,Ar,n.authorizationApi,n.limitsApi,yr,_r,Xt,Ir,an,Rr,n.projectSettingsV2Api,Mr,Tr,n.confirmationMailApi,xr,Pr];function iu(e){let t={};if(e){const o=d.createIdentifier$1();d.DependencyResolver.inject(o,e),t={INJECTION:o}}const r=n.configureStore({reducer:au,middleware:o=>o({serializableCheck:!1}).concat(Bo.map(a=>a.middleware)),preloadedState:t});return n.setupListeners(r.dispatch),r}var $o=d.createIdentifier$1("RtkApiRegistry");function su(e,t){e.inject($o,new Map(t.map(r=>[r.reducerPath,r])))}function Ke(e,t){const r=e?.getInstance($o)?.get(t);if(!r)throw new Error(`RTK api "${t}" is not in the container registry (provideRtkApiRegistry did not run)`);return r}function cu(e,t){let r={isCodeMode:void 0,direction:void 0};return n.provideCodeMode(e).watch(o=>{r.isCodeMode!==o.isCodeMode&&t.dispatch(n.setCodeMode(o.isCodeMode)),r.direction!==o.direction&&t.dispatch(n.switchCodeModeDirection(o.direction)),r={isCodeMode:o.isCodeMode,direction:o.direction}})}function lu(e,t){const r=n.provideCurrentUser(e),o=n.authorizationApi.endpoints.getMe.select("");let a=r.get()?.profile;const i=()=>{const s=o(t.getState()).data;!s||s===a||(a=s,r.set({profile:s}))};return i(),{dispose:t.subscribe(i)}}var du=d.createIdentifier$1("EmailSettingsPort");function uu(e,t){e.inject(du,{read:()=>n.selectEmailSettings(t.getState())??{},write:r=>{t.dispatch(n.setEmailSettings(r))},markAppearanceChanged:()=>{t.dispatch(n.markAppearanceNeedsUpdate())}})}var pu="Invalid standaloneKey.",mu="not implemented",mg=1,fu=d.createIdentifier$1("StandaloneMockGuard");function pn(){const e=new Error(pu);return e.name="InvalidStandaloneKeyError",e}function mn(e){return n.isStandaloneRuntime(d.getContainer(e))}function gu(e){return e instanceof Error?e.name==="InvalidStandaloneKeyError"||e.message==="Invalid standaloneKey."||e.message==="not implemented":e===mu}function Go(e){if(mn(e))throw pn()}function hu(e,t,r){return r instanceof Error&&r.name==="InvalidStandaloneKeyError"?r:pn()}var yu=()=>()=>{throw pn()};function vu(e){if(!e)throw new Error("DI container not found for standalone mock guard");e.inject(fu,1)}function _u(e){return typeof e!="function"}var fg="[plugin-api-mock]";function qo(){return!0}function bu(e){try{if(e===null||typeof e!="object")return e;const t={};for(const r of Object.keys(e).slice(0,12)){const o=e[r];t[r]=typeof o=="string"&&o.length>120?`${o.slice(0,120)}…(${o.length})`:o}return t}catch{return"(unserializable arg)"}}function Eu(e,t){return r=>{const o=r.query,a=r.queryFn||((i,s,c,u)=>{if(!o)throw new Error("query not found EndpointDefinition");return u(o(i))});a&&(r.query=void 0,r.queryFn=async(i,s,c,u)=>{try{let p;const f=d.getContainer(s).getServices(e);for(let g=f.length-1;g>=0;g--){const y=f[g];if(p=p?await p(async l=>await y.execute(l),s):await y.execute(i),_u(p))return{data:p,error:null}}if(p)p=await p(async(g,y=s,l=c,v=u)=>{Go(s);const w=await a(g,y,l,v);if(w.error)throw w.error;return w.data},s);else{Go(s),qo();const g=await a(i,s,c,u);if(g.error)throw g.error;p=g.data}return{data:p,error:null}}catch(p){return mn(s)&&gu(p)?{error:hu(t,bu(i),p)}:(qo(),{error:p})}})}}var Ho=new Set;function He(e){return(t,r)=>{const o=Object.create(null),a=Object.keys(r),i=new d.Disposable;for(const s of a){const c=`api_listeners_flag_${t.reducerPath}/${s.toString()}`,u=d.createIdentifier$1(`api_listeners_${t.reducerPath}/${s.toString()}`);Ho.has(c)||(o[s]=Eu(u,`${t.reducerPath}/${s.toString()}`),Ho.add(c)),i.addDisposable(e.addService(u,{execute:r[s]}))}return Object.keys(o).length&&t.enhanceEndpoints({endpoints:o}),n.getDisposable(e).addDisposable(i),i}}function zo(e,t){for(const r of Object.keys(t))try{t[r](e)}catch{}}function gg(e){return e}function Vo(e,t){return e({body:t}).catch(()=>new Promise(r=>setTimeout(r,1e3)))}function Su(e){He(e)(Ke(e,"AiApi"),{sendMessage:({body:t})=>async(r,o)=>{const a=n.getEmitter(e,d.events.AI_TEXT_REQUEST_ID);if(!a.hasListeners())return Vo(r,t);const i=t,s={message:i.message??i.context,locale:i.locale,entityId:i.entity_id,projectId:i.project_id!=null?String(i.project_id):void 0,subject:i.subject,preheader:i.preheader,textContent:i.textContent,context:i.context??i.connection,connection:i.connection,onProgress:(c,u)=>{n.getEmitter(e,d.events.AI_TEXT_PROGRESS_ID).fire({progress:Number.isFinite(c)?c:0,status:typeof u=="string"?u:void 0})},onStreamChunk:c=>{typeof c!="string"||!c||n.getEmitter(e,d.events.AI_TEXT_STREAM_ID).fire({partialHtml:c})},signal:o.signal};for(const c of a.getListeners([s])){const u=await c(s);if(u)return{status:200,_eventResult:!0,aiMessage:typeof u.message=="string"?u.message:"",aiHtml:typeof u.html=="string"?u.html:void 0}}return Vo(r,t)},getDialog:t=>(r,o)=>mn(o)?Promise.resolve({documents:[],totalCount:0}):r(t)})}function wu(e){const t=He(e),r=n.getEmitter(e,d.events.FILE_PROXY_EVENT_ID);t(Ke(e,"proxyApi"),{async getFile({url:o,tryFetch:a=!0,type:i}){return async s=>{const{requested:c}=n.getCurrentProject(e),u=(await r.fire({url:o,project:c})).filter(p=>p instanceof Blob)[0];if(u)switch(i){case"json":return JSON.parse(await u.text());case"text":return u.text();default:return u}else return s({url:o,tryFetch:a,type:i})}}})}function ku(e){He(e)(Ke(e,"tokenApi"),{tokenCreate(t){return r=>r(t)},tokenValidate(){return t=>t({})}})}function hg(e){return e}function Cu(e){He(e)(Ke(e,"imageApi"),{sendAiImageRequest:function({body:t}){return async(r,o)=>{const a=n.getEmitter(e,d.events.AI_IMAGE_REQUEST_ID);if(!a.hasListeners()||t.request!=="create-image")return r({body:t});const i={prompt:t.message??"",size:t.size,entityId:t.entity_id,projectId:t.project_id!=null?String(t.project_id):void 0,onProgress:(s,c)=>{n.getEmitter(e,d.events.AI_IMAGE_PROGRESS_ID).fire({progress:Number.isFinite(s)?s:0,status:typeof c=="string"?c:void 0})},signal:o.signal};for(const s of a.getListeners([i])){const c=await s(i);if(c&&c.images?.length)return{data:{status:200,_eventResult:!0,task:{images:c.images}}}}return r({body:t})}},getAiImage(t){return r=>r(t)}})}async function Wo(e,t,r,o,a){try{const i=(await e.fire({project:String(t),emailId:r})).filter(s=>s!=null);if(i.length)return i.flat()}catch{}return o(a)}function Au(e){if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0}function Iu(e){const t=He(e),r=Ke(e,"blocksApi"),o=n.blocksDataSourceProvider(e),a=o.byForeignKey("project"),i=n.blockRevisionsDataSourceProvider(e);i.byForeignKey("parent");const{dispatch:s}=n.getStore(e),c=n.getDisposable(e);c.addDisposable(o.onChange(()=>s(r.util.invalidateTags(["Blocks"])))),c.addDisposable(o.onSave(({prev:f,patch:g,value:y})=>{const l=f?{...f,...g}:g;let v=n.mergeEntityPreservingMeta(f,g,y);return l&&v.html===l.html&&v.title===l.title&&(v={...v,renderGuid:l.renderGuid}),v},Number.MIN_VALUE));const u=n.getEmitter(e,n.READ_COMMON_BLOCKS_EVENT_ID),p=n.getEmitter(e,n.READ_TEMPLATE_BLOCKS_EVENT_ID);t(r,{async getBlocks(f){const g={};f.name&&(g.title=f.name),f.type&&(g.type=f.type);const y=Au(f.projectId)??await n.getBlocksProject(e);return await a.get(y,{filter:g,page:f.page,pageSize:f.pageSize,order:f.order,orderBy:f.orderby}).then(({data:l})=>l)},getBlocksSchema(){return f=>f(void 0)},getParentEmailBlocks(f){return async g=>{if(!p.hasListeners())return[];const y=n.getCurrentProject(e).requested||"";return Wo(p,y,f.emailId||"",g,f)}},getTemplateBlocks(f){return async g=>{const y=n.getCurrentProject(e).requested||"";return Wo(u,y,f.emailId||"",g,f)}},getBlock(f){return n.readBlockById(e,f)},addBlock(f){return async g=>{const y=await o.create(f);return n.getAppConfig(e).preventSendDataToEM||g(y).catch(l=>{}),y}},editBlock({blockId:f,...g}){return o.update(f,g)},deleteBlock(f){return o.remove(typeof f=="object"?f.id:f)},addTag(f){return f},getDeletableTag([f,g]){return[]},autoSaveBlock({blockId:f,body:g}){return i.create({...g,parent:f,isAutosave:!0})}})}function Tu(e){const{emails:t,emailRevisions:r}=n.provideEmailDocuments(e),{dispatch:o}=n.getStore(e),a=n.getDisposable(e),i=He(e),s=Ke(e,"emailsApi");a.addDisposable(t.onChange(async()=>{o(s.util.invalidateTags(["Email"]))})),i(s,{getEmails:c=>[],getTemplateEmails:c=>[],async addEmail({source:c,...u}){const p=await t.create(u,{source:c});return p.renderGuid||(p.renderGuid=d.generateUUID()),p},editEmail(c){return async u=>{const{emailId:p,source:f,...g}=c;return n.isRevisionServiceEnabled(e)&&await u(c),t.update(p,g,{source:f})}},deleteEmail(c){return t.remove(typeof c=="object"?c.id:c)},addTag(){throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)},getDeletableTag([c,u]){return[]},autoSaveEmail({emailId:c,body:u}){return async p=>{n.isRevisionServiceEnabled(e)&&await p({emailId:c,body:u});const f=await r.create({...u,parent:c,modified:new Date().toString()});return f&&!f.html&&u.html?{...f,html:u.html}:f}}})}var Pu="tmp",yg=d.createIdentifier$1();function xu(e){const t=He(e);if(!e.getInstance(d.DISPOSABLE_ID))throw new Error("Something was wrong");const r=n.getEmitter(e,d.events.UPLOAD_EVENT_ID),o=n.getEmitter(e,d.events.ON_SEND_TESTEMAIL_ID),a=n.getEmitter(e,d.events.ON_SEND_LIVEPREVIEW_ID);t(Ke(e,"saveFileApi"),{uploadImage(i){return async s=>{const{requested:c}=n.getCurrentProject(e),u=async()=>s({...i,user_id:String((await e.getInstanceAsync(d.APP_ID)).app_id)});if(i.folder===Pu)return u();const p=await n.fireUploadImageEvent(r,{file:i.file,project:c});if(p.url)return[{file_url:p.url,project:c}];if(!n.shouldFallbackToBuiltInUpload(p,{isStandalone:n.isStandaloneRuntime(e)}))throw n.toUploadImageError(p);return u()}},sendTestEmail(i){return async s=>{const{requested:c}=n.getCurrentProject(e);(await o.fire({project:c,email_id:i.email_id,subject:i.subject,email:i.email,html:i.html,from_name:i.from_name})).some(u=>u===!1)&&await s({...i,user_id:String((await e.getInstanceAsync(d.APP_ID)).app_id)})}},async sendLivePreview(i){const{requested:s}=n.getCurrentProject(e);(await a.fire({project:s,id:i.email,subject:i.subject,html:i.content})).some(c=>c===!1)},sendShortLink(i){return s=>s(i)}})}function Ru(e){He(e)(Ke(e,"emailRawApi"),{getEmailRaw({emailId:t,secret_hash:r}){throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)}})}function _t(e,t){for(var r=e<0?"-":"",o=Math.abs(e).toString();o.length<t;)o="0"+o;return r+o}function Ou(e,t){var r,o;n.requiredArgs(1,arguments);var a=li(e);if(isNaN(a.getTime()))throw new RangeError("Invalid time value");var i=String((r=t?.format)!==null&&r!==void 0?r:"extended"),s=String((o=t?.representation)!==null&&o!==void 0?o:"complete");if(i!=="extended"&&i!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(s!=="date"&&s!=="time"&&s!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var c="",u="",p=i==="extended"?"-":"",f=i==="extended"?":":"";if(s!=="time"){var g=_t(a.getDate(),2),y=_t(a.getMonth()+1,2),l=_t(a.getFullYear(),4);c="".concat(l).concat(p).concat(y).concat(p).concat(g)}if(s!=="date"){var v=a.getTimezoneOffset();if(v!==0){var w=Math.abs(v),A=_t(Math.floor(w/60),2),P=_t(w%60,2),M=v<0?"+":"-";u="".concat(M).concat(A,":").concat(P)}else u="Z";var O=_t(a.getHours(),2),D=_t(a.getMinutes(),2),G=_t(a.getSeconds(),2),S=c===""?"":"T",T=[O,D,G].join(f);c="".concat(c).concat(S).concat(T).concat(u)}return c}function Mu(e){const t=He(e),r=Ke(e,"commentsApi"),o=n.commentsDataSourceProvider(e),a=o.byForeignKey("post"),{dispatch:i}=n.getStore(e);n.getDisposable(e).addDisposable(o.onChange(()=>i(r.util.invalidateTags(["Comments"])))),t(r,{getComments(s){return a.get(s).then(({data:c})=>c)},addComment({subjectId:s,author:c,parent:u,content:p,author_name:f,author_email:g,targetId:y}){const l={post:s,author:c,author_name:f,author_email:g,content:p,parent:u,target_id:y,date:Ou(new Date),author_avatar_urls:{}};return o.create(l)},deleteComment(s){return o.remove(s)},editComment({commentId:s,...c}){return o.update(s,c)},deleteTarget(s){return o.update(s,{target_id:""})}})}function fn(e){return{id:String(e),name:"",myRole:"",members:[],invites:[],emailsCount:0,blocksCount:0,title:"",group:[],folder:[],blockfolder:[]}}function Ko(e,t){return{project:Number(e),app_id:t?.app_id||0,app_config:t?.app_config||{},user:t?.user}}function ju(e,t){const r=fn(String(t)),o=n.getCurrentProject(e).card;return o&&String(o.id)===String(t)?Promise.resolve({...r,...o,id:String(t)}):Promise.resolve({...r,id:String(t)})}function Lu(e){let t,r;const o=a=>((t!==a||!r)&&(t=a,r=ju(e,a)),r);He(e)(Ke(e,"projectsApi"),{getProjects(a={page:1}){return[]},getProject(a){return async i=>n.isStandaloneRuntime(e)?i(a):{...await o(a),id:String(a)}},addProject(a){throw new Error},async editProject({projectId:a,...i}){const s={...await o(a),...i,id:String(a)};return t=a,r=Promise.resolve(s),s},deleteProject(a){throw new Error},mutateProjectMembers(){throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)},addProjectMember(){throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)},getFrequentProjects(){return[]}})}function Du(e){let t={id:"0",username:"",email:"",password:"",code_editor:{},theme:"light",locale:n.getCurrentUser(e).profile?.locale,counters:{},avatar_urls:{},autosaves:!0};He(e)(Ke(e,"authorizationApi"),{getSchema:()=>r=>r({}),getMe:()=>t,editMe:r=>t={...t,...r},getSubscriptions:()=>[]})}function Nu(e){He(e)(Ke(e,"notificationsApi"),{getNotifications(t){return[]},notificationShown({id:t,datetime:r}){throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Fu(e){He(e)(Ke(e,"addUserToProjectApi"),{addUserToProject:()=>{}})}function Uu(e){n.injectEmailTermsResolver(e,{resolve:async()=>{}}),He(e)(Ke(e,"taxonomiesApi"),{getTerms:()=>[],getStandardGroups:()=>[],addTerm:()=>{throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)},editTerm:t=>({id:t.id,name:t.name,parent:0,count:0}),deleteTerm:()=>{throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Bu(e){He(e)(Ke(e,"projectSettingsV2Api"),{getProjectIntegrations:()=>({}),getProjectWebhook:()=>"",getProjectStorage:()=>({}),getProjectTestRecipients:()=>[],getIntegrationCredentials:()=>({}),putProjectIntegration:()=>{throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)},deleteProjectIntegration:()=>{throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectWebhook:()=>{throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectSettings:()=>{throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectTestRecipients:()=>{throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)}})}function $u(e){He(e)(Ke(e,"stripoImportApi"),{getStripoFolders:()=>[],getStripoItems:()=>({items:[],total:0}),getCurrentStripoImport:()=>null,getStripoImport:()=>{throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)},saveStripoKey:()=>{throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)},startStripoImport:()=>{throw new Error(d.NOT_IMPLEMENTED_IN_PLUGIN)}})}var Yo={addUserToProjectApiMock:Fu,AiApiMock:Su,authorizationApiMock:Du,blocksApiMock:Iu,commentsApiMock:Mu,emailsApiMock:Tu,emailRawApiMock:Ru,imageApiMock:Cu,notificationsApiMock:Nu,projectsApiMock:Lu,projectSettingsV2ApiMock:Bu,proxyApiMock:wu,saveFileApiMock:xu,stripoImportApiMock:$u,taxonomiesApiMock:Uu,tokenApiMock:ku},gn=n.createApi({reducerPath:"tokenApi",baseQuery:n.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/jwt-auth/v1/"}),endpoints:e=>({tokenCreate:e.mutation({queryFn(t,r){return n.clientFromApi(r).jwtAuth.token_create({body:t,type:d.ContentType.Json})}}),tokenValidate:e.mutation({queryFn(t,r){return n.clientFromApi(r).jwtAuth.token_validate_create({type:d.ContentType.Json})}})})}),{useTokenCreateMutation:vg,useTokenValidateMutation:_g}=gn;function hn(){const e=new Map;for(const t of Bo)e.set(t.reducerPath,t);return e.set(gn.reducerPath,gn),[...e.values()]}function Gu(e,t){const r=Object.keys(t.endpoints);r.length&&e(t,Object.fromEntries(r.map(o=>[o,yu])))}function qu(e){vu(e);const t=He(e);for(const r of hn())Gu(t,r)}function Hu(e){if(!e)return;const t=d.decodeJwt(e)?.data,r=t?.data?.scope??t?.scope;return(Array.isArray(r)?r.flatMap(o=>typeof o=="string"?o.split(/\s+/):[]):typeof r=="string"?r.split(/\s+/):[]).find(o=>/^project_\d+$/.test(o))?.replace(/^project_/,"")||void 0}var zu={AiApi:new Set(["sendMessage","getDialog"]),imageApi:new Set(["sendAiImageRequest","getAiImage","getAiImageSSE"])};function Vu(e){return n.getAppConfig(d.getContainer(e))}function Wu(e){return e?.backendProxy!==void 0&&e?.backendProxyPolicy?.proxyAi===!0}function Ku(e){return Wu(Vu(e))}function Yu(e,t,r,o){return zu[t]?.has(r)?a=>Ku(e)?i=>i(a):o(a):o}function Qu(e){const t=He(e);return((r,o)=>{if(!r||typeof r.reducerPath!="string")return new d.Disposable;const a=Object.fromEntries(Object.entries(o??{}).map(([i,s])=>[i,typeof s=="function"?Yu(e,r.reducerPath,i,s):s]));return t(r,a)})}function Ju(e){const t=`blocks_${d.generateUUID().replaceAll("-","")}`,r=document.createElement("script");return r.type="text/javascript",r.text=`window.${t}(function(module, exports, require) { ${e}; })`,new Promise((o,a)=>{window[t]=function(i){const s={exports:{}},c=()=>{};i(s,s.exports,c),o(s.exports)},document.head.appendChild(r)}).finally(()=>{r.remove(),delete window[t]})}async function Qo(e){const t=d.getContainer(e),r=t?.getInstance(d.STANDALONE_PROJECT_ID),o=r?void 0:await t?.getInstanceAsync(d.APP_ID).catch(()=>{}),a=r||(o?.project!==void 0?String(o.project):void 0);a&&t&&n.setCurrentProjectCard(t,fn(a))}async function Xu(e,t){try{const r=function(c){const u=e.getInstance(d.STANDALONE_PROJECT_ID),p=u?Ko(u,c):c;e.injectFactory(d.APP_ID,async()=>p)},o=Qu(e),a=await n.readZipFromBase64(t),i=a.key&&n.zipEntryToText(a.key);if(typeof i!="string")return;const s=await Ju(i);if(typeof s!="object"||s===null||typeof s.execute!="function")return;s.execute(r,o,hn())}catch{}}async function Jo(e,t){qu(d.getContainer(e)),await Xu(d.getContainer(e),t),zo(d.getContainer(e),Yo)}var Zu=Jt(async e=>{const t=iu(e);e.inject(d.STORE_ID,t),su(e,hn()),uu(e,t),n.getDisposable(e).addDisposable(lu(e,t)),n.getDisposable(e).addDisposable(cu(e,t));const r=d.getContainer(t);r&&(e.inject(d.MESSAGE_SERVICE_ID,n.getMessageService(r)),e.inject(n.CURRENT_PROJECT_ID,n.provideCurrentProject(r)));const o=e.getInstance(d.SECURITY_MODULE_ID);return o?(await Jo(t,o),await Qo(t)):zo(d.getContainer(t),Yo),{instance:{}}}),Xo=["historyEnabled","commentsEnabled","aiAssistentEnabled","livePreviewEnabled","sendTestEnabled","sharePreviewEnabled","webversionEnabled","optimizeSpamAssassinEnabled","exportWebHookEnabled","aiLayoutConverterEnabled","elementAIimageEnabled","elementAItextEnabled","revisionService"];function ep(e){const t={...e};for(const r of Xo)t[r]=!1;return t}function tp(e){const t={...e};for(const r of Xo)r in t&&typeof t[r]=="boolean"&&(t[r]=!1);return t}function rp(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t={};for(const[r,o]of Object.entries(e))!o||typeof o!="object"||Array.isArray(o)||(t[r]=tp(o));return Object.keys(t).length>0?t:void 0}function yn(e){const t=ep(e),r=rp(e.advancedConfigs),o={...t};return r?o.advancedConfigs=r:delete o.advancedConfigs,o}var bg=1,np=2592e6;function Zo(){return"emailmaker".trim()||void 0}function op(e){return{schemaVersion:1,savedAt:Date.now(),project:e.project,app_id:e.app_id,app_config:yn(ta(e.app_config))}}function ea(e){return{...e,app_config:ta(e.app_config)}}function ta(e){if(!e||typeof e!="object"||Array.isArray(e))return{};try{if(typeof structuredClone=="function")return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{return{}}}async function ap(e){const t=Zo();t&&await pp(t,op(e))}async function ip(e=Date.now()){const t=Zo();if(t)return mp(t,e)}function sp(e,t=Date.now()){return e.savedAt>t?!1:t-e.savedAt<=np}function ra(e){if(!e||typeof e!="object")return!1;const t=e,r=typeof t.project=="number"&&Number.isFinite(t.project)||typeof t.project=="string"&&t.project.trim()!=="";return t.schemaVersion===1&&typeof t.savedAt=="number"&&Number.isFinite(t.savedAt)&&r&&typeof t.app_id=="number"&&Number.isFinite(t.app_id)&&t.app_config!=null&&typeof t.app_config=="object"&&!Array.isArray(t.app_config)}var ct="snapshots",cp=1;function lp(){return`${"emailmaker".trim()||"plugin"}-plugin-deferred-config`}function jr(){return new Promise((e,t)=>{if(typeof indexedDB>"u"){t(new Error("indexedDB is not available"));return}const r=indexedDB.open(lp(),cp);r.onerror=()=>t(r.error||new Error("indexedDB open failed")),r.onupgradeneeded=()=>{const o=r.result;o.objectStoreNames.contains(ct)||o.createObjectStore(ct)},r.onsuccess=()=>e(r.result)})}function dp(e){return new Promise((t,r)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>r(e.error||new Error("indexedDB request failed"))})}function up(){return{async get(e){const t=await jr();try{const r=await dp(t.transaction(ct,"readonly").objectStore(ct).get(e));return r===void 0?void 0:r}finally{t.close()}},async put(e,t){const r=await jr();try{const o=r.transaction(ct,"readwrite");o.objectStore(ct).put(t,e),await new Promise((a,i)=>{o.oncomplete=()=>a(),o.onerror=()=>i(o.error||new Error("indexedDB write failed")),o.onabort=()=>i(o.error||new Error("indexedDB write aborted"))})}finally{r.close()}},async delete(e){const t=await jr();try{const r=t.transaction(ct,"readwrite");r.objectStore(ct).delete(e),await new Promise((o,a)=>{r.oncomplete=()=>o(),r.onerror=()=>a(r.error||new Error("indexedDB delete failed")),r.onabort=()=>a(r.error||new Error("indexedDB delete aborted"))})}finally{t.close()}},async clear(){const e=await jr();try{const t=e.transaction(ct,"readwrite");t.objectStore(ct).clear(),await new Promise((r,o)=>{t.oncomplete=()=>r(),t.onerror=()=>o(t.error||new Error("indexedDB clear failed")),t.onabort=()=>o(t.error||new Error("indexedDB clear aborted"))})}finally{e.close()}}}}var na,vn;function _n(){return na||(vn||(vn=up()),vn)}function oa(e){_n().delete(e).catch(()=>{})}async function pp(e,t){if(ra(t))try{await _n().put(e,ea(t))}catch{}}async function mp(e,t=Date.now()){try{const r=await _n().get(e);if(r===void 0)return;if(!ra(r)){oa(e);return}if(!sp(r,t)){oa(e);return}return ea(r)}catch{return}}function fp(e,t){if(e.getInstance(d.STANDALONE_FILE_PROXY_REGISTERED_ID))return;e.inject(d.STANDALONE_FILE_PROXY_REGISTERED_ID,!0);const r=d.getEvent(e,d.events.FILE_PROXY_EVENT_ID);t.addDisposable(r(async({url:o})=>(await fetch(o)).blob(),Number.MIN_VALUE))}function aa(e){try{return Hu(e)||void 0}catch{return}}async function gp(e,t,r){if(!e)return;let o;try{const a=await e(t,r,void 0);o=String(a||"").trim()}catch{return}if(o)return{token:o,serverProjectId:aa(o)}}function hp(e){if(e==null)return;const t=String(e).trim();return/^\d+$/.test(t)?t:void 0}function yp(e){const t=String(e.getInstance(d.JWT_TOKEN_ID)||"").trim();if(t)return aa(t)}function ia(e,t,r){e.inject(d.APP_ID,void 0),e.inject(d.APP_ID,Promise.resolve(Ko(t,r)))}function vp(e){return{app_id:e.app_id,app_config:yn(e.app_config)}}async function sa(){const e=await ip();return e?vp(e):{app_config:yn({})}}function _p(e,t){e.getInstance(d.STANDALONE_ACTIVATED_ID)||(e.inject(d.SECURITY_MODULE_ID,void 0),e.inject(d.STANDALONE_BOOTSTRAP_TOKEN_ID,void 0),e.inject(d.STANDALONE_PROJECT_ID,void 0),t&&e.inject(d.APP_ID,void 0),e.inject(d.STANDALONE_FILE_PROXY_REGISTERED_ID,void 0))}async function ca(e){const{container:t,store:r,standaloneKey:o,project:a,reason:i,getAuthToken:s,user:c}=e,u=e.disposable||t.getInstance(d.DISPOSABLE_ID);if(t.getInstance(d.STANDALONE_ACTIVATED_ID))return;const p=await gp(s,c,a),f=hp(a),g=p?.serverProjectId??yp(t)??(p?void 0:f);t.inject(d.SECURITY_MODULE_ID,o);let y=!1;try{if(p&&(t.inject(d.STANDALONE_BOOTSTRAP_TOKEN_ID,Promise.resolve(p.token)),s&&d.recreateTokenProvider(t,s,c,a)),g){const l=await sa();t.inject(d.STANDALONE_PROJECT_ID,g),ia(t,g,l),y=!0,n.setCurrentProjectCard(t,fn(g))}if(await Jo(r,o),y=!0,!g){await Qo(r);const l=t.getInstance(d.STANDALONE_PROJECT_ID);if(l)ia(t,l,await sa()),y=!0;else if(t.getInstance(d.APP_ID)!==void 0)try{(await t.getInstanceAsync(d.APP_ID))?.project==null}catch{}}u&&fp(t,u),t.inject(d.STANDALONE_ACTIVATED_ID,!0)}catch(l){throw _p(t,y),l}}async function bp(e,t,r,o){const a=o?.attemptTimeout??d.isFailoverEnabled(r),i=d.isFailoverEnabled(r)?d.getOrderedOriginCandidates(r):d.getOriginChain(r).length>0?[d.getActiveBaseUrl(r)]:[];if(i.length===0)throw new Error("[apiOriginFailover] no API base URL configured");const s=e.startsWith("/")?e:`/${e}`;let c,u;for(let p=0;p<i.length;p++){const f=i[p],g=p===i.length-1,y=a?d.beginFailoverAttempt(t.signal):void 0;try{const l=await fetch(`${f}${s}`,{...t,...y?{signal:y.signal}:{}});if(!l.ok&&d.shouldFailoverResponse(l.status)){if(c=l,!g){d.reportOriginFailure(f,r);continue}break}return l.ok&&d.reportOriginSuccess(f,r),l}catch(l){const v=y?.timeoutError();if(!v&&!d.shouldFailoverError(l))throw l;u=v||l,g||d.reportOriginFailure(f,r)}finally{y?.done()}}if(d.isFailoverEnabled(r)&&d.abandonStickyOrigin(),c)return c;throw u instanceof Error?u:new Error("[apiOriginFailover] fetch chain failed")}function Ep(e,t){const r=String(t.baseUrl||"").trim();if(r)return d.resolveExplicitApiBaseUrl(r);const o=e.getInstance(d.REST_CLIENT_FACTORY_ID),a=String(o?.getOptions()?.baseUrl||"").trim();return d.resolveExplicitApiBaseUrl(a||void 0)}async function Sp(e,t){if(t.getAuthToken)try{const r=await t.getAuthToken(t.user,t.project,void 0);if(String(r||"").trim())return!0}catch{if(!t.jwtAuth)return!1}if(t.jwtAuth)try{if(String(e.getInstance(d.JWT_TOKEN_ID)||"").trim())return!0;const r=Ep(e,t);if(!r)return!1;const o=await bp("/jwt-auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.jwtAuth)},r,{attemptTimeout:!0});if(!o.ok)return!1;const a=await o.json();return a.token?(e.inject(d.JWT_ERROR_ID,void 0),e.inject(d.JWT_TOKEN_ID,a.token),!0):!1}catch{return!1}return!1}async function wp(e){try{if(e.getInstance(d.APP_ID)===void 0)return!1;const t=await Cp(e.getInstanceAsync(d.APP_ID));return t!=null&&t.project!=null?t:!1}catch{return!1}}function kp(){return d.getFailoverAttemptTimeoutMs()*Math.max(1,d.getOriginChain().length)}function Cp(e){const t=kp();return new Promise((r,o)=>{const a=setTimeout(()=>{r(void 0)},t);e.then(i=>{clearTimeout(a),r(i)},i=>{clearTimeout(a),o(i)})})}function la(e){return String(e.standaloneKey||"").trim()||void 0}function Ap(e){return e.standaloneOnAuthFailure===!0?!0:e.config?.standaloneOnAuthFailure===!0}function Ip(e){return Ap(e)?!!la(e):!1}var Tp=Jt(async e=>{const t=e.getInstance(d.DISPOSABLE_ID),r=()=>e.getInstanceAsync(d.STORE_ID);return{async setOptions(o){if(!Ip(o)){e.getInstance(d.STANDALONE_ACTIVATED_ID);return}const a=la(o);if(!a||e.getInstance(d.STANDALONE_ACTIVATED_ID))return;const i=await r(),s=!!(o.getAuthToken||o.jwtAuth),c=s?await Sp(e,o):!0;if(s&&!c){await ca({container:e,store:i,standaloneKey:a,project:o.project,getAuthToken:o.getAuthToken,user:o.user,disposable:t,reason:"auth pipeline failed"});return}const u=await wp(e);if(u){await ap(u).catch(()=>{});return}await ca({container:e,store:i,standaloneKey:a,project:o.project,getAuthToken:o.getAuthToken,user:o.user,disposable:t,reason:"app_init failed"})}}});function Pp(e){return{font_size:e.fontSize,font_family:e.fontFamily,tab_size:e.tabSize,word_wrap:e.wordWrap,minimap:e.minimap,insert_spaces:e.insertSpaces}}function xp(e){return{fontSize:e.fontSize,fontFamily:e.fontFamily,tabSize:e.tabSize,wordWrap:e.wordWrap!=="off",minimap:e.minimap?.enabled,insertSpaces:e.insertSpaces}}var Rp=d.createIdentifier$1("plugin.publicConfig");function bn(e){return e.getInstance(d.CONFIG_SOURCE_ID)?.get()??{}}function da(e){return e.getInstance(d.CONFIG_SOURCE_ID)?.layers()??{base:{},profile:{},serverSide:{},user:{},local:{},advancedConfigs:{}}}function ua(e){const t=n.getCodeMode(e),r=bn(e);return{...r,locale:r.locale||"ru_RU",theme:r.theme||"light",editor:xp(n.getEditorOptions(e)),codeModeDirection:t.isCodeMode?t.direction:"none"}}function pa(e){return e.getInstance(d.CONFIG_SOURCE_ID)?.get()!==void 0}function Op(e){const t=_o(),r=n.getEmitter(e,d.CONFIG_CHANGED_EVENT_ID);let o,a,i=!1;const s=async()=>{try{return e.getInstance(d.APP_ID)===void 0?{}:(await e.getInstanceAsync(d.APP_ID))?.app_config||{}}catch{return{}}},c=async({onlyChangedCodeMode:g=!1}={})=>{await e.getInstance(d.CONFIG_SOURCE_ID)?.ready(),n.getRevisionServiceFlag(e).set(bn(e).revisionService===!0);const{codeModeDirection:y,editor:l}=bn(e);l&&n.applyEditorOptions(e,Pp(l)),y!==void 0&&!(g&&y===a)&&(a=y,y==="none"?n.setCodeMode$1(e,!1):(n.setCodeMode$1(e,!0),n.setCodeModeDirection(e,y)))},u=async()=>{if(!pa(e))return;const g=ua(e),y=JSON.stringify(g);y!==o&&(o=y,await r.fire(g))},p=async g=>{const y=e.getInstance(d.CONFIG_SOURCE_ID),l={advancedConfigs:da(e).advancedConfigs,serverSide:await s(),user:g};y?.setAdvancedConfigs({...l.advancedConfigs,...l.user?.advancedConfigs});const v=y?.layers().user.mode;y?.replace(l.user?.mode===void 0&&v!==void 0?{...l.user,mode:v}:l.user,"user"),y?.replace(l.serverSide,"server"),await c(),await u()},f=g=>{const{commonStyles:y,...l}=g;return"commonStyles"in g&&n.setDefaultCommonStyles(e,y===void 0?void 0:y),l};return{queue:t,reactToConfig:c,emitConfigChanged:u,resolveServerSideConfig:s,getConfig:()=>pa(e)?ua(e):{},setConfig:t.decorate(async g=>{await p(f(g))}),updateConfig:t.decorate(async g=>{const y=f(g);await p({...da(e).user,...y})}),announceAssembled(){i||(i=!0,e.getInstance(d.CONFIG_SOURCE_ID)?.ready().then(t.decorate(async()=>{await c({onlyChangedCodeMode:!0}),await u()})))}}}function Mp(e){return e.getOrCreateInstance(Rp,()=>Op(e))}async function ma(e){const t=n.getCurrentUser(e).profile;if(t)return t;const r=e.getInstance(d.STORE_ID);if(r)return(await r.dispatch(n.authorizationApi.endpoints.getMe.initiate("",{forceRefetch:!0}))).data}function jp(e){const t=n.resolveTemplateDirectivesConfig(e);if(!(Object.keys(t.output).length>0||Object.keys(t.editor).length>0))return n.createBaselinePolicy();const r=new Set(Object.keys(t.output).filter(a=>t.output[a]==="html-comment")),o=new Set(Object.keys(t.output));return{isConfigured:()=>!0,toEditorForm:a=>n.mapper.normalizeToPolicy(a,t.editor),toOutputForm:a=>n.mapper.normalizeToPolicy(a,t.output),keepWrappedOnOutput:r,editorPolicy:t.editor,warnAboutUnconfiguredInput:n.createUnconfiguredInputWarner(o)}}var Lp=Zr(e=>{const t=n.getDisposable(e),r=rt(n.getEvent(e,d.events.ON_LIMIT_ID)),o=t.addDisposable(new tt(r)),a=rt(n.getEvent(e,d.events.READ_LOCALE)),i=t.addDisposable(new tt(a)),s=rt(n.getEvent(e,d.events.ON_TRANSLATE_ID)),c=t.addDisposable(new tt(s)),u=Mp(e),p=e.getInstance(d.CONFIG_SOURCE_ID)?.select(P=>P.revisionService===!0).watch(P=>n.getRevisionServiceFlag(e).set(P));p&&t.addDisposable(p);const f=_o();let g;const y=P=>{if(typeof P=="number")return String(P);if(typeof P=="string")return P},l=P=>{if(P!==void 0){const M=n.provideCurrentProject(e);M.set({...M.get(),requested:String(P)})}},v=async(P,M)=>{if(!P){const H=await ma(e);return g=y(H?.id),{didReset:!1}}const O=await ma(e),D=P.id!==void 0?y(P.id):y(O?.id),G=g!==void 0?String(g):void 0,S=D!==void 0?String(D):void 0,T=G!==void 0&&S!==void 0&&G!==S,Y={...O,...n.filterUndefined(P),id:D};if(P.id===void 0&&!O?.id&&delete Y.id,n.provideCurrentUser(e).set({profile:Y}),T&&M){const H=e.getInstance(d.INSTANCE_ID);if(H?.reset)return await H.reset(M),{didReset:!0}}return g=S,{didReset:!1}};let w;const A=f.decorate(async({config:P={},project:M,user:O,advancedConfigs:D},G)=>{e.getInstance(d.CONFIG_SOURCE_ID)?.replace(await u.resolveServerSideConfig(),"server"),await u.reactToConfig({onlyChangedCodeMode:!0}),e.inject(d.TEMPLATE_DIRECTIVES_ID,jp(e.getInstance(d.CONFIG_SOURCE_ID)?.get()?.templateDirectives)),l(M),G&&"commonStyles"in G&&n.setDefaultCommonStyles(e,G.commonStyles===void 0?void 0:G.commonStyles);const{didReset:S}=await v(O,G)});return{setOptions:u.queue.decorate(async P=>{const{config:M={},project:O,user:D,advancedConfigs:G,handleReadLocale:S,handleLimitUsage:T,handleTranslate:Y,storageProvider:H}=P;e.inject(d.STORAGE_PROVIDER_ID,H),i.setListener(S),o.setListener(T),c.setListener(Y),await A({config:M,project:O,user:D,advancedConfigs:G},P).catch(ie=>{}),await u.emitConfigChanged(),w&&w.dispose(),w=new d.Disposable}),instance:{}}}),Lr;function En(){return Lr===void 0&&(Lr=(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/6e548251.js")),void 0,{}.url).catch(e=>{throw Lr=void 0,e})),Lr}var Dp=class extends d.Disposable{_container;_dataSources;_currentEmail;_blockMetaWrites=Promise.resolve();constructor(e){super(),this._container=e,this._dataSources=n.getDataSources(e),this.addDisposable(d.getEvent(e,d.events.ON_EMAIL_CHANGED_ID)(t=>{this._currentEmail=t}))}openEmail(){const e=n.peekEmailDocuments(this._container);if(e&&n.isBlockSessionKey(e.sessionKey())&&!e.hasSuspended())throw new Error("[emailmaker] no open email: only a block is shown");return n.getOpenEmail(this._container,this._currentEmail)}async getBlocks(){const e=await this._readProjectBlocks();return await this._blockMetaWrites,(await this._dataSources.blocks.cache.values()).filter(t=>String(t.project)===String(e)).map(t=>vo(t,this._container))}async _readProjectBlocks(){const e=await n.getBlocksProject(this._container);return await this._dataSources.blocks.byForeignKey("project").get(e),e}async getComments(){const{cache:e}=this._dataSources.comments,t=await this.getEmailSnapshot();return(await e.values()).filter(r=>r.post===t.id).map(r=>Wl(r,this._container))}async getEmailRevisions(){const{cache:e}=this._dataSources.emailRevisions,t=await this.getEmailSnapshot();return(await e.values()).filter(r=>r.parent===t.id).map(r=>Kl(r,this._container))}async getEmailSnapshot(){return Ti(this.openEmail(),this._container)}async getBlockSnapshot(){const e=n.peekEmailDocuments(this._container),t=e?.current();return!e||!t||!n.isBlockSessionKey(e.sessionKey())?null:(await t.whenReady(),vo(n.snapshotBlock(t),this._container))}setEmailMeta(e){const t=n.getOpenDocument(this._container);if(!t)return;const r=t.get().attributes.meta;n.writeEmailAttributes(t,{meta:n.applyMetaPatch({meta:r},e).meta});const o=t.get().serverId;o!=null&&this._dataSources.emails.cache.addOrUpdate(o,a=>a&&n.applyMetaPatch(a,e))}setBlockMeta(e,t){const r=n.peekEmailDocuments(this._container);if(r?.sessionKey()===n.blockSessionKey(e)){const a=r.current();a&&n.writeEmailAttributes(a,{meta:n.applyMetaPatch({meta:a.get().attributes.meta},t).meta})}const o=async()=>{await this._readProjectBlocks();const{cache:a}=this._dataSources.blocks;await a.getIfPresent(e)&&await a.addOrUpdate(e,i=>i&&n.applyMetaPatch(i,t))};this._blockMetaWrites=this._blockMetaWrites.then(o).catch(()=>{})}getCodeErrors(){return n.hasCheckedCode(this._container)?n.getCodeErrors(this._container):void 0}},Np=d.createIdentifier$1("EmailDataController");function Fp(e){return e.getOrCreateInstance(Np,()=>{const t=new Dp(e);return e.getInstance(d.DISPOSABLE_ID)?.addDisposable(t),t})}var Up=class{_container;_data;constructor(e){this._container=e,this._data=Fp(e)}async getEmail(e=!0){return this.compile(e)}async compileEmail(e=!0){return this.compile(e)}async compile(e){const{compileEmail:t}=await En();return t(await this._data.getEmailSnapshot(),e,n.getTemplateDirectivesPolicy(this._container).keepWrappedOnOutput)}async validateCode(){return Zn(this._data.openEmail().html??"")}};function fa(){En().catch(()=>{})}function Bp(e){const t=n.provideHeadlessMode(e).watch(r=>{r&&fa()});e.getInstance(d.DISPOSABLE_ID)?.addDisposable(t),n.getEditorVisible(e).whenVisible(()=>{n.whenIdle(fa)})}var $p=d.createIdentifier$1("EmailOperationsController");function ga(e){return e.getOrCreateInstance($p,()=>new Up(e))}function Gp(e){ga(e),Bp(e)}function qp(e){const t=ga(e);return{getEmail:()=>t.getEmail(),async compileEmail(r,o=!0){if(!r)return t.compileEmail(o);const{compileEmail:a}=await En();return a(r,o,n.getTemplateDirectivesPolicy(e).keepWrappedOnOutput)},validateCode:()=>t.validateCode()}}var Hp=d.defineMixin(e=>{const t=e.getInstance(d.DISPOSABLE_ID),r=d.getEvent(e,d.events.UPLOAD_EVENT_ID),o=d.getEvent(e,d.events.FILE_PROXY_EVENT_ID),a=d.getEmitter(e,d.events.PROXY_URL_EVENT_ID).event,i=rt(r),s=rt(a),c=rt(o),u=t.addDisposable(new tt(i)),p=t.addDisposable(new tt(c)),f=t.addDisposable(new tt(s));return{setOptions(g){u.setListener(g.handleLoadImage),p.setListener(g.handleFileProxy),f.setListener(g.handleUrlProxy)},instance:{}}}),zp=d.defineMixin(e=>{const t=e.getInstance(d.DISPOSABLE_ID),r=d.getEvent(e,d.events.AI_TEXT_REQUEST_ID),o=d.getEvent(e,d.events.AI_IMAGE_REQUEST_ID),a=rt(r),i=rt(o),s=t.addDisposable(new tt(a)),c=t.addDisposable(new tt(i));return{setOptions(u){s.setListener(u.handleAITextRequest),c.setListener(u.handleAIImageRequest)},instance:{}}});function Eg(e){return e}var Vp=class extends Error{cycle;constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),this.cycle=e}};function Wp(e){const t=new Map;for(const r of e)for(const o of r.provides??[]){const a=t.get(o)??[];a.push(r),t.set(o,a)}return t}function Kp(e,t){const r=[];for(const o of e.awaits?.services??[])for(const a of t.get(o)??[])a!==e&&r.push(a);return r}function Yp(e){const t=Wp(e),r=[],o=new Set,a=[],i=new Set,s=c=>{if(!o.has(c)){if(i.has(c)){const u=a.indexOf(c);throw new Vp([...a.slice(u),c].map(p=>p.name))}i.add(c),a.push(c);for(const u of Kp(c,t))s(u);a.pop(),i.delete(c),o.add(c),r.push(c)}};for(const c of e)s(c);return r}var Qp="author,slug,date,modified,title,acf.html,id,parent,date_gmt",Jp="author,slug,date,modified,modified_gmt,title,acf.html,id,parent",Xp=20,Sn=[d.WpEblockApi];function ha(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}function Zp(e){return{async readRevisions(t,r=1){const o=await d.getApi(e,Sn).eblock_revisions_list({parent:t,per_page:Xp,page:r},{extraQuery:{_fields:Qp}}),a=(o?.data??[]).map(s=>n.WpBlockRevisionToBlockRevision(s)),i=Number(o?.headers?.get("X-WP-TotalPages"));return{revisions:a,page:r,hasMore:Number.isFinite(i)&&r<i}},async readAutosave(t){const r=d.getApi(e,Sn),[o,a]=await Promise.all([r.eblock_autosaves_list({id:t},{extraQuery:{_fields:Jp}}),r.eblock_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),i=(o?.data??[]).map(c=>{const u=c,p=n.WpBlockRevisionToBlockRevision(u),f=ha(u.modified_gmt);return f?{...p,modified:f}:p}),s=Date.parse(ha(a?.data?.modified_gmt)??"");return n.autosaveStateFromSlots(i,Number.isFinite(s)?s:void 0)},async saveAutosave(t,r){const o=r,a=o.global_block&&o.html?n.injectEmBlockIdIntoBlockHtml(o.html,t):o.html??"";n.writePendingData(t,{sentAt:Date.now(),html:a,common_styles:""});const i=await d.getApi(e,Sn).eblock_autosaves_create({id:t},n.BlockAutoSaveToWpBlockAutoSave({title:o.title,html:a,project:o.project,excerpt:new Date().toISOString()}),{type:d.ContentType.FormData});return n.WpBlockRevisionToBlockRevision(i?.data)}}}var em="author,slug,date,modified,title,meta,acf.html,acf.common_styles,id,parent,date_gmt",tm="author,slug,date,modified,modified_gmt,title,meta,acf.html,acf.common_styles,id,parent";function ya(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}function rm(e){return!!e?.acf?.html}var nm=20,wn=[d.WpEmailApi];function om(e){return{async readRevisions(t,r=1){const o=await d.getApi(e,wn).email_revisions_list({parent:t,per_page:nm,page:r},{extraQuery:{_fields:em}}),a=(o?.data??[]).filter(rm).map(s=>n.WpEmailRevisionToEmailRevision(s)),i=Number(o?.headers?.get("X-WP-TotalPages"));return{revisions:a,page:r,hasMore:Number.isFinite(i)&&r<i}},async readAutosave(t){const r=d.getApi(e,wn),[o,a]=await Promise.all([r.email_autosaves_list({id:t},{extraQuery:{_fields:tm}}),r.email_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),i=(o?.data??[]).map(c=>{const u=c,p=n.WpEmailRevisionToEmailRevision(u),f=ya(u.modified_gmt);return f?{...p,modified:f}:p}),s=Date.parse(ya(a?.data?.modified_gmt)??"");return n.autosaveStateFromSlots(i,Number.isFinite(s)?s:void 0)},async saveAutosave(t,r){const o=await d.getApi(e,wn).email_autosaves_create({id:t},n.EmailAutoSaveToWpEmailAutoSave(n.autosaveBody(r)),{type:d.ContentType.FormData});return n.WpEmailRevisionToEmailRevision(o?.data)}}}function am(e){return e&&typeof e=="object"&&"data"in e?e.data:e}function im(e){const t=e?.message;return typeof t=="string"&&t.trim()?t:void 0}var va=class extends Error{status;data;constructor(e,t,r=im(t)??""){super(r),this.name="EmailSaveFailedError",this.status=e,this.data=t}};function _a(e){return e?new va(e.status,am(e.error)):new va(void 0,void 0,"network: no response")}var ba=["_embedded","id","author","title","meta","emailtags","folder","group","modified","date","type","parent","date_gmt","acf.description","acf.html","acf.common_styles","acf.is_template","acf.lock","acf.parent_email","acf.project","acf.secret_hash","acf.subject","acf.utm_parameters"].join(","),kn=[d.WpEmailApi],Ea=e=>n.EmailToWpEmail(e);function sm(e){return{async readEmail(t){const r=await d.getApi(e,kn).email_detail({id:n.toNumberSafe(t)},{extraQuery:{_embed:"wp:term",_fields:ba}}).catch(o=>{throw o instanceof TypeError?new n.EmailOpenFailedError("unavailable",o):o});if(!r)throw new n.EmailOpenFailedError("unavailable");if(r.ok===!1)throw n.openFailureFromResponse(r);if(!r.data&&r.error)throw new n.EmailOpenFailedError("unavailable",r.error);return r.data?n.WpEmailToEmail(r.data):null},async createEmail(t){const r={status:"publish",...Ea(t)},o=await d.getApi(e,kn).email_create(r,{type:d.ContentType.Json});if(!o?.data||o.ok===!1)throw _a(o);return n.WpEmailToEmail(o.data)},async updateEmail(t,r){const o=await d.getApi(e,kn).email_partial_update({id:t},Ea(r),{type:d.ContentType.Json,extraQuery:{_embed:"wp:term",_fields:ba}});if(!o?.data||o.ok===!1)throw _a(o);return n.WpEmailToEmail(o.data)}}}function cm(e){n.injectRestEmailPortFactories(e,{email:sm,history:om,blockHistory:Zp})}var lm=ft.__commonJSMin(((e,t)=>{(function(r){if(typeof window>"u")return;var o=0,a,i=!1,s=!1,c=7,u="[iFrameSizer]",p=u.length,f=null,g=window.requestAnimationFrame,y=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),l={},v=null,w=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){H("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function A(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function P(_,b,C){_.addEventListener(b,C,!1)}function M(_,b,C){_.removeEventListener(b,C,!1)}function O(){for(var _=["moz","webkit","o","ms"],b=0;b<_.length&&!g;b+=1)g=window[_[b]+"RequestAnimationFrame"];g?g=g.bind(window):T("setup","RequestAnimationFrame not supported")}function D(_){var b="Host page: "+_;return window.top!==window.self&&(b=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+_:"Nested host page: "+_),b}function G(_){return u+"["+D(_)+"]"}function S(_){return l[_]?l[_].log:i}function T(_,b){ie("log",_,b,S(_))}function Y(_,b){ie("info",_,b,S(_))}function H(_,b){ie("warn",_,b,!0)}function ie(_,b,C,k){k===!0&&window.console}function oe(_){function b(){function L(){ce(ae),pe(N),nt("onResized",ae)}E("Height"),E("Width"),Se(L,ae,"init")}function C(){var L=Je.slice(p).split(":"),J=L[1]?parseInt(L[1],10):0,fe=l[L[0]]&&l[L[0]].iframe,ge=getComputedStyle(fe);return{iframe:fe,id:L[0],height:J+k(ge)+R(ge),width:L[2],type:L[3]}}function k(L){return L.boxSizing!=="border-box"?0:(L.paddingTop?parseInt(L.paddingTop,10):0)+(L.paddingBottom?parseInt(L.paddingBottom,10):0)}function R(L){return L.boxSizing!=="border-box"?0:(L.borderTopWidth?parseInt(L.borderTopWidth,10):0)+(L.borderBottomWidth?parseInt(L.borderBottomWidth,10):0)}function E(L){var J=Number(l[N]["max"+L]),fe=Number(l[N]["min"+L]),ge=L.toLowerCase(),Fe=Number(ae[ge]);T(N,"Checking "+ge+" is in range "+fe+"-"+J),Fe<fe&&(Fe=fe,T(N,"Set "+ge+" to min value")),Fe>J&&(Fe=J,T(N,"Set "+ge+" to max value")),ae[ge]=""+Fe}function j(){function L(){function ge(){var qe=0,Xe=!1;for(T(N,"Checking connection is from allowed list of origins: "+fe);qe<fe.length;qe++)if(fe[qe]===J){Xe=!0;break}return Xe}function Fe(){var qe=l[N]&&l[N].remoteHost;return T(N,"Checking connection is from: "+qe),J===qe}return fe.constructor===Array?ge():Fe()}var J=_.origin,fe=l[N]&&l[N].checkOrigin;if(fe&&""+J!="null"&&!L())throw new Error("Unexpected message received from: "+J+" for "+ae.iframe.id+". Message was: "+_.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function re(){return u===(""+Je).slice(0,p)&&Je.slice(p).split(":")[0]in l}function Oe(){var L=ae.type in{true:1,false:1,undefined:1};return L&&T(N,"Ignoring init message from meta parent page"),L}function Ee(L){return Je.slice(Je.indexOf(":")+c+L)}function $e(L){T(N,"onMessage passed: {iframe: "+ae.iframe.id+", message: "+L+"}"),nt("onMessage",{iframe:ae.iframe,message:JSON.parse(L)}),T(N,"--")}function kt(){var L=document.body.getBoundingClientRect(),J=ae.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:J.height,iframeWidth:J.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(J.top-L.top,10),offsetLeft:parseInt(J.left-L.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function Ge(L,J){function fe(){Q("Send Page Info","pageInfo:"+kt(),L,J)}le(fe,32,J)}function Ct(){function L(Fe,qe){function Xe(){l[ge]?Ge(l[ge].iframe,ge):J()}["scroll","resize"].forEach(function(ot){T(ge,Fe+ot+" listener for sendPageInfo"),qe(window,ot,Xe)})}function J(){L("Remove ",M)}function fe(){L("Add ",P)}var ge=N;fe(),l[ge]&&(l[ge].stopPageInfo=J)}function At(){l[N]&&l[N].stopPageInfo&&(l[N].stopPageInfo(),delete l[N].stopPageInfo)}function et(){var L=!0;return ae.iframe===null&&(H(N,"IFrame ("+ae.id+") not found"),L=!1),L}function q(L){var J=L.getBoundingClientRect();return K(N),{x:Math.floor(Number(J.left)+Number(f.x)),y:Math.floor(Number(J.top)+Number(f.y))}}function z(L){function J(){f=qe,xe(),T(N,"--")}function fe(){return{x:Number(ae.width)+Fe.x,y:Number(ae.height)+Fe.y}}function ge(){window.parentIFrame?window.parentIFrame["scrollTo"+(L?"Offset":"")](qe.x,qe.y):H(N,"Unable to scroll to requested position, window.parentIFrame not found")}var Fe=L?q(ae.iframe):{x:0,y:0},qe=fe();T(N,"Reposition requested from iFrame (offset x:"+Fe.x+" y:"+Fe.y+")"),window.top===window.self?J():ge()}function xe(){nt("onScroll",f)===!1?ve():pe(N)}function Ue(L){function J(){var Xe=q(qe);T(N,"Moving to in page link (#"+ge+") at x: "+Xe.x+" y: "+Xe.y),f={x:Xe.x,y:Xe.y},xe(),T(N,"--")}function fe(){window.parentIFrame?window.parentIFrame.moveToAnchor(ge):T(N,"In page link #"+ge+" not found and window.parentIFrame not found")}var ge=L.split("#")[1]||"",Fe=decodeURIComponent(ge),qe=document.getElementById(Fe)||document.getElementsByName(Fe)[0];qe?J():window.top===window.self?T(N,"In page link #"+ge+" not found"):fe()}function Be(L){var J={};if(Number(ae.width)===0&&Number(ae.height)===0){var fe=Ee(9).split(":");J={x:fe[1],y:fe[0]}}else J={x:ae.width,y:ae.height};nt(L,{iframe:ae.iframe,screenX:Number(J.x),screenY:Number(J.y),type:ae.type})}function nt(L,J){return ee(N,L,J)}function ut(){switch(l[N]&&l[N].firstRun&&bt(),ae.type){case"close":te(ae.iframe);break;case"message":$e(Ee(6));break;case"mouseenter":Be("onMouseEnter");break;case"mouseleave":Be("onMouseLeave");break;case"autoResize":l[N].autoResize=JSON.parse(Ee(9));break;case"scrollTo":z(!1);break;case"scrollToOffset":z(!0);break;case"pageInfo":Ge(l[N]&&l[N].iframe,N),Ct();break;case"pageInfoStop":At();break;case"inPageLink":Ue(Ee(9));break;case"reset":De(ae);break;case"init":b(),nt("onInit",ae.iframe);break;default:Number(ae.width)===0&&Number(ae.height)===0?H("Unsupported message received ("+ae.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):b()}}function Me(L){var J=!0;return l[L]||(J=!1,H(ae.type+" No settings for "+L+". Message was: "+Je)),J}function Qe(){for(var L in l)Q("iFrame requested init",be(L),l[L].iframe,L)}function bt(){l[N]&&(l[N].firstRun=!1)}var Je=_.data,ae={},N=null;Je==="[iFrameResizerChild]Ready"?Qe():re()?(ae=C(),N=ae.id,l[N]&&(l[N].loaded=!0),!Oe()&&Me(N)&&(T(N,"Received: "+Je),et()&&j()&&ut())):Y(N,"Ignored: "+Je)}function ee(_,b,C){var k=null,R=null;if(l[_])if(k=l[_][b],typeof k=="function")R=k(C);else throw new TypeError(b+" on iFrame["+_+"] is not a function");return R}function me(_){var b=_.id;delete l[b]}function te(_){var b=_.id;if(ee(b,"onClose",b)===!1){T(b,"Close iframe cancelled by onClose event");return}T(b,"Removing iFrame: "+b);try{_.parentNode&&_.parentNode.removeChild(_)}catch(C){H(C)}ee(b,"onClosed",b),T(b,"--"),me(_),a&&(a.disconnect(),a=null)}function K(_){f===null&&(f={x:window.pageXOffset===r?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===r?document.documentElement.scrollTop:window.pageYOffset},T(_,"Get page position: "+f.x+","+f.y))}function pe(_){f!==null&&(window.scrollTo(f.x,f.y),T(_,"Set page position: "+f.x+","+f.y),ve())}function ve(){f=null}function De(_){function b(){ce(_),Q("reset","reset",_.iframe,_.id)}T(_.id,"Size reset requested by "+(_.type==="init"?"host page":"iFrame")),K(_.id),Se(b,_,"reset")}function ce(_){function b(E){if(!_.id){T("undefined","messageData id not set");return}_.iframe.style[E]=_[E]+"px",T(_.id,"IFrame ("+R+") "+E+" set to "+_[E]+"px")}function C(E){!s&&_[E]==="0"&&(s=!0,T(R,"Hidden iFrame detected, creating visibility listener"),W())}function k(E){b(E),C(E)}var R=_.iframe.id;l[R]&&(l[R].sizeHeight&&k("height"),l[R].sizeWidth&&k("width"))}function Se(_,b,C){C!==b.type&&g&&!window.jasmine?(T(b.id,"Requesting animation frame"),g(_)):_()}function Q(_,b,C,k,R){function E(){var $e=l[k]&&l[k].targetOrigin;T(k,"["+_+"] Sending msg to iframe["+k+"] ("+b+") targetOrigin: "+$e),C.contentWindow.postMessage(u+b,$e)}function j(){H(k,"["+_+"] IFrame("+k+") not found")}function re(){C&&"contentWindow"in C&&C.contentWindow!==null?E():j()}function Oe(){function $e(){l[k]&&!l[k].loaded&&!Ee&&(Ee=!0,H(k,"IFrame has not responded within "+l[k].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}R&&l[k]&&l[k].warningTimeout&&(l[k].msgTimeout=setTimeout($e,l[k].warningTimeout))}var Ee=!1;k=k||C.id,l[k]&&(re(),Oe())}function be(_){return _+":"+l[_].bodyMarginV1+":"+l[_].sizeWidth+":"+l[_].log+":"+l[_].interval+":"+l[_].enablePublicMethods+":"+l[_].autoResize+":"+l[_].bodyMargin+":"+l[_].heightCalculationMethod+":"+l[_].bodyBackground+":"+l[_].bodyPadding+":"+l[_].tolerance+":"+l[_].inPageLinks+":"+l[_].resizeFrom+":"+l[_].widthCalculationMethod+":"+l[_].mouseEvents}function ne(_){return typeof _=="number"}function Ne(_,b){function C(){function z(Ue){var Be=l[q][Ue];Be!==1/0&&Be!==0&&(_.style[Ue]=ne(Be)?Be+"px":Be,T(q,"Set "+Ue+" = "+_.style[Ue]))}function xe(Ue){if(l[q]["min"+Ue]>l[q]["max"+Ue])throw new Error("Value for min"+Ue+" can not be greater than max"+Ue)}xe("Height"),xe("Width"),z("maxHeight"),z("minHeight"),z("maxWidth"),z("minWidth")}function k(){var z=b&&b.id||w.id+o++;return document.getElementById(z)!==null&&(z+=o++),z}function R(z){if(typeof z!="string")throw new TypeError("Invaild id for iFrame. Expected String");return z===""&&(_.id=z=k(),i=(b||{}).log,T(z,"Added missing iframe ID: "+z+" ("+_.src+")")),z}function E(){switch(T(q,"IFrame scrolling "+(l[q]&&l[q].scrolling?"enabled":"disabled")+" for "+q),_.style.overflow=(l[q]&&l[q].scrolling)===!1?"hidden":"auto",l[q]&&l[q].scrolling){case"omit":break;case!0:_.scrolling="yes";break;case!1:_.scrolling="no";break;default:_.scrolling=l[q]?l[q].scrolling:"no"}}function j(){(typeof(l[q]&&l[q].bodyMargin)=="number"||(l[q]&&l[q].bodyMargin)==="0")&&(l[q].bodyMarginV1=l[q].bodyMargin,l[q].bodyMargin=""+l[q].bodyMargin+"px")}function re(){var z=l[q]&&l[q].firstRun,xe=l[q]&&l[q].heightCalculationMethod in y;!z&&xe&&De({iframe:_,height:0,width:0,type:"init"})}function Oe(){l[q]&&(l[q].iframe.iFrameResizer={close:te.bind(null,l[q].iframe),removeListeners:me.bind(null,l[q].iframe),resize:Q.bind(null,"Window resize","resize",l[q].iframe),moveToAnchor:function(z){Q("Move to anchor","moveToAnchor:"+z,l[q].iframe,q)},sendMessage:function(z){z=JSON.stringify(z),Q("Send Message","message:"+z,l[q].iframe,q)}})}function Ee(z){function xe(){Q("iFrame.onload",z,_,r,!0),re()}function Ue(nt){if(!_.parentNode)return null;var ut=new nt(function(Me){Me.forEach(function(Qe){Array.prototype.slice.call(Qe.removedNodes).forEach(function(bt){bt===_&&te(_)})})});return ut.observe(_.parentNode,{childList:!0}),ut}var Be=A();Be&&(a=Ue(Be)),P(_,"load",xe),Q("init",z,_,r,!0)}function $e(z){if(typeof z!="object")throw new TypeError("Options is not an object")}function kt(z){for(var xe in w)Object.prototype.hasOwnProperty.call(w,xe)&&(l[q][xe]=Object.prototype.hasOwnProperty.call(z,xe)?z[xe]:w[xe])}function Ge(z){return z===""||z.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":z}function Ct(z){var xe=z.split("Callback");if(xe.length===2){var Ue="on"+xe[0].charAt(0).toUpperCase()+xe[0].slice(1);this[Ue]=this[z],delete this[z],H(q,"Deprecated: '"+z+"' has been renamed '"+Ue+"'. The old method will be removed in the next major version.")}}function At(z){z=z||{},l[q]=Object.create(null),l[q].iframe=_,l[q].firstRun=!0,l[q].remoteHost=_.src&&_.src.split("/").slice(0,3).join("/"),$e(z),Object.keys(z).forEach(Ct,z),kt(z),l[q]&&(l[q].targetOrigin=l[q].checkOrigin===!0?Ge(l[q].remoteHost):"*")}function et(){return q in l&&"iFrameResizer"in _}var q=R(_.id);et()?H(q,"Ignored iFrame, already setup."):(At(b),E(),C(),j(),Ee(be(q)),Oe())}function Ie(_,b){v===null&&(v=setTimeout(function(){v=null,_()},b))}var we={};function le(_,b,C){we[C]||(we[C]=setTimeout(function(){we[C]=null,_()},b))}function W(){function _(){function R(E){function j(Oe){return(l[E]&&l[E].iframe.style[Oe])==="0px"}function re(Oe){return Oe.offsetParent!==null}l[E]&&re(l[E].iframe)&&(j("height")||j("width"))&&Q("Visibility change","resize",l[E].iframe,E)}Object.keys(l).forEach(function(E){R(E)})}function b(R){T("window","Mutation observed: "+R[0].target+" "+R[0].type),Ie(_,16)}function C(){var R=document.querySelector("body");new k(b).observe(R,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0})}var k=A();k&&C()}function ue(_){function b(){ke("Window "+_,"resize")}T("window","Trigger event: "+_),Ie(b,16)}function Z(){function _(){ke("Tab Visible","resize")}document.visibilityState!=="hidden"&&(T("document","Trigger event: Visibility change"),Ie(_,16))}function ke(_,b){function C(k){return l[k]&&l[k].resizeFrom==="parent"&&l[k].autoResize&&!l[k].firstRun}Object.keys(l).forEach(function(k){C(k)&&Q(_,b,l[k].iframe,k)})}function Ve(){P(window,"message",oe),P(window,"resize",function(){ue("resize")}),P(document,"visibilitychange",Z),P(document,"-webkit-visibilitychange",Z)}function Ye(){function _(k,R){function E(){if(R.tagName){if(R.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+R.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}R&&(E(),Ne(R,k),C.push(R))}function b(k){k&&k.enablePublicMethods&&H("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var C;return O(),Ve(),function(R,E){switch(C=[],b(R),typeof E){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(E||"iframe"),_.bind(r,R));break;case"object":_(R,E);break;default:throw new TypeError("Unexpected data type ("+typeof E+")")}return C}}function Pe(_){_.fn?_.fn.iFrameResize||(_.fn.iFrameResize=function(C){function k(R,E){Ne(E,C)}return this.filter("iframe").each(k).end()}):Y("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==r&&Pe(window.jQuery),typeof define=="function"&&define.amd?define([],Ye):typeof t=="object"&&typeof t.exports=="object"&&(t.exports=Ye()),window.iFrameResize=window.iFrameResize||Ye()})()})),dm=ft.__toESM(lm()),um={checkOrigin:!1,minHeight:600,scrolling:!1,resizeFrom:"child"};function pm(e,t){const r=e.getRootNode(),o=typeof r.getElementById=="function"?r.getElementById(t):null;if(o&&o!==e)return;const a=e.getAttribute("id");e.id=t;try{e.iFrameResizer?.removeListeners?.()}finally{a===null?e.removeAttribute("id"):e.id=a}}function mm(e){const t=()=>e.iFrameResizer;(0,dm.default)(um,e);const r=e.id;return{resize:()=>t()?.resize?.(),dispose:()=>{pm(e,r),delete e.iFrameResizer}}}function fm(e){e.inject(n.CANVAS_RESIZER_BINDER_ID,mm)}function gm(e){const t=n.getMessageService(e),r=e.getInstance(n.LOCALE_SERVICE_ID);if(!r)return;let o="",a;const i=()=>{const u=r.snapshot(),p=u.id??"";if(!t.isInited()||p===o&&u.catalog===a)return;const f=n.createI18n(u.catalog),g=l=>f.__(l),y=n.SANDBOX_TRANSLATIONS_MAP(g);o=p,a=u.catalog,t.send(n.EVENT_TYPES.SANDBOX_TRANSLATIONS,{name:p,data:y})},s=t.onInit(()=>{o="",a=void 0,i()}),c=r.state.watch(i);e.getInstance(d.DISPOSABLE_ID)?.addDispose(()=>{s.dispose(),c.dispose()})}function hm(e){const t=e?.content?.templateId;return t==null||t===""?void 0:String(t)}function ym(e){e.getInstance(d.OPTIONS_SOURCE_ID)?.watch(t=>{const r=hm(t);r!==void 0&&Zl(e,r)})}var Cn={en_US:()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/b752ed52.js")),void 0,{}.url),ru_RU:()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/c804e4dd.js")).then(e=>e.ru_RU_exports),void 0,{}.url),uk_UA:()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/492992bb.js")),void 0,{}.url),es_ES:()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/c2daae71.js")),void 0,{}.url),pt_BR:()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/aab84cf4.js")),void 0,{}.url),de_DE:()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/b6999cba.js")),void 0,{}.url),fr_FR:()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/d2a90b69.js")),void 0,{}.url),it_IT:()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/e13d6875.js")),void 0,{}.url),pl_PL:()=>(0,je.__vitePreload)(()=>Promise.resolve().then(()=>se("./static/core/c6cd3dc2.js")),void 0,{}.url)};async function vm(e){const t=Cn[e];if(!t){const r=Cn.en_US;return r?(await r()).default:void 0}return(await t()).default}var Sg=Object.keys(Cn),_m=e=>e==="uk"?"uk_UA":e;function bm(e){e.getInstance(n.LOCALE_SERVICE_ID)?.useAntdLoader(t=>vm(_m(t)))}var Sa={id:"ru_RU",time:1792576228,hash:"a2eea21eca4b73d33ab850dc5fdb1c810ff5d5c760f57dc634db9c24f4a35590",catalog:JSON.parse(`{"":{"domain":"default","lang":"ru_RU","plural_forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2);"}," Add section":["Добавить раздел"]," email was":["письмо","письма","писем"]," from the project successfully.":["из проекта."]," successfully imported.":["импортировано."],"\\" email?":["»?"],"\\" was successfully created.":["\\" создано."],"\\" was successfully removed.":["» удалён."],"%d block removed.":["Удалён %d блок.","Удалено %d блока.","Удалено %d блоков."],"%d day":["%d день","%d дня","%d дней"],"%d day left":["%d день остался","%d дня осталось","%d дней осталось"],"%d email removed.":["Удалено %d письмо.","Удалено %d письма.","Удалено %d писем."],"%s plan":["Тариф %s"],"+0:00 London, Lisbon, Dublin":["+0:00 Лондон, Лиссабон, Дублин"],"+10:00 Sydney, Melbourne, Port Moresby":["+10:00 Сидней, Мельбурн, Порт-Морсби"],"+11:00 Honiara, Nuku'alofa, Apia":["+11:00 Хониара, Нукуалофа, Апиа"],"+1:00 Paris, Berlin, Rome":["+1:00 Париж, Берлин, Рим"],"+2:00 Athens, Kiev, Istanbul":["+2:00 Афины, Киев, Стамбул"],"+3:00 Istanbul, Doha, Baghdad":["+3:00 Москва, Санкт-Петербург, Киев"],"+4:00 Baku, Dubai, Tbilisi":["+4:00 Баку, Дубай, Тбилиси"],"+5:00 Karachi, Tashkent, Islamabad":["+5:00 Екатеринбург, Ташкент, Исламабад"],"+6:00 Almaty, Dhaka, Bishkek":["+6:00 Алматы, Дакка, Омск"],"+7:00 Bangkok, Ho Chi Minh City, Jakarta":["+7:00 Бангкок, Хошимин, Джакарта"],"+8:00 Beijing, Hong Kong, Singapore":["+8:00 Пекин, Гонконг, Сингапур"],"+9:00 Tokyo, Seoul, Jayapura":["+9:00 Токио, Сеул, Якутск"],"-10:00 Honolulu, Anchorage":["-10:00 Гонолулу, Анкоридж"],"-11:00 Pago Pago, Midway Atoll":["- 11:00 Паго-Паго, атолл Мидуэй"],"-12:00 Apia":["-12:00 Апиа"],"-1:00 Azores, Cape Verde":["-1:00 Азорские острова, Кабо-Верде"],"-2:00 South Georgia, Saint Helena":["-2:00 Южная Джорджия, остров Святой Елены"],"-3:00 Buenos Aires, Santiago, Montevideo":["-3:00 Буэнос-Айрес, Сантьяго, Монтевидео"],"-4:00 Caracas, Santo Domingo":["-4:00 Каракас, Санто-Доминго"],"-5:00 New York, Toronto, Havana":["-5:00 Нью-Йорк, Торонто, Гавана"],"-6:00 Mexico City, Guadalajara":["-6:00 Мехико, Гвадалахара"],"-7:00 Denver, Phoenix":["-7:00 Денвер, Феникс"],"-8:00 Los Angeles, Vancouver":["-8:00 Лос-Анджелес, Ванкувер"],"-9:00 Anchorage, Yukon":["-9:00 Анкоридж, Юкон"],"/ month":["/ месяц"],"1000+":["1000+"],"11–50":["11–50"],"12 hours":["12 часов"],"123456, City, 1 Example St.":["123456, Город, ул. Пример, 1"],"14 days free":["14 дней бесплатно"],"1–10":["1–10"],"20 s":["20 с"],"201–500":["201–500"],"24 hours":["24 часа"],"40 s":["40 с"],"501–1000":["501–1000"],"51–200":["51–200"],"60 s":["60 с"],"<1>Upload your own templates</1> or use <2>ready-made ones</2> to create emails from blocks.":["<1>Загружайте свои шаблоны</1> или используйте <2>готовые</2> для создания писем из блоков."],"A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.":["Расширение браузера (например, Urban VPN Proxy или аналогичные блокировщики рекламы/VPN-сервисы) вставляет код в окно предварительного просмотра письма. Это может привести к повреждению шаблона при сохранении."],"A flexible plan tailored to your needs":["Гибкий план, разработанный с учетом ваших потребностей"],"A shareable link to this page has been copied to the clipboard.":["Ссылка на страницу предпросмотра скопирована в буфер обмена."],"A test email can be sent to a maximum of 10 addresses.":["Тестовое письмо можно отправить максимум на 10 адресов."],"A-Z":["А-Я"],"AI":["AI"],"AI Assistant":["AI Ассистент"],"AI assistant":["AI Ассистент"],"AI email generation":["AI генерация письма"],"AI image":["AI картинка"],"AI image generation":["AI генерация изображений"],"AI requests":["Запросы к ИИ"],"AMP":["AMP"],"AMP visibility":["Видимость в AMP"],"API Key":["Ключ API"],"API Token":["Токен API"],"API URL":["URL API"],"Above":["Сверху"],"Accepted formats: PNG, JPG, WEBP, SVG or GIF.":["Доступные форматы: PNG, JPG, SVG или GIF."],"Access Key ID":["Идентификатор ключа доступа"],"Access ends in %s":["Доступ закончится через %s"],"Access keys and integration":["Ключи доступа и интеграция"],"Access to the user account ends soon":["Доступ к аккаунту пользователя скоро закончится"],"Access to the user account has ended":["Доступ к аккаунту пользователя закончился"],"Accessibility":["Доступность"],"Accessibility text":["Текст для людей с ограниченными возможностями"],"Accordion":["Аккордеон"],"Account Login":["Логин"],"Account settings":["Настройки аккаунта"],"Actions with the chosen text":["Действия с выбранным текстом"],"Active":["Активен"],"Active date background color":["Цвет фона активной даты"],"Active date font":["Шрифт активной даты"],"Active sessions":["Активные сессии"],"Add a common block":["Добавить общий блок"],"Add a font file or a link to the font.":["Добавьте файл шрифта или ссылку на него."],"Add a new folder":["Добавить новую папку"],"Add a new group":["Добавить группу"],"Add a new project":["Создать проект"],"Add a note":["Добавить метку"],"Add a saved block":["Добавить сохранённый блок"],"Add a template block":["Добавить шаблонный блок"],"Add an empty block":["Добавить пустой блок"],"Add block":["Добавить блок"],"Add button":["Добавить кнопку"],"Add card":["Добавить карточку"],"Add color":["Добавить цвет"],"Add column":["Добавить колонку"],"Add first color":["Добавить первый цвет"],"Add first link":["Добавить первую ссылку"],"Add group":["Добавить группу"],"Add image":["Изображение"],"Add inline image":["Вставить картинку"],"Add paragraph":["Добавить абзац"],"Add slide":["Добавить слайд"],"Add social network":["Добавить соцсеть"],"Add social network links to use in your email templates.":["Добавьте ссылки на соцсети, чтобы использовать их в шаблонах писем."],"Add some tags":["Укажите несколько тегов"],"Add up to 10 recipients":["Добавьте до 10 получателей"],"Add value":["Добавить значение"],"Add your brand palette and reuse it in the email editor.":["Добавьте палитру бренда и используйте её в редакторе писем."],"Add your first block to the folder...":["Добавьте свой первый блок в папку..."],"Address of any S3-compatible storage, for example https://storage.example.com":["Адрес любого S3-совместимого хранилища, например https://storage.example.com"],"Adds VML markup so the background image is visible in Outlook.":["Добавляет разметку VML, чтобы фоновое изображение отображалось в Outlook."],"Adds bulletproof VML markup so the button keeps rounded corners in Outlook.":["Добавляет разметку VML, благодаря чему кнопка сохраняет закругленные углы в Outlook."],"Admin":["Админка"],"Admin sections":["Разделы админки"],"Administrator":["Администратор"],"Align bottom":["По нижнему краю"],"Align center":["По центру"],"Align left":["Влево"],"Align middle":["Посередине"],"Align right":["Вправо"],"Align top":["По верхнему краю"],"Alignments":["Выравнивание"],"All":["Все"],"All EmailMaker features are available for 14 days":["Все функции EmailMaker доступны в течение 14 дней."],"All blocks saved at this point can be found in the “Saved Blocks” section in the sidebar.":["Все сохраненные на данный момент блоки можно найти в разделе «Сохраненные блоки» на боковой панели."],"All blocks saved successfully.":["Все блоки сохранены."],"All emails sent to this address will be added to your project as a template.":["Все письма, которые придут на этот адрес, будут добавлены в ваш проект в виде шаблона"],"All folders":["Все папки"],"All roles":["Все роли"],"All sessions of the user are ended":["Все сессии пользователя завершены"],"All statuses":["Все статусы"],"Allow multiple selection":["Разрешить множественный выбор"],"Allowed protocols":["Допустимые протоколы"],"Already imported":["Уже импортировано"],"Altcraft":["Altcraft"],"Alternative text":["Альтернативный текст"],"Always":["Всегда"],"Amount":["Сумма"],"An unexpected error has occurred. Our team has already been notified. Please try reloading the page.":["Произошла непредвиденная ошибка. Наша команда уже получила уведомление. Попробуйте перезагрузить страницу."],"Anchor":["Якорь"],"Anchor links do not work in Outlook, Gmail, and several other email clients.":["Якорные ссылки не работают в Outlook, Gmail и ряде других почтовых клиентов."],"Anchor name":["Имя якоря"],"Animate":["Анимация"],"Annotation type":["Тип аннотации"],"Annotations":["Аннотации"],"Any additional details":["Любые дополнительные сведения"],"Appearance":["Внешний вид"],"Appearance on mobile devices":["Внешний вид на мобильных устройствах"],"Apply":["Применить"],"Apply horizontal padding to height":["Применить горизонтальный отступ к высоте"],"Approaching usage limit. Remaining":["Приближается предел использования. Остаток"],"Apps":["Приложения"],"Are you sure you want to delete project ":["Вы уверены, что хотите удалить проект "],"Are you sure you want to disable this integration?":["Вы уверены, что хотите отключить эту интеграцию?"],"Are you sure you want to leave the project ":["Вы уверены, что хотите покинуть проект "],"Are you sure?":["Вы уверены"],"Around":["Вокруг"],"Arrow":["Стрелка"],"Arrow color":["Цвет стрелки"],"Article":["Статьи"],"At least 8 characters in both cases, including letters, numbers, and special characters.":["Минимум 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters.":["Не менее 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least one card needs an image and a link starting with https://":["Нужна хотя бы одна карточка с изображением и ссылкой, начинающейся с https://"],"Author":["Автор"],"Authorization error via Yandex":["Ошибка авторизации через Яндекс"],"Authorization keys":["Ключи авторизации"],"Auto":["Авто"],"Auto-payment enabled":["Автоплатёж включён"],"Auto-payment will be available once the subscription is linked in the payment system.":["Автоматическая оплата станет доступна после привязки подписки в платежной системе."],"Auto-prepend protocol on blur":["Автоматически добавлять протокол при потере фокуса"],"Autoplay":["Автозапуск"],"Autosave in editor":["Автосохранение в редакторе"],"Available formats: HTML, EML, ZIP":["Доступные форматы: HTML, EML, ZIP"],"Available until:":["Оплачен до:"],"BIK (bank ID)":["БИК"],"BIK must be 9 digits":["БИК должен состоять из 9 цифр"],"Back":["Назад"],"Back Home":["Вернуться"],"Back To Project":["Вернуться в проект"],"Back To Projects":["Вернуться к проектам"],"Back to Log In":["Вернуться к авторизации"],"Back to admin":["Вернуться в админку"],"Back to integrations":["К интеграциям"],"Back to users":["К списку пользователей"],"Background":["Фон"],"Background color":["Цвет фона"],"Background color of the contrast blocks":["Цвет фона контрастных блоков"],"Background image":["Фоновое изображение"],"Background image in Outlook (VML)":["Фоновое изображение в Outlook (VML)"],"Background image link/route":["Ссылка на фоновое изображение"],"Background image repeat":["Повтор фона"],"Background image size":["Размер фона"],"Bank account (RUB)":["Банковский счет (рубли)"],"Bank name":["Название банка"],"Banners":["Баннеры"],"Base URL for public access to files":["Базовый адрес для публичного доступа к файлам"],"Base background color":["Базовый цвет фона"],"Base colors":["Базовые цвета"],"Base path for uploading files":["Базовый путь для загрузки файлов"],"Base text color":["Базовый цвет текста"],"Before exporting the project, make sure to provide the URL where the webhook request will be sent":["Перед экспортом проекта необходимо заполнить url, на который будет отправляться запрос webHook"],"Below":["Снизу"],"Between bullets and text":["Между буллетами и текстом"],"Between list items":["Между пунктами списка"],"Billing":["Тарифы и оплата"],"Billing period":["Расчетный период"],"Black":["Чёрный"],"Black and White":["Чёрно-белые"],"Black circle":["Чёрный круг"],"Black circle outlined":["Чёрный круг обводка"],"Blank template":["Пустой шаблон"],"Block":["Блок"],"Block name":["Название блока"],"Block not yet loaded or global container not found.":["Код блока не загружен или глобальный контейнер не найден."],"Block styles":["Стили блока"],"Block user":["Заблокировать пользователя"],"Blocked":["Заблокирован"],"Blocks":["Блоки"],"Blocks background color":["Цвет фона блоков"],"Blocks not found":["Блоки не найдены."],"Blocks search":["Поиск блоков"],"Blocks storage":["Хранилище Blocks"],"Blue":["Синий"],"Blur radius":["Размытие"],"Body":["Сообщение"],"Border":["Рамка"],"Border color":["Цвет рамки"],"Border radius":["Скругление"],"Borders":["Рамка"],"Both":["Всегда"],"Bottom":["Снизу"],"Bottom Code panel":["Панель кода снизу"],"Bottom left corner":["Нижний левый угол"],"Bottom margin":["Отступ снизу"],"Bottom padding":["Отступ снизу"],"Bottom padding of the general text":["Нижний отступ у текста"],"Bottom right corner":["Нижний правый угол"],"Box shadow":["Тень"],"Broadcast successfully created!":["Выпуск успешно создан!"],"Browser":["Браузер"],"Browser extension detected":["Обнаружено расширение для браузера"],"Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.":["Включена функция перевода страницы в браузере (например, Google Translate). Это может привести к сбоям в работе редактора и вызывать ошибки при сохранении."],"Browser translation detected":["Обнаружен перевод с помощью браузера"],"Bucket name":["Имя бакета"],"Build newsletters from scratch with <1>structures and elements</1>.":["Собирайте рассылки с нуля с помощью <1>структур и элементов</1>."],"Bulk saving of blocks":["Массовое сохранение блоков"],"Bullet":["Буллет"],"Bullets color":["Цвет буллетов"],"Bullets font":["Шрифт буллетов"],"Bullets size":["Размер буллетов"],"Bullets type":["Тип буллетов"],"Button":["Кнопка"],"Button background color in contrasting blocks":["Цвет фона кнопок в контрастных блоках"],"Button size":["Размер кнопки"],"Button text color in contrasting blocks":["Цвет текста кнопок в контрастных блоках"],"Buttons":["Кнопки"],"Buttons background color":["Цвет фона кнопки"],"Buttons font":["Шрифт кнопки"],"Buttons font size":["Размер текста кнопки"],"Buttons letter spacing":["Межбуквенный интервал кнопки"],"Buttons text color":["Цвет текста кнопки"],"Buy":["Купить"],"Buy generations":["Купить генерации"],"Buy image check package":["Купить пакет проверки изображений"],"Buy link check package":["Купить пакет проверки ссылок"],"Buy optimization package":["Купить пакет оптимизации"],"Buy package":["Купить пакет"],"Buy spam check package":["Купить пакет проверки на спам"],"Buy test sends package":["Купить пакет тестов"],"By card":["Картой"],"Calendar":["Календарь"],"Call to Action":["Призыв к действию"],"Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it.":["Кампания создана. Dotdigital использовал отправителя по умолчанию вашей учетной записи, поскольку этот адрес электронной почты в поле «От» не зарегистрирован в качестве настраиваемого адреса отправителя. Добавьте адрес в Dotdigital и повторно экспортируйте данные, чтобы использовать его."],"Campaign successfully created!":["Кампания успешно создана!"],"Cancel":["Отмена"],"Cannot disable recurring payments":["Не удается отключить автоплатёж"],"Cannot enable recurring payments":["Не удается включить автоплатёж"],"Captcha required":["Требуется ввести капчу"],"Captcha verification failed":["Ошибка при проверке капчи"],"Caption next to checkbox":["Подпись рядом с чекбоксом"],"Caption next to options":["Подпись рядом с пунктами"],"Card":["Карточка"],"Card payment is not available for this change.":["Для данной операции оплата картой недоступна."],"Card payment is not available for this change. Use an invoice for a legal entity.":["Для данного изменения оплата картой недоступна. Для юридического лица воспользуйтесь счётом-фактурой."],"Card payment is not available for this plan change. Please contact support.":["Оплата картой недоступна при изменении тарифного плана. Пожалуйста, обратитесь в службу поддержки."],"Card payment is not available for this plan change. Use an invoice for a legal entity or contact support.":["Для данного изменения тарифного плана оплата картой недоступна. Для юридических лиц воспользуйтесь счетом-фактурой или обратитесь в службу поддержки."],"Cards":["Карточки"],"Cards view":["Карточки"],"Carousel":["Карусель"],"Case Change":["Изменение ситуации"],"Cell":["Ячейка"],"Center horizontally":["По центру"],"Center vertically":["По центру"],"Change":["Изменить"],"Change Stripo key":["Сменить ключ Stripo"],"Change folder name":["Переименовать папку"],"Change group name":["Переименовать группу"],"Change image":["Сменить изображение"],"Change name":["Переименовать"],"Change password":["Сменить пароль"],"Change plan":["Изменить тариф"],"Change role":["Изменить роль"],"Change role to Administrator":["Изменить роль на Администратор"],"Change tariff":["Сменить тариф"],"Changes are not being saved. Check your connection.":["Изменения не сохраняются. Проверьте соединение."],"Changes are not being saved: the save was rejected.":["Изменения не сохраняются: сохранение отклонено."],"Changes loaded":["Изменения загружены"],"Character limit":["Ограничение по количеству символов"],"Characters":["Символы"],"Chat support":["Чат поддержки"],"Check how your email appears across various devices and email clients.":["Проверьте, как будет выглядеть ваше письмо на разных устройствах и в разных почтовых клиентах."],"Check who and when made changes to the email template and, if necessary, restore one of the previous versions.":["Проверьте, кто и когда вносил изменения в шаблон, и при необходимости восстановите одну из предыдущих версий."],"Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.":["Проверьте письмо на наличие неработающих ссылок, отсутствующих alt-текстов, тяжелых изображений и других препятствий, которые могут помешать вашим письмам попасть в почтовые ящики."],"Check your network connection and try again.":["Проверьте подключение к сети и попробуйте ещё раз."],"Checkbox":["Чекбокс"],"Checked":["Отмечено"],"Checked fill color":["Цвет заливки отмеченного"],"Checked icon URL":["URL иконки отмеченного"],"Choose":["Выбрать"],"Choose a payment method":["Выберите способ оплаты"],"Choose a plan":["Выбрать тариф"],"Choose allowed protocols":["Выберите разрешенные протоколы"],"Choose block type":["Выберите тип блока"],"Choose complexity rules":["Выберите правила сложности"],"Choose input type":["Выберите тип ввода"],"Choose plan":["Выберите тариф"],"Clear":["Очистить"],"Clear all":["Очистить"],"Clear border":["Очистить рамку"],"Clear chat":["Очистить чат"],"Clear chat history?":["Очистить чат?"],"Clear selection":["Очистить выбор"],"Click or drag a block":["Нажмите или перетащите блок"],"Click the Add a new project button to add your first project.":["Нажмите кнопку «Добавить проект», чтобы создать свой первый проект."],"Click to select, paste from the clipboard, or drag and drop":["Перетащите изображения сюда или вставьте из буфера"],"Client ID":["Client ID"],"Client ID copied to clipboard.":["Client ID скопирован."],"Client Secret":["Client Secret"],"Client secret copied to clipboard.":["Client Secret скопирован."],"Client secret rotated successfully.":["Client Secret перевыпущен."],"Clipboard":["Буфер обмена"],"Clone":["Дублировать"],"Clone block":["Клонировать блок"],"Clone element":["Клонировать элемент"],"Clone group":["Клонировать группу"],"Close":["Закрыть"],"Closed field background":["Фон закрытого поля"],"Code":["Код"],"Code Size Warning":["Предупреждение о размере кода"],"Code editor":["Редактор кода"],"Code mode":["Режим кода"],"Code size":["Размер кода"],"Code that will replace the image \`src\`":["Код, который заменит путь к изображению"],"Collapse section":["Свернуть раздел"],"Collection of all HTTP requests used by the plugin (Postman Collection v2.1 format).":["Коллекция всех HTTP-запросов, которые использует плагин (формат Postman Collection v2.1)."],"Color":["Цвет"],"Color of the general text":["Цвет текста"],"Color settings":["Настройки цвета"],"Colors":["Цвета"],"Column":["Колонка"],"Column gap":["Отступ между колонками"],"Columns":["Колонки"],"Come up with a hint":["Придумайте подсказку"],"Coming soon":["В разработке"],"Comment":["Комментарий"],"Comment was removed.":["Комментарий удалён."],"Common blocks":["Общие блоки"],"Company size":["Размер компании"],"Complexity rules":["Правила сложности"],"Configure":["Настроить"],"Configure %s":["Настройка %s"],"Configure integration":["Настроить интеграцию"],"Configure social network link":["Настройка ссылки на соцсеть"],"Confirmation":["Подтверждение"],"Confirmation email has been sent to {confirmedEmail}.":["На адрес {confirmedEmail} отправлено письмо с подтверждением."],"Confirmation email was sent to":["Подтверждение было отправлено на"],"Connect":["Подключить"],"Connect plugin":["Подключить плагин"],"Connected":["Подключено"],"Connection established":["Соединение установлено"],"Connection test failed.":["Не удалось проверить соединение."],"Contact":["Связаться"],"Contact List ID":["ID списка контактов"],"Contact Us":["Связаться с нами"],"Contact person (full name)":["Контактное лицо (полное имя)"],"Contact sync, content personalization, and real-time campaign results tracking.":["Синхронизация контактов, персонализация содержимого и отслеживание результатов кампаний в реальном времени."],"Contacts":["Контакты"],"Contain":["Contain"],"Container":["Контейнер"],"Container width":["Ширина блока"],"Content":["Контент"],"Content styles":["Стили контента"],"Continue":["Продолжить"],"Continue (%d)":["Продолжить (%d)"],"Continue as user":["Продолжить под пользователем"],"Continue without saving":["Продолжить без сохранения"],"Contract":["Договор"],"Contract / public offer":["Договор / публичная оферта"],"Contract date":["Дата заключения договора"],"Contract number":["Номер договора"],"Contrast block":["Контрастный блок"],"Contrast block header color":["Цвет заголовка контрастного блока"],"Contrast block text color":["Цвет текста контрастного блока"],"Contrasting background color":["Контрастный цвет фона"],"Contrasting colors":["Контрастные цвета"],"Contrasting text color":["Контрастный цвет текста"],"Conversion failed":["Конвертация не удалась"],"Convert":["Конвертировать"],"Convert into an image":["Преобразовать в изображение"],"Converting layout…":["Конвертация шаблона..."],"Copy":["Копировать"],"Copy block to clipboard":["Скопировать блок в буфер обмена"],"Copy client ID":["Скопировать Client ID"],"Copy client secret":["Скопировать Client Secret"],"Copy code":["Скопировать код"],"Copy column":["Скопировать колонку"],"Copy hex":["Копировать HEX"],"Copy to clipboard":["Скопировать в буфер обмена"],"Copywriter":["Писатель"],"Corner radius":["Скругление"],"Correspondent account":["Корреспондентский счёт"],"Could not activate the trial. Please try again later or contact support.":["Не удалось активировать пробную версию. Попробуйте позже или обратитесь в службу поддержки."],"Could not extend access. Try again.":["Не удалось продлить доступ. Попробуйте ещё раз."],"Could not move files from old storage":["Не удалось переместить файлы со старого хранилища"],"Could not reach the server. Please try again later.":["Не удалось установить соединение с сервером. Пожалуйста, попробуйте позже."],"Could not save the email":["Не удалось сохранить письмо"],"Couldn\`t determine the email width":["Не удалось определить ширину письма."],"Countdown":["Таймер"],"Countdown font settings":["Шрифт таймера"],"Country selector (flag+code)":["Выбор страны (флаг + код)"],"Cover":["Cover"],"Create a new email":["Создать письмо"],"Create a password":["Создайте пароль"],"Create email":["Создать письмо"],"Create folder":["Создать папку"],"Create group":["Создать группу"],"Create new block":["Создать новый блок"],"Create new email":["Создать письмо"],"Create project":["Создать проект"],"Creating an email on request":["Создание письма по запросу"],"Creation date":["Дата создания"],"Cross":["Крест"],"Current password":["Текущий пароль"],"Custom":["Пользовательский"],"Custom fonts":["Шрифты проекта"],"Custom icon":["Пользовательская иконка"],"Customized solutions for large-scale operations with high productivity":["Индивидуальные решения для крупных компаний с высокой производительностью"],"Dark":["Тёмная"],"Dark theme":["Тёмная тема"],"Dash":["Тире"],"Dashed":["Пунктир"],"Date":["Дата"],"Date format":["Формат даты"],"Days":["Дни"],"Deal Annotation":["Аннотация акции"],"Deal Card":["Карточка акции"],"Default or bound value for the field":["Значение по умолчанию или заданное значение для поля"],"Default value":["Значение по умолчанию"],"Delete":["Удалить"],"Delete column":["Удалить колонку"],"Delete from palette":["Удалить из палитры"],"Delete from styles":["Удалить из стилей"],"Delete permanently":["Удалить навсегда"],"Delete this color from the palette?":["Удалить этот цвет из палитры?"],"Delete this font from styles?":["Удалить этот шрифт из стилей?"],"Delete this social network?":["Удалить эту соцсеть?"],"Deleted":["Удалённые"],"Describe your project":["Опишите свой проект"],"Description":["Описание"],"Description is used in other sections of the service.":["Описание используется в других разделах сервиса."],"Description must be at most 500 characters.":["Описание не длиннее 500 символов."],"Desktop":["Десктоп"],"Desktop view":["Десктопный вид"],"Details":["Подробнее"],"Developer files":["Файлы для разработчика"],"Diamond":["Ромб"],"Didn't receive an email?":["Не получили письмо?"],"Digits (0-9)":["Цифры (0–9)"],"Disable":["Отключить"],"Disable integration":["Отключить интеграцию"],"Disabled":["Отключенный"],"Disconnect Stripo":["Отключить Stripo"],"Discount code":["Промокод"],"Discount description":["Описание скидки"],"Discount description is required":["Нужно описание скидки"],"Discount must be a percentage greater than 0 and up to 100":["Скидка указывается в процентах: больше 0 и не больше 100"],"Discount with promo code: ":["Скидка по промокоду: "],"Discount, %":["Скидка, %"],"Discuss":["Обсуждение"],"Display control":["Видимость"],"Display control & Direction":["Видимость и направление"],"Display the minimap.":["Показывать миникарту кода."],"Divider":["Разделитель"],"Do not repeat background (no-repeat)":["Не повторять фон (no-repeat)"],"Domain that serves this folder: it goes into image links in emails":["Домен, который отдаёт эту папку: он попадает в ссылки на изображения в письмах"],"Don't suggest again":["Больше не предлагать"],"Done":["Готово"],"Dot color":["Цвет точки"],"Dotted":["Точки"],"Double arrow":["Двойная стрелка"],"Double quotation":["Двойная кавычка"],"Download":["Скачать"],"Download as is":["Скачать как есть"],"Draft Name":["Имя черновика"],"Draft campaign created! Open it to review and schedule.":["Проект кампании создан! Откройте его для проверки и планирования."],"Draft successfully created!":["Черновик создан!"],"Drag file here or upload from device":["Перетащите файл сюда или загрузите с устройства"],"Drag to reorder":["Можно перемещать"],"Drop here":["Вставить сюда"],"Dropdown list":["Выпадающий список"],"Duration":["Длительность"],"During export, the element is converted into an image.":["При экспорте элемент преобразуется в изображение."],"E-Commerce":["Электронная коммерция"],"E-mail":["E-mail"],"Edit":["Редактировать"],"Edit block":["Свойства блока"],"Edit element":["Редактировать элемент"],"Edit group":["Свойства группы"],"Edit icon":["Редактировать иконку"],"Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!":["Редактируйте HTML-версию шаблона письма в режиме кода и наблюдайте за изменениями в реальном времени. В EmailMaker нет ограничений на код: вы можете создавать шаблоны любой сложности!"],"Editing comments":["Редактирование комментариев"],"Education":["Образование"],"Element":["Элемент"],"Elements":["Элементы"],"Email":["Email"],"Email Subject":["Тема письма"],"Email background color":["Цвет фона письма"],"Email builder for your teamwork":["Редактор писем для совместной работы"],"Email confirmation required":["Требуется подтверждение email"],"Email confirmed":["Email подтверждён"],"Email generation":["Генерация писем"],"Email generator":["Генератор Email"],"Email layout width":["Ширина письма"],"Email name":["Название письма"],"Email not yet loaded or global container not found.":["Код письма не загружен или глобальный контейнер не найден."],"Email optimization":["Оптимизация шаблона"],"Email platforms":["Платформы"],"Email successfully copied to clipboard.":["Адрес скопирован в буфер обмена."],"Email successfully created!":["Письмо создано!"],"Email synced with the server":["Email синхронизирован с сервером"],"Email testing":["Тестирование шаблона"],"EmailMaker storage":["Хранилище EmailMaker"],"Emails":["Письма"],"Emails not found":["По данному запросу ничего не найдено."],"Embed images in the file?":["Включить изображения в файл?"],"Empty blocks":["Пустые блоки"],"Enable auto-payment":["Включить автоплатёж"],"Enabled":["Включено"],"End all sessions":["Завершить все сессии"],"End date":["Дата окончания"],"End time":["Время окончания"],"Endpoint":["Адрес хранилища"],"Ends":["Окончание"],"Ends in":["Заканчивается через"],"Enter Altcraft API token":["Введите токен API Altcraft"],"Enter Mailganer API key":["Введите ключ API Mailganer"],"Enter Sendsay API key":["Введите ключ API Sendsay"],"Enter URL":["Введите адрес"],"Enter Unisender API key":["Введите ключ API Unisender"],"Enter a URL starting with http:// or https://":["Адрес должен начинаться с http:// или https://"],"Enter a direct link to a font file (.woff2, .woff, .ttf, .otf) or a Google Fonts stylesheet.":["Укажите прямую ссылку на файл шрифта (.woff2, .woff, .ttf, .otf) или на стили Google Fonts."],"Enter a font name.":["Введите название шрифта."],"Enter a port between 1 and 65535":["Укажите порт от 1 до 65535"],"Enter a valid HEX color (e.g. #1F1F1F).":["Введите корректный HEX-цвет (например, #1F1F1F)."],"Enter a valid HEX color.":["Введите корректный HEX-цвет."],"Enter a valid URL (https://example.com or example.com).":["Введите корректный адрес (https://example.com или example.com)."],"Enter block name":["Укажите название блока"],"Enter color name":["Введите название цвета"],"Enter enKod API key":["Введите ключ API enKod"],"Enter font name":["Введите название шрифта"],"Enter heading":["Введите заголовок"],"Enter link":["Введите ссылку"],"Enter name":["Введите название"],"Enter path":["Введите путь"],"Enter preheader here":["Введите прехедер"],"Enter promo code":["Введите промокод"],"Enter subject line here":["Введите тему письма"],"Enter the access key":["Введите ключ доступа"],"Enter the block name":["Введите название блока"],"Enter the bucket name":["Введите имя бакета"],"Enter the confirmation code from the email and set a new password.":["Введите код подтверждения из письма и установите новый пароль."],"Enter the connection login":["Введите логин для подключения"],"Enter the connection password":["Введите пароль для подключения"],"Enter the email name":["Введите название письма"],"Enter the folder name":["Введите имя папки"],"Enter the group name":["Введите имя группы"],"Enter the price as a number to calculate the discount":["Укажите цену числом, чтобы рассчитать скидку"],"Enter the project name":["Введите название проекта"],"Enter the secret key":["Введите секретный ключ"],"Enter the server host":["Введите имя хоста"],"Enter the storage endpoint":["Введите адрес хранилища"],"Enter the title of the image":["Введите название изображения"],"Enter value":["Введите значение"],"Enter your contact details":["Укажите свои контакты"],"Enter your current password":["Введите текущий пароль"],"Enter your email":["Укажите ваш email"],"Enter your email address and we will send you password reset instructions.":["Введите свой адрес электронной почты, и мы вышлем вам инструкции по сбросу пароля."],"Enter your first name":["Укажите ваше имя"],"Enter your last name":["Укажите вашу фамилию"],"Enter your new password":["Введите новый пароль"],"Enter your password":["Введите ваш пароль"],"Enter your phone or email":["Введите телефон или email"],"Equalize":["Сравнять"],"Error":["Ошибка"],"Error when initializing file manager":["Ошибка инициализации файлового менеджера"],"Error when receiving data. Try again (reload page) or contact support.":["Ошибка при получении данных. Попробуйте еще раз (перезагрузите страницу) или обратитесь в службу поддержки."],"Errors":["Ошибки"],"Evaluating the task":["Обдумываю задачу"],"Example:":["Например:"],"Expand only one section":["Раскрывать только один раздел"],"Expand section":["Развернуть раздел"],"Expires":["Действует до"],"Export":["Экспорт"],"Export emails as draft campaigns to ActiveCampaign":["Экспорт писем в ActiveCampaign в виде черновиков кампаний"],"Export emails to Altcraft":["Экспорт писем в Altcraft"],"Export emails to Bento":["Экспорт писем в Bento"],"Export emails to Brevo":["Экспорт писем в Brevo"],"Export emails to Campaign Monitor":["Экспорт писем в Campaign Monitor"],"Export emails to Constant Contact":["Экспорт писем в Constant Contact"],"Export emails to Dotdigital":["Экспорт писем в Dotdigital"],"Export emails to GetResponse":["Экспорт писем в GetResponse"],"Export emails to HubSpot":["Экспорт писем в HubSpot"],"Export emails to Klaviyo":["Экспорт писем в Klaviyo"],"Export emails to Mailchimp":["Экспорт писем в Mailchimp"],"Export emails to Mailganer":["Экспорт писем в Mailganer"],"Export emails to Salesforce":["Экспорт писем в Salesforce"],"Export emails to Sendsay":["Экспорт писем в Sendsay"],"Export emails to Unisender":["Экспорт писем в Unisender"],"Export emails to enKod":["Экспорт писем в enKod"],"Export settings":["Настройки экспорта"],"Extend plan":["Продлить тариф"],"Extra limit package":["Расширенный пакет"],"Extra package is not configured for this limit.":["Для этого ограничения дополнительный пакет не настроен."],"Extra packages are only available with CloudPayments at the moment.":["На данный момент дополнительные пакеты доступны только в CloudPayments."],"Eyedropper":["Пипетка"],"Failed to clean trash":["Не удалось очистить корзину"],"Failed to complete Yandex authorization":["Не удалось пройти авторизацию в «Яндексе»"],"Failed to copy.":["Не удалось скопировать."],"Failed to create broadcast":["Не удалось создать выпуск"],"Failed to create campaign":["Не удалось создать кампанию"],"Failed to create draft":["Не удалось создать черновик"],"Failed to create email":["Не удалось создать письмо"],"Failed to create mailing":["Не удалось создать рассылку"],"Failed to create newsletter":["Не удалось создать рассылку"],"Failed to create template":["Не удалось создать шаблон"],"Failed to download file.":["Не удалось скачать файл."],"Failed to download image from URL.":["Не удалось загрузить изображение по URL-адресу."],"Failed to export the email as images. Please try again.":["Не удалось экспортировать письмо в виде изображений. Попробуйте ещё раз."],"Failed to get file: %s":["Не удалось получить файл: %s"],"Failed to load":["Не удалось загрузить"],"Failed to load GIFs":["Не удалось загрузить GIF-файлы"],"Failed to load GIFs through the configured proxy chain.":["Не удалось загрузить GIF-файлы через настроенную цепочку прокси-серверов."],"Failed to load YaSendSuggestToken script":["Не удалось загрузить скрипт YaSendSuggestToken"],"Failed to load Yandex authorization script":["Не удалось загрузить скрипт авторизации Яндекс"],"Failed to load integrations.":["Не удалось загрузить интеграции."],"Failed to load payments.":["Не удалось загрузить платежи."],"Failed to load plugin analytics.":["Не удалось загрузить аналитику плагина."],"Failed to load plugin settings.":["Не удалось загрузить настройки плагина."],"Failed to load plugin usage.":["Не удалось загрузить статистику использования плагина."],"Failed to load project styles.":["Не удалось загрузить стили проекта."],"Failed to load stock images":["Не удалось загрузить стоковые изображения"],"Failed to load stock images through the configured proxy chain.":["Не удалось загрузить стоковые изображения через настроенную цепочку прокси-серверов."],"Failed to load storage settings.":["Не удалось загрузить настройки хранилища."],"Failed to process image URL.":["Не удалось обработать URL-адрес изображения."],"Failed to rotate client secret.":["Не удалось перевыпустить Client Secret."],"Failed to save blocks.":["Не удалось сохранить блоки."],"Failed to save integration settings.":["Не удалось сохранить настройки интеграции."],"Failed to save project settings.":["Не удалось сохранить настройки проекта."],"Failed to save project styles.":["Не удалось сохранить стили проекта."],"Failed to save storage settings.":["Не удалось сохранить настройки хранилища."],"Failed to save the image. Check the file storage settings.":["Не удалось сохранить изображение. Проверьте настройки хранилища файлов."],"Failed to update the global block.":["Не удалось обновить глобальный блок."],"Failed to update the inbox.":["Не удалось обновить папку «Входящие»."],"Features":["Возможности"],"Fewer settings":["Меньше настроек"],"Field heading":["Заголовок поля"],"Field required":["Обязательное поле"],"Field state appearance":["Внешний вид поля"],"File":["Файл"],"File upload failed":["Не удалось загрузить файл"],"Files ready: %s":["Файлы готовы: %s"],"Fill in at least one offer field":["Заполните хотя бы одно поле акции"],"Filter by type":["Фильтр по типу"],"Finance & Banking":["Финансы и банки"],"First name":["Имя"],"Float block width":["Ширина плавающего блока"],"Folder (Prefix)":["Папка (префикс)"],"Folder name is required":["Имя папки обязательно"],"Folder path":["Путь к папке"],"Folders":["Папки"],"Font":["Шрифт"],"Font family":["Шрифт"],"Font file":["Файл шрифта"],"Font of the general text":["Шрифта текста"],"Font settings":["Настройки шрифта"],"Font size":["Размер текста"],"Font size of the general text":["Размер текста"],"Font type":["Тип шрифта"],"Font weight":["Толщина шрифта"],"Fonts":["Шрифты"],"Footers":["Подвалы"],"For basic tasks in business or personal projects":["Для выполнения основных задач в рамках деловых или личных проектов"],"Forgot the password?":["Забыли пароль?"],"Forgot your password?":["Забыли пароль?"],"Form":["Форма"],"Found so far: %s":["Найдено на данный момент: %s"],"Free trial":["Пробная версия"],"From 8 characters to 72 bytes":["От 8 символов до 72 байт"],"From scratch":["С чистого листа"],"Full legal company name":["Полное юридическое название компании"],"GIF":["GIF"],"General settings":["Общие настройки"],"General text":["Текст"],"Generate":["Сгенерировать"],"Generate Email":["Создать письмо"],"Generate image":["Сгенерировать изображение"],"Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.":["С легкостью создавайте потрясающие визуальные эффекты. Мы обучили нашу модель искусственного интеллекта, чтобы обеспечить высочайшее качество изображений."],"Generate with AI":["Генерация с помощью ИИ"],"Generated images":["Генерация картинок"],"Get a discount":["получить со скидкой"],"Get started":["Начать работу"],"Give your users the ability to build beautiful emails without development costs":["Дайте пользователям возможность собирать красивые письма без затрат на разработку"],"Global block":["Глобальный блок"],"Global styles":["Стили письма"],"Gmail annotation was successfully applied to the template code.":["Аннотация Gmail добавлена в код письма."],"Gmail annotations":["аннотаций в Gmail"],"Gmail annotations were removed from the template code.":["Аннотации Gmail удалены из кода письма."],"Go to project settings?":["Перейти в настройки проекта?"],"Go to projects":["Перейти к проектам"],"Google Fonts":["Шрифты Google"],"Got it":["Понятно"],"Green":["Зелёный"],"Grid":["Сетка"],"Group":["Группа"],"HTML":["HTML"],"HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.":["Требуется URL-адрес HTML-страницы. Сначала сохраните письмо или вставьте собственный URL-адрес размещенной у вас HTML-страницы."],"Half year":["Полгода"],"Header":["Заголовок"],"Header text":["Текст заголовка"],"Headers":["Шапки"],"Heading":["Заголовок"],"Heading color":["Цвет заголовка"],"Heading font":["Шрифт заголовка"],"Heading font size":["Размер заголовка"],"Heading letter spacing":["Межбуквенный интервал заголовка"],"Heading line height":["Высота строки заголовка"],"Headings":["Заголовки"],"Headline":["Заголовок"],"Healthcare":["Здравоохранение"],"Height":["Высота"],"Hello":["Привет"],"Help":["Справка"],"Help menu":["Помощь"],"Helper text":["Подсказка"],"Helper text / tooltip":["Подсказка / всплывающая подсказка"],"Hide payment history":["Скрыть историю платежей"],"High contrast mode":["Режим высокой контрастности"],"Hint text":["Подсказка"],"Horizontal":["Горизонтальный"],"Horizontal alignment":["Горизонтальное выравнивание"],"Horizontal offset":["Гориз. смещение"],"Horizontal padding":["Горизонтальный отступ"],"Horizontal position":["Гориз. смещение"],"Hospitality & Travel":["Гостиничный бизнес и туризм"],"Host":["Имя хоста"],"Hostname or server IP address":["Имя хоста или IP-адрес сервера"],"How to get an API key?":["Как получить ключ API?"],"Hyperlink URL":["Адрес ссылки"],"I agree to the":["Я согласен с"],"I would like to receive updates from Blocks.":["Я хочу получать новости от Blocks"],"I would like to receive updates from EmailMaker.":["Я хочу получать новости от EmailMaker."],"I'd be happy to create an email for you! ":["Я с удовольствием создам для вас электронное письмо! "],"IP address":["IP-адрес"],"Icon":["Иконка"],"Icon URL":["URL иконки"],"Icon description":["Описание иконки"],"Identifies search terms. For example: utm_term=running+shoes":["Определяет условия поиска. Например: utm_term=running+shoes"],"Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc":["Определяет, какой тип ссылки использовался, например, цена за клик или электронная почта. Например: utm_medium=cpc"],"If \\"Yes\\", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If \\"No\\", images will be loaded from external links.":["Если «Да», изображения будут включены в сам файл. Это полезно для просмотра без интернета или если внешние изображения заблокированы, но увеличивает размер файла. Если «Нет», изображения будут загружаться по внешним ссылкам."],"If different from the legal address":["Если отличается от юридического адреса"],"If you do not pay, you will be switched to the free plan automatically.":["Если вы не оплатите, вы будете автоматически переведены на бесплатный тарифный план."],"If you have problems connecting the plugin — contact us, our specialists will definitely help you.":["Если возникли сложности с подключением плагина — напишите нам, наши специалисты обязательно помогут."],"If you turn the switch off, lines of code will not wrap. If you turn the switch on, lines of code will wrap at the viewport.":["Если параметр отключен, строки никогда не будут переноситься. Если параметр включен, строки будут переноситься по ширине области просмотра."],"Image":["Картинка"],"Image Center":["Центр изображений"],"Image checks":["Проверка картинок"],"Image editor":["Редактор изображений"],"Image path":["Путь к изображению"],"Image replacer":["Замена картинки"],"Image src":["Картинка"],"Images validation":["Проверка изображений"],"Images validation was successfully completed":["Проверка изображений завершена"],"Import":["Импорт"],"Import email":["Импортировать письмо"],"Import finished":["Импорт завершён"],"Import first %d":["Импортировать первые %d"],"Import from Stripo":["Импорт из Stripo"],"Import problems":["Проблемы импорта"],"Import templates and emails from your Stripo project.":["Импорт шаблонов и писем из вашего проекта Stripo."],"Imported":["Импортировано"],"Imported %1$d of %2$d":["Импортировано %1$d из %2$d"],"Imported: %1$d, failed: %2$d.":["Импортировано: %1$d, не удалось: %2$d."],"Importing from Stripo":["Импорт из Stripo"],"Improves visibility by automatically tuning the form for accessibility. Turn off to restore the previous look.":["Улучшает читаемость за счет автоматической настройки формы с учетом требований доступности. Отключите эту функцию, чтобы вернуть прежний вид."],"Inactive date background color":["Цвет фона неактивной даты"],"Inactive date font":["Шрифт неактивной даты"],"Indent":["Отступ"],"Indent between columns":["Горизонтальный отступ"],"Indent height":["Высота"],"Indent in mobile":["Вертикальный отступ"],"Indexing files…":["Индексация файлов…"],"Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale":["Определяет продвижение конкретного продукта или стратегическую кампанию. Например: utm_campaign=spring_sale"],"Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink":["Определяет, что именно было нажато, чтобы привести пользователя на сайт, например, рекламный баннер или текстовая ссылка. Он часто используется для A/B-тестирования и рекламы, ориентированной на контент. Например: utm_content=logolink или utm_content=textlink."],"Individual corner radii":["Радиусы отдельных углов"],"Individual padding":["Отдельные отступы"],"Industry":["Отрасль"],"Input":["Поле ввода"],"Input field text":["Текст поля ввода"],"Insert column after":["Вставить столбец справа"],"Insert column before":["Вставить столбец слева"],"Insert row after":["Вставить строку после"],"Insert row before":["Вставить строку перед"],"Insert spaces":["Отступы пробелами"],"Inside":["Внутри"],"Integration settings saved.":["Настройки интеграции сохранены."],"Integrations":["Интеграции"],"Integrations are set up in the project settings. Unsaved changes in the email may be lost.":["Интеграции настраиваются в настройках проекта. Несохранённые изменения в письме могут потеряться."],"Internal padding":["Внутренний отступ"],"Invalid file data":["Неверные данные файла"],"Invite members":["Пригласить участников"],"Invited %s":["Приглашён %s"],"Invoice for legal entity":["Счёт для юр. лица"],"Invoice request for a legal entity":["Запрос на выставление счета для юридического лица"],"Is a template":["Шаблон"],"It looks like the email was not created in our service, so the content styles won\`t work. Read more about content styles in the help.":["Похоже, письмо создано не в нашем сервисе, поэтому стили контента работать не будут. Подробнее о стилях содержимого читайте в справке."],"It\`s done!":["Готово!"],"Italic":["Курсив"],"Italic ( Ctrl+I )":["Курсив ( Ctrl+I )"],"Italic ( ⌘I )":["Курсив ( ⌘I )"],"Items to import: %d.":["Элементов к импорту: %d."],"Ivan Ivanov":["Иван Иванов"],"Joined the project":["Присоединился к проекту"],"Just now":["Только что"],"KB":["KB"],"KPP":["КПП"],"KPP must be 9 digits":["КПП должен состоять из 9 цифр"],"LLC \\"Example\\"":["ООО «Пример»"],"Label next to checkbox":["Надпись рядом с чекбоксом"],"Label text style":["Стиль текста подписи"],"Landscape":["Горизонтальная"],"Language":["Язык"],"Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.":["Большие электронные письма могут иметь проблемы с доставкой и медленно загружаться. Мы рекомендуем минимизировать код перед экспортом."],"Last login":["Последний вход"],"Last name":["Фамилия"],"Last update: ":["Обновлено:"],"Layout conversion failed":["Ошибка при преобразовании шаблона"],"Layout converted to Blocks format":["Шаблон преобразован в формат Blocks"],"Layout converted to EmailMaker format":["Шаблон преобразован в формат EmailMaker"],"Learn more about %s":["Подробнее о работе %s"],"Leave":["Уйти"],"Leave your comment":["Оставьте ваш комментарий"],"Left":["Слева"],"Left Code panel":["Панель кода слева"],"Left padding":["Отступ слева"],"Left to right":["Слева направо"],"Legal address":["Юридический адрес"],"Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!":["Позвольте нашему помощнику с ИИ улучшить ваше письмо! От создания темы и прехедеров на основе письма до генерации всего письма с учетом особенностей вашего сайта!"],"Letter spacing":["Межбуквенный интервал"],"Light":["Светлая"],"Light theme":["Светлая тема"],"Line break on mobile devices":["Переносить колонки друг под друга"],"Line height":["Высота строки"],"Line height of the general text":["Высота строки текста"],"Line wrap":["Перенос строк"],"Link":["Ссылка"],"Link checks":["Проверка ссылок"],"Link color":["Цвет ссылки"],"Link color in contrasting blocks":["Цвет ссылок в контрастных блоках"],"Link for all slides":["Общая ссылка"],"Link to web version of the font":["Ссылка на веб-версию шрифта"],"Links":["Ссылки"],"Links validation":["Проверка ссылок"],"Links validation was successfully completed":["Проверка ссылок завершена"],"List OL":["Список OL"],"List UL":["Список UL"],"List item appearance":["Внешний вид элемента списка"],"List of projects":["Список проектов"],"List panel background":["Фон панели списка"],"List settings":["Настройки списка"],"List text style":["Стиль текста списка"],"Lists":["Списки"],"Live preview":["Тест в почтовиках"],"Loading latest changes...":["Загрузка последних изменений..."],"Locally saved version applied":["Применена локально сохраненная версия"],"Lock":["Заблокировать"],"Log in as user":["Войти под пользователем"],"Logged in as user":["Вы вошли под пользователем"],"Login for connection":["Логин для подключения"],"Logo must be 2 MB or smaller.":["Логотип должен быть не больше 2 МБ."],"Loop":["Зациклить"],"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.":["С другой стороны, разбавленное изрядной долей эмпатии, рациональное мышление выявляет срочную потребность как самодостаточных, так и внешне зависимых концептуальных решений."],"Lower scores are better. Aim for a score less than ":["Чем ниже балл, тем лучше. Старайтесь набрать как можно меньше."],"Lowercase":["Строчные"],"Lowercase letters (a-z)":["Строчные буквы (a–z)"],"MB":["MB"],"Magenta":["Пурпурный"],"Mailganer":["Mailganer"],"Mailing Name":["Имя рассылки"],"Mailing address":["Почтовый адрес"],"Mailing automation, audience segmentation, and email personalization.":["Автоматизация рассылок, сегментация аудитории и персонализация писем."],"Mailing successfully created!":["Письмо создано!"],"Make columns the same width.":["Сделать колонки одинаковой ширины."],"Managed in billing settings":["Управляется в настройках оплаты"],"Mandatory. Indicates the traffic source. Example: utm_source=google":["Указывает, какой сайт отправил трафик, и является обязательным параметром. Например: utm_source=google"],"Manufacturing":["Производство"],"Margins":["Отступы"],"Markdown":["Markdown"],"Marker shape":["Форма маркера"],"Marketer":["Маркетолог"],"Mass mailing automation, audience segmentation, and campaign performance analytics.":["Автоматизация массовых рассылок, сегментация аудитории и аналитика по кампаниям."],"Max width":["Ширина изображения"],"Maximum 10 tags available.":["Максимум доступно 10 тегов."],"Maximum 64 characters.":["Не длиннее 64 символов."],"Maximum length":["Максимальная длина"],"Maximum width":["Макс. ширина"],"Maximum {0} colors in the palette.":["В палитре не больше {0} цветов."],"Maximum {0} fonts in the project.":["В проекте не больше {0} шрифтов."],"Maximum {0} social networks.":["Не больше {0} соцсетей."],"Media & Marketing":["Медиа и маркетинг"],"Members":["Участники"],"Menus":["Меню"],"Merchant homepage URL":["Ссылка на сайт магазина"],"Merge bottom cell":["Объединить нижнюю ячейку"],"Merge left cell":["Объединить левую ячейку"],"Merge right cell":["Объединить правую ячейку"],"Merge tags":["Переменные"],"Merge top cell":["Объединить верхнюю ячейку"],"Merge with the chosen block":["Объединить с выделенным блоком"],"Message when validation fails":["Сообщение в случае сбоя проверки"],"Minimap":["Миникарта"],"Minimize code":["Минимизировать код"],"Minimum length 8 characters":["Минимальная длина — 8 символов"],"Minimum width":["Мин. ширина"],"Minus":["Минус"],"Mobile":["На мобильном"],"Mobile L – 425px":["Смартфон L – 425px"],"Mobile M – 375px":["Смартфон M – 375px"],"Mobile S – 320px":["Смартфон S – 320px"],"Mobile view":["Мобильный вид"],"Month":["Месяц"],"More editing features":["Больше возможностей редактирования"],"More options":["Больше настроек"],"More settings":["Больше настроек"],"Move %1$d block to folder “%2$s”?":["Переместить %1$d блок в папку «%2$s»?","Переместить %1$d блока в папку «%2$s»?","Переместить %1$d блоков в папку «%2$s»?"],"Move %1$d template to folder “%2$s”?":["Переместить %1$d шаблон в папку «%2$s»?","Переместить %1$d шаблона в папку «%2$s»?","Переместить %1$d шаблонов в папку «%2$s»?"],"Move block “%1$s” to folder “%2$s”?":["Переместить блок «%1$s» в папку «%2$s»?"],"Move down":["Переместить вниз"],"Move stopped":["Перемещение остановлено"],"Move template “%1$s” to folder “%2$s”?":["Переместить шаблон «%1$s» в папку «%2$s»?"],"Move up":["Переместить вверх"],"Moving files from old storage…":["Перенос файлов со старого хранилища…"],"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).":["Автоматизация мультиканальных кампаний (email, SMS, push, WhatsApp и другие)."],"Name":["Имя"],"Name must be at most 64 characters.":["Название не длиннее 64 символов."],"Need more?":["Нужно больше?"],"New block title":["Название нового блока"],"New blocks":["Новые блоки"],"New email title":["Новое письмо"],"New emails":["Новые письма"],"New file name is required":["Требуется новое имя файла"],"New folder":["Новая папка"],"New folder name is required":["Требуется название новой папки"],"New password":["Новый пароль"],"New project":["Новый проект"],"Newest first":["Сначала новые"],"Newsletter Subscription":["Подписка на новости"],"Newsletter successfully created!":["Рассылка успешно создана!"],"No":["Нет"],"No access to edit the letter.":["Нет доступа к редактированию письма."],"No active sessions":["Нет активных сессий"],"No analytics data for the selected period.":["За выбранный период данных нет."],"No brand colors yet":["Пока нет цветов бренда"],"No card required: we ask for no payment or personal details.":["Карту привязывать не нужно: ни платёжных, ни персональных данных мы не спросим."],"No emails match the search.":["По запросу не найдено ни одного письма."],"No history records available.":["Записи истории отсутствуют."],"No images found.":["Нет изображений."],"No internet connection":["Нет подключения к Интернету"],"No links found.":["Нет ссылок."],"No logo":["Без логотипа"],"No mailing address found. Add one in ActiveCampaign: ":["Почтовый адрес не найден. Добавьте его в ActiveCampaign: "],"No name":["Без названия"],"No one found":["Никого не нашлось"],"No payments yet.":["Платежей пока нет."],"No problems found.":["Проблем не найдено."],"No project fonts yet":["Пока нет шрифтов проекта"],"No projects match the search.":["По запросу не найдено ни одного проекта."],"No properties to edit.":["Нет свойств для редактирования."],"No related blocks found.":["У этого письма нет привязанных шаблонов."],"No social networks yet":["Пока нет соцсетей"],"No users found":["Пользователи не найдены"],"Non-profit":["Некоммерческая организация"],"None":["Нет"],"Not available for the current payment settings":["Недоступно при текущих настройках оплаты"],"Not available in this context":["Недоступно в данном контексте"],"Not connected":["Не подключено"],"Not defined":["Не определено"],"Not found in Stripo":["Не найдено в Stripo"],"Not imported":["Не импортировано"],"Not now":["Не сейчас"],"Not set":["Не указано"],"Nothing found in Stripo":["В Stripo ничего не найдено"],"Now":["Сейчас"],"Now create an email":["Теперь создайте письмо"],"OGRN / PSRN":["ОГРН / ПСРН"],"OGRN/PSRN must be 13 or 15 digits":["ОГРН / ПСРН должно состоять из 13 или 15 цифр"],"Offer page URL":["Ссылка на страницу акции"],"Offer page or merchant homepage link starting with https:// is required":["Нужна ссылка на страницу акции или на сайт магазина, начинающаяся с https://"],"Ok. I'll be waiting":["Хорошо. Я подожду"],"Okay. I'll log in.":["Хорошо, я авторизуюсь."],"Oldest first":["Сначала старые"],"On request":["По запросу"],"On the left":["Слева"],"On the right":["Справа"],"Onboarding":["Тур по редактору"],"Only a-z, 0-9, hyphen, dot":["Только a-z, 0-9, дефис, точка"],"Oops! Something went wrong":["Ой! Что-то пошло не так"],"Open draft campaign":["Открыть черновик кампании "],"Open in Bento":["Открыть в Bento"],"Open in Brevo":["Открыть в Brevo"],"Open in Campaign Monitor":["Открыть в Campaign Monitor"],"Open in Constant Contact":["Открыть в Constant Contact"],"Open in Dotdigital":["Открыть в Dotdigital"],"Open in GetResponse":["Открыть в GetResponse"],"Open in HubSpot":["Открыть в HubSpot"],"Open in Klaviyo":["Открыть в Klaviyo"],"Open in Mailchimp":["Открыть в Mailchimp"],"Open in Mailganer":["Открыть в Mailganer"],"Open in Marketing Cloud":["Открыть в Marketing Cloud"],"Open in Sendsay":["Открыть в Sendsay"],"Open in Unisender":["Открыть в Unisender"],"Open in enKod":["Открыть в enKod"],"Optimize":["Оптимизация"],"Optional fields":["Необязательные поля"],"Orange":["Оранжевый"],"Ordered list":["Нумерованный список"],"Organization logo":["Логотип компании"],"Other":["Другое"],"Others":["Другие"],"Outlook":["Outlook"],"Outside":["Снаружи"],"PDF":["PDF"],"PJSC Sberbank":["ПАО «Сбербанк»"],"PNG":["PNG"],"Padding":["Внутренний отступ"],"Paid until: ":["Оплачен до: "],"Palette":["Палитра"],"Password":["Пароль"],"Password for connection":["Пароль для подключения"],"Password set":["Пароль задан"],"Paste block from clipboard":["Вставить блок из буфера обмена"],"Paste image URL here":["Вставьте URL изображения"],"Pay":["Оплата"],"Payment":["Оплата"],"Payment basis":["Условия оплаты"],"Payment history":["История платежей"],"Payment was successful. Limits will update in a few seconds.":["Оплата прошла успешно. Лимиты обновятся через несколько секунд."],"Payment was successful. New AI generations are now available.":["Оплата прошла успешно. Теперь доступны новые генерации с помощью ИИ."],"Payment was successful. Your plan features are now available.":["Оплата прошла успешно. Теперь вы можете пользоваться всеми возможностями вашего тарифного плана."],"Phone":["Телефон"],"Phone must be 3 to 40 characters and contain digits and separators only.":["Телефон — от 3 до 40 символов, только цифры и разделители."],"Phone number":["Телефон"],"Phone or email":["Телефон или email"],"Pick a color.":["Выберите цвет."],"Picture":["Изображение"],"Placeholder":["Плейсхолдер"],"Placeholder text":["Текст плейсхолдера"],"Plain text":["Простой текст"],"Plan":["Тариф"],"Plan usage statistics":["Статистика использования тарифа"],"Play button":["Кнопка воспроизведения"],"Please accept the agreement":["Пожалуйста, примите соглашение"],"Please add a comment to your request":["Введите комментарий к запросу"],"Please choose":["Пожалуйста, выберите"],"Please choose block type":["Пожалуйста, выберите тип блока"],"Please choose the block type":["Пожалуйста, укажите тип блока"],"Please complete payment on the Billing page.":["Пожалуйста, произведите оплату на странице «Тарифы и оплата»."],"Please complete the captcha":["Пожалуйста, пройдите капчу"],"Please complete the captcha to continue.":["Пожалуйста, пройдите капчу, чтобы продолжить."],"Please enter a URL.":["Пожалуйста, введите адрес."],"Please enter a color name.":["Пожалуйста, введите название цвета."],"Please enter a name.":["Пожалуйста, введите название."],"Please enter a valid email address.":["Введите действительный адрес электронной почты."],"Please enter a valid email.":["Пожалуйста, введите корректный email."],"Please enter the URL.":["Пожалуйста, введите адрес"],"Please enter the block name":["Введите название блока"],"Please enter the correct URL.":["Пожалуйста, введите правильный адрес."],"Please enter the correct email address.":["Пожалуйста, введите корректный адрес почты."],"Please enter the correct email.":["Пожалуйста, введите корректную эл. почту"],"Please enter the description":["Введите описание"],"Please enter the email name":["Введите имя письма"],"Please enter the folder name":["Введите имя папки "],"Please enter the group name":["Введите название группы"],"Please enter the project name":["Пожалуйста, введите название проекта"],"Please enter valid email":["Введите действительный адрес электронной почты"],"Please enter your email address":["Пожалуйста, укажите свой адрес эл. почты"],"Please enter your password":["Пожалуйста, введите свой пароль"],"Please input block name":["Пожалуйста укажите название блока"],"Please input container width":["Пожалуйста, укажите ширину блока"],"Please input tags!":["Пожалуйста, введите теги!"],"Please input type!":["Пожалуйста, введите тип!"],"Please log in":["Необходим вход в систему"],"Please select":["Пожалуйста, выберите"],"Please set the 'Type' field in the Settings section.":["Пожалуйста, заполните поле «Тип» в настройках блока."],"Please set the background color":["Пожалуйста, установите цвет фона"],"Please set the font color":["Установите цвет текста"],"Please type correct emails":["Пожалуйста, введите верные адреса получателей"],"Please type emails":["Пожалуйста, введите адреса получателей"],"Please type subject":["Укажите тему письма"],"Please type the project name.":["Пожалуйста, укажите название проекта."],"Please type the webhook URL.":["Пожалуйста, введите адрес вебхука."],"Please type your email address.":["Пожалуйста, укажите свой адрес электронной почты."],"Please type your password confirmation code.":["Пожалуйста, укажите код подтверждения."],"Please type your password.":["Пожалуйста, введите свой пароль."],"Please upgrade your plan.":["Пожалуйста, обновите тарифный план.\\n"],"Please upload a JPG, PNG, or WebP image.":["Загрузите изображение в формате JPG, PNG или WebP."],"Plugin":["Плагин"],"Plugin connected":["Плагин подключён"],"Plugin connection request":["Заявка на подключение плагина"],"Plugin is not connected":["Плагин не подключён"],"Plus":["Плюс"],"Pointer":["Треугольник"],"Polls":["Опросы"],"Port":["Порт"],"Portrait":["Вертикальная"],"Position in cell":["Положение в ячейке"],"Prefer spaces over tabs.":["Делать табуляцию пробелами."],"Prefix path inside the bucket for project files":["Префикс — путь внутри бакета для файлов проекта"],"Preheader":["Прехедер"],"Preheader copied to email settings":["Прехедер скопирован в настройки письма"],"Preparing countdown preview…":["Готовим превью таймера..."],"Preparing video preview…":["Готовим превью видео..."],"Preview":["Предпросмотр"],"Preview mode":["Предпросмотр"],"Price":["Цена"],"Price currency":["Валюта"],"Price currency must be a three-letter ISO 4217 code, for example USD":["Валюта указывается трёхбуквенным кодом ISO 4217, например USD"],"Privacy Policy.":["Политикой конфиденциальности."],"Product carousel":["Карусель товаров"],"Profile":["Профиль"],"Project":["Проект"],"Project files are stored on the built-in Blocks CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN Blocks. Дополнительно настраивать подключение не нужно."],"Project files are stored on the built-in EmailMaker CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN EmailMaker. Дополнительно настраивать подключение не нужно."],"Project information":["Информация о проекте"],"Project name":["Название проекта"],"Project name must be at most 100 characters.":["Название проекта не длиннее 100 символов."],"Project not found.":["Проект не найден."],"Project settings":["Настройки проекта"],"Project styles":["Стили проекта"],"Project styles saved.":["Стили проекта сохранены."],"Project switched to the built-in storage.":["Проект переключён на встроенное хранилище."],"Projects":["Проекты"],"Promo code applied.":["Промокод применен."],"Promocodes":["Промокоды"],"Promotion cards":["Промокарточки"],"Proofreader":["Корректор "],"Psychologist":["Психолог"],"Public URL":["Публичный адрес"],"Public access key":["Публичный ключ доступа"],"Public offer":["Публичная оферта"],"Purple":["Фиолетовый"],"Push block update to all templates":["Применить обновление блока ко всем шаблонам"],"Quarter":["Квартал"],"Radio button":["Радиокнопка"],"Ready-made HTML template for testing the plugin locally.":["Готовый HTML-шаблон, чтобы проверить плагин локально."],"Real Estate":["Недвижимость"],"Real-time notifications about email-related events.":["Уведомления о событиях с письмами в реальном времени."],"Receipt":["Чек"],"Recipients":["Получатели"],"Recommended":["Рекомендуемые"],"Recover":["Восстановить"],"Recover password":["Восстановить пароль"],"Recurring payments disabled":["Автоплатёж отключён"],"Recurring payments enabled":["Автоплатёж включён"],"Red":["Красный"],"Redo (Ctrl+Shift+Z)":["Повторить (Ctrl+Shift+Z)"],"Refresh":["Обновить"],"Refresh inbox":["Обновить почтовый ящик"],"Registered":["Регистрация"],"Reload page":["Перезагрузить страницу"],"Remaining:":["Осталось:"],"Remember me":["Запомнить меня"],"Remove":["Удалить"],"Remove annotations":["Удалить аннотации"],"Remove block":["Удалить блок"],"Remove column":["Удалить столбец"],"Remove element":["Удалить элемент"],"Remove element by Delete Key":["Удалить элемент (Delete)"],"Remove file":["Удалить файл"],"Remove group":["Удалить группу"],"Remove logo":["Удалить логотип"],"Remove member":["Удалить участника"],"Remove row":["Удалить строку"],"Remove slide":["Удалить слайд"],"Removed %1$d of %2$d.":["Удалено %1$d из %2$d."],"Rename":["Переименовать"],"Rename block":["Переименовать блок"],"Rename email":["Переименовать письмо"],"Reorder block":["Переместить блок"],"Reorder element":["Переместить элемент"],"Reorder group":["Переместить группу"],"Repeat background (repeat)":["Повторять фон (repeat)"],"Repeat background horizontally (repeat-x)":["Горизонтальное повторение фона (repeat-x)"],"Repeat background vertically (repeat-y)":["Вертикальное повторение фона (repeat-y)"],"Repeat the new password":["Повторите новый пароль"],"Replace the preheader":["Вставить в прехедер письма"],"Replace the title":["Вставить в заголовок письма"],"Reply":["Ответить"],"Reply to the comment":["Ответить на комментарий"],"Request for changing the pricing plan":["Запрос на смену тарифа"],"Request sent successfully.":["Запрос отправлен."],"Requests JSON":["JSON с запросами"],"Required field":["Обязательное поле"],"Resend":["Отправить повторно"],"Responsive email":["Адаптировать письмо в моб. устройствах"],"Restore %1$d block to folder “%2$s”?":["Восстановить %1$d блок в папку «%2$s»?","Восстановить %1$d блока в папку «%2$s»?","Восстановить %1$d блоков в папку «%2$s»?"],"Restore %1$d template to folder “%2$s”?":["Восстановить %1$d шаблон в папку «%2$s»?","Восстановить %1$d шаблона в папку «%2$s»?","Восстановить %1$d шаблонов в папку «%2$s»?"],"Restore block “%1$s” to folder “%2$s”?":["Восстановить блок «%1$s» в папку «%2$s»?"],"Restore template “%1$s” to folder “%2$s”?":["Восстановить шаблон «%1$s» в папку «%2$s»?"],"Resume":["Резюме"],"Retail & E-commerce":["Розница и e-commerce"],"Retry":["Повторить"],"Retry failed":["Повторить неудавшиеся"],"Reverse order on desktop":["Изменить порядок в десктопе"],"Revoke the invite":["Отозвать приглашение"],"Right":["Справа"],"Right Code panel":["Панель кода справа"],"Right padding":["Отступ справа"],"Right to left":["Справа налево"],"Role":["Роль"],"Rotate":["Перевыпустить"],"Rotate client secret?":["Перевыпустить Client Secret?"],"Rotate secret":["Перевыпустить секрет"],"Round":["Круглый"],"Rounded corners in Outlook (VML)":["Закругленные углы в Outlook (VML)"],"SMS":["СМС"],"Safe Fonts":["Безопасные шрифты"],"Sandbox HTML file":["HTML-файл песочницы"],"Sans Serif":["Sans Serif"],"Save":["Сохранить"],"Save %d block":["Сохранить %d блок","Сохранить %d блока","Сохранить %d блоков"],"Save all blocks":["Сохранить все блоки"],"Save and continue":["Сохранить и продолжить"],"Save block":["Сохранить блок"],"Save by Ctrl+S":["Ctrl+S"],"Save by ⌘S":["Сохранить ( ⌘S )"],"Save email first.":["Сначала сохраните письмо."],"Save the block before commenting.":["Сохраните блок перед комментированием."],"Save the email before commenting.":["Сохраните письмо перед комментированием."],"Save to Blocks":["Сохранить в Блоки"],"Save to Blocks button.":["Сохранить в Блоки"],"Saved blocks":["Сохранённые блоки"],"Saving changes in the block":["Сохранение изменений в блоке"],"Saving failed":["Сохранение не удалось"],"Search":["Поиск"],"Search GIFs":["Поиск GIF"],"Search a block":["Найти блок"],"Search by email":["Поиск по email"],"Search by name":["Поиск по названию"],"Search by title":["Поиск по названию"],"Search image":["Поиск изображения"],"Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.":["В обширной галерее стоковых фотографий и GIF-файлов вы найдете изображения для любого случая. Вы можете отфильтровать результаты по ориентации изображения, цветовой гамме и т. д."],"Secret Access Key":["Секретный ключ доступа"],"Secret access key":["Секретный ключ доступа"],"Secret is masked. Use Rotate to get a new secret once.":["Секрет скрыт. Нажмите «Перевыпустить», чтобы один раз увидеть новый."],"Section":["Раздел"],"Section ":["Раздел"],"Section title":["Заголовок раздела"],"Security":["Безопасность"],"Select a font family":["Выберите шрифт"],"Select a theme":["Выберите тему"],"Select all %d":["Выбрать все: %d"],"Select company size":["Выберите размер компании"],"Select email template":["Выберите шаблон письма"],"Select industry":["Выберите отрасль"],"Select period":["Выберите период"],"Select plan":["Выбрать тариф"],"Select the block type to find any block on the list faster.":["Выберите тип блока, чтобы быстрее найти любой блок в списке."],"Select the time zone":["Выберите часовой пояс"],"Selected %1$d, your plan allows %2$d more emails.":["Выбрано: %1$d, по тарифу можно создать ещё писем: %2$d."],"Send":["Отправить"],"Send a test email":["Отправить тест"],"Send again":["Повторить"],"Send password reset email":["Отправить письмо для сброса пароля"],"Sender Email":["Email отправителя"],"Sender Name":["Имя отправителя"],"Sendsay":["Sendsay"],"Separators":["Разделители"],"Serif":["Serif"],"Server is unavailable":["Сервер недоступен"],"Sessions":["Сессии"],"Set":["Установить"],"Set new password":["Установить новый пароль"],"Set the type":["Укажите тип"],"Settings":["Настройки"],"Shadow inside or outside of the element":["Если включено, то тень будет внутри элемента."],"Share":["Поделиться"],"Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.":["Поделитесь проектом со своей командой и сотрудничайте в режиме реального времени. Добавляйте комментарии к отдельным блокам писем и обсуждайте необходимые правки прямо в конструкторе."],"Short company name":["Краткое название компании"],"Show eye icon":["Показать иконку глаза"],"Show more":["Показать ещё"],"Shuffle options":["Параметры перемешивания"],"Sign In":["Войти"],"Sign Up":["Зарегистрироваться"],"Sign in":["Войти"],"Sign in again to log in as a user":["Войдите заново, чтобы войти под пользователем"],"Sign in to your account to activate the trial period.":["Войдите в свою учетную запись, чтобы активировать пробный период."],"Sign in with eLama":["Войти через eLama"],"Sign out":["Выйти"],"Sign-in methods":["Способы входа"],"Single image preview":["Одно изображение"],"Single quotation":["Кавычка"],"Site":["Сайт"],"Size":["Размер"],"Small desktop – 768px":["Небольшой десктоп – 768px"],"Social buttons":["Кнопки соцсетей"],"Social media":["Соцсети"],"Social network name":["Название соцсети"],"Social network settings":["Настройки соцсети"],"Social networks":["Соцсети"],"Solid":["Сплошная"],"Some blocks were not saved successfully.":["Некоторые блоки не были сохранены."],"Some images were left as links to Stripo":["Часть картинок осталась ссылками на Stripo"],"Something went wrong":["Ошибка редактирования. Обратитесь в техподдержку."],"Something went wrong during layout conversion. You can try running the conversion again.":["При конвертации шаблона произошла ошибка. Вы можете повторить конвертацию."],"Something went wrong, please try again":["Что-то пошло не так. Попробуйте ещё раз."],"Something went wrong.":["Что-то пошло не так."],"Something went wrong. Try again later.":["Что-то пошло не так. Попробуйте позже."],"Soon":["Скоро"],"Sorry, the page you visited does not exist.":["Извините, страница, которую вы посетили, не существует."],"Source code validation":["Проверка кода"],"Spacer":["Отступ"],"Spacing":["Интервал"],"Spam checks":["Проверка на спам"],"Spam validation was successfully completed":["Проверка на спам завершена"],"SpamAssassin":["SpamAssassin"],"Special characters":["Специальные символы"],"Specifies the block width.":["Задаёт ширину блока."],"Split blocks":["Разделить блоки"],"Split cell":["Разделить ячейку"],"Spread radius":["Распространение"],"Square":["Квадрат"],"Squarish":["Квадратная"],"Star":["Звезда"],"Start Trial":["Начать Триал"],"Start date":["Дата начала"],"Start from scratch":["Начать с чистого листа"],"Start the trial":["Включить пробный период"],"Start typing the title":["Начните писать название"],"Start with a detailed description of your email.":["Начните с подробного описания вашего письма."],"Started":["Начало"],"Starts":["Начало"],"Status":["Статус"],"Stay":["Остаться"],"Stock":["Фотосток"],"Stock photos and GIFs":["Стоковые изображения"],"Stopping…":["Остановка…"],"Storage settings":["Настройки хранилища"],"Storage type":["Тип хранилища"],"Stored or bound value for this field":["Сохраненное или заданное значение для этого поля"],"Stored or bound value for this option":["Сохраненное или заданное значение для этого параметра"],"Strikethrough ( Alt+Shift+5 )":["Зачёркнутый ( Alt+Shift+5 )"],"Strikethrough ( ⌘+Shift+X )":["Зачёркнутый ( ⌘+Shift+X )"],"Stripo API key":["API-ключ Stripo"],"Stripo did not accept this key. Check that it is the REST API key of your Stripo project.":["Stripo не принял этот ключ. Проверьте, что это ключ REST API вашего проекта Stripo."],"Stripo did not respond":["Stripo не ответил"],"Stripo is not responding. Try again later.":["Stripo не отвечает. Попробуйте позже."],"Stripo stopped accepting the API key. Update the key and repeat the import.":["Stripo перестал принимать API-ключ. Обновите ключ и повторите импорт."],"Stripo templates become project templates, emails become emails. Folders are recreated, images are copied to the project storage. Items already imported are skipped when you select all.":["Шаблоны Stripo станут шаблонами проекта, письма — письмами. Папки будут воссозданы, картинки скопированы в хранилище проекта. При выборе всех уже импортированные элементы пропускаются."],"Stroke color":["Цвет контура"],"Strong":["Полужирный"],"Strong ( Ctrl+B )":["Полужирный ( Ctrl+B )"],"Strong ( ⌘B )":["Полужирный ( ⌘B )"],"Subject":["Тема"],"Subject line & preheader generator":["Генератор темы и прехедера"],"Subscription ID is missing":["Отсутствует идентификатор подписки"],"Subscription summary":["Сведения о подписке"],"Success":["Готово"],"Success!":["Готово!"],"Supported formats: .woff, .woff2, .ttf, .otf. Maximum file size is 5 MB.":["Поддерживаемые форматы: .woff, .woff2, .ttf, .otf. Файл не больше 5 МБ."],"Supported: .woff, .woff2, .ttf, .otf — up to {0} MB.":["Поддерживаются .woff, .woff2, .ttf, .otf — до {0} МБ."],"Swap columns":["Поменять местами"],"Switch to a different plan to save more emails.":["Перейдите на другой тариф, чтобы иметь возможность сохранять новые шаблоны."],"Syncing with the server in the background...":["Происходит синхронизация с сервером в фоновом режиме..."],"System":["Системная"],"System theme":["Системная тема"],"TIN (INN)":["ИНН"],"TIN (INN) must be 10 or 12 digits":["ИНН должен состоять из 10 или 12 цифр"],"Tab size":["Величина отступа"],"Table":["Таблица"],"Table view":["Таблица"],"Table width":["Ширина таблицы"],"Tags":["Теги"],"Tags help you find the block in the list.":["Теги помогают найти блок в списке."],"Tariff and payment":["Тариф и оплата"],"Teal":["Бирюзовый"],"Team collaboration":["Командная работа"],"Technical support":["Техническая поддержка"],"Technology & Software":["Технологии и ПО"],"Template":[" Шаблон"],"Template Name":["Название шаблона"],"Template blocks":["Блоки шаблона"],"Template conversion":["Конвертация шаблона"],"Template from another editor":["Шаблон из другого редактора"],"Template is not mobile-friendly":["Шаблон может некорректно отображаться в телефоне"],"Template successfully created!":["Шаблон создан!"],"Templates":["Шаблоны"],"Terms":["Условиями использования"],"Test sends":["Тесты отображения"],"Text":["Текст"],"Text & background":["Текст и фон"],"Text align center":["Текст по центру"],"Text align center ( Ctrl+Shift+E )":["По центру ( Ctrl+Shift+E )"],"Text align center ( ⌘+Shift+E )":["По центру ( ⌘+Shift+E )"],"Text align justify":["Текст по ширине"],"Text align justify ( Ctrl+Shift+J )":["По ширине ( Ctrl+Shift+J )"],"Text align justify ( ⌘+Shift+J )":["По ширине ( ⌘+Shift+J )"],"Text align left":["Текст слева"],"Text align left ( Ctrl+Shift+L )":["По левому краю ( Ctrl+Shift+L )"],"Text align left ( ⌘+Shift+L )":["По левому краю ( ⌘+Shift+L )"],"Text align right":["Текст справа"],"Text align right ( Ctrl+Shift+R )":["По правому краю ( Ctrl+Shift+R )"],"Text align right ( ⌘+Shift+R )":["По правому краю ( ⌘+Shift+R )"],"Text background":["Фон текста"],"Text beside the box":["Текст рядом с полем"],"Text color":["Цвет текста"],"Text copied to clipboard":["Скопировано в буфер обмена"],"Text font":["Шрифт текста"],"Text replacer":["Замена текста"],"Text size":["Размер текста"],"Text subscript":["Подстрочный текст"],"Text superscript":["Надстрочный текст"],"Text visible at the start":["Текст, отображаемый в начале"],"That\`s all we could find.":["Это все, что мы смогли найти."],"The ":[" "],"The Pro plan is not available.":["Тариф «Pro» недоступен."],"The URL that the hyperlink directs to.":["URL, на который указывает ссылка."],"The account number must be 20 digits":["Номер счета должен состоять из 20 цифр"],"The align attribute sets the horizontal alignment of the table.":["Атрибут align устанавливает горизонтальное выравнивание таблицы."],"The block \\"":["Блок «"],"The block was successfully renamed.":["Блок переименован."],"The block was successfully saved.":["Блок сохранен."],"The block will change its colors to contrasting colors. You can change them in the Content Styles section.":["Блок изменит свои цвета на контрастные. Вы можете изменить их в разделе «Стили контента»."],"The block “":["Блок «"],"The captcha is invalid or expired. Please try again.":["Капча неверна или срок её действия истек. Пожалуйста, попробуйте ещё раз."],"The code size exceeds the recommended value 90kB":["Размер кода превышает рекомендуемое значение 90 кБ."],"The code that will replace this text":["Код, который заменит этот текст"],"The copies were successfully created.":["Копии созданы."],"The copy of block “":["Копия блока «"],"The copy of email \\"":["Копия письма \\""],"The current code size is":["Текущий размер кода составляет"],"The current template will be changed to the generated one, are you sure about this?":["Текущий шаблон будет заменен на сгенерированный, вы уверены в этом?"],"The draft of the block has been deleted.":["Черновик блока удалён."],"The draft of the email has been deleted.":["Черновик письма удалён."],"The email \\"":["Письмо \\""],"The email content is empty — saving was cancelled to prevent data loss.":["Содержимое письма пусто — сохранение отменено, чтобы не потерять данные."],"The email could not be loaded. Please try again.":["Не удалось загрузить письмо. Попробуйте ещё раз."],"The email has been copied to the clipboard.":["Код письма скопирован в буфер обмена."],"The email limit of your plan has been reached.":["Лимит писем вашего тарифа исчерпан."],"The email was successfully renamed.":["Письмо переименованно."],"The email was successfully saved.":["Письмо сохранено."],"The email “":["Письмо «"],"The feature is under development.":["Функционал находится в разработке."],"The folder \\"":["Папка «"],"The folder “":["Папка «"],"The font-size CSS property sets the size of the font.":["Свойство font-size устанавливает размер шрифта."],"The global block was updated.":["Глобальный блок был обновлён."],"The group “":["Группа «"],"The image could not be uploaded.":["Не удалось загрузить изображение."],"The image was successfully uploaded.":["Изображение загружено."],"The import failed. Try again later.":["Импорт не удался. Попробуйте позже."],"The inbox has been updated.":["Почтовый ящик обновлён."],"The invitation has been sent":["Приглашение отправлено"],"The maximum number of requests for the current subscription period has been reached.\\nSelect the appropriate plan to fulfil more requests":["Максимальное количество запросов для текущего периода подписки достигнуто.\\nВыберите соответствующий тариф для выполнения большего количества запросов."],"The password does not meet the requirements:":["Пароль не соответствует требованиям безопасности:"],"The password has been changed and all sessions of the user are ended":["Пароль изменён, все сессии пользователя завершены"],"The password is too simple.":["Слишком простой пароль."],"The password reset email has been sent":["Письмо для сброса пароля отправлено"],"The payment widget failed to load. Refresh the page and try again.":["Не удалось загрузить виджет оплаты. Обновите страницу и попробуйте ещё раз."],"The previous secret will stop working immediately.":["Прежний секрет перестанет работать сразу."],"The project \\"":["Проект «"],"The saved key no longer works. Enter a new one.":["Сохранённый ключ больше не работает. Введите новый."],"The selected element is in the block that supports a multicolumn structure. To add a new column, click the \\"Add a column\\" button.":["Выделенный элемент находится в блоке, в котором можно организовать многоколоночную структуру. Для добавления новой колонки нажмите кнопку «Добавить колонку»."],"The server returned an unexpected response. Please try again or contact support.":["Сервер вернул неожиданный ответ. Попробуйте ещё раз или обратитесь в службу поддержки."],"The specified parameters will be added to all links when exporting the email.":["Специальные параметры будут добавлены во все ссылки при экспорте."],"The test email will be sent to the specified addresses.":["Тестовое письмо будет отправлено на указанные адреса."],"The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it.":["Название отображается в списке шаблонов и зачастую совпадает с темой письма, но вы можете его изменить."],"The trash is empty.":["Корзина пуста."],"The trial has ended. You are on the Free plan.":["Пробный период закончился. Вы пользуетесь тарифом «Free»."],"The two passwords that you entered do not match!":["Два введенных вами пароля не совпадают!"],"The usage limit has been exceeded":["Превышен лимит использования"],"The user is blocked":["Пользователь заблокирован"],"The user is unblocked":["Пользователь разблокирован"],"The whole email":["Всё письмо"],"Theme":["Тема"],"There are no blocks for this request.":["По данному запросу ничего не найдено."],"There are no members yet":["Участников пока нет"],"There's no such comment.":["Нет такого комментария."],"There's no such element in the email.":["В письме нет такой метки."],"These global blocks have a newer saved version. Select the ones to update in the template.":["Для этих глобальных блоков имеется более новая сохраненная версия. Выберите в шаблоне те из них, которые необходимо обновить."],"This Figmail link has expired or is unavailable. Open the email from the plugin again.":["Ссылка Figmail устарела или недоступна. Откройте письмо из плагина ещё раз."],"This action cannot be undone.":["Это действие нельзя отменить."],"This and other features are available for you on a higher plan.":["Эти и другие функции доступны для вас на более старшем тарифном плане."],"This can be the name of your company, department, website, project, marketing campaign, or other activity.":["Это может быть название вашей компании, отдела, веб-сайта, проекта или сферы деятельности, для которой вы планируете создать рассылку."],"This element":["Этот элемент"],"This email must be verified in Mailganer":["Адрес необходимо подтвердить в Mailganer"],"This email must be verified in Sendsay":["Адрес необходимо подтвердить в Sendsay"],"This email must be verified in Unisender":["Адрес необходимо подтвердить в Unisender"],"This email no longer exists. It may have been deleted.":["Письма больше нет. Возможно, его удалили."],"This field is required":["Это обязательное поле"],"This field sets the width of the email.":["Это поле выставляет ширину письма."],"This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.":["Это глобальный блок. Вы можете создать новый блок, чтобы изменения вступили в силу только в этом письме, или обновить текущий — в этом случае изменения будут применены везде, где используется этот блок."],"This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.":["Этот шаблон не был создан в нашем редакторе. Преобразуйте его, чтобы получить доступ ко всем возможностям редактирования: легко изменяйте тексты, заменяйте изображения и управляйте блоками."],"This link cannot be used as a font source.":["Эту ссылку нельзя использовать как источник шрифта."],"This may take several minutes. Please keep this tab open.":["Это может занять несколько минут. Пожалуйста, не закрывайте эту вкладку."],"This promo code is already applied.":["Промокод уже применен."],"This section will be implemented in a separate task.":["Раздел пока в разработке."],"This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control.":["Этот шаблон создан в другом редакторе. Пересоберите его из наших компонентов и получите стабильное отображение, редактирование без ошибок и полный контроль над дизайном."],"Time":["Время"],"Time units font settings":["Шрифт единиц времени"],"Time zone":["Часовой пояс"],"Title":["Название"],"Title copied to email settings":["Заголовок скопирован в настройки письма"],"Title should not be empty":["Заголовок не должен быть пустым"],"Title shown above the control":["Название, отображаемое над элементом управления"],"To add a block from the dashboard click the":["Чтобы добавить блок, нажмите в визуальном редакторе письма кнопку"],"To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.":["Чтобы избежать этой проблемы, отключите перевод данного сайта в настройках браузера или отключите функцию автоматического перевода."],"To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version.":["Для изменения внешнего вида элемента в мобильном устройстве, внесите правки в поля ниже. Если поле пустое, то в мобильной версии применятся стили для десктопа."],"To create a copy, you need to save the block.":["Чтобы создать копию, вы должны сохранить блок."],"To create a copy, you need to save the email.":["Чтобы создать копию, вы должны сохранить письмо."],"To emails":["В письма"],"To fully address all necessary tasks in any field":["Чтобы в полной мере решить все необходимые задачи в любой области"],"To get started quickly":["Чтобы быстро приступить к работе"],"To import from Stripo, add the REST API key of your Stripo project: <1>open the project settings in Stripo</1>, find “Access the REST API” and generate a key.":["Чтобы импортировать из Stripo, добавьте ключ REST API вашего проекта Stripo: <1>откройте настройки проекта в Stripo</1>, найдите «Access the REST API» и сгенерируйте ключ."],"To leave comments you must be logged into Blocks and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To leave comments you must be logged into EmailMaker and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To preview and edit the uploaded image":["Предварительный просмотр и редактирование загруженного изображения"],"To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.":["Чтобы отправить тестовое письмо, вам необходимо подтвердить свой адрес электронной почты. Если вы не получили ссылку для подтверждения, обратитесь в службу поддержки через чат или по электронной почте {supportEmail}."],"Today":["Сегодня"],"Too many items selected. One import takes up to 1000 items.":["Выбрано слишком много. Один импорт берёт до 1000 элементов."],"Tooltip or hint text":["Всплывающая подсказка или текст подсказки"],"Tooltip text":["Текст всплывающей подсказки"],"Top":["Сверху"],"Top left corner":["Верхний левый угол"],"Top margin":["Отступ сверху"],"Top padding":["Отступ сверху"],"Top right corner":["Верхний правый угол"],"Top up balance":["Пополнить баланс"],"Transfer to folder":["Переместить"],"Translator":["Переводчик"],"Transparency":["Прозрачность"],"Trial":["Триал"],"Trial activated":["Пробная версия активирована"],"Trial active":["Пробная версия активна"],"Trial period activated.":["Пробный период активирован."],"Try again":["Попробовать ещё раз"],"Try every editor feature — free":["Попробуйте все возможности редактора — бесплатно"],"Try for free":["Попробуйте бесплатно"],"Try reloading the page.":["Попробуйте перезагрузить страницу."],"Try sign in with your new password.":["Попробуйте войти с новым паролем."],"Turn on a 14-day trial and the whole editor opens up:":["Включим пробный период на 14 дней — и редактор откроется целиком:"],"Type":["Тип"],"Type category here":["Укажите категорию"],"Type in the project's webhook":["Введите проект webHook"],"Type subject":["Укажите тему письма"],"Type the output parameters of your platform. E.g., ":["Указывайте символы вывода параметра вашей платформы. Например, "],"Type title here":["Введите название"],"Type your description here":["Введите описание"],"Type your request":["Введите ваш запрос"],"Type your tags here":["Укажите теги"],"Typing...":["Ввод текста..."],"Typograf":["Типограф"],"Typography":["Типограф"],"URL":["URL"],"URL must start with https://":["Адрес должен начинаться с https://"],"URL of the video clip.":["URL-адрес видеоклипа."],"UTM parameters":["UTM-метки"],"Unavailable":["Недоступно"],"Unblock user":["Разблокировать пользователя"],"Underline":["Подчёркнутый"],"Underline ( Ctrl+U )":["Подчёркнутый ( Ctrl+U )"],"Underline ( ⌘U )":["Подчёркнутый ( ⌘U )"],"Undo (Ctrl+Z)":["Отменить (Ctrl+Z)"],"Unisender":["Unisender"],"Unknown error":["Неизвестная ошибка"],"Unknown integration":["Неизвестная интеграция"],"Unlimited possibilities with the PRO plan":["Безграничные возможности с тарифом PRO"],"Unlock":["Разблокировать"],"Unordered list":["Ненумерованный список"],"Unsaved changes":["Несохранённые изменения"],"Untitled email.":["Письмо без названия."],"Up to parent element":["Перейти к контейнеру"],"Update":["Обновить"],"Update current block":["Обновить текущий блок"],"Update date":["Дата обновления"],"Update global blocks":["Обновить глобальные блоки"],"Updated":["Обновлено"],"Upload":["Загрузить"],"Upload .woff, .woff2, .ttf or .otf files for use in the email editor.":["Загрузите файлы .woff, .woff2, .ttf или .otf, чтобы использовать их в редакторе писем."],"Upload Image":["Загрузить изображение"],"Upload failed":["Загрузка не удалась"],"Upload first font":["Загрузить первый шрифт"],"Upload font":["Загрузить шрифт"],"Upload logo":["Загрузить логотип"],"Upload your email":["Загрузить своё письмо"],"Uppercase":["Заглавные"],"Uppercase letters (A-Z)":["Заглавные буквы (A–Z)"],"Usage analytics":["Аналитика использования"],"Use custom icon for checked state":["Использовать пользовательскую иконку для отмеченного состояния"],"Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.":["Используйте наш визуальный редактор, чтобы настроить каждый элемент под свои нужды: изменить рамки и их радиус, тени, отступы, фон и многое другое."],"Use this email as a template for creating future emails.":["Используйте это письмо в качестве шаблона для создания будущих писем."],"Use this one":["Использовать эту"],"Use your own styles instead of defaults for states such as error, focus, and success.":["Используйте собственные стили вместо стандартных для таких состояний, как «ошибка», «фокус» и «успех»."],"Used":["Используемые"],"User":["Пользователь"],"User not found":["Пользователь не найден"],"Username":["Логин"],"Users":["Пользователи"],"VAT":["НДС"],"Valid":["Верно"],"Valid until":["Оплачен до"],"Validation error message":["Сообщение об ошибке проверки"],"Value":["Значение"],"Variable value":["Значение переменной"],"Version history":["Контроль версий"],"Version of":["Версия от"],"Vertical":["Вертикальный"],"Vertical alignment":["Верт. выравнивание"],"Vertical offset":["Верт. смещение"],"Vertical padding":["Вертикальный отступ"],"Vertical position":["Верт. смещение"],"Video":["Видео"],"Video URL":["URL-адрес видео"],"View only — you cannot edit settings in this section.":["Только просмотр — настройки в этом разделе менять нельзя."],"Vimeo":["Vimeo"],"Visibility":["Видимость"],"Visibility in AMP":["Видимость в AMP"],"Visit site":["Перейти на сайт"],"Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.":["Хотите изменить размер изображения, добавить текст или применить фильтр? Не нужно покидать EmailMaker! Все основные изменения вы можете сделать в нашем редакторе изображений."],"Warning":["Предупреждение"],"Warnings":["Предупреждения"],"We are always in touch":["Мы всегда на связи"],"We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.":["Мы автоматически удалили внедренный код. Чтобы избежать этой проблемы, отключите расширение для этого сайта или воспользуйтесь редактором в окне инкогнито без расширений."],"Web version":["Веб-версия"],"Webhook":["WebHook"],"Webhook URL":["Вебхук"],"Webhook settings":["Настройки вебхука"],"Webhook successfully sent!":["WebHook отправлен!"],"Website link":["Ссылка на сайт"],"Week":["Неделя"],"What's new":["Что нового"],"When the trial ends, the service switches to the free plan.":["Когда триал закончится, сервис перейдёт в бесплатный режим."],"When the trial ends, you will return to the Free plan.":["По окончании пробного периода вы вернётесь к тарифу «Free»."],"When you need more letters, additional projects and participants":["Если вам понадобится больше писем, дополнительных проектов и участников"],"While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices.":["Похоже, при редактировании шаблона, некоторые элементы перестали помещаться в экран мобильного устройства. Попробуйте уменьшить их ширину."],"White":["Белый"],"White circle":["Белый круг"],"White circle outlined":["Белый круг обводка"],"Width":["Ширина"],"With VAT":["С НДС"],"With VAT / without VAT":["С НДС / без НДС"],"With warnings":["С предупреждениями"],"Without VAT":["Без НДС"],"Without background color":["Без цвета фона"],"Without button":["Без кнопки"],"Without folder":["Без папки"],"Without image":["Без картинки"],"Without shadow":["Без тени"],"WordPress user ID":["ID пользователя в WordPress"],"Work with the HTML code":["Работа с HTML-кодом"],"Work with your markup":["Работайте со своей вёрсткой"],"Year":["Год"],"Yes":["Да"],"You are buying a set of AI generation requests:":["Вы приобретаете набор запросов на генерацию с помощью ИИ:"],"You are buying an extra email generation package:":["Вы приобретаете дополнительный пакет для создания писем:"],"You are buying an extra image check package:":["Вы приобретаете дополнительный пакет проверки изображений:"],"You are buying an extra image generation package:":["Вы приобретаете дополнительный пакет для генерации изображений:"],"You are buying an extra link check package:":["Вы приобретаете дополнительный пакет проверки ссылок:"],"You are buying an extra optimization package:":["Вы приобретаете дополнительный пакет оптимизации:"],"You are buying an extra preview/test sends package:":["Вы приобретаете дополнительный пакет тестов:"],"You are buying an extra spam check package:":["Вы приобретаете дополнительный пакет проверки на спам:"],"You are paying for the plan:":["Вы оплачиваете тарифный план:"],"You are running out of AI tool usage.":["Ваш лимит использования инструментов ИИ подходит к концу."],"You can activate a 2-week trial version that includes access to all features.":["Вы можете активировать 2-недельную пробную версию, которая включает доступ ко всем функциям."],"You can add more generations right now; they are billed separately from the generations included in your plan.":["Вы можете добавить дополнительные генерации прямо сейчас; их стоимость оплачивается отдельно от генераций, включенных в ваш тарифный план."],"You can also save all blocks at once. The AI assistant will automatically determine the type and create a name for each block when saving.":["Вы также можете сохранить все блоки сразу. ИИ ассистент автоматически определит тип и создаст имя для каждого блока при сохранении."],"You can close this window: the import continues in the background.":["Окно можно закрыть: импорт продолжится в фоне."],"You can get more emails and access to all features.":["Вы сможете создавать больше писем и получить доступ ко всем функциям."],"You can increase the limit by changing your plan or buying an extra package.":["Вы можете увеличить лимит, сменив тарифный план."],"You can increase the number of emails right now.":["Вы можете увеличить количество писем прямо сейчас."],"You can save blocks from the email template.":["Вы можете сохранить блоки из шаблона письма."],"You cannot switch plans because a limit has been exceeded.":["Вы не можете сменить тарифный план, так как превышен лимит."],"You changed the role of ":["Вы поменяли роль "],"You deleted ":["Вы исключили пользователя "],"You deleted yourself from the project successfully.":["Вы исключили себя из проекта."],"You do not have access to this email.":["У вас нет доступа к этому письму."],"You do not have permission to edit project styles.":["У вас нет прав на редактирование стилей проекта."],"You do not have permission to view this section.":["У вас нет прав на просмотр этого раздела."],"You don't have any blocks in this folder.":["У вас нет блоков в этой папке."],"You don't have any blocks yet.":["У вас еще нет сохранённых блоков."],"You don't have any emails in this folder.":["В папке пока нет писем."],"You don't have any emails yet.":["У вас еще нет сохранённых писем."],"You don't have any projects yet.":["У вас пока нет проектов."],"You don\`t have any saved blocks yet.":["У вас ещё нет сохранённых блоков."],"You have reached the limit of AI chat usage.":["Вы достигли предела использования чата ИИ.\\n"],"You have reached the limit of AI generator usage.":["Вы достигли предела использования генератора ИИ.\\n"],"You have unsaved changes. Leave this page without saving?":["У вас есть несохранённые изменения. Покинуть страницу без сохранения?"],"You have used up the number of emails you can create on your current plan":["Вы исчерпали лимит на количество писем, которое можно создать в рамках вашего текущего тарифа"],"You have used up your AI generations":["Вы исчерпали лимит генераций ИИ"],"You have used up your image check limit":["Вы исчерпали лимит проверки изображений"],"You have used up your image generation limit":["Вы исчерпали лимит на генерацию изображений"],"You have used up your link check limit":["Вы исчерпали лимит проверок ссылок"],"You have used up your optimisation limit":["Вы исчерпали лимит оптимизаций"],"You have used up your preview (test send) limit":["Вы исчерпали лимит на просмотр в почтовиках"],"You have used up your spam check limit":["Вы исчерпали лимит проверок на спам"],"You have used up your test send limit":["Вы исчерпали лимит тестовых отправок"],"You reached the plan limit":["Достигнут лимит тарифа"],"You revoke invite for ":["Вы отзываете приглашение для "],"Your Altcraft Platform URL (Cloud: ru.altkraft.com or your On-Premises URL)":["URL вашей платформы Altcraft (облачная версия: ru.altkraft.com или URL вашей локальной версии)"],"Your Sendsay account login (not email). For sublogin use format: account/sublogin":["Ваш логин в Sendsay (не email). Для ввода дополнительного логина используйте формат: account/sublogin"],"Your admin session has ended. Sign in again.":["Сессия администратора закончилась. Войдите заново."],"Your company":["Ваша компания"],"Your current plan":["Ваш текущий тариф"],"Your email doesn't look like spam.":["Ваше письмо не похоже на спам."],"Your generations are running out soon":["Генерации с помощью ИИ скоро закончатся"],"Your letter contains %d block that can be saved for future use.":["Ваше письмо содержит %d блок, который можно сохранить для использования в будущем.","Ваше письмо содержит %d блока, которые можно сохранить для использования в будущем.","Ваше письмо содержит %d блоков, которые можно сохранить для использования в будущем."],"Your package is activated":["Пакет активирован"],"Your password successfully reset.":["Ваш пароль успешно сброшен."],"Your password was successfully changed.":["Ваш пароль успешно изменен."],"Your plan is activated":["Тариф активирован"],"Your plan will expire soon":["Ваш тариф скоро закончится"],"Your profile was successfully updated.":["Настройки сохранены."],"Your project has incoming email":["У вашего проекта есть входящая почта"],"Your templates and emails":["Ваши шаблоны и письма"],"Youtube Black":["Youtube Чёрный"],"Youtube Red":["Youtube Красный"],"Youtube White":["Youtube Белый"],"Z-A":["Я-А"],"ZIP":["ZIP-архив"],"accordion":["аккордеон"],"and":["и"],"before %s":["до %s"],"block":["Блок","",""],"block\\u0004\\" was successfully removed.":["» удалён."],"block\\u0004Are you sure to delete selected blocks?":["Вы уверены, что хотите удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete selected blocks?":["Вы уверены, что хотите безвозвратно удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete the “":["Вы уверены, что хотите удалить «"],"block\\u0004Are you sure you want to delete the “":["Вы уверены, что хотите удалить блок «"],"block\\u0004locked.":["заблокирован."],"block\\u0004unlocked.":["разблокирован."],"block\\u0004” was successfully created.":["» создана."],"block\\u0004” was successfully removed.":["» удалён."],"border\\u0004Width":["Толщина"],"button":["кнопка"],"carousel":["карусель"],"cell":["ячейка"],"column":["колонка"],"confirmation code":["код подтверждения"],"container":["контейнер"],"copy\\u0004\\" was successfully created.":["» создана."],"countdown":["таймер"],"cpc":["cpc"],"day":["день","дня","дней"],"e.g., 123456":["Например, 123456"],"e.g., Newsletter June 2026":["Например, дайджест за июнь"],"e.g., Special offer for you!":["Например: Специальное предложение!"],"e.g., Your Company":["Например, Ваша компания"],"e.g., https://ru.altkraft.com":["Например, https://ru.altkraft.com"],"e.g., myaccount or myaccount/sublogin":["Например, myaccount или myaccount/sublogin"],"element":["элемент"],"email":["эл. почта"],"email\\u0004\\" was successfully removed.":["\\" удалено."],"email\\u0004Are you sure to delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to delete selected emails?":["Вы уверены, что хотите удалить выбранные письма?"],"email\\u0004Are you sure to irrevocably delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to irrevocably delete selected emails?":["Вы уверены, что хотите безвозвратно удалить выбранные письма?"],"email\\u0004locked.":["заблокировано."],"email\\u0004unlocked.":["разблокировано."],"empty link":["пустая ссылка"],"empty src":["нет картинки"],"enKod":["enKod"],"expanded":["Раскрыт"],"folder\\u0004\\" was successfully created.":["» создана."],"folder\\u0004Are you sure to delete “":["Вы уверены, что хотите удалить папку «"],"folder\\u0004” was successfully changed to “":["» переименована в «"],"google":["google"],"group":["группа"],"group\\u0004All":["Все"],"group\\u0004Are you sure to delete “":["Вы уверенны, что хотите удалить группу «"],"group\\u0004Project":["Проектные"],"group\\u0004Standard":["Стандартные"],"group\\u0004” was successfully changed to “":["» переименована в «"],"hour":["час","часа","часов"],"https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png":["https://emcdn.ru/384263/241017_18_K3O0sad.png"],"https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png":["https://emcdn.ru/644755/241021_5149_MtX8mBz.png"],"https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png":["https://emcdn.ru/384263/241017_18_fsshqsL.png"],"https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png":["https://emcdn.ru/384263/241017_18_I98a6kp.png"],"https://cdn.useblocks.io/1351/241017_18_NDYloAO.png":["https://emcdn.ru/384263/241017_18_QFBYtv0.png"],"https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png":["https://emcdn.ru/384263/241017_18_HFSbGb5.png"],"https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png":["https://emcdn.ru/384263/241017_18_Uu6iuFF.png"],"https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png":["https://emcdn.ru/384263/241017_18_lkaw2P4.png"],"https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png":["https://emcdn.ru/384263/241017_18_ykdbX19.png"],"https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png":["https://emcdn.ru/384263/241017_18_HMNSbZd.png"],"https://cdn.useblocks.io/1351/241031_18_JoH0f3E.png":["https://emcdn.ru/719787/241031_976_jyIsWjj.png"],"https://cdn.useblocks.io/1351/241031_18_OQEyMEF.png":["https://emcdn.ru/719787/241031_976_lgYswn9.png"],"https://cdn.useblocks.io/1351/241031_18_aJAY1Xz.png":["https://emcdn.ru/719787/241031_976_XfDnnmK.png"],"images":["Изображения"],"indent":["отступ"],"kB":["kB"],"letter\\u0004Email":["Письмо"],"letter\\u0004email":["Письмо"],"link":["ссылка"],"loading more":["загрузить ещё"],"mail generator":["генератор писем"],"main heading":["основной заголовок"],"max 10":["максимум 10"],"member\\u0004 to ":[" на "],"member\\u0004Administrator":["Администратор"],"member\\u0004Invited":["Приглашённый"],"member\\u0004Owner":["Владелец"],"messeges":["сообщения"],"minute":["минута","минуты","минут"],"ms":["мс"],"new password":["новый пароль"],"not valid":["не верно"],"of":["из"],"or":["или"],"password":["пароль"],"picture":["изображение"],"project\\u0004 across all your projects?":[" во всех ваших проектах?"],"project\\u0004 from project ":[" из проекта "],"project\\u0004 in project ":["в проекте"],"project\\u0004Actions":["Действия"],"project\\u0004Add members":["Добавить участников"],"project\\u0004Are you sure you want to change permissions for user ":["Вы уверены, что хотите изменить права доступа для пользователя "],"project\\u0004Are you sure you want to invite user ":["Вы уверены, что хотите пригласить этого пользователя "],"project\\u0004Are you sure you want to remove user ":["Вы уверены, что хотите удалить пользователя "],"project\\u0004Are you sure you want to revoke the invitation for ":["Вы уверены, что хотите отозвать приглашение для "],"project\\u0004Change in all projects":["Изменить во всех проектах"],"project\\u0004Confirm":["Подтвердить"],"project\\u0004Could not load the project list":["Не удалось загрузить список проектов"],"project\\u0004Could not undo exclusion":["Не удалось отменить исключение"],"project\\u0004Delete":["Удалить"],"project\\u0004Delete project":["Удалить проект"],"project\\u0004Edit member list":["Изменить список участников"],"project\\u0004Email address":["Email"],"project\\u0004Exclude":["Удалить"],"project\\u0004Failed to send invitation":["Не удалось отправить приглашение"],"project\\u0004Failed to send invitations":["Не удалось отправить приглашения"],"project\\u0004Failed to update permissions":["Не удалось обновить права доступа"],"project\\u0004In all projects":["Во всех проектах"],"project\\u0004Invite":["Пригласить"],"project\\u0004Invite participants":["Пригласить участников"],"project\\u0004Invite to all projects":["Пригласить во все проекты"],"project\\u0004Name":["Имя"],"project\\u0004No matching memberships to update in your other projects":["В других ваших проектах нет подходящих участников для обновления"],"project\\u0004Permissions updated":["Права доступа обновлены"],"project\\u0004Project participants":["Участники проекта"],"project\\u0004Project settings":["Настройки проекта"],"project\\u0004Remove from project":["Удалить из проекта"],"project\\u0004Revoke":["Отозвать"],"project\\u0004Revoke invite":["Отозвать приглашение"],"project\\u0004Role in project":["Роль в проекте"],"project\\u0004The invitation was restored":["Приглашение было восстановлено"],"project\\u0004The invitation was sent to all your projects":["Приглашение было отправлено во все ваши проекты"],"project\\u0004The invitation was sent to some of your projects":["Приглашение было отправлено некоторым из ваших проектов"],"project\\u0004The participant was restored to the project":["Участник был восстановлен в проекте"],"project\\u0004Undo":["Отменить"],"project\\u0004You":["Вы"],"project\\u0004You are not the owner of any project":["Вы не являетесь владельцем какого-либо проекта"],"project\\u0004You excluded user ":["Вы заблокировали пользователя "],"recovery\\u0004\\" was successfully recovered.":["» восстановлен."],"recovery\\u0004” was successfully deleted.":["» удалено."],"recovery\\u0004” was successfully recovered.":["» завершено."],"running+shoes":["running+shoes"],"s":["с"],"secure":["безопасно"],"selected":["выбрано"],"selling blue":["продающий синий"],"sender@example.com":["sender@example.com"],"spring_sale":["spring_sale"],"tab\\u0004AI assistant":["AI Ассистент"],"tab\\u0004Build":["Контент"],"tab\\u0004Calendar":["Календарь"],"tab\\u0004Checkbox":["Чекбокс"],"tab\\u0004Discuss":["Обсуждение"],"tab\\u0004Dropdown list":["Выпадающий список"],"tab\\u0004Input":["Поле ввода"],"tab\\u0004Optimize":["Оптимизация"],"tab\\u0004Radio button":["Радиокнопка"],"tab\\u0004Settings":["Настройки"],"tab\\u0004Styles":["Стили"],"table":["таблица"],"test":["тест","теста","тестов"],"text":["текст"],"textlink":["textlink"],"time to load":["время загрузки"],"total size":["общий размер"],"user":["Пользователь"],"user role\\u0004Admin":["Администратор"],"utm_campaign":["utm_campaign"],"utm_content":["utm_content"],"utm_medium":["utm_medium"],"utm_source":["utm_source"],"utm_term":["utm_term"],"variable":["переменная"],"verb\\u0004Import":["Импортировать"],"video":["видео"],"was successfully":[" успешно"],"was used":["был использован","было использовано","было использовано"],"which exceeds the recommended 90 KB limit.":["что превышает рекомендуемый предел в 90 КБ."],"–":["–"],"—":["—"],"“":["«"],"”":["»"],"” block?":["»?"],"” folder?":["»?"],"” group and all nested groups?":["» вместе со всеми вложениями?"],"” was successfully created.":["» создан."],"” was successfully imported.":["» импортировано."],"” was successfully sent.":["» отправлено."],"”.":["»."],"🎉 Welcome! Pro plan is activated":["🎉 Привет! Тариф Pro активирован"]}`)};function Em(e){if(!Sa)return;const{id:t,catalog:r,time:o,hash:a}=Sa;e.getInstance(n.LOCALE_SERVICE_ID)?.prime(t,r,{time:o,hash:a})}function wa(e,t,r){let o=!1;const a=e.watch(i=>{o||!t(i)||(o=!0,r())});o&&a.dispose()}function Sm(e,t){const r=e.getInstance(d.CONFIG_SOURCE_ID);r&&wa(r,o=>!!o?.codeEnabled||!!o?.codeSideEnabled,()=>{Cm(e,()=>{Am(e,()=>{km(e,()=>{n.getEditorVisible(e).whenVisible(()=>{n.whenIdle(()=>{wm(t).catch(()=>{})})})})})})})}async function wm(e){await e()}function km(e,t){const r=e.getInstance(mo);if(!r){n.whenIdle(t);return}const o=()=>{if(r.pipeline.filledGeneration()!==void 0){t();return}n.whenIdle(o)};n.whenIdle(o)}function Cm(e,t){const r=e.getInstance(n.EMAIL_DOCUMENTS_ID);if(!r)return;if(r.current()){t();return}let o=!1;const a=r.subscribe(()=>{o||!r.current()||(o=!0,t())});o&&a()}function Am(e,t){const r=e.getInstance(d.OPTIONS_SOURCE_ID);r&&wa(r,o=>!!o?.element,t)}function Im(e){Sm(e,n.warmCodeEditor)}function ka(e,t="success"){return typeof e=="string"&&(e={message:e}),n.filterUndefined({type:e.type||t,data:e.data,innerException:e.innerException,title:e.message,description:e.description,actions:e.btn,onClose:e.onClose,duration:e.duration,icon:e.icon,placement:e.placement,style:e.style,closeIcon:e.closeIcon,props:e.props,role:e.role})}var Tm="bottomRight";function An(e,t){return typeof e=="string"||typeof e=="object"?ka(e,t):e}var Pm=class extends d.Disposable{send;onNotify;onError;onSuccess;constructor(e,t,r){super(),this.send=r,this.onNotify=rt(t,s=>s,s=>An(s)),this.onError=rt(d.filter(t,s=>s.type==="error"),s=>s,s=>An(s,"error")),this.onSuccess=rt(d.filter(t,s=>s.type==="success"),s=>s,s=>An(s));const o=this.addDisposable(new tt(this.onNotify)),a=this.addDisposable(new tt(this.onError)),i=this.addDisposable(new tt(this.onSuccess));this.addDisposable(e.watch(({handleNotify:s,handleError:c,handleSuccess:u})=>{o.setListener(s),a.setListener(c),i.setListener(u)}))}notify(e){this.send({placement:Tm,...ka(e)})}};function xm(e){e.injectFactory(en,(t,r)=>{if(r)return r;const o=new Pm(e.getInstance(d.OPTIONS_SOURCE_ID),d.getEvent(e,d.events.ON_NOTIFICATION),a=>{n.executeCommand(e,n.NOTIFY_COMMAND_ID,a)});return e.getInstance(d.DISPOSABLE_ID)?.addDisposable(o),o},!0)}function Rm(e){const t=n.getEmailDocuments(e),r=a=>{e.getInstance(d.STORE_ID)?.dispatch(n.taxonomiesApi.util.invalidateTags([{type:"folder",id:a}]))},o=t.onSaved(a=>{a.created&&r("folder")});e.getInstance(d.DISPOSABLE_ID)?.addDispose(o)}var Om=[{name:"rest.legacySections",provides:[d.REST_CLIENT_ID],setup:d.provideLegacyRestSections},{name:"canvas.resizer",provides:[n.CANVAS_RESIZER_BINDER_ID],setup:fm},{name:"canvas.sandboxLocale",awaits:{services:[n.LOCALE_SERVICE_ID]},setup:gm},{name:"locale.brandCatalog",awaits:{services:[n.LOCALE_SERVICE_ID]},setup:Em},{name:"email.restPorts",provides:[n.REST_EMAIL_PORTS_ID],setup:cm},{name:"block.historyPort",setup:nd},{name:"email.templatePrefetch",setup:ym},{name:"locale.antd",awaits:{services:[n.LOCALE_SERVICE_ID]},setup:bm},{name:"save.listsFollow",setup:Rm},{name:"monaco.prewarm",awaits:{services:[d.CONFIG_SOURCE_ID]},setup:Im},{name:"notifications",provides:[en],setup:xm},{name:"email.operations",setup:Gp}],Mm=d.defineMixin(e=>{for(const t of Yp(Om))t.setup(e);return{instance:qp(e)}}),jm=d.combineMixins([Mm,Zu,Tp,Lp,Hp,zp,Vl,Eo,So]);async function Lm(e){const t=new Map;typeof e=="object"&&(e=e.code);const{amp2html:r,html2amp:o}=await(0,je.__vitePreload)(async()=>{const{amp2html:s,html2amp:c}=await Promise.resolve().then(()=>se("./static/core/ed4586a5.js"));return{amp2html:s,html2amp:c}},void 0,{}.url),a=await Ze.changeHtml(e,async s=>{await Ze.replaceImagesInDocument(s.document,c=>n.mapper.getEscapedText(c)!==c?c:n.toAbsoluteUrl(c),t);for(const c of s.document.querySelectorAll(".em-amp-show-disabled"))c.remove();s.handleRender(async({contentDocument:c,managedNodeController:u})=>{await o(c,{mappedTags:{script:"___script"},commit:()=>u.commit()})})},[800]),i=await Ze.changeHtml(e,async s=>{await Ze.replaceImagesInDocument(s.document,c=>n.mapper.getEscapedText(c)!==c?c:n.toAbsoluteUrl(c),t);for(const c of s.document.querySelectorAll(".em-amp-show-only"))c.remove();await r(s.document,{mappedTags:{script:"___script"}})},[800]);return{code:e,html:i,ampHtml:a}}async function Dm(){const{installDiagnostics:e}=await(0,je.__vitePreload)(async()=>{const{installDiagnostics:t}=await Promise.resolve().then(()=>se("./static/core/c7b2d60e.js"));return{installDiagnostics:t}},void 0,{}.url);return e()}async function Nm(e,t){const{initDevTools:r}=await(0,je.__vitePreload)(async()=>{const{initDevTools:o}=await Promise.resolve().then(()=>se("./static/core/dfbe3ba4.js"));return{initDevTools:o}},void 0,{}.url);r(e,t)}var Fm="1.2.3";xt.asyncMixins=jm,xt.initDevTools=Nm,xt.installDiagnostics=Dm,xt.parseAMP=Lm,xt.version=Fm});
|