@guodun/antdv 1.7.12 → 1.7.13

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