@orangelogic/design-system 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/library/chunks/{asset-link-format.C5Ue4EGP.js → asset-link-format.DTLA2CFh.js} +407 -388
  2. package/library/chunks/{button.DbAUlIXG.js → button.cbDkxJHn.js} +1 -1
  3. package/library/chunks/{color-swatch-group.B10yWbVM.js → color-swatch-group.CZSeCrot.js} +7 -7
  4. package/library/chunks/{confirm-popover.Cd4HM5-B.js → confirm-popover.Dvgoz-oA.js} +3 -3
  5. package/library/chunks/{dialog.CXphbq8N.js → dialog.BvSMV36r.js} +2 -2
  6. package/library/chunks/{document-viewer.B_ESlazf.js → document-viewer.BLdEjbza.js} +7 -7
  7. package/library/chunks/{dot-pagination.CzT-MZmt.js → dot-pagination.CukHxNBk.js} +1 -1
  8. package/library/chunks/{folder-select.BWeanVkA.js → folder-select.DAZQRdLq.js} +4 -4
  9. package/library/chunks/{header.Dy57RuQW.js → header.2RH_nPmz.js} +1 -1
  10. package/library/chunks/{i18n.Q5_2aVLU.js → i18n.BSPmBQ73.js} +1 -0
  11. package/library/chunks/{icon-button.BjAbCuH8.js → icon-button.DV5Fks8j.js} +1 -1
  12. package/library/chunks/{iframe.CdktjPCB.js → iframe.ddX2kGu3.js} +1 -1
  13. package/library/chunks/{image.CCo__54F.js → image.BM7bPTub.js} +174 -143
  14. package/library/chunks/{index.DiZGZkHv.js → index.DKKvxBAi.js} +70 -66
  15. package/library/chunks/{input.ftEf4GS6.js → input.7pumTpdu.js} +1 -1
  16. package/library/chunks/{markdown.RljldBNb.js → markdown.LHSzm035.js} +2 -2
  17. package/library/chunks/{menu-item.BNs1Ji48.js → menu-item.CqPvDGeN.js} +1 -1
  18. package/library/chunks/{option.C8IEnv5Q.js → option.dBUWN4sF.js} +1 -1
  19. package/library/chunks/{pagination.Bke9vgl4.js → pagination.C2f8lUVb.js} +5 -5
  20. package/library/chunks/{resizable-component.styles.CAfXABBc.js → resizable-component.styles.kMFDlGgv.js} +2 -2
  21. package/library/chunks/{tab-group.DZ32f41G.js → tab-group.DOnaT12G.js} +4 -4
  22. package/library/chunks/{tree.Umn7TAkc.js → tree.CHQ1WjZV.js} +1 -1
  23. package/library/chunks/{types.BW36Gr9c.js → types.PdpKNndx.js} +2519 -2411
  24. package/library/components/alert.js +2 -2
  25. package/library/components/asset-link-format.js +3 -3
  26. package/library/components/atoms.js +15 -15
  27. package/library/components/audio.js +3 -3
  28. package/library/components/border-input-group.js +2 -2
  29. package/library/components/breadcrumb.js +1 -1
  30. package/library/components/button.js +2 -2
  31. package/library/components/color-picker.js +6 -6
  32. package/library/components/color-swatch-group.js +2 -2
  33. package/library/components/color-swatch.js +1 -1
  34. package/library/components/confirm-popover.js +4 -4
  35. package/library/components/copy-button.js +1 -1
  36. package/library/components/corner-position-input-group.js +3 -3
  37. package/library/components/date-calendar.js +1 -1
  38. package/library/components/details.js +1 -1
  39. package/library/components/dialog.js +3 -3
  40. package/library/components/document-viewer.js +4 -4
  41. package/library/components/dot-pagination.js +2 -2
  42. package/library/components/drawer.js +2 -2
  43. package/library/components/dropdown.js +2 -2
  44. package/library/components/dynamic-select.js +4 -4
  45. package/library/components/e-chart.js +1 -1
  46. package/library/components/element-clamp.js +2 -2
  47. package/library/components/file-on-demand.js +9 -9
  48. package/library/components/folder-select.js +4 -4
  49. package/library/components/format-bytes.js +1 -1
  50. package/library/components/format-date.js +1 -1
  51. package/library/components/format-number.js +1 -1
  52. package/library/components/format-time.js +1 -1
  53. package/library/components/header.js +2 -2
  54. package/library/components/icon-button.js +2 -2
  55. package/library/components/iframe.js +2 -2
  56. package/library/components/image-comparer.js +1 -1
  57. package/library/components/image.js +3 -3
  58. package/library/components/input.js +2 -2
  59. package/library/components/line-clamp.js +1 -1
  60. package/library/components/markdown.js +3 -3
  61. package/library/components/masonry.js +2 -2
  62. package/library/components/menu-item.js +2 -2
  63. package/library/components/menu.js +2 -2
  64. package/library/components/molecules.js +2 -2
  65. package/library/components/option.js +2 -2
  66. package/library/components/organisms.js +2 -2
  67. package/library/components/padding-input-group.js +1 -1
  68. package/library/components/pagination.js +6 -6
  69. package/library/components/popup.js +1 -1
  70. package/library/components/position-picker.js +1 -1
  71. package/library/components/progress-bar.js +1 -1
  72. package/library/components/progress-ring.js +1 -1
  73. package/library/components/range.js +1 -1
  74. package/library/components/rating.js +1 -1
  75. package/library/components/relative-time.js +1 -1
  76. package/library/components/select.js +2 -2
  77. package/library/components/shadow-input-group.js +1 -1
  78. package/library/components/share-option-list.js +1 -1
  79. package/library/components/sidebar.js +1 -1
  80. package/library/components/size-input-group.js +3 -3
  81. package/library/components/spinner.js +1 -1
  82. package/library/components/split-panel.js +1 -1
  83. package/library/components/tab-group.js +5 -5
  84. package/library/components/tab.js +2 -2
  85. package/library/components/tag.js +2 -2
  86. package/library/components/tooltip.js +1 -1
  87. package/library/components/tree-item.js +2 -2
  88. package/library/components/tree.js +2 -2
  89. package/library/components/typeface.js +2 -2
  90. package/library/components/types.js +21 -21
  91. package/library/components/video.js +1341 -1294
  92. package/library/package.json +1 -1
  93. package/library/packages/atoms/src/components/image/image.d.ts +16 -0
  94. package/library/packages/atoms/src/components/video/video.d.ts +6 -0
  95. package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +2 -0
  96. package/library/packages/molecules/src/icon-picker/icon-picker.d.ts +5 -6
  97. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +6 -0
  98. package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +5 -1
  99. package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +10 -3
  100. package/library/packages/organisms/src/content-builder/configs/header.d.ts +1 -1
  101. package/library/packages/organisms/src/content-builder/configs/image.d.ts +2 -0
  102. package/library/packages/organisms/src/content-builder/configs-controller.d.ts +13 -0
  103. package/library/packages/organisms/src/content-builder/styleController.d.ts +2 -0
  104. package/library/packages/organisms/src/form/control-renderer/control-renderer.d.ts +6 -0
  105. package/library/packages/types/src/content-builder.d.ts +6 -2
  106. package/library/packages/utils/src/custom-element/i18n.d.ts +1 -0
  107. package/library/react-web-component.d.ts +4 -0
  108. package/library/utils.js +1 -1
  109. package/package.json +1 -1
@@ -1,69 +1,69 @@
1
- import { r as $e, R as Re, H as K, a as ie, b as je } from "./resizable-component.styles.CAfXABBc.js";
1
+ import { r as $e, R as je, H as K, a as ie, b as oe } from "./resizable-component.styles.kMFDlGgv.js";
2
2
  import { c as He } from "./component.styles.CAS3c9pM.js";
3
- import { a as oe } from "./index.Cpamj0jB.js";
4
- import { P as Te } from "./position-picker.qkbJlboF.js";
5
- import { c as Ae } from "./custom-element.L4WJXn1j.js";
3
+ import { a as re } from "./index.Cpamj0jB.js";
4
+ import { P as Ae } from "./position-picker.qkbJlboF.js";
5
+ import { c as Te } from "./custom-element.L4WJXn1j.js";
6
6
  import { d as Oe } from "./debounce.DaHuiSGU.js";
7
- import { L as Ze } from "./i18n.Q5_2aVLU.js";
7
+ import { L as Ze } from "./i18n.BSPmBQ73.js";
8
8
  import { w as M } from "./watch.DJF5K-8U.js";
9
9
  import { a as Ie } from "./url.CGdWC06g.js";
10
- import { i as le, E as X, x as L } from "./lit-element.jLBm65_O.js";
10
+ import { i as he, E as X, x as R } from "./lit-element.jLBm65_O.js";
11
11
  import { n as p } from "./lib-cortex-element.CVMmyPMC.js";
12
12
  import { r as E } from "./state.CSDxrqLd.js";
13
13
  import { e as G } from "./query.BBf1UFkC.js";
14
- import { e as S } from "./class-map.BiVq-cVR.js";
15
- import { o as $ } from "./if-defined.BRoBj_Rp.js";
14
+ import { e as L } from "./class-map.BiVq-cVR.js";
15
+ import { o as S } from "./if-defined.BRoBj_Rp.js";
16
16
  import { i as Me } from "./keyed.DdOUTIg-.js";
17
17
  import { o as Pe } from "./style-map.llVFPd__.js";
18
- import { n as T } from "./when.Dr1es41R.js";
18
+ import { n as A } from "./when.Dr1es41R.js";
19
19
  import { C as Fe } from "./icon.BLXWp6CU.js";
20
20
  import _e from "../components/popup.js";
21
21
  import Ne from "../components/resize-observer.js";
22
22
  import We from "../components/skeleton.js";
23
23
  import Be from "../components/space.js";
24
- var I = /* @__PURE__ */ ((i) => (i.Automatic = "automatic", i.Manual = "manual", i))(I || {});
24
+ var I = /* @__PURE__ */ ((e) => (e.Automatic = "automatic", e.Manual = "manual", e))(I || {});
25
25
  /*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */
26
- var R = Object.assign || function(i) {
27
- for (var t = 1; t < arguments.length; t++) {
28
- var o = arguments[t];
26
+ var $ = Object.assign || function(e) {
27
+ for (var i = 1; i < arguments.length; i++) {
28
+ var o = arguments[i];
29
29
  for (var h in o)
30
- Object.prototype.hasOwnProperty.call(o, h) && (i[h] = o[h]);
31
- }
32
- return i;
33
- }, W = function(t) {
34
- return t.tagName === "IMG";
35
- }, Ue = function(t) {
36
- return NodeList.prototype.isPrototypeOf(t);
37
- }, B = function(t) {
38
- return t && t.nodeType === 1;
39
- }, re = function(t) {
40
- var o = t.currentSrc || t.src;
30
+ Object.prototype.hasOwnProperty.call(o, h) && (e[h] = o[h]);
31
+ }
32
+ return e;
33
+ }, W = function(i) {
34
+ return i.tagName === "IMG";
35
+ }, Ue = function(i) {
36
+ return NodeList.prototype.isPrototypeOf(i);
37
+ }, B = function(i) {
38
+ return i && i.nodeType === 1;
39
+ }, ae = function(i) {
40
+ var o = i.currentSrc || i.src;
41
41
  return o.substr(-4).toLowerCase() === ".svg";
42
- }, ne = function(t) {
42
+ }, ne = function(i) {
43
43
  try {
44
- return Array.isArray(t) ? t.filter(W) : Ue(t) ? [].slice.call(t).filter(W) : B(t) ? [t].filter(W) : typeof t == "string" ? [].slice.call(document.querySelectorAll(t)).filter(W) : [];
44
+ return Array.isArray(i) ? i.filter(W) : Ue(i) ? [].slice.call(i).filter(W) : B(i) ? [i].filter(W) : typeof i == "string" ? [].slice.call(document.querySelectorAll(i)).filter(W) : [];
45
45
  } catch {
46
46
  throw new TypeError(`The provided selector is invalid.
47
47
  Expects a CSS selector, a Node element, a NodeList or an array.
48
48
  See: https://github.com/francoischalifour/medium-zoom`);
49
49
  }
50
- }, De = function(t) {
50
+ }, De = function(i) {
51
51
  var o = document.createElement("div");
52
- return o.classList.add("medium-zoom-overlay"), o.style.background = t, o;
53
- }, qe = function(t) {
54
- var o = t.getBoundingClientRect(), h = o.top, d = o.left, C = o.width, k = o.height, z = t.cloneNode(), U = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, P = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
52
+ return o.classList.add("medium-zoom-overlay"), o.style.background = i, o;
53
+ }, qe = function(i) {
54
+ var o = i.getBoundingClientRect(), h = o.top, d = o.left, C = o.width, k = o.height, z = i.cloneNode(), U = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, P = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
55
55
  return z.removeAttribute("id"), z.style.position = "absolute", z.style.top = h + U + "px", z.style.left = d + P + "px", z.style.width = C + "px", z.style.height = k + "px", z.style.transform = "", z;
56
- }, A = function(t, o) {
57
- var h = R({
56
+ }, T = function(i, o) {
57
+ var h = $({
58
58
  bubbles: !1,
59
59
  cancelable: !1,
60
60
  detail: void 0
61
61
  }, o);
62
62
  if (typeof window.CustomEvent == "function")
63
- return new CustomEvent(t, h);
63
+ return new CustomEvent(i, h);
64
64
  var d = document.createEvent("CustomEvent");
65
- return d.initCustomEvent(t, h.bubbles, h.cancelable, h.detail), d;
66
- }, Ve = function i(t) {
65
+ return d.initCustomEvent(i, h.bubbles, h.cancelable, h.detail), d;
66
+ }, Ve = function e(i) {
67
67
  var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = window.Promise || function(r) {
68
68
  function n() {
69
69
  }
@@ -76,7 +76,7 @@ See: https://github.com/francoischalifour/medium-zoom`);
76
76
  }
77
77
  y.indexOf(n) !== -1 && Q({ target: n });
78
78
  }, C = function() {
79
- if (!(j || !e.original)) {
79
+ if (!(j || !t.original)) {
80
80
  var r = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
81
81
  Math.abs(ee - r) > c.scrollOffset && setTimeout(x, 150);
82
82
  }
@@ -85,18 +85,18 @@ See: https://github.com/francoischalifour/medium-zoom`);
85
85
  (n === "Escape" || n === "Esc" || n === 27) && x();
86
86
  }, z = function() {
87
87
  var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = r;
88
- if (r.background && (_.style.background = r.background), r.container && r.container instanceof Object && (n.container = R({}, c.container, r.container)), r.template) {
88
+ if (r.background && (_.style.background = r.background), r.container && r.container instanceof Object && (n.container = $({}, c.container, r.container)), r.template) {
89
89
  var m = B(r.template) ? r.template : document.querySelector(r.template);
90
90
  n.template = m;
91
91
  }
92
- return c = R({}, c, n), y.forEach(function(g) {
93
- g.dispatchEvent(A("medium-zoom:update", {
92
+ return c = $({}, c, n), y.forEach(function(g) {
93
+ g.dispatchEvent(T("medium-zoom:update", {
94
94
  detail: { zoom: u }
95
95
  }));
96
96
  }), u;
97
97
  }, U = function() {
98
98
  var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
99
- return i(R({}, c, r));
99
+ return e($({}, c, r));
100
100
  }, P = function() {
101
101
  for (var r = arguments.length, n = Array(r), m = 0; m < r; m++)
102
102
  n[m] = arguments[m];
@@ -113,26 +113,26 @@ See: https://github.com/francoischalifour/medium-zoom`);
113
113
  w.addEventListener(v, b, H);
114
114
  });
115
115
  }), u;
116
- }, de = function() {
116
+ }, me = function() {
117
117
  for (var r = arguments.length, n = Array(r), m = 0; m < r; m++)
118
118
  n[m] = arguments[m];
119
- e.zoomed && x();
119
+ t.zoomed && x();
120
120
  var g = n.length > 0 ? n.reduce(function(s, v) {
121
121
  return [].concat(s, ne(v));
122
122
  }, []) : y;
123
123
  return g.forEach(function(s) {
124
- s.classList.remove("medium-zoom-image"), s.dispatchEvent(A("medium-zoom:detach", {
124
+ s.classList.remove("medium-zoom-image"), s.dispatchEvent(T("medium-zoom:detach", {
125
125
  detail: { zoom: u }
126
126
  }));
127
127
  }), y = y.filter(function(s) {
128
128
  return g.indexOf(s) === -1;
129
129
  }), u;
130
- }, me = function(r, n) {
130
+ }, ge = function(r, n) {
131
131
  var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
132
132
  return y.forEach(function(g) {
133
133
  g.addEventListener("medium-zoom:" + r, n, m);
134
134
  }), F.push({ type: "medium-zoom:" + r, listener: n, options: m }), u;
135
- }, ge = function(r, n) {
135
+ }, ue = function(r, n) {
136
136
  var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
137
137
  return y.forEach(function(g) {
138
138
  g.removeEventListener("medium-zoom:" + r, n, m);
@@ -151,19 +151,19 @@ See: https://github.com/francoischalifour/medium-zoom`);
151
151
  }, v = void 0, b = void 0;
152
152
  if (c.container)
153
153
  if (c.container instanceof Object)
154
- s = R({}, s, c.container), v = s.width - s.left - s.right - c.margin * 2, b = s.height - s.top - s.bottom - c.margin * 2;
154
+ s = $({}, s, c.container), v = s.width - s.left - s.right - c.margin * 2, b = s.height - s.top - s.bottom - c.margin * 2;
155
155
  else {
156
- var H = B(c.container) ? c.container : document.querySelector(c.container), w = H.getBoundingClientRect(), D = w.width, ve = w.height, ye = w.left, be = w.top;
157
- s = R({}, s, {
156
+ var H = B(c.container) ? c.container : document.querySelector(c.container), w = H.getBoundingClientRect(), D = w.width, ye = w.height, be = w.left, ze = w.top;
157
+ s = $({}, s, {
158
158
  width: D,
159
- height: ve,
160
- left: ye,
161
- top: be
159
+ height: ye,
160
+ left: be,
161
+ top: ze
162
162
  });
163
163
  }
164
164
  v = v || s.width - c.margin * 2, b = b || s.height - c.margin * 2;
165
- var Z = e.zoomedHd || e.original, ze = re(Z) ? v : Z.naturalWidth || v, xe = re(Z) ? b : Z.naturalHeight || b, N = Z.getBoundingClientRect(), we = N.top, Ee = N.left, q = N.width, V = N.height, Ce = Math.min(Math.max(q, ze), v) / q, ke = Math.min(Math.max(V, xe), b) / V, Y = Math.min(Ce, ke), Le = (-Ee + (v - q) / 2 + c.margin + s.left) / Y, Se = (-we + (b - V) / 2 + c.margin + s.top) / Y, te = "scale(" + Y + ") translate3d(" + Le + "px, " + Se + "px, 0)";
166
- e.zoomed.style.transform = te, e.zoomedHd && (e.zoomedHd.style.transform = te);
165
+ var Z = t.zoomedHd || t.original, xe = ae(Z) ? v : Z.naturalWidth || v, we = ae(Z) ? b : Z.naturalHeight || b, N = Z.getBoundingClientRect(), Ee = N.top, Ce = N.left, q = N.width, V = N.height, ke = Math.min(Math.max(q, xe), v) / q, Re = Math.min(Math.max(V, we), b) / V, Y = Math.min(ke, Re), Le = (-Ce + (v - q) / 2 + c.margin + s.left) / Y, Se = (-Ee + (b - V) / 2 + c.margin + s.top) / Y, te = "scale(" + Y + ") translate3d(" + Le + "px, " + Se + "px, 0)";
166
+ t.zoomed.style.transform = te, t.zoomedHd && (t.zoomedHd.style.transform = te);
167
167
  };
168
168
  return new h(function(g) {
169
169
  if (n && y.indexOf(n) === -1) {
@@ -171,78 +171,78 @@ See: https://github.com/francoischalifour/medium-zoom`);
171
171
  return;
172
172
  }
173
173
  var s = function D() {
174
- j = !1, e.zoomed.removeEventListener("transitionend", D), e.original.dispatchEvent(A("medium-zoom:opened", {
174
+ j = !1, t.zoomed.removeEventListener("transitionend", D), t.original.dispatchEvent(T("medium-zoom:opened", {
175
175
  detail: { zoom: u }
176
176
  })), g(u);
177
177
  };
178
- if (e.zoomed) {
178
+ if (t.zoomed) {
179
179
  g(u);
180
180
  return;
181
181
  }
182
182
  if (n)
183
- e.original = n;
183
+ t.original = n;
184
184
  else if (y.length > 0) {
185
185
  var v = y;
186
- e.original = v[0];
186
+ t.original = v[0];
187
187
  } else {
188
188
  g(u);
189
189
  return;
190
190
  }
191
- if (e.original.dispatchEvent(A("medium-zoom:open", {
191
+ if (t.original.dispatchEvent(T("medium-zoom:open", {
192
192
  detail: { zoom: u }
193
- })), ee = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, j = !0, e.zoomed = qe(e.original), document.body.appendChild(_), c.template) {
193
+ })), ee = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, j = !0, t.zoomed = qe(t.original), document.body.appendChild(_), c.template) {
194
194
  var b = B(c.template) ? c.template : document.querySelector(c.template);
195
- e.template = document.createElement("div"), e.template.appendChild(b.content.cloneNode(!0)), document.body.appendChild(e.template);
195
+ t.template = document.createElement("div"), t.template.appendChild(b.content.cloneNode(!0)), document.body.appendChild(t.template);
196
196
  }
197
- if (e.original.parentElement && e.original.parentElement.tagName === "PICTURE" && e.original.currentSrc && (e.zoomed.src = e.original.currentSrc), document.body.appendChild(e.zoomed), window.requestAnimationFrame(function() {
197
+ if (t.original.parentElement && t.original.parentElement.tagName === "PICTURE" && t.original.currentSrc && (t.zoomed.src = t.original.currentSrc), document.body.appendChild(t.zoomed), window.requestAnimationFrame(function() {
198
198
  document.body.classList.add("medium-zoom--opened");
199
- }), e.original.classList.add("medium-zoom-image--hidden"), e.zoomed.classList.add("medium-zoom-image--opened"), e.zoomed.addEventListener("click", x), e.zoomed.addEventListener("transitionend", s), e.original.getAttribute("data-zoom-src")) {
200
- e.zoomedHd = e.zoomed.cloneNode(), e.zoomedHd.removeAttribute("srcset"), e.zoomedHd.removeAttribute("sizes"), e.zoomedHd.removeAttribute("loading"), e.zoomedHd.src = e.zoomed.getAttribute("data-zoom-src"), e.zoomedHd.onerror = function() {
201
- clearInterval(H), console.warn("Unable to reach the zoom image target " + e.zoomedHd.src), e.zoomedHd = null, m();
199
+ }), t.original.classList.add("medium-zoom-image--hidden"), t.zoomed.classList.add("medium-zoom-image--opened"), t.zoomed.addEventListener("click", x), t.zoomed.addEventListener("transitionend", s), t.original.getAttribute("data-zoom-src")) {
200
+ t.zoomedHd = t.zoomed.cloneNode(), t.zoomedHd.removeAttribute("srcset"), t.zoomedHd.removeAttribute("sizes"), t.zoomedHd.removeAttribute("loading"), t.zoomedHd.src = t.zoomed.getAttribute("data-zoom-src"), t.zoomedHd.onerror = function() {
201
+ clearInterval(H), console.warn("Unable to reach the zoom image target " + t.zoomedHd.src), t.zoomedHd = null, m();
202
202
  };
203
203
  var H = setInterval(function() {
204
- e.zoomedHd.complete && (clearInterval(H), e.zoomedHd.classList.add("medium-zoom-image--opened"), e.zoomedHd.addEventListener("click", x), document.body.appendChild(e.zoomedHd), m());
204
+ t.zoomedHd.complete && (clearInterval(H), t.zoomedHd.classList.add("medium-zoom-image--opened"), t.zoomedHd.addEventListener("click", x), document.body.appendChild(t.zoomedHd), m());
205
205
  }, 10);
206
- } else if (e.original.hasAttribute("srcset")) {
207
- e.zoomedHd = e.zoomed.cloneNode(), e.zoomedHd.removeAttribute("sizes"), e.zoomedHd.removeAttribute("loading");
208
- var w = e.zoomedHd.addEventListener("load", function() {
209
- e.zoomedHd.removeEventListener("load", w), e.zoomedHd.classList.add("medium-zoom-image--opened"), e.zoomedHd.addEventListener("click", x), document.body.appendChild(e.zoomedHd), m();
206
+ } else if (t.original.hasAttribute("srcset")) {
207
+ t.zoomedHd = t.zoomed.cloneNode(), t.zoomedHd.removeAttribute("sizes"), t.zoomedHd.removeAttribute("loading");
208
+ var w = t.zoomedHd.addEventListener("load", function() {
209
+ t.zoomedHd.removeEventListener("load", w), t.zoomedHd.classList.add("medium-zoom-image--opened"), t.zoomedHd.addEventListener("click", x), document.body.appendChild(t.zoomedHd), m();
210
210
  });
211
211
  } else
212
212
  m();
213
213
  });
214
214
  }, x = function() {
215
215
  return new h(function(r) {
216
- if (j || !e.original) {
216
+ if (j || !t.original) {
217
217
  r(u);
218
218
  return;
219
219
  }
220
220
  var n = function m() {
221
- e.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(e.zoomed), e.zoomedHd && document.body.removeChild(e.zoomedHd), document.body.removeChild(_), e.zoomed.classList.remove("medium-zoom-image--opened"), e.template && document.body.removeChild(e.template), j = !1, e.zoomed.removeEventListener("transitionend", m), e.original.dispatchEvent(A("medium-zoom:closed", {
221
+ t.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(t.zoomed), t.zoomedHd && document.body.removeChild(t.zoomedHd), document.body.removeChild(_), t.zoomed.classList.remove("medium-zoom-image--opened"), t.template && document.body.removeChild(t.template), j = !1, t.zoomed.removeEventListener("transitionend", m), t.original.dispatchEvent(T("medium-zoom:closed", {
222
222
  detail: { zoom: u }
223
- })), e.original = null, e.zoomed = null, e.zoomedHd = null, e.template = null, r(u);
223
+ })), t.original = null, t.zoomed = null, t.zoomedHd = null, t.template = null, r(u);
224
224
  };
225
- j = !0, document.body.classList.remove("medium-zoom--opened"), e.zoomed.style.transform = "", e.zoomedHd && (e.zoomedHd.style.transform = ""), e.template && (e.template.style.transition = "opacity 150ms", e.template.style.opacity = 0), e.original.dispatchEvent(A("medium-zoom:close", {
225
+ j = !0, document.body.classList.remove("medium-zoom--opened"), t.zoomed.style.transform = "", t.zoomedHd && (t.zoomedHd.style.transform = ""), t.template && (t.template.style.transition = "opacity 150ms", t.template.style.opacity = 0), t.original.dispatchEvent(T("medium-zoom:close", {
226
226
  detail: { zoom: u }
227
- })), e.zoomed.addEventListener("transitionend", n);
227
+ })), t.zoomed.addEventListener("transitionend", n);
228
228
  });
229
229
  }, Q = function() {
230
230
  var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = r.target;
231
- return e.original ? x() : J({ target: n });
232
- }, ue = function() {
233
- return c;
231
+ return t.original ? x() : J({ target: n });
234
232
  }, pe = function() {
235
- return y;
233
+ return c;
236
234
  }, fe = function() {
237
- return e.original;
238
- }, y = [], F = [], j = !1, ee = 0, c = o, e = {
235
+ return y;
236
+ }, ve = function() {
237
+ return t.original;
238
+ }, y = [], F = [], j = !1, ee = 0, c = o, t = {
239
239
  original: null,
240
240
  zoomed: null,
241
241
  zoomedHd: null,
242
242
  template: null
243
243
  // If the selector is omitted, it's replaced by the options
244
244
  };
245
- Object.prototype.toString.call(t) === "[object Object]" ? c = t : (t || typeof t == "string") && P(t), c = R({
245
+ Object.prototype.toString.call(i) === "[object Object]" ? c = i : (i || typeof i == "string") && P(i), c = $({
246
246
  margin: 0,
247
247
  background: "#fff",
248
248
  scrollOffset: 40,
@@ -258,26 +258,26 @@ See: https://github.com/francoischalifour/medium-zoom`);
258
258
  update: z,
259
259
  clone: U,
260
260
  attach: P,
261
- detach: de,
262
- on: me,
263
- off: ge,
264
- getOptions: ue,
265
- getImages: pe,
266
- getZoomedImage: fe
261
+ detach: me,
262
+ on: ge,
263
+ off: ue,
264
+ getOptions: pe,
265
+ getImages: fe,
266
+ getZoomedImage: ve
267
267
  };
268
268
  return u;
269
269
  };
270
- function Ye(i, t) {
271
- t === void 0 && (t = {});
272
- var o = t.insertAt;
270
+ function Ye(e, i) {
271
+ i === void 0 && (i = {});
272
+ var o = i.insertAt;
273
273
  if (!(typeof document > "u")) {
274
274
  var h = document.head || document.getElementsByTagName("head")[0], d = document.createElement("style");
275
- d.type = "text/css", o === "top" && h.firstChild ? h.insertBefore(d, h.firstChild) : h.appendChild(d), d.styleSheet ? d.styleSheet.cssText = i : d.appendChild(document.createTextNode(i));
275
+ d.type = "text/css", o === "top" && h.firstChild ? h.insertBefore(d, h.firstChild) : h.appendChild(d), d.styleSheet ? d.styleSheet.cssText = e : d.appendChild(document.createTextNode(e));
276
276
  }
277
277
  }
278
278
  var Ke = ".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";
279
279
  Ye(Ke);
280
- const Xe = le`:host([effect=jump]) .container,:host([effect=text-reveal]) .container,:host([effect=zoom]) .container{overflow:initial}:host([effect=jump]) .highlighter{transition:all var(--transition-duration,.5s) var(--easing,linear), transform var(--transition-transform-duration,.5s) var(--easing,linear)}:host([effect=jump]) .highlighter:hover{transform:translateY(calc(var(--highlightable-item-effect-jump-distance,0) * -1))}:host([effect=zoom][zoom-style=pop-out]){overflow-clip-margin:var(--column-padding,10px);overflow:clip}.highlighter--effect-text-reveal,:host([effect=zoom]) .highlighter--zoom-style-within-borders{overflow:hidden}:host([effect=zoom][zoom-style=pop-out]) .highlighter:hover{z-index:3;animation:none}:host([effect=zoom][zoom-style=pop-out]) .highlighter:not(:hover){animation:drop-z var(--transition-transform-duration) forwards}@keyframes drop-z{0%{z-index:2}99%{z-index:2}to{z-index:0}}.highlighter--can-hover:hover:after,.highlighter--selected:after,.highlighter--color-overlay:after{content:"";pointer-events:none;width:100%;height:100%;transition:all var(--transition-duration,.5s) var(--easing,linear);position:absolute;top:0;left:0}.highlighter--can-hover:hover:after,.highlighter--selected:after{outline:2px solid var(--cx-color-primary)}.highlighter--border:hover .image{border-color:var(--highlightable-item-highlight-border-color,var(--cx-color-primary))}.highlighter--color-overlay:after{border-radius:var(--border-radius,none)}.highlighter--color-overlay:hover:after{background-color:var(--highlightable-item-highlight-color-overlay-color,transparent)}.highlighter--drop-shadow:hover .image{box-shadow:var(--highlightable-item-highlight-drop-shadow,none)}.highlighter--background:hover .highlightable-item{--content-background-color:var(--highlightable-item-highlight-background,transparent);--highlightable-item-background-color:var(--highlightable-item-highlight-background,transparent)}.highlighter--opacity{opacity:var(--highlightable-item-highlight-opacity,1)}:host([effect=zoom][zoom-style=within-borders]) .highlighter .image,:host([effect=zoom][zoom-style=pop-out]) .highlighter{transition:transform var(--transition-transform-duration,.5s) var(--easing,linear)}:host([effect=zoom][zoom-style=within-borders]) .highlighter:hover .image,:host([effect=zoom][zoom-style=pop-out]) .highlighter:hover{transform:scale(var(--highlightable-item-effect-zoom-scale,1))}.highlightable-item{transition:background-color var(--transition-duration,.5s) var(--easing,linear), border-color var(--transition-duration,.5s) var(--easing,linear), box-shadow var(--transition-duration,.5s) var(--easing,linear), opacity var(--transition-duration,.5s) var(--easing,linear), transform var(--transition-transform-duration,.5s) var(--easing,linear), visibility var(--transition-duration,.5s) var(--easing,linear)}`, Ge = le`
280
+ const Xe = he`:host([effect=jump]) .container,:host([effect=text-reveal]) .container,:host([effect=zoom]) .container{overflow:initial}:host([effect=jump]) .highlighter{transition:all var(--transition-duration,.5s) var(--easing,linear), transform var(--transition-transform-duration,.5s) var(--easing,linear)}:host([effect=jump]) .highlighter:hover{transform:translateY(calc(var(--highlightable-item-effect-jump-distance,0) * -1))}:host([effect=zoom][zoom-style=pop-out]){overflow-clip-margin:var(--column-padding,10px);overflow:clip}.highlighter--effect-text-reveal,:host([effect=zoom]) .highlighter--zoom-style-within-borders{overflow:hidden}:host([effect=zoom][zoom-style=pop-out]) .highlighter:hover{z-index:3;animation:none}:host([effect=zoom][zoom-style=pop-out]) .highlighter:not(:hover){animation:drop-z var(--transition-transform-duration) forwards}@keyframes drop-z{0%{z-index:2}99%{z-index:2}to{z-index:0}}.highlighter--can-hover:hover:after,.highlighter--selected:after,.highlighter--color-overlay:after{content:"";pointer-events:none;width:100%;height:100%;transition:all var(--transition-duration,.5s) var(--easing,linear);position:absolute;top:0;left:0}.highlighter--can-hover:hover:after,.highlighter--selected:after{outline:2px solid var(--cx-color-primary)}.highlighter--border:hover .image{border-color:var(--highlightable-item-highlight-border-color,var(--cx-color-primary))}.highlighter--color-overlay:after{border-radius:var(--border-radius,none)}.highlighter--color-overlay:hover:after{background-color:var(--highlightable-item-highlight-color-overlay-color,transparent)}.highlighter--drop-shadow:hover .image{box-shadow:var(--highlightable-item-highlight-drop-shadow,none)}.highlighter--background:hover .highlightable-item{--content-background-color:var(--highlightable-item-highlight-background,transparent);--highlightable-item-background-color:var(--highlightable-item-highlight-background,transparent)}.highlighter--opacity{opacity:var(--highlightable-item-highlight-opacity,1)}:host([effect=zoom][zoom-style=within-borders]) .highlighter .image,:host([effect=zoom][zoom-style=pop-out]) .highlighter{transition:transform var(--transition-transform-duration,.5s) var(--easing,linear)}:host([effect=zoom][zoom-style=within-borders]) .highlighter:hover .image,:host([effect=zoom][zoom-style=pop-out]) .highlighter:hover{transform:scale(var(--highlightable-item-effect-zoom-scale,1))}.highlightable-item{transition:background-color var(--transition-duration,.5s) var(--easing,linear), border-color var(--transition-duration,.5s) var(--easing,linear), box-shadow var(--transition-duration,.5s) var(--easing,linear), opacity var(--transition-duration,.5s) var(--easing,linear), transform var(--transition-transform-duration,.5s) var(--easing,linear), visibility var(--transition-duration,.5s) var(--easing,linear)}`, Ge = he`
281
281
  :host {
282
282
  --justify-content: flex-start;
283
283
  --border-radius: 0px;
@@ -405,6 +405,19 @@ const Xe = le`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
405
405
  outline: none;
406
406
  }
407
407
 
408
+ .highlighter--loading-ratio {
409
+ aspect-ratio: var(--image-loading-aspect-ratio);
410
+ height: auto;
411
+ min-height: 0;
412
+ }
413
+
414
+ /* Jump/Zoom put the image in the popup's anchor slot; its host is display: contents. */
415
+ .highlighter--loading-ratio > .highlightable-item,
416
+ .highlighter--loading-ratio > .popup-container > .highlightable-item[slot='anchor'] {
417
+ position: absolute;
418
+ inset: 0;
419
+ }
420
+
408
421
  .highlighter--centered {
409
422
  display: flex;
410
423
  justify-content: center;
@@ -622,16 +635,16 @@ const Xe = le`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
622
635
  color: var(--fallback-icon-color);
623
636
  }
624
637
  `;
625
- var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, he = (i) => {
626
- throw TypeError(i);
627
- }, l = (i, t, o, h) => {
628
- for (var d = h > 1 ? void 0 : h ? Qe(t, o) : t, C = i.length - 1, k; C >= 0; C--)
629
- (k = i[C]) && (d = (h ? k(t, o, d) : k(d)) || d);
630
- return h && d && Je(t, o, d), d;
631
- }, ce = (i, t, o) => t.has(i) || he("Cannot " + o), ae = (i, t, o) => (ce(i, t, "read from private field"), o ? o.call(i) : t.get(i)), et = (i, t, o) => t.has(i) ? he("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, o), se = (i, t, o, h) => (ce(i, t, "write to private field"), t.set(i, o), o), O;
632
- let a = class extends Re {
638
+ var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, ce = (e) => {
639
+ throw TypeError(e);
640
+ }, l = (e, i, o, h) => {
641
+ for (var d = h > 1 ? void 0 : h ? Qe(i, o) : i, C = e.length - 1, k; C >= 0; C--)
642
+ (k = e[C]) && (d = (h ? k(i, o, d) : k(d)) || d);
643
+ return h && d && Je(i, o, d), d;
644
+ }, de = (e, i, o) => i.has(e) || ce("Cannot " + o), se = (e, i, o) => (de(e, i, "read from private field"), o ? o.call(e) : i.get(e)), et = (e, i, o) => i.has(e) ? ce("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, o), le = (e, i, o, h) => (de(e, i, "write to private field"), i.set(e, o), o), O;
645
+ let a = class extends je {
633
646
  constructor() {
634
- super(...arguments), this.localize = new Ze(this), this.retryCount = 0, this.retryTimer = null, this.isLoaded = !1, this.isError = !1, this.isRetrying = !1, this.retryIndex = 0, this.src = "", this.srcset = "", this.sizes = "", this.placeholder = "", this.alt = "", this.objectFit = oe.Fill, this.cropFocus = Te.CenterCenter, this.skeleton = !1, this.fallback = !1, this.canZoom = !1, this.loading = !1, this.block = !1, this.htmlLoading = "lazy", this.noCrossorigin = !1, this.clickHandlerType = I.Automatic, this.retryOnError = !1, this.maxRetries = 10, this.isZoomed = !1, this.imageRatio = 1, this.parsedAlt = "", this.parsedAltDarkMode = "", this.zoom = null, this.lastPatchedWidth = null, et(this, O, "");
647
+ super(...arguments), this.localize = new Ze(this), this.retryCount = 0, this.retryTimer = null, this.isLoaded = !1, this.isError = !1, this.isRetrying = !1, this.retryIndex = 0, this.src = "", this.aspectRatio = 0, this.srcset = "", this.sizes = "", this.placeholder = "", this.alt = "", this.objectFit = re.Fill, this.cropFocus = Ae.CenterCenter, this.skeleton = !1, this.fallback = !1, this.canZoom = !1, this.loading = !1, this.block = !1, this.htmlLoading = "lazy", this.noCrossorigin = !1, this.clickHandlerType = I.Automatic, this.retryOnError = !1, this.maxRetries = 10, this.isZoomed = !1, this.imageRatio = 1, this.parsedAlt = "", this.parsedAltDarkMode = "", this.zoom = null, this.lastPatchedWidth = null, et(this, O, "");
635
648
  }
636
649
  get currentAltValue() {
637
650
  return this.alt;
@@ -651,7 +664,7 @@ let a = class extends Re {
651
664
  * the focal point must instead be applied by aligning the `<img>` within this flex parent.
652
665
  */
653
666
  get highlighterCropFocusClass() {
654
- return this.objectFit === oe.Contain ? { [`highlightable-item--crop-focus-${this.cropFocus}`]: !0 } : {};
667
+ return this.objectFit === re.Contain ? { [`highlightable-item--crop-focus-${this.cropFocus}`]: !0 } : {};
655
668
  }
656
669
  get highlighterClass() {
657
670
  return {
@@ -661,13 +674,26 @@ let a = class extends Re {
661
674
  ...this.highlighterCropFocusClass
662
675
  };
663
676
  }
677
+ get currentAspectRatio() {
678
+ return this.aspectRatio;
679
+ }
680
+ get loadingAspectRatio() {
681
+ const e = this.currentAspectRatio;
682
+ return this.heightMode === ie.Auto && !this.isLoaded && !this.isEmpty && Number.isFinite(e) && e > 0 ? e : void 0;
683
+ }
684
+ getHighlighterClass(e = !1) {
685
+ return {
686
+ ...super.getHighlighterClass(e),
687
+ "highlighter--loading-ratio": this.loadingAspectRatio !== void 0
688
+ };
689
+ }
664
690
  get imageClass() {
665
- let i = "landscape", t = this.ratio;
691
+ let e = "landscape", i = this.ratio;
666
692
  const o = this.width.endsWith("%") ? this.clientWidth : Number.parseFloat(this.width), h = this.isResizing ? this.resizeSize.width : o, d = this.isResizing ? this.resizeSize.height : Number.parseFloat(this.height);
667
- return h && d && (t = h / d), t > this.imageRatio && (i = "portrait"), {
693
+ return h && d && (i = h / d), i > this.imageRatio && (e = "portrait"), {
668
694
  image: !0,
669
695
  [`image--${this.objectFit}`]: !0,
670
- [`image--${i}`]: !0,
696
+ [`image--${e}`]: !0,
671
697
  [`image--height-${this.heightMode}`]: !0,
672
698
  [`image--crop-focus-${this.cropFocus}`]: !0,
673
699
  "image--can-zoom": this.canZoom,
@@ -727,8 +753,8 @@ let a = class extends Re {
727
753
  handleBlur() {
728
754
  this.isZoomed && this.zoom?.close();
729
755
  }
730
- handleKeyDown(i) {
731
- i.target === this.highlighterElement && (i.key === "Enter" || i.key === " ") && (i.preventDefault(), this.highlighterElement.click());
756
+ handleKeyDown(e) {
757
+ e.target === this.highlighterElement && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.highlighterElement.click());
732
758
  }
733
759
  async handleCanZoomChange() {
734
760
  await this.updateComplete, this.hasZoomAction ? this.initZoom() : (this.zoom?.detach(), this.zoom = null);
@@ -737,20 +763,20 @@ let a = class extends Re {
737
763
  await this.updateComplete, this.requestUpdate();
738
764
  }
739
765
  handleSrcChange() {
740
- this.isLoaded = !1, this.isError = !1, this.isRetrying = !1, this.retryCount = 0, this.retryIndex = 0, se(this, O, ""), this.clearRetryTimer();
766
+ this.isLoaded = !1, this.isError = !1, this.isRetrying = !1, this.retryCount = 0, this.retryIndex = 0, le(this, O, ""), this.clearRetryTimer();
741
767
  }
742
768
  clearRetryTimer() {
743
769
  this.retryTimer !== null && (clearTimeout(this.retryTimer), this.retryTimer = null);
744
770
  }
745
771
  scheduleRetry() {
746
- const i = Math.min(1e3 * Math.pow(2, this.retryCount - 1), 1e4);
772
+ const e = Math.min(1e3 * Math.pow(2, this.retryCount - 1), 1e4);
747
773
  this.retryTimer = setTimeout(() => {
748
- this.retryTimer = null, se(this, O, `${this.retryCount}-${Math.random().toString(36).slice(2)}`), this.retryIndex += 1;
749
- }, i);
774
+ this.retryTimer = null, le(this, O, `${this.retryCount}-${Math.random().toString(36).slice(2)}`), this.retryIndex += 1;
775
+ }, e);
750
776
  }
751
777
  /** Appends the retry cache-bust param to `src` while a retry attempt is in flight, so a CDN edge caching a corrupted/truncated response is bypassed in favor of a fresh origin fetch. */
752
- applyRetryCacheBust(i) {
753
- return this.retryIndex === 0 || !ae(this, O) || !i ? i : Ie(i, "cachebust", ae(this, O));
778
+ applyRetryCacheBust(e) {
779
+ return this.retryIndex === 0 || !se(this, O) || !e ? e : Ie(e, "cachebust", se(this, O));
754
780
  }
755
781
  async initZoom() {
756
782
  this.zoomImageElement && !this.zoom && this.isLoaded && (this.zoom = Ve(this.zoomImageElement, {
@@ -763,11 +789,11 @@ let a = class extends Re {
763
789
  this.emit("cx-image-zoom-close"), this.isZoomed = !1;
764
790
  }));
765
791
  }
766
- handleLoad(i) {
767
- const t = i?.currentTarget ?? this.imageElement;
768
- if (!t)
792
+ handleLoad(e) {
793
+ const i = e?.currentTarget ?? this.imageElement;
794
+ if (!i)
769
795
  return;
770
- const { naturalHeight: o, naturalWidth: h } = t;
796
+ const { naturalHeight: o, naturalWidth: h } = i;
771
797
  this.imageRatio = h / o, this.clearRetryTimer(), this.retryCount = 0, this.isRetrying = !1, this.isLoaded || this.emit("cx-load"), this.isLoaded = !0, this.isError = !1;
772
798
  }
773
799
  handleError() {
@@ -778,68 +804,70 @@ let a = class extends Re {
778
804
  this.isRetrying = !1, this.emit("cx-error"), this.isLoaded = !0, this.isError = !0;
779
805
  }
780
806
  handleSizeChange() {
781
- const i = this.resizeDirection !== ie.Vertical, t = this.resizeDirection !== ie.Horizontal, o = this.isResizing ? `${this.resizeSize.width}px` : this.width, h = this.isResizing ? `${this.resizeSize.height}px` : this.height;
782
- i && (this.width || this.isResizing ? this.style.setProperty("--width", o) : this.style.removeProperty("--width")), t && (this.heightMode !== je.Auto && (this.height || this.isResizing) ? this.style.setProperty("--height", h) : this.style.removeProperty("--height"));
807
+ const e = this.resizeDirection !== oe.Vertical, i = this.resizeDirection !== oe.Horizontal, o = this.isResizing ? `${this.resizeSize.width}px` : this.width, h = this.isResizing ? `${this.resizeSize.height}px` : this.height;
808
+ e && (this.width || this.isResizing ? this.style.setProperty("--width", o) : this.style.removeProperty("--width")), i && (this.heightMode !== ie.Auto && (this.height || this.isResizing) ? this.style.setProperty("--height", h) : this.style.removeProperty("--height"));
783
809
  }
784
- handleResize(i) {
785
- const { entries: t } = i.detail;
786
- for (const o of t)
810
+ handleResize(e) {
811
+ const { entries: i } = e.detail;
812
+ for (const o of i)
787
813
  o.target === this.highlighterElement && this.width.endsWith("%") && !this.isResizing && Math.abs(o.contentRect.width - (this.lastPatchedWidth ?? 0)) > 1 && this.updateLastPatchedWidth(o.contentRect.width);
788
814
  }
789
- updateLastPatchedWidth(i) {
790
- this.lastPatchedWidth = i, this.requestUpdate();
815
+ updateLastPatchedWidth(e) {
816
+ this.lastPatchedWidth = e, this.requestUpdate();
791
817
  }
792
818
  /**
793
819
  * Support CMS5 click action for the image.
794
820
  */
795
- handleClickAction(i) {
796
- !(i.target instanceof HTMLElement) || this.clickHandlerType === I.Manual || this.canZoom && this.openZoom();
821
+ handleClickAction(e) {
822
+ !(e.target instanceof HTMLElement) || this.clickHandlerType === I.Manual || this.canZoom && this.openZoom();
797
823
  }
798
- updated(i) {
799
- super.updated(i), (i.has("width") || i.has("height") || i.has("heightMode") || i.has("resizeSize")) && this.handleSizeChange();
824
+ updated(e) {
825
+ super.updated(e);
826
+ const i = this.loadingAspectRatio;
827
+ i !== void 0 ? this.style.setProperty("--image-loading-aspect-ratio", String(i)) : this.style.removeProperty("--image-loading-aspect-ratio"), (e.has("width") || e.has("height") || e.has("heightMode") || e.has("resizeSize")) && this.handleSizeChange();
800
828
  }
801
829
  openZoom() {
802
830
  this.zoom && this.zoom.open();
803
831
  }
804
832
  renderContent() {
805
- const i = this.applyRetryCacheBust(this.currentSrc), t = this.currentAltValue;
833
+ const e = this.applyRetryCacheBust(this.currentSrc), i = this.currentAltValue;
806
834
  if (this.retryOnError) {
807
835
  if (this.isError && this.retryCount >= this.maxRetries)
808
836
  return X;
809
837
  } else if (this.isError)
810
838
  return X;
811
- return L`<div part="content" slot="anchor" class=${S(this.highlighterClass)}>${Me(
839
+ return R`<div part="content" slot="anchor" class=${L(this.highlighterClass)}>${Me(
812
840
  this.retryIndex,
813
- L`<img part="image" class=${S(this.imageClass)} src=${i || this.placeholder} srcset=${$(this.srcset || void 0)} sizes=${$(this.sizes || void 0)} alt=${t} aria-label=${t} crossorigin=${$(this.crossorigin)} @load=${this.handleLoad} @error=${this.handleError} loading=${this.retryIndex > 0 ? "eager" : this.htmlLoading} decoding="async" width=${$(this.width || void 0)} height=${$(this.height || void 0)}>`
841
+ R`<img part="image" class=${L(this.imageClass)} src=${e || this.placeholder} srcset=${S(this.srcset || void 0)} sizes=${S(this.sizes || void 0)} alt=${i} aria-label=${i} crossorigin=${S(this.crossorigin)} @load=${this.handleLoad} @error=${this.handleError} loading=${this.retryIndex > 0 ? "eager" : this.htmlLoading} decoding="async" width=${S(this.width || void 0)} height=${S(this.height || void 0)}>`
814
842
  )}</div>`;
815
843
  }
816
844
  render() {
817
- const i = this.hasZoomAction, t = this.currentAltValue;
818
- return L`<div part="base" class=${S({
845
+ const e = this.hasZoomAction, i = this.currentAltValue;
846
+ return R`<div part="base" class=${L({
819
847
  container: !0,
820
848
  "container--empty": this.isEmpty,
821
849
  "container--loading": this.loading,
822
850
  "container--resizing": this.resizable && this.isResizeActive
823
851
  })} style=${Pe({
824
852
  "--easing": this.easeCSSVariable
825
- })} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${$(this.highlighterTabindex)} role=${this.highlighterRole} aria-label=${t} aria-roledescription=${this.localize.term("image")} class=${S(this.isEmpty ? {} : this.getHighlighterClass(this.isError))} @click=${this.handleClickAction} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave} @blur=${this.handleBlur}>${T(
853
+ })} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${S(this.highlighterTabindex)} role=${this.highlighterRole} aria-label=${i} aria-roledescription=${this.localize.term("image")} class=${L(this.isEmpty ? {} : this.getHighlighterClass(this.isError))} @click=${this.handleClickAction} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave} @blur=${this.handleBlur}>${A(
826
854
  this.isEmpty,
827
855
  () => X,
828
- () => T(
856
+ () => A(
829
857
  this.effect === K.Jump || this.effect === K.Zoom,
830
- () => L`<cx-popup class="popup-container" strategy="absolute" active placement="center" sync="both">${this.renderContent()}</cx-popup>`,
858
+ () => R`<cx-popup class="popup-container" strategy="absolute" active placement="center" sync="both">${this.renderContent()}</cx-popup>`,
831
859
  () => this.renderContent()
832
860
  )
833
- )}<div class="zoom-image-container">${T(
834
- i,
835
- () => L`<img part="zoom-image" class=${S({
861
+ )}<div class="zoom-image-container">${A(
862
+ e,
863
+ () => R`<img part="zoom-image" class=${L({
836
864
  "zoom-image": !0,
837
865
  "zoom-image--hidden": !this.isZoomed
838
- })} src=${this.applyRetryCacheBust(this.currentSrc) || this.placeholder} alt="" aria-hidden="true" decoding="async" draggable="false" crossorigin=${$(this.crossorigin)}>`
839
- )}</div>${T(this.showPlaceholderSkeleton, () => L`<slot name="skeleton" part="skeleton"><div class=${S({
866
+ })} src=${this.applyRetryCacheBust(this.currentSrc) || this.placeholder} alt="" aria-hidden="true" decoding="async" draggable="false" crossorigin=${S(this.crossorigin)}>`
867
+ )}</div>${A(this.showPlaceholderSkeleton, () => R`<slot name="skeleton" part="skeleton"><div class=${L({
840
868
  skeleton: !0
841
869
  })}><cx-skeleton effect="none" role="status" aria-live="polite" aria-label=${this.localize.term("loading")}></cx-skeleton></div></slot>`)}
842
- ${T(this.isError, () => L`<slot name="fallback" part="fallback"><cx-space class=${S({ fallback: !0 })} direction="column" align-items="center" justify-content="center"><cx-icon name="hide_image" part="fallback-icon"> </cx-icon></cx-space></slot>`)}</div></cx-resize-observer>${T(this.resizable && this.isResizeActive, () => this.renderResizer())}</div>`;
870
+ ${A(this.isError, () => R`<slot name="fallback" part="fallback"><cx-space class=${L({ fallback: !0 })} direction="column" align-items="center" justify-content="center"><cx-icon name="hide_image" part="fallback-icon"> </cx-icon></cx-space></slot>`)}</div></cx-resize-observer>${A(this.resizable && this.isResizeActive, () => this.renderResizer())}</div>`;
843
871
  }
844
872
  };
845
873
  O = /* @__PURE__ */ new WeakMap();
@@ -875,6 +903,9 @@ l([
875
903
  l([
876
904
  p({ reflect: !0, type: String })
877
905
  ], a.prototype, "src", 2);
906
+ l([
907
+ p({ attribute: "aspect-ratio", reflect: !0, type: Number })
908
+ ], a.prototype, "aspectRatio", 2);
878
909
  l([
879
910
  p({ reflect: !0, type: String })
880
911
  ], a.prototype, "srcset", 2);
@@ -950,7 +981,7 @@ l([
950
981
  Oe(100)
951
982
  ], a.prototype, "updateLastPatchedWidth", 1);
952
983
  a = l([
953
- Ae("cx-image")
984
+ Te("cx-image")
954
985
  ], a);
955
986
  export {
956
987
  a as C,