useblocks 1.1.46 → 1.1.49

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 (80) hide show
  1. package/iframe/js/amp.BP7EklKo.js +1 -0
  2. package/iframe/js/iframe-eblock.js +1 -1
  3. package/iframe/js/iframe.js +1 -1
  4. package/iframe/js/rules.4N5s3OV-.js +1 -1
  5. package/monacoeditorwork/css.worker.bundle.js +40524 -40442
  6. package/monacoeditorwork/editor.worker.bundle.js +9740 -9697
  7. package/monacoeditorwork/html.worker.bundle.js +50513 -50431
  8. package/monacoeditorwork/json.worker.bundle.js +14570 -14527
  9. package/monacoeditorwork/ts.worker.bundle.js +119593 -119455
  10. package/npm-publish.manifest.json +7 -7
  11. package/package.json +1 -1
  12. package/runtime/@ant-design/cssinjs/index.js +1 -1
  13. package/runtime/@ant-design/icons/index.js +2 -2
  14. package/runtime/README.md +1 -1
  15. package/runtime/THIRD_PARTY_LICENSES.txt +70 -42
  16. package/runtime/antd/index.js +1 -1
  17. package/runtime/react/index.js +3 -3
  18. package/runtime/react/jsx-runtime/index.js +1 -1
  19. package/runtime/react-dom/client/index.js +4 -4
  20. package/runtime/react-dom/index.js +3 -3
  21. package/runtime/react-router-dom/index.js +2 -2
  22. package/singlepage_headless_plugin.html +1 -1
  23. package/static/core/{cc8f145d.js → 11296a18.js} +55 -55
  24. package/static/core/{a321a57d.js → 13d197af.js} +26 -26
  25. package/static/core/13f581cc.js +924 -0
  26. package/static/core/{90ec6d2b2.js → 1ca5f3772.js} +184 -155
  27. package/static/core/{b9529b8a.js → 339377b8.js} +16684 -16503
  28. package/static/core/{6e2d88d5.js → 386cf7b3.js} +3573 -3559
  29. package/static/core/{6df04323.js → 3b4845f7.js} +537 -518
  30. package/static/core/{526b23c2.js → 3dea3b87.js} +7 -7
  31. package/static/core/59023866.js +2090 -0
  32. package/static/core/{4a2af478.js → 7a229b90.js} +3 -3
  33. package/static/core/{6b8432a3.js → 8c81db36.js} +3 -3
  34. package/static/core/{b8b730b2.js → 8e110c69.js} +22 -22
  35. package/static/core/{35e13192.js → a11c28c2.js} +172 -168
  36. package/static/core/{9c1c1b89.js → aacf134d.js} +745 -664
  37. package/static/core/{350eac23.js → acb049cb.js} +1349 -1297
  38. package/static/core/{cefd6620.js → c59f9731.js} +7640 -6595
  39. package/static/core/{4eb628d3.js → de79e0c5.js} +3947 -3705
  40. package/static/core/e7c24fe9.js +649 -0
  41. package/static/esm/{dab4cdfd.js → 448d4bb0.js} +70 -70
  42. package/static/esm/{7c5227f0.js → d180c108.js} +50 -47
  43. package/static/runtime/{DownloadOutlined-CgJ8OpH_.js → DownloadOutlined-Dg_G2xO7.js} +4 -4
  44. package/static/runtime/client-CfXgU5Vo.js +7580 -0
  45. package/static/runtime/{defineProperty-B-FyVNQF.js → defineProperty-C_9hhJHt.js} +1 -1
  46. package/static/runtime/dom-export-CHgQ7Ws9.js +8069 -0
  47. package/static/runtime/{es-DnZp8dh1.js → es-BPfImJ0x.js} +5 -5
  48. package/static/runtime/{es-B2DS-PLP.js → es-DcH6fwd6.js} +2 -2
  49. package/static/runtime/{es-deqzngIL.js → es-_OY-D9g1.js} +2 -2
  50. package/static/runtime/{jsx-dev-runtime-Wj1_6O79.js → jsx-dev-runtime-DDukXY54.js} +2 -2
  51. package/static/runtime/jsx-runtime-BodCQYDg.js +22 -0
  52. package/static/runtime/react-BHNx_xzv.js +290 -0
  53. package/static/runtime/react-dom-CyByzibb.js +127 -0
  54. package/two_step_headless_plugin.html +1 -1
  55. package/{useblocks-core.2116f1b9.js → useblocks-core.15a9129c.js} +82 -76
  56. package/useblocks-esm.js +628 -3198
  57. package/useblocks.d.ts +184 -52
  58. package/useblocks.js +818 -12588
  59. package/vite/index.cjs +46 -21
  60. package/vite/index.d.ts +0 -1
  61. package/vite/index.js +46 -21
  62. package/vite/pluginDev/index.d.ts +0 -1
  63. package/webpack/index.cjs +46 -21
  64. package/webpack/index.d.ts +0 -1
  65. package/webpack/index.js +46 -21
  66. package/webpack/pluginDev/index.d.ts +0 -1
  67. package/iframe/js/amp.CVC2Iq48.js +0 -1
  68. package/static/core/9421a704.js +0 -869
  69. package/static/core/9c79239d.js +0 -2063
  70. package/static/core/df0652cc.js +0 -1119
  71. package/static/esm/2fb07398.js +0 -3480
  72. package/static/esm/352121c5.js +0 -55
  73. package/static/esm/64966e1c.js +0 -18
  74. package/static/runtime/client-CM3WFcip.js +0 -7
  75. package/static/runtime/dist-DUS42Hru.js +0 -3421
  76. package/static/runtime/jsx-runtime-DmPQfqtr.js +0 -28
  77. package/static/runtime/react-DIf5CLST.js +0 -258
  78. package/static/runtime/react-dom-Cc3IcUkg.js +0 -5604
  79. /package/iframe/{iframe-eblock.2116f1b9.html → iframe-eblock.15a9129c.html} +0 -0
  80. /package/iframe/{iframe.2116f1b9.html → iframe.15a9129c.html} +0 -0
package/useblocks-esm.js CHANGED
@@ -1,123 +1,121 @@
1
- import { a as Xr, c as lt, d as Rt, i as h, l as Pe, n as $r, o as Se, r as Nt, s as F, t as Wr, u as Bt } from "./static/esm/7c5227f0.js";
2
- import { a as P, i as Lt, n as Ft, r as ke, t as O } from "./static/esm/dab4cdfd.js";
3
- import { a as ie, i as jt, n as $, r as qt, t as W } from "./static/esm/2fb07398.js";
4
- import { t as Ut } from "./static/esm/352121c5.js";
5
- import { useEffect as Ce, useMemo as st, useRef as Gt, useState as xe } from "useblocks/runtime/react";
1
+ import { a as X, i as A, n as Me, r as Te, t as qe } from "./static/esm/d180c108.js";
2
+ import { a as v, i as Y, n as Q, r as C, t as w } from "./static/esm/448d4bb0.js";
6
3
  (function() {
7
4
  "use strict";
8
- var t = window.__useblocks__ = window.__useblocks__ || {};
9
- t.__facadeSentinel = "@shared-runtime:init-complete", __useblocks__.publicPath || (__useblocks__.publicPath = (function() {
10
- var s = (function() {
5
+ var e = window.__useblocks__ = window.__useblocks__ || {};
6
+ e.__facadeSentinel = "@shared-runtime:init-complete", e.publicPath || (e.publicPath = (function() {
7
+ var t = (function() {
11
8
  if (typeof document < "u" && document.querySelector) try {
12
- var d = document.querySelector("script[src*=\"useblocks-esm.js\"]") || document.querySelector("script[src*=\"useblocks.js\"]");
13
- if (d && d.src) return d.src.substring(0, d.src.lastIndexOf("/") + 1);
9
+ var f = document.querySelector("script[src*=\"useblocks-esm.js\"]") || document.querySelector("script[src*=\"useblocks.js\"]");
10
+ if (f && f.src) return f.src.substring(0, f.src.lastIndexOf("/") + 1);
14
11
  } catch {}
15
12
  try {
16
- var E = import.meta.url;
17
- if (E) return E.substring(0, E.lastIndexOf("/") + 1);
13
+ var m = import.meta.url;
14
+ if (m) return m.substring(0, m.lastIndexOf("/") + 1);
18
15
  } catch {}
19
16
  return "./";
20
17
  })();
21
- s || (s = "./");
18
+ t || (t = "./");
22
19
  try {
23
- var l = String(s);
24
- if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(l) || l.indexOf("//") === 0) return l;
25
- var u = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "";
26
- return u ? new URL(l, u).href : l;
20
+ var n = String(t);
21
+ if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n) || n.indexOf("//") === 0) return n.charAt(n.length - 1) === "/" ? n : n + "/";
22
+ var r = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "", i = r ? new URL(n, r).href : n;
23
+ return i.charAt(i.length - 1) === "/" ? i : i + "/";
27
24
  } catch {
28
- return String(s);
25
+ var l = String(t);
26
+ return l.charAt(l.length - 1) === "/" ? l : l + "/";
29
27
  }
30
- })()), typeof __useblocks__.setPublicPath != "function" && (__useblocks__.setPublicPath = function(s) {
31
- var l = s == null ? "" : String(s);
32
- l || (l = "./");
33
- try {
34
- var u = l;
35
- if (!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(u) && u.indexOf("//") !== 0) {
36
- var d = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "";
37
- u = d ? new URL(u, d).href : u;
28
+ })()), typeof e.setPublicPath != "function" && (e.setPublicPath = function(t) {
29
+ return e.publicPath = (function() {
30
+ var n = t == null ? "" : String(t);
31
+ n || (n = "./");
32
+ try {
33
+ var r = String(n);
34
+ if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(r) || r.indexOf("//") === 0) return r.charAt(r.length - 1) === "/" ? r : r + "/";
35
+ var i = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "", l = i ? new URL(r, i).href : r;
36
+ return l.charAt(l.length - 1) === "/" ? l : l + "/";
37
+ } catch {
38
+ var f = String(n);
39
+ return f.charAt(f.length - 1) === "/" ? f : f + "/";
38
40
  }
39
- __useblocks__.publicPath = u.charAt(u.length - 1) === "/" ? u : u + "/";
40
- } catch {
41
- __useblocks__.publicPath = l;
42
- }
43
- return __useblocks__.publicPath;
44
- }), __useblocks__.__publicPathDiagnosticsLogged || (__useblocks__.__publicPathDiagnosticsLogged = !0, (function() {
45
- var s = String(__useblocks__.publicPath || "");
46
- if (s.indexOf("file:") !== 0 && !(s && s !== "./")) try {
41
+ })(), e.publicPath;
42
+ }), e.__publicPathDiagnosticsLogged || (e.__publicPathDiagnosticsLogged = !0, (function() {
43
+ var t = String(e.publicPath || "");
44
+ if (t.indexOf("file:") !== 0 && !(t && t !== "./")) try {
47
45
  if (typeof window < "u") {
48
- for (var u in window) if (!(u === "__useblocks__" || !/^__[^_].*__$/.test(u))) {
49
- var d;
46
+ for (var r in window) if (!(r === "__useblocks__" || !/^__[^_].*__$/.test(r))) {
47
+ var i;
50
48
  try {
51
- d = window[u];
49
+ i = window[r];
52
50
  } catch {
53
51
  continue;
54
52
  }
55
- if (d && typeof d == "object" && d.publicPath) {
56
- "" + u;
53
+ if (i && typeof i == "object" && i.publicPath) {
54
+ "" + r;
57
55
  break;
58
56
  }
59
57
  }
60
58
  }
61
59
  } catch {}
62
- })()), __useblocks__.assetUrl || (__useblocks__.assetUrl = function(s) {
63
- function l(I) {
60
+ })()), e.assetUrl || (e.assetUrl = function(t) {
61
+ function n(y) {
64
62
  try {
65
- var N = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "";
66
- return N ? new URL(String(I || ""), N).href : String(I || "");
63
+ var T = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "";
64
+ return T ? new URL(String(y || ""), T).href : String(y || "");
67
65
  } catch {
68
- return String(I || "");
66
+ return String(y || "");
69
67
  }
70
68
  }
71
- var u = String(s || "");
72
- if (!u) return "";
73
- if (/^(?:data:|blob:)/.test(u)) return u;
74
- if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(u) || u.indexOf("//") === 0 || u.charAt(0) === "/") return l(u);
75
- var d = u.replace(/^\.\/+/, "").replace(/^\/+/, ""), E = "static/media".replace(/^\.\/+/, "").replace(/^\/+/, "").replace(/\/+$/, ""), b = E && d.indexOf(E + "/") !== 0 ? E + "/" + d : d, g = __useblocks__.publicPath || "./";
69
+ var r = String(t || "");
70
+ if (!r) return "";
71
+ if (/^(?:data:|blob:)/.test(r)) return r;
72
+ if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(r) || r.indexOf("//") === 0 || r.charAt(0) === "/") return n(r);
73
+ var i = r.replace(/^\.\/+/, "").replace(/^\/+/, ""), l = "static/media".replace(/^\.\/+/, "").replace(/^\/+/, "").replace(/\/+$/, ""), f = l && i.indexOf(l + "/") !== 0 ? l + "/" + i : i, m = e.publicPath || "./";
76
74
  try {
77
- return new URL(b, g).href;
75
+ return new URL(f, m).href;
78
76
  } catch {
79
- return g.slice(-1) !== "/" && (g += "/"), l(g + b);
77
+ return m.slice(-1) !== "/" && (m += "/"), n(m + f);
80
78
  }
81
- }), t.version || (t.version = "1.1.46");
82
- var e = t.modules = /* @__PURE__ */ Object.create(null), n = import("./runtime/index.js"), r = import("./ui-kit/index.js");
83
- e.React = n.then(function(s) {
84
- return s.React;
85
- }), e.ReactDom = n.then(function(s) {
86
- return s.ReactDom;
87
- }), e.ReactDomClient = n.then(function(s) {
88
- return s.ReactDomClient;
89
- }), e.ReactJsxRuntime = n.then(function(s) {
90
- return s.ReactJsxRuntime;
91
- }), e.ReactJsxDevRuntime = n.then(function(s) {
92
- return s.ReactJsxDevRuntime;
93
- }), e.PropTypes = n.then(function(s) {
94
- return s.PropTypes;
95
- }), e.ReactRouterDom = n.then(function(s) {
96
- return s.ReactRouterDom;
97
- }), e.Antd = n.then(function(s) {
98
- return s.Antd;
99
- }), e.AntDesignIcons = n.then(function(s) {
100
- return s.AntDesignIcons;
101
- }), e.AntDesignCssinjs = n.then(function(s) {
102
- return s.AntDesignCssinjs;
103
- }), e.Classnames = n.then(function(s) {
104
- return s.Classnames;
105
- }), e.Dayjs = n.then(function(s) {
106
- return s.Dayjs;
107
- }), e.Uuid = n.then(function(s) {
108
- return s.Uuid;
109
- }), e.UiKit = r.then(function(s) {
110
- return s.UiKit !== void 0 ? s.UiKit : s;
79
+ }), e.version || (e.version = "1.1.49");
80
+ var o = e.modules = /* @__PURE__ */ Object.create(null), a = import("./runtime/index.js"), c = import("./ui-kit/index.js");
81
+ o.React = a.then(function(t) {
82
+ return t.React;
83
+ }), o.ReactDom = a.then(function(t) {
84
+ return t.ReactDom;
85
+ }), o.ReactDomClient = a.then(function(t) {
86
+ return t.ReactDomClient;
87
+ }), o.ReactJsxRuntime = a.then(function(t) {
88
+ return t.ReactJsxRuntime;
89
+ }), o.ReactJsxDevRuntime = a.then(function(t) {
90
+ return t.ReactJsxDevRuntime;
91
+ }), o.PropTypes = a.then(function(t) {
92
+ return t.PropTypes;
93
+ }), o.ReactRouterDom = a.then(function(t) {
94
+ return t.ReactRouterDom;
95
+ }), o.Antd = a.then(function(t) {
96
+ return t.Antd;
97
+ }), o.AntDesignIcons = a.then(function(t) {
98
+ return t.AntDesignIcons;
99
+ }), o.AntDesignCssinjs = a.then(function(t) {
100
+ return t.AntDesignCssinjs;
101
+ }), o.Classnames = a.then(function(t) {
102
+ return t.Classnames;
103
+ }), o.Dayjs = a.then(function(t) {
104
+ return t.Dayjs;
105
+ }), o.Uuid = a.then(function(t) {
106
+ return t.Uuid;
107
+ }), o.UiKit = c.then(function(t) {
108
+ return t.UiKit !== void 0 ? t.UiKit : t;
111
109
  });
112
- var o = Promise.all([n, r]).then(function(s) {
113
- var l = s[0] || /* @__PURE__ */ Object.create(null), u = /* @__PURE__ */ Object.create(null);
114
- for (var d in l) Object.prototype.hasOwnProperty.call(l, d) && (u[d] = l[d]);
115
- var E = s[1] || /* @__PURE__ */ Object.create(null);
116
- u.UiKit = E.UiKit !== void 0 ? E.UiKit : E;
117
- for (var b in u) Object.prototype.hasOwnProperty.call(u, b) && (e[b] = u[b]);
118
- return u;
119
- }), i = e, a = o;
120
- if (typeof t.define != "function") new Function("__amdEnv", `/**
110
+ var d = Promise.all([a, c]).then(function(t) {
111
+ var n = t[0] || /* @__PURE__ */ Object.create(null), r = /* @__PURE__ */ Object.create(null);
112
+ for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (r[i] = n[i]);
113
+ var l = t[1] || /* @__PURE__ */ Object.create(null);
114
+ r.UiKit = l.UiKit !== void 0 ? l.UiKit : l;
115
+ for (var f in r) Object.prototype.hasOwnProperty.call(r, f) && (o[f] = r[f]);
116
+ return r;
117
+ }), s = o, u = d;
118
+ if (typeof e.define != "function") new Function("__amdEnv", `/**
121
119
  * Async AMD Loader (IIFE version for injection)
122
120
  *
123
121
  * This file is injected at the beginning of iframe entry points.
@@ -354,6 +352,7 @@ import { useEffect as Ce, useMemo as st, useRef as Gt, useState as xe } from "us
354
352
  }
355
353
 
356
354
  function normalizeRuntimeUrl(url) {
355
+ // SSOT: build-tools/plugins/shared/publicPathResolve.ts
357
356
  var normalizedUrl = String(url || '');
358
357
  if (!normalizedUrl) {
359
358
  return normalizedUrl;
@@ -788,365 +787,365 @@ import { useEffect as Ce, useMemo as st, useRef as Gt, useState as xe } from "us
788
787
  __amdEnv.require = require;
789
788
  __amdEnv.syncRequire = syncRequire;
790
789
  })();
791
- `)(t), typeof t.require == "function" && typeof t.require.config == "function" && t.require.config({
790
+ `)(e), typeof e.require == "function" && typeof e.require.config == "function" && e.require.config({
792
791
  baseUrl: "./",
793
- paths: { core: "useblocks-core.2116f1b9.js" }
792
+ paths: { core: "useblocks-core.15a9129c.js" }
794
793
  });
795
- var p = typeof t.prefetch == "function" ? t.prefetch : void 0;
796
- if (t.prefetch = function() {
797
- return o.then(function() {
798
- if (typeof p == "function") return p.call(t);
794
+ var h = typeof e.prefetch == "function" ? e.prefetch : void 0;
795
+ if (e.prefetch = function() {
796
+ return d.then(function() {
797
+ if (typeof h == "function") return h.call(e);
799
798
  });
800
- }, typeof t.define == "function") {
801
- let s = function(l) {
802
- if (!l || typeof l != "object" && typeof l != "function" || l.__esModule) return l;
803
- if (m) {
804
- var u = m.get(l);
805
- if (u) return u;
799
+ }, typeof e.define == "function") {
800
+ let t = function(n) {
801
+ if (!n || typeof n != "object" && typeof n != "function" || n.__esModule) return n;
802
+ if (p) {
803
+ var r = p.get(n);
804
+ if (r) return r;
806
805
  }
807
- var d = /* @__PURE__ */ Object.create(null);
808
- Object.defineProperties(d, {
806
+ var i = /* @__PURE__ */ Object.create(null);
807
+ Object.defineProperties(i, {
809
808
  __esModule: { value: !0 },
810
809
  [Symbol.toStringTag]: { value: "Module" }
811
810
  });
812
- for (var E = Reflect.ownKeys(l), b = 0; b < E.length; b++) {
813
- var g = E[b];
814
- if (g !== "__esModule") {
815
- var I = Object.getOwnPropertyDescriptor(l, g);
816
- I && Object.defineProperty(d, g, I);
811
+ for (var l = Reflect.ownKeys(n), f = 0; f < l.length; f++) {
812
+ var m = l[f];
813
+ if (m !== "__esModule") {
814
+ var y = Object.getOwnPropertyDescriptor(n, m);
815
+ y && Object.defineProperty(i, m, y);
817
816
  }
818
817
  }
819
- return Object.prototype.hasOwnProperty.call(d, "default") || Object.defineProperty(d, "default", {
818
+ return Object.prototype.hasOwnProperty.call(i, "default") || Object.defineProperty(i, "default", {
820
819
  enumerable: !0,
821
- value: l,
820
+ value: n,
822
821
  writable: !1
823
- }), m && m.set(l, d), d;
822
+ }), p && p.set(n, i), i;
824
823
  };
825
- var m = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : null;
826
- t.define("react", [], function() {
827
- var l = i.React;
828
- return l && typeof l.then == "function" ? a.then(function(u) {
829
- var d = u.React;
830
- return s(d);
831
- }) : l !== void 0 ? s(l) : a.then(function(u) {
832
- var d = u.React;
833
- return s(d);
824
+ var p = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : null;
825
+ e.define("react", [], function() {
826
+ var n = s.React;
827
+ return n && typeof n.then == "function" ? u.then(function(r) {
828
+ var i = r.React;
829
+ return t(i);
830
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
831
+ var i = r.React;
832
+ return t(i);
834
833
  });
835
- }), t.define("useblocks/runtime/react", [], function() {
836
- var l = i.React;
837
- return l && typeof l.then == "function" ? a.then(function(u) {
838
- var d = u.React;
839
- return s(d);
840
- }) : l !== void 0 ? s(l) : a.then(function(u) {
841
- var d = u.React;
842
- return s(d);
834
+ }), e.define("useblocks/runtime/react", [], function() {
835
+ var n = s.React;
836
+ return n && typeof n.then == "function" ? u.then(function(r) {
837
+ var i = r.React;
838
+ return t(i);
839
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
840
+ var i = r.React;
841
+ return t(i);
843
842
  });
844
- }), t.define("react-dom", [], function() {
845
- var l = i.ReactDom;
846
- return l && typeof l.then == "function" ? a.then(function(u) {
847
- var d = u.ReactDom;
848
- return s(d);
849
- }) : l !== void 0 ? s(l) : a.then(function(u) {
850
- var d = u.ReactDom;
851
- return s(d);
843
+ }), e.define("react-dom", [], function() {
844
+ var n = s.ReactDom;
845
+ return n && typeof n.then == "function" ? u.then(function(r) {
846
+ var i = r.ReactDom;
847
+ return t(i);
848
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
849
+ var i = r.ReactDom;
850
+ return t(i);
852
851
  });
853
- }), t.define("useblocks/runtime/react-dom", [], function() {
854
- var l = i.ReactDom;
855
- return l && typeof l.then == "function" ? a.then(function(u) {
856
- var d = u.ReactDom;
857
- return s(d);
858
- }) : l !== void 0 ? s(l) : a.then(function(u) {
859
- var d = u.ReactDom;
860
- return s(d);
852
+ }), e.define("useblocks/runtime/react-dom", [], function() {
853
+ var n = s.ReactDom;
854
+ return n && typeof n.then == "function" ? u.then(function(r) {
855
+ var i = r.ReactDom;
856
+ return t(i);
857
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
858
+ var i = r.ReactDom;
859
+ return t(i);
861
860
  });
862
- }), t.define("react-dom/client", [], function() {
863
- var l = i.ReactDomClient;
864
- return l && typeof l.then == "function" ? a.then(function(u) {
865
- var d = u.ReactDomClient;
866
- return s(d);
867
- }) : l !== void 0 ? s(l) : a.then(function(u) {
868
- var d = u.ReactDomClient;
869
- return s(d);
861
+ }), e.define("react-dom/client", [], function() {
862
+ var n = s.ReactDomClient;
863
+ return n && typeof n.then == "function" ? u.then(function(r) {
864
+ var i = r.ReactDomClient;
865
+ return t(i);
866
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
867
+ var i = r.ReactDomClient;
868
+ return t(i);
870
869
  });
871
- }), t.define("useblocks/runtime/react-dom/client", [], function() {
872
- var l = i.ReactDomClient;
873
- return l && typeof l.then == "function" ? a.then(function(u) {
874
- var d = u.ReactDomClient;
875
- return s(d);
876
- }) : l !== void 0 ? s(l) : a.then(function(u) {
877
- var d = u.ReactDomClient;
878
- return s(d);
870
+ }), e.define("useblocks/runtime/react-dom/client", [], function() {
871
+ var n = s.ReactDomClient;
872
+ return n && typeof n.then == "function" ? u.then(function(r) {
873
+ var i = r.ReactDomClient;
874
+ return t(i);
875
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
876
+ var i = r.ReactDomClient;
877
+ return t(i);
879
878
  });
880
- }), t.define("react/jsx-runtime", [], function() {
881
- var l = i.ReactJsxRuntime;
882
- return l && typeof l.then == "function" ? a.then(function(u) {
883
- var d = u.ReactJsxRuntime;
884
- return s(d);
885
- }) : l !== void 0 ? s(l) : a.then(function(u) {
886
- var d = u.ReactJsxRuntime;
887
- return s(d);
879
+ }), e.define("react/jsx-runtime", [], function() {
880
+ var n = s.ReactJsxRuntime;
881
+ return n && typeof n.then == "function" ? u.then(function(r) {
882
+ var i = r.ReactJsxRuntime;
883
+ return t(i);
884
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
885
+ var i = r.ReactJsxRuntime;
886
+ return t(i);
888
887
  });
889
- }), t.define("useblocks/runtime/react/jsx-runtime", [], function() {
890
- var l = i.ReactJsxRuntime;
891
- return l && typeof l.then == "function" ? a.then(function(u) {
892
- var d = u.ReactJsxRuntime;
893
- return s(d);
894
- }) : l !== void 0 ? s(l) : a.then(function(u) {
895
- var d = u.ReactJsxRuntime;
896
- return s(d);
888
+ }), e.define("useblocks/runtime/react/jsx-runtime", [], function() {
889
+ var n = s.ReactJsxRuntime;
890
+ return n && typeof n.then == "function" ? u.then(function(r) {
891
+ var i = r.ReactJsxRuntime;
892
+ return t(i);
893
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
894
+ var i = r.ReactJsxRuntime;
895
+ return t(i);
897
896
  });
898
- }), t.define("react/jsx-dev-runtime", [], function() {
899
- var l = i.ReactJsxDevRuntime;
900
- return l && typeof l.then == "function" ? a.then(function(u) {
901
- var d = u.ReactJsxDevRuntime;
902
- return s(d);
903
- }) : l !== void 0 ? s(l) : a.then(function(u) {
904
- var d = u.ReactJsxDevRuntime;
905
- return s(d);
897
+ }), e.define("react/jsx-dev-runtime", [], function() {
898
+ var n = s.ReactJsxDevRuntime;
899
+ return n && typeof n.then == "function" ? u.then(function(r) {
900
+ var i = r.ReactJsxDevRuntime;
901
+ return t(i);
902
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
903
+ var i = r.ReactJsxDevRuntime;
904
+ return t(i);
906
905
  });
907
- }), t.define("useblocks/runtime/react/jsx-dev-runtime", [], function() {
908
- var l = i.ReactJsxDevRuntime;
909
- return l && typeof l.then == "function" ? a.then(function(u) {
910
- var d = u.ReactJsxDevRuntime;
911
- return s(d);
912
- }) : l !== void 0 ? s(l) : a.then(function(u) {
913
- var d = u.ReactJsxDevRuntime;
914
- return s(d);
906
+ }), e.define("useblocks/runtime/react/jsx-dev-runtime", [], function() {
907
+ var n = s.ReactJsxDevRuntime;
908
+ return n && typeof n.then == "function" ? u.then(function(r) {
909
+ var i = r.ReactJsxDevRuntime;
910
+ return t(i);
911
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
912
+ var i = r.ReactJsxDevRuntime;
913
+ return t(i);
915
914
  });
916
- }), t.define("prop-types", [], function() {
917
- var l = i.PropTypes;
918
- return l && typeof l.then == "function" ? a.then(function(u) {
919
- var d = u.PropTypes;
920
- return s(d);
921
- }) : l !== void 0 ? s(l) : a.then(function(u) {
922
- var d = u.PropTypes;
923
- return s(d);
915
+ }), e.define("prop-types", [], function() {
916
+ var n = s.PropTypes;
917
+ return n && typeof n.then == "function" ? u.then(function(r) {
918
+ var i = r.PropTypes;
919
+ return t(i);
920
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
921
+ var i = r.PropTypes;
922
+ return t(i);
924
923
  });
925
- }), t.define("useblocks/runtime/prop-types", [], function() {
926
- var l = i.PropTypes;
927
- return l && typeof l.then == "function" ? a.then(function(u) {
928
- var d = u.PropTypes;
929
- return s(d);
930
- }) : l !== void 0 ? s(l) : a.then(function(u) {
931
- var d = u.PropTypes;
932
- return s(d);
924
+ }), e.define("useblocks/runtime/prop-types", [], function() {
925
+ var n = s.PropTypes;
926
+ return n && typeof n.then == "function" ? u.then(function(r) {
927
+ var i = r.PropTypes;
928
+ return t(i);
929
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
930
+ var i = r.PropTypes;
931
+ return t(i);
933
932
  });
934
- }), t.define("react-router-dom", [], function() {
935
- var l = i.ReactRouterDom;
936
- return l && typeof l.then == "function" ? a.then(function(u) {
937
- var d = u.ReactRouterDom;
938
- return s(d);
939
- }) : l !== void 0 ? s(l) : a.then(function(u) {
940
- var d = u.ReactRouterDom;
941
- return s(d);
933
+ }), e.define("react-router-dom", [], function() {
934
+ var n = s.ReactRouterDom;
935
+ return n && typeof n.then == "function" ? u.then(function(r) {
936
+ var i = r.ReactRouterDom;
937
+ return t(i);
938
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
939
+ var i = r.ReactRouterDom;
940
+ return t(i);
942
941
  });
943
- }), t.define("useblocks/runtime/react-router-dom", [], function() {
944
- var l = i.ReactRouterDom;
945
- return l && typeof l.then == "function" ? a.then(function(u) {
946
- var d = u.ReactRouterDom;
947
- return s(d);
948
- }) : l !== void 0 ? s(l) : a.then(function(u) {
949
- var d = u.ReactRouterDom;
950
- return s(d);
942
+ }), e.define("useblocks/runtime/react-router-dom", [], function() {
943
+ var n = s.ReactRouterDom;
944
+ return n && typeof n.then == "function" ? u.then(function(r) {
945
+ var i = r.ReactRouterDom;
946
+ return t(i);
947
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
948
+ var i = r.ReactRouterDom;
949
+ return t(i);
951
950
  });
952
- }), t.define("antd", [], function() {
953
- var l = i.Antd;
954
- return l && typeof l.then == "function" ? a.then(function(u) {
955
- var d = u.Antd;
956
- return s(d);
957
- }) : l !== void 0 ? s(l) : a.then(function(u) {
958
- var d = u.Antd;
959
- return s(d);
951
+ }), e.define("antd", [], function() {
952
+ var n = s.Antd;
953
+ return n && typeof n.then == "function" ? u.then(function(r) {
954
+ var i = r.Antd;
955
+ return t(i);
956
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
957
+ var i = r.Antd;
958
+ return t(i);
960
959
  });
961
- }), t.define("useblocks/runtime/antd", [], function() {
962
- var l = i.Antd;
963
- return l && typeof l.then == "function" ? a.then(function(u) {
964
- var d = u.Antd;
965
- return s(d);
966
- }) : l !== void 0 ? s(l) : a.then(function(u) {
967
- var d = u.Antd;
968
- return s(d);
960
+ }), e.define("useblocks/runtime/antd", [], function() {
961
+ var n = s.Antd;
962
+ return n && typeof n.then == "function" ? u.then(function(r) {
963
+ var i = r.Antd;
964
+ return t(i);
965
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
966
+ var i = r.Antd;
967
+ return t(i);
969
968
  });
970
- }), t.define("@ant-design/icons", [], function() {
971
- var l = i.AntDesignIcons;
972
- return l && typeof l.then == "function" ? a.then(function(u) {
973
- var d = u.AntDesignIcons;
974
- return s(d);
975
- }) : l !== void 0 ? s(l) : a.then(function(u) {
976
- var d = u.AntDesignIcons;
977
- return s(d);
969
+ }), e.define("@ant-design/icons", [], function() {
970
+ var n = s.AntDesignIcons;
971
+ return n && typeof n.then == "function" ? u.then(function(r) {
972
+ var i = r.AntDesignIcons;
973
+ return t(i);
974
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
975
+ var i = r.AntDesignIcons;
976
+ return t(i);
978
977
  });
979
- }), t.define("useblocks/runtime/@ant-design/icons", [], function() {
980
- var l = i.AntDesignIcons;
981
- return l && typeof l.then == "function" ? a.then(function(u) {
982
- var d = u.AntDesignIcons;
983
- return s(d);
984
- }) : l !== void 0 ? s(l) : a.then(function(u) {
985
- var d = u.AntDesignIcons;
986
- return s(d);
978
+ }), e.define("useblocks/runtime/@ant-design/icons", [], function() {
979
+ var n = s.AntDesignIcons;
980
+ return n && typeof n.then == "function" ? u.then(function(r) {
981
+ var i = r.AntDesignIcons;
982
+ return t(i);
983
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
984
+ var i = r.AntDesignIcons;
985
+ return t(i);
987
986
  });
988
- }), t.define("@ant-design/cssinjs", [], function() {
989
- var l = i.AntDesignCssinjs;
990
- return l && typeof l.then == "function" ? a.then(function(u) {
991
- var d = u.AntDesignCssinjs;
992
- return s(d);
993
- }) : l !== void 0 ? s(l) : a.then(function(u) {
994
- var d = u.AntDesignCssinjs;
995
- return s(d);
987
+ }), e.define("@ant-design/cssinjs", [], function() {
988
+ var n = s.AntDesignCssinjs;
989
+ return n && typeof n.then == "function" ? u.then(function(r) {
990
+ var i = r.AntDesignCssinjs;
991
+ return t(i);
992
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
993
+ var i = r.AntDesignCssinjs;
994
+ return t(i);
996
995
  });
997
- }), t.define("useblocks/runtime/@ant-design/cssinjs", [], function() {
998
- var l = i.AntDesignCssinjs;
999
- return l && typeof l.then == "function" ? a.then(function(u) {
1000
- var d = u.AntDesignCssinjs;
1001
- return s(d);
1002
- }) : l !== void 0 ? s(l) : a.then(function(u) {
1003
- var d = u.AntDesignCssinjs;
1004
- return s(d);
996
+ }), e.define("useblocks/runtime/@ant-design/cssinjs", [], function() {
997
+ var n = s.AntDesignCssinjs;
998
+ return n && typeof n.then == "function" ? u.then(function(r) {
999
+ var i = r.AntDesignCssinjs;
1000
+ return t(i);
1001
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
1002
+ var i = r.AntDesignCssinjs;
1003
+ return t(i);
1005
1004
  });
1006
- }), t.define("classnames", [], function() {
1007
- var l = i.Classnames;
1008
- return l && typeof l.then == "function" ? a.then(function(u) {
1009
- var d = u.Classnames;
1010
- return s(d);
1011
- }) : l !== void 0 ? s(l) : a.then(function(u) {
1012
- var d = u.Classnames;
1013
- return s(d);
1005
+ }), e.define("classnames", [], function() {
1006
+ var n = s.Classnames;
1007
+ return n && typeof n.then == "function" ? u.then(function(r) {
1008
+ var i = r.Classnames;
1009
+ return t(i);
1010
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
1011
+ var i = r.Classnames;
1012
+ return t(i);
1014
1013
  });
1015
- }), t.define("useblocks/runtime/classnames", [], function() {
1016
- var l = i.Classnames;
1017
- return l && typeof l.then == "function" ? a.then(function(u) {
1018
- var d = u.Classnames;
1019
- return s(d);
1020
- }) : l !== void 0 ? s(l) : a.then(function(u) {
1021
- var d = u.Classnames;
1022
- return s(d);
1014
+ }), e.define("useblocks/runtime/classnames", [], function() {
1015
+ var n = s.Classnames;
1016
+ return n && typeof n.then == "function" ? u.then(function(r) {
1017
+ var i = r.Classnames;
1018
+ return t(i);
1019
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
1020
+ var i = r.Classnames;
1021
+ return t(i);
1023
1022
  });
1024
- }), t.define("dayjs", [], function() {
1025
- var l = i.Dayjs;
1026
- return l && typeof l.then == "function" ? a.then(function(u) {
1027
- var d = u.Dayjs;
1028
- return s(d);
1029
- }) : l !== void 0 ? s(l) : a.then(function(u) {
1030
- var d = u.Dayjs;
1031
- return s(d);
1023
+ }), e.define("dayjs", [], function() {
1024
+ var n = s.Dayjs;
1025
+ return n && typeof n.then == "function" ? u.then(function(r) {
1026
+ var i = r.Dayjs;
1027
+ return t(i);
1028
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
1029
+ var i = r.Dayjs;
1030
+ return t(i);
1032
1031
  });
1033
- }), t.define("useblocks/runtime/dayjs", [], function() {
1034
- var l = i.Dayjs;
1035
- return l && typeof l.then == "function" ? a.then(function(u) {
1036
- var d = u.Dayjs;
1037
- return s(d);
1038
- }) : l !== void 0 ? s(l) : a.then(function(u) {
1039
- var d = u.Dayjs;
1040
- return s(d);
1032
+ }), e.define("useblocks/runtime/dayjs", [], function() {
1033
+ var n = s.Dayjs;
1034
+ return n && typeof n.then == "function" ? u.then(function(r) {
1035
+ var i = r.Dayjs;
1036
+ return t(i);
1037
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
1038
+ var i = r.Dayjs;
1039
+ return t(i);
1041
1040
  });
1042
- }), t.define("uuid", [], function() {
1043
- var l = i.Uuid;
1044
- return l && typeof l.then == "function" ? a.then(function(u) {
1045
- var d = u.Uuid;
1046
- return s(d);
1047
- }) : l !== void 0 ? s(l) : a.then(function(u) {
1048
- var d = u.Uuid;
1049
- return s(d);
1041
+ }), e.define("uuid", [], function() {
1042
+ var n = s.Uuid;
1043
+ return n && typeof n.then == "function" ? u.then(function(r) {
1044
+ var i = r.Uuid;
1045
+ return t(i);
1046
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
1047
+ var i = r.Uuid;
1048
+ return t(i);
1050
1049
  });
1051
- }), t.define("useblocks/runtime/uuid", [], function() {
1052
- var l = i.Uuid;
1053
- return l && typeof l.then == "function" ? a.then(function(u) {
1054
- var d = u.Uuid;
1055
- return s(d);
1056
- }) : l !== void 0 ? s(l) : a.then(function(u) {
1057
- var d = u.Uuid;
1058
- return s(d);
1050
+ }), e.define("useblocks/runtime/uuid", [], function() {
1051
+ var n = s.Uuid;
1052
+ return n && typeof n.then == "function" ? u.then(function(r) {
1053
+ var i = r.Uuid;
1054
+ return t(i);
1055
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
1056
+ var i = r.Uuid;
1057
+ return t(i);
1059
1058
  });
1060
- }), t.define("useblocks-ui-kit", [], function() {
1061
- var l = i.UiKit;
1062
- return l && typeof l.then == "function" ? a.then(function(u) {
1063
- var d = u.UiKit;
1064
- return s(d);
1065
- }) : l !== void 0 ? s(l) : a.then(function(u) {
1066
- var d = u.UiKit;
1067
- return s(d);
1059
+ }), e.define("useblocks-ui-kit", [], function() {
1060
+ var n = s.UiKit;
1061
+ return n && typeof n.then == "function" ? u.then(function(r) {
1062
+ var i = r.UiKit;
1063
+ return t(i);
1064
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
1065
+ var i = r.UiKit;
1066
+ return t(i);
1068
1067
  });
1069
- }), t.define("useblocks/ui-kit", [], function() {
1070
- var l = i.UiKit;
1071
- return l && typeof l.then == "function" ? a.then(function(u) {
1072
- var d = u.UiKit;
1073
- return s(d);
1074
- }) : l !== void 0 ? s(l) : a.then(function(u) {
1075
- var d = u.UiKit;
1076
- return s(d);
1068
+ }), e.define("useblocks/ui-kit", [], function() {
1069
+ var n = s.UiKit;
1070
+ return n && typeof n.then == "function" ? u.then(function(r) {
1071
+ var i = r.UiKit;
1072
+ return t(i);
1073
+ }) : n !== void 0 ? t(n) : u.then(function(r) {
1074
+ var i = r.UiKit;
1075
+ return t(i);
1077
1076
  });
1078
1077
  });
1079
1078
  }
1080
1079
  globalThis.__SHARED_RUNTIME_INIT_SENTINEL__ = "@shared-runtime:init-complete";
1081
1080
  })();
1082
- var se = null, zt = "core";
1083
- function Vt() {
1084
- return typeof window.__useblocks__?.require != "function" ? Promise.reject(/* @__PURE__ */ new Error("[loadEngine] AMD loader is unavailable")) : new Promise((t, e) => {
1085
- window.__useblocks__.require([zt], (n) => t(n), (n) => e(n instanceof Error ? n : /* @__PURE__ */ new Error("[loadEngine] Failed to require core module")));
1081
+ var _ = null, ee = "core";
1082
+ function ne() {
1083
+ return typeof window.__useblocks__?.require != "function" ? Promise.reject(/* @__PURE__ */ new Error("[loadEngine] AMD loader is unavailable")) : new Promise((e, o) => {
1084
+ window.__useblocks__.require([ee], (a) => e(a), (a) => o(a instanceof Error ? a : /* @__PURE__ */ new Error("[loadEngine] Failed to require core module")));
1086
1085
  });
1087
1086
  }
1088
- function Me() {
1089
- return se || (se = Vt()), se;
1087
+ function O() {
1088
+ return _ || (_ = ne()), _;
1090
1089
  }
1091
- var ue = null, de = null;
1092
- async function Ht(t) {
1093
- typeof t?.prefetch == "function" && await t.prefetch();
1090
+ var P = null, S = null;
1091
+ async function re(e) {
1092
+ typeof e?.prefetch == "function" && await e.prefetch();
1094
1093
  }
1095
- function ut() {
1096
- return ue || (ue = Me().then(() => {})), ue;
1094
+ function J() {
1095
+ return P || (P = O().then(() => {})), P;
1097
1096
  }
1098
- function De(t) {
1099
- return de || (de = Ht(t)), de;
1097
+ function M(e) {
1098
+ return S || (S = re(e)), S;
1100
1099
  }
1101
- function dt(t) {
1102
- return Promise.all([ut(), De(t)]).then(() => {});
1100
+ function $(e) {
1101
+ return Promise.all([J(), M(e)]).then(() => {});
1103
1102
  }
1104
- function Xt(t) {
1105
- const e = t?.startupPrefetchMode;
1106
- return e === "eager" || e === "idle" || e === "manual" || e === "off" ? e : "eager";
1103
+ function te(e) {
1104
+ const o = e?.startupPrefetchMode;
1105
+ return o === "eager" || o === "idle" || o === "manual" || o === "off" ? o : "eager";
1107
1106
  }
1108
- function ce(t) {
1109
- Promise.resolve().then(() => dt(t)).catch(() => {});
1107
+ function x(e) {
1108
+ Promise.resolve().then(() => $(e)).catch(() => {});
1110
1109
  }
1111
- function $t(t) {
1112
- Promise.resolve().then(() => De(t)).catch(() => {});
1110
+ function ie(e) {
1111
+ Promise.resolve().then(() => M(e)).catch(() => {});
1113
1112
  }
1114
- function Wt(t) {
1115
- const e = Xt(t);
1116
- if (e === "eager") ce(t);
1117
- else if (e === "idle") {
1118
- const n = window.requestIdleCallback;
1119
- typeof n == "function" ? n(() => ce(t), { timeout: 1500 }) : setTimeout(() => ce(t), 0);
1113
+ function oe(e) {
1114
+ const o = te(e);
1115
+ if (o === "eager") x(e);
1116
+ else if (o === "idle") {
1117
+ const a = window.requestIdleCallback;
1118
+ typeof a == "function" ? a(() => x(e), { timeout: 1500 }) : setTimeout(() => x(e), 0);
1120
1119
  }
1121
1120
  }
1122
- var H = /* @__PURE__ */ new WeakMap(), Qt = "data-useblocks-config-styles";
1123
- function Kt(t) {
1124
- return typeof t == "string" ? t.trim() : "";
1121
+ var R = /* @__PURE__ */ new WeakMap(), ae = "data-useblocks-config-styles";
1122
+ function ue(e) {
1123
+ return typeof e == "string" ? e.trim() : "";
1125
1124
  }
1126
- function Ue(t, e) {
1127
- if (t.firstChild) {
1128
- t.insertBefore(e, t.firstChild);
1125
+ function q(e, o) {
1126
+ if (e.firstChild) {
1127
+ e.insertBefore(o, e.firstChild);
1129
1128
  return;
1130
1129
  }
1131
- t.appendChild(e);
1132
- }
1133
- function Jt(t, e, n) {
1134
- if (!t || typeof document > "u") return null;
1135
- const r = Kt(e), o = H.get(t), i = n || t;
1136
- if (!r) return o && (o.remove(), H.delete(t)), null;
1137
- if (o) return o.textContent !== r && (o.textContent = r), (o.parentNode !== i || o !== i.firstChild) && Ue(i, o), o;
1138
- const a = document.createElement("style");
1139
- return a.setAttribute(Qt, "true"), a.textContent = r, Ue(i, a), H.set(t, a), a;
1140
- }
1141
- function Yt(t) {
1142
- if (!t) return;
1143
- const e = H.get(t);
1144
- e && (e.remove(), H.delete(t));
1145
- }
1146
- function ct() {
1130
+ e.appendChild(o);
1131
+ }
1132
+ function se(e, o, a) {
1133
+ if (!e || typeof document > "u") return null;
1134
+ const c = ue(o), d = R.get(e), s = a || e;
1135
+ if (!c) return d && (d.remove(), R.delete(e)), null;
1136
+ if (d) return d.textContent !== c && (d.textContent = c), (d.parentNode !== s || d !== s.firstChild) && q(s, d), d;
1137
+ const u = document.createElement("style");
1138
+ return u.setAttribute(ae, "true"), u.textContent = c, q(s, u), R.set(e, u), u;
1139
+ }
1140
+ function ce(e) {
1141
+ if (!e) return;
1142
+ const o = R.get(e);
1143
+ o && (o.remove(), R.delete(e));
1144
+ }
1145
+ function F() {
1147
1146
  return !1;
1148
1147
  }
1149
- var Zt = `
1148
+ var de = `
1150
1149
  .blocks-app-initial-spinner-wrapper {
1151
1150
  width: 100%;
1152
1151
  height: 100%;
@@ -1176,2905 +1175,336 @@ var Zt = `
1176
1175
  transform: rotate(360deg);
1177
1176
  }
1178
1177
  }`;
1179
- function en() {
1178
+ function le() {
1180
1179
  return () => {};
1181
1180
  }
1182
- function tn(t, e) {
1183
- if (!ct() || !t || typeof document > "u") return en();
1184
- t.querySelectorAll(".blocks-app-initial-spinner-wrapper").forEach((a) => {
1185
- a.remove();
1181
+ function fe(e, o) {
1182
+ if (!F() || !e || typeof document > "u") return le();
1183
+ e.querySelectorAll(".blocks-app-initial-spinner-wrapper").forEach((u) => {
1184
+ u.remove();
1186
1185
  });
1187
- const n = document.createElement("div");
1188
- n.classList.add("blocks-app-initial-spinner-wrapper");
1189
- const r = document.createElement("div");
1190
- r.classList.add("blocks-app-initial-spinner"), n.appendChild(r);
1191
- const o = document.createElement("style");
1192
- o.setAttribute(e, "true"), o.textContent = Zt, document.head?.appendChild(o), t.appendChild(n);
1193
- let i = !1;
1186
+ const a = document.createElement("div");
1187
+ a.classList.add("blocks-app-initial-spinner-wrapper");
1188
+ const c = document.createElement("div");
1189
+ c.classList.add("blocks-app-initial-spinner"), a.appendChild(c);
1190
+ const d = document.createElement("style");
1191
+ d.setAttribute(o, "true"), d.textContent = de, document.head?.appendChild(d), e.appendChild(a);
1192
+ let s = !1;
1194
1193
  return () => {
1195
- i || (i = !0, n.remove(), o.remove());
1194
+ s || (s = !0, a.remove(), d.remove());
1196
1195
  };
1197
1196
  }
1198
- var k = /* @__PURE__ */ (function(t) {
1199
- return t.Json = "application/json", t.FormData = "multipart/form-data", t.UrlEncoded = "application/x-www-form-urlencoded", t.Text = "text/plain", t;
1200
- })({}), ft = "INJECTION";
1201
- function nn(t) {
1202
- return t.getState;
1203
- }
1204
- function v(t) {
1205
- if (nn(t)) {
1206
- const e = t.getState()[ft];
1207
- return e && Se.getInstance(e);
1208
- } else return t;
1209
- }
1210
- function fe(t, e) {
1211
- for (const n of t) if (n && e in n) return n[e];
1212
- }
1213
- function Oe(t) {
1214
- return Object.assign({}, ...t);
1215
- }
1216
- var pt = [
1217
- "generic",
1218
- "stockImages",
1219
- "emFiles",
1220
- "cdn"
1221
- ];
1222
- function Re(t) {
1223
- return !!t && typeof t == "object" && !Array.isArray(t);
1224
- }
1225
- function Ge(t) {
1226
- return !Re(t) || "match" in t || "rewrite" in t || "proxyBase" in t ? !1 : Object.keys(t).some((e) => pt.includes(e));
1227
- }
1228
- function mt(t) {
1229
- return t.length === 0 ? [] : t.length === 1 ? t[0] : t;
1230
- }
1231
- function _t(t) {
1232
- let e = !1, n = [];
1233
- for (const r of t) if (r !== void 0) {
1234
- if (e = !0, Array.isArray(r)) {
1235
- n = [...r, ...n];
1236
- continue;
1237
- }
1238
- n = [r, ...n];
1239
- }
1240
- if (e) return mt(n);
1241
- }
1242
- function rn(t) {
1243
- return Re(t) && ("value" in t || "replace" in t);
1244
- }
1245
- function ze(t, e) {
1246
- return e === void 0 ? t : Array.isArray(e) ? [...e, ...t] : [e, ...t];
1247
- }
1248
- function on(t) {
1249
- let e = !1, n = [], r = !1;
1250
- for (const i of t) if (i !== void 0) {
1251
- if (rn(i)) {
1252
- e = !0, i.replace && (n = [], r = !0), i.value !== void 0 && (n = ze(n, i.value), r = !0);
1253
- continue;
1254
- }
1255
- n = ze(n, i), r = !0;
1256
- }
1257
- const o = r ? mt(n) : void 0;
1258
- if (!e) return o;
1259
- if (o !== void 0) return { value: o };
1260
- }
1261
- function an(t) {
1262
- const e = t.filter((r) => r !== void 0);
1263
- if (e.length === 0) return;
1264
- if (!e.some((r) => Ge(r))) return _t(e);
1265
- const n = {};
1266
- for (const r of pt) {
1267
- const o = on(t.map((i) => {
1268
- if (i !== void 0) return Ge(i) ? i[r] : r === "generic" ? i : void 0;
1269
- }));
1270
- o !== void 0 && (n[r] = o);
1271
- }
1272
- return Object.keys(n).length > 0 ? n : void 0;
1273
- }
1274
- function ln(t) {
1275
- return _t(t);
1276
- }
1277
- function sn(t) {
1278
- if (t !== void 0) {
1279
- if (Array.isArray(t)) return {
1280
- replace: !1,
1281
- hosts: t
1282
- };
1283
- if (Re(t) && Array.isArray(t.value)) return {
1284
- replace: !!t.replace,
1285
- hosts: t.value
1286
- };
1287
- }
1288
- }
1289
- function un(t, e) {
1290
- const n = [...t], r = new Set(n.map((o) => o.toLowerCase()));
1291
- for (const o of e) {
1292
- const i = o.trim().replace(/:\d+$/, "");
1293
- if (!i) continue;
1294
- const a = i.toLowerCase();
1295
- r.has(a) || (r.add(a), n.push(i));
1296
- }
1297
- return n;
1298
- }
1299
- function dn(t) {
1300
- let e = [], n = !1;
1301
- for (const r of t) {
1302
- const o = sn(r);
1303
- o && (n = !0, o.replace && (e = []), e = un(e, o.hosts));
1304
- }
1305
- return n ? e : void 0;
1306
- }
1307
- function cn(t) {
1308
- const e = t.filter((o) => o !== void 0);
1309
- if (e.length === 0) return;
1310
- const n = Oe(e.map(({ directHosts: o, ...i }) => i)), r = dn(e.map((o) => o?.directHosts));
1311
- return r !== void 0 && (n.directHosts = r), n;
1312
- }
1313
- function Ae(t) {
1314
- for (; t.endsWith("/");) t = t.slice(0, t.length - 1);
1315
- return /\/wp-json$/i.test(t) ? t : `${t}/wp-json`;
1316
- }
1317
- Ae("https://app.useblocks.io/api");
1318
- F();
1319
- F();
1320
- F();
1321
- var fn = F(), Ve;
1322
- (function(t) {
1323
- const e = "https://racs.rest/v3";
1324
- function n(o, i) {
1325
- const a = {
1197
+ function U(e) {
1198
+ for (; e.endsWith("/");) e = e.slice(0, e.length - 1);
1199
+ return /\/wp-json$/i.test(e) ? e : `${e}/wp-json`;
1200
+ }
1201
+ U("https://app.useblocks.io/api");
1202
+ A();
1203
+ A();
1204
+ A();
1205
+ A();
1206
+ var L;
1207
+ (function(e) {
1208
+ const o = "https://racs.rest/v3";
1209
+ function a(d, s) {
1210
+ const u = {
1326
1211
  method: "POST",
1327
1212
  headers: {
1328
1213
  "Content-Type": "application/json",
1329
1214
  Accept: "application/json"
1330
1215
  },
1331
- body: JSON.stringify(i)
1216
+ body: JSON.stringify(s)
1332
1217
  };
1333
- return fetch(`${e}?resource=${o}&dataset=${document.location.hostname}`, a);
1218
+ return fetch(`${o}?resource=${d}&dataset=${document.location.hostname}`, u);
1334
1219
  }
1335
- t.post = n;
1336
- async function r(o, i = 0) {
1337
- const a = {
1220
+ e.post = a;
1221
+ async function c(d, s = 0) {
1222
+ const u = {
1338
1223
  method: "POST",
1339
1224
  headers: {
1340
1225
  "Content-Type": "application/json",
1341
1226
  Accept: "application/json"
1342
1227
  },
1343
- body: `{"filter":{},"limit":${i}}`
1228
+ body: `{"filter":{},"limit":${s}}`
1344
1229
  };
1345
- return await (await fetch(`${e}/get?resource=${o}&dataset=${document.location.hostname}`, a)).json();
1230
+ return await (await fetch(`${o}/get?resource=${d}&dataset=${document.location.hostname}`, u)).json();
1346
1231
  }
1347
- t.getAll = r;
1348
- })(Ve || (Ve = {}));
1349
- var pe = /* @__PURE__ */ new Map(), He = /* @__PURE__ */ new WeakMap();
1350
- function Et(t) {
1351
- const e = String(t || "").trim();
1352
- if (e) return Ae(e);
1353
- return Ae("https://app.useblocks.io/api".trim());
1354
- }
1355
- async function pn(t) {
1356
- if (!t.getAuthToken) return;
1357
- const e = await t.getAuthToken(t.user, t.project, void 0);
1358
- return e ? `Bearer ${e}` : void 0;
1359
- }
1360
- function mn(t) {
1361
- return async ({ baseUrl: e }) => {
1362
- const n = Et(e);
1363
- if (!n) throw new Error("[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL");
1364
- const r = new Headers({
1232
+ e.getAll = c;
1233
+ })(L || (L = {}));
1234
+ var D = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new WeakMap();
1235
+ function K(e) {
1236
+ const o = String(e || "").trim();
1237
+ if (o) return U(o);
1238
+ return U("https://app.useblocks.io/api".trim());
1239
+ }
1240
+ async function pe(e) {
1241
+ if (!e.getAuthToken) return;
1242
+ const o = await e.getAuthToken(e.user, e.project, void 0);
1243
+ return o ? `Bearer ${o}` : void 0;
1244
+ }
1245
+ function he(e) {
1246
+ return async ({ baseUrl: o }) => {
1247
+ const a = K(o);
1248
+ if (!a) throw new Error("[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL");
1249
+ const c = new Headers({
1365
1250
  Accept: "application/json",
1366
1251
  "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
1367
- }), o = await pn(t);
1368
- o && r.set("authorization", o);
1369
- const i = await fetch(`${n}/app/v1/app_init`, {
1252
+ }), d = await pe(e);
1253
+ d && c.set("authorization", d);
1254
+ const s = await fetch(`${a}/app/v1/app_init`, {
1370
1255
  method: "POST",
1371
- headers: r,
1256
+ headers: c,
1372
1257
  body: new URLSearchParams(),
1373
1258
  credentials: "same-origin"
1374
1259
  });
1375
- if (!i.ok) throw new Error(`[Loader] appInit request failed: ${i.status} ${i.statusText}`);
1376
- return i.json();
1260
+ if (!s.ok) throw new Error(`[Loader] appInit request failed: ${s.status} ${s.statusText}`);
1261
+ return s.json();
1377
1262
  };
1378
1263
  }
1379
- function _n(t) {
1264
+ function me(e) {
1380
1265
  return JSON.stringify({
1381
- baseUrl: Et(t.baseUrl) || "",
1382
- project: t.project ?? "",
1383
- userId: t.user?.id ?? ""
1266
+ baseUrl: K(e.baseUrl) || "",
1267
+ project: e.project ?? "",
1268
+ userId: e.user?.id ?? ""
1384
1269
  });
1385
1270
  }
1386
- function En(t) {
1387
- return async (e) => {
1388
- const n = _n(e), r = pe.get(n);
1389
- if (r) return r;
1390
- const o = Promise.resolve(t(e)).catch((i) => {
1391
- throw pe.delete(n), i;
1271
+ function ve(e) {
1272
+ return async (o) => {
1273
+ const a = me(o), c = D.get(a);
1274
+ if (c) return c;
1275
+ const d = Promise.resolve(e(o)).catch((s) => {
1276
+ throw D.delete(a), s;
1392
1277
  });
1393
- return pe.set(n, o), o;
1278
+ return D.set(a, d), d;
1394
1279
  };
1395
1280
  }
1396
- function bn(t) {
1397
- if (t.standaloneKey) return t;
1398
- const e = t.appInit || mn(t);
1399
- let n = He.get(e);
1400
- return n || (n = En(e), He.set(e, n)), Promise.resolve(n({
1401
- baseUrl: t.baseUrl,
1402
- user: t.user,
1403
- project: t.project,
1281
+ function ge(e) {
1282
+ if (e.standaloneKey) return e;
1283
+ const o = e.appInit || he(e);
1284
+ let a = V.get(o);
1285
+ return a || (a = ve(o), V.set(o, a)), Promise.resolve(a({
1286
+ baseUrl: e.baseUrl,
1287
+ user: e.user,
1288
+ project: e.project,
1404
1289
  prevApp: void 0
1405
- })).catch((r) => {}), {
1406
- ...t,
1407
- appInit: n
1408
- };
1409
- }
1410
- var Xe = /* @__PURE__ */ new WeakMap();
1411
- function gn(t) {
1412
- let e = null;
1413
- return async (n, r, o) => (e || (e = Promise.resolve(t(n, r, o)).finally(() => {
1414
- e = null;
1415
- })), e);
1416
- }
1417
- function hn(t) {
1418
- if (t.standaloneKey) return t;
1419
- const e = t.getAuthToken;
1420
- if (!e) return t;
1421
- let n = Xe.get(e);
1422
- return n || (n = gn(e), Xe.set(e, n)), Promise.resolve(n(t.user, t.project, void 0)).catch((r) => {}), {
1423
- ...t,
1424
- getAuthToken: n
1425
- };
1426
- }
1427
- function bt(...t) {
1428
- const e = t.filter((i) => i != null);
1429
- if (e.length === 0) return;
1430
- if (e.length === 1) return e[0];
1431
- const n = e.find((i) => i.aborted);
1432
- if (n) return n;
1433
- if (typeof AbortSignal < "u" && typeof AbortSignal.any == "function") return AbortSignal.any(e);
1434
- const r = new AbortController(), o = (i) => {
1435
- r.signal.aborted || r.abort(i.reason);
1436
- };
1437
- for (const i of e) i.addEventListener("abort", () => o(i), { once: !0 });
1438
- return r.signal;
1439
- }
1440
- function Q(t, e = !1) {
1441
- const n = {};
1442
- for (const r of Object.keys(t)) {
1443
- let o = t[r];
1444
- o !== void 0 && !(typeof o == "number" && Number.isNaN(o)) && (e && typeof o == "object" && o !== null && (o = Q(o)), n[r] = o);
1445
- }
1446
- return n;
1447
- }
1448
- function A(t) {
1449
- return typeof t == "object" && t;
1450
- }
1451
- function T(t) {
1452
- const e = Number(t);
1453
- return isNaN(e) ? t : e;
1454
- }
1455
- function y(t) {
1456
- return typeof t == "number" ? String(t) : t;
1457
- }
1458
- function R(t) {
1459
- return typeof t == "object" ? t.rendered : t;
1460
- }
1461
- function yn(t) {
1462
- return typeof t == "object" && t !== null ? t : void 0;
1463
- }
1464
- function x({ id: t, title: e, meta: n, type: r, guid: o, acf: { lock: i, subject: a, description: c, html: f, project: p, tags: m, utm_parameters: s, parent_email: l, common_styles: u, is_template: d }, author: E, ...b }) {
1465
- const g = yn(n);
1466
- return {
1467
- ...b,
1468
- ...g !== void 0 ? { meta: g } : {},
1469
- id: y(t),
1470
- author: y(E),
1471
- title: R(e) || "",
1472
- lock: i,
1473
- description: c,
1474
- html: f,
1475
- project: A(p) ? p.ID : p,
1476
- project_author: A(p) ? p.post_author : void 0,
1477
- project_title: A(p) ? p.post_title : void 0,
1478
- tags: m,
1479
- utm_parameters: s,
1480
- parent_email: y(l instanceof Array && l[0] ? l[0].ID : l),
1481
- common_styles: u,
1482
- is_template: d
1483
- };
1484
- }
1485
- function $e({ title: t, lock: e, subject: n, description: r, html: o, project: i, tags: a, renderGuid: c, utm_parameters: f, parent_email: p, common_styles: m, is_template: s, author: l, meta: u, ...d }) {
1486
- return {
1487
- ...d,
1488
- author: T(l),
1489
- title: t,
1490
- acf: {
1491
- lock: e,
1492
- description: r,
1493
- html: o,
1494
- project: i,
1495
- tags: a,
1496
- utm_parameters: f,
1497
- parent_email: T(p),
1498
- common_styles: m,
1499
- is_template: s
1500
- }
1501
- };
1502
- }
1503
- function vn(t) {
1504
- return typeof t == "object" && t !== null ? t : void 0;
1505
- }
1506
- function We({ id: t, title: e, meta: n, acf: { html: r, common_styles: o }, parent: i, excerpt: a, author: c, ...f }) {
1507
- const p = vn(n);
1508
- return {
1509
- ...f,
1510
- ...p !== void 0 ? { meta: p } : {},
1511
- author: y(c),
1512
- id: y(t),
1513
- parent: y(i),
1514
- title: R(e) || "",
1515
- html: r,
1516
- common_styles: o,
1517
- excerpt: A(a) ? a.rendered : a
1518
- };
1519
- }
1520
- function Sn({ parent: t, title: e, html: n, project: r, subject: o, preheader: i, common_styles: a, author: c, parent_email: f, meta: p, ...m }) {
1521
- return {
1522
- ...m,
1523
- author: T(c),
1524
- title: e,
1525
- parent: T(t),
1526
- "acf[html]": n,
1527
- "acf[project]": A(r) ? r.id || r.ID : r,
1528
- "acf[parent_email]": f,
1529
- "acf[common_styles]": a
1530
- };
1531
- }
1532
- function ae({ data: t, ...e }, n) {
1533
- return e.error ? e : {
1534
- data: n(t, e.meta),
1535
- ...e
1536
- };
1537
- }
1538
- function An({ data: t, ...e }, n) {
1539
- return e.error ? e : {
1540
- data: t.map((r) => n(r, e.meta)),
1541
- ...e
1542
- };
1543
- }
1544
- function S(t) {
1545
- return (e) => ae(e, t);
1546
- }
1547
- function Tn(t) {
1548
- return !t.hasOwnProperty("previous");
1549
- }
1550
- function Ne(t) {
1551
- return (e) => ae(e, (n, r) => Tn(n) ? t(n, r) : t(n.previous, r));
1552
- }
1553
- function C(t) {
1554
- return (e) => An(e, t);
1555
- }
1556
- var In = ft, wn = (t, e) => {
1557
- if (!t) {
1558
- const n = Se.createChild(), r = F();
1559
- return Se.inject(r, n), r;
1560
- }
1561
- return t;
1562
- };
1563
- function Pn() {
1564
- const t = v($());
1565
- return function(e, n) {
1566
- t.inject(e, n);
1567
- };
1568
- }
1569
- function kn() {
1570
- const t = v($());
1571
- return function(e, n, r) {
1572
- t.injectFactory(e, n, r);
1573
- };
1574
- }
1575
- function Cn(t, e) {
1576
- const n = $(), r = st(() => e || v(n), [n, e]), [o, i] = xe(() => r?.getInstance(t));
1577
- return Ce(() => {
1578
- const a = r?.onInject((c) => {
1579
- c === t && i(r.getInstance(t));
1580
- });
1581
- return () => a?.dispose();
1582
- }, [t, r]), o;
1583
- }
1584
- function xn(t) {
1585
- const [e, n] = xe(), r = $(), o = Gt(Promise.resolve()), i = v(r);
1586
- return Ce(() => {
1587
- const a = o.current = o.current.then(() => i?.getInstanceAsync(t)).then((c) => {
1588
- a === o.current && n(c);
1589
- }, (c) => {});
1590
- }, [t, i]), e;
1591
- }
1592
- function Mn(t, e) {
1593
- const n = $(), r = st(() => e || v(n), [n, e]), [o, i] = xe(() => r?.getServices(t) || []);
1594
- return Ce(() => {
1595
- if (!r) return;
1596
- const a = r.onInject((c) => {
1597
- c === Bt(t) && i(r.getServices(t));
1598
- });
1599
- return () => {
1600
- a?.dispose();
1601
- };
1602
- }, [t, r]), o;
1603
- }
1604
- function Te(t) {
1605
- return (e, n, r, o) => t(v(n))(e, n, r, o);
1606
- }
1607
- function Dn(t, e) {
1608
- return (t instanceof Pe ? t : v(t)).getInstance(e);
1609
- }
1610
- function On(t, e) {
1611
- return (t instanceof Pe ? t : v(t)).getInstanceAsync(e);
1612
- }
1613
- function Rn(t, e, n) {
1614
- return (t instanceof Pe ? t : v(t)).getOrCreateInstance(e, n);
1615
- }
1616
- function Nn(t, e, n) {
1617
- v(t).inject(e, n);
1618
- }
1619
- function Bn(t, e, n, r) {
1620
- v(t).injectFactory(e, n, r);
1621
- }
1622
- function Ln(t, e, n) {
1623
- return v(t).addService(e, n);
1624
- }
1625
- function Fn(t, e, n, r) {
1626
- return v(t).addServiceFactory(e, n, r);
1627
- }
1628
- function jn(t, e) {
1629
- return v(t).getServices(e);
1630
- }
1631
- var gt = {
1632
- getContainer: v,
1633
- createIdentifier: F,
1634
- reducer: wn,
1635
- reducerPath: In,
1636
- getInstance: Dn,
1637
- getInstanceAsync: On,
1638
- getOrCreateInstance: Rn,
1639
- inject: Nn,
1640
- injectFactory: Bn,
1641
- addService: Ln,
1642
- addServiceFactory: Fn,
1643
- getServices: jn,
1644
- useInstance: Cn,
1645
- useInstanceAsync: xn,
1646
- useServices: Mn,
1647
- useInject: Pn,
1648
- useInjectFactory: kn
1649
- }, _ = (t) => gt.getInstance(t, Nt);
1650
- function K(t) {
1651
- return (e, n, r) => {
1652
- const o = gt.getInstance(n, fn);
1653
- return qt({
1654
- ...t,
1655
- fetchFn: o?.execute || fetch
1656
- })(e, n, r);
1657
- };
1658
- }
1659
- var { setRevisionToApply: U, clearRevisionToApply: ro, setIsRecovering: me, markContentReady: Qe, markEmailInited: oo, resetContentReady: io, resetEmailInited: ao, resetShowReady: lo, beginForcedHeaderSync: so, endForcedHeaderSync: uo } = ie({
1660
- name: "autosaveRecovery",
1661
- initialState: {
1662
- revisionToApply: null,
1663
- isRecovering: !1,
1664
- contentReadyEmailId: null,
1665
- initedShowToken: 0,
1666
- forcedHeaderSync: null
1667
- },
1668
- reducers: {
1669
- setRevisionToApply: (t, { payload: e }) => {
1670
- t.revisionToApply = e;
1671
- },
1672
- clearRevisionToApply: (t) => {
1673
- t.revisionToApply = null;
1674
- },
1675
- setIsRecovering: (t, { payload: e }) => {
1676
- t.isRecovering = e;
1677
- },
1678
- markContentReady: (t, { payload: e }) => {
1679
- t.contentReadyEmailId = e;
1680
- },
1681
- markEmailInited: (t, { payload: e }) => {
1682
- t.initedShowToken = e;
1683
- },
1684
- resetContentReady: (t) => {
1685
- t.contentReadyEmailId = null;
1686
- },
1687
- resetEmailInited: (t) => {
1688
- t.initedShowToken = 0;
1689
- },
1690
- resetShowReady: (t) => {
1691
- t.contentReadyEmailId = null, t.initedShowToken = 0;
1692
- },
1693
- beginForcedHeaderSync: (t, { payload: e }) => {
1694
- t.forcedHeaderSync = e;
1695
- },
1696
- endForcedHeaderSync: (t) => {
1697
- t.forcedHeaderSync = null;
1698
- }
1699
- }
1700
- }).actions, Gn = "em_autosave_pending", zn = 2e3, Vn = 5, Hn = 5e3, Xn = 4, $n = 6e4, Wn = 5e3;
1701
- function oe(t) {
1702
- return `${Gn}_${t}`;
1703
- }
1704
- function Qn(t, e) {
1705
- try {
1706
- sessionStorage.setItem(oe(t), JSON.stringify(e));
1707
- } catch {}
1708
- }
1709
- function Kn(t) {
1710
- try {
1711
- const e = sessionStorage.getItem(oe(t));
1712
- if (!e) return null;
1713
- const n = JSON.parse(e);
1714
- return Date.now() - n.sentAt > $n ? (sessionStorage.removeItem(oe(t)), null) : n;
1715
- } catch {
1716
- return null;
1717
- }
1718
- }
1719
- function G(t) {
1720
- try {
1721
- sessionStorage.removeItem(oe(t));
1722
- } catch {}
1723
- }
1724
- function ht(t) {
1725
- return !!t?.slug?.includes("autosave");
1726
- }
1727
- function _e(t, e) {
1728
- return ht(t) && Date.parse(t.modified) >= e - Wn;
1729
- }
1730
- function J(t) {
1731
- return ht(t) && !!t?.html?.trim();
1732
- }
1733
- function Jn(t) {
1734
- return t?.length ? [...t].sort((e, n) => Date.parse(n.modified) - Date.parse(e.modified))[0] : null;
1735
- }
1736
- function Yn() {
1737
- return typeof performance < "u" && typeof performance.timeOrigin == "number" ? performance.timeOrigin : Date.now();
1738
- }
1739
- function Zn(t, e) {
1740
- return t == null || e == null ? !1 : t.replaceAll(`\r
1741
- `, `
1742
- `) === e.replaceAll(`\r
1743
- `, `
1744
- `);
1745
- }
1746
- var er = class {
1747
- pageLoadTs;
1748
- polls = /* @__PURE__ */ new Map();
1749
- processedEmails = /* @__PURE__ */ new Set();
1750
- constructor(t = Yn()) {
1751
- this.pageLoadTs = t;
1752
- }
1753
- onAutoSaveStarted(t, e) {
1754
- Qn(t, e);
1755
- }
1756
- onAutoSaveCompleted(t) {}
1757
- onHistoryFetched(t, e, n, r, o = !1, i = null) {
1758
- const a = Jn(e), c = this.polls.get(t);
1759
- if (c && (c.triggerRefetch = r, c.dispatch = n), o && c?.phase === "fast") {
1760
- J(a) && _e(a, c.pending.sentAt) && (G(t), this.cancelPolling(t), n(U({
1761
- emailId: t,
1762
- payload: a,
1763
- phase: "found"
1764
- })), this.processedEmails.add(t));
1765
- return;
1766
- }
1767
- if (o && c?.phase === "bg") {
1768
- J(a) && _e(a, c.pending.sentAt) && (G(t), this.cancelPolling(t), n(U({
1769
- emailId: t,
1770
- payload: a,
1771
- phase: "bg"
1772
- })), this.processedEmails.add(t));
1773
- return;
1774
- }
1775
- if (this.processedEmails.has(t)) return;
1776
- const f = o ? Kn(t) : null, p = f && (f.sentAt < this.pageLoadTs || !Zn(f.html, i)) ? f : null;
1777
- p ? J(a) && _e(a, p.sentAt) ? (G(t), n(U({
1778
- emailId: t,
1779
- payload: a,
1780
- phase: "found"
1781
- })), this.processedEmails.add(t)) : this.startFastPoll(t, p, n, r) : (J(a) ? n(U({
1782
- emailId: t,
1783
- payload: a,
1784
- phase: "normal"
1785
- })) : n(Qe(t)), this.processedEmails.add(t));
1786
- }
1787
- onHistoryFetchError(t, e) {
1788
- this.polls.has(t) || e(Qe(t));
1789
- }
1790
- cancelPolling(t) {
1791
- const e = this.polls.get(t);
1792
- e?.timer && clearTimeout(e.timer), e && e.dispatch(me(!1)), this.polls.delete(t), this.processedEmails.delete(t);
1793
- }
1794
- startFastPoll(t, e, n, r) {
1795
- n(me(!0));
1796
- const o = {
1797
- phase: "fast",
1798
- attempts: 0,
1799
- pending: e,
1800
- timer: null,
1801
- triggerRefetch: r,
1802
- dispatch: n
1803
- };
1804
- this.polls.set(t, o), this.scheduleNextPoll(t);
1805
- }
1806
- scheduleNextPoll(t) {
1807
- const e = this.polls.get(t);
1808
- if (!e) return;
1809
- const n = e.phase === "fast", r = n ? zn : Hn, o = n ? Vn : Xn;
1810
- e.timer = setTimeout(() => {
1811
- const i = this.polls.get(t);
1812
- if (i) if (i.attempts++, i.triggerRefetch(), n && i.attempts >= o) {
1813
- const { pending: a, dispatch: c } = i;
1814
- G(t), c(me(!1)), c(U({
1815
- emailId: t,
1816
- payload: {
1817
- html: a.html,
1818
- common_styles: a.common_styles,
1819
- subject: a.subject,
1820
- preheader: a.preheader
1821
- },
1822
- phase: "timeout"
1823
- })), this.processedEmails.add(t), i.phase = "bg", i.attempts = 0, this.scheduleNextPoll(t);
1824
- } else !n && i.attempts >= o ? (G(t), this.cancelPolling(t), this.processedEmails.add(t)) : this.scheduleNextPoll(t);
1825
- }, r);
1826
- }
1827
- }, z = new er(), Ke = {
1828
- pro: {
1829
- config: {
1830
- mode: "pro",
1831
- autosaveTimeout: 5e3,
1832
- autosaveRetryMaxAttempts: 5,
1833
- autosaveRetryIntervalMs: 3e4,
1834
- theme: "",
1835
- themes: {},
1836
- mergeTagsShow: !0,
1837
- styles: "",
1838
- revisionService: !1,
1839
- headerShow: !0,
1840
- headerTitleVisible: !0,
1841
- headerPreheaderVisible: !0,
1842
- headerArrowBackVisible: !0,
1843
- historyEnabled: !0,
1844
- codeEnabled: !0,
1845
- codeSideEnabled: !0,
1846
- previewIconEnabled: !0,
1847
- previewModeEnabled: !0,
1848
- livePreviewEnabled: !0,
1849
- sendTestEnabled: !0,
1850
- sharePreviewEnabled: !0,
1851
- webversionEnabled: !0,
1852
- commonStylesEnabled: !0,
1853
- emailResponsiveControlEnabled: !0,
1854
- templateNotEmAlertShow: !1,
1855
- beeFreeConverterEnabled: !0,
1856
- aiLayoutConverterEnabled: !0,
1857
- emailDropdownMenuEnabled: !0,
1858
- emailDropdownMenuClone: !0,
1859
- emailDropdownMenuImport: !0,
1860
- emailDropdownMenuImportButton: !1,
1861
- emailDropdownMenuConvert: !0,
1862
- emailDropdownMenuLock: !0,
1863
- emailDropdownMenuRemove: !0,
1864
- emailExportEnabled: !0,
1865
- exportHtmlEnabled: !0,
1866
- exportZipEnabled: !0,
1867
- exportTextEnabled: !0,
1868
- exportClipboardEnabled: !0,
1869
- exportWebHookEnabled: !0,
1870
- exportOutlookEnabled: !0,
1871
- exportPdfEnabled: !0,
1872
- exportPngEnabled: !0,
1873
- nextButtonEnabled: !1,
1874
- nextButtonText: "",
1875
- saveButtonEnabled: !0,
1876
- saveButtonText: "",
1877
- commandButtonsEnabled: !0,
1878
- emailIdShow: !1,
1879
- sidePanelFloating: !0,
1880
- desktopMobileSwitchRule: !0,
1881
- desktopMobileSwitchPanel: !1,
1882
- onlyCodeModeInMobile: !1,
1883
- pathEnabled: !0,
1884
- copyPasteEnabled: !0,
1885
- saveBlockEnabled: !0,
1886
- globalBlockCheckboxEnabled: !0,
1887
- editImageControlEnabled: !0,
1888
- lockEditor: !1,
1889
- lockPreheaderAndTitle: !1,
1890
- disableSideMenu: !1,
1891
- menuDirection: "right",
1892
- defaultBuildPanel: "",
1893
- commentsEnabled: !0,
1894
- aiAssistentEnabled: !0,
1895
- optimizeEnabled: !0,
1896
- optimizeLinksEnabled: !0,
1897
- optimizeImagesEnabled: !0,
1898
- optimizeSpamAssassinEnabled: !0,
1899
- optimizeCheckCodeEnabled: !0,
1900
- settingsEnabled: !0,
1901
- UTMEnabled: !0,
1902
- subjectEnabled: !0,
1903
- preheaderEnabled: !0,
1904
- descriptionEnabled: !0,
1905
- tagsEnabled: !0,
1906
- isTemplateEnabled: !0,
1907
- switchDesktopMobilePropsEnabled: !0,
1908
- stepToOtherElementEnabled: !0,
1909
- deleteButtonEnabled: !0,
1910
- toggleSidePanel: !0,
1911
- blocksSectionsShow: !0,
1912
- blocksEmptyEnabled: !0,
1913
- blocksSavedEnabled: !0,
1914
- blocksCommonEnabled: !0,
1915
- blocksTemplateEnabled: !0,
1916
- blocksSearchEnabled: !0,
1917
- blocksAddPanelEnabled: !0,
1918
- imagePathDropdownEnabled: !0,
1919
- formFieldImageTitleEnabled: !0,
1920
- formFieldBorderEnabled: !0,
1921
- formFieldBorderRadiusEnabled: !0,
1922
- formFieldBoxShadowEnabled: !0,
1923
- formFieldVisibilityEnabled: !0,
1924
- formFieldExportAsPictureEnabled: !0,
1925
- emailPaneDesktopSize: 0,
1926
- formButtonFieldInsertImageEnabled: !0,
1927
- formButtonFieldVerticalAlignEnabled: !0,
1928
- formButtonFieldTextAlignEnabled: !0,
1929
- formButtonFieldBackgroundImageEnabled: !0,
1930
- formButtonFieldPaddingsEnabled: !0,
1931
- formButtonFieldReplacerEnabled: !0,
1932
- formCellFieldVerticalAlignEnabled: !0,
1933
- formCellFieldBackgroundImageEnabled: !0,
1934
- formCellFieldPaddingsEnabled: !0,
1935
- formCellFieldSizeEnabled: !0,
1936
- formLinkFieldInsertImageEnabled: !0,
1937
- formTableFieldBackgroundImageEnabled: !0,
1938
- formDivFieldBackgroundImageEnabled: !0,
1939
- formImageFieldVerticalAlignEnabled: !0,
1940
- formImageFieldReplacerEnabled: !0,
1941
- formImageFieldHeightEnabled: !0,
1942
- formTextFieldTypografEnabled: !0,
1943
- formTextFieldReplacerEnabled: !0,
1944
- formEmailFieldBackgroundImageEnabled: !0,
1945
- elementImageEnabled: !0,
1946
- elementTextEnabled: !0,
1947
- elementHeaderEnabled: !0,
1948
- elementButtonEnabled: !0,
1949
- elementListULEnabled: !0,
1950
- elementListOLEnabled: !0,
1951
- elementDividerEnabled: !0,
1952
- elementSpacerEnabled: !0,
1953
- elementSocialEnabled: !0,
1954
- elementTableEnabled: !0,
1955
- elementCountdownEnabled: !0,
1956
- elementVideoEnabled: !0,
1957
- elementAIimageEnabled: !0,
1958
- elementAItextEnabled: !0,
1959
- elementCarouselEnabled: !0,
1960
- elementAccordionEnabled: !0,
1961
- elementFormEnabled: !1,
1962
- preventSendDataToEM: !1,
1963
- imageInfoToolUrl: "",
1964
- resourceProxy: void 0,
1965
- resourceProxyPolicy: void 0,
1966
- imageCenterFileManagerView: !0,
1967
- imageCenterLocalUploadEnabled: !0,
1968
- imageCenterStockEnabled: !0,
1969
- imageCenterGifEnabled: !0,
1970
- imageCenterIconStockEnabled: !0,
1971
- imageCenterEditorEnabled: !0,
1972
- compressMaxSize: 1,
1973
- compressMaxWidthOrHeight: 2e3,
1974
- ampExportEnabled: !0,
1975
- formFieldAmpVisibilityEnabled: !0,
1976
- testEmails: [],
1977
- pushToGTM: !0,
1978
- activeNextButton: !0,
1979
- iconStrokeWidth: 1.4,
1980
- fileManager: {
1981
- defaultFolderName: "",
1982
- enableMoveFolder: !0,
1983
- enableEdit: !0,
1984
- enableTrash: !0,
1985
- enableCopyFile: !0
1986
- }
1987
- },
1988
- project: void 0,
1989
- page: {
1990
- isNew: !0,
1991
- type: "email",
1992
- project: 0,
1993
- id: "",
1994
- showToken: 0
1995
- }
1996
- },
1997
- editor: {
1998
- config: {
1999
- mode: "editor",
2000
- autosaveTimeout: 5e3,
2001
- autosaveRetryMaxAttempts: 5,
2002
- autosaveRetryIntervalMs: 3e4,
2003
- theme: "",
2004
- themes: {},
2005
- mergeTagsShow: !1,
2006
- styles: "",
2007
- headerShow: !0,
2008
- headerTitleVisible: !0,
2009
- headerPreheaderVisible: !0,
2010
- headerArrowBackVisible: !0,
2011
- historyEnabled: !0,
2012
- codeEnabled: !1,
2013
- codeSideEnabled: !0,
2014
- previewIconEnabled: !0,
2015
- previewModeEnabled: !0,
2016
- livePreviewEnabled: !0,
2017
- sendTestEnabled: !0,
2018
- sharePreviewEnabled: !1,
2019
- webversionEnabled: !1,
2020
- commonStylesEnabled: !1,
2021
- emailResponsiveControlEnabled: !1,
2022
- templateNotEmAlertShow: !1,
2023
- beeFreeConverterEnabled: !0,
2024
- aiLayoutConverterEnabled: !0,
2025
- emailDropdownMenuEnabled: !1,
2026
- emailDropdownMenuClone: !0,
2027
- emailDropdownMenuImport: !1,
2028
- emailDropdownMenuImportButton: !1,
2029
- emailDropdownMenuConvert: !0,
2030
- emailDropdownMenuLock: !0,
2031
- emailDropdownMenuRemove: !0,
2032
- emailExportEnabled: !0,
2033
- exportHtmlEnabled: !0,
2034
- exportTextEnabled: !1,
2035
- exportZipEnabled: !0,
2036
- exportClipboardEnabled: !1,
2037
- exportWebHookEnabled: !1,
2038
- exportOutlookEnabled: !0,
2039
- exportPdfEnabled: !0,
2040
- exportPngEnabled: !0,
2041
- nextButtonEnabled: !1,
2042
- nextButtonText: "",
2043
- saveButtonEnabled: !0,
2044
- saveButtonText: "",
2045
- commandButtonsEnabled: !0,
2046
- emailIdShow: !1,
2047
- sidePanelFloating: !0,
2048
- desktopMobileSwitchRule: !0,
2049
- desktopMobileSwitchPanel: !1,
2050
- onlyCodeModeInMobile: !1,
2051
- pathEnabled: !0,
2052
- copyPasteEnabled: !1,
2053
- saveBlockEnabled: !0,
2054
- globalBlockCheckboxEnabled: !0,
2055
- editImageControlEnabled: !0,
2056
- lockEditor: !1,
2057
- lockPreheaderAndTitle: !1,
2058
- disableSideMenu: !1,
2059
- menuDirection: "right",
2060
- defaultBuildPanel: "",
2061
- commentsEnabled: !1,
2062
- aiAssistentEnabled: !1,
2063
- optimizeEnabled: !1,
2064
- optimizeLinksEnabled: !0,
2065
- optimizeImagesEnabled: !0,
2066
- optimizeSpamAssassinEnabled: !0,
2067
- optimizeCheckCodeEnabled: !0,
2068
- settingsEnabled: !0,
2069
- UTMEnabled: !1,
2070
- subjectEnabled: !0,
2071
- preheaderEnabled: !0,
2072
- descriptionEnabled: !1,
2073
- tagsEnabled: !0,
2074
- isTemplateEnabled: !1,
2075
- switchDesktopMobilePropsEnabled: !0,
2076
- stepToOtherElementEnabled: !1,
2077
- deleteButtonEnabled: !0,
2078
- toggleSidePanel: !1,
2079
- blocksSectionsShow: !0,
2080
- blocksEmptyEnabled: !0,
2081
- blocksSavedEnabled: !0,
2082
- blocksCommonEnabled: !0,
2083
- blocksTemplateEnabled: !0,
2084
- blocksSearchEnabled: !0,
2085
- blocksAddPanelEnabled: !0,
2086
- imagePathDropdownEnabled: !1,
2087
- formFieldImageTitleEnabled: !1,
2088
- formFieldBorderEnabled: !1,
2089
- formFieldBorderRadiusEnabled: !1,
2090
- formFieldBoxShadowEnabled: !1,
2091
- formFieldVisibilityEnabled: !1,
2092
- formFieldExportAsPictureEnabled: !1,
2093
- emailPaneDesktopSize: 0,
2094
- formButtonFieldInsertImageEnabled: !1,
2095
- formButtonFieldVerticalAlignEnabled: !0,
2096
- formButtonFieldTextAlignEnabled: !1,
2097
- formButtonFieldBackgroundImageEnabled: !0,
2098
- formButtonFieldPaddingsEnabled: !1,
2099
- formButtonFieldReplacerEnabled: !1,
2100
- formCellFieldVerticalAlignEnabled: !1,
2101
- formCellFieldBackgroundImageEnabled: !0,
2102
- formCellFieldPaddingsEnabled: !0,
2103
- formCellFieldSizeEnabled: !1,
2104
- formLinkFieldInsertImageEnabled: !0,
2105
- formTableFieldBackgroundImageEnabled: !0,
2106
- formDivFieldBackgroundImageEnabled: !0,
2107
- formImageFieldVerticalAlignEnabled: !1,
2108
- formImageFieldReplacerEnabled: !1,
2109
- formImageFieldHeightEnabled: !1,
2110
- formTextFieldTypografEnabled: !1,
2111
- formTextFieldReplacerEnabled: !1,
2112
- formEmailFieldBackgroundImageEnabled: !0,
2113
- elementImageEnabled: !0,
2114
- elementTextEnabled: !0,
2115
- elementHeaderEnabled: !0,
2116
- elementButtonEnabled: !0,
2117
- elementListULEnabled: !0,
2118
- elementListOLEnabled: !0,
2119
- elementDividerEnabled: !0,
2120
- elementSpacerEnabled: !0,
2121
- elementSocialEnabled: !0,
2122
- elementTableEnabled: !0,
2123
- elementCountdownEnabled: !0,
2124
- elementVideoEnabled: !1,
2125
- elementAIimageEnabled: !0,
2126
- elementAItextEnabled: !1,
2127
- elementCarouselEnabled: !1,
2128
- elementAccordionEnabled: !1,
2129
- elementFormEnabled: !1,
2130
- preventSendDataToEM: !1,
2131
- imageInfoToolUrl: "",
2132
- resourceProxy: void 0,
2133
- resourceProxyPolicy: void 0,
2134
- imageCenterFileManagerView: !0,
2135
- imageCenterLocalUploadEnabled: !0,
2136
- imageCenterStockEnabled: !0,
2137
- imageCenterGifEnabled: !0,
2138
- imageCenterIconStockEnabled: !0,
2139
- imageCenterEditorEnabled: !0,
2140
- compressMaxSize: 1,
2141
- compressMaxWidthOrHeight: 2e3,
2142
- ampExportEnabled: !1,
2143
- formFieldAmpVisibilityEnabled: !1,
2144
- testEmails: [],
2145
- pushToGTM: !0,
2146
- activeNextButton: !0,
2147
- iconStrokeWidth: 1.4
2148
- },
2149
- project: void 0,
2150
- page: {
2151
- isNew: !1,
2152
- type: "email",
2153
- project: 0,
2154
- id: "",
2155
- showToken: 0
2156
- }
2157
- },
2158
- simple: {
2159
- config: {
2160
- mode: "simple",
2161
- autosaveTimeout: 5e3,
2162
- autosaveRetryMaxAttempts: 5,
2163
- autosaveRetryIntervalMs: 3e4,
2164
- theme: "",
2165
- themes: {},
2166
- mergeTagsShow: !1,
2167
- styles: "",
2168
- headerShow: !0,
2169
- headerTitleVisible: !0,
2170
- headerPreheaderVisible: !0,
2171
- headerArrowBackVisible: !0,
2172
- historyEnabled: !0,
2173
- codeEnabled: !0,
2174
- codeSideEnabled: !0,
2175
- previewIconEnabled: !0,
2176
- previewModeEnabled: !0,
2177
- livePreviewEnabled: !0,
2178
- sendTestEnabled: !0,
2179
- sharePreviewEnabled: !0,
2180
- webversionEnabled: !1,
2181
- commonStylesEnabled: !1,
2182
- emailResponsiveControlEnabled: !1,
2183
- templateNotEmAlertShow: !1,
2184
- beeFreeConverterEnabled: !1,
2185
- aiLayoutConverterEnabled: !1,
2186
- emailDropdownMenuEnabled: !0,
2187
- emailDropdownMenuClone: !0,
2188
- emailDropdownMenuImport: !0,
2189
- emailDropdownMenuImportButton: !1,
2190
- emailDropdownMenuConvert: !1,
2191
- emailDropdownMenuLock: !0,
2192
- emailDropdownMenuRemove: !0,
2193
- emailExportEnabled: !0,
2194
- exportHtmlEnabled: !0,
2195
- exportZipEnabled: !0,
2196
- exportTextEnabled: !0,
2197
- exportClipboardEnabled: !0,
2198
- exportWebHookEnabled: !0,
2199
- exportOutlookEnabled: !1,
2200
- exportPdfEnabled: !0,
2201
- exportPngEnabled: !0,
2202
- nextButtonEnabled: !1,
2203
- nextButtonText: "",
2204
- saveButtonEnabled: !0,
2205
- saveButtonText: "",
2206
- commandButtonsEnabled: !0,
2207
- emailIdShow: !1,
2208
- sidePanelFloating: !0,
2209
- desktopMobileSwitchRule: !0,
2210
- desktopMobileSwitchPanel: !1,
2211
- onlyCodeModeInMobile: !1,
2212
- pathEnabled: !0,
2213
- copyPasteEnabled: !0,
2214
- saveBlockEnabled: !0,
2215
- globalBlockCheckboxEnabled: !0,
2216
- editImageControlEnabled: !0,
2217
- lockEditor: !1,
2218
- lockPreheaderAndTitle: !1,
2219
- disableSideMenu: !1,
2220
- menuDirection: "right",
2221
- defaultBuildPanel: "",
2222
- commentsEnabled: !0,
2223
- aiAssistentEnabled: !0,
2224
- optimizeEnabled: !0,
2225
- optimizeLinksEnabled: !0,
2226
- optimizeImagesEnabled: !0,
2227
- optimizeSpamAssassinEnabled: !0,
2228
- optimizeCheckCodeEnabled: !0,
2229
- settingsEnabled: !0,
2230
- UTMEnabled: !1,
2231
- subjectEnabled: !0,
2232
- preheaderEnabled: !0,
2233
- descriptionEnabled: !0,
2234
- tagsEnabled: !0,
2235
- isTemplateEnabled: !0,
2236
- switchDesktopMobilePropsEnabled: !0,
2237
- stepToOtherElementEnabled: !0,
2238
- deleteButtonEnabled: !0,
2239
- toggleSidePanel: !0,
2240
- blocksSectionsShow: !0,
2241
- blocksEmptyEnabled: !0,
2242
- blocksSavedEnabled: !0,
2243
- blocksCommonEnabled: !0,
2244
- blocksTemplateEnabled: !0,
2245
- blocksSearchEnabled: !0,
2246
- blocksAddPanelEnabled: !0,
2247
- imagePathDropdownEnabled: !0,
2248
- formFieldImageTitleEnabled: !0,
2249
- formFieldBorderEnabled: !1,
2250
- formFieldBorderRadiusEnabled: !1,
2251
- formFieldBoxShadowEnabled: !1,
2252
- formFieldVisibilityEnabled: !1,
2253
- formFieldExportAsPictureEnabled: !1,
2254
- emailPaneDesktopSize: 0,
2255
- formButtonFieldInsertImageEnabled: !0,
2256
- formButtonFieldVerticalAlignEnabled: !0,
2257
- formButtonFieldTextAlignEnabled: !0,
2258
- formButtonFieldBackgroundImageEnabled: !0,
2259
- formButtonFieldPaddingsEnabled: !0,
2260
- formButtonFieldReplacerEnabled: !1,
2261
- formCellFieldVerticalAlignEnabled: !0,
2262
- formCellFieldBackgroundImageEnabled: !0,
2263
- formCellFieldPaddingsEnabled: !0,
2264
- formCellFieldSizeEnabled: !1,
2265
- formLinkFieldInsertImageEnabled: !0,
2266
- formTableFieldBackgroundImageEnabled: !0,
2267
- formDivFieldBackgroundImageEnabled: !0,
2268
- formImageFieldVerticalAlignEnabled: !1,
2269
- formImageFieldReplacerEnabled: !1,
2270
- formImageFieldHeightEnabled: !1,
2271
- formTextFieldTypografEnabled: !1,
2272
- formTextFieldReplacerEnabled: !1,
2273
- formEmailFieldBackgroundImageEnabled: !0,
2274
- elementImageEnabled: !0,
2275
- elementTextEnabled: !0,
2276
- elementHeaderEnabled: !0,
2277
- elementButtonEnabled: !0,
2278
- elementListULEnabled: !0,
2279
- elementListOLEnabled: !0,
2280
- elementDividerEnabled: !0,
2281
- elementSpacerEnabled: !0,
2282
- elementSocialEnabled: !0,
2283
- elementTableEnabled: !1,
2284
- elementCountdownEnabled: !1,
2285
- elementVideoEnabled: !1,
2286
- elementAIimageEnabled: !0,
2287
- elementAItextEnabled: !1,
2288
- elementCarouselEnabled: !1,
2289
- elementAccordionEnabled: !1,
2290
- elementFormEnabled: !1,
2291
- preventSendDataToEM: !1,
2292
- imageInfoToolUrl: "",
2293
- resourceProxy: void 0,
2294
- resourceProxyPolicy: void 0,
2295
- imageCenterFileManagerView: !1,
2296
- imageCenterLocalUploadEnabled: !0,
2297
- imageCenterStockEnabled: !0,
2298
- imageCenterGifEnabled: !0,
2299
- imageCenterIconStockEnabled: !0,
2300
- imageCenterEditorEnabled: !0,
2301
- compressMaxSize: 1,
2302
- compressMaxWidthOrHeight: 2e3,
2303
- ampExportEnabled: !1,
2304
- formFieldAmpVisibilityEnabled: !1,
2305
- testEmails: [],
2306
- pushToGTM: !0,
2307
- activeNextButton: !0,
2308
- iconStrokeWidth: 1.4,
2309
- fileManager: {
2310
- defaultFolderName: "",
2311
- enableMoveFolder: !0,
2312
- enableEdit: !0,
2313
- enableTrash: !0
2314
- }
2315
- },
2316
- project: void 0,
2317
- page: {
2318
- isNew: !1,
2319
- type: "email",
2320
- project: 0,
2321
- id: "",
2322
- showToken: 0
2323
- }
2324
- },
2325
- blocks: {
2326
- config: {
2327
- mode: "freeUserBlocks",
2328
- autosaveTimeout: 5e3,
2329
- autosaveRetryMaxAttempts: 5,
2330
- autosaveRetryIntervalMs: 3e4,
2331
- theme: "",
2332
- themes: {},
2333
- mergeTagsShow: !0,
2334
- styles: "",
2335
- revisionService: !1,
2336
- headerShow: !0,
2337
- headerTitleVisible: !0,
2338
- headerPreheaderVisible: !0,
2339
- headerArrowBackVisible: !0,
2340
- historyEnabled: !0,
2341
- codeEnabled: !0,
2342
- codeSideEnabled: !0,
2343
- previewIconEnabled: !0,
2344
- previewModeEnabled: !0,
2345
- livePreviewEnabled: !0,
2346
- sendTestEnabled: !0,
2347
- sharePreviewEnabled: !0,
2348
- webversionEnabled: !0,
2349
- commonStylesEnabled: !0,
2350
- emailResponsiveControlEnabled: !0,
2351
- templateNotEmAlertShow: !1,
2352
- beeFreeConverterEnabled: !1,
2353
- aiLayoutConverterEnabled: !1,
2354
- emailDropdownMenuEnabled: !0,
2355
- emailDropdownMenuClone: !0,
2356
- emailDropdownMenuImport: !0,
2357
- emailDropdownMenuConvert: !1,
2358
- emailDropdownMenuLock: !0,
2359
- emailDropdownMenuRemove: !0,
2360
- emailExportEnabled: !0,
2361
- exportHtmlEnabled: !0,
2362
- exportZipEnabled: !0,
2363
- exportTextEnabled: !0,
2364
- exportClipboardEnabled: !0,
2365
- exportWebHookEnabled: !0,
2366
- exportOutlookEnabled: !0,
2367
- exportPdfEnabled: !0,
2368
- exportPngEnabled: !0,
2369
- nextButtonEnabled: !1,
2370
- nextButtonText: "",
2371
- saveButtonEnabled: !0,
2372
- saveButtonText: "",
2373
- commandButtonsEnabled: !0,
2374
- emailIdShow: !1,
2375
- sidePanelFloating: !0,
2376
- desktopMobileSwitchRule: !0,
2377
- desktopMobileSwitchPanel: !1,
2378
- onlyCodeModeInMobile: !1,
2379
- pathEnabled: !0,
2380
- copyPasteEnabled: !0,
2381
- saveBlockEnabled: !0,
2382
- globalBlockCheckboxEnabled: !0,
2383
- editImageControlEnabled: !0,
2384
- lockEditor: !1,
2385
- lockPreheaderAndTitle: !1,
2386
- disableSideMenu: !1,
2387
- menuDirection: "right",
2388
- defaultBuildPanel: "",
2389
- commentsEnabled: !0,
2390
- aiAssistentEnabled: !0,
2391
- optimizeEnabled: !0,
2392
- optimizeLinksEnabled: !0,
2393
- optimizeImagesEnabled: !0,
2394
- optimizeSpamAssassinEnabled: !0,
2395
- optimizeCheckCodeEnabled: !0,
2396
- settingsEnabled: !0,
2397
- UTMEnabled: !0,
2398
- subjectEnabled: !0,
2399
- preheaderEnabled: !0,
2400
- descriptionEnabled: !0,
2401
- tagsEnabled: !0,
2402
- isTemplateEnabled: !0,
2403
- switchDesktopMobilePropsEnabled: !0,
2404
- stepToOtherElementEnabled: !0,
2405
- deleteButtonEnabled: !0,
2406
- toggleSidePanel: !0,
2407
- blocksSectionsShow: !0,
2408
- blocksEmptyEnabled: !0,
2409
- blocksSavedEnabled: !0,
2410
- blocksCommonEnabled: !0,
2411
- blocksTemplateEnabled: !0,
2412
- blocksSearchEnabled: !0,
2413
- blocksAddPanelEnabled: !0,
2414
- imagePathDropdownEnabled: !0,
2415
- formFieldImageTitleEnabled: !0,
2416
- formFieldBorderEnabled: !0,
2417
- formFieldBorderRadiusEnabled: !0,
2418
- formFieldBoxShadowEnabled: !0,
2419
- formFieldVisibilityEnabled: !0,
2420
- formFieldExportAsPictureEnabled: !0,
2421
- emailPaneDesktopSize: 0,
2422
- formButtonFieldInsertImageEnabled: !0,
2423
- formButtonFieldVerticalAlignEnabled: !0,
2424
- formButtonFieldTextAlignEnabled: !0,
2425
- formButtonFieldBackgroundImageEnabled: !0,
2426
- formButtonFieldPaddingsEnabled: !0,
2427
- formCellFieldVerticalAlignEnabled: !0,
2428
- formCellFieldBackgroundImageEnabled: !0,
2429
- formCellFieldPaddingsEnabled: !0,
2430
- formCellFieldSizeEnabled: !0,
2431
- formButtonFieldReplacerEnabled: !0,
2432
- formLinkFieldInsertImageEnabled: !0,
2433
- formTableFieldBackgroundImageEnabled: !0,
2434
- formDivFieldBackgroundImageEnabled: !0,
2435
- formImageFieldVerticalAlignEnabled: !0,
2436
- formImageFieldReplacerEnabled: !0,
2437
- formImageFieldHeightEnabled: !0,
2438
- formTextFieldTypografEnabled: !0,
2439
- formTextFieldReplacerEnabled: !0,
2440
- formEmailFieldBackgroundImageEnabled: !0,
2441
- elementImageEnabled: !0,
2442
- elementTextEnabled: !0,
2443
- elementHeaderEnabled: !0,
2444
- elementButtonEnabled: !0,
2445
- elementListULEnabled: !0,
2446
- elementListOLEnabled: !0,
2447
- elementDividerEnabled: !0,
2448
- elementSpacerEnabled: !0,
2449
- elementSocialEnabled: !0,
2450
- elementTableEnabled: !1,
2451
- elementCountdownEnabled: !0,
2452
- elementVideoEnabled: !0,
2453
- elementAIimageEnabled: !0,
2454
- elementAItextEnabled: !0,
2455
- elementCarouselEnabled: !0,
2456
- elementAccordionEnabled: !0,
2457
- elementFormEnabled: !1,
2458
- preventSendDataToEM: !1,
2459
- imageInfoToolUrl: "",
2460
- resourceProxy: void 0,
2461
- resourceProxyPolicy: void 0,
2462
- imageCenterFileManagerView: !1,
2463
- imageCenterLocalUploadEnabled: !0,
2464
- imageCenterStockEnabled: !0,
2465
- imageCenterGifEnabled: !0,
2466
- imageCenterIconStockEnabled: !0,
2467
- imageCenterEditorEnabled: !0,
2468
- compressMaxSize: 1,
2469
- compressMaxWidthOrHeight: 2e3,
2470
- ampExportEnabled: !0,
2471
- formFieldAmpVisibilityEnabled: !0,
2472
- testEmails: [],
2473
- pushToGTM: !0,
2474
- activeNextButton: !0,
2475
- iconStrokeWidth: 1.4
2476
- },
2477
- project: void 0,
2478
- page: {
2479
- isNew: !0,
2480
- type: "email",
2481
- project: 0,
2482
- id: "",
2483
- showToken: 0
2484
- }
2485
- }
2486
- }, yt = (t) => {
2487
- return Ke[t] || Ke.editor;
2488
- };
2489
- function M({ id: t, type: e, title: n, excerpt: r, author: o, acf: { subject: i, description: a, html: c, project: f, related_email: p, tags: m, type: s, is_template: l, global_block: u, lock: d }, ...E }) {
2490
- return {
2491
- ...E,
2492
- id: String(t),
2493
- author: String(o),
2494
- renderGuid: lt(),
2495
- description: a,
2496
- html: c,
2497
- excerpt: R(n),
2498
- project: A(f) ? f.ID : f,
2499
- project_author: A(f) ? f.post_author : void 0,
2500
- project_title: A(f) ? f.post_title : void 0,
2501
- tags: m,
2502
- is_template: l,
2503
- global_block: u,
2504
- type: s,
2505
- related_email: y(A(p) ? p.ID : p),
2506
- title: R(n) || "",
2507
- lock: d
2508
- };
2509
- }
2510
- function Je({ title: t, subject: e, description: n, renderGuid: r, html: o, project: i, tags: a, type: c, related_email: f, is_template: p, global_block: m, lock: s, author: l, ...u }) {
2511
- return {
2512
- ...u,
2513
- author: T(l),
2514
- title: t,
2515
- acf: {
2516
- description: n,
2517
- related_email: T(f),
2518
- html: o,
2519
- project: i,
2520
- tags: a,
2521
- type: c,
2522
- is_template: p,
2523
- ...typeof m == "boolean" ? { global_block: m } : {},
2524
- lock: s
2525
- }
2526
- };
2527
- }
2528
- function Ye({ id: t, title: e, acf: { html: n }, excerpt: r, parent: o, author: i, ...a }) {
2529
- return {
2530
- ...a,
2531
- id: y(t),
2532
- author: y(i),
2533
- parent: y(o),
2534
- title: R(e) || "",
2535
- html: n,
2536
- excerpt: A(r) ? r.rendered : r
2537
- };
2538
- }
2539
- function ir({ parent: t, title: e, html: n, project: r, author: o, ...i }) {
2540
- return {
2541
- ...i,
2542
- author: T(o),
2543
- parent: T(t),
2544
- title: R(e),
2545
- "acf[html]": n,
2546
- "acf[project]": A(r) ? r.id || r.ID : r
2547
- };
2548
- }
2549
- var re = { isPlugin: !0 }, ar = {
2550
- em_token: "em_access_token",
2551
- em_refresh_token: "em_refresh_token",
2552
- em_elements_view: "em_elements_view",
2553
- em_new_block: "em_new_block",
2554
- em_new_email: "em_new_email",
2555
- em_id: "em_id",
2556
- em_name: "em_name",
2557
- em_email: "em_email",
2558
- em_locale: "em_locale",
2559
- em_carrotquest_hash: "em_carrotquest_hash",
2560
- em_ducalis_hash: "em_ducalis_hash",
2561
- em_email_subscription_consent: "em_email_subscription_consent",
2562
- em_folder: "em_folder",
2563
- promocode: "promocode",
2564
- em_active_tab: "em_active_tab"
2565
- }, B = {
2566
- em_color_scheme: "em_color_scheme",
2567
- em_code_mode_pane_sizes: "em_code_mode_pane_sizes",
2568
- em_preview_pane_sizes: "em_preview_pane_sizes",
2569
- em_default_sizes: "em_default_sizes",
2570
- em_pane_sizes: "em_pane_sizes",
2571
- em_test_emails: "em_test_emails",
2572
- em_menu_is_locked: "em_menu_is_locked",
2573
- em_code_mode_settings: "em_code_mode_settings",
2574
- em_folder_is_open: "em_folder_is_open",
2575
- em_active_tab: "em_active_tab",
2576
- em_ai_settings: "em_ai_settings",
2577
- em_last_active_page: "em_last_active_page",
2578
- em_layout_convert_never_suggest: "em_layout_convert_never_suggest",
2579
- em_filemanager_v2: "em_filemanager_v2"
2580
- };
2581
- h("application_element_settings_set"), h("application_subject_update"), h("application_preheader_update"), h("application_domparser_error"), h("application_update_entity"), h("application_iframe_drag_event"), h("application_has_amp"), h("application_atom_inserted"), h("SANDBOX_READY"), h("sandbox_subject_update"), h("sandbox_preheader_update"), h("sandbox_drag_event"), h("sandbox_add_mergetag"), h("sandbox_send_translations"), h("sandbox_send_theme_variables"), h("sandbox_set_entity"), h("sandbox_init_start"), h("sandbox_inited"), h("sandbox_update_entity"), h("reload"), h("sandbox_add_extensions"), h("sandbox_remove_extensions"), h("sandbox_add_script"), h("sandbox_is_email_empty"), h("sandbox_switch_theme");
2582
- var lr = {
2583
- ALL: "All",
2584
- STANDARD: "Standard",
2585
- PROJECT: "Project"
2586
- };
2587
- var sr = "Edit selected element", Ze = "Build", vt = "desktop", ur = "mobile", St = W({
2588
- reducerPath: "blocksApi",
2589
- tagTypes: [
2590
- "Blocks",
2591
- "TemplatesBlocks",
2592
- "ParentsBlocks",
2593
- "Block"
2594
- ],
2595
- baseQuery: K({ baseUrl: "https://app.useblocks.io/api/wp-json/wp/v2/" }),
2596
- endpoints: (t) => ({
2597
- getBlocks: t.query({
2598
- queryFn(e, n) {
2599
- const r = _(n), o = {
2600
- order: "desc",
2601
- orderby: "modified"
2602
- }, i = {};
2603
- if (e.notEmbed || (i._embed = ""), e.projectId && (i._embed = "author", i._fields = "id,title,blocktags,blockfolder,group,modified,date,type,acf.lock,acf.project.ID,acf.type,author,acf.is_template,acf.global_block,acf.html,_embedded", o["filter[meta_key]"] = "project", o["filter[meta_value]"] = e.projectId), e.fields && (i._fields = e.fields), e.page && (o.page = e.page), e.order && (o.order = e.order), e.orderby && (o.orderby = e.orderby), e.folderTag && e.folderTag !== "all" ? (o["filter[tax_query][relation]"] = "AND", o["filter[tax_query][0][taxonomy]"] = "blockfolder", o["filter[tax_query][0][field]"] = "id", o["filter[tax_query][0][terms]"] = e.folderTag, o["filter[tax_query][0][include_children]"] = "0") : e.hasOwnProperty("folderTag") && (e.folderTag !== "all" || typeof e.folderTag == "object" && e.folderTag === null) && !e.tags?.length && e.status && e.status !== "trash" && (o["filter[tax_query][0][taxonomy]"] = "blockfolder", o["filter[tax_query][0][operator]"] = "NOT EXISTS"), e.tags?.length > 0 && e.status !== "trash") {
2604
- o["filter[tax_query][relation]"] = "AND";
2605
- for (let a = 0, c = e.tags.length; a < c; a++) {
2606
- const f = e.tags[a];
2607
- o[`filter[tax_query][${a + 1}][taxonomy]`] = "blocktags", o[`filter[tax_query][${a + 1}][field]`] = "id", o[`filter[tax_query][${a + 1}][terms]`] = f;
2608
- }
2609
- }
2610
- return e.type && (o["filter[meta_query][2][key]"] = "type", o["filter[meta_query][2][value]"] = e.type), e.name && (o.search = e.name), e.pageSize && (o.per_page = e.pageSize), e.status === "trash" && (i.status = "trash"), r.wp.eblock_list(o, { extraQuery: i }).then(C(M));
2611
- },
2612
- providesTags: (e) => e ? [...e.map(({ id: n }) => ({
2613
- type: "Blocks",
2614
- id: n
2615
- })), {
2616
- type: "Blocks",
2617
- id: "LIST"
2618
- }] : [{
2619
- type: "Blocks",
2620
- id: "LIST"
2621
- }],
2622
- keepUnusedDataFor: 0
2623
- }),
2624
- getBlocksSchema: t.query({ queryFn(e, n) {
2625
- return _(n).wp.eblock_list(void 0, {
2626
- method: "OPTIONS",
2627
- extraQuery: { _fields: "schema.properties.acf" }
2628
- });
2629
- } }),
2630
- getParentEmailBlocks: t.query({
2631
- queryFn(e, n) {
2632
- const r = _(n), o = { "filter[meta_query][0][compare]": "LIKE" }, i = {};
2633
- if (e.notEmbed || (i._embed = ""), e.emailId && (o["filter[meta_query][0][key]"] = "related_email", o["filter[meta_query][0][value]"] = e.emailId), e.fields && (i._fields = e.fields), e.page && (o.page = e.page), e.tags?.length > 0) {
2634
- o["filter[tax_query][relation]"] = "AND";
2635
- for (let a = 0, c = e.tags.length; a < c; a++) {
2636
- const f = e.tags[a];
2637
- o[`filter[tax_query][${a}][taxonomy]`] = "blocktags", o[`filter[tax_query][${a}][field]`] = "id", o[`filter[tax_query][${a}][terms]`] = f;
2638
- }
2639
- }
2640
- return e.type && (o["filter[meta_query][2][key]"] = "type", o["filter[meta_query][2][value]"] = e.type), e.name && (o.search = e.name), e.pageSize && (o.per_page = e.pageSize), r.wp.eblock_list(o, { extraQuery: i }).then(C(M));
2641
- },
2642
- providesTags: (e) => e ? [...e.map(({ id: n }) => ({
2643
- type: "ParentsBlocks",
2644
- id: n
2645
- })), {
2646
- type: "ParentsBlocks",
2647
- id: "LIST"
2648
- }] : [{
2649
- type: "ParentsBlocks",
2650
- id: "LIST"
2651
- }],
2652
- keepUnusedDataFor: 0
2653
- }),
2654
- getTemplateBlocks: t.query({
2655
- queryFn: (e, n) => {
2656
- const r = _(n), o = {
2657
- "filter[meta_query][1][key]": "is_template",
2658
- "filter[meta_query][1][value]": "1",
2659
- orderby: "modified",
2660
- order: "desc"
2661
- }, i = {};
2662
- if (e.notEmbed || (i._embed = ""), e.fields && (i._fields = e.fields), e.page && (o.page = e.page), e.tags?.length > 0) {
2663
- o["filter[tax_query][relation]"] = "AND";
2664
- for (let a = 0, c = e.tags.length; a < c; a++) {
2665
- const f = e.tags[a];
2666
- o[`filter[tax_query][${a}][taxonomy]`] = "blocktags", o[`filter[tax_query][${a}][field]`] = "id", o[`filter[tax_query][${a}][terms]`] = f;
2667
- }
2668
- }
2669
- return e.type && (o["filter[meta_query][2][key]"] = "type", o["filter[meta_query][2][value]"] = e.type), e.name && (o.search = e.name), e.pageSize && (o.per_page = e.pageSize), r.wp.eblock_list(o, { extraQuery: i }).then(C(M));
2670
- },
2671
- providesTags: (e) => e ? [...e.map(({ id: n }) => ({
2672
- type: "TemplatesBlocks",
2673
- id: n
2674
- })), {
2675
- type: "TemplatesBlocks",
2676
- id: "LIST"
2677
- }] : [{
2678
- type: "TemplatesBlocks",
2679
- id: "LIST"
2680
- }],
2681
- keepUnusedDataFor: 0
2682
- }),
2683
- getBlock: t.query({
2684
- queryFn(e, n) {
2685
- return _(n).wp.eblock_detail({ id: T(e) }, { extraQuery: { _embed: "" } }).then(S(M));
2686
- },
2687
- providesTags: (e, n, r) => [{
2688
- type: "Block",
2689
- id: r
2690
- }],
2691
- keepUnusedDataFor: 0
2692
- }),
2693
- getBlockHistory: t.query({
2694
- queryFn({ blockId: e, page: n = 1 }, r) {
2695
- return _(r).wp.eblock_revisions_list({
2696
- parent: e,
2697
- per_page: 20,
2698
- page: n
2699
- }, { extraQuery: { _fields: "author,slug,date,modified,title,acf.html,acf.common_styles,id" } }).then((o) => ae(o, (i, a) => ({
2700
- data: i.filter((c) => c.acf.html).map((c) => ({
2701
- ...c,
2702
- acf: {
2703
- ...c.acf,
2704
- html: c.acf.html
2705
- }
2706
- })).map(Ye),
2707
- totalPages: +a.response.headers.get("X-WP-TotalPages"),
2708
- args: {
2709
- blockId: e,
2710
- page: n
2711
- }
2712
- })));
2713
- },
2714
- keepUnusedDataFor: 0
2715
- }),
2716
- addBlock: t.mutation({
2717
- queryFn(e, n) {
2718
- return _(n).wp.eblock_create({
2719
- ...Je(e),
2720
- status: "publish"
2721
- }, { type: k.Json }).then(S(M));
2722
- },
2723
- invalidatesTags: [{
2724
- type: "Blocks",
2725
- id: "LIST"
2726
- }]
2727
- }),
2728
- editBlock: t.mutation({ queryFn: Te((e) => ({ blockId: n, source: r, ...o }, i) => {
2729
- const a = _(e), c = Q(Je(o));
2730
- return a.wp.eblock_partial_update({ id: n }, c, {
2731
- type: k.Json,
2732
- extraQuery: { _embed: "wp:term" }
2733
- }).then(S(M));
2734
- }) }),
2735
- deleteBlock: t.mutation({
2736
- queryFn(e, n) {
2737
- const r = _(n);
2738
- let o, i;
2739
- return typeof e == "object" ? (o = e.id, i = e.force) : (o = e, i = !1), r.wp.eblock_delete({ id: o }, { force: i }).then(Ne(M));
2740
- },
2741
- invalidatesTags: (e, n, r) => [{
2742
- type: "Blocks",
2743
- id: r
2744
- }]
2745
- }),
2746
- addTag: t.mutation({ queryFn(e, n) {
2747
- return _(n).wp.blocktags_create({ ...e }, { type: k.Json });
2748
- } }),
2749
- getDeletableTag: t.query({ queryFn([e, n], r) {
2750
- return _(r).wp.eblock_list({
2751
- status: ["private"],
2752
- "filter[meta_key]": "project",
2753
- "filter[meta_value]": e,
2754
- blocktags: [n]
2755
- }, { extraQuery: { "_fields[]": "blocktags" } }).then(C(M));
2756
- } }),
2757
- autoSaveBlock: t.mutation({ queryFn({ blockId: e, body: n }, r) {
2758
- const o = _(r), i = ir(n);
2759
- return o.wp.eblock_autosaves_create({ id: e }, i, { type: k.FormData }).then(S(Ye));
2760
- } })
2761
- })
2762
- }), { useGetBlocksQuery: fo, useGetBlockQuery: po, useLazyGetBlockQuery: mo, useGetBlockHistoryQuery: _o, useLazyGetBlockHistoryQuery: Eo, useGetBlocksSchemaQuery: bo, useGetParentEmailBlocksQuery: go, useAddBlockMutation: ho, useEditBlockMutation: yo, useAddTagMutation: vo, useAutoSaveBlockMutation: So, useGetTemplateBlocksQuery: Ao } = St, et = window.localStorage?.getItem(B.em_code_mode_settings), Ee = et && JSON.parse(et), Ie = {
2763
- activeModal: "",
2764
- lastActiveSettingsTab: Ze,
2765
- activeSettingsTab: Ze,
2766
- isPanelHistoryCollapsed: !0,
2767
- monacoHeight: 0,
2768
- isCodeMode: Ee?.isCodeMode || re.isPlugin && Ee?.isCodeMode === void 0,
2769
- codeModeDirection: Ee?.codeModeDirection || "left",
2770
- isHeaderCodeMenuOpen: {
2771
- current: !1,
2772
- switched: !1
2773
- },
2774
- emailWidth: "100%",
2775
- emailViewType: vt,
2776
- mobileViewActive: {
2777
- shutdown: !0,
2778
- styles: !0
2779
- },
2780
- emailMaxWidthSize: 425,
2781
- propertiesPanelKey: sr,
2782
- parentBlocks: [],
2783
- isGlobalLoading: !1
2784
- };
2785
- localStorage.getItem(B.em_code_mode_settings) || window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
2786
- codeModeDirection: Ie.codeModeDirection,
2787
- isCodeMode: Ie.isCodeMode
2788
- }));
2789
- var { openModal: To, closeModal: Io, setActiveSettingsTab: wo, resetToLastActiveSettingsTab: Po, switchIsPanelHistoryCollapsed: ko, setEmailWidth: Co, switchCodeMode: xo, switchCodeModeDirection: Mo, setMobileViewActive: Do, setEmailViewType: Oo, setCodeMode: fr, setEmailMaxWidthSize: Ro, setPropertiesPanelKey: No, resetParentBlocks: Bo, setIsGlobalLoading: Lo, setHeaderCodeMenuOpen: Fo } = ie({
2790
- name: "emailPageSlice",
2791
- initialState: Ie,
2792
- reducers: {
2793
- openModal: (t, e) => {
2794
- t.activeModal = e.payload;
2795
- },
2796
- closeModal: (t) => {
2797
- t.activeModal = "";
2798
- },
2799
- setActiveSettingsTab: (t, e) => {
2800
- t.lastActiveSettingsTab = t.activeSettingsTab, t.activeSettingsTab = e.payload, e.payload !== "History" && (t.isPanelHistoryCollapsed = !0);
2801
- },
2802
- resetToLastActiveSettingsTab: (t) => {
2803
- t.lastActiveSettingsTab === "Properties" ? t.activeSettingsTab = "Build" : t.activeSettingsTab = t.lastActiveSettingsTab, t.lastActiveSettingsTab !== "History" && (t.isPanelHistoryCollapsed = !0);
2804
- },
2805
- switchIsPanelHistoryCollapsed: (t, e) => {
2806
- t.isPanelHistoryCollapsed = e.payload || !t.isPanelHistoryCollapsed;
2807
- },
2808
- setEmailWidth: (t, { payload: e }) => {
2809
- t.emailWidth = e, t.emailViewType = e > t.emailMaxWidthSize || e === "100%" ? vt : ur, window.localStorage.setItem(B.em_default_sizes, JSON.stringify(e));
2810
- },
2811
- setEmailMaxWidthSize: (t, { payload: e }) => {
2812
- t.emailMaxWidthSize = e;
2813
- },
2814
- setEmailViewType: (t, e) => {
2815
- t.emailViewType = e.payload;
2816
- },
2817
- switchCodeMode: (t) => {
2818
- const e = !t.isCodeMode;
2819
- t.isCodeMode = e, window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
2820
- codeModeDirection: t.codeModeDirection,
2821
- isCodeMode: e
2822
- }));
2823
- },
2824
- setCodeMode: (t, e) => {
2825
- const n = e.payload;
2826
- t.isCodeMode !== n && (t.isCodeMode = n, window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
2827
- codeModeDirection: t.codeModeDirection,
2828
- isCodeMode: n
2829
- })));
2830
- },
2831
- switchCodeModeDirection: (t, e) => {
2832
- t.codeModeDirection = e.payload, window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
2833
- isCodeMode: t.isCodeMode,
2834
- codeModeDirection: e.payload
2835
- }));
2836
- },
2837
- setMobileViewActive: (t, e) => {
2838
- t.mobileViewActive = e.payload;
2839
- },
2840
- setPropertiesPanelKey: (t, e) => {
2841
- t.propertiesPanelKey = e.payload;
2842
- },
2843
- resetParentBlocks: (t) => {
2844
- t.parentBlocks = [];
2845
- },
2846
- setParentBlocks: (t, e) => {
2847
- t.parentBlocks = e.payload;
2848
- },
2849
- setIsGlobalLoading: (t, e) => {
2850
- t.isGlobalLoading = e.payload;
2851
- },
2852
- setHeaderCodeMenuOpen: (t, e) => {
2853
- t.isHeaderCodeMenuOpen.current && !e.payload ? t.isHeaderCodeMenuOpen.switched = !0 : t.isHeaderCodeMenuOpen.switched = !1, t.isHeaderCodeMenuOpen.current = e.payload;
2854
- }
2855
- },
2856
- extraReducers: (t) => {
2857
- t.addMatcher(St.endpoints.getParentEmailBlocks.matchFulfilled, (e, n) => {
2858
- e.parentBlocks = n.payload;
2859
- });
2860
- }
2861
- }).actions, pr = [
2862
- "is_paying",
2863
- "is_paying_user",
2864
- "paying",
2865
- "paying_user"
2866
- ];
2867
- function be(t) {
2868
- if (!t || typeof t != "object") return !1;
2869
- const e = t;
2870
- for (const n of pr) {
2871
- const r = e[n];
2872
- if (r === !0 || r === 1 || r === "1" || typeof r == "string" && r.trim().toLowerCase() === "true") return !0;
2873
- }
2874
- return !1;
2875
- }
2876
- function Y(t) {
2877
- if (t === void 0) return;
2878
- if (t === null || t === "") return null;
2879
- const e = Number(t);
2880
- return Number.isFinite(e) ? e : null;
2881
- }
2882
- function mr(t) {
2883
- if (!t) return !1;
2884
- const e = t, n = e.trial_enabled ?? e.trial ?? e.is_get_trial;
2885
- return n === !0 || n === 1 || n === "1" || typeof n == "string" && n.toLowerCase() === "true";
2886
- }
2887
- function ge(t) {
2888
- const e = t.acf ?? {}, { autosaves: n, hide_mergetags: r, theme: o, newsletter_consent: i, code_editor: a, counters: c, subscription: f, subscription_end: p, recurring_payments: m, subscription_id: s, promocode: l, subscription_amount: u, enterprise_users_limit: d, enterprise_price: E, enterprise_12_price: b, privacy_policy_agreement: g, last_used_project: I, email_confirmation: N, email_builder_config: j } = e, { id: le, acf: Le, ...q } = t, Dt = mr(e), Fe = c ?? {}, Ot = be(e) || be(q) || be(t.meta);
2889
- return {
2890
- ...q,
2891
- id: y(le),
2892
- username: q.username || "",
2893
- email: q.email || "",
2894
- password: q.password || "",
2895
- trial_enabled: Dt,
2896
- is_paying: Ot,
2897
- autosaves: n,
2898
- hide_mergetags: r,
2899
- theme: o,
2900
- newsletter_consent: i,
2901
- code_editor: a ? {
2902
- ...a,
2903
- font_size: Number(a.font_size)
2904
- } : void 0,
2905
- counters: Object.keys(Fe).reduce((je, qe) => (je[qe] = Number(Fe[qe]), je), {}),
2906
- subscription: f,
2907
- subscription_end: p,
2908
- recurring_payments: m,
2909
- subscription_id: s,
2910
- promocode: l,
2911
- subscription_amount: Y(u),
2912
- enterprise_users_limit: Y(d),
2913
- enterprise_price: Y(E),
2914
- enterprise_12_price: Y(b),
2915
- privacy_policy_agreement: g,
2916
- last_used_project: I,
2917
- email_confirmation: N,
2918
- email_builder_config: j
2919
- };
2920
- }
2921
- function _r({ autosaves: t, theme: e, newsletter_consent: n, code_editor: r, counters: o, subscription: i, subscription_end: a, recurring_payments: c, subscription_id: f, promocode: p, subscription_amount: m, enterprise_users_limit: s, enterprise_price: l, enterprise_12_price: u, privacy_policy_agreement: d, locale: E, last_used_project: b, email_confirmation: g, email_builder_config: I, trial_enabled: N, is_paying: j, id: le, ...Le }) {
2922
- return {
2923
- ...Le,
2924
- id: T(le),
2925
- locale: E,
2926
- acf: {
2927
- autosaves: t,
2928
- theme: e,
2929
- newsletter_consent: n,
2930
- code_editor: r ? {
2931
- ...r,
2932
- font_size: String(r.font_size)
2933
- } : void 0,
2934
- counters: o,
2935
- subscription: i,
2936
- subscription_end: a,
2937
- recurring_payments: c,
2938
- subscription_id: f,
2939
- promocode: p,
2940
- subscription_amount: m,
2941
- enterprise_users_limit: s,
2942
- enterprise_price: l,
2943
- enterprise_12_price: u,
2944
- privacy_policy_agreement: d,
2945
- last_used_project: b,
2946
- email_confirmation: g,
2947
- email_builder_config: I,
2948
- ...N !== void 0 ? { trial_enabled: N } : {},
2949
- ...j !== void 0 ? { is_paying: j } : {}
2950
- }
2951
- };
2952
- }
2953
- function Er({ title: t, acf: { limits: e, price: n }, ...r }) {
2954
- return {
2955
- ...r,
2956
- title: R(t) || "",
2957
- limits: e,
2958
- price: n
2959
- };
2960
- }
2961
- var At = W({
2962
- reducerPath: "authorizationApi",
2963
- baseQuery: K({
2964
- baseUrl: "https://app.useblocks.io/api/wp-json/wp/v2/",
2965
- prepareHeaders: (t) => {
2966
- const e = Ut.get(ar.em_token);
2967
- return e && !t.has("authorization") && t.set("authorization", `Bearer ${e}`), t;
2968
- }
2969
- }),
2970
- endpoints: (t) => ({
2971
- getMailConfirmation: t.query({ queryFn(e, n) {
2972
- return _(n).wp.confirmation_list({ ...e });
2973
- } }),
2974
- getSchema: t.query({ queryFn(e, n) {
2975
- return _(n).wp.users_me_list(void 0, {
2976
- method: "OPTIONS",
2977
- extraQuery: { _fields: "schema" }
2978
- });
2979
- } }),
2980
- getMe: t.query({
2981
- query: () => {
2982
- const e = "https://app.useblocks.io/api/v2".replace(/\/+$/, ""), n = typeof window < "u" ? window.location.origin : "";
2983
- return {
2984
- url: `${e.startsWith("http") ? e : `${n}${e}`}/auth/user`,
2985
- method: "GET"
2986
- };
2987
- },
2988
- transformResponse: (e) => ge(Array.isArray(e) ? e[0] : e)
2989
- }),
2990
- getUser: t.query({ queryFn(e, n) {
2991
- return _(n).wp.users_detail({ id: e }).then(S(ge));
2992
- } }),
2993
- editMe: t.mutation({ queryFn(e, n) {
2994
- const r = _(n), o = Q(_r(e), !0);
2995
- return r.wp.users_me_create(o, { type: k.Json }).then(S(ge));
2996
- } }),
2997
- getSubscriptions: t.query({ queryFn(e, n) {
2998
- return _(n).wp.subscription_list(void 0).then(C(Er));
2999
- } }),
3000
- activateTrial: t.mutation({ query: (e) => ({
3001
- url: `${"https://app.useblocks.io/api".replaceAll(/[\\/]$/g, "")}/wp-json/subscription/v2/activate_trial`,
3002
- method: "GET",
3003
- headers: {
3004
- Authorization: `Bearer ${e}`,
3005
- "Content-Type": "application/json"
3006
- }
3007
- }) })
3008
- })
3009
- }), { useGetMeQuery: jo, useLazyGetMeQuery: qo, useEditMeMutation: Uo, useLazyGetSchemaQuery: Go, useGetSubscriptionsQuery: zo, useLazyGetMailConfirmationQuery: Vo, useActivateTrialMutation: Ho } = At, Tt = "configSlice", tt = yt("blocks");
3010
- function Be(t) {
3011
- return t.user.mode || t.serverSide.mode || localStorage.getItem("configSwither") || "pro";
3012
- }
3013
- function It(t) {
3014
- return yt(Be(t))?.config || {};
3015
- }
3016
- function wt(t) {
3017
- const e = Be(t);
3018
- return t.serverSide.advancedConfigs?.[e] || {};
3019
- }
3020
- function Pt(t) {
3021
- const e = Be(t), n = t?.user?.advancedConfigs?.[e], r = n !== void 0 ? n : t?.user?.advancedConfigs?.pro;
3022
- return {
3023
- ...t?.advancedConfigs?.[e] || {},
3024
- ...r || {}
3025
- };
3026
- }
3027
- function he(t) {
3028
- const e = It(t), n = wt(t);
3029
- return [
3030
- Pt(t),
3031
- t.user,
3032
- n,
3033
- t.serverSide,
3034
- e,
3035
- t.base
3036
- ];
3037
- }
3038
- function br(t) {
3039
- let e;
3040
- for (const n of t) n?.fileManager && (e = {
3041
- ...e || {},
3042
- ...n.fileManager
3043
- });
3044
- return e;
3045
- }
3046
- function gr(t) {
3047
- return an(t.map((e) => e?.resourceProxy));
3048
- }
3049
- function hr(t) {
3050
- return cn(t.map((e) => e?.resourceProxyPolicy));
3051
- }
3052
- function yr(t) {
3053
- return ln(t.map((e) => e?.backendProxy));
3054
- }
3055
- function vr(t) {
3056
- return Oe(t.map((e) => e?.backendProxyPolicy || {}).filter(Boolean));
3057
- }
3058
- function Z(t) {
3059
- const e = It(t), n = wt(t), r = Pt(t), o = [
3060
- t.base,
3061
- e,
3062
- t.serverSide,
3063
- n,
3064
- t.user,
3065
- r
3066
- ], i = Oe(o), a = br(o);
3067
- a !== void 0 && (i.fileManager = a);
3068
- const c = gr(o);
3069
- c !== void 0 && (i.resourceProxy = c);
3070
- const f = hr(o);
3071
- f && Object.keys(f).length > 0 && (i.resourceProxyPolicy = f);
3072
- const p = yr(o);
3073
- p !== void 0 && (i.backendProxy = p);
3074
- const m = vr(o);
3075
- return m && Object.keys(m).length > 0 && (i.backendProxyPolicy = m), i;
3076
- }
3077
- jt("config/changeConfigModeWithCodeCheck", async (t, { dispatch: e, getState: n }) => {
3078
- e(Ar(t)), e(At.endpoints.editMe.initiate({ email_builder_config: t })), await new Promise((i) => setTimeout(i, 0));
3079
- const r = n(), o = r.emailPageSlice?.isCodeMode;
3080
- return r.configSlice?.config?.codeEnabled === !1 && o && e(fr(!1)), t;
3081
- });
3082
- var Sr = ie({
3083
- name: Tt,
3084
- initialState: () => {
3085
- const t = {
3086
- ...tt,
3087
- config: {
3088
- ...tt.config,
3089
- mergeTags: void 0
3090
- }
3091
- };
3092
- return {
3093
- base: t.config,
3094
- serverSide: {},
3095
- user: {},
3096
- advancedConfigs: {},
3097
- config: t.config,
3098
- page: t.page,
3099
- project: t.project,
3100
- pluginDefaultCommonStyles: void 0,
3101
- headless: !1
3102
- };
3103
- },
3104
- reducers: {
3105
- setPage: (t, e) => {
3106
- t.page = e.payload;
3107
- },
3108
- setAllConfigs: (t, { payload: e }) => {
3109
- t.user = e.user, t.serverSide = e.serverSide, t.advancedConfigs = {
3110
- ...e.advancedConfigs || {},
3111
- ...e.user?.advancedConfigs || {}
3112
- }, t.config = Z(t);
3113
- },
3114
- changeConfigMode: (t, e) => {
3115
- t.user.mode = e.payload, t.config = Z(t);
3116
- },
3117
- setInitialMergeTags: (t, e) => {
3118
- t.base.mergeTags = e.payload, t.config.mergeTags = fe(he(t), "mergeTags");
3119
- },
3120
- setMergeTags: (t, e) => {
3121
- t.user.mergeTags = e.payload, t.config.mergeTags = fe(he(t), "mergeTags");
3122
- },
3123
- setUserConfig: (t, { payload: e }) => {
3124
- t.user = e, t.config = Z(t);
3125
- },
3126
- updateUserConfig: (t, { payload: e }) => {
3127
- t.user = {
3128
- ...t.user,
3129
- ...e
3130
- }, t.config = Z(t);
3131
- },
3132
- setProject: (t, e) => {
3133
- t.project = e.payload;
3134
- },
3135
- setActiveNextButton: (t, e) => {
3136
- t.user.activeNextButton = e.payload, t.config.activeNextButton = fe(he(t), "activeNextButton") !== void 0;
3137
- },
3138
- setPluginDefaultCommonStyles: (t, e) => {
3139
- e.payload === void 0 ? delete t.pluginDefaultCommonStyles : t.pluginDefaultCommonStyles = e.payload;
3140
- },
3141
- setHeadless: (t, e) => {
3142
- t.headless = e.payload;
3143
- }
3144
- },
3145
- extraReducers: (t) => {}
3146
- }), nt = (t) => t[Tt].config, { setPage: $o, setAllConfigs: Wo, updateUserConfig: Qo, setUserConfig: Ko, setProject: Jo, setMergeTags: Yo, changeConfigMode: Ar, setInitialMergeTags: Zo, setActiveNextButton: ei, setPluginDefaultCommonStyles: ti, setHeadless: ni } = Sr.actions, X = W({
3147
- reducerPath: "emailsApi",
3148
- tagTypes: [
3149
- "Emails",
3150
- "Email",
3151
- "EmailAutosaves",
3152
- "TemplateEmail"
3153
- ],
3154
- baseQuery: K({ baseUrl: "https://app.useblocks.io/api/wp-json/wp/v2/" }),
3155
- endpoints: (t) => ({
3156
- getEmails: t.query({
3157
- queryFn(e, n) {
3158
- const r = _(n), o = {
3159
- order: "desc",
3160
- orderby: "modified"
3161
- }, i = {};
3162
- if (e.notEmbed || (i._embed = ""), e.projectId && (i._embed = "author", i._fields = "id,title,meta,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template,_embedded", o["filter[meta_key]"] = "project", o["filter[meta_value]"] = e.projectId), e.fields && (i._fields = e.fields), e.page && (o.page = e.page), e.order && (o.order = e.order), e.orderby && (o.orderby = e.orderby), e.folderTag && e.folderTag !== "all" ? (o["filter[tax_query][relation]"] = "AND", o["filter[tax_query][0][taxonomy]"] = "folder", o["filter[tax_query][0][field]"] = "id", o["filter[tax_query][0][terms]"] = e.folderTag, o["filter[tax_query][0][include_children]"] = "0") : (e.folderTag !== "all" || typeof e.folderTag == "object" && e.folderTag === null) && !e.tags?.length && e.status && e.status !== "trash" && (o["filter[tax_query][0][taxonomy]"] = "folder", o["filter[tax_query][0][operator]"] = "NOT EXISTS"), e.tags?.length > 0 && e.status !== "trash") {
3163
- o["filter[tax_query][relation]"] = "AND";
3164
- for (let a = 0, c = e.tags.length; a < c; a++) {
3165
- const f = e.tags[a];
3166
- o[`filter[tax_query][${a + 1}][taxonomy]`] = "emailtags", o[`filter[tax_query][${a + 1}][field]`] = "id", o[`filter[tax_query][${a + 1}][terms]`] = f;
3167
- }
3168
- }
3169
- return e.name && (o.search = e.name), e.pageSize && (o.per_page = e.pageSize), e.status === "trash" && (i.status = "trash"), r.wp.email_list(o, { extraQuery: i }).then((a) => C(x)(a));
3170
- },
3171
- providesTags: (e, n, r, { response: o }) => {
3172
- const i = o?.headers.get("X-WP-Total") || 0;
3173
- return e ? [...e.map(({ id: a }) => ({
3174
- type: "Emails",
3175
- id: `${r.folderTag || r.tags?.[0] || r.projectId}_${r.page}_${r.status}_${i}`
3176
- })), {
3177
- type: "Emails",
3178
- id: `${r.folderTag || r.tags?.[0] || r.projectId}_${r.page}_${r.status}_${i}`
3179
- }] : [{
3180
- type: "Emails",
3181
- id: `${r.folderTag || r.tags?.[0] || r.projectId}_${r.page}_${r.status}_${i}`
3182
- }];
3183
- },
3184
- keepUnusedDataFor: 0
3185
- }),
3186
- getTemplateEmails: t.query({
3187
- queryFn(e, n) {
3188
- const r = _(n), o = {
3189
- "filter[meta_query][1][key]": "is_template",
3190
- "filter[meta_query][1][value]": "1",
3191
- "filter[meta_query][0][compare]": "LIKE",
3192
- orderby: "modified",
3193
- order: "desc"
3194
- }, i = {
3195
- _embed: "author,wp:term",
3196
- _fields: "_embedded,id,title,meta,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,acf.is_template"
3197
- };
3198
- if (e.emailId && (o["filter[meta_query][0][key]"] = "parent_email", o["filter[meta_query][0][value]"] = e.emailId), e.fields && (i._fields = e.fields), e.group?.length > 0 || e.projectGroup?.length > 0) {
3199
- const a = [...e.group || [], ...e.projectGroup || []].reduce((f, { key: p, parentId: m }) => (f[m] || (f[m] = []), f[m].push(String(p)), f), {}), c = Object.values(a).map((f) => f.sort());
3200
- o["filter[tax_query][relation]"] = "AND", c.forEach((f, p) => {
3201
- o[`filter[tax_query][${p}][relation]`] = "OR", f.forEach((m, s) => {
3202
- o[`filter[tax_query][${p}][${s}][taxonomy]`] = "group", o[`filter[tax_query][${p}][${s}][field]`] = "id", o[`filter[tax_query][${p}][${s}][terms]`] = m;
3203
- });
3204
- });
3205
- }
3206
- if (e.tags?.length > 0) {
3207
- o["filter[tax_query][relation]"] = "AND";
3208
- for (let a = 0, c = e.tags.length; a < c; a++) {
3209
- const f = e.tags[a];
3210
- o[`filter[tax_query][${a}][taxonomy]`] = "emailtags", o[`filter[tax_query][${a}][field]`] = "id", o[`filter[tax_query][${a}][terms]`] = f;
3211
- }
3212
- }
3213
- if (e.type && (o["filter[meta_query][2][key]"] = "type", o["filter[meta_query][2][value]"] = e.type), e.name && (o.search = e.name), e.pageSize && (o.per_page = e.pageSize), e.page) {
3214
- o.page = e.page;
3215
- const { groupsTemplateProjectTotal: a, groupsTemplateProjectTotalPages: c } = n.getState()?.projectSlice;
3216
- if (!e.projectGroup?.length && !e.group?.length && c < e.page && e.groupType === lr.ALL && a && c && !e.projectId) {
3217
- const f = 24 - a % 24 + (e.page - (c + 1)) * 24;
3218
- f && (o.page = 1, o.offset = f);
3219
- }
3220
- }
3221
- return e.projectId && (o["filter[meta_key]"] = "project", o["filter[meta_value]"] = e.projectId), r.wp.email_list(o, { extraQuery: i }).then(C(x));
3222
- },
3223
- keepUnusedDataFor: 0
3224
- }),
3225
- getEmail: t.query({
3226
- queryFn(e, n) {
3227
- return _(n).wp.email_detail({ id: T(e) }, { extraQuery: {
3228
- _embed: "wp:term",
3229
- _fields: `_embedded,id,author,title,meta,emailtags,folder,group,modified,date,type,parent,date_gmt
3230
- acf.description,
3231
- acf.html,
3232
- acf.common_styles,
3233
- acf.is_template,
3234
- acf.lock,
3235
- acf.parent_email,
3236
- acf.project,
3237
- acf.secret_hash,
3238
- acf.subject,
3239
- acf.utm_parameters
3240
- `
3241
- } }).then(S(x));
3242
- },
3243
- providesTags: (e, n, r) => [{
3244
- type: "Email",
3245
- id: r
3246
- }],
3247
- keepUnusedDataFor: 0
3248
- }),
3249
- getTemplateEmail: t.query({
3250
- queryFn(e, n) {
3251
- return _(n).wp.email_detail({ id: T(e) }, { extraQuery: {
3252
- _embed: "wp:term",
3253
- _fields: `_embedded,id,author,title,meta,emailtags,folder,group,modified,date,type,parent,date_gmt
3254
- acf.description,
3255
- acf.html,
3256
- acf.common_styles,
3257
- acf.is_template,
3258
- acf.lock,
3259
- acf.parent_email,
3260
- acf.project,
3261
- acf.secret_hash,
3262
- acf.subject,
3263
- acf.utm_parameters
3264
- `
3265
- } }).then(S(x));
3266
- },
3267
- providesTags: (e, n, r) => [{
3268
- type: "TemplateEmail",
3269
- id: r
3270
- }],
3271
- keepUnusedDataFor: 0
3272
- }),
3273
- getEmailHistory: t.query({
3274
- queryFn({ emailId: e, page: n = 1 }, r) {
3275
- return _(r).wp.email_revisions_list({
3276
- parent: e,
3277
- per_page: 20,
3278
- page: n
3279
- }, { extraQuery: { _fields: "author,slug,date,modified,title,meta,acf.html,acf.common_styles,id,parent,date_gmt" } }).then((o) => ae(o, (i, a) => ({
3280
- data: i.filter((c) => c.acf.html).map((c) => ({
3281
- ...c,
3282
- acf: {
3283
- ...c.acf,
3284
- html: c.acf.html
3285
- }
3286
- })).map(We),
3287
- totalPages: +a.response.headers.get("X-WP-TotalPages"),
3288
- args: {
3289
- emailId: e,
3290
- page: n
3291
- }
3292
- })));
3293
- },
3294
- providesTags: (e) => e ? [...e.data.map(({ id: n }) => ({
3295
- type: "EmailAutosaves",
3296
- id: n
3297
- })), {
3298
- type: "EmailAutosaves",
3299
- id: "LIST"
3300
- }] : [{
3301
- type: "EmailAutosaves",
3302
- id: "LIST"
3303
- }],
3304
- keepUnusedDataFor: 0,
3305
- async onQueryStarted({ emailId: e }, { queryFulfilled: n, dispatch: r, getState: o }) {
3306
- try {
3307
- const { data: i } = await n, a = o(), c = nt(a).revisionService === !0, f = a.emailSlice?.email?.html ?? null;
3308
- z.onHistoryFetched(e, i.data, r, () => r(X.endpoints.getEmailHistory.initiate({ emailId: e }, { forceRefetch: !0 })), c, f);
3309
- } catch {
3310
- z.onHistoryFetchError(e, r);
3311
- }
3312
- }
3313
- }),
3314
- addEmail: t.mutation({
3315
- queryFn: Te((e) => ({ source: n, ...r }) => _(e).wp.email_create({
3316
- status: "publish",
3317
- ...$e(r)
3318
- }, { type: k.Json }).then(S(x))),
3319
- invalidatesTags: [{
3320
- type: "Emails",
3321
- id: "LIST"
3322
- }]
3323
- }),
3324
- editEmail: t.mutation({ queryFn: Te((e) => ({ emailId: n, source: r, ...o }) => {
3325
- const i = _(e), a = Q($e(o));
3326
- return i.wp.email_partial_update({ id: n }, a, {
3327
- type: k.Json,
3328
- extraQuery: {
3329
- _embed: "wp:term",
3330
- _fields: "_embedded,id,author,title,meta,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"
3331
- }
3332
- }).then(S(x));
3333
- }) }),
3334
- deleteEmail: t.mutation({
3335
- queryFn(e, n) {
3336
- const r = _(n);
3337
- let o, i;
3338
- return typeof e == "object" ? (o = e.id, i = e.force) : (o = e, i = !1), r.wp.email_delete({ id: o }, { force: i }).then(Ne(x));
3339
- },
3340
- invalidatesTags: (e, n, r) => [{
3341
- type: "Emails",
3342
- id: r
3343
- }]
3344
- }),
3345
- addTag: t.mutation({ queryFn(e, n) {
3346
- return _(n).wp.emailtags_create({ ...e }, { type: k.Json });
3347
- } }),
3348
- getDeletableTag: t.query({ queryFn([e, n], r) {
3349
- return _(r).wp.email_list({
3350
- status: ["private"],
3351
- "filter[meta_key]": "project",
3352
- "filter[meta_value]": e,
3353
- emailtags: [n]
3354
- }, { extraQuery: { "_fields[]": "emailtags" } }).then(C(x));
3355
- } }),
3356
- autoSaveEmail: t.mutation({
3357
- queryFn({ emailId: e, body: n }, r) {
3358
- const o = _(r), i = Sn(n);
3359
- return o.wp.email_autosaves_create({ id: e }, i, { type: k.FormData }).then(S(We));
3360
- },
3361
- async onQueryStarted({ emailId: e, body: n }, { queryFulfilled: r, getState: o }) {
3362
- const i = nt(o()).revisionService === !0;
3363
- i && z.onAutoSaveStarted(e, {
3364
- sentAt: Date.now(),
3365
- html: n.html ?? "",
3366
- common_styles: n.common_styles ?? "",
3367
- subject: n.subject,
3368
- preheader: n.preheader
3369
- });
3370
- try {
3371
- await r, i && z.onAutoSaveCompleted(e);
3372
- } catch {
3373
- i && z.onAutoSaveCompleted(e);
3374
- }
3375
- }
3376
- })
3377
- })
3378
- }), { useGetEmailsQuery: ri, useGetTemplateEmailsQuery: oi, useGetEmailQuery: ii, useLazyGetEmailQuery: ai, useGetEmailHistoryQuery: li, useLazyGetEmailHistoryQuery: si, useAddEmailMutation: ui, useEditEmailMutation: di, useDeleteEmailMutation: ci, useGetDeletableTagQuery: fi, useAddTagMutation: pi, useAutoSaveEmailMutation: mi } = X;
3379
- function L({ title: t, acf: e, ...n }) {
3380
- const { members: r, projects_test_emails: o, ftp_settings: i, emails: a, blocks: c, webhook: f, inbox_email: p, integrations: m } = e, s = A(r) ? r : void 0;
3381
- return {
3382
- ...n,
3383
- title: R(t) || "",
3384
- members: s ? {
3385
- admins: s.admins && s.admins.map((l) => ({
3386
- ...l,
3387
- ID: y(l.ID)
3388
- })),
3389
- users: s.users && s.users.map((l) => ({
3390
- ...l,
3391
- ID: y(l.ID)
3392
- })),
3393
- viewers: s.viewers && s.viewers.map((l) => ({
3394
- ...l,
3395
- ID: y(l.ID)
3396
- })),
3397
- invited_users: s.invited_users && s.invited_users.map((l) => ({
3398
- ...l,
3399
- ID: y(l.ID)
3400
- })),
3401
- owner: A(s.owner) ? {
3402
- ...s.owner,
3403
- ID: y(s.owner.ID)
3404
- } : s.owner
3405
- } : void 0,
3406
- projects_test_emails: o,
3407
- inbox_email: p,
3408
- ftp_settings: i,
3409
- webhook: f,
3410
- integrations: m,
3411
- emails: a,
3412
- blocks: c
1290
+ })).catch((c) => {}), {
1291
+ ...e,
1292
+ appInit: a
3413
1293
  };
3414
1294
  }
3415
- function rt({ title: t, members: e, projects_test_emails: n, inbox_email: r, ftp_settings: o, webhook: i, integrations: a, emails: c, blocks: f, ...p }) {
3416
- const m = (d) => Array.isArray(d) ? d : d ? [d] : [], s = (d) => ({ ID: T(d.ID || d) }), l = (d) => m(d).map(s), u = e && {
3417
- admins: l(e.admins),
3418
- users: l(e.users),
3419
- viewers: l(e.viewers),
3420
- invited_users: l(e.invited_users),
3421
- owner: e.owner && s(e.owner)
3422
- };
3423
- return {
3424
- ...p,
3425
- title: t,
3426
- acf: {
3427
- members: u,
3428
- webhook: i,
3429
- projects_test_emails: n,
3430
- inbox_email: r,
3431
- ftp_settings: o,
3432
- integrations: a,
3433
- emails: c,
3434
- blocks: f
3435
- }
1295
+ var z = /* @__PURE__ */ new WeakMap();
1296
+ function ye(e) {
1297
+ let o = null;
1298
+ return async (a, c, d) => (o || (o = Promise.resolve(e(a, c, d)).finally(() => {
1299
+ o = null;
1300
+ })), o);
1301
+ }
1302
+ function be(e) {
1303
+ if (e.standaloneKey) return e;
1304
+ const o = e.getAuthToken;
1305
+ if (!o) return e;
1306
+ let a = z.get(o);
1307
+ return a || (a = ye(o), z.set(o, a)), Promise.resolve(a(e.user, e.project, void 0)).catch((c) => {}), {
1308
+ ...e,
1309
+ getAuthToken: a
3436
1310
  };
3437
1311
  }
3438
- var w = "Projects", ee = "LIST";
3439
- function Tr(t) {
3440
- if (Array.isArray(t)) return t;
3441
- if (t != null && typeof t == "object") {
3442
- const e = t.projects;
3443
- if (Array.isArray(e)) return e;
3444
- }
3445
- return [];
3446
- }
3447
- function Ir(t) {
3448
- if (typeof t == "number" && Number.isFinite(t) && t >= 0) return Math.trunc(t);
3449
- if (typeof t == "string" && t.trim() !== "") {
3450
- const e = parseInt(t, 10);
3451
- if (Number.isFinite(e) && e >= 0) return e;
3452
- }
3453
- }
3454
- function wr(t) {
3455
- if (t == null || typeof t != "object" || Array.isArray(t)) return { title: "" };
3456
- const e = t, n = Ir(e.emails_count);
3457
- return {
3458
- id: e.id,
3459
- title: typeof e.title == "string" ? e.title : "",
3460
- ...n != null ? { emails: n } : {}
1312
+ function W(...e) {
1313
+ const o = e.filter((s) => s != null);
1314
+ if (o.length === 0) return;
1315
+ if (o.length === 1) return o[0];
1316
+ const a = o.find((s) => s.aborted);
1317
+ if (a) return a;
1318
+ if (typeof AbortSignal < "u" && typeof AbortSignal.any == "function") return AbortSignal.any(o);
1319
+ const c = new AbortController(), d = (s) => {
1320
+ c.signal.aborted || c.abort(s.reason);
3461
1321
  };
1322
+ for (const s of o) s.addEventListener("abort", () => d(s), { once: !0 });
1323
+ return c.signal;
3462
1324
  }
3463
- var kt = W({
3464
- reducerPath: "projectsApi",
3465
- tagTypes: [w, "project"],
3466
- baseQuery: K({ baseUrl: "https://app.useblocks.io/api/wp-json/wp/v2/" }),
3467
- endpoints: (t) => ({
3468
- getProjects: t.query({
3469
- queryFn(e = { page: 1 }, n) {
3470
- const r = _(n), o = { status: ["private"] };
3471
- return e.page && (o.page = e.page), e.order && (o.order = e.order), e.orderby && (o.orderby = e.orderby), e.search && (o.search = e.search), e.after && (o.after = e.after), e.before && (o.before = e.before), e.per_page != null && (o.per_page = e.per_page), r.wp.project_list(o).then((i) => {
3472
- const a = C(L)(i);
3473
- if (a.error) return { error: a.error };
3474
- const c = i.headers?.get?.("X-WP-Total"), f = i.headers?.get?.("X-WP-TotalPages"), p = c != null && c !== "" ? parseInt(String(c), 10) : NaN, m = f != null && f !== "" ? parseInt(String(f), 10) : NaN, s = Math.max(1, e.per_page ?? 12), l = Number.isFinite(m) ? m : Number.isFinite(p) ? Math.max(1, Math.ceil(p / s)) : NaN, u = a.data.length, d = Math.max(1, e.page ?? 1), E = s;
3475
- let b = p, g = l;
3476
- return Number.isFinite(b) ? Number.isFinite(g) || (g = Math.max(1, Math.ceil(b / E))) : d === 1 ? u === 0 ? (b = 0, g = 1) : u < E ? (b = u, g = 1) : (b = u + 1, g = 2) : u === 0 ? (b = Math.max(0, (d - 1) * E), g = Math.max(1, d - 1)) : u < E ? (b = (d - 1) * E + u, g = d) : (b = d * E + 1, g = d + 1), {
3477
- data: a.data,
3478
- meta: { projectsListPagination: {
3479
- total: b,
3480
- totalPages: g
3481
- } }
3482
- };
3483
- });
3484
- },
3485
- providesTags: (e) => e ? [...e.map(({ id: n }) => ({
3486
- type: w,
3487
- id: n
3488
- })), {
3489
- type: w,
3490
- id: ee
3491
- }] : [{
3492
- type: w,
3493
- id: ee
3494
- }]
3495
- }),
3496
- getProject: t.query({
3497
- queryFn(e, n) {
3498
- return _(n).wp.project_detail({ id: e }, { extraQuery: { _embed: "wp:term" } }).then(S(L));
3499
- },
3500
- providesTags: (e, n, r) => [{
3501
- type: "project",
3502
- id: r
3503
- }]
3504
- }),
3505
- addProject: t.mutation({
3506
- queryFn(e, n) {
3507
- return _(n).wp.project_create({
3508
- status: "private",
3509
- ...rt(e)
3510
- }, { type: k.Json }).then(S(L));
3511
- },
3512
- invalidatesTags: [{
3513
- type: w,
3514
- id: ee
3515
- }]
3516
- }),
3517
- editProject: t.mutation({
3518
- queryFn({ projectId: e, ...n }, r) {
3519
- const o = _(r), i = Q(rt(n), !0);
3520
- return o.wp.project_partial_update({ id: e }, i, { type: k.Json }).then(S(L));
3521
- },
3522
- invalidatesTags: (e, n, { projectId: r }) => [{
3523
- type: w,
3524
- id: r
3525
- }, {
3526
- type: "project",
3527
- id: r
3528
- }]
3529
- }),
3530
- deleteProject: t.mutation({
3531
- queryFn(e, n) {
3532
- return _(n).wp.project_delete({ id: e }, {}).then(Ne(L));
3533
- },
3534
- invalidatesTags: (e, n, r) => [
3535
- {
3536
- type: w,
3537
- id: r
3538
- },
3539
- {
3540
- type: "project",
3541
- id: r
3542
- },
3543
- {
3544
- type: w,
3545
- id: ee
3546
- }
3547
- ]
3548
- }),
3549
- getFrequentProjects: t.query({
3550
- async queryFn(e, n) {
3551
- const r = typeof e == "number" && e > 0 ? e : 5, o = _(n);
3552
- try {
3553
- const i = await o.projects.top_used_list({ limit: r });
3554
- if (!i.ok || i.error) throw i.error ?? /* @__PURE__ */ new Error("top-used request failed");
3555
- const a = Tr(i.data), c = C(wr)({
3556
- data: a,
3557
- error: i.error,
3558
- meta: i.meta
3559
- });
3560
- return c.error, c;
3561
- } catch {
3562
- const i = await o.wp.project_list({
3563
- per_page: r,
3564
- order: "desc",
3565
- orderby: "modified",
3566
- status: ["private"]
3567
- });
3568
- return C(L)({
3569
- data: i.data,
3570
- error: i.error,
3571
- meta: i.meta
3572
- });
3573
- }
3574
- },
3575
- providesTags: (e) => e && e.length > 0 ? [...e.map(({ id: n }) => ({
3576
- type: w,
3577
- id: n
3578
- })), {
3579
- type: w,
3580
- id: "FREQUENT"
3581
- }] : [{
3582
- type: w,
3583
- id: "FREQUENT"
3584
- }]
3585
- })
3586
- })
3587
- }), { useGetProjectsQuery: _i, useGetProjectQuery: Ei, useAddProjectMutation: bi, useEditProjectMutation: gi, useGetFrequentProjectsQuery: hi } = kt, Pr = "Taxonomies", D = () => window.location.toString().includes("/blocks") ? "block" : "", kr = () => window.location.toString().includes("/blocks") ? "block" : "email", Ct = W({
3588
- reducerPath: "taxonomiesApi",
3589
- tagTypes: [
3590
- Pr,
3591
- "folder",
3592
- "block_folder",
3593
- "Group"
3594
- ],
3595
- baseQuery: K({ baseUrl: "https://app.useblocks.io/api/wp-json/wp/v2/" }),
3596
- endpoints: (t) => ({
3597
- addFolder: t.mutation({ queryFn(e, n) {
3598
- return _(n).wp[D() + "folder_create"](e).then((r) => r);
3599
- } }),
3600
- editFolder: t.mutation({ queryFn({ id: e, data: n }, r) {
3601
- return _(r).wp[D() + "folder_partial_update"]({ id: e }, n).then((o) => o);
3602
- } }),
3603
- deleteFolder: t.mutation({ queryFn(e, n) {
3604
- return _(n).wp[D() + "folder_delete"]({ id: e }, { force: !0 }).then((r) => r);
3605
- } }),
3606
- getFolders: t.query({
3607
- queryFn(e, n) {
3608
- return _(n).wp[D() + "folder_list"]({
3609
- per_page: 100,
3610
- ...e
3611
- }).then((r) => r);
3612
- },
3613
- providesTags: (e, n, r) => [{
3614
- type: "folder",
3615
- id: r
3616
- }]
3617
- }),
3618
- addGroup: t.mutation({ queryFn(e, n) {
3619
- return _(n).wp[D() + "group_create"](e).then((r) => r);
3620
- } }),
3621
- editGroup: t.mutation({ queryFn({ id: e, data: n }, r) {
3622
- return _(r).wp[D() + "group_partial_update"]({ id: e }, n).then((o) => o);
3623
- } }),
3624
- getGroups: t.query({
3625
- queryFn(e, n) {
3626
- return _(n).wp[D() + "group_list"]({
3627
- per_page: 100,
3628
- ...e
3629
- }).then((r) => r);
3630
- },
3631
- providesTags: (e, n, r) => [{
3632
- type: "Group",
3633
- id: r
3634
- }]
3635
- }),
3636
- deleteGroup: t.mutation({ queryFn(e, n) {
3637
- return _(n).wp[D() + "group_delete"]({ id: e }, { force: !0 }).then((r) => r);
3638
- } }),
3639
- addEmailsTag: t.mutation({ queryFn(e, n) {
3640
- return _(n).wp.emailtags_create(e).then((r) => r);
3641
- } }),
3642
- editEmailsTag: t.mutation({ queryFn({ id: e, ...n }, r) {
3643
- return _(r).wp.emailtags_partial_update(e, n).then((o) => o);
3644
- } }),
3645
- deleteEmailsTag: t.mutation({ queryFn(e, n) {
3646
- return _(n).wp.emailtags_delete(e, { force: !0 }).then((r) => r);
3647
- } }),
3648
- getTags: t.query({ queryFn(e, n) {
3649
- return _(n).wp[kr() + "tags_list"]({
3650
- per_page: 100,
3651
- ...e
3652
- }).then((r) => r);
3653
- } })
3654
- })
3655
- }), { useGetFoldersQuery: yi, useGetGroupsQuery: vi, useLazyGetGroupsQuery: Si, useDeleteGroupMutation: Ai, useEditGroupMutation: Ti, useAddGroupMutation: Ii, useGetTagsQuery: wi, useLazyGetFoldersQuery: Pi, useAddFolderMutation: ki, useEditFolderMutation: Ci } = Ct;
3656
- function Cr(t) {
3657
- return t != null && Object.prototype.hasOwnProperty.call(t, "meta");
3658
- }
3659
- function ye(t, e) {
3660
- return Cr(t) ? t.meta : e;
3661
- }
3662
- var V = {
3663
- appliedShowToken: 0,
3664
- invalidateEmailId: null,
3665
- editorThemeColor: "light",
3666
- isSettingsDisabled: !1,
3667
- emailAutosaveTimestamps: {},
3668
- settings: {
3669
- backgroundColor: "",
3670
- backgroundImage: [{
3671
- type: "url",
3672
- value: ""
3673
- }],
3674
- backgroundPositionX: "",
3675
- backgroundPositionY: "",
3676
- backgroundRepeat: "",
3677
- textStrong: !1,
3678
- textItalic: !1,
3679
- textUnderline: !1
3680
- },
3681
- elementSettings: {},
3682
- searchFilters: {},
3683
- emailCommonStyles: "",
3684
- saveTime: null,
3685
- mobileViewActive: {
3686
- shutdown: !0,
3687
- styles: !0
3688
- },
3689
- email: {
3690
- id: void 0,
3691
- is_inited: !1,
3692
- isNew: !1,
3693
- subject: void 0,
3694
- preheader: void 0,
3695
- description: "",
3696
- html: "",
3697
- project: void 0,
3698
- project_author: "",
3699
- project_title: "",
3700
- tags: [],
3701
- utm_parameters: {
3702
- utm_source: "",
3703
- utm_medium: "",
3704
- utm_campaign: "",
3705
- utm_term: "",
3706
- utm_content: ""
3707
- },
3708
- parent_email: null,
3709
- common_styles: "{}",
3710
- title: null,
3711
- emailtags: [],
3712
- group: [],
3713
- isAmp: !1
3714
- },
3715
- emailIsEdit: !1,
3716
- isCodeMode: !1,
3717
- codeModeDirection: void 0,
3718
- emailViewType: void 0,
3719
- changeKey: null,
3720
- problemsList: [],
3721
- activeProblemRange: null,
3722
- emailGroups: {},
3723
- parentGroupOfProject: null,
3724
- projectGroups: [],
3725
- isNeedUpdateAppearance: !1,
3726
- isNeedUpdateContentAppearance: !1
3727
- }, { setEditorThemeColor: xi, setEmailSettings: Mi, setElementSettings: Di, setEmailSettingsDisable: Oi, setSearchFilters: Ri, updateSearchFilters: Ni, setEmailSubject: Bi, setEmailPreheader: Li, setEmailHTML: Fi, resetEmailSlice: ji, setEmailTitle: qi, setEmailFromHistory: Ui, setEmailMeta: Gi, setIsInited: zi, setEmailIsAmp: Vi, setProblemsList: Hi, setActiveProblemRange: Xi, setEmailGroups: $i, setIsNeedUpdateAppearance: Wi, setIsNeedUpdateContentAppearance: Qi } = ie({
3728
- name: "emailSlice",
3729
- initialState: V,
3730
- reducers: {
3731
- setEditorThemeColor: (t, e) => {
3732
- t.editorThemeColor = e.payload;
3733
- },
3734
- setEmailFromHistory: (t, { payload: e }) => {
3735
- if (!e) return;
3736
- const n = t.email, r = e?.preheader === void 0, o = e?.subject === void 0, i = ye(e, n.meta);
3737
- t.email = {
3738
- ...n,
3739
- html: e?.html,
3740
- preheader: r ? n.preheader : e?.preheader,
3741
- subject: o ? n.subject : e?.subject,
3742
- common_styles: typeof e?.common_styles == "string" && e?.common_styles.startsWith("{") ? e?.common_styles : n.common_styles || "{}",
3743
- ...i !== void 0 ? { meta: i } : {}
3744
- }, t.isNeedUpdateAppearance = !0, t.isNeedUpdateContentAppearance = !0;
3745
- },
3746
- setEmailSettings: (t, { payload: e }) => {
3747
- Object.assign(t, {
3748
- ...t,
3749
- settings: { ...e },
3750
- isSettingsDisabled: !1
3751
- });
3752
- },
3753
- setEmailSettingsDisable: (t, e) => {
3754
- t.isSettingsDisabled = e.payload;
3755
- },
3756
- setElementSettings: (t, { payload: e }) => {
3757
- t.elementSettings = e;
3758
- },
3759
- setSearchFilters: (t, e) => {
3760
- t.searchFilters = e.payload;
3761
- },
3762
- updateSearchFilters: (t, e) => {
3763
- t.searchFilters = {
3764
- ...t.searchFilters,
3765
- ...e.payload
3766
- };
3767
- },
3768
- setEmailHTML: (t, e) => {
3769
- t.email.html = e.payload;
3770
- },
3771
- setEmailSubject: (t, e) => {
3772
- (t.email.title === t.email.subject || !t.email.subject && !t.email.title) && (t.email.title = e.payload), t.email.subject = e.payload;
3773
- },
3774
- setEmailPreheader: (t, e) => {
3775
- t.email.preheader = e.payload;
3776
- },
3777
- resetEmailSlice: (t) => {
3778
- const e = t.emailAutosaveTimestamps;
3779
- return {
3780
- ...V,
3781
- emailAutosaveTimestamps: e
3782
- };
3783
- },
3784
- setEmailTitle: (t, e) => {
3785
- t.email.title = e.payload;
3786
- },
3787
- setEmailMeta: (t, e) => {
3788
- if (e.payload === void 0) {
3789
- delete t.email.meta;
3790
- return;
3791
- }
3792
- t.email.meta = {
3793
- ...t.email.meta ?? {},
3794
- ...e.payload
3795
- };
3796
- },
3797
- setIsInited: (t, e) => {
3798
- t.email.is_inited = e.payload;
3799
- },
3800
- setEmailIsAmp: (t, e) => {
3801
- t.email.isAmp = e.payload;
3802
- },
3803
- setProblemsList: (t, e) => {
3804
- t.problemsList = e.payload;
3805
- },
3806
- setActiveProblemRange: (t, e) => {
3807
- t.activeProblemRange = e.payload;
3808
- },
3809
- setIsNeedUpdateContentAppearance: (t, e) => {
3810
- t.isNeedUpdateContentAppearance = e.payload;
3811
- },
3812
- setIsNeedUpdateAppearance: (t, e) => {
3813
- t.isNeedUpdateAppearance = e.payload;
3814
- },
3815
- setEmailGroups: (t, { payload: e }) => {
3816
- const n = Object.keys(e)[0], r = t.emailGroups, o = t.parentGroupOfProject, i = t.projectGroups, a = {};
3817
- o && i.length && (e[n]?.forEach((c) => {
3818
- const f = i.find((m) => m.id === +n), p = f?.children.find((m) => m.id === +c);
3819
- p ? (a.hasOwnProperty(f.id) || (a[f.id] = []), a[f.id].push({
3820
- label: p.name,
3821
- value: p.id
3822
- })) : (a.hasOwnProperty(n) || (a[n] = []), a[n].push({
3823
- label: c,
3824
- value: null
3825
- }));
3826
- }), e[n].length === 0 && (a[n] = [])), t.emailGroups = {
3827
- ...r,
3828
- ...a
3829
- };
3830
- }
3831
- },
3832
- extraReducers: (t) => {
3833
- t.addMatcher((e) => e.type === "emailsApi/queries/queryResultPatched", (e, n) => {
3834
- const r = n.payload.queryCacheKey.match(/\("([0-9]+)"\)/), o = n.payload?.patches[0];
3835
- o?.path?.[0] && (e.email[o?.path[0]] = o.value), r?.[1] && (e.invalidateEmailId = r[1]), e.emailIsEdit = !0;
3836
- }), t.addMatcher((e) => e.type === "emailsApi/invalidateTags", (e, n) => {
3837
- if (n.payload[0].id === +e.invalidateEmailId) return V;
3838
- }), t.addMatcher(X.endpoints.editEmail.matchFulfilled, (e, { payload: n }) => {
3839
- e.invalidateEmailId = null;
3840
- const r = ye(n, e.email.meta);
3841
- e.email = {
3842
- ...e.email,
3843
- ...n,
3844
- renderGuid: e.email.renderGuid,
3845
- ...r !== void 0 ? { meta: r } : {}
3846
- };
3847
- }), t.addMatcher(X.endpoints.autoSaveEmail.matchFulfilled, (e, n) => {
3848
- e.email.id?.toString() === n.payload.parent?.toString() && (e.email.html = n.payload.html, n.payload.modified && (e.email.modified = n.payload.modified, e.emailAutosaveTimestamps[n.payload.parent] = n.payload.modified));
3849
- }), t.addMatcher(X.endpoints.getEmail.matchFulfilled, (e, { payload: n }) => {
3850
- const r = e.email, o = ye(n, n.id === r?.id ? r.meta : void 0), i = r?.id != null && r.id === n.id, a = n.showToken, c = n.showId, f = re.isPlugin && c != null && c !== "";
3851
- if (re.isPlugin && !f && a === void 0 && i && e.appliedShowToken > 0) {
3852
- n.id, e.appliedShowToken, r?.id, r?.showId;
3853
- return;
3854
- }
3855
- if (!f) {
3856
- if (a !== void 0 && a < e.appliedShowToken) {
3857
- n.id, e.appliedShowToken, r?.id;
3858
- return;
3859
- }
3860
- const b = r?.renderGuid != null && r.renderGuid === n.renderGuid;
3861
- if (re.isPlugin && a === void 0 && e.appliedShowToken > 0 && n.id !== r?.id && !b) {
3862
- n.id, e.appliedShowToken, r?.id;
3863
- return;
3864
- }
3865
- }
3866
- const p = f || a !== void 0 && a !== e.appliedShowToken, m = i && n.modified !== void 0 && r.modified === n.modified, s = i && r.is_inited === !0 && m && !p && !!r.html?.trim(), l = i && r.renderGuid ? r.renderGuid : n.renderGuid ?? lt(), { showToken: u, showId: d, ...E } = n;
3867
- e.email = {
3868
- ...V.email,
3869
- ...E,
3870
- ...c ? { showId: c } : {},
3871
- renderGuid: l,
3872
- ...s ? { html: r.html } : {},
3873
- is_inited: n.is_inited || (i ? r?.is_inited : V.email.is_inited),
3874
- common_styles: typeof n?.common_styles == "string" && n?.common_styles.startsWith("{") ? n?.common_styles : "{}",
3875
- ...o !== void 0 ? { meta: o } : {}
3876
- }, a !== void 0 ? e.appliedShowToken = a : (!i || r.is_inited !== !0 || !m) && (e.appliedShowToken += 1), n.id, e.appliedShowToken, r?.id, e.emailIsEdit = !1;
3877
- }), t.addMatcher(Ct.endpoints.getGroups.matchFulfilled, (e, { meta: n, payload: r }) => {
3878
- const o = e.email.group, i = n.arg.originalArgs.parent, a = r;
3879
- i && (e.parentGroupOfProject = i, e.projectGroups = a);
3880
- const c = {};
3881
- i && o.length && a.length && o?.forEach((f) => {
3882
- a?.forEach((p) => {
3883
- const m = p.children.find((s) => s.id === f);
3884
- m && (c.hasOwnProperty(p.id) || (c[p.id] = []), c[p.id].push({
3885
- label: m.name,
3886
- value: m.id
3887
- }));
3888
- });
3889
- }), e.emailGroups = c;
3890
- }), t.addMatcher(kt.endpoints.getProject.matchFulfilled, (e, { meta: n, payload: r }) => {
3891
- e.parentGroupOfProject = r.group?.[0] || null;
3892
- });
3893
- }
3894
- }).actions;
3895
- var xt = "Editor mount element was removed from the document. Call instance.destroy() on host unmount.";
3896
- function Dr() {
3897
- return ke(xt);
1325
+ var G = "Editor mount element was removed from the document. Call instance.destroy() on host unmount.";
1326
+ function we() {
1327
+ return C(G);
3898
1328
  }
3899
- function Or(t) {
3900
- return !(t instanceof DOMException) || t.name !== "AbortError" ? !1 : t.message === xt;
1329
+ function Re(e) {
1330
+ return !(e instanceof DOMException) || e.name !== "AbortError" ? !1 : e.message === G;
3901
1331
  }
3902
- function Rr(t, e, n) {
1332
+ function Ie(e, o, a) {
3903
1333
  if (typeof document > "u") return;
3904
- let r = !1, o;
3905
- const i = () => {
3906
- r = !0, o?.disconnect(), o = void 0;
3907
- }, a = () => {
3908
- r || (i(), e());
1334
+ let c = !1, d;
1335
+ const s = () => {
1336
+ c = !0, d?.disconnect(), d = void 0;
1337
+ }, u = () => {
1338
+ c || (s(), o());
3909
1339
  };
3910
- if (n.addDispose(i), !t.isConnected) {
3911
- queueMicrotask(a);
1340
+ if (a.addDispose(s), !e.isConnected) {
1341
+ queueMicrotask(u);
3912
1342
  return;
3913
1343
  }
3914
- o = new MutationObserver(() => {
3915
- t.isConnected || a();
1344
+ d = new MutationObserver(() => {
1345
+ e.isConnected || u();
3916
1346
  });
3917
- let c = t.parentNode;
3918
- for (; c;) o.observe(c, { childList: !0 }), c = c.parentNode;
3919
- }
3920
- function Nr(t) {
3921
- const { hostElementOption: e, resolvedElement: n, externalSignal: r, disposable: o } = t;
3922
- if (e === void 0 || !(n instanceof Element)) return r;
3923
- const i = new AbortController();
3924
- return Rr(n, () => {
3925
- n.id, i.abort(Dr());
3926
- }, o), bt(r, i.signal);
3927
- }
3928
- var Mt = "Superseded by newer init() on the same mount element";
3929
- function ot() {
3930
- return ke(Mt);
3931
- }
3932
- function Br(t) {
3933
- return !(t instanceof DOMException) || t.name !== "AbortError" ? !1 : t.message === Mt;
3934
- }
3935
- var te = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new WeakMap();
3936
- function Lr(t) {
3937
- if (t instanceof Element) {
3938
- const e = t.id?.trim();
3939
- if (e) return `#${e}`;
1347
+ let g = e.parentNode;
1348
+ for (; g;) d.observe(g, { childList: !0 }), g = g.parentNode;
1349
+ }
1350
+ function Ee(e) {
1351
+ const { hostElementOption: o, resolvedElement: a, externalSignal: c, disposable: d } = e;
1352
+ if (o === void 0 || !(a instanceof Element)) return c;
1353
+ const s = new AbortController();
1354
+ return Ie(a, () => {
1355
+ a.id, s.abort(we());
1356
+ }, d), W(c, s.signal);
1357
+ }
1358
+ var Z = "Superseded by newer init() on the same mount element";
1359
+ function B() {
1360
+ return C(Z);
1361
+ }
1362
+ function Ae(e) {
1363
+ return !(e instanceof DOMException) || e.name !== "AbortError" ? !1 : e.message === Z;
1364
+ }
1365
+ var I = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new WeakMap();
1366
+ function _e(e) {
1367
+ if (e instanceof Element) {
1368
+ const o = e.id?.trim();
1369
+ if (o) return `#${o}`;
3940
1370
  }
3941
1371
  }
3942
- function Fr(t) {
3943
- if (!(t instanceof Element)) return { release: () => {} };
3944
- const e = Lr(t);
3945
- ne.get(t)?.abort(ot()), e && te.get(e)?.abort(ot());
3946
- const n = new AbortController();
3947
- return ne.set(t, n), e && te.set(e, n), {
3948
- signal: n.signal,
1372
+ function Pe(e) {
1373
+ if (!(e instanceof Element)) return { release: () => {} };
1374
+ const o = _e(e);
1375
+ E.get(e)?.abort(B()), o && I.get(o)?.abort(B());
1376
+ const a = new AbortController();
1377
+ return E.set(e, a), o && I.set(o, a), {
1378
+ signal: a.signal,
3949
1379
  release: () => {
3950
- ne.get(t) === n && ne.delete(t), e && te.get(e) === n && te.delete(e);
1380
+ E.get(e) === a && E.delete(e), o && I.get(o) === a && I.delete(o);
3951
1381
  }
3952
1382
  };
3953
1383
  }
3954
- function jr(t, e) {
1384
+ function Se(e, o) {
3955
1385
  return {
3956
- ...t,
3957
- element: e
1386
+ ...e,
1387
+ element: o
3958
1388
  };
3959
1389
  }
3960
- function we() {
1390
+ function k() {
3961
1391
  return () => {};
3962
1392
  }
3963
- function qr(t) {
3964
- const e = t.element;
3965
- return !e || typeof e == "string" || typeof document > "u" ? we() : (Jt(e, t.config?.styles, e), () => {
3966
- Yt(e);
1393
+ function xe(e) {
1394
+ const o = e.element;
1395
+ return !o || typeof o == "string" || typeof document > "u" ? k() : (se(o, e.config?.styles, o), () => {
1396
+ ce(o);
3967
1397
  });
3968
1398
  }
3969
- function Ur(t) {
3970
- if (!ct() || t.initialSpinner === !1 || typeof document > "u") return {
3971
- options: t,
3972
- cleanup: we()
1399
+ function De(e) {
1400
+ if (!F() || e.initialSpinner === !1 || typeof document > "u") return {
1401
+ options: e,
1402
+ cleanup: k()
3973
1403
  };
3974
- const e = t.element;
3975
- if (!e || typeof e == "string") return {
3976
- options: t,
3977
- cleanup: we()
1404
+ const o = e.element;
1405
+ if (!o || typeof o == "string") return {
1406
+ options: e,
1407
+ cleanup: k()
3978
1408
  };
3979
- e.querySelectorAll(".blocks-app-initial-spinner-wrapper").forEach((o) => {
3980
- o.remove();
1409
+ o.querySelectorAll(".blocks-app-initial-spinner-wrapper").forEach((d) => {
1410
+ d.remove();
3981
1411
  });
3982
- const n = tn(e, "data-useblocks"), r = t.handleChunkLoaded;
1412
+ const a = fe(o, "data-useblocks"), c = e.handleChunkLoaded;
3983
1413
  return {
3984
1414
  options: {
3985
- ...t,
1415
+ ...e,
3986
1416
  handleChunkLoaded: () => {
3987
- n(), r?.();
1417
+ a(), c?.();
3988
1418
  }
3989
1419
  },
3990
- cleanup: n
1420
+ cleanup: a
3991
1421
  };
3992
1422
  }
3993
- function Gr(t) {
3994
- return t?.length ? t.some((e) => Array.isArray(e) ? !1 : !!(e && typeof e == "object" && "url" in e)) : !1;
1423
+ function je(e) {
1424
+ return e?.length ? e.some((o) => Array.isArray(o) ? !1 : !!(o && typeof o == "object" && "url" in o)) : !1;
3995
1425
  }
3996
- function it(t) {
3997
- return t instanceof DOMException && t.name === "AbortError";
1426
+ function N(e) {
1427
+ return e instanceof DOMException && e.name === "AbortError";
3998
1428
  }
3999
- function at(t) {
1429
+ function H(e) {
4000
1430
  try {
4001
- t.destroy();
1431
+ e.destroy();
4002
1432
  } catch {}
4003
1433
  }
4004
- function ve(t, ...e) {
4005
- const n = O.get(t);
4006
- e.some((r) => r !== void 0 && r === n) && O.delete(t);
1434
+ function j(e, ...o) {
1435
+ const a = w.get(e);
1436
+ o.some((c) => c !== void 0 && c === a) && w.delete(e);
4007
1437
  }
4008
- var Ki = "1.1.46";
4009
- async function Ji(t) {
4010
- await dt(typeof window.__useblocks__ < "u" ? window.__useblocks__ : void 0);
1438
+ var Je = "1.1.49";
1439
+ async function $e(e) {
1440
+ await $(typeof window.__useblocks__ < "u" ? window.__useblocks__ : void 0);
4011
1441
  }
4012
- async function Yi(t) {
4013
- return zr(t);
1442
+ async function Fe(e) {
1443
+ return Ue(e);
4014
1444
  }
4015
- async function zr(t) {
4016
- P(t.signal);
4017
- const e = new Rt();
4018
- let n;
1445
+ async function Ue(e) {
1446
+ v(e.signal);
1447
+ const o = new X();
1448
+ let a;
4019
1449
  try {
4020
- const r = await Ft(t.element, e, t.signal), o = Nr({
4021
- hostElementOption: t.element,
4022
- resolvedElement: r,
4023
- externalSignal: t.signal,
4024
- disposable: e
4025
- }), i = Fr(r);
4026
- n = i.release;
4027
- const a = bt(o, i.signal);
4028
- return await Lt(Vr(t, r, a), a);
1450
+ const c = await Q(e.element, o, e.signal), d = Ee({
1451
+ hostElementOption: e.element,
1452
+ resolvedElement: c,
1453
+ externalSignal: e.signal,
1454
+ disposable: o
1455
+ }), s = Pe(c);
1456
+ a = s.release;
1457
+ const u = W(d, s.signal);
1458
+ return await Y(ke(e, c, u), u);
4029
1459
  } finally {
4030
- n?.(), e.dispose();
1460
+ a?.(), o.dispose();
4031
1461
  }
4032
1462
  }
4033
- async function Vr(t, e, n) {
4034
- P(n);
4035
- const r = bn(hn(jr(t, e))), o = n != null ? {
4036
- ...r,
4037
- signal: n
4038
- } : r;
4039
- if (e) {
4040
- const p = O.get(e);
4041
- if (p) {
4042
- let m;
1463
+ async function ke(e, o, a) {
1464
+ v(a);
1465
+ const c = ge(be(Se(e, o))), d = a != null ? {
1466
+ ...c,
1467
+ signal: a
1468
+ } : c;
1469
+ if (o) {
1470
+ const h = w.get(o);
1471
+ if (h) {
1472
+ let p;
4043
1473
  try {
4044
- m = await p, P(n);
4045
- } catch (s) {
4046
- if (P(n), ve(e, p), it(s)) throw s;
4047
- m = void 0;
1474
+ p = await h, v(a);
1475
+ } catch (t) {
1476
+ if (v(a), j(o, h), N(t)) throw t;
1477
+ p = void 0;
4048
1478
  }
4049
- if (m) if (m.getElement() === e) try {
4050
- return await m.reset(o);
4051
- } catch (s) {
4052
- if (P(n), Br(s) || Or(s) || it(s) && n?.aborted) throw s;
4053
- ve(e, p, m), at(m);
1479
+ if (p) if (p.getElement() === o) try {
1480
+ return await p.reset(d);
1481
+ } catch (t) {
1482
+ if (v(a), Ae(t) || Re(t) || N(t) && a?.aborted) throw t;
1483
+ j(o, h, p), H(p);
4054
1484
  }
4055
- else ve(e, p, m), at(m);
1485
+ else j(o, h, p), H(p);
4056
1486
  }
4057
1487
  }
4058
- P(n);
4059
- const i = qr(r), a = Ur(r), c = n != null ? {
4060
- ...a.options,
4061
- signal: n
4062
- } : a.options;
4063
- let f;
1488
+ v(a);
1489
+ const s = xe(c), u = De(c), g = a != null ? {
1490
+ ...u.options,
1491
+ signal: a
1492
+ } : u.options;
1493
+ let b;
4064
1494
  try {
4065
- await ut(), P(n);
4066
- const p = typeof window.__useblocks__ < "u" ? window.__useblocks__ : void 0;
4067
- Gr(c.plugins) ? (await De(p), P(n)) : $t(p), P(n), f = Me().then((s) => s.init(c)), e && O.set(e, f);
4068
- const m = await f;
4069
- if (n?.aborted && (m.destroy(), P(n)), e) if (O.get(e) === f) O.set(e, m);
4070
- else throw m.destroy(), P(n), ke(n?.reason);
4071
- return m;
4072
- } catch (p) {
4073
- throw i(), a.cleanup(), e && f && O.get(e) === f && O.delete(e), p;
1495
+ await J(), v(a);
1496
+ const h = typeof window.__useblocks__ < "u" ? window.__useblocks__ : void 0;
1497
+ je(g.plugins) ? (await M(h), v(a)) : ie(h), v(a), b = O().then((t) => t.init(g)), o && w.set(o, b);
1498
+ const p = await b;
1499
+ if (a?.aborted && (p.destroy(), v(a)), o) if (w.get(o) === b) w.set(o, p);
1500
+ else throw p.destroy(), v(a), C(a?.reason);
1501
+ return p;
1502
+ } catch (h) {
1503
+ throw s(), u.cleanup(), o && b && w.get(o) === b && w.delete(o), h;
4074
1504
  }
4075
1505
  }
4076
- async function Zi(t) {
4077
- return (await Me()).parseAMP(t);
1506
+ async function Ke(e) {
1507
+ return (await O()).parseAMP(e);
4078
1508
  }
4079
- typeof window < "u" && Wt(typeof window.__useblocks__ < "u" ? window.__useblocks__ : void 0);
4080
- export { xt as ELEMENT_DETACHED_ABORT_MESSAGE, Mt as SUPERSEDED_INIT_ABORT_MESSAGE, $r as errors, Wr as helpers, Yi as init, Or as isElementDetachedError, Br as isSupersededInitError, Zi as parseAMP, Xr as pluginRegistry, Ji as preload, Ki as version };
1509
+ typeof window < "u" && oe(typeof window.__useblocks__ < "u" ? window.__useblocks__ : void 0);
1510
+ export { G as ELEMENT_DETACHED_ABORT_MESSAGE, Z as SUPERSEDED_INIT_ABORT_MESSAGE, Me as errors, qe as helpers, Fe as init, Re as isElementDetachedError, Ae as isSupersededInitError, Ke as parseAMP, Te as pluginRegistry, $e as preload, Je as version };