@topol.io/editor 1.0.0-alpha.7 → 1.0.0-alpha.8
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/dist/topol-plugin.es.js +109 -101
- package/dist/topol-plugin.umd.js +1 -1
- package/package.json +1 -1
package/dist/topol-plugin.es.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function T(e) {
|
|
2
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3
3
|
}
|
|
4
|
-
var P = function(
|
|
5
|
-
var r = document.head || document.getElementsByTagName("head")[0],
|
|
6
|
-
typeof
|
|
7
|
-
},
|
|
8
|
-
var l = "onload" in
|
|
9
|
-
l(
|
|
4
|
+
var P = function(n, o, t) {
|
|
5
|
+
var r = document.head || document.getElementsByTagName("head")[0], i = document.createElement("script");
|
|
6
|
+
typeof o == "function" && (t = o, o = {}), o = o || {}, t = t || function() {
|
|
7
|
+
}, i.type = o.type || "text/javascript", i.charset = o.charset || "utf8", i.async = "async" in o ? !!o.async : !0, i.src = n, o.attrs && m(i, o.attrs), o.text && (i.text = "" + o.text);
|
|
8
|
+
var l = "onload" in i ? p : E;
|
|
9
|
+
l(i, t), i.onload || p(i, t), r.appendChild(i);
|
|
10
10
|
};
|
|
11
|
-
function m(
|
|
12
|
-
for (var
|
|
13
|
-
|
|
11
|
+
function m(e, n) {
|
|
12
|
+
for (var o in n)
|
|
13
|
+
e.setAttribute(o, n[o]);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
this.onerror = this.onload = null,
|
|
18
|
-
},
|
|
19
|
-
this.onerror = this.onload = null,
|
|
15
|
+
function p(e, n) {
|
|
16
|
+
e.onload = function() {
|
|
17
|
+
this.onerror = this.onload = null, n(null, e);
|
|
18
|
+
}, e.onerror = function() {
|
|
19
|
+
this.onerror = this.onload = null, n(new Error("Failed to load " + this.src), e);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function E(
|
|
23
|
-
|
|
24
|
-
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null,
|
|
22
|
+
function E(e, n) {
|
|
23
|
+
e.onreadystatechange = function() {
|
|
24
|
+
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, n(null, e));
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
const g = /* @__PURE__ */
|
|
27
|
+
const g = /* @__PURE__ */ T(P);
|
|
28
28
|
var u = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
29
29
|
const h = "https://v3.email-assets.topol.io/loader/build.js", L = "https://v3.develop.email-assets.topol.io/loader/build.js", v = "https://v3.develop.email-assets.topol.io/loader/build.js", a = {
|
|
30
30
|
production: u.VITE_TOPOL_URL || h,
|
|
31
31
|
dev: u.VITE_TOPOL_DEV_URL || L,
|
|
32
32
|
staging: u.VITE_TOPOL_STAGING_URL || v
|
|
33
33
|
}, y = "https://d10h8ga60f7b91.cloudfront.net/preview-app-{stage}/loader/build.js";
|
|
34
|
-
function _(
|
|
35
|
-
switch (
|
|
34
|
+
function _(e) {
|
|
35
|
+
switch (e) {
|
|
36
36
|
case "dev":
|
|
37
37
|
return a.dev;
|
|
38
38
|
case "staging":
|
|
@@ -40,26 +40,26 @@ function _(o) {
|
|
|
40
40
|
case "production":
|
|
41
41
|
return a.production;
|
|
42
42
|
default:
|
|
43
|
-
return y.replace("{stage}", String(
|
|
43
|
+
return y.replace("{stage}", String(e));
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function S(
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
46
|
+
function S(e = "production") {
|
|
47
|
+
const n = _(e);
|
|
48
|
+
if (!n) {
|
|
49
49
|
if (a.production)
|
|
50
|
-
return console.error(`[@topol.io/editor] No loader URL resolved for stage "${
|
|
51
|
-
throw new Error(`[@topol.io/editor] Could not resolve a loader URL for stage "${
|
|
50
|
+
return console.error(`[@topol.io/editor] No loader URL resolved for stage "${e}"; falling back to the production loader.`), a.production;
|
|
51
|
+
throw new Error(`[@topol.io/editor] Could not resolve a loader URL for stage "${e}". The editor cannot be loaded.`);
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return n;
|
|
54
54
|
}
|
|
55
|
-
async function A(
|
|
56
|
-
return new Promise((
|
|
57
|
-
g(a.production, (
|
|
58
|
-
if (
|
|
59
|
-
|
|
55
|
+
async function A(e) {
|
|
56
|
+
return new Promise((n, o) => {
|
|
57
|
+
g(a.production, (t) => {
|
|
58
|
+
if (t !== null) {
|
|
59
|
+
o(t);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
window.TopolPlugin.init(
|
|
62
|
+
window.TopolPlugin.init(e), n(!0);
|
|
63
63
|
});
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -70,29 +70,29 @@ const R = {
|
|
|
70
70
|
* @param options - Plugin options including stage selection
|
|
71
71
|
* @returns Promise that resolves to true when the editor is ready
|
|
72
72
|
*/
|
|
73
|
-
init: (
|
|
74
|
-
const r = S(
|
|
75
|
-
g(r, async (
|
|
76
|
-
if (
|
|
73
|
+
init: (e, n) => new Promise((o, t) => {
|
|
74
|
+
const r = S(n == null ? void 0 : n.stage);
|
|
75
|
+
g(r, async (i) => {
|
|
76
|
+
if (i !== null) {
|
|
77
77
|
if (r !== a.production)
|
|
78
78
|
try {
|
|
79
|
-
return await A(
|
|
79
|
+
return await A(e), o(!0);
|
|
80
80
|
} catch (l) {
|
|
81
|
-
|
|
81
|
+
t(l);
|
|
82
82
|
}
|
|
83
|
-
i
|
|
83
|
+
t(i);
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
|
-
window.TopolPlugin.init(
|
|
86
|
+
window.TopolPlugin.init(e), o(!0);
|
|
87
87
|
});
|
|
88
88
|
}),
|
|
89
89
|
/** Trigger the save callback with current editor content */
|
|
90
|
-
save: (
|
|
91
|
-
window.TopolPlugin.save(
|
|
90
|
+
save: (e) => {
|
|
91
|
+
window.TopolPlugin.save(e);
|
|
92
92
|
},
|
|
93
93
|
/** Load a template JSON into the editor */
|
|
94
|
-
load: (
|
|
95
|
-
window.TopolPlugin.load(
|
|
94
|
+
load: (e) => {
|
|
95
|
+
window.TopolPlugin.load(e);
|
|
96
96
|
},
|
|
97
97
|
/** Toggle the preview mode */
|
|
98
98
|
togglePreview: () => {
|
|
@@ -103,8 +103,8 @@ const R = {
|
|
|
103
103
|
window.TopolPlugin.togglePreviewSize();
|
|
104
104
|
},
|
|
105
105
|
/** Select a file from the custom file manager */
|
|
106
|
-
chooseFile: (
|
|
107
|
-
window.TopolPlugin.chooseFile(
|
|
106
|
+
chooseFile: (e) => {
|
|
107
|
+
window.TopolPlugin.chooseFile(e);
|
|
108
108
|
},
|
|
109
109
|
/** Undo the last action */
|
|
110
110
|
undo: () => {
|
|
@@ -119,20 +119,20 @@ const R = {
|
|
|
119
119
|
window.TopolPlugin.destroy();
|
|
120
120
|
},
|
|
121
121
|
/** Update the list of saved/reusable blocks */
|
|
122
|
-
setSavedBlocks: (
|
|
123
|
-
window.TopolPlugin.setSavedBlocks(
|
|
122
|
+
setSavedBlocks: (e) => {
|
|
123
|
+
window.TopolPlugin.setSavedBlocks(e);
|
|
124
124
|
},
|
|
125
125
|
/** Set custom HTML for the preview */
|
|
126
|
-
setPreviewHTML: (
|
|
127
|
-
window.TopolPlugin.setPreviewHTML(
|
|
126
|
+
setPreviewHTML: (e) => {
|
|
127
|
+
window.TopolPlugin.setPreviewHTML(e);
|
|
128
128
|
},
|
|
129
129
|
/** Display a notification in the editor */
|
|
130
|
-
createNotification: (
|
|
131
|
-
window.TopolPlugin.createNotification(
|
|
130
|
+
createNotification: (e) => {
|
|
131
|
+
window.TopolPlugin.createNotification(e);
|
|
132
132
|
},
|
|
133
133
|
/** Set the list of active collaboration members */
|
|
134
|
-
setActiveMembers: (
|
|
135
|
-
window.TopolPlugin.setActiveMembers(
|
|
134
|
+
setActiveMembers: (e) => {
|
|
135
|
+
window.TopolPlugin.setActiveMembers(e);
|
|
136
136
|
},
|
|
137
137
|
/** Switch to mobile view */
|
|
138
138
|
changeEmailToMobile: () => {
|
|
@@ -147,12 +147,12 @@ const R = {
|
|
|
147
147
|
window.TopolPlugin.toggleBlocksAndStructuresVisibility();
|
|
148
148
|
},
|
|
149
149
|
/** Update the content of a custom block */
|
|
150
|
-
updateCustomBlockContent: (
|
|
151
|
-
window.TopolPlugin.updateCustomBlockContent(
|
|
150
|
+
updateCustomBlockContent: (e) => {
|
|
151
|
+
window.TopolPlugin.updateCustomBlockContent(e);
|
|
152
152
|
},
|
|
153
153
|
/** Refresh comments/conversations */
|
|
154
|
-
refreshComments: (
|
|
155
|
-
window.TopolPlugin.refreshComments(
|
|
154
|
+
refreshComments: (e) => {
|
|
155
|
+
window.TopolPlugin.refreshComments(e);
|
|
156
156
|
},
|
|
157
157
|
/** Refresh synced rows */
|
|
158
158
|
refreshSyncedRows: () => {
|
|
@@ -163,15 +163,15 @@ const R = {
|
|
|
163
163
|
window.TopolPlugin.openPremadeTemplatesSelection();
|
|
164
164
|
},
|
|
165
165
|
/** Update the API authorization header */
|
|
166
|
-
updateApiAuthorizationHeader: (
|
|
167
|
-
window.TopolPlugin.updateApiAuthorizationHeader(
|
|
166
|
+
updateApiAuthorizationHeader: (e) => {
|
|
167
|
+
window.TopolPlugin.updateApiAuthorizationHeader(e);
|
|
168
168
|
},
|
|
169
169
|
/** Set the template name/title */
|
|
170
|
-
setTemplateName: (
|
|
171
|
-
window.TopolPlugin.setTemplateName(
|
|
170
|
+
setTemplateName: (e) => {
|
|
171
|
+
window.TopolPlugin.setTemplateName(e);
|
|
172
172
|
},
|
|
173
|
-
updateOptions: (
|
|
174
|
-
window.TopolPlugin.updateOptions(
|
|
173
|
+
updateOptions: (e) => {
|
|
174
|
+
window.TopolPlugin.updateOptions(e);
|
|
175
175
|
},
|
|
176
176
|
/** Toggle the AI chat feature */
|
|
177
177
|
toggleChatAI: () => {
|
|
@@ -186,20 +186,20 @@ const R = {
|
|
|
186
186
|
window.TopolPlugin.toggleComments();
|
|
187
187
|
},
|
|
188
188
|
/** Create a new language variant */
|
|
189
|
-
createLanguage: (
|
|
190
|
-
window.TopolPlugin.createLanguage(
|
|
189
|
+
createLanguage: (e) => {
|
|
190
|
+
window.TopolPlugin.createLanguage(e);
|
|
191
191
|
},
|
|
192
192
|
/** Set the primary language */
|
|
193
|
-
setPrimaryLanguage: (
|
|
194
|
-
window.TopolPlugin.setPrimaryLanguage(
|
|
193
|
+
setPrimaryLanguage: (e) => {
|
|
194
|
+
window.TopolPlugin.setPrimaryLanguage(e);
|
|
195
195
|
},
|
|
196
196
|
/** Delete a language variant */
|
|
197
|
-
deleteLanguage: (
|
|
198
|
-
window.TopolPlugin.deleteLanguage(
|
|
197
|
+
deleteLanguage: (e) => {
|
|
198
|
+
window.TopolPlugin.deleteLanguage(e);
|
|
199
199
|
},
|
|
200
200
|
/** Select/switch to a language */
|
|
201
|
-
selectLanguage: (
|
|
202
|
-
window.TopolPlugin.selectLanguage(
|
|
201
|
+
selectLanguage: (e) => {
|
|
202
|
+
window.TopolPlugin.selectLanguage(e);
|
|
203
203
|
},
|
|
204
204
|
/** Get the list of mutations */
|
|
205
205
|
getMutations: () => window.TopolPlugin.getMutations(),
|
|
@@ -208,49 +208,49 @@ const R = {
|
|
|
208
208
|
window.TopolPlugin.toggleControlPanel();
|
|
209
209
|
},
|
|
210
210
|
/** Update the editor template with new JSON data */
|
|
211
|
-
updateTemplate: (
|
|
212
|
-
window.TopolPlugin.updateTemplate(
|
|
211
|
+
updateTemplate: (e, n) => {
|
|
212
|
+
window.TopolPlugin.updateTemplate(e, n);
|
|
213
213
|
},
|
|
214
214
|
/** Toggle dark mode for the editor */
|
|
215
215
|
toggleDarkMode: () => {
|
|
216
216
|
window.TopolPlugin.toggleDarkMode();
|
|
217
217
|
}
|
|
218
218
|
}, O = "https://v1.page-assets.topol.io/topol-lpe.js", s = /* @__PURE__ */ new Map();
|
|
219
|
-
function D(
|
|
220
|
-
if (
|
|
219
|
+
function D(e, n) {
|
|
220
|
+
if (n())
|
|
221
221
|
return Promise.resolve();
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
return
|
|
225
|
-
const
|
|
226
|
-
const l = typeof document < "u" ? U(
|
|
222
|
+
const o = s.get(e);
|
|
223
|
+
if (o)
|
|
224
|
+
return o;
|
|
225
|
+
const t = new Promise((r, i) => {
|
|
226
|
+
const l = typeof document < "u" ? U(e) : null;
|
|
227
227
|
if (l) {
|
|
228
228
|
const d = () => {
|
|
229
|
-
|
|
229
|
+
w(), r();
|
|
230
230
|
}, c = () => {
|
|
231
|
-
|
|
232
|
-
},
|
|
231
|
+
w(), i(new Error(`Failed to load script: ${e}`));
|
|
232
|
+
}, w = () => {
|
|
233
233
|
l.removeEventListener("load", d), l.removeEventListener("error", c);
|
|
234
234
|
};
|
|
235
235
|
l.addEventListener("load", d), l.addEventListener("error", c);
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
g(
|
|
239
|
-
d !== null ?
|
|
238
|
+
g(e, (d) => {
|
|
239
|
+
d !== null ? i(d) : r();
|
|
240
240
|
});
|
|
241
241
|
}).finally(() => {
|
|
242
|
-
s.delete(
|
|
242
|
+
s.delete(e);
|
|
243
243
|
});
|
|
244
|
-
return s.set(
|
|
244
|
+
return s.set(e, t), t;
|
|
245
245
|
}
|
|
246
|
-
function U(
|
|
247
|
-
const
|
|
248
|
-
for (let
|
|
249
|
-
if (
|
|
250
|
-
return
|
|
246
|
+
function U(e) {
|
|
247
|
+
const n = document.getElementsByTagName("script");
|
|
248
|
+
for (let o = 0; o < n.length; o++)
|
|
249
|
+
if (n[o].src === e)
|
|
250
|
+
return n[o];
|
|
251
251
|
return null;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function f() {
|
|
254
254
|
return typeof window < "u" && typeof window.LandingPageEditor == "function";
|
|
255
255
|
}
|
|
256
256
|
const C = {
|
|
@@ -261,11 +261,19 @@ const C = {
|
|
|
261
261
|
* @param pluginOptions - Plugin options (reserved for future staging/dev URL support)
|
|
262
262
|
* @returns Promise that resolves with the editor instance
|
|
263
263
|
*/
|
|
264
|
-
init: async (
|
|
265
|
-
|
|
264
|
+
init: async (e, n) => {
|
|
265
|
+
var i;
|
|
266
|
+
if (await D(O, f), !f())
|
|
266
267
|
throw new Error("[@topol.io/editor] topol-lpe.js loaded but window.LandingPageEditor is not defined.");
|
|
267
|
-
|
|
268
|
-
|
|
268
|
+
let o = !1;
|
|
269
|
+
const t = window.LandingPageEditor({
|
|
270
|
+
...e,
|
|
271
|
+
onClose() {
|
|
272
|
+
var l;
|
|
273
|
+
o || (l = e.onClose) == null || l.call(e);
|
|
274
|
+
}
|
|
275
|
+
}), r = ((i = t.destroy) == null ? void 0 : i.bind(t)) ?? (() => t.close());
|
|
276
|
+
return t.destroy = () => (o = !0, r()), t;
|
|
269
277
|
}
|
|
270
278
|
}, I = R;
|
|
271
279
|
export {
|
package/dist/topol-plugin.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(r,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(r=typeof globalThis<"u"?globalThis:r||self,u(r["topol-plugin"]={}))})(this,function(r){"use strict";function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L=function(n,o,t){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof o=="function"&&(t=o,o={}),o=o||{},t=t||function(){},i.type=o.type||"text/javascript",i.charset=o.charset||"utf8",i.async="async"in o?!!o.async:!0,i.src=n,o.attrs&&h(i,o.attrs),o.text&&(i.text=""+o.text);var l="onload"in i?w:v;l(i,t),i.onload||w(i,t),a.appendChild(i)};function h(e,n){for(var o in n)e.setAttribute(o,n[o])}function w(e,n){e.onload=function(){this.onerror=this.onload=null,n(null,e)},e.onerror=function(){this.onerror=this.onload=null,n(new Error("Failed to load "+this.src),e)}}function v(e,n){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,n(null,e))}}const g=u(L);var c={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const d={production:c.VITE_TOPOL_URL||"https://v3.email-assets.topol.io/loader/build.js",dev:c.VITE_TOPOL_DEV_URL||"https://v3.develop.email-assets.topol.io/loader/build.js",staging:c.VITE_TOPOL_STAGING_URL||"https://v3.develop.email-assets.topol.io/loader/build.js"},_="https://d10h8ga60f7b91.cloudfront.net/preview-app-{stage}/loader/build.js";function y(e){switch(e){case"dev":return d.dev;case"staging":return d.staging;case"production":return d.production;default:return _.replace("{stage}",String(e))}}function A(e="production"){const n=y(e);if(!n){if(d.production)return console.error(`[@topol.io/editor] No loader URL resolved for stage "${e}"; falling back to the production loader.`),d.production;throw new Error(`[@topol.io/editor] Could not resolve a loader URL for stage "${e}". The editor cannot be loaded.`)}return n}async function S(e){return new Promise((n,o)=>{g(d.production,t=>{if(t!==null){o(t);return}window.TopolPlugin.init(e),n(!0)})})}const f={init:(e,n)=>new Promise((o,t)=>{const a=A(n==null?void 0:n.stage);g(a,async i=>{if(i!==null){if(a!==d.production)try{return await S(e),o(!0)}catch(l){t(l)}t(i);return}window.TopolPlugin.init(e),o(!0)})}),save:e=>{window.TopolPlugin.save(e)},load:e=>{window.TopolPlugin.load(e)},togglePreview:()=>{window.TopolPlugin.togglePreview()},togglePreviewSize:()=>{window.TopolPlugin.togglePreviewSize()},chooseFile:e=>{window.TopolPlugin.chooseFile(e)},undo:()=>{window.TopolPlugin.undo()},redo:()=>{window.TopolPlugin.redo()},destroy:()=>{window.TopolPlugin.destroy()},setSavedBlocks:e=>{window.TopolPlugin.setSavedBlocks(e)},setPreviewHTML:e=>{window.TopolPlugin.setPreviewHTML(e)},createNotification:e=>{window.TopolPlugin.createNotification(e)},setActiveMembers:e=>{window.TopolPlugin.setActiveMembers(e)},changeEmailToMobile:()=>{window.TopolPlugin.changeEmailToMobile()},changeEmailToDesktop:()=>{window.TopolPlugin.changeEmailToDesktop()},toggleBlocksAndStructuresVisibility:()=>{window.TopolPlugin.toggleBlocksAndStructuresVisibility()},updateCustomBlockContent:e=>{window.TopolPlugin.updateCustomBlockContent(e)},refreshComments:e=>{window.TopolPlugin.refreshComments(e)},refreshSyncedRows:()=>{window.TopolPlugin.refreshSyncedRows()},openPremadeTemplatesSelection:()=>{window.TopolPlugin.openPremadeTemplatesSelection()},updateApiAuthorizationHeader:e=>{window.TopolPlugin.updateApiAuthorizationHeader(e)},setTemplateName:e=>{window.TopolPlugin.setTemplateName(e)},updateOptions:e=>{window.TopolPlugin.updateOptions(e)},toggleChatAI:()=>{window.TopolPlugin.toggleChatAI()},toggleAutosaves:()=>{window.TopolPlugin.toggleAutosaves()},toggleComments:()=>{window.TopolPlugin.toggleComments()},createLanguage:e=>{window.TopolPlugin.createLanguage(e)},setPrimaryLanguage:e=>{window.TopolPlugin.setPrimaryLanguage(e)},deleteLanguage:e=>{window.TopolPlugin.deleteLanguage(e)},selectLanguage:e=>{window.TopolPlugin.selectLanguage(e)},getMutations:()=>window.TopolPlugin.getMutations(),toggleControlPanel:()=>{window.TopolPlugin.toggleControlPanel()},updateTemplate:(e,n)=>{window.TopolPlugin.updateTemplate(e,n)},toggleDarkMode:()=>{window.TopolPlugin.toggleDarkMode()}},R="https://v1.page-assets.topol.io/topol-lpe.js",p=new Map;function U(e,n){if(n())return Promise.resolve();const o=p.get(e);if(o)return o;const t=new Promise((a,i)=>{const l=typeof document<"u"?D(e):null;if(l){const s=()=>{E(),a()},m=()=>{E(),i(new Error(`Failed to load script: ${e}`))},E=()=>{l.removeEventListener("load",s),l.removeEventListener("error",m)};l.addEventListener("load",s),l.addEventListener("error",m);return}g(e,s=>{s!==null?i(s):a()})}).finally(()=>{p.delete(e)});return p.set(e,t),t}function D(e){const n=document.getElementsByTagName("script");for(let o=0;o<n.length;o++)if(n[o].src===e)return n[o];return null}function T(){return typeof window<"u"&&typeof window.LandingPageEditor=="function"}const O={init:async(e,n)=>{var i;if(await U(R,T),!T())throw new Error("[@topol.io/editor] topol-lpe.js loaded but window.LandingPageEditor is not defined.");let o=!1;const t=window.LandingPageEditor({...e,onClose(){var l;o||(l=e.onClose)==null||l.call(e)}}),a=((i=t.destroy)==null?void 0:i.bind(t))??(()=>t.close());return t.destroy=()=>(o=!0,a()),t}},P=f;r.EmailEditor=f,r.LandingPageEditor=O,r.TopolPlugin=P,r.default=P,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|