@orangelogic/design-system 4.56.0 → 4.58.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 (108) hide show
  1. package/library/chunks/{array-line-clamp.sxTWf9Iz.js → array-line-clamp.9myPWg1y.js} +2 -2
  2. package/library/chunks/{asset-link-format.b1PRwN5q.js → asset-link-format.zO0t0oA3.js} +237 -208
  3. package/library/chunks/{bicolor-picker.BEs23Gs0.js → bicolor-picker.DZY5PP24.js} +1 -1
  4. package/library/chunks/{block-width.C-Etq9nn.js → block-width.Dbc3rT3Y.js} +50 -50
  5. package/library/chunks/{border-input-group.dw1516Kf.js → border-input-group.BymzNWba.js} +1 -1
  6. package/library/chunks/{browser.Ct4pHP9I.js → browser.gIznFIix.js} +4 -1
  7. package/library/chunks/{color-picker.D38VZ1JB.js → color-picker.Ch5-Ylm8.js} +4 -4
  8. package/library/chunks/{color-swatch-group.D4cJJmvA.js → color-swatch-group.Bcw5aIqG.js} +404 -401
  9. package/library/chunks/{color-swatch.PNkiDQx5.js → color-swatch.DZG975M_.js} +2 -2
  10. package/library/chunks/{config-manager.DncPuD4f.js → config-manager.BfkCA0F3.js} +21 -21
  11. package/library/chunks/{configs-controller.0FoXQnJn.js → configs-controller.uTcM4iX4.js} +11 -11
  12. package/library/chunks/{confirm-popover.BHKVBESN.js → confirm-popover.DUrgLQjC.js} +2 -2
  13. package/library/chunks/{copy-button.CQO3gEFh.js → copy-button.CqqKJEh3.js} +1 -1
  14. package/library/chunks/{corner-position-input-group.BzYJD8zG.js → corner-position-input-group.mrOiz-0k.js} +1 -1
  15. package/library/chunks/{cropper.BRsN8h2t.js → cropper.CNmQt-sa.js} +10 -12
  16. package/library/chunks/{dialog.QENKQ3wO.js → dialog.BcCTa8Bd.js} +1 -1
  17. package/library/chunks/{document-viewer.CSSI__TI.js → document-viewer.Ch5h5Wte.js} +7 -7
  18. package/library/chunks/{dot-pagination.8huF7K9E.js → dot-pagination.C1C6NG8d.js} +1 -1
  19. package/library/chunks/{dropdown.BTQ07f9L.js → dropdown.DDQXJMth.js} +2 -2
  20. package/library/chunks/{dynamic-select.BEKv0lpx.js → dynamic-select.Dwcz7UjN.js} +1 -1
  21. package/library/chunks/{file-on-demand.DNVrOUTH.js → file-on-demand.BmRBmyyq.js} +8 -8
  22. package/library/chunks/{folder-select.B16qEGcG.js → folder-select.Buoz3ioX.js} +4 -4
  23. package/library/chunks/{header.B11-tX9H.js → header.CowQINf-.js} +1 -1
  24. package/library/chunks/{image.alhsAc_i.js → image.-lgb634-.js} +1 -1
  25. package/library/chunks/{line-clamp.BYoTFCvo.js → line-clamp.SD3U021K.js} +2 -2
  26. package/library/chunks/{masonry.B8EOiLu0.js → masonry.BxNeClR6.js} +2 -2
  27. package/library/chunks/{menu-item.Z7pkEEyC.js → menu-item.CtFgeM0H.js} +1 -1
  28. package/library/chunks/{menu.Dlt4EsSJ.js → menu.BEVPnl3Y.js} +1 -1
  29. package/library/chunks/{pagination.ATa3enAG.js → pagination.DULLxssA.js} +2 -2
  30. package/library/chunks/{popup.LaRE0W3Q.js → popup.w4ZU3jI-.js} +4 -4
  31. package/library/chunks/{radio-card.BVkRnAT5.js → radio-card.BWutKj6E.js} +1 -1
  32. package/library/chunks/{range.BWrWIE6S.js → range.ObEMbygm.js} +1 -1
  33. package/library/chunks/{select.DJSXKV7u.js → select.S9rnkI_b.js} +3 -3
  34. package/library/chunks/{shadow-input-group.B_06ZQpb.js → shadow-input-group.B_W5gJ4u.js} +1 -1
  35. package/library/chunks/{share-option-list.BetSdhgh.js → share-option-list.DOaEypfQ.js} +1 -1
  36. package/library/chunks/{size-input-group.VZ4Yt8qW.js → size-input-group.DUyTc5na.js} +2 -2
  37. package/library/chunks/{src.DiLNsEca.js → src.D0Zj6Eo1.js} +26 -26
  38. package/library/chunks/{src.CgqvT9Zj.js → src.Dia365C9.js} +82 -82
  39. package/library/chunks/{step.CA3PQN8l.js → step.DoO31jfk.js} +2 -2
  40. package/library/chunks/{stepper-wizard.B72l6S-I.js → stepper-wizard.DgrCTDtq.js} +2 -2
  41. package/library/chunks/{stepper.DgoOS-k1.js → stepper.BhpFjenM.js} +1 -1
  42. package/library/chunks/{tab-group.DhX_Aowk.js → tab-group.kyiPblS9.js} +4 -4
  43. package/library/chunks/{tab.vGimW19a.js → tab.Cv-UuYM5.js} +1 -1
  44. package/library/chunks/{tag.Dr7Na8Kf.js → tag.Cq8m5pRP.js} +1 -1
  45. package/library/chunks/{tooltip.BpXJhnhh.js → tooltip.Cc02vm6M.js} +1 -1
  46. package/library/chunks/{tree.BEdI81wd.js → tree.XYIP-Ujw.js} +2 -2
  47. package/library/chunks/{typeface.CDjUSIt9.js → typeface.eo-n8r2R.js} +1 -1
  48. package/library/chunks/{video.Dbzi5Pxz.js → video.B0vHXehv.js} +3 -3
  49. package/library/components/array-line-clamp.js +1 -1
  50. package/library/components/asset-link-format.js +1 -1
  51. package/library/components/atoms.js +29 -29
  52. package/library/components/bicolor-picker.js +1 -1
  53. package/library/components/border-input-group.js +1 -1
  54. package/library/components/color-picker.js +1 -1
  55. package/library/components/color-swatch-group.js +1 -1
  56. package/library/components/color-swatch.js +1 -1
  57. package/library/components/confirm-popover.js +1 -1
  58. package/library/components/copy-button.js +1 -1
  59. package/library/components/corner-position-input-group.js +1 -1
  60. package/library/components/cropper.js +1 -1
  61. package/library/components/dialog.js +1 -1
  62. package/library/components/document-viewer.js +1 -1
  63. package/library/components/dot-pagination.js +1 -1
  64. package/library/components/dropdown.js +1 -1
  65. package/library/components/dynamic-select.js +1 -1
  66. package/library/components/file-on-demand.js +1 -1
  67. package/library/components/folder-select.js +1 -1
  68. package/library/components/header.js +1 -1
  69. package/library/components/image.js +1 -1
  70. package/library/components/line-clamp.js +1 -1
  71. package/library/components/masonry.js +1 -1
  72. package/library/components/menu-item.js +1 -1
  73. package/library/components/menu.js +1 -1
  74. package/library/components/molecules.js +14 -14
  75. package/library/components/organisms.js +3 -3
  76. package/library/components/pagination.js +1 -1
  77. package/library/components/popup.js +1 -1
  78. package/library/components/radio-card.js +1 -1
  79. package/library/components/range.js +1 -1
  80. package/library/components/select.js +1 -1
  81. package/library/components/shadow-input-group.js +1 -1
  82. package/library/components/share-option-list.js +1 -1
  83. package/library/components/size-input-group.js +1 -1
  84. package/library/components/step.js +1 -1
  85. package/library/components/stepper-wizard.js +1 -1
  86. package/library/components/stepper.js +1 -1
  87. package/library/components/tab-group.js +1 -1
  88. package/library/components/tab.js +1 -1
  89. package/library/components/tag.js +1 -1
  90. package/library/components/tooltip.js +1 -1
  91. package/library/components/tree-item.js +1 -1
  92. package/library/components/tree.js +1 -1
  93. package/library/components/typeface.js +1 -1
  94. package/library/components/types.js +13812 -13812
  95. package/library/components/video.js +1 -1
  96. package/library/package.json +1 -1
  97. package/library/packages/hybrid/video-advanced/src/react/components/VideoEditor/VideoEditor.d.ts +1 -0
  98. package/library/packages/hybrid/video-advanced/src/react/plugins/Crop/Crop.d.ts +2 -0
  99. package/library/packages/hybrid/video-advanced/src/react/utils/browser.d.ts +1 -0
  100. package/library/packages/molecules/src/cropper/react/ReactCrop/ReactCrop.d.ts +1 -1
  101. package/library/packages/molecules/src/multi-select/components/board/board.utils.d.ts +0 -7
  102. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +16 -1
  103. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-crop/asset-link-format-crop.d.ts +8 -0
  104. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-resize/asset-link-format-resize.d.ts +7 -0
  105. package/library/packages/utils/src/browser/browser.d.ts +1 -0
  106. package/library/packages/utils/src/video/video.d.ts +1 -0
  107. package/library/utils.js +28 -28
  108. package/package.json +1 -1
@@ -9,42 +9,43 @@ import { t as p } from "./icon-button.qJd_az6T.js";
9
9
  import { t as m } from "./when.BUskJLtZ.js";
10
10
  import { t as h } from "./icon.CeQpEaQz.js";
11
11
  import { t as g } from "./style-map.DPGQIxip.js";
12
+ import { c as ee } from "./browser.gIznFIix.js";
12
13
  import { t as _ } from "./button.BjijpxeK.js";
13
- import { g as ee } from "./string.9yahdkB8.js";
14
- import { t as te } from "./tooltip.BpXJhnhh.js";
14
+ import { g as te } from "./string.9yahdkB8.js";
15
+ import { t as ne } from "./tooltip.Cc02vm6M.js";
15
16
  import { n as v } from "./position-picker.dY_vgF_H.js";
16
- import { l as ne, r as y } from "./number.CNp5LKkv.js";
17
- import { t as re } from "./image.C0s1gL4z.js";
17
+ import { l as re, r as y } from "./number.CNp5LKkv.js";
18
+ import { t as ie } from "./image.C0s1gL4z.js";
18
19
  import { n as b, t as x } from "./typography.B0mkhqTB.js";
19
- import { t as ie } from "./button-group.CPfXrqyq.js";
20
- import { t as ae } from "./checkbox.BdSpQlwf.js";
20
+ import { t as ae } from "./button-group.CPfXrqyq.js";
21
+ import { t as oe } from "./checkbox.BdSpQlwf.js";
21
22
  import { t as S } from "./repeat.CKv9FPlC.js";
22
- import { t as oe } from "./input.kTjqEyC8.js";
23
+ import { t as se } from "./input.kTjqEyC8.js";
23
24
  import { t as C } from "./option.DWE0tark.js";
24
25
  import { t as w } from "./space.Dd8jezXK.js";
25
- import { t as T } from "./select.DJSXKV7u.js";
26
- import { t as se } from "./visually-hidden.Bv3SInZp.js";
27
- import { E as ce, T as le, b as ue, d as de, h as fe, p as pe, w as me, y as he } from "./src.CgqvT9Zj.js";
26
+ import { t as T } from "./select.S9rnkI_b.js";
27
+ import { t as ce } from "./visually-hidden.Bv3SInZp.js";
28
+ import { D as le, E as ue, T as de, b as fe, f as pe, g as me, m as he, x as ge } from "./src.Dia365C9.js";
28
29
  import { t as E } from "./details.DSgp6VAD.js";
29
- import { t as ge } from "./divider.CqSNZCU8.js";
30
- import { a as D, c as O, l as k, n as _e, o as A, r as j, s as M, t as N } from "./asset-link-format.COPyGdND.js";
31
- import { t as ve } from "./menu-label.B-FOyfAX.js";
32
- import { t as ye } from "./switch.BM9msK5T.js";
33
- import { t as be } from "./v4.JyXW8GUB.js";
34
- import "./cropper.BRsN8h2t.js";
35
- import { t as xe } from "./_baseUniq.h_pGICPH.js";
36
- import { d as Se, i as Ce, n as we, o as Te, p as P, r as Ee, s as De, t as Oe } from "./string-array.Dstcqyjm.js";
37
- import { t as ke } from "./position-picker.X2hhfGx7.js";
30
+ import { t as _e } from "./divider.CqSNZCU8.js";
31
+ import { a as D, c as O, l as k, n as ve, o as A, r as j, s as M, t as N } from "./asset-link-format.COPyGdND.js";
32
+ import { t as ye } from "./menu-label.B-FOyfAX.js";
33
+ import { t as be } from "./switch.BM9msK5T.js";
34
+ import { t as xe } from "./v4.JyXW8GUB.js";
35
+ import "./cropper.CNmQt-sa.js";
36
+ import { t as Se } from "./_baseUniq.h_pGICPH.js";
37
+ import { d as Ce, i as we, n as Te, o as Ee, p as P, r as De, s as Oe, t as ke } from "./string-array.Dstcqyjm.js";
38
+ import { t as Ae } from "./position-picker.X2hhfGx7.js";
38
39
  //#region ../../node_modules/lodash-es/uniq.js
39
- function Ae(e) {
40
- return e && e.length ? xe(e) : [];
40
+ function je(e) {
41
+ return e && e.length ? Se(e) : [];
41
42
  }
42
43
  //#endregion
43
44
  //#region ../../packages/services/src/api/asset/asset.utils.ts
44
- function je(e) {
45
+ function Me(e) {
45
46
  return typeof e == "object" && !!e && "URI" in e;
46
47
  }
47
- var Me = {
48
+ var Ne = {
48
49
  artist: "Artist",
49
50
  color: "Color",
50
51
  createDate: "CreateDate",
@@ -66,34 +67,34 @@ var Me = {
66
67
  systemIdentifier: "SystemIdentifier",
67
68
  text: "Text",
68
69
  title: "Title"
69
- }, Ne = /* @__PURE__ */ new Set([
70
+ }, Pe = /* @__PURE__ */ new Set([
70
71
  "mediaDate",
71
72
  "createDate",
72
73
  "editDate"
73
74
  ]);
74
- function Pe(e) {
75
+ function Fe(e) {
75
76
  return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(e) && !/^(?:OR|AND|NOT)$/.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
76
77
  }
77
- function Fe(e, t) {
78
- let n = (Array.isArray(t) ? t : [t]).map((t) => `${e}:${Pe(t)}`);
78
+ function Ie(e, t) {
79
+ let n = (Array.isArray(t) ? t : [t]).map((t) => `${e}:${Fe(t)}`);
79
80
  return n.length > 1 ? `(${n.join(" OR ")})` : n[0] ?? "";
80
81
  }
81
- function Ie(e, t) {
82
+ function Le(e, t) {
82
83
  return (Array.isArray(t) ? t : [t]).map((t) => `${e}${t.operator}${t.value}`).join(" AND ");
83
84
  }
84
- function Le(e) {
85
+ function Re(e) {
85
86
  let t = [];
86
87
  for (let n of Object.keys(e)) {
87
88
  let r = n, i = e[r];
88
89
  if (i == null) continue;
89
90
  if (r === "custom") {
90
- for (let [e, n] of Object.entries(i)) t.push(Fe(e, n));
91
+ for (let [e, n] of Object.entries(i)) t.push(Ie(e, n));
91
92
  continue;
92
93
  }
93
- let a = Me[r];
94
+ let a = Ne[r];
94
95
  if (a) {
95
- if (Ne.has(r)) {
96
- t.push(Ie(a, i));
96
+ if (Pe.has(r)) {
97
+ t.push(Le(a, i));
97
98
  continue;
98
99
  }
99
100
  if (r === "color") {
@@ -103,83 +104,83 @@ function Le(e) {
103
104
  if (r === "parentFolderIdentifier") {
104
105
  let e = Array.isArray(i) ? i : [i];
105
106
  if (e.length === 0) continue;
106
- let n = [...e.map((e) => `ParentFolderIdentifier:${Pe(String(e))}`), ...e.map((e) => `ParentAlbumIdentifier:${Pe(String(e))}`)];
107
+ let n = [...e.map((e) => `ParentFolderIdentifier:${Fe(String(e))}`), ...e.map((e) => `ParentAlbumIdentifier:${Fe(String(e))}`)];
107
108
  t.push(`(${n.join(" OR ")})`);
108
109
  continue;
109
110
  }
110
- t.push(Fe(a, i));
111
+ t.push(Ie(a, i));
111
112
  }
112
113
  }
113
114
  return t.join(" AND ");
114
115
  }
115
- function Re(e) {
116
- if ("and" in e) return e.and.map(Re).filter(Boolean).join(" AND ");
116
+ function ze(e) {
117
+ if ("and" in e) return e.and.map(ze).filter(Boolean).join(" AND ");
117
118
  if ("or" in e) {
118
- let t = e.or.map(Re).filter(Boolean);
119
+ let t = e.or.map(ze).filter(Boolean);
119
120
  return t.length > 1 ? `(${t.join(" OR ")})` : t[0] ?? "";
120
121
  }
121
122
  if ("not" in e) {
122
- let t = Re(e.not);
123
+ let t = ze(e.not);
123
124
  return t ? `NOT (${t})` : "";
124
125
  }
125
- return Le(e);
126
+ return Re(e);
126
127
  }
127
128
  //#endregion
128
129
  //#region ../../packages/services/src/api/asset/asset.ts
129
- var ze = "CoreField.LargeSizePreview", F = "CoreField.DocType", Be = "Document.Title", Ve = "Document.CaptionLong", I = "Document.FileExtension", He = "CoreField.FileSize", Ue = "CoreField.Identifier", We = "CoreField.MaxHeight", Ge = "CoreField.MaxWidth", L = "Document.RecordID", Ke = "CoreField.DocSubType", qe = "CoreField.TitleWithFallback", R = "CoreField.OriginalFileName", Je = "__width", Ye = "__height", Xe = "CoreField.OriginalPreview", Ze = "Document.DocSubType", Qe = "Document.InPoint", $e = "Document.OutPoint", et = {
130
+ var Be = "CoreField.LargeSizePreview", F = "CoreField.DocType", Ve = "Document.Title", He = "Document.CaptionLong", I = "Document.FileExtension", Ue = "CoreField.FileSize", We = "CoreField.Identifier", Ge = "CoreField.MaxHeight", Ke = "CoreField.MaxWidth", L = "Document.RecordID", qe = "CoreField.DocSubType", Je = "CoreField.TitleWithFallback", R = "CoreField.OriginalFileName", Ye = "__width", Xe = "__height", Ze = "CoreField.OriginalPreview", Qe = "Document.DocSubType", $e = "Document.InPoint", et = "Document.OutPoint", tt = {
130
131
  DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
131
132
  ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
132
- }, tt = {
133
- [ze]: et.DEFAULT_VIEW_SIZE,
134
- [Xe]: et.ORIGINAL_VIEW_SIZE
135
- }, nt = Object.fromEntries(Object.entries(tt).map(([e, t]) => [t, e]));
136
- function rt(e) {
137
- return tt[e] ?? e;
138
- }
133
+ }, nt = {
134
+ [Be]: tt.DEFAULT_VIEW_SIZE,
135
+ [Ze]: tt.ORIGINAL_VIEW_SIZE
136
+ }, rt = Object.fromEntries(Object.entries(nt).map(([e, t]) => [t, e]));
139
137
  function it(e) {
140
- return e === "CoreField.TitleWithFallback" ? [Be, R] : [rt(e)];
138
+ return nt[e] ?? e;
141
139
  }
142
140
  function at(e) {
141
+ return e === "CoreField.TitleWithFallback" ? [Ve, R] : [it(e)];
142
+ }
143
+ function ot(e) {
143
144
  let t = {};
144
145
  for (let [n, r] of Object.entries(e)) {
145
- let e = nt[n] ?? n;
146
+ let e = rt[n] ?? n;
146
147
  t[e] = r;
147
148
  }
148
149
  return t;
149
150
  }
150
- function ot(e, t, n) {
151
+ function st(e, t, n) {
151
152
  e[n] = z(t, n);
152
153
  let r = t[n];
153
- return r != null && je(r) && (typeof r.Width == "number" && r.Width > 0 && (e[`${n}${Je}`] = String(r.Width)), typeof r.Height == "number" && r.Height > 0 && (e[`${n}${Ye}`] = String(r.Height))), e;
154
+ return r != null && Me(r) && (typeof r.Width == "number" && r.Width > 0 && (e[`${n}${Ye}`] = String(r.Width)), typeof r.Height == "number" && r.Height > 0 && (e[`${n}${Xe}`] = String(r.Height))), e;
154
155
  }
155
- function st(e) {
156
+ function ct(e) {
156
157
  let t = new URLSearchParams();
157
158
  for (let [n, r] of Object.entries(e)) r != null && (Array.isArray(r) ? r.forEach((e) => t.append(n, String(e))) : t.append(n, String(r)));
158
159
  return t;
159
160
  }
160
- async function ct({ consistency: e, countPerPage: t, fields: n, getPermanentAssetsPaths: r, httpMethod: i = "GET", isSiteBuilder: a, pageNumber: o, query: s, securityByPassToken: c, siteUrl: l, sort: u, throwOnError: d, token: f, useSession: p }) {
161
- let m = n?.flatMap(it), h = n?.includes("CoreField.TitleWithFallback") ?? !1, g = (e) => {
162
- let t = at(e);
163
- return h && (t[qe] = z(t, "Document.Title") || z(t, "CoreField.OriginalFileName")), t;
164
- }, _ = {
161
+ async function lt({ consistency: e, countPerPage: t, fields: n, getPermanentAssetsPaths: r, httpMethod: i = "GET", isSiteBuilder: a, pageNumber: o, query: s, securityByPassToken: c, siteUrl: l, sort: u, throwOnError: d, token: f, useSession: p }) {
162
+ let m = n?.flatMap(at), h = n?.includes("CoreField.TitleWithFallback") ?? !1, g = (e) => {
163
+ let t = ot(e);
164
+ return h && (t[Je] = z(t, "Document.Title") || z(t, "CoreField.OriginalFileName")), t;
165
+ }, ee = {
165
166
  Consistency: e || void 0,
166
167
  CountPerPage: t,
167
- Fields: Ae(m),
168
+ Fields: je(m),
168
169
  Format: "json",
169
170
  GetPermanentAssetsPaths: r ?? void 0,
170
171
  PageNumber: o,
171
- Query: Re(s),
172
+ Query: ze(s),
172
173
  SecurityByPassToken: c || void 0,
173
174
  Sort: u || void 0,
174
175
  UseSession: p || void 0
175
- }, ee = i === "POST";
176
+ }, _ = i === "POST";
176
177
  try {
177
178
  return (await P.request({
178
179
  baseURL: l,
179
180
  headers: f ? { Authorization: `Bearer ${f}` } : void 0,
180
181
  method: i,
181
- ...ee ? { data: st(_) } : {
182
- params: _,
182
+ ..._ ? { data: ct(ee) } : {
183
+ params: ee,
183
184
  paramsSerializer: { indexes: null }
184
185
  },
185
186
  responseType: "json",
@@ -192,7 +193,7 @@ async function ct({ consistency: e, countPerPage: t, fields: n, getPermanentAsse
192
193
  sort: e.APIResponse?.GlobalInfo?.Sort ?? "",
193
194
  totalCount: e.APIResponse?.GlobalInfo?.TotalCount ?? 0
194
195
  })],
195
- url: a ? De.SEARCH_ASSETS : Se["4.0"]
196
+ url: a ? Oe.SEARCH_ASSETS : Ce["4.0"]
196
197
  })).data;
197
198
  } catch (e) {
198
199
  if (d) throw e;
@@ -203,7 +204,7 @@ async function ct({ consistency: e, countPerPage: t, fields: n, getPermanentAsse
203
204
  };
204
205
  }
205
206
  }
206
- async function lt({ assetId: e, extension: t, format: n, siteUrl: r, token: i, transformations: a, useSession: o }) {
207
+ async function ut({ assetId: e, extension: t, format: n, siteUrl: r, token: i, transformations: a, useSession: o }) {
207
208
  try {
208
209
  return (await P.request({
209
210
  baseURL: r,
@@ -211,25 +212,25 @@ async function lt({ assetId: e, extension: t, format: n, siteUrl: r, token: i, t
211
212
  params: {
212
213
  SourceAssetFormat: n,
213
214
  SourceAssetRecordID: e,
214
- TargetExtension: ee(t),
215
+ TargetExtension: te(t),
215
216
  Token: i || void 0,
216
217
  Transformations: a,
217
218
  UseSession: o || void 0
218
219
  },
219
220
  timeout: 3e5,
220
- url: Ee.GET_TRANSFORM_ASSET_LINK
221
+ url: De.GET_TRANSFORM_ASSET_LINK
221
222
  })).data;
222
223
  } catch {
223
224
  return null;
224
225
  }
225
226
  }
226
- var ut = 50;
227
- function dt(e, t) {
227
+ var dt = 50;
228
+ function ft(e, t) {
228
229
  let n = [];
229
230
  for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
230
231
  return n;
231
232
  }
232
- async function ft({ consistency: e, extraFields: t, getPermanentAssetsPaths: n, isSiteBuilder: r, recordIds: i, securityByPassToken: a, throwOnError: o, token: s }) {
233
+ async function pt({ consistency: e, extraFields: t, getPermanentAssetsPaths: n, isSiteBuilder: r, recordIds: i, securityByPassToken: a, throwOnError: o, token: s }) {
233
234
  if (!Array.isArray(i) || i.length === 0) return {
234
235
  facets: [],
235
236
  items: [],
@@ -238,10 +239,10 @@ async function ft({ consistency: e, extraFields: t, getPermanentAssetsPaths: n,
238
239
  let c = t?.filter((e) => e && typeof e == "string") ?? [], l = [
239
240
  ...c,
240
241
  R,
241
- Be,
242
242
  Ve,
243
+ He,
243
244
  L
244
- ], u = dt(i, ut), d = await Promise.all(u.map((t) => ct({
245
+ ], u = ft(i, dt), d = await Promise.all(u.map((t) => lt({
245
246
  consistency: e,
246
247
  countPerPage: t.length,
247
248
  fields: l,
@@ -259,16 +260,16 @@ async function ft({ consistency: e, extraFields: t, getPermanentAssetsPaths: n,
259
260
  items: d.flatMap((e) => e.items).map((e) => ({
260
261
  name: z(e, R),
261
262
  recordId: z(e, L),
262
- ...c.reduce((t, n) => ot(t, e, n), {})
263
+ ...c.reduce((t, n) => st(t, e, n), {})
263
264
  })).sort((e, t) => (f.get(e.recordId) ?? Infinity) - (f.get(t.recordId) ?? Infinity)),
264
265
  totalCount: d.reduce((e, t) => e + t.totalCount, 0)
265
266
  };
266
267
  }
267
268
  function z(e, t) {
268
269
  let n = e[t];
269
- return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) : je(n) ? n.URI : "";
270
+ return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) : Me(n) ? n.URI : "";
270
271
  }
271
- async function pt({ consistency: e, countPerPage: t, directParentFolderIdentifier: n, extraFields: r, getPermanentAssetsPaths: i, isSiteBuilder: a, limitedDocTypes: o, pageNumber: s, parentFolderIdentifier: c, searchTerm: l, securityByPassToken: u, sortOrder: d, throwOnError: f, token: p }) {
272
+ async function mt({ consistency: e, countPerPage: t, directParentFolderIdentifier: n, extraFields: r, getPermanentAssetsPaths: i, isSiteBuilder: a, limitedDocTypes: o, pageNumber: s, parentFolderIdentifier: c, searchTerm: l, securityByPassToken: u, sortOrder: d, throwOnError: f, token: p }) {
272
273
  if (!n && !c) return {
273
274
  facets: [],
274
275
  items: [],
@@ -279,16 +280,16 @@ async function pt({ consistency: e, countPerPage: t, directParentFolderIdentifie
279
280
  parentFolderIdentifier: c,
280
281
  ...l ? { text: l } : {},
281
282
  ...o && o.length > 0 ? { docType: o } : {}
282
- }, g = await ct({
283
+ }, g = await lt({
283
284
  consistency: e,
284
285
  countPerPage: t,
285
286
  fields: [
286
287
  ...m,
287
- qe,
288
- He,
289
- F,
290
- Ke,
288
+ Je,
291
289
  Ue,
290
+ F,
291
+ qe,
292
+ We,
292
293
  I,
293
294
  L,
294
295
  R
@@ -309,21 +310,21 @@ async function pt({ consistency: e, countPerPage: t, directParentFolderIdentifie
309
310
  t && !t.startsWith(".") && (t = "." + t);
310
311
  let n = z(e, L);
311
312
  return {
312
- docSubType: z(e, Ke),
313
+ docSubType: z(e, qe),
313
314
  docType: z(e, "CoreField.DocType") || "",
314
315
  extension: t,
315
316
  id: n,
316
- identifier: z(e, Ue),
317
+ identifier: z(e, We),
317
318
  name: z(e, R),
318
319
  recordId: n,
319
320
  size: z(e, "CoreField.FileSize") || "0 MB",
320
- ...m.reduce((t, n) => ot(t, e, n), {})
321
+ ...m.reduce((t, n) => st(t, e, n), {})
321
322
  };
322
323
  }),
323
324
  totalCount: g.totalCount
324
325
  };
325
326
  }
326
- async function mt({ autoCropMode: e, cropHeight: t, cropWidth: n, imageUrl: r, useSession: i }) {
327
+ async function ht({ autoCropMode: e, cropHeight: t, cropWidth: n, imageUrl: r, useSession: i }) {
327
328
  try {
328
329
  return (await P.request({
329
330
  method: "GET",
@@ -342,13 +343,13 @@ async function mt({ autoCropMode: e, cropHeight: t, cropWidth: n, imageUrl: r, u
342
343
  x: e.cropX,
343
344
  y: e.cropY
344
345
  })],
345
- url: Ee.GET_CROP_ZONE_SUGGESTION
346
+ url: De.GET_CROP_ZONE_SUGGESTION
346
347
  })).data;
347
348
  } catch {
348
349
  return null;
349
350
  }
350
351
  }
351
- async function ht({ assetRecordId: e, isSiteBuilder: t, siteUrl: n, token: r, useSession: i }) {
352
+ async function gt({ assetRecordId: e, isSiteBuilder: t, siteUrl: n, token: r, useSession: i }) {
352
353
  try {
353
354
  return (await P.request({
354
355
  baseURL: n,
@@ -370,13 +371,13 @@ async function ht({ assetRecordId: e, isSiteBuilder: t, siteUrl: n, token: r, us
370
371
  proxyName: e.proxyName,
371
372
  width: e.width
372
373
  })) ?? []],
373
- url: t ? De.GET_AVAILABLE_PROXIES : Te
374
+ url: t ? Oe.GET_AVAILABLE_PROXIES : Ee
374
375
  })).data;
375
376
  } catch {
376
377
  return [];
377
378
  }
378
379
  }
379
- async function gt({ siteUrl: e } = {}) {
380
+ async function _t({ siteUrl: e } = {}) {
380
381
  try {
381
382
  return (await P.request({
382
383
  baseURL: e,
@@ -388,13 +389,13 @@ async function gt({ siteUrl: e } = {}) {
388
389
  Multimedia: {},
389
390
  Video: {}
390
391
  } } : { formatsByDocType: e.formatsByDocType ?? {} }],
391
- url: we
392
+ url: Te
392
393
  })).data;
393
394
  } catch {
394
395
  return { formatsByDocType: {} };
395
396
  }
396
397
  }
397
- async function _t({ recordIds: e, rightsToCheck: t }) {
398
+ async function vt({ recordIds: e, rightsToCheck: t }) {
398
399
  let n = {
399
400
  authorizedObjects: [],
400
401
  forbiddenObjectsOfReadPermission: [],
@@ -410,7 +411,7 @@ async function _t({ recordIds: e, rightsToCheck: t }) {
410
411
  },
411
412
  paramsSerializer: { indexes: null },
412
413
  responseType: "json",
413
- url: Ce.GET_AUTHORIZED_OBJECTS
414
+ url: we.GET_AUTHORIZED_OBJECTS
414
415
  });
415
416
  return n;
416
417
  } catch {
@@ -419,7 +420,7 @@ async function _t({ recordIds: e, rightsToCheck: t }) {
419
420
  }
420
421
  //#endregion
421
422
  //#region ../../packages/tools/src/fetch-image/fetch-image.ts
422
- var vt = 20, B = "TR1", V = "TRX", yt = /* @__PURE__ */ new Set([".gif"]), bt = /* @__PURE__ */ new Set([
423
+ var yt = 20, B = "TR1", V = "TRX", bt = /* @__PURE__ */ new Set([".gif"]), xt = /* @__PURE__ */ new Set([
423
424
  ".avif",
424
425
  ".bmp",
425
426
  ".gif",
@@ -430,18 +431,18 @@ var vt = 20, B = "TR1", V = "TRX", yt = /* @__PURE__ */ new Set([".gif"]), bt =
430
431
  ".svg",
431
432
  ".webp"
432
433
  ]);
433
- function xt(e) {
434
+ function St(e) {
434
435
  let t = e.toLowerCase(), n = t.startsWith(".") ? t : `.${t}`;
435
- return bt.has(n);
436
+ return xt.has(n);
436
437
  }
437
- function St(e, t) {
438
- return e !== void 0 && e !== "" && e !== M.Image ? !1 : !t || xt(t);
438
+ function Ct(e, t) {
439
+ return e !== void 0 && e !== "" && e !== M.Image ? !1 : !t || St(t);
439
440
  }
440
- function Ct({ autoFormat: e, buildSrcset: t, docType: n, extension: r, format: i, item: a, manualFormat: o, size: s, useExpiringAssetUrls: c }) {
441
+ function wt({ autoFormat: e, buildSrcset: t, docType: n, extension: r, format: i, item: a, manualFormat: o, size: s, useExpiringAssetUrls: c }) {
441
442
  let l = r?.toLowerCase() ?? "", u = l.startsWith(".") ? l : `.${l}`, d = `path_${B}`, f = (n, r) => {
442
443
  let i = a[n];
443
444
  if (!i) return;
444
- let s = a[`${n}${Je}`], u = a[`${n}${Ye}`], d = e && !c ? de(i, [], {
445
+ let s = a[`${n}${Ye}`], u = a[`${n}${Xe}`], d = e && !c ? pe(i, [], {
445
446
  autoFormat: !o,
446
447
  extension: l,
447
448
  format: r
@@ -450,31 +451,31 @@ function Ct({ autoFormat: e, buildSrcset: t, docType: n, extension: r, format: i
450
451
  maxHeight: u,
451
452
  maxWidth: s,
452
453
  src: d,
453
- srcset: t && !c ? pe(d, {
454
+ srcset: t && !c ? he(d, {
454
455
  extension: l,
455
456
  format: r,
456
- maxWidth: ue(o, s)
457
+ maxWidth: ge(o, s)
457
458
  }) : ""
458
459
  };
459
460
  };
460
461
  if (c) {
461
- let e = le(a, St(n, l), l);
462
+ let e = ue(a, Ct(n, l), l);
462
463
  return e ? f(e) ?? {} : {};
463
464
  }
464
465
  if (!o) {
465
- let e = he(l, s);
466
+ let e = fe(l, s);
466
467
  return f(`path_${e}`, e) ?? f(d, B) ?? {};
467
468
  }
468
469
  let p = i ? `path_${i}` : void 0;
469
- return p && a[p] ? i !== V || St(n, l) ? f(p, i) ?? {} : f(d, B) ?? {} : l && yt.has(u) ? f(`path_${V}`, V) ?? f(d, B) ?? {} : f(d, B) ?? {};
470
+ return p && a[p] ? i !== V || Ct(n, l) ? f(p, i) ?? {} : f(d, B) ?? {} : l && bt.has(u) ? f(`path_${V}`, V) ?? f(d, B) ?? {} : f(d, B) ?? {};
470
471
  }
471
- var wt = class {
472
+ var Tt = class {
472
473
  constructor(e, t) {
473
- this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = Infinity, this.pageSize = vt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
474
+ this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = Infinity, this.pageSize = yt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
474
475
  let n = t?.maxEnd;
475
476
  this.maxEnd = typeof n == "number" && Number.isFinite(n) && n >= 0 ? Math.floor(n) : Infinity;
476
477
  let r = t?.pageSize;
477
- this.pageSize = typeof r == "number" && Number.isFinite(r) && r >= 1 ? Math.floor(r) : vt, this.authToken = t?.token, this.securityByPassToken = t?.securityByPassToken, this.isSiteBuilder = t?.isSiteBuilder ?? !1, this.autoFormat = t?.autoFormat ?? !1, this.buildSrcset = t?.buildSrcset ?? !1, this.consistency = t?.consistency;
478
+ this.pageSize = typeof r == "number" && Number.isFinite(r) && r >= 1 ? Math.floor(r) : yt, this.authToken = t?.token, this.securityByPassToken = t?.securityByPassToken, this.isSiteBuilder = t?.isSiteBuilder ?? !1, this.autoFormat = t?.autoFormat ?? !1, this.buildSrcset = t?.buildSrcset ?? !1, this.consistency = t?.consistency;
478
479
  }
479
480
  get totalDataCount() {
480
481
  return this.totalCount;
@@ -483,14 +484,14 @@ var wt = class {
483
484
  this.securityByPassToken !== e && (this.securityByPassToken = e, this.resetPageCache());
484
485
  }
485
486
  setPageSize(e) {
486
- let t = Number.isFinite(e) && e >= 1 ? Math.floor(e) : vt;
487
+ let t = Number.isFinite(e) && e >= 1 ? Math.floor(e) : yt;
487
488
  if (this.pageSize === t) return;
488
489
  let n = this.fetchedPages.size > 0;
489
490
  n && t < this.pageSize || (this.pageSize = t, n && (this.requestEpoch += 1, this.fetchedPages.clear()));
490
491
  }
491
492
  async fetchImages({ end: e, extraFields: t = [], format: n, manualFormat: r = !0, start: i, throwOnError: a = !1, transformations: o }) {
492
493
  if (e < i || this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < i)) return this.data;
493
- let s = this.requestEpoch, c = me(this.host.ownerDocument.defaultView);
494
+ let s = this.requestEpoch, c = de(this.host.ownerDocument.defaultView);
494
495
  if (!this.folderId || s !== this.requestEpoch) return this.data;
495
496
  let l = n ? `path_${n}` : void 0, u = `path_${B}`, d = `path_${V}`, f = c ? [u, d] : [...new Set([
496
497
  l,
@@ -499,12 +500,12 @@ var wt = class {
499
500
  ].filter((e) => !!e))], p = Math.floor(i / this.pageSize) + 1, m = Math.floor(e / this.pageSize) + 1;
500
501
  for (let e = p; e <= m; e++) {
501
502
  if (this.fetchedPages.has(e)) continue;
502
- let i = await pt({
503
+ let i = await mt({
503
504
  consistency: this.consistency,
504
505
  countPerPage: this.pageSize,
505
506
  directParentFolderIdentifier: this.folderId,
506
507
  extraFields: [...t, ...f],
507
- getPermanentAssetsPaths: ce(this.host.ownerDocument.defaultView),
508
+ getPermanentAssetsPaths: le(this.host.ownerDocument.defaultView),
508
509
  isSiteBuilder: this.isSiteBuilder,
509
510
  limitedDocTypes: [
510
511
  M.Image,
@@ -524,7 +525,7 @@ var wt = class {
524
525
  let e = Math.min(this.maxEnd, i.totalCount);
525
526
  this.totalCount = e, this.data = Array.from({ length: e }, () => ({
526
527
  alt: "",
527
- id: `temp-${be()}`,
528
+ id: `temp-${xe()}`,
528
529
  name: "",
529
530
  src: ""
530
531
  }));
@@ -533,7 +534,7 @@ var wt = class {
533
534
  for (let e = 0; e < i.items.length; e++) {
534
535
  let a = l + e;
535
536
  if (a < this.data.length) {
536
- let s = i.items[e], { maxHeight: l, maxWidth: u, src: d, srcset: f } = Ct({
537
+ let s = i.items[e], { maxHeight: l, maxWidth: u, src: d, srcset: f } = wt({
537
538
  autoFormat: this.autoFormat,
538
539
  buildSrcset: this.buildSrcset,
539
540
  docType: s.docType,
@@ -544,7 +545,7 @@ var wt = class {
544
545
  size: s.size,
545
546
  useExpiringAssetUrls: c
546
547
  }), p = d, m = f;
547
- !c && p && o && o.length > 0 && (p = de(p, o), m = ""), this.data[a] = {
548
+ !c && p && o && o.length > 0 && (p = pe(p, o), m = ""), this.data[a] = {
548
549
  alt: s.name,
549
550
  docType: s.docType,
550
551
  extension: s.extension,
@@ -587,26 +588,26 @@ var wt = class {
587
588
  }
588
589
  async fetchImagesByIDs({ extraFields: e = [], format: t, manualFormat: n = !0, recordIds: r, throwOnError: i = !1, transformations: a }) {
589
590
  if (r.length === 0) return [];
590
- let o = me(this.host.ownerDocument.defaultView), s = t ? `path_${t}` : void 0, c = `path_${B}`, l = `path_${V}`, u = o ? [c, l] : [...new Set([
591
+ let o = de(this.host.ownerDocument.defaultView), s = t ? `path_${t}` : void 0, c = `path_${B}`, l = `path_${V}`, u = o ? [c, l] : [...new Set([
591
592
  s,
592
593
  c,
593
594
  l
594
- ].filter((e) => !!e))], d = [I, ...o ? [] : [He]], f = [...e, F];
595
- return (await ft({
595
+ ].filter((e) => !!e))], d = [I, ...o ? [] : [Ue]], f = [...e, F];
596
+ return (await pt({
596
597
  consistency: this.consistency,
597
598
  extraFields: [
598
599
  ...f,
599
600
  ...u,
600
601
  ...d
601
602
  ].filter((e) => e !== ""),
602
- getPermanentAssetsPaths: ce(this.host.ownerDocument.defaultView),
603
+ getPermanentAssetsPaths: le(this.host.ownerDocument.defaultView),
603
604
  isSiteBuilder: this.isSiteBuilder,
604
605
  recordIds: r,
605
606
  securityByPassToken: this.securityByPassToken,
606
607
  throwOnError: i,
607
608
  token: this.authToken
608
609
  })).items.map((e) => {
609
- let { maxHeight: r, maxWidth: i, src: s, srcset: c } = Ct({
610
+ let { maxHeight: r, maxWidth: i, src: s, srcset: c } = wt({
610
611
  autoFormat: this.autoFormat,
611
612
  buildSrcset: this.buildSrcset,
612
613
  docType: e[F],
@@ -614,10 +615,10 @@ var wt = class {
614
615
  format: t,
615
616
  item: e,
616
617
  manualFormat: n,
617
- size: e[He],
618
+ size: e[Ue],
618
619
  useExpiringAssetUrls: o
619
620
  }), l = s, u = c;
620
- return !o && l && a && a.length > 0 && (l = de(l, a), u = ""), {
621
+ return !o && l && a && a.length > 0 && (l = pe(l, a), u = ""), {
621
622
  alt: e.name,
622
623
  docType: e[F],
623
624
  extension: e["Document.FileExtension"] || "",
@@ -686,7 +687,7 @@ var wt = class {
686
687
  resetFolderState() {
687
688
  this.resetPageCache();
688
689
  }
689
- }, Tt = t`.asset-link-format__panel{position:relative}.asset-link-format--formats .asset-link-format__panel:not(:last-child){border-bottom:1px solid var(--cx-color-neutral-200)}.asset-link-format__panel--placeholder,.asset-link-format--formats .asset-link-format__panel--placeholder:not(:last-child){height:var(--cx-spacing-3x-small);background-color:var(--cx-color-primary);border:none;overflow:hidden}.asset-link-format__panel--placeholder>*{visibility:hidden}.asset-link-format__drag-handle{cursor:grab;touch-action:none;width:max-content;margin-inline:auto;position:absolute;inset-block-start:calc(var(--cx-spacing-small) + var(--cx-font-size-3x-large) / 2);inset-inline:0;transform:translateY(-50%)}.asset-link-format__drag-handle::part(base){cursor:grab}.asset-link-format__drag-handle:active,.asset-link-format__drag-handle:active::part(base){cursor:grabbing}.asset-link-format__drag-handle::part(icon){color:var(--cx-color-neutral-300);rotate:90deg}.asset-link-format__announcement{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.asset-link-format__order-hint{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border-bottom:1px solid var(--cx-color-neutral-200);color:var(--cx-input-help-text-color);font:var(--cx-font-label-x-small)}.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__formats-summary{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__formats-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__formats-summary [part=icon]{width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__formats-crop cx-asset-link-format-crop{box-sizing:border-box;width:100%;padding:0 var(--cx-spacing-medium) var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}.asset-link-format__footer,.asset-link-format__footer>slot{display:block}`, Et = t`:host([inline]){display:block}cx-details::part(base){border-bottom-width:0}.details--inline::part(base){border-width:0}.details--inline::part(header){display:none}.details--inline::part(content){padding:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}.crop__limit{color:var(--cx-input-help-text-color);margin-block-start:calc(-1 * var(--spacing-container-gap))}.crop__limit:empty{position:absolute}`, H, U = class extends s {
690
+ }, Et = t`.asset-link-format__panel{position:relative}.asset-link-format--formats .asset-link-format__panel:not(:last-child){border-bottom:1px solid var(--cx-color-neutral-200)}.asset-link-format__panel--placeholder,.asset-link-format--formats .asset-link-format__panel--placeholder:not(:last-child){height:var(--cx-spacing-3x-small);background-color:var(--cx-color-primary);border:none;overflow:hidden}.asset-link-format__panel--placeholder>*{visibility:hidden}.asset-link-format__drag-handle{cursor:grab;touch-action:none;width:max-content;margin-inline:auto;position:absolute;inset-block-start:calc(var(--cx-spacing-small) + var(--cx-font-size-3x-large) / 2);inset-inline:0;transform:translateY(-50%)}.asset-link-format__drag-handle::part(base){cursor:grab}.asset-link-format__drag-handle:active,.asset-link-format__drag-handle:active::part(base){cursor:grabbing}.asset-link-format__drag-handle::part(icon){color:var(--cx-color-neutral-300);rotate:90deg}.asset-link-format__announcement{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.asset-link-format__order-hint{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border-bottom:1px solid var(--cx-color-neutral-200);color:var(--cx-input-help-text-color);font:var(--cx-font-label-x-small)}.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__formats-summary{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__formats-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__formats-summary [part=icon]{width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__formats-crop cx-asset-link-format-crop{box-sizing:border-box;width:100%;padding:0 var(--cx-spacing-medium) var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}.asset-link-format__footer,.asset-link-format__footer>slot{display:block}`, Dt = t`:host([inline]){display:block}cx-details::part(base){border-bottom-width:0}.details--inline::part(base){border-width:0}.details--inline::part(header){display:none}.details--inline::part(content){padding:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}.crop__limit{color:var(--cx-input-help-text-color);margin-block-start:calc(-1 * var(--spacing-container-gap))}.crop__limit:empty{position:absolute}`, H, U = class extends s {
690
691
  static #e = H = this;
691
692
  constructor(...e) {
692
693
  super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = k.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.hasCropper = !1, this.dimensionsLimited = !1, this.lastAppliedSetting = {
@@ -710,22 +711,22 @@ var wt = class {
710
711
  }
711
712
  }, this.loading = !1, this.cropModes = [], this.focusModes = [], this.focusMode = "manual", this.cropMode = "free", this.position = v.CenterCenter, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
712
713
  }
713
- static #t = this.styles = [l, Et];
714
+ static #t = this.styles = [l, Dt];
714
715
  static #n = this.dependencies = {
715
716
  "cx-button": _,
716
717
  "cx-details": E,
717
- "cx-divider": ge,
718
+ "cx-divider": _e,
718
719
  "cx-icon": h,
719
720
  "cx-icon-button": p,
720
- "cx-input": oe,
721
+ "cx-input": se,
721
722
  "cx-option": C,
722
- "cx-position-picker": ke,
723
+ "cx-position-picker": Ae,
723
724
  "cx-select": T,
724
725
  "cx-space": w,
725
726
  "cx-typography": x
726
727
  };
727
728
  static getRatioSize(e, t, n, r, i) {
728
- return n === k.Pixel && Number.isFinite(r) && Number.isFinite(i) ? re(r, i, e, t) : {
729
+ return n === k.Pixel && Number.isFinite(r) && Number.isFinite(i) ? ie(r, i, e, t) : {
729
730
  height: t,
730
731
  width: e
731
732
  };
@@ -777,7 +778,7 @@ var wt = class {
777
778
  }
778
779
  this.invalidWidth = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1));
779
780
  let n = this.unit === k.Pixel ? this.height : this.ratioHeight, r = !1;
780
- this.keepAspectRatio && (n = Math.max(Math.round(t / this.aspectRatio), 1)), this.unit === k.Pixel && this.maxHeight >= 1 && n > this.maxHeight && (n = this.maxHeight, r = this.keepAspectRatio), e.target.value = t.toString(), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
781
+ this.keepAspectRatio ? n = Math.max(Math.round(t / this.aspectRatio), 1) : this.unit === k.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxWidth, this.maxHeight)), this.unit === k.Pixel && this.maxHeight >= 1 && n > this.maxHeight && (n = this.maxHeight, r = this.keepAspectRatio), e.target.value = t.toString(), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
781
782
  breakAspectRatio: r,
782
783
  height: n,
783
784
  keepAspectRatio: this.keepAspectRatio,
@@ -793,7 +794,7 @@ var wt = class {
793
794
  }
794
795
  this.invalidHeight = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1));
795
796
  let n = this.unit === k.Pixel ? this.width : this.ratioWidth, r = !1;
796
- this.keepAspectRatio && (n = Math.max(Math.round(t * this.aspectRatio), 1)), this.unit === k.Pixel && this.maxWidth >= 1 && n > this.maxWidth && (n = this.maxWidth, r = this.keepAspectRatio), e.target.value = t.toString(), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
797
+ this.keepAspectRatio ? n = Math.max(Math.round(t * this.aspectRatio), 1) : this.unit === k.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxHeight, this.maxWidth)), this.unit === k.Pixel && this.maxWidth >= 1 && n > this.maxWidth && (n = this.maxWidth, r = this.keepAspectRatio), e.target.value = t.toString(), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
797
798
  breakAspectRatio: r,
798
799
  height: t,
799
800
  keepAspectRatio: this.keepAspectRatio,
@@ -919,6 +920,11 @@ var wt = class {
919
920
  scale: 0
920
921
  } };
921
922
  }
923
+ fitRatioSides(e, t, n, r) {
924
+ if (!this.hasMaxSize || n < 1 || r < 1) return [e, t];
925
+ let i = Math.min(e, n * t);
926
+ return [i, Math.min(t, r * i)];
927
+ }
922
928
  render() {
923
929
  let t = this.cropModes.filter((e) => !e.auto), n = this.cropModes.filter((e) => e.auto);
924
930
  return e`<cx-details class="details ${this.inline ? "details--inline" : ""}" ?open=${this.inline || this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${g({ width: "100%" })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${S(t, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}
@@ -932,7 +938,7 @@ var wt = class {
932
938
  ${m(!this.inline, () => e`<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${g({ marginLeft: "auto" })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space></cx-details>`;
933
939
  }
934
940
  };
935
- a([c(".details"), o("design:type", E === void 0 ? Object : E)], U.prototype, "base", void 0), a([c("cx-position-picker"), o("design:type", ke === void 0 ? Object : ke)], U.prototype, "positionPicker", void 0), a([r({
941
+ a([c(".details"), o("design:type", E === void 0 ? Object : E)], U.prototype, "base", void 0), a([c("cx-position-picker"), o("design:type", Ae === void 0 ? Object : Ae)], U.prototype, "positionPicker", void 0), a([r({
936
942
  reflect: !0,
937
943
  type: Boolean
938
944
  }), o("design:type", Boolean)], U.prototype, "open", void 0), a([r({
@@ -1035,7 +1041,7 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], U.prototype, "ba
1035
1041
  o("design:paramtypes", []),
1036
1042
  o("design:returntype", Promise)
1037
1043
  ], U.prototype, "handleOpenChange", null), U = H = a([u("cx-asset-link-format-crop")], U);
1038
- var Dt = U, Ot = t`:host{display:block}.asset-link-format__dimensions-select{width:100%}.details::part(base){border-bottom-width:0}.asset-link-format__dimensions-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__dimensions-inline .asset-link-format__dimensions-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__dimensions-inline .asset-link-format__dimensions-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__dimensions-custom{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,7rem);align-items:center;display:grid}.asset-link-format__dimensions-custom cx-input,.asset-link-format__dimensions-custom cx-select{min-width:0}.asset-link-format__dimensions-apply{margin-inline-start:auto}`, kt = {
1044
+ var Ot = U, kt = t`:host{display:block}.asset-link-format__dimensions-select{width:100%}.details::part(base){border-bottom-width:0}.asset-link-format__dimensions-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__dimensions-inline .asset-link-format__dimensions-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__dimensions-inline .asset-link-format__dimensions-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__dimensions-custom{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,7rem);align-items:center;display:grid}.asset-link-format__dimensions-custom cx-input,.asset-link-format__dimensions-custom cx-select{min-width:0}.asset-link-format__dimensions-apply{margin-inline-start:auto}`, At = {
1039
1045
  [A.Percent]: { num: {
1040
1046
  mask: Number,
1041
1047
  min: 1,
@@ -1061,14 +1067,14 @@ var Dt = U, Ot = t`:host{display:block}.asset-link-format__dimensions-select{wid
1061
1067
  }
1062
1068
  };
1063
1069
  }
1064
- static #e = this.styles = [l, Ot];
1070
+ static #e = this.styles = [l, kt];
1065
1071
  static #t = this.dependencies = {
1066
1072
  "cx-button": _,
1067
1073
  "cx-details": E,
1068
- "cx-divider": ge,
1074
+ "cx-divider": _e,
1069
1075
  "cx-icon": h,
1070
- "cx-input": oe,
1071
- "cx-menu-label": ve,
1076
+ "cx-input": se,
1077
+ "cx-menu-label": ye,
1072
1078
  "cx-option": C,
1073
1079
  "cx-select": T,
1074
1080
  "cx-space": w,
@@ -1156,7 +1162,7 @@ var Dt = U, Ot = t`:host{display:block}.asset-link-format__dimensions-select{wid
1156
1162
  }
1157
1163
  renderCustomDimensions() {
1158
1164
  let t = this.customDimensionsUnit, n = this.customDimensionsDrafts[t];
1159
- return e`<cx-space class="asset-link-format__dimensions-custom" spacing="small"><cx-input name="width" mask="num" .maskBlocks=${kt[t]} aria-label=${this.localize.term("maxWidth")} value=${n.width} ?disabled=${this.loading} @cx-input=${this.onDimensionsInput} @cx-change=${this.onDimensionsCustomChange}><cx-typography slot="prefix" variant="body3" part="input-label">W</cx-typography></cx-input><cx-input name="height" mask="num" .maskBlocks=${kt[t]} aria-label=${this.localize.term("maxHeight")} value=${n.height} ?disabled=${this.loading} @cx-input=${this.onDimensionsInput} @cx-change=${this.onDimensionsCustomChange}><cx-typography slot="prefix" variant="body3" part="input-label">H</cx-typography></cx-input><cx-select data-label=${this.localize.term("unit")} value=${t} ?disabled=${this.loading} hoist @cx-change=${this.onDimensionsUnitChange}><cx-option value=${A.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${A.Percent}>${this.localize.term("dimensionsPercent")}</cx-option></cx-select></cx-space>`;
1165
+ return e`<cx-space class="asset-link-format__dimensions-custom" spacing="small"><cx-input name="width" mask="num" .maskBlocks=${At[t]} aria-label=${this.localize.term("maxWidth")} value=${n.width} ?disabled=${this.loading} @cx-input=${this.onDimensionsInput} @cx-change=${this.onDimensionsCustomChange}><cx-typography slot="prefix" variant="body3" part="input-label">W</cx-typography></cx-input><cx-input name="height" mask="num" .maskBlocks=${At[t]} aria-label=${this.localize.term("maxHeight")} value=${n.height} ?disabled=${this.loading} @cx-input=${this.onDimensionsInput} @cx-change=${this.onDimensionsCustomChange}><cx-typography slot="prefix" variant="body3" part="input-label">H</cx-typography></cx-input><cx-select data-label=${this.localize.term("unit")} value=${t} ?disabled=${this.loading} hoist @cx-change=${this.onDimensionsUnitChange}><cx-option value=${A.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${A.Percent}>${this.localize.term("dimensionsPercent")}</cx-option></cx-select></cx-space>`;
1160
1166
  }
1161
1167
  renderSummary() {
1162
1168
  return e`<cx-space class="asset-link-format__dimensions-summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant=${this.inline ? b.Body3 : b.Body2}>${this.localize.term("dimensions")}</cx-typography></cx-space>`;
@@ -1205,11 +1211,11 @@ a([r({
1205
1211
  o("design:paramtypes", []),
1206
1212
  o("design:returntype", void 0)
1207
1213
  ], W.prototype, "handleDimensionsValueChange", null), W = a([u("cx-asset-link-format-dimensions")], W);
1208
- var At = W, jt = t`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`, G = class extends s {
1214
+ var jt = W, Mt = t`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`, G = class extends s {
1209
1215
  constructor(...e) {
1210
1216
  super(...e), this.localize = new d(this), this.value = "", this.items = [];
1211
1217
  }
1212
- static #e = this.styles = [l, jt];
1218
+ static #e = this.styles = [l, Mt];
1213
1219
  static #t = this.dependencies = {
1214
1220
  "cx-option": C,
1215
1221
  "cx-select": T,
@@ -1231,15 +1237,15 @@ a([r({
1231
1237
  reflect: !1,
1232
1238
  type: Array
1233
1239
  }), o("design:type", typeof Array > "u" ? Object : Array)], G.prototype, "items", void 0), G = a([u("cx-asset-link-format-extension")], G);
1234
- var Mt = G, Nt = t`cx-details::part(base){border-bottom-width:0}`, Pt = "auto", K = class extends s {
1240
+ var Nt = G, Pt = t`cx-details::part(base){border-bottom-width:0}`, Ft = "auto", K = class extends s {
1235
1241
  constructor(...e) {
1236
1242
  super(...e), this.localize = new d(this), this.open = !1, this.value = "", this.items = [], this.canAutoFormat = !1, this.autoFormat = !1, this.loading = !1, this.scopedValue = "";
1237
1243
  }
1238
- static #e = this.styles = [l, Nt];
1244
+ static #e = this.styles = [l, Pt];
1239
1245
  static #t = this.dependencies = {
1240
1246
  "cx-button": _,
1241
1247
  "cx-details": E,
1242
- "cx-divider": ge,
1248
+ "cx-divider": _e,
1243
1249
  "cx-icon": h,
1244
1250
  "cx-option": C,
1245
1251
  "cx-select": T,
@@ -1247,7 +1253,7 @@ var Mt = G, Nt = t`cx-details::part(base){border-bottom-width:0}`, Pt = "auto",
1247
1253
  "cx-typography": x
1248
1254
  };
1249
1255
  get committedValue() {
1250
- return this.autoFormat ? Pt : this.value;
1256
+ return this.autoFormat ? Ft : this.value;
1251
1257
  }
1252
1258
  handleValueChange() {
1253
1259
  this.scopedValue = this.committedValue;
@@ -1279,7 +1285,7 @@ var Mt = G, Nt = t`cx-details::part(base){border-bottom-width:0}`, Pt = "auto",
1279
1285
  }
1280
1286
  render() {
1281
1287
  return e`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${S(this.items, (e) => e.id, (t) => e`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`)}
1282
- ${m(this.canAutoFormat, () => e`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${Pt}>${this.localize.term("auto")}</cx-option>`, () => n)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${g({ "margin-left": "auto" })} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1288
+ ${m(this.canAutoFormat, () => e`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${Ft}>${this.localize.term("auto")}</cx-option>`, () => n)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${g({ "margin-left": "auto" })} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1283
1289
  }
1284
1290
  };
1285
1291
  a([c(".details"), o("design:type", E === void 0 ? Object : E)], K.prototype, "base", void 0), a([r({
@@ -1314,21 +1320,21 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], K.prototype, "ba
1314
1320
  o("design:paramtypes", []),
1315
1321
  o("design:returntype", void 0)
1316
1322
  ], K.prototype, "handleOpenChange", null), K = a([u("cx-asset-link-format-proxy")], K);
1317
- var Ft = K, It = t`cx-details::part(base){border-bottom-width:0}.asset-link-format__quality-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__quality-inline .asset-link-format__quality-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__quality-inline .asset-link-format__quality-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__quality-apply{margin-inline-start:auto}`, q = class extends s {
1323
+ var It = K, Lt = t`cx-details::part(base){border-bottom-width:0}.asset-link-format__quality-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__quality-inline .asset-link-format__quality-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__quality-inline .asset-link-format__quality-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__quality-apply{margin-inline-start:auto}`, q = class extends s {
1318
1324
  constructor(...e) {
1319
1325
  super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.applyBehavior = N.Legacy, this.value = 100, this.items = [], this.customSelected = !1, this.loading = !1, this.scopedValue = 100;
1320
1326
  }
1321
- static #e = this.styles = [l, It];
1327
+ static #e = this.styles = [l, Lt];
1322
1328
  static #t = this.dependencies = {
1323
1329
  "cx-button": _,
1324
1330
  "cx-details": E,
1325
- "cx-divider": ge,
1331
+ "cx-divider": _e,
1326
1332
  "cx-icon": h,
1327
- "cx-input": oe,
1333
+ "cx-input": se,
1328
1334
  "cx-option": C,
1329
1335
  "cx-select": T,
1330
1336
  "cx-space": w,
1331
- "cx-tooltip": te,
1337
+ "cx-tooltip": ne,
1332
1338
  "cx-typography": x
1333
1339
  };
1334
1340
  get invalidValue() {
@@ -1413,7 +1419,7 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], q.prototype, "ba
1413
1419
  o("design:paramtypes", []),
1414
1420
  o("design:returntype", void 0)
1415
1421
  ], q.prototype, "handleValueChange", null), q = a([u("cx-asset-link-format-quality")], q);
1416
- var Lt = q, Rt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`, J = class extends s {
1422
+ var Rt = q, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`, J = class extends s {
1417
1423
  constructor(...e) {
1418
1424
  super(...e), this.localize = new d(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = k.Pixel, this.lastAppliedSetting = {
1419
1425
  [k.Pixel]: {
@@ -1426,13 +1432,13 @@ var Lt = q, Rt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1426
1432
  }
1427
1433
  }, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
1428
1434
  }
1429
- static #e = this.styles = [l, Rt];
1435
+ static #e = this.styles = [l, zt];
1430
1436
  static #t = this.dependencies = {
1431
1437
  "cx-button": _,
1432
1438
  "cx-details": E,
1433
1439
  "cx-icon": h,
1434
1440
  "cx-icon-button": p,
1435
- "cx-input": oe,
1441
+ "cx-input": se,
1436
1442
  "cx-option": C,
1437
1443
  "cx-select": T,
1438
1444
  "cx-space": w,
@@ -1476,9 +1482,9 @@ var Lt = q, Rt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1476
1482
  this.invalidWidth = !0;
1477
1483
  return;
1478
1484
  }
1479
- this.invalidWidth = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1)), e.target.value = t.toString();
1485
+ this.invalidWidth = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1));
1480
1486
  let n = this.unit === k.Pixel ? this.height : this.ratioHeight;
1481
- this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t / this.aspectRatio), this.maxHeight), 1), this.invalidHeight = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1487
+ !this.keepAspectRatio && this.unit === k.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxWidth, this.maxHeight)), e.target.value = t.toString(), this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t / this.aspectRatio), this.maxHeight), 1), this.invalidHeight = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1482
1488
  height: n,
1483
1489
  keepAspectRatio: this.keepAspectRatio,
1484
1490
  unit: this.unit,
@@ -1491,9 +1497,9 @@ var Lt = q, Rt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1491
1497
  this.invalidHeight = !0;
1492
1498
  return;
1493
1499
  }
1494
- this.invalidHeight = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1)), e.target.value = t.toString();
1500
+ this.invalidHeight = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1));
1495
1501
  let n = this.unit === k.Pixel ? this.width : this.ratioWidth;
1496
- this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t * this.aspectRatio), this.maxWidth), 1), this.invalidWidth = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1502
+ !this.keepAspectRatio && this.unit === k.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxHeight, this.maxWidth)), e.target.value = t.toString(), this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t * this.aspectRatio), this.maxWidth), 1), this.invalidWidth = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1497
1503
  height: t,
1498
1504
  keepAspectRatio: this.keepAspectRatio,
1499
1505
  unit: this.unit,
@@ -1534,6 +1540,11 @@ var Lt = q, Rt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1534
1540
  width: this.unit === k.Pixel ? this.width : this.ratioWidth
1535
1541
  } });
1536
1542
  }
1543
+ fitRatioSides(e, t, n, r) {
1544
+ if (!Number.isFinite(n) || !Number.isFinite(r) || n < 1 || r < 1) return [e, t];
1545
+ let i = Math.min(e, n * t);
1546
+ return [i, Math.min(t, r * i)];
1547
+ }
1537
1548
  render() {
1538
1549
  return e`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: {
1539
1550
  mask: Number,
@@ -1609,14 +1620,14 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], J.prototype, "ba
1609
1620
  o("design:paramtypes", []),
1610
1621
  o("design:returntype", Promise)
1611
1622
  ], J.prototype, "handleOpenChange", null), J = a([u("cx-asset-link-format-resize")], J);
1612
- var zt = J, Bt = t`cx-details::part(base){border-bottom-width:0}.asset-link-format__rotation-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__rotation-inline .asset-link-format__rotation-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__rotation-inline .asset-link-format__rotation-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}`, Y = class extends s {
1623
+ var Bt = J, Vt = t`cx-details::part(base){border-bottom-width:0}.asset-link-format__rotation-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__rotation-inline .asset-link-format__rotation-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__rotation-inline .asset-link-format__rotation-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}`, Y = class extends s {
1613
1624
  constructor(...e) {
1614
1625
  super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
1615
1626
  }
1616
- static #e = this.styles = [l, Bt];
1627
+ static #e = this.styles = [l, Vt];
1617
1628
  static #t = this.dependencies = {
1618
1629
  "cx-button": _,
1619
- "cx-button-group": ie,
1630
+ "cx-button-group": ae,
1620
1631
  "cx-details": E,
1621
1632
  "cx-icon": h,
1622
1633
  "cx-icon-button": p,
@@ -1629,11 +1640,11 @@ var zt = J, Bt = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
1629
1640
  handleRotationChange(e) {
1630
1641
  let t = e.target.value, n = Number(t);
1631
1642
  if (Number.isNaN(n)) return;
1632
- let r = ne(n);
1643
+ let r = re(n);
1633
1644
  (n > 360 || n < -360) && (e.target.value = r.toString()), this.emit("cx-asset-link-format-rotation-change", { detail: r });
1634
1645
  }
1635
1646
  handleButtonClick(e) {
1636
- this.emit("cx-asset-link-format-rotation-change", { detail: ne(e) });
1647
+ this.emit("cx-asset-link-format-rotation-change", { detail: re(e) });
1637
1648
  }
1638
1649
  handleClockwiseClick() {
1639
1650
  this.handleButtonClick(this.value + 90);
@@ -1691,18 +1702,18 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], Y.prototype, "ba
1691
1702
  o("design:paramtypes", []),
1692
1703
  o("design:returntype", void 0)
1693
1704
  ], Y.prototype, "handleOpenChange", null), Y = a([u("cx-asset-link-format-rotation")], Y);
1694
- var Vt = Y, Ht = t`cx-details::part(base){border-bottom-width:0}`, X = class extends s {
1705
+ var Ht = Y, Ut = t`cx-details::part(base){border-bottom-width:0}`, X = class extends s {
1695
1706
  constructor(...e) {
1696
1707
  super(...e), this.localize = new d(this), this.open = !1, this.value = !1;
1697
1708
  }
1698
- static #e = this.styles = [l, Ht];
1709
+ static #e = this.styles = [l, Ut];
1699
1710
  static #t = this.dependencies = {
1700
1711
  "cx-button": _,
1701
- "cx-checkbox": ae,
1712
+ "cx-checkbox": oe,
1702
1713
  "cx-details": E,
1703
1714
  "cx-icon": h,
1704
1715
  "cx-space": w,
1705
- "cx-tooltip": te,
1716
+ "cx-tooltip": ne,
1706
1717
  "cx-typography": x
1707
1718
  };
1708
1719
  handleApply(e) {
@@ -1725,13 +1736,13 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], X.prototype, "ba
1725
1736
  reflect: !0,
1726
1737
  type: Boolean
1727
1738
  }), o("design:type", Object)], X.prototype, "value", void 0), X = a([u("cx-asset-link-format-metadata")], X);
1728
- var Ut = X, Z, Wt = {
1739
+ var Wt = X, Z, Gt = {
1729
1740
  [j.Crop]: O.Crop,
1730
1741
  [j.Dimensions]: O.Dimensions,
1731
1742
  [j.Quality]: O.Quality,
1732
1743
  [j.Resize]: O.Resize,
1733
1744
  [j.Rotate]: O.Rotate
1734
- }, Gt = [
1745
+ }, Q = [
1735
1746
  j.Proxy,
1736
1747
  j.Crop,
1737
1748
  j.Resize,
@@ -1741,8 +1752,8 @@ var Ut = X, Z, Wt = {
1741
1752
  ], Kt = [
1742
1753
  j.Proxy,
1743
1754
  j.Dimensions,
1744
- ...Gt.slice(1)
1745
- ], Q = [
1755
+ ...Q.slice(1)
1756
+ ], qt = [
1746
1757
  j.Dimensions,
1747
1758
  j.Crop,
1748
1759
  j.Resize,
@@ -1750,32 +1761,39 @@ var Ut = X, Z, Wt = {
1750
1761
  j.Quality
1751
1762
  ], $ = class extends s {
1752
1763
  static #e = Z = this;
1753
- static #t = this.styles = [l, Tt];
1764
+ static #t = this.styles = [l, Et];
1754
1765
  static #n = this.dependencies = {
1755
- "cx-asset-link-format-crop": Dt,
1756
- "cx-asset-link-format-dimensions": At,
1757
- "cx-asset-link-format-extension": Mt,
1758
- "cx-asset-link-format-metadata": Ut,
1759
- "cx-asset-link-format-proxy": Ft,
1760
- "cx-asset-link-format-quality": Lt,
1761
- "cx-asset-link-format-resize": zt,
1762
- "cx-asset-link-format-rotation": Vt,
1766
+ "cx-asset-link-format-crop": Ot,
1767
+ "cx-asset-link-format-dimensions": jt,
1768
+ "cx-asset-link-format-extension": Nt,
1769
+ "cx-asset-link-format-metadata": Wt,
1770
+ "cx-asset-link-format-proxy": It,
1771
+ "cx-asset-link-format-quality": Rt,
1772
+ "cx-asset-link-format-resize": Bt,
1773
+ "cx-asset-link-format-rotation": Ht,
1763
1774
  "cx-button": _,
1764
1775
  "cx-icon": h,
1765
1776
  "cx-icon-button": p,
1766
1777
  "cx-space": w,
1767
- "cx-switch": ye,
1778
+ "cx-switch": be,
1768
1779
  "cx-typography": x,
1769
- "cx-visually-hidden": se
1780
+ "cx-visually-hidden": ce
1770
1781
  };
1771
1782
  static getTransformExtension(e) {
1772
- return !e || xt(e) ? e : "jpg";
1783
+ return !e || St(e) ? e : "jpg";
1784
+ }
1785
+ static fitRatioResizeSize(e, t, n, r) {
1786
+ let { height: i, width: a } = ie(n, r, e, t);
1787
+ return {
1788
+ height: Math.max(i, 1),
1789
+ width: Math.max(a, 1)
1790
+ };
1773
1791
  }
1774
1792
  static uniqueTransformations(e) {
1775
1793
  return [...new Map(e.map((e) => [e.key, e])).values()];
1776
1794
  }
1777
1795
  static orderTransformations(e, t) {
1778
- let n = t.map((e) => Wt[e]).filter((e) => e !== void 0), r = e.filter((e) => n.includes(e.key)).sort((e, t) => n.indexOf(e.key) - n.indexOf(t.key)), i = 0;
1796
+ let n = t.map((e) => Gt[e]).filter((e) => e !== void 0), r = e.filter((e) => n.includes(e.key)).sort((e, t) => n.indexOf(e.key) - n.indexOf(t.key)), i = 0;
1779
1797
  return e.map((e) => n.includes(e.key) ? r[i++] : e);
1780
1798
  }
1781
1799
  static getDimensionsPresetSize(e) {
@@ -1818,7 +1836,7 @@ var Ut = X, Z, Wt = {
1818
1836
  return this.reorderable && !this.asset;
1819
1837
  }
1820
1838
  get isFormatsLayout() {
1821
- return this.layout === _e.Formats;
1839
+ return this.layout === ve.Formats;
1822
1840
  }
1823
1841
  get hasUnfrozenTransformations() {
1824
1842
  return !(this.transformations.length === 0 || this.frozenIndex !== void 0 && this.frozenIndex >= this.transformations.length - 1);
@@ -2012,7 +2030,7 @@ var Ut = X, Z, Wt = {
2012
2030
  return this.asset ? 0 : this.transformations.findLast((e) => e.key === O.Rotate)?.value.rotation ?? 0;
2013
2031
  }
2014
2032
  get transformationString() {
2015
- return fe({
2033
+ return me({
2016
2034
  asset: this.asset,
2017
2035
  baseUrl: "",
2018
2036
  parameters: this.parameters,
@@ -2021,7 +2039,7 @@ var Ut = X, Z, Wt = {
2021
2039
  }).replace(/\/t\//g, "");
2022
2040
  }
2023
2041
  constructor() {
2024
- super(), this.localize = new d(this), this.initialParts = [...Gt], this.sortableRevision = 0, this.dragPreviousSibling = null, this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
2042
+ super(), this.localize = new d(this), this.initialParts = [...Q], this.sortableRevision = 0, this.dragPreviousSibling = null, this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
2025
2043
  {
2026
2044
  label: "Free",
2027
2045
  value: "free"
@@ -2080,7 +2098,7 @@ var Ut = X, Z, Wt = {
2080
2098
  label: "Smart Swatch",
2081
2099
  value: "SmartSwatch"
2082
2100
  }
2083
- ], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.defaultProxy = "", this.canAutoFormat = !1, this.autoFormat = !1, this.useCustomExtension = !1, this.parts = this.initialParts, this.layout = _e.Accordion, this.cropEnabled = !1, this.reorderable = !1, this.dimensionsItems = [], this.qualityItems = [], this.canCustomDimensions = !1, this.lastImageSize = {
2101
+ ], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.defaultProxy = "", this.canAutoFormat = !1, this.autoFormat = !1, this.useCustomExtension = !1, this.parts = this.initialParts, this.layout = ve.Accordion, this.cropEnabled = !1, this.reorderable = !1, this.dimensionsItems = [], this.qualityItems = [], this.canCustomDimensions = !1, this.lastImageSize = {
2084
2102
  height: 0,
2085
2103
  width: 0
2086
2104
  }, this.hideHeader = !1, this.canReset = !1, this.queryElement = null, this.activeSetting = "cx-asset-link-format-proxy", this.selectedFormat = void 0, this.resizeSize = {
@@ -2107,7 +2125,7 @@ var Ut = X, Z, Wt = {
2107
2125
  }, this.rotation = 0, this.defaultSize = {
2108
2126
  height: 0,
2109
2127
  width: 0
2110
- }, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.reorderAnnouncement = "", this.orderUndo = [], this.apiGetTransformAssetLink = lt, this.apiGetCropFocusMode = mt, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
2128
+ }, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.reorderAnnouncement = "", this.orderUndo = [], this.apiGetTransformAssetLink = ut, this.apiGetCropFocusMode = ht, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
2111
2129
  }
2112
2130
  runConnectedCallback() {
2113
2131
  this.hasUpdated && (this.syncSortable(), this.handleCropperSelectorChange(), this.cropperElement && (this.cropperElement.addEventListener("cx-cropper-crop-complete", this.onCropComplete), this.cropperElement.addEventListener("cx-cropper-crop-drag-start", this.onCropDragStart)));
@@ -2136,7 +2154,7 @@ var Ut = X, Z, Wt = {
2136
2154
  width: e.width
2137
2155
  });
2138
2156
  });
2139
- let t = fe({
2157
+ let t = me({
2140
2158
  asset: this.asset,
2141
2159
  baseUrl: "",
2142
2160
  extension: this.selectedFormat.extension,
@@ -2239,10 +2257,10 @@ var Ut = X, Z, Wt = {
2239
2257
  let t = e, n = this.canReorder && t !== void 0 && t.length === this.transformations.length && t.every((e) => this.transformations.includes(e));
2240
2258
  if (!this.asset) {
2241
2259
  let e = Z.uniqueTransformations(this.transformations), t = this.canReorder ? Z.orderTransformations(e, this.activeParts) : e;
2242
- (t.length !== this.transformations.length || t.some((e, t) => e !== this.transformations[t])) && (this.transformations = t);
2260
+ (t.length !== this.transformations.length || t.some((e, t) => e !== this.transformations[t])) && (this.transformations = t), n || this.capCropToMaxSize();
2243
2261
  }
2244
2262
  if (this.syncSelectedDimensions(), await this.updateComplete, !this.asset) {
2245
- if (this.emit("cx-asset-link-format-change", { detail: fe({
2263
+ if (this.emit("cx-asset-link-format-change", { detail: me({
2246
2264
  asset: this.asset,
2247
2265
  baseUrl: "",
2248
2266
  options: { omitZeroXY: !0 },
@@ -2375,7 +2393,7 @@ var Ut = X, Z, Wt = {
2375
2393
  url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${r.relativePath}` : r.relativePath,
2376
2394
  width: r.width
2377
2395
  };
2378
- let o = fe({
2396
+ let o = me({
2379
2397
  asset: this.asset,
2380
2398
  baseUrl: "",
2381
2399
  extension: this.selectedFormat.extension,
@@ -2521,14 +2539,14 @@ var Ut = X, Z, Wt = {
2521
2539
  }
2522
2540
  handleReorderableChange() {
2523
2541
  if (this.orderUndo = [], this.canReorder && this.parts === this.initialParts && this.transformations.length > 0) {
2524
- let e = Z.uniqueTransformations(this.transformations).flatMap((e) => Gt.filter((t) => Wt[t] === e.key)), t = [...e, ...Gt.filter((t) => Wt[t] && !e.includes(t))], n = 0;
2525
- this.parts = Gt.map((e) => Wt[e] ? t[n++] : e);
2542
+ let e = Z.uniqueTransformations(this.transformations).flatMap((e) => Q.filter((t) => Gt[t] === e.key)), t = [...e, ...Q.filter((t) => Gt[t] && !e.includes(t))], n = 0;
2543
+ this.parts = Q.map((e) => Gt[e] ? t[n++] : e);
2526
2544
  }
2527
2545
  this.handlePartsChange(), this.syncSortable();
2528
2546
  }
2529
2547
  destroySortable() {
2530
- let e = this.shadowRoot?.querySelector(".asset-link-format__panel--placeholder");
2531
- this.sortable?.destroy(), this.sortable = void 0, e && (e.classList.remove("asset-link-format__panel--placeholder"), this.dragPreviousSibling?.after(e)), this.dragPreviousSibling = null;
2548
+ let e = this.draggedPanel;
2549
+ this.sortable?.destroy(), this.sortable = void 0, this.dragCopy?.remove(), e && (e.classList.remove("asset-link-format__panel--placeholder"), this.dragPreviousSibling?.after(e)), this.dragPreviousSibling = null;
2532
2550
  }
2533
2551
  async syncSortable() {
2534
2552
  let e = ++this.sortableRevision;
@@ -2541,6 +2559,8 @@ var Ut = X, Z, Wt = {
2541
2559
  animation: 0,
2542
2560
  direction: "vertical",
2543
2561
  draggable: "[data-reorderable]",
2562
+ fallbackTolerance: 3,
2563
+ forceFallback: ee(),
2544
2564
  ghostClass: "asset-link-format__panel--placeholder",
2545
2565
  handle: ".asset-link-format__drag-handle",
2546
2566
  invertSwap: !0,
@@ -2576,11 +2596,11 @@ var Ut = X, Z, Wt = {
2576
2596
  }
2577
2597
  movePart(e, t) {
2578
2598
  if (!this.canReorder || this.loading) return;
2579
- let n = this.activeParts.filter((e) => Q.includes(e)), r = n.indexOf(e);
2599
+ let n = this.activeParts.filter((e) => qt.includes(e)), r = n.indexOf(e);
2580
2600
  if (r < 0 || t < 0 || t >= n.length || r === t) return;
2581
2601
  this.rememberOrder(), n.splice(r, 1), n.splice(t, 0, e);
2582
2602
  let i = 0;
2583
- this.parts = this.activeParts.map((e) => Q.includes(e) ? n[i++] : e);
2603
+ this.parts = this.activeParts.map((e) => qt.includes(e) ? n[i++] : e);
2584
2604
  let a = Z.orderTransformations(this.transformations, this.parts);
2585
2605
  a.some((e, t) => e !== this.transformations[t]) && (this.transformations = a), this.capCropToMaxSize(), this.reorderAnnouncement = `${this.localize.term(e)}: ${t + 1} / ${n.length}`, this.emitReorder(), this.updateComplete.then(() => {
2586
2606
  this.shadowRoot?.querySelector(`[data-part="${e}"] .asset-link-format__drag-handle`)?.focus();
@@ -2589,7 +2609,7 @@ var Ut = X, Z, Wt = {
2589
2609
  handleReorderKeyDown(e) {
2590
2610
  if (e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
2591
2611
  e.preventDefault(), e.stopPropagation();
2592
- let t = e.currentTarget.closest("[data-part]")?.dataset.part, n = this.activeParts.filter((e) => Q.includes(e));
2612
+ let t = e.currentTarget.closest("[data-part]")?.dataset.part, n = this.activeParts.filter((e) => qt.includes(e));
2593
2613
  this.movePart(t, n.indexOf(t) + (e.key === "ArrowUp" ? -1 : 1));
2594
2614
  }
2595
2615
  handleActiveSettingChange() {
@@ -2675,7 +2695,7 @@ var Ut = X, Z, Wt = {
2675
2695
  this.activeSetting === e.target.localName && (this.activeSetting = "");
2676
2696
  }
2677
2697
  get autoResolvedProxyId() {
2678
- let e = he(this.asset?.extension, this.asset?.size);
2698
+ let e = fe(this.asset?.extension, this.asset?.size);
2679
2699
  return this.proxies?.find((t) => t.proxyName === e)?.id ?? "";
2680
2700
  }
2681
2701
  onProxyChange(e) {
@@ -2696,7 +2716,7 @@ var Ut = X, Z, Wt = {
2696
2716
  });
2697
2717
  else {
2698
2718
  let e = this.focusModes.find((e) => e.value === this.cropSize.focusMode)?.auto, n = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, i = this.cropSize.x, a = this.cropSize.y;
2699
- t === "free" ? (n = !1, r = "manual") : this.cropSize.unit === k.Pixel && !e && (i = 0, a = 0), e ? await this.handleRequestAutoCropSuggestion({
2719
+ t === "free" ? (n = !1, this.cropperElement && (r = "manual")) : this.cropSize.unit === k.Pixel && !e && (i = 0, a = 0), this.focusModes.find((e) => e.value === r)?.auto && this.selectedFormat?.url ? await this.handleRequestAutoCropSuggestion({
2700
2720
  cropMode: t,
2701
2721
  focusMode: r,
2702
2722
  height: this.cropSize.height,
@@ -2733,7 +2753,7 @@ var Ut = X, Z, Wt = {
2733
2753
  async onCropChange(e) {
2734
2754
  let t = this.cropSize.unit;
2735
2755
  if (e.detail.unit === k.AspectRatio) {
2736
- let t = e.detail.width / e.detail.height, n = this.asset ? Math.min(Math.max(Math.round(this.cropSize.height * t), 0), this.resizeSize.width) : 0, r = this.asset ? Math.min(Math.max(Math.round(n / t), 0), this.resizeSize.height) : 0, i = this.asset ? r * 100 / this.selectedFormat.height : 100, a = this.asset ? n * 100 / this.selectedFormat.width : 100, o = this.cropSize.x, s = this.cropSize.y;
2756
+ let t = e.detail.width / e.detail.height, n = this.asset ? Math.min(Math.max(Math.round(this.cropSize.height * t), 1), this.resizeSize.width) : 0, r = this.asset ? Math.min(Math.max(Math.round(n / t), 1), this.resizeSize.height) : 0, i = this.asset ? r * 100 / this.selectedFormat.height : 100, a = this.asset ? n * 100 / this.selectedFormat.width : 100, o = this.cropSize.x, s = this.cropSize.y;
2737
2757
  o + a > 100 && (o = 100 - a), s + i > 100 && (s = 100 - i);
2738
2758
  let c = this.cropSize.cropMode, l = this.cropModes.find((e) => e.value === c)?.auto, u = /^(\d+):(\d+)$/.exec(c), d = u !== null && !e.detail.keepAspectRatio && Number(u[1]) * e.detail.height !== Number(u[2]) * e.detail.width;
2739
2759
  (l || d) && (c = "free"), e.detail.silent ? (this.cropSize.height = r, this.cropSize.keepAspectRatio = e.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = a, this.cropSize.ratioHeight = e.detail.height, this.cropSize.ratioWidth = e.detail.width, this.cropSize.unit = k.AspectRatio, this.cropSize.width = n) : this.cropSize = {
@@ -2857,12 +2877,21 @@ var Ut = X, Z, Wt = {
2857
2877
  }
2858
2878
  }]);
2859
2879
  }
2880
+ getRatioResizePreviewSize(e, t) {
2881
+ let { height: n, width: r } = this.imageSize;
2882
+ if (this.asset && r && n) return Z.fitRatioResizeSize(e, t, r, n);
2883
+ let i = e / t, a = Math.max(Math.round(this.lastResizeSize[k.Pixel].height * i), 0);
2884
+ return {
2885
+ height: Math.max(Math.round(a / i), 0),
2886
+ width: a
2887
+ };
2888
+ }
2860
2889
  onResizeChange(e) {
2861
2890
  if (e.detail.unit === k.AspectRatio) {
2862
- let t = e.detail.width / e.detail.height, n = Math.max(Math.round(this.lastResizeSize[k.Pixel].height * t), 0), r = Math.max(Math.round(n / t), 0);
2891
+ let { height: t, width: n } = this.getRatioResizePreviewSize(e.detail.width, e.detail.height);
2863
2892
  this.resizeSize = {
2864
2893
  ...this.resizeSize,
2865
- height: r,
2894
+ height: t,
2866
2895
  keepAspectRatio: e.detail.keepAspectRatio,
2867
2896
  ratioHeight: e.detail.height,
2868
2897
  ratioWidth: e.detail.width,
@@ -2905,7 +2934,7 @@ var Ut = X, Z, Wt = {
2905
2934
  }
2906
2935
  if (!this.selectedFormat) return;
2907
2936
  let i = this.selectedFormat.width || this.defaultSize.width, a = this.selectedFormat.height || this.defaultSize.height, o = r, s = t;
2908
- this.resizeSize.unit === n ? n === k.AspectRatio && (o = Math.round(r / t * a), s = a) : (o = i, s = a), this.transformations = [...this.transformations, {
2937
+ this.resizeSize.unit === n ? n === k.AspectRatio && ({height: s, width: o} = Z.fitRatioResizeSize(r, t, i, a)) : (o = i, s = a), this.transformations = [...this.transformations, {
2909
2938
  key: O.Resize,
2910
2939
  value: {
2911
2940
  height: s,
@@ -3074,11 +3103,11 @@ var Ut = X, Z, Wt = {
3074
3103
  }
3075
3104
  render() {
3076
3105
  return e`<div class="asset-link-format ${this.isFormatsLayout ? "asset-link-format--formats" : ""}" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${this.renderHeader()}
3077
- ${this.renderOrderHint()}<div class="asset-link-format__panels">${S(this.activeParts, (e) => e, (t) => e`<div class="asset-link-format__panel" data-part=${t} ?data-reorderable=${this.canReorder && Q.includes(t)}>${m(this.canReorder && Q.includes(t), () => e`<cx-icon-button class="asset-link-format__drag-handle" name="drag_indicator" label=${this.localize.term("reorderTransformation", this.localize.term(t))} ?disabled=${this.loading} @keydown=${this.handleReorderKeyDown}></cx-icon-button>`)}
3106
+ ${this.renderOrderHint()}<div class="asset-link-format__panels">${S(this.activeParts, (e) => e, (t) => e`<div class="asset-link-format__panel" data-part=${t} ?data-reorderable=${this.canReorder && qt.includes(t)}>${m(this.canReorder && qt.includes(t), () => e`<cx-icon-button class="asset-link-format__drag-handle" name="drag_indicator" label=${this.localize.term("reorderTransformation", this.localize.term(t))} ?disabled=${this.loading} @keydown=${this.handleReorderKeyDown}></cx-icon-button>`)}
3078
3107
  ${this.renderPart(t)}</div>`)}</div><span class="asset-link-format__announcement" role="status" aria-live="polite">${this.reorderAnnouncement}</span>${m(this.useCustomExtension, () => e`<cx-asset-link-format-extension .items=${this.extensions} value=${this.selectedFormat?.extension ?? ""} @cx-asset-link-format-extension-change=${this.onExtensionChange}></cx-asset-link-format-extension>`)}<div class="asset-link-format__footer"><slot name="footer"></slot></div></div>`;
3079
3108
  }
3080
3109
  };
3081
- a([r({
3110
+ a([c(".sortable-fallback"), o("design:type", Object)], $.prototype, "dragCopy", void 0), a([c(".asset-link-format__panel--placeholder"), o("design:type", Object)], $.prototype, "draggedPanel", void 0), a([r({
3082
3111
  attribute: "base-url",
3083
3112
  type: String
3084
3113
  }), o("design:type", Object)], $.prototype, "baseUrl", void 0), a([r({
@@ -3134,12 +3163,12 @@ a([r({
3134
3163
  type: Boolean
3135
3164
  }), o("design:type", Boolean)], $.prototype, "useCustomExtension", void 0), a([r({
3136
3165
  attribute: "parts",
3137
- converter: Oe,
3166
+ converter: ke,
3138
3167
  type: Array
3139
3168
  }), o("design:type", Array)], $.prototype, "parts", void 0), a([r({
3140
3169
  reflect: !0,
3141
3170
  type: String
3142
- }), o("design:type", _e === void 0 ? Object : _e)], $.prototype, "layout", void 0), a([r({
3171
+ }), o("design:type", ve === void 0 ? Object : ve)], $.prototype, "layout", void 0), a([r({
3143
3172
  attribute: "crop-enabled",
3144
3173
  reflect: !0,
3145
3174
  type: Boolean
@@ -3193,6 +3222,6 @@ a([r({
3193
3222
  o("design:paramtypes", []),
3194
3223
  o("design:returntype", void 0)
3195
3224
  ], $.prototype, "handleReorderableChange", null), $ = Z = a([u("cx-asset-link-format"), o("design:paramtypes", [])], $);
3196
- var qt = $;
3225
+ var Jt = $;
3197
3226
  //#endregion
3198
- export { ct as C, ht as S, Ae as T, qe as _, Ze as a, ft as b, I as c, Qe as d, We as f, Ke as g, L as h, xt as i, He as l, $e as m, wt as n, Be as o, Ge as p, St as r, F as s, qt as t, Ue as u, Je as v, je as w, _t as x, gt as y };
3227
+ export { lt as C, gt as S, je as T, Je as _, Qe as a, pt as b, I as c, $e as d, Ge as f, qe as g, L as h, St as i, Ue as l, et as m, Tt as n, Ve as o, Ke as p, Ct as r, F as s, Jt as t, We as u, Ye as v, Me as w, vt as x, _t as y };