@charisol/plexo-sdk 2.0.19 → 2.0.21

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.
@@ -14136,40 +14136,59 @@ function lo(e, t) {
14136
14136
  }
14137
14137
  //#endregion
14138
14138
  //#region src/v2/sol/describe.ts
14139
- var uo = (e, t = 60) => e.length > t ? `${e.slice(0, t - 1).trimEnd()}…` : e;
14140
- function fo(e, t = 0) {
14139
+ var uo = 60, fo = (e, t = 60) => e.length > t ? `${e.slice(0, t - 1).trimEnd()}…` : e;
14140
+ function po(e, t = 0) {
14141
14141
  if (typeof e.content == "string" && e.content.trim()) return e.content.trim();
14142
14142
  if (t > 6) return "";
14143
14143
  for (let n of e.children ?? []) {
14144
- let e = fo(n, t + 1);
14144
+ let e = po(n, t + 1);
14145
14145
  if (e) return e;
14146
14146
  }
14147
14147
  return "";
14148
14148
  }
14149
- function po(e) {
14149
+ function mo(e) {
14150
14150
  let t = H(e);
14151
14151
  if (!t) return "";
14152
14152
  let n = ji(t.kind) ? V(t.kind).fields : [];
14153
14153
  for (let e of n) {
14154
14154
  let n = t.content?.[e.key];
14155
- if ((e.type === "text" || e.type === "longtext") && typeof n == "string" && n.trim()) return uo(n.trim());
14155
+ if ((e.type === "text" || e.type === "longtext") && typeof n == "string" && n.trim()) return fo(n.trim());
14156
14156
  }
14157
14157
  return "";
14158
14158
  }
14159
- function mo(e) {
14159
+ function ho(e) {
14160
+ let t = [], n = (r, i) => {
14161
+ if (!(t.length >= uo || i > 12)) {
14162
+ if (r !== e) {
14163
+ let e = typeof r.content == "string" && r.content.trim() ? fo(r.content.trim(), 200) : void 0, n = typeof r.props?.href == "string" && r.props.href ? r.props.href : void 0, i = typeof r.props?.alt == "string" && r.props.alt ? fo(r.props.alt, 80) : void 0;
14164
+ (e || r.type === "image" && (i || r.id)) && t.push({
14165
+ id: r.id,
14166
+ type: r.type,
14167
+ ...e ? { text: e } : {},
14168
+ ...n ? { href: n } : {},
14169
+ ...i ? { alt: i } : {}
14170
+ });
14171
+ }
14172
+ for (let e of r.children ?? []) n(e, i + 1);
14173
+ }
14174
+ };
14175
+ return n(e, 0), t;
14176
+ }
14177
+ function go(e) {
14160
14178
  let t = H(e);
14161
14179
  return t ? {
14162
14180
  id: e.id,
14163
14181
  kind: t.kind,
14164
14182
  variant: t.variant,
14165
- preview: po(e)
14183
+ preview: mo(e)
14166
14184
  } : {
14167
14185
  id: e.id,
14168
- preview: uo(fo(e) || e.name || ""),
14169
- freeForm: !0
14186
+ preview: fo(po(e) || e.name || ""),
14187
+ freeForm: !0,
14188
+ elements: ho(e)
14170
14189
  };
14171
14190
  }
14172
- function ho(e, t) {
14191
+ function _o(e, t) {
14173
14192
  let n = (e) => {
14174
14193
  let n = ee(t, e);
14175
14194
  return n ? v(n) : void 0;
@@ -14180,7 +14199,7 @@ function ho(e, t) {
14180
14199
  name: e.name,
14181
14200
  slug: e.slug,
14182
14201
  ...e.isHome ? { isHome: !0 } : {},
14183
- sections: ve(e.rootNode).filter((e) => e.type === "section").map(mo)
14202
+ sections: ve(e.rootNode).filter((e) => e.type === "section").map(go)
14184
14203
  })),
14185
14204
  brand: {
14186
14205
  primaryColor: ee(t, "--color-brand-primary-500"),
@@ -14194,7 +14213,7 @@ function ho(e, t) {
14194
14213
  }
14195
14214
  //#endregion
14196
14215
  //#region src/v2/data/blankPage.ts
14197
- function go() {
14216
+ function vo() {
14198
14217
  let e = {
14199
14218
  id: k("page"),
14200
14219
  type: "page",
@@ -14227,7 +14246,7 @@ function go() {
14227
14246
  }
14228
14247
  //#endregion
14229
14248
  //#region src/v2/sol/schema.ts
14230
- var _o = a({
14249
+ var yo = a({
14231
14250
  background: u([
14232
14251
  "canvas",
14233
14252
  "surface",
@@ -14245,26 +14264,51 @@ var _o = a({
14245
14264
  "airy"
14246
14265
  ]).optional(),
14247
14266
  pinned: i().optional()
14248
- }).strict(), vo = d(n(), s()), yo = {
14267
+ }).strict(), bo = d(n(), s()), xo = {
14249
14268
  index: t().int().min(0).optional(),
14250
14269
  afterSectionId: n().optional()
14251
- }, bo = e("op", [
14252
- a({
14253
- op: l("addSection"),
14254
- pageId: n(),
14255
- kind: n(),
14256
- variant: n().optional(),
14257
- content: vo.optional(),
14258
- style: _o.optional(),
14259
- id: n().optional(),
14260
- ...yo
14261
- }),
14270
+ }, So = a({
14271
+ op: l("addSection"),
14272
+ pageId: n(),
14273
+ kind: n(),
14274
+ variant: n().optional(),
14275
+ content: bo.optional(),
14276
+ style: yo.optional(),
14277
+ id: n().optional(),
14278
+ ...xo
14279
+ }), Co = a({
14280
+ op: l("updateSection"),
14281
+ sectionId: n(),
14282
+ content: bo.optional(),
14283
+ variant: n().optional(),
14284
+ style: yo.optional()
14285
+ }), wo = a({
14286
+ fontSize: n().regex(/^\d+(\.\d+)?(px|rem|em|vw|%)$/).optional(),
14287
+ fontWeight: n().regex(/^[1-9]00$/).optional(),
14288
+ textAlign: u([
14289
+ "left",
14290
+ "center",
14291
+ "right"
14292
+ ]).optional(),
14293
+ textColor: n().max(80).optional(),
14294
+ lineHeight: n().regex(/^\d+(\.\d+)?(px|rem|em|%)?$/).optional(),
14295
+ letterSpacing: n().regex(/^-?\d+(\.\d+)?(px|em|rem)$/).optional(),
14296
+ textTransform: u([
14297
+ "none",
14298
+ "uppercase",
14299
+ "lowercase",
14300
+ "capitalize"
14301
+ ]).optional()
14302
+ }).strict(), To = e("op", [
14303
+ So,
14304
+ Co,
14262
14305
  a({
14263
- op: l("updateSection"),
14264
- sectionId: n(),
14265
- content: vo.optional(),
14266
- variant: n().optional(),
14267
- style: _o.optional()
14306
+ op: l("updateElement"),
14307
+ nodeId: n(),
14308
+ text: n().max(2e3).optional(),
14309
+ href: n().max(2e3).optional(),
14310
+ alt: n().max(500).optional(),
14311
+ style: wo.optional()
14268
14312
  }),
14269
14313
  a({
14270
14314
  op: l("removeSection"),
@@ -14273,7 +14317,7 @@ var _o = a({
14273
14317
  a({
14274
14318
  op: l("moveSection"),
14275
14319
  sectionId: n(),
14276
- ...yo
14320
+ ...xo
14277
14321
  }),
14278
14322
  a({
14279
14323
  op: l("duplicateSection"),
@@ -14293,52 +14337,52 @@ var _o = a({
14293
14337
  pageId: n(),
14294
14338
  name: n().min(1)
14295
14339
  })
14296
- ]), xo = (e) => Sa.some((t) => t.id === e) ? Aa(e, { seed: k("tpl") }) : null;
14297
- function So(e) {
14298
- xo = e;
14340
+ ]), Eo = (e) => Sa.some((t) => t.id === e) ? Aa(e, { seed: k("tpl") }) : null;
14341
+ function Do(e) {
14342
+ Eo = e;
14299
14343
  }
14300
14344
  var U = (e) => ({
14301
14345
  ok: !1,
14302
14346
  message: e
14303
- }), Co = (e, t) => ({
14347
+ }), Oo = (e, t) => ({
14304
14348
  ok: !0,
14305
14349
  message: e,
14306
14350
  ...t ? { sectionId: t } : {}
14307
- }), wo = () => ki.map((e) => e.kind).join(", "), To = (e) => e.type === "section", Eo = (e, t) => e.find((e) => e.id === t) ?? e.find((e) => e.name.trim().toLowerCase() === t.trim().toLowerCase()), Do = (e, t) => {
14351
+ }), ko = () => ki.map((e) => e.kind).join(", "), Ao = (e) => e.type === "section", jo = (e, t) => e.find((e) => e.id === t) ?? e.find((e) => e.name.trim().toLowerCase() === t.trim().toLowerCase()), Mo = (e, t) => {
14308
14352
  for (let n of e) {
14309
- let e = (n.rootNode.children ?? []).findIndex((e) => e.id === t && To(e));
14353
+ let e = (n.rootNode.children ?? []).findIndex((e) => e.id === t && Ao(e));
14310
14354
  if (e >= 0) return {
14311
14355
  page: n,
14312
14356
  index: e
14313
14357
  };
14314
14358
  }
14315
14359
  return null;
14316
- }, Oo = (e, t, n) => e.map((e) => e.id === t ? {
14360
+ }, No = (e, t, n) => e.map((e) => e.id === t ? {
14317
14361
  ...e,
14318
14362
  rootNode: {
14319
14363
  ...e.rootNode,
14320
14364
  children: n
14321
14365
  }
14322
- } : e), ko = (e) => e.rootNode.children ?? [], Ao = (e) => U(`I couldn't find a section called "${e}". It may have been removed already.`), jo = (e) => {
14366
+ } : e), W = (e) => e.rootNode.children ?? [], Po = (e) => U(`I couldn't find a section called "${e}". It may have been removed already.`), Fo = (e) => {
14323
14367
  let t = H(e);
14324
14368
  return t && ji(t.kind) ? V(t.kind).label : e.name || "section";
14325
14369
  };
14326
- function Mo(e, t, n) {
14370
+ function Io(e, t, n) {
14327
14371
  if (t.afterSectionId !== void 0) {
14328
14372
  let n = e.findIndex((e) => e.id === t.afterSectionId);
14329
14373
  return n < 0 ? { error: `I couldn't find the section to place it after ("${t.afterSectionId}").` } : { index: n + 1 };
14330
14374
  }
14331
14375
  return t.index === void 0 ? { index: n } : { index: Math.min(t.index, e.length) };
14332
14376
  }
14333
- var No = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "page";
14334
- function Po(e) {
14377
+ var Lo = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "page";
14378
+ function Ro(e) {
14335
14379
  return {
14336
14380
  ...e,
14337
14381
  id: k("node"),
14338
- children: e.children?.map(Po)
14382
+ children: e.children?.map(Ro)
14339
14383
  };
14340
14384
  }
14341
- var Fo = (e, t) => {
14385
+ var zo = (e, t) => {
14342
14386
  let [n, ...r] = t, i = e.find((e) => e.key === n);
14343
14387
  return i ? r.length ? i.type === "list" && /^\d+$/.test(r[0]) ? r.length === 1 ? {
14344
14388
  ...i,
@@ -14348,9 +14392,9 @@ var Fo = (e, t) => {
14348
14392
  itemName: i.itemName,
14349
14393
  label: i.itemName ?? i.label,
14350
14394
  limit: -1
14351
- } : Fo(i.item ?? [], r.slice(1)) : null : i : null;
14352
- }, Io = (e) => !!e && typeof e == "object" && !Array.isArray(e);
14353
- function Lo(e, t, n) {
14395
+ } : zo(i.item ?? [], r.slice(1)) : null : i : null;
14396
+ }, Bo = (e) => !!e && typeof e == "object" && !Array.isArray(e);
14397
+ function Vo(e, t, n) {
14354
14398
  switch (e.type) {
14355
14399
  case "text":
14356
14400
  case "longtext":
@@ -14363,53 +14407,53 @@ function Lo(e, t, n) {
14363
14407
  return typeof t == "string" && (!r.length || r.includes(t)) ? null : `"${n}" should be one of: ${r.join(", ")}.`;
14364
14408
  }
14365
14409
  case "button":
14366
- if (!Io(t)) return `"${n}" should be a button with a label and a link.`;
14410
+ if (!Bo(t)) return `"${n}" should be a button with a label and a link.`;
14367
14411
  for (let [e, r] of Object.entries(t)) if (!["label", "href"].includes(e) || typeof r != "string") return `"${n}" can only have a label and a link, both text.`;
14368
14412
  return null;
14369
14413
  case "list":
14370
14414
  if (!Array.isArray(t)) return `"${n}" should be a list.`;
14371
14415
  if (e.limit && e.limit > 0 && t.length > e.limit) return `"${n}" can have at most ${e.limit} ${e.itemName ?? "item"}s.`;
14372
14416
  for (let [r, i] of t.entries()) {
14373
- let t = Ro(e.item ?? [], i, `${n} ${r + 1}`);
14417
+ let t = Ho(e.item ?? [], i, `${n} ${r + 1}`);
14374
14418
  if (t) return t;
14375
14419
  }
14376
14420
  return null;
14377
14421
  }
14378
14422
  }
14379
- function Ro(e, t, n) {
14380
- if (!Io(t)) return `${n} should be a group of fields.`;
14423
+ function Ho(e, t, n) {
14424
+ if (!Bo(t)) return `${n} should be a group of fields.`;
14381
14425
  for (let [r, i] of Object.entries(t)) {
14382
14426
  let t = e.find((e) => e.key === r);
14383
14427
  if (!t) return `${n} has a field "${r}" that doesn't exist. Available: ${e.map((e) => e.key).join(", ")}.`;
14384
- let a = Lo(t, i, `${n} ${t.label.toLowerCase()}`);
14428
+ let a = Vo(t, i, `${n} ${t.label.toLowerCase()}`);
14385
14429
  if (a) return a;
14386
14430
  }
14387
14431
  return null;
14388
14432
  }
14389
- function zo(e, t) {
14433
+ function Uo(e, t) {
14390
14434
  let n = V(e);
14391
14435
  for (let [e, r] of Object.entries(t)) {
14392
- let t = Fo(n.fields, e.split(".").filter(Boolean));
14436
+ let t = zo(n.fields, e.split(".").filter(Boolean));
14393
14437
  if (!t) return `A ${n.label.toLowerCase()} section has no "${e}" field. The fields are: ${n.fields.map((e) => e.key).join(", ")}.`;
14394
14438
  if (t.limit === -1) {
14395
- let e = Ro(t.item ?? [], r, t.label);
14439
+ let e = Ho(t.item ?? [], r, t.label);
14396
14440
  if (e) return e;
14397
14441
  continue;
14398
14442
  }
14399
- let i = Lo(t, r, t.label);
14443
+ let i = Vo(t, r, t.label);
14400
14444
  if (i) return i;
14401
14445
  }
14402
14446
  return null;
14403
14447
  }
14404
- var Bo = (e, t) => Object.entries(t).reduce((e, [t, n]) => Zi(e, t, n), e), Vo = [
14448
+ var Wo = (e, t) => Object.entries(t).reduce((e, [t, n]) => Zi(e, t, n), e), Go = [
14405
14449
  "primaryColor",
14406
14450
  "secondaryColor",
14407
14451
  "headingFont",
14408
14452
  "bodyFont",
14409
14453
  "neutrals",
14410
14454
  "roundness"
14411
- ], Ho = (e) => new Set(re(e).map((e) => `${e.kind}:${e.key}`));
14412
- function Uo(e, t) {
14455
+ ], Ko = (e) => new Set(re(e).map((e) => `${e.kind}:${e.key}`));
14456
+ function qo(e, t) {
14413
14457
  let n = e, r = [];
14414
14458
  for (let [i, a] of Object.entries(t)) {
14415
14459
  let t = String(a).trim();
@@ -14457,7 +14501,7 @@ function Uo(e, t) {
14457
14501
  default: {
14458
14502
  if (!i.startsWith("--")) return {
14459
14503
  ds: e,
14460
- result: U(`I don't know the brand setting "${i}". I can change: ${Vo.join(", ")}.`)
14504
+ result: U(`I don't know the brand setting "${i}". I can change: ${Go.join(", ")}.`)
14461
14505
  };
14462
14506
  let a = ne(n, i);
14463
14507
  if (!a) return {
@@ -14472,16 +14516,50 @@ function Uo(e, t) {
14472
14516
  ds: e,
14473
14517
  result: U("There was nothing to change in the brand.")
14474
14518
  };
14475
- let i = Ho(e), a = re(n).filter((e) => !i.has(`${e.kind}:${e.key}`));
14519
+ let i = Ko(e), a = re(n).filter((e) => !i.has(`${e.kind}:${e.key}`));
14476
14520
  return a.length ? {
14477
14521
  ds: e,
14478
14522
  result: U(`That brand change wouldn't work: ${a[0].message}`)
14479
14523
  } : {
14480
14524
  ds: te(n),
14481
- result: Co(`Updated the brand (${r.join(", ")}).`)
14525
+ result: Oo(`Updated the brand (${r.join(", ")}).`)
14482
14526
  };
14483
14527
  }
14484
- function Wo(e, t, n, r) {
14528
+ var Jo = /* @__PURE__ */ new Set([
14529
+ "heading",
14530
+ "paragraph",
14531
+ "button",
14532
+ "badge"
14533
+ ]), Yo = (e, t, n) => e.id === t ? n(e) : e.children ? {
14534
+ ...e,
14535
+ children: e.children.map((e) => Yo(e, t, n))
14536
+ } : e, Xo = (e, t) => e.id === t || (e.children ?? []).some((e) => Xo(e, t));
14537
+ function Zo(e, t) {
14538
+ for (let n of e) {
14539
+ let e = W(n);
14540
+ for (let r = 0; r < e.length; r++) if (e[r].id !== t && Xo(e[r], t)) {
14541
+ let i = null;
14542
+ return Yo(e[r], t, (e) => (i = e, e)), {
14543
+ page: n,
14544
+ index: r,
14545
+ node: i
14546
+ };
14547
+ }
14548
+ }
14549
+ return null;
14550
+ }
14551
+ var Qo = (e) => {
14552
+ let t = (e.content ?? e.props?.alt ?? "").toString().trim();
14553
+ return t ? `"${t.length > 40 ? `${t.slice(0, 39).trimEnd()}…` : t}"` : `the ${e.type}`;
14554
+ };
14555
+ function $o(e, t) {
14556
+ let n = Zo(e, t);
14557
+ return n ? {
14558
+ label: Qo(n.node),
14559
+ page: n.page.name
14560
+ } : { label: "an element" };
14561
+ }
14562
+ function es(e, t, n, r) {
14485
14563
  let i = (n) => ({
14486
14564
  pages: e,
14487
14565
  ds: t,
@@ -14489,23 +14567,23 @@ function Wo(e, t, n, r) {
14489
14567
  });
14490
14568
  switch (n.op) {
14491
14569
  case "addSection": {
14492
- let r = Eo(e, n.pageId);
14570
+ let r = jo(e, n.pageId);
14493
14571
  if (!r) return i(U(`I couldn't find a page called "${n.pageId}".`));
14494
- if (!ji(n.kind)) return i(U(`I don't know a "${n.kind}" section. The ones I can add are: ${wo()}.`));
14572
+ if (!ji(n.kind)) return i(U(`I don't know a "${n.kind}" section. The ones I can add are: ${ko()}.`));
14495
14573
  let a = V(n.kind);
14496
14574
  if (n.variant && !a.variants.some((e) => e.id === n.variant)) return i(U(`A ${a.label.toLowerCase()} section doesn't have a "${n.variant}" layout. Choose from: ${a.variants.map((e) => e.id).join(", ")}.`));
14497
14575
  if (n.content) {
14498
- let e = zo(n.kind, n.content);
14576
+ let e = Uo(n.kind, n.content);
14499
14577
  if (e) return i(U(e));
14500
14578
  }
14501
14579
  let o = Fi(n.kind, n.variant), s = {
14502
14580
  ...o,
14503
- content: n.content ? Bo(o.content, n.content) : o.content,
14581
+ content: n.content ? Wo(o.content, n.content) : o.content,
14504
14582
  style: {
14505
14583
  ...o.style,
14506
14584
  ...n.style
14507
14585
  }
14508
- }, c = ko(r), l = new Set(e.flatMap((e) => ko(e).map((e) => e.id))), u = n.id && /^[A-Za-z0-9_-]{1,40}$/.test(n.id) && !l.has(n.id) ? n.id : k("section"), d = Mo(c, n, n.kind === "header" ? 0 : n.kind !== "footer" && c[c.length - 1] && H(c[c.length - 1])?.kind === "footer" ? c.length - 1 : c.length);
14586
+ }, c = W(r), l = new Set(e.flatMap((e) => W(e).map((e) => e.id))), u = n.id && /^[A-Za-z0-9_-]{1,40}$/.test(n.id) && !l.has(n.id) ? n.id : k("section"), d = Io(c, n, n.kind === "header" ? 0 : n.kind !== "footer" && c[c.length - 1] && H(c[c.length - 1])?.kind === "footer" ? c.length - 1 : c.length);
14509
14587
  if ("error" in d) return i(U(d.error));
14510
14588
  let f = [
14511
14589
  ...c.slice(0, d.index),
@@ -14513,21 +14591,21 @@ function Wo(e, t, n, r) {
14513
14591
  ...c.slice(d.index)
14514
14592
  ];
14515
14593
  return {
14516
- pages: Oo(e, r.id, f),
14594
+ pages: No(e, r.id, f),
14517
14595
  ds: t,
14518
- result: Co(`Added a ${a.label.toLowerCase()} section to ${r.name}.`, u)
14596
+ result: Oo(`Added a ${a.label.toLowerCase()} section to ${r.name}.`, u)
14519
14597
  };
14520
14598
  }
14521
14599
  case "updateSection": {
14522
- let r = Do(e, n.sectionId);
14523
- if (!r) return i(Ao(n.sectionId));
14524
- let a = ko(r.page)[r.index], o = H(a);
14525
- if (!o) return i(U("That section was designed by hand, so I can't change its words safely. You can edit it directly, or I can add a new section instead."));
14600
+ let r = Mo(e, n.sectionId);
14601
+ if (!r) return i(Po(n.sectionId));
14602
+ let a = W(r.page)[r.index], o = H(a);
14603
+ if (!o) return i(U("That section was designed by hand, so its words aren't fields: change the elements inside it one at a time instead."));
14526
14604
  if (n.content === void 0 && n.variant === void 0 && n.style === void 0) return i(U("There was nothing to change in that section."));
14527
14605
  let s = V(o.kind);
14528
14606
  if (n.variant && !s.variants.some((e) => e.id === n.variant)) return i(U(`A ${s.label.toLowerCase()} section doesn't have a "${n.variant}" layout. Choose from: ${s.variants.map((e) => e.id).join(", ")}.`));
14529
14607
  if (n.content) {
14530
- let e = zo(o.kind, n.content);
14608
+ let e = Uo(o.kind, n.content);
14531
14609
  if (e) return i(U(e));
14532
14610
  }
14533
14611
  let c = a;
@@ -14535,34 +14613,68 @@ function Wo(e, t, n, r) {
14535
14613
  let e = H(c);
14536
14614
  c = Qi(c, {
14537
14615
  ...e,
14538
- content: Bo(e.content, n.content)
14616
+ content: Wo(e.content, n.content)
14539
14617
  });
14540
14618
  }
14541
14619
  n.style && (c = na(c, n.style));
14542
- let l = ko(r.page).map((e, t) => t === r.index ? c : e);
14620
+ let l = W(r.page).map((e, t) => t === r.index ? c : e);
14543
14621
  return {
14544
- pages: Oo(e, r.page.id, l),
14622
+ pages: No(e, r.page.id, l),
14545
14623
  ds: t,
14546
- result: Co(`Updated the ${s.label.toLowerCase()} section on ${r.page.name}.`, a.id)
14624
+ result: Oo(`Updated the ${s.label.toLowerCase()} section on ${r.page.name}.`, a.id)
14625
+ };
14626
+ }
14627
+ case "updateElement": {
14628
+ let r = Zo(e, n.nodeId);
14629
+ if (!r) return i(U(`I couldn't find an element called "${n.nodeId}" on the site. It may have been removed already.`));
14630
+ let a = W(r.page)[r.index];
14631
+ if (H(a)) return i(U("That element belongs to a ready-made section, so change it through the section (its wording and layout) instead."));
14632
+ if (n.text === void 0 && n.href === void 0 && n.alt === void 0 && n.style === void 0) return i(U("There was nothing to change in that element."));
14633
+ let o = r.node;
14634
+ if (n.text !== void 0 && !Jo.has(o.type) && typeof o.content != "string") return i(U(`That ${o.type} has no words to change.`));
14635
+ if (n.href !== void 0 && /^\s*(javascript|data|vbscript):/i.test(n.href)) return i(U("That link isn't one I can use. Use a page address like /about or a full https:// address."));
14636
+ if (n.alt !== void 0 && o.type !== "image") return i(U("Only a picture has a picture description."));
14637
+ let s = Qo(o), c = Yo(a, n.nodeId, (e) => ({
14638
+ ...e,
14639
+ ...n.text === void 0 ? {} : { content: n.text },
14640
+ ...n.href !== void 0 || n.alt !== void 0 ? { props: {
14641
+ ...e.props,
14642
+ ...n.href === void 0 ? {} : { href: n.href },
14643
+ ...n.alt === void 0 ? {} : { alt: n.alt }
14644
+ } } : {},
14645
+ ...n.style ? { styles: {
14646
+ ...e.styles,
14647
+ ...n.style
14648
+ } } : {}
14649
+ })), l = W(r.page).map((e, t) => t === r.index ? c : e), u = [
14650
+ n.text !== void 0 && "wording",
14651
+ n.href !== void 0 && "link",
14652
+ n.alt !== void 0 && "picture description",
14653
+ n.style && "look"
14654
+ ].filter(Boolean).join(" and ");
14655
+ return {
14656
+ pages: No(e, r.page.id, l),
14657
+ ds: t,
14658
+ result: Oo(`Changed the ${u} of ${s} on ${r.page.name}.`, a.id)
14547
14659
  };
14548
14660
  }
14549
14661
  case "removeSection": {
14550
- let r = Do(e, n.sectionId);
14551
- if (!r) return i(Ao(n.sectionId));
14552
- let a = ko(r.page)[r.index];
14662
+ let r = Mo(e, n.sectionId);
14663
+ if (!r) return i(Po(n.sectionId));
14664
+ let a = W(r.page)[r.index];
14553
14665
  return {
14554
- pages: Oo(e, r.page.id, ko(r.page).filter((e, t) => t !== r.index)),
14666
+ pages: No(e, r.page.id, W(r.page).filter((e, t) => t !== r.index)),
14555
14667
  ds: t,
14556
- result: Co(`Removed the ${jo(a).toLowerCase()} section from ${r.page.name}.`)
14668
+ result: Oo(`Removed the ${Fo(a).toLowerCase()} section from ${r.page.name}.`)
14557
14669
  };
14558
14670
  }
14559
14671
  case "moveSection": {
14560
- let r = Do(e, n.sectionId);
14561
- if (!r) return i(Ao(n.sectionId));
14672
+ let r = Mo(e, n.sectionId);
14673
+ if (!r) return i(Po(n.sectionId));
14562
14674
  if (n.index === void 0 && n.afterSectionId === void 0) return i(U("I need to know where to move it to."));
14563
- let a = ko(r.page)[r.index];
14675
+ let a = W(r.page)[r.index];
14564
14676
  if (n.afterSectionId === n.sectionId) return i(U("A section can't be moved after itself."));
14565
- let o = ko(r.page).filter((e, t) => t !== r.index), s = Mo(o, n, o.length);
14677
+ let o = W(r.page).filter((e, t) => t !== r.index), s = Io(o, n, o.length);
14566
14678
  if ("error" in s) return i(U(s.error));
14567
14679
  let c = [
14568
14680
  ...o.slice(0, s.index),
@@ -14570,30 +14682,30 @@ function Wo(e, t, n, r) {
14570
14682
  ...o.slice(s.index)
14571
14683
  ];
14572
14684
  return {
14573
- pages: Oo(e, r.page.id, c),
14685
+ pages: No(e, r.page.id, c),
14574
14686
  ds: t,
14575
- result: Co(`Moved the ${jo(a).toLowerCase()} section on ${r.page.name}.`, a.id)
14687
+ result: Oo(`Moved the ${Fo(a).toLowerCase()} section on ${r.page.name}.`, a.id)
14576
14688
  };
14577
14689
  }
14578
14690
  case "duplicateSection": {
14579
- let r = Do(e, n.sectionId);
14580
- if (!r) return i(Ao(n.sectionId));
14581
- let a = ko(r.page), o = a[r.index], s = k("section"), c = H(o), l = c ? Ji(c, s) : {
14582
- ...Po(o),
14691
+ let r = Mo(e, n.sectionId);
14692
+ if (!r) return i(Po(n.sectionId));
14693
+ let a = W(r.page), o = a[r.index], s = k("section"), c = H(o), l = c ? Ji(c, s) : {
14694
+ ...Ro(o),
14583
14695
  id: s
14584
14696
  };
14585
14697
  return {
14586
- pages: Oo(e, r.page.id, [
14698
+ pages: No(e, r.page.id, [
14587
14699
  ...a.slice(0, r.index + 1),
14588
14700
  l,
14589
14701
  ...a.slice(r.index + 1)
14590
14702
  ]),
14591
14703
  ds: t,
14592
- result: Co(`Copied the ${jo(o).toLowerCase()} section on ${r.page.name}.`, s)
14704
+ result: Oo(`Copied the ${Fo(o).toLowerCase()} section on ${r.page.name}.`, s)
14593
14705
  };
14594
14706
  }
14595
14707
  case "setBrand": {
14596
- let r = Uo(t, n.tokens);
14708
+ let r = qo(t, n.tokens);
14597
14709
  return {
14598
14710
  pages: e,
14599
14711
  ds: r.ds,
@@ -14608,15 +14720,15 @@ function Wo(e, t, n, r) {
14608
14720
  if (n.templateId) {
14609
14721
  let e = null;
14610
14722
  try {
14611
- e = (r.templates ?? xo)?.(n.templateId) ?? null;
14723
+ e = (r.templates ?? Eo)?.(n.templateId) ?? null;
14612
14724
  } catch {
14613
14725
  e = null;
14614
14726
  }
14615
14727
  e ? o = e : s = ` (I couldn't find the "${n.templateId}" starting layout, so it's blank.)`;
14616
14728
  }
14617
- let c = new Set(e.map((e) => e.slug)), l = No(a), u = l;
14729
+ let c = new Set(e.map((e) => e.slug)), l = Lo(a), u = l;
14618
14730
  for (let e = 2; c.has(u); e++) u = `${l}-${e}`;
14619
- let d = go()[0], f = {
14731
+ let d = vo()[0], f = {
14620
14732
  id: k("page"),
14621
14733
  name: a,
14622
14734
  slug: u,
@@ -14629,11 +14741,11 @@ function Wo(e, t, n, r) {
14629
14741
  return {
14630
14742
  pages: [...e, f],
14631
14743
  ds: t,
14632
- result: Co(`Added a new page called ${a}.${s}`)
14744
+ result: Oo(`Added a new page called ${a}.${s}`)
14633
14745
  };
14634
14746
  }
14635
14747
  case "renamePage": {
14636
- let r = Eo(e, n.pageId);
14748
+ let r = jo(e, n.pageId);
14637
14749
  if (!r) return i(U(`I couldn't find a page called "${n.pageId}".`));
14638
14750
  let a = n.name.trim();
14639
14751
  return e.some((e) => e.id !== r.id && e.name.trim().toLowerCase() === a.toLowerCase()) ? i(U(`There's already a page called "${a}".`)) : {
@@ -14642,22 +14754,22 @@ function Wo(e, t, n, r) {
14642
14754
  name: a
14643
14755
  } : e),
14644
14756
  ds: t,
14645
- result: Co(`Renamed ${r.name} to ${a}.`)
14757
+ result: Oo(`Renamed ${r.name} to ${a}.`)
14646
14758
  };
14647
14759
  }
14648
14760
  }
14649
14761
  }
14650
- function Go(e, t, n, r = {}) {
14762
+ function ts(e, t, n, r = {}) {
14651
14763
  let i = e, a = t, o = [];
14652
14764
  for (let e of Array.isArray(n) ? n : []) {
14653
- let t = bo.safeParse(e);
14765
+ let t = To.safeParse(e);
14654
14766
  if (!t.success) {
14655
- let t = Io(e) && typeof e.op == "string" ? e.op : "";
14767
+ let t = Bo(e) && typeof e.op == "string" ? e.op : "";
14656
14768
  o.push(U(t ? `I didn't understand one of the "${t}" changes, so I skipped it.` : "I didn't understand one of the changes, so I skipped it."));
14657
14769
  continue;
14658
14770
  }
14659
14771
  try {
14660
- let e = Wo(i, a, t.data, r);
14772
+ let e = es(i, a, t.data, r);
14661
14773
  i = e.pages, a = e.ds, o.push(e.result);
14662
14774
  } catch {
14663
14775
  o.push(U("Something went wrong with one of the changes, so I skipped it."));
@@ -14671,8 +14783,8 @@ function Go(e, t, n, r = {}) {
14671
14783
  }
14672
14784
  //#endregion
14673
14785
  //#region src/v2/sol/parse.ts
14674
- var Ko = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*?)```/i, qo = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*)$/i;
14675
- function Jo(e) {
14786
+ var ns = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*?)```/i, rs = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*)$/i;
14787
+ function is(e) {
14676
14788
  let t = "", n = !1;
14677
14789
  for (let r = 0; r < e.length; r++) {
14678
14790
  let i = e[r];
@@ -14697,15 +14809,15 @@ function Jo(e) {
14697
14809
  }
14698
14810
  return t;
14699
14811
  }
14700
- function Yo(e) {
14701
- let t = Ko.exec(e), n = t ? null : qo.exec(e), r = t ?? n;
14812
+ function as(e) {
14813
+ let t = ns.exec(e), n = t ? null : rs.exec(e), r = t ?? n;
14702
14814
  if (!r) return {
14703
14815
  text: e.trim(),
14704
14816
  commands: null
14705
14817
  };
14706
14818
  let i = e.replace(r[0], "").replace(/\n{3,}/g, "\n\n").trim(), a;
14707
14819
  try {
14708
- a = JSON.parse(Jo(r[1].trim()));
14820
+ a = JSON.parse(is(r[1].trim()));
14709
14821
  } catch {
14710
14822
  return {
14711
14823
  text: i,
@@ -14721,7 +14833,7 @@ function Yo(e) {
14721
14833
  };
14722
14834
  let s = [];
14723
14835
  for (let e of o) {
14724
- let t = bo.safeParse(e);
14836
+ let t = To.safeParse(e);
14725
14837
  t.success && s.push(t.data);
14726
14838
  }
14727
14839
  let c = o.length - s.length;
@@ -14735,9 +14847,55 @@ function Yo(e) {
14735
14847
  error: o.length ? "I couldn't understand the changes SOL suggested. Try asking again." : void 0
14736
14848
  };
14737
14849
  }
14850
+ var os = /```[ \t]*plexo-commands[ \t]*\r?\n/i, ss = "```plexo-commands";
14851
+ function cs(e) {
14852
+ for (let t = Math.min(19, e.length); t >= 3; t--) {
14853
+ let n = e.slice(-t);
14854
+ if (n[0] === "`" && ss.startsWith(n.trimEnd().toLowerCase())) return e.slice(0, -t);
14855
+ }
14856
+ return e;
14857
+ }
14858
+ function ls(e) {
14859
+ let t = os.exec(e);
14860
+ if (!t) return {
14861
+ text: cs(e).trim(),
14862
+ commands: [],
14863
+ writing: !1
14864
+ };
14865
+ let n = e.slice(0, t.index), r = e.slice(t.index + t[0].length), i = r.indexOf("```"), a = i === -1 ? r : r.slice(0, i), o = i === -1 ? "" : r.slice(i + 3), s = [], c = a.indexOf("[");
14866
+ if (c !== -1) {
14867
+ let e = 1, t = !1, n = -1;
14868
+ for (let r = c + 1; r < a.length && e > 0; r++) {
14869
+ let i = a[r];
14870
+ if (t) {
14871
+ i === "\\" ? r++ : (i === "\"" || i === "”") && (t = !1);
14872
+ continue;
14873
+ }
14874
+ if (i === "\"" || i === "“") t = !0;
14875
+ else if (i === "{") e === 1 && (n = r), e++;
14876
+ else if (i === "}") {
14877
+ if (e--, e === 1 && n !== -1) {
14878
+ let e;
14879
+ try {
14880
+ e = JSON.parse(is(a.slice(n, r + 1)));
14881
+ } catch {
14882
+ e = void 0;
14883
+ }
14884
+ let t = To.safeParse(e);
14885
+ s.push(t.success ? t.data : null), n = -1;
14886
+ }
14887
+ } else i === "[" ? e++ : i === "]" && e--;
14888
+ }
14889
+ }
14890
+ return {
14891
+ text: `${n}${i === -1 ? "" : o}`.replace(/\n{3,}/g, "\n\n").trim(),
14892
+ commands: s,
14893
+ writing: i === -1
14894
+ };
14895
+ }
14738
14896
  //#endregion
14739
14897
  //#region src/v2/sol/summarize.ts
14740
- var Xo = {
14898
+ var us = {
14741
14899
  primaryColor: "main colour",
14742
14900
  secondaryColor: "second colour",
14743
14901
  headingFont: "heading font",
@@ -14745,7 +14903,7 @@ var Xo = {
14745
14903
  neutrals: "background feel",
14746
14904
  roundness: "corner roundness"
14747
14905
  };
14748
- function Zo(e, t) {
14906
+ function ds(e, t) {
14749
14907
  let n = (e) => t.find((t) => t.id === e || t.name.toLowerCase() === e.toLowerCase()), r = (e) => {
14750
14908
  for (let n of t) {
14751
14909
  let t = (n.rootNode.children ?? []).find((t) => t.id === e);
@@ -14769,25 +14927,34 @@ function Zo(e, t) {
14769
14927
  e.variant && "the layout",
14770
14928
  e.style && "the look"
14771
14929
  ].filter(Boolean).join(" and ") || "it"} of ${i(e.sectionId)}${a(e.sectionId)}`;
14930
+ case "updateElement": {
14931
+ let n = $o(t, e.nodeId);
14932
+ return `Change ${[
14933
+ e.text !== void 0 && "the wording",
14934
+ e.href !== void 0 && "the link",
14935
+ e.alt !== void 0 && "the picture description",
14936
+ e.style && "the look"
14937
+ ].filter(Boolean).join(" and ") || "it"} of ${n.label}${n.page ? ` on ${n.page}` : ""}`;
14938
+ }
14772
14939
  case "removeSection": return `Remove ${i(e.sectionId)}${a(e.sectionId)}`;
14773
14940
  case "moveSection": return `Move ${i(e.sectionId)}${a(e.sectionId)}`;
14774
14941
  case "duplicateSection": return `Make a copy of ${i(e.sectionId)}${a(e.sectionId)}`;
14775
- case "setBrand": return `Update the brand (${Object.keys(e.tokens).map((e) => Xo[e] ?? "a brand setting").join(", ")})`;
14942
+ case "setBrand": return `Update the brand (${Object.keys(e.tokens).map((e) => us[e] ?? "a brand setting").join(", ")})`;
14776
14943
  case "addPage": return `Add a new page called "${e.name}"`;
14777
14944
  case "renamePage": return `Rename ${n(e.pageId)?.name ?? "a page"} to "${e.name}"`;
14778
14945
  }
14779
14946
  }
14780
14947
  //#endregion
14781
14948
  //#region src/v2/sol/prompt.ts
14782
- var Qo = "You are SOL, a friendly assistant inside a website builder. The site owner is not technical: speak plainly, never mention JSON, ids, code or \"blocks\" in what you say to them.\n\nYou are given two JSON documents: \"catalog\" (every kind of section you can add, its layouts and the fields you can fill in) and \"design\" (the site's pages, their sections in order, and the brand). Only use kinds, layouts and fields that appear in the catalog, and only refer to pages and sections by the ids in \"design\".\n\nWhen the owner asks for a change, reply with one or two short, warm sentences explaining what you suggest, then a fenced block of changes like this:\n\n```plexo-commands\n[\n {\"op\": \"addSection\", \"pageId\": \"<page id>\", \"kind\": \"hero\", \"variant\": \"<layout id>\", \"content\": {\"headline\": \"...\"}, \"afterSectionId\": \"<section id>\"},\n {\"op\": \"updateSection\", \"sectionId\": \"<section id>\", \"content\": {\"heading\": \"...\"}, \"variant\": \"<layout id>\", \"style\": {\"background\": \"surface\", \"align\": \"center\", \"spacing\": \"airy\"}},\n {\"op\": \"removeSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"moveSection\", \"sectionId\": \"<section id>\", \"index\": 0},\n {\"op\": \"duplicateSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"setBrand\", \"tokens\": {\"primaryColor\": \"#1D4ED8\", \"headingFont\": \"Poppins\", \"bodyFont\": \"Inter\", \"neutrals\": \"warm\", \"roundness\": \"round\"}},\n {\"op\": \"addPage\", \"name\": \"About\", \"templateId\": \"<optional, from catalog.pageTemplates>\"},\n {\"op\": \"renamePage\", \"pageId\": \"<page id>\", \"name\": \"Our story\"}\n]\n```\n\nRules:\n- The owner always reviews and approves your changes before anything happens, so suggest them confidently, but keep each suggestion small and focused.\n- Content keys are the field paths from the catalog (\"headline\", \"items.0.title\"). A list field needs the whole list. Keep text within each field's \"max\".\n- Write real, specific copy for the owner's business; never lorem ipsum.\n- Sections marked freeForm in \"design\" were designed by hand: you may move, copy or remove them but not edit their content. Add a new section instead.\n- If you only need to answer a question or give advice, reply in plain text with no block.", $o = 16;
14783
- function es(e, t, n = 0) {
14949
+ var fs = "You are SOL, a friendly assistant inside a website builder. The site owner is not technical: speak plainly, never mention JSON, ids, code or \"blocks\" in what you say to them.\n\nYou are given two JSON documents: \"catalog\" (every kind of section you can add, its layouts and the fields you can fill in) and \"design\" (the site's pages, their sections in order, and the brand). Only use kinds, layouts and fields that appear in the catalog, and only refer to pages and sections by the ids in \"design\".\n\nWhen the owner asks for a change, reply with one or two short, warm sentences explaining what you suggest, then a fenced block of changes like this:\n\n```plexo-commands\n[\n {\"op\": \"addSection\", \"pageId\": \"<page id>\", \"kind\": \"hero\", \"variant\": \"<layout id>\", \"content\": {\"headline\": \"...\"}, \"afterSectionId\": \"<section id>\"},\n {\"op\": \"updateSection\", \"sectionId\": \"<section id>\", \"content\": {\"heading\": \"...\"}, \"variant\": \"<layout id>\", \"style\": {\"background\": \"surface\", \"align\": \"center\", \"spacing\": \"airy\"}},\n {\"op\": \"updateElement\", \"nodeId\": \"<element id>\", \"text\": \"...\", \"href\": \"/about\", \"alt\": \"...\", \"style\": {\"fontSize\": \"56px\", \"fontWeight\": \"700\", \"textAlign\": \"center\", \"textColor\": \"#111111\", \"lineHeight\": \"1.1\", \"letterSpacing\": \"-0.02em\", \"textTransform\": \"none\"}},\n {\"op\": \"removeSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"moveSection\", \"sectionId\": \"<section id>\", \"index\": 0},\n {\"op\": \"duplicateSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"setBrand\", \"tokens\": {\"primaryColor\": \"#1D4ED8\", \"headingFont\": \"Poppins\", \"bodyFont\": \"Inter\", \"neutrals\": \"warm\", \"roundness\": \"round\"}},\n {\"op\": \"addPage\", \"name\": \"About\", \"templateId\": \"<optional, from catalog.pageTemplates>\"},\n {\"op\": \"renamePage\", \"pageId\": \"<page id>\", \"name\": \"Our story\"}\n]\n```\n\nRules:\n- The owner always reviews and approves your changes before anything happens, so suggest them confidently, but keep each suggestion small and focused.\n- Content keys are the field paths from the catalog (\"headline\", \"items.0.title\"). A list field needs the whole list. Keep text within each field's \"max\".\n- Write real, specific copy for the owner's business; never lorem ipsum.\n- Sections marked freeForm in \"design\" were designed by hand, so they have no fields: change what is inside them with updateElement, using the element ids listed in that section's \"elements\" (headlines, paragraphs, buttons, pictures). \"text\" replaces its words, \"href\" its link, \"alt\" a picture's description, and \"style\" only the keys shown above. Each updateElement changes one element; send one per element. For a managed section (one with a kind) always use updateSection instead.\n- When the owner has selected an element, \"Asking about\" gives its id: edit that element, not a different one. Make real, specific changes: a punchier headline is new words, not a restyle.\n- If you only need to answer a question or give advice, reply in plain text with no block.", ps = 16;
14950
+ function ms(e, t, n = 0) {
14784
14951
  return n > 12 ? e : e.replace(/var\(\s*(--[A-Za-z0-9_-]+)\s*(?:,\s*((?:[^()]|\([^()]*\))*))?\)/g, (e, r, i) => {
14785
14952
  let a = t.get(r);
14786
- return a ? es(O(a), t, n + 1) : i === void 0 ? "NaN" : es(i.trim(), t, n + 1);
14953
+ return a ? ms(O(a), t, n + 1) : i === void 0 ? "NaN" : ms(i.trim(), t, n + 1);
14787
14954
  });
14788
14955
  }
14789
- function ts(e, t) {
14790
- let n = es(e.trim(), t.tokens ?? /* @__PURE__ */ new Map()), r = 0, i = () => {
14956
+ function hs(e, t) {
14957
+ let n = ms(e.trim(), t.tokens ?? /* @__PURE__ */ new Map()), r = 0, i = () => {
14791
14958
  for (; r < n.length && /\s/.test(n[r]);) r += 1;
14792
14959
  }, a = () => {
14793
14960
  throw Error("bad");
@@ -14876,57 +15043,57 @@ function ts(e, t) {
14876
15043
  return null;
14877
15044
  }
14878
15045
  }
14879
- var ns = {
15046
+ var gs = {
14880
15047
  tablet: .8,
14881
15048
  mobile: .6
14882
- }, rs = 40;
14883
- function is(e, t) {
15049
+ }, _s = 40;
15050
+ function vs(e, t) {
14884
15051
  return t === "desktop" || e.responsive?.tablet?.fontSize !== void 0 ? !1 : t === "tablet" || e.responsive?.mobile?.fontSize === void 0;
14885
15052
  }
14886
- function as(e, t) {
14887
- return e <= rs ? e : Math.max(rs, e * ns[t]);
15053
+ function ys(e, t) {
15054
+ return e <= _s ? e : Math.max(_s, e * gs[t]);
14888
15055
  }
14889
- function os(e, t) {
15056
+ function bs(e, t) {
14890
15057
  let n = e.trim(), r = /^(\d*\.?\d+)(px|rem)$/i.exec(n);
14891
15058
  if (r) {
14892
15059
  let e = parseFloat(r[1]) * (r[2].toLowerCase() === "rem" ? 16 : 1);
14893
- if (e <= rs) return n;
14894
- let i = as(e, t);
15060
+ if (e <= _s) return n;
15061
+ let i = ys(e, t);
14895
15062
  return r[2].toLowerCase() === "rem" ? `${Math.round(i / 16 * 1e3) / 1e3}rem` : `${Math.round(i * 10) / 10}px`;
14896
15063
  }
14897
- return /^(?:var|calc|clamp|min|max)\(/i.test(n) && n.length < 300 ? `max(min(${n}, ${rs}px), calc(${n} * ${ns[t]}))` : n;
15064
+ return /^(?:var|calc|clamp|min|max)\(/i.test(n) && n.length < 300 ? `max(min(${n}, ${_s}px), calc(${n} * ${gs[t]}))` : n;
14898
15065
  }
14899
- var ss = (e, t = 10) => Math.round(e * t) / t;
14900
- function cs(e, t) {
15066
+ var xs = (e, t = 10) => Math.round(e * t) / t;
15067
+ function Ss(e, t) {
14901
15068
  return je(t.textStyle) ? t.textStyle : e.type === "heading" ? Ie(e.props?.level) : null;
14902
15069
  }
14903
- function ls(e, t) {
14904
- return e ? ts(/^-?[\d.]+$/.test(e.trim()) ? `${e.trim()}px` : e, {
15070
+ function Cs(e, t) {
15071
+ return e ? hs(/^-?[\d.]+$/.test(e.trim()) ? `${e.trim()}px` : e, {
14905
15072
  ...t,
14906
15073
  tokens: t.tokens
14907
15074
  }) : null;
14908
15075
  }
14909
- function us(e, t, n, r) {
14910
- let i = E(n), a = fe[r], o = cs(e, t), s = o ? Me(o) : null, c = {
15076
+ function ws(e, t, n, r) {
15077
+ let i = E(n), a = fe[r], o = Ss(e, t), s = o ? Me(o) : null, c = {
14911
15078
  tokens: i,
14912
15079
  width: a,
14913
15080
  fontPx: 16
14914
- }, l = ls(t.fontSize, c), u = l !== null && is(e, r) ? as(l, r) : l, d = s ? ts(s.size[r], c) : null, f = u ?? d ?? 16, p = {
15081
+ }, l = Cs(t.fontSize, c), u = l !== null && vs(e, r) ? ys(l, r) : l, d = s ? hs(s.size[r], c) : null, f = u ?? d ?? 16, p = {
14915
15082
  ...c,
14916
15083
  fontPx: f
14917
15084
  }, m = null, h = !1;
14918
15085
  if (t.lineHeight) {
14919
15086
  let e = String(t.lineHeight).trim(), n = /^-?[\d.]+$/.test(e) ? parseFloat(e) : /%$/.test(e) ? parseFloat(e) / 100 : (() => {
14920
- let t = ts(e, p);
15087
+ let t = hs(e, p);
14921
15088
  return t === null ? null : t / f;
14922
15089
  })();
14923
15090
  n !== null && Number.isFinite(n) && n > 0 && (m = n, h = !0);
14924
15091
  }
14925
- m === null && (m = s ? ts(s.line, p) : null), m === null && (m = 1.5);
14926
- let g = t.isBold ? 700 : Number(t.fontWeight ?? (s ? ts(s.weight, p) : 400)), _ = t.fontFamily ?? es(s && s.family === "heading" ? "var(--semantic-font-family-heading, var(--font-family-sans))" : "var(--semantic-font-family-body, var(--font-family-sans))", i);
15092
+ m === null && (m = s ? hs(s.line, p) : null), m === null && (m = 1.5);
15093
+ let g = t.isBold ? 700 : Number(t.fontWeight ?? (s ? hs(s.weight, p) : 400)), _ = t.fontFamily ?? ms(s && s.family === "heading" ? "var(--semantic-font-family-heading, var(--font-family-sans))" : "var(--semantic-font-family-body, var(--font-family-sans))", i);
14927
15094
  return {
14928
- fontSize: ss(f),
14929
- lineHeight: ss(m, 100),
15095
+ fontSize: xs(f),
15096
+ lineHeight: xs(m, 100),
14930
15097
  fontWeight: Number.isFinite(g) ? g : 400,
14931
15098
  fontFamily: v(_),
14932
15099
  textStyle: o,
@@ -14940,7 +15107,7 @@ function us(e, t, n, r) {
14940
15107
  }
14941
15108
  //#endregion
14942
15109
  //#region src/v2/design/css.ts
14943
- var ds = {
15110
+ var Ts = {
14944
15111
  compact: {
14945
15112
  desktop: {
14946
15113
  y: "3.5rem",
@@ -14993,11 +15160,11 @@ var ds = {
14993
15160
  }
14994
15161
  }
14995
15162
  };
14996
- function fs(e) {
15163
+ function Es(e) {
14997
15164
  return Object.fromEntries(e.tokens.map((e) => [e.key, O(e)]));
14998
15165
  }
14999
- function ps(e, t) {
15000
- let n = ds[e.options?.density ?? "comfortable"][t], r = E(e), i = r.get("--color-action-primary-bg"), a = r.get("--color-action-primary-text"), o = i && Ha(ie(r, O(i)), a ? ie(r, O(a)) : void 0) || "#FFFFFF";
15166
+ function Ds(e, t) {
15167
+ let n = Ts[e.options?.density ?? "comfortable"][t], r = E(e), i = r.get("--color-action-primary-bg"), a = r.get("--color-action-primary-text"), o = i && Ha(ie(r, O(i)), a ? ie(r, O(a)) : void 0) || "#FFFFFF";
15001
15168
  return {
15002
15169
  ...Pe(t),
15003
15170
  "--plx-on-accent": o,
@@ -15008,39 +15175,39 @@ function ps(e, t) {
15008
15175
  "--plx-accent": "var(--color-action-primary-bg)"
15009
15176
  };
15010
15177
  }
15011
- function ms(e, t) {
15178
+ function Os(e, t) {
15012
15179
  return {
15013
- ...fs(e),
15014
- ...ps(e, t)
15180
+ ...Es(e),
15181
+ ...Ds(e, t)
15015
15182
  };
15016
15183
  }
15017
- var hs = /var\(\s*(--[A-Za-z0-9_-]+)/g, gs = (e) => [...e.matchAll(hs)].map((e) => e[1]);
15018
- function _s(e, t) {
15019
- let n = E(e), r = ps(e, "desktop"), i = ps(e, "tablet"), a = ps(e, "mobile"), o = (e) => {
15184
+ var ks = /var\(\s*(--[A-Za-z0-9_-]+)/g, As = (e) => [...e.matchAll(ks)].map((e) => e[1]);
15185
+ function js(e, t) {
15186
+ let n = E(e), r = Ds(e, "desktop"), i = Ds(e, "tablet"), a = Ds(e, "mobile"), o = (e) => {
15020
15187
  if (e in r) return r[e];
15021
15188
  let t = n.get(e);
15022
15189
  return t ? O(t) : void 0;
15023
- }, s = /* @__PURE__ */ new Set(), c = {}, l = gs(t);
15190
+ }, s = /* @__PURE__ */ new Set(), c = {}, l = As(t);
15024
15191
  for (; l.length;) {
15025
15192
  let e = l.pop();
15026
15193
  if (s.has(e)) continue;
15027
15194
  let t = o(e);
15028
- t !== void 0 && (s.add(e), c[e] = t, l.push(...gs(t)), e in i && l.push(...gs(i[e])), e in a && l.push(...gs(a[e])));
15195
+ t !== void 0 && (s.add(e), c[e] = t, l.push(...As(t)), e in i && l.push(...As(i[e])), e in a && l.push(...As(a[e])));
15029
15196
  }
15030
15197
  return {
15031
15198
  needed: s,
15032
15199
  vars: c
15033
15200
  };
15034
15201
  }
15035
- function vs(e, t, n) {
15036
- let { vars: r } = _s(e, `${n} var(--color-brand-primary-500) var(--color-text-primary) var(--color-text-muted) var(--color-border-default) var(--color-bg-surface) var(--color-bg-canvas) var(--radius-lg) var(--font-family-body)`);
15202
+ function Ms(e, t, n) {
15203
+ let { vars: r } = js(e, `${n} var(--color-brand-primary-500) var(--color-text-primary) var(--color-text-muted) var(--color-border-default) var(--color-bg-surface) var(--color-bg-canvas) var(--radius-lg) var(--font-family-body)`);
15037
15204
  return {
15038
15205
  ...r,
15039
- ...ps(e, t)
15206
+ ...Ds(e, t)
15040
15207
  };
15041
15208
  }
15042
- function ys(e, t) {
15043
- let { needed: n } = _s(e, t), r = E(e), i = /* @__PURE__ */ new Set();
15209
+ function Ns(e, t) {
15210
+ let { needed: n } = js(e, t), r = E(e), i = /* @__PURE__ */ new Set();
15044
15211
  for (let e of n) {
15045
15212
  let t = r.get(e);
15046
15213
  if (!t || t.type !== "font family") continue;
@@ -15049,17 +15216,17 @@ function ys(e, t) {
15049
15216
  }
15050
15217
  return [...i];
15051
15218
  }
15052
- function bs(e, t) {
15053
- let { needed: n, vars: r } = _s(e, t), i = (e, t) => e.map((e) => `${e}:${t[e]}`).join(";"), a = [`.plx-page{${i([...n], r)}}`];
15219
+ function Ps(e, t) {
15220
+ let { needed: n, vars: r } = js(e, t), i = (e, t) => e.map((e) => `${e}:${t[e]}`).join(";"), a = [`.plx-page{${i([...n], r)}}`];
15054
15221
  for (let [t, r] of [["tablet", "(max-width: 1023px)"], ["mobile", "(max-width: 599px)"]]) {
15055
- let o = ps(e, t), s = ps(e, t === "tablet" ? "desktop" : "tablet"), c = Object.keys(o).filter((e) => n.has(e) && o[e] !== s[e]);
15222
+ let o = Ds(e, t), s = Ds(e, t === "tablet" ? "desktop" : "tablet"), c = Object.keys(o).filter((e) => n.has(e) && o[e] !== s[e]);
15056
15223
  c.length && a.push(`@container plx-page ${r}{.plx-page>*{${i(c, o)}}}`);
15057
15224
  }
15058
15225
  return a.join("\n");
15059
15226
  }
15060
15227
  //#endregion
15061
15228
  //#region src/v2/design/audit.ts
15062
- var xs = [
15229
+ var Fs = [
15063
15230
  "color",
15064
15231
  "font",
15065
15232
  "fontSize",
@@ -15067,7 +15234,7 @@ var xs = [
15067
15234
  "radius",
15068
15235
  "shadow",
15069
15236
  "spacing"
15070
- ], Ss = {
15237
+ ], Is = {
15071
15238
  color: {
15072
15239
  one: "colour",
15073
15240
  many: "colours",
@@ -15103,14 +15270,14 @@ var xs = [
15103
15270
  many: "spacings",
15104
15271
  nearest: "brand spacing"
15105
15272
  }
15106
- }, Cs = [
15273
+ }, Ls = [
15107
15274
  "textColor",
15108
15275
  "backgroundColor",
15109
15276
  "darkModeBackgroundColor",
15110
15277
  "borderColor",
15111
15278
  "linkColor",
15112
15279
  "linkHoverColor"
15113
- ], ws = [
15280
+ ], Rs = [
15114
15281
  "padding",
15115
15282
  "paddingTop",
15116
15283
  "paddingBottom",
@@ -15123,56 +15290,56 @@ var xs = [
15123
15290
  "marginRight",
15124
15291
  "gap",
15125
15292
  "gridGap"
15126
- ], Ts = /^(#[0-9a-f]{3,8}|rgba?\([^)]*\)|hsla?\([^)]*\)|white|black)$/i, Es = /#[0-9a-f]{8}\b|#[0-9a-f]{6}\b|#[0-9a-f]{3,4}\b|rgba?\([^)]*\)|hsla?\([^)]*\)/gi, Ds = /^(\d*\.?\d+)(px|rem)$/i, Os = (e, t = 2) => Math.round(e * 10 ** t) / 10 ** t, ks = (e) => {
15127
- let t = Ds.exec(e.trim());
15293
+ ], zs = /^(#[0-9a-f]{3,8}|rgba?\([^)]*\)|hsla?\([^)]*\)|white|black)$/i, Bs = /#[0-9a-f]{8}\b|#[0-9a-f]{6}\b|#[0-9a-f]{3,4}\b|rgba?\([^)]*\)|hsla?\([^)]*\)/gi, Vs = /^(\d*\.?\d+)(px|rem)$/i, Hs = (e, t = 2) => Math.round(e * 10 ** t) / 10 ** t, Us = (e) => {
15294
+ let t = Vs.exec(e.trim());
15128
15295
  if (!t) return null;
15129
15296
  let n = parseFloat(t[1]);
15130
15297
  return t[2].toLowerCase() === "rem" ? n * 16 : n;
15131
- }, As = (e) => Ts.test(e.trim()) && (f(e)?.a ?? 0) > 0, js = (e) => {
15298
+ }, Ws = (e) => zs.test(e.trim()) && (f(e)?.a ?? 0) > 0, Gs = (e) => {
15132
15299
  let t = f(e);
15133
15300
  return !t || t.a <= 0 ? null : m({
15134
15301
  ...t,
15135
- a: Os(t.a, 2)
15302
+ a: Hs(t.a, 2)
15136
15303
  }).toLowerCase();
15137
- }, Ms = (e) => e.trim().toLowerCase().replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").replace(/\(\s+/g, "(").replace(/\s+\)/g, ")");
15138
- function Ns(e, t) {
15304
+ }, Ks = (e) => e.trim().toLowerCase().replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").replace(/\(\s+/g, "(").replace(/\s+\)/g, ")");
15305
+ function qs(e, t) {
15139
15306
  switch (e) {
15140
- case "color": return js(t);
15307
+ case "color": return Gs(t);
15141
15308
  case "font": return v(t).toLowerCase() || null;
15142
15309
  case "fontSize":
15143
15310
  case "radius":
15144
15311
  case "spacing": {
15145
- let e = ks(t);
15146
- return e === null || e <= 0 ? null : `${Os(e)}px`;
15312
+ let e = Us(t);
15313
+ return e === null || e <= 0 ? null : `${Hs(e)}px`;
15147
15314
  }
15148
15315
  case "lineHeight": {
15149
15316
  let e = parseFloat(t);
15150
- return Number.isFinite(e) && e > 0 ? String(Os(e)) : null;
15317
+ return Number.isFinite(e) && e > 0 ? String(Hs(e)) : null;
15151
15318
  }
15152
- case "shadow": return Ms(t) || null;
15319
+ case "shadow": return Ks(t) || null;
15153
15320
  }
15154
15321
  }
15155
- function Ps(e, t) {
15322
+ function Js(e, t) {
15156
15323
  if (!e) return e;
15157
15324
  let n = null, r = e, i = (e, t) => {
15158
15325
  t !== r[e] && (n ??= { ...r }, n[e] = t);
15159
15326
  }, a = (e) => typeof r[e] == "string" && !r[e].includes("var(") ? r[e].trim() : null;
15160
- for (let e of Cs) {
15327
+ for (let e of Ls) {
15161
15328
  let n = a(e);
15162
- if (n && As(n)) {
15329
+ if (n && Ws(n)) {
15163
15330
  let r = t("color", n);
15164
15331
  r !== void 0 && i(e, r);
15165
15332
  }
15166
15333
  }
15167
15334
  let o = typeof r.backgroundGradient == "string" ? r.backgroundGradient : null;
15168
- o && i("backgroundGradient", o.replace(Es, (e) => As(e) ? t("color", e) ?? e : e));
15335
+ o && i("backgroundGradient", o.replace(Bs, (e) => Ws(e) ? t("color", e) ?? e : e));
15169
15336
  let s = a("fontFamily");
15170
15337
  if (s && !/^(inherit|initial|unset)$/i.test(s)) {
15171
15338
  let e = t("font", s);
15172
15339
  e !== void 0 && i("fontFamily", e);
15173
15340
  }
15174
15341
  let c = a("fontSize");
15175
- if (c && Ds.test(c)) {
15342
+ if (c && Vs.test(c)) {
15176
15343
  let e = t("fontSize", c);
15177
15344
  e !== void 0 && i("fontSize", e);
15178
15345
  }
@@ -15189,21 +15356,21 @@ function Ps(e, t) {
15189
15356
  let d = (e, n) => {
15190
15357
  let r = a(e);
15191
15358
  if (!r || r.includes("(")) return;
15192
- let o = r.split(/\s+/).map((e) => Ds.test(e) && (ks(e) ?? 0) > 0 ? t(n, e) ?? e : e).join(" ");
15359
+ let o = r.split(/\s+/).map((e) => Vs.test(e) && (Us(e) ?? 0) > 0 ? t(n, e) ?? e : e).join(" ");
15193
15360
  i(e, o);
15194
15361
  };
15195
15362
  d("borderRadius", "radius");
15196
- for (let e of ws) d(e, "spacing");
15363
+ for (let e of Rs) d(e, "spacing");
15197
15364
  return n ?? e;
15198
15365
  }
15199
- var Fs = (e) => {
15366
+ var Ys = (e) => {
15200
15367
  let t = e.type === "section" ? e.props?.block : void 0;
15201
15368
  return t && typeof t == "object" && typeof t.kind == "string" ? t : null;
15202
- }, Is = "__", Ls = (e, t) => t === e ? "@section" : t.startsWith(`${e}${Is}`) ? t.slice(e.length + 2) : t;
15203
- function Rs(e, t) {
15369
+ }, Xs = "__", Zs = (e, t) => t === e ? "@section" : t.startsWith(`${e}${Xs}`) ? t.slice(e.length + 2) : t;
15370
+ function Qs(e, t) {
15204
15371
  if (!e.overrides) return e;
15205
15372
  let n = !1, r = Object.fromEntries(Object.entries(e.overrides).map(([e, r]) => {
15206
- let i = Ps(r.styles, t), a = Ps(r.responsive?.tablet, t), o = Ps(r.responsive?.mobile, t);
15373
+ let i = Js(r.styles, t), a = Js(r.responsive?.tablet, t), o = Js(r.responsive?.mobile, t);
15207
15374
  return i === r.styles && a === r.responsive?.tablet && o === r.responsive?.mobile ? [e, r] : (n = !0, [e, {
15208
15375
  ...r,
15209
15376
  styles: i,
@@ -15219,13 +15386,13 @@ function Rs(e, t) {
15219
15386
  overrides: r
15220
15387
  } : e;
15221
15388
  }
15222
- function zs(e, t, n) {
15223
- let r = Fs(e);
15389
+ function $s(e, t, n) {
15390
+ let r = Ys(e);
15224
15391
  if (r) {
15225
- let i = Rs(r, t);
15392
+ let i = Qs(r, t);
15226
15393
  if (!n || i === r) return e;
15227
15394
  let a = i.overrides ?? {};
15228
- return Bs({
15395
+ return ec({
15229
15396
  ...e,
15230
15397
  props: {
15231
15398
  ...e.props,
@@ -15233,7 +15400,7 @@ function zs(e, t, n) {
15233
15400
  }
15234
15401
  }, e.id, a);
15235
15402
  }
15236
- let i = Ps(e.styles, t), a = Ps(e.responsive?.tablet, t), o = Ps(e.responsive?.mobile, t), s = e.children?.map((e) => zs(e, t, n)), c = !s || s.every((t, n) => t === e.children[n]);
15403
+ let i = Js(e.styles, t), a = Js(e.responsive?.tablet, t), o = Js(e.responsive?.mobile, t), s = e.children?.map((e) => $s(e, t, n)), c = !s || s.every((t, n) => t === e.children[n]);
15237
15404
  return i === e.styles && a === e.responsive?.tablet && o === e.responsive?.mobile && c ? e : {
15238
15405
  ...e,
15239
15406
  styles: i,
@@ -15245,9 +15412,9 @@ function zs(e, t, n) {
15245
15412
  ...s ? { children: s } : {}
15246
15413
  };
15247
15414
  }
15248
- function Bs(e, t, n) {
15415
+ function ec(e, t, n) {
15249
15416
  let r = (e) => {
15250
- let i = n[Ls(t, e.id)], a = e.children?.map(r);
15417
+ let i = n[Zs(t, e.id)], a = e.children?.map(r);
15251
15418
  return i ? {
15252
15419
  ...e,
15253
15420
  ...a ? { children: a } : {},
@@ -15272,7 +15439,7 @@ function Bs(e, t, n) {
15272
15439
  };
15273
15440
  return r(e);
15274
15441
  }
15275
- var Vs = {
15442
+ var tc = {
15276
15443
  font: "--font-family-",
15277
15444
  fontSize: "--font-size-",
15278
15445
  lineHeight: "--line-height-",
@@ -15280,27 +15447,27 @@ var Vs = {
15280
15447
  shadow: "--shadow-",
15281
15448
  spacing: "--space-"
15282
15449
  };
15283
- function Hs(e) {
15450
+ function nc(e) {
15284
15451
  let t = (e.name && !e.name.startsWith("--") ? e.name : e.key.replace(/^--/, "").replace(/-/g, " ")).replace(/^(Color|Semantic) /i, "");
15285
15452
  return t = t.replace(/^Brand (Primary|Secondary) 500$/i, "$1").replace(/^Brand /i, ""), t;
15286
15453
  }
15287
- function Us(e, t) {
15288
- let n = [], r = Vs[t];
15454
+ function rc(e, t) {
15455
+ let n = [], r = tc[t];
15289
15456
  for (let i of e.tokens) {
15290
15457
  if (t === "color" ? !(i.type === "color" && i.layer !== "component") : !(r && i.key.startsWith(r))) continue;
15291
15458
  let a = T(e, i.key);
15292
15459
  if (a === void 0) continue;
15293
- let o = Ns(t, a);
15460
+ let o = qs(t, a);
15294
15461
  o && n.push({
15295
15462
  key: i.key,
15296
- name: Hs(i),
15463
+ name: nc(i),
15297
15464
  norm: o,
15298
15465
  layer: i.layer
15299
15466
  });
15300
15467
  }
15301
15468
  return n;
15302
15469
  }
15303
- function Ws(e) {
15470
+ function ic(e) {
15304
15471
  let t = f(e), n = (e) => {
15305
15472
  let t = e / 255;
15306
15473
  return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
@@ -15315,16 +15482,16 @@ function Ws(e) {
15315
15482
  200 * (l(s) - l(c))
15316
15483
  ];
15317
15484
  }
15318
- var Gs = (e) => f(e)?.a ?? 1;
15319
- function Ks(e, t) {
15320
- let n = Math.abs(Gs(e) - Gs(t));
15485
+ var ac = (e) => f(e)?.a ?? 1;
15486
+ function oc(e, t) {
15487
+ let n = Math.abs(ac(e) - ac(t));
15321
15488
  if (n > .06) return Infinity;
15322
- let [r, i, a] = Ws(e), [o, s, c] = Ws(t);
15489
+ let [r, i, a] = ic(e), [o, s, c] = ic(t);
15323
15490
  return Math.sqrt((r - o) ** 2 + (i - s) ** 2 + (a - c) ** 2) + n * 100;
15324
15491
  }
15325
- function qs(e, t, n) {
15492
+ function sc(e, t, n) {
15326
15493
  switch (e) {
15327
- case "color": return Ks(t, n);
15494
+ case "color": return oc(t, n);
15328
15495
  case "fontSize":
15329
15496
  case "radius":
15330
15497
  case "spacing": return Math.abs(parseFloat(t) - parseFloat(n));
@@ -15332,8 +15499,8 @@ function qs(e, t, n) {
15332
15499
  default: return t === n ? 0 : Infinity;
15333
15500
  }
15334
15501
  }
15335
- var Js = (e) => e === "color" ? 1.5 : e === "lineHeight" ? .02 : .5;
15336
- function Ys(e, t, n, r) {
15502
+ var cc = (e) => e === "color" ? 1.5 : e === "lineHeight" ? .02 : .5;
15503
+ function lc(e, t, n, r) {
15337
15504
  return e === "color" ? {
15338
15505
  ok: t <= 10,
15339
15506
  level: t <= 3 ? "almost identical" : t <= 6 ? "very close" : "close"
@@ -15351,15 +15518,15 @@ function Ys(e, t, n, r) {
15351
15518
  level: "almost identical"
15352
15519
  };
15353
15520
  }
15354
- var Xs = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), Zs = (e) => {
15521
+ var uc = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), dc = (e) => {
15355
15522
  let t = f(e);
15356
15523
  return Math.max(t.r, t.g, t.b) - Math.min(t.r, t.g, t.b) < 24;
15357
15524
  };
15358
- function Qs(e, t, n, r) {
15525
+ function fc(e, t, n, r) {
15359
15526
  let i;
15360
15527
  switch (e) {
15361
15528
  case "color":
15362
- i = Zs(t) ? {
15529
+ i = dc(t) ? {
15363
15530
  key: "--color-neutral-custom",
15364
15531
  name: "Neutral",
15365
15532
  numbered: !0
@@ -15371,10 +15538,10 @@ function Qs(e, t, n, r) {
15371
15538
  break;
15372
15539
  case "font": {
15373
15540
  let e = v(n);
15374
- return $s(`--font-family-${Xs(e) || "custom"}`, e, !1, r);
15541
+ return pc(`--font-family-${uc(e) || "custom"}`, e, !1, r);
15375
15542
  }
15376
15543
  case "fontSize":
15377
- i = (ks(t) ?? 0) >= 28 ? {
15544
+ i = (Us(t) ?? 0) >= 28 ? {
15378
15545
  key: "--font-size-heading",
15379
15546
  name: "Heading size",
15380
15547
  numbered: !0
@@ -15413,9 +15580,9 @@ function Qs(e, t, n, r) {
15413
15580
  };
15414
15581
  break;
15415
15582
  }
15416
- return $s(i.key, i.name, !0, r);
15583
+ return pc(i.key, i.name, !0, r);
15417
15584
  }
15418
- function $s(e, t, n, r) {
15585
+ function pc(e, t, n, r) {
15419
15586
  if (!n) {
15420
15587
  let n = e, i = 2;
15421
15588
  for (; r.has(n);) n = `${e}-${i++}`;
@@ -15431,10 +15598,10 @@ function $s(e, t, n, r) {
15431
15598
  name: `${t} ${i}`
15432
15599
  };
15433
15600
  }
15434
- function ec(e) {
15601
+ function mc(e) {
15435
15602
  let t = /* @__PURE__ */ new Map();
15436
- for (let n of e) zs(n.rootNode, (e, r) => {
15437
- let i = Ns(e, r);
15603
+ for (let n of e) $s(n.rootNode, (e, r) => {
15604
+ let i = qs(e, r);
15438
15605
  if (!i) return;
15439
15606
  let a = `${e}:${i}`, o = t.get(a);
15440
15607
  o || t.set(a, o = {
@@ -15447,25 +15614,25 @@ function ec(e) {
15447
15614
  }, !1);
15448
15615
  return t;
15449
15616
  }
15450
- var tc = (e) => [...e.entries()].sort((e, t) => t[1] - e[1])[0][0];
15451
- function nc(e, t, n = {}) {
15452
- let r = n.minorBelow ?? 2, i = ec(e), a = new Set(t.tokens.map((e) => e.key)), o = [];
15453
- for (let e of xs) {
15454
- let n = Us(t, e), s = new Set(n.map((e) => e.norm)), c = [...i.values()].filter((t) => t.kind === e && !s.has(t.norm)).sort((e, t) => t.uses - e.uses || e.norm.localeCompare(t.norm)), l = [];
15617
+ var hc = (e) => [...e.entries()].sort((e, t) => t[1] - e[1])[0][0];
15618
+ function gc(e, t, n = {}) {
15619
+ let r = n.minorBelow ?? 2, i = mc(e), a = new Set(t.tokens.map((e) => e.key)), o = [];
15620
+ for (let e of Fs) {
15621
+ let n = rc(t, e), s = new Set(n.map((e) => e.norm)), c = [...i.values()].filter((t) => t.kind === e && !s.has(t.norm)).sort((e, t) => t.uses - e.uses || e.norm.localeCompare(t.norm)), l = [];
15455
15622
  for (let t of c) {
15456
- let n = l.find((n) => qs(e, n.rep.norm, t.norm) <= Js(e));
15623
+ let n = l.find((n) => sc(e, n.rep.norm, t.norm) <= cc(e));
15457
15624
  n ? n.members.push(t) : l.push({
15458
15625
  rep: t,
15459
15626
  members: [t]
15460
15627
  });
15461
15628
  }
15462
15629
  for (let { rep: t, members: i } of l) {
15463
- let s = i.reduce((e, t) => e + t.uses, 0), c = tc(t.raws), l = [...new Set(i.flatMap((e) => [...e.pages]))], u = [...new Set(i.flatMap((e) => [...e.raws.keys()]))], d, f = Infinity;
15630
+ let s = i.reduce((e, t) => e + t.uses, 0), c = hc(t.raws), l = [...new Set(i.flatMap((e) => [...e.pages]))], u = [...new Set(i.flatMap((e) => [...e.raws.keys()]))], d, f = Infinity;
15464
15631
  for (let r of n) {
15465
- if (e !== "color" && e !== "font" && e !== "shadow" && parseFloat(r.norm) === 0 || e === "color" && Gs(r.norm) === 0) continue;
15466
- let i = qs(e, t.norm, r.norm);
15632
+ if (e !== "color" && e !== "font" && e !== "shadow" && parseFloat(r.norm) === 0 || e === "color" && ac(r.norm) === 0) continue;
15633
+ let i = sc(e, t.norm, r.norm);
15467
15634
  if (i < f || i === f && d && r.layer === "brand" && n.find((e) => e.key === d.tokenKey)?.layer !== "brand") {
15468
- let n = Ys(e, i, t.norm, r.norm);
15635
+ let n = lc(e, i, t.norm, r.norm);
15469
15636
  n.ok && (f = i, d = {
15470
15637
  tokenKey: r.key,
15471
15638
  name: r.name,
@@ -15473,9 +15640,9 @@ function nc(e, t, n = {}) {
15473
15640
  });
15474
15641
  }
15475
15642
  }
15476
- let p = Qs(e, t.norm, c, a);
15643
+ let p = fc(e, t.norm, c, a);
15477
15644
  a.add(p.key);
15478
- let m = Ss[e];
15645
+ let m = Is[e];
15479
15646
  o.push({
15480
15647
  id: `${e}:${t.norm}`,
15481
15648
  kind: e,
@@ -15497,23 +15664,23 @@ function nc(e, t, n = {}) {
15497
15664
  }
15498
15665
  }
15499
15666
  o.sort((e, t) => t.uses - e.uses || e.id.localeCompare(t.id));
15500
- let s = Object.fromEntries(xs.map((e) => [e, o.filter((t) => t.kind === e)]));
15667
+ let s = Object.fromEntries(Fs.map((e) => [e, o.filter((t) => t.kind === e)]));
15501
15668
  return {
15502
15669
  findings: o,
15503
15670
  byKind: s,
15504
- counts: Object.fromEntries(xs.map((e) => [e, s[e].length])),
15671
+ counts: Object.fromEntries(Fs.map((e) => [e, s[e].length])),
15505
15672
  total: o.length,
15506
15673
  minorCount: o.filter((e) => e.minor).length
15507
15674
  };
15508
15675
  }
15509
- function rc(e) {
15510
- let t = xs.filter((t) => e.counts[t] > 0).map((t) => `${e.counts[t]} ${e.counts[t] === 1 ? Ss[t].one : Ss[t].many}`);
15676
+ function _c(e) {
15677
+ let t = Fs.filter((t) => e.counts[t] > 0).map((t) => `${e.counts[t]} ${e.counts[t] === 1 ? Is[t].one : Is[t].many}`);
15511
15678
  return t.length <= 1 ? t.join("") : `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}`;
15512
15679
  }
15513
- function ic(e) {
15680
+ function vc(e) {
15514
15681
  return Object.fromEntries(e.findings.map((e) => [e.id, e.minor ? "keep" : e.suggestion.action]));
15515
15682
  }
15516
- function ac(e, t) {
15683
+ function yc(e, t) {
15517
15684
  let n = e.value;
15518
15685
  if (e.kind === "color") {
15519
15686
  let r = f(n);
@@ -15542,7 +15709,7 @@ function ac(e, t) {
15542
15709
  layer: "brand",
15543
15710
  comment: "Added from your pages"
15544
15711
  });
15545
- let r = Ds.exec(n.trim());
15712
+ let r = Vs.exec(n.trim());
15546
15713
  return C(t, e.add.key, String(parseFloat(r[1])), {
15547
15714
  name: e.add.name,
15548
15715
  type: "dimension",
@@ -15551,21 +15718,21 @@ function ac(e, t) {
15551
15718
  comment: "Added from your pages"
15552
15719
  });
15553
15720
  }
15554
- function oc(e, t, n, r = {}) {
15555
- let i = nc(e, t, r), a = t, o = /* @__PURE__ */ new Map(), s = ec(e);
15721
+ function bc(e, t, n, r = {}) {
15722
+ let i = gc(e, t, r), a = t, o = /* @__PURE__ */ new Map(), s = mc(e);
15556
15723
  for (let e of i.findings) {
15557
15724
  let t = n[e.id] ?? "keep", r;
15558
- if (t === "add" ? (a = ac(e, a), r = e.add.key) : t === "match" && e.match && (r = e.match.tokenKey), r) for (let t of s.values()) t.kind === e.kind && (t.norm === e.id.slice(e.kind.length + 1) || qs(e.kind, e.id.slice(e.kind.length + 1), t.norm) <= Js(e.kind)) && o.set(`${t.kind}:${t.norm}`, `var(${r})`);
15725
+ if (t === "add" ? (a = yc(e, a), r = e.add.key) : t === "match" && e.match && (r = e.match.tokenKey), r) for (let t of s.values()) t.kind === e.kind && (t.norm === e.id.slice(e.kind.length + 1) || sc(e.kind, e.id.slice(e.kind.length + 1), t.norm) <= cc(e.kind)) && o.set(`${t.kind}:${t.norm}`, `var(${r})`);
15559
15726
  }
15560
15727
  if (!o.size) return {
15561
15728
  pages: e,
15562
15729
  designSystem: t
15563
15730
  };
15564
15731
  let c = (e, t) => {
15565
- let n = Ns(e, t), r = n ? o.get(`${e}:${n}`) : void 0;
15732
+ let n = qs(e, t), r = n ? o.get(`${e}:${n}`) : void 0;
15566
15733
  if (r) return r;
15567
15734
  }, l = e.map((e) => {
15568
- let t = zs(e.rootNode, c, !0);
15735
+ let t = $s(e.rootNode, c, !0);
15569
15736
  return t === e.rootNode ? e : {
15570
15737
  ...e,
15571
15738
  rootNode: t
@@ -15579,21 +15746,21 @@ function oc(e, t, n, r = {}) {
15579
15746
  designSystem: u
15580
15747
  };
15581
15748
  }
15582
- function sc(e, t) {
15749
+ function xc(e, t) {
15583
15750
  let n = /* @__PURE__ */ new Map();
15584
15751
  for (let e of ["color", "font"]) {
15585
- let r = Us(t, e).sort((e, t) => Number(t.layer === "brand") - Number(e.layer === "brand"));
15752
+ let r = rc(t, e).sort((e, t) => Number(t.layer === "brand") - Number(e.layer === "brand"));
15586
15753
  for (let t of r) {
15587
- if (e === "color" && Gs(t.norm) === 0) continue;
15754
+ if (e === "color" && ac(t.norm) === 0) continue;
15588
15755
  let r = `${e}:${t.norm}`;
15589
15756
  n.has(r) || n.set(r, `var(${t.key})`);
15590
15757
  }
15591
15758
  }
15592
15759
  let r = (e, t) => {
15593
- let r = Ns(e, t);
15760
+ let r = qs(e, t);
15594
15761
  return r ? n.get(`${e}:${r}`) : void 0;
15595
15762
  }, i = !1, a = e.map((e) => {
15596
- let t = zs(e.rootNode, r, !0);
15763
+ let t = $s(e.rootNode, r, !0);
15597
15764
  return t === e.rootNode ? e : (i = !0, {
15598
15765
  ...e,
15599
15766
  rootNode: t
@@ -15601,7 +15768,7 @@ function sc(e, t) {
15601
15768
  });
15602
15769
  return i ? a : e;
15603
15770
  }
15604
- var cc = (e) => {
15771
+ var Sc = (e) => {
15605
15772
  let t = f(e);
15606
15773
  if (!t) return null;
15607
15774
  let n = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(n, r, i), o = Math.min(n, r, i), s = (a + o) / 2, c = a - o;
@@ -15618,31 +15785,31 @@ var cc = (e) => {
15618
15785
  l: s,
15619
15786
  a: t.a ?? 1
15620
15787
  };
15621
- }, lc = (e, t) => {
15788
+ }, Cc = (e, t) => {
15622
15789
  let n = Math.abs(e - t) % 360;
15623
15790
  return n > 180 ? 360 - n : n;
15624
15791
  };
15625
- function uc(e, t) {
15792
+ function wc(e, t) {
15626
15793
  let n = new Set(t.tokens.map((e) => e.key));
15627
15794
  if (!n.has("--color-brand-primary-500")) return e;
15628
- let r = [...ec(e).values()].filter((e) => e.kind === "color").map((e) => ({
15795
+ let r = [...mc(e).values()].filter((e) => e.kind === "color").map((e) => ({
15629
15796
  e,
15630
- c: cc(e.norm)
15797
+ c: Sc(e.norm)
15631
15798
  })).filter((e) => !!e.c && e.c.a > .99 && e.c.s >= .3 && e.c.l >= .1 && e.c.l <= .92).sort((e, t) => t.e.uses - e.e.uses);
15632
15799
  if (!r.length) return e;
15633
15800
  let i = [], a = /* @__PURE__ */ new Map();
15634
15801
  for (let { e, c: t } of r) {
15635
- let r = i.findIndex((e) => lc(e, t.h) <= 28);
15802
+ let r = i.findIndex((e) => Cc(e, t.h) <= 28);
15636
15803
  if (r === -1 && i.length < 2 && (i.push(t.h), r = i.length - 1), r === -1) continue;
15637
15804
  let o = t.l < .35 ? "700" : t.l > .68 ? "300" : "500", s = r === 0 ? `--color-brand-primary-${o}` : n.has("--color-brand-secondary-500") ? "--color-brand-secondary-500" : null;
15638
15805
  s && n.has(s) && a.set(`color:${e.norm}`, `var(${s})`);
15639
15806
  }
15640
15807
  if (!a.size) return e;
15641
15808
  let o = (e, t) => {
15642
- let n = Ns(e, t);
15809
+ let n = qs(e, t);
15643
15810
  return n ? a.get(`${e}:${n}`) : void 0;
15644
15811
  }, s = !1, c = e.map((e) => {
15645
- let t = zs(e.rootNode, o, !0);
15812
+ let t = $s(e.rootNode, o, !0);
15646
15813
  return t === e.rootNode ? e : (s = !0, {
15647
15814
  ...e,
15648
15815
  rootNode: t
@@ -15652,7 +15819,7 @@ function uc(e, t) {
15652
15819
  }
15653
15820
  //#endregion
15654
15821
  //#region src/v2/render/runtime.ts
15655
- function dc(e) {
15822
+ function Tc(e) {
15656
15823
  let t = [], n = (t) => Array.prototype.slice.call(e.querySelectorAll(t)), r = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, i = n(".plx-in");
15657
15824
  if (i.length && !r && typeof IntersectionObserver == "function") {
15658
15825
  let n = e.querySelector(".plx-page") || e;
@@ -15757,23 +15924,23 @@ function dc(e) {
15757
15924
  e.addEventListener("submit", n), t.push(() => e.removeEventListener("submit", n));
15758
15925
  }), () => t.forEach((e) => e());
15759
15926
  }
15760
- var fc = `(function(){var __name=function(f){return f};return ${dc.toString()}})()`, pc = 1e5, mc = (e) => typeof e == "string" && /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(e.trim()) ? e.trim() : null, hc = (e) => mc(e.replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^[^A-Za-z]+/, "").slice(0, 64)) ?? "";
15761
- function gc(e) {
15927
+ var Ec = `(function(){var __name=function(f){return f};return ${Tc.toString()}})()`, Dc = 1e5, Oc = (e) => typeof e == "string" && /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(e.trim()) ? e.trim() : null, kc = (e) => Oc(e.replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^[^A-Za-z]+/, "").slice(0, 64)) ?? "";
15928
+ function Ac(e) {
15762
15929
  if (typeof e != "string") return { code: "" };
15763
15930
  let t = e.trim();
15764
15931
  return t ? t.length > 1e5 ? {
15765
15932
  code: "",
15766
- warning: `The site's custom code is too long (over ${pc.toLocaleString("en-US")} characters), so it was left out. Shorten it or load it from a file instead.`
15933
+ warning: `The site's custom code is too long (over ${Dc.toLocaleString("en-US")} characters), so it was left out. Shorten it or load it from a file instead.`
15767
15934
  } : { code: t.replace(/<\/(script)/gi, "<\\/$1").replace(/<!--/g, "<\\!--") } : { code: "" };
15768
15935
  }
15769
15936
  //#endregion
15770
15937
  //#region src/v2/utils/css.ts
15771
- function _c(e) {
15938
+ function jc(e) {
15772
15939
  return `url("${e.replace(/["\\\n\r\f]/g, (e) => `\\${e.charCodeAt(0).toString(16)} `)}")`;
15773
15940
  }
15774
15941
  //#endregion
15775
15942
  //#region src/v2/render/nodeStyle.ts
15776
- var vc = [
15943
+ var Mc = [
15777
15944
  "flex-start",
15778
15945
  "center",
15779
15946
  "flex-end",
@@ -15781,25 +15948,25 @@ var vc = [
15781
15948
  "start",
15782
15949
  "end",
15783
15950
  "baseline"
15784
- ], yc = [
15951
+ ], Nc = [
15785
15952
  "hidden",
15786
15953
  "visible",
15787
15954
  "auto",
15788
15955
  "clip"
15789
- ], bc = ["normal", "nowrap"], xc = [
15956
+ ], Pc = ["normal", "nowrap"], Fc = [
15790
15957
  "auto",
15791
15958
  "pointer",
15792
15959
  "default",
15793
15960
  "text",
15794
15961
  "grab",
15795
15962
  "not-allowed"
15796
- ], Sc = [
15963
+ ], Ic = [
15797
15964
  "ease",
15798
15965
  "linear",
15799
15966
  "ease-in",
15800
15967
  "ease-out",
15801
15968
  "ease-in-out"
15802
- ], Cc = {
15969
+ ], Lc = {
15803
15970
  all: ["all"],
15804
15971
  opacity: ["opacity"],
15805
15972
  transform: ["transform"],
@@ -15809,7 +15976,7 @@ var vc = [
15809
15976
  "border-color",
15810
15977
  "box-shadow"
15811
15978
  ]
15812
- }, wc = (e, t) => typeof e == "string" && t.includes(e) ? e : void 0, Tc = (e) => typeof e == "string" && /^(?:(?:left|right|top|bottom|center|-?\d{1,3}(?:\.\d+)?%)(?: |$)){1,2}$/.test(e.trim() + " ") ? e.trim() : void 0, Ec = (e) => {
15979
+ }, Rc = (e, t) => typeof e == "string" && t.includes(e) ? e : void 0, zc = (e) => typeof e == "string" && /^(?:(?:left|right|top|bottom|center|-?\d{1,3}(?:\.\d+)?%)(?: |$)){1,2}$/.test(e.trim() + " ") ? e.trim() : void 0, Bc = (e) => {
15813
15980
  let t = typeof e == "number" ? e : typeof e == "string" ? parseFloat(e) : NaN;
15814
15981
  if (!Number.isFinite(t) || t <= 0) return {};
15815
15982
  let n = `blur(${Math.round(Math.min(40, t) * 10) / 10}px)`;
@@ -15818,18 +15985,18 @@ var vc = [
15818
15985
  WebkitBackdropFilter: n
15819
15986
  };
15820
15987
  };
15821
- function Dc(e) {
15822
- let t = wc(e.transitionProperty, Object.keys(Cc));
15988
+ function Vc(e) {
15989
+ let t = Rc(e.transitionProperty, Object.keys(Lc));
15823
15990
  if (!t) return;
15824
- let n = typeof e.transitionDuration == "number" ? e.transitionDuration : 200, r = Math.round(Math.min(2e3, Math.max(0, Number.isFinite(n) ? n : 200))), i = wc(e.transitionEasing, Sc) ?? "ease";
15825
- return Cc[t].map((e) => `${e} ${r}ms ${i}`).join(", ");
15991
+ let n = typeof e.transitionDuration == "number" ? e.transitionDuration : 200, r = Math.round(Math.min(2e3, Math.max(0, Number.isFinite(n) ? n : 200))), i = Rc(e.transitionEasing, Ic) ?? "ease";
15992
+ return Lc[t].map((e) => `${e} ${r}ms ${i}`).join(", ");
15826
15993
  }
15827
- var Oc = [
15994
+ var Hc = [
15828
15995
  "lift",
15829
15996
  "grow",
15830
15997
  "fade",
15831
15998
  "glow"
15832
- ], kc = {
15999
+ ], Uc = {
15833
16000
  lift: {
15834
16001
  translate: "0 -6px",
15835
16002
  boxShadow: "0 16px 32px rgba(0,0,0,0.18)"
@@ -15838,19 +16005,19 @@ var Oc = [
15838
16005
  fade: { opacity: .8 },
15839
16006
  glow: { boxShadow: "0 10px 30px rgba(0,0,0,0.28)" }
15840
16007
  };
15841
- function Ac(e) {
15842
- let t = wc(e.hoverEffect, Oc);
15843
- return t ? kc[t] : void 0;
16008
+ function Wc(e) {
16009
+ let t = Rc(e.hoverEffect, Hc);
16010
+ return t ? Uc[t] : void 0;
15844
16011
  }
15845
- var jc = [
16012
+ var Gc = [
15846
16013
  "fade",
15847
16014
  "slide-up",
15848
16015
  "slide-left",
15849
16016
  "slide-right",
15850
16017
  "zoom"
15851
16018
  ];
15852
- function Mc(e) {
15853
- let t = wc(e.entrance, jc);
16019
+ function Kc(e) {
16020
+ let t = Rc(e.entrance, Gc);
15854
16021
  if (!t) return;
15855
16022
  let n = typeof e.entranceDelay == "number" && Number.isFinite(e.entranceDelay) ? e.entranceDelay : 0;
15856
16023
  return {
@@ -15858,7 +16025,7 @@ function Mc(e) {
15858
16025
  delay: Math.round(Math.min(1500, Math.max(0, n)))
15859
16026
  };
15860
16027
  }
15861
- function Nc(e, t, n) {
16028
+ function qc(e, t, n) {
15862
16029
  let { viewport: r } = n, i = je(t.textStyle) ? t.textStyle : e.type === "heading" ? Ie(e.props?.level) : null, a = i ? Fe(i) : {}, o = t.position !== "static" && (typeof t.x == "number" || typeof t.y == "number" || t.position === "absolute"), s = t.flexDirection;
15863
16030
  r === "mobile" && t.stackOnMobile && t.display === "flex" && (s = "column");
15864
16031
  let c = t.isFullWidth ? "100%" : t.customWidth || t.width, l = t.maxWidth;
@@ -15909,9 +16076,9 @@ function Nc(e, t, n) {
15909
16076
  gridRow: n.isGridChild && t.gridRowSpan ? `span ${t.gridRowSpan}` : void 0,
15910
16077
  flexDirection: s,
15911
16078
  justifyContent: t.justifyContent,
15912
- alignItems: wc(t.alignItems, vc),
15913
- alignSelf: wc(t.alignSelf, vc),
15914
- alignContent: wc(t.alignContent, [
16079
+ alignItems: Rc(t.alignItems, Mc),
16080
+ alignSelf: Rc(t.alignSelf, Mc),
16081
+ alignContent: Rc(t.alignContent, [
15915
16082
  "start",
15916
16083
  "center",
15917
16084
  "end",
@@ -15959,7 +16126,7 @@ function Nc(e, t, n) {
15959
16126
  color: t.textColor,
15960
16127
  textAlign: t.textAlign,
15961
16128
  backgroundColor: t.backgroundColor,
15962
- backgroundImage: S ? "none" : C ? _c(C) : t.backgroundGradient || void 0,
16129
+ backgroundImage: S ? "none" : C ? jc(C) : t.backgroundGradient || void 0,
15963
16130
  aspectRatio: t.aspectRatio,
15964
16131
  backgroundSize: t.backgroundSize,
15965
16132
  backgroundPosition: t.backgroundPosition,
@@ -15969,13 +16136,13 @@ function Nc(e, t, n) {
15969
16136
  borderStyle: t.borderStyle,
15970
16137
  borderColor: t.borderColor,
15971
16138
  boxShadow: t.boxShadow,
15972
- overflow: wc(t.overflow, yc),
15973
- whiteSpace: wc(t.whiteSpace, bc),
15974
- objectPosition: Tc(t.objectPosition),
15975
- ...Ec(t.backdropFilter),
16139
+ overflow: Rc(t.overflow, Nc),
16140
+ whiteSpace: Rc(t.whiteSpace, Pc),
16141
+ objectPosition: zc(t.objectPosition),
16142
+ ...Bc(t.backdropFilter),
15976
16143
  pointerEvents: t.pointerEvents
15977
16144
  };
15978
- n.forPublish && (w.cursor = wc(t.cursor, xc), w.transition = Dc(t) ?? (Ac(t) ? "translate 200ms ease, scale 200ms ease, opacity 200ms ease, box-shadow 200ms ease" : void 0)), typeof w.fontSize == "string" && t.fontSize !== void 0 && is(e, r) && (w.fontSize = os(w.fontSize, r)), e.type === "columns" && !f && (w.display = "grid", w.gridTemplateColumns = `repeat(${r === "mobile" ? 1 : r === "tablet" ? 2 : t.gridColumns || 3}, minmax(0, 1fr))`), n.isRootPage && (w.maxWidth = t.maxWidth || void 0, w.marginLeft = t.horizontalAlign === "left" ? "0px" : t.horizontalAlign === "right" ? "auto" : t.marginLeft || "auto", w.marginRight = t.horizontalAlign === "left" ? "auto" : t.horizontalAlign === "right" ? "0px" : t.marginRight || "auto"), e.type === "section" && t.pinned && (w.position = "sticky", w.top = "0px", w.zIndex = 40);
16145
+ n.forPublish && (w.cursor = Rc(t.cursor, Fc), w.transition = Vc(t) ?? (Wc(t) ? "translate 200ms ease, scale 200ms ease, opacity 200ms ease, box-shadow 200ms ease" : void 0)), typeof w.fontSize == "string" && t.fontSize !== void 0 && vs(e, r) && (w.fontSize = bs(w.fontSize, r)), e.type === "columns" && !f && (w.display = "grid", w.gridTemplateColumns = `repeat(${r === "mobile" ? 1 : r === "tablet" ? 2 : t.gridColumns || 3}, minmax(0, 1fr))`), n.isRootPage && (w.maxWidth = t.maxWidth || void 0, w.marginLeft = t.horizontalAlign === "left" ? "0px" : t.horizontalAlign === "right" ? "auto" : t.marginLeft || "auto", w.marginRight = t.horizontalAlign === "left" ? "auto" : t.horizontalAlign === "right" ? "0px" : t.marginRight || "auto"), e.type === "section" && t.pinned && (w.position = "sticky", w.top = "0px", w.zIndex = 40);
15979
16146
  for (let e of Object.keys(w)) w[e] === void 0 && delete w[e];
15980
16147
  return {
15981
16148
  css: w,
@@ -15989,7 +16156,7 @@ function Nc(e, t, n) {
15989
16156
  }
15990
16157
  //#endregion
15991
16158
  //#region src/v2/render/iconSet.ts
15992
- var Pc = {
16159
+ var Jc = {
15993
16160
  star: [["path", { d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" }]],
15994
16161
  heart: [["path", { d: "M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5" }]],
15995
16162
  check: [["path", { d: "M20 6 9 17l-5-5" }]],
@@ -17659,7 +17826,7 @@ var Pc = {
17659
17826
  ["path", { d: "m13 14 8-2" }],
17660
17827
  ["path", { d: "m13 19 8-2" }]
17661
17828
  ]
17662
- }, Fc = {
17829
+ }, Yc = {
17663
17830
  Popular: [
17664
17831
  "star",
17665
17832
  "heart",
@@ -17865,20 +18032,20 @@ var Pc = {
17865
18032
  "spray-can"
17866
18033
  ]
17867
18034
  };
17868
- Object.keys(Pc);
17869
- var Ic = [["circle", {
18035
+ Object.keys(Jc);
18036
+ var Xc = [["circle", {
17870
18037
  cx: "12",
17871
18038
  cy: "12",
17872
18039
  r: "9"
17873
18040
  }]];
17874
- function Lc(e) {
17875
- return typeof e != "string" || !e.trim() ? Pc.star : Object.prototype.hasOwnProperty.call(Pc, e) ? Pc[e] : Ic;
18041
+ function Zc(e) {
18042
+ return typeof e != "string" || !e.trim() ? Jc.star : Object.prototype.hasOwnProperty.call(Jc, e) ? Jc[e] : Xc;
17876
18043
  }
17877
18044
  //#endregion
17878
18045
  //#region src/v2/render/elements.ts
17879
- var Rc = "_hp_field", zc = (e) => e.props ?? {}, Bc = (e) => M("div", { class: "plx-empty" }, e);
17880
- function Vc(e) {
17881
- let t = zc(e), n = Lc(t.iconName), r = F(t.label, 200).trim();
18046
+ var Qc = "_hp_field", $c = (e) => e.props ?? {}, el = (e) => M("div", { class: "plx-empty" }, e);
18047
+ function tl(e) {
18048
+ let t = $c(e), n = Zc(t.iconName), r = F(t.label, 200).trim();
17882
18049
  return M("span", {
17883
18050
  class: "plx-el plx-icon",
17884
18051
  ...r ? {
@@ -17895,9 +18062,9 @@ function Vc(e) {
17895
18062
  "aria-hidden": "true"
17896
18063
  }, n.map(([e, t]) => M(e, t))));
17897
18064
  }
17898
- function Hc(e, t) {
17899
- let n = zc(e), r = Et(n.slides, 30);
17900
- if (!r.length) return M("div", { class: "plx-el plx-carousel" }, Bc("Add a slide to start your carousel"));
18065
+ function nl(e, t) {
18066
+ let n = $c(e), r = Et(n.slides, 30);
18067
+ if (!r.length) return M("div", { class: "plx-el plx-carousel" }, el("Add a slide to start your carousel"));
17901
18068
  let i = r.map((e, n) => `${t.uid}-s${n + 1}`), a = r.length, o = r.map((e, t) => {
17902
18069
  let n = vt(e.src), r = F(e.caption, 300), o = [n ? M("img", {
17903
18070
  src: n,
@@ -17956,13 +18123,13 @@ function Hc(e, t) {
17956
18123
  "aria-label": `Go to slide ${t + 1}`
17957
18124
  }))));
17958
18125
  }
17959
- var Uc = {
18126
+ var rl = {
17960
18127
  "16:9": "16 / 9",
17961
18128
  "4:3": "4 / 3",
17962
18129
  "1:1": "1 / 1",
17963
18130
  "9:16": "9 / 16"
17964
18131
  };
17965
- function Wc(e) {
18132
+ function il(e) {
17966
18133
  let t = e.trim();
17967
18134
  if (!/^https?:\/\//i.test(t)) return null;
17968
18135
  let n;
@@ -17988,12 +18155,12 @@ function Wc(e) {
17988
18155
  src: t
17989
18156
  } : null;
17990
18157
  }
17991
- function Gc(e, t) {
17992
- let n = zc(e), r = Wc(F(n.url, 2e3)), i = Uc[n.ratio ?? "16:9"] ?? Uc["16:9"], a = (e) => ({
18158
+ function al(e, t) {
18159
+ let n = $c(e), r = il(F(n.url, 2e3)), i = rl[n.ratio ?? "16:9"] ?? rl["16:9"], a = (e) => ({
17993
18160
  ...M("div", { class: "plx-el plx-video" }, e),
17994
18161
  style: { "aspect-ratio": i }
17995
18162
  });
17996
- if (!r) return a(Bc("Paste a YouTube, Vimeo or video file link"));
18163
+ if (!r) return a(el("Paste a YouTube, Vimeo or video file link"));
17997
18164
  if (r.kind === "file") {
17998
18165
  let e = vt(n.poster);
17999
18166
  return a(M("video", {
@@ -18018,8 +18185,8 @@ function Gc(e, t) {
18018
18185
  referrerpolicy: "strict-origin-when-cross-origin"
18019
18186
  }));
18020
18187
  }
18021
- function Kc(e) {
18022
- let t = zc(e), n = Et(t.links, 20).filter((e) => e && e.network in Xt), r = Tt(t.size, 20, 96, 40), i = t.shape === "square" || t.shape === "plain" ? t.shape : "circle", a = t.colorMode === "mono";
18188
+ function ol(e) {
18189
+ let t = $c(e), n = Et(t.links, 20).filter((e) => e && e.network in Xt), r = Tt(t.size, 20, 96, 40), i = t.shape === "square" || t.shape === "plain" ? t.shape : "circle", a = t.colorMode === "mono";
18023
18190
  return n.length ? {
18024
18191
  ...M("nav", {
18025
18192
  class: `plx-el plx-social plx-social--${i}`,
@@ -18049,11 +18216,11 @@ function Kc(e) {
18049
18216
  };
18050
18217
  })),
18051
18218
  style: { "--plx-size": `${r}px` }
18052
- } : M("div", { class: "plx-el plx-social" }, Bc("Add your social links"));
18219
+ } : M("div", { class: "plx-el plx-social" }, el("Add your social links"));
18053
18220
  }
18054
- function qc(e) {
18055
- let t = zc(e), n = Et(t.links, 40);
18056
- if (!n.length) return M("nav", { class: "plx-el plx-menu" }, Bc("Add menu links"));
18221
+ function sl(e) {
18222
+ let t = $c(e), n = Et(t.links, 40);
18223
+ if (!n.length) return M("nav", { class: "plx-el plx-menu" }, el("Add menu links"));
18057
18224
  let r = n.map((e) => M("li", null, M("a", { href: P(e.href) }, F(e.label, 120) || "Link"))), i = t.layout === "vertical", a = !i && (n.length > 4 || n.reduce((e, t) => e + F(t.label, 120).length, 0) > 36);
18058
18225
  return M("nav", {
18059
18226
  class: `plx-el plx-menu${i ? " plx-menu--vertical" : ""}${a ? " plx-menu--long" : ""}${t.mobile === "expanded" ? " plx-menu--expanded" : ""}`,
@@ -18069,19 +18236,19 @@ function qc(e) {
18069
18236
  "stroke-linecap": "round"
18070
18237
  }))), M("ul", null, r)));
18071
18238
  }
18072
- function Jc(e, t) {
18073
- let n = zc(e), r = F(n.code, 1e5);
18239
+ function cl(e, t) {
18240
+ let n = $c(e), r = F(n.code, 1e5);
18074
18241
  return r.trim() ? M("div", { class: "plx-el plx-html" }, M("iframe", {
18075
18242
  srcdoc: r,
18076
18243
  sandbox: `allow-popups allow-popups-to-escape-sandbox allow-forms${t.allowEmbedScripts ? " allow-scripts" : ""}`,
18077
18244
  title: F(n.title, 120) || "Embedded content",
18078
18245
  loading: "lazy",
18079
18246
  referrerpolicy: "no-referrer"
18080
- })) : M("div", { class: "plx-el plx-html" }, Bc("Paste your embed code in the settings"));
18247
+ })) : M("div", { class: "plx-el plx-html" }, el("Paste your embed code in the settings"));
18081
18248
  }
18082
- function Yc(e) {
18083
- let t = zc(e), n = Et(t.rows, 200).map((e) => Et(e, 30).map((e) => F(e, 500)));
18084
- if (!n.length) return M("div", { class: "plx-el plx-table-wrap" }, Bc("Add rows to your table"));
18249
+ function ll(e) {
18250
+ let t = $c(e), n = Et(t.rows, 200).map((e) => Et(e, 30).map((e) => F(e, 500)));
18251
+ if (!n.length) return M("div", { class: "plx-el plx-table-wrap" }, el("Add rows to your table"));
18085
18252
  let r = t.headerRow !== !1, i = Math.max(...n.map((e) => e.length)), a = (e) => Array.from({ length: i }, (t, n) => e[n] ?? "");
18086
18253
  return M("div", {
18087
18254
  class: "plx-el plx-table-wrap",
@@ -18090,8 +18257,8 @@ function Yc(e) {
18090
18257
  "aria-label": "Table"
18091
18258
  }, M("table", { class: `plx-table${t.striped === !1 ? "" : " plx-striped"}` }, r && M("thead", null, M("tr", null, a(n[0]).map((e) => M("th", { scope: "col" }, e)))), M("tbody", null, n.slice(+!!r).map((e) => M("tr", null, a(e).map((e) => M("td", null, e)))))));
18092
18259
  }
18093
- var Xc = (e) => String(Math.max(0, e)).padStart(2, "0");
18094
- function Zc(e, t) {
18260
+ var ul = (e) => String(Math.max(0, e)).padStart(2, "0");
18261
+ function dl(e, t) {
18095
18262
  let n = Date.parse(e);
18096
18263
  if (!Number.isFinite(n)) return {
18097
18264
  done: !0,
@@ -18117,11 +18284,11 @@ function Zc(e, t) {
18117
18284
  s: i % 60
18118
18285
  };
18119
18286
  }
18120
- function Qc(e, t) {
18121
- let n = zc(e), r = F(n.target, 40), i = Zc(r, t.now), a = (e, t, r) => M("div", { class: "plx-unit" }, M("span", {
18287
+ function fl(e, t) {
18288
+ let n = $c(e), r = F(n.target, 40), i = dl(r, t.now), a = (e, t, r) => M("div", { class: "plx-unit" }, M("span", {
18122
18289
  class: "plx-num",
18123
18290
  "data-plx-unit": e
18124
- }, Xc(t)), n.showLabels !== !1 && M("span", { class: "plx-lbl" }, r));
18291
+ }, ul(t)), n.showLabels !== !1 && M("span", { class: "plx-lbl" }, r));
18125
18292
  return M("div", {
18126
18293
  class: "plx-el plx-timer",
18127
18294
  role: "timer",
@@ -18134,7 +18301,7 @@ function Qc(e, t) {
18134
18301
  a("s", i.s, "Seconds")
18135
18302
  ]);
18136
18303
  }
18137
- function $c(e, t) {
18304
+ function pl(e, t) {
18138
18305
  let n = wt(e.id, "field"), r = n, i = F(e.label, 200) || n, a = e.required ? !0 : void 0, o = F(e.placeholder, 200) || void 0, s = e.required ? M("span", {
18139
18306
  class: "plx-req",
18140
18307
  "aria-hidden": "true"
@@ -18162,24 +18329,24 @@ function $c(e, t) {
18162
18329
  });
18163
18330
  return M("label", { class: "plx-field" }, M("span", { class: "plx-label" }, i, s), c);
18164
18331
  }
18165
- function el(e) {
18332
+ function ml(e) {
18166
18333
  let t = xt(e.buttonColor), n = xt(e.buttonTextColor) ?? (t && !t.startsWith("var(") ? Ha(t) ?? void 0 : void 0), r = St(e.buttonRadius), i = {};
18167
18334
  return t && (i["--plx-btn-bg"] = t), n && (i["--plx-btn-fg"] = n), r && (i["--plx-btn-radius"] = r), Object.keys(i).length ? i : void 0;
18168
18335
  }
18169
- function tl(e, t) {
18170
- let n = zc(e), r = Et(n.fields, 40);
18336
+ function hl(e, t) {
18337
+ let n = $c(e), r = Et(n.fields, 40);
18171
18338
  return r.length ? M("form", {
18172
18339
  class: "plx-el plx-form",
18173
18340
  method: "post",
18174
18341
  action: (n.action && P(n.action) !== "#" ? P(n.action) : "") || t.formAction?.(e.id) || void 0,
18175
18342
  "data-plx-form": t.uid,
18176
18343
  "data-plx-success": F(n.successMessage, 300) || "Thanks! We got your message."
18177
- }, r.map((e) => $c(e, t.uid)), M("div", {
18344
+ }, r.map((e) => pl(e, t.uid)), M("div", {
18178
18345
  class: "plx-hp",
18179
18346
  "aria-hidden": "true"
18180
18347
  }, M("label", null, "Leave this field blank", M("input", {
18181
18348
  type: "text",
18182
- name: Rc,
18349
+ name: Qc,
18183
18350
  tabindex: "-1",
18184
18351
  autocomplete: "off"
18185
18352
  }))), {
@@ -18187,11 +18354,11 @@ function tl(e, t) {
18187
18354
  type: "submit",
18188
18355
  class: "plx-submit"
18189
18356
  }, F(n.submitLabel, 80) || "Submit"),
18190
- ...el(n) ? { style: el(n) } : {}
18191
- }) : M("div", { class: "plx-el plx-form" }, Bc("Add a field to your form"));
18357
+ ...ml(n) ? { style: ml(n) } : {}
18358
+ }) : M("div", { class: "plx-el plx-form" }, el("Add a field to your form"));
18192
18359
  }
18193
- function nl(e, t) {
18194
- let n = zc(e), r = Et(n.items, 50);
18360
+ function gl(e, t) {
18361
+ let n = $c(e), r = Et(n.items, 50);
18195
18362
  return r.length ? M("div", { class: "plx-el plx-accordion" }, r.map((e, r) => M("details", {
18196
18363
  ...n.allowMultiple ? {} : { name: t.uid },
18197
18364
  open: n.openFirst !== !1 && r === 0 || void 0
@@ -18206,30 +18373,30 @@ function nl(e, t) {
18206
18373
  "stroke-width": 2.2,
18207
18374
  "stroke-linecap": "round",
18208
18375
  "stroke-linejoin": "round"
18209
- }))), M("div", { class: "plx-body" }, F(e.content, 5e3).split(/\n{2,}/).map((e) => M("p", null, e)))))) : M("div", { class: "plx-el plx-accordion" }, Bc("Add a question to start"));
18376
+ }))), M("div", { class: "plx-body" }, F(e.content, 5e3).split(/\n{2,}/).map((e) => M("p", null, e)))))) : M("div", { class: "plx-el plx-accordion" }, el("Add a question to start"));
18210
18377
  }
18211
- function rl(e, t) {
18378
+ function _l(e, t) {
18212
18379
  if (Ot(e.type)) return Gt(e, t);
18213
18380
  switch (e.type) {
18214
- case "icon": return Vc(e);
18215
- case "carousel": return Hc(e, t);
18216
- case "video": return Gc(e, t);
18217
- case "social": return Kc(e);
18218
- case "menu": return qc(e);
18219
- case "html": return Jc(e, t);
18220
- case "table": return Yc(e);
18221
- case "timer": return Qc(e, t);
18222
- case "form": return tl(e, t);
18223
- case "accordion": return nl(e, t);
18381
+ case "icon": return tl(e);
18382
+ case "carousel": return nl(e, t);
18383
+ case "video": return al(e, t);
18384
+ case "social": return ol(e);
18385
+ case "menu": return sl(e);
18386
+ case "html": return cl(e, t);
18387
+ case "table": return ll(e);
18388
+ case "timer": return fl(e, t);
18389
+ case "form": return hl(e, t);
18390
+ case "accordion": return gl(e, t);
18224
18391
  default: return null;
18225
18392
  }
18226
18393
  }
18227
18394
  //#endregion
18228
18395
  //#region src/v2/render/elementCss.ts
18229
- var il = ".plx-el{box-sizing:border-box;width:100%;height:100%;min-width:0;color:inherit;font:inherit;text-align:left}\n.plx-el *,.plx-el *::before,.plx-el *::after{box-sizing:border-box}\n.plx-el ul,.plx-el ol{list-style:none!important;padding-left:0!important;margin:0}\n.plx-el li{display:block!important}\n.plx-empty{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:72px;padding:16px;border:1.5px dashed currentColor;border-radius:10px;opacity:.5;font-size:13px;text-align:center}\n.plx-ph{width:100%;height:100%;min-height:60px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.32))}\n\n.plx-icon{display:inline-flex;width:auto;height:auto;line-height:1;font-size:inherit}\n.plx-icon svg{display:block;width:1em;height:1em}\n\n.plx-carousel{position:relative;overflow:hidden;border-radius:inherit}\n.plx-track{display:flex;width:100%;height:100%;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;-webkit-overflow-scrolling:touch}\n.plx-track::-webkit-scrollbar{display:none}\n.plx-slide{position:relative;flex:0 0 100%;height:100%;margin:0;scroll-snap-align:center;overflow:hidden}\n.plx-slide a{display:block;width:100%;height:100%;color:inherit;text-decoration:none}\n.plx-slide img{display:block;width:100%;height:100%;object-fit:cover;user-select:none}\n.plx-slide figcaption{position:absolute;left:0;right:0;bottom:0;padding:28px 20px 16px;color:#fff;font-size:15px;background:linear-gradient(transparent,rgba(0,0,0,.6))}\n.plx-arrow{display:none;position:absolute;top:50%;width:40px;height:40px;margin-top:-20px;align-items:center;justify-content:center;border-radius:999px;background:rgba(0,0,0,.45);color:#fff;text-decoration:none;backdrop-filter:blur(4px);transition:background .15s}\n[data-plx-ready] .plx-arrow{display:flex;align-items:center;justify-content:center}\n.plx-arrow:hover{background:rgba(0,0,0,.7)}\n.plx-arrow svg{width:20px;height:20px}\n.plx-prev{left:12px}.plx-next{right:12px}\n.plx-dots{position:absolute;left:0;right:0;bottom:12px;display:flex;justify-content:center;gap:8px;pointer-events:none}\n.plx-dots a{pointer-events:auto;width:9px;height:9px;border-radius:999px;background:rgba(255,255,255,.55);box-shadow:0 0 0 1px rgba(0,0,0,.2);transition:transform .15s,background .15s}\n.plx-dots a[aria-current=\"true\"]{background:#fff;transform:scale(1.25)}\n\n.plx-video{position:relative;width:100%;height:auto;overflow:hidden;border-radius:inherit;background:#000}\n.plx-video iframe,.plx-video video{position:absolute;inset:0;width:100%;height:100%;border:0;background:#000}\n.plx-video .plx-empty{position:absolute;inset:0;background:#111;color:#e5e7eb;opacity:1;border-color:rgba(255,255,255,.3)}\n\n.plx-social{display:flex;flex-wrap:wrap;align-items:center;gap:12px;width:auto;height:auto}\n.plx-social a{display:inline-flex;align-items:center;justify-content:center;width:var(--plx-size,40px);height:var(--plx-size,40px);color:inherit;text-decoration:none;transition:transform .15s,opacity .15s}\n.plx-social a:hover{transform:translateY(-2px);opacity:.85}\n.plx-social svg{width:52%;height:52%}\n.plx-social--circle a,.plx-social--square a{background:var(--plx-brand,currentColor);color:#fff}\n.plx-social--circle a{border-radius:999px}\n.plx-social--square a{border-radius:10px}\n.plx-social--plain a svg{width:70%;height:70%}\n\n.plx-menu{width:auto;height:auto}\n.plx-menu ul{display:flex;flex-wrap:wrap;gap:8px 28px;margin:0;padding:0;list-style:none}\n.plx-menu--vertical ul{flex-direction:column;gap:12px}\n.plx-menu a{color:inherit;text-decoration:none;font-weight:500}\n.plx-menu a:hover{text-decoration:underline;text-underline-offset:4px}\n.plx-menu-m{display:none;position:relative}\n.plx-menu-m summary{display:flex;width:40px;height:40px;align-items:center;justify-content:center;list-style:none;cursor:pointer;border-radius:8px}\n.plx-menu-m summary::-webkit-details-marker{display:none}\n.plx-menu-m summary svg{width:24px;height:24px}\n/* Fixed (not absolute) so the header's own clipping can't cut it off, and inset from both screen edges so it never runs off the side. */\n.plx-menu-m ul{position:fixed;z-index:50;left:12px;right:12px;top:auto;margin-top:6px;max-height:70vh;overflow-y:auto;flex-direction:column;gap:2px;padding:8px;border-radius:12px;background:#fff;color:#111;box-shadow:0 12px 32px rgba(0,0,0,.18)}\n.plx-menu-m li a{display:block;padding:10px 12px;border-radius:8px}\n.plx-menu-m li a:hover{background:rgba(0,0,0,.06);text-decoration:none}\n@container plx-page (max-width: 599px){\n .plx-menu:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n/* A long row of links doesn't fit beside a logo and button on a tablet, and wrapping onto a second row looks broken — so it folds into the menu button from tablet width. */\n@container plx-page (max-width: 1023px){\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n\n.plx-html{overflow:hidden;border-radius:inherit}\n.plx-html iframe{display:block;width:100%;height:100%;min-height:200px;border:0;background:transparent}\n\n.plx-table-wrap{width:100%;height:auto;overflow-x:auto;border-radius:inherit}\n.plx-table{width:100%;border-collapse:collapse;font-size:15px}\n.plx-table th,.plx-table td{padding:12px 16px;text-align:left;border-bottom:1px solid rgba(128,128,128,.28)}\n.plx-table th{font-weight:600;border-bottom:2px solid rgba(128,128,128,.5)}\n.plx-striped tbody tr:nth-child(even){background:rgba(128,128,128,.08)}\n\n.plx-timer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;width:auto;height:auto}\n.plx-unit{display:flex;flex-direction:column;align-items:center;min-width:72px;padding:14px 12px;border-radius:12px;background:rgba(128,128,128,.14)}\n.plx-num{font-size:34px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}\n.plx-lbl{margin-top:6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;opacity:.65}\n.plx-expired{font-size:18px;font-weight:600}\n\n.plx-form{display:flex;flex-direction:column;gap:14px;height:auto}\n.plx-field{display:flex;flex-direction:column;gap:6px}\n.plx-label,.plx-check{font-size:14px;font-weight:500}\n.plx-req{color:#e11d48}\n.plx-form input[type=text],.plx-form input[type=email],.plx-form input[type=tel],.plx-form textarea,.plx-form select{width:100%;padding:11px 13px;border:1px solid var(--color-border-default,rgba(128,128,128,.45));border-radius:var(--radius-lg,10px);background:var(--color-bg-surface,rgba(255,255,255,.92));color:var(--color-text-primary,#111);font:inherit;font-size:15px}\n.plx-form ::placeholder{color:var(--color-text-muted,#9ca3af);opacity:1}\n.plx-form textarea{resize:vertical;min-height:96px}\n.plx-form input:focus,.plx-form textarea:focus,.plx-form select:focus{outline:2px solid var(--plx-accent,#2563eb);outline-offset:1px}\n.plx-check{display:flex;align-items:center;gap:10px}\n.plx-check input{width:18px;height:18px}\n.plx-submit{align-self:flex-start;padding:12px 22px;border:0;border-radius:var(--plx-btn-radius,10px);background:var(--plx-btn-bg,var(--plx-accent,#111827));color:var(--plx-btn-fg,var(--plx-on-accent,#fff));font:inherit;font-weight:600;cursor:pointer;transition:opacity .15s}\n.plx-submit:hover{opacity:.9}\n.plx-submit:disabled{opacity:.6;cursor:default}\n.plx-hp{position:absolute;width:0;height:0;overflow:hidden;opacity:0;pointer-events:none}\n.plx-form-note{padding:12px 14px;border-radius:10px;background:rgba(34,197,94,.14);font-weight:500}\n.plx-form-note[data-error]{background:rgba(225,29,72,.14)}\n\n.plx-accordion{display:flex;flex-direction:column;gap:10px;height:auto}\n.plx-accordion details{border:1px solid rgba(128,128,128,.32);border-radius:12px;overflow:hidden}\n.plx-accordion summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;list-style:none;cursor:pointer;font-weight:600}\n.plx-accordion summary::-webkit-details-marker{display:none}\n.plx-chev{flex:none;width:20px;height:20px;transition:transform .2s}\n.plx-accordion details[open] .plx-chev{transform:rotate(180deg)}\n.plx-body{padding:0 18px 16px;opacity:.85;line-height:1.6}\n.plx-body p+p{margin-top:.75em}\n.plx-dyn{display:flex;flex-direction:column;gap:12px;height:auto;min-height:72px;padding:18px;border:1.5px dashed rgba(128,128,128,.55);border-radius:12px;background:rgba(128,128,128,.07)}\n.plx-dyn-head{display:flex;align-items:center;gap:8px;font-size:14px}\n.plx-dyn-tag{padding:2px 8px;border-radius:999px;background:rgba(128,128,128,.22);font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}\n.plx-dyn-note{font-size:12px;opacity:.65}\n.plx-dyn-body{display:flex;flex-direction:column;gap:10px}\n.plx-dyn-bar{display:block;height:10px;border-radius:999px;background:rgba(128,128,128,.28)}\n.plx-dyn-bar--thick{height:16px}\n.plx-dyn-img{display:block;width:100%;border-radius:8px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.34))}\n.plx-dyn-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:14px;align-items:center}\n.plx-dyn-row--tight{grid-template-columns:56px minmax(0,1fr)}\n.plx-dyn-stack{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-grid{display:grid;gap:12px}\n.plx-dyn-card{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-line{display:flex;justify-content:space-between;gap:12px}\n.plx-dyn-line .plx-dyn-bar{flex:0 1 40%}\n.plx-dyn-text{font-size:14px;opacity:.8}\n.plx-dyn-field{display:flex;flex-direction:column;gap:4px}\n.plx-dyn-lbl{font-size:12px;opacity:.7}\n.plx-dyn-input{display:block;height:36px;border:1px solid rgba(128,128,128,.4);border-radius:8px;background:rgba(128,128,128,.08)}\n.plx-dyn-btn{align-self:flex-start;padding:9px 18px;border-radius:8px;background:rgba(128,128,128,.4);font-size:13px;font-weight:600}\n.plx-dyn-chips{display:flex;flex-wrap:wrap;gap:8px}\n.plx-dyn-chip{padding:6px 12px;border:1px solid rgba(128,128,128,.45);border-radius:999px;font-size:12px}\n.plx-dyn-tick{display:flex;width:44px;height:44px;align-items:center;justify-content:center;border-radius:999px;background:rgba(34,197,94,.25);font-size:22px}";
18396
+ var vl = ".plx-el{box-sizing:border-box;width:100%;height:100%;min-width:0;color:inherit;font:inherit;text-align:left}\n.plx-el *,.plx-el *::before,.plx-el *::after{box-sizing:border-box}\n.plx-el ul,.plx-el ol{list-style:none!important;padding-left:0!important;margin:0}\n.plx-el li{display:block!important}\n.plx-empty{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:72px;padding:16px;border:1.5px dashed currentColor;border-radius:10px;opacity:.5;font-size:13px;text-align:center}\n.plx-ph{width:100%;height:100%;min-height:60px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.32))}\n\n.plx-icon{display:inline-flex;width:auto;height:auto;line-height:1;font-size:inherit}\n.plx-icon svg{display:block;width:1em;height:1em}\n\n.plx-carousel{position:relative;overflow:hidden;border-radius:inherit}\n.plx-track{display:flex;width:100%;height:100%;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;-webkit-overflow-scrolling:touch}\n.plx-track::-webkit-scrollbar{display:none}\n.plx-slide{position:relative;flex:0 0 100%;height:100%;margin:0;scroll-snap-align:center;overflow:hidden}\n.plx-slide a{display:block;width:100%;height:100%;color:inherit;text-decoration:none}\n.plx-slide img{display:block;width:100%;height:100%;object-fit:cover;user-select:none}\n.plx-slide figcaption{position:absolute;left:0;right:0;bottom:0;padding:28px 20px 16px;color:#fff;font-size:15px;background:linear-gradient(transparent,rgba(0,0,0,.6))}\n.plx-arrow{display:none;position:absolute;top:50%;width:40px;height:40px;margin-top:-20px;align-items:center;justify-content:center;border-radius:999px;background:rgba(0,0,0,.45);color:#fff;text-decoration:none;backdrop-filter:blur(4px);transition:background .15s}\n[data-plx-ready] .plx-arrow{display:flex;align-items:center;justify-content:center}\n.plx-arrow:hover{background:rgba(0,0,0,.7)}\n.plx-arrow svg{width:20px;height:20px}\n.plx-prev{left:12px}.plx-next{right:12px}\n.plx-dots{position:absolute;left:0;right:0;bottom:12px;display:flex;justify-content:center;gap:8px;pointer-events:none}\n.plx-dots a{pointer-events:auto;width:9px;height:9px;border-radius:999px;background:rgba(255,255,255,.55);box-shadow:0 0 0 1px rgba(0,0,0,.2);transition:transform .15s,background .15s}\n.plx-dots a[aria-current=\"true\"]{background:#fff;transform:scale(1.25)}\n\n.plx-video{position:relative;width:100%;height:auto;overflow:hidden;border-radius:inherit;background:#000}\n.plx-video iframe,.plx-video video{position:absolute;inset:0;width:100%;height:100%;border:0;background:#000}\n.plx-video .plx-empty{position:absolute;inset:0;background:#111;color:#e5e7eb;opacity:1;border-color:rgba(255,255,255,.3)}\n\n.plx-social{display:flex;flex-wrap:wrap;align-items:center;gap:12px;width:auto;height:auto}\n.plx-social a{display:inline-flex;align-items:center;justify-content:center;width:var(--plx-size,40px);height:var(--plx-size,40px);color:inherit;text-decoration:none;transition:transform .15s,opacity .15s}\n.plx-social a:hover{transform:translateY(-2px);opacity:.85}\n.plx-social svg{width:52%;height:52%}\n.plx-social--circle a,.plx-social--square a{background:var(--plx-brand,currentColor);color:#fff}\n.plx-social--circle a{border-radius:999px}\n.plx-social--square a{border-radius:10px}\n.plx-social--plain a svg{width:70%;height:70%}\n\n.plx-menu{width:auto;height:auto}\n.plx-menu ul{display:flex;flex-wrap:wrap;gap:8px 28px;margin:0;padding:0;list-style:none}\n.plx-menu--vertical ul{flex-direction:column;gap:12px}\n.plx-menu a{color:inherit;text-decoration:none;font-weight:500}\n.plx-menu a:hover{text-decoration:underline;text-underline-offset:4px}\n.plx-menu-m{display:none;position:relative}\n.plx-menu-m summary{display:flex;width:40px;height:40px;align-items:center;justify-content:center;list-style:none;cursor:pointer;border-radius:8px}\n.plx-menu-m summary::-webkit-details-marker{display:none}\n.plx-menu-m summary svg{width:24px;height:24px}\n/* Fixed (not absolute) so the header's own clipping can't cut it off, and inset from both screen edges so it never runs off the side. */\n.plx-menu-m ul{position:fixed;z-index:50;left:12px;right:12px;top:auto;margin-top:6px;max-height:70vh;overflow-y:auto;flex-direction:column;gap:2px;padding:8px;border-radius:12px;background:#fff;color:#111;box-shadow:0 12px 32px rgba(0,0,0,.18)}\n.plx-menu-m li a{display:block;padding:10px 12px;border-radius:8px}\n.plx-menu-m li a:hover{background:rgba(0,0,0,.06);text-decoration:none}\n@container plx-page (max-width: 599px){\n .plx-menu:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n/* A long row of links doesn't fit beside a logo and button on a tablet, and wrapping onto a second row looks broken — so it folds into the menu button from tablet width. */\n@container plx-page (max-width: 1023px){\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n\n.plx-html{overflow:hidden;border-radius:inherit}\n.plx-html iframe{display:block;width:100%;height:100%;min-height:200px;border:0;background:transparent}\n\n.plx-table-wrap{width:100%;height:auto;overflow-x:auto;border-radius:inherit}\n.plx-table{width:100%;border-collapse:collapse;font-size:15px}\n.plx-table th,.plx-table td{padding:12px 16px;text-align:left;border-bottom:1px solid rgba(128,128,128,.28)}\n.plx-table th{font-weight:600;border-bottom:2px solid rgba(128,128,128,.5)}\n.plx-striped tbody tr:nth-child(even){background:rgba(128,128,128,.08)}\n\n.plx-timer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;width:auto;height:auto}\n.plx-unit{display:flex;flex-direction:column;align-items:center;min-width:72px;padding:14px 12px;border-radius:12px;background:rgba(128,128,128,.14)}\n.plx-num{font-size:34px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}\n.plx-lbl{margin-top:6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;opacity:.65}\n.plx-expired{font-size:18px;font-weight:600}\n\n.plx-form{display:flex;flex-direction:column;gap:14px;height:auto}\n.plx-field{display:flex;flex-direction:column;gap:6px}\n.plx-label,.plx-check{font-size:14px;font-weight:500}\n.plx-req{color:#e11d48}\n.plx-form input[type=text],.plx-form input[type=email],.plx-form input[type=tel],.plx-form textarea,.plx-form select{width:100%;padding:11px 13px;border:1px solid var(--color-border-default,rgba(128,128,128,.45));border-radius:var(--radius-lg,10px);background:var(--color-bg-surface,rgba(255,255,255,.92));color:var(--color-text-primary,#111);font:inherit;font-size:15px}\n.plx-form ::placeholder{color:var(--color-text-muted,#9ca3af);opacity:1}\n.plx-form textarea{resize:vertical;min-height:96px}\n.plx-form input:focus,.plx-form textarea:focus,.plx-form select:focus{outline:2px solid var(--plx-accent,#2563eb);outline-offset:1px}\n.plx-check{display:flex;align-items:center;gap:10px}\n.plx-check input{width:18px;height:18px}\n.plx-submit{align-self:flex-start;padding:12px 22px;border:0;border-radius:var(--plx-btn-radius,10px);background:var(--plx-btn-bg,var(--plx-accent,#111827));color:var(--plx-btn-fg,var(--plx-on-accent,#fff));font:inherit;font-weight:600;cursor:pointer;transition:opacity .15s}\n.plx-submit:hover{opacity:.9}\n.plx-submit:disabled{opacity:.6;cursor:default}\n.plx-hp{position:absolute;width:0;height:0;overflow:hidden;opacity:0;pointer-events:none}\n.plx-form-note{padding:12px 14px;border-radius:10px;background:rgba(34,197,94,.14);font-weight:500}\n.plx-form-note[data-error]{background:rgba(225,29,72,.14)}\n\n.plx-accordion{display:flex;flex-direction:column;gap:10px;height:auto}\n.plx-accordion details{border:1px solid rgba(128,128,128,.32);border-radius:12px;overflow:hidden}\n.plx-accordion summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;list-style:none;cursor:pointer;font-weight:600}\n.plx-accordion summary::-webkit-details-marker{display:none}\n.plx-chev{flex:none;width:20px;height:20px;transition:transform .2s}\n.plx-accordion details[open] .plx-chev{transform:rotate(180deg)}\n.plx-body{padding:0 18px 16px;opacity:.85;line-height:1.6}\n.plx-body p+p{margin-top:.75em}\n.plx-dyn{display:flex;flex-direction:column;gap:12px;height:auto;min-height:72px;padding:18px;border:1.5px dashed rgba(128,128,128,.55);border-radius:12px;background:rgba(128,128,128,.07)}\n.plx-dyn-head{display:flex;align-items:center;gap:8px;font-size:14px}\n.plx-dyn-tag{padding:2px 8px;border-radius:999px;background:rgba(128,128,128,.22);font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}\n.plx-dyn-note{font-size:12px;opacity:.65}\n.plx-dyn-body{display:flex;flex-direction:column;gap:10px}\n.plx-dyn-bar{display:block;height:10px;border-radius:999px;background:rgba(128,128,128,.28)}\n.plx-dyn-bar--thick{height:16px}\n.plx-dyn-img{display:block;width:100%;border-radius:8px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.34))}\n.plx-dyn-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:14px;align-items:center}\n.plx-dyn-row--tight{grid-template-columns:56px minmax(0,1fr)}\n.plx-dyn-stack{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-grid{display:grid;gap:12px}\n.plx-dyn-card{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-line{display:flex;justify-content:space-between;gap:12px}\n.plx-dyn-line .plx-dyn-bar{flex:0 1 40%}\n.plx-dyn-text{font-size:14px;opacity:.8}\n.plx-dyn-field{display:flex;flex-direction:column;gap:4px}\n.plx-dyn-lbl{font-size:12px;opacity:.7}\n.plx-dyn-input{display:block;height:36px;border:1px solid rgba(128,128,128,.4);border-radius:8px;background:rgba(128,128,128,.08)}\n.plx-dyn-btn{align-self:flex-start;padding:9px 18px;border-radius:8px;background:rgba(128,128,128,.4);font-size:13px;font-weight:600}\n.plx-dyn-chips{display:flex;flex-wrap:wrap;gap:8px}\n.plx-dyn-chip{padding:6px 12px;border:1px solid rgba(128,128,128,.45);border-radius:999px;font-size:12px}\n.plx-dyn-tick{display:flex;width:44px;height:44px;align-items:center;justify-content:center;border-radius:999px;background:rgba(34,197,94,.25);font-size:22px}";
18230
18397
  //#endregion
18231
18398
  //#region src/v2/render/formAction.ts
18232
- function al(e, t, n) {
18399
+ function yl(e, t, n) {
18233
18400
  let r = e?.trim();
18234
18401
  if (r) return {
18235
18402
  kind: "custom",
@@ -18244,14 +18411,14 @@ function al(e, t, n) {
18244
18411
  url: `/api/public/forms/${encodeURIComponent(n.templateId)}/submit?form=${encodeURIComponent(t)}`
18245
18412
  } : { kind: "none" };
18246
18413
  }
18247
- var ol = (e) => (t) => {
18248
- let n = al(void 0, t, e);
18414
+ var bl = (e) => (t) => {
18415
+ let n = yl(void 0, t, e);
18249
18416
  return n.kind === "none" ? void 0 : n.url;
18250
- }, sl = (e) => e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
18251
- function cl(e) {
18417
+ }, xl = (e) => e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
18418
+ function Sl(e) {
18252
18419
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = (e) => {
18253
18420
  if (e.type === "section") {
18254
- let r = wt((typeof e.props?.anchor == "string" ? sl(e.props.anchor) : "") || sl(e.name || "") || "section", "section"), i = r;
18421
+ let r = wt((typeof e.props?.anchor == "string" ? xl(e.props.anchor) : "") || xl(e.name || "") || "section", "section"), i = r;
18255
18422
  for (let e = 2; n.has(i); e++) i = `${r}-${e}`;
18256
18423
  n.add(i), t.set(e.id, i);
18257
18424
  }
@@ -18261,23 +18428,23 @@ function cl(e) {
18261
18428
  }
18262
18429
  //#endregion
18263
18430
  //#region src/v2/render/boxTags.ts
18264
- var ll = [
18431
+ var Cl = [
18265
18432
  "header",
18266
18433
  "nav",
18267
18434
  "main",
18268
18435
  "footer",
18269
18436
  "aside",
18270
18437
  "article"
18271
- ], ul = {
18438
+ ], wl = {
18272
18439
  section: [
18273
18440
  "section",
18274
- ...ll,
18441
+ ...Cl,
18275
18442
  "div"
18276
18443
  ],
18277
18444
  container: [
18278
18445
  "div",
18279
18446
  "section",
18280
- ...ll
18447
+ ...Cl
18281
18448
  ],
18282
18449
  card: [
18283
18450
  "div",
@@ -18288,52 +18455,52 @@ var ll = [
18288
18455
  columns: [
18289
18456
  "div",
18290
18457
  "section",
18291
- ...ll
18458
+ ...Cl
18292
18459
  ],
18293
18460
  column: [
18294
18461
  "div",
18295
18462
  "section",
18296
- ...ll
18463
+ ...Cl
18297
18464
  ]
18298
- }, dl = {
18465
+ }, Tl = {
18299
18466
  section: "section",
18300
18467
  container: "div",
18301
18468
  card: "div",
18302
18469
  columns: "div",
18303
18470
  column: "div"
18304
- }, fl = null, pl = () => fl ??= ue(), ml = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
18305
- function hl(e) {
18471
+ }, El = null, Dl = () => El ??= ue(), Ol = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
18472
+ function kl(e) {
18306
18473
  if (!/^(?:repeating-)?(?:linear|radial|conic)-gradient\(/i.test(e) || e.length > 600 || !/^[A-Za-z0-9\s.,#%()\-+*/]+$/.test(e) || /url\s*\(|expression|javascript|image-set|\/\*/i.test(e)) return !1;
18307
18474
  let t = 0;
18308
18475
  for (let n of e) if (n === "(") t += 1;
18309
18476
  else if (n === ")" && --t < 0) return !1;
18310
18477
  return t === 0 && e.endsWith(")");
18311
18478
  }
18312
- function gl(e, t) {
18479
+ function Al(e, t) {
18313
18480
  if (typeof t == "number") return Number.isFinite(t) ? String(t) : null;
18314
18481
  let n = t.trim();
18315
- return n ? e === "backgroundImage" ? n === "none" || /^url\("(?:[^"\\\n]|\\[0-9a-f]{1,6} )*"\)$/i.test(n) || hl(n) ? n : null : /[;{}<>\\]|\/\*|@import|expression\s*\(|javascript:|behavior\s*:|-moz-binding|url\s*\(/i.test(n) ? null : n : null;
18482
+ return n ? e === "backgroundImage" ? n === "none" || /^url\("(?:[^"\\\n]|\\[0-9a-f]{1,6} )*"\)$/i.test(n) || kl(n) ? n : null : /[;{}<>\\]|\/\*|@import|expression\s*\(|javascript:|behavior\s*:|-moz-binding|url\s*\(/i.test(n) ? null : n : null;
18316
18483
  }
18317
- function _l(e) {
18484
+ function jl(e) {
18318
18485
  let t = [];
18319
18486
  for (let [n, r] of Object.entries(e)) {
18320
18487
  if (r === void 0) continue;
18321
- let e = gl(n, r);
18322
- e !== null && t.push(`${ml(n)}:${e}`);
18488
+ let e = Al(n, r);
18489
+ e !== null && t.push(`${Ol(n)}:${e}`);
18323
18490
  }
18324
18491
  return t.join(";");
18325
18492
  }
18326
- function vl(e, t) {
18493
+ function Ml(e, t) {
18327
18494
  let n = {};
18328
18495
  for (let r of Object.keys(t)) e[r] !== t[r] && (n[r] = t[r]);
18329
18496
  for (let r of Object.keys(e)) r in t || (n[r] = r === "display" ? "revert" : "unset");
18330
18497
  return n;
18331
18498
  }
18332
- var yl = (e) => {
18499
+ var Nl = (e) => {
18333
18500
  let t = e?.split(",")[0]?.trim().replace(/^['"]|['"]$/g, "");
18334
18501
  return t && x(t) ? t : null;
18335
18502
  };
18336
- function bl(e, t) {
18503
+ function Pl(e, t) {
18337
18504
  if (t && e.includes(t)) {
18338
18505
  let [n, ...r] = e.split(t);
18339
18506
  return [
@@ -18344,7 +18511,7 @@ function bl(e, t) {
18344
18511
  }
18345
18512
  return [e];
18346
18513
  }
18347
- function xl(e, t = {}) {
18514
+ function Fl(e, t = {}) {
18348
18515
  let n = Se(ba(e)), r = {
18349
18516
  desktop: De(n.rootNode, "desktop"),
18350
18517
  tablet: De(n.rootNode, "tablet"),
@@ -18353,7 +18520,7 @@ function xl(e, t = {}) {
18353
18520
  apiKey: t.apiKey,
18354
18521
  templateId: t.templateId,
18355
18522
  formAction: t.formAction
18356
- }, m = cl(n.rootNode), h = (e, n) => {
18523
+ }, m = Sl(n.rootNode), h = (e, n) => {
18357
18524
  if (e.hidden) return null;
18358
18525
  let l = e.type === "page", h = {
18359
18526
  desktop: !0,
@@ -18368,14 +18535,14 @@ function xl(e, t = {}) {
18368
18535
  _[t] = { display: "none" };
18369
18536
  continue;
18370
18537
  }
18371
- let r = de(e, t), i = Nc(e, r, {
18538
+ let r = de(e, t), i = qc(e, r, {
18372
18539
  viewport: t,
18373
18540
  isGridChild: (n ? de(n, t).layoutMode : void 0) === "grid",
18374
18541
  isRootPage: l,
18375
18542
  forPublish: !0
18376
18543
  }).css;
18377
18544
  e.type === "section" && (i.overflow = "hidden"), e.props?.isFlowSpacer && (i.visibility = "hidden"), _[t] = i;
18378
- let s = yl(r.fontFamily);
18545
+ let s = Nl(r.fontFamily);
18379
18546
  s && a.add(s);
18380
18547
  let c = r.isBold ? 700 : Number(r.fontWeight);
18381
18548
  Number.isInteger(c) && c >= 100 && c <= 900 && o.add(c);
@@ -18384,22 +18551,22 @@ function xl(e, t = {}) {
18384
18551
  cls: g,
18385
18552
  rule: _
18386
18553
  });
18387
- let y = Ac(de(e, "desktop"));
18554
+ let y = Wc(de(e, "desktop"));
18388
18555
  y && u.push({
18389
18556
  cls: g,
18390
18557
  css: y
18391
18558
  });
18392
18559
  let b = [g, Ct(de(e, "desktop").customClasses)].filter(Boolean).join(" "), x = () => (e.children ?? []).map((t) => v(t, e)).filter((e) => e !== null);
18393
18560
  if (qt(e.type)) {
18394
- let n = rl(e, {
18561
+ let n = _l(e, {
18395
18562
  uid: wt(e.id),
18396
18563
  editing: !1,
18397
18564
  allowEmbedScripts: t.allowEmbedScripts !== !1,
18398
- formAction: ol(p),
18565
+ formAction: bl(p),
18399
18566
  now: f,
18400
18567
  templateId: t.templateId
18401
18568
  });
18402
- return n ? ((e.type === "carousel" || e.type === "timer" || e.type === "form") && (c = !0), e.type === "form" && al((e.props ?? {}).action, e.id, p).kind === "none" && s.push(`The form "${e.name}" has nowhere to send messages. Give it an address, or set one for the whole site.`), e.type === "signupForm" && !n.attrs?.["data-plexo-template-id"] && s.push(`The sign-up form "${e.name}" isn't connected to a funnel yet, so visitors can't sign up.`), {
18569
+ return n ? ((e.type === "carousel" || e.type === "timer" || e.type === "form") && (c = !0), e.type === "form" && yl((e.props ?? {}).action, e.id, p).kind === "none" && s.push(`The form "${e.name}" has nowhere to send messages. Give it an address, or set one for the whole site.`), e.type === "signupForm" && !n.attrs?.["data-plexo-template-id"] && s.push(`The sign-up form "${e.name}" isn't connected to a funnel yet, so visitors can't sign up.`), {
18403
18570
  ...n,
18404
18571
  attrs: {
18405
18572
  ...n.attrs,
@@ -18413,10 +18580,10 @@ function xl(e, t = {}) {
18413
18580
  class: b,
18414
18581
  id: m.get(e.id)
18415
18582
  }, x());
18416
- case "heading": return M(`h${Tt(e.props?.level, 1, 6, 2)}`, { class: b }, bl(e.content ?? "", e.props?.highlightText));
18417
- case "paragraph": return M("p", { class: b }, bl(e.content ?? "", e.props?.highlightText));
18583
+ case "heading": return M(`h${Tt(e.props?.level, 1, 6, 2)}`, { class: b }, Pl(e.content ?? "", e.props?.highlightText));
18584
+ case "paragraph": return M("p", { class: b }, Pl(e.content ?? "", e.props?.highlightText));
18418
18585
  case "button": {
18419
- let t = e.props?.href ? P(e.props.href) : "", n = bl(e.content ?? "", e.props?.highlightText);
18586
+ let t = e.props?.href ? P(e.props.href) : "", n = Pl(e.content ?? "", e.props?.highlightText);
18420
18587
  return t && t !== "#" ? M("a", {
18421
18588
  class: `${b} plx-btn`,
18422
18589
  href: t
@@ -18425,7 +18592,7 @@ function xl(e, t = {}) {
18425
18592
  type: "button"
18426
18593
  }, n);
18427
18594
  }
18428
- case "badge": return M("div", { class: b }, bl(e.content ?? "", e.props?.highlightText));
18595
+ case "badge": return M("div", { class: b }, Pl(e.content ?? "", e.props?.highlightText));
18429
18596
  case "image": {
18430
18597
  let t = vt(e.props?.src);
18431
18598
  return M("div", { class: `${b} plx-image` }, t ? {
@@ -18453,10 +18620,10 @@ function xl(e, t = {}) {
18453
18620
  if (!n) return n;
18454
18621
  let r = {}, i = typeof e.props?.ariaLabel == "string" ? e.props.ariaLabel.trim().slice(0, 200) : "";
18455
18622
  i && (r["aria-label"] = i), e.props?.ariaHidden === !0 && (r["aria-hidden"] = "true");
18456
- let a = ul[e.type] && typeof e.props?.htmlTag == "string" && ul[e.type].includes(e.props.htmlTag) ? e.props.htmlTag : null, o = a ? {
18623
+ let a = wl[e.type] && typeof e.props?.htmlTag == "string" && wl[e.type].includes(e.props.htmlTag) ? e.props.htmlTag : null, o = a ? {
18457
18624
  ...n,
18458
18625
  tag: a
18459
- } : n, s = e.type === "page" ? void 0 : Mc(de(e, "desktop"));
18626
+ } : n, s = e.type === "page" ? void 0 : Kc(de(e, "desktop"));
18460
18627
  s && (c = !0, l = !0, r.class = `${o.attrs?.class ?? ""} plx-in plx-in-${s.kind}`.trim());
18461
18628
  let u = Object.keys(r).length ? {
18462
18629
  ...o,
@@ -18468,7 +18635,7 @@ function xl(e, t = {}) {
18468
18635
  ...o.style,
18469
18636
  "--plx-delay": `${s.delay}ms`
18470
18637
  } } : {}
18471
- } : o, d = e.type === "section" ? null : mc(e.props?.htmlId);
18638
+ } : o, d = e.type === "section" ? null : Oc(e.props?.htmlId);
18472
18639
  if (!d) return u;
18473
18640
  let f = d;
18474
18641
  for (let e = 2; g.has(f); e++) f = `${d}-${e}`;
@@ -18485,7 +18652,7 @@ function xl(e, t = {}) {
18485
18652
  for (let [n, i] of r[e]) i === "outside" && r.desktop.get(n) !== "outside" && (t += 1);
18486
18653
  t && s.push(`On ${e}, ${t === 1 ? "1 element is" : `${t} elements are`} outside the screen and won't appear. Open the ${e} view and choose "Fit to this screen".`);
18487
18654
  }
18488
- let y = t.designSystem ? te(t.designSystem) : pl(), x = v(n.rootNode, null) ?? M("div", { class: "plx-page" }), S = RegExp(`"type":"(${Kt.join("|")})"`).test(JSON.stringify(n.rootNode)), C = [
18655
+ let y = t.designSystem ? te(t.designSystem) : Dl(), x = v(n.rootNode, null) ?? M("div", { class: "plx-page" }), S = RegExp(`"type":"(${Kt.join("|")})"`).test(JSON.stringify(n.rootNode)), C = [
18489
18656
  ":where(.plx-page,.plx-page *,.plx-page *::before,.plx-page *::after){box-sizing:border-box}",
18490
18657
  ":where(.plx-page *){margin:0;padding:0;border:0 solid}",
18491
18658
  ".plx-page{position:relative;overflow-x:clip;container-type:inline-size;container-name:plx-page;-webkit-text-size-adjust:100%;font-family:var(--semantic-font-family-body, var(--font-family-sans))}",
@@ -18501,29 +18668,29 @@ function xl(e, t = {}) {
18501
18668
  ".plx-hl{color:#FBBF24;font-style:italic;font-family:serif;font-weight:400}",
18502
18669
  ".plx-ph{width:100%;height:100%;min-height:60px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.32))}"
18503
18670
  ];
18504
- S && C.push(il);
18671
+ S && C.push(vl);
18505
18672
  for (let { cls: e, rule: t } of i) {
18506
- let n = t.desktop ? _l(t.desktop) : "";
18673
+ let n = t.desktop ? jl(t.desktop) : "";
18507
18674
  n && C.push(`.${e}{${n}}`);
18508
18675
  }
18509
- u.length && C.push(`@media (hover:hover){${u.map((e) => `.${e.cls}:hover{${_l(e.css)}}`).join("")}}`), l && C.push("@media (prefers-reduced-motion:no-preference){.plx-anim .plx-in{opacity:0;transition:opacity .6s ease-out var(--plx-delay,0ms),translate .6s ease-out var(--plx-delay,0ms),scale .6s ease-out var(--plx-delay,0ms)}.plx-anim .plx-in.plx-in-slide-up{translate:0 28px}.plx-anim .plx-in.plx-in-slide-left{translate:-36px 0}.plx-anim .plx-in.plx-in-slide-right{translate:36px 0}.plx-anim .plx-in.plx-in-zoom{scale:.92}.plx-anim .plx-in.plx-in-on{opacity:1;translate:none;scale:none}}");
18676
+ u.length && C.push(`@media (hover:hover){${u.map((e) => `.${e.cls}:hover{${jl(e.css)}}`).join("")}}`), l && C.push("@media (prefers-reduced-motion:no-preference){.plx-anim .plx-in{opacity:0;transition:opacity .6s ease-out var(--plx-delay,0ms),translate .6s ease-out var(--plx-delay,0ms),scale .6s ease-out var(--plx-delay,0ms)}.plx-anim .plx-in.plx-in-slide-up{translate:0 28px}.plx-anim .plx-in.plx-in-slide-left{translate:-36px 0}.plx-anim .plx-in.plx-in-slide-right{translate:36px 0}.plx-anim .plx-in.plx-in-zoom{scale:.92}.plx-anim .plx-in.plx-in-on{opacity:1;translate:none;scale:none}}");
18510
18677
  for (let e of ["tablet", "mobile"]) {
18511
18678
  let t = e === "tablet" ? "desktop" : "tablet", n = [];
18512
18679
  for (let { cls: r, rule: a } of i) {
18513
- let i = _l(vl(a[t] ?? {}, a[e] ?? {}));
18680
+ let i = jl(Ml(a[t] ?? {}, a[e] ?? {}));
18514
18681
  i && n.push(`.${r}{${i}}`);
18515
18682
  }
18516
18683
  n.length && C.push(`@container plx-page ${pe[e]}{${n.join("")}}`);
18517
18684
  }
18518
18685
  let w = C.join("\n");
18519
- for (let e of ys(y, w)) a.add(e);
18686
+ for (let e of Ns(y, w)) a.add(e);
18520
18687
  let ee = [...a], T = new Set(ee.filter((e) => _(y.fonts, e)).map((e) => e.toLowerCase())), E = ae(y.fonts, T), D = b(ee.filter((e) => !T.has(e.toLowerCase())).map((e) => ({
18521
18688
  family: e,
18522
18689
  weights: [...o]
18523
18690
  })));
18524
18691
  return {
18525
18692
  tree: x,
18526
- css: `${E ? `${E}\n` : ""}${bs(y, w)}\n${w}`,
18693
+ css: `${E ? `${E}\n` : ""}${Ps(y, w)}\n${w}`,
18527
18694
  usesRuntime: c,
18528
18695
  fonts: ee,
18529
18696
  fontLinks: D,
@@ -18532,7 +18699,7 @@ function xl(e, t = {}) {
18532
18699
  }
18533
18700
  //#endregion
18534
18701
  //#region src/v2/compile/html.ts
18535
- var Sl = (e) => {
18702
+ var Il = (e) => {
18536
18703
  let t = "";
18537
18704
  for (let [n, r] of Object.entries(e.attrs ?? {})) r === void 0 || r === !1 || (t += r === !0 ? ` ${n}` : ` ${n}="${N(String(r))}"`);
18538
18705
  if (e.style) {
@@ -18541,13 +18708,13 @@ var Sl = (e) => {
18541
18708
  }
18542
18709
  return t;
18543
18710
  };
18544
- function Cl(e) {
18711
+ function Ll(e) {
18545
18712
  if (typeof e == "string") return ht(e);
18546
- let t = `<${e.tag}${Sl(e)}>`;
18547
- return ct.has(e.tag) ? t : `${t}${(e.children ?? []).map(Cl).join("")}</${e.tag}>`;
18713
+ let t = `<${e.tag}${Il(e)}>`;
18714
+ return ct.has(e.tag) ? t : `${t}${(e.children ?? []).map(Ll).join("")}</${e.tag}>`;
18548
18715
  }
18549
- function wl(e, t = {}) {
18550
- let n = xl(e, t), r = Cl(n.tree), i = t.runtime === "none" || !n.usesRuntime ? "" : `(${fc})(document);`.replace(/<\/script/gi, "<\\/script"), a = gc(t.customJs);
18716
+ function Rl(e, t = {}) {
18717
+ let n = Fl(e, t), r = Ll(n.tree), i = t.runtime === "none" || !n.usesRuntime ? "" : `(${Ec})(document);`.replace(/<\/script/gi, "<\\/script"), a = Ac(t.customJs);
18551
18718
  a.warning && n.warnings.push(a.warning);
18552
18719
  let o = a.code ? `${i}${i ? "\n" : ""}${a.code}` : i, s = n.fontLinks.length ? `<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>${n.fontLinks.map((e) => `<link rel="stylesheet" href="${N(e)}">`).join("")}` : "", c = `<!doctype html>
18553
18720
  <html lang="${N(t.lang ?? "en")}">
@@ -18573,14 +18740,14 @@ ${i ? `<script>${i}<\/script>\n` : ""}${a.code ? `<script>\n${a.code}\n<\/script
18573
18740
  }
18574
18741
  //#endregion
18575
18742
  //#region src/v2/email/support.ts
18576
- var Tl = /* @__PURE__ */ new Set([
18743
+ var zl = /* @__PURE__ */ new Set([
18577
18744
  "page",
18578
18745
  "section",
18579
18746
  "container",
18580
18747
  "columns",
18581
18748
  "column",
18582
18749
  "card"
18583
- ]), El = /* @__PURE__ */ new Set([
18750
+ ]), Bl = /* @__PURE__ */ new Set([
18584
18751
  "heading",
18585
18752
  "paragraph",
18586
18753
  "button",
@@ -18588,18 +18755,18 @@ var Tl = /* @__PURE__ */ new Set([
18588
18755
  "divider",
18589
18756
  "spacer",
18590
18757
  "badge"
18591
- ]), Dl = (e) => Tl.has(e) || El.has(e), Ol = 600, kl = (e, t, n = null) => {
18592
- t(e, n), e.children?.forEach((n) => kl(n, t, e));
18758
+ ]), Vl = (e) => zl.has(e) || Bl.has(e), Hl = 600, Ul = (e, t, n = null) => {
18759
+ t(e, n), e.children?.forEach((n) => Ul(n, t, e));
18593
18760
  };
18594
- function Al(e) {
18761
+ function Wl(e) {
18595
18762
  let t = [];
18596
- return kl(e.rootNode, (e) => {
18763
+ return Ul(e.rootNode, (e) => {
18597
18764
  let n = (n) => t.push({
18598
18765
  nodeId: e.id,
18599
18766
  name: e.name,
18600
18767
  message: n
18601
18768
  });
18602
- if (!Dl(e.type)) {
18769
+ if (!Vl(e.type)) {
18603
18770
  n(`“${e.name}” is a ${e.type}, which email apps can't show, so it is left out.`);
18604
18771
  return;
18605
18772
  }
@@ -18609,7 +18776,7 @@ function Al(e) {
18609
18776
  }
18610
18777
  //#endregion
18611
18778
  //#region src/v2/email/compile.ts
18612
- var jl = (e) => {
18779
+ var Gl = (e) => {
18613
18780
  let t = f(e);
18614
18781
  return t && t.a > .05 ? [
18615
18782
  t.r,
@@ -18617,7 +18784,7 @@ var jl = (e) => {
18617
18784
  t.b
18618
18785
  ] : null;
18619
18786
  };
18620
- function Ml([e, t, n]) {
18787
+ function Kl([e, t, n]) {
18621
18788
  let r = e / 255, i = t / 255, a = n / 255, o = Math.max(r, i, a), s = Math.min(r, i, a), c = (o + s) / 2;
18622
18789
  if (o === s) return [
18623
18790
  0,
@@ -18631,7 +18798,7 @@ function Ml([e, t, n]) {
18631
18798
  c
18632
18799
  ];
18633
18800
  }
18634
- var Nl = (e, t, n) => {
18801
+ var ql = (e, t, n) => {
18635
18802
  let { r, g: i, b: a } = p(e, Math.max(0, Math.min(1, t)) * 100, Math.max(0, Math.min(1, n)) * 100);
18636
18803
  return m({
18637
18804
  r,
@@ -18640,14 +18807,14 @@ var Nl = (e, t, n) => {
18640
18807
  a: 1
18641
18808
  });
18642
18809
  };
18643
- function Pl(e, t) {
18644
- let n = jl(t);
18810
+ function Jl(e, t) {
18811
+ let n = Gl(t);
18645
18812
  if (!n) return null;
18646
- let [r, i, a] = Ml(n);
18647
- return e === "bg" ? a >= .55 ? Nl(r, Math.min(i, .35) * .6, .045 + (a - .55) * .2) : null : e === "text" || e === "border" ? a >= .5 ? null : i > .25 ? Nl(r, Math.min(i, .7), Math.max(a, .64)) : e === "border" ? Nl(r, i, Math.max(a, .55)) : Nl(r, i * .8, Math.min(.93, .93 - a * .5)) : e === "btnbg" ? a < .2 && i < .25 ? Nl(r, i * .3, .92) : a < .34 ? Nl(r, i, .44) : null : e === "btntext" ? a > .8 ? Nl(r, Math.min(i, .3), .1) : null : a > .6 ? Nl(r, i * .5, .2 + (a - .6) * .15) : null;
18813
+ let [r, i, a] = Kl(n);
18814
+ return e === "bg" ? a >= .55 ? ql(r, Math.min(i, .35) * .6, .045 + (a - .55) * .2) : null : e === "text" || e === "border" ? a >= .5 ? null : i > .25 ? ql(r, Math.min(i, .7), Math.max(a, .64)) : e === "border" ? ql(r, i, Math.max(a, .55)) : ql(r, i * .8, Math.min(.93, .93 - a * .5)) : e === "btnbg" ? a < .2 && i < .25 ? ql(r, i * .3, .92) : a < .34 ? ql(r, i, .44) : null : e === "btntext" ? a > .8 ? ql(r, Math.min(i, .3), .1) : null : a > .6 ? ql(r, i * .5, .2 + (a - .6) * .15) : null;
18648
18815
  }
18649
- var Fl = "Arial, Helvetica, sans-serif", W = (e) => `${Math.round(e * 100) / 100}px`;
18650
- function Il(e) {
18816
+ var Yl = "Arial, Helvetica, sans-serif", G = (e) => `${Math.round(e * 100) / 100}px`;
18817
+ function Xl(e) {
18651
18818
  if (typeof e == "number" && Number.isFinite(e)) return e;
18652
18819
  if (typeof e != "string") return;
18653
18820
  let t = /^\s*(-?\d+(?:\.\d+)?)\s*(px|rem|em)?\s*$/.exec(e);
@@ -18655,11 +18822,11 @@ function Il(e) {
18655
18822
  let n = parseFloat(t[1]);
18656
18823
  return t[2] === "rem" || t[2] === "em" ? n * 16 : n;
18657
18824
  }
18658
- var Ll = (e) => {
18825
+ var Zl = (e) => {
18659
18826
  let t = typeof e == "string" ? /^\s*(\d+(?:\.\d+)?)\s*%\s*$/.exec(e) : null;
18660
18827
  return t ? parseFloat(t[1]) : void 0;
18661
18828
  };
18662
- function Rl(e, t, n, r, i) {
18829
+ function Ql(e, t, n, r, i) {
18663
18830
  let a = [
18664
18831
  0,
18665
18832
  0,
@@ -18667,7 +18834,7 @@ function Rl(e, t, n, r, i) {
18667
18834
  0
18668
18835
  ];
18669
18836
  if (typeof e == "string" || typeof e == "number") {
18670
- let t = String(e).trim().split(/\s+/).map((e) => Il(e) ?? 0);
18837
+ let t = String(e).trim().split(/\s+/).map((e) => Xl(e) ?? 0);
18671
18838
  t.length === 1 ? a = [
18672
18839
  t[0],
18673
18840
  t[0],
@@ -18690,7 +18857,7 @@ function Rl(e, t, n, r, i) {
18690
18857
  n,
18691
18858
  r,
18692
18859
  i
18693
- ].map((e) => Il(e));
18860
+ ].map((e) => Xl(e));
18694
18861
  return [
18695
18862
  o[0] ?? a[0],
18696
18863
  o[1] ?? a[1],
@@ -18698,9 +18865,9 @@ function Rl(e, t, n, r, i) {
18698
18865
  o[3] ?? a[3]
18699
18866
  ];
18700
18867
  }
18701
- function zl(e, t = {}) {
18702
- let n = Se(e), r = E(t.designSystem ? te(t.designSystem) : ue()), i = Math.min(800, Math.max(320, t.width ?? 600)), a = Al(n).map((e) => e.message), o = [], s = /* @__PURE__ */ new Map(), c = (e, n) => {
18703
- if (!n || t.dark === "off" || !Pl(e, n)) return "";
18868
+ function $l(e, t = {}) {
18869
+ let n = Se(e), r = E(t.designSystem ? te(t.designSystem) : ue()), i = Math.min(800, Math.max(320, t.width ?? 600)), a = Wl(n).map((e) => e.message), o = [], s = /* @__PURE__ */ new Map(), c = (e, n) => {
18870
+ if (!n || t.dark === "off" || !Jl(e, n)) return "";
18704
18871
  let r = `${e}:${n.toLowerCase()}`, i = s.get(r);
18705
18872
  return i || (i = {
18706
18873
  cls: `plx-${e[0]}${s.size}`,
@@ -18713,7 +18880,7 @@ function zl(e, t = {}) {
18713
18880
  return /^var\(/.test(t) ? void 0 : bt(t);
18714
18881
  }, d = (e) => {
18715
18882
  try {
18716
- return ts(e, {
18883
+ return hs(e, {
18717
18884
  width: i,
18718
18885
  fontPx: 16,
18719
18886
  tokens: r
@@ -18721,12 +18888,12 @@ function zl(e, t = {}) {
18721
18888
  } catch {
18722
18889
  return;
18723
18890
  }
18724
- }, f = (e) => typeof e == "string" ? Il(e) ?? (/var\(|calc\(/.test(e) ? d(e) : void 0) : Il(e), p = (() => {
18891
+ }, f = (e) => typeof e == "string" ? Xl(e) ?? (/var\(|calc\(/.test(e) ? d(e) : void 0) : Xl(e), p = (() => {
18725
18892
  let e = ie(r, "var(--semantic-font-family-body, var(--font-family-sans))");
18726
- return e && !/^var\(/.test(e) ? e : Fl;
18893
+ return e && !/^var\(/.test(e) ? e : Yl;
18727
18894
  })(), m = /* @__PURE__ */ new Map(), h = (e) => {
18728
18895
  let t = (typeof e == "string" ? ie(r, e.trim()) : "").split(",")[0]?.replace(/["']/g, "").trim();
18729
- return !t || /^var\(/.test(t) || !/^[\w\s-]{1,60}$/.test(t) ? p.includes(",") ? p : `${p}, ${Fl}` : (m.has(t) || m.set(t, /* @__PURE__ */ new Set()), `'${t}', ${/(serif|georgia|times|garamond|playfair|fraunces|lora|merriweather|cormorant|libre baskerville|dm serif|crimson|spectral|newsreader|source serif)/i.test(t) && !/sans/i.test(t) ? "Georgia, 'Times New Roman', serif" : Fl}`);
18896
+ return !t || /^var\(/.test(t) || !/^[\w\s-]{1,60}$/.test(t) ? p.includes(",") ? p : `${p}, ${Yl}` : (m.has(t) || m.set(t, /* @__PURE__ */ new Set()), `'${t}', ${/(serif|georgia|times|garamond|playfair|fraunces|lora|merriweather|cormorant|libre baskerville|dm serif|crimson|spectral|newsreader|source serif)/i.test(t) && !/sans/i.test(t) ? "Georgia, 'Times New Roman', serif" : Yl}`);
18730
18897
  }, g = (e, t) => {
18731
18898
  let n = je(t.textStyle) ? t.textStyle : e.type === "heading" ? Ie(e.props?.level) : null;
18732
18899
  return n ? Me(n) : null;
@@ -18738,12 +18905,12 @@ function zl(e, t = {}) {
18738
18905
  lh: p,
18739
18906
  family: _
18740
18907
  };
18741
- }, v = (e) => ht(e).replace(/\r?\n/g, "<br>"), y = (e) => e.replace(/\s+/g, " ").trim(), x = (e) => Rl(e.padding, e.paddingTop, e.paddingRight, e.paddingBottom, e.paddingLeft), S = (e) => e === "center" ? "center" : e === "right" || e === "flex-end" ? "right" : e === "left" || e === "flex-start" ? "left" : void 0, C = (e) => {
18908
+ }, v = (e) => ht(e).replace(/\r?\n/g, "<br>"), y = (e) => e.replace(/\s+/g, " ").trim(), x = (e) => Ql(e.padding, e.paddingTop, e.paddingRight, e.paddingBottom, e.paddingLeft), S = (e) => e === "center" ? "center" : e === "right" || e === "flex-end" ? "right" : e === "left" || e === "flex-start" ? "left" : void 0, C = (e) => {
18742
18909
  let t = f(e.borderWidth), n = u(e.borderColor), r = e.borderStyle && e.borderStyle !== "none" ? e.borderStyle : void 0;
18743
- return t && n && r ? `border:${W(t)} ${r} ${n};` : "";
18910
+ return t && n && r ? `border:${G(t)} ${r} ${n};` : "";
18744
18911
  }, w = (e) => {
18745
18912
  let t = f(e.borderRadius);
18746
- return t ? `border-radius:${W(Math.min(t, 999))};` : "";
18913
+ return t ? `border-radius:${G(Math.min(t, 999))};` : "";
18747
18914
  }, ee = (e) => f(e.gap) ?? 0, T = (e) => {
18748
18915
  if (typeof e.backgroundGradient != "string") return "";
18749
18916
  let t = /^\s*linear-gradient\(\s*((?:\d{1,3}deg)|(?:to (?:top|bottom|left|right)(?: (?:left|right|top|bottom))?))\s*,(.+)\)\s*$/i.exec(e.backgroundGradient);
@@ -18757,7 +18924,7 @@ function zl(e, t = {}) {
18757
18924
  return r.length >= 2 && r.length <= 5 ? `background-image:linear-gradient(${t[1]},${r.join(",")});` : "";
18758
18925
  };
18759
18926
  function D(e, n) {
18760
- if (!Dl(e.type)) return "";
18927
+ if (!Vl(e.type)) return "";
18761
18928
  let r = e.styles ?? {};
18762
18929
  if (r.display === "none") return "";
18763
18930
  switch (e.type) {
@@ -18766,10 +18933,10 @@ function zl(e, t = {}) {
18766
18933
  case "badge": {
18767
18934
  let t = _(e, r), n = u(r.textColor) ?? u("var(--color-text-primary)") ?? "#111827", i = e.type === "heading" ? `h${Math.min(6, Math.max(1, Math.round(Number(e.props?.level) || 2)))}` : "p", a = typeof e.content == "string" ? e.content : "";
18768
18935
  o.push(y(a));
18769
- let s = S(r.textAlign) ?? "left", d = f(r.letterSpacing), p = `margin:0;padding:0;font-family:${t.family};font-size:${W(t.size)};line-height:${W(t.lh)};font-weight:${t.weight};color:${n};text-align:${s};${r.isItalic ? "font-style:italic;" : ""}${r.isUnderline ? "text-decoration:underline;" : ""}${r.textTransform && r.textTransform !== "none" ? `text-transform:${r.textTransform};` : ""}${d ? `letter-spacing:${W(d)};` : ""}`, m = u(r.backgroundColor), h = `<${i}${l(c("text", n))} style="${N(p)}">${v(a)}</${i}>`;
18936
+ let s = S(r.textAlign) ?? "left", d = f(r.letterSpacing), p = `margin:0;padding:0;font-family:${t.family};font-size:${G(t.size)};line-height:${G(t.lh)};font-weight:${t.weight};color:${n};text-align:${s};${r.isItalic ? "font-style:italic;" : ""}${r.isUnderline ? "text-decoration:underline;" : ""}${r.textTransform && r.textTransform !== "none" ? `text-transform:${r.textTransform};` : ""}${d ? `letter-spacing:${G(d)};` : ""}`, m = u(r.backgroundColor), h = `<${i}${l(c("text", n))} style="${N(p)}">${v(a)}</${i}>`;
18770
18937
  if (e.type === "badge" || m) {
18771
18938
  let [e, t, n, i] = x(r);
18772
- return `<table role="presentation" cellpadding="0" cellspacing="0" border="0"${s === "left" ? "" : ` align="${s}"`}><tr><td${m ? ` bgcolor="${m}"` : ""}${l(c("bg", m))} style="${N(`${m ? `background-color:${m};` : ""}padding:${W(e)} ${W(t)} ${W(n)} ${W(i)};${w(r)}${C(r)}`)}">${h}</td></tr></table>`;
18939
+ return `<table role="presentation" cellpadding="0" cellspacing="0" border="0"${s === "left" ? "" : ` align="${s}"`}><tr><td${m ? ` bgcolor="${m}"` : ""}${l(c("bg", m))} style="${N(`${m ? `background-color:${m};` : ""}padding:${G(e)} ${G(t)} ${G(n)} ${G(i)};${w(r)}${C(r)}`)}">${h}</td></tr></table>`;
18773
18940
  }
18774
18941
  return h;
18775
18942
  }
@@ -18781,49 +18948,49 @@ function zl(e, t = {}) {
18781
18948
  f || 28,
18782
18949
  p || 14,
18783
18950
  m || 28
18784
- ], ee = S(r.textAlign) ?? S(r.alignSelf) ?? "left", T = r.backgroundColor === "transparent", E = w(r) || "border-radius:8px;", te = C(r), D = `${T ? "" : `background-color:${a};`}${E}${te}`, O = T ? null : Pl("btnbg", a), ne = O ? jl(O) : null, re = !!ne && Ml(ne)[2] > .8 && !!Pl("btntext", s), ie = r.widthSizing === "fill" || r.width === "100%" || r.isFullWidth;
18785
- return `<table role="presentation" cellpadding="0" cellspacing="0" border="0"${ie ? " width=\"100%\"" : ""} align="${ee}"><tr><td${T ? "" : ` bgcolor="${a}"`}${l([T ? "" : c("btnbg", a), te && u(r.borderColor) ? c("border", u(r.borderColor)) : ""].filter(Boolean).join(" "))} align="center" style="${N(D)}"><a href="${N(i)}" target="_blank"${l(T ? c("text", u(r.textColor) ?? a) : re ? c("btntext", s) : "")} style="${N(`display:${ie ? "block" : "inline-block"};padding:${W(h)} ${W(g)} ${W(v)} ${W(b)};font-family:${t.family};font-size:${W(t.size)};line-height:${W(Math.round(t.size * 1.2))};font-weight:${t.weight === "400" ? "600" : t.weight};color:${T ? u(r.textColor) ?? a : s};text-decoration:none;white-space:nowrap;${E}`)}">${ht(n)}</a></td></tr></table>`;
18951
+ ], ee = S(r.textAlign) ?? S(r.alignSelf) ?? "left", T = r.backgroundColor === "transparent", E = w(r) || "border-radius:8px;", te = C(r), D = `${T ? "" : `background-color:${a};`}${E}${te}`, O = T ? null : Jl("btnbg", a), ne = O ? Gl(O) : null, re = !!ne && Kl(ne)[2] > .8 && !!Jl("btntext", s), ie = r.widthSizing === "fill" || r.width === "100%" || r.isFullWidth;
18952
+ return `<table role="presentation" cellpadding="0" cellspacing="0" border="0"${ie ? " width=\"100%\"" : ""} align="${ee}"><tr><td${T ? "" : ` bgcolor="${a}"`}${l([T ? "" : c("btnbg", a), te && u(r.borderColor) ? c("border", u(r.borderColor)) : ""].filter(Boolean).join(" "))} align="center" style="${N(D)}"><a href="${N(i)}" target="_blank"${l(T ? c("text", u(r.textColor) ?? a) : re ? c("btntext", s) : "")} style="${N(`display:${ie ? "block" : "inline-block"};padding:${G(h)} ${G(g)} ${G(v)} ${G(b)};font-family:${t.family};font-size:${G(t.size)};line-height:${G(Math.round(t.size * 1.2))};font-weight:${t.weight === "400" ? "600" : t.weight};color:${T ? u(r.textColor) ?? a : s};text-decoration:none;white-space:nowrap;${E}`)}">${ht(n)}</a></td></tr></table>`;
18786
18953
  }
18787
18954
  case "image": {
18788
18955
  let i = vt(e.props?.src);
18789
18956
  if (!i) return "";
18790
- let a = typeof e.props?.alt == "string" ? e.props.alt : "", o = f(r.customWidth ?? r.width), s = Ll(r.customWidth ?? r.width), c = Math.round(Math.min(n, o ?? (s ? n * s / 100 : n))), l = S(r.alignSelf) ?? S(r.textAlign), u = `display:block;border:0;outline:none;text-decoration:none;width:${W(c)};max-width:100%;height:auto;${w(r)}`, d = t.dark === "off" ? "" : vt(e.props?.srcDark), p = d ? `<img class="plx-light" src="${N(i)}" alt="${N(a)}" width="${c}" style="${N(u)}"><img class="plx-dark" src="${N(d)}" alt="${N(a)}" width="${c}" style="${N(`${u}display:none;max-height:0;overflow:hidden;`)}">` : `<img src="${N(i)}" alt="${N(a)}" width="${c}" style="${N(u)}">`;
18957
+ let a = typeof e.props?.alt == "string" ? e.props.alt : "", o = f(r.customWidth ?? r.width), s = Zl(r.customWidth ?? r.width), c = Math.round(Math.min(n, o ?? (s ? n * s / 100 : n))), l = S(r.alignSelf) ?? S(r.textAlign), u = `display:block;border:0;outline:none;text-decoration:none;width:${G(c)};max-width:100%;height:auto;${w(r)}`, d = t.dark === "off" ? "" : vt(e.props?.srcDark), p = d ? `<img class="plx-light" src="${N(i)}" alt="${N(a)}" width="${c}" style="${N(u)}"><img class="plx-dark" src="${N(d)}" alt="${N(a)}" width="${c}" style="${N(`${u}display:none;max-height:0;overflow:hidden;`)}">` : `<img src="${N(i)}" alt="${N(a)}" width="${c}" style="${N(u)}">`;
18791
18958
  return l && l !== "left" ? `<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="${l}"><tr><td>${p}</td></tr></table>` : p;
18792
18959
  }
18793
18960
  case "divider": {
18794
- let e = u(r.borderColor) ?? u("var(--color-border-default)") ?? "#e5e7eb", t = f(r.borderWidth?.toString().split(/\s+/).find((e) => Il(e))) ?? 1;
18795
- return `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${t}"${l(c("line", e))} style="font-size:1px;line-height:1px;border-top:${W(t)} solid ${e};">&nbsp;</td></tr></table>`;
18961
+ let e = u(r.borderColor) ?? u("var(--color-border-default)") ?? "#e5e7eb", t = f(r.borderWidth?.toString().split(/\s+/).find((e) => Xl(e))) ?? 1;
18962
+ return `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${t}"${l(c("line", e))} style="font-size:1px;line-height:1px;border-top:${G(t)} solid ${e};">&nbsp;</td></tr></table>`;
18796
18963
  }
18797
18964
  case "spacer": {
18798
18965
  let e = Math.min(400, Math.max(1, f(r.height) ?? f(r.minHeight) ?? 24));
18799
- return `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${e}" style="height:${W(e)};font-size:1px;line-height:${W(e)};">&nbsp;</td></tr></table>`;
18966
+ return `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${e}" style="height:${G(e)};font-size:1px;line-height:${G(e)};">&nbsp;</td></tr></table>`;
18800
18967
  }
18801
18968
  default: return O(e, n);
18802
18969
  }
18803
18970
  }
18804
18971
  function O(e, t, n = !1) {
18805
- let r = e.styles ?? {}, i = (e.children ?? []).filter((e) => Dl(e.type) && (e.styles ?? {}).display !== "none"), [a, o, s, d] = x(r), p = u(r.backgroundColor), m = f(r.customWidth ?? r.width) ?? f(r.maxWidth), h = Math.max(40, Math.min(t, m ?? t)), g = h - d - o, _ = ee(r), v = e.type === "columns" || r.layoutMode !== "grid" && r.flexDirection === "row" && e.type !== "section" && e.type !== "page", y = S(r.alignItems), b = r.alignItems === "center" ? "middle" : r.alignItems === "flex-end" ? "bottom" : "top", E = "";
18972
+ let r = e.styles ?? {}, i = (e.children ?? []).filter((e) => Vl(e.type) && (e.styles ?? {}).display !== "none"), [a, o, s, d] = x(r), p = u(r.backgroundColor), m = f(r.customWidth ?? r.width) ?? f(r.maxWidth), h = Math.max(40, Math.min(t, m ?? t)), g = h - d - o, _ = ee(r), v = e.type === "columns" || r.layoutMode !== "grid" && r.flexDirection === "row" && e.type !== "section" && e.type !== "page", y = S(r.alignItems), b = r.alignItems === "center" ? "middle" : r.alignItems === "flex-end" ? "bottom" : "top", E = "";
18806
18973
  if (i.length) if (v) {
18807
18974
  let e = i.map((e) => {
18808
- let t = e.styles ?? {}, n = f(t.customWidth ?? t.width), r = Ll(t.customWidth ?? t.width);
18975
+ let t = e.styles ?? {}, n = f(t.customWidth ?? t.width), r = Zl(t.customWidth ?? t.width);
18809
18976
  return n === void 0 ? r !== void 0 && r < 99 ? g * r / 100 : void 0 : n;
18810
18977
  }), t = e.reduce((e, t) => e + (t ?? 0), 0), n = e.filter((e) => e === void 0).length, c = n ? Math.max(40, (g - t - _ * (i.length - 1)) / n) : 0, l = i.map((t, n) => {
18811
18978
  let a = Math.floor(e[n] ?? c), o = n === i.length - 1, s = D(t, a);
18812
- return `<td${r.stackOnMobile === !1 ? "" : " class=\"plx-col\""} width="${a}" valign="${b}" style="${N(`width:${W(a)};${o ? "" : `padding-right:${W(_)};`}vertical-align:${b};`)}">${s}</td>`;
18979
+ return `<td${r.stackOnMobile === !1 ? "" : " class=\"plx-col\""} width="${a}" valign="${b}" style="${N(`width:${G(a)};${o ? "" : `padding-right:${G(_)};`}vertical-align:${b};`)}">${s}</td>`;
18813
18980
  });
18814
- E = `<tr><td style="${N(`padding:${W(a)} ${W(o)} ${W(s)} ${W(d)};`)}"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>${l.join("")}</tr></table></td></tr>`;
18981
+ E = `<tr><td style="${N(`padding:${G(a)} ${G(o)} ${G(s)} ${G(d)};`)}"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>${l.join("")}</tr></table></td></tr>`;
18815
18982
  } else E = i.map((e, t) => {
18816
18983
  let n = e.styles ?? {}, r = S(n.alignSelf) ?? y ?? (e.type === "button" || e.type, void 0), c = r === "center" || n.marginLeft === "auto" && n.marginRight === "auto" || n.margin === "0 auto" ? " align=\"center\"" : r === "right" || n.marginLeft === "auto" ? " align=\"right\"" : "", l = D(e, g);
18817
18984
  if (!l) return "";
18818
- let u = t === 0 ? a : _, [f, , p] = Rl(n.margin, n.marginTop, n.marginRight, n.marginBottom, n.marginLeft);
18819
- return `<tr><td${c} style="${N(`padding:${W(u + f)} ${W(o)} ${W(t === i.length - 1 ? s + p : p)} ${W(d)};`)}">${l}</td></tr>`;
18985
+ let u = t === 0 ? a : _, [f, , p] = Ql(n.margin, n.marginTop, n.marginRight, n.marginBottom, n.marginLeft);
18986
+ return `<tr><td${c} style="${N(`padding:${G(u + f)} ${G(o)} ${G(t === i.length - 1 ? s + p : p)} ${G(d)};`)}">${l}</td></tr>`;
18820
18987
  }).join("");
18821
- else a + s > 0 && (E = `<tr><td height="${a + s}" style="font-size:1px;line-height:${W(a + s)};">&nbsp;</td></tr>`);
18822
- let te = `${p ? `background-color:${p};` : ""}${T(r)}${w(r)}${C(r)}`, O = n ? " width=\"100%\"" : ` width="${Math.round(h)}"`, ne = n ? "" : `max-width:${W(h)};width:100%;`;
18988
+ else a + s > 0 && (E = `<tr><td height="${a + s}" style="font-size:1px;line-height:${G(a + s)};">&nbsp;</td></tr>`);
18989
+ let te = `${p ? `background-color:${p};` : ""}${T(r)}${w(r)}${C(r)}`, O = n ? " width=\"100%\"" : ` width="${Math.round(h)}"`, ne = n ? "" : `max-width:${G(h)};width:100%;`;
18823
18990
  return `<table role="presentation"${O}${p ? ` bgcolor="${p}"` : ""}${l(c("bg", p))} cellpadding="0" cellspacing="0" border="0" style="${N(`${ne}${te}`)}">${E}</table>`;
18824
18991
  }
18825
- let ne = n.rootNode, re = u((ne.styles ?? {}).backgroundColor) ?? u("var(--color-bg-canvas)") ?? "#ffffff", ae = (ne.children ?? []).filter((e) => Dl(e.type)).map((e) => {
18826
- let t = e.styles ?? {}, n = u(t.backgroundColor), r = Tl.has(e.type) ? O(e, i) : D(e, i);
18992
+ let ne = n.rootNode, re = u((ne.styles ?? {}).backgroundColor) ?? u("var(--color-bg-canvas)") ?? "#ffffff", ae = (ne.children ?? []).filter((e) => Vl(e.type)).map((e) => {
18993
+ let t = e.styles ?? {}, n = u(t.backgroundColor), r = zl.has(e.type) ? O(e, i) : D(e, i);
18827
18994
  return r ? `<tr><td align="center"${n ? ` bgcolor="${n}"` : ""}${l(c("bg", n))} style="${N(`${n ? `background-color:${n};` : ""}${T(t)}`)}">${r}</td></tr>` : "";
18828
18995
  }).join(""), oe = t.title ?? n.name, k = b([...m].map(([e, t]) => ({
18829
18996
  family: e,
@@ -18833,7 +19000,7 @@ function zl(e, t = {}) {
18833
19000
  700
18834
19001
  ]
18835
19002
  }))).map((e) => `<link href="${N(e)}" rel="stylesheet">\n`).join(""), se = t.preheader ? `<div style="display:none;max-height:0;overflow:hidden;opacity:0;color:transparent;mso-hide:all;">${ht(t.preheader)}${"&nbsp;&zwnj;".repeat(40)}</div>` : "", ce = c("bg", re), le = t.dark !== "off", de = (e) => {
18836
- let t = Pl(e.kind, e.color);
19003
+ let t = Jl(e.kind, e.color);
18837
19004
  if (!t) return [];
18838
19005
  let n = e.kind === "bg" || e.kind === "btnbg", r = n ? "background-color" : e.kind === "text" || e.kind === "btntext" ? "color" : e.kind === "border" ? "border-color" : "border-top-color", i = n ? "ogsb" : "ogsc";
18839
19006
  return [`.${e.cls}{${r}:${t}!important}`, `[data-${i}] .${e.cls}{${r}:${t}!important}`];
@@ -18868,7 +19035,7 @@ ${se}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" bor
18868
19035
  }
18869
19036
  //#endregion
18870
19037
  //#region src/v2/email/blank.ts
18871
- var Bl = (e) => ({
19038
+ var eu = (e) => ({
18872
19039
  id: k("page"),
18873
19040
  type: "page",
18874
19041
  name: "Email",
@@ -18882,22 +19049,22 @@ var Bl = (e) => ({
18882
19049
  },
18883
19050
  children: e
18884
19051
  });
18885
- function Vl() {
19052
+ function tu() {
18886
19053
  return [{
18887
19054
  id: k("page"),
18888
19055
  name: "Email",
18889
19056
  slug: "email",
18890
19057
  isHome: !0,
18891
- rootNode: Bl([Ji(Fi("emailText", "plain"))])
19058
+ rootNode: eu([Ji(Fi("emailText", "plain"))])
18892
19059
  }];
18893
19060
  }
18894
- function Hl() {
19061
+ function nu() {
18895
19062
  return [{
18896
19063
  id: k("page"),
18897
19064
  name: "Email",
18898
19065
  slug: "email",
18899
19066
  isHome: !0,
18900
- rootNode: Bl([
19067
+ rootNode: eu([
18901
19068
  ["emailHeader", "centered"],
18902
19069
  ["emailHero", "centered"],
18903
19070
  ["emailFeatures", "columns"],
@@ -18908,48 +19075,48 @@ function Hl() {
18908
19075
  }
18909
19076
  //#endregion
18910
19077
  //#region src/v2/migrate/legacy.ts
18911
- var Ul = 1400, Wl = (e) => {
19078
+ var ru = 1400, iu = (e) => {
18912
19079
  let t = e;
18913
19080
  return !!t && typeof t == "object" && !!t.nodes && typeof t.nodes == "object" && !Array.isArray(t.nodes) && Array.isArray(t.pageOrder);
18914
- }, Gl = {
19081
+ }, au = {
18915
19082
  sm: "0 1px 3px rgba(15,23,42,0.14)",
18916
19083
  md: "0 6px 16px rgba(15,23,42,0.18)",
18917
19084
  lg: "0 16px 40px rgba(15,23,42,0.24)"
18918
- }, G = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, K = (e) => typeof e == "string" && e ? e : void 0, Kl = (e) => `${Math.round(e * 100) / 100}px`, ql = [
19085
+ }, K = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, q = (e) => typeof e == "string" && e ? e : void 0, ou = (e) => `${Math.round(e * 100) / 100}px`, su = [
18919
19086
  {
18920
19087
  name: "desktop",
18921
- k: fe.desktop / Ul,
19088
+ k: fe.desktop / ru,
18922
19089
  minFont: 0
18923
19090
  },
18924
19091
  {
18925
19092
  name: "tablet",
18926
- k: fe.tablet / Ul,
19093
+ k: fe.tablet / ru,
18927
19094
  minFont: 12
18928
19095
  },
18929
19096
  {
18930
19097
  name: "mobile",
18931
- k: fe.mobile / Ul,
19098
+ k: fe.mobile / ru,
18932
19099
  minFont: 11
18933
19100
  }
18934
19101
  ];
18935
- function Jl(e, t, n) {
19102
+ function cu(e, t, n) {
18936
19103
  let r = {};
18937
- return n && (e.x !== void 0 && (r.x = Math.round(e.x * t.k)), e.y !== void 0 && (r.y = Math.round(e.y * t.k))), e.width !== void 0 && (r.width = Kl(e.width * t.k), r.customWidth = r.width), e.height !== void 0 && (r.height = Kl(e.height * t.k)), e.minHeight !== void 0 && (r.minHeight = Kl(e.minHeight * t.k)), e.fontSize !== void 0 && (r.fontSize = Kl(Math.max(e.fontSize * t.k, t.minFont))), e.gap !== void 0 && (r.gap = Kl(e.gap * t.k)), r;
19104
+ return n && (e.x !== void 0 && (r.x = Math.round(e.x * t.k)), e.y !== void 0 && (r.y = Math.round(e.y * t.k))), e.width !== void 0 && (r.width = ou(e.width * t.k), r.customWidth = r.width), e.height !== void 0 && (r.height = ou(e.height * t.k)), e.minHeight !== void 0 && (r.minHeight = ou(e.minHeight * t.k)), e.fontSize !== void 0 && (r.fontSize = ou(Math.max(e.fontSize * t.k, t.minFont))), e.gap !== void 0 && (r.gap = ou(e.gap * t.k)), r;
18938
19105
  }
18939
- function Yl(e, t) {
19106
+ function lu(e, t) {
18940
19107
  let { nodes: n } = e, r = /* @__PURE__ */ new Set(), i = (e) => {
18941
- let t = {}, n = G(e.borderWidth);
18942
- n && n > 0 && (t.borderWidth = Kl(n), t.borderStyle = [
19108
+ let t = {}, n = K(e.borderWidth);
19109
+ n && n > 0 && (t.borderWidth = ou(n), t.borderStyle = [
18943
19110
  "solid",
18944
19111
  "dashed",
18945
19112
  "dotted"
18946
- ].includes(String(e.borderStyle)) ? e.borderStyle : "solid", t.borderColor = K(e.borderColor) ?? "#0f172a");
18947
- let r = G(e.borderRadius);
18948
- r !== void 0 && (t.borderRadius = Kl(r));
18949
- let i = Gl[String(e.boxShadowPreset)];
19113
+ ].includes(String(e.borderStyle)) ? e.borderStyle : "solid", t.borderColor = q(e.borderColor) ?? "#0f172a");
19114
+ let r = K(e.borderRadius);
19115
+ r !== void 0 && (t.borderRadius = ou(r));
19116
+ let i = au[String(e.boxShadowPreset)];
18950
19117
  return i && (t.boxShadow = i), t;
18951
19118
  }, a = (e, t, n) => {
18952
- let [r, i, a] = ql.map((n) => Jl(e, n, t)), o = (e, t) => Object.fromEntries(Object.entries(t).filter(([t, n]) => e[t] !== n));
19119
+ let [r, i, a] = su.map((n) => cu(e, n, t)), o = (e, t) => Object.fromEntries(Object.entries(t).filter(([t, n]) => e[t] !== n));
18953
19120
  return {
18954
19121
  styles: {
18955
19122
  ...n,
@@ -18961,11 +19128,11 @@ function Yl(e, t) {
18961
19128
  }
18962
19129
  };
18963
19130
  }, o = (e) => ({
18964
- x: G(e.x),
18965
- y: G(e.y),
18966
- width: G(e.width),
18967
- height: G(e.height),
18968
- fontSize: G(e.fontSize)
19131
+ x: K(e.x),
19132
+ y: K(e.y),
19133
+ width: K(e.width),
19134
+ height: K(e.height),
19135
+ fontSize: K(e.fontSize)
18969
19136
  }), s = (e) => {
18970
19137
  let t = e.id;
18971
19138
  for (; r.has(t);) t = `${t}-x`;
@@ -19004,7 +19171,7 @@ function Yl(e, t) {
19004
19171
  return {
19005
19172
  id: s(e),
19006
19173
  type: t,
19007
- name: K(e.props.name) ?? e.type,
19174
+ name: q(e.props.name) ?? e.type,
19008
19175
  ...c
19009
19176
  };
19010
19177
  };
@@ -19013,7 +19180,7 @@ function Yl(e, t) {
19013
19180
  let t = /^h[1-6]$/.test(String(r.htmlTag)) ? Number(String(r.htmlTag)[1]) : null;
19014
19181
  return {
19015
19182
  ...u(t ? "heading" : "paragraph", {
19016
- textColor: K(r.color),
19183
+ textColor: q(r.color),
19017
19184
  textAlign: [
19018
19185
  "left",
19019
19186
  "center",
@@ -19035,8 +19202,8 @@ function Yl(e, t) {
19035
19202
  };
19036
19203
  case "Button": return {
19037
19204
  ...u("button", {
19038
- backgroundColor: K(r.backgroundColor),
19039
- textColor: K(r.color),
19205
+ backgroundColor: q(r.backgroundColor),
19206
+ textColor: q(r.color),
19040
19207
  fontWeight: String(r.fontWeight ?? 600),
19041
19208
  display: "flex",
19042
19209
  alignItems: "center",
@@ -19050,7 +19217,7 @@ function Yl(e, t) {
19050
19217
  display: "flex",
19051
19218
  flexDirection: "row",
19052
19219
  layoutMode: "flow",
19053
- backgroundColor: K(r.backgroundColor),
19220
+ backgroundColor: q(r.backgroundColor),
19054
19221
  ...c ? {
19055
19222
  position: "absolute",
19056
19223
  x: 0,
@@ -19064,7 +19231,7 @@ function Yl(e, t) {
19064
19231
  width: void 0
19065
19232
  } : o.geo, f = a({
19066
19233
  ...d,
19067
- gap: G(r.gap)
19234
+ gap: K(r.gap)
19068
19235
  }, c ? !0 : o.free, {
19069
19236
  ...o.base,
19070
19237
  ...i(r),
@@ -19082,7 +19249,7 @@ function Yl(e, t) {
19082
19249
  ...u("video"),
19083
19250
  props: {
19084
19251
  url: String(e.props.url ?? ""),
19085
- poster: K(e.props.coverImage),
19252
+ poster: q(e.props.coverImage),
19086
19253
  ratio: "16:9"
19087
19254
  }
19088
19255
  } : {
@@ -19094,7 +19261,7 @@ function Yl(e, t) {
19094
19261
  };
19095
19262
  case "Menu": return {
19096
19263
  ...u("menu", {
19097
- textColor: K(r.color),
19264
+ textColor: q(r.color),
19098
19265
  fontSize: void 0
19099
19266
  }),
19100
19267
  props: {
@@ -19111,7 +19278,7 @@ function Yl(e, t) {
19111
19278
  }, u = (e, t) => {
19112
19279
  let n = t.filter((e) => e.type === "Input");
19113
19280
  if (!n.length) return null;
19114
- let r = n.slice().sort((e, t) => (G(e.styles.y) ?? 0) - (G(t.styles.y) ?? 0) || (G(e.styles.x) ?? 0) - (G(t.styles.x) ?? 0)), i = r.map((e) => o(e.styles)), c = Math.max(...i.map((e) => (e.y ?? 0) + (e.height ?? 0))), l = t.find((e) => e.type === "Button" && (G(e.styles.y) ?? 0) >= c - 6), u = [...i, ...l ? [o(l.styles)] : []], d = Math.min(...u.map((e) => e.x ?? 0)), f = Math.min(...u.map((e) => e.y ?? 0)), p = Math.max(...u.map((e) => (e.x ?? 0) + (e.width ?? 0))) - d, m = r[0], h = r.map((e, t) => ({
19281
+ let r = n.slice().sort((e, t) => (K(e.styles.y) ?? 0) - (K(t.styles.y) ?? 0) || (K(e.styles.x) ?? 0) - (K(t.styles.x) ?? 0)), i = r.map((e) => o(e.styles)), c = Math.max(...i.map((e) => (e.y ?? 0) + (e.height ?? 0))), l = t.find((e) => e.type === "Button" && (K(e.styles.y) ?? 0) >= c - 6), u = [...i, ...l ? [o(l.styles)] : []], d = Math.min(...u.map((e) => e.x ?? 0)), f = Math.min(...u.map((e) => e.y ?? 0)), p = Math.max(...u.map((e) => (e.x ?? 0) + (e.width ?? 0))) - d, m = r[0], h = r.map((e, t) => ({
19115
19282
  id: `${String(e.props.label ?? "field").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "field"}-${t + 1}`,
19116
19283
  label: String(e.props.label ?? "Field"),
19117
19284
  type: [
@@ -19120,7 +19287,7 @@ function Yl(e, t) {
19120
19287
  "tel",
19121
19288
  "textarea"
19122
19289
  ].includes(String(e.props.fieldType)) ? e.props.fieldType : "text",
19123
- placeholder: K(e.props.placeholder),
19290
+ placeholder: q(e.props.placeholder),
19124
19291
  required: !!e.props.required
19125
19292
  })), g = a({
19126
19293
  x: d,
@@ -19130,7 +19297,7 @@ function Yl(e, t) {
19130
19297
  position: "absolute",
19131
19298
  horizontalConstraint: "left",
19132
19299
  verticalConstraint: "top",
19133
- textColor: K(m.styles.color),
19300
+ textColor: q(m.styles.color),
19134
19301
  padding: "0px"
19135
19302
  });
19136
19303
  return {
@@ -19150,18 +19317,18 @@ function Yl(e, t) {
19150
19317
  }, d = e.pageOrder.map((e) => n[e]).filter((e) => !!e && e.type === "Section").map((e) => {
19151
19318
  let t = e.styles, r = e.children.map((e) => n[e]).filter(Boolean), i = u(e, r), o = r.filter((e) => !i?.consumed.has(e.id)).map((t) => l(t, e)).filter((e) => !!e);
19152
19319
  i && o.push(i.node);
19153
- let c = G(t.height) ?? 400, d = a({ minHeight: c }, !1, {
19320
+ let c = K(t.height) ?? 400, d = a({ minHeight: c }, !1, {
19154
19321
  layoutMode: "free",
19155
- backgroundColor: K(t.backgroundColor),
19322
+ backgroundColor: q(t.backgroundColor),
19156
19323
  ...t.pinned === "true" ? { pinned: !0 } : {},
19157
- backgroundImage: K(t.backgroundImage),
19324
+ backgroundImage: q(t.backgroundImage),
19158
19325
  backgroundSize: t.backgroundImage ? "cover" : void 0,
19159
19326
  backgroundPosition: t.backgroundImage ? "center" : void 0
19160
19327
  });
19161
19328
  return {
19162
19329
  id: s(e),
19163
19330
  type: "section",
19164
- name: K(e.props.name) ?? "Section",
19331
+ name: q(e.props.name) ?? "Section",
19165
19332
  ...d,
19166
19333
  children: o
19167
19334
  };
@@ -19185,7 +19352,7 @@ function Yl(e, t) {
19185
19352
  }
19186
19353
  //#endregion
19187
19354
  //#region src/v2/compile/sanitizeHtml.ts
19188
- var Xl = new Map(Object.entries({
19355
+ var uu = new Map(Object.entries({
19189
19356
  amp: "&",
19190
19357
  lt: "<",
19191
19358
  gt: ">",
@@ -19217,9 +19384,9 @@ var Xl = new Map(Object.entries({
19217
19384
  hyphen: "-",
19218
19385
  dash: "-"
19219
19386
  }).map(([e, t]) => [e.toLowerCase(), t]));
19220
- function Zl(e) {
19387
+ function du(e) {
19221
19388
  return e.replace(/&(?:#[xX]([0-9a-fA-F]{1,8})|#(\d{1,10})|([A-Za-z][A-Za-z0-9]{1,31}));?/g, (e, t, n, r) => {
19222
- if (r !== void 0) return Xl.get(r.toLowerCase()) ?? e;
19389
+ if (r !== void 0) return uu.get(r.toLowerCase()) ?? e;
19223
19390
  let i = t === void 0 ? parseInt(n, 10) : parseInt(t, 16);
19224
19391
  if (!Number.isFinite(i) || i <= 0 || i > 1114111) return "�";
19225
19392
  try {
@@ -19229,40 +19396,40 @@ function Zl(e) {
19229
19396
  }
19230
19397
  });
19231
19398
  }
19232
- var Ql = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), $l = /[\u0000-\u0020\u007f-\u009f\u200b-\u200f\u2028\u2029\ufeff]/g, eu = (e) => /^(\/(?!\/)|\.{0,2}\/|#|\?)/.test(e) || !/^[a-z][a-z0-9+.-]*:/i.test(e) && !e.startsWith("//");
19233
- function tu(e) {
19234
- let t = e.replace($l, "");
19235
- return !t || /^(https?|mailto|tel|sms):/i.test(t) || eu(t);
19399
+ var fu = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), pu = /[\u0000-\u0020\u007f-\u009f\u200b-\u200f\u2028\u2029\ufeff]/g, mu = (e) => /^(\/(?!\/)|\.{0,2}\/|#|\?)/.test(e) || !/^[a-z][a-z0-9+.-]*:/i.test(e) && !e.startsWith("//");
19400
+ function hu(e) {
19401
+ let t = e.replace(pu, "");
19402
+ return !t || /^(https?|mailto|tel|sms):/i.test(t) || mu(t);
19236
19403
  }
19237
- var nu = /^data:image\/(png|jpe?g|gif|webp|avif|svg\+xml)[;,]/i;
19238
- function ru(e) {
19239
- let t = e.replace($l, "");
19240
- return !t || nu.test(t) || /^https?:\/\//i.test(t) || /^(\/(?!\/)|\.{0,2}\/)/.test(t) || !/^[a-z][a-z0-9+.-]*:/i.test(t) && !t.startsWith("//");
19404
+ var gu = /^data:image\/(png|jpe?g|gif|webp|avif|svg\+xml)[;,]/i;
19405
+ function _u(e) {
19406
+ let t = e.replace(pu, "");
19407
+ return !t || gu.test(t) || /^https?:\/\//i.test(t) || /^(\/(?!\/)|\.{0,2}\/)/.test(t) || !/^[a-z][a-z0-9+.-]*:/i.test(t) && !t.startsWith("//");
19241
19408
  }
19242
- var iu = (e) => {
19243
- let t = e.replace($l, "");
19409
+ var vu = (e) => {
19410
+ let t = e.replace(pu, "");
19244
19411
  return !t || /^https?:\/\//i.test(t) || /^(\/(?!\/)|\.{0,2}\/)/.test(t) || !/^[a-z][a-z0-9+.-]*:/i.test(t) && !t.startsWith("//");
19245
19412
  };
19246
- function au(e) {
19413
+ function yu(e) {
19247
19414
  let t;
19248
19415
  try {
19249
- t = new URL(e.replace($l, ""));
19416
+ t = new URL(e.replace(pu, ""));
19250
19417
  } catch {
19251
19418
  return !1;
19252
19419
  }
19253
19420
  return t.protocol !== "https:" || t.username || t.password || t.port ? !1 : t.hostname === "www.youtube-nocookie.com" || t.hostname === "youtube-nocookie.com" ? /^\/embed\/[\w-]{6,20}\/?$/.test(t.pathname) : t.hostname === "player.vimeo.com" && /^\/video\/\d{6,}\/?$/.test(t.pathname);
19254
19421
  }
19255
- function ou(e) {
19422
+ function bu(e) {
19256
19423
  return e.replace(/\/\*[\s\S]*?(?:\*\/|$)/g, "").replace(/\\([0-9a-fA-F]{1,6})[ \t\n\r\f]?/g, (e, t) => {
19257
19424
  let n = parseInt(t, 16);
19258
19425
  return n > 0 && n <= 1114111 ? String.fromCodePoint(n) : "�";
19259
19426
  }).replace(/\\([\s\S])/g, "$1").toLowerCase();
19260
19427
  }
19261
- var su = /^data:(?:font\/(?:woff2?|ttf|otf|sfnt)|application\/(?:font-woff2?|x-font-(?:woff2?|ttf|otf|truetype|opentype)|octet-stream));base64,[a-z0-9+/=]+$/i;
19262
- function cu(e, t) {
19263
- let n = e.replace($l, "");
19428
+ var xu = /^data:(?:font\/(?:woff2?|ttf|otf|sfnt)|application\/(?:font-woff2?|x-font-(?:woff2?|ttf|otf|truetype|opentype)|octet-stream));base64,[a-z0-9+/=]+$/i;
19429
+ function Su(e, t) {
19430
+ let n = e.replace(pu, "");
19264
19431
  if (!n) return !1;
19265
- if (su.test(n)) return !0;
19432
+ if (xu.test(n)) return !0;
19266
19433
  if (/^https:\/\//i.test(n)) {
19267
19434
  let e;
19268
19435
  try {
@@ -19274,19 +19441,19 @@ function cu(e, t) {
19274
19441
  }
19275
19442
  return /^\/(?!\/)/.test(n);
19276
19443
  }
19277
- function lu(e, t) {
19444
+ function Cu(e, t) {
19278
19445
  let n = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/g, r;
19279
19446
  for (; r = n.exec(e);) {
19280
19447
  let e = (r[1] ?? r[2] ?? r[3] ?? "").trim();
19281
- if (!e.startsWith("#") && (t ? !cu(e, t.fontOrigins) : !ru(e))) return !1;
19448
+ if (!e.startsWith("#") && (t ? !Su(e, t.fontOrigins) : !_u(e))) return !1;
19282
19449
  }
19283
19450
  return (e.match(/url\(/g) ?? []).length === (e.match(n) ?? []).length;
19284
19451
  }
19285
- function uu(e, t) {
19286
- let n = ou(e).replace(/\s+/g, " ");
19287
- return !/expression\s*\(|javascript:|vbscript:|livescript:|(?:^|[^a-z-])behavior\s*:|-moz-binding|@import|image-set\s*\(|\bsrc\s*\(|<\/?script|<!--/.test(n) && lu(n, t);
19452
+ function wu(e, t) {
19453
+ let n = bu(e).replace(/\s+/g, " ");
19454
+ return !/expression\s*\(|javascript:|vbscript:|livescript:|(?:^|[^a-z-])behavior\s*:|-moz-binding|@import|image-set\s*\(|\bsrc\s*\(|<\/?script|<!--/.test(n) && Cu(n, t);
19288
19455
  }
19289
- var du = (e, t) => !e.trim().startsWith("@") && e.includes(":") && !e.includes("<") && uu(e, t), fu = /* @__PURE__ */ new Set([
19456
+ var Tu = (e, t) => !e.trim().startsWith("@") && e.includes(":") && !e.includes("<") && wu(e, t), Eu = /* @__PURE__ */ new Set([
19290
19457
  "media",
19291
19458
  "container",
19292
19459
  "supports",
@@ -19297,7 +19464,7 @@ var du = (e, t) => !e.trim().startsWith("@") && e.includes(":") && !e.includes("
19297
19464
  "page",
19298
19465
  "property"
19299
19466
  ]);
19300
- function pu(e, t = {}) {
19467
+ function Du(e, t = {}) {
19301
19468
  let n = (t.fontOrigins ?? []).map((e) => e.trim().replace(/\/+$/, "").toLowerCase()), r = 0, i = e.length, a = (t) => {
19302
19469
  let n = e[t];
19303
19470
  if (n === "\"" || n === "'") {
@@ -19338,22 +19505,22 @@ function pu(e, t = {}) {
19338
19505
  r += 1;
19339
19506
  }
19340
19507
  let f = e.slice(l, Math.min(r, i));
19341
- if (d === ";") r += 1, du(f, s) ? c += `${f};` : /^\s*$/.test(f) && (c += f + ";");
19508
+ if (d === ";") r += 1, Tu(f, s) ? c += `${f};` : /^\s*$/.test(f) && (c += f + ";");
19342
19509
  else if (d === "{") {
19343
19510
  r += 1;
19344
- let t = ou(f).trim(), i = r, a = o(!0, /^@font-face\b/.test(t) ? { fontOrigins: n } : void 0), s = e.slice(i, r).trim() !== "";
19511
+ let t = bu(f).trim(), i = r, a = o(!0, /^@font-face\b/.test(t) ? { fontOrigins: n } : void 0), s = e.slice(i, r).trim() !== "";
19345
19512
  if (e[r] === "}" && (r += 1), s && a.trim() === "") continue;
19346
19513
  if (t.startsWith("@")) {
19347
19514
  let e = /^@([a-z-]+)/.exec(t)?.[1] ?? "";
19348
- fu.has(e) && uu(f) && (c += `${f}{${a}}`);
19349
- } else uu(f) && !/[<]/.test(f) && (c += `${f}{${a}}`);
19350
- } else (/^\s*$/.test(f) || du(f, s)) && (c += f);
19515
+ Eu.has(e) && wu(f) && (c += `${f}{${a}}`);
19516
+ } else wu(f) && !/[<]/.test(f) && (c += `${f}{${a}}`);
19517
+ } else (/^\s*$/.test(f) || Tu(f, s)) && (c += f);
19351
19518
  }
19352
19519
  return c;
19353
19520
  };
19354
19521
  return o(!1);
19355
19522
  }
19356
- var mu = /* @__PURE__ */ new Set([
19523
+ var Ou = /* @__PURE__ */ new Set([
19357
19524
  "script",
19358
19525
  "style",
19359
19526
  "textarea",
@@ -19364,8 +19531,8 @@ var mu = /* @__PURE__ */ new Set([
19364
19531
  "noframes",
19365
19532
  "noscript",
19366
19533
  "plaintext"
19367
- ]), hu = (e, t) => Object.prototype.hasOwnProperty.call(e, t), gu = (e) => e === " " || e === " " || e === "\n" || e === "\r" || e === "\f", _u = (e) => !!e && /[A-Za-z]/.test(e);
19368
- function vu(e) {
19534
+ ]), ku = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Au = (e) => e === " " || e === " " || e === "\n" || e === "\r" || e === "\f", ju = (e) => !!e && /[A-Za-z]/.test(e);
19535
+ function Mu(e) {
19369
19536
  let t = [], n = e.length, r = 0, i = "", a = () => {
19370
19537
  i &&= (t.push({
19371
19538
  k: "text",
@@ -19397,10 +19564,10 @@ function vu(e) {
19397
19564
  continue;
19398
19565
  }
19399
19566
  if (o === "/") {
19400
- if (_u(e[r + 2])) {
19567
+ if (ju(e[r + 2])) {
19401
19568
  a();
19402
19569
  let i = r + 2;
19403
- for (; i < n && !gu(e[i]) && e[i] !== "/" && e[i] !== ">";) i += 1;
19570
+ for (; i < n && !Au(e[i]) && e[i] !== "/" && e[i] !== ">";) i += 1;
19404
19571
  let o = e.slice(r + 2, i).toLowerCase(), s = e.indexOf(">", i);
19405
19572
  t.push({
19406
19573
  k: "end",
@@ -19413,27 +19580,27 @@ function vu(e) {
19413
19580
  }
19414
19581
  continue;
19415
19582
  }
19416
- if (!_u(o)) {
19583
+ if (!ju(o)) {
19417
19584
  i += "&lt;", r += 1;
19418
19585
  continue;
19419
19586
  }
19420
19587
  let s = r + 1;
19421
- for (; s < n && !gu(e[s]) && e[s] !== "/" && e[s] !== ">";) s += 1;
19588
+ for (; s < n && !Au(e[s]) && e[s] !== "/" && e[s] !== ">";) s += 1;
19422
19589
  let c = e.slice(r + 1, s).toLowerCase(), l = [], u = !1, d = !1;
19423
19590
  for (; s < n;) {
19424
- for (; s < n && (gu(e[s]) || e[s] === "/");) e[s] === "/" && e[s + 1] === ">" && (u = !0), s += 1;
19591
+ for (; s < n && (Au(e[s]) || e[s] === "/");) e[s] === "/" && e[s + 1] === ">" && (u = !0), s += 1;
19425
19592
  if (e[s] === ">") {
19426
19593
  d = !0, s += 1;
19427
19594
  break;
19428
19595
  }
19429
19596
  if (s >= n) break;
19430
19597
  let t = s;
19431
- for (s += 1; s < n && !gu(e[s]) && e[s] !== "/" && e[s] !== ">" && e[s] !== "=";) s += 1;
19598
+ for (s += 1; s < n && !Au(e[s]) && e[s] !== "/" && e[s] !== ">" && e[s] !== "=";) s += 1;
19432
19599
  let r = e.slice(t, s).toLowerCase();
19433
- for (; s < n && gu(e[s]);) s += 1;
19600
+ for (; s < n && Au(e[s]);) s += 1;
19434
19601
  let i = null;
19435
19602
  if (e[s] === "=") {
19436
- for (s += 1; s < n && gu(e[s]);) s += 1;
19603
+ for (s += 1; s < n && Au(e[s]);) s += 1;
19437
19604
  let t = e[s];
19438
19605
  if (t === "\"" || t === "'") {
19439
19606
  let r = e.indexOf(t, s + 1);
@@ -19444,7 +19611,7 @@ function vu(e) {
19444
19611
  i = e.slice(s + 1, r), s = r + 1;
19445
19612
  } else {
19446
19613
  let t = s;
19447
- for (; s < n && !gu(e[s]) && e[s] !== ">";) s += 1;
19614
+ for (; s < n && !Au(e[s]) && e[s] !== ">";) s += 1;
19448
19615
  i = e.slice(t, s);
19449
19616
  }
19450
19617
  }
@@ -19458,7 +19625,7 @@ function vu(e) {
19458
19625
  r = n;
19459
19626
  break;
19460
19627
  }
19461
- if (r = s, mu.has(c)) {
19628
+ if (r = s, Ou.has(c)) {
19462
19629
  if (c === "plaintext") {
19463
19630
  t.push({
19464
19631
  k: "raw",
@@ -19490,7 +19657,7 @@ function vu(e) {
19490
19657
  }
19491
19658
  return a(), t;
19492
19659
  }
19493
- var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.section.article.aside.header.footer.main.nav.h1.h2.h3.h4.h5.h6.p.a.button.img.hr.br.wbr.ul.ol.li.figure.figcaption.details.summary.table.thead.tbody.tfoot.tr.th.td.caption.colgroup.col.form.label.input.textarea.select.option.optgroup.fieldset.legend.video.strong.em.b.i.u.s.small.sub.sup.code.pre.blockquote.mark.abbr.time.dl.dt.dd.address.cite.q.span".split(".")), bu = /* @__PURE__ */ new Set([
19660
+ var Nu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.section.article.aside.header.footer.main.nav.h1.h2.h3.h4.h5.h6.p.a.button.img.hr.br.wbr.ul.ol.li.figure.figcaption.details.summary.table.thead.tbody.tfoot.tr.th.td.caption.colgroup.col.form.label.input.textarea.select.option.optgroup.fieldset.legend.video.strong.em.b.i.u.s.small.sub.sup.code.pre.blockquote.mark.abbr.time.dl.dt.dd.address.cite.q.span".split(".")), Pu = /* @__PURE__ */ new Set([
19494
19661
  "img",
19495
19662
  "hr",
19496
19663
  "br",
@@ -19499,7 +19666,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19499
19666
  "col",
19500
19667
  "meta",
19501
19668
  "link"
19502
- ]), xu = /* @__PURE__ */ new Set([
19669
+ ]), Fu = /* @__PURE__ */ new Set([
19503
19670
  "svg",
19504
19671
  "g",
19505
19672
  "path",
@@ -19509,7 +19676,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19509
19676
  "polyline",
19510
19677
  "polygon",
19511
19678
  "ellipse"
19512
- ]), Su = /* @__PURE__ */ new Set([
19679
+ ]), Iu = /* @__PURE__ */ new Set([
19513
19680
  "open",
19514
19681
  "required",
19515
19682
  "disabled",
@@ -19525,7 +19692,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19525
19692
  "allowfullscreen",
19526
19693
  "hidden",
19527
19694
  "novalidate"
19528
- ]), Cu = {
19695
+ ]), Lu = {
19529
19696
  id: /^[\w:.[\]-]{1,200}$/,
19530
19697
  role: /^[a-z-]{1,30}$/,
19531
19698
  tabindex: /^-?\d{1,3}$/,
@@ -19533,11 +19700,11 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19533
19700
  dir: /^(ltr|rtl|auto)$/i,
19534
19701
  draggable: /^(true|false)$/,
19535
19702
  translate: /^(yes|no)$/
19536
- }, wu = /* @__PURE__ */ new Set([
19703
+ }, Ru = /* @__PURE__ */ new Set([
19537
19704
  "class",
19538
19705
  "title",
19539
19706
  "hidden"
19540
- ]), q = /^\d{1,5}(?:\.\d+)?(?:px|%|em|rem)?$/, Tu = /^[\w:.[\]-]{1,200}$/, Eu = /* @__PURE__ */ new Set([
19707
+ ]), J = /^\d{1,5}(?:\.\d+)?(?:px|%|em|rem)?$/, zu = /^[\w:.[\]-]{1,200}$/, Bu = /* @__PURE__ */ new Set([
19541
19708
  "text",
19542
19709
  "email",
19543
19710
  "tel",
@@ -19556,7 +19723,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19556
19723
  "file",
19557
19724
  "color",
19558
19725
  "range"
19559
- ]), Du = /^(#[0-9a-f]{3,8}|[a-z]{3,20}|rgba?\(\s*[\d.\s,%]+\))$/i, Ou = {
19726
+ ]), Vu = /^(#[0-9a-f]{3,8}|[a-z]{3,20}|rgba?\(\s*[\d.\s,%]+\))$/i, Hu = {
19560
19727
  a: {
19561
19728
  href: "href",
19562
19729
  target: /^(_blank|_self)$/,
@@ -19567,8 +19734,8 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19567
19734
  alt: "plain",
19568
19735
  loading: /^(lazy|eager)$/,
19569
19736
  decoding: /^(async|sync|auto)$/,
19570
- width: q,
19571
- height: q
19737
+ width: J,
19738
+ height: J
19572
19739
  },
19573
19740
  video: {
19574
19741
  src: "media",
@@ -19579,13 +19746,13 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19579
19746
  loop: "bool",
19580
19747
  autoplay: "bool",
19581
19748
  muted: "bool",
19582
- width: q,
19583
- height: q
19749
+ width: J,
19750
+ height: J
19584
19751
  },
19585
19752
  button: {
19586
19753
  type: /^(submit|button|reset)$/,
19587
19754
  disabled: "bool",
19588
- name: Tu,
19755
+ name: zu,
19589
19756
  value: "plain"
19590
19757
  },
19591
19758
  form: {
@@ -19596,7 +19763,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19596
19763
  enctype: /^(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)$/
19597
19764
  },
19598
19765
  input: {
19599
- name: Tu,
19766
+ name: zu,
19600
19767
  value: "plain",
19601
19768
  placeholder: "plain",
19602
19769
  required: "bool",
@@ -19614,7 +19781,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19614
19781
  size: /^\d{1,3}$/
19615
19782
  },
19616
19783
  textarea: {
19617
- name: Tu,
19784
+ name: zu,
19618
19785
  rows: /^\d{1,3}$/,
19619
19786
  cols: /^\d{1,3}$/,
19620
19787
  placeholder: "plain",
@@ -19626,7 +19793,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19626
19793
  autocomplete: /^[\w\s-]{1,60}$/
19627
19794
  },
19628
19795
  select: {
19629
- name: Tu,
19796
+ name: zu,
19630
19797
  required: "bool",
19631
19798
  multiple: "bool",
19632
19799
  disabled: "bool",
@@ -19642,121 +19809,121 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19642
19809
  label: "plain",
19643
19810
  disabled: "bool"
19644
19811
  },
19645
- label: { for: Tu },
19812
+ label: { for: zu },
19646
19813
  details: {
19647
19814
  open: "bool",
19648
- name: Tu
19815
+ name: zu
19649
19816
  },
19650
19817
  table: {
19651
- width: q,
19652
- height: q,
19818
+ width: J,
19819
+ height: J,
19653
19820
  align: /^(left|center|right)$/,
19654
19821
  cellpadding: /^\d{1,3}$/,
19655
19822
  cellspacing: /^\d{1,3}$/,
19656
19823
  border: /^\d{1,2}$/,
19657
- bgcolor: Du
19824
+ bgcolor: Vu
19658
19825
  },
19659
19826
  th: {
19660
19827
  scope: /^(col|row|colgroup|rowgroup)$/,
19661
19828
  colspan: /^\d{1,3}$/,
19662
19829
  rowspan: /^\d{1,3}$/,
19663
- width: q,
19664
- height: q,
19830
+ width: J,
19831
+ height: J,
19665
19832
  align: /^(left|center|right)$/,
19666
19833
  valign: /^(top|middle|bottom|baseline)$/,
19667
- bgcolor: Du
19834
+ bgcolor: Vu
19668
19835
  },
19669
19836
  td: {
19670
19837
  colspan: /^\d{1,3}$/,
19671
19838
  rowspan: /^\d{1,3}$/,
19672
- width: q,
19673
- height: q,
19839
+ width: J,
19840
+ height: J,
19674
19841
  align: /^(left|center|right)$/,
19675
19842
  valign: /^(top|middle|bottom|baseline)$/,
19676
- bgcolor: Du
19843
+ bgcolor: Vu
19677
19844
  },
19678
19845
  col: { span: /^\d{1,3}$/ },
19679
19846
  time: { datetime: "plain" },
19680
19847
  html: {},
19681
19848
  body: {}
19682
- }, ku = /* @__PURE__ */ new Set(/* @__PURE__ */ "viewbox.fill.stroke.stroke-width.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-dasharray.stroke-dashoffset.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.d.cx.cy.r.rx.ry.x.y.x1.y1.x2.y2.points.width.height.transform.xmlns.preserveaspectratio.focusable.vector-effect".split(".")), Au = {
19849
+ }, Uu = /* @__PURE__ */ new Set(/* @__PURE__ */ "viewbox.fill.stroke.stroke-width.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-dasharray.stroke-dashoffset.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.d.cx.cy.r.rx.ry.x.y.x1.y1.x2.y2.points.width.height.transform.xmlns.preserveaspectratio.focusable.vector-effect".split(".")), Wu = {
19683
19850
  viewbox: "viewBox",
19684
19851
  preserveaspectratio: "preserveAspectRatio"
19685
- }, ju = /^[\w\s.,#%()+\-:/]*$/, Mu = /* @__PURE__ */ new Set([
19852
+ }, Gu = /^[\w\s.,#%()+\-:/]*$/, Ku = /* @__PURE__ */ new Set([
19686
19853
  "allow-popups",
19687
19854
  "allow-popups-to-escape-sandbox",
19688
19855
  "allow-forms",
19689
19856
  "allow-scripts",
19690
19857
  "allow-presentation"
19691
- ]), Nu = /^[\w\s;*-]{0,200}$/, Pu = `(${fc})(document);`.replace(/<\/script/gi, "<\\/script");
19692
- function Fu(e, t) {
19693
- let n = e.raw, r = n === null ? "" : Zl(n), i = n === null ? "" : `="${n.replace(/"/g, "&quot;")}"`;
19694
- return t === "bool" ? n === null || n === "" || n.toLowerCase() === e.name ? n === null ? "" : i : null : t === "plain" ? i : t === "href" ? tu(r) ? i : e.name === "href" ? ((e) => `="${Ql(e)}"`)("#") : null : t === "image" ? ru(r) ? i : null : t === "media" ? iu(r) ? i : null : t.test(r) ? i : null;
19858
+ ]), qu = /^[\w\s;*-]{0,200}$/, Ju = `(${Ec})(document);`.replace(/<\/script/gi, "<\\/script");
19859
+ function Yu(e, t) {
19860
+ let n = e.raw, r = n === null ? "" : du(n), i = n === null ? "" : `="${n.replace(/"/g, "&quot;")}"`;
19861
+ return t === "bool" ? n === null || n === "" || n.toLowerCase() === e.name ? n === null ? "" : i : null : t === "plain" ? i : t === "href" ? hu(r) ? i : e.name === "href" ? ((e) => `="${fu(e)}"`)("#") : null : t === "image" ? _u(r) ? i : null : t === "media" ? vu(r) ? i : null : t.test(r) ? i : null;
19695
19862
  }
19696
- function Iu(e) {
19863
+ function Xu(e) {
19697
19864
  if (e.raw === null) return null;
19698
- let t = Zl(e.raw), n = pu(t);
19699
- return n === t ? `="${e.raw.replace(/"/g, "&quot;")}"` : n.trim() ? `="${Ql(n)}"` : null;
19865
+ let t = du(e.raw), n = Du(t);
19866
+ return n === t ? `="${e.raw.replace(/"/g, "&quot;")}"` : n.trim() ? `="${fu(n)}"` : null;
19700
19867
  }
19701
- function Lu(e, t, n) {
19702
- let r = "", i = hu(Ou, e) ? Ou[e] : {};
19868
+ function Zu(e, t, n) {
19869
+ let r = "", i = ku(Hu, e) ? Hu[e] : {};
19703
19870
  for (let e of t) {
19704
19871
  let t = e.name;
19705
19872
  if (!/^[a-z][a-z0-9:_.-]*$/.test(t) || t.startsWith("on")) continue;
19706
19873
  let a = null;
19707
- if (t === "style") a = Iu(e);
19874
+ if (t === "style") a = Xu(e);
19708
19875
  else if (n) {
19709
- if (ku.has(t) || t === "class" || /^aria-[a-z-]+$/.test(t) || t === "role" || t === "id") {
19710
- let n = e.raw === null ? "" : Zl(e.raw);
19711
- a = t === "class" || t === "id" || t === "role" ? Fu(e, hu(Cu, t) ? Cu[t] : "plain") : ju.test(n) && !/javascript:|data:/i.test(n) ? e.raw === null ? "" : `="${e.raw.replace(/"/g, "&quot;")}"` : null;
19876
+ if (Uu.has(t) || t === "class" || /^aria-[a-z-]+$/.test(t) || t === "role" || t === "id") {
19877
+ let n = e.raw === null ? "" : du(e.raw);
19878
+ a = t === "class" || t === "id" || t === "role" ? Yu(e, ku(Lu, t) ? Lu[t] : "plain") : Gu.test(n) && !/javascript:|data:/i.test(n) ? e.raw === null ? "" : `="${e.raw.replace(/"/g, "&quot;")}"` : null;
19712
19879
  }
19713
- } else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(t) || /^aria-[a-z-]+$/.test(t) ? a = e.raw === null ? "" : `="${e.raw.replace(/"/g, "&quot;")}"` : hu(i, t) ? a = Fu(e, i[t]) : hu(Cu, t) ? a = Fu(e, Cu[t]) : wu.has(t) && (a = t === "hidden" ? Fu(e, "bool") : Fu(e, "plain"));
19880
+ } else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(t) || /^aria-[a-z-]+$/.test(t) ? a = e.raw === null ? "" : `="${e.raw.replace(/"/g, "&quot;")}"` : ku(i, t) ? a = Yu(e, i[t]) : ku(Lu, t) ? a = Yu(e, Lu[t]) : Ru.has(t) && (a = t === "hidden" ? Yu(e, "bool") : Yu(e, "plain"));
19714
19881
  if (a === null) continue;
19715
19882
  let o = /^data-(plx|plexo)-/.test(t) && e.written && e.written.toLowerCase() === t ? e.written : t;
19716
- r += ` ${/^data-/.test(t) ? o : n && hu(Au, t) ? Au[t] : t}${Su.has(t) && a === "" ? "" : a}`;
19883
+ r += ` ${/^data-/.test(t) ? o : n && ku(Wu, t) ? Wu[t] : t}${Iu.has(t) && a === "" ? "" : a}`;
19717
19884
  }
19718
19885
  return r;
19719
19886
  }
19720
- function Ru(e, t) {
19887
+ function Qu(e, t) {
19721
19888
  if (e === "input") {
19722
19889
  let e = "";
19723
19890
  for (let n of t) if (n.name === "type") {
19724
- let t = n.raw === null ? "text" : Zl(n.raw).trim().toLowerCase();
19725
- e += ` type="${Eu.has(t) ? Ql(t) : "text"}"`;
19726
- } else e += Lu("input", [n], !1);
19891
+ let t = n.raw === null ? "text" : du(n.raw).trim().toLowerCase();
19892
+ e += ` type="${Bu.has(t) ? fu(t) : "text"}"`;
19893
+ } else e += Zu("input", [n], !1);
19727
19894
  return e;
19728
19895
  }
19729
- return Lu(e, t, !1);
19896
+ return Zu(e, t, !1);
19730
19897
  }
19731
- function zu(e, t) {
19898
+ function $u(e, t) {
19732
19899
  let n = (t) => e.find((e) => e.name === t), r = n("src"), i = n("srcdoc"), a = () => {
19733
19900
  let t = "";
19734
19901
  for (let n of e) {
19735
- let e = n.raw === null ? "" : Zl(n.raw);
19902
+ let e = n.raw === null ? "" : du(n.raw);
19736
19903
  if (n.name === "title" || n.name === "loading" || n.name === "referrerpolicy" || n.name === "allowfullscreen") {
19737
- let e = Fu(n, n.name === "loading" ? /^(lazy|eager)$/ : n.name === "referrerpolicy" ? /^[a-z-]{1,40}$/ : n.name === "allowfullscreen" ? "bool" : "plain");
19904
+ let e = Yu(n, n.name === "loading" ? /^(lazy|eager)$/ : n.name === "referrerpolicy" ? /^[a-z-]{1,40}$/ : n.name === "allowfullscreen" ? "bool" : "plain");
19738
19905
  e !== null && (t += ` ${n.name}${e}`);
19739
- } else if (n.name === "allow" && Nu.test(e)) t += ` allow${Fu(n, "plain")}`;
19740
- else if (n.name === "width" || n.name === "height") q.test(e) && (t += ` ${n.name}="${Ql(e)}"`);
19741
- else if (n.name === "class") t += ` class${Fu(n, "plain")}`;
19906
+ } else if (n.name === "allow" && qu.test(e)) t += ` allow${Yu(n, "plain")}`;
19907
+ else if (n.name === "width" || n.name === "height") J.test(e) && (t += ` ${n.name}="${fu(e)}"`);
19908
+ else if (n.name === "class") t += ` class${Yu(n, "plain")}`;
19742
19909
  else if (n.name === "style") {
19743
- let e = Iu(n);
19910
+ let e = Xu(n);
19744
19911
  e !== null && (t += ` style${e}`);
19745
19912
  } else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(n.name) && (t += ` ${n.name}${n.raw === null ? "" : `="${n.raw.replace(/"/g, "&quot;")}"`}`);
19746
19913
  }
19747
19914
  return t;
19748
19915
  };
19749
- if (r && r.raw !== null && au(Zl(r.raw))) return ` src="${r.raw.replace(/"/g, "&quot;")}"${a()}`;
19916
+ if (r && r.raw !== null && yu(du(r.raw))) return ` src="${r.raw.replace(/"/g, "&quot;")}"${a()}`;
19750
19917
  let o = n("sandbox");
19751
19918
  if (i && o) {
19752
- let n = (o.raw === null ? "" : Zl(o.raw)).split(/\s+/).filter(Boolean), r = n.filter((e) => Mu.has(e.toLowerCase()) && (t.allowEmbedScripts !== !1 || e.toLowerCase() !== "allow-scripts")).map((e) => e.toLowerCase()).join(" "), i = n.join(" "), s = "";
19753
- for (let t of e) t.name === "srcdoc" ? s += ` srcdoc="${(t.raw ?? "").replace(/"/g, "&quot;")}"` : t.name === "sandbox" && (s += ` sandbox="${r === i ? (t.raw ?? "").replace(/"/g, "&quot;") : Ql(r)}"`);
19919
+ let n = (o.raw === null ? "" : du(o.raw)).split(/\s+/).filter(Boolean), r = n.filter((e) => Ku.has(e.toLowerCase()) && (t.allowEmbedScripts !== !1 || e.toLowerCase() !== "allow-scripts")).map((e) => e.toLowerCase()).join(" "), i = n.join(" "), s = "";
19920
+ for (let t of e) t.name === "srcdoc" ? s += ` srcdoc="${(t.raw ?? "").replace(/"/g, "&quot;")}"` : t.name === "sandbox" && (s += ` sandbox="${r === i ? (t.raw ?? "").replace(/"/g, "&quot;") : fu(r)}"`);
19754
19921
  return `${s}${a()}`;
19755
19922
  }
19756
19923
  return null;
19757
19924
  }
19758
- function Bu(e, t = {}) {
19759
- let n = /* @__PURE__ */ new Set([Pu, ...t.allowedScripts ?? []]), r = vu(typeof e == "string" ? e : ""), i = "", a = 0;
19925
+ function ed(e, t = {}) {
19926
+ let n = /* @__PURE__ */ new Set([Ju, ...t.allowedScripts ?? []]), r = Mu(typeof e == "string" ? e : ""), i = "", a = 0;
19760
19927
  for (let e of r) switch (e.k) {
19761
19928
  case "text":
19762
19929
  i += e.v;
@@ -19767,43 +19934,43 @@ function Bu(e, t = {}) {
19767
19934
  case "raw":
19768
19935
  if (a > 0) break;
19769
19936
  if (e.name === "script") e.attrs.length === 0 && n.has(e.content) && (i += `<script>${e.content}<\/script>`);
19770
- else if (e.name === "style") i += `<style>${pu(e.content, t)}</style>`;
19771
- else if (e.name === "textarea") i += `<textarea${Lu("textarea", e.attrs, !1)}>${e.content.replace(/</g, "&lt;")}</textarea>`;
19937
+ else if (e.name === "style") i += `<style>${Du(e.content, t)}</style>`;
19938
+ else if (e.name === "textarea") i += `<textarea${Zu("textarea", e.attrs, !1)}>${e.content.replace(/</g, "&lt;")}</textarea>`;
19772
19939
  else if (e.name === "title") i += `<title>${e.content.replace(/</g, "&lt;")}</title>`;
19773
19940
  else if (e.name === "iframe") {
19774
- let n = zu(e.attrs, t);
19941
+ let n = $u(e.attrs, t);
19775
19942
  n !== null && (i += `<iframe${n}></iframe>`);
19776
19943
  }
19777
19944
  break;
19778
19945
  case "start": {
19779
19946
  let { name: t } = e;
19780
19947
  if (t === "svg") {
19781
- i += `<svg${Lu("svg", e.attrs, !0)}${e.selfClose ? "/" : ""}>`, e.selfClose || (a += 1);
19948
+ i += `<svg${Zu("svg", e.attrs, !0)}${e.selfClose ? "/" : ""}>`, e.selfClose || (a += 1);
19782
19949
  break;
19783
19950
  }
19784
19951
  if (a > 0) {
19785
- xu.has(t) && (i += `<${t}${Lu(t, e.attrs, !0)}${e.selfClose ? "/" : ""}>`);
19952
+ Fu.has(t) && (i += `<${t}${Zu(t, e.attrs, !0)}${e.selfClose ? "/" : ""}>`);
19786
19953
  break;
19787
19954
  }
19788
- if (yu.has(t)) i += `<${t}${Ru(t, e.attrs)}>`;
19955
+ if (Nu.has(t)) i += `<${t}${Qu(t, e.attrs)}>`;
19789
19956
  else if (t === "meta") {
19790
19957
  let t = (t) => e.attrs.find((e) => e.name === t), n = t("charset"), r = t("name"), a = t("content");
19791
19958
  n && n.raw !== null && /^utf-8$/i.test(n.raw) ? i += `<meta charset="${n.raw}">` : r && r.raw?.toLowerCase() === "viewport" && a && a.raw !== null && /^[\w=,.\s-]{1,120}$/.test(a.raw) && (i += `<meta name="viewport" content="${a.raw}">`);
19792
19959
  } else if (t === "link") {
19793
19960
  let t = (t) => e.attrs.find((e) => e.name === t), n = t("rel"), r = t("href"), a = "";
19794
19961
  try {
19795
- a = r && r.raw !== null ? new URL(Zl(r.raw)).hostname : "";
19962
+ a = r && r.raw !== null ? new URL(du(r.raw)).hostname : "";
19796
19963
  } catch {
19797
19964
  a = "";
19798
19965
  }
19799
- let o = r && r.raw !== null && /^https:\/\//i.test(Zl(r.raw).trim());
19966
+ let o = r && r.raw !== null && /^https:\/\//i.test(du(r.raw).trim());
19800
19967
  n && n.raw !== null && /^(stylesheet|preconnect|dns-prefetch)$/i.test(n.raw) && o && (a === "fonts.googleapis.com" || a === "fonts.gstatic.com") && (i += `<link rel="${n.raw.toLowerCase()}" href="${r.raw.replace(/"/g, "&quot;")}"${t("crossorigin") ? " crossorigin" : ""}>`);
19801
19968
  }
19802
19969
  break;
19803
19970
  }
19804
19971
  case "end": {
19805
19972
  let { name: t } = e;
19806
- t === "svg" ? a > 0 && (--a, i += "</svg>") : a > 0 ? xu.has(t) && (i += `</${t}>`) : yu.has(t) && !bu.has(t) && (i += `</${t}>`);
19973
+ t === "svg" ? a > 0 && (--a, i += "</svg>") : a > 0 ? Fu.has(t) && (i += `</${t}>`) : Nu.has(t) && !Pu.has(t) && (i += `</${t}>`);
19807
19974
  break;
19808
19975
  }
19809
19976
  }
@@ -19812,7 +19979,7 @@ function Bu(e, t = {}) {
19812
19979
  }
19813
19980
  //#endregion
19814
19981
  //#region src/v2/compile/schema.ts
19815
- var Vu = 5e3, Hu = 40, Uu = /* @__PURE__ */ "page.section.container.columns.column.heading.paragraph.button.image.badge.divider.spacer.card.icon.carousel.video.social.menu.html.table.timer.form.accordion.blogTitle.blogContent.blogFeaturedImage.blogDate.blogAuthor.blogCategories.blogComments.blogPostList.shopGrid.product.booking.cart.checkout.orderConfirmation.orderTracking.signupForm".split("."), Wu = [
19982
+ var td = 5e3, nd = 40, rd = /* @__PURE__ */ "page.section.container.columns.column.heading.paragraph.button.image.badge.divider.spacer.card.icon.carousel.video.social.menu.html.table.timer.form.accordion.blogTitle.blogContent.blogFeaturedImage.blogDate.blogAuthor.blogCategories.blogComments.blogPostList.shopGrid.product.booking.cart.checkout.orderConfirmation.orderTracking.signupForm".split("."), id = [
19816
19983
  "blogTitle",
19817
19984
  "blogContent",
19818
19985
  "blogFeaturedImage",
@@ -19829,70 +19996,70 @@ var Vu = 5e3, Hu = 40, Uu = /* @__PURE__ */ "page.section.container.columns.colu
19829
19996
  "orderConfirmation",
19830
19997
  "orderTracking",
19831
19998
  "signupForm"
19832
- ], Gu = r([t().int().min(1).max(96), n().max(4)]), Ku = a({
19999
+ ], ad = r([t().int().min(1).max(96), n().max(4)]), od = a({
19833
20000
  prefix: n().max(80),
19834
20001
  productId: n().max(100),
19835
20002
  serviceId: n().max(100),
19836
20003
  mode: n().max(40),
19837
20004
  storeMode: i(),
19838
- limit: Gu,
20005
+ limit: ad,
19839
20006
  category: n().max(100),
19840
20007
  sort: n().max(100),
19841
- itemsPerRow: Gu,
19842
- itemsPerPage: Gu,
20008
+ itemsPerRow: ad,
20009
+ itemsPerPage: ad,
19843
20010
  paginated: i(),
19844
20011
  templateId: n().max(100)
19845
- }).partial().passthrough(), qu = r([
20012
+ }).partial().passthrough(), sd = r([
19846
20013
  n().max(2e3),
19847
20014
  t(),
19848
20015
  i()
19849
- ]), Ju = d(n(), qu.optional()), Yu = o(() => a({
20016
+ ]), cd = d(n(), sd.optional()), ld = o(() => a({
19850
20017
  id: n().min(1).max(200),
19851
- type: u(Uu),
20018
+ type: u(rd),
19852
20019
  name: n().max(300),
19853
20020
  content: n().max(1e5).optional(),
19854
20021
  props: d(n(), s()).optional(),
19855
- styles: Ju,
20022
+ styles: cd,
19856
20023
  responsive: a({
19857
- tablet: Ju.optional(),
19858
- mobile: Ju.optional()
20024
+ tablet: cd.optional(),
20025
+ mobile: cd.optional()
19859
20026
  }).optional(),
19860
20027
  responsiveVisibility: a({
19861
20028
  hideOnDesktop: i().optional(),
19862
20029
  hideOnTablet: i().optional(),
19863
20030
  hideOnMobile: i().optional()
19864
20031
  }).optional(),
19865
- children: c(Yu).optional(),
20032
+ children: c(ld).optional(),
19866
20033
  locked: i().optional(),
19867
20034
  hidden: i().optional()
19868
20035
  }).superRefine((e, t) => {
19869
- if (!Wu.includes(e.type) || !e.props) return;
19870
- let n = Ku.safeParse(e.props);
20036
+ if (!id.includes(e.type) || !e.props) return;
20037
+ let n = od.safeParse(e.props);
19871
20038
  n.success || t.addIssue({
19872
20039
  code: "custom",
19873
20040
  path: ["props", ...n.error.issues[0].path],
19874
20041
  message: `The settings of "${e.name}" aren't valid (${n.error.issues[0].path.join(" › ") || "settings"}: ${n.error.issues[0].message})`
19875
20042
  });
19876
- })), Xu = a({
20043
+ })), ud = a({
19877
20044
  id: n().min(1).max(200),
19878
20045
  name: n().max(300),
19879
20046
  slug: n().max(300),
19880
20047
  isHome: i().optional(),
19881
- rootNode: Yu
20048
+ rootNode: ld
19882
20049
  });
19883
- function Zu(e, t, n) {
19884
- if (n.n += 1, n.n > 5e3) return `This design is too large (more than ${Vu} elements).`;
20050
+ function dd(e, t, n) {
20051
+ if (n.n += 1, n.n > 5e3) return `This design is too large (more than ${td} elements).`;
19885
20052
  if (t > 40) return "This design is nested too deeply.";
19886
20053
  if (n.ids.has(e.id)) return `Two elements share the same id ("${e.id}"). Each element needs its own.`;
19887
20054
  n.ids.add(e.id);
19888
20055
  for (let r of e.children ?? []) {
19889
- let e = Zu(r, t + 1, n);
20056
+ let e = dd(r, t + 1, n);
19890
20057
  if (e) return e;
19891
20058
  }
19892
20059
  return null;
19893
20060
  }
19894
- function Qu(e) {
19895
- let t = c(Xu).min(1, "A design needs at least one page.").safeParse(e);
20061
+ function fd(e) {
20062
+ let t = c(ud).min(1, "A design needs at least one page.").safeParse(e);
19896
20063
  if (!t.success) {
19897
20064
  let e = t.error.issues[0], n = e.path.length ? ` (at ${e.path.filter((e) => typeof e == "string" && e !== "children" && e !== "rootNode").join(" › ") || "the design"})` : "";
19898
20065
  return {
@@ -19902,7 +20069,7 @@ function Qu(e) {
19902
20069
  }
19903
20070
  let n = t.data;
19904
20071
  for (let e of n) {
19905
- let t = Zu(e.rootNode, 0, {
20072
+ let t = dd(e.rootNode, 0, {
19906
20073
  n: 0,
19907
20074
  ids: /* @__PURE__ */ new Set()
19908
20075
  });
@@ -19918,7 +20085,7 @@ function Qu(e) {
19918
20085
  }
19919
20086
  //#endregion
19920
20087
  //#region src/v2/migrate/v1.ts
19921
- var $u = {
20088
+ var pd = {
19922
20089
  blog_title: "blogTitle",
19923
20090
  blog_content: "blogContent",
19924
20091
  blog_featured_image: "blogFeaturedImage",
@@ -19935,7 +20102,7 @@ var $u = {
19935
20102
  order_tracking: "orderTracking",
19936
20103
  booking: "booking",
19937
20104
  maildrip_form: null
19938
- }, ed = !0, td = [
20105
+ }, md = !0, hd = [
19939
20106
  "prefix",
19940
20107
  "productId",
19941
20108
  "serviceId",
@@ -19947,7 +20114,7 @@ var $u = {
19947
20114
  "itemsPerRow",
19948
20115
  "itemsPerPage",
19949
20116
  "paginated"
19950
- ], nd = {
20117
+ ], gd = {
19951
20118
  blog_title: "blog title",
19952
20119
  blog_content: "blog post text",
19953
20120
  blog_featured_image: "blog picture",
@@ -19963,7 +20130,7 @@ var $u = {
19963
20130
  checkout_flow: "checkout",
19964
20131
  order_confirmation: "order confirmation",
19965
20132
  order_tracking: "order tracking"
19966
- }, rd = (e) => !!e && typeof e == "object" && !Array.isArray(e), J = (e) => rd(e) ? e : {}, Y = (e, t = 500) => Array.isArray(e) ? e.slice(0, t) : [], X = (e) => typeof e == "string" ? e : typeof e == "number" && Number.isFinite(e) ? String(e) : "", id = {
20133
+ }, _d = (e) => !!e && typeof e == "object" && !Array.isArray(e), Y = (e) => _d(e) ? e : {}, X = (e, t = 500) => Array.isArray(e) ? e.slice(0, t) : [], Z = (e) => typeof e == "string" ? e : typeof e == "number" && Number.isFinite(e) ? String(e) : "", vd = {
19967
20134
  amp: "&",
19968
20135
  lt: "<",
19969
20136
  gt: ">",
@@ -19978,7 +20145,7 @@ var $u = {
19978
20145
  ndash: "–",
19979
20146
  hellip: "…",
19980
20147
  copy: "©"
19981
- }, ad = (e) => e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (e, t) => {
20148
+ }, yd = (e) => e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (e, t) => {
19982
20149
  if (t[0] === "#") {
19983
20150
  let e = t[1].toLowerCase() === "x" ? parseInt(t.slice(2), 16) : parseInt(t.slice(1), 10);
19984
20151
  try {
@@ -19987,37 +20154,37 @@ var $u = {
19987
20154
  return "";
19988
20155
  }
19989
20156
  }
19990
- return id[t.toLowerCase()] ?? e;
20157
+ return vd[t.toLowerCase()] ?? e;
19991
20158
  });
19992
- function Z(e) {
20159
+ function bd(e) {
19993
20160
  let t = /<(a|b|strong|i|em|u|s|span|font|ul|ol|li|img|sup|sub|mark|code)\b/i.test(e);
19994
20161
  return {
19995
- text: ad(e.replace(/<\s*br\s*\/?>/gi, "\n").replace(/<\/(p|div|li|h[1-6])\s*>/gi, "\n").replace(/<[^>]*>/g, "")).replace(/[ \t\f\v]+/g, " ").replace(/ ?\n ?/g, "\n").replace(/\n{3,}/g, "\n\n").trim().slice(0, 2e4),
20162
+ text: yd(e.replace(/<\s*br\s*\/?>/gi, "\n").replace(/<\/(p|div|li|h[1-6])\s*>/gi, "\n").replace(/<[^>]*>/g, "")).replace(/[ \t\f\v]+/g, " ").replace(/ ?\n ?/g, "\n").replace(/\n{3,}/g, "\n\n").trim().slice(0, 2e4),
19996
20163
  rich: t
19997
20164
  };
19998
20165
  }
19999
- var od = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-binding/i, sd = (e) => {
20000
- let t = X(e).trim();
20001
- return t && t.length <= 300 && !od.test(t) ? t : void 0;
20002
- }, cd = /* @__PURE__ */ new Set([
20166
+ var xd = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-binding/i, Sd = (e) => {
20167
+ let t = Z(e).trim();
20168
+ return t && t.length <= 300 && !xd.test(t) ? t : void 0;
20169
+ }, Cd = /* @__PURE__ */ new Set([
20003
20170
  "left",
20004
20171
  "center",
20005
20172
  "right",
20006
20173
  "justify"
20007
- ]), ld = /* @__PURE__ */ new Set([
20174
+ ]), wd = /* @__PURE__ */ new Set([
20008
20175
  "solid",
20009
20176
  "dashed",
20010
20177
  "dotted",
20011
20178
  "none"
20012
- ]), ud = /* @__PURE__ */ new Set([
20179
+ ]), Td = /* @__PURE__ */ new Set([
20013
20180
  "none",
20014
20181
  "uppercase",
20015
20182
  "lowercase",
20016
20183
  "capitalize"
20017
- ]), dd = (e) => {
20184
+ ]), Ed = (e) => {
20018
20185
  let t = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/i.exec(e), n = (t?.[1] ?? t?.[2] ?? t?.[3] ?? "").trim();
20019
20186
  return n && vt(n) || void 0;
20020
- }, fd = /* @__PURE__ */ new Set([
20187
+ }, Dd = /* @__PURE__ */ new Set([
20021
20188
  "autoHeight",
20022
20189
  "autoWidth",
20023
20190
  "position",
@@ -20035,13 +20202,13 @@ var od = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-b
20035
20202
  "verticalAlign",
20036
20203
  "float"
20037
20204
  ]);
20038
- function pd(e) {
20039
- let t = J(e), n = {}, r = [], i = (e, t) => {
20205
+ function Od(e) {
20206
+ let t = Y(e), n = {}, r = [], i = (e, t) => {
20040
20207
  t !== void 0 && (n[e] = t);
20041
20208
  };
20042
20209
  for (let [e, a] of Object.entries(t)) {
20043
- if (a == null || a === "" || fd.has(e)) continue;
20044
- let t = sd(a);
20210
+ if (a == null || a === "" || Dd.has(e)) continue;
20211
+ let t = Sd(a);
20045
20212
  switch (e) {
20046
20213
  case "color":
20047
20214
  i("textColor", t);
@@ -20062,7 +20229,7 @@ function pd(e) {
20062
20229
  i("letterSpacing", t);
20063
20230
  break;
20064
20231
  case "textTransform":
20065
- t && ud.has(t) && (n.textTransform = t);
20232
+ t && Td.has(t) && (n.textTransform = t);
20066
20233
  break;
20067
20234
  case "fontStyle":
20068
20235
  t === "italic" && (n.isItalic = !0);
@@ -20071,7 +20238,7 @@ function pd(e) {
20071
20238
  t && /underline/.test(t) && (n.isUnderline = !0);
20072
20239
  break;
20073
20240
  case "textAlign":
20074
- t && cd.has(t) && (n.textAlign = t);
20241
+ t && Cd.has(t) && (n.textAlign = t);
20075
20242
  break;
20076
20243
  case "backgroundColor":
20077
20244
  i("backgroundColor", t);
@@ -20080,7 +20247,7 @@ function pd(e) {
20080
20247
  case "backgroundImage":
20081
20248
  if (t && /gradient\(/i.test(t)) n.backgroundGradient = t;
20082
20249
  else if (t && /url\(/i.test(t)) {
20083
- let i = dd(t);
20250
+ let i = Ed(t);
20084
20251
  i ? (n.backgroundImage = i, n.backgroundSize ??= "cover", n.backgroundPosition ??= "center") : r.push(e);
20085
20252
  } else e === "background" ? i("backgroundColor", t) : t && r.push(e);
20086
20253
  break;
@@ -20118,7 +20285,7 @@ function pd(e) {
20118
20285
  i("gap", t);
20119
20286
  break;
20120
20287
  case "borderStyle":
20121
- t && ld.has(t) && (n.borderStyle = t);
20288
+ t && wd.has(t) && (n.borderStyle = t);
20122
20289
  break;
20123
20290
  case "border": {
20124
20291
  let i = t ? /^([\d.]+(?:px|rem|em)?)\s+(solid|dashed|dotted|none)\s*(.*)$/i.exec(t) : null;
@@ -20141,11 +20308,11 @@ function pd(e) {
20141
20308
  unmapped: r
20142
20309
  };
20143
20310
  }
20144
- var md = (e, ...t) => t.some((t) => X(e[t]).trim() !== ""), Q = (e, t) => {
20311
+ var kd = (e, ...t) => t.some((t) => Z(e[t]).trim() !== ""), Q = (e, t) => {
20145
20312
  e.seen.has(t) || (e.seen.add(t), e.warnings.push(t));
20146
- }, hd = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
20147
- function gd(e, t, n) {
20148
- let r = pd(t.style), i = pd(t.styleTablet), a = pd(t.styleMobile), o = [.../* @__PURE__ */ new Set([
20313
+ }, Ad = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
20314
+ function jd(e, t, n) {
20315
+ let r = Od(t.style), i = Od(t.styleTablet), a = Od(t.styleMobile), o = [.../* @__PURE__ */ new Set([
20149
20316
  ...r.unmapped,
20150
20317
  ...i.unmapped,
20151
20318
  ...a.unmapped
@@ -20157,7 +20324,7 @@ function gd(e, t, n) {
20157
20324
  responsive: Object.keys(s).length ? s : void 0
20158
20325
  };
20159
20326
  }
20160
- function _d(e, t) {
20327
+ function Md(e, t) {
20161
20328
  t !== "center" && t !== "right" || (!e.width && !e.widthSizing && (e.widthSizing = "hug"), e.marginLeft ||= "auto", !e.marginRight && t === "center" && (e.marginRight = "auto"));
20162
20329
  }
20163
20330
  var $ = (e, t, n, r, i = {}) => ({
@@ -20166,12 +20333,12 @@ var $ = (e, t, n, r, i = {}) => ({
20166
20333
  name: n,
20167
20334
  styles: r,
20168
20335
  ...i
20169
- }), vd = {
20336
+ }), Nd = {
20170
20337
  layoutMode: "flow",
20171
20338
  display: "flex",
20172
20339
  flexDirection: "column",
20173
20340
  width: "100%"
20174
- }, yd = {
20341
+ }, Pd = {
20175
20342
  1: "32px",
20176
20343
  2: "24px",
20177
20344
  3: "19px",
@@ -20179,45 +20346,45 @@ var $ = (e, t, n, r, i = {}) => ({
20179
20346
  5: "13px",
20180
20347
  6: "11px"
20181
20348
  };
20182
- function bd(e, t, n) {
20183
- let r = X(t.type), i = J(t.attributes), { styles: a, responsive: o } = gd(e, t, `${nd[r] ?? r.replace(/_/g, " ")} block`), s = a.textAlign, c = (e, t, r = {}, i = a) => $(n, e, t, i, {
20349
+ function Fd(e, t, n) {
20350
+ let r = Z(t.type), i = Y(t.attributes), { styles: a, responsive: o } = jd(e, t, `${gd[r] ?? r.replace(/_/g, " ")} block`), s = a.textAlign, c = (e, t, r = {}, i = a) => $(n, e, t, i, {
20184
20351
  ...o ? { responsive: o } : {},
20185
20352
  ...r
20186
20353
  });
20187
20354
  switch (r) {
20188
20355
  case "heading": {
20189
- let { text: n, rich: r } = Z(X(i.text) || "Heading");
20356
+ let { text: n, rich: r } = bd(Z(i.text) || "Heading");
20190
20357
  r && (e.approx = !0, Q(e, "Bold, italic and links inside text are simplified to plain text."));
20191
- let o = /^h([1-6])$/i.exec(X(i.headingType)), s = o ? Number(o[1]) : 2, l = { ...a };
20192
- return l.fontSize ??= yd[s], l.fontWeight ??= "700", md(J(t.style), "margin", "marginBottom") || (l.marginBottom = "8px"), [c("heading", n.slice(0, 40) || "Heading", {
20358
+ let o = /^h([1-6])$/i.exec(Z(i.headingType)), s = o ? Number(o[1]) : 2, l = { ...a };
20359
+ return l.fontSize ??= Pd[s], l.fontWeight ??= "700", kd(Y(t.style), "margin", "marginBottom") || (l.marginBottom = "8px"), [c("heading", n.slice(0, 40) || "Heading", {
20193
20360
  content: n,
20194
20361
  props: { level: s }
20195
20362
  }, l)];
20196
20363
  }
20197
20364
  case "paragraph":
20198
20365
  case "text": {
20199
- let s = X(i.text) || (r === "paragraph" ? "Paragraph text content." : ""), { rich: l } = Z(s);
20366
+ let s = Z(i.text) || (r === "paragraph" ? "Paragraph text content." : ""), { rich: l } = bd(s);
20200
20367
  l && (e.approx = !0, Q(e, "Bold, italic and links inside text are simplified to plain text."));
20201
- let u = s.split(/<\/p\s*>|(?:<br\s*\/?>\s*){2,}/i).map((e) => Z(e).text).filter(Boolean), d = u.length ? u : [""], f = { ...a };
20202
- return r === "paragraph" && !md(J(t.style), "margin", "marginBottom") && (f.marginBottom = "12px"), d.map((e, t) => t === 0 ? c("paragraph", e.slice(0, 40) || "Text", { content: e }, f) : $(`${n}-p${t + 1}`, "paragraph", e.slice(0, 40) || "Text", f, {
20368
+ let u = s.split(/<\/p\s*>|(?:<br\s*\/?>\s*){2,}/i).map((e) => bd(e).text).filter(Boolean), d = u.length ? u : [""], f = { ...a };
20369
+ return r === "paragraph" && !kd(Y(t.style), "margin", "marginBottom") && (f.marginBottom = "12px"), d.map((e, t) => t === 0 ? c("paragraph", e.slice(0, 40) || "Text", { content: e }, f) : $(`${n}-p${t + 1}`, "paragraph", e.slice(0, 40) || "Text", f, {
20203
20370
  content: e,
20204
20371
  ...o ? { responsive: o } : {}
20205
20372
  }));
20206
20373
  }
20207
20374
  case "button": {
20208
20375
  let t = { ...a };
20209
- _d(t, s), !t.widthSizing && !t.width && (t.widthSizing = "hug");
20210
- let n = X(i.href).trim();
20376
+ Md(t, s), !t.widthSizing && !t.width && (t.widthSizing = "hug");
20377
+ let n = Z(i.href).trim();
20211
20378
  return i.openInNewTab && (e.approx = !0, Q(e, "Buttons can't open in a new tab yet, so they open in the same one.")), [c("button", "Button", {
20212
- content: Z(X(i.text) || "Button").text,
20379
+ content: bd(Z(i.text) || "Button").text,
20213
20380
  props: { href: n ? P(n) : "#" }
20214
20381
  }, t)];
20215
20382
  }
20216
20383
  case "image": {
20217
20384
  let e = { ...a };
20218
- return i.autoHeight !== !1 && delete e.height, e.width ??= "100%", _d(e, s), [c("image", X(i.alt).slice(0, 40) || "Image", { props: {
20385
+ return i.autoHeight !== !1 && delete e.height, e.width ??= "100%", Md(e, s), [c("image", Z(i.alt).slice(0, 40) || "Image", { props: {
20219
20386
  src: vt(i.src),
20220
- alt: X(i.alt)
20387
+ alt: Z(i.alt)
20221
20388
  } }, e)];
20222
20389
  }
20223
20390
  case "divider": return [c("divider", "Divider", {}, {
@@ -20229,84 +20396,84 @@ function bd(e, t, n) {
20229
20396
  case "spacer": return [c("spacer", "Spacer", {}, { height: a.height ?? "24px" })];
20230
20397
  case "card": {
20231
20398
  let e = {
20232
- ...vd,
20399
+ ...Nd,
20233
20400
  gap: "8px",
20234
20401
  ...a
20235
20402
  };
20236
- return [c("card", X(i.title).slice(0, 40) || "Card", { children: [$(`${n}-title`, "heading", "Card title", {
20403
+ return [c("card", Z(i.title).slice(0, 40) || "Card", { children: [$(`${n}-title`, "heading", "Card title", {
20237
20404
  fontSize: "19px",
20238
20405
  fontWeight: "700",
20239
20406
  textColor: "#ffffff"
20240
20407
  }, {
20241
- content: Z(X(i.title) || "Card Title").text,
20408
+ content: bd(Z(i.title) || "Card Title").text,
20242
20409
  props: { level: 3 }
20243
20410
  }), $(`${n}-text`, "paragraph", "Card text", {
20244
20411
  fontSize: "14px",
20245
20412
  textColor: "#94a3b8"
20246
- }, { content: Z(X(i.description) || "Card description.").text })] }, e)];
20413
+ }, { content: bd(Z(i.description) || "Card description.").text })] }, e)];
20247
20414
  }
20248
20415
  case "icon": {
20249
- let t = hd(X(i.iconName)), n = t in Pc;
20250
- n || (e.approx = !0, Q(e, `The icon "${X(i.iconName) || "unnamed"}" isn't in the V2 icon set, so a star stands in for it.`)), X(i.href).trim() && (e.approx = !0, Q(e, "Icons can't be links yet; the icon is kept without its link."));
20416
+ let t = Ad(Z(i.iconName)), n = t in Jc;
20417
+ n || (e.approx = !0, Q(e, `The icon "${Z(i.iconName) || "unnamed"}" isn't in the V2 icon set, so a star stands in for it.`)), Z(i.href).trim() && (e.approx = !0, Q(e, "Icons can't be links yet; the icon is kept without its link."));
20251
20418
  let r = { ...a };
20252
- return r.fontSize ??= `${parseInt(X(i.iconSize), 10) || 48}px`, r.textColor ??= "#1e293b", _d(r, s === "left" ? void 0 : s ?? "center"), [c("icon", "Icon", { props: {
20419
+ return r.fontSize ??= `${parseInt(Z(i.iconSize), 10) || 48}px`, r.textColor ??= "#1e293b", Md(r, s === "left" ? void 0 : s ?? "center"), [c("icon", "Icon", { props: {
20253
20420
  iconName: n ? t : "star",
20254
20421
  strokeWidth: 2,
20255
- label: X(i.alt) || X(i.label)
20422
+ label: Z(i.alt) || Z(i.label)
20256
20423
  } }, r)];
20257
20424
  }
20258
20425
  case "carousel": return [c("carousel", "Carousel", { props: {
20259
- slides: Y(i.images, 30).map((e) => J(e)).map((e) => ({
20426
+ slides: X(i.images, 30).map((e) => Y(e)).map((e) => ({
20260
20427
  src: vt(e.src),
20261
- alt: X(e.alt),
20262
- caption: X(e.caption)
20428
+ alt: Z(e.alt),
20429
+ caption: Z(e.caption)
20263
20430
  })),
20264
20431
  showArrows: i.showArrows !== !1,
20265
20432
  showDots: i.showDots !== !1,
20266
20433
  autoplay: !0,
20267
20434
  interval: 5
20268
20435
  } })];
20269
- case "video": return X(i.videoUrl).trim() ? [c("video", "Video", { props: {
20270
- url: X(i.videoUrl),
20436
+ case "video": return Z(i.videoUrl).trim() ? [c("video", "Video", { props: {
20437
+ url: Z(i.videoUrl),
20271
20438
  ratio: "16:9"
20272
20439
  } })] : (e.lost = !0, Q(e, "A video block had no video address, so it was left out."), []);
20273
20440
  case "social": {
20274
- let n = Y(i.links, 20).map(J), r = n.map((e) => ({
20275
- network: X(e.provider) === "twitter" ? "x" : X(e.provider),
20276
- url: P(X(e.url))
20441
+ let n = X(i.links, 20).map(Y), r = n.map((e) => ({
20442
+ network: Z(e.provider) === "twitter" ? "x" : Z(e.provider),
20443
+ url: P(Z(e.url))
20277
20444
  })).filter((e) => e.network in Xt);
20278
20445
  r.length < n.length && (e.approx = !0, Q(e, "A social link to a network V2 has no icon for was left out."));
20279
- let o = parseInt(X(J(n[0]).size) || X(J(t.style).iconSize), 10), l = { ...a };
20280
- return _d(l, s), [c("social", "Social links", { props: {
20446
+ let o = parseInt(Z(Y(n[0]).size) || Z(Y(t.style).iconSize), 10), l = { ...a };
20447
+ return Md(l, s), [c("social", "Social links", { props: {
20281
20448
  links: r,
20282
20449
  size: Number.isFinite(o) ? Math.min(96, Math.max(20, o)) : 40,
20283
- shape: X(i.iconType ?? J(n[0]).iconType) === "square" ? "square" : "circle",
20450
+ shape: Z(i.iconType ?? Y(n[0]).iconType) === "square" ? "square" : "circle",
20284
20451
  colorMode: i.colorMode === "branded" ? "brand" : "mono"
20285
20452
  } }, l)];
20286
20453
  }
20287
20454
  case "menu": {
20288
- let e = Y(i.links, 40).map(J).map((e) => ({
20289
- label: X(e.label).trim() || "Link",
20290
- href: P(X(e.href) || "#")
20455
+ let e = X(i.links, 40).map(Y).map((e) => ({
20456
+ label: Z(e.label).trim() || "Link",
20457
+ href: P(Z(e.href) || "#")
20291
20458
  })), t = { ...a };
20292
- return (s === "center" || s === "right") && _d(t, s), [c("menu", "Menu", { props: {
20459
+ return (s === "center" || s === "right") && Md(t, s), [c("menu", "Menu", { props: {
20293
20460
  links: e,
20294
20461
  layout: "horizontal",
20295
20462
  mobile: "hamburger"
20296
20463
  } }, t)];
20297
20464
  }
20298
20465
  case "html": {
20299
- let t = X(i.htmlContent);
20466
+ let t = Z(i.htmlContent);
20300
20467
  return t.trim() ? (e.approx = !0, Q(e, "HTML blocks now sit in their own box on the page, so they no longer pick up the site’s styles. Check each one."), [c("html", "Embed", { props: {
20301
20468
  code: t,
20302
- title: X(i.title) || "Embedded content"
20469
+ title: Z(i.title) || "Embedded content"
20303
20470
  } }, {
20304
20471
  ...a,
20305
20472
  height: a.height ?? "300px"
20306
20473
  })]) : (e.lost = !0, Q(e, "An empty HTML block was left out."), []);
20307
20474
  }
20308
20475
  case "table": {
20309
- let t = Math.max(1, Math.min(200, Number(i.rowCount) || 2)), n = Math.max(1, Math.min(30, Number(i.colCount) || 2)), r = Y(i.cells, 200).map((e) => Y(e, 30)), a = Array.from({ length: t }, (e, t) => Array.from({ length: n }, (e, n) => Z(X(r[t]?.[n])).text));
20476
+ let t = Math.max(1, Math.min(200, Number(i.rowCount) || 2)), n = Math.max(1, Math.min(30, Number(i.colCount) || 2)), r = X(i.cells, 200).map((e) => X(e, 30)), a = Array.from({ length: t }, (e, t) => Array.from({ length: n }, (e, n) => bd(Z(r[t]?.[n])).text));
20310
20477
  return i.enableFooter && (e.approx = !0, Q(e, "A table footer row is now an ordinary row.")), [c("table", "Table", { props: {
20311
20478
  rows: a,
20312
20479
  headerRow: i.enableHeader !== !1,
@@ -20314,35 +20481,35 @@ function bd(e, t, n) {
20314
20481
  } })];
20315
20482
  }
20316
20483
  case "timer": {
20317
- let t = Date.parse(X(i.targetDate));
20318
- return Number.isFinite(t) ? (X(i.timezone) && !/^(utc|gmt)?$/i.test(X(i.timezone)) && (e.approx = !0, Q(e, "Countdown times now use the date as written, in the visitor’s own time zone. Check the end time.")), [c("timer", "Countdown", { props: {
20484
+ let t = Date.parse(Z(i.targetDate));
20485
+ return Number.isFinite(t) ? (Z(i.timezone) && !/^(utc|gmt)?$/i.test(Z(i.timezone)) && (e.approx = !0, Q(e, "Countdown times now use the date as written, in the visitor’s own time zone. Check the end time.")), [c("timer", "Countdown", { props: {
20319
20486
  target: new Date(t).toISOString(),
20320
- expiredMessage: X(i.expiredMessage) || "This offer has ended",
20487
+ expiredMessage: Z(i.expiredMessage) || "This offer has ended",
20321
20488
  showLabels: i.showLabels !== !1
20322
20489
  } })]) : (e.lost = !0, Q(e, "A countdown timer had no valid end date, so it was left out."), []);
20323
20490
  }
20324
20491
  case "accordion": {
20325
- let t = Y(i.items, 50).map(J);
20326
- t.some((e) => Y(e.children).length) && (e.approx = !0, Q(e, "Questions nested inside other questions were left out of an accordion."));
20492
+ let t = X(i.items, 50).map(Y);
20493
+ t.some((e) => X(e.children).length) && (e.approx = !0, Q(e, "Questions nested inside other questions were left out of an accordion."));
20327
20494
  let n = t.findIndex((e) => !!e.defaultOpen);
20328
20495
  return n > 0 && (e.approx = !0, Q(e, "An accordion opens its first question by default now, not the one it used to.")), [c("accordion", "Accordion", { props: {
20329
20496
  items: t.map((e, t) => ({
20330
- title: Z(X(e.title) || `Item ${t + 1}`).text,
20331
- content: Z(X(e.content)).text
20497
+ title: bd(Z(e.title) || `Item ${t + 1}`).text,
20498
+ content: bd(Z(e.content)).text
20332
20499
  })),
20333
20500
  allowMultiple: i.mode === "multi",
20334
20501
  openFirst: n === 0
20335
20502
  } })];
20336
20503
  }
20337
- case "form_container": return X(i.provider) === "maildrip" ? xd(e, "maildrip_form", "a MailDrip sign-up form", n, i) : [Cd(e, n, i, Y(i.fields, 40).map(J), a, o)];
20338
- default: return r in $u ? xd(e, r, nd[r] ?? r, n, i, a, o) : (e.lost = !0, Q(e, `A "${r || "unknown"}" block isn't supported in the new editor and was left out.`), []);
20504
+ case "form_container": return Z(i.provider) === "maildrip" ? Id(e, "maildrip_form", "a MailDrip sign-up form", n, i) : [Rd(e, n, i, X(i.fields, 40).map(Y), a, o)];
20505
+ default: return r in pd ? Id(e, r, gd[r] ?? r, n, i, a, o) : (e.lost = !0, Q(e, `A "${r || "unknown"}" block isn't supported in the new editor and was left out.`), []);
20339
20506
  }
20340
20507
  }
20341
- function xd(e, t, n, r, i, a = {}, o) {
20342
- let s = $u[t];
20508
+ function Id(e, t, n, r, i, a = {}, o) {
20509
+ let s = pd[t];
20343
20510
  if (s) {
20344
20511
  let e = {};
20345
- for (let t of td) {
20512
+ for (let t of hd) {
20346
20513
  let n = i[t];
20347
20514
  (typeof n == "string" || typeof n == "boolean" || typeof n == "number" && Number.isFinite(n)) && (e[t] = n);
20348
20515
  }
@@ -20355,11 +20522,11 @@ function xd(e, t, n, r, i, a = {}, o) {
20355
20522
  })];
20356
20523
  }
20357
20524
  return e.lost = !0, Q(e, `The ${n} can't be carried over automatically and was left out. Add it again from the new editor's Add panel.`), [$(r, "container", `Needs attention: ${n}`, {
20358
- ...vd,
20525
+ ...Nd,
20359
20526
  minHeight: "40px"
20360
20527
  }, { hidden: !0 })];
20361
20528
  }
20362
- var Sd = {
20529
+ var Ld = {
20363
20530
  text: "text",
20364
20531
  email: "email",
20365
20532
  tel: "tel",
@@ -20371,34 +20538,34 @@ var Sd = {
20371
20538
  number: "text",
20372
20539
  date: "text"
20373
20540
  };
20374
- function Cd(e, t, n, r, i, a) {
20541
+ function Rd(e, t, n, r, i, a) {
20375
20542
  let o = /* @__PURE__ */ new Set(), s = [];
20376
20543
  for (let t of r) {
20377
- let n = X(t.kind) || X(t.type) || X(t.inputType) || "text", r = Sd[n] ?? "text";
20378
- (n === "radio" || n === "number" || n === "date" || !(n in Sd)) && (e.approx = !0, Q(e, `A "${n}" form field is now a ${r === "select" ? "drop-down" : "text"} field.`));
20379
- let i = Z(X(t.label) || X(t.placeholder) || X(t.name) || "Field").text, a = (X(t.name) || X(t.fieldName) || i).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "field", c = a;
20544
+ let n = Z(t.kind) || Z(t.type) || Z(t.inputType) || "text", r = Ld[n] ?? "text";
20545
+ (n === "radio" || n === "number" || n === "date" || !(n in Ld)) && (e.approx = !0, Q(e, `A "${n}" form field is now a ${r === "select" ? "drop-down" : "text"} field.`));
20546
+ let i = bd(Z(t.label) || Z(t.placeholder) || Z(t.name) || "Field").text, a = (Z(t.name) || Z(t.fieldName) || i).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "field", c = a;
20380
20547
  for (let e = 2; o.has(a); e++) a = `${c}-${e}`;
20381
20548
  o.add(a);
20382
- let l = Y(t.options, 50).map((e) => rd(e) ? X(e.label) || X(e.value) : X(e)).filter(Boolean);
20549
+ let l = X(t.options, 50).map((e) => _d(e) ? Z(e.label) || Z(e.value) : Z(e)).filter(Boolean);
20383
20550
  s.push({
20384
20551
  id: a,
20385
20552
  label: i,
20386
20553
  type: r,
20387
- ...X(t.placeholder) ? { placeholder: X(t.placeholder) } : {},
20554
+ ...Z(t.placeholder) ? { placeholder: Z(t.placeholder) } : {},
20388
20555
  ...t.required ? { required: !0 } : {},
20389
20556
  ...r === "select" ? { options: l } : {}
20390
20557
  });
20391
20558
  }
20392
20559
  e.approx = !0, Q(e, "Forms use the new form style, so field and button colours need a quick check.");
20393
- let c = X(n.actionUrl) || X(n.action), l = {
20560
+ let c = Z(n.actionUrl) || Z(n.action), l = {
20394
20561
  fields: s.length ? s : [{
20395
20562
  id: "email",
20396
20563
  label: "Email",
20397
20564
  type: "email",
20398
20565
  required: !0
20399
20566
  }],
20400
- submitLabel: X(n.submitLabel) || "Submit",
20401
- successMessage: X(n.successMessage) || "Thanks! We got your message."
20567
+ submitLabel: Z(n.submitLabel) || "Submit",
20568
+ successMessage: Z(n.successMessage) || "Thanks! We got your message."
20402
20569
  };
20403
20570
  c && P(c) !== "#" && (l.action = P(c)), s.length || (e.approx = !0, Q(e, "A form had no fields, so it starts with an email field."));
20404
20571
  let u = { ...i };
@@ -20407,35 +20574,35 @@ function Cd(e, t, n, r, i, a) {
20407
20574
  ...a ? { responsive: a } : {}
20408
20575
  });
20409
20576
  }
20410
- var wd = /* @__PURE__ */ new Set([
20577
+ var zd = /* @__PURE__ */ new Set([
20411
20578
  "input",
20412
20579
  "textarea",
20413
20580
  "select"
20414
20581
  ]);
20415
- function Td(e) {
20416
- let t = J(e.attributes), n = X(e.type);
20582
+ function Bd(e) {
20583
+ let t = Y(e.attributes), n = Z(e.type);
20417
20584
  return {
20418
- kind: n === "input" ? X(t.inputType) || X(t.type) || "text" : n,
20419
- name: X(t.name) || X(t.fieldName),
20420
- label: X(t.label) || X(t.placeholder),
20421
- placeholder: X(t.placeholder),
20585
+ kind: n === "input" ? Z(t.inputType) || Z(t.type) || "text" : n,
20586
+ name: Z(t.name) || Z(t.fieldName),
20587
+ label: Z(t.label) || Z(t.placeholder),
20588
+ placeholder: Z(t.placeholder),
20422
20589
  required: t.required,
20423
20590
  options: t.options
20424
20591
  };
20425
20592
  }
20426
- function Ed(e) {
20427
- let t = Y(e.elements, 200).filter(rd), n = Y(e.nestedRows, 50).filter(rd), r = /* @__PURE__ */ new Map();
20428
- for (let e of t) r.set(X(e.id), {
20593
+ function Vd(e) {
20594
+ let t = X(e.elements, 200).filter(_d), n = X(e.nestedRows, 50).filter(_d), r = /* @__PURE__ */ new Map();
20595
+ for (let e of t) r.set(Z(e.id), {
20429
20596
  kind: "el",
20430
20597
  item: e
20431
20598
  });
20432
- for (let e of n) r.set(X(e.id), {
20599
+ for (let e of n) r.set(Z(e.id), {
20433
20600
  kind: "row",
20434
20601
  item: e
20435
20602
  });
20436
20603
  let i = [], a = /* @__PURE__ */ new Set();
20437
- for (let t of Y(e.childOrder, 250)) {
20438
- let e = r.get(X(t));
20604
+ for (let t of X(e.childOrder, 250)) {
20605
+ let e = r.get(Z(t));
20439
20606
  e && !a.has(e.item) && (i.push(e), a.add(e.item));
20440
20607
  }
20441
20608
  for (let e of t) a.has(e) || i.push({
@@ -20448,11 +20615,11 @@ function Ed(e) {
20448
20615
  });
20449
20616
  return i;
20450
20617
  }
20451
- function Dd(e, t = 1) {
20618
+ function Hd(e, t = 1) {
20452
20619
  return e.nodes + t > 4980 ? (e.capped || (e.capped = !0, e.lost = !0, Q(e, "This design is very large, so the last part of it was left out.")), !1) : (e.nodes += t, !0);
20453
20620
  }
20454
- function Od(e, t, n, r) {
20455
- let i = [], a = Ed(t), o = 0;
20621
+ function Ud(e, t, n, r) {
20622
+ let i = [], a = Vd(t), o = 0;
20456
20623
  for (let t = 0; t < a.length; t++) {
20457
20624
  let s = a[t];
20458
20625
  if (o += 1, s.kind === "row") {
@@ -20460,35 +20627,35 @@ function Od(e, t, n, r) {
20460
20627
  e.lost = !0, Q(e, "Rows nested very deeply were left out.");
20461
20628
  continue;
20462
20629
  }
20463
- let t = Ad(e, s.item, `${n}-r${o}`, r + 1, !1);
20630
+ let t = Gd(e, s.item, `${n}-r${o}`, r + 1, !1);
20464
20631
  t && i.push(t);
20465
20632
  continue;
20466
20633
  }
20467
- if (wd.has(X(s.item.type))) {
20634
+ if (zd.has(Z(s.item.type))) {
20468
20635
  let r = [s.item];
20469
- for (; t + 1 < a.length && a[t + 1].kind === "el" && wd.has(X(a[t + 1].item.type));) r.push(a[t + 1].item), t += 1;
20470
- if (!Dd(e)) continue;
20471
- e.approx = !0, Q(e, "Separate form fields were grouped into one form. Check its button and where it sends messages."), i.push(Cd(e, `${n}-e${o}`, {}, r.map(Td), gd(e, r[0], "form field").styles, void 0));
20636
+ for (; t + 1 < a.length && a[t + 1].kind === "el" && zd.has(Z(a[t + 1].item.type));) r.push(a[t + 1].item), t += 1;
20637
+ if (!Hd(e)) continue;
20638
+ e.approx = !0, Q(e, "Separate form fields were grouped into one form. Check its button and where it sends messages."), i.push(Rd(e, `${n}-e${o}`, {}, r.map(Bd), jd(e, r[0], "form field").styles, void 0));
20472
20639
  continue;
20473
20640
  }
20474
- Dd(e, 2) && i.push(...bd(e, s.item, `${n}-e${o}`));
20641
+ Hd(e, 2) && i.push(...Fd(e, s.item, `${n}-e${o}`));
20475
20642
  }
20476
20643
  return i;
20477
20644
  }
20478
- var kd = (e) => {
20479
- let t = parseFloat(X(e));
20645
+ var Wd = (e) => {
20646
+ let t = parseFloat(Z(e));
20480
20647
  return Number.isFinite(t) && t > 0 ? t : 0;
20481
20648
  };
20482
- function Ad(e, t, n, r, i) {
20483
- if (!Dd(e, 3)) return null;
20484
- let { styles: a, responsive: o } = gd(e, {
20649
+ function Gd(e, t, n, r, i) {
20650
+ if (!Hd(e, 3)) return null;
20651
+ let { styles: a, responsive: o } = jd(e, {
20485
20652
  style: t.style,
20486
20653
  styleTablet: t.styleTablet,
20487
20654
  styleMobile: t.styleMobile
20488
- }, "row"), s = Y(t.columns, 12).filter(rd), c = a.gap ?? (s.length > 1 ? "16px" : void 0);
20655
+ }, "row"), s = X(t.columns, 12).filter(_d), c = a.gap ?? (s.length > 1 ? "16px" : void 0);
20489
20656
  delete a.gap;
20490
20657
  let l = s.map((t, i) => {
20491
- let a = `${n}-c${i + 1}`, { styles: o, responsive: s } = gd(e, {
20658
+ let a = `${n}-c${i + 1}`, { styles: o, responsive: s } = jd(e, {
20492
20659
  style: t.styles,
20493
20660
  styleTablet: t.stylesTablet,
20494
20661
  styleMobile: t.stylesMobile
@@ -20497,13 +20664,13 @@ function Ad(e, t, n, r, i) {
20497
20664
  cid: a,
20498
20665
  cs: o,
20499
20666
  cr: s,
20500
- children: Od(e, t, a, r)
20667
+ children: Ud(e, t, a, r)
20501
20668
  };
20502
20669
  }), u;
20503
20670
  if (l.length === 1) {
20504
20671
  let e = l[0];
20505
20672
  u = $(`${n}-body`, "container", "Content", {
20506
- ...vd,
20673
+ ...Nd,
20507
20674
  ...e.cs,
20508
20675
  width: "100%"
20509
20676
  }, {
@@ -20511,7 +20678,7 @@ function Ad(e, t, n, r, i) {
20511
20678
  ...e.cr ? { responsive: e.cr } : {}
20512
20679
  });
20513
20680
  } else {
20514
- let e = s.map((e) => kd(e.width)), t = e.reduce((e, t) => e + t, 0), r = l.map((n, r) => t > 0 && e[r] > 0 ? Math.round(e[r] / t * 1e3) / 10 : 100 / Math.max(1, l.length)).map((e) => `minmax(0, ${e}fr)`).join(" "), i = l.length <= 2 ? r : "minmax(0, 1fr) minmax(0, 1fr)";
20681
+ let e = s.map((e) => Wd(e.width)), t = e.reduce((e, t) => e + t, 0), r = l.map((n, r) => t > 0 && e[r] > 0 ? Math.round(e[r] / t * 1e3) / 10 : 100 / Math.max(1, l.length)).map((e) => `minmax(0, ${e}fr)`).join(" "), i = l.length <= 2 ? r : "minmax(0, 1fr) minmax(0, 1fr)";
20515
20682
  u = $(`${n}-cols`, "columns", "Columns", {
20516
20683
  layoutMode: "grid",
20517
20684
  display: "grid",
@@ -20525,7 +20692,7 @@ function Ad(e, t, n, r, i) {
20525
20692
  mobile: { gridTemplateColumns: "minmax(0, 1fr)" }
20526
20693
  },
20527
20694
  children: l.map((e) => $(e.cid, "column", "Column", {
20528
- ...vd,
20695
+ ...Nd,
20529
20696
  ...e.cs,
20530
20697
  width: "100%"
20531
20698
  }, {
@@ -20540,15 +20707,15 @@ function Ad(e, t, n, r, i) {
20540
20707
  marginLeft: "auto",
20541
20708
  marginRight: "auto"
20542
20709
  });
20543
- let d = X(t.htmlId).trim(), f = (function e(t) {
20710
+ let d = Z(t.htmlId).trim(), f = (function e(t) {
20544
20711
  for (let n of t) {
20545
20712
  if (n.type === "heading" && n.content) return n.content.split("\n")[0].slice(0, 40);
20546
20713
  let t = n.children ? e(n.children) : "";
20547
20714
  if (t) return t;
20548
20715
  }
20549
20716
  return "";
20550
- })(u.children ?? []), p = d && d.replace(/[-_]+/g, " ") || f || (i ? "Section" : "Row"), m = Ct(X(t.htmlClass)), h = {
20551
- ...vd,
20717
+ })(u.children ?? []), p = d && d.replace(/[-_]+/g, " ") || f || (i ? "Section" : "Row"), m = Ct(Z(t.htmlClass)), h = {
20718
+ ...Nd,
20552
20719
  ...a,
20553
20720
  ...m ? { customClasses: m } : {}
20554
20721
  };
@@ -20561,7 +20728,7 @@ function Ad(e, t, n, r, i) {
20561
20728
  ...o ? { responsive: o } : {}
20562
20729
  });
20563
20730
  }
20564
- var jd = (e, t = {}) => ({
20731
+ var Kd = (e, t = {}) => ({
20565
20732
  id: e.id ?? "v1-page",
20566
20733
  name: e.name ?? "Home",
20567
20734
  slug: e.slug ?? "home",
@@ -20574,7 +20741,7 @@ var jd = (e, t = {}) => ({
20574
20741
  children: []
20575
20742
  }
20576
20743
  });
20577
- function Md(e, t = {}) {
20744
+ function qd(e, t = {}) {
20578
20745
  let n = {
20579
20746
  warnings: [],
20580
20747
  seen: /* @__PURE__ */ new Set(),
@@ -20584,33 +20751,33 @@ function Md(e, t = {}) {
20584
20751
  capped: !1
20585
20752
  }, r = {};
20586
20753
  try {
20587
- let i = J(e), a = rd(i.body) ? i.body : null;
20754
+ let i = Y(e), a = _d(i.body) ? i.body : null;
20588
20755
  if (!a) return Q(n, "This doesn't look like a design from the old editor, so an empty page was made instead."), {
20589
- page: jd(t),
20756
+ page: Kd(t),
20590
20757
  warnings: n.warnings,
20591
20758
  fidelity: "partial",
20592
20759
  extras: r
20593
20760
  };
20594
- let o = J(a.style), { styles: s, unmapped: c } = pd(Object.fromEntries(Object.entries(o).filter(([e]) => ![
20761
+ let o = Y(a.style), { styles: s, unmapped: c } = Od(Object.fromEntries(Object.entries(o).filter(([e]) => ![
20595
20762
  "customJs",
20596
20763
  "customCss",
20597
20764
  "favicon",
20598
20765
  "contentMaxWidth"
20599
20766
  ].includes(e))));
20600
20767
  c.length && (n.approx = !0, Q(n, `Some page-wide styling (${c.slice(0, 4).join(", ")}) can't be carried over.`));
20601
- let l = X(o.customJs).trim();
20602
- l && (r.customJs = l), X(o.customCss).trim() && (n.approx = !0, Q(n, "The page's custom CSS can't be carried over; check the page's look.")), X(o.favicon).trim() && (n.approx = !0, Q(n, "Set the site icon again in the site settings."));
20603
- let u = jd(t, { ...s }), d = X(o.contentMaxWidth).trim();
20768
+ let l = Z(o.customJs).trim();
20769
+ l && (r.customJs = l), Z(o.customCss).trim() && (n.approx = !0, Q(n, "The page's custom CSS can't be carried over; check the page's look.")), Z(o.favicon).trim() && (n.approx = !0, Q(n, "Set the site icon again in the site settings."));
20770
+ let u = Kd(t, { ...s }), d = Z(o.contentMaxWidth).trim();
20604
20771
  u.rootNode.styles.layoutMode = "flow", u.rootNode.styles.display = "flex", u.rootNode.styles.flexDirection = "column";
20605
- let f = Y(a.rows, 200).filter(rd), p = [];
20772
+ let f = X(a.rows, 200).filter(_d), p = [];
20606
20773
  if (f.forEach((e, t) => {
20607
- let r = Ad(n, e, `v1-s${t + 1}`, 0, !0);
20774
+ let r = Gd(n, e, `v1-s${t + 1}`, 0, !0);
20608
20775
  r && p.push(r);
20609
20776
  }), d && d !== "1200px") {
20610
- let e = d.toLowerCase() === "none" ? "100%" : sd(d);
20777
+ let e = d.toLowerCase() === "none" ? "100%" : Sd(d);
20611
20778
  if (e) for (let t of p) for (let n of t.children ?? []) n.styles.maxWidth = e;
20612
20779
  }
20613
- u.rootNode.children = p, Nd(u.rootNode) > 40 && (n.lost = !0, Q(n, "Rows nested too deeply were left out."), u.rootNode.children = p.map((e) => Pd(e, 0)));
20780
+ u.rootNode.children = p, Jd(u.rootNode) > 40 && (n.lost = !0, Q(n, "Rows nested too deeply were left out."), u.rootNode.children = p.map((e) => Yd(e, 0)));
20614
20781
  let m = n.lost ? "partial" : n.approx ? "approximate" : "exact";
20615
20782
  return {
20616
20783
  page: u,
@@ -20620,26 +20787,26 @@ function Md(e, t = {}) {
20620
20787
  };
20621
20788
  } catch {
20622
20789
  return {
20623
- page: jd(t),
20790
+ page: Kd(t),
20624
20791
  warnings: [...n.warnings, "This design could not be read, so an empty page was made instead."],
20625
20792
  fidelity: "partial",
20626
20793
  extras: r
20627
20794
  };
20628
20795
  }
20629
20796
  }
20630
- function Nd(e) {
20797
+ function Jd(e) {
20631
20798
  let t = 0;
20632
- for (let n of e.children ?? []) t = Math.max(t, Nd(n));
20799
+ for (let n of e.children ?? []) t = Math.max(t, Jd(n));
20633
20800
  return t + 1;
20634
20801
  }
20635
- function Pd(e, t) {
20802
+ function Yd(e, t) {
20636
20803
  return t >= 38 ? {
20637
20804
  ...e,
20638
20805
  children: []
20639
20806
  } : {
20640
20807
  ...e,
20641
- children: e.children?.map((e) => Pd(e, t + 1))
20808
+ children: e.children?.map((e) => Yd(e, t + 1))
20642
20809
  };
20643
20810
  }
20644
20811
  //#endregion
20645
- export { us as $, na as $t, pc as A, ve as An, Aa as At, Ks as B, la as Bt, al as C, Pe as Cn, co as Ct, Pc as D, xe as Dn, Pa as Dt, Wc as E, he as En, Ua as Et, dc as F, de as Fn, ba as Ft, ic as G, oa as Gt, Hs as H, ra as Ht, xs as I, ue as In, da as It, ys as J, pa as Jt, bs as K, ya as Kt, Ss as L, k as Ln, aa as Lt, hc as M, _e as Mn, ja as Mt, mc as N, fe as Nn, Ea as Nt, Fc as O, ye as On, Sa as Ot, fc as P, pe as Pn, Oa as Pt, $o as Q, sa as Qt, oc as R, H as Rt, ol as S, Me as Sn, Ya as St, rl as T, we as Tn, Ra as Tt, uc as U, ia as Ut, rc as V, Fi as Vt, sc as W, fa as Wt, vs as X, $i as Xt, ms as Y, ca as Yt, ps as Z, ea as Zt, Cl as _, Ae as _n, lo as _t, Vu as a, Xt as an, Go as at, dl as b, Ie as bn, Ja as bt, Bu as c, Dt as cn, go as ct, Vl as d, zt as dn, oo as dt, ta as en, ts as et, Hl as f, Ot as fn, so as ft, wl as g, ke as gn, to as gt, Al as h, ut as hn, io as ht, Hu as i, Oi as in, Yo as it, gc as j, Se as jn, wa as jt, Nc as k, ge as kn, Ma as kt, Yl as l, Rt as ln, ho as lt, Ol as m, ct as mn, no as mt, ed as n, ki as nn, Qo as nt, Qu as o, Yt as on, So as ot, zl as p, wt as pn, Za as pt, fs as q, Yi as qt, Md as r, V as rn, Zo as rt, pu as s, qt as sn, bo as st, $u as t, ha as tn, cs as tt, Wl as u, Lt as un, mo as ut, xl as v, Le as vn, ao as vt, il as w, De as wn, La as wt, cl as x, Fe as xn, ro as xt, ul as y, je as yn, $a as yt, nc as z, Ji as zt };
20812
+ export { ws as $, sa as $t, Dc as A, ge as An, Ma as At, oc as B, Ji as Bt, yl as C, Me as Cn, Ya as Ct, Jc as D, he as Dn, Ua as Dt, il as E, we as En, Ra as Et, Tc as F, pe as Fn, Oa as Ft, vc as G, fa as Gt, nc as H, Fi as Ht, Fs as I, de as In, ba as It, Ns as J, Yi as Jt, Ps as K, oa as Kt, Is as L, ue as Ln, da as Lt, kc as M, Se as Mn, wa as Mt, Oc as N, _e as Nn, ja as Nt, Yc as O, xe as On, Pa as Ot, Ec as P, fe as Pn, Ea as Pt, ps as Q, ea as Qt, bc as R, k as Rn, aa as Rt, bl as S, Fe as Sn, ro as St, _l as T, De as Tn, La as Tt, wc as U, ra as Ut, _c as V, la as Vt, xc as W, ia as Wt, Ms as X, ca as Xt, Os as Y, pa as Yt, Ds as Z, $i as Zt, Ll as _, ke as _n, to as _t, td as a, Oi as an, ls as at, Tl as b, je as bn, $a as bt, ed as c, qt as cn, To as ct, tu as d, Lt as dn, go as dt, na as en, hs as et, nu as f, zt as fn, oo as ft, Rl as g, ut as gn, io as gt, Wl as h, ct as hn, no as ht, nd as i, V as in, as as it, Ac as j, ve as jn, Aa as jt, qc as k, ye as kn, Sa as kt, lu as l, Dt as ln, vo as lt, Hl as m, wt as mn, Za as mt, md as n, ha as nn, fs as nt, fd as o, Xt as on, ts as ot, $l as p, Ot as pn, so as pt, Es as q, ya as qt, qd as r, ki as rn, ds as rt, Du as s, Yt as sn, Do as st, pd as t, ta as tn, Ss as tt, iu as u, Rt as un, _o as ut, Fl as v, Ae as vn, lo as vt, vl as w, Pe as wn, co as wt, Sl as x, Ie as xn, Ja as xt, wl as y, Le as yn, ao as yt, gc as z, H as zt };