@charisol/plexo-sdk 2.0.7 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{v1-iodIbfkY.js → v1-BCCIC3DR.js} +651 -586
- package/dist/v2/components/layout/TopToolbar.d.ts +2 -0
- package/dist/v2/render/nodeStyle.d.ts +8 -0
- package/dist/v2/types/editor.d.ts +6 -0
- package/dist/v2-compile.js +1 -1
- package/dist/v2.js +1209 -1072
- package/package.json +1 -1
|
@@ -13469,45 +13469,45 @@ function $a(e) {
|
|
|
13469
13469
|
var V = (e) => ({
|
|
13470
13470
|
ok: !1,
|
|
13471
13471
|
message: e
|
|
13472
|
-
}),
|
|
13472
|
+
}), eo = (e, t) => ({
|
|
13473
13473
|
ok: !0,
|
|
13474
13474
|
message: e,
|
|
13475
13475
|
...t ? { sectionId: t } : {}
|
|
13476
|
-
}),
|
|
13476
|
+
}), to = () => yi.map((e) => e.kind).join(", "), no = (e) => e.type === "section", ro = (e, t) => e.find((e) => e.id === t) ?? e.find((e) => e.name.trim().toLowerCase() === t.trim().toLowerCase()), io = (e, t) => {
|
|
13477
13477
|
for (let n of e) {
|
|
13478
|
-
let e = (n.rootNode.children ?? []).findIndex((e) => e.id === t &&
|
|
13478
|
+
let e = (n.rootNode.children ?? []).findIndex((e) => e.id === t && no(e));
|
|
13479
13479
|
if (e >= 0) return {
|
|
13480
13480
|
page: n,
|
|
13481
13481
|
index: e
|
|
13482
13482
|
};
|
|
13483
13483
|
}
|
|
13484
13484
|
return null;
|
|
13485
|
-
},
|
|
13485
|
+
}, ao = (e, t, n) => e.map((e) => e.id === t ? {
|
|
13486
13486
|
...e,
|
|
13487
13487
|
rootNode: {
|
|
13488
13488
|
...e.rootNode,
|
|
13489
13489
|
children: n
|
|
13490
13490
|
}
|
|
13491
|
-
} : e),
|
|
13491
|
+
} : e), H = (e) => e.rootNode.children ?? [], oo = (e) => V(`I couldn't find a section called "${e}". It may have been removed already.`), so = (e) => {
|
|
13492
13492
|
let t = R(e);
|
|
13493
13493
|
return t && xi(t.kind) ? L(t.kind).label : e.name || "section";
|
|
13494
13494
|
};
|
|
13495
|
-
function
|
|
13495
|
+
function co(e, t, n) {
|
|
13496
13496
|
if (t.afterSectionId !== void 0) {
|
|
13497
13497
|
let n = e.findIndex((e) => e.id === t.afterSectionId);
|
|
13498
13498
|
return n < 0 ? { error: `I couldn't find the section to place it after ("${t.afterSectionId}").` } : { index: n + 1 };
|
|
13499
13499
|
}
|
|
13500
13500
|
return t.index === void 0 ? { index: n } : { index: Math.min(t.index, e.length) };
|
|
13501
13501
|
}
|
|
13502
|
-
var
|
|
13503
|
-
function
|
|
13502
|
+
var lo = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "page";
|
|
13503
|
+
function uo(e) {
|
|
13504
13504
|
return {
|
|
13505
13505
|
...e,
|
|
13506
13506
|
id: T("node"),
|
|
13507
|
-
children: e.children?.map(
|
|
13507
|
+
children: e.children?.map(uo)
|
|
13508
13508
|
};
|
|
13509
13509
|
}
|
|
13510
|
-
var
|
|
13510
|
+
var fo = (e, t) => {
|
|
13511
13511
|
let [n, ...r] = t, i = e.find((e) => e.key === n);
|
|
13512
13512
|
return i ? r.length ? i.type === "list" && /^\d+$/.test(r[0]) ? r.length === 1 ? {
|
|
13513
13513
|
...i,
|
|
@@ -13517,9 +13517,9 @@ var uo = (e, t) => {
|
|
|
13517
13517
|
itemName: i.itemName,
|
|
13518
13518
|
label: i.itemName ?? i.label,
|
|
13519
13519
|
limit: -1
|
|
13520
|
-
} :
|
|
13521
|
-
},
|
|
13522
|
-
function
|
|
13520
|
+
} : fo(i.item ?? [], r.slice(1)) : null : i : null;
|
|
13521
|
+
}, po = (e) => !!e && typeof e == "object" && !Array.isArray(e);
|
|
13522
|
+
function mo(e, t, n) {
|
|
13523
13523
|
switch (e.type) {
|
|
13524
13524
|
case "text":
|
|
13525
13525
|
case "longtext":
|
|
@@ -13532,53 +13532,53 @@ function po(e, t, n) {
|
|
|
13532
13532
|
return typeof t == "string" && (!r.length || r.includes(t)) ? null : `"${n}" should be one of: ${r.join(", ")}.`;
|
|
13533
13533
|
}
|
|
13534
13534
|
case "button":
|
|
13535
|
-
if (!
|
|
13535
|
+
if (!po(t)) return `"${n}" should be a button with a label and a link.`;
|
|
13536
13536
|
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.`;
|
|
13537
13537
|
return null;
|
|
13538
13538
|
case "list":
|
|
13539
13539
|
if (!Array.isArray(t)) return `"${n}" should be a list.`;
|
|
13540
13540
|
if (e.limit && e.limit > 0 && t.length > e.limit) return `"${n}" can have at most ${e.limit} ${e.itemName ?? "item"}s.`;
|
|
13541
13541
|
for (let [r, i] of t.entries()) {
|
|
13542
|
-
let t =
|
|
13542
|
+
let t = ho(e.item ?? [], i, `${n} ${r + 1}`);
|
|
13543
13543
|
if (t) return t;
|
|
13544
13544
|
}
|
|
13545
13545
|
return null;
|
|
13546
13546
|
}
|
|
13547
13547
|
}
|
|
13548
|
-
function
|
|
13549
|
-
if (!
|
|
13548
|
+
function ho(e, t, n) {
|
|
13549
|
+
if (!po(t)) return `${n} should be a group of fields.`;
|
|
13550
13550
|
for (let [r, i] of Object.entries(t)) {
|
|
13551
13551
|
let t = e.find((e) => e.key === r);
|
|
13552
13552
|
if (!t) return `${n} has a field "${r}" that doesn't exist. Available: ${e.map((e) => e.key).join(", ")}.`;
|
|
13553
|
-
let a =
|
|
13553
|
+
let a = mo(t, i, `${n} ${t.label.toLowerCase()}`);
|
|
13554
13554
|
if (a) return a;
|
|
13555
13555
|
}
|
|
13556
13556
|
return null;
|
|
13557
13557
|
}
|
|
13558
|
-
function
|
|
13558
|
+
function go(e, t) {
|
|
13559
13559
|
let n = L(e);
|
|
13560
13560
|
for (let [e, r] of Object.entries(t)) {
|
|
13561
|
-
let t =
|
|
13561
|
+
let t = fo(n.fields, e.split(".").filter(Boolean));
|
|
13562
13562
|
if (!t) return `A ${n.label.toLowerCase()} section has no "${e}" field. The fields are: ${n.fields.map((e) => e.key).join(", ")}.`;
|
|
13563
13563
|
if (t.limit === -1) {
|
|
13564
|
-
let e =
|
|
13564
|
+
let e = ho(t.item ?? [], r, t.label);
|
|
13565
13565
|
if (e) return e;
|
|
13566
13566
|
continue;
|
|
13567
13567
|
}
|
|
13568
|
-
let i =
|
|
13568
|
+
let i = mo(t, r, t.label);
|
|
13569
13569
|
if (i) return i;
|
|
13570
13570
|
}
|
|
13571
13571
|
return null;
|
|
13572
13572
|
}
|
|
13573
|
-
var
|
|
13573
|
+
var _o = (e, t) => Object.entries(t).reduce((e, [t, n]) => Vi(e, t, n), e), vo = [
|
|
13574
13574
|
"primaryColor",
|
|
13575
13575
|
"secondaryColor",
|
|
13576
13576
|
"headingFont",
|
|
13577
13577
|
"bodyFont",
|
|
13578
13578
|
"neutrals",
|
|
13579
13579
|
"roundness"
|
|
13580
|
-
],
|
|
13581
|
-
function
|
|
13580
|
+
], yo = (e) => new Set(oe(e).map((e) => `${e.kind}:${e.key}`));
|
|
13581
|
+
function bo(e, t) {
|
|
13582
13582
|
let n = e, r = [];
|
|
13583
13583
|
for (let [i, a] of Object.entries(t)) {
|
|
13584
13584
|
let t = String(a).trim();
|
|
@@ -13626,7 +13626,7 @@ function yo(e, t) {
|
|
|
13626
13626
|
default: {
|
|
13627
13627
|
if (!i.startsWith("--")) return {
|
|
13628
13628
|
ds: e,
|
|
13629
|
-
result: V(`I don't know the brand setting "${i}". I can change: ${
|
|
13629
|
+
result: V(`I don't know the brand setting "${i}". I can change: ${vo.join(", ")}.`)
|
|
13630
13630
|
};
|
|
13631
13631
|
let a = ae(n, i);
|
|
13632
13632
|
if (!a) return {
|
|
@@ -13641,16 +13641,16 @@ function yo(e, t) {
|
|
|
13641
13641
|
ds: e,
|
|
13642
13642
|
result: V("There was nothing to change in the brand.")
|
|
13643
13643
|
};
|
|
13644
|
-
let i =
|
|
13644
|
+
let i = yo(e), a = oe(n).filter((e) => !i.has(`${e.kind}:${e.key}`));
|
|
13645
13645
|
return a.length ? {
|
|
13646
13646
|
ds: e,
|
|
13647
13647
|
result: V(`That brand change wouldn't work: ${a[0].message}`)
|
|
13648
13648
|
} : {
|
|
13649
13649
|
ds: re(n),
|
|
13650
|
-
result:
|
|
13650
|
+
result: eo(`Updated the brand (${r.join(", ")}).`)
|
|
13651
13651
|
};
|
|
13652
13652
|
}
|
|
13653
|
-
function
|
|
13653
|
+
function xo(e, t, n, r) {
|
|
13654
13654
|
let i = (n) => ({
|
|
13655
13655
|
pages: e,
|
|
13656
13656
|
ds: t,
|
|
@@ -13658,23 +13658,23 @@ function bo(e, t, n, r) {
|
|
|
13658
13658
|
});
|
|
13659
13659
|
switch (n.op) {
|
|
13660
13660
|
case "addSection": {
|
|
13661
|
-
let r =
|
|
13661
|
+
let r = ro(e, n.pageId);
|
|
13662
13662
|
if (!r) return i(V(`I couldn't find a page called "${n.pageId}".`));
|
|
13663
|
-
if (!xi(n.kind)) return i(V(`I don't know a "${n.kind}" section. The ones I can add are: ${
|
|
13663
|
+
if (!xi(n.kind)) return i(V(`I don't know a "${n.kind}" section. The ones I can add are: ${to()}.`));
|
|
13664
13664
|
let a = L(n.kind);
|
|
13665
13665
|
if (n.variant && !a.variants.some((e) => e.id === n.variant)) return i(V(`A ${a.label.toLowerCase()} section doesn't have a "${n.variant}" layout. Choose from: ${a.variants.map((e) => e.id).join(", ")}.`));
|
|
13666
13666
|
if (n.content) {
|
|
13667
|
-
let e =
|
|
13667
|
+
let e = go(n.kind, n.content);
|
|
13668
13668
|
if (e) return i(V(e));
|
|
13669
13669
|
}
|
|
13670
13670
|
let o = Ti(n.kind, n.variant), s = {
|
|
13671
13671
|
...o,
|
|
13672
|
-
content: n.content ?
|
|
13672
|
+
content: n.content ? _o(o.content, n.content) : o.content,
|
|
13673
13673
|
style: {
|
|
13674
13674
|
...o.style,
|
|
13675
13675
|
...n.style
|
|
13676
13676
|
}
|
|
13677
|
-
}, c =
|
|
13677
|
+
}, c = H(r), l = new Set(e.flatMap((e) => H(e).map((e) => e.id))), u = n.id && /^[A-Za-z0-9_-]{1,40}$/.test(n.id) && !l.has(n.id) ? n.id : T("section"), d = co(c, n, n.kind === "header" ? 0 : n.kind !== "footer" && c[c.length - 1] && R(c[c.length - 1])?.kind === "footer" ? c.length - 1 : c.length);
|
|
13678
13678
|
if ("error" in d) return i(V(d.error));
|
|
13679
13679
|
let f = [
|
|
13680
13680
|
...c.slice(0, d.index),
|
|
@@ -13682,21 +13682,21 @@ function bo(e, t, n, r) {
|
|
|
13682
13682
|
...c.slice(d.index)
|
|
13683
13683
|
];
|
|
13684
13684
|
return {
|
|
13685
|
-
pages:
|
|
13685
|
+
pages: ao(e, r.id, f),
|
|
13686
13686
|
ds: t,
|
|
13687
|
-
result:
|
|
13687
|
+
result: eo(`Added a ${a.label.toLowerCase()} section to ${r.name}.`, u)
|
|
13688
13688
|
};
|
|
13689
13689
|
}
|
|
13690
13690
|
case "updateSection": {
|
|
13691
|
-
let r =
|
|
13692
|
-
if (!r) return i(
|
|
13693
|
-
let a =
|
|
13691
|
+
let r = io(e, n.sectionId);
|
|
13692
|
+
if (!r) return i(oo(n.sectionId));
|
|
13693
|
+
let a = H(r.page)[r.index], o = R(a);
|
|
13694
13694
|
if (!o) return i(V("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."));
|
|
13695
13695
|
if (n.content === void 0 && n.variant === void 0 && n.style === void 0) return i(V("There was nothing to change in that section."));
|
|
13696
13696
|
let s = L(o.kind);
|
|
13697
13697
|
if (n.variant && !s.variants.some((e) => e.id === n.variant)) return i(V(`A ${s.label.toLowerCase()} section doesn't have a "${n.variant}" layout. Choose from: ${s.variants.map((e) => e.id).join(", ")}.`));
|
|
13698
13698
|
if (n.content) {
|
|
13699
|
-
let e =
|
|
13699
|
+
let e = go(o.kind, n.content);
|
|
13700
13700
|
if (e) return i(V(e));
|
|
13701
13701
|
}
|
|
13702
13702
|
let c = a;
|
|
@@ -13704,34 +13704,34 @@ function bo(e, t, n, r) {
|
|
|
13704
13704
|
let e = R(c);
|
|
13705
13705
|
c = z(c, {
|
|
13706
13706
|
...e,
|
|
13707
|
-
content:
|
|
13707
|
+
content: _o(e.content, n.content)
|
|
13708
13708
|
});
|
|
13709
13709
|
}
|
|
13710
13710
|
n.style && (c = Gi(c, n.style));
|
|
13711
|
-
let l =
|
|
13711
|
+
let l = H(r.page).map((e, t) => t === r.index ? c : e);
|
|
13712
13712
|
return {
|
|
13713
|
-
pages:
|
|
13713
|
+
pages: ao(e, r.page.id, l),
|
|
13714
13714
|
ds: t,
|
|
13715
|
-
result:
|
|
13715
|
+
result: eo(`Updated the ${s.label.toLowerCase()} section on ${r.page.name}.`, a.id)
|
|
13716
13716
|
};
|
|
13717
13717
|
}
|
|
13718
13718
|
case "removeSection": {
|
|
13719
|
-
let r =
|
|
13720
|
-
if (!r) return i(
|
|
13721
|
-
let a =
|
|
13719
|
+
let r = io(e, n.sectionId);
|
|
13720
|
+
if (!r) return i(oo(n.sectionId));
|
|
13721
|
+
let a = H(r.page)[r.index];
|
|
13722
13722
|
return {
|
|
13723
|
-
pages:
|
|
13723
|
+
pages: ao(e, r.page.id, H(r.page).filter((e, t) => t !== r.index)),
|
|
13724
13724
|
ds: t,
|
|
13725
|
-
result:
|
|
13725
|
+
result: eo(`Removed the ${so(a).toLowerCase()} section from ${r.page.name}.`)
|
|
13726
13726
|
};
|
|
13727
13727
|
}
|
|
13728
13728
|
case "moveSection": {
|
|
13729
|
-
let r =
|
|
13730
|
-
if (!r) return i(
|
|
13729
|
+
let r = io(e, n.sectionId);
|
|
13730
|
+
if (!r) return i(oo(n.sectionId));
|
|
13731
13731
|
if (n.index === void 0 && n.afterSectionId === void 0) return i(V("I need to know where to move it to."));
|
|
13732
|
-
let a =
|
|
13732
|
+
let a = H(r.page)[r.index];
|
|
13733
13733
|
if (n.afterSectionId === n.sectionId) return i(V("A section can't be moved after itself."));
|
|
13734
|
-
let o =
|
|
13734
|
+
let o = H(r.page).filter((e, t) => t !== r.index), s = co(o, n, o.length);
|
|
13735
13735
|
if ("error" in s) return i(V(s.error));
|
|
13736
13736
|
let c = [
|
|
13737
13737
|
...o.slice(0, s.index),
|
|
@@ -13739,30 +13739,30 @@ function bo(e, t, n, r) {
|
|
|
13739
13739
|
...o.slice(s.index)
|
|
13740
13740
|
];
|
|
13741
13741
|
return {
|
|
13742
|
-
pages:
|
|
13742
|
+
pages: ao(e, r.page.id, c),
|
|
13743
13743
|
ds: t,
|
|
13744
|
-
result:
|
|
13744
|
+
result: eo(`Moved the ${so(a).toLowerCase()} section on ${r.page.name}.`, a.id)
|
|
13745
13745
|
};
|
|
13746
13746
|
}
|
|
13747
13747
|
case "duplicateSection": {
|
|
13748
|
-
let r =
|
|
13749
|
-
if (!r) return i(
|
|
13750
|
-
let a =
|
|
13751
|
-
...
|
|
13748
|
+
let r = io(e, n.sectionId);
|
|
13749
|
+
if (!r) return i(oo(n.sectionId));
|
|
13750
|
+
let a = H(r.page), o = a[r.index], s = T("section"), c = R(o), l = c ? Ri(c, s) : {
|
|
13751
|
+
...uo(o),
|
|
13752
13752
|
id: s
|
|
13753
13753
|
};
|
|
13754
13754
|
return {
|
|
13755
|
-
pages:
|
|
13755
|
+
pages: ao(e, r.page.id, [
|
|
13756
13756
|
...a.slice(0, r.index + 1),
|
|
13757
13757
|
l,
|
|
13758
13758
|
...a.slice(r.index + 1)
|
|
13759
13759
|
]),
|
|
13760
13760
|
ds: t,
|
|
13761
|
-
result:
|
|
13761
|
+
result: eo(`Copied the ${so(o).toLowerCase()} section on ${r.page.name}.`, s)
|
|
13762
13762
|
};
|
|
13763
13763
|
}
|
|
13764
13764
|
case "setBrand": {
|
|
13765
|
-
let r =
|
|
13765
|
+
let r = bo(t, n.tokens);
|
|
13766
13766
|
return {
|
|
13767
13767
|
pages: e,
|
|
13768
13768
|
ds: r.ds,
|
|
@@ -13783,7 +13783,7 @@ function bo(e, t, n, r) {
|
|
|
13783
13783
|
}
|
|
13784
13784
|
e ? o = e : s = ` (I couldn't find the "${n.templateId}" starting layout, so it's blank.)`;
|
|
13785
13785
|
}
|
|
13786
|
-
let c = new Set(e.map((e) => e.slug)), l =
|
|
13786
|
+
let c = new Set(e.map((e) => e.slug)), l = lo(a), u = l;
|
|
13787
13787
|
for (let e = 2; c.has(u); e++) u = `${l}-${e}`;
|
|
13788
13788
|
let d = qa()[0], f = {
|
|
13789
13789
|
id: T("page"),
|
|
@@ -13798,11 +13798,11 @@ function bo(e, t, n, r) {
|
|
|
13798
13798
|
return {
|
|
13799
13799
|
pages: [...e, f],
|
|
13800
13800
|
ds: t,
|
|
13801
|
-
result:
|
|
13801
|
+
result: eo(`Added a new page called ${a}.${s}`)
|
|
13802
13802
|
};
|
|
13803
13803
|
}
|
|
13804
13804
|
case "renamePage": {
|
|
13805
|
-
let r =
|
|
13805
|
+
let r = ro(e, n.pageId);
|
|
13806
13806
|
if (!r) return i(V(`I couldn't find a page called "${n.pageId}".`));
|
|
13807
13807
|
let a = n.name.trim();
|
|
13808
13808
|
return e.some((e) => e.id !== r.id && e.name.trim().toLowerCase() === a.toLowerCase()) ? i(V(`There's already a page called "${a}".`)) : {
|
|
@@ -13811,22 +13811,22 @@ function bo(e, t, n, r) {
|
|
|
13811
13811
|
name: a
|
|
13812
13812
|
} : e),
|
|
13813
13813
|
ds: t,
|
|
13814
|
-
result:
|
|
13814
|
+
result: eo(`Renamed ${r.name} to ${a}.`)
|
|
13815
13815
|
};
|
|
13816
13816
|
}
|
|
13817
13817
|
}
|
|
13818
13818
|
}
|
|
13819
|
-
function
|
|
13819
|
+
function So(e, t, n, r = {}) {
|
|
13820
13820
|
let i = e, a = t, o = [];
|
|
13821
13821
|
for (let e of Array.isArray(n) ? n : []) {
|
|
13822
13822
|
let t = Za.safeParse(e);
|
|
13823
13823
|
if (!t.success) {
|
|
13824
|
-
let t =
|
|
13824
|
+
let t = po(e) && typeof e.op == "string" ? e.op : "";
|
|
13825
13825
|
o.push(V(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."));
|
|
13826
13826
|
continue;
|
|
13827
13827
|
}
|
|
13828
13828
|
try {
|
|
13829
|
-
let e =
|
|
13829
|
+
let e = xo(i, a, t.data, r);
|
|
13830
13830
|
i = e.pages, a = e.ds, o.push(e.result);
|
|
13831
13831
|
} catch {
|
|
13832
13832
|
o.push(V("Something went wrong with one of the changes, so I skipped it."));
|
|
@@ -13840,8 +13840,8 @@ function xo(e, t, n, r = {}) {
|
|
|
13840
13840
|
}
|
|
13841
13841
|
//#endregion
|
|
13842
13842
|
//#region src/v2/sol/parse.ts
|
|
13843
|
-
var
|
|
13844
|
-
function
|
|
13843
|
+
var Co = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*?)```/i, wo = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*)$/i;
|
|
13844
|
+
function To(e) {
|
|
13845
13845
|
let t = "", n = !1;
|
|
13846
13846
|
for (let r = 0; r < e.length; r++) {
|
|
13847
13847
|
let i = e[r];
|
|
@@ -13866,15 +13866,15 @@ function wo(e) {
|
|
|
13866
13866
|
}
|
|
13867
13867
|
return t;
|
|
13868
13868
|
}
|
|
13869
|
-
function
|
|
13870
|
-
let t =
|
|
13869
|
+
function Eo(e) {
|
|
13870
|
+
let t = Co.exec(e), n = t ? null : wo.exec(e), r = t ?? n;
|
|
13871
13871
|
if (!r) return {
|
|
13872
13872
|
text: e.trim(),
|
|
13873
13873
|
commands: null
|
|
13874
13874
|
};
|
|
13875
13875
|
let i = e.replace(r[0], "").replace(/\n{3,}/g, "\n\n").trim(), a;
|
|
13876
13876
|
try {
|
|
13877
|
-
a = JSON.parse(
|
|
13877
|
+
a = JSON.parse(To(r[1].trim()));
|
|
13878
13878
|
} catch {
|
|
13879
13879
|
return {
|
|
13880
13880
|
text: i,
|
|
@@ -13906,7 +13906,7 @@ function To(e) {
|
|
|
13906
13906
|
}
|
|
13907
13907
|
//#endregion
|
|
13908
13908
|
//#region src/v2/sol/summarize.ts
|
|
13909
|
-
var
|
|
13909
|
+
var Do = {
|
|
13910
13910
|
primaryColor: "main colour",
|
|
13911
13911
|
secondaryColor: "second colour",
|
|
13912
13912
|
headingFont: "heading font",
|
|
@@ -13914,7 +13914,7 @@ var Eo = {
|
|
|
13914
13914
|
neutrals: "background feel",
|
|
13915
13915
|
roundness: "corner roundness"
|
|
13916
13916
|
};
|
|
13917
|
-
function
|
|
13917
|
+
function Oo(e, t) {
|
|
13918
13918
|
let n = (e) => t.find((t) => t.id === e || t.name.toLowerCase() === e.toLowerCase()), r = (e) => {
|
|
13919
13919
|
for (let n of t) {
|
|
13920
13920
|
let t = (n.rootNode.children ?? []).find((t) => t.id === e);
|
|
@@ -13941,22 +13941,22 @@ function Do(e, t) {
|
|
|
13941
13941
|
case "removeSection": return `Remove ${i(e.sectionId)}${a(e.sectionId)}`;
|
|
13942
13942
|
case "moveSection": return `Move ${i(e.sectionId)}${a(e.sectionId)}`;
|
|
13943
13943
|
case "duplicateSection": return `Make a copy of ${i(e.sectionId)}${a(e.sectionId)}`;
|
|
13944
|
-
case "setBrand": return `Update the brand (${Object.keys(e.tokens).map((e) =>
|
|
13944
|
+
case "setBrand": return `Update the brand (${Object.keys(e.tokens).map((e) => Do[e] ?? "a brand setting").join(", ")})`;
|
|
13945
13945
|
case "addPage": return `Add a new page called "${e.name}"`;
|
|
13946
13946
|
case "renamePage": return `Rename ${n(e.pageId)?.name ?? "a page"} to "${e.name}"`;
|
|
13947
13947
|
}
|
|
13948
13948
|
}
|
|
13949
13949
|
//#endregion
|
|
13950
13950
|
//#region src/v2/sol/prompt.ts
|
|
13951
|
-
var
|
|
13952
|
-
function
|
|
13951
|
+
var ko = "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.", Ao = 16;
|
|
13952
|
+
function jo(e, t, n = 0) {
|
|
13953
13953
|
return n > 12 ? e : e.replace(/var\(\s*(--[A-Za-z0-9_-]+)\s*(?:,\s*((?:[^()]|\([^()]*\))*))?\)/g, (e, r, i) => {
|
|
13954
13954
|
let a = t.get(r);
|
|
13955
|
-
return a ?
|
|
13955
|
+
return a ? jo(ie(a), t, n + 1) : i === void 0 ? "NaN" : jo(i.trim(), t, n + 1);
|
|
13956
13956
|
});
|
|
13957
13957
|
}
|
|
13958
|
-
function
|
|
13959
|
-
let n =
|
|
13958
|
+
function Mo(e, t) {
|
|
13959
|
+
let n = jo(e.trim(), t.tokens ?? /* @__PURE__ */ new Map()), r = 0, i = () => {
|
|
13960
13960
|
for (; r < n.length && /\s/.test(n[r]);) r += 1;
|
|
13961
13961
|
}, a = () => {
|
|
13962
13962
|
throw Error("bad");
|
|
@@ -14045,57 +14045,57 @@ function jo(e, t) {
|
|
|
14045
14045
|
return null;
|
|
14046
14046
|
}
|
|
14047
14047
|
}
|
|
14048
|
-
var
|
|
14048
|
+
var No = {
|
|
14049
14049
|
tablet: .8,
|
|
14050
14050
|
mobile: .6
|
|
14051
|
-
},
|
|
14052
|
-
function Po(e, t) {
|
|
14053
|
-
return t === "desktop" || e.responsive?.tablet?.fontSize !== void 0 ? !1 : t === "tablet" || e.responsive?.mobile?.fontSize === void 0;
|
|
14054
|
-
}
|
|
14051
|
+
}, Po = 40;
|
|
14055
14052
|
function Fo(e, t) {
|
|
14056
|
-
return e
|
|
14053
|
+
return t === "desktop" || e.responsive?.tablet?.fontSize !== void 0 ? !1 : t === "tablet" || e.responsive?.mobile?.fontSize === void 0;
|
|
14057
14054
|
}
|
|
14058
14055
|
function Io(e, t) {
|
|
14056
|
+
return e <= Po ? e : Math.max(Po, e * No[t]);
|
|
14057
|
+
}
|
|
14058
|
+
function Lo(e, t) {
|
|
14059
14059
|
let n = e.trim(), r = /^(\d*\.?\d+)(px|rem)$/i.exec(n);
|
|
14060
14060
|
if (r) {
|
|
14061
14061
|
let e = parseFloat(r[1]) * (r[2].toLowerCase() === "rem" ? 16 : 1);
|
|
14062
|
-
if (e <=
|
|
14063
|
-
let i =
|
|
14062
|
+
if (e <= Po) return n;
|
|
14063
|
+
let i = Io(e, t);
|
|
14064
14064
|
return r[2].toLowerCase() === "rem" ? `${Math.round(i / 16 * 1e3) / 1e3}rem` : `${Math.round(i * 10) / 10}px`;
|
|
14065
14065
|
}
|
|
14066
|
-
return /^(?:var|calc|clamp|min|max)\(/i.test(n) && n.length < 300 ? `max(min(${n}, ${
|
|
14066
|
+
return /^(?:var|calc|clamp|min|max)\(/i.test(n) && n.length < 300 ? `max(min(${n}, ${Po}px), calc(${n} * ${No[t]}))` : n;
|
|
14067
14067
|
}
|
|
14068
|
-
var
|
|
14069
|
-
function
|
|
14068
|
+
var Ro = (e, t = 10) => Math.round(e * t) / t;
|
|
14069
|
+
function zo(e, t) {
|
|
14070
14070
|
return Ee(t.textStyle) ? t.textStyle : e.type === "heading" ? je(e.props?.level) : null;
|
|
14071
14071
|
}
|
|
14072
|
-
function
|
|
14073
|
-
return e ?
|
|
14072
|
+
function Bo(e, t) {
|
|
14073
|
+
return e ? Mo(/^-?[\d.]+$/.test(e.trim()) ? `${e.trim()}px` : e, {
|
|
14074
14074
|
...t,
|
|
14075
14075
|
tokens: t.tokens
|
|
14076
14076
|
}) : null;
|
|
14077
14077
|
}
|
|
14078
|
-
function
|
|
14079
|
-
let i = ne(n), a = he[r], o =
|
|
14078
|
+
function Vo(e, t, n, r) {
|
|
14079
|
+
let i = ne(n), a = he[r], o = zo(e, t), s = o ? De(o) : null, c = {
|
|
14080
14080
|
tokens: i,
|
|
14081
14081
|
width: a,
|
|
14082
14082
|
fontPx: 16
|
|
14083
|
-
}, l =
|
|
14083
|
+
}, l = Bo(t.fontSize, c), u = l !== null && Fo(e, r) ? Io(l, r) : l, d = s ? Mo(s.size[r], c) : null, f = u ?? d ?? 16, p = {
|
|
14084
14084
|
...c,
|
|
14085
14085
|
fontPx: f
|
|
14086
14086
|
}, m = null, h = !1;
|
|
14087
14087
|
if (t.lineHeight) {
|
|
14088
14088
|
let e = String(t.lineHeight).trim(), n = /^-?[\d.]+$/.test(e) ? parseFloat(e) : /%$/.test(e) ? parseFloat(e) / 100 : (() => {
|
|
14089
|
-
let t =
|
|
14089
|
+
let t = Mo(e, p);
|
|
14090
14090
|
return t === null ? null : t / f;
|
|
14091
14091
|
})();
|
|
14092
14092
|
n !== null && Number.isFinite(n) && n > 0 && (m = n, h = !0);
|
|
14093
14093
|
}
|
|
14094
|
-
m === null && (m = s ?
|
|
14095
|
-
let g = t.isBold ? 700 : Number(t.fontWeight ?? (s ?
|
|
14094
|
+
m === null && (m = s ? Mo(s.line, p) : null), m === null && (m = 1.5);
|
|
14095
|
+
let g = t.isBold ? 700 : Number(t.fontWeight ?? (s ? Mo(s.weight, p) : 400)), v = t.fontFamily ?? jo(s && s.family === "heading" ? "var(--semantic-font-family-heading, var(--font-family-sans))" : "var(--semantic-font-family-body, var(--font-family-sans))", i);
|
|
14096
14096
|
return {
|
|
14097
|
-
fontSize:
|
|
14098
|
-
lineHeight:
|
|
14097
|
+
fontSize: Ro(f),
|
|
14098
|
+
lineHeight: Ro(m, 100),
|
|
14099
14099
|
fontWeight: Number.isFinite(g) ? g : 400,
|
|
14100
14100
|
fontFamily: _(v),
|
|
14101
14101
|
textStyle: o,
|
|
@@ -14109,7 +14109,7 @@ function Bo(e, t, n, r) {
|
|
|
14109
14109
|
}
|
|
14110
14110
|
//#endregion
|
|
14111
14111
|
//#region src/v2/design/css.ts
|
|
14112
|
-
var
|
|
14112
|
+
var Ho = {
|
|
14113
14113
|
compact: {
|
|
14114
14114
|
desktop: {
|
|
14115
14115
|
y: "3.5rem",
|
|
@@ -14162,11 +14162,11 @@ var Vo = {
|
|
|
14162
14162
|
}
|
|
14163
14163
|
}
|
|
14164
14164
|
};
|
|
14165
|
-
function
|
|
14165
|
+
function Uo(e) {
|
|
14166
14166
|
return Object.fromEntries(e.tokens.map((e) => [e.key, ie(e)]));
|
|
14167
14167
|
}
|
|
14168
|
-
function
|
|
14169
|
-
let n =
|
|
14168
|
+
function Wo(e, t) {
|
|
14169
|
+
let n = Ho[e.options?.density ?? "comfortable"][t], r = ne(e), i = r.get("--color-action-primary-bg"), a = r.get("--color-action-primary-text"), o = i && Ta(se(r, ie(i)), a ? se(r, ie(a)) : void 0) || "#FFFFFF";
|
|
14170
14170
|
return {
|
|
14171
14171
|
...ke(t),
|
|
14172
14172
|
"--plx-on-accent": o,
|
|
@@ -14177,29 +14177,29 @@ function Uo(e, t) {
|
|
|
14177
14177
|
"--plx-accent": "var(--color-action-primary-bg)"
|
|
14178
14178
|
};
|
|
14179
14179
|
}
|
|
14180
|
-
function
|
|
14180
|
+
function Go(e, t) {
|
|
14181
14181
|
return {
|
|
14182
|
-
...
|
|
14183
|
-
...
|
|
14182
|
+
...Uo(e),
|
|
14183
|
+
...Wo(e, t)
|
|
14184
14184
|
};
|
|
14185
14185
|
}
|
|
14186
|
-
var
|
|
14187
|
-
function
|
|
14186
|
+
var Ko = /var\(\s*(--[A-Za-z0-9_-]+)/g, qo = (e) => [...e.matchAll(Ko)].map((e) => e[1]);
|
|
14187
|
+
function Jo(e, t) {
|
|
14188
14188
|
let n = {
|
|
14189
|
-
...
|
|
14190
|
-
...
|
|
14191
|
-
}, r =
|
|
14189
|
+
...Uo(e),
|
|
14190
|
+
...Wo(e, "desktop")
|
|
14191
|
+
}, r = Wo(e, "tablet"), i = Wo(e, "mobile"), a = /* @__PURE__ */ new Set(), o = qo(t);
|
|
14192
14192
|
for (; o.length;) {
|
|
14193
14193
|
let e = o.pop();
|
|
14194
|
-
a.has(e) || !(e in n) || (a.add(e), o.push(...
|
|
14194
|
+
a.has(e) || !(e in n) || (a.add(e), o.push(...qo(n[e])), e in r && o.push(...qo(r[e])), e in i && o.push(...qo(i[e])));
|
|
14195
14195
|
}
|
|
14196
14196
|
return {
|
|
14197
14197
|
needed: a,
|
|
14198
14198
|
vars: n
|
|
14199
14199
|
};
|
|
14200
14200
|
}
|
|
14201
|
-
function
|
|
14202
|
-
let { needed: n } =
|
|
14201
|
+
function Yo(e, t) {
|
|
14202
|
+
let { needed: n } = Jo(e, t), r = ne(e), i = /* @__PURE__ */ new Set();
|
|
14203
14203
|
for (let e of n) {
|
|
14204
14204
|
let t = r.get(e);
|
|
14205
14205
|
if (!t || t.type !== "font family") continue;
|
|
@@ -14208,17 +14208,17 @@ function Jo(e, t) {
|
|
|
14208
14208
|
}
|
|
14209
14209
|
return [...i];
|
|
14210
14210
|
}
|
|
14211
|
-
function
|
|
14212
|
-
let { needed: n, vars: r } =
|
|
14211
|
+
function Xo(e, t) {
|
|
14212
|
+
let { needed: n, vars: r } = Jo(e, t), i = (e, t) => e.map((e) => `${e}:${t[e]}`).join(";"), a = [`.plx-page{${i([...n], r)}}`];
|
|
14213
14213
|
for (let [t, r] of [["tablet", "(max-width: 1023px)"], ["mobile", "(max-width: 599px)"]]) {
|
|
14214
|
-
let o =
|
|
14214
|
+
let o = Wo(e, t), s = Wo(e, t === "tablet" ? "desktop" : "tablet"), c = Object.keys(o).filter((e) => n.has(e) && o[e] !== s[e]);
|
|
14215
14215
|
c.length && a.push(`@container plx-page ${r}{.plx-page>*{${i(c, o)}}}`);
|
|
14216
14216
|
}
|
|
14217
14217
|
return a.join("\n");
|
|
14218
14218
|
}
|
|
14219
14219
|
//#endregion
|
|
14220
14220
|
//#region src/v2/design/audit.ts
|
|
14221
|
-
var
|
|
14221
|
+
var Zo = [
|
|
14222
14222
|
"color",
|
|
14223
14223
|
"font",
|
|
14224
14224
|
"fontSize",
|
|
@@ -14226,7 +14226,7 @@ var Xo = [
|
|
|
14226
14226
|
"radius",
|
|
14227
14227
|
"shadow",
|
|
14228
14228
|
"spacing"
|
|
14229
|
-
],
|
|
14229
|
+
], Qo = {
|
|
14230
14230
|
color: {
|
|
14231
14231
|
one: "colour",
|
|
14232
14232
|
many: "colours",
|
|
@@ -14262,14 +14262,14 @@ var Xo = [
|
|
|
14262
14262
|
many: "spacings",
|
|
14263
14263
|
nearest: "brand spacing"
|
|
14264
14264
|
}
|
|
14265
|
-
},
|
|
14265
|
+
}, $o = [
|
|
14266
14266
|
"textColor",
|
|
14267
14267
|
"backgroundColor",
|
|
14268
14268
|
"darkModeBackgroundColor",
|
|
14269
14269
|
"borderColor",
|
|
14270
14270
|
"linkColor",
|
|
14271
14271
|
"linkHoverColor"
|
|
14272
|
-
],
|
|
14272
|
+
], es = [
|
|
14273
14273
|
"padding",
|
|
14274
14274
|
"paddingTop",
|
|
14275
14275
|
"paddingBottom",
|
|
@@ -14282,56 +14282,56 @@ var Xo = [
|
|
|
14282
14282
|
"marginRight",
|
|
14283
14283
|
"gap",
|
|
14284
14284
|
"gridGap"
|
|
14285
|
-
],
|
|
14286
|
-
let t =
|
|
14285
|
+
], ts = /^(#[0-9a-f]{3,8}|rgba?\([^)]*\)|hsla?\([^)]*\)|white|black)$/i, ns = /#[0-9a-f]{8}\b|#[0-9a-f]{6}\b|#[0-9a-f]{3,4}\b|rgba?\([^)]*\)|hsla?\([^)]*\)/gi, rs = /^(\d*\.?\d+)(px|rem)$/i, is = (e, t = 2) => Math.round(e * 10 ** t) / 10 ** t, as = (e) => {
|
|
14286
|
+
let t = rs.exec(e.trim());
|
|
14287
14287
|
if (!t) return null;
|
|
14288
14288
|
let n = parseFloat(t[1]);
|
|
14289
14289
|
return t[2].toLowerCase() === "rem" ? n * 16 : n;
|
|
14290
|
-
},
|
|
14290
|
+
}, os = (e) => ts.test(e.trim()) && (p(e)?.a ?? 0) > 0, ss = (e) => {
|
|
14291
14291
|
let t = p(e);
|
|
14292
14292
|
return !t || t.a <= 0 ? null : f({
|
|
14293
14293
|
...t,
|
|
14294
|
-
a:
|
|
14294
|
+
a: is(t.a, 2)
|
|
14295
14295
|
}).toLowerCase();
|
|
14296
|
-
},
|
|
14297
|
-
function
|
|
14296
|
+
}, cs = (e) => e.trim().toLowerCase().replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").replace(/\(\s+/g, "(").replace(/\s+\)/g, ")");
|
|
14297
|
+
function ls(e, t) {
|
|
14298
14298
|
switch (e) {
|
|
14299
|
-
case "color": return
|
|
14299
|
+
case "color": return ss(t);
|
|
14300
14300
|
case "font": return _(t).toLowerCase() || null;
|
|
14301
14301
|
case "fontSize":
|
|
14302
14302
|
case "radius":
|
|
14303
14303
|
case "spacing": {
|
|
14304
|
-
let e =
|
|
14305
|
-
return e === null || e <= 0 ? null : `${
|
|
14304
|
+
let e = as(t);
|
|
14305
|
+
return e === null || e <= 0 ? null : `${is(e)}px`;
|
|
14306
14306
|
}
|
|
14307
14307
|
case "lineHeight": {
|
|
14308
14308
|
let e = parseFloat(t);
|
|
14309
|
-
return Number.isFinite(e) && e > 0 ? String(
|
|
14309
|
+
return Number.isFinite(e) && e > 0 ? String(is(e)) : null;
|
|
14310
14310
|
}
|
|
14311
|
-
case "shadow": return
|
|
14311
|
+
case "shadow": return cs(t) || null;
|
|
14312
14312
|
}
|
|
14313
14313
|
}
|
|
14314
|
-
function
|
|
14314
|
+
function us(e, t) {
|
|
14315
14315
|
if (!e) return e;
|
|
14316
14316
|
let n = null, r = e, i = (e, t) => {
|
|
14317
14317
|
t !== r[e] && (n ??= { ...r }, n[e] = t);
|
|
14318
14318
|
}, a = (e) => typeof r[e] == "string" && !r[e].includes("var(") ? r[e].trim() : null;
|
|
14319
|
-
for (let e of
|
|
14319
|
+
for (let e of $o) {
|
|
14320
14320
|
let n = a(e);
|
|
14321
|
-
if (n &&
|
|
14321
|
+
if (n && os(n)) {
|
|
14322
14322
|
let r = t("color", n);
|
|
14323
14323
|
r !== void 0 && i(e, r);
|
|
14324
14324
|
}
|
|
14325
14325
|
}
|
|
14326
14326
|
let o = typeof r.backgroundGradient == "string" ? r.backgroundGradient : null;
|
|
14327
|
-
o && i("backgroundGradient", o.replace(
|
|
14327
|
+
o && i("backgroundGradient", o.replace(ns, (e) => os(e) ? t("color", e) ?? e : e));
|
|
14328
14328
|
let s = a("fontFamily");
|
|
14329
14329
|
if (s && !/^(inherit|initial|unset)$/i.test(s)) {
|
|
14330
14330
|
let e = t("font", s);
|
|
14331
14331
|
e !== void 0 && i("fontFamily", e);
|
|
14332
14332
|
}
|
|
14333
14333
|
let c = a("fontSize");
|
|
14334
|
-
if (c &&
|
|
14334
|
+
if (c && rs.test(c)) {
|
|
14335
14335
|
let e = t("fontSize", c);
|
|
14336
14336
|
e !== void 0 && i("fontSize", e);
|
|
14337
14337
|
}
|
|
@@ -14348,21 +14348,21 @@ function ls(e, t) {
|
|
|
14348
14348
|
let d = (e, n) => {
|
|
14349
14349
|
let r = a(e);
|
|
14350
14350
|
if (!r || r.includes("(")) return;
|
|
14351
|
-
let o = r.split(/\s+/).map((e) =>
|
|
14351
|
+
let o = r.split(/\s+/).map((e) => rs.test(e) && (as(e) ?? 0) > 0 ? t(n, e) ?? e : e).join(" ");
|
|
14352
14352
|
i(e, o);
|
|
14353
14353
|
};
|
|
14354
14354
|
d("borderRadius", "radius");
|
|
14355
|
-
for (let e of
|
|
14355
|
+
for (let e of es) d(e, "spacing");
|
|
14356
14356
|
return n ?? e;
|
|
14357
14357
|
}
|
|
14358
|
-
var
|
|
14358
|
+
var ds = (e) => {
|
|
14359
14359
|
let t = e.type === "section" ? e.props?.block : void 0;
|
|
14360
14360
|
return t && typeof t == "object" && typeof t.kind == "string" ? t : null;
|
|
14361
|
-
},
|
|
14362
|
-
function
|
|
14361
|
+
}, fs = "__", ps = (e, t) => t === e ? "@section" : t.startsWith(`${e}${fs}`) ? t.slice(e.length + 2) : t;
|
|
14362
|
+
function ms(e, t) {
|
|
14363
14363
|
if (!e.overrides) return e;
|
|
14364
14364
|
let n = !1, r = Object.fromEntries(Object.entries(e.overrides).map(([e, r]) => {
|
|
14365
|
-
let i =
|
|
14365
|
+
let i = us(r.styles, t), a = us(r.responsive?.tablet, t), o = us(r.responsive?.mobile, t);
|
|
14366
14366
|
return i === r.styles && a === r.responsive?.tablet && o === r.responsive?.mobile ? [e, r] : (n = !0, [e, {
|
|
14367
14367
|
...r,
|
|
14368
14368
|
styles: i,
|
|
@@ -14378,13 +14378,13 @@ function ps(e, t) {
|
|
|
14378
14378
|
overrides: r
|
|
14379
14379
|
} : e;
|
|
14380
14380
|
}
|
|
14381
|
-
function
|
|
14382
|
-
let r =
|
|
14381
|
+
function hs(e, t, n) {
|
|
14382
|
+
let r = ds(e);
|
|
14383
14383
|
if (r) {
|
|
14384
|
-
let i =
|
|
14384
|
+
let i = ms(r, t);
|
|
14385
14385
|
if (!n || i === r) return e;
|
|
14386
14386
|
let a = i.overrides ?? {};
|
|
14387
|
-
return
|
|
14387
|
+
return gs({
|
|
14388
14388
|
...e,
|
|
14389
14389
|
props: {
|
|
14390
14390
|
...e.props,
|
|
@@ -14392,7 +14392,7 @@ function ms(e, t, n) {
|
|
|
14392
14392
|
}
|
|
14393
14393
|
}, e.id, a);
|
|
14394
14394
|
}
|
|
14395
|
-
let i =
|
|
14395
|
+
let i = us(e.styles, t), a = us(e.responsive?.tablet, t), o = us(e.responsive?.mobile, t), s = e.children?.map((e) => hs(e, t, n)), c = !s || s.every((t, n) => t === e.children[n]);
|
|
14396
14396
|
return i === e.styles && a === e.responsive?.tablet && o === e.responsive?.mobile && c ? e : {
|
|
14397
14397
|
...e,
|
|
14398
14398
|
styles: i,
|
|
@@ -14404,9 +14404,9 @@ function ms(e, t, n) {
|
|
|
14404
14404
|
...s ? { children: s } : {}
|
|
14405
14405
|
};
|
|
14406
14406
|
}
|
|
14407
|
-
function
|
|
14407
|
+
function gs(e, t, n) {
|
|
14408
14408
|
let r = (e) => {
|
|
14409
|
-
let i = n[
|
|
14409
|
+
let i = n[ps(t, e.id)], a = e.children?.map(r);
|
|
14410
14410
|
return i ? {
|
|
14411
14411
|
...e,
|
|
14412
14412
|
...a ? { children: a } : {},
|
|
@@ -14431,7 +14431,7 @@ function hs(e, t, n) {
|
|
|
14431
14431
|
};
|
|
14432
14432
|
return r(e);
|
|
14433
14433
|
}
|
|
14434
|
-
var
|
|
14434
|
+
var _s = {
|
|
14435
14435
|
font: "--font-family-",
|
|
14436
14436
|
fontSize: "--font-size-",
|
|
14437
14437
|
lineHeight: "--line-height-",
|
|
@@ -14439,27 +14439,27 @@ var gs = {
|
|
|
14439
14439
|
shadow: "--shadow-",
|
|
14440
14440
|
spacing: "--space-"
|
|
14441
14441
|
};
|
|
14442
|
-
function
|
|
14442
|
+
function vs(e) {
|
|
14443
14443
|
let t = (e.name && !e.name.startsWith("--") ? e.name : e.key.replace(/^--/, "").replace(/-/g, " ")).replace(/^(Color|Semantic) /i, "");
|
|
14444
14444
|
return t = t.replace(/^Brand (Primary|Secondary) 500$/i, "$1").replace(/^Brand /i, ""), t;
|
|
14445
14445
|
}
|
|
14446
|
-
function
|
|
14447
|
-
let n = [], r =
|
|
14446
|
+
function ys(e, t) {
|
|
14447
|
+
let n = [], r = _s[t];
|
|
14448
14448
|
for (let i of e.tokens) {
|
|
14449
14449
|
if (t === "color" ? !(i.type === "color" && i.layer !== "component") : !(r && i.key.startsWith(r))) continue;
|
|
14450
14450
|
let a = te(e, i.key);
|
|
14451
14451
|
if (a === void 0) continue;
|
|
14452
|
-
let o =
|
|
14452
|
+
let o = ls(t, a);
|
|
14453
14453
|
o && n.push({
|
|
14454
14454
|
key: i.key,
|
|
14455
|
-
name:
|
|
14455
|
+
name: vs(i),
|
|
14456
14456
|
norm: o,
|
|
14457
14457
|
layer: i.layer
|
|
14458
14458
|
});
|
|
14459
14459
|
}
|
|
14460
14460
|
return n;
|
|
14461
14461
|
}
|
|
14462
|
-
function
|
|
14462
|
+
function bs(e) {
|
|
14463
14463
|
let t = p(e), n = (e) => {
|
|
14464
14464
|
let t = e / 255;
|
|
14465
14465
|
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
@@ -14474,16 +14474,16 @@ function ys(e) {
|
|
|
14474
14474
|
200 * (l(s) - l(c))
|
|
14475
14475
|
];
|
|
14476
14476
|
}
|
|
14477
|
-
var
|
|
14478
|
-
function
|
|
14479
|
-
let n = Math.abs(
|
|
14477
|
+
var xs = (e) => p(e)?.a ?? 1;
|
|
14478
|
+
function Ss(e, t) {
|
|
14479
|
+
let n = Math.abs(xs(e) - xs(t));
|
|
14480
14480
|
if (n > .06) return Infinity;
|
|
14481
|
-
let [r, i, a] =
|
|
14481
|
+
let [r, i, a] = bs(e), [o, s, c] = bs(t);
|
|
14482
14482
|
return Math.sqrt((r - o) ** 2 + (i - s) ** 2 + (a - c) ** 2) + n * 100;
|
|
14483
14483
|
}
|
|
14484
|
-
function
|
|
14484
|
+
function Cs(e, t, n) {
|
|
14485
14485
|
switch (e) {
|
|
14486
|
-
case "color": return
|
|
14486
|
+
case "color": return Ss(t, n);
|
|
14487
14487
|
case "fontSize":
|
|
14488
14488
|
case "radius":
|
|
14489
14489
|
case "spacing": return Math.abs(parseFloat(t) - parseFloat(n));
|
|
@@ -14491,8 +14491,8 @@ function Ss(e, t, n) {
|
|
|
14491
14491
|
default: return t === n ? 0 : Infinity;
|
|
14492
14492
|
}
|
|
14493
14493
|
}
|
|
14494
|
-
var
|
|
14495
|
-
function
|
|
14494
|
+
var ws = (e) => e === "color" ? 1.5 : e === "lineHeight" ? .02 : .5;
|
|
14495
|
+
function Ts(e, t, n, r) {
|
|
14496
14496
|
return e === "color" ? {
|
|
14497
14497
|
ok: t <= 10,
|
|
14498
14498
|
level: t <= 3 ? "almost identical" : t <= 6 ? "very close" : "close"
|
|
@@ -14510,15 +14510,15 @@ function ws(e, t, n, r) {
|
|
|
14510
14510
|
level: "almost identical"
|
|
14511
14511
|
};
|
|
14512
14512
|
}
|
|
14513
|
-
var
|
|
14513
|
+
var Es = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), Ds = (e) => {
|
|
14514
14514
|
let t = p(e);
|
|
14515
14515
|
return Math.max(t.r, t.g, t.b) - Math.min(t.r, t.g, t.b) < 24;
|
|
14516
14516
|
};
|
|
14517
|
-
function
|
|
14517
|
+
function Os(e, t, n, r) {
|
|
14518
14518
|
let i;
|
|
14519
14519
|
switch (e) {
|
|
14520
14520
|
case "color":
|
|
14521
|
-
i =
|
|
14521
|
+
i = Ds(t) ? {
|
|
14522
14522
|
key: "--color-neutral-custom",
|
|
14523
14523
|
name: "Neutral",
|
|
14524
14524
|
numbered: !0
|
|
@@ -14530,10 +14530,10 @@ function Ds(e, t, n, r) {
|
|
|
14530
14530
|
break;
|
|
14531
14531
|
case "font": {
|
|
14532
14532
|
let e = _(n);
|
|
14533
|
-
return
|
|
14533
|
+
return ks(`--font-family-${Es(e) || "custom"}`, e, !1, r);
|
|
14534
14534
|
}
|
|
14535
14535
|
case "fontSize":
|
|
14536
|
-
i = (
|
|
14536
|
+
i = (as(t) ?? 0) >= 28 ? {
|
|
14537
14537
|
key: "--font-size-heading",
|
|
14538
14538
|
name: "Heading size",
|
|
14539
14539
|
numbered: !0
|
|
@@ -14572,9 +14572,9 @@ function Ds(e, t, n, r) {
|
|
|
14572
14572
|
};
|
|
14573
14573
|
break;
|
|
14574
14574
|
}
|
|
14575
|
-
return
|
|
14575
|
+
return ks(i.key, i.name, !0, r);
|
|
14576
14576
|
}
|
|
14577
|
-
function
|
|
14577
|
+
function ks(e, t, n, r) {
|
|
14578
14578
|
if (!n) {
|
|
14579
14579
|
let n = e, i = 2;
|
|
14580
14580
|
for (; r.has(n);) n = `${e}-${i++}`;
|
|
@@ -14590,10 +14590,10 @@ function Os(e, t, n, r) {
|
|
|
14590
14590
|
name: `${t} ${i}`
|
|
14591
14591
|
};
|
|
14592
14592
|
}
|
|
14593
|
-
function
|
|
14593
|
+
function As(e) {
|
|
14594
14594
|
let t = /* @__PURE__ */ new Map();
|
|
14595
|
-
for (let n of e)
|
|
14596
|
-
let i =
|
|
14595
|
+
for (let n of e) hs(n.rootNode, (e, r) => {
|
|
14596
|
+
let i = ls(e, r);
|
|
14597
14597
|
if (!i) return;
|
|
14598
14598
|
let a = `${e}:${i}`, o = t.get(a);
|
|
14599
14599
|
o || t.set(a, o = {
|
|
@@ -14606,25 +14606,25 @@ function ks(e) {
|
|
|
14606
14606
|
}, !1);
|
|
14607
14607
|
return t;
|
|
14608
14608
|
}
|
|
14609
|
-
var
|
|
14610
|
-
function
|
|
14611
|
-
let r = n.minorBelow ?? 2, i =
|
|
14612
|
-
for (let e of
|
|
14613
|
-
let n =
|
|
14609
|
+
var js = (e) => [...e.entries()].sort((e, t) => t[1] - e[1])[0][0];
|
|
14610
|
+
function Ms(e, t, n = {}) {
|
|
14611
|
+
let r = n.minorBelow ?? 2, i = As(e), a = new Set(t.tokens.map((e) => e.key)), o = [];
|
|
14612
|
+
for (let e of Zo) {
|
|
14613
|
+
let n = ys(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 = [];
|
|
14614
14614
|
for (let t of c) {
|
|
14615
|
-
let n = l.find((n) =>
|
|
14615
|
+
let n = l.find((n) => Cs(e, n.rep.norm, t.norm) <= ws(e));
|
|
14616
14616
|
n ? n.members.push(t) : l.push({
|
|
14617
14617
|
rep: t,
|
|
14618
14618
|
members: [t]
|
|
14619
14619
|
});
|
|
14620
14620
|
}
|
|
14621
14621
|
for (let { rep: t, members: i } of l) {
|
|
14622
|
-
let s = i.reduce((e, t) => e + t.uses, 0), c =
|
|
14622
|
+
let s = i.reduce((e, t) => e + t.uses, 0), c = js(t.raws), l = [...new Set(i.flatMap((e) => [...e.pages]))], u = [...new Set(i.flatMap((e) => [...e.raws.keys()]))], d, f = Infinity;
|
|
14623
14623
|
for (let r of n) {
|
|
14624
|
-
if (e !== "color" && e !== "font" && e !== "shadow" && parseFloat(r.norm) === 0 || e === "color" &&
|
|
14625
|
-
let i =
|
|
14624
|
+
if (e !== "color" && e !== "font" && e !== "shadow" && parseFloat(r.norm) === 0 || e === "color" && xs(r.norm) === 0) continue;
|
|
14625
|
+
let i = Cs(e, t.norm, r.norm);
|
|
14626
14626
|
if (i < f || i === f && d && r.layer === "brand" && n.find((e) => e.key === d.tokenKey)?.layer !== "brand") {
|
|
14627
|
-
let n =
|
|
14627
|
+
let n = Ts(e, i, t.norm, r.norm);
|
|
14628
14628
|
n.ok && (f = i, d = {
|
|
14629
14629
|
tokenKey: r.key,
|
|
14630
14630
|
name: r.name,
|
|
@@ -14632,9 +14632,9 @@ function js(e, t, n = {}) {
|
|
|
14632
14632
|
});
|
|
14633
14633
|
}
|
|
14634
14634
|
}
|
|
14635
|
-
let p =
|
|
14635
|
+
let p = Os(e, t.norm, c, a);
|
|
14636
14636
|
a.add(p.key);
|
|
14637
|
-
let m =
|
|
14637
|
+
let m = Qo[e];
|
|
14638
14638
|
o.push({
|
|
14639
14639
|
id: `${e}:${t.norm}`,
|
|
14640
14640
|
kind: e,
|
|
@@ -14656,23 +14656,23 @@ function js(e, t, n = {}) {
|
|
|
14656
14656
|
}
|
|
14657
14657
|
}
|
|
14658
14658
|
o.sort((e, t) => t.uses - e.uses || e.id.localeCompare(t.id));
|
|
14659
|
-
let s = Object.fromEntries(
|
|
14659
|
+
let s = Object.fromEntries(Zo.map((e) => [e, o.filter((t) => t.kind === e)]));
|
|
14660
14660
|
return {
|
|
14661
14661
|
findings: o,
|
|
14662
14662
|
byKind: s,
|
|
14663
|
-
counts: Object.fromEntries(
|
|
14663
|
+
counts: Object.fromEntries(Zo.map((e) => [e, s[e].length])),
|
|
14664
14664
|
total: o.length,
|
|
14665
14665
|
minorCount: o.filter((e) => e.minor).length
|
|
14666
14666
|
};
|
|
14667
14667
|
}
|
|
14668
|
-
function
|
|
14669
|
-
let t =
|
|
14668
|
+
function Ns(e) {
|
|
14669
|
+
let t = Zo.filter((t) => e.counts[t] > 0).map((t) => `${e.counts[t]} ${e.counts[t] === 1 ? Qo[t].one : Qo[t].many}`);
|
|
14670
14670
|
return t.length <= 1 ? t.join("") : `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}`;
|
|
14671
14671
|
}
|
|
14672
|
-
function
|
|
14672
|
+
function Ps(e) {
|
|
14673
14673
|
return Object.fromEntries(e.findings.map((e) => [e.id, e.minor ? "keep" : e.suggestion.action]));
|
|
14674
14674
|
}
|
|
14675
|
-
function
|
|
14675
|
+
function Fs(e, t) {
|
|
14676
14676
|
let n = e.value;
|
|
14677
14677
|
if (e.kind === "color") {
|
|
14678
14678
|
let r = p(n);
|
|
@@ -14701,7 +14701,7 @@ function Ps(e, t) {
|
|
|
14701
14701
|
layer: "brand",
|
|
14702
14702
|
comment: "Added from your pages"
|
|
14703
14703
|
});
|
|
14704
|
-
let r =
|
|
14704
|
+
let r = rs.exec(n.trim());
|
|
14705
14705
|
return x(t, e.add.key, String(parseFloat(r[1])), {
|
|
14706
14706
|
name: e.add.name,
|
|
14707
14707
|
type: "dimension",
|
|
@@ -14710,21 +14710,21 @@ function Ps(e, t) {
|
|
|
14710
14710
|
comment: "Added from your pages"
|
|
14711
14711
|
});
|
|
14712
14712
|
}
|
|
14713
|
-
function
|
|
14714
|
-
let i =
|
|
14713
|
+
function Is(e, t, n, r = {}) {
|
|
14714
|
+
let i = Ms(e, t, r), a = t, o = /* @__PURE__ */ new Map(), s = As(e);
|
|
14715
14715
|
for (let e of i.findings) {
|
|
14716
14716
|
let t = n[e.id] ?? "keep", r;
|
|
14717
|
-
if (t === "add" ? (a =
|
|
14717
|
+
if (t === "add" ? (a = Fs(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) || Cs(e.kind, e.id.slice(e.kind.length + 1), t.norm) <= ws(e.kind)) && o.set(`${t.kind}:${t.norm}`, `var(${r})`);
|
|
14718
14718
|
}
|
|
14719
14719
|
if (!o.size) return {
|
|
14720
14720
|
pages: e,
|
|
14721
14721
|
designSystem: t
|
|
14722
14722
|
};
|
|
14723
14723
|
let c = (e, t) => {
|
|
14724
|
-
let n =
|
|
14724
|
+
let n = ls(e, t), r = n ? o.get(`${e}:${n}`) : void 0;
|
|
14725
14725
|
if (r) return r;
|
|
14726
14726
|
}, l = e.map((e) => {
|
|
14727
|
-
let t =
|
|
14727
|
+
let t = hs(e.rootNode, c, !0);
|
|
14728
14728
|
return t === e.rootNode ? e : {
|
|
14729
14729
|
...e,
|
|
14730
14730
|
rootNode: t
|
|
@@ -14740,8 +14740,27 @@ function Fs(e, t, n, r = {}) {
|
|
|
14740
14740
|
}
|
|
14741
14741
|
//#endregion
|
|
14742
14742
|
//#region src/v2/render/runtime.ts
|
|
14743
|
-
function
|
|
14744
|
-
let t = [], n = (t) => Array.prototype.slice.call(e.querySelectorAll(t)), r = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
14743
|
+
function Ls(e) {
|
|
14744
|
+
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");
|
|
14745
|
+
if (i.length && !r && typeof IntersectionObserver == "function") {
|
|
14746
|
+
let n = e.querySelector(".plx-page") || e;
|
|
14747
|
+
n.classList.add("plx-anim"), n.offsetHeight;
|
|
14748
|
+
let r = new IntersectionObserver((e) => {
|
|
14749
|
+
e.forEach((e) => {
|
|
14750
|
+
if (!e.isIntersecting) return;
|
|
14751
|
+
let t = e.target;
|
|
14752
|
+
t.classList.add("plx-in-on"), r.unobserve(t);
|
|
14753
|
+
let n = parseFloat(getComputedStyle(t).transitionDelay) * 1e3 || 0;
|
|
14754
|
+
setTimeout(() => {
|
|
14755
|
+
t.className = t.className.replace(/\bplx-in(-[a-z]+)*\b/g, "").replace(/\s+/g, " ").trim();
|
|
14756
|
+
}, n + 800);
|
|
14757
|
+
});
|
|
14758
|
+
}, {
|
|
14759
|
+
threshold: .12,
|
|
14760
|
+
rootMargin: "0px 0px -6% 0px"
|
|
14761
|
+
});
|
|
14762
|
+
i.forEach((e) => r.observe(e)), t.push(() => r.disconnect());
|
|
14763
|
+
}
|
|
14745
14764
|
return n(".plx-carousel").forEach((e) => {
|
|
14746
14765
|
let n = e.querySelector(".plx-track");
|
|
14747
14766
|
if (!n) return;
|
|
@@ -14826,23 +14845,23 @@ function Is(e) {
|
|
|
14826
14845
|
e.addEventListener("submit", n), t.push(() => e.removeEventListener("submit", n));
|
|
14827
14846
|
}), () => t.forEach((e) => e());
|
|
14828
14847
|
}
|
|
14829
|
-
var
|
|
14830
|
-
function
|
|
14848
|
+
var Rs = `(function(){var __name=function(f){return f};return ${Ls.toString()}})()`, zs = 1e5, Bs = (e) => typeof e == "string" && /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(e.trim()) ? e.trim() : null, Vs = (e) => Bs(e.replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^[^A-Za-z]+/, "").slice(0, 64)) ?? "";
|
|
14849
|
+
function Hs(e) {
|
|
14831
14850
|
if (typeof e != "string") return { code: "" };
|
|
14832
14851
|
let t = e.trim();
|
|
14833
14852
|
return t ? t.length > 1e5 ? {
|
|
14834
14853
|
code: "",
|
|
14835
|
-
warning: `The site's custom code is too long (over ${
|
|
14854
|
+
warning: `The site's custom code is too long (over ${zs.toLocaleString("en-US")} characters), so it was left out. Shorten it or load it from a file instead.`
|
|
14836
14855
|
} : { code: t.replace(/<\/(script)/gi, "<\\/$1").replace(/<!--/g, "<\\!--") } : { code: "" };
|
|
14837
14856
|
}
|
|
14838
14857
|
//#endregion
|
|
14839
14858
|
//#region src/v2/utils/css.ts
|
|
14840
|
-
function
|
|
14859
|
+
function Us(e) {
|
|
14841
14860
|
return `url("${e.replace(/["\\\n\r\f]/g, (e) => `\\${e.charCodeAt(0).toString(16)} `)}")`;
|
|
14842
14861
|
}
|
|
14843
14862
|
//#endregion
|
|
14844
14863
|
//#region src/v2/render/nodeStyle.ts
|
|
14845
|
-
var
|
|
14864
|
+
var Ws = [
|
|
14846
14865
|
"flex-start",
|
|
14847
14866
|
"center",
|
|
14848
14867
|
"flex-end",
|
|
@@ -14850,25 +14869,25 @@ var Us = [
|
|
|
14850
14869
|
"start",
|
|
14851
14870
|
"end",
|
|
14852
14871
|
"baseline"
|
|
14853
|
-
],
|
|
14872
|
+
], Gs = [
|
|
14854
14873
|
"hidden",
|
|
14855
14874
|
"visible",
|
|
14856
14875
|
"auto",
|
|
14857
14876
|
"clip"
|
|
14858
|
-
],
|
|
14877
|
+
], Ks = ["normal", "nowrap"], qs = [
|
|
14859
14878
|
"auto",
|
|
14860
14879
|
"pointer",
|
|
14861
14880
|
"default",
|
|
14862
14881
|
"text",
|
|
14863
14882
|
"grab",
|
|
14864
14883
|
"not-allowed"
|
|
14865
|
-
],
|
|
14884
|
+
], Js = [
|
|
14866
14885
|
"ease",
|
|
14867
14886
|
"linear",
|
|
14868
14887
|
"ease-in",
|
|
14869
14888
|
"ease-out",
|
|
14870
14889
|
"ease-in-out"
|
|
14871
|
-
],
|
|
14890
|
+
], Ys = {
|
|
14872
14891
|
all: ["all"],
|
|
14873
14892
|
opacity: ["opacity"],
|
|
14874
14893
|
transform: ["transform"],
|
|
@@ -14878,7 +14897,7 @@ var Us = [
|
|
|
14878
14897
|
"border-color",
|
|
14879
14898
|
"box-shadow"
|
|
14880
14899
|
]
|
|
14881
|
-
},
|
|
14900
|
+
}, U = (e, t) => typeof e == "string" && t.includes(e) ? e : void 0, Xs = (e) => typeof e == "string" && /^(?:(?:left|right|top|bottom|center|-?\d{1,3}(?:\.\d+)?%)(?: |$)){1,2}$/.test(e.trim() + " ") ? e.trim() : void 0, Zs = (e) => {
|
|
14882
14901
|
let t = typeof e == "number" ? e : typeof e == "string" ? parseFloat(e) : NaN;
|
|
14883
14902
|
if (!Number.isFinite(t) || t <= 0) return {};
|
|
14884
14903
|
let n = `blur(${Math.round(Math.min(40, t) * 10) / 10}px)`;
|
|
@@ -14888,12 +14907,46 @@ var Us = [
|
|
|
14888
14907
|
};
|
|
14889
14908
|
};
|
|
14890
14909
|
function Qs(e) {
|
|
14891
|
-
let t =
|
|
14910
|
+
let t = U(e.transitionProperty, Object.keys(Ys));
|
|
14892
14911
|
if (!t) return;
|
|
14893
|
-
let n = typeof e.transitionDuration == "number" ? e.transitionDuration : 200, r = Math.round(Math.min(2e3, Math.max(0, Number.isFinite(n) ? n : 200))), i =
|
|
14894
|
-
return
|
|
14912
|
+
let n = typeof e.transitionDuration == "number" ? e.transitionDuration : 200, r = Math.round(Math.min(2e3, Math.max(0, Number.isFinite(n) ? n : 200))), i = U(e.transitionEasing, Js) ?? "ease";
|
|
14913
|
+
return Ys[t].map((e) => `${e} ${r}ms ${i}`).join(", ");
|
|
14895
14914
|
}
|
|
14896
|
-
|
|
14915
|
+
var $s = [
|
|
14916
|
+
"lift",
|
|
14917
|
+
"grow",
|
|
14918
|
+
"fade",
|
|
14919
|
+
"glow"
|
|
14920
|
+
], ec = {
|
|
14921
|
+
lift: {
|
|
14922
|
+
translate: "0 -6px",
|
|
14923
|
+
boxShadow: "0 16px 32px rgba(0,0,0,0.18)"
|
|
14924
|
+
},
|
|
14925
|
+
grow: { scale: "1.05" },
|
|
14926
|
+
fade: { opacity: .8 },
|
|
14927
|
+
glow: { boxShadow: "0 10px 30px rgba(0,0,0,0.28)" }
|
|
14928
|
+
};
|
|
14929
|
+
function tc(e) {
|
|
14930
|
+
let t = U(e.hoverEffect, $s);
|
|
14931
|
+
return t ? ec[t] : void 0;
|
|
14932
|
+
}
|
|
14933
|
+
var nc = [
|
|
14934
|
+
"fade",
|
|
14935
|
+
"slide-up",
|
|
14936
|
+
"slide-left",
|
|
14937
|
+
"slide-right",
|
|
14938
|
+
"zoom"
|
|
14939
|
+
];
|
|
14940
|
+
function rc(e) {
|
|
14941
|
+
let t = U(e.entrance, nc);
|
|
14942
|
+
if (!t) return;
|
|
14943
|
+
let n = typeof e.entranceDelay == "number" && Number.isFinite(e.entranceDelay) ? e.entranceDelay : 0;
|
|
14944
|
+
return {
|
|
14945
|
+
kind: t,
|
|
14946
|
+
delay: Math.round(Math.min(1500, Math.max(0, n)))
|
|
14947
|
+
};
|
|
14948
|
+
}
|
|
14949
|
+
function ic(e, t, n) {
|
|
14897
14950
|
let { viewport: r } = n, i = Ee(t.textStyle) ? t.textStyle : e.type === "heading" ? je(e.props?.level) : null, a = i ? Ae(i) : {}, o = t.position !== "static" && (typeof t.x == "number" || typeof t.y == "number" || t.position === "absolute"), s = t.flexDirection;
|
|
14898
14951
|
r === "mobile" && t.stackOnMobile && t.display === "flex" && (s = "column");
|
|
14899
14952
|
let c = t.isFullWidth ? "100%" : t.customWidth || t.width, l = t.maxWidth;
|
|
@@ -14944,9 +14997,9 @@ function $s(e, t, n) {
|
|
|
14944
14997
|
gridRow: n.isGridChild && t.gridRowSpan ? `span ${t.gridRowSpan}` : void 0,
|
|
14945
14998
|
flexDirection: s,
|
|
14946
14999
|
justifyContent: t.justifyContent,
|
|
14947
|
-
alignItems:
|
|
14948
|
-
alignSelf:
|
|
14949
|
-
alignContent:
|
|
15000
|
+
alignItems: U(t.alignItems, Ws),
|
|
15001
|
+
alignSelf: U(t.alignSelf, Ws),
|
|
15002
|
+
alignContent: U(t.alignContent, [
|
|
14950
15003
|
"start",
|
|
14951
15004
|
"center",
|
|
14952
15005
|
"end",
|
|
@@ -14994,7 +15047,7 @@ function $s(e, t, n) {
|
|
|
14994
15047
|
color: t.textColor,
|
|
14995
15048
|
textAlign: t.textAlign,
|
|
14996
15049
|
backgroundColor: t.backgroundColor,
|
|
14997
|
-
backgroundImage: x ? "none" : S ?
|
|
15050
|
+
backgroundImage: x ? "none" : S ? Us(S) : t.backgroundGradient || void 0,
|
|
14998
15051
|
aspectRatio: t.aspectRatio,
|
|
14999
15052
|
backgroundSize: t.backgroundSize,
|
|
15000
15053
|
backgroundPosition: t.backgroundPosition,
|
|
@@ -15004,13 +15057,13 @@ function $s(e, t, n) {
|
|
|
15004
15057
|
borderStyle: t.borderStyle,
|
|
15005
15058
|
borderColor: t.borderColor,
|
|
15006
15059
|
boxShadow: t.boxShadow,
|
|
15007
|
-
overflow:
|
|
15008
|
-
whiteSpace:
|
|
15060
|
+
overflow: U(t.overflow, Gs),
|
|
15061
|
+
whiteSpace: U(t.whiteSpace, Ks),
|
|
15009
15062
|
objectPosition: Xs(t.objectPosition),
|
|
15010
15063
|
...Zs(t.backdropFilter),
|
|
15011
15064
|
pointerEvents: t.pointerEvents
|
|
15012
15065
|
};
|
|
15013
|
-
n.forPublish && (C.cursor =
|
|
15066
|
+
n.forPublish && (C.cursor = U(t.cursor, qs), C.transition = Qs(t) ?? (tc(t) ? "translate 200ms ease, scale 200ms ease, opacity 200ms ease, box-shadow 200ms ease" : void 0)), typeof C.fontSize == "string" && t.fontSize !== void 0 && Fo(e, r) && (C.fontSize = Lo(C.fontSize, r)), e.type === "columns" && !f && (C.display = "grid", C.gridTemplateColumns = `repeat(${r === "mobile" ? 1 : r === "tablet" ? 2 : t.gridColumns || 3}, minmax(0, 1fr))`), n.isRootPage && (C.maxWidth = t.maxWidth || void 0, C.marginLeft = t.horizontalAlign === "left" ? "0px" : t.horizontalAlign === "right" ? "auto" : t.marginLeft || "auto", C.marginRight = t.horizontalAlign === "left" ? "auto" : t.horizontalAlign === "right" ? "0px" : t.marginRight || "auto"), e.type === "section" && t.pinned && (C.position = "sticky", C.top = "0px", C.zIndex = 40);
|
|
15014
15067
|
for (let e of Object.keys(C)) C[e] === void 0 && delete C[e];
|
|
15015
15068
|
return {
|
|
15016
15069
|
css: C,
|
|
@@ -15024,7 +15077,7 @@ function $s(e, t, n) {
|
|
|
15024
15077
|
}
|
|
15025
15078
|
//#endregion
|
|
15026
15079
|
//#region src/v2/render/iconSet.ts
|
|
15027
|
-
var
|
|
15080
|
+
var ac = {
|
|
15028
15081
|
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" }]],
|
|
15029
15082
|
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" }]],
|
|
15030
15083
|
check: [["path", { d: "M20 6 9 17l-5-5" }]],
|
|
@@ -16694,7 +16747,7 @@ var ec = {
|
|
|
16694
16747
|
["path", { d: "m13 14 8-2" }],
|
|
16695
16748
|
["path", { d: "m13 19 8-2" }]
|
|
16696
16749
|
]
|
|
16697
|
-
},
|
|
16750
|
+
}, oc = {
|
|
16698
16751
|
Popular: [
|
|
16699
16752
|
"star",
|
|
16700
16753
|
"heart",
|
|
@@ -16900,20 +16953,20 @@ var ec = {
|
|
|
16900
16953
|
"spray-can"
|
|
16901
16954
|
]
|
|
16902
16955
|
};
|
|
16903
|
-
Object.keys(
|
|
16904
|
-
var
|
|
16956
|
+
Object.keys(ac);
|
|
16957
|
+
var sc = [["circle", {
|
|
16905
16958
|
cx: "12",
|
|
16906
16959
|
cy: "12",
|
|
16907
16960
|
r: "9"
|
|
16908
16961
|
}]];
|
|
16909
|
-
function
|
|
16910
|
-
return typeof e != "string" || !e.trim() ?
|
|
16962
|
+
function cc(e) {
|
|
16963
|
+
return typeof e != "string" || !e.trim() ? ac.star : Object.prototype.hasOwnProperty.call(ac, e) ? ac[e] : sc;
|
|
16911
16964
|
}
|
|
16912
16965
|
//#endregion
|
|
16913
16966
|
//#region src/v2/render/elements.ts
|
|
16914
|
-
var
|
|
16915
|
-
function
|
|
16916
|
-
let t = W(e), n =
|
|
16967
|
+
var lc = "_hp_field", W = (e) => e.props ?? {}, uc = (e) => O("div", { class: "plx-empty" }, e);
|
|
16968
|
+
function dc(e) {
|
|
16969
|
+
let t = W(e), n = cc(t.iconName), r = A(t.label, 200).trim();
|
|
16917
16970
|
return O("span", {
|
|
16918
16971
|
class: "plx-el plx-icon",
|
|
16919
16972
|
...r ? {
|
|
@@ -16930,9 +16983,9 @@ function oc(e) {
|
|
|
16930
16983
|
"aria-hidden": "true"
|
|
16931
16984
|
}, n.map(([e, t]) => O(e, t))));
|
|
16932
16985
|
}
|
|
16933
|
-
function
|
|
16986
|
+
function fc(e, t) {
|
|
16934
16987
|
let n = W(e), r = j(n.slides, 30);
|
|
16935
|
-
if (!r.length) return O("div", { class: "plx-el plx-carousel" },
|
|
16988
|
+
if (!r.length) return O("div", { class: "plx-el plx-carousel" }, uc("Add a slide to start your carousel"));
|
|
16936
16989
|
let i = r.map((e, n) => `${t.uid}-s${n + 1}`), a = r.length, o = r.map((e, t) => {
|
|
16937
16990
|
let n = mt(e.src), r = A(e.caption, 300), o = [n ? O("img", {
|
|
16938
16991
|
src: n,
|
|
@@ -16991,13 +17044,13 @@ function sc(e, t) {
|
|
|
16991
17044
|
"aria-label": `Go to slide ${t + 1}`
|
|
16992
17045
|
}))));
|
|
16993
17046
|
}
|
|
16994
|
-
var
|
|
17047
|
+
var pc = {
|
|
16995
17048
|
"16:9": "16 / 9",
|
|
16996
17049
|
"4:3": "4 / 3",
|
|
16997
17050
|
"1:1": "1 / 1",
|
|
16998
17051
|
"9:16": "9 / 16"
|
|
16999
17052
|
};
|
|
17000
|
-
function
|
|
17053
|
+
function mc(e) {
|
|
17001
17054
|
let t = e.trim();
|
|
17002
17055
|
if (!/^https?:\/\//i.test(t)) return null;
|
|
17003
17056
|
let n;
|
|
@@ -17023,12 +17076,12 @@ function lc(e) {
|
|
|
17023
17076
|
src: t
|
|
17024
17077
|
} : null;
|
|
17025
17078
|
}
|
|
17026
|
-
function
|
|
17027
|
-
let n = W(e), r =
|
|
17079
|
+
function hc(e, t) {
|
|
17080
|
+
let n = W(e), r = mc(A(n.url, 2e3)), i = pc[n.ratio ?? "16:9"] ?? pc["16:9"], a = (e) => ({
|
|
17028
17081
|
...O("div", { class: "plx-el plx-video" }, e),
|
|
17029
17082
|
style: { "aspect-ratio": i }
|
|
17030
17083
|
});
|
|
17031
|
-
if (!r) return a(
|
|
17084
|
+
if (!r) return a(uc("Paste a YouTube, Vimeo or video file link"));
|
|
17032
17085
|
if (r.kind === "file") {
|
|
17033
17086
|
let e = mt(n.poster);
|
|
17034
17087
|
return a(O("video", {
|
|
@@ -17053,7 +17106,7 @@ function uc(e, t) {
|
|
|
17053
17106
|
referrerpolicy: "strict-origin-when-cross-origin"
|
|
17054
17107
|
}));
|
|
17055
17108
|
}
|
|
17056
|
-
function
|
|
17109
|
+
function gc(e) {
|
|
17057
17110
|
let t = W(e), n = j(t.links, 20).filter((e) => e && e.network in P), r = xt(t.size, 20, 96, 40), i = t.shape === "square" || t.shape === "plain" ? t.shape : "circle", a = t.colorMode === "mono";
|
|
17058
17111
|
return n.length ? {
|
|
17059
17112
|
...O("nav", {
|
|
@@ -17084,11 +17137,11 @@ function dc(e) {
|
|
|
17084
17137
|
};
|
|
17085
17138
|
})),
|
|
17086
17139
|
style: { "--plx-size": `${r}px` }
|
|
17087
|
-
} : O("div", { class: "plx-el plx-social" },
|
|
17140
|
+
} : O("div", { class: "plx-el plx-social" }, uc("Add your social links"));
|
|
17088
17141
|
}
|
|
17089
|
-
function
|
|
17142
|
+
function _c(e) {
|
|
17090
17143
|
let t = W(e), n = j(t.links, 40);
|
|
17091
|
-
if (!n.length) return O("nav", { class: "plx-el plx-menu" },
|
|
17144
|
+
if (!n.length) return O("nav", { class: "plx-el plx-menu" }, uc("Add menu links"));
|
|
17092
17145
|
let r = n.map((e) => O("li", null, O("a", { href: k(e.href) }, A(e.label, 120) || "Link"))), i = t.layout === "vertical", a = !i && (n.length > 4 || n.reduce((e, t) => e + A(t.label, 120).length, 0) > 36);
|
|
17093
17146
|
return O("nav", {
|
|
17094
17147
|
class: `plx-el plx-menu${i ? " plx-menu--vertical" : ""}${a ? " plx-menu--long" : ""}${t.mobile === "expanded" ? " plx-menu--expanded" : ""}`,
|
|
@@ -17104,7 +17157,7 @@ function fc(e) {
|
|
|
17104
17157
|
"stroke-linecap": "round"
|
|
17105
17158
|
}))), O("ul", null, r)));
|
|
17106
17159
|
}
|
|
17107
|
-
function
|
|
17160
|
+
function vc(e, t) {
|
|
17108
17161
|
let n = W(e), r = A(n.code, 1e5);
|
|
17109
17162
|
return r.trim() ? O("div", { class: "plx-el plx-html" }, O("iframe", {
|
|
17110
17163
|
srcdoc: r,
|
|
@@ -17112,11 +17165,11 @@ function pc(e, t) {
|
|
|
17112
17165
|
title: A(n.title, 120) || "Embedded content",
|
|
17113
17166
|
loading: "lazy",
|
|
17114
17167
|
referrerpolicy: "no-referrer"
|
|
17115
|
-
})) : O("div", { class: "plx-el plx-html" },
|
|
17168
|
+
})) : O("div", { class: "plx-el plx-html" }, uc("Paste your embed code in the settings"));
|
|
17116
17169
|
}
|
|
17117
|
-
function
|
|
17170
|
+
function yc(e) {
|
|
17118
17171
|
let t = W(e), n = j(t.rows, 200).map((e) => j(e, 30).map((e) => A(e, 500)));
|
|
17119
|
-
if (!n.length) return O("div", { class: "plx-el plx-table-wrap" },
|
|
17172
|
+
if (!n.length) return O("div", { class: "plx-el plx-table-wrap" }, uc("Add rows to your table"));
|
|
17120
17173
|
let r = t.headerRow !== !1, i = Math.max(...n.map((e) => e.length)), a = (e) => Array.from({ length: i }, (t, n) => e[n] ?? "");
|
|
17121
17174
|
return O("div", {
|
|
17122
17175
|
class: "plx-el plx-table-wrap",
|
|
@@ -17125,8 +17178,8 @@ function mc(e) {
|
|
|
17125
17178
|
"aria-label": "Table"
|
|
17126
17179
|
}, O("table", { class: `plx-table${t.striped === !1 ? "" : " plx-striped"}` }, r && O("thead", null, O("tr", null, a(n[0]).map((e) => O("th", { scope: "col" }, e)))), O("tbody", null, n.slice(+!!r).map((e) => O("tr", null, a(e).map((e) => O("td", null, e)))))));
|
|
17127
17180
|
}
|
|
17128
|
-
var
|
|
17129
|
-
function
|
|
17181
|
+
var bc = (e) => String(Math.max(0, e)).padStart(2, "0");
|
|
17182
|
+
function xc(e, t) {
|
|
17130
17183
|
let n = Date.parse(e);
|
|
17131
17184
|
if (!Number.isFinite(n)) return {
|
|
17132
17185
|
done: !0,
|
|
@@ -17152,11 +17205,11 @@ function gc(e, t) {
|
|
|
17152
17205
|
s: i % 60
|
|
17153
17206
|
};
|
|
17154
17207
|
}
|
|
17155
|
-
function
|
|
17156
|
-
let n = W(e), r = A(n.target, 40), i =
|
|
17208
|
+
function Sc(e, t) {
|
|
17209
|
+
let n = W(e), r = A(n.target, 40), i = xc(r, t.now), a = (e, t, r) => O("div", { class: "plx-unit" }, O("span", {
|
|
17157
17210
|
class: "plx-num",
|
|
17158
17211
|
"data-plx-unit": e
|
|
17159
|
-
},
|
|
17212
|
+
}, bc(t)), n.showLabels !== !1 && O("span", { class: "plx-lbl" }, r));
|
|
17160
17213
|
return O("div", {
|
|
17161
17214
|
class: "plx-el plx-timer",
|
|
17162
17215
|
role: "timer",
|
|
@@ -17169,7 +17222,7 @@ function _c(e, t) {
|
|
|
17169
17222
|
a("s", i.s, "Seconds")
|
|
17170
17223
|
]);
|
|
17171
17224
|
}
|
|
17172
|
-
function
|
|
17225
|
+
function Cc(e, t) {
|
|
17173
17226
|
let n = bt(e.id, "field"), r = n, i = A(e.label, 200) || n, a = e.required ? !0 : void 0, o = A(e.placeholder, 200) || void 0, s = e.required ? O("span", {
|
|
17174
17227
|
class: "plx-req",
|
|
17175
17228
|
"aria-hidden": "true"
|
|
@@ -17197,11 +17250,11 @@ function vc(e, t) {
|
|
|
17197
17250
|
});
|
|
17198
17251
|
return O("label", { class: "plx-field" }, O("span", { class: "plx-label" }, i, s), c);
|
|
17199
17252
|
}
|
|
17200
|
-
function
|
|
17253
|
+
function wc(e) {
|
|
17201
17254
|
let t = _t(e.buttonColor), n = _t(e.buttonTextColor) ?? (t && !t.startsWith("var(") ? Ta(t) ?? void 0 : void 0), r = vt(e.buttonRadius), i = {};
|
|
17202
17255
|
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;
|
|
17203
17256
|
}
|
|
17204
|
-
function
|
|
17257
|
+
function Tc(e, t) {
|
|
17205
17258
|
let n = W(e), r = j(n.fields, 40);
|
|
17206
17259
|
return r.length ? O("form", {
|
|
17207
17260
|
class: "plx-el plx-form",
|
|
@@ -17209,12 +17262,12 @@ function bc(e, t) {
|
|
|
17209
17262
|
action: (n.action && k(n.action) !== "#" ? k(n.action) : "") || t.formAction?.(e.id) || void 0,
|
|
17210
17263
|
"data-plx-form": t.uid,
|
|
17211
17264
|
"data-plx-success": A(n.successMessage, 300) || "Thanks! We got your message."
|
|
17212
|
-
}, r.map((e) =>
|
|
17265
|
+
}, r.map((e) => Cc(e, t.uid)), O("div", {
|
|
17213
17266
|
class: "plx-hp",
|
|
17214
17267
|
"aria-hidden": "true"
|
|
17215
17268
|
}, O("label", null, "Leave this field blank", O("input", {
|
|
17216
17269
|
type: "text",
|
|
17217
|
-
name:
|
|
17270
|
+
name: lc,
|
|
17218
17271
|
tabindex: "-1",
|
|
17219
17272
|
autocomplete: "off"
|
|
17220
17273
|
}))), {
|
|
@@ -17222,10 +17275,10 @@ function bc(e, t) {
|
|
|
17222
17275
|
type: "submit",
|
|
17223
17276
|
class: "plx-submit"
|
|
17224
17277
|
}, A(n.submitLabel, 80) || "Submit"),
|
|
17225
|
-
...
|
|
17226
|
-
}) : O("div", { class: "plx-el plx-form" },
|
|
17278
|
+
...wc(n) ? { style: wc(n) } : {}
|
|
17279
|
+
}) : O("div", { class: "plx-el plx-form" }, uc("Add a field to your form"));
|
|
17227
17280
|
}
|
|
17228
|
-
function
|
|
17281
|
+
function Ec(e, t) {
|
|
17229
17282
|
let n = W(e), r = j(n.items, 50);
|
|
17230
17283
|
return r.length ? O("div", { class: "plx-el plx-accordion" }, r.map((e, r) => O("details", {
|
|
17231
17284
|
...n.allowMultiple ? {} : { name: t.uid },
|
|
@@ -17241,30 +17294,30 @@ function xc(e, t) {
|
|
|
17241
17294
|
"stroke-width": 2.2,
|
|
17242
17295
|
"stroke-linecap": "round",
|
|
17243
17296
|
"stroke-linejoin": "round"
|
|
17244
|
-
}))), O("div", { class: "plx-body" }, A(e.content, 5e3).split(/\n{2,}/).map((e) => O("p", null, e)))))) : O("div", { class: "plx-el plx-accordion" },
|
|
17297
|
+
}))), O("div", { class: "plx-body" }, A(e.content, 5e3).split(/\n{2,}/).map((e) => O("p", null, e)))))) : O("div", { class: "plx-el plx-accordion" }, uc("Add a question to start"));
|
|
17245
17298
|
}
|
|
17246
|
-
function
|
|
17299
|
+
function Dc(e, t) {
|
|
17247
17300
|
if (Ct(e.type)) return Bt(e, t);
|
|
17248
17301
|
switch (e.type) {
|
|
17249
|
-
case "icon": return
|
|
17250
|
-
case "carousel": return
|
|
17251
|
-
case "video": return
|
|
17252
|
-
case "social": return
|
|
17253
|
-
case "menu": return
|
|
17254
|
-
case "html": return
|
|
17255
|
-
case "table": return
|
|
17256
|
-
case "timer": return
|
|
17257
|
-
case "form": return
|
|
17258
|
-
case "accordion": return
|
|
17302
|
+
case "icon": return dc(e);
|
|
17303
|
+
case "carousel": return fc(e, t);
|
|
17304
|
+
case "video": return hc(e, t);
|
|
17305
|
+
case "social": return gc(e);
|
|
17306
|
+
case "menu": return _c(e);
|
|
17307
|
+
case "html": return vc(e, t);
|
|
17308
|
+
case "table": return yc(e);
|
|
17309
|
+
case "timer": return Sc(e, t);
|
|
17310
|
+
case "form": return Tc(e, t);
|
|
17311
|
+
case "accordion": return Ec(e, t);
|
|
17259
17312
|
default: return null;
|
|
17260
17313
|
}
|
|
17261
17314
|
}
|
|
17262
17315
|
//#endregion
|
|
17263
17316
|
//#region src/v2/render/elementCss.ts
|
|
17264
|
-
var Cc = ".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}";
|
|
17317
|
+
var Oc = ".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}";
|
|
17265
17318
|
//#endregion
|
|
17266
17319
|
//#region src/v2/render/formAction.ts
|
|
17267
|
-
function
|
|
17320
|
+
function kc(e, t, n) {
|
|
17268
17321
|
let r = e?.trim();
|
|
17269
17322
|
if (r) return {
|
|
17270
17323
|
kind: "custom",
|
|
@@ -17279,14 +17332,14 @@ function wc(e, t, n) {
|
|
|
17279
17332
|
url: `/api/public/forms/${encodeURIComponent(n.templateId)}/submit?form=${encodeURIComponent(t)}`
|
|
17280
17333
|
} : { kind: "none" };
|
|
17281
17334
|
}
|
|
17282
|
-
var
|
|
17283
|
-
let n =
|
|
17335
|
+
var Ac = (e) => (t) => {
|
|
17336
|
+
let n = kc(void 0, t, e);
|
|
17284
17337
|
return n.kind === "none" ? void 0 : n.url;
|
|
17285
|
-
},
|
|
17286
|
-
function
|
|
17338
|
+
}, jc = (e) => e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
17339
|
+
function Mc(e) {
|
|
17287
17340
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
17288
17341
|
if (e.type === "section") {
|
|
17289
|
-
let r = bt((typeof e.props?.anchor == "string" ?
|
|
17342
|
+
let r = bt((typeof e.props?.anchor == "string" ? jc(e.props.anchor) : "") || jc(e.name || "") || "section", "section"), i = r;
|
|
17290
17343
|
for (let e = 2; n.has(i); e++) i = `${r}-${e}`;
|
|
17291
17344
|
n.add(i), t.set(e.id, i);
|
|
17292
17345
|
}
|
|
@@ -17296,23 +17349,23 @@ function Dc(e) {
|
|
|
17296
17349
|
}
|
|
17297
17350
|
//#endregion
|
|
17298
17351
|
//#region src/v2/render/boxTags.ts
|
|
17299
|
-
var
|
|
17352
|
+
var Nc = [
|
|
17300
17353
|
"header",
|
|
17301
17354
|
"nav",
|
|
17302
17355
|
"main",
|
|
17303
17356
|
"footer",
|
|
17304
17357
|
"aside",
|
|
17305
17358
|
"article"
|
|
17306
|
-
],
|
|
17359
|
+
], Pc = {
|
|
17307
17360
|
section: [
|
|
17308
17361
|
"section",
|
|
17309
|
-
...
|
|
17362
|
+
...Nc,
|
|
17310
17363
|
"div"
|
|
17311
17364
|
],
|
|
17312
17365
|
container: [
|
|
17313
17366
|
"div",
|
|
17314
17367
|
"section",
|
|
17315
|
-
...
|
|
17368
|
+
...Nc
|
|
17316
17369
|
],
|
|
17317
17370
|
card: [
|
|
17318
17371
|
"div",
|
|
@@ -17323,52 +17376,52 @@ var Oc = [
|
|
|
17323
17376
|
columns: [
|
|
17324
17377
|
"div",
|
|
17325
17378
|
"section",
|
|
17326
|
-
...
|
|
17379
|
+
...Nc
|
|
17327
17380
|
],
|
|
17328
17381
|
column: [
|
|
17329
17382
|
"div",
|
|
17330
17383
|
"section",
|
|
17331
|
-
...
|
|
17384
|
+
...Nc
|
|
17332
17385
|
]
|
|
17333
|
-
},
|
|
17386
|
+
}, Fc = {
|
|
17334
17387
|
section: "section",
|
|
17335
17388
|
container: "div",
|
|
17336
17389
|
card: "div",
|
|
17337
17390
|
columns: "div",
|
|
17338
17391
|
column: "div"
|
|
17339
|
-
},
|
|
17340
|
-
function
|
|
17392
|
+
}, Ic = null, Lc = () => Ic ??= pe(), Rc = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
17393
|
+
function zc(e) {
|
|
17341
17394
|
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;
|
|
17342
17395
|
let t = 0;
|
|
17343
17396
|
for (let n of e) if (n === "(") t += 1;
|
|
17344
17397
|
else if (n === ")" && --t < 0) return !1;
|
|
17345
17398
|
return t === 0 && e.endsWith(")");
|
|
17346
17399
|
}
|
|
17347
|
-
function
|
|
17400
|
+
function Bc(e, t) {
|
|
17348
17401
|
if (typeof t == "number") return Number.isFinite(t) ? String(t) : null;
|
|
17349
17402
|
let n = t.trim();
|
|
17350
|
-
return n ? e === "backgroundImage" ? n === "none" || /^url\("(?:[^"\\\n]|\\[0-9a-f]{1,6} )*"\)$/i.test(n) ||
|
|
17403
|
+
return n ? e === "backgroundImage" ? n === "none" || /^url\("(?:[^"\\\n]|\\[0-9a-f]{1,6} )*"\)$/i.test(n) || zc(n) ? n : null : /[;{}<>\\]|\/\*|@import|expression\s*\(|javascript:|behavior\s*:|-moz-binding|url\s*\(/i.test(n) ? null : n : null;
|
|
17351
17404
|
}
|
|
17352
|
-
function
|
|
17405
|
+
function Vc(e) {
|
|
17353
17406
|
let t = [];
|
|
17354
17407
|
for (let [n, r] of Object.entries(e)) {
|
|
17355
17408
|
if (r === void 0) continue;
|
|
17356
|
-
let e =
|
|
17357
|
-
e !== null && t.push(`${
|
|
17409
|
+
let e = Bc(n, r);
|
|
17410
|
+
e !== null && t.push(`${Rc(n)}:${e}`);
|
|
17358
17411
|
}
|
|
17359
17412
|
return t.join(";");
|
|
17360
17413
|
}
|
|
17361
|
-
function
|
|
17414
|
+
function Hc(e, t) {
|
|
17362
17415
|
let n = {};
|
|
17363
17416
|
for (let r of Object.keys(t)) e[r] !== t[r] && (n[r] = t[r]);
|
|
17364
17417
|
for (let r of Object.keys(e)) r in t || (n[r] = r === "display" ? "revert" : "unset");
|
|
17365
17418
|
return n;
|
|
17366
17419
|
}
|
|
17367
|
-
var
|
|
17420
|
+
var Uc = (e) => {
|
|
17368
17421
|
let t = e?.split(",")[0]?.trim().replace(/^['"]|['"]$/g, "");
|
|
17369
17422
|
return t && y(t) ? t : null;
|
|
17370
17423
|
};
|
|
17371
|
-
function
|
|
17424
|
+
function Wc(e, t) {
|
|
17372
17425
|
if (t && e.includes(t)) {
|
|
17373
17426
|
let [n, ...r] = e.split(t);
|
|
17374
17427
|
return [
|
|
@@ -17379,86 +17432,91 @@ function zc(e, t) {
|
|
|
17379
17432
|
}
|
|
17380
17433
|
return [e];
|
|
17381
17434
|
}
|
|
17382
|
-
function
|
|
17435
|
+
function Gc(e, t = {}) {
|
|
17383
17436
|
let n = {
|
|
17384
17437
|
desktop: Se(e.rootNode, "desktop"),
|
|
17385
17438
|
tablet: Se(e.rootNode, "tablet"),
|
|
17386
17439
|
mobile: Se(e.rootNode, "mobile")
|
|
17387
|
-
}, r = [], i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = [], s = !1, c =
|
|
17440
|
+
}, r = [], i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = [], s = !1, c = !1, l = [], u = 0, d = t.now ?? Date.now(), f = {
|
|
17388
17441
|
apiKey: t.apiKey,
|
|
17389
17442
|
templateId: t.templateId,
|
|
17390
17443
|
formAction: t.formAction
|
|
17391
|
-
},
|
|
17444
|
+
}, p = Mc(e.rootNode), m = (e, c) => {
|
|
17392
17445
|
if (e.hidden) return null;
|
|
17393
|
-
let
|
|
17446
|
+
let m = e.type === "page", h = {
|
|
17394
17447
|
desktop: !0,
|
|
17395
17448
|
tablet: !0,
|
|
17396
17449
|
mobile: !0
|
|
17397
17450
|
};
|
|
17398
17451
|
for (let t of _e) h[t] = !(t === "desktop" ? e.responsiveVisibility?.hideOnDesktop : t === "tablet" ? e.responsiveVisibility?.hideOnTablet : e.responsiveVisibility?.hideOnMobile) && n[t].get(e.id) !== "outside";
|
|
17399
17452
|
if (!h.desktop && !h.tablet && !h.mobile) return null;
|
|
17400
|
-
let g = `plx-${++
|
|
17453
|
+
let g = `plx-${++u}`, v = {};
|
|
17401
17454
|
for (let t of _e) {
|
|
17402
17455
|
if (!h[t]) {
|
|
17403
|
-
|
|
17456
|
+
v[t] = { display: "none" };
|
|
17404
17457
|
continue;
|
|
17405
17458
|
}
|
|
17406
|
-
let n = me(e, t), r =
|
|
17459
|
+
let n = me(e, t), r = ic(e, n, {
|
|
17407
17460
|
viewport: t,
|
|
17408
|
-
isGridChild: (
|
|
17409
|
-
isRootPage:
|
|
17461
|
+
isGridChild: (c ? me(c, t).layoutMode : void 0) === "grid",
|
|
17462
|
+
isRootPage: m,
|
|
17410
17463
|
forPublish: !0
|
|
17411
17464
|
}).css;
|
|
17412
|
-
e.type === "section" && (r.overflow = "hidden"), e.props?.isFlowSpacer && (r.visibility = "hidden"),
|
|
17413
|
-
let o =
|
|
17465
|
+
e.type === "section" && (r.overflow = "hidden"), e.props?.isFlowSpacer && (r.visibility = "hidden"), v[t] = r;
|
|
17466
|
+
let o = Uc(n.fontFamily);
|
|
17414
17467
|
o && i.add(o);
|
|
17415
17468
|
let s = n.isBold ? 700 : Number(n.fontWeight);
|
|
17416
17469
|
Number.isInteger(s) && s >= 100 && s <= 900 && a.add(s);
|
|
17417
17470
|
}
|
|
17418
17471
|
r.push({
|
|
17419
17472
|
cls: g,
|
|
17420
|
-
rule:
|
|
17473
|
+
rule: v
|
|
17474
|
+
});
|
|
17475
|
+
let ee = tc(me(e, "desktop"));
|
|
17476
|
+
ee && l.push({
|
|
17477
|
+
cls: g,
|
|
17478
|
+
css: ee
|
|
17421
17479
|
});
|
|
17422
|
-
let
|
|
17480
|
+
let y = [g, yt(me(e, "desktop").customClasses)].filter(Boolean).join(" "), b = () => (e.children ?? []).map((t) => _(t, e)).filter((e) => e !== null);
|
|
17423
17481
|
if (Ht(e.type)) {
|
|
17424
|
-
let n =
|
|
17482
|
+
let n = Dc(e, {
|
|
17425
17483
|
uid: bt(e.id),
|
|
17426
17484
|
editing: !1,
|
|
17427
17485
|
allowEmbedScripts: t.allowEmbedScripts !== !1,
|
|
17428
|
-
formAction:
|
|
17429
|
-
now:
|
|
17486
|
+
formAction: Ac(f),
|
|
17487
|
+
now: d,
|
|
17430
17488
|
templateId: t.templateId
|
|
17431
17489
|
});
|
|
17432
|
-
return n ? ((e.type === "carousel" || e.type === "timer" || e.type === "form") && (s = !0), e.type === "form" &&
|
|
17490
|
+
return n ? ((e.type === "carousel" || e.type === "timer" || e.type === "form") && (s = !0), e.type === "form" && kc((e.props ?? {}).action, e.id, f).kind === "none" && o.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"] && o.push(`The sign-up form "${e.name}" isn't connected to a funnel yet, so visitors can't sign up.`), {
|
|
17433
17491
|
...n,
|
|
17434
17492
|
attrs: {
|
|
17435
17493
|
...n.attrs,
|
|
17436
|
-
class: `${
|
|
17494
|
+
class: `${y} ${n.attrs?.class ?? ""}`.trim()
|
|
17437
17495
|
}
|
|
17438
17496
|
}) : null;
|
|
17439
17497
|
}
|
|
17440
17498
|
switch (e.type) {
|
|
17441
|
-
case "page": return O("div", { class: `plx-page ${
|
|
17499
|
+
case "page": return O("div", { class: `plx-page ${y}` }, b());
|
|
17442
17500
|
case "section": return O("section", {
|
|
17443
|
-
class:
|
|
17444
|
-
id:
|
|
17445
|
-
},
|
|
17446
|
-
case "heading": return O(`h${xt(e.props?.level, 1, 6, 2)}`, { class:
|
|
17447
|
-
case "paragraph": return O("p", { class:
|
|
17501
|
+
class: y,
|
|
17502
|
+
id: p.get(e.id)
|
|
17503
|
+
}, b());
|
|
17504
|
+
case "heading": return O(`h${xt(e.props?.level, 1, 6, 2)}`, { class: y }, Wc(e.content ?? "", e.props?.highlightText));
|
|
17505
|
+
case "paragraph": return O("p", { class: y }, Wc(e.content ?? "", e.props?.highlightText));
|
|
17448
17506
|
case "button": {
|
|
17449
|
-
let t = e.props?.href ? k(e.props.href) : "", n =
|
|
17507
|
+
let t = e.props?.href ? k(e.props.href) : "", n = Wc(e.content ?? "", e.props?.highlightText);
|
|
17450
17508
|
return t && t !== "#" ? O("a", {
|
|
17451
|
-
class: `${
|
|
17509
|
+
class: `${y} plx-btn`,
|
|
17452
17510
|
href: t
|
|
17453
17511
|
}, n) : O("button", {
|
|
17454
|
-
class:
|
|
17512
|
+
class: y,
|
|
17455
17513
|
type: "button"
|
|
17456
17514
|
}, n);
|
|
17457
17515
|
}
|
|
17458
|
-
case "badge": return O("div", { class:
|
|
17516
|
+
case "badge": return O("div", { class: y }, Wc(e.content ?? "", e.props?.highlightText));
|
|
17459
17517
|
case "image": {
|
|
17460
17518
|
let t = mt(e.props?.src);
|
|
17461
|
-
return O("div", { class: `${
|
|
17519
|
+
return O("div", { class: `${y} plx-image` }, t ? {
|
|
17462
17520
|
...O("img", {
|
|
17463
17521
|
src: t,
|
|
17464
17522
|
alt: typeof e.props?.alt == "string" ? e.props.alt : "",
|
|
@@ -17471,36 +17529,42 @@ function Bc(e, t = {}) {
|
|
|
17471
17529
|
"aria-label": typeof e.props?.alt == "string" ? e.props.alt : ""
|
|
17472
17530
|
}));
|
|
17473
17531
|
}
|
|
17474
|
-
case "divider": return O("hr", { class:
|
|
17532
|
+
case "divider": return O("hr", { class: y });
|
|
17475
17533
|
case "spacer": return O("div", {
|
|
17476
|
-
class:
|
|
17534
|
+
class: y,
|
|
17477
17535
|
"aria-hidden": "true"
|
|
17478
17536
|
});
|
|
17479
|
-
default: return O("div", { class:
|
|
17537
|
+
default: return O("div", { class: y }, b());
|
|
17480
17538
|
}
|
|
17481
|
-
},
|
|
17482
|
-
let n =
|
|
17539
|
+
}, h = new Set(p.values()), _ = (e, t) => {
|
|
17540
|
+
let n = m(e, t);
|
|
17483
17541
|
if (!n) return n;
|
|
17484
17542
|
let r = {}, i = typeof e.props?.ariaLabel == "string" ? e.props.ariaLabel.trim().slice(0, 200) : "";
|
|
17485
17543
|
i && (r["aria-label"] = i), e.props?.ariaHidden === !0 && (r["aria-hidden"] = "true");
|
|
17486
|
-
let a =
|
|
17544
|
+
let a = Pc[e.type] && typeof e.props?.htmlTag == "string" && Pc[e.type].includes(e.props.htmlTag) ? e.props.htmlTag : null, o = a ? {
|
|
17487
17545
|
...n,
|
|
17488
17546
|
tag: a
|
|
17489
|
-
} : n,
|
|
17547
|
+
} : n, l = e.type === "page" ? void 0 : rc(me(e, "desktop"));
|
|
17548
|
+
l && (s = !0, c = !0, r.class = `${o.attrs?.class ?? ""} plx-in plx-in-${l.kind}`.trim());
|
|
17549
|
+
let u = Object.keys(r).length ? {
|
|
17490
17550
|
...o,
|
|
17491
17551
|
attrs: {
|
|
17492
17552
|
...o.attrs,
|
|
17493
17553
|
...r
|
|
17494
|
-
}
|
|
17495
|
-
|
|
17496
|
-
|
|
17497
|
-
|
|
17498
|
-
|
|
17499
|
-
|
|
17500
|
-
|
|
17554
|
+
},
|
|
17555
|
+
...l && l.delay ? { style: {
|
|
17556
|
+
...o.style,
|
|
17557
|
+
"--plx-delay": `${l.delay}ms`
|
|
17558
|
+
} } : {}
|
|
17559
|
+
} : o, d = e.type === "section" ? null : Bs(e.props?.htmlId);
|
|
17560
|
+
if (!d) return u;
|
|
17561
|
+
let f = d;
|
|
17562
|
+
for (let e = 2; h.has(f); e++) f = `${d}-${e}`;
|
|
17563
|
+
return h.add(f), {
|
|
17564
|
+
...u,
|
|
17501
17565
|
attrs: {
|
|
17502
|
-
...
|
|
17503
|
-
id:
|
|
17566
|
+
...u.attrs,
|
|
17567
|
+
id: f
|
|
17504
17568
|
}
|
|
17505
17569
|
};
|
|
17506
17570
|
};
|
|
@@ -17509,7 +17573,7 @@ function Bc(e, t = {}) {
|
|
|
17509
17573
|
for (let [r, i] of n[e]) i === "outside" && n.desktop.get(r) !== "outside" && (t += 1);
|
|
17510
17574
|
t && o.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".`);
|
|
17511
17575
|
}
|
|
17512
|
-
let
|
|
17576
|
+
let v = t.designSystem ? re(t.designSystem) : Lc(), y = _(e.rootNode, null) ?? O("div", { class: "plx-page" }), b = RegExp(`"type":"(${Vt.join("|")})"`).test(JSON.stringify(e.rootNode)), x = [
|
|
17513
17577
|
":where(.plx-page,.plx-page *,.plx-page *::before,.plx-page *::after){box-sizing:border-box}",
|
|
17514
17578
|
":where(.plx-page *){margin:0;padding:0;border:0 solid}",
|
|
17515
17579
|
".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))}",
|
|
@@ -17525,37 +17589,38 @@ function Bc(e, t = {}) {
|
|
|
17525
17589
|
".plx-hl{color:#FBBF24;font-style:italic;font-family:serif;font-weight:400}",
|
|
17526
17590
|
".plx-ph{width:100%;height:100%;min-height:60px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.32))}"
|
|
17527
17591
|
];
|
|
17528
|
-
|
|
17592
|
+
b && x.push(Oc);
|
|
17529
17593
|
for (let { cls: e, rule: t } of r) {
|
|
17530
|
-
let n = t.desktop ?
|
|
17531
|
-
n &&
|
|
17594
|
+
let n = t.desktop ? Vc(t.desktop) : "";
|
|
17595
|
+
n && x.push(`.${e}{${n}}`);
|
|
17532
17596
|
}
|
|
17597
|
+
l.length && x.push(`@media (hover:hover){${l.map((e) => `.${e.cls}:hover{${Vc(e.css)}}`).join("")}}`), c && x.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}}");
|
|
17533
17598
|
for (let e of ["tablet", "mobile"]) {
|
|
17534
17599
|
let t = e === "tablet" ? "desktop" : "tablet", n = [];
|
|
17535
17600
|
for (let { cls: i, rule: a } of r) {
|
|
17536
|
-
let r =
|
|
17601
|
+
let r = Vc(Hc(a[t] ?? {}, a[e] ?? {}));
|
|
17537
17602
|
r && n.push(`.${i}{${r}}`);
|
|
17538
17603
|
}
|
|
17539
|
-
n.length &&
|
|
17604
|
+
n.length && x.push(`@container plx-page ${ge[e]}{${n.join("")}}`);
|
|
17540
17605
|
}
|
|
17541
|
-
let
|
|
17542
|
-
for (let e of
|
|
17543
|
-
let
|
|
17606
|
+
let S = x.join("\n");
|
|
17607
|
+
for (let e of Yo(v, S)) i.add(e);
|
|
17608
|
+
let C = [...i], te = new Set(C.filter((e) => g(v.fonts, e)).map((e) => e.toLowerCase())), ne = ce(v.fonts, te), w = ee(C.filter((e) => !te.has(e.toLowerCase())).map((e) => ({
|
|
17544
17609
|
family: e,
|
|
17545
17610
|
weights: [...a]
|
|
17546
17611
|
})));
|
|
17547
17612
|
return {
|
|
17548
|
-
tree:
|
|
17549
|
-
css: `${
|
|
17613
|
+
tree: y,
|
|
17614
|
+
css: `${ne ? `${ne}\n` : ""}${Xo(v, S)}\n${S}`,
|
|
17550
17615
|
usesRuntime: s,
|
|
17551
|
-
fonts:
|
|
17552
|
-
fontLinks:
|
|
17616
|
+
fonts: C,
|
|
17617
|
+
fontLinks: w,
|
|
17553
17618
|
warnings: o
|
|
17554
17619
|
};
|
|
17555
17620
|
}
|
|
17556
17621
|
//#endregion
|
|
17557
17622
|
//#region src/v2/compile/html.ts
|
|
17558
|
-
var
|
|
17623
|
+
var Kc = (e) => {
|
|
17559
17624
|
let t = "";
|
|
17560
17625
|
for (let [n, r] of Object.entries(e.attrs ?? {})) r === void 0 || r === !1 || (t += r === !0 ? ` ${n}` : ` ${n}="${dt(String(r))}"`);
|
|
17561
17626
|
if (e.style) {
|
|
@@ -17564,13 +17629,13 @@ var Vc = (e) => {
|
|
|
17564
17629
|
}
|
|
17565
17630
|
return t;
|
|
17566
17631
|
};
|
|
17567
|
-
function
|
|
17632
|
+
function qc(e) {
|
|
17568
17633
|
if (typeof e == "string") return ut(e);
|
|
17569
|
-
let t = `<${e.tag}${
|
|
17570
|
-
return rt.has(e.tag) ? t : `${t}${(e.children ?? []).map(
|
|
17634
|
+
let t = `<${e.tag}${Kc(e)}>`;
|
|
17635
|
+
return rt.has(e.tag) ? t : `${t}${(e.children ?? []).map(qc).join("")}</${e.tag}>`;
|
|
17571
17636
|
}
|
|
17572
|
-
function
|
|
17573
|
-
let n =
|
|
17637
|
+
function Jc(e, t = {}) {
|
|
17638
|
+
let n = Gc(e, t), r = qc(n.tree), i = t.runtime === "none" || !n.usesRuntime ? "" : `(${Rs})(document);`.replace(/<\/script/gi, "<\\/script"), a = Hs(t.customJs);
|
|
17574
17639
|
a.warning && n.warnings.push(a.warning);
|
|
17575
17640
|
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="${dt(e)}">`).join("")}` : "", c = `<!doctype html>
|
|
17576
17641
|
<html lang="${dt(t.lang ?? "en")}">
|
|
@@ -17596,48 +17661,48 @@ ${i ? `<script>${i}<\/script>\n` : ""}${a.code ? `<script>\n${a.code}\n<\/script
|
|
|
17596
17661
|
}
|
|
17597
17662
|
//#endregion
|
|
17598
17663
|
//#region src/v2/migrate/legacy.ts
|
|
17599
|
-
var
|
|
17664
|
+
var Yc = 1400, Xc = (e) => {
|
|
17600
17665
|
let t = e;
|
|
17601
17666
|
return !!t && typeof t == "object" && !!t.nodes && typeof t.nodes == "object" && !Array.isArray(t.nodes) && Array.isArray(t.pageOrder);
|
|
17602
|
-
},
|
|
17667
|
+
}, Zc = {
|
|
17603
17668
|
sm: "0 1px 3px rgba(15,23,42,0.14)",
|
|
17604
17669
|
md: "0 6px 16px rgba(15,23,42,0.18)",
|
|
17605
17670
|
lg: "0 16px 40px rgba(15,23,42,0.24)"
|
|
17606
|
-
}, G = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, K = (e) => typeof e == "string" && e ? e : void 0,
|
|
17671
|
+
}, G = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, K = (e) => typeof e == "string" && e ? e : void 0, Qc = (e) => `${Math.round(e * 100) / 100}px`, $c = [
|
|
17607
17672
|
{
|
|
17608
17673
|
name: "desktop",
|
|
17609
|
-
k: he.desktop /
|
|
17674
|
+
k: he.desktop / Yc,
|
|
17610
17675
|
minFont: 0
|
|
17611
17676
|
},
|
|
17612
17677
|
{
|
|
17613
17678
|
name: "tablet",
|
|
17614
|
-
k: he.tablet /
|
|
17679
|
+
k: he.tablet / Yc,
|
|
17615
17680
|
minFont: 12
|
|
17616
17681
|
},
|
|
17617
17682
|
{
|
|
17618
17683
|
name: "mobile",
|
|
17619
|
-
k: he.mobile /
|
|
17684
|
+
k: he.mobile / Yc,
|
|
17620
17685
|
minFont: 11
|
|
17621
17686
|
}
|
|
17622
17687
|
];
|
|
17623
|
-
function
|
|
17688
|
+
function el(e, t, n) {
|
|
17624
17689
|
let r = {};
|
|
17625
|
-
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 =
|
|
17690
|
+
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 = Qc(e.width * t.k), r.customWidth = r.width), e.height !== void 0 && (r.height = Qc(e.height * t.k)), e.minHeight !== void 0 && (r.minHeight = Qc(e.minHeight * t.k)), e.fontSize !== void 0 && (r.fontSize = Qc(Math.max(e.fontSize * t.k, t.minFont))), e.gap !== void 0 && (r.gap = Qc(e.gap * t.k)), r;
|
|
17626
17691
|
}
|
|
17627
|
-
function
|
|
17692
|
+
function tl(e, t) {
|
|
17628
17693
|
let { nodes: n } = e, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
17629
17694
|
let t = {}, n = G(e.borderWidth);
|
|
17630
|
-
n && n > 0 && (t.borderWidth =
|
|
17695
|
+
n && n > 0 && (t.borderWidth = Qc(n), t.borderStyle = [
|
|
17631
17696
|
"solid",
|
|
17632
17697
|
"dashed",
|
|
17633
17698
|
"dotted"
|
|
17634
17699
|
].includes(String(e.borderStyle)) ? e.borderStyle : "solid", t.borderColor = K(e.borderColor) ?? "#0f172a");
|
|
17635
17700
|
let r = G(e.borderRadius);
|
|
17636
|
-
r !== void 0 && (t.borderRadius =
|
|
17637
|
-
let i =
|
|
17701
|
+
r !== void 0 && (t.borderRadius = Qc(r));
|
|
17702
|
+
let i = Zc[String(e.boxShadowPreset)];
|
|
17638
17703
|
return i && (t.boxShadow = i), t;
|
|
17639
17704
|
}, a = (e, t, n) => {
|
|
17640
|
-
let [r, i, a] =
|
|
17705
|
+
let [r, i, a] = $c.map((n) => el(e, n, t)), o = (e, t) => Object.fromEntries(Object.entries(t).filter(([t, n]) => e[t] !== n));
|
|
17641
17706
|
return {
|
|
17642
17707
|
styles: {
|
|
17643
17708
|
...n,
|
|
@@ -17873,7 +17938,7 @@ function Xc(e, t) {
|
|
|
17873
17938
|
}
|
|
17874
17939
|
//#endregion
|
|
17875
17940
|
//#region src/v2/compile/sanitizeHtml.ts
|
|
17876
|
-
var
|
|
17941
|
+
var nl = new Map(Object.entries({
|
|
17877
17942
|
amp: "&",
|
|
17878
17943
|
lt: "<",
|
|
17879
17944
|
gt: ">",
|
|
@@ -17907,7 +17972,7 @@ var Zc = new Map(Object.entries({
|
|
|
17907
17972
|
}).map(([e, t]) => [e.toLowerCase(), t]));
|
|
17908
17973
|
function q(e) {
|
|
17909
17974
|
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) => {
|
|
17910
|
-
if (r !== void 0) return
|
|
17975
|
+
if (r !== void 0) return nl.get(r.toLowerCase()) ?? e;
|
|
17911
17976
|
let i = t === void 0 ? parseInt(n, 10) : parseInt(t, 16);
|
|
17912
17977
|
if (!Number.isFinite(i) || i <= 0 || i > 1114111) return "�";
|
|
17913
17978
|
try {
|
|
@@ -17917,40 +17982,40 @@ function q(e) {
|
|
|
17917
17982
|
}
|
|
17918
17983
|
});
|
|
17919
17984
|
}
|
|
17920
|
-
var
|
|
17921
|
-
function
|
|
17922
|
-
let t = e.replace(
|
|
17923
|
-
return !t || /^(https?|mailto|tel|sms):/i.test(t) ||
|
|
17985
|
+
var rl = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), il = /[\u0000-\u0020\u007f-\u009f\u200b-\u200f\u2028\u2029\ufeff]/g, al = (e) => /^(\/(?!\/)|\.{0,2}\/|#|\?)/.test(e) || !/^[a-z][a-z0-9+.-]*:/i.test(e) && !e.startsWith("//");
|
|
17986
|
+
function ol(e) {
|
|
17987
|
+
let t = e.replace(il, "");
|
|
17988
|
+
return !t || /^(https?|mailto|tel|sms):/i.test(t) || al(t);
|
|
17924
17989
|
}
|
|
17925
|
-
var
|
|
17926
|
-
function
|
|
17927
|
-
let t = e.replace(
|
|
17928
|
-
return !t ||
|
|
17990
|
+
var sl = /^data:image\/(png|jpe?g|gif|webp|avif|svg\+xml)[;,]/i;
|
|
17991
|
+
function cl(e) {
|
|
17992
|
+
let t = e.replace(il, "");
|
|
17993
|
+
return !t || sl.test(t) || /^https?:\/\//i.test(t) || /^(\/(?!\/)|\.{0,2}\/)/.test(t) || !/^[a-z][a-z0-9+.-]*:/i.test(t) && !t.startsWith("//");
|
|
17929
17994
|
}
|
|
17930
|
-
var
|
|
17931
|
-
let t = e.replace(
|
|
17995
|
+
var ll = (e) => {
|
|
17996
|
+
let t = e.replace(il, "");
|
|
17932
17997
|
return !t || /^https?:\/\//i.test(t) || /^(\/(?!\/)|\.{0,2}\/)/.test(t) || !/^[a-z][a-z0-9+.-]*:/i.test(t) && !t.startsWith("//");
|
|
17933
17998
|
};
|
|
17934
|
-
function
|
|
17999
|
+
function ul(e) {
|
|
17935
18000
|
let t;
|
|
17936
18001
|
try {
|
|
17937
|
-
t = new URL(e.replace(
|
|
18002
|
+
t = new URL(e.replace(il, ""));
|
|
17938
18003
|
} catch {
|
|
17939
18004
|
return !1;
|
|
17940
18005
|
}
|
|
17941
18006
|
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);
|
|
17942
18007
|
}
|
|
17943
|
-
function
|
|
18008
|
+
function dl(e) {
|
|
17944
18009
|
return e.replace(/\/\*[\s\S]*?(?:\*\/|$)/g, "").replace(/\\([0-9a-fA-F]{1,6})[ \t\n\r\f]?/g, (e, t) => {
|
|
17945
18010
|
let n = parseInt(t, 16);
|
|
17946
18011
|
return n > 0 && n <= 1114111 ? String.fromCodePoint(n) : "�";
|
|
17947
18012
|
}).replace(/\\([\s\S])/g, "$1").toLowerCase();
|
|
17948
18013
|
}
|
|
17949
|
-
var
|
|
17950
|
-
function
|
|
17951
|
-
let n = e.replace(
|
|
18014
|
+
var fl = /^data:(?:font\/(?:woff2?|ttf|otf|sfnt)|application\/(?:font-woff2?|x-font-(?:woff2?|ttf|otf|truetype|opentype)|octet-stream));base64,[a-z0-9+/=]+$/i;
|
|
18015
|
+
function pl(e, t) {
|
|
18016
|
+
let n = e.replace(il, "");
|
|
17952
18017
|
if (!n) return !1;
|
|
17953
|
-
if (
|
|
18018
|
+
if (fl.test(n)) return !0;
|
|
17954
18019
|
if (/^https:\/\//i.test(n)) {
|
|
17955
18020
|
let e;
|
|
17956
18021
|
try {
|
|
@@ -17962,19 +18027,19 @@ function cl(e, t) {
|
|
|
17962
18027
|
}
|
|
17963
18028
|
return /^\/(?!\/)/.test(n);
|
|
17964
18029
|
}
|
|
17965
|
-
function
|
|
18030
|
+
function ml(e, t) {
|
|
17966
18031
|
let n = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/g, r;
|
|
17967
18032
|
for (; r = n.exec(e);) {
|
|
17968
18033
|
let e = (r[1] ?? r[2] ?? r[3] ?? "").trim();
|
|
17969
|
-
if (!e.startsWith("#") && (t ? !
|
|
18034
|
+
if (!e.startsWith("#") && (t ? !pl(e, t.fontOrigins) : !cl(e))) return !1;
|
|
17970
18035
|
}
|
|
17971
18036
|
return (e.match(/url\(/g) ?? []).length === (e.match(n) ?? []).length;
|
|
17972
18037
|
}
|
|
17973
|
-
function
|
|
17974
|
-
let n =
|
|
17975
|
-
return !/expression\s*\(|javascript:|vbscript:|livescript:|(?:^|[^a-z-])behavior\s*:|-moz-binding|@import|image-set\s*\(|\bsrc\s*\(|<\/?script|<!--/.test(n) &&
|
|
18038
|
+
function hl(e, t) {
|
|
18039
|
+
let n = dl(e).replace(/\s+/g, " ");
|
|
18040
|
+
return !/expression\s*\(|javascript:|vbscript:|livescript:|(?:^|[^a-z-])behavior\s*:|-moz-binding|@import|image-set\s*\(|\bsrc\s*\(|<\/?script|<!--/.test(n) && ml(n, t);
|
|
17976
18041
|
}
|
|
17977
|
-
var
|
|
18042
|
+
var gl = (e, t) => !e.trim().startsWith("@") && e.includes(":") && !e.includes("<") && hl(e, t), _l = /* @__PURE__ */ new Set([
|
|
17978
18043
|
"media",
|
|
17979
18044
|
"container",
|
|
17980
18045
|
"supports",
|
|
@@ -17985,7 +18050,7 @@ var dl = (e, t) => !e.trim().startsWith("@") && e.includes(":") && !e.includes("
|
|
|
17985
18050
|
"page",
|
|
17986
18051
|
"property"
|
|
17987
18052
|
]);
|
|
17988
|
-
function
|
|
18053
|
+
function vl(e, t = {}) {
|
|
17989
18054
|
let n = (t.fontOrigins ?? []).map((e) => e.trim().replace(/\/+$/, "").toLowerCase()), r = 0, i = e.length, a = (t) => {
|
|
17990
18055
|
let n = e[t];
|
|
17991
18056
|
if (n === "\"" || n === "'") {
|
|
@@ -18026,22 +18091,22 @@ function pl(e, t = {}) {
|
|
|
18026
18091
|
r += 1;
|
|
18027
18092
|
}
|
|
18028
18093
|
let f = e.slice(l, Math.min(r, i));
|
|
18029
|
-
if (d === ";") r += 1,
|
|
18094
|
+
if (d === ";") r += 1, gl(f, s) ? c += `${f};` : /^\s*$/.test(f) && (c += f + ";");
|
|
18030
18095
|
else if (d === "{") {
|
|
18031
18096
|
r += 1;
|
|
18032
|
-
let t =
|
|
18097
|
+
let t = dl(f).trim(), i = r, a = o(!0, /^@font-face\b/.test(t) ? { fontOrigins: n } : void 0), s = e.slice(i, r).trim() !== "";
|
|
18033
18098
|
if (e[r] === "}" && (r += 1), s && a.trim() === "") continue;
|
|
18034
18099
|
if (t.startsWith("@")) {
|
|
18035
18100
|
let e = /^@([a-z-]+)/.exec(t)?.[1] ?? "";
|
|
18036
|
-
|
|
18037
|
-
} else
|
|
18038
|
-
} else (/^\s*$/.test(f) ||
|
|
18101
|
+
_l.has(e) && hl(f) && (c += `${f}{${a}}`);
|
|
18102
|
+
} else hl(f) && !/[<]/.test(f) && (c += `${f}{${a}}`);
|
|
18103
|
+
} else (/^\s*$/.test(f) || gl(f, s)) && (c += f);
|
|
18039
18104
|
}
|
|
18040
18105
|
return c;
|
|
18041
18106
|
};
|
|
18042
18107
|
return o(!1);
|
|
18043
18108
|
}
|
|
18044
|
-
var
|
|
18109
|
+
var yl = /* @__PURE__ */ new Set([
|
|
18045
18110
|
"script",
|
|
18046
18111
|
"style",
|
|
18047
18112
|
"textarea",
|
|
@@ -18052,8 +18117,8 @@ var ml = /* @__PURE__ */ new Set([
|
|
|
18052
18117
|
"noframes",
|
|
18053
18118
|
"noscript",
|
|
18054
18119
|
"plaintext"
|
|
18055
|
-
]),
|
|
18056
|
-
function
|
|
18120
|
+
]), bl = (e, t) => Object.prototype.hasOwnProperty.call(e, t), xl = (e) => e === " " || e === " " || e === "\n" || e === "\r" || e === "\f", Sl = (e) => !!e && /[A-Za-z]/.test(e);
|
|
18121
|
+
function Cl(e) {
|
|
18057
18122
|
let t = [], n = e.length, r = 0, i = "", a = () => {
|
|
18058
18123
|
i &&= (t.push({
|
|
18059
18124
|
k: "text",
|
|
@@ -18085,10 +18150,10 @@ function vl(e) {
|
|
|
18085
18150
|
continue;
|
|
18086
18151
|
}
|
|
18087
18152
|
if (o === "/") {
|
|
18088
|
-
if (
|
|
18153
|
+
if (Sl(e[r + 2])) {
|
|
18089
18154
|
a();
|
|
18090
18155
|
let i = r + 2;
|
|
18091
|
-
for (; i < n && !
|
|
18156
|
+
for (; i < n && !xl(e[i]) && e[i] !== "/" && e[i] !== ">";) i += 1;
|
|
18092
18157
|
let o = e.slice(r + 2, i).toLowerCase(), s = e.indexOf(">", i);
|
|
18093
18158
|
t.push({
|
|
18094
18159
|
k: "end",
|
|
@@ -18101,27 +18166,27 @@ function vl(e) {
|
|
|
18101
18166
|
}
|
|
18102
18167
|
continue;
|
|
18103
18168
|
}
|
|
18104
|
-
if (!
|
|
18169
|
+
if (!Sl(o)) {
|
|
18105
18170
|
i += "<", r += 1;
|
|
18106
18171
|
continue;
|
|
18107
18172
|
}
|
|
18108
18173
|
let s = r + 1;
|
|
18109
|
-
for (; s < n && !
|
|
18174
|
+
for (; s < n && !xl(e[s]) && e[s] !== "/" && e[s] !== ">";) s += 1;
|
|
18110
18175
|
let c = e.slice(r + 1, s).toLowerCase(), l = [], u = !1, d = !1;
|
|
18111
18176
|
for (; s < n;) {
|
|
18112
|
-
for (; s < n && (
|
|
18177
|
+
for (; s < n && (xl(e[s]) || e[s] === "/");) e[s] === "/" && e[s + 1] === ">" && (u = !0), s += 1;
|
|
18113
18178
|
if (e[s] === ">") {
|
|
18114
18179
|
d = !0, s += 1;
|
|
18115
18180
|
break;
|
|
18116
18181
|
}
|
|
18117
18182
|
if (s >= n) break;
|
|
18118
18183
|
let t = s;
|
|
18119
|
-
for (s += 1; s < n && !
|
|
18184
|
+
for (s += 1; s < n && !xl(e[s]) && e[s] !== "/" && e[s] !== ">" && e[s] !== "=";) s += 1;
|
|
18120
18185
|
let r = e.slice(t, s).toLowerCase();
|
|
18121
|
-
for (; s < n &&
|
|
18186
|
+
for (; s < n && xl(e[s]);) s += 1;
|
|
18122
18187
|
let i = null;
|
|
18123
18188
|
if (e[s] === "=") {
|
|
18124
|
-
for (s += 1; s < n &&
|
|
18189
|
+
for (s += 1; s < n && xl(e[s]);) s += 1;
|
|
18125
18190
|
let t = e[s];
|
|
18126
18191
|
if (t === "\"" || t === "'") {
|
|
18127
18192
|
let r = e.indexOf(t, s + 1);
|
|
@@ -18132,7 +18197,7 @@ function vl(e) {
|
|
|
18132
18197
|
i = e.slice(s + 1, r), s = r + 1;
|
|
18133
18198
|
} else {
|
|
18134
18199
|
let t = s;
|
|
18135
|
-
for (; s < n && !
|
|
18200
|
+
for (; s < n && !xl(e[s]) && e[s] !== ">";) s += 1;
|
|
18136
18201
|
i = e.slice(t, s);
|
|
18137
18202
|
}
|
|
18138
18203
|
}
|
|
@@ -18146,7 +18211,7 @@ function vl(e) {
|
|
|
18146
18211
|
r = n;
|
|
18147
18212
|
break;
|
|
18148
18213
|
}
|
|
18149
|
-
if (r = s,
|
|
18214
|
+
if (r = s, yl.has(c)) {
|
|
18150
18215
|
if (c === "plaintext") {
|
|
18151
18216
|
t.push({
|
|
18152
18217
|
k: "raw",
|
|
@@ -18178,7 +18243,7 @@ function vl(e) {
|
|
|
18178
18243
|
}
|
|
18179
18244
|
return a(), t;
|
|
18180
18245
|
}
|
|
18181
|
-
var
|
|
18246
|
+
var wl = /* @__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(".")), Tl = /* @__PURE__ */ new Set([
|
|
18182
18247
|
"img",
|
|
18183
18248
|
"hr",
|
|
18184
18249
|
"br",
|
|
@@ -18187,7 +18252,7 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18187
18252
|
"col",
|
|
18188
18253
|
"meta",
|
|
18189
18254
|
"link"
|
|
18190
|
-
]),
|
|
18255
|
+
]), El = /* @__PURE__ */ new Set([
|
|
18191
18256
|
"svg",
|
|
18192
18257
|
"g",
|
|
18193
18258
|
"path",
|
|
@@ -18197,7 +18262,7 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18197
18262
|
"polyline",
|
|
18198
18263
|
"polygon",
|
|
18199
18264
|
"ellipse"
|
|
18200
|
-
]),
|
|
18265
|
+
]), Dl = /* @__PURE__ */ new Set([
|
|
18201
18266
|
"open",
|
|
18202
18267
|
"required",
|
|
18203
18268
|
"disabled",
|
|
@@ -18213,7 +18278,7 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18213
18278
|
"allowfullscreen",
|
|
18214
18279
|
"hidden",
|
|
18215
18280
|
"novalidate"
|
|
18216
|
-
]),
|
|
18281
|
+
]), Ol = {
|
|
18217
18282
|
id: /^[\w:.[\]-]{1,200}$/,
|
|
18218
18283
|
role: /^[a-z-]{1,30}$/,
|
|
18219
18284
|
tabindex: /^-?\d{1,3}$/,
|
|
@@ -18221,11 +18286,11 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18221
18286
|
dir: /^(ltr|rtl|auto)$/i,
|
|
18222
18287
|
draggable: /^(true|false)$/,
|
|
18223
18288
|
translate: /^(yes|no)$/
|
|
18224
|
-
},
|
|
18289
|
+
}, kl = /* @__PURE__ */ new Set([
|
|
18225
18290
|
"class",
|
|
18226
18291
|
"title",
|
|
18227
18292
|
"hidden"
|
|
18228
|
-
]),
|
|
18293
|
+
]), Al = /^\d{1,5}(?:\.\d+)?(?:px|%|em|rem)?$/, jl = /^[\w:.[\]-]{1,200}$/, Ml = /* @__PURE__ */ new Set([
|
|
18229
18294
|
"text",
|
|
18230
18295
|
"email",
|
|
18231
18296
|
"tel",
|
|
@@ -18244,7 +18309,7 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18244
18309
|
"file",
|
|
18245
18310
|
"color",
|
|
18246
18311
|
"range"
|
|
18247
|
-
]),
|
|
18312
|
+
]), Nl = {
|
|
18248
18313
|
a: {
|
|
18249
18314
|
href: "href",
|
|
18250
18315
|
target: /^(_blank|_self)$/,
|
|
@@ -18255,8 +18320,8 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18255
18320
|
alt: "plain",
|
|
18256
18321
|
loading: /^(lazy|eager)$/,
|
|
18257
18322
|
decoding: /^(async|sync|auto)$/,
|
|
18258
|
-
width:
|
|
18259
|
-
height:
|
|
18323
|
+
width: Al,
|
|
18324
|
+
height: Al
|
|
18260
18325
|
},
|
|
18261
18326
|
video: {
|
|
18262
18327
|
src: "media",
|
|
@@ -18267,13 +18332,13 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18267
18332
|
loop: "bool",
|
|
18268
18333
|
autoplay: "bool",
|
|
18269
18334
|
muted: "bool",
|
|
18270
|
-
width:
|
|
18271
|
-
height:
|
|
18335
|
+
width: Al,
|
|
18336
|
+
height: Al
|
|
18272
18337
|
},
|
|
18273
18338
|
button: {
|
|
18274
18339
|
type: /^(submit|button|reset)$/,
|
|
18275
18340
|
disabled: "bool",
|
|
18276
|
-
name:
|
|
18341
|
+
name: jl,
|
|
18277
18342
|
value: "plain"
|
|
18278
18343
|
},
|
|
18279
18344
|
form: {
|
|
@@ -18284,7 +18349,7 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18284
18349
|
enctype: /^(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)$/
|
|
18285
18350
|
},
|
|
18286
18351
|
input: {
|
|
18287
|
-
name:
|
|
18352
|
+
name: jl,
|
|
18288
18353
|
value: "plain",
|
|
18289
18354
|
placeholder: "plain",
|
|
18290
18355
|
required: "bool",
|
|
@@ -18302,7 +18367,7 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18302
18367
|
size: /^\d{1,3}$/
|
|
18303
18368
|
},
|
|
18304
18369
|
textarea: {
|
|
18305
|
-
name:
|
|
18370
|
+
name: jl,
|
|
18306
18371
|
rows: /^\d{1,3}$/,
|
|
18307
18372
|
cols: /^\d{1,3}$/,
|
|
18308
18373
|
placeholder: "plain",
|
|
@@ -18314,7 +18379,7 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18314
18379
|
autocomplete: /^[\w\s-]{1,60}$/
|
|
18315
18380
|
},
|
|
18316
18381
|
select: {
|
|
18317
|
-
name:
|
|
18382
|
+
name: jl,
|
|
18318
18383
|
required: "bool",
|
|
18319
18384
|
multiple: "bool",
|
|
18320
18385
|
disabled: "bool",
|
|
@@ -18330,10 +18395,10 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18330
18395
|
label: "plain",
|
|
18331
18396
|
disabled: "bool"
|
|
18332
18397
|
},
|
|
18333
|
-
label: { for:
|
|
18398
|
+
label: { for: jl },
|
|
18334
18399
|
details: {
|
|
18335
18400
|
open: "bool",
|
|
18336
|
-
name:
|
|
18401
|
+
name: jl
|
|
18337
18402
|
},
|
|
18338
18403
|
th: {
|
|
18339
18404
|
scope: /^(col|row|colgroup|rowgroup)$/,
|
|
@@ -18348,84 +18413,84 @@ var yl = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
18348
18413
|
time: { datetime: "plain" },
|
|
18349
18414
|
html: {},
|
|
18350
18415
|
body: {}
|
|
18351
|
-
},
|
|
18416
|
+
}, Pl = /* @__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(".")), Fl = {
|
|
18352
18417
|
viewbox: "viewBox",
|
|
18353
18418
|
preserveaspectratio: "preserveAspectRatio"
|
|
18354
|
-
},
|
|
18419
|
+
}, Il = /^[\w\s.,#%()+\-:/]*$/, Ll = /* @__PURE__ */ new Set([
|
|
18355
18420
|
"allow-popups",
|
|
18356
18421
|
"allow-popups-to-escape-sandbox",
|
|
18357
18422
|
"allow-forms",
|
|
18358
18423
|
"allow-scripts",
|
|
18359
18424
|
"allow-presentation"
|
|
18360
|
-
]),
|
|
18361
|
-
function
|
|
18425
|
+
]), Rl = /^[\w\s;*-]{0,200}$/, zl = `(${Rs})(document);`.replace(/<\/script/gi, "<\\/script");
|
|
18426
|
+
function Bl(e, t) {
|
|
18362
18427
|
let n = e.raw, r = n === null ? "" : q(n), i = n === null ? "" : `="${n.replace(/"/g, """)}"`;
|
|
18363
|
-
return t === "bool" ? n === null || n === "" || n.toLowerCase() === e.name ? n === null ? "" : i : null : t === "plain" ? i : t === "href" ?
|
|
18428
|
+
return t === "bool" ? n === null || n === "" || n.toLowerCase() === e.name ? n === null ? "" : i : null : t === "plain" ? i : t === "href" ? ol(r) ? i : e.name === "href" ? ((e) => `="${rl(e)}"`)("#") : null : t === "image" ? cl(r) ? i : null : t === "media" ? ll(r) ? i : null : t.test(r) ? i : null;
|
|
18364
18429
|
}
|
|
18365
|
-
function
|
|
18430
|
+
function Vl(e) {
|
|
18366
18431
|
if (e.raw === null) return null;
|
|
18367
|
-
let t = q(e.raw), n =
|
|
18368
|
-
return n === t ? `="${e.raw.replace(/"/g, """)}"` : n.trim() ? `="${
|
|
18432
|
+
let t = q(e.raw), n = vl(t);
|
|
18433
|
+
return n === t ? `="${e.raw.replace(/"/g, """)}"` : n.trim() ? `="${rl(n)}"` : null;
|
|
18369
18434
|
}
|
|
18370
|
-
function
|
|
18371
|
-
let r = "", i =
|
|
18435
|
+
function Hl(e, t, n) {
|
|
18436
|
+
let r = "", i = bl(Nl, e) ? Nl[e] : {};
|
|
18372
18437
|
for (let e of t) {
|
|
18373
18438
|
let t = e.name;
|
|
18374
18439
|
if (!/^[a-z][a-z0-9:_.-]*$/.test(t) || t.startsWith("on")) continue;
|
|
18375
18440
|
let a = null;
|
|
18376
|
-
if (t === "style") a =
|
|
18441
|
+
if (t === "style") a = Vl(e);
|
|
18377
18442
|
else if (n) {
|
|
18378
|
-
if (
|
|
18443
|
+
if (Pl.has(t) || t === "class" || /^aria-[a-z-]+$/.test(t) || t === "role" || t === "id") {
|
|
18379
18444
|
let n = e.raw === null ? "" : q(e.raw);
|
|
18380
|
-
a = t === "class" || t === "id" || t === "role" ?
|
|
18445
|
+
a = t === "class" || t === "id" || t === "role" ? Bl(e, bl(Ol, t) ? Ol[t] : "plain") : Il.test(n) && !/javascript:|data:/i.test(n) ? e.raw === null ? "" : `="${e.raw.replace(/"/g, """)}"` : null;
|
|
18381
18446
|
}
|
|
18382
|
-
} else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(t) || /^aria-[a-z-]+$/.test(t) ? a = e.raw === null ? "" : `="${e.raw.replace(/"/g, """)}"` :
|
|
18447
|
+
} else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(t) || /^aria-[a-z-]+$/.test(t) ? a = e.raw === null ? "" : `="${e.raw.replace(/"/g, """)}"` : bl(i, t) ? a = Bl(e, i[t]) : bl(Ol, t) ? a = Bl(e, Ol[t]) : kl.has(t) && (a = t === "hidden" ? Bl(e, "bool") : Bl(e, "plain"));
|
|
18383
18448
|
if (a === null) continue;
|
|
18384
18449
|
let o = /^data-(plx|plexo)-/.test(t) && e.written && e.written.toLowerCase() === t ? e.written : t;
|
|
18385
|
-
r += ` ${/^data-/.test(t) ? o : n &&
|
|
18450
|
+
r += ` ${/^data-/.test(t) ? o : n && bl(Fl, t) ? Fl[t] : t}${Dl.has(t) && a === "" ? "" : a}`;
|
|
18386
18451
|
}
|
|
18387
18452
|
return r;
|
|
18388
18453
|
}
|
|
18389
|
-
function
|
|
18454
|
+
function Ul(e, t) {
|
|
18390
18455
|
if (e === "input") {
|
|
18391
18456
|
let e = "";
|
|
18392
18457
|
for (let n of t) if (n.name === "type") {
|
|
18393
18458
|
let t = n.raw === null ? "text" : q(n.raw).trim().toLowerCase();
|
|
18394
|
-
e += ` type="${
|
|
18395
|
-
} else e +=
|
|
18459
|
+
e += ` type="${Ml.has(t) ? rl(t) : "text"}"`;
|
|
18460
|
+
} else e += Hl("input", [n], !1);
|
|
18396
18461
|
return e;
|
|
18397
18462
|
}
|
|
18398
|
-
return
|
|
18463
|
+
return Hl(e, t, !1);
|
|
18399
18464
|
}
|
|
18400
|
-
function
|
|
18465
|
+
function Wl(e, t) {
|
|
18401
18466
|
let n = (t) => e.find((e) => e.name === t), r = n("src"), i = n("srcdoc"), a = () => {
|
|
18402
18467
|
let t = "";
|
|
18403
18468
|
for (let n of e) {
|
|
18404
18469
|
let e = n.raw === null ? "" : q(n.raw);
|
|
18405
18470
|
if (n.name === "title" || n.name === "loading" || n.name === "referrerpolicy" || n.name === "allowfullscreen") {
|
|
18406
|
-
let e =
|
|
18471
|
+
let e = Bl(n, n.name === "loading" ? /^(lazy|eager)$/ : n.name === "referrerpolicy" ? /^[a-z-]{1,40}$/ : n.name === "allowfullscreen" ? "bool" : "plain");
|
|
18407
18472
|
e !== null && (t += ` ${n.name}${e}`);
|
|
18408
|
-
} else if (n.name === "allow" &&
|
|
18409
|
-
else if (n.name === "width" || n.name === "height")
|
|
18410
|
-
else if (n.name === "class") t += ` class${
|
|
18473
|
+
} else if (n.name === "allow" && Rl.test(e)) t += ` allow${Bl(n, "plain")}`;
|
|
18474
|
+
else if (n.name === "width" || n.name === "height") Al.test(e) && (t += ` ${n.name}="${rl(e)}"`);
|
|
18475
|
+
else if (n.name === "class") t += ` class${Bl(n, "plain")}`;
|
|
18411
18476
|
else if (n.name === "style") {
|
|
18412
|
-
let e =
|
|
18477
|
+
let e = Vl(n);
|
|
18413
18478
|
e !== null && (t += ` style${e}`);
|
|
18414
18479
|
} else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(n.name) && (t += ` ${n.name}${n.raw === null ? "" : `="${n.raw.replace(/"/g, """)}"`}`);
|
|
18415
18480
|
}
|
|
18416
18481
|
return t;
|
|
18417
18482
|
};
|
|
18418
|
-
if (r && r.raw !== null &&
|
|
18483
|
+
if (r && r.raw !== null && ul(q(r.raw))) return ` src="${r.raw.replace(/"/g, """)}"${a()}`;
|
|
18419
18484
|
let o = n("sandbox");
|
|
18420
18485
|
if (i && o) {
|
|
18421
|
-
let n = (o.raw === null ? "" : q(o.raw)).split(/\s+/).filter(Boolean), r = n.filter((e) =>
|
|
18422
|
-
for (let t of e) t.name === "srcdoc" ? s += ` srcdoc="${(t.raw ?? "").replace(/"/g, """)}"` : t.name === "sandbox" && (s += ` sandbox="${r === i ? (t.raw ?? "").replace(/"/g, """) :
|
|
18486
|
+
let n = (o.raw === null ? "" : q(o.raw)).split(/\s+/).filter(Boolean), r = n.filter((e) => Ll.has(e.toLowerCase()) && (t.allowEmbedScripts !== !1 || e.toLowerCase() !== "allow-scripts")).map((e) => e.toLowerCase()).join(" "), i = n.join(" "), s = "";
|
|
18487
|
+
for (let t of e) t.name === "srcdoc" ? s += ` srcdoc="${(t.raw ?? "").replace(/"/g, """)}"` : t.name === "sandbox" && (s += ` sandbox="${r === i ? (t.raw ?? "").replace(/"/g, """) : rl(r)}"`);
|
|
18423
18488
|
return `${s}${a()}`;
|
|
18424
18489
|
}
|
|
18425
18490
|
return null;
|
|
18426
18491
|
}
|
|
18427
|
-
function
|
|
18428
|
-
let n = /* @__PURE__ */ new Set([
|
|
18492
|
+
function Gl(e, t = {}) {
|
|
18493
|
+
let n = /* @__PURE__ */ new Set([zl, ...t.allowedScripts ?? []]), r = Cl(typeof e == "string" ? e : ""), i = "", a = 0;
|
|
18429
18494
|
for (let e of r) switch (e.k) {
|
|
18430
18495
|
case "text":
|
|
18431
18496
|
i += e.v;
|
|
@@ -18436,25 +18501,25 @@ function Bl(e, t = {}) {
|
|
|
18436
18501
|
case "raw":
|
|
18437
18502
|
if (a > 0) break;
|
|
18438
18503
|
if (e.name === "script") e.attrs.length === 0 && n.has(e.content) && (i += `<script>${e.content}<\/script>`);
|
|
18439
|
-
else if (e.name === "style") i += `<style>${
|
|
18440
|
-
else if (e.name === "textarea") i += `<textarea${
|
|
18504
|
+
else if (e.name === "style") i += `<style>${vl(e.content, t)}</style>`;
|
|
18505
|
+
else if (e.name === "textarea") i += `<textarea${Hl("textarea", e.attrs, !1)}>${e.content.replace(/</g, "<")}</textarea>`;
|
|
18441
18506
|
else if (e.name === "title") i += `<title>${e.content.replace(/</g, "<")}</title>`;
|
|
18442
18507
|
else if (e.name === "iframe") {
|
|
18443
|
-
let n =
|
|
18508
|
+
let n = Wl(e.attrs, t);
|
|
18444
18509
|
n !== null && (i += `<iframe${n}></iframe>`);
|
|
18445
18510
|
}
|
|
18446
18511
|
break;
|
|
18447
18512
|
case "start": {
|
|
18448
18513
|
let { name: t } = e;
|
|
18449
18514
|
if (t === "svg") {
|
|
18450
|
-
i += `<svg${
|
|
18515
|
+
i += `<svg${Hl("svg", e.attrs, !0)}${e.selfClose ? "/" : ""}>`, e.selfClose || (a += 1);
|
|
18451
18516
|
break;
|
|
18452
18517
|
}
|
|
18453
18518
|
if (a > 0) {
|
|
18454
|
-
|
|
18519
|
+
El.has(t) && (i += `<${t}${Hl(t, e.attrs, !0)}${e.selfClose ? "/" : ""}>`);
|
|
18455
18520
|
break;
|
|
18456
18521
|
}
|
|
18457
|
-
if (
|
|
18522
|
+
if (wl.has(t)) i += `<${t}${Ul(t, e.attrs)}>`;
|
|
18458
18523
|
else if (t === "meta") {
|
|
18459
18524
|
let t = (t) => e.attrs.find((e) => e.name === t), n = t("charset"), r = t("name"), a = t("content");
|
|
18460
18525
|
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}">`);
|
|
@@ -18472,7 +18537,7 @@ function Bl(e, t = {}) {
|
|
|
18472
18537
|
}
|
|
18473
18538
|
case "end": {
|
|
18474
18539
|
let { name: t } = e;
|
|
18475
|
-
t === "svg" ? a > 0 && (--a, i += "</svg>") : a > 0 ?
|
|
18540
|
+
t === "svg" ? a > 0 && (--a, i += "</svg>") : a > 0 ? El.has(t) && (i += `</${t}>`) : wl.has(t) && !Tl.has(t) && (i += `</${t}>`);
|
|
18476
18541
|
break;
|
|
18477
18542
|
}
|
|
18478
18543
|
}
|
|
@@ -18481,7 +18546,7 @@ function Bl(e, t = {}) {
|
|
|
18481
18546
|
}
|
|
18482
18547
|
//#endregion
|
|
18483
18548
|
//#region src/v2/compile/schema.ts
|
|
18484
|
-
var
|
|
18549
|
+
var Kl = 5e3, ql = 40, Jl = /* @__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("."), Yl = [
|
|
18485
18550
|
"blogTitle",
|
|
18486
18551
|
"blogContent",
|
|
18487
18552
|
"blogFeaturedImage",
|
|
@@ -18498,70 +18563,70 @@ var Vl = 5e3, Hl = 40, Ul = /* @__PURE__ */ "page.section.container.columns.colu
|
|
|
18498
18563
|
"orderConfirmation",
|
|
18499
18564
|
"orderTracking",
|
|
18500
18565
|
"signupForm"
|
|
18501
|
-
],
|
|
18566
|
+
], Xl = r([t().int().min(1).max(96), n().max(4)]), Zl = a({
|
|
18502
18567
|
prefix: n().max(80),
|
|
18503
18568
|
productId: n().max(100),
|
|
18504
18569
|
serviceId: n().max(100),
|
|
18505
18570
|
mode: n().max(40),
|
|
18506
18571
|
storeMode: i(),
|
|
18507
|
-
limit:
|
|
18572
|
+
limit: Xl,
|
|
18508
18573
|
category: n().max(100),
|
|
18509
18574
|
sort: n().max(100),
|
|
18510
|
-
itemsPerRow:
|
|
18511
|
-
itemsPerPage:
|
|
18575
|
+
itemsPerRow: Xl,
|
|
18576
|
+
itemsPerPage: Xl,
|
|
18512
18577
|
paginated: i(),
|
|
18513
18578
|
templateId: n().max(100)
|
|
18514
|
-
}).partial().passthrough(),
|
|
18579
|
+
}).partial().passthrough(), Ql = r([
|
|
18515
18580
|
n().max(2e3),
|
|
18516
18581
|
t(),
|
|
18517
18582
|
i()
|
|
18518
|
-
]),
|
|
18583
|
+
]), $l = d(n(), Ql.optional()), eu = o(() => a({
|
|
18519
18584
|
id: n().min(1).max(200),
|
|
18520
|
-
type: u(
|
|
18585
|
+
type: u(Jl),
|
|
18521
18586
|
name: n().max(300),
|
|
18522
18587
|
content: n().max(1e5).optional(),
|
|
18523
18588
|
props: d(n(), s()).optional(),
|
|
18524
|
-
styles:
|
|
18589
|
+
styles: $l,
|
|
18525
18590
|
responsive: a({
|
|
18526
|
-
tablet:
|
|
18527
|
-
mobile:
|
|
18591
|
+
tablet: $l.optional(),
|
|
18592
|
+
mobile: $l.optional()
|
|
18528
18593
|
}).optional(),
|
|
18529
18594
|
responsiveVisibility: a({
|
|
18530
18595
|
hideOnDesktop: i().optional(),
|
|
18531
18596
|
hideOnTablet: i().optional(),
|
|
18532
18597
|
hideOnMobile: i().optional()
|
|
18533
18598
|
}).optional(),
|
|
18534
|
-
children: c(
|
|
18599
|
+
children: c(eu).optional(),
|
|
18535
18600
|
locked: i().optional(),
|
|
18536
18601
|
hidden: i().optional()
|
|
18537
18602
|
}).superRefine((e, t) => {
|
|
18538
|
-
if (!
|
|
18539
|
-
let n =
|
|
18603
|
+
if (!Yl.includes(e.type) || !e.props) return;
|
|
18604
|
+
let n = Zl.safeParse(e.props);
|
|
18540
18605
|
n.success || t.addIssue({
|
|
18541
18606
|
code: "custom",
|
|
18542
18607
|
path: ["props", ...n.error.issues[0].path],
|
|
18543
18608
|
message: `The settings of "${e.name}" aren't valid (${n.error.issues[0].path.join(" › ") || "settings"}: ${n.error.issues[0].message})`
|
|
18544
18609
|
});
|
|
18545
|
-
})),
|
|
18610
|
+
})), tu = a({
|
|
18546
18611
|
id: n().min(1).max(200),
|
|
18547
18612
|
name: n().max(300),
|
|
18548
18613
|
slug: n().max(300),
|
|
18549
18614
|
isHome: i().optional(),
|
|
18550
|
-
rootNode:
|
|
18615
|
+
rootNode: eu
|
|
18551
18616
|
});
|
|
18552
|
-
function
|
|
18553
|
-
if (n.n += 1, n.n > 5e3) return `This design is too large (more than ${
|
|
18617
|
+
function nu(e, t, n) {
|
|
18618
|
+
if (n.n += 1, n.n > 5e3) return `This design is too large (more than ${Kl} elements).`;
|
|
18554
18619
|
if (t > 40) return "This design is nested too deeply.";
|
|
18555
18620
|
if (n.ids.has(e.id)) return `Two elements share the same id ("${e.id}"). Each element needs its own.`;
|
|
18556
18621
|
n.ids.add(e.id);
|
|
18557
18622
|
for (let r of e.children ?? []) {
|
|
18558
|
-
let e =
|
|
18623
|
+
let e = nu(r, t + 1, n);
|
|
18559
18624
|
if (e) return e;
|
|
18560
18625
|
}
|
|
18561
18626
|
return null;
|
|
18562
18627
|
}
|
|
18563
|
-
function
|
|
18564
|
-
let t = c(
|
|
18628
|
+
function ru(e) {
|
|
18629
|
+
let t = c(tu).min(1, "A design needs at least one page.").safeParse(e);
|
|
18565
18630
|
if (!t.success) {
|
|
18566
18631
|
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"})` : "";
|
|
18567
18632
|
return {
|
|
@@ -18571,7 +18636,7 @@ function Ql(e) {
|
|
|
18571
18636
|
}
|
|
18572
18637
|
let n = t.data;
|
|
18573
18638
|
for (let e of n) {
|
|
18574
|
-
let t =
|
|
18639
|
+
let t = nu(e.rootNode, 0, {
|
|
18575
18640
|
n: 0,
|
|
18576
18641
|
ids: /* @__PURE__ */ new Set()
|
|
18577
18642
|
});
|
|
@@ -18587,7 +18652,7 @@ function Ql(e) {
|
|
|
18587
18652
|
}
|
|
18588
18653
|
//#endregion
|
|
18589
18654
|
//#region src/v2/migrate/v1.ts
|
|
18590
|
-
var
|
|
18655
|
+
var iu = {
|
|
18591
18656
|
blog_title: "blogTitle",
|
|
18592
18657
|
blog_content: "blogContent",
|
|
18593
18658
|
blog_featured_image: "blogFeaturedImage",
|
|
@@ -18604,7 +18669,7 @@ var $l = {
|
|
|
18604
18669
|
order_tracking: "orderTracking",
|
|
18605
18670
|
booking: "booking",
|
|
18606
18671
|
maildrip_form: null
|
|
18607
|
-
},
|
|
18672
|
+
}, au = !0, ou = [
|
|
18608
18673
|
"prefix",
|
|
18609
18674
|
"productId",
|
|
18610
18675
|
"serviceId",
|
|
@@ -18616,7 +18681,7 @@ var $l = {
|
|
|
18616
18681
|
"itemsPerRow",
|
|
18617
18682
|
"itemsPerPage",
|
|
18618
18683
|
"paginated"
|
|
18619
|
-
],
|
|
18684
|
+
], su = {
|
|
18620
18685
|
blog_title: "blog title",
|
|
18621
18686
|
blog_content: "blog post text",
|
|
18622
18687
|
blog_featured_image: "blog picture",
|
|
@@ -18632,7 +18697,7 @@ var $l = {
|
|
|
18632
18697
|
checkout_flow: "checkout",
|
|
18633
18698
|
order_confirmation: "order confirmation",
|
|
18634
18699
|
order_tracking: "order tracking"
|
|
18635
|
-
},
|
|
18700
|
+
}, cu = (e) => !!e && typeof e == "object" && !Array.isArray(e), J = (e) => cu(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) : "", lu = {
|
|
18636
18701
|
amp: "&",
|
|
18637
18702
|
lt: "<",
|
|
18638
18703
|
gt: ">",
|
|
@@ -18647,7 +18712,7 @@ var $l = {
|
|
|
18647
18712
|
ndash: "–",
|
|
18648
18713
|
hellip: "…",
|
|
18649
18714
|
copy: "©"
|
|
18650
|
-
},
|
|
18715
|
+
}, uu = (e) => e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (e, t) => {
|
|
18651
18716
|
if (t[0] === "#") {
|
|
18652
18717
|
let e = t[1].toLowerCase() === "x" ? parseInt(t.slice(2), 16) : parseInt(t.slice(1), 10);
|
|
18653
18718
|
try {
|
|
@@ -18656,37 +18721,37 @@ var $l = {
|
|
|
18656
18721
|
return "";
|
|
18657
18722
|
}
|
|
18658
18723
|
}
|
|
18659
|
-
return
|
|
18724
|
+
return lu[t.toLowerCase()] ?? e;
|
|
18660
18725
|
});
|
|
18661
18726
|
function Z(e) {
|
|
18662
18727
|
let t = /<(a|b|strong|i|em|u|s|span|font|ul|ol|li|img|sup|sub|mark|code)\b/i.test(e);
|
|
18663
18728
|
return {
|
|
18664
|
-
text:
|
|
18729
|
+
text: uu(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),
|
|
18665
18730
|
rich: t
|
|
18666
18731
|
};
|
|
18667
18732
|
}
|
|
18668
|
-
var
|
|
18733
|
+
var du = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-binding/i, fu = (e) => {
|
|
18669
18734
|
let t = X(e).trim();
|
|
18670
|
-
return t && t.length <= 300 && !
|
|
18671
|
-
},
|
|
18735
|
+
return t && t.length <= 300 && !du.test(t) ? t : void 0;
|
|
18736
|
+
}, pu = /* @__PURE__ */ new Set([
|
|
18672
18737
|
"left",
|
|
18673
18738
|
"center",
|
|
18674
18739
|
"right",
|
|
18675
18740
|
"justify"
|
|
18676
|
-
]),
|
|
18741
|
+
]), mu = /* @__PURE__ */ new Set([
|
|
18677
18742
|
"solid",
|
|
18678
18743
|
"dashed",
|
|
18679
18744
|
"dotted",
|
|
18680
18745
|
"none"
|
|
18681
|
-
]),
|
|
18746
|
+
]), hu = /* @__PURE__ */ new Set([
|
|
18682
18747
|
"none",
|
|
18683
18748
|
"uppercase",
|
|
18684
18749
|
"lowercase",
|
|
18685
18750
|
"capitalize"
|
|
18686
|
-
]),
|
|
18751
|
+
]), gu = (e) => {
|
|
18687
18752
|
let t = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/i.exec(e), n = (t?.[1] ?? t?.[2] ?? t?.[3] ?? "").trim();
|
|
18688
18753
|
return n && mt(n) || void 0;
|
|
18689
|
-
},
|
|
18754
|
+
}, _u = /* @__PURE__ */ new Set([
|
|
18690
18755
|
"autoHeight",
|
|
18691
18756
|
"autoWidth",
|
|
18692
18757
|
"position",
|
|
@@ -18704,13 +18769,13 @@ var ou = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-b
|
|
|
18704
18769
|
"verticalAlign",
|
|
18705
18770
|
"float"
|
|
18706
18771
|
]);
|
|
18707
|
-
function
|
|
18772
|
+
function vu(e) {
|
|
18708
18773
|
let t = J(e), n = {}, r = [], i = (e, t) => {
|
|
18709
18774
|
t !== void 0 && (n[e] = t);
|
|
18710
18775
|
};
|
|
18711
18776
|
for (let [e, a] of Object.entries(t)) {
|
|
18712
|
-
if (a == null || a === "" ||
|
|
18713
|
-
let t =
|
|
18777
|
+
if (a == null || a === "" || _u.has(e)) continue;
|
|
18778
|
+
let t = fu(a);
|
|
18714
18779
|
switch (e) {
|
|
18715
18780
|
case "color":
|
|
18716
18781
|
i("textColor", t);
|
|
@@ -18731,7 +18796,7 @@ function pu(e) {
|
|
|
18731
18796
|
i("letterSpacing", t);
|
|
18732
18797
|
break;
|
|
18733
18798
|
case "textTransform":
|
|
18734
|
-
t &&
|
|
18799
|
+
t && hu.has(t) && (n.textTransform = t);
|
|
18735
18800
|
break;
|
|
18736
18801
|
case "fontStyle":
|
|
18737
18802
|
t === "italic" && (n.isItalic = !0);
|
|
@@ -18740,7 +18805,7 @@ function pu(e) {
|
|
|
18740
18805
|
t && /underline/.test(t) && (n.isUnderline = !0);
|
|
18741
18806
|
break;
|
|
18742
18807
|
case "textAlign":
|
|
18743
|
-
t &&
|
|
18808
|
+
t && pu.has(t) && (n.textAlign = t);
|
|
18744
18809
|
break;
|
|
18745
18810
|
case "backgroundColor":
|
|
18746
18811
|
i("backgroundColor", t);
|
|
@@ -18749,7 +18814,7 @@ function pu(e) {
|
|
|
18749
18814
|
case "backgroundImage":
|
|
18750
18815
|
if (t && /gradient\(/i.test(t)) n.backgroundGradient = t;
|
|
18751
18816
|
else if (t && /url\(/i.test(t)) {
|
|
18752
|
-
let i =
|
|
18817
|
+
let i = gu(t);
|
|
18753
18818
|
i ? (n.backgroundImage = i, n.backgroundSize ??= "cover", n.backgroundPosition ??= "center") : r.push(e);
|
|
18754
18819
|
} else e === "background" ? i("backgroundColor", t) : t && r.push(e);
|
|
18755
18820
|
break;
|
|
@@ -18787,7 +18852,7 @@ function pu(e) {
|
|
|
18787
18852
|
i("gap", t);
|
|
18788
18853
|
break;
|
|
18789
18854
|
case "borderStyle":
|
|
18790
|
-
t &&
|
|
18855
|
+
t && mu.has(t) && (n.borderStyle = t);
|
|
18791
18856
|
break;
|
|
18792
18857
|
case "border": {
|
|
18793
18858
|
let i = t ? /^([\d.]+(?:px|rem|em)?)\s+(solid|dashed|dotted|none)\s*(.*)$/i.exec(t) : null;
|
|
@@ -18810,11 +18875,11 @@ function pu(e) {
|
|
|
18810
18875
|
unmapped: r
|
|
18811
18876
|
};
|
|
18812
18877
|
}
|
|
18813
|
-
var
|
|
18878
|
+
var yu = (e, ...t) => t.some((t) => X(e[t]).trim() !== ""), Q = (e, t) => {
|
|
18814
18879
|
e.seen.has(t) || (e.seen.add(t), e.warnings.push(t));
|
|
18815
|
-
},
|
|
18816
|
-
function
|
|
18817
|
-
let r =
|
|
18880
|
+
}, bu = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
18881
|
+
function xu(e, t, n) {
|
|
18882
|
+
let r = vu(t.style), i = vu(t.styleTablet), a = vu(t.styleMobile), o = [.../* @__PURE__ */ new Set([
|
|
18818
18883
|
...r.unmapped,
|
|
18819
18884
|
...i.unmapped,
|
|
18820
18885
|
...a.unmapped
|
|
@@ -18826,7 +18891,7 @@ function gu(e, t, n) {
|
|
|
18826
18891
|
responsive: Object.keys(s).length ? s : void 0
|
|
18827
18892
|
};
|
|
18828
18893
|
}
|
|
18829
|
-
function
|
|
18894
|
+
function Su(e, t) {
|
|
18830
18895
|
t !== "center" && t !== "right" || (!e.width && !e.widthSizing && (e.widthSizing = "hug"), e.marginLeft ||= "auto", !e.marginRight && t === "center" && (e.marginRight = "auto"));
|
|
18831
18896
|
}
|
|
18832
18897
|
var $ = (e, t, n, r, i = {}) => ({
|
|
@@ -18835,12 +18900,12 @@ var $ = (e, t, n, r, i = {}) => ({
|
|
|
18835
18900
|
name: n,
|
|
18836
18901
|
styles: r,
|
|
18837
18902
|
...i
|
|
18838
|
-
}),
|
|
18903
|
+
}), Cu = {
|
|
18839
18904
|
layoutMode: "flow",
|
|
18840
18905
|
display: "flex",
|
|
18841
18906
|
flexDirection: "column",
|
|
18842
18907
|
width: "100%"
|
|
18843
|
-
},
|
|
18908
|
+
}, wu = {
|
|
18844
18909
|
1: "32px",
|
|
18845
18910
|
2: "24px",
|
|
18846
18911
|
3: "19px",
|
|
@@ -18848,8 +18913,8 @@ var $ = (e, t, n, r, i = {}) => ({
|
|
|
18848
18913
|
5: "13px",
|
|
18849
18914
|
6: "11px"
|
|
18850
18915
|
};
|
|
18851
|
-
function
|
|
18852
|
-
let r = X(t.type), i = J(t.attributes), { styles: a, responsive: o } =
|
|
18916
|
+
function Tu(e, t, n) {
|
|
18917
|
+
let r = X(t.type), i = J(t.attributes), { styles: a, responsive: o } = xu(e, t, `${su[r] ?? r.replace(/_/g, " ")} block`), s = a.textAlign, c = (e, t, r = {}, i = a) => $(n, e, t, i, {
|
|
18853
18918
|
...o ? { responsive: o } : {},
|
|
18854
18919
|
...r
|
|
18855
18920
|
});
|
|
@@ -18858,7 +18923,7 @@ function bu(e, t, n) {
|
|
|
18858
18923
|
let { text: n, rich: r } = Z(X(i.text) || "Heading");
|
|
18859
18924
|
r && (e.approx = !0, Q(e, "Bold, italic and links inside text are simplified to plain text."));
|
|
18860
18925
|
let o = /^h([1-6])$/i.exec(X(i.headingType)), s = o ? Number(o[1]) : 2, l = { ...a };
|
|
18861
|
-
return l.fontSize ??=
|
|
18926
|
+
return l.fontSize ??= wu[s], l.fontWeight ??= "700", yu(J(t.style), "margin", "marginBottom") || (l.marginBottom = "8px"), [c("heading", n.slice(0, 40) || "Heading", {
|
|
18862
18927
|
content: n,
|
|
18863
18928
|
props: { level: s }
|
|
18864
18929
|
}, l)];
|
|
@@ -18868,14 +18933,14 @@ function bu(e, t, n) {
|
|
|
18868
18933
|
let s = X(i.text) || (r === "paragraph" ? "Paragraph text content." : ""), { rich: l } = Z(s);
|
|
18869
18934
|
l && (e.approx = !0, Q(e, "Bold, italic and links inside text are simplified to plain text."));
|
|
18870
18935
|
let u = s.split(/<\/p\s*>|(?:<br\s*\/?>\s*){2,}/i).map((e) => Z(e).text).filter(Boolean), d = u.length ? u : [""], f = { ...a };
|
|
18871
|
-
return r === "paragraph" && !
|
|
18936
|
+
return r === "paragraph" && !yu(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, {
|
|
18872
18937
|
content: e,
|
|
18873
18938
|
...o ? { responsive: o } : {}
|
|
18874
18939
|
}));
|
|
18875
18940
|
}
|
|
18876
18941
|
case "button": {
|
|
18877
18942
|
let t = { ...a };
|
|
18878
|
-
|
|
18943
|
+
Su(t, s), !t.widthSizing && !t.width && (t.widthSizing = "hug");
|
|
18879
18944
|
let n = X(i.href).trim();
|
|
18880
18945
|
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", {
|
|
18881
18946
|
content: Z(X(i.text) || "Button").text,
|
|
@@ -18884,7 +18949,7 @@ function bu(e, t, n) {
|
|
|
18884
18949
|
}
|
|
18885
18950
|
case "image": {
|
|
18886
18951
|
let e = { ...a };
|
|
18887
|
-
return i.autoHeight !== !1 && delete e.height, e.width ??= "100%",
|
|
18952
|
+
return i.autoHeight !== !1 && delete e.height, e.width ??= "100%", Su(e, s), [c("image", X(i.alt).slice(0, 40) || "Image", { props: {
|
|
18888
18953
|
src: mt(i.src),
|
|
18889
18954
|
alt: X(i.alt)
|
|
18890
18955
|
} }, e)];
|
|
@@ -18898,7 +18963,7 @@ function bu(e, t, n) {
|
|
|
18898
18963
|
case "spacer": return [c("spacer", "Spacer", {}, { height: a.height ?? "24px" })];
|
|
18899
18964
|
case "card": {
|
|
18900
18965
|
let e = {
|
|
18901
|
-
...
|
|
18966
|
+
...Cu,
|
|
18902
18967
|
gap: "8px",
|
|
18903
18968
|
...a
|
|
18904
18969
|
};
|
|
@@ -18915,10 +18980,10 @@ function bu(e, t, n) {
|
|
|
18915
18980
|
}, { content: Z(X(i.description) || "Card description.").text })] }, e)];
|
|
18916
18981
|
}
|
|
18917
18982
|
case "icon": {
|
|
18918
|
-
let t =
|
|
18983
|
+
let t = bu(X(i.iconName)), n = t in ac;
|
|
18919
18984
|
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."));
|
|
18920
18985
|
let r = { ...a };
|
|
18921
|
-
return r.fontSize ??= `${parseInt(X(i.iconSize), 10) || 48}px`, r.textColor ??= "#1e293b",
|
|
18986
|
+
return r.fontSize ??= `${parseInt(X(i.iconSize), 10) || 48}px`, r.textColor ??= "#1e293b", Su(r, s === "left" ? void 0 : s ?? "center"), [c("icon", "Icon", { props: {
|
|
18922
18987
|
iconName: n ? t : "star",
|
|
18923
18988
|
strokeWidth: 2,
|
|
18924
18989
|
label: X(i.alt) || X(i.label)
|
|
@@ -18946,7 +19011,7 @@ function bu(e, t, n) {
|
|
|
18946
19011
|
})).filter((e) => e.network in P);
|
|
18947
19012
|
r.length < n.length && (e.approx = !0, Q(e, "A social link to a network V2 has no icon for was left out."));
|
|
18948
19013
|
let o = parseInt(X(J(n[0]).size) || X(J(t.style).iconSize), 10), l = { ...a };
|
|
18949
|
-
return
|
|
19014
|
+
return Su(l, s), [c("social", "Social links", { props: {
|
|
18950
19015
|
links: r,
|
|
18951
19016
|
size: Number.isFinite(o) ? Math.min(96, Math.max(20, o)) : 40,
|
|
18952
19017
|
shape: X(i.iconType ?? J(n[0]).iconType) === "square" ? "square" : "circle",
|
|
@@ -18958,7 +19023,7 @@ function bu(e, t, n) {
|
|
|
18958
19023
|
label: X(e.label).trim() || "Link",
|
|
18959
19024
|
href: k(X(e.href) || "#")
|
|
18960
19025
|
})), t = { ...a };
|
|
18961
|
-
return (s === "center" || s === "right") &&
|
|
19026
|
+
return (s === "center" || s === "right") && Su(t, s), [c("menu", "Menu", { props: {
|
|
18962
19027
|
links: e,
|
|
18963
19028
|
layout: "horizontal",
|
|
18964
19029
|
mobile: "hamburger"
|
|
@@ -19003,15 +19068,15 @@ function bu(e, t, n) {
|
|
|
19003
19068
|
openFirst: n === 0
|
|
19004
19069
|
} })];
|
|
19005
19070
|
}
|
|
19006
|
-
case "form_container": return X(i.provider) === "maildrip" ?
|
|
19007
|
-
default: return r in
|
|
19071
|
+
case "form_container": return X(i.provider) === "maildrip" ? Eu(e, "maildrip_form", "a MailDrip sign-up form", n, i) : [Ou(e, n, i, Y(i.fields, 40).map(J), a, o)];
|
|
19072
|
+
default: return r in iu ? Eu(e, r, su[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.`), []);
|
|
19008
19073
|
}
|
|
19009
19074
|
}
|
|
19010
|
-
function
|
|
19011
|
-
let s =
|
|
19075
|
+
function Eu(e, t, n, r, i, a = {}, o) {
|
|
19076
|
+
let s = iu[t];
|
|
19012
19077
|
if (s) {
|
|
19013
19078
|
let e = {};
|
|
19014
|
-
for (let t of
|
|
19079
|
+
for (let t of ou) {
|
|
19015
19080
|
let n = i[t];
|
|
19016
19081
|
(typeof n == "string" || typeof n == "boolean" || typeof n == "number" && Number.isFinite(n)) && (e[t] = n);
|
|
19017
19082
|
}
|
|
@@ -19024,11 +19089,11 @@ function xu(e, t, n, r, i, a = {}, o) {
|
|
|
19024
19089
|
})];
|
|
19025
19090
|
}
|
|
19026
19091
|
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}`, {
|
|
19027
|
-
...
|
|
19092
|
+
...Cu,
|
|
19028
19093
|
minHeight: "40px"
|
|
19029
19094
|
}, { hidden: !0 })];
|
|
19030
19095
|
}
|
|
19031
|
-
var
|
|
19096
|
+
var Du = {
|
|
19032
19097
|
text: "text",
|
|
19033
19098
|
email: "email",
|
|
19034
19099
|
tel: "tel",
|
|
@@ -19040,15 +19105,15 @@ var Su = {
|
|
|
19040
19105
|
number: "text",
|
|
19041
19106
|
date: "text"
|
|
19042
19107
|
};
|
|
19043
|
-
function
|
|
19108
|
+
function Ou(e, t, n, r, i, a) {
|
|
19044
19109
|
let o = /* @__PURE__ */ new Set(), s = [];
|
|
19045
19110
|
for (let t of r) {
|
|
19046
|
-
let n = X(t.kind) || X(t.type) || X(t.inputType) || "text", r =
|
|
19047
|
-
(n === "radio" || n === "number" || n === "date" || !(n in
|
|
19111
|
+
let n = X(t.kind) || X(t.type) || X(t.inputType) || "text", r = Du[n] ?? "text";
|
|
19112
|
+
(n === "radio" || n === "number" || n === "date" || !(n in Du)) && (e.approx = !0, Q(e, `A "${n}" form field is now a ${r === "select" ? "drop-down" : "text"} field.`));
|
|
19048
19113
|
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;
|
|
19049
19114
|
for (let e = 2; o.has(a); e++) a = `${c}-${e}`;
|
|
19050
19115
|
o.add(a);
|
|
19051
|
-
let l = Y(t.options, 50).map((e) =>
|
|
19116
|
+
let l = Y(t.options, 50).map((e) => cu(e) ? X(e.label) || X(e.value) : X(e)).filter(Boolean);
|
|
19052
19117
|
s.push({
|
|
19053
19118
|
id: a,
|
|
19054
19119
|
label: i,
|
|
@@ -19076,12 +19141,12 @@ function Cu(e, t, n, r, i, a) {
|
|
|
19076
19141
|
...a ? { responsive: a } : {}
|
|
19077
19142
|
});
|
|
19078
19143
|
}
|
|
19079
|
-
var
|
|
19144
|
+
var ku = /* @__PURE__ */ new Set([
|
|
19080
19145
|
"input",
|
|
19081
19146
|
"textarea",
|
|
19082
19147
|
"select"
|
|
19083
19148
|
]);
|
|
19084
|
-
function
|
|
19149
|
+
function Au(e) {
|
|
19085
19150
|
let t = J(e.attributes), n = X(e.type);
|
|
19086
19151
|
return {
|
|
19087
19152
|
kind: n === "input" ? X(t.inputType) || X(t.type) || "text" : n,
|
|
@@ -19092,8 +19157,8 @@ function Tu(e) {
|
|
|
19092
19157
|
options: t.options
|
|
19093
19158
|
};
|
|
19094
19159
|
}
|
|
19095
|
-
function
|
|
19096
|
-
let t = Y(e.elements, 200).filter(
|
|
19160
|
+
function ju(e) {
|
|
19161
|
+
let t = Y(e.elements, 200).filter(cu), n = Y(e.nestedRows, 50).filter(cu), r = /* @__PURE__ */ new Map();
|
|
19097
19162
|
for (let e of t) r.set(X(e.id), {
|
|
19098
19163
|
kind: "el",
|
|
19099
19164
|
item: e
|
|
@@ -19117,11 +19182,11 @@ function Eu(e) {
|
|
|
19117
19182
|
});
|
|
19118
19183
|
return i;
|
|
19119
19184
|
}
|
|
19120
|
-
function
|
|
19185
|
+
function Mu(e, t = 1) {
|
|
19121
19186
|
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);
|
|
19122
19187
|
}
|
|
19123
|
-
function
|
|
19124
|
-
let i = [], a =
|
|
19188
|
+
function Nu(e, t, n, r) {
|
|
19189
|
+
let i = [], a = ju(t), o = 0;
|
|
19125
19190
|
for (let t = 0; t < a.length; t++) {
|
|
19126
19191
|
let s = a[t];
|
|
19127
19192
|
if (o += 1, s.kind === "row") {
|
|
@@ -19129,35 +19194,35 @@ function Ou(e, t, n, r) {
|
|
|
19129
19194
|
e.lost = !0, Q(e, "Rows nested very deeply were left out.");
|
|
19130
19195
|
continue;
|
|
19131
19196
|
}
|
|
19132
|
-
let t =
|
|
19197
|
+
let t = Fu(e, s.item, `${n}-r${o}`, r + 1, !1);
|
|
19133
19198
|
t && i.push(t);
|
|
19134
19199
|
continue;
|
|
19135
19200
|
}
|
|
19136
|
-
if (
|
|
19201
|
+
if (ku.has(X(s.item.type))) {
|
|
19137
19202
|
let r = [s.item];
|
|
19138
|
-
for (; t + 1 < a.length && a[t + 1].kind === "el" &&
|
|
19139
|
-
if (!
|
|
19140
|
-
e.approx = !0, Q(e, "Separate form fields were grouped into one form. Check its button and where it sends messages."), i.push(
|
|
19203
|
+
for (; t + 1 < a.length && a[t + 1].kind === "el" && ku.has(X(a[t + 1].item.type));) r.push(a[t + 1].item), t += 1;
|
|
19204
|
+
if (!Mu(e)) continue;
|
|
19205
|
+
e.approx = !0, Q(e, "Separate form fields were grouped into one form. Check its button and where it sends messages."), i.push(Ou(e, `${n}-e${o}`, {}, r.map(Au), xu(e, r[0], "form field").styles, void 0));
|
|
19141
19206
|
continue;
|
|
19142
19207
|
}
|
|
19143
|
-
|
|
19208
|
+
Mu(e, 2) && i.push(...Tu(e, s.item, `${n}-e${o}`));
|
|
19144
19209
|
}
|
|
19145
19210
|
return i;
|
|
19146
19211
|
}
|
|
19147
|
-
var
|
|
19212
|
+
var Pu = (e) => {
|
|
19148
19213
|
let t = parseFloat(X(e));
|
|
19149
19214
|
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
19150
19215
|
};
|
|
19151
|
-
function
|
|
19152
|
-
if (!
|
|
19153
|
-
let { styles: a, responsive: o } =
|
|
19216
|
+
function Fu(e, t, n, r, i) {
|
|
19217
|
+
if (!Mu(e, 3)) return null;
|
|
19218
|
+
let { styles: a, responsive: o } = xu(e, {
|
|
19154
19219
|
style: t.style,
|
|
19155
19220
|
styleTablet: t.styleTablet,
|
|
19156
19221
|
styleMobile: t.styleMobile
|
|
19157
|
-
}, "row"), s = Y(t.columns, 12).filter(
|
|
19222
|
+
}, "row"), s = Y(t.columns, 12).filter(cu), c = a.gap ?? (s.length > 1 ? "16px" : void 0);
|
|
19158
19223
|
delete a.gap;
|
|
19159
19224
|
let l = s.map((t, i) => {
|
|
19160
|
-
let a = `${n}-c${i + 1}`, { styles: o, responsive: s } =
|
|
19225
|
+
let a = `${n}-c${i + 1}`, { styles: o, responsive: s } = xu(e, {
|
|
19161
19226
|
style: t.styles,
|
|
19162
19227
|
styleTablet: t.stylesTablet,
|
|
19163
19228
|
styleMobile: t.stylesMobile
|
|
@@ -19166,13 +19231,13 @@ function Au(e, t, n, r, i) {
|
|
|
19166
19231
|
cid: a,
|
|
19167
19232
|
cs: o,
|
|
19168
19233
|
cr: s,
|
|
19169
|
-
children:
|
|
19234
|
+
children: Nu(e, t, a, r)
|
|
19170
19235
|
};
|
|
19171
19236
|
}), u;
|
|
19172
19237
|
if (l.length === 1) {
|
|
19173
19238
|
let e = l[0];
|
|
19174
19239
|
u = $(`${n}-body`, "container", "Content", {
|
|
19175
|
-
...
|
|
19240
|
+
...Cu,
|
|
19176
19241
|
...e.cs,
|
|
19177
19242
|
width: "100%"
|
|
19178
19243
|
}, {
|
|
@@ -19180,7 +19245,7 @@ function Au(e, t, n, r, i) {
|
|
|
19180
19245
|
...e.cr ? { responsive: e.cr } : {}
|
|
19181
19246
|
});
|
|
19182
19247
|
} else {
|
|
19183
|
-
let e = s.map((e) =>
|
|
19248
|
+
let e = s.map((e) => Pu(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)";
|
|
19184
19249
|
u = $(`${n}-cols`, "columns", "Columns", {
|
|
19185
19250
|
layoutMode: "grid",
|
|
19186
19251
|
display: "grid",
|
|
@@ -19194,7 +19259,7 @@ function Au(e, t, n, r, i) {
|
|
|
19194
19259
|
mobile: { gridTemplateColumns: "minmax(0, 1fr)" }
|
|
19195
19260
|
},
|
|
19196
19261
|
children: l.map((e) => $(e.cid, "column", "Column", {
|
|
19197
|
-
...
|
|
19262
|
+
...Cu,
|
|
19198
19263
|
...e.cs,
|
|
19199
19264
|
width: "100%"
|
|
19200
19265
|
}, {
|
|
@@ -19217,7 +19282,7 @@ function Au(e, t, n, r, i) {
|
|
|
19217
19282
|
}
|
|
19218
19283
|
return "";
|
|
19219
19284
|
})(u.children ?? []), p = d && d.replace(/[-_]+/g, " ") || f || (i ? "Section" : "Row"), m = yt(X(t.htmlClass)), h = {
|
|
19220
|
-
...
|
|
19285
|
+
...Cu,
|
|
19221
19286
|
...a,
|
|
19222
19287
|
...m ? { customClasses: m } : {}
|
|
19223
19288
|
};
|
|
@@ -19230,7 +19295,7 @@ function Au(e, t, n, r, i) {
|
|
|
19230
19295
|
...o ? { responsive: o } : {}
|
|
19231
19296
|
});
|
|
19232
19297
|
}
|
|
19233
|
-
var
|
|
19298
|
+
var Iu = (e, t = {}) => ({
|
|
19234
19299
|
id: e.id ?? "v1-page",
|
|
19235
19300
|
name: e.name ?? "Home",
|
|
19236
19301
|
slug: e.slug ?? "home",
|
|
@@ -19243,7 +19308,7 @@ var ju = (e, t = {}) => ({
|
|
|
19243
19308
|
children: []
|
|
19244
19309
|
}
|
|
19245
19310
|
});
|
|
19246
|
-
function
|
|
19311
|
+
function Lu(e, t = {}) {
|
|
19247
19312
|
let n = {
|
|
19248
19313
|
warnings: [],
|
|
19249
19314
|
seen: /* @__PURE__ */ new Set(),
|
|
@@ -19253,14 +19318,14 @@ function Mu(e, t = {}) {
|
|
|
19253
19318
|
capped: !1
|
|
19254
19319
|
}, r = {};
|
|
19255
19320
|
try {
|
|
19256
|
-
let i = J(e), a =
|
|
19321
|
+
let i = J(e), a = cu(i.body) ? i.body : null;
|
|
19257
19322
|
if (!a) return Q(n, "This doesn't look like a design from the old editor, so an empty page was made instead."), {
|
|
19258
|
-
page:
|
|
19323
|
+
page: Iu(t),
|
|
19259
19324
|
warnings: n.warnings,
|
|
19260
19325
|
fidelity: "partial",
|
|
19261
19326
|
extras: r
|
|
19262
19327
|
};
|
|
19263
|
-
let o = J(a.style), { styles: s, unmapped: c } =
|
|
19328
|
+
let o = J(a.style), { styles: s, unmapped: c } = vu(Object.fromEntries(Object.entries(o).filter(([e]) => ![
|
|
19264
19329
|
"customJs",
|
|
19265
19330
|
"customCss",
|
|
19266
19331
|
"favicon",
|
|
@@ -19269,17 +19334,17 @@ function Mu(e, t = {}) {
|
|
|
19269
19334
|
c.length && (n.approx = !0, Q(n, `Some page-wide styling (${c.slice(0, 4).join(", ")}) can't be carried over.`));
|
|
19270
19335
|
let l = X(o.customJs).trim();
|
|
19271
19336
|
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."));
|
|
19272
|
-
let u =
|
|
19337
|
+
let u = Iu(t, { ...s }), d = X(o.contentMaxWidth).trim();
|
|
19273
19338
|
u.rootNode.styles.layoutMode = "flow", u.rootNode.styles.display = "flex", u.rootNode.styles.flexDirection = "column";
|
|
19274
|
-
let f = Y(a.rows, 200).filter(
|
|
19339
|
+
let f = Y(a.rows, 200).filter(cu), p = [];
|
|
19275
19340
|
if (f.forEach((e, t) => {
|
|
19276
|
-
let r =
|
|
19341
|
+
let r = Fu(n, e, `v1-s${t + 1}`, 0, !0);
|
|
19277
19342
|
r && p.push(r);
|
|
19278
19343
|
}), d && d !== "1200px") {
|
|
19279
|
-
let e = d.toLowerCase() === "none" ? "100%" :
|
|
19344
|
+
let e = d.toLowerCase() === "none" ? "100%" : fu(d);
|
|
19280
19345
|
if (e) for (let t of p) for (let n of t.children ?? []) n.styles.maxWidth = e;
|
|
19281
19346
|
}
|
|
19282
|
-
u.rootNode.children = p,
|
|
19347
|
+
u.rootNode.children = p, Ru(u.rootNode) > 40 && (n.lost = !0, Q(n, "Rows nested too deeply were left out."), u.rootNode.children = p.map((e) => zu(e, 0)));
|
|
19283
19348
|
let m = n.lost ? "partial" : n.approx ? "approximate" : "exact";
|
|
19284
19349
|
return {
|
|
19285
19350
|
page: u,
|
|
@@ -19289,26 +19354,26 @@ function Mu(e, t = {}) {
|
|
|
19289
19354
|
};
|
|
19290
19355
|
} catch {
|
|
19291
19356
|
return {
|
|
19292
|
-
page:
|
|
19357
|
+
page: Iu(t),
|
|
19293
19358
|
warnings: [...n.warnings, "This design could not be read, so an empty page was made instead."],
|
|
19294
19359
|
fidelity: "partial",
|
|
19295
19360
|
extras: r
|
|
19296
19361
|
};
|
|
19297
19362
|
}
|
|
19298
19363
|
}
|
|
19299
|
-
function
|
|
19364
|
+
function Ru(e) {
|
|
19300
19365
|
let t = 0;
|
|
19301
|
-
for (let n of e.children ?? []) t = Math.max(t,
|
|
19366
|
+
for (let n of e.children ?? []) t = Math.max(t, Ru(n));
|
|
19302
19367
|
return t + 1;
|
|
19303
19368
|
}
|
|
19304
|
-
function
|
|
19369
|
+
function zu(e, t) {
|
|
19305
19370
|
return t >= 38 ? {
|
|
19306
19371
|
...e,
|
|
19307
19372
|
children: []
|
|
19308
19373
|
} : {
|
|
19309
19374
|
...e,
|
|
19310
|
-
children: e.children?.map((e) =>
|
|
19375
|
+
children: e.children?.map((e) => zu(e, t + 1))
|
|
19311
19376
|
};
|
|
19312
19377
|
}
|
|
19313
19378
|
//#endregion
|
|
19314
|
-
export { Za as $, bt as $t,
|
|
19379
|
+
export { Za as $, bt as $t, Ls as A, Ti as At, Uo as B, Gi as Bt, oc as C, la as Ct, Vs as D, R as Dt, Hs as E, Ji as Et, Ss as F, zi as Ft, Vo as G, P as Gt, Go as H, ia as Ht, Ns as I, na as It, ko as J, St as Jt, Mo as K, N as Kt, vs as L, Zi as Lt, Qo as M, qi as Mt, Is as N, ta as Nt, Bs as O, Ri as Ot, Ms as P, Yi as Pt, $a as Q, Ct as Qt, Ps as R, Hi as Rt, ac as S, ma as St, zs as T, ea as Tt, Wo as U, yi as Ut, Yo as V, Wi as Vt, Ao as W, L as Wt, Eo as X, Mt as Xt, Oo as Y, Nt as Yt, So as Z, Pt as Zt, Ac as _, _a as _t, Kl as a, Ee as an, Na as at, Dc as b, pa as bt, Gl as c, De as cn, La as ct, Jc as d, ye as dn, Fa as dt, rt as en, qa as et, qc as f, he as fn, ja as ft, Mc as g, T as gn, Ea as gt, Fc as h, pe as hn, xa as ht, ql as i, Me as in, za as it, Zo as j, Ki as jt, Rs as k, Qi as kt, tl as l, ke as ln, Pa as lt, Pc as m, me as mn, ba as mt, au as n, we as nn, Ga as nt, ru as o, je as on, Ia as ot, Gc as p, ge as pn, Ba as pt, zo as q, Ht as qt, Lu as r, Te as rn, Ra as rt, vl as s, Ae as sn, Va as st, iu as t, at as tn, Ka as tt, Xc as u, Se as un, Aa as ut, kc as v, aa as vt, ic as w, da as wt, mc as x, sa as xt, Oc as y, ha as yt, Xo as z, Ui as zt };
|