@guodun/antdv 1.7.6 → 1.7.7

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