@charisol/plexo-sdk 1.4.25 → 1.4.26

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.
@@ -362,7 +362,7 @@ function j(e) {
362
362
  }
363
363
  }
364
364
  }
365
- var M = /* @__PURE__ */ new Map([
365
+ var ee = /* @__PURE__ */ new Map([
366
366
  ["'Roboto', sans-serif", "Roboto"],
367
367
  ["'Open Sans', sans-serif", "Open Sans"],
368
368
  ["'Lato', sans-serif", "Lato"],
@@ -446,7 +446,7 @@ var M = /* @__PURE__ */ new Map([
446
446
  ["'Cookie', cursive", "Cookie"],
447
447
  ["'Great Vibes', cursive", "Great Vibes"]
448
448
  ]);
449
- function N(e, t = []) {
449
+ function M(e, t = []) {
450
450
  let n = /* @__PURE__ */ new Set(), r = (e) => {
451
451
  if (!e) return;
452
452
  let t = Array.isArray(e.columns) ? e.columns : [];
@@ -464,15 +464,15 @@ function N(e, t = []) {
464
464
  for (let e of t) typeof e == "string" && e.trim() && n.add(e.trim());
465
465
  return n;
466
466
  }
467
- function P(e) {
467
+ function N(e) {
468
468
  let t = /* @__PURE__ */ new Set();
469
469
  for (let n of e) {
470
- let e = M.get(n);
470
+ let e = ee.get(n);
471
471
  e && t.add(e);
472
472
  }
473
473
  return t.size === 0 ? null : `https://fonts.googleapis.com/css?family=${Array.from(t).map((e) => `${encodeURIComponent(e).replace(/%20/g, "+")}:400,700`).join("|")}&display=swap`;
474
474
  }
475
- var F = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
475
+ var P = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
476
476
  let n = e.replace(/([A-Z])/g, "-$1").toLowerCase(), r = t;
477
477
  return typeof t == "number" && [
478
478
  "padding",
@@ -483,25 +483,25 @@ var F = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
483
483
  "width",
484
484
  "height"
485
485
  ].some((t) => e.toLowerCase().includes(t)) && (r = `${t}px`), `${n}: ${r};`;
486
- }).join(" "), I = (e = {}) => F(e).replace(/;(\s|$)/g, " !important;$1");
487
- function L(e) {
486
+ }).join(" "), F = (e = {}) => P(e).replace(/;(\s|$)/g, " !important;$1");
487
+ function I(e) {
488
488
  if (typeof e != "string") return !1;
489
489
  let t = e.toLowerCase();
490
490
  return t.includes("javascript:") || t.includes("vbscript:") || t.includes("expression") || t.includes("url(") || t.includes("@import") || t.includes("-moz-binding") || t.includes("behavior") || t.includes("</style") || /\\/.test(e);
491
491
  }
492
- function R(e, t, n, r, i) {
492
+ function L(e, t, n, r, i) {
493
493
  let a = {
494
494
  ...O(n, r),
495
495
  ...i || {}
496
496
  };
497
- for (let e of Object.keys(a)) L(a[e]) && delete a[e];
497
+ for (let e of Object.keys(a)) I(a[e]) && delete a[e];
498
498
  if (Object.keys(a).length === 0) return;
499
- let o = I(a);
499
+ let o = F(a);
500
500
  if (!o) return;
501
501
  let s = String(t).replace(/["\\]/g, "");
502
502
  e[r].push(`[data-plexo-id="${s}"] { ${o} }`);
503
503
  }
504
- function z(e, t) {
504
+ function R(e, t) {
505
505
  if (e.type !== "menu" || !t || t.textAlign === void 0) return t;
506
506
  let n = t.textAlign === "center" ? "center" : t.textAlign === "right" ? "flex-end" : "flex-start";
507
507
  return {
@@ -509,7 +509,7 @@ function z(e, t) {
509
509
  justifyContent: n
510
510
  };
511
511
  }
512
- var B = () => ({
512
+ var z = () => ({
513
513
  backgroundColor: "#ffffff",
514
514
  borderRadius: "20px",
515
515
  width: "100%",
@@ -532,11 +532,11 @@ var B = () => ({
532
532
  buttonPaddingRight: "14px",
533
533
  buttonFontSize: "13px",
534
534
  buttonFontWeight: "700"
535
- }), V = (e) => (e || "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), H = (e, t) => {
535
+ }), B = (e) => (e || "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), V = (e, t) => {
536
536
  if (typeof t != "string") return "";
537
537
  let n = t.trim();
538
- return n ? ` ${e}="${V(n)}"` : "";
539
- }, U = [
538
+ return n ? ` ${e}="${B(n)}"` : "";
539
+ }, H = [
540
540
  "fieldSpacing",
541
541
  "buttonBackgroundColor",
542
542
  "buttonTextColor",
@@ -556,9 +556,36 @@ var B = () => ({
556
556
  "buttonWidth",
557
557
  "buttonHeight",
558
558
  "buttonAlign"
559
- ], W = (e) => {
559
+ ], U = "#cbd5e1", W = "#e2e8f0", G = "#1e293b", K = "#64748b", q = (e) => `<span style="display:block;font-family:monospace;font-size:10px;letter-spacing:0.06em;text-transform:uppercase;color:#94a3b8;margin-bottom:8px;">${e} (live once published)</span>`, J = (e, t = W, n = "8px") => `<div style="width:${e};height:${n};background:${t};border-radius:3px;"></div>`;
560
+ function Y(e) {
561
+ let t = (e = "90px") => `<div style="width:100%;height:${e};background:linear-gradient(135deg,${W},${U});border-radius:6px;"></div>`, n = () => `<div style="flex:1;display:flex;flex-direction:column;gap:6px;">${t("64px")}${J("75%")}${J("40%", U)}</div>`;
562
+ switch (e) {
563
+ case "product": return `${q("Product")}<div style="display:flex;flex-direction:column;gap:8px;">${t()}<div style="font-weight:600;font-size:14px;color:${G};">Sample Product Name</div><div style="font-size:13px;color:${K};">$29.99</div><div style="background:${G};color:#fff;text-align:center;padding:8px;border-radius:6px;font-size:13px;font-weight:600;">Add to Cart</div></div>`;
564
+ case "booking": return `${q("Booking")}<div style="font-weight:600;font-size:14px;color:${G};margin-bottom:8px;">Select a time</div><div style="display:flex;gap:6px;flex-wrap:wrap;">${[
565
+ "9:00 AM",
566
+ "10:00 AM",
567
+ "11:30 AM",
568
+ "2:00 PM"
569
+ ].map((e) => `<span style="border:1px solid ${U};border-radius:6px;padding:6px 10px;font-size:12px;color:${G};">${e}</span>`).join("")}</div>`;
570
+ case "shop_grid": return `${q("Shop Grid")}<div style="display:flex;gap:10px;">${n()}${n()}${n()}</div>`;
571
+ case "cart_summary": {
572
+ let e = `<div style="width:36px;height:36px;flex-shrink:0;background:linear-gradient(135deg,${W},${U});border-radius:4px;"></div>`, t = () => `<div style="display:flex;gap:8px;align-items:center;">${e}<div style="flex:1;">${J("80%")}</div>${J("30px")}</div>`;
573
+ return `${q("Cart Summary")}<div style="display:flex;flex-direction:column;gap:10px;">${t()}${t()}<div style="border-top:1px solid ${W};padding-top:8px;display:flex;justify-content:space-between;font-size:13px;font-weight:600;color:${G};"><span>Subtotal</span><span>$59.98</span></div></div>`;
574
+ }
575
+ case "checkout_flow": return `${q("Checkout")}<div style="display:flex;gap:12px;"><div style="flex:1;display:flex;flex-direction:column;gap:8px;">${J("50%", U, "10px")}<div style="height:32px;background:#fff;border:1px solid ${W};border-radius:6px;"></div><div style="height:32px;background:#fff;border:1px solid ${W};border-radius:6px;"></div></div><div style="width:120px;flex-shrink:0;border:1px solid ${W};border-radius:6px;padding:10px;background:#fff;display:flex;flex-direction:column;gap:8px;">${J("70%", U)}${J("50%")}<div style="height:26px;background:${G};border-radius:4px;margin-top:4px;"></div></div></div>`;
576
+ case "order_confirmation": return `${q("Order Confirmation")}<div style="text-align:center;padding:12px 0;"><div style="width:40px;height:40px;border-radius:100px;background:#dcfce7;color:#16a34a;display:flex;align-items:center;justify-content:center;margin:0 auto 10px;font-size:20px;line-height:1;">✓</div><div style="font-weight:600;font-size:15px;color:${G};">Thank you for your order</div><div style="font-size:12px;color:${K};margin-top:4px;">Order #10482</div></div>`;
577
+ case "order_tracking": return `${q("Order Tracking")}<div style="display:flex;gap:8px;margin-bottom:16px;"><div style="flex:1;height:32px;background:#fff;border:1px solid ${W};border-radius:6px;"></div><div style="width:76px;height:32px;background:${G};border-radius:6px;flex-shrink:0;"></div></div><div style="display:flex;justify-content:space-between;">${[
578
+ ["Placed", !0],
579
+ ["Processing", !1],
580
+ ["Shipped", !1],
581
+ ["Delivered", !1]
582
+ ].map(([e, t]) => `<div style="display:flex;flex-direction:column;align-items:center;gap:4px;"><div style="width:10px;height:10px;border-radius:100px;background:${t ? "#16a34a" : U};"></div><span style="font-size:9px;color:${K};">${e}</span></div>`).join("")}</div>`;
583
+ default: return "";
584
+ }
585
+ }
586
+ var te = (e) => {
560
587
  if (!e || typeof e != "object") return "";
561
- let t = e.kind || "text", n = V(e.name || e.id || "field"), r = e.required ? " required" : "", i = F({
588
+ let t = e.kind || "text", n = B(e.name || e.id || "field"), r = e.required ? " required" : "", i = P({
562
589
  fontSize: e.fontSize || "13px",
563
590
  borderRadius: e.borderRadius || "12px",
564
591
  borderWidth: e.borderWidth || "1px",
@@ -566,19 +593,19 @@ var B = () => ({
566
593
  borderStyle: "solid",
567
594
  color: e.inputTextColor
568
595
  }), a = e.showLabel === !1 ? "" : `<label style="display: block; margin-bottom: 4px; font-size: ${e.fontSize || "12px"}; font-weight: ${e.labelFontWeight || "700"}; color: ${e.labelColor || "inherit"};">${e.label || ""}${e.required ? " <span style=\"color:#e11d48;\">*</span>" : ""}</label>`;
569
- return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${V(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}></textarea>` : t === "select" ? `${a}<select name="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}>${(Array.isArray(e.options) ? e.options : []).map((e) => `<option value="${V(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>` : t === "radio" || t === "checkbox" ? `${a}<div style="display: flex; flex-wrap: wrap; gap: 8px;">${(Array.isArray(e.options) && e.options.length > 0 ? e.options : [{
596
+ return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${B(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}></textarea>` : t === "select" ? `${a}<select name="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}>${(Array.isArray(e.options) ? e.options : []).map((e) => `<option value="${B(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>` : t === "radio" || t === "checkbox" ? `${a}<div style="display: flex; flex-wrap: wrap; gap: 8px;">${(Array.isArray(e.options) && e.options.length > 0 ? e.options : [{
570
597
  label: e.label || "Option",
571
598
  value: e.name || "option"
572
- }]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${V(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${V(t)}" name="${n}" placeholder="${V(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
599
+ }]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${B(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${B(t)}" name="${n}" placeholder="${B(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
573
600
  };
574
- function G(e, t, n) {
601
+ function ne(e, t, n) {
575
602
  if (e === "none") return "";
576
- let r = V(t);
603
+ let r = B(t);
577
604
  return e === "plus" ? `<span data-acc-icon style="font-size: 14px; line-height: 1; font-weight: 700; color: ${r};">${n ? "−" : "+"}</span>` : e === "arrow" ? `<span data-acc-icon style="font-size: 14px; line-height: 1; display: inline-block; color: ${r}; transform: ${n ? "rotate(90deg)" : "none"}; transition: transform 0.2s ease;">›</span>` : `<svg data-acc-icon width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="${r}" stroke-width="2.5" style="flex-shrink: 0; transform: ${n ? "rotate(180deg)" : "none"}; transition: transform 0.2s ease;"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5"/></svg>`;
578
605
  }
579
- function K(e, t, n, r, i = []) {
606
+ function X(e, t, n, r, i = []) {
580
607
  return e.map((a, o) => {
581
- let s = [...i, o], c = o === e.length - 1, l = F({ borderBottom: n.showDividers && !c ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), u = F({
608
+ let s = [...i, o], c = o === e.length - 1, l = P({ borderBottom: n.showDividers && !c ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), u = P({
582
609
  display: "flex",
583
610
  alignItems: "center",
584
611
  gap: "8px",
@@ -595,70 +622,70 @@ function K(e, t, n, r, i = []) {
595
622
  border: "none",
596
623
  font: "inherit",
597
624
  background: void 0
598
- }), d = F({
625
+ }), d = P({
599
626
  display: "grid",
600
627
  gridTemplateRows: a.defaultOpen ? "1fr" : "0fr",
601
628
  transition: n.animated ? "grid-template-rows 0.25s ease" : void 0,
602
629
  backgroundColor: t.contentBackgroundColor || "#ffffff"
603
- }), f = F({
630
+ }), f = P({
604
631
  padding: t.contentPadding || "14px",
605
632
  color: t.contentTextColor || "#475569",
606
633
  fontSize: t.contentFontSize || "13px",
607
634
  whiteSpace: "pre-wrap"
608
- }), p = G(n.iconStyle, t.iconColor || "#64748b", !!a.defaultOpen), m = V(a.title), h = V(a.content), g = a.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${K(a.children, t, n, r, s)}</div>` : "";
609
- return `<div class="plexo-acc-item" style="${l}"><button type="button"${` data-plexo-acc-item="${V(r)}|${s.join(".")}"`} data-acc-header data-acc-open="${a.defaultOpen ? "1" : "0"}" style="${u}"><span style="flex: 1;">${m}</span>${p}</button><div data-acc-panel style="${d}"><div style="overflow: hidden;"><div style="${f}">${h}${g}</div></div></div></div>`;
635
+ }), p = ne(n.iconStyle, t.iconColor || "#64748b", !!a.defaultOpen), m = B(a.title), h = B(a.content), g = a.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${X(a.children, t, n, r, s)}</div>` : "";
636
+ return `<div class="plexo-acc-item" style="${l}"><button type="button"${` data-plexo-acc-item="${B(r)}|${s.join(".")}"`} data-acc-header data-acc-open="${a.defaultOpen ? "1" : "0"}" style="${u}"><span style="flex: 1;">${m}</span>${p}</button><div data-acc-panel style="${d}"><div style="overflow: hidden;"><div style="${f}">${h}${g}</div></div></div></div>`;
610
637
  }).join("");
611
638
  }
612
- function q(e) {
639
+ function re(e) {
613
640
  return `<!-- Unsupported block ${String(e)} -->`;
614
641
  }
615
- var J = (g) => {
642
+ var ie = (g, _ = !1) => {
616
643
  if (!g || typeof g != "object") return "";
617
- let _ = g.style || {}, v = g.type === "heading" || g.type === "paragraph" || g.type === "text", y = v ? c(g).autoWidth : !1, b = y ? Object.fromEntries(Object.entries(_).filter(([e]) => e !== "width")) : _, x = F(g.type === "form_container" ? {
618
- ...B(),
619
- ..._
620
- } : b), S = g.attributes || {}, C = ` data-plexo-id="${V(g.id)}"`, w = String(S.boxAlign || "left"), T = v && (y || !!_.width), E = (e) => T ? `<div style="text-align: ${w};">${e}</div>` : e, D = `${T ? "display: inline-block; " : ""}${v && _.height ? "overflow: hidden; " : ""}`;
644
+ let v = g.style || {}, y = g.type === "heading" || g.type === "paragraph" || g.type === "text", b = y ? c(g).autoWidth : !1, x = b ? Object.fromEntries(Object.entries(v).filter(([e]) => e !== "width")) : v, S = P(g.type === "form_container" ? {
645
+ ...z(),
646
+ ...v
647
+ } : x), C = g.attributes || {}, w = ` data-plexo-id="${B(g.id)}"`, T = String(C.boxAlign || "left"), E = y && (b || !!v.width), D = (e) => E ? `<div style="text-align: ${T};">${e}</div>` : e, O = `${E ? "display: inline-block; " : ""}${y && v.height ? "overflow: hidden; " : ""}`;
621
648
  switch (g.type) {
622
- case "heading": return E(`<h2${C} style="margin-top: 0; margin-bottom: 8px; ${D}${x}">${S.text || "Heading"}</h2>`);
623
- case "paragraph": return E(`<p${C} style="margin-top: 0; margin-bottom: 12px; ${D}${x}">${S.text || "Paragraph text content."}</p>`);
624
- case "text": return E(`<div${C} style="${D}${x}">${S.text || ""}</div>`);
649
+ case "heading": return D(`<h2${w} style="margin-top: 0; margin-bottom: 8px; ${O}${S}">${C.text || "Heading"}</h2>`);
650
+ case "paragraph": return D(`<p${w} style="margin-top: 0; margin-bottom: 12px; ${O}${S}">${C.text || "Paragraph text content."}</p>`);
651
+ case "text": return D(`<div${w} style="${O}${S}">${C.text || ""}</div>`);
625
652
  case "button": {
626
- let e = u(g), t = F({
627
- ..._,
653
+ let e = u(g), t = P({
654
+ ...v,
628
655
  width: e.width,
629
656
  height: e.height
630
657
  });
631
- return `<div style="text-align: ${_.textAlign || "center"};"><a${C} href="${S.href || "#"}" target="${S.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${S.text || "Button"}</a></div>`;
658
+ return `<div style="text-align: ${v.textAlign || "center"};"><a${w} href="${C.href || "#"}" target="${C.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${C.text || "Button"}</a></div>`;
632
659
  }
633
660
  case "image": {
634
- let e = h(g), t = _.textAlign === "center" ? "margin: 0 auto; display: block;" : _.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = F({
635
- ..._,
661
+ let e = h(g), t = v.textAlign === "center" ? "margin: 0 auto; display: block;" : v.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = P({
662
+ ...v,
636
663
  width: e.width,
637
664
  height: e.height
638
665
  });
639
- return `<img${C} src="${S.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${S.alt || ""}" style="${n} ${t}" />`;
666
+ return `<img${w} src="${C.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${C.alt || ""}" style="${n} ${t}" />`;
640
667
  }
641
- case "divider": return `<hr${C} style="border: 0; border-top: ${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#334155"}; ${x}" />`;
642
- case "spacer": return `<div${C} style="height: ${_.height || "24px"};"></div>`;
643
- case "card": return `<div${C} style="${x}">
644
- <h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${S.title || "Card Title"}</h3>
645
- <p style="margin: 0; color: #94a3b8; font-size: 14px;">${S.description || "Card description."}</p>
668
+ case "divider": return `<hr${w} style="border: 0; border-top: ${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#334155"}; ${S}" />`;
669
+ case "spacer": return `<div${w} style="height: ${v.height || "24px"};"></div>`;
670
+ case "card": return `<div${w} style="${S}">
671
+ <h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${C.title || "Card Title"}</h3>
672
+ <p style="margin: 0; color: #94a3b8; font-size: 14px;">${C.description || "Card description."}</p>
646
673
  </div>`;
647
674
  case "form_container": {
648
- if (S.provider === "maildrip" && typeof S.maildripPageId == "string" && S.maildripPageId.trim()) {
649
- let e = V(S.maildripPageId.trim());
650
- return `<div${C} style="${F({
651
- ..._,
675
+ if (C.provider === "maildrip" && typeof C.maildripPageId == "string" && C.maildripPageId.trim()) {
676
+ let e = B(C.maildripPageId.trim());
677
+ return `<div${w} style="${P({
678
+ ...v,
652
679
  height: p(g)
653
680
  })}"><opt-in-embed-form page-id="${e}"></opt-in-embed-form></div>`;
654
681
  }
655
682
  let n = {
656
- ...B(),
657
- ..._
683
+ ...z(),
684
+ ...v
658
685
  }, r = {};
659
- for (let e of Object.keys(n)) U.includes(e) || (r[e] = n[e]);
686
+ for (let e of Object.keys(n)) H.includes(e) || (r[e] = n[e]);
660
687
  r.height = p(g);
661
- let i = F(r), a = l(t(Array.isArray(S.fields) ? S.fields : [])), o = n.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${W(e)}</div>`).join(""), c = S.buttonAutoWidth === !1 ? n.buttonWidth || "100%" : "auto", u = n.buttonAlign === "left" ? "flex-start" : n.buttonAlign === "right" ? "flex-end" : "center", d = S.buttonAutoHeight === !1 && n.buttonHeight || "auto", f = F({
688
+ let i = P(r), a = l(t(Array.isArray(C.fields) ? C.fields : [])), o = n.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${te(e)}</div>`).join(""), c = C.buttonAutoWidth === !1 ? n.buttonWidth || "100%" : "auto", u = n.buttonAlign === "left" ? "flex-start" : n.buttonAlign === "right" ? "flex-end" : "center", d = C.buttonAutoHeight === !1 && n.buttonHeight || "auto", f = P({
662
689
  backgroundColor: n.buttonBackgroundColor,
663
690
  color: n.buttonTextColor,
664
691
  borderRadius: n.buttonBorderRadius,
@@ -675,18 +702,18 @@ var J = (g) => {
675
702
  width: c,
676
703
  height: d
677
704
  });
678
- return `<form${C} action="${V(S.actionUrl || S.action || "#")}" method="${V(S.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${u};"><button type="submit" style="border: 0; cursor: pointer; ${f}">${S.submitLabel || "Submit"}</button></div></form>`;
705
+ return `<form${w} action="${B(C.actionUrl || C.action || "#")}" method="${B(C.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${u};"><button type="submit" style="border: 0; cursor: pointer; ${f}">${C.submitLabel || "Submit"}</button></div></form>`;
679
706
  }
680
707
  case "input": {
681
- let e = S.inputType || S.type || "text", t = V(S.name || S.fieldName || "field"), n = V(S.placeholder || ""), r = S.required ? " required" : "";
682
- return `<input${C} type="${V(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${r} />`;
708
+ let e = C.inputType || C.type || "text", t = B(C.name || C.fieldName || "field"), n = B(C.placeholder || ""), r = C.required ? " required" : "";
709
+ return `<input${w} type="${B(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${r} />`;
683
710
  }
684
- case "textarea": return `<textarea${C} name="${V(S.name || S.fieldName || "field")}" placeholder="${V(S.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${S.required ? " required" : ""}></textarea>`;
685
- case "select": return `<select${C} name="${V(S.name || S.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${S.required ? " required" : ""}>${(Array.isArray(S.options) ? S.options : []).map((e) => `<option value="${V(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
686
- case "html": return `<div${C} style="${F({
687
- ..._,
711
+ case "textarea": return `<textarea${w} name="${B(C.name || C.fieldName || "field")}" placeholder="${B(C.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${C.required ? " required" : ""}></textarea>`;
712
+ case "select": return `<select${w} name="${B(C.name || C.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${C.required ? " required" : ""}>${(Array.isArray(C.options) ? C.options : []).map((e) => `<option value="${B(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
713
+ case "html": return `<div${w} style="${P({
714
+ ...v,
688
715
  height: s(g, "auto")
689
- })}">${S.htmlContent || S.text || ""}</div>`;
716
+ })}">${C.htmlContent || C.text || ""}</div>`;
690
717
  case "blog_title":
691
718
  case "blog_content":
692
719
  case "blog_featured_image":
@@ -695,8 +722,8 @@ var J = (g) => {
695
722
  case "blog_categories":
696
723
  case "blog_comments":
697
724
  case "blog_post_list": {
698
- let e = g.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = F(_);
699
- return `<div${C} data-plexo-blog-${e}="true"${H("data-plexo-blog-prefix", S.prefix)} style="${t}"></div>`;
725
+ let e = g.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = P(v);
726
+ return `<div${w} data-plexo-blog-${e}="true"${V("data-plexo-blog-prefix", C.prefix)} style="${t}"></div>`;
700
727
  }
701
728
  case "product":
702
729
  case "booking":
@@ -705,20 +732,20 @@ var J = (g) => {
705
732
  case "checkout_flow":
706
733
  case "order_confirmation":
707
734
  case "order_tracking": {
708
- let e = g.type.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = F(_);
709
- return `<div${C} data-plexo-commerce-${e}="true"${H("data-plexo-product-id", S.productId)}${H("data-plexo-service-id", S.serviceId)}${H("data-plexo-commerce-mode", S.mode)}${S.storeMode === !1 ? " data-plexo-commerce-store-mode=\"false\"" : ""}${H("data-plexo-commerce-limit", S.limit)}${H("data-plexo-commerce-category", S.category)}${H("data-plexo-commerce-sort", S.sort)}${H("data-plexo-commerce-items-per-row", S.itemsPerRow)}${H("data-plexo-commerce-items-per-page", S.itemsPerPage)}${S.paginated ? " data-plexo-commerce-paginated=\"true\"" : ""} style="${t}"></div>`;
735
+ let e = g.type.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = P(v);
736
+ return `<div${w} data-plexo-commerce-${e}="true"${V("data-plexo-product-id", C.productId)}${V("data-plexo-service-id", C.serviceId)}${V("data-plexo-commerce-mode", C.mode)}${C.storeMode === !1 ? " data-plexo-commerce-store-mode=\"false\"" : ""}${V("data-plexo-commerce-limit", C.limit)}${V("data-plexo-commerce-category", C.category)}${V("data-plexo-commerce-sort", C.sort)}${V("data-plexo-commerce-items-per-row", C.itemsPerRow)}${V("data-plexo-commerce-items-per-page", C.itemsPerPage)}${C.paginated ? " data-plexo-commerce-paginated=\"true\"" : ""} style="${t}">${_ ? `<div style="padding: 12px; box-sizing: border-box; height: 100%;">${Y(g.type)}</div>` : ""}</div>`;
710
737
  }
711
738
  case "social": {
712
- let e = r(g), t = _.textAlign === "center" ? "center" : _.textAlign === "right" ? "flex-end" : "flex-start";
713
- return `<div${C} style="${F({
714
- padding: _.padding,
715
- margin: _.margin,
739
+ let e = r(g), t = v.textAlign === "center" ? "center" : v.textAlign === "right" ? "flex-end" : "flex-start";
740
+ return `<div${w} style="${P({
741
+ padding: v.padding,
742
+ margin: v.margin,
716
743
  display: "flex",
717
744
  flexWrap: "wrap",
718
- gap: _.iconSpacing || "8px",
745
+ gap: v.iconSpacing || "8px",
719
746
  justifyContent: t
720
747
  })}">${e.map((e) => {
721
- let t = F({
748
+ let t = P({
722
749
  width: e.size,
723
750
  height: e.size,
724
751
  padding: "8px",
@@ -730,132 +757,132 @@ var J = (g) => {
730
757
  justifyContent: "center",
731
758
  overflow: "hidden"
732
759
  });
733
- return `<a href="${V(e.url)}" style="${t} text-decoration: none;">${f(e.provider, e.color)}</a>`;
760
+ return `<a href="${B(e.url)}" style="${t} text-decoration: none;">${f(e.provider, e.color)}</a>`;
734
761
  }).join("")}</div>`;
735
762
  }
736
763
  case "menu": {
737
- let e = n(g), t = _.textAlign === "center" ? "center" : _.textAlign === "right" ? "flex-end" : "flex-start";
738
- return `<div${C} style="${F({
739
- ..._,
764
+ let e = n(g), t = v.textAlign === "center" ? "center" : v.textAlign === "right" ? "flex-end" : "flex-start";
765
+ return `<div${w} style="${P({
766
+ ...v,
740
767
  display: "flex",
741
768
  flexWrap: "wrap",
742
769
  gap: "16px",
743
770
  justifyContent: t
744
- })}">${e.map((e) => `<a href="${V(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${_.fontWeight || 600};">${V(e.label)}</a>`).join("")}</div>`;
771
+ })}">${e.map((e) => `<a href="${B(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${v.fontWeight || 600};">${B(e.label)}</a>`).join("")}</div>`;
745
772
  }
746
773
  case "icon": {
747
- let e = _.fontSize || `${S.iconSize || 48}px`, t = _.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = m(S.iconName, n, t), i = _.textAlign === "right" ? "flex-end" : _.textAlign === "left" ? "flex-start" : "center", a = F({
748
- padding: _.padding,
749
- margin: _.margin,
774
+ let e = v.fontSize || `${C.iconSize || 48}px`, t = v.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = m(C.iconName, n, t), i = v.textAlign === "right" ? "flex-end" : v.textAlign === "left" ? "flex-start" : "center", a = P({
775
+ padding: v.padding,
776
+ margin: v.margin,
750
777
  display: "flex",
751
778
  justifyContent: i
752
- }), o = typeof S.href == "string" ? S.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
753
- return `<div style="${a}">${o ? `<a${C} href="${V(o)}" target="${S.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${C}>${s}</span>`}</div>`;
779
+ }), o = typeof C.href == "string" ? C.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
780
+ return `<div style="${a}">${o ? `<a${w} href="${B(o)}" target="${C.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${w}>${s}</span>`}</div>`;
754
781
  }
755
782
  case "table": {
756
- let e = d(g), t = `${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#cbd5e1"}`, n = (n, r, i, a) => {
757
- let o = a ? "th" : "td", s = a ? _.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : _.contentBgColor || "#ffffff", c = a ? _.headerTextColor || "#1e293b" : _.contentTextColor || "#475569", l = a ? _.headerTextAlign || "left" : _.contentTextAlign || "left";
783
+ let e = d(g), t = `${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#cbd5e1"}`, n = (n, r, i, a) => {
784
+ let o = a ? "th" : "td", s = a ? v.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : v.contentBgColor || "#ffffff", c = a ? v.headerTextColor || "#1e293b" : v.contentTextColor || "#475569", l = a ? v.headerTextAlign || "left" : v.contentTextAlign || "left";
758
785
  return `<tr>${n.map((e, n) => {
759
- let r = F({
760
- padding: _.cellPadding || "8px",
786
+ let r = P({
787
+ padding: v.cellPadding || "8px",
761
788
  border: t,
762
789
  backgroundColor: s,
763
790
  color: c,
764
791
  textAlign: l,
765
- lineHeight: _.contentLineHeight,
766
- letterSpacing: _.contentLetterSpacing,
792
+ lineHeight: v.contentLineHeight,
793
+ letterSpacing: v.contentLetterSpacing,
767
794
  fontWeight: a ? "700" : void 0
768
- }), u = ` data-plexo-cell="${V(g.id)}|${i}-${n}"`;
795
+ }), u = ` data-plexo-cell="${B(g.id)}|${i}-${n}"`;
769
796
  return `<${o}${u} style="${r}">${e || "&nbsp;"}</${o}>`;
770
797
  }).join("")}</tr>`;
771
- }, r = e.enableHeader && e.cells.length > 0 ? `<thead>${n(e.cells[0], 0, 0, !0)}</thead>` : "", i = +!!e.enableHeader, a = e.enableFooter ? e.cells.length - 1 : e.cells.length, o = e.cells.slice(i, Math.max(i, a)).map((e, t) => n(e, t, i + t, !1)).join(""), s = e.enableFooter && e.cells.length > i ? `<tfoot>${n(e.cells[e.cells.length - 1], e.cells.length - 1, e.cells.length - 1, !1)}</tfoot>` : "", c = F({
798
+ }, r = e.enableHeader && e.cells.length > 0 ? `<thead>${n(e.cells[0], 0, 0, !0)}</thead>` : "", i = +!!e.enableHeader, a = e.enableFooter ? e.cells.length - 1 : e.cells.length, o = e.cells.slice(i, Math.max(i, a)).map((e, t) => n(e, t, i + t, !1)).join(""), s = e.enableFooter && e.cells.length > i ? `<tfoot>${n(e.cells[e.cells.length - 1], e.cells.length - 1, e.cells.length - 1, !1)}</tfoot>` : "", c = P({
772
799
  borderCollapse: "collapse",
773
800
  width: "100%"
774
801
  });
775
- return `<div${C} style="${F({
776
- padding: _.padding,
777
- margin: _.margin,
802
+ return `<div${w} style="${P({
803
+ padding: v.padding,
804
+ margin: v.margin,
778
805
  overflowX: "auto"
779
806
  })}"><table style="${c}">${r}<tbody>${o}</tbody>${s}</table></div>`;
780
807
  }
781
808
  case "video": {
782
- let e = i(S.videoUrl), t = S.linkType === "email" ? `mailto:${S.href || ""}` : S.href || S.videoUrl || "#", n = S.target || "_blank";
783
- return `<div${C} style="${F({
784
- padding: _.padding,
785
- margin: _.margin,
786
- borderRadius: _.borderRadius,
809
+ let e = i(C.videoUrl), t = C.linkType === "email" ? `mailto:${C.href || ""}` : C.href || C.videoUrl || "#", n = C.target || "_blank";
810
+ return `<div${w} style="${P({
811
+ padding: v.padding,
812
+ margin: v.margin,
813
+ borderRadius: v.borderRadius,
787
814
  overflow: "hidden"
788
- })}"><a href="${V(t)}" target="${V(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${V(e.thumbnailUrl)}" alt="${V(S.alt || "Video preview")}" style="width: 100%; display: block;" /><span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 9999px; background: rgba(15, 23, 42, 0.75); display: flex; align-items: center; justify-content: center;"><span style="width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid #ffffff; margin-left: 4px;"></span></span></a></div>`;
815
+ })}"><a href="${B(t)}" target="${B(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${B(e.thumbnailUrl)}" alt="${B(C.alt || "Video preview")}" style="width: 100%; display: block;" /><span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 9999px; background: rgba(15, 23, 42, 0.75); display: flex; align-items: center; justify-content: center;"><span style="width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid #ffffff; margin-left: 4px;"></span></span></a></div>`;
789
816
  }
790
817
  case "timer": {
791
- let e = S.showLabels !== !1, t = F({
792
- fontFamily: _.digitsFontFamily,
793
- fontSize: _.digitsFontSize || "40px",
794
- color: _.digitsColor || "#1e293b",
818
+ let e = C.showLabels !== !1, t = P({
819
+ fontFamily: v.digitsFontFamily,
820
+ fontSize: v.digitsFontSize || "40px",
821
+ color: v.digitsColor || "#1e293b",
795
822
  fontWeight: "800"
796
- }), n = F({
797
- fontFamily: _.labelsFontFamily,
798
- fontSize: _.labelsFontSize || "16px",
799
- color: _.labelsColor || "#64748b"
800
- }), r = F({
801
- backgroundColor: _.backgroundColor || "#f8fafc",
802
- borderRadius: _.borderRadius || "8px",
803
- padding: _.padding || "16px",
823
+ }), n = P({
824
+ fontFamily: v.labelsFontFamily,
825
+ fontSize: v.labelsFontSize || "16px",
826
+ color: v.labelsColor || "#64748b"
827
+ }), r = P({
828
+ backgroundColor: v.backgroundColor || "#f8fafc",
829
+ borderRadius: v.borderRadius || "8px",
830
+ padding: v.padding || "16px",
804
831
  textAlign: "center"
805
- }), i = (r, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${r}" style="${t}">${a}</span>${e ? `<span style="${n}">${i}</span>` : ""}</div>`, o = a(S.targetDate, S.timezone), s = V(new Date(o.targetTimestamp).toISOString()), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
806
- return `<div${C} data-plexo-target="${s}" style="${r}"><div>${i("days", "Days", o.days)}${i("hours", "Hours", o.hours)}${i("minutes", "Mins", o.minutes)}${i("seconds", "Secs", o.seconds)}</div>${c}</div>`;
832
+ }), i = (r, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${r}" style="${t}">${a}</span>${e ? `<span style="${n}">${i}</span>` : ""}</div>`, o = a(C.targetDate, C.timezone), s = B(new Date(o.targetTimestamp).toISOString()), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
833
+ return `<div${w} data-plexo-target="${s}" style="${r}"><div>${i("days", "Days", o.days)}${i("hours", "Hours", o.hours)}${i("minutes", "Mins", o.minutes)}${i("seconds", "Secs", o.seconds)}</div>${c}</div>`;
807
834
  }
808
835
  case "carousel": {
809
- let e = Array.isArray(S.images) ? S.images : [], t = `plexo-carousel-${g.id}`, n = F({
810
- padding: _.padding || "10px",
811
- margin: _.margin,
812
- backgroundColor: _.backgroundColor,
836
+ let e = Array.isArray(C.images) ? C.images : [], t = `plexo-carousel-${g.id}`, n = P({
837
+ padding: v.padding || "10px",
838
+ margin: v.margin,
839
+ backgroundColor: v.backgroundColor,
813
840
  overflow: "hidden",
814
- borderRadius: _.borderRadius || "12px",
815
- width: _.width || "100%",
816
- height: _.height || "360px"
841
+ borderRadius: v.borderRadius || "12px",
842
+ width: v.width || "100%",
843
+ height: v.height || "360px"
817
844
  });
818
- if (e.length === 0) return `<div${C} style="${n}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
819
- let r = Math.min(e.length - 1, Math.max(0, parseInt(String(S.activeIdx), 10) || 0)), i = e.map((t, n) => (n - r + e.length) % e.length), a = e.length * 5, o = .6, s = e.map((n, r) => {
845
+ if (e.length === 0) return `<div${w} style="${n}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
846
+ let r = Math.min(e.length - 1, Math.max(0, parseInt(String(C.activeIdx), 10) || 0)), i = e.map((t, n) => (n - r + e.length) % e.length), a = e.length * 5, o = .6, s = e.map((n, r) => {
820
847
  let o = i[r] * 5, s = e.length > 1 ? ` animation: ${t}-fade ${a}s ease-in-out infinite; animation-delay: ${o}s;` : "";
821
- return `<div data-slide-idx="${r}" style="opacity: ${e.length > 1 ? "0" : "1"};${s}"><img src="${V(n.src)}" alt="${V(n.alt || n.caption || "")}" style="width: 100%; height: 100%; object-fit: cover; display: block;" />${n.caption ? `<div class="${t}-caption" style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${V(n.caption)}</div>` : ""}</div>`;
848
+ return `<div data-slide-idx="${r}" style="opacity: ${e.length > 1 ? "0" : "1"};${s}"><img src="${B(n.src)}" alt="${B(n.alt || n.caption || "")}" style="width: 100%; height: 100%; object-fit: cover; display: block;" />${n.caption ? `<div class="${t}-caption" style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${B(n.caption)}</div>` : ""}</div>`;
822
849
  }).join(""), c = e.some((e) => !!e.caption) ? "38px" : "10px", l = e.length > 1 ? `<div class="${t}-dots" style="display: flex; gap: 6px; justify-content: center;">${e.map((e, n) => {
823
850
  let r = i[n] * 5;
824
851
  return `<span style="width: 6px; height: 6px; border-radius: 9999px; background: #cbd5e1; animation: ${t}-dot ${a}s ease-in-out infinite; animation-delay: ${r}s;"></span>`;
825
852
  }).join("")}</div>` : "", u = (5 - o) / a * 100, d = 5 / a * 100, f = o / a * 100;
826
- return `<div${C} class="${t}" style="${n}">${e.length > 1 ? `<style>.${t}{position:relative;}.${t} [data-slide-idx]{position:absolute;inset:0;}.${t}-caption{position:absolute;left:0;right:0;bottom:0;}.${t}-dots{position:absolute;left:0;right:0;bottom:${c};}@keyframes ${t}-fade{0%{opacity:0;}${f}%{opacity:1;}${u}%{opacity:1;}${d}%{opacity:0;}100%{opacity:0;}}@keyframes ${t}-dot{0%{background:#cbd5e1;}${f}%{background:#4f46e5;}${u}%{background:#4f46e5;}${d}%{background:#cbd5e1;}100%{background:#cbd5e1;}}</style>` : `<style>.${t}{position:relative;}.${t} [data-slide-idx]{position:absolute;inset:0;}.${t}-caption{position:absolute;left:0;right:0;bottom:0;}</style>`}${s}${l}</div>`;
853
+ return `<div${w} class="${t}" style="${n}">${e.length > 1 ? `<style>.${t}{position:relative;}.${t} [data-slide-idx]{position:absolute;inset:0;}.${t}-caption{position:absolute;left:0;right:0;bottom:0;}.${t}-dots{position:absolute;left:0;right:0;bottom:${c};}@keyframes ${t}-fade{0%{opacity:0;}${f}%{opacity:1;}${u}%{opacity:1;}${d}%{opacity:0;}100%{opacity:0;}}@keyframes ${t}-dot{0%{background:#cbd5e1;}${f}%{background:#4f46e5;}${u}%{background:#4f46e5;}${d}%{background:#cbd5e1;}100%{background:#cbd5e1;}}</style>` : `<style>.${t}{position:relative;}.${t} [data-slide-idx]{position:absolute;inset:0;}.${t}-caption{position:absolute;left:0;right:0;bottom:0;}</style>`}${s}${l}</div>`;
827
854
  }
828
855
  case "accordion": {
829
- let e = o(g), t = S.mode === "multi" ? "multi" : "single", n = S.iconStyle || "chevron", r = S.iconPosition === "left", i = S.showDividers !== !1, a = S.animation !== "none", s = F({
830
- border: `${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#e2e8f0"}`,
831
- borderRadius: _.borderRadius || "10px",
856
+ let e = o(g), t = C.mode === "multi" ? "multi" : "single", n = C.iconStyle || "chevron", r = C.iconPosition === "left", i = C.showDividers !== !1, a = C.animation !== "none", s = P({
857
+ border: `${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#e2e8f0"}`,
858
+ borderRadius: v.borderRadius || "10px",
832
859
  overflow: "hidden",
833
- margin: _.margin
860
+ margin: v.margin
834
861
  });
835
- return e.length === 0 ? `<div${C} style="${s}"></div>` : `<div${C} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${K(e, _, {
862
+ return e.length === 0 ? `<div${w} style="${s}"></div>` : `<div${w} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${X(e, v, {
836
863
  iconStyle: n,
837
864
  iconOnLeft: r,
838
865
  showDividers: i,
839
866
  animated: a
840
867
  }, g.id)}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!root)return;var mode=root.getAttribute('data-acc-mode')||'single';var iconStyle=root.getAttribute('data-acc-icon-style')||'chevron';function setIconState(icon,open){if(!icon)return;if(iconStyle==='plus'){icon.textContent=open?'−':'+';}else if(iconStyle==='arrow'){icon.style.transform=open?'rotate(90deg)':'';}else if(iconStyle==='chevron'){icon.style.transform=open?'rotate(180deg)':'';}}var headers=root.querySelectorAll('[data-acc-header]');headers.forEach(function(header){header.addEventListener('click',function(){var item=header.parentElement;var group=item.parentElement;var panel=item.children[1];var isOpen=header.getAttribute('data-acc-open')==='1';if(mode!=='multi'&&group){Array.prototype.forEach.call(group.children,function(sib){if(sib===item)return;var sh=sib.children[0];var sp=sib.children[1];if(sh){sh.setAttribute('data-acc-open','0');setIconState(sh.querySelector('[data-acc-icon]'),false);}if(sp)sp.style.gridTemplateRows='0fr';});}var next=!isOpen;header.setAttribute('data-acc-open',next?'1':'0');panel.style.gridTemplateRows=next?'1fr':'0fr';setIconState(header.querySelector('[data-acc-icon]'),next);});});})();<\/script>`}</div>`;
841
868
  }
842
- default: return q(g.type);
869
+ default: return re(g.type);
843
870
  }
844
- }, Y = (e, t, n) => {
871
+ }, Z = (e, t, n) => {
845
872
  if (!e || typeof e != "object") return "";
846
873
  let r = j(e);
847
874
  if (!r) return `\n <!-- ROW SKIPPED (type="${typeof e.type == "string" ? e.type : "unknown"}"${e.id ? `, id="${e.id}"` : ""}): this row has no 'columns' array and its shorthand content (e.g. a list of items/links) can't be auto-converted without losing data. Provide a fully hydrated row with 'columns' and 'elements' instead. -->`;
848
875
  let i = r.style?.columnGap, a = typeof i == "number" ? `${i}px` : typeof i == "string" ? i.trim() : "", o = a !== "" && a !== "0" && a !== "0px", s = { ...r.style || {} };
849
876
  delete s.columnGap;
850
- let c = F(s), l = H("id", r.htmlId), u = H("class", r.htmlClass), d = r.id || `row-${Math.random().toString(36).substring(2, 9)}`;
851
- R(t, d, r.style, "tablet", r.styleTablet), R(t, d, r.style, "mobile", r.styleMobile);
877
+ let c = P(s), l = V("id", r.htmlId), u = V("class", r.htmlClass), d = r.id || `row-${Math.random().toString(36).substring(2, 9)}`;
878
+ L(t, d, r.style, "tablet", r.styleTablet), L(t, d, r.style, "mobile", r.styleMobile);
852
879
  let f = `\n <!-- ROW START: ${r.id || "row"} -->`, p = o ? `gap: ${a}; margin-left: 0; margin-right: 0;` : "margin-left: -8px; margin-right: -8px;";
853
880
  f += `\n <div data-plexo-id="${d}"${l}${u} class="plexo-row" style="display: flex; flex-wrap: wrap; ${p} ${c}">`;
854
881
  let m = Array.isArray(r.columns) ? r.columns : [], h = o && m.length > 1 ? `(${a} * ${m.length - 1} / ${m.length})` : "";
855
882
  for (let e of m) {
856
883
  if (!e) continue;
857
- let r = e.styles || e.style || {}, i = F(r), a = r.gap || "16px", s = H("id", e.attrs?.htmlId), c = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", l = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
858
- R(t, l, r, "tablet", e.stylesTablet), R(t, l, r, "mobile", e.stylesMobile);
884
+ let r = e.styles || e.style || {}, i = P(r), a = r.gap || "16px", s = V("id", e.attrs?.htmlId), c = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", l = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
885
+ L(t, l, r, "tablet", e.stylesTablet), L(t, l, r, "mobile", e.stylesMobile);
859
886
  let u = Array.isArray(e.elements) ? e.elements : [], d = Array.isArray(e.nestedRows) ? e.nestedRows : [], p = n && u.length === 0 && d.length === 0 ? "min-height: 148px; " : "", m = e.width || "100%", _ = typeof m == "string" && /^\s*\d+(\.\d+)?\s*%\s*$/.test(m), v = o && _ && h ? `calc(${m.trim()} - ${h})` : m, y = o ? "padding-left: 0; padding-right: 0;" : "padding-left: 8px; padding-right: 8px;";
860
887
  f += `\n <!-- COLUMN START: ${e.id || "col"} -->`, f += `\n <div data-plexo-id="${l}"${s} class="plexo-col${c}" style="box-sizing: border-box; ${y} width: ${v}; --plexo-col-gap: ${a}; ${p}${i}">`;
861
888
  let b = new Map(u.map((e) => [e.id, e])), x = new Map(d.map((e) => [e.id, e]));
@@ -866,17 +893,17 @@ var J = (g) => {
866
893
  })) {
867
894
  let e = b.get(r);
868
895
  if (e) {
869
- let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", i = H("id", n.htmlId), o = H("class", r), s = e.style?.display, c = s === "inline-block" || s === "inline" || s === "inline-flex" ? `margin-bottom: ${a}; display: ${s}; vertical-align: top;` : `margin-bottom: ${a};`;
870
- R(t, e.id, e.style, "tablet", z(e, e.styleTablet)), R(t, e.id, e.style, "mobile", z(e, e.styleMobile)), f += `\n <div${i}${o} style="${c}">`, f += `\n ${J(e)}`, f += "\n </div>";
896
+ let r = e.attributes || {}, i = typeof r.htmlClassNames == "string" ? r.htmlClassNames : typeof r.htmlClass == "string" ? r.htmlClass : typeof r.className == "string" ? r.className : "", o = V("id", r.htmlId), s = V("class", i), c = e.style?.display, l = c === "inline-block" || c === "inline" || c === "inline-flex" ? `margin-bottom: ${a}; display: ${c}; vertical-align: top;` : `margin-bottom: ${a};`;
897
+ L(t, e.id, e.style, "tablet", R(e, e.styleTablet)), L(t, e.id, e.style, "mobile", R(e, e.styleMobile)), f += `\n <div${o}${s} style="${l}">`, f += `\n ${ie(e, n)}`, f += "\n </div>";
871
898
  continue;
872
899
  }
873
900
  let i = x.get(r);
874
- i && (f += Y(i, t, n));
901
+ i && (f += Z(i, t, n));
875
902
  }
876
903
  f += "\n </div>";
877
904
  }
878
905
  return f += "\n </div>", f;
879
- }, X = (e, t) => {
906
+ }, Q = (e, t) => {
880
907
  let n = t?.canvasEditorPadding ?? !1;
881
908
  if (!e || typeof e != "object") return "<!-- Empty template -->";
882
909
  let r = e.designJson || e.template || e, i = r.body || (Array.isArray(r.rows) ? {
@@ -908,26 +935,26 @@ var J = (g) => {
908
935
  "ogImageUrl"
909
936
  ], s = {};
910
937
  for (let e of Object.keys(a)) o.includes(e) || (s[e] = a[e]);
911
- let c = F(s), l = typeof a.htmlTitle == "string" && a.htmlTitle.trim() ? a.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", u = H("id", a.htmlId), d = H("class", a.htmlClass), f = typeof a.customCss == "string" && a.customCss.trim() ? a.customCss.trim() : "", p = typeof a.customJs == "string" && a.customJs.trim() ? a.customJs.trim() : "", m = typeof a.favicon == "string" && a.favicon.trim() ? a.favicon.trim() : "", h = typeof a.metaDescription == "string" && a.metaDescription.trim() ? a.metaDescription.trim() : "", g = typeof a.ogImageUrl == "string" && a.ogImageUrl.trim() ? a.ogImageUrl.trim() : "", v = typeof a.contentMaxWidth == "string" && a.contentMaxWidth.trim() ? a.contentMaxWidth.trim() : "1200px", y = Array.isArray(i.rows) ? i.rows : Array.isArray(r.rows) ? r.rows : Array.isArray(e.rows) ? e.rows : [], b = P(N(y, [a.fontFamily])), x = {
938
+ let c = P(s), l = typeof a.htmlTitle == "string" && a.htmlTitle.trim() ? a.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", u = V("id", a.htmlId), d = V("class", a.htmlClass), f = typeof a.customCss == "string" && a.customCss.trim() ? a.customCss.trim() : "", p = typeof a.customJs == "string" && a.customJs.trim() ? a.customJs.trim() : "", m = typeof a.favicon == "string" && a.favicon.trim() ? a.favicon.trim() : "", h = typeof a.metaDescription == "string" && a.metaDescription.trim() ? a.metaDescription.trim() : "", g = typeof a.ogImageUrl == "string" && a.ogImageUrl.trim() ? a.ogImageUrl.trim() : "", v = typeof a.contentMaxWidth == "string" && a.contentMaxWidth.trim() ? a.contentMaxWidth.trim() : "1200px", y = Array.isArray(i.rows) ? i.rows : Array.isArray(r.rows) ? r.rows : Array.isArray(e.rows) ? e.rows : [], b = N(M(y, [a.fontFamily])), x = {
912
939
  tablet: [],
913
940
  mobile: []
914
941
  }, S = "";
915
- for (let e of y) S += Y(e, x, n);
942
+ for (let e of y) S += Z(e, x, n);
916
943
  let C = x.tablet.length ? `\n ${x.tablet.join("\n ")}` : "", w = x.mobile.length ? `\n ${x.mobile.join("\n ")}` : "", T = `<!DOCTYPE html>
917
944
  <html>
918
945
  <head>
919
946
  <meta charset="utf-8">
920
- <title>${V(l)}</title>
921
- ${h ? `<meta name="description" content="${V(h)}">` : ""}
922
- ${m ? `<link rel="icon" href="${V(m)}">` : ""}
947
+ <title>${B(l)}</title>
948
+ ${h ? `<meta name="description" content="${B(h)}">` : ""}
949
+ ${m ? `<link rel="icon" href="${B(m)}">` : ""}
923
950
  <meta property="og:type" content="website">
924
- <meta property="og:title" content="${V(l)}">
925
- ${h ? `<meta property="og:description" content="${V(h)}">` : ""}
926
- ${g ? `<meta property="og:image" content="${V(g)}">` : ""}
951
+ <meta property="og:title" content="${B(l)}">
952
+ ${h ? `<meta property="og:description" content="${B(h)}">` : ""}
953
+ ${g ? `<meta property="og:image" content="${B(g)}">` : ""}
927
954
  <meta name="twitter:card" content="${g ? "summary_large_image" : "summary"}">
928
- <meta name="twitter:title" content="${V(l)}">
929
- ${h ? `<meta name="twitter:description" content="${V(h)}">` : ""}
930
- ${g ? `<meta name="twitter:image" content="${V(g)}">` : ""}
955
+ <meta name="twitter:title" content="${B(l)}">
956
+ ${h ? `<meta name="twitter:description" content="${B(h)}">` : ""}
957
+ ${g ? `<meta name="twitter:image" content="${B(g)}">` : ""}
931
958
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
932
959
  ${b ? `<link rel="stylesheet" href="${b}">` : ""}
933
960
  ${S.includes("<opt-in-embed-form") ? `<script type="module" src="${_}"><\/script>` : ""}
@@ -969,17 +996,17 @@ ${p ? ` <script>\n${p}\n <\/script>` : ""}
969
996
  </body>
970
997
  </html>`, T = T.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), T;
971
998
  };
972
- function Z(e) {
999
+ function $(e) {
973
1000
  return e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
974
1001
  }
975
- function Q(e) {
976
- return Z(X(e));
1002
+ function ae(e) {
1003
+ return $(Q(e));
977
1004
  }
978
- function $(e) {
979
- return X(e);
1005
+ function oe(e) {
1006
+ return Q(e);
980
1007
  }
981
- function ee(e) {
1008
+ function se(e) {
982
1009
  return e;
983
1010
  }
984
1011
  //#endregion
985
- export { $ as a, B as c, ee as d, k as f, X as i, I as l, U as n, Q as o, R as r, j as s, A as t, Z as u };
1012
+ export { oe as a, z as c, se as d, k as f, Q as i, F as l, H as n, ae as o, L as r, j as s, A as t, $ as u };
package/dist/compiler.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./compiler-C4Rkxl1E.js";
1
+ import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./compiler-ZeSTpC8a.js";
2
2
  export { l as DEFAULT_BODY_FONT_FAMILY, a as FORM_NON_CSS_STYLE_KEYS, s as collectResponsiveRule, r as compileToHTML, e as compileToHTMLWithStrataAuto, o as compileToPlainText, c as convertSectionRowToPlexoRow, t as getFormDefaultStyle, i as getInlineStylesImportant, u as htmlToPlainText, n as injectStrataBundle };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { i as e, n as t, o as n, r, s as i, t as a } from "./sanitizeCompiledHtml-D3k1f2jT.js";
2
2
  import { S as o, _ as s, a as c, b as l, c as u, f as d, h as f, i as p, l as m, o as h, p as g, s as _, u as v, x as y, y as b } from "./iconSvgStatic-CGue7nyp.js";
3
- import { a as x, d as S, f as C, i as ee, o as te, u as w } from "./compiler-C4Rkxl1E.js";
3
+ import { a as x, d as S, f as C, i as ee, o as te, u as w } from "./compiler-ZeSTpC8a.js";
4
4
  import { t as ne } from "./compilerClient-BIrZIgfG.js";
5
5
  import T, { createContext as E, createElement as re, forwardRef as ie, useCallback as ae, useContext as oe, useEffect as D, useImperativeHandle as se, useMemo as O, useRef as k, useState as A } from "react";
6
6
  import { DndContext as ce, DragOverlay as le, MeasuringStrategy as ue, PointerSensor as de, TouchSensor as fe, pointerWithin as pe, rectIntersection as me, useDraggable as j, useDroppable as he, useSensor as M, useSensors as ge } from "@dnd-kit/core";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@charisol/plexo-sdk",
3
3
  "private": false,
4
- "version": "1.4.25",
4
+ "version": "1.4.26",
5
5
  "description": "Plexo visual email and landing page builder SDK — drag-and-drop template editor with AI integration.",
6
6
  "keywords": [
7
7
  "email-builder",