@scaleflex/uploader 0.2.0 → 0.2.1
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 +1 -1
- package/dist/auth/auth.service.d.ts +1 -1
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.types.d.ts +1 -9
- package/dist/auth/auth.types.d.ts.map +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/define.cjs +1 -1
- package/dist/define.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{provider-browser-CUbPlWmj.js → provider-browser-ixqCA0XP.js} +1 -1
- package/dist/{provider-browser-D7G2wcFH.cjs → provider-browser-yW3pZFSP.cjs} +1 -1
- package/dist/{search-provider-browser-D_kyqQ2m.js → search-provider-browser-B5ZWGUl8.js} +1 -1
- package/dist/{search-provider-browser-uDZrkDBZ.cjs → search-provider-browser-BrKVwGf_.cjs} +1 -1
- package/dist/{sfx-uploader-Cxz9YHev.js → sfx-uploader-CU9IwNC7.js} +69 -72
- package/dist/{sfx-uploader-DbaSJxEf.cjs → sfx-uploader-ziRTzw0k.cjs} +112 -112
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement as E, css as y, svg as
|
|
1
|
+
import { LitElement as E, css as y, svg as j, html as c, nothing as u } from "lit";
|
|
2
2
|
import { property as b, state as x, query as Se } from "lit/decorators.js";
|
|
3
3
|
import { unsafeSVG as F } from "lit/directives/unsafe-svg.js";
|
|
4
4
|
import { unsafeHTML as A } from "lit/directives/unsafe-html.js";
|
|
@@ -39,7 +39,7 @@ function S(a, e, t) {
|
|
|
39
39
|
const s = new Map(r);
|
|
40
40
|
s.set(e, { ...i, ...t }), a.setState({ files: s });
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function M(a, e) {
|
|
43
43
|
const t = new Map(a.getState().files);
|
|
44
44
|
t.set(e.id, e), a.setState({ files: t });
|
|
45
45
|
}
|
|
@@ -190,15 +190,15 @@ const Fe = {
|
|
|
190
190
|
facebook: "facebook",
|
|
191
191
|
unsplash: "unsplash"
|
|
192
192
|
};
|
|
193
|
-
function
|
|
193
|
+
function V(a) {
|
|
194
194
|
return Fe[a] ?? a;
|
|
195
195
|
}
|
|
196
196
|
function xt(a, e) {
|
|
197
|
-
const t = H(a), r = btoa(JSON.stringify({ origin: window.location.origin })), i =
|
|
197
|
+
const t = H(a), r = btoa(JSON.stringify({ origin: window.location.origin })), i = V(e);
|
|
198
198
|
return `${t}/${i}/connect?state=${encodeURIComponent(r)}`;
|
|
199
199
|
}
|
|
200
200
|
async function vt(a, e, t, r = "") {
|
|
201
|
-
const i = H(a), s = r ? `/${r}` : "", o =
|
|
201
|
+
const i = H(a), s = r ? `/${r}` : "", o = V(e), n = await fetch(`${i}/${o}/list${s}`, {
|
|
202
202
|
method: "GET",
|
|
203
203
|
headers: Z(t),
|
|
204
204
|
credentials: "same-origin"
|
|
@@ -226,7 +226,7 @@ async function bt(a, e, t) {
|
|
|
226
226
|
return i.json();
|
|
227
227
|
}
|
|
228
228
|
async function mt(a, e, t, r) {
|
|
229
|
-
const i = H(a), s =
|
|
229
|
+
const i = H(a), s = V(e), o = r ? `q=${encodeURIComponent(t)}&${r}` : `q=${encodeURIComponent(t)}`, n = await fetch(`${i}/search/${s}/list?${o}`, {
|
|
230
230
|
method: "GET",
|
|
231
231
|
headers: {
|
|
232
232
|
Accept: "application/json",
|
|
@@ -241,7 +241,7 @@ async function mt(a, e, t, r) {
|
|
|
241
241
|
return n.json();
|
|
242
242
|
}
|
|
243
243
|
async function Re(a, e, t, r, i, s = !1) {
|
|
244
|
-
const o = H(a), n =
|
|
244
|
+
const o = H(a), n = V(e), l = s ? `${o}/search/${n}/get/${r}` : `${o}/${n}/get/${r}`, d = s ? { Accept: "application/json", "Content-Type": "application/json" } : Z(t), h = await fetch(l, {
|
|
245
245
|
method: "POST",
|
|
246
246
|
headers: d,
|
|
247
247
|
credentials: "same-origin",
|
|
@@ -261,14 +261,14 @@ async function Re(a, e, t, r, i, s = !1) {
|
|
|
261
261
|
return h.json();
|
|
262
262
|
}
|
|
263
263
|
async function wt(a, e, t) {
|
|
264
|
-
const r = H(a), i =
|
|
264
|
+
const r = H(a), i = V(e), s = await fetch(`${r}/${i}/logout`, {
|
|
265
265
|
method: "GET",
|
|
266
266
|
headers: Z(t),
|
|
267
267
|
credentials: "same-origin"
|
|
268
268
|
});
|
|
269
269
|
return s.ok ? s.json() : { ok: !1, revoked: !1 };
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Oe(a) {
|
|
272
272
|
var i;
|
|
273
273
|
const t = ((i = /^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(a)) == null ? void 0 : i[1]) ?? a;
|
|
274
274
|
return `${location.protocol === "https:" ? "wss" : "ws"}://${t}`;
|
|
@@ -278,7 +278,7 @@ class oe extends Error {
|
|
|
278
278
|
super("Authentication expired"), this.name = "AuthExpiredError";
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Te(a, e) {
|
|
282
282
|
const t = a.remoteInfo;
|
|
283
283
|
if (!t)
|
|
284
284
|
return e.onError(new Error("remoteInfo is required for companion upload")), { abort() {
|
|
@@ -295,7 +295,7 @@ function Oe(a, e) {
|
|
|
295
295
|
metadata: Object.keys(n).length > 0 ? n : void 0
|
|
296
296
|
}, l).then((d) => {
|
|
297
297
|
if (r) return;
|
|
298
|
-
const f = `${
|
|
298
|
+
const f = `${Oe(t.companionUrl)}/api/${d.token}`;
|
|
299
299
|
try {
|
|
300
300
|
i = new WebSocket(f);
|
|
301
301
|
} catch {
|
|
@@ -306,15 +306,15 @@ function Oe(a, e) {
|
|
|
306
306
|
var g, w, m;
|
|
307
307
|
if (!r)
|
|
308
308
|
try {
|
|
309
|
-
const
|
|
310
|
-
switch (
|
|
309
|
+
const T = JSON.parse(p.data);
|
|
310
|
+
switch (T.action) {
|
|
311
311
|
case "progress": {
|
|
312
|
-
const _ =
|
|
312
|
+
const _ = T.payload, D = _.bytesUploaded ?? 0, Y = _.bytesTotal ?? (t.size || 1);
|
|
313
313
|
e.onProgress(D, Y);
|
|
314
314
|
break;
|
|
315
315
|
}
|
|
316
316
|
case "success": {
|
|
317
|
-
const _ =
|
|
317
|
+
const _ = T.payload;
|
|
318
318
|
if (i == null || i.close(), (g = _.response) != null && g.responseText)
|
|
319
319
|
try {
|
|
320
320
|
const D = JSON.parse(_.response.responseText);
|
|
@@ -331,7 +331,7 @@ function Oe(a, e) {
|
|
|
331
331
|
}
|
|
332
332
|
case "error": {
|
|
333
333
|
i == null || i.close();
|
|
334
|
-
const _ =
|
|
334
|
+
const _ = T.payload;
|
|
335
335
|
let D = ((w = _.error) == null ? void 0 : w.message) || "Upload failed";
|
|
336
336
|
if ((m = _.response) != null && m.responseText)
|
|
337
337
|
try {
|
|
@@ -364,7 +364,7 @@ function Oe(a, e) {
|
|
|
364
364
|
}
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
|
-
class
|
|
367
|
+
class Me {
|
|
368
368
|
constructor(e, t) {
|
|
369
369
|
this.activeUploads = /* @__PURE__ */ new Map(), this.retryTimers = /* @__PURE__ */ new Map(), this.unsubscribe = null, this.store = e, this.config = t;
|
|
370
370
|
}
|
|
@@ -476,7 +476,7 @@ class je {
|
|
|
476
476
|
S(this.store, e.id, { progress: p, bytesUploaded: l, speed: i }), this.updateTotalProgress();
|
|
477
477
|
};
|
|
478
478
|
let n;
|
|
479
|
-
e.remoteInfo ? n =
|
|
479
|
+
e.remoteInfo ? n = Te(e, { ...s, onProgress: o }) : e.remoteUrl ? n = ze(e, s) : n = De(e, { ...s, onProgress: o }), this.activeUploads.set(e.id, n);
|
|
480
480
|
}
|
|
481
481
|
handleComplete(e, t) {
|
|
482
482
|
this.activeUploads.delete(e), S(this.store, e, {
|
|
@@ -541,7 +541,7 @@ function we(a) {
|
|
|
541
541
|
function ae(a) {
|
|
542
542
|
return `https://api.filerobot.com/${a}`;
|
|
543
543
|
}
|
|
544
|
-
async function
|
|
544
|
+
async function Le(a, e) {
|
|
545
545
|
const t = `${ae(a)}/key/${encodeURIComponent(e)}`, r = new AbortController(), i = setTimeout(() => r.abort(), 3e4);
|
|
546
546
|
try {
|
|
547
547
|
const s = await fetch(t, { signal: r.signal });
|
|
@@ -568,16 +568,13 @@ function ee(a, e) {
|
|
|
568
568
|
case "sass-key":
|
|
569
569
|
t["X-Filerobot-Key"] = a.sassKey;
|
|
570
570
|
break;
|
|
571
|
-
case "session":
|
|
572
|
-
t["X-Filerobot-Session"] = a.sessionToken, a.companyToken && (t["X-Company-Token"] = a.companyToken), a.projectToken && (t["X-Project-Token"] = a.projectToken);
|
|
573
|
-
break;
|
|
574
571
|
}
|
|
575
572
|
return a.airboxPuid && (t["X-Filerobot-Airbox-Puid"] = a.airboxPuid), t;
|
|
576
573
|
}
|
|
577
|
-
async function
|
|
574
|
+
async function je(a) {
|
|
578
575
|
const e = ae(a.container);
|
|
579
576
|
if (a.mode === "security-template") {
|
|
580
|
-
const t = await
|
|
577
|
+
const t = await Le(a.container, a.securityTemplateId);
|
|
581
578
|
return { apiBase: e, headers: ee(a, t), sassKey: t };
|
|
582
579
|
}
|
|
583
580
|
return { apiBase: e, headers: ee(a) };
|
|
@@ -602,7 +599,7 @@ const v = {
|
|
|
602
599
|
FILL_METADATA: "sfx-fill-metadata"
|
|
603
600
|
};
|
|
604
601
|
let Ae = 0;
|
|
605
|
-
function
|
|
602
|
+
function L() {
|
|
606
603
|
return `file-${Date.now()}-${++Ae}`;
|
|
607
604
|
}
|
|
608
605
|
function J(a) {
|
|
@@ -701,7 +698,7 @@ function te(a, e, t) {
|
|
|
701
698
|
function Ne(a, e, t) {
|
|
702
699
|
return te(a, e, t);
|
|
703
700
|
}
|
|
704
|
-
function
|
|
701
|
+
function Ve(a) {
|
|
705
702
|
return a.allowedFileTypes ? a.allowedFileTypes.join(",") : "";
|
|
706
703
|
}
|
|
707
704
|
const ye = {
|
|
@@ -755,7 +752,7 @@ const ye = {
|
|
|
755
752
|
brandHtml: '<span class="brand-ico" style="background:#111"><svg width="12" height="12" viewBox="0 0 24 24" fill="white"><path d="M8.5 11.5v5h7v-5h5.5V21h-18v-9.5h5.5zm7-8v5h-7v-5h7z"/></svg></span>'
|
|
756
753
|
}
|
|
757
754
|
};
|
|
758
|
-
function
|
|
755
|
+
function Xe(a) {
|
|
759
756
|
return a.filter((e) => e in ye).map((e) => ye[e]);
|
|
760
757
|
}
|
|
761
758
|
var We = Object.defineProperty, Ke = (a, e, t, r) => {
|
|
@@ -786,7 +783,7 @@ const Je = '<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21
|
|
|
786
783
|
${this.sources.map(
|
|
787
784
|
(e) => c`
|
|
788
785
|
<button @click=${() => this._handleClick(e)}>
|
|
789
|
-
${e.brandHtml ? A(e.brandHtml) :
|
|
786
|
+
${e.brandHtml ? A(e.brandHtml) : j`<svg viewBox="0 0 24 24" class=${e.fillIcon ? "fill-icon" : ""}>${F(e.icon)}</svg>`}
|
|
790
787
|
${e.label}
|
|
791
788
|
</button>
|
|
792
789
|
`
|
|
@@ -979,7 +976,7 @@ const _e = 3, de = class de extends E {
|
|
|
979
976
|
}}
|
|
980
977
|
>
|
|
981
978
|
${e.brandHtml ? A(e.brandHtml) : c`<span class="pill-ico" style=${e.iconColor ? `color:${e.iconColor}` : ""}>
|
|
982
|
-
${
|
|
979
|
+
${j`<svg viewBox="0 0 24 24" class=${e.fillIcon ? "fill-icon" : ""}>${F(e.icon)}</svg>`}
|
|
983
980
|
</span>`}
|
|
984
981
|
${e.label}
|
|
985
982
|
</button>
|
|
@@ -995,7 +992,7 @@ const _e = 3, de = class de extends E {
|
|
|
995
992
|
}}
|
|
996
993
|
>
|
|
997
994
|
${e.brandHtml ? c`<span class="card-ico">${A(e.brandHtml)}</span>` : c`<span class="card-ico" style=${e.iconColor ? `color:${e.iconColor}` : ""}>
|
|
998
|
-
${
|
|
995
|
+
${j`<svg viewBox="0 0 24 24" class=${e.fillIcon ? "fill-icon" : ""}>${F(e.icon)}</svg>`}
|
|
999
996
|
</span>`}
|
|
1000
997
|
<span class="card-label">${e.label}</span>
|
|
1001
998
|
</button>
|
|
@@ -1019,7 +1016,7 @@ const _e = 3, de = class de extends E {
|
|
|
1019
1016
|
(t) => c`
|
|
1020
1017
|
<button class="more-item" @click=${(r) => this._onMoreItemClick(t, r)}>
|
|
1021
1018
|
<div class="more-item-ico">
|
|
1022
|
-
${t.brandHtml ? A(t.brandHtml) : t.iconColor ? c`<svg viewBox="0 0 24 24" style="color:${t.iconColor}">${F(t.icon)}</svg>` :
|
|
1019
|
+
${t.brandHtml ? A(t.brandHtml) : t.iconColor ? c`<svg viewBox="0 0 24 24" style="color:${t.iconColor}">${F(t.icon)}</svg>` : j`<svg viewBox="0 0 24 24">${F(t.icon)}</svg>`}
|
|
1023
1020
|
</div>
|
|
1024
1021
|
${t.label}
|
|
1025
1022
|
</button>
|
|
@@ -1042,7 +1039,7 @@ const _e = 3, de = class de extends E {
|
|
|
1042
1039
|
(t) => c`
|
|
1043
1040
|
<button class="more-item" @click=${(r) => this._onMoreItemClick(t, r)}>
|
|
1044
1041
|
<div class="more-item-ico">
|
|
1045
|
-
${t.brandHtml ? A(t.brandHtml) : t.iconColor ? c`<svg viewBox="0 0 24 24" style="color:${t.iconColor}">${F(t.icon)}</svg>` :
|
|
1042
|
+
${t.brandHtml ? A(t.brandHtml) : t.iconColor ? c`<svg viewBox="0 0 24 24" style="color:${t.iconColor}">${F(t.icon)}</svg>` : j`<svg viewBox="0 0 24 24">${F(t.icon)}</svg>`}
|
|
1046
1043
|
</div>
|
|
1047
1044
|
${t.label}
|
|
1048
1045
|
</button>
|
|
@@ -1118,7 +1115,7 @@ const _e = 3, de = class de extends E {
|
|
|
1118
1115
|
s.stopPropagation(), this._onSourceIconClick(i);
|
|
1119
1116
|
}}
|
|
1120
1117
|
>
|
|
1121
|
-
${i.brandHtml ? A(i.brandHtml) :
|
|
1118
|
+
${i.brandHtml ? A(i.brandHtml) : j`<svg viewBox="0 0 24 24" class=${i.fillIcon ? "fill-icon" : ""}>${F(i.icon)}</svg>`}
|
|
1122
1119
|
</button>
|
|
1123
1120
|
`
|
|
1124
1121
|
)}
|
|
@@ -2551,7 +2548,7 @@ let se = he;
|
|
|
2551
2548
|
st([
|
|
2552
2549
|
b({ attribute: !1 })
|
|
2553
2550
|
], se.prototype, "file");
|
|
2554
|
-
const
|
|
2551
|
+
const X = y`
|
|
2555
2552
|
.btn,
|
|
2556
2553
|
.btn-ghost,
|
|
2557
2554
|
.btn-primary,
|
|
@@ -2676,7 +2673,7 @@ const Ce = 7, fe = class fe extends E {
|
|
|
2676
2673
|
`;
|
|
2677
2674
|
}
|
|
2678
2675
|
};
|
|
2679
|
-
fe.styles = [
|
|
2676
|
+
fe.styles = [X, W, y`
|
|
2680
2677
|
:host {
|
|
2681
2678
|
display: flex;
|
|
2682
2679
|
flex: 1;
|
|
@@ -2816,7 +2813,7 @@ G([
|
|
|
2816
2813
|
G([
|
|
2817
2814
|
b({ type: String })
|
|
2818
2815
|
], I.prototype, "primaryLabel");
|
|
2819
|
-
var at = Object.defineProperty,
|
|
2816
|
+
var at = Object.defineProperty, O = (a, e, t, r) => {
|
|
2820
2817
|
for (var i = void 0, s = a.length - 1, o; s >= 0; s--)
|
|
2821
2818
|
(o = a[s]) && (i = o(e, t, i) || i);
|
|
2822
2819
|
return i && at(e, t, i), i;
|
|
@@ -2923,7 +2920,7 @@ const ge = class ge extends E {
|
|
|
2923
2920
|
`;
|
|
2924
2921
|
}
|
|
2925
2922
|
};
|
|
2926
|
-
ge.styles = [
|
|
2923
|
+
ge.styles = [X, W, y`
|
|
2927
2924
|
:host {
|
|
2928
2925
|
display: flex;
|
|
2929
2926
|
flex-direction: column;
|
|
@@ -3073,25 +3070,25 @@ ge.styles = [V, W, y`
|
|
|
3073
3070
|
}
|
|
3074
3071
|
`];
|
|
3075
3072
|
let z = ge;
|
|
3076
|
-
|
|
3073
|
+
O([
|
|
3077
3074
|
b({ type: String })
|
|
3078
3075
|
], z.prototype, "uploadState");
|
|
3079
|
-
|
|
3076
|
+
O([
|
|
3080
3077
|
b({ type: Number })
|
|
3081
3078
|
], z.prototype, "fileCount");
|
|
3082
|
-
|
|
3079
|
+
O([
|
|
3083
3080
|
b({ type: Number })
|
|
3084
3081
|
], z.prototype, "totalSize");
|
|
3085
|
-
|
|
3082
|
+
O([
|
|
3086
3083
|
b({ type: Number })
|
|
3087
3084
|
], z.prototype, "failedCount");
|
|
3088
|
-
|
|
3085
|
+
O([
|
|
3089
3086
|
b({ type: Boolean })
|
|
3090
3087
|
], z.prototype, "showFillMetadata");
|
|
3091
|
-
|
|
3088
|
+
O([
|
|
3092
3089
|
b({ type: Number })
|
|
3093
3090
|
], z.prototype, "completedCount");
|
|
3094
|
-
|
|
3091
|
+
O([
|
|
3095
3092
|
b({ type: Number })
|
|
3096
3093
|
], z.prototype, "uploadProgress");
|
|
3097
3094
|
const nt = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
@@ -3224,7 +3221,7 @@ const xe = class xe extends E {
|
|
|
3224
3221
|
`;
|
|
3225
3222
|
}
|
|
3226
3223
|
};
|
|
3227
|
-
xe.styles = [
|
|
3224
|
+
xe.styles = [X, W, y`
|
|
3228
3225
|
:host {
|
|
3229
3226
|
display: block;
|
|
3230
3227
|
}
|
|
@@ -3491,7 +3488,7 @@ const ve = class ve extends E {
|
|
|
3491
3488
|
`;
|
|
3492
3489
|
}
|
|
3493
3490
|
};
|
|
3494
|
-
ve.styles = [
|
|
3491
|
+
ve.styles = [X, W, y`
|
|
3495
3492
|
:host { display: block; }
|
|
3496
3493
|
|
|
3497
3494
|
.backdrop {
|
|
@@ -3689,7 +3686,7 @@ const be = class be extends E {
|
|
|
3689
3686
|
`;
|
|
3690
3687
|
}
|
|
3691
3688
|
};
|
|
3692
|
-
be.styles = [
|
|
3689
|
+
be.styles = [X, W, y`
|
|
3693
3690
|
:host { display: block; }
|
|
3694
3691
|
|
|
3695
3692
|
.backdrop {
|
|
@@ -3846,11 +3843,11 @@ const $ = (k = class extends E {
|
|
|
3846
3843
|
if ((((o = (s = this.config) == null ? void 0 : s.connectors) == null ? void 0 : o.providers) ?? []).includes(t)) {
|
|
3847
3844
|
if ($e.has(t)) {
|
|
3848
3845
|
if (!customElements.get("sfx-search-provider-browser")) {
|
|
3849
|
-
const { SfxSearchProviderBrowser: l } = await import("./search-provider-browser-
|
|
3846
|
+
const { SfxSearchProviderBrowser: l } = await import("./search-provider-browser-B5ZWGUl8.js");
|
|
3850
3847
|
customElements.define("sfx-search-provider-browser", l);
|
|
3851
3848
|
}
|
|
3852
3849
|
} else if (!customElements.get("sfx-provider-browser")) {
|
|
3853
|
-
const { SfxProviderBrowser: l } = await import("./provider-browser-
|
|
3850
|
+
const { SfxProviderBrowser: l } = await import("./provider-browser-ixqCA0XP.js");
|
|
3854
3851
|
customElements.define("sfx-provider-browser", l);
|
|
3855
3852
|
}
|
|
3856
3853
|
this._activeConnector = t;
|
|
@@ -3861,7 +3858,7 @@ const $ = (k = class extends E {
|
|
|
3861
3858
|
const { url: t, name: r } = e.detail, i = (h = this.config) == null ? void 0 : h.callbacks, s = Ye(r), o = s.startsWith("image/"), n = this._store.getState(), l = te({ name: r, size: 0, type: s }, n.restrictions, n.files);
|
|
3862
3859
|
if (l) {
|
|
3863
3860
|
const g = {
|
|
3864
|
-
id:
|
|
3861
|
+
id: L(),
|
|
3865
3862
|
status: "rejected",
|
|
3866
3863
|
file: null,
|
|
3867
3864
|
remoteUrl: t,
|
|
@@ -3880,11 +3877,11 @@ const $ = (k = class extends E {
|
|
|
3880
3877
|
tags: [],
|
|
3881
3878
|
remoteInfo: null
|
|
3882
3879
|
};
|
|
3883
|
-
|
|
3880
|
+
M(this._store, g), this._dispatchPublic(v.FILE_REJECTED, { file: g, reason: l }), (f = i == null ? void 0 : i.onFileRejected) == null || f.call(i, g, l);
|
|
3884
3881
|
return;
|
|
3885
3882
|
}
|
|
3886
3883
|
const d = {
|
|
3887
|
-
id:
|
|
3884
|
+
id: L(),
|
|
3888
3885
|
status: "idle",
|
|
3889
3886
|
file: null,
|
|
3890
3887
|
remoteUrl: t,
|
|
@@ -3903,7 +3900,7 @@ const $ = (k = class extends E {
|
|
|
3903
3900
|
tags: [],
|
|
3904
3901
|
remoteInfo: null
|
|
3905
3902
|
};
|
|
3906
|
-
|
|
3903
|
+
M(this._store, d), this._dispatchPublic(v.FILE_ADDED, { file: d }), (p = i == null ? void 0 : i.onFileAdded) == null || p.call(i, d), this._store.getState().queueConfig.autoProceed && this.upload();
|
|
3907
3904
|
}, this._onUrlCancel = () => {
|
|
3908
3905
|
this._showUrlDialog = !1;
|
|
3909
3906
|
}, this._onCameraCapture = (e) => {
|
|
@@ -3971,7 +3968,7 @@ const $ = (k = class extends E {
|
|
|
3971
3968
|
);
|
|
3972
3969
|
if (l) {
|
|
3973
3970
|
const h = {
|
|
3974
|
-
id:
|
|
3971
|
+
id: L(),
|
|
3975
3972
|
status: "rejected",
|
|
3976
3973
|
file: null,
|
|
3977
3974
|
remoteUrl: null,
|
|
@@ -3990,11 +3987,11 @@ const $ = (k = class extends E {
|
|
|
3990
3987
|
tags: [],
|
|
3991
3988
|
remoteInfo: o
|
|
3992
3989
|
};
|
|
3993
|
-
|
|
3990
|
+
M(this._store, h), this._dispatchPublic(v.FILE_REJECTED, { file: h, reason: l }), (i = t == null ? void 0 : t.onFileRejected) == null || i.call(t, h, l);
|
|
3994
3991
|
continue;
|
|
3995
3992
|
}
|
|
3996
3993
|
const d = {
|
|
3997
|
-
id:
|
|
3994
|
+
id: L(),
|
|
3998
3995
|
status: "idle",
|
|
3999
3996
|
file: null,
|
|
4000
3997
|
remoteUrl: null,
|
|
@@ -4013,7 +4010,7 @@ const $ = (k = class extends E {
|
|
|
4013
4010
|
tags: [],
|
|
4014
4011
|
remoteInfo: o
|
|
4015
4012
|
};
|
|
4016
|
-
|
|
4013
|
+
M(this._store, d), this._dispatchPublic(v.FILE_ADDED, { file: d }), (s = t == null ? void 0 : t.onFileAdded) == null || s.call(t, d);
|
|
4017
4014
|
}
|
|
4018
4015
|
this._activeConnector = null, this._store.getState().queueConfig.autoProceed && this.upload();
|
|
4019
4016
|
}, this._onConnectorClose = () => {
|
|
@@ -4206,7 +4203,7 @@ const $ = (k = class extends E {
|
|
|
4206
4203
|
async _resolveAuthAndEngine(e) {
|
|
4207
4204
|
var i, s;
|
|
4208
4205
|
const t = e.auth;
|
|
4209
|
-
if (t.mode === "sass-key"
|
|
4206
|
+
if (t.mode === "sass-key") {
|
|
4210
4207
|
this._apiBase = ae(t.container), this._authHeaders = ee(t), this._ensureEngine(), (i = this._engine) == null || i.updateConfig({
|
|
4211
4208
|
apiBase: this._apiBase,
|
|
4212
4209
|
authHeaders: this._authHeaders
|
|
@@ -4215,7 +4212,7 @@ const $ = (k = class extends E {
|
|
|
4215
4212
|
}
|
|
4216
4213
|
const r = ++this._authResolveId;
|
|
4217
4214
|
try {
|
|
4218
|
-
const o = await
|
|
4215
|
+
const o = await je(t);
|
|
4219
4216
|
if (r !== this._authResolveId) return;
|
|
4220
4217
|
this._apiBase = o.apiBase, this._authHeaders = o.headers, this._ensureEngine(), (s = this._engine) == null || s.updateConfig({
|
|
4221
4218
|
apiBase: this._apiBase,
|
|
@@ -4227,7 +4224,7 @@ const $ = (k = class extends E {
|
|
|
4227
4224
|
}
|
|
4228
4225
|
}
|
|
4229
4226
|
_ensureEngine() {
|
|
4230
|
-
!this._engine && this._apiBase && this._authHeaders && (this._engine = new
|
|
4227
|
+
!this._engine && this._apiBase && this._authHeaders && (this._engine = new Me(this._store, {
|
|
4231
4228
|
apiBase: this._apiBase,
|
|
4232
4229
|
authHeaders: this._authHeaders
|
|
4233
4230
|
}), this._engine.start());
|
|
@@ -4292,7 +4289,7 @@ const $ = (k = class extends E {
|
|
|
4292
4289
|
if (e === this._cachedSourcesConfig) return this._cachedSources;
|
|
4293
4290
|
if (this._cachedSourcesConfig = e, !e)
|
|
4294
4291
|
return this._cachedSources = q, this._cachedSources;
|
|
4295
|
-
const t = e.providers.length > 0 ?
|
|
4292
|
+
const t = e.providers.length > 0 ? Xe(e.providers) : [], r = e.customSources ?? [], i = q.filter((d) => d.id === "device" || d.id === "url"), s = q.filter((d) => d.id !== "device" && d.id !== "url"), o = /* @__PURE__ */ new Set(), n = [];
|
|
4296
4293
|
for (const d of [...i, ...t, ...s, ...r])
|
|
4297
4294
|
if (!o.has(d.id)) {
|
|
4298
4295
|
if (k._RESERVED_IDS.has(d.id) && d.onActivate) {
|
|
@@ -4319,7 +4316,7 @@ const $ = (k = class extends E {
|
|
|
4319
4316
|
const l = this._store.getState(), d = Ne(n, l.restrictions, l.files);
|
|
4320
4317
|
if (d) {
|
|
4321
4318
|
const p = {
|
|
4322
|
-
id:
|
|
4319
|
+
id: L(),
|
|
4323
4320
|
status: "rejected",
|
|
4324
4321
|
file: n,
|
|
4325
4322
|
remoteUrl: null,
|
|
@@ -4338,22 +4335,22 @@ const $ = (k = class extends E {
|
|
|
4338
4335
|
tags: [],
|
|
4339
4336
|
remoteInfo: null
|
|
4340
4337
|
};
|
|
4341
|
-
|
|
4338
|
+
M(this._store, p), this._dispatchPublic(v.FILE_REJECTED, { file: p, reason: d }), (i = t == null ? void 0 : t.onFileRejected) == null || i.call(t, p, d);
|
|
4342
4339
|
const g = (s = this.config) == null ? void 0 : s.rejectedFileAutoRemoveDelay, w = g === !1 || g === 0 ? 0 : g ?? 4e3;
|
|
4343
4340
|
if (w > 0) {
|
|
4344
|
-
const m = p.id,
|
|
4341
|
+
const m = p.id, T = setTimeout(() => {
|
|
4345
4342
|
this._rejectedTimers.delete(m);
|
|
4346
4343
|
const _ = this._store.getState().files.get(m);
|
|
4347
4344
|
_ && _.status === "rejected" && me(this._store, m);
|
|
4348
4345
|
}, w);
|
|
4349
|
-
this._rejectedTimers.set(m,
|
|
4346
|
+
this._rejectedTimers.set(m, T);
|
|
4350
4347
|
}
|
|
4351
4348
|
continue;
|
|
4352
4349
|
}
|
|
4353
4350
|
let h = null;
|
|
4354
4351
|
n.type.startsWith("image/") && (h = URL.createObjectURL(n));
|
|
4355
4352
|
const f = {
|
|
4356
|
-
id:
|
|
4353
|
+
id: L(),
|
|
4357
4354
|
status: "idle",
|
|
4358
4355
|
file: n,
|
|
4359
4356
|
remoteUrl: null,
|
|
@@ -4372,7 +4369,7 @@ const $ = (k = class extends E {
|
|
|
4372
4369
|
tags: [],
|
|
4373
4370
|
remoteInfo: null
|
|
4374
4371
|
};
|
|
4375
|
-
|
|
4372
|
+
M(this._store, f), this._dispatchPublic(v.FILE_ADDED, { file: f }), (o = t == null ? void 0 : t.onFileAdded) == null || o.call(t, f), n.type.startsWith("video/") && qe(n).then((p) => {
|
|
4376
4373
|
if (!p) return;
|
|
4377
4374
|
const g = this._store.getState(), w = g.files.get(f.id);
|
|
4378
4375
|
if (w) {
|
|
@@ -4538,7 +4535,7 @@ const $ = (k = class extends E {
|
|
|
4538
4535
|
}
|
|
4539
4536
|
_renderBody() {
|
|
4540
4537
|
var o, n, l;
|
|
4541
|
-
const e = this._storeCtrl.state, t = [...e.files.values()], r = this._phase, i =
|
|
4538
|
+
const e = this._storeCtrl.state, t = [...e.files.values()], r = this._phase, i = Ve(e.restrictions), s = t.length > 0;
|
|
4542
4539
|
return c`
|
|
4543
4540
|
<div class="content"
|
|
4544
4541
|
@files-selected=${this._onFilesSelected}
|
|
@@ -5361,7 +5358,7 @@ export {
|
|
|
5361
5358
|
q as C,
|
|
5362
5359
|
v as P,
|
|
5363
5360
|
z as S,
|
|
5364
|
-
|
|
5361
|
+
Me as U,
|
|
5365
5362
|
C as a,
|
|
5366
5363
|
se as b,
|
|
5367
5364
|
ie as c,
|
|
@@ -5372,14 +5369,14 @@ export {
|
|
|
5372
5369
|
Ee as h,
|
|
5373
5370
|
ee as i,
|
|
5374
5371
|
Ue as j,
|
|
5375
|
-
|
|
5372
|
+
Le as k,
|
|
5376
5373
|
ae as l,
|
|
5377
|
-
|
|
5374
|
+
Xe as m,
|
|
5378
5375
|
N as n,
|
|
5379
5376
|
B as o,
|
|
5380
5377
|
R as p,
|
|
5381
5378
|
xt as q,
|
|
5382
|
-
|
|
5379
|
+
je as r,
|
|
5383
5380
|
mt as s,
|
|
5384
5381
|
wt as t,
|
|
5385
5382
|
vt as u,
|