@rulecms/widget-svelte 0.8.1 → 0.8.2
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/dist/index.cjs +33 -33
- package/dist/index.js +930 -924
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var zt = Object.defineProperty;
|
|
2
|
+
var Ht = (e, t, r) => t in e ? zt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var Fe = (e, t, r) => Ht(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import "svelte/internal/disclose-version";
|
|
5
5
|
import * as n from "svelte/internal/client";
|
|
6
|
-
import { setContext as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
return !(e != null && e.length) || e ===
|
|
6
|
+
import { setContext as Gt, getContext as Yt, untrack as Xt } from "svelte";
|
|
7
|
+
const re = "default";
|
|
8
|
+
function rt(e, t) {
|
|
9
|
+
return !(e != null && e.length) || e === re ? t : `${e}/${t}`;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
function
|
|
11
|
+
const Jt = `RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-svelte README.`;
|
|
12
|
+
function Ke(e) {
|
|
13
13
|
if (!e || typeof e != "object")
|
|
14
14
|
return !1;
|
|
15
15
|
const t = e;
|
|
16
16
|
return !!t.manifest && typeof t.manifest == "object" && !!t.components && typeof t.components == "object" && !Array.isArray(t.components);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
if (
|
|
18
|
+
function qt(e) {
|
|
19
|
+
if (Ke(e))
|
|
20
20
|
return e;
|
|
21
21
|
const t = e;
|
|
22
|
-
return
|
|
22
|
+
return Ke(t == null ? void 0 : t.default) ? t.default : null;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return e.usesDefaultLibrary ? [
|
|
24
|
+
function he(e) {
|
|
25
|
+
return e.usesDefaultLibrary ? [re, ...e.libraryIds] : [...e.libraryIds];
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
if (t.usesDefaultLibrary && !(e != null && e[
|
|
29
|
-
throw new Error(
|
|
27
|
+
function Be({ registrations: e, referenced: t }) {
|
|
28
|
+
if (t.usesDefaultLibrary && !(e != null && e[re]))
|
|
29
|
+
throw new Error(Jt);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Zt(e) {
|
|
32
32
|
const t = [], r = /* @__PURE__ */ new Set();
|
|
33
33
|
for (const o of e.values()) {
|
|
34
34
|
if (typeof o.stylesheet != "string")
|
|
@@ -38,17 +38,17 @@ function Jt(e) {
|
|
|
38
38
|
}
|
|
39
39
|
return t.length > 0 ? t : void 0;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Qt(e) {
|
|
42
42
|
const t = {};
|
|
43
43
|
for (const [o, s] of e) {
|
|
44
|
-
const i = o ===
|
|
44
|
+
const i = o === re;
|
|
45
45
|
for (const [l, a] of Object.entries(s.components))
|
|
46
46
|
t[i ? l : `${o}/${l}`] = a;
|
|
47
47
|
}
|
|
48
|
-
const r =
|
|
48
|
+
const r = Zt(e);
|
|
49
49
|
return r ? { components: t, stylesheets: r } : { components: t };
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function de() {
|
|
52
52
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
53
53
|
let s = 0;
|
|
54
54
|
function i(u, c) {
|
|
@@ -58,7 +58,7 @@ function ue() {
|
|
|
58
58
|
), e.set(u, c), s += 1);
|
|
59
59
|
}
|
|
60
60
|
function l(u) {
|
|
61
|
-
const c =
|
|
61
|
+
const c = he(u), f = [...c].sort().join("|"), p = o.get(f);
|
|
62
62
|
if (p && p.loadedVersion === s)
|
|
63
63
|
return p.plugin;
|
|
64
64
|
const g = /* @__PURE__ */ new Map();
|
|
@@ -66,13 +66,13 @@ function ue() {
|
|
|
66
66
|
const b = e.get(w);
|
|
67
67
|
b && g.set(w, b);
|
|
68
68
|
}
|
|
69
|
-
const A =
|
|
69
|
+
const A = Qt(g);
|
|
70
70
|
return o.set(f, { loadedVersion: s, plugin: A }), A;
|
|
71
71
|
}
|
|
72
72
|
function a(u) {
|
|
73
|
-
|
|
73
|
+
Be(u);
|
|
74
74
|
const { registrations: c, referenced: f } = u;
|
|
75
|
-
for (const p of
|
|
75
|
+
for (const p of he(f)) {
|
|
76
76
|
if (e.has(p) || r.has(p))
|
|
77
77
|
continue;
|
|
78
78
|
const g = c == null ? void 0 : c[p];
|
|
@@ -89,8 +89,8 @@ function ue() {
|
|
|
89
89
|
return l(f);
|
|
90
90
|
}
|
|
91
91
|
async function d(u) {
|
|
92
|
-
|
|
93
|
-
const { registrations: c, referenced: f } = u, p =
|
|
92
|
+
Be(u);
|
|
93
|
+
const { registrations: c, referenced: f } = u, p = he(f);
|
|
94
94
|
return await Promise.all(
|
|
95
95
|
p.map(async (g) => {
|
|
96
96
|
if (e.has(g) || r.has(g))
|
|
@@ -108,7 +108,7 @@ function ue() {
|
|
|
108
108
|
}
|
|
109
109
|
let w = t.get(g);
|
|
110
110
|
w || (w = A().then((b) => {
|
|
111
|
-
const v =
|
|
111
|
+
const v = qt(b);
|
|
112
112
|
if (!v)
|
|
113
113
|
throw new Error(
|
|
114
114
|
`Registration for libraryId "${g}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`
|
|
@@ -127,20 +127,20 @@ function ue() {
|
|
|
127
127
|
}
|
|
128
128
|
return { resolveSync: a, resolve: d };
|
|
129
129
|
}
|
|
130
|
-
const
|
|
130
|
+
const Ue = {
|
|
131
131
|
Preview: "Preview",
|
|
132
132
|
Compose: "Compose",
|
|
133
133
|
RenderedPage: "RenderedPage"
|
|
134
|
-
},
|
|
134
|
+
}, Ie = {
|
|
135
135
|
DroppableBox: "droppable-box"
|
|
136
|
-
},
|
|
136
|
+
}, ze = {
|
|
137
137
|
FlexStart: "flex-start",
|
|
138
138
|
FlexEnd: "flex-end",
|
|
139
139
|
Center: "center",
|
|
140
140
|
SpaceBetween: "space-between",
|
|
141
141
|
SpaceAround: "space-around",
|
|
142
142
|
SpaceEvenly: "space-evenly"
|
|
143
|
-
},
|
|
143
|
+
}, Ki = {
|
|
144
144
|
FlexStart: "flex-start",
|
|
145
145
|
FlexEnd: "flex-end",
|
|
146
146
|
Center: "center",
|
|
@@ -148,56 +148,56 @@ const Ke = {
|
|
|
148
148
|
SpaceAround: "space-around",
|
|
149
149
|
SpaceEvenly: "space-evenly",
|
|
150
150
|
Stretch: "stretch"
|
|
151
|
-
},
|
|
151
|
+
}, _e = "cssAttrArray", Bi = {
|
|
152
152
|
Phone: "phone",
|
|
153
153
|
Tablet: "tablet",
|
|
154
154
|
Desktop: "desktop"
|
|
155
|
-
},
|
|
155
|
+
}, ot = {
|
|
156
156
|
ComposerComponent: "ComposerWidget",
|
|
157
157
|
Collection: "Collection",
|
|
158
158
|
MoveComponentHandle: "MoveWidgetHandle"
|
|
159
|
-
},
|
|
160
|
-
function
|
|
161
|
-
return typeof e == "string" && e.startsWith(
|
|
159
|
+
}, st = `${ot.Collection}_`, $t = "dev.", en = "https://rulecms.com", tn = "https://widget-cache.rulecms.com", nn = "/api/v1/c/widget/get", rn = "/api/v1/c/dev/widget/get", on = "/api/v1/c/widget/resolve", sn = "/api/v1/c/dev/widget/resolve";
|
|
160
|
+
function H(e) {
|
|
161
|
+
return typeof e == "string" && e.startsWith($t);
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return t ? t.replace(/\/$/, "") :
|
|
163
|
+
function it(e, t) {
|
|
164
|
+
return t ? t.replace(/\/$/, "") : H(e) ? en : tn;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function lt({
|
|
167
167
|
publishedKey: e,
|
|
168
168
|
token: t,
|
|
169
169
|
endpoint: r
|
|
170
170
|
}) {
|
|
171
|
-
const o =
|
|
172
|
-
return `${
|
|
171
|
+
const o = H(t), s = o ? rn : nn, i = o ? new URLSearchParams({ widgetKey: e, token: t }) : new URLSearchParams({ publishedKey: e, token: t });
|
|
172
|
+
return `${it(t, r)}${s}?${i.toString()}`;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function at({
|
|
175
175
|
token: e,
|
|
176
176
|
endpoint: t
|
|
177
177
|
}) {
|
|
178
|
-
const r =
|
|
179
|
-
return `${
|
|
178
|
+
const r = H(e) ? sn : on;
|
|
179
|
+
return `${it(e, t)}${r}`;
|
|
180
180
|
}
|
|
181
|
-
const
|
|
181
|
+
const Ui = ({ id: e, prefix: t }) => `${t}_${e}`, ln = (e) => {
|
|
182
182
|
if (!(e != null && e.length) || !e.includes("_")) {
|
|
183
183
|
console.error(`Invalid drag item id: ${e}. Type does not exist.`);
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
return
|
|
187
|
-
},
|
|
186
|
+
return an(e);
|
|
187
|
+
}, ct = (e) => e.includes("_"), an = (e) => {
|
|
188
188
|
const t = e.indexOf("_"), r = e.substring(0, t), o = e.substring(t + 1);
|
|
189
189
|
return {
|
|
190
190
|
prefix: r,
|
|
191
191
|
id: o
|
|
192
192
|
};
|
|
193
|
-
},
|
|
194
|
-
if (!
|
|
193
|
+
}, ut = (e) => {
|
|
194
|
+
if (!ct(e))
|
|
195
195
|
return;
|
|
196
|
-
const r =
|
|
197
|
-
return (r == null ? void 0 : r.prefix) ===
|
|
196
|
+
const r = ln(e);
|
|
197
|
+
return (r == null ? void 0 : r.prefix) === ot.Collection || console.error(
|
|
198
198
|
"getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."
|
|
199
199
|
), r == null ? void 0 : r.id;
|
|
200
|
-
},
|
|
200
|
+
}, zi = (e) => {
|
|
201
201
|
if (!(e != null && e.length)) {
|
|
202
202
|
console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");
|
|
203
203
|
return;
|
|
@@ -212,12 +212,12 @@ const Ki = ({ id: e, prefix: t }) => `${t}_${e}`, on = (e) => {
|
|
|
212
212
|
return { name: r, instanceId: t[1] };
|
|
213
213
|
const s = t[1].split("@");
|
|
214
214
|
return { name: r, instanceId: s[0], parentId: s[1] };
|
|
215
|
-
},
|
|
215
|
+
}, Hi = (e) => {
|
|
216
216
|
if (!(e != null && e.length))
|
|
217
217
|
return { errorMessage: "getNameFromWidgetKey: Missing widget key" };
|
|
218
218
|
const t = e.split("$");
|
|
219
219
|
return t.length < 2 ? { errorMessage: "getNameFromWidgetKey: Invalid widget key format" } : { name: t[0] };
|
|
220
|
-
},
|
|
220
|
+
}, cn = (e) => {
|
|
221
221
|
var s, i, l, a;
|
|
222
222
|
if (!e)
|
|
223
223
|
return { error: "getWidgetKeyForCollection: Missing collection" };
|
|
@@ -228,7 +228,7 @@ const Ki = ({ id: e, prefix: t }) => `${t}_${e}`, on = (e) => {
|
|
|
228
228
|
return { error: "getWidgetKeyForCollection: Missing collection id" };
|
|
229
229
|
const o = ((a = e.parentId) == null ? void 0 : a.length) ? `${e.id}@${e.parentId}` : `${e.id}`;
|
|
230
230
|
return { data: `${t}$${o}` };
|
|
231
|
-
},
|
|
231
|
+
}, un = (e) => {
|
|
232
232
|
var s, i, l, a;
|
|
233
233
|
if (!e)
|
|
234
234
|
return { error: "getWidgetKeyForPublishedCollection: Missing collection" };
|
|
@@ -239,20 +239,20 @@ const Ki = ({ id: e, prefix: t }) => `${t}_${e}`, on = (e) => {
|
|
|
239
239
|
return { error: "getWidgetKeyForPublishedCollection: Missing collection publishedKey" };
|
|
240
240
|
const o = ((a = e.parentId) == null ? void 0 : a.length) ? `${e.publishedKey}@${e.parentId}` : `${e.publishedKey}`;
|
|
241
241
|
return { data: `${t}$${o}` };
|
|
242
|
-
},
|
|
243
|
-
const t =
|
|
244
|
-
return `${
|
|
245
|
-
},
|
|
246
|
-
const t =
|
|
247
|
-
return `${
|
|
248
|
-
},
|
|
249
|
-
function
|
|
250
|
-
return `${e}${
|
|
251
|
-
}
|
|
252
|
-
function
|
|
253
|
-
return `${
|
|
254
|
-
}
|
|
255
|
-
function
|
|
242
|
+
}, Gi = (e) => {
|
|
243
|
+
const t = cn(e);
|
|
244
|
+
return `${st}${t.data}`;
|
|
245
|
+
}, Yi = (e) => {
|
|
246
|
+
const t = un(e);
|
|
247
|
+
return `${st}${t.data}`;
|
|
248
|
+
}, we = "---", dn = "___";
|
|
249
|
+
function fn(e, t) {
|
|
250
|
+
return `${e}${we}${t}`;
|
|
251
|
+
}
|
|
252
|
+
function Xi(e, t, r) {
|
|
253
|
+
return `${fn(e, t)}${dn}${r}`;
|
|
254
|
+
}
|
|
255
|
+
function Ji(e) {
|
|
256
256
|
const t = e.split(".");
|
|
257
257
|
if (t.length !== 3)
|
|
258
258
|
throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);
|
|
@@ -261,7 +261,7 @@ function Yi(e) {
|
|
|
261
261
|
throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);
|
|
262
262
|
return `${r}.${o}.${s + 1}`;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function Pe({
|
|
265
265
|
displayItemList: e,
|
|
266
266
|
widgetCollections: t
|
|
267
267
|
}) {
|
|
@@ -273,7 +273,7 @@ function Te({
|
|
|
273
273
|
for (const u of i.rows)
|
|
274
274
|
if ((a = u == null ? void 0 : u.columns) != null && a.length)
|
|
275
275
|
for (const c of u.columns)
|
|
276
|
-
c.collection && s(c.collection.collectionRows), !(!c.type || c.type ===
|
|
276
|
+
c.collection && s(c.collection.collectionRows), !(!c.type || c.type === Ie.DroppableBox) && (ct(c.type) || (!((d = c.libraryId) != null && d.length) || c.libraryId === re ? o = !0 : r.add(c.libraryId)));
|
|
277
277
|
}
|
|
278
278
|
};
|
|
279
279
|
s(e);
|
|
@@ -281,107 +281,107 @@ function Te({
|
|
|
281
281
|
s(i == null ? void 0 : i.collectionRows);
|
|
282
282
|
return { libraryIds: Array.from(r), usesDefaultLibrary: o };
|
|
283
283
|
}
|
|
284
|
-
const
|
|
285
|
-
function
|
|
284
|
+
const dt = Symbol("rulecms-widget-context");
|
|
285
|
+
function gn() {
|
|
286
286
|
return {
|
|
287
287
|
token: "",
|
|
288
288
|
endpoint: void 0,
|
|
289
289
|
libraries: void 0,
|
|
290
|
-
libraryRegistry:
|
|
290
|
+
libraryRegistry: de()
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function qi(e, t) {
|
|
294
294
|
n.push(t, !0);
|
|
295
|
-
const r = n.proxy(
|
|
295
|
+
const r = n.proxy(gn());
|
|
296
296
|
function o() {
|
|
297
297
|
r.token = t.token, r.endpoint = t.endpoint, r.libraries = t.libraries;
|
|
298
298
|
}
|
|
299
|
-
o(), n.user_effect(o),
|
|
299
|
+
o(), n.user_effect(o), Gt(dt, r);
|
|
300
300
|
var s = n.comment(), i = n.first_child(s);
|
|
301
301
|
n.snippet(i, () => t.children), n.append(e, s), n.pop();
|
|
302
302
|
}
|
|
303
|
-
const
|
|
303
|
+
const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1920, hn = {
|
|
304
304
|
f: "auto",
|
|
305
305
|
q: "auto",
|
|
306
306
|
c: "limit"
|
|
307
|
-
},
|
|
307
|
+
}, bn = /^[A-Za-z0-9][A-Za-z0-9._\-/]*$/, vn = 300, Cn = /^[A-Za-z0-9][A-Za-z0-9_-]*$/, _n = 100, wn = /^https:\/\/[^\s"'()\\<>]+$/, An = 2e3, En = /^[A-Za-z0-9_,.:\-/]*$/, Sn = 300, Tn = (e) => typeof e == "string" && e.length <= vn && bn.test(e), In = (e) => typeof e == "string" && e.length <= _n && Cn.test(e), Pn = (e) => typeof e == "string" && e.length <= An && wn.test(e), Dn = (e) => typeof e == "string" && e.length <= Sn && En.test(e), xn = (e) => Object.entries(e).map(([t, r]) => `${t}_${r}`).join(","), kn = (e) => {
|
|
308
308
|
const t = {};
|
|
309
309
|
for (const r of e.split(",")) {
|
|
310
310
|
const o = r.trim(), s = o.indexOf("_");
|
|
311
311
|
s <= 0 || (t[o.slice(0, s)] = o.slice(s + 1));
|
|
312
312
|
}
|
|
313
313
|
return t;
|
|
314
|
-
},
|
|
314
|
+
}, Ln = ({
|
|
315
315
|
publicId: e,
|
|
316
|
-
cloudName: t =
|
|
316
|
+
cloudName: t = mn,
|
|
317
317
|
transformations: r,
|
|
318
|
-
width: o =
|
|
318
|
+
width: o = yn
|
|
319
319
|
}) => {
|
|
320
|
-
const s = typeof r == "string" ?
|
|
321
|
-
...
|
|
320
|
+
const s = typeof r == "string" ? kn(r) : r, i = {
|
|
321
|
+
...hn,
|
|
322
322
|
...s,
|
|
323
323
|
w: o
|
|
324
324
|
};
|
|
325
325
|
return encodeURI(
|
|
326
|
-
`https://res.cloudinary.com/${t}/image/upload/${
|
|
326
|
+
`https://res.cloudinary.com/${t}/image/upload/${xn(i)}/${e}`
|
|
327
327
|
);
|
|
328
|
-
},
|
|
328
|
+
}, Rn = /^--[A-Za-z0-9_-]+$/, On = 200, $ = (e) => {
|
|
329
329
|
if (typeof e != "string")
|
|
330
330
|
return !1;
|
|
331
331
|
const t = e.trim();
|
|
332
|
-
return t.length <=
|
|
332
|
+
return t.length <= On && Rn.test(t);
|
|
333
333
|
}, B = (e) => `var(${e.trim()})`, k = (e) => {
|
|
334
334
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
335
335
|
return;
|
|
336
336
|
const t = e.cssVariable;
|
|
337
337
|
if (t != null)
|
|
338
338
|
return $(t) ? t.trim() : void 0;
|
|
339
|
-
},
|
|
339
|
+
}, z = (e) => {
|
|
340
340
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
341
341
|
return !1;
|
|
342
342
|
const t = e.cssVariable;
|
|
343
343
|
return t == null ? !1 : !$(t);
|
|
344
|
-
},
|
|
344
|
+
}, Qi = (e, t) => {
|
|
345
345
|
const r = k(e);
|
|
346
346
|
return r ? { [t]: B(r) } : void 0;
|
|
347
|
-
},
|
|
348
|
-
if (typeof e != "object" || e === null || Array.isArray(e) ||
|
|
347
|
+
}, jn = (e) => {
|
|
348
|
+
if (typeof e != "object" || e === null || Array.isArray(e) || z(e))
|
|
349
349
|
return !1;
|
|
350
350
|
if (k(e))
|
|
351
351
|
return !0;
|
|
352
352
|
const t = e;
|
|
353
|
-
return t.source === "none" ? !0 : t.source === "url" ?
|
|
354
|
-
},
|
|
353
|
+
return t.source === "none" ? !0 : t.source === "url" ? Pn(t.url) : t.source === "cloudinary" ? !Tn(t.publicId) || t.cloudName !== void 0 && t.cloudName !== null && !In(t.cloudName) ? !1 : t.transformations === void 0 || t.transformations === null || Dn(t.transformations) : !1;
|
|
354
|
+
}, Nn = ["px", "%", "em", "rem", "vh", "vw"], De = ["inherit", "unset"], Mn = ["allSides", "top", "right", "bottom", "left"], Z = (e, t = {}) => {
|
|
355
355
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
356
356
|
return !1;
|
|
357
357
|
const r = e;
|
|
358
|
-
return
|
|
359
|
-
},
|
|
358
|
+
return z(e) ? !1 : k(e) ? !0 : r.unit === "auto" ? t.allowAuto !== !1 : r.unit === "keyword" ? t.allowKeywords !== !1 && De.includes(r.keyword) : Nn.includes(r.unit) ? typeof r.value != "number" || !Number.isFinite(r.value) ? !1 : t.allowNegative !== !1 || r.value >= 0 : !1;
|
|
359
|
+
}, Wn = (e, t = {}) => {
|
|
360
360
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
361
361
|
return !1;
|
|
362
362
|
const r = e;
|
|
363
|
-
for (const o of
|
|
363
|
+
for (const o of Mn) {
|
|
364
364
|
const s = r[o];
|
|
365
365
|
if (s != null && !Z(s, t))
|
|
366
366
|
return !1;
|
|
367
367
|
}
|
|
368
368
|
return !0;
|
|
369
|
-
},
|
|
369
|
+
}, Vn = [...De, "transparent", "currentColor"], Fn = /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/, xe = (e) => {
|
|
370
370
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
371
371
|
return !1;
|
|
372
372
|
const t = e;
|
|
373
|
-
return
|
|
374
|
-
},
|
|
373
|
+
return z(e) ? !1 : k(e) ? !0 : t.unit === "keyword" ? Vn.includes(t.keyword) : t.unit === "color" ? typeof t.value == "string" && Fn.test(t.value.trim()) : !1;
|
|
374
|
+
}, ke = (e) => {
|
|
375
375
|
const t = k(e);
|
|
376
376
|
return t ? B(t) : "unit" in e ? e.unit === "keyword" ? e.keyword : e.value.trim() : "";
|
|
377
|
-
},
|
|
377
|
+
}, Kn = (e, t) => typeof e == "object" && e !== null && !Array.isArray(e) ? !z(e) && !!k(e) : typeof e != "string" || !e.length ? !1 : t.includes(e) ? !0 : De.includes(e), Bn = [
|
|
378
378
|
'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
379
379
|
'Georgia, "Times New Roman", Times, serif',
|
|
380
380
|
"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
381
381
|
"Arial, Helvetica, sans-serif",
|
|
382
382
|
'"Helvetica Neue", Helvetica, Arial, sans-serif',
|
|
383
383
|
"Verdana, Geneva, sans-serif"
|
|
384
|
-
],
|
|
384
|
+
], Un = [
|
|
385
385
|
"normal",
|
|
386
386
|
"bold",
|
|
387
387
|
"100",
|
|
@@ -393,43 +393,43 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
393
393
|
"700",
|
|
394
394
|
"800",
|
|
395
395
|
"900"
|
|
396
|
-
],
|
|
396
|
+
], zn = ["normal", "italic", "oblique"], Hn = [
|
|
397
397
|
"left",
|
|
398
398
|
"center",
|
|
399
399
|
"right",
|
|
400
400
|
"justify",
|
|
401
401
|
"start",
|
|
402
402
|
"end"
|
|
403
|
-
],
|
|
403
|
+
], Gn = [
|
|
404
404
|
"none",
|
|
405
405
|
"underline",
|
|
406
406
|
"line-through",
|
|
407
407
|
"overline"
|
|
408
|
-
],
|
|
408
|
+
], Yn = [
|
|
409
409
|
"none",
|
|
410
410
|
"uppercase",
|
|
411
411
|
"lowercase",
|
|
412
412
|
"capitalize"
|
|
413
|
-
],
|
|
413
|
+
], be = [
|
|
414
414
|
"visible",
|
|
415
415
|
"hidden",
|
|
416
416
|
"scroll",
|
|
417
417
|
"auto",
|
|
418
418
|
"clip"
|
|
419
|
-
],
|
|
419
|
+
], Xn = ["auto", "none"], Jn = [
|
|
420
420
|
"flex-start",
|
|
421
421
|
"flex-end",
|
|
422
422
|
"center",
|
|
423
423
|
"space-between",
|
|
424
424
|
"space-around",
|
|
425
425
|
"space-evenly"
|
|
426
|
-
],
|
|
426
|
+
], qn = [
|
|
427
427
|
"flex-start",
|
|
428
428
|
"flex-end",
|
|
429
429
|
"center",
|
|
430
430
|
"baseline",
|
|
431
431
|
"stretch"
|
|
432
|
-
],
|
|
432
|
+
], Zn = ["wrap", "nowrap"], Qn = [
|
|
433
433
|
"flex-start",
|
|
434
434
|
"flex-end",
|
|
435
435
|
"center",
|
|
@@ -437,12 +437,12 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
437
437
|
"space-around",
|
|
438
438
|
"space-evenly",
|
|
439
439
|
"stretch"
|
|
440
|
-
],
|
|
440
|
+
], $n = [
|
|
441
441
|
"row",
|
|
442
442
|
"row-reverse",
|
|
443
443
|
"column",
|
|
444
444
|
"column-reverse"
|
|
445
|
-
],
|
|
445
|
+
], er = ["cover", "contain", "auto"], tr = [
|
|
446
446
|
"center center",
|
|
447
447
|
"center top",
|
|
448
448
|
"center bottom",
|
|
@@ -452,20 +452,20 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
452
452
|
"right center",
|
|
453
453
|
"right top",
|
|
454
454
|
"right bottom"
|
|
455
|
-
],
|
|
455
|
+
], nr = [
|
|
456
456
|
"no-repeat",
|
|
457
457
|
"repeat",
|
|
458
458
|
"repeat-x",
|
|
459
459
|
"repeat-y",
|
|
460
460
|
"space",
|
|
461
461
|
"round"
|
|
462
|
-
],
|
|
462
|
+
], rr = [
|
|
463
463
|
"justifyContent",
|
|
464
464
|
"alignItems",
|
|
465
465
|
"flexWrap",
|
|
466
466
|
"alignContent",
|
|
467
467
|
"flexDirection"
|
|
468
|
-
],
|
|
468
|
+
], or = [
|
|
469
469
|
"none",
|
|
470
470
|
"solid",
|
|
471
471
|
"dashed",
|
|
@@ -475,47 +475,47 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
475
475
|
"ridge",
|
|
476
476
|
"inset",
|
|
477
477
|
"outset"
|
|
478
|
-
],
|
|
478
|
+
], sr = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !z(e) && !!k(e) : or.includes(e), ir = (e) => {
|
|
479
479
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
480
480
|
return !1;
|
|
481
481
|
const t = e;
|
|
482
|
-
return
|
|
483
|
-
},
|
|
482
|
+
return z(e) ? !1 : k(e) ? !0 : !(t.width !== void 0 && t.width !== null && !Z(t.width, { allowAuto: !1, allowNegative: !1 }) || t.style !== void 0 && t.style !== null && !sr(t.style) || t.color !== void 0 && t.color !== null && !xe(t.color));
|
|
483
|
+
}, lr = {
|
|
484
484
|
allowAuto: !1,
|
|
485
485
|
allowKeywords: !1,
|
|
486
486
|
allowNegative: !0
|
|
487
|
-
},
|
|
487
|
+
}, ar = {
|
|
488
488
|
allowAuto: !1,
|
|
489
489
|
allowKeywords: !1,
|
|
490
490
|
allowNegative: !1
|
|
491
|
-
},
|
|
491
|
+
}, cr = (e) => {
|
|
492
492
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
493
493
|
return !1;
|
|
494
494
|
const t = e;
|
|
495
|
-
if (
|
|
495
|
+
if (z(e))
|
|
496
496
|
return !1;
|
|
497
497
|
if (k(e))
|
|
498
498
|
return !0;
|
|
499
499
|
for (const r of ["offsetX", "offsetY", "spread"]) {
|
|
500
500
|
const o = t[r];
|
|
501
|
-
if (o != null && !Z(o,
|
|
501
|
+
if (o != null && !Z(o, lr))
|
|
502
502
|
return !1;
|
|
503
503
|
}
|
|
504
|
-
return !(t.blur !== void 0 && t.blur !== null && !Z(t.blur,
|
|
505
|
-
},
|
|
504
|
+
return !(t.blur !== void 0 && t.blur !== null && !Z(t.blur, ar) || t.color !== void 0 && t.color !== null && !xe(t.color) || t.inset !== void 0 && t.inset !== null && typeof t.inset != "boolean");
|
|
505
|
+
}, ur = (e) => e ? e.cssVariable !== void 0 && e.cssVariable !== null || e.offsetX !== void 0 || e.offsetY !== void 0 || e.blur !== void 0 || e.spread !== void 0 || e.color !== void 0 : !1, dr = (e) => {
|
|
506
506
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
507
507
|
return !1;
|
|
508
508
|
const t = e;
|
|
509
|
-
return
|
|
510
|
-
},
|
|
511
|
-
if (!
|
|
509
|
+
return z(e) ? !1 : k(e) ? !0 : t.unit === "number" ? typeof t.value == "number" && Number.isFinite(t.value) && t.value > 0 : Z(e, { allowAuto: !1, allowNegative: !1 });
|
|
510
|
+
}, fr = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !z(e) && !!k(e) : typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 1, gr = (e) => {
|
|
511
|
+
if (!jn(e))
|
|
512
512
|
return {};
|
|
513
513
|
const t = k(e);
|
|
514
514
|
if (t)
|
|
515
515
|
return { backgroundImage: B(t) };
|
|
516
516
|
const r = e;
|
|
517
517
|
return r.source === "none" ? { backgroundImage: "none" } : r.source === "url" ? { backgroundImage: `url("${r.url}")` } : {
|
|
518
|
-
backgroundImage: `url("${
|
|
518
|
+
backgroundImage: `url("${Ln({
|
|
519
519
|
publicId: r.publicId,
|
|
520
520
|
cloudName: r.cloudName,
|
|
521
521
|
transformations: r.transformations
|
|
@@ -524,8 +524,8 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
524
524
|
}, Q = (e) => {
|
|
525
525
|
const t = k(e);
|
|
526
526
|
return t ? B(t) : "unit" in e ? e.unit === "auto" ? "auto" : e.unit === "keyword" ? e.keyword : `${e.value}${e.unit}` : "";
|
|
527
|
-
},
|
|
528
|
-
if (!
|
|
527
|
+
}, pr = (e) => {
|
|
528
|
+
if (!ir(e))
|
|
529
529
|
return {};
|
|
530
530
|
const t = k(e);
|
|
531
531
|
if (t)
|
|
@@ -535,47 +535,47 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
535
535
|
const o = k(e.style);
|
|
536
536
|
r.borderStyle = o ? B(o) : e.style;
|
|
537
537
|
}
|
|
538
|
-
return e.color && (r.borderColor =
|
|
539
|
-
},
|
|
540
|
-
if (!
|
|
538
|
+
return e.color && (r.borderColor = ke(e.color)), r;
|
|
539
|
+
}, le = (e) => e ? Q(e) : "0px", mr = (e) => {
|
|
540
|
+
if (!cr(e) || !ur(e))
|
|
541
541
|
return {};
|
|
542
542
|
const t = k(e);
|
|
543
543
|
if (t)
|
|
544
544
|
return { boxShadow: B(t) };
|
|
545
545
|
const r = [
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
546
|
+
le(e.offsetX),
|
|
547
|
+
le(e.offsetY),
|
|
548
|
+
le(e.blur),
|
|
549
|
+
le(e.spread)
|
|
550
550
|
];
|
|
551
|
-
return e.color && r.push(
|
|
552
|
-
},
|
|
553
|
-
if (!
|
|
551
|
+
return e.color && r.push(ke(e.color)), e.inset && r.unshift("inset"), { boxShadow: r.join(" ") };
|
|
552
|
+
}, yr = (e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`, hr = (e, t) => {
|
|
553
|
+
if (!Wn(e))
|
|
554
554
|
return {};
|
|
555
555
|
if (e.allSides)
|
|
556
556
|
return { [t]: Q(e.allSides) };
|
|
557
557
|
const r = {};
|
|
558
558
|
for (const o of ["top", "right", "bottom", "left"]) {
|
|
559
559
|
const s = e[o];
|
|
560
|
-
s && (r[`${t}${
|
|
560
|
+
s && (r[`${t}${yr(o)}`] = Q(s));
|
|
561
561
|
}
|
|
562
562
|
return r;
|
|
563
|
-
},
|
|
564
|
-
if (!
|
|
563
|
+
}, br = (e, t) => xe(e) ? { [t]: ke(e) } : {}, vr = (e, t, r) => {
|
|
564
|
+
if (!Kn(e, r))
|
|
565
565
|
return {};
|
|
566
566
|
const o = k(e);
|
|
567
567
|
return o ? { [t]: B(o) } : { [t]: e };
|
|
568
|
-
},
|
|
569
|
-
if (!
|
|
568
|
+
}, Cr = (e, t, r = {}) => Z(e, r) ? { [t]: Q(e) } : {}, _r = (e) => {
|
|
569
|
+
if (!dr(e))
|
|
570
570
|
return {};
|
|
571
571
|
const t = k(e);
|
|
572
572
|
return t ? { lineHeight: B(t) } : "unit" in e && e.unit === "number" ? { lineHeight: e.value } : { lineHeight: Q(e) };
|
|
573
|
-
},
|
|
574
|
-
if (!
|
|
573
|
+
}, wr = (e) => {
|
|
574
|
+
if (!fr(e))
|
|
575
575
|
return {};
|
|
576
576
|
const t = k(e);
|
|
577
577
|
return t ? { opacity: B(t) } : { opacity: e };
|
|
578
|
-
},
|
|
578
|
+
}, Le = {
|
|
579
579
|
// Box spacing (4-sided)
|
|
580
580
|
"margin-3-resolutions": { kind: "boxSpacing", cssProperty: "margin" },
|
|
581
581
|
"padding-3-resolutions": { kind: "boxSpacing", cssProperty: "padding" },
|
|
@@ -629,44 +629,44 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
629
629
|
"justify-content-3-resolutions": {
|
|
630
630
|
kind: "enum",
|
|
631
631
|
cssProperty: "justifyContent",
|
|
632
|
-
allowedValues:
|
|
632
|
+
allowedValues: Jn
|
|
633
633
|
},
|
|
634
634
|
"align-items-3-resolutions": {
|
|
635
635
|
kind: "enum",
|
|
636
636
|
cssProperty: "alignItems",
|
|
637
|
-
allowedValues:
|
|
637
|
+
allowedValues: qn
|
|
638
638
|
},
|
|
639
639
|
"flex-wrap-3-resolutions": {
|
|
640
640
|
kind: "enum",
|
|
641
641
|
cssProperty: "flexWrap",
|
|
642
|
-
allowedValues:
|
|
642
|
+
allowedValues: Zn
|
|
643
643
|
},
|
|
644
644
|
"align-content-3-resolutions": {
|
|
645
645
|
kind: "enum",
|
|
646
646
|
cssProperty: "alignContent",
|
|
647
|
-
allowedValues:
|
|
647
|
+
allowedValues: Qn
|
|
648
648
|
},
|
|
649
649
|
"flex-direction-3-resolutions": {
|
|
650
650
|
kind: "enum",
|
|
651
651
|
cssProperty: "flexDirection",
|
|
652
|
-
allowedValues:
|
|
652
|
+
allowedValues: $n
|
|
653
653
|
},
|
|
654
654
|
// Overflow — shorthand and longhands are independent attributes; when
|
|
655
655
|
// both are set, the browser's cascade decides the effective overflow.
|
|
656
656
|
"overflow-3-resolutions": {
|
|
657
657
|
kind: "enum",
|
|
658
658
|
cssProperty: "overflow",
|
|
659
|
-
allowedValues:
|
|
659
|
+
allowedValues: be
|
|
660
660
|
},
|
|
661
661
|
"overflow-x-3-resolutions": {
|
|
662
662
|
kind: "enum",
|
|
663
663
|
cssProperty: "overflowX",
|
|
664
|
-
allowedValues:
|
|
664
|
+
allowedValues: be
|
|
665
665
|
},
|
|
666
666
|
"overflow-y-3-resolutions": {
|
|
667
667
|
kind: "enum",
|
|
668
668
|
cssProperty: "overflowY",
|
|
669
|
-
allowedValues:
|
|
669
|
+
allowedValues: be
|
|
670
670
|
},
|
|
671
671
|
// Color
|
|
672
672
|
// Pointer input. On an overlay layer this is lifted onto the absolutely
|
|
@@ -674,7 +674,7 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
674
674
|
"pointer-events-3-resolutions": {
|
|
675
675
|
kind: "enum",
|
|
676
676
|
cssProperty: "pointerEvents",
|
|
677
|
-
allowedValues:
|
|
677
|
+
allowedValues: Xn
|
|
678
678
|
},
|
|
679
679
|
"background-color-3-resolutions": { kind: "color", cssProperty: "backgroundColor" },
|
|
680
680
|
"color-3-resolutions": { kind: "color", cssProperty: "color" },
|
|
@@ -685,17 +685,17 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
685
685
|
"background-size-3-resolutions": {
|
|
686
686
|
kind: "enum",
|
|
687
687
|
cssProperty: "backgroundSize",
|
|
688
|
-
allowedValues:
|
|
688
|
+
allowedValues: er
|
|
689
689
|
},
|
|
690
690
|
"background-position-3-resolutions": {
|
|
691
691
|
kind: "enum",
|
|
692
692
|
cssProperty: "backgroundPosition",
|
|
693
|
-
allowedValues:
|
|
693
|
+
allowedValues: tr
|
|
694
694
|
},
|
|
695
695
|
"background-repeat-3-resolutions": {
|
|
696
696
|
kind: "enum",
|
|
697
697
|
cssProperty: "backgroundRepeat",
|
|
698
|
-
allowedValues:
|
|
698
|
+
allowedValues: nr
|
|
699
699
|
},
|
|
700
700
|
// Opacity (0–1 number)
|
|
701
701
|
"opacity-3-resolutions": { kind: "opacity" },
|
|
@@ -703,7 +703,7 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
703
703
|
"font-family-3-resolutions": {
|
|
704
704
|
kind: "enum",
|
|
705
705
|
cssProperty: "fontFamily",
|
|
706
|
-
allowedValues:
|
|
706
|
+
allowedValues: Bn
|
|
707
707
|
},
|
|
708
708
|
"font-size-3-resolutions": {
|
|
709
709
|
kind: "length",
|
|
@@ -713,12 +713,12 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
713
713
|
"font-weight-3-resolutions": {
|
|
714
714
|
kind: "enum",
|
|
715
715
|
cssProperty: "fontWeight",
|
|
716
|
-
allowedValues:
|
|
716
|
+
allowedValues: Un
|
|
717
717
|
},
|
|
718
718
|
"font-style-3-resolutions": {
|
|
719
719
|
kind: "enum",
|
|
720
720
|
cssProperty: "fontStyle",
|
|
721
|
-
allowedValues:
|
|
721
|
+
allowedValues: zn
|
|
722
722
|
},
|
|
723
723
|
"line-height-3-resolutions": { kind: "lineHeight" },
|
|
724
724
|
"letter-spacing-3-resolutions": {
|
|
@@ -729,59 +729,59 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
729
729
|
"text-align-3-resolutions": {
|
|
730
730
|
kind: "enum",
|
|
731
731
|
cssProperty: "textAlign",
|
|
732
|
-
allowedValues:
|
|
732
|
+
allowedValues: Hn
|
|
733
733
|
},
|
|
734
734
|
"text-decoration-3-resolutions": {
|
|
735
735
|
kind: "enum",
|
|
736
736
|
cssProperty: "textDecoration",
|
|
737
|
-
allowedValues:
|
|
737
|
+
allowedValues: Gn
|
|
738
738
|
},
|
|
739
739
|
"text-transform-3-resolutions": {
|
|
740
740
|
kind: "enum",
|
|
741
741
|
cssProperty: "textTransform",
|
|
742
|
-
allowedValues:
|
|
742
|
+
allowedValues: Yn
|
|
743
743
|
}
|
|
744
|
-
},
|
|
745
|
-
const r =
|
|
744
|
+
}, Ar = (e, t) => {
|
|
745
|
+
const r = Le[e];
|
|
746
746
|
if (!r)
|
|
747
747
|
return {};
|
|
748
748
|
switch (r.kind) {
|
|
749
749
|
case "boxSpacing":
|
|
750
|
-
return
|
|
750
|
+
return hr(t, r.cssProperty);
|
|
751
751
|
case "length":
|
|
752
|
-
return
|
|
752
|
+
return Cr(t, r.cssProperty, r.capabilities);
|
|
753
753
|
case "border":
|
|
754
|
-
return
|
|
754
|
+
return pr(t);
|
|
755
755
|
case "boxShadow":
|
|
756
|
-
return
|
|
756
|
+
return mr(t);
|
|
757
757
|
case "color":
|
|
758
|
-
return
|
|
758
|
+
return br(t, r.cssProperty);
|
|
759
759
|
case "opacity":
|
|
760
|
-
return
|
|
760
|
+
return wr(t);
|
|
761
761
|
case "enum":
|
|
762
|
-
return
|
|
762
|
+
return vr(t, r.cssProperty, r.allowedValues);
|
|
763
763
|
case "lineHeight":
|
|
764
|
-
return
|
|
764
|
+
return _r(t);
|
|
765
765
|
case "backgroundImage":
|
|
766
|
-
return
|
|
766
|
+
return gr(t);
|
|
767
767
|
default:
|
|
768
768
|
return {};
|
|
769
769
|
}
|
|
770
|
-
},
|
|
771
|
-
Object.entries(
|
|
770
|
+
}, $i = Object.fromEntries(
|
|
771
|
+
Object.entries(Le).filter(([, e]) => e.kind === "boxSpacing").map(([e, t]) => [
|
|
772
772
|
e,
|
|
773
773
|
t.cssProperty
|
|
774
774
|
])
|
|
775
|
-
),
|
|
776
|
-
(r) =>
|
|
777
|
-
) || e.display === "flex" ? e : { ...e, display: "flex" } : {},
|
|
775
|
+
), Er = (e) => e != null && e !== "", Sr = (e) => e ? !rr.some(
|
|
776
|
+
(r) => Er(e[r])
|
|
777
|
+
) || e.display === "flex" ? e : { ...e, display: "flex" } : {}, Tr = ({
|
|
778
778
|
dbEntryType: e,
|
|
779
779
|
libraryId: t,
|
|
780
780
|
sourceComponentsPlugin: r
|
|
781
781
|
}) => {
|
|
782
782
|
if (!(e != null && e.length))
|
|
783
783
|
return;
|
|
784
|
-
const o = r.components[
|
|
784
|
+
const o = r.components[rt(t, e)];
|
|
785
785
|
if (!o || !("defaultAttributeValues" in o))
|
|
786
786
|
return;
|
|
787
787
|
const i = o.defaultAttributeValues;
|
|
@@ -790,7 +790,7 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
790
790
|
...l,
|
|
791
791
|
[a.name]: a.defaultValues
|
|
792
792
|
}), {});
|
|
793
|
-
},
|
|
793
|
+
}, G = ({
|
|
794
794
|
deviceDisplayType: e,
|
|
795
795
|
componentAttributes: t
|
|
796
796
|
}) => {
|
|
@@ -803,7 +803,7 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
803
803
|
if (!s.includes("3-resolutions") || !i)
|
|
804
804
|
continue;
|
|
805
805
|
const l = i.all, a = l ?? i[e.toLowerCase()];
|
|
806
|
-
o[s] = a,
|
|
806
|
+
o[s] = a, Le[s] && Object.assign(r, Ar(s, a));
|
|
807
807
|
}
|
|
808
808
|
return Object.keys(r).length || Object.keys(o).length ? {
|
|
809
809
|
styles: Object.keys(r).length ? r : void 0,
|
|
@@ -811,27 +811,27 @@ const fn = "1200px", ut = "500px", dt = "820px", Ji = fn, gn = "rulecms", pn = 1
|
|
|
811
811
|
o
|
|
812
812
|
).length ? o : void 0
|
|
813
813
|
} : void 0;
|
|
814
|
-
},
|
|
814
|
+
}, Ir = ({
|
|
815
815
|
defaultAttributes: e,
|
|
816
816
|
userModifiedAttributes: t
|
|
817
817
|
}) => e ? t ? { ...e, ...t } : e : t;
|
|
818
|
-
function
|
|
818
|
+
function ce(e) {
|
|
819
819
|
return e.componentAttributes ?? e.widgetAttributes;
|
|
820
820
|
}
|
|
821
|
-
function
|
|
821
|
+
function He({
|
|
822
822
|
col: e,
|
|
823
823
|
deviceDisplayType: t,
|
|
824
824
|
isComposeMode: r,
|
|
825
825
|
sourceComponentsPlugin: o
|
|
826
826
|
}) {
|
|
827
|
-
const s =
|
|
827
|
+
const s = ce(e), i = Tr({
|
|
828
828
|
dbEntryType: e.type,
|
|
829
829
|
libraryId: e.libraryId,
|
|
830
830
|
sourceComponentsPlugin: o
|
|
831
|
-
}) || [], l =
|
|
831
|
+
}) || [], l = Ir({
|
|
832
832
|
defaultAttributes: i,
|
|
833
833
|
userModifiedAttributes: s
|
|
834
|
-
}), { styles: a, componentAttributesSpecificToDeviceType: d } =
|
|
834
|
+
}), { styles: a, componentAttributesSpecificToDeviceType: d } = G({
|
|
835
835
|
deviceDisplayType: t,
|
|
836
836
|
componentAttributes: l
|
|
837
837
|
}) || {
|
|
@@ -846,16 +846,16 @@ function Ue({
|
|
|
846
846
|
...u,
|
|
847
847
|
[g]: A
|
|
848
848
|
});
|
|
849
|
-
let f =
|
|
849
|
+
let f = ce(e);
|
|
850
850
|
for (const g in d)
|
|
851
851
|
if (g.includes("3-resolutions")) {
|
|
852
852
|
f = {
|
|
853
|
-
...
|
|
853
|
+
...ce(e) || {},
|
|
854
854
|
...d || {}
|
|
855
855
|
};
|
|
856
856
|
break;
|
|
857
857
|
}
|
|
858
|
-
const p =
|
|
858
|
+
const p = Sr(u);
|
|
859
859
|
if (r && p.pointerEvents !== void 0) {
|
|
860
860
|
const g = { ...p };
|
|
861
861
|
return delete g.pointerEvents, {
|
|
@@ -868,37 +868,37 @@ function Ue({
|
|
|
868
868
|
componentStyles: p
|
|
869
869
|
};
|
|
870
870
|
}
|
|
871
|
-
const
|
|
871
|
+
const Pr = (e) => {
|
|
872
872
|
const t = (e == null ? void 0 : e.rows) || [];
|
|
873
873
|
for (const r of t)
|
|
874
874
|
if (((r == null ? void 0 : r.columns) || []).length > 0)
|
|
875
875
|
return !0;
|
|
876
876
|
return (e == null ? void 0 : e.containerAttributes) && Object.keys(e.containerAttributes).length > 0;
|
|
877
|
-
},
|
|
878
|
-
function
|
|
877
|
+
}, Dr = "var(--sl-spacing-x-small)";
|
|
878
|
+
function xr(e) {
|
|
879
879
|
return e != null && e.horizontalAlignment || e != null && e.verticalAlignment || e != null && e.flexWrap || e != null && e.gap || e != null && e.alignContent ? !0 : !!(e != null && e.rowAttributes && Object.keys(e.rowAttributes).length > 0);
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function kr({
|
|
882
882
|
row: e,
|
|
883
883
|
deviceDisplayType: t
|
|
884
884
|
}) {
|
|
885
885
|
var o;
|
|
886
|
-
const r =
|
|
886
|
+
const r = G({
|
|
887
887
|
deviceDisplayType: t,
|
|
888
888
|
componentAttributes: e.rowAttributes
|
|
889
889
|
});
|
|
890
890
|
return ((o = r == null ? void 0 : r.componentAttributesSpecificToDeviceType) == null ? void 0 : o["hide-component-3-resolutions"]) === "true";
|
|
891
891
|
}
|
|
892
|
-
function
|
|
892
|
+
function Lr({
|
|
893
893
|
row: e,
|
|
894
894
|
deviceDisplayType: t,
|
|
895
895
|
isComposeMode: r
|
|
896
896
|
}) {
|
|
897
897
|
var g;
|
|
898
|
-
const o = ((g =
|
|
898
|
+
const o = ((g = G({
|
|
899
899
|
deviceDisplayType: t,
|
|
900
900
|
componentAttributes: e.rowAttributes
|
|
901
|
-
})) == null ? void 0 : g.styles) || {}, s = o.justifyContent ?? e.horizontalAlignment ??
|
|
901
|
+
})) == null ? void 0 : g.styles) || {}, s = o.justifyContent ?? e.horizontalAlignment ?? ze.Center, i = o.alignItems ?? e.verticalAlignment ?? ze.Center, l = o.flexDirection ?? "row", a = o.gap ?? e.gap ?? Dr, d = r ? "nowrap" : o.flexWrap ?? e.flexWrap ?? "nowrap", u = o.alignContent ?? e.alignContent ?? void 0, c = /* @__PURE__ */ new Set([
|
|
902
902
|
"justifyContent",
|
|
903
903
|
"alignItems",
|
|
904
904
|
"flexDirection",
|
|
@@ -920,12 +920,12 @@ function xr({
|
|
|
920
920
|
};
|
|
921
921
|
return u !== void 0 && (p.alignContent = u), p;
|
|
922
922
|
}
|
|
923
|
-
const
|
|
923
|
+
const Re = "css-classes-3-resolutions", Rr = 500, Or = /[\x00-\x1f\x7f]/g, Oe = (e) => {
|
|
924
924
|
if (typeof e != "string")
|
|
925
925
|
return;
|
|
926
926
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
927
927
|
for (const s of e.split(/\s+/)) {
|
|
928
|
-
const i = s.replace(
|
|
928
|
+
const i = s.replace(Or, "");
|
|
929
929
|
i && (t.has(i) || (t.add(i), r.push(i)));
|
|
930
930
|
}
|
|
931
931
|
if (!r.length)
|
|
@@ -933,12 +933,12 @@ const ke = "css-classes-3-resolutions", kr = 500, Lr = /[\x00-\x1f\x7f]/g, Le =
|
|
|
933
933
|
let o = "";
|
|
934
934
|
for (const s of r) {
|
|
935
935
|
const i = o ? `${o} ${s}` : s;
|
|
936
|
-
if (i.length >
|
|
936
|
+
if (i.length > Rr)
|
|
937
937
|
break;
|
|
938
938
|
o = i;
|
|
939
939
|
}
|
|
940
940
|
return o.length ? o : void 0;
|
|
941
|
-
},
|
|
941
|
+
}, pt = "hide-component-3-resolutions", jr = "pointer-events-3-resolutions", Nr = [
|
|
942
942
|
"width-3-resolutions",
|
|
943
943
|
"min-width-3-resolutions",
|
|
944
944
|
"max-width-3-resolutions",
|
|
@@ -953,23 +953,23 @@ const ke = "css-classes-3-resolutions", kr = 500, Lr = /[\x00-\x1f\x7f]/g, Le =
|
|
|
953
953
|
"overflow-3-resolutions",
|
|
954
954
|
"overflow-x-3-resolutions",
|
|
955
955
|
"overflow-y-3-resolutions",
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
],
|
|
959
|
-
|
|
956
|
+
pt,
|
|
957
|
+
jr
|
|
958
|
+
], Mr = new Set(
|
|
959
|
+
Nr
|
|
960
960
|
);
|
|
961
|
-
function
|
|
961
|
+
function je({
|
|
962
962
|
containerAttributes: e,
|
|
963
963
|
deviceDisplayType: t
|
|
964
964
|
}) {
|
|
965
965
|
var o;
|
|
966
|
-
const r =
|
|
966
|
+
const r = G({
|
|
967
967
|
deviceDisplayType: t,
|
|
968
968
|
componentAttributes: e
|
|
969
969
|
});
|
|
970
|
-
return ((o = r == null ? void 0 : r.componentAttributesSpecificToDeviceType) == null ? void 0 : o[
|
|
970
|
+
return ((o = r == null ? void 0 : r.componentAttributesSpecificToDeviceType) == null ? void 0 : o[pt]) === "true";
|
|
971
971
|
}
|
|
972
|
-
function
|
|
972
|
+
function mt({
|
|
973
973
|
containerAttributes: e,
|
|
974
974
|
deviceDisplayType: t,
|
|
975
975
|
isComposeMode: r
|
|
@@ -979,44 +979,44 @@ function gt({
|
|
|
979
979
|
return { styles: {} };
|
|
980
980
|
const o = r ? Object.fromEntries(
|
|
981
981
|
Object.entries(e).filter(
|
|
982
|
-
([l]) => !
|
|
982
|
+
([l]) => !Mr.has(l)
|
|
983
983
|
)
|
|
984
|
-
) : e, s =
|
|
984
|
+
) : e, s = G({
|
|
985
985
|
deviceDisplayType: t,
|
|
986
986
|
componentAttributes: o
|
|
987
987
|
});
|
|
988
988
|
return {
|
|
989
989
|
styles: (s == null ? void 0 : s.styles) ?? {},
|
|
990
|
-
cssClasses:
|
|
991
|
-
(i = s == null ? void 0 : s.componentAttributesSpecificToDeviceType) == null ? void 0 : i[
|
|
990
|
+
cssClasses: Oe(
|
|
991
|
+
(i = s == null ? void 0 : s.componentAttributesSpecificToDeviceType) == null ? void 0 : i[Re]
|
|
992
992
|
)
|
|
993
993
|
};
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Wr(e) {
|
|
996
996
|
return Object.keys(e.styles).length > 0 || !!e.cssClasses;
|
|
997
997
|
}
|
|
998
|
-
function
|
|
998
|
+
function yt({
|
|
999
999
|
containerAttributes: e,
|
|
1000
1000
|
widgetContainerStyles: t
|
|
1001
1001
|
}) {
|
|
1002
|
-
return ((e == null ? void 0 : e[
|
|
1002
|
+
return ((e == null ? void 0 : e[_e]) || []).some(
|
|
1003
1003
|
(o) => o.toLowerCase().startsWith("height:")
|
|
1004
1004
|
) || t.styles.height !== void 0;
|
|
1005
1005
|
}
|
|
1006
|
-
const
|
|
1007
|
-
function
|
|
1006
|
+
const Vr = "z-index-3-resolutions", ht = 0;
|
|
1007
|
+
function Fr(e) {
|
|
1008
1008
|
var t, r;
|
|
1009
1009
|
return !!((r = (t = e == null ? void 0 : e.overlayLayers) == null ? void 0 : t.layers) != null && r.length);
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function Ge({
|
|
1012
1012
|
containerAttributes: e,
|
|
1013
1013
|
deviceDisplayType: t
|
|
1014
1014
|
}) {
|
|
1015
1015
|
var s;
|
|
1016
|
-
const r =
|
|
1016
|
+
const r = G({
|
|
1017
1017
|
deviceDisplayType: t,
|
|
1018
1018
|
componentAttributes: e
|
|
1019
|
-
}), o = (s = r == null ? void 0 : r.componentAttributesSpecificToDeviceType) == null ? void 0 : s[
|
|
1019
|
+
}), o = (s = r == null ? void 0 : r.componentAttributesSpecificToDeviceType) == null ? void 0 : s[Vr];
|
|
1020
1020
|
if (typeof o == "number" && Number.isFinite(o))
|
|
1021
1021
|
return o;
|
|
1022
1022
|
if (typeof o == "string" && o.trim().length) {
|
|
@@ -1024,33 +1024,33 @@ function ze({
|
|
|
1024
1024
|
if (Number.isFinite(i))
|
|
1025
1025
|
return i;
|
|
1026
1026
|
}
|
|
1027
|
-
return
|
|
1027
|
+
return ht;
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function Kr(e, t) {
|
|
1030
1030
|
return e + t + 1;
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function Br({
|
|
1033
1033
|
containerAttributes: e,
|
|
1034
1034
|
deviceDisplayType: t
|
|
1035
1035
|
}) {
|
|
1036
1036
|
var s;
|
|
1037
|
-
const r =
|
|
1037
|
+
const r = G({
|
|
1038
1038
|
deviceDisplayType: t,
|
|
1039
1039
|
componentAttributes: e
|
|
1040
1040
|
}), o = (s = r == null ? void 0 : r.styles) == null ? void 0 : s.pointerEvents;
|
|
1041
1041
|
return typeof o == "string" ? o : void 0;
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function Ur({
|
|
1044
1044
|
layer: e,
|
|
1045
1045
|
deviceDisplayType: t
|
|
1046
1046
|
}) {
|
|
1047
1047
|
var r;
|
|
1048
|
-
return (r = e == null ? void 0 : e.rows) != null && r.length ?
|
|
1048
|
+
return (r = e == null ? void 0 : e.rows) != null && r.length ? je({
|
|
1049
1049
|
containerAttributes: e.containerAttributes,
|
|
1050
1050
|
deviceDisplayType: t
|
|
1051
1051
|
}) : !0;
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function zr({
|
|
1054
1054
|
isWithinCollection: e,
|
|
1055
1055
|
baseDeclaresOwnHeight: t,
|
|
1056
1056
|
baseZIndex: r
|
|
@@ -1061,10 +1061,10 @@ function Br({
|
|
|
1061
1061
|
display: "flex",
|
|
1062
1062
|
flexDirection: "column",
|
|
1063
1063
|
...t ? {} : { height: e ? "auto" : "100%" },
|
|
1064
|
-
...r ===
|
|
1064
|
+
...r === ht ? {} : { zIndex: r }
|
|
1065
1065
|
};
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function Hr({
|
|
1068
1068
|
zIndex: e,
|
|
1069
1069
|
pointerEvents: t
|
|
1070
1070
|
}) {
|
|
@@ -1091,8 +1091,8 @@ function N(e) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
return t.length > 0 ? t.join("; ") : void 0;
|
|
1093
1093
|
}
|
|
1094
|
-
const
|
|
1095
|
-
function
|
|
1094
|
+
const fe = "/";
|
|
1095
|
+
function Gr({
|
|
1096
1096
|
componentProps: e,
|
|
1097
1097
|
ancestorColumnIds: t,
|
|
1098
1098
|
columnId: r
|
|
@@ -1101,22 +1101,22 @@ function zr({
|
|
|
1101
1101
|
return;
|
|
1102
1102
|
const o = [...t ?? [], r];
|
|
1103
1103
|
for (let s = 0; s < o.length; s += 1) {
|
|
1104
|
-
const i = o.slice(s).join(
|
|
1104
|
+
const i = o.slice(s).join(fe), l = e[i];
|
|
1105
1105
|
if (l)
|
|
1106
1106
|
return l;
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
|
-
const
|
|
1110
|
-
function
|
|
1109
|
+
const Ye = "placeholderValues";
|
|
1110
|
+
function Yr({
|
|
1111
1111
|
widgetInstanceProps: e,
|
|
1112
1112
|
placeholderValues: t
|
|
1113
1113
|
}) {
|
|
1114
|
-
return t === void 0 || e != null && Object.prototype.hasOwnProperty.call(e,
|
|
1114
|
+
return t === void 0 || e != null && Object.prototype.hasOwnProperty.call(e, Ye) ? e : {
|
|
1115
1115
|
...e,
|
|
1116
|
-
[
|
|
1116
|
+
[Ye]: t
|
|
1117
1117
|
};
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function Xr({
|
|
1120
1120
|
displayItemList: e,
|
|
1121
1121
|
widgetCollections: t
|
|
1122
1122
|
}) {
|
|
@@ -1125,26 +1125,26 @@ function Gr({
|
|
|
1125
1125
|
if ((l = s == null ? void 0 : s.rows) != null && l.length)
|
|
1126
1126
|
for (const a of s.rows)
|
|
1127
1127
|
for (const d of a.columns) {
|
|
1128
|
-
if (!d.id || d.type ===
|
|
1128
|
+
if (!d.id || d.type === Ie.DroppableBox)
|
|
1129
1129
|
continue;
|
|
1130
|
-
const u =
|
|
1130
|
+
const u = ut(d.type);
|
|
1131
1131
|
if (u != null && u.length) {
|
|
1132
1132
|
const c = d.collection ?? (t == null ? void 0 : t[u]);
|
|
1133
1133
|
c && !i.includes(d.id) && o(c.collectionRows, [...i, d.id]);
|
|
1134
1134
|
continue;
|
|
1135
1135
|
}
|
|
1136
1136
|
r.push(
|
|
1137
|
-
[...i, d.id].join(
|
|
1137
|
+
[...i, d.id].join(fe)
|
|
1138
1138
|
);
|
|
1139
1139
|
}
|
|
1140
1140
|
};
|
|
1141
1141
|
return o(e, []), r;
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1144
|
-
const r = `${
|
|
1143
|
+
function Jr(e, t) {
|
|
1144
|
+
const r = `${fe}${e}`;
|
|
1145
1145
|
return t.some((o) => o === e || o.endsWith(r));
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1147
|
+
function qr({
|
|
1148
1148
|
componentProps: e,
|
|
1149
1149
|
displayItemList: t,
|
|
1150
1150
|
widgetCollections: r
|
|
@@ -1152,13 +1152,13 @@ function Xr({
|
|
|
1152
1152
|
const o = e ? Object.keys(e) : [];
|
|
1153
1153
|
if (!o.length)
|
|
1154
1154
|
return [];
|
|
1155
|
-
const s =
|
|
1155
|
+
const s = Xr({
|
|
1156
1156
|
displayItemList: t,
|
|
1157
1157
|
widgetCollections: r
|
|
1158
1158
|
});
|
|
1159
|
-
return o.filter((i) => !
|
|
1159
|
+
return o.filter((i) => !Jr(i, s));
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1161
|
+
function Zr({
|
|
1162
1162
|
componentProps: e,
|
|
1163
1163
|
displayItemList: t,
|
|
1164
1164
|
widgetCollections: r,
|
|
@@ -1166,7 +1166,7 @@ function Jr({
|
|
|
1166
1166
|
}) {
|
|
1167
1167
|
if (process.env.NODE_ENV === "production")
|
|
1168
1168
|
return;
|
|
1169
|
-
const s =
|
|
1169
|
+
const s = qr({
|
|
1170
1170
|
componentProps: e,
|
|
1171
1171
|
displayItemList: t,
|
|
1172
1172
|
widgetCollections: r
|
|
@@ -1175,68 +1175,68 @@ function Jr({
|
|
|
1175
1175
|
`RuleCMSWidget "${o}": componentProps ${s.map((i) => `"${i}"`).join(", ")} ${s.length === 1 ? "matches" : "match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`
|
|
1176
1176
|
);
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function Qr(e) {
|
|
1179
1179
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1181
|
+
function $r(e) {
|
|
1182
1182
|
if (e.all !== void 0 && e.all !== null)
|
|
1183
1183
|
return !1;
|
|
1184
1184
|
const t = e.phone, r = e.tablet, o = e.desktop;
|
|
1185
1185
|
return t !== r || t !== o || r !== o;
|
|
1186
1186
|
}
|
|
1187
|
-
function
|
|
1187
|
+
function Ae(e) {
|
|
1188
1188
|
var t, r;
|
|
1189
1189
|
if (!((t = e == null ? void 0 : e.rows) != null && t.length))
|
|
1190
1190
|
return !1;
|
|
1191
|
-
if (
|
|
1191
|
+
if (ve(e.containerAttributes))
|
|
1192
1192
|
return !0;
|
|
1193
1193
|
for (const o of e.rows) {
|
|
1194
|
-
if (
|
|
1194
|
+
if (ve(o.rowAttributes))
|
|
1195
1195
|
return !0;
|
|
1196
1196
|
for (const s of o.columns)
|
|
1197
|
-
if (
|
|
1197
|
+
if (ve(ce(s)))
|
|
1198
1198
|
return !0;
|
|
1199
1199
|
}
|
|
1200
1200
|
for (const o of ((r = e.overlayLayers) == null ? void 0 : r.layers) ?? [])
|
|
1201
|
-
if (
|
|
1201
|
+
if (Ae(o))
|
|
1202
1202
|
return !0;
|
|
1203
1203
|
return !1;
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function ve(e) {
|
|
1206
1206
|
if (!e)
|
|
1207
1207
|
return !1;
|
|
1208
1208
|
for (const [t, r] of Object.entries(e))
|
|
1209
|
-
if (!(!t.includes("3-resolutions") || !
|
|
1209
|
+
if (!(!t.includes("3-resolutions") || !Qr(r))) {
|
|
1210
1210
|
if (t === "hide-component-3-resolutions") {
|
|
1211
1211
|
const o = r, s = (i) => i === "true" || i === !0;
|
|
1212
1212
|
if (s(o.phone) !== s(o.tablet) || s(o.phone) !== s(o.desktop))
|
|
1213
1213
|
return !0;
|
|
1214
1214
|
continue;
|
|
1215
1215
|
}
|
|
1216
|
-
if (
|
|
1216
|
+
if ($r(r))
|
|
1217
1217
|
return !0;
|
|
1218
1218
|
}
|
|
1219
1219
|
return !1;
|
|
1220
1220
|
}
|
|
1221
|
-
function
|
|
1222
|
-
if (
|
|
1221
|
+
function eo(e, t) {
|
|
1222
|
+
if (Ae(e))
|
|
1223
1223
|
return !0;
|
|
1224
1224
|
for (const r of Object.values(t))
|
|
1225
|
-
if (
|
|
1225
|
+
if (Ae(r.collectionRows))
|
|
1226
1226
|
return !0;
|
|
1227
1227
|
return !1;
|
|
1228
1228
|
}
|
|
1229
|
-
const
|
|
1230
|
-
function
|
|
1229
|
+
const bt = parseInt(ft, 10), vt = parseInt(gt, 10), to = bt + 1, no = vt + 1;
|
|
1230
|
+
function ro(e) {
|
|
1231
1231
|
const t = `.${e}-phone`, r = `.${e}-tablet`, o = `.${e}-desktop`;
|
|
1232
1232
|
return `
|
|
1233
1233
|
${t}, ${r}, ${o} { display: none; }
|
|
1234
|
-
@media (max-width: ${
|
|
1235
|
-
@media (min-width: ${
|
|
1236
|
-
@media (min-width: ${
|
|
1234
|
+
@media (max-width: ${bt}px) { ${t} { display: block; } }
|
|
1235
|
+
@media (min-width: ${to}px) and (max-width: ${vt}px) { ${r} { display: block; } }
|
|
1236
|
+
@media (min-width: ${no}px) { ${o} { display: block; } }
|
|
1237
1237
|
`.trim();
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function Ce(e) {
|
|
1240
1240
|
if (!e)
|
|
1241
1241
|
throw new Error("Source components plugin is required, but no plugins were provided");
|
|
1242
1242
|
const t = e.sourceComponents;
|
|
@@ -1250,38 +1250,38 @@ function be(e) {
|
|
|
1250
1250
|
);
|
|
1251
1251
|
return t;
|
|
1252
1252
|
}
|
|
1253
|
-
let
|
|
1254
|
-
var
|
|
1255
|
-
function
|
|
1253
|
+
let oo = 0;
|
|
1254
|
+
var so = n.from_html("<div><!> <!></div>");
|
|
1255
|
+
function io(e, t) {
|
|
1256
1256
|
n.push(t, !0);
|
|
1257
1257
|
let r = n.prop(t, "isComposeMode", 3, !1), o = n.prop(t, "showDropContainers", 3, !1), s = n.prop(t, "isWithinCollection", 3, !1), i = n.prop(t, "deviceDisplayType", 3, "Desktop");
|
|
1258
|
-
const l = `rulecms-vc-${++
|
|
1259
|
-
function a(h,
|
|
1260
|
-
const E = h && !
|
|
1261
|
-
return !!(
|
|
1258
|
+
const l = `rulecms-vc-${++oo}`;
|
|
1259
|
+
function a(h, _, C) {
|
|
1260
|
+
const E = h && !C ? 3 : 1;
|
|
1261
|
+
return !!(_ != null && _.length) && _.length > E;
|
|
1262
1262
|
}
|
|
1263
1263
|
const d = n.derived(() => {
|
|
1264
1264
|
var h;
|
|
1265
|
-
return (((h = t.displayItemList.containerAttributes) == null ? void 0 : h[
|
|
1265
|
+
return (((h = t.displayItemList.containerAttributes) == null ? void 0 : h[_e]) || []).join(`;
|
|
1266
1266
|
`);
|
|
1267
1267
|
}), u = n.derived(() => n.get(d) ? `.${l} {
|
|
1268
1268
|
${n.get(d)}
|
|
1269
|
-
}` : ""), c = n.derived(() => !r() &&
|
|
1269
|
+
}` : ""), c = n.derived(() => !r() && je({
|
|
1270
1270
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1271
1271
|
deviceDisplayType: i()
|
|
1272
|
-
})), f = n.derived(() =>
|
|
1272
|
+
})), f = n.derived(() => mt({
|
|
1273
1273
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1274
1274
|
deviceDisplayType: i(),
|
|
1275
1275
|
isComposeMode: r()
|
|
1276
1276
|
})), p = n.derived(() => {
|
|
1277
|
-
var
|
|
1278
|
-
const h = ((
|
|
1279
|
-
return r() && !s() || o() || h.length > 0 ||
|
|
1277
|
+
var C;
|
|
1278
|
+
const h = ((C = t.displayItemList.containerAttributes) == null ? void 0 : C[_e]) || [], _ = Wr(n.get(f));
|
|
1279
|
+
return r() && !s() || o() || h.length > 0 || _ || a(r(), t.displayItemList.rows, s());
|
|
1280
1280
|
}), g = n.derived(() => [
|
|
1281
1281
|
n.get(d) ? l : void 0,
|
|
1282
1282
|
n.get(f).cssClasses
|
|
1283
1283
|
].filter(Boolean).join(" ")), A = n.derived(() => ({
|
|
1284
|
-
...
|
|
1284
|
+
...yt({
|
|
1285
1285
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1286
1286
|
widgetContainerStyles: n.get(f)
|
|
1287
1287
|
}) ? {} : { height: s() ? "auto" : "100%" },
|
|
@@ -1289,17 +1289,17 @@ ${n.get(d)}
|
|
|
1289
1289
|
flexDirection: "column",
|
|
1290
1290
|
...n.get(f).styles
|
|
1291
1291
|
})), w = n.derived(() => n.get(p) ? n.get(g) : ""), b = n.derived(() => n.get(c) ? { display: "none" } : n.get(p) ? n.get(A) : { display: "contents" });
|
|
1292
|
-
var v =
|
|
1292
|
+
var v = so(), T = n.child(v);
|
|
1293
1293
|
{
|
|
1294
|
-
var
|
|
1295
|
-
var
|
|
1296
|
-
n.element(
|
|
1297
|
-
var
|
|
1298
|
-
n.template_effect(() => n.set_text(
|
|
1299
|
-
}), n.append(h,
|
|
1294
|
+
var j = (h) => {
|
|
1295
|
+
var _ = n.comment(), C = n.first_child(_);
|
|
1296
|
+
n.element(C, () => "style", !1, (E, I) => {
|
|
1297
|
+
var P = n.text();
|
|
1298
|
+
n.template_effect(() => n.set_text(P, n.get(u))), n.append(I, P);
|
|
1299
|
+
}), n.append(h, _);
|
|
1300
1300
|
};
|
|
1301
1301
|
n.if(T, (h) => {
|
|
1302
|
-
n.get(d) && h(
|
|
1302
|
+
n.get(d) && h(j);
|
|
1303
1303
|
});
|
|
1304
1304
|
}
|
|
1305
1305
|
var U = n.sibling(T, 2);
|
|
@@ -1310,28 +1310,28 @@ ${n.get(d)}
|
|
|
1310
1310
|
[() => N(n.get(b))]
|
|
1311
1311
|
), n.append(e, v), n.pop();
|
|
1312
1312
|
}
|
|
1313
|
-
var
|
|
1314
|
-
function
|
|
1313
|
+
var lo = n.from_html("<div><!></div>");
|
|
1314
|
+
function ao(e, t) {
|
|
1315
1315
|
n.push(t, !0);
|
|
1316
1316
|
let r = n.prop(t, "isComposeMode", 3, !1), o = n.prop(t, "showDropContainers", 3, !1), s = n.prop(t, "isWithinCollection", 3, !1), i = n.prop(t, "deviceDisplayType", 3, "Desktop");
|
|
1317
1317
|
function l(w, b, v) {
|
|
1318
|
-
var
|
|
1318
|
+
var j;
|
|
1319
1319
|
const T = w && !v ? 3 : 1;
|
|
1320
|
-
return !!((
|
|
1320
|
+
return !!((j = b == null ? void 0 : b.columns) != null && j.length) && b.columns.length > T;
|
|
1321
1321
|
}
|
|
1322
|
-
const a = n.derived(() => !r() &&
|
|
1322
|
+
const a = n.derived(() => !r() && kr({ row: t.row, deviceDisplayType: i() })), d = n.derived(() => o() || xr(t.row) || l(r(), t.row, s())), u = n.derived(() => Lr({
|
|
1323
1323
|
row: t.row,
|
|
1324
1324
|
deviceDisplayType: i(),
|
|
1325
1325
|
isComposeMode: r()
|
|
1326
1326
|
})), c = n.derived(() => {
|
|
1327
1327
|
var b;
|
|
1328
|
-
const w =
|
|
1328
|
+
const w = G({
|
|
1329
1329
|
deviceDisplayType: i(),
|
|
1330
1330
|
componentAttributes: t.row.rowAttributes
|
|
1331
1331
|
});
|
|
1332
|
-
return
|
|
1332
|
+
return Oe((b = w == null ? void 0 : w.componentAttributesSpecificToDeviceType) == null ? void 0 : b[Re]) ?? "";
|
|
1333
1333
|
}), f = n.derived(() => n.get(d) ? n.get(c) : ""), p = n.derived(() => n.get(a) ? { display: "none" } : n.get(d) ? n.get(u) : { display: "contents" });
|
|
1334
|
-
var g =
|
|
1334
|
+
var g = lo(), A = n.child(g);
|
|
1335
1335
|
n.snippet(A, () => t.children), n.reset(g), n.template_effect(
|
|
1336
1336
|
(w) => {
|
|
1337
1337
|
n.set_attribute(g, "hidden", n.get(a) || void 0), n.set_class(g, 1, n.clsx(n.get(f) || void 0)), n.set_style(g, w);
|
|
@@ -1339,7 +1339,7 @@ function io(e, t) {
|
|
|
1339
1339
|
[() => N(n.get(p))]
|
|
1340
1340
|
), n.append(e, g), n.pop();
|
|
1341
1341
|
}
|
|
1342
|
-
const
|
|
1342
|
+
const Ct = [
|
|
1343
1343
|
"minWidth",
|
|
1344
1344
|
"maxWidth",
|
|
1345
1345
|
"minHeight",
|
|
@@ -1391,20 +1391,20 @@ const bt = [
|
|
|
1391
1391
|
"textAlign",
|
|
1392
1392
|
"textDecoration",
|
|
1393
1393
|
"textTransform"
|
|
1394
|
-
],
|
|
1394
|
+
], co = (e) => e != null && e !== "", uo = (e) => e ? Ct.reduce(
|
|
1395
1395
|
(t, r) => {
|
|
1396
1396
|
const o = e[r];
|
|
1397
|
-
return
|
|
1397
|
+
return co(o) && (t[r] = o), t;
|
|
1398
1398
|
},
|
|
1399
1399
|
{}
|
|
1400
|
-
) : {},
|
|
1400
|
+
) : {}, fo = (e) => {
|
|
1401
1401
|
if (!e)
|
|
1402
1402
|
return;
|
|
1403
1403
|
const t = { ...e };
|
|
1404
|
-
for (const r of
|
|
1404
|
+
for (const r of Ct)
|
|
1405
1405
|
delete t[r];
|
|
1406
1406
|
return Object.keys(t).length ? t : void 0;
|
|
1407
|
-
},
|
|
1407
|
+
}, go = (e) => Object.keys(e).length > 0, po = (e, t) => {
|
|
1408
1408
|
const r = (e == null ? void 0 : e.noContainer) ?? !1, o = e == null ? void 0 : e.resolveNoContainer;
|
|
1409
1409
|
if (typeof o != "function")
|
|
1410
1410
|
return r;
|
|
@@ -1422,7 +1422,7 @@ const bt = [
|
|
|
1422
1422
|
);
|
|
1423
1423
|
}
|
|
1424
1424
|
return r;
|
|
1425
|
-
},
|
|
1425
|
+
}, mo = (e, t) => {
|
|
1426
1426
|
const r = e == null ? void 0 : e.resolveRendersOwnElement;
|
|
1427
1427
|
if (typeof r != "function")
|
|
1428
1428
|
return !1;
|
|
@@ -1441,20 +1441,20 @@ const bt = [
|
|
|
1441
1441
|
}
|
|
1442
1442
|
return !1;
|
|
1443
1443
|
};
|
|
1444
|
-
var
|
|
1445
|
-
function
|
|
1444
|
+
var Xe = n.from_html("<div><!></div>");
|
|
1445
|
+
function yo(e, t) {
|
|
1446
1446
|
n.push(t, !0);
|
|
1447
|
-
const r = n.derived(() => t.components[
|
|
1447
|
+
const r = n.derived(() => t.components[rt(t.libraryId, t.componentType)]), o = n.derived(() => {
|
|
1448
1448
|
var v;
|
|
1449
1449
|
const b = (v = n.get(r)) == null ? void 0 : v.card;
|
|
1450
1450
|
return b || (console.error(`DisplayComponent: Component with type ${t.componentType}${t.libraryId ? ` (library "${t.libraryId}")` : ""} not found in components`), null);
|
|
1451
1451
|
}), s = n.derived(() => ({
|
|
1452
1452
|
componentAttributes: t.componentAttributes,
|
|
1453
1453
|
styleProps: t.styleProps
|
|
1454
|
-
})), i = n.derived(() => n.get(r) ?
|
|
1454
|
+
})), i = n.derived(() => n.get(r) ? po(n.get(r), n.get(s)) : !1), l = n.derived(() => uo(t.styleProps)), a = n.derived(() => n.get(i) ? fo(t.styleProps) : t.styleProps), d = n.derived(() => {
|
|
1455
1455
|
var b;
|
|
1456
|
-
return
|
|
1457
|
-
}), u = n.derived(() => n.get(i) &&
|
|
1456
|
+
return Oe((b = t.componentAttributes) == null ? void 0 : b[Re]);
|
|
1457
|
+
}), u = n.derived(() => n.get(i) && go(n.get(l))), c = n.derived(() => !n.get(i) || (n.get(r) ? mo(n.get(r), n.get(s)) : !1)), f = n.derived(() => !n.get(u) && n.get(c) ? n.get(d) : void 0), p = n.derived(() => ({
|
|
1458
1458
|
componentAttributes: t.componentAttributes,
|
|
1459
1459
|
styleProps: n.get(a),
|
|
1460
1460
|
className: n.get(f),
|
|
@@ -1467,31 +1467,31 @@ function po(e, t) {
|
|
|
1467
1467
|
{
|
|
1468
1468
|
var w = (b) => {
|
|
1469
1469
|
const v = n.derived(() => n.get(o));
|
|
1470
|
-
var T = n.comment(),
|
|
1470
|
+
var T = n.comment(), j = n.first_child(T);
|
|
1471
1471
|
{
|
|
1472
|
-
var U = (
|
|
1473
|
-
var E =
|
|
1474
|
-
n.component(
|
|
1475
|
-
L(
|
|
1472
|
+
var U = (C) => {
|
|
1473
|
+
var E = Xe(), I = n.child(E);
|
|
1474
|
+
n.component(I, () => n.get(v), (P, L) => {
|
|
1475
|
+
L(P, n.spread_props(() => n.get(p)));
|
|
1476
1476
|
}), n.reset(E), n.template_effect(
|
|
1477
|
-
(
|
|
1478
|
-
n.set_class(E, 1, n.clsx(n.get(d) || void 0)), n.set_style(E,
|
|
1477
|
+
(P) => {
|
|
1478
|
+
n.set_class(E, 1, n.clsx(n.get(d) || void 0)), n.set_style(E, P);
|
|
1479
1479
|
},
|
|
1480
1480
|
[() => N(n.get(l))]
|
|
1481
|
-
), n.append(
|
|
1482
|
-
}, h = (
|
|
1483
|
-
var E =
|
|
1484
|
-
n.component(
|
|
1485
|
-
L(
|
|
1486
|
-
}), n.reset(E), n.template_effect(() => n.set_class(E, 1, n.clsx(n.get(d)))), n.append(
|
|
1487
|
-
},
|
|
1488
|
-
var E = n.comment(),
|
|
1489
|
-
n.component(
|
|
1490
|
-
L(
|
|
1491
|
-
}), n.append(
|
|
1481
|
+
), n.append(C, E);
|
|
1482
|
+
}, h = (C) => {
|
|
1483
|
+
var E = Xe(), I = n.child(E);
|
|
1484
|
+
n.component(I, () => n.get(v), (P, L) => {
|
|
1485
|
+
L(P, n.spread_props(() => n.get(p)));
|
|
1486
|
+
}), n.reset(E), n.template_effect(() => n.set_class(E, 1, n.clsx(n.get(d)))), n.append(C, E);
|
|
1487
|
+
}, _ = (C) => {
|
|
1488
|
+
var E = n.comment(), I = n.first_child(E);
|
|
1489
|
+
n.component(I, () => n.get(v), (P, L) => {
|
|
1490
|
+
L(P, n.spread_props(() => n.get(p)));
|
|
1491
|
+
}), n.append(C, E);
|
|
1492
1492
|
};
|
|
1493
|
-
n.if(
|
|
1494
|
-
n.get(u) ?
|
|
1493
|
+
n.if(j, (C) => {
|
|
1494
|
+
n.get(u) ? C(U) : !n.get(c) && n.get(d) ? C(h, 1) : C(_, -1);
|
|
1495
1495
|
});
|
|
1496
1496
|
}
|
|
1497
1497
|
n.append(b, T);
|
|
@@ -1502,11 +1502,11 @@ function po(e, t) {
|
|
|
1502
1502
|
}
|
|
1503
1503
|
n.append(e, g), n.pop();
|
|
1504
1504
|
}
|
|
1505
|
-
var
|
|
1506
|
-
function
|
|
1505
|
+
var ho = n.from_html("<div><!></div>"), bo = n.from_html("<div><!> <!></div>");
|
|
1506
|
+
function Ee(e, t) {
|
|
1507
1507
|
n.push(t, !0);
|
|
1508
1508
|
const r = (h) => {
|
|
1509
|
-
|
|
1509
|
+
io(h, {
|
|
1510
1510
|
get displayItemList() {
|
|
1511
1511
|
return t.displayItemList;
|
|
1512
1512
|
},
|
|
@@ -1522,10 +1522,10 @@ function we(e, t) {
|
|
|
1522
1522
|
get deviceDisplayType() {
|
|
1523
1523
|
return t.deviceDisplayType;
|
|
1524
1524
|
},
|
|
1525
|
-
children: (
|
|
1526
|
-
var E = n.comment(),
|
|
1527
|
-
n.each(
|
|
1528
|
-
|
|
1525
|
+
children: (_, C) => {
|
|
1526
|
+
var E = n.comment(), I = n.first_child(E);
|
|
1527
|
+
n.each(I, 17, () => t.displayItemList.rows, (P) => P.id, (P, L) => {
|
|
1528
|
+
ao(P, {
|
|
1529
1529
|
get row() {
|
|
1530
1530
|
return n.get(L);
|
|
1531
1531
|
},
|
|
@@ -1541,21 +1541,21 @@ function we(e, t) {
|
|
|
1541
1541
|
get deviceDisplayType() {
|
|
1542
1542
|
return t.deviceDisplayType;
|
|
1543
1543
|
},
|
|
1544
|
-
children: (
|
|
1545
|
-
var te = n.comment(),
|
|
1546
|
-
n.each(
|
|
1544
|
+
children: (J, ee) => {
|
|
1545
|
+
var te = n.comment(), oe = n.first_child(te);
|
|
1546
|
+
n.each(oe, 17, () => n.get(L).columns, (q) => q.id, (q, V) => {
|
|
1547
1547
|
var se = n.comment(), pe = n.first_child(se);
|
|
1548
1548
|
{
|
|
1549
|
-
var
|
|
1550
|
-
const
|
|
1551
|
-
var
|
|
1549
|
+
var me = (y) => {
|
|
1550
|
+
const m = n.derived(() => p(n.get(V)));
|
|
1551
|
+
var S = n.comment(), D = n.first_child(S);
|
|
1552
1552
|
{
|
|
1553
|
-
var
|
|
1553
|
+
var M = (O) => {
|
|
1554
1554
|
{
|
|
1555
|
-
let
|
|
1556
|
-
|
|
1555
|
+
let Y = n.derived(() => g(n.get(V).id));
|
|
1556
|
+
Ee(O, {
|
|
1557
1557
|
get displayItemList() {
|
|
1558
|
-
return n.get(
|
|
1558
|
+
return n.get(m);
|
|
1559
1559
|
},
|
|
1560
1560
|
get isComposeMode() {
|
|
1561
1561
|
return o();
|
|
@@ -1586,14 +1586,14 @@ function we(e, t) {
|
|
|
1586
1586
|
return t.placeholderValues;
|
|
1587
1587
|
},
|
|
1588
1588
|
get ancestorColumnIds() {
|
|
1589
|
-
return n.get(
|
|
1589
|
+
return n.get(Y);
|
|
1590
1590
|
}
|
|
1591
1591
|
});
|
|
1592
1592
|
}
|
|
1593
|
-
},
|
|
1593
|
+
}, R = (O) => {
|
|
1594
1594
|
{
|
|
1595
|
-
let
|
|
1596
|
-
|
|
1595
|
+
let Y = n.derived(() => f(n.get(V)).componentAttributes), ie = n.derived(() => f(n.get(V)).styleProps), ne = n.derived(() => b(n.get(V).id)), We = n.derived(A), Ve = n.derived(() => w(n.get(V).id));
|
|
1596
|
+
yo(O, {
|
|
1597
1597
|
get componentType() {
|
|
1598
1598
|
return n.get(V).type;
|
|
1599
1599
|
},
|
|
@@ -1601,22 +1601,22 @@ function we(e, t) {
|
|
|
1601
1601
|
return n.get(V).libraryId;
|
|
1602
1602
|
},
|
|
1603
1603
|
get componentAttributes() {
|
|
1604
|
-
return n.get(
|
|
1604
|
+
return n.get(Y);
|
|
1605
1605
|
},
|
|
1606
1606
|
get components() {
|
|
1607
1607
|
return n.get(l);
|
|
1608
1608
|
},
|
|
1609
1609
|
get styleProps() {
|
|
1610
|
-
return n.get(
|
|
1610
|
+
return n.get(ie);
|
|
1611
1611
|
},
|
|
1612
1612
|
get widgetInstanceProps() {
|
|
1613
|
-
return n.get(
|
|
1613
|
+
return n.get(ne);
|
|
1614
1614
|
},
|
|
1615
1615
|
get pageViewType() {
|
|
1616
|
-
return n.get(
|
|
1616
|
+
return n.get(We);
|
|
1617
1617
|
},
|
|
1618
1618
|
get columnPath() {
|
|
1619
|
-
return n.get(
|
|
1619
|
+
return n.get(Ve);
|
|
1620
1620
|
},
|
|
1621
1621
|
get mounts() {
|
|
1622
1622
|
return t.mounts;
|
|
@@ -1624,40 +1624,40 @@ function we(e, t) {
|
|
|
1624
1624
|
});
|
|
1625
1625
|
}
|
|
1626
1626
|
};
|
|
1627
|
-
n.if(
|
|
1628
|
-
n.get(
|
|
1627
|
+
n.if(D, (O) => {
|
|
1628
|
+
n.get(m) ? O(M) : O(R, -1);
|
|
1629
1629
|
});
|
|
1630
1630
|
}
|
|
1631
|
-
n.append(
|
|
1632
|
-
},
|
|
1633
|
-
n.if(pe, (
|
|
1634
|
-
n.get(
|
|
1631
|
+
n.append(y, S);
|
|
1632
|
+
}, ye = n.derived(() => c(n.get(V)));
|
|
1633
|
+
n.if(pe, (y) => {
|
|
1634
|
+
n.get(ye) && y(me);
|
|
1635
1635
|
});
|
|
1636
1636
|
}
|
|
1637
|
-
n.append(
|
|
1638
|
-
}), n.append(
|
|
1637
|
+
n.append(q, se);
|
|
1638
|
+
}), n.append(J, te);
|
|
1639
1639
|
},
|
|
1640
1640
|
$$slots: { default: !0 }
|
|
1641
1641
|
});
|
|
1642
|
-
}), n.append(
|
|
1642
|
+
}), n.append(_, E);
|
|
1643
1643
|
},
|
|
1644
1644
|
$$slots: { default: !0 }
|
|
1645
1645
|
});
|
|
1646
1646
|
};
|
|
1647
1647
|
let o = n.prop(t, "isComposeMode", 3, !1), s = n.prop(t, "isWithinCollection", 3, !1), i = n.prop(t, "showDropContainers", 3, !1);
|
|
1648
|
-
const l = n.derived(() =>
|
|
1648
|
+
const l = n.derived(() => Ce(t.plugins).components), a = n.derived(() => !o() && Fr(t.displayItemList) && !je({
|
|
1649
1649
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1650
1650
|
deviceDisplayType: t.deviceDisplayType
|
|
1651
1651
|
})), d = n.derived(() => {
|
|
1652
|
-
const h =
|
|
1652
|
+
const h = Ge({
|
|
1653
1653
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1654
1654
|
deviceDisplayType: t.deviceDisplayType
|
|
1655
1655
|
});
|
|
1656
|
-
return
|
|
1656
|
+
return zr({
|
|
1657
1657
|
isWithinCollection: s(),
|
|
1658
|
-
baseDeclaresOwnHeight:
|
|
1658
|
+
baseDeclaresOwnHeight: yt({
|
|
1659
1659
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1660
|
-
widgetContainerStyles:
|
|
1660
|
+
widgetContainerStyles: mt({
|
|
1661
1661
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1662
1662
|
deviceDisplayType: t.deviceDisplayType,
|
|
1663
1663
|
isComposeMode: o()
|
|
@@ -1666,18 +1666,18 @@ function we(e, t) {
|
|
|
1666
1666
|
baseZIndex: h
|
|
1667
1667
|
});
|
|
1668
1668
|
}), u = n.derived(() => {
|
|
1669
|
-
var
|
|
1670
|
-
const h = ((
|
|
1669
|
+
var C;
|
|
1670
|
+
const h = ((C = t.displayItemList.overlayLayers) == null ? void 0 : C.layers) ?? [], _ = Ge({
|
|
1671
1671
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1672
1672
|
deviceDisplayType: t.deviceDisplayType
|
|
1673
1673
|
});
|
|
1674
|
-
return h.flatMap((E,
|
|
1674
|
+
return h.flatMap((E, I) => Ur({ layer: E, deviceDisplayType: t.deviceDisplayType }) ? [] : [
|
|
1675
1675
|
{
|
|
1676
|
-
index:
|
|
1676
|
+
index: I,
|
|
1677
1677
|
layer: E,
|
|
1678
|
-
boxStyles:
|
|
1679
|
-
zIndex:
|
|
1680
|
-
pointerEvents:
|
|
1678
|
+
boxStyles: Hr({
|
|
1679
|
+
zIndex: Kr(_, I),
|
|
1680
|
+
pointerEvents: Br({
|
|
1681
1681
|
containerAttributes: E.containerAttributes,
|
|
1682
1682
|
deviceDisplayType: t.deviceDisplayType
|
|
1683
1683
|
})
|
|
@@ -1686,50 +1686,50 @@ function we(e, t) {
|
|
|
1686
1686
|
]);
|
|
1687
1687
|
});
|
|
1688
1688
|
function c(h) {
|
|
1689
|
-
if (o() && h.type ===
|
|
1689
|
+
if (o() && h.type === Ie.DroppableBox)
|
|
1690
1690
|
return !1;
|
|
1691
|
-
const { componentAttributesBasedOnDevice:
|
|
1691
|
+
const { componentAttributesBasedOnDevice: _ } = He({
|
|
1692
1692
|
col: h,
|
|
1693
1693
|
deviceDisplayType: t.deviceDisplayType,
|
|
1694
1694
|
isComposeMode: o(),
|
|
1695
|
-
sourceComponentsPlugin:
|
|
1696
|
-
}),
|
|
1697
|
-
return !(!o() &&
|
|
1695
|
+
sourceComponentsPlugin: Ce(t.plugins)
|
|
1696
|
+
}), C = !!_ && _["hide-component-3-resolutions"] === "true";
|
|
1697
|
+
return !(!o() && C);
|
|
1698
1698
|
}
|
|
1699
1699
|
function f(h) {
|
|
1700
|
-
const { componentAttributesBasedOnDevice:
|
|
1700
|
+
const { componentAttributesBasedOnDevice: _, componentStyles: C } = He({
|
|
1701
1701
|
col: h,
|
|
1702
1702
|
deviceDisplayType: t.deviceDisplayType,
|
|
1703
1703
|
isComposeMode: o(),
|
|
1704
|
-
sourceComponentsPlugin:
|
|
1704
|
+
sourceComponentsPlugin: Ce(t.plugins)
|
|
1705
1705
|
});
|
|
1706
1706
|
return {
|
|
1707
|
-
componentAttributes:
|
|
1708
|
-
styleProps:
|
|
1707
|
+
componentAttributes: _,
|
|
1708
|
+
styleProps: C
|
|
1709
1709
|
};
|
|
1710
1710
|
}
|
|
1711
1711
|
function p(h) {
|
|
1712
|
-
const
|
|
1713
|
-
if (!(
|
|
1712
|
+
const _ = ut(h.type);
|
|
1713
|
+
if (!(_ != null && _.length))
|
|
1714
1714
|
return null;
|
|
1715
|
-
const
|
|
1716
|
-
if (!
|
|
1717
|
-
throw new Error(`DisplayCollection - Collection with ID ${
|
|
1718
|
-
return !
|
|
1715
|
+
const C = h.collection ?? t.widgetCollections[_];
|
|
1716
|
+
if (!C)
|
|
1717
|
+
throw new Error(`DisplayCollection - Collection with ID ${_} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`);
|
|
1718
|
+
return !C.collectionRows || !Pr(C.collectionRows) ? null : C.collectionRows;
|
|
1719
1719
|
}
|
|
1720
1720
|
function g(h) {
|
|
1721
1721
|
return [...t.ancestorColumnIds ?? [], h];
|
|
1722
1722
|
}
|
|
1723
1723
|
function A() {
|
|
1724
|
-
return o() ?
|
|
1724
|
+
return o() ? Ue.Compose : Ue.RenderedPage;
|
|
1725
1725
|
}
|
|
1726
1726
|
function w(h) {
|
|
1727
1727
|
if (!(o() || !h))
|
|
1728
|
-
return [...t.ancestorColumnIds ?? [], h].join(
|
|
1728
|
+
return [...t.ancestorColumnIds ?? [], h].join(fe);
|
|
1729
1729
|
}
|
|
1730
1730
|
function b(h) {
|
|
1731
|
-
return
|
|
1732
|
-
widgetInstanceProps:
|
|
1731
|
+
return Yr({
|
|
1732
|
+
widgetInstanceProps: Gr({
|
|
1733
1733
|
componentProps: t.componentProps,
|
|
1734
1734
|
ancestorColumnIds: t.ancestorColumnIds,
|
|
1735
1735
|
columnId: h
|
|
@@ -1739,15 +1739,15 @@ function we(e, t) {
|
|
|
1739
1739
|
}
|
|
1740
1740
|
var v = n.comment(), T = n.first_child(v);
|
|
1741
1741
|
{
|
|
1742
|
-
var
|
|
1743
|
-
var
|
|
1744
|
-
r(
|
|
1745
|
-
var E = n.sibling(
|
|
1746
|
-
n.each(E, 17, () => n.get(u), (
|
|
1747
|
-
var L =
|
|
1748
|
-
|
|
1742
|
+
var j = (h) => {
|
|
1743
|
+
var _ = bo(), C = n.child(_);
|
|
1744
|
+
r(C);
|
|
1745
|
+
var E = n.sibling(C, 2);
|
|
1746
|
+
n.each(E, 17, () => n.get(u), (I) => I.index, (I, P) => {
|
|
1747
|
+
var L = ho(), J = n.child(L);
|
|
1748
|
+
Ee(J, {
|
|
1749
1749
|
get displayItemList() {
|
|
1750
|
-
return n.get(
|
|
1750
|
+
return n.get(P).layer;
|
|
1751
1751
|
},
|
|
1752
1752
|
get isComposeMode() {
|
|
1753
1753
|
return o();
|
|
@@ -1780,26 +1780,26 @@ function we(e, t) {
|
|
|
1780
1780
|
}
|
|
1781
1781
|
}), n.reset(L), n.template_effect(
|
|
1782
1782
|
(ee) => {
|
|
1783
|
-
n.set_attribute(L, "data-rulecms-overlay-layer", n.get(
|
|
1783
|
+
n.set_attribute(L, "data-rulecms-overlay-layer", n.get(P).index), n.set_style(L, ee);
|
|
1784
1784
|
},
|
|
1785
|
-
[() => N(n.get(
|
|
1786
|
-
), n.append(
|
|
1787
|
-
}), n.reset(
|
|
1785
|
+
[() => N(n.get(P).boxStyles)]
|
|
1786
|
+
), n.append(I, L);
|
|
1787
|
+
}), n.reset(_), n.template_effect((I) => n.set_style(_, I), [() => N(n.get(d))]), n.append(h, _);
|
|
1788
1788
|
}, U = (h) => {
|
|
1789
1789
|
r(h);
|
|
1790
1790
|
};
|
|
1791
1791
|
n.if(T, (h) => {
|
|
1792
|
-
n.get(a) ? h(
|
|
1792
|
+
n.get(a) ? h(j) : h(U, -1);
|
|
1793
1793
|
});
|
|
1794
1794
|
}
|
|
1795
1795
|
n.append(e, v), n.pop();
|
|
1796
1796
|
}
|
|
1797
|
-
function
|
|
1797
|
+
function Se(e, t) {
|
|
1798
1798
|
n.push(t, !0);
|
|
1799
1799
|
var r = n.comment(), o = n.first_child(r);
|
|
1800
1800
|
{
|
|
1801
1801
|
var s = (i) => {
|
|
1802
|
-
|
|
1802
|
+
Ee(i, {
|
|
1803
1803
|
get displayItemList() {
|
|
1804
1804
|
return t.displayItemList;
|
|
1805
1805
|
},
|
|
@@ -1845,7 +1845,7 @@ function Ae(e, t) {
|
|
|
1845
1845
|
}
|
|
1846
1846
|
n.append(e, r), n.pop();
|
|
1847
1847
|
}
|
|
1848
|
-
function
|
|
1848
|
+
function _t(e, t) {
|
|
1849
1849
|
var r = n.comment(), o = n.first_child(r);
|
|
1850
1850
|
n.each(
|
|
1851
1851
|
o,
|
|
@@ -1862,18 +1862,18 @@ function vt(e, t) {
|
|
|
1862
1862
|
}
|
|
1863
1863
|
), n.append(e, r);
|
|
1864
1864
|
}
|
|
1865
|
-
let
|
|
1866
|
-
var
|
|
1867
|
-
function
|
|
1865
|
+
let vo = 0;
|
|
1866
|
+
var Co = n.from_html("<div><!></div>"), Je = n.from_html("<!> <!>", 1);
|
|
1867
|
+
function _o(e, t) {
|
|
1868
1868
|
n.push(t, !0);
|
|
1869
|
-
const r = ["Phone", "Tablet", "Desktop"], o = `rulecms-bp-${++
|
|
1870
|
-
var a =
|
|
1869
|
+
const r = ["Phone", "Tablet", "Desktop"], o = `rulecms-bp-${++vo}`, s = n.derived(() => t.scopeIdInput ?? o), i = n.derived(() => eo(t.displayItemList, t.widgetCollections)), l = n.derived(() => ro(n.get(s)));
|
|
1870
|
+
var a = Je(), d = n.first_child(a);
|
|
1871
1871
|
{
|
|
1872
1872
|
let p = n.derived(() => {
|
|
1873
1873
|
var g;
|
|
1874
1874
|
return (g = t.plugins.sourceComponents) == null ? void 0 : g.stylesheets;
|
|
1875
1875
|
});
|
|
1876
|
-
|
|
1876
|
+
_t(d, {
|
|
1877
1877
|
get stylesheets() {
|
|
1878
1878
|
return n.get(p);
|
|
1879
1879
|
}
|
|
@@ -1882,7 +1882,7 @@ function vo(e, t) {
|
|
|
1882
1882
|
var u = n.sibling(d, 2);
|
|
1883
1883
|
{
|
|
1884
1884
|
var c = (p) => {
|
|
1885
|
-
|
|
1885
|
+
Se(p, {
|
|
1886
1886
|
get displayItemList() {
|
|
1887
1887
|
return t.displayItemList;
|
|
1888
1888
|
},
|
|
@@ -1908,15 +1908,15 @@ function vo(e, t) {
|
|
|
1908
1908
|
}
|
|
1909
1909
|
});
|
|
1910
1910
|
}, f = (p) => {
|
|
1911
|
-
var g =
|
|
1911
|
+
var g = Je(), A = n.first_child(g);
|
|
1912
1912
|
n.element(A, () => "style", !1, (b, v) => {
|
|
1913
1913
|
var T = n.text();
|
|
1914
1914
|
n.template_effect(() => n.set_text(T, n.get(l))), n.append(v, T);
|
|
1915
1915
|
});
|
|
1916
1916
|
var w = n.sibling(A, 2);
|
|
1917
1917
|
n.each(w, 16, () => r, (b) => b, (b, v) => {
|
|
1918
|
-
var T =
|
|
1919
|
-
|
|
1918
|
+
var T = Co(), j = n.child(T);
|
|
1919
|
+
Se(j, {
|
|
1920
1920
|
get displayItemList() {
|
|
1921
1921
|
return t.displayItemList;
|
|
1922
1922
|
},
|
|
@@ -1951,7 +1951,7 @@ function vo(e, t) {
|
|
|
1951
1951
|
}
|
|
1952
1952
|
n.append(e, a), n.pop();
|
|
1953
1953
|
}
|
|
1954
|
-
function
|
|
1954
|
+
function wo(e, t, r) {
|
|
1955
1955
|
if (e)
|
|
1956
1956
|
return "Phone";
|
|
1957
1957
|
if (t)
|
|
@@ -1959,18 +1959,18 @@ function Co(e, t, r) {
|
|
|
1959
1959
|
const o = (r == null ? void 0 : r.toLowerCase()) || "desktop";
|
|
1960
1960
|
return o === "phone" ? "Phone" : o === "tablet" ? "Tablet" : "Desktop";
|
|
1961
1961
|
}
|
|
1962
|
-
const
|
|
1963
|
-
var
|
|
1964
|
-
function
|
|
1962
|
+
const Ao = `(max-width: ${ft})`, Eo = `(max-width: ${gt})`;
|
|
1963
|
+
var So = n.from_html("<!> <!>", 1);
|
|
1964
|
+
function To(e, t) {
|
|
1965
1965
|
n.push(t, !0);
|
|
1966
1966
|
let r = n.state("Desktop"), o, s;
|
|
1967
1967
|
function i() {
|
|
1968
|
-
n.set(r,
|
|
1968
|
+
n.set(r, wo((o == null ? void 0 : o.matches) ?? !1, (s == null ? void 0 : s.matches) ?? !1, t.reduxDeviceDisplayType), !0);
|
|
1969
1969
|
}
|
|
1970
|
-
n.user_effect(() => (typeof matchMedia == "function" && (o = matchMedia(
|
|
1970
|
+
n.user_effect(() => (typeof matchMedia == "function" && (o = matchMedia(Ao), s = matchMedia(Eo), o.addEventListener("change", i), s.addEventListener("change", i)), i(), () => {
|
|
1971
1971
|
o == null || o.removeEventListener("change", i), s == null || s.removeEventListener("change", i);
|
|
1972
1972
|
}));
|
|
1973
|
-
var l =
|
|
1973
|
+
var l = So(), a = n.first_child(l);
|
|
1974
1974
|
{
|
|
1975
1975
|
var d = (c) => {
|
|
1976
1976
|
{
|
|
@@ -1978,7 +1978,7 @@ function Eo(e, t) {
|
|
|
1978
1978
|
var p;
|
|
1979
1979
|
return (p = t.plugins.sourceComponents) == null ? void 0 : p.stylesheets;
|
|
1980
1980
|
});
|
|
1981
|
-
|
|
1981
|
+
_t(c, {
|
|
1982
1982
|
get stylesheets() {
|
|
1983
1983
|
return n.get(f);
|
|
1984
1984
|
}
|
|
@@ -1990,7 +1990,7 @@ function Eo(e, t) {
|
|
|
1990
1990
|
});
|
|
1991
1991
|
}
|
|
1992
1992
|
var u = n.sibling(a, 2);
|
|
1993
|
-
|
|
1993
|
+
Se(u, {
|
|
1994
1994
|
get displayItemList() {
|
|
1995
1995
|
return t.displayItemList;
|
|
1996
1996
|
},
|
|
@@ -2026,14 +2026,14 @@ function Eo(e, t) {
|
|
|
2026
2026
|
}
|
|
2027
2027
|
}), n.append(e, l), n.pop();
|
|
2028
2028
|
}
|
|
2029
|
-
function
|
|
2029
|
+
function wt(e) {
|
|
2030
2030
|
return e !== !1;
|
|
2031
2031
|
}
|
|
2032
|
-
const
|
|
2032
|
+
const Io = ["utilities", "components"], Po = new Set(Io), At = (e) => typeof e == "string" && Po.has(e), Do = (e) => e.split(`
|
|
2033
2033
|
`).map((t) => t.length > 0 ? ` ${t}` : t).join(`
|
|
2034
|
-
`),
|
|
2035
|
-
${
|
|
2036
|
-
}` : e : null,
|
|
2034
|
+
`), xo = (e, t) => e ? At(t) ? `@layer ${t} {
|
|
2035
|
+
${Do(e)}
|
|
2036
|
+
}` : e : null, ko = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Lo = (e) => e.replace(/[^A-Za-z0-9_-]/g, (t) => `\\${t}`), Ro = ["</", "<script", "@import", "javascript:", "vbscript:", "expression("], Oo = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, jo = /[\s{};"]/, No = /^[A-Za-z0-9_:%./[\]%-]+$/, Mo = (e) => {
|
|
2037
2037
|
let t = 0;
|
|
2038
2038
|
for (const r of e)
|
|
2039
2039
|
if (r === "{")
|
|
@@ -2041,46 +2041,46 @@ ${Io(e)}
|
|
|
2041
2041
|
else if (r === "}" && (t -= 1, t < 0))
|
|
2042
2042
|
return !1;
|
|
2043
2043
|
return t === 0;
|
|
2044
|
-
},
|
|
2044
|
+
}, Wo = (e) => {
|
|
2045
2045
|
const t = e.startsWith(".") ? e.slice(1) : e;
|
|
2046
|
-
return !t || t.length > 200 || t.startsWith(".") ||
|
|
2047
|
-
},
|
|
2046
|
+
return !t || t.length > 200 || t.startsWith(".") || jo.test(t) ? !1 : No.test(t);
|
|
2047
|
+
}, Vo = (e) => {
|
|
2048
2048
|
const t = e.trim();
|
|
2049
|
-
if (!t || t.length > 4e3 ||
|
|
2049
|
+
if (!t || t.length > 4e3 || Oo.test(t) || !Mo(t))
|
|
2050
2050
|
return !1;
|
|
2051
2051
|
const r = t.toLowerCase();
|
|
2052
|
-
return !
|
|
2053
|
-
},
|
|
2052
|
+
return !Ro.some((o) => r.includes(o));
|
|
2053
|
+
}, Fo = (e) => {
|
|
2054
2054
|
if (!e)
|
|
2055
2055
|
return {};
|
|
2056
2056
|
const t = {};
|
|
2057
2057
|
for (const [r, o] of Object.entries(e)) {
|
|
2058
2058
|
const s = r.startsWith(".") ? r.slice(1) : r.trim();
|
|
2059
|
-
if (!
|
|
2059
|
+
if (!Wo(s) || typeof o != "string")
|
|
2060
2060
|
continue;
|
|
2061
2061
|
const i = o.trim();
|
|
2062
|
-
|
|
2062
|
+
Vo(i) && (t[s] = i);
|
|
2063
2063
|
}
|
|
2064
2064
|
return t;
|
|
2065
|
-
},
|
|
2065
|
+
}, Ko = (e) => e.split(`
|
|
2066
2066
|
`).map((t) => ` ${t}`).join(`
|
|
2067
|
-
`),
|
|
2068
|
-
if (!
|
|
2067
|
+
`), Bo = (e, t, r, o) => {
|
|
2068
|
+
if (!wt(r))
|
|
2069
2069
|
return null;
|
|
2070
|
-
const s =
|
|
2070
|
+
const s = Fo(t), i = Object.keys(s);
|
|
2071
2071
|
if (i.length === 0 || !e)
|
|
2072
2072
|
return null;
|
|
2073
|
-
const l = `[data-rulecms-published-key="${
|
|
2074
|
-
(d) => `${l} .${
|
|
2075
|
-
${
|
|
2073
|
+
const l = `[data-rulecms-published-key="${ko(e)}"]`, a = i.sort((d, u) => d.localeCompare(u)).map(
|
|
2074
|
+
(d) => `${l} .${Lo(d)} {
|
|
2075
|
+
${Ko(s[d])}
|
|
2076
2076
|
}`
|
|
2077
2077
|
).join(`
|
|
2078
2078
|
`);
|
|
2079
|
-
return
|
|
2079
|
+
return xo(a, o);
|
|
2080
2080
|
};
|
|
2081
|
-
function
|
|
2081
|
+
function Uo(e, t) {
|
|
2082
2082
|
n.push(t, !0);
|
|
2083
|
-
const r = n.derived(() =>
|
|
2083
|
+
const r = n.derived(() => Bo(t.publishedKey, t.classes, void 0, t.classLayer));
|
|
2084
2084
|
var o = n.comment(), s = n.first_child(o);
|
|
2085
2085
|
{
|
|
2086
2086
|
var i = (l) => {
|
|
@@ -2097,10 +2097,10 @@ function Ko(e, t) {
|
|
|
2097
2097
|
}
|
|
2098
2098
|
n.append(e, o), n.pop();
|
|
2099
2099
|
}
|
|
2100
|
-
function
|
|
2100
|
+
function Ne(e) {
|
|
2101
2101
|
return e !== !1;
|
|
2102
2102
|
}
|
|
2103
|
-
const
|
|
2103
|
+
const Et = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), zo = /* @__PURE__ */ new Set([
|
|
2104
2104
|
"serif",
|
|
2105
2105
|
"sans-serif",
|
|
2106
2106
|
"monospace",
|
|
@@ -2114,25 +2114,25 @@ const wt = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Bo = /* @__PURE
|
|
|
2114
2114
|
"emoji",
|
|
2115
2115
|
"math",
|
|
2116
2116
|
"fangsong"
|
|
2117
|
-
]),
|
|
2117
|
+
]), Ho = /^[a-zA-Z_\u00A0-\uFFFF-][a-zA-Z0-9_\u00A0-\uFFFF-]*$/, Go = /url\(|@|[{};\\<>]|javascript:/i, Yo = /url\(|@|[{};\\<>]|javascript:|expression\(/i, Xo = /^--[A-Za-z_][\w-]*$/, Jo = /^[A-Za-z0-9 ]+$/, qo = /* @__PURE__ */ new Set([100, 200, 300, 400, 500, 600, 700, 800, 900]), Zo = 4, Qo = 8, $o = 255, Te = (e) => zo.has(e.toLowerCase()) || Ho.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`, qe = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 80 && !e.includes(",") && !Go.test(e), es = (e) => typeof e == "string" && Xo.test(e.trim()) && e.trim().length <= 80, ts = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !Yo.test(e), ns = (e) => typeof e != "number" || !Number.isInteger(e) || e < 0 || e > $o ? null : e, rs = (e, t, r) => {
|
|
2118
2118
|
if (!Array.isArray(e))
|
|
2119
2119
|
return [];
|
|
2120
2120
|
const o = [];
|
|
2121
2121
|
for (const s of e) {
|
|
2122
|
-
if (!s || typeof s != "object" || o.length >=
|
|
2122
|
+
if (!s || typeof s != "object" || o.length >= Zo)
|
|
2123
2123
|
continue;
|
|
2124
2124
|
const i = s;
|
|
2125
|
-
if (!
|
|
2125
|
+
if (!es(i.name))
|
|
2126
2126
|
continue;
|
|
2127
2127
|
const l = i.name.trim();
|
|
2128
2128
|
if (t.has(l))
|
|
2129
2129
|
continue;
|
|
2130
2130
|
const a = [], d = /* @__PURE__ */ new Set();
|
|
2131
2131
|
for (const c of i.overrideColors ?? []) {
|
|
2132
|
-
if (a.length >=
|
|
2132
|
+
if (a.length >= Qo)
|
|
2133
2133
|
break;
|
|
2134
|
-
const f =
|
|
2135
|
-
f === null || d.has(f) ||
|
|
2134
|
+
const f = ns(c == null ? void 0 : c.index);
|
|
2135
|
+
f === null || d.has(f) || !ts(c == null ? void 0 : c.color) || (d.add(f), a.push({ index: f, color: c.color.trim() }));
|
|
2136
2136
|
}
|
|
2137
2137
|
a.sort((c, f) => c.index - f.index);
|
|
2138
2138
|
const u = i.applyToWidget === !0 && !r.current;
|
|
@@ -2143,24 +2143,24 @@ const wt = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Bo = /* @__PURE
|
|
|
2143
2143
|
});
|
|
2144
2144
|
}
|
|
2145
2145
|
return o;
|
|
2146
|
-
},
|
|
2146
|
+
}, ge = (e) => {
|
|
2147
2147
|
var l;
|
|
2148
2148
|
if (!Array.isArray(e))
|
|
2149
2149
|
return [];
|
|
2150
2150
|
const t = [], r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = { current: !1 };
|
|
2151
2151
|
let i = !1;
|
|
2152
2152
|
for (const a of e) {
|
|
2153
|
-
if (!a || !
|
|
2153
|
+
if (!a || !qe(a.family))
|
|
2154
2154
|
continue;
|
|
2155
2155
|
const d = a.family.trim(), u = d.toLowerCase();
|
|
2156
2156
|
if (r.has(u) || t.length >= 12)
|
|
2157
2157
|
continue;
|
|
2158
|
-
const c = (a.fallbacks ?? []).filter(
|
|
2158
|
+
const c = (a.fallbacks ?? []).filter(qe).slice(0, 8), f = typeof a.cssVariable == "string" && $(a.cssVariable.trim()) ? a.cssVariable.trim() : void 0;
|
|
2159
2159
|
let p = { kind: "stack-only" };
|
|
2160
2160
|
if (((l = a.source) == null ? void 0 : l.kind) === "google") {
|
|
2161
|
-
if (!
|
|
2161
|
+
if (!Jo.test(d))
|
|
2162
2162
|
continue;
|
|
2163
|
-
const b = (Array.isArray(a.source.weights) ? a.source.weights : []).filter((v) => typeof v == "number" &&
|
|
2163
|
+
const b = (Array.isArray(a.source.weights) ? a.source.weights : []).filter((v) => typeof v == "number" && qo.has(v)).filter((v, T, j) => j.indexOf(v) === T).sort((v, T) => v - T);
|
|
2164
2164
|
if (b.length === 0)
|
|
2165
2165
|
continue;
|
|
2166
2166
|
p = { kind: "google", weights: b };
|
|
@@ -2168,7 +2168,7 @@ const wt = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Bo = /* @__PURE
|
|
|
2168
2168
|
r.add(u);
|
|
2169
2169
|
const g = a.applyToWidget === !0 && !i;
|
|
2170
2170
|
g && (i = !0);
|
|
2171
|
-
const A =
|
|
2171
|
+
const A = rs(a.palettes, o, s);
|
|
2172
2172
|
t.push({
|
|
2173
2173
|
family: d,
|
|
2174
2174
|
...f ? { cssVariable: f } : {},
|
|
@@ -2179,17 +2179,17 @@ const wt = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Bo = /* @__PURE
|
|
|
2179
2179
|
});
|
|
2180
2180
|
}
|
|
2181
2181
|
return t;
|
|
2182
|
-
},
|
|
2183
|
-
const t =
|
|
2182
|
+
}, os = (e) => {
|
|
2183
|
+
const t = ge(e).filter((r) => r.source.kind === "google").map((r) => {
|
|
2184
2184
|
const o = r.source.kind === "google" ? r.source.weights.join(";") : "400";
|
|
2185
2185
|
return `family=${r.family.replace(/ /g, "+")}:wght@${o}`;
|
|
2186
2186
|
});
|
|
2187
2187
|
return t.length === 0 ? null : `https://fonts.googleapis.com/css2?${t.join("&")}&display=swap`;
|
|
2188
|
-
},
|
|
2188
|
+
}, ss = (e) => [Te(e.family), ...(e.fallbacks ?? []).map(Te)].join(", "), is = (e) => {
|
|
2189
2189
|
const t = [];
|
|
2190
2190
|
for (const r of e)
|
|
2191
2191
|
for (const o of r.palettes ?? []) {
|
|
2192
|
-
const s = [` font-family: ${
|
|
2192
|
+
const s = [` font-family: ${Te(r.family)};`];
|
|
2193
2193
|
if (o.overrideColors && o.overrideColors.length > 0) {
|
|
2194
2194
|
const i = o.overrideColors.map((l) => `${l.index} ${l.color}`).join(", ");
|
|
2195
2195
|
s.push(` override-colors: ${i};`);
|
|
@@ -2202,24 +2202,24 @@ ${s.join(`
|
|
|
2202
2202
|
return t.length > 0 ? t.join(`
|
|
2203
2203
|
|
|
2204
2204
|
`) : null;
|
|
2205
|
-
},
|
|
2205
|
+
}, ls = (e) => {
|
|
2206
2206
|
for (const t of e)
|
|
2207
2207
|
for (const r of t.palettes ?? [])
|
|
2208
2208
|
if (r.applyToWidget)
|
|
2209
2209
|
return r.name;
|
|
2210
|
-
},
|
|
2211
|
-
if (!
|
|
2210
|
+
}, as = (e, t, r) => {
|
|
2211
|
+
if (!Ne(r) || !e)
|
|
2212
2212
|
return null;
|
|
2213
|
-
const o =
|
|
2213
|
+
const o = ge(t), s = [];
|
|
2214
2214
|
for (const u of o) {
|
|
2215
|
-
const c =
|
|
2215
|
+
const c = ss(u);
|
|
2216
2216
|
u.cssVariable && s.push(` ${u.cssVariable}: ${c};`), u.applyToWidget && s.push(
|
|
2217
2217
|
` font-family: ${u.cssVariable ? `var(${u.cssVariable})` : c};`
|
|
2218
2218
|
);
|
|
2219
2219
|
}
|
|
2220
|
-
const i =
|
|
2220
|
+
const i = ls(o);
|
|
2221
2221
|
i && s.push(` font-palette: ${i};`);
|
|
2222
|
-
const l =
|
|
2222
|
+
const l = is(o), a = `[data-rulecms-published-key="${Et(e)}"] > *`, d = s.length > 0 ? `${a} {
|
|
2223
2223
|
${s.join(`
|
|
2224
2224
|
`)}
|
|
2225
2225
|
}` : null;
|
|
@@ -2227,14 +2227,14 @@ ${s.join(`
|
|
|
2227
2227
|
|
|
2228
2228
|
${d}` : l : d;
|
|
2229
2229
|
};
|
|
2230
|
-
var
|
|
2231
|
-
function
|
|
2230
|
+
var cs = n.from_html('<link rel="stylesheet" data-rulecms-project-fonts=""/>'), us = n.from_html("<!> <!>", 1);
|
|
2231
|
+
function ds(e, t) {
|
|
2232
2232
|
n.push(t, !0);
|
|
2233
|
-
const r = n.derived(() =>
|
|
2234
|
-
var i =
|
|
2233
|
+
const r = n.derived(() => ge(t.fonts)), o = n.derived(() => Ne(t.includeFontFaces) ? os(n.get(r)) : null), s = n.derived(() => as(t.publishedKey, n.get(r), t.includeFontFaces));
|
|
2234
|
+
var i = us(), l = n.first_child(i);
|
|
2235
2235
|
{
|
|
2236
2236
|
var a = (c) => {
|
|
2237
|
-
var f =
|
|
2237
|
+
var f = cs();
|
|
2238
2238
|
n.template_effect(() => n.set_attribute(f, "href", n.get(o))), n.append(c, f);
|
|
2239
2239
|
};
|
|
2240
2240
|
n.if(l, (c) => {
|
|
@@ -2257,10 +2257,10 @@ function cs(e, t) {
|
|
|
2257
2257
|
}
|
|
2258
2258
|
n.append(e, i), n.pop();
|
|
2259
2259
|
}
|
|
2260
|
-
function
|
|
2260
|
+
function St(e) {
|
|
2261
2261
|
return e !== !1;
|
|
2262
2262
|
}
|
|
2263
|
-
const
|
|
2263
|
+
const fs = 80, gs = 4e3, ps = 32, Tt = [
|
|
2264
2264
|
"url(",
|
|
2265
2265
|
"@import",
|
|
2266
2266
|
"@font-face",
|
|
@@ -2271,7 +2271,7 @@ const us = 80, ds = 4e3, fs = 32, Et = [
|
|
|
2271
2271
|
"javascript:",
|
|
2272
2272
|
"expression(",
|
|
2273
2273
|
"behavior:"
|
|
2274
|
-
],
|
|
2274
|
+
], ms = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, ys = /^[A-Za-z_][\w-]*$/, hs = (e) => {
|
|
2275
2275
|
let t = 0;
|
|
2276
2276
|
for (const r of e)
|
|
2277
2277
|
if (r === "{")
|
|
@@ -2279,12 +2279,12 @@ const us = 80, ds = 4e3, fs = 32, Et = [
|
|
|
2279
2279
|
else if (r === "}" && (t -= 1, t < 0))
|
|
2280
2280
|
return !1;
|
|
2281
2281
|
return t === 0;
|
|
2282
|
-
},
|
|
2283
|
-
if (!e || e.length >
|
|
2282
|
+
}, bs = (e) => {
|
|
2283
|
+
if (!e || e.length > fs || e.includes("@") || e.includes(".") || /\s/.test(e))
|
|
2284
2284
|
return !1;
|
|
2285
2285
|
const t = e.toLowerCase();
|
|
2286
|
-
return
|
|
2287
|
-
},
|
|
2286
|
+
return Tt.some((r) => t.includes(r)) ? !1 : ys.test(e);
|
|
2287
|
+
}, vs = (e) => {
|
|
2288
2288
|
const t = e.trim();
|
|
2289
2289
|
if (t === "")
|
|
2290
2290
|
return !1;
|
|
@@ -2296,7 +2296,7 @@ const us = 80, ds = 4e3, fs = 32, Et = [
|
|
|
2296
2296
|
return !1;
|
|
2297
2297
|
const s = Number(o[1]);
|
|
2298
2298
|
return s >= 0 && s <= 100;
|
|
2299
|
-
},
|
|
2299
|
+
}, Cs = (e) => {
|
|
2300
2300
|
let t = 0;
|
|
2301
2301
|
const r = e.length;
|
|
2302
2302
|
let o = 0;
|
|
@@ -2306,7 +2306,7 @@ const us = 80, ds = 4e3, fs = 32, Et = [
|
|
|
2306
2306
|
};
|
|
2307
2307
|
for (s(); t < r; ) {
|
|
2308
2308
|
const i = e.indexOf("{", t);
|
|
2309
|
-
if (i === -1 || !e.slice(t, i).trim().split(",").every((u) =>
|
|
2309
|
+
if (i === -1 || !e.slice(t, i).trim().split(",").every((u) => vs(u)))
|
|
2310
2310
|
return !1;
|
|
2311
2311
|
t = i + 1;
|
|
2312
2312
|
const a = e.indexOf("}", t);
|
|
@@ -2318,42 +2318,42 @@ const us = 80, ds = 4e3, fs = 32, Et = [
|
|
|
2318
2318
|
t = a + 1, o += 1, s();
|
|
2319
2319
|
}
|
|
2320
2320
|
return o > 0;
|
|
2321
|
-
},
|
|
2321
|
+
}, _s = (e) => {
|
|
2322
2322
|
const t = e.trim();
|
|
2323
|
-
if (!t || t.length >
|
|
2323
|
+
if (!t || t.length > gs || ms.test(t) || !hs(t))
|
|
2324
2324
|
return !1;
|
|
2325
2325
|
const r = t.toLowerCase();
|
|
2326
|
-
return
|
|
2327
|
-
},
|
|
2326
|
+
return Tt.some((o) => r.includes(o)) || t.includes("@") ? !1 : Cs(t);
|
|
2327
|
+
}, It = (e) => {
|
|
2328
2328
|
if (!e)
|
|
2329
2329
|
return {};
|
|
2330
2330
|
const t = {};
|
|
2331
2331
|
for (const [r, o] of Object.entries(e)) {
|
|
2332
2332
|
const s = r.trim();
|
|
2333
|
-
if (!
|
|
2333
|
+
if (!bs(s) || t[s] !== void 0 || typeof o != "string")
|
|
2334
2334
|
continue;
|
|
2335
2335
|
const i = o.trim();
|
|
2336
|
-
if (
|
|
2336
|
+
if (_s(i) && (t[s] = i, Object.keys(t).length === ps))
|
|
2337
2337
|
break;
|
|
2338
2338
|
}
|
|
2339
2339
|
return Object.fromEntries(
|
|
2340
2340
|
Object.entries(t).sort(([r], [o]) => r.localeCompare(o))
|
|
2341
2341
|
);
|
|
2342
|
-
},
|
|
2342
|
+
}, ws = (e) => e.split(`
|
|
2343
2343
|
`).map((t) => ` ${t}`).join(`
|
|
2344
|
-
`),
|
|
2345
|
-
if (!
|
|
2344
|
+
`), As = (e, t, r) => {
|
|
2345
|
+
if (!St(r))
|
|
2346
2346
|
return null;
|
|
2347
|
-
const o =
|
|
2347
|
+
const o = It(t), s = Object.keys(o);
|
|
2348
2348
|
return s.length === 0 ? null : s.map((i) => `@keyframes ${i} {
|
|
2349
|
-
${
|
|
2349
|
+
${ws(o[i])}
|
|
2350
2350
|
}`).join(`
|
|
2351
2351
|
|
|
2352
2352
|
`);
|
|
2353
2353
|
};
|
|
2354
|
-
function
|
|
2354
|
+
function Es(e, t) {
|
|
2355
2355
|
n.push(t, !0);
|
|
2356
|
-
const r = n.derived(() =>
|
|
2356
|
+
const r = n.derived(() => As(t.publishedKey, t.keyframes));
|
|
2357
2357
|
var o = n.comment(), s = n.first_child(o);
|
|
2358
2358
|
{
|
|
2359
2359
|
var i = (l) => {
|
|
@@ -2370,52 +2370,52 @@ function ws(e, t) {
|
|
|
2370
2370
|
}
|
|
2371
2371
|
n.append(e, o), n.pop();
|
|
2372
2372
|
}
|
|
2373
|
-
const
|
|
2373
|
+
const Pt = (e) => e !== !1, Ss = 80, Ts = 2e3, Is = 16, Dt = ["url(", "@", "</", "<script", "javascript:", "expression("], Ps = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, Ds = /^--[A-Za-z_][\w-]*$/, xs = (e) => {
|
|
2374
2374
|
for (const t of e)
|
|
2375
2375
|
if (t === "{" || t === "}")
|
|
2376
2376
|
return !1;
|
|
2377
2377
|
return !0;
|
|
2378
|
-
},
|
|
2379
|
-
if (!e || e.length >
|
|
2378
|
+
}, ks = (e) => {
|
|
2379
|
+
if (!e || e.length > Ss || e.includes("@") || e.includes(".") || /\s/.test(e))
|
|
2380
2380
|
return !1;
|
|
2381
2381
|
const t = e.toLowerCase();
|
|
2382
|
-
return
|
|
2383
|
-
},
|
|
2382
|
+
return Dt.some((r) => t.includes(r)) ? !1 : Ds.test(e);
|
|
2383
|
+
}, Ls = (e) => {
|
|
2384
2384
|
const t = e.trim();
|
|
2385
|
-
if (!t || t.length >
|
|
2385
|
+
if (!t || t.length > Ts || Ps.test(t) || !xs(t))
|
|
2386
2386
|
return !1;
|
|
2387
2387
|
const r = t.toLowerCase();
|
|
2388
|
-
return !
|
|
2389
|
-
},
|
|
2388
|
+
return !Dt.some((o) => r.includes(o));
|
|
2389
|
+
}, xt = (e) => {
|
|
2390
2390
|
if (!e)
|
|
2391
2391
|
return {};
|
|
2392
2392
|
const t = {};
|
|
2393
2393
|
for (const [r, o] of Object.entries(e)) {
|
|
2394
2394
|
const s = r.trim();
|
|
2395
|
-
if (!
|
|
2395
|
+
if (!ks(s) || t[s] !== void 0 || typeof o != "string")
|
|
2396
2396
|
continue;
|
|
2397
2397
|
const i = o.trim();
|
|
2398
|
-
if (
|
|
2398
|
+
if (Ls(i) && (t[s] = i, Object.keys(t).length === Is))
|
|
2399
2399
|
break;
|
|
2400
2400
|
}
|
|
2401
2401
|
return Object.fromEntries(
|
|
2402
2402
|
Object.entries(t).sort(([r], [o]) => r.localeCompare(o))
|
|
2403
2403
|
);
|
|
2404
|
-
},
|
|
2404
|
+
}, Rs = (e) => e.split(`
|
|
2405
2405
|
`).map((t) => ` ${t}`).join(`
|
|
2406
|
-
`),
|
|
2407
|
-
if (!
|
|
2406
|
+
`), Os = (e, t, r) => {
|
|
2407
|
+
if (!Pt(r))
|
|
2408
2408
|
return null;
|
|
2409
|
-
const o =
|
|
2409
|
+
const o = xt(t), s = Object.keys(o);
|
|
2410
2410
|
return s.length === 0 ? null : s.map((i) => `@position-try ${i} {
|
|
2411
|
-
${
|
|
2411
|
+
${Rs(o[i])}
|
|
2412
2412
|
}`).join(`
|
|
2413
2413
|
|
|
2414
2414
|
`);
|
|
2415
2415
|
};
|
|
2416
|
-
function
|
|
2416
|
+
function js(e, t) {
|
|
2417
2417
|
n.push(t, !0);
|
|
2418
|
-
const r = n.derived(() =>
|
|
2418
|
+
const r = n.derived(() => Os(t.publishedKey, t.positionTry));
|
|
2419
2419
|
var o = n.comment(), s = n.first_child(o);
|
|
2420
2420
|
{
|
|
2421
2421
|
var i = (l) => {
|
|
@@ -2432,10 +2432,10 @@ function Rs(e, t) {
|
|
|
2432
2432
|
}
|
|
2433
2433
|
n.append(e, o), n.pop();
|
|
2434
2434
|
}
|
|
2435
|
-
function
|
|
2435
|
+
function kt(e) {
|
|
2436
2436
|
return e !== !1;
|
|
2437
2437
|
}
|
|
2438
|
-
const
|
|
2438
|
+
const Ns = [
|
|
2439
2439
|
"*",
|
|
2440
2440
|
"<number>",
|
|
2441
2441
|
"<integer>",
|
|
@@ -2447,7 +2447,7 @@ const Os = [
|
|
|
2447
2447
|
"<time>",
|
|
2448
2448
|
"<transform-function>",
|
|
2449
2449
|
"<transform-list>"
|
|
2450
|
-
],
|
|
2450
|
+
], Ms = new Set(Ns), Ws = /[{};]/, Vs = 40, Fs = 200, Ks = (e) => typeof e == "string" && Ms.has(e), Bs = (e, t) => t !== "*" && e === "" ? !1 : t === "*" && e === "" ? !0 : !(e.length > Fs || Ws.test(e) || e.includes("url(") || e.includes("@")), Lt = (e) => {
|
|
2451
2451
|
if (!Array.isArray(e))
|
|
2452
2452
|
return [];
|
|
2453
2453
|
const t = [], r = /* @__PURE__ */ new Set();
|
|
@@ -2455,10 +2455,10 @@ const Os = [
|
|
|
2455
2455
|
if (!o || typeof o.name != "string" || !$(o.name.trim()))
|
|
2456
2456
|
continue;
|
|
2457
2457
|
const s = o.name.trim();
|
|
2458
|
-
if (r.has(s) || t.length >=
|
|
2458
|
+
if (r.has(s) || t.length >= Vs || !Ks(o.syntax) || typeof o.inherits != "boolean")
|
|
2459
2459
|
continue;
|
|
2460
2460
|
const i = typeof o.initialValue == "string" ? o.initialValue.trim() : "";
|
|
2461
|
-
|
|
2461
|
+
Bs(i, o.syntax) && (r.add(s), t.push({
|
|
2462
2462
|
name: s,
|
|
2463
2463
|
syntax: o.syntax,
|
|
2464
2464
|
inherits: o.inherits,
|
|
@@ -2466,7 +2466,7 @@ const Os = [
|
|
|
2466
2466
|
}));
|
|
2467
2467
|
}
|
|
2468
2468
|
return t;
|
|
2469
|
-
},
|
|
2469
|
+
}, Us = (e) => {
|
|
2470
2470
|
const t = [
|
|
2471
2471
|
`@property ${e.name} {`,
|
|
2472
2472
|
` syntax: "${e.syntax}";`,
|
|
@@ -2474,17 +2474,17 @@ const Os = [
|
|
|
2474
2474
|
];
|
|
2475
2475
|
return e.initialValue !== "" && t.push(` initial-value: ${e.initialValue};`), t.push("}"), t.join(`
|
|
2476
2476
|
`);
|
|
2477
|
-
},
|
|
2478
|
-
if (!
|
|
2477
|
+
}, zs = (e, t, r) => {
|
|
2478
|
+
if (!kt(r))
|
|
2479
2479
|
return null;
|
|
2480
|
-
const o =
|
|
2481
|
-
return o.length === 0 ? null : o.map(
|
|
2480
|
+
const o = Lt(t);
|
|
2481
|
+
return o.length === 0 ? null : o.map(Us).join(`
|
|
2482
2482
|
|
|
2483
2483
|
`);
|
|
2484
2484
|
};
|
|
2485
|
-
function
|
|
2485
|
+
function Hs(e, t) {
|
|
2486
2486
|
n.push(t, !0);
|
|
2487
|
-
const r = n.derived(() =>
|
|
2487
|
+
const r = n.derived(() => zs(t.publishedKey, t.cssProperties));
|
|
2488
2488
|
var o = n.comment(), s = n.first_child(o);
|
|
2489
2489
|
{
|
|
2490
2490
|
var i = (l) => {
|
|
@@ -2501,10 +2501,10 @@ function Us(e, t) {
|
|
|
2501
2501
|
}
|
|
2502
2502
|
n.append(e, o), n.pop();
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2504
|
+
function Rt(e) {
|
|
2505
2505
|
return e !== !1;
|
|
2506
2506
|
}
|
|
2507
|
-
const
|
|
2507
|
+
const Ot = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Gs = /[{};]/, Ys = (e) => {
|
|
2508
2508
|
if (!e)
|
|
2509
2509
|
return {};
|
|
2510
2510
|
const t = {};
|
|
@@ -2512,38 +2512,38 @@ const Lt = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), zs = /[{};]/, H
|
|
|
2512
2512
|
if (!$(r) || typeof o != "string")
|
|
2513
2513
|
continue;
|
|
2514
2514
|
const s = o.trim();
|
|
2515
|
-
s === "" ||
|
|
2515
|
+
s === "" || Gs.test(s) || (t[r.trim()] = s);
|
|
2516
2516
|
}
|
|
2517
2517
|
return t;
|
|
2518
|
-
},
|
|
2519
|
-
if (!
|
|
2518
|
+
}, Xs = (e, t, r) => {
|
|
2519
|
+
if (!Rt(r))
|
|
2520
2520
|
return null;
|
|
2521
|
-
const o =
|
|
2521
|
+
const o = Ys(t), s = Object.keys(o);
|
|
2522
2522
|
if (s.length === 0 || !e)
|
|
2523
2523
|
return null;
|
|
2524
|
-
const i = `[data-rulecms-published-key="${
|
|
2524
|
+
const i = `[data-rulecms-published-key="${Ot(e)}"] > *`, l = s.sort((a, d) => a.localeCompare(d)).map((a) => ` ${a}: ${o[a]};`).join(`
|
|
2525
2525
|
`);
|
|
2526
2526
|
return `${i} {
|
|
2527
2527
|
${l}
|
|
2528
2528
|
}`;
|
|
2529
2529
|
};
|
|
2530
|
-
function
|
|
2530
|
+
function jt(e) {
|
|
2531
2531
|
return e !== !1;
|
|
2532
2532
|
}
|
|
2533
|
-
const
|
|
2533
|
+
const Js = 5, qs = 200, Zs = [
|
|
2534
2534
|
{ kind: "prefers-color-scheme", value: "dark" },
|
|
2535
2535
|
{ kind: "prefers-color-scheme", value: "light" },
|
|
2536
2536
|
{ kind: "html-class", value: "dark" },
|
|
2537
2537
|
{ kind: "data-theme", value: "dark" },
|
|
2538
2538
|
{ kind: "data-theme", value: "light" }
|
|
2539
|
-
],
|
|
2539
|
+
], Qs = /[{};]/, $s = (e) => {
|
|
2540
2540
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
2541
2541
|
return !1;
|
|
2542
2542
|
const t = e;
|
|
2543
|
-
return
|
|
2543
|
+
return Zs.some(
|
|
2544
2544
|
(r) => r.kind === t.kind && r.value === t.value
|
|
2545
2545
|
);
|
|
2546
|
-
},
|
|
2546
|
+
}, ei = (e) => {
|
|
2547
2547
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2548
2548
|
return {};
|
|
2549
2549
|
const t = {};
|
|
@@ -2551,54 +2551,54 @@ const Ys = 5, Xs = 200, Js = [
|
|
|
2551
2551
|
if (!$(r) || typeof o != "string")
|
|
2552
2552
|
continue;
|
|
2553
2553
|
const s = o.trim();
|
|
2554
|
-
s === "" ||
|
|
2554
|
+
s === "" || Qs.test(s) || s.includes("url(") || s.includes("@") || (t[r.trim()] = s);
|
|
2555
2555
|
}
|
|
2556
2556
|
return Object.fromEntries(
|
|
2557
2557
|
Object.entries(t).sort(([r], [o]) => r.localeCompare(o))
|
|
2558
2558
|
);
|
|
2559
|
-
},
|
|
2559
|
+
}, Nt = (e) => {
|
|
2560
2560
|
if (!Array.isArray(e))
|
|
2561
2561
|
return [];
|
|
2562
2562
|
const t = [], r = /* @__PURE__ */ new Set();
|
|
2563
2563
|
let o = 0;
|
|
2564
2564
|
for (const s of e) {
|
|
2565
|
-
if (!s ||
|
|
2565
|
+
if (!s || !$s(s.condition))
|
|
2566
2566
|
continue;
|
|
2567
2567
|
const i = `${s.condition.kind}:${s.condition.value}`;
|
|
2568
2568
|
if (r.has(i))
|
|
2569
2569
|
continue;
|
|
2570
|
-
const l =
|
|
2571
|
-
if (!(Object.keys(l).length === 0 || a >
|
|
2570
|
+
const l = ei(s.variables), a = o + Object.keys(l).length;
|
|
2571
|
+
if (!(Object.keys(l).length === 0 || a > qs) && (r.add(i), o = a, t.push({ condition: s.condition, variables: l }), t.length === Js))
|
|
2572
2572
|
break;
|
|
2573
2573
|
}
|
|
2574
2574
|
return t;
|
|
2575
|
-
},
|
|
2575
|
+
}, ti = (e, t) => {
|
|
2576
2576
|
const r = Object.entries(e).map(([o, s]) => ` ${o}: ${s};`);
|
|
2577
2577
|
return `${t} {
|
|
2578
2578
|
${r.join(`
|
|
2579
2579
|
`)}
|
|
2580
2580
|
}`;
|
|
2581
|
-
},
|
|
2581
|
+
}, ni = (e) => e.split(`
|
|
2582
2582
|
`).map((t) => ` ${t}`).join(`
|
|
2583
|
-
`),
|
|
2584
|
-
const r =
|
|
2583
|
+
`), ri = (e, t) => {
|
|
2584
|
+
const r = ti(e.variables, t), { kind: o, value: s } = e.condition;
|
|
2585
2585
|
return o === "prefers-color-scheme" ? `@media (prefers-color-scheme: ${s}) {
|
|
2586
|
-
${
|
|
2586
|
+
${ni(r)}
|
|
2587
2587
|
}` : o === "html-class" ? `html.${s} ${r}` : `[data-theme="${s}"] ${r}`;
|
|
2588
|
-
},
|
|
2589
|
-
if (!
|
|
2588
|
+
}, oi = (e, t, r) => {
|
|
2589
|
+
if (!jt(r) || !e)
|
|
2590
2590
|
return null;
|
|
2591
|
-
const o =
|
|
2591
|
+
const o = Nt(t);
|
|
2592
2592
|
if (o.length === 0)
|
|
2593
2593
|
return null;
|
|
2594
|
-
const s = `[data-rulecms-published-key="${
|
|
2595
|
-
return o.map((i) =>
|
|
2594
|
+
const s = `[data-rulecms-published-key="${Ot(e)}"] > *`;
|
|
2595
|
+
return o.map((i) => ri(i, s)).join(`
|
|
2596
2596
|
|
|
2597
2597
|
`);
|
|
2598
2598
|
};
|
|
2599
|
-
function
|
|
2599
|
+
function si(e, t) {
|
|
2600
2600
|
n.push(t, !0);
|
|
2601
|
-
const r = n.derived(() =>
|
|
2601
|
+
const r = n.derived(() => oi(t.publishedKey, t.themes));
|
|
2602
2602
|
var o = n.comment(), s = n.first_child(o);
|
|
2603
2603
|
{
|
|
2604
2604
|
var i = (l) => {
|
|
@@ -2615,9 +2615,9 @@ function ri(e, t) {
|
|
|
2615
2615
|
}
|
|
2616
2616
|
n.append(e, o), n.pop();
|
|
2617
2617
|
}
|
|
2618
|
-
function
|
|
2618
|
+
function ii(e, t) {
|
|
2619
2619
|
n.push(t, !0);
|
|
2620
|
-
const r = n.derived(() =>
|
|
2620
|
+
const r = n.derived(() => Xs(t.publishedKey, t.variables));
|
|
2621
2621
|
var o = n.comment(), s = n.first_child(o);
|
|
2622
2622
|
{
|
|
2623
2623
|
var i = (l) => {
|
|
@@ -2634,32 +2634,32 @@ function oi(e, t) {
|
|
|
2634
2634
|
}
|
|
2635
2635
|
n.append(e, o), n.pop();
|
|
2636
2636
|
}
|
|
2637
|
-
function
|
|
2637
|
+
function Mt(e) {
|
|
2638
2638
|
return e !== !1;
|
|
2639
2639
|
}
|
|
2640
|
-
const
|
|
2640
|
+
const li = [
|
|
2641
2641
|
"light",
|
|
2642
2642
|
"dark",
|
|
2643
2643
|
"light dark"
|
|
2644
|
-
],
|
|
2644
|
+
], ai = ["auto", "thin", "none"], ci = new Set(li), ui = new Set(ai), di = /[{};]|url\(|@/i, fi = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !di.test(e), ae = (e) => fi(e) ? e.trim() : void 0, Wt = (e) => {
|
|
2645
2645
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2646
2646
|
return null;
|
|
2647
|
-
const t =
|
|
2648
|
-
...typeof e.colorScheme == "string" &&
|
|
2647
|
+
const t = ae(e.selectionBackground), r = ae(e.selectionColor), o = ae(e.caretColor), s = ae(e.scrollbarColor), i = {
|
|
2648
|
+
...typeof e.colorScheme == "string" && ci.has(e.colorScheme) ? { colorScheme: e.colorScheme } : {},
|
|
2649
2649
|
...t ? { selectionBackground: t } : {},
|
|
2650
2650
|
...r ? { selectionColor: r } : {},
|
|
2651
2651
|
...o ? { caretColor: o } : {},
|
|
2652
2652
|
...s ? { scrollbarColor: s } : {},
|
|
2653
|
-
...typeof e.scrollbarWidth == "string" &&
|
|
2653
|
+
...typeof e.scrollbarWidth == "string" && ui.has(e.scrollbarWidth) ? { scrollbarWidth: e.scrollbarWidth } : {}
|
|
2654
2654
|
};
|
|
2655
2655
|
return Object.keys(i).length > 0 ? i : null;
|
|
2656
|
-
},
|
|
2657
|
-
if (!
|
|
2656
|
+
}, gi = (e, t, r) => {
|
|
2657
|
+
if (!Mt(r) || !e)
|
|
2658
2658
|
return null;
|
|
2659
|
-
const o =
|
|
2659
|
+
const o = Wt(t);
|
|
2660
2660
|
if (!o)
|
|
2661
2661
|
return null;
|
|
2662
|
-
const s = `[data-rulecms-published-key="${
|
|
2662
|
+
const s = `[data-rulecms-published-key="${Et(e)}"]`, i = [];
|
|
2663
2663
|
o.colorScheme && i.push(` color-scheme: ${o.colorScheme};`), o.caretColor && i.push(` caret-color: ${o.caretColor};`), o.scrollbarWidth && i.push(` scrollbar-width: ${o.scrollbarWidth};`), o.scrollbarColor && i.push(` scrollbar-color: ${o.scrollbarColor};`);
|
|
2664
2664
|
const l = [];
|
|
2665
2665
|
o.selectionBackground && l.push(` background: ${o.selectionBackground};`), o.selectionColor && l.push(` color: ${o.selectionColor};`);
|
|
@@ -2673,9 +2673,9 @@ ${l.join(`
|
|
|
2673
2673
|
}`), a.length > 0 ? a.join(`
|
|
2674
2674
|
`) : null;
|
|
2675
2675
|
};
|
|
2676
|
-
function
|
|
2676
|
+
function pi(e, t) {
|
|
2677
2677
|
n.push(t, !0);
|
|
2678
|
-
const r = n.derived(() =>
|
|
2678
|
+
const r = n.derived(() => gi(t.publishedKey, t.widgetChrome));
|
|
2679
2679
|
var o = n.comment(), s = n.first_child(o);
|
|
2680
2680
|
{
|
|
2681
2681
|
var i = (l) => {
|
|
@@ -2692,10 +2692,10 @@ function fi(e, t) {
|
|
|
2692
2692
|
}
|
|
2693
2693
|
n.append(e, o), n.pop();
|
|
2694
2694
|
}
|
|
2695
|
-
function
|
|
2695
|
+
function mi(e) {
|
|
2696
2696
|
return e !== !1;
|
|
2697
2697
|
}
|
|
2698
|
-
function
|
|
2698
|
+
function yi(e) {
|
|
2699
2699
|
const t = {};
|
|
2700
2700
|
return Object.entries(e).forEach(([r, o]) => {
|
|
2701
2701
|
const s = { ...o };
|
|
@@ -2709,53 +2709,53 @@ function pi(e) {
|
|
|
2709
2709
|
s.parentId && (i = `${i}@${s.parentId}`), t[i] = s;
|
|
2710
2710
|
}), t;
|
|
2711
2711
|
}
|
|
2712
|
-
function
|
|
2712
|
+
function hi(e) {
|
|
2713
2713
|
return typeof e.itemList == "string" ? JSON.parse(e.itemList) : e.itemList;
|
|
2714
2714
|
}
|
|
2715
|
-
function
|
|
2716
|
-
const t =
|
|
2715
|
+
function Me(e) {
|
|
2716
|
+
const t = ge(e.fontFaces), r = It(e.keyframes), o = Nt(e.themes), s = Lt(e.cssProperties), i = Wt(e.widgetChrome), l = xt(e.positionTry), a = mi(e.includeClassLayer) && At(e.classLayer) ? e.classLayer : void 0;
|
|
2717
2717
|
return {
|
|
2718
|
-
displayItemList:
|
|
2719
|
-
widgetCollections:
|
|
2718
|
+
displayItemList: hi(e.widget),
|
|
2719
|
+
widgetCollections: yi(e.childCollections),
|
|
2720
2720
|
...e.libraries ? { libraries: e.libraries } : {},
|
|
2721
|
-
...
|
|
2722
|
-
...
|
|
2723
|
-
...
|
|
2724
|
-
...
|
|
2725
|
-
...
|
|
2726
|
-
...
|
|
2727
|
-
...
|
|
2721
|
+
...Rt(e.includeCssVariables) && e.cssVariables && Object.keys(e.cssVariables).length > 0 ? { cssVariables: e.cssVariables } : {},
|
|
2722
|
+
...wt(e.includeClassDefinitions) && e.classDefinitions && Object.keys(e.classDefinitions).length > 0 ? { classDefinitions: e.classDefinitions } : {},
|
|
2723
|
+
...Ne(e.includeFontFaces) && t.length > 0 ? { fontFaces: t } : {},
|
|
2724
|
+
...St(e.includeKeyframes) && Object.keys(r).length > 0 ? { keyframes: r } : {},
|
|
2725
|
+
...jt(e.includeThemes) && o.length > 0 ? { themes: o } : {},
|
|
2726
|
+
...kt(e.includeCssProperties) && s.length > 0 ? { cssProperties: s } : {},
|
|
2727
|
+
...Mt(e.includeWidgetChrome) && i ? { widgetChrome: i } : {},
|
|
2728
2728
|
...a ? { classLayer: a } : {},
|
|
2729
|
-
...
|
|
2729
|
+
...Pt(e.includePositionTry) && Object.keys(l).length > 0 ? { positionTry: l } : {}
|
|
2730
2730
|
};
|
|
2731
2731
|
}
|
|
2732
|
-
function
|
|
2733
|
-
const t = e.registry ??
|
|
2732
|
+
function bi(e) {
|
|
2733
|
+
const t = e.registry ?? de(), r = Pe({
|
|
2734
2734
|
displayItemList: e.displayItemList,
|
|
2735
2735
|
widgetCollections: e.widgetCollections
|
|
2736
2736
|
});
|
|
2737
2737
|
return t.resolveSync({ registrations: e.libraries, referenced: r });
|
|
2738
2738
|
}
|
|
2739
|
-
function
|
|
2740
|
-
const t = e.registry ??
|
|
2739
|
+
function vi(e) {
|
|
2740
|
+
const t = e.registry ?? de(), r = Pe({
|
|
2741
2741
|
displayItemList: e.displayItemList,
|
|
2742
2742
|
widgetCollections: e.widgetCollections
|
|
2743
2743
|
});
|
|
2744
2744
|
return t.resolve({ registrations: e.libraries, referenced: r });
|
|
2745
2745
|
}
|
|
2746
|
-
function
|
|
2747
|
-
const t = e.lastIndexOf(
|
|
2748
|
-
return t === -1 ? e : e.slice(t +
|
|
2746
|
+
function Ci(e) {
|
|
2747
|
+
const t = e.lastIndexOf(we);
|
|
2748
|
+
return t === -1 ? e : e.slice(t + we.length);
|
|
2749
2749
|
}
|
|
2750
|
-
const
|
|
2751
|
-
function
|
|
2750
|
+
const _i = "text/plain";
|
|
2751
|
+
function wi({
|
|
2752
2752
|
token: e,
|
|
2753
2753
|
rulesetPublishedKey: t,
|
|
2754
2754
|
params: r
|
|
2755
2755
|
}) {
|
|
2756
|
-
return
|
|
2756
|
+
return H(e) ? {
|
|
2757
2757
|
token: e,
|
|
2758
|
-
rulesetKey:
|
|
2758
|
+
rulesetKey: Ci(t),
|
|
2759
2759
|
...r ? { params: r } : {}
|
|
2760
2760
|
} : {
|
|
2761
2761
|
token: e,
|
|
@@ -2764,45 +2764,45 @@ function Ci({
|
|
|
2764
2764
|
mode: "payload"
|
|
2765
2765
|
};
|
|
2766
2766
|
}
|
|
2767
|
-
function
|
|
2768
|
-
contentType: e =
|
|
2767
|
+
function Vt({
|
|
2768
|
+
contentType: e = _i,
|
|
2769
2769
|
...t
|
|
2770
2770
|
}) {
|
|
2771
2771
|
return {
|
|
2772
2772
|
method: "POST",
|
|
2773
2773
|
headers: { "Content-Type": e },
|
|
2774
|
-
body: JSON.stringify(
|
|
2774
|
+
body: JSON.stringify(wi(t))
|
|
2775
2775
|
};
|
|
2776
2776
|
}
|
|
2777
|
-
const
|
|
2778
|
-
function
|
|
2777
|
+
const Ze = "rulecms_anon_id";
|
|
2778
|
+
function Qe() {
|
|
2779
2779
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
|
2780
2780
|
const t = Math.random() * 16 | 0;
|
|
2781
2781
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
2782
2782
|
});
|
|
2783
2783
|
}
|
|
2784
|
-
function
|
|
2784
|
+
function Ai() {
|
|
2785
2785
|
if (!(typeof window > "u"))
|
|
2786
2786
|
try {
|
|
2787
|
-
const e = window.localStorage.getItem(
|
|
2787
|
+
const e = window.localStorage.getItem(Ze);
|
|
2788
2788
|
if (e)
|
|
2789
2789
|
return e;
|
|
2790
|
-
const t =
|
|
2791
|
-
return window.localStorage.setItem(
|
|
2790
|
+
const t = Qe();
|
|
2791
|
+
return window.localStorage.setItem(Ze, t), t;
|
|
2792
2792
|
} catch {
|
|
2793
|
-
return
|
|
2793
|
+
return Qe();
|
|
2794
2794
|
}
|
|
2795
2795
|
}
|
|
2796
|
-
function
|
|
2796
|
+
function Ft(e) {
|
|
2797
2797
|
return e >= 500;
|
|
2798
2798
|
}
|
|
2799
|
-
function
|
|
2799
|
+
function Ei(e) {
|
|
2800
2800
|
if (!(e != null && e.success) || !e.data)
|
|
2801
2801
|
return null;
|
|
2802
2802
|
const { selection: t, ...r } = e.data;
|
|
2803
2803
|
return { raw: r, selection: t };
|
|
2804
2804
|
}
|
|
2805
|
-
function
|
|
2805
|
+
function Si(e, t) {
|
|
2806
2806
|
if (!(e != null && e.resolution) || !e.widget)
|
|
2807
2807
|
return null;
|
|
2808
2808
|
const { resolution: r, ...o } = e, s = {
|
|
@@ -2815,14 +2815,14 @@ function Ai(e, t) {
|
|
|
2815
2815
|
};
|
|
2816
2816
|
return { raw: o, selection: s };
|
|
2817
2817
|
}
|
|
2818
|
-
function
|
|
2818
|
+
function Kt({
|
|
2819
2819
|
token: e,
|
|
2820
2820
|
rulesetPublishedKey: t,
|
|
2821
2821
|
body: r
|
|
2822
2822
|
}) {
|
|
2823
|
-
return
|
|
2823
|
+
return H(e) ? Si(r, t) : Ei(r);
|
|
2824
2824
|
}
|
|
2825
|
-
function
|
|
2825
|
+
function Ti(e) {
|
|
2826
2826
|
return JSON.stringify(e, (t, r) => {
|
|
2827
2827
|
if (r === null || typeof r != "object" || Array.isArray(r))
|
|
2828
2828
|
return r;
|
|
@@ -2832,38 +2832,38 @@ function Ei(e) {
|
|
|
2832
2832
|
return o;
|
|
2833
2833
|
});
|
|
2834
2834
|
}
|
|
2835
|
-
const
|
|
2835
|
+
const Ii = {
|
|
2836
2836
|
display: "flex",
|
|
2837
2837
|
justifyContent: "center",
|
|
2838
2838
|
alignItems: "center",
|
|
2839
2839
|
padding: "3rem",
|
|
2840
2840
|
color: "#e2e8f0"
|
|
2841
|
-
},
|
|
2841
|
+
}, Pi = {
|
|
2842
2842
|
display: "flex",
|
|
2843
2843
|
alignItems: "center",
|
|
2844
2844
|
gap: "1rem"
|
|
2845
|
-
},
|
|
2845
|
+
}, Di = {
|
|
2846
2846
|
width: "40px",
|
|
2847
2847
|
height: "40px",
|
|
2848
2848
|
border: "4px solid #4a5568",
|
|
2849
2849
|
borderTopColor: "#63b3ed",
|
|
2850
2850
|
borderRadius: "50%",
|
|
2851
2851
|
animation: "spin 1s linear infinite"
|
|
2852
|
-
},
|
|
2852
|
+
}, $e = {
|
|
2853
2853
|
padding: "1.5rem",
|
|
2854
2854
|
backgroundColor: "#742a2a",
|
|
2855
2855
|
border: "1px solid #9b2c2c",
|
|
2856
2856
|
borderRadius: "8px",
|
|
2857
2857
|
color: "#fed7d7"
|
|
2858
|
-
},
|
|
2858
|
+
}, et = {
|
|
2859
2859
|
fontSize: "16px",
|
|
2860
2860
|
fontWeight: "600",
|
|
2861
2861
|
marginBottom: "0.5rem",
|
|
2862
2862
|
color: "#feb2b2"
|
|
2863
|
-
},
|
|
2863
|
+
}, tt = {
|
|
2864
2864
|
fontSize: "14px",
|
|
2865
2865
|
color: "#fed7d7"
|
|
2866
|
-
},
|
|
2866
|
+
}, xi = `
|
|
2867
2867
|
@keyframes spin {
|
|
2868
2868
|
from {
|
|
2869
2869
|
transform: rotate(0deg);
|
|
@@ -2872,12 +2872,12 @@ const Si = {
|
|
|
2872
2872
|
transform: rotate(360deg);
|
|
2873
2873
|
}
|
|
2874
2874
|
}
|
|
2875
|
-
`,
|
|
2876
|
-
var
|
|
2877
|
-
function
|
|
2875
|
+
`, el = "data-rulecms-published-key";
|
|
2876
|
+
var ki = n.from_html("<div><div><div></div></div></div>"), Li = n.from_html("<div><div>Error Loading Widget</div> <div> </div></div>"), Ri = n.from_html("<div><div>No Widget Data</div> <div>No widget data available</div></div>"), Oi = n.from_html('<span style="display: contents"><!> <!> <!> <!> <!> <!> <!> <!> <!></span>');
|
|
2877
|
+
function tl(e, t) {
|
|
2878
2878
|
n.push(t, !0);
|
|
2879
2879
|
let r = n.prop(t, "mode", 3, "client-fetch");
|
|
2880
|
-
const o =
|
|
2880
|
+
const o = Yt(dt);
|
|
2881
2881
|
let s = n.state(!0), i = n.state(null), l = n.state(null), a = n.state(null), d = n.state("");
|
|
2882
2882
|
const u = n.derived(() => r() === "pre-fetched"), c = n.derived(() => ({ sourceComponents: n.get(a) ?? void 0 })), f = n.derived(() => t.publishedKey || n.get(d));
|
|
2883
2883
|
let p = null, g = null, A = !1, w = 0;
|
|
@@ -2891,7 +2891,7 @@ function $i(e, t) {
|
|
|
2891
2891
|
n.set(a, null);
|
|
2892
2892
|
return;
|
|
2893
2893
|
}
|
|
2894
|
-
const y = t.libraries ?? (o == null ? void 0 : o.libraries), m = o == null ? void 0 : o.libraryRegistry, S =
|
|
2894
|
+
const y = t.libraries ?? (o == null ? void 0 : o.libraries), m = o == null ? void 0 : o.libraryRegistry, S = bi({
|
|
2895
2895
|
displayItemList: n.get(l).displayItemList,
|
|
2896
2896
|
widgetCollections: n.get(l).widgetCollections,
|
|
2897
2897
|
libraries: y,
|
|
@@ -2901,49 +2901,49 @@ function $i(e, t) {
|
|
|
2901
2901
|
n.set(a, S, !0);
|
|
2902
2902
|
return;
|
|
2903
2903
|
}
|
|
2904
|
-
|
|
2904
|
+
vi({
|
|
2905
2905
|
displayItemList: n.get(l).displayItemList,
|
|
2906
2906
|
widgetCollections: n.get(l).widgetCollections,
|
|
2907
2907
|
libraries: y,
|
|
2908
2908
|
registry: m
|
|
2909
|
-
}).then((
|
|
2910
|
-
n.set(a,
|
|
2909
|
+
}).then((D) => {
|
|
2910
|
+
n.set(a, D, !0);
|
|
2911
2911
|
});
|
|
2912
2912
|
}
|
|
2913
2913
|
function T() {
|
|
2914
|
-
n.get(l) &&
|
|
2914
|
+
n.get(l) && Zr({
|
|
2915
2915
|
componentProps: t.componentProps,
|
|
2916
2916
|
displayItemList: n.get(l).displayItemList,
|
|
2917
2917
|
widgetCollections: n.get(l).widgetCollections,
|
|
2918
2918
|
publishedKey: n.get(f)
|
|
2919
2919
|
});
|
|
2920
2920
|
}
|
|
2921
|
-
function
|
|
2921
|
+
function j() {
|
|
2922
2922
|
if (A || typeof document > "u")
|
|
2923
2923
|
return;
|
|
2924
2924
|
const y = "rulecms-widget-spinner-styles";
|
|
2925
2925
|
if (!document.getElementById(y)) {
|
|
2926
2926
|
const m = document.createElement("style");
|
|
2927
|
-
m.id = y, m.textContent =
|
|
2927
|
+
m.id = y, m.textContent = xi, document.head.appendChild(m);
|
|
2928
2928
|
}
|
|
2929
2929
|
A = !0;
|
|
2930
2930
|
}
|
|
2931
2931
|
function U() {
|
|
2932
|
-
const y = t.token ?? (o == null ? void 0 : o.token), m = t.endpoint ?? (o == null ? void 0 : o.endpoint), S =
|
|
2933
|
-
if (!t.publishedKey && !
|
|
2934
|
-
!t.publishedKey && !
|
|
2932
|
+
const y = t.token ?? (o == null ? void 0 : o.token), m = t.endpoint ?? (o == null ? void 0 : o.endpoint), S = H(y), D = t.rulesetPublishedKey;
|
|
2933
|
+
if (!t.publishedKey && !D || !y) {
|
|
2934
|
+
!t.publishedKey && !D ? n.set(
|
|
2935
2935
|
i,
|
|
2936
|
-
|
|
2936
|
+
D !== void 0 ? S ? "Ruleset key is required" : "Ruleset published key is required" : S ? "Widget key is required" : "Published key is required",
|
|
2937
2937
|
!0
|
|
2938
2938
|
) : n.set(i, "Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider."), n.set(l, null), n.set(s, !1);
|
|
2939
2939
|
return;
|
|
2940
2940
|
}
|
|
2941
|
-
const
|
|
2941
|
+
const M = Ti(t.params), R = JSON.stringify({
|
|
2942
2942
|
publishedKey: t.publishedKey,
|
|
2943
|
-
rulesetPublishedKey:
|
|
2943
|
+
rulesetPublishedKey: D,
|
|
2944
2944
|
token: y,
|
|
2945
2945
|
endpoint: m,
|
|
2946
|
-
paramsKey:
|
|
2946
|
+
paramsKey: M,
|
|
2947
2947
|
anonymousId: t.anonymousId,
|
|
2948
2948
|
fallbackPublishedKey: t.fallbackPublishedKey,
|
|
2949
2949
|
contentType: t.contentType
|
|
@@ -2953,94 +2953,100 @@ function $i(e, t) {
|
|
|
2953
2953
|
return;
|
|
2954
2954
|
}
|
|
2955
2955
|
p == null || p.abort(), p = new AbortController();
|
|
2956
|
-
const
|
|
2956
|
+
const O = p.signal;
|
|
2957
2957
|
g = R, n.set(s, !0), n.set(i, null);
|
|
2958
|
-
const
|
|
2959
|
-
const
|
|
2960
|
-
publishedKey:
|
|
2958
|
+
const Y = ++w, ie = async (x) => (await x.json().catch(() => ({ error: "Unknown error" }))).error || `Request failed with status ${x.status}`, ne = async (x) => {
|
|
2959
|
+
const F = lt({
|
|
2960
|
+
publishedKey: x,
|
|
2961
2961
|
token: y,
|
|
2962
2962
|
endpoint: m
|
|
2963
|
-
}), K = await fetch(
|
|
2963
|
+
}), K = await fetch(F, { method: "GET", ...S ? { cache: "no-store" } : {}, signal: O });
|
|
2964
2964
|
if (!K.ok)
|
|
2965
|
-
throw new b(await
|
|
2965
|
+
throw new b(await ie(K));
|
|
2966
2966
|
const W = await K.json();
|
|
2967
2967
|
if (!W.success)
|
|
2968
2968
|
throw new b("Failed to fetch widget data");
|
|
2969
2969
|
return W.data;
|
|
2970
2970
|
};
|
|
2971
|
-
(
|
|
2972
|
-
const
|
|
2971
|
+
(D ? (async () => {
|
|
2972
|
+
const x = M ? JSON.parse(M) : {};
|
|
2973
2973
|
if (t.anonymousId !== !1) {
|
|
2974
2974
|
if (typeof t.anonymousId == "string")
|
|
2975
|
-
|
|
2976
|
-
else if (
|
|
2977
|
-
const W =
|
|
2978
|
-
W && (
|
|
2975
|
+
x.anonId = x.anonId ?? t.anonymousId;
|
|
2976
|
+
else if (x.anonId == null) {
|
|
2977
|
+
const W = Ai();
|
|
2978
|
+
W && (x.anonId = W);
|
|
2979
2979
|
}
|
|
2980
2980
|
}
|
|
2981
|
-
let
|
|
2981
|
+
let F;
|
|
2982
2982
|
try {
|
|
2983
|
-
|
|
2984
|
-
...
|
|
2983
|
+
F = await fetch(at({ token: y, endpoint: m }), {
|
|
2984
|
+
...Vt({
|
|
2985
2985
|
token: y,
|
|
2986
|
-
rulesetPublishedKey:
|
|
2987
|
-
params:
|
|
2986
|
+
rulesetPublishedKey: D,
|
|
2987
|
+
params: x,
|
|
2988
2988
|
contentType: t.contentType
|
|
2989
2989
|
}),
|
|
2990
|
-
signal:
|
|
2990
|
+
signal: O
|
|
2991
2991
|
});
|
|
2992
2992
|
} catch (W) {
|
|
2993
2993
|
if (W instanceof DOMException && W.name === "AbortError")
|
|
2994
2994
|
throw W;
|
|
2995
2995
|
if (t.fallbackPublishedKey)
|
|
2996
2996
|
return {
|
|
2997
|
-
raw: await
|
|
2997
|
+
raw: await ne(t.fallbackPublishedKey),
|
|
2998
2998
|
selection: null
|
|
2999
2999
|
};
|
|
3000
3000
|
throw W;
|
|
3001
3001
|
}
|
|
3002
|
-
if (!
|
|
3003
|
-
if (t.fallbackPublishedKey &&
|
|
3002
|
+
if (!F.ok) {
|
|
3003
|
+
if (t.fallbackPublishedKey && Ft(F.status))
|
|
3004
3004
|
return {
|
|
3005
|
-
raw: await
|
|
3005
|
+
raw: await ne(t.fallbackPublishedKey),
|
|
3006
3006
|
selection: null
|
|
3007
3007
|
};
|
|
3008
|
-
throw new b(await
|
|
3008
|
+
throw new b(await ie(F));
|
|
3009
3009
|
}
|
|
3010
|
-
const K =
|
|
3010
|
+
const K = Kt({
|
|
3011
3011
|
token: y,
|
|
3012
|
-
rulesetPublishedKey:
|
|
3013
|
-
body: await
|
|
3012
|
+
rulesetPublishedKey: D,
|
|
3013
|
+
body: await F.json()
|
|
3014
3014
|
});
|
|
3015
3015
|
if (!K)
|
|
3016
3016
|
throw new b("Failed to fetch widget data");
|
|
3017
3017
|
return { raw: K.raw, selection: K.selection };
|
|
3018
|
-
})() :
|
|
3018
|
+
})() : ne(t.publishedKey).then((x) => ({ raw: x, selection: null }))).then(({ raw: x, selection: F }) => {
|
|
3019
3019
|
var K, W;
|
|
3020
|
-
n.set(l,
|
|
3021
|
-
}).catch((
|
|
3022
|
-
|
|
3020
|
+
n.set(l, Me(x), !0), n.set(d, ((K = x.widget) == null ? void 0 : K.publishedKey) ?? "", !0), n.set(i, null), v(), T(), F && ((W = t.onSelection) == null || W.call(t, F));
|
|
3021
|
+
}).catch((x) => {
|
|
3022
|
+
x instanceof DOMException && x.name === "AbortError" || (console.error("Error fetching widget:", x), n.set(i, x instanceof b ? x.message : "Failed to fetch widget", !0), n.set(l, null));
|
|
3023
3023
|
}).finally(() => {
|
|
3024
|
-
w ===
|
|
3024
|
+
w === Y && n.set(s, !1);
|
|
3025
3025
|
});
|
|
3026
3026
|
}
|
|
3027
3027
|
function h() {
|
|
3028
|
+
n.set(l, t.initialData ?? null, !0), n.set(s, !1), n.set(i, null), v(), T();
|
|
3029
|
+
}
|
|
3030
|
+
function _() {
|
|
3028
3031
|
if (r() === "pre-fetched") {
|
|
3029
|
-
|
|
3032
|
+
h();
|
|
3030
3033
|
return;
|
|
3031
3034
|
}
|
|
3032
|
-
|
|
3035
|
+
j(), U();
|
|
3036
|
+
}
|
|
3037
|
+
function C() {
|
|
3038
|
+
r() === "pre-fetched" && h();
|
|
3033
3039
|
}
|
|
3034
|
-
n.user_effect(() => (t.publishedKey, t.rulesetPublishedKey, t.params, t.anonymousId, t.fallbackPublishedKey, t.contentType, t.token, t.endpoint, r(), t.initialData, t.libraries, t.componentProps,
|
|
3040
|
+
C(), n.user_effect(() => (t.publishedKey, t.rulesetPublishedKey, t.params, t.anonymousId, t.fallbackPublishedKey, t.contentType, t.token, t.endpoint, r(), t.initialData, t.libraries, t.componentProps, Xt(() => _()), () => {
|
|
3035
3041
|
p == null || p.abort();
|
|
3036
3042
|
}));
|
|
3037
|
-
var
|
|
3043
|
+
var E = Oi(), I = n.child(E);
|
|
3038
3044
|
{
|
|
3039
3045
|
let y = n.derived(() => {
|
|
3040
3046
|
var m;
|
|
3041
3047
|
return (m = n.get(l)) == null ? void 0 : m.fontFaces;
|
|
3042
3048
|
});
|
|
3043
|
-
|
|
3049
|
+
ds(I, {
|
|
3044
3050
|
get publishedKey() {
|
|
3045
3051
|
return n.get(f);
|
|
3046
3052
|
},
|
|
@@ -3049,13 +3055,13 @@ function $i(e, t) {
|
|
|
3049
3055
|
}
|
|
3050
3056
|
});
|
|
3051
3057
|
}
|
|
3052
|
-
var
|
|
3058
|
+
var P = n.sibling(I, 2);
|
|
3053
3059
|
{
|
|
3054
3060
|
let y = n.derived(() => {
|
|
3055
3061
|
var m;
|
|
3056
3062
|
return (m = n.get(l)) == null ? void 0 : m.keyframes;
|
|
3057
3063
|
});
|
|
3058
|
-
|
|
3064
|
+
Es(P, {
|
|
3059
3065
|
get publishedKey() {
|
|
3060
3066
|
return n.get(f);
|
|
3061
3067
|
},
|
|
@@ -3064,13 +3070,13 @@ function $i(e, t) {
|
|
|
3064
3070
|
}
|
|
3065
3071
|
});
|
|
3066
3072
|
}
|
|
3067
|
-
var
|
|
3073
|
+
var L = n.sibling(P, 2);
|
|
3068
3074
|
{
|
|
3069
3075
|
let y = n.derived(() => {
|
|
3070
3076
|
var m;
|
|
3071
3077
|
return (m = n.get(l)) == null ? void 0 : m.themes;
|
|
3072
3078
|
});
|
|
3073
|
-
|
|
3079
|
+
si(L, {
|
|
3074
3080
|
get publishedKey() {
|
|
3075
3081
|
return n.get(f);
|
|
3076
3082
|
},
|
|
@@ -3079,13 +3085,13 @@ function $i(e, t) {
|
|
|
3079
3085
|
}
|
|
3080
3086
|
});
|
|
3081
3087
|
}
|
|
3082
|
-
var
|
|
3088
|
+
var J = n.sibling(L, 2);
|
|
3083
3089
|
{
|
|
3084
3090
|
let y = n.derived(() => {
|
|
3085
3091
|
var m;
|
|
3086
3092
|
return (m = n.get(l)) == null ? void 0 : m.cssProperties;
|
|
3087
3093
|
});
|
|
3088
|
-
|
|
3094
|
+
Hs(J, {
|
|
3089
3095
|
get publishedKey() {
|
|
3090
3096
|
return n.get(f);
|
|
3091
3097
|
},
|
|
@@ -3094,13 +3100,13 @@ function $i(e, t) {
|
|
|
3094
3100
|
}
|
|
3095
3101
|
});
|
|
3096
3102
|
}
|
|
3097
|
-
var
|
|
3103
|
+
var ee = n.sibling(J, 2);
|
|
3098
3104
|
{
|
|
3099
3105
|
let y = n.derived(() => {
|
|
3100
3106
|
var m;
|
|
3101
3107
|
return (m = n.get(l)) == null ? void 0 : m.widgetChrome;
|
|
3102
3108
|
});
|
|
3103
|
-
|
|
3109
|
+
pi(ee, {
|
|
3104
3110
|
get publishedKey() {
|
|
3105
3111
|
return n.get(f);
|
|
3106
3112
|
},
|
|
@@ -3109,13 +3115,13 @@ function $i(e, t) {
|
|
|
3109
3115
|
}
|
|
3110
3116
|
});
|
|
3111
3117
|
}
|
|
3112
|
-
var
|
|
3118
|
+
var te = n.sibling(ee, 2);
|
|
3113
3119
|
{
|
|
3114
3120
|
let y = n.derived(() => {
|
|
3115
3121
|
var m;
|
|
3116
3122
|
return (m = n.get(l)) == null ? void 0 : m.positionTry;
|
|
3117
3123
|
});
|
|
3118
|
-
|
|
3124
|
+
js(te, {
|
|
3119
3125
|
get publishedKey() {
|
|
3120
3126
|
return n.get(f);
|
|
3121
3127
|
},
|
|
@@ -3124,13 +3130,13 @@ function $i(e, t) {
|
|
|
3124
3130
|
}
|
|
3125
3131
|
});
|
|
3126
3132
|
}
|
|
3127
|
-
var
|
|
3133
|
+
var oe = n.sibling(te, 2);
|
|
3128
3134
|
{
|
|
3129
3135
|
let y = n.derived(() => {
|
|
3130
3136
|
var m;
|
|
3131
3137
|
return (m = n.get(l)) == null ? void 0 : m.cssVariables;
|
|
3132
3138
|
});
|
|
3133
|
-
|
|
3139
|
+
ii(oe, {
|
|
3134
3140
|
get publishedKey() {
|
|
3135
3141
|
return n.get(f);
|
|
3136
3142
|
},
|
|
@@ -3139,7 +3145,7 @@ function $i(e, t) {
|
|
|
3139
3145
|
}
|
|
3140
3146
|
});
|
|
3141
3147
|
}
|
|
3142
|
-
var
|
|
3148
|
+
var q = n.sibling(oe, 2);
|
|
3143
3149
|
{
|
|
3144
3150
|
let y = n.derived(() => {
|
|
3145
3151
|
var S;
|
|
@@ -3148,7 +3154,7 @@ function $i(e, t) {
|
|
|
3148
3154
|
var S;
|
|
3149
3155
|
return (S = n.get(l)) == null ? void 0 : S.classLayer;
|
|
3150
3156
|
});
|
|
3151
|
-
|
|
3157
|
+
Uo(q, {
|
|
3152
3158
|
get publishedKey() {
|
|
3153
3159
|
return n.get(f);
|
|
3154
3160
|
},
|
|
@@ -3160,49 +3166,49 @@ function $i(e, t) {
|
|
|
3160
3166
|
}
|
|
3161
3167
|
});
|
|
3162
3168
|
}
|
|
3163
|
-
var
|
|
3169
|
+
var V = n.sibling(q, 2);
|
|
3164
3170
|
{
|
|
3165
|
-
var
|
|
3166
|
-
var m =
|
|
3171
|
+
var se = (y) => {
|
|
3172
|
+
var m = ki(), S = n.child(m), D = n.child(S);
|
|
3167
3173
|
n.reset(S), n.reset(m), n.template_effect(
|
|
3168
|
-
(
|
|
3169
|
-
n.set_style(m,
|
|
3174
|
+
(M, R, O) => {
|
|
3175
|
+
n.set_style(m, M), n.set_style(S, R), n.set_style(D, O);
|
|
3170
3176
|
},
|
|
3171
3177
|
[
|
|
3172
|
-
() => N(
|
|
3173
|
-
() => N(
|
|
3174
|
-
() => N(
|
|
3178
|
+
() => N(Ii),
|
|
3179
|
+
() => N(Pi),
|
|
3180
|
+
() => N(Di)
|
|
3175
3181
|
]
|
|
3176
3182
|
), n.append(y, m);
|
|
3177
|
-
},
|
|
3178
|
-
var m =
|
|
3179
|
-
n.reset(
|
|
3180
|
-
(R,
|
|
3181
|
-
n.set_style(m, R), n.set_style(S,
|
|
3183
|
+
}, pe = (y) => {
|
|
3184
|
+
var m = Li(), S = n.child(m), D = n.sibling(S, 2), M = n.child(D, !0);
|
|
3185
|
+
n.reset(D), n.reset(m), n.template_effect(
|
|
3186
|
+
(R, O, Y) => {
|
|
3187
|
+
n.set_style(m, R), n.set_style(S, O), n.set_style(D, Y), n.set_text(M, n.get(i));
|
|
3182
3188
|
},
|
|
3183
3189
|
[
|
|
3184
|
-
() => N(
|
|
3185
|
-
() => N(
|
|
3186
|
-
() => N(
|
|
3190
|
+
() => N($e),
|
|
3191
|
+
() => N(et),
|
|
3192
|
+
() => N(tt)
|
|
3187
3193
|
]
|
|
3188
3194
|
), n.append(y, m);
|
|
3189
|
-
},
|
|
3190
|
-
var m =
|
|
3195
|
+
}, me = (y) => {
|
|
3196
|
+
var m = Ri(), S = n.child(m), D = n.sibling(S, 2);
|
|
3191
3197
|
n.reset(m), n.template_effect(
|
|
3192
|
-
(
|
|
3193
|
-
n.set_style(m,
|
|
3198
|
+
(M, R, O) => {
|
|
3199
|
+
n.set_style(m, M), n.set_style(S, R), n.set_style(D, O);
|
|
3194
3200
|
},
|
|
3195
3201
|
[
|
|
3196
|
-
() => N(
|
|
3197
|
-
() => N(
|
|
3198
|
-
() => N(
|
|
3202
|
+
() => N($e),
|
|
3203
|
+
() => N(et),
|
|
3204
|
+
() => N(tt)
|
|
3199
3205
|
]
|
|
3200
3206
|
), n.append(y, m);
|
|
3201
|
-
},
|
|
3207
|
+
}, ye = (y) => {
|
|
3202
3208
|
var m = n.comment(), S = n.first_child(m);
|
|
3203
3209
|
{
|
|
3204
|
-
var
|
|
3205
|
-
|
|
3210
|
+
var D = (R) => {
|
|
3211
|
+
_o(R, {
|
|
3206
3212
|
get displayItemList() {
|
|
3207
3213
|
return n.get(l).displayItemList;
|
|
3208
3214
|
},
|
|
@@ -3222,8 +3228,8 @@ function $i(e, t) {
|
|
|
3222
3228
|
return t.placeholderValues;
|
|
3223
3229
|
}
|
|
3224
3230
|
});
|
|
3225
|
-
},
|
|
3226
|
-
|
|
3231
|
+
}, M = (R) => {
|
|
3232
|
+
To(R, {
|
|
3227
3233
|
get displayItemList() {
|
|
3228
3234
|
return n.get(l).displayItemList;
|
|
3229
3235
|
},
|
|
@@ -3249,55 +3255,55 @@ function $i(e, t) {
|
|
|
3249
3255
|
});
|
|
3250
3256
|
};
|
|
3251
3257
|
n.if(S, (R) => {
|
|
3252
|
-
n.get(u) ? R(
|
|
3258
|
+
n.get(u) ? R(D) : R(M, -1);
|
|
3253
3259
|
});
|
|
3254
3260
|
}
|
|
3255
3261
|
n.append(y, m);
|
|
3256
3262
|
};
|
|
3257
|
-
n.if(
|
|
3258
|
-
r() !== "pre-fetched" && n.get(s) ? y(
|
|
3263
|
+
n.if(V, (y) => {
|
|
3264
|
+
r() !== "pre-fetched" && n.get(s) ? y(se) : r() !== "pre-fetched" && n.get(i) ? y(pe, 1) : r() !== "pre-fetched" && !n.get(l) ? y(me, 2) : n.get(a) && n.get(l) && y(ye, 3);
|
|
3259
3265
|
});
|
|
3260
3266
|
}
|
|
3261
|
-
n.reset(
|
|
3267
|
+
n.reset(E), n.template_effect(() => n.set_attribute(E, "data-rulecms-published-key", n.get(f))), n.append(e, E), n.pop();
|
|
3262
3268
|
}
|
|
3263
|
-
const
|
|
3264
|
-
class
|
|
3269
|
+
const ji = 6e4;
|
|
3270
|
+
class X extends Error {
|
|
3265
3271
|
constructor(r, o) {
|
|
3266
3272
|
super(r);
|
|
3267
|
-
|
|
3273
|
+
Fe(this, "status");
|
|
3268
3274
|
this.name = "FetchRuleCMSWidgetError", this.status = o;
|
|
3269
3275
|
}
|
|
3270
3276
|
}
|
|
3271
|
-
const
|
|
3272
|
-
function
|
|
3273
|
-
|
|
3277
|
+
const ue = /* @__PURE__ */ new Map();
|
|
3278
|
+
function nl() {
|
|
3279
|
+
ue.clear();
|
|
3274
3280
|
}
|
|
3275
|
-
function
|
|
3281
|
+
function nt(e) {
|
|
3276
3282
|
const t = e == null ? void 0 : e.cache;
|
|
3277
3283
|
return t === "no-store" || t === "reload" || t === "no-cache";
|
|
3278
3284
|
}
|
|
3279
|
-
function
|
|
3280
|
-
const r =
|
|
3285
|
+
function Ni(e, t) {
|
|
3286
|
+
const r = ue.get(e);
|
|
3281
3287
|
if (r) {
|
|
3282
3288
|
if (r.expiresAt <= t) {
|
|
3283
|
-
|
|
3289
|
+
ue.delete(e);
|
|
3284
3290
|
return;
|
|
3285
3291
|
}
|
|
3286
3292
|
return r.data;
|
|
3287
3293
|
}
|
|
3288
3294
|
}
|
|
3289
|
-
async function
|
|
3295
|
+
async function Bt(e) {
|
|
3290
3296
|
return (await e.json().catch(() => ({ error: "Unknown error" }))).error || `Request failed with status ${e.status}`;
|
|
3291
3297
|
}
|
|
3292
|
-
async function
|
|
3298
|
+
async function Ut({
|
|
3293
3299
|
publishedKey: e,
|
|
3294
3300
|
token: t,
|
|
3295
3301
|
endpoint: r,
|
|
3296
3302
|
fetchOptions: o
|
|
3297
3303
|
}) {
|
|
3298
|
-
const s =
|
|
3299
|
-
if (!i && !
|
|
3300
|
-
const c =
|
|
3304
|
+
const s = lt({ publishedKey: e, token: t, endpoint: r }), i = H(t), l = Date.now();
|
|
3305
|
+
if (!i && !nt(o)) {
|
|
3306
|
+
const c = Ni(s, l);
|
|
3301
3307
|
if (c)
|
|
3302
3308
|
return c;
|
|
3303
3309
|
}
|
|
@@ -3307,18 +3313,18 @@ async function Kt({
|
|
|
3307
3313
|
...o
|
|
3308
3314
|
});
|
|
3309
3315
|
if (!a.ok)
|
|
3310
|
-
throw new
|
|
3316
|
+
throw new X(await Bt(a), a.status);
|
|
3311
3317
|
const d = await a.json();
|
|
3312
3318
|
if (!d.success)
|
|
3313
|
-
throw new
|
|
3314
|
-
const u =
|
|
3315
|
-
return !i && !
|
|
3316
|
-
expiresAt: l +
|
|
3319
|
+
throw new X("Failed to fetch widget data");
|
|
3320
|
+
const u = Me(d.data);
|
|
3321
|
+
return !i && !nt(o) && ue.set(s, {
|
|
3322
|
+
expiresAt: l + ji,
|
|
3317
3323
|
data: u
|
|
3318
3324
|
}), u;
|
|
3319
3325
|
}
|
|
3320
|
-
async function
|
|
3321
|
-
const { rulesetPublishedKey: t, params: r, fallbackPublishedKey: o, contentType: s, token: i, endpoint: l, fetchOptions: a } = e, d = () =>
|
|
3326
|
+
async function Mi(e) {
|
|
3327
|
+
const { rulesetPublishedKey: t, params: r, fallbackPublishedKey: o, contentType: s, token: i, endpoint: l, fetchOptions: a } = e, d = () => Ut({
|
|
3322
3328
|
publishedKey: o,
|
|
3323
3329
|
token: i,
|
|
3324
3330
|
endpoint: l,
|
|
@@ -3326,8 +3332,8 @@ async function ji(e) {
|
|
|
3326
3332
|
});
|
|
3327
3333
|
let u;
|
|
3328
3334
|
try {
|
|
3329
|
-
u = await fetch(
|
|
3330
|
-
...
|
|
3335
|
+
u = await fetch(at({ token: i, endpoint: l }), {
|
|
3336
|
+
...Vt({
|
|
3331
3337
|
token: i,
|
|
3332
3338
|
rulesetPublishedKey: t,
|
|
3333
3339
|
params: r,
|
|
@@ -3341,199 +3347,199 @@ async function ji(e) {
|
|
|
3341
3347
|
throw f;
|
|
3342
3348
|
}
|
|
3343
3349
|
if (!u.ok) {
|
|
3344
|
-
if (o &&
|
|
3350
|
+
if (o && Ft(u.status))
|
|
3345
3351
|
return d();
|
|
3346
|
-
throw new
|
|
3352
|
+
throw new X(await Bt(u), u.status);
|
|
3347
3353
|
}
|
|
3348
|
-
const c =
|
|
3354
|
+
const c = Kt({
|
|
3349
3355
|
token: i,
|
|
3350
3356
|
rulesetPublishedKey: t,
|
|
3351
3357
|
body: await u.json()
|
|
3352
3358
|
});
|
|
3353
3359
|
if (!c)
|
|
3354
|
-
throw new
|
|
3355
|
-
return { ...
|
|
3360
|
+
throw new X("Failed to fetch widget data");
|
|
3361
|
+
return { ...Me(c.raw), selection: c.selection };
|
|
3356
3362
|
}
|
|
3357
|
-
async function
|
|
3363
|
+
async function rl(e) {
|
|
3358
3364
|
const { publishedKey: t, rulesetPublishedKey: r, token: o } = e;
|
|
3359
3365
|
if (!t && !r) {
|
|
3360
|
-
const s =
|
|
3361
|
-
throw r !== void 0 ? new
|
|
3366
|
+
const s = H(o);
|
|
3367
|
+
throw r !== void 0 ? new X(
|
|
3362
3368
|
s ? "Ruleset key is required" : "Ruleset published key is required"
|
|
3363
|
-
) : new
|
|
3369
|
+
) : new X(
|
|
3364
3370
|
s ? "Widget key is required" : "Published key is required"
|
|
3365
3371
|
);
|
|
3366
3372
|
}
|
|
3367
3373
|
if (!o)
|
|
3368
|
-
throw new
|
|
3369
|
-
return e.rulesetPublishedKey ?
|
|
3374
|
+
throw new X("Token is required");
|
|
3375
|
+
return e.rulesetPublishedKey ? Mi(e) : Ut(e);
|
|
3370
3376
|
}
|
|
3371
|
-
async function
|
|
3372
|
-
const { data: t, libraries: r } = e, o =
|
|
3377
|
+
async function ol(e) {
|
|
3378
|
+
const { data: t, libraries: r } = e, o = Pe({
|
|
3373
3379
|
displayItemList: t.displayItemList,
|
|
3374
3380
|
widgetCollections: t.widgetCollections
|
|
3375
3381
|
});
|
|
3376
|
-
return
|
|
3382
|
+
return de().resolve({ registrations: r, referenced: o });
|
|
3377
3383
|
}
|
|
3378
3384
|
export {
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3385
|
+
Ki as AlignContentTypes,
|
|
3386
|
+
_o as BreakpointVariantRender,
|
|
3387
|
+
st as COLLECTION_TYPE_PREFIX,
|
|
3388
|
+
fe as COMPONENT_PROPS_PATH_SEPARATOR,
|
|
3389
|
+
Re as CSS_CLASSES_ATTRIBUTE_NAME,
|
|
3390
|
+
On as CSS_VARIABLE_NAME_MAX_LENGTH,
|
|
3391
|
+
Rn as CSS_VARIABLE_NAME_PATTERN,
|
|
3392
|
+
ht as DEFAULT_BASE_Z_INDEX,
|
|
3393
|
+
mn as DEFAULT_CLOUDINARY_CLOUD_NAME,
|
|
3394
|
+
re as DEFAULT_LIBRARY_ID,
|
|
3395
|
+
ji as DEFAULT_PUBLISHED_WIDGET_CACHE_MS,
|
|
3396
|
+
Dr as DEFAULT_ROW_GAP,
|
|
3397
|
+
$t as DEV_CLIENT_TOKEN_PREFIX,
|
|
3398
|
+
rn as DEV_WIDGET_API_PATH,
|
|
3399
|
+
sn as DEV_WIDGET_RESOLVE_API_PATH,
|
|
3400
|
+
Bi as DeviceDisplayTypes,
|
|
3401
|
+
yo as DisplayComponent,
|
|
3402
|
+
Ie as DisplayItemTypes,
|
|
3403
|
+
ot as DragItemIdPrefixTypes,
|
|
3404
|
+
dn as EMBEDDED_KEY_SEPARATOR,
|
|
3405
|
+
rr as FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY,
|
|
3406
|
+
X as FetchRuleCMSWidgetError,
|
|
3407
|
+
pt as HIDE_WIDGET_ATTRIBUTE_NAME,
|
|
3408
|
+
ze as JustifyContentTypes,
|
|
3409
|
+
jr as POINTER_EVENTS_ATTRIBUTE_NAME,
|
|
3410
|
+
we as PUBLISHED_KEY_SEPARATOR,
|
|
3411
|
+
nn as PUBLISHED_WIDGET_API_PATH,
|
|
3412
|
+
on as PUBLISHED_WIDGET_RESOLVE_API_PATH,
|
|
3413
|
+
Ue as PageViewTypes,
|
|
3414
|
+
Ze as RULECMS_ANONYMOUS_ID_STORAGE_KEY,
|
|
3415
|
+
en as RULECMS_API_ORIGIN,
|
|
3416
|
+
el as RULECMS_PUBLISHED_KEY_ATTRIBUTE,
|
|
3417
|
+
dt as RULECMS_WIDGET_CONTEXT_KEY,
|
|
3418
|
+
To as RenderComponents,
|
|
3419
|
+
Se as RenderComponentsForDevice,
|
|
3420
|
+
Ee as RenderComponentsInner,
|
|
3421
|
+
tl as RuleCMSWidget,
|
|
3422
|
+
qi as RuleCMSWidgetProvider,
|
|
3423
|
+
Nr as WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE,
|
|
3424
|
+
tn as WIDGET_CACHE_API_ORIGIN,
|
|
3425
|
+
Ye as WIDGET_PLACEHOLDER_VALUES_KEY,
|
|
3426
|
+
Vr as Z_INDEX_WIDGET_ATTRIBUTE_NAME,
|
|
3427
|
+
Qn as alignContentAllowlist,
|
|
3428
|
+
qn as alignItemsAllowlist,
|
|
3429
|
+
tr as backgroundPositionAllowlist,
|
|
3430
|
+
nr as backgroundRepeatAllowlist,
|
|
3431
|
+
er as backgroundSizeAllowlist,
|
|
3432
|
+
or as borderStyleKeywords,
|
|
3433
|
+
Mn as boxSpacingSideKeys,
|
|
3434
|
+
$i as boxSpacingStyleAttributeEntries,
|
|
3435
|
+
Ln as buildCloudinaryBackgroundUrl,
|
|
3436
|
+
Hr as buildOverlayLayerBoxStyles,
|
|
3437
|
+
zr as buildOverlayStackStyles,
|
|
3438
|
+
lt as buildWidgetFetchUrl,
|
|
3439
|
+
at as buildWidgetResolveUrl,
|
|
3440
|
+
nl as clearPublishedWidgetFetchCache,
|
|
3441
|
+
Xr as collectComponentInstancePaths,
|
|
3442
|
+
Pe as collectReferencedLibraryIds,
|
|
3443
|
+
Qt as composeSourceComponentsPlugin,
|
|
3444
|
+
de as createComponentLibraryRegistry,
|
|
3445
|
+
_e as cssAttrArrayKey,
|
|
3446
|
+
pn as defaultPageWidth,
|
|
3447
|
+
Sr as deriveDisplayFlexIfNeeded,
|
|
3448
|
+
Zi as desktopModeWidth,
|
|
3449
|
+
rl as fetchRuleCMSWidget,
|
|
3450
|
+
qr as findUnmatchedComponentPropsKeys,
|
|
3451
|
+
$n as flexDirectionAllowlist,
|
|
3452
|
+
Zn as flexWrapAllowlist,
|
|
3453
|
+
Bn as fontFamilyAllowlist,
|
|
3454
|
+
zn as fontStyleAllowlist,
|
|
3455
|
+
Un as fontWeightAllowlist,
|
|
3456
|
+
gr as formatBackgroundImageStyles,
|
|
3457
|
+
pr as formatBorderStyles,
|
|
3458
|
+
mr as formatBoxShadowStyles,
|
|
3459
|
+
hr as formatBoxSpacingStyles,
|
|
3460
|
+
br as formatCssColorStyles,
|
|
3461
|
+
ke as formatCssColorValue,
|
|
3462
|
+
vr as formatCssEnumStyles,
|
|
3463
|
+
Cr as formatCssLengthStyles,
|
|
3458
3464
|
B as formatCssVariable,
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3465
|
+
Qi as formatCssVariableStyles,
|
|
3466
|
+
_r as formatLineHeightStyles,
|
|
3467
|
+
Ar as formatObjectStyleAttribute,
|
|
3468
|
+
wr as formatOpacityStyles,
|
|
3463
3469
|
Q as formatSpacingSideValue,
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
+
fn as generatePublishedKey,
|
|
3471
|
+
Xi as generatePublishedKeyForEmbedded,
|
|
3472
|
+
ut as getCollectionIdForCollectionType,
|
|
3473
|
+
ce as getColumnAttributes,
|
|
3474
|
+
He as getComponentAttributesAndStyles,
|
|
3475
|
+
Ce as getComponentsPluginFromPlugins,
|
|
3470
3476
|
k as getCssVariableFromLeaf,
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3477
|
+
Tr as getDefaultDimensionAttributes,
|
|
3478
|
+
G as getDeviceTypeBasedAttributes,
|
|
3479
|
+
Ui as getDragItemId,
|
|
3480
|
+
ln as getDragItemPrefixAndId,
|
|
3481
|
+
an as getIdAndPrefix,
|
|
3482
|
+
Ir as getMergedAttributes,
|
|
3483
|
+
zi as getNameAndInstanceIdFromWidgetKey,
|
|
3484
|
+
Hi as getNameFromWidgetKey,
|
|
3485
|
+
Ai as getOrCreateAnonymousId,
|
|
3486
|
+
Kr as getOverlayLayerZIndex,
|
|
3487
|
+
cn as getWidgetKeyForCollection,
|
|
3488
|
+
Gi as getWidgetKeyForCollectionWithPrefix,
|
|
3489
|
+
un as getWidgetKeyForPublishedCollection,
|
|
3490
|
+
Yi as getWidgetKeyForPublishedCollectionWithPrefix,
|
|
3491
|
+
ur as hasBoxShadowLeaf,
|
|
3492
|
+
eo as hasDeviceDivergentValues,
|
|
3493
|
+
z as hasInvalidCssVariable,
|
|
3494
|
+
Pr as hasItems,
|
|
3495
|
+
Fr as hasOverlayLayers,
|
|
3496
|
+
Ji as incrementVersion,
|
|
3497
|
+
jn as isBackgroundImageValue,
|
|
3498
|
+
sr as isBorderStyleValue,
|
|
3499
|
+
ir as isBorderValue,
|
|
3500
|
+
cr as isBoxShadowValue,
|
|
3501
|
+
Wn as isBoxSpacingValue,
|
|
3502
|
+
In as isCloudinaryCloudName,
|
|
3503
|
+
Tn as isCloudinaryPublicId,
|
|
3504
|
+
Dn as isCloudinaryTransformationString,
|
|
3505
|
+
xe as isCssColorValue,
|
|
3506
|
+
Kn as isCssEnumValue,
|
|
3501
3507
|
$ as isCssVariableName,
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
+
H as isDevClientToken,
|
|
3509
|
+
dr as isLineHeightValue,
|
|
3510
|
+
fr as isOpacityValue,
|
|
3511
|
+
Ur as isOverlayLayerEmptyForDevice,
|
|
3512
|
+
kr as isRowHiddenForDevice,
|
|
3513
|
+
Pn as isSafeImageUrl,
|
|
3508
3514
|
Z as isSpacingSideValue,
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3515
|
+
je as isWidgetHiddenForDevice,
|
|
3516
|
+
Jn as justifyContentAllowlist,
|
|
3517
|
+
Oe as normalizeCssClasses,
|
|
3518
|
+
Le as objectStyleAttributeRegistry,
|
|
3519
|
+
be as overflowAllowlist,
|
|
3520
|
+
ft as phoneModeWidth,
|
|
3521
|
+
Xn as pointerEventsAllowlist,
|
|
3522
|
+
Me as prepareRuleCMSWidgetData,
|
|
3523
|
+
Ge as resolveBaseZIndex,
|
|
3524
|
+
rt as resolveKey,
|
|
3525
|
+
Br as resolveOverlayLayerPointerEvents,
|
|
3526
|
+
Lr as resolveRowStyles,
|
|
3527
|
+
it as resolveWidgetApiOrigin,
|
|
3528
|
+
mt as resolveWidgetContainerStyles,
|
|
3529
|
+
Gr as resolveWidgetInstanceProps,
|
|
3530
|
+
ol as resolveWidgetLibraries,
|
|
3531
|
+
xr as rowBasedPropertiesAreAssigned,
|
|
3532
|
+
De as spacingKeywords,
|
|
3533
|
+
Nn as spacingLengthUnits,
|
|
3534
|
+
Ti as stableJsonStringify,
|
|
3535
|
+
gt as tabletModeWidth,
|
|
3536
|
+
Hn as textAlignAllowlist,
|
|
3537
|
+
Gn as textDecorationAllowlist,
|
|
3538
|
+
Yn as textTransformAllowlist,
|
|
3533
3539
|
N as toStyleAttr,
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3540
|
+
ct as typeHasPrefix,
|
|
3541
|
+
Zr as warnUnmatchedComponentProps,
|
|
3542
|
+
Wr as widgetBasedPropertiesAreAssigned,
|
|
3543
|
+
yt as widgetDeclaresOwnHeight,
|
|
3544
|
+
Yr as withWidgetPlaceholderValues
|
|
3539
3545
|
};
|