@aswin.dev/editor 0.7.0 → 0.7.2

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 (182) hide show
  1. package/LICENSE +56 -0
  2. package/README.md +3 -3
  3. package/dist/{AccessibilityPanel-CvQGLdu6.js → AccessibilityPanel-EmQ19wiS.js} +37 -37
  4. package/dist/{AiChatSidebar-B3SJIKG_.js → AiChatSidebar-DeB0w_32.js} +67 -81
  5. package/dist/{AiFeatureMenu-BLLKoOos.js → AiFeatureMenu-DoLD5Cde.js} +22 -22
  6. package/dist/{BlockA11yBadge-CXDLqkcJ.js → BlockA11yBadge-DkNbDvJA.js} +12 -12
  7. package/dist/CloudEditor-zo9PjjvY.js +1214 -0
  8. package/dist/{CollaboratorBar-DuPYW5iF.js → CollaboratorBar-BsXMY-8e.js} +21 -21
  9. package/dist/CommentsSidebar-DIWIa4rS.js +436 -0
  10. package/dist/CountdownBlock-BCi7-DAM.js +92 -0
  11. package/dist/CountdownToolbar-BuS8p5ju.js +210 -0
  12. package/dist/{DesignReferenceSidebar-B8V_F2yF.js → DesignReferenceSidebar-RDlnhL-6.js} +58 -58
  13. package/dist/{LoadingTrack-B0CWFHXQ.js → LoadingTrack-BJ59h9ok.js} +2 -2
  14. package/dist/ModuleBrowserModal-b7HbpByz.js +206 -0
  15. package/dist/ModulePreviewCanvas-D__YlOLS.js +108 -0
  16. package/dist/{NumberWithSuffix-DkXUez9t.js → NumberWithSuffix-Ca3vNY84.js} +87 -87
  17. package/dist/{ParagraphEditor-D75wl3BX.js → ParagraphEditor-B1aYPO-6.js} +182 -182
  18. package/dist/{RichTextEditorContent-DYkIauIk.js → RichTextEditorContent-BmEVMrkJ.js} +38 -38
  19. package/dist/{SaveModuleDialog-FZ9lxY7_.js → SaveModuleDialog-ClovqI6h.js} +28 -28
  20. package/dist/{SnapshotHistory-BR3eV120.js → SnapshotHistory-DoqtH0cw.js} +45 -50
  21. package/dist/{TemplateScoringPanel-4GTNHej5.js → TemplateScoringPanel-DQv2ZAiL.js} +75 -75
  22. package/dist/{TestEmailModal--ue5w9fT.js → TestEmailModal-iIeYJYsj.js} +28 -28
  23. package/dist/{TitleEditor-fStSADI-.js → TitleEditor-CTDIwRF_.js} +68 -68
  24. package/dist/{TplModal-BwSfxIHf.js → TplModal-CBq1J1pG.js} +14 -14
  25. package/dist/{accessibility-e8JYu_zd.js → accessibility-BU09xZrQ.js} +1 -1
  26. package/dist/{blockTypeIcons-BcTrDjmH.js → blockTypeIcons-QkC6f5UE.js} +19 -5
  27. package/dist/bundle-stats.json +7 -7
  28. package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js → AccessibilityPanel-BeU8nz7A.js} +28 -28
  29. package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js.map → AccessibilityPanel-BeU8nz7A.js.map} +1 -1
  30. package/dist/cdn/chunks/{AiFeatureMenu-qEdB2fZJ.js → AiFeatureMenu-B2mhscyP.js} +21 -21
  31. package/dist/cdn/chunks/AiFeatureMenu-B2mhscyP.js.map +1 -0
  32. package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js → BlockA11yBadge-C4g77gF0.js} +11 -11
  33. package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js.map → BlockA11yBadge-C4g77gF0.js.map} +1 -1
  34. package/dist/{CloudEditor-BCz1ZTYC.js → cdn/chunks/CloudEditor-Btyr0b0_.js} +486 -475
  35. package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js.map +1 -0
  36. package/dist/cdn/chunks/{CollaboratorBar--nO7TX6b.js → CollaboratorBar-YBiIjiRh.js} +15 -15
  37. package/dist/cdn/chunks/CollaboratorBar-YBiIjiRh.js.map +1 -0
  38. package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js +93 -0
  39. package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js.map +1 -0
  40. package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js +212 -0
  41. package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js.map +1 -0
  42. package/dist/{ModuleBrowserModal-DrUFMTDx.js → cdn/chunks/ModuleBrowserModal-C2CDWKW6.js} +51 -62
  43. package/dist/cdn/chunks/ModuleBrowserModal-C2CDWKW6.js.map +1 -0
  44. package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js +109 -0
  45. package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js.map +1 -0
  46. package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js → NumberWithSuffix-Ty1bp9vB.js} +64 -64
  47. package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js.map → NumberWithSuffix-Ty1bp9vB.js.map} +1 -1
  48. package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js → ParagraphEditor-BA1WbHI7.js} +188 -188
  49. package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js.map → ParagraphEditor-BA1WbHI7.js.map} +1 -1
  50. package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js → RichTextEditorContent-BtWCA_Oc.js} +30 -30
  51. package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js.map → RichTextEditorContent-BtWCA_Oc.js.map} +1 -1
  52. package/dist/cdn/chunks/{SaveModuleDialog-B0TnO_o9.js → SaveModuleDialog-AwL0tkCV.js} +21 -21
  53. package/dist/cdn/chunks/SaveModuleDialog-AwL0tkCV.js.map +1 -0
  54. package/dist/cdn/chunks/{TitleEditor-BHpfxvwy.js → TitleEditor-DbSyeixS.js} +65 -65
  55. package/dist/cdn/chunks/TitleEditor-DbSyeixS.js.map +1 -0
  56. package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js +23 -0
  57. package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js.map +1 -0
  58. package/dist/cdn/chunks/{de-D8CnZxV9.js → de-_tooy3Q8.js} +250 -2
  59. package/dist/cdn/chunks/de-_tooy3Q8.js.map +1 -0
  60. package/dist/cdn/chunks/{draggable-Bcb86AsV.js → draggable-C-1_gch3.js} +2 -2
  61. package/dist/cdn/chunks/{draggable-Bcb86AsV.js.map → draggable-C-1_gch3.js.map} +1 -1
  62. package/dist/cdn/chunks/{en-8FHaQv4V.js → en-CNqLoIm9.js} +250 -2
  63. package/dist/cdn/chunks/en-CNqLoIm9.js.map +1 -0
  64. package/dist/cdn/chunks/{extensions-DIxF31tA.js → extensions-BVKQw_sp.js} +107 -107
  65. package/dist/cdn/chunks/extensions-BVKQw_sp.js.map +1 -0
  66. package/dist/cdn/chunks/{features-DEMb13KS.js → features-DIBEo4xl.js} +3388 -2289
  67. package/dist/cdn/chunks/features-DIBEo4xl.js.map +1 -0
  68. package/dist/cdn/chunks/{icons-CsLTcirh.js → icons-C1Gg-ov-.js} +346 -54
  69. package/dist/cdn/chunks/icons-C1Gg-ov-.js.map +1 -0
  70. package/dist/cdn/chunks/{media-library-CVaNvhpM.js → media-library-BTF_Ko70.js} +985 -985
  71. package/dist/cdn/chunks/media-library-BTF_Ko70.js.map +1 -0
  72. package/dist/cdn/chunks/{quality-BaBfc54_.js → quality-C5AmotmP.js} +312 -312
  73. package/dist/cdn/chunks/quality-C5AmotmP.js.map +1 -0
  74. package/dist/cdn/chunks/{renderer-CUxvx7ro.js → renderer-D0L44Vlp.js} +236 -142
  75. package/dist/cdn/chunks/renderer-D0L44Vlp.js.map +1 -0
  76. package/dist/cdn/chunks/{src-CRaqN-p8.js → src-RKexlYjA.js} +161 -161
  77. package/dist/cdn/chunks/src-RKexlYjA.js.map +1 -0
  78. package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js +57 -0
  79. package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js.map +1 -0
  80. package/dist/cdn/chunks/styles-CQR6ed13.js +4976 -0
  81. package/dist/cdn/chunks/styles-CQR6ed13.js.map +1 -0
  82. package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js → tiptap-CDzAbF2j.js} +43 -43
  83. package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js.map → tiptap-CDzAbF2j.js.map} +1 -1
  84. package/dist/cdn/editor.css +1 -1
  85. package/dist/cdn/editor.js +211 -123
  86. package/dist/cdn/editor.js.map +1 -1
  87. package/dist/{check-Da05j8yl.js → check-DJrpDKO_.js} +1 -1
  88. package/dist/{chevron-down-R2uY34iD.js → chevron-down-C5oBUhT8.js} +1 -1
  89. package/dist/chevron-right-BqCptpdp.js +10 -0
  90. package/dist/{circle-alert-DZuGWPX-.js → circle-alert-ZQQc98HC.js} +1 -1
  91. package/dist/{clock-CRp2sIub.js → clock-ik2pRJKG.js} +1 -1
  92. package/dist/{cloud-DEk_b4CR.js → cloud-DJG4tb4_.js} +485 -427
  93. package/dist/{createLucideIcon-C3pa2siy.js → createLucideIcon-ClREiSx3.js} +6 -6
  94. package/dist/{de-Brqvgr43.js → de-2LEvILeZ.js} +249 -1
  95. package/dist/{dist-Cp0zXPAD.js → dist-BHAeXaUY.js} +1 -1
  96. package/dist/{dist-BaQIYPsn.js → dist-BSJvAvH3.js} +1 -1
  97. package/dist/{dist-wzMIGj-D.js → dist-BeFnymxK.js} +1 -1
  98. package/dist/dist-Bmir0gYb.js +1167 -0
  99. package/dist/{dist-DDJIWTRY.js → dist-BvPgo-UK.js} +1 -1
  100. package/dist/{dist-BFawx6IS.js → dist-CPVBKMmd.js} +51 -51
  101. package/dist/dist-CivF9P8b.js +382 -0
  102. package/dist/{dist-D6uC2xhi.js → dist-Df4ie7vZ.js} +1 -1
  103. package/dist/{dist-us-RpCWN.js → dist-DxOoemkW.js} +1 -1
  104. package/dist/{dist-KoBJjK1G.js → dist-HEQ52gTJ.js} +1 -1
  105. package/dist/{dist-DjviJBCi.js → dist-b-XUqAoF.js} +1 -1
  106. package/dist/{dist-D90y8dvT.js → dist-kZfaVUpW.js} +3 -3
  107. package/dist/{dist-aRzjfSRN.js → dist-wfAedlzi.js} +1 -1
  108. package/dist/{en-WDVp87TE.js → en-D2RU2Poj.js} +249 -1
  109. package/dist/{extensions-CUcl9Ok4.js → extensions-BQ1xXx3d.js} +103 -103
  110. package/dist/{image-up-MBZKKg9p.js → image-up-DT7gcJLN.js} +1 -1
  111. package/dist/index.d.ts +102 -14
  112. package/dist/{info-CJEC7piy.js → info-BSPGcsSM.js} +1 -1
  113. package/dist/keys-CvX8D-8C.js +10 -0
  114. package/dist/{loader-circle-DsY5Yg33.js → loader-circle-Balo8p3d.js} +1 -1
  115. package/dist/{message-circle-yElBbR2C.js → message-circle-B39qAHxs.js} +1 -1
  116. package/dist/pencil-BZJPNYWR.js +10 -0
  117. package/dist/{refresh-cw-CE_AGtn8.js → refresh-cw-DwDqGUM0.js} +1 -1
  118. package/dist/{scan-line-D0vcUekt.js → scan-line-DlghmhNf.js} +1 -1
  119. package/dist/{send-DH4oDQqC.js → send-DDdhIRj8.js} +1 -1
  120. package/dist/{shield-check-CfJgs2Hd.js → shield-check-OSQ-JVTX.js} +1 -1
  121. package/dist/{sparkles-CvRXGqFs.js → sparkles-BN4a-CoF.js} +1 -1
  122. package/dist/style.css +1 -1
  123. package/dist/styleConstants-wWRbcuEK.js +55 -0
  124. package/dist/styles-CavWjvol.js +5487 -0
  125. package/dist/templatical-editor.js +211 -119
  126. package/dist/{text-align-start-BT9VUDxK.js → text-align-start-D1weisjS.js} +1 -1
  127. package/dist/{trash-2-DbP2Y6t2.js → trash-2-CMWvQ5KX.js} +1 -1
  128. package/dist/{triangle-alert-aOXceTSe.js → triangle-alert-DyidRNX_.js} +1 -1
  129. package/dist/undo-2-Cg8I7obC.js +16 -0
  130. package/dist/{useCloudI18n-BuIwR6OE.js → useCloudI18n-BTTNBk5i.js} +2 -2
  131. package/dist/{useEditorCore-C6ost42Q.js → useEditorCore-BGnzcT7p.js} +2424 -2249
  132. package/dist/{useI18n-lb2DHDiu.js → useI18n-C2xQZ6K9.js} +2 -2
  133. package/dist/{useMergeTag-CBwKnnNB.js → useMergeTag-CfuZq2fF.js} +4 -4
  134. package/dist/{vue.runtime.esm-bundler-DpvJL-nX.js → vue.runtime.esm-bundler-CjauPXjj.js} +1 -1
  135. package/dist/{x-u2oVmjN_.js → x-CgIhNcT9.js} +1 -1
  136. package/package.json +15 -15
  137. package/dist/CommentsSidebar-B1pvJdqF.js +0 -441
  138. package/dist/CountdownBlock-BNSj1jvJ.js +0 -92
  139. package/dist/CountdownToolbar-ClJr2GzL.js +0 -210
  140. package/dist/ModulePreviewCanvas-CHdOwV_4.js +0 -106
  141. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +0 -1
  142. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +0 -1143
  143. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +0 -1
  144. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +0 -1
  145. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +0 -93
  146. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +0 -1
  147. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +0 -212
  148. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +0 -1
  149. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +0 -195
  150. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +0 -1
  151. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +0 -107
  152. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +0 -1
  153. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +0 -1
  154. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +0 -1
  155. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +0 -22
  156. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +0 -1
  157. package/dist/cdn/chunks/de-D8CnZxV9.js.map +0 -1
  158. package/dist/cdn/chunks/en-8FHaQv4V.js.map +0 -1
  159. package/dist/cdn/chunks/extensions-DIxF31tA.js.map +0 -1
  160. package/dist/cdn/chunks/features-DEMb13KS.js.map +0 -1
  161. package/dist/cdn/chunks/icons-CsLTcirh.js.map +0 -1
  162. package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +0 -1
  163. package/dist/cdn/chunks/quality-BaBfc54_.js.map +0 -1
  164. package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +0 -1
  165. package/dist/cdn/chunks/src-CRaqN-p8.js.map +0 -1
  166. package/dist/cdn/chunks/styleConstants-DP1VOca8.js +0 -57
  167. package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +0 -1
  168. package/dist/cdn/chunks/styles-BHJULjNR.js +0 -2947
  169. package/dist/cdn/chunks/styles-BHJULjNR.js.map +0 -1
  170. package/dist/dist-B1IR0bpH.js +0 -326
  171. package/dist/dist-DJmnUmW9.js +0 -362
  172. package/dist/keys-ciNfSSGj.js +0 -10
  173. package/dist/styleConstants-fWzlIIwN.js +0 -55
  174. package/dist/styles-DEXEkBvg.js +0 -3176
  175. /package/dist/{_plugin-vue_export-helper-B0hnzhyu.js → _plugin-vue_export-helper-Bwh4ceeO.js} +0 -0
  176. /package/dist/{de-DCaaCE5s.js → de-D2npYjrZ.js} +0 -0
  177. /package/dist/{dist-iLBdeBDR.js → dist-DvHLtWVP.js} +0 -0
  178. /package/dist/{emojiData-PQyVa4bU.js → emojiData-DvQBBzmO.js} +0 -0
  179. /package/dist/{en-DXCyK4-X.js → en-ib-4h3_o.js} +0 -0
  180. /package/dist/{formatRelativeTime-BOEf47hq.js → formatRelativeTime-CFDZnEIs.js} +0 -0
  181. /package/dist/{liquid.browser-CdMv1BTn.js → liquid.browser-7Rv0QDiO.js} +0 -0
  182. /package/dist/{readableTextColor-CY3SiRnt.js → readableTextColor-C_9OpzBw.js} +0 -0
@@ -0,0 +1,1214 @@
1
+ import { At as e, C as t, F as n, Ft as r, M as i, N as a, P as o, S as s, U as c, V as l, W as u, Z as d, _ as f, b as p, d as m, et as h, f as g, g as _, h as v, j as y, jt as b, l as x, m as S, nt as C, st as w, t as T, v as E, x as D, y as O } from "./vue.runtime.esm-bundler-CjauPXjj.js";
2
+ import { t as k } from "./timeouts-BSGxjuUF.js";
3
+ import { f as A, j, o as ee, r as M } from "./dist-Bmir0gYb.js";
4
+ import { C as N, F as te, L as P, t as F } from "./useEditorCore-BGnzcT7p.js";
5
+ import { l as I, t as L } from "./dist-CivF9P8b.js";
6
+ import { E as ne, S as R, T as z, c as B, i as re, l as ie, n as ae, u as V, w as oe } from "./keys-CvX8D-8C.js";
7
+ import { t as H } from "./useI18n-C2xQZ6K9.js";
8
+ import { t as se } from "./createLucideIcon-ClREiSx3.js";
9
+ import { a as ce, c as U, d as W, f as le, g as ue, h as G, i as de, l as fe, m as pe, n as me, p as he, r as ge, s as _e, t as ve, u as K } from "./styles-CavWjvol.js";
10
+ import { t as ye } from "./check-DJrpDKO_.js";
11
+ import { t as be } from "./circle-alert-ZQQc98HC.js";
12
+ import { t as xe } from "./clock-ik2pRJKG.js";
13
+ import { t as q } from "./loader-circle-Balo8p3d.js";
14
+ import { t as J } from "./message-circle-B39qAHxs.js";
15
+ import { t as Se } from "./send-DDdhIRj8.js";
16
+ import { t as Y } from "./sparkles-BN4a-CoF.js";
17
+ import { t as Ce } from "./triangle-alert-DyidRNX_.js";
18
+ import { t as we } from "./_plugin-vue_export-helper-Bwh4ceeO.js";
19
+ import { n as X } from "./useCloudI18n-BTTNBk5i.js";
20
+ import { d as Z } from "./styleConstants-wWRbcuEK.js";
21
+ import { _ as Te, a as Q, c as Ee, d as $, f as De, g as Oe, h as ke, l as Ae, m as je, n as Me, o as Ne, p as Pe, r as Fe, s as Ie, t as Le, v as Re, y as ze } from "./cloud-DJG4tb4_.js";
22
+ var Be = se("save", [
23
+ ["path", {
24
+ d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
25
+ key: "1c8476"
26
+ }],
27
+ ["path", {
28
+ d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",
29
+ key: "1ydtos"
30
+ }],
31
+ ["path", {
32
+ d: "M7 3v4a1 1 0 0 0 1 1h7",
33
+ key: "t51u73"
34
+ }]
35
+ ]);
36
+ //#endregion
37
+ //#region src/cloud/composables/useSnapshotPreview.ts
38
+ function Ve(e) {
39
+ let { authManager: t, editor: n, history: r, conditionPreview: i, autoSave: a, onError: o } = e, s = C(null), c = h(null), l = h(null), u = !1;
40
+ d(() => {
41
+ u = !0;
42
+ });
43
+ let f = S(() => c.value !== null), p = S(() => s.value?.snapshots.value ?? []), m = S(() => s.value?.isLoading.value ?? !1), g = S(() => s.value?.isRestoring.value ?? !1);
44
+ function _() {
45
+ n.state.template?.id && !s.value && (s.value = Oe({
46
+ authManager: t,
47
+ templateId: n.state.template.id,
48
+ onRestore: v,
49
+ onError: o
50
+ }), s.value.loadSnapshots());
51
+ }
52
+ function v(e) {
53
+ n.setContent(e.content, !1), r.clear(), i.reset();
54
+ }
55
+ async function y(e) {
56
+ if (!u) {
57
+ if (c.value) {
58
+ c.value = e, n.setContent(e.content, !1);
59
+ return;
60
+ }
61
+ n.state.isDirty && n.hasTemplate() && (await n.createSnapshot(), u) || (l.value = structuredClone(n.content.value), a?.pause(), c.value = e, n.setContent(e.content, !1));
62
+ }
63
+ }
64
+ async function b() {
65
+ if (!(!c.value || !s.value)) try {
66
+ if (await s.value.restoreSnapshot(c.value.id), u || (await s.value.loadSnapshots(), u)) return;
67
+ } finally {
68
+ u || (c.value = null, l.value = null, a?.resume());
69
+ }
70
+ }
71
+ function x() {
72
+ !c.value || !l.value || (n.setContent(l.value, !1), c.value = null, l.value = null, a?.resume());
73
+ }
74
+ async function w() {
75
+ u || s.value && await s.value.loadSnapshots();
76
+ }
77
+ return {
78
+ snapshotHistoryInstance: s,
79
+ previewingSnapshot: c,
80
+ contentBeforePreview: l,
81
+ isPreviewingSnapshot: f,
82
+ snapshotHistorySnapshots: p,
83
+ snapshotHistoryIsLoading: m,
84
+ snapshotHistoryIsRestoring: g,
85
+ initSnapshotHistory: _,
86
+ handleRestore: v,
87
+ handleSnapshotNavigate: y,
88
+ confirmRestoreSnapshot: b,
89
+ cancelPreview: x,
90
+ loadSnapshotHistory: w
91
+ };
92
+ }
93
+ //#endregion
94
+ //#region src/cloud/composables/useCloudPanelState.ts
95
+ function He() {
96
+ let e = h(null), t = S({
97
+ get: () => e.value === "ai-chat",
98
+ set: (t) => e.value = t ? "ai-chat" : null
99
+ }), n = S({
100
+ get: () => e.value === "scoring",
101
+ set: (t) => e.value = t ? "scoring" : null
102
+ }), r = S({
103
+ get: () => e.value === "design-reference",
104
+ set: (t) => e.value = t ? "design-reference" : null
105
+ }), i = S({
106
+ get: () => e.value === "comments",
107
+ set: (t) => e.value = t ? "comments" : null
108
+ }), a = h(!1), o = h(!1), s = h(void 0), c = h(!1), l = h(null), u = S(() => e.value !== null), d = S(() => {
109
+ let t = e.value;
110
+ return t === "ai-chat" || t === "design-reference" || t === "scoring" ? t : null;
111
+ }), f = S(() => c.value || e.value === "ai-chat" || e.value === "design-reference" || e.value === "scoring");
112
+ function p() {
113
+ c.value = !c.value;
114
+ }
115
+ function m(t) {
116
+ c.value = !1, e.value = e.value === t ? null : t;
117
+ }
118
+ return L(l, () => {
119
+ c.value = !1;
120
+ }), {
121
+ activePanel: e,
122
+ aiChatOpen: t,
123
+ scoringPanelOpen: n,
124
+ designReferenceOpen: r,
125
+ commentsOpen: i,
126
+ testEmailModalOpen: a,
127
+ mediaLibraryOpen: o,
128
+ mediaLibraryAccept: s,
129
+ aiMenuOpen: c,
130
+ aiMenuRef: l,
131
+ rightPanelOpen: u,
132
+ activeAiFeature: d,
133
+ aiButtonActive: f,
134
+ toggleAiMenu: p,
135
+ handleAiFeatureSelect: m
136
+ };
137
+ }
138
+ //#endregion
139
+ //#region src/cloud/composables/useCollabUndoWarning.ts
140
+ function Ue(e) {
141
+ let { isCollaborationEnabled: t, getCollaboratorCount: n, canUndo: r } = e, i = h(!1), a = h(!1), { start: o } = I(() => {
142
+ a.value = !1;
143
+ }, k, { immediate: !1 });
144
+ function s() {
145
+ i.value || !t.value || n() === 0 || !r.value || (i.value = !0, a.value = !0, o());
146
+ }
147
+ return {
148
+ collabUndoWarningVisible: a,
149
+ showCollabUndoWarning: s
150
+ };
151
+ }
152
+ //#endregion
153
+ //#region src/cloud/composables/useCloudFeatureFlags.ts
154
+ function We(e) {
155
+ let { planConfigInstance: t, aiConfig: n, editor: r } = e, i = S(() => t.hasFeature("ai_generation") && n.hasAnyMenuFeature.value), a = S(() => t.hasFeature("test_email")), o = S(() => !!r.state.template?.id), s = S(() => t.hasFeature("white_label")), c = S(() => t.config.value?.limits.max_templates ?? null), l = S(() => t.config.value?.template_count ?? 0), u = h(!1), d = h("idle"), f = h(""), { start: p } = I(() => {
156
+ d.value = "idle";
157
+ }, 3e3, { immediate: !1 });
158
+ return {
159
+ canUseAiGeneration: i,
160
+ canSendTestEmail: a,
161
+ hasTemplateSaved: o,
162
+ isWhiteLabeled: s,
163
+ templateLimit: c,
164
+ templateCount: l,
165
+ isSaveExporting: u,
166
+ saveStatus: d,
167
+ saveErrorMessage: f,
168
+ startSaveStatusClear: p
169
+ };
170
+ }
171
+ //#endregion
172
+ //#region src/cloud/composables/useCloudMediaLibrary.ts
173
+ function Ge(e) {
174
+ let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: r } = e, i = null;
175
+ async function a() {
176
+ if (t) {
177
+ let e = await t({ accept: ["images"] });
178
+ return e ? {
179
+ url: e.url,
180
+ alt: e.alt_text || void 0
181
+ } : null;
182
+ }
183
+ return i &&= (i(null), null), r.value = ["images"], n.value = !0, new Promise((e) => {
184
+ i = (t) => {
185
+ e(t);
186
+ };
187
+ });
188
+ }
189
+ function o(e) {
190
+ n.value = !1, i?.({
191
+ url: e.url,
192
+ alt: e.alt_text || void 0
193
+ }), i = null;
194
+ }
195
+ function s() {
196
+ n.value = !1, i?.(null), i = null;
197
+ }
198
+ return d(() => {
199
+ i &&= (i(null), null);
200
+ }), {
201
+ handleRequestMedia: a,
202
+ handleMediaSelect: o,
203
+ handleMediaLibraryClose: s
204
+ };
205
+ }
206
+ //#endregion
207
+ //#region src/cloud/composables/useCloudInitialization.ts
208
+ function Ke(e) {
209
+ let { config: t, translations: n, fontsManager: r, emit: i, getCommentsSidebar: a } = e, s = h(!0), c = h(!1), u = h(null), d = !1, f = { value: null }, p = null, m = null, g = new Le({
210
+ ...t.auth,
211
+ onError: t.onError
212
+ }), _ = je({
213
+ authManager: g,
214
+ onError: t.onError
215
+ }), v = h(/* @__PURE__ */ new Map()), y = $({
216
+ authManager: g,
217
+ defaultFontFamily: t.fonts?.defaultFont,
218
+ templateDefaults: t.templateDefaults,
219
+ onError: t.onError,
220
+ lockedBlocks: v
221
+ }), b = ze({
222
+ authManager: g,
223
+ onError: t.onError
224
+ });
225
+ t.mcp?.enabled && Pe({
226
+ editor: y,
227
+ channel: b.channel,
228
+ onOperation: t.mcp.onOperation
229
+ });
230
+ let x = null;
231
+ t.collaboration?.enabled && (x = Ne({
232
+ authManager: g,
233
+ editor: y,
234
+ channel: b.channel,
235
+ onError: t.onError,
236
+ onCollaboratorJoined: t.collaboration.onCollaboratorJoined,
237
+ onCollaboratorLeft: t.collaboration.onCollaboratorLeft,
238
+ onBlockLocked: t.collaboration.onBlockLocked,
239
+ onBlockUnlocked: t.collaboration.onBlockUnlocked
240
+ }), l(() => x.lockedBlocks.value, (e) => {
241
+ v.value = e;
242
+ }, { immediate: !0 }), Ie(y, x));
243
+ let C = S(() => !!t.collaboration?.enabled && _.hasFeature("collaboration")), w = F({
244
+ editor: y,
245
+ config: {
246
+ uiTheme: t.uiTheme,
247
+ theme: void 0,
248
+ blockDefaults: t.blockDefaults,
249
+ customBlocks: [],
250
+ mergeTags: t.mergeTags,
251
+ displayConditions: t.displayConditions,
252
+ onRequestMedia: null,
253
+ editorType: t.editorType,
254
+ accessibility: G(t),
255
+ onSave: () => {
256
+ f.value?.().catch((e) => {
257
+ t.onError?.(e);
258
+ });
259
+ }
260
+ },
261
+ translations: n,
262
+ fontsManager: r,
263
+ historyOptions: x ? { isRemoteOperation: () => x._isProcessingRemoteOperation() } : void 0,
264
+ autoSaveOptions: {
265
+ onChange: async () => {
266
+ y.hasTemplate() && (await y.createSnapshot(), p?.snapshotHistoryInstance.value?.loadSnapshots());
267
+ },
268
+ debounce: t.autoSaveDebounce ?? 5e3,
269
+ enabled: () => t.autoSave !== !1 && _.hasFeature("auto_save")
270
+ },
271
+ themeExtraStyles: () => ({ "--tpl-drop-text": `"${n.canvas.dropHere}"` }),
272
+ keyboardOptions: { onBeforeUndo: () => m?.showCollabUndoWarning() }
273
+ }), T = Ue({
274
+ isCollaborationEnabled: C,
275
+ getCollaboratorCount: () => x?.collaborators.value.length ?? 0,
276
+ canUndo: w.history.canUndo
277
+ });
278
+ m = T;
279
+ let E = Ve({
280
+ authManager: g,
281
+ editor: y,
282
+ history: w.history,
283
+ conditionPreview: w.conditionPreview,
284
+ autoSave: w.autoSave,
285
+ onError: t.onError
286
+ });
287
+ p = E;
288
+ let D = He(), O = Q(t.ai), k = We({
289
+ planConfigInstance: _,
290
+ aiConfig: O,
291
+ editor: y
292
+ }), A = Ge({
293
+ onRequestMedia: t.onRequestMedia,
294
+ mediaLibraryOpen: D.mediaLibraryOpen,
295
+ mediaLibraryAccept: D.mediaLibraryAccept
296
+ });
297
+ N({
298
+ onBlockMove: y.moveBlock,
299
+ onBlockAdd: y.addBlock
300
+ });
301
+ let j = De({
302
+ authManager: g,
303
+ getFontsConfig: () => t.fonts,
304
+ canUseCustomFonts: () => _.hasFeature("custom_fonts")
305
+ }), ee = Re({
306
+ authManager: g,
307
+ getTemplateId: () => y.state.template?.id ?? null,
308
+ save: () => y.save(),
309
+ exportHtml: (e) => j.exportHtml(e),
310
+ onError: t.onError,
311
+ isAuthReady: c,
312
+ onBeforeTestEmail: t.onBeforeTestEmail
313
+ }), M = Ae({
314
+ authManager: g,
315
+ getTemplateId: () => y.state.template?.id ?? null,
316
+ getSocketId: () => b.getSocketId(),
317
+ onComment: t.onComment,
318
+ onError: t.onError,
319
+ isAuthReady: c,
320
+ hasCommentingFeature: () => t.commenting !== !1 && _.hasFeature("commenting")
321
+ });
322
+ Ee({
323
+ comments: M,
324
+ channel: b.channel
325
+ });
326
+ let P = ke({
327
+ authManager: g,
328
+ onError: t.onError
329
+ }), I = h(!1), L = h(null), ie = h(!1), oe = Te({
330
+ authManager: g,
331
+ getTemplateId: () => y.state.template?.id ?? null
332
+ });
333
+ function H(e) {
334
+ D.commentsOpen.value = !0, queueMicrotask(() => {
335
+ a()?.filterByBlock(e);
336
+ });
337
+ }
338
+ o(R, A.handleRequestMedia), o(re, g), o(ae, O), o(V, M), o(z, P), o(ne, oe), o(B, {
339
+ plan: _,
340
+ ai: O,
341
+ comments: {
342
+ getBlockCount: (e) => M.commentCountByBlock.value.get(e) ?? 0,
343
+ openForBlock: H
344
+ },
345
+ savedModules: {
346
+ openSaveDialog: (e) => {
347
+ L.value = e ?? null, I.value = !0;
348
+ },
349
+ openBrowser: () => {
350
+ ie.value = !0;
351
+ },
352
+ moduleCount: S(() => P.modules.value.length)
353
+ }
354
+ });
355
+ function se(e) {
356
+ _.hasFeature("theme_customization") && (w.themeOverrides.value = e);
357
+ }
358
+ function ce(e) {
359
+ y.setUiTheme(e);
360
+ }
361
+ async function U() {
362
+ s.value = !0, u.value = null;
363
+ try {
364
+ if (await g.initialize(), d) return;
365
+ c.value = !0;
366
+ let e = await Me({ authManager: g });
367
+ if (d) return;
368
+ if (!e.api.ok) throw Error("Health check failed: API is not reachable");
369
+ if (!e.auth.ok) throw Error(`Health check failed: authentication error${e.auth.error ? ` - ${e.auth.error}` : ""}`);
370
+ if (e.websocket.ok || te.warn("WebSocket health check failed:", e.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await _.fetchConfig(), d) return;
371
+ r.setCustomFontsEnabled(_.hasFeature("custom_fonts")), t.customBlocks?.length && _.hasFeature("custom_blocks") && w.registerCustomBlocks(t.customBlocks), t.theme && _.hasFeature("theme_customization") && (w.themeOverrides.value = t.theme), t.modules !== !1 && _.hasFeature("saved_modules") && P.loadModules(), i("ready");
372
+ } catch (e) {
373
+ if (d) return;
374
+ let n = e instanceof Error ? e : Error("Initialization failed", { cause: e });
375
+ u.value = n, t.onError?.(n);
376
+ } finally {
377
+ d || (s.value = !1);
378
+ }
379
+ }
380
+ function W() {
381
+ d = !0, r.cleanupFontLinks(), b.disconnect(), w.destroy(), t.onUnmount?.();
382
+ }
383
+ return {
384
+ isInitializing: s,
385
+ isAuthReady: c,
386
+ initError: u,
387
+ isDestroyed: () => d,
388
+ authManager: g,
389
+ planConfigInstance: _,
390
+ websocket: b,
391
+ collaboration: x,
392
+ isCollaborationEnabled: C,
393
+ editor: y,
394
+ core: w,
395
+ aiConfig: O,
396
+ featureFlags: k,
397
+ mediaLib: A,
398
+ exporter: j,
399
+ testEmail: ee,
400
+ commentsInstance: M,
401
+ savedModulesHeadless: P,
402
+ scoringInstance: oe,
403
+ panelState: D,
404
+ snapshotPreview: E,
405
+ collabWarning: T,
406
+ showSaveModuleDialog: I,
407
+ showModuleBrowserModal: ie,
408
+ saveModulePreSelectedBlockId: L,
409
+ onSaveHook: f,
410
+ initialize: U,
411
+ destroy: W,
412
+ setThemeOverrides: se,
413
+ setUiTheme: ce,
414
+ openCommentsForBlock: H
415
+ };
416
+ }
417
+ //#endregion
418
+ //#region src/utils/preRenderCustomBlocks.ts
419
+ async function qe(e, t) {
420
+ let n = async (e) => {
421
+ if (j(e)) {
422
+ let n = e;
423
+ try {
424
+ n.renderedHtml = await t.renderCustomBlock(n);
425
+ } catch {
426
+ n.renderedHtml = `<!-- Custom block render error: ${n.customType} -->`;
427
+ }
428
+ }
429
+ if (e.type === "section" && "children" in e) {
430
+ let t = e;
431
+ for (let e of t.children) for (let t of e) await n(t);
432
+ }
433
+ };
434
+ for (let t of e.blocks) await n(t);
435
+ }
436
+ //#endregion
437
+ //#region src/cloud/composables/useCloudLifecycle.ts
438
+ function Je(e) {
439
+ let { config: t, editor: n, websocket: r, planConfigInstance: i, snapshotPreview: a, core: o, exporter: s, featureFlags: c, isDestroyed: l } = e;
440
+ function u() {
441
+ return Fe(i.config.value.websocket);
442
+ }
443
+ async function d(e) {
444
+ let i = await n.create(e);
445
+ return l() ? i : (t.onCreate?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
446
+ }
447
+ async function f(e) {
448
+ let i = await n.load(e);
449
+ return l() ? i : (t.onLoad?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
450
+ }
451
+ async function p() {
452
+ c.isSaveExporting.value = !0, c.saveStatus.value = "idle";
453
+ try {
454
+ if (await qe(n.content.value, o.registry), l()) throw Error("Component unmounted during save");
455
+ let e = await n.save();
456
+ if (l()) throw Error("Component unmounted during save");
457
+ a.initSnapshotHistory(), a.snapshotHistoryInstance.value?.loadSnapshots();
458
+ let r = await s.exportHtml(e.id);
459
+ if (l()) throw Error("Component unmounted during save");
460
+ let i = {
461
+ templateId: e.id,
462
+ html: r.html,
463
+ mjml: r.mjml,
464
+ content: e.content
465
+ };
466
+ return t.onSave?.(i), c.saveStatus.value = "saved", c.startSaveStatusClear(), i;
467
+ } catch (e) {
468
+ throw l() || (c.saveStatus.value = "error", c.saveErrorMessage.value = e instanceof Error ? e.message : "Save failed"), e;
469
+ } finally {
470
+ l() || (c.isSaveExporting.value = !1);
471
+ }
472
+ }
473
+ return {
474
+ createTemplate: d,
475
+ loadTemplate: f,
476
+ saveTemplate: p
477
+ };
478
+ }
479
+ //#endregion
480
+ //#region src/cloud/composables/useCloudSaveGate.ts
481
+ function Ye(e) {
482
+ let t = h(!1), n = null, r = S(() => e.planConfig.value?.accessibility?.blockOnError === !0), i = S(() => r.value ? e.issues.value.filter((e) => e.severity === "error") : []), a = S(() => i.value.length > 0);
483
+ async function o(e) {
484
+ return a.value ? (n = e, t.value = !0, !1) : (await e(), !0);
485
+ }
486
+ async function s() {
487
+ let e = n;
488
+ n = null, t.value = !1, e && await e();
489
+ }
490
+ function c() {
491
+ n = null, t.value = !1;
492
+ }
493
+ return {
494
+ shouldBlock: a,
495
+ blockingIssues: i,
496
+ modalOpen: t,
497
+ tryRunSave: o,
498
+ confirmAndSave: s,
499
+ cancel: c
500
+ };
501
+ }
502
+ //#endregion
503
+ //#region src/cloud/components/CloudSaveGateModal.vue?vue&type=script&setup=true&lang.ts
504
+ var Xe = ["aria-label"], Ze = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl:max-w-md tpl:flex-col tpl:gap-4 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-5 tpl:shadow-[var(--tpl-shadow-md)]" }, Qe = { class: "tpl:flex tpl:items-center tpl:gap-2" }, $e = { class: "tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]" }, et = { class: "tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, tt = { class: "tpl:m-0 tpl:flex tpl:max-h-64 tpl:list-none tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-2" }, nt = { class: "tpl:text-xs tpl:text-[var(--tpl-text)]" }, rt = { class: "tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, it = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, at = /* @__PURE__ */ t({
505
+ __name: "CloudSaveGateModal",
506
+ props: {
507
+ open: { type: Boolean },
508
+ issues: {}
509
+ },
510
+ emits: ["cancel", "confirm"],
511
+ setup(e, { emit: t }) {
512
+ let i = t, { t: o } = X();
513
+ return (t, s) => (a(), _(T, {
514
+ "enter-active-class": "tpl:transition-opacity tpl:duration-150",
515
+ "leave-active-class": "tpl:transition-opacity tpl:duration-150",
516
+ "enter-from-class": "tpl:opacity-0",
517
+ "leave-to-class": "tpl:opacity-0"
518
+ }, {
519
+ default: c(() => [e.open ? (a(), E("div", {
520
+ key: 0,
521
+ role: "dialog",
522
+ "aria-modal": "true",
523
+ "aria-label": w(o).saveGate.title,
524
+ class: "tpl:fixed tpl:inset-0 tpl:z-50 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/40 tpl:p-6",
525
+ onClick: s[2] ||= m((e) => i("cancel"), ["self"])
526
+ }, [v("div", Ze, [
527
+ v("header", Qe, [D(w(Ce), {
528
+ size: 18,
529
+ "stroke-width": 2,
530
+ class: "tpl:text-[var(--tpl-warning)]"
531
+ }), v("h2", $e, r(w(o).saveGate.title), 1)]),
532
+ v("p", et, r(w(o).saveGate.body), 1),
533
+ v("ul", tt, [(a(!0), E(g, null, n(e.issues, (e) => (a(), E("li", {
534
+ key: `${e.ruleId}-${e.blockId ?? "template"}`,
535
+ class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:rounded tpl:px-2 tpl:py-1.5"
536
+ }, [v("span", nt, r(e.message), 1), v("span", rt, r(e.ruleId), 1)]))), 128))]),
537
+ v("footer", it, [v("button", {
538
+ type: "button",
539
+ class: "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)]",
540
+ onClick: s[0] ||= (e) => i("cancel")
541
+ }, r(w(o).saveGate.cancel), 1), v("button", {
542
+ type: "button",
543
+ class: "tpl:rounded-md tpl:bg-[var(--tpl-danger)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white",
544
+ onClick: s[1] ||= (e) => i("confirm")
545
+ }, r(w(o).saveGate.confirm), 1)])
546
+ ])], 8, Xe)) : f("", !0)]),
547
+ _: 1
548
+ }));
549
+ }
550
+ }), ot = {
551
+ class: "tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4",
552
+ style: {
553
+ "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
554
+ "backdrop-filter": "blur(12px)",
555
+ "-webkit-backdrop-filter": "blur(12px)",
556
+ "box-shadow": "var(--tpl-shadow-md)",
557
+ "border-bottom": "1px solid var(--tpl-border)"
558
+ }
559
+ }, st = { class: "tpl-header-left tpl:flex tpl:min-w-[200px] tpl:items-center tpl:gap-3" }, ct = {
560
+ key: 0,
561
+ class: "tpl:text-xs tpl:opacity-60 tpl:text-[var(--tpl-text-muted)]"
562
+ }, lt = { class: "tpl-header-center tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, ut = { class: "tpl-header-right tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, dt = ["data-tooltip"], ft = {
563
+ key: 1,
564
+ "aria-live": "polite",
565
+ class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-success)]"
566
+ }, pt = {
567
+ key: 2,
568
+ "aria-live": "polite",
569
+ class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
570
+ }, mt = ["aria-label", "aria-expanded"], ht = {
571
+ key: 0,
572
+ class: "tpl:inline-flex tpl:size-4.5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]"
573
+ }, gt = ["aria-expanded"], _t = {
574
+ key: 0,
575
+ class: "tpl:absolute tpl:right-0 tpl:top-full tpl:z-50 tpl:mt-1 tpl:origin-top-right"
576
+ }, vt = ["disabled"], yt = ["disabled"], bt = /* @__PURE__ */ t({
577
+ __name: "CloudHeader",
578
+ props: {
579
+ editor: {},
580
+ onBeforeHistoryUndo: { type: Function },
581
+ featureFlags: {},
582
+ panelState: {},
583
+ snapshotPreview: {},
584
+ commentsInstance: {},
585
+ testEmail: {},
586
+ websocket: {},
587
+ collaboration: {},
588
+ isCollaborationEnabled: { type: Boolean },
589
+ isSaveDisabled: { type: Boolean },
590
+ isSaving: { type: Boolean }
591
+ },
592
+ emits: ["save"],
593
+ setup(t) {
594
+ let n = s(() => import("./CollaboratorBar-BsXMY-8e.js")), i = s(() => import("./SnapshotHistory-DoqtH0cw.js")), o = s(() => import("./AiFeatureMenu-DoLD5Cde.js")), { t: l, format: u } = X();
595
+ return (s, d) => (a(), E("header", ot, [
596
+ v("div", st, [t.featureFlags.templateLimit.value === null ? f("", !0) : (a(), E("span", ct, r(w(u)(w(l).header.templatesUsed, {
597
+ used: t.featureFlags.templateCount.value,
598
+ max: t.featureFlags.templateLimit.value
599
+ })), 1))]),
600
+ v("div", lt, [
601
+ D(W, { "on-before-undo": t.onBeforeHistoryUndo }, null, 8, ["on-before-undo"]),
602
+ D(K, {
603
+ viewport: t.editor.state.viewport,
604
+ onChange: t.editor.setViewport
605
+ }, null, 8, ["viewport", "onChange"]),
606
+ D(U, {
607
+ "dark-mode": t.editor.state.darkMode,
608
+ onChange: t.editor.setDarkMode
609
+ }, null, 8, ["dark-mode", "onChange"]),
610
+ D(fe, {
611
+ "preview-mode": t.editor.state.previewMode,
612
+ onChange: t.editor.setPreviewMode
613
+ }, null, 8, ["preview-mode", "onChange"]),
614
+ t.collaboration && t.isCollaborationEnabled ? (a(), _(w(n), {
615
+ key: 0,
616
+ collaborators: t.collaboration.collaborators.value,
617
+ "is-connected": t.websocket.isConnected.value
618
+ }, null, 8, ["collaborators", "is-connected"])) : f("", !0),
619
+ t.snapshotPreview.snapshotHistoryInstance.value ? (a(), _(w(i), {
620
+ key: 1,
621
+ snapshots: t.snapshotPreview.snapshotHistorySnapshots.value,
622
+ "is-loading": t.snapshotPreview.snapshotHistoryIsLoading.value,
623
+ "is-restoring": t.snapshotPreview.snapshotHistoryIsRestoring.value,
624
+ onLoad: t.snapshotPreview.loadSnapshotHistory,
625
+ onNavigate: t.snapshotPreview.handleSnapshotNavigate
626
+ }, null, 8, [
627
+ "snapshots",
628
+ "is-loading",
629
+ "is-restoring",
630
+ "onLoad",
631
+ "onNavigate"
632
+ ])) : f("", !0)
633
+ ]),
634
+ v("div", ut, [
635
+ t.featureFlags.saveStatus.value === "error" ? (a(), E("div", {
636
+ key: 0,
637
+ "aria-live": "assertive",
638
+ class: "tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]",
639
+ "data-tooltip": t.featureFlags.saveErrorMessage.value
640
+ }, [D(w(be), {
641
+ size: 12,
642
+ "stroke-width": 2.5
643
+ }), p(" " + r(w(l).header.saveFailed), 1)], 8, dt)) : t.featureFlags.saveStatus.value === "saved" ? (a(), E("div", ft, [D(w(ye), {
644
+ size: 12,
645
+ "stroke-width": 2.5
646
+ }), p(" " + r(w(l).header.saved), 1)])) : t.editor.state.isDirty ? (a(), E("div", pt, [d[4] ||= v("span", { class: "tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]" }, null, -1), p(" " + r(w(l).header.unsaved), 1)])) : f("", !0),
647
+ t.commentsInstance.isEnabled.value && t.featureFlags.hasTemplateSaved.value ? (a(), E("button", {
648
+ key: 3,
649
+ "aria-label": t.commentsInstance.unresolvedCount.value > 0 ? `${w(l).comments.button} (${t.commentsInstance.unresolvedCount.value})` : w(l).comments.button,
650
+ "aria-expanded": t.panelState.commentsOpen.value,
651
+ class: e(w(Z)),
652
+ style: b({
653
+ backgroundColor: t.panelState.commentsOpen.value ? "var(--tpl-primary)" : "transparent",
654
+ color: t.panelState.commentsOpen.value ? "var(--tpl-bg)" : "var(--tpl-primary)",
655
+ borderColor: "var(--tpl-primary)"
656
+ }),
657
+ onClick: d[0] ||= (e) => t.panelState.commentsOpen.value = !t.panelState.commentsOpen.value
658
+ }, [
659
+ D(w(J), {
660
+ size: 16,
661
+ "stroke-width": 2
662
+ }),
663
+ p(" " + r(w(l).comments.button) + " ", 1),
664
+ t.commentsInstance.unresolvedCount.value > 0 && !t.panelState.commentsOpen.value ? (a(), E("span", ht, r(t.commentsInstance.unresolvedCount.value), 1)) : f("", !0)
665
+ ], 14, mt)) : f("", !0),
666
+ t.featureFlags.canUseAiGeneration.value && t.featureFlags.hasTemplateSaved.value ? (a(), E("div", {
667
+ key: 4,
668
+ ref: (e) => t.panelState.aiMenuRef.value = e,
669
+ class: "tpl:relative"
670
+ }, [v("button", {
671
+ "aria-expanded": t.panelState.aiMenuOpen.value,
672
+ class: e(["tpl-ai-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:whitespace-nowrap tpl:transition-all tpl:duration-200", t.panelState.aiButtonActive.value ? "tpl-ai-btn--active" : "tpl-ai-btn--idle"]),
673
+ onClick: d[1] ||= m((...e) => t.panelState.toggleAiMenu && t.panelState.toggleAiMenu(...e), ["stop"])
674
+ }, [D(w(Y), {
675
+ size: 16,
676
+ "stroke-width": 2,
677
+ class: "tpl-ai-btn-icon"
678
+ }), p(" " + r(w(l).aiChat.button), 1)], 10, gt), D(T, {
679
+ "enter-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-out",
680
+ "enter-from-class": "tpl:scale-95 tpl:opacity-0",
681
+ "enter-to-class": "tpl:scale-100 tpl:opacity-100",
682
+ "leave-active-class": "tpl:transition-all tpl:duration-100 tpl:ease-in",
683
+ "leave-from-class": "tpl:scale-100 tpl:opacity-100",
684
+ "leave-to-class": "tpl:scale-95 tpl:opacity-0"
685
+ }, {
686
+ default: c(() => [t.panelState.aiMenuOpen.value ? (a(), E("div", _t, [D(w(o), {
687
+ "active-feature": t.panelState.activeAiFeature.value,
688
+ onSelect: t.panelState.handleAiFeatureSelect
689
+ }, null, 8, ["active-feature", "onSelect"])])) : f("", !0)]),
690
+ _: 1
691
+ })], 512)) : f("", !0),
692
+ t.testEmail.isEnabled.value && t.featureFlags.canSendTestEmail.value ? (a(), E("button", {
693
+ key: 5,
694
+ class: e(w(Z)),
695
+ style: {
696
+ "background-color": "transparent",
697
+ color: "var(--tpl-primary)",
698
+ "border-color": "var(--tpl-primary)"
699
+ },
700
+ disabled: t.testEmail.isSending.value || !t.featureFlags.hasTemplateSaved.value,
701
+ onClick: d[2] ||= (e) => t.panelState.testEmailModalOpen.value = !0
702
+ }, [t.testEmail.isSending.value ? (a(), _(w(q), {
703
+ key: 1,
704
+ class: "tpl-spinner",
705
+ size: 16,
706
+ "stroke-width": 2
707
+ })) : (a(), _(w(Se), {
708
+ key: 0,
709
+ size: 16,
710
+ "stroke-width": 2
711
+ })), p(" " + r(w(l).testEmail.button), 1)], 10, vt)) : f("", !0),
712
+ v("button", {
713
+ class: e(w(Z)),
714
+ style: {
715
+ "background-color": "transparent",
716
+ color: "var(--tpl-primary)",
717
+ "border-color": "var(--tpl-primary)"
718
+ },
719
+ disabled: t.isSaveDisabled,
720
+ onClick: d[3] ||= (e) => s.$emit("save")
721
+ }, [t.isSaving ? (a(), _(w(q), {
722
+ key: 1,
723
+ class: "tpl-spinner",
724
+ size: 16,
725
+ "stroke-width": 2
726
+ })) : (a(), _(w(Be), {
727
+ key: 0,
728
+ size: 16,
729
+ "stroke-width": 2
730
+ })), p(" " + r(t.isSaving ? w(l).header.saving : w(l).header.save), 1)], 10, yt)
731
+ ])
732
+ ]));
733
+ }
734
+ }), xt = /* @__PURE__ */ t({
735
+ __name: "CloudPanels",
736
+ props: {
737
+ config: {},
738
+ editor: {},
739
+ core: {},
740
+ panelState: {},
741
+ planConfigInstance: {},
742
+ testEmail: {},
743
+ mediaLib: {},
744
+ savedModulesHeadless: {},
745
+ showSaveModuleDialog: { type: Boolean },
746
+ saveModulePreSelectedBlockId: {},
747
+ showModuleBrowserModal: { type: Boolean }
748
+ },
749
+ emits: [
750
+ "update:showSaveModuleDialog",
751
+ "update:saveModulePreSelectedBlockId",
752
+ "update:showModuleBrowserModal",
753
+ "send-test-email",
754
+ "module-insert"
755
+ ],
756
+ setup(e, { expose: t, emit: n }) {
757
+ let r = s(() => import("./AiChatSidebar-DeB0w_32.js")), i = s(() => import("./CommentsSidebar-DIWIa4rS.js")), o = s(() => import("./DesignReferenceSidebar-RDlnhL-6.js")), c = s(() => import("./TemplateScoringPanel-DQv2ZAiL.js")), l = s(() => import("./TestEmailModal-iIeYJYsj.js")), u = s(() => import("./SaveModuleDialog-ClovqI6h.js")), d = s(() => import("./ModuleBrowserModal-b7HbpByz.js")), p = s(async () => (await import("@aswin.dev/media-library")).MediaLibraryModal), m = n;
758
+ function v(e, t, n) {
759
+ t.history.record(), n.setContent(e), t.conditionPreview.reset();
760
+ }
761
+ function y(e, t) {
762
+ m("module-insert", e, t);
763
+ }
764
+ let b = h(null);
765
+ function x(e) {
766
+ b.value?.filterByBlock(e);
767
+ }
768
+ return t({ filterCommentsByBlock: x }), (t, n) => (a(), E(g, null, [
769
+ D(w(r), {
770
+ visible: e.panelState.aiChatOpen.value,
771
+ "on-apply": (t) => v(t, e.core, e.editor),
772
+ onClose: n[0] ||= (t) => e.panelState.aiChatOpen.value = !1
773
+ }, null, 8, ["visible", "on-apply"]),
774
+ D(w(c), {
775
+ visible: e.panelState.scoringPanelOpen.value,
776
+ onClose: n[1] ||= (t) => e.panelState.scoringPanelOpen.value = !1
777
+ }, null, 8, ["visible"]),
778
+ D(w(o), {
779
+ visible: e.panelState.designReferenceOpen.value,
780
+ "has-existing-blocks": e.editor.content.value.blocks.length > 0,
781
+ onClose: n[2] ||= (t) => e.panelState.designReferenceOpen.value = !1,
782
+ onApply: n[3] ||= (t) => v(t, e.core, e.editor)
783
+ }, null, 8, ["visible", "has-existing-blocks"]),
784
+ D(w(i), {
785
+ ref_key: "commentsSidebar",
786
+ ref: b,
787
+ visible: e.panelState.commentsOpen.value,
788
+ onClose: n[4] ||= (t) => e.panelState.commentsOpen.value = !1
789
+ }, null, 8, ["visible"]),
790
+ D(w(l), {
791
+ visible: e.panelState.testEmailModalOpen.value,
792
+ "allowed-emails": e.testEmail.allowedEmails.value,
793
+ "is-sending": e.testEmail.isSending.value,
794
+ error: e.testEmail.error.value,
795
+ onSend: n[5] ||= (e) => m("send-test-email", e),
796
+ onClose: n[6] ||= (t) => e.panelState.testEmailModalOpen.value = !1
797
+ }, null, 8, [
798
+ "visible",
799
+ "allowed-emails",
800
+ "is-sending",
801
+ "error"
802
+ ]),
803
+ e.planConfigInstance.hasFeature("saved_modules") && e.config.modules !== !1 ? (a(), _(w(u), {
804
+ key: 0,
805
+ visible: e.showSaveModuleDialog,
806
+ "pre-selected-block-id": e.saveModulePreSelectedBlockId,
807
+ onClose: n[7] ||= (e) => {
808
+ m("update:showSaveModuleDialog", !1), m("update:saveModulePreSelectedBlockId", null);
809
+ },
810
+ onSaved: n[8] ||= (t) => e.savedModulesHeadless.loadModules()
811
+ }, null, 8, ["visible", "pre-selected-block-id"])) : f("", !0),
812
+ e.planConfigInstance.hasFeature("saved_modules") && e.config.modules !== !1 ? (a(), _(w(d), {
813
+ key: 1,
814
+ visible: e.showModuleBrowserModal,
815
+ onClose: n[9] ||= (e) => m("update:showModuleBrowserModal", !1),
816
+ onInsert: y
817
+ }, null, 8, ["visible"])) : f("", !0),
818
+ D(w(p), {
819
+ visible: e.panelState.mediaLibraryOpen.value,
820
+ accept: e.panelState.mediaLibraryAccept.value,
821
+ onSelect: e.mediaLib.handleMediaSelect,
822
+ onClose: e.mediaLib.handleMediaLibraryClose
823
+ }, null, 8, [
824
+ "visible",
825
+ "accept",
826
+ "onSelect",
827
+ "onClose"
828
+ ])
829
+ ], 64));
830
+ }
831
+ }), St = {
832
+ key: 0,
833
+ class: "tpl-loading tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]"
834
+ }, Ct = { class: "tpl:flex tpl:flex-1 tpl:overflow-hidden" }, wt = { class: "tpl:flex tpl:w-12 tpl:shrink-0 tpl:flex-col tpl:items-center tpl:gap-4 tpl:py-5 tpl:border-r tpl:border-[var(--tpl-border)]" }, Tt = /* @__PURE__ */ t({
835
+ __name: "CloudLoadingOverlay",
836
+ props: { visible: { type: Boolean } },
837
+ setup(e) {
838
+ return (t, r) => e.visible ? (a(), E("div", St, [r[1] ||= O("<div class=\"tpl:flex tpl:h-14 tpl:shrink-0 tpl:items-center tpl:justify-between tpl:px-4 tpl:border-b tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-5 tpl:w-28 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl:flex tpl:gap-3\"><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div></div>", 1), v("div", Ct, [v("div", wt, [(a(), E(g, null, n(5, (e) => v("div", {
839
+ key: e,
840
+ class: "tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]"
841
+ })), 64))]), r[0] ||= O("<div class=\"tpl:flex tpl:flex-1 tpl:items-start tpl:justify-center tpl:overflow-auto tpl:p-8 tpl:bg-[var(--tpl-canvas-bg)]\"><div class=\"tpl:w-full tpl:max-w-[600px] tpl:rounded-[var(--tpl-radius)] tpl:p-6 tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-sm)]\"><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-3/4 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-5/6 tpl:rounded\"></div></div><div class=\"tpl:py-4\"><div class=\"tpl-shimmer tpl:h-44 tpl:w-full tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-2/3 tpl:rounded\"></div></div><div class=\"tpl:flex tpl:justify-center tpl:py-4\"><div class=\"tpl-shimmer tpl:h-10 tpl:w-36 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/2 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/3 tpl:rounded\"></div></div></div></div><div class=\"tpl:flex tpl:w-[320px] tpl:shrink-0 tpl:flex-col tpl:gap-4 tpl:p-4 tpl:border-l tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-8 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div></div>", 2)])])) : f("", !0);
842
+ }
843
+ }), Et = {
844
+ key: 0,
845
+ role: "alert",
846
+ class: "tpl-error tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-6 tpl:px-8 tpl:bg-[var(--tpl-bg)]"
847
+ }, Dt = { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]" }, Ot = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center" }, kt = { class: "tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]" }, At = { class: "tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, jt = /* @__PURE__ */ t({
848
+ __name: "CloudErrorOverlay",
849
+ props: {
850
+ error: {},
851
+ visible: { type: Boolean }
852
+ },
853
+ emits: ["retry"],
854
+ setup(e, { emit: t }) {
855
+ let n = t, { t: i } = X();
856
+ function o(e) {
857
+ return "isUnauthorized" in e && e.isUnauthorized ? i.error.authFailed : "isNotFound" in e && e.isNotFound ? i.error.templateNotFound : i.error.defaultMessage;
858
+ }
859
+ function s(e) {
860
+ return "isNotFound" in e && !!e.isNotFound;
861
+ }
862
+ return (t, c) => e.visible && e.error ? (a(), E("div", Et, [
863
+ v("div", Dt, [D(w(be), {
864
+ size: 32,
865
+ "stroke-width": 1.5,
866
+ class: "tpl:text-[var(--tpl-danger)]"
867
+ })]),
868
+ v("div", Ot, [v("h2", kt, r(w(i).error.title), 1), v("p", At, r(o(e.error)), 1)]),
869
+ s(e.error) ? f("", !0) : (a(), E("button", {
870
+ key: 0,
871
+ class: "tpl-btn tpl-btn-primary tpl:inline-flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
872
+ onClick: c[0] ||= (e) => n("retry")
873
+ }, r(w(i).error.retry), 1))
874
+ ])) : f("", !0);
875
+ }
876
+ }), Mt = {
877
+ key: 0,
878
+ class: "tpl-preview-banner tpl:absolute tpl:top-14 tpl:right-0 tpl:left-0 tpl:z-40 tpl:flex tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-4 tpl:py-3 tpl:bg-[var(--tpl-primary-light)] tpl:border-b tpl:border-[var(--tpl-primary)]"
879
+ }, Nt = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:text-[var(--tpl-text)]" }, Pt = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ft = /* @__PURE__ */ t({
880
+ __name: "SnapshotPreviewBanner",
881
+ props: { visible: { type: Boolean } },
882
+ emits: ["cancel", "confirm"],
883
+ setup(e, { emit: t }) {
884
+ let n = t, { t: i } = X();
885
+ return (t, o) => e.visible ? (a(), E("div", Mt, [v("div", Nt, [D(w(xe), {
886
+ size: 18,
887
+ "stroke-width": 2,
888
+ class: "tpl:text-[var(--tpl-primary)]"
889
+ }), v("span", null, r(w(i).snapshotPreview.message), 1)]), v("div", Pt, [v("button", {
890
+ class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]",
891
+ style: { "background-color": "transparent" },
892
+ onClick: o[0] ||= (e) => n("cancel")
893
+ }, r(w(i).snapshotPreview.cancel), 1), v("button", {
894
+ class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
895
+ onClick: o[1] ||= (e) => n("confirm")
896
+ }, r(w(i).snapshotPreview.restore), 1)])])) : f("", !0);
897
+ }
898
+ }), It = {
899
+ key: 0,
900
+ role: "status",
901
+ "aria-live": "polite",
902
+ class: "tpl:absolute tpl:top-16 tpl:left-1/2 tpl:z-toast tpl:-translate-x-1/2 tpl:rounded-[var(--tpl-radius)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:shadow-lg",
903
+ style: {
904
+ "background-color": "var(--tpl-warning-light)",
905
+ color: "var(--tpl-text)",
906
+ border: "1px solid var(--tpl-warning)"
907
+ }
908
+ }, Lt = /* @__PURE__ */ t({
909
+ __name: "CollabUndoToast",
910
+ props: { visible: { type: Boolean } },
911
+ setup(e) {
912
+ let { t } = H();
913
+ return (n, i) => e.visible ? (a(), E("div", It, r(w(t).history.collabWarning), 1)) : f("", !0);
914
+ }
915
+ }), Rt = ["data-tpl-theme"], zt = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, Bt = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, Vt = ["aria-label"], Ht = /* @__PURE__ */ we(/* @__PURE__ */ t({
916
+ __name: "CloudEditor",
917
+ props: {
918
+ config: {},
919
+ translations: {},
920
+ cloudTranslations: {},
921
+ fontsManager: {}
922
+ },
923
+ emits: ["ready"],
924
+ setup(t, { expose: n, emit: s }) {
925
+ let d = t;
926
+ o(ie, d.cloudTranslations);
927
+ let m = s, C = h(null), O = h(null), k = Ke({
928
+ config: d.config,
929
+ translations: d.translations,
930
+ fontsManager: d.fontsManager,
931
+ emit: m,
932
+ getCommentsSidebar: () => C.value ? { filterByBlock: C.value.filterCommentsByBlock } : null
933
+ }), { isInitializing: j, isAuthReady: N, initError: te, planConfigInstance: F, websocket: I, collaboration: L, isCollaborationEnabled: ne, editor: R, core: z, featureFlags: B, mediaLib: re, exporter: ae, testEmail: V, commentsInstance: H, savedModulesHeadless: se, panelState: U, snapshotPreview: W, collabWarning: G, showSaveModuleDialog: fe, showModuleBrowserModal: K, saveModulePreSelectedBlockId: ye, setThemeOverrides: be, setUiTheme: xe } = k, q = h("blocks");
934
+ o(oe, q);
935
+ let J = S(() => P(d.config.editorType) === "popup"), Se = S(() => J.value && q.value === "displayRules"), Y = S(() => J.value && q.value === "schedule"), Ce = S(() => q.value === "design"), we = S(() => J.value && (Se.value || Y.value || Ce.value)), X = S(() => Se.value || Y.value);
936
+ l(() => [N.value, R.content.value.settings.popup], ([e]) => {
937
+ if (!e || !J.value || R.content.value.settings.popup) return;
938
+ let t = A();
939
+ R.updateSettings({
940
+ popup: t,
941
+ width: M[t.design.sizePreset]
942
+ });
943
+ }, { immediate: !0 });
944
+ async function Z(e) {
945
+ try {
946
+ await V.sendTestEmail(e), U.testEmailModalOpen.value = !1;
947
+ } catch {}
948
+ }
949
+ function Te(e, t) {
950
+ for (let n = 0; n < e.content.length; n++) {
951
+ let r = ee(e.content[n]), i = t === void 0 ? void 0 : t + n;
952
+ R.addBlock(r, void 0, void 0, i);
953
+ }
954
+ K.value = !1;
955
+ }
956
+ let Q = Je({
957
+ config: d.config,
958
+ editor: R,
959
+ websocket: I,
960
+ planConfigInstance: F,
961
+ snapshotPreview: W,
962
+ core: z,
963
+ exporter: ae,
964
+ featureFlags: B,
965
+ isDestroyed: k.isDestroyed
966
+ }), Ee = S(() => {
967
+ if (R.state.previewMode) return ["tpl:left-0", "tpl:right-0"];
968
+ let e = U.rightPanelOpen.value ? "tpl:right-[680px]" : "tpl:right-[320px]";
969
+ if (!J.value) return ["tpl:left-12", e];
970
+ let t;
971
+ t = q.value === "blocks" ? "tpl:left-[272px]" : Ce.value ? "tpl:left-[392px]" : "tpl:left-[72px]";
972
+ let n = we.value ? "tpl:right-0" : e;
973
+ return [t, n];
974
+ }), $ = Ye({
975
+ issues: z.accessibilityLint ? z.accessibilityLint.issues : h([]),
976
+ planConfig: F.config
977
+ });
978
+ async function De() {
979
+ await $.tryRunSave(() => Q.saveTemplate().catch((e) => d.config.onError?.(e)));
980
+ }
981
+ return k.onSaveHook.value = De, y(() => {
982
+ k.initialize();
983
+ }), i(() => {
984
+ k.destroy();
985
+ }), n({
986
+ getContent: () => R.content.value,
987
+ setContent: (e) => R.setContent(e),
988
+ setTheme: xe,
989
+ setThemeOverrides: be,
990
+ undo: () => {
991
+ G.showCollabUndoWarning(), z.history.undo();
992
+ },
993
+ redo: () => z.history.redo(),
994
+ canUndo: () => z.history.canUndo.value,
995
+ canRedo: () => z.history.canRedo.value,
996
+ create: Q.createTemplate,
997
+ load: Q.loadTemplate,
998
+ save: Q.saveTemplate,
999
+ sendTestEmail: V.sendTestEmail,
1000
+ startTour: (e) => O.value?.start(e),
1001
+ dismissTour: () => O.value?.dismiss(),
1002
+ resetTourDismissed: () => de(d.config.tour),
1003
+ isTourDismissed: () => d.config.tour ? ce(d.config.tour) : !0
1004
+ }), (n, i) => (a(), E("div", {
1005
+ class: e(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": w(R).state.darkMode }]),
1006
+ "data-tpl-theme": w(z).resolvedTheme.value,
1007
+ style: b(w(z).themeStyles.value)
1008
+ }, [
1009
+ D(T, {
1010
+ "enter-active-class": "tpl:transition-opacity tpl:duration-200",
1011
+ "enter-from-class": "tpl:opacity-100",
1012
+ "enter-to-class": "tpl:opacity-100",
1013
+ "leave-active-class": "tpl:transition-opacity tpl:duration-300",
1014
+ "leave-from-class": "tpl:opacity-100",
1015
+ "leave-to-class": "tpl:opacity-0"
1016
+ }, {
1017
+ default: c(() => [D(Tt, { visible: w(j) || w(R).state.isLoading }, null, 8, ["visible"])]),
1018
+ _: 1
1019
+ }),
1020
+ D(T, {
1021
+ "enter-active-class": "tpl:transition-opacity tpl:duration-200",
1022
+ "enter-from-class": "tpl:opacity-0",
1023
+ "enter-to-class": "tpl:opacity-100",
1024
+ "leave-active-class": "tpl:transition-opacity tpl:duration-300",
1025
+ "leave-from-class": "tpl:opacity-100",
1026
+ "leave-to-class": "tpl:opacity-0"
1027
+ }, {
1028
+ default: c(() => [D(jt, {
1029
+ error: w(te),
1030
+ visible: !!w(te) && !w(j),
1031
+ onRetry: w(k).initialize
1032
+ }, null, 8, [
1033
+ "error",
1034
+ "visible",
1035
+ "onRetry"
1036
+ ])]),
1037
+ _: 1
1038
+ }),
1039
+ D(bt, {
1040
+ editor: w(R),
1041
+ "on-before-history-undo": w(G).showCollabUndoWarning,
1042
+ "feature-flags": w(B),
1043
+ "panel-state": w(U),
1044
+ "snapshot-preview": w(W),
1045
+ "comments-instance": w(H),
1046
+ "test-email": w(V),
1047
+ websocket: w(I),
1048
+ collaboration: w(L),
1049
+ "is-collaboration-enabled": w(ne),
1050
+ "is-saving": w(R).state.isSaving || w(B).isSaveExporting.value,
1051
+ "is-save-disabled": w(R).state.isSaving || w(B).isSaveExporting.value || !w(R).state.isDirty,
1052
+ onSave: De
1053
+ }, null, 8, [
1054
+ "editor",
1055
+ "on-before-history-undo",
1056
+ "feature-flags",
1057
+ "panel-state",
1058
+ "snapshot-preview",
1059
+ "comments-instance",
1060
+ "test-email",
1061
+ "websocket",
1062
+ "collaboration",
1063
+ "is-collaboration-enabled",
1064
+ "is-saving",
1065
+ "is-save-disabled"
1066
+ ]),
1067
+ D(at, {
1068
+ open: w($).modalOpen.value,
1069
+ issues: w($).blockingIssues.value,
1070
+ onCancel: w($).cancel,
1071
+ onConfirm: w($).confirmAndSave
1072
+ }, null, 8, [
1073
+ "open",
1074
+ "issues",
1075
+ "onCancel",
1076
+ "onConfirm"
1077
+ ]),
1078
+ D(Ft, {
1079
+ visible: w(W).isPreviewingSnapshot.value,
1080
+ onCancel: w(W).cancelPreview,
1081
+ onConfirm: w(W).confirmRestoreSnapshot
1082
+ }, null, 8, [
1083
+ "visible",
1084
+ "onCancel",
1085
+ "onConfirm"
1086
+ ]),
1087
+ D(T, {
1088
+ "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
1089
+ "enter-from-class": "tpl:translate-y-[-8px] tpl:opacity-0",
1090
+ "enter-to-class": "tpl:translate-y-0 tpl:opacity-100",
1091
+ "leave-active-class": "tpl:transition-all tpl:duration-300 tpl:ease-in",
1092
+ "leave-from-class": "tpl:translate-y-0 tpl:opacity-100",
1093
+ "leave-to-class": "tpl:translate-y-[-8px] tpl:opacity-0"
1094
+ }, {
1095
+ default: c(() => [D(Lt, { visible: w(G).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
1096
+ _: 1
1097
+ }),
1098
+ u(D(he, null, null, 512), [[x, !w(R).state.previewMode]]),
1099
+ v("div", {
1100
+ class: e(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [...Ee.value, w(W).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
1101
+ style: b({
1102
+ transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
1103
+ backgroundColor: X.value ? "var(--tpl-bg)" : "var(--tpl-canvas-bg)"
1104
+ })
1105
+ }, [J.value && q.value === "displayRules" ? (a(), _(me, { key: 0 })) : J.value && q.value === "schedule" ? (a(), _(ve, {
1106
+ key: 1,
1107
+ layout: "standalone"
1108
+ })) : (a(), E(g, { key: 2 }, [v("div", zt, [D(T, { name: "tpl-restore-btn" }, {
1109
+ default: c(() => [w(z).conditionPreview.hasHiddenBlocks.value ? (a(), E("button", {
1110
+ key: 0,
1111
+ class: "tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80",
1112
+ style: {
1113
+ "background-color": "var(--tpl-warning-light)",
1114
+ color: "var(--tpl-warning)",
1115
+ "border-color": "var(--tpl-warning)",
1116
+ "backdrop-filter": "blur(8px)"
1117
+ },
1118
+ onClick: i[0] ||= (e) => w(z).conditionPreview.reset()
1119
+ }, [D(w(ue), {
1120
+ size: 13,
1121
+ "stroke-width": 2
1122
+ }), p(" " + r(w(z).t.blockSettings.restoreHiddenBlocks), 1)])) : f("", !0)]),
1123
+ _: 1
1124
+ })]), v("main", Bt, [D(pe, {
1125
+ viewport: w(R).state.viewport,
1126
+ content: w(R).content.value,
1127
+ "selected-block-id": w(R).state.selectedBlockId,
1128
+ "dark-mode": w(R).state.darkMode,
1129
+ "preview-mode": w(R).state.previewMode,
1130
+ "multi-page-canvas": t.config.multiPageCanvas ?? !1,
1131
+ "locked-blocks": w(L)?.lockedBlocks.value ?? void 0,
1132
+ onSelectBlock: w(R).selectBlock,
1133
+ onOpenAiChat: i[1] ||= (e) => w(U).aiChatOpen.value = !0,
1134
+ onOpenDesignReference: i[2] ||= (e) => w(U).designReferenceOpen.value = !0
1135
+ }, null, 8, [
1136
+ "viewport",
1137
+ "content",
1138
+ "selected-block-id",
1139
+ "dark-mode",
1140
+ "preview-mode",
1141
+ "multi-page-canvas",
1142
+ "locked-blocks",
1143
+ "onSelectBlock"
1144
+ ])])], 64))], 6),
1145
+ t.config.branding !== !1 && !w(B).isWhiteLabeled.value ? (a(), _(_e, {
1146
+ key: 0,
1147
+ "position-class": Ee.value
1148
+ }, null, 8, ["position-class"])) : f("", !0),
1149
+ v("div", {
1150
+ class: "tpl-sr-only",
1151
+ role: "status",
1152
+ "aria-live": "polite",
1153
+ "aria-atomic": "true",
1154
+ "aria-label": w(z).t.landmarks.reorderAnnouncements
1155
+ }, r(w(z).keyboardReorder.announcement.value), 9, Vt),
1156
+ u(D(le, {
1157
+ "selected-block": w(R).selectedBlock.value,
1158
+ settings: w(R).content.value.settings,
1159
+ "shifted-left": w(U).rightPanelOpen.value,
1160
+ onUpdateBlock: i[3] ||= (e) => w(R).updateBlock(w(R).selectedBlock.value.id, e),
1161
+ onDeleteBlock: i[4] ||= (e) => w(z).blockActions.deleteBlock(w(R).selectedBlock.value.id),
1162
+ onDuplicateBlock: i[5] ||= (e) => w(z).blockActions.duplicateBlock(w(R).selectedBlock.value),
1163
+ onUpdateSettings: w(R).updateSettings
1164
+ }, null, 8, [
1165
+ "selected-block",
1166
+ "settings",
1167
+ "shifted-left",
1168
+ "onUpdateSettings"
1169
+ ]), [[x, !w(R).state.previewMode && !we.value]]),
1170
+ !w(j) && w(N) ? (a(), _(xt, {
1171
+ key: 1,
1172
+ ref_key: "cloudPanelsRef",
1173
+ ref: C,
1174
+ config: d.config,
1175
+ editor: w(R),
1176
+ core: w(z),
1177
+ "panel-state": w(U),
1178
+ "plan-config-instance": w(F),
1179
+ "test-email": w(V),
1180
+ "media-lib": w(re),
1181
+ "saved-modules-headless": w(se),
1182
+ "show-save-module-dialog": w(fe),
1183
+ "save-module-pre-selected-block-id": w(ye),
1184
+ "show-module-browser-modal": w(K),
1185
+ "onUpdate:showSaveModuleDialog": i[6] ||= (e) => fe.value = e,
1186
+ "onUpdate:saveModulePreSelectedBlockId": i[7] ||= (e) => ye.value = e,
1187
+ "onUpdate:showModuleBrowserModal": i[8] ||= (e) => K.value = e,
1188
+ onSendTestEmail: Z,
1189
+ onModuleInsert: Te
1190
+ }, null, 8, [
1191
+ "config",
1192
+ "editor",
1193
+ "core",
1194
+ "panel-state",
1195
+ "plan-config-instance",
1196
+ "test-email",
1197
+ "media-lib",
1198
+ "saved-modules-headless",
1199
+ "show-save-module-dialog",
1200
+ "save-module-pre-selected-block-id",
1201
+ "show-module-browser-modal"
1202
+ ])) : f("", !0),
1203
+ t.config.tour ? (a(), _(ge, {
1204
+ key: 2,
1205
+ ref_key: "editorTourRef",
1206
+ ref: O,
1207
+ "tour-config": t.config.tour,
1208
+ "dark-mode": w(R).state.darkMode
1209
+ }, null, 8, ["tour-config", "dark-mode"])) : f("", !0)
1210
+ ], 14, Rt));
1211
+ }
1212
+ }), [["__scopeId", "data-v-6985a9ad"]]);
1213
+ //#endregion
1214
+ export { Ht as default };