@uploadcare/react-uploader 0.0.1-alpha.1 → 0.0.1-alpha.4

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.
@@ -79,15 +79,15 @@ var _ = Object.freeze({
79
79
  SET_LATER_KEY: "__toSetLater__",
80
80
  USE_TPL: "use-template",
81
81
  ROOT_STYLE_ATTR_NAME: "sym-component"
82
- }), Hi = "1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm", mr = Hi.length - 1, te = class {
82
+ }), Wi = "1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm", mr = Wi.length - 1, te = class {
83
83
  static generate(s = "XXXXXXXXX-XXX") {
84
84
  let i = "";
85
85
  for (let e = 0; e < s.length; e++)
86
- i += s[e] === "-" ? s[e] : Hi.charAt(Math.random() * mr);
86
+ i += s[e] === "-" ? s[e] : Wi.charAt(Math.random() * mr);
87
87
  return i;
88
88
  }
89
89
  };
90
- function Wi(s, i, e) {
90
+ function qi(s, i, e) {
91
91
  let t = !0, r, n = i.split(".");
92
92
  return n.forEach((o, l) => {
93
93
  l < n.length - 1 ? s = s[o] : r = o;
@@ -154,7 +154,7 @@ function br(s, i) {
154
154
  }), e.removeAttribute(_.REPEAT_ATTR), e.removeAttribute(_.REPEAT_ITEM_TAG_ATTR);
155
155
  });
156
156
  }
157
- var pi = "__default__";
157
+ var mi = "__default__";
158
158
  function _r(s, i) {
159
159
  if (i.shadowRoot)
160
160
  return;
@@ -163,14 +163,14 @@ function _r(s, i) {
163
163
  return;
164
164
  let t = {};
165
165
  e.forEach((r) => {
166
- let n = r.getAttribute("name") || pi;
166
+ let n = r.getAttribute("name") || mi;
167
167
  t[n] = {
168
168
  slot: r,
169
169
  fr: document.createDocumentFragment()
170
170
  };
171
171
  }), i.initChildren.forEach((r) => {
172
172
  var n;
173
- let o = pi;
173
+ let o = mi;
174
174
  r instanceof Element && r.hasAttribute("slot") && (o = r.getAttribute("slot"), r.removeAttribute("slot")), (n = t[o]) == null || n.fr.appendChild(r);
175
175
  }), Object.values(t).forEach((r) => {
176
176
  if (r.fr.childNodes.length)
@@ -205,18 +205,18 @@ function vr(s, i) {
205
205
  for (let h of c) {
206
206
  let d;
207
207
  h.startsWith("!!") ? (d = "double", h = h.replace("!!", "")) : h.startsWith("!") && (d = "single", h = h.replace("!", "")), i.sub(h, (f) => {
208
- d === "double" ? f = !!f : d === "single" && (f = !f), a ? (f == null ? void 0 : f.constructor) === Boolean ? f ? e.setAttribute(l, "") : e.removeAttribute(l) : e.setAttribute(l, f) : Wi(e, l, f) || (e[_.SET_LATER_KEY] || (e[_.SET_LATER_KEY] = /* @__PURE__ */ Object.create(null)), e[_.SET_LATER_KEY][l] = f);
208
+ d === "double" ? f = !!f : d === "single" && (f = !f), a ? (f == null ? void 0 : f.constructor) === Boolean ? f ? e.setAttribute(l, "") : e.removeAttribute(l) : e.setAttribute(l, f) : qi(e, l, f) || (e[_.SET_LATER_KEY] || (e[_.SET_LATER_KEY] = /* @__PURE__ */ Object.create(null)), e[_.SET_LATER_KEY][l] = f);
209
209
  });
210
210
  }
211
211
  }), e.removeAttribute(_.BIND_ATTR);
212
212
  });
213
213
  }
214
- var it = "{{", Be = "}}", Cr = "skip-text";
214
+ var it = "{{", je = "}}", Cr = "skip-text";
215
215
  function wr(s) {
216
216
  let i, e = [], t = document.createTreeWalker(s, NodeFilter.SHOW_TEXT, {
217
217
  acceptNode: (r) => {
218
218
  var n;
219
- return !((n = r.parentElement) != null && n.hasAttribute(Cr)) && r.textContent.includes(it) && r.textContent.includes(Be) && 1;
219
+ return !((n = r.parentElement) != null && n.hasAttribute(Cr)) && r.textContent.includes(it) && r.textContent.includes(je) && 1;
220
220
  }
221
221
  });
222
222
  for (; i = t.nextNode(); )
@@ -226,10 +226,10 @@ function wr(s) {
226
226
  var Er = function(s, i) {
227
227
  wr(s).forEach((t) => {
228
228
  let r = [], n;
229
- for (; t.textContent.includes(Be); )
230
- t.textContent.startsWith(it) ? (n = t.textContent.indexOf(Be) + Be.length, t.splitText(n), r.push(t)) : (n = t.textContent.indexOf(it), t.splitText(n)), t = t.nextSibling;
229
+ for (; t.textContent.includes(je); )
230
+ t.textContent.startsWith(it) ? (n = t.textContent.indexOf(je) + je.length, t.splitText(n), r.push(t)) : (n = t.textContent.indexOf(it), t.splitText(n)), t = t.nextSibling;
231
231
  r.forEach((o) => {
232
- let l = o.textContent.replace(it, "").replace(Be, "");
232
+ let l = o.textContent.replace(it, "").replace(je, "");
233
233
  o.textContent = "", i.sub(l, (a) => {
234
234
  o.textContent = a;
235
235
  });
@@ -260,7 +260,7 @@ function Ir(s) {
260
260
  throw new Error(`Failed to parse CSS property value: ${i}. Original input: ${s}`);
261
261
  }
262
262
  }
263
- var mi = 0, $e = null, re = null, ue = class extends HTMLElement {
263
+ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
264
264
  constructor() {
265
265
  super(), Dt(this, "updateCssData", () => {
266
266
  var s;
@@ -424,7 +424,7 @@ var mi = 0, $e = null, re = null, ue = class extends HTMLElement {
424
424
  let i = (s = this.getAttribute(_.CTX_NAME_ATTR)) == null ? void 0 : s.trim();
425
425
  if (i && this.style.setProperty(_.CSS_CTX_PROP, `'${i}'`), this.__initDataCtx(), this[_.SET_LATER_KEY]) {
426
426
  for (let e in this[_.SET_LATER_KEY])
427
- Wi(this, e, this[_.SET_LATER_KEY][e]);
427
+ qi(this, e, this[_.SET_LATER_KEY][e]);
428
428
  delete this[_.SET_LATER_KEY];
429
429
  }
430
430
  this.initChildren = [...this.childNodes];
@@ -463,7 +463,7 @@ var mi = 0, $e = null, re = null, ue = class extends HTMLElement {
463
463
  }, 100)));
464
464
  }
465
465
  static reg(s, i = !1) {
466
- s || (mi++, s = `${_.AUTO_TAG_PRFX}-${mi}`), this.__tag = s;
466
+ s || (gi++, s = `${_.AUTO_TAG_PRFX}-${gi}`), this.__tag = s;
467
467
  let e = window.customElements.get(s);
468
468
  if (e) {
469
469
  !i && e !== this && console.warn([
@@ -553,7 +553,7 @@ var mi = 0, $e = null, re = null, ue = class extends HTMLElement {
553
553
  }
554
554
  }, ht = ue;
555
555
  Dt(ht, "template");
556
- function qi(s, i) {
556
+ function Gi(s, i) {
557
557
  for (let e in i)
558
558
  e.includes("-") ? s.style.setProperty(e, i[e]) : s.style[e] = i[e];
559
559
  }
@@ -563,7 +563,7 @@ function kr(s, i) {
563
563
  }
564
564
  function zt(s = { tag: "div" }) {
565
565
  let i = document.createElement(s.tag);
566
- if (s.attributes && kr(i, s.attributes), s.styles && qi(i, s.styles), s.properties)
566
+ if (s.attributes && kr(i, s.attributes), s.styles && Gi(i, s.styles), s.properties)
567
567
  for (let e in s.properties)
568
568
  i[e] = s.properties[e];
569
569
  return s.processors && s.processors.forEach((e) => {
@@ -573,9 +573,9 @@ function zt(s = { tag: "div" }) {
573
573
  i.appendChild(t);
574
574
  }), i;
575
575
  }
576
- var Gi = "idb-store-ready", Or = "symbiote-db", Lr = "symbiote-idb-update_", Pr = class {
576
+ var Xi = "idb-store-ready", Or = "symbiote-db", Lr = "symbiote-idb-update_", Pr = class {
577
577
  _notifyWhenReady(s = null) {
578
- window.dispatchEvent(new CustomEvent(Gi, {
578
+ window.dispatchEvent(new CustomEvent(Xi, {
579
579
  detail: {
580
580
  dbName: this.name,
581
581
  storeName: this.storeName,
@@ -671,11 +671,11 @@ var Gi = "idb-store-ready", Or = "symbiote-db", Lr = "symbiote-idb-update_", Pr
671
671
  };
672
672
  }
673
673
  stop() {
674
- window.removeEventListener("storage", this._updateHandler), this._subscriptionsMap = null, Xi.clear(this.name);
674
+ window.removeEventListener("storage", this._updateHandler), this._subscriptionsMap = null, Ki.clear(this.name);
675
675
  }
676
- }, Xi = class {
676
+ }, Ki = class {
677
677
  static get readyEventName() {
678
- return Gi;
678
+ return Xi;
679
679
  }
680
680
  static open(s = Or, i = "store") {
681
681
  let e = s + "/" + i;
@@ -687,7 +687,7 @@ var Gi = "idb-store-ready", Or = "symbiote-db", Lr = "symbiote-idb-update_", Pr
687
687
  i.split("/")[0] === s && delete this._reg[i];
688
688
  }
689
689
  };
690
- Dt(Xi, "_reg", /* @__PURE__ */ Object.create(null));
690
+ Dt(Ki, "_reg", /* @__PURE__ */ Object.create(null));
691
691
  const Ur = 20, S = Object.freeze({
692
692
  FILE_ADDED: "file-added",
693
693
  FILE_REMOVED: "file-removed",
@@ -787,7 +787,7 @@ function H(s, i) {
787
787
  }, /** @type {T & { cancel: () => void }} } */
788
788
  t;
789
789
  }
790
- const gi = "--uploadcare-blocks-window-height";
790
+ const bi = "--uploadcare-blocks-window-height";
791
791
  class nt {
792
792
  /**
793
793
  * @param {unknown} client
@@ -809,7 +809,7 @@ class nt {
809
809
  }
810
810
  /** @private */
811
811
  static detachTracker() {
812
- window.removeEventListener("resize", this.flush, { capture: !0 }), document.documentElement.style.removeProperty(gi);
812
+ window.removeEventListener("resize", this.flush, { capture: !0 }), document.documentElement.style.removeProperty(bi);
813
813
  }
814
814
  }
815
815
  /**
@@ -818,12 +818,12 @@ class nt {
818
818
  */
819
819
  u(nt, "clientsRegistry", /* @__PURE__ */ new Set()), /** @private */
820
820
  u(nt, "flush", H(() => {
821
- document.documentElement.style.setProperty(gi, `${window.innerHeight}px`);
821
+ document.documentElement.style.setProperty(bi, `${window.innerHeight}px`);
822
822
  }, 100));
823
- const Ki = (s, i) => new Intl.PluralRules(s).select(i), Mr = (s) => s, kt = "{{", Yi = "}}", bi = "plural:";
823
+ const Yi = (s, i) => new Intl.PluralRules(s).select(i), Mr = (s) => s, kt = "{{", Ji = "}}", _i = "plural:";
824
824
  function Ot(s, i, e = {}) {
825
825
  var o;
826
- let { openToken: t = kt, closeToken: r = Yi, transform: n = Mr } = e;
826
+ let { openToken: t = kt, closeToken: r = Ji, transform: n = Mr } = e;
827
827
  for (let l in i) {
828
828
  let a = (o = i[l]) == null ? void 0 : o.toString();
829
829
  s = s.replaceAll(t + l + r, typeof a == "string" ? n(a) : a);
@@ -834,9 +834,9 @@ function Nr(s) {
834
834
  const i = [];
835
835
  let e = s.indexOf(kt);
836
836
  for (; e !== -1; ) {
837
- const t = s.indexOf(Yi, e), r = s.substring(e + 2, t);
838
- if (r.startsWith(bi)) {
839
- const n = s.substring(e + 2, t).replace(bi, ""), o = n.substring(0, n.indexOf("(")), l = n.substring(n.indexOf("(") + 1, n.indexOf(")"));
837
+ const t = s.indexOf(Ji, e), r = s.substring(e + 2, t);
838
+ if (r.startsWith(_i)) {
839
+ const n = s.substring(e + 2, t).replace(_i, ""), o = n.substring(0, n.indexOf("(")), l = n.substring(n.indexOf("(") + 1, n.indexOf(")"));
840
840
  i.push({ variable: r, pluralKey: o, countVariable: l });
841
841
  }
842
842
  e = s.indexOf(kt, t);
@@ -846,7 +846,7 @@ function Nr(s) {
846
846
  const we = (s) => {
847
847
  var i;
848
848
  return (i = s.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)) == null ? void 0 : i.map((e) => e.toLowerCase()).join("-");
849
- }, Ji = ({ element: s, attribute: i, onSuccess: e, onTimeout: t, timeout: r = 300 }) => {
849
+ }, Zi = ({ element: s, attribute: i, onSuccess: e, onTimeout: t, timeout: r = 300 }) => {
850
850
  const n = s.getAttribute(i);
851
851
  if (n !== null) {
852
852
  e(n);
@@ -866,24 +866,24 @@ const we = (s) => {
866
866
  const h = s.getAttribute(i);
867
867
  c.type === "attributes" && c.attributeName === i && h !== null && (clearTimeout(l), o.disconnect(), e(h));
868
868
  };
869
- }, _i = /* @__PURE__ */ new Set();
869
+ }, yi = /* @__PURE__ */ new Set();
870
870
  function ot(s) {
871
- _i.has(s) || (_i.add(s), console.warn(s));
871
+ yi.has(s) || (yi.add(s), console.warn(s));
872
872
  }
873
- function yi(s) {
873
+ function vi(s) {
874
874
  return Object.prototype.toString.call(s) === "[object Object]";
875
875
  }
876
876
  const Fr = /\W|_/g;
877
877
  function Dr(s) {
878
878
  return s.split(Fr).map((i, e) => i.charAt(0)[e > 0 ? "toUpperCase" : "toLowerCase"]() + i.slice(1)).join("");
879
879
  }
880
- function vi(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
880
+ function Ci(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
881
881
  return Array.isArray(s) ? s.map((e) => he(e, { ignoreKeys: i })) : s;
882
882
  }
883
883
  function he(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
884
884
  if (Array.isArray(s))
885
- return vi(s, { ignoreKeys: i });
886
- if (!yi(s))
885
+ return Ci(s, { ignoreKeys: i });
886
+ if (!vi(s))
887
887
  return s;
888
888
  const e = {};
889
889
  for (const t of Object.keys(s)) {
@@ -892,12 +892,12 @@ function he(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
892
892
  e[t] = r;
893
893
  continue;
894
894
  }
895
- yi(r) ? r = he(r, { ignoreKeys: i }) : Array.isArray(r) && (r = vi(r, { ignoreKeys: i })), e[Dr(t)] = r;
895
+ vi(r) ? r = he(r, { ignoreKeys: i }) : Array.isArray(r) && (r = Ci(r, { ignoreKeys: i })), e[Dr(t)] = r;
896
896
  }
897
897
  return e;
898
898
  }
899
899
  const zr = (s) => new Promise((i) => setTimeout(i, s));
900
- function Zi({ libraryName: s, libraryVersion: i, userAgent: e, publicKey: t = "", integration: r = "" }) {
900
+ function Qi({ libraryName: s, libraryVersion: i, userAgent: e, publicKey: t = "", integration: r = "" }) {
901
901
  const n = "JavaScript";
902
902
  if (typeof e == "string")
903
903
  return e;
@@ -946,7 +946,7 @@ class Ae extends Vt {
946
946
  this.name = "CancelError", Object.setPrototypeOf(this, Ae.prototype);
947
947
  }
948
948
  }
949
- const jr = 500, Qi = ({ check: s, interval: i = jr, timeout: e, signal: t }) => new Promise((r, n) => {
949
+ const jr = 500, es = ({ check: s, interval: i = jr, timeout: e, signal: t }) => new Promise((r, n) => {
950
950
  let o, l;
951
951
  ut(t, () => {
952
952
  o && clearTimeout(o), n(new Ae("Poll cancelled"));
@@ -981,7 +981,7 @@ const jr = 500, Qi = ({ check: s, interval: i = jr, timeout: e, signal: t }) =>
981
981
  maxConcurrentRequests: 4,
982
982
  pollingTimeoutMilliseconds: 1e4,
983
983
  pusherKey: "79ae88bd931ea68464d9"
984
- }, dt = "application/octet-stream", es = "original", ge = ({ method: s, url: i, data: e, headers: t = {}, signal: r, onProgress: n }) => new Promise((o, l) => {
984
+ }, dt = "application/octet-stream", ts = "original", ge = ({ method: s, url: i, data: e, headers: t = {}, signal: r, onProgress: n }) => new Promise((o, l) => {
985
985
  const a = new XMLHttpRequest(), c = (s == null ? void 0 : s.toUpperCase()) || "GET";
986
986
  let h = !1;
987
987
  a.open(c, i, !0), t && Object.entries(t).forEach((d) => {
@@ -1027,11 +1027,11 @@ function Hr(s, ...i) {
1027
1027
  }
1028
1028
  const Wr = ({ name: s }) => s ? [s] : [], qr = Hr;
1029
1029
  var Gr = () => new FormData();
1030
- const ts = (s) => !1, ft = (s) => typeof Blob < "u" && s instanceof Blob, pt = (s) => typeof File < "u" && s instanceof File, mt = (s) => !!s && typeof s == "object" && !Array.isArray(s) && "uri" in s && typeof s.uri == "string", Re = (s) => ft(s) || pt(s) || ts() || mt(s), Xr = (s) => typeof s == "string" || typeof s == "number" || typeof s > "u", Kr = (s) => !!s && typeof s == "object" && !Array.isArray(s), Yr = (s) => !!s && typeof s == "object" && "data" in s && Re(s.data);
1031
- function is(s, i, e) {
1030
+ const is = (s) => !1, ft = (s) => typeof Blob < "u" && s instanceof Blob, pt = (s) => typeof File < "u" && s instanceof File, mt = (s) => !!s && typeof s == "object" && !Array.isArray(s) && "uri" in s && typeof s.uri == "string", Me = (s) => ft(s) || pt(s) || is() || mt(s), Xr = (s) => typeof s == "string" || typeof s == "number" || typeof s > "u", Kr = (s) => !!s && typeof s == "object" && !Array.isArray(s), Yr = (s) => !!s && typeof s == "object" && "data" in s && Me(s.data);
1031
+ function ss(s, i, e) {
1032
1032
  if (Array.isArray(e))
1033
1033
  for (const t of e)
1034
- is(s, `${i}[]`, t);
1034
+ ss(s, `${i}[]`, t);
1035
1035
  else if (Yr(e)) {
1036
1036
  const { name: t, contentType: r } = e, n = qr(e.data, t, r ?? dt), o = Wr({ name: t, contentType: r });
1037
1037
  s.push([i, n, ...o]);
@@ -1044,7 +1044,7 @@ function is(s, i, e) {
1044
1044
  function Jr(s) {
1045
1045
  const i = [];
1046
1046
  for (const [e, t] of Object.entries(s))
1047
- is(i, e, t);
1047
+ ss(i, e, t);
1048
1048
  return i;
1049
1049
  }
1050
1050
  function gt(s) {
@@ -1079,19 +1079,19 @@ const Zr = (s) => {
1079
1079
  var Qr = "6.14.1";
1080
1080
  const en = "UploadcareUploadClient", tn = Qr;
1081
1081
  function Te(s) {
1082
- return Zi({
1082
+ return Qi({
1083
1083
  libraryName: en,
1084
1084
  libraryVersion: tn,
1085
1085
  ...s
1086
1086
  });
1087
1087
  }
1088
- const sn = "RequestThrottledError", Ci = 15e3, rn = 1e3;
1088
+ const sn = "RequestThrottledError", wi = 15e3, rn = 1e3;
1089
1089
  function nn(s) {
1090
1090
  const { headers: i } = s || {};
1091
1091
  if (!i || typeof i["retry-after"] != "string")
1092
- return Ci;
1092
+ return wi;
1093
1093
  const e = parseInt(i["retry-after"], 10);
1094
- return Number.isFinite(e) ? e * 1e3 : Ci;
1094
+ return Number.isFinite(e) ? e * 1e3 : wi;
1095
1095
  }
1096
1096
  function be(s, i) {
1097
1097
  const { retryThrottledRequestMaxTimes: e, retryNetworkErrorMaxTimes: t } = i;
@@ -1103,12 +1103,12 @@ function be(s, i) {
1103
1103
  throw o;
1104
1104
  }));
1105
1105
  }
1106
- const ss = (s) => {
1106
+ const rs = (s) => {
1107
1107
  let i = "";
1108
1108
  return (ft(s) || pt(s) || mt(s)) && (i = s.type), i || dt;
1109
- }, rs = (s) => {
1109
+ }, ns = (s) => {
1110
1110
  let i = "";
1111
- return pt(s) && s.name ? i = s.name : ft(s) || ts() ? i = "" : mt(s) && s.name && (i = s.name), i || es;
1111
+ return pt(s) && s.name ? i = s.name : ft(s) || is() ? i = "" : mt(s) && s.name && (i = s.name), i || ts;
1112
1112
  };
1113
1113
  function Bt(s) {
1114
1114
  return typeof s > "u" || s === "auto" ? "auto" : s ? "1" : "0";
@@ -1125,8 +1125,8 @@ function on(s, { publicKey: i, fileName: e, contentType: t, baseURL: r = A.baseU
1125
1125
  data: gt({
1126
1126
  file: {
1127
1127
  data: s,
1128
- name: e || rs(s),
1129
- contentType: t || ss(s)
1128
+ name: e || ns(s),
1129
+ contentType: t || rs(s)
1130
1130
  },
1131
1131
  UPLOADCARE_PUB_KEY: i,
1132
1132
  UPLOADCARE_STORE: Bt(l),
@@ -1227,7 +1227,7 @@ function hn(s, { publicKey: i, baseURL: e = A.baseURL, jsonpCallback: t, secureS
1227
1227
  return g;
1228
1228
  }), { retryNetworkErrorMaxTimes: d, retryThrottledRequestMaxTimes: h });
1229
1229
  }
1230
- function ns(s, { publicKey: i, baseURL: e = A.baseURL, signal: t, source: r, integration: n, userAgent: o, retryThrottledRequestMaxTimes: l = A.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: a = A.retryNetworkErrorMaxTimes }) {
1230
+ function os(s, { publicKey: i, baseURL: e = A.baseURL, signal: t, source: r, integration: n, userAgent: o, retryThrottledRequestMaxTimes: l = A.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: a = A.retryNetworkErrorMaxTimes }) {
1231
1231
  return be(() => ge({
1232
1232
  method: "GET",
1233
1233
  headers: {
@@ -1255,7 +1255,7 @@ function un(s, { publicKey: i, contentType: e, fileName: t, multipartChunkSize:
1255
1255
  "X-UC-User-Agent": Te({ publicKey: i, integration: d, userAgent: f })
1256
1256
  },
1257
1257
  data: gt({
1258
- filename: t || es,
1258
+ filename: t || ts,
1259
1259
  size: s,
1260
1260
  content_type: e || dt,
1261
1261
  part_size: r,
@@ -1314,8 +1314,8 @@ function fn(s, { publicKey: i, baseURL: e = A.baseURL, source: t = "local", sign
1314
1314
  }), { retryThrottledRequestMaxTimes: l, retryNetworkErrorMaxTimes: a });
1315
1315
  }
1316
1316
  function jt(s, { publicKey: i, baseURL: e, source: t, integration: r, userAgent: n, retryThrottledRequestMaxTimes: o, retryNetworkErrorMaxTimes: l, signal: a, onProgress: c }) {
1317
- return Qi({
1318
- check: (h) => ns(s, {
1317
+ return es({
1318
+ check: (h) => os(s, {
1319
1319
  publicKey: i,
1320
1320
  baseURL: e,
1321
1321
  signal: h,
@@ -1331,7 +1331,7 @@ function jt(s, { publicKey: i, baseURL: e, source: t, integration: r, userAgent:
1331
1331
  function pn(s) {
1332
1332
  return "defaultEffects" in s;
1333
1333
  }
1334
- class Me {
1334
+ class Ne {
1335
1335
  constructor(i, { baseCDN: e = A.baseCDN, fileName: t } = {}) {
1336
1336
  u(this, "uuid");
1337
1337
  u(this, "name", null);
@@ -1378,7 +1378,7 @@ const mn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secu
1378
1378
  retryNetworkErrorMaxTimes: p,
1379
1379
  onProgress: c,
1380
1380
  signal: a
1381
- })).then((E) => new Me(E, { baseCDN: g })), gn = (s, { publicKey: i, fileName: e, baseURL: t, signal: r, onProgress: n, source: o, integration: l, userAgent: a, retryThrottledRequestMaxTimes: c, retryNetworkErrorMaxTimes: h, baseCDN: d }) => ns(s, {
1381
+ })).then((E) => new Ne(E, { baseCDN: g })), gn = (s, { publicKey: i, fileName: e, baseURL: t, signal: r, onProgress: n, source: o, integration: l, userAgent: a, retryThrottledRequestMaxTimes: c, retryNetworkErrorMaxTimes: h, baseCDN: d }) => os(s, {
1382
1382
  publicKey: i,
1383
1383
  baseURL: t,
1384
1384
  signal: r,
@@ -1387,7 +1387,7 @@ const mn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secu
1387
1387
  userAgent: a,
1388
1388
  retryThrottledRequestMaxTimes: c,
1389
1389
  retryNetworkErrorMaxTimes: h
1390
- }).then((f) => new Me(f, { baseCDN: d, fileName: e })).then((f) => (n && n({
1390
+ }).then((f) => new Ne(f, { baseCDN: d, fileName: e })).then((f) => (n && n({
1391
1391
  isComputable: !0,
1392
1392
  value: 1
1393
1393
  }), f)), bn = (s, { signal: i } = {}) => {
@@ -1506,7 +1506,7 @@ const Ht = (s) => {
1506
1506
  Ht(s).connect();
1507
1507
  };
1508
1508
  function En({ token: s, publicKey: i, baseURL: e, integration: t, userAgent: r, retryThrottledRequestMaxTimes: n, retryNetworkErrorMaxTimes: o, onProgress: l, signal: a }) {
1509
- return Qi({
1509
+ return es({
1510
1510
  check: (c) => cn(s, {
1511
1511
  publicKey: i,
1512
1512
  baseURL: e,
@@ -1613,23 +1613,23 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1613
1613
  retryThrottledRequestMaxTimes: g,
1614
1614
  onProgress: d,
1615
1615
  signal: h
1616
- })).then((w) => new Me(w, { baseCDN: r })), At = /* @__PURE__ */ new WeakMap(), $n = async (s) => {
1616
+ })).then((w) => new Ne(w, { baseCDN: r })), At = /* @__PURE__ */ new WeakMap(), $n = async (s) => {
1617
1617
  if (At.has(s))
1618
1618
  return At.get(s);
1619
1619
  const i = await fetch(s.uri).then((e) => e.blob());
1620
1620
  return At.set(s, i), i;
1621
- }, os = async (s) => {
1621
+ }, ls = async (s) => {
1622
1622
  if (pt(s) || ft(s))
1623
1623
  return s.size;
1624
1624
  if (mt(s))
1625
1625
  return (await $n(s)).size;
1626
1626
  throw new Error("Unknown file type. Cannot determine file size.");
1627
- }, Sn = (s, i = A.multipartMinFileSize) => s >= i, ls = (s) => {
1627
+ }, Sn = (s, i = A.multipartMinFileSize) => s >= i, as = (s) => {
1628
1628
  const i = "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", e = new RegExp(i);
1629
- return !Re(s) && e.test(s);
1629
+ return !Me(s) && e.test(s);
1630
1630
  }, Wt = (s) => {
1631
1631
  const i = "^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$", e = new RegExp(i);
1632
- return !Re(s) && e.test(s);
1632
+ return !Me(s) && e.test(s);
1633
1633
  }, xn = (s, i) => new Promise((e, t) => {
1634
1634
  const r = [];
1635
1635
  let n = !1, o = i.length;
@@ -1655,7 +1655,7 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1655
1655
  retryThrottledRequestMaxTimes: l,
1656
1656
  retryNetworkErrorMaxTimes: a
1657
1657
  }), Ln = async (s, { publicKey: i, fileName: e, fileSize: t, baseURL: r, secureSignature: n, secureExpire: o, store: l, signal: a, onProgress: c, source: h, integration: d, userAgent: f, retryThrottledRequestMaxTimes: m, retryNetworkErrorMaxTimes: p, contentType: g, multipartChunkSize: C = A.multipartChunkSize, maxConcurrentRequests: E = A.maxConcurrentRequests, baseCDN: w, metadata: y }) => {
1658
- const U = t ?? await os(s);
1658
+ const U = t ?? await ls(s);
1659
1659
  let ie;
1660
1660
  const ye = (O, R) => {
1661
1661
  if (!c)
@@ -1669,10 +1669,10 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1669
1669
  }));
1670
1670
  };
1671
1671
  };
1672
- return g || (g = ss(s)), un(U, {
1672
+ return g || (g = rs(s)), un(U, {
1673
1673
  publicKey: i,
1674
1674
  contentType: g,
1675
- fileName: e || rs(s),
1675
+ fileName: e || ns(s),
1676
1676
  baseURL: r,
1677
1677
  secureSignature: n,
1678
1678
  secureExpire: o,
@@ -1716,11 +1716,11 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1716
1716
  retryNetworkErrorMaxTimes: p,
1717
1717
  onProgress: c,
1718
1718
  signal: a
1719
- })).then((O) => new Me(O, { baseCDN: w }));
1719
+ })).then((O) => new Ne(O, { baseCDN: w }));
1720
1720
  };
1721
- async function as(s, { publicKey: i, fileName: e, baseURL: t = A.baseURL, secureSignature: r, secureExpire: n, store: o, signal: l, onProgress: a, source: c, integration: h, userAgent: d, retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m, contentType: p, multipartMinFileSize: g, multipartChunkSize: C, maxConcurrentRequests: E, baseCDN: w = A.baseCDN, checkForUrlDuplicates: y, saveUrlForRecurrentUploads: U, pusherKey: ie, metadata: ye }) {
1722
- if (Re(s)) {
1723
- const O = await os(s);
1721
+ async function cs(s, { publicKey: i, fileName: e, baseURL: t = A.baseURL, secureSignature: r, secureExpire: n, store: o, signal: l, onProgress: a, source: c, integration: h, userAgent: d, retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m, contentType: p, multipartMinFileSize: g, multipartChunkSize: C, maxConcurrentRequests: E, baseCDN: w = A.baseCDN, checkForUrlDuplicates: y, saveUrlForRecurrentUploads: U, pusherKey: ie, metadata: ye }) {
1722
+ if (Me(s)) {
1723
+ const O = await ls(s);
1724
1724
  return Sn(O, g) ? Ln(s, {
1725
1725
  publicKey: i,
1726
1726
  contentType: p,
@@ -1781,7 +1781,7 @@ async function as(s, { publicKey: i, fileName: e, baseURL: t = A.baseURL, secure
1781
1781
  pusherKey: ie,
1782
1782
  metadata: ye
1783
1783
  });
1784
- if (ls(s))
1784
+ if (as(s))
1785
1785
  return gn(s, {
1786
1786
  publicKey: i,
1787
1787
  fileName: e,
@@ -1810,17 +1810,17 @@ class Pn {
1810
1810
  u(this, "storedAt", null);
1811
1811
  this.uuid = i.id, this.filesCount = i.filesCount;
1812
1812
  const t = i.files.filter(Boolean);
1813
- this.totalSize = Object.values(t).reduce((r, n) => r + n.size, 0), this.isStored = !!i.datetimeStored, this.isImage = !!Object.values(t).filter((r) => r.isImage).length, this.cdnUrl = i.cdnUrl, this.files = t.map((r) => new Me(r, { baseCDN: e })), this.createdAt = i.datetimeCreated, this.storedAt = i.datetimeStored;
1813
+ this.totalSize = Object.values(t).reduce((r, n) => r + n.size, 0), this.isStored = !!i.datetimeStored, this.isImage = !!Object.values(t).filter((r) => r.isImage).length, this.cdnUrl = i.cdnUrl, this.files = t.map((r) => new Ne(r, { baseCDN: e })), this.createdAt = i.datetimeCreated, this.storedAt = i.datetimeStored;
1814
1814
  }
1815
1815
  }
1816
1816
  const Un = (s) => {
1817
1817
  for (const i of s)
1818
- if (!Re(i))
1818
+ if (!Me(i))
1819
1819
  return !1;
1820
1820
  return !0;
1821
1821
  }, Rn = (s) => {
1822
1822
  for (const i of s)
1823
- if (!ls(i))
1823
+ if (!as(i))
1824
1824
  return !1;
1825
1825
  return !0;
1826
1826
  }, Mn = (s) => {
@@ -1846,7 +1846,7 @@ function Nn(s, { publicKey: i, fileName: e, baseURL: t = A.baseURL, secureSignat
1846
1846
  U[W] = se.value, a({ isComputable: !0, value: K(U) });
1847
1847
  };
1848
1848
  };
1849
- return Promise.all(s.map((R, W) => Re(R) || Wt(R) ? as(R, {
1849
+ return Promise.all(s.map((R, W) => Me(R) || Wt(R) ? cs(R, {
1850
1850
  publicKey: i,
1851
1851
  fileName: e,
1852
1852
  baseURL: t,
@@ -1920,13 +1920,13 @@ class Fn {
1920
1920
  return this._concurrency;
1921
1921
  }
1922
1922
  }
1923
- const cs = () => ({
1923
+ const hs = () => ({
1924
1924
  /** @type {Set<import('./Block').Block>} */
1925
1925
  "*blocksRegistry": /* @__PURE__ */ new Set(),
1926
1926
  /** @type {import('../blocks/UploadCtxProvider/EventEmitter.js').EventEmitter | null} */
1927
1927
  "*eventEmitter": null
1928
- }), hs = (s) => ({
1929
- ...cs(),
1928
+ }), us = (s) => ({
1929
+ ...hs(),
1930
1930
  "*currentActivity": "",
1931
1931
  "*currentActivityParams": {},
1932
1932
  "*history": [],
@@ -1937,8 +1937,8 @@ const cs = () => ({
1937
1937
  "*currentActivity": ""
1938
1938
  });
1939
1939
  }
1940
- }), us = (s) => ({
1941
- ...hs(s),
1940
+ }), ds = (s) => ({
1941
+ ...us(s),
1942
1942
  "*commonProgress": 0,
1943
1943
  "*uploadList": [],
1944
1944
  "*focusedEntry": null,
@@ -1975,7 +1975,7 @@ class k extends ht {
1975
1975
  u(this, "allowCustomTemplate", !0);
1976
1976
  /** @type {import('./ActivityBlock.js').ActivityType} */
1977
1977
  u(this, "activityType", null);
1978
- u(this, "init$", cs());
1978
+ u(this, "init$", hs());
1979
1979
  /** @deprecated */
1980
1980
  u(this, "updateCtxCssData", () => {
1981
1981
  ot(
@@ -2009,7 +2009,7 @@ class k extends ht {
2009
2009
  * @returns {string}
2010
2010
  */
2011
2011
  pluralize(e, t) {
2012
- const r = this.l10n("locale-name") || "en-US", n = Ki(r, t);
2012
+ const r = this.l10n("locale-name") || "en-US", n = Yi(r, t);
2013
2013
  return this.l10n(`${e}__${n}`);
2014
2014
  }
2015
2015
  /**
@@ -2066,7 +2066,7 @@ class k extends ht {
2066
2066
  /** @type {typeof Block} */
2067
2067
  this.constructor.className
2068
2068
  );
2069
- e && this.classList.toggle(`${Tt}${e}`, !0), this.hasAttribute("retpl") && (this.constructor.template = null, this.processInnerHtml = !0), this.requireCtxName ? Ji({
2069
+ e && this.classList.toggle(`${Tt}${e}`, !0), this.hasAttribute("retpl") && (this.constructor.template = null, this.processInnerHtml = !0), this.requireCtxName ? Zi({
2070
2070
  element: this,
2071
2071
  attribute: "ctx-name",
2072
2072
  onSuccess: () => {
@@ -2192,24 +2192,24 @@ class k extends ht {
2192
2192
  }
2193
2193
  /** @type {string | null} */
2194
2194
  u(k, "StateConsumerScope", null), u(k, "className", "");
2195
- const wi = "active", Fe = "___ACTIVITY_IS_ACTIVE___", G = class G extends k {
2195
+ const Ei = "active", De = "___ACTIVITY_IS_ACTIVE___", G = class G extends k {
2196
2196
  constructor() {
2197
2197
  super(...arguments);
2198
2198
  u(this, "historyTracked", !1);
2199
- u(this, "init$", hs(this));
2199
+ u(this, "init$", us(this));
2200
2200
  u(this, "_debouncedHistoryFlush", H(this._historyFlush.bind(this), 10));
2201
2201
  }
2202
2202
  /** @private */
2203
2203
  _deactivate() {
2204
2204
  var t;
2205
2205
  let e = G._activityRegistry[this.activityKey];
2206
- this[Fe] = !1, this.removeAttribute(wi), (t = e == null ? void 0 : e.deactivateCallback) == null || t.call(e);
2206
+ this[De] = !1, this.removeAttribute(Ei), (t = e == null ? void 0 : e.deactivateCallback) == null || t.call(e);
2207
2207
  }
2208
2208
  /** @private */
2209
2209
  _activate() {
2210
2210
  var t;
2211
2211
  let e = G._activityRegistry[this.activityKey];
2212
- this.$["*historyBack"] = this.historyBack.bind(this), this[Fe] = !0, this.setAttribute(wi, ""), (t = e == null ? void 0 : e.activateCallback) == null || t.call(e), this._debouncedHistoryFlush(), this.emit(S.ACTIVITY_CHANGE, {
2212
+ this.$["*historyBack"] = this.historyBack.bind(this), this[De] = !0, this.setAttribute(Ei, ""), (t = e == null ? void 0 : e.activateCallback) == null || t.call(e), this._debouncedHistoryFlush(), this.emit(S.ACTIVITY_CHANGE, {
2213
2213
  activity: this.activityType
2214
2214
  });
2215
2215
  }
@@ -2217,7 +2217,7 @@ const wi = "active", Fe = "___ACTIVITY_IS_ACTIVE___", G = class G extends k {
2217
2217
  super.initCallback(), this.hasAttribute("current-activity") && this.sub("*currentActivity", (e) => {
2218
2218
  this.setAttribute("current-activity", e);
2219
2219
  }), this.activityType && (this.hasAttribute("activity") || this.setAttribute("activity", this.activityType), this.sub("*currentActivity", (e) => {
2220
- this.activityType !== e && this[Fe] ? this._deactivate() : this.activityType === e && !this[Fe] && this._activate(), e || (this.$["*history"] = []);
2220
+ this.activityType !== e && this[De] ? this._deactivate() : this.activityType === e && !this[De] && this._activate(), e || (this.$["*history"] = []);
2221
2221
  }), this.has("*modalActive") && this.sub("*modalActive", (e) => {
2222
2222
  !e && this.activityType === this.$["*currentActivity"] && (this.$["*currentActivity"] = null);
2223
2223
  }));
@@ -2232,7 +2232,7 @@ const wi = "active", Fe = "___ACTIVITY_IS_ACTIVE___", G = class G extends k {
2232
2232
  return this.activityType && !!G._activityRegistry[this.activityKey];
2233
2233
  }
2234
2234
  get isActivityActive() {
2235
- return this[Fe];
2235
+ return this[De];
2236
2236
  }
2237
2237
  get couldOpenActivity() {
2238
2238
  return !0;
@@ -2304,7 +2304,7 @@ b.activities = Object.freeze({
2304
2304
  EXTERNAL: "external",
2305
2305
  DETAILS: "details"
2306
2306
  });
2307
- const zn = 20, Pt = 24, je = 34, ds = 3, Z = ds / 2, ve = 1, Je = 100 / 3, v = 1, Ei = 24, Vn = 6;
2307
+ const zn = 20, Pt = 24, He = 34, fs = 3, Z = fs / 2, ve = 1, Je = 100 / 3, v = 1, Ai = 24, Vn = 6;
2308
2308
  function Ie(s, i) {
2309
2309
  for (let e in i)
2310
2310
  s.setAttributeNS(null, e, i[e].toString());
@@ -2334,7 +2334,7 @@ function jn(s, i, e) {
2334
2334
  /** @type {Extract<import('./types.js').Direction, 'n' | 's'>} */
2335
2335
  i
2336
2336
  ], c = [-1, 1][l], h = [-1, 1][a], d, f;
2337
- ["n", "s"].includes(i) ? (d = [t + l * n - je * e / 2, r + a * o + Z * h], f = [t + l * n + je * e / 2, r + a * o + Z * h]) : (d = [t + l * n + Z * c, r + a * o - je * e / 2], f = [t + l * n + Z * c, r + a * o + je * e / 2]);
2337
+ ["n", "s"].includes(i) ? (d = [t + l * n - He * e / 2, r + a * o + Z * h], f = [t + l * n + He * e / 2, r + a * o + Z * h]) : (d = [t + l * n + Z * c, r + a * o - He * e / 2], f = [t + l * n + Z * c, r + a * o + He * e / 2]);
2338
2338
  let m = `M ${d[0]} ${d[1]} L ${f[0]} ${f[1]}`, p = [f[0] - (f[0] - d[0]) / 2, f[1] - (f[1] - d[1]) / 2];
2339
2339
  return { d: m, center: p };
2340
2340
  }
@@ -2434,7 +2434,7 @@ function io(s, i) {
2434
2434
  function so(s, i) {
2435
2435
  return Math.abs(s.width / s.height - i) < 0.1;
2436
2436
  }
2437
- function De({ width: s, height: i }, e) {
2437
+ function ze({ width: s, height: i }, e) {
2438
2438
  let t = e / 90 % 2 !== 0;
2439
2439
  return { width: t ? i : s, height: t ? s : i };
2440
2440
  }
@@ -2456,7 +2456,7 @@ function st(s) {
2456
2456
  function ke(s, i, e) {
2457
2457
  return Math.min(Math.max(s, i), e);
2458
2458
  }
2459
- const fs = (s) => {
2459
+ const ps = (s) => {
2460
2460
  if (!s)
2461
2461
  return [];
2462
2462
  const [i, e] = s.split(":").map(Number);
@@ -2474,29 +2474,29 @@ const fs = (s) => {
2474
2474
  API: "js-api"
2475
2475
  }), no = (s) => s ? s.split(",").map((i) => i.trim()) : [], qt = (s) => s ? s.join(",") : "", Gt = "blocks", bt = "0.36.0";
2476
2476
  function oo(s) {
2477
- return Zi({
2477
+ return Qi({
2478
2478
  ...s,
2479
2479
  libraryName: Gt,
2480
2480
  libraryVersion: bt
2481
2481
  });
2482
2482
  }
2483
- const ps = ({ type: s, message: i, ...e }) => ({
2483
+ const ms = ({ type: s, message: i, ...e }) => ({
2484
2484
  type: s,
2485
2485
  message: i,
2486
2486
  ...e
2487
- }), Se = ps, $t = ps, ms = (s) => {
2487
+ }), Se = ms, $t = ms, gs = (s) => {
2488
2488
  if (typeof s != "string" || !s)
2489
2489
  return "";
2490
2490
  let i = s.trim();
2491
2491
  return i.startsWith("-/") ? i = i.slice(2) : i.startsWith("/") && (i = i.slice(1)), i.endsWith("/") && (i = i.slice(0, i.length - 1)), i;
2492
- }, Xt = (...s) => s.filter((i) => typeof i == "string" && i).map((i) => ms(
2492
+ }, Xt = (...s) => s.filter((i) => typeof i == "string" && i).map((i) => gs(
2493
2493
  /** @type {String} */
2494
2494
  i
2495
2495
  )).join("/-/"), ae = (...s) => {
2496
2496
  let i = Xt(...s);
2497
2497
  return i ? `-/${i}/` : "";
2498
2498
  };
2499
- function gs(s) {
2499
+ function bs(s) {
2500
2500
  let i = new URL(s), e = i.pathname + i.search + i.hash, t = e.lastIndexOf("http"), r = e.lastIndexOf("/"), n = "";
2501
2501
  return t >= 0 ? n = e.slice(t) : r >= 0 && (n = e.slice(r + 1)), n;
2502
2502
  }
@@ -2506,17 +2506,17 @@ function lo(s) {
2506
2506
  return e.substring(t + 1, r);
2507
2507
  }
2508
2508
  function ao(s) {
2509
- let i = bs(s), e = new URL(i), t = e.pathname.indexOf("/-/");
2510
- return t === -1 ? [] : e.pathname.substring(t).split("/-/").filter(Boolean).map((n) => ms(n));
2509
+ let i = _s(s), e = new URL(i), t = e.pathname.indexOf("/-/");
2510
+ return t === -1 ? [] : e.pathname.substring(t).split("/-/").filter(Boolean).map((n) => gs(n));
2511
2511
  }
2512
- function bs(s) {
2513
- let i = new URL(s), e = gs(s), t = _s(e) ? ys(e).pathname : e;
2512
+ function _s(s) {
2513
+ let i = new URL(s), e = bs(s), t = ys(e) ? vs(e).pathname : e;
2514
2514
  return i.pathname = i.pathname.replace(t, ""), i.search = "", i.hash = "", i.toString();
2515
2515
  }
2516
- function _s(s) {
2516
+ function ys(s) {
2517
2517
  return s.startsWith("http");
2518
2518
  }
2519
- function ys(s) {
2519
+ function vs(s) {
2520
2520
  let i = new URL(s);
2521
2521
  return {
2522
2522
  pathname: i.origin + i.pathname || "",
@@ -2525,14 +2525,14 @@ function ys(s) {
2525
2525
  };
2526
2526
  }
2527
2527
  const V = (s, i, e) => {
2528
- let t = new URL(bs(s));
2529
- if (e = e || gs(s), t.pathname.startsWith("//") && (t.pathname = t.pathname.replace("//", "/")), _s(e)) {
2530
- let r = ys(e);
2528
+ let t = new URL(_s(s));
2529
+ if (e = e || bs(s), t.pathname.startsWith("//") && (t.pathname = t.pathname.replace("//", "/")), ys(e)) {
2530
+ let r = vs(e);
2531
2531
  t.pathname = t.pathname + (i || "") + (r.pathname || ""), t.search = r.search, t.hash = r.hash;
2532
2532
  } else
2533
2533
  t.pathname = t.pathname + (i || "") + (e || "");
2534
2534
  return t.toString();
2535
- }, We = (s, i) => {
2535
+ }, qe = (s, i) => {
2536
2536
  let e = new URL(s);
2537
2537
  return e.pathname = i + "/", e.toString();
2538
2538
  }, ce = (s, i = ",") => s.trim().split(i).map((e) => e.trim()).filter((e) => e.length > 0), Ut = [
@@ -2549,9 +2549,9 @@ const V = (s, i, e) => {
2549
2549
  ".heics",
2550
2550
  ".avif",
2551
2551
  ".avifs"
2552
- ], Ai = (s) => s ? s.filter((i) => typeof i == "string").map((i) => ce(i)).flat() : [], vs = (s, i) => i.some((e) => e.endsWith("*") ? (e = e.replace("*", ""), s.startsWith(e)) : s === e), co = (s, i) => i.some((e) => e.startsWith(".") ? s.toLowerCase().endsWith(e.toLowerCase()) : !1), Rt = (s) => {
2552
+ ], Ti = (s) => s ? s.filter((i) => typeof i == "string").map((i) => ce(i)).flat() : [], Cs = (s, i) => i.some((e) => e.endsWith("*") ? (e = e.replace("*", ""), s.startsWith(e)) : s === e), co = (s, i) => i.some((e) => e.startsWith(".") ? s.toLowerCase().endsWith(e.toLowerCase()) : !1), Rt = (s) => {
2553
2553
  let i = s == null ? void 0 : s.type;
2554
- return i ? vs(i, Ut) : !1;
2554
+ return i ? Cs(i, Ut) : !1;
2555
2555
  }, Y = 1e3, Ce = Object.freeze({
2556
2556
  AUTO: "auto",
2557
2557
  BYTE: "byte",
@@ -2560,20 +2560,20 @@ const V = (s, i, e) => {
2560
2560
  GB: "gb",
2561
2561
  TB: "tb",
2562
2562
  PB: "pb"
2563
- }), ze = (s) => Math.ceil(s * 100) / 100, ho = (s, i = Ce.AUTO) => {
2563
+ }), Ve = (s) => Math.ceil(s * 100) / 100, ho = (s, i = Ce.AUTO) => {
2564
2564
  const e = i === Ce.AUTO;
2565
2565
  if (i === Ce.BYTE || e && s < Y ** 1) {
2566
2566
  const t = (
2567
2567
  /** @type {Extract<import('./getPluralForm').PluralForm, 'one' | 'other'>} */
2568
- Ki("en-US", s)
2568
+ Yi("en-US", s)
2569
2569
  ), r = {
2570
2570
  one: "byte",
2571
2571
  other: "bytes"
2572
2572
  }[t];
2573
2573
  return `${s} ${r}`;
2574
2574
  }
2575
- return i === Ce.KB || e && s < Y ** 2 ? `${ze(s / Y ** 1)} KB` : i === Ce.MB || e && s < Y ** 3 ? `${ze(s / Y ** 2)} MB` : i === Ce.GB || e && s < Y ** 4 ? `${ze(s / Y ** 3)} GB` : i === Ce.TB || e && s < Y ** 5 ? `${ze(s / Y ** 4)} TB` : `${ze(s / Y ** 5)} PB`;
2576
- }, Ti = "[Typed State] Wrong property name: ", uo = "[Typed State] Wrong property type: ";
2575
+ return i === Ce.KB || e && s < Y ** 2 ? `${Ve(s / Y ** 1)} KB` : i === Ce.MB || e && s < Y ** 3 ? `${Ve(s / Y ** 2)} MB` : i === Ce.GB || e && s < Y ** 4 ? `${Ve(s / Y ** 3)} GB` : i === Ce.TB || e && s < Y ** 5 ? `${Ve(s / Y ** 4)} TB` : `${Ve(s / Y ** 5)} PB`;
2576
+ }, $i = "[Typed State] Wrong property name: ", uo = "[Typed State] Wrong property type: ";
2577
2577
  class fo {
2578
2578
  /**
2579
2579
  * @param {Object<string, { type: any; value: any; nullable?: Boolean }>} typedSchema
@@ -2592,7 +2592,7 @@ class fo {
2592
2592
  */
2593
2593
  setValue(i, e) {
2594
2594
  if (!this.__typedSchema.hasOwnProperty(i)) {
2595
- console.warn(Ti + i);
2595
+ console.warn($i + i);
2596
2596
  return;
2597
2597
  }
2598
2598
  let t = this.__typedSchema[i];
@@ -2610,7 +2610,7 @@ class fo {
2610
2610
  /** @param {String} prop */
2611
2611
  getValue(i) {
2612
2612
  if (!this.__typedSchema.hasOwnProperty(i)) {
2613
- console.warn(Ti + i);
2613
+ console.warn($i + i);
2614
2614
  return;
2615
2615
  }
2616
2616
  return this.__data.read(i);
@@ -2867,7 +2867,7 @@ const _o = Object.freeze({
2867
2867
  value: null
2868
2868
  },
2869
2869
  fileInfo: {
2870
- type: Me,
2870
+ type: Ne,
2871
2871
  value: null
2872
2872
  },
2873
2873
  isUploading: {
@@ -2932,7 +2932,7 @@ class $ extends b {
2932
2932
  super(...arguments);
2933
2933
  u(this, "couldBeCtxOwner", !1);
2934
2934
  u(this, "isCtxOwner", !1);
2935
- u(this, "init$", us(this));
2935
+ u(this, "init$", ds(this));
2936
2936
  /** @private */
2937
2937
  u(this, "__initialUploadMetadata", null);
2938
2938
  /**
@@ -3248,7 +3248,7 @@ class $ extends b {
3248
3248
  }
3249
3249
  /** @param {{ captureCamera?: boolean }} options */
3250
3250
  openSystemDialog(e = {}) {
3251
- let t = qt(Ai([this.cfg.accept ?? "", ...this.cfg.imgOnly ? Ut : []]));
3251
+ let t = qt(Ti([this.cfg.accept ?? "", ...this.cfg.imgOnly ? Ut : []]));
3252
3252
  this.cfg.accept && this.cfg.imgOnly && console.warn(
3253
3253
  "There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list."
3254
3254
  ), this.fileInput = document.createElement("input"), this.fileInput.type = "file", this.fileInput.multiple = this.cfg.multiple, e.captureCamera ? (this.fileInput.capture = this.cfg.cameraCapture, this.fileInput.accept = "image/*") : this.fileInput.accept = t, this.fileInput.dispatchEvent(new MouseEvent("click")), this.fileInput.onchange = () => {
@@ -3297,13 +3297,13 @@ class $ extends b {
3297
3297
  * @param {import('../types').OutputFileEntry} outputEntry
3298
3298
  */
3299
3299
  _validateFileType(e) {
3300
- const t = this.cfg.imgOnly, r = this.cfg.accept, n = Ai([...t ? Ut : [], r]);
3300
+ const t = this.cfg.imgOnly, r = this.cfg.accept, n = Ti([...t ? Ut : [], r]);
3301
3301
  if (!n.length)
3302
3302
  return;
3303
3303
  const o = e.mimeType, l = e.name;
3304
3304
  if (!o || !l)
3305
3305
  return;
3306
- const a = vs(o, n), c = co(l, n);
3306
+ const a = Cs(o, n), c = co(l, n);
3307
3307
  if (!a && !c)
3308
3308
  return Se({
3309
3309
  type: "FORBIDDEN_FILE_TYPE",
@@ -3428,7 +3428,7 @@ class $ extends b {
3428
3428
  }
3429
3429
  /** @private */
3430
3430
  setInitialCrop() {
3431
- const e = fs(this.cfg.cropPreset);
3431
+ const e = ps(this.cfg.cropPreset);
3432
3432
  if (e) {
3433
3433
  const [t] = e, r = this.uploadCollection.findItems(
3434
3434
  (n) => {
@@ -3567,7 +3567,7 @@ const j = Object.freeze({
3567
3567
  mirror: !1,
3568
3568
  flip: !1,
3569
3569
  crop: void 0
3570
- }), Cs = (
3570
+ }), ws = (
3571
3571
  /** @type {const} */
3572
3572
  [
3573
3573
  "enhance",
@@ -3612,7 +3612,7 @@ function wo(s, i) {
3612
3612
  }
3613
3613
  function _t(s) {
3614
3614
  return Xt(
3615
- ...Cs.filter(
3615
+ ...ws.filter(
3616
3616
  (i) => typeof s[i] < "u" && s[i] !== null
3617
3617
  ).map((i) => {
3618
3618
  let e = s[i];
@@ -3620,7 +3620,7 @@ function _t(s) {
3620
3620
  }).filter((i) => !!i)
3621
3621
  );
3622
3622
  }
3623
- const ws = Xt("format/auto", "progressive/yes"), ne = ([s]) => typeof s < "u" ? Number(s) : void 0, $i = () => !0, Eo = ([s, i]) => ({
3623
+ const Es = Xt("format/auto", "progressive/yes"), ne = ([s]) => typeof s < "u" ? Number(s) : void 0, Si = () => !0, Eo = ([s, i]) => ({
3624
3624
  name: s,
3625
3625
  amount: typeof i < "u" ? Number(i) : 100
3626
3626
  }), Ao = ([s, i]) => {
@@ -3643,8 +3643,8 @@ const ws = Xt("format/auto", "progressive/yes"), ne = ([s]) => typeof s < "u" ?
3643
3643
  vibrance: ne,
3644
3644
  warmth: ne,
3645
3645
  filter: Eo,
3646
- mirror: $i,
3647
- flip: $i,
3646
+ mirror: Si,
3647
+ flip: Si,
3648
3648
  rotate: ne,
3649
3649
  crop: Ao
3650
3650
  });
@@ -3652,7 +3652,7 @@ function $o(s) {
3652
3652
  const i = {};
3653
3653
  for (const e of s) {
3654
3654
  const [t, ...r] = e.split("/");
3655
- if (!Cs.includes(t))
3655
+ if (!ws.includes(t))
3656
3656
  continue;
3657
3657
  const n = (
3658
3658
  /** @type {(typeof SUPPORTED_OPERATIONS_ORDERED)[number]} */
@@ -3891,12 +3891,12 @@ const P = Object.freeze({
3891
3891
  } catch (e) {
3892
3892
  return console.error(`Invalid value for config key "${s}".`, e), Oe[s];
3893
3893
  }
3894
- }, qe = (
3894
+ }, Re = (
3895
3895
  /** @type {(keyof import('../../types').ConfigType)[]} */
3896
3896
  Object.keys(Oe)
3897
3897
  ), No = ["metadata"], Fo = (s) => No.includes(s), at = (
3898
3898
  /** @type {(keyof import('../../types').ConfigPlainType)[]} */
3899
- qe.filter((s) => !Fo(s))
3899
+ Re.filter((s) => !Fo(s))
3900
3900
  ), Do = (
3901
3901
  /** @type {Record<keyof import('../../types').ConfigAttributesType, keyof import('../../types').ConfigPlainType>} */
3902
3902
  {
@@ -3906,18 +3906,18 @@ const P = Object.freeze({
3906
3906
  ), zo = (
3907
3907
  /** @type {Record<keyof import('../../types').ConfigAttributesType, string>} */
3908
3908
  {
3909
- ...Object.fromEntries(qe.map((s) => [we(s), z(s)])),
3910
- ...Object.fromEntries(qe.map((s) => [s.toLowerCase(), z(s)]))
3909
+ ...Object.fromEntries(Re.map((s) => [we(s), z(s)])),
3910
+ ...Object.fromEntries(Re.map((s) => [s.toLowerCase(), z(s)]))
3911
3911
  }
3912
3912
  );
3913
- class Es extends k {
3913
+ class Kt extends k {
3914
3914
  constructor() {
3915
3915
  super();
3916
3916
  u(this, "requireCtxName", !0);
3917
3917
  /** @private */
3918
3918
  u(this, "_debugPrint", H(() => {
3919
3919
  const e = /* @__PURE__ */ Object.create(null);
3920
- for (const t of qe)
3920
+ for (const t of Re)
3921
3921
  e[t] = this.$[z(t)];
3922
3922
  this.debugPrint("config", e);
3923
3923
  }, 0));
@@ -3948,7 +3948,7 @@ class Es extends k {
3948
3948
  },
3949
3949
  !1
3950
3950
  );
3951
- for (const t of qe) {
3951
+ for (const t of Re) {
3952
3952
  let r = "__" + t;
3953
3953
  e[r] = e[t], Object.defineProperty(this, t, {
3954
3954
  /** @param {unknown} value */
@@ -3979,13 +3979,25 @@ class Es extends k {
3979
3979
  a[n] = l;
3980
3980
  }
3981
3981
  }
3982
- Es.bindAttributes(zo);
3982
+ Kt.bindAttributes(zo);
3983
+ for (const s of Re) {
3984
+ const i = "__" + s;
3985
+ Object.defineProperty(Kt.prototype, s, {
3986
+ /** @param {unknown} value */
3987
+ set: function(e) {
3988
+ this[i] = e;
3989
+ },
3990
+ get: function() {
3991
+ return this[i];
3992
+ }
3993
+ });
3994
+ }
3983
3995
  const As = (
3984
3996
  /** @type {Config} */
3985
3997
  /** @type {unknown} */
3986
- Es
3998
+ Kt
3987
3999
  );
3988
- class Kt extends k {
4000
+ class Yt extends k {
3989
4001
  constructor() {
3990
4002
  super(...arguments);
3991
4003
  u(this, "init$", {
@@ -4011,11 +4023,11 @@ class Kt extends k {
4011
4023
  });
4012
4024
  }
4013
4025
  }
4014
- Kt.template = /* HTML */
4026
+ Yt.template = /* HTML */
4015
4027
  `
4016
4028
  <svg ref="svg" xmlns="http://www.w3.org/2000/svg" set="@viewBox: viewBox; @height: size; @width: size"></svg>
4017
4029
  `;
4018
- Kt.bindAttributes({
4030
+ Yt.bindAttributes({
4019
4031
  name: "name",
4020
4032
  size: "size"
4021
4033
  });
@@ -4051,13 +4063,13 @@ const Vo = (s) => [...new Set(s)], Bo = (s) => Object.entries(s).filter(([i, e])
4051
4063
  "is-preview-blur": {
4052
4064
  default: 1
4053
4065
  }
4054
- }), He = "--lr-img-", Si = "unresolved", Ze = 2, Qe = 3, xi = !window.location.host.trim() || window.location.host.includes(":") || window.location.hostname.includes("localhost"), Ii = 3e3, ki = 5e3, Oi = Object.freeze({
4066
+ }), We = "--lr-img-", xi = "unresolved", Ze = 2, Qe = 3, Ii = !window.location.host.trim() || window.location.host.includes(":") || window.location.hostname.includes("localhost"), ki = 3e3, Oi = 5e3, Li = Object.freeze({
4055
4067
  PREVIEW: "PREVIEW",
4056
4068
  MAIN: "MAIN"
4057
4069
  }), Ts = /* @__PURE__ */ Object.create(null);
4058
- var ji;
4070
+ var Hi;
4059
4071
  for (let s in ct)
4060
- Ts[He + s] = ((ji = ct[s]) == null ? void 0 : ji.default) || "";
4072
+ Ts[We + s] = ((Hi = ct[s]) == null ? void 0 : Hi.default) || "";
4061
4073
  class Ho extends ht {
4062
4074
  constructor() {
4063
4075
  super(...arguments);
@@ -4068,19 +4080,19 @@ class Ho extends ht {
4068
4080
  * @returns {any}
4069
4081
  */
4070
4082
  $$(e) {
4071
- return this.$[He + e];
4083
+ return this.$[We + e];
4072
4084
  }
4073
4085
  /** @param {Object<String, String | Number>} kvObj */
4074
4086
  set$$(e) {
4075
4087
  for (let t in e)
4076
- this.$[He + t] = e[t];
4088
+ this.$[We + t] = e[t];
4077
4089
  }
4078
4090
  /**
4079
4091
  * @param {String} key
4080
4092
  * @param {(val: any) => void} kbFn
4081
4093
  */
4082
4094
  sub$$(e, t) {
4083
- this.sub(He + e, (r) => {
4095
+ this.sub(We + e, (r) => {
4084
4096
  r === null || r === "" || t(r);
4085
4097
  });
4086
4098
  }
@@ -4117,7 +4129,7 @@ class Ho extends ht {
4117
4129
  }
4118
4130
  attributeChangedCallback(e, t, r) {
4119
4131
  window.setTimeout(() => {
4120
- this.$[He + e] = r;
4132
+ this.$[We + e] = r;
4121
4133
  });
4122
4134
  }
4123
4135
  }
@@ -4132,7 +4144,7 @@ class Wo extends Ho {
4132
4144
  * @param {String} src
4133
4145
  */
4134
4146
  _fmtAbs(e) {
4135
- return !e.includes("//") && !xi && (e = new URL(e, document.baseURI).href), e;
4147
+ return !e.includes("//") && !Ii && (e = new URL(e, document.baseURI).href), e;
4136
4148
  }
4137
4149
  /**
4138
4150
  * Validate size
@@ -4144,10 +4156,10 @@ class Wo extends Ho {
4144
4156
  if ((e == null ? void 0 : e.trim()) !== "") {
4145
4157
  let t = e.match(/\d+/)[0], r = e.match(/[a-zA-Z]+/)[0];
4146
4158
  const n = parseInt(t, 10);
4147
- if (Number(n) > ki && this.hasFormatJPG)
4159
+ if (Number(n) > Oi && this.hasFormatJPG)
4160
+ return Oi + r;
4161
+ if (Number(n) > ki && !this.hasFormatJPG)
4148
4162
  return ki + r;
4149
- if (Number(n) > Ii && !this.hasFormatJPG)
4150
- return Ii + r;
4151
4163
  }
4152
4164
  return e;
4153
4165
  }
@@ -4177,7 +4189,7 @@ class Wo extends Ho {
4177
4189
  _getUrlBase(e = "", t = "") {
4178
4190
  if (this.$$("src").startsWith("data:") || this.$$("src").startsWith("blob:"))
4179
4191
  return this.$$("src");
4180
- if (xi && this.$$("src") && !this.$$("src").includes("//"))
4192
+ if (Ii && this.$$("src") && !this.$$("src").includes("//"))
4181
4193
  return this._proxyUrl(this.$$("src"));
4182
4194
  let r = this._getCdnModifiers(e, t);
4183
4195
  if (this.$$("src").startsWith(this.$$("cdn-cname")))
@@ -4186,7 +4198,7 @@ class Wo extends Ho {
4186
4198
  return this._proxyUrl(
4187
4199
  V(
4188
4200
  //
4189
- We(this.$$("cdn-cname"), this.$$("uuid")),
4201
+ qe(this.$$("cdn-cname"), this.$$("uuid")),
4190
4202
  r
4191
4203
  )
4192
4204
  );
@@ -4194,7 +4206,7 @@ class Wo extends Ho {
4194
4206
  return this._proxyUrl(
4195
4207
  V(
4196
4208
  //
4197
- We(this.$$("cdn-cname"), this.$$("uuid")),
4209
+ qe(this.$$("cdn-cname"), this.$$("uuid")),
4198
4210
  r
4199
4211
  )
4200
4212
  );
@@ -4254,10 +4266,10 @@ class Wo extends Ho {
4254
4266
  }
4255
4267
  get currentImg() {
4256
4268
  return this.hasPreviewImage ? {
4257
- type: Oi.PREVIEW,
4269
+ type: Li.PREVIEW,
4258
4270
  img: this._imgPreview
4259
4271
  } : {
4260
- type: Oi.MAIN,
4272
+ type: Li.MAIN,
4261
4273
  img: this.img
4262
4274
  };
4263
4275
  }
@@ -4311,8 +4323,8 @@ class Wo extends Ho {
4311
4323
  }
4312
4324
  loaderImage({ src: e, srcset: t, elNode: r }) {
4313
4325
  return new Promise((n, o) => {
4314
- this._setupConfigForImage({ elNode: r }), r.setAttribute(Si, ""), r.addEventListener("load", () => {
4315
- r.removeAttribute(Si), n(r);
4326
+ this._setupConfigForImage({ elNode: r }), r.setAttribute(xi, ""), r.addEventListener("load", () => {
4327
+ r.removeAttribute(xi), n(r);
4316
4328
  }), r.addEventListener("error", () => {
4317
4329
  o(!1);
4318
4330
  }), this._appendURL({
@@ -4368,7 +4380,7 @@ class qo extends Wo {
4368
4380
  });
4369
4381
  }
4370
4382
  }
4371
- class Yt extends $ {
4383
+ class Jt extends $ {
4372
4384
  constructor() {
4373
4385
  super();
4374
4386
  u(this, "couldBeCtxOwner", !0);
@@ -4393,7 +4405,7 @@ class Yt extends $ {
4393
4405
  });
4394
4406
  }
4395
4407
  }
4396
- Yt.template = /* HTML */
4408
+ Jt.template = /* HTML */
4397
4409
  `
4398
4410
  <lr-drop-area set="@disabled: !withDropZone">
4399
4411
  <button type="button" set="onclick: onClick">
@@ -4404,7 +4416,7 @@ Yt.template = /* HTML */
4404
4416
  </button>
4405
4417
  </lr-drop-area>
4406
4418
  `;
4407
- Yt.bindAttributes({
4419
+ Jt.bindAttributes({
4408
4420
  // @ts-expect-error TODO: we need to update symbiote types
4409
4421
  dropzone: null
4410
4422
  });
@@ -4515,12 +4527,12 @@ const N = {
4515
4527
  NEAR: 2,
4516
4528
  OVER: 3
4517
4529
  };
4518
- let Li = ["focus"], Yo = 100, St = /* @__PURE__ */ new Map();
4530
+ let Pi = ["focus"], Yo = 100, St = /* @__PURE__ */ new Map();
4519
4531
  function Jo(s, i) {
4520
4532
  let e = Math.max(Math.min(s[0], i.x + i.width), i.x), t = Math.max(Math.min(s[1], i.y + i.height), i.y);
4521
4533
  return Math.sqrt((s[0] - e) * (s[0] - e) + (s[1] - t) * (s[1] - t));
4522
4534
  }
4523
- function Pi(s) {
4535
+ function Ui(s) {
4524
4536
  let i = 0, e = document.body, t = /* @__PURE__ */ new Set(), r = (p) => t.add(p), n = N.INACTIVE, o = (p) => {
4525
4537
  s.shouldIgnore() && p !== N.INACTIVE || (n !== p && t.forEach((g) => g(p)), n = p);
4526
4538
  }, l = () => i > 0;
@@ -4548,16 +4560,16 @@ function Pi(s) {
4548
4560
  let g = await Ko(p.dataTransfer);
4549
4561
  s.onItems(g), o(N.INACTIVE);
4550
4562
  };
4551
- return e.addEventListener("drop", d), e.addEventListener("dragleave", h), e.addEventListener("dragenter", c), e.addEventListener("dragover", f), s.element.addEventListener("drop", m), Li.forEach((p) => {
4563
+ return e.addEventListener("drop", d), e.addEventListener("dragleave", h), e.addEventListener("dragenter", c), e.addEventListener("dragover", f), s.element.addEventListener("drop", m), Pi.forEach((p) => {
4552
4564
  window.addEventListener(p, a);
4553
4565
  }), () => {
4554
- St.delete(s.element), e.removeEventListener("drop", d), e.removeEventListener("dragleave", h), e.removeEventListener("dragenter", c), e.removeEventListener("dragover", f), s.element.removeEventListener("drop", m), Li.forEach((p) => {
4566
+ St.delete(s.element), e.removeEventListener("drop", d), e.removeEventListener("dragleave", h), e.removeEventListener("dragenter", c), e.removeEventListener("dragover", f), s.element.removeEventListener("drop", m), Pi.forEach((p) => {
4555
4567
  window.removeEventListener(p, a);
4556
4568
  });
4557
4569
  };
4558
4570
  }
4559
4571
  const Ss = "lr-drop-area", xe = `${Ss}/registry`;
4560
- class Jt extends $ {
4572
+ class Zt extends $ {
4561
4573
  constructor() {
4562
4574
  super(), this.init$ = {
4563
4575
  ...this.init$,
@@ -4608,7 +4620,7 @@ class Jt extends $ {
4608
4620
  (e) => {
4609
4621
  typeof e == "string" ? this.set$({ text: this.l10n(e) || e }) : this.set$({ text: this.l10n("drop-files-here") });
4610
4622
  }
4611
- ), this._destroyDropzone = Pi({
4623
+ ), this._destroyDropzone = Ui({
4612
4624
  element: this,
4613
4625
  shouldIgnore: () => this._shouldIgnore(),
4614
4626
  /** @param {DropzoneState} state */
@@ -4625,7 +4637,7 @@ class Jt extends $ {
4625
4637
  }
4626
4638
  });
4627
4639
  let i = this.ref["content-wrapper"];
4628
- i && (this._destroyContentWrapperDropzone = Pi({
4640
+ i && (this._destroyContentWrapperDropzone = Ui({
4629
4641
  element: i,
4630
4642
  /** @param {DropzoneState} state */
4631
4643
  onChange: (e) => {
@@ -4672,7 +4684,7 @@ class Jt extends $ {
4672
4684
  i && (i.delete(this), i.size === 0 && T.deleteCtx(Ss)), (e = this._destroyDropzone) == null || e.call(this), (t = this._destroyContentWrapperDropzone) == null || t.call(this), this._onAreaClicked && this.removeEventListener("click", this._onAreaClicked);
4673
4685
  }
4674
4686
  }
4675
- Jt.template = /* HTML */
4687
+ Zt.template = /* HTML */
4676
4688
  `
4677
4689
  <slot>
4678
4690
  <div data-default-slot hidden></div>
@@ -4685,7 +4697,7 @@ Jt.template = /* HTML */
4685
4697
  </div>
4686
4698
  </slot>
4687
4699
  `;
4688
- Jt.bindAttributes({
4700
+ Zt.bindAttributes({
4689
4701
  // @ts-expect-error TODO: fix types inside symbiote
4690
4702
  "with-icon": null,
4691
4703
  // @ts-expect-error TODO: fix types inside symbiote
@@ -4698,7 +4710,7 @@ Jt.bindAttributes({
4698
4710
  disabled: null
4699
4711
  });
4700
4712
  const Zo = "src-type-";
4701
- class Zt extends $ {
4713
+ class Qt extends $ {
4702
4714
  constructor() {
4703
4715
  super();
4704
4716
  u(this, "couldBeCtxOwner", !0);
@@ -4782,12 +4794,12 @@ class Zt extends $ {
4782
4794
  };
4783
4795
  }
4784
4796
  }
4785
- Zt.template = /* HTML */
4797
+ Qt.template = /* HTML */
4786
4798
  `
4787
4799
  <lr-icon set="@name: iconName"></lr-icon>
4788
4800
  <div class="txt" l10n="src-type"></div>
4789
4801
  `;
4790
- Zt.bindAttributes({
4802
+ Qt.bindAttributes({
4791
4803
  // @ts-expect-error symbiote types bug
4792
4804
  type: null
4793
4805
  });
@@ -4985,7 +4997,7 @@ const ll = () => new Promise((s) => {
4985
4997
  // ("SOF14", "Differential progressive DCT (AC)", SOF)
4986
4998
  207
4987
4999
  // ("SOF15", "Differential spatial (AC)", SOF)
4988
- ], Ui = {
5000
+ ], Ri = {
4989
5001
  squareSide: [
4990
5002
  // Safari (iOS < 9, ram >= 256)
4991
5003
  // We are supported mobile safari < 9 since widget v2, by 5 Mpx limit
@@ -5079,7 +5091,7 @@ function Ps(s) {
5079
5091
  });
5080
5092
  }
5081
5093
  const bl = Ps(ks(Ls, Os)), _l = Ps(ks(Ls, Os)), Us = async (s, i) => {
5082
- const e = Ui.squareSide.find((o) => o * o >= s * i), t = Ui.dimension.find((o) => o >= s && o >= i);
5094
+ const e = Ri.squareSide.find((o) => o * o >= s * i), t = Ri.dimension.find((o) => o >= s && o >= i);
5083
5095
  if (!e || !t)
5084
5096
  throw new Error("Not supported");
5085
5097
  const [r, n] = await Promise.all([
@@ -5181,11 +5193,11 @@ function Sl(s, i = 40) {
5181
5193
  });
5182
5194
  return r.src = URL.createObjectURL(s), n;
5183
5195
  }
5184
- const Ri = 16384, xl = /^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i, Il = (s) => {
5196
+ const Mi = 16384, xl = /^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i, Il = (s) => {
5185
5197
  const i = xl.exec(s == null ? void 0 : s.toLocaleLowerCase()) || [];
5186
5198
  if (!i.length)
5187
5199
  return !1;
5188
- const e = i[1] * i[2], t = Ri * Ri;
5200
+ const e = i[1] * i[2], t = Mi * Mi;
5189
5201
  return e > t ? (console.warn(
5190
5202
  `Shrinked size can not be larger than ${Math.floor(t / 1e3 / 1e3)}MP. You have set ${i[1]}x${i[2]} (${Math.ceil(e / 1e3 / 100) / 10}MP).`
5191
5203
  ), !1) : {
@@ -5275,7 +5287,7 @@ class Ee extends $ {
5275
5287
  if (e.getValue("fileInfo") && e.getValue("isImage")) {
5276
5288
  let r = this.cfg.thumbSize, n = this.proxyUrl(
5277
5289
  V(
5278
- We(this.cfg.cdnCname, this._entry.getValue("uuid")),
5290
+ qe(this.cfg.cdnCname, this._entry.getValue("uuid")),
5279
5291
  ae(e.getValue("cdnUrlModifiers"), `scale_crop/${r}x${r}/center`)
5280
5292
  )
5281
5293
  ), o = e.getValue("thumbUrl");
@@ -5413,7 +5425,7 @@ class Ee extends $ {
5413
5425
  signal: o.signal,
5414
5426
  metadata: await this.getMetadataFor(e.uid)
5415
5427
  };
5416
- return this.debugPrint("upload options", h, f), as(h, f);
5428
+ return this.debugPrint("upload options", h, f), cs(h, f);
5417
5429
  };
5418
5430
  let a = await this.$["*uploadQueue"].add(l);
5419
5431
  e.setMultipleValues({
@@ -5468,7 +5480,7 @@ Ee.template = /* HTML */
5468
5480
  </div>
5469
5481
  `;
5470
5482
  Ee.activeInstances = /* @__PURE__ */ new Set();
5471
- class Qt extends k {
5483
+ class ei extends k {
5472
5484
  constructor() {
5473
5485
  super();
5474
5486
  u(this, "_handleBackdropClick", () => {
@@ -5521,8 +5533,8 @@ class Qt extends k {
5521
5533
  super.destroyCallback(), document.body.style.overflow = "", this._mouseDownTarget = void 0, this.ref.dialog.removeEventListener("close", this._handleDialogClose), this.ref.dialog.removeEventListener("mousedown", this._handleDialogMouseDown), this.ref.dialog.removeEventListener("mouseup", this._handleDialogMouseUp);
5522
5534
  }
5523
5535
  }
5524
- u(Qt, "StateConsumerScope", "modal");
5525
- Qt.template = /* HTML */
5536
+ u(ei, "StateConsumerScope", "modal");
5537
+ ei.template = /* HTML */
5526
5538
  `
5527
5539
  <dialog ref="dialog">
5528
5540
  <slot></slot>
@@ -5752,7 +5764,7 @@ Ds.template = /* HTML */
5752
5764
  ></button>
5753
5765
  </form>
5754
5766
  `;
5755
- const Mi = () => typeof navigator.permissions < "u";
5767
+ const Ni = () => typeof navigator.permissions < "u";
5756
5768
  class zs extends $ {
5757
5769
  constructor() {
5758
5770
  super(...arguments);
@@ -5767,7 +5779,7 @@ class zs extends $ {
5767
5779
  shotBtnDisabled: !0,
5768
5780
  videoHidden: !0,
5769
5781
  messageHidden: !0,
5770
- requestBtnHidden: Mi(),
5782
+ requestBtnHidden: Ni(),
5771
5783
  l10nMessage: null,
5772
5784
  originalErrorMessage: null,
5773
5785
  cameraSelectOptions: null,
@@ -5787,7 +5799,7 @@ class zs extends $ {
5787
5799
  });
5788
5800
  /** @private */
5789
5801
  u(this, "_onActivate", () => {
5790
- Mi() && this._subscribePermissions(), this._capture();
5802
+ Ni() && this._subscribePermissions(), this._capture();
5791
5803
  });
5792
5804
  /** @private */
5793
5805
  u(this, "_onDeactivate", () => {
@@ -6214,7 +6226,7 @@ class Ws extends k {
6214
6226
  Ws.template = /* HTML */
6215
6227
  ' <div ref="line" class="progress"></div> ';
6216
6228
  const me = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";
6217
- class ei extends k {
6229
+ class ti extends k {
6218
6230
  constructor() {
6219
6231
  super();
6220
6232
  u(this, "init$", {
@@ -6248,19 +6260,19 @@ class ei extends k {
6248
6260
  URL.revokeObjectURL(this._lastObjectUrl), this.$.src = me;
6249
6261
  }
6250
6262
  }
6251
- ei.template = /* HTML */
6263
+ ti.template = /* HTML */
6252
6264
  ' <lr-img class="img-view" ref="img" set="@src: src; style.aa: src;" /> ';
6253
- ei.bindAttributes({
6265
+ ti.bindAttributes({
6254
6266
  checkerboard: "checkerboard"
6255
6267
  });
6256
- const Ni = "--cfg-ctx-name";
6268
+ const Fi = "--cfg-ctx-name";
6257
6269
  class _e extends k {
6258
6270
  /**
6259
6271
  * @private
6260
6272
  * @returns {string}
6261
6273
  */
6262
6274
  get cfgCssCtxName() {
6263
- return this.getCssData(Ni, !0);
6275
+ return this.getCssData(Fi, !0);
6264
6276
  }
6265
6277
  /** @private */
6266
6278
  get cfgCtxName() {
@@ -6274,7 +6286,7 @@ class _e extends k {
6274
6286
  var i;
6275
6287
  if (!this.connectedOnce) {
6276
6288
  const e = (i = this.getAttribute("ctx-name")) == null ? void 0 : i.trim();
6277
- e && this.style.setProperty(Ni, `'${e}'`);
6289
+ e && this.style.setProperty(Fi, `'${e}'`);
6278
6290
  }
6279
6291
  super.connectedCallback();
6280
6292
  }
@@ -6424,7 +6436,7 @@ const Ul = (
6424
6436
  </div>
6425
6437
  `
6426
6438
  );
6427
- class Ne extends _e {
6439
+ class Fe extends _e {
6428
6440
  constructor() {
6429
6441
  super();
6430
6442
  /** @private */
@@ -6467,14 +6479,14 @@ class Ne extends _e {
6467
6479
  async updateImage() {
6468
6480
  if (this.isConnected) {
6469
6481
  if (await this._waitForSize(), this.$.cdnUrl) {
6470
- const e = lo(this.$.cdnUrl), t = We(this.$.cdnUrl, e);
6482
+ const e = lo(this.$.cdnUrl), t = qe(this.$.cdnUrl, e);
6471
6483
  if (t === this.$["*originalUrl"])
6472
6484
  return;
6473
6485
  this.$["*originalUrl"] = t;
6474
6486
  const r = ao(this.$.cdnUrl), n = $o(r);
6475
6487
  this.$["*editorTransformations"] = n;
6476
6488
  } else if (this.$.uuid) {
6477
- const e = We(this.cfg.cdnCname, this.$.uuid);
6489
+ const e = qe(this.cfg.cdnCname, this.$.uuid);
6478
6490
  if (e === this.$["*originalUrl"])
6479
6491
  return;
6480
6492
  this.$["*originalUrl"] = e, this.$["*editorTransformations"] = {};
@@ -6507,7 +6519,7 @@ class Ne extends _e {
6507
6519
  let t = this.ref["img-el"];
6508
6520
  t.src !== e && (this._imgLoading = !0, t.src = e || me);
6509
6521
  }), this.sub("cropPreset", (e) => {
6510
- this.$["*cropPresetList"] = fs(e);
6522
+ this.$["*cropPresetList"] = ps(e);
6511
6523
  }), this.sub(
6512
6524
  "tabs",
6513
6525
  /** @param {string} val */
@@ -6544,9 +6556,9 @@ class Ne extends _e {
6544
6556
  ), this.sub("uuid", (e) => e && this.updateImage()), this.sub("cdnUrl", (e) => e && this.updateImage());
6545
6557
  }
6546
6558
  }
6547
- u(Ne, "className", "cloud-image-editor");
6548
- Ne.template = Ul;
6549
- Ne.bindAttributes({
6559
+ u(Fe, "className", "cloud-image-editor");
6560
+ Fe.template = Ul;
6561
+ Fe.bindAttributes({
6550
6562
  uuid: "uuid",
6551
6563
  "cdn-url": "cdnUrl",
6552
6564
  "crop-preset": "cropPreset",
@@ -6635,7 +6647,7 @@ class Gs extends _e {
6635
6647
  Ie(n, p);
6636
6648
  } else {
6637
6649
  const p = ke(
6638
- Math.min(d, f) / (Pt * 2 + je) / 2,
6650
+ Math.min(d, f) / (Pt * 2 + He) / 2,
6639
6651
  0,
6640
6652
  1
6641
6653
  );
@@ -6646,7 +6658,7 @@ class Gs extends _e {
6646
6658
  p
6647
6659
  );
6648
6660
  const E = Math.max(
6649
- Ei * ke(Math.min(d, f) / Ei / 3, 0, 1),
6661
+ Ai * ke(Math.min(d, f) / Ai / 3, 0, 1),
6650
6662
  Vn
6651
6663
  );
6652
6664
  Ie(n, {
@@ -6688,7 +6700,7 @@ class Gs extends _e {
6688
6700
  }), l = q("path", {
6689
6701
  stroke: "currentColor",
6690
6702
  fill: "none",
6691
- "stroke-width": ds
6703
+ "stroke-width": fs
6692
6704
  });
6693
6705
  n.appendChild(l), n.appendChild(o), i[r] = {
6694
6706
  direction: r,
@@ -6915,7 +6927,7 @@ class Xs extends vt {
6915
6927
  };
6916
6928
  }
6917
6929
  }
6918
- const Ve = {
6930
+ const Be = {
6919
6931
  FILTER: "filter",
6920
6932
  COLOR_OPERATION: "color_operation"
6921
6933
  }, fe = "original";
@@ -6940,7 +6952,7 @@ class Ks extends _e {
6940
6952
  * @param {String} [filter]
6941
6953
  */
6942
6954
  setOperation(e, t) {
6943
- this._controlType = e === "filter" ? Ve.FILTER : Ve.COLOR_OPERATION, this._operation = e, this._iconName = e, this._title = e.toUpperCase(), this._filter = t, this._initializeValues(), this.$["*faderEl"].activate({
6955
+ this._controlType = e === "filter" ? Be.FILTER : Be.COLOR_OPERATION, this._operation = e, this._iconName = e, this._title = e.toUpperCase(), this._filter = t, this._initializeValues(), this.$["*faderEl"].activate({
6944
6956
  url: this.$["*originalUrl"],
6945
6957
  operation: this._operation,
6946
6958
  value: this._filter === fe ? void 0 : this.$.value,
@@ -6953,7 +6965,7 @@ class Ks extends _e {
6953
6965
  let { range: e, zero: t } = Ue[this._operation], [r, n] = e;
6954
6966
  this.$.min = r, this.$.max = n, this.$.zero = t;
6955
6967
  let o = this.$["*editorTransformations"][this._operation];
6956
- if (this._controlType === Ve.FILTER) {
6968
+ if (this._controlType === Be.FILTER) {
6957
6969
  let l = n;
6958
6970
  if (o) {
6959
6971
  let { name: a, amount: c } = o;
@@ -6961,14 +6973,14 @@ class Ks extends _e {
6961
6973
  }
6962
6974
  this.$.value = l, this.$.defaultValue = l;
6963
6975
  }
6964
- if (this._controlType === Ve.COLOR_OPERATION) {
6976
+ if (this._controlType === Be.COLOR_OPERATION) {
6965
6977
  let l = typeof o < "u" ? o : t;
6966
6978
  this.$.value = l, this.$.defaultValue = l;
6967
6979
  }
6968
6980
  }
6969
6981
  apply() {
6970
6982
  let e;
6971
- this._controlType === Ve.FILTER ? this._filter === fe ? e = null : e = { name: this._filter, amount: this.$.value } : e = this.$.value;
6983
+ this._controlType === Be.FILTER ? this._filter === fe ? e = null : e = { name: this._filter, amount: this.$.value } : e = this.$.value;
6972
6984
  let t = {
6973
6985
  ...this.$["*editorTransformations"],
6974
6986
  [this._operation]: e
@@ -6994,7 +7006,7 @@ Ks.template = /* HTML */
6994
7006
  set="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;"
6995
7007
  ></lr-slider-ui>
6996
7008
  `;
6997
- function ti(s) {
7009
+ function ii(s) {
6998
7010
  let i = new Image();
6999
7011
  return { promise: new Promise((r, n) => {
7000
7012
  i.src = s, i.onload = r, i.onerror = n;
@@ -7005,7 +7017,7 @@ function ti(s) {
7005
7017
  function Ft(s) {
7006
7018
  let i = [];
7007
7019
  for (let n of s) {
7008
- let o = ti(n);
7020
+ let o = ii(n);
7009
7021
  i.push(o);
7010
7022
  }
7011
7023
  let e = i.map((n) => n.image);
@@ -7015,7 +7027,7 @@ function Ft(s) {
7015
7027
  });
7016
7028
  } };
7017
7029
  }
7018
- class ii extends vt {
7030
+ class si extends vt {
7019
7031
  constructor() {
7020
7032
  super(...arguments);
7021
7033
  u(this, "init$", {
@@ -7036,7 +7048,7 @@ class ii extends vt {
7036
7048
  } : void 0, V(
7037
7049
  this._originalUrl,
7038
7050
  ae(
7039
- ws,
7051
+ Es,
7040
7052
  _t(l),
7041
7053
  `quality/${n}`,
7042
7054
  `scale_crop/${r}x${r}/center`
@@ -7049,7 +7061,7 @@ class ii extends vt {
7049
7061
  */
7050
7062
  _observerCallback(e, t) {
7051
7063
  if (e[0].isIntersecting) {
7052
- let n = this.proxyUrl(this._previewSrc()), o = this.ref["preview-el"], { promise: l, cancel: a } = ti(n);
7064
+ let n = this.proxyUrl(this._previewSrc()), o = this.ref["preview-el"], { promise: l, cancel: a } = ii(n);
7053
7065
  this._cancelPreload = a, l.catch((c) => {
7054
7066
  this.$["*networkProblems"] = !0, console.error("Failed to load image", { error: c });
7055
7067
  }).finally(() => {
@@ -7090,7 +7102,7 @@ class ii extends vt {
7090
7102
  super.destroyCallback(), (e = this._observer) == null || e.disconnect(), this._cancelPreload && this._cancelPreload();
7091
7103
  }
7092
7104
  }
7093
- ii.template = /* HTML */
7105
+ si.template = /* HTML */
7094
7106
  `
7095
7107
  <div class="before"></div>
7096
7108
  <div class="preview" ref="preview-el"></div>
@@ -7126,12 +7138,12 @@ function Nl(s, i) {
7126
7138
  }
7127
7139
  return e;
7128
7140
  }
7129
- function si(s, i, e) {
7141
+ function ri(s, i, e) {
7130
7142
  let r = window.devicePixelRatio, n = Math.min(Math.ceil(i * r), 3e3), o = r >= 2 ? "lightest" : "normal";
7131
7143
  return V(
7132
7144
  s,
7133
7145
  ae(
7134
- ws,
7146
+ Es,
7135
7147
  _t(e),
7136
7148
  `quality/${o}`,
7137
7149
  `stretch/off/-/resize/${n}x`
@@ -7190,7 +7202,7 @@ class Js extends _e {
7190
7202
  _alignImage() {
7191
7203
  if (!this._isActive || !this.$.image)
7192
7204
  return;
7193
- let i = this.$.image, e = this.$["*padding"], t = this.$["*operations"], { rotate: r } = t, n = { width: this.offsetWidth, height: this.offsetHeight }, o = De({ width: i.naturalWidth, height: i.naturalHeight }, r), l;
7205
+ let i = this.$.image, e = this.$["*padding"], t = this.$["*operations"], { rotate: r } = t, n = { width: this.offsetWidth, height: this.offsetHeight }, o = ze({ width: i.naturalWidth, height: i.naturalHeight }, r), l;
7194
7206
  if (o.width > n.width - e * 2 || o.height > n.height - e * 2) {
7195
7207
  let a = o.width / o.height, c = n.width / n.height;
7196
7208
  if (a > c) {
@@ -7214,7 +7226,7 @@ class Js extends _e {
7214
7226
  let {
7215
7227
  dimensions: [f, m],
7216
7228
  coords: [p, g]
7217
- } = n, { width: C } = De(this._imageSize, r), E = o / C;
7229
+ } = n, { width: C } = ze(this._imageSize, r), E = o / C;
7218
7230
  i = lt(
7219
7231
  st({
7220
7232
  x: l + p * E,
@@ -7243,7 +7255,7 @@ class Js extends _e {
7243
7255
  let i = this._ctx;
7244
7256
  if (!i)
7245
7257
  return;
7246
- let e = this.$.image, t = this.$["*imageBox"], r = this.$["*operations"], { mirror: n, flip: o, rotate: l } = r, a = De({ width: t.width, height: t.height }, l);
7258
+ let e = this.$.image, t = this.$["*imageBox"], r = this.$["*operations"], { mirror: n, flip: o, rotate: l } = r, a = ze({ width: t.width, height: t.height }, l);
7247
7259
  i.save(), i.translate(t.x + t.width / 2, t.y + t.height / 2), i.rotate(l * Math.PI * -1 / 180), i.scale(n ? -1 : 1, o ? -1 : 1), i.drawImage(e, -a.width / 2, -a.height / 2, a.width, a.height), i.restore();
7248
7260
  }
7249
7261
  /** @private */
@@ -7271,7 +7283,7 @@ class Js extends _e {
7271
7283
  * @returns {NonNullable<import('./types.js').Transformations['crop']>['dimensions']}
7272
7284
  */
7273
7285
  _getCropDimensions() {
7274
- let i = this.$["*cropBox"], e = this.$["*imageBox"], t = this.$["*operations"], { rotate: r } = t, { width: n, height: o } = e, { width: l, height: a } = De(this._imageSize, r), { width: c, height: h } = i, d = n / l, f = o / a;
7286
+ let i = this.$["*cropBox"], e = this.$["*imageBox"], t = this.$["*operations"], { rotate: r } = t, { width: n, height: o } = e, { width: l, height: a } = ze(this._imageSize, r), { width: c, height: h } = i, d = n / l, f = o / a;
7275
7287
  return [
7276
7288
  ke(Math.round(c / d), 1, l),
7277
7289
  ke(Math.round(h / f), 1, a)
@@ -7282,7 +7294,7 @@ class Js extends _e {
7282
7294
  * @returns {import('./types.js').Transformations['crop']}
7283
7295
  */
7284
7296
  _getCropTransformation() {
7285
- let i = this.$["*cropBox"], e = this.$["*imageBox"], t = this.$["*operations"], { rotate: r } = t, { width: n, height: o, x: l, y: a } = e, { width: c, height: h } = De(this._imageSize, r), { x: d, y: f } = i, m = n / c, p = o / h, g = this._getCropDimensions(), C = {
7297
+ let i = this.$["*cropBox"], e = this.$["*imageBox"], t = this.$["*operations"], { rotate: r } = t, { width: n, height: o, x: l, y: a } = e, { width: c, height: h } = ze(this._imageSize, r), { x: d, y: f } = i, m = n / c, p = o / h, g = this._getCropDimensions(), C = {
7286
7298
  dimensions: g,
7287
7299
  coords: (
7288
7300
  /** @type {[Number, Number]} */
@@ -7386,7 +7398,7 @@ class Js extends _e {
7386
7398
  flip: void 0,
7387
7399
  mirror: void 0
7388
7400
  };
7389
- let r = this.proxyUrl(si(i, t, e)), { promise: n, cancel: o, image: l } = ti(r), a = this._handleImageLoading(r);
7401
+ let r = this.proxyUrl(ri(i, t, e)), { promise: n, cancel: o, image: l } = ii(r), a = this._handleImageLoading(r);
7390
7402
  return l.addEventListener("load", a, { once: !0 }), l.addEventListener("error", a, { once: !0 }), this._cancelPreload && this._cancelPreload(), this._cancelPreload = o, n.then(() => l).catch((c) => (console.error("Failed to load image", { error: c }), this.$["*networkProblems"] = !0, Promise.resolve(l)));
7391
7403
  }
7392
7404
  /**
@@ -7424,7 +7436,7 @@ Js.template = /* HTML */
7424
7436
  <canvas class="canvas" ref="canvas-el"></canvas>
7425
7437
  <lr-crop-frame ref="frame-el"></lr-crop-frame>
7426
7438
  `;
7427
- function Fi(s, i, e) {
7439
+ function Di(s, i, e) {
7428
7440
  let t = Array(e);
7429
7441
  e--;
7430
7442
  for (let r = e; r >= 0; r--)
@@ -7447,9 +7459,9 @@ function zl(s, i, e) {
7447
7459
  function Vl(s, i) {
7448
7460
  return s.map((e, t) => e < i ? s.length - t : t);
7449
7461
  }
7450
- function Di(s, i) {
7462
+ function zi(s, i) {
7451
7463
  let e = Ue[s].keypointsNumber, { range: t, zero: r } = Ue[s];
7452
- return [.../* @__PURE__ */ new Set([...Fi(t[0], r, e + 1), ...Fi(r, t[1], e + 1), r, i])].sort(
7464
+ return [.../* @__PURE__ */ new Set([...Di(t[0], r, e + 1), ...Di(r, t[1], e + 1), r, i])].sort(
7453
7465
  (n, o) => n - o
7454
7466
  );
7455
7467
  }
@@ -7491,7 +7503,7 @@ class Bl extends _e {
7491
7503
  let n = { ...this._transformations };
7492
7504
  t && (n[t] = e ? { name: e, amount: r } : r);
7493
7505
  let o = this.offsetWidth;
7494
- return this.proxyUrl(si(i, o, n));
7506
+ return this.proxyUrl(ri(i, o, n));
7495
7507
  }
7496
7508
  /**
7497
7509
  * @private
@@ -7611,7 +7623,7 @@ class Bl extends _e {
7611
7623
  */
7612
7624
  preload({ url: i, filter: e, operation: t, value: r }) {
7613
7625
  this._cancelBatchPreload && this._cancelBatchPreload();
7614
- let o = Di(t, r).map((a) => this._imageSrc({ url: i, filter: e, operation: t, value: a })), { cancel: l } = Ft(o);
7626
+ let o = zi(t, r).map((a) => this._imageSrc({ url: i, filter: e, operation: t, value: a })), { cancel: l } = Ft(o);
7615
7627
  this._cancelBatchPreload = l;
7616
7628
  }
7617
7629
  /** @private */
@@ -7659,7 +7671,7 @@ class Bl extends _e {
7659
7671
  this._setOriginalSrc(l), this._container && this._container.remove();
7660
7672
  return;
7661
7673
  }
7662
- this._keypoints = Di(e, t).map((l) => this._constructKeypoint(e, l)), this._update(e, t), this._initNodes();
7674
+ this._keypoints = zi(e, t).map((l) => this._constructKeypoint(e, l)), this._update(e, t), this._initNodes();
7663
7675
  }
7664
7676
  /** @param {{ hide?: Boolean }} options */
7665
7677
  deactivate({ hide: i = !0 } = {}) {
@@ -7823,7 +7835,7 @@ class Qs extends _e {
7823
7835
  * @param {String} filter
7824
7836
  */
7825
7837
  _createFilterControl(e) {
7826
- let t = new ii();
7838
+ let t = new si();
7827
7839
  return t.filter = e, t;
7828
7840
  }
7829
7841
  /**
@@ -7887,7 +7899,7 @@ class Qs extends _e {
7887
7899
  /** @private */
7888
7900
  _preloadEditedImage() {
7889
7901
  if (this.$["*imgContainerEl"] && this.$["*originalUrl"]) {
7890
- let e = this.$["*imgContainerEl"].offsetWidth, t = this.proxyUrl(si(this.$["*originalUrl"], e, this.$["*editorTransformations"]));
7902
+ let e = this.$["*imgContainerEl"].offsetWidth, t = this.proxyUrl(ri(this.$["*originalUrl"], e, this.$["*editorTransformations"]));
7891
7903
  this._cancelPreload && this._cancelPreload();
7892
7904
  let { cancel: r } = Ft([t]);
7893
7905
  this._cancelPreload = () => {
@@ -7977,7 +7989,7 @@ Qs.template = /* HTML */
7977
7989
  </lr-presence-toggle>
7978
7990
  </div>
7979
7991
  `;
7980
- class ri extends k {
7992
+ class ni extends k {
7981
7993
  constructor() {
7982
7994
  super(), this._iconReversed = !1, this._iconSingle = !1, this._iconHidden = !1, this.init$ = {
7983
7995
  ...this.init$,
@@ -8010,8 +8022,8 @@ class ri extends k {
8010
8022
  this.hasAttribute("reverse") ? (this.style.flexDirection = "row-reverse", this._iconReversed = !0) : (this._iconReversed = !1, this.style.flexDirection = null);
8011
8023
  }
8012
8024
  }
8013
- ri.bindAttributes({ text: "text", icon: "icon", reverse: "reverse", theme: "theme" });
8014
- ri.template = /* HTML */
8025
+ ni.bindAttributes({ text: "text", icon: "icon", reverse: "reverse", theme: "theme" });
8026
+ ni.template = /* HTML */
8015
8027
  `
8016
8028
  <lr-icon size="20" set="className: iconCss; @name: icon;"></lr-icon>
8017
8029
  <div class="text">{{text}}</div>
@@ -8212,7 +8224,7 @@ class ql extends $ {
8212
8224
  this.historyBack();
8213
8225
  }
8214
8226
  mountEditor() {
8215
- const e = new Ne(), t = this.$.cdnUrl, r = this.cfg.cropPreset, n = this.cfg.cloudImageEditorTabs;
8227
+ const e = new Fe(), t = this.$.cdnUrl, r = this.cfg.cropPreset, n = this.cfg.cloudImageEditorTabs;
8216
8228
  e.setAttribute("ctx-name", this.ctxName), e.setAttribute("cdn-url", t), r && e.setAttribute("crop-preset", r), n && e.setAttribute("tabs", n), e.addEventListener("apply", (o) => {
8217
8229
  const l = (
8218
8230
  /** @type {CustomEvent<import('../CloudImageEditor/src/types.js').ApplyResult>} */
@@ -8511,7 +8523,7 @@ sr.template = /* HTML */
8511
8523
  </div>
8512
8524
  </div>
8513
8525
  `;
8514
- class ni extends k {
8526
+ class oi extends k {
8515
8527
  /** @param {String} tabL10nStr */
8516
8528
  setCurrentTab(i) {
8517
8529
  if (!i)
@@ -8545,11 +8557,11 @@ class ni extends k {
8545
8557
  }), this.hasAttribute("default") || this.setCurrentTab(Object.keys(this._tabMap)[0]);
8546
8558
  }
8547
8559
  }
8548
- ni.bindAttributes({
8560
+ oi.bindAttributes({
8549
8561
  "tab-list": null,
8550
8562
  default: null
8551
8563
  });
8552
- ni.template = /* HTML */
8564
+ oi.template = /* HTML */
8553
8565
  `
8554
8566
  <div ref="row" class="tabs-row"></div>
8555
8567
  <div ref="context" class="tabs-context">
@@ -8563,7 +8575,7 @@ class ea extends $ {
8563
8575
  }
8564
8576
  _createValidationInput() {
8565
8577
  const e = document.createElement("input");
8566
- return e.type = "text", e.name = this.ctxName, e.required = this.cfg.multipleMin > 0, e.tabIndex = -1, qi(e, {
8578
+ return e.type = "text", e.name = this.ctxName, e.required = this.cfg.multipleMin > 0, e.tabIndex = -1, Gi(e, {
8567
8579
  opacity: 0,
8568
8580
  height: 0,
8569
8581
  width: 0
@@ -8656,7 +8668,7 @@ const M = {
8656
8668
  VOL_OFF: "mute",
8657
8669
  CAP_ON: "captions",
8658
8670
  CAP_OFF: "captions-off"
8659
- }, zi = {
8671
+ }, Vi = {
8660
8672
  requestFullscreen: (s) => {
8661
8673
  s.requestFullscreen ? s.requestFullscreen() : s.webkitRequestFullscreen && s.webkitRequestFullscreen();
8662
8674
  },
@@ -8706,7 +8718,7 @@ class oe extends k {
8706
8718
  this._video.paused || this._video.ended ? this._video.play() : this._video.pause();
8707
8719
  }
8708
8720
  toggleFullscreen() {
8709
- (document.fullscreenElement || document.webkitFullscreenElement) === this ? zi.exitFullscreen() : zi.requestFullscreen(this);
8721
+ (document.fullscreenElement || document.webkitFullscreenElement) === this ? Vi.exitFullscreen() : Vi.requestFullscreen(this);
8710
8722
  }
8711
8723
  toggleCaptions() {
8712
8724
  this.$.capIcon === M.CAP_OFF ? (this.$.capIcon = M.CAP_ON, this._video.textTracks[0].mode = "showing", window.localStorage.setItem(oe.is + ":captions", "1")) : (this.$.capIcon = M.CAP_OFF, this._video.textTracks[0].mode = "hidden", window.localStorage.removeItem(oe.is + ":captions"));
@@ -8841,7 +8853,7 @@ oe.bindAttributes({
8841
8853
  src: "src"
8842
8854
  });
8843
8855
  const ia = "css-src";
8844
- function oi(s) {
8856
+ function li(s) {
8845
8857
  return class extends s {
8846
8858
  constructor() {
8847
8859
  super(...arguments);
@@ -8868,7 +8880,7 @@ function oi(s) {
8868
8880
  });
8869
8881
  }
8870
8882
  initCallback() {
8871
- super.initCallback(), this.setAttribute("hidden", ""), Ji({
8883
+ super.initCallback(), this.setAttribute("hidden", ""), Zi({
8872
8884
  element: this,
8873
8885
  attribute: ia,
8874
8886
  onSuccess: (e) => {
@@ -8893,7 +8905,7 @@ function oi(s) {
8893
8905
  }
8894
8906
  };
8895
8907
  }
8896
- class nr extends oi(k) {
8908
+ class nr extends li(k) {
8897
8909
  }
8898
8910
  class or extends k {
8899
8911
  initCallback() {
@@ -8919,11 +8931,11 @@ u(
8919
8931
  >
8920
8932
  `
8921
8933
  );
8922
- class li extends nr {
8934
+ class ai extends nr {
8923
8935
  constructor() {
8924
8936
  super(...arguments);
8925
8937
  u(this, "requireCtxName", !0);
8926
- u(this, "init$", us(this));
8938
+ u(this, "init$", ds(this));
8927
8939
  u(this, "_template", null);
8928
8940
  }
8929
8941
  static set template(e) {
@@ -8934,7 +8946,7 @@ class li extends nr {
8934
8946
  return this._template;
8935
8947
  }
8936
8948
  }
8937
- let ai = class extends li {
8949
+ let ci = class extends ai {
8938
8950
  shadowReadyCallback() {
8939
8951
  super.shadowReadyCallback(), this.sub(
8940
8952
  "*modalActive",
@@ -8945,7 +8957,7 @@ let ai = class extends li {
8945
8957
  );
8946
8958
  }
8947
8959
  };
8948
- ai.template = /* HTML */
8960
+ ci.template = /* HTML */
8949
8961
  `
8950
8962
  <lr-simple-btn></lr-simple-btn>
8951
8963
 
@@ -8965,7 +8977,7 @@ ai.template = /* HTML */
8965
8977
 
8966
8978
  <lr-progress-bar-common></lr-progress-bar-common>
8967
8979
  `;
8968
- let Ct = class extends li {
8980
+ let Ct = class extends ai {
8969
8981
  constructor() {
8970
8982
  super(...arguments);
8971
8983
  u(this, "pauseRender", !0);
@@ -8991,7 +9003,7 @@ Ct.template = /* HTML */
8991
9003
  </lr-start-from>
8992
9004
  <lr-upload-list ref="uBlock"></lr-upload-list>
8993
9005
  `;
8994
- let lr = class extends li {
9006
+ let lr = class extends ai {
8995
9007
  constructor() {
8996
9008
  super(), this.init$ = {
8997
9009
  ...this.init$,
@@ -9037,7 +9049,7 @@ lr.template = /* HTML */
9037
9049
  <lr-external-source></lr-external-source>
9038
9050
  <lr-progress-bar></lr-progress-bar>
9039
9051
  <lr-cloud-image-editor-activity></lr-cloud-image-editor-activity>`;
9040
- class sa extends oi(Ne) {
9052
+ class sa extends li(Fe) {
9041
9053
  shadowReadyCallback() {
9042
9054
  this.__shadowReady = !0, this.$["*faderEl"] = this.ref["fader-el"], this.$["*cropperEl"] = this.ref["cropper-el"], this.$["*imgContainerEl"] = this.ref["img-container-el"], this.initEditor();
9043
9055
  }
@@ -9071,7 +9083,7 @@ async function ra(s, i = !1) {
9071
9083
  }, document.head.appendChild(r);
9072
9084
  });
9073
9085
  }
9074
- const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9086
+ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9075
9087
  __proto__: null,
9076
9088
  ActivityBlock: b,
9077
9089
  ActivityHeader: ta,
@@ -9080,15 +9092,15 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9080
9092
  CameraSource: zs,
9081
9093
  CloudImageEditor: sa,
9082
9094
  CloudImageEditorActivity: ql,
9083
- CloudImageEditorBlock: Ne,
9095
+ CloudImageEditorBlock: Fe,
9084
9096
  Config: As,
9085
9097
  ConfirmationDialog: js,
9086
9098
  Copyright: or,
9087
9099
  CropFrame: Gs,
9088
9100
  Data: T,
9089
- DropArea: Jt,
9101
+ DropArea: Zt,
9090
9102
  EditorCropButtonControl: Xs,
9091
- EditorFilterControl: ii,
9103
+ EditorFilterControl: si,
9092
9104
  EditorImageCropper: Js,
9093
9105
  EditorImageFader: Bl,
9094
9106
  EditorOperationControl: Ys,
@@ -9097,16 +9109,16 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9097
9109
  EditorToolbar: Qs,
9098
9110
  ExternalSource: sr,
9099
9111
  FileItem: Ee,
9100
- FilePreview: ei,
9112
+ FilePreview: ti,
9101
9113
  FileUploaderInline: lr,
9102
9114
  FileUploaderMinimal: Ct,
9103
- FileUploaderRegular: ai,
9115
+ FileUploaderRegular: ci,
9104
9116
  FormInput: ea,
9105
- Icon: Kt,
9117
+ Icon: Yt,
9106
9118
  Img: qo,
9107
9119
  LineLoaderUi: er,
9108
- LrBtnUi: ri,
9109
- Modal: Qt,
9120
+ LrBtnUi: ni,
9121
+ Modal: ei,
9110
9122
  PACKAGE_NAME: Gt,
9111
9123
  PACKAGE_VERSION: bt,
9112
9124
  PresenceToggle: tr,
@@ -9114,12 +9126,12 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9114
9126
  ProgressBarCommon: Hs,
9115
9127
  Select: rr,
9116
9128
  ShadowWrapper: nr,
9117
- SimpleBtn: Yt,
9129
+ SimpleBtn: Jt,
9118
9130
  SliderUi: ir,
9119
- SourceBtn: Zt,
9131
+ SourceBtn: Qt,
9120
9132
  SourceList: Qo,
9121
9133
  StartFrom: $s,
9122
- Tabs: ni,
9134
+ Tabs: oi,
9123
9135
  UID: te,
9124
9136
  UploadCtxProvider: Nt,
9125
9137
  UploadDetails: Bs,
@@ -9129,7 +9141,7 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9129
9141
  Video: oe,
9130
9142
  connectBlocksFrom: ra,
9131
9143
  registerBlocks: Ke,
9132
- shadowed: oi,
9144
+ shadowed: li,
9133
9145
  toKebabCase: we
9134
9146
  }, Symbol.toStringTag, { value: "Module" })), ar = /* @__PURE__ */ new Set([
9135
9147
  "children",
@@ -9137,9 +9149,9 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9137
9149
  "ref",
9138
9150
  "style",
9139
9151
  "className"
9140
- ]), Vi = /* @__PURE__ */ new WeakMap(), na = (s) => {
9141
- let i = Vi.get(s);
9142
- return i || (i = /* @__PURE__ */ new Map(), Vi.set(s, i)), i;
9152
+ ]), Bi = /* @__PURE__ */ new WeakMap(), na = (s) => {
9153
+ let i = Bi.get(s);
9154
+ return i || (i = /* @__PURE__ */ new Map(), Bi.set(s, i)), i;
9143
9155
  }, oa = (s, i, e) => {
9144
9156
  const t = na(s), r = t.has(i);
9145
9157
  if (e) {
@@ -9149,7 +9161,7 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9149
9161
  const n = t.get(i);
9150
9162
  s.removeEventListener(i, n), t.delete(i);
9151
9163
  }
9152
- }, la = oa, Bi = (s, i, e, t, r) => {
9164
+ }, la = oa, ji = (s, i, e, t, r) => {
9153
9165
  const n = r == null ? void 0 : r[i];
9154
9166
  if (n !== void 0 && e !== t) {
9155
9167
  la(s, n, e);
@@ -9192,7 +9204,7 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9192
9204
  return;
9193
9205
  const p = /* @__PURE__ */ new Map();
9194
9206
  for (const g in m)
9195
- Bi(
9207
+ ji(
9196
9208
  d.current,
9197
9209
  g,
9198
9210
  a[g],
@@ -9200,7 +9212,7 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9200
9212
  n
9201
9213
  ), h.current.delete(g), p.set(g, a[g]);
9202
9214
  for (const [g, C] of h.current)
9203
- Bi(d.current, g, void 0, C, n);
9215
+ ji(d.current, g, void 0, C, n);
9204
9216
  h.current = p;
9205
9217
  }, []), f.suppressHydrationWarning = !0, s.createElement(i, {
9206
9218
  ...f,
@@ -9213,16 +9225,16 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9213
9225
  });
9214
9226
  });
9215
9227
  return l.displayName = t ?? e.name, l;
9216
- }, hi = Ye({
9228
+ }, ui = Ye({
9217
9229
  react: I,
9218
9230
  tagName: "lr-config",
9219
9231
  elementClass: As
9220
- }), ui = Ye({
9232
+ }), di = Ye({
9221
9233
  react: I,
9222
9234
  tagName: "lr-upload-ctx-provider",
9223
9235
  elementClass: Nt,
9224
9236
  schema: Nt.EventType
9225
- }), di = (s) => `https://cdn.jsdelivr.net/npm/@uploadcare/blocks@${bt}/web/lr-file-uploader-${s}.min.css`, fi = (s) => {
9237
+ }), fi = (s) => `https://cdn.jsdelivr.net/npm/@uploadcare/blocks@${bt}/web/lr-file-uploader-${s}.min.css`, pi = (s) => {
9226
9238
  const i = {}, e = {};
9227
9239
  return Object.entries(s).forEach(([t, r]) => {
9228
9240
  t.startsWith("on") ? i[t] = r : e[t] = r;
@@ -9231,21 +9243,21 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9231
9243
  config: e
9232
9244
  };
9233
9245
  };
9234
- Ke(ci);
9246
+ Ke(hi);
9235
9247
  const ua = Ye({
9236
9248
  react: I,
9237
9249
  tagName: "lr-file-uploader-regular",
9238
- elementClass: ai
9239
- }), da = di("regular"), wa = ({
9250
+ elementClass: ci
9251
+ }), da = fi("regular"), wa = ({
9240
9252
  refUploadCtxProvider: s,
9241
9253
  ...i
9242
9254
  }) => {
9243
9255
  const e = Le(() => te.generate(), [te.generate]), { eventHandlers: t, config: r } = Le(
9244
- () => fi(i),
9256
+ () => pi(i),
9245
9257
  [i]
9246
9258
  );
9247
- return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(hi, { "ctx-name": e, ...r }), /* @__PURE__ */ I.createElement(
9248
- ui,
9259
+ return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name": e, ...r }), /* @__PURE__ */ I.createElement(
9260
+ di,
9249
9261
  {
9250
9262
  ref: s,
9251
9263
  "ctx-name": e,
@@ -9259,21 +9271,21 @@ const ua = Ye({
9259
9271
  }
9260
9272
  ));
9261
9273
  };
9262
- Ke(ci);
9274
+ Ke(hi);
9263
9275
  const fa = Ye({
9264
9276
  react: I,
9265
9277
  tagName: "lr-file-uploader-minimal",
9266
9278
  elementClass: Ct
9267
- }), pa = di("minimal"), Ea = ({
9279
+ }), pa = fi("minimal"), Ea = ({
9268
9280
  refUploadCtxProvider: s,
9269
9281
  ...i
9270
9282
  }) => {
9271
9283
  const e = Le(() => te.generate(), [te.generate]), { eventHandlers: t, config: r } = Le(
9272
- () => fi(i),
9284
+ () => pi(i),
9273
9285
  [i]
9274
9286
  );
9275
- return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(hi, { "ctx-name": e, ...r }), /* @__PURE__ */ I.createElement(
9276
- ui,
9287
+ return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name": e, ...r }), /* @__PURE__ */ I.createElement(
9288
+ di,
9277
9289
  {
9278
9290
  ref: s,
9279
9291
  "ctx-name": e,
@@ -9287,21 +9299,21 @@ const fa = Ye({
9287
9299
  }
9288
9300
  ));
9289
9301
  };
9290
- Ke(ci);
9302
+ Ke(hi);
9291
9303
  const ma = Ye({
9292
9304
  react: I,
9293
9305
  tagName: "lr-file-uploader-inline",
9294
9306
  elementClass: Ct
9295
- }), ga = di("inline"), Aa = ({
9307
+ }), ga = fi("inline"), Aa = ({
9296
9308
  refUploadCtxProvider: s,
9297
9309
  ...i
9298
9310
  }) => {
9299
9311
  const e = Le(() => te.generate(), [te.generate]), { eventHandlers: t, config: r } = Le(
9300
- () => fi(i),
9312
+ () => pi(i),
9301
9313
  [i]
9302
9314
  );
9303
- return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(hi, { "ctx-name": e, ...r }), /* @__PURE__ */ I.createElement(
9304
- ui,
9315
+ return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name": e, ...r }), /* @__PURE__ */ I.createElement(
9316
+ di,
9305
9317
  {
9306
9318
  ref: s,
9307
9319
  "ctx-name": e,