@templatical/editor 0.7.2 → 0.8.0

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.
Files changed (134) hide show
  1. package/dist/{AiChatSidebar-DWRONNm6.js → AiChatSidebar-B74X6tIx.js} +49 -59
  2. package/dist/{AiFeatureMenu-U7b4Z8OV.js → AiFeatureMenu-BOxQqkn9.js} +4 -4
  3. package/dist/{BlockA11yBadge-BFIw0h1m.js → BlockIssueBadge-DJTiT1eF.js} +6 -6
  4. package/dist/{CloudEditor-DgiUCNMn.js → CloudEditor-BzCVDD6e.js} +125 -121
  5. package/dist/{CollaboratorBar-BgeaMhrV.js → CollaboratorBar-Cb-c1IkS.js} +3 -3
  6. package/dist/{CommentsSidebar-BiRtaXYD.js → CommentsSidebar-Qvppl-DR.js} +7 -7
  7. package/dist/{CountdownBlock-Cq8A8WrM.js → CountdownBlock-D0IiMliC.js} +1 -1
  8. package/dist/{CountdownToolbar-CojjlZet.js → CountdownToolbar-BVVT8U5C.js} +3 -3
  9. package/dist/{DesignReferenceSidebar-C1W02bYt.js → DesignReferenceSidebar-ucgtoDll.js} +7 -7
  10. package/dist/{AccessibilityPanel-D-PqmHdH.js → IssuesPanel-XVdvrgmq.js} +18 -18
  11. package/dist/{ModuleBrowserModal-Bjh99_5c.js → ModuleBrowserModal-BotDsZ0R.js} +7 -7
  12. package/dist/{ModulePreviewCanvas-DDDQmUI_.js → ModulePreviewCanvas-CDg4MnJP.js} +2 -2
  13. package/dist/{NumberWithSuffix-CLTBb2Rj.js → NumberWithSuffix-n-cr7lpU.js} +2 -2
  14. package/dist/{ParagraphEditor-BSaEdasm.js → ParagraphEditor-CfzIUFQ_.js} +18 -18
  15. package/dist/{RichTextEditorContent-C3QSg7gd.js → RichTextEditorContent-Cu9NEkKd.js} +3 -3
  16. package/dist/{SaveModuleDialog-9fX6oSxf.js → SaveModuleDialog-DuzfCamG.js} +6 -6
  17. package/dist/{SnapshotHistory-gYW-IXkE.js → SnapshotHistory-DiAPOSDM.js} +6 -6
  18. package/dist/{TemplateScoringPanel-V79yrEPC.js → TemplateScoringPanel-BzDVdfOx.js} +6 -6
  19. package/dist/{TestEmailModal-B_Rmnngq.js → TestEmailModal-D5I5Mgtb.js} +3 -3
  20. package/dist/{TitleEditor-XbFuw1Vy.js → TitleEditor-CZUkhtDo.js} +9 -9
  21. package/dist/{TplModal-LY9rkDph.js → TplModal-CVq2BAIW.js} +3 -3
  22. package/dist/{blockTypeIcons-CLT2H0yU.js → blockTypeIcons-CJNuGjLX.js} +1 -1
  23. package/dist/bundle-stats.json +7 -7
  24. package/dist/cdn/chunks/{AiFeatureMenu-WhZ7G-Wr.js → AiFeatureMenu-DtrT-aFR.js} +8 -8
  25. package/dist/cdn/chunks/{AiFeatureMenu-WhZ7G-Wr.js.map → AiFeatureMenu-DtrT-aFR.js.map} +1 -1
  26. package/dist/cdn/chunks/{BlockA11yBadge-BLKyO0lH.js → BlockIssueBadge-w7n4orSd.js} +6 -6
  27. package/dist/cdn/chunks/BlockIssueBadge-w7n4orSd.js.map +1 -0
  28. package/dist/cdn/chunks/{CloudEditor-BKEXPt3g.js → CloudEditor-CwG0DhG1.js} +166 -162
  29. package/dist/cdn/chunks/CloudEditor-CwG0DhG1.js.map +1 -0
  30. package/dist/cdn/chunks/{CollaboratorBar-ASDiTitQ.js → CollaboratorBar-DYjZaz7H.js} +3 -3
  31. package/dist/cdn/chunks/{CollaboratorBar-ASDiTitQ.js.map → CollaboratorBar-DYjZaz7H.js.map} +1 -1
  32. package/dist/cdn/chunks/{CountdownBlock-LAlYJYWL.js → CountdownBlock-CFR8VJCU.js} +2 -2
  33. package/dist/cdn/chunks/{CountdownBlock-LAlYJYWL.js.map → CountdownBlock-CFR8VJCU.js.map} +1 -1
  34. package/dist/cdn/chunks/{CountdownToolbar-CbIKGP7u.js → CountdownToolbar-DOrQCH57.js} +3 -3
  35. package/dist/cdn/chunks/{CountdownToolbar-CbIKGP7u.js.map → CountdownToolbar-DOrQCH57.js.map} +1 -1
  36. package/dist/cdn/chunks/{AccessibilityPanel-DaqF4Xzy.js → IssuesPanel-C54PhBgc.js} +16 -16
  37. package/dist/cdn/chunks/IssuesPanel-C54PhBgc.js.map +1 -0
  38. package/dist/cdn/chunks/{ModuleBrowserModal-BjmdleNq.js → ModuleBrowserModal-4V6um-AC.js} +8 -8
  39. package/dist/cdn/chunks/{ModuleBrowserModal-BjmdleNq.js.map → ModuleBrowserModal-4V6um-AC.js.map} +1 -1
  40. package/dist/cdn/chunks/{ModulePreviewCanvas-DsmACAdb.js → ModulePreviewCanvas-DL8zI6VX.js} +26 -26
  41. package/dist/cdn/chunks/{ModulePreviewCanvas-DsmACAdb.js.map → ModulePreviewCanvas-DL8zI6VX.js.map} +1 -1
  42. package/dist/cdn/chunks/{NumberWithSuffix-EEDNj1my.js → NumberWithSuffix-avXrYDo6.js} +2 -2
  43. package/dist/cdn/chunks/{NumberWithSuffix-EEDNj1my.js.map → NumberWithSuffix-avXrYDo6.js.map} +1 -1
  44. package/dist/cdn/chunks/{ParagraphEditor-D6Dw5RtX.js → ParagraphEditor-Cpmy85zL.js} +39 -39
  45. package/dist/cdn/chunks/{ParagraphEditor-D6Dw5RtX.js.map → ParagraphEditor-Cpmy85zL.js.map} +1 -1
  46. package/dist/cdn/chunks/{RichTextEditorContent-C2yj_yPM.js → RichTextEditorContent-CFL-Lrv5.js} +5 -5
  47. package/dist/cdn/chunks/{RichTextEditorContent-C2yj_yPM.js.map → RichTextEditorContent-CFL-Lrv5.js.map} +1 -1
  48. package/dist/cdn/chunks/{SaveModuleDialog-DCcvwYat.js → SaveModuleDialog-D6szy5vX.js} +14 -14
  49. package/dist/cdn/chunks/{SaveModuleDialog-DCcvwYat.js.map → SaveModuleDialog-D6szy5vX.js.map} +1 -1
  50. package/dist/cdn/chunks/{TitleEditor-isN_t0MJ.js → TitleEditor-CSDdss38.js} +9 -9
  51. package/dist/cdn/chunks/{TitleEditor-isN_t0MJ.js.map → TitleEditor-CSDdss38.js.map} +1 -1
  52. package/dist/cdn/chunks/blockTypeIcons-BEdpG8xl.js +22 -0
  53. package/dist/cdn/chunks/{blockTypeIcons-Bgn69Q1-.js.map → blockTypeIcons-BEdpG8xl.js.map} +1 -1
  54. package/dist/{de-BhIWu_bO.js → cdn/chunks/de-BBEGQDsd.js} +9 -7
  55. package/dist/cdn/chunks/{de-B_6zGPbx.js.map → de-BBEGQDsd.js.map} +1 -1
  56. package/dist/{en-D7HRbYah.js → cdn/chunks/en-CHha-_ta.js} +9 -7
  57. package/dist/cdn/chunks/{en-pYt1-lm4.js.map → en-CHha-_ta.js.map} +1 -1
  58. package/dist/cdn/chunks/{extensions-BPsjY5N8.js → extensions-DgvvgeJU.js} +50 -48
  59. package/dist/cdn/chunks/{extensions-BPsjY5N8.js.map → extensions-DgvvgeJU.js.map} +1 -1
  60. package/dist/cdn/chunks/{features-BouLRfOO.js → features-CgTy87Ni.js} +1276 -1119
  61. package/dist/cdn/chunks/features-CgTy87Ni.js.map +1 -0
  62. package/dist/cdn/chunks/{icons-BBuZkqC3.js → icons-DxJ--AJb.js} +36 -38
  63. package/dist/cdn/chunks/icons-DxJ--AJb.js.map +1 -0
  64. package/dist/cdn/chunks/{media-library-C-DcHE6w.js → media-library-Byh_BbTm.js} +113 -113
  65. package/dist/cdn/chunks/{media-library-C-DcHE6w.js.map → media-library-Byh_BbTm.js.map} +1 -1
  66. package/dist/{pt-BR-K32lt6YP.js → cdn/chunks/pt-BR-CFomv2R8.js} +9 -7
  67. package/dist/cdn/chunks/{pt-BR-CtDwVsN-.js.map → pt-BR-CFomv2R8.js.map} +1 -1
  68. package/dist/cdn/chunks/quality-CHCEMG8e.js +1846 -0
  69. package/dist/cdn/chunks/quality-CHCEMG8e.js.map +1 -0
  70. package/dist/cdn/chunks/{renderer-F8cxEe3t.js → renderer-DttVILgu.js} +50 -50
  71. package/dist/cdn/chunks/{renderer-F8cxEe3t.js.map → renderer-DttVILgu.js.map} +1 -1
  72. package/dist/cdn/chunks/{src-C9rMok-R.js → src-a8fYhBi5.js} +8 -8
  73. package/dist/cdn/chunks/{src-C9rMok-R.js.map → src-a8fYhBi5.js.map} +1 -1
  74. package/dist/cdn/chunks/styles-8qDRQ-6n.js +3001 -0
  75. package/dist/cdn/chunks/styles-8qDRQ-6n.js.map +1 -0
  76. package/dist/cdn/editor.css +1 -1
  77. package/dist/cdn/editor.js +112 -109
  78. package/dist/cdn/editor.js.map +1 -1
  79. package/dist/{cdn/chunks/de-B_6zGPbx.js → de-KFqjrxG3.js} +7 -9
  80. package/dist/{dist-DDJIWTRY.js → dist-B2jcQhv8.js} +1 -1
  81. package/dist/{dist-wzMIGj-D.js → dist-BYt3jdCR.js} +1 -1
  82. package/dist/{dist-aRzjfSRN.js → dist-CISFttkF.js} +1 -1
  83. package/dist/{dist-D6uC2xhi.js → dist-CfQPBf15.js} +1 -1
  84. package/dist/{dist-DjviJBCi.js → dist-DD-9hatO.js} +1 -1
  85. package/dist/{dist-KoBJjK1G.js → dist-DUvhjQ2-.js} +1 -1
  86. package/dist/{dist-BaQIYPsn.js → dist-DVwOAodp.js} +1 -1
  87. package/dist/{dist-Cp0zXPAD.js → dist-DxD1kSdH.js} +1 -1
  88. package/dist/{dist-Pk4MhWMP.js → dist-U5guDm2w.js} +1 -1
  89. package/dist/{dist-D90y8dvT.js → dist-hfu7I2rO.js} +3 -3
  90. package/dist/{dist-us-RpCWN.js → dist-v8h02hhE.js} +1 -1
  91. package/dist/{cdn/chunks/en-pYt1-lm4.js → en-CNm94YYD.js} +7 -9
  92. package/dist/{extensions-D-J02CiP.js → extensions-C-FpnfJn.js} +32 -30
  93. package/dist/index.d.ts +13 -11
  94. package/dist/{keys-B5SJtPWf.js → keys-CY3tkCsv.js} +2 -2
  95. package/dist/list-checks-CMtEXe9l.js +25 -0
  96. package/dist/{cdn/chunks/pt-BR-CtDwVsN-.js → pt-BR-gxZZAUWp.js} +7 -9
  97. package/dist/style.css +1 -1
  98. package/dist/{styles-j_3bu0Bo.js → styles-Ci7RdimQ.js} +1096 -1065
  99. package/dist/templatical-editor.js +108 -105
  100. package/dist/useAliveFlag-D8GoB4VE.js +10 -0
  101. package/dist/{useCloudI18n-ByEMykjO.js → useCloudI18n-BPUHj2CZ.js} +1 -1
  102. package/dist/{useEditorCore-B1XrI6fY.js → useEditorCore-DT3VrvZS.js} +940 -785
  103. package/dist/{useI18n-PEB8ioi_.js → useI18n-CWX9ZTCW.js} +1 -1
  104. package/dist/{useMergeTag-C47xwU7X.js → useMergeTag-B3F9VR04.js} +2 -2
  105. package/dist/{usePopoverRoot-BxJrqnMD.js → usePopoverRoot-BKJcxsst.js} +1 -1
  106. package/package.json +7 -7
  107. package/dist/accessibility-BgUEA-Ai.js +0 -27
  108. package/dist/cdn/chunks/AccessibilityPanel-DaqF4Xzy.js.map +0 -1
  109. package/dist/cdn/chunks/BlockA11yBadge-BLKyO0lH.js.map +0 -1
  110. package/dist/cdn/chunks/CloudEditor-BKEXPt3g.js.map +0 -1
  111. package/dist/cdn/chunks/blockTypeIcons-Bgn69Q1-.js +0 -22
  112. package/dist/cdn/chunks/features-BouLRfOO.js.map +0 -1
  113. package/dist/cdn/chunks/icons-BBuZkqC3.js.map +0 -1
  114. package/dist/cdn/chunks/quality-ConWSEB6.js +0 -1456
  115. package/dist/cdn/chunks/quality-ConWSEB6.js.map +0 -1
  116. package/dist/cdn/chunks/styles-BRN0i_zg.js +0 -2971
  117. package/dist/cdn/chunks/styles-BRN0i_zg.js.map +0 -1
  118. /package/dist/{check-Bg5yrRmX.js → check-BF4bEbCU.js} +0 -0
  119. /package/dist/{chevron-down-tee-ghFi.js → chevron-down-4NzWtv6Y.js} +0 -0
  120. /package/dist/{circle-alert-C0L9pUQ4.js → circle-alert-CPIth9bC.js} +0 -0
  121. /package/dist/{clock-CDlEdqiP.js → clock-B9-ct9r_.js} +0 -0
  122. /package/dist/{cloud-CTmfCSqf.js → cloud-k0DgeCo2.js} +0 -0
  123. /package/dist/{de-Di4MEjjx.js → de-GOtR9DwW.js} +0 -0
  124. /package/dist/{dist-iLBdeBDR.js → dist-CQQS9SRN.js} +0 -0
  125. /package/dist/{emojiData-DX3E0XT-.js → emojiData-DrBuvEoP.js} +0 -0
  126. /package/dist/{en-BSuzi-Pd.js → en-dFFQVzNn.js} +0 -0
  127. /package/dist/{formatRelativeTime-BOEf47hq.js → formatRelativeTime-bvx5sFh5.js} +0 -0
  128. /package/dist/{image-up-1D_3XDdO.js → image-up-CubAveUO.js} +0 -0
  129. /package/dist/{info-DTGrc0Bx.js → info-DiINxXfZ.js} +0 -0
  130. /package/dist/{liquid.browser-CdMv1BTn.js → liquid.browser-DX8ZHRdq.js} +0 -0
  131. /package/dist/{pt-BR-CCVBRais.js → pt-BR-iOr79aDg.js} +0 -0
  132. /package/dist/{readableTextColor-CY3SiRnt.js → readableTextColor-CXzrEnNb.js} +0 -0
  133. /package/dist/{refresh-cw-BNAhAmtL.js → refresh-cw-C9_M6yB3.js} +0 -0
  134. /package/dist/{styleConstants-fWzlIIwN.js → styleConstants-DkfOPzGu.js} +0 -0
@@ -0,0 +1,3001 @@
1
+ import { F as e, G as t, H as n, J as r, L as i, M as a, O as o, P as s, T as c, V as l, Y as u, Z as d, b as f, c as p, ct as m, f as h, g, h as _, it as v, l as y, m as b, n as x, o as S, ot as C, p as w, s as T, st as E, t as D, u as O, v as k, x as A, y as j, z as M } from "./draggable-P6QWzy4g.js";
2
+ import { $ as N, $t as P, Bt as F, Ct as ee, Dt as te, F as I, Ft as L, G as R, Gt as z, H as ne, I as re, J as ie, Jt as ae, K as oe, Kt as se, L as ce, Lt as le, M as ue, Mt as de, N as fe, P as pe, Pt as me, R as he, Sn as B, St as ge, Tt as _e, U as ve, V as ye, Vt as be, W as xe, Wt as Se, Xt as Ce, Yt as we, at as Te, bn as Ee, bt as De, ct as Oe, dn as ke, et as Ae, fn as je, gn as Me, hn as Ne, it as Pe, j as Fe, kt as Ie, mn as Le, mt as Re, nn as ze, q as Be, qt as Ve, rt as V, ut as He, vn as Ue, wn as We, wt as Ge, xn as Ke, xt as qe, yt as Je, z as Ye, zt as Xe } from "./features-CgTy87Ni.js";
3
+ import { B as Ze, E as H, F as U, H as Qe, I as $e, K as et, L as tt, N as nt, P as rt, X as it, c as at, d as ot, g as st, h as ct, j as lt, k as ut, l as dt, o as ft, s as pt, v as mt, x as ht, y as gt } from "./icons-DxJ--AJb.js";
4
+ import { t as _t } from "./readableTextColor-DhoK4XiZ.js";
5
+ import { t as vt } from "./CountdownBlock-CFR8VJCU.js";
6
+ import { t as yt } from "./blockTypeIcons-BEdpG8xl.js";
7
+ import { _ as bt, c as xt, f as W, g as St, h as G, l as Ct, m as K, p as q, t as wt } from "./styleConstants-DP1VOca8.js";
8
+ import { i as J, n as Y, r as X, t as Tt } from "./NumberWithSuffix-avXrYDo6.js";
9
+ //#region src/utils/resolveLintOptions.ts
10
+ function Et(e) {
11
+ return {
12
+ ...e.lint,
13
+ locale: e.locale
14
+ };
15
+ }
16
+ //#endregion
17
+ //#region src/components/Canvas.vue?vue&type=script&setup=true&lang.ts
18
+ var Dt = ["aria-label"], Ot = {
19
+ key: 0,
20
+ class: "tpl-canvas-empty-content tpl:flex tpl:flex-col tpl:items-center"
21
+ }, kt = { class: "tpl-canvas-empty-icon tpl:mb-4 tpl:text-[var(--tpl-primary)]" }, At = { class: "tpl-canvas-empty-title tpl:m-0 tpl:mb-2 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-primary)]" }, jt = { class: "tpl-canvas-empty-text tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-dim)]" }, Mt = {
22
+ key: 0,
23
+ class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
24
+ }, Nt = {
25
+ key: 1,
26
+ class: "tpl:m-0 tpl:mt-4 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
27
+ }, Pt = { class: "tpl:relative" }, Ft = {
28
+ class: "tpl:inline-flex tpl:size-3 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[8px] tpl:font-bold",
29
+ style: { "background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 30%,\n transparent\n )" }
30
+ }, It = /* @__PURE__ */ V(/* @__PURE__ */ A({
31
+ __name: "Canvas",
32
+ props: {
33
+ viewport: {},
34
+ content: {},
35
+ selectedBlockId: {},
36
+ darkMode: { type: Boolean },
37
+ previewMode: { type: Boolean },
38
+ lockedBlocks: {}
39
+ },
40
+ emits: [
41
+ "select-block",
42
+ "open-ai-chat",
43
+ "open-design-reference"
44
+ ],
45
+ setup(e, { emit: t }) {
46
+ let r = {
47
+ section: ce,
48
+ title: he,
49
+ paragraph: ne,
50
+ image: xe,
51
+ button: de,
52
+ divider: Be,
53
+ spacer: fe,
54
+ html: oe,
55
+ social: pe,
56
+ menu: ve,
57
+ table: ue,
58
+ video: Fe,
59
+ countdown: vt,
60
+ custom: ie
61
+ }, o = e, u = t, { t: f } = L(), { t: p } = Ae(), y = ze(Ve, "Canvas"), x = c(Se, null), S = c(F, null), A = c(be, {}), M = h(() => (A.plan?.hasFeature("ai_generation") ?? !1) && (A.ai?.isFeatureEnabled("chat") ?? !1)), N = h(() => (A.plan?.hasFeature("ai_generation") ?? !1) && (A.ai?.isFeatureEnabled("designToTemplate") ?? !1)), P = h({
62
+ get: () => o.content.blocks,
63
+ set: (e) => {
64
+ y.setContent({
65
+ ...o.content,
66
+ blocks: e
67
+ });
68
+ }
69
+ }), ee = h(() => {
70
+ switch (o.viewport) {
71
+ case "mobile": return 375;
72
+ case "tablet": return 768;
73
+ default: return o.content.settings.width;
74
+ }
75
+ }), te = h(() => ({ fontFamily: o.content.settings.fontFamily })), I = h(() => P.value.length === 0 && !o.previewMode), R = d(0), z = h(() => I.value && R.value > 0);
76
+ function re() {
77
+ I.value && (R.value += 1);
78
+ }
79
+ function ae() {
80
+ I.value && (R.value = Math.max(0, R.value - 1));
81
+ }
82
+ function se() {
83
+ R.value = 0;
84
+ }
85
+ function le(e) {
86
+ o.previewMode || e.target === e.currentTarget && u("select-block", null);
87
+ }
88
+ function me(e) {
89
+ return ye(e, S, r);
90
+ }
91
+ function B(e) {
92
+ return o.lockedBlocks?.get(e) ?? null;
93
+ }
94
+ function ge(e, t) {
95
+ e.type === "custom" && y.updateBlock(e.id, {
96
+ fieldValues: t.fieldValues,
97
+ dataSourceFetched: t.dataSourceFetched
98
+ });
99
+ }
100
+ return (t, r) => (a(), g("div", {
101
+ "data-testid": "canvas-wrapper",
102
+ role: "region",
103
+ "aria-label": v(f).landmarks.canvas,
104
+ class: "tpl-canvas-wrapper tpl:relative tpl:rounded-lg",
105
+ style: E({
106
+ width: `${ee.value}px`,
107
+ boxShadow: e.darkMode ? "none" : "var(--tpl-shadow-xl)",
108
+ transition: "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)"
109
+ })
110
+ }, [w("div", {
111
+ class: "tpl-canvas-bg tpl:absolute tpl:inset-0 tpl:rounded-lg tpl:pointer-events-none",
112
+ style: E({
113
+ backgroundColor: e.content.settings.backgroundColor,
114
+ ...e.darkMode ? { filter: "invert(1) hue-rotate(180deg)" } : {},
115
+ transition: "filter 300ms ease"
116
+ })
117
+ }, null, 4), w("div", {
118
+ class: C(["tpl-canvas tpl:relative tpl:rounded-lg", {
119
+ "tpl-canvas--dark-mode": e.darkMode,
120
+ "tpl-preview-mode": e.previewMode
121
+ }]),
122
+ style: E(te.value),
123
+ onClick: le
124
+ }, [j(v(D), {
125
+ modelValue: P.value,
126
+ "onUpdate:modelValue": r[2] ||= (e) => P.value = e,
127
+ group: "blocks",
128
+ animation: 150,
129
+ "ghost-class": "tpl-ghost",
130
+ "drag-class": "tpl-dragging",
131
+ handle: ".tpl-block-btn",
132
+ "invert-swap": !0,
133
+ "inverted-swap-threshold": .65,
134
+ disabled: e.previewMode,
135
+ draggable: ".tpl-block-item",
136
+ "force-fallback": !0,
137
+ class: C([
138
+ "tpl-canvas-blocks",
139
+ I.value ? "tpl-canvas-empty tpl:m-6 tpl:flex tpl:min-h-[400px] tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-xl tpl:border-2 tpl:border-dashed tpl:px-10 tpl:py-12 tpl:text-center tpl:bg-[var(--tpl-bg-elevated)] tpl:font-[var(--tpl-font-family)] tpl:transition-colors tpl:duration-150" : "",
140
+ I.value && z.value ? "tpl-canvas-empty--drag-over tpl:border-[var(--tpl-primary-hover)] tpl:bg-[var(--tpl-primary-light)]" : "",
141
+ I.value && !z.value ? "tpl:border-[var(--tpl-primary)]" : ""
142
+ ]),
143
+ onDragenter: re,
144
+ onDragleave: ae,
145
+ onDrop: se
146
+ }, {
147
+ default: l(() => [I.value ? (a(), g("div", Ot, [
148
+ w("div", kt, [j(v(st), {
149
+ size: 48,
150
+ "stroke-width": 1
151
+ })]),
152
+ w("p", At, m(v(f).canvas.noBlocks), 1),
153
+ w("p", jt, m(v(f).canvas.dragHint), 1),
154
+ M.value && v(p) ? (a(), g("p", Mt, [
155
+ k(m(v(f).canvas.aiHintChat) + " ", 1),
156
+ w("button", {
157
+ class: "tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
158
+ onClick: r[0] ||= (e) => u("open-ai-chat")
159
+ }, [j(v(He), {
160
+ size: 14,
161
+ "stroke-width": 2
162
+ }), k(" " + m(v(p).aiMenu.aiAssistant), 1)]),
163
+ k(" " + m(v(f).canvas.aiHintChatSuffix), 1)
164
+ ])) : _("", !0),
165
+ N.value && v(p) ? (a(), g("p", Nt, [
166
+ k(m(v(f).canvas.aiHintDesign) + " ", 1),
167
+ w("button", {
168
+ class: "tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
169
+ onClick: r[1] ||= (e) => u("open-design-reference")
170
+ }, [j(v(qe), {
171
+ size: 14,
172
+ "stroke-width": 2
173
+ }), k(" " + m(v(p).aiMenu.designToTemplate), 1)]),
174
+ k(" " + m(v(f).canvas.aiHintDesignSuffix), 1)
175
+ ])) : _("", !0)
176
+ ])) : _("", !0), (a(!0), g(O, null, s(P.value, (t) => n((a(), g("div", {
177
+ key: t.id,
178
+ class: "tpl-block-item"
179
+ }, [w("div", Pt, [B(t.id) ? (a(), g("div", {
180
+ key: 0,
181
+ class: "tpl-collab-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
182
+ style: E({
183
+ outline: `2px solid ${B(t.id).color}`,
184
+ outlineOffset: "-1px"
185
+ })
186
+ }, [w("span", {
187
+ class: "tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:flex tpl:-translate-x-1/2 tpl:-translate-y-full tpl:items-center tpl:gap-1 tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:whitespace-nowrap",
188
+ style: E({
189
+ backgroundColor: B(t.id).color,
190
+ color: v(_t)(B(t.id).color)
191
+ })
192
+ }, [w("span", Ft, m(B(t.id).name.charAt(0)), 1), k(" " + m(B(t.id).name), 1)], 4)], 4)) : _("", !0), j(Ye, {
193
+ block: t,
194
+ "is-selected": !e.previewMode && e.selectedBlockId === t.id && !B(t.id),
195
+ viewport: e.viewport,
196
+ "preview-mode": e.previewMode,
197
+ onSelect: (n) => e.previewMode || B(t.id) ? void 0 : u("select-block", t.id)
198
+ }, {
199
+ default: l(() => [(a(), b(i(me(t)), {
200
+ block: t,
201
+ viewport: e.viewport,
202
+ onFetchData: (e) => ge(t, e),
203
+ onUpdate: (e) => v(y).updateBlock(t.id, e)
204
+ }, null, 40, [
205
+ "block",
206
+ "viewport",
207
+ "onFetchData",
208
+ "onUpdate"
209
+ ]))]),
210
+ _: 2
211
+ }, 1032, [
212
+ "block",
213
+ "is-selected",
214
+ "viewport",
215
+ "preview-mode",
216
+ "onSelect"
217
+ ])])])), [[T, !v(x)?.isHidden(t.id)]])), 128))]),
218
+ _: 1
219
+ }, 8, [
220
+ "modelValue",
221
+ "disabled",
222
+ "class"
223
+ ])], 6)], 12, Dt));
224
+ }
225
+ }), [["__scopeId", "data-v-a4d3fa2d"]]), Lt = ["aria-label"], Rt = {
226
+ key: 0,
227
+ class: "tpl:border-b tpl:px-1 tpl:pb-1 tpl:border-[var(--tpl-border)]"
228
+ }, zt = ["aria-label"], Bt = {
229
+ key: 0,
230
+ class: "tpl:flex-1 tpl:truncate tpl:text-sm tpl:font-medium"
231
+ }, Vt = {
232
+ key: 1,
233
+ class: "tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]"
234
+ }, Ht = [
235
+ "data-palette-type",
236
+ "aria-label",
237
+ "onClick",
238
+ "onKeydown"
239
+ ], Ut = { class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:scale-105" }, Wt = {
240
+ key: 0,
241
+ class: "tpl:truncate tpl:text-sm tpl:font-medium"
242
+ }, Gt = /* @__PURE__ */ A({
243
+ __name: "Sidebar",
244
+ setup(e) {
245
+ let { t, format: n } = L(), { t: r } = Ae(), o = c(z, []), u = c(Xe, void 0), f = c(Ve, null), p = c(be, {}), y = h(() => (p.savedModules?.moduleCount.value ?? 0) > 0), x = d(!1), S = d(!1);
246
+ function C() {
247
+ S.value || (x.value = !1);
248
+ }
249
+ function T() {
250
+ S.value = !0;
251
+ }
252
+ function k() {
253
+ S.value = !1;
254
+ }
255
+ let A = [
256
+ "section",
257
+ "image",
258
+ "title",
259
+ "paragraph",
260
+ "button",
261
+ "divider",
262
+ "video",
263
+ "social",
264
+ "menu",
265
+ "table",
266
+ "spacer",
267
+ "html"
268
+ ], M = h(() => {
269
+ let e = A.map((e) => ({
270
+ type: e,
271
+ label: me(e, t)
272
+ }));
273
+ return p.plan && e.splice(-1, 0, {
274
+ type: "countdown",
275
+ label: me("countdown", t)
276
+ }), e;
277
+ }), N = h(() => o.map((e) => ({
278
+ type: `custom:${e.type}`,
279
+ label: e.name,
280
+ isCustom: !0,
281
+ icon: e.icon
282
+ }))), P = h(() => [...M.value, ...N.value]);
283
+ function F(e) {
284
+ if (e.isCustom) {
285
+ let t = e.type.replace("custom:", ""), n = o.find((e) => e.type === t);
286
+ if (n) return Ke(n);
287
+ }
288
+ return Ee(e.type, u);
289
+ }
290
+ function ee(e) {
291
+ if (!f) return;
292
+ let t = F(e);
293
+ f.addBlock(t), f.selectBlock(t.id);
294
+ }
295
+ function te(e, t) {
296
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), ee(t));
297
+ }
298
+ return (e, o) => (a(), g("aside", {
299
+ "aria-label": v(t).sidebarNav.palette,
300
+ class: "tpl-sidebar-rail tpl:absolute tpl:top-14 tpl:bottom-0 tpl:left-0 tpl:z-40 tpl:overflow-hidden",
301
+ style: E({
302
+ width: x.value ? "200px" : "48px",
303
+ backgroundColor: "var(--tpl-bg-elevated)",
304
+ borderRight: "1px solid var(--tpl-border)",
305
+ boxShadow: x.value ? "var(--tpl-shadow-lg)" : "none",
306
+ transition: "width 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1)"
307
+ }),
308
+ onMouseenter: o[1] ||= (e) => x.value = !0,
309
+ onMouseleave: C,
310
+ onFocusin: o[2] ||= (e) => x.value = !0,
311
+ onFocusout: o[3] ||= (e) => x.value = !1
312
+ }, [y.value && v(r) ? (a(), g("div", Rt, [w("button", {
313
+ type: "button",
314
+ "aria-label": v(t).sidebarNav.browseModules,
315
+ class: "tpl:flex tpl:h-10 tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)]",
316
+ style: E({ justifyContent: x.value ? "flex-start" : "center" }),
317
+ onClick: o[0] ||= (e) => v(p).savedModules?.openBrowser()
318
+ }, [
319
+ j(v(lt), {
320
+ size: 20,
321
+ "stroke-width": 1.5,
322
+ class: "tpl:shrink-0"
323
+ }),
324
+ x.value ? (a(), g("span", Bt, m(v(r).modules.title), 1)) : _("", !0),
325
+ x.value ? (a(), g("span", Vt, m(v(p).savedModules?.moduleCount.value ?? 0), 1)) : _("", !0)
326
+ ], 12, zt)])) : _("", !0), j(v(D), {
327
+ "model-value": P.value,
328
+ group: {
329
+ name: "blocks",
330
+ pull: "clone",
331
+ put: !1
332
+ },
333
+ clone: F,
334
+ sort: !1,
335
+ animation: 150,
336
+ "ghost-class": "tpl-ghost",
337
+ "force-fallback": !0,
338
+ class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:p-1",
339
+ onChoose: T,
340
+ onEnd: k
341
+ }, {
342
+ default: l(() => [(a(!0), g(O, null, s(P.value, (e) => (a(), g("button", {
343
+ key: e.type,
344
+ type: "button",
345
+ "data-palette-type": e.type,
346
+ "aria-label": v(n)(v(t).sidebarNav.insertBlock, { block: e.label }),
347
+ class: "tpl:flex tpl:h-10 tpl:w-full tpl:cursor-grab tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] active:tpl:cursor-grabbing",
348
+ style: E({ justifyContent: x.value ? "flex-start" : "center" }),
349
+ onClick: (t) => ee(e),
350
+ onKeydown: (t) => te(t, e)
351
+ }, [w("div", Ut, [v(yt)[e.type] ? (a(), b(i(v(yt)[e.type]), {
352
+ key: 0,
353
+ size: 20,
354
+ "stroke-width": 1.5
355
+ })) : e.isCustom ? (a(), b(Pe, {
356
+ key: 1,
357
+ icon: e.icon,
358
+ size: 20
359
+ }, null, 8, ["icon"])) : _("", !0)]), x.value ? (a(), g("span", Wt, m(e.label), 1)) : _("", !0)], 44, Ht))), 128))]),
360
+ _: 1
361
+ }, 8, ["model-value"])], 44, Lt));
362
+ }
363
+ });
364
+ //#endregion
365
+ //#region src/composables/useMergeTagField.ts
366
+ function Kt(e) {
367
+ let { modelValue: n, emit: i, elementRef: a } = e, { canRequestMergeTag: s, isRequesting: c, isMergeTagValue: l, getMergeTagLabel: u, requestMergeTag: f, syntax: p } = N(), m = d(!1), g = !1, _ = !1;
368
+ t() && r(() => {
369
+ _ = !0;
370
+ });
371
+ let v = h(() => {
372
+ let e = n();
373
+ if (!e) return [];
374
+ let t = [], r = `(${p.value.source}|${p.logic.source})`, i = new RegExp(r, "g"), a = 0, o;
375
+ for (; (o = i.exec(e)) !== null;) {
376
+ o.index > a && t.push({
377
+ type: "text",
378
+ value: e.slice(a, o.index)
379
+ });
380
+ let n = o[0];
381
+ l(n) ? t.push({
382
+ type: "mergeTag",
383
+ value: n,
384
+ label: u(n)
385
+ }) : Ue(n, p) ? t.push({
386
+ type: "logicMergeTag",
387
+ value: n,
388
+ keyword: Me(n, p)
389
+ }) : t.push({
390
+ type: "text",
391
+ value: n
392
+ }), a = o.index + n.length;
393
+ }
394
+ return a < e.length && t.push({
395
+ type: "text",
396
+ value: e.slice(a)
397
+ }), t;
398
+ }), y = h(() => v.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
399
+ function b() {
400
+ m.value = !0, o(() => {
401
+ a.value?.focus();
402
+ let e = n()?.length || 0;
403
+ a.value?.setSelectionRange(e, e);
404
+ });
405
+ }
406
+ function x() {
407
+ g || (m.value = !1);
408
+ }
409
+ function S(e) {
410
+ i(e.target.value);
411
+ }
412
+ function C() {
413
+ i("");
414
+ }
415
+ async function w() {
416
+ let e = m.value && a.value ? a.value.selectionStart ?? n().length : n().length;
417
+ g = !0;
418
+ let t;
419
+ try {
420
+ t = await f();
421
+ } finally {
422
+ g = !1;
423
+ }
424
+ if (!_ && t) {
425
+ let r = n().slice(0, e), s = n().slice(e);
426
+ i(r + t.value + s), m.value = !0, o(() => {
427
+ if (_) return;
428
+ let n = e + t.value.length;
429
+ a.value?.focus(), a.value?.setSelectionRange(n, n);
430
+ });
431
+ }
432
+ }
433
+ return {
434
+ segments: v,
435
+ hasMergeTags: y,
436
+ canRequestMergeTag: s,
437
+ isRequestingMergeTag: c,
438
+ isEditing: m,
439
+ startEditing: b,
440
+ stopEditing: x,
441
+ handleInput: S,
442
+ clearValue: C,
443
+ insertMergeTag: w
444
+ };
445
+ }
446
+ //#endregion
447
+ //#region src/components/MergeTagSegments.vue?vue&type=script&setup=true&lang.ts
448
+ var qt = ["aria-label", "onKeydown"], Jt = ["data-tooltip"], Yt = ["data-tooltip"], Xt = {
449
+ key: 2,
450
+ class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
451
+ }, Zt = ["aria-label", "title"], Qt = /* @__PURE__ */ A({
452
+ __name: "MergeTagSegments",
453
+ props: {
454
+ segments: {},
455
+ displayClass: {},
456
+ pulse: { type: Boolean }
457
+ },
458
+ emits: ["edit", "clear"],
459
+ setup(e, { emit: t }) {
460
+ let n = t, { t: r } = L();
461
+ function i() {
462
+ n("edit");
463
+ }
464
+ return (t, o) => (a(), g("div", {
465
+ role: "button",
466
+ tabindex: "0",
467
+ "aria-label": v(r).mergeTag.clickToEdit,
468
+ class: C([e.displayClass, { "tpl-pulse-fill": e.pulse }]),
469
+ onClick: i,
470
+ onKeydown: [p(i, ["enter"]), p(y(i, ["prevent"]), ["space"])]
471
+ }, [(a(!0), g(O, null, s(e.segments, (e, t) => (a(), g(O, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" ? (a(), g("span", {
472
+ key: 0,
473
+ class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium",
474
+ "data-tooltip": e.value,
475
+ style: {
476
+ "background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
477
+ color: "var(--tpl-primary)"
478
+ }
479
+ }, m(e.label), 9, Jt)) : e.type === "logicMergeTag" ? (a(), g("span", {
480
+ key: 1,
481
+ class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase",
482
+ "data-tooltip": e.value,
483
+ style: {
484
+ "background-color": "transparent",
485
+ border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
486
+ color: "var(--tpl-primary)"
487
+ }
488
+ }, m(e.keyword), 9, Yt)) : (a(), g("span", Xt, m(e.value), 1))], 64))), 128)), w("button", {
489
+ type: "button",
490
+ class: "tpl:ml-auto tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all hover:tpl:text-[var(--tpl-danger)] hover:tpl:opacity-100",
491
+ "aria-label": v(r).mergeTag.remove,
492
+ title: v(r).mergeTag.remove,
493
+ onClick: o[0] ||= y((e) => n("clear"), ["stop"])
494
+ }, [j(v(Te), {
495
+ size: 12,
496
+ "stroke-width": 2.5
497
+ })], 8, Zt)], 42, qt));
498
+ }
499
+ }), $t = [
500
+ "aria-label",
501
+ "title",
502
+ "disabled"
503
+ ], en = "tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] hover:tpl:border-[var(--tpl-primary)]", tn = /* @__PURE__ */ A({
504
+ __name: "MergeTagInsertButton",
505
+ props: { disabled: { type: Boolean } },
506
+ emits: ["insert"],
507
+ setup(e) {
508
+ let { t } = L();
509
+ return (n, r) => (a(), g("button", {
510
+ type: "button",
511
+ class: C([en, "tpl:mt-1.5"]),
512
+ "aria-label": v(t).mergeTag.insert,
513
+ title: v(t).mergeTag.insert,
514
+ disabled: e.disabled,
515
+ onClick: r[0] ||= (e) => n.$emit("insert")
516
+ }, [j(v(ht), {
517
+ size: 12,
518
+ "stroke-width": 2
519
+ }), k(" " + m(v(t).mergeTag.insert), 1)], 10, $t));
520
+ }
521
+ }), nn = { key: 0 }, rn = { key: 1 }, an = [
522
+ "value",
523
+ "placeholder",
524
+ "rows"
525
+ ], on = "tpl:w-full tpl:resize-y tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)]", sn = "tpl:flex tpl:w-full tpl:min-h-[5rem] tpl:cursor-pointer tpl:items-start tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", cn = /* @__PURE__ */ A({
526
+ __name: "MergeTagTextarea",
527
+ props: {
528
+ modelValue: {},
529
+ placeholder: { default: "" },
530
+ rows: { default: 3 }
531
+ },
532
+ emits: ["update:modelValue"],
533
+ setup(e, { emit: t }) {
534
+ let n = e, r = t, i = d(null), { segments: o, hasMergeTags: s, canRequestMergeTag: c, isRequestingMergeTag: l, isEditing: u, startEditing: f, stopEditing: m, handleInput: h, clearValue: y, insertMergeTag: x } = Kt({
535
+ modelValue: () => n.modelValue,
536
+ emit: (e) => r("update:modelValue", e),
537
+ elementRef: i
538
+ });
539
+ return (t, n) => v(s) && !v(u) ? (a(), g("div", nn, [j(Qt, {
540
+ segments: v(o),
541
+ "display-class": sn,
542
+ onEdit: v(f),
543
+ onClear: v(y)
544
+ }, null, 8, [
545
+ "segments",
546
+ "onEdit",
547
+ "onClear"
548
+ ]), v(c) ? (a(), b(tn, {
549
+ key: 0,
550
+ disabled: v(l),
551
+ onInsert: v(x)
552
+ }, null, 8, ["disabled", "onInsert"])) : _("", !0)])) : (a(), g("div", rn, [w("textarea", {
553
+ ref_key: "textareaRef",
554
+ ref: i,
555
+ class: C(on),
556
+ value: e.modelValue,
557
+ placeholder: e.placeholder,
558
+ rows: e.rows,
559
+ onInput: n[0] ||= (...e) => v(h) && v(h)(...e),
560
+ onBlur: n[1] ||= (...e) => v(m) && v(m)(...e),
561
+ onKeydown: n[2] ||= p((...e) => v(m) && v(m)(...e), ["escape"])
562
+ }, null, 40, an), v(c) ? (a(), b(tn, {
563
+ key: 0,
564
+ disabled: v(l),
565
+ onInsert: v(x)
566
+ }, null, 8, ["disabled", "onInsert"])) : _("", !0)]));
567
+ }
568
+ }), ln = { class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]" }, un = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:gap-3 tpl:overflow-y-auto tpl:p-4" }, dn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, fn = { class: "tpl:mb-3.5" }, pn = { class: "tpl:grid tpl:grid-cols-4 tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-hover)]" }, mn = ["onClick"], hn = { class: "tpl:flex tpl:items-stretch" }, gn = ["value"], _n = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, vn = { class: "tpl:mb-3.5" }, yn = ["value"], bn = ["value"], xn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Sn = ["value"], Cn = { class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, wn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Tn = { class: "tpl:mt-1 tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, En = { class: "tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, Dn = { class: "tpl:shrink-0 tpl:text-xs tpl:tabular-nums tpl:text-[var(--tpl-text-dim)]" }, On = { class: "tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3" }, kn = { class: "tpl:mb-2.5 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text-muted)]" }, An = { class: "tpl:m-0 tpl:pl-[18px] tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, jn = { class: "tpl:mb-1 tpl:last:mb-0" }, Mn = { class: "tpl:mb-1 tpl:last:mb-0" }, Nn = { class: "tpl:mb-1 tpl:last:mb-0" }, Pn = 150, Fn = /* @__PURE__ */ A({
569
+ __name: "TemplateSettings",
570
+ props: { settings: {} },
571
+ emits: ["update"],
572
+ setup(e, { emit: t }) {
573
+ let n = e, r = t, { t: i } = L(), o = ze(ae, "TemplateSettings"), c = h(() => o.fonts.value), l = h(() => c.value.some((e) => e.value === n.settings.fontFamily) ? n.settings.fontFamily : o.defaultFont.value), u = [
574
+ {
575
+ value: 480,
576
+ label: "480px"
577
+ },
578
+ {
579
+ value: 600,
580
+ label: "600px"
581
+ },
582
+ {
583
+ value: 700,
584
+ label: "700px"
585
+ },
586
+ {
587
+ value: 800,
588
+ label: "800px"
589
+ }
590
+ ];
591
+ return (t, n) => (a(), g("aside", ln, [w("div", un, [
592
+ w("div", { class: C(v(Ct)) }, [
593
+ w("div", dn, [j(v(ct), {
594
+ class: "tpl:text-[var(--tpl-text-muted)]",
595
+ size: 14,
596
+ "stroke-width": 2
597
+ }), w("span", null, m(v(i).templateSettings.layout), 1)]),
598
+ w("div", fn, [w("label", { class: C(v(G)) }, m(v(i).templateSettings.widthPreset), 3), w("div", pn, [(a(), g(O, null, s(u, (t) => w("button", {
599
+ key: t.value,
600
+ class: "tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
601
+ style: E({
602
+ backgroundColor: e.settings.width === t.value ? "var(--tpl-bg)" : "transparent",
603
+ color: e.settings.width === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
604
+ boxShadow: e.settings.width === t.value ? "var(--tpl-shadow)" : "none"
605
+ }),
606
+ onClick: (e) => r("update", { width: t.value })
607
+ }, m(t.label), 13, mn)), 64))])]),
608
+ w("div", null, [w("label", { class: C(v(G)) }, m(v(i).templateSettings.customWidth), 3), w("div", hn, [w("input", {
609
+ type: "number",
610
+ class: C(v(q)),
611
+ value: e.settings.width,
612
+ min: "300",
613
+ max: "900",
614
+ onInput: n[0] ||= (e) => r("update", { width: Number(e.target.value) })
615
+ }, null, 42, gn), w("span", { class: C(v(K)) }, "px", 2)])])
616
+ ], 2),
617
+ w("div", { class: C(v(Ct)) }, [
618
+ w("div", _n, [j(v(it), {
619
+ class: "tpl:text-[var(--tpl-text-muted)]",
620
+ size: 14,
621
+ "stroke-width": 2
622
+ }), w("span", null, m(v(i).templateSettings.appearance), 1)]),
623
+ w("div", vn, [w("label", { class: C(v(G)) }, m(v(i).templateSettings.backgroundColor), 3), j(J, {
624
+ "model-value": e.settings.backgroundColor,
625
+ placeholder: v(wt),
626
+ "onUpdate:modelValue": n[1] ||= (e) => r("update", { backgroundColor: e })
627
+ }, null, 8, ["model-value", "placeholder"])]),
628
+ w("div", null, [w("label", { class: C(v(G)) }, m(v(i).templateSettings.fontFamily), 3), w("select", {
629
+ class: C(v(W)),
630
+ value: l.value,
631
+ onChange: n[2] ||= (e) => r("update", { fontFamily: e.target.value })
632
+ }, [(a(!0), g(O, null, s(c.value, (e) => (a(), g("option", {
633
+ key: e.value,
634
+ value: e.value
635
+ }, m(e.label), 9, bn))), 128))], 42, yn)])
636
+ ], 2),
637
+ w("div", { class: C(v(Ct)) }, [w("div", xn, [j(v(et), {
638
+ class: "tpl:text-[var(--tpl-text-muted)]",
639
+ size: 14,
640
+ "stroke-width": 2
641
+ }), w("span", null, m(v(i).templateSettings.language), 1)]), w("div", null, [
642
+ w("label", { class: C(v(G)) }, m(v(i).templateSettings.contentLocale), 3),
643
+ w("input", {
644
+ type: "text",
645
+ class: C(v(W)),
646
+ value: e.settings.locale ?? "",
647
+ placeholder: "en",
648
+ spellcheck: "false",
649
+ autocapitalize: "off",
650
+ autocomplete: "off",
651
+ onInput: n[3] ||= (e) => r("update", { locale: e.target.value.trim() || void 0 })
652
+ }, null, 42, Sn),
653
+ w("p", Cn, m(v(i).templateSettings.contentLocaleHint), 1)
654
+ ])], 2),
655
+ w("div", { class: C(v(Ct)) }, [w("div", wn, [j(v(ge), {
656
+ class: "tpl:text-[var(--tpl-text-muted)]",
657
+ size: 14,
658
+ "stroke-width": 2
659
+ }), w("span", null, m(v(i).templateSettings.preheaderText), 1)]), w("div", null, [j(cn, {
660
+ "model-value": e.settings.preheaderText ?? "",
661
+ placeholder: v(i).templateSettings.preheaderTextPlaceholder,
662
+ rows: 2,
663
+ "onUpdate:modelValue": n[4] ||= (e) => r("update", { preheaderText: e.replace(/[\r\n]/g, " ") || void 0 })
664
+ }, null, 8, ["model-value", "placeholder"]), w("div", Tn, [w("span", En, m(v(i).templateSettings.preheaderTextHint), 1), w("span", Dn, m((e.settings.preheaderText ?? "").length) + "/" + m(Pn), 1)])])], 2),
665
+ w("div", On, [w("div", kn, [j(v(Je), {
666
+ size: 14,
667
+ "stroke-width": 2
668
+ }), w("span", null, m(v(i).templateSettings.tips), 1)]), w("ul", An, [
669
+ w("li", jn, m(v(i).templateSettings.tip1), 1),
670
+ w("li", Mn, m(v(i).templateSettings.tip2), 1),
671
+ w("li", Nn, m(v(i).templateSettings.tip3), 1)
672
+ ])])
673
+ ])]));
674
+ }
675
+ }), In = { key: 0 }, Ln = { key: 1 }, Rn = [
676
+ "type",
677
+ "value",
678
+ "placeholder"
679
+ ], zn = "tpl:flex tpl:w-full tpl:min-h-10 tpl:cursor-pointer tpl:items-center tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3.5 tpl:py-1.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", Z = /* @__PURE__ */ V(/* @__PURE__ */ A({
680
+ __name: "MergeTagInput",
681
+ props: {
682
+ modelValue: {},
683
+ type: { default: "text" },
684
+ placeholder: { default: "" },
685
+ pulse: {
686
+ type: Boolean,
687
+ default: !1
688
+ }
689
+ },
690
+ emits: ["update:modelValue"],
691
+ setup(e, { emit: t }) {
692
+ let n = e, r = t, i = d(null), { segments: o, hasMergeTags: s, canRequestMergeTag: c, isRequestingMergeTag: l, isEditing: u, startEditing: f, stopEditing: m, handleInput: h, clearValue: y, insertMergeTag: x } = Kt({
693
+ modelValue: () => n.modelValue,
694
+ emit: (e) => r("update:modelValue", e),
695
+ elementRef: i
696
+ });
697
+ return (t, n) => v(s) && !v(u) ? (a(), g("div", In, [j(Qt, {
698
+ segments: v(o),
699
+ "display-class": zn,
700
+ pulse: e.pulse,
701
+ onEdit: v(f),
702
+ onClear: v(y)
703
+ }, null, 8, [
704
+ "segments",
705
+ "pulse",
706
+ "onEdit",
707
+ "onClear"
708
+ ]), v(c) ? (a(), b(tn, {
709
+ key: 0,
710
+ disabled: v(l),
711
+ onInsert: v(x)
712
+ }, null, 8, ["disabled", "onInsert"])) : _("", !0)])) : (a(), g("div", Ln, [w("input", {
713
+ ref_key: "inputRef",
714
+ ref: i,
715
+ type: e.type,
716
+ class: C([v(W), { "tpl-pulse-fill": e.pulse }]),
717
+ value: e.modelValue,
718
+ placeholder: e.placeholder,
719
+ onInput: n[0] ||= (...e) => v(h) && v(h)(...e),
720
+ onBlur: n[1] ||= (...e) => v(m) && v(m)(...e),
721
+ onKeydown: n[2] ||= p((...e) => v(m) && v(m)(...e), ["escape"])
722
+ }, null, 42, Rn), v(c) ? (a(), b(tn, {
723
+ key: 0,
724
+ disabled: v(l),
725
+ onInsert: v(x)
726
+ }, null, 8, ["disabled", "onInsert"])) : _("", !0)]));
727
+ }
728
+ }), [["__scopeId", "data-v-358207dd"]]), Bn = { class: "tpl:mb-3.5" }, Vn = ["value"], Hn = { value: "" }, Un = ["value"], Wn = { class: "tpl:mb-3.5" }, Gn = { class: "tpl:mb-3.5" }, Kn = {
729
+ key: 0,
730
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
731
+ }, qn = ["checked"], Jn = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, Yn = { class: "tpl:mb-3.5" }, Xn = { class: "tpl:mb-3.5" }, Zn = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, Qn = { class: "tpl:mb-3.5" }, $n = { class: "tpl:flex tpl:items-stretch" }, er = ["value"], tr = { class: "tpl:mb-3.5" }, nr = { class: "tpl:flex tpl:items-stretch" }, rr = ["value"], ir = /* @__PURE__ */ A({
732
+ __name: "ButtonToolbar",
733
+ props: {
734
+ block: {},
735
+ fontFamilies: {}
736
+ },
737
+ emits: ["update"],
738
+ setup(e, { emit: t }) {
739
+ let n = t, { t: r } = L();
740
+ function i(e, t) {
741
+ n("update", { [e]: t });
742
+ }
743
+ return (t, n) => (a(), g(O, null, [
744
+ w("div", Bn, [w("label", { class: C(v(G)) }, m(v(r).button.fontFamily), 3), w("select", {
745
+ class: C(v(W)),
746
+ value: e.block.fontFamily || "",
747
+ onChange: n[0] ||= (e) => i("fontFamily", e.target.value || void 0)
748
+ }, [w("option", Hn, m(v(r).button.inheritFont), 1), (a(!0), g(O, null, s(e.fontFamilies, (e) => (a(), g("option", {
749
+ key: e.value,
750
+ value: e.value
751
+ }, m(e.label), 9, Un))), 128))], 42, Vn)]),
752
+ w("div", Wn, [w("label", { class: C(v(G)) }, m(v(r).button.text), 3), j(Z, {
753
+ "model-value": e.block.text,
754
+ type: "text",
755
+ "onUpdate:modelValue": n[1] ||= (e) => i("text", e)
756
+ }, null, 8, ["model-value"])]),
757
+ w("div", Gn, [
758
+ w("label", { class: C(v(G)) }, m(v(r).button.url), 3),
759
+ j(Z, {
760
+ "model-value": e.block.url,
761
+ type: "url",
762
+ placeholder: v(r).button.urlPlaceholder,
763
+ "onUpdate:modelValue": n[2] ||= (e) => i("url", e)
764
+ }, null, 8, ["model-value", "placeholder"]),
765
+ e.block.url ? (a(), g("label", Kn, [w("input", {
766
+ type: "checkbox",
767
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
768
+ checked: e.block.openInNewTab ?? !1,
769
+ onChange: n[3] ||= (e) => i("openInNewTab", e.target.checked)
770
+ }, null, 40, qn), k(" " + m(v(r).button.openInNewTab), 1)])) : _("", !0)
771
+ ]),
772
+ w("div", Jn, [w("div", Yn, [w("label", { class: C(v(G)) }, m(v(r).button.background), 3), j(J, {
773
+ "model-value": e.block.backgroundColor,
774
+ "onUpdate:modelValue": n[4] ||= (e) => i("backgroundColor", e)
775
+ }, null, 8, ["model-value"])]), w("div", Xn, [w("label", { class: C(v(G)) }, m(v(r).button.textColor), 3), j(J, {
776
+ "model-value": e.block.textColor,
777
+ "onUpdate:modelValue": n[5] ||= (e) => i("textColor", e)
778
+ }, null, 8, ["model-value"])])]),
779
+ w("div", Zn, [w("div", Qn, [w("label", { class: C(v(G)) }, m(v(r).button.borderRadius), 3), w("div", $n, [w("input", {
780
+ type: "number",
781
+ class: C(v(q)),
782
+ value: e.block.borderRadius,
783
+ min: "0",
784
+ max: "50",
785
+ onInput: n[6] ||= (e) => i("borderRadius", Number(e.target.value))
786
+ }, null, 42, er), w("span", { class: C(v(K)) }, "px", 2)])]), w("div", tr, [w("label", { class: C(v(G)) }, m(v(r).button.fontSize), 3), w("div", nr, [w("input", {
787
+ type: "number",
788
+ class: C(v(q)),
789
+ value: e.block.fontSize,
790
+ min: "10",
791
+ max: "36",
792
+ onInput: n[7] ||= (e) => i("fontSize", Number(e.target.value))
793
+ }, null, 42, rr), w("span", { class: C(v(K)) }, "px", 2)])])])
794
+ ], 64));
795
+ }
796
+ }), ar = { class: "spacing-control" }, or = { class: "tpl:mb-2 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, sr = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5" }, cr = { class: "tpl:flex tpl:items-center" }, lr = ["aria-label"], ur = ["value", "aria-label"], dr = ["aria-label"], fr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, pr = { class: "tpl:flex tpl:items-center" }, mr = ["aria-label"], hr = ["value", "aria-label"], gr = ["aria-label"], _r = ["aria-label", "title"], vr = { class: "tpl:flex tpl:items-center" }, yr = ["aria-label"], br = ["value", "aria-label"], xr = ["aria-label"], Sr = { class: "tpl:flex tpl:items-center" }, Cr = ["aria-label"], wr = ["value", "aria-label"], Tr = ["aria-label"], Q = "tpl:flex tpl:items-center tpl:justify-center tpl:w-8 tpl:h-8 tpl:text-[var(--tpl-text-muted)] tpl:bg-[var(--tpl-bg)] tpl:border tpl:border-[var(--tpl-border)] tpl:cursor-pointer tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)] active:tpl:bg-[var(--tpl-bg-active)]", Er = "tpl:w-10 tpl:h-8 tpl:text-center tpl:text-xs tpl:font-medium tpl:border-y tpl:border-x-0 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]", Dr = /* @__PURE__ */ V(/* @__PURE__ */ A({
797
+ __name: "SpacingControl",
798
+ props: {
799
+ modelValue: {},
800
+ label: {}
801
+ },
802
+ emits: ["update:modelValue"],
803
+ setup(e, { emit: t }) {
804
+ let n = e, r = t, { t: i } = L(), o = h(() => n.modelValue.top === n.modelValue.right && n.modelValue.right === n.modelValue.bottom && n.modelValue.bottom === n.modelValue.left), s = d(o.value);
805
+ M(o, (e) => {
806
+ !e && s.value && (s.value = !1);
807
+ });
808
+ function c(e, t) {
809
+ let i = Math.max(0, n.modelValue[e] + t);
810
+ s.value ? r("update:modelValue", {
811
+ top: i,
812
+ right: i,
813
+ bottom: i,
814
+ left: i
815
+ }) : r("update:modelValue", {
816
+ ...n.modelValue,
817
+ [e]: i
818
+ });
819
+ }
820
+ function l(e, t) {
821
+ let i = Math.max(0, t);
822
+ s.value ? r("update:modelValue", {
823
+ top: i,
824
+ right: i,
825
+ bottom: i,
826
+ left: i
827
+ }) : r("update:modelValue", {
828
+ ...n.modelValue,
829
+ [e]: i
830
+ });
831
+ }
832
+ function u() {
833
+ if (s.value = !s.value, s.value) {
834
+ let e = n.modelValue.top;
835
+ r("update:modelValue", {
836
+ top: e,
837
+ right: e,
838
+ bottom: e,
839
+ left: e
840
+ });
841
+ }
842
+ }
843
+ return (t, n) => (a(), g("div", ar, [w("label", or, m(e.label), 1), w("div", sr, [
844
+ w("div", cr, [
845
+ w("button", {
846
+ "aria-label": v(i).spacingControl.decreaseTop,
847
+ class: C([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
848
+ onClick: n[0] ||= (e) => c("top", -1)
849
+ }, [j(v(U), {
850
+ size: 12,
851
+ "stroke-width": 2
852
+ })], 10, lr),
853
+ w("input", {
854
+ type: "number",
855
+ class: C(Er),
856
+ value: e.modelValue.top,
857
+ "aria-label": v(i).spacingControl.top,
858
+ min: "0",
859
+ onInput: n[1] ||= (e) => l("top", Number(e.target.value))
860
+ }, null, 40, ur),
861
+ w("button", {
862
+ "aria-label": v(i).spacingControl.increaseTop,
863
+ class: C([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
864
+ onClick: n[2] ||= (e) => c("top", 1)
865
+ }, [j(v(H), {
866
+ size: 12,
867
+ "stroke-width": 2
868
+ })], 10, dr)
869
+ ]),
870
+ w("div", fr, [
871
+ w("div", pr, [
872
+ w("button", {
873
+ "aria-label": v(i).spacingControl.decreaseLeft,
874
+ class: C([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
875
+ onClick: n[3] ||= (e) => c("left", -1)
876
+ }, [j(v(U), {
877
+ size: 12,
878
+ "stroke-width": 2
879
+ })], 10, mr),
880
+ w("input", {
881
+ type: "number",
882
+ class: C(Er),
883
+ value: e.modelValue.left,
884
+ "aria-label": v(i).spacingControl.left,
885
+ min: "0",
886
+ onInput: n[4] ||= (e) => l("left", Number(e.target.value))
887
+ }, null, 40, hr),
888
+ w("button", {
889
+ "aria-label": v(i).spacingControl.increaseLeft,
890
+ class: C([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
891
+ onClick: n[5] ||= (e) => c("left", 1)
892
+ }, [j(v(H), {
893
+ size: 12,
894
+ "stroke-width": 2
895
+ })], 10, gr)
896
+ ]),
897
+ w("button", {
898
+ class: C(["tpl:flex tpl:h-8 tpl:w-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", s.value ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] hover:tpl:bg-[var(--tpl-bg-hover)]"]),
899
+ "aria-label": s.value ? v(i).spacingControl.unlock : v(i).spacingControl.lockAll,
900
+ title: s.value ? v(i).spacingControl.unlock : v(i).spacingControl.lockAll,
901
+ onClick: u
902
+ }, [s.value ? (a(), b(v($e), {
903
+ key: 0,
904
+ size: 14,
905
+ "stroke-width": 2
906
+ })) : (a(), b(v(tt), {
907
+ key: 1,
908
+ size: 14,
909
+ "stroke-width": 2
910
+ }))], 10, _r),
911
+ w("div", vr, [
912
+ w("button", {
913
+ "aria-label": v(i).spacingControl.decreaseRight,
914
+ class: C([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
915
+ onClick: n[6] ||= (e) => c("right", -1)
916
+ }, [j(v(U), {
917
+ size: 12,
918
+ "stroke-width": 2
919
+ })], 10, yr),
920
+ w("input", {
921
+ type: "number",
922
+ class: C(Er),
923
+ value: e.modelValue.right,
924
+ "aria-label": v(i).spacingControl.right,
925
+ min: "0",
926
+ onInput: n[7] ||= (e) => l("right", Number(e.target.value))
927
+ }, null, 40, br),
928
+ w("button", {
929
+ "aria-label": v(i).spacingControl.increaseRight,
930
+ class: C([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
931
+ onClick: n[8] ||= (e) => c("right", 1)
932
+ }, [j(v(H), {
933
+ size: 12,
934
+ "stroke-width": 2
935
+ })], 10, xr)
936
+ ])
937
+ ]),
938
+ w("div", Sr, [
939
+ w("button", {
940
+ "aria-label": v(i).spacingControl.decreaseBottom,
941
+ class: C([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
942
+ onClick: n[9] ||= (e) => c("bottom", -1)
943
+ }, [j(v(U), {
944
+ size: 12,
945
+ "stroke-width": 2
946
+ })], 10, Cr),
947
+ w("input", {
948
+ type: "number",
949
+ class: C(Er),
950
+ value: e.modelValue.bottom,
951
+ "aria-label": v(i).spacingControl.bottom,
952
+ min: "0",
953
+ onInput: n[10] ||= (e) => l("bottom", Number(e.target.value))
954
+ }, null, 40, wr),
955
+ w("button", {
956
+ "aria-label": v(i).spacingControl.increaseBottom,
957
+ class: C([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
958
+ onClick: n[11] ||= (e) => c("bottom", 1)
959
+ }, [j(v(H), {
960
+ size: 12,
961
+ "stroke-width": 2
962
+ })], 10, Tr)
963
+ ])
964
+ ])]));
965
+ }
966
+ }), [["__scopeId", "data-v-9a9c8a07"]]), Or = { class: "tpl:mt-3" }, kr = /* @__PURE__ */ A({
967
+ __name: "CollapsibleSection",
968
+ props: {
969
+ title: {},
970
+ open: { type: Boolean },
971
+ noBorder: { type: Boolean }
972
+ },
973
+ emits: ["toggle"],
974
+ setup(t) {
975
+ return (r, i) => (a(), g("div", { class: C(["tpl:py-3", t.noBorder ? "" : "tpl:border-t tpl:border-[var(--tpl-border)]"]) }, [w("button", {
976
+ type: "button",
977
+ class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
978
+ onClick: i[0] ||= (e) => r.$emit("toggle")
979
+ }, [j(v(Ie), {
980
+ class: C(["tpl:transition-transform tpl:duration-200", t.open ? "tpl:rotate-0" : "tpl:-rotate-90"]),
981
+ size: 12,
982
+ "stroke-width": 2
983
+ }, null, 8, ["class"]), w("span", null, m(t.title), 1)]), n(w("div", Or, [e(r.$slots, "default")], 512), [[T, t.open]])], 2));
984
+ }
985
+ }), Ar = { class: "tpl:mt-4" }, jr = { class: "tpl:space-y-2" }, Mr = ["checked", "onChange"], Nr = ["value", "placeholder"], Pr = { class: "tpl:space-y-2" }, Fr = ["value"], Ir = { value: "" }, Lr = ["label"], Rr = ["value"], zr = ["value"], Br = {
986
+ key: 0,
987
+ value: "__custom__"
988
+ }, Vr = {
989
+ key: 0,
990
+ class: "tpl:space-y-2"
991
+ }, Hr = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Ur = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Wr = { class: "tpl:flex tpl:justify-end" }, Gr = ["disabled"], Kr = {
992
+ key: 0,
993
+ class: "tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]"
994
+ }, qr = { class: "tpl:space-y-1" }, Jr = { class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]" }, Yr = {
995
+ key: 0,
996
+ class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]"
997
+ }, Xr = /* @__PURE__ */ A({
998
+ __name: "CommonBlockSettings",
999
+ props: {
1000
+ block: {},
1001
+ isFirstSection: { type: Boolean }
1002
+ },
1003
+ emits: ["update"],
1004
+ setup(e, { emit: t }) {
1005
+ let r = e, o = t, { t: f } = L(), p = c(se, []), y = c(le, !1), x = u(/* @__PURE__ */ new Set()), T = d(!1), E = d(""), D = d(""), A = [
1006
+ {
1007
+ key: "desktop",
1008
+ icon: rt,
1009
+ labelKey: "showOnDesktop"
1010
+ },
1011
+ {
1012
+ key: "tablet",
1013
+ icon: dt,
1014
+ labelKey: "showOnTablet"
1015
+ },
1016
+ {
1017
+ key: "mobile",
1018
+ icon: mt,
1019
+ labelKey: "showOnMobile"
1020
+ }
1021
+ ];
1022
+ function N(e) {
1023
+ x.has(e) ? x.delete(e) : x.add(e);
1024
+ }
1025
+ let P = h(() => p.length > 0 || y), F = h(() => r.block.displayCondition ? !p.some((e) => e.label === r.block.displayCondition?.label) : !1);
1026
+ function ee() {
1027
+ T.value = !0, F.value && r.block.displayCondition ? (E.value = r.block.displayCondition.before, D.value = r.block.displayCondition.after ?? "") : (E.value = "", D.value = "");
1028
+ }
1029
+ function te() {
1030
+ E.value.trim() && (o("update", { displayCondition: {
1031
+ label: f.blockSettings.customCondition,
1032
+ before: E.value.trim(),
1033
+ after: D.value.trim()
1034
+ } }), T.value = !1, E.value = "", D.value = "");
1035
+ }
1036
+ M(() => r.block.displayCondition, (e) => {
1037
+ if (!e) {
1038
+ T.value = !1, E.value = "", D.value = "";
1039
+ return;
1040
+ }
1041
+ F.value && (E.value = e.before, D.value = e.after ?? "");
1042
+ }, { immediate: !0 });
1043
+ let I = h(() => {
1044
+ let e = {};
1045
+ for (let t of p) {
1046
+ let n = t.group ?? "";
1047
+ e[n] || (e[n] = []), e[n].push(t);
1048
+ }
1049
+ return e;
1050
+ });
1051
+ function R(e, t) {
1052
+ o("update", { styles: {
1053
+ ...r.block.styles,
1054
+ [e]: t
1055
+ } });
1056
+ }
1057
+ function z(e) {
1058
+ return r.block.visibility?.[e] !== !1;
1059
+ }
1060
+ function ne(e) {
1061
+ let t = {
1062
+ desktop: z("desktop"),
1063
+ tablet: z("tablet"),
1064
+ mobile: z("mobile")
1065
+ };
1066
+ t[e] = !t[e], o("update", { visibility: t });
1067
+ }
1068
+ return (t, r) => (a(), g("div", { class: C(["tpl:flex tpl:flex-col", e.isFirstSection ? "" : "tpl:mt-4"]) }, [
1069
+ j(kr, {
1070
+ title: v(f).blockSettings.spacing,
1071
+ open: x.has("spacing"),
1072
+ "no-border": e.isFirstSection,
1073
+ onToggle: r[2] ||= (e) => N("spacing")
1074
+ }, {
1075
+ default: l(() => [j(Dr, {
1076
+ label: v(f).blockSettings.padding,
1077
+ "model-value": e.block.styles.padding,
1078
+ "onUpdate:modelValue": r[0] ||= (e) => R("padding", e)
1079
+ }, null, 8, ["label", "model-value"]), w("div", Ar, [j(Dr, {
1080
+ label: v(f).blockSettings.margin,
1081
+ "model-value": e.block.styles.margin,
1082
+ "onUpdate:modelValue": r[1] ||= (e) => R("margin", e)
1083
+ }, null, 8, ["label", "model-value"])])]),
1084
+ _: 1
1085
+ }, 8, [
1086
+ "title",
1087
+ "open",
1088
+ "no-border"
1089
+ ]),
1090
+ j(kr, {
1091
+ title: v(f).blockSettings.background,
1092
+ open: x.has("bg"),
1093
+ onToggle: r[4] ||= (e) => N("bg")
1094
+ }, {
1095
+ default: l(() => [w("label", { class: C(v(G)) }, m(v(f).blockSettings.color), 3), j(J, {
1096
+ size: "large",
1097
+ "model-value": e.block.styles.backgroundColor || v("#ffffff"),
1098
+ "onUpdate:modelValue": r[3] ||= (e) => R("backgroundColor", e)
1099
+ }, null, 8, ["model-value"])]),
1100
+ _: 1
1101
+ }, 8, ["title", "open"]),
1102
+ j(kr, {
1103
+ title: v(f).blockSettings.display,
1104
+ open: x.has("display"),
1105
+ onToggle: r[5] ||= (e) => N("display")
1106
+ }, {
1107
+ default: l(() => [w("div", jr, [(a(), g(O, null, s(A, (e) => w("label", {
1108
+ key: e.key,
1109
+ class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]"
1110
+ }, [
1111
+ w("input", {
1112
+ type: "checkbox",
1113
+ class: "tpl:accent-[var(--tpl-primary)]",
1114
+ checked: z(e.key),
1115
+ onChange: (t) => ne(e.key)
1116
+ }, null, 40, Mr),
1117
+ (a(), b(i(e.icon), {
1118
+ size: 14,
1119
+ "stroke-width": 1.5
1120
+ })),
1121
+ k(" " + m(v(f).blockSettings[e.labelKey]), 1)
1122
+ ])), 64))])]),
1123
+ _: 1
1124
+ }, 8, ["title", "open"]),
1125
+ j(kr, {
1126
+ title: v(f).blockSettings.customCss,
1127
+ open: x.has("css"),
1128
+ onToggle: r[7] ||= (e) => N("css")
1129
+ }, {
1130
+ default: l(() => [w("label", { class: C(v(G)) }, m(v(f).blockSettings.css), 3), w("textarea", {
1131
+ value: e.block.customCss || "",
1132
+ placeholder: v(f).blockSettings.cssPlaceholder,
1133
+ rows: "3",
1134
+ class: C(v(St)),
1135
+ onInput: r[6] ||= (e) => o("update", { customCss: e.target.value })
1136
+ }, null, 42, Nr)]),
1137
+ _: 1
1138
+ }, 8, ["title", "open"]),
1139
+ P.value ? (a(), b(kr, {
1140
+ key: 0,
1141
+ title: v(f).blockSettings.displayCondition,
1142
+ open: x.has("condition"),
1143
+ onToggle: r[11] ||= (e) => N("condition")
1144
+ }, {
1145
+ default: l(() => [w("div", Pr, [w("select", {
1146
+ class: C(["tpl:w-full tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:outline-none tpl:transition-all tpl:duration-150 tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]", e.block.displayCondition ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-text)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"]),
1147
+ value: T.value || F.value ? "__custom__" : e.block.displayCondition?.label ?? "",
1148
+ onChange: r[8] ||= (e) => {
1149
+ let t = e.target.value;
1150
+ if (t === "__custom__") {
1151
+ ee();
1152
+ return;
1153
+ }
1154
+ if (T.value = !1, !t) {
1155
+ o("update", { displayCondition: void 0 });
1156
+ return;
1157
+ }
1158
+ let n = v(p).find((e) => e.label === t);
1159
+ n && o("update", { displayCondition: n });
1160
+ }
1161
+ }, [
1162
+ w("option", Ir, m(v(f).blockSettings.noCondition), 1),
1163
+ (a(!0), g(O, null, s(I.value, (e, t) => (a(), g(O, { key: t }, [t ? (a(), g("optgroup", {
1164
+ key: 0,
1165
+ label: String(t)
1166
+ }, [(a(!0), g(O, null, s(e, (e) => (a(), g("option", {
1167
+ key: e.label,
1168
+ value: e.label
1169
+ }, m(e.label), 9, Rr))), 128))], 8, Lr)) : (a(!0), g(O, { key: 1 }, s(e, (e) => (a(), g("option", {
1170
+ key: e.label,
1171
+ value: e.label
1172
+ }, m(e.label), 9, zr))), 128))], 64))), 128)),
1173
+ v(y) ? (a(), g("option", Br, m(v(f).blockSettings.customCondition), 1)) : _("", !0)
1174
+ ], 42, Fr), T.value || F.value ? (a(), g("div", Vr, [
1175
+ w("div", null, [w("label", Hr, m(v(f).blockSettings.customConditionBefore), 1), n(w("textarea", {
1176
+ "onUpdate:modelValue": r[9] ||= (e) => E.value = e,
1177
+ rows: "2",
1178
+ class: C(v(St))
1179
+ }, null, 2), [[S, E.value]])]),
1180
+ w("div", null, [w("label", Ur, m(v(f).blockSettings.customConditionAfter), 1), n(w("textarea", {
1181
+ "onUpdate:modelValue": r[10] ||= (e) => D.value = e,
1182
+ rows: "2",
1183
+ class: C(v(St))
1184
+ }, null, 2), [[S, D.value]])]),
1185
+ w("div", Wr, [w("button", {
1186
+ type: "button",
1187
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:opacity-50",
1188
+ disabled: !E.value.trim(),
1189
+ onClick: te
1190
+ }, m(v(f).blockSettings.applyCondition), 9, Gr)])
1191
+ ])) : e.block.displayCondition && !F.value ? (a(), g(O, { key: 1 }, [e.block.displayCondition.description ? (a(), g("p", Kr, m(e.block.displayCondition.description), 1)) : _("", !0), w("div", qr, [w("pre", Jr, m(e.block.displayCondition.before), 1), e.block.displayCondition.after ? (a(), g("pre", Yr, m(e.block.displayCondition.after), 1)) : _("", !0)])], 64)) : _("", !0)])]),
1192
+ _: 1
1193
+ }, 8, ["title", "open"])) : _("", !0)
1194
+ ], 2));
1195
+ }
1196
+ }), Zr = ["title"], Qr = { class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, $r = {
1197
+ key: 1,
1198
+ class: "tpl:text-[var(--tpl-danger)]"
1199
+ }, ei = [
1200
+ "aria-checked",
1201
+ "aria-label",
1202
+ "disabled"
1203
+ ], ti = /* @__PURE__ */ A({
1204
+ __name: "BooleanField",
1205
+ props: {
1206
+ field: {},
1207
+ modelValue: { type: Boolean },
1208
+ readOnly: { type: Boolean }
1209
+ },
1210
+ emits: ["update:modelValue"],
1211
+ setup(e, { emit: t }) {
1212
+ let n = t, { t: r } = L();
1213
+ return (t, i) => (a(), g("div", {
1214
+ class: "tpl:mb-3.5",
1215
+ title: e.readOnly ? v(r).customBlocks.dataSource.readOnlyTooltip : void 0
1216
+ }, [w("label", { class: C(["tpl:flex tpl:items-center tpl:justify-between tpl:gap-2", e.readOnly ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer"]) }, [w("span", Qr, [
1217
+ k(m(e.field.label) + " ", 1),
1218
+ e.readOnly ? (a(), b(v($e), {
1219
+ key: 0,
1220
+ size: 12,
1221
+ class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
1222
+ })) : _("", !0),
1223
+ e.field.required ? (a(), g("span", $r, " * ")) : _("", !0)
1224
+ ]), w("button", {
1225
+ type: "button",
1226
+ role: "switch",
1227
+ "aria-checked": e.modelValue,
1228
+ "aria-label": e.field.label,
1229
+ class: C([
1230
+ "tpl:relative tpl:inline-flex tpl:h-5 tpl:w-9 tpl:shrink-0 tpl:rounded-full tpl:border-2 tpl:border-transparent tpl:transition-colors tpl:duration-200",
1231
+ e.modelValue ? "tpl:bg-[var(--tpl-primary)]" : "tpl:bg-[var(--tpl-border)]",
1232
+ e.readOnly ? "tpl:opacity-60 tpl:cursor-not-allowed" : "tpl:cursor-pointer"
1233
+ ]),
1234
+ disabled: e.readOnly,
1235
+ onClick: i[0] ||= (t) => !e.readOnly && n("update:modelValue", !e.modelValue)
1236
+ }, [w("span", { class: C(["tpl:pointer-events-none tpl:inline-block tpl:size-4 tpl:rounded-full tpl:bg-[var(--tpl-bg)] tpl:shadow tpl:transition-transform tpl:duration-200", e.modelValue ? "tpl:translate-x-4" : "tpl:translate-x-0"]) }, null, 2)], 10, ei)], 2)], 8, Zr));
1237
+ }
1238
+ }), ni = { class: "tpl:mb-3.5" }, ri = {
1239
+ key: 1,
1240
+ class: "tpl:text-[var(--tpl-danger)]"
1241
+ }, $ = /* @__PURE__ */ A({
1242
+ __name: "FieldWrapper",
1243
+ props: {
1244
+ label: {},
1245
+ required: { type: Boolean },
1246
+ readOnly: { type: Boolean }
1247
+ },
1248
+ setup(t) {
1249
+ return (n, r) => (a(), g("div", ni, [w("label", { class: C(v(G)) }, [
1250
+ k(m(t.label) + " ", 1),
1251
+ t.readOnly ? (a(), b(v($e), {
1252
+ key: 0,
1253
+ size: 12,
1254
+ class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
1255
+ })) : _("", !0),
1256
+ t.required ? (a(), g("span", ri, "*")) : _("", !0)
1257
+ ], 2), e(n.$slots, "default")]));
1258
+ }
1259
+ }), ii = /* @__PURE__ */ A({
1260
+ __name: "ColorField",
1261
+ props: {
1262
+ field: {},
1263
+ modelValue: {},
1264
+ readOnly: { type: Boolean }
1265
+ },
1266
+ emits: ["update:modelValue"],
1267
+ setup(e, { emit: t }) {
1268
+ let n = t, { t: r } = L();
1269
+ return (t, i) => (a(), b($, {
1270
+ label: e.field.label,
1271
+ required: e.field.required,
1272
+ "read-only": e.readOnly
1273
+ }, {
1274
+ default: l(() => [j(J, {
1275
+ "model-value": e.modelValue || v("#000000"),
1276
+ placeholder: e.field.placeholder || v("#000000"),
1277
+ disabled: e.readOnly,
1278
+ title: e.readOnly ? v(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1279
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
1280
+ }, null, 8, [
1281
+ "model-value",
1282
+ "placeholder",
1283
+ "disabled",
1284
+ "title"
1285
+ ])]),
1286
+ _: 1
1287
+ }, 8, [
1288
+ "label",
1289
+ "required",
1290
+ "read-only"
1291
+ ]));
1292
+ }
1293
+ }), ai = [
1294
+ "value",
1295
+ "placeholder",
1296
+ "title"
1297
+ ], oi = ["value", "placeholder"], si = /* @__PURE__ */ A({
1298
+ __name: "ImageField",
1299
+ props: {
1300
+ field: {},
1301
+ modelValue: {},
1302
+ readOnly: { type: Boolean }
1303
+ },
1304
+ emits: ["update:modelValue"],
1305
+ setup(e, { emit: t }) {
1306
+ let n = t, { t: r } = L(), i = c(Ce, null), o = R(), s = h(() => !!i);
1307
+ async function u() {
1308
+ let e = await i?.({ accept: ["images"] });
1309
+ o.alive && e && n("update:modelValue", e.url);
1310
+ }
1311
+ return (t, i) => (a(), b($, {
1312
+ label: e.field.label,
1313
+ required: e.field.required,
1314
+ "read-only": e.readOnly
1315
+ }, {
1316
+ default: l(() => [e.readOnly ? (a(), g("input", {
1317
+ key: 0,
1318
+ type: "url",
1319
+ class: C([v(W), "tpl:opacity-60 tpl:cursor-not-allowed"]),
1320
+ value: e.modelValue,
1321
+ placeholder: e.field.placeholder || "https://...",
1322
+ disabled: "",
1323
+ title: v(r).customBlocks.dataSource.readOnlyTooltip
1324
+ }, null, 10, ai)) : (a(), g("input", {
1325
+ key: 1,
1326
+ type: "url",
1327
+ class: C(v(W)),
1328
+ value: e.modelValue,
1329
+ placeholder: e.field.placeholder || "https://...",
1330
+ onInput: i[0] ||= (e) => n("update:modelValue", e.target.value)
1331
+ }, null, 42, oi)), s.value && !e.readOnly ? (a(), g("button", {
1332
+ key: 2,
1333
+ class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
1334
+ onClick: i[1] ||= (e) => u()
1335
+ }, [j(v(De), {
1336
+ size: 14,
1337
+ "stroke-width": 1.5
1338
+ }), k(" " + m(v(r).image.browseMedia), 1)])) : _("", !0)]),
1339
+ _: 1
1340
+ }, 8, [
1341
+ "label",
1342
+ "required",
1343
+ "read-only"
1344
+ ]));
1345
+ }
1346
+ }), ci = [
1347
+ "value",
1348
+ "placeholder",
1349
+ "min",
1350
+ "max",
1351
+ "step",
1352
+ "disabled",
1353
+ "title"
1354
+ ], li = /* @__PURE__ */ A({
1355
+ __name: "NumberField",
1356
+ props: {
1357
+ field: {},
1358
+ modelValue: {},
1359
+ readOnly: { type: Boolean }
1360
+ },
1361
+ emits: ["update:modelValue"],
1362
+ setup(e, { emit: t }) {
1363
+ let n = t, { t: r } = L();
1364
+ return (t, i) => (a(), b($, {
1365
+ label: e.field.label,
1366
+ required: e.field.required,
1367
+ "read-only": e.readOnly
1368
+ }, {
1369
+ default: l(() => [w("input", {
1370
+ type: "number",
1371
+ class: C([v(W), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
1372
+ value: e.modelValue,
1373
+ placeholder: e.field.placeholder,
1374
+ min: e.field.min,
1375
+ max: e.field.max,
1376
+ step: e.field.step,
1377
+ disabled: e.readOnly,
1378
+ title: e.readOnly ? v(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1379
+ onInput: i[0] ||= (t) => !e.readOnly && n("update:modelValue", Number(t.target.value))
1380
+ }, null, 42, ci)]),
1381
+ _: 1
1382
+ }, 8, [
1383
+ "label",
1384
+ "required",
1385
+ "read-only"
1386
+ ]));
1387
+ }
1388
+ }), ui = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, di = { class: "tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between" }, fi = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]" }, pi = ["title", "onClick"], mi = {
1389
+ key: 1,
1390
+ class: "tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
1391
+ }, hi = /* @__PURE__ */ A({
1392
+ __name: "RepeatableField",
1393
+ props: {
1394
+ field: {},
1395
+ modelValue: {},
1396
+ readOnly: { type: Boolean }
1397
+ },
1398
+ emits: ["update:modelValue"],
1399
+ setup(e, { emit: t }) {
1400
+ let n = e, r = t, { t: o } = L(), c = h(() => n.modelValue || []), u = h(() => !n.field.maxItems || c.value.length < n.field.maxItems), d = h(() => !n.field.minItems || c.value.length > n.field.minItems);
1401
+ function f() {
1402
+ if (!u.value || n.readOnly) return;
1403
+ let e = {};
1404
+ for (let t of n.field.fields) e[t.key] = t.default ?? "";
1405
+ r("update:modelValue", [...c.value, e]);
1406
+ }
1407
+ function p(e) {
1408
+ if (!d.value || n.readOnly) return;
1409
+ let t = [...c.value];
1410
+ t.splice(e, 1), r("update:modelValue", t);
1411
+ }
1412
+ function y(e, t, n) {
1413
+ r("update:modelValue", c.value.map((r, i) => i === e ? {
1414
+ ...r,
1415
+ [t]: n
1416
+ } : r));
1417
+ }
1418
+ return (t, n) => (a(), b($, {
1419
+ label: e.field.label,
1420
+ required: e.field.required,
1421
+ "read-only": e.readOnly
1422
+ }, {
1423
+ default: l(() => [w("div", ui, [
1424
+ (a(!0), g(O, null, s(c.value, (t, n) => (a(), g("div", {
1425
+ key: `${e.field.key}-${n}`,
1426
+ class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3"
1427
+ }, [w("div", di, [w("span", fi, " #" + m(n + 1), 1), d.value && !e.readOnly ? (a(), g("button", {
1428
+ key: 0,
1429
+ type: "button",
1430
+ class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
1431
+ title: v(o).customBlocks.fields.removeItem,
1432
+ onClick: (e) => p(n)
1433
+ }, [j(v(Oe), {
1434
+ size: 12,
1435
+ "stroke-width": 2
1436
+ })], 8, pi)) : _("", !0)]), (a(!0), g(O, null, s(e.field.fields, (r) => (a(), b(i(v(wi)(r.type)), {
1437
+ key: r.key,
1438
+ field: r,
1439
+ "model-value": t[r.key],
1440
+ "read-only": e.readOnly,
1441
+ "onUpdate:modelValue": (e) => y(n, r.key, e)
1442
+ }, null, 8, [
1443
+ "field",
1444
+ "model-value",
1445
+ "read-only",
1446
+ "onUpdate:modelValue"
1447
+ ]))), 128))]))), 128)),
1448
+ u.value && !e.readOnly ? (a(), g("button", {
1449
+ key: 0,
1450
+ type: "button",
1451
+ class: C(v(xt)),
1452
+ onClick: f
1453
+ }, [j(v(H), {
1454
+ size: 14,
1455
+ "stroke-width": 2
1456
+ }), k(" " + m(v(o).customBlocks.fields.addItem), 1)], 2)) : _("", !0),
1457
+ !u.value && !e.readOnly ? (a(), g("p", mi, m(v(o).customBlocks.fields.maxItemsReached), 1)) : _("", !0)
1458
+ ])]),
1459
+ _: 1
1460
+ }, 8, [
1461
+ "label",
1462
+ "required",
1463
+ "read-only"
1464
+ ]));
1465
+ }
1466
+ }), gi = [
1467
+ "value",
1468
+ "disabled",
1469
+ "title"
1470
+ ], _i = ["value"], vi = /* @__PURE__ */ A({
1471
+ __name: "SelectField",
1472
+ props: {
1473
+ field: {},
1474
+ modelValue: {},
1475
+ readOnly: { type: Boolean }
1476
+ },
1477
+ emits: ["update:modelValue"],
1478
+ setup(e, { emit: t }) {
1479
+ let n = t, { t: r } = L();
1480
+ return (t, i) => (a(), b($, {
1481
+ label: e.field.label,
1482
+ required: e.field.required,
1483
+ "read-only": e.readOnly
1484
+ }, {
1485
+ default: l(() => [w("select", {
1486
+ class: C([v(W), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
1487
+ value: e.modelValue,
1488
+ disabled: e.readOnly,
1489
+ title: e.readOnly ? v(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1490
+ onChange: i[0] ||= (t) => !e.readOnly && n("update:modelValue", t.target.value)
1491
+ }, [(a(!0), g(O, null, s(e.field.options, (e) => (a(), g("option", {
1492
+ key: e.value,
1493
+ value: e.value
1494
+ }, m(e.label), 9, _i))), 128))], 42, gi)]),
1495
+ _: 1
1496
+ }, 8, [
1497
+ "label",
1498
+ "required",
1499
+ "read-only"
1500
+ ]));
1501
+ }
1502
+ }), yi = [
1503
+ "value",
1504
+ "placeholder",
1505
+ "title"
1506
+ ], bi = /* @__PURE__ */ A({
1507
+ __name: "TextField",
1508
+ props: {
1509
+ field: {},
1510
+ modelValue: {},
1511
+ readOnly: { type: Boolean }
1512
+ },
1513
+ emits: ["update:modelValue"],
1514
+ setup(e, { emit: t }) {
1515
+ let n = t, { t: r } = L();
1516
+ return (t, i) => (a(), b($, {
1517
+ label: e.field.label,
1518
+ required: e.field.required,
1519
+ "read-only": e.readOnly
1520
+ }, {
1521
+ default: l(() => [e.readOnly ? (a(), g("input", {
1522
+ key: 0,
1523
+ type: "text",
1524
+ class: C([v(W), "tpl:opacity-60 tpl:cursor-not-allowed"]),
1525
+ value: e.modelValue,
1526
+ placeholder: e.field.placeholder,
1527
+ disabled: "",
1528
+ title: v(r).customBlocks.dataSource.readOnlyTooltip
1529
+ }, null, 10, yi)) : (a(), b(Z, {
1530
+ key: 1,
1531
+ "model-value": e.modelValue,
1532
+ placeholder: e.field.placeholder,
1533
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
1534
+ }, null, 8, ["model-value", "placeholder"]))]),
1535
+ _: 1
1536
+ }, 8, [
1537
+ "label",
1538
+ "required",
1539
+ "read-only"
1540
+ ]));
1541
+ }
1542
+ }), xi = [
1543
+ "value",
1544
+ "placeholder",
1545
+ "title"
1546
+ ], Si = "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:opacity-60 tpl:cursor-not-allowed", Ci = {
1547
+ text: bi,
1548
+ textarea: /* @__PURE__ */ A({
1549
+ __name: "TextareaField",
1550
+ props: {
1551
+ field: {},
1552
+ modelValue: {},
1553
+ readOnly: { type: Boolean }
1554
+ },
1555
+ emits: ["update:modelValue"],
1556
+ setup(e, { emit: t }) {
1557
+ let n = t, { t: r } = L();
1558
+ return (t, i) => (a(), b($, {
1559
+ label: e.field.label,
1560
+ required: e.field.required,
1561
+ "read-only": e.readOnly
1562
+ }, {
1563
+ default: l(() => [e.readOnly ? (a(), g("textarea", {
1564
+ key: 0,
1565
+ value: e.modelValue,
1566
+ placeholder: e.field.placeholder,
1567
+ rows: "3",
1568
+ disabled: "",
1569
+ title: v(r).customBlocks.dataSource.readOnlyTooltip,
1570
+ class: C(Si)
1571
+ }, null, 8, xi)) : (a(), b(cn, {
1572
+ key: 1,
1573
+ "model-value": e.modelValue,
1574
+ placeholder: e.field.placeholder,
1575
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
1576
+ }, null, 8, ["model-value", "placeholder"]))]),
1577
+ _: 1
1578
+ }, 8, [
1579
+ "label",
1580
+ "required",
1581
+ "read-only"
1582
+ ]));
1583
+ }
1584
+ }),
1585
+ image: si,
1586
+ color: ii,
1587
+ number: li,
1588
+ select: vi,
1589
+ boolean: ti,
1590
+ repeatable: hi
1591
+ };
1592
+ function wi(e) {
1593
+ return Ci[e] ?? bi;
1594
+ }
1595
+ //#endregion
1596
+ //#region src/components/toolbar/CustomBlockToolbar.vue?vue&type=script&setup=true&lang.ts
1597
+ var Ti = {
1598
+ key: 0,
1599
+ class: "tpl:p-4"
1600
+ }, Ei = { class: "tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Di = { key: 1 }, Oi = {
1601
+ key: 0,
1602
+ class: "tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
1603
+ }, ki = {
1604
+ key: 1,
1605
+ class: "tpl:mb-4"
1606
+ }, Ai = {
1607
+ key: 1,
1608
+ class: "tpl:flex tpl:h-[32px] tpl:items-center"
1609
+ }, ji = {
1610
+ key: 0,
1611
+ class: "tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
1612
+ }, Mi = {
1613
+ key: 2,
1614
+ class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]"
1615
+ }, Ni = /* @__PURE__ */ A({
1616
+ __name: "CustomBlockToolbar",
1617
+ props: { block: {} },
1618
+ emits: ["updateFieldValues", "updateDataSourceFetched"],
1619
+ setup(e, { emit: t }) {
1620
+ let n = e, r = t, { t: o } = L(), l = c(z, []), u = h(() => l.find((e) => e.type === n.block.customType)), { isFetching: d, fetchError: f, fetch: p, hasDataSource: y, needsFetch: x } = je({
1621
+ definition: u,
1622
+ block: h(() => n.block),
1623
+ onUpdate: (e, t) => {
1624
+ r("updateFieldValues", e), r("updateDataSourceFetched", t);
1625
+ }
1626
+ });
1627
+ function S(e) {
1628
+ return e.readOnly === !0 && y.value && !!n.block.dataSourceFetched;
1629
+ }
1630
+ function C(e, t) {
1631
+ r("updateFieldValues", {
1632
+ ...n.block.fieldValues,
1633
+ [e]: t
1634
+ });
1635
+ }
1636
+ return (t, n) => u.value ? (a(), g("div", Di, [
1637
+ u.value.description ? (a(), g("p", Oi, m(u.value.description), 1)) : _("", !0),
1638
+ v(y) ? (a(), g("div", ki, [v(x) && !v(d) ? (a(), g("button", {
1639
+ key: 0,
1640
+ type: "button",
1641
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-md tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:bg-[var(--tpl-primary)]",
1642
+ onClick: n[0] ||= (...e) => v(p) && v(p)(...e)
1643
+ }, m(u.value?.dataSource?.label || v(o).customBlocks.dataSource.fetchButton), 1)) : (a(), g("div", Ai, [v(d) ? (a(), g("div", ji, m(v(o).customBlocks.dataSource.fetching), 1)) : (a(), g("button", {
1644
+ key: 1,
1645
+ type: "button",
1646
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",
1647
+ onClick: n[1] ||= (...e) => v(p) && v(p)(...e)
1648
+ }, [j(v(Re), { size: 12 }), k(" " + m(v(o).customBlocks.dataSource.changeButton), 1)]))])), v(f) ? (a(), g("p", Mi, [j(v(te), {
1649
+ size: 14,
1650
+ class: "tpl:shrink-0"
1651
+ }), k(" " + m(v(o).customBlocks.dataSource.fetchError), 1)])) : _("", !0)])) : _("", !0),
1652
+ (a(!0), g(O, null, s(u.value.fields, (t) => (a(), b(i(v(wi)(t.type)), {
1653
+ key: t.key,
1654
+ field: t,
1655
+ "model-value": e.block.fieldValues[t.key],
1656
+ "read-only": S(t),
1657
+ "onUpdate:modelValue": (e) => C(t.key, e)
1658
+ }, null, 8, [
1659
+ "field",
1660
+ "model-value",
1661
+ "read-only",
1662
+ "onUpdate:modelValue"
1663
+ ]))), 128))
1664
+ ])) : (a(), g("div", Ti, [w("p", Ei, m(v(o).customBlocks.toolbar.noDefinition), 1)]));
1665
+ }
1666
+ }), Pi = { class: "tpl:mb-3.5" }, Fi = { class: "tpl:mb-3.5" }, Ii = { class: "tpl:mb-3.5" }, Li = { class: "tpl:flex tpl:items-stretch" }, Ri = ["value"], zi = /* @__PURE__ */ A({
1667
+ __name: "DividerToolbar",
1668
+ props: { block: {} },
1669
+ emits: ["update"],
1670
+ setup(e, { emit: t }) {
1671
+ let n = t, { t: r } = L();
1672
+ function i(e, t) {
1673
+ n("update", { [e]: t });
1674
+ }
1675
+ return (t, n) => (a(), g(O, null, [
1676
+ w("div", Pi, [w("label", { class: C(v(G)) }, m(v(r).divider.style), 3), j(X, {
1677
+ options: [
1678
+ {
1679
+ value: "solid",
1680
+ label: v(r).divider.solid
1681
+ },
1682
+ {
1683
+ value: "dashed",
1684
+ label: v(r).divider.dashed
1685
+ },
1686
+ {
1687
+ value: "dotted",
1688
+ label: v(r).divider.dotted
1689
+ }
1690
+ ],
1691
+ "model-value": e.block.lineStyle,
1692
+ "onUpdate:modelValue": n[0] ||= (e) => i("lineStyle", e)
1693
+ }, null, 8, ["options", "model-value"])]),
1694
+ w("div", Fi, [w("label", { class: C(v(G)) }, m(v(r).divider.color), 3), j(J, {
1695
+ "model-value": e.block.color,
1696
+ "onUpdate:modelValue": n[1] ||= (e) => i("color", e)
1697
+ }, null, 8, ["model-value"])]),
1698
+ w("div", Ii, [w("label", { class: C(v(G)) }, m(v(r).divider.thickness), 3), w("div", Li, [w("input", {
1699
+ type: "number",
1700
+ class: C(v(q)),
1701
+ value: e.block.thickness,
1702
+ min: "1",
1703
+ max: "10",
1704
+ onInput: n[2] ||= (e) => i("thickness", Number(e.target.value))
1705
+ }, null, 42, Ri), w("span", { class: C(v(K)) }, "px", 2)])])
1706
+ ], 64));
1707
+ }
1708
+ }), Bi = { class: "tpl:mb-3.5" }, Vi = ["value"], Hi = { class: "tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, Ui = /* @__PURE__ */ A({
1709
+ __name: "HtmlToolbar",
1710
+ props: { block: {} },
1711
+ emits: ["update"],
1712
+ setup(e, { emit: t }) {
1713
+ let n = t, { t: r } = L();
1714
+ return (t, i) => (a(), g("div", Bi, [
1715
+ w("label", { class: C(v(G)) }, m(v(r).html.content), 3),
1716
+ w("textarea", {
1717
+ value: e.block.content,
1718
+ placeholder: "<div>...</div>",
1719
+ rows: "10",
1720
+ class: C(v(St)),
1721
+ onInput: i[0] ||= (e) => n("update", { content: e.target.value })
1722
+ }, null, 42, Vi),
1723
+ w("p", Hi, [j(v(Je), {
1724
+ size: 12,
1725
+ class: "tpl:mt-0.5 tpl:shrink-0"
1726
+ }), k(" " + m(v(r).html.sanitizationHint), 1)])
1727
+ ]));
1728
+ }
1729
+ }), Wi = { class: "tpl:mb-3.5" }, Gi = {
1730
+ key: 0,
1731
+ class: "tpl:mb-3.5"
1732
+ }, Ki = ["value", "placeholder"], qi = { class: "tpl:mb-3.5" }, Ji = { class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]" }, Yi = ["checked"], Xi = { class: "tpl:block tpl:text-[var(--tpl-text-dim)]" }, Zi = { class: "tpl:mb-3.5" }, Qi = ["value"], $i = { value: "full" }, ea = { class: "tpl:mb-3.5" }, ta = { class: "tpl:mb-3.5" }, na = {
1733
+ key: 0,
1734
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
1735
+ }, ra = ["checked"], ia = /* @__PURE__ */ A({
1736
+ __name: "ImageToolbar",
1737
+ props: { block: {} },
1738
+ emits: ["update"],
1739
+ setup(e, { emit: t }) {
1740
+ let n = t, { t: r } = L(), i = c(Ce, null), o = c(we, Le.liquid), s = R(), l = h(() => !!i), u = d(!1), f = d(!1), { start: p } = ke(() => {
1741
+ u.value = !1;
1742
+ }, 1e3, { immediate: !1 });
1743
+ function y(e, t) {
1744
+ n("update", { [e]: t });
1745
+ }
1746
+ async function b() {
1747
+ let e = await i?.({ accept: ["images"] });
1748
+ s.alive && e && (y("src", e.url), e.alt && (y("alt", e.alt), f.value = !0), u.value = !0, p());
1749
+ }
1750
+ return (t, n) => (a(), g(O, null, [
1751
+ w("div", Wi, [
1752
+ w("label", { class: C(v(G)) }, m(v(r).image.imageUrl), 3),
1753
+ j(Z, {
1754
+ "model-value": e.block.src,
1755
+ type: "url",
1756
+ placeholder: v(r).image.imageUrlPlaceholder,
1757
+ pulse: u.value,
1758
+ "onUpdate:modelValue": n[0] ||= (e) => y("src", e)
1759
+ }, null, 8, [
1760
+ "model-value",
1761
+ "placeholder",
1762
+ "pulse"
1763
+ ]),
1764
+ l.value ? (a(), g("button", {
1765
+ key: 0,
1766
+ class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
1767
+ style: {
1768
+ "border-color": "var(--tpl-border)",
1769
+ color: "var(--tpl-primary)",
1770
+ "background-color": "var(--tpl-bg)"
1771
+ },
1772
+ onClick: b
1773
+ }, [j(v(De), {
1774
+ size: 14,
1775
+ "stroke-width": 1.5
1776
+ }), k(" " + m(v(r).image.browseMedia), 1)])) : _("", !0)
1777
+ ]),
1778
+ v(Ne)(e.block.src, v(o)) ? (a(), g("div", Gi, [w("label", { class: C(v(G)) }, [k(m(v(r).image.placeholderUrl) + " ", 1), n[8] ||= w("span", { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, m("(optional)"), -1)], 2), w("input", {
1779
+ type: "url",
1780
+ class: C(v(W)),
1781
+ value: e.block.placeholderUrl || "",
1782
+ placeholder: v(r).image.placeholderUrlPlaceholder,
1783
+ onInput: n[1] ||= (e) => y("placeholderUrl", e.target.value)
1784
+ }, null, 42, Ki)])) : _("", !0),
1785
+ w("div", qi, [
1786
+ w("label", { class: C(v(G)) }, m(v(r).image.altText), 3),
1787
+ j(Z, {
1788
+ "model-value": e.block.alt,
1789
+ type: "text",
1790
+ placeholder: v(r).image.altTextPlaceholder,
1791
+ pulse: f.value,
1792
+ disabled: e.block.decorative === !0,
1793
+ "onUpdate:modelValue": n[2] ||= (e) => y("alt", e)
1794
+ }, null, 8, [
1795
+ "model-value",
1796
+ "placeholder",
1797
+ "pulse",
1798
+ "disabled"
1799
+ ]),
1800
+ w("label", Ji, [w("input", {
1801
+ type: "checkbox",
1802
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1803
+ checked: e.block.decorative === !0,
1804
+ onChange: n[3] ||= (e) => y("decorative", e.target.checked)
1805
+ }, null, 40, Yi), w("span", null, [k(m(v(r).image.decorative) + " ", 1), w("span", Xi, m(v(r).image.decorativeHint), 1)])])
1806
+ ]),
1807
+ w("div", Zi, [w("label", { class: C(v(G)) }, m(v(r).image.width), 3), w("select", {
1808
+ class: C(v(W)),
1809
+ value: e.block.width,
1810
+ onChange: n[4] ||= (e) => y("width", e.target.value === "full" ? "full" : Number(e.target.value))
1811
+ }, [
1812
+ w("option", $i, m(v(r).image.fullWidth), 1),
1813
+ n[9] ||= w("option", { value: "300" }, "300px", -1),
1814
+ n[10] ||= w("option", { value: "400" }, "400px", -1),
1815
+ n[11] ||= w("option", { value: "500" }, "500px", -1)
1816
+ ], 42, Qi)]),
1817
+ w("div", ea, [w("label", { class: C(v(G)) }, m(v(r).title.align), 3), j(X, {
1818
+ options: [
1819
+ {
1820
+ value: "left",
1821
+ label: v(r).title.alignLeft
1822
+ },
1823
+ {
1824
+ value: "center",
1825
+ label: v(r).title.alignCenter
1826
+ },
1827
+ {
1828
+ value: "right",
1829
+ label: v(r).title.alignRight
1830
+ }
1831
+ ],
1832
+ "model-value": e.block.align,
1833
+ "onUpdate:modelValue": n[5] ||= (e) => y("align", e)
1834
+ }, null, 8, ["options", "model-value"])]),
1835
+ w("div", ta, [
1836
+ w("label", { class: C(v(G)) }, m(v(r).image.linkUrl), 3),
1837
+ j(Z, {
1838
+ "model-value": e.block.linkUrl || "",
1839
+ type: "url",
1840
+ placeholder: v(r).image.imageUrlPlaceholder,
1841
+ "onUpdate:modelValue": n[6] ||= (e) => y("linkUrl", e)
1842
+ }, null, 8, ["model-value", "placeholder"]),
1843
+ e.block.linkUrl ? (a(), g("label", na, [w("input", {
1844
+ type: "checkbox",
1845
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1846
+ checked: e.block.linkOpenInNewTab ?? !1,
1847
+ onChange: n[7] ||= (e) => y("linkOpenInNewTab", e.target.checked)
1848
+ }, null, 40, ra), k(" " + m(v(r).image.openInNewTab), 1)])) : _("", !0)
1849
+ ])
1850
+ ], 64));
1851
+ }
1852
+ }), aa = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, oa = { class: "tpl:flex tpl:items-center tpl:gap-2" }, sa = [
1853
+ "value",
1854
+ "placeholder",
1855
+ "onInput"
1856
+ ], ca = ["title", "onClick"], la = { class: "tpl:flex tpl:items-center tpl:gap-3 tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, ua = ["checked", "onChange"], da = { class: "tpl:flex tpl:items-center tpl:gap-2" }, fa = ["value"], pa = { value: "" }, ma = ["value"], ha = ["value"], ga = /* @__PURE__ */ A({
1857
+ __name: "MenuToolbar",
1858
+ props: {
1859
+ block: {},
1860
+ fontFamilies: {}
1861
+ },
1862
+ emits: ["update"],
1863
+ setup(e, { emit: t }) {
1864
+ let n = e, r = t, { t: i } = L(), o = h(() => [
1865
+ {
1866
+ key: "openInNewTab",
1867
+ label: i.menu.openInNewTab
1868
+ },
1869
+ {
1870
+ key: "bold",
1871
+ label: i.menu.bold
1872
+ },
1873
+ {
1874
+ key: "underline",
1875
+ label: i.menu.underline
1876
+ }
1877
+ ]), c = h(() => [
1878
+ {
1879
+ value: "left",
1880
+ label: i.title.alignLeft,
1881
+ icon: ft
1882
+ },
1883
+ {
1884
+ value: "center",
1885
+ label: i.title.alignCenter,
1886
+ icon: at
1887
+ },
1888
+ {
1889
+ value: "right",
1890
+ label: i.title.alignRight,
1891
+ icon: pt
1892
+ }
1893
+ ]);
1894
+ function u(e, t) {
1895
+ r("update", { [e]: t });
1896
+ }
1897
+ function d() {
1898
+ let e = {
1899
+ id: B(),
1900
+ text: "",
1901
+ url: "",
1902
+ openInNewTab: !1,
1903
+ bold: !1,
1904
+ underline: !1
1905
+ };
1906
+ r("update", { items: [...n.block.items, e] });
1907
+ }
1908
+ function f(e, t, i) {
1909
+ r("update", { items: n.block.items.map((n) => n.id === e ? {
1910
+ ...n,
1911
+ [t]: i
1912
+ } : n) });
1913
+ }
1914
+ function p(e) {
1915
+ r("update", { items: n.block.items.filter((t) => t.id !== e) });
1916
+ }
1917
+ return (t, n) => (a(), g(O, null, [
1918
+ j(Y, { label: v(i).menu.items }, {
1919
+ default: l(() => [w("div", aa, [(a(!0), g(O, null, s(e.block.items, (t) => (a(), g("div", {
1920
+ key: t.id,
1921
+ class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
1922
+ }, [
1923
+ w("div", oa, [w("input", {
1924
+ type: "text",
1925
+ class: C([v(W), "tpl:flex-1"]),
1926
+ value: t.text,
1927
+ placeholder: v(i).menu.text,
1928
+ onInput: (e) => f(t.id, "text", e.target.value)
1929
+ }, null, 42, sa), w("button", {
1930
+ class: C(v(bt)),
1931
+ title: v(i).menu.removeItem,
1932
+ onClick: (e) => p(t.id)
1933
+ }, [j(v(Te), {
1934
+ size: 14,
1935
+ "stroke-width": 2
1936
+ })], 10, ca)]),
1937
+ j(Z, {
1938
+ "model-value": t.url,
1939
+ type: "url",
1940
+ placeholder: v(i).menu.urlPlaceholder,
1941
+ "onUpdate:modelValue": (e) => f(t.id, "url", e)
1942
+ }, null, 8, [
1943
+ "model-value",
1944
+ "placeholder",
1945
+ "onUpdate:modelValue"
1946
+ ]),
1947
+ w("div", la, [(a(!0), g(O, null, s(o.value, (e) => (a(), g("label", {
1948
+ key: e.key,
1949
+ class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1"
1950
+ }, [w("input", {
1951
+ type: "checkbox",
1952
+ checked: t[e.key],
1953
+ class: "tpl:accent-[var(--tpl-primary)]",
1954
+ onChange: (n) => f(t.id, e.key, n.target.checked)
1955
+ }, null, 40, ua), k(" " + m(e.label), 1)]))), 128))]),
1956
+ w("div", da, [w("label", { class: C([v(G), "tpl:!mb-0"]) }, m(v(i).menu.color), 3), j(J, {
1957
+ "swatch-only": "",
1958
+ "model-value": t.color || e.block.linkColor || e.block.color,
1959
+ "onUpdate:modelValue": (e) => f(t.id, "color", e)
1960
+ }, null, 8, ["model-value", "onUpdate:modelValue"])])
1961
+ ]))), 128)), w("button", {
1962
+ class: C(v(xt)),
1963
+ onClick: d
1964
+ }, [j(v(H), {
1965
+ size: 14,
1966
+ "stroke-width": 2
1967
+ }), k(" " + m(v(i).menu.addItem), 1)], 2)])]),
1968
+ _: 1
1969
+ }, 8, ["label"]),
1970
+ j(Y, { label: v(i).menu.fontFamily }, {
1971
+ default: l(() => [w("select", {
1972
+ class: C(v(W)),
1973
+ value: e.block.fontFamily || "",
1974
+ onChange: n[0] ||= (e) => u("fontFamily", e.target.value || void 0)
1975
+ }, [w("option", pa, m(v(i).title.inheritFont), 1), (a(!0), g(O, null, s(e.fontFamilies, (e) => (a(), g("option", {
1976
+ key: e.value,
1977
+ value: e.value
1978
+ }, m(e.label), 9, ma))), 128))], 42, fa)]),
1979
+ _: 1
1980
+ }, 8, ["label"]),
1981
+ j(Y, { label: v(i).menu.fontSize }, {
1982
+ default: l(() => [j(Tt, {
1983
+ "model-value": e.block.fontSize,
1984
+ min: 8,
1985
+ max: 48,
1986
+ suffix: "px",
1987
+ "onUpdate:modelValue": n[1] ||= (e) => u("fontSize", e)
1988
+ }, null, 8, ["model-value"])]),
1989
+ _: 1
1990
+ }, 8, ["label"]),
1991
+ j(Y, { label: v(i).menu.color }, {
1992
+ default: l(() => [j(J, {
1993
+ "model-value": e.block.color,
1994
+ "onUpdate:modelValue": n[2] ||= (e) => u("color", e)
1995
+ }, null, 8, ["model-value"])]),
1996
+ _: 1
1997
+ }, 8, ["label"]),
1998
+ j(Y, { label: v(i).menu.linkColor }, {
1999
+ default: l(() => [j(J, {
2000
+ "model-value": e.block.linkColor || e.block.color,
2001
+ "onUpdate:modelValue": n[3] ||= (e) => u("linkColor", e || void 0)
2002
+ }, null, 8, ["model-value"])]),
2003
+ _: 1
2004
+ }, 8, ["label"]),
2005
+ j(Y, { label: v(i).menu.textAlign }, {
2006
+ default: l(() => [j(X, {
2007
+ options: c.value,
2008
+ "model-value": e.block.textAlign,
2009
+ "onUpdate:modelValue": n[4] ||= (e) => u("textAlign", e)
2010
+ }, null, 8, ["options", "model-value"])]),
2011
+ _: 1
2012
+ }, 8, ["label"]),
2013
+ j(Y, { label: v(i).menu.separator }, {
2014
+ default: l(() => [w("input", {
2015
+ type: "text",
2016
+ class: C(v(W)),
2017
+ value: e.block.separator,
2018
+ onInput: n[5] ||= (e) => u("separator", e.target.value)
2019
+ }, null, 42, ha)]),
2020
+ _: 1
2021
+ }, 8, ["label"]),
2022
+ j(Y, { label: v(i).menu.separatorColor }, {
2023
+ default: l(() => [j(J, {
2024
+ "model-value": e.block.separatorColor,
2025
+ "onUpdate:modelValue": n[6] ||= (e) => u("separatorColor", e)
2026
+ }, null, 8, ["model-value"])]),
2027
+ _: 1
2028
+ }, 8, ["label"]),
2029
+ j(Y, { label: v(i).menu.spacing }, {
2030
+ default: l(() => [j(Tt, {
2031
+ "model-value": e.block.spacing,
2032
+ min: 0,
2033
+ max: 50,
2034
+ suffix: "px",
2035
+ "onUpdate:modelValue": n[7] ||= (e) => u("spacing", e)
2036
+ }, null, 8, ["model-value"])]),
2037
+ _: 1
2038
+ }, 8, ["label"])
2039
+ ], 64));
2040
+ }
2041
+ });
2042
+ //#endregion
2043
+ //#region src/utils/rebalanceColumnChildren.ts
2044
+ function _a(e) {
2045
+ return e === "1" ? 1 : e === "3" ? 3 : 2;
2046
+ }
2047
+ function va(e, t) {
2048
+ let n = _a(t);
2049
+ if (e.length === n) return e;
2050
+ if (e.length < n) {
2051
+ let t = Array.from({ length: n - e.length }, () => []);
2052
+ return [...e, ...t];
2053
+ }
2054
+ let r = e.slice(0, n), i = e.slice(n).flat(), a = [...r[n - 1], ...i];
2055
+ return [...r.slice(0, n - 1), a];
2056
+ }
2057
+ //#endregion
2058
+ //#region src/components/toolbar/SectionToolbar.vue?vue&type=script&setup=true&lang.ts
2059
+ var ya = { class: "tpl:mb-3.5" }, ba = ["value"], xa = ["value"], Sa = /* @__PURE__ */ A({
2060
+ __name: "SectionToolbar",
2061
+ props: { block: {} },
2062
+ emits: ["update"],
2063
+ setup(e, { emit: t }) {
2064
+ let n = e, r = t, { t: i } = L(), o = h(() => [
2065
+ {
2066
+ value: "1",
2067
+ label: i.section.column1
2068
+ },
2069
+ {
2070
+ value: "2",
2071
+ label: i.section.column2
2072
+ },
2073
+ {
2074
+ value: "3",
2075
+ label: i.section.column3
2076
+ },
2077
+ {
2078
+ value: "1-2",
2079
+ label: i.section.ratio12
2080
+ },
2081
+ {
2082
+ value: "2-1",
2083
+ label: i.section.ratio21
2084
+ }
2085
+ ]);
2086
+ function c(e) {
2087
+ let t = e.target.value;
2088
+ r("update", {
2089
+ columns: t,
2090
+ children: va(n.block.children, t)
2091
+ });
2092
+ }
2093
+ return (t, n) => (a(), g("div", ya, [w("label", { class: C(v(G)) }, m(v(i).section.columns), 3), w("select", {
2094
+ class: C(v(W)),
2095
+ value: e.block.columns,
2096
+ onChange: c
2097
+ }, [(a(!0), g(O, null, s(o.value, (e) => (a(), g("option", {
2098
+ key: e.value,
2099
+ value: e.value
2100
+ }, m(e.label), 9, xa))), 128))], 42, ba)]));
2101
+ }
2102
+ }), Ca = { class: "tpl:mb-3.5" }, wa = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Ta = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ea = ["value", "onChange"], Da = ["value"], Oa = ["title", "onClick"], ka = { class: "tpl:mb-3.5" }, Aa = ["value"], ja = { value: "solid" }, Ma = { value: "outlined" }, Na = { value: "rounded" }, Pa = { value: "square" }, Fa = { value: "circle" }, Ia = { class: "tpl:mb-3.5" }, La = { class: "tpl:mb-3.5" }, Ra = { class: "tpl:flex tpl:items-stretch" }, za = ["value"], Ba = { class: "tpl:mb-3.5" }, Va = /* @__PURE__ */ A({
2103
+ __name: "SocialToolbar",
2104
+ props: { block: {} },
2105
+ emits: ["update"],
2106
+ setup(e, { emit: t }) {
2107
+ let n = e, r = t, { t: i } = L();
2108
+ function o(e, t) {
2109
+ r("update", { [e]: t });
2110
+ }
2111
+ function c() {
2112
+ let e = {
2113
+ id: B(),
2114
+ platform: "facebook",
2115
+ url: ""
2116
+ };
2117
+ r("update", { icons: [...n.block.icons, e] });
2118
+ }
2119
+ function l(e, t, i) {
2120
+ r("update", { icons: n.block.icons.map((n) => n.id === e ? {
2121
+ ...n,
2122
+ [t]: i
2123
+ } : n) });
2124
+ }
2125
+ function u(e) {
2126
+ r("update", { icons: n.block.icons.filter((t) => t.id !== e) });
2127
+ }
2128
+ return (t, n) => (a(), g(O, null, [
2129
+ w("div", Ca, [w("label", { class: C(v(G)) }, m(v(i).social.icons), 3), w("div", wa, [(a(!0), g(O, null, s(e.block.icons, (e) => (a(), g("div", {
2130
+ key: e.id,
2131
+ class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
2132
+ }, [w("div", Ta, [w("select", {
2133
+ "data-testid": "social-platform-select",
2134
+ class: C([v(W), "tpl:flex-1"]),
2135
+ value: e.platform,
2136
+ onChange: (t) => l(e.id, "platform", t.target.value)
2137
+ }, [(a(!0), g(O, null, s(v(re), (e) => (a(), g("option", {
2138
+ key: e,
2139
+ value: e
2140
+ }, m(v(I)[e].name), 9, Da))), 128))], 42, Ea), w("button", {
2141
+ class: C(v(bt)),
2142
+ title: v(i).social.removeIcon,
2143
+ onClick: (t) => u(e.id)
2144
+ }, [j(v(Te), {
2145
+ size: 14,
2146
+ "stroke-width": 2
2147
+ })], 10, Oa)]), j(Z, {
2148
+ "model-value": e.url,
2149
+ type: "url",
2150
+ placeholder: v(i).social.urlPlaceholder,
2151
+ "onUpdate:modelValue": (t) => l(e.id, "url", t)
2152
+ }, null, 8, [
2153
+ "model-value",
2154
+ "placeholder",
2155
+ "onUpdate:modelValue"
2156
+ ])]))), 128)), w("button", {
2157
+ class: C(v(xt)),
2158
+ onClick: c
2159
+ }, [j(v(H), {
2160
+ size: 14,
2161
+ "stroke-width": 2
2162
+ }), k(" " + m(v(i).social.addIcon), 1)], 2)])]),
2163
+ w("div", ka, [w("label", { class: C(v(G)) }, m(v(i).social.style), 3), w("select", {
2164
+ class: C(v(W)),
2165
+ value: e.block.iconStyle,
2166
+ onChange: n[0] ||= (e) => o("iconStyle", e.target.value)
2167
+ }, [
2168
+ w("option", ja, m(v(i).social.styleSolid), 1),
2169
+ w("option", Ma, m(v(i).social.styleOutlined), 1),
2170
+ w("option", Na, m(v(i).social.styleRounded), 1),
2171
+ w("option", Pa, m(v(i).social.styleSquare), 1),
2172
+ w("option", Fa, m(v(i).social.styleCircle), 1)
2173
+ ], 42, Aa)]),
2174
+ w("div", Ia, [w("label", { class: C(v(G)) }, m(v(i).social.size), 3), j(X, {
2175
+ options: [
2176
+ {
2177
+ value: "small",
2178
+ label: v(i).social.sizeSmall
2179
+ },
2180
+ {
2181
+ value: "medium",
2182
+ label: v(i).social.sizeMedium
2183
+ },
2184
+ {
2185
+ value: "large",
2186
+ label: v(i).social.sizeLarge
2187
+ }
2188
+ ],
2189
+ "model-value": e.block.iconSize,
2190
+ "onUpdate:modelValue": n[1] ||= (e) => o("iconSize", e)
2191
+ }, null, 8, ["options", "model-value"])]),
2192
+ w("div", La, [w("label", { class: C(v(G)) }, m(v(i).social.spacing), 3), w("div", Ra, [w("input", {
2193
+ type: "number",
2194
+ class: C(v(q)),
2195
+ value: e.block.spacing,
2196
+ min: "0",
2197
+ max: "50",
2198
+ onInput: n[2] ||= (e) => o("spacing", Number(e.target.value))
2199
+ }, null, 42, za), w("span", { class: C(v(K)) }, "px", 2)])]),
2200
+ w("div", Ba, [w("label", { class: C(v(G)) }, m(v(i).social.align), 3), j(X, {
2201
+ options: [
2202
+ {
2203
+ value: "left",
2204
+ label: v(i).title.alignLeft,
2205
+ icon: v(ft)
2206
+ },
2207
+ {
2208
+ value: "center",
2209
+ label: v(i).title.alignCenter,
2210
+ icon: v(at)
2211
+ },
2212
+ {
2213
+ value: "right",
2214
+ label: v(i).title.alignRight,
2215
+ icon: v(pt)
2216
+ }
2217
+ ],
2218
+ "model-value": e.block.align,
2219
+ "onUpdate:modelValue": n[3] ||= (e) => o("align", e)
2220
+ }, null, 8, ["options", "model-value"])])
2221
+ ], 64));
2222
+ }
2223
+ }), Ha = { class: "tpl:mb-3.5" }, Ua = { class: "tpl:flex tpl:items-stretch" }, Wa = ["value"], Ga = ["value"], Ka = /* @__PURE__ */ A({
2224
+ __name: "SpacerToolbar",
2225
+ props: { block: {} },
2226
+ emits: ["update"],
2227
+ setup(e, { emit: t }) {
2228
+ let n = t, { t: r } = L();
2229
+ return (t, i) => (a(), g("div", Ha, [
2230
+ w("label", { class: C(v(G)) }, m(v(r).spacer.height), 3),
2231
+ w("div", Ua, [w("input", {
2232
+ type: "number",
2233
+ class: C(v(q)),
2234
+ value: e.block.height,
2235
+ min: "10",
2236
+ max: "100",
2237
+ onInput: i[0] ||= (e) => n("update", { height: Number(e.target.value) })
2238
+ }, null, 42, Wa), w("span", { class: C(v(K)) }, "px", 2)]),
2239
+ w("input", {
2240
+ type: "range",
2241
+ class: "tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",
2242
+ value: e.block.height,
2243
+ min: "10",
2244
+ max: "100",
2245
+ onInput: i[1] ||= (e) => n("update", { height: Number(e.target.value) })
2246
+ }, null, 40, Ga)
2247
+ ]));
2248
+ }
2249
+ }), qa = { class: "tpl:mb-3.5" }, Ja = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Ya = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, Xa = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Za = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, Qa = ["disabled"], $a = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, eo = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, to = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, no = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, ro = ["disabled"], io = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, ao = { class: "tpl:mb-3.5" }, oo = { class: "tpl:mb-1.5 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, so = ["checked"], co = {
2250
+ key: 0,
2251
+ class: "tpl:mb-3.5"
2252
+ }, lo = { class: "tpl:mb-3.5" }, uo = { class: "tpl:mb-3.5" }, fo = { class: "tpl:flex tpl:items-stretch" }, po = ["value"], mo = { class: "tpl:mb-3.5" }, ho = { class: "tpl:flex tpl:items-stretch" }, go = ["value"], _o = { class: "tpl:mb-3.5" }, vo = ["value"], yo = { value: "" }, bo = ["value"], xo = { class: "tpl:mb-3.5" }, So = { class: "tpl:flex tpl:items-stretch" }, Co = ["value"], wo = { class: "tpl:mb-3.5" }, To = { class: "tpl:mb-3.5" }, Eo = /* @__PURE__ */ A({
2253
+ __name: "TableToolbar",
2254
+ props: {
2255
+ block: {},
2256
+ fontFamilies: {}
2257
+ },
2258
+ emits: ["update"],
2259
+ setup(e, { emit: t }) {
2260
+ let n = e, r = t, { t: i } = L(), o = h(() => n.block.rows.length > 0 ? n.block.rows[0].cells.length : 0);
2261
+ function c(e, t) {
2262
+ r("update", { [e]: t });
2263
+ }
2264
+ function l() {
2265
+ let e = n.block.rows.length > 0 ? n.block.rows[0].cells.length : 3, t = {
2266
+ id: B(),
2267
+ cells: Array.from({ length: e }, () => ({
2268
+ id: B(),
2269
+ content: ""
2270
+ }))
2271
+ };
2272
+ r("update", { rows: [...n.block.rows, t] });
2273
+ }
2274
+ function u(e) {
2275
+ r("update", { rows: n.block.rows.filter((t) => t.id !== e) });
2276
+ }
2277
+ function d() {
2278
+ r("update", { rows: n.block.rows.map((e) => ({
2279
+ ...e,
2280
+ cells: [...e.cells, {
2281
+ id: B(),
2282
+ content: ""
2283
+ }]
2284
+ })) });
2285
+ }
2286
+ function f(e) {
2287
+ r("update", { rows: n.block.rows.map((t) => ({
2288
+ ...t,
2289
+ cells: t.cells.filter((t, n) => n !== e)
2290
+ })) });
2291
+ }
2292
+ return (t, n) => (a(), g(O, null, [
2293
+ w("div", qa, [w("label", { class: C(v(G)) }, m(v(i).table.dimensions), 3), w("div", Ja, [w("div", Ya, [w("span", Xa, m(v(i).table.rows), 1), w("div", Za, [
2294
+ w("button", {
2295
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
2296
+ disabled: e.block.rows.length <= 1,
2297
+ onClick: n[0] ||= (t) => u(e.block.rows[e.block.rows.length - 1].id)
2298
+ }, [j(v(U), {
2299
+ size: 12,
2300
+ "stroke-width": 2
2301
+ })], 8, Qa),
2302
+ w("span", $a, m(e.block.rows.length), 1),
2303
+ w("button", {
2304
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",
2305
+ onClick: l
2306
+ }, [j(v(H), {
2307
+ size: 12,
2308
+ "stroke-width": 2
2309
+ })])
2310
+ ])]), w("div", eo, [w("span", to, m(v(i).table.columns), 1), w("div", no, [
2311
+ w("button", {
2312
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
2313
+ disabled: o.value <= 1,
2314
+ onClick: n[1] ||= (e) => f(o.value - 1)
2315
+ }, [j(v(U), {
2316
+ size: 12,
2317
+ "stroke-width": 2
2318
+ })], 8, ro),
2319
+ w("span", io, m(o.value), 1),
2320
+ w("button", {
2321
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",
2322
+ onClick: d
2323
+ }, [j(v(H), {
2324
+ size: 12,
2325
+ "stroke-width": 2
2326
+ })])
2327
+ ])])])]),
2328
+ w("div", ao, [w("label", oo, [w("input", {
2329
+ type: "checkbox",
2330
+ checked: e.block.hasHeaderRow,
2331
+ class: "tpl:accent-[var(--tpl-primary)]",
2332
+ onChange: n[2] ||= (e) => c("hasHeaderRow", e.target.checked)
2333
+ }, null, 40, so), k(" " + m(v(i).table.hasHeaderRow), 1)])]),
2334
+ e.block.hasHeaderRow ? (a(), g("div", co, [w("label", { class: C(v(G)) }, m(v(i).table.headerBackgroundColor), 3), j(J, {
2335
+ "model-value": e.block.headerBackgroundColor || v("#f2f2f2"),
2336
+ placeholder: v(i).table.noHeaderBg,
2337
+ "onUpdate:modelValue": n[3] ||= (e) => c("headerBackgroundColor", e || null)
2338
+ }, null, 8, ["model-value", "placeholder"])])) : _("", !0),
2339
+ w("div", lo, [w("label", { class: C(v(G)) }, m(v(i).table.borderColor), 3), j(J, {
2340
+ "model-value": e.block.borderColor,
2341
+ "onUpdate:modelValue": n[4] ||= (e) => c("borderColor", e)
2342
+ }, null, 8, ["model-value"])]),
2343
+ w("div", uo, [w("label", { class: C(v(G)) }, m(v(i).table.borderWidth), 3), w("div", fo, [w("input", {
2344
+ type: "number",
2345
+ class: C(v(q)),
2346
+ value: e.block.borderWidth,
2347
+ min: "0",
2348
+ max: "10",
2349
+ onInput: n[5] ||= (e) => c("borderWidth", Number(e.target.value))
2350
+ }, null, 42, po), w("span", { class: C(v(K)) }, "px", 2)])]),
2351
+ w("div", mo, [w("label", { class: C(v(G)) }, m(v(i).table.cellPadding), 3), w("div", ho, [w("input", {
2352
+ type: "number",
2353
+ class: C(v(q)),
2354
+ value: e.block.cellPadding,
2355
+ min: "0",
2356
+ max: "30",
2357
+ onInput: n[6] ||= (e) => c("cellPadding", Number(e.target.value))
2358
+ }, null, 42, go), w("span", { class: C(v(K)) }, "px", 2)])]),
2359
+ w("div", _o, [w("label", { class: C(v(G)) }, m(v(i).table.fontFamily), 3), w("select", {
2360
+ class: C(v(W)),
2361
+ value: e.block.fontFamily || "",
2362
+ onChange: n[7] ||= (e) => c("fontFamily", e.target.value || void 0)
2363
+ }, [w("option", yo, m(v(i).title.inheritFont), 1), (a(!0), g(O, null, s(e.fontFamilies, (e) => (a(), g("option", {
2364
+ key: e.value,
2365
+ value: e.value
2366
+ }, m(e.label), 9, bo))), 128))], 42, vo)]),
2367
+ w("div", xo, [w("label", { class: C(v(G)) }, m(v(i).table.fontSize), 3), w("div", So, [w("input", {
2368
+ type: "number",
2369
+ class: C(v(q)),
2370
+ value: e.block.fontSize,
2371
+ min: "10",
2372
+ max: "32",
2373
+ onInput: n[8] ||= (e) => c("fontSize", Number(e.target.value))
2374
+ }, null, 42, Co), w("span", { class: C(v(K)) }, "px", 2)])]),
2375
+ w("div", wo, [w("label", { class: C(v(G)) }, m(v(i).table.color), 3), j(J, {
2376
+ "model-value": e.block.color,
2377
+ "onUpdate:modelValue": n[9] ||= (e) => c("color", e)
2378
+ }, null, 8, ["model-value"])]),
2379
+ w("div", To, [w("label", { class: C(v(G)) }, m(v(i).table.textAlign), 3), j(X, {
2380
+ options: [
2381
+ {
2382
+ value: "left",
2383
+ label: v(i).title.alignLeft,
2384
+ icon: v(ft)
2385
+ },
2386
+ {
2387
+ value: "center",
2388
+ label: v(i).title.alignCenter,
2389
+ icon: v(at)
2390
+ },
2391
+ {
2392
+ value: "right",
2393
+ label: v(i).title.alignRight,
2394
+ icon: v(pt)
2395
+ }
2396
+ ],
2397
+ "model-value": e.block.textAlign,
2398
+ "onUpdate:modelValue": n[10] ||= (e) => c("textAlign", e)
2399
+ }, null, 8, ["options", "model-value"])])
2400
+ ], 64));
2401
+ }
2402
+ }), Do = { class: "tpl:mb-3.5" }, Oo = ["value"], ko = { value: 1 }, Ao = { value: 2 }, jo = { value: 3 }, Mo = { value: 4 }, No = { class: "tpl:mb-3.5" }, Po = ["value"], Fo = { value: "" }, Io = ["value"], Lo = { class: "tpl:mb-3.5" }, Ro = { class: "tpl:mb-3.5" }, zo = /* @__PURE__ */ A({
2403
+ __name: "TitleToolbar",
2404
+ props: {
2405
+ block: {},
2406
+ fontFamilies: {}
2407
+ },
2408
+ emits: ["update"],
2409
+ setup(e, { emit: t }) {
2410
+ let n = t, { t: r } = L();
2411
+ function i(e, t) {
2412
+ n("update", { [e]: t });
2413
+ }
2414
+ return (t, n) => (a(), g(O, null, [
2415
+ w("div", Do, [w("label", { class: C(v(G)) }, m(v(r).title.level), 3), w("select", {
2416
+ class: C(v(W)),
2417
+ value: e.block.level,
2418
+ onChange: n[0] ||= (e) => i("level", Number(e.target.value))
2419
+ }, [
2420
+ w("option", ko, m(v(r).title.heading1), 1),
2421
+ w("option", Ao, m(v(r).title.heading2), 1),
2422
+ w("option", jo, m(v(r).title.heading3), 1),
2423
+ w("option", Mo, m(v(r).title.heading4), 1)
2424
+ ], 42, Oo)]),
2425
+ w("div", No, [w("label", { class: C(v(G)) }, m(v(r).title.fontFamily), 3), w("select", {
2426
+ class: C(v(W)),
2427
+ value: e.block.fontFamily || "",
2428
+ onChange: n[1] ||= (e) => i("fontFamily", e.target.value || void 0)
2429
+ }, [w("option", Fo, m(v(r).title.inheritFont), 1), (a(!0), g(O, null, s(e.fontFamilies, (e) => (a(), g("option", {
2430
+ key: e.value,
2431
+ value: e.value
2432
+ }, m(e.label), 9, Io))), 128))], 42, Po)]),
2433
+ w("div", Lo, [w("label", { class: C(v(G)) }, m(v(r).title.color), 3), j(J, {
2434
+ "model-value": e.block.color,
2435
+ "onUpdate:modelValue": n[2] ||= (e) => i("color", e)
2436
+ }, null, 8, ["model-value"])]),
2437
+ w("div", Ro, [w("label", { class: C(v(G)) }, m(v(r).title.align), 3), j(X, {
2438
+ options: [
2439
+ {
2440
+ value: "left",
2441
+ label: v(r).title.alignLeft,
2442
+ icon: v(ft)
2443
+ },
2444
+ {
2445
+ value: "center",
2446
+ label: v(r).title.alignCenter,
2447
+ icon: v(at)
2448
+ },
2449
+ {
2450
+ value: "right",
2451
+ label: v(r).title.alignRight,
2452
+ icon: v(pt)
2453
+ }
2454
+ ],
2455
+ "model-value": e.block.textAlign,
2456
+ "onUpdate:modelValue": n[3] ||= (e) => i("textAlign", e)
2457
+ }, null, 8, ["options", "model-value"])])
2458
+ ], 64));
2459
+ }
2460
+ }), Bo = { class: "tpl:mb-3.5" }, Vo = {
2461
+ key: 0,
2462
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
2463
+ }, Ho = ["checked"], Uo = {
2464
+ key: 0,
2465
+ class: "tpl:mb-3.5"
2466
+ }, Wo = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, Go = [
2467
+ "value",
2468
+ "placeholder",
2469
+ "title"
2470
+ ], Ko = { class: "tpl:mb-3.5" }, qo = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, Jo = { class: "tpl:mb-3.5" }, Yo = { class: "tpl:mb-3.5" }, Xo = ["value"], Zo = { value: "full" }, Qo = { class: "tpl:mb-3.5" }, $o = /* @__PURE__ */ A({
2471
+ __name: "VideoToolbar",
2472
+ props: { block: {} },
2473
+ emits: ["update"],
2474
+ setup(e, { emit: t }) {
2475
+ let n = e, r = t, { t: i } = L(), o = c(Ce, null), s = c(we, Le.liquid), l = R(), u = h(() => !!o), f = h(() => Ne(n.block.url, s)), p = d(!1), { start: y } = ke(() => {
2476
+ p.value = !1;
2477
+ }, 1e3, { immediate: !1 });
2478
+ function b(e, t) {
2479
+ r("update", { [e]: t });
2480
+ }
2481
+ async function x() {
2482
+ let e = await o?.({ accept: ["images"] });
2483
+ l.alive && e && (b("thumbnailUrl", e.url), p.value = !0, y());
2484
+ }
2485
+ return (t, n) => (a(), g(O, null, [
2486
+ w("div", Bo, [
2487
+ w("label", { class: C(v(G)) }, m(v(i).video.videoUrl), 3),
2488
+ j(Z, {
2489
+ "model-value": e.block.url,
2490
+ type: "url",
2491
+ placeholder: v(i).video.videoUrlPlaceholder,
2492
+ "onUpdate:modelValue": n[0] ||= (e) => b("url", e)
2493
+ }, null, 8, ["model-value", "placeholder"]),
2494
+ e.block.url ? (a(), g("label", Vo, [w("input", {
2495
+ type: "checkbox",
2496
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
2497
+ checked: e.block.openInNewTab ?? !1,
2498
+ onChange: n[1] ||= (e) => b("openInNewTab", e.target.checked)
2499
+ }, null, 40, Ho), k(" " + m(v(i).video.openInNewTab), 1)])) : _("", !0)
2500
+ ]),
2501
+ f.value ? (a(), g("div", Uo, [w("label", { class: C(v(G)) }, [k(m(v(i).video.placeholderUrl) + " ", 1), w("span", Wo, m(v(i).video.optional), 1)], 2), w("input", {
2502
+ type: "url",
2503
+ class: C(v(W)),
2504
+ value: e.block.placeholderUrl || "",
2505
+ placeholder: v(i).video.placeholderUrlPlaceholder,
2506
+ title: v(i).video.placeholderUrlTooltip,
2507
+ onInput: n[2] ||= (e) => b("placeholderUrl", e.target.value)
2508
+ }, null, 42, Go)])) : _("", !0),
2509
+ w("div", Ko, [
2510
+ w("label", { class: C(v(G)) }, [k(m(v(i).video.customThumbnail) + " ", 1), w("span", qo, m(v(i).video.optional), 1)], 2),
2511
+ j(Z, {
2512
+ "model-value": e.block.thumbnailUrl,
2513
+ type: "url",
2514
+ placeholder: v(i).video.thumbnailPlaceholder,
2515
+ pulse: p.value,
2516
+ "onUpdate:modelValue": n[3] ||= (e) => b("thumbnailUrl", e)
2517
+ }, null, 8, [
2518
+ "model-value",
2519
+ "placeholder",
2520
+ "pulse"
2521
+ ]),
2522
+ u.value ? (a(), g("button", {
2523
+ key: 0,
2524
+ class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2525
+ style: {
2526
+ "border-color": "var(--tpl-border)",
2527
+ color: "var(--tpl-primary)",
2528
+ "background-color": "var(--tpl-bg)"
2529
+ },
2530
+ onClick: x
2531
+ }, [j(v(De), {
2532
+ size: 14,
2533
+ "stroke-width": 1.5
2534
+ }), k(" " + m(v(i).image.browseMedia), 1)])) : _("", !0)
2535
+ ]),
2536
+ w("div", Jo, [w("label", { class: C(v(G)) }, m(v(i).video.altText), 3), j(Z, {
2537
+ "model-value": e.block.alt,
2538
+ type: "text",
2539
+ placeholder: v(i).video.altTextPlaceholder,
2540
+ "onUpdate:modelValue": n[4] ||= (e) => b("alt", e)
2541
+ }, null, 8, ["model-value", "placeholder"])]),
2542
+ w("div", Yo, [w("label", { class: C(v(G)) }, m(v(i).video.width), 3), w("select", {
2543
+ class: C(v(W)),
2544
+ value: e.block.width,
2545
+ onChange: n[5] ||= (e) => b("width", e.target.value === "full" ? "full" : Number(e.target.value))
2546
+ }, [
2547
+ w("option", Zo, m(v(i).video.fullWidth), 1),
2548
+ n[7] ||= w("option", { value: "300" }, "300px", -1),
2549
+ n[8] ||= w("option", { value: "400" }, "400px", -1),
2550
+ n[9] ||= w("option", { value: "500" }, "500px", -1)
2551
+ ], 42, Xo)]),
2552
+ w("div", Qo, [w("label", { class: C(v(G)) }, m(v(i).title.align), 3), j(X, {
2553
+ options: [
2554
+ {
2555
+ value: "left",
2556
+ label: v(i).title.alignLeft
2557
+ },
2558
+ {
2559
+ value: "center",
2560
+ label: v(i).title.alignCenter
2561
+ },
2562
+ {
2563
+ value: "right",
2564
+ label: v(i).title.alignRight
2565
+ }
2566
+ ],
2567
+ "model-value": e.block.align,
2568
+ "onUpdate:modelValue": n[6] ||= (e) => b("align", e)
2569
+ }, null, 8, ["options", "model-value"])])
2570
+ ], 64));
2571
+ }
2572
+ }), es = ["aria-label"], ts = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5" }, ns = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]" }, rs = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, is = { class: "tpl:flex tpl:gap-1" }, as = ["title"], os = ["title"], ss = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, cs = /* @__PURE__ */ V(/* @__PURE__ */ A({
2573
+ __name: "Toolbar",
2574
+ props: { block: {} },
2575
+ emits: [
2576
+ "update",
2577
+ "delete",
2578
+ "duplicate"
2579
+ ],
2580
+ setup(e, { emit: t }) {
2581
+ let n = f(() => import("./CountdownToolbar-DOrQCH57.js")), r = e, o = t, { t: s } = L(), l = ze(ae, "Toolbar"), u = c(z, []), d = h(() => r.block.type), p = h(() => We(r.block)), y = h(() => {
2582
+ if (p.value) return u.find((e) => e.type === r.block.customType);
2583
+ }), x = h(() => p.value ? y.value?.name ?? r.block.customType : me(d.value, s)), S = l.fonts;
2584
+ function C(e) {
2585
+ o("update", e);
2586
+ }
2587
+ return (t, r) => (a(), g("aside", {
2588
+ "aria-label": v(s).landmarks.blockToolbar,
2589
+ class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"
2590
+ }, [w("div", ts, [w("div", ns, [v(yt)[d.value] ? (a(), b(i(v(yt)[d.value]), {
2591
+ key: 0,
2592
+ size: 16,
2593
+ "stroke-width": 1.5
2594
+ })) : p.value ? (a(), b(v(_e), {
2595
+ key: 1,
2596
+ size: 16,
2597
+ "stroke-width": 1.5
2598
+ })) : _("", !0), w("h3", rs, m(x.value), 1)]), w("div", is, [w("button", {
2599
+ class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)] tpl:hover:text-[var(--tpl-text)]",
2600
+ title: v(s).toolbar.duplicate,
2601
+ onClick: r[0] ||= (e) => o("duplicate")
2602
+ }, [j(v(Ge), {
2603
+ size: 14,
2604
+ "stroke-width": 2
2605
+ })], 8, as), w("button", {
2606
+ class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
2607
+ title: v(s).toolbar.delete,
2608
+ onClick: r[1] ||= (e) => o("delete")
2609
+ }, [j(v(Oe), {
2610
+ size: 14,
2611
+ "stroke-width": 2
2612
+ })], 8, os)])]), w("div", ss, [p.value ? (a(), b(Ni, {
2613
+ key: 0,
2614
+ block: e.block,
2615
+ onUpdateFieldValues: r[2] ||= (e) => o("update", { fieldValues: e }),
2616
+ onUpdateDataSourceFetched: r[3] ||= (e) => o("update", { dataSourceFetched: e })
2617
+ }, null, 8, ["block"])) : d.value === "section" ? (a(), b(Sa, {
2618
+ key: 1,
2619
+ block: e.block,
2620
+ onUpdate: C
2621
+ }, null, 8, ["block"])) : d.value === "title" ? (a(), b(zo, {
2622
+ key: 2,
2623
+ block: e.block,
2624
+ "font-families": v(S),
2625
+ onUpdate: C
2626
+ }, null, 8, ["block", "font-families"])) : d.value === "paragraph" ? (a(), g(O, { key: 3 }, [], 64)) : d.value === "image" ? (a(), b(ia, {
2627
+ key: 4,
2628
+ block: e.block,
2629
+ onUpdate: C
2630
+ }, null, 8, ["block"])) : d.value === "video" ? (a(), b($o, {
2631
+ key: 5,
2632
+ block: e.block,
2633
+ onUpdate: C
2634
+ }, null, 8, ["block"])) : d.value === "button" ? (a(), b(ir, {
2635
+ key: 6,
2636
+ block: e.block,
2637
+ "font-families": v(S),
2638
+ onUpdate: C
2639
+ }, null, 8, ["block", "font-families"])) : d.value === "divider" ? (a(), b(zi, {
2640
+ key: 7,
2641
+ block: e.block,
2642
+ onUpdate: C
2643
+ }, null, 8, ["block"])) : d.value === "social" ? (a(), b(Va, {
2644
+ key: 8,
2645
+ block: e.block,
2646
+ onUpdate: C
2647
+ }, null, 8, ["block"])) : d.value === "menu" ? (a(), b(ga, {
2648
+ key: 9,
2649
+ block: e.block,
2650
+ "font-families": v(S),
2651
+ onUpdate: C
2652
+ }, null, 8, ["block", "font-families"])) : d.value === "table" ? (a(), b(Eo, {
2653
+ key: 10,
2654
+ block: e.block,
2655
+ "font-families": v(S),
2656
+ onUpdate: C
2657
+ }, null, 8, ["block", "font-families"])) : d.value === "spacer" ? (a(), b(Ka, {
2658
+ key: 11,
2659
+ block: e.block,
2660
+ onUpdate: C
2661
+ }, null, 8, ["block"])) : d.value === "html" ? (a(), b(Ui, {
2662
+ key: 12,
2663
+ block: e.block,
2664
+ onUpdate: C
2665
+ }, null, 8, ["block"])) : d.value === "countdown" ? (a(), b(v(n), {
2666
+ key: 13,
2667
+ block: e.block,
2668
+ "font-families": v(S),
2669
+ onUpdate: C
2670
+ }, null, 8, ["block", "font-families"])) : _("", !0), j(Xr, {
2671
+ block: e.block,
2672
+ "is-first-section": d.value === "paragraph",
2673
+ onUpdate: C
2674
+ }, null, 8, ["block", "is-first-section"])])], 8, es));
2675
+ }
2676
+ }), [["__scopeId", "data-v-2ac88283"]]), ls = ["aria-label"], us = {
2677
+ role: "tablist",
2678
+ class: "tpl:relative tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-active)] tpl:p-1.5"
2679
+ }, ds = [
2680
+ "aria-selected",
2681
+ "aria-label",
2682
+ "title"
2683
+ ], fs = { key: 0 }, ps = [
2684
+ "aria-selected",
2685
+ "aria-label",
2686
+ "title"
2687
+ ], ms = { key: 0 }, hs = [
2688
+ "aria-selected",
2689
+ "aria-label",
2690
+ "title"
2691
+ ], gs = { key: 0 }, _s = {
2692
+ key: 1,
2693
+ class: "tpl:ml-1 tpl:rounded-full tpl:bg-[var(--tpl-bg-hover)] tpl:px-1.5 tpl:text-[10px]"
2694
+ }, vs = {
2695
+ key: 0,
2696
+ id: "tpl-tabpanel-content",
2697
+ role: "tabpanel",
2698
+ "aria-labelledby": "tpl-tab-content",
2699
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
2700
+ }, ys = {
2701
+ key: 1,
2702
+ class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:px-6 tpl:py-10 tpl:text-center tpl:text-[var(--tpl-text-muted)]"
2703
+ }, bs = { class: "tpl:mb-4 tpl:text-[var(--tpl-text-dim)]" }, xs = { class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Ss = { class: "tpl:m-0 tpl:text-sm tpl:leading-normal" }, Cs = {
2704
+ key: 1,
2705
+ id: "tpl-tabpanel-settings",
2706
+ role: "tabpanel",
2707
+ "aria-labelledby": "tpl-tab-settings",
2708
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
2709
+ }, ws = {
2710
+ key: 2,
2711
+ id: "tpl-tabpanel-issues",
2712
+ role: "tabpanel",
2713
+ "aria-labelledby": "tpl-tab-issues",
2714
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
2715
+ }, Ts = /* @__PURE__ */ A({
2716
+ __name: "RightSidebar",
2717
+ props: {
2718
+ selectedBlock: {},
2719
+ settings: {},
2720
+ shiftedLeft: { type: Boolean }
2721
+ },
2722
+ emits: [
2723
+ "update-block",
2724
+ "delete-block",
2725
+ "duplicate-block",
2726
+ "update-settings"
2727
+ ],
2728
+ setup(e, { emit: t }) {
2729
+ let n = f(() => import("./IssuesPanel-C54PhBgc.js")), r = e, i = t, { t: o } = L(), s = d("content"), l = c(P, null), u = h(() => l !== null), p = h(() => l?.issues.value.length ?? 0);
2730
+ function y(e) {
2731
+ return s.value === e ? "tpl:flex-1 tpl:text-[var(--tpl-primary)]" : "tpl:shrink-0 tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]";
2732
+ }
2733
+ function x(e) {
2734
+ return s.value === e ? {
2735
+ backgroundColor: "var(--tpl-bg)",
2736
+ boxShadow: "var(--tpl-shadow-md)"
2737
+ } : { backgroundColor: "transparent" };
2738
+ }
2739
+ return M(() => r.selectedBlock, (e) => {
2740
+ e && (s.value = "content");
2741
+ }), (t, r) => (a(), g("aside", {
2742
+ "aria-label": v(o).landmarks.rightSidebar,
2743
+ class: C(["tpl-right-sidebar tpl:absolute tpl:top-14 tpl:bottom-0 tpl:z-40 tpl:flex tpl:w-[320px] tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)] tpl:transition-all tpl:duration-200 tpl:border-l tpl:border-[var(--tpl-border)]", e.shiftedLeft ? "tpl:right-[360px]" : "tpl:right-0"])
2744
+ }, [
2745
+ w("div", us, [
2746
+ w("button", {
2747
+ id: "tpl-tab-content",
2748
+ role: "tab",
2749
+ "aria-selected": s.value === "content",
2750
+ "aria-controls": "tpl-tabpanel-content",
2751
+ "aria-label": v(o).sidebar.content,
2752
+ title: v(o).sidebar.content,
2753
+ class: C(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", y("content")]),
2754
+ style: E(x("content")),
2755
+ onClick: r[0] ||= (e) => s.value = "content"
2756
+ }, [j(v(ut), {
2757
+ size: 14,
2758
+ "stroke-width": 2
2759
+ }), s.value === "content" ? (a(), g("span", fs, m(v(o).sidebar.content), 1)) : _("", !0)], 14, ds),
2760
+ w("button", {
2761
+ id: "tpl-tab-settings",
2762
+ role: "tab",
2763
+ "aria-selected": s.value === "settings",
2764
+ "aria-controls": "tpl-tabpanel-settings",
2765
+ "aria-label": v(o).sidebar.settings,
2766
+ title: v(o).sidebar.settings,
2767
+ class: C(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", y("settings")]),
2768
+ style: E(x("settings")),
2769
+ onClick: r[1] ||= (e) => s.value = "settings"
2770
+ }, [j(v(gt), {
2771
+ size: 14,
2772
+ "stroke-width": 1.5
2773
+ }), s.value === "settings" ? (a(), g("span", ms, m(v(o).sidebar.settings), 1)) : _("", !0)], 14, ps),
2774
+ u.value ? (a(), g("button", {
2775
+ key: 0,
2776
+ id: "tpl-tab-issues",
2777
+ role: "tab",
2778
+ "aria-selected": s.value === "issues",
2779
+ "aria-controls": "tpl-tabpanel-issues",
2780
+ "aria-label": v(o).issues.panelTabLabel,
2781
+ title: v(o).issues.panelTabLabel,
2782
+ class: C(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", y("issues")]),
2783
+ style: E(x("issues")),
2784
+ onClick: r[2] ||= (e) => s.value = "issues"
2785
+ }, [
2786
+ j(v(Ze), {
2787
+ size: 14,
2788
+ "stroke-width": 1.5
2789
+ }),
2790
+ s.value === "issues" ? (a(), g("span", gs, m(v(o).issues.panelTabLabel), 1)) : _("", !0),
2791
+ p.value > 0 ? (a(), g("span", _s, m(p.value), 1)) : _("", !0)
2792
+ ], 14, hs)) : _("", !0)
2793
+ ]),
2794
+ s.value === "content" ? (a(), g("div", vs, [e.selectedBlock ? (a(), b(cs, {
2795
+ key: 0,
2796
+ block: e.selectedBlock,
2797
+ onUpdate: r[3] ||= (e) => i("update-block", e),
2798
+ onDelete: r[4] ||= (e) => i("delete-block"),
2799
+ onDuplicate: r[5] ||= (e) => i("duplicate-block")
2800
+ }, null, 8, ["block"])) : (a(), g("div", ys, [
2801
+ w("div", bs, [j(v(Qe), {
2802
+ size: 40,
2803
+ "stroke-width": 1.5
2804
+ })]),
2805
+ w("h3", xs, m(v(o).sidebar.noSelection), 1),
2806
+ w("p", Ss, m(v(o).sidebar.noSelectionHint), 1)
2807
+ ]))])) : _("", !0),
2808
+ s.value === "settings" ? (a(), g("div", Cs, [j(Fn, {
2809
+ settings: e.settings,
2810
+ onUpdate: r[6] ||= (e) => i("update-settings", e)
2811
+ }, null, 8, ["settings"])])) : _("", !0),
2812
+ s.value === "issues" && u.value ? (a(), g("div", ws, [j(v(n))])) : _("", !0)
2813
+ ], 10, ls));
2814
+ }
2815
+ }), Es = ["aria-label"], Ds = [
2816
+ "aria-checked",
2817
+ "aria-label",
2818
+ "title",
2819
+ "onClick"
2820
+ ], Os = /* @__PURE__ */ A({
2821
+ __name: "ViewportToggle",
2822
+ props: { viewport: {} },
2823
+ emits: ["change"],
2824
+ setup(e, { emit: t }) {
2825
+ let n = e, r = t, { t: i } = L(), o = h(() => [
2826
+ {
2827
+ value: "desktop",
2828
+ label: i.viewport.desktop
2829
+ },
2830
+ {
2831
+ value: "tablet",
2832
+ label: i.viewport.tablet
2833
+ },
2834
+ {
2835
+ value: "mobile",
2836
+ label: i.viewport.mobile
2837
+ }
2838
+ ]), c = h(() => `translateX(${o.value.findIndex((e) => e.value === n.viewport) * 100}%)`);
2839
+ return (t, n) => (a(), g("div", {
2840
+ role: "radiogroup",
2841
+ "aria-label": v(i).viewport.label,
2842
+ class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
2843
+ style: E({
2844
+ gridTemplateColumns: `repeat(${o.value.length}, 1fr)`,
2845
+ backgroundColor: "var(--tpl-bg-hover)"
2846
+ })
2847
+ }, [w("div", {
2848
+ class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
2849
+ style: E({
2850
+ left: "4px",
2851
+ width: `calc((100% - 8px) / ${o.value.length})`,
2852
+ transform: c.value,
2853
+ backgroundColor: "var(--tpl-bg)",
2854
+ boxShadow: "var(--tpl-shadow)",
2855
+ transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
2856
+ })
2857
+ }, null, 4), (a(!0), g(O, null, s(o.value, (t) => (a(), g("button", {
2858
+ key: t.value,
2859
+ role: "radio",
2860
+ "aria-checked": e.viewport === t.value,
2861
+ "aria-label": t.label,
2862
+ class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium",
2863
+ style: E({
2864
+ color: e.viewport === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2865
+ transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
2866
+ }),
2867
+ title: t.label,
2868
+ onClick: (e) => r("change", t.value)
2869
+ }, [t.value === "desktop" ? (a(), b(v(rt), {
2870
+ key: 0,
2871
+ size: 18,
2872
+ "stroke-width": 1.5
2873
+ })) : t.value === "tablet" ? (a(), b(v(dt), {
2874
+ key: 1,
2875
+ size: 18,
2876
+ "stroke-width": 1.5
2877
+ })) : (a(), b(v(mt), {
2878
+ key: 2,
2879
+ size: 18,
2880
+ "stroke-width": 1.5
2881
+ })), w("span", null, m(t.label), 1)], 12, Ds))), 128))], 12, Es));
2882
+ }
2883
+ }), ks = [
2884
+ "aria-label",
2885
+ "title",
2886
+ "aria-pressed"
2887
+ ], As = /* @__PURE__ */ V(/* @__PURE__ */ A({
2888
+ __name: "PreviewToggle",
2889
+ props: { previewMode: { type: Boolean } },
2890
+ emits: ["change"],
2891
+ setup(e, { emit: t }) {
2892
+ let n = t, { t: r } = L();
2893
+ return (t, i) => (a(), g("button", {
2894
+ class: "tpl-preview-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",
2895
+ style: E({
2896
+ color: e.previewMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2897
+ backgroundColor: e.previewMode ? "var(--tpl-primary-light)" : "transparent"
2898
+ }),
2899
+ "aria-label": e.previewMode ? v(r).previewMode.disable : v(r).previewMode.enable,
2900
+ title: e.previewMode ? v(r).previewMode.disable : v(r).previewMode.enable,
2901
+ "aria-pressed": e.previewMode,
2902
+ onClick: i[0] ||= (t) => n("change", !e.previewMode)
2903
+ }, [j(x, {
2904
+ "enter-active-class": "tpl-icon-enter-active",
2905
+ "leave-active-class": "tpl-icon-leave-active",
2906
+ "enter-from-class": "tpl-icon-enter-from",
2907
+ "leave-to-class": "tpl-icon-leave-to",
2908
+ mode: "out-in"
2909
+ }, {
2910
+ default: l(() => [e.previewMode ? (a(), b(v(ge), {
2911
+ key: "eye",
2912
+ size: 18,
2913
+ "stroke-width": 1.5
2914
+ })) : (a(), b(v(ee), {
2915
+ key: "eye-off",
2916
+ size: 18,
2917
+ "stroke-width": 1.5
2918
+ }))]),
2919
+ _: 1
2920
+ })], 12, ks));
2921
+ }
2922
+ }), [["__scopeId", "data-v-af87d02a"]]), js = [
2923
+ "aria-label",
2924
+ "title",
2925
+ "aria-pressed"
2926
+ ], Ms = /* @__PURE__ */ V(/* @__PURE__ */ A({
2927
+ __name: "DarkModeToggle",
2928
+ props: { darkMode: { type: Boolean } },
2929
+ emits: ["change"],
2930
+ setup(e, { emit: t }) {
2931
+ let n = t, { t: r } = L();
2932
+ return (t, i) => (a(), g("button", {
2933
+ class: "tpl-dark-mode-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",
2934
+ style: E({
2935
+ color: e.darkMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2936
+ backgroundColor: e.darkMode ? "var(--tpl-primary-light)" : "transparent"
2937
+ }),
2938
+ "aria-label": e.darkMode ? v(r).darkMode.disable : v(r).darkMode.enable,
2939
+ title: e.darkMode ? v(r).darkMode.disable : v(r).darkMode.enable,
2940
+ "aria-pressed": e.darkMode,
2941
+ onClick: i[0] ||= (t) => n("change", !e.darkMode)
2942
+ }, [j(x, {
2943
+ "enter-active-class": "tpl-icon-enter-active",
2944
+ "leave-active-class": "tpl-icon-leave-active",
2945
+ "enter-from-class": "tpl-icon-enter-from",
2946
+ "leave-to-class": "tpl-icon-leave-to",
2947
+ mode: "out-in"
2948
+ }, {
2949
+ default: l(() => [e.darkMode ? (a(), b(v(nt), {
2950
+ key: "moon",
2951
+ size: 18,
2952
+ "stroke-width": 1.5
2953
+ })) : (a(), b(v(ot), {
2954
+ key: "sun",
2955
+ size: 18,
2956
+ "stroke-width": 1.5
2957
+ }))]),
2958
+ _: 1
2959
+ })], 12, js));
2960
+ }
2961
+ }), [["__scopeId", "data-v-f8694f76"]]), Ns = {
2962
+ class: "tpl:pointer-events-auto tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-tl-lg tpl:p-1",
2963
+ style: {
2964
+ "background-color": "color-mix(\n in srgb,\n var(--tpl-canvas-bg) 85%,\n transparent\n )",
2965
+ "backdrop-filter": "blur(8px)",
2966
+ "-webkit-backdrop-filter": "blur(8px)"
2967
+ }
2968
+ }, Ps = {
2969
+ href: "https://github.com/templatical/sdk",
2970
+ target: "_blank",
2971
+ rel: "noopener noreferrer",
2972
+ class: "tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-dim)]",
2973
+ style: { "text-decoration": "none" }
2974
+ }, Fs = /* @__PURE__ */ A({
2975
+ __name: "EditorFooter",
2976
+ props: { positionClass: {} },
2977
+ setup(e) {
2978
+ let { t } = L();
2979
+ return (n, r) => (a(), g("footer", { class: C(["tpl:pointer-events-none tpl:absolute tpl:bottom-0 tpl:z-50 tpl:flex tpl:h-8 tpl:items-center tpl:justify-end tpl:pr-4 tpl:text-[9px] tpl:opacity-90 tpl:transition-all tpl:duration-300 tpl:text-[var(--tpl-text-dim)]", e.positionClass]) }, [w("div", Ns, [
2980
+ w("span", null, m(v(t).footer.poweredBy), 1),
2981
+ r[0] ||= w("a", {
2982
+ href: "https://templatical.com",
2983
+ target: "_blank",
2984
+ rel: "noopener noreferrer",
2985
+ class: "tpl:inline-flex tpl:items-center tpl:gap-1 tpl:font-medium tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-muted)]",
2986
+ style: { "text-decoration": "none" }
2987
+ }, [w("img", {
2988
+ width: "14",
2989
+ height: "14",
2990
+ src: "https://templatical.com/logo.svg",
2991
+ alt: ""
2992
+ }), k(" Templatical ")], -1),
2993
+ r[1] ||= w("span", { class: "tpl:text-[var(--tpl-border)]" }, "·", -1),
2994
+ w("a", Ps, m(v(t).footer.openSource), 1)
2995
+ ])], 2));
2996
+ }
2997
+ });
2998
+ //#endregion
2999
+ export { Ts as a, Et as c, Os as i, Ms as n, Gt as o, As as r, It as s, Fs as t };
3000
+
3001
+ //# sourceMappingURL=styles-8qDRQ-6n.js.map