@templatical/editor 0.0.6 → 0.1.1

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