@orangelogic/design-system 3.11.0 → 3.12.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.
- package/library/chunks/{asset-link-format.CxDu37Om.js → asset-link-format.f7Khv8SZ.js} +129 -128
- package/library/chunks/{color-swatch-group.DGPlxYsp.js → color-swatch-group.Ib1WYbMl.js} +2 -2
- package/library/chunks/{document-viewer.DhJ4jBNe.js → document-viewer.CMET1HRd.js} +2 -2
- package/library/chunks/{image.1ufrCtW1.js → image.rtjsax7e.js} +1 -1
- package/library/chunks/{index.BAJfz5QI.js → index.BBLDucoY.js} +4 -4
- package/library/chunks/{toast.CCWVobz5.js → toast.CGIDPKV8.js} +1 -1
- package/library/chunks/transformation.OaRYixzE.js +385 -0
- package/library/chunks/{types.D0NvE1EB.js → types.IAKAUHSg.js} +4733 -4721
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +2 -2
- package/library/components/color-swatch-group.js +3 -3
- package/library/components/document-viewer.js +2 -2
- package/library/components/image.js +1 -1
- package/library/components/masonry.js +1 -1
- package/library/components/organisms.js +2 -2
- package/library/components/types.js +130 -131
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/blocks/video/video.d.ts +1 -0
- package/library/packages/utils/src/transformation/transformation.d.ts +10 -29
- package/library/utils.js +94 -95
- package/package.json +1 -1
- package/library/chunks/transformation.D27sTUdZ.js +0 -392
|
@@ -7,7 +7,7 @@ import { C as Et } from "./button.-Jl_NdgM.js";
|
|
|
7
7
|
import { C as Dn, o as Mn, O as Fn } from "./dialog.YFc-HBc5.js";
|
|
8
8
|
import { C as oi } from "./icon-button.ENVA7x3u.js";
|
|
9
9
|
import Pt from "../components/tooltip.js";
|
|
10
|
-
import { i as Wr, r as Ln, f as Jt, m as zn, a as _n, t as jr, g as On, b as An, c as Pn } from "./toast.
|
|
10
|
+
import { i as Wr, r as Ln, f as Jt, m as zn, a as _n, t as jr, g as On, b as An, c as Pn } from "./toast.CGIDPKV8.js";
|
|
11
11
|
import { c as Ie } from "./custom-element.L4WJXn1j.js";
|
|
12
12
|
import { L as tt } from "./i18n.CNnI4-0K.js";
|
|
13
13
|
import { b as In, S as Hn, c as Vo, p as Nn, w as V, E as Vn } from "./watch.DJF5K-8U.js";
|
|
@@ -47,7 +47,7 @@ import "./browser.BHOCIF_A.js";
|
|
|
47
47
|
import "./form.C8LMdQB4.js";
|
|
48
48
|
import "./purify.es.BIuh5IAZ.js";
|
|
49
49
|
import { D as Yr, a as la, t as ha, b as Zr } from "./date-picker.BGHn6qg8.js";
|
|
50
|
-
import { D as Ti } from "./transformation.
|
|
50
|
+
import { D as Ti } from "./transformation.OaRYixzE.js";
|
|
51
51
|
import { s as P, h as $o, b as Ui, c as lo } from "./string.Demn8Xmk.js";
|
|
52
52
|
import { a as ca } from "./_commonjsHelpers.DQNKXVTB.js";
|
|
53
53
|
import { d as da } from "./debounce.Bv1rtE8D.js";
|
|
@@ -23,7 +23,7 @@ import { L as LocalizeController } from "./i18n.CNnI4-0K.js";
|
|
|
23
23
|
import "./purify.es.BIuh5IAZ.js";
|
|
24
24
|
import { w as watch } from "./watch.DJF5K-8U.js";
|
|
25
25
|
import "./date-picker.BGHn6qg8.js";
|
|
26
|
-
import {
|
|
26
|
+
import { f as fetchCortexApi } from "./transformation.OaRYixzE.js";
|
|
27
27
|
import "./unsafe-html.Dff7-rCx.js";
|
|
28
28
|
import { r as reactExports, a as React, j as jsxRuntimeExports, w, R as ReactDOM } from "./jsx-runtime.CTpPVMxj.js";
|
|
29
29
|
import { a as getDefaultExportFromCjs, c as commonjsGlobal } from "./_commonjsHelpers.DQNKXVTB.js";
|
|
@@ -34,7 +34,7 @@ import { a as ObjectFit } from "./index.Cpamj0jB.js";
|
|
|
34
34
|
import { r as r$1 } from "./state.CSDxrqLd.js";
|
|
35
35
|
import { e } from "./class-map.BiVq-cVR.js";
|
|
36
36
|
import { n as n$1 } from "./when.Dr1es41R.js";
|
|
37
|
-
import { C as CxImage } from "./image.
|
|
37
|
+
import { C as CxImage } from "./image.rtjsax7e.js";
|
|
38
38
|
var BookReaderMode$1 = /* @__PURE__ */ ((l) => (l.Image = "Image", l.Pdf = "Pdf", l))(BookReaderMode$1 || {}), BookReaderViewMode = /* @__PURE__ */ ((l) => (l.FourPage = "FourPage", l.OnePage = "OnePage", l.TwoPage = "TwoPage", l))(BookReaderViewMode || {});
|
|
39
39
|
function commonjsRequire(l) {
|
|
40
40
|
throw new Error('Could not dynamically require "' + l + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
@@ -741,7 +741,7 @@ let n = class extends Re {
|
|
|
741
741
|
})} src=${this.applyRetryCacheBust(this.currentSrc) || this.placeholder} alt="" aria-hidden="true" decoding="async" draggable="false" crossorigin=${R(this.crossorigin)}>`
|
|
742
742
|
)}</div>${A(this.showPlaceholderSkeleton, () => L`<slot name="skeleton" part="skeleton"><div class=${S({
|
|
743
743
|
skeleton: !0
|
|
744
|
-
})}><cx-skeleton effect="
|
|
744
|
+
})}><cx-skeleton effect="none" role="status" aria-live="polite" aria-label=${this.localize.term("loading")}></cx-skeleton></div></slot>`)}
|
|
745
745
|
${A(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>${A(this.resizable && this.isResizeActive, () => this.renderResizer())}</div>`;
|
|
746
746
|
}
|
|
747
747
|
};
|
|
@@ -2,7 +2,7 @@ import { C as Z } from "./typography.IqHbnd3C.js";
|
|
|
2
2
|
import { n as y, C as ee } from "./lib-cortex-element.CVMmyPMC.js";
|
|
3
3
|
import { c as ae } from "./component.styles.CRO4Odto.js";
|
|
4
4
|
import { C as Ee, s as ve, F as Q, a as Ce } from "./folder-select.Hl51n0ge.js";
|
|
5
|
-
import {
|
|
5
|
+
import { e as U, S as n1, E as le } from "./transformation.OaRYixzE.js";
|
|
6
6
|
import { c as ie } from "./custom-element.L4WJXn1j.js";
|
|
7
7
|
import { L as W } from "./i18n.CNnI4-0K.js";
|
|
8
8
|
import { w as O } from "./watch.DJF5K-8U.js";
|
|
@@ -13,7 +13,7 @@ import { b as Ke } from "./_baseIteratee.sC2wLi2m.js";
|
|
|
13
13
|
import { a as c1 } from "./toString.B1zKIiZc.js";
|
|
14
14
|
import { b as d1 } from "./cloneDeep.tKGbEwzn.js";
|
|
15
15
|
import { c as s1 } from "./_baseClone.ipmFlCAx.js";
|
|
16
|
-
import { I as je, C as Ve, a as o1, b as He, S as z, D as h1, c as g1, A as Ie, g as l1, i as C1, F as y1, d as x1, t as b1, e as k1, f as p1, h as u1, j as f1, k as A1, l as B1, m as D1, n as F1, o as E1, p as v1, q as $1, r as w1, O as S1 } from "./types.
|
|
16
|
+
import { I as je, C as Ve, a as o1, b as He, S as z, D as h1, c as g1, A as Ie, g as l1, i as C1, F as y1, d as x1, t as b1, e as k1, f as p1, h as u1, j as f1, k as A1, l as B1, m as D1, n as F1, o as E1, p as v1, q as $1, r as w1, O as S1 } from "./types.IAKAUHSg.js";
|
|
17
17
|
import { C as ce } from "./button.-Jl_NdgM.js";
|
|
18
18
|
import _1 from "../components/button-group.js";
|
|
19
19
|
import I1 from "../components/card.js";
|
|
@@ -59,11 +59,11 @@ import { n as v } from "./when.Dr1es41R.js";
|
|
|
59
59
|
import { a as g0 } from "./_baseXor.DixEm6JQ.js";
|
|
60
60
|
import { a as l0, i as Le, b as C0 } from "./isArrayLikeObject.D7afXo-f.js";
|
|
61
61
|
import { i as y0 } from "./isEmpty.DtTJTUcf.js";
|
|
62
|
-
import { a as Ae, F as x0, b as b0, c as qe, d as Oe, i as k0, e as Me, u as Be } from "./asset-link-format.
|
|
62
|
+
import { a as Ae, F as x0, b as b0, c as qe, d as Oe, i as k0, e as Me, u as Be } from "./asset-link-format.f7Khv8SZ.js";
|
|
63
63
|
import p0 from "../components/color-picker.js";
|
|
64
64
|
import { C as _e } from "./icon-button.ENVA7x3u.js";
|
|
65
65
|
import u0 from "../components/spinner.js";
|
|
66
|
-
import { a as f0, d as A0 } from "./color-swatch-group.
|
|
66
|
+
import { a as f0, d as A0 } from "./color-swatch-group.Ib1WYbMl.js";
|
|
67
67
|
import { c as ne, C as me, p as B0, a as D0, b as F0, g as ye } from "./color.LzSGBy7o.js";
|
|
68
68
|
import { o as e1 } from "./map.D8heArFD.js";
|
|
69
69
|
import { v as a1 } from "./v4.CKZ6klMF.js";
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { c as k } from "./capitalize.CIBKBL10.js";
|
|
2
|
+
import { C as $, T as R, U as M } from "./asset-link-format.ClaYu_v8.js";
|
|
3
|
+
import { P as v } from "./position-picker.DjnhxIKF.js";
|
|
4
|
+
const y = window.location.origin.includes("localhost:") ? "https://local.orangelogic.com" : window.location.origin;
|
|
5
|
+
function ae(e, i, n, u = y) {
|
|
6
|
+
const c = new URL(u + "/" + e);
|
|
7
|
+
return Array.isArray(n) ? n.forEach((a) => {
|
|
8
|
+
a[1] && c.searchParams.append(a[0], a[1]);
|
|
9
|
+
}) : n && Object.keys(n).forEach((a) => {
|
|
10
|
+
n[a] && c.searchParams.append(a, n[a]);
|
|
11
|
+
}), fetch(c, i);
|
|
12
|
+
}
|
|
13
|
+
const oe = "space-default";
|
|
14
|
+
var L = /* @__PURE__ */ ((e) => (e.Desktop = "desktop", e.Mobile = "mobile", e.Tablet = "tablet", e))(L || {});
|
|
15
|
+
const w = {
|
|
16
|
+
canvasWidth: "",
|
|
17
|
+
height: "",
|
|
18
|
+
id: "desktop",
|
|
19
|
+
maxWidth: "",
|
|
20
|
+
name: k(
|
|
21
|
+
"desktop"
|
|
22
|
+
/* Desktop */
|
|
23
|
+
)
|
|
24
|
+
}, F = {
|
|
25
|
+
canvasWidth: "770px",
|
|
26
|
+
height: "",
|
|
27
|
+
id: "tablet",
|
|
28
|
+
maxWidth: "1280px",
|
|
29
|
+
name: k(
|
|
30
|
+
"tablet"
|
|
31
|
+
/* Tablet */
|
|
32
|
+
)
|
|
33
|
+
}, W = {
|
|
34
|
+
canvasWidth: "320px",
|
|
35
|
+
height: "",
|
|
36
|
+
id: "mobile",
|
|
37
|
+
maxWidth: "480px",
|
|
38
|
+
name: k(
|
|
39
|
+
"mobile"
|
|
40
|
+
/* Mobile */
|
|
41
|
+
)
|
|
42
|
+
}, re = [w, F, W];
|
|
43
|
+
var B = /* @__PURE__ */ ((e) => (e.All = "ALL", e.CanDelete = "CanDelete", e.CanDownload = "CanDownload", e.CanFind = "CanFind", e.CanManageRights = "CanManageRights", e.CanMove = "CanMove", e.CanRead = "CanRead", e.CanReadAll = "CanReadAll", e.CanReadAndWrite = "CanReadAndWrite", e.CanReadLarge = "CanReadLarge", e.CanReadMedium = "CanReadMedium", e.CanReadOriginal = "CanReadOriginal", e.CanShare = "CanShare", e.CanUpload = "CanUpload", e.CanWrite = "CanWrite", e.None = "NONE", e))(B || {}), D = /* @__PURE__ */ ((e) => (e.All = "all", e.Audio = "audio", e.Image = "image", e.Other = "other", e.Video = "video", e))(D || {}), U = /* @__PURE__ */ ((e) => (e.Content = "content", e.Template = "template", e))(U || {}), G = /* @__PURE__ */ ((e) => (e.Administrator = "Administrator", e.Designer = "Designer", e.Editor = "Editor", e))(G || {}), I = /* @__PURE__ */ ((e) => (e.Accordion = "BlockAccordion", e.Analytics = "BlockAnalytics", e.Audio = "BlockAudio", e.Button = "BlockButton", e.Carousel = "BlockCarousel", e.ColorSwatches = "BlockColorSwatches", e.Column = "BlockCell", e.ColumnGroup = "BlockColumns", e.DamView = "BlockDamView", e.Divider = "BlockDivider", e.DocumentViewer = "BlockDocumentViewer", e.FontKit = "BlockFontKit", e.Gallery = "BlockGallery", e.Header = "BlockHeader", e.Image = "BlockImage", e.RichText = "BlockRichText", e.SearchBox = "BlockSearchBox", e.TabGroup = "BlockTabs", e.Text = "BlockText", e.Timeline = "BlockTimeline", e.Video = "BlockVideo", e))(I || {});
|
|
44
|
+
const se = Object.values(I).filter(
|
|
45
|
+
(e) => e !== "BlockCell"
|
|
46
|
+
/* Column */
|
|
47
|
+
);
|
|
48
|
+
var K = /* @__PURE__ */ ((e) => (e.Carousel = "carousel", e.Gallery = "gallery", e))(K || {}), j = /* @__PURE__ */ ((e) => (e.Templates = "TEMPLATES", e.TranslatableAttributes = "TRANSLATABLE_ATTRIBUTES", e.TranslatableTexts = "TRANSLATABLE_TEXTS", e))(j || {});
|
|
49
|
+
const _ = "/AssetLink/", V = {
|
|
50
|
+
[v.BottomCenter]: $.South,
|
|
51
|
+
[v.BottomLeft]: $.Southwest,
|
|
52
|
+
[v.BottomRight]: $.Southeast,
|
|
53
|
+
[v.CenterCenter]: $.Center,
|
|
54
|
+
[v.CenterLeft]: $.West,
|
|
55
|
+
[v.CenterRight]: $.East,
|
|
56
|
+
[v.TopCenter]: $.North,
|
|
57
|
+
[v.TopLeft]: $.Northwest,
|
|
58
|
+
[v.TopRight]: $.Northeast
|
|
59
|
+
}, g = "/t/", X = [400, 800, 1200, 1600, 2400], z = 0.15;
|
|
60
|
+
function H({
|
|
61
|
+
asset: e,
|
|
62
|
+
baseUrl: i,
|
|
63
|
+
extension: n,
|
|
64
|
+
options: u,
|
|
65
|
+
parameters: c,
|
|
66
|
+
transformations: a,
|
|
67
|
+
useSession: h = ""
|
|
68
|
+
}) {
|
|
69
|
+
if (i == null)
|
|
70
|
+
return "";
|
|
71
|
+
let r = i;
|
|
72
|
+
const f = a?.findLast(
|
|
73
|
+
(l) => l.key === R.Quality
|
|
74
|
+
);
|
|
75
|
+
if (f && (a = [
|
|
76
|
+
...a?.filter(
|
|
77
|
+
(l) => l.key !== R.Quality
|
|
78
|
+
) || [],
|
|
79
|
+
f
|
|
80
|
+
]), a) {
|
|
81
|
+
const l = [];
|
|
82
|
+
for (let t = 0; t < a.length; t++) {
|
|
83
|
+
const d = a[t];
|
|
84
|
+
if (d.key === R.Rotate) {
|
|
85
|
+
let o = d.value.rotation ?? 0;
|
|
86
|
+
for (; a[t + 1]?.key === R.Rotate; )
|
|
87
|
+
t++, o += a[t].value.rotation ?? 0;
|
|
88
|
+
o !== 0 && l.push({ key: R.Rotate, value: { rotation: o } });
|
|
89
|
+
} else
|
|
90
|
+
l.push(d);
|
|
91
|
+
}
|
|
92
|
+
a = l;
|
|
93
|
+
}
|
|
94
|
+
a && a.length > 0 && (r += "/t/"), a?.forEach(({ key: l, value: t }) => {
|
|
95
|
+
if (l === R.Resize) {
|
|
96
|
+
if (t.unit === M.AspectRatio && t.ratioWidth && t.ratioHeight) {
|
|
97
|
+
r += `re_ar_${t.ratioWidth}:${t.ratioHeight}/`;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const d = [
|
|
101
|
+
...[
|
|
102
|
+
{
|
|
103
|
+
key: "re_w_",
|
|
104
|
+
value: Math.round(t.width ?? 0)
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: "re_h_",
|
|
108
|
+
value: Math.round(t.height ?? 0)
|
|
109
|
+
}
|
|
110
|
+
].filter((o) => o.value !== void 0).map((o) => ({
|
|
111
|
+
key: o.key,
|
|
112
|
+
value: Math.round(Number(o.value))
|
|
113
|
+
})),
|
|
114
|
+
{
|
|
115
|
+
key: "re_rm_",
|
|
116
|
+
value: "stretch"
|
|
117
|
+
}
|
|
118
|
+
];
|
|
119
|
+
d.forEach(({ key: o, value: m }, A) => {
|
|
120
|
+
r += `${o}${m}${A < d.length - 1 ? "," : ""}`;
|
|
121
|
+
}), r += "/";
|
|
122
|
+
}
|
|
123
|
+
if (l === R.Crop) {
|
|
124
|
+
const d = t.unit === M.AspectRatio && !!t.ratioWidth && !!t.ratioHeight, o = !t.disabledSize && !d, m = o && (t.x !== void 0 || t.y !== void 0), A = [
|
|
125
|
+
...[
|
|
126
|
+
{
|
|
127
|
+
key: "c_",
|
|
128
|
+
value: t.mode
|
|
129
|
+
},
|
|
130
|
+
...d ? [
|
|
131
|
+
{
|
|
132
|
+
key: "ar_",
|
|
133
|
+
value: `${t.ratioWidth}:${t.ratioHeight}`
|
|
134
|
+
}
|
|
135
|
+
] : [],
|
|
136
|
+
...o ? [
|
|
137
|
+
{
|
|
138
|
+
key: "c_w_",
|
|
139
|
+
value: Math.round(t.width ?? 0)
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
key: "c_h_",
|
|
143
|
+
value: Math.round(t.height ?? 0)
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
key: "c_x_",
|
|
147
|
+
value: Math.round(t.x ?? 0) === 0 && u?.omitZeroXY ? void 0 : Math.round(t.x ?? 0)
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
key: "c_y_",
|
|
151
|
+
value: Math.round(t.y ?? 0) === 0 && u?.omitZeroXY ? void 0 : Math.round(t.y ?? 0)
|
|
152
|
+
}
|
|
153
|
+
] : [],
|
|
154
|
+
...!m && t.focusMode && t.focusMode !== "manual" ? [
|
|
155
|
+
{
|
|
156
|
+
key: t.isFocusModeAuto ? "acm_" : "c_g_",
|
|
157
|
+
value: t.focusMode
|
|
158
|
+
}
|
|
159
|
+
] : [],
|
|
160
|
+
...!m && t.focusMode === "manual" && t.position ? [
|
|
161
|
+
{
|
|
162
|
+
key: "c_g_",
|
|
163
|
+
value: V[t.position]
|
|
164
|
+
}
|
|
165
|
+
] : []
|
|
166
|
+
].filter((C) => C.value !== void 0 && C.value !== null).map((C) => ({
|
|
167
|
+
key: C.key,
|
|
168
|
+
value: C.value
|
|
169
|
+
})),
|
|
170
|
+
...d ? [] : [
|
|
171
|
+
{
|
|
172
|
+
key: "c_whu_",
|
|
173
|
+
value: "pixel"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
];
|
|
177
|
+
A.forEach(({ key: C, value: b }, x) => {
|
|
178
|
+
const p = ["c_w_", "c_h_", "c_x_", "c_y_"].includes(C);
|
|
179
|
+
r += `${C}${p ? Math.round(Number(b)) : b}${x < A.length - 1 ? "," : ""}`;
|
|
180
|
+
}), r += "/";
|
|
181
|
+
}
|
|
182
|
+
if (l === R.Rotate && ([
|
|
183
|
+
{
|
|
184
|
+
key: "r_a_",
|
|
185
|
+
value: t.rotation
|
|
186
|
+
}
|
|
187
|
+
].filter((o) => o.value !== void 0).map((o) => ({
|
|
188
|
+
key: o.key,
|
|
189
|
+
value: Math.round(Number(o.value))
|
|
190
|
+
})).forEach(({ key: o, value: m }) => {
|
|
191
|
+
r += `${o}${m}`;
|
|
192
|
+
}), r += "/"), l === R.Quality) {
|
|
193
|
+
const d = [
|
|
194
|
+
{
|
|
195
|
+
key: "q_level_",
|
|
196
|
+
value: t.quality
|
|
197
|
+
}
|
|
198
|
+
].filter((o) => o.value !== void 0).map((o) => ({
|
|
199
|
+
key: o.key,
|
|
200
|
+
value: Math.round(Number(o.value))
|
|
201
|
+
}));
|
|
202
|
+
d.forEach(({ key: o, value: m }, A) => {
|
|
203
|
+
r += `${o}${m}${A < d.length - 1 ? "," : ""}`;
|
|
204
|
+
}), r += "/";
|
|
205
|
+
}
|
|
206
|
+
if (l === R.Metadata) {
|
|
207
|
+
const d = [
|
|
208
|
+
{
|
|
209
|
+
key: "fl_keep_metadata",
|
|
210
|
+
value: t.keepMetadata
|
|
211
|
+
}
|
|
212
|
+
].filter((o) => o.value !== void 0).map((o) => ({ key: o.key, value: o.value }));
|
|
213
|
+
d.forEach(({ key: o }, m) => {
|
|
214
|
+
r += `${o}${m < d.length - 1 ? "," : ""}`;
|
|
215
|
+
}), r += "/";
|
|
216
|
+
}
|
|
217
|
+
}), n && (r += `${e?.identifier ?? crypto.randomUUID()}${n}`);
|
|
218
|
+
const s = [];
|
|
219
|
+
return c && c.length > 0 && c.forEach(({ key: l, value: t }) => {
|
|
220
|
+
s.push(
|
|
221
|
+
`${encodeURIComponent(l.trim())}=${encodeURIComponent(t.trim())}`
|
|
222
|
+
);
|
|
223
|
+
}), i && h && s.push(`UseSession=${encodeURIComponent(h)}`), s.length > 0 && (r += `?${s.join("&")}`), r.endsWith("/") && (r = r.slice(0, -1)), r;
|
|
224
|
+
}
|
|
225
|
+
const E = ".auto";
|
|
226
|
+
function ce(e, i, n = {}) {
|
|
227
|
+
const u = n.format === T && S(n.extension), c = !!n.autoFormat && !u;
|
|
228
|
+
if (!e || !i?.length && !c)
|
|
229
|
+
return e;
|
|
230
|
+
const a = i?.length ? H({ baseUrl: "", transformations: i }).replace(/\/t\//g, "") : "";
|
|
231
|
+
if (!a && !c)
|
|
232
|
+
return e;
|
|
233
|
+
const h = e.indexOf(_);
|
|
234
|
+
if (h < 0)
|
|
235
|
+
return a ? `${e}${g}${a}` : e;
|
|
236
|
+
const r = e.slice(0, h + _.length), f = e.slice(h + _.length);
|
|
237
|
+
if (!f)
|
|
238
|
+
return e;
|
|
239
|
+
const s = f.indexOf(g), l = s >= 0, t = f.indexOf("/"), d = l ? s : t, o = d >= 0 ? f.slice(0, d) : f, m = l ? f.slice(s + g.length) : t >= 0 ? f.slice(t + 1) : "", A = m.slice(m.lastIndexOf("/") + 1), C = A ? `${A.replace(/\.[^.]+$/, "")}${E}` : `${o.replace(/\.[^.]+$/, "")}${E}`, x = [a, c ? C : l ? "" : A].filter(
|
|
240
|
+
Boolean
|
|
241
|
+
);
|
|
242
|
+
return x.length === 0 ? e : `${r}${o}${g}${x.join("/")}`;
|
|
243
|
+
}
|
|
244
|
+
function Y(e) {
|
|
245
|
+
return `re_w_${Math.round(e)}`;
|
|
246
|
+
}
|
|
247
|
+
function q(e, i) {
|
|
248
|
+
if (!e || !Number.isFinite(i) || i <= 0)
|
|
249
|
+
return e;
|
|
250
|
+
const n = e.indexOf(_);
|
|
251
|
+
if (n < 0)
|
|
252
|
+
return e;
|
|
253
|
+
const u = Y(i), c = e.slice(0, n + _.length), a = e.slice(n + _.length), h = a.indexOf(g);
|
|
254
|
+
if (h >= 0) {
|
|
255
|
+
const f = a.slice(0, h), s = a.slice(
|
|
256
|
+
h + g.length
|
|
257
|
+
);
|
|
258
|
+
return `${c}${f}${g}${u}/${s}`;
|
|
259
|
+
}
|
|
260
|
+
const r = a.indexOf("/");
|
|
261
|
+
if (r >= 0) {
|
|
262
|
+
const f = a.slice(0, r), s = a.slice(r);
|
|
263
|
+
return `${c}${f}${g}${u}${s}`;
|
|
264
|
+
}
|
|
265
|
+
return `${c}${a}${g}${u}`;
|
|
266
|
+
}
|
|
267
|
+
function le(e) {
|
|
268
|
+
const i = e.indexOf(_);
|
|
269
|
+
return i < 0 ? !1 : e.slice(i + _.length).includes(g);
|
|
270
|
+
}
|
|
271
|
+
function Q(e) {
|
|
272
|
+
const i = e.indexOf(_);
|
|
273
|
+
if (i < 0)
|
|
274
|
+
return !1;
|
|
275
|
+
const n = e.slice(i + _.length), u = n.indexOf(g);
|
|
276
|
+
return u < 0 ? !1 : n.slice(u + g.length).includes("/");
|
|
277
|
+
}
|
|
278
|
+
const T = "TRX", N = "TR1", Z = /* @__PURE__ */ new Set([
|
|
279
|
+
"avif",
|
|
280
|
+
"bmp",
|
|
281
|
+
"gif",
|
|
282
|
+
"ico",
|
|
283
|
+
"jpeg",
|
|
284
|
+
"jpg",
|
|
285
|
+
"png",
|
|
286
|
+
"svg",
|
|
287
|
+
"tif",
|
|
288
|
+
"tiff",
|
|
289
|
+
"webp"
|
|
290
|
+
]);
|
|
291
|
+
function O(e) {
|
|
292
|
+
if (!e)
|
|
293
|
+
return "";
|
|
294
|
+
const i = e.trim().toLowerCase();
|
|
295
|
+
return i.startsWith(".") ? i.slice(1) : i;
|
|
296
|
+
}
|
|
297
|
+
function S(e) {
|
|
298
|
+
return O(e) === "gif";
|
|
299
|
+
}
|
|
300
|
+
const J = 1e3 * 1024 * 1024, P = {
|
|
301
|
+
b: 1,
|
|
302
|
+
byte: 1,
|
|
303
|
+
bytes: 1,
|
|
304
|
+
gb: 1024 ** 3,
|
|
305
|
+
kb: 1024,
|
|
306
|
+
mb: 1024 ** 2,
|
|
307
|
+
tb: 1024 ** 4
|
|
308
|
+
};
|
|
309
|
+
function ee(e) {
|
|
310
|
+
if (typeof e == "number")
|
|
311
|
+
return Number.isFinite(e) && e >= 0 ? e : void 0;
|
|
312
|
+
if (!e)
|
|
313
|
+
return;
|
|
314
|
+
const i = /^\s*([\d.,]+)\s*([a-z]*)\s*$/i.exec(e);
|
|
315
|
+
if (!i)
|
|
316
|
+
return;
|
|
317
|
+
const n = Number(i[1].replace(/,/g, ""));
|
|
318
|
+
if (!Number.isFinite(n) || n < 0)
|
|
319
|
+
return;
|
|
320
|
+
const u = i[2].toLowerCase();
|
|
321
|
+
if (!u)
|
|
322
|
+
return n;
|
|
323
|
+
const c = P[u];
|
|
324
|
+
return c === void 0 ? void 0 : n * c;
|
|
325
|
+
}
|
|
326
|
+
function de(e, i) {
|
|
327
|
+
if (e)
|
|
328
|
+
return;
|
|
329
|
+
const n = typeof i == "number" ? i : Number(i ?? "");
|
|
330
|
+
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
331
|
+
}
|
|
332
|
+
function ue(e, i) {
|
|
333
|
+
if (!Z.has(O(e)))
|
|
334
|
+
return N;
|
|
335
|
+
const n = ee(i);
|
|
336
|
+
return n !== void 0 && n > J ? N : T;
|
|
337
|
+
}
|
|
338
|
+
function fe(e, i = {}) {
|
|
339
|
+
if (!e.includes(_) || Q(e) || i.format === T && S(i.extension))
|
|
340
|
+
return "";
|
|
341
|
+
const { maxWidth: n, widths: u = X } = i, c = [...u].filter((s) => Number.isFinite(s) && s > 0).sort((s, l) => s - l);
|
|
342
|
+
if (c.length === 0)
|
|
343
|
+
return "";
|
|
344
|
+
let a = c;
|
|
345
|
+
if (n !== void 0 && Number.isFinite(n) && n > 0) {
|
|
346
|
+
const s = c.filter((l) => l <= n);
|
|
347
|
+
a = s.length > 0 ? s : [c[0]];
|
|
348
|
+
}
|
|
349
|
+
const h = n !== void 0 && Number.isFinite(n) && n > 0, f = (h ? a.filter(
|
|
350
|
+
(s) => n > s * (1 + z)
|
|
351
|
+
) : a).map(
|
|
352
|
+
(s) => `${q(e, s)} ${s}w`
|
|
353
|
+
);
|
|
354
|
+
return h && f.push(`${e} ${n}w`), f.join(", ");
|
|
355
|
+
}
|
|
356
|
+
function he(e, i = 100) {
|
|
357
|
+
return !Number.isFinite(e) || e <= 0 ? "" : `${Math.ceil(e / i) * i}px`;
|
|
358
|
+
}
|
|
359
|
+
export {
|
|
360
|
+
D as A,
|
|
361
|
+
I as B,
|
|
362
|
+
L as D,
|
|
363
|
+
U as E,
|
|
364
|
+
B as P,
|
|
365
|
+
oe as S,
|
|
366
|
+
G as T,
|
|
367
|
+
ce as a,
|
|
368
|
+
fe as b,
|
|
369
|
+
de as c,
|
|
370
|
+
H as d,
|
|
371
|
+
K as e,
|
|
372
|
+
ae as f,
|
|
373
|
+
he as g,
|
|
374
|
+
j as h,
|
|
375
|
+
se as i,
|
|
376
|
+
re as j,
|
|
377
|
+
X as k,
|
|
378
|
+
E as l,
|
|
379
|
+
q as m,
|
|
380
|
+
le as n,
|
|
381
|
+
N as o,
|
|
382
|
+
J as p,
|
|
383
|
+
ee as q,
|
|
384
|
+
ue as r
|
|
385
|
+
};
|