@useinsider/guido 3.21.1-beta.f5fb7ac → 3.21.2-beta.066adbf

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +35 -13
  2. package/dist/@types/config/schemas.js +33 -35
  3. package/dist/components/Guido.vue.js +5 -5
  4. package/dist/components/Guido.vue2.js +121 -115
  5. package/dist/composables/useEditorOpenMetrics.js +167 -0
  6. package/dist/composables/useModuleRepair.js +23 -32
  7. package/dist/composables/useStripo.js +93 -82
  8. package/dist/config/compiler/utils/recommendationCompilerUtils.js +55 -53
  9. package/dist/config/migrator/index.js +9 -10
  10. package/dist/enums/academy.js +1 -2
  11. package/dist/extensions/Blocks/Recommendation/block.js +52 -37
  12. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +76 -16
  13. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +16 -15
  14. package/dist/guido.css +1 -1
  15. package/dist/library.js +12 -10
  16. package/dist/package.json.js +6 -4
  17. package/dist/public/prefetchRuntime.js +4 -0
  18. package/dist/src/@types/config/schemas.d.ts +0 -4
  19. package/dist/src/composables/useConfig.d.ts +0 -2
  20. package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
  21. package/dist/src/composables/useModuleRepair.d.ts +11 -2
  22. package/dist/src/composables/useStripo.d.ts +2 -1
  23. package/dist/src/enums/academy.d.ts +0 -1
  24. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +2 -0
  25. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +31 -17
  26. package/dist/src/library.d.ts +1 -0
  27. package/dist/src/public/prefetchRuntime.d.ts +1 -0
  28. package/dist/src/stores/config.d.ts +0 -20
  29. package/dist/src/stores/editor.d.ts +0 -25
  30. package/dist/src/utils/runtimePrefetch.d.ts +4 -0
  31. package/dist/src/utils/stripoRuntime.d.ts +3 -0
  32. package/dist/static/stripo-runtime-manifest.json.js +9 -0
  33. package/dist/stores/editor.js +14 -15
  34. package/dist/utils/runtimePrefetch.js +26 -0
  35. package/dist/utils/stripoRuntime.js +13 -0
  36. package/package.json +6 -1
  37. package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +0 -17
  38. package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +0 -30
  39. package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +0 -16
  40. package/dist/src/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts +0 -2
  41. package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +0 -1
  42. package/dist/src/utils/legacyUnsubscribeConversion.d.ts +0 -10
  43. package/dist/utils/legacyUnsubscribeConversion.js +0 -49
@@ -0,0 +1,167 @@
1
+ import { SYNC_MODULE_CLASS as w } from "./useSyncModuleExtractor.js";
2
+ import { readRuntimePrefetchState as S } from "../utils/runtimePrefetch.js";
3
+ import { getStripoVersion as R } from "../utils/stripoRuntime.js";
4
+ import M from "../package.json.js";
5
+ const A = [
6
+ "setup",
7
+ "host_ready",
8
+ "migration_start",
9
+ "migration_end",
10
+ "default_template_start",
11
+ "default_template_end",
12
+ "timer_clone_start",
13
+ "timer_clone_end",
14
+ "plugin_start",
15
+ "script_ready",
16
+ "fonts_sync_ready",
17
+ "blocks_config_ready",
18
+ "init_editor",
19
+ "token_start",
20
+ "token_end",
21
+ "ready"
22
+ ], m = "guido:open:", h = "total", p = [
23
+ ["host_wait", "setup", "host_ready"],
24
+ ["migration", "migration_start", "migration_end"],
25
+ ["default_template", "default_template_start", "default_template_end"],
26
+ ["timer_clone", "timer_clone_start", "timer_clone_end"],
27
+ ["script", "plugin_start", "script_ready"],
28
+ ["fonts_sync", "script_ready", "fonts_sync_ready"],
29
+ ["blocks_config", "fonts_sync_ready", "blocks_config_ready"],
30
+ ["editor_config", "blocks_config_ready", "init_editor"],
31
+ ["stripo_load", "init_editor", "ready"],
32
+ ["token", "token_start", "token_end"]
33
+ ], b = (e) => new RegExp(`(?:^|[\\s"'])(?:${e})(?=[\\s"'])`, "g"), N = /<img\b/gi, $ = b(w), L = /\srecommendation-id=/g, C = b("items-block-v2|esd-(?:cart|browsed|purchased)-items-block"), I = "esd-timer-id", f = {
34
+ html_bytes: null,
35
+ css_bytes: null,
36
+ image_count: null,
37
+ synced_module_count: null,
38
+ recommendation_block_count: null,
39
+ items_block_count: null,
40
+ has_timers: null,
41
+ force_recreate: null
42
+ };
43
+ let l = null;
44
+ const i = (e) => {
45
+ try {
46
+ e();
47
+ } catch (t) {
48
+ console.debug("guido:open: metrics step failed", t);
49
+ }
50
+ }, k = () => window.DD_RUM, g = (e, t) => e === void 0 || t === void 0 ? null : Math.round(t - e), _ = (e, t) => {
51
+ var r;
52
+ return ((r = e.match(t)) == null ? void 0 : r.length) ?? 0;
53
+ }, y = (e) => new TextEncoder().encode(e).length, O = (e) => {
54
+ if (!e)
55
+ return f;
56
+ try {
57
+ const { html: t, css: r, forceRecreate: o } = e;
58
+ return {
59
+ html_bytes: y(t),
60
+ css_bytes: y(r),
61
+ image_count: _(t, N),
62
+ synced_module_count: _(t, $),
63
+ recommendation_block_count: _(t, L),
64
+ items_block_count: _(t, C),
65
+ has_timers: t.includes(I),
66
+ force_recreate: o
67
+ };
68
+ } catch (t) {
69
+ return console.debug("guido:open: template weight failed", t), f;
70
+ }
71
+ }, E = () => {
72
+ i(() => {
73
+ A.forEach((e) => performance.clearMarks(`${m}${e}`)), [...p.map(([e]) => e), h].forEach((e) => performance.clearMeasures(`${m}${e}`));
74
+ });
75
+ }, c = (e, t) => {
76
+ if (e.finished || e.marks[t] !== void 0)
77
+ return;
78
+ const r = performance.now();
79
+ e.marks[t] = r, e === l && i(() => performance.mark(`${m}${t}`, { startTime: r }));
80
+ }, s = (e) => {
81
+ e.finished = !0, document.removeEventListener("visibilitychange", e.onVisibilityChange), window.removeEventListener("pagehide", e.onPageHide);
82
+ }, B = (e, t) => {
83
+ const { marks: r } = e, o = p.map(([n, a, d]) => [n, r[a], r[d]]);
84
+ o.push([h, r.setup, t]), o.forEach(([n, a, d]) => {
85
+ a !== void 0 && d !== void 0 && i(() => performance.measure(`${m}${n}`, { start: a, end: d }));
86
+ });
87
+ }, D = (e, t, r) => {
88
+ const { marks: o, context: n } = e, a = Object.fromEntries(
89
+ p.map(([d, v, P]) => [`${d}_ms`, g(o[v], o[P])])
90
+ );
91
+ return {
92
+ outcome: t,
93
+ open_ms: g(o.setup, r),
94
+ ...a,
95
+ script_preloaded: e.scriptPreloaded,
96
+ runtime_prefetch: e.runtimePrefetch,
97
+ ...O(e.template),
98
+ partner_name: (n == null ? void 0 : n.partnerName) ?? null,
99
+ product_type: (n == null ? void 0 : n.productType) ?? null,
100
+ template_id: (n == null ? void 0 : n.templateId) ?? null,
101
+ variation_id: (n == null ? void 0 : n.variationId) ?? null,
102
+ guido_version: M.version,
103
+ stripo_version: R(),
104
+ was_backgrounded: e.wasBackgrounded
105
+ };
106
+ }, u = (e, t) => {
107
+ i(() => {
108
+ const r = e.marks.ready ?? performance.now(), o = D(e, t, r);
109
+ e.template = null, e === l && B(e, r), console.debug("guido:open", o), i(() => {
110
+ var n, a;
111
+ return (a = (n = k()) == null ? void 0 : n.addAction) == null ? void 0 : a.call(n, "guido_editor_open", o);
112
+ });
113
+ });
114
+ }, T = (e) => {
115
+ e.finished || (s(e), u(e, "abandoned"));
116
+ }, H = () => {
117
+ const e = {
118
+ marks: {},
119
+ context: null,
120
+ template: null,
121
+ scriptPreloaded: null,
122
+ runtimePrefetch: null,
123
+ wasBackgrounded: document.visibilityState === "hidden",
124
+ finished: !1,
125
+ onVisibilityChange: () => {
126
+ document.visibilityState === "hidden" && (e.wasBackgrounded = !0);
127
+ },
128
+ onPageHide: () => T(e)
129
+ };
130
+ return e;
131
+ }, Y = (e) => ({
132
+ mark: (t) => c(e, t),
133
+ timed: async (t, r) => {
134
+ c(e, `${t}_start`);
135
+ const o = await r();
136
+ return c(e, `${t}_end`), o;
137
+ },
138
+ setContext: (t) => {
139
+ e.context = t;
140
+ },
141
+ setTemplate: (t) => {
142
+ e.template = t;
143
+ },
144
+ setScriptPreloaded: (t) => {
145
+ e.scriptPreloaded = t;
146
+ },
147
+ markReady: () => {
148
+ e.finished || (c(e, "ready"), s(e), i(() => {
149
+ var t, r;
150
+ return (r = (t = k()) == null ? void 0 : t.addTiming) == null ? void 0 : r.call(t, "guido_editor_ready");
151
+ }), setTimeout(() => u(e, "ready"), 0));
152
+ },
153
+ markFailed: () => {
154
+ e.finished || (s(e), u(e, "error"));
155
+ },
156
+ dispose: () => {
157
+ T(e), e === l && (E(), l = null);
158
+ }
159
+ }), K = () => {
160
+ const e = H();
161
+ return E(), l = e, i(() => {
162
+ e.runtimePrefetch = S();
163
+ }), document.addEventListener("visibilitychange", e.onVisibilityChange), window.addEventListener("pagehide", e.onPageHide), c(e, "setup"), Y(e);
164
+ };
165
+ export {
166
+ K as startEditorOpenMetrics
167
+ };
@@ -1,42 +1,33 @@
1
- import { useConfig as f } from "./useConfig.js";
2
- import { useToaster as d } from "./useToaster.js";
3
- import { useTranslations as C } from "./useTranslations.js";
4
- import { ToasterTypeOptions as h } from "../enums/toaster.js";
5
- import { useEditorStore as T } from "../stores/editor.js";
6
- import { buildDynamicContentLookup as v, convertModuleDynamicContent as D } from "../utils/dynamicContentConverter.js";
7
- import { flattenDynamicContentList as L } from "../utils/genericUtil.js";
1
+ import { useConfig as C } from "./useConfig.js";
2
+ import { useToaster as T } from "./useToaster.js";
3
+ import { useTranslations as g } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as D } from "../enums/toaster.js";
5
+ import { buildDynamicContentLookup as f, convertModuleDynamicContent as h } from "../utils/dynamicContentConverter.js";
6
+ import { flattenDynamicContentList as O } from "../utils/genericUtil.js";
8
7
  import { repairItemsCurrencyAttributes as M } from "../utils/itemsCurrencyRepair.js";
9
- import { convertLegacyUnsubscribeInModuleHtml as O } from "../utils/legacyUnsubscribeConversion.js";
10
- const E = "dynamic-content.unresolved-attributes-on-drop", Y = () => {
11
- const { template: p, isFeatureEnabled: s } = f(), { showToaster: y } = d(), b = C();
12
- return { handleModuleAdd: (t, r) => {
13
- var c, l, u;
8
+ const N = "dynamic-content.unresolved-attributes-on-drop", R = () => {
9
+ const { template: p, isFeatureEnabled: m } = C(), { showToaster: a } = T(), y = g();
10
+ return { handleModuleAdd: (e, o) => {
11
+ var s, l, u;
14
12
  try {
15
- if ((t == null ? void 0 : t.action) !== "ADD" && (t == null ? void 0 : t.action) !== "COPY")
13
+ if ((e == null ? void 0 : e.action) !== "ADD" && (e == null ? void 0 : e.action) !== "COPY")
16
14
  return;
17
- const e = (c = r == null ? void 0 : r.getTargetNode) == null ? void 0 : c.call(r), n = (l = e == null ? void 0 : e.getOuterHTML) == null ? void 0 : l.call(e);
18
- if (!e || typeof n != "string")
15
+ const t = (s = o == null ? void 0 : o.getTargetNode) == null ? void 0 : s.call(o), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
16
+ if (!t || typeof r != "string")
19
17
  return;
20
- let o = M(n), i = !1;
21
- s("legacyUnsubscribeConversion") && ({ html: o, converted: i } = O(o));
22
- const a = v(L((u = p.value) == null ? void 0 : u.dynamicContentList));
23
- let m = [];
24
- if (a.size > 0 && ({ html: o, unresolved: m } = D(o, a, s("liquidSyntax"))), o !== n && r.modifyHtml(e).replaceWith(o), i)
25
- try {
26
- T().isLegacyUnsubscribeModalRequested = !0;
27
- } catch (g) {
28
- console.error("Failed to request the legacy unsubscribe modal:", g);
29
- }
30
- m.length > 0 && y({
31
- type: h.Warning,
32
- message: b(E)
18
+ let n = M(r);
19
+ const c = f(O((u = p.value) == null ? void 0 : u.dynamicContentList));
20
+ let i = [];
21
+ c.size > 0 && ({ html: n, unresolved: i } = h(n, c, m("liquidSyntax"))), n !== r && o.modifyHtml(t).replaceWith(n), i.length > 0 && a({
22
+ type: D.Warning,
23
+ message: y(N)
33
24
  });
34
- } catch (e) {
35
- console.error("Failed to repair module on add:", e);
25
+ } catch (t) {
26
+ console.error("Failed to repair module on add:", t);
36
27
  }
37
28
  } };
38
29
  };
39
30
  export {
40
- E as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
41
- Y as useModuleRepair
31
+ N as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
32
+ R as useModuleRepair
42
33
  };
@@ -1,44 +1,54 @@
1
- import { useActionsApi as L } from "./useActionsApi.js";
2
- import { useBlocksConfig as O } from "./useBlocksConfig.js";
3
- import { useConfig as H } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
6
- import { useModuleRepair as j } from "./useModuleRepair.js";
7
- import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
8
- import { useStripoNotifications as $ } from "./useStripoNotifications.js";
9
- import { useToaster as G } from "./useToaster.js";
10
- import { localePatch as J } from "../config/i18n/index.js";
11
- import { en as b } from "../config/i18n/en/index.js";
12
- import { ToasterTypeOptions as X } from "../enums/toaster.js";
13
- import { useStripoApi as K } from "../services/stripoApi.js";
14
- import Q from "../static/styles/customEditorStyle.css.js";
15
- import { useEditorStore as k } from "../stores/editor.js";
16
- import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
17
- import Z from "../package.json.js";
18
- let n = null;
19
- const he = () => {
20
- const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = O(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
21
- var d;
1
+ import { useActionsApi as M } from "./useActionsApi.js";
2
+ import { useBlocksConfig as N } from "./useBlocksConfig.js";
3
+ import { useConfig as j } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as _ } from "./useCustomInterfaceAppearance.js";
5
+ import { useFullStoryBridge as z } from "./useFullStoryBridge.js";
6
+ import { useModuleRepair as $ } from "./useModuleRepair.js";
7
+ import { useStripoEventHandler as G } from "./useStripoEventHandler.js";
8
+ import { useStripoNotifications as X } from "./useStripoNotifications.js";
9
+ import { useToaster as J } from "./useToaster.js";
10
+ import { localePatch as K } from "../config/i18n/index.js";
11
+ import { en as B } from "../config/i18n/en/index.js";
12
+ import { ToasterTypeOptions as Q } from "../enums/toaster.js";
13
+ import { useStripoApi as W } from "../services/stripoApi.js";
14
+ import Y from "../static/styles/customEditorStyle.css.js";
15
+ import { useEditorStore as v } from "../stores/editor.js";
16
+ import { buildMergeTagEntries as Z, flattenDynamicContentList as ee } from "../utils/genericUtil.js";
17
+ import { getStripoRuntimeBaseUrl as te } from "../utils/stripoRuntime.js";
18
+ let d = null, T = !1;
19
+ const we = (e) => {
20
+ const { features: u, template: m, isFeatureEnabled: p } = j(), { handleError: f, showToaster: F } = J(), { getToken: A, getCustomFonts: P, getSyncModulesStatus: R } = W(), { handleEvent: U } = G(), { handleModuleAdd: V } = $(), { getStripoBlocksConfig: D } = N(), { getStripoNotifications: I } = X(), g = () => d || (d = new Promise((a, s) => {
22
21
  if (document.getElementById("UiEditorScript")) {
23
- r();
22
+ a();
24
23
  return;
25
24
  }
26
- const o = Z.guido, i = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
27
- e.id = "UiEditorScript", e.type = "module", e.src = i, e.onload = () => r(), e.onerror = () => {
28
- e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${i}`));
29
- }, document.body.appendChild(e);
30
- }), n.catch(() => {
31
- n = null;
32
- }), n), D = async (r, s, o, a = [], i = !1) => {
33
- var y, E, h, C;
34
- const e = k(), { html: d, css: P } = r, { baseBlocks: g, extensions: R } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
35
- w().importCss(), await window.UIEditor.initEditor(
25
+ const i = te();
26
+ if (!i) {
27
+ s(
28
+ new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
29
+ );
30
+ return;
31
+ }
32
+ const n = `${i}UIEditor.js`, t = document.createElement("script");
33
+ t.id = "UiEditorScript", t.type = "module", t.src = n, t.onload = () => {
34
+ T = !0, a();
35
+ }, t.onerror = () => {
36
+ t.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${n}`));
37
+ }, document.body.appendChild(t);
38
+ }), d.catch(() => {
39
+ d = null;
40
+ }), d), L = async (a, s, i, n = [], t = !1) => {
41
+ var C, w, k, b;
42
+ const o = v(), { html: c, css: S } = a, { baseBlocks: y, extensions: q } = await D();
43
+ e.mark("blocks_config_ready");
44
+ const E = ((C = u.value) == null ? void 0 : C.displayConditions) ?? !0, x = ((w = u.value) == null ? void 0 : w.modulesDisabled) ?? !1, h = !!c || (((k = m.value) == null ? void 0 : k.forceRecreate) ?? !1), O = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
45
+ e.setTemplate({ html: c, css: S, forceRecreate: h }), _().importCss(), e.mark("init_editor"), await window.UIEditor.initEditor(
36
46
  document.querySelector("#guido-editor"),
37
47
  {
38
48
  metadata: s,
39
- html: d,
40
- css: P,
41
- forceRecreate: I,
49
+ html: c,
50
+ css: S,
51
+ forceRecreate: h,
42
52
  locale: "en",
43
53
  undoButtonSelector: "#guido__undo-button",
44
54
  redoButtonSelector: "#guido__redo-button",
@@ -48,12 +58,12 @@ const he = () => {
48
58
  customAppearanceMergetags: !p("liquidSyntax"),
49
59
  customAppearanceMergetagsBorderColor: "#f1f3fe",
50
60
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
51
- customViewStyles: Q,
52
- conditionsEnabled: S,
53
- customConditionsEnabled: S,
61
+ customViewStyles: Y,
62
+ conditionsEnabled: E,
63
+ customConditionsEnabled: E,
54
64
  enableXSSSecurity: !0,
55
- modulesDisabled: U,
56
- syncModulesEnabled: i,
65
+ modulesDisabled: x,
66
+ syncModulesEnabled: t,
57
67
  messageSettingsEnabled: !0,
58
68
  displayGmailAnnotations: !0,
59
69
  displayHiddenPreheader: !1,
@@ -63,55 +73,56 @@ const he = () => {
63
73
  copyPasteEnabled: !1,
64
74
  selectElementAfterDrop: !0,
65
75
  sameFontSizeForOutlook: !0,
66
- allowedScriptSourceDomains: q,
67
- ...g ? { baseBlocks: g } : {},
76
+ allowedScriptSourceDomains: O,
77
+ ...y ? { baseBlocks: y } : {},
68
78
  editorFonts: {
69
79
  showDefaultStandardFonts: !0,
70
80
  showDefaultNotStandardFonts: !0,
71
- customFonts: a
81
+ customFonts: n
72
82
  },
73
83
  mergeTags: [
74
84
  {
75
- entries: W(
76
- o.preselectedDynamicContentList,
77
- Y((C = u.value) == null ? void 0 : C.dynamicContentList),
85
+ entries: Z(
86
+ i.preselectedDynamicContentList,
87
+ ee((b = m.value) == null ? void 0 : b.dynamicContentList),
78
88
  p("liquidSyntax")
79
89
  )
80
90
  }
81
91
  ],
82
- async onTokenRefreshRequest(t) {
92
+ async onTokenRefreshRequest(r) {
83
93
  try {
84
- const l = await B();
85
- t(l);
94
+ e.mark("token_start");
95
+ const l = await A();
96
+ e.mark("token_end"), r(l);
86
97
  } catch (l) {
87
- m(l, "Failed to refresh token");
98
+ f(l, "Failed to refresh token");
88
99
  }
89
100
  },
90
101
  onTemplateLoaded() {
91
102
  try {
92
- const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = L(), { injectFullStory: x } = N();
93
- w().importCss(), t(), x(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
94
- e.hasChanges = !1;
95
- }, 1e3);
96
- } catch (t) {
97
- m(t, "Failed to load custom interface appearance");
103
+ const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = M(), { injectFullStory: H } = z();
104
+ _().importCss(), r(), H(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
105
+ o.hasChanges = !1;
106
+ }, 1e3), e.markReady();
107
+ } catch (r) {
108
+ f(r, "Failed to load custom interface appearance");
98
109
  }
99
110
  },
100
- onCodeEditorVisibilityChanged(t) {
101
- e.isCodeEditorOpen = t;
111
+ onCodeEditorVisibilityChanged(r) {
112
+ o.isCodeEditorOpen = r;
102
113
  },
103
- onEditorVisualModeChanged(t) {
104
- e.editorVisualMode = t.toLowerCase();
114
+ onEditorVisualModeChanged(r) {
115
+ o.editorVisualMode = r.toLowerCase();
105
116
  },
106
- onVersionHistoryVisibilityChanged(t) {
107
- e.isVersionHistoryOpen = t;
117
+ onVersionHistoryVisibilityChanged(r) {
118
+ o.isVersionHistoryOpen = r;
108
119
  },
109
120
  onDataChanged() {
110
- e.hasChanges = !0, e.changeSeq += 1;
121
+ o.hasChanges = !0, o.changeSeq += 1;
111
122
  },
112
- onEvent: F,
113
- onModuleAdd: A,
114
- notifications: _(),
123
+ onEvent: U,
124
+ onModuleAdd: V,
125
+ notifications: I(),
115
126
  // Stripo deselects the block on any click outside the canvas, so every surface
116
127
  // that belongs to the block's own flow has to be listed here (SD-153273).
117
128
  ignoreClickOutsideSelectors: [
@@ -121,35 +132,35 @@ const he = () => {
121
132
  ".in-modal-v2-wrapper",
122
133
  ".in-toasts-wrapper"
123
134
  ],
124
- extensions: R,
125
- localePatch: J
135
+ extensions: q,
136
+ localePatch: K
126
137
  }
127
138
  );
128
139
  };
129
- return { initPlugin: async (r, s, o) => {
130
- const a = k();
140
+ return { initPlugin: async (a, s, i) => {
141
+ const n = v();
131
142
  try {
132
- await f();
133
- const [i, e] = await Promise.all([
134
- M(),
135
- T()
143
+ e.mark("plugin_start"), e.setScriptPreloaded(T), await g(), e.mark("script_ready");
144
+ const [t, o] = await Promise.all([
145
+ P(),
146
+ R()
136
147
  ]);
137
- a.syncModulesEnabled = e, await D(r, s, o, i, e);
148
+ e.mark("fonts_sync_ready"), n.syncModulesEnabled = o, await L(a, s, i, t, o);
138
149
  } catch {
139
- a.loadingStatus = !1, v({
140
- type: X.Error,
141
- message: b["An error has occurred. Please report the error code to support."],
150
+ n.loadingStatus = !1, F({
151
+ type: Q.Error,
152
+ message: B["An error has occurred. Please report the error code to support."],
142
153
  actionButton: {
143
- text: b["Reload page"],
154
+ text: B["Reload page"],
144
155
  onClick: () => window.location.reload()
145
156
  }
146
- });
157
+ }), e.markFailed();
147
158
  }
148
159
  }, preloadRuntime: () => {
149
- f().catch(() => {
160
+ g().catch(() => {
150
161
  });
151
162
  } };
152
163
  };
153
164
  export {
154
- he as useStripo
165
+ we as useStripo
155
166
  };