@guodun/antdv 1.7.7 → 1.7.8

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