@templatical/editor 0.7.2 → 0.7.3

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 (109) hide show
  1. package/dist/{AiChatSidebar-DWRONNm6.js → AiChatSidebar-H7SIsxeC.js} +49 -59
  2. package/dist/{AiFeatureMenu-U7b4Z8OV.js → AiFeatureMenu-CJGX-fP5.js} +1 -1
  3. package/dist/{CloudEditor-DgiUCNMn.js → CloudEditor-BBs3p-mW.js} +124 -120
  4. package/dist/{CollaboratorBar-BgeaMhrV.js → CollaboratorBar-CiEo25lb.js} +2 -2
  5. package/dist/{CommentsSidebar-BiRtaXYD.js → CommentsSidebar-DikjSLtH.js} +1 -1
  6. package/dist/{CountdownToolbar-CojjlZet.js → CountdownToolbar-Bn4RwJVN.js} +2 -2
  7. package/dist/{DesignReferenceSidebar-C1W02bYt.js → DesignReferenceSidebar-D08CLZPA.js} +1 -1
  8. package/dist/{ModuleBrowserModal-Bjh99_5c.js → ModuleBrowserModal-D6637s8j.js} +4 -4
  9. package/dist/{ModulePreviewCanvas-DDDQmUI_.js → ModulePreviewCanvas-DBFmwq-y.js} +1 -1
  10. package/dist/{NumberWithSuffix-CLTBb2Rj.js → NumberWithSuffix-CyFX9w1e.js} +1 -1
  11. package/dist/{ParagraphEditor-BSaEdasm.js → ParagraphEditor-DC2jOjNh.js} +16 -16
  12. package/dist/{RichTextEditorContent-C3QSg7gd.js → RichTextEditorContent-8NkjTIua.js} +1 -1
  13. package/dist/{SaveModuleDialog-9fX6oSxf.js → SaveModuleDialog-NKT7bWWs.js} +2 -2
  14. package/dist/{SnapshotHistory-gYW-IXkE.js → SnapshotHistory-XNqYxPBj.js} +2 -2
  15. package/dist/{TestEmailModal-B_Rmnngq.js → TestEmailModal-B_-Qo5Us.js} +2 -2
  16. package/dist/{TitleEditor-XbFuw1Vy.js → TitleEditor-DnH3yyTr.js} +7 -7
  17. package/dist/{TplModal-LY9rkDph.js → TplModal-BoEZFe3U.js} +2 -2
  18. package/dist/{blockTypeIcons-CLT2H0yU.js → blockTypeIcons-CUcYuWAO.js} +1 -1
  19. package/dist/bundle-stats.json +7 -7
  20. package/dist/cdn/chunks/{AccessibilityPanel-DaqF4Xzy.js → AccessibilityPanel-CQt87OMk.js} +5 -5
  21. package/dist/cdn/chunks/{AccessibilityPanel-DaqF4Xzy.js.map → AccessibilityPanel-CQt87OMk.js.map} +1 -1
  22. package/dist/cdn/chunks/{AiFeatureMenu-WhZ7G-Wr.js → AiFeatureMenu-SxIqfqA0.js} +8 -8
  23. package/dist/cdn/chunks/{AiFeatureMenu-WhZ7G-Wr.js.map → AiFeatureMenu-SxIqfqA0.js.map} +1 -1
  24. package/dist/cdn/chunks/{BlockA11yBadge-BLKyO0lH.js → BlockA11yBadge-QqW6nomn.js} +3 -3
  25. package/dist/cdn/chunks/{BlockA11yBadge-BLKyO0lH.js.map → BlockA11yBadge-QqW6nomn.js.map} +1 -1
  26. package/dist/cdn/chunks/{CloudEditor-BKEXPt3g.js → CloudEditor-ChWUIMw7.js} +165 -161
  27. package/dist/cdn/chunks/CloudEditor-ChWUIMw7.js.map +1 -0
  28. package/dist/cdn/chunks/{CollaboratorBar-ASDiTitQ.js → CollaboratorBar-73LfbzqF.js} +3 -3
  29. package/dist/cdn/chunks/{CollaboratorBar-ASDiTitQ.js.map → CollaboratorBar-73LfbzqF.js.map} +1 -1
  30. package/dist/cdn/chunks/{CountdownBlock-LAlYJYWL.js → CountdownBlock-WYz9b9Ex.js} +2 -2
  31. package/dist/cdn/chunks/{CountdownBlock-LAlYJYWL.js.map → CountdownBlock-WYz9b9Ex.js.map} +1 -1
  32. package/dist/cdn/chunks/{CountdownToolbar-CbIKGP7u.js → CountdownToolbar-B9fPfFqp.js} +3 -3
  33. package/dist/cdn/chunks/{CountdownToolbar-CbIKGP7u.js.map → CountdownToolbar-B9fPfFqp.js.map} +1 -1
  34. package/dist/cdn/chunks/{ModuleBrowserModal-BjmdleNq.js → ModuleBrowserModal-DfnJQBkM.js} +8 -8
  35. package/dist/cdn/chunks/{ModuleBrowserModal-BjmdleNq.js.map → ModuleBrowserModal-DfnJQBkM.js.map} +1 -1
  36. package/dist/cdn/chunks/{ModulePreviewCanvas-DsmACAdb.js → ModulePreviewCanvas-DE4_oHA_.js} +20 -20
  37. package/dist/cdn/chunks/{ModulePreviewCanvas-DsmACAdb.js.map → ModulePreviewCanvas-DE4_oHA_.js.map} +1 -1
  38. package/dist/cdn/chunks/{NumberWithSuffix-EEDNj1my.js → NumberWithSuffix-BST0yRor.js} +2 -2
  39. package/dist/cdn/chunks/{NumberWithSuffix-EEDNj1my.js.map → NumberWithSuffix-BST0yRor.js.map} +1 -1
  40. package/dist/cdn/chunks/{ParagraphEditor-D6Dw5RtX.js → ParagraphEditor-CQfijF3i.js} +36 -36
  41. package/dist/cdn/chunks/{ParagraphEditor-D6Dw5RtX.js.map → ParagraphEditor-CQfijF3i.js.map} +1 -1
  42. package/dist/cdn/chunks/{RichTextEditorContent-C2yj_yPM.js → RichTextEditorContent-CBds8dnm.js} +5 -5
  43. package/dist/cdn/chunks/{RichTextEditorContent-C2yj_yPM.js.map → RichTextEditorContent-CBds8dnm.js.map} +1 -1
  44. package/dist/cdn/chunks/{SaveModuleDialog-DCcvwYat.js → SaveModuleDialog-DXhuZgZ4.js} +13 -13
  45. package/dist/cdn/chunks/{SaveModuleDialog-DCcvwYat.js.map → SaveModuleDialog-DXhuZgZ4.js.map} +1 -1
  46. package/dist/cdn/chunks/{TitleEditor-isN_t0MJ.js → TitleEditor-BdQvH7eK.js} +7 -7
  47. package/dist/cdn/chunks/{TitleEditor-isN_t0MJ.js.map → TitleEditor-BdQvH7eK.js.map} +1 -1
  48. package/dist/cdn/chunks/{blockTypeIcons-Bgn69Q1-.js → blockTypeIcons-D3CGFW5P.js} +8 -8
  49. package/dist/cdn/chunks/{blockTypeIcons-Bgn69Q1-.js.map → blockTypeIcons-D3CGFW5P.js.map} +1 -1
  50. package/dist/cdn/chunks/{extensions-BPsjY5N8.js → extensions-BE81zpqP.js} +50 -48
  51. package/dist/cdn/chunks/{extensions-BPsjY5N8.js.map → extensions-BE81zpqP.js.map} +1 -1
  52. package/dist/cdn/chunks/{features-BouLRfOO.js → features-CXF_YKlL.js} +1258 -1113
  53. package/dist/cdn/chunks/features-CXF_YKlL.js.map +1 -0
  54. package/dist/cdn/chunks/{icons-BBuZkqC3.js → icons-KbmhF7rg.js} +2 -2
  55. package/dist/cdn/chunks/{icons-BBuZkqC3.js.map → icons-KbmhF7rg.js.map} +1 -1
  56. package/dist/cdn/chunks/{media-library-C-DcHE6w.js → media-library-BERe10wA.js} +103 -103
  57. package/dist/cdn/chunks/{media-library-C-DcHE6w.js.map → media-library-BERe10wA.js.map} +1 -1
  58. package/dist/cdn/chunks/{quality-ConWSEB6.js → quality-CmkY1kMU.js} +309 -309
  59. package/dist/cdn/chunks/{quality-ConWSEB6.js.map → quality-CmkY1kMU.js.map} +1 -1
  60. package/dist/cdn/chunks/{renderer-F8cxEe3t.js → renderer-OttGEYkY.js} +50 -50
  61. package/dist/cdn/chunks/{renderer-F8cxEe3t.js.map → renderer-OttGEYkY.js.map} +1 -1
  62. package/dist/cdn/chunks/{src-C9rMok-R.js → src-C21GI0p6.js} +6 -6
  63. package/dist/cdn/chunks/{src-C9rMok-R.js.map → src-C21GI0p6.js.map} +1 -1
  64. package/dist/cdn/chunks/styles-Cy-My9zK.js +2976 -0
  65. package/dist/cdn/chunks/styles-Cy-My9zK.js.map +1 -0
  66. package/dist/cdn/editor.css +1 -1
  67. package/dist/cdn/editor.js +109 -106
  68. package/dist/cdn/editor.js.map +1 -1
  69. package/dist/{dist-DDJIWTRY.js → dist-B2jcQhv8.js} +1 -1
  70. package/dist/{dist-wzMIGj-D.js → dist-BYt3jdCR.js} +1 -1
  71. package/dist/{dist-aRzjfSRN.js → dist-CISFttkF.js} +1 -1
  72. package/dist/{dist-D6uC2xhi.js → dist-CfQPBf15.js} +1 -1
  73. package/dist/{dist-DjviJBCi.js → dist-DD-9hatO.js} +1 -1
  74. package/dist/{dist-KoBJjK1G.js → dist-DUvhjQ2-.js} +1 -1
  75. package/dist/{dist-BaQIYPsn.js → dist-DVwOAodp.js} +1 -1
  76. package/dist/{dist-Cp0zXPAD.js → dist-DxD1kSdH.js} +1 -1
  77. package/dist/{dist-Pk4MhWMP.js → dist-U5guDm2w.js} +1 -1
  78. package/dist/{dist-D90y8dvT.js → dist-hfu7I2rO.js} +3 -3
  79. package/dist/{dist-us-RpCWN.js → dist-v8h02hhE.js} +1 -1
  80. package/dist/{extensions-D-J02CiP.js → extensions-p6UBqXfg.js} +30 -28
  81. package/dist/index.d.ts +8 -8
  82. package/dist/style.css +1 -1
  83. package/dist/{styles-j_3bu0Bo.js → styles-BP15QmP3.js} +1058 -1052
  84. package/dist/templatical-editor.js +108 -105
  85. package/dist/useAliveFlag-D8GoB4VE.js +10 -0
  86. package/dist/{useEditorCore-B1XrI6fY.js → useEditorCore-_rbu6iMu.js} +921 -778
  87. package/package.json +7 -7
  88. package/dist/cdn/chunks/CloudEditor-BKEXPt3g.js.map +0 -1
  89. package/dist/cdn/chunks/features-BouLRfOO.js.map +0 -1
  90. package/dist/cdn/chunks/styles-BRN0i_zg.js +0 -2971
  91. package/dist/cdn/chunks/styles-BRN0i_zg.js.map +0 -1
  92. /package/dist/{AccessibilityPanel-D-PqmHdH.js → AccessibilityPanel-BeUibrUb.js} +0 -0
  93. /package/dist/{BlockA11yBadge-BFIw0h1m.js → BlockA11yBadge-BhyoMZJ9.js} +0 -0
  94. /package/dist/{CountdownBlock-Cq8A8WrM.js → CountdownBlock-ByJ0_8Pk.js} +0 -0
  95. /package/dist/{TemplateScoringPanel-V79yrEPC.js → TemplateScoringPanel-kYOGtac3.js} +0 -0
  96. /package/dist/{cloud-CTmfCSqf.js → cloud-k0DgeCo2.js} +0 -0
  97. /package/dist/{de-BhIWu_bO.js → de-C9hp3n_a.js} +0 -0
  98. /package/dist/{de-Di4MEjjx.js → de-GOtR9DwW.js} +0 -0
  99. /package/dist/{dist-iLBdeBDR.js → dist-CQQS9SRN.js} +0 -0
  100. /package/dist/{emojiData-DX3E0XT-.js → emojiData-DrBuvEoP.js} +0 -0
  101. /package/dist/{en-D7HRbYah.js → en-Dv776AqL.js} +0 -0
  102. /package/dist/{en-BSuzi-Pd.js → en-dFFQVzNn.js} +0 -0
  103. /package/dist/{formatRelativeTime-BOEf47hq.js → formatRelativeTime-bvx5sFh5.js} +0 -0
  104. /package/dist/{liquid.browser-CdMv1BTn.js → liquid.browser-DX8ZHRdq.js} +0 -0
  105. /package/dist/{pt-BR-K32lt6YP.js → pt-BR-6n58Fl_q.js} +0 -0
  106. /package/dist/{pt-BR-CCVBRais.js → pt-BR-iOr79aDg.js} +0 -0
  107. /package/dist/{readableTextColor-CY3SiRnt.js → readableTextColor-CXzrEnNb.js} +0 -0
  108. /package/dist/{styleConstants-fWzlIIwN.js → styleConstants-DkfOPzGu.js} +0 -0
  109. /package/dist/{usePopoverRoot-BxJrqnMD.js → usePopoverRoot-BwzFSPLy.js} +0 -0
@@ -0,0 +1,2976 @@
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 ee } from "./draggable-P6QWzy4g.js";
2
+ import { $ as M, Bt as N, Ct as P, Dt as F, F as I, Ft as L, G as R, Gt as te, H as ne, Ht as re, I as ie, It as ae, J as oe, Jt as se, K as ce, Kt as le, L as ue, M as de, Mt as fe, N as pe, P as me, Pt as he, R as ge, Rt as _e, Sn as z, St as B, Tt as ve, U as ye, V as be, Vt as xe, W as Se, Xt as Ce, Yt as we, Zt as Te, at as Ee, bn as De, bt as Oe, ct as ke, dn as Ae, et as je, fn as Me, gn as Ne, hn as Pe, it as Fe, j as Ie, kt as Le, mn as Re, mt as ze, nn as Be, q as Ve, qt as He, rt as V, ut as Ue, vn as We, wn as Ge, wt as Ke, xn as qe, xt as Je, yt as Ye, z as Xe } from "./features-CXF_YKlL.js";
3
+ import { E as H, F as U, G as Ze, I as Qe, L as $e, N as et, P as tt, Q as nt, V as rt, Y 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-KbmhF7rg.js";
4
+ import { t as _t } from "./readableTextColor-DhoK4XiZ.js";
5
+ import { t as vt } from "./CountdownBlock-WYz9b9Ex.js";
6
+ import { t as yt } from "./blockTypeIcons-D3CGFW5P.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-BST0yRor.js";
9
+ //#region src/utils/resolveAccessibilityOptions.ts
10
+ function Et(e) {
11
+ return {
12
+ ...e.accessibility,
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: ue,
48
+ title: ge,
49
+ paragraph: ne,
50
+ image: Se,
51
+ button: fe,
52
+ divider: Ve,
53
+ spacer: pe,
54
+ html: ce,
55
+ social: me,
56
+ menu: ye,
57
+ table: de,
58
+ video: Ie,
59
+ countdown: vt,
60
+ custom: oe
61
+ }, o = e, u = t, { t: f } = L(), { t: p } = je(), y = Be(se, "Canvas"), x = c(te, null), S = c(xe, null), A = c(re, {}), ee = h(() => (A.plan?.hasFeature("ai_generation") ?? !1) && (A.ai?.isFeatureEnabled("chat") ?? !1)), M = h(() => (A.plan?.hasFeature("ai_generation") ?? !1) && (A.ai?.isFeatureEnabled("designToTemplate") ?? !1)), N = h({
62
+ get: () => o.content.blocks,
63
+ set: (e) => {
64
+ y.setContent({
65
+ ...o.content,
66
+ blocks: e
67
+ });
68
+ }
69
+ }), P = h(() => {
70
+ switch (o.viewport) {
71
+ case "mobile": return 375;
72
+ case "tablet": return 768;
73
+ default: return o.content.settings.width;
74
+ }
75
+ }), F = h(() => ({ fontFamily: o.content.settings.fontFamily })), I = h(() => N.value.length === 0 && !o.previewMode), R = d(0), ie = h(() => I.value && R.value > 0);
76
+ function ae() {
77
+ I.value && (R.value += 1);
78
+ }
79
+ function le() {
80
+ I.value && (R.value = Math.max(0, R.value - 1));
81
+ }
82
+ function he() {
83
+ R.value = 0;
84
+ }
85
+ function _e(e) {
86
+ o.previewMode || e.target === e.currentTarget && u("select-block", null);
87
+ }
88
+ function z(e) {
89
+ return be(e, S, r);
90
+ }
91
+ function B(e) {
92
+ return o.lockedBlocks?.get(e) ?? null;
93
+ }
94
+ function ve(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: `${P.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(F.value),
123
+ onClick: _e
124
+ }, [j(v(D), {
125
+ modelValue: N.value,
126
+ "onUpdate:modelValue": r[2] ||= (e) => N.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 && ie.value ? "tpl-canvas-empty--drag-over tpl:border-[var(--tpl-primary-hover)] tpl:bg-[var(--tpl-primary-light)]" : "",
141
+ I.value && !ie.value ? "tpl:border-[var(--tpl-primary)]" : ""
142
+ ]),
143
+ onDragenter: ae,
144
+ onDragleave: le,
145
+ onDrop: he
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
+ ee.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(Ue), {
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
+ M.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(Je), {
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(N.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(Xe, {
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(z(t)), {
200
+ block: t,
201
+ viewport: e.viewport,
202
+ onFetchData: (e) => ve(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 } = je(), o = c(le, []), u = c(N, void 0), f = c(se, null), p = c(re, {}), 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
+ ], ee = h(() => {
269
+ let e = A.map((e) => ({
270
+ type: e,
271
+ label: he(e, t)
272
+ }));
273
+ return p.plan && e.splice(-1, 0, {
274
+ type: "countdown",
275
+ label: he("countdown", t)
276
+ }), e;
277
+ }), M = h(() => o.map((e) => ({
278
+ type: `custom:${e.type}`,
279
+ label: e.name,
280
+ isCustom: !0,
281
+ icon: e.icon
282
+ }))), P = h(() => [...ee.value, ...M.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 qe(n);
287
+ }
288
+ return De(e.type, u);
289
+ }
290
+ function I(e) {
291
+ if (!f) return;
292
+ let t = F(e);
293
+ f.addBlock(t), f.selectBlock(t.id);
294
+ }
295
+ function R(e, t) {
296
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), I(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) => I(e),
350
+ onKeydown: (t) => R(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(Fe, {
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 } = M(), 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
+ }) : We(n, p) ? t.push({
386
+ type: "logicMergeTag",
387
+ value: n,
388
+ keyword: Ne(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(Ee), {
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 = Be(we, "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(Ze), {
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(B), {
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(Ye), {
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
+ ee(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(Qe), {
903
+ key: 0,
904
+ size: 14,
905
+ "stroke-width": 2
906
+ })) : (a(), b(v($e), {
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(Le), {
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(He, []), y = c(_e, !1), x = u(/* @__PURE__ */ new Set()), T = d(!1), E = d(""), D = d(""), A = [
1006
+ {
1007
+ key: "desktop",
1008
+ icon: tt,
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 M(e) {
1023
+ x.has(e) ? x.delete(e) : x.add(e);
1024
+ }
1025
+ let N = h(() => p.length > 0 || y), P = h(() => r.block.displayCondition ? !p.some((e) => e.label === r.block.displayCondition?.label) : !1);
1026
+ function F() {
1027
+ T.value = !0, P.value && r.block.displayCondition ? (E.value = r.block.displayCondition.before, D.value = r.block.displayCondition.after ?? "") : (E.value = "", D.value = "");
1028
+ }
1029
+ function I() {
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
+ ee(() => r.block.displayCondition, (e) => {
1037
+ if (!e) {
1038
+ T.value = !1, E.value = "", D.value = "";
1039
+ return;
1040
+ }
1041
+ P.value && (E.value = e.before, D.value = e.after ?? "");
1042
+ }, { immediate: !0 });
1043
+ let R = 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 te(e, t) {
1052
+ o("update", { styles: {
1053
+ ...r.block.styles,
1054
+ [e]: t
1055
+ } });
1056
+ }
1057
+ function ne(e) {
1058
+ return r.block.visibility?.[e] !== !1;
1059
+ }
1060
+ function re(e) {
1061
+ let t = {
1062
+ desktop: ne("desktop"),
1063
+ tablet: ne("tablet"),
1064
+ mobile: ne("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) => M("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) => te("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) => te("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) => M("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) => te("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) => M("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: ne(e.key),
1115
+ onChange: (t) => re(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) => M("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
+ N.value ? (a(), b(kr, {
1140
+ key: 0,
1141
+ title: v(f).blockSettings.displayCondition,
1142
+ open: x.has("condition"),
1143
+ onToggle: r[11] ||= (e) => M("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 || P.value ? "__custom__" : e.block.displayCondition?.label ?? "",
1148
+ onChange: r[8] ||= (e) => {
1149
+ let t = e.target.value;
1150
+ if (t === "__custom__") {
1151
+ F();
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(R.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 || P.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: I
1190
+ }, m(v(f).blockSettings.applyCondition), 9, Gr)])
1191
+ ])) : e.block.displayCondition && !P.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(Qe), {
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(Qe), {
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(Te, 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(Oe), {
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(ke), {
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(le, []), u = h(() => l.find((e) => e.type === n.block.customType)), { isFetching: d, fetchError: f, fetch: p, hasDataSource: y, needsFetch: x } = Me({
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(ze), { size: 12 }), k(" " + m(v(o).customBlocks.dataSource.changeButton), 1)]))])), v(f) ? (a(), g("p", Mi, [j(v(F), {
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(Ye), {
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(Te, null), o = c(Ce, Re.liquid), s = R(), l = h(() => !!i), u = d(!1), f = d(!1), { start: p } = Ae(() => {
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(Oe), {
1774
+ size: 14,
1775
+ "stroke-width": 1.5
1776
+ }), k(" " + m(v(r).image.browseMedia), 1)])) : _("", !0)
1777
+ ]),
1778
+ v(Pe)(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: z(),
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(Ee), {
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
+ }), _a = { class: "tpl:mb-3.5" }, va = ["value"], ya = ["value"], ba = /* @__PURE__ */ A({
2042
+ __name: "SectionToolbar",
2043
+ props: { block: {} },
2044
+ emits: ["update"],
2045
+ setup(e, { emit: t }) {
2046
+ let n = t, { t: r } = L(), i = h(() => [
2047
+ {
2048
+ value: "1",
2049
+ label: r.section.column1
2050
+ },
2051
+ {
2052
+ value: "2",
2053
+ label: r.section.column2
2054
+ },
2055
+ {
2056
+ value: "3",
2057
+ label: r.section.column3
2058
+ },
2059
+ {
2060
+ value: "1-2",
2061
+ label: r.section.ratio12
2062
+ },
2063
+ {
2064
+ value: "2-1",
2065
+ label: r.section.ratio21
2066
+ }
2067
+ ]);
2068
+ return (t, o) => (a(), g("div", _a, [w("label", { class: C(v(G)) }, m(v(r).section.columns), 3), w("select", {
2069
+ class: C(v(W)),
2070
+ value: e.block.columns,
2071
+ onChange: o[0] ||= (e) => n("update", { columns: e.target.value })
2072
+ }, [(a(!0), g(O, null, s(i.value, (e) => (a(), g("option", {
2073
+ key: e.value,
2074
+ value: e.value
2075
+ }, m(e.label), 9, ya))), 128))], 42, va)]));
2076
+ }
2077
+ }), xa = { class: "tpl:mb-3.5" }, Sa = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Ca = { class: "tpl:flex tpl:items-center tpl:gap-2" }, wa = ["value", "onChange"], Ta = ["value"], Ea = ["title", "onClick"], Da = { class: "tpl:mb-3.5" }, Oa = ["value"], ka = { value: "solid" }, Aa = { value: "outlined" }, ja = { value: "rounded" }, Ma = { value: "square" }, Na = { value: "circle" }, Pa = { class: "tpl:mb-3.5" }, Fa = { class: "tpl:mb-3.5" }, Ia = { class: "tpl:flex tpl:items-stretch" }, La = ["value"], Ra = { class: "tpl:mb-3.5" }, za = /* @__PURE__ */ A({
2078
+ __name: "SocialToolbar",
2079
+ props: { block: {} },
2080
+ emits: ["update"],
2081
+ setup(e, { emit: t }) {
2082
+ let n = e, r = t, { t: i } = L();
2083
+ function o(e, t) {
2084
+ r("update", { [e]: t });
2085
+ }
2086
+ function c() {
2087
+ let e = {
2088
+ id: z(),
2089
+ platform: "facebook",
2090
+ url: ""
2091
+ };
2092
+ r("update", { icons: [...n.block.icons, e] });
2093
+ }
2094
+ function l(e, t, i) {
2095
+ r("update", { icons: n.block.icons.map((n) => n.id === e ? {
2096
+ ...n,
2097
+ [t]: i
2098
+ } : n) });
2099
+ }
2100
+ function u(e) {
2101
+ r("update", { icons: n.block.icons.filter((t) => t.id !== e) });
2102
+ }
2103
+ return (t, n) => (a(), g(O, null, [
2104
+ w("div", xa, [w("label", { class: C(v(G)) }, m(v(i).social.icons), 3), w("div", Sa, [(a(!0), g(O, null, s(e.block.icons, (e) => (a(), g("div", {
2105
+ key: e.id,
2106
+ 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"
2107
+ }, [w("div", Ca, [w("select", {
2108
+ "data-testid": "social-platform-select",
2109
+ class: C([v(W), "tpl:flex-1"]),
2110
+ value: e.platform,
2111
+ onChange: (t) => l(e.id, "platform", t.target.value)
2112
+ }, [(a(!0), g(O, null, s(v(ie), (e) => (a(), g("option", {
2113
+ key: e,
2114
+ value: e
2115
+ }, m(v(I)[e].name), 9, Ta))), 128))], 42, wa), w("button", {
2116
+ class: C(v(bt)),
2117
+ title: v(i).social.removeIcon,
2118
+ onClick: (t) => u(e.id)
2119
+ }, [j(v(Ee), {
2120
+ size: 14,
2121
+ "stroke-width": 2
2122
+ })], 10, Ea)]), j(Z, {
2123
+ "model-value": e.url,
2124
+ type: "url",
2125
+ placeholder: v(i).social.urlPlaceholder,
2126
+ "onUpdate:modelValue": (t) => l(e.id, "url", t)
2127
+ }, null, 8, [
2128
+ "model-value",
2129
+ "placeholder",
2130
+ "onUpdate:modelValue"
2131
+ ])]))), 128)), w("button", {
2132
+ class: C(v(xt)),
2133
+ onClick: c
2134
+ }, [j(v(H), {
2135
+ size: 14,
2136
+ "stroke-width": 2
2137
+ }), k(" " + m(v(i).social.addIcon), 1)], 2)])]),
2138
+ w("div", Da, [w("label", { class: C(v(G)) }, m(v(i).social.style), 3), w("select", {
2139
+ class: C(v(W)),
2140
+ value: e.block.iconStyle,
2141
+ onChange: n[0] ||= (e) => o("iconStyle", e.target.value)
2142
+ }, [
2143
+ w("option", ka, m(v(i).social.styleSolid), 1),
2144
+ w("option", Aa, m(v(i).social.styleOutlined), 1),
2145
+ w("option", ja, m(v(i).social.styleRounded), 1),
2146
+ w("option", Ma, m(v(i).social.styleSquare), 1),
2147
+ w("option", Na, m(v(i).social.styleCircle), 1)
2148
+ ], 42, Oa)]),
2149
+ w("div", Pa, [w("label", { class: C(v(G)) }, m(v(i).social.size), 3), j(X, {
2150
+ options: [
2151
+ {
2152
+ value: "small",
2153
+ label: v(i).social.sizeSmall
2154
+ },
2155
+ {
2156
+ value: "medium",
2157
+ label: v(i).social.sizeMedium
2158
+ },
2159
+ {
2160
+ value: "large",
2161
+ label: v(i).social.sizeLarge
2162
+ }
2163
+ ],
2164
+ "model-value": e.block.iconSize,
2165
+ "onUpdate:modelValue": n[1] ||= (e) => o("iconSize", e)
2166
+ }, null, 8, ["options", "model-value"])]),
2167
+ w("div", Fa, [w("label", { class: C(v(G)) }, m(v(i).social.spacing), 3), w("div", Ia, [w("input", {
2168
+ type: "number",
2169
+ class: C(v(q)),
2170
+ value: e.block.spacing,
2171
+ min: "0",
2172
+ max: "50",
2173
+ onInput: n[2] ||= (e) => o("spacing", Number(e.target.value))
2174
+ }, null, 42, La), w("span", { class: C(v(K)) }, "px", 2)])]),
2175
+ w("div", Ra, [w("label", { class: C(v(G)) }, m(v(i).social.align), 3), j(X, {
2176
+ options: [
2177
+ {
2178
+ value: "left",
2179
+ label: v(i).title.alignLeft,
2180
+ icon: v(ft)
2181
+ },
2182
+ {
2183
+ value: "center",
2184
+ label: v(i).title.alignCenter,
2185
+ icon: v(at)
2186
+ },
2187
+ {
2188
+ value: "right",
2189
+ label: v(i).title.alignRight,
2190
+ icon: v(pt)
2191
+ }
2192
+ ],
2193
+ "model-value": e.block.align,
2194
+ "onUpdate:modelValue": n[3] ||= (e) => o("align", e)
2195
+ }, null, 8, ["options", "model-value"])])
2196
+ ], 64));
2197
+ }
2198
+ }), Ba = { class: "tpl:mb-3.5" }, Va = { class: "tpl:flex tpl:items-stretch" }, Ha = ["value"], Ua = ["value"], Wa = /* @__PURE__ */ A({
2199
+ __name: "SpacerToolbar",
2200
+ props: { block: {} },
2201
+ emits: ["update"],
2202
+ setup(e, { emit: t }) {
2203
+ let n = t, { t: r } = L();
2204
+ return (t, i) => (a(), g("div", Ba, [
2205
+ w("label", { class: C(v(G)) }, m(v(r).spacer.height), 3),
2206
+ w("div", Va, [w("input", {
2207
+ type: "number",
2208
+ class: C(v(q)),
2209
+ value: e.block.height,
2210
+ min: "10",
2211
+ max: "100",
2212
+ onInput: i[0] ||= (e) => n("update", { height: Number(e.target.value) })
2213
+ }, null, 42, Ha), w("span", { class: C(v(K)) }, "px", 2)]),
2214
+ w("input", {
2215
+ type: "range",
2216
+ class: "tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",
2217
+ value: e.block.height,
2218
+ min: "10",
2219
+ max: "100",
2220
+ onInput: i[1] ||= (e) => n("update", { height: Number(e.target.value) })
2221
+ }, null, 40, Ua)
2222
+ ]));
2223
+ }
2224
+ }), Ga = { class: "tpl:mb-3.5" }, Ka = { class: "tpl:flex tpl:items-center tpl:gap-3" }, qa = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, Ja = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Ya = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, Xa = ["disabled"], Za = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, Qa = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, $a = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, eo = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, to = ["disabled"], no = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, ro = { class: "tpl:mb-3.5" }, io = { 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)]" }, ao = ["checked"], oo = {
2225
+ key: 0,
2226
+ class: "tpl:mb-3.5"
2227
+ }, so = { class: "tpl:mb-3.5" }, co = { class: "tpl:mb-3.5" }, lo = { class: "tpl:flex tpl:items-stretch" }, uo = ["value"], fo = { class: "tpl:mb-3.5" }, po = { class: "tpl:flex tpl:items-stretch" }, mo = ["value"], ho = { class: "tpl:mb-3.5" }, go = ["value"], _o = { value: "" }, vo = ["value"], yo = { class: "tpl:mb-3.5" }, bo = { class: "tpl:flex tpl:items-stretch" }, xo = ["value"], So = { class: "tpl:mb-3.5" }, Co = { class: "tpl:mb-3.5" }, wo = /* @__PURE__ */ A({
2228
+ __name: "TableToolbar",
2229
+ props: {
2230
+ block: {},
2231
+ fontFamilies: {}
2232
+ },
2233
+ emits: ["update"],
2234
+ setup(e, { emit: t }) {
2235
+ let n = e, r = t, { t: i } = L(), o = h(() => n.block.rows.length > 0 ? n.block.rows[0].cells.length : 0);
2236
+ function c(e, t) {
2237
+ r("update", { [e]: t });
2238
+ }
2239
+ function l() {
2240
+ let e = n.block.rows.length > 0 ? n.block.rows[0].cells.length : 3, t = {
2241
+ id: z(),
2242
+ cells: Array.from({ length: e }, () => ({
2243
+ id: z(),
2244
+ content: ""
2245
+ }))
2246
+ };
2247
+ r("update", { rows: [...n.block.rows, t] });
2248
+ }
2249
+ function u(e) {
2250
+ r("update", { rows: n.block.rows.filter((t) => t.id !== e) });
2251
+ }
2252
+ function d() {
2253
+ r("update", { rows: n.block.rows.map((e) => ({
2254
+ ...e,
2255
+ cells: [...e.cells, {
2256
+ id: z(),
2257
+ content: ""
2258
+ }]
2259
+ })) });
2260
+ }
2261
+ function f(e) {
2262
+ r("update", { rows: n.block.rows.map((t) => ({
2263
+ ...t,
2264
+ cells: t.cells.filter((t, n) => n !== e)
2265
+ })) });
2266
+ }
2267
+ return (t, n) => (a(), g(O, null, [
2268
+ w("div", Ga, [w("label", { class: C(v(G)) }, m(v(i).table.dimensions), 3), w("div", Ka, [w("div", qa, [w("span", Ja, m(v(i).table.rows), 1), w("div", Ya, [
2269
+ w("button", {
2270
+ 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",
2271
+ disabled: e.block.rows.length <= 1,
2272
+ onClick: n[0] ||= (t) => u(e.block.rows[e.block.rows.length - 1].id)
2273
+ }, [j(v(U), {
2274
+ size: 12,
2275
+ "stroke-width": 2
2276
+ })], 8, Xa),
2277
+ w("span", Za, m(e.block.rows.length), 1),
2278
+ w("button", {
2279
+ 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)]",
2280
+ onClick: l
2281
+ }, [j(v(H), {
2282
+ size: 12,
2283
+ "stroke-width": 2
2284
+ })])
2285
+ ])]), w("div", Qa, [w("span", $a, m(v(i).table.columns), 1), w("div", eo, [
2286
+ w("button", {
2287
+ 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",
2288
+ disabled: o.value <= 1,
2289
+ onClick: n[1] ||= (e) => f(o.value - 1)
2290
+ }, [j(v(U), {
2291
+ size: 12,
2292
+ "stroke-width": 2
2293
+ })], 8, to),
2294
+ w("span", no, m(o.value), 1),
2295
+ w("button", {
2296
+ 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)]",
2297
+ onClick: d
2298
+ }, [j(v(H), {
2299
+ size: 12,
2300
+ "stroke-width": 2
2301
+ })])
2302
+ ])])])]),
2303
+ w("div", ro, [w("label", io, [w("input", {
2304
+ type: "checkbox",
2305
+ checked: e.block.hasHeaderRow,
2306
+ class: "tpl:accent-[var(--tpl-primary)]",
2307
+ onChange: n[2] ||= (e) => c("hasHeaderRow", e.target.checked)
2308
+ }, null, 40, ao), k(" " + m(v(i).table.hasHeaderRow), 1)])]),
2309
+ e.block.hasHeaderRow ? (a(), g("div", oo, [w("label", { class: C(v(G)) }, m(v(i).table.headerBackgroundColor), 3), j(J, {
2310
+ "model-value": e.block.headerBackgroundColor || v("#f2f2f2"),
2311
+ placeholder: v(i).table.noHeaderBg,
2312
+ "onUpdate:modelValue": n[3] ||= (e) => c("headerBackgroundColor", e || null)
2313
+ }, null, 8, ["model-value", "placeholder"])])) : _("", !0),
2314
+ w("div", so, [w("label", { class: C(v(G)) }, m(v(i).table.borderColor), 3), j(J, {
2315
+ "model-value": e.block.borderColor,
2316
+ "onUpdate:modelValue": n[4] ||= (e) => c("borderColor", e)
2317
+ }, null, 8, ["model-value"])]),
2318
+ w("div", co, [w("label", { class: C(v(G)) }, m(v(i).table.borderWidth), 3), w("div", lo, [w("input", {
2319
+ type: "number",
2320
+ class: C(v(q)),
2321
+ value: e.block.borderWidth,
2322
+ min: "0",
2323
+ max: "10",
2324
+ onInput: n[5] ||= (e) => c("borderWidth", Number(e.target.value))
2325
+ }, null, 42, uo), w("span", { class: C(v(K)) }, "px", 2)])]),
2326
+ w("div", fo, [w("label", { class: C(v(G)) }, m(v(i).table.cellPadding), 3), w("div", po, [w("input", {
2327
+ type: "number",
2328
+ class: C(v(q)),
2329
+ value: e.block.cellPadding,
2330
+ min: "0",
2331
+ max: "30",
2332
+ onInput: n[6] ||= (e) => c("cellPadding", Number(e.target.value))
2333
+ }, null, 42, mo), w("span", { class: C(v(K)) }, "px", 2)])]),
2334
+ w("div", ho, [w("label", { class: C(v(G)) }, m(v(i).table.fontFamily), 3), w("select", {
2335
+ class: C(v(W)),
2336
+ value: e.block.fontFamily || "",
2337
+ onChange: n[7] ||= (e) => c("fontFamily", e.target.value || void 0)
2338
+ }, [w("option", _o, m(v(i).title.inheritFont), 1), (a(!0), g(O, null, s(e.fontFamilies, (e) => (a(), g("option", {
2339
+ key: e.value,
2340
+ value: e.value
2341
+ }, m(e.label), 9, vo))), 128))], 42, go)]),
2342
+ w("div", yo, [w("label", { class: C(v(G)) }, m(v(i).table.fontSize), 3), w("div", bo, [w("input", {
2343
+ type: "number",
2344
+ class: C(v(q)),
2345
+ value: e.block.fontSize,
2346
+ min: "10",
2347
+ max: "32",
2348
+ onInput: n[8] ||= (e) => c("fontSize", Number(e.target.value))
2349
+ }, null, 42, xo), w("span", { class: C(v(K)) }, "px", 2)])]),
2350
+ w("div", So, [w("label", { class: C(v(G)) }, m(v(i).table.color), 3), j(J, {
2351
+ "model-value": e.block.color,
2352
+ "onUpdate:modelValue": n[9] ||= (e) => c("color", e)
2353
+ }, null, 8, ["model-value"])]),
2354
+ w("div", Co, [w("label", { class: C(v(G)) }, m(v(i).table.textAlign), 3), j(X, {
2355
+ options: [
2356
+ {
2357
+ value: "left",
2358
+ label: v(i).title.alignLeft,
2359
+ icon: v(ft)
2360
+ },
2361
+ {
2362
+ value: "center",
2363
+ label: v(i).title.alignCenter,
2364
+ icon: v(at)
2365
+ },
2366
+ {
2367
+ value: "right",
2368
+ label: v(i).title.alignRight,
2369
+ icon: v(pt)
2370
+ }
2371
+ ],
2372
+ "model-value": e.block.textAlign,
2373
+ "onUpdate:modelValue": n[10] ||= (e) => c("textAlign", e)
2374
+ }, null, 8, ["options", "model-value"])])
2375
+ ], 64));
2376
+ }
2377
+ }), To = { class: "tpl:mb-3.5" }, Eo = ["value"], Do = { value: 1 }, Oo = { value: 2 }, ko = { value: 3 }, Ao = { value: 4 }, jo = { class: "tpl:mb-3.5" }, Mo = ["value"], No = { value: "" }, Po = ["value"], Fo = { class: "tpl:mb-3.5" }, Io = { class: "tpl:mb-3.5" }, Lo = /* @__PURE__ */ A({
2378
+ __name: "TitleToolbar",
2379
+ props: {
2380
+ block: {},
2381
+ fontFamilies: {}
2382
+ },
2383
+ emits: ["update"],
2384
+ setup(e, { emit: t }) {
2385
+ let n = t, { t: r } = L();
2386
+ function i(e, t) {
2387
+ n("update", { [e]: t });
2388
+ }
2389
+ return (t, n) => (a(), g(O, null, [
2390
+ w("div", To, [w("label", { class: C(v(G)) }, m(v(r).title.level), 3), w("select", {
2391
+ class: C(v(W)),
2392
+ value: e.block.level,
2393
+ onChange: n[0] ||= (e) => i("level", Number(e.target.value))
2394
+ }, [
2395
+ w("option", Do, m(v(r).title.heading1), 1),
2396
+ w("option", Oo, m(v(r).title.heading2), 1),
2397
+ w("option", ko, m(v(r).title.heading3), 1),
2398
+ w("option", Ao, m(v(r).title.heading4), 1)
2399
+ ], 42, Eo)]),
2400
+ w("div", jo, [w("label", { class: C(v(G)) }, m(v(r).title.fontFamily), 3), w("select", {
2401
+ class: C(v(W)),
2402
+ value: e.block.fontFamily || "",
2403
+ onChange: n[1] ||= (e) => i("fontFamily", e.target.value || void 0)
2404
+ }, [w("option", No, m(v(r).title.inheritFont), 1), (a(!0), g(O, null, s(e.fontFamilies, (e) => (a(), g("option", {
2405
+ key: e.value,
2406
+ value: e.value
2407
+ }, m(e.label), 9, Po))), 128))], 42, Mo)]),
2408
+ w("div", Fo, [w("label", { class: C(v(G)) }, m(v(r).title.color), 3), j(J, {
2409
+ "model-value": e.block.color,
2410
+ "onUpdate:modelValue": n[2] ||= (e) => i("color", e)
2411
+ }, null, 8, ["model-value"])]),
2412
+ w("div", Io, [w("label", { class: C(v(G)) }, m(v(r).title.align), 3), j(X, {
2413
+ options: [
2414
+ {
2415
+ value: "left",
2416
+ label: v(r).title.alignLeft,
2417
+ icon: v(ft)
2418
+ },
2419
+ {
2420
+ value: "center",
2421
+ label: v(r).title.alignCenter,
2422
+ icon: v(at)
2423
+ },
2424
+ {
2425
+ value: "right",
2426
+ label: v(r).title.alignRight,
2427
+ icon: v(pt)
2428
+ }
2429
+ ],
2430
+ "model-value": e.block.textAlign,
2431
+ "onUpdate:modelValue": n[3] ||= (e) => i("textAlign", e)
2432
+ }, null, 8, ["options", "model-value"])])
2433
+ ], 64));
2434
+ }
2435
+ }), Ro = { class: "tpl:mb-3.5" }, zo = {
2436
+ key: 0,
2437
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
2438
+ }, Bo = ["checked"], Vo = {
2439
+ key: 0,
2440
+ class: "tpl:mb-3.5"
2441
+ }, Ho = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, Uo = [
2442
+ "value",
2443
+ "placeholder",
2444
+ "title"
2445
+ ], Wo = { class: "tpl:mb-3.5" }, Go = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, Ko = { class: "tpl:mb-3.5" }, qo = { class: "tpl:mb-3.5" }, Jo = ["value"], Yo = { value: "full" }, Xo = { class: "tpl:mb-3.5" }, Zo = /* @__PURE__ */ A({
2446
+ __name: "VideoToolbar",
2447
+ props: { block: {} },
2448
+ emits: ["update"],
2449
+ setup(e, { emit: t }) {
2450
+ let n = e, r = t, { t: i } = L(), o = c(Te, null), s = c(Ce, Re.liquid), l = R(), u = h(() => !!o), f = h(() => Pe(n.block.url, s)), p = d(!1), { start: y } = Ae(() => {
2451
+ p.value = !1;
2452
+ }, 1e3, { immediate: !1 });
2453
+ function b(e, t) {
2454
+ r("update", { [e]: t });
2455
+ }
2456
+ async function x() {
2457
+ let e = await o?.({ accept: ["images"] });
2458
+ l.alive && e && (b("thumbnailUrl", e.url), p.value = !0, y());
2459
+ }
2460
+ return (t, n) => (a(), g(O, null, [
2461
+ w("div", Ro, [
2462
+ w("label", { class: C(v(G)) }, m(v(i).video.videoUrl), 3),
2463
+ j(Z, {
2464
+ "model-value": e.block.url,
2465
+ type: "url",
2466
+ placeholder: v(i).video.videoUrlPlaceholder,
2467
+ "onUpdate:modelValue": n[0] ||= (e) => b("url", e)
2468
+ }, null, 8, ["model-value", "placeholder"]),
2469
+ e.block.url ? (a(), g("label", zo, [w("input", {
2470
+ type: "checkbox",
2471
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
2472
+ checked: e.block.openInNewTab ?? !1,
2473
+ onChange: n[1] ||= (e) => b("openInNewTab", e.target.checked)
2474
+ }, null, 40, Bo), k(" " + m(v(i).video.openInNewTab), 1)])) : _("", !0)
2475
+ ]),
2476
+ f.value ? (a(), g("div", Vo, [w("label", { class: C(v(G)) }, [k(m(v(i).video.placeholderUrl) + " ", 1), w("span", Ho, m(v(i).video.optional), 1)], 2), w("input", {
2477
+ type: "url",
2478
+ class: C(v(W)),
2479
+ value: e.block.placeholderUrl || "",
2480
+ placeholder: v(i).video.placeholderUrlPlaceholder,
2481
+ title: v(i).video.placeholderUrlTooltip,
2482
+ onInput: n[2] ||= (e) => b("placeholderUrl", e.target.value)
2483
+ }, null, 42, Uo)])) : _("", !0),
2484
+ w("div", Wo, [
2485
+ w("label", { class: C(v(G)) }, [k(m(v(i).video.customThumbnail) + " ", 1), w("span", Go, m(v(i).video.optional), 1)], 2),
2486
+ j(Z, {
2487
+ "model-value": e.block.thumbnailUrl,
2488
+ type: "url",
2489
+ placeholder: v(i).video.thumbnailPlaceholder,
2490
+ pulse: p.value,
2491
+ "onUpdate:modelValue": n[3] ||= (e) => b("thumbnailUrl", e)
2492
+ }, null, 8, [
2493
+ "model-value",
2494
+ "placeholder",
2495
+ "pulse"
2496
+ ]),
2497
+ u.value ? (a(), g("button", {
2498
+ key: 0,
2499
+ 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",
2500
+ style: {
2501
+ "border-color": "var(--tpl-border)",
2502
+ color: "var(--tpl-primary)",
2503
+ "background-color": "var(--tpl-bg)"
2504
+ },
2505
+ onClick: x
2506
+ }, [j(v(Oe), {
2507
+ size: 14,
2508
+ "stroke-width": 1.5
2509
+ }), k(" " + m(v(i).image.browseMedia), 1)])) : _("", !0)
2510
+ ]),
2511
+ w("div", Ko, [w("label", { class: C(v(G)) }, m(v(i).video.altText), 3), j(Z, {
2512
+ "model-value": e.block.alt,
2513
+ type: "text",
2514
+ placeholder: v(i).video.altTextPlaceholder,
2515
+ "onUpdate:modelValue": n[4] ||= (e) => b("alt", e)
2516
+ }, null, 8, ["model-value", "placeholder"])]),
2517
+ w("div", qo, [w("label", { class: C(v(G)) }, m(v(i).video.width), 3), w("select", {
2518
+ class: C(v(W)),
2519
+ value: e.block.width,
2520
+ onChange: n[5] ||= (e) => b("width", e.target.value === "full" ? "full" : Number(e.target.value))
2521
+ }, [
2522
+ w("option", Yo, m(v(i).video.fullWidth), 1),
2523
+ n[7] ||= w("option", { value: "300" }, "300px", -1),
2524
+ n[8] ||= w("option", { value: "400" }, "400px", -1),
2525
+ n[9] ||= w("option", { value: "500" }, "500px", -1)
2526
+ ], 42, Jo)]),
2527
+ w("div", Xo, [w("label", { class: C(v(G)) }, m(v(i).title.align), 3), j(X, {
2528
+ options: [
2529
+ {
2530
+ value: "left",
2531
+ label: v(i).title.alignLeft
2532
+ },
2533
+ {
2534
+ value: "center",
2535
+ label: v(i).title.alignCenter
2536
+ },
2537
+ {
2538
+ value: "right",
2539
+ label: v(i).title.alignRight
2540
+ }
2541
+ ],
2542
+ "model-value": e.block.align,
2543
+ "onUpdate:modelValue": n[6] ||= (e) => b("align", e)
2544
+ }, null, 8, ["options", "model-value"])])
2545
+ ], 64));
2546
+ }
2547
+ }), Qo = ["aria-label"], $o = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5" }, es = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]" }, ts = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, ns = { class: "tpl:flex tpl:gap-1" }, rs = ["title"], is = ["title"], as = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, os = /* @__PURE__ */ V(/* @__PURE__ */ A({
2548
+ __name: "Toolbar",
2549
+ props: { block: {} },
2550
+ emits: [
2551
+ "update",
2552
+ "delete",
2553
+ "duplicate"
2554
+ ],
2555
+ setup(e, { emit: t }) {
2556
+ let n = f(() => import("./CountdownToolbar-B9fPfFqp.js")), r = e, o = t, { t: s } = L(), l = Be(we, "Toolbar"), u = c(le, []), d = h(() => r.block.type), p = h(() => Ge(r.block)), y = h(() => {
2557
+ if (p.value) return u.find((e) => e.type === r.block.customType);
2558
+ }), x = h(() => p.value ? y.value?.name ?? r.block.customType : he(d.value, s)), S = l.fonts;
2559
+ function C(e) {
2560
+ o("update", e);
2561
+ }
2562
+ return (t, r) => (a(), g("aside", {
2563
+ "aria-label": v(s).landmarks.blockToolbar,
2564
+ class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"
2565
+ }, [w("div", $o, [w("div", es, [v(yt)[d.value] ? (a(), b(i(v(yt)[d.value]), {
2566
+ key: 0,
2567
+ size: 16,
2568
+ "stroke-width": 1.5
2569
+ })) : p.value ? (a(), b(v(ve), {
2570
+ key: 1,
2571
+ size: 16,
2572
+ "stroke-width": 1.5
2573
+ })) : _("", !0), w("h3", ts, m(x.value), 1)]), w("div", ns, [w("button", {
2574
+ 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)]",
2575
+ title: v(s).toolbar.duplicate,
2576
+ onClick: r[0] ||= (e) => o("duplicate")
2577
+ }, [j(v(Ke), {
2578
+ size: 14,
2579
+ "stroke-width": 2
2580
+ })], 8, rs), w("button", {
2581
+ 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)]",
2582
+ title: v(s).toolbar.delete,
2583
+ onClick: r[1] ||= (e) => o("delete")
2584
+ }, [j(v(ke), {
2585
+ size: 14,
2586
+ "stroke-width": 2
2587
+ })], 8, is)])]), w("div", as, [p.value ? (a(), b(Ni, {
2588
+ key: 0,
2589
+ block: e.block,
2590
+ onUpdateFieldValues: r[2] ||= (e) => o("update", { fieldValues: e }),
2591
+ onUpdateDataSourceFetched: r[3] ||= (e) => o("update", { dataSourceFetched: e })
2592
+ }, null, 8, ["block"])) : d.value === "section" ? (a(), b(ba, {
2593
+ key: 1,
2594
+ block: e.block,
2595
+ onUpdate: C
2596
+ }, null, 8, ["block"])) : d.value === "title" ? (a(), b(Lo, {
2597
+ key: 2,
2598
+ block: e.block,
2599
+ "font-families": v(S),
2600
+ onUpdate: C
2601
+ }, null, 8, ["block", "font-families"])) : d.value === "paragraph" ? (a(), g(O, { key: 3 }, [], 64)) : d.value === "image" ? (a(), b(ia, {
2602
+ key: 4,
2603
+ block: e.block,
2604
+ onUpdate: C
2605
+ }, null, 8, ["block"])) : d.value === "video" ? (a(), b(Zo, {
2606
+ key: 5,
2607
+ block: e.block,
2608
+ onUpdate: C
2609
+ }, null, 8, ["block"])) : d.value === "button" ? (a(), b(ir, {
2610
+ key: 6,
2611
+ block: e.block,
2612
+ "font-families": v(S),
2613
+ onUpdate: C
2614
+ }, null, 8, ["block", "font-families"])) : d.value === "divider" ? (a(), b(zi, {
2615
+ key: 7,
2616
+ block: e.block,
2617
+ onUpdate: C
2618
+ }, null, 8, ["block"])) : d.value === "social" ? (a(), b(za, {
2619
+ key: 8,
2620
+ block: e.block,
2621
+ onUpdate: C
2622
+ }, null, 8, ["block"])) : d.value === "menu" ? (a(), b(ga, {
2623
+ key: 9,
2624
+ block: e.block,
2625
+ "font-families": v(S),
2626
+ onUpdate: C
2627
+ }, null, 8, ["block", "font-families"])) : d.value === "table" ? (a(), b(wo, {
2628
+ key: 10,
2629
+ block: e.block,
2630
+ "font-families": v(S),
2631
+ onUpdate: C
2632
+ }, null, 8, ["block", "font-families"])) : d.value === "spacer" ? (a(), b(Wa, {
2633
+ key: 11,
2634
+ block: e.block,
2635
+ onUpdate: C
2636
+ }, null, 8, ["block"])) : d.value === "html" ? (a(), b(Ui, {
2637
+ key: 12,
2638
+ block: e.block,
2639
+ onUpdate: C
2640
+ }, null, 8, ["block"])) : d.value === "countdown" ? (a(), b(v(n), {
2641
+ key: 13,
2642
+ block: e.block,
2643
+ "font-families": v(S),
2644
+ onUpdate: C
2645
+ }, null, 8, ["block", "font-families"])) : _("", !0), j(Xr, {
2646
+ block: e.block,
2647
+ "is-first-section": d.value === "paragraph",
2648
+ onUpdate: C
2649
+ }, null, 8, ["block", "is-first-section"])])], 8, Qo));
2650
+ }
2651
+ }), [["__scopeId", "data-v-2ac88283"]]), ss = ["aria-label"], cs = {
2652
+ role: "tablist",
2653
+ 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"
2654
+ }, ls = [
2655
+ "aria-selected",
2656
+ "aria-label",
2657
+ "title"
2658
+ ], us = { key: 0 }, ds = [
2659
+ "aria-selected",
2660
+ "aria-label",
2661
+ "title"
2662
+ ], fs = { key: 0 }, ps = [
2663
+ "aria-selected",
2664
+ "aria-label",
2665
+ "title"
2666
+ ], ms = { key: 0 }, hs = {
2667
+ key: 1,
2668
+ class: "tpl:ml-1 tpl:rounded-full tpl:bg-[var(--tpl-bg-hover)] tpl:px-1.5 tpl:text-[10px]"
2669
+ }, gs = {
2670
+ key: 0,
2671
+ id: "tpl-tabpanel-content",
2672
+ role: "tabpanel",
2673
+ "aria-labelledby": "tpl-tab-content",
2674
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
2675
+ }, _s = {
2676
+ key: 1,
2677
+ 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)]"
2678
+ }, vs = { class: "tpl:mb-4 tpl:text-[var(--tpl-text-dim)]" }, ys = { class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, bs = { class: "tpl:m-0 tpl:text-sm tpl:leading-normal" }, xs = {
2679
+ key: 1,
2680
+ id: "tpl-tabpanel-settings",
2681
+ role: "tabpanel",
2682
+ "aria-labelledby": "tpl-tab-settings",
2683
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
2684
+ }, Ss = {
2685
+ key: 2,
2686
+ id: "tpl-tabpanel-accessibility",
2687
+ role: "tabpanel",
2688
+ "aria-labelledby": "tpl-tab-accessibility",
2689
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
2690
+ }, Cs = /* @__PURE__ */ A({
2691
+ __name: "RightSidebar",
2692
+ props: {
2693
+ selectedBlock: {},
2694
+ settings: {},
2695
+ shiftedLeft: { type: Boolean }
2696
+ },
2697
+ emits: [
2698
+ "update-block",
2699
+ "delete-block",
2700
+ "duplicate-block",
2701
+ "update-settings"
2702
+ ],
2703
+ setup(e, { emit: t }) {
2704
+ let n = f(() => import("./AccessibilityPanel-CQt87OMk.js")), r = e, i = t, { t: o } = L(), s = d("content"), l = c(ae, null), u = h(() => l !== null), p = h(() => l?.issues.value.length ?? 0);
2705
+ function y(e) {
2706
+ 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)]";
2707
+ }
2708
+ function x(e) {
2709
+ return s.value === e ? {
2710
+ backgroundColor: "var(--tpl-bg)",
2711
+ boxShadow: "var(--tpl-shadow-md)"
2712
+ } : { backgroundColor: "transparent" };
2713
+ }
2714
+ return ee(() => r.selectedBlock, (e) => {
2715
+ e && (s.value = "content");
2716
+ }), (t, r) => (a(), g("aside", {
2717
+ "aria-label": v(o).landmarks.rightSidebar,
2718
+ 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"])
2719
+ }, [
2720
+ w("div", cs, [
2721
+ w("button", {
2722
+ id: "tpl-tab-content",
2723
+ role: "tab",
2724
+ "aria-selected": s.value === "content",
2725
+ "aria-controls": "tpl-tabpanel-content",
2726
+ "aria-label": v(o).sidebar.content,
2727
+ title: v(o).sidebar.content,
2728
+ 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")]),
2729
+ style: E(x("content")),
2730
+ onClick: r[0] ||= (e) => s.value = "content"
2731
+ }, [j(v(ut), {
2732
+ size: 14,
2733
+ "stroke-width": 2
2734
+ }), s.value === "content" ? (a(), g("span", us, m(v(o).sidebar.content), 1)) : _("", !0)], 14, ls),
2735
+ w("button", {
2736
+ id: "tpl-tab-settings",
2737
+ role: "tab",
2738
+ "aria-selected": s.value === "settings",
2739
+ "aria-controls": "tpl-tabpanel-settings",
2740
+ "aria-label": v(o).sidebar.settings,
2741
+ title: v(o).sidebar.settings,
2742
+ 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")]),
2743
+ style: E(x("settings")),
2744
+ onClick: r[1] ||= (e) => s.value = "settings"
2745
+ }, [j(v(gt), {
2746
+ size: 14,
2747
+ "stroke-width": 1.5
2748
+ }), s.value === "settings" ? (a(), g("span", fs, m(v(o).sidebar.settings), 1)) : _("", !0)], 14, ds),
2749
+ u.value ? (a(), g("button", {
2750
+ key: 0,
2751
+ id: "tpl-tab-accessibility",
2752
+ role: "tab",
2753
+ "aria-selected": s.value === "accessibility",
2754
+ "aria-controls": "tpl-tabpanel-accessibility",
2755
+ "aria-label": v(o).accessibility.panelTabLabel,
2756
+ title: v(o).accessibility.panelTabLabel,
2757
+ 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("accessibility")]),
2758
+ style: E(x("accessibility")),
2759
+ onClick: r[2] ||= (e) => s.value = "accessibility"
2760
+ }, [
2761
+ j(v(nt), {
2762
+ size: 14,
2763
+ "stroke-width": 1.5
2764
+ }),
2765
+ s.value === "accessibility" ? (a(), g("span", ms, m(v(o).accessibility.panelTabLabel), 1)) : _("", !0),
2766
+ p.value > 0 ? (a(), g("span", hs, m(p.value), 1)) : _("", !0)
2767
+ ], 14, ps)) : _("", !0)
2768
+ ]),
2769
+ s.value === "content" ? (a(), g("div", gs, [e.selectedBlock ? (a(), b(os, {
2770
+ key: 0,
2771
+ block: e.selectedBlock,
2772
+ onUpdate: r[3] ||= (e) => i("update-block", e),
2773
+ onDelete: r[4] ||= (e) => i("delete-block"),
2774
+ onDuplicate: r[5] ||= (e) => i("duplicate-block")
2775
+ }, null, 8, ["block"])) : (a(), g("div", _s, [
2776
+ w("div", vs, [j(v(rt), {
2777
+ size: 40,
2778
+ "stroke-width": 1.5
2779
+ })]),
2780
+ w("h3", ys, m(v(o).sidebar.noSelection), 1),
2781
+ w("p", bs, m(v(o).sidebar.noSelectionHint), 1)
2782
+ ]))])) : _("", !0),
2783
+ s.value === "settings" ? (a(), g("div", xs, [j(Fn, {
2784
+ settings: e.settings,
2785
+ onUpdate: r[6] ||= (e) => i("update-settings", e)
2786
+ }, null, 8, ["settings"])])) : _("", !0),
2787
+ s.value === "accessibility" && u.value ? (a(), g("div", Ss, [j(v(n))])) : _("", !0)
2788
+ ], 10, ss));
2789
+ }
2790
+ }), ws = ["aria-label"], Ts = [
2791
+ "aria-checked",
2792
+ "aria-label",
2793
+ "title",
2794
+ "onClick"
2795
+ ], Es = /* @__PURE__ */ A({
2796
+ __name: "ViewportToggle",
2797
+ props: { viewport: {} },
2798
+ emits: ["change"],
2799
+ setup(e, { emit: t }) {
2800
+ let n = e, r = t, { t: i } = L(), o = h(() => [
2801
+ {
2802
+ value: "desktop",
2803
+ label: i.viewport.desktop
2804
+ },
2805
+ {
2806
+ value: "tablet",
2807
+ label: i.viewport.tablet
2808
+ },
2809
+ {
2810
+ value: "mobile",
2811
+ label: i.viewport.mobile
2812
+ }
2813
+ ]), c = h(() => `translateX(${o.value.findIndex((e) => e.value === n.viewport) * 100}%)`);
2814
+ return (t, n) => (a(), g("div", {
2815
+ role: "radiogroup",
2816
+ "aria-label": v(i).viewport.label,
2817
+ class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
2818
+ style: E({
2819
+ gridTemplateColumns: `repeat(${o.value.length}, 1fr)`,
2820
+ backgroundColor: "var(--tpl-bg-hover)"
2821
+ })
2822
+ }, [w("div", {
2823
+ class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
2824
+ style: E({
2825
+ left: "4px",
2826
+ width: `calc((100% - 8px) / ${o.value.length})`,
2827
+ transform: c.value,
2828
+ backgroundColor: "var(--tpl-bg)",
2829
+ boxShadow: "var(--tpl-shadow)",
2830
+ transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
2831
+ })
2832
+ }, null, 4), (a(!0), g(O, null, s(o.value, (t) => (a(), g("button", {
2833
+ key: t.value,
2834
+ role: "radio",
2835
+ "aria-checked": e.viewport === t.value,
2836
+ "aria-label": t.label,
2837
+ 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",
2838
+ style: E({
2839
+ color: e.viewport === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2840
+ transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
2841
+ }),
2842
+ title: t.label,
2843
+ onClick: (e) => r("change", t.value)
2844
+ }, [t.value === "desktop" ? (a(), b(v(tt), {
2845
+ key: 0,
2846
+ size: 18,
2847
+ "stroke-width": 1.5
2848
+ })) : t.value === "tablet" ? (a(), b(v(dt), {
2849
+ key: 1,
2850
+ size: 18,
2851
+ "stroke-width": 1.5
2852
+ })) : (a(), b(v(mt), {
2853
+ key: 2,
2854
+ size: 18,
2855
+ "stroke-width": 1.5
2856
+ })), w("span", null, m(t.label), 1)], 12, Ts))), 128))], 12, ws));
2857
+ }
2858
+ }), Ds = [
2859
+ "aria-label",
2860
+ "title",
2861
+ "aria-pressed"
2862
+ ], Os = /* @__PURE__ */ V(/* @__PURE__ */ A({
2863
+ __name: "PreviewToggle",
2864
+ props: { previewMode: { type: Boolean } },
2865
+ emits: ["change"],
2866
+ setup(e, { emit: t }) {
2867
+ let n = t, { t: r } = L();
2868
+ return (t, i) => (a(), g("button", {
2869
+ 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",
2870
+ style: E({
2871
+ color: e.previewMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2872
+ backgroundColor: e.previewMode ? "var(--tpl-primary-light)" : "transparent"
2873
+ }),
2874
+ "aria-label": e.previewMode ? v(r).previewMode.disable : v(r).previewMode.enable,
2875
+ title: e.previewMode ? v(r).previewMode.disable : v(r).previewMode.enable,
2876
+ "aria-pressed": e.previewMode,
2877
+ onClick: i[0] ||= (t) => n("change", !e.previewMode)
2878
+ }, [j(x, {
2879
+ "enter-active-class": "tpl-icon-enter-active",
2880
+ "leave-active-class": "tpl-icon-leave-active",
2881
+ "enter-from-class": "tpl-icon-enter-from",
2882
+ "leave-to-class": "tpl-icon-leave-to",
2883
+ mode: "out-in"
2884
+ }, {
2885
+ default: l(() => [e.previewMode ? (a(), b(v(B), {
2886
+ key: "eye",
2887
+ size: 18,
2888
+ "stroke-width": 1.5
2889
+ })) : (a(), b(v(P), {
2890
+ key: "eye-off",
2891
+ size: 18,
2892
+ "stroke-width": 1.5
2893
+ }))]),
2894
+ _: 1
2895
+ })], 12, Ds));
2896
+ }
2897
+ }), [["__scopeId", "data-v-af87d02a"]]), ks = [
2898
+ "aria-label",
2899
+ "title",
2900
+ "aria-pressed"
2901
+ ], As = /* @__PURE__ */ V(/* @__PURE__ */ A({
2902
+ __name: "DarkModeToggle",
2903
+ props: { darkMode: { type: Boolean } },
2904
+ emits: ["change"],
2905
+ setup(e, { emit: t }) {
2906
+ let n = t, { t: r } = L();
2907
+ return (t, i) => (a(), g("button", {
2908
+ 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",
2909
+ style: E({
2910
+ color: e.darkMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2911
+ backgroundColor: e.darkMode ? "var(--tpl-primary-light)" : "transparent"
2912
+ }),
2913
+ "aria-label": e.darkMode ? v(r).darkMode.disable : v(r).darkMode.enable,
2914
+ title: e.darkMode ? v(r).darkMode.disable : v(r).darkMode.enable,
2915
+ "aria-pressed": e.darkMode,
2916
+ onClick: i[0] ||= (t) => n("change", !e.darkMode)
2917
+ }, [j(x, {
2918
+ "enter-active-class": "tpl-icon-enter-active",
2919
+ "leave-active-class": "tpl-icon-leave-active",
2920
+ "enter-from-class": "tpl-icon-enter-from",
2921
+ "leave-to-class": "tpl-icon-leave-to",
2922
+ mode: "out-in"
2923
+ }, {
2924
+ default: l(() => [e.darkMode ? (a(), b(v(et), {
2925
+ key: "moon",
2926
+ size: 18,
2927
+ "stroke-width": 1.5
2928
+ })) : (a(), b(v(ot), {
2929
+ key: "sun",
2930
+ size: 18,
2931
+ "stroke-width": 1.5
2932
+ }))]),
2933
+ _: 1
2934
+ })], 12, ks));
2935
+ }
2936
+ }), [["__scopeId", "data-v-f8694f76"]]), js = {
2937
+ class: "tpl:pointer-events-auto tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-tl-lg tpl:p-1",
2938
+ style: {
2939
+ "background-color": "color-mix(\n in srgb,\n var(--tpl-canvas-bg) 85%,\n transparent\n )",
2940
+ "backdrop-filter": "blur(8px)",
2941
+ "-webkit-backdrop-filter": "blur(8px)"
2942
+ }
2943
+ }, Ms = {
2944
+ href: "https://github.com/templatical/sdk",
2945
+ target: "_blank",
2946
+ rel: "noopener noreferrer",
2947
+ class: "tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-dim)]",
2948
+ style: { "text-decoration": "none" }
2949
+ }, Ns = /* @__PURE__ */ A({
2950
+ __name: "EditorFooter",
2951
+ props: { positionClass: {} },
2952
+ setup(e) {
2953
+ let { t } = L();
2954
+ 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", js, [
2955
+ w("span", null, m(v(t).footer.poweredBy), 1),
2956
+ r[0] ||= w("a", {
2957
+ href: "https://templatical.com",
2958
+ target: "_blank",
2959
+ rel: "noopener noreferrer",
2960
+ 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)]",
2961
+ style: { "text-decoration": "none" }
2962
+ }, [w("img", {
2963
+ width: "14",
2964
+ height: "14",
2965
+ src: "https://templatical.com/logo.svg",
2966
+ alt: ""
2967
+ }), k(" Templatical ")], -1),
2968
+ r[1] ||= w("span", { class: "tpl:text-[var(--tpl-border)]" }, "·", -1),
2969
+ w("a", Ms, m(v(t).footer.openSource), 1)
2970
+ ])], 2));
2971
+ }
2972
+ });
2973
+ //#endregion
2974
+ export { Cs as a, Et as c, Es as i, As as n, Gt as o, Os as r, It as s, Ns as t };
2975
+
2976
+ //# sourceMappingURL=styles-Cy-My9zK.js.map