@rulecms/widget-vue 0.7.0 → 0.8.1

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.js CHANGED
@@ -1,32 +1,32 @@
1
- var kt = Object.defineProperty;
2
- var Tt = (e, t, n) => t in e ? kt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var Pe = (e, t, n) => Tt(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { defineComponent as A, reactive as It, watch as Be, provide as Pt, renderSlot as pe, computed as g, openBlock as f, createElementBlock as b, normalizeStyle as I, normalizeClass as G, createBlock as C, resolveDynamicComponent as P, withCtx as T, createTextVNode as R, toDisplayString as L, createCommentVNode as k, Fragment as E, normalizeProps as oe, guardReactiveProps as De, mergeProps as Dt, resolveComponent as $t, createVNode as $, renderList as F, createElementVNode as V, ref as Y, onMounted as Lt, onBeforeUnmount as Ke, inject as xt, unref as j } from "vue";
5
- const X = "default";
6
- function ze(e, t) {
7
- return !(e != null && e.length) || e === X ? t : `${e}/${t}`;
8
- }
9
- const Rt = `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-vue README.`;
10
- function $e(e) {
1
+ var Yt = Object.defineProperty;
2
+ var Xt = (e, t, n) => t in e ? Yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var Ne = (e, t, n) => Xt(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defineComponent as S, reactive as Jt, watch as ot, provide as qt, renderSlot as ke, computed as m, openBlock as p, createElementBlock as w, normalizeStyle as D, normalizeClass as oe, createBlock as v, resolveDynamicComponent as x, unref as T, createCommentVNode as I, Fragment as k, normalizeProps as he, guardReactiveProps as We, mergeProps as Zt, resolveComponent as Qt, createVNode as R, withCtx as re, renderList as U, createElementVNode as K, ref as H, onMounted as en, onBeforeUnmount as st, inject as tn, toDisplayString as nn } from "vue";
5
+ const se = "default";
6
+ function it(e, t) {
7
+ return !(e != null && e.length) || e === se ? t : `${e}/${t}`;
8
+ }
9
+ const on = `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-vue README.`;
10
+ function Ve(e) {
11
11
  if (!e || typeof e != "object")
12
12
  return !1;
13
13
  const t = e;
14
14
  return !!t.manifest && typeof t.manifest == "object" && !!t.components && typeof t.components == "object" && !Array.isArray(t.components);
15
15
  }
16
- function Ot(e) {
17
- if ($e(e))
16
+ function sn(e) {
17
+ if (Ve(e))
18
18
  return e;
19
19
  const t = e;
20
- return $e(t == null ? void 0 : t.default) ? t.default : null;
20
+ return Ve(t == null ? void 0 : t.default) ? t.default : null;
21
21
  }
22
- function se(e) {
23
- return e.usesDefaultLibrary ? [X, ...e.libraryIds] : [...e.libraryIds];
22
+ function ge(e) {
23
+ return e.usesDefaultLibrary ? [se, ...e.libraryIds] : [...e.libraryIds];
24
24
  }
25
- function Le({ registrations: e, referenced: t }) {
26
- if (t.usesDefaultLibrary && !(e != null && e[X]))
27
- throw new Error(Rt);
25
+ function Fe({ registrations: e, referenced: t }) {
26
+ if (t.usesDefaultLibrary && !(e != null && e[se]))
27
+ throw new Error(on);
28
28
  }
29
- function _t(e) {
29
+ function rn(e) {
30
30
  const t = [], n = /* @__PURE__ */ new Set();
31
31
  for (const o of e.values()) {
32
32
  if (typeof o.stylesheet != "string")
@@ -36,109 +36,109 @@ function _t(e) {
36
36
  }
37
37
  return t.length > 0 ? t : void 0;
38
38
  }
39
- function jt(e) {
39
+ function ln(e) {
40
40
  const t = {};
41
41
  for (const [o, s] of e) {
42
- const i = o === X;
43
- for (const [r, l] of Object.entries(s.components))
44
- t[i ? r : `${o}/${r}`] = l;
42
+ const i = o === se;
43
+ for (const [l, r] of Object.entries(s.components))
44
+ t[i ? l : `${o}/${l}`] = r;
45
45
  }
46
- const n = _t(e);
46
+ const n = rn(e);
47
47
  return n ? { components: t, stylesheets: n } : { components: t };
48
48
  }
49
- function te() {
49
+ function de() {
50
50
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
51
51
  let s = 0;
52
- function i(c, a) {
53
- var p;
54
- e.get(c) !== a && ((p = a.manifest) != null && p.id && a.manifest.id !== c && console.warn(
55
- `RuleCMS widget: component library registered as "${c}" declares manifest id "${a.manifest.id}". The registered id wins for resolution.`
56
- ), e.set(c, a), s += 1);
52
+ function i(a, c) {
53
+ var f;
54
+ e.get(a) !== c && ((f = c.manifest) != null && f.id && c.manifest.id !== a && console.warn(
55
+ `RuleCMS widget: component library registered as "${a}" declares manifest id "${c.manifest.id}". The registered id wins for resolution.`
56
+ ), e.set(a, c), s += 1);
57
57
  }
58
- function r(c) {
59
- const a = se(c), p = [...a].sort().join("|"), y = o.get(p);
60
- if (y && y.loadedVersion === s)
61
- return y.plugin;
62
- const d = /* @__PURE__ */ new Map();
63
- for (const m of a) {
64
- const S = e.get(m);
65
- S && d.set(m, S);
58
+ function l(a) {
59
+ const c = ge(a), f = [...c].sort().join("|"), h = o.get(f);
60
+ if (h && h.loadedVersion === s)
61
+ return h.plugin;
62
+ const u = /* @__PURE__ */ new Map();
63
+ for (const b of c) {
64
+ const C = e.get(b);
65
+ C && u.set(b, C);
66
66
  }
67
- const h = jt(d);
68
- return o.set(p, { loadedVersion: s, plugin: h }), h;
67
+ const y = ln(u);
68
+ return o.set(f, { loadedVersion: s, plugin: y }), y;
69
69
  }
70
- function l(c) {
71
- Le(c);
72
- const { registrations: a, referenced: p } = c;
73
- for (const y of se(p)) {
74
- if (e.has(y) || n.has(y))
70
+ function r(a) {
71
+ Fe(a);
72
+ const { registrations: c, referenced: f } = a;
73
+ for (const h of ge(f)) {
74
+ if (e.has(h) || n.has(h))
75
75
  continue;
76
- const d = a == null ? void 0 : a[y];
77
- if (!d) {
76
+ const u = c == null ? void 0 : c[h];
77
+ if (!u) {
78
78
  console.error(
79
- `RuleCMS widget: no component library registered for libraryId "${y}"; its components will not render.`
80
- ), n.set(y, new Error(`No registration for libraryId "${y}"`));
79
+ `RuleCMS widget: no component library registered for libraryId "${h}"; its components will not render.`
80
+ ), n.set(h, new Error(`No registration for libraryId "${h}"`));
81
81
  continue;
82
82
  }
83
- if (typeof d == "function")
83
+ if (typeof u == "function")
84
84
  return null;
85
- i(y, d);
85
+ i(h, u);
86
86
  }
87
- return r(p);
87
+ return l(f);
88
88
  }
89
- async function u(c) {
90
- Le(c);
91
- const { registrations: a, referenced: p } = c, y = se(p);
89
+ async function d(a) {
90
+ Fe(a);
91
+ const { registrations: c, referenced: f } = a, h = ge(f);
92
92
  return await Promise.all(
93
- y.map(async (d) => {
94
- if (e.has(d) || n.has(d))
93
+ h.map(async (u) => {
94
+ if (e.has(u) || n.has(u))
95
95
  return;
96
- const h = a == null ? void 0 : a[d];
97
- if (!h) {
96
+ const y = c == null ? void 0 : c[u];
97
+ if (!y) {
98
98
  console.error(
99
- `RuleCMS widget: no component library registered for libraryId "${d}"; its components will not render.`
100
- ), n.set(d, new Error(`No registration for libraryId "${d}"`));
99
+ `RuleCMS widget: no component library registered for libraryId "${u}"; its components will not render.`
100
+ ), n.set(u, new Error(`No registration for libraryId "${u}"`));
101
101
  return;
102
102
  }
103
- if (typeof h != "function") {
104
- i(d, h);
103
+ if (typeof y != "function") {
104
+ i(u, y);
105
105
  return;
106
106
  }
107
- let m = t.get(d);
108
- m || (m = h().then((S) => {
109
- const w = Ot(S);
110
- if (!w)
107
+ let b = t.get(u);
108
+ b || (b = y().then((C) => {
109
+ const g = sn(C);
110
+ if (!g)
111
111
  throw new Error(
112
- `Registration for libraryId "${d}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`
112
+ `Registration for libraryId "${u}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`
113
113
  );
114
- i(d, w);
115
- }).catch((S) => {
116
- n.set(d, S), console.error(
117
- `RuleCMS widget: failed to load component library "${d}":`,
118
- S
114
+ i(u, g);
115
+ }).catch((C) => {
116
+ n.set(u, C), console.error(
117
+ `RuleCMS widget: failed to load component library "${u}":`,
118
+ C
119
119
  );
120
120
  }).finally(() => {
121
- t.delete(d);
122
- }), t.set(d, m)), await m;
121
+ t.delete(u);
122
+ }), t.set(u, b)), await b;
123
123
  })
124
- ), r(p);
124
+ ), l(f);
125
125
  }
126
- return { resolveSync: l, resolve: u };
126
+ return { resolveSync: r, resolve: d };
127
127
  }
128
- const nr = {
128
+ const Be = {
129
129
  Preview: "Preview",
130
130
  Compose: "Compose",
131
131
  RenderedPage: "RenderedPage"
132
- }, fe = {
132
+ }, Ie = {
133
133
  DroppableBox: "droppable-box"
134
- }, xe = {
134
+ }, Ke = {
135
135
  FlexStart: "flex-start",
136
136
  FlexEnd: "flex-end",
137
137
  Center: "center",
138
138
  SpaceBetween: "space-between",
139
139
  SpaceAround: "space-around",
140
140
  SpaceEvenly: "space-evenly"
141
- }, or = {
141
+ }, Vr = {
142
142
  FlexStart: "flex-start",
143
143
  FlexEnd: "flex-end",
144
144
  Center: "center",
@@ -146,49 +146,56 @@ const nr = {
146
146
  SpaceAround: "space-around",
147
147
  SpaceEvenly: "space-evenly",
148
148
  Stretch: "stretch"
149
- }, ce = "cssAttrArray", sr = {
149
+ }, ve = "cssAttrArray", Fr = {
150
150
  Phone: "phone",
151
151
  Tablet: "tablet",
152
152
  Desktop: "desktop"
153
- }, He = {
153
+ }, rt = {
154
154
  ComposerComponent: "ComposerWidget",
155
155
  Collection: "Collection",
156
156
  MoveComponentHandle: "MoveWidgetHandle"
157
- }, Ue = `${He.Collection}_`, Mt = "dev.", Nt = "https://rulecms.com", Wt = "https://widget-cache.rulecms.com", Vt = "/api/v1/c/widget/get", Ft = "/api/v1/c/dev/widget/get";
158
- function K(e) {
159
- return typeof e == "string" && e.startsWith(Mt);
157
+ }, lt = `${rt.Collection}_`, cn = "dev.", an = "https://rulecms.com", un = "https://widget-cache.rulecms.com", dn = "/api/v1/c/widget/get", pn = "/api/v1/c/dev/widget/get", fn = "/api/v1/c/widget/resolve", yn = "/api/v1/c/dev/widget/resolve";
158
+ function F(e) {
159
+ return typeof e == "string" && e.startsWith(cn);
160
160
  }
161
- function Bt(e, t) {
162
- return t ? t.replace(/\/$/, "") : K(e) ? Nt : Wt;
161
+ function ct(e, t) {
162
+ return t ? t.replace(/\/$/, "") : F(e) ? an : un;
163
163
  }
164
- function Ye({
164
+ function at({
165
165
  publishedKey: e,
166
166
  token: t,
167
167
  endpoint: n
168
168
  }) {
169
- const o = K(t), s = o ? Ft : Vt, i = o ? new URLSearchParams({ widgetKey: e, token: t }) : new URLSearchParams({ publishedKey: e, token: t });
170
- return `${Bt(t, n)}${s}?${i.toString()}`;
169
+ const o = F(t), s = o ? pn : dn, i = o ? new URLSearchParams({ widgetKey: e, token: t }) : new URLSearchParams({ publishedKey: e, token: t });
170
+ return `${ct(t, n)}${s}?${i.toString()}`;
171
+ }
172
+ function ut({
173
+ token: e,
174
+ endpoint: t
175
+ }) {
176
+ const n = F(e) ? yn : fn;
177
+ return `${ct(e, t)}${n}`;
171
178
  }
172
- const ir = ({ id: e, prefix: t }) => `${t}_${e}`, Kt = (e) => {
179
+ const Br = ({ id: e, prefix: t }) => `${t}_${e}`, mn = (e) => {
173
180
  if (!(e != null && e.length) || !e.includes("_")) {
174
181
  console.error(`Invalid drag item id: ${e}. Type does not exist.`);
175
182
  return;
176
183
  }
177
- return zt(e);
178
- }, Ge = (e) => e.includes("_"), zt = (e) => {
184
+ return hn(e);
185
+ }, dt = (e) => e.includes("_"), hn = (e) => {
179
186
  const t = e.indexOf("_"), n = e.substring(0, t), o = e.substring(t + 1);
180
187
  return {
181
188
  prefix: n,
182
189
  id: o
183
190
  };
184
- }, Xe = (e) => {
185
- if (!Ge(e))
191
+ }, pt = (e) => {
192
+ if (!dt(e))
186
193
  return;
187
- const n = Kt(e);
188
- return (n == null ? void 0 : n.prefix) === He.Collection || console.error(
194
+ const n = mn(e);
195
+ return (n == null ? void 0 : n.prefix) === rt.Collection || console.error(
189
196
  "getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."
190
197
  ), n == null ? void 0 : n.id;
191
- }, rr = (e) => {
198
+ }, Kr = (e) => {
192
199
  if (!(e != null && e.length)) {
193
200
  console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");
194
201
  return;
@@ -203,47 +210,47 @@ const ir = ({ id: e, prefix: t }) => `${t}_${e}`, Kt = (e) => {
203
210
  return { name: n, instanceId: t[1] };
204
211
  const s = t[1].split("@");
205
212
  return { name: n, instanceId: s[0], parentId: s[1] };
206
- }, lr = (e) => {
213
+ }, Hr = (e) => {
207
214
  if (!(e != null && e.length))
208
215
  return { errorMessage: "getNameFromWidgetKey: Missing widget key" };
209
216
  const t = e.split("$");
210
217
  return t.length < 2 ? { errorMessage: "getNameFromWidgetKey: Invalid widget key format" } : { name: t[0] };
211
- }, Ht = (e) => {
212
- var s, i, r, l;
218
+ }, gn = (e) => {
219
+ var s, i, l, r;
213
220
  if (!e)
214
221
  return { error: "getWidgetKeyForCollection: Missing collection" };
215
222
  if (!((s = e.name) != null && s.length))
216
223
  return { error: "getWidgetKeyForCollection: Missing collection name" };
217
224
  const t = (i = e.name) == null ? void 0 : i.trim().toLowerCase();
218
- if (!((r = e.id) != null && r.length))
225
+ if (!((l = e.id) != null && l.length))
219
226
  return { error: "getWidgetKeyForCollection: Missing collection id" };
220
- const o = ((l = e.parentId) == null ? void 0 : l.length) ? `${e.id}@${e.parentId}` : `${e.id}`;
227
+ const o = ((r = e.parentId) == null ? void 0 : r.length) ? `${e.id}@${e.parentId}` : `${e.id}`;
221
228
  return { data: `${t}$${o}` };
222
- }, Ut = (e) => {
223
- var s, i, r, l;
229
+ }, bn = (e) => {
230
+ var s, i, l, r;
224
231
  if (!e)
225
232
  return { error: "getWidgetKeyForPublishedCollection: Missing collection" };
226
233
  if (!((s = e.name) != null && s.length))
227
234
  return { error: "getWidgetKeyForPublishedCollection: Missing collection name" };
228
235
  const t = (i = e.name) == null ? void 0 : i.trim().toLowerCase();
229
- if (!((r = e.publishedKey) != null && r.length))
236
+ if (!((l = e.publishedKey) != null && l.length))
230
237
  return { error: "getWidgetKeyForPublishedCollection: Missing collection publishedKey" };
231
- const o = ((l = e.parentId) == null ? void 0 : l.length) ? `${e.publishedKey}@${e.parentId}` : `${e.publishedKey}`;
238
+ const o = ((r = e.parentId) == null ? void 0 : r.length) ? `${e.publishedKey}@${e.parentId}` : `${e.publishedKey}`;
232
239
  return { data: `${t}$${o}` };
233
- }, cr = (e) => {
234
- const t = Ht(e);
235
- return `${Ue}${t.data}`;
236
- }, ar = (e) => {
237
- const t = Ut(e);
238
- return `${Ue}${t.data}`;
239
- }, Yt = "---", Gt = "___";
240
- function Xt(e, t) {
241
- return `${e}${Yt}${t}`;
242
- }
243
- function ur(e, t, n) {
244
- return `${Xt(e, t)}${Gt}${n}`;
245
- }
246
- function dr(e) {
240
+ }, Ur = (e) => {
241
+ const t = gn(e);
242
+ return `${lt}${t.data}`;
243
+ }, zr = (e) => {
244
+ const t = bn(e);
245
+ return `${lt}${t.data}`;
246
+ }, Ae = "---", Cn = "___";
247
+ function wn(e, t) {
248
+ return `${e}${Ae}${t}`;
249
+ }
250
+ function Gr(e, t, n) {
251
+ return `${wn(e, t)}${Cn}${n}`;
252
+ }
253
+ function Yr(e) {
247
254
  const t = e.split(".");
248
255
  if (t.length !== 3)
249
256
  throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);
@@ -252,19 +259,19 @@ function dr(e) {
252
259
  throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);
253
260
  return `${n}.${o}.${s + 1}`;
254
261
  }
255
- function ye({
262
+ function Pe({
256
263
  displayItemList: e,
257
264
  widgetCollections: t
258
265
  }) {
259
266
  const n = /* @__PURE__ */ new Set();
260
267
  let o = !1;
261
268
  const s = (i) => {
262
- var r, l, u;
263
- if ((r = i == null ? void 0 : i.rows) != null && r.length) {
264
- for (const c of i.rows)
265
- if ((l = c == null ? void 0 : c.columns) != null && l.length)
266
- for (const a of c.columns)
267
- a.collection && s(a.collection.collectionRows), !(!a.type || a.type === fe.DroppableBox) && (Ge(a.type) || (!((u = a.libraryId) != null && u.length) || a.libraryId === X ? o = !0 : n.add(a.libraryId)));
269
+ var l, r, d;
270
+ if ((l = i == null ? void 0 : i.rows) != null && l.length) {
271
+ for (const a of i.rows)
272
+ if ((r = a == null ? void 0 : a.columns) != null && r.length)
273
+ for (const c of a.columns)
274
+ c.collection && s(c.collection.collectionRows), !(!c.type || c.type === Ie.DroppableBox) && (dt(c.type) || (!((d = c.libraryId) != null && d.length) || c.libraryId === se ? o = !0 : n.add(c.libraryId)));
268
275
  }
269
276
  };
270
277
  s(e);
@@ -272,16 +279,16 @@ function ye({
272
279
  s(i == null ? void 0 : i.collectionRows);
273
280
  return { libraryIds: Array.from(n), usesDefaultLibrary: o };
274
281
  }
275
- const Je = Symbol("rulecms-widget-context");
276
- function Jt() {
282
+ const ft = Symbol("rulecms-widget-context");
283
+ function vn() {
277
284
  return {
278
285
  token: "",
279
286
  endpoint: void 0,
280
287
  libraries: void 0,
281
- libraryRegistry: te()
288
+ libraryRegistry: de()
282
289
  };
283
290
  }
284
- const pr = /* @__PURE__ */ A({
291
+ const Xr = /* @__PURE__ */ S({
285
292
  __name: "RuleCMSWidgetProvider",
286
293
  props: {
287
294
  token: {},
@@ -289,97 +296,97 @@ const pr = /* @__PURE__ */ A({
289
296
  libraries: {}
290
297
  },
291
298
  setup(e) {
292
- const t = e, n = It(Jt());
293
- return Be(
299
+ const t = e, n = Jt(vn());
300
+ return ot(
294
301
  () => [t.token, t.endpoint, t.libraries],
295
302
  () => {
296
303
  n.token = t.token, n.endpoint = t.endpoint, n.libraries = t.libraries;
297
304
  },
298
305
  { immediate: !0 }
299
- ), Pt(Je, n), (o, s) => pe(o.$slots, "default");
306
+ ), qt(ft, n), (o, s) => ke(o.$slots, "default");
300
307
  }
301
- }), Zt = "1200px", Ze = "500px", qe = "820px", fr = Zt, qt = "rulecms", Qt = 1920, en = {
308
+ }), An = "1200px", yt = "500px", mt = "820px", Jr = An, Tn = "rulecms", En = 1920, Sn = {
302
309
  f: "auto",
303
310
  q: "auto",
304
311
  c: "limit"
305
- }, tn = /^[A-Za-z0-9][A-Za-z0-9._\-/]*$/, nn = 300, on = /^[A-Za-z0-9][A-Za-z0-9_-]*$/, sn = 100, rn = /^https:\/\/[^\s"'()\\<>]+$/, ln = 2e3, cn = /^[A-Za-z0-9_,.:\-/]*$/, an = 300, un = (e) => typeof e == "string" && e.length <= nn && tn.test(e), dn = (e) => typeof e == "string" && e.length <= sn && on.test(e), pn = (e) => typeof e == "string" && e.length <= ln && rn.test(e), fn = (e) => typeof e == "string" && e.length <= an && cn.test(e), yn = (e) => Object.entries(e).map(([t, n]) => `${t}_${n}`).join(","), mn = (e) => {
312
+ }, kn = /^[A-Za-z0-9][A-Za-z0-9._\-/]*$/, In = 300, Pn = /^[A-Za-z0-9][A-Za-z0-9_-]*$/, Dn = 100, xn = /^https:\/\/[^\s"'()\\<>]+$/, Ln = 2e3, $n = /^[A-Za-z0-9_,.:\-/]*$/, Rn = 300, Mn = (e) => typeof e == "string" && e.length <= In && kn.test(e), On = (e) => typeof e == "string" && e.length <= Dn && Pn.test(e), _n = (e) => typeof e == "string" && e.length <= Ln && xn.test(e), jn = (e) => typeof e == "string" && e.length <= Rn && $n.test(e), Nn = (e) => Object.entries(e).map(([t, n]) => `${t}_${n}`).join(","), Wn = (e) => {
306
313
  const t = {};
307
314
  for (const n of e.split(",")) {
308
315
  const o = n.trim(), s = o.indexOf("_");
309
316
  s <= 0 || (t[o.slice(0, s)] = o.slice(s + 1));
310
317
  }
311
318
  return t;
312
- }, hn = ({
319
+ }, Vn = ({
313
320
  publicId: e,
314
- cloudName: t = qt,
321
+ cloudName: t = Tn,
315
322
  transformations: n,
316
- width: o = Qt
323
+ width: o = En
317
324
  }) => {
318
- const s = typeof n == "string" ? mn(n) : n, i = {
319
- ...en,
325
+ const s = typeof n == "string" ? Wn(n) : n, i = {
326
+ ...Sn,
320
327
  ...s,
321
328
  w: o
322
329
  };
323
330
  return encodeURI(
324
- `https://res.cloudinary.com/${t}/image/upload/${yn(i)}/${e}`
331
+ `https://res.cloudinary.com/${t}/image/upload/${Nn(i)}/${e}`
325
332
  );
326
- }, gn = /^--[A-Za-z0-9_-]+$/, bn = 200, U = (e) => {
333
+ }, Fn = /^--[A-Za-z0-9_-]+$/, Bn = 200, q = (e) => {
327
334
  if (typeof e != "string")
328
335
  return !1;
329
336
  const t = e.trim();
330
- return t.length <= bn && gn.test(t);
331
- }, _ = (e) => `var(${e.trim()})`, v = (e) => {
337
+ return t.length <= Bn && Fn.test(t);
338
+ }, N = (e) => `var(${e.trim()})`, E = (e) => {
332
339
  if (typeof e != "object" || e === null || Array.isArray(e))
333
340
  return;
334
341
  const t = e.cssVariable;
335
342
  if (t != null)
336
- return U(t) ? t.trim() : void 0;
337
- }, M = (e) => {
343
+ return q(t) ? t.trim() : void 0;
344
+ }, V = (e) => {
338
345
  if (typeof e != "object" || e === null || Array.isArray(e))
339
346
  return !1;
340
347
  const t = e.cssVariable;
341
- return t == null ? !1 : !U(t);
342
- }, yr = (e, t) => {
343
- const n = v(e);
344
- return n ? { [t]: _(n) } : void 0;
345
- }, Cn = (e) => {
346
- if (typeof e != "object" || e === null || Array.isArray(e) || M(e))
348
+ return t == null ? !1 : !q(t);
349
+ }, qr = (e, t) => {
350
+ const n = E(e);
351
+ return n ? { [t]: N(n) } : void 0;
352
+ }, Kn = (e) => {
353
+ if (typeof e != "object" || e === null || Array.isArray(e) || V(e))
347
354
  return !1;
348
- if (v(e))
355
+ if (E(e))
349
356
  return !0;
350
357
  const t = e;
351
- return t.source === "none" ? !0 : t.source === "url" ? pn(t.url) : t.source === "cloudinary" ? !un(t.publicId) || t.cloudName !== void 0 && t.cloudName !== null && !dn(t.cloudName) ? !1 : t.transformations === void 0 || t.transformations === null || fn(t.transformations) : !1;
352
- }, wn = ["px", "%", "em", "rem", "vh", "vw"], me = ["inherit", "unset"], vn = ["allSides", "top", "right", "bottom", "left"], z = (e, t = {}) => {
358
+ return t.source === "none" ? !0 : t.source === "url" ? _n(t.url) : t.source === "cloudinary" ? !Mn(t.publicId) || t.cloudName !== void 0 && t.cloudName !== null && !On(t.cloudName) ? !1 : t.transformations === void 0 || t.transformations === null || jn(t.transformations) : !1;
359
+ }, Hn = ["px", "%", "em", "rem", "vh", "vw"], De = ["inherit", "unset"], Un = ["allSides", "top", "right", "bottom", "left"], X = (e, t = {}) => {
353
360
  if (typeof e != "object" || e === null || Array.isArray(e))
354
361
  return !1;
355
362
  const n = e;
356
- return M(e) ? !1 : v(e) ? !0 : n.unit === "auto" ? t.allowAuto !== !1 : n.unit === "keyword" ? t.allowKeywords !== !1 && me.includes(n.keyword) : wn.includes(n.unit) ? typeof n.value != "number" || !Number.isFinite(n.value) ? !1 : t.allowNegative !== !1 || n.value >= 0 : !1;
357
- }, An = (e, t = {}) => {
363
+ return V(e) ? !1 : E(e) ? !0 : n.unit === "auto" ? t.allowAuto !== !1 : n.unit === "keyword" ? t.allowKeywords !== !1 && De.includes(n.keyword) : Hn.includes(n.unit) ? typeof n.value != "number" || !Number.isFinite(n.value) ? !1 : t.allowNegative !== !1 || n.value >= 0 : !1;
364
+ }, zn = (e, t = {}) => {
358
365
  if (typeof e != "object" || e === null || Array.isArray(e))
359
366
  return !1;
360
367
  const n = e;
361
- for (const o of vn) {
368
+ for (const o of Un) {
362
369
  const s = n[o];
363
- if (s != null && !z(s, t))
370
+ if (s != null && !X(s, t))
364
371
  return !1;
365
372
  }
366
373
  return !0;
367
- }, Sn = [...me, "transparent", "currentColor"], En = /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/, he = (e) => {
374
+ }, Gn = [...De, "transparent", "currentColor"], Yn = /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/, xe = (e) => {
368
375
  if (typeof e != "object" || e === null || Array.isArray(e))
369
376
  return !1;
370
377
  const t = e;
371
- return M(e) ? !1 : v(e) ? !0 : t.unit === "keyword" ? Sn.includes(t.keyword) : t.unit === "color" ? typeof t.value == "string" && En.test(t.value.trim()) : !1;
372
- }, ge = (e) => {
373
- const t = v(e);
374
- return t ? _(t) : "unit" in e ? e.unit === "keyword" ? e.keyword : e.value.trim() : "";
375
- }, kn = (e, t) => typeof e == "object" && e !== null && !Array.isArray(e) ? !M(e) && !!v(e) : typeof e != "string" || !e.length ? !1 : t.includes(e) ? !0 : me.includes(e), Tn = [
378
+ return V(e) ? !1 : E(e) ? !0 : t.unit === "keyword" ? Gn.includes(t.keyword) : t.unit === "color" ? typeof t.value == "string" && Yn.test(t.value.trim()) : !1;
379
+ }, Le = (e) => {
380
+ const t = E(e);
381
+ return t ? N(t) : "unit" in e ? e.unit === "keyword" ? e.keyword : e.value.trim() : "";
382
+ }, Xn = (e, t) => typeof e == "object" && e !== null && !Array.isArray(e) ? !V(e) && !!E(e) : typeof e != "string" || !e.length ? !1 : t.includes(e) ? !0 : De.includes(e), Jn = [
376
383
  'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
377
384
  'Georgia, "Times New Roman", Times, serif',
378
385
  "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
379
386
  "Arial, Helvetica, sans-serif",
380
387
  '"Helvetica Neue", Helvetica, Arial, sans-serif',
381
388
  "Verdana, Geneva, sans-serif"
382
- ], In = [
389
+ ], qn = [
383
390
  "normal",
384
391
  "bold",
385
392
  "100",
@@ -391,43 +398,43 @@ const pr = /* @__PURE__ */ A({
391
398
  "700",
392
399
  "800",
393
400
  "900"
394
- ], Pn = ["normal", "italic", "oblique"], Dn = [
401
+ ], Zn = ["normal", "italic", "oblique"], Qn = [
395
402
  "left",
396
403
  "center",
397
404
  "right",
398
405
  "justify",
399
406
  "start",
400
407
  "end"
401
- ], $n = [
408
+ ], eo = [
402
409
  "none",
403
410
  "underline",
404
411
  "line-through",
405
412
  "overline"
406
- ], Ln = [
413
+ ], to = [
407
414
  "none",
408
415
  "uppercase",
409
416
  "lowercase",
410
417
  "capitalize"
411
- ], ie = [
418
+ ], be = [
412
419
  "visible",
413
420
  "hidden",
414
421
  "scroll",
415
422
  "auto",
416
423
  "clip"
417
- ], xn = ["auto", "none"], Rn = [
424
+ ], no = ["auto", "none"], oo = [
418
425
  "flex-start",
419
426
  "flex-end",
420
427
  "center",
421
428
  "space-between",
422
429
  "space-around",
423
430
  "space-evenly"
424
- ], On = [
431
+ ], so = [
425
432
  "flex-start",
426
433
  "flex-end",
427
434
  "center",
428
435
  "baseline",
429
436
  "stretch"
430
- ], _n = ["wrap", "nowrap"], jn = [
437
+ ], io = ["wrap", "nowrap"], ro = [
431
438
  "flex-start",
432
439
  "flex-end",
433
440
  "center",
@@ -435,12 +442,12 @@ const pr = /* @__PURE__ */ A({
435
442
  "space-around",
436
443
  "space-evenly",
437
444
  "stretch"
438
- ], Mn = [
445
+ ], lo = [
439
446
  "row",
440
447
  "row-reverse",
441
448
  "column",
442
449
  "column-reverse"
443
- ], Nn = ["cover", "contain", "auto"], Wn = [
450
+ ], co = ["cover", "contain", "auto"], ao = [
444
451
  "center center",
445
452
  "center top",
446
453
  "center bottom",
@@ -450,20 +457,20 @@ const pr = /* @__PURE__ */ A({
450
457
  "right center",
451
458
  "right top",
452
459
  "right bottom"
453
- ], Vn = [
460
+ ], uo = [
454
461
  "no-repeat",
455
462
  "repeat",
456
463
  "repeat-x",
457
464
  "repeat-y",
458
465
  "space",
459
466
  "round"
460
- ], Fn = [
467
+ ], po = [
461
468
  "justifyContent",
462
469
  "alignItems",
463
470
  "flexWrap",
464
471
  "alignContent",
465
472
  "flexDirection"
466
- ], Bn = [
473
+ ], fo = [
467
474
  "none",
468
475
  "solid",
469
476
  "dashed",
@@ -473,107 +480,107 @@ const pr = /* @__PURE__ */ A({
473
480
  "ridge",
474
481
  "inset",
475
482
  "outset"
476
- ], Kn = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !M(e) && !!v(e) : Bn.includes(e), zn = (e) => {
483
+ ], yo = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !V(e) && !!E(e) : fo.includes(e), mo = (e) => {
477
484
  if (typeof e != "object" || e === null || Array.isArray(e))
478
485
  return !1;
479
486
  const t = e;
480
- return M(e) ? !1 : v(e) ? !0 : !(t.width !== void 0 && t.width !== null && !z(t.width, { allowAuto: !1, allowNegative: !1 }) || t.style !== void 0 && t.style !== null && !Kn(t.style) || t.color !== void 0 && t.color !== null && !he(t.color));
481
- }, Hn = {
487
+ return V(e) ? !1 : E(e) ? !0 : !(t.width !== void 0 && t.width !== null && !X(t.width, { allowAuto: !1, allowNegative: !1 }) || t.style !== void 0 && t.style !== null && !yo(t.style) || t.color !== void 0 && t.color !== null && !xe(t.color));
488
+ }, ho = {
482
489
  allowAuto: !1,
483
490
  allowKeywords: !1,
484
491
  allowNegative: !0
485
- }, Un = {
492
+ }, go = {
486
493
  allowAuto: !1,
487
494
  allowKeywords: !1,
488
495
  allowNegative: !1
489
- }, Yn = (e) => {
496
+ }, bo = (e) => {
490
497
  if (typeof e != "object" || e === null || Array.isArray(e))
491
498
  return !1;
492
499
  const t = e;
493
- if (M(e))
500
+ if (V(e))
494
501
  return !1;
495
- if (v(e))
502
+ if (E(e))
496
503
  return !0;
497
504
  for (const n of ["offsetX", "offsetY", "spread"]) {
498
505
  const o = t[n];
499
- if (o != null && !z(o, Hn))
506
+ if (o != null && !X(o, ho))
500
507
  return !1;
501
508
  }
502
- return !(t.blur !== void 0 && t.blur !== null && !z(t.blur, Un) || t.color !== void 0 && t.color !== null && !he(t.color) || t.inset !== void 0 && t.inset !== null && typeof t.inset != "boolean");
503
- }, Gn = (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, Xn = (e) => {
509
+ return !(t.blur !== void 0 && t.blur !== null && !X(t.blur, go) || t.color !== void 0 && t.color !== null && !xe(t.color) || t.inset !== void 0 && t.inset !== null && typeof t.inset != "boolean");
510
+ }, Co = (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, wo = (e) => {
504
511
  if (typeof e != "object" || e === null || Array.isArray(e))
505
512
  return !1;
506
513
  const t = e;
507
- return M(e) ? !1 : v(e) ? !0 : t.unit === "number" ? typeof t.value == "number" && Number.isFinite(t.value) && t.value > 0 : z(e, { allowAuto: !1, allowNegative: !1 });
508
- }, Jn = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !M(e) && !!v(e) : typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 1, Zn = (e) => {
509
- if (!Cn(e))
514
+ return V(e) ? !1 : E(e) ? !0 : t.unit === "number" ? typeof t.value == "number" && Number.isFinite(t.value) && t.value > 0 : X(e, { allowAuto: !1, allowNegative: !1 });
515
+ }, vo = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !V(e) && !!E(e) : typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 1, Ao = (e) => {
516
+ if (!Kn(e))
510
517
  return {};
511
- const t = v(e);
518
+ const t = E(e);
512
519
  if (t)
513
- return { backgroundImage: _(t) };
520
+ return { backgroundImage: N(t) };
514
521
  const n = e;
515
522
  return n.source === "none" ? { backgroundImage: "none" } : n.source === "url" ? { backgroundImage: `url("${n.url}")` } : {
516
- backgroundImage: `url("${hn({
523
+ backgroundImage: `url("${Vn({
517
524
  publicId: n.publicId,
518
525
  cloudName: n.cloudName,
519
526
  transformations: n.transformations
520
527
  })}")`
521
528
  };
522
- }, H = (e) => {
523
- const t = v(e);
524
- return t ? _(t) : "unit" in e ? e.unit === "auto" ? "auto" : e.unit === "keyword" ? e.keyword : `${e.value}${e.unit}` : "";
525
- }, qn = (e) => {
526
- if (!zn(e))
529
+ }, J = (e) => {
530
+ const t = E(e);
531
+ return t ? N(t) : "unit" in e ? e.unit === "auto" ? "auto" : e.unit === "keyword" ? e.keyword : `${e.value}${e.unit}` : "";
532
+ }, To = (e) => {
533
+ if (!mo(e))
527
534
  return {};
528
- const t = v(e);
535
+ const t = E(e);
529
536
  if (t)
530
- return { border: _(t) };
537
+ return { border: N(t) };
531
538
  const n = {};
532
- if (e.width && (n.borderWidth = H(e.width)), e.style) {
533
- const o = v(e.style);
534
- n.borderStyle = o ? _(o) : e.style;
539
+ if (e.width && (n.borderWidth = J(e.width)), e.style) {
540
+ const o = E(e.style);
541
+ n.borderStyle = o ? N(o) : e.style;
535
542
  }
536
- return e.color && (n.borderColor = ge(e.color)), n;
537
- }, Z = (e) => e ? H(e) : "0px", Qn = (e) => {
538
- if (!Yn(e) || !Gn(e))
543
+ return e.color && (n.borderColor = Le(e.color)), n;
544
+ }, le = (e) => e ? J(e) : "0px", Eo = (e) => {
545
+ if (!bo(e) || !Co(e))
539
546
  return {};
540
- const t = v(e);
547
+ const t = E(e);
541
548
  if (t)
542
- return { boxShadow: _(t) };
549
+ return { boxShadow: N(t) };
543
550
  const n = [
544
- Z(e.offsetX),
545
- Z(e.offsetY),
546
- Z(e.blur),
547
- Z(e.spread)
551
+ le(e.offsetX),
552
+ le(e.offsetY),
553
+ le(e.blur),
554
+ le(e.spread)
548
555
  ];
549
- return e.color && n.push(ge(e.color)), e.inset && n.unshift("inset"), { boxShadow: n.join(" ") };
550
- }, eo = (e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`, to = (e, t) => {
551
- if (!An(e))
556
+ return e.color && n.push(Le(e.color)), e.inset && n.unshift("inset"), { boxShadow: n.join(" ") };
557
+ }, So = (e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`, ko = (e, t) => {
558
+ if (!zn(e))
552
559
  return {};
553
560
  if (e.allSides)
554
- return { [t]: H(e.allSides) };
561
+ return { [t]: J(e.allSides) };
555
562
  const n = {};
556
563
  for (const o of ["top", "right", "bottom", "left"]) {
557
564
  const s = e[o];
558
- s && (n[`${t}${eo(o)}`] = H(s));
565
+ s && (n[`${t}${So(o)}`] = J(s));
559
566
  }
560
567
  return n;
561
- }, no = (e, t) => he(e) ? { [t]: ge(e) } : {}, oo = (e, t, n) => {
562
- if (!kn(e, n))
568
+ }, Io = (e, t) => xe(e) ? { [t]: Le(e) } : {}, Po = (e, t, n) => {
569
+ if (!Xn(e, n))
563
570
  return {};
564
- const o = v(e);
565
- return o ? { [t]: _(o) } : { [t]: e };
566
- }, so = (e, t, n = {}) => z(e, n) ? { [t]: H(e) } : {}, io = (e) => {
567
- if (!Xn(e))
571
+ const o = E(e);
572
+ return o ? { [t]: N(o) } : { [t]: e };
573
+ }, Do = (e, t, n = {}) => X(e, n) ? { [t]: J(e) } : {}, xo = (e) => {
574
+ if (!wo(e))
568
575
  return {};
569
- const t = v(e);
570
- return t ? { lineHeight: _(t) } : "unit" in e && e.unit === "number" ? { lineHeight: e.value } : { lineHeight: H(e) };
571
- }, ro = (e) => {
572
- if (!Jn(e))
576
+ const t = E(e);
577
+ return t ? { lineHeight: N(t) } : "unit" in e && e.unit === "number" ? { lineHeight: e.value } : { lineHeight: J(e) };
578
+ }, Lo = (e) => {
579
+ if (!vo(e))
573
580
  return {};
574
- const t = v(e);
575
- return t ? { opacity: _(t) } : { opacity: e };
576
- }, be = {
581
+ const t = E(e);
582
+ return t ? { opacity: N(t) } : { opacity: e };
583
+ }, $e = {
577
584
  // Box spacing (4-sided)
578
585
  "margin-3-resolutions": { kind: "boxSpacing", cssProperty: "margin" },
579
586
  "padding-3-resolutions": { kind: "boxSpacing", cssProperty: "padding" },
@@ -627,44 +634,44 @@ const pr = /* @__PURE__ */ A({
627
634
  "justify-content-3-resolutions": {
628
635
  kind: "enum",
629
636
  cssProperty: "justifyContent",
630
- allowedValues: Rn
637
+ allowedValues: oo
631
638
  },
632
639
  "align-items-3-resolutions": {
633
640
  kind: "enum",
634
641
  cssProperty: "alignItems",
635
- allowedValues: On
642
+ allowedValues: so
636
643
  },
637
644
  "flex-wrap-3-resolutions": {
638
645
  kind: "enum",
639
646
  cssProperty: "flexWrap",
640
- allowedValues: _n
647
+ allowedValues: io
641
648
  },
642
649
  "align-content-3-resolutions": {
643
650
  kind: "enum",
644
651
  cssProperty: "alignContent",
645
- allowedValues: jn
652
+ allowedValues: ro
646
653
  },
647
654
  "flex-direction-3-resolutions": {
648
655
  kind: "enum",
649
656
  cssProperty: "flexDirection",
650
- allowedValues: Mn
657
+ allowedValues: lo
651
658
  },
652
659
  // Overflow — shorthand and longhands are independent attributes; when
653
660
  // both are set, the browser's cascade decides the effective overflow.
654
661
  "overflow-3-resolutions": {
655
662
  kind: "enum",
656
663
  cssProperty: "overflow",
657
- allowedValues: ie
664
+ allowedValues: be
658
665
  },
659
666
  "overflow-x-3-resolutions": {
660
667
  kind: "enum",
661
668
  cssProperty: "overflowX",
662
- allowedValues: ie
669
+ allowedValues: be
663
670
  },
664
671
  "overflow-y-3-resolutions": {
665
672
  kind: "enum",
666
673
  cssProperty: "overflowY",
667
- allowedValues: ie
674
+ allowedValues: be
668
675
  },
669
676
  // Color
670
677
  // Pointer input. On an overlay layer this is lifted onto the absolutely
@@ -672,7 +679,7 @@ const pr = /* @__PURE__ */ A({
672
679
  "pointer-events-3-resolutions": {
673
680
  kind: "enum",
674
681
  cssProperty: "pointerEvents",
675
- allowedValues: xn
682
+ allowedValues: no
676
683
  },
677
684
  "background-color-3-resolutions": { kind: "color", cssProperty: "backgroundColor" },
678
685
  "color-3-resolutions": { kind: "color", cssProperty: "color" },
@@ -683,17 +690,17 @@ const pr = /* @__PURE__ */ A({
683
690
  "background-size-3-resolutions": {
684
691
  kind: "enum",
685
692
  cssProperty: "backgroundSize",
686
- allowedValues: Nn
693
+ allowedValues: co
687
694
  },
688
695
  "background-position-3-resolutions": {
689
696
  kind: "enum",
690
697
  cssProperty: "backgroundPosition",
691
- allowedValues: Wn
698
+ allowedValues: ao
692
699
  },
693
700
  "background-repeat-3-resolutions": {
694
701
  kind: "enum",
695
702
  cssProperty: "backgroundRepeat",
696
- allowedValues: Vn
703
+ allowedValues: uo
697
704
  },
698
705
  // Opacity (0–1 number)
699
706
  "opacity-3-resolutions": { kind: "opacity" },
@@ -701,7 +708,7 @@ const pr = /* @__PURE__ */ A({
701
708
  "font-family-3-resolutions": {
702
709
  kind: "enum",
703
710
  cssProperty: "fontFamily",
704
- allowedValues: Tn
711
+ allowedValues: Jn
705
712
  },
706
713
  "font-size-3-resolutions": {
707
714
  kind: "length",
@@ -711,12 +718,12 @@ const pr = /* @__PURE__ */ A({
711
718
  "font-weight-3-resolutions": {
712
719
  kind: "enum",
713
720
  cssProperty: "fontWeight",
714
- allowedValues: In
721
+ allowedValues: qn
715
722
  },
716
723
  "font-style-3-resolutions": {
717
724
  kind: "enum",
718
725
  cssProperty: "fontStyle",
719
- allowedValues: Pn
726
+ allowedValues: Zn
720
727
  },
721
728
  "line-height-3-resolutions": { kind: "lineHeight" },
722
729
  "letter-spacing-3-resolutions": {
@@ -727,68 +734,68 @@ const pr = /* @__PURE__ */ A({
727
734
  "text-align-3-resolutions": {
728
735
  kind: "enum",
729
736
  cssProperty: "textAlign",
730
- allowedValues: Dn
737
+ allowedValues: Qn
731
738
  },
732
739
  "text-decoration-3-resolutions": {
733
740
  kind: "enum",
734
741
  cssProperty: "textDecoration",
735
- allowedValues: $n
742
+ allowedValues: eo
736
743
  },
737
744
  "text-transform-3-resolutions": {
738
745
  kind: "enum",
739
746
  cssProperty: "textTransform",
740
- allowedValues: Ln
747
+ allowedValues: to
741
748
  }
742
- }, lo = (e, t) => {
743
- const n = be[e];
749
+ }, $o = (e, t) => {
750
+ const n = $e[e];
744
751
  if (!n)
745
752
  return {};
746
753
  switch (n.kind) {
747
754
  case "boxSpacing":
748
- return to(t, n.cssProperty);
755
+ return ko(t, n.cssProperty);
749
756
  case "length":
750
- return so(t, n.cssProperty, n.capabilities);
757
+ return Do(t, n.cssProperty, n.capabilities);
751
758
  case "border":
752
- return qn(t);
759
+ return To(t);
753
760
  case "boxShadow":
754
- return Qn(t);
761
+ return Eo(t);
755
762
  case "color":
756
- return no(t, n.cssProperty);
763
+ return Io(t, n.cssProperty);
757
764
  case "opacity":
758
- return ro(t);
765
+ return Lo(t);
759
766
  case "enum":
760
- return oo(t, n.cssProperty, n.allowedValues);
767
+ return Po(t, n.cssProperty, n.allowedValues);
761
768
  case "lineHeight":
762
- return io(t);
769
+ return xo(t);
763
770
  case "backgroundImage":
764
- return Zn(t);
771
+ return Ao(t);
765
772
  default:
766
773
  return {};
767
774
  }
768
- }, mr = Object.fromEntries(
769
- Object.entries(be).filter(([, e]) => e.kind === "boxSpacing").map(([e, t]) => [
775
+ }, Zr = Object.fromEntries(
776
+ Object.entries($e).filter(([, e]) => e.kind === "boxSpacing").map(([e, t]) => [
770
777
  e,
771
778
  t.cssProperty
772
779
  ])
773
- ), co = (e) => e != null && e !== "", ao = (e) => e ? !Fn.some(
774
- (n) => co(e[n])
775
- ) || e.display === "flex" ? e : { ...e, display: "flex" } : {}, uo = ({
780
+ ), Ro = (e) => e != null && e !== "", Mo = (e) => e ? !po.some(
781
+ (n) => Ro(e[n])
782
+ ) || e.display === "flex" ? e : { ...e, display: "flex" } : {}, Oo = ({
776
783
  dbEntryType: e,
777
784
  libraryId: t,
778
785
  sourceComponentsPlugin: n
779
786
  }) => {
780
787
  if (!(e != null && e.length))
781
788
  return;
782
- const o = n.components[ze(t, e)];
789
+ const o = n.components[it(t, e)];
783
790
  if (!o || !("defaultAttributeValues" in o))
784
791
  return;
785
792
  const i = o.defaultAttributeValues;
786
793
  if (i != null && i.length)
787
- return i.reduce((r, l) => ({
788
- ...r,
789
- [l.name]: l.defaultValues
794
+ return i.reduce((l, r) => ({
795
+ ...l,
796
+ [r.name]: r.defaultValues
790
797
  }), {});
791
- }, N = ({
798
+ }, B = ({
792
799
  deviceDisplayType: e,
793
800
  componentAttributes: t
794
801
  }) => {
@@ -800,8 +807,8 @@ const pr = /* @__PURE__ */ A({
800
807
  )) {
801
808
  if (!s.includes("3-resolutions") || !i)
802
809
  continue;
803
- const r = i.all, l = r ?? i[e.toLowerCase()];
804
- o[s] = l, be[s] && Object.assign(n, lo(s, l));
810
+ const l = i.all, r = l ?? i[e.toLowerCase()];
811
+ o[s] = r, $e[s] && Object.assign(n, $o(s, r));
805
812
  }
806
813
  return Object.keys(n).length || Object.keys(o).length ? {
807
814
  styles: Object.keys(n).length ? n : void 0,
@@ -809,94 +816,94 @@ const pr = /* @__PURE__ */ A({
809
816
  o
810
817
  ).length ? o : void 0
811
818
  } : void 0;
812
- }, po = ({
819
+ }, _o = ({
813
820
  defaultAttributes: e,
814
821
  userModifiedAttributes: t
815
822
  }) => e ? t ? { ...e, ...t } : e : t;
816
- function ee(e) {
823
+ function ae(e) {
817
824
  return e.componentAttributes ?? e.widgetAttributes;
818
825
  }
819
- function Re({
826
+ function He({
820
827
  col: e,
821
828
  deviceDisplayType: t,
822
829
  isComposeMode: n,
823
830
  sourceComponentsPlugin: o
824
831
  }) {
825
- const s = ee(e), i = uo({
832
+ const s = ae(e), i = Oo({
826
833
  dbEntryType: e.type,
827
834
  libraryId: e.libraryId,
828
835
  sourceComponentsPlugin: o
829
- }) || [], r = po({
836
+ }) || [], l = _o({
830
837
  defaultAttributes: i,
831
838
  userModifiedAttributes: s
832
- }), { styles: l, componentAttributesSpecificToDeviceType: u } = N({
839
+ }), { styles: r, componentAttributesSpecificToDeviceType: d } = B({
833
840
  deviceDisplayType: t,
834
- componentAttributes: r
841
+ componentAttributes: l
835
842
  }) || {
836
843
  styles: void 0,
837
844
  componentAttributesSpecificToDeviceType: void 0
838
845
  };
839
- let c = {};
840
- const a = {};
841
- if (l)
842
- for (const [d, h] of Object.entries(l))
843
- n && a[d] || (c = {
844
- ...c,
845
- [d]: h
846
+ let a = {};
847
+ const c = {};
848
+ if (r)
849
+ for (const [u, y] of Object.entries(r))
850
+ n && c[u] || (a = {
851
+ ...a,
852
+ [u]: y
846
853
  });
847
- let p = ee(e);
848
- for (const d in u)
849
- if (d.includes("3-resolutions")) {
850
- p = {
851
- ...ee(e) || {},
852
- ...u || {}
854
+ let f = ae(e);
855
+ for (const u in d)
856
+ if (u.includes("3-resolutions")) {
857
+ f = {
858
+ ...ae(e) || {},
859
+ ...d || {}
853
860
  };
854
861
  break;
855
862
  }
856
- const y = ao(c);
857
- if (n && y.pointerEvents !== void 0) {
858
- const d = { ...y };
859
- return delete d.pointerEvents, {
860
- componentAttributesBasedOnDevice: p,
861
- componentStyles: d
863
+ const h = Mo(a);
864
+ if (n && h.pointerEvents !== void 0) {
865
+ const u = { ...h };
866
+ return delete u.pointerEvents, {
867
+ componentAttributesBasedOnDevice: f,
868
+ componentStyles: u
862
869
  };
863
870
  }
864
871
  return {
865
- componentAttributesBasedOnDevice: p,
866
- componentStyles: y
872
+ componentAttributesBasedOnDevice: f,
873
+ componentStyles: h
867
874
  };
868
875
  }
869
- const fo = (e) => {
876
+ const jo = (e) => {
870
877
  const t = (e == null ? void 0 : e.rows) || [];
871
878
  for (const n of t)
872
879
  if (((n == null ? void 0 : n.columns) || []).length > 0)
873
880
  return !0;
874
881
  return (e == null ? void 0 : e.containerAttributes) && Object.keys(e.containerAttributes).length > 0;
875
- }, yo = "var(--sl-spacing-x-small)";
876
- function mo(e) {
882
+ }, No = "var(--sl-spacing-x-small)";
883
+ function Wo(e) {
877
884
  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);
878
885
  }
879
- function ho({
886
+ function Vo({
880
887
  row: e,
881
888
  deviceDisplayType: t
882
889
  }) {
883
890
  var o;
884
- const n = N({
891
+ const n = B({
885
892
  deviceDisplayType: t,
886
893
  componentAttributes: e.rowAttributes
887
894
  });
888
895
  return ((o = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : o["hide-component-3-resolutions"]) === "true";
889
896
  }
890
- function go({
897
+ function Fo({
891
898
  row: e,
892
899
  deviceDisplayType: t,
893
900
  isComposeMode: n
894
901
  }) {
895
- var d;
896
- const o = ((d = N({
902
+ var u;
903
+ const o = ((u = B({
897
904
  deviceDisplayType: t,
898
905
  componentAttributes: e.rowAttributes
899
- })) == null ? void 0 : d.styles) || {}, s = o.justifyContent ?? e.horizontalAlignment ?? xe.Center, i = o.alignItems ?? e.verticalAlignment ?? xe.Center, r = o.flexDirection ?? "row", l = o.gap ?? e.gap ?? yo, u = n ? "nowrap" : o.flexWrap ?? e.flexWrap ?? "nowrap", c = o.alignContent ?? e.alignContent ?? void 0, a = /* @__PURE__ */ new Set([
906
+ })) == null ? void 0 : u.styles) || {}, s = o.justifyContent ?? e.horizontalAlignment ?? Ke.Center, i = o.alignItems ?? e.verticalAlignment ?? Ke.Center, l = o.flexDirection ?? "row", r = o.gap ?? e.gap ?? No, d = n ? "nowrap" : o.flexWrap ?? e.flexWrap ?? "nowrap", a = o.alignContent ?? e.alignContent ?? void 0, c = /* @__PURE__ */ new Set([
900
907
  "justifyContent",
901
908
  "alignItems",
902
909
  "flexDirection",
@@ -904,26 +911,26 @@ function go({
904
911
  "flexWrap",
905
912
  "alignContent",
906
913
  "display"
907
- ]), p = {};
908
- for (const [h, m] of Object.entries(o))
909
- a.has(h) || (p[h] = m);
910
- const y = {
914
+ ]), f = {};
915
+ for (const [y, b] of Object.entries(o))
916
+ c.has(y) || (f[y] = b);
917
+ const h = {
911
918
  display: "flex",
912
- flexDirection: r,
913
- gap: l,
914
- flexWrap: u,
919
+ flexDirection: l,
920
+ gap: r,
921
+ flexWrap: d,
915
922
  justifyContent: s,
916
923
  alignItems: i,
917
- ...p
924
+ ...f
918
925
  };
919
- return c !== void 0 && (y.alignContent = c), y;
926
+ return a !== void 0 && (h.alignContent = a), h;
920
927
  }
921
- const Ce = "css-classes-3-resolutions", bo = 500, Co = /[\x00-\x1f\x7f]/g, we = (e) => {
928
+ const Re = "css-classes-3-resolutions", Bo = 500, Ko = /[\x00-\x1f\x7f]/g, Me = (e) => {
922
929
  if (typeof e != "string")
923
930
  return;
924
931
  const t = /* @__PURE__ */ new Set(), n = [];
925
932
  for (const s of e.split(/\s+/)) {
926
- const i = s.replace(Co, "");
933
+ const i = s.replace(Ko, "");
927
934
  i && (t.has(i) || (t.add(i), n.push(i)));
928
935
  }
929
936
  if (!n.length)
@@ -931,12 +938,12 @@ const Ce = "css-classes-3-resolutions", bo = 500, Co = /[\x00-\x1f\x7f]/g, we =
931
938
  let o = "";
932
939
  for (const s of n) {
933
940
  const i = o ? `${o} ${s}` : s;
934
- if (i.length > bo)
941
+ if (i.length > Bo)
935
942
  break;
936
943
  o = i;
937
944
  }
938
945
  return o.length ? o : void 0;
939
- }, Qe = "hide-component-3-resolutions", wo = "pointer-events-3-resolutions", vo = [
946
+ }, ht = "hide-component-3-resolutions", Ho = "pointer-events-3-resolutions", Uo = [
940
947
  "width-3-resolutions",
941
948
  "min-width-3-resolutions",
942
949
  "max-width-3-resolutions",
@@ -951,23 +958,23 @@ const Ce = "css-classes-3-resolutions", bo = 500, Co = /[\x00-\x1f\x7f]/g, we =
951
958
  "overflow-3-resolutions",
952
959
  "overflow-x-3-resolutions",
953
960
  "overflow-y-3-resolutions",
954
- Qe,
955
- wo
956
- ], Ao = new Set(
957
- vo
961
+ ht,
962
+ Ho
963
+ ], zo = new Set(
964
+ Uo
958
965
  );
959
- function ve({
966
+ function Oe({
960
967
  containerAttributes: e,
961
968
  deviceDisplayType: t
962
969
  }) {
963
970
  var o;
964
- const n = N({
971
+ const n = B({
965
972
  deviceDisplayType: t,
966
973
  componentAttributes: e
967
974
  });
968
- return ((o = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : o[Qe]) === "true";
975
+ return ((o = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : o[ht]) === "true";
969
976
  }
970
- function et({
977
+ function gt({
971
978
  containerAttributes: e,
972
979
  deviceDisplayType: t,
973
980
  isComposeMode: n
@@ -977,44 +984,44 @@ function et({
977
984
  return { styles: {} };
978
985
  const o = n ? Object.fromEntries(
979
986
  Object.entries(e).filter(
980
- ([r]) => !Ao.has(r)
987
+ ([l]) => !zo.has(l)
981
988
  )
982
- ) : e, s = N({
989
+ ) : e, s = B({
983
990
  deviceDisplayType: t,
984
991
  componentAttributes: o
985
992
  });
986
993
  return {
987
994
  styles: (s == null ? void 0 : s.styles) ?? {},
988
- cssClasses: we(
989
- (i = s == null ? void 0 : s.componentAttributesSpecificToDeviceType) == null ? void 0 : i[Ce]
995
+ cssClasses: Me(
996
+ (i = s == null ? void 0 : s.componentAttributesSpecificToDeviceType) == null ? void 0 : i[Re]
990
997
  )
991
998
  };
992
999
  }
993
- function So(e) {
1000
+ function Go(e) {
994
1001
  return Object.keys(e.styles).length > 0 || !!e.cssClasses;
995
1002
  }
996
- function tt({
1003
+ function bt({
997
1004
  containerAttributes: e,
998
1005
  widgetContainerStyles: t
999
1006
  }) {
1000
- return ((e == null ? void 0 : e[ce]) || []).some(
1007
+ return ((e == null ? void 0 : e[ve]) || []).some(
1001
1008
  (o) => o.toLowerCase().startsWith("height:")
1002
1009
  ) || t.styles.height !== void 0;
1003
1010
  }
1004
- const Eo = "z-index-3-resolutions", nt = 0;
1005
- function ko(e) {
1011
+ const Yo = "z-index-3-resolutions", Ct = 0;
1012
+ function Xo(e) {
1006
1013
  var t, n;
1007
1014
  return !!((n = (t = e == null ? void 0 : e.overlayLayers) == null ? void 0 : t.layers) != null && n.length);
1008
1015
  }
1009
- function Oe({
1016
+ function Ue({
1010
1017
  containerAttributes: e,
1011
1018
  deviceDisplayType: t
1012
1019
  }) {
1013
1020
  var s;
1014
- const n = N({
1021
+ const n = B({
1015
1022
  deviceDisplayType: t,
1016
1023
  componentAttributes: e
1017
- }), o = (s = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : s[Eo];
1024
+ }), o = (s = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : s[Yo];
1018
1025
  if (typeof o == "number" && Number.isFinite(o))
1019
1026
  return o;
1020
1027
  if (typeof o == "string" && o.trim().length) {
@@ -1022,33 +1029,33 @@ function Oe({
1022
1029
  if (Number.isFinite(i))
1023
1030
  return i;
1024
1031
  }
1025
- return nt;
1032
+ return Ct;
1026
1033
  }
1027
- function To(e, t) {
1034
+ function Jo(e, t) {
1028
1035
  return e + t + 1;
1029
1036
  }
1030
- function Io({
1037
+ function qo({
1031
1038
  containerAttributes: e,
1032
1039
  deviceDisplayType: t
1033
1040
  }) {
1034
1041
  var s;
1035
- const n = N({
1042
+ const n = B({
1036
1043
  deviceDisplayType: t,
1037
1044
  componentAttributes: e
1038
1045
  }), o = (s = n == null ? void 0 : n.styles) == null ? void 0 : s.pointerEvents;
1039
1046
  return typeof o == "string" ? o : void 0;
1040
1047
  }
1041
- function Po({
1048
+ function Zo({
1042
1049
  layer: e,
1043
1050
  deviceDisplayType: t
1044
1051
  }) {
1045
1052
  var n;
1046
- return (n = e == null ? void 0 : e.rows) != null && n.length ? ve({
1053
+ return (n = e == null ? void 0 : e.rows) != null && n.length ? Oe({
1047
1054
  containerAttributes: e.containerAttributes,
1048
1055
  deviceDisplayType: t
1049
1056
  }) : !0;
1050
1057
  }
1051
- function Do({
1058
+ function Qo({
1052
1059
  isWithinCollection: e,
1053
1060
  baseDeclaresOwnHeight: t,
1054
1061
  baseZIndex: n
@@ -1059,10 +1066,10 @@ function Do({
1059
1066
  display: "flex",
1060
1067
  flexDirection: "column",
1061
1068
  ...t ? {} : { height: e ? "auto" : "100%" },
1062
- ...n === nt ? {} : { zIndex: n }
1069
+ ...n === Ct ? {} : { zIndex: n }
1063
1070
  };
1064
1071
  }
1065
- function $o({
1072
+ function es({
1066
1073
  zIndex: e,
1067
1074
  pointerEvents: t
1068
1075
  }) {
@@ -1077,8 +1084,8 @@ function $o({
1077
1084
  ...t ? { pointerEvents: t } : {}
1078
1085
  };
1079
1086
  }
1080
- const Ae = "/";
1081
- function Lo({
1087
+ const pe = "/";
1088
+ function ts({
1082
1089
  componentProps: e,
1083
1090
  ancestorColumnIds: t,
1084
1091
  columnId: n
@@ -1087,40 +1094,50 @@ function Lo({
1087
1094
  return;
1088
1095
  const o = [...t ?? [], n];
1089
1096
  for (let s = 0; s < o.length; s += 1) {
1090
- const i = o.slice(s).join(Ae), r = e[i];
1091
- if (r)
1092
- return r;
1097
+ const i = o.slice(s).join(pe), l = e[i];
1098
+ if (l)
1099
+ return l;
1093
1100
  }
1094
1101
  }
1095
- function xo({
1102
+ const ze = "placeholderValues";
1103
+ function ns({
1104
+ widgetInstanceProps: e,
1105
+ placeholderValues: t
1106
+ }) {
1107
+ return t === void 0 || e != null && Object.prototype.hasOwnProperty.call(e, ze) ? e : {
1108
+ ...e,
1109
+ [ze]: t
1110
+ };
1111
+ }
1112
+ function os({
1096
1113
  displayItemList: e,
1097
1114
  widgetCollections: t
1098
1115
  }) {
1099
1116
  const n = [], o = (s, i) => {
1100
- var r;
1101
- if ((r = s == null ? void 0 : s.rows) != null && r.length)
1102
- for (const l of s.rows)
1103
- for (const u of l.columns) {
1104
- if (!u.id || u.type === fe.DroppableBox)
1117
+ var l;
1118
+ if ((l = s == null ? void 0 : s.rows) != null && l.length)
1119
+ for (const r of s.rows)
1120
+ for (const d of r.columns) {
1121
+ if (!d.id || d.type === Ie.DroppableBox)
1105
1122
  continue;
1106
- const c = Xe(u.type);
1107
- if (c != null && c.length) {
1108
- const a = u.collection ?? (t == null ? void 0 : t[c]);
1109
- a && !i.includes(u.id) && o(a.collectionRows, [...i, u.id]);
1123
+ const a = pt(d.type);
1124
+ if (a != null && a.length) {
1125
+ const c = d.collection ?? (t == null ? void 0 : t[a]);
1126
+ c && !i.includes(d.id) && o(c.collectionRows, [...i, d.id]);
1110
1127
  continue;
1111
1128
  }
1112
1129
  n.push(
1113
- [...i, u.id].join(Ae)
1130
+ [...i, d.id].join(pe)
1114
1131
  );
1115
1132
  }
1116
1133
  };
1117
1134
  return o(e, []), n;
1118
1135
  }
1119
- function Ro(e, t) {
1120
- const n = `${Ae}${e}`;
1136
+ function ss(e, t) {
1137
+ const n = `${pe}${e}`;
1121
1138
  return t.some((o) => o === e || o.endsWith(n));
1122
1139
  }
1123
- function Oo({
1140
+ function is({
1124
1141
  componentProps: e,
1125
1142
  displayItemList: t,
1126
1143
  widgetCollections: n
@@ -1128,13 +1145,13 @@ function Oo({
1128
1145
  const o = e ? Object.keys(e) : [];
1129
1146
  if (!o.length)
1130
1147
  return [];
1131
- const s = xo({
1148
+ const s = os({
1132
1149
  displayItemList: t,
1133
1150
  widgetCollections: n
1134
1151
  });
1135
- return o.filter((i) => !Ro(i, s));
1152
+ return o.filter((i) => !ss(i, s));
1136
1153
  }
1137
- function _o({
1154
+ function rs({
1138
1155
  componentProps: e,
1139
1156
  displayItemList: t,
1140
1157
  widgetCollections: n,
@@ -1142,7 +1159,7 @@ function _o({
1142
1159
  }) {
1143
1160
  if (process.env.NODE_ENV === "production")
1144
1161
  return;
1145
- const s = Oo({
1162
+ const s = is({
1146
1163
  componentProps: e,
1147
1164
  displayItemList: t,
1148
1165
  widgetCollections: n
@@ -1151,68 +1168,83 @@ function _o({
1151
1168
  `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.`
1152
1169
  );
1153
1170
  }
1154
- function jo(e) {
1171
+ function ls(e) {
1155
1172
  return typeof e == "object" && e !== null && !Array.isArray(e);
1156
1173
  }
1157
- function Mo(e) {
1174
+ function cs(e) {
1158
1175
  if (e.all !== void 0 && e.all !== null)
1159
1176
  return !1;
1160
1177
  const t = e.phone, n = e.tablet, o = e.desktop;
1161
1178
  return t !== n || t !== o || n !== o;
1162
1179
  }
1163
- function ae(e) {
1180
+ function Te(e) {
1164
1181
  var t, n;
1165
1182
  if (!((t = e == null ? void 0 : e.rows) != null && t.length))
1166
1183
  return !1;
1167
- if (re(e.containerAttributes))
1184
+ if (Ce(e.containerAttributes))
1168
1185
  return !0;
1169
1186
  for (const o of e.rows) {
1170
- if (re(o.rowAttributes))
1187
+ if (Ce(o.rowAttributes))
1171
1188
  return !0;
1172
1189
  for (const s of o.columns)
1173
- if (re(ee(s)))
1190
+ if (Ce(ae(s)))
1174
1191
  return !0;
1175
1192
  }
1176
1193
  for (const o of ((n = e.overlayLayers) == null ? void 0 : n.layers) ?? [])
1177
- if (ae(o))
1194
+ if (Te(o))
1178
1195
  return !0;
1179
1196
  return !1;
1180
1197
  }
1181
- function re(e) {
1198
+ function Ce(e) {
1182
1199
  if (!e)
1183
1200
  return !1;
1184
1201
  for (const [t, n] of Object.entries(e))
1185
- if (!(!t.includes("3-resolutions") || !jo(n))) {
1202
+ if (!(!t.includes("3-resolutions") || !ls(n))) {
1186
1203
  if (t === "hide-component-3-resolutions") {
1187
1204
  const o = n, s = (i) => i === "true" || i === !0;
1188
1205
  if (s(o.phone) !== s(o.tablet) || s(o.phone) !== s(o.desktop))
1189
1206
  return !0;
1190
1207
  continue;
1191
1208
  }
1192
- if (Mo(n))
1209
+ if (cs(n))
1193
1210
  return !0;
1194
1211
  }
1195
1212
  return !1;
1196
1213
  }
1197
- function No(e, t) {
1198
- if (ae(e))
1214
+ function as(e, t) {
1215
+ if (Te(e))
1199
1216
  return !0;
1200
1217
  for (const n of Object.values(t))
1201
- if (ae(n.collectionRows))
1218
+ if (Te(n.collectionRows))
1202
1219
  return !0;
1203
1220
  return !1;
1204
1221
  }
1205
- const ot = parseInt(Ze, 10), st = parseInt(qe, 10), Wo = ot + 1, Vo = st + 1;
1206
- function Fo(e) {
1222
+ const wt = parseInt(yt, 10), vt = parseInt(mt, 10), us = wt + 1, ds = vt + 1;
1223
+ function ps(e) {
1207
1224
  const t = `.${e}-phone`, n = `.${e}-tablet`, o = `.${e}-desktop`;
1208
1225
  return `
1209
1226
  ${t}, ${n}, ${o} { display: none; }
1210
- @media (max-width: ${ot}px) { ${t} { display: block; } }
1211
- @media (min-width: ${Wo}px) and (max-width: ${st}px) { ${n} { display: block; } }
1212
- @media (min-width: ${Vo}px) { ${o} { display: block; } }
1227
+ @media (max-width: ${wt}px) { ${t} { display: block; } }
1228
+ @media (min-width: ${us}px) and (max-width: ${vt}px) { ${n} { display: block; } }
1229
+ @media (min-width: ${ds}px) { ${o} { display: block; } }
1213
1230
  `.trim();
1214
1231
  }
1215
- function le(e) {
1232
+ const fs = /(<\/|<)(s)(tyle)/gi;
1233
+ function _(e) {
1234
+ return e.replace(
1235
+ fs,
1236
+ (t, n, o, s) => `${n}${o === "s" ? "\\73 " : "\\53 "}${s}`
1237
+ );
1238
+ }
1239
+ const ys = (e) => {
1240
+ let t = 3735928559, n = 1103547991;
1241
+ for (let o = 0; o < e.length; o += 1) {
1242
+ const s = e.charCodeAt(o);
1243
+ t = Math.imul(t ^ s, 2654435761), n = Math.imul(n ^ s, 1597334677);
1244
+ }
1245
+ return t = Math.imul(t ^ t >>> 16, 2246822507), t ^= Math.imul(n ^ n >>> 13, 3266489909), n = Math.imul(n ^ n >>> 16, 2246822507), n ^= Math.imul(t ^ t >>> 13, 3266489909), 4294967296 * (2097151 & n) + (t >>> 0);
1246
+ }, At = (e, t) => `${e}-${ys(t).toString(36)}`;
1247
+ function we(e) {
1216
1248
  if (!e)
1217
1249
  throw new Error("Source components plugin is required, but no plugins were provided");
1218
1250
  const t = e.sourceComponents;
@@ -1226,7 +1258,7 @@ function le(e) {
1226
1258
  );
1227
1259
  return t;
1228
1260
  }
1229
- const Bo = ["hidden"], _e = /* @__PURE__ */ A({
1261
+ const ms = ["hidden"], Ge = /* @__PURE__ */ S({
1230
1262
  __name: "EmbedInVerticalContainer",
1231
1263
  props: {
1232
1264
  displayItemList: {},
@@ -1237,61 +1269,57 @@ const Bo = ["hidden"], _e = /* @__PURE__ */ A({
1237
1269
  },
1238
1270
  setup(e) {
1239
1271
  const t = e;
1240
- let n = 0;
1241
- const o = `rulecms-vc-${++n}`;
1242
- function s(h, m, S) {
1243
- const w = h && !S ? 3 : 1;
1244
- return !!(m != null && m.length) && m.length > w;
1272
+ function n(u, y, b) {
1273
+ const C = u && !b ? 3 : 1;
1274
+ return !!(y != null && y.length) && y.length > C;
1245
1275
  }
1246
- const i = g(() => {
1247
- var m;
1248
- return (((m = t.displayItemList.containerAttributes) == null ? void 0 : m[ce]) || []).join(`;
1276
+ const o = m(() => {
1277
+ var y;
1278
+ return (((y = t.displayItemList.containerAttributes) == null ? void 0 : y[ve]) || []).join(`;
1249
1279
  `);
1250
- }), r = g(
1251
- () => i.value ? `.${o} {
1252
- ${i.value}
1280
+ }), s = m(() => At("rulecms-vc", o.value)), i = m(
1281
+ () => o.value ? `.${s.value} {
1282
+ ${o.value}
1253
1283
  }` : ""
1254
- ), l = g(
1255
- () => !t.isComposeMode && ve({
1284
+ ), l = m(
1285
+ () => !t.isComposeMode && Oe({
1256
1286
  containerAttributes: t.displayItemList.containerAttributes,
1257
1287
  deviceDisplayType: t.deviceDisplayType
1258
1288
  })
1259
- ), u = g(
1260
- () => et({
1289
+ ), r = m(
1290
+ () => gt({
1261
1291
  containerAttributes: t.displayItemList.containerAttributes,
1262
1292
  deviceDisplayType: t.deviceDisplayType,
1263
1293
  isComposeMode: t.isComposeMode
1264
1294
  })
1265
- ), c = g(() => {
1266
- var S;
1267
- const h = ((S = t.displayItemList.containerAttributes) == null ? void 0 : S[ce]) || [], m = So(u.value);
1268
- return t.isComposeMode && !t.isWithinCollection || t.showDropContainers || h.length > 0 || m || s(t.isComposeMode, t.displayItemList.rows, t.isWithinCollection);
1269
- }), a = g(
1270
- () => [i.value ? o : void 0, u.value.cssClasses].filter(Boolean).join(" ")
1271
- ), p = g(() => ({
1272
- ...tt({
1295
+ ), d = m(() => {
1296
+ var b;
1297
+ const u = ((b = t.displayItemList.containerAttributes) == null ? void 0 : b[ve]) || [], y = Go(r.value);
1298
+ return t.isComposeMode && !t.isWithinCollection || t.showDropContainers || u.length > 0 || y || n(t.isComposeMode, t.displayItemList.rows, t.isWithinCollection);
1299
+ }), a = m(
1300
+ () => [o.value ? s.value : void 0, r.value.cssClasses].filter(Boolean).join(" ")
1301
+ ), c = m(() => ({
1302
+ ...bt({
1273
1303
  containerAttributes: t.displayItemList.containerAttributes,
1274
- widgetContainerStyles: u.value
1304
+ widgetContainerStyles: r.value
1275
1305
  }) ? {} : { height: t.isWithinCollection ? "auto" : "100%" },
1276
1306
  display: "flex",
1277
1307
  flexDirection: "column",
1278
- ...u.value.styles
1279
- })), y = g(() => c.value ? a.value : ""), d = g(() => l.value ? { display: "none" } : c.value ? p.value : { display: "contents" });
1280
- return (h, m) => (f(), b("div", {
1308
+ ...r.value.styles
1309
+ })), f = m(() => d.value ? a.value : ""), h = m(() => l.value ? { display: "none" } : d.value ? c.value : { display: "contents" });
1310
+ return (u, y) => (p(), w("div", {
1281
1311
  hidden: l.value || void 0,
1282
- class: G(y.value || void 0),
1283
- style: I(d.value)
1312
+ class: oe(f.value || void 0),
1313
+ style: D(h.value)
1284
1314
  }, [
1285
- i.value ? (f(), C(P("style"), { key: 0 }, {
1286
- default: T(() => [
1287
- R(L(r.value), 1)
1288
- ]),
1289
- _: 1
1290
- })) : k("", !0),
1291
- pe(h.$slots, "default")
1292
- ], 14, Bo));
1315
+ o.value ? (p(), v(x("style"), {
1316
+ key: 0,
1317
+ innerHTML: T(_)(i.value)
1318
+ }, null, 8, ["innerHTML"])) : I("", !0),
1319
+ ke(u.$slots, "default")
1320
+ ], 14, ms));
1293
1321
  }
1294
- }), Ko = ["hidden"], je = /* @__PURE__ */ A({
1322
+ }), hs = ["hidden"], Ye = /* @__PURE__ */ S({
1295
1323
  __name: "EmbedInRow",
1296
1324
  props: {
1297
1325
  row: {},
@@ -1302,40 +1330,40 @@ ${i.value}
1302
1330
  },
1303
1331
  setup(e) {
1304
1332
  const t = e;
1305
- function n(c, a, p) {
1306
- var d;
1307
- const y = c && !p ? 3 : 1;
1308
- return !!((d = a == null ? void 0 : a.columns) != null && d.length) && a.columns.length > y;
1333
+ function n(a, c, f) {
1334
+ var u;
1335
+ const h = a && !f ? 3 : 1;
1336
+ return !!((u = c == null ? void 0 : c.columns) != null && u.length) && c.columns.length > h;
1309
1337
  }
1310
- const o = g(
1311
- () => !t.isComposeMode && ho({ row: t.row, deviceDisplayType: t.deviceDisplayType })
1312
- ), s = g(
1313
- () => t.showDropContainers || mo(t.row) || n(t.isComposeMode, t.row, t.isWithinCollection)
1314
- ), i = g(
1315
- () => go({
1338
+ const o = m(
1339
+ () => !t.isComposeMode && Vo({ row: t.row, deviceDisplayType: t.deviceDisplayType })
1340
+ ), s = m(
1341
+ () => t.showDropContainers || Wo(t.row) || n(t.isComposeMode, t.row, t.isWithinCollection)
1342
+ ), i = m(
1343
+ () => Fo({
1316
1344
  row: t.row,
1317
1345
  deviceDisplayType: t.deviceDisplayType,
1318
1346
  isComposeMode: t.isComposeMode
1319
1347
  })
1320
- ), r = g(() => {
1321
- var a;
1322
- const c = N({
1348
+ ), l = m(() => {
1349
+ var c;
1350
+ const a = B({
1323
1351
  deviceDisplayType: t.deviceDisplayType,
1324
1352
  componentAttributes: t.row.rowAttributes
1325
1353
  });
1326
- return we(
1327
- (a = c == null ? void 0 : c.componentAttributesSpecificToDeviceType) == null ? void 0 : a[Ce]
1354
+ return Me(
1355
+ (c = a == null ? void 0 : a.componentAttributesSpecificToDeviceType) == null ? void 0 : c[Re]
1328
1356
  ) ?? "";
1329
- }), l = g(() => s.value ? r.value : ""), u = g(() => o.value ? { display: "none" } : s.value ? i.value : { display: "contents" });
1330
- return (c, a) => (f(), b("div", {
1357
+ }), r = m(() => s.value ? l.value : ""), d = m(() => o.value ? { display: "none" } : s.value ? i.value : { display: "contents" });
1358
+ return (a, c) => (p(), w("div", {
1331
1359
  hidden: o.value || void 0,
1332
- class: G(l.value || void 0),
1333
- style: I(u.value)
1360
+ class: oe(r.value || void 0),
1361
+ style: D(d.value)
1334
1362
  }, [
1335
- pe(c.$slots, "default")
1336
- ], 14, Ko));
1363
+ ke(a.$slots, "default")
1364
+ ], 14, hs));
1337
1365
  }
1338
- }), it = [
1366
+ }), Tt = [
1339
1367
  "minWidth",
1340
1368
  "maxWidth",
1341
1369
  "minHeight",
@@ -1387,20 +1415,20 @@ ${i.value}
1387
1415
  "textAlign",
1388
1416
  "textDecoration",
1389
1417
  "textTransform"
1390
- ], zo = (e) => e != null && e !== "", Ho = (e) => e ? it.reduce(
1418
+ ], gs = (e) => e != null && e !== "", bs = (e) => e ? Tt.reduce(
1391
1419
  (t, n) => {
1392
1420
  const o = e[n];
1393
- return zo(o) && (t[n] = o), t;
1421
+ return gs(o) && (t[n] = o), t;
1394
1422
  },
1395
1423
  {}
1396
- ) : {}, Uo = (e) => {
1424
+ ) : {}, Cs = (e) => {
1397
1425
  if (!e)
1398
1426
  return;
1399
1427
  const t = { ...e };
1400
- for (const n of it)
1428
+ for (const n of Tt)
1401
1429
  delete t[n];
1402
1430
  return Object.keys(t).length ? t : void 0;
1403
- }, Yo = (e) => Object.keys(e).length > 0, Go = (e, t) => {
1431
+ }, ws = (e) => Object.keys(e).length > 0, vs = (e, t) => {
1404
1432
  const n = (e == null ? void 0 : e.noContainer) ?? !1, o = e == null ? void 0 : e.resolveNoContainer;
1405
1433
  if (typeof o != "function")
1406
1434
  return n;
@@ -1418,7 +1446,7 @@ ${i.value}
1418
1446
  );
1419
1447
  }
1420
1448
  return n;
1421
- }, Xo = (e, t) => {
1449
+ }, As = (e, t) => {
1422
1450
  const n = e == null ? void 0 : e.resolveRendersOwnElement;
1423
1451
  if (typeof n != "function")
1424
1452
  return !1;
@@ -1436,7 +1464,7 @@ ${i.value}
1436
1464
  );
1437
1465
  }
1438
1466
  return !1;
1439
- }, Me = /* @__PURE__ */ A({
1467
+ }, Xe = /* @__PURE__ */ S({
1440
1468
  __name: "DisplayComponent",
1441
1469
  props: {
1442
1470
  componentType: {},
@@ -1445,54 +1473,58 @@ ${i.value}
1445
1473
  components: {},
1446
1474
  styleProps: {},
1447
1475
  widgetInstanceProps: {},
1476
+ pageViewType: {},
1477
+ columnPath: {},
1448
1478
  mounts: {}
1449
1479
  },
1450
1480
  setup(e) {
1451
- const t = e, n = g(() => t.components[ze(t.libraryId, t.componentType)]), o = g(() => {
1452
- var h;
1453
- const d = (h = n.value) == null ? void 0 : h.card;
1454
- return d || (console.error(
1481
+ const t = e, n = m(() => t.components[it(t.libraryId, t.componentType)]), o = m(() => {
1482
+ var y;
1483
+ const u = (y = n.value) == null ? void 0 : y.card;
1484
+ return u || (console.error(
1455
1485
  `DisplayComponent: Component with type ${t.componentType}${t.libraryId ? ` (library "${t.libraryId}")` : ""} not found in components`
1456
1486
  ), null);
1457
- }), s = g(() => ({
1487
+ }), s = m(() => ({
1458
1488
  componentAttributes: t.componentAttributes,
1459
1489
  styleProps: t.styleProps
1460
- })), i = g(
1461
- () => n.value ? Go(n.value, s.value) : !1
1462
- ), r = g(() => Ho(t.styleProps)), l = g(
1463
- () => i.value ? Uo(t.styleProps) : t.styleProps
1464
- ), u = g(
1490
+ })), i = m(
1491
+ () => n.value ? vs(n.value, s.value) : !1
1492
+ ), l = m(() => bs(t.styleProps)), r = m(
1493
+ () => i.value ? Cs(t.styleProps) : t.styleProps
1494
+ ), d = m(
1465
1495
  () => {
1466
- var d;
1467
- return we((d = t.componentAttributes) == null ? void 0 : d[Ce]);
1496
+ var u;
1497
+ return Me((u = t.componentAttributes) == null ? void 0 : u[Re]);
1468
1498
  }
1469
- ), c = g(() => i.value && Yo(r.value)), a = g(
1470
- () => !i.value || (n.value ? Xo(n.value, s.value) : !1)
1471
- ), p = g(
1472
- () => !c.value && a.value ? u.value : void 0
1473
- ), y = g(() => ({
1499
+ ), a = m(() => i.value && ws(l.value)), c = m(
1500
+ () => !i.value || (n.value ? As(n.value, s.value) : !1)
1501
+ ), f = m(
1502
+ () => !a.value && c.value ? d.value : void 0
1503
+ ), h = m(() => ({
1474
1504
  componentAttributes: t.componentAttributes,
1475
- styleProps: l.value,
1476
- className: p.value,
1505
+ styleProps: r.value,
1506
+ className: f.value,
1477
1507
  widgetInstanceProps: t.widgetInstanceProps,
1508
+ pageViewType: t.pageViewType,
1509
+ columnPath: t.columnPath,
1478
1510
  mounts: t.mounts
1479
1511
  }));
1480
- return (d, h) => o.value ? (f(), b(E, { key: 0 }, [
1481
- c.value ? (f(), b("div", {
1512
+ return (u, y) => o.value ? (p(), w(k, { key: 0 }, [
1513
+ a.value ? (p(), w("div", {
1482
1514
  key: 0,
1483
- class: G(u.value || void 0),
1484
- style: I(r.value)
1515
+ class: oe(d.value || void 0),
1516
+ style: D(l.value)
1485
1517
  }, [
1486
- (f(), C(P(o.value), oe(De(y.value)), null, 16))
1487
- ], 6)) : !a.value && u.value ? (f(), b("div", {
1518
+ (p(), v(x(o.value), he(We(h.value)), null, 16))
1519
+ ], 6)) : !c.value && d.value ? (p(), w("div", {
1488
1520
  key: 1,
1489
- class: G(u.value)
1521
+ class: oe(d.value)
1490
1522
  }, [
1491
- (f(), C(P(o.value), oe(De(y.value)), null, 16))
1492
- ], 2)) : (f(), C(P(o.value), oe(Dt({ key: 2 }, y.value)), null, 16))
1493
- ], 64)) : k("", !0);
1523
+ (p(), v(x(o.value), he(We(h.value)), null, 16))
1524
+ ], 2)) : (p(), v(x(o.value), he(Zt({ key: 2 }, h.value)), null, 16))
1525
+ ], 64)) : I("", !0);
1494
1526
  }
1495
- }), Jo = ["data-rulecms-overlay-layer"], Zo = /* @__PURE__ */ A({
1527
+ }), Ts = ["data-rulecms-overlay-layer"], Es = /* @__PURE__ */ S({
1496
1528
  __name: "RenderComponentsInner",
1497
1529
  props: {
1498
1530
  displayItemList: {},
@@ -1505,125 +1537,136 @@ ${i.value}
1505
1537
  deviceDisplayType: {},
1506
1538
  componentProps: {},
1507
1539
  mounts: {},
1540
+ placeholderValues: {},
1508
1541
  ancestorColumnIds: {}
1509
1542
  },
1510
1543
  setup(e) {
1511
- const t = e, n = () => le(t.plugins).components, o = g(
1512
- () => !t.isComposeMode && ko(t.displayItemList) && !ve({
1544
+ const t = e, n = () => we(t.plugins).components, o = m(
1545
+ () => !t.isComposeMode && Xo(t.displayItemList) && !Oe({
1513
1546
  containerAttributes: t.displayItemList.containerAttributes,
1514
1547
  deviceDisplayType: t.deviceDisplayType
1515
1548
  })
1516
- ), s = g(() => {
1517
- const p = Oe({
1549
+ ), s = m(() => {
1550
+ const u = Ue({
1518
1551
  containerAttributes: t.displayItemList.containerAttributes,
1519
1552
  deviceDisplayType: t.deviceDisplayType
1520
1553
  });
1521
- return Do({
1554
+ return Qo({
1522
1555
  isWithinCollection: t.isWithinCollection,
1523
- baseDeclaresOwnHeight: tt({
1556
+ baseDeclaresOwnHeight: bt({
1524
1557
  containerAttributes: t.displayItemList.containerAttributes,
1525
- widgetContainerStyles: et({
1558
+ widgetContainerStyles: gt({
1526
1559
  containerAttributes: t.displayItemList.containerAttributes,
1527
1560
  deviceDisplayType: t.deviceDisplayType,
1528
1561
  isComposeMode: t.isComposeMode
1529
1562
  })
1530
1563
  }),
1531
- baseZIndex: p
1564
+ baseZIndex: u
1532
1565
  });
1533
- }), i = g(() => {
1534
- var d;
1535
- const p = ((d = t.displayItemList.overlayLayers) == null ? void 0 : d.layers) ?? [], y = Oe({
1566
+ }), i = m(() => {
1567
+ var b;
1568
+ const u = ((b = t.displayItemList.overlayLayers) == null ? void 0 : b.layers) ?? [], y = Ue({
1536
1569
  containerAttributes: t.displayItemList.containerAttributes,
1537
1570
  deviceDisplayType: t.deviceDisplayType
1538
1571
  });
1539
- return p.flatMap((h, m) => Po({ layer: h, deviceDisplayType: t.deviceDisplayType }) ? [] : [
1572
+ return u.flatMap((C, g) => Zo({ layer: C, deviceDisplayType: t.deviceDisplayType }) ? [] : [
1540
1573
  {
1541
- index: m,
1542
- layer: h,
1543
- boxStyles: $o({
1544
- zIndex: To(y, m),
1545
- pointerEvents: Io({
1546
- containerAttributes: h.containerAttributes,
1574
+ index: g,
1575
+ layer: C,
1576
+ boxStyles: es({
1577
+ zIndex: Jo(y, g),
1578
+ pointerEvents: qo({
1579
+ containerAttributes: C.containerAttributes,
1547
1580
  deviceDisplayType: t.deviceDisplayType
1548
1581
  })
1549
1582
  })
1550
1583
  }
1551
1584
  ]);
1552
1585
  });
1553
- function r(p) {
1554
- if (t.isComposeMode && p.type === fe.DroppableBox)
1586
+ function l(u) {
1587
+ if (t.isComposeMode && u.type === Ie.DroppableBox)
1555
1588
  return !1;
1556
- const { componentAttributesBasedOnDevice: y } = Re({
1557
- col: p,
1589
+ const { componentAttributesBasedOnDevice: y } = He({
1590
+ col: u,
1558
1591
  deviceDisplayType: t.deviceDisplayType,
1559
1592
  isComposeMode: t.isComposeMode,
1560
- sourceComponentsPlugin: le(t.plugins)
1561
- }), d = !!y && y["hide-component-3-resolutions"] === "true";
1562
- return !(!t.isComposeMode && d);
1593
+ sourceComponentsPlugin: we(t.plugins)
1594
+ }), b = !!y && y["hide-component-3-resolutions"] === "true";
1595
+ return !(!t.isComposeMode && b);
1563
1596
  }
1564
- function l(p) {
1565
- const { componentAttributesBasedOnDevice: y, componentStyles: d } = Re({
1566
- col: p,
1597
+ function r(u) {
1598
+ const { componentAttributesBasedOnDevice: y, componentStyles: b } = He({
1599
+ col: u,
1567
1600
  deviceDisplayType: t.deviceDisplayType,
1568
1601
  isComposeMode: t.isComposeMode,
1569
- sourceComponentsPlugin: le(t.plugins)
1602
+ sourceComponentsPlugin: we(t.plugins)
1570
1603
  });
1571
1604
  return {
1572
1605
  componentAttributes: y,
1573
- styleProps: d
1606
+ styleProps: b
1574
1607
  };
1575
1608
  }
1576
- function u(p) {
1577
- const y = Xe(p.type);
1609
+ function d(u) {
1610
+ const y = pt(u.type);
1578
1611
  if (!(y != null && y.length))
1579
1612
  return null;
1580
- const d = p.collection ?? t.widgetCollections[y];
1581
- if (!d)
1613
+ const b = u.collection ?? t.widgetCollections[y];
1614
+ if (!b)
1582
1615
  throw new Error(
1583
1616
  `DisplayCollection - Collection with ID ${y} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`
1584
1617
  );
1585
- return !d.collectionRows || !fo(d.collectionRows) ? null : d.collectionRows;
1618
+ return !b.collectionRows || !jo(b.collectionRows) ? null : b.collectionRows;
1586
1619
  }
1587
- function c(p) {
1588
- return [...t.ancestorColumnIds ?? [], p];
1620
+ function a(u) {
1621
+ return [...t.ancestorColumnIds ?? [], u];
1589
1622
  }
1590
- function a(p) {
1591
- return Lo({
1592
- componentProps: t.componentProps,
1593
- ancestorColumnIds: t.ancestorColumnIds,
1594
- columnId: p
1623
+ function c() {
1624
+ return t.isComposeMode ? Be.Compose : Be.RenderedPage;
1625
+ }
1626
+ function f(u) {
1627
+ if (!(t.isComposeMode || !u))
1628
+ return [...t.ancestorColumnIds ?? [], u].join(pe);
1629
+ }
1630
+ function h(u) {
1631
+ return ns({
1632
+ widgetInstanceProps: ts({
1633
+ componentProps: t.componentProps,
1634
+ ancestorColumnIds: t.ancestorColumnIds,
1635
+ columnId: u
1636
+ }),
1637
+ placeholderValues: t.isComposeMode ? void 0 : t.placeholderValues
1595
1638
  });
1596
1639
  }
1597
- return (p, y) => {
1598
- const d = $t("RenderComponentsInner", !0);
1599
- return o.value ? (f(), b("div", {
1640
+ return (u, y) => {
1641
+ const b = Qt("RenderComponentsInner", !0);
1642
+ return o.value ? (p(), w("div", {
1600
1643
  key: 0,
1601
- style: I(s.value)
1644
+ style: D(s.value)
1602
1645
  }, [
1603
- $(_e, {
1646
+ R(Ge, {
1604
1647
  "display-item-list": e.displayItemList,
1605
1648
  "is-compose-mode": e.isComposeMode,
1606
1649
  "show-drop-containers": e.showDropContainers,
1607
1650
  "is-within-collection": e.isWithinCollection,
1608
1651
  "device-display-type": e.deviceDisplayType
1609
1652
  }, {
1610
- default: T(() => [
1611
- (f(!0), b(E, null, F(e.displayItemList.rows, (h) => (f(), C(je, {
1612
- key: h.id,
1613
- row: h,
1653
+ default: re(() => [
1654
+ (p(!0), w(k, null, U(e.displayItemList.rows, (C) => (p(), v(Ye, {
1655
+ key: C.id,
1656
+ row: C,
1614
1657
  "is-compose-mode": e.isComposeMode,
1615
1658
  "show-drop-containers": e.showDropContainers,
1616
1659
  "is-within-collection": e.isWithinCollection,
1617
1660
  "device-display-type": e.deviceDisplayType
1618
1661
  }, {
1619
- default: T(() => [
1620
- (f(!0), b(E, null, F(h.columns, (m) => (f(), b(E, {
1621
- key: m.id
1662
+ default: re(() => [
1663
+ (p(!0), w(k, null, U(C.columns, (g) => (p(), w(k, {
1664
+ key: g.id
1622
1665
  }, [
1623
- r(m) ? (f(), b(E, { key: 0 }, [
1624
- u(m) ? (f(), C(d, {
1666
+ l(g) ? (p(), w(k, { key: 0 }, [
1667
+ d(g) ? (p(), v(b, {
1625
1668
  key: 0,
1626
- "display-item-list": u(m),
1669
+ "display-item-list": d(g),
1627
1670
  "is-compose-mode": e.isComposeMode,
1628
1671
  "is-within-collection": !0,
1629
1672
  "widget-collections": e.widgetCollections,
@@ -1633,18 +1676,21 @@ ${i.value}
1633
1676
  "device-display-type": e.deviceDisplayType,
1634
1677
  "component-props": e.componentProps,
1635
1678
  mounts: e.mounts,
1636
- "ancestor-column-ids": c(m.id)
1637
- }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "ancestor-column-ids"])) : (f(), C(Me, {
1679
+ "placeholder-values": e.placeholderValues,
1680
+ "ancestor-column-ids": a(g.id)
1681
+ }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "placeholder-values", "ancestor-column-ids"])) : (p(), v(Xe, {
1638
1682
  key: 1,
1639
- "component-type": m.type,
1640
- "library-id": m.libraryId,
1641
- "component-attributes": l(m).componentAttributes,
1683
+ "component-type": g.type,
1684
+ "library-id": g.libraryId,
1685
+ "component-attributes": r(g).componentAttributes,
1642
1686
  components: n(),
1643
- "style-props": l(m).styleProps,
1644
- "widget-instance-props": a(m.id),
1687
+ "style-props": r(g).styleProps,
1688
+ "widget-instance-props": h(g.id),
1689
+ "page-view-type": c(),
1690
+ "column-path": f(g.id),
1645
1691
  mounts: e.mounts
1646
- }, null, 8, ["component-type", "library-id", "component-attributes", "components", "style-props", "widget-instance-props", "mounts"]))
1647
- ], 64)) : k("", !0)
1692
+ }, null, 8, ["component-type", "library-id", "component-attributes", "components", "style-props", "widget-instance-props", "page-view-type", "column-path", "mounts"]))
1693
+ ], 64)) : I("", !0)
1648
1694
  ], 64))), 128))
1649
1695
  ]),
1650
1696
  _: 2
@@ -1652,13 +1698,13 @@ ${i.value}
1652
1698
  ]),
1653
1699
  _: 1
1654
1700
  }, 8, ["display-item-list", "is-compose-mode", "show-drop-containers", "is-within-collection", "device-display-type"]),
1655
- (f(!0), b(E, null, F(i.value, (h) => (f(), b("div", {
1656
- key: h.index,
1657
- "data-rulecms-overlay-layer": h.index,
1658
- style: I(h.boxStyles)
1701
+ (p(!0), w(k, null, U(i.value, (C) => (p(), w("div", {
1702
+ key: C.index,
1703
+ "data-rulecms-overlay-layer": C.index,
1704
+ style: D(C.boxStyles)
1659
1705
  }, [
1660
- $(d, {
1661
- "display-item-list": h.layer,
1706
+ R(b, {
1707
+ "display-item-list": C.layer,
1662
1708
  "is-compose-mode": e.isComposeMode,
1663
1709
  "is-within-collection": !1,
1664
1710
  "widget-collections": e.widgetCollections,
@@ -1668,10 +1714,11 @@ ${i.value}
1668
1714
  "device-display-type": e.deviceDisplayType,
1669
1715
  "component-props": e.componentProps,
1670
1716
  mounts: e.mounts,
1717
+ "placeholder-values": e.placeholderValues,
1671
1718
  "ancestor-column-ids": e.ancestorColumnIds
1672
- }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "ancestor-column-ids"])
1673
- ], 12, Jo))), 128))
1674
- ], 4)) : (f(), C(_e, {
1719
+ }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "placeholder-values", "ancestor-column-ids"])
1720
+ ], 12, Ts))), 128))
1721
+ ], 4)) : (p(), v(Ge, {
1675
1722
  key: 1,
1676
1723
  "display-item-list": e.displayItemList,
1677
1724
  "is-compose-mode": e.isComposeMode,
@@ -1679,23 +1726,23 @@ ${i.value}
1679
1726
  "is-within-collection": e.isWithinCollection,
1680
1727
  "device-display-type": e.deviceDisplayType
1681
1728
  }, {
1682
- default: T(() => [
1683
- (f(!0), b(E, null, F(e.displayItemList.rows, (h) => (f(), C(je, {
1684
- key: h.id,
1685
- row: h,
1729
+ default: re(() => [
1730
+ (p(!0), w(k, null, U(e.displayItemList.rows, (C) => (p(), v(Ye, {
1731
+ key: C.id,
1732
+ row: C,
1686
1733
  "is-compose-mode": e.isComposeMode,
1687
1734
  "show-drop-containers": e.showDropContainers,
1688
1735
  "is-within-collection": e.isWithinCollection,
1689
1736
  "device-display-type": e.deviceDisplayType
1690
1737
  }, {
1691
- default: T(() => [
1692
- (f(!0), b(E, null, F(h.columns, (m) => (f(), b(E, {
1693
- key: m.id
1738
+ default: re(() => [
1739
+ (p(!0), w(k, null, U(C.columns, (g) => (p(), w(k, {
1740
+ key: g.id
1694
1741
  }, [
1695
- r(m) ? (f(), b(E, { key: 0 }, [
1696
- u(m) ? (f(), C(d, {
1742
+ l(g) ? (p(), w(k, { key: 0 }, [
1743
+ d(g) ? (p(), v(b, {
1697
1744
  key: 0,
1698
- "display-item-list": u(m),
1745
+ "display-item-list": d(g),
1699
1746
  "is-compose-mode": e.isComposeMode,
1700
1747
  "is-within-collection": !0,
1701
1748
  "widget-collections": e.widgetCollections,
@@ -1705,18 +1752,21 @@ ${i.value}
1705
1752
  "device-display-type": e.deviceDisplayType,
1706
1753
  "component-props": e.componentProps,
1707
1754
  mounts: e.mounts,
1708
- "ancestor-column-ids": c(m.id)
1709
- }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "ancestor-column-ids"])) : (f(), C(Me, {
1755
+ "placeholder-values": e.placeholderValues,
1756
+ "ancestor-column-ids": a(g.id)
1757
+ }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "placeholder-values", "ancestor-column-ids"])) : (p(), v(Xe, {
1710
1758
  key: 1,
1711
- "component-type": m.type,
1712
- "library-id": m.libraryId,
1713
- "component-attributes": l(m).componentAttributes,
1759
+ "component-type": g.type,
1760
+ "library-id": g.libraryId,
1761
+ "component-attributes": r(g).componentAttributes,
1714
1762
  components: n(),
1715
- "style-props": l(m).styleProps,
1716
- "widget-instance-props": a(m.id),
1763
+ "style-props": r(g).styleProps,
1764
+ "widget-instance-props": h(g.id),
1765
+ "page-view-type": c(),
1766
+ "column-path": f(g.id),
1717
1767
  mounts: e.mounts
1718
- }, null, 8, ["component-type", "library-id", "component-attributes", "components", "style-props", "widget-instance-props", "mounts"]))
1719
- ], 64)) : k("", !0)
1768
+ }, null, 8, ["component-type", "library-id", "component-attributes", "components", "style-props", "widget-instance-props", "page-view-type", "column-path", "mounts"]))
1769
+ ], 64)) : I("", !0)
1720
1770
  ], 64))), 128))
1721
1771
  ]),
1722
1772
  _: 2
@@ -1726,7 +1776,7 @@ ${i.value}
1726
1776
  }, 8, ["display-item-list", "is-compose-mode", "show-drop-containers", "is-within-collection", "device-display-type"]));
1727
1777
  };
1728
1778
  }
1729
- }), ue = /* @__PURE__ */ A({
1779
+ }), Ee = /* @__PURE__ */ S({
1730
1780
  __name: "RenderComponentsForDevice",
1731
1781
  props: {
1732
1782
  displayItemList: {},
@@ -1739,12 +1789,13 @@ ${i.value}
1739
1789
  plugins: {},
1740
1790
  componentProps: {},
1741
1791
  mounts: {},
1792
+ placeholderValues: {},
1742
1793
  ancestorColumnIds: {}
1743
1794
  },
1744
1795
  setup(e) {
1745
1796
  return (t, n) => {
1746
1797
  var o, s;
1747
- return (s = (o = e.displayItemList) == null ? void 0 : o.rows) != null && s.length ? (f(), C(Zo, {
1798
+ return (s = (o = e.displayItemList) == null ? void 0 : o.rows) != null && s.length ? (p(), v(Es, {
1748
1799
  key: 0,
1749
1800
  "display-item-list": e.displayItemList,
1750
1801
  "is-compose-mode": e.isComposeMode,
@@ -1756,27 +1807,24 @@ ${i.value}
1756
1807
  "device-display-type": e.deviceDisplayType,
1757
1808
  "component-props": e.componentProps,
1758
1809
  mounts: e.mounts,
1810
+ "placeholder-values": e.placeholderValues,
1759
1811
  "ancestor-column-ids": e.ancestorColumnIds
1760
- }, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "ancestor-column-ids"])) : k("", !0);
1812
+ }, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "placeholder-values", "ancestor-column-ids"])) : I("", !0);
1761
1813
  };
1762
1814
  }
1763
- }), rt = /* @__PURE__ */ A({
1815
+ }), Et = /* @__PURE__ */ S({
1764
1816
  __name: "LibraryStylesheets",
1765
1817
  props: {
1766
1818
  stylesheets: {}
1767
1819
  },
1768
1820
  setup(e) {
1769
- return (t, n) => (f(!0), b(E, null, F(e.stylesheets ?? [], (o) => (f(), C(P("style"), {
1770
- key: o,
1771
- "data-rulecms-library-stylesheet": ""
1772
- }, {
1773
- default: T(() => [
1774
- R(L(o), 1)
1775
- ]),
1776
- _: 2
1777
- }, 1024))), 128));
1821
+ return (t, n) => (p(!0), w(k, null, U(e.stylesheets ?? [], (o, s) => (p(), v(x("style"), {
1822
+ key: s,
1823
+ "data-rulecms-library-stylesheet": "",
1824
+ innerHTML: T(_)(o)
1825
+ }, null, 8, ["innerHTML"]))), 128));
1778
1826
  }
1779
- }), qo = /* @__PURE__ */ A({
1827
+ }), Ss = /* @__PURE__ */ S({
1780
1828
  __name: "BreakpointVariantRender",
1781
1829
  props: {
1782
1830
  displayItemList: {},
@@ -1784,45 +1832,44 @@ ${i.value}
1784
1832
  plugins: {},
1785
1833
  componentProps: {},
1786
1834
  mounts: {},
1835
+ placeholderValues: {},
1787
1836
  scopeIdInput: {}
1788
1837
  },
1789
1838
  setup(e) {
1790
- const t = ["Phone", "Tablet", "Desktop"];
1791
- let n = 0;
1792
- const o = e, s = `rulecms-bp-${++n}`, i = g(() => o.scopeIdInput ?? s), r = g(
1793
- () => No(o.displayItemList, o.widgetCollections)
1794
- ), l = g(() => Fo(i.value));
1795
- return (u, c) => {
1839
+ const t = ["Phone", "Tablet", "Desktop"], n = e, o = m(
1840
+ () => At("rulecms-bp", JSON.stringify(n.displayItemList))
1841
+ ), s = m(() => n.scopeIdInput ?? o.value), i = m(
1842
+ () => as(n.displayItemList, n.widgetCollections)
1843
+ ), l = m(() => ps(s.value));
1844
+ return (r, d) => {
1796
1845
  var a;
1797
- return f(), b(E, null, [
1798
- $(rt, {
1846
+ return p(), w(k, null, [
1847
+ R(Et, {
1799
1848
  stylesheets: (a = e.plugins.sourceComponents) == null ? void 0 : a.stylesheets
1800
1849
  }, null, 8, ["stylesheets"]),
1801
- r.value ? (f(), b(E, { key: 1 }, [
1802
- (f(), C(P("style"), null, {
1803
- default: T(() => [
1804
- R(L(l.value), 1)
1805
- ]),
1806
- _: 1
1807
- })),
1808
- (f(), b(E, null, F(t, (p) => V("div", {
1809
- key: p,
1810
- class: G(`${i.value}-${p.toLowerCase()}`)
1850
+ i.value ? (p(), w(k, { key: 1 }, [
1851
+ (p(), v(x("style"), {
1852
+ innerHTML: T(_)(l.value)
1853
+ }, null, 8, ["innerHTML"])),
1854
+ (p(), w(k, null, U(t, (c) => K("div", {
1855
+ key: c,
1856
+ class: oe(`${s.value}-${c.toLowerCase()}`)
1811
1857
  }, [
1812
- $(ue, {
1858
+ R(Ee, {
1813
1859
  "display-item-list": e.displayItemList,
1814
1860
  "is-compose-mode": !1,
1815
1861
  "is-within-collection": !1,
1816
1862
  "widget-collections": e.widgetCollections,
1817
1863
  "show-drop-containers": !1,
1818
1864
  "redux-device-display-type": "desktop",
1819
- "device-display-type": p,
1865
+ "device-display-type": c,
1820
1866
  plugins: e.plugins,
1821
1867
  "component-props": e.componentProps,
1822
- mounts: e.mounts
1823
- }, null, 8, ["display-item-list", "widget-collections", "device-display-type", "plugins", "component-props", "mounts"])
1868
+ mounts: e.mounts,
1869
+ "placeholder-values": e.placeholderValues
1870
+ }, null, 8, ["display-item-list", "widget-collections", "device-display-type", "plugins", "component-props", "mounts", "placeholder-values"])
1824
1871
  ], 2)), 64))
1825
- ], 64)) : (f(), C(ue, {
1872
+ ], 64)) : (p(), v(Ee, {
1826
1873
  key: 0,
1827
1874
  "display-item-list": e.displayItemList,
1828
1875
  "is-compose-mode": !1,
@@ -1833,13 +1880,14 @@ ${i.value}
1833
1880
  "device-display-type": "Desktop",
1834
1881
  plugins: e.plugins,
1835
1882
  "component-props": e.componentProps,
1836
- mounts: e.mounts
1837
- }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts"]))
1883
+ mounts: e.mounts,
1884
+ "placeholder-values": e.placeholderValues
1885
+ }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts", "placeholder-values"]))
1838
1886
  ], 64);
1839
1887
  };
1840
1888
  }
1841
1889
  });
1842
- function Qo(e, t, n) {
1890
+ function ks(e, t, n) {
1843
1891
  if (e)
1844
1892
  return "Phone";
1845
1893
  if (t)
@@ -1847,7 +1895,7 @@ function Qo(e, t, n) {
1847
1895
  const o = (n == null ? void 0 : n.toLowerCase()) || "desktop";
1848
1896
  return o === "phone" ? "Phone" : o === "tablet" ? "Tablet" : "Desktop";
1849
1897
  }
1850
- const es = `(max-width: ${Ze})`, ts = `(max-width: ${qe})`, ns = /* @__PURE__ */ A({
1898
+ const Is = `(max-width: ${yt})`, Ps = `(max-width: ${mt})`, Ds = /* @__PURE__ */ S({
1851
1899
  __name: "RenderComponents",
1852
1900
  props: {
1853
1901
  displayItemList: {},
@@ -1858,30 +1906,31 @@ const es = `(max-width: ${Ze})`, ts = `(max-width: ${qe})`, ns = /* @__PURE__ */
1858
1906
  reduxDeviceDisplayType: {},
1859
1907
  plugins: {},
1860
1908
  componentProps: {},
1861
- mounts: {}
1909
+ mounts: {},
1910
+ placeholderValues: {}
1862
1911
  },
1863
1912
  setup(e) {
1864
- const t = e, n = Y("Desktop");
1913
+ const t = e, n = H("Desktop");
1865
1914
  let o, s;
1866
1915
  function i() {
1867
- n.value = Qo(
1916
+ n.value = ks(
1868
1917
  (o == null ? void 0 : o.matches) ?? !1,
1869
1918
  (s == null ? void 0 : s.matches) ?? !1,
1870
1919
  t.reduxDeviceDisplayType
1871
1920
  );
1872
1921
  }
1873
- return Lt(() => {
1874
- typeof matchMedia == "function" && (o = matchMedia(es), s = matchMedia(ts), o.addEventListener("change", i), s.addEventListener("change", i)), i();
1875
- }), Ke(() => {
1922
+ return en(() => {
1923
+ typeof matchMedia == "function" && (o = matchMedia(Is), s = matchMedia(Ps), o.addEventListener("change", i), s.addEventListener("change", i)), i();
1924
+ }), st(() => {
1876
1925
  o == null || o.removeEventListener("change", i), s == null || s.removeEventListener("change", i);
1877
- }), (r, l) => {
1878
- var u;
1879
- return f(), b(E, null, [
1880
- e.isWithinCollection ? k("", !0) : (f(), C(rt, {
1926
+ }), (l, r) => {
1927
+ var d;
1928
+ return p(), w(k, null, [
1929
+ e.isWithinCollection ? I("", !0) : (p(), v(Et, {
1881
1930
  key: 0,
1882
- stylesheets: (u = e.plugins.sourceComponents) == null ? void 0 : u.stylesheets
1931
+ stylesheets: (d = e.plugins.sourceComponents) == null ? void 0 : d.stylesheets
1883
1932
  }, null, 8, ["stylesheets"])),
1884
- $(ue, {
1933
+ R(Ee, {
1885
1934
  "display-item-list": e.displayItemList,
1886
1935
  "is-compose-mode": e.isComposeMode,
1887
1936
  "is-within-collection": e.isWithinCollection,
@@ -1891,20 +1940,24 @@ const es = `(max-width: ${Ze})`, ts = `(max-width: ${qe})`, ns = /* @__PURE__ */
1891
1940
  "device-display-type": n.value,
1892
1941
  plugins: e.plugins,
1893
1942
  "component-props": e.componentProps,
1894
- mounts: e.mounts
1895
- }, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "device-display-type", "plugins", "component-props", "mounts"])
1943
+ mounts: e.mounts,
1944
+ "placeholder-values": e.placeholderValues
1945
+ }, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "device-display-type", "plugins", "component-props", "mounts", "placeholder-values"])
1896
1946
  ], 64);
1897
1947
  };
1898
1948
  }
1899
1949
  });
1900
- function lt(e) {
1950
+ function St(e) {
1901
1951
  return e !== !1;
1902
1952
  }
1903
- const os = ["utilities", "components"], ss = new Set(os), ct = (e) => typeof e == "string" && ss.has(e), is = (e) => e.split(`
1953
+ const xs = ["utilities", "components"], Ls = new Set(xs), kt = (e) => typeof e == "string" && Ls.has(e), $s = (e) => e.split(`
1904
1954
  `).map((t) => t.length > 0 ? ` ${t}` : t).join(`
1905
- `), rs = (e, t) => e ? ct(t) ? `@layer ${t} {
1906
- ${is(e)}
1907
- }` : e : null, ls = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), cs = (e) => e.replace(/[^A-Za-z0-9_-]/g, (t) => `\\${t}`), as = ["</", "<script", "@import", "javascript:", "vbscript:", "expression("], us = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, ds = /[\s{};"]/, ps = /^[A-Za-z0-9_:%./[\]%-]+$/, fs = (e) => {
1955
+ `), Rs = (e, t) => e ? kt(t) ? `@layer ${t} {
1956
+ ${$s(e)}
1957
+ }` : e : null, Ms = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Os = (e) => {
1958
+ const t = e.replace(/[^A-Za-z0-9_-]/g, (n) => `\\${n}`);
1959
+ return /^[0-9]/.test(t) ? `\\3${t[0]} ${t.slice(1)}` : /^-[0-9]/.test(t) ? `-\\3${t[1]} ${t.slice(2)}` : t;
1960
+ }, _s = ["</", "<script", "@import", "javascript:", "vbscript:", "expression("], js = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, Ns = /[\s{};"]/, Ws = /^[A-Za-z0-9_:%./[\]%-]+$/, Vs = (e) => {
1908
1961
  let t = 0;
1909
1962
  for (const n of e)
1910
1963
  if (n === "{")
@@ -1912,43 +1965,43 @@ ${is(e)}
1912
1965
  else if (n === "}" && (t -= 1, t < 0))
1913
1966
  return !1;
1914
1967
  return t === 0;
1915
- }, ys = (e) => {
1968
+ }, Fs = (e) => {
1916
1969
  const t = e.startsWith(".") ? e.slice(1) : e;
1917
- return !t || t.length > 200 || t.startsWith(".") || ds.test(t) ? !1 : ps.test(t);
1918
- }, ms = (e) => {
1970
+ return !t || t.length > 200 || t.startsWith(".") || Ns.test(t) ? !1 : Ws.test(t);
1971
+ }, Bs = (e) => {
1919
1972
  const t = e.trim();
1920
- if (!t || t.length > 4e3 || us.test(t) || !fs(t))
1973
+ if (!t || t.length > 4e3 || js.test(t) || !Vs(t))
1921
1974
  return !1;
1922
1975
  const n = t.toLowerCase();
1923
- return !as.some((o) => n.includes(o));
1924
- }, hs = (e) => {
1976
+ return !_s.some((o) => n.includes(o));
1977
+ }, Ks = (e) => {
1925
1978
  if (!e)
1926
1979
  return {};
1927
1980
  const t = {};
1928
1981
  for (const [n, o] of Object.entries(e)) {
1929
1982
  const s = n.startsWith(".") ? n.slice(1) : n.trim();
1930
- if (!ys(s) || typeof o != "string")
1983
+ if (!Fs(s) || typeof o != "string")
1931
1984
  continue;
1932
1985
  const i = o.trim();
1933
- ms(i) && (t[s] = i);
1986
+ Bs(i) && (t[s] = i);
1934
1987
  }
1935
1988
  return t;
1936
- }, gs = (e) => e.split(`
1989
+ }, Hs = (e) => e.split(`
1937
1990
  `).map((t) => ` ${t}`).join(`
1938
- `), bs = (e, t, n, o) => {
1939
- if (!lt(n))
1991
+ `), Us = (e, t, n, o) => {
1992
+ if (!St(n))
1940
1993
  return null;
1941
- const s = hs(t), i = Object.keys(s);
1994
+ const s = Ks(t), i = Object.keys(s);
1942
1995
  if (i.length === 0 || !e)
1943
1996
  return null;
1944
- const r = `[data-rulecms-published-key="${ls(e)}"]`, l = i.sort((u, c) => u.localeCompare(c)).map(
1945
- (u) => `${r} .${cs(u)} {
1946
- ${gs(s[u])}
1997
+ const l = `[data-rulecms-published-key="${Ms(e)}"]`, r = i.map(
1998
+ (d) => `${l} .${Os(d)} {
1999
+ ${Hs(s[d])}
1947
2000
  }`
1948
2001
  ).join(`
1949
2002
  `);
1950
- return rs(l, o);
1951
- }, Cs = /* @__PURE__ */ A({
2003
+ return Rs(r, o);
2004
+ }, zs = /* @__PURE__ */ S({
1952
2005
  __name: "ProjectCssClassesStylesheet",
1953
2006
  props: {
1954
2007
  publishedKey: {},
@@ -1956,29 +2009,25 @@ ${gs(s[u])}
1956
2009
  classLayer: {}
1957
2010
  },
1958
2011
  setup(e) {
1959
- const t = e, n = g(
1960
- () => bs(
2012
+ const t = e, n = m(
2013
+ () => Us(
1961
2014
  t.publishedKey,
1962
2015
  t.classes,
1963
2016
  void 0,
1964
2017
  t.classLayer
1965
2018
  )
1966
2019
  );
1967
- return (o, s) => n.value ? (f(), C(P("style"), {
2020
+ return (o, s) => n.value ? (p(), v(x("style"), {
1968
2021
  key: 0,
1969
- "data-rulecms-project-class-definitions": ""
1970
- }, {
1971
- default: T(() => [
1972
- R(L(n.value), 1)
1973
- ]),
1974
- _: 1
1975
- })) : k("", !0);
2022
+ "data-rulecms-project-class-definitions": "",
2023
+ innerHTML: T(_)(n.value)
2024
+ }, null, 8, ["innerHTML"])) : I("", !0);
1976
2025
  }
1977
2026
  });
1978
- function Se(e) {
2027
+ function _e(e) {
1979
2028
  return e !== !1;
1980
2029
  }
1981
- const at = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), ws = /* @__PURE__ */ new Set([
2030
+ const It = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Gs = /* @__PURE__ */ new Set([
1982
2031
  "serif",
1983
2032
  "sans-serif",
1984
2033
  "monospace",
@@ -1992,84 +2041,84 @@ const at = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), ws = /* @__PURE
1992
2041
  "emoji",
1993
2042
  "math",
1994
2043
  "fangsong"
1995
- ]), vs = /^[a-zA-Z_\u00A0-\uFFFF-][a-zA-Z0-9_\u00A0-\uFFFF-]*$/, As = /url\(|@|[{};\\<>]|javascript:/i, Ss = /url\(|@|[{};\\<>]|javascript:|expression\(/i, Es = /^--[A-Za-z_][\w-]*$/, ks = /^[A-Za-z0-9 ]+$/, Ts = /* @__PURE__ */ new Set([100, 200, 300, 400, 500, 600, 700, 800, 900]), Is = 4, Ps = 8, Ds = 255, de = (e) => ws.has(e.toLowerCase()) || vs.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`, Ne = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 80 && !e.includes(",") && !As.test(e), $s = (e) => typeof e == "string" && Es.test(e.trim()) && e.trim().length <= 80, Ls = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !Ss.test(e), xs = (e) => typeof e != "number" || !Number.isInteger(e) || e < 0 || e > Ds ? null : e, Rs = (e, t, n) => {
2044
+ ]), Ys = /^[a-zA-Z_\u00A0-\uFFFF-][a-zA-Z0-9_\u00A0-\uFFFF-]*$/, Xs = /url\(|@|[{};\\<>]|javascript:/i, Js = /url\(|@|[{};\\<>]|javascript:|expression\(/i, qs = /^--[A-Za-z_][\w-]*$/, Zs = /^[A-Za-z0-9 ]+$/, Qs = /* @__PURE__ */ new Set([100, 200, 300, 400, 500, 600, 700, 800, 900]), ei = 4, ti = 8, ni = 255, Se = (e) => Gs.has(e.toLowerCase()) || Ys.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`, Je = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 80 && !e.includes(",") && !Xs.test(e), oi = (e) => typeof e == "string" && qs.test(e.trim()) && e.trim().length <= 80, si = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !Js.test(e), ii = (e) => typeof e != "number" || !Number.isInteger(e) || e < 0 || e > ni ? null : e, ri = (e, t, n) => {
1996
2045
  if (!Array.isArray(e))
1997
2046
  return [];
1998
2047
  const o = [];
1999
2048
  for (const s of e) {
2000
- if (!s || typeof s != "object" || o.length >= Is)
2049
+ if (!s || typeof s != "object" || o.length >= ei)
2001
2050
  continue;
2002
2051
  const i = s;
2003
- if (!$s(i.name))
2052
+ if (!oi(i.name))
2004
2053
  continue;
2005
- const r = i.name.trim();
2006
- if (t.has(r))
2054
+ const l = i.name.trim();
2055
+ if (t.has(l))
2007
2056
  continue;
2008
- const l = [], u = /* @__PURE__ */ new Set();
2009
- for (const a of i.overrideColors ?? []) {
2010
- if (l.length >= Ps)
2057
+ const r = [], d = /* @__PURE__ */ new Set();
2058
+ for (const c of i.overrideColors ?? []) {
2059
+ if (r.length >= ti)
2011
2060
  break;
2012
- const p = xs(a == null ? void 0 : a.index);
2013
- p === null || u.has(p) || !Ls(a == null ? void 0 : a.color) || (u.add(p), l.push({ index: p, color: a.color.trim() }));
2061
+ const f = ii(c == null ? void 0 : c.index);
2062
+ f === null || d.has(f) || !si(c == null ? void 0 : c.color) || (d.add(f), r.push({ index: f, color: c.color.trim() }));
2014
2063
  }
2015
- l.sort((a, p) => a.index - p.index);
2016
- const c = i.applyToWidget === !0 && !n.current;
2017
- c && (n.current = !0), t.add(r), o.push({
2018
- name: r,
2019
- ...l.length > 0 ? { overrideColors: l } : {},
2020
- ...c ? { applyToWidget: !0 } : {}
2064
+ r.sort((c, f) => c.index - f.index);
2065
+ const a = i.applyToWidget === !0 && !n.current;
2066
+ a && (n.current = !0), t.add(l), o.push({
2067
+ name: l,
2068
+ ...r.length > 0 ? { overrideColors: r } : {},
2069
+ ...a ? { applyToWidget: !0 } : {}
2021
2070
  });
2022
2071
  }
2023
2072
  return o;
2024
- }, ne = (e) => {
2025
- var r;
2073
+ }, fe = (e) => {
2074
+ var l;
2026
2075
  if (!Array.isArray(e))
2027
2076
  return [];
2028
2077
  const t = [], n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = { current: !1 };
2029
2078
  let i = !1;
2030
- for (const l of e) {
2031
- if (!l || !Ne(l.family))
2079
+ for (const r of e) {
2080
+ if (!r || !Je(r.family))
2032
2081
  continue;
2033
- const u = l.family.trim(), c = u.toLowerCase();
2034
- if (n.has(c) || t.length >= 12)
2082
+ const d = r.family.trim(), a = d.toLowerCase();
2083
+ if (n.has(a) || t.length >= 12)
2035
2084
  continue;
2036
- const a = (l.fallbacks ?? []).filter(Ne).slice(0, 8), p = typeof l.cssVariable == "string" && U(l.cssVariable.trim()) ? l.cssVariable.trim() : void 0;
2037
- let y = { kind: "stack-only" };
2038
- if (((r = l.source) == null ? void 0 : r.kind) === "google") {
2039
- if (!ks.test(u))
2085
+ const c = (r.fallbacks ?? []).filter(Je).slice(0, 8), f = typeof r.cssVariable == "string" && q(r.cssVariable.trim()) ? r.cssVariable.trim() : void 0;
2086
+ let h = { kind: "stack-only" };
2087
+ if (((l = r.source) == null ? void 0 : l.kind) === "google") {
2088
+ if (!Zs.test(d))
2040
2089
  continue;
2041
- const S = (Array.isArray(l.source.weights) ? l.source.weights : []).filter((w) => typeof w == "number" && Ts.has(w)).filter((w, D, O) => O.indexOf(w) === D).sort((w, D) => w - D);
2042
- if (S.length === 0)
2090
+ const C = (Array.isArray(r.source.weights) ? r.source.weights : []).filter((g) => typeof g == "number" && Qs.has(g)).filter((g, Z, ye) => ye.indexOf(g) === Z).sort((g, Z) => g - Z);
2091
+ if (C.length === 0)
2043
2092
  continue;
2044
- y = { kind: "google", weights: S };
2093
+ h = { kind: "google", weights: C };
2045
2094
  }
2046
- n.add(c);
2047
- const d = l.applyToWidget === !0 && !i;
2048
- d && (i = !0);
2049
- const h = Rs(l.palettes, o, s);
2095
+ n.add(a);
2096
+ const u = r.applyToWidget === !0 && !i;
2097
+ u && (i = !0);
2098
+ const y = ri(r.palettes, o, s);
2050
2099
  t.push({
2051
- family: u,
2052
- ...p ? { cssVariable: p } : {},
2053
- fallbacks: a,
2054
- applyToWidget: d,
2055
- source: y,
2056
- ...h.length > 0 ? { palettes: h } : {}
2100
+ family: d,
2101
+ ...f ? { cssVariable: f } : {},
2102
+ fallbacks: c,
2103
+ applyToWidget: u,
2104
+ source: h,
2105
+ ...y.length > 0 ? { palettes: y } : {}
2057
2106
  });
2058
2107
  }
2059
2108
  return t;
2060
- }, Os = (e) => {
2061
- const t = ne(e).filter((n) => n.source.kind === "google").map((n) => {
2109
+ }, li = (e) => {
2110
+ const t = fe(e).filter((n) => n.source.kind === "google").map((n) => {
2062
2111
  const o = n.source.kind === "google" ? n.source.weights.join(";") : "400";
2063
2112
  return `family=${n.family.replace(/ /g, "+")}:wght@${o}`;
2064
2113
  });
2065
2114
  return t.length === 0 ? null : `https://fonts.googleapis.com/css2?${t.join("&")}&display=swap`;
2066
- }, _s = (e) => [de(e.family), ...(e.fallbacks ?? []).map(de)].join(", "), js = (e) => {
2115
+ }, ci = (e) => [Se(e.family), ...(e.fallbacks ?? []).map(Se)].join(", "), ai = (e) => {
2067
2116
  const t = [];
2068
2117
  for (const n of e)
2069
2118
  for (const o of n.palettes ?? []) {
2070
- const s = [` font-family: ${de(n.family)};`];
2119
+ const s = [` font-family: ${Se(n.family)};`];
2071
2120
  if (o.overrideColors && o.overrideColors.length > 0) {
2072
- const i = o.overrideColors.map((r) => `${r.index} ${r.color}`).join(", ");
2121
+ const i = o.overrideColors.map((l) => `${l.index} ${l.color}`).join(", ");
2073
2122
  s.push(` override-colors: ${i};`);
2074
2123
  }
2075
2124
  t.push(`@font-palette-values ${o.name} {
@@ -2080,66 +2129,62 @@ ${s.join(`
2080
2129
  return t.length > 0 ? t.join(`
2081
2130
 
2082
2131
  `) : null;
2083
- }, Ms = (e) => {
2132
+ }, ui = (e) => {
2084
2133
  for (const t of e)
2085
2134
  for (const n of t.palettes ?? [])
2086
2135
  if (n.applyToWidget)
2087
2136
  return n.name;
2088
- }, Ns = (e, t, n) => {
2089
- if (!Se(n) || !e)
2137
+ }, di = (e, t, n) => {
2138
+ if (!_e(n) || !e)
2090
2139
  return null;
2091
- const o = ne(t), s = [];
2092
- for (const c of o) {
2093
- const a = _s(c);
2094
- c.cssVariable && s.push(` ${c.cssVariable}: ${a};`), c.applyToWidget && s.push(
2095
- ` font-family: ${c.cssVariable ? `var(${c.cssVariable})` : a};`
2140
+ const o = fe(t), s = [];
2141
+ for (const a of o) {
2142
+ const c = ci(a);
2143
+ a.cssVariable && s.push(` ${a.cssVariable}: ${c};`), a.applyToWidget && s.push(
2144
+ ` font-family: ${a.cssVariable ? `var(${a.cssVariable})` : c};`
2096
2145
  );
2097
2146
  }
2098
- const i = Ms(o);
2147
+ const i = ui(o);
2099
2148
  i && s.push(` font-palette: ${i};`);
2100
- const r = js(o), l = `[data-rulecms-published-key="${at(e)}"] > *`, u = s.length > 0 ? `${l} {
2149
+ const l = ai(o), r = `[data-rulecms-published-key="${It(e)}"] > *`, d = s.length > 0 ? `${r} {
2101
2150
  ${s.join(`
2102
2151
  `)}
2103
2152
  }` : null;
2104
- return !r && !u ? null : r ? u ? `${r}
2153
+ return !l && !d ? null : l ? d ? `${l}
2105
2154
 
2106
- ${u}` : r : u;
2107
- }, Ws = ["href"], Vs = /* @__PURE__ */ A({
2155
+ ${d}` : l : d;
2156
+ }, pi = ["href"], fi = /* @__PURE__ */ S({
2108
2157
  __name: "ProjectCssFontsStylesheet",
2109
2158
  props: {
2110
2159
  publishedKey: {},
2111
2160
  fonts: {},
2112
- includeFontFaces: { type: [Boolean, null] }
2161
+ includeFontFaces: { type: [Boolean, null], default: void 0 }
2113
2162
  },
2114
2163
  setup(e) {
2115
- const t = e, n = g(() => ne(t.fonts)), o = g(
2116
- () => Se(t.includeFontFaces) ? Os(n.value) : null
2117
- ), s = g(
2118
- () => Ns(t.publishedKey, n.value, t.includeFontFaces)
2164
+ const t = e, n = m(() => fe(t.fonts)), o = m(
2165
+ () => _e(t.includeFontFaces) ? li(n.value) : null
2166
+ ), s = m(
2167
+ () => di(t.publishedKey, n.value, t.includeFontFaces)
2119
2168
  );
2120
- return (i, r) => (f(), b(E, null, [
2121
- o.value ? (f(), b("link", {
2169
+ return (i, l) => (p(), w(k, null, [
2170
+ o.value ? (p(), w("link", {
2122
2171
  key: 0,
2123
2172
  rel: "stylesheet",
2124
2173
  href: o.value,
2125
2174
  "data-rulecms-project-fonts": ""
2126
- }, null, 8, Ws)) : k("", !0),
2127
- s.value ? (f(), C(P("style"), {
2175
+ }, null, 8, pi)) : I("", !0),
2176
+ s.value ? (p(), v(x("style"), {
2128
2177
  key: 1,
2129
- "data-rulecms-project-fonts": ""
2130
- }, {
2131
- default: T(() => [
2132
- R(L(s.value), 1)
2133
- ]),
2134
- _: 1
2135
- })) : k("", !0)
2178
+ "data-rulecms-project-fonts": "",
2179
+ innerHTML: T(_)(s.value)
2180
+ }, null, 8, ["innerHTML"])) : I("", !0)
2136
2181
  ], 64));
2137
2182
  }
2138
2183
  });
2139
- function ut(e) {
2184
+ function Pt(e) {
2140
2185
  return e !== !1;
2141
2186
  }
2142
- const Fs = 80, Bs = 4e3, Ks = 32, dt = [
2187
+ const yi = 80, mi = 4e3, hi = 32, Dt = [
2143
2188
  "url(",
2144
2189
  "@import",
2145
2190
  "@font-face",
@@ -2150,7 +2195,7 @@ const Fs = 80, Bs = 4e3, Ks = 32, dt = [
2150
2195
  "javascript:",
2151
2196
  "expression(",
2152
2197
  "behavior:"
2153
- ], zs = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, Hs = /^[A-Za-z_][\w-]*$/, Us = (e) => {
2198
+ ], gi = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, bi = /^[A-Za-z_][\w-]*$/, Ci = (e) => {
2154
2199
  let t = 0;
2155
2200
  for (const n of e)
2156
2201
  if (n === "{")
@@ -2158,12 +2203,12 @@ const Fs = 80, Bs = 4e3, Ks = 32, dt = [
2158
2203
  else if (n === "}" && (t -= 1, t < 0))
2159
2204
  return !1;
2160
2205
  return t === 0;
2161
- }, Ys = (e) => {
2162
- if (!e || e.length > Fs || e.includes("@") || e.includes(".") || /\s/.test(e))
2206
+ }, wi = (e) => {
2207
+ if (!e || e.length > yi || e.includes("@") || e.includes(".") || /\s/.test(e))
2163
2208
  return !1;
2164
2209
  const t = e.toLowerCase();
2165
- return dt.some((n) => t.includes(n)) ? !1 : Hs.test(e);
2166
- }, Gs = (e) => {
2210
+ return Dt.some((n) => t.includes(n)) ? !1 : bi.test(e);
2211
+ }, vi = (e) => {
2167
2212
  const t = e.trim();
2168
2213
  if (t === "")
2169
2214
  return !1;
@@ -2175,7 +2220,7 @@ const Fs = 80, Bs = 4e3, Ks = 32, dt = [
2175
2220
  return !1;
2176
2221
  const s = Number(o[1]);
2177
2222
  return s >= 0 && s <= 100;
2178
- }, Xs = (e) => {
2223
+ }, Ai = (e) => {
2179
2224
  let t = 0;
2180
2225
  const n = e.length;
2181
2226
  let o = 0;
@@ -2185,137 +2230,129 @@ const Fs = 80, Bs = 4e3, Ks = 32, dt = [
2185
2230
  };
2186
2231
  for (s(); t < n; ) {
2187
2232
  const i = e.indexOf("{", t);
2188
- if (i === -1 || !e.slice(t, i).trim().split(",").every((c) => Gs(c)))
2233
+ if (i === -1 || !e.slice(t, i).trim().split(",").every((a) => vi(a)))
2189
2234
  return !1;
2190
2235
  t = i + 1;
2191
- const l = e.indexOf("}", t);
2192
- if (l === -1)
2236
+ const r = e.indexOf("}", t);
2237
+ if (r === -1)
2193
2238
  return !1;
2194
- const u = e.slice(t, l);
2195
- if (u.includes("{") || u.includes("}") || u.includes("@"))
2239
+ const d = e.slice(t, r);
2240
+ if (d.includes("{") || d.includes("}") || d.includes("@"))
2196
2241
  return !1;
2197
- t = l + 1, o += 1, s();
2242
+ t = r + 1, o += 1, s();
2198
2243
  }
2199
2244
  return o > 0;
2200
- }, Js = (e) => {
2245
+ }, Ti = (e) => {
2201
2246
  const t = e.trim();
2202
- if (!t || t.length > Bs || zs.test(t) || !Us(t))
2247
+ if (!t || t.length > mi || gi.test(t) || !Ci(t))
2203
2248
  return !1;
2204
2249
  const n = t.toLowerCase();
2205
- return dt.some((o) => n.includes(o)) || t.includes("@") ? !1 : Xs(t);
2206
- }, pt = (e) => {
2250
+ return Dt.some((o) => n.includes(o)) || t.includes("@") ? !1 : Ai(t);
2251
+ }, xt = (e) => {
2207
2252
  if (!e)
2208
2253
  return {};
2209
2254
  const t = {};
2210
2255
  for (const [n, o] of Object.entries(e)) {
2211
2256
  const s = n.trim();
2212
- if (!Ys(s) || t[s] !== void 0 || typeof o != "string")
2257
+ if (!wi(s) || t[s] !== void 0 || typeof o != "string")
2213
2258
  continue;
2214
2259
  const i = o.trim();
2215
- if (Js(i) && (t[s] = i, Object.keys(t).length === Ks))
2260
+ if (Ti(i) && (t[s] = i, Object.keys(t).length === hi))
2216
2261
  break;
2217
2262
  }
2218
2263
  return Object.fromEntries(
2219
2264
  Object.entries(t).sort(([n], [o]) => n.localeCompare(o))
2220
2265
  );
2221
- }, Zs = (e) => e.split(`
2266
+ }, Ei = (e) => e.split(`
2222
2267
  `).map((t) => ` ${t}`).join(`
2223
- `), qs = (e, t, n) => {
2224
- if (!ut(n))
2268
+ `), Si = (e, t, n) => {
2269
+ if (!Pt(n))
2225
2270
  return null;
2226
- const o = pt(t), s = Object.keys(o);
2271
+ const o = xt(t), s = Object.keys(o);
2227
2272
  return s.length === 0 ? null : s.map((i) => `@keyframes ${i} {
2228
- ${Zs(o[i])}
2273
+ ${Ei(o[i])}
2229
2274
  }`).join(`
2230
2275
 
2231
2276
  `);
2232
- }, Qs = /* @__PURE__ */ A({
2277
+ }, ki = /* @__PURE__ */ S({
2233
2278
  __name: "ProjectCssKeyframesStylesheet",
2234
2279
  props: {
2235
2280
  publishedKey: {},
2236
2281
  keyframes: {}
2237
2282
  },
2238
2283
  setup(e) {
2239
- const t = e, n = g(
2240
- () => qs(t.publishedKey, t.keyframes)
2284
+ const t = e, n = m(
2285
+ () => Si(t.publishedKey, t.keyframes)
2241
2286
  );
2242
- return (o, s) => n.value ? (f(), C(P("style"), {
2287
+ return (o, s) => n.value ? (p(), v(x("style"), {
2243
2288
  key: 0,
2244
- "data-rulecms-project-keyframes": ""
2245
- }, {
2246
- default: T(() => [
2247
- R(L(n.value), 1)
2248
- ]),
2249
- _: 1
2250
- })) : k("", !0);
2289
+ "data-rulecms-project-keyframes": "",
2290
+ innerHTML: T(_)(n.value)
2291
+ }, null, 8, ["innerHTML"])) : I("", !0);
2251
2292
  }
2252
- }), ft = (e) => e !== !1, ei = 80, ti = 2e3, ni = 16, yt = ["url(", "@", "</", "<script", "javascript:", "expression("], oi = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, si = /^--[A-Za-z_][\w-]*$/, ii = (e) => {
2293
+ }), Lt = (e) => e !== !1, Ii = 80, Pi = 2e3, Di = 16, $t = ["url(", "@", "</", "<script", "javascript:", "expression("], xi = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, Li = /^--[A-Za-z_][\w-]*$/, $i = (e) => {
2253
2294
  for (const t of e)
2254
2295
  if (t === "{" || t === "}")
2255
2296
  return !1;
2256
2297
  return !0;
2257
- }, ri = (e) => {
2258
- if (!e || e.length > ei || e.includes("@") || e.includes(".") || /\s/.test(e))
2298
+ }, Ri = (e) => {
2299
+ if (!e || e.length > Ii || e.includes("@") || e.includes(".") || /\s/.test(e))
2259
2300
  return !1;
2260
2301
  const t = e.toLowerCase();
2261
- return yt.some((n) => t.includes(n)) ? !1 : si.test(e);
2262
- }, li = (e) => {
2302
+ return $t.some((n) => t.includes(n)) ? !1 : Li.test(e);
2303
+ }, Mi = (e) => {
2263
2304
  const t = e.trim();
2264
- if (!t || t.length > ti || oi.test(t) || !ii(t))
2305
+ if (!t || t.length > Pi || xi.test(t) || !$i(t))
2265
2306
  return !1;
2266
2307
  const n = t.toLowerCase();
2267
- return !yt.some((o) => n.includes(o));
2268
- }, mt = (e) => {
2308
+ return !$t.some((o) => n.includes(o));
2309
+ }, Rt = (e) => {
2269
2310
  if (!e)
2270
2311
  return {};
2271
2312
  const t = {};
2272
2313
  for (const [n, o] of Object.entries(e)) {
2273
2314
  const s = n.trim();
2274
- if (!ri(s) || t[s] !== void 0 || typeof o != "string")
2315
+ if (!Ri(s) || t[s] !== void 0 || typeof o != "string")
2275
2316
  continue;
2276
2317
  const i = o.trim();
2277
- if (li(i) && (t[s] = i, Object.keys(t).length === ni))
2318
+ if (Mi(i) && (t[s] = i, Object.keys(t).length === Di))
2278
2319
  break;
2279
2320
  }
2280
2321
  return Object.fromEntries(
2281
2322
  Object.entries(t).sort(([n], [o]) => n.localeCompare(o))
2282
2323
  );
2283
- }, ci = (e) => e.split(`
2324
+ }, Oi = (e) => e.split(`
2284
2325
  `).map((t) => ` ${t}`).join(`
2285
- `), ai = (e, t, n) => {
2286
- if (!ft(n))
2326
+ `), _i = (e, t, n) => {
2327
+ if (!Lt(n))
2287
2328
  return null;
2288
- const o = mt(t), s = Object.keys(o);
2329
+ const o = Rt(t), s = Object.keys(o);
2289
2330
  return s.length === 0 ? null : s.map((i) => `@position-try ${i} {
2290
- ${ci(o[i])}
2331
+ ${Oi(o[i])}
2291
2332
  }`).join(`
2292
2333
 
2293
2334
  `);
2294
- }, ui = /* @__PURE__ */ A({
2335
+ }, ji = /* @__PURE__ */ S({
2295
2336
  __name: "ProjectCssPositionTryStylesheet",
2296
2337
  props: {
2297
2338
  publishedKey: {},
2298
2339
  positionTry: {}
2299
2340
  },
2300
2341
  setup(e) {
2301
- const t = e, n = g(
2302
- () => ai(t.publishedKey, t.positionTry)
2342
+ const t = e, n = m(
2343
+ () => _i(t.publishedKey, t.positionTry)
2303
2344
  );
2304
- return (o, s) => n.value ? (f(), C(P("style"), {
2345
+ return (o, s) => n.value ? (p(), v(x("style"), {
2305
2346
  key: 0,
2306
- "data-rulecms-project-position-try": ""
2307
- }, {
2308
- default: T(() => [
2309
- R(L(n.value), 1)
2310
- ]),
2311
- _: 1
2312
- })) : k("", !0);
2347
+ "data-rulecms-project-position-try": "",
2348
+ innerHTML: T(_)(n.value)
2349
+ }, null, 8, ["innerHTML"])) : I("", !0);
2313
2350
  }
2314
2351
  });
2315
- function ht(e) {
2352
+ function Mt(e) {
2316
2353
  return e !== !1;
2317
2354
  }
2318
- const di = [
2355
+ const Ni = [
2319
2356
  "*",
2320
2357
  "<number>",
2321
2358
  "<integer>",
@@ -2327,18 +2364,18 @@ const di = [
2327
2364
  "<time>",
2328
2365
  "<transform-function>",
2329
2366
  "<transform-list>"
2330
- ], pi = new Set(di), fi = /[{};]/, yi = 40, mi = 200, hi = (e) => typeof e == "string" && pi.has(e), gi = (e, t) => t !== "*" && e === "" ? !1 : t === "*" && e === "" ? !0 : !(e.length > mi || fi.test(e) || e.includes("url(") || e.includes("@")), gt = (e) => {
2367
+ ], Wi = new Set(Ni), Vi = /[{};]/, Fi = 200, Bi = 200, Ki = (e) => typeof e == "string" && Wi.has(e), Hi = (e, t) => t !== "*" && e === "" ? !1 : t === "*" && e === "" ? !0 : !(e.length > Bi || Vi.test(e) || e.includes("url(") || e.includes("@")), Ot = (e) => {
2331
2368
  if (!Array.isArray(e))
2332
2369
  return [];
2333
2370
  const t = [], n = /* @__PURE__ */ new Set();
2334
2371
  for (const o of e) {
2335
- if (!o || typeof o.name != "string" || !U(o.name.trim()))
2372
+ if (!o || typeof o.name != "string" || !q(o.name.trim()))
2336
2373
  continue;
2337
2374
  const s = o.name.trim();
2338
- if (n.has(s) || t.length >= yi || !hi(o.syntax) || typeof o.inherits != "boolean")
2375
+ if (n.has(s) || t.length >= Fi || !Ki(o.syntax) || typeof o.inherits != "boolean")
2339
2376
  continue;
2340
2377
  const i = typeof o.initialValue == "string" ? o.initialValue.trim() : "";
2341
- gi(i, o.syntax) && (n.add(s), t.push({
2378
+ Hi(i, o.syntax) && (n.add(s), t.push({
2342
2379
  name: s,
2343
2380
  syntax: o.syntax,
2344
2381
  inherits: o.inherits,
@@ -2346,7 +2383,7 @@ const di = [
2346
2383
  }));
2347
2384
  }
2348
2385
  return t;
2349
- }, bi = (e) => {
2386
+ }, Ui = (e) => {
2350
2387
  const t = [
2351
2388
  `@property ${e.name} {`,
2352
2389
  ` syntax: "${e.syntax}";`,
@@ -2354,311 +2391,384 @@ const di = [
2354
2391
  ];
2355
2392
  return e.initialValue !== "" && t.push(` initial-value: ${e.initialValue};`), t.push("}"), t.join(`
2356
2393
  `);
2357
- }, Ci = (e, t, n) => {
2358
- if (!ht(n))
2394
+ }, zi = (e, t, n) => {
2395
+ if (!Mt(n))
2359
2396
  return null;
2360
- const o = gt(t);
2361
- return o.length === 0 ? null : o.map(bi).join(`
2397
+ const o = Ot(t);
2398
+ return o.length === 0 ? null : o.map(Ui).join(`
2362
2399
 
2363
2400
  `);
2364
- }, wi = /* @__PURE__ */ A({
2401
+ }, Gi = /* @__PURE__ */ S({
2365
2402
  __name: "ProjectCssPropertiesStylesheet",
2366
2403
  props: {
2367
2404
  publishedKey: {},
2368
2405
  cssProperties: {}
2369
2406
  },
2370
2407
  setup(e) {
2371
- const t = e, n = g(
2372
- () => Ci(t.publishedKey, t.cssProperties)
2408
+ const t = e, n = m(
2409
+ () => zi(t.publishedKey, t.cssProperties)
2373
2410
  );
2374
- return (o, s) => n.value ? (f(), C(P("style"), {
2411
+ return (o, s) => n.value ? (p(), v(x("style"), {
2375
2412
  key: 0,
2376
- "data-rulecms-project-css-properties": ""
2377
- }, {
2378
- default: T(() => [
2379
- R(L(n.value), 1)
2380
- ]),
2381
- _: 1
2382
- })) : k("", !0);
2413
+ "data-rulecms-project-css-properties": "",
2414
+ innerHTML: T(_)(n.value)
2415
+ }, null, 8, ["innerHTML"])) : I("", !0);
2383
2416
  }
2384
2417
  });
2385
- function bt(e) {
2418
+ function _t(e) {
2386
2419
  return e !== !1;
2387
2420
  }
2388
- const Ct = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), vi = /[{};]/, Ai = (e) => {
2421
+ const jt = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Yi = /[{};]/, Xi = (e) => {
2389
2422
  if (!e)
2390
2423
  return {};
2391
2424
  const t = {};
2392
2425
  for (const [n, o] of Object.entries(e)) {
2393
- if (!U(n) || typeof o != "string")
2426
+ if (!q(n) || typeof o != "string")
2394
2427
  continue;
2395
2428
  const s = o.trim();
2396
- s === "" || vi.test(s) || (t[n.trim()] = s);
2429
+ s === "" || Yi.test(s) || (t[n.trim()] = s);
2397
2430
  }
2398
2431
  return t;
2399
- }, Si = (e, t, n) => {
2400
- if (!bt(n))
2432
+ }, Ji = (e, t, n) => {
2433
+ if (!_t(n))
2401
2434
  return null;
2402
- const o = Ai(t), s = Object.keys(o);
2435
+ const o = Xi(t), s = Object.keys(o);
2403
2436
  if (s.length === 0 || !e)
2404
2437
  return null;
2405
- const i = `[data-rulecms-published-key="${Ct(e)}"] > *`, r = s.sort((l, u) => l.localeCompare(u)).map((l) => ` ${l}: ${o[l]};`).join(`
2438
+ const i = `[data-rulecms-published-key="${jt(e)}"] > *`, l = s.sort((r, d) => r.localeCompare(d)).map((r) => ` ${r}: ${o[r]};`).join(`
2406
2439
  `);
2407
2440
  return `${i} {
2408
- ${r}
2441
+ ${l}
2409
2442
  }`;
2410
2443
  };
2411
- function wt(e) {
2444
+ function Nt(e) {
2412
2445
  return e !== !1;
2413
2446
  }
2414
- const Ei = 5, ki = 200, Ti = [
2447
+ const qi = 5, Zi = 200, Qi = [
2415
2448
  { kind: "prefers-color-scheme", value: "dark" },
2416
2449
  { kind: "prefers-color-scheme", value: "light" },
2417
2450
  { kind: "html-class", value: "dark" },
2418
2451
  { kind: "data-theme", value: "dark" },
2419
2452
  { kind: "data-theme", value: "light" }
2420
- ], Ii = /[{};]/, Pi = (e) => {
2453
+ ], er = /[{};]/, tr = (e) => {
2421
2454
  if (typeof e != "object" || e === null || Array.isArray(e))
2422
2455
  return !1;
2423
2456
  const t = e;
2424
- return Ti.some(
2457
+ return Qi.some(
2425
2458
  (n) => n.kind === t.kind && n.value === t.value
2426
2459
  );
2427
- }, Di = (e) => {
2460
+ }, nr = (e) => {
2428
2461
  if (!e || typeof e != "object" || Array.isArray(e))
2429
2462
  return {};
2430
2463
  const t = {};
2431
2464
  for (const [n, o] of Object.entries(e)) {
2432
- if (!U(n) || typeof o != "string")
2465
+ if (!q(n) || typeof o != "string")
2433
2466
  continue;
2434
2467
  const s = o.trim();
2435
- s === "" || Ii.test(s) || s.includes("url(") || s.includes("@") || (t[n.trim()] = s);
2468
+ s === "" || er.test(s) || s.includes("url(") || s.includes("@") || (t[n.trim()] = s);
2436
2469
  }
2437
2470
  return Object.fromEntries(
2438
2471
  Object.entries(t).sort(([n], [o]) => n.localeCompare(o))
2439
2472
  );
2440
- }, vt = (e) => {
2473
+ }, Wt = (e) => {
2441
2474
  if (!Array.isArray(e))
2442
2475
  return [];
2443
2476
  const t = [], n = /* @__PURE__ */ new Set();
2444
2477
  let o = 0;
2445
2478
  for (const s of e) {
2446
- if (!s || !Pi(s.condition))
2479
+ if (!s || !tr(s.condition))
2447
2480
  continue;
2448
2481
  const i = `${s.condition.kind}:${s.condition.value}`;
2449
2482
  if (n.has(i))
2450
2483
  continue;
2451
- const r = Di(s.variables), l = o + Object.keys(r).length;
2452
- if (!(Object.keys(r).length === 0 || l > ki) && (n.add(i), o = l, t.push({ condition: s.condition, variables: r }), t.length === Ei))
2484
+ const l = nr(s.variables), r = o + Object.keys(l).length;
2485
+ if (!(Object.keys(l).length === 0 || r > Zi) && (n.add(i), o = r, t.push({ condition: s.condition, variables: l }), t.length === qi))
2453
2486
  break;
2454
2487
  }
2455
2488
  return t;
2456
- }, $i = (e, t) => {
2489
+ }, or = (e, t) => {
2457
2490
  const n = Object.entries(e).map(([o, s]) => ` ${o}: ${s};`);
2458
2491
  return `${t} {
2459
2492
  ${n.join(`
2460
2493
  `)}
2461
2494
  }`;
2462
- }, Li = (e) => e.split(`
2495
+ }, sr = (e) => e.split(`
2463
2496
  `).map((t) => ` ${t}`).join(`
2464
- `), xi = (e, t) => {
2465
- const n = $i(e.variables, t), { kind: o, value: s } = e.condition;
2497
+ `), ir = (e, t) => {
2498
+ const n = or(e.variables, t), { kind: o, value: s } = e.condition;
2466
2499
  return o === "prefers-color-scheme" ? `@media (prefers-color-scheme: ${s}) {
2467
- ${Li(n)}
2500
+ ${sr(n)}
2468
2501
  }` : o === "html-class" ? `html.${s} ${n}` : `[data-theme="${s}"] ${n}`;
2469
- }, Ri = (e, t, n) => {
2470
- if (!wt(n) || !e)
2502
+ }, rr = (e, t, n) => {
2503
+ if (!Nt(n) || !e)
2471
2504
  return null;
2472
- const o = vt(t);
2505
+ const o = Wt(t);
2473
2506
  if (o.length === 0)
2474
2507
  return null;
2475
- const s = `[data-rulecms-published-key="${Ct(e)}"] > *`;
2476
- return o.map((i) => xi(i, s)).join(`
2508
+ const s = `[data-rulecms-published-key="${jt(e)}"] > *`;
2509
+ return o.map((i) => ir(i, s)).join(`
2477
2510
 
2478
2511
  `);
2479
- }, Oi = /* @__PURE__ */ A({
2512
+ }, lr = /* @__PURE__ */ S({
2480
2513
  __name: "ProjectCssThemesStylesheet",
2481
2514
  props: {
2482
2515
  publishedKey: {},
2483
2516
  themes: {}
2484
2517
  },
2485
2518
  setup(e) {
2486
- const t = e, n = g(
2487
- () => Ri(t.publishedKey, t.themes)
2519
+ const t = e, n = m(
2520
+ () => rr(t.publishedKey, t.themes)
2488
2521
  );
2489
- return (o, s) => n.value ? (f(), C(P("style"), {
2522
+ return (o, s) => n.value ? (p(), v(x("style"), {
2490
2523
  key: 0,
2491
- "data-rulecms-project-themes": ""
2492
- }, {
2493
- default: T(() => [
2494
- R(L(n.value), 1)
2495
- ]),
2496
- _: 1
2497
- })) : k("", !0);
2524
+ "data-rulecms-project-themes": "",
2525
+ innerHTML: T(_)(n.value)
2526
+ }, null, 8, ["innerHTML"])) : I("", !0);
2498
2527
  }
2499
- }), _i = /* @__PURE__ */ A({
2528
+ }), cr = /* @__PURE__ */ S({
2500
2529
  __name: "ProjectCssVariablesStylesheet",
2501
2530
  props: {
2502
2531
  publishedKey: {},
2503
2532
  variables: {}
2504
2533
  },
2505
2534
  setup(e) {
2506
- const t = e, n = g(
2507
- () => Si(t.publishedKey, t.variables)
2535
+ const t = e, n = m(
2536
+ () => Ji(t.publishedKey, t.variables)
2508
2537
  );
2509
- return (o, s) => n.value ? (f(), C(P("style"), {
2538
+ return (o, s) => n.value ? (p(), v(x("style"), {
2510
2539
  key: 0,
2511
- "data-rulecms-project-css-variables": ""
2512
- }, {
2513
- default: T(() => [
2514
- R(L(n.value), 1)
2515
- ]),
2516
- _: 1
2517
- })) : k("", !0);
2540
+ "data-rulecms-project-css-variables": "",
2541
+ innerHTML: T(_)(n.value)
2542
+ }, null, 8, ["innerHTML"])) : I("", !0);
2518
2543
  }
2519
2544
  });
2520
- function At(e) {
2545
+ function Vt(e) {
2521
2546
  return e !== !1;
2522
2547
  }
2523
- const ji = [
2548
+ const ar = [
2524
2549
  "light",
2525
2550
  "dark",
2526
2551
  "light dark"
2527
- ], Mi = ["auto", "thin", "none"], Ni = new Set(ji), Wi = new Set(Mi), Vi = /[{};]|url\(|@/i, Fi = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !Vi.test(e), q = (e) => Fi(e) ? e.trim() : void 0, St = (e) => {
2552
+ ], ur = ["auto", "thin", "none"], dr = new Set(ar), pr = new Set(ur), fr = /[{};]|url\(|@/i, yr = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !fr.test(e), ce = (e) => yr(e) ? e.trim() : void 0, Ft = (e) => {
2528
2553
  if (!e || typeof e != "object" || Array.isArray(e))
2529
2554
  return null;
2530
- const t = q(e.selectionBackground), n = q(e.selectionColor), o = q(e.caretColor), s = q(e.scrollbarColor), i = {
2531
- ...typeof e.colorScheme == "string" && Ni.has(e.colorScheme) ? { colorScheme: e.colorScheme } : {},
2555
+ const t = ce(e.selectionBackground), n = ce(e.selectionColor), o = ce(e.caretColor), s = ce(e.scrollbarColor), i = {
2556
+ ...typeof e.colorScheme == "string" && dr.has(e.colorScheme) ? { colorScheme: e.colorScheme } : {},
2532
2557
  ...t ? { selectionBackground: t } : {},
2533
2558
  ...n ? { selectionColor: n } : {},
2534
2559
  ...o ? { caretColor: o } : {},
2535
2560
  ...s ? { scrollbarColor: s } : {},
2536
- ...typeof e.scrollbarWidth == "string" && Wi.has(e.scrollbarWidth) ? { scrollbarWidth: e.scrollbarWidth } : {}
2561
+ ...typeof e.scrollbarWidth == "string" && pr.has(e.scrollbarWidth) ? { scrollbarWidth: e.scrollbarWidth } : {}
2537
2562
  };
2538
2563
  return Object.keys(i).length > 0 ? i : null;
2539
- }, Bi = (e, t, n) => {
2540
- if (!At(n) || !e)
2564
+ }, mr = (e, t, n) => {
2565
+ if (!Vt(n) || !e)
2541
2566
  return null;
2542
- const o = St(t);
2567
+ const o = Ft(t);
2543
2568
  if (!o)
2544
2569
  return null;
2545
- const s = `[data-rulecms-published-key="${at(e)}"]`, i = [];
2570
+ const s = `[data-rulecms-published-key="${It(e)}"]`, i = [];
2546
2571
  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};`);
2547
- const r = [];
2548
- o.selectionBackground && r.push(` background: ${o.selectionBackground};`), o.selectionColor && r.push(` color: ${o.selectionColor};`);
2549
2572
  const l = [];
2550
- return i.length > 0 && l.push(`${s} > * {
2573
+ o.selectionBackground && l.push(` background: ${o.selectionBackground};`), o.selectionColor && l.push(` color: ${o.selectionColor};`);
2574
+ const r = [];
2575
+ return i.length > 0 && r.push(`${s} > * {
2551
2576
  ${i.join(`
2552
2577
  `)}
2553
- }`), r.length > 0 && l.push(`${s} > * ::selection {
2554
- ${r.join(`
2578
+ }`), l.length > 0 && r.push(`${s} > * ::selection {
2579
+ ${l.join(`
2555
2580
  `)}
2556
- }`), l.length > 0 ? l.join(`
2581
+ }`), r.length > 0 ? r.join(`
2557
2582
  `) : null;
2558
- }, Ki = /* @__PURE__ */ A({
2583
+ }, hr = /* @__PURE__ */ S({
2559
2584
  __name: "ProjectCssWidgetChromeStylesheet",
2560
2585
  props: {
2561
2586
  publishedKey: {},
2562
2587
  widgetChrome: {}
2563
2588
  },
2564
2589
  setup(e) {
2565
- const t = e, n = g(
2566
- () => Bi(t.publishedKey, t.widgetChrome)
2590
+ const t = e, n = m(
2591
+ () => mr(t.publishedKey, t.widgetChrome)
2567
2592
  );
2568
- return (o, s) => n.value ? (f(), C(P("style"), {
2593
+ return (o, s) => n.value ? (p(), v(x("style"), {
2569
2594
  key: 0,
2570
- "data-rulecms-project-widget-chrome": ""
2571
- }, {
2572
- default: T(() => [
2573
- R(L(n.value), 1)
2574
- ]),
2575
- _: 1
2576
- })) : k("", !0);
2595
+ "data-rulecms-project-widget-chrome": "",
2596
+ innerHTML: T(_)(n.value)
2597
+ }, null, 8, ["innerHTML"])) : I("", !0);
2577
2598
  }
2578
2599
  });
2579
- function zi(e) {
2600
+ function gr(e) {
2580
2601
  return e !== !1;
2581
2602
  }
2582
- function Hi(e) {
2603
+ function br(e) {
2583
2604
  const t = {};
2584
2605
  return Object.entries(e).forEach(([n, o]) => {
2585
2606
  const s = { ...o };
2586
2607
  if (s.itemList)
2587
2608
  try {
2588
2609
  s.collectionRows = typeof s.itemList == "string" ? JSON.parse(s.itemList) : s.itemList;
2589
- } catch (r) {
2590
- console.error(`Failed to parse itemList for collection ${n}:`, r), s.collectionRows = { rows: [] };
2610
+ } catch (l) {
2611
+ console.error(`Failed to parse itemList for collection ${n}:`, l), s.collectionRows = { rows: [] };
2591
2612
  }
2592
2613
  let i = `${s.name}$${n}`;
2593
2614
  s.parentId && (i = `${i}@${s.parentId}`), t[i] = s;
2594
2615
  }), t;
2595
2616
  }
2596
- function Ui(e) {
2617
+ function Cr(e) {
2597
2618
  return typeof e.itemList == "string" ? JSON.parse(e.itemList) : e.itemList;
2598
2619
  }
2599
- function Et(e) {
2600
- const t = ne(e.fontFaces), n = pt(e.keyframes), o = vt(e.themes), s = gt(e.cssProperties), i = St(e.widgetChrome), r = mt(e.positionTry), l = zi(e.includeClassLayer) && ct(e.classLayer) ? e.classLayer : void 0;
2620
+ function je(e) {
2621
+ const t = fe(e.fontFaces), n = xt(e.keyframes), o = Wt(e.themes), s = Ot(e.cssProperties), i = Ft(e.widgetChrome), l = Rt(e.positionTry), r = gr(e.includeClassLayer) && kt(e.classLayer) ? e.classLayer : void 0;
2601
2622
  return {
2602
- displayItemList: Ui(e.widget),
2603
- widgetCollections: Hi(e.childCollections),
2623
+ displayItemList: Cr(e.widget),
2624
+ widgetCollections: br(e.childCollections),
2604
2625
  ...e.libraries ? { libraries: e.libraries } : {},
2605
- ...bt(e.includeCssVariables) && e.cssVariables && Object.keys(e.cssVariables).length > 0 ? { cssVariables: e.cssVariables } : {},
2606
- ...lt(e.includeClassDefinitions) && e.classDefinitions && Object.keys(e.classDefinitions).length > 0 ? { classDefinitions: e.classDefinitions } : {},
2607
- ...Se(e.includeFontFaces) && t.length > 0 ? { fontFaces: t } : {},
2608
- ...ut(e.includeKeyframes) && Object.keys(n).length > 0 ? { keyframes: n } : {},
2609
- ...wt(e.includeThemes) && o.length > 0 ? { themes: o } : {},
2610
- ...ht(e.includeCssProperties) && s.length > 0 ? { cssProperties: s } : {},
2611
- ...At(e.includeWidgetChrome) && i ? { widgetChrome: i } : {},
2612
- ...l ? { classLayer: l } : {},
2613
- ...ft(e.includePositionTry) && Object.keys(r).length > 0 ? { positionTry: r } : {}
2626
+ ..._t(e.includeCssVariables) && e.cssVariables && Object.keys(e.cssVariables).length > 0 ? { cssVariables: e.cssVariables } : {},
2627
+ ...St(e.includeClassDefinitions) && e.classDefinitions && Object.keys(e.classDefinitions).length > 0 ? { classDefinitions: e.classDefinitions } : {},
2628
+ ..._e(e.includeFontFaces) && t.length > 0 ? { fontFaces: t } : {},
2629
+ ...Pt(e.includeKeyframes) && Object.keys(n).length > 0 ? { keyframes: n } : {},
2630
+ ...Nt(e.includeThemes) && o.length > 0 ? { themes: o } : {},
2631
+ ...Mt(e.includeCssProperties) && s.length > 0 ? { cssProperties: s } : {},
2632
+ ...Vt(e.includeWidgetChrome) && i ? { widgetChrome: i } : {},
2633
+ ...r ? { classLayer: r } : {},
2634
+ ...Lt(e.includePositionTry) && Object.keys(l).length > 0 ? { positionTry: l } : {}
2614
2635
  };
2615
2636
  }
2616
- function Yi(e) {
2617
- const t = e.registry ?? te(), n = ye({
2637
+ function wr(e) {
2638
+ const t = e.registry ?? de(), n = Pe({
2618
2639
  displayItemList: e.displayItemList,
2619
2640
  widgetCollections: e.widgetCollections
2620
2641
  });
2621
2642
  return t.resolveSync({ registrations: e.libraries, referenced: n });
2622
2643
  }
2623
- function Gi(e) {
2624
- const t = e.registry ?? te(), n = ye({
2644
+ function vr(e) {
2645
+ const t = e.registry ?? de(), n = Pe({
2625
2646
  displayItemList: e.displayItemList,
2626
2647
  widgetCollections: e.widgetCollections
2627
2648
  });
2628
2649
  return t.resolve({ registrations: e.libraries, referenced: n });
2629
2650
  }
2630
- const Xi = {
2651
+ function Ar(e) {
2652
+ const t = e.lastIndexOf(Ae);
2653
+ return t === -1 ? e : e.slice(t + Ae.length);
2654
+ }
2655
+ const Tr = "text/plain";
2656
+ function Er({
2657
+ token: e,
2658
+ rulesetPublishedKey: t,
2659
+ params: n
2660
+ }) {
2661
+ return F(e) ? {
2662
+ token: e,
2663
+ rulesetKey: Ar(t),
2664
+ ...n ? { params: n } : {}
2665
+ } : {
2666
+ token: e,
2667
+ rulesetPublishedKey: t,
2668
+ ...n ? { params: n } : {},
2669
+ mode: "payload"
2670
+ };
2671
+ }
2672
+ function Bt({
2673
+ contentType: e = Tr,
2674
+ ...t
2675
+ }) {
2676
+ return {
2677
+ method: "POST",
2678
+ headers: { "Content-Type": e },
2679
+ body: JSON.stringify(Er(t))
2680
+ };
2681
+ }
2682
+ const qe = "rulecms_anon_id";
2683
+ function Ze() {
2684
+ return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
2685
+ const t = Math.random() * 16 | 0;
2686
+ return (e === "x" ? t : t & 3 | 8).toString(16);
2687
+ });
2688
+ }
2689
+ function Sr() {
2690
+ if (!(typeof window > "u"))
2691
+ try {
2692
+ const e = window.localStorage.getItem(qe);
2693
+ if (e)
2694
+ return e;
2695
+ const t = Ze();
2696
+ return window.localStorage.setItem(qe, t), t;
2697
+ } catch {
2698
+ return Ze();
2699
+ }
2700
+ }
2701
+ function Kt(e) {
2702
+ return e >= 500;
2703
+ }
2704
+ function kr(e) {
2705
+ if (!(e != null && e.success) || !e.data)
2706
+ return null;
2707
+ const { selection: t, ...n } = e.data;
2708
+ return { raw: n, selection: t };
2709
+ }
2710
+ function Ir(e, t) {
2711
+ if (!(e != null && e.resolution) || !e.widget)
2712
+ return null;
2713
+ const { resolution: n, ...o } = e, s = {
2714
+ rulesetPublishedKey: t,
2715
+ outcome: n.outcome,
2716
+ ruleId: n.ruleId ?? null,
2717
+ variantId: n.variantId ?? null,
2718
+ widgetKey: n.widgetKey,
2719
+ widgetPublishedKey: n.widgetPublishedKey
2720
+ };
2721
+ return { raw: o, selection: s };
2722
+ }
2723
+ function Ht({
2724
+ token: e,
2725
+ rulesetPublishedKey: t,
2726
+ body: n
2727
+ }) {
2728
+ return F(e) ? Ir(n, t) : kr(n);
2729
+ }
2730
+ function Pr(e) {
2731
+ return JSON.stringify(e, (t, n) => {
2732
+ if (n === null || typeof n != "object" || Array.isArray(n))
2733
+ return n;
2734
+ const o = {};
2735
+ for (const s of Object.keys(n).sort())
2736
+ o[s] = n[s];
2737
+ return o;
2738
+ });
2739
+ }
2740
+ const Dr = {
2631
2741
  display: "flex",
2632
2742
  justifyContent: "center",
2633
2743
  alignItems: "center",
2634
2744
  padding: "3rem",
2635
2745
  color: "#e2e8f0"
2636
- }, Ji = {
2746
+ }, xr = {
2637
2747
  display: "flex",
2638
2748
  alignItems: "center",
2639
2749
  gap: "1rem"
2640
- }, Zi = {
2750
+ }, Lr = {
2641
2751
  width: "40px",
2642
2752
  height: "40px",
2643
2753
  border: "4px solid #4a5568",
2644
2754
  borderTopColor: "#63b3ed",
2645
2755
  borderRadius: "50%",
2646
2756
  animation: "spin 1s linear infinite"
2647
- }, We = {
2757
+ }, Qe = {
2648
2758
  padding: "1.5rem",
2649
2759
  backgroundColor: "#742a2a",
2650
2760
  border: "1px solid #9b2c2c",
2651
2761
  borderRadius: "8px",
2652
2762
  color: "#fed7d7"
2653
- }, Ve = {
2763
+ }, et = {
2654
2764
  fontSize: "16px",
2655
2765
  fontWeight: "600",
2656
2766
  marginBottom: "0.5rem",
2657
2767
  color: "#feb2b2"
2658
- }, Fe = {
2768
+ }, tt = {
2659
2769
  fontSize: "14px",
2660
2770
  color: "#fed7d7"
2661
- }, qi = `
2771
+ }, $r = `
2662
2772
  @keyframes spin {
2663
2773
  from {
2664
2774
  transform: rotate(0deg);
@@ -2667,109 +2777,176 @@ const Xi = {
2667
2777
  transform: rotate(360deg);
2668
2778
  }
2669
2779
  }
2670
- `, hr = "data-rulecms-published-key", Qi = ["data-rulecms-published-key"], gr = /* @__PURE__ */ A({
2780
+ `, Qr = "data-rulecms-published-key", Rr = ["data-rulecms-published-key"], el = /* @__PURE__ */ S({
2671
2781
  __name: "RuleCMSWidget",
2672
2782
  props: {
2673
2783
  publishedKey: {},
2784
+ rulesetPublishedKey: {},
2785
+ params: {},
2786
+ anonymousId: { type: [String, Boolean], default: void 0 },
2787
+ fallbackPublishedKey: {},
2788
+ contentType: {},
2674
2789
  token: {},
2675
2790
  endpoint: {},
2676
2791
  mode: { default: "client-fetch" },
2677
2792
  initialData: {},
2678
2793
  libraries: {},
2679
2794
  componentProps: {},
2680
- mounts: {}
2795
+ mounts: {},
2796
+ placeholderValues: {},
2797
+ onSelection: {}
2681
2798
  },
2682
2799
  setup(e) {
2683
- const t = e, n = xt(Je, null), o = Y(!1), s = Y(null), i = Y(null), r = Y(null), l = g(() => t.mode === "pre-fetched"), u = g(() => ({
2684
- sourceComponents: r.value ?? void 0
2685
- }));
2686
- let c = null, a = null, p = !1;
2687
- function y() {
2800
+ const t = e, n = tn(ft, null), o = H(!0), s = H(null), i = H(null), l = H(null), r = H(null), d = H(""), a = m(() => t.mode === "pre-fetched"), c = m(() => ({
2801
+ sourceComponents: l.value ?? void 0
2802
+ })), f = m(() => t.publishedKey || d.value);
2803
+ let h = null, u = null, y = !1, b = 0;
2804
+ function C() {
2688
2805
  if (!i.value) {
2689
- r.value = null;
2806
+ l.value = null;
2690
2807
  return;
2691
2808
  }
2692
- const w = t.libraries ?? (n == null ? void 0 : n.libraries), D = n == null ? void 0 : n.libraryRegistry, O = Yi({
2809
+ const P = t.libraries ?? (n == null ? void 0 : n.libraries), L = n == null ? void 0 : n.libraryRegistry, W = wr({
2693
2810
  displayItemList: i.value.displayItemList,
2694
2811
  widgetCollections: i.value.widgetCollections,
2695
- libraries: w,
2696
- registry: D
2812
+ libraries: P,
2813
+ registry: L
2697
2814
  });
2698
- if (O) {
2699
- r.value = O;
2815
+ if (W) {
2816
+ l.value = W;
2700
2817
  return;
2701
2818
  }
2702
- Gi({
2819
+ vr({
2703
2820
  displayItemList: i.value.displayItemList,
2704
2821
  widgetCollections: i.value.widgetCollections,
2705
- libraries: w,
2706
- registry: D
2707
- }).then((B) => {
2708
- r.value = B;
2822
+ libraries: P,
2823
+ registry: L
2824
+ }).then((M) => {
2825
+ l.value = M;
2709
2826
  });
2710
2827
  }
2711
- function d() {
2712
- i.value && _o({
2828
+ function g() {
2829
+ i.value && rs({
2713
2830
  componentProps: t.componentProps,
2714
2831
  displayItemList: i.value.displayItemList,
2715
2832
  widgetCollections: i.value.widgetCollections,
2716
- publishedKey: t.publishedKey
2833
+ publishedKey: f.value
2717
2834
  });
2718
2835
  }
2719
- function h() {
2720
- if (p || typeof document > "u")
2836
+ function Z() {
2837
+ if (y || typeof document > "u")
2721
2838
  return;
2722
- const w = "rulecms-widget-spinner-styles";
2723
- if (!document.getElementById(w)) {
2724
- const D = document.createElement("style");
2725
- D.id = w, D.textContent = qi, document.head.appendChild(D);
2839
+ const P = "rulecms-widget-spinner-styles";
2840
+ if (!document.getElementById(P)) {
2841
+ const L = document.createElement("style");
2842
+ L.id = P, L.textContent = $r, document.head.appendChild(L);
2726
2843
  }
2727
- p = !0;
2844
+ y = !0;
2728
2845
  }
2729
- function m() {
2730
- const w = t.token ?? (n == null ? void 0 : n.token), D = t.endpoint ?? (n == null ? void 0 : n.endpoint);
2731
- if (!t.publishedKey || !w) {
2732
- s.value = t.publishedKey ? "Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider." : K(w) ? "Widget key is required" : "Published key is required", i.value = null;
2846
+ function ye() {
2847
+ const P = t.token ?? (n == null ? void 0 : n.token), L = t.endpoint ?? (n == null ? void 0 : n.endpoint), W = F(P), M = t.rulesetPublishedKey;
2848
+ if (!t.publishedKey && !M || !P) {
2849
+ !t.publishedKey && !M ? s.value = M !== void 0 ? W ? "Ruleset key is required" : "Ruleset published key is required" : W ? "Widget key is required" : "Published key is required" : s.value = "Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider.", i.value = null, o.value = !1;
2733
2850
  return;
2734
2851
  }
2735
- const O = `${t.publishedKey}|${w}`;
2736
- if (a === O && i.value) {
2737
- y();
2852
+ const G = Pr(t.params), ee = JSON.stringify({
2853
+ publishedKey: t.publishedKey,
2854
+ rulesetPublishedKey: M,
2855
+ token: P,
2856
+ endpoint: L,
2857
+ paramsKey: G,
2858
+ anonymousId: t.anonymousId,
2859
+ fallbackPublishedKey: t.fallbackPublishedKey,
2860
+ contentType: t.contentType
2861
+ });
2862
+ if (u === ee && i.value) {
2863
+ o.value = !1, C();
2738
2864
  return;
2739
2865
  }
2740
- c == null || c.abort(), c = new AbortController();
2741
- const B = c.signal;
2742
- a = O, o.value = !0, s.value = null;
2743
- const J = Ye({ publishedKey: t.publishedKey, token: w, endpoint: D });
2744
- fetch(J, {
2745
- method: "GET",
2746
- headers: { "Content-Type": "application/json" },
2747
- ...K(w) ? { cache: "no-store" } : {},
2748
- signal: B
2749
- }).then(async (x) => {
2750
- if (x.ok) {
2751
- const W = await x.json();
2752
- W.success ? (i.value = Et(W.data), s.value = null, y(), d()) : (s.value = "Failed to fetch widget data", i.value = null);
2753
- } else {
2754
- const W = await x.json().catch(() => ({ error: "Unknown error" }));
2755
- s.value = W.error || `Request failed with status ${x.status}`, i.value = null;
2866
+ h == null || h.abort(), h = new AbortController();
2867
+ const te = h.signal;
2868
+ u = ee, o.value = !0, s.value = null;
2869
+ const ie = ++b, ne = async (A) => (await A.json().catch(() => ({ error: "Unknown error" }))).error || `Request failed with status ${A.status}`, Y = async (A) => {
2870
+ const O = at({ publishedKey: A, token: P, endpoint: L }), j = await fetch(O, {
2871
+ method: "GET",
2872
+ ...W ? { cache: "no-store" } : {},
2873
+ signal: te
2874
+ });
2875
+ if (!j.ok)
2876
+ throw new Q(await ne(j));
2877
+ const $ = await j.json();
2878
+ if (!$.success)
2879
+ throw new Q("Failed to fetch widget data");
2880
+ return $.data;
2881
+ };
2882
+ (M ? (async () => {
2883
+ const A = G ? JSON.parse(G) : {};
2884
+ if (t.anonymousId !== !1) {
2885
+ if (typeof t.anonymousId == "string")
2886
+ A.anonId = A.anonId ?? t.anonymousId;
2887
+ else if (A.anonId == null) {
2888
+ const $ = Sr();
2889
+ $ && (A.anonId = $);
2890
+ }
2891
+ }
2892
+ let O;
2893
+ try {
2894
+ O = await fetch(ut({ token: P, endpoint: L }), {
2895
+ ...Bt({
2896
+ token: P,
2897
+ rulesetPublishedKey: M,
2898
+ params: A,
2899
+ contentType: t.contentType
2900
+ }),
2901
+ signal: te
2902
+ });
2903
+ } catch ($) {
2904
+ if ($ instanceof DOMException && $.name === "AbortError")
2905
+ throw $;
2906
+ if (t.fallbackPublishedKey)
2907
+ return { raw: await Y(t.fallbackPublishedKey), selection: null };
2908
+ throw $;
2756
2909
  }
2757
- }).catch((x) => {
2758
- x instanceof DOMException && x.name === "AbortError" || (console.error("Error fetching widget:", x), s.value = "Failed to fetch widget", i.value = null);
2910
+ if (!O.ok) {
2911
+ if (t.fallbackPublishedKey && Kt(O.status))
2912
+ return { raw: await Y(t.fallbackPublishedKey), selection: null };
2913
+ throw new Q(await ne(O));
2914
+ }
2915
+ const j = Ht({
2916
+ token: P,
2917
+ rulesetPublishedKey: M,
2918
+ body: await O.json()
2919
+ });
2920
+ if (!j)
2921
+ throw new Q("Failed to fetch widget data");
2922
+ return { raw: j.raw, selection: j.selection };
2923
+ })() : Y(t.publishedKey).then((A) => ({
2924
+ raw: A,
2925
+ selection: null
2926
+ }))).then(({ raw: A, selection: O }) => {
2927
+ var j, $;
2928
+ i.value = je(A), d.value = ((j = A.widget) == null ? void 0 : j.publishedKey) ?? "", r.value = O, s.value = null, C(), g(), O && (($ = t.onSelection) == null || $.call(t, O));
2929
+ }).catch((A) => {
2930
+ A instanceof DOMException && A.name === "AbortError" || (console.error("Error fetching widget:", A), s.value = A instanceof Q ? A.message : "Failed to fetch widget", i.value = null, r.value = null);
2759
2931
  }).finally(() => {
2760
- o.value = !1;
2932
+ b === ie && (o.value = !1);
2761
2933
  });
2762
2934
  }
2763
- function S() {
2935
+ function Gt() {
2764
2936
  if (t.mode === "pre-fetched") {
2765
- i.value = t.initialData ?? null, o.value = !1, s.value = null, y(), d();
2937
+ i.value = t.initialData ?? null, o.value = !1, s.value = null, C(), g();
2766
2938
  return;
2767
2939
  }
2768
- h(), m();
2940
+ Z(), ye();
2769
2941
  }
2770
- return Be(
2942
+ ot(
2771
2943
  () => [
2772
2944
  t.publishedKey,
2945
+ t.rulesetPublishedKey,
2946
+ t.params,
2947
+ t.anonymousId,
2948
+ t.fallbackPublishedKey,
2949
+ t.contentType,
2773
2950
  t.token,
2774
2951
  t.endpoint,
2775
2952
  t.mode,
@@ -2778,90 +2955,97 @@ const Xi = {
2778
2955
  t.componentProps
2779
2956
  ],
2780
2957
  () => {
2781
- S();
2958
+ Gt();
2782
2959
  },
2783
2960
  { immediate: !0 }
2784
- ), Ke(() => {
2785
- c == null || c.abort();
2786
- }), (w, D) => {
2787
- var O, B, J, x, W, Ee, ke, Te, Ie;
2788
- return f(), b("span", {
2789
- "data-rulecms-published-key": e.publishedKey,
2961
+ ), st(() => {
2962
+ h == null || h.abort();
2963
+ });
2964
+ class Q extends Error {
2965
+ constructor(L) {
2966
+ super(L), this.name = "FetchWidgetMessage";
2967
+ }
2968
+ }
2969
+ return (P, L) => {
2970
+ var W, M, G, ee, te, ie, ne, Y, me;
2971
+ return p(), w("span", {
2972
+ "data-rulecms-published-key": f.value,
2790
2973
  style: { display: "contents" }
2791
2974
  }, [
2792
- $(Vs, {
2793
- "published-key": e.publishedKey,
2794
- fonts: (O = i.value) == null ? void 0 : O.fontFaces
2975
+ R(fi, {
2976
+ "published-key": f.value,
2977
+ fonts: (W = i.value) == null ? void 0 : W.fontFaces
2795
2978
  }, null, 8, ["published-key", "fonts"]),
2796
- $(Qs, {
2797
- "published-key": e.publishedKey,
2798
- keyframes: (B = i.value) == null ? void 0 : B.keyframes
2979
+ R(ki, {
2980
+ "published-key": f.value,
2981
+ keyframes: (M = i.value) == null ? void 0 : M.keyframes
2799
2982
  }, null, 8, ["published-key", "keyframes"]),
2800
- $(Oi, {
2801
- "published-key": e.publishedKey,
2802
- themes: (J = i.value) == null ? void 0 : J.themes
2983
+ R(lr, {
2984
+ "published-key": f.value,
2985
+ themes: (G = i.value) == null ? void 0 : G.themes
2803
2986
  }, null, 8, ["published-key", "themes"]),
2804
- $(wi, {
2805
- "published-key": e.publishedKey,
2806
- "css-properties": (x = i.value) == null ? void 0 : x.cssProperties
2987
+ R(Gi, {
2988
+ "published-key": f.value,
2989
+ "css-properties": (ee = i.value) == null ? void 0 : ee.cssProperties
2807
2990
  }, null, 8, ["published-key", "css-properties"]),
2808
- $(Ki, {
2809
- "published-key": e.publishedKey,
2810
- "widget-chrome": (W = i.value) == null ? void 0 : W.widgetChrome
2991
+ R(hr, {
2992
+ "published-key": f.value,
2993
+ "widget-chrome": (te = i.value) == null ? void 0 : te.widgetChrome
2811
2994
  }, null, 8, ["published-key", "widget-chrome"]),
2812
- $(ui, {
2813
- "published-key": e.publishedKey,
2814
- "position-try": (Ee = i.value) == null ? void 0 : Ee.positionTry
2995
+ R(ji, {
2996
+ "published-key": f.value,
2997
+ "position-try": (ie = i.value) == null ? void 0 : ie.positionTry
2815
2998
  }, null, 8, ["published-key", "position-try"]),
2816
- $(_i, {
2817
- "published-key": e.publishedKey,
2818
- variables: (ke = i.value) == null ? void 0 : ke.cssVariables
2999
+ R(cr, {
3000
+ "published-key": f.value,
3001
+ variables: (ne = i.value) == null ? void 0 : ne.cssVariables
2819
3002
  }, null, 8, ["published-key", "variables"]),
2820
- $(Cs, {
2821
- "published-key": e.publishedKey,
2822
- classes: (Te = i.value) == null ? void 0 : Te.classDefinitions,
2823
- "class-layer": (Ie = i.value) == null ? void 0 : Ie.classLayer
3003
+ R(zs, {
3004
+ "published-key": f.value,
3005
+ classes: (Y = i.value) == null ? void 0 : Y.classDefinitions,
3006
+ "class-layer": (me = i.value) == null ? void 0 : me.classLayer
2824
3007
  }, null, 8, ["published-key", "classes", "class-layer"]),
2825
- e.mode !== "pre-fetched" && o.value ? (f(), b("div", {
3008
+ e.mode !== "pre-fetched" && o.value ? (p(), w("div", {
2826
3009
  key: 0,
2827
- style: I(j(Xi))
3010
+ style: D(T(Dr))
2828
3011
  }, [
2829
- V("div", {
2830
- style: I(j(Ji))
3012
+ K("div", {
3013
+ style: D(T(xr))
2831
3014
  }, [
2832
- V("div", {
2833
- style: I(j(Zi))
3015
+ K("div", {
3016
+ style: D(T(Lr))
2834
3017
  }, null, 4)
2835
3018
  ], 4)
2836
- ], 4)) : e.mode !== "pre-fetched" && s.value ? (f(), b("div", {
3019
+ ], 4)) : e.mode !== "pre-fetched" && s.value ? (p(), w("div", {
2837
3020
  key: 1,
2838
- style: I(j(We))
3021
+ style: D(T(Qe))
2839
3022
  }, [
2840
- V("div", {
2841
- style: I(j(Ve))
3023
+ K("div", {
3024
+ style: D(T(et))
2842
3025
  }, "Error Loading Widget", 4),
2843
- V("div", {
2844
- style: I(j(Fe))
2845
- }, L(s.value), 5)
2846
- ], 4)) : e.mode !== "pre-fetched" && !i.value ? (f(), b("div", {
3026
+ K("div", {
3027
+ style: D(T(tt))
3028
+ }, nn(s.value), 5)
3029
+ ], 4)) : e.mode !== "pre-fetched" && !i.value ? (p(), w("div", {
2847
3030
  key: 2,
2848
- style: I(j(We))
3031
+ style: D(T(Qe))
2849
3032
  }, [
2850
- V("div", {
2851
- style: I(j(Ve))
3033
+ K("div", {
3034
+ style: D(T(et))
2852
3035
  }, "No Widget Data", 4),
2853
- V("div", {
2854
- style: I(j(Fe))
3036
+ K("div", {
3037
+ style: D(T(tt))
2855
3038
  }, "No widget data available", 4)
2856
- ], 4)) : r.value && i.value ? (f(), b(E, { key: 3 }, [
2857
- l.value ? (f(), C(qo, {
3039
+ ], 4)) : l.value && i.value ? (p(), w(k, { key: 3 }, [
3040
+ a.value ? (p(), v(Ss, {
2858
3041
  key: 0,
2859
3042
  "display-item-list": i.value.displayItemList,
2860
3043
  "widget-collections": i.value.widgetCollections,
2861
- plugins: u.value,
3044
+ plugins: c.value,
2862
3045
  "component-props": e.componentProps,
2863
- mounts: e.mounts
2864
- }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts"])) : (f(), C(ns, {
3046
+ mounts: e.mounts,
3047
+ "placeholder-values": e.placeholderValues
3048
+ }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts", "placeholder-values"])) : (p(), v(Ds, {
2865
3049
  key: 1,
2866
3050
  "display-item-list": i.value.displayItemList,
2867
3051
  "is-compose-mode": !1,
@@ -2869,203 +3053,288 @@ const Xi = {
2869
3053
  "widget-collections": i.value.widgetCollections,
2870
3054
  "show-drop-containers": !1,
2871
3055
  "redux-device-display-type": "desktop",
2872
- plugins: u.value,
3056
+ plugins: c.value,
2873
3057
  "component-props": e.componentProps,
2874
- mounts: e.mounts
2875
- }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts"]))
2876
- ], 64)) : k("", !0)
2877
- ], 8, Qi);
3058
+ mounts: e.mounts,
3059
+ "placeholder-values": e.placeholderValues
3060
+ }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts", "placeholder-values"]))
3061
+ ], 64)) : I("", !0)
3062
+ ], 8, Rr);
2878
3063
  };
2879
3064
  }
2880
- });
2881
- class Q extends Error {
3065
+ }), Mr = 6e4;
3066
+ class z extends Error {
2882
3067
  constructor(n, o) {
2883
3068
  super(n);
2884
- Pe(this, "status");
3069
+ Ne(this, "status");
2885
3070
  this.name = "FetchRuleCMSWidgetError", this.status = o;
2886
3071
  }
2887
3072
  }
2888
- async function br(e) {
2889
- const { publishedKey: t, token: n, endpoint: o, fetchOptions: s } = e;
2890
- if (!t)
2891
- throw new Q(
2892
- K(n) ? "Widget key is required" : "Published key is required"
2893
- );
2894
- if (!n)
2895
- throw new Q("Token is required");
2896
- const i = Ye({ publishedKey: t, token: n, endpoint: o }), r = await fetch(i, {
3073
+ const ue = /* @__PURE__ */ new Map();
3074
+ function tl() {
3075
+ ue.clear();
3076
+ }
3077
+ function nt(e) {
3078
+ const t = e == null ? void 0 : e.cache;
3079
+ return t === "no-store" || t === "reload" || t === "no-cache";
3080
+ }
3081
+ function Or(e, t) {
3082
+ const n = ue.get(e);
3083
+ if (n) {
3084
+ if (n.expiresAt <= t) {
3085
+ ue.delete(e);
3086
+ return;
3087
+ }
3088
+ return n.data;
3089
+ }
3090
+ }
3091
+ async function Ut(e) {
3092
+ return (await e.json().catch(() => ({ error: "Unknown error" }))).error || `Request failed with status ${e.status}`;
3093
+ }
3094
+ async function zt({
3095
+ publishedKey: e,
3096
+ token: t,
3097
+ endpoint: n,
3098
+ fetchOptions: o
3099
+ }) {
3100
+ const s = at({ publishedKey: e, token: t, endpoint: n }), i = F(t), l = Date.now();
3101
+ if (!i && !nt(o)) {
3102
+ const c = Or(s, l);
3103
+ if (c)
3104
+ return c;
3105
+ }
3106
+ const r = await fetch(s, {
2897
3107
  method: "GET",
2898
- headers: { "Content-Type": "application/json" },
2899
- ...K(n) ? { cache: "no-store" } : {},
2900
- ...s
3108
+ ...i ? { cache: "no-store" } : {},
3109
+ ...o
2901
3110
  });
2902
- if (!r.ok) {
2903
- const u = await r.json().catch(() => ({ error: "Unknown error" }));
2904
- throw new Q(
2905
- u.error || `Request failed with status ${r.status}`,
2906
- r.status
3111
+ if (!r.ok)
3112
+ throw new z(await Ut(r), r.status);
3113
+ const d = await r.json();
3114
+ if (!d.success)
3115
+ throw new z("Failed to fetch widget data");
3116
+ const a = je(d.data);
3117
+ return !i && !nt(o) && ue.set(s, {
3118
+ expiresAt: l + Mr,
3119
+ data: a
3120
+ }), a;
3121
+ }
3122
+ async function _r(e) {
3123
+ const { rulesetPublishedKey: t, params: n, fallbackPublishedKey: o, contentType: s, token: i, endpoint: l, fetchOptions: r } = e, d = () => zt({
3124
+ publishedKey: o,
3125
+ token: i,
3126
+ endpoint: l,
3127
+ fetchOptions: r
3128
+ });
3129
+ let a;
3130
+ try {
3131
+ a = await fetch(ut({ token: i, endpoint: l }), {
3132
+ ...Bt({
3133
+ token: i,
3134
+ rulesetPublishedKey: t,
3135
+ params: n,
3136
+ contentType: s
3137
+ }),
3138
+ ...r
3139
+ });
3140
+ } catch (f) {
3141
+ if (o)
3142
+ return d();
3143
+ throw f;
3144
+ }
3145
+ if (!a.ok) {
3146
+ if (o && Kt(a.status))
3147
+ return d();
3148
+ throw new z(await Ut(a), a.status);
3149
+ }
3150
+ const c = Ht({
3151
+ token: i,
3152
+ rulesetPublishedKey: t,
3153
+ body: await a.json()
3154
+ });
3155
+ if (!c)
3156
+ throw new z("Failed to fetch widget data");
3157
+ return { ...je(c.raw), selection: c.selection };
3158
+ }
3159
+ async function nl(e) {
3160
+ const { publishedKey: t, rulesetPublishedKey: n, token: o } = e;
3161
+ if (!t && !n) {
3162
+ const s = F(o);
3163
+ throw n !== void 0 ? new z(
3164
+ s ? "Ruleset key is required" : "Ruleset published key is required"
3165
+ ) : new z(
3166
+ s ? "Widget key is required" : "Published key is required"
2907
3167
  );
2908
3168
  }
2909
- const l = await r.json();
2910
- if (!l.success)
2911
- throw new Q("Failed to fetch widget data");
2912
- return Et(l.data);
3169
+ if (!o)
3170
+ throw new z("Token is required");
3171
+ return e.rulesetPublishedKey ? _r(e) : zt(e);
2913
3172
  }
2914
- async function Cr(e) {
2915
- const { data: t, libraries: n } = e, o = ye({
3173
+ async function ol(e) {
3174
+ const { data: t, libraries: n } = e, o = Pe({
2916
3175
  displayItemList: t.displayItemList,
2917
3176
  widgetCollections: t.widgetCollections
2918
3177
  });
2919
- return te().resolve({ registrations: n, referenced: o });
3178
+ return de().resolve({ registrations: n, referenced: o });
2920
3179
  }
2921
3180
  export {
2922
- or as AlignContentTypes,
2923
- qo as BreakpointVariantRender,
2924
- Ue as COLLECTION_TYPE_PREFIX,
2925
- Ae as COMPONENT_PROPS_PATH_SEPARATOR,
2926
- Ce as CSS_CLASSES_ATTRIBUTE_NAME,
2927
- bn as CSS_VARIABLE_NAME_MAX_LENGTH,
2928
- gn as CSS_VARIABLE_NAME_PATTERN,
2929
- nt as DEFAULT_BASE_Z_INDEX,
2930
- qt as DEFAULT_CLOUDINARY_CLOUD_NAME,
2931
- X as DEFAULT_LIBRARY_ID,
2932
- yo as DEFAULT_ROW_GAP,
2933
- Mt as DEV_CLIENT_TOKEN_PREFIX,
2934
- Ft as DEV_WIDGET_API_PATH,
2935
- sr as DeviceDisplayTypes,
2936
- Me as DisplayComponent,
2937
- fe as DisplayItemTypes,
2938
- He as DragItemIdPrefixTypes,
2939
- Gt as EMBEDDED_KEY_SEPARATOR,
2940
- Fn as FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY,
2941
- Q as FetchRuleCMSWidgetError,
2942
- Qe as HIDE_WIDGET_ATTRIBUTE_NAME,
2943
- xe as JustifyContentTypes,
2944
- wo as POINTER_EVENTS_ATTRIBUTE_NAME,
2945
- Yt as PUBLISHED_KEY_SEPARATOR,
2946
- Vt as PUBLISHED_WIDGET_API_PATH,
2947
- nr as PageViewTypes,
2948
- Nt as RULECMS_API_ORIGIN,
2949
- hr as RULECMS_PUBLISHED_KEY_ATTRIBUTE,
2950
- Je as RULECMS_WIDGET_CONTEXT_KEY,
2951
- ns as RenderComponents,
2952
- ue as RenderComponentsForDevice,
2953
- Zo as RenderComponentsInner,
2954
- gr as RuleCMSWidget,
2955
- pr as RuleCMSWidgetProvider,
2956
- vo as WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE,
2957
- Wt as WIDGET_CACHE_API_ORIGIN,
2958
- Eo as Z_INDEX_WIDGET_ATTRIBUTE_NAME,
2959
- jn as alignContentAllowlist,
2960
- On as alignItemsAllowlist,
2961
- Wn as backgroundPositionAllowlist,
2962
- Vn as backgroundRepeatAllowlist,
2963
- Nn as backgroundSizeAllowlist,
2964
- Bn as borderStyleKeywords,
2965
- vn as boxSpacingSideKeys,
2966
- mr as boxSpacingStyleAttributeEntries,
2967
- hn as buildCloudinaryBackgroundUrl,
2968
- $o as buildOverlayLayerBoxStyles,
2969
- Do as buildOverlayStackStyles,
2970
- Ye as buildWidgetFetchUrl,
2971
- xo as collectComponentInstancePaths,
2972
- ye as collectReferencedLibraryIds,
2973
- jt as composeSourceComponentsPlugin,
2974
- te as createComponentLibraryRegistry,
2975
- ce as cssAttrArrayKey,
2976
- Zt as defaultPageWidth,
2977
- ao as deriveDisplayFlexIfNeeded,
2978
- fr as desktopModeWidth,
2979
- br as fetchRuleCMSWidget,
2980
- Oo as findUnmatchedComponentPropsKeys,
2981
- Mn as flexDirectionAllowlist,
2982
- _n as flexWrapAllowlist,
2983
- Tn as fontFamilyAllowlist,
2984
- Pn as fontStyleAllowlist,
2985
- In as fontWeightAllowlist,
2986
- Zn as formatBackgroundImageStyles,
2987
- qn as formatBorderStyles,
2988
- Qn as formatBoxShadowStyles,
2989
- to as formatBoxSpacingStyles,
2990
- no as formatCssColorStyles,
2991
- ge as formatCssColorValue,
2992
- oo as formatCssEnumStyles,
2993
- so as formatCssLengthStyles,
2994
- _ as formatCssVariable,
2995
- yr as formatCssVariableStyles,
2996
- io as formatLineHeightStyles,
2997
- lo as formatObjectStyleAttribute,
2998
- ro as formatOpacityStyles,
2999
- H as formatSpacingSideValue,
3000
- Xt as generatePublishedKey,
3001
- ur as generatePublishedKeyForEmbedded,
3002
- Xe as getCollectionIdForCollectionType,
3003
- ee as getColumnAttributes,
3004
- Re as getComponentAttributesAndStyles,
3005
- le as getComponentsPluginFromPlugins,
3006
- v as getCssVariableFromLeaf,
3007
- uo as getDefaultDimensionAttributes,
3008
- N as getDeviceTypeBasedAttributes,
3009
- ir as getDragItemId,
3010
- Kt as getDragItemPrefixAndId,
3011
- zt as getIdAndPrefix,
3012
- po as getMergedAttributes,
3013
- rr as getNameAndInstanceIdFromWidgetKey,
3014
- lr as getNameFromWidgetKey,
3015
- To as getOverlayLayerZIndex,
3016
- Ht as getWidgetKeyForCollection,
3017
- cr as getWidgetKeyForCollectionWithPrefix,
3018
- Ut as getWidgetKeyForPublishedCollection,
3019
- ar as getWidgetKeyForPublishedCollectionWithPrefix,
3020
- Gn as hasBoxShadowLeaf,
3021
- No as hasDeviceDivergentValues,
3022
- M as hasInvalidCssVariable,
3023
- fo as hasItems,
3024
- ko as hasOverlayLayers,
3025
- dr as incrementVersion,
3026
- Cn as isBackgroundImageValue,
3027
- Kn as isBorderStyleValue,
3028
- zn as isBorderValue,
3029
- Yn as isBoxShadowValue,
3030
- An as isBoxSpacingValue,
3031
- dn as isCloudinaryCloudName,
3032
- un as isCloudinaryPublicId,
3033
- fn as isCloudinaryTransformationString,
3034
- he as isCssColorValue,
3035
- kn as isCssEnumValue,
3036
- U as isCssVariableName,
3037
- K as isDevClientToken,
3038
- Xn as isLineHeightValue,
3039
- Jn as isOpacityValue,
3040
- Po as isOverlayLayerEmptyForDevice,
3041
- ho as isRowHiddenForDevice,
3042
- pn as isSafeImageUrl,
3043
- z as isSpacingSideValue,
3044
- ve as isWidgetHiddenForDevice,
3045
- Rn as justifyContentAllowlist,
3046
- we as normalizeCssClasses,
3047
- be as objectStyleAttributeRegistry,
3048
- ie as overflowAllowlist,
3049
- Ze as phoneModeWidth,
3050
- xn as pointerEventsAllowlist,
3051
- Et as prepareRuleCMSWidgetData,
3052
- Oe as resolveBaseZIndex,
3053
- ze as resolveKey,
3054
- Io as resolveOverlayLayerPointerEvents,
3055
- go as resolveRowStyles,
3056
- Bt as resolveWidgetApiOrigin,
3057
- et as resolveWidgetContainerStyles,
3058
- Lo as resolveWidgetInstanceProps,
3059
- Cr as resolveWidgetLibraries,
3060
- mo as rowBasedPropertiesAreAssigned,
3061
- me as spacingKeywords,
3062
- wn as spacingLengthUnits,
3063
- qe as tabletModeWidth,
3064
- Dn as textAlignAllowlist,
3065
- $n as textDecorationAllowlist,
3066
- Ln as textTransformAllowlist,
3067
- Ge as typeHasPrefix,
3068
- _o as warnUnmatchedComponentProps,
3069
- So as widgetBasedPropertiesAreAssigned,
3070
- tt as widgetDeclaresOwnHeight
3181
+ Vr as AlignContentTypes,
3182
+ Ss as BreakpointVariantRender,
3183
+ lt as COLLECTION_TYPE_PREFIX,
3184
+ pe as COMPONENT_PROPS_PATH_SEPARATOR,
3185
+ Re as CSS_CLASSES_ATTRIBUTE_NAME,
3186
+ Bn as CSS_VARIABLE_NAME_MAX_LENGTH,
3187
+ Fn as CSS_VARIABLE_NAME_PATTERN,
3188
+ Ct as DEFAULT_BASE_Z_INDEX,
3189
+ Tn as DEFAULT_CLOUDINARY_CLOUD_NAME,
3190
+ se as DEFAULT_LIBRARY_ID,
3191
+ Mr as DEFAULT_PUBLISHED_WIDGET_CACHE_MS,
3192
+ No as DEFAULT_ROW_GAP,
3193
+ cn as DEV_CLIENT_TOKEN_PREFIX,
3194
+ pn as DEV_WIDGET_API_PATH,
3195
+ yn as DEV_WIDGET_RESOLVE_API_PATH,
3196
+ Fr as DeviceDisplayTypes,
3197
+ Xe as DisplayComponent,
3198
+ Ie as DisplayItemTypes,
3199
+ rt as DragItemIdPrefixTypes,
3200
+ Cn as EMBEDDED_KEY_SEPARATOR,
3201
+ po as FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY,
3202
+ z as FetchRuleCMSWidgetError,
3203
+ ht as HIDE_WIDGET_ATTRIBUTE_NAME,
3204
+ Ke as JustifyContentTypes,
3205
+ Ho as POINTER_EVENTS_ATTRIBUTE_NAME,
3206
+ Ae as PUBLISHED_KEY_SEPARATOR,
3207
+ dn as PUBLISHED_WIDGET_API_PATH,
3208
+ fn as PUBLISHED_WIDGET_RESOLVE_API_PATH,
3209
+ Be as PageViewTypes,
3210
+ qe as RULECMS_ANONYMOUS_ID_STORAGE_KEY,
3211
+ an as RULECMS_API_ORIGIN,
3212
+ Qr as RULECMS_PUBLISHED_KEY_ATTRIBUTE,
3213
+ ft as RULECMS_WIDGET_CONTEXT_KEY,
3214
+ Ds as RenderComponents,
3215
+ Ee as RenderComponentsForDevice,
3216
+ Es as RenderComponentsInner,
3217
+ el as RuleCMSWidget,
3218
+ Xr as RuleCMSWidgetProvider,
3219
+ Uo as WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE,
3220
+ un as WIDGET_CACHE_API_ORIGIN,
3221
+ ze as WIDGET_PLACEHOLDER_VALUES_KEY,
3222
+ Yo as Z_INDEX_WIDGET_ATTRIBUTE_NAME,
3223
+ ro as alignContentAllowlist,
3224
+ so as alignItemsAllowlist,
3225
+ ao as backgroundPositionAllowlist,
3226
+ uo as backgroundRepeatAllowlist,
3227
+ co as backgroundSizeAllowlist,
3228
+ fo as borderStyleKeywords,
3229
+ Un as boxSpacingSideKeys,
3230
+ Zr as boxSpacingStyleAttributeEntries,
3231
+ Vn as buildCloudinaryBackgroundUrl,
3232
+ es as buildOverlayLayerBoxStyles,
3233
+ Qo as buildOverlayStackStyles,
3234
+ at as buildWidgetFetchUrl,
3235
+ ut as buildWidgetResolveUrl,
3236
+ tl as clearPublishedWidgetFetchCache,
3237
+ os as collectComponentInstancePaths,
3238
+ Pe as collectReferencedLibraryIds,
3239
+ ln as composeSourceComponentsPlugin,
3240
+ de as createComponentLibraryRegistry,
3241
+ ve as cssAttrArrayKey,
3242
+ An as defaultPageWidth,
3243
+ Mo as deriveDisplayFlexIfNeeded,
3244
+ Jr as desktopModeWidth,
3245
+ nl as fetchRuleCMSWidget,
3246
+ is as findUnmatchedComponentPropsKeys,
3247
+ lo as flexDirectionAllowlist,
3248
+ io as flexWrapAllowlist,
3249
+ Jn as fontFamilyAllowlist,
3250
+ Zn as fontStyleAllowlist,
3251
+ qn as fontWeightAllowlist,
3252
+ Ao as formatBackgroundImageStyles,
3253
+ To as formatBorderStyles,
3254
+ Eo as formatBoxShadowStyles,
3255
+ ko as formatBoxSpacingStyles,
3256
+ Io as formatCssColorStyles,
3257
+ Le as formatCssColorValue,
3258
+ Po as formatCssEnumStyles,
3259
+ Do as formatCssLengthStyles,
3260
+ N as formatCssVariable,
3261
+ qr as formatCssVariableStyles,
3262
+ xo as formatLineHeightStyles,
3263
+ $o as formatObjectStyleAttribute,
3264
+ Lo as formatOpacityStyles,
3265
+ J as formatSpacingSideValue,
3266
+ wn as generatePublishedKey,
3267
+ Gr as generatePublishedKeyForEmbedded,
3268
+ pt as getCollectionIdForCollectionType,
3269
+ ae as getColumnAttributes,
3270
+ He as getComponentAttributesAndStyles,
3271
+ we as getComponentsPluginFromPlugins,
3272
+ E as getCssVariableFromLeaf,
3273
+ Oo as getDefaultDimensionAttributes,
3274
+ B as getDeviceTypeBasedAttributes,
3275
+ Br as getDragItemId,
3276
+ mn as getDragItemPrefixAndId,
3277
+ hn as getIdAndPrefix,
3278
+ _o as getMergedAttributes,
3279
+ Kr as getNameAndInstanceIdFromWidgetKey,
3280
+ Hr as getNameFromWidgetKey,
3281
+ Sr as getOrCreateAnonymousId,
3282
+ Jo as getOverlayLayerZIndex,
3283
+ gn as getWidgetKeyForCollection,
3284
+ Ur as getWidgetKeyForCollectionWithPrefix,
3285
+ bn as getWidgetKeyForPublishedCollection,
3286
+ zr as getWidgetKeyForPublishedCollectionWithPrefix,
3287
+ Co as hasBoxShadowLeaf,
3288
+ as as hasDeviceDivergentValues,
3289
+ V as hasInvalidCssVariable,
3290
+ jo as hasItems,
3291
+ Xo as hasOverlayLayers,
3292
+ Yr as incrementVersion,
3293
+ Kn as isBackgroundImageValue,
3294
+ yo as isBorderStyleValue,
3295
+ mo as isBorderValue,
3296
+ bo as isBoxShadowValue,
3297
+ zn as isBoxSpacingValue,
3298
+ On as isCloudinaryCloudName,
3299
+ Mn as isCloudinaryPublicId,
3300
+ jn as isCloudinaryTransformationString,
3301
+ xe as isCssColorValue,
3302
+ Xn as isCssEnumValue,
3303
+ q as isCssVariableName,
3304
+ F as isDevClientToken,
3305
+ wo as isLineHeightValue,
3306
+ vo as isOpacityValue,
3307
+ Zo as isOverlayLayerEmptyForDevice,
3308
+ Vo as isRowHiddenForDevice,
3309
+ _n as isSafeImageUrl,
3310
+ X as isSpacingSideValue,
3311
+ Oe as isWidgetHiddenForDevice,
3312
+ oo as justifyContentAllowlist,
3313
+ Me as normalizeCssClasses,
3314
+ $e as objectStyleAttributeRegistry,
3315
+ be as overflowAllowlist,
3316
+ yt as phoneModeWidth,
3317
+ no as pointerEventsAllowlist,
3318
+ je as prepareRuleCMSWidgetData,
3319
+ Ue as resolveBaseZIndex,
3320
+ it as resolveKey,
3321
+ qo as resolveOverlayLayerPointerEvents,
3322
+ Fo as resolveRowStyles,
3323
+ ct as resolveWidgetApiOrigin,
3324
+ gt as resolveWidgetContainerStyles,
3325
+ ts as resolveWidgetInstanceProps,
3326
+ ol as resolveWidgetLibraries,
3327
+ Wo as rowBasedPropertiesAreAssigned,
3328
+ De as spacingKeywords,
3329
+ Hn as spacingLengthUnits,
3330
+ Pr as stableJsonStringify,
3331
+ mt as tabletModeWidth,
3332
+ Qn as textAlignAllowlist,
3333
+ eo as textDecorationAllowlist,
3334
+ to as textTransformAllowlist,
3335
+ dt as typeHasPrefix,
3336
+ rs as warnUnmatchedComponentProps,
3337
+ Go as widgetBasedPropertiesAreAssigned,
3338
+ bt as widgetDeclaresOwnHeight,
3339
+ ns as withWidgetPlaceholderValues
3071
3340
  };