ablok-components 0.3.23 → 0.3.24

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.
@@ -803,16 +803,18 @@ function Fx(t, e, n, A = "image/png", r) {
803
803
  return s ? (s.drawImage(t, 0, 0, e, n), i.toDataURL(A, r)) : t.src;
804
804
  }
805
805
  async function N2(t, e, n) {
806
- const A = await Tf(t), r = await H2(A), i = r.naturalWidth, s = r.naturalHeight;
807
- if (!i || i <= e) return t;
808
- const o = Math.round(e), a = s / i, u = Math.round(o * a), c = Fx(
809
- r,
810
- o,
806
+ const A = (t.type || "").toLowerCase();
807
+ if (!(A.startsWith("image/") && A !== "image/svg+xml")) return t;
808
+ const i = await Tf(t), s = await H2(i), o = s.naturalWidth, a = s.naturalHeight;
809
+ if (!o || o <= e) return t;
810
+ const u = Math.round(e), c = a / o, f = Math.round(u * c), h = Fx(
811
+ s,
811
812
  u,
813
+ f,
812
814
  t.type || "image/png",
813
815
  n
814
816
  );
815
- return await Sx(c, t.name, t.type || "image/png");
817
+ return await Sx(h, t.name, t.type || "image/png");
816
818
  }
817
819
  function Qx(t) {
818
820
  return !t || typeof t != "string" ? "" : t.replace(/\0/g, "").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/on\w+\s*=\s*["'][^"']*["']/gi, "").replace(/on\w+\s*=\s*[^\s>]*/gi, "").replace(/javascript:/gi, "").replace(/data:text\/html/gi, "");