@emailmaker/emailmaker 1.1.75 → 1.1.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +18 -7
  3. package/{emailmaker-core.705f9cde.js → emailmaker-core.79ea451d.js} +6 -6
  4. package/emailmaker-esm.js +127 -127
  5. package/{emailmaker-po.705f9cde.js → emailmaker-po.79ea451d.js} +1 -1
  6. package/emailmaker.d.ts +51 -24
  7. package/emailmaker.js +3 -3
  8. package/iframe/css/sandbox-dark.css +1 -1
  9. package/iframe/css/sandbox-darktheme.css +3 -3
  10. package/iframe/css/sandbox-light.css +1 -1
  11. package/iframe/css/sandbox.css +2 -2
  12. package/iframe/js/amp.BX1rGa_X.js +1 -0
  13. package/iframe/js/iframe-eblock.js +1 -1
  14. package/iframe/js/iframe.js +1 -1
  15. package/iframe/js/rules.B-wCbIo7.js +1 -1
  16. package/package.json +1 -1
  17. package/static/core/{e44c2cac.js → 12f8b705.js} +15 -15
  18. package/static/core/{8e559366.js → 1b3e2d70.js} +4 -4
  19. package/static/core/{2dd8b882.js → 2180385a.js} +100 -100
  20. package/static/core/{a5a25e092.js → 3834896e2.js} +41 -41
  21. package/static/core/{baee7d8b2.js → 5ec924792.js} +2710 -2494
  22. package/static/core/{fb14792c.js → 62284a79.js} +2786 -2640
  23. package/static/core/{dd6d3ae42.js → 69d13cd82.js} +72 -72
  24. package/static/core/860577ca.js +3280 -0
  25. package/static/core/{7af547562.js → 8bf24c892.js} +987 -970
  26. package/static/core/{23d0be47.js → af78f5c5.js} +3 -3
  27. package/static/core/{aaa151dc.js → c62226dd.js} +528 -523
  28. package/static/core/{2181dfc12.js → d31af2772.js} +2155 -2090
  29. package/static/core/{3af12861.js → d6d05bc8.js} +19537 -18598
  30. package/static/core/{7093b78e.js → d825fdc8.js} +272 -248
  31. package/static/core/{d6093d8d.js → dd044cfd.js} +7 -7
  32. package/static/core/f422bc19.js +1098 -0
  33. package/static/core/{4efbc972.js → f4cfd2a7.js} +2468 -2613
  34. package/static/core/{f5f707b8.js → f740dd7d.js} +54 -54
  35. package/static/umd-runtime/{DntxC9N-.js → Py_VRWLn.js} +7 -1
  36. package/static/umd-runtime/runtime.js +2 -2
  37. package/static/umd-runtime/ui-kit.js +1742 -1734
  38. package/ui-kit/index.js +1859 -1851
  39. package/iframe/js/amp.CcyAlXr8.js +0 -1
  40. package/static/core/1f9bc4c3.js +0 -925
  41. package/static/core/e430193d.js +0 -3189
  42. /package/iframe/{iframe-eblock.705f9cde.html → iframe-eblock.79ea451d.html} +0 -0
  43. /package/iframe/{iframe.705f9cde.html → iframe.79ea451d.html} +0 -0
@@ -1,25 +1,25 @@
1
1
  (function(){try{if(typeof document<"u"){var o=document.createElement("style");o.setAttribute("data-emailmaker","true"),o.appendChild(document.createTextNode(".blocks-app .image-preview{text-align:center;min-height:100px;position:relative}.blocks-app .image-preview .image-editor-modal{border:1px solid red}.blocks-app .image-preview__edit-button{position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-preview img{border:1px solid var(--em-colorBorder);border-radius:6px;max-width:100%;max-height:500px}.blocks-app .image-editor-modal .ant-modal-container{flex-direction:column;min-height:100vh;display:flex;border-radius:0!important}.blocks-app .image-editor-modal .ant-modal-body{flex-grow:1;display:flex}.blocks-app .image-editor-modal .ant-modal-body #pixie-editor{flex-grow:1;height:calc(100vh - 70px);min-height:calc(100vh - 70px);overflow:hidden}.blocks-app .image-editor-modal .pi .text-on-primary{background:var(--em-colorPrimary);border-color:var(--em-colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary:hover{background:var(--em-colorPrimaryHover);border-color:var(--em-colorPrimaryHover)}.blocks-app .image-editor-modal .pi .text-on-primary.rounded-full{border-radius:calc(var(--em-borderRadius) * 1px)}.blocks-app .image-editor-modal .pi .shadow-xl{box-shadow:none}.blocks-app .image-editor-modal .w-\\[4ch\\].text-sm.text-center{width:5ch}.blocks-app .image-editor-modal .pi .border-white{border-color:var(--em-colorPrimary)}.blocks-app .image-editor-modal .pi .bg-white\\/50{background-color:var(--em-colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary{color:var(--em-colorWhite)}.blocks-app .serach-results .ant-row{align-items:center}.blocks-app .serach-results .blocks-search__divider-wrapper{margin-top:12px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{border-top:1px solid var(--em-colorBorderSecondary);background:0 0;width:100%;height:1px;min-height:0;margin:0;position:static}.blocks-app .slideshow-container{width:524px;height:350px;margin:auto;position:relative;overflow:hidden}.blocks-app .slideshow-image{opacity:0;width:100%;height:100%;position:absolute;top:0;left:0}.blocks-app .image-ai .slideshow-image{width:auto;height:auto}.blocks-app .image-ai__image-item{text-align:center;border-radius:6px;justify-content:center;align-items:center;min-height:100px;display:flex;position:relative}.blocks-app .image-ai__image-item .buttons{justify-content:space-between;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-ai .text-area-input-hybrid{border:none;outline:none;min-height:0;padding:0 0 0 1px}.blocks-app .image-ai .text-area-input-hybrid textarea{height:32px;min-height:32px;padding:3px 11px;line-height:26px}.blocks-app .image-ai__loading{justify-content:center;align-items:center;min-height:150px;display:flex}.blocks-app .image-ai__loading .spin{flex-direction:column;justify-content:center;align-items:center;height:150px;display:flex}.blocks-app .image-ai__loading .status{margin:3px 0 0}.blocks-app .image-ai__preview{border-radius:6px;margin-top:24px;overflow:hidden}.blocks-app .image-ai__preview .image-ai__image-item img{border-radius:calc(var(--em-borderRadius) * 1px);object-fit:contain;max-height:100%;transition:height 1s;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}.blocks-app .image-ai .small{width:302px;height:202px}.blocks-app .image-ai .large{width:524px;height:350px}.blocks-app .image-ai .image-ai__row{padding:0 2px}.blocks-app .image-ai .image-ai__input-affix-wrapper{border-style:solid;border-width:calc(var(--em-borderWidth) * 1px);border-color:var(--em-colorFillSecondaryDarken);border-radius:calc(var(--em-borderRadius) * 1px);width:100%;padding-left:0;display:inline-flex}.blocks-app .image-ai .image-ai__input-affix-wrapper:hover{border-color:var(--em-borderColorHover)}.blocks-app .image-ai .image-ai__input-affix-wrapper.ant-input-affix-wrapper-focused{border-color:var(--em-colorPrimaryBorder)}.blocks-app .image-ai .image-ai__textarea{font-size:16px}.blocks-app .image-ai .image-ai__input-icon{font-size:16px;top:0;right:0}.dark .blocks-app .image-ai .image-ai__preview .image-ai__image-item img{background:#2b2b2b;border:1px solid #434343}.dark .blocks-app .image-ai .ant-btn{background:#1f1f1f}.dark .blocks-app .image-ai .ant-btn:hover{color:var(--em-colorPrimary)}.blocks-app .stock-tab img{border-radius:0;max-width:none;max-height:none}.blocks-app .stock-tab .stock-search-input{padding:0 2px}.blocks-app .stock-tab .my-masonry-grid{text-align:center;width:auto;display:flex}.blocks-app .stock-tab .my-masonry-grid_column{background-clip:padding-box}.blocks-app .stock-tab .list-item{cursor:pointer;background:#f0f2f5;border:1px solid #f0f2f5;border-radius:6px;min-height:100px;max-height:100px;margin-bottom:20px;transition:all .3s;display:inline-block;position:relative;overflow:hidden}.blocks-app .stock-tab .list-item .overlay-image{opacity:0;background-size:cover;width:110px;height:40px;transition:opacity .5s;position:absolute;bottom:10px;right:10px}.blocks-app .stock-tab .list-item .ant-spin{color:#f0f2f5;font-size:20px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.blocks-app .stock-tab .list-item img{object-fit:cover;opacity:0;border-radius:6px;height:auto;transition:opacity .5s ease-in-out;display:block}.blocks-app .stock-tab .list-item.loaded{border:1px solid #d9d9d9;max-height:1000px}.blocks-app .stock-tab .list-item.loaded img{opacity:1;height:100%}.blocks-app .stock-tab .list-item.loaded .loaded-image{opacity:.5}.blocks-app .stock-tab .list-item:hover{box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #00000017}.blocks-app .stock-tab .list-item:hover p.creator-info,.blocks-app .stock-tab .list-item:hover .overlay-image{opacity:1}.blocks-app .stock-tab .list-item p.creator-info{color:#fff;opacity:0;background-color:#00000080;border-radius:0 0 6px;margin:0;padding:5px;font-size:10px;line-height:1.2;position:absolute;bottom:0;right:0}.blocks-app .stock-tab .list-item p.creator-info:hover a{color:#fff;text-decoration:underline}.blocks-app .stock-tab .list-item p.creator-info a{color:#fff;text-decoration:none}.blocks-app .stock-color-filter{display:flex}.blocks-app .stock-color-filter label{border-width:1px;width:24px;height:24px;margin:4px;padding:0;font-size:0;border-radius:6px!important}.blocks-app .stock-color-filter label.all-colors{background-image:linear-gradient(135deg,red,#ff7f00,#ff0,#0f0,#00f,#8b00ff)}.blocks-app .stock-color-filter label.black-color{background:#222}.blocks-app .stock-color-filter label.bw-color{background-image:linear-gradient(135deg,#222 50%,#fff 50%)}.blocks-app .stock-color-filter label.white-color{background:#fff}.blocks-app .stock-color-filter label.orange-color{background:#fa8c16}.blocks-app .stock-color-filter label.red-color{background:#f5222d}.blocks-app .stock-color-filter label.purple-color{background:#722ed1}.blocks-app .stock-color-filter label.magenta-color{background:#eb2f96}.blocks-app .stock-color-filter label.green-color{background:#52c41a}.blocks-app .stock-color-filter label.teal-color{background:#43c3c3}.blocks-app .stock-color-filter label.blue-color{background:#1677ff}.blocks-app .stock-color-filter .ant-radio-button-wrapper:not(:first-child):before{display:none}.blocks-app .serach-results{padding-top:6px}.blocks-app .serach-results .stock-search-input{width:322px;padding:0 2px}.blocks-app .serach-results .blocks-search__divider-wrapper{width:calc(100% + 48px);margin-top:12px;margin-left:-24px;margin-right:-24px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{pointer-events:none;border-top:1px solid var(--em-colorBorderSecondary);background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);border-bottom:none;width:100%;height:20px;min-height:20px;margin:0;position:relative;bottom:auto;left:auto;right:auto}.dark .blocks-app .image-center .stock-tab .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{background:linear-gradient(180deg, var(--em-colorBgBase), transparent 40%)}.dark .blocks-app .stock-tab .list-item{background:#2b2b2b;border:1px solid #2b2b2b}.dark .blocks-app .stock-tab .list-item.loaded{border:1px solid #434343}.blocks-app .image-center .image-center-image-preview{justify-content:center;align-items:center;display:flex}.blocks-app .image-center .ant-divider-horizontal{pointer-events:none;z-index:1;background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);width:calc(100% + 48px);height:20px;margin:24px -24px 0;position:absolute;bottom:-19px}.dark .blocks-app .image-center .ant-divider-horizontal{background:linear-gradient(180deg, var(--em-colorBgBase), transparent 40%)}.blocks-app .image-center .ant-divider-horizontal.ant-divider-with-text{background:0 0;width:calc(100% + 38px);margin:0 -24px 20px;position:relative;top:0}.blocks-app .image-center img{border-radius:4px;max-width:524px;max-height:352px}.blocks-app .image-center .image-size{justify-content:center;margin-top:6px;font-size:14px;line-height:22px;display:flex}.blocks-app .image-center .ant-upload.ant-upload-drag{border-radius:6px}.blocks-app .image-center .ant-modal-body .stock-search-input{margin-bottom:0}.blocks-app .image-center .ant-modal-body .serach-results .stock-search-input{margin-bottom:10px}.blocks-app .image-center .ant-modal-body .ant-form:not(.serach-results) .ant-form-item:last-child{margin-bottom:0}.blocks-app .image-center .ant-modal-body .ant-tabs{transition:all .7s cubic-bezier(.075,.82,.165,1)}.blocks-app .image-center .ant-modal-body .ant-tabs .ant-tabs-content-holder{overflow-y:clip}.blocks-app .ant-modal{transition:width .7s ease-in-out}")),document.head.appendChild(o)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- __emailmaker__.define("static/core/aaa151dc.js", [
2
+ __emailmaker__.define("static/core/c62226dd.js", [
3
3
  "require",
4
4
  "exports",
5
5
  "module",
6
6
  "static/core/7df48ae1.js",
7
- "static/core/fb14792c.js",
8
- "static/core/1f9bc4c3.js",
9
- "static/core/e430193d.js",
10
- "static/core/7af547562.js",
11
- "static/core/baee7d8b2.js",
7
+ "static/core/62284a79.js",
8
+ "static/core/f422bc19.js",
9
+ "static/core/860577ca.js",
10
+ "static/core/8bf24c892.js",
11
+ "static/core/5ec924792.js",
12
12
  "static/core/4c113afa.js",
13
13
  "static/core/fc878f95.js",
14
14
  "react",
15
15
  "react/jsx-runtime"
16
- ], function(ue, yt, mn) {
17
- const Ze = ue("./7df48ae1.js"), u = ue("./fb14792c.js"), Q = ue("./1f9bc4c3.js"), ne = ue("./e430193d.js"), f = ue("./7af547562.js"), B = ue("./baee7d8b2.js"), vt = ue("./4c113afa.js"), Xe = ue("./fc878f95.js");
16
+ ], function(ue, bt, hn) {
17
+ const Xe = ue("./7df48ae1.js"), d = ue("./62284a79.js"), ee = ue("./f422bc19.js"), te = ue("./860577ca.js"), f = ue("./8bf24c892.js"), R = ue("./5ec924792.js"), wt = ue("./4c113afa.js"), Je = ue("./fc878f95.js");
18
18
  let n = ue("react");
19
- n = Ze.__toESM(n);
19
+ n = Xe.__toESM(n);
20
20
  let r = ue("react/jsx-runtime");
21
- var Ct = Ze.__toESM(ne.require_prop_types());
22
- function bt(t, e) {
21
+ var At = Xe.__toESM(te.require_prop_types());
22
+ function It(t, e) {
23
23
  return { [t]: {
24
24
  Filter: e("Filter"),
25
25
  filter: e("filter"),
@@ -105,7 +105,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
105
105
  square: e("square")
106
106
  } };
107
107
  }
108
- function Je(t, e = "application/octet-stream") {
108
+ function $e(t, e = "application/octet-stream") {
109
109
  let s = t.trim(), i = e?.trim() || "application/octet-stream";
110
110
  const o = s.indexOf(",");
111
111
  if (s.startsWith("data:") && o >= 0) {
@@ -116,7 +116,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
116
116
  for (let g = 0; g < m.length; g++) p[g] = m.charCodeAt(g);
117
117
  return new Blob([p], { type: i });
118
118
  }
119
- var wt = "static/media/image-editor", At = { text: {
119
+ var xt = "static/media/image-editor", St = { text: {
120
120
  replaceDefaultItems: !0,
121
121
  defaultText: "Handwriting",
122
122
  items: [
@@ -234,7 +234,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
234
234
  }
235
235
  ]
236
236
  } };
237
- function It(t, e, s, i) {
237
+ function kt(t, e, s, i) {
238
238
  if (e.type === "linear") {
239
239
  const o = t.createLinearGradient(s + e.coords.x1, i + e.coords.y1, s + e.coords.x2, i + e.coords.y2);
240
240
  return e.colorStops.forEach((l) => o.addColorStop(l.offset, l.color)), o;
@@ -245,82 +245,82 @@ __emailmaker__.define("static/core/aaa151dc.js", [
245
245
  }
246
246
  throw new Error("Unknown gradient type");
247
247
  }
248
- function xt(t) {
248
+ function Et(t) {
249
249
  if (!this.backgroundColor) return;
250
250
  const e = this._getNonTransformedDimensions(), s = -e.x / 2, i = -e.y / 2, o = e.x, l = e.y, m = this.backgroundColor;
251
251
  if (typeof m == "string" || m instanceof CanvasGradient || m instanceof CanvasPattern) t.fillStyle = m, t.fillRect(s, i, o, l);
252
- else if (typeof m == "object" && "type" in m && (m.type === "linear" || m.type === "radial")) t.fillStyle = It(t, m, s, i), t.fillRect(s, i, o, l);
252
+ else if (typeof m == "object" && "type" in m && (m.type === "linear" || m.type === "radial")) t.fillStyle = kt(t, m, s, i), t.fillRect(s, i, o, l);
253
253
  else if ("source" in m && (m.source instanceof HTMLImageElement || m.source instanceof HTMLCanvasElement)) if (m.repeat) {
254
254
  const p = t.createPattern(m.source, m.repeat);
255
255
  p && (t.fillStyle = p, t.fillRect(s, i, o, l));
256
256
  } else t.drawImage(m.source, s, i, o, l);
257
257
  this._removeShadow(t);
258
258
  }
259
- function St(t) {
259
+ function Rt(t) {
260
260
  t?.fabric && t.fabric.on("object:added", (e) => {
261
261
  const s = e.target;
262
- s && s.name === "text" && (s._renderBackground = xt);
262
+ s && s.name === "text" && (s._renderBackground = Et);
263
263
  });
264
264
  }
265
- function Rt(t, e) {
265
+ function jt(t, e) {
266
266
  if (t === "json") return new Blob([e], { type: "application/json" });
267
267
  if (t === "svg") return new Blob([e], { type: "image/svg+xml" });
268
268
  const s = `image/${t}`;
269
- return Je(e.replace(/data:image\/([a-z]*)?;base64,/, ""), s);
269
+ return $e(e.replace(/data:image\/([a-z]*)?;base64,/, ""), s);
270
270
  }
271
- var kt = ({ currentImageLink: t, prefetchedBlob: e, resolveImageBlob: s, onSave: i, uploadImageResultIsLoading: o }) => {
272
- const l = B.useCookieManager(), [m, p] = (0, n.useState)(), [g, x] = (0, n.useState)(), { __: h } = f.useI18n();
273
- let v = u.useDispatch();
274
- const A = u.useStore(), k = u.useAppConfig(), b = u.useSelector(u.selectedCurrentUser), O = u.useSelector(Q.selectSecondModal), w = u.useSelector(u.selectProject), U = (0, n.useMemo)(() => {
275
- if (!k?.icons) return;
276
- const E = {};
277
- for (const [z, j] of Object.entries(k.icons)) typeof j == "string" && (E[z] = B.sanitizeHtml(j));
278
- return Object.keys(E).length > 0 ? E : void 0;
279
- }, [k?.icons]), L = (0, n.useRef)(!1), [M, V] = (0, n.useState)(), P = u.useEventEmitter(u.events.FILE_PROXY_EVENT_ID);
271
+ var Lt = ({ currentImageLink: t, prefetchedBlob: e, resolveImageBlob: s, onSave: i, uploadImageResultIsLoading: o }) => {
272
+ const l = R.useCookieManager(), [m, p] = (0, n.useState)(), [g, x] = (0, n.useState)(), { __: h } = f.useI18n();
273
+ let v = d.useDispatch();
274
+ const I = d.useStore(), E = d.useAppConfig(), b = d.useSelector(d.selectedCurrentUser), O = d.useSelector(ee.selectSecondModal), w = d.useSelector(d.selectProject), U = (0, n.useMemo)(() => {
275
+ if (!E?.icons) return;
276
+ const j = {};
277
+ for (const [z, L] of Object.entries(E.icons)) typeof L == "string" && (j[z] = R.sanitizeHtml(L));
278
+ return Object.keys(j).length > 0 ? j : void 0;
279
+ }, [E?.icons]), D = (0, n.useRef)(!1), [B, V] = (0, n.useState)(), M = d.useEventEmitter(d.events.FILE_PROXY_EVENT_ID);
280
280
  (0, n.useEffect)(() => {
281
- let E = !1;
281
+ let j = !1;
282
282
  return (async () => {
283
- const j = t;
284
- if (!j && !e) return;
283
+ const L = t;
284
+ if (!L && !e) return;
285
285
  let S = e;
286
- if (!S && j) try {
287
- typeof s == "function" ? S = await s(j) : S = await (await fetch(j)).blob();
286
+ if (!S && L) try {
287
+ typeof s == "function" ? S = await s(L) : S = await (await fetch(L)).blob();
288
288
  } catch {
289
- if (E) return;
290
- if (S = await P.fire({
291
- url: j,
289
+ if (j) return;
290
+ if (S = await M.fire({
291
+ url: L,
292
292
  project: w
293
293
  }).filter((N) => N instanceof Blob)[0], !S) {
294
- const N = l.get(u.APP_COOKIES.em_token) || await u.di.getInstance(A, Q.TOKEN_ID);
295
- S = await (await fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(j)}`, { headers: { authorization: `Bearer ${N}` } })).blob();
294
+ const N = l.get(d.APP_COOKIES.em_token) || await d.di.getInstance(I, ee.TOKEN_ID);
295
+ S = await (await fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(L)}`, { headers: { authorization: `Bearer ${N}` } })).blob();
296
296
  }
297
297
  }
298
- if (E || !S) return;
299
- const I = new FileReader();
300
- I.onload = () => {
301
- if (E) return;
302
- const N = I.result;
303
- typeof N == "string" && (p(N), x(S.type), M?.tools.import.openBackgroundImage(N));
304
- }, I.onerror = () => {}, I.readAsDataURL(S);
305
- })().catch((j) => {}), () => {
306
- E = !0;
298
+ if (j || !S) return;
299
+ const A = new FileReader();
300
+ A.onload = () => {
301
+ if (j) return;
302
+ const N = A.result;
303
+ typeof N == "string" && (p(N), x(S.type), B?.tools.import.openBackgroundImage(N));
304
+ }, A.onerror = () => {}, A.readAsDataURL(S);
305
+ })().catch((L) => {}), () => {
306
+ j = !0;
307
307
  };
308
308
  }, [
309
309
  t,
310
310
  e,
311
311
  s,
312
312
  l,
313
+ B,
313
314
  M,
314
- P,
315
315
  w,
316
- A
316
+ I
317
317
  ]);
318
318
  const T = (0, n.useCallback)(() => {
319
- p(null), x(null), v(Q.closeSecondModal()), v(Q.closeModal(u.MODALS.UPLOAD_IMAGE_MODAL));
320
- }, [v]), X = (0, n.useRef)();
321
- X.current = async function(E, z, j) {
319
+ p(null), x(null), v(ee.closeSecondModal()), v(ee.closeModal(d.MODALS.UPLOAD_IMAGE_MODAL));
320
+ }, [v]), Z = (0, n.useRef)();
321
+ Z.current = async function(j, z, L) {
322
322
  try {
323
- const S = Rt(j, E);
323
+ const S = jt(L, j);
324
324
  i && await i(new File([S], z, {
325
325
  lastModified: Date.now(),
326
326
  type: S.type
@@ -329,17 +329,17 @@ __emailmaker__.define("static/core/aaa151dc.js", [
329
329
  throw S;
330
330
  }
331
331
  };
332
- const _ = (0, n.useCallback)((E) => {
333
- if (E && !(L.current && M)) {
334
- L.current = !0;
335
- const z = b.locale ? b.locale.replace("_", "-") : "ru-RU", j = b.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? u.DARK : u.LIGHT : b.theme;
336
- vt.Tf.init({
332
+ const q = (0, n.useCallback)((j) => {
333
+ if (j && !(D.current && B)) {
334
+ D.current = !0;
335
+ const z = b.locale ? b.locale.replace("_", "-") : "ru-RU", L = b.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? d.DARK : d.LIGHT : b.theme;
336
+ wt.Tf.init({
337
337
  selector: "#pixie-editor",
338
- baseUrl: f.getBundledHostAssetUrl(wt),
338
+ baseUrl: f.getBundledHostAssetUrl(xt),
339
339
  image: m,
340
340
  activeLanguage: z,
341
- languages: bt(z, h),
342
- tools: At,
341
+ languages: It(z, h),
342
+ tools: St,
343
343
  ui: {
344
344
  menubar: {
345
345
  replaceDefaultItems: !0,
@@ -380,37 +380,37 @@ __emailmaker__.define("static/core/aaa151dc.js", [
380
380
  ]
381
381
  },
382
382
  nav: { position: "top" },
383
- activeTheme: j,
383
+ activeTheme: L,
384
384
  mode: "inline",
385
385
  forceOverlayModeOnMobile: !1
386
386
  },
387
- onSave: async function(S, I, N) {
387
+ onSave: async function(S, A, N) {
388
388
  try {
389
- await X.current(S, I, N);
389
+ await Z.current(S, A, N);
390
390
  } catch {}
391
391
  }
392
392
  }).then((S) => {
393
- St(S), V(S);
393
+ Rt(S), V(S);
394
394
  }).catch((S) => {});
395
395
  }
396
396
  }, [
397
397
  b.theme,
398
398
  m,
399
- M,
399
+ B,
400
400
  V,
401
401
  b.locale,
402
402
  h,
403
403
  T,
404
404
  U
405
- ]), Y = (0, n.useCallback)(() => {
406
- M?.tools.export.save(t?.split("/").pop().split(".")[0], g?.split("/")[1]);
405
+ ]), Q = (0, n.useCallback)(() => {
406
+ B?.tools.export.save(t?.split("/").pop().split(".")[0], g?.split("/")[1]);
407
407
  }, [
408
- M,
408
+ B,
409
409
  t,
410
410
  g
411
411
  ]);
412
412
  return (0, r.jsxs)(f.Modal, {
413
- afterOpenChange: _,
413
+ afterOpenChange: q,
414
414
  width: "100%",
415
415
  style: {
416
416
  maxWidth: "100%",
@@ -430,7 +430,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
430
430
  className: "em-analytics__profile-updapixiete",
431
431
  id: "save",
432
432
  type: "primary",
433
- onClick: Y,
433
+ onClick: Q,
434
434
  children: h("Update")
435
435
  }, "Ok")],
436
436
  children: [o && (0, r.jsx)("div", {
@@ -441,14 +441,14 @@ __emailmaker__.define("static/core/aaa151dc.js", [
441
441
  display: "flex",
442
442
  alignItems: "center",
443
443
  justifyContent: "center",
444
- background: Xe.emCssVar("colorBgLayout"),
444
+ background: Je.emCssVar("colorBgLayout"),
445
445
  zIndex: 10,
446
446
  opacity: .7
447
447
  },
448
448
  children: (0, r.jsx)(f.Spin, { size: "large" })
449
449
  }), (0, r.jsx)("div", { id: "pixie-editor" })]
450
450
  });
451
- }, Et = ({ currentImageLink: t, newLink: e, previewDisplayUrl: s, resolvedPreviewObjectUrl: i, resolvedPreviewBlob: o, resolveImageBlob: l, onSave: m, uploadImageResultIsLoading: p }) => {
451
+ }, Ot = ({ currentImageLink: t, newLink: e, previewDisplayUrl: s, resolvedPreviewObjectUrl: i, resolvedPreviewBlob: o, resolveImageBlob: l, onSave: m, uploadImageResultIsLoading: p }) => {
452
452
  const g = s || i;
453
453
  return (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)("div", { children: (0, r.jsxs)("div", {
454
454
  className: "image-preview",
@@ -460,7 +460,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
460
460
  display: "flex",
461
461
  alignItems: "center",
462
462
  justifyContent: "center",
463
- background: Xe.emCssVar("colorBgLayout"),
463
+ background: Je.emCssVar("colorBgLayout"),
464
464
  zIndex: 10,
465
465
  opacity: .7
466
466
  },
@@ -469,7 +469,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
469
469
  alt: "uploadedImage",
470
470
  src: g
471
471
  })]
472
- }) }), (0, r.jsx)(kt, {
472
+ }) }), (0, r.jsx)(Lt, {
473
473
  currentImageLink: t,
474
474
  prefetchedBlob: o,
475
475
  resolveImageBlob: l,
@@ -477,110 +477,110 @@ __emailmaker__.define("static/core/aaa151dc.js", [
477
477
  onSave: m,
478
478
  uploadImageResultIsLoading: p
479
479
  })] });
480
- }, Re = {
480
+ }, Se = {
481
481
  Pixel: "Pixel",
482
482
  Percent: "Percent"
483
- }, $e = {
484
- unit: Re.Percent,
483
+ }, et = {
484
+ unit: Se.Percent,
485
485
  value: 80
486
486
  };
487
- function jt(t) {
487
+ function Dt(t) {
488
488
  return typeof t == "number" ? {
489
- unit: Re.Percent,
489
+ unit: Se.Percent,
490
490
  value: t * 100
491
491
  } : typeof t == "string" ? /^(\d*(\.\d+)?)px$/.exec(t) ? {
492
- unit: Re.Pixel,
492
+ unit: Se.Pixel,
493
493
  value: parseFloat(t)
494
494
  } : /^(\d*(\.\d+)?)%$/.exec(t) ? {
495
- unit: Re.Percent,
495
+ unit: Se.Percent,
496
496
  value: parseFloat(t)
497
- } : $e : $e;
497
+ } : et : et;
498
498
  }
499
- function Ot(t, e) {
500
- const s = jt(t);
499
+ function Pt(t, e) {
500
+ const s = Dt(t);
501
501
  let i;
502
- return s.unit === Re.Pixel ? i = `${s.value}px` : i = `${100 - s.value}%`, e ? `${i} 0px 0px 0px` : `0px 0px ${i} 0px`;
502
+ return s.unit === Se.Pixel ? i = `${s.value}px` : i = `${100 - s.value}%`, e ? `${i} 0px 0px 0px` : `0px 0px ${i} 0px`;
503
503
  }
504
- function et({ next: t, hasMore: e, children: s, loader: i, scrollThreshold: o = .8, endMessage: l, style: m, height: p, scrollableTarget: g, hasChildren: x, inverse: h = !1, pullDownToRefresh: v = !1, pullDownToRefreshContent: A, releaseToRefreshContent: k, pullDownToRefreshThreshold: b = 100, refreshFunction: O, onScroll: w, dataLength: U, initialScrollY: L, className: M = "", role: V, tabIndex: P, id: T, ...X }) {
505
- const [_, Y] = (0, n.useState)(!1), [E, z] = (0, n.useState)(!1), [j, S] = (0, n.useState)(0), I = (0, n.useRef)(null), N = (0, n.useRef)(null), J = (0, n.useRef)(null), K = (0, n.useRef)(t);
504
+ function tt({ next: t, hasMore: e, children: s, loader: i, scrollThreshold: o = .8, endMessage: l, style: m, height: p, scrollableTarget: g, hasChildren: x, inverse: h = !1, pullDownToRefresh: v = !1, pullDownToRefreshContent: I, releaseToRefreshContent: E, pullDownToRefreshThreshold: b = 100, refreshFunction: O, onScroll: w, dataLength: U, initialScrollY: D, className: B = "", role: V, tabIndex: M, id: T, ...Z }) {
505
+ const [q, Q] = (0, n.useState)(!1), [j, z] = (0, n.useState)(!1), [L, S] = (0, n.useState)(0), A = (0, n.useRef)(null), N = (0, n.useRef)(null), X = (0, n.useRef)(null), K = (0, n.useRef)(t);
506
506
  K.current = t;
507
507
  const a = (0, n.useRef)(O);
508
508
  a.current = O;
509
509
  const y = (0, n.useRef)(b);
510
510
  y.current = b;
511
- const W = (0, n.useRef)(!1), ie = (0, n.useRef)(!1), ee = (0, n.useRef)(0), F = (0, n.useRef)(0), le = (0, n.useRef)(0), D = (0, n.useCallback)(() => g instanceof HTMLElement ? g : typeof g == "string" ? document.getElementById(g) : null, [g]);
511
+ const W = (0, n.useRef)(!1), ie = (0, n.useRef)(!1), $ = (0, n.useRef)(0), F = (0, n.useRef)(0), le = (0, n.useRef)(0), P = (0, n.useCallback)(() => g instanceof HTMLElement ? g : typeof g == "string" ? document.getElementById(g) : null, [g]);
512
512
  (0, n.useEffect)(() => {
513
513
  if (typeof U > "u") throw new Error("mandatory prop \"dataLength\" is missing. The prop is needed when loading more content. Check README.md for usage");
514
514
  if (v && typeof O != "function") throw new Error(`Mandatory prop "refreshFunction" missing.
515
515
  Pull Down To Refresh functionality will not work
516
516
  as expected. Check README.md for usage'`);
517
- if (typeof L == "number") {
518
- const $ = p ? I.current : D();
519
- $ && $.scrollHeight > L && $.scrollTo(0, L);
517
+ if (typeof D == "number") {
518
+ const J = p ? A.current : P();
519
+ J && J.scrollHeight > D && J.scrollTo(0, D);
520
520
  }
521
521
  }, []), (0, n.useEffect)(() => {
522
- W.current = !1, Y(!1);
522
+ W.current = !1, Q(!1);
523
523
  }, [U]), (0, n.useEffect)(() => {
524
524
  if (!e || typeof IntersectionObserver > "u") return;
525
- const $ = N.current;
526
- if (!$) return;
527
- const te = p ? I.current : D(), G = new IntersectionObserver(([ae]) => {
528
- !ae.isIntersecting || W.current || (W.current = !0, Y(!0), K.current());
525
+ const J = N.current;
526
+ if (!J) return;
527
+ const ne = p ? A.current : P(), G = new IntersectionObserver(([ae]) => {
528
+ !ae.isIntersecting || W.current || (W.current = !0, Q(!0), K.current());
529
529
  }, {
530
- root: te,
531
- rootMargin: Ot(o, h),
530
+ root: ne,
531
+ rootMargin: Pt(o, h),
532
532
  threshold: 0
533
533
  });
534
- return G.observe($), () => G.disconnect();
534
+ return G.observe(J), () => G.disconnect();
535
535
  }, [
536
536
  e,
537
537
  o,
538
538
  h,
539
539
  p,
540
- D
540
+ P
541
541
  ]), (0, n.useEffect)(() => {
542
- var $;
542
+ var J;
543
543
  if (!w) return;
544
- const te = ($ = p ? I.current : D()) !== null && $ !== void 0 ? $ : typeof window < "u" ? window : null;
545
- if (!te) return;
544
+ const ne = (J = p ? A.current : P()) !== null && J !== void 0 ? J : typeof window < "u" ? window : null;
545
+ if (!ne) return;
546
546
  const G = (ae) => {
547
547
  setTimeout(() => w(ae), 0);
548
548
  };
549
- return te.addEventListener("scroll", G), () => te.removeEventListener("scroll", G);
549
+ return ne.addEventListener("scroll", G), () => ne.removeEventListener("scroll", G);
550
550
  }, [
551
551
  w,
552
552
  p,
553
- D
553
+ P
554
554
  ]), (0, n.useEffect)(() => {
555
- var $, te;
555
+ var J, ne;
556
556
  if (!v) return;
557
- const G = ($ = p ? I.current : D()) !== null && $ !== void 0 ? $ : typeof window < "u" ? window : null;
557
+ const G = (J = p ? A.current : P()) !== null && J !== void 0 ? J : typeof window < "u" ? window : null;
558
558
  if (!G) return;
559
- if (!((te = J.current) === null || te === void 0) && te.firstChild) {
560
- const Z = J.current.firstChild.getBoundingClientRect().height;
561
- le.current = Z, S(Z);
559
+ if (!((ne = X.current) === null || ne === void 0) && ne.firstChild) {
560
+ const Y = X.current.firstChild.getBoundingClientRect().height;
561
+ le.current = Y, S(Y);
562
562
  }
563
- const ae = (Z) => {
564
- (G instanceof HTMLElement ? G.scrollTop : document.documentElement.scrollTop) > 0 || (ie.current = !0, Z instanceof MouseEvent ? ee.current = Z.pageY : Z instanceof TouchEvent && (ee.current = Z.touches[0].pageY), F.current = ee.current, I.current && (I.current.style.willChange = "transform", I.current.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
565
- }, C = (Z) => {
566
- if (!ie.current || (Z instanceof MouseEvent ? F.current = Z.pageY : Z instanceof TouchEvent && (F.current = Z.touches[0].pageY), F.current < ee.current)) return;
567
- const me = F.current - ee.current;
568
- me >= y.current && z(!0), !(me > le.current * 1.5) && I.current && (I.current.style.overflow = "visible", I.current.style.transform = `translate3d(0px, ${me}px, 0px)`);
569
- }, q = () => {
570
- ee.current = 0, F.current = 0, ie.current = !1, z((Z) => {
563
+ const ae = (Y) => {
564
+ (G instanceof HTMLElement ? G.scrollTop : document.documentElement.scrollTop) > 0 || (ie.current = !0, Y instanceof MouseEvent ? $.current = Y.pageY : Y instanceof TouchEvent && ($.current = Y.touches[0].pageY), F.current = $.current, A.current && (A.current.style.willChange = "transform", A.current.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
565
+ }, C = (Y) => {
566
+ if (!ie.current || (Y instanceof MouseEvent ? F.current = Y.pageY : Y instanceof TouchEvent && (F.current = Y.touches[0].pageY), F.current < $.current)) return;
567
+ const me = F.current - $.current;
568
+ me >= y.current && z(!0), !(me > le.current * 1.5) && A.current && (A.current.style.overflow = "visible", A.current.style.transform = `translate3d(0px, ${me}px, 0px)`);
569
+ }, _ = () => {
570
+ $.current = 0, F.current = 0, ie.current = !1, z((Y) => {
571
571
  var me;
572
- return Z && ((me = a.current) === null || me === void 0 || me.call(a)), !1;
572
+ return Y && ((me = a.current) === null || me === void 0 || me.call(a)), !1;
573
573
  }), requestAnimationFrame(() => {
574
- I.current && (I.current.style.overflow = "auto", I.current.style.transform = "none", I.current.style.willChange = "unset");
574
+ A.current && (A.current.style.overflow = "auto", A.current.style.transform = "none", A.current.style.willChange = "unset");
575
575
  });
576
576
  };
577
- return G.addEventListener("touchstart", ae), G.addEventListener("touchmove", C), G.addEventListener("touchend", q), G.addEventListener("mousedown", ae), G.addEventListener("mousemove", C), G.addEventListener("mouseup", q), () => {
578
- G.removeEventListener("touchstart", ae), G.removeEventListener("touchmove", C), G.removeEventListener("touchend", q), G.removeEventListener("mousedown", ae), G.removeEventListener("mousemove", C), G.removeEventListener("mouseup", q);
577
+ return G.addEventListener("touchstart", ae), G.addEventListener("touchmove", C), G.addEventListener("touchend", _), G.addEventListener("mousedown", ae), G.addEventListener("mousemove", C), G.addEventListener("mouseup", _), () => {
578
+ G.removeEventListener("touchstart", ae), G.removeEventListener("touchmove", C), G.removeEventListener("touchend", _), G.removeEventListener("mousedown", ae), G.removeEventListener("mousemove", C), G.removeEventListener("mouseup", _);
579
579
  };
580
580
  }, [
581
581
  v,
582
582
  p,
583
- D
583
+ P
584
584
  ]);
585
585
  const he = {
586
586
  height: p ?? "auto",
@@ -595,61 +595,61 @@ __emailmaker__.define("static/core/aaa151dc.js", [
595
595
  style: oe,
596
596
  className: "infinite-scroll-component__outerdiv",
597
597
  children: (0, r.jsxs)("div", {
598
- ...X,
598
+ ...Z,
599
599
  role: V,
600
- tabIndex: P,
600
+ tabIndex: M,
601
601
  id: T,
602
- className: ["infinite-scroll-component", M].filter(Boolean).join(" "),
603
- ref: I,
602
+ className: ["infinite-scroll-component", B].filter(Boolean).join(" "),
603
+ ref: A,
604
604
  style: he,
605
605
  children: [
606
606
  v && (0, r.jsx)("div", {
607
607
  style: { position: "relative" },
608
- ref: J,
608
+ ref: X,
609
609
  children: (0, r.jsx)("div", {
610
610
  style: {
611
611
  position: "absolute",
612
612
  left: 0,
613
613
  right: 0,
614
- top: -1 * j
614
+ top: -1 * L
615
615
  },
616
- children: E ? k : A
616
+ children: j ? E : I
617
617
  })
618
618
  }),
619
619
  s,
620
- !_ && !ye && e && i,
621
- _ && e && i,
620
+ !q && !ye && e && i,
621
+ q && e && i,
622
622
  ve,
623
623
  !e && l
624
624
  ]
625
625
  })
626
626
  });
627
627
  }
628
- function Lt(t, e) {
628
+ function Ut(t, e) {
629
629
  if (t == null) return {};
630
- var s = Dt(t, e), i, o;
630
+ var s = Bt(t, e), i, o;
631
631
  if (Object.getOwnPropertySymbols) {
632
632
  var l = Object.getOwnPropertySymbols(t);
633
633
  for (o = 0; o < l.length; o++) i = l[o], !(e.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(t, i) && (s[i] = t[i]);
634
634
  }
635
635
  return s;
636
636
  }
637
- function Dt(t, e) {
637
+ function Bt(t, e) {
638
638
  if (t == null) return {};
639
639
  var s = {}, i = Object.keys(t), o, l;
640
640
  for (l = 0; l < i.length; l++) o = i[l], !(e.indexOf(o) >= 0) && (s[o] = t[o]);
641
641
  return s;
642
642
  }
643
- function Ue() {
644
- return Ue = Object.assign || function(t) {
643
+ function Pe() {
644
+ return Pe = Object.assign || function(t) {
645
645
  for (var e = 1; e < arguments.length; e++) {
646
646
  var s = arguments[e];
647
647
  for (var i in s) Object.prototype.hasOwnProperty.call(s, i) && (t[i] = s[i]);
648
648
  }
649
649
  return t;
650
- }, Ue.apply(this, arguments);
650
+ }, Pe.apply(this, arguments);
651
651
  }
652
- function tt(t, e) {
652
+ function nt(t, e) {
653
653
  var s = Object.keys(t);
654
654
  if (Object.getOwnPropertySymbols) {
655
655
  var i = Object.getOwnPropertySymbols(t);
@@ -662,15 +662,15 @@ __emailmaker__.define("static/core/aaa151dc.js", [
662
662
  function ke(t) {
663
663
  for (var e = 1; e < arguments.length; e++) {
664
664
  var s = arguments[e] != null ? arguments[e] : {};
665
- e % 2 ? tt(Object(s), !0).forEach(function(i) {
666
- Bt(t, i, s[i]);
667
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(s)) : tt(Object(s)).forEach(function(i) {
665
+ e % 2 ? nt(Object(s), !0).forEach(function(i) {
666
+ Mt(t, i, s[i]);
667
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(s)) : nt(Object(s)).forEach(function(i) {
668
668
  Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(s, i));
669
669
  });
670
670
  }
671
671
  return t;
672
672
  }
673
- function Bt(t, e, s) {
673
+ function Mt(t, e, s) {
674
674
  return e in t ? Object.defineProperty(t, e, {
675
675
  value: s,
676
676
  enumerable: !0,
@@ -678,18 +678,18 @@ __emailmaker__.define("static/core/aaa151dc.js", [
678
678
  writable: !0
679
679
  }) : t[e] = s, t;
680
680
  }
681
- var Ut = {
681
+ var Tt = {
682
682
  breakpointCols: void 0,
683
683
  className: void 0,
684
684
  columnClassName: void 0,
685
685
  children: void 0,
686
686
  columnAttrs: void 0,
687
687
  column: void 0
688
- }, Ne = 2, Ge = class extends n.default.Component {
688
+ }, Te = 2, Ne = class extends n.default.Component {
689
689
  constructor(t) {
690
690
  super(t), this.reCalculateColumnCount = this.reCalculateColumnCount.bind(this), this.reCalculateColumnCountDebounce = this.reCalculateColumnCountDebounce.bind(this);
691
691
  let e;
692
- this.props.breakpointCols && this.props.breakpointCols.default ? e = this.props.breakpointCols.default : e = parseInt(this.props.breakpointCols) || Ne, this.state = { columnCount: e };
692
+ this.props.breakpointCols && this.props.breakpointCols.default ? e = this.props.breakpointCols.default : e = parseInt(this.props.breakpointCols) || Te, this.state = { columnCount: e };
693
693
  }
694
694
  componentDidMount() {
695
695
  this.reCalculateColumnCount(), window && window.addEventListener("resize", this.reCalculateColumnCountDebounce);
@@ -712,8 +712,8 @@ __emailmaker__.define("static/core/aaa151dc.js", [
712
712
  reCalculateColumnCount() {
713
713
  const t = window && window.innerWidth || Infinity;
714
714
  let e = this.props.breakpointCols;
715
- typeof e != "object" && (e = { default: parseInt(e) || Ne });
716
- let s = Infinity, i = e.default || Ne;
715
+ typeof e != "object" && (e = { default: parseInt(e) || Te });
716
+ let s = Infinity, i = e.default || Te;
717
717
  for (let o in e) {
718
718
  const l = parseInt(o);
719
719
  l > 0 && t <= l && l < s && (s = l, i = e[o]);
@@ -736,11 +736,11 @@ __emailmaker__.define("static/core/aaa151dc.js", [
736
736
  style: ke(ke({}, e.style), {}, { width: o }),
737
737
  className: l
738
738
  });
739
- return i.map((p, g) => n.default.createElement("div", Ue({}, m, { key: g }), p));
739
+ return i.map((p, g) => n.default.createElement("div", Pe({}, m, { key: g }), p));
740
740
  }
741
741
  logDeprecated(t) {}
742
742
  render() {
743
- const t = this.props, { children: e, breakpointCols: s, columnClassName: i, columnAttrs: o, column: l, className: m } = t, p = Lt(t, [
743
+ const t = this.props, { children: e, breakpointCols: s, columnClassName: i, columnAttrs: o, column: l, className: m } = t, p = Ut(t, [
744
744
  "children",
745
745
  "breakpointCols",
746
746
  "columnClassName",
@@ -749,11 +749,11 @@ __emailmaker__.define("static/core/aaa151dc.js", [
749
749
  "className"
750
750
  ]);
751
751
  let g = m;
752
- return typeof m != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof m > "u" && (g = "my-masonry-grid")), n.default.createElement("div", Ue({}, p, { className: g }), this.renderColumns());
752
+ return typeof m != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof m > "u" && (g = "my-masonry-grid")), n.default.createElement("div", Pe({}, p, { className: g }), this.renderColumns());
753
753
  }
754
754
  };
755
- Ge.defaultProps = Ut;
756
- function Fe(t, e) {
755
+ Ne.defaultProps = Tt;
756
+ function Ge(t, e) {
757
757
  return t ? t.exhausted ? {
758
758
  ...t,
759
759
  src: null
@@ -762,7 +762,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
762
762
  src: t.src || e || null
763
763
  } : null;
764
764
  }
765
- function nt({ items: t, getItemId: e, getRequestUrl: s, createController: i }) {
765
+ function rt({ items: t, getItemId: e, getRequestUrl: s, createController: i }) {
766
766
  const [o, l] = (0, n.useState)({}), m = (0, n.useRef)(new Map()), p = (0, n.useCallback)((g) => {
767
767
  const x = e(g), h = s(g), v = `${x}:${h}`;
768
768
  if (m.current.has(v)) return {
@@ -771,12 +771,12 @@ __emailmaker__.define("static/core/aaa151dc.js", [
771
771
  cacheKey: v,
772
772
  controller: m.current.get(v)
773
773
  };
774
- const A = i(h);
775
- return m.current.set(v, A), {
774
+ const I = i(h);
775
+ return m.current.set(v, I), {
776
776
  itemId: x,
777
777
  requestUrl: h,
778
778
  cacheKey: v,
779
- controller: A
779
+ controller: I
780
780
  };
781
781
  }, [
782
782
  i,
@@ -785,19 +785,19 @@ __emailmaker__.define("static/core/aaa151dc.js", [
785
785
  ]);
786
786
  return (0, n.useEffect)(() => {
787
787
  const g = new Set(), x = {}, h = t.map((v) => {
788
- const { itemId: A, cacheKey: k, controller: b } = p(v);
789
- g.add(k), x[A] = b.src;
790
- const O = Fe(b.handleChangeSrc?.(), b.src);
791
- return O?.changed && O.src && (x[A] = O.src), b.subscribeToSrcChange?.((w) => {
792
- const U = Fe(w, b.src);
793
- !U?.changed || !U.src || l((L) => L[A] === U.src ? L : {
794
- ...L,
795
- [A]: U.src
788
+ const { itemId: I, cacheKey: E, controller: b } = p(v);
789
+ g.add(E), x[I] = b.src;
790
+ const O = Ge(b.handleChangeSrc?.(), b.src);
791
+ return O?.changed && O.src && (x[I] = O.src), b.subscribeToSrcChange?.((w) => {
792
+ const U = Ge(w, b.src);
793
+ !U?.changed || !U.src || l((D) => D[I] === U.src ? D : {
794
+ ...D,
795
+ [I]: U.src
796
796
  });
797
797
  });
798
798
  }).filter(Boolean);
799
- return m.current.forEach((v, A) => {
800
- g.has(A) || m.current.delete(A);
799
+ return m.current.forEach((v, I) => {
800
+ g.has(I) || m.current.delete(I);
801
801
  }), l(x), () => {
802
802
  h.forEach((v) => v?.());
803
803
  };
@@ -810,16 +810,16 @@ __emailmaker__.define("static/core/aaa151dc.js", [
810
810
  p(g).controller.handleSuccess();
811
811
  }, [p]),
812
812
  handleError: (0, n.useCallback)((g) => {
813
- const { itemId: x, controller: h } = p(g), v = Fe(h.handleError(), h.src);
814
- v?.changed && v.src && l((A) => ({
815
- ...A,
813
+ const { itemId: x, controller: h } = p(g), v = Ge(h.handleError(), h.src);
814
+ v?.changed && v.src && l((I) => ({
815
+ ...I,
816
816
  [x]: v.src
817
817
  }));
818
818
  }, [p])
819
819
  };
820
820
  }
821
- var rt = "blocks", Mt = ({ setCurrentImageLink: t, setModalHeight: e, setModalWidth: s, setImageStockList: i, imageStockList: o, currentReq: l, setCurrentReq: m, inputRef: p, setStockLink: g, customRequest: x }) => {
822
- const h = u.useAppConfig(), v = u.useIsStandalone(), [A, k] = (0, n.useState)(!1), [b, O] = (0, n.useState)(2), { __: w } = f.useI18n(), U = f.useNotification(), [L] = Q.useLazyGetUnsplashImageQuery(), [M] = Q.useLazyGetSearchImageQuery(), V = (0, n.useCallback)((a) => a instanceof Error || typeof a?.message == "string" && a.message ? a.message : typeof a?.error?.message == "string" && a.error.message ? a.error.message : w("Failed to load stock images through the configured proxy chain."), [w]), P = (0, n.useCallback)((a) => {
821
+ var at = "blocks", Nt = ({ setCurrentImageLink: t, setModalHeight: e, setModalWidth: s, setImageStockList: i, imageStockList: o, currentReq: l, setCurrentReq: m, inputRef: p, setStockLink: g, customRequest: x }) => {
822
+ const h = d.useAppConfig(), v = d.useIsStandalone(), [I, E] = (0, n.useState)(!1), [b, O] = (0, n.useState)(2), { __: w } = f.useI18n(), U = f.useNotification(), [D] = ee.useLazyGetUnsplashImageQuery(), [B] = ee.useLazyGetSearchImageQuery(), V = (0, n.useCallback)((a) => a instanceof Error || typeof a?.message == "string" && a.message ? a.message : typeof a?.error?.message == "string" && a.error.message ? a.error.message : w("Failed to load stock images through the configured proxy chain."), [w]), M = (0, n.useCallback)((a) => {
823
823
  U.error({
824
824
  id: "STOCK_IMAGES_SEARCH_FAILED",
825
825
  title: w("Failed to load stock images"),
@@ -830,57 +830,57 @@ __emailmaker__.define("static/core/aaa151dc.js", [
830
830
  V,
831
831
  U
832
832
  ]), T = async () => {
833
- A || (k(!0), M({
833
+ I || (E(!0), B({
834
834
  query: l,
835
835
  page: b
836
836
  }).then((a) => {
837
837
  if (a?.error) {
838
- P(a.error), k(!1);
838
+ M(a.error), E(!1);
839
839
  return;
840
840
  }
841
841
  const y = a?.data?.results || [];
842
- i((W) => [...W, ...y]), k(!1), O((W) => W + 1);
842
+ i((W) => [...W, ...y]), E(!1), O((W) => W + 1);
843
843
  }).catch(() => {
844
- k(!1);
844
+ E(!1);
845
845
  }));
846
846
  };
847
847
  (0, n.useEffect)(() => {
848
- l.keywords !== "" && X();
848
+ l.keywords !== "" && Z();
849
849
  }, [l.color, l.orientation]);
850
- const X = async () => {
851
- const a = await M({
850
+ const Z = async () => {
851
+ const a = await B({
852
852
  query: l,
853
853
  page: 1
854
854
  });
855
855
  if (a?.error) {
856
- P(a.error), i([]);
856
+ M(a.error), i([]);
857
857
  return;
858
858
  }
859
859
  const y = a?.data?.results || [];
860
860
  y.length > 0 ? (i(y), setTimeout(() => {
861
861
  s(1060), e("84vh");
862
862
  }, 0)) : i([]);
863
- }, [_, Y] = (0, n.useState)(null), E = (0, n.useCallback)((a, y, W) => `${a}${a.includes("?") ? "&" : "?"}w=${y}&q=${W}`, []), z = (0, n.useCallback)((a) => u.getProxiedUrl(a, {
863
+ }, [q, Q] = (0, n.useState)(null), j = (0, n.useCallback)((a, y, W) => `${a}${a.includes("?") ? "&" : "?"}w=${y}&q=${W}`, []), z = (0, n.useCallback)((a) => d.getProxiedUrl(a, {
864
864
  config: h,
865
865
  standalone: v,
866
866
  resourceType: "stockImages",
867
867
  intent: "display"
868
- }), [h, v]), { getDisplaySrc: j, handleLoad: S, handleError: I } = nt({
868
+ }), [h, v]), { getDisplaySrc: L, handleLoad: S, handleError: A } = rt({
869
869
  items: o,
870
870
  getItemId: (0, n.useCallback)((a) => a.id, []),
871
- getRequestUrl: (0, n.useCallback)((a) => E(a.urls.raw, 644, 96), [E]),
871
+ getRequestUrl: (0, n.useCallback)((a) => j(a.urls.raw, 644, 96), [j]),
872
872
  createController: z
873
873
  }), N = (a) => (y) => {
874
874
  S(a), y.target.parentNode.classList.add("loaded");
875
- }, J = (a) => () => {
876
- I(a);
875
+ }, X = (a) => () => {
876
+ A(a);
877
877
  }, K = (a, y, W) => {
878
- L(y.download_location), Y(W), setTimeout(() => Y(null), 2e3), g(`${a.raw}&w=1200&q=96`), t(`${a.raw}&w=1200&q=96`), x(`${a.raw}&w=1200&q=96`);
878
+ D(y.download_location), Q(W), setTimeout(() => Q(null), 2e3), g(`${a.raw}&w=1200&q=96`), t(`${a.raw}&w=1200&q=96`), x(`${a.raw}&w=1200&q=96`);
879
879
  };
880
880
  return (0, r.jsxs)("div", {
881
881
  className: "stock-tab",
882
882
  children: [(0, r.jsxs)(f.Form, {
883
- onValuesChange: X,
883
+ onValuesChange: Z,
884
884
  className: o.length > 0 ? "serach-results" : "",
885
885
  children: [(0, r.jsxs)(f.Row, {
886
886
  gutter: 24,
@@ -889,7 +889,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
889
889
  children: (0, r.jsx)(f.Form.Item, {
890
890
  className: "stock-search-input",
891
891
  children: (0, r.jsx)(f.SearchInput, {
892
- onSearch: X,
892
+ onSearch: Z,
893
893
  allowClear: !0,
894
894
  size: o.length > 0 ? "medium" : "large",
895
895
  placeholder: w("Search image"),
@@ -915,7 +915,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
915
915
  placement: "top",
916
916
  children: (0, r.jsx)(f.Radio.Button, {
917
917
  value: "",
918
- children: (0, r.jsx)(B.EmIcons, { icon: "MixedView" })
918
+ children: (0, r.jsx)(R.EmIcons, { icon: "MixedView" })
919
919
  })
920
920
  }),
921
921
  (0, r.jsx)(f.Tooltip, {
@@ -923,7 +923,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
923
923
  placement: "top",
924
924
  children: (0, r.jsx)(f.Radio.Button, {
925
925
  value: "landscape",
926
- children: (0, r.jsx)(B.EmIcons, { icon: "LandscapeView" })
926
+ children: (0, r.jsx)(R.EmIcons, { icon: "LandscapeView" })
927
927
  })
928
928
  }),
929
929
  (0, r.jsx)(f.Tooltip, {
@@ -931,7 +931,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
931
931
  placement: "top",
932
932
  children: (0, r.jsx)(f.Radio.Button, {
933
933
  value: "portrait",
934
- children: (0, r.jsx)(B.EmIcons, { icon: "PortraitView" })
934
+ children: (0, r.jsx)(R.EmIcons, { icon: "PortraitView" })
935
935
  })
936
936
  }),
937
937
  (0, r.jsx)(f.Tooltip, {
@@ -939,7 +939,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
939
939
  placement: "top",
940
940
  children: (0, r.jsx)(f.Radio.Button, {
941
941
  value: "squarish",
942
- children: (0, r.jsx)(B.EmIcons, { icon: "SquareView" })
942
+ children: (0, r.jsx)(R.EmIcons, { icon: "SquareView" })
943
943
  })
944
944
  })
945
945
  ]
@@ -1031,7 +1031,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
1031
1031
  lineHeight: "0",
1032
1032
  boxSizing: "unset"
1033
1033
  },
1034
- children: (0, r.jsx)(et, {
1034
+ children: (0, r.jsx)(tt, {
1035
1035
  dataLength: o && o.length,
1036
1036
  next: T,
1037
1037
  hasMore: o,
@@ -1042,7 +1042,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
1042
1042
  scrollableTarget: "scrollableDiv",
1043
1043
  style: { overflow: "visible" },
1044
1044
  loader: null,
1045
- children: (0, r.jsx)(Ge, {
1045
+ children: (0, r.jsx)(Ne, {
1046
1046
  breakpointCols: { default: 3 },
1047
1047
  className: "my-masonry-grid",
1048
1048
  columnClassName: "my-masonry-grid_column",
@@ -1051,12 +1051,12 @@ __emailmaker__.define("static/core/aaa151dc.js", [
1051
1051
  onClick: () => K(a.urls, a.links, a.id),
1052
1052
  children: [
1053
1053
  (0, r.jsx)("img", {
1054
- className: _ === a.id ? "loaded-image" : "",
1054
+ className: q === a.id ? "loaded-image" : "",
1055
1055
  width: "322px",
1056
- src: j(a),
1056
+ src: L(a),
1057
1057
  alt: a.description,
1058
1058
  onLoad: N(a),
1059
- onError: J(a)
1059
+ onError: X(a)
1060
1060
  }),
1061
1061
  (0, r.jsxs)("p", {
1062
1062
  className: "creator-info",
@@ -1066,7 +1066,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
1066
1066
  " ",
1067
1067
  (0, r.jsx)("a", {
1068
1068
  target: "_blank",
1069
- href: `${a.user.links.html}?utm_source=${rt}&utm_medium=referral`,
1069
+ href: `${a.user.links.html}?utm_source=${at}&utm_medium=referral`,
1070
1070
  rel: "noreferrer",
1071
1071
  children: a.user.name
1072
1072
  }),
@@ -1075,13 +1075,13 @@ __emailmaker__.define("static/core/aaa151dc.js", [
1075
1075
  " ",
1076
1076
  (0, r.jsx)("a", {
1077
1077
  target: "_blank",
1078
- href: `https://unsplash.com/?utm_source=${rt}&utm_medium=referral`,
1078
+ href: `https://unsplash.com/?utm_source=${at}&utm_medium=referral`,
1079
1079
  rel: "noreferrer",
1080
1080
  children: "Unsplash"
1081
1081
  })
1082
1082
  ]
1083
1083
  }),
1084
- _ === a.id && (0, r.jsx)(f.Spin, {
1084
+ q === a.id && (0, r.jsx)(f.Spin, {
1085
1085
  className: "ant-spin",
1086
1086
  size: "small"
1087
1087
  })
@@ -1093,14 +1093,14 @@ __emailmaker__.define("static/core/aaa151dc.js", [
1093
1093
  })]
1094
1094
  });
1095
1095
  };
1096
- function at(t) {
1096
+ function st(t) {
1097
1097
  return /^(https?:)?\/\//i.test(t.trim());
1098
1098
  }
1099
- function Pt(t) {
1099
+ function Gt(t) {
1100
1100
  const e = t.trim();
1101
- return at(e) || /^data:/i.test(e) ? e : `data:image/jpeg;base64, ${t}`;
1101
+ return st(e) || /^data:/i.test(e) ? e : `data:image/jpeg;base64, ${t}`;
1102
1102
  }
1103
- var Tt = ({ images: t, transitionDuration: e = 1e3 }) => {
1103
+ var Ft = ({ images: t, transitionDuration: e = 1e3 }) => {
1104
1104
  const [s, i] = (0, n.useState)([]);
1105
1105
  return (0, n.useEffect)(() => {
1106
1106
  if (t.length > 0) {
@@ -1118,7 +1118,7 @@ __emailmaker__.define("static/core/aaa151dc.js", [
1118
1118
  }, [t]), (0, r.jsx)("div", {
1119
1119
  className: "slideshow-container",
1120
1120
  children: s.map((o, l) => (0, r.jsx)("img", {
1121
- src: Pt(o.src),
1121
+ src: Gt(o.src),
1122
1122
  alt: `Slide ${l + 1}`,
1123
1123
  className: "slideshow-image",
1124
1124
  style: {
@@ -1128,36 +1128,36 @@ __emailmaker__.define("static/core/aaa151dc.js", [
1128
1128
  }, l))
1129
1129
  });
1130
1130
  };
1131
- function Nt({ setModalHeight: t, customRequest: e, aiTabRef: s, isImageUploaded: i, setIsImageUploaded: o, aiImageRequest: l, imageAiList: m, setImageAiList: p, isLoadingAi: g, setIsLoadingAi: x, onPluginAiImageLimitExceeded: h, onImageGenerateLimitExceeded: v }) {
1132
- const { __: A } = f.useI18n(), k = u.useAppConfig(), b = f.useNotification(), O = u.usePushToDataLayer(), { blockId: w, projectId: U } = u.useParams(), L = B.useRouteEmailId(), [M] = Q.useLazySendAiImageRequestQuery(), [V, { data: P = [] }] = Q.useLazyGetAiImageSSEQuery(), [T] = Q.useLazyGetLimitsStatsByTypeQuery(), X = k?.sendAIImageRequest || M, _ = k?.trigger || V, Y = k?.handleLimitUsageEmitter || u.useEventEmitter(u.events.ON_LIMIT_ID), [E, z] = (0, n.useState)(0), [j, S] = (0, n.useState)(null), [I, N] = (0, n.useState)(!1), [J, K] = (0, n.useState)(A("Evaluating the task")), [a, y] = (0, n.useState)(!1), W = L || w, { limits: ie } = k?.limits ? k : { limits: { ai_img_limit: 0 } }, { ai_img_limit: ee } = ie, F = !!(k.limits && k.counters) && u.PLUGIN.isPlugin, le = u.useEventEmitter(u.events.AI_IMAGE_REQUEST_ID).hasListeners(), D = ne.shouldCountAiUsage({
1131
+ function zt({ setModalHeight: t, customRequest: e, aiTabRef: s, isImageUploaded: i, setIsImageUploaded: o, aiImageRequest: l, imageAiList: m, setImageAiList: p, isLoadingAi: g, setIsLoadingAi: x, onPluginAiImageLimitExceeded: h, onImageGenerateLimitExceeded: v }) {
1132
+ const { __: I } = f.useI18n(), E = d.useAppConfig(), b = f.useNotification(), O = d.usePushToDataLayer(), { blockId: w, projectId: U } = d.useParams(), D = R.useRouteEmailId(), [B] = ee.useLazySendAiImageRequestQuery(), [V, { data: M = [] }] = ee.useLazyGetAiImageSSEQuery(), T = te.useProjectPlanLimitPreflight(), Z = E?.sendAIImageRequest || B, q = E?.trigger || V, Q = E?.handleLimitUsageEmitter || d.useEventEmitter(d.events.ON_LIMIT_ID), [j, z] = (0, n.useState)(0), [L, S] = (0, n.useState)(null), [A, N] = (0, n.useState)(!1), [X, K] = (0, n.useState)(I("Evaluating the task")), [a, y] = (0, n.useState)(!1), W = D || w, { limits: ie } = E?.limits ? E : { limits: { ai_img_limit: 0 } }, { ai_img_limit: $ } = ie, F = !!(E.limits && E.counters) && d.PLUGIN.isPlugin, le = d.useEventEmitter(d.events.AI_IMAGE_REQUEST_ID).hasListeners(), P = te.shouldCountAiUsage({
1133
1133
  limitsInPlugin: F,
1134
1134
  hostedAiActive: le
1135
- }), he = !le && ee > 0 && E >= ee, ye = (0, n.useCallback)(() => {
1136
- Y.fire({
1135
+ }), he = !le && $ > 0 && j >= $, ye = (0, n.useCallback)(() => {
1136
+ Q.fire({
1137
1137
  name: "AiImgCount",
1138
- count: E + 1
1138
+ count: j + 1
1139
1139
  });
1140
- }, [Y, E]), oe = (0, n.useMemo)(() => !he && (!D || ee === 0 || E < ee), [
1140
+ }, [Q, j]), oe = (0, n.useMemo)(() => !he && (!P || $ === 0 || j < $), [
1141
1141
  he,
1142
- D,
1143
- E,
1144
- ee
1142
+ P,
1143
+ j,
1144
+ $
1145
1145
  ]), ve = (0, n.useCallback)(async () => {
1146
- K(A("Evaluating the task")), l !== "" && !g && (x(!0), y(!0), p([]), O({
1146
+ K(I("Evaluating the task")), l !== "" && !g && (x(!0), y(!0), p([]), O({
1147
1147
  event: "submit_form",
1148
1148
  action: "ai_image_generation",
1149
- entity_id: L,
1149
+ entity_id: D,
1150
1150
  project_id: U
1151
- }), X({ body: {
1151
+ }), Z({ body: {
1152
1152
  project_id: U,
1153
1153
  request: "create-image",
1154
1154
  connection: "midjourney",
1155
1155
  message: l
1156
- } }).then(({ data: C, error: q }) => {
1157
- if (q) throw q;
1158
- if (C.data.status === 401) throw new Error(u.ERROR);
1156
+ } }).then(({ data: C, error: _ }) => {
1157
+ if (_) throw _;
1158
+ if (C.data.status === 401) throw new Error(d.ERROR);
1159
1159
  if (C?.data?._eventResult) {
1160
- p(C.data.task.images), x(!1), y(!1), K(A("Evaluating the task"));
1160
+ p(C.data.task.images), x(!1), y(!1), K(I("Evaluating the task"));
1161
1161
  return;
1162
1162
  }
1163
1163
  C?.data.status === 200 ? (C?.data.task.id && (K(C.data.task.message), S(C.data.task.id)), C.message && b.success({
@@ -1165,12 +1165,12 @@ __emailmaker__.define("static/core/aaa151dc.js", [
1165
1165
  title: C.message,
1166
1166
  placement: "bottomRight",
1167
1167
  data: l
1168
- }), _({
1168
+ }), q({
1169
1169
  task_id: C?.data.task.id,
1170
1170
  entity_id: W
1171
1171
  })) : (x(!1), y(!1), b.error({
1172
1172
  id: "AI_IMAGE_SEND_ERROR",
1173
- title: C?.message || A("Something went wrong, please try again"),
1173
+ title: C?.message || I("Something went wrong, please try again"),
1174
1174
  placement: "bottomRight",
1175
1175
  data: l,
1176
1176
  innerException: C
@@ -1185,26 +1185,26 @@ __emailmaker__.define("static/core/aaa151dc.js", [
1185
1185
  y,
1186
1186
  p,
1187
1187
  O,
1188
- L,
1188
+ D,
1189
1189
  U,
1190
- X,
1190
+ Z,
1191
1191
  b,
1192
- _,
1192
+ q,
1193
1193
  W,
1194
- A
1195
- ]), $ = (0, n.useCallback)(async () => {
1194
+ I
1195
+ ]), J = (0, n.useCallback)(async () => {
1196
1196
  if (oe) {
1197
- if (!u.PLUGIN.isPlugin && !le) {
1198
- const C = B.resolveLimitActionPreflightExceededForType("image_generate", (await T("image_generate")).data?.stats);
1197
+ if (!d.PLUGIN.isPlugin && !le) {
1198
+ const C = R.resolveLimitActionPreflightExceededForType("image_generate", await T("image_generate"));
1199
1199
  if (C) {
1200
1200
  v?.(C);
1201
1201
  return;
1202
1202
  }
1203
1203
  }
1204
- D && (z((C) => C + 1), ye()), ve();
1204
+ P && (z((C) => C + 1), ye()), ve();
1205
1205
  } else F && (h ? h() : b.error({
1206
- title: A("The usage limit has been exceeded"),
1207
- description: A(`The maximum number of requests for the current subscription period has been reached.
1206
+ title: I("The usage limit has been exceeded"),
1207
+ description: I(`The maximum number of requests for the current subscription period has been reached.
1208
1208
  Select the appropriate plan to fulfil more requests`),
1209
1209
  placement: "bottomRight"
1210
1210
  }));
@@ -1212,32 +1212,32 @@ Select the appropriate plan to fulfil more requests`),
1212
1212
  oe,
1213
1213
  F,
1214
1214
  le,
1215
- D,
1215
+ P,
1216
1216
  T,
1217
1217
  v,
1218
1218
  z,
1219
1219
  ye,
1220
1220
  ve,
1221
1221
  b,
1222
- A,
1222
+ I,
1223
1223
  h
1224
1224
  ]);
1225
1225
  (0, n.useEffect)(() => {
1226
- F && z(k?.counters?.ai_img_counter || 0);
1227
- }, [k, F]);
1228
- const te = u.useEventEmitter(u.events.AI_IMAGE_PROGRESS_ID);
1226
+ F && z(E?.counters?.ai_img_counter || 0);
1227
+ }, [E, F]);
1228
+ const ne = d.useEventEmitter(d.events.AI_IMAGE_PROGRESS_ID);
1229
1229
  (0, n.useEffect)(() => {
1230
- const C = te.event(({ progress: q, status: Z }) => {
1231
- K(Z || `${Math.round(q)}%`);
1230
+ const C = ne.event(({ progress: _, status: Y }) => {
1231
+ K(Y || `${Math.round(_)}%`);
1232
1232
  });
1233
1233
  return () => C.dispose();
1234
- }, [te]);
1234
+ }, [ne]);
1235
1235
  const G = (0, n.useCallback)(async (C) => {
1236
1236
  if (!i) {
1237
1237
  o(!0);
1238
1238
  try {
1239
- const q = at(C) ? await (await fetch(C)).blob() : Je(C);
1240
- e({ file: new File([q], "image.jpeg", { type: q.type || "image/jpeg" }) });
1239
+ const _ = st(C) ? await (await fetch(C)).blob() : $e(C);
1240
+ e({ file: new File([_], "image.jpeg", { type: _.type || "image/jpeg" }) });
1241
1241
  } catch {
1242
1242
  o(!1);
1243
1243
  }
@@ -1247,39 +1247,39 @@ Select the appropriate plan to fulfil more requests`),
1247
1247
  o,
1248
1248
  e
1249
1249
  ]), ae = (0, n.useCallback)((C) => {
1250
- C.status !== "error" && C.status !== "Canceled" ? C.images ? (K(C.status), C.progress === 100 && (p(C.images), K(A("Evaluating the task")), S(null), y(!1))) : (p([C.data]), x(!1)) : (x(!1), y(!1), b.error({
1250
+ C.status !== "error" && C.status !== "Canceled" ? C.images ? (K(C.status), C.progress === 100 && (p(C.images), K(I("Evaluating the task")), S(null), y(!1))) : (p([C.data]), x(!1)) : (x(!1), y(!1), b.error({
1251
1251
  id: "AI_IMAGE_GET_ERROR",
1252
- title: A("Something went wrong, please try again"),
1252
+ title: I("Something went wrong, please try again"),
1253
1253
  placement: "bottomRight",
1254
- data: j
1254
+ data: L
1255
1255
  }));
1256
1256
  }, [
1257
1257
  p,
1258
1258
  K,
1259
- A,
1259
+ I,
1260
1260
  x,
1261
1261
  t,
1262
- j,
1262
+ L,
1263
1263
  b,
1264
1264
  y
1265
1265
  ]);
1266
1266
  return (0, n.useEffect)(() => {
1267
- P.length > 1 && ae(P[P.length - 1]);
1268
- }, [P, ae]), (0, n.useEffect)(() => {
1267
+ M.length > 1 && ae(M[M.length - 1]);
1268
+ }, [M, ae]), (0, n.useEffect)(() => {
1269
1269
  (g || m.length > 0) && setTimeout(() => {
1270
1270
  let C = 550;
1271
1271
  s.current && (C = s.current.offsetHeight + 68), t(C);
1272
1272
  }, 0);
1273
1273
  }, [
1274
1274
  s,
1275
- P,
1275
+ M,
1276
1276
  m.length,
1277
1277
  g,
1278
1278
  t
1279
1279
  ]), {
1280
- aiImageCounter: E,
1280
+ aiImageCounter: j,
1281
1281
  setAiImageCounter: z,
1282
- currentAiImgLimits: ee,
1282
+ currentAiImgLimits: $,
1283
1283
  isFieldsDisabled: he,
1284
1284
  canGenerateImage: oe,
1285
1285
  aiImageRequest: l,
@@ -1289,20 +1289,22 @@ Select the appropriate plan to fulfil more requests`),
1289
1289
  setIsLoadingAi: x,
1290
1290
  loadingDuringGeneration: a,
1291
1291
  setLoadingDuringGeneration: y,
1292
- requestStatus: J,
1292
+ requestStatus: X,
1293
1293
  setRequestStatus: K,
1294
- handleGenerate: $,
1294
+ handleGenerate: J,
1295
1295
  handleLimitAiImgCount: ye,
1296
1296
  convertBase64ToFile: G,
1297
- isShiftPressed: I,
1297
+ isShiftPressed: A,
1298
1298
  setIsShiftPressed: N,
1299
- currentReqId: j,
1299
+ currentReqId: L,
1300
1300
  setCurrentReqId: S,
1301
1301
  limitsInPlugin: F
1302
1302
  };
1303
1303
  }
1304
- var Gt = ({ setModalHeight: t, customRequest: e, aiTabRef: s, inputAiRef: i, isImageUploaded: o, setIsImageUploaded: l, aiImageRequest: m, setAiImageRequest: p, imageAiList: g, setImageAiList: x, isLoadingAi: h, setIsLoadingAi: v }) => {
1305
- const A = u.useNavigate(), k = u.useDispatch(), { __: b, _n: O } = f.useI18n(), w = u.useAppConfig(), [U, L] = (0, n.useState)(!1), [M, V] = (0, n.useState)(null), { aiImageCounter: P, currentAiImgLimits: T, loadingDuringGeneration: X, requestStatus: _, handleGenerate: Y, convertBase64ToFile: E, isShiftPressed: z, setIsShiftPressed: j, limitsInPlugin: S } = Nt({
1304
+ var Kt = ({ setModalHeight: t, customRequest: e, aiTabRef: s, inputAiRef: i, isImageUploaded: o, setIsImageUploaded: l, aiImageRequest: m, setAiImageRequest: p, imageAiList: g, setImageAiList: x, isLoadingAi: h, setIsLoadingAi: v }) => {
1305
+ const I = d.useNavigate();
1306
+ d.useDispatch();
1307
+ const E = R.useOpenPlanCatalog(), { __: b, _n: O } = f.useI18n(), w = d.useAppConfig(), [U, D] = (0, n.useState)(!1), [B, V] = (0, n.useState)(null), { aiImageCounter: M, currentAiImgLimits: T, loadingDuringGeneration: Z, requestStatus: q, handleGenerate: Q, convertBase64ToFile: j, isShiftPressed: z, setIsShiftPressed: L, limitsInPlugin: S } = zt({
1306
1308
  setModalHeight: t,
1307
1309
  customRequest: e,
1308
1310
  aiTabRef: s,
@@ -1313,54 +1315,54 @@ Select the appropriate plan to fulfil more requests`),
1313
1315
  setImageAiList: x,
1314
1316
  isLoadingAi: h,
1315
1317
  setIsLoadingAi: v,
1316
- onPluginAiImageLimitExceeded: () => L(!0),
1318
+ onPluginAiImageLimitExceeded: () => D(!0),
1317
1319
  onImageGenerateLimitExceeded: V
1318
- }), I = U && T > 0 ? ne.getAiTariffUpgradeStep(T) : null, N = I ? B.getLimitUpgradePresetDefinition(I.presetId) : null, J = M ? B.getLimitUpgradePresetDefinition(M.presetId) : null, [K, a] = (0, n.useState)(!1), y = (0, n.useCallback)(() => a(!0), []), W = (0, n.useCallback)(() => a(!1), []), ie = (0, n.useCallback)((D) => p(D.target.value), [p]), ee = (0, n.useCallback)((D) => {
1319
- D.key === "Shift" ? j(!0) : D.key === "Enter" && !z && (D.preventDefault(), Y());
1320
+ }), A = U && T > 0 ? te.getAiTariffUpgradeStep(T) : null, N = A ? R.getLimitUpgradePresetDefinition(A.presetId) : null, X = B ? R.getLimitUpgradePresetDefinition(B.presetId) : null, [K, a] = (0, n.useState)(!1), y = (0, n.useCallback)(() => a(!0), []), W = (0, n.useCallback)(() => a(!1), []), ie = (0, n.useCallback)((P) => p(P.target.value), [p]), $ = (0, n.useCallback)((P) => {
1321
+ P.key === "Shift" ? L(!0) : P.key === "Enter" && !z && (P.preventDefault(), Q());
1320
1322
  }, [
1321
1323
  z,
1322
- Y,
1323
- j
1324
- ]), F = (0, n.useCallback)((D) => {
1325
- D.key === "Shift" && j(!1);
1326
- }, [j]), le = g[g.length - 1];
1324
+ Q,
1325
+ L
1326
+ ]), F = (0, n.useCallback)((P) => {
1327
+ P.key === "Shift" && L(!1);
1328
+ }, [L]), le = g[g.length - 1];
1327
1329
  return (0, r.jsxs)("div", {
1328
1330
  className: "image-ai",
1329
1331
  children: [
1330
- N && I ? (0, r.jsx)(B.LimitUpgradeModal, {
1332
+ N && A ? (0, r.jsx)(R.LimitUpgradeModal, {
1331
1333
  open: !0,
1332
- onClose: () => L(!1),
1334
+ onClose: () => D(!1),
1333
1335
  title: b(N.titleKey),
1334
1336
  subtitle: b(N.subtitleKey),
1335
1337
  usageResource: N.usageResource,
1336
- previousDisplay: B.presetLimitDisplay(I.previousLimit),
1337
- nextDisplay: B.presetLimitDisplay(I.nextLimit),
1338
+ previousDisplay: R.presetLimitDisplay(A.previousLimit),
1339
+ nextDisplay: R.presetLimitDisplay(A.nextLimit),
1338
1340
  onChangePlan: () => {
1339
- L(!1), document.body.classList.remove("editor"), A("/billing"), k(Q.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1341
+ D(!1), E();
1340
1342
  }
1341
1343
  }) : null,
1342
- J && M ? (0, r.jsx)(B.LimitUpgradeModal, {
1344
+ X && B ? (0, r.jsx)(R.LimitUpgradeModal, {
1343
1345
  open: !0,
1344
1346
  onClose: () => V(null),
1345
- title: b(J.titleKey),
1346
- subtitle: b(J.subtitleKey),
1347
- usageResource: J.usageResource,
1348
- previousDisplay: B.presetLimitDisplay(M.previousLimit),
1349
- nextDisplay: B.presetLimitDisplay(M.nextLimit),
1347
+ title: b(X.titleKey),
1348
+ subtitle: b(X.subtitleKey),
1349
+ usageResource: X.usageResource,
1350
+ previousDisplay: R.presetLimitDisplay(B.previousLimit),
1351
+ nextDisplay: R.presetLimitDisplay(B.nextLimit),
1350
1352
  onChangePlan: () => {
1351
- V(null), document.body.classList.remove("editor"), A("/billing"), k(Q.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1353
+ V(null), E();
1352
1354
  }
1353
1355
  }) : null,
1354
1356
  S && (0, r.jsx)(f.LimitsCounter, {
1355
- text: `${P} ${b("of")} ${T > 0 ? T : "∞"} images ${O("was used", "were used", P)}`,
1356
- exceeded: T > 0 && P >= T,
1357
+ text: `${M} ${b("of")} ${T > 0 ? T : "∞"} images ${O("was used", "were used", M)}`,
1358
+ exceeded: T > 0 && M >= T,
1357
1359
  style: { marginTop: -25 },
1358
1360
  extra: (0, r.jsx)("span", {
1359
1361
  style: {
1360
1362
  textDecoration: "underline",
1361
1363
  cursor: "pointer"
1362
1364
  },
1363
- onClick: () => A(w.billingPageUrl || u.APP_ROUTES.billing),
1365
+ onClick: () => I(w.billingPageUrl || d.APP_ROUTES.billing),
1364
1366
  children: b("Need more?")
1365
1367
  })
1366
1368
  }),
@@ -1375,7 +1377,7 @@ Select the appropriate plan to fulfil more requests`),
1375
1377
  className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${K ? " ant-input-affix-wrapper-focused" : ""}`,
1376
1378
  children: [(0, r.jsx)(f.TextArea, {
1377
1379
  ref: i,
1378
- onKeyDown: ee,
1380
+ onKeyDown: $,
1379
1381
  onKeyUp: F,
1380
1382
  onFocus: y,
1381
1383
  onBlur: W,
@@ -1388,14 +1390,14 @@ Select the appropriate plan to fulfil more requests`),
1388
1390
  spellCheck: "false"
1389
1391
  }), (0, r.jsx)("span", {
1390
1392
  className: "ant-input-suffix image-ai__input-suffix",
1391
- children: h || X ? (0, r.jsx)(B.EmIcons, {
1393
+ children: h || Z ? (0, r.jsx)(R.EmIcons, {
1392
1394
  icon: "LoadingOutlined",
1393
1395
  className: "input-icon image-ai__input-icon",
1394
1396
  spin: !0
1395
- }) : (0, r.jsx)(B.EmIcons, {
1397
+ }) : (0, r.jsx)(R.EmIcons, {
1396
1398
  icon: "AI",
1397
1399
  className: "input-icon image-ai__input-icon",
1398
- onClick: Y
1400
+ onClick: Q
1399
1401
  })
1400
1402
  })]
1401
1403
  })
@@ -1408,22 +1410,22 @@ Select the appropriate plan to fulfil more requests`),
1408
1410
  className: "image-ai__loading",
1409
1411
  children: (0, r.jsxs)("div", {
1410
1412
  className: "spin",
1411
- children: [(0, r.jsx)(B.EmIcons, {
1413
+ children: [(0, r.jsx)(R.EmIcons, {
1412
1414
  icon: "LoadingOutlined",
1413
1415
  style: { fontSize: 48 },
1414
1416
  spin: !0
1415
1417
  }), (0, r.jsx)("p", {
1416
1418
  className: "status",
1417
- children: _
1419
+ children: q
1418
1420
  })]
1419
1421
  })
1420
1422
  }), g.length > 0 && (0, r.jsxs)("div", {
1421
1423
  className: "image-ai__image-item",
1422
- children: [(0, r.jsx)(Tt, { images: g }), (0, r.jsx)("div", {
1424
+ children: [(0, r.jsx)(Ft, { images: g }), (0, r.jsx)("div", {
1423
1425
  className: "buttons",
1424
1426
  children: (0, r.jsx)(f.Button, {
1425
- onClick: () => E(le),
1426
- icon: (0, r.jsx)(B.EmIcons, { icon: "CheckOutlined" }),
1427
+ onClick: () => j(le),
1428
+ icon: (0, r.jsx)(R.EmIcons, { icon: "CheckOutlined" }),
1427
1429
  children: b("Use this one")
1428
1430
  })
1429
1431
  })]
@@ -1431,8 +1433,8 @@ Select the appropriate plan to fulfil more requests`),
1431
1433
  })
1432
1434
  ]
1433
1435
  });
1434
- }, Ft = ({ setNewLink: t, setCurrentImageLink: e, setModalHeight: s, setModalWidth: i, setImageGifList: o, imageGifList: l, currentReqGif: m, setCurrentReqGif: p, inputRef: g, setStockLink: x, customRequest: h }) => {
1435
- const { __: v } = f.useI18n(), A = u.useAppConfig(), k = u.useIsStandalone(), b = f.useNotification(), [O, w] = (0, n.useState)(null), [U, L] = (0, n.useState)(!1), [M, V] = (0, n.useState)(25), [P] = Q.useLazyGetSearchGifQuery(), T = (0, n.useCallback)((a) => a instanceof Error || typeof a?.message == "string" && a.message ? a.message : typeof a?.error?.message == "string" && a.error.message ? a.error.message : v("Failed to load GIFs through the configured proxy chain."), [v]), X = (0, n.useCallback)((a) => {
1436
+ }, Wt = ({ setNewLink: t, setCurrentImageLink: e, setModalHeight: s, setModalWidth: i, setImageGifList: o, imageGifList: l, currentReqGif: m, setCurrentReqGif: p, inputRef: g, setStockLink: x, customRequest: h }) => {
1437
+ const { __: v } = f.useI18n(), I = d.useAppConfig(), E = d.useIsStandalone(), b = f.useNotification(), [O, w] = (0, n.useState)(null), [U, D] = (0, n.useState)(!1), [B, V] = (0, n.useState)(25), [M] = ee.useLazyGetSearchGifQuery(), T = (0, n.useCallback)((a) => a instanceof Error || typeof a?.message == "string" && a.message ? a.message : typeof a?.error?.message == "string" && a.error.message ? a.error.message : v("Failed to load GIFs through the configured proxy chain."), [v]), Z = (0, n.useCallback)((a) => {
1436
1438
  b.error({
1437
1439
  id: "STOCK_GIFS_SEARCH_FAILED",
1438
1440
  title: v("Failed to load GIFs"),
@@ -1442,54 +1444,54 @@ Select the appropriate plan to fulfil more requests`),
1442
1444
  v,
1443
1445
  T,
1444
1446
  b
1445
- ]), _ = async () => {
1446
- U || (L(!0), P({
1447
+ ]), q = async () => {
1448
+ U || (D(!0), M({
1447
1449
  query: m,
1448
- page: M
1450
+ page: B
1449
1451
  }).then((a) => {
1450
1452
  if (a?.error) {
1451
- X(a.error), L(!1);
1453
+ Z(a.error), D(!1);
1452
1454
  return;
1453
1455
  }
1454
- o((y) => [...y, ...a.data.data]), L(!1), V((y) => y + 25);
1456
+ o((y) => [...y, ...a.data.data]), D(!1), V((y) => y + 25);
1455
1457
  }).catch(() => {
1456
- L(!1);
1458
+ D(!1);
1457
1459
  }));
1458
- }, Y = async () => {
1459
- const a = await P({
1460
+ }, Q = async () => {
1461
+ const a = await M({
1460
1462
  query: m,
1461
1463
  page: 0
1462
1464
  });
1463
1465
  if (a?.error) {
1464
- X(a.error), o([]);
1466
+ Z(a.error), o([]);
1465
1467
  return;
1466
1468
  }
1467
1469
  a?.data?.data?.length > 0 && (o(a.data.data), setTimeout(() => {
1468
1470
  s("84vh"), i(1060);
1469
1471
  }, 0));
1470
- }, E = (a, y) => {
1472
+ }, j = (a, y) => {
1471
1473
  w(y), setTimeout(() => {
1472
1474
  w(null);
1473
1475
  }, 2e3), x(`${a}`), e(`${a}`), h(`${a}`);
1474
- }, z = { default: 3 }, j = (0, n.useCallback)((a) => u.getProxiedUrl(a, {
1475
- config: A,
1476
- standalone: k,
1476
+ }, z = { default: 3 }, L = (0, n.useCallback)((a) => d.getProxiedUrl(a, {
1477
+ config: I,
1478
+ standalone: E,
1477
1479
  resourceType: "generic",
1478
1480
  intent: "display"
1479
- }), [A, k]), { getDisplaySrc: S, handleLoad: I, handleError: N } = nt({
1481
+ }), [I, E]), { getDisplaySrc: S, handleLoad: A, handleError: N } = rt({
1480
1482
  items: l,
1481
1483
  getItemId: (0, n.useCallback)((a) => a.id, []),
1482
1484
  getRequestUrl: (0, n.useCallback)((a) => a.images.downsized.url, []),
1483
- createController: j
1484
- }), J = (a) => (y) => {
1485
- I(a), y.target.parentNode.classList.add("loaded");
1485
+ createController: L
1486
+ }), X = (a) => (y) => {
1487
+ A(a), y.target.parentNode.classList.add("loaded");
1486
1488
  }, K = (a) => () => {
1487
1489
  N(a);
1488
1490
  };
1489
1491
  return (0, r.jsxs)("div", {
1490
1492
  className: "stock-tab",
1491
1493
  children: [(0, r.jsxs)(f.Form, {
1492
- onValuesChange: Y,
1494
+ onValuesChange: Q,
1493
1495
  className: l.length > 0 ? "serach-results" : "",
1494
1496
  children: [(0, r.jsx)(f.Row, {
1495
1497
  gutter: 24,
@@ -1498,7 +1500,7 @@ Select the appropriate plan to fulfil more requests`),
1498
1500
  children: (0, r.jsx)(f.Form.Item, {
1499
1501
  className: "stock-search-input",
1500
1502
  children: (0, r.jsx)(f.SearchInput, {
1501
- onSearch: Y,
1503
+ onSearch: Q,
1502
1504
  allowClear: !0,
1503
1505
  size: l.length > 0 ? "medium" : "large",
1504
1506
  placeholder: v("Search GIFs"),
@@ -1536,9 +1538,9 @@ Select the appropriate plan to fulfil more requests`),
1536
1538
  lineHeight: "0",
1537
1539
  boxSizing: "unset"
1538
1540
  },
1539
- children: (0, r.jsx)(et, {
1541
+ children: (0, r.jsx)(tt, {
1540
1542
  dataLength: l && l.length,
1541
- next: _,
1543
+ next: q,
1542
1544
  hasMore: l,
1543
1545
  endMessage: (0, r.jsxs)(f.Divider, {
1544
1546
  plain: !0,
@@ -1547,20 +1549,20 @@ Select the appropriate plan to fulfil more requests`),
1547
1549
  scrollableTarget: "scrollableDiv",
1548
1550
  style: { overflow: "visible" },
1549
1551
  loader: (0, r.jsx)(f.Spin, { size: "small" }),
1550
- children: (0, r.jsx)(Ge, {
1552
+ children: (0, r.jsx)(Ne, {
1551
1553
  breakpointCols: z,
1552
1554
  className: "my-masonry-grid",
1553
1555
  columnClassName: "my-masonry-grid_column",
1554
1556
  children: l.map((a, y) => (0, r.jsxs)("div", {
1555
1557
  className: "list-item",
1556
- onClick: () => E(a.images.downsized.url, a.id),
1558
+ onClick: () => j(a.images.downsized.url, a.id),
1557
1559
  children: [
1558
1560
  (0, r.jsx)("img", {
1559
1561
  className: O === a.id ? "loaded-image" : "",
1560
1562
  width: "322px",
1561
1563
  src: S(a),
1562
1564
  alt: a.title,
1563
- onLoad: J(a),
1565
+ onLoad: X(a),
1564
1566
  onError: K(a)
1565
1567
  }),
1566
1568
  (0, r.jsx)("a", {
@@ -1585,10 +1587,10 @@ Select the appropriate plan to fulfil more requests`),
1585
1587
  })]
1586
1588
  });
1587
1589
  };
1588
- function zt(t) {
1590
+ function Ht(t) {
1589
1591
  if (!(t == null || t === "")) return t;
1590
1592
  }
1591
- async function Kt(t, e) {
1593
+ async function Vt(t, e) {
1592
1594
  if (t) {
1593
1595
  if (t.url) return t.url;
1594
1596
  if (typeof e.getFileById == "function" && t.id) {
@@ -1608,10 +1610,10 @@ Select the appropriate plan to fulfil more requests`),
1608
1610
  return t.thumbnail || t.thumbnailUrl;
1609
1611
  }
1610
1612
  }
1611
- function Wt(t) {
1613
+ function _t(t) {
1612
1614
  if (!(!t?.success || !Array.isArray(t.detailed))) return t.detailed.find((e) => e?.success && e.data)?.data;
1613
1615
  }
1614
- function Ht(t, e, s) {
1616
+ function qt(t, e, s) {
1615
1617
  if (t) return {
1616
1618
  id: t.id,
1617
1619
  name: t.name || e.name,
@@ -1631,11 +1633,11 @@ Select the appropriate plan to fulfil more requests`),
1631
1633
  childrenCount: t.childrenCount
1632
1634
  };
1633
1635
  }
1634
- async function Vt(t, e, s) {
1636
+ async function Qt(t, e, s) {
1635
1637
  if (!e) return;
1636
- const i = zt(s ?? e.rootId);
1638
+ const i = Ht(s ?? e.rootId);
1637
1639
  let o;
1638
- typeof e.uploadFiles == "function" ? o = Wt(await e.uploadFiles({
1640
+ typeof e.uploadFiles == "function" ? o = _t(await e.uploadFiles({
1639
1641
  folderId: i,
1640
1642
  items: [{
1641
1643
  name: t.name,
@@ -1644,99 +1646,99 @@ Select the appropriate plan to fulfil more requests`),
1644
1646
  folderId: i,
1645
1647
  data: t
1646
1648
  }]
1647
- })) : typeof e.uploadFile == "function" && (o = Ht(await e.uploadFile({
1649
+ })) : typeof e.uploadFile == "function" && (o = qt(await e.uploadFile({
1648
1650
  name: t.name,
1649
1651
  size: t.size,
1650
1652
  type: t.type,
1651
1653
  folderId: i,
1652
1654
  data: t
1653
1655
  }), t, i));
1654
- const l = await Kt(o, e);
1656
+ const l = await Vt(o, e);
1655
1657
  return l ? {
1656
1658
  item: o,
1657
1659
  url: l
1658
1660
  } : void 0;
1659
1661
  }
1660
- var st = "IMG", ot = "BACKGROUND", qt = "GALLERY", Ie = "EDITOR", fe = "UPLOAD", ze = "STOCK", Ke = "GIF", We = "AI", Qt = { mode: "select" }, _t = { mode: "save" }, { Dragger: Yt } = f.Upload, Zt = (t, e = "image") => Q.decodeFileNameFromUrl(t) ?? e, Ee = ne.normalizeImageFormatForDisplay, Xt = (t, e) => {
1662
+ var ot = "IMG", it = "BACKGROUND", Yt = "GALLERY", Ae = "EDITOR", fe = "UPLOAD", Fe = "STOCK", ze = "GIF", Ke = "AI", Zt = { mode: "select" }, Xt = { mode: "save" }, { Dragger: Jt } = f.Upload, $t = (t, e = "image") => ee.decodeFileNameFromUrl(t) ?? e, Ee = te.normalizeImageFormatForDisplay, en = (t, e) => {
1661
1663
  const s = Ee(e);
1662
1664
  return !s || t.includes(".") ? t : `${t}.${s}`;
1663
- }, Jt = (t, e) => new File([t], Xt(Zt(e), t.type), { type: t.type || "application/octet-stream" }), it = ({ dataProvider: t, usesBuiltInStorage: e }) => {
1664
- const s = u.useAppConfig(), i = u.useIsStandalone(), { __: o } = f.useI18n(), l = u.useDispatch(), { projectId: m } = u.useParams(), [p] = Q.useLazyGetImageInfoQuery(), { modal: g } = f.App.useApp(), x = f.useNotification(), h = u.useSelector(Q.selectActiveModal), { request: v, resolveImagePicker: A } = B.useImagePicker(), [k, b] = (0, n.useState)(""), [O, w] = (0, n.useState)(""), [U, L] = (0, n.useState)(""), [M, V] = (0, n.useState)(""), [P, T] = (0, n.useState)(fe), [X, _] = (0, n.useState)({
1665
+ }, tn = (t, e) => new File([t], en($t(e), t.type), { type: t.type || "application/octet-stream" }), lt = ({ dataProvider: t, usesBuiltInStorage: e }) => {
1666
+ const s = d.useAppConfig(), i = d.useIsStandalone(), { __: o } = f.useI18n(), l = d.useDispatch(), { projectId: m } = d.useParams(), [p] = ee.useLazyGetImageInfoQuery(), { modal: g } = f.App.useApp(), x = f.useNotification(), h = d.useSelector(ee.selectActiveModal), { request: v, resolveImagePicker: I } = R.useImagePicker(), [E, b] = (0, n.useState)(""), [O, w] = (0, n.useState)(""), [U, D] = (0, n.useState)(""), [B, V] = (0, n.useState)(""), [M, T] = (0, n.useState)(fe), [Z, q] = (0, n.useState)({
1665
1667
  width: "",
1666
1668
  height: "",
1667
1669
  size: "",
1668
1670
  format: ""
1669
- }), [Y, E] = (0, n.useState)("success"), [z, j] = (0, n.useState)(!1), S = n.default.useRef(null), I = n.default.useRef(null), N = n.default.useRef(null), J = n.default.useRef(null), K = n.default.useRef(null), a = n.default.useRef(null), y = n.default.useRef(null), W = n.default.useRef(null), ie = n.default.useRef(null), [ee, F] = (0, n.useState)("auto"), [le, D] = (0, n.useState)(572), [he, ye] = (0, n.useState)(!1), [oe, ve] = (0, n.useState)({
1671
+ }), [Q, j] = (0, n.useState)("success"), [z, L] = (0, n.useState)(!1), S = n.default.useRef(null), A = n.default.useRef(null), N = n.default.useRef(null), X = n.default.useRef(null), K = n.default.useRef(null), a = n.default.useRef(null), y = n.default.useRef(null), W = n.default.useRef(null), ie = n.default.useRef(null), [$, F] = (0, n.useState)("auto"), [le, P] = (0, n.useState)(572), [he, ye] = (0, n.useState)(!1), [oe, ve] = (0, n.useState)({
1670
1672
  keywords: "",
1671
1673
  color: "",
1672
1674
  orientation: ""
1673
- }), [$, te] = (0, n.useState)({ keywords: "" }), [G, ae] = (0, n.useState)([]), [C, q] = (0, n.useState)([]), [Z, me] = (0, n.useState)([]), [lt, ct] = (0, n.useState)(!1), [ut, He] = (0, n.useState)(""), [$t, je] = (0, n.useState)(!1), [en, Me] = (0, n.useState)(0), Ve = u.useSelector(u.selectProject), dt = Ve?.id !== void 0 ? String(Ve.id) : m || "", ft = u.useEventEmitter(u.events.UPLOAD_EVENT_ID), pe = ne.useImageBlobResolver(), Oe = n.default.useRef(""), we = n.default.useRef(0), xe = n.default.useRef(""), [tn, mt] = (0, n.useState)(""), [nn, pt] = (0, n.useState)(null), [rn, qe] = (0, n.useState)(""), Pe = (0, n.useCallback)((c) => {
1675
+ }), [J, ne] = (0, n.useState)({ keywords: "" }), [G, ae] = (0, n.useState)([]), [C, _] = (0, n.useState)([]), [Y, me] = (0, n.useState)([]), [ct, ut] = (0, n.useState)(!1), [dt, We] = (0, n.useState)(""), [nn, Re] = (0, n.useState)(!1), [rn, Ue] = (0, n.useState)(0), ft = d.useSelector(d.selectProject), mt = ft?.id !== void 0 ? String(ft.id) : m || "", pt = d.useEventEmitter(d.events.UPLOAD_EVENT_ID), pe = te.useImageBlobResolver(), je = n.default.useRef(""), be = n.default.useRef(0), Ie = n.default.useRef(""), [an, gt] = (0, n.useState)(""), [sn, ht] = (0, n.useState)(null), [on, He] = (0, n.useState)(""), Be = (0, n.useCallback)((c) => {
1674
1676
  if (!(c instanceof Blob)) return;
1675
- xe.current && URL.revokeObjectURL(xe.current);
1676
- const d = URL.createObjectURL(c);
1677
- xe.current = d, mt(d), pt(c);
1677
+ Ie.current && URL.revokeObjectURL(Ie.current);
1678
+ const u = URL.createObjectURL(c);
1679
+ Ie.current = u, gt(u), ht(c);
1678
1680
  }, []), ge = (0, n.useCallback)(() => {
1679
- xe.current && (URL.revokeObjectURL(xe.current), xe.current = ""), mt(""), pt(null);
1681
+ Ie.current && (URL.revokeObjectURL(Ie.current), Ie.current = ""), gt(""), ht(null);
1680
1682
  }, []), ce = (0, n.useCallback)(() => {
1681
- qe("");
1682
- }, []), Ce = B.isEditorLockedByPlan(Ve, { isPlugin: u.PLUGIN.isPlugin }), an = (c) => {
1683
+ He("");
1684
+ }, []), Ve = R.usePlanFeatureGate("element_ai_image"), _e = R.usePlanFeatureGate("stock_photo"), qe = R.usePlanFeatureGate("stock_gif"), yt = R.usePlanFeatureGate("image_editor"), ln = (c) => {
1683
1685
  w(c.target.value);
1684
- }, Le = (0, n.useCallback)((c, d, R = o("The image could not be uploaded.")) => {
1685
- const H = d instanceof Error ? d.message : R;
1686
+ }, Le = (0, n.useCallback)((c, u, k = o("The image could not be uploaded.")) => {
1687
+ const H = u instanceof Error ? u.message : k;
1686
1688
  x.error({
1687
1689
  id: "IMAGE_UPLOAD_ERROR",
1688
1690
  data: c,
1689
1691
  title: o("Upload failed"),
1690
1692
  description: H
1691
1693
  });
1692
- }, [o, x]), sn = (0, n.useCallback)((c) => B.fireUploadImageEvent(ft, {
1694
+ }, [o, x]), cn = (0, n.useCallback)((c) => R.fireUploadImageEvent(pt, {
1693
1695
  file: c,
1694
- project: dt
1695
- }), [dt, ft]), Ae = ne.useImageBlobFetch(), on = (0, n.useCallback)((c) => pe.resolve(ne.canonicalImageUrlKey(c), void 0, Ae), [Ae, pe]), Te = async (c) => {
1696
+ project: mt
1697
+ }), [mt, pt]), we = te.useImageBlobFetch(), un = (0, n.useCallback)((c) => pe.resolve(te.canonicalImageUrlKey(c), void 0, we), [we, pe]), Me = async (c) => {
1696
1698
  if (c) try {
1697
- const d = await ln(c);
1698
- d && _e(d) ? await De({ file: d }) : d || Le({ url: c }, null, o("Failed to download image from URL."));
1699
- } catch (d) {
1700
- Le({ url: c }, d, o("Failed to process image URL."));
1699
+ const u = await dn(c);
1700
+ u && Ye(u) ? await Oe({ file: u }) : u || Le({ url: c }, null, o("Failed to download image from URL."));
1701
+ } catch (u) {
1702
+ Le({ url: c }, u, o("Failed to process image URL."));
1701
1703
  }
1702
- }, gt = n.default.useRef(Te);
1703
- gt.current = Te, n.default.useEffect(() => {
1704
- if (P !== fe || !M) return;
1704
+ }, vt = n.default.useRef(Me);
1705
+ vt.current = Me, n.default.useEffect(() => {
1706
+ if (M !== fe || !B) return;
1705
1707
  const c = O.trim();
1706
1708
  if (!c || !c.toLowerCase().startsWith("http")) return;
1707
- const d = setTimeout(() => {
1708
- gt.current(c);
1709
+ const u = setTimeout(() => {
1710
+ vt.current(c);
1709
1711
  }, 1e3);
1710
1712
  return () => {
1711
- clearTimeout(d);
1713
+ clearTimeout(u);
1712
1714
  };
1713
1715
  }, [
1714
1716
  O,
1715
- P,
1716
- M
1717
+ M,
1718
+ B
1717
1719
  ]);
1718
- const ln = async (c) => {
1720
+ const dn = async (c) => {
1719
1721
  try {
1720
- const d = ne.canonicalImageUrlKey(c);
1721
- return Jt(await pe.resolve(d, void 0, Ae), d);
1722
+ const u = te.canonicalImageUrlKey(c);
1723
+ return tn(await pe.resolve(u, void 0, we), u);
1722
1724
  } catch {}
1723
1725
  };
1724
1726
  document.onpaste = function(c) {
1725
- const d = c.clipboardData?.items?.[0];
1726
- if (P === fe && M) {
1727
- if (d?.type?.indexOf("image") === 0 && s.imageCenterLocalUploadEnabled !== !1) {
1728
- const H = d.getAsFile();
1729
- _e(H);
1727
+ const u = c.clipboardData?.items?.[0];
1728
+ if (M === fe && B) {
1729
+ if (u?.type?.indexOf("image") === 0 && s.imageCenterLocalUploadEnabled !== !1) {
1730
+ const H = u.getAsFile();
1731
+ Ye(H);
1730
1732
  const se = { file: H };
1731
- w(""), De(se);
1733
+ w(""), Oe(se);
1732
1734
  return;
1733
1735
  }
1734
- const R = c.clipboardData?.getData("text/plain");
1735
- if (R && R.trim().toLowerCase().startsWith("http")) {
1736
- c.preventDefault(), c.stopPropagation(), w(R.trim());
1736
+ const k = c.clipboardData?.getData("text/plain");
1737
+ if (k && k.trim().toLowerCase().startsWith("http")) {
1738
+ c.preventDefault(), c.stopPropagation(), w(k.trim());
1737
1739
  return;
1738
1740
  }
1739
- d?.type?.indexOf("text") === 0 && d.getAsString((H) => {
1741
+ u?.type?.indexOf("text") === 0 && u.getAsString((H) => {
1740
1742
  if (H.trim().toLowerCase().startsWith("http")) w(H.trim());
1741
1743
  else if (H.toString().slice(1, 5) === "meta") {
1742
1744
  const se = H.toString().split("\"")[1];
@@ -1745,40 +1747,43 @@ Select the appropriate plan to fulfil more requests`),
1745
1747
  });
1746
1748
  }
1747
1749
  }, (0, n.useEffect)(() => {
1748
- const c = (d) => {
1749
- let R = null;
1750
- v?.kind === "background" ? (R = ot, V(ot)) : v?.kind === "img" && (V(st), R = st), v?.currentUrl && R && (b(v.currentUrl), T(d));
1750
+ const c = (u) => {
1751
+ let k = null;
1752
+ v?.kind === "background" ? (k = it, V(it)) : v?.kind === "img" && (V(ot), k = ot), v?.currentUrl && k && (b(v.currentUrl), T(u));
1751
1753
  };
1752
- h === u.MODALS.UPLOAD_IMAGE_MODAL || h === u.MODALS.UPLOAD_BACKGROUND_MODAL ? c(Ie) : h === u.MODALS.UPLOAD_IMAGE_MODAL_AI || h === u.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (Ce ? (je(!0), Me(2)) : c(We), setTimeout(() => ie.current?.focus({ cursor: "start" }), 100)) : h === u.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || h === u.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(fe), setTimeout(() => a.current?.focus({ cursor: "start" }), 100)) : h === u.MODALS.UPLOAD_IMAGE_MODAL_STOCK || h === u.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (Ce ? (je(!0), Me(3)) : c(ze), setTimeout(() => W.current?.focus({ cursor: "start" }), 100)) : h === u.MODALS.UPLOAD_IMAGE_MODAL_GIF || h === u.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (Ce ? (je(!0), Me(3)) : c(Ke), setTimeout(() => y.current?.focus({ cursor: "start" }), 100)) : h === u.MODALS.UPLOAD_IMAGE_MODAL_EDIT || h === u.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (Ce ? (je(!0), Me(5)) : c(Ie), l(Q.openSecondModal(u.MODALS.IMAGE_EDITOR_MODAL))) : V("");
1754
+ h === d.MODALS.UPLOAD_IMAGE_MODAL || h === d.MODALS.UPLOAD_BACKGROUND_MODAL ? c(Ae) : h === d.MODALS.UPLOAD_IMAGE_MODAL_AI || h === d.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (Ve.isLocked ? (Re(!0), Ue(R.FEATURE_UPSELL_SLIDE.element_ai_image)) : c(Ke), setTimeout(() => ie.current?.focus({ cursor: "start" }), 100)) : h === d.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || h === d.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(fe), setTimeout(() => a.current?.focus({ cursor: "start" }), 100)) : h === d.MODALS.UPLOAD_IMAGE_MODAL_STOCK || h === d.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (_e.isLocked ? (Re(!0), Ue(R.FEATURE_UPSELL_SLIDE.stock_photo)) : c(Fe), setTimeout(() => W.current?.focus({ cursor: "start" }), 100)) : h === d.MODALS.UPLOAD_IMAGE_MODAL_GIF || h === d.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (qe.isLocked ? (Re(!0), Ue(R.FEATURE_UPSELL_SLIDE.stock_gif)) : c(ze), setTimeout(() => y.current?.focus({ cursor: "start" }), 100)) : h === d.MODALS.UPLOAD_IMAGE_MODAL_EDIT || h === d.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (yt.isLocked ? (Re(!0), Ue(R.FEATURE_UPSELL_SLIDE.image_editor)) : c(Ae), l(ee.openSecondModal(d.MODALS.IMAGE_EDITOR_MODAL))) : V("");
1753
1755
  }, [
1754
1756
  h,
1755
1757
  l,
1756
- Ce,
1758
+ Ve.isLocked,
1759
+ _e.isLocked,
1760
+ qe.isLocked,
1761
+ yt.isLocked,
1757
1762
  v
1758
1763
  ]);
1759
- const Qe = (0, n.useCallback)(({ url: c = k || "", meta: d = Qt }) => {
1760
- b(c), A({
1764
+ const Qe = (0, n.useCallback)(({ url: c = E || "", meta: u = Zt }) => {
1765
+ b(c), I({
1761
1766
  url: c,
1762
- meta: d
1767
+ meta: u
1763
1768
  }), setTimeout(() => {
1764
1769
  ce(), ge(), ve({
1765
1770
  keywords: "",
1766
1771
  color: "",
1767
1772
  orientation: ""
1768
- }), te({ keywords: "" }), q([]), ae([]), V(""), He(""), ct(!1), L(""), w(""), T(fe);
1769
- }, 200), l(Q.closeModal()), l(Q.closeSecondModal());
1773
+ }), ne({ keywords: "" }), _([]), ae([]), V(""), We(""), ut(!1), D(""), w(""), T(fe);
1774
+ }, 200), l(ee.closeModal()), l(ee.closeSecondModal());
1770
1775
  }, [
1771
- k,
1776
+ E,
1772
1777
  ce,
1773
1778
  l,
1774
- A,
1779
+ I,
1775
1780
  ge
1776
- ]), ht = (0, n.useCallback)((c, d) => (F("auto"), j(!1), Qe({
1781
+ ]), Ct = (0, n.useCallback)((c, u) => (F("auto"), L(!1), Qe({
1777
1782
  url: c,
1778
- meta: _t
1783
+ meta: Xt
1779
1784
  }), x.success({
1780
1785
  id: "IMAGE_UPLOAD_SUCCESS",
1781
- data: d,
1786
+ data: u,
1782
1787
  title: o("The image was successfully uploaded.")
1783
1788
  }), c), [
1784
1789
  o,
@@ -1786,80 +1791,80 @@ Select the appropriate plan to fulfil more requests`),
1786
1791
  x
1787
1792
  ]);
1788
1793
  (0, n.useEffect)(() => {
1789
- const c = O || U, d = ne.canonicalImageUrlKey(c);
1790
- if (!c || !d) {
1791
- E(""), Oe.current && pe.abandonKey(Oe.current), Oe.current = "", ce(), ge();
1794
+ const c = O || U, u = te.canonicalImageUrlKey(c);
1795
+ if (!c || !u) {
1796
+ j(""), je.current && pe.abandonKey(je.current), je.current = "", ce(), ge();
1792
1797
  return;
1793
1798
  }
1794
- const R = Oe.current;
1795
- R && R !== d && (pe.abandonKey(R), ce(), ge()), Oe.current = d;
1796
- const H = new AbortController(), se = O ? 800 : 0, re = ++we.current, Ye = setTimeout(async () => {
1799
+ const k = je.current;
1800
+ k && k !== u && (pe.abandonKey(k), ce(), ge()), je.current = u;
1801
+ const H = new AbortController(), se = O ? 800 : 0, re = ++be.current, Ze = setTimeout(async () => {
1797
1802
  try {
1798
- const Se = async () => {
1799
- const de = await pe.resolve(d, H.signal, Ae);
1800
- if (re !== we.current) return;
1801
- const { width: be, height: fn } = await ne.getImageDimensionsFromBlob(de);
1802
- re === we.current && (_({
1803
- width: be,
1804
- height: fn,
1803
+ const xe = async () => {
1804
+ const de = await pe.resolve(u, H.signal, we);
1805
+ if (re !== be.current) return;
1806
+ const { width: Ce, height: gn } = await te.getImageDimensionsFromBlob(de);
1807
+ re === be.current && (q({
1808
+ width: Ce,
1809
+ height: gn,
1805
1810
  size: (de.size / 1024).toFixed(2),
1806
1811
  format: Ee(de.type)
1807
- }), ce(), Pe(de));
1812
+ }), ce(), Be(de));
1808
1813
  };
1809
- if (i) await Se();
1814
+ if (i) await xe();
1810
1815
  else {
1811
- const de = await ne.resolveDataProviderPreview(t, d);
1812
- if (de?.previewUrl && re === we.current) {
1813
- qe(de.previewUrl), ge();
1816
+ const de = await te.resolveDataProviderPreview(t, u);
1817
+ if (de?.previewUrl && re === be.current) {
1818
+ He(de.previewUrl), ge();
1814
1819
  try {
1815
- const { data: be } = await p(d);
1816
- if (re !== we.current) return;
1817
- be ? _({
1818
- width: be?.width,
1819
- height: be?.height,
1820
- size: be?.fileSize != null ? (be.fileSize / 1024).toFixed(2) : "",
1821
- format: Ee(be?.format)
1822
- }) : await Se();
1820
+ const { data: Ce } = await p(u);
1821
+ if (re !== be.current) return;
1822
+ Ce ? q({
1823
+ width: Ce?.width,
1824
+ height: Ce?.height,
1825
+ size: Ce?.fileSize != null ? (Ce.fileSize / 1024).toFixed(2) : "",
1826
+ format: Ee(Ce?.format)
1827
+ }) : await xe();
1823
1828
  } catch {
1824
- await Se();
1829
+ await xe();
1825
1830
  }
1826
- } else await Se();
1831
+ } else await xe();
1827
1832
  }
1828
- if (re !== we.current) return;
1829
- E("success"), b(c), D(572), setTimeout(() => {
1833
+ if (re !== be.current) return;
1834
+ j("success"), b(c), P(572), setTimeout(() => {
1830
1835
  let de = 0;
1831
- I.current && (de = I.current.offsetHeight + 62), F(de);
1836
+ A.current && (de = A.current.offsetHeight + 62), F(de);
1832
1837
  }, 0);
1833
- } catch (Se) {
1834
- if (Se?.name === "AbortError" || H.signal.aborted || re !== we.current) return;
1835
- ce(), ge(), E("error");
1838
+ } catch (xe) {
1839
+ if (xe?.name === "AbortError" || H.signal.aborted || re !== be.current) return;
1840
+ ce(), ge(), j("error");
1836
1841
  }
1837
1842
  }, se);
1838
1843
  return () => {
1839
- clearTimeout(Ye), H.abort();
1844
+ clearTimeout(Ze), H.abort();
1840
1845
  };
1841
1846
  }, [
1842
1847
  O,
1843
1848
  U,
1844
1849
  i,
1845
1850
  ce,
1846
- Ae,
1851
+ we,
1847
1852
  p,
1848
1853
  pe,
1849
1854
  ge,
1850
1855
  t,
1851
- Pe
1856
+ Be
1852
1857
  ]), (0, n.useEffect)(() => {
1853
- if (!k || O || U || !h) return;
1854
- const c = ne.canonicalImageUrlKey(k), d = new AbortController();
1855
- let R = !1;
1858
+ if (!E || O || U || !h) return;
1859
+ const c = te.canonicalImageUrlKey(E), u = new AbortController();
1860
+ let k = !1;
1856
1861
  const H = async () => {
1857
- const se = await pe.resolve(c, d.signal, Ae);
1858
- if (R) return;
1859
- const { width: re, height: Ye } = await ne.getImageDimensionsFromBlob(se);
1860
- R || (ce(), Pe(se), _({
1862
+ const se = await pe.resolve(c, u.signal, we);
1863
+ if (k) return;
1864
+ const { width: re, height: Ze } = await te.getImageDimensionsFromBlob(se);
1865
+ k || (ce(), Be(se), q({
1861
1866
  width: re,
1862
- height: Ye,
1867
+ height: Ze,
1863
1868
  size: (se.size / 1024).toFixed(2),
1864
1869
  format: Ee(se.type)
1865
1870
  }));
@@ -1867,13 +1872,13 @@ Select the appropriate plan to fulfil more requests`),
1867
1872
  return (async () => {
1868
1873
  try {
1869
1874
  if (!i) {
1870
- const se = await ne.resolveDataProviderPreview(t, c);
1871
- if (se?.previewUrl && !R) {
1872
- qe(se.previewUrl), ge();
1875
+ const se = await te.resolveDataProviderPreview(t, c);
1876
+ if (se?.previewUrl && !k) {
1877
+ He(se.previewUrl), ge();
1873
1878
  try {
1874
1879
  const { data: re } = await p(c);
1875
- if (R) return;
1876
- re ? _({
1880
+ if (k) return;
1881
+ re ? q({
1877
1882
  width: re?.width,
1878
1883
  height: re?.height,
1879
1884
  size: re?.fileSize != null ? (re.fileSize / 1024).toFixed(2) : "",
@@ -1887,41 +1892,41 @@ Select the appropriate plan to fulfil more requests`),
1887
1892
  }
1888
1893
  await H();
1889
1894
  } catch {
1890
- R || ce();
1895
+ k || ce();
1891
1896
  }
1892
1897
  })(), () => {
1893
- R = !0, d.abort();
1898
+ k = !0, u.abort();
1894
1899
  };
1895
1900
  }, [
1896
1901
  i,
1897
1902
  h,
1898
1903
  ce,
1899
- k,
1900
- Ae,
1904
+ E,
1905
+ we,
1901
1906
  p,
1902
1907
  pe,
1903
1908
  t,
1904
1909
  O,
1905
1910
  U,
1906
- Pe
1911
+ Be
1907
1912
  ]);
1908
- const cn = () => {
1909
- l(Q.closeModal()), setTimeout(() => {
1910
- ce(), ge(), b(""), w(""), q([]), q([]), ve({
1913
+ const fn = () => {
1914
+ l(ee.closeModal()), setTimeout(() => {
1915
+ ce(), ge(), b(""), w(""), _([]), _([]), ve({
1911
1916
  keywords: "",
1912
1917
  color: "",
1913
1918
  orientation: ""
1914
- }), te({ keywords: "" }), F("auto"), !lt && He(""), D(572), T(fe);
1919
+ }), ne({ keywords: "" }), F("auto"), !ct && We(""), P(572), T(fe);
1915
1920
  }, 200);
1916
- }, un = (c) => {
1917
- c === qt ? g.success({
1921
+ }, mn = (c) => {
1922
+ c === Yt ? g.success({
1918
1923
  mask: { closable: !0 },
1919
1924
  centered: !0,
1920
1925
  title: o("Coming soon"),
1921
1926
  content: o("The feature is under development."),
1922
1927
  okText: o("Ok. I'll be waiting"),
1923
1928
  onOk: () => {}
1924
- }) : c === Ie && k === "" ? g.warning({
1929
+ }) : c === Ae && E === "" ? g.warning({
1925
1930
  mask: { closable: !0 },
1926
1931
  centered: !0,
1927
1932
  title: o(""),
@@ -1931,69 +1936,69 @@ Select the appropriate plan to fulfil more requests`),
1931
1936
  T(fe);
1932
1937
  }
1933
1938
  }) : (setTimeout(() => {
1934
- let d = 0, R = 0;
1935
- c === fe && S.current ? (oe.keywords === "" && a.current?.focus({ cursor: "start" }), d = 300, R = 572) : c === Ie && I.current ? (d = I.current.offsetHeight + 62, R = 572) : c === ze && N.current ? (oe.keywords === "" && W.current?.focus({ cursor: "start" }), d = 130, R = 572, C.length > 0 && (R = 1060, d = "84vh")) : c === Ke && J.current ? (oe.keywords === "" && y.current?.focus({ cursor: "start" }), d = 130, R = 572, G.length > 0 && (R = 1060, d = "84vh")) : c === We && K.current && (ut === "" && Z.length === 0 ? (ie.current?.focus({ cursor: "start" }), d = 130) : d = K.current.offsetHeight + 82, R = 572), F(d), D(R);
1939
+ let u = 0, k = 0;
1940
+ c === fe && S.current ? (oe.keywords === "" && a.current?.focus({ cursor: "start" }), u = 300, k = 572) : c === Ae && A.current ? (u = A.current.offsetHeight + 62, k = 572) : c === Fe && N.current ? (oe.keywords === "" && W.current?.focus({ cursor: "start" }), u = 130, k = 572, C.length > 0 && (k = 1060, u = "84vh")) : c === ze && X.current ? (oe.keywords === "" && y.current?.focus({ cursor: "start" }), u = 130, k = 572, G.length > 0 && (k = 1060, u = "84vh")) : c === Ke && K.current && (dt === "" && Y.length === 0 ? (ie.current?.focus({ cursor: "start" }), u = 130) : u = K.current.offsetHeight + 82, k = 572), F(u), P(k);
1936
1941
  }, 0), T(c));
1937
1942
  };
1938
1943
  (0, n.useEffect)(() => {
1939
- oe.keywords === "" && (a?.current?.focus({ cursor: "start" }), q([]), setTimeout(() => {
1940
- F("auto"), D(572);
1944
+ oe.keywords === "" && (a?.current?.focus({ cursor: "start" }), _([]), setTimeout(() => {
1945
+ F("auto"), P(572);
1941
1946
  }, 0));
1942
1947
  }, [
1943
1948
  oe,
1944
- q,
1949
+ _,
1945
1950
  F,
1946
- D
1951
+ P
1947
1952
  ]);
1948
- const _e = (c) => {
1949
- const d = c.type === "image/jpeg" || c.type === "image/png" || c.type === "image/jpg" || c.type === "image/webp" || c.type === "image/gif" || c.type === "image/svg+xml";
1950
- return d || x.error({
1953
+ const Ye = (c) => {
1954
+ const u = c.type === "image/jpeg" || c.type === "image/png" || c.type === "image/jpg" || c.type === "image/webp" || c.type === "image/gif" || c.type === "image/svg+xml";
1955
+ return u || x.error({
1951
1956
  id: "IMAGE_UPLOAD_WRONG_FORMAT",
1952
1957
  data: c,
1953
1958
  title: "Upload",
1954
1959
  description: "You can only upload JPG/JPEG/PNG/WEBP/GIF/SVG file!"
1955
- }), d;
1956
- }, De = async ({ file: c }) => {
1960
+ }), u;
1961
+ }, Oe = async ({ file: c }) => {
1957
1962
  try {
1958
1963
  ye(!0);
1959
- const d = await ne.prepareImageForEditorUpload(c, s), R = await sn(d);
1960
- if (R.url) return ht(R.url, d), R.url;
1961
- if (!B.shouldFallbackToBuiltInUpload(R, {
1964
+ const u = await te.prepareImageForEditorUpload(c, s), k = await cn(u);
1965
+ if (k.url) return Ct(k.url, u), k.url;
1966
+ if (!R.shouldFallbackToBuiltInUpload(k, {
1962
1967
  isStandalone: i,
1963
1968
  targetIsOurBackend: !!e
1964
1969
  })) {
1965
- Le(d, B.toUploadImageError(R));
1970
+ Le(u, R.toUploadImageError(k));
1966
1971
  return;
1967
1972
  }
1968
- const H = await Vt(d, t);
1969
- if (H?.url) return ht(H.url, d), H.url;
1970
- Le(d, null);
1973
+ const H = await Qt(u, t);
1974
+ if (H?.url) return Ct(H.url, u), H.url;
1975
+ Le(u, null);
1971
1976
  return;
1972
- } catch (d) {
1973
- Le(c, d);
1977
+ } catch (u) {
1978
+ Le(c, u);
1974
1979
  return;
1975
1980
  } finally {
1976
1981
  ye(!1);
1977
1982
  }
1978
- }, dn = (c) => De({ file: c });
1979
- let Be = [{
1983
+ }, pn = (c) => Oe({ file: c });
1984
+ let De = [{
1980
1985
  label: o("Upload"),
1981
1986
  key: fe,
1982
1987
  children: (0, r.jsxs)("div", {
1983
1988
  ref: S,
1984
1989
  style: { paddingBottom: 24 },
1985
- children: [s.imageCenterLocalUploadEnabled !== !1 && (0, r.jsxs)(Yt, {
1990
+ children: [s.imageCenterLocalUploadEnabled !== !1 && (0, r.jsxs)(Jt, {
1986
1991
  showUploadList: !1,
1987
1992
  name: "Image",
1988
- beforeUpload: _e,
1989
- customRequest: De,
1993
+ beforeUpload: Ye,
1994
+ customRequest: Oe,
1990
1995
  style: { marginBottom: 10 },
1991
1996
  multiple: !1,
1992
1997
  accept: "image/png, image/jpeg, image/jpg, image/webp, image/gif, image/svg+xml",
1993
1998
  children: [
1994
1999
  (0, r.jsx)("p", {
1995
2000
  className: "ant-upload-drag-icon",
1996
- children: (0, r.jsx)(B.EmIcons, { icon: "InboxOutlined" })
2001
+ children: (0, r.jsx)(R.EmIcons, { icon: "InboxOutlined" })
1997
2002
  }),
1998
2003
  (0, r.jsx)("p", {
1999
2004
  className: "ant-upload-text",
@@ -2007,93 +2012,93 @@ Select the appropriate plan to fulfil more requests`),
2007
2012
  }), (0, r.jsx)(f.Form, {
2008
2013
  style: { padding: "0 2px 0 2px" },
2009
2014
  children: (0, r.jsx)(f.Form.Item, {
2010
- validateStatus: Y,
2015
+ validateStatus: Q,
2011
2016
  children: (0, r.jsx)(f.Input, {
2012
2017
  ref: a,
2013
2018
  allowClear: !0,
2014
2019
  size: "large",
2015
2020
  placeholder: o("Paste image URL here"),
2016
2021
  value: O,
2017
- onChange: an,
2022
+ onChange: ln,
2018
2023
  spellCheck: "false"
2019
2024
  })
2020
2025
  })
2021
2026
  })]
2022
2027
  })
2023
2028
  }];
2024
- return s.imageCenterStockEnabled && !Ce && Be.push({
2029
+ return s.imageCenterStockEnabled && !_e.isLocked && De.push({
2025
2030
  label: o("Stock"),
2026
- key: ze,
2031
+ key: Fe,
2027
2032
  children: (0, r.jsx)("div", {
2028
2033
  ref: N,
2029
2034
  style: { paddingBottom: 24 },
2030
- children: (0, r.jsx)(Mt, {
2035
+ children: (0, r.jsx)(Nt, {
2031
2036
  currentReq: oe,
2032
2037
  setCurrentReq: ve,
2033
2038
  imageStockList: C,
2034
- setImageStockList: q,
2035
- setModalWidth: D,
2039
+ setImageStockList: _,
2040
+ setModalWidth: P,
2036
2041
  setModalHeight: F,
2037
- setStockLink: L,
2042
+ setStockLink: D,
2038
2043
  setCurrentImageLink: b,
2039
2044
  inputRef: W,
2040
- customRequest: Te
2045
+ customRequest: Me
2041
2046
  })
2042
2047
  })
2043
- }), s.imageCenterGifEnabled && !Ce && Be.push({
2048
+ }), s.imageCenterGifEnabled && !qe.isLocked && De.push({
2044
2049
  label: o("GIF"),
2045
- key: Ke,
2050
+ key: ze,
2046
2051
  children: (0, r.jsx)("div", {
2047
- ref: J,
2052
+ ref: X,
2048
2053
  style: { paddingBottom: 24 },
2049
- children: (0, r.jsx)(Ft, {
2050
- currentReqGif: $,
2051
- setCurrentReqGif: te,
2054
+ children: (0, r.jsx)(Wt, {
2055
+ currentReqGif: J,
2056
+ setCurrentReqGif: ne,
2052
2057
  imageGifList: G,
2053
2058
  setImageGifList: ae,
2054
- setModalWidth: D,
2059
+ setModalWidth: P,
2055
2060
  setModalHeight: F,
2056
- setStockLink: L,
2061
+ setStockLink: D,
2057
2062
  setCurrentImageLink: b,
2058
2063
  inputRef: y,
2059
- customRequest: Te
2064
+ customRequest: Me
2060
2065
  })
2061
2066
  })
2062
- }), s.elementAIimageEnabled && !Ce && Be.push({
2067
+ }), s.elementAIimageEnabled && !Ve.isLocked && De.push({
2063
2068
  label: o("AI"),
2064
- key: We,
2069
+ key: Ke,
2065
2070
  children: (0, r.jsx)("div", {
2066
2071
  ref: K,
2067
2072
  style: { paddingBottom: 24 },
2068
- children: (0, r.jsx)(Gt, {
2073
+ children: (0, r.jsx)(Kt, {
2069
2074
  setModalHeight: F,
2070
- customRequest: De,
2071
- aiImageRequest: ut,
2072
- setAiImageRequest: He,
2073
- imageAiList: Z,
2075
+ customRequest: Oe,
2076
+ aiImageRequest: dt,
2077
+ setAiImageRequest: We,
2078
+ imageAiList: Y,
2074
2079
  setImageAiList: me,
2075
- isLoadingAi: lt,
2076
- setIsLoadingAi: ct,
2080
+ isLoadingAi: ct,
2081
+ setIsLoadingAi: ut,
2077
2082
  aiTabRef: K,
2078
2083
  inputAiRef: ie,
2079
2084
  isImageUploaded: z,
2080
- setIsImageUploaded: j
2085
+ setIsImageUploaded: L
2081
2086
  })
2082
2087
  })
2083
- }), s.imageCenterEditorEnabled && Be.push({
2088
+ }), s.imageCenterEditorEnabled && De.push({
2084
2089
  label: "",
2085
- key: Ie,
2090
+ key: Ae,
2086
2091
  children: (0, r.jsx)("div", {
2087
- ref: I,
2088
- children: (0, r.jsx)(Et, {
2089
- currentImageLink: k,
2092
+ ref: A,
2093
+ children: (0, r.jsx)(Ot, {
2094
+ currentImageLink: E,
2090
2095
  newLink: O,
2091
- previewDisplayUrl: rn,
2092
- resolvedPreviewObjectUrl: tn,
2093
- resolvedPreviewBlob: nn,
2094
- resolveImageBlob: on,
2095
- imageSize: X,
2096
- onSave: dn,
2096
+ previewDisplayUrl: on,
2097
+ resolvedPreviewObjectUrl: an,
2098
+ resolvedPreviewBlob: sn,
2099
+ resolveImageBlob: un,
2100
+ imageSize: Z,
2101
+ onSave: pn,
2097
2102
  uploadImageResultIsLoading: he || !1
2098
2103
  })
2099
2104
  })
@@ -2102,28 +2107,28 @@ Select the appropriate plan to fulfil more requests`),
2102
2107
  className: "image-center",
2103
2108
  title: o("Image Center"),
2104
2109
  style: { minHeight: 390 },
2105
- open: !!M,
2110
+ open: !!B,
2106
2111
  onOk: Qe,
2107
- onCancel: cn,
2108
- footer: P === Ie ? (0, r.jsx)(r.Fragment, {}) : null,
2112
+ onCancel: fn,
2113
+ footer: M === Ae ? (0, r.jsx)(r.Fragment, {}) : null,
2109
2114
  children: (0, r.jsx)(f.Spin, {
2110
2115
  spinning: he,
2111
2116
  children: (0, r.jsx)(f.Tabs, {
2112
- activeKey: P,
2113
- onChange: un,
2114
- items: Be,
2117
+ activeKey: M,
2118
+ onChange: mn,
2119
+ items: De,
2115
2120
  className: "modal-tabs",
2116
2121
  style: {
2117
- height: ee,
2122
+ height: $,
2118
2123
  minHeight: 130
2119
2124
  }
2120
2125
  })
2121
2126
  })
2122
- }), (0, r.jsx)(B.PlanUpgradePrompt, {
2123
- open: $t,
2124
- onCancel: () => je(!1),
2125
- initialSlide: en
2127
+ }), (0, r.jsx)(R.PlanUpgradePrompt, {
2128
+ open: nn,
2129
+ onCancel: () => Re(!1),
2130
+ initialSlide: rn
2126
2131
  })] });
2127
2132
  };
2128
- it.propTypes = { dataProvider: Ct.default.object }, yt.default = it;
2133
+ lt.propTypes = { dataProvider: At.default.object }, bt.default = lt;
2129
2134
  });