@guodun/antdv 1.6.2 → 1.6.4

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 (69) hide show
  1. package/dist/es/components/dept-selector/src/DeptSelector.vue.mjs +52 -46
  2. package/dist/es/components/dept-selector/src/types.mjs +4 -0
  3. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.mjs +67 -106
  4. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +791 -794
  5. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-authoring.mjs +2 -9
  6. package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +34 -36
  7. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  8. package/dist/es/components/pro-menu-tree/src/pro-menu-tree.mjs +108 -103
  9. package/dist/es/components/pro-menu-tree/src/types.mjs +4 -0
  10. package/dist/es/components/pro-selector/src/ProUserSelector.vue.mjs +50 -44
  11. package/dist/es/components/pro-selector/src/types.mjs +4 -0
  12. package/dist/es/components/pro-selector-group/src/index.vue.mjs +47 -40
  13. package/dist/es/components/role-selector/src/RoleSelector.vue.mjs +50 -44
  14. package/dist/es/components/role-selector/src/types.mjs +5 -1
  15. package/dist/es/components/selector-core/components/SelectorDialog.vue.mjs +242 -233
  16. package/dist/es/components/selector-core/selection-theme.mjs +35 -0
  17. package/dist/es/components/selector-core/useSelectorData.mjs +1 -1
  18. package/dist/lib/components/dept-selector/src/DeptSelector.vue.cjs +1 -1
  19. package/dist/lib/components/dept-selector/src/types.cjs +1 -1
  20. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.cjs +1 -1
  21. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  22. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-authoring.cjs +1 -1
  23. package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
  24. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  25. package/dist/lib/components/pro-menu-tree/src/pro-menu-tree.cjs +1 -1
  26. package/dist/lib/components/pro-menu-tree/src/types.cjs +1 -1
  27. package/dist/lib/components/pro-selector/src/ProUserSelector.vue.cjs +1 -1
  28. package/dist/lib/components/pro-selector/src/types.cjs +1 -1
  29. package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
  30. package/dist/lib/components/role-selector/src/RoleSelector.vue.cjs +1 -1
  31. package/dist/lib/components/role-selector/src/types.cjs +1 -1
  32. package/dist/lib/components/selector-core/components/SelectorDialog.vue.cjs +1 -1
  33. package/dist/lib/components/selector-core/selection-theme.cjs +1 -0
  34. package/dist/lib/components/selector-core/useSelectorData.cjs +1 -1
  35. package/dist/theme/dept-selector.css +1 -0
  36. package/dist/theme/icon.css +1 -1
  37. package/dist/theme/index.css +1 -1
  38. package/dist/theme/pro-menu-tree.css +1 -1
  39. package/dist/theme/pro-selector-group.css +1 -0
  40. package/dist/theme/role-selector.css +1 -0
  41. package/dist/theme/selector-core.css +1 -1
  42. package/dist/types/components/dept-selector/index.d.ts +15 -0
  43. package/dist/types/components/dept-selector/src/DeptSelector.vue.d.ts +9 -0
  44. package/dist/types/components/dept-selector/src/types.d.ts +7 -0
  45. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.d.ts +0 -3
  46. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +2 -2
  47. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +0 -3
  48. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-authoring.d.ts +2 -4
  49. package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +0 -3
  50. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +0 -4
  51. package/dist/types/components/pro-menu-tree/index.d.ts +9 -0
  52. package/dist/types/components/pro-menu-tree/src/pro-menu-tree.d.ts +9 -0
  53. package/dist/types/components/pro-menu-tree/src/types.d.ts +7 -0
  54. package/dist/types/components/pro-selector/index.d.ts +59 -2
  55. package/dist/types/components/pro-selector/src/ProUserSelector.vue.d.ts +9 -0
  56. package/dist/types/components/pro-selector/src/ProUserSelectorDrilldown.vue.d.ts +28 -4
  57. package/dist/types/components/pro-selector/src/types.d.ts +7 -0
  58. package/dist/types/components/pro-selector-group/index.d.ts +3 -0
  59. package/dist/types/components/pro-selector-group/src/index.vue.d.ts +1 -0
  60. package/dist/types/components/pro-selector-group/src/types.d.ts +5 -0
  61. package/dist/types/components/role-selector/index.d.ts +30 -0
  62. package/dist/types/components/role-selector/src/RoleSelector.vue.d.ts +9 -0
  63. package/dist/types/components/role-selector/src/types.d.ts +9 -2
  64. package/dist/types/components/selector-core/components/SelectorDialog.vue.d.ts +2 -0
  65. package/dist/types/components/selector-core/selection-theme.d.ts +20 -0
  66. package/package.json +3 -3
  67. package/dist/es/components/pro-contract-template-designer/src/utils/clause-snippets.mjs +0 -56
  68. package/dist/lib/components/pro-contract-template-designer/src/utils/clause-snippets.cjs +0 -1
  69. package/dist/types/components/pro-contract-template-designer/src/utils/clause-snippets.d.ts +0 -10
@@ -138,45 +138,44 @@ var Vt = {
138
138
  let E = y(""), D = y(T.value.pages[0]?.id ?? ""), O = y(!1), k = y([]), A = /* @__PURE__ */ new Map(), Sn = y(!1), Cn = y(""), wn = y(!1), Tn = y(), En = y(), Dn = y(""), On = y(!1), kn = y(""), An = y(!1), jn = y({
139
139
  values: {},
140
140
  variables: []
141
- }), j = y(1), M = y(!1), Mn = y(!1), Nn = y(!1), N = y(!1), Pn = y(!1), Fn = y(), P = y(!1), In = y("header"), Ln = y(!1), Rn = y({}), zn = y(""), F = y(!1), I = y(!1), Bn = y(!1), Vn = y(!1), Hn = y(!1), Un = y(!1), Wn = y(!1), Gn = y(""), Kn = y(), qn = y(), Jn = y(""), Yn = y(!1), L = y(), Xn = y(), R = y(), Zn = y(), Qn = y(!1), $n, er = y(!1), tr, nr = y(!1), rr = y(""), z = y(), ir = y(), B = y(), ar = y(), or = y(), sr = y(), V = y(""), H = y(Qe("idle", "暂无本地草稿")), cr = y({
141
+ }), j = y(1), M = y(!1), Mn = y(!1), Nn = y(!1), N = y(!1), P = y(!1), Pn = y(), F = y(!1), Fn = y("header"), In = y(!1), Ln = y({}), Rn = y(""), I = y(!1), L = y(!1), zn = y(!1), Bn = y(!1), Vn = y(!1), Hn = y(!1), Un = y(!1), Wn = y(""), Gn = y(), Kn = y(), qn = y(""), Jn = y(!1), R = y(), Yn = y(), z = y(), Xn = y(), Zn = y(!1), Qn, $n = y(!1), er, tr = y(!1), nr = y(""), B = y(), rr = y(), V = y(), ir = y(), ar = y(), or = y(), H = y(""), U = y(Qe("idle", "暂无本地草稿")), sr = y({
142
142
  rows: 3,
143
143
  cols: 3,
144
144
  withHeaderRow: !0
145
- }), lr = /* @__PURE__ */ new WeakSet(), ur = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), dr, fr, pr = !1, mr = !1, hr, U = f(() => l.readonly || l.disabled), { panel: gr, query: _r, replacement: vr, matchCase: yr, matches: br, currentIndex: xr, currentMatch: Sr, feedback: Cr, highlightQuery: wr, open: Tr, close: Er, navigate: Dr, replaceCurrent: Or, replaceAll: kr, insertSnippet: Ar, handleKeydown: jr } = He({
145
+ }), cr = /* @__PURE__ */ new WeakSet(), lr = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), ur, dr, fr = !1, pr = !1, mr, W = f(() => l.readonly || l.disabled), { panel: hr, query: gr, replacement: _r, matchCase: vr, matches: yr, currentIndex: br, currentMatch: xr, feedback: Sr, highlightQuery: Cr, open: wr, close: Tr, navigate: Er, replaceCurrent: Dr, replaceAll: Or, handleKeydown: kr } = He({
146
146
  pages: () => T.value.pages,
147
147
  fileId: () => w.value,
148
- readonly: () => U.value,
148
+ readonly: () => W.value,
149
149
  root: () => rn.value,
150
150
  pageRefs: A,
151
- activatePage: xo,
151
+ activatePage: bo,
152
152
  beforeOpen: () => {
153
- $(), ls(), N.value = !1;
153
+ $(), cs(), N.value = !1;
154
154
  },
155
155
  focusPanel: () => pn.value?.focusPanel(),
156
- focusTrigger: (e) => pn.value?.focusTrigger(e),
157
- command: Z
158
- }), Mr = f(() => !!(L.value || gr.value || z.value || B.value || F.value || I.value || Ln.value || Bn.value || Vn.value || Hn.value || Un.value || Wn.value)), Nr = f(() => !!l.enableDraftCache && !U.value), Pr = f(() => C.value.find((e) => e.id === w.value) ?? C.value[0]), Fr = f(() => Tn.value ? le(Tn.value) : []), Ir = f(() => (En.value ?? []).map((e) => ({
156
+ focusTrigger: (e) => pn.value?.focusTrigger(e)
157
+ }), Ar = f(() => !!(R.value || hr.value || B.value || V.value || I.value || L.value || In.value || zn.value || Bn.value || Vn.value || Hn.value || Un.value)), jr = f(() => !!l.enableDraftCache && !W.value), Mr = f(() => C.value.find((e) => e.id === w.value) ?? C.value[0]), Nr = f(() => Tn.value ? le(Tn.value) : []), Pr = f(() => (En.value ?? []).map((e) => ({
159
158
  file: e,
160
159
  pages: le(e.template)
161
- }))), Lr = f(() => Ir.value.find((e) => e.file.id === Dn.value) ?? Ir.value[0]), W = f(() => T.value.pages.find((e) => e.id === D.value) ?? T.value.pages[0]), Rr = f(() => Se(W.value?.pageSize, T.value.pageSize)), zr = f(() => O.value && k.value.length === 0), Br = f(() => O.value ? zr.value ? "校验通过,正文变量与变量配置一致" : `发现 ${k.value.length} 个校验问题` : ""), Vr = f(() => {
162
- let e = W.value?.title || "合同正文";
163
- return `${S.value && Pr.value ? `${Pr.value.name} · ` : ""}${e} · ${Rr.value.label} · 共 ${T.value.pages.length} 页`;
164
- }), Hr = f(() => ({
160
+ }))), Fr = f(() => Pr.value.find((e) => e.file.id === Dn.value) ?? Pr.value[0]), G = f(() => T.value.pages.find((e) => e.id === D.value) ?? T.value.pages[0]), Ir = f(() => Se(G.value?.pageSize, T.value.pageSize)), Lr = f(() => O.value && k.value.length === 0), Rr = f(() => O.value ? Lr.value ? "校验通过,正文变量与变量配置一致" : `发现 ${k.value.length} 个校验问题` : ""), zr = f(() => {
161
+ let e = G.value?.title || "合同正文";
162
+ return `${S.value && Mr.value ? `${Mr.value.name} · ` : ""}${e} · ${Ir.value.label} · 共 ${T.value.pages.length} 页`;
163
+ }), Br = f(() => ({
165
164
  none: "无装饰",
166
165
  "page-number": "标准页码",
167
166
  "internal-review": "内部审阅",
168
167
  draft: "草稿",
169
168
  custom: "自定义"
170
- })[ee(T.value.pageDecorations)]), Ur = f(() => {
169
+ })[ee(T.value.pageDecorations)]), Vr = f(() => {
171
170
  let e = o(T.value.pageDecorations);
172
171
  return {
173
172
  header: e.header.enabled,
174
173
  footer: e.footer.enabled,
175
174
  watermark: e.watermark.enabled
176
175
  };
177
- }), Wr = f(() => Object.values(Ur.value).filter(Boolean).length), Gr = f(() => {
178
- switch (H.value.type) {
179
- case "saved": return `草稿已缓存 ${$e(H.value.savedAt)}`;
176
+ }), Hr = f(() => Object.values(Vr.value).filter(Boolean).length), Ur = f(() => {
177
+ switch (U.value.type) {
178
+ case "saved": return `草稿已缓存 ${$e(U.value.savedAt)}`;
180
179
  case "restored": return "已恢复本地草稿";
181
180
  case "too-large": return "草稿过大,未缓存";
182
181
  case "unavailable":
@@ -185,23 +184,23 @@ var Vt = {
185
184
  case "cleared": return "草稿缓存已清理";
186
185
  default: return "";
187
186
  }
188
- }), Kr = f(() => ({
189
- "is-success": H.value.type === "saved" || H.value.type === "restored",
190
- "is-warning": H.value.type === "too-large",
191
- "is-error": H.value.type === "unavailable" || H.value.type === "read-failed" || H.value.type === "write-failed"
192
- })), qr = f(() => `${Math.round(j.value * 100)}%`), Jr = f(() => i(l.fontFamilies, l.fontFamilyMode)), Yr = f(() => Jr.value.map((e) => ({
187
+ }), Wr = f(() => ({
188
+ "is-success": U.value.type === "saved" || U.value.type === "restored",
189
+ "is-warning": U.value.type === "too-large",
190
+ "is-error": U.value.type === "unavailable" || U.value.type === "read-failed" || U.value.type === "write-failed"
191
+ })), Gr = f(() => `${Math.round(j.value * 100)}%`), Kr = f(() => i(l.fontFamilies, l.fontFamilyMode)), qr = f(() => Kr.value.map((e) => ({
193
192
  label: e.label,
194
193
  value: e.value
195
- }))), Xr = r, Zr = [...e.map((e) => ({
194
+ }))), Jr = r, Yr = [...e.map((e) => ({
196
195
  label: e.label,
197
196
  value: e.format
198
- }))], Qr = [{
197
+ }))], Xr = [{
199
198
  label: "实线",
200
199
  value: "solid"
201
200
  }, {
202
201
  label: "虚线",
203
202
  value: "dashed"
204
- }], $r = [
203
+ }], Zr = [
205
204
  {
206
205
  label: "完整显示",
207
206
  value: "contain"
@@ -214,10 +213,10 @@ var Vt = {
214
213
  label: "拉伸填充",
215
214
  value: "fill"
216
215
  }
217
- ], ei = f(() => be(l.pageSizeOptions)), ti = f(() => ei.value.map((e) => ({
216
+ ], Qr = f(() => be(l.pageSizeOptions)), $r = f(() => Qr.value.map((e) => ({
218
217
  label: `${e.label} · ${e.width} × ${e.height}`,
219
218
  value: ve(e)
220
- }))), ni = f(() => ve(Rr.value)), ri = f(() => l.draftCacheKey), G = f(() => T.value.variables.find((e) => e.key === E.value)), ii = f(() => {
219
+ }))), ei = f(() => ve(Ir.value)), ti = f(() => l.draftCacheKey), K = f(() => T.value.variables.find((e) => e.key === E.value)), ni = f(() => {
221
220
  let e = [
222
221
  ...l.variableTypes,
223
222
  ...l.showAdvancedChoiceControls ? ie : [],
@@ -225,56 +224,56 @@ var Vt = {
225
224
  ...l.showCustomControls ? oe : []
226
225
  ].filter((e) => re(e?.type));
227
226
  return Array.from(new Map(e.map((e) => [e.type, e])).values());
228
- }), ai = f(() => {
227
+ }), ri = f(() => {
229
228
  let e = [...Me.map((e) => je[e]), ...(l.signingLayoutPresets ?? []).filter((e) => !!e?.key)];
230
229
  return Array.from(new Map(e.map((e) => [e.key, e])).values());
231
- }), oi = f(() => ii.value.map((e) => ({
230
+ }), ii = f(() => ni.value.map((e) => ({
232
231
  ...e,
233
232
  icon: ze(e.type),
234
233
  group: e.type === "select" || e.type === "radio" ? "advanced-choice" : e.type.endsWith("-selector") ? "builtin-selector" : e.type === "custom" ? "custom" : "basic"
235
- }))), si = f(() => ye(l.maxPages)), ci = f(() => T.value.pages.length >= si.value), li = f(() => {
234
+ }))), ai = f(() => ye(l.maxPages)), oi = f(() => T.value.pages.length >= ai.value), si = f(() => {
236
235
  let e = ue(T.value);
237
236
  return Array.from(a(T.value.pageDecorations)).filter((t) => !e.has(t));
238
- }), { scheduleAutoPaginate: K } = et({
237
+ }), { scheduleAutoPaginate: q } = et({
239
238
  templateValue: T,
240
- readonlyState: U,
239
+ readonlyState: W,
241
240
  isAutoPaginating: Sn,
242
241
  pendingPaginationPageId: Cn,
243
242
  activePageId: D,
244
- normalizedMaxPages: si,
243
+ normalizedMaxPages: ai,
245
244
  pageRefs: A,
246
- syncPageEditors: Mi,
247
- commitBodyChange: Ji,
248
- getPageSize: Xi,
249
- notifyPageLimit: Qi
250
- }), { saveDraftCache: ui, loadDraftCache: di, clearDraftCache: fi, restoreDraftCacheIfNeeded: pi, stopDraftCacheTimer: mi, restartDraftCacheTimer: hi, resetDraftFingerprint: gi } = dt({
251
- draftCacheWritable: Nr,
245
+ syncPageEditors: Ai,
246
+ commitBodyChange: Ki,
247
+ getPageSize: Ji,
248
+ notifyPageLimit: Xi
249
+ }), { saveDraftCache: ci, loadDraftCache: li, clearDraftCache: ui, restoreDraftCacheIfNeeded: di, stopDraftCacheTimer: fi, restartDraftCacheTimer: pi, resetDraftFingerprint: mi } = dt({
250
+ draftCacheWritable: jr,
252
251
  multipleFilesMode: S,
253
252
  filesValue: C,
254
253
  activeFileIdValue: w,
255
254
  templateValue: T,
256
- draftCacheKey: ri,
255
+ draftCacheKey: ti,
257
256
  draftCacheInterval: () => l.draftCacheInterval,
258
257
  draftCacheMaxBytes: () => l.draftCacheMaxBytes,
259
258
  pageSize: () => l.pageSize,
260
259
  pageSizeOptions: () => l.pageSizeOptions,
261
- syncActiveFileSnapshot: J,
262
- syncPageEditors: Mi,
263
- setActiveFileId: Ri,
264
- emitFilesChange: Y,
265
- commit: X,
266
- updateDraftCacheStatus: zi,
267
- scheduleAutoPaginate: K,
260
+ syncActiveFileSnapshot: Y,
261
+ syncPageEditors: Ai,
262
+ setActiveFileId: Ii,
263
+ emitFilesChange: X,
264
+ commit: Z,
265
+ updateDraftCacheStatus: Li,
266
+ scheduleAutoPaginate: q,
268
267
  activePageId: D,
269
268
  selectedVariableKey: E
270
- }), _i = f(() => {
271
- let e = rr.value.trim().toLowerCase(), t = T.value.variables;
269
+ }), hi = f(() => {
270
+ let e = nr.value.trim().toLowerCase(), t = T.value.variables;
272
271
  return e ? t.filter((t) => t.label.toLowerCase().includes(e) || t.key.toLowerCase().includes(e)) : t;
273
- }), vi = f(() => Math.max(Zt, Rr.value.width - Yt)), yi = f(() => Math.max(Qt, Rr.value.height - Xt)), q = f(() => Rn.value[D.value] ?? Di()), bi = f(() => q.value.hasMixedBlockFormats ? void 0 : q.value.currentHeadingLevel ?? "paragraph"), xi = f(() => q.value.fontFamily || t), Si = f(() => q.value.fontSize ?? se.fontSize ?? 14), Ci = f(() => q.value.textColor || se.color || "#1f2937"), wi = f(() => G.value?.style?.fontFamily || se.fontFamily || t), Ti = f(() => {
272
+ }), gi = f(() => Math.max(Zt, Ir.value.width - Yt)), _i = f(() => Math.max(Qt, Ir.value.height - Xt)), J = f(() => Ln.value[D.value] ?? Ti()), vi = f(() => J.value.hasMixedBlockFormats ? void 0 : J.value.currentHeadingLevel ?? "paragraph"), yi = f(() => J.value.fontFamily || t), bi = f(() => J.value.fontSize ?? se.fontSize ?? 14), xi = f(() => J.value.textColor || se.color || "#1f2937"), Si = f(() => K.value?.style?.fontFamily || se.fontFamily || t), Ci = f(() => {
274
273
  let e = n.map((e) => ({
275
274
  label: `${e}px`,
276
275
  value: e
277
- })), t = ji(Si.value), r = ji(zn.value), i = /* @__PURE__ */ new Map();
276
+ })), t = ki(bi.value), r = ki(Rn.value), i = /* @__PURE__ */ new Map();
278
277
  return r && !n.includes(r) && i.set(r, {
279
278
  label: `使用 ${r}px`,
280
279
  value: r
@@ -286,16 +285,16 @@ var Vt = {
286
285
  x(() => l.modelValue, (e) => {
287
286
  if (!e || S.value) return;
288
287
  let t = xe(e, l.pageSize), n = de(t, l.pageSizeOptions), r = d(n) !== d(T.value), i = d(n), a = i === hn;
289
- a && (hn = ""), (r || !a) && (T.value = n, C.value = lt(C.value, w.value, n), D.value = n.pages[0]?.id ?? "", E.value = "", K(D.value)), d(n) !== d(t) && (hn = i, g("update:modelValue", c(n)), g("change", c(n)));
288
+ a && (hn = ""), (r || !a) && (T.value = n, C.value = lt(C.value, w.value, n), D.value = n.pages[0]?.id ?? "", E.value = "", q(D.value)), d(n) !== d(t) && (hn = i, g("update:modelValue", c(n)), g("change", c(n)));
290
289
  }, { deep: !0 }), x(() => l.files, (e) => {
291
290
  if (!Array.isArray(e)) return;
292
291
  let t = ot(e, void 0, l.pageSize), n = nt(t, l.pageSizeOptions).files, r = d(n), i = d(C.value);
293
292
  r === mn && (mn = "");
294
293
  let a = ut(n, l.activeFileId || w.value);
295
- if (r === i ? a !== w.value && Ri(a, {
294
+ if (r === i ? a !== w.value && Ii(a, {
296
295
  syncCurrent: !1,
297
296
  shouldEmit: !1
298
- }) : (C.value = n, Ri(a, {
297
+ }) : (C.value = n, Ii(a, {
299
298
  syncCurrent: !1,
300
299
  shouldEmit: !1,
301
300
  forceRefresh: !0
@@ -304,57 +303,57 @@ var Vt = {
304
303
  mn = d(e), g("update:files", e), g("files-change", u(e));
305
304
  }
306
305
  }, { deep: !0 }), x(() => l.activeFileId, (e) => {
307
- !S.value || !e || e === w.value || Ri(e, {
306
+ !S.value || !e || e === w.value || Ii(e, {
308
307
  syncCurrent: !0,
309
308
  shouldEmit: !1
310
309
  });
311
310
  });
312
- function Ei(e, t) {
311
+ function wi(e, t) {
313
312
  let n = d(C.value);
314
- J(!1);
313
+ Y(!1);
315
314
  let { files: r } = nt(ot(C.value, void 0, e), t), i = d(r) !== n, a = r.find((e) => e.id === w.value);
316
- return a && d(a.template) !== d(T.value) && (T.value = c(a.template)), i && (O.value = !1, k.value = [], Y(r, "")), i;
315
+ return a && d(a.template) !== d(T.value) && (T.value = c(a.template)), i && (O.value = !1, k.value = [], X(r, "")), i;
317
316
  }
318
317
  x([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
319
318
  if (S.value) {
320
- Ei(e, t), K(D.value);
319
+ wi(e, t), q(D.value);
321
320
  return;
322
321
  }
323
322
  let n = de(xe(T.value, e), t);
324
- d(n) !== d(T.value) && X(n), K(D.value);
325
- }, { deep: !0 }), x(si, () => {
326
- K(T.value.pages[0]?.id);
327
- }), x(U, (e) => {
328
- e && ($(), F.value = !1, I.value = !1);
323
+ d(n) !== d(T.value) && Z(n), q(D.value);
324
+ }, { deep: !0 }), x(ai, () => {
325
+ q(T.value.pages[0]?.id);
326
+ }), x(W, (e) => {
327
+ e && ($(), I.value = !1, L.value = !1);
329
328
  }), x(D, () => {
330
- R.value = void 0;
329
+ z.value = void 0;
331
330
  }), x([
332
- Mr,
333
- P,
331
+ Ar,
332
+ F,
334
333
  wn
335
334
  ], () => {
336
- fs();
335
+ ds();
337
336
  }), x(() => [
338
337
  l.enableDraftCache,
339
- ri.value,
338
+ ti.value,
340
339
  l.draftCacheInterval,
341
- U.value
340
+ W.value
342
341
  ], () => {
343
- gi(), hi();
342
+ mi(), pi();
344
343
  }), x(M, (e) => {
345
344
  if (!(typeof document > "u")) {
346
345
  if (e) {
347
- dr = document.body.style.overflow, document.body.style.overflow = "hidden";
346
+ ur = document.body.style.overflow, document.body.style.overflow = "hidden";
348
347
  return;
349
348
  }
350
- document.body.style.overflow = dr ?? "", dr = void 0;
349
+ document.body.style.overflow = ur ?? "", ur = void 0;
351
350
  }
352
351
  }), Dt(() => {
353
- pi(), hi(), K(D.value), window.addEventListener("pointerdown", bs, !0), window.addEventListener("pointerup", _s), window.addEventListener("keydown", Cs, !0), window.addEventListener("keydown", ws), window.addEventListener("resize", vs), window.addEventListener("scroll", xs, !0);
352
+ di(), pi(), q(D.value), window.addEventListener("pointerdown", ys, !0), window.addEventListener("pointerup", gs), window.addEventListener("keydown", Ss, !0), window.addEventListener("keydown", Cs), window.addEventListener("resize", _s), window.addEventListener("scroll", bs, !0);
354
353
  }), Et(() => {
355
- Pi(), pr = !0, M.value && typeof document < "u" && (document.body.style.overflow = dr ?? ""), window.removeEventListener("pointerdown", bs, !0), window.removeEventListener("pointerup", _s), window.removeEventListener("keydown", Cs, !0), window.removeEventListener("keydown", ws), window.removeEventListener("resize", vs), window.removeEventListener("scroll", xs, !0), tr !== void 0 && cancelAnimationFrame(tr), mi();
354
+ Mi(), fr = !0, M.value && typeof document < "u" && (document.body.style.overflow = ur ?? ""), window.removeEventListener("pointerdown", ys, !0), window.removeEventListener("pointerup", gs), window.removeEventListener("keydown", Ss, !0), window.removeEventListener("keydown", Cs), window.removeEventListener("resize", _s), window.removeEventListener("scroll", bs, !0), er !== void 0 && cancelAnimationFrame(er), fi();
356
355
  });
357
- function Di() {
356
+ function Ti() {
358
357
  return {
359
358
  isFocused: !1,
360
359
  canUndo: !1,
@@ -373,23 +372,23 @@ var Vt = {
373
372
  hasMixedBlockFormats: !1
374
373
  };
375
374
  }
376
- function Oi(e) {
375
+ function Ei(e) {
377
376
  return e === "left" || e === "center" || e === "right";
378
377
  }
379
- function ki(e) {
378
+ function Di(e) {
380
379
  return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 6;
381
380
  }
382
- function Ai(e, t = Si.value) {
381
+ function Oi(e, t = bi.value) {
383
382
  let n = Number(e);
384
383
  return Number.isFinite(n) ? Math.min(en, Math.max($t, Math.round(n))) : t;
385
384
  }
386
- function ji(e) {
385
+ function ki(e) {
387
386
  let t = String(e || "").trim().match(/(\d+(\.\d+)?)/);
388
387
  if (!t) return;
389
388
  let n = Number(t[1]);
390
389
  if (Number.isFinite(n)) return Math.min(en, Math.max($t, Math.round(n)));
391
390
  }
392
- function Mi(e = T.value) {
391
+ function Ai(e = T.value) {
393
392
  return {
394
393
  ...e,
395
394
  pages: e.pages.map((e) => {
@@ -402,19 +401,19 @@ var Vt = {
402
401
  })
403
402
  };
404
403
  }
405
- function Ni() {
406
- mr = !1, hr &&= (clearTimeout(hr), void 0);
404
+ function ji() {
405
+ pr = !1, mr &&= (clearTimeout(mr), void 0);
407
406
  }
408
- function Pi() {
409
- let e = mr;
410
- Ni(), e && Li();
407
+ function Mi() {
408
+ let e = pr;
409
+ ji(), e && Fi();
411
410
  }
412
- function Fi() {
413
- mr = !0, hr && clearTimeout(hr), hr = setTimeout(() => {
414
- hr = void 0, !(!mr || pr) && (mr = !1, Li());
411
+ function Ni() {
412
+ pr = !0, mr && clearTimeout(mr), mr = setTimeout(() => {
413
+ mr = void 0, !(!pr || fr) && (pr = !1, Fi());
415
414
  }, Jt);
416
415
  }
417
- function Ii(e) {
416
+ function Pi(e) {
418
417
  let t = T.value.pages, n = t.findIndex((t) => t.id === e.id);
419
418
  if (n < 0) return;
420
419
  let r = t[n];
@@ -425,121 +424,121 @@ var Vt = {
425
424
  pages: i
426
425
  };
427
426
  }
428
- function Li() {
429
- let e = Ce(Mi());
430
- E.value && !e.variables.some((e) => e.key === E.value) && (E.value = ""), X(e);
427
+ function Fi() {
428
+ let e = Ce(Ai());
429
+ E.value && !e.variables.some((e) => e.key === E.value) && (E.value = ""), Z(e);
431
430
  }
432
- function J(e = !1) {
433
- Pi();
434
- let t = c(Mi());
431
+ function Y(e = !1) {
432
+ Mi();
433
+ let t = c(Ai());
435
434
  if (!S.value) return t;
436
435
  let n = C.value.find((e) => e.id === w.value)?.template, r = d(n) !== d(t), i = lt(C.value, w.value, t);
437
- return C.value = i, r && e && Y(i), t;
436
+ return C.value = i, r && e && X(i), t;
438
437
  }
439
- function Y(e, t = w.value) {
438
+ function X(e, t = w.value) {
440
439
  if (!S.value) return;
441
440
  let n = u(e);
442
441
  C.value = n, mn = d(n), g("update:files", u(n)), g("files-change", u(n));
443
442
  let r = n.find((e) => e.id === t);
444
443
  r && g("file-change", u([r])[0]);
445
444
  }
446
- function Ri(e, t = {}) {
445
+ function Ii(e, t = {}) {
447
446
  let { syncCurrent: n, shouldEmit: r, forceRefresh: i } = tt(t), a = ut(C.value, e), o = a !== w.value;
448
- if (n ? J(!0) : Ni(), !o && !i) return;
447
+ if (n ? Y(!0) : ji(), !o && !i) return;
449
448
  let ee = C.value.find((e) => e.id === a);
450
- ee && (w.value = a, T.value = c(ee.template), E.value = "", D.value = T.value.pages[0]?.id ?? "", Rn.value = {}, A.clear(), Cn.value = "", O.value = !1, k.value = [], wn.value = !1, Tn.value = void 0, En.value = void 0, gi(), r && o && g("update:activeFileId", a), n && o && Nr.value && ui(), _(() => {
451
- K(D.value);
449
+ ee && (w.value = a, T.value = c(ee.template), E.value = "", D.value = T.value.pages[0]?.id ?? "", Ln.value = {}, A.clear(), Cn.value = "", O.value = !1, k.value = [], wn.value = !1, Tn.value = void 0, En.value = void 0, mi(), r && o && g("update:activeFileId", a), n && o && jr.value && ci(), _(() => {
450
+ q(D.value);
452
451
  }));
453
452
  }
454
- function X(e) {
455
- Ni();
453
+ function Z(e) {
454
+ ji();
456
455
  let t = de(xe(e, l.pageSize), l.pageSizeOptions);
457
- return T.value = t, O.value = !1, k.value = [], S.value ? Y(lt(C.value, w.value, t)) : (C.value = lt(C.value, w.value, t), hn = d(t), g("update:modelValue", c(t)), g("change", c(t))), t;
456
+ return T.value = t, O.value = !1, k.value = [], S.value ? X(lt(C.value, w.value, t)) : (C.value = lt(C.value, w.value, t), hn = d(t), g("update:modelValue", c(t)), g("change", c(t))), t;
458
457
  }
459
- function zi(e, t = e.type !== "unchanged") {
460
- H.value = e, t && g("draft-cache-change", { ...e });
458
+ function Li(e, t = e.type !== "unchanged") {
459
+ U.value = e, t && g("draft-cache-change", { ...e });
461
460
  }
462
- function Bi() {
463
- return { ...H.value };
461
+ function Ri() {
462
+ return { ...U.value };
464
463
  }
465
- function Vi(e, t) {
464
+ function zi(e, t) {
466
465
  t ? A.set(e, t) : A.delete(e);
467
466
  }
468
- function Hi(e) {
469
- $(), Hn.value = !1, Z({
467
+ function Bi(e) {
468
+ $(), Vn.value = !1, Q({
470
469
  type: "insert-signing-layout",
471
470
  preset: Ne(e.key) ? e.key : void 0,
472
471
  options: e.options
473
472
  });
474
473
  }
475
- function Ui(e) {
476
- $(), Z({
474
+ function Vi(e) {
475
+ $(), Q({
477
476
  type: "insert-signing-layout",
478
477
  options: e
479
478
  });
480
479
  }
481
- function Wi() {
482
- Hn.value = !1, Wn.value = !0;
480
+ function Hi() {
481
+ Vn.value = !1, Un.value = !0;
483
482
  }
484
- function Gi(e) {
485
- $(), Un.value = !1, Z({
483
+ function Ui(e) {
484
+ $(), Hn.value = !1, Q({
486
485
  type: "insert-signing-mark",
487
486
  mark: { markType: e }
488
487
  });
489
488
  }
490
- function Z(e, t = W.value?.id ?? D.value) {
491
- U.value || A.get(t)?.runCommand(e);
489
+ function Q(e, t = G.value?.id ?? D.value) {
490
+ W.value || A.get(t)?.runCommand(e);
492
491
  }
493
- function Ki(e) {
494
- Z(e), $();
492
+ function Wi(e) {
493
+ Q(e), $();
495
494
  }
496
- function qi(e) {
497
- let t = L.value?.pageId;
498
- t && (A.get(t)?.focus(), V.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
495
+ function Gi(e) {
496
+ let t = R.value?.pageId;
497
+ t && (A.get(t)?.focus(), H.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
499
498
  }
500
- function Ji(e) {
501
- let t = X(Ce(e));
499
+ function Ki(e) {
500
+ let t = Z(Ce(e));
502
501
  return E.value && !t.variables.some((e) => e.key === E.value) && (E.value = ""), t;
503
502
  }
504
- function Yi(e) {
505
- Ii(e), Fi(), K(e.id);
503
+ function qi(e) {
504
+ Pi(e), Ni(), q(e.id);
506
505
  }
507
- function Xi(e) {
506
+ function Ji(e) {
508
507
  return Se(e?.pageSize, T.value.pageSize);
509
508
  }
510
- function Zi(e) {
511
- if (U.value || !W.value) return;
512
- let t = ei.value.find((t) => ve(t) === e);
509
+ function Yi(e) {
510
+ if (W.value || !G.value) return;
511
+ let t = Qr.value.find((t) => ve(t) === e);
513
512
  if (!t) return;
514
- let n = W.value.id, r = Se(t, T.value.pageSize);
515
- X({
513
+ let n = G.value.id, r = Se(t, T.value.pageSize);
514
+ Z({
516
515
  ...T.value,
517
516
  pages: T.value.pages.map((e) => e.id === n ? {
518
517
  ...e,
519
518
  pageSize: r
520
519
  } : e)
521
- }), K(n);
520
+ }), q(n);
522
521
  }
523
- function Qi(e) {
524
- let t = si.value;
525
- V.value = `合同最多支持 ${t} 页`, g("page-limit", t, e);
522
+ function Xi(e) {
523
+ let t = ai.value;
524
+ H.value = `合同最多支持 ${t} 页`, g("page-limit", t, e);
526
525
  }
527
- function $i() {
528
- if (U.value) return;
529
- if (ci.value) {
530
- Qi("add");
526
+ function Zi() {
527
+ if (W.value) return;
528
+ if (oi.value) {
529
+ Xi("add");
531
530
  return;
532
531
  }
533
- let e = me(T.value.pages.length + 1, Rr.value);
534
- X({
532
+ let e = me(T.value.pages.length + 1, Ir.value);
533
+ Z({
535
534
  ...T.value,
536
535
  pages: [...T.value.pages, e]
537
536
  }), D.value = e.id;
538
537
  }
539
- function ea(e) {
540
- if (U.value) return;
541
- if (ci.value) {
542
- Qi("duplicate");
538
+ function Qi(e) {
539
+ if (W.value) return;
540
+ if (oi.value) {
541
+ Xi("duplicate");
543
542
  return;
544
543
  }
545
544
  let t = T.value.pages.findIndex((t) => t.id === e.id);
@@ -548,60 +547,60 @@ var Vt = {
548
547
  pages: [e],
549
548
  variables: [],
550
549
  pageSize: T.value.pageSize
551
- }).pages[0], r = fe(t + 2, Xi(e), n.contentHtml, n.contentJson);
550
+ }).pages[0], r = fe(t + 2, Ji(e), n.contentHtml, n.contentJson);
552
551
  r.title = `${e.title || `第 ${t + 1} 页`}副本`;
553
552
  let i = [...T.value.pages];
554
- i.splice(t + 1, 0, r), X({
553
+ i.splice(t + 1, 0, r), Z({
555
554
  ...T.value,
556
555
  pages: i
557
556
  }), D.value = r.id;
558
557
  }
559
- function ta(e) {
560
- if (U.value || T.value.pages.length <= 1) return;
558
+ function $i(e) {
559
+ if (W.value || T.value.pages.length <= 1) return;
561
560
  let t = T.value.pages.findIndex((t) => t.id === e.id);
562
561
  if (t < 0) return;
563
- let n = T.value.pages.filter((t) => t.id !== e.id), r = Ji({
562
+ let n = T.value.pages.filter((t) => t.id !== e.id), r = Ki({
564
563
  ...T.value,
565
564
  pages: n
566
565
  });
567
566
  D.value = r.pages[Math.min(t, r.pages.length - 1)]?.id ?? "";
568
567
  }
569
- function na(e) {
570
- U.value || T.value.pages.length <= 1 || Ft.confirm({
568
+ function ea(e) {
569
+ W.value || T.value.pages.length <= 1 || Ft.confirm({
571
570
  title: "删除合同页面",
572
571
  content: "删除页面会同时移除页面正文,是否继续?",
573
572
  okText: "确认删除",
574
573
  okType: "danger",
575
574
  cancelText: "取消",
576
575
  onOk: () => {
577
- ta(e);
576
+ $i(e);
578
577
  }
579
578
  });
580
579
  }
581
- function ra(e) {
580
+ function ta(e) {
582
581
  let t = new Set(T.value.variables.map((e) => e.key)), n = 1;
583
582
  for (; t.has(`${e}_${n}`);) n += 1;
584
583
  return `${e}_${n}`;
585
584
  }
586
- function ia(e) {
585
+ function na(e) {
587
586
  let t = e.type ?? "text";
588
587
  return he({
589
588
  ...e,
590
589
  type: t,
591
- key: e.key || ra(t),
592
- label: e.label || _e(t, ii.value).label
593
- }, ii.value, l.defaultVariableStyle);
590
+ key: e.key || ta(t),
591
+ label: e.label || _e(t, ni.value).label
592
+ }, ni.value, l.defaultVariableStyle);
594
593
  }
595
- function aa(e, t = W.value?.id ?? T.value.pages[0].id, n) {
596
- if (U.value) return e;
594
+ function ra(e, t = G.value?.id ?? T.value.pages[0].id, n) {
595
+ if (W.value) return e;
597
596
  let r = A.get(t)?.insertVariable(e, n), i = !T.value.variables.some((t) => t.key === e.key);
598
- return X({
597
+ return Z({
599
598
  ...T.value,
600
599
  pages: r ? T.value.pages.map((e) => e.id === r.id ? r : e) : T.value.pages,
601
600
  variables: i ? [...T.value.variables, e] : T.value.variables
602
- }), E.value = e.key, D.value = t, i && g("variable-add", e), K(t), e;
601
+ }), E.value = e.key, D.value = t, i && g("variable-add", e), q(t), e;
603
602
  }
604
- function oa(e) {
603
+ function ia(e) {
605
604
  let { width: t, height: n, ...r } = e, i = ke(t), a = ke(n);
606
605
  return {
607
606
  ...r,
@@ -609,103 +608,103 @@ var Vt = {
609
608
  ...a === void 0 ? {} : { height: a }
610
609
  };
611
610
  }
612
- function sa(e = {}) {
613
- let t = ke(Kn.value), n = ke(qn.value);
611
+ function aa(e = {}) {
612
+ let t = ke(Gn.value), n = ke(Kn.value);
614
613
  return {
615
614
  ...e,
616
615
  ...t === void 0 ? {} : { width: t },
617
616
  ...n === void 0 ? {} : { height: n }
618
617
  };
619
618
  }
620
- function ca() {
621
- Gn.value = "", Kn.value = void 0, qn.value = void 0, Jn.value = "";
619
+ function oa() {
620
+ Wn.value = "", Gn.value = void 0, Kn.value = void 0, qn.value = "";
622
621
  }
623
- function la(e, t = W.value?.id ?? T.value.pages[0]?.id, n) {
624
- let r = oa({
622
+ function sa(e, t = G.value?.id ?? T.value.pages[0]?.id, n) {
623
+ let r = ia({
625
624
  ...e,
626
625
  src: e.src.trim()
627
626
  });
628
- if (!(U.value || !t || !Ee(r.src) || !r.src || !A.get(t)?.insertContentImage(r, n))) return D.value = t, E.value = "", r.src;
627
+ if (!(W.value || !t || !Ee(r.src) || !r.src || !A.get(t)?.insertContentImage(r, n))) return D.value = t, E.value = "", r.src;
629
628
  }
630
- function ua(e) {
629
+ function ca(e) {
631
630
  return e instanceof Error ? e : /* @__PURE__ */ Error("图片处理失败");
632
631
  }
633
- async function da(e, t) {
634
- t === "toolbar" && (Yn.value = !0, Jn.value = "");
632
+ async function la(e, t) {
633
+ t === "toolbar" && (Jn.value = !0, qn.value = "");
635
634
  try {
636
635
  let n = await Ae(e, {
637
636
  source: t,
638
637
  compression: l.imageCompression,
639
638
  upload: l.imageUpload
640
639
  });
641
- return pr ? void 0 : n.src;
640
+ return fr ? void 0 : n.src;
642
641
  } catch (e) {
643
- let n = ua(e);
644
- t === "toolbar" && (Jn.value = n.message), V.value = n.message, g("image-error", n, t);
642
+ let n = ca(e);
643
+ t === "toolbar" && (qn.value = n.message), H.value = n.message, g("image-error", n, t);
645
644
  return;
646
645
  } finally {
647
- t === "toolbar" && (Yn.value = !1);
646
+ t === "toolbar" && (Jn.value = !1);
648
647
  }
649
648
  }
650
- let fa = 0;
651
- function pa(e) {
649
+ let ua = 0;
650
+ function da(e) {
652
651
  let t = e.replacedFontFamilies.filter(Boolean);
653
652
  if (!t.length) return;
654
653
  let n = Date.now();
655
- n - fa < 800 || (fa = n, Lt.info(`已将 ${t.length} 种外部字体(${t.join("、")})统一为合同标准字体,以保证 Mac 与 Windows 排版一致`));
654
+ n - ua < 800 || (ua = n, Lt.info(`已将 ${t.length} 种外部字体(${t.join("、")})统一为合同标准字体,以保证 Mac 与 Windows 排版一致`));
656
655
  }
657
- async function ma(e) {
658
- return await da(e, "paste") ?? null;
656
+ async function fa(e) {
657
+ return await la(e, "paste") ?? null;
659
658
  }
660
- async function ha(e, t = {}) {
661
- if (U.value) return;
662
- let n = W.value?.id ?? T.value.pages[0]?.id, r = n ? A.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await da(e, "toolbar");
663
- if (pr) return;
659
+ async function pa(e, t = {}) {
660
+ if (W.value) return;
661
+ let n = G.value?.id ?? T.value.pages[0]?.id, r = n ? A.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await la(e, "toolbar");
662
+ if (fr) return;
664
663
  if (!i || !Ee(i)) {
665
- typeof e == "string" && (Jn.value = "请输入安全的图片 URL");
664
+ typeof e == "string" && (qn.value = "请输入安全的图片 URL");
666
665
  return;
667
666
  }
668
667
  if (n && !A.has(n)) return;
669
- let a = la({
668
+ let a = sa({
670
669
  ...t,
671
670
  src: i
672
671
  }, n, r);
673
- return a && (Vn.value = !1, ca(), V.value = "已插入图片"), a;
672
+ return a && (Bn.value = !1, oa(), H.value = "已插入图片"), a;
674
673
  }
675
- function ga() {
676
- U.value || Yn.value || ($(), Jn.value = "", fn.value && (fn.value.value = ""), fn.value?.click());
674
+ function ma() {
675
+ W.value || Jn.value || ($(), qn.value = "", fn.value && (fn.value.value = ""), fn.value?.click());
677
676
  }
678
- async function _a(e) {
677
+ async function ha(e) {
679
678
  let t = e.target.files?.[0];
680
- t && await ha(t, sa({ alt: t.name }));
679
+ t && await pa(t, aa({ alt: t.name }));
681
680
  }
682
- async function va() {
683
- let e = Gn.value;
684
- await ha(e, sa());
681
+ async function ga() {
682
+ let e = Wn.value;
683
+ await pa(e, aa());
685
684
  }
686
- function ya(e) {
687
- Ra(e), Bn.value = !1;
685
+ function _a(e) {
686
+ La(e), zn.value = !1;
688
687
  }
689
- function ba() {
690
- $(), $i();
688
+ function va() {
689
+ $(), Zi();
691
690
  }
692
- function xa(e, t, n, r) {
693
- $(), aa(ia({ type: t }), e, {
691
+ function ya(e, t, n, r) {
692
+ $(), ra(na({ type: t }), e, {
694
693
  left: n,
695
694
  top: r
696
695
  });
697
696
  }
698
- function Sa(e) {
697
+ function ba(e) {
699
698
  $(), E.value = e;
700
699
  }
701
- function Ca(e) {
700
+ function xa(e) {
702
701
  let t = T.value.variables.find((t) => t.id === e.id);
703
702
  if (!t) return;
704
703
  let n = e.key.trim();
705
704
  if (n !== t.key) {
706
705
  let t = we(n, T.value.variables, e.id);
707
706
  if (t) {
708
- V.value = t;
707
+ H.value = t;
709
708
  return;
710
709
  }
711
710
  }
@@ -721,66 +720,66 @@ var Vt = {
721
720
  let e = r.findIndex((e) => e.id === n);
722
721
  e >= 0 && (r[e] = o);
723
722
  }
724
- }), X({
723
+ }), Z({
725
724
  ...T.value,
726
725
  pages: r,
727
726
  variables: T.value.variables.map((t) => t.id === e.id ? e : t),
728
727
  ...i !== e.key && T.value.pageDecorations ? { pageDecorations: ne(T.value.pageDecorations, i, e.key) } : {}
729
- }), E.value = e.key, K(a || D.value);
728
+ }), E.value = e.key, q(a || D.value);
730
729
  }
731
- function Q(e) {
732
- G.value && Ca({
733
- ...G.value,
730
+ function Sa(e) {
731
+ K.value && xa({
732
+ ...K.value,
734
733
  ...e,
735
734
  style: {
736
- ...G.value.style,
735
+ ...K.value.style,
737
736
  ...e.style
738
737
  }
739
738
  });
740
739
  }
741
- function wa(e) {
742
- U.value || !G.value || Q({ key: e });
740
+ function Ca(e) {
741
+ W.value || !K.value || Sa({ key: e });
743
742
  }
744
- function Ta(e) {
745
- U.value || (X({
743
+ function wa(e) {
744
+ W.value || (Z({
746
745
  ...T.value,
747
746
  pageDecorations: o(e)
748
- }), K(T.value.pages[0]?.id));
747
+ }), q(T.value.pages[0]?.id));
748
+ }
749
+ function Ta(e) {
750
+ (e === "left" || e === "center" || e === "right") && Sa({ style: { textAlign: e } });
749
751
  }
750
752
  function Ea(e) {
751
- (e === "left" || e === "center" || e === "right") && Q({ style: { textAlign: e } });
753
+ (e === "solid" || e === "dashed") && Sa({ style: { borderStyle: e } });
752
754
  }
753
755
  function Da(e) {
754
- (e === "solid" || e === "dashed") && Q({ style: { borderStyle: e } });
756
+ (e === "contain" || e === "cover" || e === "fill") && Sa({ style: { objectFit: e } });
755
757
  }
756
758
  function Oa(e) {
757
- (e === "contain" || e === "cover" || e === "fill") && Q({ style: { objectFit: e } });
759
+ Sa({ style: e });
758
760
  }
759
761
  function ka(e) {
760
- Q({ style: e });
762
+ Oa({ fontFamily: String(e || "").trim() || t });
761
763
  }
762
764
  function Aa(e) {
763
- ka({ fontFamily: String(e || "").trim() || t });
765
+ Oa({ fontSize: Oi(e, K.value?.style?.fontSize ?? 14) });
764
766
  }
765
767
  function ja(e) {
766
- ka({ fontSize: Ai(e, G.value?.style?.fontSize ?? 14) });
767
- }
768
- function Ma(e) {
769
- G.value && Q({
768
+ K.value && Sa({
770
769
  multiline: e,
771
- rows: G.value.rows || 3,
772
- lineHeight: G.value.lineHeight || 28,
770
+ rows: K.value.rows || 3,
771
+ lineHeight: K.value.lineHeight || 28,
773
772
  style: e ? { underline: !0 } : void 0
774
773
  });
775
774
  }
776
- function Na(e) {
777
- G.value && Q({
775
+ function Ma(e) {
776
+ K.value && Sa({
778
777
  rows: Number(e || 3),
779
- lineHeight: G.value.lineHeight || 28
778
+ lineHeight: K.value.lineHeight || 28
780
779
  });
781
780
  }
782
- function Pa(e) {
783
- if (U.value) return;
781
+ function Na(e) {
782
+ if (W.value) return;
784
783
  let t = [...T.value.pages];
785
784
  A.forEach((n, r) => {
786
785
  let i = n.removeVariable(e.key);
@@ -788,259 +787,259 @@ var Vt = {
788
787
  let e = t.findIndex((e) => e.id === r);
789
788
  e >= 0 && (t[e] = i);
790
789
  }
791
- }), X({
790
+ }), Z({
792
791
  ...T.value,
793
792
  pages: t,
794
793
  variables: T.value.variables.filter((t) => t.id !== e.id),
795
794
  ...T.value.pageDecorations ? { pageDecorations: ne(T.value.pageDecorations, e.key) } : {}
796
795
  }), E.value = "";
797
796
  }
798
- function Fa(e) {
797
+ function Pa(e) {
799
798
  let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(T.value.variables.map((e) => e.key));
800
799
  if (!n.has(t)) return t;
801
800
  let r = 2;
802
801
  for (; n.has(`${t}_${r}`);) r += 1;
803
802
  return `${t}_${r}`;
804
803
  }
805
- function Ia(e) {
806
- U.value || aa(he({
804
+ function Fa(e) {
805
+ W.value || ra(he({
807
806
  ...e,
808
807
  id: void 0,
809
- key: Fa(`${e.key || e.type}_copy`),
808
+ key: Pa(`${e.key || e.type}_copy`),
810
809
  label: `${e.label}副本`,
811
810
  style: { ...e.style }
812
- }, ii.value, l.defaultVariableStyle));
811
+ }, ni.value, l.defaultVariableStyle));
812
+ }
813
+ function Ia(e) {
814
+ return W.value ? void 0 : ra(T.value.variables.find((t) => t.key === e.key) ?? he(e, ni.value, l.defaultVariableStyle));
813
815
  }
814
816
  function La(e) {
815
- return U.value ? void 0 : aa(T.value.variables.find((t) => t.key === e.key) ?? he(e, ii.value, l.defaultVariableStyle));
817
+ if (!W.value) return ra(na({ type: e }));
816
818
  }
817
819
  function Ra(e) {
818
- if (!U.value) return aa(ia({ type: e }));
819
- }
820
- function za(e) {
821
- if (U.value || !re(e)) return;
822
- let t = L.value, n = ii.value.find((t) => t.type === e);
820
+ if (W.value || !re(e)) return;
821
+ let t = R.value, n = ni.value.find((t) => t.type === e);
823
822
  if (!t || !n) return;
824
- let r = Pe(t.leadingText) || n.label, i = Fe(t.selectionWidth, Zt, vi.value), a = Ba();
825
- aa(ia({
823
+ let r = Pe(t.leadingText) || n.label, i = Fe(t.selectionWidth, Zt, gi.value), a = za();
824
+ ra(na({
826
825
  type: e,
827
826
  label: r,
828
827
  ...i ? { width: i } : {},
829
828
  ...a ? { style: a } : {}
830
- }), t.pageId), V.value = t.hasSelection ? `已将选中内容替换为${n.label}控件` : `已插入${n.label}控件`, $();
829
+ }), t.pageId), H.value = t.hasSelection ? `已将选中内容替换为${n.label}控件` : `已插入${n.label}控件`, $();
831
830
  }
832
- function Ba() {
833
- let e = q.value, t = {};
831
+ function za() {
832
+ let e = J.value, t = {};
834
833
  return e.isUnderline && (t.underline = !0), typeof e.fontSize == "number" && Number.isFinite(e.fontSize) && (t.fontSize = e.fontSize), e.fontFamily && (t.fontFamily = e.fontFamily), e.textColor && (t.color = e.textColor), Object.keys(t).length ? t : void 0;
835
834
  }
836
- function Va(e) {
837
- if (U.value) return;
838
- let t = L.value;
839
- t && (aa(e, t.pageId), V.value = `已绑定到${e.label},沿用原控件尺寸`, $());
835
+ function Ba(e) {
836
+ if (W.value) return;
837
+ let t = R.value;
838
+ t && (ra(e, t.pageId), H.value = `已绑定到${e.label},沿用原控件尺寸`, $());
840
839
  }
841
- function Ha(e) {
842
- return _e(e.type && re(e.type) ? e.type : "text", ii.value).label;
840
+ function Va(e) {
841
+ return _e(e.type && re(e.type) ? e.type : "text", ni.value).label;
843
842
  }
844
- function Ua() {
845
- T.value.variables.length && (nr.value = !0, _(() => {
846
- ns(), Xn.value?.focusBindSearch();
843
+ function Ha() {
844
+ T.value.variables.length && (tr.value = !0, _(() => {
845
+ ts(), Yn.value?.focusBindSearch();
847
846
  }));
848
847
  }
849
- function Wa(e, t) {
848
+ function Ua(e, t) {
850
849
  e.dataTransfer?.setData("application/x-gd-contract-variable", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
851
850
  }
852
- function Ga(e) {
851
+ function Wa(e) {
853
852
  return j.value = Math.round(Math.min(Kt, Math.max(Gt, Number.isFinite(e) ? e : 1)) * 100) / 100, j.value;
854
853
  }
855
- let { width: Ka } = Rt(an), { fitWidth: qa, applyAutoFit: Ja, markUserAdjusted: Ya, userAdjusted: Xa } = Oe({
856
- viewportWidth: Ka,
857
- widestPageWidth: f(() => Math.max(...T.value.pages.map((e) => Xi(e).width), ce.width) + 10),
854
+ let { width: Ga } = Rt(an), { fitWidth: Ka, applyAutoFit: qa, markUserAdjusted: Ja, userAdjusted: Ya } = Oe({
855
+ viewportWidth: Ga,
856
+ widestPageWidth: f(() => Math.max(...T.value.pages.map((e) => Ji(e).width), ce.width) + 10),
858
857
  padding: 48,
859
858
  minZoom: Gt,
860
859
  maxZoom: Kt,
861
860
  getZoom: () => j.value,
862
- applyZoom: Ga
861
+ applyZoom: Wa
863
862
  });
864
- function Za(e) {
865
- return Ya(), Ga(e);
863
+ function Xa(e) {
864
+ return Ja(), Wa(e);
865
+ }
866
+ function Za() {
867
+ return qa();
866
868
  }
867
869
  function Qa() {
868
- return Ja();
870
+ return j.value;
869
871
  }
870
872
  function $a() {
871
- return j.value;
873
+ Xa(j.value + qt);
872
874
  }
873
875
  function eo() {
874
- Za(j.value + qt);
876
+ Xa(j.value - qt);
875
877
  }
876
878
  function to() {
877
- Za(j.value - qt);
878
- }
879
- function no() {
880
- $(), ls(), M.value = !M.value;
879
+ $(), cs(), M.value = !M.value;
881
880
  }
882
- x(Ka, (e) => {
883
- Pn.value && !Xa.value && e > 0 && qa();
881
+ x(Ga, (e) => {
882
+ P.value && !Ya.value && e > 0 && Ka();
884
883
  });
885
- function ro(e) {
884
+ function no(e) {
886
885
  N.value ? dn.value?.focus() : e();
887
886
  }
888
- function io() {
889
- $(), ls(), P.value = !1, fr = {
887
+ function ro() {
888
+ $(), cs(), F.value = !1, dr = {
890
889
  fullscreen: M.value,
891
890
  sidebar: Mn.value,
892
891
  inspector: Nn.value,
893
892
  chrome: N.value,
894
893
  zoom: j.value,
895
- userAdjusted: Xa.value
896
- }, M.value = !0, Mn.value = !0, Nn.value = !0, N.value = !0, Pn.value = !0, _(() => {
897
- U.value ? Fn.value?.focus() : A.get(D.value)?.focus();
894
+ userAdjusted: Ya.value
895
+ }, M.value = !0, Mn.value = !0, Nn.value = !0, N.value = !0, P.value = !0, _(() => {
896
+ W.value ? Pn.value?.focus() : A.get(D.value)?.focus();
898
897
  });
899
898
  }
899
+ function io() {
900
+ let e = dr;
901
+ P.value = !1, dr = void 0, e && (M.value = e.fullscreen, Mn.value = e.sidebar, Nn.value = e.inspector, N.value = e.chrome, e.userAdjusted ? Xa(e.zoom) : qa(), _(() => no(() => sn.value?.focusImmersive())));
902
+ }
900
903
  function ao() {
901
- let e = fr;
902
- Pn.value = !1, fr = void 0, e && (M.value = e.fullscreen, Mn.value = e.sidebar, Nn.value = e.inspector, N.value = e.chrome, e.userAdjusted ? Za(e.zoom) : Ja(), _(() => ro(() => sn.value?.focusImmersive())));
904
+ P.value ? io() : ro();
903
905
  }
904
906
  function oo() {
905
- Pn.value ? ao() : io();
907
+ $(), z.value = void 0;
908
+ let e = Y(!1);
909
+ S.value ? (En.value = u(C.value), Tn.value = void 0, Dn.value = w.value || C.value[0]?.id || "") : (Tn.value = c(e), En.value = void 0, Dn.value = ""), wn.value = !0;
906
910
  }
907
911
  function so() {
908
- $(), R.value = void 0;
909
- let e = J(!1);
910
- S.value ? (En.value = u(C.value), Tn.value = void 0, Dn.value = w.value || C.value[0]?.id || "") : (Tn.value = c(e), En.value = void 0, Dn.value = ""), wn.value = !0;
912
+ wn.value = !1, Tn.value = void 0, En.value = void 0, Dn.value = "";
911
913
  }
912
914
  function co() {
913
- wn.value = !1, Tn.value = void 0, En.value = void 0, Dn.value = "";
915
+ return Ro();
914
916
  }
915
917
  function lo() {
916
- return zo();
917
- }
918
- function uo() {
919
918
  $();
920
- let e = lo();
919
+ let e = co();
921
920
  return kn.value = JSON.stringify(e, null, 2), On.value = !0, e;
922
921
  }
923
- function fo() {
922
+ function uo() {
924
923
  On.value = !1;
925
924
  }
926
- function po() {
927
- return De(J(!1));
925
+ function fo() {
926
+ return De(Y(!1));
928
927
  }
929
- function mo() {
928
+ function po() {
930
929
  $();
931
- let e = po();
930
+ let e = fo();
932
931
  return jn.value = e, An.value = !0, e;
933
932
  }
934
- function ho() {
933
+ function mo() {
935
934
  An.value = !1;
936
935
  }
937
- function go() {
938
- $(), R.value = void 0, F.value = !1, I.value = !1, E.value = "", D.value = "", wn.value = !1, Tn.value = void 0, En.value = void 0, On.value = !1, kn.value = "", An.value = !1, jn.value = {
936
+ function ho() {
937
+ $(), z.value = void 0, I.value = !1, L.value = !1, E.value = "", D.value = "", wn.value = !1, Tn.value = void 0, En.value = void 0, On.value = !1, kn.value = "", An.value = !1, jn.value = {
939
938
  values: {},
940
939
  variables: []
941
- }, Rn.value = {}, Cn.value = "";
942
- let e = X(pe(ce));
940
+ }, Ln.value = {}, Cn.value = "";
941
+ let e = Z(pe(ce));
943
942
  return D.value = e.pages[0]?.id ?? "", c(e);
944
943
  }
945
- function _o() {
946
- U.value || ($(), Ft.confirm({
944
+ function go() {
945
+ W.value || ($(), Ft.confirm({
947
946
  title: "清空合同内容",
948
947
  content: "将清空全部合同正文、页面和模板变量,仅保留一个空白 A4 合同页。此操作不可撤销。",
949
948
  okText: "确认清空",
950
949
  okType: "danger",
951
950
  cancelText: "取消",
952
951
  onOk: () => {
953
- go();
952
+ ho();
954
953
  }
955
954
  }));
956
955
  }
957
- function vo(e) {
958
- let t = Mi().pages, n = t.find((e) => e.id === D.value);
956
+ function _o(e) {
957
+ let t = Ai().pages, n = t.find((e) => e.id === D.value);
959
958
  return (n ? [n, ...t.filter((e) => e.id !== n.id)] : t).find((t) => t.contentHtml.includes(`data-key="${e.key}"`) || t.contentHtml.includes(`data-key='${e.key}'`));
960
959
  }
961
- function yo(e) {
960
+ function vo(e) {
962
961
  $(), E.value = e.key;
963
- let t = vo(e);
962
+ let t = _o(e);
964
963
  t && (D.value = t.id, _(() => {
965
964
  A.get(t.id)?.scrollIntoVariable(e.key);
966
965
  }));
967
966
  }
968
- function bo(e) {
967
+ function yo(e) {
969
968
  let t = T.value.variables.find((t) => t.key === e || t.id === e);
970
- t && yo(t);
969
+ t && vo(t);
971
970
  }
972
- function xo(e, t = !0) {
971
+ function bo(e, t = !0) {
973
972
  $(), D.value = e, t && _(() => {
974
973
  A.get(e)?.scrollIntoPage();
975
974
  });
976
975
  }
977
- function So(e) {
978
- xo(e.pageId, !1), A.get(e.pageId)?.focusHeading(e.headingIndex);
976
+ function xo(e) {
977
+ bo(e.pageId, !1), A.get(e.pageId)?.focusHeading(e.headingIndex);
979
978
  }
980
- function Co(e) {
981
- T.value.pages.some((t) => t.id === e) && xo(e);
979
+ function So(e) {
980
+ T.value.pages.some((t) => t.id === e) && bo(e);
982
981
  }
983
- function wo() {
984
- if (P.value) {
985
- To();
982
+ function Co() {
983
+ if (F.value) {
984
+ wo();
986
985
  return;
987
986
  }
988
- P.value = !0;
987
+ F.value = !0;
989
988
  }
990
- function To() {
991
- P.value = !1, _(() => ro(() => sn.value?.focusPageDecorations()));
989
+ function wo() {
990
+ F.value = !1, _(() => no(() => sn.value?.focusPageDecorations()));
992
991
  }
993
- function Eo() {
994
- return Pi(), c(Mi());
992
+ function To() {
993
+ return Mi(), c(Ai());
995
994
  }
996
- function Do(e) {
997
- K(X(xe(e, l.pageSize)).pages[0]?.id);
995
+ function Eo(e) {
996
+ q(Z(xe(e, l.pageSize)).pages[0]?.id);
998
997
  }
999
- function Oo() {
1000
- let e = J(!1);
998
+ function Do() {
999
+ let e = Y(!1);
1001
1000
  return S.value ? u(C.value) : u(lt(C.value, w.value, e));
1002
1001
  }
1003
- function ko(e, t) {
1002
+ function Oo(e, t) {
1004
1003
  let n = nt(ot(e, void 0, l.pageSize), l.pageSizeOptions), r = C.value;
1005
- gn.value = !0, J(!1), C.value = n.files, Ri(ut(C.value, t ?? w.value), {
1004
+ gn.value = !0, Y(!1), C.value = n.files, Ii(ut(C.value, t ?? w.value), {
1006
1005
  syncCurrent: !1,
1007
1006
  shouldEmit: !0,
1008
1007
  forceRefresh: !0
1009
- }), d(r) !== d(C.value) && Y(C.value, "");
1008
+ }), d(r) !== d(C.value) && X(C.value, "");
1010
1009
  }
1011
- function Ao(e) {
1012
- if (U.value) return;
1013
- gn.value = !0, J(!0);
1010
+ function ko(e) {
1011
+ if (W.value) return;
1012
+ gn.value = !0, Y(!0);
1014
1013
  let t = rt(e || `合同文件 ${C.value.length + 1}`, l.pageSize);
1015
- return C.value = [...C.value, t], Y(C.value, ""), g("file-add", u([t])[0]), Ri(t.id, {
1014
+ return C.value = [...C.value, t], X(C.value, ""), g("file-add", u([t])[0]), Ii(t.id, {
1016
1015
  syncCurrent: !1,
1017
1016
  shouldEmit: !0,
1018
1017
  forceRefresh: !0
1019
1018
  }), u([t])[0];
1020
1019
  }
1021
- function jo(e) {
1022
- !S.value && !C.value.some((t) => t.id === e) || (gn.value = !0, Ri(e));
1020
+ function Ao(e) {
1021
+ !S.value && !C.value.some((t) => t.id === e) || (gn.value = !0, Ii(e));
1023
1022
  }
1024
- function Mo(e, t) {
1025
- if (U.value) return;
1026
- gn.value = !0, J(!1);
1023
+ function jo(e, t) {
1024
+ if (W.value) return;
1025
+ gn.value = !0, Y(!1);
1027
1026
  let n = ct(C.value, e, t), r = n.find((t) => t.id === e);
1028
- if (r) return C.value = n, Y(n, e), u([r])[0];
1027
+ if (r) return C.value = n, X(n, e), u([r])[0];
1029
1028
  }
1030
- function No(e) {
1031
- if (U.value || C.value.length <= 1) return;
1032
- gn.value = !0, J(!1);
1029
+ function Mo(e) {
1030
+ if (W.value || C.value.length <= 1) return;
1031
+ gn.value = !0, Y(!1);
1033
1032
  let t = C.value.find((t) => t.id === e);
1034
1033
  if (!t) return;
1035
1034
  let n = st(C.value, e);
1036
- if (n.length !== C.value.length) return C.value = n, Y(n, ""), g("file-remove", u([t])[0]), w.value === e && Ri(ut(n, n[0]?.id), {
1035
+ if (n.length !== C.value.length) return C.value = n, X(n, ""), g("file-remove", u([t])[0]), w.value === e && Ii(ut(n, n[0]?.id), {
1037
1036
  syncCurrent: !1,
1038
1037
  shouldEmit: !0,
1039
1038
  forceRefresh: !0
1040
1039
  }), u([t])[0];
1041
1040
  }
1042
- function Po(e) {
1043
- if (U.value || C.value.length <= 1) return;
1041
+ function No(e) {
1042
+ if (W.value || C.value.length <= 1) return;
1044
1043
  let t = C.value.find((t) => t.id === e);
1045
1044
  t && Ft.confirm({
1046
1045
  title: "删除合同文件",
@@ -1049,27 +1048,27 @@ var Vt = {
1049
1048
  okType: "danger",
1050
1049
  cancelText: "取消",
1051
1050
  onOk: () => {
1052
- No(e);
1051
+ Mo(e);
1053
1052
  }
1054
1053
  });
1055
1054
  }
1056
- function Fo(e, t) {
1057
- if (U.value) return;
1058
- gn.value = !0, J(!1);
1055
+ function Po(e, t) {
1056
+ if (W.value) return;
1057
+ gn.value = !0, Y(!1);
1059
1058
  let n = C.value.findIndex((t) => t.id === e), r = at(C.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
1060
- if (!(!a || n === i)) return C.value = r, Y(r, ""), g("file-move", u([a])[0], n, i), u([a])[0];
1059
+ if (!(!a || n === i)) return C.value = r, X(r, ""), g("file-move", u([a])[0], n, i), u([a])[0];
1061
1060
  }
1062
- function Io() {
1063
- J(!1);
1064
- let e = Vo(S.value ? C.value.flatMap((e) => Te(e.template, { maxPages: si.value }).map((t) => ({
1061
+ function Fo() {
1062
+ Y(!1);
1063
+ let e = Bo(S.value ? C.value.flatMap((e) => Te(e.template, { maxPages: ai.value }).map((t) => ({
1065
1064
  ...t,
1066
1065
  fileId: e.id
1067
- }))) : Te(Mi(), { maxPages: si.value }));
1066
+ }))) : Te(Ai(), { maxPages: ai.value }));
1068
1067
  return k.value = e, O.value = !0, g("validate", e), e;
1069
1068
  }
1070
- function Lo(e) {
1069
+ function Io(e) {
1071
1070
  if (e.fileId && e.fileId !== w.value) {
1072
- jo(e.fileId), _(() => Lo({
1071
+ Ao(e.fileId), _(() => Io({
1073
1072
  ...e,
1074
1073
  fileId: void 0
1075
1074
  }));
@@ -1077,107 +1076,107 @@ var Vt = {
1077
1076
  }
1078
1077
  let t = te(e);
1079
1078
  if (t) {
1080
- P.value = !0, _(() => cn.value?.focusField(t));
1079
+ F.value = !0, _(() => cn.value?.focusField(t));
1081
1080
  return;
1082
1081
  }
1083
1082
  if (e.variableKey) {
1084
- bo(e.variableKey);
1083
+ yo(e.variableKey);
1085
1084
  return;
1086
1085
  }
1087
1086
  if (e.pageId) {
1088
- Co(e.pageId);
1087
+ So(e.pageId);
1089
1088
  return;
1090
1089
  }
1091
1090
  let n = T.value.variables.find((t) => t.id === e.id || t.key === e.id);
1092
1091
  if (n) {
1093
- yo(n);
1092
+ vo(n);
1094
1093
  return;
1095
1094
  }
1096
- T.value.pages.some((t) => t.id === e.id) && xo(e.id);
1095
+ T.value.pages.some((t) => t.id === e.id) && bo(e.id);
1097
1096
  }
1098
- function Ro(e) {
1097
+ function Lo(e) {
1099
1098
  return te(e) ? "页面装饰" : e.type === "variable" ? "变量" : "字段";
1100
1099
  }
1101
- function zo() {
1102
- return Pi(), ge(Mi());
1100
+ function Ro() {
1101
+ return Mi(), ge(Ai());
1103
1102
  }
1104
- function Bo() {
1105
- let e = J(!1);
1103
+ function zo() {
1104
+ let e = Y(!1);
1106
1105
  return it(S.value ? C.value : lt(C.value, w.value, e));
1107
1106
  }
1108
- function Vo(e) {
1107
+ function Bo(e) {
1109
1108
  let t = /* @__PURE__ */ new Set();
1110
1109
  return e.filter((e) => {
1111
1110
  let n = `${e.fileId ?? ""}|${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
1112
1111
  return t.has(n) ? !1 : (t.add(n), !0);
1113
1112
  });
1114
1113
  }
1115
- function Ho(e) {
1114
+ function Vo(e) {
1116
1115
  k.value = [...e], O.value = !0;
1117
1116
  }
1118
- function Uo() {
1117
+ function Ho() {
1119
1118
  k.value = [], O.value = !1;
1120
1119
  }
1121
- function Wo() {
1122
- A.get(W.value?.id ?? D.value)?.focus();
1120
+ function Uo() {
1121
+ A.get(G.value?.id ?? D.value)?.focus();
1123
1122
  }
1124
- function Go(e) {
1125
- Oi(e) && Z({
1123
+ function Wo(e) {
1124
+ Ei(e) && Q({
1126
1125
  type: "set-text-align",
1127
1126
  value: e
1128
1127
  });
1129
1128
  }
1130
- function Ko(e) {
1131
- (e === "paragraph" || ki(e)) && Z({
1129
+ function Go(e) {
1130
+ (e === "paragraph" || Di(e)) && Q({
1132
1131
  type: "apply-block-style",
1133
1132
  format: e
1134
1133
  });
1135
1134
  }
1136
- function qo(e) {
1137
- let t = ji(e);
1138
- t && (Z({
1135
+ function Ko(e) {
1136
+ let t = ki(e);
1137
+ t && (Q({
1139
1138
  type: "set-font-size",
1140
1139
  value: t
1141
- }), zn.value = "");
1140
+ }), Rn.value = "");
1142
1141
  }
1143
- function Jo(e) {
1142
+ function qo(e) {
1144
1143
  let t = String(e || "").trim();
1145
1144
  if (!t) {
1146
- Z({ type: "unset-font-family" });
1145
+ Q({ type: "unset-font-family" });
1147
1146
  return;
1148
1147
  }
1149
- Z({
1148
+ Q({
1150
1149
  type: "set-font-family",
1151
1150
  value: t
1152
1151
  });
1153
1152
  }
1154
- function Yo(e) {
1155
- Xo(e.target?.value ?? "");
1153
+ function Jo(e) {
1154
+ Yo(e.target?.value ?? "");
1156
1155
  }
1157
- function Xo(e) {
1156
+ function Yo(e) {
1158
1157
  let t = e.trim();
1159
- t && Z({
1158
+ t && Q({
1160
1159
  type: "set-color",
1161
1160
  value: t
1162
1161
  });
1163
1162
  }
1164
- function Zo(e) {
1165
- zn.value = e;
1163
+ function Xo(e) {
1164
+ Rn.value = e;
1165
+ }
1166
+ function Zo() {
1167
+ Rn.value.trim() && Ko(Rn.value);
1166
1168
  }
1167
- function Qo() {
1168
- zn.value.trim() && qo(zn.value);
1169
+ function Qo(e) {
1170
+ e.key === "Enter" && (e.preventDefault(), Zo());
1169
1171
  }
1170
1172
  function $o(e) {
1171
- e.key === "Enter" && (e.preventDefault(), Qo());
1173
+ e || (Zo(), Rn.value = "");
1172
1174
  }
1173
1175
  function es(e) {
1174
- e || (Qo(), zn.value = "");
1175
- }
1176
- function ts(e) {
1177
- if (U.value) return;
1178
- D.value = e.pageId, F.value = !1, I.value = !1, z.value = void 0, B.value = void 0, nr.value = !1, rr.value = "";
1176
+ if (W.value) return;
1177
+ D.value = e.pageId, I.value = !1, L.value = !1, B.value = void 0, V.value = void 0, tr.value = !1, nr.value = "";
1179
1178
  let t = _t(e.clientX, e.clientY, 304, 300);
1180
- L.value = {
1179
+ R.value = {
1181
1180
  pageId: e.pageId,
1182
1181
  x: t.x,
1183
1182
  y: t.y,
@@ -1185,207 +1184,207 @@ var Vt = {
1185
1184
  selectionWidth: e.selectionWidth,
1186
1185
  leadingText: e.leadingText
1187
1186
  }, _(() => {
1188
- ns(), Xn.value?.focusFirstButton();
1187
+ ts(), Yn.value?.focusFirstButton();
1189
1188
  });
1190
1189
  }
1191
- function ns() {
1192
- let e = Xn.value?.getMenuElement(), t = L.value;
1190
+ function ts() {
1191
+ let e = Yn.value?.getMenuElement(), t = R.value;
1193
1192
  if (!e || !t) return;
1194
1193
  let n = vt(t.x, t.y, e);
1195
- L.value = {
1194
+ R.value = {
1196
1195
  ...t,
1197
1196
  x: n.x,
1198
1197
  y: n.y
1199
1198
  };
1200
1199
  }
1201
- function rs(e) {
1202
- if (U.value) return;
1203
- D.value = e.pageId, F.value = !1, I.value = !1, L.value = void 0, B.value = void 0;
1200
+ function ns(e) {
1201
+ if (W.value) return;
1202
+ D.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, V.value = void 0;
1204
1203
  let t = _t(e.clientX, e.clientY, 248, 400);
1205
- z.value = {
1204
+ B.value = {
1206
1205
  ...e,
1207
1206
  x: t.x,
1208
1207
  y: t.y
1209
1208
  }, _(() => {
1210
- let e = ir.value?.getMenuElement(), t = z.value;
1209
+ let e = rr.value?.getMenuElement(), t = B.value;
1211
1210
  if (e && t) {
1212
1211
  let n = vt(t.x, t.y, e);
1213
- z.value = {
1212
+ B.value = {
1214
1213
  ...t,
1215
1214
  x: n.x,
1216
1215
  y: n.y
1217
1216
  };
1218
1217
  }
1219
- ir.value?.focusFirstItem();
1218
+ rr.value?.focusFirstItem();
1220
1219
  });
1221
1220
  }
1222
- function is(e) {
1223
- if (U.value) return;
1224
- D.value = e.pageId, F.value = !1, I.value = !1, L.value = void 0, z.value = void 0, or.value = e.image.width, sr.value = e.image.height, E.value = "";
1221
+ function rs(e) {
1222
+ if (W.value) return;
1223
+ D.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, B.value = void 0, ar.value = e.image.width, or.value = e.image.height, E.value = "";
1225
1224
  let t = _t(e.clientX, e.clientY, 288, 196);
1226
- B.value = {
1225
+ V.value = {
1227
1226
  pageId: e.pageId,
1228
1227
  image: e.image,
1229
1228
  x: t.x,
1230
1229
  y: t.y
1231
1230
  }, _(() => {
1232
- as(), ar.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
1231
+ is(), ir.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
1233
1232
  });
1234
1233
  }
1235
- function as() {
1236
- let e = ar.value?.getMenuElement(), t = B.value;
1234
+ function is() {
1235
+ let e = ir.value?.getMenuElement(), t = V.value;
1237
1236
  if (!e || !t) return;
1238
1237
  let n = vt(t.x, t.y, e);
1239
- B.value = {
1238
+ V.value = {
1240
1239
  ...t,
1241
1240
  x: n.x,
1242
1241
  y: n.y
1243
1242
  };
1244
1243
  }
1244
+ function as() {
1245
+ let e = V.value;
1246
+ !e || W.value || (A.get(e.pageId)?.updateSelectedContentImage({
1247
+ width: ke(ar.value),
1248
+ height: ke(or.value)
1249
+ }) && (H.value = "已更新图片尺寸"), $());
1250
+ }
1245
1251
  function os() {
1246
- let e = B.value;
1247
- !e || U.value || (A.get(e.pageId)?.updateSelectedContentImage({
1248
- width: ke(or.value),
1249
- height: ke(sr.value)
1250
- }) && (V.value = "已更新图片尺寸"), $());
1251
- }
1252
- function ss() {
1253
- let e = B.value;
1254
- !e || U.value || (A.get(e.pageId)?.updateSelectedContentImage({
1252
+ let e = V.value;
1253
+ !e || W.value || (A.get(e.pageId)?.updateSelectedContentImage({
1255
1254
  width: void 0,
1256
1255
  height: void 0
1257
- }) && (V.value = "已恢复图片自然尺寸"), $());
1256
+ }) && (H.value = "已恢复图片自然尺寸"), $());
1258
1257
  }
1259
- function cs(e) {
1260
- e.type === "table" ? rs(e) : e.type === "image" ? is(e) : ts(e);
1258
+ function ss(e) {
1259
+ e.type === "table" ? ns(e) : e.type === "image" ? rs(e) : es(e);
1261
1260
  }
1262
1261
  function $() {
1263
- L.value = void 0, z.value = void 0, B.value = void 0, nr.value = !1, rr.value = "";
1262
+ R.value = void 0, B.value = void 0, V.value = void 0, tr.value = !1, nr.value = "";
1264
1263
  }
1265
- function ls() {
1266
- Er(!1), F.value = !1, I.value = !1, Ln.value = !1, Bn.value = !1, Vn.value = !1, Hn.value = !1, Un.value = !1;
1264
+ function cs() {
1265
+ Tr(!1), I.value = !1, L.value = !1, In.value = !1, zn.value = !1, Bn.value = !1, Vn.value = !1, Hn.value = !1;
1267
1266
  }
1268
- function us() {
1269
- ls(), N.value = !N.value, _(() => ro(() => sn.value?.focusChromeToggle()));
1267
+ function ls() {
1268
+ cs(), N.value = !N.value, _(() => no(() => sn.value?.focusChromeToggle()));
1270
1269
  }
1271
- let ds = [
1270
+ let us = [
1272
1271
  ".gd-contract-template-designer__context-menu",
1273
1272
  ".gd-contract-template-designer__bubble-menu",
1274
1273
  ".gd-contract-template-designer__bubble-menu-popup"
1275
1274
  ].join(",");
1276
- function fs() {
1277
- let e = U.value || er.value || Qn.value || Mr.value || P.value || wn.value, t = D.value, n = e ? void 0 : A.get(t)?.getSelectionViewportRect();
1275
+ function ds() {
1276
+ let e = W.value || $n.value || Zn.value || Ar.value || F.value || wn.value, t = D.value, n = e ? void 0 : A.get(t)?.getSelectionViewportRect();
1278
1277
  if (!n) {
1279
- R.value = void 0;
1278
+ z.value = void 0;
1280
1279
  return;
1281
1280
  }
1282
1281
  let r = n.top - 40 - tn, i = r >= 12 ? r : n.bottom + tn, a = _t((n.left + n.right) / 2 - 380 / 2, i, 380, 40);
1283
- R.value = {
1282
+ z.value = {
1284
1283
  pageId: t,
1285
1284
  x: a.x,
1286
1285
  y: a.y
1287
- }, _(() => ps(n));
1286
+ }, _(() => fs(n));
1288
1287
  }
1289
- function ps(e) {
1290
- let t = Zn.value?.getMenuElement(), n = R.value;
1288
+ function fs(e) {
1289
+ let t = Xn.value?.getMenuElement(), n = z.value;
1291
1290
  if (!t || !n) return;
1292
1291
  let r = t.getBoundingClientRect(), i = e.top - r.height - tn, a = i >= 12 ? i : e.bottom + tn, o = vt((e.left + e.right) / 2 - r.width / 2, a, t);
1293
- R.value = {
1292
+ z.value = {
1294
1293
  ...n,
1295
1294
  x: o.x,
1296
1295
  y: o.y
1297
1296
  };
1298
1297
  }
1299
- function ms() {
1300
- let e = R.value?.pageId ?? D.value, t = A.get(e)?.getSelectionRange();
1301
- $n = t ? {
1298
+ function ps() {
1299
+ let e = z.value?.pageId ?? D.value, t = A.get(e)?.getSelectionRange();
1300
+ Qn = t ? {
1302
1301
  pageId: e,
1303
1302
  ...t
1304
- } : void 0, Qn.value = !0, R.value = void 0;
1303
+ } : void 0, Zn.value = !0, z.value = void 0;
1305
1304
  }
1306
- function hs(e) {
1307
- if (!Qn.value) return;
1308
- let t = $n, n = A.get(e)?.getSelectionRange();
1309
- t && n && t.pageId === e && t.from === n.from && t.to === n.to || (Qn.value = !1, $n = void 0);
1305
+ function ms(e) {
1306
+ if (!Zn.value) return;
1307
+ let t = Qn, n = A.get(e)?.getSelectionRange();
1308
+ t && n && t.pageId === e && t.from === n.from && t.to === n.to || (Zn.value = !1, Qn = void 0);
1310
1309
  }
1311
- function gs() {
1312
- !R.value || tr !== void 0 || (tr = requestAnimationFrame(() => {
1313
- tr = void 0, fs();
1310
+ function hs() {
1311
+ !z.value || er !== void 0 || (er = requestAnimationFrame(() => {
1312
+ er = void 0, ds();
1314
1313
  }));
1315
1314
  }
1315
+ function gs() {
1316
+ $n.value && ($n.value = !1, ds());
1317
+ }
1316
1318
  function _s() {
1317
- er.value && (er.value = !1, fs());
1319
+ $(), hs();
1318
1320
  }
1319
- function vs() {
1320
- $(), gs();
1321
+ function vs(e, t) {
1322
+ A.get(z.value?.pageId ?? D.value)?.requestTextContextMenu(e, t);
1321
1323
  }
1322
- function ys(e, t) {
1323
- A.get(R.value?.pageId ?? D.value)?.requestTextContextMenu(e, t);
1324
+ function ys(e) {
1325
+ let t = e.target instanceof Element ? e.target : null;
1326
+ t?.closest(".ProseMirror") && ($n.value = !0, z.value = void 0), !(!R.value && !B.value && !V.value && !z.value) && (t?.closest(us) || ($(), z.value && ps()));
1324
1327
  }
1325
1328
  function bs(e) {
1326
- let t = e.target instanceof Element ? e.target : null;
1327
- t?.closest(".ProseMirror") && (er.value = !0, R.value = void 0), !(!L.value && !z.value && !B.value && !R.value) && (t?.closest(ds) || ($(), R.value && ms()));
1329
+ (e.target instanceof Element ? e.target : null)?.closest(us) || ($(), hs());
1328
1330
  }
1329
1331
  function xs(e) {
1330
- (e.target instanceof Element ? e.target : null)?.closest(ds) || ($(), gs());
1331
- }
1332
- function Ss(e) {
1333
1332
  let t = rn.value;
1334
1333
  if (!t || typeof document > "u") return !1;
1335
1334
  let n = e.target instanceof Node ? e.target : void 0, r = document.activeElement;
1336
1335
  return !!(n && t.contains(n) || r && t.contains(r) || n instanceof Element && n.closest(".gd-contract-template-designer__context-menu"));
1337
1336
  }
1338
- function Cs(e) {
1339
- if (e.key !== "Escape" || !P.value || typeof document > "u") return;
1337
+ function Ss(e) {
1338
+ if (e.key !== "Escape" || !F.value || typeof document > "u") return;
1340
1339
  let t = rn.value?.querySelector(".gd-contract-template-designer__page-decorations-studio");
1341
1340
  if (!t) return;
1342
- let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(ur) || r?.closest(ur)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
1341
+ let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(lr) || r?.closest(lr)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
1343
1342
  if (i || a && o) {
1344
- lr.add(e);
1343
+ cr.add(e);
1345
1344
  return;
1346
1345
  }
1347
- !Mr.value && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), To());
1346
+ !Ar.value && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), wo());
1348
1347
  }
1349
- function ws(e) {
1348
+ function Cs(e) {
1350
1349
  if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "s") {
1351
- if (!Nr.value || !Ss(e)) return;
1352
- e.preventDefault(), ui();
1350
+ if (!jr.value || !xs(e)) return;
1351
+ e.preventDefault(), ci();
1353
1352
  return;
1354
1353
  }
1355
1354
  if (e.key === "Escape") {
1356
- if (lr.has(e)) {
1357
- lr.delete(e);
1355
+ if (cr.has(e)) {
1356
+ cr.delete(e);
1358
1357
  return;
1359
1358
  }
1360
- let t = Mr.value, n = t || P.value;
1361
- if (!t && P.value && To(), $(), ls(), n && e.stopPropagation(), !n) {
1362
- if (R.value) {
1363
- ms(), e.stopPropagation();
1359
+ let t = Ar.value, n = t || F.value;
1360
+ if (!t && F.value && wo(), $(), cs(), n && e.stopPropagation(), !n) {
1361
+ if (z.value) {
1362
+ ps(), e.stopPropagation();
1364
1363
  return;
1365
1364
  }
1366
- Pn.value ? ao() : M.value = !1;
1365
+ P.value ? io() : M.value = !1;
1367
1366
  }
1368
1367
  }
1369
1368
  }
1370
- function Ts(e, t) {
1371
- e === D.value && t.selectedContentImage && (E.value = ""), e === D.value && (hs(e), fs());
1372
- let n = Rn.value[e];
1373
- n && gt(n, t) || (Rn.value = {
1374
- ...Rn.value,
1369
+ function ws(e, t) {
1370
+ e === D.value && t.selectedContentImage && (E.value = ""), e === D.value && (ms(e), ds());
1371
+ let n = Ln.value[e];
1372
+ n && gt(n, t) || (Ln.value = {
1373
+ ...Ln.value,
1375
1374
  [e]: t
1376
1375
  });
1377
1376
  }
1378
- function Es(e = cr.value.rows, t = cr.value.cols) {
1379
- Z({
1377
+ function Ts(e = sr.value.rows, t = sr.value.cols) {
1378
+ Q({
1380
1379
  type: "insert-table",
1381
1380
  options: {
1382
1381
  rows: Math.min(10, Math.max(1, Math.round(Number(e) || 3))),
1383
1382
  cols: Math.min(10, Math.max(1, Math.round(Number(t) || 3))),
1384
- withHeaderRow: !!cr.value.withHeaderRow
1383
+ withHeaderRow: !!sr.value.withHeaderRow
1385
1384
  }
1386
- }), F.value = !1, $();
1385
+ }), I.value = !1, $();
1387
1386
  }
1388
- let Ds = {
1387
+ let Es = {
1389
1388
  "delete-table-row": {
1390
1389
  label: "删除当前行",
1391
1390
  countKey: "deleteRow"
@@ -1399,12 +1398,12 @@ var Vt = {
1399
1398
  countKey: "deleteTable"
1400
1399
  }
1401
1400
  };
1402
- function Os(e) {
1403
- let t = z.value;
1401
+ function Ds(e) {
1402
+ let t = B.value;
1404
1403
  if (!t) return;
1405
1404
  let n = () => {
1406
- Z(e, t.pageId), $();
1407
- }, r = Ds[e.type];
1405
+ Q(e, t.pageId), $();
1406
+ }, r = Es[e.type];
1408
1407
  if (!r) {
1409
1408
  n();
1410
1409
  return;
@@ -1420,12 +1419,12 @@ var Vt = {
1420
1419
  onCancel: () => A.get(t.pageId)?.focus()
1421
1420
  });
1422
1421
  }
1423
- function ks(e) {
1424
- let t = ir.value?.getMenuElement();
1422
+ function Os(e) {
1423
+ let t = rr.value?.getMenuElement();
1425
1424
  if (!t) return;
1426
1425
  if (e.key === "Escape") {
1427
1426
  e.preventDefault(), e.stopPropagation();
1428
- let t = z.value?.pageId;
1427
+ let t = B.value?.pageId;
1429
1428
  $(), A.get(t ?? "")?.focus();
1430
1429
  return;
1431
1430
  }
@@ -1444,80 +1443,80 @@ var Vt = {
1444
1443
  let r = (Math.max(0, n.indexOf(document.activeElement)) + (e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1) + n.length) % n.length;
1445
1444
  e.preventDefault(), n[r]?.focus();
1446
1445
  }
1447
- function As(e) {
1446
+ function ks(e) {
1448
1447
  if (e.key !== "Escape") return;
1449
1448
  e.preventDefault(), e.stopPropagation();
1450
- let t = L.value?.pageId;
1449
+ let t = R.value?.pageId;
1451
1450
  $(), A.get(t ?? "")?.focus();
1452
1451
  }
1453
- function js(e) {
1452
+ function As(e) {
1454
1453
  if (e.key !== "Escape") return;
1455
1454
  e.preventDefault(), e.stopPropagation();
1456
- let t = B.value?.pageId;
1455
+ let t = V.value?.pageId;
1457
1456
  $(), A.get(t ?? "")?.focus();
1458
1457
  }
1459
- function Ms(e) {
1460
- Z({ type: e }), I.value = !1, $();
1458
+ function js(e) {
1459
+ Q({ type: e }), L.value = !1, $();
1461
1460
  }
1462
1461
  return Xe({
1463
- getValue: Eo,
1464
- setValue: Do,
1465
- getFiles: Oo,
1466
- setFiles: ko,
1467
- addFile: Ao,
1468
- selectFile: jo,
1469
- renameFile: Mo,
1470
- removeFile: No,
1471
- moveFile: Fo,
1472
- validate: Io,
1473
- exportTemplate: zo,
1474
- exportFiles: Bo,
1475
- getSubmitData: lo,
1476
- clearTemplate: go,
1477
- saveDraftCache: ui,
1478
- loadDraftCache: di,
1479
- clearDraftCache: fi,
1480
- getDraftCacheStatus: Bi,
1481
- insertVariable: La,
1482
- insertImage: ha,
1483
- focus: Wo,
1484
- openPreview: so,
1485
- closePreview: co,
1486
- openSubmitDataViewer: uo,
1487
- closeSubmitDataViewer: fo,
1488
- getVariableData: po,
1489
- openVariableDataViewer: mo,
1490
- closeVariableDataViewer: ho,
1491
- setServerValidationErrors: Ho,
1492
- clearValidationErrors: Uo,
1493
- scrollToVariable: bo,
1494
- scrollToPage: Co,
1495
- setZoom: Za,
1496
- resetZoom: Qa,
1497
- getZoom: $a,
1498
- fitWidth: qa
1462
+ getValue: To,
1463
+ setValue: Eo,
1464
+ getFiles: Do,
1465
+ setFiles: Oo,
1466
+ addFile: ko,
1467
+ selectFile: Ao,
1468
+ renameFile: jo,
1469
+ removeFile: Mo,
1470
+ moveFile: Po,
1471
+ validate: Fo,
1472
+ exportTemplate: Ro,
1473
+ exportFiles: zo,
1474
+ getSubmitData: co,
1475
+ clearTemplate: ho,
1476
+ saveDraftCache: ci,
1477
+ loadDraftCache: li,
1478
+ clearDraftCache: ui,
1479
+ getDraftCacheStatus: Ri,
1480
+ insertVariable: Ia,
1481
+ insertImage: pa,
1482
+ focus: Uo,
1483
+ openPreview: oo,
1484
+ closePreview: so,
1485
+ openSubmitDataViewer: lo,
1486
+ closeSubmitDataViewer: uo,
1487
+ getVariableData: fo,
1488
+ openVariableDataViewer: po,
1489
+ closeVariableDataViewer: mo,
1490
+ setServerValidationErrors: Vo,
1491
+ clearValidationErrors: Ho,
1492
+ scrollToVariable: yo,
1493
+ scrollToPage: So,
1494
+ setZoom: Xa,
1495
+ resetZoom: Za,
1496
+ getZoom: Qa,
1497
+ fitWidth: Ka
1499
1498
  }), (e, t) => (v(), St("div", {
1500
1499
  ref_key: "designerElement",
1501
1500
  ref: rn,
1502
1501
  class: wt(["gd-contract-template-designer", {
1503
1502
  "is-disabled": s.disabled,
1504
- "is-readonly": U.value,
1503
+ "is-readonly": W.value,
1505
1504
  "is-fullscreen": M.value,
1506
- "is-immersive": Pn.value
1505
+ "is-immersive": P.value
1507
1506
  }]),
1508
1507
  style: Tt(nn.value),
1509
- onKeydownCapture: t[31] ||= (...e) => b(jr) && b(jr)(...e)
1508
+ onKeydownCapture: t[31] ||= (...e) => b(kr) && b(kr)(...e)
1510
1509
  }, [
1511
1510
  S.value ? (v(), xt(ft, {
1512
1511
  key: 0,
1513
1512
  files: C.value,
1514
1513
  "active-file-id": w.value,
1515
- readonly: U.value,
1516
- onSelect: jo,
1517
- onAdd: t[0] ||= (e) => Ao(),
1518
- onRename: Mo,
1519
- onRemove: Po,
1520
- onMove: Fo
1514
+ readonly: W.value,
1515
+ onSelect: Ao,
1516
+ onAdd: t[0] ||= (e) => ko(),
1517
+ onRename: jo,
1518
+ onRemove: No,
1519
+ onMove: Po
1521
1520
  }, null, 8, [
1522
1521
  "files",
1523
1522
  "active-file-id",
@@ -1531,26 +1530,26 @@ var Vt = {
1531
1530
  collapsed: Mn.value,
1532
1531
  pages: T.value.pages,
1533
1532
  variables: T.value.variables,
1534
- "decoration-variable-keys": li.value,
1533
+ "decoration-variable-keys": si.value,
1535
1534
  "active-page-id": D.value,
1536
1535
  "selected-variable-key": E.value,
1537
- "normalized-max-pages": si.value,
1538
- "page-limit-reached": ci.value,
1539
- "selected-page": W.value,
1540
- "selected-page-size": Rr.value,
1541
- "normalized-page-size-options": ei.value,
1542
- "page-size-options": ti.value,
1543
- "selected-page-size-option-value": ni.value,
1544
- readonly: U.value,
1545
- "get-page-size": Xi,
1536
+ "normalized-max-pages": ai.value,
1537
+ "page-limit-reached": oi.value,
1538
+ "selected-page": G.value,
1539
+ "selected-page-size": Ir.value,
1540
+ "normalized-page-size-options": Qr.value,
1541
+ "page-size-options": $r.value,
1542
+ "selected-page-size-option-value": ei.value,
1543
+ readonly: W.value,
1544
+ "get-page-size": Ji,
1546
1545
  onToggle: t[1] ||= (e) => Mn.value = !Mn.value,
1547
- onAddPage: $i,
1548
- onActivatePage: xo,
1549
- onNavigateOutline: So,
1550
- onDuplicatePage: ea,
1551
- onRemovePage: na,
1552
- onPatchPageFormat: Zi,
1553
- onScrollToVariable: yo
1546
+ onAddPage: Zi,
1547
+ onActivatePage: bo,
1548
+ onNavigateOutline: xo,
1549
+ onDuplicatePage: Qi,
1550
+ onRemovePage: ea,
1551
+ onPatchPageFormat: Yi,
1552
+ onScrollToVariable: vo
1554
1553
  }, null, 8, [
1555
1554
  "collapsed",
1556
1555
  "pages",
@@ -1578,61 +1577,60 @@ var Vt = {
1578
1577
  }, [h(Re, {
1579
1578
  ref_key: "workspaceHeaderElement",
1580
1579
  ref: sn,
1581
- summary: Vr.value,
1582
- "draft-cache-status-text": Gr.value,
1583
- "draft-cache-status-class": Kr.value,
1580
+ summary: zr.value,
1581
+ "draft-cache-status-text": Ur.value,
1582
+ "draft-cache-status-class": Wr.value,
1584
1583
  "show-draft-cache-status": s.showDraftCacheStatus,
1585
1584
  "show-clear-button": s.showClearButton,
1586
1585
  "show-submit-data-viewer": s.showSubmitDataViewer,
1587
1586
  "show-variable-data-viewer": s.showVariableDataViewer,
1588
- readonly: U.value,
1589
- "zoom-percent": qr.value,
1587
+ readonly: W.value,
1588
+ "zoom-percent": Gr.value,
1590
1589
  "zoom-out-disabled": j.value <= Gt,
1591
1590
  "zoom-in-disabled": j.value >= Kt,
1592
1591
  "is-fullscreen": M.value,
1593
- immersive: Pn.value,
1594
- "page-decorations-open": P.value,
1592
+ immersive: P.value,
1593
+ "page-decorations-open": F.value,
1595
1594
  "page-decorations-studio-id": ln,
1596
- "page-decorations-preset-label": Hr.value,
1597
- "page-decorations-enabled-count": Wr.value,
1598
- "page-decorations-enabled-states": Ur.value,
1595
+ "page-decorations-preset-label": Br.value,
1596
+ "page-decorations-enabled-count": Hr.value,
1597
+ "page-decorations-enabled-states": Vr.value,
1599
1598
  "chrome-controls-id": un,
1600
- onZoomOut: to,
1601
- onZoomIn: eo,
1602
- onFitWidth: b(qa),
1603
- onResetZoom: Qa,
1604
- onToggleFullscreen: no,
1605
- onToggleImmersive: oo,
1606
- onClear: _o,
1607
- onValidate: Io,
1608
- onPreview: so,
1609
- onSubmitData: uo,
1610
- onVariableData: mo,
1611
- onTogglePageDecorations: wo,
1612
- onToggleChrome: us
1599
+ onZoomOut: eo,
1600
+ onZoomIn: $a,
1601
+ onFitWidth: b(Ka),
1602
+ onResetZoom: Za,
1603
+ onToggleFullscreen: to,
1604
+ onToggleImmersive: ao,
1605
+ onClear: go,
1606
+ onValidate: Fo,
1607
+ onPreview: oo,
1608
+ onSubmitData: lo,
1609
+ onVariableData: po,
1610
+ onTogglePageDecorations: Co,
1611
+ onToggleChrome: ls
1613
1612
  }, {
1614
1613
  authoring: Mt(() => [h(Ve, {
1615
1614
  ref_key: "authoringBarElement",
1616
1615
  ref: pn,
1617
1616
  compact: "",
1618
- query: b(_r),
1619
- "onUpdate:query": t[2] ||= (e) => Ct(_r) ? _r.value = e : null,
1620
- replacement: b(vr),
1621
- "onUpdate:replacement": t[3] ||= (e) => Ct(vr) ? vr.value = e : null,
1622
- "match-case": b(yr),
1623
- "onUpdate:matchCase": t[4] ||= (e) => Ct(yr) ? yr.value = e : null,
1624
- panel: b(gr),
1625
- readonly: U.value,
1626
- total: b(br).length,
1627
- "current-index": b(xr),
1628
- "current-page": b(Sr) ? b(Sr).pageIndex + 1 : void 0,
1629
- feedback: b(Cr),
1630
- onOpen: b(Tr),
1631
- onClose: t[5] ||= (e) => b(Er)(),
1632
- onNavigate: b(Dr),
1633
- onReplaceCurrent: b(Or),
1634
- onReplaceAll: b(kr),
1635
- onInsertSnippet: b(Ar)
1617
+ query: b(gr),
1618
+ "onUpdate:query": t[2] ||= (e) => Ct(gr) ? gr.value = e : null,
1619
+ replacement: b(_r),
1620
+ "onUpdate:replacement": t[3] ||= (e) => Ct(_r) ? _r.value = e : null,
1621
+ "match-case": b(vr),
1622
+ "onUpdate:matchCase": t[4] ||= (e) => Ct(vr) ? vr.value = e : null,
1623
+ panel: b(hr),
1624
+ readonly: W.value,
1625
+ total: b(yr).length,
1626
+ "current-index": b(br),
1627
+ "current-page": b(xr) ? b(xr).pageIndex + 1 : void 0,
1628
+ feedback: b(Sr),
1629
+ onOpen: b(wr),
1630
+ onClose: t[5] ||= (e) => b(Tr)(),
1631
+ onNavigate: b(Er),
1632
+ onReplaceCurrent: b(Dr),
1633
+ onReplaceAll: b(Or)
1636
1634
  }, null, 8, [
1637
1635
  "query",
1638
1636
  "replacement",
@@ -1646,8 +1644,7 @@ var Vt = {
1646
1644
  "onOpen",
1647
1645
  "onNavigate",
1648
1646
  "onReplaceCurrent",
1649
- "onReplaceAll",
1650
- "onInsertSnippet"
1647
+ "onReplaceAll"
1651
1648
  ])]),
1652
1649
  _: 1
1653
1650
  }, 8, [
@@ -1670,63 +1667,63 @@ var Vt = {
1670
1667
  "page-decorations-enabled-states",
1671
1668
  "onFitWidth"
1672
1669
  ]), h(Be, {
1673
- "variable-insert-popover-open": Bn.value,
1674
- "onUpdate:variableInsertPopoverOpen": t[6] ||= (e) => Bn.value = e,
1675
- "signing-layout-popover-open": Hn.value,
1676
- "onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) => Hn.value = e,
1677
- "signing-mark-popover-open": Un.value,
1678
- "onUpdate:signingMarkPopoverOpen": t[8] ||= (e) => Un.value = e,
1679
- "image-insert-popover-open": Vn.value,
1680
- "onUpdate:imageInsertPopoverOpen": t[9] ||= (e) => Vn.value = e,
1681
- "image-insert-url": Gn.value,
1682
- "onUpdate:imageInsertUrl": t[10] ||= (e) => Gn.value = e,
1683
- "image-insert-width": Kn.value,
1684
- "onUpdate:imageInsertWidth": t[11] ||= (e) => Kn.value = e,
1685
- "image-insert-height": qn.value,
1686
- "onUpdate:imageInsertHeight": t[12] ||= (e) => qn.value = e,
1687
- "table-insert-popover-open": F.value,
1688
- "onUpdate:tableInsertPopoverOpen": t[13] ||= (e) => F.value = e,
1689
- "table-actions-popover-open": I.value,
1690
- "onUpdate:tableActionsPopoverOpen": t[14] ||= (e) => I.value = e,
1691
- "table-insert-draft": cr.value,
1692
- "onUpdate:tableInsertDraft": t[15] ||= (e) => cr.value = e,
1693
- "toolbar-more-open": Ln.value,
1694
- "onUpdate:toolbarMoreOpen": t[16] ||= (e) => Ln.value = e,
1695
- readonly: U.value,
1696
- "editor-state": q.value,
1697
- "current-block-format": bi.value,
1698
- "block-format-options": Zr,
1699
- "font-family-select-options": Yr.value,
1700
- "current-editor-font-family": xi.value,
1701
- "font-size-preset-options": Ti.value,
1702
- "current-editor-font-size": Si.value,
1703
- "editor-font-size-search-value": zn.value,
1704
- "current-editor-text-color": Ci.value,
1705
- "body-control-tool-items": oi.value,
1706
- "signing-layout-presets": ai.value,
1707
- "page-limit-reached": ci.value,
1708
- "normalized-max-pages": si.value,
1709
- "image-processing": Yn.value,
1710
- "image-insert-error": Jn.value,
1711
- onCommand: t[17] ||= (e) => Z(e),
1712
- onPatchBlockFormat: Ko,
1713
- onPatchFontFamily: Jo,
1714
- onPatchFontSize: qo,
1715
- onPatchColor: Yo,
1716
- onPatchTextAlign: Go,
1717
- onInsertVariable: ya,
1718
- onInsertSigningLayout: Hi,
1719
- onInsertSigningMark: Gi,
1720
- onOpenSigningLayoutCustom: Wi,
1721
- onOpenImageFile: ga,
1722
- onInsertImageUrl: va,
1723
- onAddPage: $i,
1724
- onInsertTable: Es,
1725
- onTableAction: Ms,
1726
- onFontSizeSearch: Zo,
1727
- onFontSizeCommit: Qo,
1728
- onFontSizeDropdownChange: es,
1729
- onFontSizeKeydown: $o
1670
+ "variable-insert-popover-open": zn.value,
1671
+ "onUpdate:variableInsertPopoverOpen": t[6] ||= (e) => zn.value = e,
1672
+ "signing-layout-popover-open": Vn.value,
1673
+ "onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) => Vn.value = e,
1674
+ "signing-mark-popover-open": Hn.value,
1675
+ "onUpdate:signingMarkPopoverOpen": t[8] ||= (e) => Hn.value = e,
1676
+ "image-insert-popover-open": Bn.value,
1677
+ "onUpdate:imageInsertPopoverOpen": t[9] ||= (e) => Bn.value = e,
1678
+ "image-insert-url": Wn.value,
1679
+ "onUpdate:imageInsertUrl": t[10] ||= (e) => Wn.value = e,
1680
+ "image-insert-width": Gn.value,
1681
+ "onUpdate:imageInsertWidth": t[11] ||= (e) => Gn.value = e,
1682
+ "image-insert-height": Kn.value,
1683
+ "onUpdate:imageInsertHeight": t[12] ||= (e) => Kn.value = e,
1684
+ "table-insert-popover-open": I.value,
1685
+ "onUpdate:tableInsertPopoverOpen": t[13] ||= (e) => I.value = e,
1686
+ "table-actions-popover-open": L.value,
1687
+ "onUpdate:tableActionsPopoverOpen": t[14] ||= (e) => L.value = e,
1688
+ "table-insert-draft": sr.value,
1689
+ "onUpdate:tableInsertDraft": t[15] ||= (e) => sr.value = e,
1690
+ "toolbar-more-open": In.value,
1691
+ "onUpdate:toolbarMoreOpen": t[16] ||= (e) => In.value = e,
1692
+ readonly: W.value,
1693
+ "editor-state": J.value,
1694
+ "current-block-format": vi.value,
1695
+ "block-format-options": Yr,
1696
+ "font-family-select-options": qr.value,
1697
+ "current-editor-font-family": yi.value,
1698
+ "font-size-preset-options": Ci.value,
1699
+ "current-editor-font-size": bi.value,
1700
+ "editor-font-size-search-value": Rn.value,
1701
+ "current-editor-text-color": xi.value,
1702
+ "body-control-tool-items": ii.value,
1703
+ "signing-layout-presets": ri.value,
1704
+ "page-limit-reached": oi.value,
1705
+ "normalized-max-pages": ai.value,
1706
+ "image-processing": Jn.value,
1707
+ "image-insert-error": qn.value,
1708
+ onCommand: t[17] ||= (e) => Q(e),
1709
+ onPatchBlockFormat: Go,
1710
+ onPatchFontFamily: qo,
1711
+ onPatchFontSize: Ko,
1712
+ onPatchColor: Jo,
1713
+ onPatchTextAlign: Wo,
1714
+ onInsertVariable: _a,
1715
+ onInsertSigningLayout: Bi,
1716
+ onInsertSigningMark: Ui,
1717
+ onOpenSigningLayoutCustom: Hi,
1718
+ onOpenImageFile: ma,
1719
+ onInsertImageUrl: ga,
1720
+ onAddPage: Zi,
1721
+ onInsertTable: Ts,
1722
+ onTableAction: js,
1723
+ onFontSizeSearch: Xo,
1724
+ onFontSizeCommit: Zo,
1725
+ onFontSizeDropdownChange: $o,
1726
+ onFontSizeKeydown: Qo
1730
1727
  }, null, 8, /* @__PURE__ */ "variable-insert-popover-open.signing-layout-popover-open.signing-mark-popover-open.image-insert-popover-open.image-insert-url.image-insert-width.image-insert-height.table-insert-popover-open.table-actions-popover-open.table-insert-draft.toolbar-more-open.readonly.editor-state.current-block-format.font-family-select-options.current-editor-font-family.font-size-preset-options.current-editor-font-size.editor-font-size-search-value.current-editor-text-color.body-control-tool-items.signing-layout-presets.page-limit-reached.normalized-max-pages.image-processing.image-insert-error".split("."))], 512), [[jt, !N.value]]),
1731
1728
  N.value ? (v(), xt(b(It), {
1732
1729
  key: 0,
@@ -1740,33 +1737,33 @@ var Vt = {
1740
1737
  "aria-label": "展开工具区",
1741
1738
  "aria-expanded": !1,
1742
1739
  "aria-controls": un,
1743
- onClick: us
1740
+ onClick: ls
1744
1741
  }, [h(b(Bt), { "aria-hidden": "true" })], 512)]),
1745
1742
  _: 1
1746
1743
  })) : p("", !0),
1747
- Pn.value && !P.value ? (v(), St("button", {
1744
+ P.value && !F.value ? (v(), St("button", {
1748
1745
  key: 1,
1749
1746
  ref_key: "immersiveExitElement",
1750
- ref: Fn,
1747
+ ref: Pn,
1751
1748
  type: "button",
1752
1749
  class: "gd-contract-template-designer__immersive-exit",
1753
1750
  "aria-label": "退出沉浸写作",
1754
- onClick: ao
1751
+ onClick: io
1755
1752
  }, [
1756
1753
  h(b(zt), { "aria-hidden": "true" }),
1757
1754
  t[32] ||= m("span", { class: "gd-contract-template-designer__immersive-exit-label" }, "退出沉浸", -1),
1758
1755
  t[33] ||= m("kbd", null, "Esc", -1)
1759
1756
  ], 512)) : p("", !0),
1760
1757
  O.value ? (v(), St("section", Vt, [h(b(Pt), {
1761
- type: zr.value ? "success" : "error",
1762
- message: Br.value,
1758
+ type: Lr.value ? "success" : "error",
1759
+ message: Rr.value,
1763
1760
  "show-icon": ""
1764
1761
  }, null, 8, ["type", "message"]), k.value.length ? (v(), St("div", Ht, [(v(!0), St(yt, null, Ot(k.value, (e) => (v(), St("button", {
1765
1762
  key: `${e.id}-${e.message}`,
1766
1763
  type: "button",
1767
1764
  class: "gd-contract-template-designer__validation-item",
1768
- onClick: (t) => Lo(e)
1769
- }, [m("span", null, kt(e.message), 1), m("small", null, kt(Ro(e)), 1)], 8, Ut))), 128))])) : p("", !0)])) : p("", !0),
1765
+ onClick: (t) => Io(e)
1766
+ }, [m("span", null, kt(e.message), 1), m("small", null, kt(Lo(e)), 1)], 8, Ut))), 128))])) : p("", !0)])) : p("", !0),
1770
1767
  m("div", {
1771
1768
  ref_key: "canvasElement",
1772
1769
  ref: an,
@@ -1774,10 +1771,10 @@ var Vt = {
1774
1771
  }, [(v(!0), St(yt, null, Ot(T.value.pages, (e, n) => (v(), xt(Ie, {
1775
1772
  key: `${w.value}:${e.id}`,
1776
1773
  ref_for: !0,
1777
- ref: (t) => Vi(e.id, t),
1774
+ ref: (t) => zi(e.id, t),
1778
1775
  page: e,
1779
1776
  "page-index": n,
1780
- "page-size": Xi(e),
1777
+ "page-size": Ji(e),
1781
1778
  "page-decorations": T.value.pageDecorations,
1782
1779
  "total-pages": T.value.pages.length,
1783
1780
  variables: T.value.variables,
@@ -1786,18 +1783,18 @@ var Vt = {
1786
1783
  readonly: s.readonly,
1787
1784
  disabled: s.disabled,
1788
1785
  zoom: j.value,
1789
- "process-image-file": ma,
1790
- "search-query": b(wr),
1791
- "search-match-case": b(yr),
1792
- "active-search-match": b(Sr)?.pageId === e.id ? b(Sr) : void 0,
1793
- onPageUpdate: Yi,
1794
- onVariableDrop: xa,
1795
- onVariableSelect: Sa,
1796
- onEditorFocus: t[18] ||= (e) => xo(e, !1),
1797
- onEditorStateChange: Ts,
1798
- onEditorContextMenu: cs,
1799
- onWordPaste: pa,
1800
- onVariableMoveBlocked: t[19] ||= (e) => V.value = "变量只能在当前页内移动,跨页移动尚未支持。"
1786
+ "process-image-file": fa,
1787
+ "search-query": b(Cr),
1788
+ "search-match-case": b(vr),
1789
+ "active-search-match": b(xr)?.pageId === e.id ? b(xr) : void 0,
1790
+ onPageUpdate: qi,
1791
+ onVariableDrop: ya,
1792
+ onVariableSelect: ba,
1793
+ onEditorFocus: t[18] ||= (e) => bo(e, !1),
1794
+ onEditorStateChange: ws,
1795
+ onEditorContextMenu: ss,
1796
+ onWordPaste: da,
1797
+ onVariableMoveBlocked: t[19] ||= (e) => H.value = "变量只能在当前页内移动,跨页移动尚未支持。"
1801
1798
  }, null, 8, [
1802
1799
  "page",
1803
1800
  "page-index",
@@ -1819,34 +1816,34 @@ var Vt = {
1819
1816
  collapsed: Nn.value,
1820
1817
  readonly: s.readonly,
1821
1818
  disabled: s.disabled,
1822
- "body-control-tool-items": oi.value,
1823
- "selected-variable": G.value,
1819
+ "body-control-tool-items": ii.value,
1820
+ "selected-variable": K.value,
1824
1821
  variables: T.value.variables,
1825
- "current-variable-font-family": wi.value,
1826
- "font-family-select-options": Yr.value,
1827
- "text-align-options": b(Xr),
1828
- "border-style-options": Qr,
1829
- "object-fit-options": $r,
1830
- "selected-variable-width-max": vi.value,
1831
- "selected-variable-height-max": yi.value,
1822
+ "current-variable-font-family": Si.value,
1823
+ "font-family-select-options": qr.value,
1824
+ "text-align-options": b(Jr),
1825
+ "border-style-options": Xr,
1826
+ "object-fit-options": Zr,
1827
+ "selected-variable-width-max": gi.value,
1828
+ "selected-variable-height-max": _i.value,
1832
1829
  "min-font-size": $t,
1833
1830
  "max-font-size": en,
1834
1831
  "default-multiline-rows": b(3),
1835
1832
  onToggle: t[20] ||= (e) => Nn.value = !Nn.value,
1836
- onVariableDragStart: Wa,
1837
- onInsertVariable: Ra,
1838
- onDuplicateVariable: Ia,
1839
- onRemoveVariable: Pa,
1840
- onPatchVariable: Q,
1841
- onRenameVariable: wa,
1842
- onPatchStyle: ka,
1843
- onPatchMultiline: Ma,
1844
- onPatchRows: Na,
1845
- onPatchFontFamily: Aa,
1846
- onPatchFontSize: ja,
1847
- onPatchTextAlign: Ea,
1848
- onPatchBorderStyle: Da,
1849
- onPatchObjectFit: Oa
1833
+ onVariableDragStart: Ua,
1834
+ onInsertVariable: La,
1835
+ onDuplicateVariable: Fa,
1836
+ onRemoveVariable: Na,
1837
+ onPatchVariable: Sa,
1838
+ onRenameVariable: Ca,
1839
+ onPatchStyle: Oa,
1840
+ onPatchMultiline: ja,
1841
+ onPatchRows: Ma,
1842
+ onPatchFontFamily: ka,
1843
+ onPatchFontSize: Aa,
1844
+ onPatchTextAlign: Ta,
1845
+ onPatchBorderStyle: Ea,
1846
+ onPatchObjectFit: Da
1850
1847
  }, null, 8, [
1851
1848
  "collapsed",
1852
1849
  "readonly",
@@ -1866,16 +1863,16 @@ var Vt = {
1866
1863
  ref_key: "pageDecorationsStudioElement",
1867
1864
  ref: cn,
1868
1865
  id: ln,
1869
- open: P.value,
1866
+ open: F.value,
1870
1867
  decorations: T.value.pageDecorations,
1871
1868
  variables: T.value.variables,
1872
- "font-family-options": Yr.value,
1869
+ "font-family-options": qr.value,
1873
1870
  readonly: s.readonly,
1874
1871
  disabled: s.disabled,
1875
- "active-tab": In.value,
1876
- "onUpdate:activeTab": t[21] ||= (e) => In.value = e,
1877
- onChange: Ta,
1878
- onClose: To
1872
+ "active-tab": Fn.value,
1873
+ "onUpdate:activeTab": t[21] ||= (e) => Fn.value = e,
1874
+ onChange: wa,
1875
+ onClose: wo
1879
1876
  }, null, 8, [
1880
1877
  "open",
1881
1878
  "decorations",
@@ -1884,39 +1881,39 @@ var Vt = {
1884
1881
  "readonly",
1885
1882
  "disabled",
1886
1883
  "active-tab"
1887
- ]), [[jt, P.value]]),
1884
+ ]), [[jt, F.value]]),
1888
1885
  (v(), xt(bt, { to: "body" }, [
1889
- z.value ? (v(), xt(Le, {
1886
+ B.value ? (v(), xt(Le, {
1890
1887
  key: 0,
1891
1888
  ref_key: "tableContextMenuElement",
1892
- ref: ir,
1893
- capabilities: z.value.capabilities,
1894
- "active-alignment": z.value.activeAlignment,
1889
+ ref: rr,
1890
+ capabilities: B.value.capabilities,
1891
+ "active-alignment": B.value.activeAlignment,
1895
1892
  style: Tt({
1896
- left: `${z.value.x}px`,
1897
- top: `${z.value.y}px`
1893
+ left: `${B.value.x}px`,
1894
+ top: `${B.value.y}px`
1898
1895
  }),
1899
- onExecute: Os,
1900
- onKeydown: ks
1896
+ onExecute: Ds,
1897
+ onKeydown: Os
1901
1898
  }, null, 8, [
1902
1899
  "capabilities",
1903
1900
  "active-alignment",
1904
1901
  "style"
1905
1902
  ])) : p("", !0),
1906
- B.value ? (v(), xt(Ge, {
1903
+ V.value ? (v(), xt(Ge, {
1907
1904
  key: 1,
1908
1905
  ref_key: "imageContextMenuElement",
1909
- ref: ar,
1910
- width: or.value,
1911
- "onUpdate:width": t[22] ||= (e) => or.value = e,
1912
- height: sr.value,
1913
- "onUpdate:height": t[23] ||= (e) => sr.value = e,
1914
- x: B.value.x,
1915
- y: B.value.y,
1916
- readonly: U.value,
1917
- onRestore: ss,
1918
- onApply: os,
1919
- onKeydown: js
1906
+ ref: ir,
1907
+ width: ar.value,
1908
+ "onUpdate:width": t[22] ||= (e) => ar.value = e,
1909
+ height: or.value,
1910
+ "onUpdate:height": t[23] ||= (e) => or.value = e,
1911
+ x: V.value.x,
1912
+ y: V.value.y,
1913
+ readonly: W.value,
1914
+ onRestore: os,
1915
+ onApply: as,
1916
+ onKeydown: As
1920
1917
  }, null, 8, [
1921
1918
  "width",
1922
1919
  "height",
@@ -1924,31 +1921,31 @@ var Vt = {
1924
1921
  "y",
1925
1922
  "readonly"
1926
1923
  ])) : p("", !0),
1927
- L.value ? (v(), xt(Ue, {
1924
+ R.value ? (v(), xt(Ue, {
1928
1925
  key: 2,
1929
1926
  ref_key: "textContextMenuElement",
1930
- ref: Xn,
1931
- "bind-open": nr.value,
1932
- "onUpdate:bindOpen": t[24] ||= (e) => nr.value = e,
1933
- "bind-keyword": rr.value,
1934
- "onUpdate:bindKeyword": t[25] ||= (e) => rr.value = e,
1935
- x: L.value.x,
1936
- y: L.value.y,
1937
- "has-selection": L.value.hasSelection,
1938
- "editor-state": q.value,
1939
- "current-editor-text-color": Ci.value,
1940
- "body-control-tool-items": oi.value,
1941
- "text-menu-bindable-variables": _i.value,
1927
+ ref: Yn,
1928
+ "bind-open": tr.value,
1929
+ "onUpdate:bindOpen": t[24] ||= (e) => tr.value = e,
1930
+ "bind-keyword": nr.value,
1931
+ "onUpdate:bindKeyword": t[25] ||= (e) => nr.value = e,
1932
+ x: R.value.x,
1933
+ y: R.value.y,
1934
+ "has-selection": R.value.hasSelection,
1935
+ "editor-state": J.value,
1936
+ "current-editor-text-color": xi.value,
1937
+ "body-control-tool-items": ii.value,
1938
+ "text-menu-bindable-variables": hi.value,
1942
1939
  "variables-count": T.value.variables.length,
1943
- "resolve-bind-variable-type-label": Ha,
1944
- onCommand: Ki,
1945
- onClipboard: qi,
1946
- onAddPage: ba,
1947
- onInsertVariable: za,
1948
- onBindVariable: Va,
1949
- onOpenBindPanel: Ua,
1950
- onKeydown: As,
1951
- onPatchColor: Xo
1940
+ "resolve-bind-variable-type-label": Va,
1941
+ onCommand: Wi,
1942
+ onClipboard: Gi,
1943
+ onAddPage: va,
1944
+ onInsertVariable: Ra,
1945
+ onBindVariable: Ba,
1946
+ onOpenBindPanel: Ha,
1947
+ onKeydown: ks,
1948
+ onPatchColor: Yo
1952
1949
  }, null, 8, [
1953
1950
  "bind-open",
1954
1951
  "bind-keyword",
@@ -1961,27 +1958,27 @@ var Vt = {
1961
1958
  "text-menu-bindable-variables",
1962
1959
  "variables-count"
1963
1960
  ])) : p("", !0),
1964
- R.value ? (v(), xt(We, {
1961
+ z.value ? (v(), xt(We, {
1965
1962
  key: 3,
1966
1963
  ref_key: "textBubbleElement",
1967
- ref: Zn,
1968
- x: R.value.x,
1969
- y: R.value.y,
1970
- "editor-state": q.value,
1971
- "font-size-preset-options": Ti.value,
1972
- "current-editor-font-size": Si.value,
1973
- "editor-font-size-search-value": zn.value,
1974
- "current-editor-text-color": Ci.value,
1975
- "text-align-options": b(Xr),
1976
- onCommand: Z,
1977
- onPatchFontSize: qo,
1978
- onPatchTextAlign: Go,
1979
- onPatchColor: Xo,
1980
- onFontSizeSearch: Zo,
1981
- onFontSizeCommit: Qo,
1982
- onFontSizeDropdownChange: es,
1983
- onFontSizeKeydown: $o,
1984
- onMore: ys
1964
+ ref: Xn,
1965
+ x: z.value.x,
1966
+ y: z.value.y,
1967
+ "editor-state": J.value,
1968
+ "font-size-preset-options": Ci.value,
1969
+ "current-editor-font-size": bi.value,
1970
+ "editor-font-size-search-value": Rn.value,
1971
+ "current-editor-text-color": xi.value,
1972
+ "text-align-options": b(Jr),
1973
+ onCommand: Q,
1974
+ onPatchFontSize: Ko,
1975
+ onPatchTextAlign: Wo,
1976
+ onPatchColor: Yo,
1977
+ onFontSizeSearch: Xo,
1978
+ onFontSizeCommit: Zo,
1979
+ onFontSizeDropdownChange: $o,
1980
+ onFontSizeKeydown: Qo,
1981
+ onMore: vs
1985
1982
  }, null, 8, [
1986
1983
  "x",
1987
1984
  "y",
@@ -2001,18 +1998,18 @@ var Vt = {
2001
1998
  accept: "image/png,image/jpeg,image/webp,image/gif,image/bmp",
2002
1999
  tabindex: "-1",
2003
2000
  "aria-hidden": "true",
2004
- onChange: _a
2001
+ onChange: ha
2005
2002
  }, null, 544),
2006
- m("span", Wt, kt(V.value), 1),
2003
+ m("span", Wt, kt(H.value), 1),
2007
2004
  h(Ke, {
2008
2005
  open: wn.value,
2009
2006
  "onUpdate:open": t[26] ||= (e) => wn.value = e,
2010
- "preview-pages": Fr.value,
2011
- "preview-file-groups": Ir.value,
2012
- "preview-active-group": Lr.value,
2007
+ "preview-pages": Nr.value,
2008
+ "preview-file-groups": Pr.value,
2009
+ "preview-active-group": Fr.value,
2013
2010
  "preview-snapshot": Tn.value,
2014
2011
  "font-base-url": s.contractFontBaseUrl,
2015
- onCancel: co,
2012
+ onCancel: so,
2016
2013
  onSelectFile: t[27] ||= (e) => Dn.value = e
2017
2014
  }, null, 8, [
2018
2015
  "open",
@@ -2026,24 +2023,24 @@ var Vt = {
2026
2023
  open: On.value,
2027
2024
  "onUpdate:open": t[28] ||= (e) => On.value = e,
2028
2025
  json: kn.value,
2029
- onCancel: fo
2026
+ onCancel: uo
2030
2027
  }, null, 8, ["open", "json"]),
2031
2028
  h(Je, {
2032
2029
  open: An.value,
2033
2030
  "onUpdate:open": t[29] ||= (e) => An.value = e,
2034
2031
  data: jn.value,
2035
- "file-name": Pr.value?.name,
2036
- onCancel: ho
2032
+ "file-name": Mr.value?.name,
2033
+ onCancel: mo
2037
2034
  }, null, 8, [
2038
2035
  "open",
2039
2036
  "data",
2040
2037
  "file-name"
2041
2038
  ]),
2042
2039
  h(Ye, {
2043
- open: Wn.value,
2044
- "onUpdate:open": t[30] ||= (e) => Wn.value = e,
2045
- disabled: U.value,
2046
- onInsert: Ui
2040
+ open: Un.value,
2041
+ "onUpdate:open": t[30] ||= (e) => Un.value = e,
2042
+ disabled: W.value,
2043
+ onInsert: Vi
2047
2044
  }, null, 8, ["open", "disabled"])
2048
2045
  ], 38));
2049
2046
  }