useblocks 1.1.45 → 1.1.46

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 (33) hide show
  1. package/iframe/js/amp.CVC2Iq48.js +1 -1
  2. package/iframe/js/iframe-eblock.js +1 -1
  3. package/iframe/js/iframe.js +1 -1
  4. package/iframe/js/rules.4N5s3OV-.js +1 -1
  5. package/npm-publish.manifest.json +7 -7
  6. package/package.json +1 -1
  7. package/singlepage_headless_plugin.html +1 -1
  8. package/static/core/{5e0828e3.js → 350eac23.js} +3 -3
  9. package/static/core/{2f2019c1.js → 35e13192.js} +253 -239
  10. package/static/core/{bc098620.js → 4a2af478.js} +3 -3
  11. package/static/core/{ed0ecf0a.js → 4eb628d3.js} +5 -5
  12. package/static/core/{d14cb6e2.js → 526b23c2.js} +7 -7
  13. package/static/core/{48b80eec.js → 6b8432a3.js} +3 -3
  14. package/static/core/{b7a9d262.js → 6df04323.js} +248 -248
  15. package/static/core/{94f2c0df.js → 6e2d88d5.js} +8959 -8844
  16. package/static/core/{6450546e2.js → 90ec6d2b2.js} +7 -7
  17. package/static/core/{632d894f.js → 9421a704.js} +3 -3
  18. package/static/core/{fd4fa049.js → 9c1c1b89.js} +4 -4
  19. package/static/core/{ff830d19.js → 9c79239d.js} +899 -882
  20. package/static/core/{7d884291.js → a321a57d.js} +32 -32
  21. package/static/core/{8c84cc76.js → b8b730b2.js} +15 -15
  22. package/static/core/{af153381.js → b9529b8a.js} +6405 -6131
  23. package/static/core/{cb72ea5e.js → cc8f145d.js} +86 -86
  24. package/static/core/{bb774fb9.js → cefd6620.js} +636 -603
  25. package/static/core/df0652cc.js +1119 -0
  26. package/two_step_headless_plugin.html +1 -1
  27. package/{useblocks-core.ecd1a3b0.js → useblocks-core.2116f1b9.js} +6 -6
  28. package/useblocks-esm.js +5 -4
  29. package/useblocks.d.ts +6 -0
  30. package/useblocks.js +5 -4
  31. package/static/core/c28bc42e.js +0 -46
  32. /package/iframe/{iframe-eblock.ecd1a3b0.html → iframe-eblock.2116f1b9.html} +0 -0
  33. /package/iframe/{iframe.ecd1a3b0.html → iframe.2116f1b9.html} +0 -0
@@ -1,28 +1,28 @@
1
1
  (function(){try{if(typeof document<"u"){var o=document.createElement("style");o.setAttribute("data-useblocks","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(--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(--colorPrimary);border-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary:hover{background:var(--colorPrimaryHover);border-color:var(--colorPrimaryHover)}.blocks-app .image-editor-modal .pi .text-on-primary.rounded-full{border-radius:calc(var(--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(--colorPrimary)}.blocks-app .image-editor-modal .pi .bg-white\\/50{background-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary{color:var(--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(--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(--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(--borderWidth) * 1px);border-color:var(--colorFillSecondaryDarken);border-radius:calc(var(--borderRadius) * 1px);width:100%;padding-left:0;display:inline-flex}.blocks-app .image-ai .image-ai__input-affix-wrapper:hover{border-color:var(--borderColorHover)}.blocks-app .image-ai .image-ai__input-affix-wrapper.ant-input-affix-wrapper-focused{border-color:var(--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(--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(--colorBorderSecondary);background:linear-gradient(180deg, var(--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(--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(--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(--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
- __useblocks__.define("static/core/ff830d19.js", [
2
+ __useblocks__.define("static/core/9c79239d.js", [
3
3
  "require",
4
4
  "exports",
5
5
  "module",
6
6
  "static/core/bd36b180.js",
7
- "static/core/bb774fb9.js",
8
- "static/core/632d894f.js",
9
- "static/core/5e0828e3.js",
10
- "static/core/94f2c0df.js",
11
- "static/core/6450546e2.js",
12
- "static/core/b7a9d262.js",
7
+ "static/core/cefd6620.js",
8
+ "static/core/9421a704.js",
9
+ "static/core/350eac23.js",
10
+ "static/core/6e2d88d5.js",
11
+ "static/core/90ec6d2b2.js",
12
+ "static/core/6df04323.js",
13
13
  "react",
14
14
  "prop-types",
15
15
  "react-router-dom",
16
16
  "react/jsx-runtime"
17
- ], function(ee, bt, an) {
18
- const nt = ee("./bd36b180.js"), d = ee("./bb774fb9.js"), z = ee("./632d894f.js"), u = ee("./5e0828e3.js"), Ct = ee("./94f2c0df.js"), B = ee("./6450546e2.js"), q = ee("./b7a9d262.js");
17
+ ], function(ee, wt, ur) {
18
+ const Ze = ee("./bd36b180.js"), f = ee("./cefd6620.js"), H = ee("./9421a704.js"), d = ee("./350eac23.js"), bt = ee("./6e2d88d5.js"), U = ee("./90ec6d2b2.js"), q = ee("./6df04323.js");
19
19
  let o = ee("react");
20
- o = nt.__toESM(o);
21
- let Fe = ee("prop-types");
22
- Fe = nt.__toESM(Fe);
23
- let Ge = ee("react-router-dom"), s = ee("react/jsx-runtime");
24
- function wt(n, e) {
25
- return { [n]: {
20
+ o = Ze.__toESM(o);
21
+ let Be = ee("prop-types");
22
+ Be = Ze.__toESM(Be);
23
+ let Me = ee("react-router-dom"), s = ee("react/jsx-runtime");
24
+ function At(r, e) {
25
+ return { [r]: {
26
26
  Filter: e("Filter"),
27
27
  filter: e("filter"),
28
28
  Resize: e("Resize"),
@@ -107,7 +107,18 @@ __useblocks__.define("static/core/ff830d19.js", [
107
107
  square: e("square")
108
108
  } };
109
109
  }
110
- var At = "static/media/image-editor", St = { text: {
110
+ function Xe(r, e = "application/octet-stream") {
111
+ let n = r.trim(), t = e?.trim() || "application/octet-stream";
112
+ const i = n.indexOf(",");
113
+ if (n.startsWith("data:") && i >= 0) {
114
+ const p = n.slice(5, i).split(";")[0]?.trim();
115
+ p && (t = p), n = n.slice(i + 1);
116
+ }
117
+ const l = n.replace(/\s/g, ""), h = atob(l), C = new Uint8Array(h.length);
118
+ for (let p = 0; p < h.length; p++) C[p] = h.charCodeAt(p);
119
+ return new Blob([C], { type: t });
120
+ }
121
+ var St = "static/media/image-editor", It = { text: {
111
122
  replaceDefaultItems: !0,
112
123
  defaultText: "Handwriting",
113
124
  items: [
@@ -224,84 +235,83 @@ __useblocks__.define("static/core/ff830d19.js", [
224
235
  src: "fonts/caveat-v23-cyrillic_latin-regular.woff2"
225
236
  }
226
237
  ]
227
- } }, It = (n, e = "application/octet-stream") => fetch(`data:${e};base64,${n}`).then((r) => r.blob());
228
- function xt(n, e) {
229
- if (n === "json") return new Blob([e], { type: "application/json" });
230
- if (n === "svg") return new Blob([e], { type: "image/svg+xml" });
231
- const r = `image/${n}`;
232
- return e = e.replace(/data:image\/([a-z]*)?;base64,/, ""), It(e, r);
238
+ } };
239
+ function xt(r, e) {
240
+ if (r === "json") return new Blob([e], { type: "application/json" });
241
+ if (r === "svg") return new Blob([e], { type: "image/svg+xml" });
242
+ const n = `image/${r}`;
243
+ return Xe(e.replace(/data:image\/([a-z]*)?;base64,/, ""), n);
233
244
  }
234
- var jt = ({ currentImageLink: n, prefetchedBlobUrl: e, newLink: r, onSave: t, uploadImageResultIsLoading: i }) => {
235
- const l = q.useCookieManager(), [h, C] = (0, o.useState)(), [g, S] = (0, o.useState)(), { __: I } = u.useI18n();
236
- let p = d.useDispatch();
237
- const b = d.useStore(), j = d.useAppConfig(), y = d.useSelector(d.selectedCurrentUser), M = d.useSelector(z.selectSecondModal), v = d.useSelector(d.selectProject), k = (0, o.useMemo)(() => {
238
- if (!j?.icons) return;
239
- const E = {};
240
- for (const [L, O] of Object.entries(j.icons)) typeof O == "string" && (E[L] = B.sanitizeHtml(O));
241
- return Object.keys(E).length > 0 ? E : void 0;
242
- }, [j?.icons]), R = (0, o.useRef)(!1), [T, H] = (0, o.useState)(), U = d.useEventEmitter(d.events.FILE_PROXY_EVENT_ID);
245
+ var jt = ({ currentImageLink: r, prefetchedBlob: e, onSave: n, uploadImageResultIsLoading: t }) => {
246
+ const i = q.useCookieManager(), [l, h] = (0, o.useState)(), [C, p] = (0, o.useState)(), { __: b } = d.useI18n();
247
+ let j = f.useDispatch();
248
+ const m = f.useStore(), v = f.useAppConfig(), A = f.useSelector(f.selectedCurrentUser), w = f.useSelector(H.selectSecondModal), T = f.useSelector(f.selectProject), g = (0, o.useMemo)(() => {
249
+ if (!v?.icons) return;
250
+ const O = {};
251
+ for (const [M, R] of Object.entries(v.icons)) typeof R == "string" && (O[M] = U.sanitizeHtml(R));
252
+ return Object.keys(O).length > 0 ? O : void 0;
253
+ }, [v?.icons]), L = (0, o.useRef)(!1), [E, F] = (0, o.useState)(), K = f.useEventEmitter(f.events.FILE_PROXY_EVENT_ID);
243
254
  (0, o.useEffect)(() => {
244
- (async () => {
245
- const L = n;
246
- if (!L && !e) return;
247
- let O;
248
- if (e) try {
249
- const x = await fetch(e);
250
- x.ok && (O = await x.blob());
251
- } catch {
252
- O = void 0;
253
- }
254
- if (!O && L) try {
255
- O = await (await fetch(L)).blob();
255
+ let O = !1;
256
+ return (async () => {
257
+ const R = r;
258
+ if (!R && !e) return;
259
+ let S = e;
260
+ if (!S && R) try {
261
+ S = await (await fetch(R)).blob();
256
262
  } catch {
257
- if (O = await U.fire({
258
- url: L,
259
- project: v
260
- }).filter((x) => x instanceof Blob)[0], !O) {
261
- const x = l.get(d.APP_COOKIES.em_token) || await d.di.getInstance(b, z.TOKEN_ID);
262
- O = await (await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(L)}`, { headers: { authorization: `Bearer ${x}` } })).blob();
263
+ if (S = await K.fire({
264
+ url: R,
265
+ project: T
266
+ }).filter((D) => D instanceof Blob)[0], !S) {
267
+ const D = i.get(f.APP_COOKIES.em_token) || await f.di.getInstance(m, H.TOKEN_ID);
268
+ S = await (await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(R)}`, { headers: { authorization: `Bearer ${D}` } })).blob();
263
269
  }
264
270
  }
265
- if (O) {
266
- let x = new FileReader();
267
- x.onload = () => {
268
- T?.tools.import.openBackgroundImage(h), x.result !== h && (C(x.result), S(O.type));
269
- }, x.readAsDataURL(O);
270
- }
271
- })().catch((L) => {});
271
+ if (O || !S) return;
272
+ const z = new FileReader();
273
+ z.onload = () => {
274
+ if (O) return;
275
+ const D = z.result;
276
+ typeof D == "string" && (h(D), p(S.type), E?.tools.import.openBackgroundImage(D));
277
+ }, z.onerror = () => {}, z.readAsDataURL(S);
278
+ })().catch((R) => {}), () => {
279
+ O = !0;
280
+ };
272
281
  }, [
273
- n,
274
- e,
275
282
  r,
276
- C,
277
- l,
278
- h,
283
+ e,
284
+ i,
285
+ E,
286
+ K,
279
287
  T,
280
- U,
281
- v,
282
- b
288
+ m
283
289
  ]);
284
- const D = (0, o.useCallback)(() => {
285
- C(null), S(null), p(z.closeSecondModal()), p(z.closeModal(d.MODALS.UPLOAD_IMAGE_MODAL));
286
- }, [p]), F = (0, o.useRef)();
287
- F.current = async function(E, L, O) {
288
- const x = await xt(O, E);
289
- t && t(new File([x], L, {
290
- lastModified: new Date().getTime(),
291
- type: x.type
292
- }));
290
+ const k = (0, o.useCallback)(() => {
291
+ h(null), p(null), j(H.closeSecondModal()), j(H.closeModal(f.MODALS.UPLOAD_IMAGE_MODAL));
292
+ }, [j]), B = (0, o.useRef)();
293
+ B.current = async function(O, M, R) {
294
+ try {
295
+ const S = xt(R, O);
296
+ n && await n(new File([S], M, {
297
+ lastModified: Date.now(),
298
+ type: S.type
299
+ }));
300
+ } catch (S) {
301
+ throw S;
302
+ }
293
303
  };
294
- const Z = (0, o.useCallback)((E) => {
295
- if (E && !(R.current && T)) {
296
- R.current = !0;
297
- const L = y.locale ? y.locale.replace("_", "-") : "en-US", O = y.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? d.DARK : d.LIGHT : y.theme;
298
- Ct.Tf.init({
304
+ const G = (0, o.useCallback)((O) => {
305
+ if (O && !(L.current && E)) {
306
+ L.current = !0;
307
+ const M = A.locale ? A.locale.replace("_", "-") : "en-US", R = A.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? f.DARK : f.LIGHT : A.theme;
308
+ bt.Tf.init({
299
309
  selector: "#pixie-editor",
300
- baseUrl: u.getBundledHostAssetUrl(At),
301
- image: h,
302
- activeLanguage: L,
303
- languages: wt(L, I),
304
- tools: St,
310
+ baseUrl: d.getBundledHostAssetUrl(St),
311
+ image: l,
312
+ activeLanguage: M,
313
+ languages: At(M, b),
314
+ tools: It,
305
315
  ui: {
306
316
  menubar: {
307
317
  replaceDefaultItems: !0,
@@ -317,60 +327,62 @@ __useblocks__.define("static/core/ff830d19.js", [
317
327
  },
318
328
  {
319
329
  type: "button",
320
- icon: (0, s.jsx)(u.EmIcons, {
330
+ icon: (0, s.jsx)(d.EmIcons, {
321
331
  icon: "HistoryOutlined",
322
- configIcons: k,
332
+ configIcons: g,
323
333
  style: { fontSize: 20 }
324
334
  }),
325
335
  align: "right",
326
336
  desktopOnly: !0,
327
- action: (x) => {
328
- x.togglePanel("history");
337
+ action: (S) => {
338
+ S.togglePanel("history");
329
339
  }
330
340
  },
331
341
  {
332
342
  type: "button",
333
- icon: (0, s.jsx)(u.EmIcons, {
343
+ icon: (0, s.jsx)(d.EmIcons, {
334
344
  icon: "CloseOutlined",
335
- configIcons: k,
345
+ configIcons: g,
336
346
  style: { fontSize: 20 }
337
347
  }),
338
348
  align: "right",
339
349
  desktopOnly: !0,
340
- action: () => D()
350
+ action: () => k()
341
351
  }
342
352
  ]
343
353
  },
344
354
  nav: { position: "top" },
345
- activeTheme: O,
355
+ activeTheme: R,
346
356
  mode: "inline",
347
357
  forceOverlayModeOnMobile: !1
348
358
  },
349
- onSave: async function(x, Y, W) {
350
- F.current(x, Y, W);
359
+ onSave: async function(S, z, D) {
360
+ try {
361
+ await B.current(S, z, D);
362
+ } catch {}
351
363
  }
352
- }).then((x) => {
353
- H(x);
354
- }).catch((x) => {});
364
+ }).then((S) => {
365
+ F(S);
366
+ }).catch((S) => {});
355
367
  }
356
368
  }, [
357
- y.theme,
358
- h,
359
- T,
360
- H,
361
- y.locale,
362
- I,
363
- D,
364
- k
365
- ]), G = (0, o.useCallback)(() => {
366
- T?.tools.export.save(n?.split("/").pop().split(".")[0], g?.split("/")[1]);
367
- }, [
368
- T,
369
- n,
369
+ A.theme,
370
+ l,
371
+ E,
372
+ F,
373
+ A.locale,
374
+ b,
375
+ k,
370
376
  g
377
+ ]), Z = (0, o.useCallback)(() => {
378
+ E?.tools.export.save(r?.split("/").pop().split(".")[0], C?.split("/")[1]);
379
+ }, [
380
+ E,
381
+ r,
382
+ C
371
383
  ]);
372
- return (0, s.jsxs)(u.Modal, {
373
- afterOpenChange: Z,
384
+ return (0, s.jsxs)(d.Modal, {
385
+ afterOpenChange: G,
374
386
  width: "100%",
375
387
  style: {
376
388
  maxWidth: "100%",
@@ -381,19 +393,19 @@ __useblocks__.define("static/core/ff830d19.js", [
381
393
  closable: !1,
382
394
  zIndex: 1100,
383
395
  mask: !1,
384
- open: M,
385
- footer: [(0, s.jsx)(u.Button, {
396
+ open: w,
397
+ footer: [(0, s.jsx)(d.Button, {
386
398
  className: "em-analytics__profile-cancel",
387
- onClick: D,
388
- children: I("Cancel")
389
- }, "Cancel"), (0, s.jsx)(u.Button, {
399
+ onClick: k,
400
+ children: b("Cancel")
401
+ }, "Cancel"), (0, s.jsx)(d.Button, {
390
402
  className: "em-analytics__profile-updapixiete",
391
403
  id: "save",
392
404
  type: "primary",
393
- onClick: G,
394
- children: I("Update")
405
+ onClick: Z,
406
+ children: b("Update")
395
407
  }, "Ok")],
396
- children: [i && (0, s.jsx)("div", {
408
+ children: [t && (0, s.jsx)("div", {
397
409
  style: {
398
410
  position: "absolute",
399
411
  height: "100%",
@@ -405,14 +417,14 @@ __useblocks__.define("static/core/ff830d19.js", [
405
417
  zIndex: 10,
406
418
  opacity: .7
407
419
  },
408
- children: (0, s.jsx)(u.Spin, { size: "large" })
420
+ children: (0, s.jsx)(d.Spin, { size: "large" })
409
421
  }), (0, s.jsx)("div", { id: "pixie-editor" })]
410
422
  });
411
- }, Ot = ({ currentImageLink: n, newLink: e, previewDisplayUrl: r, resolvedPreviewObjectUrl: t, onSave: i, uploadImageResultIsLoading: l }) => {
412
- const h = r || t;
423
+ }, Et = ({ currentImageLink: r, newLink: e, previewDisplayUrl: n, resolvedPreviewObjectUrl: t, resolvedPreviewBlob: i, onSave: l, uploadImageResultIsLoading: h }) => {
424
+ const C = n || t;
413
425
  return (0, s.jsxs)(s.Fragment, { children: [(0, s.jsx)("div", { children: (0, s.jsxs)("div", {
414
426
  className: "image-preview",
415
- children: [l && (0, s.jsx)("div", {
427
+ children: [h && (0, s.jsx)("div", {
416
428
  style: {
417
429
  position: "absolute",
418
430
  height: "100%",
@@ -424,86 +436,86 @@ __useblocks__.define("static/core/ff830d19.js", [
424
436
  zIndex: 10,
425
437
  opacity: .7
426
438
  },
427
- children: (0, s.jsx)(u.Spin, { size: "large" })
428
- }), h && (0, s.jsx)("img", {
439
+ children: (0, s.jsx)(d.Spin, { size: "large" })
440
+ }), C && (0, s.jsx)("img", {
429
441
  alt: "uploadedImage",
430
- src: h
442
+ src: C
431
443
  })]
432
444
  }) }), (0, s.jsx)(jt, {
433
- currentImageLink: n,
434
- prefetchedBlobUrl: t,
445
+ currentImageLink: r,
446
+ prefetchedBlob: i,
435
447
  newLink: e,
436
- onSave: i,
437
- uploadImageResultIsLoading: l
448
+ onSave: l,
449
+ uploadImageResultIsLoading: h
438
450
  })] });
439
- }, ze = function(n, e) {
440
- return ze = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, t) {
441
- r.__proto__ = t;
442
- } || function(r, t) {
443
- for (var i in t) t.hasOwnProperty(i) && (r[i] = t[i]);
444
- }, ze(n, e);
451
+ }, Ue = function(r, e) {
452
+ return Ue = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, t) {
453
+ n.__proto__ = t;
454
+ } || function(n, t) {
455
+ for (var i in t) t.hasOwnProperty(i) && (n[i] = t[i]);
456
+ }, Ue(r, e);
445
457
  };
446
- function Lt(n, e) {
447
- ze(n, e);
448
- function r() {
449
- this.constructor = n;
458
+ function Ot(r, e) {
459
+ Ue(r, e);
460
+ function n() {
461
+ this.constructor = r;
450
462
  }
451
- n.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
463
+ r.prototype = e === null ? Object.create(e) : (n.prototype = e.prototype, new n());
452
464
  }
453
- var we = function() {
454
- return we = Object.assign || function(e) {
455
- for (var r, t = 1, i = arguments.length; t < i; t++) {
456
- r = arguments[t];
457
- for (var l in r) Object.prototype.hasOwnProperty.call(r, l) && (e[l] = r[l]);
465
+ var Ce = function() {
466
+ return Ce = Object.assign || function(e) {
467
+ for (var n, t = 1, i = arguments.length; t < i; t++) {
468
+ n = arguments[t];
469
+ for (var l in n) Object.prototype.hasOwnProperty.call(n, l) && (e[l] = n[l]);
458
470
  }
459
471
  return e;
460
- }, we.apply(this, arguments);
472
+ }, Ce.apply(this, arguments);
461
473
  };
462
- function Rt(n, e, r, t) {
474
+ function Rt(r, e, n, t) {
463
475
  var i, l = !1, h = 0;
464
476
  function C() {
465
477
  i && clearTimeout(i);
466
478
  }
467
- function g() {
479
+ function p() {
468
480
  C(), l = !0;
469
481
  }
470
- typeof e != "boolean" && (t = r, r = e, e = void 0);
471
- function S() {
472
- var I = this, p = Date.now() - h, b = arguments;
482
+ typeof e != "boolean" && (t = n, n = e, e = void 0);
483
+ function b() {
484
+ var j = this, m = Date.now() - h, v = arguments;
473
485
  if (l) return;
474
- function j() {
475
- h = Date.now(), r.apply(I, b);
486
+ function A() {
487
+ h = Date.now(), n.apply(j, v);
476
488
  }
477
- function y() {
489
+ function w() {
478
490
  i = void 0;
479
491
  }
480
- t && !i && j(), C(), t === void 0 && p > n ? j() : e !== !0 && (i = setTimeout(t ? y : j, t === void 0 ? n - p : n));
492
+ t && !i && A(), C(), t === void 0 && m > r ? A() : e !== !0 && (i = setTimeout(t ? w : A, t === void 0 ? r - m : r));
481
493
  }
482
- return S.cancel = g, S;
494
+ return b.cancel = p, b;
483
495
  }
484
- var ye = {
496
+ var pe = {
485
497
  Pixel: "Pixel",
486
498
  Percent: "Percent"
487
- }, rt = {
488
- unit: ye.Percent,
499
+ }, Je = {
500
+ unit: pe.Percent,
489
501
  value: .8
490
502
  };
491
- function st(n) {
492
- return typeof n == "number" ? {
493
- unit: ye.Percent,
494
- value: n * 100
495
- } : typeof n == "string" ? n.match(/^(\d*(\.\d+)?)px$/) ? {
496
- unit: ye.Pixel,
497
- value: parseFloat(n)
498
- } : n.match(/^(\d*(\.\d+)?)%$/) ? {
499
- unit: ye.Percent,
500
- value: parseFloat(n)
501
- } : rt : rt;
503
+ function $e(r) {
504
+ return typeof r == "number" ? {
505
+ unit: pe.Percent,
506
+ value: r * 100
507
+ } : typeof r == "string" ? r.match(/^(\d*(\.\d+)?)px$/) ? {
508
+ unit: pe.Pixel,
509
+ value: parseFloat(r)
510
+ } : r.match(/^(\d*(\.\d+)?)%$/) ? {
511
+ unit: pe.Percent,
512
+ value: parseFloat(r)
513
+ } : Je : Je;
502
514
  }
503
- var ot = (function(n) {
504
- Lt(e, n);
505
- function e(r) {
506
- var t = n.call(this, r) || this;
515
+ var et = (function(r) {
516
+ Ot(e, r);
517
+ function e(n) {
518
+ var t = r.call(this, n) || this;
507
519
  return t.lastScrollTop = 0, t.actionTriggered = !1, t.startY = 0, t.currentY = 0, t.dragging = !1, t.maxPullDownDistance = 0, t.getScrollableTarget = function() {
508
520
  return t.props.scrollableTarget instanceof HTMLElement ? t.props.scrollableTarget : typeof t.props.scrollableTarget == "string" ? document.getElementById(t.props.scrollableTarget) : (t.props.scrollableTarget, null);
509
521
  }, t.onStart = function(i) {
@@ -523,7 +535,7 @@ __useblocks__.define("static/core/ff830d19.js", [
523
535
  }, t.state = {
524
536
  showLoader: !1,
525
537
  pullToRefreshThresholdBreached: !1,
526
- prevDataLength: r.dataLength
538
+ prevDataLength: n.dataLength
527
539
  }, t.throttledOnScrollListener = Rt(150, t.onScrollListener).bind(t), t.onStart = t.onStart.bind(t), t.onMove = t.onMove.bind(t), t.onEnd = t.onEnd.bind(t), t;
528
540
  }
529
541
  return e.prototype.componentDidMount = function() {
@@ -533,20 +545,20 @@ __useblocks__.define("static/core/ff830d19.js", [
533
545
  as expected. Check README.md for usage'`);
534
546
  }, e.prototype.componentWillUnmount = function() {
535
547
  this.el && (this.el.removeEventListener("scroll", this.throttledOnScrollListener), this.props.pullDownToRefresh && (this.el.removeEventListener("touchstart", this.onStart), this.el.removeEventListener("touchmove", this.onMove), this.el.removeEventListener("touchend", this.onEnd), this.el.removeEventListener("mousedown", this.onStart), this.el.removeEventListener("mousemove", this.onMove), this.el.removeEventListener("mouseup", this.onEnd)));
536
- }, e.prototype.componentDidUpdate = function(r) {
537
- this.props.dataLength !== r.dataLength && (this.actionTriggered = !1, this.setState({ showLoader: !1 }));
538
- }, e.getDerivedStateFromProps = function(r, t) {
539
- return r.dataLength !== t.prevDataLength ? we(we({}, t), { prevDataLength: r.dataLength }) : null;
540
- }, e.prototype.isElementAtTop = function(r, t) {
548
+ }, e.prototype.componentDidUpdate = function(n) {
549
+ this.props.dataLength !== n.dataLength && (this.actionTriggered = !1, this.setState({ showLoader: !1 }));
550
+ }, e.getDerivedStateFromProps = function(n, t) {
551
+ return n.dataLength !== t.prevDataLength ? Ce(Ce({}, t), { prevDataLength: n.dataLength }) : null;
552
+ }, e.prototype.isElementAtTop = function(n, t) {
541
553
  t === void 0 && (t = .8);
542
- var i = r === document.body || r === document.documentElement ? window.screen.availHeight : r.clientHeight, l = st(t);
543
- return l.unit === ye.Pixel ? r.scrollTop <= l.value + i - r.scrollHeight + 1 : r.scrollTop <= l.value / 100 + i - r.scrollHeight + 1;
544
- }, e.prototype.isElementAtBottom = function(r, t) {
554
+ var i = n === document.body || n === document.documentElement ? window.screen.availHeight : n.clientHeight, l = $e(t);
555
+ return l.unit === pe.Pixel ? n.scrollTop <= l.value + i - n.scrollHeight + 1 : n.scrollTop <= l.value / 100 + i - n.scrollHeight + 1;
556
+ }, e.prototype.isElementAtBottom = function(n, t) {
545
557
  t === void 0 && (t = .8);
546
- var i = r === document.body || r === document.documentElement ? window.screen.availHeight : r.clientHeight, l = st(t);
547
- return l.unit === ye.Pixel ? r.scrollTop + i >= r.scrollHeight - l.value : r.scrollTop + i >= l.value / 100 * r.scrollHeight;
558
+ var i = n === document.body || n === document.documentElement ? window.screen.availHeight : n.clientHeight, l = $e(t);
559
+ return l.unit === pe.Pixel ? n.scrollTop + i >= n.scrollHeight - l.value : n.scrollTop + i >= l.value / 100 * n.scrollHeight;
548
560
  }, e.prototype.render = function() {
549
- var r = this, t = we({
561
+ var n = this, t = Ce({
550
562
  height: this.props.height || "auto",
551
563
  overflow: "auto",
552
564
  WebkitOverflowScrolling: "touch"
@@ -557,13 +569,13 @@ __useblocks__.define("static/core/ff830d19.js", [
557
569
  }, o.default.createElement("div", {
558
570
  className: "infinite-scroll-component " + (this.props.className || ""),
559
571
  ref: function(h) {
560
- return r._infScroll = h;
572
+ return n._infScroll = h;
561
573
  },
562
574
  style: t
563
575
  }, this.props.pullDownToRefresh && o.default.createElement("div", {
564
576
  style: { position: "relative" },
565
577
  ref: function(h) {
566
- return r._pullDown = h;
578
+ return n._pullDown = h;
567
579
  }
568
580
  }, o.default.createElement("div", { style: {
569
581
  position: "absolute",
@@ -573,58 +585,58 @@ __useblocks__.define("static/core/ff830d19.js", [
573
585
  } }, this.state.pullToRefreshThresholdBreached ? this.props.releaseToRefreshContent : this.props.pullDownToRefreshContent)), this.props.children, !this.state.showLoader && !i && this.props.hasMore && this.props.loader, this.state.showLoader && this.props.hasMore && this.props.loader, !this.props.hasMore && this.props.endMessage));
574
586
  }, e;
575
587
  })(o.Component);
576
- function kt(n, e) {
577
- if (n == null) return {};
578
- var r = Dt(n, e), t, i;
588
+ function Lt(r, e) {
589
+ if (r == null) return {};
590
+ var n = kt(r, e), t, i;
579
591
  if (Object.getOwnPropertySymbols) {
580
- var l = Object.getOwnPropertySymbols(n);
581
- for (i = 0; i < l.length; i++) t = l[i], !(e.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(n, t) && (r[t] = n[t]);
592
+ var l = Object.getOwnPropertySymbols(r);
593
+ for (i = 0; i < l.length; i++) t = l[i], !(e.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(r, t) && (n[t] = r[t]);
582
594
  }
583
- return r;
595
+ return n;
584
596
  }
585
- function Dt(n, e) {
586
- if (n == null) return {};
587
- var r = {}, t = Object.keys(n), i, l;
588
- for (l = 0; l < t.length; l++) i = t[l], !(e.indexOf(i) >= 0) && (r[i] = n[i]);
589
- return r;
597
+ function kt(r, e) {
598
+ if (r == null) return {};
599
+ var n = {}, t = Object.keys(r), i, l;
600
+ for (l = 0; l < t.length; l++) i = t[l], !(e.indexOf(i) >= 0) && (n[i] = r[i]);
601
+ return n;
590
602
  }
591
- function ke() {
592
- return ke = Object.assign || function(n) {
603
+ function Oe() {
604
+ return Oe = Object.assign || function(r) {
593
605
  for (var e = 1; e < arguments.length; e++) {
594
- var r = arguments[e];
595
- for (var t in r) Object.prototype.hasOwnProperty.call(r, t) && (n[t] = r[t]);
606
+ var n = arguments[e];
607
+ for (var t in n) Object.prototype.hasOwnProperty.call(n, t) && (r[t] = n[t]);
596
608
  }
597
- return n;
598
- }, ke.apply(this, arguments);
609
+ return r;
610
+ }, Oe.apply(this, arguments);
599
611
  }
600
- function at(n, e) {
601
- var r = Object.keys(n);
612
+ function tt(r, e) {
613
+ var n = Object.keys(r);
602
614
  if (Object.getOwnPropertySymbols) {
603
- var t = Object.getOwnPropertySymbols(n);
615
+ var t = Object.getOwnPropertySymbols(r);
604
616
  e && (t = t.filter(function(i) {
605
- return Object.getOwnPropertyDescriptor(n, i).enumerable;
606
- })), r.push.apply(r, t);
617
+ return Object.getOwnPropertyDescriptor(r, i).enumerable;
618
+ })), n.push.apply(n, t);
607
619
  }
608
- return r;
620
+ return n;
609
621
  }
610
- function Ae(n) {
622
+ function we(r) {
611
623
  for (var e = 1; e < arguments.length; e++) {
612
- var r = arguments[e] != null ? arguments[e] : {};
613
- e % 2 ? at(Object(r), !0).forEach(function(t) {
614
- Et(n, t, r[t]);
615
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(r)) : at(Object(r)).forEach(function(t) {
616
- Object.defineProperty(n, t, Object.getOwnPropertyDescriptor(r, t));
624
+ var n = arguments[e] != null ? arguments[e] : {};
625
+ e % 2 ? tt(Object(n), !0).forEach(function(t) {
626
+ Dt(r, t, n[t]);
627
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(n)) : tt(Object(n)).forEach(function(t) {
628
+ Object.defineProperty(r, t, Object.getOwnPropertyDescriptor(n, t));
617
629
  });
618
630
  }
619
- return n;
631
+ return r;
620
632
  }
621
- function Et(n, e, r) {
622
- return e in n ? Object.defineProperty(n, e, {
623
- value: r,
633
+ function Dt(r, e, n) {
634
+ return e in r ? Object.defineProperty(r, e, {
635
+ value: n,
624
636
  enumerable: !0,
625
637
  configurable: !0,
626
638
  writable: !0
627
- }) : n[e] = r, n;
639
+ }) : r[e] = n, r;
628
640
  }
629
641
  var Tt = {
630
642
  breakpointCols: void 0,
@@ -633,11 +645,11 @@ __useblocks__.define("static/core/ff830d19.js", [
633
645
  children: void 0,
634
646
  columnAttrs: void 0,
635
647
  column: void 0
636
- }, He = 2, We = class extends o.default.Component {
637
- constructor(n) {
638
- super(n), this.reCalculateColumnCount = this.reCalculateColumnCount.bind(this), this.reCalculateColumnCountDebounce = this.reCalculateColumnCountDebounce.bind(this);
648
+ }, Pe = 2, Ne = class extends o.default.Component {
649
+ constructor(r) {
650
+ super(r), this.reCalculateColumnCount = this.reCalculateColumnCount.bind(this), this.reCalculateColumnCountDebounce = this.reCalculateColumnCountDebounce.bind(this);
639
651
  let e;
640
- this.props.breakpointCols && this.props.breakpointCols.default ? e = this.props.breakpointCols.default : e = parseInt(this.props.breakpointCols) || He, this.state = { columnCount: e };
652
+ this.props.breakpointCols && this.props.breakpointCols.default ? e = this.props.breakpointCols.default : e = parseInt(this.props.breakpointCols) || Pe, this.state = { columnCount: e };
641
653
  }
642
654
  componentDidMount() {
643
655
  this.reCalculateColumnCount(), window && window.addEventListener("resize", this.reCalculateColumnCountDebounce);
@@ -658,37 +670,37 @@ __useblocks__.define("static/core/ff830d19.js", [
658
670
  });
659
671
  }
660
672
  reCalculateColumnCount() {
661
- const n = window && window.innerWidth || Infinity;
673
+ const r = window && window.innerWidth || Infinity;
662
674
  let e = this.props.breakpointCols;
663
- typeof e != "object" && (e = { default: parseInt(e) || He });
664
- let r = Infinity, t = e.default || He;
675
+ typeof e != "object" && (e = { default: parseInt(e) || Pe });
676
+ let n = Infinity, t = e.default || Pe;
665
677
  for (let i in e) {
666
678
  const l = parseInt(i);
667
- l > 0 && n <= l && l < r && (r = l, t = e[i]);
679
+ l > 0 && r <= l && l < n && (n = l, t = e[i]);
668
680
  }
669
681
  t = Math.max(1, parseInt(t) || 1), this.state.columnCount !== t && this.setState({ columnCount: t });
670
682
  }
671
683
  itemsInColumns() {
672
- const n = this.state.columnCount, e = new Array(n), r = o.default.Children.toArray(this.props.children);
673
- for (let t = 0; t < r.length; t++) {
674
- const i = t % n;
675
- e[i] || (e[i] = []), e[i].push(r[t]);
684
+ const r = this.state.columnCount, e = new Array(r), n = o.default.Children.toArray(this.props.children);
685
+ for (let t = 0; t < n.length; t++) {
686
+ const i = t % r;
687
+ e[i] || (e[i] = []), e[i].push(n[t]);
676
688
  }
677
689
  return e;
678
690
  }
679
691
  renderColumns() {
680
- const { column: n, columnAttrs: e = {}, columnClassName: r } = this.props, t = this.itemsInColumns(), i = `${100 / t.length}%`;
681
- let l = r;
692
+ const { column: r, columnAttrs: e = {}, columnClassName: n } = this.props, t = this.itemsInColumns(), i = `${100 / t.length}%`;
693
+ let l = n;
682
694
  l && typeof l != "string" && (this.logDeprecated("The property \"columnClassName\" requires a string"), typeof l > "u" && (l = "my-masonry-grid_column"));
683
- const h = Ae(Ae(Ae({}, n), e), {}, {
684
- style: Ae(Ae({}, e.style), {}, { width: i }),
695
+ const h = we(we(we({}, r), e), {}, {
696
+ style: we(we({}, e.style), {}, { width: i }),
685
697
  className: l
686
698
  });
687
- return t.map((C, g) => o.default.createElement("div", ke({}, h, { key: g }), C));
699
+ return t.map((C, p) => o.default.createElement("div", Oe({}, h, { key: p }), C));
688
700
  }
689
- logDeprecated(n) {}
701
+ logDeprecated(r) {}
690
702
  render() {
691
- const n = this.props, { children: e, breakpointCols: r, columnClassName: t, columnAttrs: i, column: l, className: h } = n, C = kt(n, [
703
+ const r = this.props, { children: e, breakpointCols: n, columnClassName: t, columnAttrs: i, column: l, className: h } = r, C = Lt(r, [
692
704
  "children",
693
705
  "breakpointCols",
694
706
  "columnClassName",
@@ -696,154 +708,154 @@ __useblocks__.define("static/core/ff830d19.js", [
696
708
  "column",
697
709
  "className"
698
710
  ]);
699
- let g = h;
700
- return typeof h != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof h > "u" && (g = "my-masonry-grid")), o.default.createElement("div", ke({}, C, { className: g }), this.renderColumns());
711
+ let p = h;
712
+ return typeof h != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof h > "u" && (p = "my-masonry-grid")), o.default.createElement("div", Oe({}, C, { className: p }), this.renderColumns());
701
713
  }
702
714
  };
703
- We.defaultProps = Tt;
704
- function Ke(n, e) {
705
- return n ? n.exhausted ? {
706
- ...n,
715
+ Ne.defaultProps = Tt;
716
+ function Fe(r, e) {
717
+ return r ? r.exhausted ? {
718
+ ...r,
707
719
  src: null
708
720
  } : {
709
- ...n,
710
- src: n.src || e || null
721
+ ...r,
722
+ src: r.src || e || null
711
723
  } : null;
712
724
  }
713
- function it({ items: n, getItemId: e, getRequestUrl: r, createController: t }) {
714
- const [i, l] = (0, o.useState)({}), h = (0, o.useRef)(new Map()), C = (0, o.useCallback)((g) => {
715
- const S = e(g), I = r(g), p = `${S}:${I}`;
716
- if (h.current.has(p)) return {
717
- itemId: S,
718
- requestUrl: I,
719
- cacheKey: p,
720
- controller: h.current.get(p)
725
+ function rt({ items: r, getItemId: e, getRequestUrl: n, createController: t }) {
726
+ const [i, l] = (0, o.useState)({}), h = (0, o.useRef)(new Map()), C = (0, o.useCallback)((p) => {
727
+ const b = e(p), j = n(p), m = `${b}:${j}`;
728
+ if (h.current.has(m)) return {
729
+ itemId: b,
730
+ requestUrl: j,
731
+ cacheKey: m,
732
+ controller: h.current.get(m)
721
733
  };
722
- const b = t(I);
723
- return h.current.set(p, b), {
724
- itemId: S,
725
- requestUrl: I,
726
- cacheKey: p,
727
- controller: b
734
+ const v = t(j);
735
+ return h.current.set(m, v), {
736
+ itemId: b,
737
+ requestUrl: j,
738
+ cacheKey: m,
739
+ controller: v
728
740
  };
729
741
  }, [
730
742
  t,
731
743
  e,
732
- r
744
+ n
733
745
  ]);
734
746
  return (0, o.useEffect)(() => {
735
- const g = new Set(), S = {}, I = n.map((p) => {
736
- const { itemId: b, cacheKey: j, controller: y } = C(p);
737
- g.add(j), S[b] = y.src;
738
- const M = Ke(y.handleChangeSrc?.(), y.src);
739
- return M?.changed && M.src && (S[b] = M.src), y.subscribeToSrcChange?.((v) => {
740
- const k = Ke(v, y.src);
741
- !k?.changed || !k.src || l((R) => R[b] === k.src ? R : {
742
- ...R,
743
- [b]: k.src
747
+ const p = new Set(), b = {}, j = r.map((m) => {
748
+ const { itemId: v, cacheKey: A, controller: w } = C(m);
749
+ p.add(A), b[v] = w.src;
750
+ const T = Fe(w.handleChangeSrc?.(), w.src);
751
+ return T?.changed && T.src && (b[v] = T.src), w.subscribeToSrcChange?.((g) => {
752
+ const L = Fe(g, w.src);
753
+ !L?.changed || !L.src || l((E) => E[v] === L.src ? E : {
754
+ ...E,
755
+ [v]: L.src
744
756
  });
745
757
  });
746
758
  }).filter(Boolean);
747
- return h.current.forEach((p, b) => {
748
- g.has(b) || h.current.delete(b);
749
- }), l(S), () => {
750
- I.forEach((p) => p?.());
759
+ return h.current.forEach((m, v) => {
760
+ p.has(v) || h.current.delete(v);
761
+ }), l(b), () => {
762
+ j.forEach((m) => m?.());
751
763
  };
752
- }, [C, n]), {
753
- getDisplaySrc: (0, o.useCallback)((g) => {
754
- const { itemId: S, requestUrl: I, controller: p } = C(g);
755
- return i[S] || p.src || I;
764
+ }, [C, r]), {
765
+ getDisplaySrc: (0, o.useCallback)((p) => {
766
+ const { itemId: b, requestUrl: j, controller: m } = C(p);
767
+ return i[b] || m.src || j;
756
768
  }, [i, C]),
757
- handleLoad: (0, o.useCallback)((g) => {
758
- C(g).controller.handleSuccess();
769
+ handleLoad: (0, o.useCallback)((p) => {
770
+ C(p).controller.handleSuccess();
759
771
  }, [C]),
760
- handleError: (0, o.useCallback)((g) => {
761
- const { itemId: S, controller: I } = C(g), p = Ke(I.handleError(), I.src);
762
- p?.changed && p.src && l((b) => ({
763
- ...b,
764
- [S]: p.src
772
+ handleError: (0, o.useCallback)((p) => {
773
+ const { itemId: b, controller: j } = C(p), m = Fe(j.handleError(), j.src);
774
+ m?.changed && m.src && l((v) => ({
775
+ ...v,
776
+ [b]: m.src
765
777
  }));
766
778
  }, [C])
767
779
  };
768
780
  }
769
- var lt = "blocks", Ut = ({ setCurrentImageLink: n, setModalHeight: e, setModalWidth: r, setImageStockList: t, imageStockList: i, currentReq: l, setCurrentReq: h, inputRef: C, setStockLink: g, customRequest: S }) => {
770
- const I = d.useAppConfig(), p = d.useIsStandalone(), [b, j] = (0, o.useState)(!1), [y, M] = (0, o.useState)(2), { __: v } = u.useI18n(), k = u.useNotification(), [R] = z.useLazyGetUnsplashImageQuery(), [T] = z.useLazyGetSearchImageQuery(), H = (0, o.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 stock images through the configured proxy chain."), [v]), U = (0, o.useCallback)((a) => {
771
- k.error({
781
+ var nt = "blocks", Bt = ({ setCurrentImageLink: r, setModalHeight: e, setModalWidth: n, setImageStockList: t, imageStockList: i, currentReq: l, setCurrentReq: h, inputRef: C, setStockLink: p, customRequest: b }) => {
782
+ const j = f.useAppConfig(), m = f.useIsStandalone(), [v, A] = (0, o.useState)(!1), [w, T] = (0, o.useState)(2), { __: g } = d.useI18n(), L = d.useNotification(), [E] = H.useLazyGetUnsplashImageQuery(), [F] = H.useLazyGetSearchImageQuery(), K = (0, o.useCallback)((a) => a instanceof Error || typeof a?.message == "string" && a.message ? a.message : typeof a?.error?.message == "string" && a.error.message ? a.error.message : g("Failed to load stock images through the configured proxy chain."), [g]), k = (0, o.useCallback)((a) => {
783
+ L.error({
772
784
  id: "STOCK_IMAGES_SEARCH_FAILED",
773
- title: v("Failed to load stock images"),
774
- description: H(a)
785
+ title: g("Failed to load stock images"),
786
+ description: K(a)
775
787
  });
776
788
  }, [
777
- v,
778
- H,
779
- k
780
- ]), D = async () => {
781
- b || (j(!0), T({
789
+ g,
790
+ K,
791
+ L
792
+ ]), B = async () => {
793
+ v || (A(!0), F({
782
794
  query: l,
783
- page: y
795
+ page: w
784
796
  }).then((a) => {
785
797
  if (a?.error) {
786
- U(a.error), j(!1);
798
+ k(a.error), A(!1);
787
799
  return;
788
800
  }
789
- const m = a?.data?.results || [];
790
- t((K) => [...K, ...m]), j(!1), M((K) => K + 1);
801
+ const y = a?.data?.results || [];
802
+ t((W) => [...W, ...y]), A(!1), T((W) => W + 1);
791
803
  }).catch(() => {
792
- j(!1);
804
+ A(!1);
793
805
  }));
794
806
  };
795
807
  (0, o.useEffect)(() => {
796
- l.keywords !== "" && F();
808
+ l.keywords !== "" && G();
797
809
  }, [l.color, l.orientation]);
798
- const F = async () => {
799
- const a = await T({
810
+ const G = async () => {
811
+ const a = await F({
800
812
  query: l,
801
813
  page: 1
802
814
  });
803
815
  if (a?.error) {
804
- U(a.error), t([]);
816
+ k(a.error), t([]);
805
817
  return;
806
818
  }
807
- const m = a?.data?.results || [];
808
- m.length > 0 ? (t(m), setTimeout(() => {
809
- r(1060), e("84vh");
819
+ const y = a?.data?.results || [];
820
+ y.length > 0 ? (t(y), setTimeout(() => {
821
+ n(1060), e("84vh");
810
822
  }, 0)) : t([]);
811
- }, [Z, G] = (0, o.useState)(null), E = (0, o.useCallback)((a, m, K) => `${a}${a.includes("?") ? "&" : "?"}w=${m}&q=${K}`, []), L = (0, o.useCallback)((a) => d.getProxiedUrl(a, {
812
- config: I,
813
- standalone: p,
823
+ }, [Z, O] = (0, o.useState)(null), M = (0, o.useCallback)((a, y, W) => `${a}${a.includes("?") ? "&" : "?"}w=${y}&q=${W}`, []), R = (0, o.useCallback)((a) => f.getProxiedUrl(a, {
824
+ config: j,
825
+ standalone: m,
814
826
  resourceType: "stockImages",
815
827
  intent: "display"
816
- }), [I, p]), { getDisplaySrc: O, handleLoad: x, handleError: Y } = it({
828
+ }), [j, m]), { getDisplaySrc: S, handleLoad: z, handleError: D } = rt({
817
829
  items: i,
818
830
  getItemId: (0, o.useCallback)((a) => a.id, []),
819
- getRequestUrl: (0, o.useCallback)((a) => E(a.urls.raw, 644, 96), [E]),
820
- createController: L
821
- }), W = (a) => (m) => {
822
- x(a), m.target.parentNode.classList.add("loaded");
831
+ getRequestUrl: (0, o.useCallback)((a) => M(a.urls.raw, 644, 96), [M]),
832
+ createController: R
833
+ }), _ = (a) => (y) => {
834
+ z(a), y.target.parentNode.classList.add("loaded");
823
835
  }, X = (a) => () => {
824
- Y(a);
825
- }, _ = (a, m, K) => {
826
- R(m.download_location), G(K), setTimeout(() => G(null), 2e3), g(`${a.raw}&w=1200&q=96`), n(`${a.raw}&w=1200&q=96`), S(`${a.raw}&w=1200&q=96`);
836
+ D(a);
837
+ }, Y = (a, y, W) => {
838
+ E(y.download_location), O(W), setTimeout(() => O(null), 2e3), p(`${a.raw}&w=1200&q=96`), r(`${a.raw}&w=1200&q=96`), b(`${a.raw}&w=1200&q=96`);
827
839
  };
828
840
  return (0, s.jsxs)("div", {
829
841
  className: "stock-tab",
830
- children: [(0, s.jsxs)(u.Form, {
831
- onValuesChange: F,
842
+ children: [(0, s.jsxs)(d.Form, {
843
+ onValuesChange: G,
832
844
  className: i.length > 0 ? "serach-results" : "",
833
- children: [(0, s.jsxs)(u.Row, {
845
+ children: [(0, s.jsxs)(d.Row, {
834
846
  gutter: 24,
835
- children: [(0, s.jsx)(u.Col, {
847
+ children: [(0, s.jsx)(d.Col, {
836
848
  span: i.length > 0 ? "" : 24,
837
- children: (0, s.jsx)(u.Form.Item, {
849
+ children: (0, s.jsx)(d.Form.Item, {
838
850
  className: "stock-search-input",
839
- children: (0, s.jsx)(u.SearchInput, {
840
- onSearch: F,
851
+ children: (0, s.jsx)(d.SearchInput, {
852
+ onSearch: G,
841
853
  allowClear: !0,
842
854
  size: i.length > 0 ? "medium" : "large",
843
- placeholder: v("Search image"),
855
+ placeholder: g("Search image"),
844
856
  value: l.keywords,
845
- onChange: (a) => h((m) => ({
846
- ...m,
857
+ onChange: (a) => h((y) => ({
858
+ ...y,
847
859
  keywords: a.target.value
848
860
  })),
849
861
  ref: C,
@@ -851,107 +863,107 @@ __useblocks__.define("static/core/ff830d19.js", [
851
863
  enterButton: !1
852
864
  })
853
865
  })
854
- }), i.length > 0 && (0, s.jsxs)(s.Fragment, { children: [(0, s.jsx)(u.Col, { children: (0, s.jsxs)(u.Radio.Group, {
866
+ }), i.length > 0 && (0, s.jsxs)(s.Fragment, { children: [(0, s.jsx)(d.Col, { children: (0, s.jsxs)(d.Radio.Group, {
855
867
  defaultValue: "",
856
- onChange: (a) => h((m) => ({
857
- ...m,
868
+ onChange: (a) => h((y) => ({
869
+ ...y,
858
870
  orientation: a.target.value
859
871
  })),
860
872
  children: [
861
- (0, s.jsx)(u.Tooltip, {
862
- title: v("All"),
873
+ (0, s.jsx)(d.Tooltip, {
874
+ title: g("All"),
863
875
  placement: "top",
864
- children: (0, s.jsx)(u.Radio.Button, {
876
+ children: (0, s.jsx)(d.Radio.Button, {
865
877
  value: "",
866
- children: (0, s.jsx)(B.EmIcons, { icon: "MixedView" })
878
+ children: (0, s.jsx)(U.EmIcons, { icon: "MixedView" })
867
879
  })
868
880
  }),
869
- (0, s.jsx)(u.Tooltip, {
870
- title: v("Landscape"),
881
+ (0, s.jsx)(d.Tooltip, {
882
+ title: g("Landscape"),
871
883
  placement: "top",
872
- children: (0, s.jsx)(u.Radio.Button, {
884
+ children: (0, s.jsx)(d.Radio.Button, {
873
885
  value: "landscape",
874
- children: (0, s.jsx)(B.EmIcons, { icon: "LandscapeView" })
886
+ children: (0, s.jsx)(U.EmIcons, { icon: "LandscapeView" })
875
887
  })
876
888
  }),
877
- (0, s.jsx)(u.Tooltip, {
878
- title: v("Portrait"),
889
+ (0, s.jsx)(d.Tooltip, {
890
+ title: g("Portrait"),
879
891
  placement: "top",
880
- children: (0, s.jsx)(u.Radio.Button, {
892
+ children: (0, s.jsx)(d.Radio.Button, {
881
893
  value: "portrait",
882
- children: (0, s.jsx)(B.EmIcons, { icon: "PortraitView" })
894
+ children: (0, s.jsx)(U.EmIcons, { icon: "PortraitView" })
883
895
  })
884
896
  }),
885
- (0, s.jsx)(u.Tooltip, {
886
- title: v("Squarish"),
897
+ (0, s.jsx)(d.Tooltip, {
898
+ title: g("Squarish"),
887
899
  placement: "top",
888
- children: (0, s.jsx)(u.Radio.Button, {
900
+ children: (0, s.jsx)(d.Radio.Button, {
889
901
  value: "squarish",
890
- children: (0, s.jsx)(B.EmIcons, { icon: "SquareView" })
902
+ children: (0, s.jsx)(U.EmIcons, { icon: "SquareView" })
891
903
  })
892
904
  })
893
905
  ]
894
- }) }), (0, s.jsx)(u.Col, { children: (0, s.jsx)(u.RadioColorFilter, {
906
+ }) }), (0, s.jsx)(d.Col, { children: (0, s.jsx)(d.RadioColorFilter, {
895
907
  defaultValue: "",
896
- onChange: (a) => h((m) => ({
897
- ...m,
908
+ onChange: (a) => h((y) => ({
909
+ ...y,
898
910
  color: a.target.value
899
911
  })),
900
912
  options: [
901
913
  {
902
914
  value: "",
903
915
  colorClass: "all-colors",
904
- label: v("All")
916
+ label: g("All")
905
917
  },
906
918
  {
907
919
  value: "black",
908
920
  colorClass: "black-color",
909
- label: v("Black")
921
+ label: g("Black")
910
922
  },
911
923
  {
912
924
  value: "black_and_white",
913
925
  colorClass: "bw-color",
914
- label: v("Black and White")
926
+ label: g("Black and White")
915
927
  },
916
928
  {
917
929
  value: "white",
918
930
  colorClass: "white-color",
919
- label: v("White")
931
+ label: g("White")
920
932
  },
921
933
  {
922
934
  value: "orange",
923
935
  colorClass: "orange-color",
924
- label: v("Orange")
936
+ label: g("Orange")
925
937
  },
926
938
  {
927
939
  value: "red",
928
940
  colorClass: "red-color",
929
- label: v("Red")
941
+ label: g("Red")
930
942
  },
931
943
  {
932
944
  value: "purple",
933
945
  colorClass: "purple-color",
934
- label: v("Purple")
946
+ label: g("Purple")
935
947
  },
936
948
  {
937
949
  value: "magenta",
938
950
  colorClass: "magenta-color",
939
- label: v("Magenta")
951
+ label: g("Magenta")
940
952
  },
941
953
  {
942
954
  value: "green",
943
955
  colorClass: "green-color",
944
- label: v("Green")
956
+ label: g("Green")
945
957
  },
946
958
  {
947
959
  value: "teal",
948
960
  colorClass: "teal-color",
949
- label: v("Teal")
961
+ label: g("Teal")
950
962
  },
951
963
  {
952
964
  value: "blue",
953
965
  colorClass: "blue-color",
954
- label: v("Blue")
966
+ label: g("Blue")
955
967
  }
956
968
  ],
957
969
  tooltipPlacement: "top"
@@ -979,42 +991,42 @@ __useblocks__.define("static/core/ff830d19.js", [
979
991
  lineHeight: "0",
980
992
  boxSizing: "unset"
981
993
  },
982
- children: (0, s.jsx)(ot, {
994
+ children: (0, s.jsx)(et, {
983
995
  dataLength: i && i.length,
984
- next: D,
996
+ next: B,
985
997
  hasMore: i,
986
- endMessage: (0, s.jsxs)(u.Divider, {
998
+ endMessage: (0, s.jsxs)(d.Divider, {
987
999
  plain: !0,
988
- children: [v("That`s all we could find."), " 🤐"]
1000
+ children: [g("That`s all we could find."), " 🤐"]
989
1001
  }),
990
1002
  scrollableTarget: "scrollableDiv",
991
1003
  style: { overflow: "visible" },
992
1004
  loader: null,
993
- children: (0, s.jsx)(We, {
1005
+ children: (0, s.jsx)(Ne, {
994
1006
  breakpointCols: { default: 3 },
995
1007
  className: "my-masonry-grid",
996
1008
  columnClassName: "my-masonry-grid_column",
997
1009
  children: i.map((a) => (0, s.jsxs)("div", {
998
1010
  className: "list-item",
999
- onClick: () => _(a.urls, a.links, a.id),
1011
+ onClick: () => Y(a.urls, a.links, a.id),
1000
1012
  children: [
1001
1013
  (0, s.jsx)("img", {
1002
1014
  className: Z === a.id ? "loaded-image" : "",
1003
1015
  width: "322px",
1004
- src: O(a),
1016
+ src: S(a),
1005
1017
  alt: a.description,
1006
- onLoad: W(a),
1018
+ onLoad: _(a),
1007
1019
  onError: X(a)
1008
1020
  }),
1009
1021
  (0, s.jsxs)("p", {
1010
1022
  className: "creator-info",
1011
- onClick: (m) => m.stopPropagation(),
1023
+ onClick: (y) => y.stopPropagation(),
1012
1024
  children: [
1013
1025
  "Photo by",
1014
1026
  " ",
1015
1027
  (0, s.jsx)("a", {
1016
1028
  target: "_blank",
1017
- href: `${a.user.links.html}?utm_source=${lt}&utm_medium=referral`,
1029
+ href: `${a.user.links.html}?utm_source=${nt}&utm_medium=referral`,
1018
1030
  rel: "noreferrer",
1019
1031
  children: a.user.name
1020
1032
  }),
@@ -1023,13 +1035,13 @@ __useblocks__.define("static/core/ff830d19.js", [
1023
1035
  " ",
1024
1036
  (0, s.jsx)("a", {
1025
1037
  target: "_blank",
1026
- href: `https://unsplash.com/?utm_source=${lt}&utm_medium=referral`,
1038
+ href: `https://unsplash.com/?utm_source=${nt}&utm_medium=referral`,
1027
1039
  rel: "noreferrer",
1028
1040
  children: "Unsplash"
1029
1041
  })
1030
1042
  ]
1031
1043
  }),
1032
- Z === a.id && (0, s.jsx)(u.Spin, {
1044
+ Z === a.id && (0, s.jsx)(d.Spin, {
1033
1045
  className: "ant-spin",
1034
1046
  size: "small"
1035
1047
  })
@@ -1040,11 +1052,11 @@ __useblocks__.define("static/core/ff830d19.js", [
1040
1052
  })
1041
1053
  })]
1042
1054
  });
1043
- }, Bt = ({ images: n, transitionDuration: e = 1e3 }) => {
1044
- const [r, t] = (0, o.useState)([]);
1055
+ }, Mt = ({ images: r, transitionDuration: e = 1e3 }) => {
1056
+ const [n, t] = (0, o.useState)([]);
1045
1057
  return (0, o.useEffect)(() => {
1046
- if (n.length > 0) {
1047
- const i = n[n.length - 1];
1058
+ if (r.length > 0) {
1059
+ const i = r[r.length - 1];
1048
1060
  t((l) => [...l, {
1049
1061
  src: i,
1050
1062
  opacity: 0
@@ -1055,9 +1067,9 @@ __useblocks__.define("static/core/ff830d19.js", [
1055
1067
  } : h));
1056
1068
  }, 1e3);
1057
1069
  }
1058
- }, [n]), (0, s.jsx)("div", {
1070
+ }, [r]), (0, s.jsx)("div", {
1059
1071
  className: "slideshow-container",
1060
- children: r.map((i, l) => (0, s.jsx)("img", {
1072
+ children: n.map((i, l) => (0, s.jsx)("img", {
1061
1073
  src: `data:image/jpeg;base64, ${i.src}`,
1062
1074
  alt: `Slide ${l + 1}`,
1063
1075
  className: "slideshow-image",
@@ -1068,271 +1080,271 @@ __useblocks__.define("static/core/ff830d19.js", [
1068
1080
  }, l))
1069
1081
  });
1070
1082
  };
1071
- function Mt({ setModalHeight: n, customRequest: e, aiTabRef: r, isImageUploaded: t, setIsImageUploaded: i, aiImageRequest: l, imageAiList: h, setImageAiList: C, isLoadingAi: g, setIsLoadingAi: S, onPluginAiImageLimitExceeded: I, onImageGenerateLimitExceeded: p }) {
1072
- const { __: b } = u.useI18n(), j = d.useAppConfig(), y = u.useNotification(), M = d.usePushToDataLayer(), { emailId: v, blockId: k, projectId: R } = (0, Ge.useParams)(), [T] = z.useLazySendAiImageRequestQuery(), [H, { data: U = [] }] = z.useLazyGetAiImageSSEQuery(), [D] = z.useLazyGetLimitsStatsByTypeQuery(), F = j?.sendAIImageRequest || T, Z = j?.trigger || H, G = j?.handleLimitUsageEmitter || d.useEventEmitter(d.events.ON_LIMIT_ID), [E, L] = (0, o.useState)(0), [O, x] = (0, o.useState)(null), [Y, W] = (0, o.useState)(!1), [X, _] = (0, o.useState)(b("Evaluating the task")), [a, m] = (0, o.useState)(!1), K = v || k, { limits: pe } = j?.limits ? j : { limits: { ai_img_limit: 0 } }, { ai_img_limit: $ } = pe, he = $ > 0 && E >= $, P = !!(j.limits && j.counters) && d.PLUGIN.isPlugin, J = (0, o.useCallback)(() => {
1073
- G.fire({
1083
+ function Ut({ setModalHeight: r, customRequest: e, aiTabRef: n, isImageUploaded: t, setIsImageUploaded: i, aiImageRequest: l, imageAiList: h, setImageAiList: C, isLoadingAi: p, setIsLoadingAi: b, onPluginAiImageLimitExceeded: j, onImageGenerateLimitExceeded: m }) {
1084
+ const { __: v } = d.useI18n(), A = f.useAppConfig(), w = d.useNotification(), T = f.usePushToDataLayer(), { emailId: g, blockId: L, projectId: E } = (0, Me.useParams)(), [F] = H.useLazySendAiImageRequestQuery(), [K, { data: k = [] }] = H.useLazyGetAiImageSSEQuery(), [B] = H.useLazyGetLimitsStatsByTypeQuery(), G = A?.sendAIImageRequest || F, Z = A?.trigger || K, O = A?.handleLimitUsageEmitter || f.useEventEmitter(f.events.ON_LIMIT_ID), [M, R] = (0, o.useState)(0), [S, z] = (0, o.useState)(null), [D, _] = (0, o.useState)(!1), [X, Y] = (0, o.useState)(v("Evaluating the task")), [a, y] = (0, o.useState)(!1), W = g || L, { limits: ue } = A?.limits ? A : { limits: { ai_img_limit: 0 } }, { ai_img_limit: $ } = ue, de = $ > 0 && M >= $, P = !!(A.limits && A.counters) && f.PLUGIN.isPlugin, J = (0, o.useCallback)(() => {
1085
+ O.fire({
1074
1086
  name: "AiImgCount",
1075
- count: E + 1
1087
+ count: M + 1
1076
1088
  });
1077
- }, [G, E]), te = (0, o.useMemo)(() => !he && (!P || $ === 0 || E < $), [
1078
- he,
1089
+ }, [O, M]), te = (0, o.useMemo)(() => !de && (!P || $ === 0 || M < $), [
1090
+ de,
1079
1091
  P,
1080
- E,
1092
+ M,
1081
1093
  $
1082
- ]), Ie = (0, o.useCallback)(async () => {
1083
- _(b("Evaluating the task")), l !== "" && !g && (S(!0), m(!0), C([]), M({
1094
+ ]), Ae = (0, o.useCallback)(async () => {
1095
+ Y(v("Evaluating the task")), l !== "" && !p && (b(!0), y(!0), C([]), T({
1084
1096
  event: "submit_form",
1085
1097
  action: "ai_image_generation",
1086
- entity_id: v,
1087
- project_id: R
1088
- }), F({ body: {
1089
- project_id: R,
1098
+ entity_id: g,
1099
+ project_id: E
1100
+ }), G({ body: {
1101
+ project_id: E,
1090
1102
  request: "create-image",
1091
1103
  connection: "midjourney",
1092
1104
  message: l
1093
- } }).then(({ data: w, error: re }) => {
1094
- if (re) throw re;
1095
- if (w.data.status === 401) throw new Error(d.ERROR);
1096
- w?.data.status === 200 ? (w?.data.task.id && (_(w.data.task.message), x(w.data.task.id)), w.message && y.success({
1105
+ } }).then(({ data: I, error: ne }) => {
1106
+ if (ne) throw ne;
1107
+ if (I.data.status === 401) throw new Error(f.ERROR);
1108
+ I?.data.status === 200 ? (I?.data.task.id && (Y(I.data.task.message), z(I.data.task.id)), I.message && w.success({
1097
1109
  id: "AI_IMAGE_SEND_SUCCESS",
1098
- title: w.message,
1110
+ title: I.message,
1099
1111
  placement: "bottomRight",
1100
1112
  data: l
1101
1113
  }), Z({
1102
- task_id: w?.data.task.id,
1103
- entity_id: K
1104
- })) : (S(!1), m(!1), y.error({
1114
+ task_id: I?.data.task.id,
1115
+ entity_id: W
1116
+ })) : (b(!1), y(!1), w.error({
1105
1117
  id: "AI_IMAGE_SEND_ERROR",
1106
- title: w?.message || b("Something went wrong, please try again"),
1118
+ title: I?.message || v("Something went wrong, please try again"),
1107
1119
  placement: "bottomRight",
1108
1120
  data: l,
1109
- innerException: w
1121
+ innerException: I
1110
1122
  }));
1111
- }).catch((w) => {
1112
- S(!1), m(!1), (w?.error || w?.data) && y.fromError("AI_IMAGE_SEND_ERROR", l, w.error || w);
1123
+ }).catch((I) => {
1124
+ b(!1), y(!1), (I?.error || I?.data) && w.fromError("AI_IMAGE_SEND_ERROR", l, I.error || I);
1113
1125
  }));
1114
1126
  }, [
1115
1127
  l,
1116
- g,
1117
- S,
1118
- m,
1119
- C,
1120
- M,
1121
- v,
1122
- R,
1123
- F,
1128
+ p,
1129
+ b,
1124
1130
  y,
1131
+ C,
1132
+ T,
1133
+ g,
1134
+ E,
1135
+ G,
1136
+ w,
1125
1137
  Z,
1126
- K,
1127
- b
1128
- ]), De = (0, o.useCallback)(async () => {
1138
+ W,
1139
+ v
1140
+ ]), Re = (0, o.useCallback)(async () => {
1129
1141
  if (te) {
1130
1142
  if (!P) {
1131
- const w = B.resolveLimitActionPreflightExceededForType("image_generate", (await D("image_generate")).data?.stats);
1132
- if (w) {
1133
- p?.(w);
1143
+ const I = U.resolveLimitActionPreflightExceededForType("image_generate", (await B("image_generate")).data?.stats);
1144
+ if (I) {
1145
+ m?.(I);
1134
1146
  return;
1135
1147
  }
1136
1148
  }
1137
- P && (L((w) => w + 1), J()), Ie();
1138
- } else P && (I ? I() : y.error({
1139
- title: b("The usage limit has been exceeded"),
1140
- description: b(`The maximum number of requests for the current subscription period has been reached.
1149
+ P && (R((I) => I + 1), J()), Ae();
1150
+ } else P && (j ? j() : w.error({
1151
+ title: v("The usage limit has been exceeded"),
1152
+ description: v(`The maximum number of requests for the current subscription period has been reached.
1141
1153
  Select the appropriate plan to fulfil more requests`),
1142
1154
  placement: "bottomRight"
1143
1155
  }));
1144
1156
  }, [
1145
1157
  te,
1146
1158
  P,
1147
- D,
1148
- p,
1149
- L,
1159
+ B,
1160
+ m,
1161
+ R,
1150
1162
  J,
1151
- Ie,
1152
- y,
1153
- b,
1154
- I
1163
+ Ae,
1164
+ w,
1165
+ v,
1166
+ j
1155
1167
  ]);
1156
1168
  (0, o.useEffect)(() => {
1157
- P && L(j?.counters?.ai_img_counter || 0);
1158
- }, [j, P]);
1159
- const ue = (0, o.useCallback)((w) => {
1169
+ P && R(A?.counters?.ai_img_counter || 0);
1170
+ }, [A, P]);
1171
+ const ie = (0, o.useCallback)((I) => {
1160
1172
  if (!t) {
1161
1173
  i(!0);
1162
- const re = w.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);
1163
- if (!re) return;
1164
- const Ee = re[1], Te = re[2], Ce = atob(Te), ae = new Array(Ce.length);
1165
- for (let me = 0; me < Ce.length; me++) ae[me] = Ce.charCodeAt(me);
1166
- const Ue = new Uint8Array(ae), Be = new Blob([Ue], { type: `image/${Ee}` });
1167
- e({ file: new File([Be], "image.jpeg", { type: Be.type }) });
1174
+ try {
1175
+ const ne = Xe(I);
1176
+ e({ file: new File([ne], "image.jpeg", { type: ne.type || "image/jpeg" }) });
1177
+ } catch {
1178
+ i(!1);
1179
+ }
1168
1180
  }
1169
1181
  }, [
1170
1182
  t,
1171
1183
  i,
1172
1184
  e
1173
- ]), be = (0, o.useCallback)((w) => {
1174
- w.status !== "error" && w.status !== "Canceled" ? w.images ? (_(w.status), w.progress === 100 && (C(w.images), _(b("Evaluating the task")), x(null), m(!1))) : (C([w.data]), S(!1)) : (S(!1), m(!1), y.error({
1185
+ ]), me = (0, o.useCallback)((I) => {
1186
+ I.status !== "error" && I.status !== "Canceled" ? I.images ? (Y(I.status), I.progress === 100 && (C(I.images), Y(v("Evaluating the task")), z(null), y(!1))) : (C([I.data]), b(!1)) : (b(!1), y(!1), w.error({
1175
1187
  id: "AI_IMAGE_GET_ERROR",
1176
- title: b("Something went wrong, please try again"),
1188
+ title: v("Something went wrong, please try again"),
1177
1189
  placement: "bottomRight",
1178
- data: O
1190
+ data: S
1179
1191
  }));
1180
1192
  }, [
1181
1193
  C,
1182
- _,
1194
+ Y,
1195
+ v,
1183
1196
  b,
1197
+ r,
1184
1198
  S,
1185
- n,
1186
- O,
1187
- y,
1188
- m
1199
+ w,
1200
+ y
1189
1201
  ]);
1190
1202
  return (0, o.useEffect)(() => {
1191
- U.length > 1 && be(U[U.length - 1]);
1192
- }, [U, be]), (0, o.useEffect)(() => {
1193
- (g || h.length > 0) && setTimeout(() => {
1194
- let w = 550;
1195
- r.current && (w = r.current.offsetHeight + 68), n(w);
1203
+ k.length > 1 && me(k[k.length - 1]);
1204
+ }, [k, me]), (0, o.useEffect)(() => {
1205
+ (p || h.length > 0) && setTimeout(() => {
1206
+ let I = 550;
1207
+ n.current && (I = n.current.offsetHeight + 68), r(I);
1196
1208
  }, 0);
1197
1209
  }, [
1198
- r,
1199
- U,
1210
+ n,
1211
+ k,
1200
1212
  h.length,
1201
- g,
1202
- n
1213
+ p,
1214
+ r
1203
1215
  ]), {
1204
- aiImageCounter: E,
1205
- setAiImageCounter: L,
1216
+ aiImageCounter: M,
1217
+ setAiImageCounter: R,
1206
1218
  currentAiImgLimits: $,
1207
- isFieldsDisabled: he,
1219
+ isFieldsDisabled: de,
1208
1220
  canGenerateImage: te,
1209
1221
  aiImageRequest: l,
1210
1222
  imageAiList: h,
1211
1223
  setImageAiList: C,
1212
- isLoadingAi: g,
1213
- setIsLoadingAi: S,
1224
+ isLoadingAi: p,
1225
+ setIsLoadingAi: b,
1214
1226
  loadingDuringGeneration: a,
1215
- setLoadingDuringGeneration: m,
1227
+ setLoadingDuringGeneration: y,
1216
1228
  requestStatus: X,
1217
- setRequestStatus: _,
1218
- handleGenerate: De,
1229
+ setRequestStatus: Y,
1230
+ handleGenerate: Re,
1219
1231
  handleLimitAiImgCount: J,
1220
- convertBase64ToFile: ue,
1221
- isShiftPressed: Y,
1222
- setIsShiftPressed: W,
1223
- currentReqId: O,
1224
- setCurrentReqId: x,
1232
+ convertBase64ToFile: ie,
1233
+ isShiftPressed: D,
1234
+ setIsShiftPressed: _,
1235
+ currentReqId: S,
1236
+ setCurrentReqId: z,
1225
1237
  limitsInPlugin: P
1226
1238
  };
1227
1239
  }
1228
- var Pt = ({ setModalHeight: n, customRequest: e, aiTabRef: r, inputAiRef: t, isImageUploaded: i, setIsImageUploaded: l, aiImageRequest: h, setAiImageRequest: C, imageAiList: g, setImageAiList: S, isLoadingAi: I, setIsLoadingAi: p }) => {
1229
- const b = (0, Ge.useNavigate)(), j = d.useDispatch(), { __: y, _n: M } = u.useI18n(), v = d.useAppConfig(), [k, R] = (0, o.useState)(!1), [T, H] = (0, o.useState)(null), { aiImageCounter: U, currentAiImgLimits: D, loadingDuringGeneration: F, requestStatus: Z, handleGenerate: G, convertBase64ToFile: E, isShiftPressed: L, setIsShiftPressed: O, limitsInPlugin: x } = Mt({
1230
- setModalHeight: n,
1240
+ var Pt = ({ setModalHeight: r, customRequest: e, aiTabRef: n, inputAiRef: t, isImageUploaded: i, setIsImageUploaded: l, aiImageRequest: h, setAiImageRequest: C, imageAiList: p, setImageAiList: b, isLoadingAi: j, setIsLoadingAi: m }) => {
1241
+ const v = (0, Me.useNavigate)(), A = f.useDispatch(), { __: w, _n: T } = d.useI18n(), g = f.useAppConfig(), [L, E] = (0, o.useState)(!1), [F, K] = (0, o.useState)(null), { aiImageCounter: k, currentAiImgLimits: B, loadingDuringGeneration: G, requestStatus: Z, handleGenerate: O, convertBase64ToFile: M, isShiftPressed: R, setIsShiftPressed: S, limitsInPlugin: z } = Ut({
1242
+ setModalHeight: r,
1231
1243
  customRequest: e,
1232
- aiTabRef: r,
1244
+ aiTabRef: n,
1233
1245
  isImageUploaded: i,
1234
1246
  setIsImageUploaded: l,
1235
1247
  aiImageRequest: h,
1236
- imageAiList: g,
1237
- setImageAiList: S,
1238
- isLoadingAi: I,
1239
- setIsLoadingAi: p,
1240
- onPluginAiImageLimitExceeded: () => R(!0),
1241
- onImageGenerateLimitExceeded: H
1242
- }), Y = k && D > 0 ? q.getAiTariffUpgradeStep(D) : null, W = Y ? B.getLimitUpgradePresetDefinition(Y.presetId) : null, X = T ? B.getLimitUpgradePresetDefinition(T.presetId) : null, [_, a] = (0, o.useState)(!1), m = (0, o.useCallback)(() => a(!0), []), K = (0, o.useCallback)(() => a(!1), []), pe = (0, o.useCallback)((J) => C(J.target.value), [C]), $ = (0, o.useCallback)((J) => {
1243
- J.key === "Shift" ? O(!0) : J.key === "Enter" && !L && (J.preventDefault(), G());
1248
+ imageAiList: p,
1249
+ setImageAiList: b,
1250
+ isLoadingAi: j,
1251
+ setIsLoadingAi: m,
1252
+ onPluginAiImageLimitExceeded: () => E(!0),
1253
+ onImageGenerateLimitExceeded: K
1254
+ }), D = L && B > 0 ? q.getAiTariffUpgradeStep(B) : null, _ = D ? U.getLimitUpgradePresetDefinition(D.presetId) : null, X = F ? U.getLimitUpgradePresetDefinition(F.presetId) : null, [Y, a] = (0, o.useState)(!1), y = (0, o.useCallback)(() => a(!0), []), W = (0, o.useCallback)(() => a(!1), []), ue = (0, o.useCallback)((J) => C(J.target.value), [C]), $ = (0, o.useCallback)((J) => {
1255
+ J.key === "Shift" ? S(!0) : J.key === "Enter" && !R && (J.preventDefault(), O());
1244
1256
  }, [
1245
- L,
1246
- G,
1247
- O
1248
- ]), he = (0, o.useCallback)((J) => {
1249
- J.key === "Shift" && O(!1);
1250
- }, [O]), P = g[g.length - 1];
1257
+ R,
1258
+ O,
1259
+ S
1260
+ ]), de = (0, o.useCallback)((J) => {
1261
+ J.key === "Shift" && S(!1);
1262
+ }, [S]), P = p[p.length - 1];
1251
1263
  return (0, s.jsxs)("div", {
1252
1264
  className: "image-ai",
1253
1265
  children: [
1254
- W && Y ? (0, s.jsx)(B.LimitUpgradeModal, {
1266
+ _ && D ? (0, s.jsx)(U.LimitUpgradeModal, {
1255
1267
  open: !0,
1256
- onClose: () => R(!1),
1257
- title: y(W.titleKey),
1258
- subtitle: y(W.subtitleKey),
1259
- usageResource: W.usageResource,
1260
- previousDisplay: B.presetLimitDisplay(Y.previousLimit),
1261
- nextDisplay: B.presetLimitDisplay(Y.nextLimit),
1268
+ onClose: () => E(!1),
1269
+ title: w(_.titleKey),
1270
+ subtitle: w(_.subtitleKey),
1271
+ usageResource: _.usageResource,
1272
+ previousDisplay: U.presetLimitDisplay(D.previousLimit),
1273
+ nextDisplay: U.presetLimitDisplay(D.nextLimit),
1262
1274
  onChangePlan: () => {
1263
- R(!1), document.body.classList.remove("editor"), b("/billing"), j(z.openModal(d.MODALS.SWITCH_TO_PLAN_MODAL));
1275
+ E(!1), document.body.classList.remove("editor"), v("/billing"), A(H.openModal(f.MODALS.SWITCH_TO_PLAN_MODAL));
1264
1276
  }
1265
1277
  }) : null,
1266
- X && T ? (0, s.jsx)(B.LimitUpgradeModal, {
1278
+ X && F ? (0, s.jsx)(U.LimitUpgradeModal, {
1267
1279
  open: !0,
1268
- onClose: () => H(null),
1269
- title: y(X.titleKey),
1270
- subtitle: y(X.subtitleKey),
1280
+ onClose: () => K(null),
1281
+ title: w(X.titleKey),
1282
+ subtitle: w(X.subtitleKey),
1271
1283
  usageResource: X.usageResource,
1272
- previousDisplay: B.presetLimitDisplay(T.previousLimit),
1273
- nextDisplay: B.presetLimitDisplay(T.nextLimit),
1284
+ previousDisplay: U.presetLimitDisplay(F.previousLimit),
1285
+ nextDisplay: U.presetLimitDisplay(F.nextLimit),
1274
1286
  onChangePlan: () => {
1275
- H(null), document.body.classList.remove("editor"), b("/billing"), j(z.openModal(d.MODALS.SWITCH_TO_PLAN_MODAL));
1287
+ K(null), document.body.classList.remove("editor"), v("/billing"), A(H.openModal(f.MODALS.SWITCH_TO_PLAN_MODAL));
1276
1288
  }
1277
1289
  }) : null,
1278
- x && (0, s.jsx)(u.LimitsCounter, {
1279
- text: `${U} ${y("of")} ${D > 0 ? D : "∞"} images ${M("was used", "were used", U)}`,
1280
- exceeded: D > 0 && U >= D,
1290
+ z && (0, s.jsx)(d.LimitsCounter, {
1291
+ text: `${k} ${w("of")} ${B > 0 ? B : "∞"} images ${T("was used", "were used", k)}`,
1292
+ exceeded: B > 0 && k >= B,
1281
1293
  style: { marginTop: -25 },
1282
1294
  extra: (0, s.jsx)("span", {
1283
1295
  style: {
1284
1296
  textDecoration: "underline",
1285
1297
  cursor: "pointer"
1286
1298
  },
1287
- onClick: () => b(v.billingPageUrl || d.APP_ROUTES.billing),
1288
- children: y("Need more?")
1299
+ onClick: () => v(g.billingPageUrl || f.APP_ROUTES.billing),
1300
+ children: w("Need more?")
1289
1301
  })
1290
1302
  }),
1291
- (0, s.jsx)(u.Row, {
1303
+ (0, s.jsx)(d.Row, {
1292
1304
  gutter: 24,
1293
1305
  className: "image-ai__row",
1294
- children: (0, s.jsx)(u.Col, {
1306
+ children: (0, s.jsx)(d.Col, {
1295
1307
  span: 24,
1296
- children: (0, s.jsx)(u.Form.Item, {
1308
+ children: (0, s.jsx)(d.Form.Item, {
1297
1309
  style: { margin: 0 },
1298
1310
  children: (0, s.jsxs)("span", {
1299
- className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${_ ? " ant-input-affix-wrapper-focused" : ""}`,
1300
- children: [(0, s.jsx)(u.TextArea, {
1311
+ className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${Y ? " ant-input-affix-wrapper-focused" : ""}`,
1312
+ children: [(0, s.jsx)(d.TextArea, {
1301
1313
  ref: t,
1302
1314
  onKeyDown: $,
1303
- onKeyUp: he,
1304
- onFocus: m,
1305
- onBlur: K,
1315
+ onKeyUp: de,
1316
+ onFocus: y,
1317
+ onBlur: W,
1306
1318
  autoSize: !0,
1307
1319
  allowClear: !0,
1308
1320
  className: "text-area-input-hybrid image-ai__textarea",
1309
- placeholder: y("Generate image"),
1321
+ placeholder: w("Generate image"),
1310
1322
  value: h,
1311
- onChange: pe,
1323
+ onChange: ue,
1312
1324
  spellCheck: "false"
1313
1325
  }), (0, s.jsx)("span", {
1314
1326
  className: "ant-input-suffix image-ai__input-suffix",
1315
- children: I || F ? (0, s.jsx)(B.EmIcons, {
1327
+ children: j || G ? (0, s.jsx)(U.EmIcons, {
1316
1328
  icon: "LoadingOutlined",
1317
1329
  className: "input-icon image-ai__input-icon",
1318
1330
  spin: !0
1319
- }) : (0, s.jsx)(B.EmIcons, {
1331
+ }) : (0, s.jsx)(U.EmIcons, {
1320
1332
  icon: "AI",
1321
1333
  className: "input-icon image-ai__input-icon",
1322
- onClick: G
1334
+ onClick: O
1323
1335
  })
1324
1336
  })]
1325
1337
  })
1326
1338
  })
1327
1339
  })
1328
1340
  }),
1329
- (I || g.length > 0) && (0, s.jsxs)("div", {
1341
+ (j || p.length > 0) && (0, s.jsxs)("div", {
1330
1342
  className: "image-ai__preview",
1331
- children: [I && g.length === 0 && (0, s.jsx)("div", {
1343
+ children: [j && p.length === 0 && (0, s.jsx)("div", {
1332
1344
  className: "image-ai__loading",
1333
1345
  children: (0, s.jsxs)("div", {
1334
1346
  className: "spin",
1335
- children: [(0, s.jsx)(B.EmIcons, {
1347
+ children: [(0, s.jsx)(U.EmIcons, {
1336
1348
  icon: "LoadingOutlined",
1337
1349
  style: { fontSize: 48 },
1338
1350
  spin: !0
@@ -1341,97 +1353,97 @@ Select the appropriate plan to fulfil more requests`),
1341
1353
  children: Z
1342
1354
  })]
1343
1355
  })
1344
- }), g.length > 0 && (0, s.jsxs)("div", {
1356
+ }), p.length > 0 && (0, s.jsxs)("div", {
1345
1357
  className: "image-ai__image-item",
1346
- children: [(0, s.jsx)(Bt, { images: g }), (0, s.jsx)("div", {
1358
+ children: [(0, s.jsx)(Mt, { images: p }), (0, s.jsx)("div", {
1347
1359
  className: "buttons",
1348
- children: (0, s.jsx)(u.Button, {
1349
- onClick: () => E(`data:image/jpeg;base64, ${P}`),
1350
- icon: (0, s.jsx)(B.EmIcons, { icon: "CheckOutlined" }),
1351
- children: y("Use this one")
1360
+ children: (0, s.jsx)(d.Button, {
1361
+ onClick: () => M(`data:image/jpeg;base64, ${P}`),
1362
+ icon: (0, s.jsx)(U.EmIcons, { icon: "CheckOutlined" }),
1363
+ children: w("Use this one")
1352
1364
  })
1353
1365
  })]
1354
1366
  })]
1355
1367
  })
1356
1368
  ]
1357
1369
  });
1358
- }, Nt = ({ setNewLink: n, setCurrentImageLink: e, setModalHeight: r, setModalWidth: t, setImageGifList: i, imageGifList: l, currentReqGif: h, setCurrentReqGif: C, inputRef: g, setStockLink: S, customRequest: I }) => {
1359
- const { __: p } = u.useI18n(), b = d.useAppConfig(), j = d.useIsStandalone(), y = u.useNotification(), [M, v] = (0, o.useState)(null), [k, R] = (0, o.useState)(!1), [T, H] = (0, o.useState)(25), [U] = z.useLazyGetSearchGifQuery(), D = (0, o.useCallback)((a) => a instanceof Error || typeof a?.message == "string" && a.message ? a.message : typeof a?.error?.message == "string" && a.error.message ? a.error.message : p("Failed to load GIFs through the configured proxy chain."), [p]), F = (0, o.useCallback)((a) => {
1360
- y.error({
1370
+ }, Nt = ({ setNewLink: r, setCurrentImageLink: e, setModalHeight: n, setModalWidth: t, setImageGifList: i, imageGifList: l, currentReqGif: h, setCurrentReqGif: C, inputRef: p, setStockLink: b, customRequest: j }) => {
1371
+ const { __: m } = d.useI18n(), v = f.useAppConfig(), A = f.useIsStandalone(), w = d.useNotification(), [T, g] = (0, o.useState)(null), [L, E] = (0, o.useState)(!1), [F, K] = (0, o.useState)(25), [k] = H.useLazyGetSearchGifQuery(), B = (0, o.useCallback)((a) => a instanceof Error || typeof a?.message == "string" && a.message ? a.message : typeof a?.error?.message == "string" && a.error.message ? a.error.message : m("Failed to load GIFs through the configured proxy chain."), [m]), G = (0, o.useCallback)((a) => {
1372
+ w.error({
1361
1373
  id: "STOCK_GIFS_SEARCH_FAILED",
1362
- title: p("Failed to load GIFs"),
1363
- description: D(a)
1374
+ title: m("Failed to load GIFs"),
1375
+ description: B(a)
1364
1376
  });
1365
1377
  }, [
1366
- p,
1367
- D,
1368
- y
1378
+ m,
1379
+ B,
1380
+ w
1369
1381
  ]), Z = async () => {
1370
- k || (R(!0), U({
1382
+ L || (E(!0), k({
1371
1383
  query: h,
1372
- page: T
1384
+ page: F
1373
1385
  }).then((a) => {
1374
1386
  if (a?.error) {
1375
- F(a.error), R(!1);
1387
+ G(a.error), E(!1);
1376
1388
  return;
1377
1389
  }
1378
- i((m) => [...m, ...a.data.data]), R(!1), H((m) => m + 25);
1390
+ i((y) => [...y, ...a.data.data]), E(!1), K((y) => y + 25);
1379
1391
  }).catch(() => {
1380
- R(!1);
1392
+ E(!1);
1381
1393
  }));
1382
- }, G = async () => {
1383
- const a = await U({
1394
+ }, O = async () => {
1395
+ const a = await k({
1384
1396
  query: h,
1385
1397
  page: 0
1386
1398
  });
1387
1399
  if (a?.error) {
1388
- F(a.error), i([]);
1400
+ G(a.error), i([]);
1389
1401
  return;
1390
1402
  }
1391
1403
  a?.data?.data?.length > 0 && (i(a.data.data), setTimeout(() => {
1392
- r("84vh"), t(1060);
1404
+ n("84vh"), t(1060);
1393
1405
  }, 0));
1394
- }, E = (a, m) => {
1395
- v(m), setTimeout(() => {
1396
- v(null);
1397
- }, 2e3), S(`${a}`), e(`${a}`), I(`${a}`);
1398
- }, L = { default: 3 }, O = (0, o.useCallback)((a) => d.getProxiedUrl(a, {
1399
- config: b,
1400
- standalone: j,
1406
+ }, M = (a, y) => {
1407
+ g(y), setTimeout(() => {
1408
+ g(null);
1409
+ }, 2e3), b(`${a}`), e(`${a}`), j(`${a}`);
1410
+ }, R = { default: 3 }, S = (0, o.useCallback)((a) => f.getProxiedUrl(a, {
1411
+ config: v,
1412
+ standalone: A,
1401
1413
  resourceType: "generic",
1402
1414
  intent: "display"
1403
- }), [b, j]), { getDisplaySrc: x, handleLoad: Y, handleError: W } = it({
1415
+ }), [v, A]), { getDisplaySrc: z, handleLoad: D, handleError: _ } = rt({
1404
1416
  items: l,
1405
1417
  getItemId: (0, o.useCallback)((a) => a.id, []),
1406
1418
  getRequestUrl: (0, o.useCallback)((a) => a.images.downsized.url, []),
1407
- createController: O
1408
- }), X = (a) => (m) => {
1409
- Y(a), m.target.parentNode.classList.add("loaded");
1410
- }, _ = (a) => () => {
1411
- W(a);
1419
+ createController: S
1420
+ }), X = (a) => (y) => {
1421
+ D(a), y.target.parentNode.classList.add("loaded");
1422
+ }, Y = (a) => () => {
1423
+ _(a);
1412
1424
  };
1413
1425
  return (0, s.jsxs)("div", {
1414
1426
  className: "stock-tab",
1415
- children: [(0, s.jsxs)(u.Form, {
1416
- onValuesChange: G,
1427
+ children: [(0, s.jsxs)(d.Form, {
1428
+ onValuesChange: O,
1417
1429
  className: l.length > 0 ? "serach-results" : "",
1418
- children: [(0, s.jsx)(u.Row, {
1430
+ children: [(0, s.jsx)(d.Row, {
1419
1431
  gutter: 24,
1420
- children: (0, s.jsx)(u.Col, {
1432
+ children: (0, s.jsx)(d.Col, {
1421
1433
  span: l.length > 0 ? "" : 24,
1422
- children: (0, s.jsx)(u.Form.Item, {
1434
+ children: (0, s.jsx)(d.Form.Item, {
1423
1435
  className: "stock-search-input",
1424
- children: (0, s.jsx)(u.SearchInput, {
1425
- onSearch: G,
1436
+ children: (0, s.jsx)(d.SearchInput, {
1437
+ onSearch: O,
1426
1438
  allowClear: !0,
1427
1439
  size: l.length > 0 ? "medium" : "large",
1428
- placeholder: p("Search GIFs"),
1440
+ placeholder: m("Search GIFs"),
1429
1441
  value: h.keywords,
1430
- onChange: (a) => C((m) => ({
1431
- ...m,
1442
+ onChange: (a) => C((y) => ({
1443
+ ...y,
1432
1444
  keywords: a.target.value
1433
1445
  })),
1434
- ref: g,
1446
+ ref: p,
1435
1447
  spellCheck: "false",
1436
1448
  enterButton: !1
1437
1449
  })
@@ -1460,353 +1472,356 @@ Select the appropriate plan to fulfil more requests`),
1460
1472
  lineHeight: "0",
1461
1473
  boxSizing: "unset"
1462
1474
  },
1463
- children: (0, s.jsx)(ot, {
1475
+ children: (0, s.jsx)(et, {
1464
1476
  dataLength: l && l.length,
1465
1477
  next: Z,
1466
1478
  hasMore: l,
1467
- endMessage: (0, s.jsxs)(u.Divider, {
1479
+ endMessage: (0, s.jsxs)(d.Divider, {
1468
1480
  plain: !0,
1469
- children: [p("That`s all we could find."), " 🤐"]
1481
+ children: [m("That`s all we could find."), " 🤐"]
1470
1482
  }),
1471
1483
  scrollableTarget: "scrollableDiv",
1472
1484
  style: { overflow: "visible" },
1473
- loader: (0, s.jsx)(u.Spin, { size: "small" }),
1474
- children: (0, s.jsx)(We, {
1475
- breakpointCols: L,
1485
+ loader: (0, s.jsx)(d.Spin, { size: "small" }),
1486
+ children: (0, s.jsx)(Ne, {
1487
+ breakpointCols: R,
1476
1488
  className: "my-masonry-grid",
1477
1489
  columnClassName: "my-masonry-grid_column",
1478
- children: l.map((a, m) => (0, s.jsxs)("div", {
1490
+ children: l.map((a, y) => (0, s.jsxs)("div", {
1479
1491
  className: "list-item",
1480
- onClick: () => E(a.images.downsized.url, a.id),
1492
+ onClick: () => M(a.images.downsized.url, a.id),
1481
1493
  children: [
1482
1494
  (0, s.jsx)("img", {
1483
- className: M === a.id ? "loaded-image" : "",
1495
+ className: T === a.id ? "loaded-image" : "",
1484
1496
  width: "322px",
1485
- src: x(a),
1497
+ src: z(a),
1486
1498
  alt: a.title,
1487
1499
  onLoad: X(a),
1488
- onError: _(a)
1500
+ onError: Y(a)
1489
1501
  }),
1490
1502
  (0, s.jsx)("a", {
1491
1503
  rel: "noreferrer",
1492
1504
  href: "https://giphy.com/",
1493
1505
  target: "_blank",
1494
- onClick: (K) => K.stopPropagation(),
1506
+ onClick: (W) => W.stopPropagation(),
1495
1507
  children: (0, s.jsx)("div", {
1496
1508
  className: "overlay-image",
1497
1509
  style: { backgroundImage: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAkCAYAAAB/up84AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABSBJREFUeNrsWjFv2zoQVoMW8BZ18xaN3qLRW9QtW9OtW92to98vaPoP3K1b1S1b3c2jvWlUNm3lw1s8Mpu3PAo4Iocr70jKlp0COuCQlpKPx/t43x1pv3h8fEwGeT5yNoTgeclLZvza6NgxXoNaGRktjE6MpjC2NVqh92bwt4HxBI1ro0s0dgN2tvD5a8a/9vkq0M+xYKdG81A7Gp6pyBjZddrnO6N36Hkbqyn8u4L3vYC0hjLHeAbPVhC4TwAK/ewNvLsEhyxgFXLK2l/D4tvnOVrUiPEh1k/JjvLYyWENdeTcKazBBr6AdY4AqBTmbkIzhO4gvMumYLxAYKzgPTvhBBajYNwCksHYhOyYiow1KONaKYlfO8bPEWyGEfi5Iu+Vjizg7EzB3xvwWTMxWkHG4mDnMF6BnSnYncLzHWGG4BqiwZkKQMC7I0cOVTCJhvRUKNgNCmCOxhNmrBEWzwGi0Y6rIihbsnOH/JgE2hshKrLZv4Px9yhj1twafRlid/UIGWvlFdlVLirIkIM12nETGLeO2tTPECBUZuT/a7JBMpSxUybYLjulUCN2iEpHQoyuGWZJUCa8R/VGSZvGB0iOdjAO9n8EtC2zUxICSIoW0ICTmA53DCDKQzWZg89XAXZ2B2iMavBnjDKpBX6B1tnAM5aqQgGhnU2D6GmHuqw7AkaOPmP/bsHpFC1kTLqVhglS6fFNgX1MCXUHO1zR1h5AFOoSc1jjmKx/An/1PoBQasBSoZZ3hpyaOrg0IW2sRkG8JsU8CaCaLckAhfi6AG0cmeuzkyMQMtL+SiySkY3oA/EgGeICK0UOZYQKVsQpDAjm2BpsaAGQLMKnMdok3yLtpKS70yT7OUBcm7UTHb5grk5y1Csrj40MqUbUpgW7NXo+RunckODkQvdXM37iwm7b1VA7lAaVB4jUUZOUIzNxfOougAwy3GUN0qWG2IJJ09V2NcvIFE8c54nQelEHFM6C6chUhI+WZjjffDQkrenPhqmlrAC9Naof/aLhXZeNNfMZOk+MtPOVRjNmTpfcCut0+biGZ3PBj1ywWTOfqV3v+yjLFuDPRs8Ddu05vLtmsuHQ0s73wehvR0t7aGkPevfCM5fcGr0MbOW9NSSFwF52cP5KcLIv+X4EUGbCemcOqpoz73/haE4CZNkRjAR20vwENXHRc2bWEMyQuUuGVe4hc6K6rBmg7pKN0XdGX7dts9E3Rr8afUATFl1PqgLAG6T3AoX1nSVtMP9l5r5FVyiu+D14/YssRHOheGVQYNMeinrhsMcV2WVPRR1rIRT4QmiA5r4G6oxp0y6ZzFh4LvhmB84MHz1xta9vWQMrcFR/3iF+7DmEu2YoyTshRbuMvGE9hnwGPQR1tdR04aCueKrqAIgiu/AqcCf1JXPhfuoYosGHn4Hgqa6AnCK4IfSkCa1eCJRxLGnn+mX0rfDOJok4AsQAUpwQlND2++HIgNiOVO1LVRIgtXDPs0bpunEU08vktHLMpoJS1/d9qEo6h6gAzq7RRaPV+QmBeICzUUh2fIHzk0s3HedXwkEy2ReQmjn4XDzDjqkN4D/J04/y/np5KbSrrtbwAyx+kTxdf9tfpvSZIW9O3FScHJAF8PEFc5F2lQzSi5wJheoG3U/t0xYOcgBAcOHuAkr7mY9ditoAiCz2q8uvEcD8gJpSDuGNl5hfnaTJ0/fpheMUr4CitHCO6fqdesj359xh1tWiqggfdUCmcz9ZivZ7+BnQM5P/BRgABx8sJWqTxoYAAAAASUVORK5CYII=)" }
1498
1510
  })
1499
1511
  }),
1500
- M === a.id && (0, s.jsx)(u.Spin, {
1512
+ T === a.id && (0, s.jsx)(d.Spin, {
1501
1513
  className: "ant-spin",
1502
1514
  size: "small"
1503
1515
  })
1504
1516
  ]
1505
- }, a.id + m))
1517
+ }, a.id + y))
1506
1518
  })
1507
1519
  })
1508
1520
  })
1509
1521
  })]
1510
1522
  });
1511
1523
  };
1512
- function Ft(n) {
1513
- if (!(n == null || n === "")) return n;
1524
+ function Ft(r) {
1525
+ if (!(r == null || r === "")) return r;
1514
1526
  }
1515
- async function Gt(n, e) {
1516
- if (n) {
1517
- if (n.url) return n.url;
1518
- if (typeof e.getFileById == "function" && n.id) {
1519
- const r = await e.getFileById(n.id);
1520
- if (r?.url) return r.url;
1521
- if (r?.thumbnailUrl) return r.thumbnailUrl;
1522
- if (r?.thumbnail) return r.thumbnail;
1527
+ async function Gt(r, e) {
1528
+ if (r) {
1529
+ if (r.url) return r.url;
1530
+ if (typeof e.getFileById == "function" && r.id) {
1531
+ const n = await e.getFileById(r.id);
1532
+ if (n?.url) return n.url;
1533
+ if (n?.thumbnailUrl) return n.thumbnailUrl;
1534
+ if (n?.thumbnail) return n.thumbnail;
1523
1535
  }
1524
- if (typeof e.getFileUrl == "function" && n.folderId !== void 0 && n.name) {
1525
- const r = await e.getFileUrl(n.folderId || "", n.name);
1526
- if (r) return r;
1536
+ if (typeof e.getFileUrl == "function" && r.folderId !== void 0 && r.name) {
1537
+ const n = await e.getFileUrl(r.folderId || "", r.name);
1538
+ if (n) return n;
1527
1539
  }
1528
- if (typeof e.getUrl == "function" && n.name) {
1529
- const r = await e.getUrl(n);
1530
- if (r) return r;
1540
+ if (typeof e.getUrl == "function" && r.name) {
1541
+ const n = await e.getUrl(r);
1542
+ if (n) return n;
1531
1543
  }
1532
- return n.thumbnail || n.thumbnailUrl;
1544
+ return r.thumbnail || r.thumbnailUrl;
1533
1545
  }
1534
1546
  }
1535
- function zt(n) {
1536
- if (!(!n?.success || !Array.isArray(n.detailed))) return n.detailed.find((e) => e?.success && e.data)?.data;
1547
+ function zt(r) {
1548
+ if (!(!r?.success || !Array.isArray(r.detailed))) return r.detailed.find((e) => e?.success && e.data)?.data;
1537
1549
  }
1538
- function Ht(n, e, r) {
1539
- if (n) return {
1540
- id: n.id,
1541
- name: n.name || e.name,
1542
- size: n.size ?? e.size,
1543
- type: n.type || e.type,
1544
- folderId: n.folderId ?? r ?? "",
1545
- url: n.url,
1546
- thumbnail: n.thumbnail,
1547
- thumbnailUrl: n.thumbnailUrl,
1548
- date: n.date,
1549
- dimensions: n.dimensions,
1550
- aspectRatio: n.aspectRatio,
1551
- extension: n.extension,
1552
- selected: n.selected,
1553
- isFolder: n.isFolder,
1554
- lastEdited: n.lastEdited,
1555
- childrenCount: n.childrenCount
1550
+ function Ht(r, e, n) {
1551
+ if (r) return {
1552
+ id: r.id,
1553
+ name: r.name || e.name,
1554
+ size: r.size ?? e.size,
1555
+ type: r.type || e.type,
1556
+ folderId: r.folderId ?? n ?? "",
1557
+ url: r.url,
1558
+ thumbnail: r.thumbnail,
1559
+ thumbnailUrl: r.thumbnailUrl,
1560
+ date: r.date,
1561
+ dimensions: r.dimensions,
1562
+ aspectRatio: r.aspectRatio,
1563
+ extension: r.extension,
1564
+ selected: r.selected,
1565
+ isFolder: r.isFolder,
1566
+ lastEdited: r.lastEdited,
1567
+ childrenCount: r.childrenCount
1556
1568
  };
1557
1569
  }
1558
- async function Wt(n, e, r) {
1570
+ async function Kt(r, e, n) {
1559
1571
  if (!e) return;
1560
- const t = Ft(r ?? e.rootId);
1572
+ const t = Ft(n ?? e.rootId);
1561
1573
  let i;
1562
1574
  typeof e.uploadFiles == "function" ? i = zt(await e.uploadFiles({
1563
1575
  folderId: t,
1564
1576
  items: [{
1565
- name: n.name,
1566
- size: n.size,
1567
- type: n.type,
1577
+ name: r.name,
1578
+ size: r.size,
1579
+ type: r.type,
1568
1580
  folderId: t,
1569
- data: n
1581
+ data: r
1570
1582
  }]
1571
1583
  })) : typeof e.uploadFile == "function" && (i = Ht(await e.uploadFile({
1572
- name: n.name,
1573
- size: n.size,
1574
- type: n.type,
1584
+ name: r.name,
1585
+ size: r.size,
1586
+ type: r.type,
1575
1587
  folderId: t,
1576
- data: n
1577
- }), n, t));
1588
+ data: r
1589
+ }), r, t));
1578
1590
  const l = await Gt(i, e);
1579
1591
  return l ? {
1580
1592
  item: i,
1581
1593
  url: l
1582
1594
  } : void 0;
1583
1595
  }
1584
- var ct = "IMG", ut = "BACKGROUND", Kt = "GALLERY", ve = "EDITOR", oe = "UPLOAD", Ye = "STOCK", _e = "GIF", Ve = "AI", { Dragger: Yt } = u.Upload, _t = (n, e = "image") => {
1596
+ var st = "IMG", ot = "BACKGROUND", Wt = "GALLERY", he = "EDITOR", oe = "UPLOAD", Ge = "STOCK", ze = "GIF", He = "AI", _t = { mode: "select" }, Yt = { mode: "save" }, { Dragger: Vt } = d.Upload, Qt = (r, e = "image") => {
1585
1597
  try {
1586
- const r = new URL(n).pathname.split("/").pop();
1587
- return r && decodeURIComponent(r) || e;
1598
+ const n = new URL(r).pathname.split("/").pop();
1599
+ return n && decodeURIComponent(n) || e;
1588
1600
  } catch {
1589
1601
  return e;
1590
1602
  }
1591
- }, Se = q.normalizeImageFormatForDisplay, Vt = (n, e) => {
1592
- const r = Se(e);
1593
- return !r || n.includes(".") ? n : `${n}.${r}`;
1594
- }, Qt = (n, e) => new File([n], Vt(_t(e), n.type), { type: n.type || "application/octet-stream" }), dt = ({ dataProvider: n }) => {
1595
- const e = d.useAppConfig(), r = d.useIsStandalone(), { __: t } = u.useI18n(), i = d.useDispatch(), { projectId: l } = (0, Ge.useParams)(), [h] = z.useLazyGetImageInfoQuery(), { modal: C } = u.App.useApp(), g = u.useNotification(), S = d.useSelector(d.selectedIsUserPaySmth), I = d.useSelector(d.selectedCurrentUser), p = d.useSelector(z.selectActiveModal), { request: b, resolveImagePicker: j } = B.useImagePicker(), [y, M] = (0, o.useState)(""), [v, k] = (0, o.useState)(""), [R, T] = (0, o.useState)(""), [H, U] = (0, o.useState)(""), [D, F] = (0, o.useState)(oe), [Z, G] = (0, o.useState)({
1603
+ }, be = q.normalizeImageFormatForDisplay, qt = (r, e) => {
1604
+ const n = be(e);
1605
+ return !n || r.includes(".") ? r : `${r}.${n}`;
1606
+ }, Zt = (r, e) => new File([r], qt(Qt(e), r.type), { type: r.type || "application/octet-stream" }), at = ({ dataProvider: r }) => {
1607
+ const e = f.useAppConfig(), n = f.useIsStandalone(), { __: t } = d.useI18n(), i = f.useDispatch(), { projectId: l } = (0, Me.useParams)(), [h] = H.useLazyGetImageInfoQuery(), { modal: C } = d.App.useApp(), p = d.useNotification(), b = f.useSelector(f.selectedIsUserPaySmth), j = f.useSelector(f.selectedCurrentUser), m = f.useSelector(H.selectActiveModal), { request: v, resolveImagePicker: A } = U.useImagePicker(), [w, T] = (0, o.useState)(""), [g, L] = (0, o.useState)(""), [E, F] = (0, o.useState)(""), [K, k] = (0, o.useState)(""), [B, G] = (0, o.useState)(oe), [Z, O] = (0, o.useState)({
1596
1608
  width: "",
1597
1609
  height: "",
1598
1610
  size: "",
1599
1611
  format: ""
1600
- }), [E, L] = (0, o.useState)("success"), [O, x] = (0, o.useState)(!1), Y = o.default.useRef(null), W = o.default.useRef(null), X = o.default.useRef(null), _ = o.default.useRef(null), a = o.default.useRef(null), m = o.default.useRef(null), K = o.default.useRef(null), pe = o.default.useRef(null), $ = o.default.useRef(null), [he, P] = (0, o.useState)("auto"), [J, te] = (0, o.useState)(572), [Ie, De] = (0, o.useState)(!1), [ue, be] = (0, o.useState)({
1612
+ }), [M, R] = (0, o.useState)("success"), [S, z] = (0, o.useState)(!1), D = o.default.useRef(null), _ = o.default.useRef(null), X = o.default.useRef(null), Y = o.default.useRef(null), a = o.default.useRef(null), y = o.default.useRef(null), W = o.default.useRef(null), ue = o.default.useRef(null), $ = o.default.useRef(null), [de, P] = (0, o.useState)("auto"), [J, te] = (0, o.useState)(572), [Ae, Re] = (0, o.useState)(!1), [ie, me] = (0, o.useState)({
1601
1613
  keywords: "",
1602
1614
  color: "",
1603
1615
  orientation: ""
1604
- }), [w, re] = (0, o.useState)({ keywords: "" }), [Ee, Te] = (0, o.useState)([]), [Ce, ae] = (0, o.useState)([]), [Ue, Be] = (0, o.useState)([]), [me, ft] = (0, o.useState)(!1), [pt, Qe] = (0, o.useState)(""), [qt, xe] = (0, o.useState)(!1), [Zt, Me] = (0, o.useState)(0), qe = d.useSelector(d.selectProject), ht = qe?.id !== void 0 ? String(qe.id) : l || "", mt = d.useEventEmitter(d.events.UPLOAD_EVENT_ID), je = o.default.useRef(q.createImageUrlBlobResolver()), Ze = o.default.useRef(""), ge = o.default.useRef(0), ie = o.default.useRef(""), [Xt, Xe] = (0, o.useState)(""), [Jt, Je] = (0, o.useState)(""), le = (0, o.useCallback)(() => {
1605
- ie.current && (URL.revokeObjectURL(ie.current), ie.current = ""), Xe("");
1606
- }, []), ne = (0, o.useCallback)(() => {
1607
- Je("");
1616
+ }), [I, ne] = (0, o.useState)({ keywords: "" }), [it, lt] = (0, o.useState)([]), [ct, ge] = (0, o.useState)([]), [ut, Xt] = (0, o.useState)([]), [dt, ft] = (0, o.useState)(!1), [pt, Ke] = (0, o.useState)(""), [Jt, Se] = (0, o.useState)(!1), [$t, Le] = (0, o.useState)(0), We = f.useSelector(f.selectProject), ht = We?.id !== void 0 ? String(We.id) : l || "", mt = f.useEventEmitter(f.events.UPLOAD_EVENT_ID), Ie = o.default.useRef(q.createImageUrlBlobResolver()), _e = o.default.useRef(""), fe = o.default.useRef(0), ye = o.default.useRef(""), [er, gt] = (0, o.useState)(""), [tr, yt] = (0, o.useState)(null), [rr, Ye] = (0, o.useState)(""), ke = (0, o.useCallback)((c) => {
1617
+ if (!(c instanceof Blob)) return;
1618
+ ye.current && URL.revokeObjectURL(ye.current);
1619
+ const u = URL.createObjectURL(c);
1620
+ ye.current = u, gt(u), yt(c);
1621
+ }, []), ae = (0, o.useCallback)(() => {
1622
+ ye.current && (URL.revokeObjectURL(ye.current), ye.current = ""), gt(""), yt(null);
1623
+ }, []), re = (0, o.useCallback)(() => {
1624
+ Ye("");
1608
1625
  }, []);
1609
- let de = !(S || I.id?.toString() !== qe?.members?.owner.ID);
1610
- const $t = (c) => {
1611
- k(c.target.value);
1612
- }, Pe = (0, o.useCallback)((c, f, A = t("The image could not be uploaded.")) => {
1613
- const N = f instanceof Error ? f.message : A;
1614
- g.error({
1626
+ let le = !(b || j.id?.toString() !== We?.members?.owner.ID);
1627
+ const nr = (c) => {
1628
+ L(c.target.value);
1629
+ }, De = (0, o.useCallback)((c, u, x = t("The image could not be uploaded.")) => {
1630
+ const N = u instanceof Error ? u.message : x;
1631
+ p.error({
1615
1632
  id: "IMAGE_UPLOAD_ERROR",
1616
1633
  data: c,
1617
1634
  title: t("Upload failed"),
1618
1635
  description: N
1619
1636
  });
1620
- }, [t, g]), en = (0, o.useCallback)(async (c) => B.pickUploadImageUrlFromFireResults(await mt.fire({
1637
+ }, [t, p]), sr = (0, o.useCallback)(async (c) => U.pickUploadImageUrlFromFireResults(await mt.fire({
1621
1638
  file: c,
1622
1639
  project: ht
1623
- })), [ht, mt]), Oe = q.useImageBlobFetch(), Ne = async (c) => {
1640
+ })), [ht, mt]), xe = q.useImageBlobFetch(), Te = async (c) => {
1624
1641
  if (c) try {
1625
- const f = await tn(c);
1626
- f && et(f) ? await Le({ file: f }) : f || Pe({ url: c }, null, t("Failed to download image from URL."));
1627
- } catch (f) {
1628
- Pe({ url: c }, f, t("Failed to process image URL."));
1642
+ const u = await or(c);
1643
+ u && Qe(u) ? await je({ file: u }) : u || De({ url: c }, null, t("Failed to download image from URL."));
1644
+ } catch (u) {
1645
+ De({ url: c }, u, t("Failed to process image URL."));
1629
1646
  }
1630
- }, gt = o.default.useRef(Ne);
1631
- gt.current = Ne, o.default.useEffect(() => {
1632
- if (D !== oe || !H) return;
1633
- const c = v.trim();
1647
+ }, vt = o.default.useRef(Te);
1648
+ vt.current = Te, o.default.useEffect(() => {
1649
+ if (B !== oe || !K) return;
1650
+ const c = g.trim();
1634
1651
  if (!c || !c.toLowerCase().startsWith("http")) return;
1635
- const f = setTimeout(() => {
1636
- gt.current(c);
1652
+ const u = setTimeout(() => {
1653
+ vt.current(c);
1637
1654
  }, 1e3);
1638
1655
  return () => {
1639
- clearTimeout(f);
1656
+ clearTimeout(u);
1640
1657
  };
1641
1658
  }, [
1642
- v,
1643
- D,
1644
- H
1659
+ g,
1660
+ B,
1661
+ K
1645
1662
  ]);
1646
- const tn = async (c) => {
1663
+ const or = async (c) => {
1647
1664
  try {
1648
- const f = q.canonicalImageUrlKey(c);
1649
- return Qt(await je.current.resolve(f, void 0, Oe), f);
1665
+ const u = q.canonicalImageUrlKey(c);
1666
+ return Zt(await Ie.current.resolve(u, void 0, xe), u);
1650
1667
  } catch {}
1651
1668
  };
1652
1669
  document.onpaste = function(c) {
1653
- const f = c.clipboardData?.items?.[0];
1654
- if (D === oe && H) {
1655
- if (f?.type?.indexOf("image") === 0 && e.imageCenterLocalUploadEnabled !== !1) {
1656
- const N = f.getAsFile();
1657
- et(N);
1670
+ const u = c.clipboardData?.items?.[0];
1671
+ if (B === oe && K) {
1672
+ if (u?.type?.indexOf("image") === 0 && e.imageCenterLocalUploadEnabled !== !1) {
1673
+ const N = u.getAsFile();
1674
+ Qe(N);
1658
1675
  const Q = { file: N };
1659
- k(""), Le(Q);
1676
+ L(""), je(Q);
1660
1677
  return;
1661
1678
  }
1662
- const A = c.clipboardData?.getData("text/plain");
1663
- if (A && A.trim().toLowerCase().startsWith("http")) {
1664
- c.preventDefault(), c.stopPropagation(), k(A.trim());
1679
+ const x = c.clipboardData?.getData("text/plain");
1680
+ if (x && x.trim().toLowerCase().startsWith("http")) {
1681
+ c.preventDefault(), c.stopPropagation(), L(x.trim());
1665
1682
  return;
1666
1683
  }
1667
- f?.type?.indexOf("text") === 0 && f.getAsString((N) => {
1668
- if (N.trim().toLowerCase().startsWith("http")) k(N.trim());
1684
+ u?.type?.indexOf("text") === 0 && u.getAsString((N) => {
1685
+ if (N.trim().toLowerCase().startsWith("http")) L(N.trim());
1669
1686
  else if (N.toString().slice(1, 5) === "meta") {
1670
1687
  const Q = N.toString().split("\"")[1];
1671
- Q && k(Q);
1688
+ Q && L(Q);
1672
1689
  }
1673
1690
  });
1674
1691
  }
1675
1692
  }, (0, o.useEffect)(() => {
1676
- const c = (f) => {
1677
- let A = null;
1678
- b?.kind === "background" ? (A = ut, U(ut)) : b?.kind === "img" && (U(ct), A = ct), b?.currentUrl && A && (M(b.currentUrl), F(f));
1693
+ const c = (u) => {
1694
+ let x = null;
1695
+ v?.kind === "background" ? (x = ot, k(ot)) : v?.kind === "img" && (k(st), x = st), v?.currentUrl && x && (T(v.currentUrl), G(u));
1679
1696
  };
1680
- p === d.MODALS.UPLOAD_IMAGE_MODAL || p === d.MODALS.UPLOAD_BACKGROUND_MODAL ? c(ve) : p === d.MODALS.UPLOAD_IMAGE_MODAL_AI || p === d.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (de ? (xe(!0), Me(2)) : c(Ve), setTimeout(() => $.current?.focus({ cursor: "start" }), 100)) : p === d.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || p === d.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(oe), setTimeout(() => m.current?.focus({ cursor: "start" }), 100)) : p === d.MODALS.UPLOAD_IMAGE_MODAL_STOCK || p === d.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (de ? (xe(!0), Me(3)) : c(Ye), setTimeout(() => pe.current?.focus({ cursor: "start" }), 100)) : p === d.MODALS.UPLOAD_IMAGE_MODAL_GIF || p === d.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (de ? (xe(!0), Me(3)) : c(_e), setTimeout(() => K.current?.focus({ cursor: "start" }), 100)) : p === d.MODALS.UPLOAD_IMAGE_MODAL_EDIT || p === d.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (de ? (xe(!0), Me(5)) : c(ve), i(z.openSecondModal(d.MODALS.IMAGE_EDITOR_MODAL))) : U("");
1697
+ m === f.MODALS.UPLOAD_IMAGE_MODAL || m === f.MODALS.UPLOAD_BACKGROUND_MODAL ? c(he) : m === f.MODALS.UPLOAD_IMAGE_MODAL_AI || m === f.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (le ? (Se(!0), Le(2)) : c(He), setTimeout(() => $.current?.focus({ cursor: "start" }), 100)) : m === f.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || m === f.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(oe), setTimeout(() => y.current?.focus({ cursor: "start" }), 100)) : m === f.MODALS.UPLOAD_IMAGE_MODAL_STOCK || m === f.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (le ? (Se(!0), Le(3)) : c(Ge), setTimeout(() => ue.current?.focus({ cursor: "start" }), 100)) : m === f.MODALS.UPLOAD_IMAGE_MODAL_GIF || m === f.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (le ? (Se(!0), Le(3)) : c(ze), setTimeout(() => W.current?.focus({ cursor: "start" }), 100)) : m === f.MODALS.UPLOAD_IMAGE_MODAL_EDIT || m === f.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (le ? (Se(!0), Le(5)) : c(he), i(H.openSecondModal(f.MODALS.IMAGE_EDITOR_MODAL))) : k("");
1681
1698
  }, [
1682
- p,
1699
+ m,
1683
1700
  i,
1684
- de,
1685
- b
1701
+ le,
1702
+ v
1686
1703
  ]);
1687
- const $e = (0, o.useCallback)(({ url: c = y || "" }) => {
1688
- M(c), j({
1704
+ const Ve = (0, o.useCallback)(({ url: c = w || "", meta: u = _t }) => {
1705
+ T(c), A({
1689
1706
  url: c,
1690
- meta: { mode: "select" }
1707
+ meta: u
1691
1708
  }), setTimeout(() => {
1692
- ne(), le(), be({
1709
+ re(), ae(), me({
1693
1710
  keywords: "",
1694
1711
  color: "",
1695
1712
  orientation: ""
1696
- }), re({ keywords: "" }), ae([]), Te([]), U(""), Qe(""), ft(!1), T(""), k(""), F(oe);
1697
- }, 200), i(z.closeModal()), i(z.closeSecondModal());
1713
+ }), ne({ keywords: "" }), ge([]), lt([]), k(""), Ke(""), ft(!1), F(""), L(""), G(oe);
1714
+ }, 200), i(H.closeModal()), i(H.closeSecondModal());
1698
1715
  }, [
1699
- y,
1700
- ne,
1716
+ w,
1717
+ re,
1701
1718
  i,
1702
- j,
1703
- le
1704
- ]), yt = (0, o.useCallback)((c, f) => (P("auto"), x(!1), $e({ url: c }), g.success({
1719
+ A,
1720
+ ae
1721
+ ]), Ct = (0, o.useCallback)((c, u) => (P("auto"), z(!1), Ve({
1722
+ url: c,
1723
+ meta: Yt
1724
+ }), p.success({
1705
1725
  id: "IMAGE_UPLOAD_SUCCESS",
1706
- data: f,
1726
+ data: u,
1707
1727
  title: t("The image was successfully uploaded.")
1708
1728
  }), c), [
1709
1729
  t,
1710
- $e,
1711
- g
1730
+ Ve,
1731
+ p
1712
1732
  ]);
1713
1733
  (0, o.useEffect)(() => {
1714
- const c = v || R, f = q.canonicalImageUrlKey(c);
1715
- if (!c || !f) {
1716
- L(""), Ze.current = "", ne(), le(), je.current.invalidateAll();
1734
+ const c = g || E, u = q.canonicalImageUrlKey(c);
1735
+ if (!c || !u) {
1736
+ R(""), _e.current = "", re(), ae(), Ie.current.invalidateAll();
1717
1737
  return;
1718
1738
  }
1719
- const A = Ze.current;
1720
- A && A !== f && (je.current.abandonKey(A), ne(), le()), Ze.current = f;
1721
- const N = new AbortController(), Q = v ? 800 : 0, V = ++ge.current, tt = setTimeout(async () => {
1739
+ const x = _e.current;
1740
+ x && x !== u && (Ie.current.abandonKey(x), re(), ae()), _e.current = u;
1741
+ const N = new AbortController(), Q = g ? 800 : 0, V = ++fe.current, qe = setTimeout(async () => {
1722
1742
  try {
1723
- const ce = async () => {
1724
- const se = await je.current.resolve(f, N.signal, Oe);
1725
- if (V !== ge.current) return;
1726
- const { width: fe, height: on } = await q.getImageDimensionsFromBlob(se);
1727
- if (V !== ge.current) return;
1728
- G({
1729
- width: fe,
1730
- height: on,
1743
+ const ve = async () => {
1744
+ const se = await Ie.current.resolve(u, N.signal, xe);
1745
+ if (V !== fe.current) return;
1746
+ const { width: ce, height: cr } = await q.getImageDimensionsFromBlob(se);
1747
+ V === fe.current && (O({
1748
+ width: ce,
1749
+ height: cr,
1731
1750
  size: (se.size / 1024).toFixed(2),
1732
- format: Se(se.type)
1733
- }), ne(), ie.current && URL.revokeObjectURL(ie.current);
1734
- const vt = URL.createObjectURL(se);
1735
- ie.current = vt, Xe(vt);
1751
+ format: be(se.type)
1752
+ }), re(), ke(se));
1736
1753
  };
1737
- if (r) await ce();
1754
+ if (n) await ve();
1738
1755
  else {
1739
- const se = await q.resolveDataProviderPreview(n, f);
1740
- if (se?.previewUrl && V === ge.current) {
1741
- Je(se.previewUrl), le();
1756
+ const se = await q.resolveDataProviderPreview(r, u);
1757
+ if (se?.previewUrl && V === fe.current) {
1758
+ Ye(se.previewUrl), ae();
1742
1759
  try {
1743
- const { data: fe } = await h(f);
1744
- if (V !== ge.current) return;
1745
- fe ? G({
1746
- width: fe?.width,
1747
- height: fe?.height,
1748
- size: fe?.fileSize != null ? (fe.fileSize / 1024).toFixed(2) : "",
1749
- format: Se(fe?.format)
1750
- }) : await ce();
1760
+ const { data: ce } = await h(u);
1761
+ if (V !== fe.current) return;
1762
+ ce ? O({
1763
+ width: ce?.width,
1764
+ height: ce?.height,
1765
+ size: ce?.fileSize != null ? (ce.fileSize / 1024).toFixed(2) : "",
1766
+ format: be(ce?.format)
1767
+ }) : await ve();
1751
1768
  } catch {
1752
- await ce();
1769
+ await ve();
1753
1770
  }
1754
- } else await ce();
1771
+ } else await ve();
1755
1772
  }
1756
- if (V !== ge.current) return;
1757
- L("success"), M(c), te(572), setTimeout(() => {
1773
+ if (V !== fe.current) return;
1774
+ R("success"), T(c), te(572), setTimeout(() => {
1758
1775
  let se = 0;
1759
- W.current && (se = W.current.offsetHeight + 62), P(se);
1776
+ _.current && (se = _.current.offsetHeight + 62), P(se);
1760
1777
  }, 0);
1761
- } catch (ce) {
1762
- if (ce?.name === "AbortError" || N.signal.aborted || V !== ge.current) return;
1763
- ne(), le(), L("error");
1778
+ } catch (ve) {
1779
+ if (ve?.name === "AbortError" || N.signal.aborted || V !== fe.current) return;
1780
+ re(), ae(), R("error");
1764
1781
  }
1765
1782
  }, Q);
1766
1783
  return () => {
1767
- clearTimeout(tt), N.abort();
1784
+ clearTimeout(qe), N.abort();
1768
1785
  };
1769
1786
  }, [
1770
- v,
1771
- R,
1772
- r,
1773
- ne,
1774
- Oe,
1787
+ g,
1788
+ E,
1789
+ n,
1790
+ re,
1791
+ xe,
1775
1792
  h,
1776
- le,
1777
- n
1793
+ ae,
1794
+ r,
1795
+ ke
1778
1796
  ]), (0, o.useEffect)(() => {
1779
- if (!y || v || R) return;
1780
- const c = q.canonicalImageUrlKey(y), f = new AbortController();
1781
- let A = !1;
1797
+ if (!w || g || E) return;
1798
+ const c = q.canonicalImageUrlKey(w), u = new AbortController();
1799
+ let x = !1;
1782
1800
  const N = async () => {
1783
- const Q = await je.current.resolve(c, f.signal, Oe);
1784
- if (A) return;
1785
- const { width: V, height: tt } = await q.getImageDimensionsFromBlob(Q);
1786
- if (A) return;
1787
- ne(), ie.current && URL.revokeObjectURL(ie.current);
1788
- const ce = URL.createObjectURL(Q);
1789
- ie.current = ce, Xe(ce), G({
1801
+ const Q = await Ie.current.resolve(c, u.signal, xe);
1802
+ if (x) return;
1803
+ const { width: V, height: qe } = await q.getImageDimensionsFromBlob(Q);
1804
+ x || (re(), ke(Q), O({
1790
1805
  width: V,
1791
- height: tt,
1806
+ height: qe,
1792
1807
  size: (Q.size / 1024).toFixed(2),
1793
- format: Se(Q.type)
1794
- });
1808
+ format: be(Q.type)
1809
+ }));
1795
1810
  };
1796
1811
  return (async () => {
1797
1812
  try {
1798
- if (!r) {
1799
- const Q = await q.resolveDataProviderPreview(n, c);
1800
- if (Q?.previewUrl && !A) {
1801
- Je(Q.previewUrl), le();
1813
+ if (!n) {
1814
+ const Q = await q.resolveDataProviderPreview(r, c);
1815
+ if (Q?.previewUrl && !x) {
1816
+ Ye(Q.previewUrl), ae();
1802
1817
  try {
1803
1818
  const { data: V } = await h(c);
1804
- if (A) return;
1805
- V ? G({
1819
+ if (x) return;
1820
+ V ? O({
1806
1821
  width: V?.width,
1807
1822
  height: V?.height,
1808
1823
  size: V?.fileSize != null ? (V.fileSize / 1024).toFixed(2) : "",
1809
- format: Se(V?.format)
1824
+ format: be(V?.format)
1810
1825
  }) : await N();
1811
1826
  return;
1812
1827
  } catch {
@@ -1816,103 +1831,104 @@ Select the appropriate plan to fulfil more requests`),
1816
1831
  }
1817
1832
  await N();
1818
1833
  } catch {
1819
- A || ne();
1834
+ x || re();
1820
1835
  }
1821
1836
  })(), () => {
1822
- A = !0, f.abort();
1837
+ x = !0, u.abort();
1823
1838
  };
1824
1839
  }, [
1825
- r,
1826
- ne,
1827
- y,
1828
- Oe,
1829
- h,
1830
1840
  n,
1831
- v,
1832
- R
1841
+ re,
1842
+ w,
1843
+ xe,
1844
+ h,
1845
+ r,
1846
+ g,
1847
+ E,
1848
+ ke
1833
1849
  ]);
1834
- const nn = () => {
1835
- i(z.closeModal()), setTimeout(() => {
1836
- ne(), le(), M(""), k(""), ae([]), ae([]), be({
1850
+ const ar = () => {
1851
+ i(H.closeModal()), setTimeout(() => {
1852
+ re(), ae(), T(""), L(""), ge([]), ge([]), me({
1837
1853
  keywords: "",
1838
1854
  color: "",
1839
1855
  orientation: ""
1840
- }), re({ keywords: "" }), P("auto"), !me && Qe(""), te(572), F(oe);
1856
+ }), ne({ keywords: "" }), P("auto"), !dt && Ke(""), te(572), G(oe);
1841
1857
  }, 200);
1842
- }, rn = (c) => {
1843
- c === Kt ? C.success({
1858
+ }, ir = (c) => {
1859
+ c === Wt ? C.success({
1844
1860
  mask: { closable: !0 },
1845
1861
  centered: !0,
1846
1862
  title: t("Coming soon"),
1847
1863
  content: t("The feature is under development."),
1848
1864
  okText: t("Ok. I'll be waiting"),
1849
1865
  onOk: () => {}
1850
- }) : c === ve && y === "" ? C.warning({
1866
+ }) : c === he && w === "" ? C.warning({
1851
1867
  mask: { closable: !0 },
1852
1868
  centered: !0,
1853
1869
  title: t(""),
1854
1870
  content: t("To preview and edit the uploaded image"),
1855
1871
  okText: t("Upload Image"),
1856
1872
  onOk: () => {
1857
- F(oe);
1873
+ G(oe);
1858
1874
  }
1859
1875
  }) : (setTimeout(() => {
1860
- let f = 0, A = 0;
1861
- c === oe && Y.current ? (ue.keywords === "" && m.current?.focus({ cursor: "start" }), f = 300, A = 572) : c === ve && W.current ? (f = W.current.offsetHeight + 62, A = 572) : c === Ye && X.current ? (ue.keywords === "" && pe.current?.focus({ cursor: "start" }), f = 130, A = 572, Ce.length > 0 && (A = 1060, f = "84vh")) : c === _e && _.current ? (ue.keywords === "" && K.current?.focus({ cursor: "start" }), f = 130, A = 572, Ee.length > 0 && (A = 1060, f = "84vh")) : c === Ve && a.current && (pt === "" && Ue.length === 0 ? ($.current?.focus({ cursor: "start" }), f = 130) : f = a.current.offsetHeight + 82, A = 572), P(f), te(A);
1862
- }, 0), F(c));
1876
+ let u = 0, x = 0;
1877
+ c === oe && D.current ? (ie.keywords === "" && y.current?.focus({ cursor: "start" }), u = 300, x = 572) : c === he && _.current ? (u = _.current.offsetHeight + 62, x = 572) : c === Ge && X.current ? (ie.keywords === "" && ue.current?.focus({ cursor: "start" }), u = 130, x = 572, ct.length > 0 && (x = 1060, u = "84vh")) : c === ze && Y.current ? (ie.keywords === "" && W.current?.focus({ cursor: "start" }), u = 130, x = 572, it.length > 0 && (x = 1060, u = "84vh")) : c === He && a.current && (pt === "" && ut.length === 0 ? ($.current?.focus({ cursor: "start" }), u = 130) : u = a.current.offsetHeight + 82, x = 572), P(u), te(x);
1878
+ }, 0), G(c));
1863
1879
  };
1864
1880
  (0, o.useEffect)(() => {
1865
- ue.keywords === "" && (m?.current?.focus({ cursor: "start" }), ae([]), setTimeout(() => {
1881
+ ie.keywords === "" && (y?.current?.focus({ cursor: "start" }), ge([]), setTimeout(() => {
1866
1882
  P("auto"), te(572);
1867
1883
  }, 0));
1868
1884
  }, [
1869
- ue,
1870
- ae,
1885
+ ie,
1886
+ ge,
1871
1887
  P,
1872
1888
  te
1873
1889
  ]);
1874
- const et = (c) => {
1875
- const f = 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";
1876
- return f || g.error({
1890
+ const Qe = (c) => {
1891
+ 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";
1892
+ return u || p.error({
1877
1893
  id: "IMAGE_UPLOAD_WRONG_FORMAT",
1878
1894
  data: c,
1879
1895
  title: "Upload",
1880
1896
  description: "You can only upload JPG/JPEG/PNG/WEBP/GIF/SVG file!"
1881
- }), f;
1882
- }, Le = async ({ file: c }) => {
1897
+ }), u;
1898
+ }, je = async ({ file: c }) => {
1883
1899
  try {
1884
- De(!0);
1885
- const f = await q.prepareImageForEditorUpload(c, e), A = await en(f);
1886
- if (A) return yt(A, f), A;
1887
- const N = await Wt(f, n);
1888
- if (N?.url) return yt(N.url, f), N.url;
1889
- Pe(f, null);
1900
+ Re(!0);
1901
+ const u = await q.prepareImageForEditorUpload(c, e), x = await sr(u);
1902
+ if (x) return Ct(x, u), x;
1903
+ const N = await Kt(u, r);
1904
+ if (N?.url) return Ct(N.url, u), N.url;
1905
+ De(u, null);
1890
1906
  return;
1891
- } catch (f) {
1892
- Pe(c, f);
1907
+ } catch (u) {
1908
+ De(c, u);
1893
1909
  return;
1894
1910
  } finally {
1895
- De(!1);
1911
+ Re(!1);
1896
1912
  }
1897
- }, sn = (c) => Le({ file: c });
1898
- let Re = [{
1913
+ }, lr = (c) => je({ file: c });
1914
+ let Ee = [{
1899
1915
  label: t("Upload"),
1900
1916
  key: oe,
1901
1917
  children: (0, s.jsxs)("div", {
1902
- ref: Y,
1918
+ ref: D,
1903
1919
  style: { paddingBottom: 24 },
1904
- children: [e.imageCenterLocalUploadEnabled !== !1 && (0, s.jsxs)(Yt, {
1920
+ children: [e.imageCenterLocalUploadEnabled !== !1 && (0, s.jsxs)(Vt, {
1905
1921
  showUploadList: !1,
1906
1922
  name: "Image",
1907
- beforeUpload: et,
1908
- customRequest: Le,
1923
+ beforeUpload: Qe,
1924
+ customRequest: je,
1909
1925
  style: { marginBottom: 10 },
1910
1926
  multiple: !1,
1911
1927
  accept: "image/png, image/jpeg, image/jpg, image/webp, image/gif, image/svg+xml",
1912
1928
  children: [
1913
1929
  (0, s.jsx)("p", {
1914
1930
  className: "ant-upload-drag-icon",
1915
- children: (0, s.jsx)(B.EmIcons, { icon: "InboxOutlined" })
1931
+ children: (0, s.jsx)(U.EmIcons, { icon: "InboxOutlined" })
1916
1932
  }),
1917
1933
  (0, s.jsx)("p", {
1918
1934
  className: "ant-upload-text",
@@ -1923,124 +1939,125 @@ Select the appropriate plan to fulfil more requests`),
1923
1939
  children: t("Accepted formats: PNG, JPG, WEBP, SVG or GIF.")
1924
1940
  })
1925
1941
  ]
1926
- }), (0, s.jsx)(u.Form, {
1942
+ }), (0, s.jsx)(d.Form, {
1927
1943
  style: { padding: "0 2px 0 2px" },
1928
- children: (0, s.jsx)(u.Form.Item, {
1929
- validateStatus: E,
1930
- children: (0, s.jsx)(u.Input, {
1931
- ref: m,
1944
+ children: (0, s.jsx)(d.Form.Item, {
1945
+ validateStatus: M,
1946
+ children: (0, s.jsx)(d.Input, {
1947
+ ref: y,
1932
1948
  allowClear: !0,
1933
1949
  size: "large",
1934
1950
  placeholder: t("Paste image URL here"),
1935
- value: v,
1936
- onChange: $t,
1951
+ value: g,
1952
+ onChange: nr,
1937
1953
  spellCheck: "false"
1938
1954
  })
1939
1955
  })
1940
1956
  })]
1941
1957
  })
1942
1958
  }];
1943
- return e.imageCenterStockEnabled && !de && Re.push({
1959
+ return e.imageCenterStockEnabled && !le && Ee.push({
1944
1960
  label: t("Stock"),
1945
- key: Ye,
1961
+ key: Ge,
1946
1962
  children: (0, s.jsx)("div", {
1947
1963
  ref: X,
1948
1964
  style: { paddingBottom: 24 },
1949
- children: (0, s.jsx)(Ut, {
1950
- currentReq: ue,
1951
- setCurrentReq: be,
1952
- imageStockList: Ce,
1953
- setImageStockList: ae,
1965
+ children: (0, s.jsx)(Bt, {
1966
+ currentReq: ie,
1967
+ setCurrentReq: me,
1968
+ imageStockList: ct,
1969
+ setImageStockList: ge,
1954
1970
  setModalWidth: te,
1955
1971
  setModalHeight: P,
1956
- setStockLink: T,
1957
- setCurrentImageLink: M,
1958
- inputRef: pe,
1959
- customRequest: Ne
1972
+ setStockLink: F,
1973
+ setCurrentImageLink: T,
1974
+ inputRef: ue,
1975
+ customRequest: Te
1960
1976
  })
1961
1977
  })
1962
- }), e.imageCenterGifEnabled && !de && Re.push({
1978
+ }), e.imageCenterGifEnabled && !le && Ee.push({
1963
1979
  label: t("GIF"),
1964
- key: _e,
1980
+ key: ze,
1965
1981
  children: (0, s.jsx)("div", {
1966
- ref: _,
1982
+ ref: Y,
1967
1983
  style: { paddingBottom: 24 },
1968
1984
  children: (0, s.jsx)(Nt, {
1969
- currentReqGif: w,
1970
- setCurrentReqGif: re,
1971
- imageGifList: Ee,
1972
- setImageGifList: Te,
1985
+ currentReqGif: I,
1986
+ setCurrentReqGif: ne,
1987
+ imageGifList: it,
1988
+ setImageGifList: lt,
1973
1989
  setModalWidth: te,
1974
1990
  setModalHeight: P,
1975
- setStockLink: T,
1976
- setCurrentImageLink: M,
1977
- inputRef: K,
1978
- customRequest: Ne
1991
+ setStockLink: F,
1992
+ setCurrentImageLink: T,
1993
+ inputRef: W,
1994
+ customRequest: Te
1979
1995
  })
1980
1996
  })
1981
- }), e.elementAIimageEnabled && !de && Re.push({
1997
+ }), e.elementAIimageEnabled && !le && Ee.push({
1982
1998
  label: t("AI"),
1983
- key: Ve,
1999
+ key: He,
1984
2000
  children: (0, s.jsx)("div", {
1985
2001
  ref: a,
1986
2002
  style: { paddingBottom: 24 },
1987
2003
  children: (0, s.jsx)(Pt, {
1988
2004
  setModalHeight: P,
1989
- customRequest: Le,
2005
+ customRequest: je,
1990
2006
  aiImageRequest: pt,
1991
- setAiImageRequest: Qe,
1992
- imageAiList: Ue,
1993
- setImageAiList: Be,
1994
- isLoadingAi: me,
2007
+ setAiImageRequest: Ke,
2008
+ imageAiList: ut,
2009
+ setImageAiList: Xt,
2010
+ isLoadingAi: dt,
1995
2011
  setIsLoadingAi: ft,
1996
2012
  aiTabRef: a,
1997
2013
  inputAiRef: $,
1998
- isImageUploaded: O,
1999
- setIsImageUploaded: x
2014
+ isImageUploaded: S,
2015
+ setIsImageUploaded: z
2000
2016
  })
2001
2017
  })
2002
- }), e.imageCenterEditorEnabled && Re.push({
2018
+ }), e.imageCenterEditorEnabled && Ee.push({
2003
2019
  label: "",
2004
- key: ve,
2020
+ key: he,
2005
2021
  children: (0, s.jsx)("div", {
2006
- ref: W,
2007
- children: (0, s.jsx)(Ot, {
2008
- currentImageLink: y,
2009
- newLink: v,
2010
- previewDisplayUrl: Jt,
2011
- resolvedPreviewObjectUrl: Xt,
2022
+ ref: _,
2023
+ children: (0, s.jsx)(Et, {
2024
+ currentImageLink: w,
2025
+ newLink: g,
2026
+ previewDisplayUrl: rr,
2027
+ resolvedPreviewObjectUrl: er,
2028
+ resolvedPreviewBlob: tr,
2012
2029
  imageSize: Z,
2013
- onSave: sn,
2014
- uploadImageResultIsLoading: Ie || !1
2030
+ onSave: lr,
2031
+ uploadImageResultIsLoading: Ae || !1
2015
2032
  })
2016
2033
  })
2017
- }), (0, s.jsxs)(s.Fragment, { children: [(0, s.jsx)(u.Modal, {
2034
+ }), (0, s.jsxs)(s.Fragment, { children: [(0, s.jsx)(d.Modal, {
2018
2035
  width: J,
2019
2036
  className: "image-center",
2020
2037
  title: t("Image Center"),
2021
2038
  style: { minHeight: 390 },
2022
- open: !!H,
2023
- onOk: $e,
2024
- onCancel: nn,
2025
- footer: D === ve ? (0, s.jsx)(s.Fragment, {}) : null,
2026
- children: (0, s.jsx)(u.Spin, {
2027
- spinning: Ie,
2028
- children: (0, s.jsx)(u.Tabs, {
2029
- activeKey: D,
2030
- onChange: rn,
2031
- items: Re,
2039
+ open: !!K,
2040
+ onOk: Ve,
2041
+ onCancel: ar,
2042
+ footer: B === he ? (0, s.jsx)(s.Fragment, {}) : null,
2043
+ children: (0, s.jsx)(d.Spin, {
2044
+ spinning: Ae,
2045
+ children: (0, s.jsx)(d.Tabs, {
2046
+ activeKey: B,
2047
+ onChange: ir,
2048
+ items: Ee,
2032
2049
  className: "modal-tabs",
2033
2050
  style: {
2034
- height: he,
2051
+ height: de,
2035
2052
  minHeight: 130
2036
2053
  }
2037
2054
  })
2038
2055
  })
2039
- }), (0, s.jsx)(B.ModalToChangeConfigOnFree, {
2040
- open: qt,
2041
- onCancel: () => xe(!1),
2042
- initialSlide: Zt
2056
+ }), (0, s.jsx)(U.ModalToChangeConfigOnFree, {
2057
+ open: Jt,
2058
+ onCancel: () => Se(!1),
2059
+ initialSlide: $t
2043
2060
  })] });
2044
2061
  };
2045
- dt.propTypes = { dataProvider: Fe.default.object }, bt.default = dt;
2062
+ at.propTypes = { dataProvider: Be.default.object }, wt.default = at;
2046
2063
  });