@singlebase/elements 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +2 -0
  2. package/dist/{display-8HEcKYR4.js → authui-display-BCZBP7HR.js} +11 -10
  3. package/dist/authui-display-BCZBP7HR.js.map +1 -0
  4. package/dist/{display-CLDNNZQy.cjs → authui-display-CLGFSqRi.cjs} +21 -21
  5. package/dist/authui-display-CLGFSqRi.cjs.map +1 -0
  6. package/dist/authui.cjs +1 -1
  7. package/dist/authui.d.ts +9 -9
  8. package/dist/authui.js +2 -2
  9. package/dist/chat-DRenTJlI.cjs +3001 -0
  10. package/dist/chat-DRenTJlI.cjs.map +1 -0
  11. package/dist/chat-bXaRWel7.js +4926 -0
  12. package/dist/chat-bXaRWel7.js.map +1 -0
  13. package/dist/chat-messages.d.ts +109 -0
  14. package/dist/chat.cjs +2 -0
  15. package/dist/chat.cjs.map +1 -0
  16. package/dist/chat.d.ts +10 -0
  17. package/dist/chat.js +13 -0
  18. package/dist/chat.js.map +1 -0
  19. package/dist/elements/{account-screen.d.ts → authui-account.d.ts} +1 -1
  20. package/dist/elements/{buttons.d.ts → authui-buttons.d.ts} +1 -1
  21. package/dist/elements/{display.d.ts → authui-display.d.ts} +1 -1
  22. package/dist/elements/{form-base.d.ts → authui-form-base.d.ts} +1 -1
  23. package/dist/elements/{guard.d.ts → authui-guard.d.ts} +1 -1
  24. package/dist/elements/{auth-screen.d.ts → authui.d.ts} +3 -3
  25. package/dist/elements/chat.d.ts +312 -0
  26. package/dist/files-BOwtpYyQ.js +168 -0
  27. package/dist/files-BOwtpYyQ.js.map +1 -0
  28. package/dist/files-DW8A4Jl-.cjs +38 -0
  29. package/dist/files-DW8A4Jl-.cjs.map +1 -0
  30. package/dist/index.cjs +1 -1
  31. package/dist/index.d.ts +3 -2
  32. package/dist/index.js +36 -25
  33. package/dist/index.js.map +1 -1
  34. package/dist/singlebase-elements.min.js +6841 -1824
  35. package/dist/singlebase-elements.min.js.map +1 -1
  36. package/dist/styles/chat.d.ts +6 -0
  37. package/dist/styles/tokens.d.ts +1 -1
  38. package/dist/{uploader-eFYKpk8b.cjs → uploader-DGV2y9uT.cjs} +41 -77
  39. package/dist/uploader-DGV2y9uT.cjs.map +1 -0
  40. package/dist/{uploader-D-Da1trc.js → uploader-abQoem5q.js} +309 -463
  41. package/dist/uploader-abQoem5q.js.map +1 -0
  42. package/dist/uploader.cjs +1 -1
  43. package/dist/uploader.js +5 -4
  44. package/dist/uploader.js.map +1 -1
  45. package/dist/utils/markdown.d.ts +108 -0
  46. package/package.json +13 -5
  47. package/dist/display-8HEcKYR4.js.map +0 -1
  48. package/dist/display-CLDNNZQy.cjs.map +0 -1
  49. package/dist/uploader-D-Da1trc.js.map +0 -1
  50. package/dist/uploader-eFYKpk8b.cjs.map +0 -1
  51. /package/dist/elements/{base.d.ts → authui-base.d.ts} +0 -0
@@ -1,72 +1,13 @@
1
1
  var ue = (r) => {
2
2
  throw TypeError(r);
3
3
  };
4
- var be = (r, e, t) => e.has(r) || ue("Cannot " + t);
5
- var d = (r, e, t) => (be(r, e, "read from private field"), t ? t.call(r) : e.get(r)), l = (r, e, t) => e.has(r) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), c = (r, e, t, o) => (be(r, e, "write to private field"), o ? o.call(r, t) : e.set(r, t), t);
6
- import { unsafeCSS as ge, css as se, LitElement as Ce, nothing as x, html as f } from "lit";
7
- import { property as g, state as Z, customElement as Me } from "lit/decorators.js";
8
- import { getDefaultClient as Le } from "@singlebase/core";
9
- const he = {
10
- font: '"Geist", -apple-system, "Segoe UI", Helvetica, sans-serif',
11
- mono: '"Geist Mono", ui-monospace, monospace',
12
- accent: "#111111",
13
- onAccent: "#ffffff",
14
- radius: "4px",
15
- surface: "#ffffff",
16
- surfaceAlt: "#fafafa",
17
- ink: "#16181a",
18
- mutedInk: "#61666c",
19
- border: "#e4e6e9",
20
- borderStrong: "#cdd1d6",
21
- danger: "#b4231a",
22
- dangerBg: "#fdf1f0",
23
- dangerBorder: "#f3d6d3",
24
- dangerOutline: "#e8c4c0",
25
- dangerPanelBorder: "#efd9d6",
26
- dangerPanelBg: "#fdf7f6",
27
- ok: "#0f6b4a",
28
- okBg: "#f0f7f3",
29
- okBorder: "#cfe5da",
30
- gap: "16px",
31
- pad: "20px",
32
- fieldPad: "11px 13px"
33
- }, Te = se`
34
- :host {
35
- display: block;
36
- box-sizing: border-box;
37
- font-family: var(--sb-font, ${ge(he.font)});
38
- color: var(--sb-ink, ${ge(he.ink)});
39
- }
40
-
41
- :host([theme="dark"]) {
42
- /* The light default accent is near-black, which disappears on a dark
43
- surface — primary buttons and links both use it. A host that sets its
44
- own --sb-accent still wins: outer-page declarations beat :host rules. */
45
- --sb-accent: #f3f4f5;
46
- --sb-on-accent: #17181b;
47
- --sb-surface: #17181b;
48
- --sb-surface-alt: #202226;
49
- --sb-ink: #f3f4f5;
50
- --sb-muted-ink: #a2a8ae;
51
- --sb-border: #2c2f34;
52
- --sb-border-strong: #3a3e44;
53
- --sb-danger: #f08379;
54
- --sb-danger-bg: rgba(240, 131, 121, 0.1);
55
- --sb-danger-border: rgba(240, 131, 121, 0.3);
56
- --sb-danger-outline: rgba(240, 131, 121, 0.4);
57
- --sb-danger-panel-border: rgba(240, 131, 121, 0.3);
58
- --sb-danger-panel-bg: rgba(240, 131, 121, 0.06);
59
- --sb-ok: #6fd1a6;
60
- --sb-ok-bg: rgba(111, 209, 166, 0.1);
61
- --sb-ok-border: rgba(111, 209, 166, 0.28);
62
- }
63
-
64
- :host([density="compact"]) {
65
- --sb-gap: 12px;
66
- --sb-pad: 16px;
67
- --sb-field-pad: 9px 11px;
68
- }
69
- `, Fe = se`
4
+ var fe = (r, e, t) => e.has(r) || ue("Cannot " + t);
5
+ var d = (r, e, t) => (fe(r, e, "read from private field"), t ? t.call(r) : e.get(r)), l = (r, e, t) => e.has(r) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), c = (r, e, t, i) => (fe(r, e, "write to private field"), i ? i.call(r, t) : e.set(r, t), t);
6
+ import { css as me, LitElement as $e, nothing as x, html as u } from "lit";
7
+ import { property as b, state as Z, customElement as Ue } from "lit/decorators.js";
8
+ import { getDefaultClient as Se } from "@singlebase/core";
9
+ import { t as Me, r as Ce, b as oe, f as v, c as je, p as se, a as ee, e as Fe, g as Oe, h as De, i as Ee } from "./files-BOwtpYyQ.js";
10
+ const Le = me`
70
11
  /* ── layout primitives ───────────────────────────────────── */
71
12
  .stack {
72
13
  display: flex;
@@ -1043,214 +984,123 @@ const he = {
1043
984
  font-style: italic;
1044
985
  }
1045
986
  `;
1046
- function Oe(r, e, t) {
987
+ function Te(r, e, t) {
1047
988
  if (!r || !e) return null;
1048
- let o;
989
+ let i;
1049
990
  try {
1050
- o = new URL(e);
991
+ i = new URL(e);
1051
992
  } catch {
1052
993
  return null;
1053
994
  }
1054
- let n;
995
+ let s;
1055
996
  try {
1056
- n = new URL(r, o.href);
997
+ s = new URL(r, i.href);
1057
998
  } catch {
1058
999
  return t == null || t(`"${r}" is not a valid URL`), null;
1059
1000
  }
1060
- return n.protocol !== "http:" && n.protocol !== "https:" ? (t == null || t(`refusing redirect to unsupported scheme "${n.protocol}"`), null) : n.origin !== o.origin ? (t == null || t(`refusing cross-origin redirect to ${n.origin}; same-origin only`), null) : n.href === o.href ? null : n.href;
1061
- }
1062
- const me = {
1063
- heading: "Upload files",
1064
- description: "Add one or more files. You can review the list before uploading.",
1065
- dropTitle: "Drag and drop files here",
1066
- dropSub: "or browse from your device",
1067
- hintUpTo: "up to {size} each",
1068
- chooseFiles: "Choose files",
1069
- chooseFile: "Choose file",
1070
- addMore: "+ Add more files",
1071
- remove: "Remove",
1072
- rename: "Rename",
1073
- retry: "Retry",
1074
- uploadCtaOne: "Upload {n} file",
1075
- uploadCtaMany: "Upload {n} files",
1076
- attachments: "Attachments",
1077
- dropOrChoose: "Drop files or choose",
1078
- checking: "Checking…",
1079
- pagesLabel: "{n} pages",
1080
- countOne: "{n} file of {max}",
1081
- countMany: "{n} files of {max}",
1082
- uploading: "Uploading…",
1083
- uploaded: "Uploaded",
1084
- failedLabel: "Failed",
1085
- errTooMany: "You can upload up to {max} files.",
1086
- errTooLarge: "{name} is larger than {size}.",
1087
- errTooSmall: "{name} is smaller than {size}.",
1088
- errDuplicate: "{name} is already in the list.",
1089
- errType: "{name} isn't an accepted file type.",
1090
- errNoClient: "No Singlebase client found on this page.",
1091
- errUpload: "Upload failed.",
1092
- errProtected: "{name} is password protected.",
1093
- errTooManyPages: "{name} has {pages} pages; the limit is {max}.",
1094
- brandingLabel: "Files by Singlebase"
1095
- };
1096
- function De(r) {
1097
- return r ? { ...me, ...r } : me;
1098
- }
1099
- function v(r, e) {
1100
- return r.replace(
1101
- /\{(\w+)\}/g,
1102
- (t, o) => o in e ? String(e[o]) : t
1103
- );
1104
- }
1105
- const je = {
1106
- b: 1,
1107
- kb: 1024,
1108
- mb: 1024 * 1024,
1109
- gb: 1024 * 1024 * 1024
1110
- };
1111
- function ne(r) {
1112
- if (typeof r == "number") return r > 0 ? r : 0;
1113
- if (!r) return 0;
1114
- const e = String(r).trim().toLowerCase().match(/^([\d.]+)\s*(b|kb|mb|gb)?$/);
1115
- if (!e) return 0;
1116
- const t = Number.parseFloat(e[1]);
1117
- return !Number.isFinite(t) || t <= 0 ? 0 : Math.round(t * (je[e[2] ?? "b"] ?? 1));
1118
- }
1119
- function ee(r) {
1120
- return r < 1024 ? `${r} B` : r < 1024 * 1024 ? `${Math.round(r / 1024)} KB` : r < 1024 * 1024 * 1024 ? `${(r / (1024 * 1024)).toFixed(1)} MB` : `${(r / (1024 * 1024 * 1024)).toFixed(1)} GB`;
1121
- }
1122
- function te(r) {
1123
- const e = r.lastIndexOf(".");
1124
- return e <= 0 || e === r.length - 1 ? "" : r.slice(e + 1).toLowerCase();
1125
- }
1126
- function Ae(r) {
1127
- return te(r).toUpperCase().slice(0, 4);
1128
- }
1129
- function Ee(r, e, t) {
1130
- const o = r.split(",").map((i) => i.trim().toLowerCase()).filter(Boolean);
1131
- if (!o.length) return !0;
1132
- const n = e.toLowerCase(), u = (t || "").toLowerCase();
1133
- return o.some((i) => i.startsWith(".") ? n.endsWith(i) : i.endsWith("/*") ? u.startsWith(i.slice(0, -1)) : u === i);
1134
- }
1135
- function Ne(r) {
1136
- const e = r.split(",").map((t) => t.trim()).filter(Boolean).map((t) => {
1137
- if (t.startsWith(".")) return t.slice(1).toUpperCase();
1138
- if (t.endsWith("/*")) return t.slice(0, -2).toUpperCase();
1139
- const o = t.indexOf("/");
1140
- return (o >= 0 ? t.slice(o + 1) : t).toUpperCase();
1141
- });
1142
- return [...new Set(e)].join(", ");
1143
- }
1144
- function Be(r) {
1145
- return `${r.name}:${r.size}:${r.lastModified ?? 0}`;
1146
- }
1147
- function Pe(r, e) {
1148
- const t = e.trim().replace(/[/\\]/g, "");
1149
- if (!t) return r;
1150
- const o = r.lastIndexOf("."), n = o > 0 ? r.slice(o) : "";
1151
- return n ? t.toLowerCase().endsWith(n.toLowerCase()) ? t : t + n : t;
1001
+ return s.protocol !== "http:" && s.protocol !== "https:" ? (t == null || t(`refusing redirect to unsupported scheme "${s.protocol}"`), null) : s.origin !== i.origin ? (t == null || t(`refusing cross-origin redirect to ${s.origin}; same-origin only`), null) : s.href === i.href ? null : s.href;
1152
1002
  }
1153
- const we = { pages: null, encrypted: null }, xe = 16 * 1024 * 1024, Re = 2 * 1024 * 1024, Ie = 40, Ge = 4 * 1024 * 1024, ke = /* @__PURE__ */ new Set(["docx", "pptx", "xlsx"]);
1154
- async function _e(r, e) {
1003
+ const xe = { pages: null, encrypted: null }, ge = 16 * 1024 * 1024, Ae = 2 * 1024 * 1024, Ne = 40, Pe = 4 * 1024 * 1024, ve = /* @__PURE__ */ new Set(["docx", "pptx", "xlsx"]);
1004
+ async function Re(r, e) {
1155
1005
  try {
1156
- if (e === "pdf") return await We(r);
1157
- if (ke.has(e)) return await qe(r, e);
1006
+ if (e === "pdf") return await Be(r);
1007
+ if (ve.has(e)) return await _e(r, e);
1158
1008
  } catch {
1159
1009
  }
1160
- return we;
1010
+ return xe;
1161
1011
  }
1162
- function Ke(r) {
1163
- return r === "pdf" || ke.has(r);
1012
+ function Ge(r) {
1013
+ return r === "pdf" || ve.has(r);
1164
1014
  }
1165
- async function We(r) {
1166
- const e = await re(r.slice(0, xe)), t = r.size > xe ? await re(r.slice(Math.max(0, r.size - Re))) : null, o = oe(e) + (t ? oe(t) : ""), n = /\/Encrypt[\s/<>\]]/.test(o);
1167
- let u = ze(o);
1168
- return u === null && (u = await Ye(e)), { pages: u, encrypted: n };
1015
+ async function Be(r) {
1016
+ const e = await te(r.slice(0, ge)), t = r.size > ge ? await te(r.slice(Math.max(0, r.size - Ae))) : null, i = re(e) + (t ? re(t) : ""), s = /\/Encrypt[\s/<>\]]/.test(i);
1017
+ let g = ye(i);
1018
+ return g === null && (g = await Ie(e)), { pages: g, encrypted: s };
1169
1019
  }
1170
- function ze(r) {
1020
+ function ye(r) {
1171
1021
  if (/\/Type\s*\/Pages/.test(r)) {
1172
1022
  let t = 0;
1173
- for (const o of r.matchAll(/\/Count\s+(\d+)/g))
1174
- t = Math.max(t, Number(o[1]));
1023
+ for (const i of r.matchAll(/\/Count\s+(\d+)/g))
1024
+ t = Math.max(t, Number(i[1]));
1175
1025
  if (t > 0) return t;
1176
1026
  }
1177
1027
  const e = r.match(/\/Type\s*\/Page[^s]/g);
1178
1028
  return e != null && e.length ? e.length : null;
1179
1029
  }
1180
- async function Ye(r) {
1030
+ async function Ie(r) {
1181
1031
  if (typeof DecompressionStream > "u") return null;
1182
- const e = oe(r);
1183
- let t = "", o = 0;
1184
- for (const n of e.matchAll(/stream\r?\n/g)) {
1185
- if (o >= Ie || t.length >= Ge) break;
1186
- const u = n.index + n[0].length;
1187
- let i = e.indexOf("endstream", u);
1188
- if (i < 0) break;
1189
- for (; i > u && (e[i - 1] === `
1190
- ` || e[i - 1] === "\r"); ) i -= 1;
1191
- o += 1;
1032
+ const e = re(r);
1033
+ let t = "", i = 0;
1034
+ for (const s of e.matchAll(/stream\r?\n/g)) {
1035
+ if (i >= Ne || t.length >= Pe) break;
1036
+ const g = s.index + s[0].length;
1037
+ let o = e.indexOf("endstream", g);
1038
+ if (o < 0) break;
1039
+ for (; o > g && (e[o - 1] === `
1040
+ ` || e[o - 1] === "\r"); ) o -= 1;
1041
+ i += 1;
1192
1042
  try {
1193
- const a = await $e(r.subarray(u, i), "deflate");
1194
- t += oe(a);
1043
+ const a = await we(r.subarray(g, o), "deflate");
1044
+ t += re(a);
1195
1045
  } catch {
1196
1046
  }
1197
1047
  }
1198
- return t ? ze(t) : null;
1048
+ return t ? ye(t) : null;
1199
1049
  }
1200
- async function qe(r, e) {
1201
- const t = await re(r.slice(0, 8));
1202
- if (He(t)) return { pages: null, encrypted: !0 };
1203
- if (t[0] !== 80 || t[1] !== 75) return we;
1204
- const o = await Ve(r, "docProps/app.xml");
1205
- if (!o) return { pages: null, encrypted: !1 };
1206
- const n = e === "pptx" ? "Slides" : "Pages", u = new TextDecoder().decode(o).match(new RegExp(`<${n}>(\\d+)</${n}>`));
1207
- return { pages: u ? Number(u[1]) : null, encrypted: !1 };
1050
+ async function _e(r, e) {
1051
+ const t = await te(r.slice(0, 8));
1052
+ if (Ke(t)) return { pages: null, encrypted: !0 };
1053
+ if (t[0] !== 80 || t[1] !== 75) return xe;
1054
+ const i = await qe(r, "docProps/app.xml");
1055
+ if (!i) return { pages: null, encrypted: !1 };
1056
+ const s = e === "pptx" ? "Slides" : "Pages", g = new TextDecoder().decode(i).match(new RegExp(`<${s}>(\\d+)</${s}>`));
1057
+ return { pages: g ? Number(g[1]) : null, encrypted: !1 };
1208
1058
  }
1209
- function He(r) {
1210
- return [208, 207, 17, 224, 161, 177, 26, 225].every((t, o) => r[o] === t);
1059
+ function Ke(r) {
1060
+ return [208, 207, 17, 224, 161, 177, 26, 225].every((t, i) => r[i] === t);
1211
1061
  }
1212
- async function Ve(r, e) {
1213
- const t = Math.min(r.size, 66e3), o = new DataView(await r.slice(r.size - t).arrayBuffer());
1214
- let n = -1;
1215
- for (let h = o.byteLength - 22; h >= 0; h--)
1216
- if (o.getUint32(h, !0) === 101010256) {
1217
- n = h;
1062
+ async function qe(r, e) {
1063
+ const t = Math.min(r.size, 66e3), i = new DataView(await r.slice(r.size - t).arrayBuffer());
1064
+ let s = -1;
1065
+ for (let h = i.byteLength - 22; h >= 0; h--)
1066
+ if (i.getUint32(h, !0) === 101010256) {
1067
+ s = h;
1218
1068
  break;
1219
1069
  }
1220
- if (n < 0) return null;
1221
- const u = o.getUint32(n + 12, !0), i = o.getUint32(n + 16, !0);
1222
- if (!u || i === 4294967295) return null;
1223
- const a = new DataView(await r.slice(i, i + u).arrayBuffer()), m = new TextDecoder();
1224
- let b = 0;
1225
- for (; b + 46 <= a.byteLength && a.getUint32(b, !0) === 33639248; ) {
1226
- const h = a.getUint16(b + 10, !0), Q = a.getUint32(b + 20, !0), y = a.getUint16(b + 28, !0), ie = a.getUint16(b + 30, !0), Se = a.getUint16(b + 32, !0), ae = a.getUint32(b + 42, !0);
1227
- if (m.decode(new Uint8Array(a.buffer, a.byteOffset + b + 46, y)) === e) {
1228
- const ce = new DataView(await r.slice(ae, ae + 30).arrayBuffer()), pe = ae + 30 + ce.getUint16(26, !0) + ce.getUint16(28, !0), fe = await re(r.slice(pe, pe + Q));
1229
- return h === 0 ? fe : h === 8 && typeof DecompressionStream < "u" ? await $e(fe, "deflate-raw") : null;
1070
+ if (s < 0) return null;
1071
+ const g = i.getUint32(s + 12, !0), o = i.getUint32(s + 16, !0);
1072
+ if (!g || o === 4294967295) return null;
1073
+ const a = new DataView(await r.slice(o, o + g).arrayBuffer()), m = new TextDecoder();
1074
+ let f = 0;
1075
+ for (; f + 46 <= a.byteLength && a.getUint32(f, !0) === 33639248; ) {
1076
+ const h = a.getUint16(f + 10, !0), Q = a.getUint32(f + 20, !0), y = a.getUint16(f + 28, !0), ie = a.getUint16(f + 30, !0), ze = a.getUint16(f + 32, !0), ae = a.getUint32(f + 42, !0);
1077
+ if (m.decode(new Uint8Array(a.buffer, a.byteOffset + f + 46, y)) === e) {
1078
+ const le = new DataView(await r.slice(ae, ae + 30).arrayBuffer()), ce = ae + 30 + le.getUint16(26, !0) + le.getUint16(28, !0), pe = await te(r.slice(ce, ce + Q));
1079
+ return h === 0 ? pe : h === 8 && typeof DecompressionStream < "u" ? await we(pe, "deflate-raw") : null;
1230
1080
  }
1231
- b += 46 + y + ie + Se;
1081
+ f += 46 + y + ie + ze;
1232
1082
  }
1233
1083
  return null;
1234
1084
  }
1235
- async function re(r) {
1085
+ async function te(r) {
1236
1086
  return new Uint8Array(await r.arrayBuffer());
1237
1087
  }
1238
- async function $e(r, e) {
1088
+ async function we(r, e) {
1239
1089
  const t = new Blob([r]).stream().pipeThrough(new DecompressionStream(e));
1240
1090
  return new Uint8Array(await new Response(t).arrayBuffer());
1241
1091
  }
1242
- function oe(r) {
1092
+ function re(r) {
1243
1093
  let e = "";
1244
- for (let o = 0; o < r.length; o += 32768)
1245
- e += String.fromCharCode(...r.subarray(o, o + 32768));
1094
+ for (let i = 0; i < r.length; i += 32768)
1095
+ e += String.fromCharCode(...r.subarray(i, i + 32768));
1246
1096
  return e;
1247
1097
  }
1248
- var Ue = Object.defineProperty, Je = Object.getOwnPropertyDescriptor, Xe = (r, e, t) => e in r ? Ue(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, p = (r, e, t, o) => {
1249
- for (var n = o > 1 ? void 0 : o ? Je(e, t) : e, u = r.length - 1, i; u >= 0; u--)
1250
- (i = r[u]) && (n = (o ? i(e, t, n) : i(n)) || n);
1251
- return o && n && Ue(e, t, n), n;
1252
- }, Ze = (r, e, t) => Xe(r, e + "", t);
1253
- const de = {
1098
+ var ke = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, Ye = (r, e, t) => e in r ? ke(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, p = (r, e, t, i) => {
1099
+ for (var s = i > 1 ? void 0 : i ? Ve(e, t) : e, g = r.length - 1, o; g >= 0; g--)
1100
+ (o = r[g]) && (s = (i ? o(e, t, s) : o(s)) || s);
1101
+ return i && s && ke(e, t, s), s;
1102
+ }, He = (r, e, t) => Ye(r, e + "", t);
1103
+ const ne = {
1254
1104
  fromAttribute: (r) => {
1255
1105
  if (!r) return {};
1256
1106
  try {
@@ -1261,10 +1111,10 @@ const de = {
1261
1111
  }
1262
1112
  },
1263
1113
  toAttribute: (r) => JSON.stringify(r ?? {})
1264
- }, le = {
1114
+ }, de = {
1265
1115
  fromAttribute: (r) => r === null ? !0 : r !== "false",
1266
1116
  toAttribute: (r) => r ? null : "false"
1267
- }, ve = [
1117
+ }, be = [
1268
1118
  "view",
1269
1119
  "dropzone",
1270
1120
  "allowRename",
@@ -1290,8 +1140,8 @@ const de = {
1290
1140
  "onComplete",
1291
1141
  "onError"
1292
1142
  ];
1293
- var k, z, $, U, S, C, M, L, T, F, O, D, j, A, E, N, B, P, R, I, G, _, K, W, Y, q, H, V, J, X, ye;
1294
- let s = (ye = class extends Ce {
1143
+ var k, z, $, U, S, M, C, j, F, O, D, E, L, T, A, N, P, R, G, B, I, _, K, q, V, Y, H, J, X, W, he;
1144
+ let n = (he = class extends $e {
1295
1145
  constructor() {
1296
1146
  super(...arguments);
1297
1147
  l(this, k, null);
@@ -1299,31 +1149,31 @@ let s = (ye = class extends Ce {
1299
1149
  l(this, $);
1300
1150
  l(this, U);
1301
1151
  l(this, S, "full");
1302
- l(this, C, !0);
1303
1152
  l(this, M, !0);
1304
- l(this, L, !1);
1305
- l(this, T, !0);
1306
- l(this, F, "");
1153
+ l(this, C, !0);
1154
+ l(this, j, !1);
1155
+ l(this, F, !0);
1307
1156
  l(this, O, "");
1308
1157
  l(this, D, "");
1309
- l(this, j, "");
1310
- l(this, A, 10);
1311
- l(this, E, "25MB");
1158
+ l(this, E, "");
1159
+ l(this, L, "");
1160
+ l(this, T, 10);
1161
+ l(this, A, "25MB");
1312
1162
  l(this, N, 0);
1313
- l(this, B, "");
1314
- l(this, P, {});
1315
- l(this, R, "default");
1163
+ l(this, P, "");
1164
+ l(this, R, {});
1165
+ l(this, G, "default");
1166
+ l(this, B, {});
1316
1167
  l(this, I, {});
1317
- l(this, G, {});
1318
1168
  l(this, _, !1);
1319
1169
  l(this, K, "");
1320
- l(this, W, null);
1321
- l(this, Y, null);
1322
- l(this, q, []);
1170
+ l(this, q, null);
1171
+ l(this, V, null);
1172
+ l(this, Y, []);
1323
1173
  l(this, H, "");
1324
- l(this, V, !1);
1325
1174
  l(this, J, !1);
1326
- l(this, X, "");
1175
+ l(this, X, !1);
1176
+ l(this, W, "");
1327
1177
  }
1328
1178
  get client() {
1329
1179
  return d(this, k);
@@ -1356,64 +1206,64 @@ let s = (ye = class extends Ce {
1356
1206
  c(this, S, e);
1357
1207
  }
1358
1208
  get dropzone() {
1359
- return d(this, C);
1209
+ return d(this, M);
1360
1210
  }
1361
1211
  set dropzone(e) {
1362
- c(this, C, e);
1212
+ c(this, M, e);
1363
1213
  }
1364
1214
  get allowRename() {
1365
- return d(this, M);
1215
+ return d(this, C);
1366
1216
  }
1367
1217
  set allowRename(e) {
1368
- c(this, M, e);
1218
+ c(this, C, e);
1369
1219
  }
1370
1220
  get autoUpload() {
1371
- return d(this, L);
1221
+ return d(this, j);
1372
1222
  }
1373
1223
  set autoUpload(e) {
1374
- c(this, L, e);
1224
+ c(this, j, e);
1375
1225
  }
1376
1226
  get branding() {
1377
- return d(this, T);
1227
+ return d(this, F);
1378
1228
  }
1379
1229
  set branding(e) {
1380
- c(this, T, e);
1230
+ c(this, F, e);
1381
1231
  }
1382
1232
  get logoUrl() {
1383
- return d(this, F);
1233
+ return d(this, O);
1384
1234
  }
1385
1235
  set logoUrl(e) {
1386
- c(this, F, e);
1236
+ c(this, O, e);
1387
1237
  }
1388
1238
  get logoText() {
1389
- return d(this, O);
1239
+ return d(this, D);
1390
1240
  }
1391
1241
  set logoText(e) {
1392
- c(this, O, e);
1242
+ c(this, D, e);
1393
1243
  }
1394
1244
  get heading() {
1395
- return d(this, D);
1245
+ return d(this, E);
1396
1246
  }
1397
1247
  set heading(e) {
1398
- c(this, D, e);
1248
+ c(this, E, e);
1399
1249
  }
1400
1250
  get description() {
1401
- return d(this, j);
1251
+ return d(this, L);
1402
1252
  }
1403
1253
  set description(e) {
1404
- c(this, j, e);
1254
+ c(this, L, e);
1405
1255
  }
1406
1256
  get maxFiles() {
1407
- return d(this, A);
1257
+ return d(this, T);
1408
1258
  }
1409
1259
  set maxFiles(e) {
1410
- c(this, A, e);
1260
+ c(this, T, e);
1411
1261
  }
1412
1262
  get maxSize() {
1413
- return d(this, E);
1263
+ return d(this, A);
1414
1264
  }
1415
1265
  set maxSize(e) {
1416
- c(this, E, e);
1266
+ c(this, A, e);
1417
1267
  }
1418
1268
  get minSize() {
1419
1269
  return d(this, N);
@@ -1422,34 +1272,34 @@ let s = (ye = class extends Ce {
1422
1272
  c(this, N, e);
1423
1273
  }
1424
1274
  get accept() {
1425
- return d(this, B);
1275
+ return d(this, P);
1426
1276
  }
1427
1277
  set accept(e) {
1428
- c(this, B, e);
1278
+ c(this, P, e);
1429
1279
  }
1430
1280
  get rules() {
1431
- return d(this, P);
1281
+ return d(this, R);
1432
1282
  }
1433
1283
  set rules(e) {
1434
- c(this, P, e);
1284
+ c(this, R, e);
1435
1285
  }
1436
1286
  get bucket() {
1437
- return d(this, R);
1287
+ return d(this, G);
1438
1288
  }
1439
1289
  set bucket(e) {
1440
- c(this, R, e);
1290
+ c(this, G, e);
1441
1291
  }
1442
1292
  get metadata() {
1443
- return d(this, I);
1293
+ return d(this, B);
1444
1294
  }
1445
1295
  set metadata(e) {
1446
- c(this, I, e);
1296
+ c(this, B, e);
1447
1297
  }
1448
1298
  get options() {
1449
- return d(this, G);
1299
+ return d(this, I);
1450
1300
  }
1451
1301
  set options(e) {
1452
- c(this, G, e);
1302
+ c(this, I, e);
1453
1303
  }
1454
1304
  get publicRead() {
1455
1305
  return d(this, _);
@@ -1464,22 +1314,22 @@ let s = (ye = class extends Ce {
1464
1314
  c(this, K, e);
1465
1315
  }
1466
1316
  get onComplete() {
1467
- return d(this, W);
1317
+ return d(this, q);
1468
1318
  }
1469
1319
  set onComplete(e) {
1470
- c(this, W, e);
1320
+ c(this, q, e);
1471
1321
  }
1472
1322
  get onError() {
1473
- return d(this, Y);
1323
+ return d(this, V);
1474
1324
  }
1475
1325
  set onError(e) {
1476
- c(this, Y, e);
1326
+ c(this, V, e);
1477
1327
  }
1478
1328
  get items() {
1479
- return d(this, q);
1329
+ return d(this, Y);
1480
1330
  }
1481
1331
  set items(e) {
1482
- c(this, q, e);
1332
+ c(this, Y, e);
1483
1333
  }
1484
1334
  get notice() {
1485
1335
  return d(this, H);
@@ -1488,29 +1338,29 @@ let s = (ye = class extends Ce {
1488
1338
  c(this, H, e);
1489
1339
  }
1490
1340
  get busy() {
1491
- return d(this, V);
1341
+ return d(this, J);
1492
1342
  }
1493
1343
  set busy(e) {
1494
- c(this, V, e);
1344
+ c(this, J, e);
1495
1345
  }
1496
1346
  get dragging() {
1497
- return d(this, J);
1347
+ return d(this, X);
1498
1348
  }
1499
1349
  set dragging(e) {
1500
- c(this, J, e);
1350
+ c(this, X, e);
1501
1351
  }
1502
1352
  get editing() {
1503
- return d(this, X);
1353
+ return d(this, W);
1504
1354
  }
1505
1355
  set editing(e) {
1506
- c(this, X, e);
1356
+ c(this, W, e);
1507
1357
  }
1508
1358
  get msg() {
1509
- return De(this.messages);
1359
+ return Ce(this.messages);
1510
1360
  }
1511
1361
  /** An explicit `.client`, else the page default. */
1512
1362
  get resolvedClient() {
1513
- return this.client ?? Le() ?? null;
1363
+ return this.client ?? Se() ?? null;
1514
1364
  }
1515
1365
  /** The staging list, for host code that wants to inspect or persist it. */
1516
1366
  get files() {
@@ -1519,7 +1369,7 @@ let s = (ye = class extends Ce {
1519
1369
  /** Overall progress across the current batch, 0–100. */
1520
1370
  get percent() {
1521
1371
  const e = this.items.filter((t) => t.status !== "ready");
1522
- return e.length ? Math.round(e.reduce((t, o) => t + o.percent, 0) / e.length) : 0;
1372
+ return e.length ? Math.round(e.reduce((t, i) => t + i.percent, 0) / e.length) : 0;
1523
1373
  }
1524
1374
  // ── public API ────────────────────────────────────────────
1525
1375
  /** Opens the file picker. */
@@ -1536,12 +1386,12 @@ let s = (ye = class extends Ce {
1536
1386
  */
1537
1387
  set config(e) {
1538
1388
  const t = this;
1539
- for (const o of ve)
1540
- e && o in e && (t[o] = e[o]);
1389
+ for (const i of be)
1390
+ e && i in e && (t[i] = e[i]);
1541
1391
  }
1542
1392
  get config() {
1543
1393
  const e = this;
1544
- return Object.fromEntries(ve.map((t) => [t, e[t]]));
1394
+ return Object.fromEntries(be.map((t) => [t, e[t]]));
1545
1395
  }
1546
1396
  /** Drops every staged file and any notice. */
1547
1397
  clear() {
@@ -1552,9 +1402,9 @@ let s = (ye = class extends Ce {
1552
1402
  }
1553
1403
  /** Uploads everything staged. Rows that already succeeded are left alone. */
1554
1404
  async upload() {
1555
- var u;
1405
+ var g;
1556
1406
  if (this.busy) return;
1557
- const e = this.items.filter((i) => i.status === "ready" || i.status === "error");
1407
+ const e = this.items.filter((o) => o.status === "ready" || o.status === "error");
1558
1408
  if (!e.length) return;
1559
1409
  const t = this.resolvedClient;
1560
1410
  if (!t) {
@@ -1562,35 +1412,35 @@ let s = (ye = class extends Ce {
1562
1412
  return;
1563
1413
  }
1564
1414
  this.busy = !0, this.notice = "";
1565
- for (const i of e)
1566
- i.status = "uploading", i.percent = 0, i.error = "";
1415
+ for (const o of e)
1416
+ o.status = "uploading", o.percent = 0, o.error = "";
1567
1417
  this.items = [...this.items];
1568
- const o = /* @__PURE__ */ new Map(), n = e.map((i) => {
1569
- const a = { file: i.file, filename: i.file.name };
1570
- return this.bucket && (a.bucket = this.bucket), this.publicRead && (a.publicRead = !0), i.name !== i.file.name && (a.newName = i.name), Object.keys(this.metadata ?? {}).length && (a.metadata = { ...this.metadata }), Object.keys(this.options ?? {}).length && (a.options = { ...this.options }), o.set(a, i), a;
1418
+ const i = /* @__PURE__ */ new Map(), s = e.map((o) => {
1419
+ const a = { file: o.file, filename: o.file.name };
1420
+ return this.bucket && (a.bucket = this.bucket), this.publicRead && (a.publicRead = !0), o.name !== o.file.name && (a.newName = o.name), Object.keys(this.metadata ?? {}).length && (a.metadata = { ...this.metadata }), Object.keys(this.options ?? {}).length && (a.options = { ...this.options }), i.set(a, o), a;
1571
1421
  });
1572
1422
  try {
1573
- const i = await t.files.upload(n, {
1574
- onProgress: (b) => {
1575
- const h = o.get(b.input);
1576
- h && (h.percent = b.percent, this.items = [...this.items], this.emit("singlebase-upload-progress", { file: h, percent: this.percent }));
1423
+ const o = await t.files.upload(s, {
1424
+ onProgress: (f) => {
1425
+ const h = i.get(f.input);
1426
+ h && (h.percent = f.percent, this.items = [...this.items], this.emit("singlebase-upload-progress", { file: h, percent: this.percent }));
1577
1427
  }
1578
1428
  });
1579
- for (const b of i.completed) {
1580
- const h = o.get(b.input);
1581
- h && (h.status = "done", h.percent = 100, h.record = b.file);
1429
+ for (const f of o.completed) {
1430
+ const h = i.get(f.input);
1431
+ h && (h.status = "done", h.percent = 100, h.record = f.file);
1582
1432
  }
1583
- for (const b of i.failed) {
1584
- const h = o.get(b.input);
1585
- h && (h.status = "error", h.error = b.error.message || b.error.code);
1433
+ for (const f of o.failed) {
1434
+ const h = i.get(f.input);
1435
+ h && (h.status = "error", h.error = f.error.message || f.error.code);
1586
1436
  }
1587
1437
  this.items = [...this.items];
1588
- const a = i.completed.map((b) => o.get(b.input)).filter(Boolean), m = i.failed.map((b) => o.get(b.input)).filter(Boolean);
1589
- this.emit("singlebase-upload-complete", { completed: a, failed: m }), (u = this.onComplete) == null || u.call(this, { completed: a, failed: m }), m.length ? this.notice = this.msg.errUpload : this.redirect();
1590
- } catch (i) {
1438
+ const a = o.completed.map((f) => i.get(f.input)).filter(Boolean), m = o.failed.map((f) => i.get(f.input)).filter(Boolean);
1439
+ this.emit("singlebase-upload-complete", { completed: a, failed: m }), (g = this.onComplete) == null || g.call(this, { completed: a, failed: m }), m.length ? this.notice = this.msg.errUpload : this.redirect();
1440
+ } catch (o) {
1591
1441
  for (const a of e)
1592
1442
  a.status = "error", a.error = "";
1593
- this.items = [...this.items], this.fail(et(i) || this.msg.errUpload);
1443
+ this.items = [...this.items], this.fail(Xe(o) || this.msg.errUpload);
1594
1444
  } finally {
1595
1445
  this.busy = !1;
1596
1446
  }
@@ -1598,10 +1448,10 @@ let s = (ye = class extends Ce {
1598
1448
  // ── staging ───────────────────────────────────────────────
1599
1449
  /** The rule for this filename's extension, if the host set one. */
1600
1450
  ruleFor(e) {
1601
- const t = te(e);
1451
+ const t = oe(e);
1602
1452
  if (!t) return null;
1603
- for (const [o, n] of Object.entries(this.rules ?? {}))
1604
- if (o.toLowerCase().replace(/^\./, "") === t) return n;
1453
+ for (const [i, s] of Object.entries(this.rules ?? {}))
1454
+ if (i.toLowerCase().replace(/^\./, "") === t) return s;
1605
1455
  return null;
1606
1456
  }
1607
1457
  async add(e) {
@@ -1609,29 +1459,29 @@ let s = (ye = class extends Ce {
1609
1459
  const a = this.items.filter((m) => m.status === "done" || m.status === "error");
1610
1460
  a.forEach(w), this.items = this.items.filter((m) => !a.includes(m));
1611
1461
  }
1612
- const t = this.maxFiles > 0 ? this.maxFiles : Number.POSITIVE_INFINITY, o = [...this.items], n = o.length, u = [];
1613
- let i = "";
1462
+ const t = this.maxFiles > 0 ? this.maxFiles : Number.POSITIVE_INFINITY, i = [...this.items], s = i.length, g = [];
1463
+ let o = "";
1614
1464
  for (const a of Array.from(e)) {
1615
- if (o.length >= t) {
1616
- i = v(this.msg.errTooMany, { max: t });
1465
+ if (i.length >= t) {
1466
+ o = v(this.msg.errTooMany, { max: t });
1617
1467
  break;
1618
1468
  }
1619
- if (this.accept && !Ee(this.accept, a.name, a.type)) {
1620
- i = v(this.msg.errType, { name: a.name });
1469
+ if (this.accept && !je(this.accept, a.name, a.type)) {
1470
+ o = v(this.msg.errType, { name: a.name });
1621
1471
  continue;
1622
1472
  }
1623
- const m = this.ruleFor(a.name), b = ne((m == null ? void 0 : m.maxSize) ?? this.maxSize), h = ne((m == null ? void 0 : m.minSize) ?? this.minSize);
1624
- if (b && a.size > b) {
1625
- i = v(this.msg.errTooLarge, { name: a.name, size: ee(b) });
1473
+ const m = this.ruleFor(a.name), f = se((m == null ? void 0 : m.maxSize) ?? this.maxSize), h = se((m == null ? void 0 : m.minSize) ?? this.minSize);
1474
+ if (f && a.size > f) {
1475
+ o = v(this.msg.errTooLarge, { name: a.name, size: ee(f) });
1626
1476
  continue;
1627
1477
  }
1628
1478
  if (h && a.size < h) {
1629
- i = v(this.msg.errTooSmall, { name: a.name, size: ee(h) });
1479
+ o = v(this.msg.errTooSmall, { name: a.name, size: ee(h) });
1630
1480
  continue;
1631
1481
  }
1632
- const Q = Be(a);
1633
- if (o.some((ie) => ie.key === Q)) {
1634
- i = v(this.msg.errDuplicate, { name: a.name });
1482
+ const Q = Fe(a);
1483
+ if (i.some((ie) => ie.key === Q)) {
1484
+ o = v(this.msg.errDuplicate, { name: a.name });
1635
1485
  continue;
1636
1486
  }
1637
1487
  const y = {
@@ -1646,16 +1496,16 @@ let s = (ye = class extends Ce {
1646
1496
  record: null,
1647
1497
  pages: null,
1648
1498
  encrypted: null,
1649
- preview: Qe(a)
1499
+ preview: Je(a)
1650
1500
  };
1651
- o.push(y), u.push(y);
1501
+ i.push(y), g.push(y);
1652
1502
  }
1653
- this.notice = i, i && this.emit("singlebase-upload-rejected", { message: i }), o.length !== n && (this.items = o, this.emit("singlebase-upload-selected", { files: this.items }), await Promise.all(
1654
- u.filter((a) => a.status === "checking").map((a) => this.inspect(a, this.ruleFor(a.file.name)))
1503
+ this.notice = o, o && this.emit("singlebase-upload-rejected", { message: o }), i.length !== s && (this.items = i, this.emit("singlebase-upload-selected", { files: this.items }), await Promise.all(
1504
+ g.filter((a) => a.status === "checking").map((a) => this.inspect(a, this.ruleFor(a.file.name)))
1655
1505
  ), (this.autoUpload || this.view === "button") && this.upload());
1656
1506
  }
1657
1507
  needsInspection(e, t) {
1658
- return !e || !Ke(te(t)) ? !1 : e.maxPages !== void 0 || e.allowProtected === !1;
1508
+ return !e || !Ge(oe(t)) ? !1 : e.maxPages !== void 0 || e.allowProtected === !1;
1659
1509
  }
1660
1510
  /**
1661
1511
  * Reads the file and applies the rule. A fact the reader could not
@@ -1663,21 +1513,21 @@ let s = (ye = class extends Ce {
1663
1513
  * the page rule simply doesn't apply to that file.
1664
1514
  */
1665
1515
  async inspect(e, t) {
1666
- const o = await _e(e.file, te(e.file.name));
1667
- e.pages = o.pages, e.encrypted = o.encrypted;
1668
- let n = "";
1669
- t.allowProtected === !1 && o.encrypted === !0 ? n = v(this.msg.errProtected, { name: e.name }) : t.maxPages && o.pages !== null && o.pages > t.maxPages && (n = v(this.msg.errTooManyPages, {
1516
+ const i = await Re(e.file, oe(e.file.name));
1517
+ e.pages = i.pages, e.encrypted = i.encrypted;
1518
+ let s = "";
1519
+ t.allowProtected === !1 && i.encrypted === !0 ? s = v(this.msg.errProtected, { name: e.name }) : t.maxPages && i.pages !== null && i.pages > t.maxPages && (s = v(this.msg.errTooManyPages, {
1670
1520
  name: e.name,
1671
- pages: o.pages,
1521
+ pages: i.pages,
1672
1522
  max: t.maxPages
1673
- })), n ? (w(e), this.items = this.items.filter((u) => u !== e), this.notice = n, this.emit("singlebase-upload-rejected", { message: n })) : (e.status = "ready", this.items = [...this.items]);
1523
+ })), s ? (w(e), this.items = this.items.filter((g) => g !== e), this.notice = s, this.emit("singlebase-upload-rejected", { message: s })) : (e.status = "ready", this.items = [...this.items]);
1674
1524
  }
1675
1525
  /** Drops one staged file. Named for the row action, not Element.remove(). */
1676
1526
  removeItem(e) {
1677
1527
  this.items.filter((t) => t.key === e).forEach(w), this.items = this.items.filter((t) => t.key !== e), this.notice = "";
1678
1528
  }
1679
1529
  commitRename(e, t) {
1680
- e.name = Pe(e.file.name, t), this.editing = "", this.items = [...this.items];
1530
+ e.name = Oe(e.file.name, t), this.editing = "", this.items = [...this.items];
1681
1531
  }
1682
1532
  fail(e) {
1683
1533
  var t;
@@ -1688,7 +1538,7 @@ let s = (ye = class extends Ce {
1688
1538
  }
1689
1539
  redirect() {
1690
1540
  if (!this.redirectUrl || typeof location > "u") return;
1691
- const e = Oe(
1541
+ const e = Te(
1692
1542
  this.redirectUrl,
1693
1543
  location.href,
1694
1544
  (t) => console.warn(`[singlebase-uploader] ${t}`)
@@ -1697,14 +1547,14 @@ let s = (ye = class extends Ce {
1697
1547
  }
1698
1548
  // ── events ────────────────────────────────────────────────
1699
1549
  onPick(e) {
1700
- var o;
1550
+ var i;
1701
1551
  const t = e.target;
1702
- (o = t.files) != null && o.length && this.add(t.files), t.value = "";
1552
+ (i = t.files) != null && i.length && this.add(t.files), t.value = "";
1703
1553
  }
1704
1554
  onDrop(e) {
1705
- var o;
1555
+ var i;
1706
1556
  e.preventDefault(), this.dragging = !1;
1707
- const t = (o = e.dataTransfer) == null ? void 0 : o.files;
1557
+ const t = (i = e.dataTransfer) == null ? void 0 : i.files;
1708
1558
  t != null && t.length && this.add(t);
1709
1559
  }
1710
1560
  onDragOver(e) {
@@ -1725,11 +1575,11 @@ let s = (ye = class extends Ce {
1725
1575
  return this.items.filter((e) => e.status === "ready" || e.status === "error").length;
1726
1576
  }
1727
1577
  get hint() {
1728
- const e = Ne(this.accept), t = ne(this.maxSize), o = t ? v(this.msg.hintUpTo, { size: ee(t) }) : "";
1729
- return [e, o].filter(Boolean).join(" · ");
1578
+ const e = De(this.accept), t = se(this.maxSize), i = t ? v(this.msg.hintUpTo, { size: ee(t) }) : "";
1579
+ return [e, i].filter(Boolean).join(" · ");
1730
1580
  }
1731
1581
  renderInput() {
1732
- return f`<input
1582
+ return u`<input
1733
1583
  class="sr-only"
1734
1584
  type="file"
1735
1585
  ?multiple=${this.maxFiles !== 1}
@@ -1738,27 +1588,27 @@ let s = (ye = class extends Ce {
1738
1588
  />`;
1739
1589
  }
1740
1590
  renderLogo() {
1741
- return this.logoUrl ? f`<img
1591
+ return this.logoUrl ? u`<img
1742
1592
  class="logo-img"
1743
1593
  src=${this.logoUrl}
1744
1594
  alt=${this.logoText || "Logo"}
1745
1595
  part="logo"
1746
- />` : this.logoText ? f`<div class="brand-mark" part="logo">${this.logoText}</div>` : x;
1596
+ />` : this.logoText ? u`<div class="brand-mark" part="logo">${this.logoText}</div>` : x;
1747
1597
  }
1748
1598
  renderBranding() {
1749
- return this.branding ? f`<div class="branding" part="branding">
1599
+ return this.branding ? u`<div class="branding" part="branding">
1750
1600
  <a href="https://singlebase.cloud" target="_blank" rel="noopener noreferrer"
1751
1601
  >${this.msg.brandingLabel}</a
1752
1602
  >
1753
1603
  </div>` : x;
1754
1604
  }
1755
1605
  renderNotice() {
1756
- return this.notice ? f`<div class="banner" role="alert" part="error">${this.notice}</div>` : x;
1606
+ return this.notice ? u`<div class="banner" role="alert" part="error">${this.notice}</div>` : x;
1757
1607
  }
1758
1608
  renderCount() {
1759
1609
  if (!this.items.length) return x;
1760
1610
  const e = this.items.length === 1 ? this.msg.countOne : this.msg.countMany;
1761
- return f`<div class="count" part="count">
1611
+ return u`<div class="count" part="count">
1762
1612
  ${v(e, { n: this.items.length, max: this.maxFiles })}
1763
1613
  </div>`;
1764
1614
  }
@@ -1769,25 +1619,25 @@ let s = (ye = class extends Ce {
1769
1619
  if (e.status === "done") return `${t} · ${this.msg.uploaded}`;
1770
1620
  if (e.status === "error")
1771
1621
  return `${t} · ${e.error || this.msg.failedLabel}`;
1772
- const o = e.pages ? ` · ${v(this.msg.pagesLabel, { n: e.pages })}` : "";
1773
- return t + o;
1622
+ const i = e.pages ? ` · ${v(this.msg.pagesLabel, { n: e.pages })}` : "";
1623
+ return t + i;
1774
1624
  }
1775
1625
  renderRow(e) {
1776
1626
  const t = this.allowRename && e.status === "ready";
1777
- return e.status === "uploading" || e.status, f`<div class="row" part="file">
1627
+ return e.status === "uploading" || e.status, u`<div class="row" part="file">
1778
1628
  <div class="chip" part="file-type">
1779
- ${e.preview ? f`<img class="thumb" src=${e.preview} alt="" part="preview" />` : Ae(e.name) || "FILE"}
1629
+ ${e.preview ? u`<img class="thumb" src=${e.preview} alt="" part="preview" />` : Ee(e.name) || "FILE"}
1780
1630
  </div>
1781
1631
  <div class="meta">
1782
- ${this.editing === e.key ? f`<input
1632
+ ${this.editing === e.key ? u`<input
1783
1633
  class="name-input"
1784
1634
  .value=${e.name}
1785
1635
  autofocus
1786
- @keydown=${(o) => {
1787
- o.key === "Enter" ? this.commitRename(e, o.target.value) : o.key === "Escape" && (this.editing = "");
1636
+ @keydown=${(i) => {
1637
+ i.key === "Enter" ? this.commitRename(e, i.target.value) : i.key === "Escape" && (this.editing = "");
1788
1638
  }}
1789
- @blur=${(o) => this.commitRename(e, o.target.value)}
1790
- />` : t ? f`<button
1639
+ @blur=${(i) => this.commitRename(e, i.target.value)}
1640
+ />` : t ? u`<button
1791
1641
  class="name"
1792
1642
  title=${this.msg.rename}
1793
1643
  @click=${() => {
@@ -1795,40 +1645,40 @@ let s = (ye = class extends Ce {
1795
1645
  }}
1796
1646
  >
1797
1647
  ${e.name}
1798
- </button>` : f`<div class="name">${e.name}</div>`}
1648
+ </button>` : u`<div class="name">${e.name}</div>`}
1799
1649
  <div class="sz" data-state=${e.status}>${this.renderStatus(e)}</div>
1800
- ${e.status === "uploading" ? f`<div class="bar" part="progress">
1650
+ ${e.status === "uploading" ? u`<div class="bar" part="progress">
1801
1651
  <div class="bar-fill" style="width:${e.percent}%"></div>
1802
1652
  </div>` : x}
1803
1653
  </div>
1804
1654
  <div class="row-act">
1805
- ${e.status === "error" ? f`<button class="link-sm" @click=${() => void this.upload()}>
1655
+ ${e.status === "error" ? u`<button class="link-sm" @click=${() => void this.upload()}>
1806
1656
  ${this.msg.retry}
1807
1657
  </button>` : x}
1808
- ${e.status === "uploading" || e.status === "done" ? x : f`<button class="link-sm" @click=${() => this.removeItem(e.key)}>
1658
+ ${e.status === "uploading" || e.status === "done" ? x : u`<button class="link-sm" @click=${() => this.removeItem(e.key)}>
1809
1659
  ${this.msg.remove}
1810
1660
  </button>`}
1811
1661
  </div>
1812
1662
  </div>`;
1813
1663
  }
1814
1664
  renderRows() {
1815
- return this.items.length ? f`<div class="rows" part="files">
1665
+ return this.items.length ? u`<div class="rows" part="files">
1816
1666
  ${this.items.map((e) => this.renderRow(e))}
1817
1667
  </div>` : x;
1818
1668
  }
1819
1669
  renderDropzone() {
1820
- return f`<div class="drop" part="dropzone" data-drag=${String(this.dragging)}>
1670
+ return u`<div class="drop" part="dropzone" data-drag=${String(this.dragging)}>
1821
1671
  <div class="arrow" aria-hidden="true">↑</div>
1822
1672
  <div class="drop-title">${this.msg.dropTitle}</div>
1823
1673
  <button class="link" @click=${this.open}>${this.msg.dropSub}</button>
1824
- ${this.hint ? f`<div class="hint">${this.hint}</div>` : x}
1674
+ ${this.hint ? u`<div class="hint">${this.hint}</div>` : x}
1825
1675
  </div>`;
1826
1676
  }
1827
1677
  renderUploadCta() {
1828
1678
  const e = this.pendingCount;
1829
1679
  if (this.autoUpload || !e && !this.busy) return x;
1830
1680
  const t = e === 1 ? this.msg.uploadCtaOne : this.msg.uploadCtaMany;
1831
- return f`<button
1681
+ return u`<button
1832
1682
  class="primary wide"
1833
1683
  part="submit"
1834
1684
  ?disabled=${this.busy || this.checking}
@@ -1843,26 +1693,26 @@ let s = (ye = class extends Ce {
1843
1693
  */
1844
1694
  renderFull() {
1845
1695
  const e = this.dropzone && !this.items.length && this.canAddMore;
1846
- return f`<div
1696
+ return u`<div
1847
1697
  class="card"
1848
1698
  part="card"
1849
1699
  @dragover=${this.onDragOver}
1850
1700
  @dragleave=${this.onDragLeave}
1851
1701
  @drop=${this.onDrop}
1852
1702
  >
1853
- ${this.logoUrl || this.logoText || this.heading || this.description ? f`<div class="head-block">
1703
+ ${this.logoUrl || this.logoText || this.heading || this.description ? u`<div class="head-block">
1854
1704
  ${this.renderLogo()}
1855
- ${this.heading ? f`<div class="title">${this.heading}</div>` : x}
1856
- ${this.description ? f`<div class="sub">${this.description}</div>` : x}
1705
+ ${this.heading ? u`<div class="title">${this.heading}</div>` : x}
1706
+ ${this.description ? u`<div class="sub">${this.description}</div>` : x}
1857
1707
  </div>` : x}
1858
1708
  ${this.renderCount()} ${this.renderNotice()} ${this.renderRows()}
1859
1709
  ${e ? this.renderDropzone() : x}
1860
- ${!e && this.canAddMore ? f`<button class="add-more" @click=${this.open}>${this.msg.addMore}</button>` : x}
1710
+ ${!e && this.canAddMore ? u`<button class="add-more" @click=${this.open}>${this.msg.addMore}</button>` : x}
1861
1711
  ${this.renderUploadCta()} ${this.renderBranding()}
1862
1712
  </div>`;
1863
1713
  }
1864
1714
  renderCompact() {
1865
- return f`<div
1715
+ return u`<div
1866
1716
  class="card"
1867
1717
  part="card"
1868
1718
  @dragover=${this.onDragOver}
@@ -1873,36 +1723,36 @@ let s = (ye = class extends Ce {
1873
1723
  <span class="sec-title">${this.heading || this.msg.attachments}</span>
1874
1724
  <span class="count">${this.items.length} / ${this.maxFiles}</span>
1875
1725
  </div>
1876
- ${this.dropzone ? f`<div class="strip" part="dropzone" data-drag=${String(this.dragging)}>
1726
+ ${this.dropzone ? u`<div class="strip" part="dropzone" data-drag=${String(this.dragging)}>
1877
1727
  <span class="strip-label">${this.msg.dropOrChoose}</span>
1878
1728
  <button class="secondary" ?disabled=${!this.canAddMore} @click=${this.open}>
1879
1729
  ${this.msg.chooseFiles}
1880
1730
  </button>
1881
- </div>` : f`<button class="secondary" ?disabled=${!this.canAddMore} @click=${this.open}>
1731
+ </div>` : u`<button class="secondary" ?disabled=${!this.canAddMore} @click=${this.open}>
1882
1732
  ${this.msg.chooseFiles}
1883
1733
  </button>`}
1884
- ${this.hint ? f`<div class="hint">${this.hint}</div>` : x} ${this.renderNotice()}
1734
+ ${this.hint ? u`<div class="hint">${this.hint}</div>` : x} ${this.renderNotice()}
1885
1735
  ${this.renderRows()} ${this.renderUploadCta()} ${this.renderBranding()}
1886
1736
  </div>`;
1887
1737
  }
1888
1738
  renderButton() {
1889
1739
  const e = this.items[this.items.length - 1];
1890
- return f`<div class="button-view">
1740
+ return u`<div class="button-view">
1891
1741
  <button class="primary" ?disabled=${this.busy || !this.canAddMore} @click=${this.open}>
1892
1742
  ${this.busy ? this.msg.uploading : this.msg.chooseFile}
1893
1743
  </button>
1894
- ${e && e.status !== "ready" ? f`<div class="sz" data-state=${e.status}>${this.renderStatus(e)}</div>` : x}
1744
+ ${e && e.status !== "ready" ? u`<div class="sz" data-state=${e.status}>${this.renderStatus(e)}</div>` : x}
1895
1745
  ${this.renderNotice()}
1896
1746
  </div>`;
1897
1747
  }
1898
1748
  render() {
1899
- return f`${this.renderInput()}${this.view === "button" ? this.renderButton() : this.view === "compact" ? this.renderCompact() : this.renderFull()}`;
1749
+ return u`${this.renderInput()}${this.view === "button" ? this.renderButton() : this.view === "compact" ? this.renderCompact() : this.renderFull()}`;
1900
1750
  }
1901
- }, k = new WeakMap(), z = new WeakMap(), $ = new WeakMap(), U = new WeakMap(), S = new WeakMap(), C = new WeakMap(), M = new WeakMap(), L = new WeakMap(), T = new WeakMap(), F = new WeakMap(), O = new WeakMap(), D = new WeakMap(), j = new WeakMap(), A = new WeakMap(), E = new WeakMap(), N = new WeakMap(), B = new WeakMap(), P = new WeakMap(), R = new WeakMap(), I = new WeakMap(), G = new WeakMap(), _ = new WeakMap(), K = new WeakMap(), W = new WeakMap(), Y = new WeakMap(), q = new WeakMap(), H = new WeakMap(), V = new WeakMap(), J = new WeakMap(), X = new WeakMap(), ye);
1902
- Ze(s, "styles", [
1903
- Te,
1904
- Fe,
1905
- se`
1751
+ }, k = new WeakMap(), z = new WeakMap(), $ = new WeakMap(), U = new WeakMap(), S = new WeakMap(), M = new WeakMap(), C = new WeakMap(), j = new WeakMap(), F = new WeakMap(), O = new WeakMap(), D = new WeakMap(), E = new WeakMap(), L = new WeakMap(), T = new WeakMap(), A = new WeakMap(), N = new WeakMap(), P = new WeakMap(), R = new WeakMap(), G = new WeakMap(), B = new WeakMap(), I = new WeakMap(), _ = new WeakMap(), K = new WeakMap(), q = new WeakMap(), V = new WeakMap(), Y = new WeakMap(), H = new WeakMap(), J = new WeakMap(), X = new WeakMap(), W = new WeakMap(), he);
1752
+ He(n, "styles", [
1753
+ Me,
1754
+ Le,
1755
+ me`
1906
1756
  .card {
1907
1757
  display: flex;
1908
1758
  flex-direction: column;
@@ -2175,116 +2025,112 @@ Ze(s, "styles", [
2175
2025
  `
2176
2026
  ]);
2177
2027
  p([
2178
- g({ attribute: !1 })
2179
- ], s.prototype, "client", 1);
2028
+ b({ attribute: !1 })
2029
+ ], n.prototype, "client", 1);
2180
2030
  p([
2181
- g({ attribute: !1 })
2182
- ], s.prototype, "messages", 1);
2031
+ b({ attribute: !1 })
2032
+ ], n.prototype, "messages", 1);
2183
2033
  p([
2184
- g({ reflect: !0 })
2185
- ], s.prototype, "theme", 1);
2034
+ b({ reflect: !0 })
2035
+ ], n.prototype, "theme", 1);
2186
2036
  p([
2187
- g({ reflect: !0 })
2188
- ], s.prototype, "density", 1);
2037
+ b({ reflect: !0 })
2038
+ ], n.prototype, "density", 1);
2189
2039
  p([
2190
- g({ reflect: !0 })
2191
- ], s.prototype, "view", 1);
2040
+ b({ reflect: !0 })
2041
+ ], n.prototype, "view", 1);
2192
2042
  p([
2193
- g({ converter: le })
2194
- ], s.prototype, "dropzone", 1);
2043
+ b({ converter: de })
2044
+ ], n.prototype, "dropzone", 1);
2195
2045
  p([
2196
- g({ converter: le, attribute: "allow-rename" })
2197
- ], s.prototype, "allowRename", 1);
2046
+ b({ converter: de, attribute: "allow-rename" })
2047
+ ], n.prototype, "allowRename", 1);
2198
2048
  p([
2199
- g({ type: Boolean, attribute: "auto-upload" })
2200
- ], s.prototype, "autoUpload", 1);
2049
+ b({ type: Boolean, attribute: "auto-upload" })
2050
+ ], n.prototype, "autoUpload", 1);
2201
2051
  p([
2202
- g({ converter: le })
2203
- ], s.prototype, "branding", 1);
2052
+ b({ converter: de })
2053
+ ], n.prototype, "branding", 1);
2204
2054
  p([
2205
- g({ attribute: "logo-url" })
2206
- ], s.prototype, "logoUrl", 1);
2055
+ b({ attribute: "logo-url" })
2056
+ ], n.prototype, "logoUrl", 1);
2207
2057
  p([
2208
- g({ attribute: "logo-text" })
2209
- ], s.prototype, "logoText", 1);
2058
+ b({ attribute: "logo-text" })
2059
+ ], n.prototype, "logoText", 1);
2210
2060
  p([
2211
- g()
2212
- ], s.prototype, "heading", 1);
2061
+ b()
2062
+ ], n.prototype, "heading", 1);
2213
2063
  p([
2214
- g()
2215
- ], s.prototype, "description", 1);
2064
+ b()
2065
+ ], n.prototype, "description", 1);
2216
2066
  p([
2217
- g({ type: Number, attribute: "max-files" })
2218
- ], s.prototype, "maxFiles", 1);
2067
+ b({ type: Number, attribute: "max-files" })
2068
+ ], n.prototype, "maxFiles", 1);
2219
2069
  p([
2220
- g({ attribute: "max-size" })
2221
- ], s.prototype, "maxSize", 1);
2070
+ b({ attribute: "max-size" })
2071
+ ], n.prototype, "maxSize", 1);
2222
2072
  p([
2223
- g({ attribute: "min-size" })
2224
- ], s.prototype, "minSize", 1);
2073
+ b({ attribute: "min-size" })
2074
+ ], n.prototype, "minSize", 1);
2225
2075
  p([
2226
- g()
2227
- ], s.prototype, "accept", 1);
2076
+ b()
2077
+ ], n.prototype, "accept", 1);
2228
2078
  p([
2229
- g({ converter: de })
2230
- ], s.prototype, "rules", 1);
2079
+ b({ converter: ne })
2080
+ ], n.prototype, "rules", 1);
2231
2081
  p([
2232
- g()
2233
- ], s.prototype, "bucket", 1);
2082
+ b()
2083
+ ], n.prototype, "bucket", 1);
2234
2084
  p([
2235
- g({ converter: de })
2236
- ], s.prototype, "metadata", 1);
2085
+ b({ converter: ne })
2086
+ ], n.prototype, "metadata", 1);
2237
2087
  p([
2238
- g({ converter: de })
2239
- ], s.prototype, "options", 1);
2088
+ b({ converter: ne })
2089
+ ], n.prototype, "options", 1);
2240
2090
  p([
2241
- g({ type: Boolean, attribute: "public-read" })
2242
- ], s.prototype, "publicRead", 1);
2091
+ b({ type: Boolean, attribute: "public-read" })
2092
+ ], n.prototype, "publicRead", 1);
2243
2093
  p([
2244
- g({ attribute: "redirect-url" })
2245
- ], s.prototype, "redirectUrl", 1);
2094
+ b({ attribute: "redirect-url" })
2095
+ ], n.prototype, "redirectUrl", 1);
2246
2096
  p([
2247
- g({ attribute: !1 })
2248
- ], s.prototype, "onComplete", 1);
2097
+ b({ attribute: !1 })
2098
+ ], n.prototype, "onComplete", 1);
2249
2099
  p([
2250
- g({ attribute: !1 })
2251
- ], s.prototype, "onError", 1);
2100
+ b({ attribute: !1 })
2101
+ ], n.prototype, "onError", 1);
2252
2102
  p([
2253
2103
  Z()
2254
- ], s.prototype, "items", 1);
2104
+ ], n.prototype, "items", 1);
2255
2105
  p([
2256
2106
  Z()
2257
- ], s.prototype, "notice", 1);
2107
+ ], n.prototype, "notice", 1);
2258
2108
  p([
2259
2109
  Z()
2260
- ], s.prototype, "busy", 1);
2110
+ ], n.prototype, "busy", 1);
2261
2111
  p([
2262
2112
  Z()
2263
- ], s.prototype, "dragging", 1);
2113
+ ], n.prototype, "dragging", 1);
2264
2114
  p([
2265
2115
  Z()
2266
- ], s.prototype, "editing", 1);
2267
- s = p([
2268
- Me("singlebase-uploader")
2269
- ], s);
2270
- function Qe(r) {
2116
+ ], n.prototype, "editing", 1);
2117
+ n = p([
2118
+ Ue("singlebase-uploader")
2119
+ ], n);
2120
+ function Je(r) {
2271
2121
  return !r.type.startsWith("image/") || typeof URL.createObjectURL != "function" ? "" : URL.createObjectURL(r);
2272
2122
  }
2273
2123
  function w(r) {
2274
2124
  r.preview && URL.revokeObjectURL(r.preview);
2275
2125
  }
2276
- function et(r) {
2126
+ function Xe(r) {
2277
2127
  return r instanceof Error ? r.message : "";
2278
2128
  }
2279
2129
  export {
2280
- s as S,
2281
- he as T,
2282
- Ke as a,
2283
- De as b,
2284
- me as d,
2285
- _e as i,
2286
- Oe as r,
2287
- Fe as s,
2288
- Te as t
2130
+ n as S,
2131
+ Ge as a,
2132
+ Re as i,
2133
+ Te as r,
2134
+ Le as s
2289
2135
  };
2290
- //# sourceMappingURL=uploader-D-Da1trc.js.map
2136
+ //# sourceMappingURL=uploader-abQoem5q.js.map