useblocks 1.1.56 → 1.1.60

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 (31) hide show
  1. package/iframe/js/amp.BP7EklKo.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/{4d493eba.js → 161d1254.js} +268 -257
  9. package/static/core/{4dadf572.js → 40f73dfb.js} +3 -3
  10. package/static/core/{289ba982.js → 43c3f160.js} +3270 -3187
  11. package/static/core/{58c4b8d7.js → 4c39852e.js} +5 -5
  12. package/static/core/{a4c19e27.js → 4e75b331.js} +4 -4
  13. package/static/core/{87969347.js → 53463a60.js} +675 -677
  14. package/static/core/{eb23332a.js → 7a15fa8b.js} +3 -3
  15. package/static/core/{12a9aa4e.js → 8815eb5b.js} +11514 -11159
  16. package/static/core/{4a5f1756.js → ba6c356e.js} +104 -104
  17. package/static/core/{b9bb2c5f.js → c9e59b34.js} +4634 -4271
  18. package/static/core/{fa354fb5.js → d9baa55e.js} +7 -7
  19. package/static/core/{bf446743.js → dbf19c2e.js} +248 -198
  20. package/static/core/{988589a5.js → f953827c.js} +7 -7
  21. package/static/esm/2474de05.js +131 -0
  22. package/static/esm/{3cde7cb6.js → 53b688bd.js} +48 -48
  23. package/two_step_headless_plugin.html +1 -1
  24. package/useblocks-core.f6bb8947.js +673 -0
  25. package/useblocks-esm.js +892 -529
  26. package/useblocks.d.ts +8 -0
  27. package/useblocks.js +698 -330
  28. package/static/esm/550bf3cb.js +0 -127
  29. package/useblocks-core.1279854f.js +0 -643
  30. /package/iframe/{iframe-eblock.1279854f.html → iframe-eblock.f6bb8947.html} +0 -0
  31. /package/iframe/{iframe.1279854f.html → iframe.f6bb8947.html} +0 -0
@@ -1,24 +1,24 @@
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/87969347.js", [
2
+ __useblocks__.define("static/core/53463a60.js", [
3
3
  "require",
4
4
  "exports",
5
5
  "module",
6
6
  "static/core/bd36b180.js",
7
- "static/core/b9bb2c5f.js",
8
- "static/core/4d493eba.js",
9
- "static/core/58c4b8d7.js",
10
- "static/core/4dadf572.js",
7
+ "static/core/c9e59b34.js",
8
+ "static/core/161d1254.js",
9
+ "static/core/4c39852e.js",
10
+ "static/core/40f73dfb.js",
11
11
  "static/core/951903fb.js",
12
- "static/core/bf446743.js",
12
+ "static/core/dbf19c2e.js",
13
13
  "react",
14
14
  "react/jsx-runtime"
15
- ], function(me, ht, un) {
16
- const Ze = me("./bd36b180.js"), u = me("./b9bb2c5f.js"), Y = me("./4d493eba.js"), ne = me("./58c4b8d7.js"), m = me("./4dadf572.js"), yt = me("./951903fb.js"), F = me("./bf446743.js");
17
- let n = me("react");
15
+ ], function(de, gt, ln) {
16
+ const Ze = de("./bd36b180.js"), u = de("./c9e59b34.js"), Z = de("./161d1254.js"), ne = de("./4c39852e.js"), m = de("./40f73dfb.js"), ht = de("./951903fb.js"), N = de("./dbf19c2e.js");
17
+ let n = de("react");
18
18
  n = Ze.__toESM(n);
19
- let r = me("react/jsx-runtime");
20
- var vt = Ze.__toESM(ne.require_prop_types());
21
- function Ct(t, e) {
19
+ let r = de("react/jsx-runtime");
20
+ var yt = Ze.__toESM(ne.require_prop_types());
21
+ function vt(t, e) {
22
22
  return { [t]: {
23
23
  Filter: e("Filter"),
24
24
  filter: e("filter"),
@@ -111,11 +111,11 @@ __useblocks__.define("static/core/87969347.js", [
111
111
  const d = o.slice(5, i).split(";")[0]?.trim();
112
112
  d && (a = d), o = o.slice(i + 1);
113
113
  }
114
- const l = o.replace(/\s/g, ""), b = atob(l), g = new Uint8Array(b.length);
115
- for (let d = 0; d < b.length; d++) g[d] = b.charCodeAt(d);
116
- return new Blob([g], { type: a });
114
+ const l = o.replace(/\s/g, ""), b = atob(l), p = new Uint8Array(b.length);
115
+ for (let d = 0; d < b.length; d++) p[d] = b.charCodeAt(d);
116
+ return new Blob([p], { type: a });
117
117
  }
118
- var bt = "static/media/image-editor", wt = { text: {
118
+ var Ct = "static/media/image-editor", bt = { text: {
119
119
  replaceDefaultItems: !0,
120
120
  defaultText: "Handwriting",
121
121
  items: [
@@ -233,84 +233,84 @@ __useblocks__.define("static/core/87969347.js", [
233
233
  }
234
234
  ]
235
235
  } };
236
- function At(t, e) {
236
+ function wt(t, e) {
237
237
  if (t === "json") return new Blob([e], { type: "application/json" });
238
238
  if (t === "svg") return new Blob([e], { type: "image/svg+xml" });
239
239
  const o = `image/${t}`;
240
240
  return Xe(e.replace(/data:image\/([a-z]*)?;base64,/, ""), o);
241
241
  }
242
- var It = ({ currentImageLink: t, prefetchedBlob: e, resolveImageBlob: o, onSave: a, uploadImageResultIsLoading: i }) => {
243
- const l = F.useCookieManager(), [b, g] = (0, n.useState)(), [d, R] = (0, n.useState)(), { __: x } = m.useI18n();
244
- let p = u.useDispatch();
245
- const w = u.useStore(), j = u.useAppConfig(), C = u.useSelector(u.selectedCurrentUser), U = u.useSelector(Y.selectSecondModal), y = u.useSelector(u.selectProject), D = (0, n.useMemo)(() => {
246
- if (!j?.icons) return;
247
- const k = {};
248
- for (const [P, E] of Object.entries(j.icons)) typeof E == "string" && (k[P] = F.sanitizeHtml(E));
249
- return Object.keys(k).length > 0 ? k : void 0;
250
- }, [j?.icons]), O = (0, n.useRef)(!1), [T, q] = (0, n.useState)(), N = u.useEventEmitter(u.events.FILE_PROXY_EVENT_ID);
242
+ var At = ({ currentImageLink: t, prefetchedBlob: e, resolveImageBlob: o, onSave: a, uploadImageResultIsLoading: i }) => {
243
+ const l = N.useCookieManager(), [b, p] = (0, n.useState)(), [d, v] = (0, n.useState)(), { __: I } = m.useI18n();
244
+ let w = u.useDispatch();
245
+ const C = u.useStore(), R = u.useAppConfig(), y = u.useSelector(u.selectedCurrentUser), L = u.useSelector(Z.selectSecondModal), A = u.useSelector(u.selectProject), G = (0, n.useMemo)(() => {
246
+ if (!R?.icons) return;
247
+ const E = {};
248
+ for (const [P, j] of Object.entries(R.icons)) typeof j == "string" && (E[P] = N.sanitizeHtml(j));
249
+ return Object.keys(E).length > 0 ? E : void 0;
250
+ }, [R?.icons]), O = (0, n.useRef)(!1), [D, H] = (0, n.useState)(), B = u.useEventEmitter(u.events.FILE_PROXY_EVENT_ID);
251
251
  (0, n.useEffect)(() => {
252
- let k = !1;
252
+ let E = !1;
253
253
  return (async () => {
254
- const E = t;
255
- if (!E && !e) return;
256
- let I = e;
257
- if (!I && E) try {
258
- typeof o == "function" ? I = await o(E) : I = await (await fetch(E)).blob();
254
+ const j = t;
255
+ if (!j && !e) return;
256
+ let x = e;
257
+ if (!x && j) try {
258
+ typeof o == "function" ? x = await o(j) : x = await (await fetch(j)).blob();
259
259
  } catch {
260
- if (k) return;
261
- if (I = await N.fire({
262
- url: E,
263
- project: y
264
- }).filter((L) => L instanceof Blob)[0], !I) {
265
- const L = l.get(u.APP_COOKIES.em_token) || await u.di.getInstance(w, Y.TOKEN_ID);
266
- I = await (await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(E)}`, { headers: { authorization: `Bearer ${L}` } })).blob();
260
+ if (E) return;
261
+ if (x = await B.fire({
262
+ url: j,
263
+ project: A
264
+ }).filter((U) => U instanceof Blob)[0], !x) {
265
+ const U = l.get(u.APP_COOKIES.em_token) || await u.di.getInstance(C, Z.TOKEN_ID);
266
+ x = await (await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(j)}`, { headers: { authorization: `Bearer ${U}` } })).blob();
267
267
  }
268
268
  }
269
- if (k || !I) return;
270
- const A = new FileReader();
271
- A.onload = () => {
272
- if (k) return;
273
- const L = A.result;
274
- typeof L == "string" && (g(L), R(I.type), T?.tools.import.openBackgroundImage(L));
275
- }, A.onerror = () => {}, A.readAsDataURL(I);
276
- })().catch((E) => {}), () => {
277
- k = !0;
269
+ if (E || !x) return;
270
+ const S = new FileReader();
271
+ S.onload = () => {
272
+ if (E) return;
273
+ const U = S.result;
274
+ typeof U == "string" && (p(U), v(x.type), D?.tools.import.openBackgroundImage(U));
275
+ }, S.onerror = () => {}, S.readAsDataURL(x);
276
+ })().catch((j) => {}), () => {
277
+ E = !0;
278
278
  };
279
279
  }, [
280
280
  t,
281
281
  e,
282
282
  o,
283
283
  l,
284
- T,
285
- N,
286
- y,
287
- w
284
+ D,
285
+ B,
286
+ A,
287
+ C
288
288
  ]);
289
- const M = (0, n.useCallback)(() => {
290
- g(null), R(null), p(Y.closeSecondModal()), p(Y.closeModal(u.MODALS.UPLOAD_IMAGE_MODAL));
291
- }, [p]), z = (0, n.useRef)();
292
- z.current = async function(k, P, E) {
289
+ const z = (0, n.useCallback)(() => {
290
+ p(null), v(null), w(Z.closeSecondModal()), w(Z.closeModal(u.MODALS.UPLOAD_IMAGE_MODAL));
291
+ }, [w]), V = (0, n.useRef)();
292
+ V.current = async function(E, P, j) {
293
293
  try {
294
- const I = At(E, k);
295
- a && await a(new File([I], P, {
294
+ const x = wt(j, E);
295
+ a && await a(new File([x], P, {
296
296
  lastModified: Date.now(),
297
- type: I.type
297
+ type: x.type
298
298
  }));
299
- } catch (I) {
300
- throw I;
299
+ } catch (x) {
300
+ throw x;
301
301
  }
302
302
  };
303
- const ee = (0, n.useCallback)((k) => {
304
- if (k && !(O.current && T)) {
303
+ const ee = (0, n.useCallback)((E) => {
304
+ if (E && !(O.current && D)) {
305
305
  O.current = !0;
306
- const P = C.locale ? C.locale.replace("_", "-") : "en-US", E = C.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? u.DARK : u.LIGHT : C.theme;
307
- yt.Tf.init({
306
+ const P = y.locale ? y.locale.replace("_", "-") : "en-US", j = y.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? u.DARK : u.LIGHT : y.theme;
307
+ ht.Tf.init({
308
308
  selector: "#pixie-editor",
309
- baseUrl: m.getBundledHostAssetUrl(bt),
309
+ baseUrl: m.getBundledHostAssetUrl(Ct),
310
310
  image: b,
311
311
  activeLanguage: P,
312
- languages: Ct(P, x),
313
- tools: wt,
312
+ languages: vt(P, I),
313
+ tools: bt,
314
314
  ui: {
315
315
  menubar: {
316
316
  replaceDefaultItems: !0,
@@ -328,55 +328,55 @@ __useblocks__.define("static/core/87969347.js", [
328
328
  type: "button",
329
329
  icon: (0, r.jsx)(m.EmIcons, {
330
330
  icon: "HistoryOutlined",
331
- configIcons: D,
331
+ configIcons: G,
332
332
  style: { fontSize: 20 }
333
333
  }),
334
334
  align: "right",
335
335
  desktopOnly: !0,
336
- action: (I) => {
337
- I.togglePanel("history");
336
+ action: (x) => {
337
+ x.togglePanel("history");
338
338
  }
339
339
  },
340
340
  {
341
341
  type: "button",
342
342
  icon: (0, r.jsx)(m.EmIcons, {
343
343
  icon: "CloseOutlined",
344
- configIcons: D,
344
+ configIcons: G,
345
345
  style: { fontSize: 20 }
346
346
  }),
347
347
  align: "right",
348
348
  desktopOnly: !0,
349
- action: () => M()
349
+ action: () => z()
350
350
  }
351
351
  ]
352
352
  },
353
353
  nav: { position: "top" },
354
- activeTheme: E,
354
+ activeTheme: j,
355
355
  mode: "inline",
356
356
  forceOverlayModeOnMobile: !1
357
357
  },
358
- onSave: async function(I, A, L) {
358
+ onSave: async function(x, S, U) {
359
359
  try {
360
- await z.current(I, A, L);
360
+ await V.current(x, S, U);
361
361
  } catch {}
362
362
  }
363
- }).then((I) => {
364
- q(I);
365
- }).catch((I) => {});
363
+ }).then((x) => {
364
+ H(x);
365
+ }).catch((x) => {});
366
366
  }
367
367
  }, [
368
- C.theme,
368
+ y.theme,
369
369
  b,
370
- T,
371
- q,
372
- C.locale,
373
- x,
374
- M,
375
- D
376
- ]), K = (0, n.useCallback)(() => {
377
- T?.tools.export.save(t?.split("/").pop().split(".")[0], d?.split("/")[1]);
370
+ D,
371
+ H,
372
+ y.locale,
373
+ I,
374
+ z,
375
+ G
376
+ ]), q = (0, n.useCallback)(() => {
377
+ D?.tools.export.save(t?.split("/").pop().split(".")[0], d?.split("/")[1]);
378
378
  }, [
379
- T,
379
+ D,
380
380
  t,
381
381
  d
382
382
  ]);
@@ -392,17 +392,17 @@ __useblocks__.define("static/core/87969347.js", [
392
392
  closable: !1,
393
393
  zIndex: 1100,
394
394
  mask: !1,
395
- open: U,
395
+ open: L,
396
396
  footer: [(0, r.jsx)(m.Button, {
397
397
  className: "em-analytics__profile-cancel",
398
- onClick: M,
399
- children: x("Cancel")
398
+ onClick: z,
399
+ children: I("Cancel")
400
400
  }, "Cancel"), (0, r.jsx)(m.Button, {
401
401
  className: "em-analytics__profile-updapixiete",
402
402
  id: "save",
403
403
  type: "primary",
404
- onClick: K,
405
- children: x("Update")
404
+ onClick: q,
405
+ children: I("Update")
406
406
  }, "Ok")],
407
407
  children: [i && (0, r.jsx)("div", {
408
408
  style: {
@@ -419,11 +419,11 @@ __useblocks__.define("static/core/87969347.js", [
419
419
  children: (0, r.jsx)(m.Spin, { size: "large" })
420
420
  }), (0, r.jsx)("div", { id: "pixie-editor" })]
421
421
  });
422
- }, xt = ({ currentImageLink: t, newLink: e, previewDisplayUrl: o, resolvedPreviewObjectUrl: a, resolvedPreviewBlob: i, resolveImageBlob: l, onSave: b, uploadImageResultIsLoading: g }) => {
422
+ }, It = ({ currentImageLink: t, newLink: e, previewDisplayUrl: o, resolvedPreviewObjectUrl: a, resolvedPreviewBlob: i, resolveImageBlob: l, onSave: b, uploadImageResultIsLoading: p }) => {
423
423
  const d = o || a;
424
424
  return (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)("div", { children: (0, r.jsxs)("div", {
425
425
  className: "image-preview",
426
- children: [g && (0, r.jsx)("div", {
426
+ children: [p && (0, r.jsx)("div", {
427
427
  style: {
428
428
  position: "absolute",
429
429
  height: "100%",
@@ -440,13 +440,13 @@ __useblocks__.define("static/core/87969347.js", [
440
440
  alt: "uploadedImage",
441
441
  src: d
442
442
  })]
443
- }) }), (0, r.jsx)(It, {
443
+ }) }), (0, r.jsx)(At, {
444
444
  currentImageLink: t,
445
445
  prefetchedBlob: i,
446
446
  resolveImageBlob: l,
447
447
  newLink: e,
448
448
  onSave: b,
449
- uploadImageResultIsLoading: g
449
+ uploadImageResultIsLoading: p
450
450
  })] });
451
451
  }, Re = {
452
452
  Pixel: "Pixel",
@@ -455,7 +455,7 @@ __useblocks__.define("static/core/87969347.js", [
455
455
  unit: Re.Percent,
456
456
  value: 80
457
457
  };
458
- function St(t) {
458
+ function xt(t) {
459
459
  return typeof t == "number" ? {
460
460
  unit: Re.Percent,
461
461
  value: t * 100
@@ -467,136 +467,136 @@ __useblocks__.define("static/core/87969347.js", [
467
467
  value: parseFloat(t)
468
468
  } : Je : Je;
469
469
  }
470
- function Rt(t, e) {
471
- const o = St(t);
470
+ function St(t, e) {
471
+ const o = xt(t);
472
472
  let a;
473
473
  return o.unit === Re.Pixel ? a = `${o.value}px` : a = `${100 - o.value}%`, e ? `${a} 0px 0px 0px` : `0px 0px ${a} 0px`;
474
474
  }
475
- function $e({ next: t, hasMore: e, children: o, loader: a, scrollThreshold: i = .8, endMessage: l, style: b, height: g, scrollableTarget: d, hasChildren: R, inverse: x = !1, pullDownToRefresh: p = !1, pullDownToRefreshContent: w, releaseToRefreshContent: j, pullDownToRefreshThreshold: C = 100, refreshFunction: U, onScroll: y, dataLength: D, initialScrollY: O, className: T = "", role: q, tabIndex: N, id: M, ...z }) {
476
- const [ee, K] = (0, n.useState)(!1), [k, P] = (0, n.useState)(!1), [E, I] = (0, n.useState)(0), A = (0, n.useRef)(null), L = (0, n.useRef)(null), J = (0, n.useRef)(null), Q = (0, n.useRef)(t);
477
- Q.current = t;
478
- const s = (0, n.useRef)(U);
479
- s.current = U;
480
- const h = (0, n.useRef)(C);
481
- h.current = C;
482
- const W = (0, n.useRef)(!1), le = (0, n.useRef)(!1), Z = (0, n.useRef)(0), $ = (0, n.useRef)(0), X = (0, n.useRef)(0), H = (0, n.useCallback)(() => d instanceof HTMLElement ? d : typeof d == "string" ? document.getElementById(d) : null, [d]);
475
+ function $e({ next: t, hasMore: e, children: o, loader: a, scrollThreshold: i = .8, endMessage: l, style: b, height: p, scrollableTarget: d, hasChildren: v, inverse: I = !1, pullDownToRefresh: w = !1, pullDownToRefreshContent: C, releaseToRefreshContent: R, pullDownToRefreshThreshold: y = 100, refreshFunction: L, onScroll: A, dataLength: G, initialScrollY: O, className: D = "", role: H, tabIndex: B, id: z, ...V }) {
476
+ const [ee, q] = (0, n.useState)(!1), [E, P] = (0, n.useState)(!1), [j, x] = (0, n.useState)(0), S = (0, n.useRef)(null), U = (0, n.useRef)(null), _ = (0, n.useRef)(null), K = (0, n.useRef)(t);
477
+ K.current = t;
478
+ const s = (0, n.useRef)(L);
479
+ s.current = L;
480
+ const h = (0, n.useRef)(y);
481
+ h.current = y;
482
+ const W = (0, n.useRef)(!1), me = (0, n.useRef)(!1), T = (0, n.useRef)(0), J = (0, n.useRef)(0), $ = (0, n.useRef)(0), F = (0, n.useCallback)(() => d instanceof HTMLElement ? d : typeof d == "string" ? document.getElementById(d) : null, [d]);
483
483
  (0, n.useEffect)(() => {
484
- if (typeof D > "u") throw new Error("mandatory prop \"dataLength\" is missing. The prop is needed when loading more content. Check README.md for usage");
485
- if (p && typeof U != "function") throw new Error(`Mandatory prop "refreshFunction" missing.
484
+ if (typeof G > "u") throw new Error("mandatory prop \"dataLength\" is missing. The prop is needed when loading more content. Check README.md for usage");
485
+ if (w && typeof L != "function") throw new Error(`Mandatory prop "refreshFunction" missing.
486
486
  Pull Down To Refresh functionality will not work
487
487
  as expected. Check README.md for usage'`);
488
488
  if (typeof O == "number") {
489
- const _ = g ? A.current : H();
490
- _ && _.scrollHeight > O && _.scrollTo(0, O);
489
+ const Y = p ? S.current : F();
490
+ Y && Y.scrollHeight > O && Y.scrollTo(0, O);
491
491
  }
492
492
  }, []), (0, n.useEffect)(() => {
493
- W.current = !1, K(!1);
494
- }, [D]), (0, n.useEffect)(() => {
493
+ W.current = !1, q(!1);
494
+ }, [G]), (0, n.useEffect)(() => {
495
495
  if (!e || typeof IntersectionObserver > "u") return;
496
- const _ = L.current;
497
- if (!_) return;
498
- const se = g ? A.current : H(), B = new IntersectionObserver(([ae]) => {
499
- !ae.isIntersecting || W.current || (W.current = !0, K(!0), Q.current());
496
+ const Y = U.current;
497
+ if (!Y) return;
498
+ const re = p ? S.current : F(), M = new IntersectionObserver(([ae]) => {
499
+ !ae.isIntersecting || W.current || (W.current = !0, q(!0), K.current());
500
500
  }, {
501
- root: se,
502
- rootMargin: Rt(i, x),
501
+ root: re,
502
+ rootMargin: St(i, I),
503
503
  threshold: 0
504
504
  });
505
- return B.observe(_), () => B.disconnect();
505
+ return M.observe(Y), () => M.disconnect();
506
506
  }, [
507
507
  e,
508
508
  i,
509
- x,
510
- g,
511
- H
509
+ I,
510
+ p,
511
+ F
512
512
  ]), (0, n.useEffect)(() => {
513
- var _;
514
- if (!y) return;
515
- const se = (_ = g ? A.current : H()) !== null && _ !== void 0 ? _ : typeof window < "u" ? window : null;
516
- if (!se) return;
517
- const B = (ae) => {
518
- setTimeout(() => y(ae), 0);
513
+ var Y;
514
+ if (!A) return;
515
+ const re = (Y = p ? S.current : F()) !== null && Y !== void 0 ? Y : typeof window < "u" ? window : null;
516
+ if (!re) return;
517
+ const M = (ae) => {
518
+ setTimeout(() => A(ae), 0);
519
519
  };
520
- return se.addEventListener("scroll", B), () => se.removeEventListener("scroll", B);
520
+ return re.addEventListener("scroll", M), () => re.removeEventListener("scroll", M);
521
521
  }, [
522
- y,
523
- g,
524
- H
522
+ A,
523
+ p,
524
+ F
525
525
  ]), (0, n.useEffect)(() => {
526
- var _, se;
527
- if (!p) return;
528
- const B = (_ = g ? A.current : H()) !== null && _ !== void 0 ? _ : typeof window < "u" ? window : null;
529
- if (!B) return;
530
- if (!((se = J.current) === null || se === void 0) && se.firstChild) {
531
- const G = J.current.firstChild.getBoundingClientRect().height;
532
- X.current = G, I(G);
526
+ var Y, re;
527
+ if (!w) return;
528
+ const M = (Y = p ? S.current : F()) !== null && Y !== void 0 ? Y : typeof window < "u" ? window : null;
529
+ if (!M) return;
530
+ if (!((re = _.current) === null || re === void 0) && re.firstChild) {
531
+ const X = _.current.firstChild.getBoundingClientRect().height;
532
+ $.current = X, x(X);
533
533
  }
534
- const ae = (G) => {
535
- (B instanceof HTMLElement ? B.scrollTop : document.documentElement.scrollTop) > 0 || (le.current = !0, G instanceof MouseEvent ? Z.current = G.pageY : G instanceof TouchEvent && (Z.current = G.touches[0].pageY), $.current = Z.current, A.current && (A.current.style.willChange = "transform", A.current.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
536
- }, v = (G) => {
537
- if (!le.current || (G instanceof MouseEvent ? $.current = G.pageY : G instanceof TouchEvent && ($.current = G.touches[0].pageY), $.current < Z.current)) return;
538
- const de = $.current - Z.current;
539
- de >= h.current && P(!0), !(de > X.current * 1.5) && A.current && (A.current.style.overflow = "visible", A.current.style.transform = `translate3d(0px, ${de}px, 0px)`);
534
+ const ae = (X) => {
535
+ (M instanceof HTMLElement ? M.scrollTop : document.documentElement.scrollTop) > 0 || (me.current = !0, X instanceof MouseEvent ? T.current = X.pageY : X instanceof TouchEvent && (T.current = X.touches[0].pageY), J.current = T.current, S.current && (S.current.style.willChange = "transform", S.current.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
536
+ }, g = (X) => {
537
+ if (!me.current || (X instanceof MouseEvent ? J.current = X.pageY : X instanceof TouchEvent && (J.current = X.touches[0].pageY), J.current < T.current)) return;
538
+ const ce = J.current - T.current;
539
+ ce >= h.current && P(!0), !(ce > $.current * 1.5) && S.current && (S.current.style.overflow = "visible", S.current.style.transform = `translate3d(0px, ${ce}px, 0px)`);
540
540
  }, te = () => {
541
- Z.current = 0, $.current = 0, le.current = !1, P((G) => {
542
- var de;
543
- return G && ((de = s.current) === null || de === void 0 || de.call(s)), !1;
541
+ T.current = 0, J.current = 0, me.current = !1, P((X) => {
542
+ var ce;
543
+ return X && ((ce = s.current) === null || ce === void 0 || ce.call(s)), !1;
544
544
  }), requestAnimationFrame(() => {
545
- A.current && (A.current.style.overflow = "auto", A.current.style.transform = "none", A.current.style.willChange = "unset");
545
+ S.current && (S.current.style.overflow = "auto", S.current.style.transform = "none", S.current.style.willChange = "unset");
546
546
  });
547
547
  };
548
- return B.addEventListener("touchstart", ae), B.addEventListener("touchmove", v), B.addEventListener("touchend", te), B.addEventListener("mousedown", ae), B.addEventListener("mousemove", v), B.addEventListener("mouseup", te), () => {
549
- B.removeEventListener("touchstart", ae), B.removeEventListener("touchmove", v), B.removeEventListener("touchend", te), B.removeEventListener("mousedown", ae), B.removeEventListener("mousemove", v), B.removeEventListener("mouseup", te);
548
+ return M.addEventListener("touchstart", ae), M.addEventListener("touchmove", g), M.addEventListener("touchend", te), M.addEventListener("mousedown", ae), M.addEventListener("mousemove", g), M.addEventListener("mouseup", te), () => {
549
+ M.removeEventListener("touchstart", ae), M.removeEventListener("touchmove", g), M.removeEventListener("touchend", te), M.removeEventListener("mousedown", ae), M.removeEventListener("mousemove", g), M.removeEventListener("mouseup", te);
550
550
  };
551
551
  }, [
552
+ w,
552
553
  p,
553
- g,
554
- H
554
+ F
555
555
  ]);
556
- const ie = {
557
- height: g ?? "auto",
556
+ const he = {
557
+ height: p ?? "auto",
558
558
  overflow: "auto",
559
559
  WebkitOverflowScrolling: "touch",
560
560
  ...b
561
- }, he = R || !!(o && o instanceof Array && o.length), ye = p && g ? { overflow: "auto" } : {}, ce = e ? (0, r.jsx)("div", {
562
- ref: L,
561
+ }, ie = v || !!(o && o instanceof Array && o.length), pe = w && p ? { overflow: "auto" } : {}, Ae = e ? (0, r.jsx)("div", {
562
+ ref: U,
563
563
  style: { height: 1 }
564
564
  }) : null;
565
565
  return (0, r.jsx)("div", {
566
- style: ye,
566
+ style: pe,
567
567
  className: "infinite-scroll-component__outerdiv",
568
568
  children: (0, r.jsxs)("div", {
569
- ...z,
570
- role: q,
571
- tabIndex: N,
572
- id: M,
573
- className: ["infinite-scroll-component", T].filter(Boolean).join(" "),
574
- ref: A,
575
- style: ie,
569
+ ...V,
570
+ role: H,
571
+ tabIndex: B,
572
+ id: z,
573
+ className: ["infinite-scroll-component", D].filter(Boolean).join(" "),
574
+ ref: S,
575
+ style: he,
576
576
  children: [
577
- p && (0, r.jsx)("div", {
577
+ w && (0, r.jsx)("div", {
578
578
  style: { position: "relative" },
579
- ref: J,
579
+ ref: _,
580
580
  children: (0, r.jsx)("div", {
581
581
  style: {
582
582
  position: "absolute",
583
583
  left: 0,
584
584
  right: 0,
585
- top: -1 * E
585
+ top: -1 * j
586
586
  },
587
- children: k ? j : w
587
+ children: E ? R : C
588
588
  })
589
589
  }),
590
590
  o,
591
- !ee && !he && e && a,
591
+ !ee && !ie && e && a,
592
592
  ee && e && a,
593
- ce,
593
+ Ae,
594
594
  !e && l
595
595
  ]
596
596
  })
597
597
  });
598
598
  }
599
- function jt(t, e) {
599
+ function Rt(t, e) {
600
600
  if (t == null) return {};
601
601
  var o = kt(t, e), a, i;
602
602
  if (Object.getOwnPropertySymbols) {
@@ -630,18 +630,18 @@ __useblocks__.define("static/core/87969347.js", [
630
630
  }
631
631
  return o;
632
632
  }
633
- function je(t) {
633
+ function ke(t) {
634
634
  for (var e = 1; e < arguments.length; e++) {
635
635
  var o = arguments[e] != null ? arguments[e] : {};
636
636
  e % 2 ? et(Object(o), !0).forEach(function(a) {
637
- Et(t, a, o[a]);
637
+ jt(t, a, o[a]);
638
638
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) : et(Object(o)).forEach(function(a) {
639
639
  Object.defineProperty(t, a, Object.getOwnPropertyDescriptor(o, a));
640
640
  });
641
641
  }
642
642
  return t;
643
643
  }
644
- function Et(t, e, o) {
644
+ function jt(t, e, o) {
645
645
  return e in t ? Object.defineProperty(t, e, {
646
646
  value: o,
647
647
  enumerable: !0,
@@ -649,7 +649,7 @@ __useblocks__.define("static/core/87969347.js", [
649
649
  writable: !0
650
650
  }) : t[e] = o, t;
651
651
  }
652
- var Ot = {
652
+ var Et = {
653
653
  breakpointCols: void 0,
654
654
  className: void 0,
655
655
  columnClassName: void 0,
@@ -703,15 +703,15 @@ __useblocks__.define("static/core/87969347.js", [
703
703
  const { column: t, columnAttrs: e = {}, columnClassName: o } = this.props, a = this.itemsInColumns(), i = `${100 / a.length}%`;
704
704
  let l = o;
705
705
  l && typeof l != "string" && (this.logDeprecated("The property \"columnClassName\" requires a string"), typeof l > "u" && (l = "my-masonry-grid_column"));
706
- const b = je(je(je({}, t), e), {}, {
707
- style: je(je({}, e.style), {}, { width: i }),
706
+ const b = ke(ke(ke({}, t), e), {}, {
707
+ style: ke(ke({}, e.style), {}, { width: i }),
708
708
  className: l
709
709
  });
710
- return a.map((g, d) => n.default.createElement("div", De({}, b, { key: d }), g));
710
+ return a.map((p, d) => n.default.createElement("div", De({}, b, { key: d }), p));
711
711
  }
712
712
  logDeprecated(t) {}
713
713
  render() {
714
- const t = this.props, { children: e, breakpointCols: o, columnClassName: a, columnAttrs: i, column: l, className: b } = t, g = jt(t, [
714
+ const t = this.props, { children: e, breakpointCols: o, columnClassName: a, columnAttrs: i, column: l, className: b } = t, p = Rt(t, [
715
715
  "children",
716
716
  "breakpointCols",
717
717
  "columnClassName",
@@ -720,11 +720,11 @@ __useblocks__.define("static/core/87969347.js", [
720
720
  "className"
721
721
  ]);
722
722
  let d = b;
723
- return typeof b != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof b > "u" && (d = "my-masonry-grid")), n.default.createElement("div", De({}, g, { className: d }), this.renderColumns());
723
+ return typeof b != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof b > "u" && (d = "my-masonry-grid")), n.default.createElement("div", De({}, p, { className: d }), this.renderColumns());
724
724
  }
725
725
  };
726
- Ne.defaultProps = Ot;
727
- function Fe(t, e) {
726
+ Ne.defaultProps = Et;
727
+ function Ge(t, e) {
728
728
  return t ? t.exhausted ? {
729
729
  ...t,
730
730
  src: null
@@ -734,20 +734,20 @@ __useblocks__.define("static/core/87969347.js", [
734
734
  } : null;
735
735
  }
736
736
  function tt({ items: t, getItemId: e, getRequestUrl: o, createController: a }) {
737
- const [i, l] = (0, n.useState)({}), b = (0, n.useRef)(new Map()), g = (0, n.useCallback)((d) => {
738
- const R = e(d), x = o(d), p = `${R}:${x}`;
739
- if (b.current.has(p)) return {
740
- itemId: R,
741
- requestUrl: x,
742
- cacheKey: p,
743
- controller: b.current.get(p)
737
+ const [i, l] = (0, n.useState)({}), b = (0, n.useRef)(new Map()), p = (0, n.useCallback)((d) => {
738
+ const v = e(d), I = o(d), w = `${v}:${I}`;
739
+ if (b.current.has(w)) return {
740
+ itemId: v,
741
+ requestUrl: I,
742
+ cacheKey: w,
743
+ controller: b.current.get(w)
744
744
  };
745
- const w = a(x);
746
- return b.current.set(p, w), {
747
- itemId: R,
748
- requestUrl: x,
749
- cacheKey: p,
750
- controller: w
745
+ const C = a(I);
746
+ return b.current.set(w, C), {
747
+ itemId: v,
748
+ requestUrl: I,
749
+ cacheKey: w,
750
+ controller: C
751
751
  };
752
752
  }, [
753
753
  a,
@@ -755,103 +755,103 @@ __useblocks__.define("static/core/87969347.js", [
755
755
  o
756
756
  ]);
757
757
  return (0, n.useEffect)(() => {
758
- const d = new Set(), R = {}, x = t.map((p) => {
759
- const { itemId: w, cacheKey: j, controller: C } = g(p);
760
- d.add(j), R[w] = C.src;
761
- const U = Fe(C.handleChangeSrc?.(), C.src);
762
- return U?.changed && U.src && (R[w] = U.src), C.subscribeToSrcChange?.((y) => {
763
- const D = Fe(y, C.src);
764
- !D?.changed || !D.src || l((O) => O[w] === D.src ? O : {
758
+ const d = new Set(), v = {}, I = t.map((w) => {
759
+ const { itemId: C, cacheKey: R, controller: y } = p(w);
760
+ d.add(R), v[C] = y.src;
761
+ const L = Ge(y.handleChangeSrc?.(), y.src);
762
+ return L?.changed && L.src && (v[C] = L.src), y.subscribeToSrcChange?.((A) => {
763
+ const G = Ge(A, y.src);
764
+ !G?.changed || !G.src || l((O) => O[C] === G.src ? O : {
765
765
  ...O,
766
- [w]: D.src
766
+ [C]: G.src
767
767
  });
768
768
  });
769
769
  }).filter(Boolean);
770
- return b.current.forEach((p, w) => {
771
- d.has(w) || b.current.delete(w);
772
- }), l(R), () => {
773
- x.forEach((p) => p?.());
770
+ return b.current.forEach((w, C) => {
771
+ d.has(C) || b.current.delete(C);
772
+ }), l(v), () => {
773
+ I.forEach((w) => w?.());
774
774
  };
775
- }, [g, t]), {
775
+ }, [p, t]), {
776
776
  getDisplaySrc: (0, n.useCallback)((d) => {
777
- const { itemId: R, requestUrl: x, controller: p } = g(d);
778
- return i[R] || p.src || x;
779
- }, [i, g]),
777
+ const { itemId: v, requestUrl: I, controller: w } = p(d);
778
+ return i[v] || w.src || I;
779
+ }, [i, p]),
780
780
  handleLoad: (0, n.useCallback)((d) => {
781
- g(d).controller.handleSuccess();
782
- }, [g]),
781
+ p(d).controller.handleSuccess();
782
+ }, [p]),
783
783
  handleError: (0, n.useCallback)((d) => {
784
- const { itemId: R, controller: x } = g(d), p = Fe(x.handleError(), x.src);
785
- p?.changed && p.src && l((w) => ({
786
- ...w,
787
- [R]: p.src
784
+ const { itemId: v, controller: I } = p(d), w = Ge(I.handleError(), I.src);
785
+ w?.changed && w.src && l((C) => ({
786
+ ...C,
787
+ [v]: w.src
788
788
  }));
789
- }, [g])
789
+ }, [p])
790
790
  };
791
791
  }
792
- var nt = "blocks", Lt = ({ setCurrentImageLink: t, setModalHeight: e, setModalWidth: o, setImageStockList: a, imageStockList: i, currentReq: l, setCurrentReq: b, inputRef: g, setStockLink: d, customRequest: R }) => {
793
- const x = u.useAppConfig(), p = u.useIsStandalone(), [w, j] = (0, n.useState)(!1), [C, U] = (0, n.useState)(2), { __: y } = m.useI18n(), D = m.useNotification(), [O] = Y.useLazyGetUnsplashImageQuery(), [T] = Y.useLazyGetSearchImageQuery(), q = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : y("Failed to load stock images through the configured proxy chain."), [y]), N = (0, n.useCallback)((s) => {
794
- D.error({
792
+ var nt = "blocks", Ot = ({ setCurrentImageLink: t, setModalHeight: e, setModalWidth: o, setImageStockList: a, imageStockList: i, currentReq: l, setCurrentReq: b, inputRef: p, setStockLink: d, customRequest: v }) => {
793
+ const I = u.useAppConfig(), w = u.useIsStandalone(), [C, R] = (0, n.useState)(!1), [y, L] = (0, n.useState)(2), { __: A } = m.useI18n(), G = m.useNotification(), [O] = Z.useLazyGetUnsplashImageQuery(), [D] = Z.useLazyGetSearchImageQuery(), H = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : A("Failed to load stock images through the configured proxy chain."), [A]), B = (0, n.useCallback)((s) => {
794
+ G.error({
795
795
  id: "STOCK_IMAGES_SEARCH_FAILED",
796
- title: y("Failed to load stock images"),
797
- description: q(s)
796
+ title: A("Failed to load stock images"),
797
+ description: H(s)
798
798
  });
799
799
  }, [
800
- y,
801
- q,
802
- D
803
- ]), M = async () => {
804
- w || (j(!0), T({
800
+ A,
801
+ H,
802
+ G
803
+ ]), z = async () => {
804
+ C || (R(!0), D({
805
805
  query: l,
806
- page: C
806
+ page: y
807
807
  }).then((s) => {
808
808
  if (s?.error) {
809
- N(s.error), j(!1);
809
+ B(s.error), R(!1);
810
810
  return;
811
811
  }
812
812
  const h = s?.data?.results || [];
813
- a((W) => [...W, ...h]), j(!1), U((W) => W + 1);
813
+ a((W) => [...W, ...h]), R(!1), L((W) => W + 1);
814
814
  }).catch(() => {
815
- j(!1);
815
+ R(!1);
816
816
  }));
817
817
  };
818
818
  (0, n.useEffect)(() => {
819
- l.keywords !== "" && z();
819
+ l.keywords !== "" && V();
820
820
  }, [l.color, l.orientation]);
821
- const z = async () => {
822
- const s = await T({
821
+ const V = async () => {
822
+ const s = await D({
823
823
  query: l,
824
824
  page: 1
825
825
  });
826
826
  if (s?.error) {
827
- N(s.error), a([]);
827
+ B(s.error), a([]);
828
828
  return;
829
829
  }
830
830
  const h = s?.data?.results || [];
831
831
  h.length > 0 ? (a(h), setTimeout(() => {
832
832
  o(1060), e("84vh");
833
833
  }, 0)) : a([]);
834
- }, [ee, K] = (0, n.useState)(null), k = (0, n.useCallback)((s, h, W) => `${s}${s.includes("?") ? "&" : "?"}w=${h}&q=${W}`, []), P = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
835
- config: x,
836
- standalone: p,
834
+ }, [ee, q] = (0, n.useState)(null), E = (0, n.useCallback)((s, h, W) => `${s}${s.includes("?") ? "&" : "?"}w=${h}&q=${W}`, []), P = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
835
+ config: I,
836
+ standalone: w,
837
837
  resourceType: "stockImages",
838
838
  intent: "display"
839
- }), [x, p]), { getDisplaySrc: E, handleLoad: I, handleError: A } = tt({
839
+ }), [I, w]), { getDisplaySrc: j, handleLoad: x, handleError: S } = tt({
840
840
  items: i,
841
841
  getItemId: (0, n.useCallback)((s) => s.id, []),
842
- getRequestUrl: (0, n.useCallback)((s) => k(s.urls.raw, 644, 96), [k]),
842
+ getRequestUrl: (0, n.useCallback)((s) => E(s.urls.raw, 644, 96), [E]),
843
843
  createController: P
844
- }), L = (s) => (h) => {
845
- I(s), h.target.parentNode.classList.add("loaded");
846
- }, J = (s) => () => {
847
- A(s);
848
- }, Q = (s, h, W) => {
849
- O(h.download_location), K(W), setTimeout(() => K(null), 2e3), d(`${s.raw}&w=1200&q=96`), t(`${s.raw}&w=1200&q=96`), R(`${s.raw}&w=1200&q=96`);
844
+ }), U = (s) => (h) => {
845
+ x(s), h.target.parentNode.classList.add("loaded");
846
+ }, _ = (s) => () => {
847
+ S(s);
848
+ }, K = (s, h, W) => {
849
+ O(h.download_location), q(W), setTimeout(() => q(null), 2e3), d(`${s.raw}&w=1200&q=96`), t(`${s.raw}&w=1200&q=96`), v(`${s.raw}&w=1200&q=96`);
850
850
  };
851
851
  return (0, r.jsxs)("div", {
852
852
  className: "stock-tab",
853
853
  children: [(0, r.jsxs)(m.Form, {
854
- onValuesChange: z,
854
+ onValuesChange: V,
855
855
  className: i.length > 0 ? "serach-results" : "",
856
856
  children: [(0, r.jsxs)(m.Row, {
857
857
  gutter: 24,
@@ -860,16 +860,16 @@ __useblocks__.define("static/core/87969347.js", [
860
860
  children: (0, r.jsx)(m.Form.Item, {
861
861
  className: "stock-search-input",
862
862
  children: (0, r.jsx)(m.SearchInput, {
863
- onSearch: z,
863
+ onSearch: V,
864
864
  allowClear: !0,
865
865
  size: i.length > 0 ? "medium" : "large",
866
- placeholder: y("Search image"),
866
+ placeholder: A("Search image"),
867
867
  value: l.keywords,
868
868
  onChange: (s) => b((h) => ({
869
869
  ...h,
870
870
  keywords: s.target.value
871
871
  })),
872
- ref: g,
872
+ ref: p,
873
873
  spellCheck: "false",
874
874
  enterButton: !1
875
875
  })
@@ -882,35 +882,35 @@ __useblocks__.define("static/core/87969347.js", [
882
882
  })),
883
883
  children: [
884
884
  (0, r.jsx)(m.Tooltip, {
885
- title: y("All"),
885
+ title: A("All"),
886
886
  placement: "top",
887
887
  children: (0, r.jsx)(m.Radio.Button, {
888
888
  value: "",
889
- children: (0, r.jsx)(F.EmIcons, { icon: "MixedView" })
889
+ children: (0, r.jsx)(N.EmIcons, { icon: "MixedView" })
890
890
  })
891
891
  }),
892
892
  (0, r.jsx)(m.Tooltip, {
893
- title: y("Landscape"),
893
+ title: A("Landscape"),
894
894
  placement: "top",
895
895
  children: (0, r.jsx)(m.Radio.Button, {
896
896
  value: "landscape",
897
- children: (0, r.jsx)(F.EmIcons, { icon: "LandscapeView" })
897
+ children: (0, r.jsx)(N.EmIcons, { icon: "LandscapeView" })
898
898
  })
899
899
  }),
900
900
  (0, r.jsx)(m.Tooltip, {
901
- title: y("Portrait"),
901
+ title: A("Portrait"),
902
902
  placement: "top",
903
903
  children: (0, r.jsx)(m.Radio.Button, {
904
904
  value: "portrait",
905
- children: (0, r.jsx)(F.EmIcons, { icon: "PortraitView" })
905
+ children: (0, r.jsx)(N.EmIcons, { icon: "PortraitView" })
906
906
  })
907
907
  }),
908
908
  (0, r.jsx)(m.Tooltip, {
909
- title: y("Squarish"),
909
+ title: A("Squarish"),
910
910
  placement: "top",
911
911
  children: (0, r.jsx)(m.Radio.Button, {
912
912
  value: "squarish",
913
- children: (0, r.jsx)(F.EmIcons, { icon: "SquareView" })
913
+ children: (0, r.jsx)(N.EmIcons, { icon: "SquareView" })
914
914
  })
915
915
  })
916
916
  ]
@@ -924,57 +924,57 @@ __useblocks__.define("static/core/87969347.js", [
924
924
  {
925
925
  value: "",
926
926
  colorClass: "all-colors",
927
- label: y("All")
927
+ label: A("All")
928
928
  },
929
929
  {
930
930
  value: "black",
931
931
  colorClass: "black-color",
932
- label: y("Black")
932
+ label: A("Black")
933
933
  },
934
934
  {
935
935
  value: "black_and_white",
936
936
  colorClass: "bw-color",
937
- label: y("Black and White")
937
+ label: A("Black and White")
938
938
  },
939
939
  {
940
940
  value: "white",
941
941
  colorClass: "white-color",
942
- label: y("White")
942
+ label: A("White")
943
943
  },
944
944
  {
945
945
  value: "orange",
946
946
  colorClass: "orange-color",
947
- label: y("Orange")
947
+ label: A("Orange")
948
948
  },
949
949
  {
950
950
  value: "red",
951
951
  colorClass: "red-color",
952
- label: y("Red")
952
+ label: A("Red")
953
953
  },
954
954
  {
955
955
  value: "purple",
956
956
  colorClass: "purple-color",
957
- label: y("Purple")
957
+ label: A("Purple")
958
958
  },
959
959
  {
960
960
  value: "magenta",
961
961
  colorClass: "magenta-color",
962
- label: y("Magenta")
962
+ label: A("Magenta")
963
963
  },
964
964
  {
965
965
  value: "green",
966
966
  colorClass: "green-color",
967
- label: y("Green")
967
+ label: A("Green")
968
968
  },
969
969
  {
970
970
  value: "teal",
971
971
  colorClass: "teal-color",
972
- label: y("Teal")
972
+ label: A("Teal")
973
973
  },
974
974
  {
975
975
  value: "blue",
976
976
  colorClass: "blue-color",
977
- label: y("Blue")
977
+ label: A("Blue")
978
978
  }
979
979
  ],
980
980
  tooltipPlacement: "top"
@@ -1004,11 +1004,11 @@ __useblocks__.define("static/core/87969347.js", [
1004
1004
  },
1005
1005
  children: (0, r.jsx)($e, {
1006
1006
  dataLength: i && i.length,
1007
- next: M,
1007
+ next: z,
1008
1008
  hasMore: i,
1009
1009
  endMessage: (0, r.jsxs)(m.Divider, {
1010
1010
  plain: !0,
1011
- children: [y("That`s all we could find."), " 🤐"]
1011
+ children: [A("That`s all we could find."), " 🤐"]
1012
1012
  }),
1013
1013
  scrollableTarget: "scrollableDiv",
1014
1014
  style: { overflow: "visible" },
@@ -1019,15 +1019,15 @@ __useblocks__.define("static/core/87969347.js", [
1019
1019
  columnClassName: "my-masonry-grid_column",
1020
1020
  children: i.map((s) => (0, r.jsxs)("div", {
1021
1021
  className: "list-item",
1022
- onClick: () => Q(s.urls, s.links, s.id),
1022
+ onClick: () => K(s.urls, s.links, s.id),
1023
1023
  children: [
1024
1024
  (0, r.jsx)("img", {
1025
1025
  className: ee === s.id ? "loaded-image" : "",
1026
1026
  width: "322px",
1027
- src: E(s),
1027
+ src: j(s),
1028
1028
  alt: s.description,
1029
- onLoad: L(s),
1030
- onError: J(s)
1029
+ onLoad: U(s),
1030
+ onError: _(s)
1031
1031
  }),
1032
1032
  (0, r.jsxs)("p", {
1033
1033
  className: "creator-info",
@@ -1067,11 +1067,11 @@ __useblocks__.define("static/core/87969347.js", [
1067
1067
  function rt(t) {
1068
1068
  return /^(https?:)?\/\//i.test(t.trim());
1069
1069
  }
1070
- function Dt(t) {
1070
+ function Lt(t) {
1071
1071
  const e = t.trim();
1072
1072
  return rt(e) || /^data:/i.test(e) ? e : `data:image/jpeg;base64, ${t}`;
1073
1073
  }
1074
- var Bt = ({ images: t, transitionDuration: e = 1e3 }) => {
1074
+ var Dt = ({ images: t, transitionDuration: e = 1e3 }) => {
1075
1075
  const [o, a] = (0, n.useState)([]);
1076
1076
  return (0, n.useEffect)(() => {
1077
1077
  if (t.length > 0) {
@@ -1080,7 +1080,7 @@ __useblocks__.define("static/core/87969347.js", [
1080
1080
  src: i,
1081
1081
  opacity: 0
1082
1082
  }]), setTimeout(() => {
1083
- a((l) => l.map((b, g) => g === l.length - 1 ? {
1083
+ a((l) => l.map((b, p) => p === l.length - 1 ? {
1084
1084
  ...b,
1085
1085
  opacity: 1
1086
1086
  } : b));
@@ -1089,7 +1089,7 @@ __useblocks__.define("static/core/87969347.js", [
1089
1089
  }, [t]), (0, r.jsx)("div", {
1090
1090
  className: "slideshow-container",
1091
1091
  children: o.map((i, l) => (0, r.jsx)("img", {
1092
- src: Dt(i.src),
1092
+ src: Lt(i.src),
1093
1093
  alt: `Slide ${l + 1}`,
1094
1094
  className: "slideshow-image",
1095
1095
  style: {
@@ -1099,115 +1099,115 @@ __useblocks__.define("static/core/87969347.js", [
1099
1099
  }, l))
1100
1100
  });
1101
1101
  };
1102
- function Ut({ setModalHeight: t, customRequest: e, aiTabRef: o, isImageUploaded: a, setIsImageUploaded: i, aiImageRequest: l, imageAiList: b, setImageAiList: g, isLoadingAi: d, setIsLoadingAi: R, onPluginAiImageLimitExceeded: x, onImageGenerateLimitExceeded: p }) {
1103
- const { __: w } = m.useI18n(), j = u.useAppConfig(), C = m.useNotification(), U = u.usePushToDataLayer(), { emailId: y, blockId: D, projectId: O } = u.useParams(), [T] = Y.useLazySendAiImageRequestQuery(), [q, { data: N = [] }] = Y.useLazyGetAiImageSSEQuery(), [M] = Y.useLazyGetLimitsStatsByTypeQuery(), z = j?.sendAIImageRequest || T, ee = j?.trigger || q, K = j?.handleLimitUsageEmitter || u.useEventEmitter(u.events.ON_LIMIT_ID), [k, P] = (0, n.useState)(0), [E, I] = (0, n.useState)(null), [A, L] = (0, n.useState)(!1), [J, Q] = (0, n.useState)(w("Evaluating the task")), [s, h] = (0, n.useState)(!1), W = y || D, { limits: le } = j?.limits ? j : { limits: { ai_img_limit: 0 } }, { ai_img_limit: Z } = le, $ = !!(j.limits && j.counters) && u.PLUGIN.isPlugin, X = u.useEventEmitter(u.events.AI_IMAGE_REQUEST_ID).hasListeners(), H = ne.shouldCountAiUsage({
1104
- limitsInPlugin: $,
1105
- hostedAiActive: X
1106
- }), ie = !X && Z > 0 && k >= Z, he = (0, n.useCallback)(() => {
1107
- K.fire({
1102
+ function Bt({ setModalHeight: t, customRequest: e, aiTabRef: o, isImageUploaded: a, setIsImageUploaded: i, aiImageRequest: l, imageAiList: b, setImageAiList: p, isLoadingAi: d, setIsLoadingAi: v, onPluginAiImageLimitExceeded: I, onImageGenerateLimitExceeded: w }) {
1103
+ const { __: C } = m.useI18n(), R = u.useAppConfig(), y = m.useNotification(), L = u.usePushToDataLayer(), { emailId: A, blockId: G, projectId: O } = u.useParams(), [D] = Z.useLazySendAiImageRequestQuery(), [H, { data: B = [] }] = Z.useLazyGetAiImageSSEQuery(), [z] = Z.useLazyGetLimitsStatsByTypeQuery(), V = R?.sendAIImageRequest || D, ee = R?.trigger || H, q = R?.handleLimitUsageEmitter || u.useEventEmitter(u.events.ON_LIMIT_ID), [E, P] = (0, n.useState)(0), [j, x] = (0, n.useState)(null), [S, U] = (0, n.useState)(!1), [_, K] = (0, n.useState)(C("Evaluating the task")), [s, h] = (0, n.useState)(!1), W = A || G, { limits: me } = R?.limits ? R : { limits: { ai_img_limit: 0 } }, { ai_img_limit: T } = me, J = !!(R.limits && R.counters) && u.PLUGIN.isPlugin, $ = u.useEventEmitter(u.events.AI_IMAGE_REQUEST_ID).hasListeners(), F = ne.shouldCountAiUsage({
1104
+ limitsInPlugin: J,
1105
+ hostedAiActive: $
1106
+ }), he = !$ && T > 0 && E >= T, ie = (0, n.useCallback)(() => {
1107
+ q.fire({
1108
1108
  name: "AiImgCount",
1109
- count: k + 1
1109
+ count: E + 1
1110
1110
  });
1111
- }, [K, k]), ye = (0, n.useMemo)(() => !ie && (!H || Z === 0 || k < Z), [
1112
- ie,
1113
- H,
1114
- k,
1115
- Z
1116
- ]), ce = (0, n.useCallback)(async () => {
1117
- Q(w("Evaluating the task")), l !== "" && !d && (R(!0), h(!0), g([]), U({
1111
+ }, [q, E]), pe = (0, n.useMemo)(() => !he && (!F || T === 0 || E < T), [
1112
+ he,
1113
+ F,
1114
+ E,
1115
+ T
1116
+ ]), Ae = (0, n.useCallback)(async () => {
1117
+ K(C("Evaluating the task")), l !== "" && !d && (v(!0), h(!0), p([]), L({
1118
1118
  event: "submit_form",
1119
1119
  action: "ai_image_generation",
1120
- entity_id: y,
1120
+ entity_id: A,
1121
1121
  project_id: O
1122
- }), z({ body: {
1122
+ }), V({ body: {
1123
1123
  project_id: O,
1124
1124
  request: "create-image",
1125
1125
  connection: "midjourney",
1126
1126
  message: l
1127
- } }).then(({ data: v, error: te }) => {
1127
+ } }).then(({ data: g, error: te }) => {
1128
1128
  if (te) throw te;
1129
- if (v.data.status === 401) throw new Error(u.ERROR);
1130
- if (v?.data?._eventResult) {
1131
- g(v.data.task.images), R(!1), h(!1), Q(w("Evaluating the task"));
1129
+ if (g.data.status === 401) throw new Error(u.ERROR);
1130
+ if (g?.data?._eventResult) {
1131
+ p(g.data.task.images), v(!1), h(!1), K(C("Evaluating the task"));
1132
1132
  return;
1133
1133
  }
1134
- v?.data.status === 200 ? (v?.data.task.id && (Q(v.data.task.message), I(v.data.task.id)), v.message && C.success({
1134
+ g?.data.status === 200 ? (g?.data.task.id && (K(g.data.task.message), x(g.data.task.id)), g.message && y.success({
1135
1135
  id: "AI_IMAGE_SEND_SUCCESS",
1136
- title: v.message,
1136
+ title: g.message,
1137
1137
  placement: "bottomRight",
1138
1138
  data: l
1139
1139
  }), ee({
1140
- task_id: v?.data.task.id,
1140
+ task_id: g?.data.task.id,
1141
1141
  entity_id: W
1142
- })) : (R(!1), h(!1), C.error({
1142
+ })) : (v(!1), h(!1), y.error({
1143
1143
  id: "AI_IMAGE_SEND_ERROR",
1144
- title: v?.message || w("Something went wrong, please try again"),
1144
+ title: g?.message || C("Something went wrong, please try again"),
1145
1145
  placement: "bottomRight",
1146
1146
  data: l,
1147
- innerException: v
1147
+ innerException: g
1148
1148
  }));
1149
- }).catch((v) => {
1150
- R(!1), h(!1), (v?.error || v?.data) && C.fromError("AI_IMAGE_SEND_ERROR", l, v.error || v);
1149
+ }).catch((g) => {
1150
+ v(!1), h(!1), (g?.error || g?.data) && y.fromError("AI_IMAGE_SEND_ERROR", l, g.error || g);
1151
1151
  }));
1152
1152
  }, [
1153
1153
  l,
1154
1154
  d,
1155
- R,
1155
+ v,
1156
1156
  h,
1157
- g,
1158
- U,
1159
- y,
1157
+ p,
1158
+ L,
1159
+ A,
1160
1160
  O,
1161
- z,
1162
- C,
1161
+ V,
1162
+ y,
1163
1163
  ee,
1164
1164
  W,
1165
- w
1166
- ]), _ = (0, n.useCallback)(async () => {
1167
- if (ye) {
1168
- if (!u.PLUGIN.isPlugin && !X) {
1169
- const v = F.resolveLimitActionPreflightExceededForType("image_generate", (await M("image_generate")).data?.stats);
1170
- if (v) {
1171
- p?.(v);
1165
+ C
1166
+ ]), Y = (0, n.useCallback)(async () => {
1167
+ if (pe) {
1168
+ if (!u.PLUGIN.isPlugin && !$) {
1169
+ const g = N.resolveLimitActionPreflightExceededForType("image_generate", (await z("image_generate")).data?.stats);
1170
+ if (g) {
1171
+ w?.(g);
1172
1172
  return;
1173
1173
  }
1174
1174
  }
1175
- H && (P((v) => v + 1), he()), ce();
1176
- } else $ && (x ? x() : C.error({
1177
- title: w("The usage limit has been exceeded"),
1178
- description: w(`The maximum number of requests for the current subscription period has been reached.
1175
+ F && (P((g) => g + 1), ie()), Ae();
1176
+ } else J && (I ? I() : y.error({
1177
+ title: C("The usage limit has been exceeded"),
1178
+ description: C(`The maximum number of requests for the current subscription period has been reached.
1179
1179
  Select the appropriate plan to fulfil more requests`),
1180
1180
  placement: "bottomRight"
1181
1181
  }));
1182
1182
  }, [
1183
- ye,
1183
+ pe,
1184
+ J,
1184
1185
  $,
1185
- X,
1186
- H,
1187
- M,
1188
- p,
1186
+ F,
1187
+ z,
1188
+ w,
1189
1189
  P,
1190
- he,
1191
- ce,
1190
+ ie,
1191
+ Ae,
1192
+ y,
1192
1193
  C,
1193
- w,
1194
- x
1194
+ I
1195
1195
  ]);
1196
1196
  (0, n.useEffect)(() => {
1197
- $ && P(j?.counters?.ai_img_counter || 0);
1198
- }, [j, $]);
1199
- const se = u.useEventEmitter(u.events.AI_IMAGE_PROGRESS_ID);
1197
+ J && P(R?.counters?.ai_img_counter || 0);
1198
+ }, [R, J]);
1199
+ const re = u.useEventEmitter(u.events.AI_IMAGE_PROGRESS_ID);
1200
1200
  (0, n.useEffect)(() => {
1201
- const v = se.event(({ progress: te, status: G }) => {
1202
- Q(G || `${Math.round(te)}%`);
1201
+ const g = re.event(({ progress: te, status: X }) => {
1202
+ K(X || `${Math.round(te)}%`);
1203
1203
  });
1204
- return () => v.dispose();
1205
- }, [se]);
1206
- const B = (0, n.useCallback)(async (v) => {
1204
+ return () => g.dispose();
1205
+ }, [re]);
1206
+ const M = (0, n.useCallback)(async (g) => {
1207
1207
  if (!a) {
1208
1208
  i(!0);
1209
1209
  try {
1210
- const te = rt(v) ? await (await fetch(v)).blob() : Xe(v);
1210
+ const te = rt(g) ? await (await fetch(g)).blob() : Xe(g);
1211
1211
  e({ file: new File([te], "image.jpeg", { type: te.type || "image/jpeg" }) });
1212
1212
  } catch {
1213
1213
  i(!1);
@@ -1217,63 +1217,63 @@ Select the appropriate plan to fulfil more requests`),
1217
1217
  a,
1218
1218
  i,
1219
1219
  e
1220
- ]), ae = (0, n.useCallback)((v) => {
1221
- v.status !== "error" && v.status !== "Canceled" ? v.images ? (Q(v.status), v.progress === 100 && (g(v.images), Q(w("Evaluating the task")), I(null), h(!1))) : (g([v.data]), R(!1)) : (R(!1), h(!1), C.error({
1220
+ ]), ae = (0, n.useCallback)((g) => {
1221
+ g.status !== "error" && g.status !== "Canceled" ? g.images ? (K(g.status), g.progress === 100 && (p(g.images), K(C("Evaluating the task")), x(null), h(!1))) : (p([g.data]), v(!1)) : (v(!1), h(!1), y.error({
1222
1222
  id: "AI_IMAGE_GET_ERROR",
1223
- title: w("Something went wrong, please try again"),
1223
+ title: C("Something went wrong, please try again"),
1224
1224
  placement: "bottomRight",
1225
- data: E
1225
+ data: j
1226
1226
  }));
1227
1227
  }, [
1228
- g,
1229
- Q,
1230
- w,
1231
- R,
1232
- t,
1233
- E,
1228
+ p,
1229
+ K,
1234
1230
  C,
1231
+ v,
1232
+ t,
1233
+ j,
1234
+ y,
1235
1235
  h
1236
1236
  ]);
1237
1237
  return (0, n.useEffect)(() => {
1238
- N.length > 1 && ae(N[N.length - 1]);
1239
- }, [N, ae]), (0, n.useEffect)(() => {
1238
+ B.length > 1 && ae(B[B.length - 1]);
1239
+ }, [B, ae]), (0, n.useEffect)(() => {
1240
1240
  (d || b.length > 0) && setTimeout(() => {
1241
- let v = 550;
1242
- o.current && (v = o.current.offsetHeight + 68), t(v);
1241
+ let g = 550;
1242
+ o.current && (g = o.current.offsetHeight + 68), t(g);
1243
1243
  }, 0);
1244
1244
  }, [
1245
1245
  o,
1246
- N,
1246
+ B,
1247
1247
  b.length,
1248
1248
  d,
1249
1249
  t
1250
1250
  ]), {
1251
- aiImageCounter: k,
1251
+ aiImageCounter: E,
1252
1252
  setAiImageCounter: P,
1253
- currentAiImgLimits: Z,
1254
- isFieldsDisabled: ie,
1255
- canGenerateImage: ye,
1253
+ currentAiImgLimits: T,
1254
+ isFieldsDisabled: he,
1255
+ canGenerateImage: pe,
1256
1256
  aiImageRequest: l,
1257
1257
  imageAiList: b,
1258
- setImageAiList: g,
1258
+ setImageAiList: p,
1259
1259
  isLoadingAi: d,
1260
- setIsLoadingAi: R,
1260
+ setIsLoadingAi: v,
1261
1261
  loadingDuringGeneration: s,
1262
1262
  setLoadingDuringGeneration: h,
1263
- requestStatus: J,
1264
- setRequestStatus: Q,
1265
- handleGenerate: _,
1266
- handleLimitAiImgCount: he,
1267
- convertBase64ToFile: B,
1268
- isShiftPressed: A,
1269
- setIsShiftPressed: L,
1270
- currentReqId: E,
1271
- setCurrentReqId: I,
1272
- limitsInPlugin: $
1263
+ requestStatus: _,
1264
+ setRequestStatus: K,
1265
+ handleGenerate: Y,
1266
+ handleLimitAiImgCount: ie,
1267
+ convertBase64ToFile: M,
1268
+ isShiftPressed: S,
1269
+ setIsShiftPressed: U,
1270
+ currentReqId: j,
1271
+ setCurrentReqId: x,
1272
+ limitsInPlugin: J
1273
1273
  };
1274
1274
  }
1275
- var Mt = ({ setModalHeight: t, customRequest: e, aiTabRef: o, inputAiRef: a, isImageUploaded: i, setIsImageUploaded: l, aiImageRequest: b, setAiImageRequest: g, imageAiList: d, setImageAiList: R, isLoadingAi: x, setIsLoadingAi: p }) => {
1276
- const w = u.useNavigate(), j = u.useDispatch(), { __: C, _n: U } = m.useI18n(), y = u.useAppConfig(), [D, O] = (0, n.useState)(!1), [T, q] = (0, n.useState)(null), { aiImageCounter: N, currentAiImgLimits: M, loadingDuringGeneration: z, requestStatus: ee, handleGenerate: K, convertBase64ToFile: k, isShiftPressed: P, setIsShiftPressed: E, limitsInPlugin: I } = Ut({
1275
+ var Ut = ({ setModalHeight: t, customRequest: e, aiTabRef: o, inputAiRef: a, isImageUploaded: i, setIsImageUploaded: l, aiImageRequest: b, setAiImageRequest: p, imageAiList: d, setImageAiList: v, isLoadingAi: I, setIsLoadingAi: w }) => {
1276
+ const C = u.useNavigate(), R = u.useDispatch(), { __: y, _n: L } = m.useI18n(), A = u.useAppConfig(), [G, O] = (0, n.useState)(!1), [D, H] = (0, n.useState)(null), { aiImageCounter: B, currentAiImgLimits: z, loadingDuringGeneration: V, requestStatus: ee, handleGenerate: q, convertBase64ToFile: E, isShiftPressed: P, setIsShiftPressed: j, limitsInPlugin: x } = Bt({
1277
1277
  setModalHeight: t,
1278
1278
  customRequest: e,
1279
1279
  aiTabRef: o,
@@ -1281,58 +1281,58 @@ Select the appropriate plan to fulfil more requests`),
1281
1281
  setIsImageUploaded: l,
1282
1282
  aiImageRequest: b,
1283
1283
  imageAiList: d,
1284
- setImageAiList: R,
1285
- isLoadingAi: x,
1286
- setIsLoadingAi: p,
1284
+ setImageAiList: v,
1285
+ isLoadingAi: I,
1286
+ setIsLoadingAi: w,
1287
1287
  onPluginAiImageLimitExceeded: () => O(!0),
1288
- onImageGenerateLimitExceeded: q
1289
- }), A = D && M > 0 ? ne.getAiTariffUpgradeStep(M) : null, L = A ? F.getLimitUpgradePresetDefinition(A.presetId) : null, J = T ? F.getLimitUpgradePresetDefinition(T.presetId) : null, [Q, s] = (0, n.useState)(!1), h = (0, n.useCallback)(() => s(!0), []), W = (0, n.useCallback)(() => s(!1), []), le = (0, n.useCallback)((H) => g(H.target.value), [g]), Z = (0, n.useCallback)((H) => {
1290
- H.key === "Shift" ? E(!0) : H.key === "Enter" && !P && (H.preventDefault(), K());
1288
+ onImageGenerateLimitExceeded: H
1289
+ }), S = G && z > 0 ? ne.getAiTariffUpgradeStep(z) : null, U = S ? N.getLimitUpgradePresetDefinition(S.presetId) : null, _ = D ? N.getLimitUpgradePresetDefinition(D.presetId) : null, [K, s] = (0, n.useState)(!1), h = (0, n.useCallback)(() => s(!0), []), W = (0, n.useCallback)(() => s(!1), []), me = (0, n.useCallback)((F) => p(F.target.value), [p]), T = (0, n.useCallback)((F) => {
1290
+ F.key === "Shift" ? j(!0) : F.key === "Enter" && !P && (F.preventDefault(), q());
1291
1291
  }, [
1292
1292
  P,
1293
- K,
1294
- E
1295
- ]), $ = (0, n.useCallback)((H) => {
1296
- H.key === "Shift" && E(!1);
1297
- }, [E]), X = d[d.length - 1];
1293
+ q,
1294
+ j
1295
+ ]), J = (0, n.useCallback)((F) => {
1296
+ F.key === "Shift" && j(!1);
1297
+ }, [j]), $ = d[d.length - 1];
1298
1298
  return (0, r.jsxs)("div", {
1299
1299
  className: "image-ai",
1300
1300
  children: [
1301
- L && A ? (0, r.jsx)(F.LimitUpgradeModal, {
1301
+ U && S ? (0, r.jsx)(N.LimitUpgradeModal, {
1302
1302
  open: !0,
1303
1303
  onClose: () => O(!1),
1304
- title: C(L.titleKey),
1305
- subtitle: C(L.subtitleKey),
1306
- usageResource: L.usageResource,
1307
- previousDisplay: F.presetLimitDisplay(A.previousLimit),
1308
- nextDisplay: F.presetLimitDisplay(A.nextLimit),
1304
+ title: y(U.titleKey),
1305
+ subtitle: y(U.subtitleKey),
1306
+ usageResource: U.usageResource,
1307
+ previousDisplay: N.presetLimitDisplay(S.previousLimit),
1308
+ nextDisplay: N.presetLimitDisplay(S.nextLimit),
1309
1309
  onChangePlan: () => {
1310
- O(!1), document.body.classList.remove("editor"), w("/billing"), j(Y.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1310
+ O(!1), document.body.classList.remove("editor"), C("/billing"), R(Z.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1311
1311
  }
1312
1312
  }) : null,
1313
- J && T ? (0, r.jsx)(F.LimitUpgradeModal, {
1313
+ _ && D ? (0, r.jsx)(N.LimitUpgradeModal, {
1314
1314
  open: !0,
1315
- onClose: () => q(null),
1316
- title: C(J.titleKey),
1317
- subtitle: C(J.subtitleKey),
1318
- usageResource: J.usageResource,
1319
- previousDisplay: F.presetLimitDisplay(T.previousLimit),
1320
- nextDisplay: F.presetLimitDisplay(T.nextLimit),
1315
+ onClose: () => H(null),
1316
+ title: y(_.titleKey),
1317
+ subtitle: y(_.subtitleKey),
1318
+ usageResource: _.usageResource,
1319
+ previousDisplay: N.presetLimitDisplay(D.previousLimit),
1320
+ nextDisplay: N.presetLimitDisplay(D.nextLimit),
1321
1321
  onChangePlan: () => {
1322
- q(null), document.body.classList.remove("editor"), w("/billing"), j(Y.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1322
+ H(null), document.body.classList.remove("editor"), C("/billing"), R(Z.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1323
1323
  }
1324
1324
  }) : null,
1325
- I && (0, r.jsx)(m.LimitsCounter, {
1326
- text: `${N} ${C("of")} ${M > 0 ? M : "∞"} images ${U("was used", "were used", N)}`,
1327
- exceeded: M > 0 && N >= M,
1325
+ x && (0, r.jsx)(m.LimitsCounter, {
1326
+ text: `${B} ${y("of")} ${z > 0 ? z : "∞"} images ${L("was used", "were used", B)}`,
1327
+ exceeded: z > 0 && B >= z,
1328
1328
  style: { marginTop: -25 },
1329
1329
  extra: (0, r.jsx)("span", {
1330
1330
  style: {
1331
1331
  textDecoration: "underline",
1332
1332
  cursor: "pointer"
1333
1333
  },
1334
- onClick: () => w(y.billingPageUrl || u.APP_ROUTES.billing),
1335
- children: C("Need more?")
1334
+ onClick: () => C(A.billingPageUrl || u.APP_ROUTES.billing),
1335
+ children: y("Need more?")
1336
1336
  })
1337
1337
  }),
1338
1338
  (0, r.jsx)(m.Row, {
@@ -1343,43 +1343,43 @@ Select the appropriate plan to fulfil more requests`),
1343
1343
  children: (0, r.jsx)(m.Form.Item, {
1344
1344
  style: { margin: 0 },
1345
1345
  children: (0, r.jsxs)("span", {
1346
- className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${Q ? " ant-input-affix-wrapper-focused" : ""}`,
1346
+ className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${K ? " ant-input-affix-wrapper-focused" : ""}`,
1347
1347
  children: [(0, r.jsx)(m.TextArea, {
1348
1348
  ref: a,
1349
- onKeyDown: Z,
1350
- onKeyUp: $,
1349
+ onKeyDown: T,
1350
+ onKeyUp: J,
1351
1351
  onFocus: h,
1352
1352
  onBlur: W,
1353
1353
  autoSize: !0,
1354
1354
  allowClear: !0,
1355
1355
  className: "text-area-input-hybrid image-ai__textarea",
1356
- placeholder: C("Generate image"),
1356
+ placeholder: y("Generate image"),
1357
1357
  value: b,
1358
- onChange: le,
1358
+ onChange: me,
1359
1359
  spellCheck: "false"
1360
1360
  }), (0, r.jsx)("span", {
1361
1361
  className: "ant-input-suffix image-ai__input-suffix",
1362
- children: x || z ? (0, r.jsx)(F.EmIcons, {
1362
+ children: I || V ? (0, r.jsx)(N.EmIcons, {
1363
1363
  icon: "LoadingOutlined",
1364
1364
  className: "input-icon image-ai__input-icon",
1365
1365
  spin: !0
1366
- }) : (0, r.jsx)(F.EmIcons, {
1366
+ }) : (0, r.jsx)(N.EmIcons, {
1367
1367
  icon: "AI",
1368
1368
  className: "input-icon image-ai__input-icon",
1369
- onClick: K
1369
+ onClick: q
1370
1370
  })
1371
1371
  })]
1372
1372
  })
1373
1373
  })
1374
1374
  })
1375
1375
  }),
1376
- (x || d.length > 0) && (0, r.jsxs)("div", {
1376
+ (I || d.length > 0) && (0, r.jsxs)("div", {
1377
1377
  className: "image-ai__preview",
1378
- children: [x && d.length === 0 && (0, r.jsx)("div", {
1378
+ children: [I && d.length === 0 && (0, r.jsx)("div", {
1379
1379
  className: "image-ai__loading",
1380
1380
  children: (0, r.jsxs)("div", {
1381
1381
  className: "spin",
1382
- children: [(0, r.jsx)(F.EmIcons, {
1382
+ children: [(0, r.jsx)(N.EmIcons, {
1383
1383
  icon: "LoadingOutlined",
1384
1384
  style: { fontSize: 48 },
1385
1385
  spin: !0
@@ -1390,77 +1390,77 @@ Select the appropriate plan to fulfil more requests`),
1390
1390
  })
1391
1391
  }), d.length > 0 && (0, r.jsxs)("div", {
1392
1392
  className: "image-ai__image-item",
1393
- children: [(0, r.jsx)(Bt, { images: d }), (0, r.jsx)("div", {
1393
+ children: [(0, r.jsx)(Dt, { images: d }), (0, r.jsx)("div", {
1394
1394
  className: "buttons",
1395
1395
  children: (0, r.jsx)(m.Button, {
1396
- onClick: () => k(X),
1397
- icon: (0, r.jsx)(F.EmIcons, { icon: "CheckOutlined" }),
1398
- children: C("Use this one")
1396
+ onClick: () => E($),
1397
+ icon: (0, r.jsx)(N.EmIcons, { icon: "CheckOutlined" }),
1398
+ children: y("Use this one")
1399
1399
  })
1400
1400
  })]
1401
1401
  })]
1402
1402
  })
1403
1403
  ]
1404
1404
  });
1405
- }, Pt = ({ setNewLink: t, setCurrentImageLink: e, setModalHeight: o, setModalWidth: a, setImageGifList: i, imageGifList: l, currentReqGif: b, setCurrentReqGif: g, inputRef: d, setStockLink: R, customRequest: x }) => {
1406
- const { __: p } = m.useI18n(), w = u.useAppConfig(), j = u.useIsStandalone(), C = m.useNotification(), [U, y] = (0, n.useState)(null), [D, O] = (0, n.useState)(!1), [T, q] = (0, n.useState)(25), [N] = Y.useLazyGetSearchGifQuery(), M = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : p("Failed to load GIFs through the configured proxy chain."), [p]), z = (0, n.useCallback)((s) => {
1407
- C.error({
1405
+ }, Mt = ({ setNewLink: t, setCurrentImageLink: e, setModalHeight: o, setModalWidth: a, setImageGifList: i, imageGifList: l, currentReqGif: b, setCurrentReqGif: p, inputRef: d, setStockLink: v, customRequest: I }) => {
1406
+ const { __: w } = m.useI18n(), C = u.useAppConfig(), R = u.useIsStandalone(), y = m.useNotification(), [L, A] = (0, n.useState)(null), [G, O] = (0, n.useState)(!1), [D, H] = (0, n.useState)(25), [B] = Z.useLazyGetSearchGifQuery(), z = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : w("Failed to load GIFs through the configured proxy chain."), [w]), V = (0, n.useCallback)((s) => {
1407
+ y.error({
1408
1408
  id: "STOCK_GIFS_SEARCH_FAILED",
1409
- title: p("Failed to load GIFs"),
1410
- description: M(s)
1409
+ title: w("Failed to load GIFs"),
1410
+ description: z(s)
1411
1411
  });
1412
1412
  }, [
1413
- p,
1414
- M,
1415
- C
1413
+ w,
1414
+ z,
1415
+ y
1416
1416
  ]), ee = async () => {
1417
- D || (O(!0), N({
1417
+ G || (O(!0), B({
1418
1418
  query: b,
1419
- page: T
1419
+ page: D
1420
1420
  }).then((s) => {
1421
1421
  if (s?.error) {
1422
- z(s.error), O(!1);
1422
+ V(s.error), O(!1);
1423
1423
  return;
1424
1424
  }
1425
- i((h) => [...h, ...s.data.data]), O(!1), q((h) => h + 25);
1425
+ i((h) => [...h, ...s.data.data]), O(!1), H((h) => h + 25);
1426
1426
  }).catch(() => {
1427
1427
  O(!1);
1428
1428
  }));
1429
- }, K = async () => {
1430
- const s = await N({
1429
+ }, q = async () => {
1430
+ const s = await B({
1431
1431
  query: b,
1432
1432
  page: 0
1433
1433
  });
1434
1434
  if (s?.error) {
1435
- z(s.error), i([]);
1435
+ V(s.error), i([]);
1436
1436
  return;
1437
1437
  }
1438
1438
  s?.data?.data?.length > 0 && (i(s.data.data), setTimeout(() => {
1439
1439
  o("84vh"), a(1060);
1440
1440
  }, 0));
1441
- }, k = (s, h) => {
1442
- y(h), setTimeout(() => {
1443
- y(null);
1444
- }, 2e3), R(`${s}`), e(`${s}`), x(`${s}`);
1445
- }, P = { default: 3 }, E = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
1446
- config: w,
1447
- standalone: j,
1441
+ }, E = (s, h) => {
1442
+ A(h), setTimeout(() => {
1443
+ A(null);
1444
+ }, 2e3), v(`${s}`), e(`${s}`), I(`${s}`);
1445
+ }, P = { default: 3 }, j = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
1446
+ config: C,
1447
+ standalone: R,
1448
1448
  resourceType: "generic",
1449
1449
  intent: "display"
1450
- }), [w, j]), { getDisplaySrc: I, handleLoad: A, handleError: L } = tt({
1450
+ }), [C, R]), { getDisplaySrc: x, handleLoad: S, handleError: U } = tt({
1451
1451
  items: l,
1452
1452
  getItemId: (0, n.useCallback)((s) => s.id, []),
1453
1453
  getRequestUrl: (0, n.useCallback)((s) => s.images.downsized.url, []),
1454
- createController: E
1455
- }), J = (s) => (h) => {
1456
- A(s), h.target.parentNode.classList.add("loaded");
1457
- }, Q = (s) => () => {
1458
- L(s);
1454
+ createController: j
1455
+ }), _ = (s) => (h) => {
1456
+ S(s), h.target.parentNode.classList.add("loaded");
1457
+ }, K = (s) => () => {
1458
+ U(s);
1459
1459
  };
1460
1460
  return (0, r.jsxs)("div", {
1461
1461
  className: "stock-tab",
1462
1462
  children: [(0, r.jsxs)(m.Form, {
1463
- onValuesChange: K,
1463
+ onValuesChange: q,
1464
1464
  className: l.length > 0 ? "serach-results" : "",
1465
1465
  children: [(0, r.jsx)(m.Row, {
1466
1466
  gutter: 24,
@@ -1469,12 +1469,12 @@ Select the appropriate plan to fulfil more requests`),
1469
1469
  children: (0, r.jsx)(m.Form.Item, {
1470
1470
  className: "stock-search-input",
1471
1471
  children: (0, r.jsx)(m.SearchInput, {
1472
- onSearch: K,
1472
+ onSearch: q,
1473
1473
  allowClear: !0,
1474
1474
  size: l.length > 0 ? "medium" : "large",
1475
- placeholder: p("Search GIFs"),
1475
+ placeholder: w("Search GIFs"),
1476
1476
  value: b.keywords,
1477
- onChange: (s) => g((h) => ({
1477
+ onChange: (s) => p((h) => ({
1478
1478
  ...h,
1479
1479
  keywords: s.target.value
1480
1480
  })),
@@ -1513,7 +1513,7 @@ Select the appropriate plan to fulfil more requests`),
1513
1513
  hasMore: l,
1514
1514
  endMessage: (0, r.jsxs)(m.Divider, {
1515
1515
  plain: !0,
1516
- children: [p("That`s all we could find."), " 🤐"]
1516
+ children: [w("That`s all we could find."), " 🤐"]
1517
1517
  }),
1518
1518
  scrollableTarget: "scrollableDiv",
1519
1519
  style: { overflow: "visible" },
@@ -1524,15 +1524,15 @@ Select the appropriate plan to fulfil more requests`),
1524
1524
  columnClassName: "my-masonry-grid_column",
1525
1525
  children: l.map((s, h) => (0, r.jsxs)("div", {
1526
1526
  className: "list-item",
1527
- onClick: () => k(s.images.downsized.url, s.id),
1527
+ onClick: () => E(s.images.downsized.url, s.id),
1528
1528
  children: [
1529
1529
  (0, r.jsx)("img", {
1530
- className: U === s.id ? "loaded-image" : "",
1530
+ className: L === s.id ? "loaded-image" : "",
1531
1531
  width: "322px",
1532
- src: I(s),
1532
+ src: x(s),
1533
1533
  alt: s.title,
1534
- onLoad: J(s),
1535
- onError: Q(s)
1534
+ onLoad: _(s),
1535
+ onError: K(s)
1536
1536
  }),
1537
1537
  (0, r.jsx)("a", {
1538
1538
  rel: "noreferrer",
@@ -1544,7 +1544,7 @@ Select the appropriate plan to fulfil more requests`),
1544
1544
  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=)" }
1545
1545
  })
1546
1546
  }),
1547
- U === s.id && (0, r.jsx)(m.Spin, {
1547
+ L === s.id && (0, r.jsx)(m.Spin, {
1548
1548
  className: "ant-spin",
1549
1549
  size: "small"
1550
1550
  })
@@ -1556,10 +1556,10 @@ Select the appropriate plan to fulfil more requests`),
1556
1556
  })]
1557
1557
  });
1558
1558
  };
1559
- function Tt(t) {
1559
+ function Pt(t) {
1560
1560
  if (!(t == null || t === "")) return t;
1561
1561
  }
1562
- async function Nt(t, e) {
1562
+ async function Tt(t, e) {
1563
1563
  if (t) {
1564
1564
  if (t.url) return t.url;
1565
1565
  if (typeof e.getFileById == "function" && t.id) {
@@ -1579,7 +1579,7 @@ Select the appropriate plan to fulfil more requests`),
1579
1579
  return t.thumbnail || t.thumbnailUrl;
1580
1580
  }
1581
1581
  }
1582
- function Ft(t) {
1582
+ function Nt(t) {
1583
1583
  if (!(!t?.success || !Array.isArray(t.detailed))) return t.detailed.find((e) => e?.success && e.data)?.data;
1584
1584
  }
1585
1585
  function Gt(t, e, o) {
@@ -1602,11 +1602,11 @@ Select the appropriate plan to fulfil more requests`),
1602
1602
  childrenCount: t.childrenCount
1603
1603
  };
1604
1604
  }
1605
- async function zt(t, e, o) {
1605
+ async function Ft(t, e, o) {
1606
1606
  if (!e) return;
1607
- const a = Tt(o ?? e.rootId);
1607
+ const a = Pt(o ?? e.rootId);
1608
1608
  let i;
1609
- typeof e.uploadFiles == "function" ? i = Ft(await e.uploadFiles({
1609
+ typeof e.uploadFiles == "function" ? i = Nt(await e.uploadFiles({
1610
1610
  folderId: a,
1611
1611
  items: [{
1612
1612
  name: t.name,
@@ -1622,133 +1622,131 @@ Select the appropriate plan to fulfil more requests`),
1622
1622
  folderId: a,
1623
1623
  data: t
1624
1624
  }), t, a));
1625
- const l = await Nt(i, e);
1625
+ const l = await Tt(i, e);
1626
1626
  return l ? {
1627
1627
  item: i,
1628
1628
  url: l
1629
1629
  } : void 0;
1630
1630
  }
1631
- var st = "IMG", at = "BACKGROUND", Kt = "GALLERY", Ae = "EDITOR", pe = "UPLOAD", Ge = "STOCK", ze = "GIF", Ke = "AI", Wt = { mode: "select" }, Ht = { mode: "save" }, { Dragger: Vt } = m.Upload, qt = (t, e = "image") => Y.decodeFileNameFromUrl(t) ?? e, ke = ne.normalizeImageFormatForDisplay, Qt = (t, e) => {
1632
- const o = ke(e);
1631
+ var st = "IMG", at = "BACKGROUND", zt = "GALLERY", we = "EDITOR", fe = "UPLOAD", Fe = "STOCK", ze = "GIF", Ke = "AI", Kt = { mode: "select" }, Wt = { mode: "save" }, { Dragger: Ht } = m.Upload, Vt = (t, e = "image") => Z.decodeFileNameFromUrl(t) ?? e, je = ne.normalizeImageFormatForDisplay, qt = (t, e) => {
1632
+ const o = je(e);
1633
1633
  return !o || t.includes(".") ? t : `${t}.${o}`;
1634
- }, _t = (t, e) => new File([t], Qt(qt(e), t.type), { type: t.type || "application/octet-stream" }), ot = ({ dataProvider: t }) => {
1635
- const e = u.useAppConfig(), o = u.useIsStandalone(), { __: a } = m.useI18n(), i = u.useDispatch(), { projectId: l } = u.useParams(), [b] = Y.useLazyGetImageInfoQuery(), { modal: g } = m.App.useApp(), d = m.useNotification(), R = u.useSelector(u.selectedIsUserPaySmth), x = u.useSelector(u.selectedCurrentUser), p = u.useSelector(Y.selectActiveModal), { request: w, resolveImagePicker: j } = F.useImagePicker(), [C, U] = (0, n.useState)(""), [y, D] = (0, n.useState)(""), [O, T] = (0, n.useState)(""), [q, N] = (0, n.useState)(""), [M, z] = (0, n.useState)(pe), [ee, K] = (0, n.useState)({
1634
+ }, Qt = (t, e) => new File([t], qt(Vt(e), t.type), { type: t.type || "application/octet-stream" }), ot = ({ dataProvider: t }) => {
1635
+ const e = u.useAppConfig(), o = u.useIsStandalone(), { __: a } = m.useI18n(), i = u.useDispatch(), { projectId: l } = u.useParams(), [b] = Z.useLazyGetImageInfoQuery(), { modal: p } = m.App.useApp(), d = m.useNotification(), v = u.useSelector(Z.selectActiveModal), { request: I, resolveImagePicker: w } = N.useImagePicker(), [C, R] = (0, n.useState)(""), [y, L] = (0, n.useState)(""), [A, G] = (0, n.useState)(""), [O, D] = (0, n.useState)(""), [H, B] = (0, n.useState)(fe), [z, V] = (0, n.useState)({
1636
1636
  width: "",
1637
1637
  height: "",
1638
1638
  size: "",
1639
1639
  format: ""
1640
- }), [k, P] = (0, n.useState)("success"), [E, I] = (0, n.useState)(!1), A = n.default.useRef(null), L = n.default.useRef(null), J = n.default.useRef(null), Q = n.default.useRef(null), s = n.default.useRef(null), h = n.default.useRef(null), W = n.default.useRef(null), le = n.default.useRef(null), Z = n.default.useRef(null), [$, X] = (0, n.useState)("auto"), [H, ie] = (0, n.useState)(572), [he, ye] = (0, n.useState)(!1), [ce, _] = (0, n.useState)({
1640
+ }), [ee, q] = (0, n.useState)("success"), [E, P] = (0, n.useState)(!1), j = n.default.useRef(null), x = n.default.useRef(null), S = n.default.useRef(null), U = n.default.useRef(null), _ = n.default.useRef(null), K = n.default.useRef(null), s = n.default.useRef(null), h = n.default.useRef(null), W = n.default.useRef(null), [me, T] = (0, n.useState)("auto"), [J, $] = (0, n.useState)(572), [F, he] = (0, n.useState)(!1), [ie, pe] = (0, n.useState)({
1641
1641
  keywords: "",
1642
1642
  color: "",
1643
1643
  orientation: ""
1644
- }), [se, B] = (0, n.useState)({ keywords: "" }), [ae, v] = (0, n.useState)([]), [te, G] = (0, n.useState)([]), [de, Yt] = (0, n.useState)([]), [it, lt] = (0, n.useState)(!1), [ct, We] = (0, n.useState)(""), [Zt, Ee] = (0, n.useState)(!1), [Xt, Be] = (0, n.useState)(0), He = u.useSelector(u.selectProject), ut = He?.id !== void 0 ? String(He.id) : l || "", dt = u.useEventEmitter(u.events.UPLOAD_EVENT_ID), Ie = n.default.useRef(ne.createImageUrlBlobResolver()), Ve = n.default.useRef(""), be = n.default.useRef(0), xe = n.default.useRef(""), [Jt, ft] = (0, n.useState)(""), [$t, mt] = (0, n.useState)(null), [en, qe] = (0, n.useState)(""), Ue = (0, n.useCallback)((c) => {
1644
+ }), [Ae, Y] = (0, n.useState)({ keywords: "" }), [re, M] = (0, n.useState)([]), [ae, g] = (0, n.useState)([]), [te, X] = (0, n.useState)([]), [ce, it] = (0, n.useState)(!1), [lt, We] = (0, n.useState)(""), [_t, Ee] = (0, n.useState)(!1), [Yt, Be] = (0, n.useState)(0), He = u.useSelector(u.selectProject), ct = He?.id !== void 0 ? String(He.id) : l || "", ut = u.useEventEmitter(u.events.UPLOAD_EVENT_ID), Ie = n.default.useRef(ne.createImageUrlBlobResolver()), Ve = n.default.useRef(""), Ce = n.default.useRef(0), xe = n.default.useRef(""), [Zt, dt] = (0, n.useState)(""), [Xt, ft] = (0, n.useState)(null), [Jt, qe] = (0, n.useState)(""), Ue = (0, n.useCallback)((c) => {
1645
1645
  if (!(c instanceof Blob)) return;
1646
1646
  xe.current && URL.revokeObjectURL(xe.current);
1647
1647
  const f = URL.createObjectURL(c);
1648
- xe.current = f, ft(f), mt(c);
1648
+ xe.current = f, dt(f), ft(c);
1649
1649
  }, []), ge = (0, n.useCallback)(() => {
1650
- xe.current && (URL.revokeObjectURL(xe.current), xe.current = ""), ft(""), mt(null);
1651
- }, []), ue = (0, n.useCallback)(() => {
1650
+ xe.current && (URL.revokeObjectURL(xe.current), xe.current = ""), dt(""), ft(null);
1651
+ }, []), le = (0, n.useCallback)(() => {
1652
1652
  qe("");
1653
- }, []);
1654
- let ve = !(R || !F.isProjectOwner(He, x));
1655
- const tn = (c) => {
1656
- D(c.target.value);
1657
- }, Me = (0, n.useCallback)((c, f, S = a("The image could not be uploaded.")) => {
1658
- const V = f instanceof Error ? f.message : S;
1653
+ }, []), ye = N.isEditorLockedByPlan(He, { isPlugin: u.PLUGIN.isPlugin }), $t = (c) => {
1654
+ L(c.target.value);
1655
+ }, Me = (0, n.useCallback)((c, f, k = a("The image could not be uploaded.")) => {
1656
+ const Q = f instanceof Error ? f.message : k;
1659
1657
  d.error({
1660
1658
  id: "IMAGE_UPLOAD_ERROR",
1661
1659
  data: c,
1662
1660
  title: a("Upload failed"),
1663
- description: V
1661
+ description: Q
1664
1662
  });
1665
- }, [a, d]), nn = (0, n.useCallback)(async (c) => F.pickUploadImageUrlFromFireResults(await dt.fire({
1663
+ }, [a, d]), en = (0, n.useCallback)(async (c) => N.pickUploadImageUrlFromFireResults(await ut.fire({
1666
1664
  file: c,
1667
- project: ut
1668
- })), [ut, dt]), we = ne.useImageBlobFetch(), rn = (0, n.useCallback)((c) => Ie.current.resolve(ne.canonicalImageUrlKey(c), void 0, we), [we]), Pe = async (c) => {
1665
+ project: ct
1666
+ })), [ct, ut]), be = ne.useImageBlobFetch(), tn = (0, n.useCallback)((c) => Ie.current.resolve(ne.canonicalImageUrlKey(c), void 0, be), [be]), Pe = async (c) => {
1669
1667
  if (c) try {
1670
- const f = await sn(c);
1668
+ const f = await nn(c);
1671
1669
  f && _e(f) ? await Oe({ file: f }) : f || Me({ url: c }, null, a("Failed to download image from URL."));
1672
1670
  } catch (f) {
1673
1671
  Me({ url: c }, f, a("Failed to process image URL."));
1674
1672
  }
1675
- }, pt = n.default.useRef(Pe);
1676
- pt.current = Pe, n.default.useEffect(() => {
1677
- if (M !== pe || !q) return;
1673
+ }, mt = n.default.useRef(Pe);
1674
+ mt.current = Pe, n.default.useEffect(() => {
1675
+ if (H !== fe || !O) return;
1678
1676
  const c = y.trim();
1679
1677
  if (!c || !c.toLowerCase().startsWith("http")) return;
1680
1678
  const f = setTimeout(() => {
1681
- pt.current(c);
1679
+ mt.current(c);
1682
1680
  }, 1e3);
1683
1681
  return () => {
1684
1682
  clearTimeout(f);
1685
1683
  };
1686
1684
  }, [
1687
1685
  y,
1688
- M,
1689
- q
1686
+ H,
1687
+ O
1690
1688
  ]);
1691
- const sn = async (c) => {
1689
+ const nn = async (c) => {
1692
1690
  try {
1693
1691
  const f = ne.canonicalImageUrlKey(c);
1694
- return _t(await Ie.current.resolve(f, void 0, we), f);
1692
+ return Qt(await Ie.current.resolve(f, void 0, be), f);
1695
1693
  } catch {}
1696
1694
  };
1697
1695
  document.onpaste = function(c) {
1698
1696
  const f = c.clipboardData?.items?.[0];
1699
- if (M === pe && q) {
1697
+ if (H === fe && O) {
1700
1698
  if (f?.type?.indexOf("image") === 0 && e.imageCenterLocalUploadEnabled !== !1) {
1701
- const V = f.getAsFile();
1702
- _e(V);
1703
- const oe = { file: V };
1704
- D(""), Oe(oe);
1699
+ const Q = f.getAsFile();
1700
+ _e(Q);
1701
+ const oe = { file: Q };
1702
+ L(""), Oe(oe);
1705
1703
  return;
1706
1704
  }
1707
- const S = c.clipboardData?.getData("text/plain");
1708
- if (S && S.trim().toLowerCase().startsWith("http")) {
1709
- c.preventDefault(), c.stopPropagation(), D(S.trim());
1705
+ const k = c.clipboardData?.getData("text/plain");
1706
+ if (k && k.trim().toLowerCase().startsWith("http")) {
1707
+ c.preventDefault(), c.stopPropagation(), L(k.trim());
1710
1708
  return;
1711
1709
  }
1712
- f?.type?.indexOf("text") === 0 && f.getAsString((V) => {
1713
- if (V.trim().toLowerCase().startsWith("http")) D(V.trim());
1714
- else if (V.toString().slice(1, 5) === "meta") {
1715
- const oe = V.toString().split("\"")[1];
1716
- oe && D(oe);
1710
+ f?.type?.indexOf("text") === 0 && f.getAsString((Q) => {
1711
+ if (Q.trim().toLowerCase().startsWith("http")) L(Q.trim());
1712
+ else if (Q.toString().slice(1, 5) === "meta") {
1713
+ const oe = Q.toString().split("\"")[1];
1714
+ oe && L(oe);
1717
1715
  }
1718
1716
  });
1719
1717
  }
1720
1718
  }, (0, n.useEffect)(() => {
1721
1719
  const c = (f) => {
1722
- let S = null;
1723
- w?.kind === "background" ? (S = at, N(at)) : w?.kind === "img" && (N(st), S = st), w?.currentUrl && S && (U(w.currentUrl), z(f));
1720
+ let k = null;
1721
+ I?.kind === "background" ? (k = at, D(at)) : I?.kind === "img" && (D(st), k = st), I?.currentUrl && k && (R(I.currentUrl), B(f));
1724
1722
  };
1725
- p === u.MODALS.UPLOAD_IMAGE_MODAL || p === u.MODALS.UPLOAD_BACKGROUND_MODAL ? c(Ae) : p === u.MODALS.UPLOAD_IMAGE_MODAL_AI || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (ve ? (Ee(!0), Be(2)) : c(Ke), setTimeout(() => Z.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(pe), setTimeout(() => h.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_STOCK || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (ve ? (Ee(!0), Be(3)) : c(Ge), setTimeout(() => le.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_GIF || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (ve ? (Ee(!0), Be(3)) : c(ze), setTimeout(() => W.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_EDIT || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (ve ? (Ee(!0), Be(5)) : c(Ae), i(Y.openSecondModal(u.MODALS.IMAGE_EDITOR_MODAL))) : N("");
1723
+ v === u.MODALS.UPLOAD_IMAGE_MODAL || v === u.MODALS.UPLOAD_BACKGROUND_MODAL ? c(we) : v === u.MODALS.UPLOAD_IMAGE_MODAL_AI || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (ye ? (Ee(!0), Be(2)) : c(Ke), setTimeout(() => W.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(fe), setTimeout(() => K.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_STOCK || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (ye ? (Ee(!0), Be(3)) : c(Fe), setTimeout(() => h.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_GIF || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (ye ? (Ee(!0), Be(3)) : c(ze), setTimeout(() => s.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_EDIT || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (ye ? (Ee(!0), Be(5)) : c(we), i(Z.openSecondModal(u.MODALS.IMAGE_EDITOR_MODAL))) : D("");
1726
1724
  }, [
1727
- p,
1725
+ v,
1728
1726
  i,
1729
- ve,
1730
- w
1727
+ ye,
1728
+ I
1731
1729
  ]);
1732
- const Qe = (0, n.useCallback)(({ url: c = C || "", meta: f = Wt }) => {
1733
- U(c), j({
1730
+ const Qe = (0, n.useCallback)(({ url: c = C || "", meta: f = Kt }) => {
1731
+ R(c), w({
1734
1732
  url: c,
1735
1733
  meta: f
1736
1734
  }), setTimeout(() => {
1737
- ue(), ge(), _({
1735
+ le(), ge(), pe({
1738
1736
  keywords: "",
1739
1737
  color: "",
1740
1738
  orientation: ""
1741
- }), B({ keywords: "" }), G([]), v([]), N(""), We(""), lt(!1), T(""), D(""), z(pe);
1742
- }, 200), i(Y.closeModal()), i(Y.closeSecondModal());
1739
+ }), Y({ keywords: "" }), g([]), M([]), D(""), We(""), it(!1), G(""), L(""), B(fe);
1740
+ }, 200), i(Z.closeModal()), i(Z.closeSecondModal());
1743
1741
  }, [
1744
1742
  C,
1745
- ue,
1743
+ le,
1746
1744
  i,
1747
- j,
1745
+ w,
1748
1746
  ge
1749
- ]), gt = (0, n.useCallback)((c, f) => (X("auto"), I(!1), Qe({
1747
+ ]), pt = (0, n.useCallback)((c, f) => (T("auto"), P(!1), Qe({
1750
1748
  url: c,
1751
- meta: Ht
1749
+ meta: Wt
1752
1750
  }), d.success({
1753
1751
  id: "IMAGE_UPLOAD_SUCCESS",
1754
1752
  data: f,
@@ -1759,161 +1757,161 @@ Select the appropriate plan to fulfil more requests`),
1759
1757
  d
1760
1758
  ]);
1761
1759
  (0, n.useEffect)(() => {
1762
- const c = y || O, f = ne.canonicalImageUrlKey(c);
1760
+ const c = y || A, f = ne.canonicalImageUrlKey(c);
1763
1761
  if (!c || !f) {
1764
- P(""), Ve.current = "", ue(), ge(), Ie.current.invalidateAll();
1762
+ q(""), Ve.current = "", le(), ge(), Ie.current.invalidateAll();
1765
1763
  return;
1766
1764
  }
1767
- const S = Ve.current;
1768
- S && S !== f && (Ie.current.abandonKey(S), ue(), ge()), Ve.current = f;
1769
- const V = new AbortController(), oe = y ? 800 : 0, re = ++be.current, Ye = setTimeout(async () => {
1765
+ const k = Ve.current;
1766
+ k && k !== f && (Ie.current.abandonKey(k), le(), ge()), Ve.current = f;
1767
+ const Q = new AbortController(), oe = y ? 800 : 0, se = ++Ce.current, Ye = setTimeout(async () => {
1770
1768
  try {
1771
1769
  const Se = async () => {
1772
- const fe = await Ie.current.resolve(f, V.signal, we);
1773
- if (re !== be.current) return;
1774
- const { width: Ce, height: cn } = await ne.getImageDimensionsFromBlob(fe);
1775
- re === be.current && (K({
1776
- width: Ce,
1777
- height: cn,
1778
- size: (fe.size / 1024).toFixed(2),
1779
- format: ke(fe.type)
1780
- }), ue(), Ue(fe));
1770
+ const ue = await Ie.current.resolve(f, Q.signal, be);
1771
+ if (se !== Ce.current) return;
1772
+ const { width: ve, height: on } = await ne.getImageDimensionsFromBlob(ue);
1773
+ se === Ce.current && (V({
1774
+ width: ve,
1775
+ height: on,
1776
+ size: (ue.size / 1024).toFixed(2),
1777
+ format: je(ue.type)
1778
+ }), le(), Ue(ue));
1781
1779
  };
1782
1780
  if (o) await Se();
1783
1781
  else {
1784
- const fe = await ne.resolveDataProviderPreview(t, f);
1785
- if (fe?.previewUrl && re === be.current) {
1786
- qe(fe.previewUrl), ge();
1782
+ const ue = await ne.resolveDataProviderPreview(t, f);
1783
+ if (ue?.previewUrl && se === Ce.current) {
1784
+ qe(ue.previewUrl), ge();
1787
1785
  try {
1788
- const { data: Ce } = await b(f);
1789
- if (re !== be.current) return;
1790
- Ce ? K({
1791
- width: Ce?.width,
1792
- height: Ce?.height,
1793
- size: Ce?.fileSize != null ? (Ce.fileSize / 1024).toFixed(2) : "",
1794
- format: ke(Ce?.format)
1786
+ const { data: ve } = await b(f);
1787
+ if (se !== Ce.current) return;
1788
+ ve ? V({
1789
+ width: ve?.width,
1790
+ height: ve?.height,
1791
+ size: ve?.fileSize != null ? (ve.fileSize / 1024).toFixed(2) : "",
1792
+ format: je(ve?.format)
1795
1793
  }) : await Se();
1796
1794
  } catch {
1797
1795
  await Se();
1798
1796
  }
1799
1797
  } else await Se();
1800
1798
  }
1801
- if (re !== be.current) return;
1802
- P("success"), U(c), ie(572), setTimeout(() => {
1803
- let fe = 0;
1804
- L.current && (fe = L.current.offsetHeight + 62), X(fe);
1799
+ if (se !== Ce.current) return;
1800
+ q("success"), R(c), $(572), setTimeout(() => {
1801
+ let ue = 0;
1802
+ x.current && (ue = x.current.offsetHeight + 62), T(ue);
1805
1803
  }, 0);
1806
1804
  } catch (Se) {
1807
- if (Se?.name === "AbortError" || V.signal.aborted || re !== be.current) return;
1808
- ue(), ge(), P("error");
1805
+ if (Se?.name === "AbortError" || Q.signal.aborted || se !== Ce.current) return;
1806
+ le(), ge(), q("error");
1809
1807
  }
1810
1808
  }, oe);
1811
1809
  return () => {
1812
- clearTimeout(Ye), V.abort();
1810
+ clearTimeout(Ye), Q.abort();
1813
1811
  };
1814
1812
  }, [
1815
1813
  y,
1816
- O,
1814
+ A,
1817
1815
  o,
1818
- ue,
1819
- we,
1816
+ le,
1817
+ be,
1820
1818
  b,
1821
1819
  ge,
1822
1820
  t,
1823
1821
  Ue
1824
1822
  ]), (0, n.useEffect)(() => {
1825
- if (!C || y || O) return;
1823
+ if (!C || y || A) return;
1826
1824
  const c = ne.canonicalImageUrlKey(C), f = new AbortController();
1827
- let S = !1;
1828
- const V = async () => {
1829
- const oe = await Ie.current.resolve(c, f.signal, we);
1830
- if (S) return;
1831
- const { width: re, height: Ye } = await ne.getImageDimensionsFromBlob(oe);
1832
- S || (ue(), Ue(oe), K({
1833
- width: re,
1825
+ let k = !1;
1826
+ const Q = async () => {
1827
+ const oe = await Ie.current.resolve(c, f.signal, be);
1828
+ if (k) return;
1829
+ const { width: se, height: Ye } = await ne.getImageDimensionsFromBlob(oe);
1830
+ k || (le(), Ue(oe), V({
1831
+ width: se,
1834
1832
  height: Ye,
1835
1833
  size: (oe.size / 1024).toFixed(2),
1836
- format: ke(oe.type)
1834
+ format: je(oe.type)
1837
1835
  }));
1838
1836
  };
1839
1837
  return (async () => {
1840
1838
  try {
1841
1839
  if (!o) {
1842
1840
  const oe = await ne.resolveDataProviderPreview(t, c);
1843
- if (oe?.previewUrl && !S) {
1841
+ if (oe?.previewUrl && !k) {
1844
1842
  qe(oe.previewUrl), ge();
1845
1843
  try {
1846
- const { data: re } = await b(c);
1847
- if (S) return;
1848
- re ? K({
1849
- width: re?.width,
1850
- height: re?.height,
1851
- size: re?.fileSize != null ? (re.fileSize / 1024).toFixed(2) : "",
1852
- format: ke(re?.format)
1853
- }) : await V();
1844
+ const { data: se } = await b(c);
1845
+ if (k) return;
1846
+ se ? V({
1847
+ width: se?.width,
1848
+ height: se?.height,
1849
+ size: se?.fileSize != null ? (se.fileSize / 1024).toFixed(2) : "",
1850
+ format: je(se?.format)
1851
+ }) : await Q();
1854
1852
  return;
1855
1853
  } catch {
1856
- await V();
1854
+ await Q();
1857
1855
  }
1858
1856
  }
1859
1857
  }
1860
- await V();
1858
+ await Q();
1861
1859
  } catch {
1862
- S || ue();
1860
+ k || le();
1863
1861
  }
1864
1862
  })(), () => {
1865
- S = !0, f.abort();
1863
+ k = !0, f.abort();
1866
1864
  };
1867
1865
  }, [
1868
1866
  o,
1869
- ue,
1867
+ le,
1870
1868
  C,
1871
- we,
1869
+ be,
1872
1870
  b,
1873
1871
  t,
1874
1872
  y,
1875
- O,
1873
+ A,
1876
1874
  Ue
1877
1875
  ]);
1878
- const an = () => {
1879
- i(Y.closeModal()), setTimeout(() => {
1880
- ue(), ge(), U(""), D(""), G([]), G([]), _({
1876
+ const rn = () => {
1877
+ i(Z.closeModal()), setTimeout(() => {
1878
+ le(), ge(), R(""), L(""), g([]), g([]), pe({
1881
1879
  keywords: "",
1882
1880
  color: "",
1883
1881
  orientation: ""
1884
- }), B({ keywords: "" }), X("auto"), !it && We(""), ie(572), z(pe);
1882
+ }), Y({ keywords: "" }), T("auto"), !ce && We(""), $(572), B(fe);
1885
1883
  }, 200);
1886
- }, on = (c) => {
1887
- c === Kt ? g.success({
1884
+ }, sn = (c) => {
1885
+ c === zt ? p.success({
1888
1886
  mask: { closable: !0 },
1889
1887
  centered: !0,
1890
1888
  title: a("Coming soon"),
1891
1889
  content: a("The feature is under development."),
1892
1890
  okText: a("Ok. I'll be waiting"),
1893
1891
  onOk: () => {}
1894
- }) : c === Ae && C === "" ? g.warning({
1892
+ }) : c === we && C === "" ? p.warning({
1895
1893
  mask: { closable: !0 },
1896
1894
  centered: !0,
1897
1895
  title: a(""),
1898
1896
  content: a("To preview and edit the uploaded image"),
1899
1897
  okText: a("Upload Image"),
1900
1898
  onOk: () => {
1901
- z(pe);
1899
+ B(fe);
1902
1900
  }
1903
1901
  }) : (setTimeout(() => {
1904
- let f = 0, S = 0;
1905
- c === pe && A.current ? (ce.keywords === "" && h.current?.focus({ cursor: "start" }), f = 300, S = 572) : c === Ae && L.current ? (f = L.current.offsetHeight + 62, S = 572) : c === Ge && J.current ? (ce.keywords === "" && le.current?.focus({ cursor: "start" }), f = 130, S = 572, te.length > 0 && (S = 1060, f = "84vh")) : c === ze && Q.current ? (ce.keywords === "" && W.current?.focus({ cursor: "start" }), f = 130, S = 572, ae.length > 0 && (S = 1060, f = "84vh")) : c === Ke && s.current && (ct === "" && de.length === 0 ? (Z.current?.focus({ cursor: "start" }), f = 130) : f = s.current.offsetHeight + 82, S = 572), X(f), ie(S);
1906
- }, 0), z(c));
1902
+ let f = 0, k = 0;
1903
+ c === fe && j.current ? (ie.keywords === "" && K.current?.focus({ cursor: "start" }), f = 300, k = 572) : c === we && x.current ? (f = x.current.offsetHeight + 62, k = 572) : c === Fe && S.current ? (ie.keywords === "" && h.current?.focus({ cursor: "start" }), f = 130, k = 572, ae.length > 0 && (k = 1060, f = "84vh")) : c === ze && U.current ? (ie.keywords === "" && s.current?.focus({ cursor: "start" }), f = 130, k = 572, re.length > 0 && (k = 1060, f = "84vh")) : c === Ke && _.current && (lt === "" && te.length === 0 ? (W.current?.focus({ cursor: "start" }), f = 130) : f = _.current.offsetHeight + 82, k = 572), T(f), $(k);
1904
+ }, 0), B(c));
1907
1905
  };
1908
1906
  (0, n.useEffect)(() => {
1909
- ce.keywords === "" && (h?.current?.focus({ cursor: "start" }), G([]), setTimeout(() => {
1910
- X("auto"), ie(572);
1907
+ ie.keywords === "" && (K?.current?.focus({ cursor: "start" }), g([]), setTimeout(() => {
1908
+ T("auto"), $(572);
1911
1909
  }, 0));
1912
1910
  }, [
1913
- ce,
1914
- G,
1915
- X,
1916
- ie
1911
+ ie,
1912
+ g,
1913
+ T,
1914
+ $
1917
1915
  ]);
1918
1916
  const _e = (c) => {
1919
1917
  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";
@@ -1925,27 +1923,27 @@ Select the appropriate plan to fulfil more requests`),
1925
1923
  }), f;
1926
1924
  }, Oe = async ({ file: c }) => {
1927
1925
  try {
1928
- ye(!0);
1929
- const f = await ne.prepareImageForEditorUpload(c, e), S = await nn(f);
1930
- if (S) return gt(S, f), S;
1931
- const V = await zt(f, t);
1932
- if (V?.url) return gt(V.url, f), V.url;
1926
+ he(!0);
1927
+ const f = await ne.prepareImageForEditorUpload(c, e), k = await en(f);
1928
+ if (k) return pt(k, f), k;
1929
+ const Q = await Ft(f, t);
1930
+ if (Q?.url) return pt(Q.url, f), Q.url;
1933
1931
  Me(f, null);
1934
1932
  return;
1935
1933
  } catch (f) {
1936
1934
  Me(c, f);
1937
1935
  return;
1938
1936
  } finally {
1939
- ye(!1);
1937
+ he(!1);
1940
1938
  }
1941
- }, ln = (c) => Oe({ file: c });
1939
+ }, an = (c) => Oe({ file: c });
1942
1940
  let Le = [{
1943
1941
  label: a("Upload"),
1944
- key: pe,
1942
+ key: fe,
1945
1943
  children: (0, r.jsxs)("div", {
1946
- ref: A,
1944
+ ref: j,
1947
1945
  style: { paddingBottom: 24 },
1948
- children: [e.imageCenterLocalUploadEnabled !== !1 && (0, r.jsxs)(Vt, {
1946
+ children: [e.imageCenterLocalUploadEnabled !== !1 && (0, r.jsxs)(Ht, {
1949
1947
  showUploadList: !1,
1950
1948
  name: "Image",
1951
1949
  beforeUpload: _e,
@@ -1956,7 +1954,7 @@ Select the appropriate plan to fulfil more requests`),
1956
1954
  children: [
1957
1955
  (0, r.jsx)("p", {
1958
1956
  className: "ant-upload-drag-icon",
1959
- children: (0, r.jsx)(F.EmIcons, { icon: "InboxOutlined" })
1957
+ children: (0, r.jsx)(N.EmIcons, { icon: "InboxOutlined" })
1960
1958
  }),
1961
1959
  (0, r.jsx)("p", {
1962
1960
  className: "ant-upload-text",
@@ -1970,123 +1968,123 @@ Select the appropriate plan to fulfil more requests`),
1970
1968
  }), (0, r.jsx)(m.Form, {
1971
1969
  style: { padding: "0 2px 0 2px" },
1972
1970
  children: (0, r.jsx)(m.Form.Item, {
1973
- validateStatus: k,
1971
+ validateStatus: ee,
1974
1972
  children: (0, r.jsx)(m.Input, {
1975
- ref: h,
1973
+ ref: K,
1976
1974
  allowClear: !0,
1977
1975
  size: "large",
1978
1976
  placeholder: a("Paste image URL here"),
1979
1977
  value: y,
1980
- onChange: tn,
1978
+ onChange: $t,
1981
1979
  spellCheck: "false"
1982
1980
  })
1983
1981
  })
1984
1982
  })]
1985
1983
  })
1986
1984
  }];
1987
- return e.imageCenterStockEnabled && !ve && Le.push({
1985
+ return e.imageCenterStockEnabled && !ye && Le.push({
1988
1986
  label: a("Stock"),
1989
- key: Ge,
1987
+ key: Fe,
1990
1988
  children: (0, r.jsx)("div", {
1991
- ref: J,
1989
+ ref: S,
1992
1990
  style: { paddingBottom: 24 },
1993
- children: (0, r.jsx)(Lt, {
1994
- currentReq: ce,
1995
- setCurrentReq: _,
1996
- imageStockList: te,
1997
- setImageStockList: G,
1998
- setModalWidth: ie,
1999
- setModalHeight: X,
2000
- setStockLink: T,
2001
- setCurrentImageLink: U,
2002
- inputRef: le,
1991
+ children: (0, r.jsx)(Ot, {
1992
+ currentReq: ie,
1993
+ setCurrentReq: pe,
1994
+ imageStockList: ae,
1995
+ setImageStockList: g,
1996
+ setModalWidth: $,
1997
+ setModalHeight: T,
1998
+ setStockLink: G,
1999
+ setCurrentImageLink: R,
2000
+ inputRef: h,
2003
2001
  customRequest: Pe
2004
2002
  })
2005
2003
  })
2006
- }), e.imageCenterGifEnabled && !ve && Le.push({
2004
+ }), e.imageCenterGifEnabled && !ye && Le.push({
2007
2005
  label: a("GIF"),
2008
2006
  key: ze,
2009
2007
  children: (0, r.jsx)("div", {
2010
- ref: Q,
2008
+ ref: U,
2011
2009
  style: { paddingBottom: 24 },
2012
- children: (0, r.jsx)(Pt, {
2013
- currentReqGif: se,
2014
- setCurrentReqGif: B,
2015
- imageGifList: ae,
2016
- setImageGifList: v,
2017
- setModalWidth: ie,
2018
- setModalHeight: X,
2019
- setStockLink: T,
2020
- setCurrentImageLink: U,
2021
- inputRef: W,
2010
+ children: (0, r.jsx)(Mt, {
2011
+ currentReqGif: Ae,
2012
+ setCurrentReqGif: Y,
2013
+ imageGifList: re,
2014
+ setImageGifList: M,
2015
+ setModalWidth: $,
2016
+ setModalHeight: T,
2017
+ setStockLink: G,
2018
+ setCurrentImageLink: R,
2019
+ inputRef: s,
2022
2020
  customRequest: Pe
2023
2021
  })
2024
2022
  })
2025
- }), e.elementAIimageEnabled && !ve && Le.push({
2023
+ }), e.elementAIimageEnabled && !ye && Le.push({
2026
2024
  label: a("AI"),
2027
2025
  key: Ke,
2028
2026
  children: (0, r.jsx)("div", {
2029
- ref: s,
2027
+ ref: _,
2030
2028
  style: { paddingBottom: 24 },
2031
- children: (0, r.jsx)(Mt, {
2032
- setModalHeight: X,
2029
+ children: (0, r.jsx)(Ut, {
2030
+ setModalHeight: T,
2033
2031
  customRequest: Oe,
2034
- aiImageRequest: ct,
2032
+ aiImageRequest: lt,
2035
2033
  setAiImageRequest: We,
2036
- imageAiList: de,
2037
- setImageAiList: Yt,
2038
- isLoadingAi: it,
2039
- setIsLoadingAi: lt,
2040
- aiTabRef: s,
2041
- inputAiRef: Z,
2034
+ imageAiList: te,
2035
+ setImageAiList: X,
2036
+ isLoadingAi: ce,
2037
+ setIsLoadingAi: it,
2038
+ aiTabRef: _,
2039
+ inputAiRef: W,
2042
2040
  isImageUploaded: E,
2043
- setIsImageUploaded: I
2041
+ setIsImageUploaded: P
2044
2042
  })
2045
2043
  })
2046
2044
  }), e.imageCenterEditorEnabled && Le.push({
2047
2045
  label: "",
2048
- key: Ae,
2046
+ key: we,
2049
2047
  children: (0, r.jsx)("div", {
2050
- ref: L,
2051
- children: (0, r.jsx)(xt, {
2048
+ ref: x,
2049
+ children: (0, r.jsx)(It, {
2052
2050
  currentImageLink: C,
2053
2051
  newLink: y,
2054
- previewDisplayUrl: en,
2055
- resolvedPreviewObjectUrl: Jt,
2056
- resolvedPreviewBlob: $t,
2057
- resolveImageBlob: rn,
2058
- imageSize: ee,
2059
- onSave: ln,
2060
- uploadImageResultIsLoading: he || !1
2052
+ previewDisplayUrl: Jt,
2053
+ resolvedPreviewObjectUrl: Zt,
2054
+ resolvedPreviewBlob: Xt,
2055
+ resolveImageBlob: tn,
2056
+ imageSize: z,
2057
+ onSave: an,
2058
+ uploadImageResultIsLoading: F || !1
2061
2059
  })
2062
2060
  })
2063
2061
  }), (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)(m.Modal, {
2064
- width: H,
2062
+ width: J,
2065
2063
  className: "image-center",
2066
2064
  title: a("Image Center"),
2067
2065
  style: { minHeight: 390 },
2068
- open: !!q,
2066
+ open: !!O,
2069
2067
  onOk: Qe,
2070
- onCancel: an,
2071
- footer: M === Ae ? (0, r.jsx)(r.Fragment, {}) : null,
2068
+ onCancel: rn,
2069
+ footer: H === we ? (0, r.jsx)(r.Fragment, {}) : null,
2072
2070
  children: (0, r.jsx)(m.Spin, {
2073
- spinning: he,
2071
+ spinning: F,
2074
2072
  children: (0, r.jsx)(m.Tabs, {
2075
- activeKey: M,
2076
- onChange: on,
2073
+ activeKey: H,
2074
+ onChange: sn,
2077
2075
  items: Le,
2078
2076
  className: "modal-tabs",
2079
2077
  style: {
2080
- height: $,
2078
+ height: me,
2081
2079
  minHeight: 130
2082
2080
  }
2083
2081
  })
2084
2082
  })
2085
- }), (0, r.jsx)(F.PlanUpgradePrompt, {
2086
- open: Zt,
2083
+ }), (0, r.jsx)(N.PlanUpgradePrompt, {
2084
+ open: _t,
2087
2085
  onCancel: () => Ee(!1),
2088
- initialSlide: Xt
2086
+ initialSlide: Yt
2089
2087
  })] });
2090
2088
  };
2091
- ot.propTypes = { dataProvider: vt.default.object }, ht.default = ot;
2089
+ ot.propTypes = { dataProvider: yt.default.object }, gt.default = ot;
2092
2090
  });