@emailmaker/emailmaker 1.1.72 → 1.1.75
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.
- package/CHANGELOG.md +376 -0
- package/README.md +37 -1
- package/{emailmaker-core.bd3c8144.js → emailmaker-core.705f9cde.js} +6 -6
- package/emailmaker-esm.js +4 -4
- package/{emailmaker-po.bd3c8144.js → emailmaker-po.705f9cde.js} +1 -1
- package/emailmaker.d.ts +4 -0
- package/emailmaker.js +3 -3
- package/iframe/js/amp.CcyAlXr8.js +1 -0
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.B-wCbIo7.js +1 -1
- package/package.json +30 -9
- package/static/core/{84e7cbac.js → 1f9bc4c3.js} +3 -3
- package/static/core/{ce8ca64c.js → 23d0be47.js} +3 -3
- package/static/core/{893bd50e.js → 3af12861.js} +17559 -15293
- package/static/core/{fab6e3c1.js → 4efbc972.js} +5 -5
- package/static/core/{34b3c6f9.js → 7093b78e.js} +53 -53
- package/static/core/{98529d8d2.js → 7af547562.js} +1304 -1240
- package/static/core/{dda6d713.js → 8e559366.js} +4 -4
- package/static/core/aaa151dc.js +2129 -0
- package/static/core/{ec8d567d2.js → baee7d8b2.js} +864 -819
- package/static/core/{ab6da7f5.js → d6093d8d.js} +7 -7
- package/static/core/{8815169a.js → e430193d.js} +5 -5
- package/static/core/{dd625043.js → e44c2cac.js} +6 -6
- package/static/core/{5da8610f.js → fb14792c.js} +1512 -1260
- package/static/umd-runtime/ui-kit.js +1171 -1103
- package/ui-kit/index.js +1541 -1469
- package/favicon-b.ico +0 -0
- package/favicon.ico +0 -0
- package/fonts/SegoeUI-Bold.woff2 +0 -0
- package/fonts/SegoeUI-Semibold.woff2 +0 -0
- package/fonts/SegoeUI.woff2 +0 -0
- package/iframe/js/amp.D4LpeCG3.js +0 -1
- package/js/amplitude.min.js +0 -10859
- package/js/sourcebuster.min.js +0 -672
- package/manifest.json +0 -17
- package/npm-publish.manifest.json +0 -65
- package/static/core/e84eccff.js +0 -2122
- package/static/media/image-editor/images/samples/large_sample.jpg +0 -0
- package/static/media/image-editor/images/samples/sample1.jpg +0 -0
- package/static/media/image-editor/images/samples/sample1_thumbnail.jpg +0 -0
- package/static/media/image-editor/images/samples/sample2.jpg +0 -0
- package/static/media/image-editor/images/samples/sample2_thumbnail.jpg +0 -0
- package/static/media/image-editor/images/samples/sample3.jpg +0 -0
- package/static/media/image-editor/images/samples/sample3_thumbnail.jpg +0 -0
- package/static/media/image-editor/images/samples/sample4.json +0 -871
- package/static/media/image-editor/images/samples/sample4_preview.jpg +0 -0
- package/test-font.otf +0 -0
- package/test-font.ttf +0 -0
- package/test-font.woff2 +0 -0
- package/tsconfig.json +0 -14
- package/two_step_headless_plugin.html +0 -558
- /package/iframe/{iframe-eblock.bd3c8144.html → iframe-eblock.705f9cde.html} +0 -0
- /package/iframe/{iframe.bd3c8144.html → iframe.705f9cde.html} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.setAttribute("data-emailmaker","true"),e.appendChild(document.createTextNode('@import "https://fonts.googleapis.com/css2?family=Geologica:wght@300;600&display=swap";.blocks-app .ant-modal.premium-features-modal .ant-modal-container{border-radius:calc(var(--em-borderRadiusXL) * 2px);padding:20px 19px}.blocks-app .premium-features-modal .modal-title{text-align:center;margin-bottom:0;font-size:32px}.blocks-app .premium-features-modal .ant-carousel .slick-dots li button{opacity:.5;background:#fff}.blocks-app .premium-features-modal .ant-carousel .slick-dots li.slick-active button{opacity:1}.blocks-app .premium-features-modal .modal-subtitle{text-align:center;margin-bottom:20px;font-size:18px}.blocks-app .premium-features-modal .carousel-slider{margin-bottom:20px}.blocks-app .premium-features-modal .slick-list{border-radius:calc(var(--em-borderRadiusXL) * 1.5px)}.blocks-app .premium-features-modal .slick-slide{padding:0 5px}.blocks-app .premium-features-modal .carousel-slide{border-radius:calc(var(--em-borderRadiusXL) * 1.5px);justify-content:flex-end;align-items:center;height:480px;display:flex}.blocks-app .premium-features-modal .slide-item-image{width:50%;padding:24px 0 24px 32px}.blocks-app .premium-features-modal .slide-item-image img{border-radius:calc(var(--em-borderRadiusXL) * 1.3px);width:100%}.blocks-app .premium-features-modal .slide-item-content{width:50%;padding:48px}.blocks-app .premium-features-modal .slide-title{margin-bottom:48px;font-size:50px;font-weight:700;line-height:1}.blocks-app .premium-features-modal .slide-description{font-size:22px}.blocks-app .premium-features-modal .modal-buttons{justify-content:center;gap:10px;display:flex}.blocks-app .premium-features-modal .modal-buttons button{padding:0 30px}.blocks-app .trial-suggest-modal{max-width:calc(100vw - 24px)}.blocks-app .trial-suggest-modal .ant-modal-container{border-radius:16px;padding:0;overflow:hidden}.blocks-app .trial-suggest-modal__layout{align-items:stretch;display:flex}.blocks-app .trial-suggest-modal__gallery{background:var(--em-colorFillQuaternary);flex:0 0 300px;width:300px;max-width:300px;position:relative;overflow:hidden}.blocks-app .trial-suggest-modal__slide-image{border-right:1px solid var(--em-colorFillSecondary);background-repeat:no-repeat;background-size:cover;transition:opacity .4s;position:absolute;inset:0}.blocks-app .trial-suggest-modal__content{flex:auto;min-width:0;max-width:100%;padding:32px}.blocks-app .trial-suggest-modal__badge{background:var(--em-colorPrimaryBg);color:var(--em-colorPrimary);border-radius:12px;margin-bottom:12px;padding:2px 10px;font-size:12px;font-weight:600;line-height:20px;display:inline-block}.blocks-app .trial-suggest-modal__title{color:var(--em-colorText);margin:0 0 8px;font-size:22px;font-weight:600;line-height:1.25}.blocks-app .trial-suggest-modal__intro{color:var(--em-colorTextSecondary);margin:0 0 16px}.blocks-app .trial-suggest-modal__features{margin:0 0 20px;padding:0;list-style:none}.blocks-app .trial-suggest-modal__features li{color:var(--em-colorText);align-items:flex-start;gap:10px;margin-bottom:10px;display:flex}.blocks-app .trial-suggest-modal__feature-icon,.blocks-app .trial-suggest-modal__promise-icon{flex:none;width:20px;height:20px;margin-top:2px;font-size:20px;line-height:20px}.blocks-app .trial-suggest-modal__feature-icon svg,.blocks-app .trial-suggest-modal__promise-icon svg{width:100%;height:100%}.blocks-app .trial-suggest-modal__feature-icon{color:var(--em-colorPrimary)}.blocks-app .trial-suggest-modal__promise{background:var(--em-colorFillQuaternary);color:var(--em-colorText);border-radius:8px;align-items:flex-start;gap:10px;margin:0 0 8px;padding:12px;display:flex}.blocks-app .trial-suggest-modal__promise-icon{color:var(--em-colorSuccess)}.blocks-app .trial-suggest-modal__note{color:var(--em-colorTextTertiary);margin:0 0 24px;font-size:12px;line-height:140%}.blocks-app .trial-suggest-modal__buttons{justify-content:space-between;align-items:center;gap:8px;display:flex}.blocks-app .trial-suggest-modal__decline.ant-btn{box-shadow:none;color:var(--em-colorTextSecondary);border:1px solid #0000}.blocks-app .trial-suggest-modal__decline.ant-btn:hover,.blocks-app .trial-suggest-modal__decline.ant-btn:focus,.blocks-app .trial-suggest-modal__decline.ant-btn:focus-visible,.blocks-app .trial-suggest-modal__decline.ant-btn:active{box-shadow:none;border:1px solid #0000;transform:none}.blocks-app .trial-suggest-modal__decline.ant-btn:hover:not(:disabled){background:var(--em-colorFillTertiary);color:var(--em-colorText)}@media (width<=720px){.blocks-app .trial-suggest-modal__layout{flex-direction:column}.blocks-app .trial-suggest-modal__gallery{flex:none;width:auto;max-width:none;height:180px}.blocks-app .trial-suggest-modal__content{padding:24px}}.blocks-app .limit-upgrade-modal.ant-modal{max-width:calc(100vw - 24px)}.blocks-app .limit-upgrade-modal .ant-modal-content{border-radius:16px;padding:0;overflow:hidden;box-shadow:0 12px 24px -4px #191d3a14}.blocks-app .limit-upgrade-modal .ant-modal-header{display:none}.blocks-app .limit-upgrade-modal .ant-modal-content .ant-modal-body{padding:0}.blocks-app .limit-upgrade-modal__wrap{background:var(--em-colorBgContainer);flex-direction:column;align-items:center;width:400px;max-width:100%;display:flex}.blocks-app .limit-upgrade-modal__header{z-index:1;box-sizing:border-box;justify-content:flex-end;align-items:center;display:flex;position:absolute;top:20px;right:20px}.blocks-app .limit-upgrade-modal__close{background:var(--em-colorBgContainer);width:34px;height:34px;color:var(--em-colorTextSecondary);cursor:pointer;border:none;border-radius:6px;justify-content:center;align-items:center;margin:0;padding:0;transition:background .15s,color .15s;display:flex}.blocks-app .limit-upgrade-modal__close:hover{background:var(--em-colorFillTertiary);color:var(--em-colorText)}.blocks-app .limit-upgrade-modal__close .anticon{font-size:16px}.blocks-app .limit-upgrade-modal__body{box-sizing:border-box;flex-direction:column;align-items:center;gap:16px;width:100%;padding:44px 40px 24px;display:flex}.blocks-app .limit-upgrade-modal__title{text-align:center;max-width:320px;color:var(--em-colorText);margin:0;font-size:18px;font-weight:400;line-height:130%}.blocks-app .limit-upgrade-modal__subtitle{text-align:center;max-width:320px;color:var(--em-colorTextSecondary);margin:0;font-size:14px;font-weight:100;line-height:120%}.blocks-app .limit-upgrade-modal__limits-row{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;width:100%;max-width:320px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle{box-sizing:border-box;border:1px solid var(--em-colorText);width:34px;height:34px;color:var(--em-colorText);border-radius:32px;flex:none;justify-content:center;align-items:center;padding:8px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle .anticon{font-size:18px}.blocks-app .limit-upgrade-modal__icon-circle svg{flex-shrink:0;width:18px;height:18px;display:block}.blocks-app .limit-upgrade-modal__limit-old{color:#f85243;flex-shrink:0;font-size:40px;font-weight:100;line-height:100%}.blocks-app .limit-upgrade-modal__arrow-btn{color:#fff;background:#8946fb;border-radius:38px;flex:none;justify-content:center;align-items:center;width:34px;height:34px;display:flex}.blocks-app .limit-upgrade-modal__arrow-icon{font-size:16px;transform:rotate(45deg)}.blocks-app .limit-upgrade-modal__limit-new{color:#7ed846;flex-shrink:0;font-size:40px;font-weight:400;line-height:100%}.blocks-app .limit-upgrade-modal__limit-new--infinity{font-size:36px;line-height:40px}.blocks-app .limit-upgrade-modal__divider{border:none;border-top:1px solid var(--em-colorBorderSecondary);width:100%;height:0;margin:0}.blocks-app .limit-upgrade-modal__footer{box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;width:100%;padding:16px 0;display:flex}.blocks-app .limit-upgrade-modal__footer--dual{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;padding:16px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary{min-width:147px;height:32px;box-shadow:none;background:#2884ff;border-color:#2884ff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary:hover{background:#1a75f0;border-color:#1a75f0}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default{border-color:var(--em-colorBorder);min-width:147px;height:32px;color:var(--em-colorText);box-shadow:none;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default:hover{color:#2884ff;border-color:#2884ff}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
__emailmaker__.define("static/core/
|
|
2
|
+
__emailmaker__.define("static/core/baee7d8b2.js", [
|
|
3
3
|
"require",
|
|
4
4
|
"exports",
|
|
5
5
|
"module",
|
|
6
6
|
"static/core/7df48ae1.js",
|
|
7
|
-
"static/core/
|
|
8
|
-
"static/core/
|
|
7
|
+
"static/core/fb14792c.js",
|
|
8
|
+
"static/core/1f9bc4c3.js",
|
|
9
9
|
"static/core/2181dfc12.js",
|
|
10
|
-
"static/core/
|
|
10
|
+
"static/core/7af547562.js",
|
|
11
11
|
"static/core/dd6d3ae42.js",
|
|
12
12
|
"static/core/5f203ce92.js",
|
|
13
13
|
"static/core/b33e034e.js",
|
|
@@ -18,8 +18,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
18
18
|
"@ant-design/icons",
|
|
19
19
|
"react-dom/client",
|
|
20
20
|
"@ant-design/cssinjs"
|
|
21
|
-
], function(ze,
|
|
22
|
-
const qt = ze("./7df48ae1.js"),
|
|
21
|
+
], function(ze, ye, Zs) {
|
|
22
|
+
const qt = ze("./7df48ae1.js"), Ee = ze("./fb14792c.js"), Pt = ze("./1f9bc4c3.js"), m = ze("./2181dfc12.js"), be = ze("./7af547562.js"), se = ze("./dd6d3ae42.js"), kt = ze("./5f203ce92.js"), nt = ze("./b33e034e.js");
|
|
23
23
|
let c = ze("react"), De = qt.__toESM(c, 1);
|
|
24
24
|
c = qt.__toESM(c);
|
|
25
25
|
let Ht = ze("react-dom"), g = ze("antd"), l = ze("react/jsx-runtime"), qe = ze("@ant-design/icons");
|
|
@@ -143,6 +143,15 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
143
143
|
}, De.createElement("path", { d: "M9 3h6M3 6h18m-2 0-.701 10.52c-.105 1.578-.158 2.367-.499 2.965a3 3 0 0 1-1.298 1.215c-.62.3-1.41.3-2.993.3h-3.018c-1.582 0-2.373 0-2.993-.3A3 3 0 0 1 6.2 19.485c-.34-.598-.394-1.387-.499-2.966L5 6" }));
|
|
144
144
|
er.displayName = "Trash04";
|
|
145
145
|
function qi(e, t) {
|
|
146
|
+
if (!Ee.PLUGIN.isPlugin) return t;
|
|
147
|
+
if (e?.type === "email" && !e.isNew && e.id != null && e.id !== "") return String(e.id);
|
|
148
|
+
if (!(e?.type === "email" && e.isNew)) return t === "new" ? void 0 : t;
|
|
149
|
+
}
|
|
150
|
+
function Hi() {
|
|
151
|
+
const { emailId: e } = Ee.useParams();
|
|
152
|
+
return e === "new" ? void 0 : e;
|
|
153
|
+
}
|
|
154
|
+
function Ki(e, t) {
|
|
146
155
|
return e == null || t == null ? !1 : String(e) === String(t);
|
|
147
156
|
}
|
|
148
157
|
function tr(e, t) {
|
|
@@ -150,7 +159,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
150
159
|
if (e?.myRole === "user" || e?.myRole === "viewer") return "user";
|
|
151
160
|
const r = Array.isArray(e?.members) ? e.members : [], a = Array.isArray(e?.invites) ? e.invites : [];
|
|
152
161
|
if (t?.id == null || t.id === "") return null;
|
|
153
|
-
const i = r.find((o) =>
|
|
162
|
+
const i = r.find((o) => Ki(o?.userId, t.id));
|
|
154
163
|
if (i) {
|
|
155
164
|
if (i.role === "owner" || i.role === "admin") return i.role;
|
|
156
165
|
if (i.role === "user" || i.role === "viewer") return "user";
|
|
@@ -161,16 +170,16 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
161
170
|
function rr(e, t) {
|
|
162
171
|
return t.isPlugin ? !1 : e?.ownerPlan?.isPaid !== !0;
|
|
163
172
|
}
|
|
164
|
-
function
|
|
173
|
+
function Yi(e, t) {
|
|
165
174
|
const r = tr(e, t);
|
|
166
175
|
return r === null || r === "owner";
|
|
167
176
|
}
|
|
168
|
-
function
|
|
177
|
+
function Qi(e) {
|
|
169
178
|
const { isPlanLocked: t, trialEnabled: r, canStartTrial: a } = e;
|
|
170
179
|
return !t || r || !a ? "upsell" : "trial";
|
|
171
180
|
}
|
|
172
|
-
var ir = () =>
|
|
173
|
-
function
|
|
181
|
+
var ir = () => Ee.di.useInstance(Ee.COOKIE_MANAGER_ID);
|
|
182
|
+
function Zi(e, t, r) {
|
|
174
183
|
const a = e.data?.status, i = typeof e.status == "number" ? e.status : void 0;
|
|
175
184
|
return a === 403 || i === 403 ? {
|
|
176
185
|
kind: "failure",
|
|
@@ -181,23 +190,23 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
181
190
|
description: e.message && String(e.message).trim() || void 0
|
|
182
191
|
};
|
|
183
192
|
}
|
|
184
|
-
async function
|
|
193
|
+
async function Ji(e, t, r, a, i, s, o) {
|
|
185
194
|
const d = await t(e), u = r("Could not activate the trial. Please try again later or contact support.");
|
|
186
195
|
if ("error" in d && d.error) {
|
|
187
196
|
const n = d.error, h = "data" in n ? n.data : void 0;
|
|
188
197
|
return o((h && typeof h == "object" && h !== null && "message" in h ? String(h.message) : void 0) || u), !1;
|
|
189
198
|
}
|
|
190
199
|
if ("data" in d && d.data && typeof d.data == "object") {
|
|
191
|
-
const n =
|
|
192
|
-
return n.kind === "failure" ? (o(n.userMessage), !1) : (a(
|
|
200
|
+
const n = Zi(d.data, u, r("Trial period activated."));
|
|
201
|
+
return n.kind === "failure" ? (o(n.userMessage), !1) : (a(Ee.changeConfig("pro")), await i(void 0), n.description ? s({
|
|
193
202
|
title: n.title,
|
|
194
203
|
description: n.description
|
|
195
204
|
}) : s(n.title), !0);
|
|
196
205
|
}
|
|
197
|
-
return a(
|
|
206
|
+
return a(Ee.changeConfig("pro")), await i(void 0), s(r("Trial period activated.")), !0;
|
|
198
207
|
}
|
|
199
|
-
function
|
|
200
|
-
const { __: e } =
|
|
208
|
+
function Xi() {
|
|
209
|
+
const { __: e } = be.useI18n(), t = Ee.useDispatch(), r = ir(), { success: a, notify: i } = be.useNotification(), s = Ee.usePushToDataLayer(), [o] = Ee.useLazyGetMeQuery(), [d, { isLoading: u }] = Ee.useActivateTrialMutation(), [n] = Pt.useInvalidatePlanCacheMutation(), h = (0, c.useCallback)((v) => {
|
|
201
210
|
i({
|
|
202
211
|
title: v,
|
|
203
212
|
type: "error"
|
|
@@ -205,11 +214,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
205
214
|
}, [i]);
|
|
206
215
|
return {
|
|
207
216
|
activate: (0, c.useCallback)(async () => {
|
|
208
|
-
const v = r.get(
|
|
217
|
+
const v = r.get(Ee.APP_COOKIES.em_token);
|
|
209
218
|
if (!v) return h(e("Sign in to your account to activate the trial period.")), !1;
|
|
210
219
|
try {
|
|
211
|
-
const f = await
|
|
212
|
-
return f && (await n(), t(
|
|
220
|
+
const f = await Ji(v, d, e, t, o, a, h);
|
|
221
|
+
return f && (await n(), t(Ee.projectsApi.util.invalidateTags(["project"])), s({
|
|
213
222
|
event: "change",
|
|
214
223
|
action: "activate_trial"
|
|
215
224
|
})), f;
|
|
@@ -230,8 +239,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
230
239
|
isActivating: u
|
|
231
240
|
};
|
|
232
241
|
}
|
|
233
|
-
var
|
|
234
|
-
const { __: i } =
|
|
242
|
+
var ea = ({ open: e, sideOnOk: t, onCancel: r, initialSlide: a = 0 }) => {
|
|
243
|
+
const { __: i } = be.useI18n(), s = Ee.useNavigate(), [o, d] = (0, c.useState)(a), u = (0, c.useRef)(null), n = Ee.usePushToDataLayer(), h = () => {
|
|
235
244
|
t && t(), s("/billing"), r(!1);
|
|
236
245
|
};
|
|
237
246
|
(0, c.useEffect)(() => {
|
|
@@ -315,7 +324,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
315
324
|
v,
|
|
316
325
|
a,
|
|
317
326
|
n
|
|
318
|
-
]), (0, l.jsxs)(
|
|
327
|
+
]), (0, l.jsxs)(be.Modal, {
|
|
319
328
|
open: e,
|
|
320
329
|
footer: null,
|
|
321
330
|
onCancel: r,
|
|
@@ -326,7 +335,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
326
335
|
width: 1100,
|
|
327
336
|
style: { maxWidth: "80%" },
|
|
328
337
|
children: [
|
|
329
|
-
(0, l.jsx)(
|
|
338
|
+
(0, l.jsx)(be.Carousel, {
|
|
330
339
|
dots: !0,
|
|
331
340
|
slidesToShow: 1,
|
|
332
341
|
slidesToScroll: 1,
|
|
@@ -363,11 +372,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
363
372
|
}),
|
|
364
373
|
(0, l.jsxs)("div", {
|
|
365
374
|
className: "modal-buttons",
|
|
366
|
-
children: [(0, l.jsx)(
|
|
375
|
+
children: [(0, l.jsx)(be.Button, {
|
|
367
376
|
size: "large",
|
|
368
377
|
onClick: () => r(!1),
|
|
369
378
|
children: i("Cancel")
|
|
370
|
-
}), (0, l.jsx)(
|
|
379
|
+
}), (0, l.jsx)(be.Button, {
|
|
371
380
|
type: "primary",
|
|
372
381
|
size: "large",
|
|
373
382
|
onClick: h,
|
|
@@ -382,8 +391,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
382
391
|
return e = e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim, ""), e = e.replace(/<\/?(?:script|embed|object|frameset|frame|iframe|applet|meta)[^>]*>/gi, ""), e = e.replace(/ on\w+="[^"]*"/g, ""), e = e.replace(/ on\w+='[^']*'/g, ""), e;
|
|
383
392
|
}
|
|
384
393
|
var dt = c.default.forwardRef(({ icon: e, ...t }, r) => {
|
|
385
|
-
const a =
|
|
386
|
-
return (0, l.jsx)(
|
|
394
|
+
const a = Ee.useAppConfig();
|
|
395
|
+
return (0, l.jsx)(be.EmIcons, {
|
|
387
396
|
ref: r,
|
|
388
397
|
icon: e,
|
|
389
398
|
configIcons: (0, c.useMemo)(() => {
|
|
@@ -397,7 +406,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
397
406
|
});
|
|
398
407
|
});
|
|
399
408
|
dt.displayName = "EmIcons";
|
|
400
|
-
var
|
|
409
|
+
var ta = "CheckCircleVerified", ra = [
|
|
401
410
|
"Export to HTML, AMP, PDF and PNG",
|
|
402
411
|
"Code editing and version history",
|
|
403
412
|
"AI assistant and AI image generation",
|
|
@@ -414,16 +423,16 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
414
423
|
"https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png",
|
|
415
424
|
"https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png",
|
|
416
425
|
"https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png"
|
|
417
|
-
],
|
|
418
|
-
const { __: i } =
|
|
426
|
+
], ia = 5e3, aa = ({ open: e, onCancel: t, onConfirm: r, loading: a = !1 }) => {
|
|
427
|
+
const { __: i } = be.useI18n(), [s, o] = (0, c.useState)(0), d = (0, c.useMemo)(() => lr.map((u) => ({ backgroundImage: `url(${i(u)})` })), [i]);
|
|
419
428
|
return (0, c.useEffect)(() => {
|
|
420
429
|
if (!e) {
|
|
421
430
|
o(0);
|
|
422
431
|
return;
|
|
423
432
|
}
|
|
424
|
-
const u = setInterval(() => o((n) => (n + 1) % lr.length),
|
|
433
|
+
const u = setInterval(() => o((n) => (n + 1) % lr.length), ia);
|
|
425
434
|
return () => clearInterval(u);
|
|
426
|
-
}, [e]), (0, l.jsx)(
|
|
435
|
+
}, [e]), (0, l.jsx)(be.Modal, {
|
|
427
436
|
open: e,
|
|
428
437
|
onCancel: t,
|
|
429
438
|
footer: null,
|
|
@@ -456,8 +465,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
456
465
|
}),
|
|
457
466
|
(0, l.jsx)("ul", {
|
|
458
467
|
className: "trial-suggest-modal__features",
|
|
459
|
-
children:
|
|
460
|
-
icon:
|
|
468
|
+
children: ra.map((u) => (0, l.jsxs)("li", { children: [(0, l.jsx)(dt, {
|
|
469
|
+
icon: ta,
|
|
461
470
|
className: "trial-suggest-modal__feature-icon"
|
|
462
471
|
}), (0, l.jsx)("span", { children: i(u) })] }, u))
|
|
463
472
|
}),
|
|
@@ -474,13 +483,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
474
483
|
}),
|
|
475
484
|
(0, l.jsxs)("div", {
|
|
476
485
|
className: "trial-suggest-modal__buttons",
|
|
477
|
-
children: [(0, l.jsxs)(
|
|
486
|
+
children: [(0, l.jsxs)(be.Button, {
|
|
478
487
|
type: "text",
|
|
479
488
|
size: "large",
|
|
480
489
|
onClick: t,
|
|
481
490
|
className: "trial-suggest-modal__decline",
|
|
482
491
|
children: [i("Not now"), " "]
|
|
483
|
-
}), (0, l.jsxs)(
|
|
492
|
+
}), (0, l.jsxs)(be.Button, {
|
|
484
493
|
type: "primary",
|
|
485
494
|
size: "large",
|
|
486
495
|
loading: a,
|
|
@@ -492,11 +501,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
492
501
|
})]
|
|
493
502
|
})
|
|
494
503
|
});
|
|
495
|
-
},
|
|
496
|
-
const s =
|
|
497
|
-
isPlanLocked: rr(o, { isPlugin:
|
|
504
|
+
}, la = ({ open: e, onCancel: t, initialSlide: r = 0, onTrialActivated: a, sideOnOk: i }) => {
|
|
505
|
+
const s = Ee.useSelector(Ee.selectedCurrentUser), o = Ee.useSelector(Ee.selectProject), d = Ee.usePushToDataLayer(), { activate: u, isActivating: n } = Xi(), h = Qi({
|
|
506
|
+
isPlanLocked: rr(o, { isPlugin: Ee.PLUGIN.isPlugin }),
|
|
498
507
|
trialEnabled: !!s?.trial_enabled,
|
|
499
|
-
canStartTrial:
|
|
508
|
+
canStartTrial: Yi(o, s)
|
|
500
509
|
}) === "trial";
|
|
501
510
|
(0, c.useEffect)(() => {
|
|
502
511
|
!e || !h || d({
|
|
@@ -522,12 +531,12 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
522
531
|
t,
|
|
523
532
|
a
|
|
524
533
|
]);
|
|
525
|
-
return h ? (0, l.jsx)(
|
|
534
|
+
return h ? (0, l.jsx)(aa, {
|
|
526
535
|
open: e,
|
|
527
536
|
onCancel: t,
|
|
528
537
|
onConfirm: v,
|
|
529
538
|
loading: n
|
|
530
|
-
}) : (0, l.jsx)(
|
|
539
|
+
}) : (0, l.jsx)(ea, {
|
|
531
540
|
open: e,
|
|
532
541
|
onCancel: t,
|
|
533
542
|
initialSlide: r,
|
|
@@ -558,9 +567,9 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
558
567
|
}
|
|
559
568
|
return e;
|
|
560
569
|
}
|
|
561
|
-
var
|
|
562
|
-
const { __: v } =
|
|
563
|
-
return (0, l.jsx)(
|
|
570
|
+
var sa = ({ open: e, onClose: t, title: r, subtitle: a, usageResource: i, icon: s, previousDisplay: o, nextDisplay: d, onChangePlan: u, secondaryAction: n, changePlanLabel: h }) => {
|
|
571
|
+
const { __: v } = be.useI18n(), f = h ?? v("Change plan"), w = !!n, I = i != null ? (0, l.jsx)(dt, { icon: sr[i] }) : s ?? null;
|
|
572
|
+
return (0, l.jsx)(be.Modal, {
|
|
564
573
|
open: e,
|
|
565
574
|
onCancel: t,
|
|
566
575
|
footer: null,
|
|
@@ -619,16 +628,16 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
619
628
|
(0, l.jsx)("hr", { className: "limit-upgrade-modal__divider" }),
|
|
620
629
|
(0, l.jsx)("div", {
|
|
621
630
|
className: w ? "limit-upgrade-modal__footer limit-upgrade-modal__footer--dual" : "limit-upgrade-modal__footer",
|
|
622
|
-
children: n ? (0, l.jsxs)(l.Fragment, { children: [(0, l.jsx)(
|
|
631
|
+
children: n ? (0, l.jsxs)(l.Fragment, { children: [(0, l.jsx)(be.Button, {
|
|
623
632
|
className: "limit-upgrade-modal__cta-secondary",
|
|
624
633
|
onClick: n.onClick,
|
|
625
634
|
children: n.label
|
|
626
|
-
}), (0, l.jsx)(
|
|
635
|
+
}), (0, l.jsx)(be.Button, {
|
|
627
636
|
type: "primary",
|
|
628
637
|
className: "limit-upgrade-modal__cta",
|
|
629
638
|
onClick: u,
|
|
630
639
|
children: f
|
|
631
|
-
})] }) : (0, l.jsx)(
|
|
640
|
+
})] }) : (0, l.jsx)(be.Button, {
|
|
632
641
|
type: "primary",
|
|
633
642
|
className: "limit-upgrade-modal__cta",
|
|
634
643
|
onClick: u,
|
|
@@ -638,7 +647,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
638
647
|
]
|
|
639
648
|
})
|
|
640
649
|
});
|
|
641
|
-
},
|
|
650
|
+
}, oa = {
|
|
642
651
|
email_10_30: {
|
|
643
652
|
id: "email_10_30",
|
|
644
653
|
titleKey: "You have used up the number of emails you can create on your current plan",
|
|
@@ -760,13 +769,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
760
769
|
debugLabelKey: "Limit modal: spam_check exhausted"
|
|
761
770
|
}
|
|
762
771
|
};
|
|
763
|
-
function
|
|
764
|
-
return
|
|
772
|
+
function na(e) {
|
|
773
|
+
return oa[e];
|
|
765
774
|
}
|
|
766
|
-
function
|
|
775
|
+
function da(e) {
|
|
767
776
|
return e === "infinity" ? "∞" : e;
|
|
768
777
|
}
|
|
769
|
-
var
|
|
778
|
+
var ca = {
|
|
770
779
|
ai: "ai_150_inf",
|
|
771
780
|
email_generate: "email_300_inf",
|
|
772
781
|
image_generate: "image_generate_exceeded",
|
|
@@ -780,33 +789,49 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
780
789
|
}
|
|
781
790
|
function dr(e, t) {
|
|
782
791
|
return nr(t) ? {
|
|
783
|
-
presetId:
|
|
792
|
+
presetId: ca[e],
|
|
784
793
|
previousLimit: t?.total_limit ?? 0,
|
|
785
794
|
nextLimit: "infinity"
|
|
786
795
|
} : null;
|
|
787
796
|
}
|
|
788
|
-
function
|
|
797
|
+
function ua(e, t) {
|
|
789
798
|
return dr(e, t);
|
|
790
799
|
}
|
|
791
|
-
function
|
|
800
|
+
function ha(e) {
|
|
792
801
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
793
802
|
const r = e[t];
|
|
794
803
|
if (typeof r == "string" && r) return r;
|
|
795
804
|
}
|
|
796
805
|
}
|
|
797
|
-
function
|
|
806
|
+
function ma(e) {
|
|
798
807
|
for (let t = 0; t < e.length; t++) {
|
|
799
808
|
const r = e[t];
|
|
800
809
|
if (r instanceof Blob) return r;
|
|
801
810
|
}
|
|
802
811
|
}
|
|
803
|
-
function
|
|
812
|
+
function fa(e, t) {
|
|
804
813
|
for (let r = e.length - 1; r >= 0; r--) {
|
|
805
814
|
const a = e[r];
|
|
806
815
|
if (typeof a == "string" && a && a !== t) return a;
|
|
807
816
|
}
|
|
808
817
|
}
|
|
809
|
-
var
|
|
818
|
+
var pa = "Image upload rejected by handleLoadImage";
|
|
819
|
+
async function ga(e, t) {
|
|
820
|
+
const r = e.hasListeners(), a = await e.fireSettled(t);
|
|
821
|
+
return {
|
|
822
|
+
url: ha(a.results),
|
|
823
|
+
hasHostListener: r,
|
|
824
|
+
hostFailed: a.errors.length > 0,
|
|
825
|
+
error: a.errors[0]
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
function ya(e, t = {}) {
|
|
829
|
+
return e.url || e.hostFailed ? !1 : t.isStandalone ? !(e.hasHostListener || t.targetIsOurBackend) : !0;
|
|
830
|
+
}
|
|
831
|
+
function va(e) {
|
|
832
|
+
return e.error instanceof Error && e.error.message ? e.error : typeof e.error == "string" && e.error ? new Error(e.error) : new Error(pa);
|
|
833
|
+
}
|
|
834
|
+
var wa = () => (0, l.jsx)(qe.LoadingOutlined, {
|
|
810
835
|
style: {
|
|
811
836
|
fontSize: 48,
|
|
812
837
|
height: "100%"
|
|
@@ -817,25 +842,25 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
817
842
|
skip: Symbol("deepmerge-ts: skip")
|
|
818
843
|
};
|
|
819
844
|
rt.defaultMerge;
|
|
820
|
-
function
|
|
845
|
+
function Ia(e, t) {
|
|
821
846
|
return t;
|
|
822
847
|
}
|
|
823
|
-
function
|
|
848
|
+
function ba(e, t) {
|
|
824
849
|
return e.filter((r) => r !== void 0);
|
|
825
850
|
}
|
|
826
|
-
var
|
|
851
|
+
var _a;
|
|
827
852
|
(function(e) {
|
|
828
853
|
e[e.NOT = 0] = "NOT", e[e.RECORD = 1] = "RECORD", e[e.ARRAY = 2] = "ARRAY", e[e.SET = 3] = "SET", e[e.MAP = 4] = "MAP", e[e.OTHER = 5] = "OTHER";
|
|
829
|
-
})(
|
|
854
|
+
})(_a ||= {});
|
|
830
855
|
function cr(e) {
|
|
831
|
-
return typeof e != "object" || !e ? 0 : Array.isArray(e) ? 2 :
|
|
856
|
+
return typeof e != "object" || !e ? 0 : Array.isArray(e) ? 2 : xa(e) ? 1 : e instanceof Set ? 3 : e instanceof Map ? 4 : 5;
|
|
832
857
|
}
|
|
833
|
-
function
|
|
858
|
+
function Ca(e) {
|
|
834
859
|
let t = new Set();
|
|
835
860
|
for (let r of e) for (let a of [...Object.keys(r), ...Object.getOwnPropertySymbols(r)]) t.add(a);
|
|
836
861
|
return t;
|
|
837
862
|
}
|
|
838
|
-
function
|
|
863
|
+
function Fa(e, t) {
|
|
839
864
|
return typeof e == "object" && Object.prototype.propertyIsEnumerable.call(e, t);
|
|
840
865
|
}
|
|
841
866
|
function ur(e) {
|
|
@@ -861,18 +886,18 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
861
886
|
} };
|
|
862
887
|
}
|
|
863
888
|
var hr = ["[object Object]", "[object Module]"];
|
|
864
|
-
function
|
|
889
|
+
function xa(e) {
|
|
865
890
|
if (!hr.includes(Object.prototype.toString.call(e))) return !1;
|
|
866
891
|
let { constructor: t } = e;
|
|
867
892
|
if (t === void 0) return !0;
|
|
868
893
|
let r = t.prototype;
|
|
869
894
|
return !(typeof r != "object" || !r || !hr.includes(Object.prototype.toString.call(r)) || !r.hasOwnProperty("isPrototypeOf"));
|
|
870
895
|
}
|
|
871
|
-
function
|
|
896
|
+
function Pa(e, t, r) {
|
|
872
897
|
let a = {};
|
|
873
|
-
for (let i of
|
|
898
|
+
for (let i of Ca(e)) {
|
|
874
899
|
let s = [];
|
|
875
|
-
for (let d of e)
|
|
900
|
+
for (let d of e) Fa(d, i) && s.push(d[i]);
|
|
876
901
|
if (s.length === 0) continue;
|
|
877
902
|
let o = mr(s, t, t.metaDataUpdater(r, {
|
|
878
903
|
key: i,
|
|
@@ -887,82 +912,82 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
887
912
|
}
|
|
888
913
|
return a;
|
|
889
914
|
}
|
|
890
|
-
function
|
|
915
|
+
function ka(e) {
|
|
891
916
|
return e.flat();
|
|
892
917
|
}
|
|
893
|
-
function
|
|
918
|
+
function ja(e) {
|
|
894
919
|
return new Set(ur(e));
|
|
895
920
|
}
|
|
896
|
-
function
|
|
921
|
+
function Sa(e) {
|
|
897
922
|
return new Map(ur(e));
|
|
898
923
|
}
|
|
899
|
-
function
|
|
924
|
+
function Ea(e) {
|
|
900
925
|
return e.at(-1);
|
|
901
926
|
}
|
|
902
927
|
var It = {
|
|
903
|
-
mergeRecords:
|
|
904
|
-
mergeArrays:
|
|
905
|
-
mergeSets:
|
|
906
|
-
mergeMaps:
|
|
907
|
-
mergeOthers:
|
|
928
|
+
mergeRecords: Pa,
|
|
929
|
+
mergeArrays: ka,
|
|
930
|
+
mergeSets: ja,
|
|
931
|
+
mergeMaps: Sa,
|
|
932
|
+
mergeOthers: Ea
|
|
908
933
|
};
|
|
909
|
-
function
|
|
910
|
-
return
|
|
934
|
+
function Na(...e) {
|
|
935
|
+
return Ta({})(...e);
|
|
911
936
|
}
|
|
912
|
-
function
|
|
913
|
-
let r =
|
|
937
|
+
function Ta(e, t) {
|
|
938
|
+
let r = Ma(e, a);
|
|
914
939
|
function a(...i) {
|
|
915
940
|
return mr(i, r, t);
|
|
916
941
|
}
|
|
917
942
|
return a;
|
|
918
943
|
}
|
|
919
|
-
function
|
|
944
|
+
function Ma(e, t) {
|
|
920
945
|
return {
|
|
921
946
|
defaultMergeFunctions: It,
|
|
922
947
|
mergeFunctions: {
|
|
923
948
|
...It,
|
|
924
949
|
...Object.fromEntries(Object.entries(e).filter(([r, a]) => Object.hasOwn(It, r)).map(([r, a]) => a === !1 ? [r, It.mergeOthers] : [r, a]))
|
|
925
950
|
},
|
|
926
|
-
metaDataUpdater: e.metaDataUpdater ??
|
|
951
|
+
metaDataUpdater: e.metaDataUpdater ?? Ia,
|
|
927
952
|
deepmerge: t,
|
|
928
953
|
useImplicitDefaultMerging: e.enableImplicitDefaultMerging ?? !1,
|
|
929
|
-
filterValues: e.filterValues === !1 ? void 0 : e.filterValues ??
|
|
954
|
+
filterValues: e.filterValues === !1 ? void 0 : e.filterValues ?? ba,
|
|
930
955
|
actions: rt
|
|
931
956
|
};
|
|
932
957
|
}
|
|
933
958
|
function mr(e, t, r) {
|
|
934
959
|
let a = t.filterValues?.(e, r) ?? e;
|
|
935
960
|
if (a.length === 0) return;
|
|
936
|
-
if (a.length === 1) return
|
|
961
|
+
if (a.length === 1) return Et(a, t, r);
|
|
937
962
|
let i = cr(a[0]);
|
|
938
963
|
if (i !== 0 && i !== 5) {
|
|
939
|
-
for (let s = 1; s < a.length; s++) if (cr(a[s]) !== i) return
|
|
964
|
+
for (let s = 1; s < a.length; s++) if (cr(a[s]) !== i) return Et(a, t, r);
|
|
940
965
|
}
|
|
941
966
|
switch (i) {
|
|
942
|
-
case 1: return
|
|
943
|
-
case 2: return
|
|
944
|
-
case 3: return
|
|
945
|
-
case 4: return
|
|
946
|
-
default: return
|
|
967
|
+
case 1: return Aa(a, t, r);
|
|
968
|
+
case 2: return Ra(a, t, r);
|
|
969
|
+
case 3: return La(a, t, r);
|
|
970
|
+
case 4: return Oa(a, t, r);
|
|
971
|
+
default: return Et(a, t, r);
|
|
947
972
|
}
|
|
948
973
|
}
|
|
949
|
-
function
|
|
974
|
+
function Aa(e, t, r) {
|
|
950
975
|
let a = t.mergeFunctions.mergeRecords(e, t, r);
|
|
951
976
|
return a === rt.defaultMerge || t.useImplicitDefaultMerging && a === void 0 && t.mergeFunctions.mergeRecords !== t.defaultMergeFunctions.mergeRecords ? t.defaultMergeFunctions.mergeRecords(e, t, r) : a;
|
|
952
977
|
}
|
|
953
|
-
function
|
|
978
|
+
function Ra(e, t, r) {
|
|
954
979
|
let a = t.mergeFunctions.mergeArrays(e, t, r);
|
|
955
980
|
return a === rt.defaultMerge || t.useImplicitDefaultMerging && a === void 0 && t.mergeFunctions.mergeArrays !== t.defaultMergeFunctions.mergeArrays ? t.defaultMergeFunctions.mergeArrays(e) : a;
|
|
956
981
|
}
|
|
957
|
-
function
|
|
982
|
+
function La(e, t, r) {
|
|
958
983
|
let a = t.mergeFunctions.mergeSets(e, t, r);
|
|
959
984
|
return a === rt.defaultMerge || t.useImplicitDefaultMerging && a === void 0 && t.mergeFunctions.mergeSets !== t.defaultMergeFunctions.mergeSets ? t.defaultMergeFunctions.mergeSets(e) : a;
|
|
960
985
|
}
|
|
961
|
-
function
|
|
986
|
+
function Oa(e, t, r) {
|
|
962
987
|
let a = t.mergeFunctions.mergeMaps(e, t, r);
|
|
963
988
|
return a === rt.defaultMerge || t.useImplicitDefaultMerging && a === void 0 && t.mergeFunctions.mergeMaps !== t.defaultMergeFunctions.mergeMaps ? t.defaultMergeFunctions.mergeMaps(e) : a;
|
|
964
989
|
}
|
|
965
|
-
function
|
|
990
|
+
function Et(e, t, r) {
|
|
966
991
|
let a = t.mergeFunctions.mergeOthers(e, t, r);
|
|
967
992
|
return a === rt.defaultMerge || t.useImplicitDefaultMerging && a === void 0 && t.mergeFunctions.mergeOthers !== t.defaultMergeFunctions.mergeOthers ? t.defaultMergeFunctions.mergeOthers(e) : a;
|
|
968
993
|
}
|
|
@@ -1039,7 +1064,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1039
1064
|
return (0, c.useEffect)(() => {
|
|
1040
1065
|
o(i);
|
|
1041
1066
|
}, [i]), (0, c.useEffect)(() => {
|
|
1042
|
-
let n = s === "light" ? fr : pr, h = r, v = h ?
|
|
1067
|
+
let n = s === "light" ? fr : pr, h = r, v = h ? Na(n.token, h) : n.token;
|
|
1043
1068
|
u({
|
|
1044
1069
|
...n,
|
|
1045
1070
|
token: v
|
|
@@ -1050,7 +1075,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1050
1075
|
r
|
|
1051
1076
|
]), (0, l.jsx)(g.ConfigProvider, {
|
|
1052
1077
|
theme: d,
|
|
1053
|
-
spin: { indicator: (0, l.jsx)(
|
|
1078
|
+
spin: { indicator: (0, l.jsx)(wa, {}) },
|
|
1054
1079
|
modal: { mask: { blur: !1 } },
|
|
1055
1080
|
drawer: { mask: { blur: !1 } },
|
|
1056
1081
|
children: (0, l.jsx)($i.StyleProvider, {
|
|
@@ -1058,7 +1083,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1058
1083
|
children: t
|
|
1059
1084
|
})
|
|
1060
1085
|
});
|
|
1061
|
-
}, yr = !1,
|
|
1086
|
+
}, yr = !1, Da = () => {
|
|
1062
1087
|
if (yr) return;
|
|
1063
1088
|
window.addEventListener("error", (r) => r.message && r.message.includes("ResizeObserver loop completed with undelivered notifications") ? (r.stopImmediatePropagation(), r.preventDefault(), !0) : !1, !0);
|
|
1064
1089
|
let e = window.onerror;
|
|
@@ -1094,9 +1119,9 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1094
1119
|
}), [e, t]);
|
|
1095
1120
|
return (0, c.createElement)(m.On.Provider, { value: a }, r);
|
|
1096
1121
|
}
|
|
1097
|
-
var
|
|
1122
|
+
var Ba = m.Yn(), za = ({ onSearch: e, placeholder: t, className: r }) => {
|
|
1098
1123
|
let { t: a } = m.Nn(), [i, s] = (0, c.useState)(""), o = (0, c.useRef)(null), { options: d } = m.V(), { config: u } = d, n = t || a("Search files...");
|
|
1099
|
-
return (0, c.useEffect)(() => (o.current = (0,
|
|
1124
|
+
return (0, c.useEffect)(() => (o.current = (0, Ba.debounce)((h) => {
|
|
1100
1125
|
e(h);
|
|
1101
1126
|
}, 500), () => {
|
|
1102
1127
|
o.current?.cancel();
|
|
@@ -1117,7 +1142,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1117
1142
|
s(""), e("");
|
|
1118
1143
|
}
|
|
1119
1144
|
});
|
|
1120
|
-
},
|
|
1145
|
+
}, Nt = [
|
|
1121
1146
|
{
|
|
1122
1147
|
value: "date-desc",
|
|
1123
1148
|
labelKey: "Newest first"
|
|
@@ -1146,7 +1171,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1146
1171
|
value: "type-asc",
|
|
1147
1172
|
labelKey: "By type"
|
|
1148
1173
|
}
|
|
1149
|
-
],
|
|
1174
|
+
], Ua = (e) => {
|
|
1150
1175
|
let [t, r] = e.split("-");
|
|
1151
1176
|
return {
|
|
1152
1177
|
sortBy: t,
|
|
@@ -1222,14 +1247,14 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1222
1247
|
textTitleTrash: "textTitle_trash",
|
|
1223
1248
|
textDescription_trash: "textDescription_trash",
|
|
1224
1249
|
textDescriptionTrash: "textDescription_trash"
|
|
1225
|
-
}, { Text:
|
|
1226
|
-
function
|
|
1250
|
+
}, { Text: Ga } = g.Typography, { Option: Va } = g.Select;
|
|
1251
|
+
function Wa(e) {
|
|
1227
1252
|
if (!e || e.isFolder) return !1;
|
|
1228
1253
|
let t = e.extension || (e.name && e.name.includes(".") ? e.name.split(".").pop() : void 0) || (e.type?.startsWith("image/") ? e.type.split("/")[1]?.split(";")[0]?.trim() : void 0);
|
|
1229
1254
|
return !!(t && m.A.includes(t.toLowerCase()));
|
|
1230
1255
|
}
|
|
1231
|
-
var wr = c.default.memo(({ files: e, filesById: t, currentSortOption: r, isSmallScreen: a, iconStrokeWidth: i, multiSelectEnabled: s = !0, features: o, viewMode: d, setViewMode: u, handleSearch: n, handleSortOptionChange: h, sortOptions: v, onClearSelection: f, onRename: w, onDelete: I, onCopy:
|
|
1232
|
-
let y = (0, c.useMemo)(() => v?.length ?
|
|
1256
|
+
var wr = c.default.memo(({ files: e, filesById: t, currentSortOption: r, isSmallScreen: a, iconStrokeWidth: i, multiSelectEnabled: s = !0, features: o, viewMode: d, setViewMode: u, handleSearch: n, handleSortOptionChange: h, sortOptions: v, onClearSelection: f, onRename: w, onDelete: I, onCopy: _, onMove: F, onEdit: V, t: b }) => {
|
|
1257
|
+
let y = (0, c.useMemo)(() => v?.length ? Nt.filter((W) => v.includes(W.value)) : Nt, [v]), C = (0, c.useMemo)(() => y.map((W) => W.value).join("|") || "all", [y]), O = m.Yi((W) => W.selectedFiles), R = m.Yi((W) => W.selectedFiles.size), ne = m.Yi((W) => W.selectAllVisible), k = e.length > 0 && R === e.length, U = (0, c.useMemo)(() => Array.from(O)[0], [O]), D = (0, c.useMemo)(() => U ? t.get(U) : void 0, [t, U]), Z = D?.isFolder ? o?.enableRenameFolder !== !1 : o?.enableRenameFile !== !1, $ = (0, c.useMemo)(() => Array.from(O).every((W) => {
|
|
1233
1258
|
let J = t.get(W);
|
|
1234
1259
|
return J ? J.isFolder ? o?.enableMoveFolder !== !1 : o?.enableMoveItem !== !1 : !1;
|
|
1235
1260
|
}), [
|
|
@@ -1243,10 +1268,10 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1243
1268
|
o,
|
|
1244
1269
|
t,
|
|
1245
1270
|
O
|
|
1246
|
-
]), A = (0, c.useMemo)(() => R === 1 &&
|
|
1271
|
+
]), A = (0, c.useMemo)(() => R === 1 && Wa(D), [R, D]);
|
|
1247
1272
|
return R > 0 ? (0, l.jsxs)("div", {
|
|
1248
1273
|
className: `header-container ${T.headerContainer}`,
|
|
1249
|
-
children: [(0, l.jsxs)(
|
|
1274
|
+
children: [(0, l.jsxs)(Ga, {
|
|
1250
1275
|
type: "secondary",
|
|
1251
1276
|
className: "selected-text",
|
|
1252
1277
|
children: [
|
|
@@ -1308,14 +1333,14 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1308
1333
|
size: 16,
|
|
1309
1334
|
strokeWidth: i
|
|
1310
1335
|
}),
|
|
1311
|
-
onClick:
|
|
1336
|
+
onClick: _,
|
|
1312
1337
|
children: b("Copy")
|
|
1313
1338
|
})
|
|
1314
1339
|
}),
|
|
1315
1340
|
R === 1 && Z && (0, l.jsx)(g.Tooltip, {
|
|
1316
1341
|
title: a ? b("Rename") : null,
|
|
1317
1342
|
children: (0, l.jsx)(g.Button, {
|
|
1318
|
-
icon: (0, l.jsx)(
|
|
1343
|
+
icon: (0, l.jsx)(be.n, {
|
|
1319
1344
|
size: 16,
|
|
1320
1345
|
strokeWidth: i
|
|
1321
1346
|
}),
|
|
@@ -1343,7 +1368,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1343
1368
|
className: T.headerContainer,
|
|
1344
1369
|
children: [(0, l.jsx)("div", {
|
|
1345
1370
|
className: "search-container",
|
|
1346
|
-
children: (0, l.jsx)(
|
|
1371
|
+
children: (0, l.jsx)(za, {
|
|
1347
1372
|
placeholder: b("Search file or folder"),
|
|
1348
1373
|
onSearch: n,
|
|
1349
1374
|
className: T.searchInput
|
|
@@ -1357,27 +1382,27 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1357
1382
|
onChange: h,
|
|
1358
1383
|
className: T.sortSelect,
|
|
1359
1384
|
popupMatchSelectWidth: !1,
|
|
1360
|
-
suffixIcon: (0, l.jsx)(
|
|
1385
|
+
suffixIcon: (0, l.jsx)(be.t, {
|
|
1361
1386
|
size: 16,
|
|
1362
1387
|
strokeWidth: i
|
|
1363
1388
|
}),
|
|
1364
|
-
children: y.map(({ value: W, labelKey: J }) => (0, l.jsx)(
|
|
1389
|
+
children: y.map(({ value: W, labelKey: J }) => (0, l.jsx)(Va, {
|
|
1365
1390
|
value: W,
|
|
1366
1391
|
children: b(J)
|
|
1367
1392
|
}, W))
|
|
1368
|
-
},
|
|
1393
|
+
}, C)
|
|
1369
1394
|
}), (0, l.jsx)("div", {
|
|
1370
1395
|
className: T.actionsContainer,
|
|
1371
1396
|
children: (0, l.jsx)(g.Segmented, {
|
|
1372
1397
|
options: [{
|
|
1373
1398
|
value: "grid",
|
|
1374
|
-
icon: (0, l.jsx)(
|
|
1399
|
+
icon: (0, l.jsx)(be.c, {
|
|
1375
1400
|
size: 16,
|
|
1376
1401
|
strokeWidth: i
|
|
1377
1402
|
})
|
|
1378
1403
|
}, {
|
|
1379
1404
|
value: "table",
|
|
1380
|
-
icon: (0, l.jsx)(
|
|
1405
|
+
icon: (0, l.jsx)(be.i$1, {
|
|
1381
1406
|
size: 20,
|
|
1382
1407
|
strokeWidth: i
|
|
1383
1408
|
})
|
|
@@ -1446,7 +1471,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1446
1471
|
}), e.canRename && I.push({
|
|
1447
1472
|
key: "rename",
|
|
1448
1473
|
label: r("Rename"),
|
|
1449
|
-
icon: (0, l.jsx)(
|
|
1474
|
+
icon: (0, l.jsx)(be.n, {
|
|
1450
1475
|
size: 16,
|
|
1451
1476
|
strokeWidth: a
|
|
1452
1477
|
})
|
|
@@ -1513,7 +1538,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1513
1538
|
onClick: (I) => {
|
|
1514
1539
|
I.stopPropagation(), I.preventDefault();
|
|
1515
1540
|
},
|
|
1516
|
-
children: (0, l.jsx)(
|
|
1541
|
+
children: (0, l.jsx)(be.i$2, {
|
|
1517
1542
|
size: 16,
|
|
1518
1543
|
strokeWidth: a
|
|
1519
1544
|
})
|
|
@@ -1522,7 +1547,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1522
1547
|
onClick: (I) => {
|
|
1523
1548
|
I.stopPropagation(), I.preventDefault();
|
|
1524
1549
|
},
|
|
1525
|
-
children: (0, l.jsx)(
|
|
1550
|
+
children: (0, l.jsx)(be.i$2, {
|
|
1526
1551
|
size: 16,
|
|
1527
1552
|
strokeWidth: a
|
|
1528
1553
|
})
|
|
@@ -1530,7 +1555,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1530
1555
|
});
|
|
1531
1556
|
});
|
|
1532
1557
|
Mt.displayName = "FileItemActionsDropdown";
|
|
1533
|
-
var
|
|
1558
|
+
var $a = ({ thumbnailSrc: e, previewSrc: t, lightboxSrc: r, alt: a, className: i, width: s, height: o, preview: d = !1 }) => {
|
|
1534
1559
|
let u = (0, c.useMemo)(() => [e, t], [e, t]), n = (0, c.useMemo)(() => [
|
|
1535
1560
|
r,
|
|
1536
1561
|
t,
|
|
@@ -1539,13 +1564,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1539
1564
|
r,
|
|
1540
1565
|
t,
|
|
1541
1566
|
e
|
|
1542
|
-
]), h = m.wa(u), v = m.wa(n), { handleError: f, handleLoad: w } = v, I = h.src ?? "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",
|
|
1567
|
+
]), h = m.wa(u), v = m.wa(n), { handleError: f, handleLoad: w } = v, I = h.src ?? "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+", _ = v.src ?? h.src, F = (0, c.useRef)(!1);
|
|
1543
1568
|
(0, c.useEffect)(() => {
|
|
1544
1569
|
F.current = !1;
|
|
1545
|
-
}, [
|
|
1570
|
+
}, [_]);
|
|
1546
1571
|
let V = (0, c.useCallback)((b) => c.default.cloneElement(b, {
|
|
1547
|
-
key:
|
|
1548
|
-
src:
|
|
1572
|
+
key: _ ?? "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",
|
|
1573
|
+
src: _ ?? "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",
|
|
1549
1574
|
fallback: void 0,
|
|
1550
1575
|
onError: () => {
|
|
1551
1576
|
F.current || (F.current = !0, f().finally(() => {
|
|
@@ -1556,7 +1581,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1556
1581
|
w();
|
|
1557
1582
|
}
|
|
1558
1583
|
}), [
|
|
1559
|
-
|
|
1584
|
+
_,
|
|
1560
1585
|
f,
|
|
1561
1586
|
w
|
|
1562
1587
|
]);
|
|
@@ -1566,15 +1591,15 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1566
1591
|
alt: a,
|
|
1567
1592
|
width: s,
|
|
1568
1593
|
height: o,
|
|
1569
|
-
preview: (0, c.useMemo)(() => d &&
|
|
1570
|
-
src:
|
|
1594
|
+
preview: (0, c.useMemo)(() => d && _ ? {
|
|
1595
|
+
src: _,
|
|
1571
1596
|
actionsRender: () => null,
|
|
1572
1597
|
destroyOnHidden: !0,
|
|
1573
1598
|
cover: (0, l.jsx)(qe.EyeOutlined, { style: { fontSize: "20px" } }),
|
|
1574
1599
|
imageRender: V
|
|
1575
1600
|
} : !1, [
|
|
1576
1601
|
d,
|
|
1577
|
-
|
|
1602
|
+
_,
|
|
1578
1603
|
V
|
|
1579
1604
|
]),
|
|
1580
1605
|
onLoad: h.handleLoad,
|
|
@@ -1598,7 +1623,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1598
1623
|
}
|
|
1599
1624
|
})
|
|
1600
1625
|
})
|
|
1601
|
-
}) : !e.thumbnailSrc && !e.previewSrc ? null : (0, l.jsx)(
|
|
1626
|
+
}) : !e.thumbnailSrc && !e.previewSrc ? null : (0, l.jsx)($a, {
|
|
1602
1627
|
className: i,
|
|
1603
1628
|
thumbnailSrc: e.thumbnailSrc,
|
|
1604
1629
|
previewSrc: e.previewSrc,
|
|
@@ -1611,28 +1636,28 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1611
1636
|
getFileData: a
|
|
1612
1637
|
}));
|
|
1613
1638
|
At.displayName = "FileItemPreview";
|
|
1614
|
-
var
|
|
1639
|
+
var qa = [
|
|
1615
1640
|
".ant-image",
|
|
1616
1641
|
".ant-image-preview-root",
|
|
1617
1642
|
".ant-image-preview-wrap",
|
|
1618
1643
|
".ant-image-preview-mask",
|
|
1619
1644
|
".ant-image-preview-close",
|
|
1620
1645
|
".ant-image-preview-operations"
|
|
1621
|
-
].join(","), br = (e) => !!e.closest(
|
|
1622
|
-
function
|
|
1646
|
+
].join(","), br = (e) => !!e.closest(qa);
|
|
1647
|
+
function _r(e) {
|
|
1623
1648
|
if (e.isFolder) return !1;
|
|
1624
1649
|
let t = typeof e.name == "string" ? e.name : "", r = t ? t.split(".").pop()?.toLowerCase() : void 0, a = e.extension?.toLowerCase() ?? r;
|
|
1625
1650
|
return typeof e.type == "string" && e.type.startsWith("image/") || typeof a == "string" && m.ne.includes(a);
|
|
1626
1651
|
}
|
|
1627
|
-
var
|
|
1628
|
-
let I = m.Yi((F) => F.selectedFiles.has(e.id)),
|
|
1652
|
+
var Cr = c.default.memo(({ item: e, t, iconStrokeWidth: r, FolderIcon: a, handleItemClick: i, setCurrentMenuFile: s, showMoveModal: o, showCopyModal: d, showRenameModal: u, showDeleteConfirm: n, onEdit: h, onEditorOk: v, getFileData: f, showSelectionCheckbox: w = !0 }) => {
|
|
1653
|
+
let I = m.Yi((F) => F.selectedFiles.has(e.id)), _ = (0, c.useCallback)((F) => {
|
|
1629
1654
|
let V = F.target;
|
|
1630
1655
|
if (!(V.closest(".gridFileMenuButton") || V.closest(".ant-dropdown-menu")) && !br(V) && F.detail === 1) {
|
|
1631
1656
|
if (e.isFolder) {
|
|
1632
1657
|
i(e.file);
|
|
1633
1658
|
return;
|
|
1634
1659
|
}
|
|
1635
|
-
v &&
|
|
1660
|
+
v && _r(e.file) && v(e.file);
|
|
1636
1661
|
}
|
|
1637
1662
|
}, [
|
|
1638
1663
|
i,
|
|
@@ -1648,7 +1673,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1648
1673
|
cover: (0, l.jsx)("div", {
|
|
1649
1674
|
className: e.isFolder ? T.gridPreviewContainerFolder : T.gridPreviewContainer,
|
|
1650
1675
|
onClick: (F) => {
|
|
1651
|
-
F.stopPropagation(),
|
|
1676
|
+
F.stopPropagation(), _(F);
|
|
1652
1677
|
},
|
|
1653
1678
|
children: (0, l.jsx)(At, {
|
|
1654
1679
|
item: e,
|
|
@@ -1660,13 +1685,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1660
1685
|
}),
|
|
1661
1686
|
className: `${T.gridCard} ${I ? T.gridCardSelected : ""}`,
|
|
1662
1687
|
onClick: (F) => {
|
|
1663
|
-
F.stopPropagation(), F.preventDefault(),
|
|
1688
|
+
F.stopPropagation(), F.preventDefault(), _(F);
|
|
1664
1689
|
},
|
|
1665
1690
|
children: [
|
|
1666
1691
|
(0, l.jsxs)("div", {
|
|
1667
1692
|
className: T.gridCardContent,
|
|
1668
1693
|
onClick: (F) => {
|
|
1669
|
-
F.stopPropagation(), F.preventDefault(),
|
|
1694
|
+
F.stopPropagation(), F.preventDefault(), _(F);
|
|
1670
1695
|
},
|
|
1671
1696
|
children: [(0, l.jsx)("div", {
|
|
1672
1697
|
className: T.gridFileName,
|
|
@@ -1708,8 +1733,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1708
1733
|
})
|
|
1709
1734
|
});
|
|
1710
1735
|
});
|
|
1711
|
-
|
|
1712
|
-
var Fr = c.default.memo(({ rows: e, topOffset: t = 0, bottomOffset: r = 0, t: a, iconStrokeWidth: i, FolderIcon: s, handleItemClick: o, setCurrentMenuFile: d, showMoveModal: u, showCopyModal: n, showRenameModal: h, showDeleteConfirm: v, onEdit: f, onEditorOk: w, getFileData: I, showSelectionCheckbox:
|
|
1736
|
+
Cr.displayName = "FileGridItem";
|
|
1737
|
+
var Fr = c.default.memo(({ rows: e, topOffset: t = 0, bottomOffset: r = 0, t: a, iconStrokeWidth: i, FolderIcon: s, handleItemClick: o, setCurrentMenuFile: d, showMoveModal: u, showCopyModal: n, showRenameModal: h, showDeleteConfirm: v, onEdit: f, onEditorOk: w, getFileData: I, showSelectionCheckbox: _ = !0 }) => (0, l.jsx)(l.Fragment, { children: (0, l.jsx)("div", {
|
|
1713
1738
|
style: {
|
|
1714
1739
|
paddingTop: t,
|
|
1715
1740
|
paddingBottom: r
|
|
@@ -1722,7 +1747,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1722
1747
|
padding: "0 24px 24px",
|
|
1723
1748
|
margin: 0
|
|
1724
1749
|
},
|
|
1725
|
-
children: e.map((F) => (0, l.jsx)(
|
|
1750
|
+
children: e.map((F) => (0, l.jsx)(Cr, {
|
|
1726
1751
|
item: F,
|
|
1727
1752
|
handleItemClick: o,
|
|
1728
1753
|
iconStrokeWidth: i,
|
|
@@ -1736,7 +1761,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1736
1761
|
onEdit: f,
|
|
1737
1762
|
onEditorOk: w,
|
|
1738
1763
|
getFileData: I,
|
|
1739
|
-
showSelectionCheckbox:
|
|
1764
|
+
showSelectionCheckbox: _
|
|
1740
1765
|
}, F.id))
|
|
1741
1766
|
})
|
|
1742
1767
|
}) }));
|
|
@@ -1792,7 +1817,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1792
1817
|
})]
|
|
1793
1818
|
}));
|
|
1794
1819
|
kr.displayName = "FileItemName";
|
|
1795
|
-
var jr = "filemanager_view_mode",
|
|
1820
|
+
var jr = "filemanager_view_mode", Ha = () => {
|
|
1796
1821
|
let [e, t] = (0, c.useState)(() => {
|
|
1797
1822
|
try {
|
|
1798
1823
|
return localStorage.getItem(jr) || "table";
|
|
@@ -1813,15 +1838,15 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1813
1838
|
}, [e, r])
|
|
1814
1839
|
};
|
|
1815
1840
|
};
|
|
1816
|
-
function
|
|
1841
|
+
function Ka(e, t) {
|
|
1817
1842
|
return Math.max(1, e?.viewportHeight ?? t);
|
|
1818
1843
|
}
|
|
1819
|
-
function
|
|
1844
|
+
function Ya({ totalCount: e, plan: t }) {
|
|
1820
1845
|
let [r, a] = (0, c.useState)(null);
|
|
1821
1846
|
return {
|
|
1822
1847
|
engineOptions: (0, c.useMemo)(() => {
|
|
1823
1848
|
if (!t.enabled) return { renderStrategy: "full" };
|
|
1824
|
-
let i =
|
|
1849
|
+
let i = Ka(r, t.fallbackViewportHeight ?? 800), s = Math.max(1, Math.ceil(i / t.estimatedItemSize)), o = Math.max(1, Math.ceil(e / t.itemsPerLane)), d = Math.min(o - 1, Math.max(0, Math.floor((r?.scrollTop ?? 0) / t.estimatedItemSize))), u = d + s - 1;
|
|
1825
1850
|
return {
|
|
1826
1851
|
renderStrategy: "windowed",
|
|
1827
1852
|
windowed: {
|
|
@@ -1846,23 +1871,23 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1846
1871
|
}, [])
|
|
1847
1872
|
};
|
|
1848
1873
|
}
|
|
1849
|
-
var
|
|
1874
|
+
var Qa = "—";
|
|
1850
1875
|
function Sr(e, t) {
|
|
1851
1876
|
if (typeof e.childCount == "number") return e.childCount;
|
|
1852
1877
|
let r = t[e.id];
|
|
1853
1878
|
return r === null ? null : r ?? 0;
|
|
1854
1879
|
}
|
|
1855
|
-
function
|
|
1880
|
+
function Za(e) {
|
|
1856
1881
|
return e.extension || e.name.split(".").pop()?.toLowerCase() || (e.url ? e.url.split("?")[0].split("/").pop()?.split(".").pop()?.toLowerCase() : "") || "";
|
|
1857
1882
|
}
|
|
1858
1883
|
function bt(e) {
|
|
1859
1884
|
let t = e.extension || (e.name && e.name.includes(".") ? e.name.split(".").pop() : void 0) || (e.type?.startsWith("image/") ? e.type.split("/")[1]?.split(";")[0]?.trim() : void 0);
|
|
1860
1885
|
return !!(t && m.A.includes(t.toLowerCase()));
|
|
1861
1886
|
}
|
|
1862
|
-
function
|
|
1887
|
+
function Er(e, t) {
|
|
1863
1888
|
if (t.previewFallbackToFileUrl !== !1) return e.url && bt(e) ? e.url : void 0;
|
|
1864
1889
|
}
|
|
1865
|
-
function
|
|
1890
|
+
function Nr(e, t) {
|
|
1866
1891
|
if (!e) return "";
|
|
1867
1892
|
let r = new Date(e);
|
|
1868
1893
|
if (Number.isNaN(r.getTime())) return "";
|
|
@@ -1882,8 +1907,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1882
1907
|
], i = r.getDate(), s = a[r.getMonth()];
|
|
1883
1908
|
return t("Added", { date: `${i} ${s} ${r.getFullYear()}` });
|
|
1884
1909
|
}
|
|
1885
|
-
function
|
|
1886
|
-
let r = !!e.isFolder, a = r ? Sr(e, t.folderFileCounts) : null, i = r ? a === null ? "u" : String(a) : "0", s =
|
|
1910
|
+
function Ja(e, t) {
|
|
1911
|
+
let r = !!e.isFolder, a = r ? Sr(e, t.folderFileCounts) : null, i = r ? a === null ? "u" : String(a) : "0", s = Nr(e.date, t.t), o = !r && e.size ? String(e.size) : "", d = e.thumbnailUrl || e.thumbnail, u = e.url && bt(e) ? e.url : "", n = Er(e, t) ?? "", h = [
|
|
1887
1912
|
t.features?.enableEdit !== !1,
|
|
1888
1913
|
t.features?.enableMoveFolder !== !1,
|
|
1889
1914
|
t.features?.enableMoveItem !== !1,
|
|
@@ -1913,15 +1938,15 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1913
1938
|
h
|
|
1914
1939
|
].join("::");
|
|
1915
1940
|
}
|
|
1916
|
-
var
|
|
1941
|
+
var Xa = {
|
|
1917
1942
|
getId: (e) => e.id,
|
|
1918
|
-
buildSignature: (e, t) =>
|
|
1943
|
+
buildSignature: (e, t) => Ja(e, t),
|
|
1919
1944
|
buildRowModel: (e, t, r) => {
|
|
1920
|
-
let a = !!e.isFolder, i = a ? Sr(e, t.folderFileCounts) : null, s = a && i === null ?
|
|
1945
|
+
let a = !!e.isFolder, i = a ? Sr(e, t.folderFileCounts) : null, s = a && i === null ? Qa : a ? `${i} ${i === 1 ? t.t("item") : t.t("items")}` : "", o = e.dimensions || "", d = !a && e.size ? m.Hn(e.size) : "", u = a ? t.t("Folder") : Za(e), n = Nr(e.date, t.t), h = a ? s : [
|
|
1921
1946
|
o,
|
|
1922
1947
|
d,
|
|
1923
1948
|
u
|
|
1924
|
-
].filter(Boolean).join(" • "), v = e.thumbnailUrl || e.thumbnail, f = e.url && bt(e) ? e.url : void 0, w =
|
|
1949
|
+
].filter(Boolean).join(" • "), v = e.thumbnailUrl || e.thumbnail, f = e.url && bt(e) ? e.url : void 0, w = Er(e, t);
|
|
1925
1950
|
return {
|
|
1926
1951
|
id: r.id,
|
|
1927
1952
|
signature: r.signature,
|
|
@@ -1945,8 +1970,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1945
1970
|
canDelete: t.features?.enableDelete !== !1
|
|
1946
1971
|
};
|
|
1947
1972
|
}
|
|
1948
|
-
},
|
|
1949
|
-
function
|
|
1973
|
+
}, el = 150, tl = 56, rl = 10, il = 320, Tr = 240, al = 2;
|
|
1974
|
+
function ll({ files: e, folderFileCounts: t, features: r, t: a, viewMode: i, previewFallbackToFileUrl: s }) {
|
|
1950
1975
|
let o = (0, c.useMemo)(() => ({
|
|
1951
1976
|
folderFileCounts: t,
|
|
1952
1977
|
features: r,
|
|
@@ -1958,17 +1983,17 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1958
1983
|
a,
|
|
1959
1984
|
s
|
|
1960
1985
|
]), [d, u] = (0, c.useState)(() => Math.max(1, Math.floor(1200 / Tr))), n = (0, c.useMemo)(() => {
|
|
1961
|
-
let F = e.length >
|
|
1986
|
+
let F = e.length > el;
|
|
1962
1987
|
return i === "table" ? {
|
|
1963
1988
|
enabled: F,
|
|
1964
|
-
estimatedItemSize:
|
|
1965
|
-
overscan:
|
|
1989
|
+
estimatedItemSize: tl,
|
|
1990
|
+
overscan: rl,
|
|
1966
1991
|
itemsPerLane: 1,
|
|
1967
1992
|
fallbackViewportHeight: 800
|
|
1968
1993
|
} : {
|
|
1969
1994
|
enabled: F,
|
|
1970
|
-
estimatedItemSize:
|
|
1971
|
-
overscan:
|
|
1995
|
+
estimatedItemSize: il,
|
|
1996
|
+
overscan: al,
|
|
1972
1997
|
itemsPerLane: d,
|
|
1973
1998
|
fallbackViewportHeight: 800
|
|
1974
1999
|
};
|
|
@@ -1976,15 +2001,15 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1976
2001
|
e.length,
|
|
1977
2002
|
d,
|
|
1978
2003
|
i
|
|
1979
|
-
]), { engineOptions: h, handleViewportChange: v } =
|
|
2004
|
+
]), { engineOptions: h, handleViewportChange: v } = Ya({
|
|
1980
2005
|
totalCount: e.length,
|
|
1981
2006
|
plan: n
|
|
1982
2007
|
}), { rowModels: f, renderWindow: w } = se.X({
|
|
1983
2008
|
items: e,
|
|
1984
2009
|
context: o,
|
|
1985
|
-
adapter:
|
|
2010
|
+
adapter: Xa,
|
|
1986
2011
|
options: h
|
|
1987
|
-
}), I = (0, c.useMemo)(() => f.some((F) => !!F.dateText), [f]),
|
|
2012
|
+
}), I = (0, c.useMemo)(() => f.some((F) => !!F.dateText), [f]), _ = (0, c.useCallback)((F) => {
|
|
1988
2013
|
if (i === "grid") {
|
|
1989
2014
|
let V = Math.max(1, Math.floor(F.viewportWidth / Tr));
|
|
1990
2015
|
u((b) => b === V ? b : V);
|
|
@@ -1996,11 +2021,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
1996
2021
|
renderRows: w.rows,
|
|
1997
2022
|
renderWindow: w,
|
|
1998
2023
|
hasAnyValidDate: I,
|
|
1999
|
-
handleViewportChange:
|
|
2024
|
+
handleViewportChange: _
|
|
2000
2025
|
};
|
|
2001
2026
|
}
|
|
2002
|
-
var Mr = c.default.memo(({ files: e, searchTerm: t, handleSearch: r, sortBy: a, sortOrder: i, handleSortOptionChange: s, pagination: o, setPagination: d, loading: u, handleItemClick: n, onClearSelection: h, onRename: v, onDelete: f, onCopy: w, onMove: I, showRenameModal:
|
|
2003
|
-
let { t: R } = m.Nn(), ne = m.cr(), { DropZoneFileIcon: k, BigStockIcon: U, BigAIIcon: D, FolderIcon: Z } = se.K(), { options: $, actions: Y, state: A } = m.V(), { dataProviders: W, config: J } = $, le = J?.disablePagination, { setCurrentMenuFile: me, setActiveLibraryItem: re } = Y,
|
|
2027
|
+
var Mr = c.default.memo(({ files: e, searchTerm: t, handleSearch: r, sortBy: a, sortOrder: i, handleSortOptionChange: s, pagination: o, setPagination: d, loading: u, handleItemClick: n, onClearSelection: h, onRename: v, onDelete: f, onCopy: w, onMove: I, showRenameModal: _, showDeleteConfirm: F, showCopyModal: V, showMoveModal: b, onEdit: y, getFileData: C, handleAddFile: O }) => {
|
|
2028
|
+
let { t: R } = m.Nn(), ne = m.cr(), { DropZoneFileIcon: k, BigStockIcon: U, BigAIIcon: D, FolderIcon: Z } = se.K(), { options: $, actions: Y, state: A } = m.V(), { dataProviders: W, config: J } = $, le = J?.disablePagination, { setCurrentMenuFile: me, setActiveLibraryItem: re } = Y, Te = A?.selectedFolder === "Trash", N = A?.multiSelect !== !1, { viewMode: ve, setViewMode: Be } = Ha(), [Ce, j] = (0, c.useState)({}), [q, B] = (0, c.useState)(!1), ue = (0, c.useRef)(0), pe = (0, c.useRef)(null);
|
|
2004
2029
|
(0, c.useEffect)(() => {
|
|
2005
2030
|
let z = window.matchMedia("(max-width: 1199px)"), G = (Se) => {
|
|
2006
2031
|
B(Se.matches);
|
|
@@ -2012,7 +2037,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2012
2037
|
let K = (0, c.useMemo)(() => J?.features || {}, [J?.features]), x = J?.iconStrokeWidth, S = J?.sortOptions, oe = (0, c.useMemo)(() => S?.length ? new Set(S) : null, [S]), H = `${a}-${i}`;
|
|
2013
2038
|
(0, c.useEffect)(() => {
|
|
2014
2039
|
if (oe && !oe.has(H)) {
|
|
2015
|
-
let z =
|
|
2040
|
+
let z = Nt.find((G) => oe.has(G.value))?.value;
|
|
2016
2041
|
z && s(z);
|
|
2017
2042
|
}
|
|
2018
2043
|
}, [
|
|
@@ -2020,12 +2045,12 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2020
2045
|
H,
|
|
2021
2046
|
s
|
|
2022
2047
|
]);
|
|
2023
|
-
let
|
|
2048
|
+
let xe = (0, c.useMemo)(() => new Map(e.map((z) => [z.id, z])), [e]), { renderRows: he, renderWindow: L, hasAnyValidDate: ie, handleViewportChange: X } = ll({
|
|
2024
2049
|
files: e,
|
|
2025
2050
|
folderFileCounts: Ce,
|
|
2026
2051
|
features: K,
|
|
2027
2052
|
t: R,
|
|
2028
|
-
viewMode:
|
|
2053
|
+
viewMode: ve,
|
|
2029
2054
|
previewFallbackToFileUrl: J?.previewFallbackToFileUrl
|
|
2030
2055
|
}), ke = (0, c.useCallback)(async (z) => {
|
|
2031
2056
|
try {
|
|
@@ -2074,21 +2099,21 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2074
2099
|
]), Oe = (0, c.useCallback)(async () => {
|
|
2075
2100
|
let z = ue.current + 1;
|
|
2076
2101
|
ue.current = z;
|
|
2077
|
-
let G = e.filter((
|
|
2102
|
+
let G = e.filter((Me) => Me.isFolder);
|
|
2078
2103
|
if (G.length === 0) {
|
|
2079
|
-
j((
|
|
2104
|
+
j((Me) => Object.keys(Me).length === 0 ? Me : {});
|
|
2080
2105
|
return;
|
|
2081
2106
|
}
|
|
2082
|
-
let de = {}, Se = G.map(async (
|
|
2083
|
-
if (typeof
|
|
2084
|
-
de[
|
|
2107
|
+
let de = {}, Se = G.map(async (Me) => {
|
|
2108
|
+
if (typeof Me.childCount == "number") {
|
|
2109
|
+
de[Me.id] = Me.childCount;
|
|
2085
2110
|
return;
|
|
2086
2111
|
}
|
|
2087
|
-
de[
|
|
2112
|
+
de[Me.id] = await ke(Me.id);
|
|
2088
2113
|
});
|
|
2089
|
-
await Promise.all(Se), ue.current === z && j((
|
|
2090
|
-
let Ne = Object.keys(
|
|
2091
|
-
return Ne.length === et.length && Ne.every(($e) =>
|
|
2114
|
+
await Promise.all(Se), ue.current === z && j((Me) => {
|
|
2115
|
+
let Ne = Object.keys(Me), et = Object.keys(de);
|
|
2116
|
+
return Ne.length === et.length && Ne.every(($e) => Me[$e] === de[$e]) ? Me : de;
|
|
2092
2117
|
});
|
|
2093
2118
|
}, [e, ke]);
|
|
2094
2119
|
(0, c.useEffect)(() => {
|
|
@@ -2098,7 +2123,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2098
2123
|
}, [
|
|
2099
2124
|
e.length,
|
|
2100
2125
|
X,
|
|
2101
|
-
|
|
2126
|
+
ve
|
|
2102
2127
|
]), (0, c.useEffect)(() => {
|
|
2103
2128
|
if (!pe.current || typeof ResizeObserver > "u") return;
|
|
2104
2129
|
let z = pe.current, G = new ResizeObserver(() => {
|
|
@@ -2128,24 +2153,24 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2128
2153
|
}, [
|
|
2129
2154
|
e.length,
|
|
2130
2155
|
Re,
|
|
2131
|
-
|
|
2156
|
+
ve
|
|
2132
2157
|
]);
|
|
2133
|
-
let
|
|
2134
|
-
...
|
|
2158
|
+
let Fe = (0, c.useCallback)((z, G) => z !== G, []), it = (0, c.useMemo)(() => [
|
|
2159
|
+
...N ? [{
|
|
2135
2160
|
key: "selection",
|
|
2136
2161
|
width: 46,
|
|
2137
|
-
shouldCellUpdate:
|
|
2162
|
+
shouldCellUpdate: Fe,
|
|
2138
2163
|
render: (z, G) => (0, l.jsx)(Tt, { fileId: G.id })
|
|
2139
2164
|
}] : [],
|
|
2140
2165
|
{
|
|
2141
2166
|
key: "preview",
|
|
2142
2167
|
width: 60,
|
|
2143
|
-
shouldCellUpdate:
|
|
2168
|
+
shouldCellUpdate: Fe,
|
|
2144
2169
|
render: (z, G) => (0, l.jsx)(At, {
|
|
2145
2170
|
item: G,
|
|
2146
2171
|
variant: "table",
|
|
2147
2172
|
FolderIcon: Z,
|
|
2148
|
-
getFileData:
|
|
2173
|
+
getFileData: C,
|
|
2149
2174
|
className: `${T.imagePreview} ${T.tableImagePreview}`,
|
|
2150
2175
|
width: 40,
|
|
2151
2176
|
height: 40
|
|
@@ -2157,14 +2182,14 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2157
2182
|
dataIndex: "nameText",
|
|
2158
2183
|
key: "name",
|
|
2159
2184
|
className: T.fileNameCol,
|
|
2160
|
-
shouldCellUpdate:
|
|
2185
|
+
shouldCellUpdate: Fe,
|
|
2161
2186
|
render: (z, G) => (0, l.jsx)(kr, { item: G })
|
|
2162
2187
|
},
|
|
2163
2188
|
{
|
|
2164
2189
|
title: R("Dimensions"),
|
|
2165
2190
|
key: "dimensions",
|
|
2166
2191
|
width: 100,
|
|
2167
|
-
shouldCellUpdate:
|
|
2192
|
+
shouldCellUpdate: Fe,
|
|
2168
2193
|
render: (z, G) => G.dimensionsText && (0, l.jsx)("div", {
|
|
2169
2194
|
className: T.fileSize,
|
|
2170
2195
|
children: G.dimensionsText
|
|
@@ -2174,7 +2199,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2174
2199
|
title: R("Size"),
|
|
2175
2200
|
key: "size",
|
|
2176
2201
|
width: 90,
|
|
2177
|
-
shouldCellUpdate:
|
|
2202
|
+
shouldCellUpdate: Fe,
|
|
2178
2203
|
render: (z, G) => G.sizeText ? (0, l.jsx)("div", {
|
|
2179
2204
|
className: T.fileSize,
|
|
2180
2205
|
children: G.sizeText
|
|
@@ -2184,7 +2209,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2184
2209
|
title: R("Type"),
|
|
2185
2210
|
key: "type",
|
|
2186
2211
|
width: 90,
|
|
2187
|
-
shouldCellUpdate:
|
|
2212
|
+
shouldCellUpdate: Fe,
|
|
2188
2213
|
render: (z, G) => (0, l.jsx)("div", {
|
|
2189
2214
|
className: T.fileSize,
|
|
2190
2215
|
children: G.typeText
|
|
@@ -2195,7 +2220,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2195
2220
|
dataIndex: "dateText",
|
|
2196
2221
|
key: "date",
|
|
2197
2222
|
width: 200,
|
|
2198
|
-
shouldCellUpdate:
|
|
2223
|
+
shouldCellUpdate: Fe,
|
|
2199
2224
|
render: (z, G) => (0, l.jsx)(Pr, { item: G })
|
|
2200
2225
|
}] : [],
|
|
2201
2226
|
{
|
|
@@ -2204,7 +2229,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2204
2229
|
dataIndex: "",
|
|
2205
2230
|
key: "x",
|
|
2206
2231
|
onCell: () => ({ style: { padding: 0 } }),
|
|
2207
|
-
shouldCellUpdate:
|
|
2232
|
+
shouldCellUpdate: Fe,
|
|
2208
2233
|
render: (z, G) => (0, l.jsx)(Mt, {
|
|
2209
2234
|
item: G,
|
|
2210
2235
|
variant: "table",
|
|
@@ -2213,42 +2238,42 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2213
2238
|
setCurrentMenuFile: me,
|
|
2214
2239
|
showMoveModal: b,
|
|
2215
2240
|
showCopyModal: V,
|
|
2216
|
-
showRenameModal:
|
|
2241
|
+
showRenameModal: _,
|
|
2217
2242
|
showDeleteConfirm: F,
|
|
2218
2243
|
onEdit: y
|
|
2219
2244
|
})
|
|
2220
2245
|
}
|
|
2221
2246
|
], [
|
|
2222
2247
|
Z,
|
|
2223
|
-
|
|
2248
|
+
C,
|
|
2224
2249
|
ie,
|
|
2225
2250
|
x,
|
|
2226
|
-
|
|
2251
|
+
N,
|
|
2227
2252
|
y,
|
|
2228
2253
|
me,
|
|
2229
|
-
|
|
2254
|
+
Fe,
|
|
2230
2255
|
V,
|
|
2231
2256
|
F,
|
|
2232
2257
|
b,
|
|
2233
|
-
|
|
2258
|
+
_,
|
|
2234
2259
|
R
|
|
2235
|
-
]),
|
|
2260
|
+
]), we = (0, c.useMemo)(() => ({ body: { row: Ir } }), []), Xe = (0, c.useCallback)((z) => ({ onClick: (G) => {
|
|
2236
2261
|
if (G.stopPropagation(), G.preventDefault(), G.detail !== 1) return;
|
|
2237
|
-
let de = G.target, Se = !!de.closest(".ant-checkbox-wrapper"),
|
|
2238
|
-
if (!(Se || br(de) ||
|
|
2262
|
+
let de = G.target, Se = !!de.closest(".ant-checkbox-wrapper"), Me = !!de.closest(".tableMenuButton"), Ne = !!de.closest(".ant-dropdown-menu");
|
|
2263
|
+
if (!(Se || br(de) || Me || Ne)) {
|
|
2239
2264
|
if (z.isFolder) {
|
|
2240
2265
|
n(z.file);
|
|
2241
2266
|
return;
|
|
2242
2267
|
}
|
|
2243
|
-
$.onEditorOk &&
|
|
2268
|
+
$.onEditorOk && _r(z.file) && $.onEditorOk(z.file);
|
|
2244
2269
|
}
|
|
2245
|
-
} }), [n, $]), ut =
|
|
2270
|
+
} }), [n, $]), ut = ve === "table" ? (0, l.jsx)(xr, {
|
|
2246
2271
|
rows: he,
|
|
2247
2272
|
columns: it,
|
|
2248
2273
|
topOffset: L.topOffset,
|
|
2249
2274
|
bottomOffset: L.bottomOffset,
|
|
2250
2275
|
onRow: Xe,
|
|
2251
|
-
components:
|
|
2276
|
+
components: we
|
|
2252
2277
|
}) : (0, l.jsx)(Fr, {
|
|
2253
2278
|
rows: he,
|
|
2254
2279
|
topOffset: L.topOffset,
|
|
@@ -2260,15 +2285,15 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2260
2285
|
setCurrentMenuFile: me,
|
|
2261
2286
|
showMoveModal: b,
|
|
2262
2287
|
showCopyModal: V,
|
|
2263
|
-
showRenameModal:
|
|
2288
|
+
showRenameModal: _,
|
|
2264
2289
|
showDeleteConfirm: F,
|
|
2265
2290
|
onEdit: y,
|
|
2266
2291
|
onEditorOk: $.onEditorOk,
|
|
2267
|
-
getFileData:
|
|
2268
|
-
showSelectionCheckbox:
|
|
2292
|
+
getFileData: C,
|
|
2293
|
+
showSelectionCheckbox: N
|
|
2269
2294
|
});
|
|
2270
2295
|
t && !e.length && (ut = (0, l.jsx)(se.J, {}));
|
|
2271
|
-
let ae = J?.availableImageExtensions?.map((z) => "." + z).join(", "), fe =
|
|
2296
|
+
let ae = J?.availableImageExtensions?.map((z) => "." + z).join(", "), fe = Te ? (0, l.jsxs)("div", {
|
|
2272
2297
|
className: `${T.noFiles} ant-layout-sider-light`,
|
|
2273
2298
|
children: [
|
|
2274
2299
|
(0, l.jsx)(er, {
|
|
@@ -2354,13 +2379,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2354
2379
|
children: [
|
|
2355
2380
|
(0, l.jsx)(wr, {
|
|
2356
2381
|
files: e,
|
|
2357
|
-
filesById:
|
|
2382
|
+
filesById: xe,
|
|
2358
2383
|
currentSortOption: H,
|
|
2359
2384
|
isSmallScreen: q,
|
|
2360
2385
|
iconStrokeWidth: x,
|
|
2361
|
-
multiSelectEnabled:
|
|
2386
|
+
multiSelectEnabled: N,
|
|
2362
2387
|
features: K,
|
|
2363
|
-
viewMode:
|
|
2388
|
+
viewMode: ve,
|
|
2364
2389
|
setViewMode: Be,
|
|
2365
2390
|
handleSearch: r,
|
|
2366
2391
|
handleSortOptionChange: s,
|
|
@@ -2403,7 +2428,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2403
2428
|
});
|
|
2404
2429
|
});
|
|
2405
2430
|
Mr.displayName = "FileContent";
|
|
2406
|
-
var
|
|
2431
|
+
var sl = (0, c.memo)(({ folderId: e, activeFormField: t, EmptyFolderIcon: r, targetForm: a, handleModalOk: i, onComplete: s, t: o, setIsLoading: d, defaultFolderName: u }) => {
|
|
2407
2432
|
let n = (0, c.useCallback)(() => {
|
|
2408
2433
|
d(!0), i(a).then((h) => s(h?.id)).finally(() => d(!1));
|
|
2409
2434
|
}, [
|
|
@@ -2435,15 +2460,15 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2435
2460
|
})
|
|
2436
2461
|
});
|
|
2437
2462
|
});
|
|
2438
|
-
|
|
2439
|
-
var
|
|
2440
|
-
let { t:
|
|
2463
|
+
sl.displayName = "CustomFolderInput";
|
|
2464
|
+
var ol = ({ isModalVisible: e, handleModalOk: t, handleModalCancel: r, form: a, selectedFolder: i, folders: s, isUrlModalVisible: o, setIsUrlModalVisible: d, handleAddFileByUrl: u, urlForm: n, isRenameModalVisible: h, handleRenameOk: v, handleRenameCancel: f, renameForm: w, fileToRename: I, files: _, isMoveModalVisible: F, handleMoveOk: V, handleMoveCancel: b, moveForm: y, selectedFiles: C, isRenameFolderModalVisible: O, handleRenameFolderOk: R, handleRenameFolderCancel: ne, renameFolderForm: k, folderToRename: U, isCopyModalVisible: D, handleCopyOk: Z, handleCopyCancel: $, copyForm: Y, isDeleteConfirmVisible: A, handleDeleteConfirmOk: W, handleDeleteConfirmCancel: J, isClearTrashConfirmVisible: le, handleClearTrashConfirm: me, handleClearTrashCancel: re, fetchChildFolders: Te }) => {
|
|
2465
|
+
let { t: N } = m.Nn(), { state: ve, actions: Be, options: Ce } = m.V(), { setCurrentMenuFile: j } = Be, { config: q, getModalContainer: B } = Ce, { currentMenuFile: ue } = ve, pe = g.Form.useWatch("folderName", a), { EmptyFolderIcon: K } = se.K(), [x, S] = (0, c.useState)(!1), oe = (0, c.useMemo)(() => q?.defaultFolderName?.trim() || N("New folder"), [q?.defaultFolderName, N]), H = !pe || String(pe).trim().length === 0, xe = (0, c.useMemo)(() => Array.isArray(_) ? _ : [], [_]), he = I ? xe.find((ae) => ae.id === I)?.name : "", L = Array.isArray(s) ? s : [], ie = U ? L.find((ae) => ae.id === U)?.name : "", { activeFormField: X, setActiveFormField: ke, generateMenuItemsFromFolders: Oe } = se.oe({
|
|
2441
2466
|
folders: L,
|
|
2442
2467
|
selectedFolder: i,
|
|
2443
2468
|
EmptyFolderIcon: K,
|
|
2444
2469
|
handleCreateFolderModalOk: t,
|
|
2445
2470
|
setIsLoading: (ae) => S(!!ae),
|
|
2446
|
-
t:
|
|
2471
|
+
t: N
|
|
2447
2472
|
});
|
|
2448
2473
|
(0, c.useEffect)(() => {
|
|
2449
2474
|
if (A) {
|
|
@@ -2460,7 +2485,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2460
2485
|
return () => clearTimeout(ae);
|
|
2461
2486
|
}
|
|
2462
2487
|
}, [A]);
|
|
2463
|
-
let Re = (I ?
|
|
2488
|
+
let Re = (I ? xe.find((ae) => ae.id === I) : null)?.isFolder || I?.startsWith("folder_"), Fe = (0, c.useCallback)(async (ae) => {
|
|
2464
2489
|
ae.length > 0 && (y.setFieldsValue({ targetFolder: ae[0] }), X !== ae[0].toString() && ke(""));
|
|
2465
2490
|
}, [
|
|
2466
2491
|
y,
|
|
@@ -2472,7 +2497,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2472
2497
|
X,
|
|
2473
2498
|
Y,
|
|
2474
2499
|
ke
|
|
2475
|
-
]),
|
|
2500
|
+
]), we = (0, c.useCallback)(async (ae) => {
|
|
2476
2501
|
S(!0);
|
|
2477
2502
|
try {
|
|
2478
2503
|
await V(ae);
|
|
@@ -2487,11 +2512,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2487
2512
|
S(!1);
|
|
2488
2513
|
}
|
|
2489
2514
|
}, [Z]), ut = (0, c.useMemo)(() => {
|
|
2490
|
-
let ae = Array.from(
|
|
2515
|
+
let ae = Array.from(C).filter((fe) => xe.find((z) => z.id === fe)?.isFolder || s.some((z) => z.id === fe));
|
|
2491
2516
|
return i && i !== "folders" ? ae.push(i) : (!i || i === "folders") && ae.push("folders"), ae;
|
|
2492
2517
|
}, [
|
|
2493
|
-
|
|
2494
|
-
|
|
2518
|
+
C,
|
|
2519
|
+
xe,
|
|
2495
2520
|
s,
|
|
2496
2521
|
i
|
|
2497
2522
|
]);
|
|
@@ -2499,13 +2524,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2499
2524
|
(0, l.jsx)(g.Modal, {
|
|
2500
2525
|
title: (0, l.jsx)("div", {
|
|
2501
2526
|
className: "modal-title",
|
|
2502
|
-
children:
|
|
2527
|
+
children: N("Creating a new folder")
|
|
2503
2528
|
}),
|
|
2504
2529
|
open: e,
|
|
2505
2530
|
onOk: () => t(),
|
|
2506
2531
|
onCancel: r,
|
|
2507
|
-
okText:
|
|
2508
|
-
cancelText:
|
|
2532
|
+
okText: N("Create"),
|
|
2533
|
+
cancelText: N("Cancel"),
|
|
2509
2534
|
okButtonProps: {
|
|
2510
2535
|
disabled: H,
|
|
2511
2536
|
loading: x
|
|
@@ -2521,11 +2546,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2521
2546
|
name: "folderName",
|
|
2522
2547
|
label: (0, l.jsx)("div", {
|
|
2523
2548
|
className: "form-label",
|
|
2524
|
-
children:
|
|
2549
|
+
children: N("Folder name")
|
|
2525
2550
|
}),
|
|
2526
2551
|
rules: [{
|
|
2527
2552
|
required: !0,
|
|
2528
|
-
validator: (ae, fe) => typeof fe == "string" && fe.trim().length === 0 ? Promise.reject(Error(
|
|
2553
|
+
validator: (ae, fe) => typeof fe == "string" && fe.trim().length === 0 ? Promise.reject(Error(N("Enter the name of the folder"))) : Promise.resolve()
|
|
2529
2554
|
}],
|
|
2530
2555
|
initialValue: oe,
|
|
2531
2556
|
className: "form-item",
|
|
@@ -2534,7 +2559,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2534
2559
|
autoFocus: !0,
|
|
2535
2560
|
className: "form-input",
|
|
2536
2561
|
disabled: x,
|
|
2537
|
-
placeholder:
|
|
2562
|
+
placeholder: N("Enter the name"),
|
|
2538
2563
|
onPressEnter: async () => {
|
|
2539
2564
|
S(!0);
|
|
2540
2565
|
try {
|
|
@@ -2547,21 +2572,21 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2547
2572
|
}), (0, l.jsx)("div", { children: i && i !== "folders" ? (0, l.jsxs)("p", {
|
|
2548
2573
|
className: "fm-note",
|
|
2549
2574
|
children: [
|
|
2550
|
-
|
|
2575
|
+
N("A folder will be created inside:"),
|
|
2551
2576
|
" ",
|
|
2552
|
-
L.find((ae) => ae.id === i)?.name ||
|
|
2577
|
+
L.find((ae) => ae.id === i)?.name || N("selected folder"),
|
|
2553
2578
|
"."
|
|
2554
2579
|
]
|
|
2555
2580
|
}) : (0, l.jsx)("p", {
|
|
2556
2581
|
className: "fm-note",
|
|
2557
|
-
children:
|
|
2582
|
+
children: N("The folder will be created in the root directory.")
|
|
2558
2583
|
}) })]
|
|
2559
2584
|
})
|
|
2560
2585
|
}),
|
|
2561
2586
|
(0, l.jsx)(g.Modal, {
|
|
2562
2587
|
title: (0, l.jsx)("div", {
|
|
2563
2588
|
className: "modal-title",
|
|
2564
|
-
children:
|
|
2589
|
+
children: N("Upload file by URL")
|
|
2565
2590
|
}),
|
|
2566
2591
|
open: o,
|
|
2567
2592
|
onOk: async () => {
|
|
@@ -2574,9 +2599,9 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2574
2599
|
}
|
|
2575
2600
|
},
|
|
2576
2601
|
onCancel: () => d(!1),
|
|
2577
|
-
okText:
|
|
2602
|
+
okText: N("Download"),
|
|
2578
2603
|
okButtonProps: { loading: x },
|
|
2579
|
-
cancelText:
|
|
2604
|
+
cancelText: N("Cancel"),
|
|
2580
2605
|
cancelButtonProps: { disabled: x },
|
|
2581
2606
|
afterClose: () => S(!1),
|
|
2582
2607
|
centered: !0,
|
|
@@ -2588,17 +2613,17 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2588
2613
|
name: "fileUrl",
|
|
2589
2614
|
label: (0, l.jsx)("div", {
|
|
2590
2615
|
className: "form-label",
|
|
2591
|
-
children:
|
|
2616
|
+
children: N("File URL")
|
|
2592
2617
|
}),
|
|
2593
2618
|
rules: [{
|
|
2594
2619
|
required: !0,
|
|
2595
|
-
message:
|
|
2620
|
+
message: N("Enter the URL of the image")
|
|
2596
2621
|
}, { validator: (ae, fe) => {
|
|
2597
2622
|
if (!fe || !String(fe).trim()) return Promise.resolve();
|
|
2598
2623
|
try {
|
|
2599
|
-
return m.Lr(String(fe),
|
|
2624
|
+
return m.Lr(String(fe), N), Promise.resolve();
|
|
2600
2625
|
} catch (z) {
|
|
2601
|
-
return Promise.reject(Error(z instanceof Error ? z.message :
|
|
2626
|
+
return Promise.reject(Error(z instanceof Error ? z.message : N("The specified URL is not valid.")));
|
|
2602
2627
|
}
|
|
2603
2628
|
} }],
|
|
2604
2629
|
validateTrigger: "onBlur",
|
|
@@ -2624,14 +2649,14 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2624
2649
|
(0, l.jsx)(g.Modal, {
|
|
2625
2650
|
title: (0, l.jsx)("div", {
|
|
2626
2651
|
className: "modal-title",
|
|
2627
|
-
children: Re ? `${
|
|
2652
|
+
children: Re ? `${N("Rename folder")} ${he}` : N("Rename file", { currentFileName: he })
|
|
2628
2653
|
}),
|
|
2629
2654
|
open: h,
|
|
2630
2655
|
onOk: v,
|
|
2631
|
-
okText:
|
|
2656
|
+
okText: N("Rename"),
|
|
2632
2657
|
okButtonProps: { loading: x },
|
|
2633
2658
|
onCancel: f,
|
|
2634
|
-
cancelText:
|
|
2659
|
+
cancelText: N("Cancel"),
|
|
2635
2660
|
cancelButtonProps: { disabled: x },
|
|
2636
2661
|
afterClose: () => {
|
|
2637
2662
|
S(!1), j && j("");
|
|
@@ -2645,11 +2670,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2645
2670
|
name: "newFileName",
|
|
2646
2671
|
label: (0, l.jsx)("div", {
|
|
2647
2672
|
className: "form-label",
|
|
2648
|
-
children:
|
|
2673
|
+
children: N(Re ? "New folder name" : "New file name")
|
|
2649
2674
|
}),
|
|
2650
2675
|
rules: [{
|
|
2651
2676
|
required: !0,
|
|
2652
|
-
message:
|
|
2677
|
+
message: N(Re ? "Enter a new folder name" : "Enter a new file name")
|
|
2653
2678
|
}],
|
|
2654
2679
|
className: "form-item",
|
|
2655
2680
|
children: (0, l.jsx)(g.Input, {
|
|
@@ -2671,7 +2696,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2671
2696
|
(0, l.jsx)(g.Modal, {
|
|
2672
2697
|
title: (0, l.jsx)("div", {
|
|
2673
2698
|
className: "modal-title",
|
|
2674
|
-
children:
|
|
2699
|
+
children: N("Move to")
|
|
2675
2700
|
}),
|
|
2676
2701
|
open: F,
|
|
2677
2702
|
onCancel: b,
|
|
@@ -2690,13 +2715,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2690
2715
|
children: [(0, l.jsx)(kt.s, {
|
|
2691
2716
|
size: 18,
|
|
2692
2717
|
strokeWidth: q?.iconStrokeWidth
|
|
2693
|
-
}),
|
|
2718
|
+
}), N("Create folder")]
|
|
2694
2719
|
}), (0, l.jsx)(g.Button, {
|
|
2695
2720
|
type: "primary",
|
|
2696
2721
|
className: se.Q.folderButton,
|
|
2697
2722
|
onClick: b,
|
|
2698
2723
|
loading: x,
|
|
2699
|
-
children:
|
|
2724
|
+
children: N("Done")
|
|
2700
2725
|
})]
|
|
2701
2726
|
}),
|
|
2702
2727
|
afterClose: () => {
|
|
@@ -2725,18 +2750,18 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2725
2750
|
name: "targetFolder",
|
|
2726
2751
|
rules: [{
|
|
2727
2752
|
required: !0,
|
|
2728
|
-
message:
|
|
2753
|
+
message: N("Select the destination folder")
|
|
2729
2754
|
}],
|
|
2730
2755
|
className: se.Q.formItem,
|
|
2731
2756
|
children: (0, l.jsx)(se.ie, {
|
|
2732
|
-
onSelect:
|
|
2757
|
+
onSelect: Fe,
|
|
2733
2758
|
generateMenuItems: () => Oe({
|
|
2734
2759
|
targetForm: y,
|
|
2735
|
-
onTreeSelect:
|
|
2736
|
-
onComplete:
|
|
2737
|
-
actionButtonText:
|
|
2760
|
+
onTreeSelect: Fe,
|
|
2761
|
+
onComplete: we,
|
|
2762
|
+
actionButtonText: N("Move here")
|
|
2738
2763
|
}),
|
|
2739
|
-
fetchChildFolders:
|
|
2764
|
+
fetchChildFolders: Te,
|
|
2740
2765
|
disabledFolders: ut,
|
|
2741
2766
|
mode: "selection",
|
|
2742
2767
|
className: "folderSelectionTree",
|
|
@@ -2748,7 +2773,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2748
2773
|
style: { display: "none" },
|
|
2749
2774
|
rules: [{
|
|
2750
2775
|
required: !0,
|
|
2751
|
-
validator: (ae, fe) => typeof fe == "string" && fe.trim().length === 0 ? Promise.reject(Error(
|
|
2776
|
+
validator: (ae, fe) => typeof fe == "string" && fe.trim().length === 0 ? Promise.reject(Error(N("Enter the name of the folder"))) : Promise.resolve()
|
|
2752
2777
|
}],
|
|
2753
2778
|
children: (0, l.jsx)(g.Input, {})
|
|
2754
2779
|
}),
|
|
@@ -2765,7 +2790,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2765
2790
|
(0, l.jsx)(g.Modal, {
|
|
2766
2791
|
title: (0, l.jsx)("div", {
|
|
2767
2792
|
className: "modal-title",
|
|
2768
|
-
children:
|
|
2793
|
+
children: N("Copy to folder")
|
|
2769
2794
|
}),
|
|
2770
2795
|
open: D,
|
|
2771
2796
|
onCancel: $,
|
|
@@ -2784,13 +2809,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2784
2809
|
children: [(0, l.jsx)(kt.s, {
|
|
2785
2810
|
size: 18,
|
|
2786
2811
|
strokeWidth: q?.iconStrokeWidth
|
|
2787
|
-
}),
|
|
2812
|
+
}), N("Create folder")]
|
|
2788
2813
|
}), (0, l.jsx)(g.Button, {
|
|
2789
2814
|
type: "primary",
|
|
2790
2815
|
className: se.Q.folderButton,
|
|
2791
2816
|
onClick: $,
|
|
2792
2817
|
loading: x,
|
|
2793
|
-
children:
|
|
2818
|
+
children: N("Done")
|
|
2794
2819
|
})]
|
|
2795
2820
|
}),
|
|
2796
2821
|
afterClose: () => {
|
|
@@ -2819,7 +2844,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2819
2844
|
name: "targetFolder",
|
|
2820
2845
|
rules: [{
|
|
2821
2846
|
required: !0,
|
|
2822
|
-
message:
|
|
2847
|
+
message: N("Select the destination folder")
|
|
2823
2848
|
}],
|
|
2824
2849
|
className: se.Q.formItem,
|
|
2825
2850
|
children: (0, l.jsx)(se.ie, {
|
|
@@ -2828,9 +2853,9 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2828
2853
|
targetForm: Y,
|
|
2829
2854
|
onTreeSelect: it,
|
|
2830
2855
|
onComplete: Xe,
|
|
2831
|
-
actionButtonText:
|
|
2856
|
+
actionButtonText: N("Copy here")
|
|
2832
2857
|
}),
|
|
2833
|
-
fetchChildFolders:
|
|
2858
|
+
fetchChildFolders: Te,
|
|
2834
2859
|
disabledFolders: ut,
|
|
2835
2860
|
mode: "selection",
|
|
2836
2861
|
className: "folderSelectionTree",
|
|
@@ -2842,7 +2867,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2842
2867
|
style: { display: "none" },
|
|
2843
2868
|
rules: [{
|
|
2844
2869
|
required: !0,
|
|
2845
|
-
validator: (ae, fe) => typeof fe == "string" && fe.trim().length === 0 ? Promise.reject(Error(
|
|
2870
|
+
validator: (ae, fe) => typeof fe == "string" && fe.trim().length === 0 ? Promise.reject(Error(N("Enter the name of the folder"))) : Promise.resolve()
|
|
2846
2871
|
}],
|
|
2847
2872
|
children: (0, l.jsx)(g.Input, {})
|
|
2848
2873
|
}),
|
|
@@ -2860,7 +2885,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2860
2885
|
title: (0, l.jsxs)("div", {
|
|
2861
2886
|
className: "modal-title",
|
|
2862
2887
|
children: [
|
|
2863
|
-
|
|
2888
|
+
N("Rename folder"),
|
|
2864
2889
|
" ",
|
|
2865
2890
|
ie
|
|
2866
2891
|
]
|
|
@@ -2868,8 +2893,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2868
2893
|
open: O,
|
|
2869
2894
|
onOk: R,
|
|
2870
2895
|
onCancel: ne,
|
|
2871
|
-
okText:
|
|
2872
|
-
cancelText:
|
|
2896
|
+
okText: N("Rename"),
|
|
2897
|
+
cancelText: N("Cancel"),
|
|
2873
2898
|
okButtonProps: { loading: x },
|
|
2874
2899
|
cancelButtonProps: { disabled: x },
|
|
2875
2900
|
afterClose: () => {
|
|
@@ -2884,11 +2909,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2884
2909
|
name: "newFolderName",
|
|
2885
2910
|
label: (0, l.jsx)("div", {
|
|
2886
2911
|
className: "form-label",
|
|
2887
|
-
children:
|
|
2912
|
+
children: N("New folder name")
|
|
2888
2913
|
}),
|
|
2889
2914
|
rules: [{
|
|
2890
2915
|
required: !0,
|
|
2891
|
-
message:
|
|
2916
|
+
message: N("Enter a new folder name")
|
|
2892
2917
|
}],
|
|
2893
2918
|
className: "form-item",
|
|
2894
2919
|
children: (0, l.jsx)(g.Input, {
|
|
@@ -2911,7 +2936,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2911
2936
|
className: `${se.Q.deleteModal} deleteModal`,
|
|
2912
2937
|
title: (0, l.jsx)("div", {
|
|
2913
2938
|
className: "modal-title",
|
|
2914
|
-
children: q?.enableTrashFolder && i === "Trash" || !q?.enableTrashFolder ?
|
|
2939
|
+
children: q?.enableTrashFolder && i === "Trash" || !q?.enableTrashFolder ? N("Permanently delete") : N("Move to Trash")
|
|
2915
2940
|
}),
|
|
2916
2941
|
open: !!A,
|
|
2917
2942
|
onOk: () => {
|
|
@@ -2923,8 +2948,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2923
2948
|
}
|
|
2924
2949
|
},
|
|
2925
2950
|
onCancel: () => J && J(),
|
|
2926
|
-
okText: q?.enableTrashFolder && i === "Trash" ?
|
|
2927
|
-
cancelText:
|
|
2951
|
+
okText: q?.enableTrashFolder && i === "Trash" ? N("Delete permanently") : q?.enableTrashFolder ? N("Move to Trash") : N("Delete"),
|
|
2952
|
+
cancelText: N("Cancel"),
|
|
2928
2953
|
okButtonProps: {
|
|
2929
2954
|
danger: !q?.enableTrashFolder || i === "Trash",
|
|
2930
2955
|
loading: x
|
|
@@ -2937,33 +2962,33 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2937
2962
|
centered: !0,
|
|
2938
2963
|
getContainer: B,
|
|
2939
2964
|
children: (() => {
|
|
2940
|
-
let ae = (ue ? [ue] : Array.from(
|
|
2941
|
-
if (!
|
|
2965
|
+
let ae = (ue ? [ue] : Array.from(C || [])).map((Ne) => xe.find((et) => et.id === Ne)).filter((Ne) => !!Ne), fe = ae.filter((Ne) => Ne.isFolder || Ne.id.startsWith("folder_")), z = ae.filter((Ne) => !(Ne.isFolder || Ne.id.startsWith("folder_"))), G = ae.length, de = fe.length, Se = z.length, Me = !!q?.enableTrashFolder;
|
|
2966
|
+
if (!Me || Me && i === "Trash") {
|
|
2942
2967
|
let Ne;
|
|
2943
2968
|
if (G === 1 && de === 1) {
|
|
2944
2969
|
let et = fe[0], $e = et?.name || "", xt = et?.childCount ?? 0;
|
|
2945
|
-
Ne =
|
|
2970
|
+
Ne = N("delete_folder_permanent", {
|
|
2946
2971
|
name: $e,
|
|
2947
2972
|
count: xt
|
|
2948
2973
|
});
|
|
2949
|
-
} else Ne = de === 0 && Se > 0 ?
|
|
2974
|
+
} else Ne = de === 0 && Se > 0 ? N("delete_files_permanent", { count: Se }) : N("delete_mixed_permanent", {
|
|
2950
2975
|
total: G,
|
|
2951
2976
|
folders: de,
|
|
2952
2977
|
images: Se
|
|
2953
2978
|
});
|
|
2954
2979
|
return (0, l.jsxs)("div", { children: [(0, l.jsx)("div", { children: Ne }), (0, l.jsx)("p", {
|
|
2955
2980
|
className: se.Q.permanentDeleteWarning,
|
|
2956
|
-
children:
|
|
2981
|
+
children: N("permanent_delete_warning")
|
|
2957
2982
|
})] });
|
|
2958
2983
|
}
|
|
2959
2984
|
if (G === 1 && de === 1) {
|
|
2960
2985
|
let Ne = fe[0], et = Ne?.name || "", $e = Ne?.childCount ?? 0;
|
|
2961
|
-
return (0, l.jsx)("div", { children:
|
|
2986
|
+
return (0, l.jsx)("div", { children: N("move_folder_to_trash", {
|
|
2962
2987
|
name: et,
|
|
2963
2988
|
count: $e
|
|
2964
2989
|
}) });
|
|
2965
2990
|
}
|
|
2966
|
-
return de === 0 && Se > 0 ? (0, l.jsx)("div", { children:
|
|
2991
|
+
return de === 0 && Se > 0 ? (0, l.jsx)("div", { children: N("move_files_to_trash", { count: Se }) }) : (0, l.jsx)("div", { children: N("move_mixed_to_trash", {
|
|
2967
2992
|
total: G,
|
|
2968
2993
|
folders: de,
|
|
2969
2994
|
images: Se
|
|
@@ -2974,15 +2999,15 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2974
2999
|
className: `${se.Q.deleteModal} deleteModal`,
|
|
2975
3000
|
title: (0, l.jsx)("div", {
|
|
2976
3001
|
className: "modal-title",
|
|
2977
|
-
children:
|
|
3002
|
+
children: N("Clear Trash")
|
|
2978
3003
|
}),
|
|
2979
3004
|
open: !!le,
|
|
2980
3005
|
onOk: async () => {
|
|
2981
3006
|
S(!0), me && await me(), S(!1);
|
|
2982
3007
|
},
|
|
2983
3008
|
onCancel: () => re && re(),
|
|
2984
|
-
okText:
|
|
2985
|
-
cancelText:
|
|
3009
|
+
okText: N("Delete permanently"),
|
|
3010
|
+
cancelText: N("Cancel"),
|
|
2986
3011
|
okButtonProps: {
|
|
2987
3012
|
danger: !0,
|
|
2988
3013
|
loading: x
|
|
@@ -2994,7 +3019,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
2994
3019
|
closeIcon: (0, l.jsx)(qe.CloseOutlined, { className: se.Q.closeIcon }),
|
|
2995
3020
|
centered: !0,
|
|
2996
3021
|
getContainer: B,
|
|
2997
|
-
children: [(0, l.jsx)("div", { children:
|
|
3022
|
+
children: [(0, l.jsx)("div", { children: N("Are you sure you want to permanently delete all items from Trash?") }), x && (0, l.jsxs)("div", {
|
|
2998
3023
|
className: se.Q.clearTrashProgress,
|
|
2999
3024
|
children: [(0, l.jsx)(g.Progress, {
|
|
3000
3025
|
percent: 99,
|
|
@@ -3002,7 +3027,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3002
3027
|
showInfo: !1
|
|
3003
3028
|
}), (0, l.jsx)("div", {
|
|
3004
3029
|
className: se.Q.progressText,
|
|
3005
|
-
children:
|
|
3030
|
+
children: N("Deleting items...")
|
|
3006
3031
|
})]
|
|
3007
3032
|
})]
|
|
3008
3033
|
})
|
|
@@ -3037,9 +3062,9 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3037
3062
|
lockedTabLock: "lockedTabLock",
|
|
3038
3063
|
lockedTabLabel: "lockedTabLabel"
|
|
3039
3064
|
}, Ar = (0, c.memo)((0, c.forwardRef)(({ selectedFolder: e, generateMenuItems: t, onFolderSelect: r, folders: a, fetchChildFolders: i, handleAddFile: s, setIsUrlModalVisible: o, handleCreateFolder: d, activeLibraryItem: u, setActiveLibraryItem: n }, h) => {
|
|
3040
|
-
let v = (0, c.useMemo)(() => Array.isArray(a) ? a : [], [a]), { t: f } = m.Nn(), w = m.cr(), [I,
|
|
3065
|
+
let v = (0, c.useMemo)(() => Array.isArray(a) ? a : [], [a]), { t: f } = m.Nn(), w = m.cr(), [I, _] = (0, c.useState)({}), { options: F, state: V } = m.V(), { dataProviders: b, config: y } = F, C = V.pathHistory, O = y?.features?.enableGif !== !1 && (!y?.enabledTabs || y.enabledTabs.includes("gif")), R = y?.features?.enableStockImages !== !1 && (!y?.enabledTabs || y.enabledTabs.includes("stock")), ne = y?.features?.enableIconStock !== !1 && (!y?.enabledTabs || y.enabledTabs.includes("icons")), k = y?.features?.enableQrBarcodeTab !== !1 && (!y?.enabledTabs || y.enabledTabs.includes("codes")), U = (0, c.useCallback)((j, q) => m.Kn(q, y) ? (0, l.jsxs)("span", {
|
|
3041
3066
|
className: Je.lockedTabIcon,
|
|
3042
|
-
children: [j, (0, l.jsx)(
|
|
3067
|
+
children: [j, (0, l.jsx)(be.i, {
|
|
3043
3068
|
size: 12,
|
|
3044
3069
|
strokeWidth: 2.5,
|
|
3045
3070
|
className: Je.lockedTabLock
|
|
@@ -3113,7 +3138,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3113
3138
|
folderId: j,
|
|
3114
3139
|
dataProviders: b,
|
|
3115
3140
|
folders: v,
|
|
3116
|
-
pathHistory:
|
|
3141
|
+
pathHistory: C,
|
|
3117
3142
|
t: f
|
|
3118
3143
|
});
|
|
3119
3144
|
return w.error({
|
|
@@ -3133,7 +3158,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3133
3158
|
b,
|
|
3134
3159
|
J,
|
|
3135
3160
|
w,
|
|
3136
|
-
|
|
3161
|
+
C,
|
|
3137
3162
|
v,
|
|
3138
3163
|
f
|
|
3139
3164
|
]), me = (0, c.useCallback)(async () => {
|
|
@@ -3147,10 +3172,10 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3147
3172
|
}
|
|
3148
3173
|
j[B.id] = await le(B.id);
|
|
3149
3174
|
});
|
|
3150
|
-
await Promise.all(q),
|
|
3175
|
+
await Promise.all(q), _(j);
|
|
3151
3176
|
}, [v, le]), re = (0, c.useCallback)(async (j) => {
|
|
3152
3177
|
let q = await le(j);
|
|
3153
|
-
|
|
3178
|
+
_((B) => ({
|
|
3154
3179
|
...B,
|
|
3155
3180
|
[j]: q
|
|
3156
3181
|
}));
|
|
@@ -3171,17 +3196,17 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3171
3196
|
return q.forEach((pe) => ue.add(pe)), ue.add("folders"), Array.from(ue);
|
|
3172
3197
|
}) : Y((B) => B.includes("folders") ? B : [...B, "folders"]);
|
|
3173
3198
|
}, [e, v]);
|
|
3174
|
-
let
|
|
3199
|
+
let Te = (0, c.useCallback)(async () => {
|
|
3175
3200
|
await s(), e ? await re(e) : await re("folders");
|
|
3176
3201
|
}, [
|
|
3177
3202
|
s,
|
|
3178
3203
|
e,
|
|
3179
3204
|
re
|
|
3180
|
-
]),
|
|
3205
|
+
]), N = [
|
|
3181
3206
|
{
|
|
3182
3207
|
key: m.g,
|
|
3183
3208
|
label: D(f("My files"), m.g),
|
|
3184
|
-
icon: U((0, l.jsx)(
|
|
3209
|
+
icon: U((0, l.jsx)(be.a, {
|
|
3185
3210
|
size: 20,
|
|
3186
3211
|
strokeWidth: y?.iconStrokeWidth
|
|
3187
3212
|
}), m.g)
|
|
@@ -3231,7 +3256,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3231
3256
|
}), "ai"),
|
|
3232
3257
|
disabled: !y?.sseQuery
|
|
3233
3258
|
}
|
|
3234
|
-
].filter((j) => !j.disabled),
|
|
3259
|
+
].filter((j) => !j.disabled), ve = (0, c.useCallback)(async (j) => {
|
|
3235
3260
|
let q = j[0];
|
|
3236
3261
|
!q || q === "empty" || (u !== "my_files" && n("my_files"), r?.(q), await i?.(q === "folders" ? null : q));
|
|
3237
3262
|
}, [
|
|
@@ -3255,7 +3280,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3255
3280
|
folderId: B,
|
|
3256
3281
|
dataProviders: b,
|
|
3257
3282
|
folders: v,
|
|
3258
|
-
pathHistory:
|
|
3283
|
+
pathHistory: C,
|
|
3259
3284
|
t: f
|
|
3260
3285
|
});
|
|
3261
3286
|
w.error({
|
|
@@ -3276,7 +3301,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3276
3301
|
b,
|
|
3277
3302
|
i,
|
|
3278
3303
|
w,
|
|
3279
|
-
|
|
3304
|
+
C,
|
|
3280
3305
|
v,
|
|
3281
3306
|
f
|
|
3282
3307
|
]);
|
|
@@ -3288,11 +3313,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3288
3313
|
children: [(0, l.jsx)(g.Button, {
|
|
3289
3314
|
type: "primary",
|
|
3290
3315
|
size: "large",
|
|
3291
|
-
icon: (0, l.jsx)(
|
|
3316
|
+
icon: (0, l.jsx)(be.s, {
|
|
3292
3317
|
size: 24,
|
|
3293
3318
|
strokeWidth: y?.iconStrokeWidth
|
|
3294
3319
|
}),
|
|
3295
|
-
onClick:
|
|
3320
|
+
onClick: Te,
|
|
3296
3321
|
className: Je.uploadButton,
|
|
3297
3322
|
style: { whiteSpace: "nowrap" },
|
|
3298
3323
|
disabled: e === "Trash",
|
|
@@ -3315,7 +3340,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3315
3340
|
}),
|
|
3316
3341
|
(0, l.jsx)(g.Menu, {
|
|
3317
3342
|
className: "folder-menu",
|
|
3318
|
-
items:
|
|
3343
|
+
items: N,
|
|
3319
3344
|
defaultSelectedKeys: [m.g],
|
|
3320
3345
|
onSelect: ({ key: j }) => Be({ key: j }),
|
|
3321
3346
|
selectedKeys: [u]
|
|
@@ -3325,7 +3350,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3325
3350
|
className: Je.foldersContainer,
|
|
3326
3351
|
children: [(0, l.jsx)(se.ie, {
|
|
3327
3352
|
selectedFolder: e,
|
|
3328
|
-
onSelect:
|
|
3353
|
+
onSelect: ve,
|
|
3329
3354
|
onExpand: Ce,
|
|
3330
3355
|
generateMenuItems: t,
|
|
3331
3356
|
fetchChildFolders: i,
|
|
@@ -3353,7 +3378,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3353
3378
|
});
|
|
3354
3379
|
}));
|
|
3355
3380
|
Ar.displayName = "FolderSidebar";
|
|
3356
|
-
var
|
|
3381
|
+
var nl = c.default.lazy(async () => ({ default: (await Promise.resolve().then(() => ze("./2dd8b882.js"))).PixieEditor })), dl = {
|
|
3357
3382
|
position: "fixed",
|
|
3358
3383
|
inset: 0,
|
|
3359
3384
|
display: "flex",
|
|
@@ -3362,11 +3387,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3362
3387
|
zIndex: 1e3
|
|
3363
3388
|
}, Rr = (e) => e.visible ? (0, l.jsx)(c.Suspense, {
|
|
3364
3389
|
fallback: (0, l.jsx)("div", {
|
|
3365
|
-
style:
|
|
3390
|
+
style: dl,
|
|
3366
3391
|
children: (0, l.jsx)(g.Spin, { size: "large" })
|
|
3367
3392
|
}),
|
|
3368
|
-
children: (0, l.jsx)(
|
|
3369
|
-
}) : null,
|
|
3393
|
+
children: (0, l.jsx)(nl, { ...e })
|
|
3394
|
+
}) : null, _e = {
|
|
3370
3395
|
"em-filemanager": "em-filemanager",
|
|
3371
3396
|
emFilemanager: "em-filemanager",
|
|
3372
3397
|
uploadProgress: "uploadProgress",
|
|
@@ -3433,13 +3458,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3433
3458
|
"uploadProgress__file-list": "uploadProgress__file-list",
|
|
3434
3459
|
uploadProgressFileList: "uploadProgress__file-list",
|
|
3435
3460
|
slideInFromLeft: "slideInFromLeft"
|
|
3436
|
-
}, { Text: ct } = g.Typography,
|
|
3461
|
+
}, { Text: ct } = g.Typography, cl = ({ visible: e, files: t, totalFiles: r, completedFiles: a, onClose: i, onMinimize: s, onInsert: o, minimized: d = !1 }) => {
|
|
3437
3462
|
let { token: u } = g.theme.useToken(), { t: n } = m.Nn();
|
|
3438
3463
|
if (!e) return null;
|
|
3439
3464
|
let h = (y) => {
|
|
3440
3465
|
switch (y) {
|
|
3441
3466
|
case "success": return (0, l.jsx)("div", {
|
|
3442
|
-
className:
|
|
3467
|
+
className: _e["uploadProgress__status-icon"],
|
|
3443
3468
|
children: (0, l.jsx)(qe.CheckCircleOutlined, { style: { color: u.colorSuccess } })
|
|
3444
3469
|
});
|
|
3445
3470
|
case "error": return (0, l.jsx)(qe.ExclamationCircleOutlined, { style: { color: u.colorError } });
|
|
@@ -3447,8 +3472,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3447
3472
|
}
|
|
3448
3473
|
}, v = (y) => {
|
|
3449
3474
|
if (!y) return null;
|
|
3450
|
-
let
|
|
3451
|
-
return
|
|
3475
|
+
let C = y.toLowerCase();
|
|
3476
|
+
return C.includes("type") || C.includes("format") || C.includes("формат") || C.includes("тип") || C.includes("not allowed") || C.includes("дозволен") || C.includes("name") || C.includes("invalid") || C.includes("назва") || C.includes("неприпустим") || C.includes("allowed characters") ? null : C.includes("large") || C.includes("size") || C.includes("розмір") || C.includes("размер") ? n("upload_error_hint_size") : C.includes("exists") || C.includes("вже існує") || C.includes("уже существует") ? n("upload_error_hint_exists") : null;
|
|
3452
3477
|
}, f = (y) => y.status === "success" ? [(0, l.jsx)(g.Button, {
|
|
3453
3478
|
type: "primary",
|
|
3454
3479
|
size: "small",
|
|
@@ -3456,73 +3481,73 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3456
3481
|
children: n("Insert")
|
|
3457
3482
|
}, "insert")] : [];
|
|
3458
3483
|
if (d) return (0, l.jsx)("div", {
|
|
3459
|
-
className:
|
|
3484
|
+
className: _e.uploadProgress__minimized,
|
|
3460
3485
|
children: (0, l.jsx)(g.Button, {
|
|
3461
3486
|
type: "primary",
|
|
3462
3487
|
size: "small",
|
|
3463
3488
|
onClick: s,
|
|
3464
|
-
className:
|
|
3489
|
+
className: _e["uploadProgress__minimized-button"],
|
|
3465
3490
|
children: n("Upload progress", {
|
|
3466
3491
|
completed: a,
|
|
3467
3492
|
total: r
|
|
3468
3493
|
})
|
|
3469
3494
|
})
|
|
3470
3495
|
});
|
|
3471
|
-
let w = t.filter((y) => y.status === "uploading").length, I = t.filter((y) => y.status === "success").length,
|
|
3496
|
+
let w = t.filter((y) => y.status === "uploading").length, I = t.filter((y) => y.status === "success").length, _ = t.filter((y) => y.status === "error").length, F = t.filter((y) => y.status === "error"), V = F.length > 1 && F.every((y) => y.error && y.error === F[0]?.error), b = V ? F[0]?.error : null;
|
|
3472
3497
|
return (0, l.jsx)("div", {
|
|
3473
|
-
className:
|
|
3498
|
+
className: _e.uploadProgress + " fm-upload-progress",
|
|
3474
3499
|
children: (0, l.jsxs)("div", {
|
|
3475
|
-
className:
|
|
3500
|
+
className: _e.uploadProgress__card,
|
|
3476
3501
|
children: [(0, l.jsxs)("div", {
|
|
3477
|
-
className:
|
|
3502
|
+
className: _e.uploadProgress__header,
|
|
3478
3503
|
children: [(0, l.jsx)(ct, {
|
|
3479
3504
|
strong: !0,
|
|
3480
|
-
className:
|
|
3505
|
+
className: _e["uploadProgress__header-title"],
|
|
3481
3506
|
children: w > 0 ? n("Uploading files", {
|
|
3482
3507
|
completed: a,
|
|
3483
3508
|
total: r
|
|
3484
3509
|
}) : I > 0 ? n("Uploaded files", {
|
|
3485
3510
|
success: I,
|
|
3486
3511
|
total: r
|
|
3487
|
-
}) : n("Upload error files", { errorCount:
|
|
3512
|
+
}) : n("Upload error files", { errorCount: _ })
|
|
3488
3513
|
}), (0, l.jsx)("div", {
|
|
3489
|
-
className:
|
|
3514
|
+
className: _e["uploadProgress__header-buttons"],
|
|
3490
3515
|
children: (0, l.jsx)(g.Button, {
|
|
3491
3516
|
type: "text",
|
|
3492
3517
|
size: "small",
|
|
3493
|
-
icon: (0, l.jsx)(qe.CloseOutlined, { className:
|
|
3518
|
+
icon: (0, l.jsx)(qe.CloseOutlined, { className: _e["uploadProgress__close-icon"] }),
|
|
3494
3519
|
onClick: i,
|
|
3495
|
-
className:
|
|
3520
|
+
className: _e["uploadProgress__header-button"]
|
|
3496
3521
|
})
|
|
3497
3522
|
})]
|
|
3498
3523
|
}), (0, l.jsxs)("div", {
|
|
3499
|
-
className: `${
|
|
3524
|
+
className: `${_e.uploadProgress__body} ${t.some((y) => y.status === "error") ? _e["uploadProgress__body--error"] : ""}`,
|
|
3500
3525
|
children: [(0, l.jsx)("div", {
|
|
3501
|
-
className:
|
|
3526
|
+
className: _e["uploadProgress__list-wrapper"],
|
|
3502
3527
|
children: (0, l.jsx)(g.List, {
|
|
3503
|
-
className:
|
|
3528
|
+
className: _e["uploadProgress__file-list"],
|
|
3504
3529
|
size: "small",
|
|
3505
3530
|
dataSource: t,
|
|
3506
3531
|
renderItem: (y) => {
|
|
3507
|
-
let
|
|
3532
|
+
let C = y.status === "error", O = C ? v(y.error) : null;
|
|
3508
3533
|
return (0, l.jsx)(g.List.Item, {
|
|
3509
|
-
className: `${
|
|
3534
|
+
className: `${_e["uploadProgress__file-item"]} ${C ? _e["uploadProgress__file-item--error"] : ""}`,
|
|
3510
3535
|
actions: f(y),
|
|
3511
3536
|
children: (0, l.jsx)(g.List.Item.Meta, {
|
|
3512
3537
|
avatar: (0, l.jsx)(g.Avatar, {
|
|
3513
3538
|
size: "small",
|
|
3514
3539
|
icon: h(y.status),
|
|
3515
|
-
className:
|
|
3540
|
+
className: _e["uploadProgress__file-avatar"]
|
|
3516
3541
|
}),
|
|
3517
3542
|
title: (0, l.jsxs)("div", {
|
|
3518
|
-
className:
|
|
3543
|
+
className: _e["uploadProgress__file-info"],
|
|
3519
3544
|
children: [(0, l.jsx)(ct, {
|
|
3520
3545
|
ellipsis: !0,
|
|
3521
|
-
className:
|
|
3546
|
+
className: _e["uploadProgress__file-name"],
|
|
3522
3547
|
children: y.name
|
|
3523
3548
|
}), (0, l.jsx)(ct, {
|
|
3524
3549
|
type: "secondary",
|
|
3525
|
-
className:
|
|
3550
|
+
className: _e["uploadProgress__file-size"],
|
|
3526
3551
|
children: y.size === void 0 ? "" : m.Hn(y.size)
|
|
3527
3552
|
})]
|
|
3528
3553
|
}),
|
|
@@ -3531,16 +3556,16 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3531
3556
|
size: "small",
|
|
3532
3557
|
status: "active",
|
|
3533
3558
|
showInfo: !1,
|
|
3534
|
-
className:
|
|
3535
|
-
}) :
|
|
3536
|
-
className:
|
|
3559
|
+
className: _e["uploadProgress__progress-bar"]
|
|
3560
|
+
}) : C ? V ? null : (0, l.jsxs)("div", {
|
|
3561
|
+
className: _e["uploadProgress__error-item"],
|
|
3537
3562
|
children: [(0, l.jsx)(ct, {
|
|
3538
3563
|
type: "danger",
|
|
3539
|
-
className:
|
|
3564
|
+
className: _e["uploadProgress__error-message"],
|
|
3540
3565
|
children: y.error || n("Error")
|
|
3541
3566
|
}), O && (0, l.jsx)(ct, {
|
|
3542
3567
|
type: "secondary",
|
|
3543
|
-
className:
|
|
3568
|
+
className: _e["uploadProgress__error-hint"],
|
|
3544
3569
|
children: O
|
|
3545
3570
|
})]
|
|
3546
3571
|
}) : null
|
|
@@ -3549,9 +3574,9 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3549
3574
|
}
|
|
3550
3575
|
})
|
|
3551
3576
|
}), b && (0, l.jsxs)("div", {
|
|
3552
|
-
className:
|
|
3577
|
+
className: _e["uploadProgress__common-error"],
|
|
3553
3578
|
children: [(0, l.jsxs)("div", {
|
|
3554
|
-
className:
|
|
3579
|
+
className: _e["uploadProgress__common-error-row"],
|
|
3555
3580
|
children: [(0, l.jsx)(qe.ExclamationCircleOutlined, { style: {
|
|
3556
3581
|
color: u.colorError,
|
|
3557
3582
|
marginRight: 8,
|
|
@@ -3562,14 +3587,14 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3562
3587
|
})]
|
|
3563
3588
|
}), (0, l.jsx)(ct, {
|
|
3564
3589
|
type: "secondary",
|
|
3565
|
-
className:
|
|
3590
|
+
className: _e["uploadProgress__common-error-hint"],
|
|
3566
3591
|
children: n("Applies to all {{count}} files", { count: F.length })
|
|
3567
3592
|
})]
|
|
3568
3593
|
})]
|
|
3569
3594
|
})]
|
|
3570
3595
|
})
|
|
3571
3596
|
});
|
|
3572
|
-
}, { Header:
|
|
3597
|
+
}, { Header: ul } = g.Layout, { Title: hl } = g.Typography, ml = 200, fl = ({ activeLibraryItem: e, selectedFolder: t, isTrashFolder: r, onClearTrash: a, files: i, loading: s, onRefresh: o, refreshDisabled: d, showRefresh: u = !1 }) => {
|
|
3573
3598
|
let { t: n } = m.Nn(), h = e === "my_files" && (r ?? t === "Trash"), [v, f] = c.useState(!1), w = {
|
|
3574
3599
|
[m.g]: n("My files"),
|
|
3575
3600
|
gif: n("GIF"),
|
|
@@ -3579,22 +3604,22 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3579
3604
|
ai: n("AI image generation")
|
|
3580
3605
|
};
|
|
3581
3606
|
c.useEffect(() => {
|
|
3582
|
-
let
|
|
3607
|
+
let _ = setTimeout(() => {
|
|
3583
3608
|
f(h && i.length > 0 && !s);
|
|
3584
|
-
},
|
|
3585
|
-
return () => clearTimeout(
|
|
3609
|
+
}, ml);
|
|
3610
|
+
return () => clearTimeout(_);
|
|
3586
3611
|
}, [
|
|
3587
3612
|
h,
|
|
3588
3613
|
i.length,
|
|
3589
3614
|
s
|
|
3590
3615
|
]);
|
|
3591
3616
|
let I;
|
|
3592
|
-
return I = e === "my_files" ? h ? n("Trash") : t : w[e], (0, l.jsx)(
|
|
3617
|
+
return I = e === "my_files" ? h ? n("Trash") : t : w[e], (0, l.jsx)(ul, {
|
|
3593
3618
|
className: "actions-header",
|
|
3594
3619
|
children: (0, l.jsxs)("div", {
|
|
3595
3620
|
className: "header-title-container",
|
|
3596
3621
|
children: [
|
|
3597
|
-
(0, l.jsx)(
|
|
3622
|
+
(0, l.jsx)(hl, {
|
|
3598
3623
|
level: 5,
|
|
3599
3624
|
className: "header-title",
|
|
3600
3625
|
children: I
|
|
@@ -3666,11 +3691,11 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3666
3691
|
playButton: "playButton",
|
|
3667
3692
|
title: "title",
|
|
3668
3693
|
subtitle: "subtitle"
|
|
3669
|
-
}, Rt = 50,
|
|
3694
|
+
}, Rt = 50, pl = 6, Or = 240, gl = 320, yl = (e) => {
|
|
3670
3695
|
let t = typeof window < "u" ? window.innerWidth : e;
|
|
3671
3696
|
return t <= 700 ? 1 : t <= 1100 ? 2 : t <= 1600 ? 3 : 4;
|
|
3672
|
-
}, Dr = (e) => e.images.downsized.url,
|
|
3673
|
-
let { t: o } = m.Nn(), { GifPlayIcon: d } = se.K(), { options: u } = m.V(), { config: n } = u, h = m.ga({ maxConcurrent:
|
|
3697
|
+
}, Dr = (e) => e.images.downsized.url, vl = ({ setImageGifList: e, imageGifList: t = [], currentReqGif: r, setCurrentReqGif: a, inputRef: i, customRequest: s }) => {
|
|
3698
|
+
let { t: o } = m.Nn(), { GifPlayIcon: d } = se.K(), { options: u } = m.V(), { config: n } = u, h = m.ga({ maxConcurrent: pl }), [v, f] = (0, c.useState)(null), [w, I] = (0, c.useState)(new Set()), [_, F] = (0, c.useState)(!1), [V, b] = (0, c.useState)(!1), [y, C] = (0, c.useState)(!1), [O] = g.Form.useForm(), R = (0, c.useRef)(r), ne = (0, c.useRef)(null), k = (0, c.useRef)(null), U = (0, c.useRef)(null), D = (0, c.useRef)(0), Z = (0, c.useRef)(0), $ = (0, c.useRef)(new Set());
|
|
3674
3699
|
(0, c.useEffect)(() => {
|
|
3675
3700
|
R.current = r;
|
|
3676
3701
|
}, [r]), (0, c.useEffect)(() => {
|
|
@@ -3682,7 +3707,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3682
3707
|
let oe = `${m.O}/search?api_key=${n?.REACT_APP_GIPHY_KEY ?? "Nh77eBlPeMn1ed9MBAvL542NUGeNO26F"}&q=${encodeURIComponent(S)}&limit=${Rt}&offset=${x}&lang=en`;
|
|
3683
3708
|
return { data: await (await J(oe)).json() };
|
|
3684
3709
|
} catch {}
|
|
3685
|
-
}, { positionedItems: me, containerHeight: re, isNearEnd:
|
|
3710
|
+
}, { positionedItems: me, containerHeight: re, isNearEnd: Te, viewportMetrics: N, handleViewportChange: ve } = se.ge({
|
|
3686
3711
|
items: t,
|
|
3687
3712
|
getId: (K) => K.id,
|
|
3688
3713
|
getPreviewSrc: Dr,
|
|
@@ -3692,15 +3717,15 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3692
3717
|
layoutMode: "masonry",
|
|
3693
3718
|
minColumnWidth: 240,
|
|
3694
3719
|
estimatedItemHeight: 220,
|
|
3695
|
-
prefetchThresholdPx:
|
|
3696
|
-
resolveColumnCount:
|
|
3697
|
-
}), Be = m.Ra(
|
|
3720
|
+
prefetchThresholdPx: gl,
|
|
3721
|
+
resolveColumnCount: yl
|
|
3722
|
+
}), Be = m.Ra(ve, [t.length]), Ce = () => {
|
|
3698
3723
|
ne.current &&= (clearTimeout(ne.current), null);
|
|
3699
3724
|
}, j = (K) => $.current.has(K) ? !1 : ($.current.add(K), !0), q = (K) => {
|
|
3700
3725
|
$.current.delete(K);
|
|
3701
3726
|
}, B = (0, c.useCallback)(async () => {
|
|
3702
3727
|
let K = R.current.keywords?.trim();
|
|
3703
|
-
if (!K ||
|
|
3728
|
+
if (!K || _ || V || !y) return;
|
|
3704
3729
|
let x = `gif:${K}:${Z.current}`;
|
|
3705
3730
|
if (!j(x)) return;
|
|
3706
3731
|
let S = D.current;
|
|
@@ -3713,35 +3738,35 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3713
3738
|
if (S !== D.current) return;
|
|
3714
3739
|
let H = oe?.data?.data ?? [];
|
|
3715
3740
|
if (!Array.isArray(H) || H.length === 0) {
|
|
3716
|
-
|
|
3741
|
+
C(!1);
|
|
3717
3742
|
return;
|
|
3718
3743
|
}
|
|
3719
|
-
let
|
|
3744
|
+
let xe = H;
|
|
3720
3745
|
if (S !== D.current) return;
|
|
3721
3746
|
e((he) => {
|
|
3722
|
-
let L = new Set(he.map((X) => X.id)), ie =
|
|
3747
|
+
let L = new Set(he.map((X) => X.id)), ie = xe.filter((X) => !L.has(X.id));
|
|
3723
3748
|
return ie.length > 0 ? [...he, ...ie] : he;
|
|
3724
|
-
}), Z.current += H.length,
|
|
3749
|
+
}), Z.current += H.length, C(H.length === Rt);
|
|
3725
3750
|
} finally {
|
|
3726
3751
|
q(x), S === D.current && b(!1);
|
|
3727
3752
|
}
|
|
3728
3753
|
}, [
|
|
3729
3754
|
y,
|
|
3730
|
-
|
|
3755
|
+
_,
|
|
3731
3756
|
V,
|
|
3732
3757
|
e
|
|
3733
3758
|
]), ue = async () => {
|
|
3734
3759
|
Ce();
|
|
3735
3760
|
let K = R.current.keywords?.trim();
|
|
3736
3761
|
if (!K) {
|
|
3737
|
-
k.current = null, U.current = null, D.current += 1, Z.current = 0, e([]), I(new Set()),
|
|
3762
|
+
k.current = null, U.current = null, D.current += 1, Z.current = 0, e([]), I(new Set()), C(!1), b(!1);
|
|
3738
3763
|
return;
|
|
3739
3764
|
}
|
|
3740
|
-
if (U.current === K || k.current === K ||
|
|
3765
|
+
if (U.current === K || k.current === K || _ && k.current === K) return;
|
|
3741
3766
|
let x = `gif:${K}:0`;
|
|
3742
3767
|
if (!j(x)) return;
|
|
3743
3768
|
let S = D.current + 1;
|
|
3744
|
-
D.current = S, k.current = K, Z.current = 0, e([]), I(new Set()),
|
|
3769
|
+
D.current = S, k.current = K, Z.current = 0, e([]), I(new Set()), C(!1), b(!1), F(!0);
|
|
3745
3770
|
try {
|
|
3746
3771
|
let oe = await le({
|
|
3747
3772
|
query: R.current,
|
|
@@ -3750,13 +3775,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3750
3775
|
if (S !== D.current) return;
|
|
3751
3776
|
let H = oe?.data?.data;
|
|
3752
3777
|
if (Array.isArray(H) && H.length > 0) {
|
|
3753
|
-
let
|
|
3778
|
+
let xe = H;
|
|
3754
3779
|
if (S !== D.current) return;
|
|
3755
|
-
e(
|
|
3756
|
-
} else e([]),
|
|
3780
|
+
e(xe), Z.current = H.length, C(H.length === Rt);
|
|
3781
|
+
} else e([]), C(!1);
|
|
3757
3782
|
U.current = K;
|
|
3758
3783
|
} catch {
|
|
3759
|
-
|
|
3784
|
+
C(!1);
|
|
3760
3785
|
} finally {
|
|
3761
3786
|
q(x), k.current === K && (k.current = null), F(!1);
|
|
3762
3787
|
}
|
|
@@ -3770,13 +3795,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3770
3795
|
return (0, c.useEffect)(() => () => {
|
|
3771
3796
|
Ce();
|
|
3772
3797
|
}, []), (0, c.useEffect)(() => {
|
|
3773
|
-
!
|
|
3798
|
+
!_ && !V && y && t.length > 0 && Te && B();
|
|
3774
3799
|
}, [
|
|
3775
3800
|
y,
|
|
3776
3801
|
t.length,
|
|
3777
|
-
|
|
3802
|
+
Te,
|
|
3778
3803
|
B,
|
|
3779
|
-
|
|
3804
|
+
_,
|
|
3780
3805
|
V
|
|
3781
3806
|
]), (0, l.jsx)("div", {
|
|
3782
3807
|
className: Ue.gifTab,
|
|
@@ -3818,12 +3843,12 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3818
3843
|
}
|
|
3819
3844
|
})
|
|
3820
3845
|
})
|
|
3821
|
-
}), t.length > 0 && !
|
|
3846
|
+
}), t.length > 0 && !_ && (0, l.jsx)("div", {
|
|
3822
3847
|
className: `ant-divider ${Ue.divider}`,
|
|
3823
3848
|
role: "separator"
|
|
3824
3849
|
})]
|
|
3825
3850
|
}),
|
|
3826
|
-
!t.length && !
|
|
3851
|
+
!t.length && !_ && (0, l.jsx)(l.Fragment, { children: r.keywords ? (0, l.jsx)(se.J, {}) : (0, l.jsxs)("div", {
|
|
3827
3852
|
className: Ue.resultsContainer,
|
|
3828
3853
|
children: [
|
|
3829
3854
|
(0, l.jsx)("div", {
|
|
@@ -3840,12 +3865,12 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3840
3865
|
})
|
|
3841
3866
|
]
|
|
3842
3867
|
}) }),
|
|
3843
|
-
!t.length &&
|
|
3868
|
+
!t.length && _ && (0, l.jsx)(nt.r, {}),
|
|
3844
3869
|
t.length > 0 && (0, l.jsxs)(l.Fragment, { children: [(0, l.jsx)("div", {
|
|
3845
3870
|
className: Ue.virtualCanvas,
|
|
3846
3871
|
style: { height: re },
|
|
3847
3872
|
children: me.map(({ row: K, layout: x }) => {
|
|
3848
|
-
let S = K.item, oe = w.has(S.id), H = Dr(S),
|
|
3873
|
+
let S = K.item, oe = w.has(S.id), H = Dr(S), xe = x.bottom >= N.scrollTop - Or && x.top <= N.scrollTop + N.viewportHeight + Or;
|
|
3849
3874
|
return (0, l.jsxs)("div", {
|
|
3850
3875
|
className: `${Ue.listItem} ${oe ? Ue.loaded : ""}`,
|
|
3851
3876
|
onClick: () => pe(S.images.downsized.url, S.id, S.title),
|
|
@@ -3863,7 +3888,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3863
3888
|
(0, l.jsx)(Lr, {
|
|
3864
3889
|
imageId: S.id,
|
|
3865
3890
|
sourceUrl: H,
|
|
3866
|
-
shouldLoad:
|
|
3891
|
+
shouldLoad: xe,
|
|
3867
3892
|
loader: h,
|
|
3868
3893
|
className: v === S.id ? Ue.loadedImage : "",
|
|
3869
3894
|
width: "100%",
|
|
@@ -3929,22 +3954,22 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3929
3954
|
title: "title",
|
|
3930
3955
|
subtitle: "subtitle",
|
|
3931
3956
|
dark: "dark"
|
|
3932
|
-
},
|
|
3957
|
+
}, wl = "https://api.unsplash.com", Lt = 30, Il = 6, Br = 240, bl = 320, _l = 540, Cl = 1200, Fl = (e) => {
|
|
3933
3958
|
let t = typeof window < "u" ? window.innerWidth : e;
|
|
3934
3959
|
return t <= 650 ? 1 : t <= 1e3 ? 2 : t <= 1450 ? 3 : 4;
|
|
3935
3960
|
}, zr = (e, t) => {
|
|
3936
3961
|
let r = new URL(e);
|
|
3937
3962
|
return r.searchParams.set("w", t.toString()), r.toString();
|
|
3938
|
-
},
|
|
3939
|
-
let { t: o } = m.Nn(), { StockBigIcon: d, MixedViewIcon: u, LandscapeViewIcon: n, PortraitViewIcon: h, SquareViewIcon: v } = se.K(), { options: f } = m.V(), { config: w } = f, I = m.ga({ maxConcurrent:
|
|
3963
|
+
}, xl = ({ imageStockList: e, setImageStockList: t, currentReq: r, setCurrentReq: a, inputRef: i, customRequest: s }) => {
|
|
3964
|
+
let { t: o } = m.Nn(), { StockBigIcon: d, MixedViewIcon: u, LandscapeViewIcon: n, PortraitViewIcon: h, SquareViewIcon: v } = se.K(), { options: f } = m.V(), { config: w } = f, I = m.ga({ maxConcurrent: Il }), [_, F] = (0, c.useState)(!1), [V, b] = (0, c.useState)(!1), [y, C] = (0, c.useState)(!1), [O, R] = (0, c.useState)(null), [ne, k] = (0, c.useState)(new Set()), [U] = g.Form.useForm(), D = w?.fetchWithProxy, Z = w?.handleProxyUrl, $ = w?.UNSPLASH_KEY ?? "HX2_qqq3F3ljmtYtfmb9P6h0dn2u9mnnOl36IdV8el0", Y = w?.locale?.slice(0, 2) || "ru", A = (0, c.useRef)(r), W = (0, c.useRef)(null), J = (0, c.useRef)(null), le = (0, c.useRef)(0), me = (0, c.useRef)(1), re = (0, c.useRef)(new Set()), Te = async (L) => Z ? await Promise.resolve(Z(L)) ?? L : L, N = (0, c.useCallback)(async (L) => D ? Promise.resolve(D(L, void 0, { intent: "metadata" })) : fetch(await Te(L)), [D, Te]), ve = () => {
|
|
3940
3965
|
W.current &&= (clearTimeout(W.current), null);
|
|
3941
3966
|
}, Be = (L) => re.current.has(L) ? !1 : (re.current.add(L), !0), Ce = (L) => {
|
|
3942
3967
|
re.current.delete(L);
|
|
3943
3968
|
}, j = (L) => L.map((ie) => ({
|
|
3944
3969
|
...ie,
|
|
3945
3970
|
urls: {
|
|
3946
|
-
raw: zr(ie.urls.raw,
|
|
3947
|
-
small: zr(ie.urls.raw,
|
|
3971
|
+
raw: zr(ie.urls.raw, Cl),
|
|
3972
|
+
small: zr(ie.urls.raw, _l)
|
|
3948
3973
|
}
|
|
3949
3974
|
}));
|
|
3950
3975
|
(0, c.useEffect)(() => {
|
|
@@ -3964,13 +3989,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3964
3989
|
let q = async function(L) {
|
|
3965
3990
|
try {
|
|
3966
3991
|
let ie = `${L}${L.includes("?") ? "&" : "?"}client_id=${$}`;
|
|
3967
|
-
return { data: await (await
|
|
3992
|
+
return { data: await (await N(ie)).json() };
|
|
3968
3993
|
} catch {}
|
|
3969
3994
|
}, B = async function({ query: L, page: ie }) {
|
|
3970
3995
|
let X = L.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g, "").replace(/[\s_-]+/g, " ");
|
|
3971
3996
|
try {
|
|
3972
|
-
let ke = `${
|
|
3973
|
-
return L.color !== "" && (ke += `&color=${L.color}`), L.orientation !== "" && (ke += `&orientation=${L.orientation}`), { data: await (await
|
|
3997
|
+
let ke = `${wl}/search/photos?client_id=${$}&lang=${Y}&per_page=${Lt}&query=${encodeURIComponent(X)}&page=${ie}`;
|
|
3998
|
+
return L.color !== "" && (ke += `&color=${L.color}`), L.orientation !== "" && (ke += `&orientation=${L.orientation}`), { data: await (await N(ke)).json() };
|
|
3974
3999
|
} catch {}
|
|
3975
4000
|
}, { positionedItems: ue, containerHeight: pe, isNearEnd: K, viewportMetrics: x, handleViewportChange: S } = se.ge({
|
|
3976
4001
|
items: e,
|
|
@@ -3982,10 +4007,10 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3982
4007
|
layoutMode: "masonry",
|
|
3983
4008
|
minColumnWidth: 240,
|
|
3984
4009
|
estimatedItemHeight: 220,
|
|
3985
|
-
prefetchThresholdPx:
|
|
3986
|
-
resolveColumnCount:
|
|
4010
|
+
prefetchThresholdPx: bl,
|
|
4011
|
+
resolveColumnCount: Fl
|
|
3987
4012
|
}), oe = m.Ra(S, [e.length]), H = (0, c.useCallback)(async () => {
|
|
3988
|
-
if (
|
|
4013
|
+
if (_ || V || !y || !A.current.keywords.trim()) return;
|
|
3989
4014
|
let L = le.current, ie = me.current, X = `stock:${`${A.current.keywords.trim()}|${A.current.color}|${A.current.orientation}`}:${ie}`;
|
|
3990
4015
|
if (Be(X)) {
|
|
3991
4016
|
b(!0);
|
|
@@ -3997,26 +4022,26 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
3997
4022
|
if (L !== le.current) return;
|
|
3998
4023
|
let Oe = ke?.data?.results ?? [];
|
|
3999
4024
|
if (Oe.length === 0) {
|
|
4000
|
-
|
|
4025
|
+
C(!1);
|
|
4001
4026
|
return;
|
|
4002
4027
|
}
|
|
4003
4028
|
let Re = j(Oe);
|
|
4004
4029
|
if (L !== le.current) return;
|
|
4005
|
-
t((
|
|
4006
|
-
let it = new Set(
|
|
4007
|
-
return
|
|
4008
|
-
}), me.current = ie + 1,
|
|
4030
|
+
t((Fe) => {
|
|
4031
|
+
let it = new Set(Fe.map((Xe) => Xe.id)), we = Re.filter((Xe) => !it.has(Xe.id));
|
|
4032
|
+
return we.length > 0 ? [...Fe, ...we] : Fe;
|
|
4033
|
+
}), me.current = ie + 1, C(Oe.length === Lt);
|
|
4009
4034
|
} finally {
|
|
4010
4035
|
Ce(X), L === le.current && b(!1);
|
|
4011
4036
|
}
|
|
4012
4037
|
}
|
|
4013
4038
|
}, [
|
|
4014
4039
|
y,
|
|
4015
|
-
|
|
4040
|
+
_,
|
|
4016
4041
|
V,
|
|
4017
4042
|
t
|
|
4018
|
-
]),
|
|
4019
|
-
|
|
4043
|
+
]), xe = async () => {
|
|
4044
|
+
ve();
|
|
4020
4045
|
let L = `${A.current.keywords.trim()}|${A.current.color}|${A.current.orientation}`;
|
|
4021
4046
|
if (!A.current.keywords.trim()) {
|
|
4022
4047
|
J.current = null;
|
|
@@ -4026,7 +4051,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4026
4051
|
let ie = `stock:${L}:1`;
|
|
4027
4052
|
if (!Be(ie)) return;
|
|
4028
4053
|
let X = le.current + 1;
|
|
4029
|
-
le.current = X, F(!0), b(!1),
|
|
4054
|
+
le.current = X, F(!0), b(!1), C(!1), me.current = 1, t([]), k(new Set());
|
|
4030
4055
|
try {
|
|
4031
4056
|
let ke = await B({
|
|
4032
4057
|
query: A.current,
|
|
@@ -4037,29 +4062,29 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4037
4062
|
if (Oe.length > 0) {
|
|
4038
4063
|
let Re = j(Oe);
|
|
4039
4064
|
if (X !== le.current) return;
|
|
4040
|
-
t(Re), me.current = 2,
|
|
4041
|
-
} else
|
|
4065
|
+
t(Re), me.current = 2, C(Oe.length === Lt);
|
|
4066
|
+
} else C(!1);
|
|
4042
4067
|
J.current = L;
|
|
4043
4068
|
} finally {
|
|
4044
4069
|
Ce(ie), F(!1);
|
|
4045
4070
|
}
|
|
4046
4071
|
};
|
|
4047
4072
|
(0, c.useEffect)(() => () => {
|
|
4048
|
-
|
|
4073
|
+
ve();
|
|
4049
4074
|
}, []), (0, c.useEffect)(() => {
|
|
4050
|
-
!
|
|
4075
|
+
!_ && !V && y && e.length > 0 && K && H();
|
|
4051
4076
|
}, [
|
|
4052
4077
|
y,
|
|
4053
4078
|
e.length,
|
|
4054
4079
|
K,
|
|
4055
4080
|
H,
|
|
4056
|
-
|
|
4081
|
+
_,
|
|
4057
4082
|
V
|
|
4058
4083
|
]);
|
|
4059
4084
|
let he = async (L, ie, X, ke) => {
|
|
4060
4085
|
q(ie.download_location), R(X), setTimeout(() => R(null), 2e3);
|
|
4061
|
-
let Oe = L.raw, Re = Oe.split("?")[0].split("#")[0].split("/"),
|
|
4062
|
-
|
|
4086
|
+
let Oe = L.raw, Re = Oe.split("?")[0].split("#")[0].split("/"), Fe = Re[Re.length - 1] || "uploaded-file";
|
|
4087
|
+
Fe.includes(".") && Fe.split(".").pop()?.length && Fe.split(".").pop().length <= 5 || (Fe += ".jpg"), s(Oe, Fe);
|
|
4063
4088
|
};
|
|
4064
4089
|
return (0, l.jsx)("div", {
|
|
4065
4090
|
className: ge.stockTab,
|
|
@@ -4078,7 +4103,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4078
4103
|
...m.re,
|
|
4079
4104
|
...ie
|
|
4080
4105
|
};
|
|
4081
|
-
a(X), A.current = X,
|
|
4106
|
+
a(X), A.current = X, ve(), X.keywords === "" ? (J.current = null, le.current += 1, me.current = 1, t([]), k(new Set()), C(!1), b(!1), a({ ...m.re }), A.current = m.re, U.resetFields()) : W.current = setTimeout(xe, 800);
|
|
4082
4107
|
},
|
|
4083
4108
|
className: e.length > 0 ? ge.searchResults : ge.search,
|
|
4084
4109
|
children: [(0, l.jsxs)(g.Row, {
|
|
@@ -4252,12 +4277,12 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4252
4277
|
]
|
|
4253
4278
|
})
|
|
4254
4279
|
}) })] })]
|
|
4255
|
-
}), e.length > 0 && !
|
|
4280
|
+
}), e.length > 0 && !_ && (0, l.jsx)("div", {
|
|
4256
4281
|
className: `ant-divider ${ge.divider}`,
|
|
4257
4282
|
role: "separator"
|
|
4258
4283
|
})]
|
|
4259
4284
|
}),
|
|
4260
|
-
!e.length && !
|
|
4285
|
+
!e.length && !_ && (0, l.jsx)(l.Fragment, { children: r.keywords ? (0, l.jsx)(se.J, {}) : (0, l.jsxs)("div", {
|
|
4261
4286
|
className: ge.resultsContainer,
|
|
4262
4287
|
children: [
|
|
4263
4288
|
(0, l.jsx)("div", {
|
|
@@ -4274,7 +4299,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4274
4299
|
})
|
|
4275
4300
|
]
|
|
4276
4301
|
}) }),
|
|
4277
|
-
!e.length &&
|
|
4302
|
+
!e.length && _ && (0, l.jsx)(nt.r, {}),
|
|
4278
4303
|
e.length > 0 && (0, l.jsxs)(l.Fragment, { children: [(0, l.jsx)("div", {
|
|
4279
4304
|
className: ge.virtualCanvas,
|
|
4280
4305
|
style: { height: pe },
|
|
@@ -4307,8 +4332,8 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4307
4332
|
onLoad: () => {
|
|
4308
4333
|
k((Re) => {
|
|
4309
4334
|
if (Re.has(X.id)) return Re;
|
|
4310
|
-
let
|
|
4311
|
-
return
|
|
4335
|
+
let Fe = new Set(Re);
|
|
4336
|
+
return Fe.add(X.id), Fe;
|
|
4312
4337
|
});
|
|
4313
4338
|
}
|
|
4314
4339
|
}),
|
|
@@ -4344,7 +4369,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4344
4369
|
})
|
|
4345
4370
|
})
|
|
4346
4371
|
});
|
|
4347
|
-
},
|
|
4372
|
+
}, Pl = (e, t) => {
|
|
4348
4373
|
let r = () => {
|
|
4349
4374
|
try {
|
|
4350
4375
|
let a = {
|
|
@@ -4355,34 +4380,34 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4355
4380
|
} catch {}
|
|
4356
4381
|
};
|
|
4357
4382
|
t ? setTimeout(r, t) : r();
|
|
4358
|
-
},
|
|
4383
|
+
}, kl = () => {
|
|
4359
4384
|
let { options: e } = m.V(), t = e.config;
|
|
4360
4385
|
return (0, c.useCallback)((r, a) => {
|
|
4361
|
-
t?.pushToGTM !== !1 &&
|
|
4386
|
+
t?.pushToGTM !== !1 && Pl(r, a);
|
|
4362
4387
|
}, [t?.pushToGTM]);
|
|
4363
4388
|
};
|
|
4364
4389
|
function Ur(e) {
|
|
4365
4390
|
let t = e.trim();
|
|
4366
4391
|
return /^(https?:)?\/\//i.test(t) || /^data:/i.test(t);
|
|
4367
4392
|
}
|
|
4368
|
-
function
|
|
4393
|
+
function jl(e) {
|
|
4369
4394
|
let t = e.trim();
|
|
4370
4395
|
return Ur(t) ? t : `data:image/jpeg;base64, ${e}`;
|
|
4371
4396
|
}
|
|
4372
|
-
function
|
|
4373
|
-
let { t: h } = m.Nn(), { options: v } = m.V(), f = v.config, w = m.cr(), I =
|
|
4397
|
+
function Sl({ setFrameHeight: e, customRequest: t, aiTabRef: r, isImageUploaded: a, setIsImageUploaded: i, aiImageRequest: s, imageAiList: o, setImageAiList: d, isLoadingAi: u, setIsLoadingAi: n }) {
|
|
4398
|
+
let { t: h } = m.Nn(), { options: v } = m.V(), f = v.config, w = m.cr(), I = kl(), { messages: _ } = v.config, [F, V] = (0, c.useState)([]), [b, y] = (0, c.useState)(0), [C, O] = (0, c.useState)(null), [R, ne] = (0, c.useState)(!1), [k, U] = (0, c.useState)(h("Evaluating the task")), [D, Z] = (0, c.useState)(!1), $ = (0, c.useRef)(new Set()), Y = (0, c.useRef)(new Set()), A = (0, c.useRef)(new Set());
|
|
4374
4399
|
(0, c.useEffect)(() => {
|
|
4375
|
-
V(
|
|
4376
|
-
}, [
|
|
4377
|
-
!o.length && !
|
|
4378
|
-
}, [o,
|
|
4400
|
+
V(_);
|
|
4401
|
+
}, [_]), (0, c.useEffect)(() => {
|
|
4402
|
+
!o.length && !C && (V([]), $.current.clear(), Y.current.clear(), A.current.clear(), le.current = -1);
|
|
4403
|
+
}, [o, C]);
|
|
4379
4404
|
let W = (0, c.useMemo)(() => f && typeof f?.sendAIImageRequest == "function" ? f?.sendAIImageRequest : () => Promise.resolve({}), [f]), J = (0, c.useCallback)((x) => {
|
|
4380
|
-
let S = `${
|
|
4405
|
+
let S = `${C}-${x.progress}-${JSON.stringify(x.images || x.data)}`;
|
|
4381
4406
|
if (!A.current.has(S)) if (A.current.add(S), x.status !== "error" && x.status !== "Canceled") {
|
|
4382
4407
|
if (x.images) {
|
|
4383
4408
|
if (U(String(x.status)), x.progress === 100) {
|
|
4384
4409
|
n(!1), d(x.images);
|
|
4385
|
-
let oe =
|
|
4410
|
+
let oe = C, H = Array.isArray(x.images) ? x.images : [];
|
|
4386
4411
|
H.length > 0 && oe && !$.current.has(oe) && ($.current.add(oe), w.success({
|
|
4387
4412
|
id: "AI_IMAGE_GENERERATION_SUCCESS",
|
|
4388
4413
|
message: h("Images generated successfully"),
|
|
@@ -4396,7 +4421,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4396
4421
|
}
|
|
4397
4422
|
} else if (x.data && (d([String(x.data)]), x.progress === 100)) {
|
|
4398
4423
|
n(!1);
|
|
4399
|
-
let oe =
|
|
4424
|
+
let oe = C, H = x.data ? [String(x.data)] : [];
|
|
4400
4425
|
H.length > 0 && oe && !$.current.has(oe) && ($.current.add(oe), w.success({
|
|
4401
4426
|
id: "AI_IMAGE_GENERERATION_SUCCESS",
|
|
4402
4427
|
message: h("Images generated successfully"),
|
|
@@ -4408,13 +4433,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4408
4433
|
}
|
|
4409
4434
|
})), O(null), Z(!1);
|
|
4410
4435
|
}
|
|
4411
|
-
} else n(!1), Z(!1),
|
|
4436
|
+
} else n(!1), Z(!1), C && !Y.current.has(C) && (Y.current.add(C), w.error({
|
|
4412
4437
|
id: "AI_RESPONSE_INVALID",
|
|
4413
4438
|
message: h("Something went wrong, please try again"),
|
|
4414
4439
|
placement: "bottomRight",
|
|
4415
|
-
description: String(
|
|
4440
|
+
description: String(C) || void 0,
|
|
4416
4441
|
data: {
|
|
4417
|
-
requestId:
|
|
4442
|
+
requestId: C,
|
|
4418
4443
|
request: s,
|
|
4419
4444
|
response: x
|
|
4420
4445
|
},
|
|
@@ -4426,7 +4451,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4426
4451
|
U,
|
|
4427
4452
|
h,
|
|
4428
4453
|
n,
|
|
4429
|
-
|
|
4454
|
+
C,
|
|
4430
4455
|
w,
|
|
4431
4456
|
Z
|
|
4432
4457
|
]), le = (0, c.useRef)(-1);
|
|
@@ -4442,7 +4467,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4442
4467
|
return (S) => x(S);
|
|
4443
4468
|
}
|
|
4444
4469
|
return (x) => {};
|
|
4445
|
-
}, [f]), re = (0, c.useMemo)(() => f && typeof f?.handleLimitUsageEmitter == "object" ? f?.handleLimitUsageEmitter : { fire: () => {} }, [f]),
|
|
4470
|
+
}, [f]), re = (0, c.useMemo)(() => f && typeof f?.handleLimitUsageEmitter == "object" ? f?.handleLimitUsageEmitter : { fire: () => {} }, [f]), Te = f?.elementId, { projectId: N } = f, { limits: ve } = f?.limits ? f : { limits: { ai_img_limit: 0 } }, { ai_img_limit: Be } = ve, Ce = Be > 0 && b >= Be, j = !!(f?.limits && f.counters) && m.E.isPlugin, q = (0, c.useCallback)(() => {
|
|
4446
4471
|
re.fire({
|
|
4447
4472
|
name: "AiImgCount",
|
|
4448
4473
|
count: b + 1
|
|
@@ -4456,10 +4481,10 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4456
4481
|
U(h("Evaluating the task")), s !== "" && !u && (n(!0), Z(!0), d([]), V([]), I({
|
|
4457
4482
|
event: "submit_form",
|
|
4458
4483
|
action: "ai_image_generation",
|
|
4459
|
-
entity_id:
|
|
4460
|
-
project_id:
|
|
4484
|
+
entity_id: Te,
|
|
4485
|
+
project_id: N
|
|
4461
4486
|
}), W({ body: {
|
|
4462
|
-
project_id:
|
|
4487
|
+
project_id: N,
|
|
4463
4488
|
request: "create-image",
|
|
4464
4489
|
connection: "midjourney",
|
|
4465
4490
|
message: s
|
|
@@ -4468,13 +4493,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4468
4493
|
if (oe) throw oe;
|
|
4469
4494
|
let H = S;
|
|
4470
4495
|
if (H?.status === 401 || H?.data?.status === 401) throw Error("ERROR");
|
|
4471
|
-
let
|
|
4472
|
-
if (
|
|
4473
|
-
let ie =
|
|
4496
|
+
let xe = H?.data ?? H;
|
|
4497
|
+
if (xe?._eventResult && Array.isArray(xe.task?.images) && (xe.task.images?.length ?? 0) > 0) {
|
|
4498
|
+
let ie = xe.task.images;
|
|
4474
4499
|
d(ie), n(!1), Z(!1), O(null);
|
|
4475
4500
|
return;
|
|
4476
4501
|
}
|
|
4477
|
-
let he = H?.task || H?.data?.task, L = he?.id ??
|
|
4502
|
+
let he = H?.task || H?.data?.task, L = he?.id ?? C ?? void 0;
|
|
4478
4503
|
H?.status === 200 || H?.data?.status === 200 ? (he?.id && (U(he.message), O(he.id)), H?.message && w.success({
|
|
4479
4504
|
id: "AI_IMAGE_GENERATION_STARTED",
|
|
4480
4505
|
message: H.message,
|
|
@@ -4486,7 +4511,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4486
4511
|
}
|
|
4487
4512
|
}), me({
|
|
4488
4513
|
task_id: he?.id,
|
|
4489
|
-
entity_id:
|
|
4514
|
+
entity_id: Te
|
|
4490
4515
|
})) : (n(!1), Z(!1), L && !Y.current.has(L) && (Y.current.add(L), w.error({
|
|
4491
4516
|
id: "AI_IMAGE_GENERATION_FAILED",
|
|
4492
4517
|
message: H?.message || h("Something went wrong, please try again"),
|
|
@@ -4502,7 +4527,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4502
4527
|
}).catch((x) => {
|
|
4503
4528
|
n(!1), Z(!1);
|
|
4504
4529
|
let S = x;
|
|
4505
|
-
return (S?.error || S?.data) &&
|
|
4530
|
+
return (S?.error || S?.data) && C && !Y.current.has(C) && (Y.current.add(C), w?.error({
|
|
4506
4531
|
id: "AI_IMAGE_GENERATION_FAILED",
|
|
4507
4532
|
message: h("Something went wrong, please try again"),
|
|
4508
4533
|
placement: "bottomRight",
|
|
@@ -4510,7 +4535,7 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4510
4535
|
innerException: x,
|
|
4511
4536
|
data: {
|
|
4512
4537
|
request: s,
|
|
4513
|
-
taskId:
|
|
4538
|
+
taskId: C,
|
|
4514
4539
|
response: S?.data,
|
|
4515
4540
|
error: m.U(S?.error)
|
|
4516
4541
|
}
|
|
@@ -4523,13 +4548,13 @@ __emailmaker__.define("static/core/ec8d567d2.js", [
|
|
|
4523
4548
|
Z,
|
|
4524
4549
|
d,
|
|
4525
4550
|
I,
|
|
4526
|
-
|
|
4527
|
-
|
|
4551
|
+
Te,
|
|
4552
|
+
N,
|
|
4528
4553
|
W,
|
|
4529
4554
|
w,
|
|
4530
4555
|
me,
|
|
4531
4556
|
h,
|
|
4532
|
-
|
|
4557
|
+
C
|
|
4533
4558
|
]), pe = (0, c.useCallback)(() => {
|
|
4534
4559
|
B ? (j && (y((x) => x + 1), q()), ue()) : j && w.error({
|
|
4535
4560
|
id: "AI_IMAGE_GENERATION_LIMIT_EXCEEDED",
|
|
@@ -4556,9 +4581,9 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4556
4581
|
try {
|
|
4557
4582
|
if (Ur(x)) S = await (await fetch(x)).blob();
|
|
4558
4583
|
else {
|
|
4559
|
-
let H = atob(x),
|
|
4560
|
-
for (let he = 0; he < H.length; he++)
|
|
4561
|
-
S = new Blob([new Uint8Array(
|
|
4584
|
+
let H = atob(x), xe = Array(H.length);
|
|
4585
|
+
for (let he = 0; he < H.length; he++) xe[he] = H.charCodeAt(he);
|
|
4586
|
+
S = new Blob([new Uint8Array(xe)], { type: "image/jpeg" });
|
|
4562
4587
|
}
|
|
4563
4588
|
} catch {
|
|
4564
4589
|
return;
|
|
@@ -4612,7 +4637,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4612
4637
|
convertBase64ToFile: K,
|
|
4613
4638
|
isShiftPressed: R,
|
|
4614
4639
|
setIsShiftPressed: ne,
|
|
4615
|
-
currentReqId:
|
|
4640
|
+
currentReqId: C,
|
|
4616
4641
|
setCurrentReqId: O,
|
|
4617
4642
|
limitsInPlugin: j
|
|
4618
4643
|
};
|
|
@@ -4622,7 +4647,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4622
4647
|
emFilemanager: "em-filemanager",
|
|
4623
4648
|
slideshowContainer: "slideshowContainer",
|
|
4624
4649
|
slideshowImage: "slideshowImage"
|
|
4625
|
-
},
|
|
4650
|
+
}, El = ({ images: e, transitionDuration: t = 1e3, frameHeight: r }) => {
|
|
4626
4651
|
let [a, i] = (0, c.useState)([]), [s, o] = (0, c.useState)(r);
|
|
4627
4652
|
(0, c.useEffect)(() => {
|
|
4628
4653
|
let u = () => {
|
|
@@ -4656,7 +4681,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4656
4681
|
minHeight: 130
|
|
4657
4682
|
},
|
|
4658
4683
|
children: a.map((u, n) => (0, l.jsx)("img", {
|
|
4659
|
-
src:
|
|
4684
|
+
src: jl(u.src),
|
|
4660
4685
|
alt: `Slide ${n + 1}`,
|
|
4661
4686
|
className: Gr.slideshowImage,
|
|
4662
4687
|
style: {
|
|
@@ -4666,7 +4691,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4666
4691
|
}
|
|
4667
4692
|
}, n))
|
|
4668
4693
|
});
|
|
4669
|
-
},
|
|
4694
|
+
}, Nl = ({ className: e, style: t, color: r, text: a, variant: i, ...s }) => {
|
|
4670
4695
|
let o = a || "";
|
|
4671
4696
|
return (0, l.jsx)(g.Tag, {
|
|
4672
4697
|
style: t,
|
|
@@ -4676,12 +4701,12 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4676
4701
|
...s,
|
|
4677
4702
|
children: o
|
|
4678
4703
|
});
|
|
4679
|
-
},
|
|
4704
|
+
}, Tl = ({ text: e, counter: t, limits: r, wrapperStyles: a }) => {
|
|
4680
4705
|
let { t: i } = m.Nn(), { options: s } = m.V(), o = s.config, { token: d } = g.theme.useToken(), u = +r > 0, n = !u || t < +r, h = o?.billingPageUrl || "/billing";
|
|
4681
4706
|
return (0, l.jsxs)("div", {
|
|
4682
4707
|
className: "limits-couter-wrapper",
|
|
4683
4708
|
style: a,
|
|
4684
|
-
children: [(0, l.jsx)(
|
|
4709
|
+
children: [(0, l.jsx)(Nl, {
|
|
4685
4710
|
variant: "filled",
|
|
4686
4711
|
text: t + " " + i("of") + " " + (u ? r : "∞") + " " + (e || i("tests", { count: r })) + " " + i("was used", { count: t }),
|
|
4687
4712
|
className: "limit-counter",
|
|
@@ -4745,8 +4770,8 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4745
4770
|
})
|
|
4746
4771
|
}));
|
|
4747
4772
|
Wr.displayName = "SamplePrevArrow";
|
|
4748
|
-
var
|
|
4749
|
-
let { t: h } = m.Nn(), { AiIcon_2: v } = se.K(), f = c.default.useRef(null), [w, I] = (0, c.useState)("auto"), { aiImageCounter:
|
|
4773
|
+
var Ml = ({ customRequest: e, inputAiRef: t, isImageUploaded: r, setIsImageUploaded: a, aiImageRequest: i, setAiImageRequest: s, imageAiList: o, setImageAiList: d, isLoadingAi: u, setIsLoadingAi: n }) => {
|
|
4774
|
+
let { t: h } = m.Nn(), { AiIcon_2: v } = se.K(), f = c.default.useRef(null), [w, I] = (0, c.useState)("auto"), { aiImageCounter: _, currentAiImgLimits: F, loadingDuringGeneration: V, requestStatus: b, handleGenerate: y, convertBase64ToFile: C, isShiftPressed: O, setIsShiftPressed: R, limitsInPlugin: ne } = Sl({
|
|
4750
4775
|
setFrameHeight: I,
|
|
4751
4776
|
customRequest: e,
|
|
4752
4777
|
aiTabRef: f,
|
|
@@ -4772,9 +4797,9 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4772
4797
|
className: Le.imageAi,
|
|
4773
4798
|
ref: f,
|
|
4774
4799
|
children: [
|
|
4775
|
-
ne && (0, l.jsx)(
|
|
4800
|
+
ne && (0, l.jsx)(Tl, {
|
|
4776
4801
|
text: "images",
|
|
4777
|
-
counter:
|
|
4802
|
+
counter: _,
|
|
4778
4803
|
limits: F,
|
|
4779
4804
|
wrapperStyles: { marginTop: -25 }
|
|
4780
4805
|
}),
|
|
@@ -4839,13 +4864,13 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4839
4864
|
})
|
|
4840
4865
|
}), o.length > 0 && o.map((W, J) => (0, l.jsxs)("div", {
|
|
4841
4866
|
className: Le.imageItem,
|
|
4842
|
-
children: [(0, l.jsx)(
|
|
4867
|
+
children: [(0, l.jsx)(El, {
|
|
4843
4868
|
images: o,
|
|
4844
4869
|
frameHeight: w
|
|
4845
4870
|
}), (0, l.jsx)("div", {
|
|
4846
4871
|
className: "buttons",
|
|
4847
4872
|
children: o.length > 0 && !u && (0, l.jsx)(g.Button, {
|
|
4848
|
-
onClick: () =>
|
|
4873
|
+
onClick: () => C(W),
|
|
4849
4874
|
loading: r,
|
|
4850
4875
|
icon: (0, l.jsx)(qe.CheckOutlined, {}),
|
|
4851
4876
|
children: h("Use this variant")
|
|
@@ -4855,10 +4880,10 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4855
4880
|
})
|
|
4856
4881
|
]
|
|
4857
4882
|
});
|
|
4858
|
-
},
|
|
4859
|
-
let { state: t, actions: r, options: a } = m.V(), { t: i } = m.Nn(), s = m.cr(), { folders: o, folderToRename: d, renameFolderForm: u, isRenameFolderModalVisible: n } = t, { setFolderToRename: h, setIsRenameFolderModalVisible: v } = r, { apiEndpoints: f, dataProviders: w, config: I } = a,
|
|
4883
|
+
}, Al = (e) => {
|
|
4884
|
+
let { state: t, actions: r, options: a } = m.V(), { t: i } = m.Nn(), s = m.cr(), { folders: o, folderToRename: d, renameFolderForm: u, isRenameFolderModalVisible: n } = t, { setFolderToRename: h, setIsRenameFolderModalVisible: v } = r, { apiEndpoints: f, dataProviders: w, config: I } = a, _ = (0, c.useCallback)((b) => {
|
|
4860
4885
|
h?.(b), v?.(!0);
|
|
4861
|
-
let y = o?.find((
|
|
4886
|
+
let y = o?.find((C) => C.id === b);
|
|
4862
4887
|
y && u && u.setFieldsValue({ newFolderName: y.name });
|
|
4863
4888
|
}, [
|
|
4864
4889
|
h,
|
|
@@ -4953,14 +4978,14 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4953
4978
|
folderToRename: d
|
|
4954
4979
|
},
|
|
4955
4980
|
actions: {
|
|
4956
|
-
showRenameFolderModal:
|
|
4981
|
+
showRenameFolderModal: _,
|
|
4957
4982
|
handleRenameFolderCancel: F,
|
|
4958
4983
|
handleRenameFolderOk: V
|
|
4959
4984
|
}
|
|
4960
4985
|
};
|
|
4961
|
-
},
|
|
4986
|
+
}, Rl = () => {
|
|
4962
4987
|
let [e, t] = (0, c.useState)([]), [r, a] = (0, c.useState)(!1), [i, s] = (0, c.useState)(!1), o = (0, c.useRef)(0), d = (0, c.useRef)(new Map()), u = (0, c.useCallback)(() => (o.current += 1, `upload_${o.current}_${Date.now()}`), []), n = (0, c.useCallback)((b) => m.Hn(b.size), []), h = (0, c.useCallback)((b, y) => {
|
|
4963
|
-
let
|
|
4988
|
+
let C = y.map((O) => ({
|
|
4964
4989
|
id: u(),
|
|
4965
4990
|
folderId: b,
|
|
4966
4991
|
name: O.name,
|
|
@@ -4968,9 +4993,9 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4968
4993
|
status: "uploading",
|
|
4969
4994
|
progress: 0
|
|
4970
4995
|
}));
|
|
4971
|
-
return t(
|
|
4996
|
+
return t(C), a(!0), s(!1), C.map((O) => O.id);
|
|
4972
4997
|
}, [u, n]), v = (0, c.useCallback)((b, y) => {
|
|
4973
|
-
let
|
|
4998
|
+
let C = {
|
|
4974
4999
|
id: u(),
|
|
4975
5000
|
folderId: b,
|
|
4976
5001
|
name: y,
|
|
@@ -4978,14 +5003,14 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4978
5003
|
status: "uploading",
|
|
4979
5004
|
progress: 0
|
|
4980
5005
|
};
|
|
4981
|
-
return t((O) => [...O,
|
|
5006
|
+
return t((O) => [...O, C]), a(!0), s(!1), C.id;
|
|
4982
5007
|
}, [u]), f = (0, c.useCallback)((b, y) => {
|
|
4983
|
-
t((
|
|
5008
|
+
t((C) => C.map((O) => O.id === b ? {
|
|
4984
5009
|
...O,
|
|
4985
5010
|
progress: Math.min(100, Math.max(0, y))
|
|
4986
5011
|
} : O));
|
|
4987
5012
|
}, []), w = (0, c.useCallback)((b, y) => {
|
|
4988
|
-
y && d.current.set(b, y), t((
|
|
5013
|
+
y && d.current.set(b, y), t((C) => C.map((O) => {
|
|
4989
5014
|
if (O.id === b) {
|
|
4990
5015
|
let R = {
|
|
4991
5016
|
...O,
|
|
@@ -4997,12 +5022,12 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4997
5022
|
return O;
|
|
4998
5023
|
}));
|
|
4999
5024
|
}, []), I = (0, c.useCallback)((b, y) => {
|
|
5000
|
-
t((
|
|
5025
|
+
t((C) => C.map((O) => O.id === b ? {
|
|
5001
5026
|
...O,
|
|
5002
5027
|
status: "error",
|
|
5003
5028
|
error: y
|
|
5004
5029
|
} : O));
|
|
5005
|
-
}, []),
|
|
5030
|
+
}, []), _ = (0, c.useCallback)(() => {
|
|
5006
5031
|
a(!1), s(!1), setTimeout(() => {
|
|
5007
5032
|
t([]), d.current.clear();
|
|
5008
5033
|
}, 300);
|
|
@@ -5021,10 +5046,10 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5021
5046
|
markAsSuccess: w,
|
|
5022
5047
|
markAsError: I,
|
|
5023
5048
|
getUploadedFile: V,
|
|
5024
|
-
closeUpload:
|
|
5049
|
+
closeUpload: _,
|
|
5025
5050
|
minimizeUpload: F
|
|
5026
5051
|
};
|
|
5027
|
-
},
|
|
5052
|
+
}, Ll = (e = {}) => {
|
|
5028
5053
|
let t = document.querySelector("head");
|
|
5029
5054
|
if (!t) return;
|
|
5030
5055
|
let r = document.createElement("style");
|
|
@@ -5038,18 +5063,18 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5038
5063
|
let i = t.querySelector("[data-theme-variables-fm=\"true\"]");
|
|
5039
5064
|
i ? t.replaceChild(r, i) : t.insertBefore(r, t.firstChild);
|
|
5040
5065
|
}
|
|
5041
|
-
},
|
|
5042
|
-
e?.customTheme &&
|
|
5043
|
-
},
|
|
5066
|
+
}, Ol = (e) => {
|
|
5067
|
+
e?.customTheme && Ll(e?.customTheme);
|
|
5068
|
+
}, Dl = (e) => {
|
|
5044
5069
|
if (e === "system") {
|
|
5045
5070
|
let t = matchMedia("(prefers-color-scheme: dark)").matches ? m.C : m.S;
|
|
5046
5071
|
e = e === "system" ? t : e;
|
|
5047
5072
|
}
|
|
5048
5073
|
document.documentElement.setAttribute("data-theme", e);
|
|
5049
|
-
}, { Sider:
|
|
5050
|
-
let e = m.Ar(), t = m.ua(), r = m.da(), a = m.fa(), i =
|
|
5051
|
-
q.current =
|
|
5052
|
-
let B = c.default.useRef(null), ue = c.default.useRef([]), [pe, K] = (0, c.useState)(!1), [x, S] = (0, c.useState)(!1), oe = m.Yi((p) => p.selectedFiles), H = m.Yi((p) => p.clearSelection),
|
|
5074
|
+
}, { Sider: Bl, Content: zl } = g.Layout, Ul = c.default.lazy(() => Promise.resolve().then(() => ze("./a5a25e092.js"))), Gl = c.default.lazy(() => Promise.resolve().then(() => ze("./f5f707b8.js"))), $r = { keywords: "" }, Vl = () => {
|
|
5075
|
+
let e = m.Ar(), t = m.ua(), r = m.da(), a = m.fa(), i = Rl(), s = m.Bi(), { deleteItems: o } = m.Mr(), d = m.cr(), { t: u } = m.Nn(), { options: n, state: h, actions: v } = m.V(), f = n, w = f?.onChangeSelection, I = h, _ = f?.config, { dataProviders: F } = f, { form: V, urlForm: b, renameForm: y, moveForm: C, renameFolderForm: O, copyForm: R, isModalVisible: ne, isUrlModalVisible: k, isMoveModalVisible: U, isRenameFolderModalVisible: D, isCopyModalVisible: Z, isDeleteConfirmVisible: $, folderToRename: Y, activeLibraryItem: A } = h, { setIsUrlModalVisible: W, setActiveLibraryItem: J } = v, { config: le } = n, { DropZoneFileIcon: me } = se.K(), [re, Te] = (0, c.useState)(!1), [N, ve] = (0, c.useState)(!1), [Be, Ce] = (0, c.useState)(!1), j = (0, c.useRef)(0), q = (0, c.useRef)(!1);
|
|
5076
|
+
q.current = N;
|
|
5077
|
+
let B = c.default.useRef(null), ue = c.default.useRef([]), [pe, K] = (0, c.useState)(!1), [x, S] = (0, c.useState)(!1), oe = m.Yi((p) => p.selectedFiles), H = m.Yi((p) => p.clearSelection), xe = m.Yi((p) => p.syncVisibleFiles), { folders: he, loading: L } = e.state, { fetchFolders: ie, fetchChildFolders: X, handleCreateFolder: ke, handleModalOk: Oe, handleModalCancel: Re, generateMenuItems: Fe } = e.actions, it = Al(ie), { files: we, loading: Xe, isRenamingFile: ut, fileToRename: ae } = t.state, { fetchFiles: fe, handleDeleteFile: z, handleDeleteFolder: G, handleAddFile: de, handleAddFileByUrl: Se, showRenameModal: Me, handleRenameCancel: Ne, handleRenameOk: et, handleDroppedFiles: $e, showMoveModal: xt, handleMoveCancel: ws, handleMoveOk: ni, handleCopyOk: di, handleCopyCancel: Is, showDeleteConfirm: ci, handleDeleteConfirmCancel: bs, handleDeleteConfirmOk: ui } = t.actions, { selectedFolder: Pe, pathHistory: hi } = r.state, { handleFolderSelect: at, handleItemClick: mi } = r.actions, { pagination: ht } = a.state, fi = m.tr(fe), { searchTerm: Ut, sortBy: Gt, sortOrder: Vt } = fi.state, { handleSearch: Wt, handleSort: pi, handlePaginationChange: gi } = fi.actions, _s = (0, c.useCallback)(async () => {
|
|
5053
5078
|
let p = m.Dr(hi || []);
|
|
5054
5079
|
try {
|
|
5055
5080
|
await m.Or({
|
|
@@ -5059,7 +5084,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5059
5084
|
});
|
|
5060
5085
|
} catch {}
|
|
5061
5086
|
await ie(), await fe({
|
|
5062
|
-
folderId:
|
|
5087
|
+
folderId: Pe || "",
|
|
5063
5088
|
page: ht.current,
|
|
5064
5089
|
limit: ht.pageSize,
|
|
5065
5090
|
search: Ut,
|
|
@@ -5074,19 +5099,19 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5074
5099
|
ht,
|
|
5075
5100
|
hi,
|
|
5076
5101
|
Ut,
|
|
5077
|
-
|
|
5102
|
+
Pe,
|
|
5078
5103
|
Gt,
|
|
5079
5104
|
Vt
|
|
5080
5105
|
]), Ze = m.ma({
|
|
5081
|
-
files:
|
|
5106
|
+
files: we || [],
|
|
5082
5107
|
fetchFiles: fe,
|
|
5083
|
-
selectedFolder:
|
|
5084
|
-
}), [yi, lt] = (0, c.useState)(!1),
|
|
5108
|
+
selectedFolder: Pe || null
|
|
5109
|
+
}), [yi, lt] = (0, c.useState)(!1), Cs = (0, c.useCallback)((p) => {
|
|
5085
5110
|
if (p.preventDefault(), p.stopPropagation(), !p.dataTransfer || !p.dataTransfer.types || !p.dataTransfer.types.includes("Files")) return;
|
|
5086
5111
|
p.dataTransfer.dropEffect = "copy";
|
|
5087
5112
|
let P = p.relatedTarget, Q = p.currentTarget;
|
|
5088
|
-
P && Q.contains(P) || (j.current += 1, j.current > 0 &&
|
|
5089
|
-
}, []),
|
|
5113
|
+
P && Q.contains(P) || (j.current += 1, j.current > 0 && Te(!0));
|
|
5114
|
+
}, []), Fs = (0, c.useCallback)((p) => {
|
|
5090
5115
|
p.preventDefault(), p.stopPropagation();
|
|
5091
5116
|
let P = p.relatedTarget, Q = p.currentTarget;
|
|
5092
5117
|
if (!P || Q.contains(P)) {
|
|
@@ -5096,18 +5121,18 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5096
5121
|
}
|
|
5097
5122
|
return;
|
|
5098
5123
|
}
|
|
5099
|
-
j.current = Math.max(0, j.current - 1), j.current <= 0 &&
|
|
5100
|
-
}, []),
|
|
5124
|
+
j.current = Math.max(0, j.current - 1), j.current <= 0 && Te(!1);
|
|
5125
|
+
}, []), xs = (0, c.useCallback)((p) => {
|
|
5101
5126
|
p.preventDefault(), p.stopPropagation(), p.dataTransfer && (p.dataTransfer.dropEffect = "copy");
|
|
5102
|
-
}, []),
|
|
5103
|
-
p.preventDefault(), p.stopPropagation(),
|
|
5127
|
+
}, []), Ps = (0, c.useCallback)((p) => {
|
|
5128
|
+
p.preventDefault(), p.stopPropagation(), Te(!1), j.current = 0;
|
|
5104
5129
|
let P = (() => {
|
|
5105
5130
|
let Q = p.dataTransfer;
|
|
5106
5131
|
if (!Q) return [];
|
|
5107
5132
|
if (Q.files?.length) return Array.from(Q.files);
|
|
5108
5133
|
let ee = [];
|
|
5109
|
-
if (Q.items) for (let
|
|
5110
|
-
let M = Q.items[
|
|
5134
|
+
if (Q.items) for (let E = 0; E < Q.items.length; E++) {
|
|
5135
|
+
let M = Q.items[E].getAsFile();
|
|
5111
5136
|
M && ee.push(M);
|
|
5112
5137
|
}
|
|
5113
5138
|
return ee;
|
|
@@ -5118,20 +5143,20 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5118
5143
|
lt(!1);
|
|
5119
5144
|
}));
|
|
5120
5145
|
}, [$e]), st = (0, c.useCallback)(() => {
|
|
5121
|
-
|
|
5146
|
+
Te(!1), j.current = 0, document.body.removeAttribute("data-fm-dragging"), Ce(!1), ve(!1);
|
|
5122
5147
|
}, []);
|
|
5123
5148
|
c.default.useEffect(() => {
|
|
5124
|
-
ue.current =
|
|
5125
|
-
}, [
|
|
5149
|
+
ue.current = we || [];
|
|
5150
|
+
}, [we]);
|
|
5126
5151
|
let yt = I?.activeLibraryItem;
|
|
5127
5152
|
(0, c.useEffect)(() => {
|
|
5128
|
-
let p = (
|
|
5129
|
-
|
|
5130
|
-
}, P = !1, Q = (
|
|
5131
|
-
!P &&
|
|
5132
|
-
}, ee = (
|
|
5133
|
-
let M =
|
|
5134
|
-
(!M || !document.documentElement.contains(M)) && P && (P = !1, Ce(!1),
|
|
5153
|
+
let p = (E) => {
|
|
5154
|
+
E ? document.body.setAttribute("data-fm-dragging", "true") : document.body.removeAttribute("data-fm-dragging");
|
|
5155
|
+
}, P = !1, Q = (E) => {
|
|
5156
|
+
!P && E.dataTransfer?.types?.includes("Files") && (P = !0, Ce(!0), p(!0), yt === "my_files" && ve(!0));
|
|
5157
|
+
}, ee = (E) => {
|
|
5158
|
+
let M = E.relatedTarget;
|
|
5159
|
+
(!M || !document.documentElement.contains(M)) && P && (P = !1, Ce(!1), ve(!1), p(!1));
|
|
5135
5160
|
};
|
|
5136
5161
|
return window.addEventListener("dragenter", Q, !0), window.addEventListener("dragleave", ee, !0), () => {
|
|
5137
5162
|
window.removeEventListener("dragenter", Q, !0), window.removeEventListener("dragleave", ee, !0), document.body.removeAttribute("data-fm-dragging");
|
|
@@ -5142,8 +5167,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5142
5167
|
if (M.files?.length) return Array.from(M.files);
|
|
5143
5168
|
let te = [];
|
|
5144
5169
|
if (M.items) for (let ce = 0; ce < M.items.length; ce++) {
|
|
5145
|
-
let
|
|
5146
|
-
|
|
5170
|
+
let Ie = M.items[ce].getAsFile();
|
|
5171
|
+
Ie && te.push(Ie);
|
|
5147
5172
|
}
|
|
5148
5173
|
return te;
|
|
5149
5174
|
}, P = (M) => {
|
|
@@ -5151,20 +5176,20 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5151
5176
|
M.preventDefault();
|
|
5152
5177
|
let te = p(M.dataTransfer);
|
|
5153
5178
|
if (!te.length) return;
|
|
5154
|
-
let ce = M.target,
|
|
5155
|
-
(q.current || re ||
|
|
5179
|
+
let ce = M.target, Ie = ce.closest(`.${T.filesContainer.replace(/\s+/g, ".")}`) || ce.closest("[data-files-container]"), We = ce.closest(".em-filemanager") || ce.closest(".file-manager__layout") || ce.closest("[data-drop-overlay]") || ce.closest("[data-drag-capture]");
|
|
5180
|
+
(q.current || re || Ie || We) && (M.preventDefault(), M.stopPropagation(), ve(!1), Te(!1), j.current = 0, lt(!0), $e(te).catch((pt) => {
|
|
5156
5181
|
pt?.name;
|
|
5157
5182
|
}).finally(() => lt(!1)));
|
|
5158
5183
|
}, Q = (M) => {
|
|
5159
|
-
M.dataTransfer?.types?.includes("Files") && (M.preventDefault(), M.dataTransfer.dropEffect = "copy", document.body.hasAttribute("data-fm-dragging") || (document.body.setAttribute("data-fm-dragging", "true"), Ce(!0)), yt === "my_files" && !q.current &&
|
|
5184
|
+
M.dataTransfer?.types?.includes("Files") && (M.preventDefault(), M.dataTransfer.dropEffect = "copy", document.body.hasAttribute("data-fm-dragging") || (document.body.setAttribute("data-fm-dragging", "true"), Ce(!0)), yt === "my_files" && !q.current && ve(!0));
|
|
5160
5185
|
}, ee = (M) => {
|
|
5161
5186
|
M.dataTransfer?.types?.includes("Files") && (M.preventDefault(), M.dataTransfer.dropEffect = "copy", document.body.setAttribute("data-fm-dragging", "true"), Ce(!0));
|
|
5162
|
-
},
|
|
5187
|
+
}, E = {
|
|
5163
5188
|
capture: !0,
|
|
5164
5189
|
passive: !1
|
|
5165
5190
|
};
|
|
5166
|
-
return window.addEventListener("drop", P,
|
|
5167
|
-
window.removeEventListener("drop", P,
|
|
5191
|
+
return window.addEventListener("drop", P, E), window.addEventListener("dragover", Q, E), window.addEventListener("dragenter", ee, E), () => {
|
|
5192
|
+
window.removeEventListener("drop", P, E), window.removeEventListener("dragover", Q, E), window.removeEventListener("dragenter", ee, E);
|
|
5168
5193
|
};
|
|
5169
5194
|
}, [
|
|
5170
5195
|
re,
|
|
@@ -5172,7 +5197,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5172
5197
|
yt
|
|
5173
5198
|
]), (0, c.useEffect)(() => {
|
|
5174
5199
|
let p = (P) => {
|
|
5175
|
-
re && st(),
|
|
5200
|
+
re && st(), ve(!1), Ce(!1), document.body.removeAttribute("data-fm-dragging");
|
|
5176
5201
|
};
|
|
5177
5202
|
return window.addEventListener("dragend", p, !0), () => window.removeEventListener("dragend", p, !0);
|
|
5178
5203
|
}, [re, st]), (0, c.useEffect)(() => {
|
|
@@ -5201,19 +5226,19 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5201
5226
|
document.removeEventListener("click", p, !0);
|
|
5202
5227
|
};
|
|
5203
5228
|
}, [re, st]);
|
|
5204
|
-
let
|
|
5205
|
-
await ui(), await ie(),
|
|
5229
|
+
let ks = c.default.useCallback(async () => {
|
|
5230
|
+
await ui(), await ie(), Pe === "Trash" && X && await X("Trash"), requestAnimationFrame(() => {
|
|
5206
5231
|
requestAnimationFrame(() => B.current?.refreshFileCounts?.());
|
|
5207
5232
|
});
|
|
5208
5233
|
}, [
|
|
5209
5234
|
ie,
|
|
5210
5235
|
X,
|
|
5211
5236
|
ui,
|
|
5212
|
-
|
|
5213
|
-
]),
|
|
5237
|
+
Pe
|
|
5238
|
+
]), js = c.default.useCallback(() => {
|
|
5214
5239
|
S(!0);
|
|
5215
|
-
}, []),
|
|
5216
|
-
if (
|
|
5240
|
+
}, []), Ss = c.default.useCallback(async () => {
|
|
5241
|
+
if (Pe !== "Trash") {
|
|
5217
5242
|
S(!1);
|
|
5218
5243
|
return;
|
|
5219
5244
|
}
|
|
@@ -5246,8 +5271,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5246
5271
|
showNotifications: !1
|
|
5247
5272
|
});
|
|
5248
5273
|
await fe({ folderId: m.x }), await B.current?.refreshFileCounts();
|
|
5249
|
-
let { successCount: ee, failCount:
|
|
5250
|
-
|
|
5274
|
+
let { successCount: ee, failCount: E } = Q;
|
|
5275
|
+
E === 0 ? d.success({
|
|
5251
5276
|
id: "TRASH_CLEARED_SUCCESS",
|
|
5252
5277
|
message: u("Trash cleared successfully"),
|
|
5253
5278
|
description: u("{{count}} items permanently deleted", { count: ee }),
|
|
@@ -5257,7 +5282,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5257
5282
|
message: u("Trash partially cleared"),
|
|
5258
5283
|
description: u("{{succeeded}} items deleted, {{failed}} items failed", {
|
|
5259
5284
|
succeeded: ee,
|
|
5260
|
-
failed:
|
|
5285
|
+
failed: E
|
|
5261
5286
|
}),
|
|
5262
5287
|
placement: "bottomRight"
|
|
5263
5288
|
}) : d.error({
|
|
@@ -5275,71 +5300,71 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5275
5300
|
}), S(!1);
|
|
5276
5301
|
}
|
|
5277
5302
|
}, [
|
|
5278
|
-
|
|
5303
|
+
Pe,
|
|
5279
5304
|
F,
|
|
5280
5305
|
fe,
|
|
5281
5306
|
d,
|
|
5282
5307
|
u,
|
|
5283
5308
|
o
|
|
5284
|
-
]),
|
|
5309
|
+
]), Es = c.default.useCallback(() => {
|
|
5285
5310
|
S(!1);
|
|
5286
|
-
}, []),
|
|
5311
|
+
}, []), Ns = c.default.useCallback(async (p) => {
|
|
5287
5312
|
await ni(p), await B.current?.refreshFileCounts();
|
|
5288
|
-
}, [ni]),
|
|
5313
|
+
}, [ni]), Ts = c.default.useCallback(async (p) => {
|
|
5289
5314
|
await di(p), await B.current?.refreshFileCounts();
|
|
5290
5315
|
}, [di]), vi = c.default.useCallback(async () => {
|
|
5291
5316
|
let p = [], P = new Map(), Q = f?.config;
|
|
5292
5317
|
await de({
|
|
5293
5318
|
onStartBatch: (ee) => {
|
|
5294
|
-
p = i.startUpload(
|
|
5319
|
+
p = i.startUpload(Pe || void 0, ee), P = new Map(), ee.forEach((E, M) => {
|
|
5295
5320
|
let te = p[M];
|
|
5296
|
-
te && (P.set(
|
|
5321
|
+
te && (P.set(E.name, te), P.set(m.Ee(E.name, Q), te));
|
|
5297
5322
|
});
|
|
5298
5323
|
},
|
|
5299
5324
|
onStart: (ee) => {
|
|
5300
5325
|
if (p.length === 0) {
|
|
5301
|
-
p = i.startUpload(
|
|
5302
|
-
let
|
|
5303
|
-
|
|
5326
|
+
p = i.startUpload(Pe || void 0, [ee]);
|
|
5327
|
+
let E = p[0];
|
|
5328
|
+
E && (P.set(ee.name, E), P.set(m.Ee(ee.name, Q), E));
|
|
5304
5329
|
}
|
|
5305
5330
|
},
|
|
5306
|
-
onProgress: (ee,
|
|
5331
|
+
onProgress: (ee, E) => {
|
|
5307
5332
|
let M = P.get(ee);
|
|
5308
|
-
M && i.updateProgress(M,
|
|
5333
|
+
M && i.updateProgress(M, E);
|
|
5309
5334
|
},
|
|
5310
5335
|
onComplete: async (ee) => {
|
|
5311
|
-
let
|
|
5312
|
-
if (
|
|
5336
|
+
let E = P.get(ee);
|
|
5337
|
+
if (E) {
|
|
5313
5338
|
await new Promise((te) => setTimeout(te, 100));
|
|
5314
|
-
let M =
|
|
5315
|
-
i.markAsSuccess(
|
|
5339
|
+
let M = we?.find((te) => te.name === ee && !te.isFolder);
|
|
5340
|
+
i.markAsSuccess(E, M);
|
|
5316
5341
|
}
|
|
5317
5342
|
await B.current?.refreshFileCounts();
|
|
5318
5343
|
},
|
|
5319
|
-
onError: (ee,
|
|
5344
|
+
onError: (ee, E, M) => {
|
|
5320
5345
|
let te = P.get(ee) ?? (M != null && M < p.length ? p[M] : void 0);
|
|
5321
|
-
te && i.markAsError(te,
|
|
5346
|
+
te && i.markAsError(te, E);
|
|
5322
5347
|
},
|
|
5323
5348
|
onBatchComplete: async (ee) => {
|
|
5324
|
-
for (let
|
|
5325
|
-
let M = ee.successes[
|
|
5349
|
+
for (let E = 0; E < ee.successes.length; E++) {
|
|
5350
|
+
let M = ee.successes[E], te = ee.uploadedFiles?.get(M), ce = P.get(M) ?? (te?.originalFileName ? P.get(te.originalFileName) : void 0) ?? (te?.originalIndex != null && te.originalIndex < p.length ? p[te.originalIndex] : void 0) ?? (E < p.length ? p[E] : void 0);
|
|
5326
5351
|
if (ce) {
|
|
5327
|
-
let
|
|
5352
|
+
let Ie;
|
|
5328
5353
|
if (te?.id) {
|
|
5329
5354
|
let We = te;
|
|
5330
|
-
|
|
5355
|
+
Ie = {
|
|
5331
5356
|
id: We.id,
|
|
5332
5357
|
name: We.name ?? M,
|
|
5333
|
-
folderId: We.folderId ??
|
|
5358
|
+
folderId: We.folderId ?? Pe ?? null,
|
|
5334
5359
|
isFolder: !1,
|
|
5335
5360
|
size: We.size
|
|
5336
5361
|
};
|
|
5337
|
-
} else await new Promise((We) => setTimeout(We, 100)),
|
|
5338
|
-
i.updateProgress(ce, 100), i.markAsSuccess(ce,
|
|
5362
|
+
} else await new Promise((We) => setTimeout(We, 100)), Ie = we?.find((We) => We.name === M && !We.isFolder);
|
|
5363
|
+
i.updateProgress(ce, 100), i.markAsSuccess(ce, Ie);
|
|
5339
5364
|
}
|
|
5340
5365
|
}
|
|
5341
|
-
ee.errors.forEach(({ fileName:
|
|
5342
|
-
let te = P.get(
|
|
5366
|
+
ee.errors.forEach(({ fileName: E, error: M }) => {
|
|
5367
|
+
let te = P.get(E);
|
|
5343
5368
|
te && i.markAsError(te, M);
|
|
5344
5369
|
}), await B.current?.refreshFileCounts();
|
|
5345
5370
|
}
|
|
@@ -5347,20 +5372,20 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5347
5372
|
}, [
|
|
5348
5373
|
de,
|
|
5349
5374
|
i,
|
|
5350
|
-
|
|
5351
|
-
|
|
5375
|
+
we,
|
|
5376
|
+
Pe,
|
|
5352
5377
|
f?.config
|
|
5353
5378
|
]), ot = c.default.useCallback(async (p, P, Q, ee) => {
|
|
5354
5379
|
try {
|
|
5355
5380
|
K(!0);
|
|
5356
|
-
let
|
|
5357
|
-
!Q && p && (
|
|
5358
|
-
let M = i.startUploadByUrl(
|
|
5381
|
+
let E = Q || "uploaded-file";
|
|
5382
|
+
!Q && p && (E = m.Ti(p) || "uploaded-file", E.includes(".") && E.split(".").pop()?.length && E.split(".").pop().length <= 5 || (E += ".jpg"));
|
|
5383
|
+
let M = i.startUploadByUrl(Pe || void 0, E);
|
|
5359
5384
|
try {
|
|
5360
5385
|
let te = await Se(p, P, !0, ee ?? "uploadByUrl");
|
|
5361
5386
|
if (i.updateProgress(M, 100), te) {
|
|
5362
|
-
await new Promise((
|
|
5363
|
-
let ce =
|
|
5387
|
+
await new Promise((Ie) => setTimeout(Ie, 100));
|
|
5388
|
+
let ce = we?.find((Ie) => Ie.id === te.id && !Ie.isFolder) || te;
|
|
5364
5389
|
i.markAsSuccess(M, ce);
|
|
5365
5390
|
} else i.markAsSuccess(M);
|
|
5366
5391
|
await B.current?.refreshFileCounts();
|
|
@@ -5374,41 +5399,41 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5374
5399
|
}, [
|
|
5375
5400
|
Se,
|
|
5376
5401
|
i,
|
|
5377
|
-
|
|
5378
|
-
|
|
5402
|
+
Pe,
|
|
5403
|
+
we,
|
|
5379
5404
|
u
|
|
5380
5405
|
]), wi = c.default.useCallback(async ({ file: p }) => {
|
|
5381
|
-
let P = i.startUpload(
|
|
5406
|
+
let P = i.startUpload(Pe || void 0, [p])[0], Q = 0, ee = setInterval(() => {
|
|
5382
5407
|
Q = Math.min(Q + 10 + Math.floor(Date.now() % 10), 90), i.updateProgress(P, Q);
|
|
5383
5408
|
}, 200);
|
|
5384
5409
|
try {
|
|
5385
|
-
let
|
|
5386
|
-
if (clearInterval(ee), i.updateProgress(P, 100),
|
|
5410
|
+
let E = await s.uploadFileWithProvider(p, void 0, !0);
|
|
5411
|
+
if (clearInterval(ee), i.updateProgress(P, 100), E) {
|
|
5387
5412
|
await new Promise((ce) => setTimeout(ce, 100));
|
|
5388
|
-
let te =
|
|
5413
|
+
let te = we?.find((ce) => ce.id === E.id && !ce.isFolder) || E;
|
|
5389
5414
|
i.markAsSuccess(P, te);
|
|
5390
5415
|
} else i.markAsSuccess(P);
|
|
5391
|
-
let M =
|
|
5392
|
-
return at && at(!M || M === "folders" ? "folders" : M), await B.current?.refreshFileCounts(),
|
|
5393
|
-
} catch (
|
|
5416
|
+
let M = E && E.folderId || Pe || null;
|
|
5417
|
+
return at && at(!M || M === "folders" ? "folders" : M), await B.current?.refreshFileCounts(), E;
|
|
5418
|
+
} catch (E) {
|
|
5394
5419
|
clearInterval(ee);
|
|
5395
|
-
let M =
|
|
5396
|
-
throw i.markAsError(P, M),
|
|
5420
|
+
let M = E instanceof Error ? E.message : String(E);
|
|
5421
|
+
throw i.markAsError(P, M), E;
|
|
5397
5422
|
}
|
|
5398
5423
|
}, [
|
|
5399
5424
|
s,
|
|
5400
5425
|
i,
|
|
5401
|
-
|
|
5402
|
-
|
|
5426
|
+
Pe,
|
|
5427
|
+
we,
|
|
5403
5428
|
at
|
|
5404
5429
|
]), Ii = c.default.useCallback(async (p) => {
|
|
5405
5430
|
if ($e) {
|
|
5406
|
-
let P = i.startUpload(
|
|
5431
|
+
let P = i.startUpload(Pe || void 0, p);
|
|
5407
5432
|
p.forEach(async (Q, ee) => {
|
|
5408
|
-
let
|
|
5409
|
-
if (!
|
|
5433
|
+
let E = P[ee];
|
|
5434
|
+
if (!E) return;
|
|
5410
5435
|
let M = 0, te = setInterval(() => {
|
|
5411
|
-
M = Math.min(M + 10 + Math.floor(Date.now() % 10), 85), i.updateProgress(
|
|
5436
|
+
M = Math.min(M + 10 + Math.floor(Date.now() % 10), 85), i.updateProgress(E, M);
|
|
5412
5437
|
}, 200);
|
|
5413
5438
|
setTimeout(() => {
|
|
5414
5439
|
clearInterval(te);
|
|
@@ -5420,32 +5445,32 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5420
5445
|
}, [
|
|
5421
5446
|
$e,
|
|
5422
5447
|
i,
|
|
5423
|
-
|
|
5448
|
+
Pe
|
|
5424
5449
|
]), bi = c.default.useCallback(async (p) => {
|
|
5425
5450
|
await G(p), await ie(), await B.current?.refreshFileCounts();
|
|
5426
5451
|
}, [G, ie]), vt = m.pa({
|
|
5427
|
-
files:
|
|
5452
|
+
files: we || [],
|
|
5428
5453
|
clearSelection: H,
|
|
5429
|
-
showRenameModal:
|
|
5454
|
+
showRenameModal: Me,
|
|
5430
5455
|
showMoveModal: xt,
|
|
5431
5456
|
showCopyModal: t.actions.showCopyModal || (() => {}),
|
|
5432
5457
|
handleDeleteFile: z,
|
|
5433
5458
|
handleDeleteFolder: bi,
|
|
5434
5459
|
showDeleteConfirm: ci,
|
|
5435
5460
|
onEdit: Ze.handleEdit
|
|
5436
|
-
}),
|
|
5461
|
+
}), _i = L || Xe || yi;
|
|
5437
5462
|
(0, c.useEffect)(() => {
|
|
5438
|
-
|
|
5463
|
+
Da();
|
|
5439
5464
|
}, []), (0, c.useLayoutEffect)(() => {
|
|
5440
5465
|
if (A === "my_files") {
|
|
5441
|
-
|
|
5466
|
+
xe(we || []);
|
|
5442
5467
|
return;
|
|
5443
5468
|
}
|
|
5444
5469
|
H();
|
|
5445
5470
|
}, [
|
|
5446
5471
|
A,
|
|
5447
|
-
|
|
5448
|
-
|
|
5472
|
+
we,
|
|
5473
|
+
xe,
|
|
5449
5474
|
H
|
|
5450
5475
|
]), (0, c.useEffect)(() => {
|
|
5451
5476
|
if (!w || A !== "my_files") return;
|
|
@@ -5453,16 +5478,16 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5453
5478
|
Li.current = !0;
|
|
5454
5479
|
return;
|
|
5455
5480
|
}
|
|
5456
|
-
let p = (Array.isArray(
|
|
5481
|
+
let p = (Array.isArray(we) ? we : []).filter((P) => oe.has(P.id));
|
|
5457
5482
|
w(p);
|
|
5458
5483
|
}, [
|
|
5459
5484
|
A,
|
|
5460
|
-
|
|
5485
|
+
we,
|
|
5461
5486
|
oe,
|
|
5462
5487
|
w
|
|
5463
5488
|
]), c.default.useEffect(() => {
|
|
5464
5489
|
if (!at || he.length === 0) return;
|
|
5465
|
-
let p =
|
|
5490
|
+
let p = _?.rememberLastFolder !== !1, P = `em_fm:lastFolder:${_?.projectId || "default"}`;
|
|
5466
5491
|
if (p && typeof window < "u") try {
|
|
5467
5492
|
let Q = localStorage.getItem(P);
|
|
5468
5493
|
if (Q && he.some((ee) => ee.id === Q)) {
|
|
@@ -5470,15 +5495,15 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5470
5495
|
return;
|
|
5471
5496
|
}
|
|
5472
5497
|
} catch {}
|
|
5473
|
-
|
|
5498
|
+
Pe || at("folders");
|
|
5474
5499
|
}, [
|
|
5475
|
-
|
|
5500
|
+
Pe,
|
|
5476
5501
|
at,
|
|
5477
5502
|
he,
|
|
5478
|
-
|
|
5479
|
-
|
|
5503
|
+
_?.rememberLastFolder,
|
|
5504
|
+
_?.projectId
|
|
5480
5505
|
]);
|
|
5481
|
-
let { handleRenameFolderCancel:
|
|
5506
|
+
let { handleRenameFolderCancel: Ms, handleRenameFolderOk: Ci } = it.actions;
|
|
5482
5507
|
(0, c.useEffect)(() => {
|
|
5483
5508
|
let p = async (P) => {
|
|
5484
5509
|
if (A !== "my_files") return;
|
|
@@ -5486,18 +5511,18 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5486
5511
|
if (Q instanceof HTMLInputElement || Q instanceof HTMLTextAreaElement || Q?.getAttribute("contenteditable") === "true") return;
|
|
5487
5512
|
let ee = P.clipboardData;
|
|
5488
5513
|
if (!ee) return;
|
|
5489
|
-
let
|
|
5514
|
+
let E = Array.from(ee.items), M = E.filter((ce) => ce.type.startsWith("image/"));
|
|
5490
5515
|
if (M.length > 0) {
|
|
5491
|
-
let ce = M.map((
|
|
5516
|
+
let ce = M.map((Ie) => Ie.getAsFile()).filter((Ie) => Ie !== null);
|
|
5492
5517
|
ce.length > 0 && (P.preventDefault(), await Ii(ce));
|
|
5493
5518
|
return;
|
|
5494
5519
|
}
|
|
5495
|
-
let te =
|
|
5520
|
+
let te = E.find((ce) => ce.type === "text/plain");
|
|
5496
5521
|
te && te.getAsString(async (ce) => {
|
|
5497
|
-
let
|
|
5498
|
-
if (
|
|
5499
|
-
else if (
|
|
5500
|
-
let We =
|
|
5522
|
+
let Ie = ce.trim();
|
|
5523
|
+
if (Ie.startsWith("http://") || Ie.startsWith("https://")) P.preventDefault(), await ot(Ie);
|
|
5524
|
+
else if (Ie.includes("<meta") || Ie.includes("http")) {
|
|
5525
|
+
let We = Ie.match(/https?:\/\/[^\s"']+/);
|
|
5501
5526
|
We && (P.preventDefault(), await ot(We[0]));
|
|
5502
5527
|
}
|
|
5503
5528
|
});
|
|
@@ -5514,14 +5539,14 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5514
5539
|
(0, c.useEffect)(() => {
|
|
5515
5540
|
$t.current = ht;
|
|
5516
5541
|
}, [ht]);
|
|
5517
|
-
let
|
|
5542
|
+
let As = (0, c.useCallback)((p) => {
|
|
5518
5543
|
gi(p.current || $t.current.current, p.pageSize || $t.current.pageSize);
|
|
5519
|
-
}, [gi]),
|
|
5544
|
+
}, [gi]), Rs = (0, c.useCallback)((p) => {
|
|
5520
5545
|
mi?.(p);
|
|
5521
|
-
}, [mi]),
|
|
5522
|
-
let { sortBy: P, sortOrder: Q } =
|
|
5546
|
+
}, [mi]), Ls = c.default.useCallback((p) => {
|
|
5547
|
+
let { sortBy: P, sortOrder: Q } = Ua(p);
|
|
5523
5548
|
pi(P, Q);
|
|
5524
|
-
}, [pi]), [
|
|
5549
|
+
}, [pi]), [Os, Fi] = (0, c.useState)($r), [Ds, xi] = (0, c.useState)([]), Pi = (0, c.useRef)(null), [Bs, ki] = (0, c.useState)(m.re), [zs, ji] = (0, c.useState)([]), Si = (0, c.useRef)(null), [Us, Gs] = (0, c.useState)(""), Ei = (0, c.useRef)(null), [Vs, Ni] = (0, c.useState)(""), [Ws, Ti] = (0, c.useState)([]), wt = c.default.useRef(void 0), [$s, Mi] = (0, c.useState)(!1), [qs, Ai] = (0, c.useState)(!1), Ri = c.default.useRef(null), Li = c.default.useRef(!1), [Hs, Ks] = (0, c.useState)({
|
|
5525
5550
|
mode: "qr",
|
|
5526
5551
|
rawText: "",
|
|
5527
5552
|
foregroundHex: "#000000",
|
|
@@ -5532,41 +5557,41 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5532
5557
|
}), Oi = c.default.useRef(A), Di = c.default.useCallback((p) => {
|
|
5533
5558
|
let P = p.indexOf(",");
|
|
5534
5559
|
if (P === -1) return null;
|
|
5535
|
-
let Q = p.substring(0, P), ee = Q.match(/^data:([^;]+)/),
|
|
5536
|
-
|
|
5560
|
+
let Q = p.substring(0, P), ee = Q.match(/^data:([^;]+)/), E = ee && ee[1] || "image/svg+xml", M = "svg";
|
|
5561
|
+
E.includes("png") ? M = "png" : (E.includes("jpeg") || E.includes("jpg")) && (M = "jpg");
|
|
5537
5562
|
let te;
|
|
5538
5563
|
if (/;base64/i.test(Q)) {
|
|
5539
|
-
let ce = p.substring(P + 1),
|
|
5540
|
-
for (let pt = 0; pt <
|
|
5541
|
-
te = new Blob([We], { type:
|
|
5564
|
+
let ce = p.substring(P + 1), Ie = atob(ce), We = new Uint8Array(Ie.length);
|
|
5565
|
+
for (let pt = 0; pt < Ie.length; pt += 1) We[pt] = Ie.charCodeAt(pt);
|
|
5566
|
+
te = new Blob([We], { type: E });
|
|
5542
5567
|
} else {
|
|
5543
5568
|
let ce = decodeURIComponent(p.substring(P + 1));
|
|
5544
|
-
te = new Blob([ce], { type:
|
|
5569
|
+
te = new Blob([ce], { type: E });
|
|
5545
5570
|
}
|
|
5546
|
-
return new File([te], `icon_${Date.now()}.${M}`, { type:
|
|
5571
|
+
return new File([te], `icon_${Date.now()}.${M}`, { type: E });
|
|
5547
5572
|
}, []), Bi = c.default.useCallback(async (p) => {
|
|
5548
|
-
let P = i.startUpload(
|
|
5573
|
+
let P = i.startUpload(Pe || void 0, [p])[0], Q = 0, ee = setInterval(() => {
|
|
5549
5574
|
Q = Math.min(Q + 10 + Math.floor(Date.now() % 10), 90), i.updateProgress(P, Q);
|
|
5550
5575
|
}, 200);
|
|
5551
5576
|
try {
|
|
5552
|
-
let
|
|
5553
|
-
if (clearInterval(ee), i.updateProgress(P, 100),
|
|
5577
|
+
let E = await s.uploadFileWithProvider(p, void 0, !0);
|
|
5578
|
+
if (clearInterval(ee), i.updateProgress(P, 100), E) {
|
|
5554
5579
|
await new Promise((te) => setTimeout(te, 100));
|
|
5555
|
-
let M =
|
|
5580
|
+
let M = we?.find((te) => te.id === E.id && !te.isFolder) || E;
|
|
5556
5581
|
i.markAsSuccess(P, M);
|
|
5557
5582
|
} else i.markAsSuccess(P);
|
|
5558
5583
|
await B.current?.refreshFileCounts();
|
|
5559
|
-
} catch (
|
|
5584
|
+
} catch (E) {
|
|
5560
5585
|
clearInterval(ee);
|
|
5561
|
-
let M =
|
|
5562
|
-
throw i.markAsError(P, M),
|
|
5586
|
+
let M = E instanceof Error ? E.message : String(E);
|
|
5587
|
+
throw i.markAsError(P, M), E;
|
|
5563
5588
|
}
|
|
5564
5589
|
}, [
|
|
5565
5590
|
i,
|
|
5566
|
-
|
|
5591
|
+
we,
|
|
5567
5592
|
s,
|
|
5568
|
-
|
|
5569
|
-
]),
|
|
5593
|
+
Pe
|
|
5594
|
+
]), Ys = (0, c.useCallback)(async (p) => {
|
|
5570
5595
|
if (p && p.startsWith("data:")) {
|
|
5571
5596
|
let P = Di(p);
|
|
5572
5597
|
if (!P) return;
|
|
@@ -5608,27 +5633,27 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5608
5633
|
zi();
|
|
5609
5634
|
}, [zi]), (0, c.useEffect)(() => {
|
|
5610
5635
|
let p = Oi.current;
|
|
5611
|
-
Oi.current = A, A === "my_files" ? (xi([]), Fi($r), ji([]), ki(m.re), Ti([]),
|
|
5636
|
+
Oi.current = A, A === "my_files" ? (xi([]), Fi($r), ji([]), ki(m.re), Ti([]), Ni(""), Ai(!1), Mi(!1), p !== "my_files" && (p === "stock_images" || p === "gif" || p === "ai") && Wt("")) : A === "ai" ? Ri.current?.focus() : A === "gif" ? Pi.current?.focus() : A === "stock_images" ? Si.current?.focus() : A === "icons" && Ei.current?.focus();
|
|
5612
5637
|
}, [A, Wt]);
|
|
5613
|
-
let
|
|
5614
|
-
await
|
|
5615
|
-
}, [
|
|
5638
|
+
let Qs = c.default.useCallback(async () => {
|
|
5639
|
+
await Ci(), await B.current?.refreshFileCounts();
|
|
5640
|
+
}, [Ci]), Ui = (0, c.useCallback)((p) => p ? p.files?.length ? Array.from(p.files) : p.items ? Array.from(p.items).map((P) => P.getAsFile()).filter((P) => !!P) : [] : [], []);
|
|
5616
5641
|
return (0, l.jsxs)(l.Fragment, { children: [
|
|
5617
5642
|
Be && yt === "my_files" && (0, Ht.createPortal)((0, l.jsx)("div", {
|
|
5618
5643
|
className: T.dragCaptureLayer,
|
|
5619
5644
|
"data-drag-capture": "true",
|
|
5620
5645
|
onDragOver: (p) => {
|
|
5621
|
-
p.preventDefault(), p.stopPropagation(), p.dataTransfer && (p.dataTransfer.dropEffect = "copy"), p.dataTransfer?.types?.includes("Files") && !q.current &&
|
|
5646
|
+
p.preventDefault(), p.stopPropagation(), p.dataTransfer && (p.dataTransfer.dropEffect = "copy"), p.dataTransfer?.types?.includes("Files") && !q.current && ve(!0);
|
|
5622
5647
|
},
|
|
5623
5648
|
onDragEnter: (p) => {
|
|
5624
|
-
p.preventDefault(), p.stopPropagation(), p.dataTransfer?.types?.includes("Files") &&
|
|
5649
|
+
p.preventDefault(), p.stopPropagation(), p.dataTransfer?.types?.includes("Files") && ve(!0);
|
|
5625
5650
|
},
|
|
5626
5651
|
onDragLeave: (p) => {
|
|
5627
5652
|
let P = p.relatedTarget;
|
|
5628
|
-
(!P || !document.documentElement.contains(P)) && (
|
|
5653
|
+
(!P || !document.documentElement.contains(P)) && (ve(!1), Ce(!1), document.body.removeAttribute("data-fm-dragging"));
|
|
5629
5654
|
},
|
|
5630
5655
|
onDrop: (p) => {
|
|
5631
|
-
p.preventDefault(), p.stopPropagation(), Ce(!1),
|
|
5656
|
+
p.preventDefault(), p.stopPropagation(), Ce(!1), ve(!1), document.body.removeAttribute("data-fm-dragging");
|
|
5632
5657
|
let P = Ui(p.dataTransfer);
|
|
5633
5658
|
P.length && (lt(!0), $e(P).catch((Q) => {
|
|
5634
5659
|
Q?.name;
|
|
@@ -5636,7 +5661,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5636
5661
|
},
|
|
5637
5662
|
"aria-hidden": "true"
|
|
5638
5663
|
}), document.body),
|
|
5639
|
-
|
|
5664
|
+
N && (0, Ht.createPortal)((0, l.jsx)("div", {
|
|
5640
5665
|
className: T.dragOverlayGlobal,
|
|
5641
5666
|
"data-drop-overlay": "true",
|
|
5642
5667
|
onDragOver: (p) => {
|
|
@@ -5644,7 +5669,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5644
5669
|
},
|
|
5645
5670
|
onDragEnter: (p) => p.preventDefault(),
|
|
5646
5671
|
onDrop: (p) => {
|
|
5647
|
-
p.preventDefault(), p.stopPropagation(),
|
|
5672
|
+
p.preventDefault(), p.stopPropagation(), ve(!1), Ce(!1), document.body.removeAttribute("data-fm-dragging");
|
|
5648
5673
|
let P = Ui(p.dataTransfer);
|
|
5649
5674
|
P.length && (lt(!0), $e(P).catch((Q) => {
|
|
5650
5675
|
Q?.name;
|
|
@@ -5674,10 +5699,10 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5674
5699
|
children: (0, l.jsxs)("div", {
|
|
5675
5700
|
className: T.filesContainer,
|
|
5676
5701
|
"data-files-container": "true",
|
|
5677
|
-
onDragOver:
|
|
5678
|
-
onDragLeave:
|
|
5679
|
-
onDragEnter:
|
|
5680
|
-
onDrop:
|
|
5702
|
+
onDragOver: xs,
|
|
5703
|
+
onDragLeave: Fs,
|
|
5704
|
+
onDragEnter: Cs,
|
|
5705
|
+
onDrop: Ps,
|
|
5681
5706
|
children: [
|
|
5682
5707
|
re && (0, l.jsx)("div", {
|
|
5683
5708
|
className: T.dragOverlay,
|
|
@@ -5701,14 +5726,14 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5701
5726
|
}),
|
|
5702
5727
|
(0, l.jsxs)(g.Layout, {
|
|
5703
5728
|
className: "file-manager__content",
|
|
5704
|
-
children: [(0, l.jsx)(
|
|
5729
|
+
children: [(0, l.jsx)(Bl, {
|
|
5705
5730
|
width: 320,
|
|
5706
5731
|
theme: "light",
|
|
5707
5732
|
className: "file-manager-sider",
|
|
5708
5733
|
children: (0, l.jsx)(Ar, {
|
|
5709
5734
|
ref: B,
|
|
5710
|
-
selectedFolder:
|
|
5711
|
-
generateMenuItems:
|
|
5735
|
+
selectedFolder: Pe || "folders",
|
|
5736
|
+
generateMenuItems: Fe,
|
|
5712
5737
|
onFolderSelect: (p) => at?.(p),
|
|
5713
5738
|
folders: he || [],
|
|
5714
5739
|
fetchFolders: ie,
|
|
@@ -5730,17 +5755,17 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5730
5755
|
left: 0,
|
|
5731
5756
|
zIndex: 100,
|
|
5732
5757
|
background: "var(--em-colorBgLayout)"
|
|
5733
|
-
} }), (0, l.jsxs)(
|
|
5758
|
+
} }), (0, l.jsxs)(zl, {
|
|
5734
5759
|
className: "main-content",
|
|
5735
5760
|
children: [
|
|
5736
|
-
(0, l.jsx)(
|
|
5761
|
+
(0, l.jsx)(fl, {
|
|
5737
5762
|
activeLibraryItem: A,
|
|
5738
|
-
selectedFolder: he?.find((p) => p?.id ===
|
|
5739
|
-
isTrashFolder:
|
|
5740
|
-
onClearTrash:
|
|
5741
|
-
files:
|
|
5742
|
-
loading:
|
|
5743
|
-
onRefresh:
|
|
5763
|
+
selectedFolder: he?.find((p) => p?.id === Pe)?.name || u("Folders"),
|
|
5764
|
+
isTrashFolder: Pe === "Trash",
|
|
5765
|
+
onClearTrash: js,
|
|
5766
|
+
files: we || [],
|
|
5767
|
+
loading: _i,
|
|
5768
|
+
onRefresh: _s,
|
|
5744
5769
|
refreshDisabled: Xe || L,
|
|
5745
5770
|
showRefresh: !!(f?.apiEndpoints?.clearCache || f?.dataProviders?.clearCache)
|
|
5746
5771
|
}),
|
|
@@ -5748,39 +5773,39 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5748
5773
|
A === "my_files" && (0, l.jsx)(Mr, {
|
|
5749
5774
|
searchTerm: Ut,
|
|
5750
5775
|
handleAddFile: vi,
|
|
5751
|
-
files:
|
|
5776
|
+
files: we || [],
|
|
5752
5777
|
handleSearch: Wt,
|
|
5753
5778
|
sortBy: Gt,
|
|
5754
5779
|
sortOrder: Vt,
|
|
5755
|
-
handleSortOptionChange:
|
|
5780
|
+
handleSortOptionChange: Ls,
|
|
5756
5781
|
pagination: ht,
|
|
5757
|
-
setPagination:
|
|
5758
|
-
loading:
|
|
5759
|
-
handleItemClick:
|
|
5782
|
+
setPagination: As,
|
|
5783
|
+
loading: _i,
|
|
5784
|
+
handleItemClick: Rs,
|
|
5760
5785
|
onClearSelection: vt.handleClearSelection,
|
|
5761
5786
|
onRename: vt.handleRename,
|
|
5762
5787
|
onCopy: vt.handleCopy,
|
|
5763
5788
|
onMove: vt.handleMove,
|
|
5764
5789
|
onDelete: vt.handleDeleteSelected,
|
|
5765
|
-
showRenameModal:
|
|
5790
|
+
showRenameModal: Me,
|
|
5766
5791
|
showDeleteConfirm: ci,
|
|
5767
5792
|
showCopyModal: t.actions.showCopyModal || (() => {}),
|
|
5768
5793
|
showMoveModal: xt,
|
|
5769
5794
|
onEdit: Ze.handleEdit,
|
|
5770
5795
|
getFileData: s.getFileData
|
|
5771
5796
|
}),
|
|
5772
|
-
A === "gif" && (0, l.jsx)(
|
|
5773
|
-
imageGifList:
|
|
5797
|
+
A === "gif" && (0, l.jsx)(vl, {
|
|
5798
|
+
imageGifList: Ds,
|
|
5774
5799
|
setImageGifList: xi,
|
|
5775
|
-
currentReqGif:
|
|
5800
|
+
currentReqGif: Os,
|
|
5776
5801
|
setCurrentReqGif: Fi,
|
|
5777
5802
|
inputRef: Pi,
|
|
5778
5803
|
customRequest: (p, P) => ot(p, void 0, P, "gif")
|
|
5779
5804
|
}),
|
|
5780
|
-
A === "stock_images" && (0, l.jsx)(
|
|
5781
|
-
imageStockList:
|
|
5805
|
+
A === "stock_images" && (0, l.jsx)(xl, {
|
|
5806
|
+
imageStockList: zs,
|
|
5782
5807
|
setImageStockList: ji,
|
|
5783
|
-
currentReq:
|
|
5808
|
+
currentReq: Bs,
|
|
5784
5809
|
setCurrentReq: ki,
|
|
5785
5810
|
inputRef: Si,
|
|
5786
5811
|
customRequest: (p, P) => ot(p, void 0, P, "imageStock")
|
|
@@ -5794,11 +5819,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5794
5819
|
},
|
|
5795
5820
|
children: (0, l.jsx)(g.Spin, { size: "large" })
|
|
5796
5821
|
}),
|
|
5797
|
-
children: (0, l.jsx)(
|
|
5798
|
-
customRequest:
|
|
5799
|
-
query:
|
|
5800
|
-
setQuery:
|
|
5801
|
-
inputRef:
|
|
5822
|
+
children: (0, l.jsx)(Ul, {
|
|
5823
|
+
customRequest: Ys,
|
|
5824
|
+
query: Us,
|
|
5825
|
+
setQuery: Gs,
|
|
5826
|
+
inputRef: Ei
|
|
5802
5827
|
})
|
|
5803
5828
|
}),
|
|
5804
5829
|
A === "image_codes" && (0, l.jsx)(c.default.Suspense, {
|
|
@@ -5810,22 +5835,22 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5810
5835
|
},
|
|
5811
5836
|
children: (0, l.jsx)(g.Spin, { size: "large" })
|
|
5812
5837
|
}),
|
|
5813
|
-
children: (0, l.jsx)(
|
|
5838
|
+
children: (0, l.jsx)(Gl, {
|
|
5814
5839
|
customRequest: wi,
|
|
5815
|
-
state:
|
|
5816
|
-
setState:
|
|
5840
|
+
state: Hs,
|
|
5841
|
+
setState: Ks
|
|
5817
5842
|
})
|
|
5818
5843
|
}),
|
|
5819
|
-
A === "ai" && !!le?.sseQuery && (0, l.jsx)(
|
|
5820
|
-
imageAiList:
|
|
5844
|
+
A === "ai" && !!le?.sseQuery && (0, l.jsx)(Ml, {
|
|
5845
|
+
imageAiList: Ws,
|
|
5821
5846
|
setImageAiList: Ti,
|
|
5822
|
-
aiImageRequest:
|
|
5823
|
-
setAiImageRequest:
|
|
5847
|
+
aiImageRequest: Vs,
|
|
5848
|
+
setAiImageRequest: Ni,
|
|
5824
5849
|
inputAiRef: Ri,
|
|
5825
5850
|
customRequest: wi,
|
|
5826
|
-
isLoadingAi:
|
|
5851
|
+
isLoadingAi: $s,
|
|
5827
5852
|
setIsLoadingAi: Mi,
|
|
5828
|
-
isImageUploaded:
|
|
5853
|
+
isImageUploaded: qs,
|
|
5829
5854
|
setIsImageUploaded: Ai
|
|
5830
5855
|
}),
|
|
5831
5856
|
A === "editor" && (0, l.jsx)(l.Fragment, {})
|
|
@@ -5846,12 +5871,12 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5846
5871
|
},
|
|
5847
5872
|
children: (0, l.jsx)(g.Spin, { size: "large" })
|
|
5848
5873
|
}),
|
|
5849
|
-
(0, l.jsx)(
|
|
5874
|
+
(0, l.jsx)(ol, {
|
|
5850
5875
|
isModalVisible: ne,
|
|
5851
5876
|
handleModalOk: Oe,
|
|
5852
5877
|
handleModalCancel: Re,
|
|
5853
5878
|
form: V,
|
|
5854
|
-
selectedFolder:
|
|
5879
|
+
selectedFolder: Pe || null,
|
|
5855
5880
|
folders: he || [],
|
|
5856
5881
|
isUrlModalVisible: k,
|
|
5857
5882
|
setIsUrlModalVisible: (p) => W?.(p),
|
|
@@ -5862,27 +5887,27 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5862
5887
|
handleRenameCancel: () => Ne?.(),
|
|
5863
5888
|
renameForm: y,
|
|
5864
5889
|
fileToRename: ae,
|
|
5865
|
-
files:
|
|
5890
|
+
files: we || [],
|
|
5866
5891
|
isMoveModalVisible: U,
|
|
5867
|
-
handleMoveOk:
|
|
5868
|
-
handleMoveCancel:
|
|
5869
|
-
moveForm:
|
|
5892
|
+
handleMoveOk: Ns,
|
|
5893
|
+
handleMoveCancel: ws,
|
|
5894
|
+
moveForm: C,
|
|
5870
5895
|
selectedFiles: oe || new Set(),
|
|
5871
5896
|
isRenameFolderModalVisible: D,
|
|
5872
|
-
handleRenameFolderOk:
|
|
5873
|
-
handleRenameFolderCancel:
|
|
5897
|
+
handleRenameFolderOk: Qs,
|
|
5898
|
+
handleRenameFolderCancel: Ms,
|
|
5874
5899
|
renameFolderForm: O,
|
|
5875
5900
|
folderToRename: Y,
|
|
5876
5901
|
isCopyModalVisible: Z,
|
|
5877
|
-
handleCopyOk:
|
|
5878
|
-
handleCopyCancel:
|
|
5902
|
+
handleCopyOk: Ts,
|
|
5903
|
+
handleCopyCancel: Is,
|
|
5879
5904
|
copyForm: R,
|
|
5880
5905
|
isDeleteConfirmVisible: $,
|
|
5881
|
-
handleDeleteConfirmOk:
|
|
5882
|
-
handleDeleteConfirmCancel: () =>
|
|
5906
|
+
handleDeleteConfirmOk: ks,
|
|
5907
|
+
handleDeleteConfirmCancel: () => bs?.(),
|
|
5883
5908
|
isClearTrashConfirmVisible: x,
|
|
5884
|
-
handleClearTrashConfirm:
|
|
5885
|
-
handleClearTrashCancel:
|
|
5909
|
+
handleClearTrashConfirm: Ss,
|
|
5910
|
+
handleClearTrashCancel: Es,
|
|
5886
5911
|
fetchChildFolders: X
|
|
5887
5912
|
}),
|
|
5888
5913
|
(0, l.jsx)(Rr, {
|
|
@@ -5892,7 +5917,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5892
5917
|
onSave: Ze.handlePixieEditorSave,
|
|
5893
5918
|
onSaveCopy: Ze.handlePixieEditorSaveCopy
|
|
5894
5919
|
}),
|
|
5895
|
-
(0, l.jsx)(
|
|
5920
|
+
(0, l.jsx)(cl, {
|
|
5896
5921
|
files: i.uploadFiles,
|
|
5897
5922
|
visible: i.isUploadVisible,
|
|
5898
5923
|
minimized: i.isUploadMinimized,
|
|
@@ -5945,11 +5970,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5945
5970
|
};
|
|
5946
5971
|
}, [e]);
|
|
5947
5972
|
c.default.useEffect(() => {
|
|
5948
|
-
w.theme &&
|
|
5973
|
+
w.theme && Dl(w.theme), Ol(w);
|
|
5949
5974
|
}, [w]), (0, c.useEffect)(() => {
|
|
5950
5975
|
w.locale && w.locale !== m.zn.language && m.zn.changeLanguage(w.locale), w.customLocale && w.locale && m.zn.addResourceBundle(w.locale, "translation", w.customLocale, !0, !0);
|
|
5951
5976
|
}, [w.locale, w.customLocale]);
|
|
5952
|
-
let I = (0, c.useRef)(null),
|
|
5977
|
+
let I = (0, c.useRef)(null), _ = (0, c.useCallback)(() => I.current ?? document.body, []);
|
|
5953
5978
|
return (0, l.jsx)(g.App, {
|
|
5954
5979
|
className: "em-filemanager",
|
|
5955
5980
|
children: (0, l.jsxs)(l.Fragment, { children: [(0, l.jsx)(g.ConfigProvider, {
|
|
@@ -5969,7 +5994,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5969
5994
|
handleNotify: h,
|
|
5970
5995
|
handleError: v,
|
|
5971
5996
|
handleSuccess: f,
|
|
5972
|
-
getModalContainer:
|
|
5997
|
+
getModalContainer: _
|
|
5973
5998
|
}), [
|
|
5974
5999
|
o,
|
|
5975
6000
|
i,
|
|
@@ -5984,9 +6009,9 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5984
6009
|
h,
|
|
5985
6010
|
v,
|
|
5986
6011
|
f,
|
|
5987
|
-
|
|
6012
|
+
_
|
|
5988
6013
|
]),
|
|
5989
|
-
children: (0, l.jsx)(
|
|
6014
|
+
children: (0, l.jsx)(Vl, {})
|
|
5990
6015
|
})
|
|
5991
6016
|
}), (0, l.jsx)("div", {
|
|
5992
6017
|
ref: I,
|
|
@@ -5995,7 +6020,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5995
6020
|
});
|
|
5996
6021
|
});
|
|
5997
6022
|
qr.displayName = "FileManagerApp";
|
|
5998
|
-
function
|
|
6023
|
+
function Wl(e) {
|
|
5999
6024
|
return {
|
|
6000
6025
|
theme: e.theme ?? "light",
|
|
6001
6026
|
locale: e.locale,
|
|
@@ -6018,15 +6043,15 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6018
6043
|
features: { enableUpdateFile: e.enableUpdateFile }
|
|
6019
6044
|
};
|
|
6020
6045
|
}
|
|
6021
|
-
var Hr = g.Alert.ErrorBoundary,
|
|
6046
|
+
var Hr = g.Alert.ErrorBoundary, $l = (e) => (0, l.jsx)(vr, {
|
|
6022
6047
|
i18n: m.zn,
|
|
6023
6048
|
children: (0, l.jsx)(gr, {
|
|
6024
6049
|
externalTheme: e.config?.theme ?? "light",
|
|
6025
6050
|
customThemeToken: e.config?.customTheme,
|
|
6026
6051
|
children: (0, l.jsx)(Hr, { children: (0, l.jsx)(qr, { ...e }) })
|
|
6027
6052
|
})
|
|
6028
|
-
}),
|
|
6029
|
-
let { onClose: t, onSave: r, dataProviders: a, theme: i, locale: s, hasPagination: o, disablePagination: d, paginationAvailable: u, dedupeUploadNamesOnClient: n, saveCopyToCurrentFolder: h, enableUpdateFile: v, handleProxyUrl: f, notificationDedupeTtlMs: w } = e, I = c.default.useMemo(() =>
|
|
6053
|
+
}), ql = (e) => {
|
|
6054
|
+
let { onClose: t, onSave: r, dataProviders: a, theme: i, locale: s, hasPagination: o, disablePagination: d, paginationAvailable: u, dedupeUploadNamesOnClient: n, saveCopyToCurrentFolder: h, enableUpdateFile: v, handleProxyUrl: f, notificationDedupeTtlMs: w } = e, I = c.default.useMemo(() => Wl(e), [
|
|
6030
6055
|
i,
|
|
6031
6056
|
s,
|
|
6032
6057
|
e.baseUrl,
|
|
@@ -6046,7 +6071,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6046
6071
|
h,
|
|
6047
6072
|
w,
|
|
6048
6073
|
v
|
|
6049
|
-
]),
|
|
6074
|
+
]), _ = c.default.useCallback(async (k, U, D, Z) => {
|
|
6050
6075
|
if (!k && !U || !a?.getFiles) return null;
|
|
6051
6076
|
try {
|
|
6052
6077
|
let [$] = (await a.getFiles({
|
|
@@ -6135,7 +6160,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6135
6160
|
sourceUrl: re.sourceUrl,
|
|
6136
6161
|
isFolder: !1,
|
|
6137
6162
|
selected: !1
|
|
6138
|
-
} : await
|
|
6163
|
+
} : await _(me.data.id, me.data.name || J.name, me.data.folderId ?? Z, D) || await F(me.data.id) || null;
|
|
6139
6164
|
}
|
|
6140
6165
|
}
|
|
6141
6166
|
if (a?.uploadFile) {
|
|
@@ -6156,10 +6181,10 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6156
6181
|
}
|
|
6157
6182
|
}, [
|
|
6158
6183
|
a,
|
|
6159
|
-
|
|
6184
|
+
_,
|
|
6160
6185
|
F,
|
|
6161
6186
|
I
|
|
6162
|
-
]),
|
|
6187
|
+
]), C = c.default.useCallback(async (k, U) => {
|
|
6163
6188
|
if (a?.updateFile && k.id && k.thumbnail) try {
|
|
6164
6189
|
let D = await b(k, U);
|
|
6165
6190
|
D && (k = D);
|
|
@@ -6205,7 +6230,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6205
6230
|
visible: !0,
|
|
6206
6231
|
onClose: t,
|
|
6207
6232
|
file: V,
|
|
6208
|
-
onSave:
|
|
6233
|
+
onSave: C,
|
|
6209
6234
|
onSaveCopy: O
|
|
6210
6235
|
})
|
|
6211
6236
|
}) })
|
|
@@ -6246,7 +6271,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6246
6271
|
clearAll() {
|
|
6247
6272
|
this.map.clear();
|
|
6248
6273
|
}
|
|
6249
|
-
},
|
|
6274
|
+
}, Hl = class {
|
|
6250
6275
|
constructor() {
|
|
6251
6276
|
this.deletingIds = new Set();
|
|
6252
6277
|
}
|
|
@@ -6285,31 +6310,31 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6285
6310
|
}
|
|
6286
6311
|
return i === "desc" ? -s : s;
|
|
6287
6312
|
}
|
|
6288
|
-
function
|
|
6313
|
+
function _t(e) {
|
|
6289
6314
|
return e != null && String(e).trim() !== "";
|
|
6290
6315
|
}
|
|
6291
|
-
function
|
|
6316
|
+
function Kl(e, t) {
|
|
6292
6317
|
let { sortBy: r } = Kr(t);
|
|
6293
6318
|
switch (r) {
|
|
6294
|
-
case "date": return
|
|
6319
|
+
case "date": return _t(e.date) ? !Number.isNaN(new Date(e.date).getTime()) : !1;
|
|
6295
6320
|
case "size": return e.size != null && Number.isFinite(Number(e.size));
|
|
6296
|
-
case "type": return
|
|
6297
|
-
default: return
|
|
6321
|
+
case "type": return _t(e.extension) || _t(e.type);
|
|
6322
|
+
default: return _t(e.name);
|
|
6298
6323
|
}
|
|
6299
6324
|
}
|
|
6300
|
-
function
|
|
6325
|
+
function Yl(e, t) {
|
|
6301
6326
|
let r = typeof t?.search == "string" ? t.search.trim() : "";
|
|
6302
6327
|
if (!r) return !0;
|
|
6303
6328
|
let a = r.toLowerCase();
|
|
6304
6329
|
return (e.name?.toLowerCase().includes(a) ?? !1) || (e.type?.toLowerCase().includes(a) ?? !1) || (e.extension?.toLowerCase().includes(a) ?? !1);
|
|
6305
6330
|
}
|
|
6306
|
-
var
|
|
6331
|
+
var Ql = Yr, Zl = Yl, Jl = Kl;
|
|
6307
6332
|
function Qr(e = {}) {
|
|
6308
6333
|
return {
|
|
6309
6334
|
...e,
|
|
6310
|
-
comparator: e.comparator ??
|
|
6311
|
-
filterMatch: e.filterMatch ??
|
|
6312
|
-
hasSortValue: e.hasSortValue ??
|
|
6335
|
+
comparator: e.comparator ?? Ql,
|
|
6336
|
+
filterMatch: e.filterMatch ?? Zl,
|
|
6337
|
+
hasSortValue: e.hasSortValue ?? Jl
|
|
6313
6338
|
};
|
|
6314
6339
|
}
|
|
6315
6340
|
var ft = "Trash";
|
|
@@ -6327,7 +6352,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6327
6352
|
}
|
|
6328
6353
|
return Array.from(new Set(i.map(He).filter(Boolean)));
|
|
6329
6354
|
}
|
|
6330
|
-
function
|
|
6355
|
+
function Xl(e) {
|
|
6331
6356
|
let t = new Map();
|
|
6332
6357
|
for (let [r, a] of Object.entries(e)) a.id && t.set(He(r), a);
|
|
6333
6358
|
return (r) => {
|
|
@@ -6349,7 +6374,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6349
6374
|
let t = Number(e);
|
|
6350
6375
|
return Number.isFinite(t) && t >= 0 ? t : Infinity;
|
|
6351
6376
|
}
|
|
6352
|
-
function
|
|
6377
|
+
function es(e) {
|
|
6353
6378
|
return !e || typeof e.search != "string" ? !1 : e.search.trim().length > 0;
|
|
6354
6379
|
}
|
|
6355
6380
|
function Ke(e) {
|
|
@@ -6379,7 +6404,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6379
6404
|
let t = e;
|
|
6380
6405
|
return t.code === "path_folder_not_found" || t.code === "folder_not_found" || t.code === "FolderNotFound" || t.data?.code === "path_folder_not_found" || t.data?.code === "folder_not_found" || t.status === 404 || t.data?.data?.status === 404;
|
|
6381
6406
|
}
|
|
6382
|
-
function
|
|
6407
|
+
function ts(e) {
|
|
6383
6408
|
let t = 2166136261;
|
|
6384
6409
|
for (let r = 0; r < e.length; r++) t ^= e.charCodeAt(r), t = t + ((t << 1) + (t << 4) + (t << 7) + (t << 8) + (t << 24)) >>> 0;
|
|
6385
6410
|
return t.toString(36);
|
|
@@ -6399,7 +6424,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6399
6424
|
let n = t[u];
|
|
6400
6425
|
i.includes(u) ? r.push(`${u}=${String(n ?? "")}`) : a[u] = n;
|
|
6401
6426
|
}
|
|
6402
|
-
let s = Object.keys(a).length ? JSON.stringify(a) : "", o = r.join("|"), d = s ?
|
|
6427
|
+
let s = Object.keys(a).length ? JSON.stringify(a) : "", o = r.join("|"), d = s ? ts(s) : "";
|
|
6403
6428
|
return `${o}${d ? `|${d}` : ""}`;
|
|
6404
6429
|
}
|
|
6405
6430
|
var ei = class Gi {
|
|
@@ -6531,8 +6556,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6531
6556
|
if (!v) continue;
|
|
6532
6557
|
let f = v.value, w = Ge(f.id);
|
|
6533
6558
|
this.childrenByParent.delete(w);
|
|
6534
|
-
let I = Ge(h),
|
|
6535
|
-
|
|
6559
|
+
let I = Ge(h), _ = this.childrenByParent.get(I);
|
|
6560
|
+
_ && (_.folders.delete(n), _.files.size === 0 && _.folders.size === 0 && this.childrenByParent.delete(I)), this.entities.delete(n), d.push({ ...f });
|
|
6536
6561
|
}
|
|
6537
6562
|
return {
|
|
6538
6563
|
deletedFolderRecords: d,
|
|
@@ -6605,8 +6630,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6605
6630
|
let I = f.shift();
|
|
6606
6631
|
if (w.has(I)) continue;
|
|
6607
6632
|
w.add(I);
|
|
6608
|
-
let
|
|
6609
|
-
if (
|
|
6633
|
+
let _ = this.childrenByParent.get(I);
|
|
6634
|
+
if (_) for (let F of _.folders) h.add(F), f.push(F);
|
|
6610
6635
|
}
|
|
6611
6636
|
}
|
|
6612
6637
|
}
|
|
@@ -6711,9 +6736,9 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6711
6736
|
let h = this.failedRequests.getFreshError(u, this.errorTtl);
|
|
6712
6737
|
if (h != null) throw h;
|
|
6713
6738
|
if (n.view.value && !this.isExpired(n.view.updatedAt) && !this.areEntitiesStale(n.view.value, i) && !n.view.meta?.stale) {
|
|
6714
|
-
let w = n.view.value.map((
|
|
6739
|
+
let w = n.view.value.map((_) => i.getEntity(_)).filter(Boolean), I = n.params?.itemType || "all";
|
|
6715
6740
|
return {
|
|
6716
|
-
items: w.filter((
|
|
6741
|
+
items: w.filter((_) => this.isEntityTypeCompatible(_, I)),
|
|
6717
6742
|
...n.view.meta ?? {}
|
|
6718
6743
|
};
|
|
6719
6744
|
}
|
|
@@ -6722,7 +6747,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6722
6747
|
n.view.loadId = v;
|
|
6723
6748
|
let f = (async () => {
|
|
6724
6749
|
try {
|
|
6725
|
-
let w = await a(t, r), I =
|
|
6750
|
+
let w = await a(t, r), I = es(r), _ = I ? {
|
|
6726
6751
|
...w,
|
|
6727
6752
|
total: void 0
|
|
6728
6753
|
} : w, F = this.views.get(s)?.get(Qe(r));
|
|
@@ -6730,18 +6755,18 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6730
6755
|
let ne = Error("StaleLoad");
|
|
6731
6756
|
throw ne.name = "StaleLoad", ne;
|
|
6732
6757
|
}
|
|
6733
|
-
for (let ne of
|
|
6734
|
-
n.view.value =
|
|
6735
|
-
let { items: V, ...b } =
|
|
6758
|
+
for (let ne of _.items) i.upsertEntity(ne);
|
|
6759
|
+
n.view.value = _.items.map((ne) => ne.id);
|
|
6760
|
+
let { items: V, ...b } = _, y = { ...b };
|
|
6736
6761
|
n.view.meta = y, n.view.meta && (n.view.meta.stale = !1), this.failedRequests.delete(u), n.view.updatedAt = this.now(), !I && typeof y.total == "number" && (this.serverChildrenCountHandler ? this.serverChildrenCountHandler(t ?? null, y.total, i) : i.updateServerChildrenCount(t, y.total));
|
|
6737
|
-
let
|
|
6738
|
-
if ((
|
|
6762
|
+
let C = this.strategy.preloadPagesAfter ?? 0, O = this.strategy.preloadPagesBefore ?? 0, R = Dt(r?.pageSize);
|
|
6763
|
+
if ((C > 0 || O > 0) && Number.isFinite(R)) {
|
|
6739
6764
|
let ne = t, k = { ...r }, U = typeof y.totalPages == "number" ? y.totalPages : 1, D = r?.page ?? 1, Z = R, $ = a, Y = v;
|
|
6740
6765
|
setTimeout(() => {
|
|
6741
|
-
this.preloadPagesAsync(ne, k, D, U, Z,
|
|
6766
|
+
this.preloadPagesAsync(ne, k, D, U, Z, C, O, i, y, $, Y);
|
|
6742
6767
|
}, 0);
|
|
6743
6768
|
}
|
|
6744
|
-
return
|
|
6769
|
+
return _;
|
|
6745
6770
|
} catch (w) {
|
|
6746
6771
|
if (w?.name === "StaleLoad") throw this.failedRequests.delete(u), n.view.value = void 0, n.view.updatedAt = this.now(), w;
|
|
6747
6772
|
if (this.isFolderNotFoundError(w)) return this.failedRequests.delete(u), n.view.value = [], n.view.meta = {
|
|
@@ -6765,9 +6790,9 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6765
6790
|
if (!w) return;
|
|
6766
6791
|
let I = w.get(Qe(r));
|
|
6767
6792
|
if (!I || v != null && I.view.loadId !== v) return;
|
|
6768
|
-
let
|
|
6769
|
-
if (!
|
|
6770
|
-
let F = typeof
|
|
6793
|
+
let _ = w.get(Qe(r));
|
|
6794
|
+
if (!_?.view.meta) return;
|
|
6795
|
+
let F = typeof _.view.meta.totalPages == "number" ? _.view.meta.totalPages : 1;
|
|
6771
6796
|
if (F !== i) return;
|
|
6772
6797
|
let V = async (b) => {
|
|
6773
6798
|
let y = {
|
|
@@ -6775,11 +6800,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6775
6800
|
page: b
|
|
6776
6801
|
};
|
|
6777
6802
|
try {
|
|
6778
|
-
let
|
|
6803
|
+
let C = await h(t, y), O = this.views.get(f);
|
|
6779
6804
|
if (!O) return;
|
|
6780
6805
|
let R = O.get(Qe(r));
|
|
6781
6806
|
if (!R || v != null && R.view.loadId !== v || R.view.loadId !== v) return;
|
|
6782
|
-
for (let U of
|
|
6807
|
+
for (let U of C.items) u.upsertEntity(U);
|
|
6783
6808
|
let ne = Qe(y), k = O.get(ne);
|
|
6784
6809
|
if (k || (k = {
|
|
6785
6810
|
params: y,
|
|
@@ -6791,8 +6816,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6791
6816
|
loadId: R.view.loadId
|
|
6792
6817
|
}
|
|
6793
6818
|
}, O.set(ne, k), this.cleanupOldViews(O)), !k.view.value || this.isExpired(k.view.updatedAt)) {
|
|
6794
|
-
k.view.value =
|
|
6795
|
-
let { items: U, ...D } =
|
|
6819
|
+
k.view.value = C.items.map((Z) => Z.id);
|
|
6820
|
+
let { items: U, ...D } = C;
|
|
6796
6821
|
k.view.meta = {
|
|
6797
6822
|
...D,
|
|
6798
6823
|
page: b,
|
|
@@ -6802,17 +6827,17 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6802
6827
|
} catch {}
|
|
6803
6828
|
};
|
|
6804
6829
|
if (o > 0 && a < F) for (let b = 1; b <= Math.min(o, F - a); b++) {
|
|
6805
|
-
let y = a + b,
|
|
6830
|
+
let y = a + b, C = Qe({
|
|
6806
6831
|
...r,
|
|
6807
6832
|
page: y
|
|
6808
|
-
}), O = w.get(
|
|
6833
|
+
}), O = w.get(C);
|
|
6809
6834
|
(!O?.view.value || this.isExpired(O.view.updatedAt)) && V(y);
|
|
6810
6835
|
}
|
|
6811
6836
|
if (d > 0 && a > 1) for (let b = 1; b <= Math.min(d, a - 1); b++) {
|
|
6812
|
-
let y = a - b,
|
|
6837
|
+
let y = a - b, C = Qe({
|
|
6813
6838
|
...r,
|
|
6814
6839
|
page: y
|
|
6815
|
-
}), O = w.get(
|
|
6840
|
+
}), O = w.get(C);
|
|
6816
6841
|
(!O?.view.value || this.isExpired(O.view.updatedAt)) && V(y);
|
|
6817
6842
|
}
|
|
6818
6843
|
} catch {}
|
|
@@ -6859,15 +6884,15 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6859
6884
|
};
|
|
6860
6885
|
break;
|
|
6861
6886
|
}
|
|
6862
|
-
let I = i - u.view.value.length,
|
|
6863
|
-
if (
|
|
6887
|
+
let I = i - u.view.value.length, _ = w.view.value.slice(0, I).filter((F) => o.getEntity(F));
|
|
6888
|
+
if (_.length === 0) {
|
|
6864
6889
|
u.view.meta = {
|
|
6865
6890
|
...u.view.meta ?? {},
|
|
6866
6891
|
stale: !0
|
|
6867
6892
|
};
|
|
6868
6893
|
break;
|
|
6869
6894
|
}
|
|
6870
|
-
if (u.view.value = [...u.view.value, ...
|
|
6895
|
+
if (u.view.value = [...u.view.value, ..._], u.view.updatedAt = Date.now(), w.view.value = w.view.value.slice(_.length), w.view.updatedAt = Date.now(), w.view.value.length === 0) {
|
|
6871
6896
|
let F = n + 1, V = w.view.meta;
|
|
6872
6897
|
if (F < (V && typeof V.totalPages == "number" ? V.totalPages : 1)) {
|
|
6873
6898
|
let b = Qe({
|
|
@@ -6921,7 +6946,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6921
6946
|
let w = h.view.meta && typeof h.view.meta.totalPages == "number" ? h.view.meta.totalPages : s;
|
|
6922
6947
|
if (!v && this.cascadeShiftToNextPage(t, h, a + 1, i, w, o, d)) return !0;
|
|
6923
6948
|
if (!h.view.value || h.view.value.length === 0) {
|
|
6924
|
-
let I = a + 1,
|
|
6949
|
+
let I = a + 1, _ = h.view.meta, F = _ && typeof _.totalPages == "number" ? _.totalPages : 1;
|
|
6925
6950
|
this.removeEmptyPageIfNeeded(t, h, I, F, d);
|
|
6926
6951
|
}
|
|
6927
6952
|
return v;
|
|
@@ -6985,9 +7010,9 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6985
7010
|
this.updateChildrenCountForOperation(a, r, s, i);
|
|
6986
7011
|
let d = this.parentKey(t), u = this.views.get(d);
|
|
6987
7012
|
if (u) for (let [, n] of u) {
|
|
6988
|
-
let h = n.params ?? {}, v = h?.page ?? 1, f = Dt(h?.pageSize), w = Number.isFinite(f), I = !!(h?.sortBy || h?.sortOrder),
|
|
7013
|
+
let h = n.params ?? {}, v = h?.page ?? 1, f = Dt(h?.pageSize), w = Number.isFinite(f), I = !!(h?.sortBy || h?.sortOrder), _ = !!h?.search, F = h?.itemType || "all";
|
|
6989
7014
|
if (this.isEntityTypeCompatible(r, F)) {
|
|
6990
|
-
if (
|
|
7015
|
+
if (_ && this.strategy.filterMatch && !this.strategy.filterMatch(r, n.params)) {
|
|
6991
7016
|
n.view.value?.includes(r.id) && (n.view.value = n.view.value.filter((V) => V !== r.id), n.view.meta && typeof n.view.meta.total == "number" && (n.view.meta.total = Math.max(0, n.view.meta.total - 1)), this.markViewStaleForReload(n));
|
|
6992
7017
|
continue;
|
|
6993
7018
|
}
|
|
@@ -7008,7 +7033,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7008
7033
|
this.handleInsert(u, n, v, f, w, I, r, i);
|
|
7009
7034
|
break;
|
|
7010
7035
|
case "update":
|
|
7011
|
-
this.handleUpdate(u, n, v, f, w, I,
|
|
7036
|
+
this.handleUpdate(u, n, v, f, w, I, _, r, i);
|
|
7012
7037
|
break;
|
|
7013
7038
|
case "move":
|
|
7014
7039
|
this.handleMove(u, n, v, f, w, I, r, s, i);
|
|
@@ -7187,7 +7212,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7187
7212
|
}
|
|
7188
7213
|
return o;
|
|
7189
7214
|
}
|
|
7190
|
-
},
|
|
7215
|
+
}, rs = class Wi {
|
|
7191
7216
|
invalidateChildrenCountCache(t) {
|
|
7192
7217
|
let r = Ge(t ?? "");
|
|
7193
7218
|
this.childrenCountPromises.delete(r), this.failedRequests.delete(mt.childrenCountKey(r));
|
|
@@ -7252,22 +7277,22 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7252
7277
|
let n = new Map();
|
|
7253
7278
|
for (let h of u) n.set(h, Ye());
|
|
7254
7279
|
for (let h of u) {
|
|
7255
|
-
let v = this.entities.getFolder(h), f = n.get(h), w = Ke(v), I = w === null ? r : n.get(w) ?? null,
|
|
7280
|
+
let v = this.entities.getFolder(h), f = n.get(h), w = Ke(v), I = w === null ? r : n.get(w) ?? null, _ = {
|
|
7256
7281
|
...v,
|
|
7257
7282
|
...h === t ? i : void 0,
|
|
7258
7283
|
id: f,
|
|
7259
7284
|
folderId: (h === t ? i?.folderId : void 0) ?? I
|
|
7260
7285
|
};
|
|
7261
|
-
this.entities.upsertEntity(
|
|
7286
|
+
this.entities.upsertEntity(_);
|
|
7262
7287
|
}
|
|
7263
7288
|
for (let h of u) {
|
|
7264
7289
|
let v = n.get(h), f = this.entities.getChildrenIds(h, { onlyFileSystemItems: !0 });
|
|
7265
7290
|
for (let w of f) {
|
|
7266
7291
|
let I = this.entities.getFileSystemItem(w);
|
|
7267
7292
|
if (!I) continue;
|
|
7268
|
-
let
|
|
7293
|
+
let _ = Ye(), F = {
|
|
7269
7294
|
...I,
|
|
7270
|
-
id:
|
|
7295
|
+
id: _,
|
|
7271
7296
|
folderId: v
|
|
7272
7297
|
};
|
|
7273
7298
|
this.entities.upsertEntity(F);
|
|
@@ -7416,8 +7441,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7416
7441
|
let s = a.getFolder(i)?.childrenCount;
|
|
7417
7442
|
s !== void 0 && s !== r && this.views.forceInvalidateChildrenViews(i), a.updateServerChildrenCount(i, r);
|
|
7418
7443
|
}
|
|
7419
|
-
},
|
|
7420
|
-
function
|
|
7444
|
+
}, is = "", as = "Trash", ls = "Edited", ri = 1e4, ii = 1e4, ai = 25, li = 10;
|
|
7445
|
+
function Ct(e, t) {
|
|
7421
7446
|
let r = e ?? {}, a = Array.isArray(r.detailed) ? r.detailed.map((i) => ({
|
|
7422
7447
|
requestId: i.requestId ?? i.id,
|
|
7423
7448
|
success: !!i.success,
|
|
@@ -7439,7 +7464,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7439
7464
|
name: Bt(e.name)
|
|
7440
7465
|
};
|
|
7441
7466
|
}
|
|
7442
|
-
function
|
|
7467
|
+
function ss(e) {
|
|
7443
7468
|
return (e ?? []).map(Ae);
|
|
7444
7469
|
}
|
|
7445
7470
|
function tt(e) {
|
|
@@ -7448,12 +7473,12 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7448
7473
|
name: Bt(e.name)
|
|
7449
7474
|
};
|
|
7450
7475
|
}
|
|
7451
|
-
function
|
|
7476
|
+
function os(e) {
|
|
7452
7477
|
return e ? e.replaceAll("\\", "/").split("/").filter(Boolean) : [];
|
|
7453
7478
|
}
|
|
7454
|
-
for (var
|
|
7479
|
+
for (var ns = class {
|
|
7455
7480
|
_getTrashPath() {
|
|
7456
|
-
return this._pathOptions.trashPath ||
|
|
7481
|
+
return this._pathOptions.trashPath || as;
|
|
7457
7482
|
}
|
|
7458
7483
|
_getPathLookupCandidates(e) {
|
|
7459
7484
|
return Zr(e, this._getTrashPath(), ft);
|
|
@@ -7480,7 +7505,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7480
7505
|
}
|
|
7481
7506
|
}
|
|
7482
7507
|
async _findOrCreateFolderByPath(e) {
|
|
7483
|
-
let t =
|
|
7508
|
+
let t = os(e);
|
|
7484
7509
|
if (t.length > li) throw new m.G("Path depth exceeds maximum limit of %s".replace("%s", String(li)), "ValidationError");
|
|
7485
7510
|
let r = await this._resolveFolderByPath(e);
|
|
7486
7511
|
if (r) return r;
|
|
@@ -7513,7 +7538,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7513
7538
|
return e;
|
|
7514
7539
|
}
|
|
7515
7540
|
async getTempFolder() {
|
|
7516
|
-
let e = this._pathOptions.tempPath ??
|
|
7541
|
+
let e = this._pathOptions.tempPath ?? ls;
|
|
7517
7542
|
if (e) try {
|
|
7518
7543
|
return await this._findOrCreateFolderByPath(e);
|
|
7519
7544
|
} catch (t) {
|
|
@@ -7522,7 +7547,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7522
7547
|
}
|
|
7523
7548
|
}
|
|
7524
7549
|
constructor(e, t = {}, r, a = {}) {
|
|
7525
|
-
this._dataProvider = e, this._options = t, this._pathOptions = r, this._blobFetchForceReloadOnceIds = new Set(), this._mutationRegistry = new
|
|
7550
|
+
this._dataProvider = e, this._options = t, this._pathOptions = r, this._blobFetchForceReloadOnceIds = new Set(), this._mutationRegistry = new Hl(), this._mapItem = async ({ childrenCount: s, ...o }) => {
|
|
7526
7551
|
let d = Ae(o);
|
|
7527
7552
|
if (d.isFolder) return {
|
|
7528
7553
|
...d,
|
|
@@ -7537,7 +7562,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7537
7562
|
url: u,
|
|
7538
7563
|
thumbnailUrl: n
|
|
7539
7564
|
};
|
|
7540
|
-
}, this._config = a, this._useSoftDelete = this._pathOptions.useSoftDelete, this._rootId = this._pathOptions.rootId ||
|
|
7565
|
+
}, this._config = a, this._useSoftDelete = this._pathOptions.useSoftDelete, this._rootId = this._pathOptions.rootId || is, this._enableTrash = this._options.enableTrash === void 0 || this._options.enableTrash, this._validateDuplicates = this._dataProvider.validateDuplicates, this._cache = new rs(t.cacheStrategy || {}, t.cacheStrategy?.ttl, t.cacheStrategy?.errorTtl), this.setController({
|
|
7541
7566
|
invalidateItemCache: (s) => {
|
|
7542
7567
|
this._cache.forceInvalidate(s);
|
|
7543
7568
|
},
|
|
@@ -7673,19 +7698,19 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7673
7698
|
}
|
|
7674
7699
|
async getFiles({ folderId: e, search: t, sortBy: r, sortOrder: a, page: i, limit: s, itemType: o = "all", noFolder: d = !1 }) {
|
|
7675
7700
|
d && (e = (await this.getTempFolder())?.id);
|
|
7676
|
-
let u = this.normalizeId(e ?? this._rootId), n = this._options.enablePagination === !1, h = n ? 1 : i, v = n ? ri : s, f = this._options.clientSideFilter, w = this._options.clientSideSorting, I = this._options.clientSidePaging,
|
|
7701
|
+
let u = this.normalizeId(e ?? this._rootId), n = this._options.enablePagination === !1, h = n ? 1 : i, v = n ? ri : s, f = this._options.clientSideFilter, w = this._options.clientSideSorting, I = this._options.clientSidePaging, _ = I ? Math.max(1, i ?? 1) : void 0, F = I ? typeof s == "number" && Number.isFinite(s) && s > 0 ? s : ai : void 0, V = this._emptyFilesResult(I ? _ : h, I ? F : v);
|
|
7677
7702
|
if (this._isDeletingId(u)) return V;
|
|
7678
|
-
let b = this._options.unifiedCatalogFetch !== !1 && n && (o === "folder" || o === "file"), y = b ? "all" : o,
|
|
7703
|
+
let b = this._options.unifiedCatalogFetch !== !1 && n && (o === "folder" || o === "file"), y = b ? "all" : o, C = {
|
|
7679
7704
|
folderId: u,
|
|
7680
7705
|
itemType: y
|
|
7681
7706
|
};
|
|
7682
|
-
f || (
|
|
7707
|
+
f || (C.search = t), w || (C.sortBy = r ?? (y === "folder" ? void 0 : "date"), C.sortOrder = a ?? (y === "folder" ? void 0 : "desc")), I || (C.page = h, C.limit = b ? ii : v);
|
|
7683
7708
|
let O = b ? ii : I ? void 0 : v, R = {
|
|
7684
7709
|
folderId: u,
|
|
7685
7710
|
itemType: y,
|
|
7686
7711
|
search: f ? void 0 : t,
|
|
7687
|
-
sortBy: w ? void 0 :
|
|
7688
|
-
sortOrder: w ? void 0 :
|
|
7712
|
+
sortBy: w ? void 0 : C.sortBy,
|
|
7713
|
+
sortOrder: w ? void 0 : C.sortOrder,
|
|
7689
7714
|
page: I ? void 0 : h,
|
|
7690
7715
|
pageSize: O
|
|
7691
7716
|
}, ne;
|
|
@@ -7695,7 +7720,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7695
7720
|
...Y,
|
|
7696
7721
|
folderId: $,
|
|
7697
7722
|
limit: W
|
|
7698
|
-
}), le =
|
|
7723
|
+
}), le = ss(J.items);
|
|
7699
7724
|
return I ? {
|
|
7700
7725
|
items: le,
|
|
7701
7726
|
total: typeof J.pagination?.total == "number" ? J.pagination.total : le.length
|
|
@@ -7720,9 +7745,9 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7720
7745
|
let U;
|
|
7721
7746
|
U = I || f || b ? k.length : ne.total ?? k.length;
|
|
7722
7747
|
let D = k;
|
|
7723
|
-
if (I) if (typeof this._options.clientSidePaging == "function") D = this._options.clientSidePaging(k,
|
|
7748
|
+
if (I) if (typeof this._options.clientSidePaging == "function") D = this._options.clientSidePaging(k, _, F);
|
|
7724
7749
|
else {
|
|
7725
|
-
let $ = (
|
|
7750
|
+
let $ = (_ - 1) * F, Y = $ + F;
|
|
7726
7751
|
D = k.slice($, Y);
|
|
7727
7752
|
}
|
|
7728
7753
|
if (typeof this._dataProvider.getUrl == "function" || typeof this._dataProvider.getThumbnailUrl == "function") {
|
|
@@ -7738,12 +7763,12 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7738
7763
|
D = await Promise.all($);
|
|
7739
7764
|
}
|
|
7740
7765
|
let Z = I ? {
|
|
7741
|
-
page:
|
|
7766
|
+
page: _,
|
|
7742
7767
|
limit: F,
|
|
7743
7768
|
total: U,
|
|
7744
7769
|
totalPages: Math.max(1, Math.ceil(U / F)),
|
|
7745
|
-
hasNext:
|
|
7746
|
-
hasPrev:
|
|
7770
|
+
hasNext: _ * F < U,
|
|
7771
|
+
hasPrev: _ > 1
|
|
7747
7772
|
} : {
|
|
7748
7773
|
page: h,
|
|
7749
7774
|
limit: v,
|
|
@@ -7871,7 +7896,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7871
7896
|
folderId: i,
|
|
7872
7897
|
items: o
|
|
7873
7898
|
});
|
|
7874
|
-
s =
|
|
7899
|
+
s = Ct(d, (n) => {
|
|
7875
7900
|
if (n) return {
|
|
7876
7901
|
id: n.id,
|
|
7877
7902
|
name: Bt(n.name),
|
|
@@ -7960,7 +7985,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7960
7985
|
detailed: []
|
|
7961
7986
|
}, a = t.permanent ? null : await this.getTrashFolder();
|
|
7962
7987
|
if (typeof this._dataProvider.deleteItems == "function") {
|
|
7963
|
-
if (r =
|
|
7988
|
+
if (r = Ct(await this._dataProvider.deleteItems(e.map((i) => this._cache.getEntity(i)), t), (i) => i), r.success) {
|
|
7964
7989
|
let i = r.detailed || e.map((s) => ({
|
|
7965
7990
|
requestId: s,
|
|
7966
7991
|
success: !0,
|
|
@@ -8146,7 +8171,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8146
8171
|
detailed: Array(a.length),
|
|
8147
8172
|
success: !0
|
|
8148
8173
|
};
|
|
8149
|
-
if (typeof this._dataProvider.moveItems == "function") i =
|
|
8174
|
+
if (typeof this._dataProvider.moveItems == "function") i = Ct(await this._dataProvider.moveItems(a, r), (s) => s);
|
|
8150
8175
|
else if (typeof this._dataProvider.moveItem == "function") i.detailed = await Promise.all(t.map(async (s, o) => {
|
|
8151
8176
|
let d = a[o] || {
|
|
8152
8177
|
id: s,
|
|
@@ -8249,7 +8274,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8249
8274
|
detailed: Array(s.length),
|
|
8250
8275
|
success: !0
|
|
8251
8276
|
};
|
|
8252
|
-
if (typeof this._dataProvider.copyItems == "function") o =
|
|
8277
|
+
if (typeof this._dataProvider.copyItems == "function") o = Ct(await this._dataProvider.copyItems(s, r), (d) => d);
|
|
8253
8278
|
else if (typeof this._dataProvider.copyItem == "function") o.detailed = await Promise.all(i.map(async (d, u) => {
|
|
8254
8279
|
let n = s[u] || {
|
|
8255
8280
|
id: d,
|
|
@@ -8322,28 +8347,28 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8322
8347
|
})), this._cache.getEntity(r);
|
|
8323
8348
|
}
|
|
8324
8349
|
}, Ve = [], zt = 0; zt < 256; ++zt) Ve.push((zt + 256).toString(16).slice(1));
|
|
8325
|
-
function
|
|
8350
|
+
function ds(e, t = 0) {
|
|
8326
8351
|
return (Ve[e[t + 0]] + Ve[e[t + 1]] + Ve[e[t + 2]] + Ve[e[t + 3]] + "-" + Ve[e[t + 4]] + Ve[e[t + 5]] + "-" + Ve[e[t + 6]] + Ve[e[t + 7]] + "-" + Ve[e[t + 8]] + Ve[e[t + 9]] + "-" + Ve[e[t + 10]] + Ve[e[t + 11]] + Ve[e[t + 12]] + Ve[e[t + 13]] + Ve[e[t + 14]] + Ve[e[t + 15]]).toLowerCase();
|
|
8327
8352
|
}
|
|
8328
|
-
var Ft,
|
|
8329
|
-
function
|
|
8353
|
+
var Ft, cs = new Uint8Array(16);
|
|
8354
|
+
function us() {
|
|
8330
8355
|
if (!Ft && (Ft = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ft)) throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
8331
|
-
return Ft(
|
|
8356
|
+
return Ft(cs);
|
|
8332
8357
|
}
|
|
8333
8358
|
var si = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
|
|
8334
|
-
function
|
|
8359
|
+
function hs(e, t, r) {
|
|
8335
8360
|
if (si.randomUUID && !t && !e) return si.randomUUID();
|
|
8336
8361
|
e ||= {};
|
|
8337
|
-
var a = e.random || (e.rng ||
|
|
8362
|
+
var a = e.random || (e.rng || us)();
|
|
8338
8363
|
if (a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, t) {
|
|
8339
8364
|
r ||= 0;
|
|
8340
8365
|
for (var i = 0; i < 16; ++i) t[r + i] = a[i];
|
|
8341
8366
|
return t;
|
|
8342
8367
|
}
|
|
8343
|
-
return
|
|
8368
|
+
return ds(a);
|
|
8344
8369
|
}
|
|
8345
|
-
var
|
|
8346
|
-
constructor(e, t =
|
|
8370
|
+
var ms = "", fs = "Trash", ps = class {
|
|
8371
|
+
constructor(e, t = ms, r = ft, a = fs, i = !0) {
|
|
8347
8372
|
this._inner = e, this.rootPath = t, this.trashId = r, this.trashPath = a, this.ensureFolderTrailingSlash = i, this._pathToId = new Map(), this._idToPath = new Map(), this.validateDuplicates = this._inner.validateDuplicates ?? !1, typeof e.getUrl == "function" && (this.getUrl = (o) => e.getUrl({
|
|
8348
8373
|
...o,
|
|
8349
8374
|
id: this.pathForId(o.id, !1),
|
|
@@ -8404,7 +8429,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8404
8429
|
let t = He(e);
|
|
8405
8430
|
if (t === He(this.trashPath)) return this.trashId;
|
|
8406
8431
|
if (this._pathToId.has(t)) return this._pathToId.get(t);
|
|
8407
|
-
let r =
|
|
8432
|
+
let r = hs();
|
|
8408
8433
|
return this._pathToId.set(t, r), this._idToPath.set(r, t), r;
|
|
8409
8434
|
}
|
|
8410
8435
|
pathForId(e, t, r) {
|
|
@@ -8800,14 +8825,14 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8800
8825
|
if (typeof this._inner.cleanTrash != "function") throw new m.G("Clean trash is not supported by inner storage", "UnsupportedOperation");
|
|
8801
8826
|
return await this._inner.cleanTrash();
|
|
8802
8827
|
}
|
|
8803
|
-
}, oi = (0, c.createContext)(null),
|
|
8804
|
-
const t =
|
|
8828
|
+
}, oi = (0, c.createContext)(null), gs = (e) => e.includes("UPLOAD_IMAGE_") || e.includes("UPLOAD_BACKGROUND_"), ys = ({ children: e }) => {
|
|
8829
|
+
const t = Ee.useDispatch(), r = Ee.useSelector(Pt.selectActiveModal), [a, i] = (0, c.useState)(null), s = (0, c.useRef)(null), o = (0, c.useCallback)((n) => {
|
|
8805
8830
|
s.current?.(n), s.current = null;
|
|
8806
8831
|
}, []), d = (0, c.useCallback)((n) => (o(null), i(n), t(Pt.openModal(n.entryModal)), new Promise((h) => {
|
|
8807
8832
|
s.current = h;
|
|
8808
8833
|
})), [t, o]);
|
|
8809
8834
|
(0, c.useEffect)(() => {
|
|
8810
|
-
|
|
8835
|
+
gs(r) || (i(null), s.current && o(null));
|
|
8811
8836
|
}, [r, o]);
|
|
8812
8837
|
const u = (0, c.useMemo)(() => ({
|
|
8813
8838
|
request: a,
|
|
@@ -8822,135 +8847,155 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8822
8847
|
value: u,
|
|
8823
8848
|
children: e
|
|
8824
8849
|
});
|
|
8825
|
-
},
|
|
8850
|
+
}, vs = () => {
|
|
8826
8851
|
const e = (0, c.useContext)(oi);
|
|
8827
8852
|
if (!e) throw new Error("useImagePicker must be used within ImagePickerProvider");
|
|
8828
8853
|
return e;
|
|
8829
8854
|
};
|
|
8830
|
-
Object.defineProperty(
|
|
8855
|
+
Object.defineProperty(ye, "Bi", {
|
|
8831
8856
|
enumerable: !0,
|
|
8832
8857
|
get: function() {
|
|
8833
8858
|
return ft;
|
|
8834
8859
|
}
|
|
8835
|
-
}), Object.defineProperty(
|
|
8860
|
+
}), Object.defineProperty(ye, "Ci", {
|
|
8836
8861
|
enumerable: !0,
|
|
8837
8862
|
get: function() {
|
|
8838
|
-
return
|
|
8863
|
+
return ql;
|
|
8839
8864
|
}
|
|
8840
|
-
}), Object.defineProperty(
|
|
8865
|
+
}), Object.defineProperty(ye, "EmIcons", {
|
|
8841
8866
|
enumerable: !0,
|
|
8842
8867
|
get: function() {
|
|
8843
8868
|
return dt;
|
|
8844
8869
|
}
|
|
8845
|
-
}), Object.defineProperty(
|
|
8870
|
+
}), Object.defineProperty(ye, "Gi", {
|
|
8846
8871
|
enumerable: !0,
|
|
8847
8872
|
get: function() {
|
|
8848
8873
|
return Ot;
|
|
8849
8874
|
}
|
|
8850
|
-
}), Object.defineProperty(
|
|
8875
|
+
}), Object.defineProperty(ye, "ImagePickerProvider", {
|
|
8851
8876
|
enumerable: !0,
|
|
8852
8877
|
get: function() {
|
|
8853
|
-
return
|
|
8878
|
+
return ys;
|
|
8854
8879
|
}
|
|
8855
|
-
}), Object.defineProperty(
|
|
8880
|
+
}), Object.defineProperty(ye, "LIMIT_TYPE_TO_USAGE_CARD_ICON", {
|
|
8856
8881
|
enumerable: !0,
|
|
8857
8882
|
get: function() {
|
|
8858
8883
|
return sr;
|
|
8859
8884
|
}
|
|
8860
|
-
}), Object.defineProperty(
|
|
8885
|
+
}), Object.defineProperty(ye, "LimitUpgradeModal", {
|
|
8861
8886
|
enumerable: !0,
|
|
8862
8887
|
get: function() {
|
|
8863
|
-
return
|
|
8888
|
+
return sa;
|
|
8864
8889
|
}
|
|
8865
|
-
}), Object.defineProperty(
|
|
8890
|
+
}), Object.defineProperty(ye, "Oa", {
|
|
8866
8891
|
enumerable: !0,
|
|
8867
8892
|
get: function() {
|
|
8868
|
-
return
|
|
8893
|
+
return ps;
|
|
8869
8894
|
}
|
|
8870
|
-
}), Object.defineProperty(
|
|
8895
|
+
}), Object.defineProperty(ye, "PlanUpgradePrompt", {
|
|
8871
8896
|
enumerable: !0,
|
|
8872
8897
|
get: function() {
|
|
8873
|
-
return
|
|
8898
|
+
return la;
|
|
8874
8899
|
}
|
|
8875
|
-
}), Object.defineProperty(
|
|
8900
|
+
}), Object.defineProperty(ye, "Ui", {
|
|
8876
8901
|
enumerable: !0,
|
|
8877
8902
|
get: function() {
|
|
8878
|
-
return
|
|
8903
|
+
return Xl;
|
|
8879
8904
|
}
|
|
8880
|
-
}), Object.defineProperty(
|
|
8905
|
+
}), Object.defineProperty(ye, "_a", {
|
|
8881
8906
|
enumerable: !0,
|
|
8882
8907
|
get: function() {
|
|
8883
|
-
return
|
|
8908
|
+
return ns;
|
|
8884
8909
|
}
|
|
8885
|
-
}), Object.defineProperty(
|
|
8910
|
+
}), Object.defineProperty(ye, "fireUploadImageEvent", {
|
|
8886
8911
|
enumerable: !0,
|
|
8887
8912
|
get: function() {
|
|
8888
|
-
return
|
|
8913
|
+
return ga;
|
|
8889
8914
|
}
|
|
8890
|
-
}), Object.defineProperty(
|
|
8915
|
+
}), Object.defineProperty(ye, "getLimitUpgradePresetDefinition", {
|
|
8916
|
+
enumerable: !0,
|
|
8917
|
+
get: function() {
|
|
8918
|
+
return na;
|
|
8919
|
+
}
|
|
8920
|
+
}), Object.defineProperty(ye, "getMyProjectRole", {
|
|
8891
8921
|
enumerable: !0,
|
|
8892
8922
|
get: function() {
|
|
8893
8923
|
return tr;
|
|
8894
8924
|
}
|
|
8895
|
-
}), Object.defineProperty(
|
|
8925
|
+
}), Object.defineProperty(ye, "isEditorLockedByPlan", {
|
|
8896
8926
|
enumerable: !0,
|
|
8897
8927
|
get: function() {
|
|
8898
8928
|
return rr;
|
|
8899
8929
|
}
|
|
8900
|
-
}), Object.defineProperty(
|
|
8930
|
+
}), Object.defineProperty(ye, "isLimitStatsBlockExhausted", {
|
|
8901
8931
|
enumerable: !0,
|
|
8902
8932
|
get: function() {
|
|
8903
8933
|
return nr;
|
|
8904
8934
|
}
|
|
8905
|
-
}), Object.defineProperty(
|
|
8935
|
+
}), Object.defineProperty(ye, "pickFileProxyBlobFromFireResults", {
|
|
8906
8936
|
enumerable: !0,
|
|
8907
8937
|
get: function() {
|
|
8908
|
-
return
|
|
8938
|
+
return ma;
|
|
8909
8939
|
}
|
|
8910
|
-
}), Object.defineProperty(
|
|
8940
|
+
}), Object.defineProperty(ye, "pickProxyUrlOverrideFromFireResults", {
|
|
8911
8941
|
enumerable: !0,
|
|
8912
8942
|
get: function() {
|
|
8913
|
-
return
|
|
8943
|
+
return fa;
|
|
8914
8944
|
}
|
|
8915
|
-
}), Object.defineProperty(
|
|
8945
|
+
}), Object.defineProperty(ye, "presetLimitDisplay", {
|
|
8916
8946
|
enumerable: !0,
|
|
8917
8947
|
get: function() {
|
|
8918
|
-
return
|
|
8948
|
+
return da;
|
|
8919
8949
|
}
|
|
8920
|
-
}), Object.defineProperty(
|
|
8950
|
+
}), Object.defineProperty(ye, "resolveLimitActionPreflightExceeded", {
|
|
8921
8951
|
enumerable: !0,
|
|
8922
8952
|
get: function() {
|
|
8923
|
-
return
|
|
8953
|
+
return dr;
|
|
8924
8954
|
}
|
|
8925
|
-
}), Object.defineProperty(
|
|
8955
|
+
}), Object.defineProperty(ye, "resolveLimitActionPreflightExceededForType", {
|
|
8926
8956
|
enumerable: !0,
|
|
8927
8957
|
get: function() {
|
|
8928
|
-
return
|
|
8958
|
+
return ua;
|
|
8929
8959
|
}
|
|
8930
|
-
}), Object.defineProperty(
|
|
8960
|
+
}), Object.defineProperty(ye, "resolvePluginRouteEmailId", {
|
|
8931
8961
|
enumerable: !0,
|
|
8932
8962
|
get: function() {
|
|
8933
|
-
return
|
|
8963
|
+
return qi;
|
|
8934
8964
|
}
|
|
8935
|
-
}), Object.defineProperty(
|
|
8965
|
+
}), Object.defineProperty(ye, "sanitizeHtml", {
|
|
8936
8966
|
enumerable: !0,
|
|
8937
8967
|
get: function() {
|
|
8938
8968
|
return ar;
|
|
8939
8969
|
}
|
|
8940
|
-
}), Object.defineProperty(
|
|
8970
|
+
}), Object.defineProperty(ye, "shouldFallbackToBuiltInUpload", {
|
|
8971
|
+
enumerable: !0,
|
|
8972
|
+
get: function() {
|
|
8973
|
+
return ya;
|
|
8974
|
+
}
|
|
8975
|
+
}), Object.defineProperty(ye, "toUploadImageError", {
|
|
8976
|
+
enumerable: !0,
|
|
8977
|
+
get: function() {
|
|
8978
|
+
return va;
|
|
8979
|
+
}
|
|
8980
|
+
}), Object.defineProperty(ye, "useCookieManager", {
|
|
8941
8981
|
enumerable: !0,
|
|
8942
8982
|
get: function() {
|
|
8943
8983
|
return ir;
|
|
8944
8984
|
}
|
|
8945
|
-
}), Object.defineProperty(
|
|
8985
|
+
}), Object.defineProperty(ye, "useImagePicker", {
|
|
8986
|
+
enumerable: !0,
|
|
8987
|
+
get: function() {
|
|
8988
|
+
return vs;
|
|
8989
|
+
}
|
|
8990
|
+
}), Object.defineProperty(ye, "useRouteEmailId", {
|
|
8946
8991
|
enumerable: !0,
|
|
8947
8992
|
get: function() {
|
|
8948
|
-
return
|
|
8993
|
+
return Hi;
|
|
8949
8994
|
}
|
|
8950
|
-
}), Object.defineProperty(
|
|
8995
|
+
}), Object.defineProperty(ye, "vi", {
|
|
8951
8996
|
enumerable: !0,
|
|
8952
8997
|
get: function() {
|
|
8953
|
-
return
|
|
8998
|
+
return $l;
|
|
8954
8999
|
}
|
|
8955
9000
|
});
|
|
8956
9001
|
});
|