@guodun/antdv 1.4.8 → 1.5.1

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