@emailmaker/emailmaker 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/emailmaker-core.7d5d6426.js +1 -0
- package/emailmaker-esm.js +3 -3
- package/emailmaker.d.ts +2 -2
- package/emailmaker.js +3 -3
- package/iframe/js/amp.BtGt-xkd.js +1 -0
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.CNqvmp_P.js +1 -1
- package/iframe/js/sanitize-html.BzjMWt1k.js +1 -0
- package/package.json +1 -1
- package/static/core/{857a130e.js → 2a6d9ce7.js} +1 -1
- package/static/core/{d1bf7655.js → 33d703fb.js} +1 -1
- package/static/core/{b1fd86b4.js → 37cc0ac5.js} +1 -1
- package/static/core/3872445e.js +1 -0
- package/static/core/{28ca49a6.js → 45958f0e.js} +1 -1
- package/static/core/{34b8b5ce.js → 69b8570a.js} +44 -44
- package/static/core/{786ef914.js → 72ee0271.js} +1 -1
- package/static/core/{a29e21f4.js → 771d97fd.js} +1 -1
- package/static/core/{7a60accf.js → 925dcb4a.js} +1 -1
- package/static/core/{fcb5a15a.js → 9ffd0912.js} +1 -1
- package/static/core/{62cd8965.js → a389d04a.js} +1 -1
- package/static/core/{24946254.js → bb9df2d2.js} +1 -1
- package/static/core/{31db2775.js → bd0eba9e.js} +1 -1
- package/static/core/d62f3e6a.js +47 -0
- package/static/core/{edf6a1bb.js → f11f8091.js} +1 -1
- package/static/esm/27964dfe.js +1 -0
- package/static/esm/c1e3467e.js +1 -0
- package/emailmaker-core.a1df38d3.js +0 -1
- package/iframe/js/amp.BiJ6w6WR.js +0 -1
- package/iframe/js/sanitize-html.3OUPclIN.js +0 -1
- package/static/core/39ea46f3.js +0 -1
- package/static/core/5cdb0560.js +0 -47
- package/static/esm/48de0f80.js +0 -1
- package/static/esm/53bd1900.js +0 -1
- /package/iframe/{iframe-eblock.a1df38d3.html → iframe-eblock.7d5d6426.html} +0 -0
- /package/iframe/{iframe.a1df38d3.html → iframe.7d5d6426.html} +0 -0
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ npm install @emailmaker/emailmaker
|
|
|
34
34
|
| Сборка | Без штатного плагина Webpack/Vite задайте **`publicPath`** (**`__emailmaker__`**). Бандл крупный (React, Monaco и др.). |
|
|
35
35
|
| Авторизация | **`getAuthToken`** или **`jwtAuth`**; **`client_secret`** только на сервере. |
|
|
36
36
|
| Файловый менеджер | **`storageProvider`**, **`config.imageCenterFileManagerView: true`**, при необходимости секция **`config.fileManager`** (**`ExportedApi.FileManagerOptions`**). Контракт **`StorageProvider`** объёмен — сверяйтесь с типами. |
|
|
37
|
-
| **`baseUrl`** |
|
|
37
|
+
| **`baseUrl`** | Origin API без суффикса `/wp-json` (напр. `https://api.emailmaker.ru` или `https://app.emailmaker.ru/api`); SDK добавляет `/wp-json` сам. |
|
|
38
38
|
| **`standaloneKey`** | Режимы с прокси файлов через события (см. код плагина); редкие сценарии. |
|
|
39
39
|
| **`commonStyles`** | Опционально на **`init` / `reset`**: объект стилей контента (частичный merge с **`COMMON_STYLES`**). Подробности — **`docs/plugin-content-styles.md`**. |
|
|
40
40
|
|
|
@@ -98,7 +98,7 @@ import * as emailmaker from '@emailmaker/emailmaker';
|
|
|
98
98
|
| **`content`** | Обязательно: HTML-строка или объект письма/шаблона. |
|
|
99
99
|
| **`config`** | Настройки UI редактора (**`ExportedApi.Config`**). |
|
|
100
100
|
| **`project`** | Идентификатор проекта в вашей системе / в EmailMaker. |
|
|
101
|
-
| **`baseUrl`** |
|
|
101
|
+
| **`baseUrl`** | Origin API без `/wp-json` (см. **`AppInitMixin.Options`**). |
|
|
102
102
|
| **`storageProvider`** | Реализация **`StorageProvider`** для файлового менеджера. |
|
|
103
103
|
| **`standaloneKey`** | Редкие режимы прокси файлов (**`instance.handleFileProxy`** / **`handleUrlProxy`**). |
|
|
104
104
|
| **`commonStyles`** | Объект стилей контента (частичный **merge** с **`COMMON_STYLES`**). См. **`docs/plugin-content-styles.md`**. |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__emailmaker__.define(`core`,[`require`,`exports`,`module`,`static/core/354bf8a9.js`,`static/core/d62f3e6a.js`,`static/core/37cc0ac5.js`,`static/core/a389d04a.js`,`static/core/925dcb4a.js`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),e("./static/core/354bf8a9.js");let r=e("./static/core/d62f3e6a.js"),i=e("./static/core/a389d04a.js"),a=e("./static/core/37cc0ac5.js"),o=e("./static/core/925dcb4a.js");function s(e){return async()=>(await e.app.app_init_create({})).data}function c(e,t,n){e.inject(r.va,void 0);let i;e.injectFactory(r.va,async(e,r)=>i||(i=(async()=>{let e=r?await r:void 0;return t({baseUrl:n.baseUrl,user:n.user,project:n.project,prevApp:e})})(),i),!0)}var l=a.A(e=>{let t,n,i,a,o,l=!1;function u(e){return String(e||``).trim()||void 0}return{setOptions(d){let f=!!e.getInstance(r.Ta),p=d.hasOwnProperty(`baseUrl`)?u(d.baseUrl):n,m=p?r.ia(p):void 0;if(d.hasOwnProperty(`baseUrl`)){let n=e.getInstance(r.na);t!==m&&n?.setOptions(m?{baseUrl:m}:{})}let h=i!==d.appInit,g=!r.$i(a,d.user),_=o!==d.project,v=t!==m;if(i=d.appInit,a=d.user,o=d.project,t=m,n=p,f||l&&!h&&!g&&!_&&!v)return;let y=e.getInstance(r.ha);c(e,i||s(y),{baseUrl:n,user:d.user,project:d.project}),l=!0}}}),u=r.Qa(),d=r.Qa(),f=a.A(e=>({setOptions(t){let n=i.On();e.addService(r.ta,{execute:n.decorate(async n=>{if(!t.jwtAuth)return;let i=e.getInstance(u);if(!e.getInstance(d)){if(!i)try{let n=e.getInstance(r.na)?.getOptions()?.baseUrl||``,a=await fetch(`${n}/jwt-auth/token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t.jwtAuth)});if(!a.ok)throw Error(`JWT auth failed: ${a.status}`);i=(await a.json()).token,e.inject(u,i)}catch{throw e.inject(d,r.hi),Error(r.hi)}i&&n.headers.append(`authorization`,`Bearer ${i}`)}})})}})),p=a.A(e=>{let t,n,a;return{async setOptions(o){let s=a!==o.getAuthToken,c=!r.$i(t,o.user),l=n!==o.project;if(a=o.getAuthToken,t=o.user,n=o.project,!(!e.getInstance(r.Ta)||!o.getAuthToken)&&!(!s&&!c&&!l))try{let t=await o.getAuthToken(o.user,o.project);e.inject(r.Ea,Promise.resolve(t||``));let n=i.I(t);if(!n)return;e.inject(r.Da,n);let a=e.getInstance(r.va),s=a?await a.catch(()=>void 0):void 0;e.inject(r.va,Promise.resolve(i.F(n,s)))}catch{}}}}),m=a.A(e=>{let t=e.getInstance(r.xa),n=new r.Ka,a=i.P(n.event);t.addDispose(()=>{let t=e.getInstance(r.Sa);n.fire(t)});let o=t.addDisposable(new i.N(a));return t.addDisposable(n),{setOptions({handleDestroy:e}){o.setListener(e)},instance:{handleDestroy:a,destroy:()=>t.dispose()}}}),h=a.A(e=>{let t=e.getInstance(r.xa),n=i.P(r.ja(e,r.ya)),a=t.addDisposable(new i.N(n));return{setOptions({handleLoad:e}){a.setListener(e)},instance:{handleLoad:n},dispose:()=>t.dispose()}}),g=a.A(e=>{let t=e.getInstance(r.xa),n=t.addDisposable(new r.Ga),a=t.addDisposable(new r.Ga),o=r.Aa(e,r.ba),s=i.P(n.event),c=i.P(a.event),l=i.P(o.event),u=t.addDisposable(new i.N(s)),d=t.addDisposable(new i.N(c)),f=t.addDisposable(new i.N(l));return{instance:{handleSetOptions:s,handleOptionsChanged:c,handleConfigChanged:l},async setOptions(e){u.setListener(e.handleSetOptions),d.setListener(e.handleOptionsChanged),f.setListener(e.handleConfigChanged),await n.fire(e),await a.fire(e)},dispose(){}}}),_=1e4;function v(e,t,n,r={}){let i=Object.assign({},e);for(let[e,a]of Object.entries(t))if(a!==void 0)if(n.includes(e)&&typeof a==`object`&&a){let t=i[e],n=r[e]??{};i[e]=Object.assign({},typeof t==`object`&&t?t:n,a)}else i[e]=a;return i}var y={border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},borderRadiusCards:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},padding:{all:null,top:null,right:null,bottom:null,left:null}},b={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:16,fontSizeDim:`px`,lineHeight:21,lineHeightDim:`px`,color:`#5a5a5a`,contrastColor:`#FFFFFF`,textAlign:`left`,paddingBottom:10,paddingBottomDim:`px`},x={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, 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},S={color:`#1C52DC`,contrastColor:`#FFFFFF`,underline:!0},C={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, 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:y.border,borderRadius:y.borderRadius,textAlign:`center`,padding:y.padding},w={backgroundColor:`#FFFFFF`,contrastBackgroundColor:`#1C52DC`,padding:y.padding},T={contrastBackgroundColor:`#1C52DC`,contrastTextColor:`#FFFFFF`,baseBackgroundColor:`#F8F8F8`,baseTextColor:`#333333`,border:y.border,borderRadius:y.borderRadiusCards};function E(e){return{...b,...e}}function D(e){return{...x,...e,bold:e?.bold??x.bold,italic:e?.italic??x.italic}}function O(e){return{...S,...e,underline:e?.underline??S.underline}}function k(e){return{...C,...e,bold:e?.bold??C.bold,italic:e?.italic??C.italic,border:{...C.border,...e?.border??{}},borderRadius:{...C.borderRadius,...e?.borderRadius??{}},padding:{...C.padding,...e?.padding??{}}}}function A(e){return{...w,...e,padding:{...w.padding,...e?.padding??{}}}}function j(e){return{...T,...e,border:{...T.border,...e?.border??{}},borderRadius:{...T.borderRadius,...e?.borderRadius??{}}}}var M=class{_editor;_layoutSettingsChanged=new r.Ka;_contentStylesChanged=new r.Ka;_messageSubscription;_messageSubscriptionPromise;_prevLayoutSnapshot;_prevContentSnapshot;constructor(e){this._editor=e}onChangeEmailLayoutSettings(e){let t=this._layoutSettingsChanged.event(e);return this._ensureMessageSubscription(),{dispose:()=>{t.dispose(),this._disposeMessageSubscriptionIfUnused()}}}onChangeEmailContentStyles(e){let t=this._contentStylesChanged.event(e);return this._ensureMessageSubscription(),{dispose:()=>{t.dispose(),this._disposeMessageSubscriptionIfUnused()}}}_disposeMessageSubscriptionIfUnused(){this._layoutSettingsChanged.hasListeners()||this._contentStylesChanged.hasListeners()||(this._messageSubscription?.dispose(),this._messageSubscription=void 0)}_mapLayoutSettings(e={}){return{backgroundColor:e.backgroundColor||``,backgroundImage:(e.backgroundImage||[]).map(e=>({type:`url`,value:e?.value||``})),backgroundPositionX:e.backgroundPositionX||``,backgroundPositionY:e.backgroundPositionY||``,backgroundRepeat:e.backgroundRepeat||``,backgroundSize:e.backgroundSize||``,backgroundColorContent:e.backgroundColorContent||``,textStrong:e.textStrong||!1,textItalic:e.textItalic||!1,textUnderline:e.textUnderline||!1,width:e.width,responsive:e.responsive}}_parseCommonStyles(e){let t={...r.Zi};try{e&&e!==`{}`&&(t=JSON.parse(e))}catch{}return t}_mapCommonStylesToContentStyles(e){return{text:E(e.text),headings:D(e.headings),links:O(e.links),buttons:k(e.buttons),block:A(e.block),cards:j(e.cards)}}_getCurrentLayoutSettings(e){return this._mapLayoutSettings(o.O(e.getState()))}_getCurrentContentStyles(e){return this._mapCommonStylesToContentStyles(this._parseCommonStyles(o.w(e.getState())?.common_styles))}_getLayoutSnapshot(e){return JSON.stringify(e)}_getContentSnapshot(e){return JSON.stringify(e)}async _ensureMessageSubscription(){if(!this._messageSubscription){if(this._messageSubscriptionPromise)return this._messageSubscriptionPromise;this._messageSubscriptionPromise=(async()=>{let e=await this._editor.container.getInstanceAsync(r.Oa);if(this._messageSubscription)return;let t=this._editor.container.getOrCreateInstance(r.La,()=>new r.Ua),n=this._getCurrentLayoutSettings(e),i=this._getCurrentContentStyles(e);this._prevLayoutSnapshot=this._getLayoutSnapshot(n),this._prevContentSnapshot=this._getContentSnapshot(i),this._messageSubscription=t.addListener(e=>{let t=e?.data?.operation;if(t===r._i.APPLICATION_EMAIL_SETTINGS_SET){let t=this._mapLayoutSettings(e.data?.settings),n=this._getLayoutSnapshot(t);n!==this._prevLayoutSnapshot&&(this._prevLayoutSnapshot=n,this._layoutSettingsChanged.fire(t));return}if(t!==r._i.APPLICATION_COMMON_STYLES_UPDATE)return;let n=this._mapCommonStylesToContentStyles(e.data?.settings?.commonStyles??{...r.Zi}),i=this._getContentSnapshot(n);i!==this._prevContentSnapshot&&(this._prevContentSnapshot=i,this._contentStylesChanged.fire(n))})})();try{await this._messageSubscriptionPromise}finally{this._messageSubscriptionPromise=void 0}}}async getEmailLayoutSettings(){let e=await this._editor.container.getInstanceAsync(r.Oa);return await this._waitForEmailSettingsFromIframe(e),this._getCurrentLayoutSettings(e)}async setEmailLayoutSettings(e){let t=await this._editor.container.getInstanceAsync(r.Oa);await this._waitForEmailSettingsFromIframe(t);let n={...o.O(t.getState()),...e};t.dispatch(o.W(n));let i=this._mapLayoutSettings(n);this._prevLayoutSnapshot=this._getLayoutSnapshot(i),this._layoutSettingsChanged.fire(i)}async _waitForEmailSettingsFromIframe(e,t=_){let n=e.getState(),i=o.w(n),a=o.O(n);if(i?.is_inited&&a&&Object.keys(a).length>0&&(a.backgroundColor||a.backgroundImage?.[0]?.value||a.width?.value||a.responsive!==void 0)||i?.is_inited)return;let s=this._editor.container,c=r.ja(s,r.ka.ON_EMAIL_INIT_ID);return new Promise(e=>{let n=!1,r,i=()=>{r&&=(clearTimeout(r),void 0)},a=c(()=>{n||(n=!0,i(),a.dispose(),e())});r=setTimeout(()=>{n||(n=!0,a.dispose(),e())},t)})}async getEmailContentStyles(){let e=await this._editor.container.getInstanceAsync(r.Oa);return this._getCurrentContentStyles(e)}async setEmailContentStyles(e){let t=await this._editor.container.getInstanceAsync(r.Oa),n=o.w(t.getState());if(!n)return;let i=this._parseCommonStyles(n.common_styles);e.text!==void 0&&(i.text={...i.text||{},...e.text}),e.headings!==void 0&&(i.headings={...i.headings||{},...e.headings}),e.links!==void 0&&(i.links={...i.links||{},...e.links}),e.buttons!==void 0&&(i.buttons=v(i.buttons||{},e.buttons,[`border`,`borderRadius`,`padding`],{border:y.border,borderRadius:y.borderRadius,padding:y.padding})),e.block!==void 0&&(i.block=v(i.block||{},e.block,[`padding`],{padding:y.padding})),e.cards!==void 0&&(i.cards=v(i.cards||{},e.cards,[`border`,`borderRadius`],{border:y.border,borderRadius:y.borderRadiusCards})),t.dispatch(o.R({...n,common_styles:JSON.stringify(i)}));let a=this._mapCommonStylesToContentStyles(i);this._prevContentSnapshot=this._getContentSnapshot(a),this._contentStylesChanged.fire(a)}},N={...r.Ma,EmailSettingsApi:M};({...r.Ma});var P={...N};function F(){i.j.addAll(P)}var I=[m,h,g,f,p,a.E,l];async function L(){return(await Promise.resolve().then(()=>e("./static/core/69b8570a.js"))).default}var R=e=>{let t=null,n=!1;return{instance:{},async setOptions(i){if(!t&&!n){t=(await L())(e);let n=await e.getInstanceAsync(r.Sa);Object.assign(n,t.instance||{}),F()}t&&await t.setOptions(i)},dispose(){t?.dispose(),n=!0}}},z=a.k([...I,R]),B=class{_storage=Object.create(null);get(e){let t=this._storage[e];return t&&(!t.expires||t.expires<Date.now())?t.value:``}set(e,t,n){this._storage[e]={value:t,expires:n.expires?n.expires*1e3+Date.now():void 0}}remove(e){delete this._storage[e]}},V=100,H={events:[],container:null,collection:null};function U(e,t){H.container=e,H.collection=t,t.onLifecycle(e=>{H.events.push({...e,timestamp:Date.now()}),H.events.length>V&&(H.events=H.events.slice(-100))}),typeof window<`u`&&(window.__EMAILMAKER_DEVTOOLS__=W())}function W(){return{enabled:!0,plugins(){return H.collection?H.collection.getStatus().map(e=>({...e,hasInit:!0,hasDispose:!0,hasAfterInit:!0})):[]},registry(){if(!H.container)return[];try{return H.container.getInstance(i.M).keys().map(String)}catch{return[]}},events(e=50){return H.events.slice(-e)},clearEvents(){H.events=[]},getPlugin(e){if(H.collection)try{return H.collection.use(e)}catch{return}}}}var G=a.k([z]);async function K(e){let t=new r.no;async function n(){let n=r.Za.createChild();if(e.standaloneKey){n.inject(r.Ta,e.standaloneKey);let i=r.ja(n,r.ka.FILE_PROXY_EVENT_ID);t.addDisposable(i(async({url:e})=>(await fetch(e)).blob(),Number.MIN_VALUE))}n.inject(r.xa,t),n.inject(r.ma,new B),r.aa(n);let i=G(n),a={...i.instance,container:n};if(n.inject(r.Sa,a),await i.setOptions(e),e.devTools)try{let e=n.getInstance(r.wa);e&&U(n,e)}catch{}return r.Aa(n,r.ya).fire(a),a}return n()}async function q(e){let t=new Map;typeof e==`object`&&(e=e.code);let n=await i.a(e,async e=>{await i.g(e.document,e=>i.m.getEscapedText(e)===e?i.y(e):e,t);for(let t of e.document.querySelectorAll(`.em-amp-show-disabled`))t.remove();e.handleRender(async({contentDocument:e,managedNodeController:t})=>{await i.n(e,{mappedTags:{script:`___script`},commit:()=>t.commit()})})},[800]),r=await i.a(e,async e=>{await i.g(e.document,e=>i.m.getEscapedText(e)===e?i.y(e):e,t);for(let t of e.document.querySelectorAll(`.em-amp-show-only`))t.remove();await i.t(e.document,{mappedTags:{script:`___script`}})},[800]);return{code:e,html:r,ampHtml:n}}t.init=K,t.parseAMP=q,t.version=`1.1.5`});
|
package/emailmaker-esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as e,i as t,n,r,t as i}from"./static/esm/27964dfe.js";import{n as a,t as o}from"./static/esm/c1e3467e.js";(function(){var e=window.__emailmaker__=window.__emailmaker__||{};__emailmaker__.publicPath||(__emailmaker__.publicPath=(function(){var e=(function(){if(typeof document>`u`)return`./`;var e=document.getElementsByTagName(`script`),t=document.currentScript||e[e.length-1];return t&&t.src?t.src.substring(0,t.src.lastIndexOf(`/`)+1):`./`})();e||=`./`;try{var t=String(e);if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t)||t.indexOf(`//`)===0)return t;var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return String(e)}})()),__emailmaker__.assetUrl||(__emailmaker__.assetUrl=function(e){function t(e){try{var t=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return t?new URL(String(e||``),t).href:String(e||``)}catch{return String(e||``)}}var n=String(e||``);if(!n)return``;if(/^(?:data:|blob:)/.test(n))return n;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.indexOf(`//`)===0||n.charAt(0)===`/`)return t(n);var r=n.replace(/^\.\/+/,``).replace(/^\/+/,``),i=`static/media`.replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\/+$/,``),a=i&&r.indexOf(i+`/`)!==0?i+`/`+r:r,o=__emailmaker__.publicPath||`./`;try{return new URL(a,o).href}catch{return o.slice(-1)!==`/`&&(o+=`/`),t(o+a)}});var t=e.modules=Object.create(null),n=import(`./runtime/index.js`),r=import(`./ui-kit/index.js`);t.React=n.then(function(e){return e.React}),t.ReactDom=n.then(function(e){return e.ReactDom}),t.ReactDomClient=n.then(function(e){return e.ReactDomClient}),t.ReactJsxRuntime=n.then(function(e){return e.ReactJsxRuntime}),t.ReactJsxDevRuntime=n.then(function(e){return e.ReactJsxDevRuntime}),t.PropTypes=n.then(function(e){return e.PropTypes}),t.ReactRouterDom=n.then(function(e){return e.ReactRouterDom}),t.Antd=n.then(function(e){return e.Antd}),t.AntDesignIcons=n.then(function(e){return e.AntDesignIcons}),t.AntDesignCssinjs=n.then(function(e){return e.AntDesignCssinjs}),t.Classnames=n.then(function(e){return e.Classnames}),t.Dayjs=n.then(function(e){return e.Dayjs}),t.Uuid=n.then(function(e){return e.Uuid}),t.UiKit=r.then(function(e){return e.UiKit===void 0?e:e.UiKit});var i=Promise.all([n,r]).then(function(e){var n=e[0]||Object.create(null),r=Object.create(null);for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);var a=e[1]||Object.create(null);for(var o in r.UiKit=a.UiKit===void 0?a:a.UiKit,r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return r}),a=t,o=i;typeof e.define!=`function`&&(Function(`__amdEnv`,`/**
|
|
2
2
|
* Async AMD Loader (IIFE version for injection)
|
|
3
3
|
*
|
|
4
4
|
* This file is injected at the beginning of iframe entry points.
|
|
@@ -476,7 +476,7 @@ import{i as e,n as t,r as n,t as r}from"./static/esm/53bd1900.js";import{n as i,
|
|
|
476
476
|
__amdEnv.require = require;
|
|
477
477
|
__amdEnv.syncRequire = syncRequire;
|
|
478
478
|
})();
|
|
479
|
-
`)(e),typeof e.require==`function`&&typeof e.require.config==`function`&&e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.
|
|
479
|
+
`)(e),typeof e.require==`function`&&typeof e.require.config==`function`&&e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.7d5d6426.js`}}));var s=typeof e.prefetch==`function`?e.prefetch:void 0;if(e.prefetch=function(){return i.then(function(){if(typeof s==`function`)return s.call(e)})},typeof e.define==`function`){var c=typeof WeakMap<`u`?new WeakMap:null;function t(e){if(!e||typeof e!=`object`&&typeof e!=`function`||e.__esModule)return e;if(c){var t=c.get(e);if(t)return t}var n=Object.create(null);Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});for(var r=Reflect.ownKeys(e),i=0;i<r.length;i++){var a=r[i];if(a!=="__esModule"){var o=Object.getOwnPropertyDescriptor(e,a);o&&Object.defineProperty(n,a,o)}}return Object.prototype.hasOwnProperty.call(n,`default`)||Object.defineProperty(n,"default",{enumerable:!0,value:e,writable:!1}),c&&c.set(e,n),n}e.define(`react`,[],function(){var e=a.React;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.React;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react`,[],function(){var e=a.React;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.React;return t(n)}):t(e)}),e.define(`react-dom`,[],function(){var e=a.ReactDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDom;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-dom`,[],function(){var e=a.ReactDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDom;return t(n)}):t(e)}),e.define(`react-dom/client`,[],function(){var e=a.ReactDomClient;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDomClient;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-dom/client`,[],function(){var e=a.ReactDomClient;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDomClient;return t(n)}):t(e)}),e.define(`react/jsx-runtime`,[],function(){var e=a.ReactJsxRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxRuntime;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react/jsx-runtime`,[],function(){var e=a.ReactJsxRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxRuntime;return t(n)}):t(e)}),e.define(`react/jsx-dev-runtime`,[],function(){var e=a.ReactJsxDevRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxDevRuntime;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react/jsx-dev-runtime`,[],function(){var e=a.ReactJsxDevRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxDevRuntime;return t(n)}):t(e)}),e.define(`prop-types`,[],function(){var e=a.PropTypes;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.PropTypes;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/prop-types`,[],function(){var e=a.PropTypes;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.PropTypes;return t(n)}):t(e)}),e.define(`react-router-dom`,[],function(){var e=a.ReactRouterDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactRouterDom;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-router-dom`,[],function(){var e=a.ReactRouterDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactRouterDom;return t(n)}):t(e)}),e.define(`antd`,[],function(){var e=a.Antd;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Antd;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/antd`,[],function(){var e=a.Antd;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Antd;return t(n)}):t(e)}),e.define(`@ant-design/icons`,[],function(){var e=a.AntDesignIcons;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignIcons;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/@ant-design/icons`,[],function(){var e=a.AntDesignIcons;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignIcons;return t(n)}):t(e)}),e.define(`@ant-design/cssinjs`,[],function(){var e=a.AntDesignCssinjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignCssinjs;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/@ant-design/cssinjs`,[],function(){var e=a.AntDesignCssinjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignCssinjs;return t(n)}):t(e)}),e.define(`classnames`,[],function(){var e=a.Classnames;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Classnames;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/classnames`,[],function(){var e=a.Classnames;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Classnames;return t(n)}):t(e)}),e.define(`dayjs`,[],function(){var e=a.Dayjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Dayjs;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/dayjs`,[],function(){var e=a.Dayjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Dayjs;return t(n)}):t(e)}),e.define(`uuid`,[],function(){var e=a.Uuid;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Uuid;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/uuid`,[],function(){var e=a.Uuid;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Uuid;return t(n)}):t(e)}),e.define(`@emailmaker/ui-kit`,[],function(){var e=a.UiKit;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.UiKit;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/ui-kit`,[],function(){var e=a.UiKit;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.UiKit;return t(n)}):t(e)})}globalThis.__SHARED_RUNTIME_INIT_SENTINEL__=`@shared-runtime:init-complete`})();var s=null,c=`core`;function l(){return typeof window.__emailmaker__?.require==`function`?new Promise((e,t)=>{window.__emailmaker__.require([c],t=>e(t),e=>t(e instanceof Error?e:Error(`[loadEngine] Failed to require core module`)))}):Promise.reject(Error(`[loadEngine] AMD loader is unavailable`))}function u(){return s||=l(),s}var d=null,f=null;async function p(e){typeof e?.prefetch==`function`&&await e.prefetch()}function m(){return d||=u().then(()=>void 0),d}function h(e){return f||=p(e),f}function g(e){return Promise.all([m(),h(e)]).then(()=>void 0)}function _(e){let t=e?.startupPrefetchMode;return t===`eager`||t===`idle`||t===`manual`||t===`off`?t:`eager`}function v(e){Promise.resolve().then(()=>g(e)).catch(()=>{})}function y(e){Promise.resolve().then(()=>h(e)).catch(()=>{})}function b(e){let t=_(e);if(t===`eager`)v(e);else if(t===`idle`){let t=window.requestIdleCallback;typeof t==`function`?t(()=>v(e),{timeout:1500}):setTimeout(()=>v(e),0)}}var x=new WeakMap,S=`data-emailmaker-config-styles`;function C(e){return typeof e==`string`?e.trim():``}function w(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function T(e,t,n){if(!e||typeof document>`u`)return null;let r=C(t),i=x.get(e),a=n||e;if(!r)return i&&(i.remove(),x.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&w(a,i),i;let o=document.createElement(`style`);return o.setAttribute(S,`true`),o.textContent=r,w(a,o),x.set(e,o),o}function E(e){if(!e)return;let t=x.get(e);t&&(t.remove(),x.delete(e))}function D(){return!1}var O=`
|
|
480
480
|
.blocks-app-initial-spinner-wrapper {
|
|
481
481
|
width: 100%;
|
|
482
482
|
height: 100%;
|
|
@@ -505,4 +505,4 @@ import{i as e,n as t,r as n,t as r}from"./static/esm/53bd1900.js";import{n as i,
|
|
|
505
505
|
100% {
|
|
506
506
|
transform: rotate(360deg);
|
|
507
507
|
}
|
|
508
|
-
}`;function
|
|
508
|
+
}`;function k(){return()=>{}}function A(e,t){if(!D()||!e||typeof document>`u`)return k();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=O,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}function j(e){for(;e.endsWith(`/`);)e=e.slice(0,e.length-1);return/\/wp-json$/i.test(e)?e:`${e}/wp-json`}j(`https://app.emailmaker.ru/api/`),t(),t(),t(),t();var M;(function(e){let t=`https://racs.emcdn.ru/v3`;function n(e,n){let r={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(n)};return fetch(`${t}?resource=${e}&dataset=${document.location.hostname}`,r)}e.post=n;async function r(e,n=0){let r={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:`{"filter":{},"limit":${n}}`};return await(await fetch(`${t}/get?resource=${e}&dataset=${document.location.hostname}`,r)).json()}e.getAll=r})(M||={});var N=new Map,P=new WeakMap;function F(e){return j(String(e||``).trim()||`https://app.emailmaker.ru/api/`)}async function I(e){if(!e.getAuthToken)return;let t=await e.getAuthToken(e.user,e.project,void 0);return t?`Bearer ${t}`:void 0}function L(e){return async({baseUrl:t})=>{let n=F(t);if(!n)throw Error(`[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL`);let r=new Headers({Accept:`application/json`,"Content-Type":`application/x-www-form-urlencoded;charset=UTF-8`}),i=await I(e);i&&r.set(`authorization`,i);let a=await fetch(`${n}/app/v1/app_init`,{method:`POST`,headers:r,body:new URLSearchParams,credentials:`same-origin`});if(!a.ok)throw Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);return a.json()}}function R(e){return JSON.stringify({baseUrl:F(e.baseUrl)||``,project:e.project??``,userId:e.user?.id??``})}function z(e){return async t=>{let n=R(t),r=N.get(n);if(r)return r;let i=Promise.resolve(e(t)).catch(e=>{throw N.delete(n),e});return N.set(n,i),i}}function B(e){if(e.standaloneKey)return e;let t=e.appInit||L(e),n=P.get(t);return n||(n=z(t),P.set(t,n)),Promise.resolve(n({baseUrl:e.baseUrl,user:e.user,project:e.project,prevApp:void 0})).catch(e=>{}),{...e,appInit:n}}var V=new WeakMap;function H(e){let t=null;return async(n,r,i)=>(t||=Promise.resolve(e(n,r,i)).finally(()=>{t=null}),t)}function U(e){if(e.standaloneKey)return e;let t=e.getAuthToken;if(!t)return e;let n=V.get(t);return n||(n=H(t),V.set(t,n)),Promise.resolve(n(e.user,e.project,void 0)).catch(e=>{}),{...e,getAuthToken:n}}function W(e,t){return{...e,element:t}}function G(){return()=>{}}function K(e){let t=e.element;return!t||typeof t==`string`||typeof document>`u`?G():(T(t,e.config?.styles,t),()=>{E(t)})}function q(e){if(!D()||e.initialSpinner===!1||typeof document>`u`)return{options:e,cleanup:G()};let t=e.element;if(!t||typeof t==`string`)return{options:e,cleanup:G()};t.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=A(t,`data-emailmaker`),r=e.handleChunkLoaded;return{options:{...e,handleChunkLoaded:()=>{n(),r?.()}},cleanup:n}}function J(e){return e?.length?e.some(e=>Array.isArray(e)?!1:!!(e&&typeof e==`object`&&`url`in e)):!1}var Y=`1.1.5`;async function X(e){await g(window.__emailmaker__===void 0?void 0:window.__emailmaker__)}async function Z(t){let n=new e,r=await a(t.element,n);n.dispose();let i=B(U(W(t,r)));if(r){let e=o.get(r);if(e)try{let t=await e;if(t.getElement()===r)return t.reset(i)}catch{o.get(r)===e&&o.delete(r)}}let s=K(i),c=q(i),l=c.options;await m();let d=window.__emailmaker__===void 0?void 0:window.__emailmaker__;J(l.plugins)?await h(d):y(d);let f=u().then(e=>e.init(l));r&&o.set(r,f);try{let e=await f;return r&&o.set(r,e),e}catch(e){throw s(),c.cleanup(),r&&o.get(r)===f&&o.delete(r),e}}async function Q(e){return(await u()).parseAMP(e)}typeof window<`u`&&b(window.__emailmaker__===void 0?void 0:window.__emailmaker__);export{n as errors,i as helpers,Z as init,Q as parseAMP,r as pluginRegistry,X as preload,Y as version};
|
package/emailmaker.d.ts
CHANGED
|
@@ -1721,14 +1721,14 @@ export declare namespace ExportedApi {
|
|
|
1721
1721
|
};
|
|
1722
1722
|
}
|
|
1723
1723
|
export type AppInitCallback = (params: {
|
|
1724
|
-
baseUrl?: string;
|
|
1724
|
+
/** API origin from init options (without `/wp-json`); SDK normalizes before HTTP. */baseUrl?: string;
|
|
1725
1725
|
user?: User;
|
|
1726
1726
|
project?: string | number;
|
|
1727
1727
|
prevApp?: AppInitResult;
|
|
1728
1728
|
}) => MayBePromise<AppInitResult>;
|
|
1729
1729
|
namespace AppInitMixin {
|
|
1730
1730
|
interface Options {
|
|
1731
|
-
/**
|
|
1731
|
+
/** API origin (e.g. `https://api.emailmaker.ru` or `https://app.emailmaker.ru/api`), without `/wp-json`. */
|
|
1732
1732
|
baseUrl?: string;
|
|
1733
1733
|
/** optional app init callback override */
|
|
1734
1734
|
appInit?: AppInitCallback;
|
package/emailmaker.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
})(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : this, function() {
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var e=window.__emailmaker__||(window.__emailmaker__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=`./`,s={};function c(e,t){var n=Error(`[AMD] Failed to load module "`+e+`"`+(t?`: `+t.message:``));return n.moduleId=e,n.cause=t,n}function l(e,t,n){var r=Error(`[AMD] Failed to resolve dependency "`+t+`" for module "`+e+`"`+(n?`: `+n.message:``));return r.moduleId=e,r.dependencyId=t,r.cause=n,r}function u(e){for(var t=String(e||``).split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];if(!(!i||i===`.`)){if(i===`..`){n.length>0&&n.pop();continue}n.push(i)}}return n.join(`/`)}function d(e){var t=String(e||``).replace(/\\/g,`/`),n=String(o||`./`).replace(/\\/g,`/`);return n=n.replace(/^\.\/+/,``),n=n.replace(/^\/+/,``),n&&n.slice(-1)!==`/`&&(n+=`/`),n&&t.indexOf(n)===0&&(t=t.slice(n.length)),t.indexOf(`./`)===0&&(t=t.slice(2)),t}function f(e,t){var n=String(e||``);if(!n)return n;if(!(n.indexOf(`./`)===0||n.indexOf(`../`)===0))return d(u(n));var r=u(t||``),i=r?r.split(`/`):[];i.length>0&&i.pop();for(var a=n.split(`/`),o=0;o<a.length;o++){var s=a[o];if(!(!s||s===`.`)){if(s===`..`){i.length>0&&i.pop();continue}i.push(s)}}return d(i.join(`/`))}function p(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function m(e){var t=String(e||``);if(!t||p(t))return t;try{var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return t}}function h(){var t=String(o||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),p(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,m(e.publicPath)).href}catch{}return m(t)}function g(e,t){var n=f(e,t),r=h(),i=Object.prototype.hasOwnProperty.call(s,n)?String(s[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function _(){if(typeof document>`u`)return``;var e=document.currentScript;if(e){var t=e.getAttribute(`data-amd-module-id`);if(t)return t}return``}function v(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=_()):typeof e==`function`?(r=e,n=[],e=_()):typeof n==`function`&&(r=n,n=[]),!e)throw Error(`[AMD] Anonymous define() could not be associated with a module id`);e in t||(t[e]={deps:n||[],factory:r})}v.amd={async:!0};function y(){return function(){}}function b(e,t){return{id:e,exports:t,uri:g(e)}}function x(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return C(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return C(e,r)}function S(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=f(e,o);if(s in a)throw a[s];if(s in n)return n[s];if(s in r||s in i)throw c(s,Error(`Module is still loading asynchronously`));if(!(s in t))throw c(s,Error(`Module is not available for syncRequire`));return T(s)}function C(e,i){var o=f(e,i);return o in a?Promise.reject(a[o]):o in n?Promise.resolve(n[o]):o in r?r[o]:o in t?(r[o]=w(o),r[o]):(r[o]=D(o).then(function(){if(!(o in t)){var e=c(o,Error(`Module not defined after script load`));throw a[o]=e,e}return w(o)}).catch(function(e){delete r[o];var t=c(o,e);throw a[o]=t,t}),r[o])}function w(e){var i=t[e],o=E(e),s=y(),c=b(e,s);return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?c:C(t,e).catch(function(n){throw l(e,t,n)})})).then(function(t){var a=i.factory.apply(null,t);return a&&typeof a.then==`function`?a.then(function(t){return n[e]=t===void 0?c.exports:t,delete r[e],n[e]}):(n[e]=a===void 0?c.exports:a,delete r[e],n[e])}).catch(function(t){throw delete r[e],a[e]=t,t})}function T(e){var r=t[e],i=E(e),o=y(),s=b(e,o);try{var u=r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return S(t,e)}catch(n){throw l(e,t,n)}}),d=r.factory.apply(null,u);if(d&&typeof d.then==`function`)throw c(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=d===void 0?s.exports:d,n[e]}catch(t){throw a[e]=t,t}}function E(e){var r=function(r,i,a){if(Array.isArray(r))return x(r,i,a,e);var o=f(r,e);return o in n?n[o]:o in t?S(r,e):C(r,e)};return r.resolve=function(t){return f(t,e)},r.toUrl=function(t){return g(t,e)},r.sync=function(t){return S(t,e)},r}function D(e){if(e in i)return i[e];var t=g(e);return document.querySelector(`script[src="`+t+`"]`)?(i[e]=Promise.resolve(),i[e]):(i[e]=new Promise(function(n,r){var a=document.createElement(`script`);a.src=t,a.setAttribute(`data-amd-module-id`,e),a.async=!0,a.onload=function(){n()},a.onerror=function(){delete i[e],r(Error(`Failed to load script: `+t))},document.head.appendChild(a)}),i[e])}x.config=function(e){if(e.baseUrl&&(o=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(s[t]=e.paths[t])},x.modules=t,x.resolved=n,x.errors=a,x.toUrl=g,x.sync=S,e.define=v,e.require=x,e.syncRequire=S})(),e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.
|
|
15
|
+
var e=window.__emailmaker__||(window.__emailmaker__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=`./`,s={};function c(e,t){var n=Error(`[AMD] Failed to load module "`+e+`"`+(t?`: `+t.message:``));return n.moduleId=e,n.cause=t,n}function l(e,t,n){var r=Error(`[AMD] Failed to resolve dependency "`+t+`" for module "`+e+`"`+(n?`: `+n.message:``));return r.moduleId=e,r.dependencyId=t,r.cause=n,r}function u(e){for(var t=String(e||``).split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];if(!(!i||i===`.`)){if(i===`..`){n.length>0&&n.pop();continue}n.push(i)}}return n.join(`/`)}function d(e){var t=String(e||``).replace(/\\/g,`/`),n=String(o||`./`).replace(/\\/g,`/`);return n=n.replace(/^\.\/+/,``),n=n.replace(/^\/+/,``),n&&n.slice(-1)!==`/`&&(n+=`/`),n&&t.indexOf(n)===0&&(t=t.slice(n.length)),t.indexOf(`./`)===0&&(t=t.slice(2)),t}function f(e,t){var n=String(e||``);if(!n)return n;if(!(n.indexOf(`./`)===0||n.indexOf(`../`)===0))return d(u(n));var r=u(t||``),i=r?r.split(`/`):[];i.length>0&&i.pop();for(var a=n.split(`/`),o=0;o<a.length;o++){var s=a[o];if(!(!s||s===`.`)){if(s===`..`){i.length>0&&i.pop();continue}i.push(s)}}return d(i.join(`/`))}function p(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function m(e){var t=String(e||``);if(!t||p(t))return t;try{var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return t}}function h(){var t=String(o||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),p(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,m(e.publicPath)).href}catch{}return m(t)}function g(e,t){var n=f(e,t),r=h(),i=Object.prototype.hasOwnProperty.call(s,n)?String(s[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function _(){if(typeof document>`u`)return``;var e=document.currentScript;if(e){var t=e.getAttribute(`data-amd-module-id`);if(t)return t}return``}function v(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=_()):typeof e==`function`?(r=e,n=[],e=_()):typeof n==`function`&&(r=n,n=[]),!e)throw Error(`[AMD] Anonymous define() could not be associated with a module id`);e in t||(t[e]={deps:n||[],factory:r})}v.amd={async:!0};function y(){return function(){}}function b(e,t){return{id:e,exports:t,uri:g(e)}}function x(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return C(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return C(e,r)}function S(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=f(e,o);if(s in a)throw a[s];if(s in n)return n[s];if(s in r||s in i)throw c(s,Error(`Module is still loading asynchronously`));if(!(s in t))throw c(s,Error(`Module is not available for syncRequire`));return T(s)}function C(e,i){var o=f(e,i);return o in a?Promise.reject(a[o]):o in n?Promise.resolve(n[o]):o in r?r[o]:o in t?(r[o]=w(o),r[o]):(r[o]=D(o).then(function(){if(!(o in t)){var e=c(o,Error(`Module not defined after script load`));throw a[o]=e,e}return w(o)}).catch(function(e){delete r[o];var t=c(o,e);throw a[o]=t,t}),r[o])}function w(e){var i=t[e],o=E(e),s=y(),c=b(e,s);return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?c:C(t,e).catch(function(n){throw l(e,t,n)})})).then(function(t){var a=i.factory.apply(null,t);return a&&typeof a.then==`function`?a.then(function(t){return n[e]=t===void 0?c.exports:t,delete r[e],n[e]}):(n[e]=a===void 0?c.exports:a,delete r[e],n[e])}).catch(function(t){throw delete r[e],a[e]=t,t})}function T(e){var r=t[e],i=E(e),o=y(),s=b(e,o);try{var u=r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return S(t,e)}catch(n){throw l(e,t,n)}}),d=r.factory.apply(null,u);if(d&&typeof d.then==`function`)throw c(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=d===void 0?s.exports:d,n[e]}catch(t){throw a[e]=t,t}}function E(e){var r=function(r,i,a){if(Array.isArray(r))return x(r,i,a,e);var o=f(r,e);return o in n?n[o]:o in t?S(r,e):C(r,e)};return r.resolve=function(t){return f(t,e)},r.toUrl=function(t){return g(t,e)},r.sync=function(t){return S(t,e)},r}function D(e){if(e in i)return i[e];var t=g(e);return document.querySelector(`script[src="`+t+`"]`)?(i[e]=Promise.resolve(),i[e]):(i[e]=new Promise(function(n,r){var a=document.createElement(`script`);a.src=t,a.setAttribute(`data-amd-module-id`,e),a.async=!0,a.onload=function(){n()},a.onerror=function(){delete i[e],r(Error(`Failed to load script: `+t))},document.head.appendChild(a)}),i[e])}x.config=function(e){if(e.baseUrl&&(o=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(s[t]=e.paths[t])},x.modules=t,x.resolved=n,x.errors=a,x.toUrl=g,x.sync=S,e.define=v,e.require=x,e.syncRequire=S})(),e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.7d5d6426.js`}});
|
|
16
16
|
|
|
17
17
|
// PublicPath (script detection via document.currentScript)
|
|
18
18
|
if (!__emailmaker__.publicPath) {
|
|
@@ -711,7 +711,7 @@ if (typeof ns.define === 'function') {
|
|
|
711
711
|
})();
|
|
712
712
|
|
|
713
713
|
|
|
714
|
-
__emailmaker__.define(`emailmaker.js`,[`require`,`exports`,`module`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=Object.defineProperty,i=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n},a=class e{_inner;_isDisposed=!1;constructor(e=[]){this._inner=e}addDisposable(t){return this._inner.push(t),t instanceof e&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(e){this.addDisposable({dispose:e})}removeDisposable(e){let t=this._inner.indexOf(e);t>=0&&this._inner.splice(t,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(let e of[...this._inner])e.dispose()}}};function o(e){return`service_container_${e}`}var s=class e extends a{_parent;_injectCallbacks=[];_injections=Object.create(null);_runCallbacks(e){this._injectCallbacks.forEach(t=>t(e))}constructor(e=null){super(),this._parent=e,e&&this.addDisposable(e.onInject(e=>this._runCallbacks(e)))}onInject=e=>(this._injectCallbacks.push(e),{dispose:()=>{let t=this._injectCallbacks.indexOf(e);t>=0&&this._injectCallbacks.splice(t,1)}});inject(e,t){this._injections[e]=()=>t,this._runCallbacks(e)}injectFactory(e,t,n){let r=this._injections[e],i=typeof r==`function`?r():r,a=this._injections[e]=()=>(i=t(this,i),i);n&&a(),this._runCallbacks(e)}_find(e,t=!0){return this._injections[e]||t&&this._parent?._find(e)}_onInject(e,t,n=new a){return n.addDisposable(this.onInject(r=>{e===r&&(n.dispose(),t(this.getInstance(r)))})),this._parent&&n.addDisposable(this._parent._onInject(e,t,n)),this.addDisposable(n),n}getInstance(e,t=!0){let n=this._find(e,t);if(typeof n==`function`)return n()}getOrCreateInstance(e,t){let n=this._find(e);if(typeof n==`function`)return n();let r=t(this);return this.inject(e,r),r}getInstanceAsync(e){let t=this._find(e);return typeof t==`function`?Promise.resolve(t()):new Promise(t=>this._onInject(e,()=>t(this.getInstance(e))))}addService(e,t){let n=o(e);this.injectFactory(n,(e,n=[])=>n.indexOf(t)<0?[...n,t]:n);let r=new a;return r.addDispose(()=>{this.injectFactory(n,(e,n=[])=>n.filter(e=>e!==t))}),r}addServiceFactory(e,t,n){let r=o(e),i;this.injectFactory(r,(e,n=[])=>(i=t(e,i),i===void 0?n:n.indexOf(i)<0?[...n,i]:n),n);let s=new a;return s.addDispose(()=>{this.injectFactory(r,(e,t=[])=>i===void 0?t:t.filter(e=>e!==i))}),s}getServices(e){let t=o(e);return[...this.getInstance(t,!1)||[],...this._parent?.getServices(e)||[]]}createChild(){return new e(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{let n=this._parent?.getOrCreateIsolatedContainer(t);return new e(n)})}dispose(){this._injections=Object.create(null)}};function c(e){return e.startsWith(`__`)?e:`__${e}__`}function l(e){if(typeof globalThis>`u`)throw Error(`[di] globalThis is required for namespace container access.`);let t=c(e),n=globalThis;return n[t]??={}}function u(e){return typeof e==`object`&&!!e&&typeof e.inject==`function`&&typeof e.getInstance==`function`}function ee(e){return c(e||`emailmaker`)}function d(e){let t=l(ee(e));if(u(t.container))return t.container;let n=new s(null);return t.container=n,n}function f(e){return d(e)}function p(){return`umd`}function te(e){if(typeof globalThis>`u`)return;let t=p(),n=globalThis[e]??{};globalThis[e]=n;let r=n.__diagnostics??={},i=r.diModuleEval??={evalCount:0,records:[],duplicateWarned:!1};i.records.push({buildSource:t,timestamp:Date.now(),stack:Error().stack}),i.evalCount+=1,!(i.evalCount<=1||i.duplicateWarned)&&(i.duplicateWarned=!0,i.evalCount,i.records)}function ne(){return`__emailmaker__`}function m(e,t){if(te(t),typeof globalThis>`u`)return e;let n=p(),r=globalThis,i=r[t]=r[t]||{},a=i.__diagnostics=i.__diagnostics||{},o=a.dependencyResolver=a.dependencyResolver||{entries:[],warnings:[]},s={container:e,source:`packages/runtime-core/di/index.ts`,buildSource:n,timestamp:Date.now(),stack:Error().stack};if(o.entries.push(s),o.entries.length>1){let e=o.entries[0];if(o.entries.some(t=>t.container!==e.container)&&!o.duplicateWarningShown){o.duplicateWarningShown=!0;let e={message:`[di] Multiple DependencyResolver instances detected on namespace`,namespaceKey:t,buildSource:n,entries:o.entries};o.warnings.push(e)}}return e}var h;function g(){if(h)return h;let e=ne();return h=m(d(e),e),h}new Proxy({},{get(e,t,n){let r=g(),i=Reflect.get(r,t,n);return typeof i==`function`?i.bind(r):i}});var _=class e extends Error{code;httpStatus;details;constructor(t,n,r,i){super(t),this.name=`FileManagerApiError`,this.code=n,this.httpStatus=r,this.details=i;let a=Error.captureStackTrace;a&&a(this,e)}};function v(e,t=`BackendError`){switch(e){case 400:return`ValidationError`;case 401:return`AuthenticationFailed`;case 403:return`AuthorizationFailed`;case 404:return`FileNotFound`;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 y=class{_plugins=new Map;_listeners=new Map;_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){let n=this._plugins.get(e);if(n?.overrides)for(let e of n.overrides)t=e(t)||t;return t}_notifyListeners(e,t){let n=this._listeners.get(e);if(!n||n.length===0)return;for(let e of n)try{e.callback(t)}catch{}let r=n.filter(e=>!e.once);r.length>0?this._listeners.set(e,r):this._listeners.delete(e)}get(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor)}async getAsync(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor);if(t?.loading){let n=await t.loading;return this._applyOverrides(e,n)}if(t?.factory){let n=Promise.resolve(t.factory()).then(n=>(t.ctor=n,t.loading=void 0,this._notifyListeners(e,n),n));t.loading=n;let r=await n;return this._applyOverrides(e,r)}return new Promise(t=>{this.on(e,n=>t(this._applyOverrides(e,n)))})}add(e,t){let n=this._getOrCreateEntry(e);n.ctor=t,this._notifyListeners(e,t)}addAll(e){for(let t of Object.keys(e)){let n=e[t];n!==void 0&&this.add(t,n)}}addAsync(e,t){let n=this._getOrCreateEntry(e);return n.factory=t,{dispose:()=>{n.ctor||(n.factory=void 0)}}}has(e){let t=this._plugins.get(e);return!!(t?.ctor||t?.factory)}isLoaded(e){return!!this._plugins.get(e)?.ctor}override(e,t){let n=this._getOrCreateEntry(e);return n.overrides.push(t),{dispose:()=>{let e=n.overrides.indexOf(t);e>=0&&n.overrides.splice(e,1)}}}on(e,t){let n=this.get(e);n&&t(n);let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!1};return r.push(i),{dispose:()=>this._removeListener(e,t)}}once(e,t){let n=this.get(e);if(n)return t(n),{dispose:()=>{}};let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!0};return r.push(i),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){let n=this._listeners.get(e);if(n){let r=n.findIndex(e=>e.callback===t);r>=0&&n.splice(r,1),n.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){let e=this;return{add(t,n){e.add(t,n)}}}},b=class{resolveRegistry;constructor(e){this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},x=null,S=`core`;function C(){return typeof __emailmaker__?.require==`function`?new Promise((e,t)=>{__emailmaker__.require([S],t=>e(t),e=>t(e instanceof Error?e:Error(`[loadEngine] Failed to require core module`)))}):Promise.reject(Error(`[loadEngine] AMD loader is unavailable`))}function w(){return x||=C(),x}var T=null,E=null;async function re(e){typeof e?.prefetch==`function`&&await e.prefetch()}function D(){return T||=w().then(()=>{}),T}function O(e){return E||=re(e),E}function k(e){return Promise.all([D(),O(e)]).then(()=>{})}function A(e){let t=e?.startupPrefetchMode;return t===`eager`||t===`idle`||t===`manual`||t===`off`?t:`eager`}function j(e){Promise.resolve().then(()=>k(e)).catch(()=>{})}function M(e){Promise.resolve().then(()=>O(e)).catch(()=>{})}function N(e){let t=A(e);if(t===`eager`)j(e);else if(t===`idle`){let t=window.requestIdleCallback;typeof t==`function`?t(()=>j(e),{timeout:1500}):setTimeout(()=>j(e),0)}}var P=`PluginRegistry`;function F(e=f()){return e.getOrCreateInstance(P,()=>new y)}var I=new b(()=>F()),L=new WeakMap,R=`data-emailmaker-config-styles`;function z(e){return typeof e==`string`?e.trim():``}function B(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function V(e,t,n){if(!e||typeof document>`u`)return null;let r=z(t),i=L.get(e),a=n||e;if(!r)return i&&(i.remove(),L.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&B(a,i),i;let o=document.createElement(`style`);return o.setAttribute(R,`true`),o.textContent=r,B(a,o),L.set(e,o),o}function H(e){if(!e)return;let t=L.get(e);t&&(t.remove(),L.delete(e))}function U(e,t){if(typeof e<`u`)if(typeof e==`string`){if(e=document.querySelector(e),e)return e;let n=t.addDisposable(new a);return new Promise((t,r)=>{let i=new MutationObserver(()=>{e=document.querySelector(e),e&&(n.dispose(),t(e))});i.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),n.addDisposable({dispose:()=>i.disconnect()})})}else return e;else return e}var W=new Map;function G(){return!1}var K=`
|
|
714
|
+
__emailmaker__.define(`emailmaker.js`,[`require`,`exports`,`module`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=Object.defineProperty,i=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),a=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n},o=class e{_inner;_isDisposed=!1;constructor(e=[]){this._inner=e}addDisposable(t){return this._inner.push(t),t instanceof e&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(e){this.addDisposable({dispose:e})}removeDisposable(e){let t=this._inner.indexOf(e);t>=0&&this._inner.splice(t,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(let e of[...this._inner])e.dispose()}}};function s(e){return`service_container_${e}`}var c=class e extends o{_parent;_injectCallbacks=[];_injections=Object.create(null);_runCallbacks(e){this._injectCallbacks.forEach(t=>t(e))}constructor(e=null){super(),this._parent=e,e&&this.addDisposable(e.onInject(e=>this._runCallbacks(e)))}onInject=e=>(this._injectCallbacks.push(e),{dispose:()=>{let t=this._injectCallbacks.indexOf(e);t>=0&&this._injectCallbacks.splice(t,1)}});inject(e,t){this._injections[e]=()=>t,this._runCallbacks(e)}injectFactory(e,t,n){let r=this._injections[e],i=typeof r==`function`?r():r,a=this._injections[e]=()=>(i=t(this,i),i);n&&a(),this._runCallbacks(e)}_find(e,t=!0){return this._injections[e]||t&&this._parent?._find(e)}_onInject(e,t,n=new o){return n.addDisposable(this.onInject(r=>{e===r&&(n.dispose(),t(this.getInstance(r)))})),this._parent&&n.addDisposable(this._parent._onInject(e,t,n)),this.addDisposable(n),n}getInstance(e,t=!0){let n=this._find(e,t);if(typeof n==`function`)return n()}getOrCreateInstance(e,t){let n=this._find(e);if(typeof n==`function`)return n();let r=t(this);return this.inject(e,r),r}getInstanceAsync(e){let t=this._find(e);return typeof t==`function`?Promise.resolve(t()):new Promise(t=>this._onInject(e,()=>t(this.getInstance(e))))}addService(e,t){let n=s(e);this.injectFactory(n,(e,n=[])=>n.indexOf(t)<0?[...n,t]:n);let r=new o;return r.addDispose(()=>{this.injectFactory(n,(e,n=[])=>n.filter(e=>e!==t))}),r}addServiceFactory(e,t,n){let r=s(e),i;this.injectFactory(r,(e,n=[])=>(i=t(e,i),i===void 0?n:n.indexOf(i)<0?[...n,i]:n),n);let a=new o;return a.addDispose(()=>{this.injectFactory(r,(e,t=[])=>i===void 0?t:t.filter(e=>e!==i))}),a}getServices(e){let t=s(e);return[...this.getInstance(t,!1)||[],...this._parent?.getServices(e)||[]]}createChild(){return new e(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{let n=this._parent?.getOrCreateIsolatedContainer(t);return new e(n)})}dispose(){this._injections=Object.create(null)}};function l(e){return e.startsWith(`__`)?e:`__${e}__`}function u(e){if(typeof globalThis>`u`)throw Error(`[di] globalThis is required for namespace container access.`);let t=l(e),n=globalThis;return n[t]??={}}function ee(e){return typeof e==`object`&&!!e&&typeof e.inject==`function`&&typeof e.getInstance==`function`}function te(e){return l(e||`emailmaker`)}function d(e){let t=u(te(e));if(ee(t.container))return t.container;let n=new c(null);return t.container=n,n}function ne(e){return d(e)}function re(){let e=new Date().getTime(),t=typeof performance<`u`&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(n){let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n===`x`?r:r&3|8).toString(16)})}function ie(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():re()}function f(e=ie()){return e}function p(){return`umd`}function m(e){if(typeof globalThis>`u`)return;let t=p(),n=globalThis[e]??{};globalThis[e]=n;let r=n.__diagnostics??={},i=r.diModuleEval??={evalCount:0,records:[],duplicateWarned:!1};i.records.push({buildSource:t,timestamp:Date.now(),stack:Error().stack}),i.evalCount+=1,!(i.evalCount<=1||i.duplicateWarned)&&(i.duplicateWarned=!0,i.evalCount,i.records)}function h(){return`__emailmaker__`}function g(e,t){if(m(t),typeof globalThis>`u`)return e;let n=p(),r=globalThis,i=r[t]=r[t]||{},a=i.__diagnostics=i.__diagnostics||{},o=a.dependencyResolver=a.dependencyResolver||{entries:[],warnings:[]},s={container:e,source:`packages/runtime-core/di/index.ts`,buildSource:n,timestamp:Date.now(),stack:Error().stack};if(o.entries.push(s),o.entries.length>1){let e=o.entries[0];if(o.entries.some(t=>t.container!==e.container)&&!o.duplicateWarningShown){o.duplicateWarningShown=!0;let e={message:`[di] Multiple DependencyResolver instances detected on namespace`,namespaceKey:t,buildSource:n,entries:o.entries};o.warnings.push(e)}}return e}var _;function v(){if(_)return _;let e=h();return _=g(d(e),e),_}new Proxy({},{get(e,t,n){let r=v(),i=Reflect.get(r,t,n);return typeof i==`function`?i.bind(r):i}});var y=class e extends Error{code;httpStatus;details;constructor(t,n,r,i){super(t),this.name=`FileManagerApiError`,this.code=n,this.httpStatus=r,this.details=i;let a=Error.captureStackTrace;a&&a(this,e)}};function b(e,t=`BackendError`){switch(e){case 400:return`ValidationError`;case 401:return`AuthenticationFailed`;case 403:return`AuthorizationFailed`;case 404:return`FileNotFound`;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 ae=class{_plugins=new Map;_listeners=new Map;_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){let n=this._plugins.get(e);if(n?.overrides)for(let e of n.overrides)t=e(t)||t;return t}_notifyListeners(e,t){let n=this._listeners.get(e);if(!n||n.length===0)return;for(let e of n)try{e.callback(t)}catch{}let r=n.filter(e=>!e.once);r.length>0?this._listeners.set(e,r):this._listeners.delete(e)}get(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor)}async getAsync(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor);if(t?.loading){let n=await t.loading;return this._applyOverrides(e,n)}if(t?.factory){let n=Promise.resolve(t.factory()).then(n=>(t.ctor=n,t.loading=void 0,this._notifyListeners(e,n),n));t.loading=n;let r=await n;return this._applyOverrides(e,r)}return new Promise(t=>{this.on(e,n=>t(this._applyOverrides(e,n)))})}add(e,t){let n=this._getOrCreateEntry(e);n.ctor=t,this._notifyListeners(e,t)}addAll(e){for(let t of Object.keys(e)){let n=e[t];n!==void 0&&this.add(t,n)}}addAsync(e,t){let n=this._getOrCreateEntry(e);return n.factory=t,{dispose:()=>{n.ctor||(n.factory=void 0)}}}has(e){let t=this._plugins.get(e);return!!(t?.ctor||t?.factory)}isLoaded(e){return!!this._plugins.get(e)?.ctor}override(e,t){let n=this._getOrCreateEntry(e);return n.overrides.push(t),{dispose:()=>{let e=n.overrides.indexOf(t);e>=0&&n.overrides.splice(e,1)}}}on(e,t){let n=this.get(e);n&&t(n);let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!1};return r.push(i),{dispose:()=>this._removeListener(e,t)}}once(e,t){let n=this.get(e);if(n)return t(n),{dispose:()=>{}};let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!0};return r.push(i),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){let n=this._listeners.get(e);if(n){let r=n.findIndex(e=>e.callback===t);r>=0&&n.splice(r,1),n.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){let e=this;return{add(t,n){e.add(t,n)}}}},oe=class{resolveRegistry;constructor(e){this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},x=null,se=`core`;function ce(){return typeof __emailmaker__?.require==`function`?new Promise((e,t)=>{__emailmaker__.require([se],t=>e(t),e=>t(e instanceof Error?e:Error(`[loadEngine] Failed to require core module`)))}):Promise.reject(Error(`[loadEngine] AMD loader is unavailable`))}function S(){return x||=ce(),x}var C=null,w=null;async function le(e){typeof e?.prefetch==`function`&&await e.prefetch()}function T(){return C||=S().then(()=>{}),C}function E(e){return w||=le(e),w}function D(e){return Promise.all([T(),E(e)]).then(()=>{})}function O(e){let t=e?.startupPrefetchMode;return t===`eager`||t===`idle`||t===`manual`||t===`off`?t:`eager`}function k(e){Promise.resolve().then(()=>D(e)).catch(()=>{})}function A(e){Promise.resolve().then(()=>E(e)).catch(()=>{})}function j(e){let t=O(e);if(t===`eager`)k(e);else if(t===`idle`){let t=window.requestIdleCallback;typeof t==`function`?t(()=>k(e),{timeout:1500}):setTimeout(()=>k(e),0)}}var M=`PluginRegistry`;function N(e=ne()){return e.getOrCreateInstance(M,()=>new ae)}var P=new oe(()=>N()),F=new WeakMap,I=`data-emailmaker-config-styles`;function L(e){return typeof e==`string`?e.trim():``}function R(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function z(e,t,n){if(!e||typeof document>`u`)return null;let r=L(t),i=F.get(e),a=n||e;if(!r)return i&&(i.remove(),F.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&R(a,i),i;let o=document.createElement(`style`);return o.setAttribute(I,`true`),o.textContent=r,R(a,o),F.set(e,o),o}function B(e){if(!e)return;let t=F.get(e);t&&(t.remove(),F.delete(e))}function V(e,t){if(typeof e<`u`)if(typeof e==`string`){if(e=document.querySelector(e),e)return e;let n=t.addDisposable(new o);return new Promise((t,r)=>{let i=new MutationObserver(()=>{e=document.querySelector(e),e&&(n.dispose(),t(e))});i.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),n.addDisposable({dispose:()=>i.disconnect()})})}else return e;else return e}var H=new Map;function U(){return!1}var W=`
|
|
715
715
|
.blocks-app-initial-spinner-wrapper {
|
|
716
716
|
width: 100%;
|
|
717
717
|
height: 100%;
|
|
@@ -740,7 +740,7 @@ __emailmaker__.define(`emailmaker.js`,[`require`,`exports`,`module`],function(e,
|
|
|
740
740
|
100% {
|
|
741
741
|
transform: rotate(360deg);
|
|
742
742
|
}
|
|
743
|
-
}`;function
|
|
743
|
+
}`;function ue(){return()=>{}}function de(e,t){if(!U()||!e||typeof document>`u`)return ue();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=W,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}function G(e){return f(e)}G(`HANDLE_ATOM_INSERT`),G(`SETTINGS_PANEL_EVENT`),G(`MODAL_SHOW_EVENT`),G(`MODAL_CLOSE_EVENT`),G(`MODAL_UPDATE_EVENT`);var fe=i((e=>{var t={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n=Object.assign,r={};function i(e,n,i){this.props=e,this.context=n,this.refs=r,this.updater=i||t}i.prototype.isReactComponent={},i.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function a(){}a.prototype=i.prototype;function o(e,n,i){this.props=e,this.context=n,this.refs=r,this.updater=i||t}var s=o.prototype=new a;s.constructor=o,n(s,i.prototype),s.isPureReactComponent=!0,Array.isArray}));i(((e,t)=>{t.exports=fe()}))();function K(e){return f(e)}var pe;(function(e){e.BEFORE_SAVE_EMAIL=K(),e.ON_SAVEBUTTON_CLICK_ID=K(),e.ON_NEXTBUTTON_CLICK_ID=K(),e.ON_PREVIOUSBUTTON_CLICK_ID=K(),e.ON_MODEL_CHANGE=K(),e.WILL_EMAIL_INIT_ID=K(),e.ON_EMAIL_INIT_ID=K(),e.ON_BLOCK_INIT_ID=K(),e.ON_CONTENT_CHANGED_ID=K(),e.ON_PREHEADER_CHANGED_ID=K(),e.ON_SUBJECT_CHANGED_ID=K(),e.ON_EMAIL_CHANGED_ID=K(),e.ON_BLOCK_CHANGED_ID=K(),e.ON_CHUNKS_LOADED=K(),e.ON_SEND_TESTEMAIL_ID=K(),e.ON_SEND_LIVEPREVIEW_ID=K(),e.ON_SHARE_ID=K(),e.ON_SHOW_PREVIEW_ID=K(),e.ON_EMAIL_CLONE_ID=K(),e.ON_SEND_EMAIL_MODAL_ID=K(),e.ON_NOTIFICATION=K(),e.READ_LOCALE=K(),e.ON_TRANSLATE_ID=K(),e.ON_CODE_VALIDATE_ID=K(),e.UPLOAD_EVENT_ID=K(),e.PROXY_URL_EVENT_ID=K(),e.FILE_PROXY_EVENT_ID=K(),e.ON_LIMIT_ID=K(),e.ON_GLOBAL_BLOCK_PROPAGATE_UPDATE_ID=K(),e.ON_BROWSER_EXTENSION_DETECTED_ID=K()})(pe||={}),K(`APP_LOAD_EVENT`),K(`CONFIG_CHANGED_EVENT`);function q(e){for(;e.endsWith(`/`);)e=e.slice(0,e.length-1);return/\/wp-json$/i.test(e)?e:`${e}/wp-json`}q(`https://app.emailmaker.ru/api/`);var me;(function(e){let t=`https://racs.emcdn.ru/v3`;function n(e,n){let r={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(n)};return fetch(`${t}?resource=${e}&dataset=${document.location.hostname}`,r)}e.post=n;async function r(e,n=0){let r={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:`{"filter":{},"limit":${n}}`};return await(await fetch(`${t}/get?resource=${e}&dataset=${document.location.hostname}`,r)).json()}e.getAll=r})(me||={});var J=new Map,Y=new WeakMap;function X(e){return q(String(e||``).trim()||`https://app.emailmaker.ru/api/`)}async function he(e){if(!e.getAuthToken)return;let t=await e.getAuthToken(e.user,e.project,void 0);return t?`Bearer ${t}`:void 0}function ge(e){return async({baseUrl:t})=>{let n=X(t);if(!n)throw Error(`[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL`);let r=new Headers({Accept:`application/json`,"Content-Type":`application/x-www-form-urlencoded;charset=UTF-8`}),i=await he(e);i&&r.set(`authorization`,i);let a=await fetch(`${n}/app/v1/app_init`,{method:`POST`,headers:r,body:new URLSearchParams,credentials:`same-origin`});if(!a.ok)throw Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);return a.json()}}function _e(e){return JSON.stringify({baseUrl:X(e.baseUrl)||``,project:e.project??``,userId:e.user?.id??``})}function ve(e){return async t=>{let n=_e(t),r=J.get(n);if(r)return r;let i=Promise.resolve(e(t)).catch(e=>{throw J.delete(n),e});return J.set(n,i),i}}function ye(e){if(e.standaloneKey)return e;let t=e.appInit||ge(e),n=Y.get(t);return n||(n=ve(t),Y.set(t,n)),Promise.resolve(n({baseUrl:e.baseUrl,user:e.user,project:e.project,prevApp:void 0})).catch(e=>{}),{...e,appInit:n}}var Z=new WeakMap;function be(e){let t=null;return async(n,r,i)=>(t||=Promise.resolve(e(n,r,i)).finally(()=>{t=null}),t)}function xe(e){if(e.standaloneKey)return e;let t=e.getAuthToken;if(!t)return e;let n=Z.get(t);return n||(n=be(t),Z.set(t,n)),Promise.resolve(n(e.user,e.project,void 0)).catch(e=>{}),{...e,getAuthToken:n}}var Q=a({FileManagerApiError:()=>y}),Se=a({mapHttpStatusToErrorCode:()=>b});function Ce(e,t){return{...e,element:t}}function $(){return()=>{}}function we(e){let t=e.element;return!t||typeof t==`string`||typeof document>`u`?$():(z(t,e.config?.styles,t),()=>{B(t)})}function Te(e){if(!U()||e.initialSpinner===!1||typeof document>`u`)return{options:e,cleanup:$()};let t=e.element;if(!t||typeof t==`string`)return{options:e,cleanup:$()};t.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=de(t,`data-emailmaker`),r=e.handleChunkLoaded;return{options:{...e,handleChunkLoaded:()=>{n(),r?.()}},cleanup:n}}function Ee(e){return e?.length?e.some(e=>Array.isArray(e)?!1:!!(e&&typeof e==`object`&&`url`in e)):!1}var De=`1.1.5`;async function Oe(e){await D(typeof __emailmaker__<`u`?__emailmaker__:void 0)}async function ke(e){let t=new o,n=await V(e.element,t);t.dispose();let r=ye(xe(Ce(e,n)));if(n){let e=H.get(n);if(e)try{let t=await e;if(t.getElement()===n)return t.reset(r)}catch{H.get(n)===e&&H.delete(n)}}let i=we(r),a=Te(r),s=a.options;await T();let c=typeof __emailmaker__<`u`?__emailmaker__:void 0;Ee(s.plugins)?await E(c):A(c);let l=S().then(e=>e.init(s));n&&H.set(n,l);try{let e=await l;return n&&H.set(n,e),e}catch(e){throw i(),a.cleanup(),n&&H.get(n)===l&&H.delete(n),e}}async function Ae(e){return(await S()).parseAMP(e)}typeof window<`u`&&j(typeof __emailmaker__<`u`?__emailmaker__:void 0),Object.defineProperty(t,"errors",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(t,"helpers",{enumerable:!0,get:function(){return Se}}),t.init=ke,t.parseAMP=Ae,t.pluginRegistry=P,t.preload=Oe,t.version=De});
|
|
744
744
|
|
|
745
745
|
// Возвращаем API из entry модуля
|
|
746
746
|
return __emailmaker__.syncRequire("emailmaker.js");
|