@guodun/antdv 1.7.7 → 1.7.9

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