@guodun/antdv 1.3.2 → 1.4.0

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 (109) hide show
  1. package/dist/es/components/contract-signing-location/index.mjs +1 -0
  2. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +304 -289
  3. package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +337 -326
  4. package/dist/es/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.mjs +41 -33
  5. package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.mjs +5 -0
  6. package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +23 -0
  7. package/dist/es/components/contract-signing-location/src/location-rules.mjs +115 -77
  8. package/dist/es/components/contract-signing-location/src/template-source.mjs +85 -0
  9. package/dist/es/components/contract-signing-location/style/index.css +1 -1
  10. package/dist/es/components/index.mjs +8 -6
  11. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.mjs +164 -57
  12. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.mjs +128 -125
  13. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.mjs +75 -49
  14. package/dist/es/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.mjs +135 -91
  15. package/dist/es/components/pro-contract-signing-flow/src/constants.mjs +25 -5
  16. package/dist/es/components/pro-contract-signing-flow/style/index.css +1 -1
  17. package/dist/es/components/pro-contract-template-designer/index.mjs +5 -4
  18. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.mjs +5 -0
  19. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +347 -0
  20. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.mjs +5 -0
  21. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +171 -0
  22. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFileBar.mjs +5 -0
  23. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.mjs +166 -0
  24. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +4 -4
  25. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.mjs +5 -0
  26. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.mjs +36 -0
  27. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +202 -202
  28. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1591 -1612
  29. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +235 -239
  30. package/dist/es/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.mjs +16 -16
  31. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +166 -166
  32. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-draft-cache.mjs +100 -33
  33. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +77 -0
  34. package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +23 -23
  35. package/dist/es/components/pro-contract-template-designer/src/utils/file-tabs.mjs +14 -0
  36. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +121 -121
  37. package/dist/es/components/pro-contract-template-designer/src/utils/toolbar-overflow.mjs +19 -0
  38. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  39. package/dist/es/index.mjs +23 -21
  40. package/dist/lib/components/contract-signing-location/index.cjs +1 -1
  41. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  42. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
  43. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.cjs +1 -1
  44. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.cjs +1 -0
  45. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -0
  46. package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
  47. package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -0
  48. package/dist/lib/components/contract-signing-location/style/index.css +1 -1
  49. package/dist/lib/components/index.cjs +1 -1
  50. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.cjs +1 -1
  51. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.cjs +1 -1
  52. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.cjs +1 -1
  53. package/dist/lib/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.cjs +1 -1
  54. package/dist/lib/components/pro-contract-signing-flow/src/constants.cjs +1 -1
  55. package/dist/lib/components/pro-contract-signing-flow/style/index.css +1 -1
  56. package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
  57. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.cjs +1 -0
  58. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -0
  59. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.cjs +1 -0
  60. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -0
  61. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFileBar.cjs +1 -0
  62. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.cjs +1 -0
  63. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
  64. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.cjs +1 -0
  65. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.cjs +1 -0
  66. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  67. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  68. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
  69. package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.cjs +1 -1
  70. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +2 -2
  71. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-draft-cache.cjs +1 -1
  72. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-files.cjs +2 -0
  73. package/dist/lib/components/pro-contract-template-designer/src/extensions/word-paste.cjs +1 -1
  74. package/dist/lib/components/pro-contract-template-designer/src/utils/file-tabs.cjs +1 -0
  75. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +2 -2
  76. package/dist/lib/components/pro-contract-template-designer/src/utils/toolbar-overflow.cjs +1 -0
  77. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  78. package/dist/lib/index.cjs +1 -1
  79. package/dist/theme/contract-signing-location.css +1 -1
  80. package/dist/theme/icon.css +1 -1
  81. package/dist/theme/index.css +1 -1
  82. package/dist/theme/pro-contract-signing-flow.css +1 -1
  83. package/dist/types/components/contract-signing-location/index.d.ts +1 -0
  84. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -1
  85. package/dist/types/components/contract-signing-location/src/ContractSigningLocationInspector.vue.d.ts +2 -2
  86. package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +6 -0
  87. package/dist/types/components/contract-signing-location/src/location-rules.d.ts +3 -3
  88. package/dist/types/components/contract-signing-location/src/template-source.d.ts +20 -0
  89. package/dist/types/components/contract-signing-location/src/types.d.ts +47 -2
  90. package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.d.ts +19 -3
  91. package/dist/types/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.d.ts +223 -2
  92. package/dist/types/components/pro-contract-signing-flow/src/constants.d.ts +15 -0
  93. package/dist/types/components/pro-contract-signing-flow/src/types.d.ts +12 -0
  94. package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
  95. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +103 -0
  96. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +48 -0
  97. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.d.ts +231 -0
  98. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.d.ts +15 -0
  99. package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +1 -1
  100. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +25 -2
  101. package/dist/types/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.d.ts +2 -2
  102. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +1 -1
  103. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-draft-cache.d.ts +29 -1
  104. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +24 -0
  105. package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +2 -2
  106. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +59 -1
  107. package/dist/types/components/pro-contract-template-designer/src/utils/file-tabs.d.ts +3 -0
  108. package/dist/types/components/pro-contract-template-designer/src/utils/toolbar-overflow.d.ts +11 -0
  109. package/package.json +2 -1
@@ -1,130 +1,104 @@
1
- import { useFitWidthZoom as e } from "./composables/use-fit-width-zoom.mjs";
2
- import { CONTRACT_TEXT_STYLE_PRESETS as t, DEFAULT_CONTRACT_FONT_FAMILY as n, DEFAULT_FONT_SIZE_PRESETS as r, DEFAULT_TEXT_ALIGN_OPTIONS as i, resolveFontFamilyOptions as a } from "./constants.mjs";
3
- import { isSafeContractImageUrl as o } from "./utils/image-url.mjs";
4
- import { MAX_CONTRACT_IMAGE_DIMENSION as s, normalizeContractImageDimension as ee, processContractImageFile as te } from "./utils/content-image.mjs";
5
- import { inferContextVariableLabel as ne, resolveContextVariableWidth as re } from "./utils/context-variable.mjs";
6
- import { isContractTemplateFieldType as ie } from "./types.mjs";
7
- import { ContractTemplateLocationRuleBuildError as ae, SIGNING_PLACEMENT_MIME as oe, SIGNING_PLACEMENT_TYPE_LABELS as se, applySigningPlacementPatch as ce, buildContractLocationRules as le, buildSigningPlacementLocationRules as ue, canMutateSigningPlacements as de, clampSigningPlacement as fe, createSigningPlacement as pe, getSigningPlacementDefaultSize as me, resolveSigningPlacementToolItems as he, scaleSigningPlacementToPage as ge, serializeSigningPlacementDragPayload as _e } from "./utils/signing-placement.mjs";
8
- import { DEFAULT_FIELD_STYLE as ve, DEFAULT_FIELD_TYPES as ye, DEFAULT_PAGE_SIZE as be, buildTemplatePreviewPages as xe, cloneTemplateValue as c, collectTemplateLocationRuleExportErrors as Se, constrainTemplatePageSizes as Ce, createBlankPage as we, createBlankTemplate as Te, createDefaultPage as Ee, createTemplateVariable as De, exportTemplateValue as Oe, getFieldOption as ke, getPageSizeKey as Ae, normalizeContractTemplateMaxPages as je, normalizePageSizeOptions as Me, normalizeTemplateValue as Ne, resolvePageSize as Pe, syncTemplateVariablesWithPages as Fe, validateTemplateValue as Ie } from "./composables/use-template-designer.mjs";
1
+ import { isContractTemplateFieldType as e } from "./types.mjs";
2
+ import { ContractTemplateLocationRuleBuildError as t, SIGNING_PLACEMENT_MIME as n, SIGNING_PLACEMENT_TYPE_LABELS as r, applySigningPlacementPatch as i, buildContractLocationRules as a, buildSigningPlacementLocationRules as o, canMutateSigningPlacements as s, clampSigningPlacement as ee, createSigningPlacement as te, getSigningPlacementDefaultSize as ne, resolveSigningPlacementToolItems as re, scaleSigningPlacementToPage as ie, serializeSigningPlacementDragPayload as ae } from "./utils/signing-placement.mjs";
3
+ import { CONTRACT_TEXT_STYLE_PRESETS as oe, DEFAULT_CONTRACT_FONT_FAMILY as se, DEFAULT_FONT_SIZE_PRESETS as ce, DEFAULT_TEXT_ALIGN_OPTIONS as le, resolveFontFamilyOptions as ue } from "./constants.mjs";
4
+ import { DEFAULT_FIELD_STYLE as de, DEFAULT_FIELD_TYPES as fe, DEFAULT_PAGE_SIZE as pe, buildTemplatePreviewPages as me, cloneTemplateValue as c, collectTemplateLocationRuleExportErrors as he, constrainTemplatePageSizes as ge, createBlankPage as _e, createBlankTemplate as ve, createDefaultPage as ye, createTemplateVariable as be, exportTemplateValue as xe, getFieldOption as Se, getPageSizeKey as Ce, normalizeContractTemplateMaxPages as we, normalizePageSizeOptions as Te, normalizeTemplateValue as Ee, resolvePageSize as De, syncTemplateVariablesWithPages as Oe, validateTemplateValue as ke } from "./composables/use-template-designer.mjs";
5
+ import { isSafeContractImageUrl as Ae } from "./utils/image-url.mjs";
6
+ import { useFitWidthZoom as je } from "./composables/use-fit-width-zoom.mjs";
7
+ import { MAX_CONTRACT_IMAGE_DIMENSION as Me, normalizeContractImageDimension as Ne, processContractImageFile as Pe } from "./utils/content-image.mjs";
8
+ import { inferContextVariableLabel as Fe, resolveContextVariableWidth as Ie } from "./utils/context-variable.mjs";
9
9
  import Le from "./DesignerPage.mjs";
10
10
  import Re from "./ContractTemplatePreviewPage.mjs";
11
11
  import ze from "./TableContextMenu.mjs";
12
12
  import Be from "./TableSizePicker.mjs";
13
- import { DEFAULT_DRAFT_CACHE_INTERVAL as Ve, DEFAULT_DRAFT_CACHE_KEY as He, DEFAULT_DRAFT_CACHE_MAX_BYTES as l, clearTemplateDraftCache as Ue, createDraftCacheStatus as We, formatDraftCacheSavedAt as Ge, getBrowserDraftCacheStorage as Ke, isBlankTemplateDraftValue as qe, loadTemplateDraftCache as Je, saveTemplateDraftCache as Ye } from "./composables/use-template-draft-cache.mjs";
14
- import Xe from "./SigningPlacementInspector.mjs";
15
- import { resolveFieldTypeIcon as Ze, resolveSigningPlacementTypeIcon as Qe } from "./utils/template-tool-icons.mjs";
16
- import { Fragment as u, Teleport as $e, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, nextTick as y, normalizeClass as b, normalizeStyle as et, onBeforeUnmount as tt, onMounted as nt, openBlock as x, ref as S, renderList as C, resolveDynamicComponent as rt, toDisplayString as w, unref as T, vShow as it, watch as at, withCtx as E, withDirectives as ot, withModifiers as st } from "vue";
17
- import { Alert as ct, Button as D, Empty as lt, Input as ut, InputNumber as dt, Modal as ft, Popover as pt, Select as O, Switch as mt, Tag as ht, Tooltip as k } from "ant-design-vue";
18
- import { useElementSize as gt } from "@vueuse/core";
19
- import { AlignCenterOutlined as _t, AlignLeftOutlined as vt, AlignRightOutlined as yt, AuditOutlined as bt, BoldOutlined as xt, ClearOutlined as St, ColumnWidthOutlined as Ct, CopyOutlined as wt, DatabaseOutlined as Tt, DeleteOutlined as Et, DownOutlined as Dt, EllipsisOutlined as Ot, EyeOutlined as kt, FileAddOutlined as At, FormatPainterOutlined as jt, FullscreenExitOutlined as Mt, FullscreenOutlined as Nt, ItalicOutlined as Pt, LeftOutlined as Ft, MinusOutlined as It, OrderedListOutlined as Lt, PictureOutlined as Rt, PlusOutlined as zt, RedoOutlined as Bt, ReloadOutlined as Vt, RightOutlined as Ht, ScissorOutlined as Ut, TableOutlined as Wt, UnderlineOutlined as Gt, UndoOutlined as Kt, UnorderedListOutlined as qt, ZoomInOutlined as Jt, ZoomOutOutlined as Yt } from "@ant-design/icons-vue";
13
+ import { DEFAULT_DRAFT_CACHE_INTERVAL as Ve, DEFAULT_DRAFT_CACHE_KEY as He, DEFAULT_DRAFT_CACHE_MAX_BYTES as l, clearTemplateDraftCache as Ue, createDraftCacheStatus as We, formatDraftCacheSavedAt as Ge, getBrowserDraftCacheStorage as Ke, isBlankTemplateDraftValue as qe, isBlankTemplateFilesDraftValue as Je, loadTemplateDraftCache as Ye, loadTemplateFilesDraftCache as Xe, saveTemplateDraftCache as Ze, saveTemplateFilesDraftCache as Qe } from "./composables/use-template-draft-cache.mjs";
14
+ import { cloneContractTemplateFiles as u, createContractTemplateFile as $e, exportContractTemplateFiles as et, moveContractTemplateFile as tt, normalizeContractTemplateFiles as nt, removeContractTemplateFile as rt, renameContractTemplateFile as it, replaceContractTemplateFile as at, resolveContractTemplateActiveFileId as ot } from "./composables/use-template-files.mjs";
15
+ import { resolveFieldTypeIcon as st, resolveSigningPlacementTypeIcon as ct } from "./utils/template-tool-icons.mjs";
16
+ import lt from "./ContractTemplateFileBar.mjs";
17
+ import ut from "./ContractTemplateDesignerSidebar.mjs";
18
+ import dt from "./ContractTemplateDesignerInspector.mjs";
19
+ import { CONTRACT_TEMPLATE_TOOLBAR_OVERFLOW_PRIORITY as ft, resolveContractTemplateToolbarOverflowKeys as pt } from "./utils/toolbar-overflow.mjs";
20
+ import { Fragment as mt, Teleport as ht, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, nextTick as y, normalizeClass as b, normalizeStyle as gt, onBeforeUnmount as _t, onMounted as vt, openBlock as x, ref as S, renderList as yt, resolveDynamicComponent as bt, toDisplayString as C, unref as w, vShow as xt, watch as St, withCtx as T, withDirectives as Ct, withModifiers as wt } from "vue";
21
+ import { Alert as Tt, Button as E, Input as Et, InputNumber as Dt, Modal as Ot, Popover as kt, Select as At, Switch as jt, Tooltip as D } from "ant-design-vue";
22
+ import { useElementSize as Mt } from "@vueuse/core";
23
+ import { AlignCenterOutlined as Nt, AlignLeftOutlined as Pt, AlignRightOutlined as Ft, AuditOutlined as It, BoldOutlined as Lt, ClearOutlined as Rt, ColumnWidthOutlined as zt, CopyOutlined as Bt, DatabaseOutlined as Vt, DeleteOutlined as Ht, DownOutlined as Ut, EllipsisOutlined as Wt, EyeOutlined as Gt, FileAddOutlined as Kt, FormatPainterOutlined as qt, FullscreenExitOutlined as Jt, FullscreenOutlined as Yt, ItalicOutlined as Xt, MinusOutlined as Zt, OrderedListOutlined as Qt, PictureOutlined as $t, PlusOutlined as en, RedoOutlined as tn, ReloadOutlined as nn, ScissorOutlined as rn, TableOutlined as an, UnderlineOutlined as on, UndoOutlined as sn, UnorderedListOutlined as cn, ZoomInOutlined as ln, ZoomOutOutlined as un } from "@ant-design/icons-vue";
20
24
  //#region src/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue?vue&type=script&setup=true&lang.ts
21
- var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-designer__panel-stack" }, Qt = { class: "gd-contract-template-designer__panel gd-contract-template-designer__panel--navigation" }, $t = { class: "gd-contract-template-designer__panel-head" }, en = { class: "gd-contract-template-designer__panel-actions" }, tn = ["onClick"], nn = { class: "gd-contract-template-designer__page-nav-actions" }, rn = {
22
- key: 0,
23
- class: "gd-contract-template-designer__page-config"
24
- }, an = {
25
- key: 0,
26
- class: "gd-contract-template-designer__form-row"
27
- }, on = { class: "gd-contract-template-designer__page-size-note" }, sn = { class: "gd-contract-template-designer__panel gd-contract-template-designer__panel--navigation" }, cn = { class: "gd-contract-template-designer__panel-head" }, ln = ["onClick"], un = {
28
- key: 0,
29
- class: "gd-contract-template-designer__panel gd-contract-template-designer__panel--navigation"
30
- }, dn = { class: "gd-contract-template-designer__panel-head" }, fn = ["onClick"], pn = { class: "gd-contract-template-designer__workspace-header" }, mn = { class: "gd-contract-template-designer__workspace-meta" }, hn = { class: "gd-contract-template-designer__workspace-actions" }, gn = { class: "gd-contract-template-designer__workspace-controls" }, _n = { class: "gd-contract-template-designer__zoom" }, vn = { class: "gd-contract-template-designer__workspace-buttons" }, yn = { class: "gd-contract-template-designer__toolbar" }, bn = { class: "gd-contract-template-designer__toolbar-group" }, xn = { class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--style" }, Sn = { class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--format" }, Cn = { class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--insert" }, wn = { class: "gd-contract-template-designer__popover gd-contract-template-designer__control-insert-popover" }, Tn = { class: "gd-contract-template-designer__text-menu-control-options" }, En = ["aria-label", "onClick"], Dn = { class: "gd-contract-template-designer__popover gd-contract-template-designer__image-insert-popover" }, On = {
25
+ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { class: "gd-contract-template-designer__workspace-meta" }, pn = { class: "gd-contract-template-designer__workspace-actions" }, mn = { class: "gd-contract-template-designer__workspace-controls" }, hn = { class: "gd-contract-template-designer__zoom" }, gn = { class: "gd-contract-template-designer__workspace-buttons" }, _n = { class: "gd-contract-template-designer__toolbar" }, vn = { class: "gd-contract-template-designer__toolbar-group" }, yn = { class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--style" }, bn = { class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--format" }, xn = {
26
+ class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--insert",
27
+ "data-toolbar-overflow-key": "insert"
28
+ }, Sn = { class: "gd-contract-template-designer__popover gd-contract-template-designer__control-insert-popover" }, Cn = { class: "gd-contract-template-designer__text-menu-control-options" }, wn = ["aria-label", "onClick"], Tn = { class: "gd-contract-template-designer__popover gd-contract-template-designer__image-insert-popover" }, En = {
31
29
  class: "gd-contract-template-designer__image-size-fields",
32
30
  role: "group",
33
31
  "aria-label": "图片尺寸"
34
- }, kn = {
32
+ }, Dn = {
35
33
  class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--typography",
36
34
  "data-toolbar-overflow-key": "typography"
37
- }, An = ["value", "disabled"], jn = {
35
+ }, On = ["value", "disabled"], kn = {
38
36
  class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--cleanup",
39
37
  "data-toolbar-overflow-key": "cleanup"
40
- }, Mn = {
38
+ }, An = {
41
39
  class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--table",
42
40
  "data-toolbar-overflow-key": "table"
43
- }, Nn = { class: "gd-contract-template-designer__popover" }, Pn = { class: "gd-contract-template-designer__switch-row" }, Fn = { class: "gd-contract-template-designer__popover" }, In = { class: "gd-contract-template-designer__table-actions" }, Ln = {
41
+ }, jn = { class: "gd-contract-template-designer__popover" }, Mn = { class: "gd-contract-template-designer__switch-row" }, Nn = { class: "gd-contract-template-designer__popover" }, Pn = { class: "gd-contract-template-designer__table-actions" }, Fn = {
44
42
  class: "gd-contract-template-designer__toolbar-more-panel",
45
43
  role: "menu",
46
44
  "aria-label": "更多编辑工具"
47
- }, Rn = { class: "gd-contract-template-designer__toolbar-more-section" }, zn = { class: "gd-contract-template-designer__toolbar-more-section" }, Bn = { class: "gd-contract-template-designer__toolbar-more-section" }, Vn = {
45
+ }, In = { class: "gd-contract-template-designer__toolbar-more-section" }, Ln = { class: "gd-contract-template-designer__toolbar-more-section" }, Rn = { class: "gd-contract-template-designer__toolbar-more-section" }, zn = { class: "gd-contract-template-designer__toolbar-more-section" }, Bn = {
48
46
  key: 0,
49
47
  class: "gd-contract-template-designer__validation"
50
- }, Hn = {
48
+ }, Vn = {
51
49
  key: 0,
52
50
  class: "gd-contract-template-designer__validation-list"
53
- }, Un = ["onClick"], Wn = ["aria-label", "aria-expanded"], Gn = { class: "gd-contract-template-designer__panel-stack" }, Kn = { class: "gd-contract-template-designer__panel gd-contract-template-designer__panel--tools" }, qn = [
54
- "disabled",
55
- "onDragstart",
56
- "onClick"
57
- ], Jn = {
58
- class: "gd-contract-template-designer__tool-item-icon",
59
- "aria-hidden": "true"
60
- }, Yn = { class: "gd-contract-template-designer__tool-item-copy" }, Xn = {
61
- key: 0,
62
- class: "gd-contract-template-designer__panel gd-contract-template-designer__panel--tools"
63
- }, Zn = { class: "gd-contract-template-designer__panel-head" }, Qn = { class: "gd-contract-template-designer__panel-actions" }, $n = [
64
- "disabled",
65
- "onDragstart",
66
- "onClick"
67
- ], er = {
68
- class: "gd-contract-template-designer__tool-item-icon",
69
- "aria-hidden": "true"
70
- }, tr = { class: "gd-contract-template-designer__signing-tool-copy" }, nr = { class: "gd-contract-template-designer__signing-tool-label" }, rr = {
71
- key: 2,
72
- class: "gd-contract-template-designer__panel gd-contract-template-designer__panel--properties"
73
- }, ir = { class: "gd-contract-template-designer__panel-head" }, ar = {
74
- key: 0,
75
- class: "gd-contract-template-designer__panel-actions"
76
- }, or = { class: "gd-contract-template-designer__form-row" }, sr = { class: "gd-contract-template-designer__form-row" }, cr = { class: "gd-contract-template-designer__form-row" }, lr = { class: "gd-contract-template-designer__form-row" }, ur = { class: "gd-contract-template-designer__form-row" }, dr = { class: "gd-contract-template-designer__form-row" }, fr = {
77
- key: 0,
78
- class: "gd-contract-template-designer__switch-grid"
79
- }, pr = { class: "gd-contract-template-designer__switch-row" }, mr = {
80
- key: 0,
81
- class: "gd-contract-template-designer__form-row is-compact"
82
- }, hr = {
83
- key: 1,
84
- class: "gd-contract-template-designer__form-row"
85
- }, gr = { class: "gd-contract-template-designer__form-row" }, _r = { class: "gd-contract-template-designer__form-row" }, vr = { class: "gd-contract-template-designer__form-row" }, yr = { class: "gd-contract-template-designer__form-row" }, br = { class: "gd-contract-template-designer__switch-grid" }, xr = { class: "gd-contract-template-designer__switch-row" }, Sr = { class: "gd-contract-template-designer__switch-row" }, Cr = { class: "gd-contract-template-designer__switch-row" }, wr = {
86
- key: 0,
87
- class: "gd-contract-template-designer__switch-row"
88
- }, Tr = { class: "gd-contract-template-designer__form-row" }, Er = { class: "gd-contract-template-designer__form-row" }, Dr = { class: "gd-contract-template-designer__form-row" }, Or = ["value", "disabled"], kr = { class: "gd-contract-template-designer__form-row" }, Ar = ["value", "disabled"], jr = { class: "gd-contract-template-designer__form-row" }, Mr = ["value", "disabled"], Nr = { class: "gd-contract-template-designer__form-row" }, Pr = { class: "gd-contract-template-designer__form-row" }, Fr = { class: "gd-contract-template-designer__form-row" }, Ir = {
51
+ }, Hn = ["onClick"], Un = {
89
52
  class: "gd-contract-template-designer__image-size-fields",
90
53
  role: "group",
91
54
  "aria-label": "图片尺寸"
92
- }, Lr = { class: "gd-contract-template-designer__popover-actions" }, Rr = {
55
+ }, Wn = { class: "gd-contract-template-designer__popover-actions" }, Gn = {
93
56
  class: "gd-contract-template-designer__text-menu-row",
94
57
  role: "group",
95
58
  "aria-label": "编辑历史与剪贴板"
96
- }, zr = {
59
+ }, Kn = {
97
60
  key: 0,
98
61
  class: "gd-contract-template-designer__text-menu-quick-insert",
99
62
  role: "group",
100
63
  "aria-label": "光标处插入"
101
- }, Br = {
64
+ }, qn = {
102
65
  class: "gd-contract-template-designer__text-menu-row gd-contract-template-designer__text-menu-row--controls",
103
66
  role: "group",
104
67
  "aria-label": "文字样式"
105
- }, Vr = ["value"], Hr = ["aria-label"], Ur = { class: "gd-contract-template-designer__text-menu-control-head" }, Wr = { class: "gd-contract-template-designer__text-menu-control-options" }, Gr = ["aria-label", "onClick"], Kr = ["disabled"], qr = {
68
+ }, Jn = ["value"], Yn = ["aria-label"], Xn = { class: "gd-contract-template-designer__text-menu-control-head" }, Zn = { class: "gd-contract-template-designer__text-menu-control-options" }, Qn = ["aria-label", "onClick"], $n = ["disabled"], er = {
106
69
  class: "gd-contract-template-designer__text-menu-bind-list",
107
70
  role: "listbox",
108
71
  "aria-label": "已有正文控件"
109
- }, Jr = ["onClick"], Yr = { class: "gd-contract-template-designer__text-menu-bind-item-label" }, Xr = { class: "gd-contract-template-designer__text-menu-bind-item-meta" }, Zr = {
72
+ }, tr = ["onClick"], nr = { class: "gd-contract-template-designer__text-menu-bind-item-label" }, rr = { class: "gd-contract-template-designer__text-menu-bind-item-meta" }, ir = {
110
73
  key: 0,
111
74
  class: "gd-contract-template-designer__text-menu-bind-empty"
112
- }, Qr = {
75
+ }, ar = {
113
76
  class: "gd-contract-template-designer__text-menu-row",
114
77
  role: "group",
115
78
  "aria-label": "常用格式与列表"
116
- }, $r = {
79
+ }, or = {
117
80
  class: "gd-contract-template-designer__text-menu-row gd-contract-template-designer__text-menu-row--cleanup",
118
81
  role: "group",
119
82
  "aria-label": "清理格式"
120
- }, ei = {
83
+ }, sr = {
121
84
  class: "gd-contract-template-designer__sr-status",
122
85
  "aria-live": "polite"
123
- }, ti = { class: "gd-contract-template-designer__preview" }, ni = { class: "gd-contract-template-designer__submit-data" }, ri = .5, ii = 1.5, ai = .1, oi = 128, si = 108, ci = 48, li = 24, ui = 10, di = 48, fi = 304, pi = 300, mi = 288, hi = 196, A = 12, gi = 43, _i = 6, vi = 4, yi = /* @__PURE__ */ v({
86
+ }, cr = {
87
+ key: 0,
88
+ class: "gd-contract-template-designer__preview-layout"
89
+ }, lr = {
90
+ class: "gd-contract-template-designer__preview-file-nav",
91
+ "aria-label": "合同文件预览切换"
92
+ }, ur = ["aria-current", "onClick"], dr = {
93
+ key: 0,
94
+ class: "gd-contract-template-designer__preview-file"
95
+ }, fr = { class: "gd-contract-template-designer__preview-file-title" }, pr = { class: "gd-contract-template-designer__submit-data" }, mr = .5, hr = 1.5, gr = .1, _r = 128, vr = 108, yr = 48, br = 24, xr = 10, Sr = 48, Cr = 304, wr = 300, Tr = 288, Er = 196, O = 12, Dr = 43, Or = 6, kr = 4, Ar = /* @__PURE__ */ v({
124
96
  name: "ProContractTemplateDesigner",
125
97
  __name: "ProContractTemplateDesigner",
126
98
  props: {
127
99
  modelValue: { default: void 0 },
100
+ files: {},
101
+ activeFileId: {},
128
102
  readonly: {
129
103
  type: Boolean,
130
104
  default: !1
@@ -134,13 +108,13 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
134
108
  default: !1
135
109
  },
136
110
  height: { default: 760 },
137
- pageSize: { default: () => be },
111
+ pageSize: { default: () => pe },
138
112
  pageSizeOptions: {},
139
- maxPages: { default: 50 },
113
+ maxPages: { default: 20 },
140
114
  imageCompression: { type: [Object, Boolean] },
141
115
  imageUpload: {},
142
- variableTypes: { default: () => ye },
143
- defaultVariableStyle: { default: () => ve },
116
+ variableTypes: { default: () => fe },
117
+ defaultVariableStyle: { default: () => de },
144
118
  fontFamilies: { default: void 0 },
145
119
  fontFamilyMode: { default: "append" },
146
120
  showSubmitDataViewer: {
@@ -170,6 +144,13 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
170
144
  emits: [
171
145
  "update:modelValue",
172
146
  "change",
147
+ "update:files",
148
+ "update:activeFileId",
149
+ "files-change",
150
+ "file-add",
151
+ "file-change",
152
+ "file-remove",
153
+ "file-move",
173
154
  "variable-add",
174
155
  "validate",
175
156
  "draft-cache-change",
@@ -180,35 +161,62 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
180
161
  "signing-placement-remove",
181
162
  "signing-placement-select"
182
163
  ],
183
- setup(ye, { expose: Ve, emit: He }) {
184
- let l = ye, v = He, yi = d(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), bi = S(), xi = S(), Si = S(), Ci = S(), wi = S(), Ti = S(), Ei = S(), Di = S(), Oi = S();
185
- function ki(e) {
164
+ setup(fe, { expose: Ve, emit: He }) {
165
+ let l = fe, v = He, Ar = d(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), jr = S(), Mr = S(), Nr = S(), Pr = S(), Fr = S(), Ir = S(), Lr = S(), Rr = S(), zr = S(), Br = S();
166
+ function Vr(e) {
186
167
  if (!e || !Array.isArray(e.pages) || !Array.isArray(e.signingPlacements)) return [];
187
168
  try {
188
- return Ie(e).filter((e) => e.type === "signing-placement");
169
+ return ke(e).filter((e) => e.type === "signing-placement");
189
170
  } catch {
190
171
  return [];
191
172
  }
192
173
  }
193
- let Ai = S(ki(l.modelValue)), ji = Ne(l.modelValue, l.pageSize), Mi = Ce(ji, l.pageSizeOptions), j = S(Mi.value);
194
- l.modelValue && JSON.stringify(Mi.value) !== JSON.stringify(ji) && (v("update:modelValue", c(Mi.value)), v("change", c(Mi.value)), yo(Mi.resizedSigningPlacementIds, Mi.value));
195
- let M = S(""), N = S(""), P = S(j.value.pages[0]?.id ?? ""), Ni = S(!1), Pi = S([]), F = /* @__PURE__ */ new Map(), Fi = S(!1), Ii = S(""), Li = S(!1), Ri = S(), zi = S(!1), Bi = S(""), Vi = S(1), Hi = S(!1), Ui = S(!1), Wi = S(!1), Gi = S(!1), Ki = S({}), qi = S(), Ji = S(""), I = S(!1), Yi = S(!1), Xi = S(!1), Zi = S(!1), Qi = S(""), $i = S(), ea = S(), ta = S(""), na = S(!1), L = S(), ra = S(), ia = S(!1), aa = S(""), R = S(), oa = S(), z = S(), sa = S(), ca = S(), la = S(), ua = S(""), da = S(We("idle", "暂无本地草稿")), fa = S({
174
+ function Hr(e, t) {
175
+ return Object.fromEntries(e.map((e, n) => [e.id, Vr(t?.[n]?.template ?? e.template)]));
176
+ }
177
+ function Ur(e, t) {
178
+ let n = /* @__PURE__ */ new Map();
179
+ return {
180
+ files: e.map((e) => {
181
+ let r = ge(e.template, t);
182
+ return r.resizedSigningPlacementIds.length && n.set(e.id, r.resizedSigningPlacementIds), {
183
+ ...e,
184
+ template: r.value
185
+ };
186
+ }),
187
+ resizedSigningPlacementIds: n
188
+ };
189
+ }
190
+ let Wr = "", Gr = "", Kr = S(!1), k = d(() => Kr.value || Array.isArray(l.files)), qr = nt(l.files, l.modelValue, l.pageSize), Jr = Ur(qr, l.pageSizeOptions), Yr = k.value ? Jr.files : qr, Xr = ot(Yr, l.activeFileId), A = S(Yr), j = S(Xr), Zr = Yr.find((e) => e.id === Xr) ?? Yr[0], M = S(Hr(Yr, Array.isArray(l.files) ? l.files : l.modelValue ? [{ template: l.modelValue }] : void 0)), N = S(M.value[Xr] ?? Vr(Zr?.template)), Qr = Ee(Zr?.template ?? l.modelValue, l.pageSize), $r = ge(Qr, l.pageSizeOptions), P = S($r.value);
191
+ if (k.value) {
192
+ if (A.value = at(A.value, j.value, $r.value), JSON.stringify(A.value) !== JSON.stringify(qr)) {
193
+ let e = u(A.value);
194
+ Wr = JSON.stringify(e), v("update:files", e), v("files-change", u(e));
195
+ }
196
+ } else l.modelValue && JSON.stringify($r.value) !== JSON.stringify(Qr) && (Gr = JSON.stringify($r.value), v("update:modelValue", c($r.value)), v("change", c($r.value)), Xa($r.resizedSigningPlacementIds, $r.value));
197
+ let F = S(""), I = S(""), L = S(P.value.pages[0]?.id ?? ""), ei = S(!1), ti = S([]), R = /* @__PURE__ */ new Map(), ni = S(!1), ri = S(""), ii = S(!1), ai = S(), oi = S(), si = S(""), ci = S(!1), li = S(""), ui = S(1), di = S(!1), fi = S(!1), pi = S(!1), mi = S(!1), hi = S({}), gi = S(), _i = S(""), vi = S(!1), yi = S(!1), bi = S(!1), xi = S(!1), Si = S(""), Ci = S(), wi = S(), Ti = S(""), Ei = S(!1), z = S(), Di = S(), Oi = S(!1), ki = S(""), B = S(), Ai = S(), V = S(), ji = S(), Mi = S(), Ni = S(), Pi = S(""), Fi = S(We("idle", "暂无本地草稿")), Ii = S({
196
198
  rows: 3,
197
199
  cols: 3,
198
200
  withHeaderRow: !0
199
- }), pa, ma, ha = "", B = d(() => l.readonly || l.disabled), ga = d(() => !!l.enableDraftCache && !B.value), V = d(() => j.value.variables.find((e) => e.key === M.value)), H = d(() => j.value.signingPlacements ?? []), _a = d(() => Ri.value ? xe(Ri.value) : []), va = d(() => H.value.find((e) => e.id === N.value)), ya = d(() => H.value.map((e) => {
200
- let t = j.value.pages.findIndex((t) => t.id === e.pageId);
201
+ }), Li, Ri, zi = "", H = d(() => l.readonly || l.disabled), Bi = d(() => !!l.enableDraftCache && !H.value), Vi = d(() => A.value.find((e) => e.id === j.value) ?? A.value[0]), Hi = d(() => l.draftCacheKey), Ui = d(() => P.value.variables.find((e) => e.key === F.value)), U = d(() => P.value.signingPlacements ?? []), Wi = d(() => ai.value ? me(ai.value) : []), Gi = d(() => (oi.value ?? []).map((e) => ({
202
+ file: e,
203
+ pages: me(e.template)
204
+ }))), Ki = d(() => Gi.value.find((e) => e.file.id === si.value) ?? Gi.value[0]), qi = d(() => U.value.find((e) => e.id === I.value)), Ji = d(() => U.value.map((e) => {
205
+ let t = P.value.pages.findIndex((t) => t.id === e.pageId);
201
206
  return {
202
207
  placement: e,
203
- label: se[e.type],
204
- detail: `${se[e.type]} · 第 ${Math.max(0, t) + 1} 页`
208
+ label: r[e.type],
209
+ detail: `${r[e.type]} · 第 ${Math.max(0, t) + 1} 页`
205
210
  };
206
- })), ba = d(() => {
207
- let e = va.value?.pageId;
208
- return J(j.value.pages.find((t) => t.id === e));
209
- }), U = d(() => j.value.pages.find((e) => e.id === P.value) ?? j.value.pages[0]), xa = d(() => Pe(U.value?.pageSize, j.value.pageSize)), Sa = d(() => Ni.value && Pi.value.length === 0), Ca = d(() => Ni.value ? Sa.value ? "校验通过,正文变量与变量配置一致" : `发现 ${Pi.value.length} 个校验问题` : ""), wa = d(() => `${U.value?.title || "合同正文"} · ${xa.value.label} · 共 ${j.value.pages.length} 页`), Ta = d(() => {
210
- switch (da.value.type) {
211
- case "saved": return `草稿已缓存 ${Ge(da.value.savedAt)}`;
211
+ })), Yi = d(() => {
212
+ let e = qi.value?.pageId;
213
+ return X(P.value.pages.find((t) => t.id === e));
214
+ }), W = d(() => P.value.pages.find((e) => e.id === L.value) ?? P.value.pages[0]), Xi = d(() => De(W.value?.pageSize, P.value.pageSize)), Zi = d(() => ei.value && ti.value.length === 0), Qi = d(() => ei.value ? Zi.value ? "校验通过,正文变量与变量配置一致" : `发现 ${ti.value.length} 个校验问题` : ""), $i = d(() => {
215
+ let e = W.value?.title || "合同正文";
216
+ return `${k.value && Vi.value ? `${Vi.value.name} · ` : ""}${e} · ${Xi.value.label} · 共 ${P.value.pages.length} 页`;
217
+ }), ea = d(() => {
218
+ switch (Fi.value.type) {
219
+ case "saved": return `草稿已缓存 ${Ge(Fi.value.savedAt)}`;
212
220
  case "restored": return "已恢复本地草稿";
213
221
  case "too-large": return "草稿过大,未缓存";
214
222
  case "unavailable":
@@ -217,17 +225,17 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
217
225
  case "cleared": return "草稿缓存已清理";
218
226
  default: return "";
219
227
  }
220
- }), Ea = d(() => ({
221
- "is-success": da.value.type === "saved" || da.value.type === "restored",
222
- "is-warning": da.value.type === "too-large",
223
- "is-error": da.value.type === "unavailable" || da.value.type === "read-failed" || da.value.type === "write-failed"
224
- })), Da = d(() => `${Math.round(Vi.value * 100)}%`), Oa = d(() => a(l.fontFamilies, l.fontFamilyMode)), ka = d(() => Oa.value.map((e) => ({
228
+ }), ta = d(() => ({
229
+ "is-success": Fi.value.type === "saved" || Fi.value.type === "restored",
230
+ "is-warning": Fi.value.type === "too-large",
231
+ "is-error": Fi.value.type === "unavailable" || Fi.value.type === "read-failed" || Fi.value.type === "write-failed"
232
+ })), na = d(() => `${Math.round(ui.value * 100)}%`), ra = d(() => ue(l.fontFamilies, l.fontFamilyMode)), ia = d(() => ra.value.map((e) => ({
225
233
  label: e.label,
226
234
  value: e.value
227
- }))), Aa = d(() => t.map((e) => ({
235
+ }))), aa = d(() => oe.map((e) => ({
228
236
  label: e.label,
229
237
  value: e.key
230
- }))), ja = i, Ma = [
238
+ }))), oa = le, sa = [
231
239
  {
232
240
  label: "正文",
233
241
  value: "paragraph"
@@ -256,13 +264,13 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
256
264
  label: "H6",
257
265
  value: 6
258
266
  }
259
- ], Na = [{
267
+ ], ca = [{
260
268
  label: "实线",
261
269
  value: "solid"
262
270
  }, {
263
271
  label: "虚线",
264
272
  value: "dashed"
265
- }], Pa = [
273
+ }], la = [
266
274
  {
267
275
  label: "完整显示",
268
276
  value: "contain"
@@ -275,65 +283,89 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
275
283
  label: "拉伸填充",
276
284
  value: "fill"
277
285
  }
278
- ], Fa = d(() => Me(l.pageSizeOptions)), Ia = d(() => Fa.value.map((e) => ({
286
+ ], ua = d(() => Te(l.pageSizeOptions)), da = d(() => ua.value.map((e) => ({
279
287
  label: `${e.label} · ${e.width} × ${e.height}`,
280
- value: Ae(e)
281
- }))), La = d(() => Ae(xa.value)), Ra = d(() => he({ showSigningPlacementTools: l.showSigningPlacementTools })), za = d(() => l.variableTypes.filter((e) => ie(e?.type))), Ba = d(() => za.value.map((e) => ({
288
+ value: Ce(e)
289
+ }))), fa = d(() => Ce(Xi.value)), pa = d(() => re({ showSigningPlacementTools: l.showSigningPlacementTools })), ma = d(() => l.variableTypes.filter((t) => e(t?.type))), ha = d(() => ma.value.map((e) => ({
282
290
  ...e,
283
- icon: Ze(e.type)
284
- }))), Va = d(() => je(l.maxPages)), Ha = d(() => j.value.pages.length >= Va.value), Ua = d(() => {
285
- let e = aa.value.trim().toLowerCase(), t = j.value.variables;
291
+ icon: st(e.type)
292
+ }))), ga = d(() => we(l.maxPages)), _a = d(() => P.value.pages.length >= ga.value), va = d(() => {
293
+ let e = ki.value.trim().toLowerCase(), t = P.value.variables;
286
294
  return e ? t.filter((t) => t.label.toLowerCase().includes(e) || t.key.toLowerCase().includes(e)) : t;
287
- }), Wa = d(() => Math.max(ci, xa.value.width - oi)), Ga = d(() => Math.max(li, xa.value.height - si)), W = d(() => Ki.value[P.value] ?? Qa()), Ka = d(() => W.value.currentHeadingLevel ?? "paragraph"), qa = d(() => W.value.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif"), Ja = d(() => W.value.fontSize ?? ve.fontSize ?? 14), Ya = d(() => W.value.textColor || ve.color || "#1f2937"), Xa = d(() => V.value?.style?.fontFamily || ve.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif"), Za = d(() => {
288
- let e = r.map((e) => ({
295
+ }), ya = d(() => Math.max(yr, Xi.value.width - _r)), ba = d(() => Math.max(br, Xi.value.height - vr)), G = d(() => hi.value[L.value] ?? Oa()), xa = d(() => G.value.currentHeadingLevel ?? "paragraph"), Sa = d(() => G.value.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif"), Ca = d(() => G.value.fontSize ?? de.fontSize ?? 14), wa = d(() => G.value.textColor || de.color || "#1f2937"), Ta = d(() => Ui.value?.style?.fontFamily || de.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif"), Ea = d(() => {
296
+ let e = ce.map((e) => ({
289
297
  label: `${e}px`,
290
298
  value: e
291
- })), t = ro(Ja.value), n = ro(Ji.value), i = /* @__PURE__ */ new Map();
292
- return n && !r.includes(n) && i.set(n, {
299
+ })), t = Na(Ca.value), n = Na(_i.value), r = /* @__PURE__ */ new Map();
300
+ return n && !ce.includes(n) && r.set(n, {
293
301
  label: `使用 ${n}px`,
294
302
  value: n
295
- }), t && !r.includes(t) && i.set(t, {
303
+ }), t && !ce.includes(t) && r.set(t, {
296
304
  label: n === t ? `使用 ${t}px` : `${t}px`,
297
305
  value: t
298
- }), [...Array.from(i.values()), ...e];
306
+ }), [...Array.from(r.values()), ...e];
299
307
  });
300
- at(() => l.modelValue, (e) => {
301
- if (!e) return;
302
- let t = Ne(e, l.pageSize), n = Ce(t, l.pageSizeOptions), r = n.value;
303
- Ai.value = ki(e), JSON.stringify(r) !== JSON.stringify(j.value) && (j.value = r, P.value = r.pages[0]?.id ?? "", M.value = "", N.value = "", Z(P.value)), JSON.stringify(r) !== JSON.stringify(t) && (v("update:modelValue", c(r)), v("change", c(r)), yo(n.resizedSigningPlacementIds, r));
304
- }, { deep: !0 }), at(() => l.pageSize, (e) => {
305
- let t = Ce(Ne(j.value, e), l.pageSizeOptions);
306
- JSON.stringify(t.value) !== JSON.stringify(j.value) && (j.value = t.value, v("update:modelValue", c(t.value)), v("change", c(t.value)), yo(t.resizedSigningPlacementIds, t.value)), Z(P.value);
307
- }, { deep: !0 }), at(() => l.pageSizeOptions, (e) => {
308
- let t = Ce(j.value, e);
309
- JSON.stringify(t.value) !== JSON.stringify(j.value) && (j.value = t.value, v("update:modelValue", c(t.value)), v("change", c(t.value)), yo(t.resizedSigningPlacementIds, t.value), Z(P.value));
310
- }, { deep: !0 }), at(Va, () => {
311
- Z(j.value.pages[0]?.id);
312
- }), at(B, (e) => {
313
- e && ($(), I.value = !1, Yi.value = !1);
314
- }), at(H, (e) => {
315
- N.value && !e.some((e) => e.id === N.value) && (N.value = "", v("signing-placement-select", void 0));
316
- }, { deep: !0 }), at(() => [
308
+ St(() => l.modelValue, (e) => {
309
+ if (!e || k.value) return;
310
+ let t = Ee(e, l.pageSize), n = ge(t, l.pageSizeOptions), r = n.value, i = JSON.stringify(r) !== JSON.stringify(P.value), a = JSON.stringify(r), o = a === Gr;
311
+ o && (Gr = ""), (i || !o) && (N.value = Vr(e), M.value = {
312
+ ...M.value,
313
+ [j.value]: N.value
314
+ }, P.value = r, A.value = at(A.value, j.value, r), L.value = r.pages[0]?.id ?? "", F.value = "", I.value = "", mo(L.value)), JSON.stringify(r) !== JSON.stringify(t) && (Gr = a, v("update:modelValue", c(r)), v("change", c(r)), Xa(n.resizedSigningPlacementIds, r));
315
+ }, { deep: !0 }), St(() => l.files, (e) => {
316
+ if (!Array.isArray(e)) return;
317
+ let t = nt(e, void 0, l.pageSize), n = Ur(t, l.pageSizeOptions).files, r = JSON.stringify(n), i = JSON.stringify(A.value), a = r === Wr;
318
+ a || (M.value = Hr(n, e)), a && (Wr = "");
319
+ let o = ot(n, l.activeFileId || j.value);
320
+ if (r === i ? o !== j.value && Ia(o, !1, !1) : (A.value = n, Ia(o, !1, !1, !0, !1)), r !== JSON.stringify(t)) {
321
+ let e = u(n);
322
+ Wr = JSON.stringify(e), v("update:files", e), v("files-change", u(e));
323
+ }
324
+ }, { deep: !0 }), St(() => l.activeFileId, (e) => {
325
+ !k.value || !e || e === j.value || Ia(e, !0, !1);
326
+ });
327
+ function Da(e, t) {
328
+ let n = JSON.stringify(A.value);
329
+ K(!1);
330
+ let { files: r, resizedSigningPlacementIds: i } = Ur(nt(A.value, void 0, e), t), a = JSON.stringify(r) !== n, o = r.find((e) => e.id === j.value);
331
+ o && JSON.stringify(o.template) !== JSON.stringify(P.value) && (P.value = c(o.template), N.value = [...M.value[j.value] ?? []]), a && (ei.value = !1, ti.value = [], Fa(r, ""));
332
+ let s = i.get(j.value);
333
+ return s?.length && o && Xa(s, o.template), a;
334
+ }
335
+ St([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
336
+ if (k.value) {
337
+ Da(e, t), mo(L.value);
338
+ return;
339
+ }
340
+ let n = ge(Ee(P.value, e), t);
341
+ JSON.stringify(n.value) !== JSON.stringify(P.value) && q(n.value), mo(L.value);
342
+ }, { deep: !0 }), St(ga, () => {
343
+ mo(P.value.pages[0]?.id);
344
+ }), St(H, (e) => {
345
+ e && ($(), vi.value = !1, yi.value = !1);
346
+ }), St(U, (e) => {
347
+ I.value && !e.some((e) => e.id === I.value) && (I.value = "", v("signing-placement-select", void 0));
348
+ }, { deep: !0 }), St(() => [
317
349
  l.enableDraftCache,
318
- l.draftCacheKey,
350
+ Hi.value,
319
351
  l.draftCacheInterval,
320
- B.value
352
+ H.value
321
353
  ], () => {
322
- ha = "", po();
323
- }), at(Hi, (e) => {
354
+ zi = "", Wa();
355
+ }), St(di, (e) => {
324
356
  if (!(typeof document > "u")) {
325
357
  if (e) {
326
- pa = document.body.style.overflow, document.body.style.overflow = "hidden";
358
+ Li = document.body.style.overflow, document.body.style.overflow = "hidden";
327
359
  return;
328
360
  }
329
- document.body.style.overflow = pa ?? "", pa = void 0;
361
+ document.body.style.overflow = Li ?? "", Li = void 0;
330
362
  }
331
- }), nt(() => {
332
- uo(), po(), Z(P.value), window.addEventListener("pointerdown", Rc, !0), window.addEventListener("keydown", Bc), window.addEventListener("resize", $), window.addEventListener("scroll", $, !0);
333
- }), tt(() => {
334
- Hi.value && typeof document < "u" && (document.body.style.overflow = pa ?? ""), window.removeEventListener("pointerdown", Rc, !0), window.removeEventListener("keydown", Bc), window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0), fo();
363
+ }), vt(() => {
364
+ Ha(), Wa(), mo(L.value), window.addEventListener("pointerdown", Ec, !0), window.addEventListener("keydown", Oc), window.addEventListener("resize", $), window.addEventListener("scroll", $, !0);
365
+ }), _t(() => {
366
+ di.value && typeof document < "u" && (document.body.style.overflow = Li ?? ""), window.removeEventListener("pointerdown", Ec, !0), window.removeEventListener("keydown", Oc), window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0), Ua();
335
367
  });
336
- function Qa() {
368
+ function Oa() {
337
369
  return {
338
370
  isFocused: !1,
339
371
  canUndo: !1,
@@ -345,36 +377,36 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
345
377
  isOrderedList: !1,
346
378
  isTableActive: !1,
347
379
  textAlign: "left",
348
- fontFamily: n,
349
- fontSize: ve.fontSize ?? 14,
350
- textColor: ve.color ?? "#1f2937",
380
+ fontFamily: se,
381
+ fontSize: de.fontSize ?? 14,
382
+ textColor: de.color ?? "#1f2937",
351
383
  selectionText: ""
352
384
  };
353
385
  }
354
- function $a(e) {
386
+ function ka(e) {
355
387
  return e === "left" || e === "center" || e === "right";
356
388
  }
357
- function eo(e) {
389
+ function Aa(e) {
358
390
  return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 6;
359
391
  }
360
- function to(e) {
361
- return typeof e == "string" && t.some((t) => t.key === e);
392
+ function ja(e) {
393
+ return typeof e == "string" && oe.some((t) => t.key === e);
362
394
  }
363
- function no(e, t = Ja.value) {
395
+ function Ma(e, t = Ca.value) {
364
396
  let n = Number(e);
365
- return Number.isFinite(n) ? Math.min(di, Math.max(ui, Math.round(n))) : t;
397
+ return Number.isFinite(n) ? Math.min(Sr, Math.max(xr, Math.round(n))) : t;
366
398
  }
367
- function ro(e) {
399
+ function Na(e) {
368
400
  let t = String(e || "").trim().match(/(\d+(\.\d+)?)/);
369
401
  if (!t) return;
370
402
  let n = Number(t[1]);
371
- if (Number.isFinite(n)) return Math.min(di, Math.max(ui, Math.round(n)));
403
+ if (Number.isFinite(n)) return Math.min(Sr, Math.max(xr, Math.round(n)));
372
404
  }
373
- function io(e = j.value) {
405
+ function Pa(e = P.value) {
374
406
  return {
375
407
  ...e,
376
408
  pages: e.pages.map((e) => {
377
- let t = F.get(e.id);
409
+ let t = R.get(e.id);
378
410
  return {
379
411
  ...e,
380
412
  contentHtml: t?.getHTML() ?? e.contentHtml,
@@ -383,236 +415,301 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
383
415
  })
384
416
  };
385
417
  }
386
- function G(e) {
387
- let t = Ce(Ne(e, l.pageSize), l.pageSizeOptions), n = t.value;
388
- return j.value = n, Ni.value = !1, Pi.value = [], v("update:modelValue", c(n)), v("change", c(n)), yo(t.resizedSigningPlacementIds, n), n;
418
+ function K(e = !1) {
419
+ let t = c(Pa());
420
+ if (!k.value) return t;
421
+ let n = A.value.find((e) => e.id === j.value)?.template, r = JSON.stringify(n) !== JSON.stringify(t), i = at(A.value, j.value, t);
422
+ return A.value = i, r && e && Fa(i), t;
423
+ }
424
+ function Fa(e, t = j.value) {
425
+ if (!k.value) return;
426
+ let n = u(e);
427
+ A.value = n, Wr = JSON.stringify(n), v("update:files", u(n)), v("files-change", u(n));
428
+ let r = n.find((e) => e.id === t);
429
+ r && v("file-change", u([r])[0]);
430
+ }
431
+ function Ia(e, t = !0, n = !0, r = !1, i = !0) {
432
+ let a = ot(A.value, e), o = a !== j.value;
433
+ if (i && k.value && j.value && (M.value = {
434
+ ...M.value,
435
+ [j.value]: [...N.value]
436
+ }), t && K(!0), !o && !r) return;
437
+ let s = A.value.find((e) => e.id === a);
438
+ s && (j.value = a, P.value = c(s.template), N.value = [...M.value[a] ?? []], F.value = "", I.value = "", L.value = P.value.pages[0]?.id ?? "", hi.value = {}, R.clear(), ri.value = "", ei.value = !1, ti.value = [], ii.value = !1, ai.value = void 0, oi.value = void 0, zi = "", n && o && v("update:activeFileId", a), t && o && Bi.value && Ra(), y(() => {
439
+ mo(L.value);
440
+ }));
441
+ }
442
+ function q(e) {
443
+ let t = ge(Ee(e, l.pageSize), l.pageSizeOptions), n = t.value;
444
+ return P.value = n, ei.value = !1, ti.value = [], k.value ? Fa(at(A.value, j.value, n)) : (A.value = at(A.value, j.value, n), Gr = JSON.stringify(n), v("update:modelValue", c(n)), v("change", c(n))), Xa(t.resizedSigningPlacementIds, n), n;
389
445
  }
390
- function ao(e, t = e.type !== "unchanged") {
391
- da.value = e, t && v("draft-cache-change", { ...e });
446
+ function La(e, t = e.type !== "unchanged") {
447
+ Fi.value = e, t && v("draft-cache-change", { ...e });
392
448
  }
393
- function oo() {
394
- if (!ga.value) {
449
+ function Ra() {
450
+ if (!Bi.value) {
395
451
  let e = We("unavailable", "草稿缓存未启用");
396
- return ao(e), e;
452
+ return La(e), e;
397
453
  }
398
- let e = Ye({
399
- storage: Ke(),
400
- key: l.draftCacheKey,
401
- value: c(io()),
454
+ let e = Ke();
455
+ k.value && K(!1);
456
+ let t = k.value ? Qe({
457
+ storage: e,
458
+ key: Hi.value,
459
+ value: {
460
+ files: u(A.value),
461
+ activeFileId: j.value
462
+ },
463
+ maxBytes: l.draftCacheMaxBytes,
464
+ previousValueSerialized: zi
465
+ }) : Ze({
466
+ storage: e,
467
+ key: Hi.value,
468
+ value: c(Pa()),
402
469
  maxBytes: l.draftCacheMaxBytes,
403
- previousValueSerialized: ha
470
+ previousValueSerialized: zi
404
471
  });
405
- return e.valueSerialized && (ha = e.valueSerialized), e.status.type !== "unchanged" && ao(e.status), e.status;
406
- }
407
- function so() {
408
- let e = Je(Ke(), l.draftCacheKey);
409
- return e.valueSerialized && (ha = e.valueSerialized), e.status.type !== "idle" && ao(e.status), e.value ? c(e.value) : void 0;
410
- }
411
- function co() {
412
- let e = Ue(Ke(), l.draftCacheKey);
413
- ha = "", ao(e);
414
- }
415
- function lo() {
416
- return { ...da.value };
417
- }
418
- function uo() {
419
- if (!ga.value || !qe(l.modelValue)) return;
420
- let e = Je(Ke(), l.draftCacheKey);
421
- if (e.valueSerialized && (ha = e.valueSerialized), e.value) {
422
- P.value = G(e.value).pages[0]?.id ?? "", M.value = "", Z(P.value), ao(e.status);
472
+ return t.valueSerialized && (zi = t.valueSerialized), t.status.type !== "unchanged" && La(t.status), t.status;
473
+ }
474
+ function za() {
475
+ if (k.value) {
476
+ let e = Xe(Ke(), Hi.value);
477
+ e.valueSerialized && (zi = e.valueSerialized), e.status.type !== "idle" && La(e.status);
478
+ let t = ot(e.value?.files ?? [], e.value?.activeFileId), n = e.value?.files.find((e) => e.id === t)?.template;
479
+ return n ? c(n) : void 0;
480
+ }
481
+ let e = Ye(Ke(), Hi.value);
482
+ return e.valueSerialized && (zi = e.valueSerialized), e.status.type !== "idle" && La(e.status), e.value ? c(e.value) : void 0;
483
+ }
484
+ function Ba() {
485
+ let e = Ue(Ke(), Hi.value);
486
+ zi = "", La(e);
487
+ }
488
+ function Va() {
489
+ return { ...Fi.value };
490
+ }
491
+ function Ha() {
492
+ if (!Bi.value) return;
493
+ if (k.value) {
494
+ if (!Je({
495
+ files: u(A.value),
496
+ activeFileId: j.value
497
+ })) return;
498
+ let e = Xe(Ke(), Hi.value);
499
+ if (e.valueSerialized && (zi = e.valueSerialized), e.value) {
500
+ let t = Ur(nt(e.value.files, void 0, l.pageSize), l.pageSizeOptions);
501
+ A.value = t.files, M.value = Hr(t.files, e.value.files), Ia(ot(A.value, e.value.activeFileId), !1, !0, !0, !1), Fa(A.value, ""), La(e.status);
502
+ return;
503
+ }
504
+ e.status.type !== "idle" && e.status.type !== "invalid" && La(e.status);
505
+ return;
506
+ }
507
+ if (!qe(P.value)) return;
508
+ let e = Ye(Ke(), Hi.value);
509
+ if (e.valueSerialized && (zi = e.valueSerialized), e.value) {
510
+ L.value = q(e.value).pages[0]?.id ?? "", F.value = "", mo(L.value), La(e.status);
423
511
  return;
424
512
  }
425
- e.status.type !== "idle" && e.status.type !== "invalid" && ao(e.status);
513
+ e.status.type !== "idle" && e.status.type !== "invalid" && La(e.status);
426
514
  }
427
- function fo() {
428
- ma &&= (clearInterval(ma), void 0);
515
+ function Ua() {
516
+ Ri &&= (clearInterval(Ri), void 0);
429
517
  }
430
- function po() {
431
- if (fo(), !ga.value || typeof window > "u") return;
518
+ function Wa() {
519
+ if (Ua(), !Bi.value || typeof window > "u") return;
432
520
  let e = Math.max(1e3, Math.round(Number(l.draftCacheInterval) || 5e3));
433
- ma = window.setInterval(() => {
434
- oo();
521
+ Ri = window.setInterval(() => {
522
+ Ra();
435
523
  }, e);
436
524
  }
437
- function mo(e, t) {
438
- t ? F.set(e, t) : F.delete(e);
525
+ function Ga(e, t) {
526
+ t ? R.set(e, t) : R.delete(e);
439
527
  }
440
- function K(e, t = U.value?.id ?? P.value) {
441
- B.value || F.get(t)?.runCommand(e);
528
+ function J(e, t = W.value?.id ?? L.value) {
529
+ H.value || R.get(t)?.runCommand(e);
442
530
  }
443
- function q(e) {
444
- K(e), $();
531
+ function Y(e) {
532
+ J(e), $();
445
533
  }
446
- function ho(e) {
447
- let t = L.value?.pageId;
448
- t && (F.get(t)?.focus(), ua.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
534
+ function Ka(e) {
535
+ let t = z.value?.pageId;
536
+ t && (R.get(t)?.focus(), Pi.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
449
537
  }
450
- function go(e) {
451
- let t = G(Fe(e));
452
- return M.value && !t.variables.some((e) => e.key === M.value) && (M.value = ""), t;
538
+ function qa(e) {
539
+ let t = q(Oe(e));
540
+ return F.value && !t.variables.some((e) => e.key === F.value) && (F.value = ""), t;
453
541
  }
454
- function _o(e) {
455
- go({
456
- ...j.value,
457
- pages: j.value.pages.map((t) => t.id === e.id ? e : t)
458
- }), Z(e.id);
542
+ function Ja(e) {
543
+ qa({
544
+ ...P.value,
545
+ pages: P.value.pages.map((t) => t.id === e.id ? e : t)
546
+ }), mo(e.id);
459
547
  }
460
- function J(e) {
461
- return Pe(e?.pageSize, j.value.pageSize);
548
+ function X(e) {
549
+ return De(e?.pageSize, P.value.pageSize);
462
550
  }
463
- function vo(e) {
464
- return H.value.filter((t) => t.pageId === e);
551
+ function Ya(e) {
552
+ return U.value.filter((t) => t.pageId === e);
465
553
  }
466
- function Y(e) {
554
+ function Z(e) {
467
555
  return {
468
556
  ...e,
469
557
  ...e.sealTypes ? { sealTypes: [...e.sealTypes] } : {}
470
558
  };
471
559
  }
472
- function yo(e, t = j.value) {
560
+ function Xa(e, t = P.value) {
473
561
  let n = new Set(e);
474
- n.size && (xo(n), (t.signingPlacements ?? []).filter((e) => n.has(e.id)).forEach((e) => v("signing-placement-change", Y(e))));
562
+ n.size && (Qa(n), (t.signingPlacements ?? []).filter((e) => n.has(e.id)).forEach((e) => v("signing-placement-change", Z(e))));
475
563
  }
476
- function X(e) {
477
- let t = e ? H.value.find((t) => t.id === e) : void 0;
478
- N.value = t?.id ?? "", t && (M.value = "", P.value = t.pageId), v("signing-placement-select", t ? Y(t) : void 0);
564
+ function Q(e) {
565
+ let t = e ? U.value.find((t) => t.id === e) : void 0;
566
+ I.value = t?.id ?? "", t && (F.value = "", L.value = t.pageId), v("signing-placement-select", t ? Z(t) : void 0);
479
567
  }
480
- function bo(e) {
481
- X(e.id);
568
+ function Za(e) {
569
+ Q(e.id);
482
570
  }
483
- function xo(e) {
571
+ function Qa(e) {
484
572
  let t = new Set(e);
485
- t.size && (Ai.value = Ai.value.filter((e) => e.type !== "signing-placement" || !t.has(e.id)));
573
+ if (!t.size) return;
574
+ let n = N.value.filter((e) => e.type !== "signing-placement" || !t.has(e.id));
575
+ N.value = n, M.value = {
576
+ ...M.value,
577
+ [j.value]: n
578
+ };
486
579
  }
487
- function So(e) {
488
- Ai.value = Ai.value.filter((t) => t.type !== "signing-placement" || t.pageId !== e);
580
+ function $a(e) {
581
+ let t = N.value.filter((t) => t.type !== "signing-placement" || t.pageId !== e);
582
+ N.value = t, M.value = {
583
+ ...M.value,
584
+ [j.value]: t
585
+ };
489
586
  }
490
- function Co(e, t = []) {
491
- return xo(t), G({
492
- ...j.value,
587
+ function eo(e, t = []) {
588
+ return Qa(t), q({
589
+ ...P.value,
493
590
  signingPlacements: e
494
591
  });
495
592
  }
496
- function wo(e, t = U.value?.id ?? j.value.pages[0]?.id, n) {
497
- if (!de(l.readonly, l.disabled) || !t) return;
498
- let r = j.value.pages.find((e) => e.id === t);
593
+ function to(e, t = W.value?.id ?? P.value.pages[0]?.id, n) {
594
+ if (!s(l.readonly, l.disabled) || !t) return;
595
+ let r = P.value.pages.find((e) => e.id === t);
499
596
  if (!r) return;
500
- let i = pe(e, t, J(r), { ...n ?? F.get(t)?.getVisibleSigningPlacementPosition(e) });
501
- return Co([...H.value, i]), P.value = t, X(i.id), v("signing-placement-add", Y(i)), i;
597
+ let i = te(e, t, X(r), { ...n ?? R.get(t)?.getVisibleSigningPlacementPosition(e) });
598
+ return eo([...U.value, i]), L.value = t, Q(i.id), v("signing-placement-add", Z(i)), i;
502
599
  }
503
- function To(e, t, n, r) {
600
+ function no(e, t, n, r) {
504
601
  if (!l.showSigningPlacementTools) return;
505
- let i = me(t.type);
506
- wo(t.type, e, {
602
+ let i = ne(t.type);
603
+ to(t.type, e, {
507
604
  x: n - i.width / 2,
508
605
  y: r - i.height / 2
509
606
  });
510
607
  }
511
- function Eo(e) {
512
- return wo(e.type);
608
+ function ro(e) {
609
+ return to(e.type);
513
610
  }
514
- function Do(e, t) {
515
- if (!de(l.readonly, l.disabled)) {
611
+ function io(e, t) {
612
+ if (!s(l.readonly, l.disabled)) {
516
613
  e.preventDefault();
517
614
  return;
518
615
  }
519
- e.dataTransfer?.setData(oe, _e(t)), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
616
+ e.dataTransfer?.setData(n, ae(t)), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
520
617
  }
521
- function Oo(e) {
522
- if (!de(l.readonly, l.disabled)) return;
523
- let t = j.value.pages.find((t) => t.id === e.pageId);
618
+ function ao(e) {
619
+ if (!s(l.readonly, l.disabled)) return;
620
+ let t = P.value.pages.find((t) => t.id === e.pageId);
524
621
  if (!t) return;
525
- let n = fe({
622
+ let n = ee({
526
623
  ...e,
527
624
  ...e.type === "seal" ? {} : { sealTypes: void 0 }
528
- }, J(t));
529
- Co(H.value.map((e) => e.id === n.id ? n : e), [n.id]), N.value = n.id, v("signing-placement-change", Y(n));
625
+ }, X(t));
626
+ eo(U.value.map((e) => e.id === n.id ? n : e), [n.id]), I.value = n.id, v("signing-placement-change", Z(n));
530
627
  }
531
- function ko(e) {
532
- let t = va.value;
628
+ function oo(e) {
629
+ let t = qi.value;
533
630
  if (!t) return;
534
- let n = j.value.pages.find((e) => e.id === t.pageId);
535
- n && Oo(ce(t, e, J(n)));
631
+ let n = P.value.pages.find((e) => e.id === t.pageId);
632
+ n && ao(i(t, e, X(n)));
536
633
  }
537
- function Ao(e = va.value) {
538
- if (!de(l.readonly, l.disabled) || !e) return;
539
- let t = j.value.pages.find((t) => t.id === e.pageId);
634
+ function so(e = qi.value) {
635
+ if (!s(l.readonly, l.disabled) || !e) return;
636
+ let t = P.value.pages.find((t) => t.id === e.pageId);
540
637
  if (!t) return;
541
- let n = pe(e.type, e.pageId, J(t), {
542
- ...Y(e),
638
+ let n = te(e.type, e.pageId, X(t), {
639
+ ...Z(e),
543
640
  id: void 0,
544
641
  x: e.x + 16,
545
642
  y: e.y + 16
546
643
  });
547
- Co([...H.value, n]), X(n.id), v("signing-placement-add", Y(n));
644
+ eo([...U.value, n]), Q(n.id), v("signing-placement-add", Z(n));
548
645
  }
549
- function jo(e = va.value) {
550
- !de(l.readonly, l.disabled) || !e || (Co(H.value.filter((t) => t.id !== e.id), [e.id]), N.value === e.id && X(), v("signing-placement-remove", Y(e)));
646
+ function co(e = qi.value) {
647
+ !s(l.readonly, l.disabled) || !e || (eo(U.value.filter((t) => t.id !== e.id), [e.id]), I.value === e.id && Q(), v("signing-placement-remove", Z(e)));
551
648
  }
552
- function Mo(e) {
553
- if (B.value || !U.value) return;
554
- let t = Fa.value.find((t) => Ae(t) === e);
649
+ function lo(e) {
650
+ if (H.value || !W.value) return;
651
+ let t = ua.value.find((t) => Ce(t) === e);
555
652
  if (!t) return;
556
- let n = U.value.id, r = J(U.value), i = Pe(t, j.value.pageSize), a = H.value.map((e) => e.pageId === n ? ge(e, r, i) : e);
557
- xo(a.filter((e) => e.pageId === n).map((e) => e.id)), G({
558
- ...j.value,
559
- pages: j.value.pages.map((e) => e.id === n ? {
653
+ let n = W.value.id, r = X(W.value), i = De(t, P.value.pageSize), a = U.value.map((e) => e.pageId === n ? ie(e, r, i) : e);
654
+ Qa(a.filter((e) => e.pageId === n).map((e) => e.id)), q({
655
+ ...P.value,
656
+ pages: P.value.pages.map((e) => e.id === n ? {
560
657
  ...e,
561
658
  pageSize: i
562
659
  } : e),
563
660
  signingPlacements: a
564
- }), a.filter((e) => e.pageId === n).forEach((e) => v("signing-placement-change", Y(e))), Z(n);
661
+ }), a.filter((e) => e.pageId === n).forEach((e) => v("signing-placement-change", Z(e))), mo(n);
565
662
  }
566
- function No(e) {
663
+ function uo(e) {
567
664
  return {
568
665
  type: "doc",
569
666
  content: e.length ? e : [{ type: "paragraph" }]
570
667
  };
571
668
  }
572
- function Po(e) {
669
+ function fo(e) {
573
670
  return e.replace(/<p>\s*(<br>)?\s*<\/p>/gi, "").trim().length === 0;
574
671
  }
575
- function Fo(e, t, n) {
576
- let r = e.contentJson?.content, i = [...t, ...r?.length ? r : []], a = Po(e.contentHtml || "") ? "" : e.contentHtml;
672
+ function po(e, t, n) {
673
+ let r = e.contentJson?.content, i = [...t, ...r?.length ? r : []], a = fo(e.contentHtml || "") ? "" : e.contentHtml;
577
674
  return {
578
675
  ...e,
579
676
  contentHtml: `${n}${a}`,
580
- contentJson: No(i)
677
+ contentJson: uo(i)
581
678
  };
582
679
  }
583
- function Z(e = P.value) {
584
- if (B.value) return;
585
- let t = j.value.pages.findIndex((e) => e.id === Ii.value), n = j.value.pages.findIndex((t) => t.id === e);
586
- (!Ii.value || t < 0 || n >= 0 && n < t) && (Ii.value = e), !Fi.value && y(() => Lo());
680
+ function mo(e = L.value) {
681
+ if (H.value) return;
682
+ let t = P.value.pages.findIndex((e) => e.id === ri.value), n = P.value.pages.findIndex((t) => t.id === e);
683
+ (!ri.value || t < 0 || n >= 0 && n < t) && (ri.value = e), !ni.value && y(() => go());
587
684
  }
588
- function Io(e) {
589
- let t = Va.value;
590
- ua.value = `合同最多支持 ${t} 页`, v("page-limit", t, e);
685
+ function ho(e) {
686
+ let t = ga.value;
687
+ Pi.value = `合同最多支持 ${t} 页`, v("page-limit", t, e);
591
688
  }
592
- async function Lo() {
593
- if (!Fi.value) {
594
- Fi.value = !0;
689
+ async function go() {
690
+ if (!ni.value) {
691
+ ni.value = !0;
595
692
  try {
596
- let e = Ii.value;
597
- Ii.value = "";
598
- let t = 0, n = Math.max(40, Va.value + 1);
693
+ let e = ri.value;
694
+ ri.value = "";
695
+ let t = 0, n = Math.max(40, ga.value + 1);
599
696
  for (; t < n;) {
600
697
  await y();
601
- let n = io().pages, r = Math.max(0, n.findIndex((t) => t.id === e)), i = !1;
698
+ let n = Pa().pages, r = Math.max(0, n.findIndex((t) => t.id === e)), i = !1;
602
699
  for (let t = r; t < n.length; t += 1) {
603
700
  let r = n[t];
604
- if (t === n.length - 1 && n.length >= Va.value && F.get(r.id)?.hasOverflowContent()) {
605
- Io("auto-pagination");
701
+ if (t === n.length - 1 && n.length >= ga.value && R.get(r.id)?.hasOverflowContent()) {
702
+ ho("auto-pagination");
606
703
  break;
607
704
  }
608
- let a = F.get(r.id)?.splitOverflowContent();
705
+ let a = R.get(r.id)?.splitOverflowContent();
609
706
  if (!a) continue;
610
- let o = io().pages, s = o.findIndex((e) => e.id === r.id);
707
+ let o = Pa().pages, s = o.findIndex((e) => e.id === r.id);
611
708
  if (s < 0) break;
612
709
  o[s] = a.page;
613
710
  let ee = o[s + 1];
614
- ee ? o[s + 1] = F.get(ee.id)?.prependContent(a.overflowContent) ?? Fo(ee, a.overflowContent, a.overflowHtml) : o.push(we(o.length + 1, J(a.page), a.overflowHtml, No(a.overflowContent))), go({
615
- ...j.value,
711
+ ee ? o[s + 1] = R.get(ee.id)?.prependContent(a.overflowContent) ?? po(ee, a.overflowContent, a.overflowHtml) : o.push(_e(o.length + 1, X(a.page), a.overflowHtml, uo(a.overflowContent))), qa({
712
+ ...P.value,
616
713
  pages: o
617
714
  }), e = o[s + 1]?.id ?? a.page.id, i = !0;
618
715
  break;
@@ -621,619 +718,701 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
621
718
  t += 1;
622
719
  }
623
720
  } finally {
624
- Fi.value = !1, Ii.value && y(() => Lo());
721
+ ni.value = !1, ri.value && y(() => go());
625
722
  }
626
723
  }
627
724
  }
628
- function Ro() {
629
- if (B.value) return;
630
- if (Ha.value) {
631
- Io("add");
725
+ function _o() {
726
+ if (H.value) return;
727
+ if (_a.value) {
728
+ ho("add");
632
729
  return;
633
730
  }
634
- let e = Ee(j.value.pages.length + 1, xa.value);
635
- G({
636
- ...j.value,
637
- pages: [...j.value.pages, e]
638
- }), P.value = e.id;
731
+ let e = ye(P.value.pages.length + 1, Xi.value);
732
+ q({
733
+ ...P.value,
734
+ pages: [...P.value.pages, e]
735
+ }), L.value = e.id;
639
736
  }
640
- function zo(e) {
641
- if (B.value) return;
642
- if (Ha.value) {
643
- Io("duplicate");
737
+ function vo(e) {
738
+ if (H.value) return;
739
+ if (_a.value) {
740
+ ho("duplicate");
644
741
  return;
645
742
  }
646
- let t = j.value.pages.findIndex((t) => t.id === e.id);
743
+ let t = P.value.pages.findIndex((t) => t.id === e.id);
647
744
  if (t < 0) return;
648
745
  let n = c({
649
746
  pages: [e],
650
747
  variables: [],
651
- pageSize: j.value.pageSize,
748
+ pageSize: P.value.pageSize,
652
749
  signingPlacements: []
653
- }).pages[0], r = we(t + 2, J(e), n.contentHtml, n.contentJson);
750
+ }).pages[0], r = _e(t + 2, X(e), n.contentHtml, n.contentJson);
654
751
  r.title = `${e.title || `第 ${t + 1} 页`}副本`;
655
- let i = [...j.value.pages];
752
+ let i = [...P.value.pages];
656
753
  i.splice(t + 1, 0, r);
657
- let a = vo(e.id).map((e) => pe(e.type, r.id, J(r), {
658
- ...Y(e),
754
+ let a = Ya(e.id).map((e) => te(e.type, r.id, X(r), {
755
+ ...Z(e),
659
756
  id: void 0,
660
757
  pageId: r.id
661
758
  }));
662
- G({
663
- ...j.value,
759
+ q({
760
+ ...P.value,
664
761
  pages: i,
665
- signingPlacements: [...H.value, ...a]
666
- }), P.value = r.id, a.forEach((e) => v("signing-placement-add", Y(e))), a[0] && X(a[0].id);
762
+ signingPlacements: [...U.value, ...a]
763
+ }), L.value = r.id, a.forEach((e) => v("signing-placement-add", Z(e))), a[0] && Q(a[0].id);
667
764
  }
668
- function Bo(e) {
669
- if (B.value || j.value.pages.length <= 1) return;
670
- let t = j.value.pages.findIndex((t) => t.id === e.id);
765
+ function yo(e) {
766
+ if (H.value || P.value.pages.length <= 1) return;
767
+ let t = P.value.pages.findIndex((t) => t.id === e.id);
671
768
  if (t < 0) return;
672
- let n = vo(e.id);
673
- So(e.id);
674
- let r = j.value.pages.filter((t) => t.id !== e.id), i = go({
675
- ...j.value,
769
+ let n = Ya(e.id);
770
+ $a(e.id);
771
+ let r = P.value.pages.filter((t) => t.id !== e.id), i = qa({
772
+ ...P.value,
676
773
  pages: r,
677
- signingPlacements: H.value.filter((t) => t.pageId !== e.id)
774
+ signingPlacements: U.value.filter((t) => t.pageId !== e.id)
678
775
  });
679
- P.value = i.pages[Math.min(t, i.pages.length - 1)]?.id ?? "", n.some((e) => e.id === N.value) && X(), n.forEach((e) => v("signing-placement-remove", Y(e)));
776
+ L.value = i.pages[Math.min(t, i.pages.length - 1)]?.id ?? "", n.some((e) => e.id === I.value) && Q(), n.forEach((e) => v("signing-placement-remove", Z(e)));
680
777
  }
681
- function Vo(e) {
682
- if (B.value || j.value.pages.length <= 1) return;
683
- let t = vo(e.id).length;
778
+ function bo(e) {
779
+ if (H.value || P.value.pages.length <= 1) return;
780
+ let t = Ya(e.id).length;
684
781
  if (!t) {
685
- Bo(e);
782
+ yo(e);
686
783
  return;
687
784
  }
688
- ft.confirm({
785
+ Ot.confirm({
689
786
  title: "删除合同页面",
690
787
  content: `此页包含 ${t} 个签署位置,删除页面会同时移除这些位置,是否继续?`,
691
788
  okText: "确认删除",
692
789
  okType: "danger",
693
790
  cancelText: "取消",
694
- onOk: () => Bo(e)
791
+ onOk: () => {
792
+ yo(e);
793
+ }
695
794
  });
696
795
  }
697
- function Ho(e) {
698
- let t = new Set(j.value.variables.map((e) => e.key)), n = 1;
796
+ function xo(e) {
797
+ let t = new Set(P.value.variables.map((e) => e.key)), n = 1;
699
798
  for (; t.has(`${e}_${n}`);) n += 1;
700
799
  return `${e}_${n}`;
701
800
  }
702
- function Uo(e) {
801
+ function So(e) {
703
802
  let t = e.type ?? "text";
704
- return De({
803
+ return be({
705
804
  ...e,
706
805
  type: t,
707
- key: e.key || Ho(t),
708
- label: e.label || ke(t, l.variableTypes).label
806
+ key: e.key || xo(t),
807
+ label: e.label || Se(t, l.variableTypes).label
709
808
  }, l.variableTypes, l.defaultVariableStyle);
710
809
  }
711
- function Wo(e, t = U.value?.id ?? j.value.pages[0].id, n) {
712
- if (B.value) return e;
713
- let r = F.get(t)?.insertVariable(e, n), i = !j.value.variables.some((t) => t.key === e.key);
714
- return G({
715
- ...j.value,
716
- pages: r ? j.value.pages.map((e) => e.id === r.id ? r : e) : j.value.pages,
717
- variables: i ? [...j.value.variables, e] : j.value.variables
718
- }), M.value = e.key, X(), P.value = t, i && v("variable-add", e), Z(t), e;
719
- }
720
- function Go(e) {
721
- let { width: t, height: n, ...r } = e, i = ee(t), a = ee(n);
810
+ function Co(e, t = W.value?.id ?? P.value.pages[0].id, n) {
811
+ if (H.value) return e;
812
+ let r = R.get(t)?.insertVariable(e, n), i = !P.value.variables.some((t) => t.key === e.key);
813
+ return q({
814
+ ...P.value,
815
+ pages: r ? P.value.pages.map((e) => e.id === r.id ? r : e) : P.value.pages,
816
+ variables: i ? [...P.value.variables, e] : P.value.variables
817
+ }), F.value = e.key, Q(), L.value = t, i && v("variable-add", e), mo(t), e;
818
+ }
819
+ function wo(e) {
820
+ let { width: t, height: n, ...r } = e, i = Ne(t), a = Ne(n);
722
821
  return {
723
822
  ...r,
724
823
  ...i === void 0 ? {} : { width: i },
725
824
  ...a === void 0 ? {} : { height: a }
726
825
  };
727
826
  }
728
- function Ko(e = {}) {
729
- let t = ee($i.value), n = ee(ea.value);
827
+ function To(e = {}) {
828
+ let t = Ne(Ci.value), n = Ne(wi.value);
730
829
  return {
731
830
  ...e,
732
831
  ...t === void 0 ? {} : { width: t },
733
832
  ...n === void 0 ? {} : { height: n }
734
833
  };
735
834
  }
736
- function qo() {
737
- Qi.value = "", $i.value = void 0, ea.value = void 0, ta.value = "";
835
+ function Eo() {
836
+ Si.value = "", Ci.value = void 0, wi.value = void 0, Ti.value = "";
738
837
  }
739
- function Jo(e, t = U.value?.id ?? j.value.pages[0]?.id, n) {
740
- let r = Go({
838
+ function Do(e, t = W.value?.id ?? P.value.pages[0]?.id, n) {
839
+ let r = wo({
741
840
  ...e,
742
841
  src: e.src.trim()
743
842
  });
744
- if (!(B.value || !t || !o(r.src) || !r.src || !F.get(t)?.insertContentImage(r, n))) return P.value = t, M.value = "", X(), r.src;
843
+ if (!(H.value || !t || !Ae(r.src) || !r.src || !R.get(t)?.insertContentImage(r, n))) return L.value = t, F.value = "", Q(), r.src;
745
844
  }
746
- function Yo(e) {
845
+ function Oo(e) {
747
846
  return e instanceof Error ? e : /* @__PURE__ */ Error("图片处理失败");
748
847
  }
749
- async function Xo(e, t) {
750
- t === "toolbar" && (na.value = !0, ta.value = "");
848
+ async function ko(e, t) {
849
+ t === "toolbar" && (Ei.value = !0, Ti.value = "");
751
850
  try {
752
- return (await te(e, {
851
+ return (await Pe(e, {
753
852
  source: t,
754
853
  compression: l.imageCompression,
755
854
  upload: l.imageUpload
756
855
  })).src;
757
856
  } catch (e) {
758
- let n = Yo(e);
759
- t === "toolbar" && (ta.value = n.message), ua.value = n.message, v("image-error", n, t);
857
+ let n = Oo(e);
858
+ t === "toolbar" && (Ti.value = n.message), Pi.value = n.message, v("image-error", n, t);
760
859
  return;
761
860
  } finally {
762
- t === "toolbar" && (na.value = !1);
861
+ t === "toolbar" && (Ei.value = !1);
763
862
  }
764
863
  }
765
- async function Zo(e) {
766
- return await Xo(e, "paste") ?? null;
864
+ async function Ao(e) {
865
+ return await ko(e, "paste") ?? null;
767
866
  }
768
- async function Qo(e, t = {}) {
769
- if (B.value) return;
770
- let n = U.value?.id ?? j.value.pages[0]?.id, r = n ? F.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await Xo(e, "toolbar");
771
- if (!i || !o(i)) {
772
- typeof e == "string" && (ta.value = "请输入安全的图片 URL");
867
+ async function jo(e, t = {}) {
868
+ if (H.value) return;
869
+ let n = W.value?.id ?? P.value.pages[0]?.id, r = n ? R.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await ko(e, "toolbar");
870
+ if (!i || !Ae(i)) {
871
+ typeof e == "string" && (Ti.value = "请输入安全的图片 URL");
773
872
  return;
774
873
  }
775
- let a = Jo({
874
+ let a = Do({
776
875
  ...t,
777
876
  src: i
778
877
  }, n, r);
779
- return a && (Zi.value = !1, qo(), ua.value = "已插入图片"), a;
878
+ return a && (xi.value = !1, Eo(), Pi.value = "已插入图片"), a;
780
879
  }
781
- function $o() {
782
- B.value || na.value || ($(), ta.value = "", Oi.value && (Oi.value.value = ""), Oi.value?.click());
880
+ function Mo() {
881
+ H.value || Ei.value || ($(), Ti.value = "", Br.value && (Br.value.value = ""), Br.value?.click());
783
882
  }
784
- async function es(e) {
883
+ async function No(e) {
785
884
  let t = e.target.files?.[0];
786
- t && await Qo(t, Ko({ alt: t.name }));
885
+ t && await jo(t, To({ alt: t.name }));
787
886
  }
788
- async function ts() {
789
- let e = Qi.value;
790
- await Qo(e, Ko());
887
+ async function Po() {
888
+ let e = Si.value;
889
+ await jo(e, To());
791
890
  }
792
- function ns(e) {
793
- ys(e), Xi.value = !1;
891
+ function Fo(e) {
892
+ $o(e), bi.value = !1;
794
893
  }
795
- function rs() {
796
- $(), Ro();
894
+ function Io() {
895
+ $(), _o();
797
896
  }
798
- function is(e, t, n, r) {
799
- $(), Wo(Uo({ type: t }), e, {
897
+ function Lo(e, t, n, r) {
898
+ $(), Co(So({ type: t }), e, {
800
899
  left: n,
801
900
  top: r
802
901
  });
803
902
  }
804
- function as(e) {
805
- $(), M.value = e, X();
903
+ function Ro(e) {
904
+ $(), F.value = e, Q();
806
905
  }
807
- function os(e) {
808
- let t = j.value.variables.find((t) => t.id === e.id), n = [...j.value.pages], r = t?.key ?? e.key, i = "";
809
- F.forEach((t, a) => {
906
+ function zo(e) {
907
+ let t = P.value.variables.find((t) => t.id === e.id), n = [...P.value.pages], r = t?.key ?? e.key, i = "";
908
+ R.forEach((t, a) => {
810
909
  let o = t.updateVariable(e, r);
811
910
  if (o) {
812
911
  i ||= a;
813
912
  let e = n.findIndex((e) => e.id === a);
814
913
  e >= 0 && (n[e] = o);
815
914
  }
816
- }), G({
817
- ...j.value,
915
+ }), q({
916
+ ...P.value,
818
917
  pages: n,
819
- variables: j.value.variables.map((t) => t.id === e.id ? e : t)
820
- }), M.value = e.key, Z(i || P.value);
918
+ variables: P.value.variables.map((t) => t.id === e.id ? e : t)
919
+ }), F.value = e.key, mo(i || L.value);
821
920
  }
822
- function Q(e) {
823
- V.value && os({
824
- ...V.value,
921
+ function Bo(e) {
922
+ Ui.value && zo({
923
+ ...Ui.value,
825
924
  ...e,
826
925
  style: {
827
- ...V.value.style,
926
+ ...Ui.value.style,
828
927
  ...e.style
829
928
  }
830
929
  });
831
930
  }
832
- function ss(e) {
833
- (e === "left" || e === "center" || e === "right") && Q({ style: { textAlign: e } });
931
+ function Vo(e) {
932
+ (e === "left" || e === "center" || e === "right") && Bo({ style: { textAlign: e } });
834
933
  }
835
- function cs(e) {
836
- (e === "solid" || e === "dashed") && Q({ style: { borderStyle: e } });
934
+ function Ho(e) {
935
+ (e === "solid" || e === "dashed") && Bo({ style: { borderStyle: e } });
837
936
  }
838
- function ls(e) {
839
- (e === "contain" || e === "cover" || e === "fill") && Q({ style: { objectFit: e } });
937
+ function Uo(e) {
938
+ (e === "contain" || e === "cover" || e === "fill") && Bo({ style: { objectFit: e } });
840
939
  }
841
- function us(e) {
842
- Q({ style: e });
940
+ function Wo(e) {
941
+ Bo({ style: e });
843
942
  }
844
- function ds(e) {
845
- us({ fontFamily: String(e || "").trim() || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif" });
943
+ function Go(e) {
944
+ Wo({ fontFamily: String(e || "").trim() || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif" });
846
945
  }
847
- function fs(e) {
848
- us({ fontSize: no(e, V.value?.style?.fontSize ?? 14) });
946
+ function Ko(e) {
947
+ Wo({ fontSize: Ma(e, Ui.value?.style?.fontSize ?? 14) });
849
948
  }
850
- function ps(e) {
851
- V.value && Q({
949
+ function qo(e) {
950
+ Ui.value && Bo({
852
951
  multiline: e,
853
- rows: V.value.rows || 3,
854
- lineHeight: V.value.lineHeight || 28,
952
+ rows: Ui.value.rows || 3,
953
+ lineHeight: Ui.value.lineHeight || 28,
855
954
  style: e ? { underline: !0 } : void 0
856
955
  });
857
956
  }
858
- function ms(e) {
859
- V.value && Q({
957
+ function Jo(e) {
958
+ Ui.value && Bo({
860
959
  rows: Number(e || 3),
861
- lineHeight: V.value.lineHeight || 28
960
+ lineHeight: Ui.value.lineHeight || 28
862
961
  });
863
962
  }
864
- function hs(e) {
865
- if (B.value) return;
866
- let t = [...j.value.pages];
867
- F.forEach((n, r) => {
963
+ function Yo(e) {
964
+ if (H.value) return;
965
+ let t = [...P.value.pages];
966
+ R.forEach((n, r) => {
868
967
  let i = n.removeVariable(e.key);
869
968
  if (i) {
870
969
  let e = t.findIndex((e) => e.id === r);
871
970
  e >= 0 && (t[e] = i);
872
971
  }
873
- }), G({
874
- ...j.value,
972
+ }), q({
973
+ ...P.value,
875
974
  pages: t,
876
- variables: j.value.variables.filter((t) => t.id !== e.id)
877
- }), M.value = "", N.value = "";
975
+ variables: P.value.variables.filter((t) => t.id !== e.id)
976
+ }), F.value = "", I.value = "";
878
977
  }
879
- function gs(e) {
880
- let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(j.value.variables.map((e) => e.key));
978
+ function Xo(e) {
979
+ let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(P.value.variables.map((e) => e.key));
881
980
  if (!n.has(t)) return t;
882
981
  let r = 2;
883
982
  for (; n.has(`${t}_${r}`);) r += 1;
884
983
  return `${t}_${r}`;
885
984
  }
886
- function _s(e) {
887
- B.value || Wo(De({
985
+ function Zo(e) {
986
+ H.value || Co(be({
888
987
  ...e,
889
988
  id: void 0,
890
- key: gs(`${e.key || e.type}_copy`),
989
+ key: Xo(`${e.key || e.type}_copy`),
891
990
  label: `${e.label}副本`,
892
991
  style: { ...e.style }
893
992
  }, l.variableTypes, l.defaultVariableStyle));
894
993
  }
895
- function vs(e) {
896
- return B.value ? void 0 : Wo(j.value.variables.find((t) => t.key === e.key) ?? De(e, l.variableTypes, l.defaultVariableStyle));
994
+ function Qo(e) {
995
+ return H.value ? void 0 : Co(P.value.variables.find((t) => t.key === e.key) ?? be(e, l.variableTypes, l.defaultVariableStyle));
897
996
  }
898
- function ys(e) {
899
- if (!B.value) return Wo(Uo({ type: e }));
997
+ function $o(e) {
998
+ if (!H.value) return Co(So({ type: e }));
900
999
  }
901
- function bs(e) {
902
- if (B.value || !ie(e)) return;
903
- let t = L.value, n = za.value.find((t) => t.type === e);
904
- if (!t || !n) return;
905
- let r = ne(t.leadingText) || n.label, i = re(t.selectionWidth, ci, Wa.value), a = xs();
906
- Wo(Uo({
907
- type: e,
908
- label: r,
909
- ...i ? { width: i } : {},
910
- ...a ? { style: a } : {}
911
- }), t.pageId), ua.value = t.hasSelection ? `已将选中内容替换为${n.label}控件` : `已插入${n.label}控件`, $();
1000
+ function es(t) {
1001
+ if (H.value || !e(t)) return;
1002
+ let n = z.value, r = ma.value.find((e) => e.type === t);
1003
+ if (!n || !r) return;
1004
+ let i = Fe(n.leadingText) || r.label, a = Ie(n.selectionWidth, yr, ya.value), o = ts();
1005
+ Co(So({
1006
+ type: t,
1007
+ label: i,
1008
+ ...a ? { width: a } : {},
1009
+ ...o ? { style: o } : {}
1010
+ }), n.pageId), Pi.value = n.hasSelection ? `已将选中内容替换为${r.label}控件` : `已插入${r.label}控件`, $();
912
1011
  }
913
- function xs() {
914
- let e = W.value, t = {};
1012
+ function ts() {
1013
+ let e = G.value, t = {};
915
1014
  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;
916
1015
  }
917
- function Ss(e) {
918
- if (B.value) return;
919
- let t = L.value;
920
- t && (Wo(e, t.pageId), ua.value = `已绑定到${e.label},沿用原控件尺寸`, $());
1016
+ function ns(e) {
1017
+ if (H.value) return;
1018
+ let t = z.value;
1019
+ t && (Co(e, t.pageId), Pi.value = `已绑定到${e.label},沿用原控件尺寸`, $());
921
1020
  }
922
- function Cs(e) {
923
- return ke(e.type && ie(e.type) ? e.type : "text", za.value).label;
1021
+ function rs(t) {
1022
+ return Se(t.type && e(t.type) ? t.type : "text", ma.value).label;
924
1023
  }
925
- function ws() {
926
- j.value.variables.length && (ia.value = !0, y(() => {
927
- jc(), ra.value?.querySelector(".gd-contract-template-designer__text-menu-bind-search input")?.focus();
1024
+ function is() {
1025
+ P.value.variables.length && (Oi.value = !0, y(() => {
1026
+ yc(), Di.value?.querySelector(".gd-contract-template-designer__text-menu-bind-search input")?.focus();
928
1027
  }));
929
1028
  }
930
- function Ts(e, t) {
1029
+ function as(e, t) {
931
1030
  e.dataTransfer?.setData("application/x-gd-contract-variable", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
932
1031
  }
933
- function Es(e) {
934
- return Vi.value = Math.round(Math.min(ii, Math.max(ri, Number.isFinite(e) ? e : 1)) * 100) / 100, Vi.value;
1032
+ function os(e) {
1033
+ return ui.value = Math.round(Math.min(hr, Math.max(mr, Number.isFinite(e) ? e : 1)) * 100) / 100, ui.value;
935
1034
  }
936
- let { width: Ds } = gt(xi), { width: Os } = gt(Ci), ks = d(() => Math.max(...j.value.pages.map((e) => J(e).width), be.width) + 10), As = [
937
- "table",
938
- "cleanup",
939
- "typography"
940
- ], js = S([]), Ms = /* @__PURE__ */ new Map(), Ns = 0, Ps = d(() => js.value.length > 0);
941
- function Fs(e) {
942
- return js.value.includes(e);
1035
+ let { width: ss } = Mt(Mr), { width: cs } = Mt(Pr), ls = d(() => Math.max(...P.value.pages.map((e) => X(e).width), pe.width) + 10), us = S([]), ds = /* @__PURE__ */ new Map(), fs = 0, ps = d(() => us.value.length > 0);
1036
+ function ms(e) {
1037
+ return us.value.includes(e);
943
1038
  }
944
- function Is(e, t) {
945
- let n = js.value;
946
- n.length === e.length && e.every((e) => n.includes(e)) || (js.value = e, e.length || (Gi.value = !1), !(t >= vi) && y(() => Ls(t + 1)));
1039
+ function hs(e, t) {
1040
+ let n = us.value;
1041
+ n.length === e.length && e.every((e) => n.includes(e)) || (us.value = e, e.length || (mi.value = !1), !(t >= kr) && y(() => gs(t + 1)));
947
1042
  }
948
- function Ls(e = 0) {
949
- let t = Ci.value;
1043
+ function gs(e = 0) {
1044
+ let t = Pr.value;
950
1045
  if (!t) return;
951
1046
  if (typeof window < "u" && window.matchMedia("(max-width: 760px)").matches) {
952
- Is([], e);
1047
+ hs([], e);
953
1048
  return;
954
1049
  }
955
1050
  let n = t.clientWidth;
956
1051
  if (n <= 0) return;
957
- let r = wi.value, i = 0;
1052
+ let r = Fr.value, i = 0;
958
1053
  for (let e of Array.from(t.children)) {
959
1054
  if (!(e instanceof HTMLElement)) continue;
960
1055
  if (e === r) {
961
- e.offsetWidth > 0 && (Ns = e.offsetWidth);
1056
+ e.offsetWidth > 0 && (fs = e.offsetWidth);
962
1057
  continue;
963
1058
  }
964
1059
  let t = e.dataset.toolbarOverflowKey;
965
1060
  if (t) {
966
- e.offsetWidth > 0 && Ms.set(t, e.offsetWidth);
1061
+ e.offsetWidth > 0 && ds.set(t, e.offsetWidth);
967
1062
  continue;
968
1063
  }
969
1064
  i += e.offsetWidth;
970
1065
  }
971
- let a = As.reduce((e, t) => e + (Ms.get(t) ?? 0), 0);
972
- if (i + a + _i <= n) {
973
- Is([], e);
974
- return;
975
- }
976
- let o = [], s = i + a + (Ns || gi);
977
- for (let e of As) {
978
- if (s <= n) break;
979
- o.push(e), s -= Ms.get(e) ?? 0;
980
- }
981
- Is(o, e);
982
- }
983
- at([
984
- Os,
985
- Ka,
986
- qi,
987
- qa,
988
- Ja,
989
- B
1066
+ let a = Object.fromEntries(ft.map((e) => [e, ds.get(e) ?? 0]));
1067
+ hs(pt({
1068
+ availableWidth: n,
1069
+ fixedWidth: i,
1070
+ groupWidths: a,
1071
+ moreWidth: fs || Dr,
1072
+ buffer: Or
1073
+ }), e);
1074
+ }
1075
+ St([
1076
+ cs,
1077
+ xa,
1078
+ gi,
1079
+ Sa,
1080
+ Ca,
1081
+ H
990
1082
  ], () => {
991
- y(() => Ls());
992
- }, { immediate: !0 }), nt(() => {
993
- y(() => Ls()), typeof document < "u" && document.fonts?.ready && document.fonts.ready.then(() => {
994
- Ci.value && y(() => Ls());
1083
+ y(() => gs());
1084
+ }, { immediate: !0 }), vt(() => {
1085
+ y(() => gs()), typeof document < "u" && document.fonts?.ready && document.fonts.ready.then(() => {
1086
+ Pr.value && y(() => gs());
995
1087
  });
996
1088
  });
997
- let { fitWidth: Rs, applyAutoFit: zs, markUserAdjusted: Bs } = e({
998
- viewportWidth: Ds,
999
- widestPageWidth: ks,
1089
+ let { fitWidth: _s, applyAutoFit: vs, markUserAdjusted: ys } = je({
1090
+ viewportWidth: ss,
1091
+ widestPageWidth: ls,
1000
1092
  padding: 48,
1001
- minZoom: ri,
1002
- maxZoom: ii,
1003
- getZoom: () => Vi.value,
1004
- applyZoom: Es
1093
+ minZoom: mr,
1094
+ maxZoom: hr,
1095
+ getZoom: () => ui.value,
1096
+ applyZoom: os
1005
1097
  });
1006
- function Vs(e) {
1007
- return Bs(), Es(e);
1098
+ function bs(e) {
1099
+ return ys(), os(e);
1008
1100
  }
1009
- function Hs() {
1010
- return zs();
1101
+ function xs() {
1102
+ return vs();
1011
1103
  }
1012
- function Us() {
1013
- return Vi.value;
1104
+ function Ss() {
1105
+ return ui.value;
1014
1106
  }
1015
- function Ws() {
1016
- Vs(Vi.value + ai);
1107
+ function Cs() {
1108
+ bs(ui.value + gr);
1017
1109
  }
1018
- function Gs() {
1019
- Vs(Vi.value - ai);
1110
+ function ws() {
1111
+ bs(ui.value - gr);
1020
1112
  }
1021
- function Ks(e) {
1113
+ function Ts(e) {
1022
1114
  let t = e.target instanceof HTMLElement ? e.target : null;
1023
- t && (t.closest(".gd-contract-template-designer__toolbar-more, .ant-popover, .ant-select-dropdown") || (Gi.value = !1));
1115
+ t && (t.closest(".gd-contract-template-designer__toolbar-more, .ant-popover, .ant-select-dropdown") || (mi.value = !1));
1024
1116
  }
1025
- at(Gi, (e) => {
1026
- typeof document > "u" || (e ? document.addEventListener("mousedown", Ks, !0) : document.removeEventListener("mousedown", Ks, !0));
1027
- }), tt(() => {
1028
- typeof document < "u" && document.removeEventListener("mousedown", Ks, !0);
1117
+ St(mi, (e) => {
1118
+ typeof document > "u" || (e ? document.addEventListener("mousedown", Ts, !0) : document.removeEventListener("mousedown", Ts, !0));
1119
+ }), _t(() => {
1120
+ typeof document < "u" && document.removeEventListener("mousedown", Ts, !0);
1029
1121
  });
1030
- function qs() {
1031
- $(), I.value = !1, Yi.value = !1, Gi.value = !1, Hi.value = !Hi.value;
1122
+ function Es() {
1123
+ $(), vi.value = !1, yi.value = !1, mi.value = !1, di.value = !di.value;
1032
1124
  }
1033
- function Js() {
1034
- $(), Ri.value = c(io()), Li.value = !0;
1125
+ function Ds() {
1126
+ $();
1127
+ let e = K(!1);
1128
+ k.value ? (oi.value = u(A.value), ai.value = void 0, si.value = j.value || A.value[0]?.id || "") : (ai.value = c(e), oi.value = void 0, si.value = ""), ii.value = !0;
1035
1129
  }
1036
- function Ys() {
1037
- Li.value = !1, Ri.value = void 0;
1130
+ function Os() {
1131
+ ii.value = !1, ai.value = void 0, oi.value = void 0, si.value = "";
1038
1132
  }
1039
- function Xs() {
1040
- return dc();
1133
+ function ks() {
1134
+ return Qs();
1041
1135
  }
1042
- function Zs() {
1136
+ function As() {
1043
1137
  $();
1044
- let e = Xs();
1045
- return Bi.value = JSON.stringify(e, null, 2), zi.value = !0, e;
1046
- }
1047
- function Qs() {
1048
- zi.value = !1;
1138
+ let e = ks();
1139
+ return li.value = JSON.stringify(e, null, 2), ci.value = !0, e;
1140
+ }
1141
+ function js() {
1142
+ ci.value = !1;
1143
+ }
1144
+ function Ms() {
1145
+ $(), vi.value = !1, yi.value = !1;
1146
+ let e = U.value.map(Z);
1147
+ N.value = [], M.value = {
1148
+ ...M.value,
1149
+ [j.value]: []
1150
+ };
1151
+ let t = !!I.value;
1152
+ F.value = "", I.value = "", L.value = "", ii.value = !1, ai.value = void 0, oi.value = void 0, ci.value = !1, li.value = "", hi.value = {}, ri.value = "";
1153
+ let n = q(ve(pe));
1154
+ return t && v("signing-placement-select", void 0), e.forEach((e) => v("signing-placement-remove", e)), L.value = n.pages[0]?.id ?? "", c(n);
1049
1155
  }
1050
- function $s() {
1051
- $(), I.value = !1, Yi.value = !1;
1052
- let e = H.value.map(Y);
1053
- Ai.value = [];
1054
- let t = !!N.value;
1055
- M.value = "", N.value = "", P.value = "", Li.value = !1, Ri.value = void 0, zi.value = !1, Bi.value = "", Ki.value = {}, Ii.value = "";
1056
- let n = G(Te(be));
1057
- return t && v("signing-placement-select", void 0), e.forEach((e) => v("signing-placement-remove", e)), P.value = n.pages[0]?.id ?? "", c(n);
1058
- }
1059
- function ec() {
1060
- B.value || ($(), ft.confirm({
1156
+ function Ns() {
1157
+ H.value || ($(), Ot.confirm({
1061
1158
  title: "清空合同内容",
1062
1159
  content: "将清空全部合同正文、页面、模板变量和签署位置,仅保留一个空白 A4 合同页。此操作不可撤销。",
1063
1160
  okText: "确认清空",
1064
1161
  okType: "danger",
1065
1162
  cancelText: "取消",
1066
1163
  onOk: () => {
1067
- $s();
1164
+ Ms();
1068
1165
  }
1069
1166
  }));
1070
1167
  }
1071
- function tc(e) {
1072
- let t = io().pages, n = t.find((e) => e.id === P.value);
1168
+ function Ps(e) {
1169
+ let t = Pa().pages, n = t.find((e) => e.id === L.value);
1073
1170
  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}'`));
1074
1171
  }
1075
- function nc(e) {
1076
- $(), M.value = e.key, X();
1077
- let t = tc(e);
1078
- t && (P.value = t.id, y(() => {
1079
- F.get(t.id)?.scrollIntoVariable(e.key);
1172
+ function Fs(e) {
1173
+ $(), F.value = e.key, Q();
1174
+ let t = Ps(e);
1175
+ t && (L.value = t.id, y(() => {
1176
+ R.get(t.id)?.scrollIntoVariable(e.key);
1080
1177
  }));
1081
1178
  }
1082
- function rc(e) {
1083
- let t = j.value.variables.find((t) => t.key === e || t.id === e);
1084
- t && nc(t);
1179
+ function Is(e) {
1180
+ let t = P.value.variables.find((t) => t.key === e || t.id === e);
1181
+ t && Fs(t);
1085
1182
  }
1086
- function ic(e) {
1087
- let t = H.value.find((t) => t.id === e);
1088
- t && ($(), M.value = "", P.value = t.pageId, X(t.id), y(() => {
1089
- F.get(t.pageId)?.scrollIntoSigningPlacement(t.id);
1183
+ function Ls(e) {
1184
+ let t = U.value.find((t) => t.id === e);
1185
+ t && ($(), F.value = "", L.value = t.pageId, Q(t.id), y(() => {
1186
+ R.get(t.pageId)?.scrollIntoSigningPlacement(t.id);
1090
1187
  }));
1091
1188
  }
1092
- function ac(e, t = !0) {
1093
- $(), P.value = e, t && y(() => {
1094
- F.get(e)?.scrollIntoPage();
1189
+ function Rs(e, t = !0) {
1190
+ $(), L.value = e, t && y(() => {
1191
+ R.get(e)?.scrollIntoPage();
1095
1192
  });
1096
1193
  }
1097
- function oc(e) {
1098
- j.value.pages.some((t) => t.id === e) && ac(e);
1194
+ function zs(e) {
1195
+ P.value.pages.some((t) => t.id === e) && Rs(e);
1099
1196
  }
1100
- function sc() {
1101
- return c(io());
1197
+ function Bs() {
1198
+ return c(Pa());
1102
1199
  }
1103
- function cc(e) {
1104
- Ai.value = ki(e);
1105
- let t = G(Ne(e, l.pageSize));
1106
- t.signingPlacements?.some((e) => e.id === N.value) || X(), Z(t.pages[0]?.id);
1200
+ function Vs(e) {
1201
+ N.value = Vr(e), M.value = {
1202
+ ...M.value,
1203
+ [j.value]: N.value
1204
+ };
1205
+ let t = q(Ee(e, l.pageSize));
1206
+ t.signingPlacements?.some((e) => e.id === I.value) || Q(), mo(t.pages[0]?.id);
1207
+ }
1208
+ function Hs() {
1209
+ let e = K(!1);
1210
+ return k.value ? u(A.value) : u(at(A.value, j.value, e));
1211
+ }
1212
+ function Us(e, t) {
1213
+ let n = Ur(nt(e, void 0, l.pageSize), l.pageSizeOptions), r = A.value;
1214
+ Kr.value = !0, K(!1), A.value = n.files, M.value = Hr(n.files, e), Ia(ot(A.value, t ?? j.value), !1, !0, !0, !1), JSON.stringify(r) !== JSON.stringify(A.value) && Fa(A.value, "");
1215
+ }
1216
+ function Ws(e) {
1217
+ if (H.value) return;
1218
+ Kr.value = !0, K(!0);
1219
+ let t = $e(e || `合同文件 ${A.value.length + 1}`, l.pageSize);
1220
+ return A.value = [...A.value, t], M.value = {
1221
+ ...M.value,
1222
+ [t.id]: []
1223
+ }, Fa(A.value, ""), v("file-add", u([t])[0]), Ia(t.id, !1, !0, !0), u([t])[0];
1224
+ }
1225
+ function Gs(e) {
1226
+ !k.value && !A.value.some((t) => t.id === e) || (Kr.value = !0, Ia(e));
1227
+ }
1228
+ function Ks(e, t) {
1229
+ if (H.value) return;
1230
+ Kr.value = !0, K(!1);
1231
+ let n = it(A.value, e, t), r = n.find((t) => t.id === e);
1232
+ if (r) return A.value = n, Fa(n, e), u([r])[0];
1233
+ }
1234
+ function qs(e) {
1235
+ if (H.value || A.value.length <= 1) return;
1236
+ Kr.value = !0, K(!1);
1237
+ let t = A.value.find((t) => t.id === e);
1238
+ if (!t) return;
1239
+ let n = rt(A.value, e);
1240
+ if (n.length === A.value.length) return;
1241
+ A.value = n;
1242
+ let { [e]: r, ...i } = M.value;
1243
+ M.value = i, Fa(n, ""), v("file-remove", u([t])[0]);
1244
+ let a = t.template.signingPlacements ?? [];
1245
+ return a.forEach((e) => v("signing-placement-remove", Z(e))), a.some((e) => e.id === I.value) && v("signing-placement-select", void 0), j.value === e && Ia(ot(n, n[0]?.id), !1, !0, !0, !1), u([t])[0];
1246
+ }
1247
+ function Js(e) {
1248
+ if (H.value || A.value.length <= 1) return;
1249
+ let t = A.value.find((t) => t.id === e);
1250
+ if (!t) return;
1251
+ let n = t.template.signingPlacements?.length ?? 0;
1252
+ Ot.confirm({
1253
+ title: "删除合同文件",
1254
+ content: n ? `“${t.name}”包含 ${n} 个签署位置,删除后文件内正文、变量和签署位置都会移除,是否继续?` : `删除“${t.name}”后,其正文和变量将无法恢复,是否继续?`,
1255
+ okText: "确认删除",
1256
+ okType: "danger",
1257
+ cancelText: "取消",
1258
+ onOk: () => {
1259
+ qs(e);
1260
+ }
1261
+ });
1107
1262
  }
1108
- function lc() {
1109
- let e = hc([...Ai.value, ...Ie(io(), { maxPages: Va.value })]);
1110
- return Pi.value = e, Ni.value = !0, v("validate", e), e;
1263
+ function Ys(e, t) {
1264
+ if (H.value) return;
1265
+ Kr.value = !0, K(!1);
1266
+ let n = A.value.findIndex((t) => t.id === e), r = tt(A.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
1267
+ if (!(!a || n === i)) return A.value = r, Fa(r, ""), v("file-move", u([a])[0], n, i), u([a])[0];
1111
1268
  }
1112
- function uc(e) {
1269
+ function Xs() {
1270
+ K(!1);
1271
+ let e = rc(k.value ? A.value.flatMap((e) => {
1272
+ let t = ke(e.template, { maxPages: ga.value });
1273
+ return [...M.value[e.id] ?? [], ...t].map((t) => ({
1274
+ ...t,
1275
+ fileId: e.id
1276
+ }));
1277
+ }) : [...N.value, ...ke(Pa(), { maxPages: ga.value })]);
1278
+ return ti.value = e, ei.value = !0, v("validate", e), e;
1279
+ }
1280
+ function Zs(e) {
1281
+ if (e.fileId && e.fileId !== j.value) {
1282
+ Gs(e.fileId), y(() => Zs({
1283
+ ...e,
1284
+ fileId: void 0
1285
+ }));
1286
+ return;
1287
+ }
1113
1288
  if (e.type === "signing-placement") {
1114
- let t = H.value.find((t) => t.id === e.id);
1289
+ let t = U.value.find((t) => t.id === e.id);
1115
1290
  if (t) {
1116
- ac(t.pageId), X(t.id);
1291
+ Rs(t.pageId), Q(t.id);
1117
1292
  return;
1118
1293
  }
1119
1294
  }
1120
1295
  if (e.variableKey) {
1121
- rc(e.variableKey);
1296
+ Is(e.variableKey);
1122
1297
  return;
1123
1298
  }
1124
1299
  if (e.pageId) {
1125
- oc(e.pageId);
1300
+ zs(e.pageId);
1126
1301
  return;
1127
1302
  }
1128
- let t = j.value.variables.find((t) => t.id === e.id || t.key === e.id);
1303
+ let t = P.value.variables.find((t) => t.id === e.id || t.key === e.id);
1129
1304
  if (t) {
1130
- nc(t);
1305
+ Fs(t);
1131
1306
  return;
1132
1307
  }
1133
- j.value.pages.some((t) => t.id === e.id) && ac(e.id);
1308
+ P.value.pages.some((t) => t.id === e.id) && Rs(e.id);
1309
+ }
1310
+ function Qs() {
1311
+ return xe(Pa());
1134
1312
  }
1135
- function dc() {
1136
- return Oe(io());
1313
+ function $s() {
1314
+ let e = K(!1);
1315
+ return et(k.value ? A.value : at(A.value, j.value, e));
1137
1316
  }
1138
- function fc(e) {
1139
- let t = io();
1317
+ function ec(e) {
1318
+ let n = Pa();
1140
1319
  try {
1141
- let n = Se(t, Ai.value);
1142
- if (n.length) throw new ae(n);
1143
- return e(t);
1320
+ let r = he(n, N.value);
1321
+ if (r.length) throw new t(r);
1322
+ return e(n);
1144
1323
  } catch (e) {
1145
- throw e instanceof ae && (Pi.value = [...e.errors], Ni.value = !0, v("validate", [...e.errors])), e;
1324
+ throw e instanceof t && (ti.value = [...e.errors], ei.value = !0, v("validate", [...e.errors])), e;
1146
1325
  }
1147
1326
  }
1148
- function pc(e) {
1149
- return fc((t) => ue(t, e));
1327
+ function tc(e) {
1328
+ return ec((t) => o(t, e));
1150
1329
  }
1151
- function mc(e) {
1152
- return fc((t) => le(t, e));
1330
+ function nc(e) {
1331
+ return ec((t) => a(t, e));
1153
1332
  }
1154
- function hc(e) {
1333
+ function rc(e) {
1155
1334
  let t = /* @__PURE__ */ new Set();
1156
1335
  return e.filter((e) => {
1157
- let n = `${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
1336
+ let n = `${e.fileId ?? ""}|${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
1158
1337
  return t.has(n) ? !1 : (t.add(n), !0);
1159
1338
  });
1160
1339
  }
1161
- function gc(e) {
1162
- Pi.value = [...e], Ni.value = !0;
1340
+ function ic(e) {
1341
+ ti.value = [...e], ei.value = !0;
1163
1342
  }
1164
- function _c() {
1165
- Pi.value = [], Ni.value = !1;
1343
+ function ac() {
1344
+ ti.value = [], ei.value = !1;
1166
1345
  }
1167
- function vc() {
1168
- F.get(U.value?.id ?? P.value)?.focus();
1346
+ function oc() {
1347
+ R.get(W.value?.id ?? L.value)?.focus();
1169
1348
  }
1170
- function yc(e) {
1171
- $a(e) && K({
1349
+ function sc(e) {
1350
+ ka(e) && J({
1172
1351
  type: "set-text-align",
1173
1352
  value: e
1174
1353
  });
1175
1354
  }
1176
- function bc(e) {
1355
+ function cc(e) {
1177
1356
  if (e === "paragraph") {
1178
- K({ type: "set-paragraph" });
1357
+ J({ type: "set-paragraph" });
1179
1358
  return;
1180
1359
  }
1181
- eo(e) && K({
1360
+ Aa(e) && J({
1182
1361
  type: "set-heading",
1183
1362
  level: e
1184
1363
  });
1185
1364
  }
1186
- function xc(e) {
1187
- let t = ro(e);
1188
- t && (K({
1365
+ function lc(e) {
1366
+ let t = Na(e);
1367
+ t && (J({
1189
1368
  type: "set-font-size",
1190
1369
  value: t
1191
- }), Ji.value = "");
1370
+ }), _i.value = "");
1192
1371
  }
1193
- function Sc(e) {
1372
+ function uc(e) {
1194
1373
  let t = String(e || "").trim();
1195
1374
  if (!t) {
1196
- K({ type: "unset-font-family" });
1375
+ J({ type: "unset-font-family" });
1197
1376
  return;
1198
1377
  }
1199
- K({
1378
+ J({
1200
1379
  type: "set-font-family",
1201
1380
  value: t
1202
1381
  });
1203
1382
  }
1204
- function Cc(e) {
1205
- wc(e.target?.value ?? "");
1383
+ function dc(e) {
1384
+ fc(e.target?.value ?? "");
1206
1385
  }
1207
- function wc(e) {
1386
+ function fc(e) {
1208
1387
  let t = e.trim();
1209
- t && K({
1388
+ t && J({
1210
1389
  type: "set-color",
1211
1390
  value: t
1212
1391
  });
1213
1392
  }
1214
- function Tc(e) {
1215
- Ji.value = e;
1393
+ function pc(e) {
1394
+ _i.value = e;
1216
1395
  }
1217
- function Ec() {
1218
- Ji.value.trim() && xc(Ji.value);
1396
+ function mc() {
1397
+ _i.value.trim() && lc(_i.value);
1219
1398
  }
1220
- function Dc(e) {
1221
- e.key === "Enter" && (e.preventDefault(), Ec());
1399
+ function hc(e) {
1400
+ e.key === "Enter" && (e.preventDefault(), mc());
1222
1401
  }
1223
- function Oc(e) {
1224
- e || (Ec(), Ji.value = "");
1402
+ function gc(e) {
1403
+ e || (mc(), _i.value = "");
1225
1404
  }
1226
- function kc(e) {
1227
- to(e) && (K({
1405
+ function _c(e) {
1406
+ ja(e) && (J({
1228
1407
  type: "apply-text-style-preset",
1229
1408
  preset: e
1230
- }), qi.value = void 0, $());
1409
+ }), gi.value = void 0, $());
1231
1410
  }
1232
- function Ac(e) {
1233
- if (B.value) return;
1234
- P.value = e.pageId, I.value = !1, Yi.value = !1, R.value = void 0, z.value = void 0, ia.value = !1, aa.value = "";
1235
- let t = Math.max(A, Math.min(e.clientX, window.innerWidth - fi)), n = Math.max(A, Math.min(e.clientY, window.innerHeight - pi));
1236
- L.value = {
1411
+ function vc(e) {
1412
+ if (H.value) return;
1413
+ L.value = e.pageId, vi.value = !1, yi.value = !1, B.value = void 0, V.value = void 0, Oi.value = !1, ki.value = "";
1414
+ let t = Math.max(O, Math.min(e.clientX, window.innerWidth - Cr)), n = Math.max(O, Math.min(e.clientY, window.innerHeight - wr));
1415
+ z.value = {
1237
1416
  pageId: e.pageId,
1238
1417
  x: t,
1239
1418
  y: n,
@@ -1241,113 +1420,113 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
1241
1420
  selectionWidth: e.selectionWidth,
1242
1421
  leadingText: e.leadingText
1243
1422
  }, y(() => {
1244
- jc(), ra.value?.querySelector("button:not(:disabled)")?.focus();
1423
+ yc(), Di.value?.querySelector("button:not(:disabled)")?.focus();
1245
1424
  });
1246
1425
  }
1247
- function jc() {
1248
- let e = ra.value, t = L.value;
1426
+ function yc() {
1427
+ let e = Di.value, t = z.value;
1249
1428
  if (!e || !t) return;
1250
1429
  let n = e.getBoundingClientRect();
1251
- L.value = {
1430
+ z.value = {
1252
1431
  ...t,
1253
- x: Math.max(A, Math.min(t.x, window.innerWidth - n.width - A)),
1254
- y: Math.max(A, Math.min(t.y, window.innerHeight - n.height - A))
1432
+ x: Math.max(O, Math.min(t.x, window.innerWidth - n.width - O)),
1433
+ y: Math.max(O, Math.min(t.y, window.innerHeight - n.height - O))
1255
1434
  };
1256
1435
  }
1257
- function Mc(e) {
1258
- B.value || (P.value = e.pageId, I.value = !1, Yi.value = !1, L.value = void 0, z.value = void 0, R.value = {
1436
+ function bc(e) {
1437
+ H.value || (L.value = e.pageId, vi.value = !1, yi.value = !1, z.value = void 0, V.value = void 0, B.value = {
1259
1438
  ...e,
1260
1439
  x: Math.max(8, Math.min(e.clientX, window.innerWidth - 248)),
1261
1440
  y: Math.max(8, Math.min(e.clientY, window.innerHeight - 400))
1262
1441
  }, y(() => {
1263
- let e = oa.value?.getMenuElement(), t = R.value;
1442
+ let e = Ai.value?.getMenuElement(), t = B.value;
1264
1443
  if (e && t) {
1265
1444
  let n = e.getBoundingClientRect();
1266
- R.value = {
1445
+ B.value = {
1267
1446
  ...t,
1268
1447
  x: Math.max(8, Math.min(t.x, window.innerWidth - n.width - 8)),
1269
1448
  y: Math.max(8, Math.min(t.y, window.innerHeight - n.height - 8))
1270
1449
  };
1271
1450
  }
1272
- oa.value?.focusFirstItem();
1451
+ Ai.value?.focusFirstItem();
1273
1452
  }));
1274
1453
  }
1275
- function Nc(e) {
1276
- B.value || (P.value = e.pageId, I.value = !1, Yi.value = !1, L.value = void 0, R.value = void 0, ca.value = e.image.width, la.value = e.image.height, M.value = "", N.value && X(), z.value = {
1454
+ function xc(e) {
1455
+ H.value || (L.value = e.pageId, vi.value = !1, yi.value = !1, z.value = void 0, B.value = void 0, Mi.value = e.image.width, Ni.value = e.image.height, F.value = "", I.value && Q(), V.value = {
1277
1456
  pageId: e.pageId,
1278
1457
  image: e.image,
1279
- x: Math.max(A, Math.min(e.clientX, window.innerWidth - mi)),
1280
- y: Math.max(A, Math.min(e.clientY, window.innerHeight - hi))
1458
+ x: Math.max(O, Math.min(e.clientX, window.innerWidth - Tr)),
1459
+ y: Math.max(O, Math.min(e.clientY, window.innerHeight - Er))
1281
1460
  }, y(() => {
1282
- Pc(), sa.value?.querySelector("input, button:not(:disabled)")?.focus();
1461
+ Sc(), ji.value?.querySelector("input, button:not(:disabled)")?.focus();
1283
1462
  }));
1284
1463
  }
1285
- function Pc() {
1286
- let e = sa.value, t = z.value;
1464
+ function Sc() {
1465
+ let e = ji.value, t = V.value;
1287
1466
  if (!e || !t) return;
1288
1467
  let n = e.getBoundingClientRect();
1289
- z.value = {
1468
+ V.value = {
1290
1469
  ...t,
1291
- x: Math.max(A, Math.min(t.x, window.innerWidth - n.width - A)),
1292
- y: Math.max(A, Math.min(t.y, window.innerHeight - n.height - A))
1470
+ x: Math.max(O, Math.min(t.x, window.innerWidth - n.width - O)),
1471
+ y: Math.max(O, Math.min(t.y, window.innerHeight - n.height - O))
1293
1472
  };
1294
1473
  }
1295
- function Fc() {
1296
- let e = z.value;
1297
- !e || B.value || (F.get(e.pageId)?.updateSelectedContentImage({
1298
- width: ee(ca.value),
1299
- height: ee(la.value)
1300
- }) && (ua.value = "已更新图片尺寸"), $());
1474
+ function Cc() {
1475
+ let e = V.value;
1476
+ !e || H.value || (R.get(e.pageId)?.updateSelectedContentImage({
1477
+ width: Ne(Mi.value),
1478
+ height: Ne(Ni.value)
1479
+ }) && (Pi.value = "已更新图片尺寸"), $());
1301
1480
  }
1302
- function Ic() {
1303
- let e = z.value;
1304
- !e || B.value || (F.get(e.pageId)?.updateSelectedContentImage({
1481
+ function wc() {
1482
+ let e = V.value;
1483
+ !e || H.value || (R.get(e.pageId)?.updateSelectedContentImage({
1305
1484
  width: void 0,
1306
1485
  height: void 0
1307
- }) && (ua.value = "已恢复图片自然尺寸"), $());
1486
+ }) && (Pi.value = "已恢复图片自然尺寸"), $());
1308
1487
  }
1309
- function Lc(e) {
1310
- e.type === "table" ? Mc(e) : e.type === "image" ? Nc(e) : Ac(e);
1488
+ function Tc(e) {
1489
+ e.type === "table" ? bc(e) : e.type === "image" ? xc(e) : vc(e);
1311
1490
  }
1312
1491
  function $() {
1313
- L.value = void 0, R.value = void 0, z.value = void 0, ia.value = !1, aa.value = "";
1492
+ z.value = void 0, B.value = void 0, V.value = void 0, Oi.value = !1, ki.value = "";
1314
1493
  }
1315
- function Rc(e) {
1316
- !L.value && !R.value && !z.value || (e.target instanceof HTMLElement ? e.target : null)?.closest(".gd-contract-template-designer__context-menu") || $();
1494
+ function Ec(e) {
1495
+ !z.value && !B.value && !V.value || (e.target instanceof HTMLElement ? e.target : null)?.closest(".gd-contract-template-designer__context-menu") || $();
1317
1496
  }
1318
- function zc(e) {
1319
- let t = bi.value;
1497
+ function Dc(e) {
1498
+ let t = jr.value;
1320
1499
  if (!t || typeof document > "u") return !1;
1321
1500
  let n = e.target instanceof Node ? e.target : void 0, r = document.activeElement;
1322
1501
  return !!(n && t.contains(n) || r && t.contains(r) || n instanceof Element && n.closest(".gd-contract-template-designer__context-menu"));
1323
1502
  }
1324
- function Bc(e) {
1503
+ function Oc(e) {
1325
1504
  if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "s") {
1326
- if (!ga.value || !zc(e)) return;
1327
- e.preventDefault(), oo();
1505
+ if (!Bi.value || !Dc(e)) return;
1506
+ e.preventDefault(), Ra();
1328
1507
  return;
1329
1508
  }
1330
- e.key === "Escape" && ($(), I.value = !1, Yi.value = !1, Hi.value = !1);
1509
+ e.key === "Escape" && ($(), vi.value = !1, yi.value = !1, di.value = !1);
1331
1510
  }
1332
- function Vc(e, t) {
1333
- e === P.value && t.selectedContentImage && (M.value = "", N.value && X());
1334
- let n = Ki.value[e];
1335
- n && JSON.stringify(n) === JSON.stringify(t) || (Ki.value = {
1336
- ...Ki.value,
1511
+ function kc(e, t) {
1512
+ e === L.value && t.selectedContentImage && (F.value = "", I.value && Q());
1513
+ let n = hi.value[e];
1514
+ n && JSON.stringify(n) === JSON.stringify(t) || (hi.value = {
1515
+ ...hi.value,
1337
1516
  [e]: t
1338
1517
  });
1339
1518
  }
1340
- function Hc(e = fa.value.rows, t = fa.value.cols) {
1341
- K({
1519
+ function Ac(e = Ii.value.rows, t = Ii.value.cols) {
1520
+ J({
1342
1521
  type: "insert-table",
1343
1522
  options: {
1344
1523
  rows: Math.min(10, Math.max(1, Math.round(Number(e) || 3))),
1345
1524
  cols: Math.min(10, Math.max(1, Math.round(Number(t) || 3))),
1346
- withHeaderRow: !!fa.value.withHeaderRow
1525
+ withHeaderRow: !!Ii.value.withHeaderRow
1347
1526
  }
1348
- }), I.value = !1, $();
1527
+ }), vi.value = !1, $();
1349
1528
  }
1350
- let Uc = {
1529
+ let jc = {
1351
1530
  "delete-table-row": {
1352
1531
  label: "删除当前行",
1353
1532
  countKey: "deleteRow"
@@ -1361,34 +1540,34 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
1361
1540
  countKey: "deleteTable"
1362
1541
  }
1363
1542
  };
1364
- function Wc(e) {
1365
- let t = R.value;
1543
+ function Mc(e) {
1544
+ let t = B.value;
1366
1545
  if (!t) return;
1367
1546
  let n = () => {
1368
- K(e, t.pageId), $();
1369
- }, r = Uc[e.type];
1547
+ J(e, t.pageId), $();
1548
+ }, r = jc[e.type];
1370
1549
  if (!r) {
1371
1550
  n();
1372
1551
  return;
1373
1552
  }
1374
1553
  let i = t.affectedVariableCounts[r.countKey];
1375
- $(), ft.confirm({
1554
+ $(), Ot.confirm({
1376
1555
  title: r.label,
1377
1556
  content: i ? `此操作将移除 ${i} 个正文变量节点,是否继续?` : "此操作将修改表格结构,是否继续?",
1378
1557
  okText: "确认",
1379
1558
  okType: "danger",
1380
1559
  cancelText: "取消",
1381
1560
  onOk: n,
1382
- onCancel: () => F.get(t.pageId)?.focus()
1561
+ onCancel: () => R.get(t.pageId)?.focus()
1383
1562
  });
1384
1563
  }
1385
- function Gc(e) {
1386
- let t = oa.value?.getMenuElement();
1564
+ function Nc(e) {
1565
+ let t = Ai.value?.getMenuElement();
1387
1566
  if (!t) return;
1388
1567
  if (e.key === "Escape") {
1389
1568
  e.preventDefault();
1390
- let t = R.value?.pageId;
1391
- $(), F.get(t ?? "")?.focus();
1569
+ let t = B.value?.pageId;
1570
+ $(), R.get(t ?? "")?.focus();
1392
1571
  return;
1393
1572
  }
1394
1573
  let n = Array.from(t.querySelectorAll("button:not(:disabled)"));
@@ -1406,256 +1585,205 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
1406
1585
  let r = (Math.max(0, n.indexOf(document.activeElement)) + (e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1) + n.length) % n.length;
1407
1586
  e.preventDefault(), n[r]?.focus();
1408
1587
  }
1409
- function Kc(e) {
1588
+ function Pc(e) {
1410
1589
  if (e.key !== "Escape") return;
1411
1590
  e.preventDefault();
1412
- let t = L.value?.pageId;
1413
- $(), F.get(t ?? "")?.focus();
1591
+ let t = z.value?.pageId;
1592
+ $(), R.get(t ?? "")?.focus();
1414
1593
  }
1415
- function qc(e) {
1594
+ function Fc(e) {
1416
1595
  if (e.key !== "Escape") return;
1417
1596
  e.preventDefault();
1418
- let t = z.value?.pageId;
1419
- $(), F.get(t ?? "")?.focus();
1597
+ let t = V.value?.pageId;
1598
+ $(), R.get(t ?? "")?.focus();
1420
1599
  }
1421
- function Jc(e) {
1422
- K({ type: e }), Yi.value = !1, $();
1600
+ function Ic(e) {
1601
+ J({ type: e }), yi.value = !1, $();
1423
1602
  }
1424
1603
  return Ve({
1425
- getValue: sc,
1426
- setValue: cc,
1427
- validate: lc,
1428
- exportTemplate: dc,
1429
- getSubmitData: Xs,
1430
- clearTemplate: $s,
1431
- saveDraftCache: oo,
1432
- loadDraftCache: so,
1433
- clearDraftCache: co,
1434
- getDraftCacheStatus: lo,
1435
- insertVariable: vs,
1436
- insertImage: Qo,
1437
- focus: vc,
1438
- openPreview: Js,
1439
- closePreview: Ys,
1440
- openSubmitDataViewer: Zs,
1441
- closeSubmitDataViewer: Qs,
1442
- setServerValidationErrors: gc,
1443
- clearValidationErrors: _c,
1444
- scrollToVariable: rc,
1445
- scrollToSigningPlacement: ic,
1446
- scrollToPage: oc,
1447
- setZoom: Vs,
1448
- resetZoom: Hs,
1449
- getZoom: Us,
1450
- fitWidth: Rs,
1451
- insertSigningPlacement: wo,
1452
- selectSigningPlacement: X,
1453
- buildLocationRules: pc,
1454
- buildContractLocationRules: mc
1604
+ getValue: Bs,
1605
+ setValue: Vs,
1606
+ getFiles: Hs,
1607
+ setFiles: Us,
1608
+ addFile: Ws,
1609
+ selectFile: Gs,
1610
+ renameFile: Ks,
1611
+ removeFile: qs,
1612
+ moveFile: Ys,
1613
+ validate: Xs,
1614
+ exportTemplate: Qs,
1615
+ exportFiles: $s,
1616
+ getSubmitData: ks,
1617
+ clearTemplate: Ms,
1618
+ saveDraftCache: Ra,
1619
+ loadDraftCache: za,
1620
+ clearDraftCache: Ba,
1621
+ getDraftCacheStatus: Va,
1622
+ insertVariable: Qo,
1623
+ insertImage: jo,
1624
+ focus: oc,
1625
+ openPreview: Ds,
1626
+ closePreview: Os,
1627
+ openSubmitDataViewer: As,
1628
+ closeSubmitDataViewer: js,
1629
+ setServerValidationErrors: ic,
1630
+ clearValidationErrors: ac,
1631
+ scrollToVariable: Is,
1632
+ scrollToSigningPlacement: Ls,
1633
+ scrollToPage: zs,
1634
+ setZoom: bs,
1635
+ resetZoom: xs,
1636
+ getZoom: Ss,
1637
+ fitWidth: _s,
1638
+ insertSigningPlacement: to,
1639
+ selectSigningPlacement: Q,
1640
+ buildLocationRules: tc,
1641
+ buildContractLocationRules: nc
1455
1642
  }), (e, t) => (x(), m("div", {
1456
1643
  ref_key: "designerElement",
1457
- ref: bi,
1644
+ ref: jr,
1458
1645
  class: b(["gd-contract-template-designer", {
1459
- "is-disabled": ye.disabled,
1460
- "is-readonly": B.value,
1461
- "is-fullscreen": Hi.value
1646
+ "is-disabled": fe.disabled,
1647
+ "is-readonly": H.value,
1648
+ "is-fullscreen": di.value
1462
1649
  }]),
1463
- style: et(yi.value)
1650
+ style: gt(Ar.value)
1464
1651
  }, [
1652
+ k.value ? (x(), f(lt, {
1653
+ key: 0,
1654
+ files: A.value,
1655
+ "active-file-id": j.value,
1656
+ readonly: H.value,
1657
+ onSelect: Gs,
1658
+ onAdd: t[0] ||= (e) => Ws(),
1659
+ onRename: Ks,
1660
+ onRemove: Js,
1661
+ onMove: Ys
1662
+ }, null, 8, [
1663
+ "files",
1664
+ "active-file-id",
1665
+ "readonly"
1666
+ ])) : p("", !0),
1465
1667
  h("div", { class: b(["gd-contract-template-designer__layout", {
1466
- "is-sidebar-collapsed": Ui.value,
1467
- "is-inspector-collapsed": Wi.value
1668
+ "is-sidebar-collapsed": fi.value,
1669
+ "is-inspector-collapsed": pi.value
1468
1670
  }]) }, [
1469
- h("aside", { class: b(["gd-contract-template-designer__sidebar", { "is-collapsed": Ui.value }]) }, [_(T(k), { title: Ui.value ? "展开页面栏" : "收起页面栏" }, {
1470
- default: E(() => [h("button", {
1471
- type: "button",
1472
- class: "gd-contract-template-designer__panel-handle",
1473
- "aria-label": Ui.value ? "展开页面栏" : "收起页面栏",
1474
- "aria-expanded": !Ui.value,
1475
- onClick: t[0] ||= (e) => Ui.value = !Ui.value
1476
- }, [Ui.value ? (x(), f(T(Ht), {
1477
- key: 0,
1478
- "aria-hidden": "true"
1479
- })) : (x(), f(T(Ft), {
1480
- key: 1,
1481
- "aria-hidden": "true"
1482
- }))], 8, Xt)]),
1483
- _: 1
1484
- }, 8, ["title"]), h("div", Zt, [
1485
- h("section", Qt, [
1486
- h("div", $t, [
1487
- t[81] ||= h("strong", null, "页面", -1),
1488
- _(T(ht), null, {
1489
- default: E(() => [g(w(j.value.pages.length) + " / " + w(Va.value), 1)]),
1490
- _: 1
1491
- }),
1492
- h("div", en, [_(T(k), { title: Ha.value ? `已达 ${Va.value} 页上限` : "新增页面" }, {
1493
- default: E(() => [_(T(D), {
1494
- size: "small",
1495
- class: "gd-contract-template-designer__icon-button",
1496
- disabled: B.value || Ha.value,
1497
- "aria-label": "新增页面",
1498
- onClick: Ro
1499
- }, {
1500
- default: E(() => [_(T(zt), { "aria-hidden": "true" })]),
1501
- _: 1
1502
- }, 8, ["disabled"])]),
1503
- _: 1
1504
- }, 8, ["title"])])
1505
- ]),
1506
- (x(!0), m(u, null, C(j.value.pages, (e, t) => (x(), m("div", {
1507
- key: e.id,
1508
- class: "gd-contract-template-designer__page-nav-row"
1509
- }, [h("button", {
1510
- type: "button",
1511
- class: b(["gd-contract-template-designer__nav-item", { "is-active": P.value === e.id }]),
1512
- onClick: (t) => ac(e.id)
1513
- }, [h("span", null, [g(w(e.title || `第 ${t + 1} 页`) + " ", 1), h("small", null, w(J(e).label) + " · " + w(vo(e.id).length) + " 个签署位置", 1)]), _(T(ht), null, {
1514
- default: E(() => [g(w(t + 1), 1)]),
1515
- _: 2
1516
- }, 1024)], 10, tn), h("div", nn, [_(T(k), { title: "复制页面" }, {
1517
- default: E(() => [_(T(D), {
1518
- size: "small",
1519
- class: "gd-contract-template-designer__icon-button",
1520
- disabled: B.value || Ha.value,
1521
- "aria-label": "复制页面",
1522
- onClick: (t) => zo(e)
1523
- }, {
1524
- default: E(() => [_(T(wt), { "aria-hidden": "true" })]),
1525
- _: 1
1526
- }, 8, ["disabled", "onClick"])]),
1527
- _: 2
1528
- }, 1024), _(T(k), { title: "删除页面" }, {
1529
- default: E(() => [_(T(D), {
1530
- size: "small",
1531
- danger: "",
1532
- class: "gd-contract-template-designer__icon-button",
1533
- disabled: B.value || j.value.pages.length <= 1,
1534
- "aria-label": "删除页面",
1535
- onClick: (t) => Vo(e)
1536
- }, {
1537
- default: E(() => [_(T(Et), { "aria-hidden": "true" })]),
1538
- _: 1
1539
- }, 8, ["disabled", "onClick"])]),
1540
- _: 2
1541
- }, 1024)])]))), 128)),
1542
- U.value ? (x(), m("div", rn, [Fa.value.length > 1 ? (x(), m("label", an, [t[82] ||= h("span", null, "页面格式", -1), _(T(O), {
1543
- value: La.value,
1544
- options: Ia.value,
1545
- disabled: B.value,
1546
- onChange: Mo
1547
- }, null, 8, [
1548
- "value",
1549
- "options",
1550
- "disabled"
1551
- ])])) : p("", !0), h("div", on, w(xa.value.width) + " × " + w(xa.value.height), 1)])) : p("", !0)
1552
- ]),
1553
- h("section", sn, [
1554
- h("div", cn, [t[83] ||= h("strong", null, "控件参数", -1), _(T(ht), null, {
1555
- default: E(() => [g(w(j.value.variables.length), 1)]),
1556
- _: 1
1557
- })]),
1558
- j.value.variables.length ? p("", !0) : (x(), f(T(lt), {
1559
- key: 0,
1560
- description: "暂无正文控件",
1561
- image: T(lt).PRESENTED_IMAGE_SIMPLE
1562
- }, null, 8, ["image"])),
1563
- (x(!0), m(u, null, C(j.value.variables, (e) => (x(), m("button", {
1564
- key: e.id,
1565
- type: "button",
1566
- class: b(["gd-contract-template-designer__nav-item", { "is-active": M.value === e.key }]),
1567
- onClick: (t) => nc(e)
1568
- }, [h("span", null, w(e.label), 1), h("small", null, w(e.type || "text") + " · " + w(e.key), 1)], 10, ln))), 128))
1569
- ]),
1570
- l.showSigningPlacementTools ? (x(), m("section", un, [
1571
- h("div", dn, [t[84] ||= h("strong", null, "签署位置", -1), _(T(ht), null, {
1572
- default: E(() => [g(w(ya.value.length), 1)]),
1573
- _: 1
1574
- })]),
1575
- ya.value.length ? p("", !0) : (x(), f(T(lt), {
1576
- key: 0,
1577
- description: "暂无签署位置",
1578
- image: T(lt).PRESENTED_IMAGE_SIMPLE
1579
- }, null, 8, ["image"])),
1580
- (x(!0), m(u, null, C(ya.value, (e) => (x(), m("button", {
1581
- key: e.placement.id,
1582
- type: "button",
1583
- class: b(["gd-contract-template-designer__nav-item", { "is-active": N.value === e.placement.id }]),
1584
- onClick: (t) => ic(e.placement.id)
1585
- }, [h("span", null, w(e.label), 1), h("small", null, w(e.detail) + " · x" + w(e.placement.x) + " y" + w(e.placement.y), 1)], 10, fn))), 128))
1586
- ])) : p("", !0)
1587
- ])], 2),
1671
+ _(ut, {
1672
+ collapsed: fi.value,
1673
+ pages: P.value.pages,
1674
+ variables: P.value.variables,
1675
+ "signing-placement-navigation-items": Ji.value,
1676
+ "active-page-id": L.value,
1677
+ "selected-variable-key": F.value,
1678
+ "selected-signing-placement-id": I.value,
1679
+ "normalized-max-pages": ga.value,
1680
+ "page-limit-reached": _a.value,
1681
+ "selected-page": W.value,
1682
+ "selected-page-size": Xi.value,
1683
+ "normalized-page-size-options": ua.value,
1684
+ "page-size-options": da.value,
1685
+ "selected-page-size-option-value": fa.value,
1686
+ "show-signing-placement-tools": l.showSigningPlacementTools,
1687
+ readonly: H.value,
1688
+ "get-page-size": X,
1689
+ "get-page-signing-placements": Ya,
1690
+ onToggle: t[1] ||= (e) => fi.value = !fi.value,
1691
+ onAddPage: _o,
1692
+ onActivatePage: Rs,
1693
+ onDuplicatePage: vo,
1694
+ onRemovePage: bo,
1695
+ onPatchPageFormat: lo,
1696
+ onScrollToVariable: Fs,
1697
+ onScrollToSigningPlacement: Ls
1698
+ }, null, 8, [
1699
+ "collapsed",
1700
+ "pages",
1701
+ "variables",
1702
+ "signing-placement-navigation-items",
1703
+ "active-page-id",
1704
+ "selected-variable-key",
1705
+ "selected-signing-placement-id",
1706
+ "normalized-max-pages",
1707
+ "page-limit-reached",
1708
+ "selected-page",
1709
+ "selected-page-size",
1710
+ "normalized-page-size-options",
1711
+ "page-size-options",
1712
+ "selected-page-size-option-value",
1713
+ "show-signing-placement-tools",
1714
+ "readonly"
1715
+ ]),
1588
1716
  h("main", {
1589
1717
  ref_key: "workspaceElement",
1590
- ref: Si,
1718
+ ref: Nr,
1591
1719
  class: "gd-contract-template-designer__workspace"
1592
1720
  }, [
1593
- h("header", pn, [h("div", mn, [h("strong", null, w(wa.value), 1), ye.showDraftCacheStatus && Ta.value ? (x(), m("small", {
1721
+ h("header", dn, [h("div", fn, [h("strong", null, C($i.value), 1), fe.showDraftCacheStatus && ea.value ? (x(), m("small", {
1594
1722
  key: 0,
1595
- class: b(["gd-contract-template-designer__draft-cache-status", Ea.value])
1596
- }, w(Ta.value), 3)) : p("", !0)]), h("div", hn, [h("div", gn, [h("div", _n, [
1597
- _(T(k), { title: "缩小" }, {
1598
- default: E(() => [_(T(D), {
1723
+ class: b(["gd-contract-template-designer__draft-cache-status", ta.value])
1724
+ }, C(ea.value), 3)) : p("", !0)]), h("div", pn, [h("div", mn, [h("div", hn, [
1725
+ _(w(D), { title: "缩小" }, {
1726
+ default: T(() => [_(w(E), {
1599
1727
  size: "small",
1600
1728
  class: "gd-contract-template-designer__icon-button",
1601
- disabled: Vi.value <= ri,
1729
+ disabled: ui.value <= mr,
1602
1730
  "aria-label": "缩小",
1603
- onClick: Gs
1731
+ onClick: ws
1604
1732
  }, {
1605
- default: E(() => [_(T(Yt), { "aria-hidden": "true" })]),
1733
+ default: T(() => [_(w(un), { "aria-hidden": "true" })]),
1606
1734
  _: 1
1607
1735
  }, 8, ["disabled"])]),
1608
1736
  _: 1
1609
1737
  }),
1610
- h("span", null, w(Da.value), 1),
1611
- _(T(k), { title: "放大" }, {
1612
- default: E(() => [_(T(D), {
1738
+ h("span", null, C(na.value), 1),
1739
+ _(w(D), { title: "放大" }, {
1740
+ default: T(() => [_(w(E), {
1613
1741
  size: "small",
1614
1742
  class: "gd-contract-template-designer__icon-button",
1615
- disabled: Vi.value >= ii,
1743
+ disabled: ui.value >= hr,
1616
1744
  "aria-label": "放大",
1617
- onClick: Ws
1745
+ onClick: Cs
1618
1746
  }, {
1619
- default: E(() => [_(T(Jt), { "aria-hidden": "true" })]),
1747
+ default: T(() => [_(w(ln), { "aria-hidden": "true" })]),
1620
1748
  _: 1
1621
1749
  }, 8, ["disabled"])]),
1622
1750
  _: 1
1623
1751
  }),
1624
- _(T(k), { title: "适应宽度" }, {
1625
- default: E(() => [_(T(D), {
1752
+ _(w(D), { title: "适应宽度" }, {
1753
+ default: T(() => [_(w(E), {
1626
1754
  size: "small",
1627
1755
  class: "gd-contract-template-designer__icon-button",
1628
1756
  "aria-label": "适应宽度",
1629
- onClick: T(Rs)
1757
+ onClick: w(_s)
1630
1758
  }, {
1631
- default: E(() => [_(T(Ct), { "aria-hidden": "true" })]),
1759
+ default: T(() => [_(w(zt), { "aria-hidden": "true" })]),
1632
1760
  _: 1
1633
1761
  }, 8, ["onClick"])]),
1634
1762
  _: 1
1635
1763
  }),
1636
- _(T(k), { title: "重置缩放" }, {
1637
- default: E(() => [_(T(D), {
1764
+ _(w(D), { title: "重置缩放" }, {
1765
+ default: T(() => [_(w(E), {
1638
1766
  size: "small",
1639
1767
  class: "gd-contract-template-designer__icon-button",
1640
1768
  "aria-label": "重置缩放",
1641
- onClick: Hs
1769
+ onClick: xs
1642
1770
  }, {
1643
- default: E(() => [_(T(Vt), { "aria-hidden": "true" })]),
1771
+ default: T(() => [_(w(nn), { "aria-hidden": "true" })]),
1644
1772
  _: 1
1645
1773
  })]),
1646
1774
  _: 1
1647
1775
  }),
1648
- _(T(k), { title: Hi.value ? "退出全屏" : "全屏显示" }, {
1649
- default: E(() => [_(T(D), {
1776
+ _(w(D), { title: di.value ? "退出全屏" : "全屏显示" }, {
1777
+ default: T(() => [_(w(E), {
1650
1778
  size: "small",
1651
1779
  class: "gd-contract-template-designer__icon-button",
1652
- "aria-label": Hi.value ? "退出全屏" : "全屏显示",
1653
- onClick: qs
1780
+ "aria-label": di.value ? "退出全屏" : "全屏显示",
1781
+ onClick: Es
1654
1782
  }, {
1655
- default: E(() => [Hi.value ? (x(), f(T(Mt), {
1783
+ default: T(() => [di.value ? (x(), f(w(Jt), {
1656
1784
  key: 0,
1657
1785
  "aria-hidden": "true"
1658
- })) : (x(), f(T(Nt), {
1786
+ })) : (x(), f(w(Yt), {
1659
1787
  key: 1,
1660
1788
  "aria-hidden": "true"
1661
1789
  }))]),
@@ -1663,251 +1791,254 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
1663
1791
  }, 8, ["aria-label"])]),
1664
1792
  _: 1
1665
1793
  }, 8, ["title"])
1666
- ])]), h("div", vn, [
1667
- ye.showClearButton ? (x(), f(T(k), {
1794
+ ])]), h("div", gn, [
1795
+ fe.showClearButton ? (x(), f(w(D), {
1668
1796
  key: 0,
1669
1797
  title: "清空合同"
1670
1798
  }, {
1671
- default: E(() => [_(T(D), {
1799
+ default: T(() => [_(w(E), {
1672
1800
  size: "small",
1673
1801
  danger: "",
1674
1802
  class: "gd-contract-template-designer__icon-button",
1675
- disabled: B.value,
1803
+ disabled: H.value,
1676
1804
  "aria-label": "清空合同",
1677
- onClick: ec
1805
+ onClick: Ns
1678
1806
  }, {
1679
- default: E(() => [_(T(Et), { "aria-hidden": "true" })]),
1807
+ default: T(() => [_(w(Ht), { "aria-hidden": "true" })]),
1680
1808
  _: 1
1681
1809
  }, 8, ["disabled"])]),
1682
1810
  _: 1
1683
1811
  })) : p("", !0),
1684
- _(T(k), { title: "校验" }, {
1685
- default: E(() => [_(T(D), {
1812
+ _(w(D), { title: "校验" }, {
1813
+ default: T(() => [_(w(E), {
1686
1814
  size: "small",
1687
1815
  class: "gd-contract-template-designer__icon-button",
1688
1816
  "aria-label": "校验",
1689
- onClick: lc
1817
+ onClick: Xs
1690
1818
  }, {
1691
- default: E(() => [_(T(bt), { "aria-hidden": "true" })]),
1819
+ default: T(() => [_(w(It), { "aria-hidden": "true" })]),
1692
1820
  _: 1
1693
1821
  })]),
1694
1822
  _: 1
1695
1823
  }),
1696
- _(T(k), { title: "预览" }, {
1697
- default: E(() => [_(T(D), {
1824
+ _(w(D), { title: "预览" }, {
1825
+ default: T(() => [_(w(E), {
1698
1826
  size: "small",
1699
1827
  type: "primary",
1700
1828
  class: "gd-contract-template-designer__icon-button",
1701
1829
  "aria-label": "预览",
1702
- onClick: Js
1830
+ onClick: Ds
1703
1831
  }, {
1704
- default: E(() => [_(T(kt), { "aria-hidden": "true" })]),
1832
+ default: T(() => [_(w(Gt), { "aria-hidden": "true" })]),
1705
1833
  _: 1
1706
1834
  })]),
1707
1835
  _: 1
1708
1836
  }),
1709
- ye.showSubmitDataViewer ? (x(), f(T(k), {
1837
+ fe.showSubmitDataViewer ? (x(), f(w(D), {
1710
1838
  key: 1,
1711
1839
  title: "数据查看"
1712
1840
  }, {
1713
- default: E(() => [_(T(D), {
1841
+ default: T(() => [_(w(E), {
1714
1842
  size: "small",
1715
1843
  class: "gd-contract-template-designer__icon-button",
1716
1844
  "aria-label": "数据查看",
1717
- onClick: Zs
1845
+ onClick: As
1718
1846
  }, {
1719
- default: E(() => [_(T(Tt), { "aria-hidden": "true" })]),
1847
+ default: T(() => [_(w(Vt), { "aria-hidden": "true" })]),
1720
1848
  _: 1
1721
1849
  })]),
1722
1850
  _: 1
1723
1851
  })) : p("", !0)
1724
1852
  ])])]),
1725
- h("header", yn, [h("div", {
1853
+ h("header", _n, [h("div", {
1726
1854
  ref_key: "toolbarMainElement",
1727
- ref: Ci,
1855
+ ref: Pr,
1728
1856
  class: "gd-contract-template-designer__toolbar-section gd-contract-template-designer__toolbar-section--main"
1729
1857
  }, [
1730
- h("div", bn, [_(T(k), { title: "撤销" }, {
1731
- default: E(() => [_(T(D), {
1858
+ h("div", vn, [_(w(D), { title: "撤销" }, {
1859
+ default: T(() => [_(w(E), {
1732
1860
  size: "small",
1733
1861
  class: "gd-contract-template-designer__icon-button",
1734
- disabled: B.value || !W.value.canUndo,
1862
+ disabled: H.value || !G.value.canUndo,
1735
1863
  "aria-label": "撤销",
1736
- onClick: t[1] ||= (e) => K({ type: "undo" })
1864
+ onClick: t[2] ||= (e) => J({ type: "undo" })
1737
1865
  }, {
1738
- default: E(() => [_(T(Kt), { "aria-hidden": "true" })]),
1866
+ default: T(() => [_(w(sn), { "aria-hidden": "true" })]),
1739
1867
  _: 1
1740
1868
  }, 8, ["disabled"])]),
1741
1869
  _: 1
1742
- }), _(T(k), { title: "重做" }, {
1743
- default: E(() => [_(T(D), {
1870
+ }), _(w(D), { title: "重做" }, {
1871
+ default: T(() => [_(w(E), {
1744
1872
  size: "small",
1745
1873
  class: "gd-contract-template-designer__icon-button",
1746
- disabled: B.value || !W.value.canRedo,
1874
+ disabled: H.value || !G.value.canRedo,
1747
1875
  "aria-label": "重做",
1748
- onClick: t[2] ||= (e) => K({ type: "redo" })
1876
+ onClick: t[3] ||= (e) => J({ type: "redo" })
1749
1877
  }, {
1750
- default: E(() => [_(T(Bt), { "aria-hidden": "true" })]),
1878
+ default: T(() => [_(w(tn), { "aria-hidden": "true" })]),
1751
1879
  _: 1
1752
1880
  }, 8, ["disabled"])]),
1753
1881
  _: 1
1754
1882
  })]),
1755
- h("div", xn, [_(T(O), {
1756
- value: qi.value,
1757
- "onUpdate:value": t[3] ||= (e) => qi.value = e,
1883
+ h("div", yn, [_(w(At), {
1884
+ value: gi.value,
1885
+ "onUpdate:value": t[4] ||= (e) => gi.value = e,
1758
1886
  class: "gd-contract-template-designer__toolbar-select",
1759
- options: Aa.value,
1887
+ options: aa.value,
1760
1888
  placeholder: "合同样式",
1761
- disabled: B.value,
1762
- onChange: kc
1889
+ disabled: H.value,
1890
+ onChange: _c
1763
1891
  }, null, 8, [
1764
1892
  "value",
1765
1893
  "options",
1766
1894
  "disabled"
1767
- ]), _(T(O), {
1895
+ ]), _(w(At), {
1768
1896
  class: "gd-contract-template-designer__toolbar-select",
1769
- value: Ka.value,
1770
- options: Ma,
1771
- disabled: B.value,
1772
- onChange: bc
1897
+ value: xa.value,
1898
+ options: sa,
1899
+ disabled: H.value,
1900
+ onChange: cc
1773
1901
  }, null, 8, ["value", "disabled"])]),
1774
- h("div", Sn, [
1775
- _(T(k), { title: "加粗" }, {
1776
- default: E(() => [_(T(D), {
1902
+ h("div", bn, [
1903
+ _(w(D), { title: "加粗" }, {
1904
+ default: T(() => [_(w(E), {
1777
1905
  size: "small",
1778
1906
  class: "gd-contract-template-designer__icon-button",
1779
- type: W.value.isBold ? "primary" : "default",
1780
- disabled: B.value,
1907
+ type: G.value.isBold ? "primary" : "default",
1908
+ disabled: H.value,
1781
1909
  "aria-label": "加粗",
1782
- onClick: t[4] ||= (e) => K({ type: "toggle-bold" })
1910
+ onClick: t[5] ||= (e) => J({ type: "toggle-bold" })
1783
1911
  }, {
1784
- default: E(() => [_(T(xt), { "aria-hidden": "true" })]),
1912
+ default: T(() => [_(w(Lt), { "aria-hidden": "true" })]),
1785
1913
  _: 1
1786
1914
  }, 8, ["type", "disabled"])]),
1787
1915
  _: 1
1788
1916
  }),
1789
- _(T(k), { title: "斜体" }, {
1790
- default: E(() => [_(T(D), {
1917
+ _(w(D), { title: "斜体" }, {
1918
+ default: T(() => [_(w(E), {
1791
1919
  size: "small",
1792
1920
  class: "gd-contract-template-designer__icon-button",
1793
- type: W.value.isItalic ? "primary" : "default",
1794
- disabled: B.value,
1921
+ type: G.value.isItalic ? "primary" : "default",
1922
+ disabled: H.value,
1795
1923
  "aria-label": "斜体",
1796
- onClick: t[5] ||= (e) => K({ type: "toggle-italic" })
1924
+ onClick: t[6] ||= (e) => J({ type: "toggle-italic" })
1797
1925
  }, {
1798
- default: E(() => [_(T(Pt), { "aria-hidden": "true" })]),
1926
+ default: T(() => [_(w(Xt), { "aria-hidden": "true" })]),
1799
1927
  _: 1
1800
1928
  }, 8, ["type", "disabled"])]),
1801
1929
  _: 1
1802
1930
  }),
1803
- _(T(k), { title: "下划线" }, {
1804
- default: E(() => [_(T(D), {
1931
+ _(w(D), { title: "下划线" }, {
1932
+ default: T(() => [_(w(E), {
1805
1933
  size: "small",
1806
1934
  class: "gd-contract-template-designer__icon-button",
1807
- type: W.value.isUnderline ? "primary" : "default",
1808
- disabled: B.value,
1935
+ type: G.value.isUnderline ? "primary" : "default",
1936
+ disabled: H.value,
1809
1937
  "aria-label": "下划线",
1810
- onClick: t[6] ||= (e) => K({ type: "toggle-underline" })
1938
+ onClick: t[7] ||= (e) => J({ type: "toggle-underline" })
1811
1939
  }, {
1812
- default: E(() => [_(T(Gt), { "aria-hidden": "true" })]),
1940
+ default: T(() => [_(w(on), { "aria-hidden": "true" })]),
1813
1941
  _: 1
1814
1942
  }, 8, ["type", "disabled"])]),
1815
1943
  _: 1
1816
1944
  }),
1817
- _(T(k), { title: "编号列表" }, {
1818
- default: E(() => [_(T(D), {
1945
+ _(w(D), { title: "编号列表" }, {
1946
+ default: T(() => [_(w(E), {
1819
1947
  size: "small",
1820
1948
  class: "gd-contract-template-designer__icon-button",
1821
- type: W.value.isOrderedList ? "primary" : "default",
1822
- disabled: B.value,
1949
+ type: G.value.isOrderedList ? "primary" : "default",
1950
+ disabled: H.value,
1823
1951
  "aria-label": "编号列表",
1824
- onClick: t[7] ||= (e) => K({ type: "toggle-ordered-list" })
1952
+ onClick: t[8] ||= (e) => J({ type: "toggle-ordered-list" })
1825
1953
  }, {
1826
- default: E(() => [_(T(Lt), { "aria-hidden": "true" })]),
1954
+ default: T(() => [_(w(Qt), { "aria-hidden": "true" })]),
1827
1955
  _: 1
1828
1956
  }, 8, ["type", "disabled"])]),
1829
1957
  _: 1
1830
1958
  }),
1831
- _(T(k), { title: "项目列表" }, {
1832
- default: E(() => [_(T(D), {
1959
+ _(w(D), { title: "项目列表" }, {
1960
+ default: T(() => [_(w(E), {
1833
1961
  size: "small",
1834
1962
  class: "gd-contract-template-designer__icon-button",
1835
- type: W.value.isBulletList ? "primary" : "default",
1836
- disabled: B.value,
1963
+ type: G.value.isBulletList ? "primary" : "default",
1964
+ disabled: H.value,
1837
1965
  "aria-label": "项目列表",
1838
- onClick: t[8] ||= (e) => K({ type: "toggle-bullet-list" })
1966
+ onClick: t[9] ||= (e) => J({ type: "toggle-bullet-list" })
1839
1967
  }, {
1840
- default: E(() => [_(T(qt), { "aria-hidden": "true" })]),
1968
+ default: T(() => [_(w(cn), { "aria-hidden": "true" })]),
1841
1969
  _: 1
1842
1970
  }, 8, ["type", "disabled"])]),
1843
1971
  _: 1
1844
1972
  })
1845
1973
  ]),
1846
- h("div", Cn, [
1847
- _(T(pt), {
1848
- open: Xi.value,
1849
- "onUpdate:open": t[9] ||= (e) => Xi.value = e,
1974
+ (x(), f(ht, {
1975
+ disabled: !ms("insert") || !Ir.value,
1976
+ to: Ir.value || "body"
1977
+ }, [h("div", xn, [
1978
+ _(w(kt), {
1979
+ open: bi.value,
1980
+ "onUpdate:open": t[10] ||= (e) => bi.value = e,
1850
1981
  trigger: "click",
1851
1982
  placement: "bottom"
1852
1983
  }, {
1853
- content: E(() => [h("div", wn, [t[85] ||= h("strong", null, "插入正文控件", -1), h("div", Tn, [(x(!0), m(u, null, C(Ba.value, (e) => (x(), f(T(k), {
1984
+ content: T(() => [h("div", Sn, [t[62] ||= h("strong", null, "插入正文控件", -1), h("div", Cn, [(x(!0), m(mt, null, yt(ha.value, (e) => (x(), f(w(D), {
1854
1985
  key: e.type,
1855
1986
  title: `插入${e.label}控件`
1856
1987
  }, {
1857
- default: E(() => [h("button", {
1988
+ default: T(() => [h("button", {
1858
1989
  type: "button",
1859
1990
  class: "gd-contract-template-designer__text-menu-control-option",
1860
1991
  "aria-label": `插入${e.label}控件`,
1861
- onClick: (t) => ns(e.type)
1862
- }, [(x(), f(rt(e.icon), { "aria-hidden": "true" })), h("span", null, w(e.label), 1)], 8, En)]),
1992
+ onClick: (t) => Fo(e.type)
1993
+ }, [(x(), f(bt(e.icon), { "aria-hidden": "true" })), h("span", null, C(e.label), 1)], 8, wn)]),
1863
1994
  _: 2
1864
1995
  }, 1032, ["title"]))), 128))])])]),
1865
- default: E(() => [_(T(k), { title: "插入正文控件" }, {
1866
- default: E(() => [_(T(D), {
1996
+ default: T(() => [_(w(D), { title: "插入正文控件" }, {
1997
+ default: T(() => [_(w(E), {
1867
1998
  size: "small",
1868
1999
  class: "gd-contract-template-designer__icon-button",
1869
- disabled: B.value,
2000
+ disabled: H.value,
1870
2001
  "aria-label": "插入正文控件"
1871
2002
  }, {
1872
- default: E(() => [_(T(zt), { "aria-hidden": "true" })]),
2003
+ default: T(() => [_(w(en), { "aria-hidden": "true" })]),
1873
2004
  _: 1
1874
2005
  }, 8, ["disabled"])]),
1875
2006
  _: 1
1876
2007
  })]),
1877
2008
  _: 1
1878
2009
  }, 8, ["open"]),
1879
- _(T(pt), {
1880
- open: Zi.value,
1881
- "onUpdate:open": t[13] ||= (e) => Zi.value = e,
2010
+ _(w(kt), {
2011
+ open: xi.value,
2012
+ "onUpdate:open": t[14] ||= (e) => xi.value = e,
1882
2013
  trigger: "click",
1883
2014
  placement: "bottom"
1884
2015
  }, {
1885
- content: E(() => [h("div", Dn, [
1886
- t[90] ||= h("strong", null, "插入正文图片", -1),
1887
- _(T(D), {
2016
+ content: T(() => [h("div", Tn, [
2017
+ t[67] ||= h("strong", null, "插入正文图片", -1),
2018
+ _(w(E), {
1888
2019
  block: "",
1889
- loading: na.value,
1890
- disabled: B.value,
1891
- onClick: $o
2020
+ loading: Ei.value,
2021
+ disabled: H.value,
2022
+ onClick: Mo
1892
2023
  }, {
1893
- default: E(() => [_(T(Rt), { "aria-hidden": "true" }), t[86] ||= g(" 本地图片 ", -1)]),
2024
+ default: T(() => [_(w($t), { "aria-hidden": "true" }), t[63] ||= g(" 本地图片 ", -1)]),
1894
2025
  _: 1
1895
2026
  }, 8, ["loading", "disabled"]),
1896
- _(T(ut), {
1897
- value: Qi.value,
1898
- "onUpdate:value": t[10] ||= (e) => Qi.value = e,
2027
+ _(w(Et), {
2028
+ value: Si.value,
2029
+ "onUpdate:value": t[11] ||= (e) => Si.value = e,
1899
2030
  "allow-clear": "",
1900
- disabled: B.value || na.value,
2031
+ disabled: H.value || Ei.value,
1901
2032
  placeholder: "https:// 或 data:image/...",
1902
2033
  "aria-label": "图片 URL",
1903
- onPressEnter: ts
2034
+ onPressEnter: Po
1904
2035
  }, null, 8, ["value", "disabled"]),
1905
- h("div", On, [h("label", null, [t[87] ||= h("span", null, "宽度", -1), _(T(dt), {
1906
- value: $i.value,
1907
- "onUpdate:value": t[11] ||= (e) => $i.value = e,
1908
- min: T(16),
1909
- max: T(s),
1910
- disabled: B.value || na.value,
2036
+ h("div", En, [h("label", null, [t[64] ||= h("span", null, "宽度", -1), _(w(Dt), {
2037
+ value: Ci.value,
2038
+ "onUpdate:value": t[12] ||= (e) => Ci.value = e,
2039
+ min: w(16),
2040
+ max: w(Me),
2041
+ disabled: H.value || Ei.value,
1911
2042
  placeholder: "自然",
1912
2043
  "aria-label": "图片宽度"
1913
2044
  }, null, 8, [
@@ -1915,12 +2046,12 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
1915
2046
  "min",
1916
2047
  "max",
1917
2048
  "disabled"
1918
- ])]), h("label", null, [t[88] ||= h("span", null, "高度", -1), _(T(dt), {
1919
- value: ea.value,
1920
- "onUpdate:value": t[12] ||= (e) => ea.value = e,
1921
- min: T(16),
1922
- max: T(s),
1923
- disabled: B.value || na.value,
2049
+ ])]), h("label", null, [t[65] ||= h("span", null, "高度", -1), _(w(Dt), {
2050
+ value: wi.value,
2051
+ "onUpdate:value": t[13] ||= (e) => wi.value = e,
2052
+ min: w(16),
2053
+ max: w(Me),
2054
+ disabled: H.value || Ei.value,
1924
2055
  placeholder: "自然",
1925
2056
  "aria-label": "图片高度"
1926
2057
  }, null, 8, [
@@ -1929,91 +2060,91 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
1929
2060
  "max",
1930
2061
  "disabled"
1931
2062
  ])])]),
1932
- _(T(D), {
2063
+ _(w(E), {
1933
2064
  type: "primary",
1934
2065
  block: "",
1935
- disabled: B.value || na.value || !Qi.value.trim(),
1936
- onClick: ts
2066
+ disabled: H.value || Ei.value || !Si.value.trim(),
2067
+ onClick: Po
1937
2068
  }, {
1938
- default: E(() => [...t[89] ||= [g(" 插入 URL ", -1)]]),
2069
+ default: T(() => [...t[66] ||= [g(" 插入 URL ", -1)]]),
1939
2070
  _: 1
1940
2071
  }, 8, ["disabled"]),
1941
- ta.value ? (x(), f(T(ct), {
2072
+ Ti.value ? (x(), f(w(Tt), {
1942
2073
  key: 0,
1943
2074
  type: "error",
1944
2075
  "show-icon": "",
1945
- message: ta.value
2076
+ message: Ti.value
1946
2077
  }, null, 8, ["message"])) : p("", !0)
1947
2078
  ])]),
1948
- default: E(() => [_(T(k), { title: "插入图片" }, {
1949
- default: E(() => [_(T(D), {
2079
+ default: T(() => [_(w(D), { title: "插入图片" }, {
2080
+ default: T(() => [_(w(E), {
1950
2081
  size: "small",
1951
2082
  class: "gd-contract-template-designer__icon-button",
1952
- disabled: B.value,
2083
+ disabled: H.value,
1953
2084
  "aria-label": "插入图片"
1954
2085
  }, {
1955
- default: E(() => [_(T(Rt), { "aria-hidden": "true" })]),
2086
+ default: T(() => [_(w($t), { "aria-hidden": "true" })]),
1956
2087
  _: 1
1957
2088
  }, 8, ["disabled"])]),
1958
2089
  _: 1
1959
2090
  })]),
1960
2091
  _: 1
1961
2092
  }, 8, ["open"]),
1962
- _(T(k), { title: "插入分隔线" }, {
1963
- default: E(() => [_(T(D), {
2093
+ _(w(D), { title: "插入分隔线" }, {
2094
+ default: T(() => [_(w(E), {
1964
2095
  size: "small",
1965
2096
  class: "gd-contract-template-designer__icon-button",
1966
- disabled: B.value,
2097
+ disabled: H.value,
1967
2098
  "aria-label": "插入分隔线",
1968
- onClick: t[14] ||= (e) => K({ type: "insert-horizontal-rule" })
2099
+ onClick: t[15] ||= (e) => J({ type: "insert-horizontal-rule" })
1969
2100
  }, {
1970
- default: E(() => [_(T(It), { "aria-hidden": "true" })]),
2101
+ default: T(() => [_(w(Zt), { "aria-hidden": "true" })]),
1971
2102
  _: 1
1972
2103
  }, 8, ["disabled"])]),
1973
2104
  _: 1
1974
2105
  }),
1975
- _(T(k), { title: Ha.value ? `已达 ${Va.value} 页上限` : "新增页面" }, {
1976
- default: E(() => [_(T(D), {
2106
+ _(w(D), { title: _a.value ? `已达 ${ga.value} 页上限` : "新增页面" }, {
2107
+ default: T(() => [_(w(E), {
1977
2108
  size: "small",
1978
2109
  class: "gd-contract-template-designer__icon-button",
1979
- disabled: B.value || Ha.value,
2110
+ disabled: H.value || _a.value,
1980
2111
  "aria-label": "新增页面",
1981
- onClick: Ro
2112
+ onClick: _o
1982
2113
  }, {
1983
- default: E(() => [_(T(At), { "aria-hidden": "true" })]),
2114
+ default: T(() => [_(w(Kt), { "aria-hidden": "true" })]),
1984
2115
  _: 1
1985
2116
  }, 8, ["disabled"])]),
1986
2117
  _: 1
1987
2118
  }, 8, ["title"])
1988
- ]),
1989
- (x(), f($e, {
1990
- disabled: !Fs("typography") || !Ti.value,
1991
- to: Ti.value || "body"
1992
- }, [h("div", kn, [
1993
- _(T(O), {
2119
+ ])], 8, ["disabled", "to"])),
2120
+ (x(), f(ht, {
2121
+ disabled: !ms("typography") || !Lr.value,
2122
+ to: Lr.value || "body"
2123
+ }, [h("div", Dn, [
2124
+ _(w(At), {
1994
2125
  class: "gd-contract-template-designer__toolbar-select is-wide",
1995
- value: qa.value,
1996
- options: ka.value,
1997
- disabled: B.value,
1998
- onChange: Sc
2126
+ value: Sa.value,
2127
+ options: ia.value,
2128
+ disabled: H.value,
2129
+ onChange: uc
1999
2130
  }, null, 8, [
2000
2131
  "value",
2001
2132
  "options",
2002
2133
  "disabled"
2003
2134
  ]),
2004
- _(T(O), {
2135
+ _(w(At), {
2005
2136
  class: "gd-contract-template-designer__toolbar-select",
2006
- value: Ja.value,
2007
- options: Za.value,
2137
+ value: Ca.value,
2138
+ options: Ea.value,
2008
2139
  "show-search": "",
2009
2140
  "filter-option": !1,
2010
- "search-value": Ji.value,
2011
- disabled: B.value,
2012
- onBlur: Ec,
2013
- onChange: xc,
2014
- onDropdownVisibleChange: Oc,
2015
- onInputKeyDown: Dc,
2016
- onSearch: Tc
2141
+ "search-value": _i.value,
2142
+ disabled: H.value,
2143
+ onBlur: mc,
2144
+ onChange: lc,
2145
+ onDropdownVisibleChange: gc,
2146
+ onInputKeyDown: hc,
2147
+ onSearch: pc
2017
2148
  }, null, 8, [
2018
2149
  "value",
2019
2150
  "options",
@@ -2023,20 +2154,20 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
2023
2154
  h("input", {
2024
2155
  class: "gd-contract-template-designer__color",
2025
2156
  type: "color",
2026
- value: Ya.value,
2027
- disabled: B.value,
2028
- onInput: Cc
2029
- }, null, 40, An),
2030
- _(T(k), { title: "左对齐" }, {
2031
- default: E(() => [_(T(D), {
2157
+ value: wa.value,
2158
+ disabled: H.value,
2159
+ onInput: dc
2160
+ }, null, 40, On),
2161
+ _(w(D), { title: "左对齐" }, {
2162
+ default: T(() => [_(w(E), {
2032
2163
  size: "small",
2033
- class: b(["gd-contract-template-designer__icon-button", { "is-selected": W.value.textAlign === "left" }]),
2034
- type: W.value.textAlign === "left" ? "primary" : "default",
2035
- disabled: B.value,
2164
+ class: b(["gd-contract-template-designer__icon-button", { "is-selected": G.value.textAlign === "left" }]),
2165
+ type: G.value.textAlign === "left" ? "primary" : "default",
2166
+ disabled: H.value,
2036
2167
  "aria-label": "左对齐",
2037
- onClick: t[15] ||= (e) => yc("left")
2168
+ onClick: t[16] ||= (e) => sc("left")
2038
2169
  }, {
2039
- default: E(() => [_(T(vt), { "aria-hidden": "true" })]),
2170
+ default: T(() => [_(w(Pt), { "aria-hidden": "true" })]),
2040
2171
  _: 1
2041
2172
  }, 8, [
2042
2173
  "class",
@@ -2045,16 +2176,16 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
2045
2176
  ])]),
2046
2177
  _: 1
2047
2178
  }),
2048
- _(T(k), { title: "居中对齐" }, {
2049
- default: E(() => [_(T(D), {
2179
+ _(w(D), { title: "居中对齐" }, {
2180
+ default: T(() => [_(w(E), {
2050
2181
  size: "small",
2051
- class: b(["gd-contract-template-designer__icon-button", { "is-selected": W.value.textAlign === "center" }]),
2052
- type: W.value.textAlign === "center" ? "primary" : "default",
2053
- disabled: B.value,
2182
+ class: b(["gd-contract-template-designer__icon-button", { "is-selected": G.value.textAlign === "center" }]),
2183
+ type: G.value.textAlign === "center" ? "primary" : "default",
2184
+ disabled: H.value,
2054
2185
  "aria-label": "居中对齐",
2055
- onClick: t[16] ||= (e) => yc("center")
2186
+ onClick: t[17] ||= (e) => sc("center")
2056
2187
  }, {
2057
- default: E(() => [_(T(_t), { "aria-hidden": "true" })]),
2188
+ default: T(() => [_(w(Nt), { "aria-hidden": "true" })]),
2058
2189
  _: 1
2059
2190
  }, 8, [
2060
2191
  "class",
@@ -2063,16 +2194,16 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
2063
2194
  ])]),
2064
2195
  _: 1
2065
2196
  }),
2066
- _(T(k), { title: "右对齐" }, {
2067
- default: E(() => [_(T(D), {
2197
+ _(w(D), { title: "右对齐" }, {
2198
+ default: T(() => [_(w(E), {
2068
2199
  size: "small",
2069
- class: b(["gd-contract-template-designer__icon-button", { "is-selected": W.value.textAlign === "right" }]),
2070
- type: W.value.textAlign === "right" ? "primary" : "default",
2071
- disabled: B.value,
2200
+ class: b(["gd-contract-template-designer__icon-button", { "is-selected": G.value.textAlign === "right" }]),
2201
+ type: G.value.textAlign === "right" ? "primary" : "default",
2202
+ disabled: H.value,
2072
2203
  "aria-label": "右对齐",
2073
- onClick: t[17] ||= (e) => yc("right")
2204
+ onClick: t[18] ||= (e) => sc("right")
2074
2205
  }, {
2075
- default: E(() => [_(T(yt), { "aria-hidden": "true" })]),
2206
+ default: T(() => [_(w(Ft), { "aria-hidden": "true" })]),
2076
2207
  _: 1
2077
2208
  }, 8, [
2078
2209
  "class",
@@ -2082,240 +2213,245 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
2082
2213
  _: 1
2083
2214
  })
2084
2215
  ])], 8, ["disabled", "to"])),
2085
- (x(), f($e, {
2086
- disabled: !Fs("cleanup") || !Ei.value,
2087
- to: Ei.value || "body"
2088
- }, [h("div", jn, [_(T(k), { title: "清文字" }, {
2089
- default: E(() => [_(T(D), {
2216
+ (x(), f(ht, {
2217
+ disabled: !ms("cleanup") || !Rr.value,
2218
+ to: Rr.value || "body"
2219
+ }, [h("div", kn, [_(w(D), { title: "清文字" }, {
2220
+ default: T(() => [_(w(E), {
2090
2221
  size: "small",
2091
2222
  class: "gd-contract-template-designer__icon-button",
2092
- disabled: B.value,
2223
+ disabled: H.value,
2093
2224
  "aria-label": "清文字",
2094
- onClick: t[18] ||= (e) => K({ type: "clear-text-format" })
2225
+ onClick: t[19] ||= (e) => J({ type: "clear-text-format" })
2095
2226
  }, {
2096
- default: E(() => [_(T(St), { "aria-hidden": "true" })]),
2227
+ default: T(() => [_(w(Rt), { "aria-hidden": "true" })]),
2097
2228
  _: 1
2098
2229
  }, 8, ["disabled"])]),
2099
2230
  _: 1
2100
- }), _(T(k), { title: "清段落" }, {
2101
- default: E(() => [_(T(D), {
2231
+ }), _(w(D), { title: "清段落" }, {
2232
+ default: T(() => [_(w(E), {
2102
2233
  size: "small",
2103
2234
  class: "gd-contract-template-designer__icon-button",
2104
- disabled: B.value,
2235
+ disabled: H.value,
2105
2236
  "aria-label": "清段落",
2106
- onClick: t[19] ||= (e) => K({ type: "clear-block-format" })
2237
+ onClick: t[20] ||= (e) => J({ type: "clear-block-format" })
2107
2238
  }, {
2108
- default: E(() => [_(T(jt), { "aria-hidden": "true" })]),
2239
+ default: T(() => [_(w(qt), { "aria-hidden": "true" })]),
2109
2240
  _: 1
2110
2241
  }, 8, ["disabled"])]),
2111
2242
  _: 1
2112
2243
  })])], 8, ["disabled", "to"])),
2113
- (x(), f($e, {
2114
- disabled: !Fs("table") || !Di.value,
2115
- to: Di.value || "body"
2116
- }, [h("div", Mn, [_(T(pt), {
2117
- open: I.value,
2118
- "onUpdate:open": t[23] ||= (e) => I.value = e,
2244
+ (x(), f(ht, {
2245
+ disabled: !ms("table") || !zr.value,
2246
+ to: zr.value || "body"
2247
+ }, [h("div", An, [_(w(kt), {
2248
+ open: vi.value,
2249
+ "onUpdate:open": t[24] ||= (e) => vi.value = e,
2119
2250
  trigger: "click",
2120
2251
  placement: "bottom"
2121
2252
  }, {
2122
- content: E(() => [h("div", Nn, [
2123
- t[92] ||= h("strong", null, "插入表格", -1),
2253
+ content: T(() => [h("div", jn, [
2254
+ t[69] ||= h("strong", null, "插入表格", -1),
2124
2255
  _(Be, {
2125
- disabled: B.value,
2126
- onSelect: t[20] ||= (e) => Hc(e.rows, e.cols),
2127
- onClose: t[21] ||= (e) => I.value = !1
2256
+ disabled: H.value,
2257
+ onSelect: t[21] ||= (e) => Ac(e.rows, e.cols),
2258
+ onClose: t[22] ||= (e) => vi.value = !1
2128
2259
  }, null, 8, ["disabled"]),
2129
- h("label", Pn, [t[91] ||= h("span", null, "表头行", -1), _(T(mt), {
2130
- checked: fa.value.withHeaderRow,
2131
- "onUpdate:checked": t[22] ||= (e) => fa.value.withHeaderRow = e,
2132
- disabled: B.value
2260
+ h("label", Mn, [t[68] ||= h("span", null, "表头行", -1), _(w(jt), {
2261
+ checked: Ii.value.withHeaderRow,
2262
+ "onUpdate:checked": t[23] ||= (e) => Ii.value.withHeaderRow = e,
2263
+ disabled: H.value
2133
2264
  }, null, 8, ["checked", "disabled"])])
2134
2265
  ])]),
2135
- default: E(() => [_(T(k), { title: "插入表格" }, {
2136
- default: E(() => [_(T(D), {
2266
+ default: T(() => [_(w(D), { title: "插入表格" }, {
2267
+ default: T(() => [_(w(E), {
2137
2268
  size: "small",
2138
2269
  class: "gd-contract-template-designer__icon-button",
2139
- disabled: B.value,
2270
+ disabled: H.value,
2140
2271
  "aria-label": "插入表格"
2141
2272
  }, {
2142
- default: E(() => [_(T(Wt), { "aria-hidden": "true" })]),
2273
+ default: T(() => [_(w(an), { "aria-hidden": "true" })]),
2143
2274
  _: 1
2144
2275
  }, 8, ["disabled"])]),
2145
2276
  _: 1
2146
2277
  })]),
2147
2278
  _: 1
2148
- }, 8, ["open"]), _(T(pt), {
2149
- open: Yi.value,
2150
- "onUpdate:open": t[33] ||= (e) => Yi.value = e,
2279
+ }, 8, ["open"]), _(w(kt), {
2280
+ open: yi.value,
2281
+ "onUpdate:open": t[34] ||= (e) => yi.value = e,
2151
2282
  trigger: "click",
2152
2283
  placement: "bottom"
2153
2284
  }, {
2154
- content: E(() => [h("div", Fn, [t[102] ||= h("strong", null, "表格操作", -1), h("div", In, [
2155
- _(T(D), {
2285
+ content: T(() => [h("div", Nn, [t[79] ||= h("strong", null, "表格操作", -1), h("div", Pn, [
2286
+ _(w(E), {
2156
2287
  size: "small",
2157
- disabled: B.value,
2158
- onClick: t[24] ||= (e) => Jc("add-table-row-before")
2288
+ disabled: H.value,
2289
+ onClick: t[25] ||= (e) => Ic("add-table-row-before")
2159
2290
  }, {
2160
- default: E(() => [...t[93] ||= [g(" 上方插行 ", -1)]]),
2291
+ default: T(() => [...t[70] ||= [g(" 上方插行 ", -1)]]),
2161
2292
  _: 1
2162
2293
  }, 8, ["disabled"]),
2163
- _(T(D), {
2294
+ _(w(E), {
2164
2295
  size: "small",
2165
- disabled: B.value,
2166
- onClick: t[25] ||= (e) => Jc("add-table-row-after")
2296
+ disabled: H.value,
2297
+ onClick: t[26] ||= (e) => Ic("add-table-row-after")
2167
2298
  }, {
2168
- default: E(() => [...t[94] ||= [g(" 下方插行 ", -1)]]),
2299
+ default: T(() => [...t[71] ||= [g(" 下方插行 ", -1)]]),
2169
2300
  _: 1
2170
2301
  }, 8, ["disabled"]),
2171
- _(T(D), {
2302
+ _(w(E), {
2172
2303
  size: "small",
2173
- disabled: B.value,
2174
- onClick: t[26] ||= (e) => Jc("add-table-column-before")
2304
+ disabled: H.value,
2305
+ onClick: t[27] ||= (e) => Ic("add-table-column-before")
2175
2306
  }, {
2176
- default: E(() => [...t[95] ||= [g(" 左侧插列 ", -1)]]),
2307
+ default: T(() => [...t[72] ||= [g(" 左侧插列 ", -1)]]),
2177
2308
  _: 1
2178
2309
  }, 8, ["disabled"]),
2179
- _(T(D), {
2310
+ _(w(E), {
2180
2311
  size: "small",
2181
- disabled: B.value,
2182
- onClick: t[27] ||= (e) => Jc("add-table-column-after")
2312
+ disabled: H.value,
2313
+ onClick: t[28] ||= (e) => Ic("add-table-column-after")
2183
2314
  }, {
2184
- default: E(() => [...t[96] ||= [g(" 右侧插列 ", -1)]]),
2315
+ default: T(() => [...t[73] ||= [g(" 右侧插列 ", -1)]]),
2185
2316
  _: 1
2186
2317
  }, 8, ["disabled"]),
2187
- _(T(D), {
2318
+ _(w(E), {
2188
2319
  size: "small",
2189
- disabled: B.value,
2190
- onClick: t[28] ||= (e) => Jc("delete-table-row")
2320
+ disabled: H.value,
2321
+ onClick: t[29] ||= (e) => Ic("delete-table-row")
2191
2322
  }, {
2192
- default: E(() => [...t[97] ||= [g(" 删除当前行 ", -1)]]),
2323
+ default: T(() => [...t[74] ||= [g(" 删除当前行 ", -1)]]),
2193
2324
  _: 1
2194
2325
  }, 8, ["disabled"]),
2195
- _(T(D), {
2326
+ _(w(E), {
2196
2327
  size: "small",
2197
- disabled: B.value,
2198
- onClick: t[29] ||= (e) => Jc("delete-table-column")
2328
+ disabled: H.value,
2329
+ onClick: t[30] ||= (e) => Ic("delete-table-column")
2199
2330
  }, {
2200
- default: E(() => [...t[98] ||= [g(" 删除当前列 ", -1)]]),
2331
+ default: T(() => [...t[75] ||= [g(" 删除当前列 ", -1)]]),
2201
2332
  _: 1
2202
2333
  }, 8, ["disabled"]),
2203
- _(T(D), {
2334
+ _(w(E), {
2204
2335
  size: "small",
2205
- disabled: B.value,
2206
- onClick: t[30] ||= (e) => Jc("toggle-table-header-row")
2336
+ disabled: H.value,
2337
+ onClick: t[31] ||= (e) => Ic("toggle-table-header-row")
2207
2338
  }, {
2208
- default: E(() => [...t[99] ||= [g(" 切换表头行 ", -1)]]),
2339
+ default: T(() => [...t[76] ||= [g(" 切换表头行 ", -1)]]),
2209
2340
  _: 1
2210
2341
  }, 8, ["disabled"]),
2211
- _(T(D), {
2342
+ _(w(E), {
2212
2343
  size: "small",
2213
- disabled: B.value,
2214
- onClick: t[31] ||= (e) => Jc("toggle-table-header-column")
2344
+ disabled: H.value,
2345
+ onClick: t[32] ||= (e) => Ic("toggle-table-header-column")
2215
2346
  }, {
2216
- default: E(() => [...t[100] ||= [g(" 切换表头列 ", -1)]]),
2347
+ default: T(() => [...t[77] ||= [g(" 切换表头列 ", -1)]]),
2217
2348
  _: 1
2218
2349
  }, 8, ["disabled"]),
2219
- _(T(D), {
2350
+ _(w(E), {
2220
2351
  danger: "",
2221
2352
  size: "small",
2222
- disabled: B.value,
2223
- onClick: t[32] ||= (e) => Jc("delete-table")
2353
+ disabled: H.value,
2354
+ onClick: t[33] ||= (e) => Ic("delete-table")
2224
2355
  }, {
2225
- default: E(() => [...t[101] ||= [g(" 删除表格 ", -1)]]),
2356
+ default: T(() => [...t[78] ||= [g(" 删除表格 ", -1)]]),
2226
2357
  _: 1
2227
2358
  }, 8, ["disabled"])
2228
2359
  ])])]),
2229
- default: E(() => [_(T(k), { title: "表格操作" }, {
2230
- default: E(() => [_(T(D), {
2360
+ default: T(() => [_(w(D), { title: "表格操作" }, {
2361
+ default: T(() => [_(w(E), {
2231
2362
  size: "small",
2232
2363
  class: "gd-contract-template-designer__icon-button",
2233
- disabled: B.value || !W.value.isTableActive,
2364
+ disabled: H.value || !G.value.isTableActive,
2234
2365
  "aria-label": "表格操作"
2235
2366
  }, {
2236
- default: E(() => [_(T(Wt), { "aria-hidden": "true" })]),
2367
+ default: T(() => [_(w(an), { "aria-hidden": "true" })]),
2237
2368
  _: 1
2238
2369
  }, 8, ["disabled"])]),
2239
2370
  _: 1
2240
2371
  })]),
2241
2372
  _: 1
2242
2373
  }, 8, ["open"])])], 8, ["disabled", "to"])),
2243
- ot(h("div", {
2374
+ Ct(h("div", {
2244
2375
  ref_key: "toolbarMoreElement",
2245
- ref: wi,
2376
+ ref: Fr,
2246
2377
  class: "gd-contract-template-designer__toolbar-more"
2247
- }, [_(T(k), { title: "更多工具" }, {
2248
- default: E(() => [_(T(D), {
2378
+ }, [_(w(D), { title: "更多工具" }, {
2379
+ default: T(() => [_(w(E), {
2249
2380
  size: "small",
2250
- class: b(["gd-contract-template-designer__icon-button", { "is-selected": Gi.value }]),
2381
+ class: b(["gd-contract-template-designer__icon-button", { "is-selected": mi.value }]),
2251
2382
  "aria-label": "更多工具",
2252
2383
  "aria-haspopup": "true",
2253
- "aria-expanded": Gi.value,
2254
- onClick: t[34] ||= st((e) => Gi.value = !Gi.value, ["stop"])
2384
+ "aria-expanded": mi.value,
2385
+ onClick: t[35] ||= wt((e) => mi.value = !mi.value, ["stop"])
2255
2386
  }, {
2256
- default: E(() => [_(T(Ot), { "aria-hidden": "true" })]),
2387
+ default: T(() => [_(w(Wt), { "aria-hidden": "true" })]),
2257
2388
  _: 1
2258
2389
  }, 8, ["class", "aria-expanded"])]),
2259
2390
  _: 1
2260
- }), ot(h("div", Ln, [
2261
- ot(h("div", Rn, [t[103] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "文字排版", -1), h("div", {
2391
+ }), Ct(h("div", Fn, [
2392
+ Ct(h("div", In, [t[80] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "插入", -1), h("div", {
2393
+ ref_key: "toolbarInsertSlotElement",
2394
+ ref: Ir,
2395
+ class: "gd-contract-template-designer__toolbar-more-slot"
2396
+ }, null, 512)], 512), [[xt, ms("insert")]]),
2397
+ Ct(h("div", Ln, [t[81] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "文字排版", -1), h("div", {
2262
2398
  ref_key: "toolbarTypographySlotElement",
2263
- ref: Ti,
2399
+ ref: Lr,
2264
2400
  class: "gd-contract-template-designer__toolbar-more-slot"
2265
- }, null, 512)], 512), [[it, Fs("typography")]]),
2266
- ot(h("div", zn, [t[104] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "清除格式", -1), h("div", {
2401
+ }, null, 512)], 512), [[xt, ms("typography")]]),
2402
+ Ct(h("div", Rn, [t[82] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "清除格式", -1), h("div", {
2267
2403
  ref_key: "toolbarCleanupSlotElement",
2268
- ref: Ei,
2404
+ ref: Rr,
2269
2405
  class: "gd-contract-template-designer__toolbar-more-slot"
2270
- }, null, 512)], 512), [[it, Fs("cleanup")]]),
2271
- ot(h("div", Bn, [t[105] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "表格", -1), h("div", {
2406
+ }, null, 512)], 512), [[xt, ms("cleanup")]]),
2407
+ Ct(h("div", zn, [t[83] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "表格", -1), h("div", {
2272
2408
  ref_key: "toolbarTableSlotElement",
2273
- ref: Di,
2409
+ ref: zr,
2274
2410
  class: "gd-contract-template-designer__toolbar-more-slot"
2275
- }, null, 512)], 512), [[it, Fs("table")]])
2276
- ], 512), [[it, Gi.value]])], 512), [[it, Ps.value]])
2411
+ }, null, 512)], 512), [[xt, ms("table")]])
2412
+ ], 512), [[xt, mi.value]])], 512), [[xt, ps.value]])
2277
2413
  ], 512)]),
2278
- Ni.value ? (x(), m("section", Vn, [_(T(ct), {
2279
- type: Sa.value ? "success" : "error",
2280
- message: Ca.value,
2414
+ ei.value ? (x(), m("section", Bn, [_(w(Tt), {
2415
+ type: Zi.value ? "success" : "error",
2416
+ message: Qi.value,
2281
2417
  "show-icon": ""
2282
- }, null, 8, ["type", "message"]), Pi.value.length ? (x(), m("div", Hn, [(x(!0), m(u, null, C(Pi.value, (e) => (x(), m("button", {
2418
+ }, null, 8, ["type", "message"]), ti.value.length ? (x(), m("div", Vn, [(x(!0), m(mt, null, yt(ti.value, (e) => (x(), m("button", {
2283
2419
  key: `${e.id}-${e.message}`,
2284
2420
  type: "button",
2285
2421
  class: "gd-contract-template-designer__validation-item",
2286
- onClick: (t) => uc(e)
2287
- }, [h("span", null, w(e.message), 1), h("small", null, w(e.type === "signing-placement" ? "签署位置" : e.type === "variable" ? "变量" : "字段"), 1)], 8, Un))), 128))])) : p("", !0)])) : p("", !0),
2422
+ onClick: (t) => Zs(e)
2423
+ }, [h("span", null, C(e.message), 1), h("small", null, C(e.type === "signing-placement" ? "签署位置" : e.type === "variable" ? "变量" : "字段"), 1)], 8, Hn))), 128))])) : p("", !0)])) : p("", !0),
2288
2424
  h("div", {
2289
2425
  ref_key: "canvasElement",
2290
- ref: xi,
2426
+ ref: Mr,
2291
2427
  class: "gd-contract-template-designer__canvas"
2292
- }, [(x(!0), m(u, null, C(j.value.pages, (e, n) => (x(), f(Le, {
2293
- key: e.id,
2428
+ }, [(x(!0), m(mt, null, yt(P.value.pages, (e, n) => (x(), f(Le, {
2429
+ key: `${j.value}:${e.id}`,
2294
2430
  ref_for: !0,
2295
- ref: (t) => mo(e.id, t),
2431
+ ref: (t) => Ga(e.id, t),
2296
2432
  page: e,
2297
2433
  "page-index": n,
2298
- "page-size": J(e),
2299
- variables: j.value.variables,
2300
- "selected-variable-key": M.value,
2301
- "signing-placements": l.showSigningPlacementTools ? vo(e.id) : [],
2302
- "selected-signing-placement-id": N.value,
2303
- active: P.value === e.id,
2304
- readonly: ye.readonly,
2305
- disabled: ye.disabled,
2306
- zoom: Vi.value,
2307
- "process-image-file": Zo,
2308
- onPageUpdate: _o,
2309
- onVariableDrop: is,
2310
- onVariableSelect: as,
2311
- onSigningPlacementDrop: To,
2312
- onSigningPlacementSelect: bo,
2313
- onSigningPlacementMove: Oo,
2314
- onSigningPlacementRemove: jo,
2315
- onEditorFocus: t[35] ||= (e) => ac(e, !1),
2316
- onEditorStateChange: Vc,
2317
- onEditorContextMenu: Lc,
2318
- onVariableMoveBlocked: t[36] ||= (e) => ua.value = "变量只能在当前页内移动,跨页移动尚未支持。"
2434
+ "page-size": X(e),
2435
+ variables: P.value.variables,
2436
+ "selected-variable-key": F.value,
2437
+ "signing-placements": l.showSigningPlacementTools ? Ya(e.id) : [],
2438
+ "selected-signing-placement-id": I.value,
2439
+ active: L.value === e.id,
2440
+ readonly: fe.readonly,
2441
+ disabled: fe.disabled,
2442
+ zoom: ui.value,
2443
+ "process-image-file": Ao,
2444
+ onPageUpdate: Ja,
2445
+ onVariableDrop: Lo,
2446
+ onVariableSelect: Ro,
2447
+ onSigningPlacementDrop: no,
2448
+ onSigningPlacementSelect: Za,
2449
+ onSigningPlacementMove: ao,
2450
+ onSigningPlacementRemove: co,
2451
+ onEditorFocus: t[36] ||= (e) => Rs(e, !1),
2452
+ onEditorStateChange: kc,
2453
+ onEditorContextMenu: Tc,
2454
+ onVariableMoveBlocked: t[37] ||= (e) => Pi.value = "变量只能在当前页内移动,跨页移动尚未支持。"
2319
2455
  }, null, 8, [
2320
2456
  "page",
2321
2457
  "page-index",
@@ -2330,285 +2466,107 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
2330
2466
  "zoom"
2331
2467
  ]))), 128))], 512)
2332
2468
  ], 512),
2333
- h("aside", { class: b(["gd-contract-template-designer__inspector", { "is-collapsed": Wi.value }]) }, [_(T(k), { title: Wi.value ? "展开属性栏" : "收起属性栏" }, {
2334
- default: E(() => [h("button", {
2335
- type: "button",
2336
- class: "gd-contract-template-designer__panel-handle",
2337
- "aria-label": Wi.value ? "展开属性栏" : "收起属性栏",
2338
- "aria-expanded": !Wi.value,
2339
- onClick: t[37] ||= (e) => Wi.value = !Wi.value
2340
- }, [Wi.value ? (x(), f(T(Ft), {
2341
- key: 0,
2342
- "aria-hidden": "true"
2343
- })) : (x(), f(T(Ht), {
2344
- key: 1,
2345
- "aria-hidden": "true"
2346
- }))], 8, Wn)]),
2347
- _: 1
2348
- }, 8, ["title"]), h("div", Gn, [
2349
- h("section", Kn, [t[107] ||= h("div", { class: "gd-contract-template-designer__panel-head" }, [h("strong", null, "正文控件"), h("span", null, "拖到正文")], -1), (x(!0), m(u, null, C(Ba.value, (e) => (x(), m("button", {
2350
- key: e.type,
2351
- type: "button",
2352
- draggable: "true",
2353
- class: "gd-contract-template-designer__tool-item",
2354
- disabled: B.value,
2355
- onDragstart: (t) => Ts(t, e.type),
2356
- onClick: (t) => ys(e.type)
2357
- }, [h("span", Jn, [(x(), f(rt(e.icon)))]), h("span", Yn, [h("span", null, w(e.label), 1), t[106] ||= h("small", null, "模板变量", -1)])], 40, qn))), 128))]),
2358
- l.showSigningPlacementTools ? (x(), m("section", Xn, [h("div", Zn, [t[108] ||= h("strong", null, "签署位置", -1), h("div", Qn, [_(T(ht), null, {
2359
- default: E(() => [g(w(H.value.length), 1)]),
2360
- _: 1
2361
- })])]), (x(!0), m(u, null, C(Ra.value, (e) => (x(), m("button", {
2362
- key: e.key,
2363
- type: "button",
2364
- draggable: "true",
2365
- class: "gd-contract-template-designer__tool-item gd-contract-template-designer__signing-tool",
2366
- disabled: B.value,
2367
- onDragstart: (t) => Do(t, e),
2368
- onClick: (t) => Eo(e)
2369
- }, [h("span", er, [(x(), f(rt(T(Qe)(e.type))))]), h("span", tr, [h("span", nr, w(e.label), 1), h("small", null, w(T(se)[e.type]) + " · 页面坐标", 1)])], 40, $n))), 128))])) : p("", !0),
2370
- l.showSigningPlacementTools && va.value ? (x(), f(Xe, {
2371
- key: 1,
2372
- placement: va.value,
2373
- "page-size": ba.value,
2374
- readonly: ye.readonly,
2375
- disabled: ye.disabled,
2376
- onUpdate: ko,
2377
- onDuplicate: t[38] ||= (e) => Ao(),
2378
- onRemove: t[39] ||= (e) => jo()
2379
- }, null, 8, [
2380
- "placement",
2381
- "page-size",
2382
- "readonly",
2383
- "disabled"
2384
- ])) : (x(), m("section", rr, [h("div", ir, [t[109] ||= h("strong", null, "属性", -1), V.value ? (x(), m("div", ar, [_(T(k), { title: "复制变量" }, {
2385
- default: E(() => [_(T(D), {
2386
- size: "small",
2387
- type: "primary",
2388
- class: "gd-contract-template-designer__icon-button",
2389
- disabled: B.value,
2390
- "aria-label": "复制变量",
2391
- onClick: t[40] ||= (e) => _s(V.value)
2392
- }, {
2393
- default: E(() => [_(T(wt), { "aria-hidden": "true" })]),
2394
- _: 1
2395
- }, 8, ["disabled"])]),
2396
- _: 1
2397
- }), _(T(k), { title: "删除变量" }, {
2398
- default: E(() => [_(T(D), {
2399
- danger: "",
2400
- type: "primary",
2401
- size: "small",
2402
- class: "gd-contract-template-designer__icon-button",
2403
- disabled: B.value,
2404
- "aria-label": "删除变量",
2405
- onClick: t[41] ||= (e) => hs(V.value)
2406
- }, {
2407
- default: E(() => [_(T(Et), { "aria-hidden": "true" })]),
2408
- _: 1
2409
- }, 8, ["disabled"])]),
2410
- _: 1
2411
- })])) : p("", !0)]), V.value ? (x(), m(u, { key: 1 }, [
2412
- h("label", or, [t[110] ||= h("span", null, "名称", -1), _(T(ut), {
2413
- value: V.value.label,
2414
- disabled: B.value,
2415
- onChange: t[42] ||= (e) => Q({ label: e.target.value })
2416
- }, null, 8, ["value", "disabled"])]),
2417
- h("label", sr, [t[111] ||= h("span", null, "变量标识", -1), _(T(ut), {
2418
- value: V.value.key,
2419
- disabled: ""
2420
- }, null, 8, ["value"])]),
2421
- h("label", cr, [t[112] ||= h("span", null, "占位文案", -1), _(T(ut), {
2422
- value: V.value.placeholder,
2423
- disabled: B.value,
2424
- onChange: t[43] ||= (e) => Q({ placeholder: e.target.value })
2425
- }, null, 8, ["value", "disabled"])]),
2426
- h("label", lr, [t[113] ||= h("span", null, "默认值", -1), _(T(ut), {
2427
- value: V.value.defaultValue,
2428
- disabled: B.value,
2429
- onChange: t[44] ||= (e) => Q({ defaultValue: e.target.value })
2430
- }, null, 8, ["value", "disabled"])]),
2431
- h("label", ur, [t[114] ||= h("span", null, "宽度", -1), _(T(dt), {
2432
- value: V.value.width,
2433
- min: ci,
2434
- max: Wa.value,
2435
- disabled: B.value,
2436
- onChange: t[45] ||= (e) => Q({ width: Number(e || ci) })
2437
- }, null, 8, [
2438
- "value",
2439
- "max",
2440
- "disabled"
2441
- ])]),
2442
- h("label", dr, [t[115] ||= h("span", null, "高度", -1), _(T(dt), {
2443
- value: V.value.height,
2444
- min: li,
2445
- max: Ga.value,
2446
- disabled: B.value,
2447
- onChange: t[46] ||= (e) => Q({ height: Number(e || li) })
2448
- }, null, 8, [
2449
- "value",
2450
- "max",
2451
- "disabled"
2452
- ])]),
2453
- V.value.type === "text" ? (x(), m("div", fr, [h("label", pr, [t[116] ||= h("span", null, "多行", -1), _(T(mt), {
2454
- checked: !!V.value.multiline,
2455
- disabled: B.value,
2456
- onChange: t[47] ||= (e) => ps(!!e)
2457
- }, null, 8, ["checked", "disabled"])]), V.value.multiline ? (x(), m("label", mr, [t[117] ||= h("span", null, "行数", -1), _(T(dt), {
2458
- value: V.value.rows || T(3),
2459
- min: 2,
2460
- max: 12,
2461
- disabled: B.value,
2462
- onChange: ms
2463
- }, null, 8, ["value", "disabled"])])) : p("", !0)])) : p("", !0),
2464
- V.value.type === "date" ? (x(), m("label", hr, [t[118] ||= h("span", null, "日期格式", -1), _(T(ut), {
2465
- value: V.value.format,
2466
- disabled: B.value,
2467
- onChange: t[48] ||= (e) => Q({ format: e.target.value })
2468
- }, null, 8, ["value", "disabled"])])) : p("", !0),
2469
- V.value.type === "number" ? (x(), m(u, { key: 2 }, [h("label", gr, [t[119] ||= h("span", null, "数字格式", -1), _(T(ut), {
2470
- value: V.value.format,
2471
- disabled: B.value,
2472
- onChange: t[49] ||= (e) => Q({ format: e.target.value })
2473
- }, null, 8, ["value", "disabled"])]), h("label", _r, [t[120] ||= h("span", null, "小数位", -1), _(T(dt), {
2474
- value: V.value.precision,
2475
- min: 0,
2476
- max: 6,
2477
- disabled: B.value,
2478
- onChange: t[50] ||= (e) => Q({ precision: typeof e == "number" ? e : void 0 })
2479
- }, null, 8, ["value", "disabled"])])], 64)) : p("", !0),
2480
- V.value.type === "checkbox" ? (x(), m(u, { key: 3 }, [h("label", vr, [t[121] ||= h("span", null, "勾选文本", -1), _(T(ut), {
2481
- value: V.value.checkedText,
2482
- disabled: B.value,
2483
- onChange: t[51] ||= (e) => Q({ checkedText: e.target.value })
2484
- }, null, 8, ["value", "disabled"])]), h("label", yr, [t[122] ||= h("span", null, "未选文本", -1), _(T(ut), {
2485
- value: V.value.uncheckedText,
2486
- disabled: B.value,
2487
- onChange: t[52] ||= (e) => Q({ uncheckedText: e.target.value })
2488
- }, null, 8, ["value", "disabled"])])], 64)) : p("", !0),
2489
- h("div", br, [
2490
- h("label", xr, [t[123] ||= h("span", null, "必填", -1), _(T(mt), {
2491
- checked: V.value.required,
2492
- disabled: B.value,
2493
- onChange: t[53] ||= (e) => Q({ required: !!e })
2494
- }, null, 8, ["checked", "disabled"])]),
2495
- h("label", Sr, [t[124] ||= h("span", null, "边框", -1), _(T(mt), {
2496
- checked: !!V.value.style?.border,
2497
- disabled: B.value,
2498
- onChange: t[54] ||= (e) => us({ border: !!e })
2499
- }, null, 8, ["checked", "disabled"])]),
2500
- h("label", Cr, [t[125] ||= h("span", null, "下划线", -1), _(T(mt), {
2501
- checked: !!V.value.style?.underline,
2502
- disabled: B.value,
2503
- onChange: t[55] ||= (e) => us({ underline: !!e })
2504
- }, null, 8, ["checked", "disabled"])]),
2505
- V.value.type === "number" ? (x(), m("label", wr, [t[126] ||= h("span", null, "千分位", -1), _(T(mt), {
2506
- checked: V.value.useGrouping !== !1,
2507
- disabled: B.value,
2508
- onChange: t[56] ||= (e) => Q({ useGrouping: !!e })
2509
- }, null, 8, ["checked", "disabled"])])) : p("", !0)
2510
- ]),
2511
- h("label", Tr, [t[127] ||= h("span", null, "字体", -1), _(T(O), {
2512
- value: Xa.value,
2513
- options: ka.value,
2514
- disabled: B.value,
2515
- onChange: ds
2516
- }, null, 8, [
2517
- "value",
2518
- "options",
2519
- "disabled"
2520
- ])]),
2521
- h("label", Er, [t[128] ||= h("span", null, "字号", -1), _(T(dt), {
2522
- value: V.value.style?.fontSize,
2523
- min: ui,
2524
- max: di,
2525
- disabled: B.value,
2526
- onChange: fs
2527
- }, null, 8, ["value", "disabled"])]),
2528
- h("label", Dr, [t[129] ||= h("span", null, "颜色", -1), h("input", {
2529
- type: "color",
2530
- value: V.value.style?.color || "#1f2937",
2531
- disabled: B.value,
2532
- onInput: t[57] ||= (e) => us({ color: e.target.value })
2533
- }, null, 40, Or)]),
2534
- h("label", kr, [t[130] ||= h("span", null, "占位颜色", -1), h("input", {
2535
- type: "color",
2536
- value: V.value.style?.placeholderColor || "#7a818b",
2537
- disabled: B.value,
2538
- onInput: t[58] ||= (e) => us({ placeholderColor: e.target.value })
2539
- }, null, 40, Ar)]),
2540
- h("label", jr, [t[131] ||= h("span", null, "线条颜色", -1), h("input", {
2541
- type: "color",
2542
- value: V.value.style?.lineColor || "#565b66",
2543
- disabled: B.value,
2544
- onInput: t[59] ||= (e) => us({ lineColor: e.target.value })
2545
- }, null, 40, Mr)]),
2546
- h("label", Nr, [t[132] ||= h("span", null, "文字对齐", -1), _(T(O), {
2547
- value: V.value.style?.textAlign || "left",
2548
- options: T(ja),
2549
- disabled: B.value,
2550
- onChange: ss
2551
- }, null, 8, [
2552
- "value",
2553
- "options",
2554
- "disabled"
2555
- ])]),
2556
- V.value.type === "image" ? (x(), m(u, { key: 4 }, [h("label", Pr, [t[133] ||= h("span", null, "边框样式", -1), _(T(O), {
2557
- value: V.value.style?.borderStyle || "dashed",
2558
- options: Na,
2559
- disabled: B.value,
2560
- onChange: cs
2561
- }, null, 8, ["value", "disabled"])]), h("label", Fr, [t[134] ||= h("span", null, "图片适配", -1), _(T(O), {
2562
- value: V.value.style?.objectFit || "contain",
2563
- options: Pa,
2564
- disabled: B.value,
2565
- onChange: ls
2566
- }, null, 8, ["value", "disabled"])])], 64)) : p("", !0)
2567
- ], 64)) : (x(), f(T(lt), {
2568
- key: 0,
2569
- description: "请选择模板变量",
2570
- image: T(lt).PRESENTED_IMAGE_SIMPLE
2571
- }, null, 8, ["image"]))]))
2572
- ])], 2)
2469
+ _(dt, {
2470
+ collapsed: pi.value,
2471
+ readonly: fe.readonly,
2472
+ disabled: fe.disabled,
2473
+ "show-signing-placement-tools": l.showSigningPlacementTools,
2474
+ "body-control-tool-items": ha.value,
2475
+ "signing-placement-tools": pa.value,
2476
+ "signing-placements": U.value,
2477
+ "selected-signing-placement": qi.value,
2478
+ "selected-signing-placement-page-size": Yi.value,
2479
+ "selected-variable": Ui.value,
2480
+ "current-variable-font-family": Ta.value,
2481
+ "font-family-select-options": ia.value,
2482
+ "text-align-options": w(oa),
2483
+ "border-style-options": ca,
2484
+ "object-fit-options": la,
2485
+ "selected-variable-width-max": ya.value,
2486
+ "selected-variable-height-max": ba.value,
2487
+ "min-font-size": xr,
2488
+ "max-font-size": Sr,
2489
+ "default-multiline-rows": w(3),
2490
+ "resolve-signing-placement-type-icon": w(ct),
2491
+ "signing-placement-type-labels": w(r),
2492
+ onToggle: t[38] ||= (e) => pi.value = !pi.value,
2493
+ onVariableDragStart: as,
2494
+ onInsertVariable: $o,
2495
+ onSigningPlacementDragStart: io,
2496
+ onInsertSigningPlacement: ro,
2497
+ onPatchSigningPlacement: oo,
2498
+ onDuplicateSigningPlacement: t[39] ||= (e) => so(),
2499
+ onRemoveSigningPlacement: t[40] ||= (e) => co(),
2500
+ onDuplicateVariable: Zo,
2501
+ onRemoveVariable: Yo,
2502
+ onPatchVariable: Bo,
2503
+ onPatchStyle: Wo,
2504
+ onPatchMultiline: qo,
2505
+ onPatchRows: Jo,
2506
+ onPatchFontFamily: Go,
2507
+ onPatchFontSize: Ko,
2508
+ onPatchTextAlign: Vo,
2509
+ onPatchBorderStyle: Ho,
2510
+ onPatchObjectFit: Uo
2511
+ }, null, 8, [
2512
+ "collapsed",
2513
+ "readonly",
2514
+ "disabled",
2515
+ "show-signing-placement-tools",
2516
+ "body-control-tool-items",
2517
+ "signing-placement-tools",
2518
+ "signing-placements",
2519
+ "selected-signing-placement",
2520
+ "selected-signing-placement-page-size",
2521
+ "selected-variable",
2522
+ "current-variable-font-family",
2523
+ "font-family-select-options",
2524
+ "text-align-options",
2525
+ "selected-variable-width-max",
2526
+ "selected-variable-height-max",
2527
+ "default-multiline-rows",
2528
+ "resolve-signing-placement-type-icon",
2529
+ "signing-placement-type-labels"
2530
+ ])
2573
2531
  ], 2),
2574
- (x(), f($e, { to: "body" }, [
2575
- R.value ? (x(), f(ze, {
2532
+ (x(), f(ht, { to: "body" }, [
2533
+ B.value ? (x(), f(ze, {
2576
2534
  key: 0,
2577
2535
  ref_key: "tableContextMenuElement",
2578
- ref: oa,
2579
- capabilities: R.value.capabilities,
2580
- "active-alignment": R.value.activeAlignment,
2581
- style: et({
2582
- left: `${R.value.x}px`,
2583
- top: `${R.value.y}px`
2536
+ ref: Ai,
2537
+ capabilities: B.value.capabilities,
2538
+ "active-alignment": B.value.activeAlignment,
2539
+ style: gt({
2540
+ left: `${B.value.x}px`,
2541
+ top: `${B.value.y}px`
2584
2542
  }),
2585
- onExecute: Wc,
2586
- onKeydown: Gc
2543
+ onExecute: Mc,
2544
+ onKeydown: Nc
2587
2545
  }, null, 8, [
2588
2546
  "capabilities",
2589
2547
  "active-alignment",
2590
2548
  "style"
2591
2549
  ])) : p("", !0),
2592
- z.value ? (x(), m("div", {
2550
+ V.value ? (x(), m("div", {
2593
2551
  key: 1,
2594
2552
  ref_key: "imageContextMenuElement",
2595
- ref: sa,
2553
+ ref: ji,
2596
2554
  class: "gd-contract-template-designer__context-menu gd-contract-template-designer__image-context-menu",
2597
- style: et({
2598
- left: `${z.value.x}px`,
2599
- top: `${z.value.y}px`
2555
+ style: gt({
2556
+ left: `${V.value.x}px`,
2557
+ top: `${V.value.y}px`
2600
2558
  }),
2601
2559
  role: "dialog",
2602
2560
  "aria-label": "图片尺寸",
2603
- onKeydown: qc
2561
+ onKeydown: Fc
2604
2562
  }, [
2605
- t[139] ||= h("div", { class: "gd-contract-template-designer__image-context-title" }, [h("strong", null, "图片尺寸"), h("span", null, "单位:px;留空可恢复自然尺寸")], -1),
2606
- h("div", Ir, [h("label", null, [t[135] ||= h("span", null, "宽度", -1), _(T(dt), {
2607
- value: ca.value,
2608
- "onUpdate:value": t[60] ||= (e) => ca.value = e,
2609
- min: T(16),
2610
- max: T(s),
2611
- disabled: B.value,
2563
+ t[88] ||= h("div", { class: "gd-contract-template-designer__image-context-title" }, [h("strong", null, "图片尺寸"), h("span", null, "单位:px;留空可恢复自然尺寸")], -1),
2564
+ h("div", Un, [h("label", null, [t[84] ||= h("span", null, "宽度", -1), _(w(Dt), {
2565
+ value: Mi.value,
2566
+ "onUpdate:value": t[41] ||= (e) => Mi.value = e,
2567
+ min: w(16),
2568
+ max: w(Me),
2569
+ disabled: H.value,
2612
2570
  placeholder: "自然",
2613
2571
  "aria-label": "图片宽度"
2614
2572
  }, null, 8, [
@@ -2616,12 +2574,12 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
2616
2574
  "min",
2617
2575
  "max",
2618
2576
  "disabled"
2619
- ])]), h("label", null, [t[136] ||= h("span", null, "高度", -1), _(T(dt), {
2620
- value: la.value,
2621
- "onUpdate:value": t[61] ||= (e) => la.value = e,
2622
- min: T(16),
2623
- max: T(s),
2624
- disabled: B.value,
2577
+ ])]), h("label", null, [t[85] ||= h("span", null, "高度", -1), _(w(Dt), {
2578
+ value: Ni.value,
2579
+ "onUpdate:value": t[42] ||= (e) => Ni.value = e,
2580
+ min: w(16),
2581
+ max: w(Me),
2582
+ disabled: H.value,
2625
2583
  placeholder: "自然",
2626
2584
  "aria-label": "图片高度"
2627
2585
  }, null, 8, [
@@ -2630,316 +2588,316 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
2630
2588
  "max",
2631
2589
  "disabled"
2632
2590
  ])])]),
2633
- h("div", Lr, [_(T(D), {
2591
+ h("div", Wn, [_(w(E), {
2634
2592
  size: "small",
2635
- onClick: Ic
2593
+ onClick: wc
2636
2594
  }, {
2637
- default: E(() => [...t[137] ||= [g("恢复自然尺寸", -1)]]),
2595
+ default: T(() => [...t[86] ||= [g("恢复自然尺寸", -1)]]),
2638
2596
  _: 1
2639
- }), _(T(D), {
2597
+ }), _(w(E), {
2640
2598
  size: "small",
2641
2599
  type: "primary",
2642
- onClick: Fc
2600
+ onClick: Cc
2643
2601
  }, {
2644
- default: E(() => [...t[138] ||= [g("应用", -1)]]),
2602
+ default: T(() => [...t[87] ||= [g("应用", -1)]]),
2645
2603
  _: 1
2646
2604
  })])
2647
2605
  ], 36)) : p("", !0),
2648
- L.value ? (x(), m("div", {
2606
+ z.value ? (x(), m("div", {
2649
2607
  key: 2,
2650
2608
  ref_key: "textContextMenuElement",
2651
- ref: ra,
2609
+ ref: Di,
2652
2610
  class: "gd-contract-template-designer__context-menu gd-contract-template-designer__text-context-menu",
2653
- style: et({
2654
- left: `${L.value.x}px`,
2655
- top: `${L.value.y}px`
2611
+ style: gt({
2612
+ left: `${z.value.x}px`,
2613
+ top: `${z.value.y}px`
2656
2614
  }),
2657
2615
  role: "toolbar",
2658
2616
  "aria-label": "正文快捷操作",
2659
- onKeydown: Kc
2617
+ onKeydown: Pc
2660
2618
  }, [
2661
- h("div", Rr, [
2662
- _(T(k), { title: "撤销" }, {
2663
- default: E(() => [_(T(D), {
2619
+ h("div", Gn, [
2620
+ _(w(D), { title: "撤销" }, {
2621
+ default: T(() => [_(w(E), {
2664
2622
  size: "small",
2665
2623
  class: "gd-contract-template-designer__text-menu-icon-button",
2666
- disabled: !W.value.canUndo,
2624
+ disabled: !G.value.canUndo,
2667
2625
  "aria-label": "撤销",
2668
- onClick: t[62] ||= (e) => q({ type: "undo" })
2626
+ onClick: t[43] ||= (e) => Y({ type: "undo" })
2669
2627
  }, {
2670
- default: E(() => [_(T(Kt), { "aria-hidden": "true" })]),
2628
+ default: T(() => [_(w(sn), { "aria-hidden": "true" })]),
2671
2629
  _: 1
2672
2630
  }, 8, ["disabled"])]),
2673
2631
  _: 1
2674
2632
  }),
2675
- _(T(k), { title: "重做" }, {
2676
- default: E(() => [_(T(D), {
2633
+ _(w(D), { title: "重做" }, {
2634
+ default: T(() => [_(w(E), {
2677
2635
  size: "small",
2678
2636
  class: "gd-contract-template-designer__text-menu-icon-button",
2679
- disabled: !W.value.canRedo,
2637
+ disabled: !G.value.canRedo,
2680
2638
  "aria-label": "重做",
2681
- onClick: t[63] ||= (e) => q({ type: "redo" })
2639
+ onClick: t[44] ||= (e) => Y({ type: "redo" })
2682
2640
  }, {
2683
- default: E(() => [_(T(Bt), { "aria-hidden": "true" })]),
2641
+ default: T(() => [_(w(tn), { "aria-hidden": "true" })]),
2684
2642
  _: 1
2685
2643
  }, 8, ["disabled"])]),
2686
2644
  _: 1
2687
2645
  }),
2688
- t[140] ||= h("span", {
2646
+ t[89] ||= h("span", {
2689
2647
  class: "gd-contract-template-designer__text-menu-divider",
2690
2648
  "aria-hidden": "true"
2691
2649
  }, null, -1),
2692
- L.value.hasSelection ? (x(), f(T(k), {
2650
+ z.value.hasSelection ? (x(), f(w(D), {
2693
2651
  key: 0,
2694
2652
  title: "复制"
2695
2653
  }, {
2696
- default: E(() => [_(T(D), {
2654
+ default: T(() => [_(w(E), {
2697
2655
  size: "small",
2698
2656
  class: "gd-contract-template-designer__text-menu-icon-button",
2699
2657
  "aria-label": "复制",
2700
- onClick: t[64] ||= (e) => ho("copy")
2658
+ onClick: t[45] ||= (e) => Ka("copy")
2701
2659
  }, {
2702
- default: E(() => [_(T(wt), { "aria-hidden": "true" })]),
2660
+ default: T(() => [_(w(Bt), { "aria-hidden": "true" })]),
2703
2661
  _: 1
2704
2662
  })]),
2705
2663
  _: 1
2706
2664
  })) : p("", !0),
2707
- L.value.hasSelection ? (x(), f(T(k), {
2665
+ z.value.hasSelection ? (x(), f(w(D), {
2708
2666
  key: 1,
2709
2667
  title: "剪切"
2710
2668
  }, {
2711
- default: E(() => [_(T(D), {
2669
+ default: T(() => [_(w(E), {
2712
2670
  size: "small",
2713
2671
  class: "gd-contract-template-designer__text-menu-icon-button",
2714
2672
  "aria-label": "剪切",
2715
- onClick: t[65] ||= (e) => ho("cut")
2673
+ onClick: t[46] ||= (e) => Ka("cut")
2716
2674
  }, {
2717
- default: E(() => [_(T(Ut), { "aria-hidden": "true" })]),
2675
+ default: T(() => [_(w(rn), { "aria-hidden": "true" })]),
2718
2676
  _: 1
2719
2677
  })]),
2720
2678
  _: 1
2721
2679
  })) : p("", !0),
2722
- _(T(k), { title: "粘贴" }, {
2723
- default: E(() => [_(T(D), {
2680
+ _(w(D), { title: "粘贴" }, {
2681
+ default: T(() => [_(w(E), {
2724
2682
  size: "small",
2725
2683
  class: "gd-contract-template-designer__text-menu-icon-button",
2726
2684
  "aria-label": "粘贴",
2727
- onClick: t[66] ||= (e) => ho("paste")
2685
+ onClick: t[47] ||= (e) => Ka("paste")
2728
2686
  }, {
2729
- default: E(() => [_(T(wt), { "aria-hidden": "true" })]),
2687
+ default: T(() => [_(w(Bt), { "aria-hidden": "true" })]),
2730
2688
  _: 1
2731
2689
  })]),
2732
2690
  _: 1
2733
2691
  })
2734
2692
  ]),
2735
- L.value.hasSelection ? p("", !0) : (x(), m("div", zr, [
2736
- _(T(D), {
2693
+ z.value.hasSelection ? p("", !0) : (x(), m("div", Kn, [
2694
+ _(w(E), {
2737
2695
  size: "small",
2738
- onClick: $o
2696
+ onClick: Mo
2739
2697
  }, {
2740
- default: E(() => [_(T(Rt), { "aria-hidden": "true" }), t[141] ||= h("span", null, "图片", -1)]),
2698
+ default: T(() => [_(w($t), { "aria-hidden": "true" }), t[90] ||= h("span", null, "图片", -1)]),
2741
2699
  _: 1
2742
2700
  }),
2743
- _(T(D), {
2701
+ _(w(E), {
2744
2702
  size: "small",
2745
- onClick: t[67] ||= (e) => q({
2703
+ onClick: t[48] ||= (e) => Y({
2746
2704
  type: "insert-table",
2747
- options: fa.value
2705
+ options: Ii.value
2748
2706
  })
2749
2707
  }, {
2750
- default: E(() => [_(T(Wt), { "aria-hidden": "true" }), t[142] ||= h("span", null, "表格", -1)]),
2708
+ default: T(() => [_(w(an), { "aria-hidden": "true" }), t[91] ||= h("span", null, "表格", -1)]),
2751
2709
  _: 1
2752
2710
  }),
2753
- _(T(D), {
2711
+ _(w(E), {
2754
2712
  size: "small",
2755
- onClick: t[68] ||= (e) => q({ type: "insert-horizontal-rule" })
2713
+ onClick: t[49] ||= (e) => Y({ type: "insert-horizontal-rule" })
2756
2714
  }, {
2757
- default: E(() => [_(T(It), { "aria-hidden": "true" }), t[143] ||= h("span", null, "分隔线", -1)]),
2715
+ default: T(() => [_(w(Zt), { "aria-hidden": "true" }), t[92] ||= h("span", null, "分隔线", -1)]),
2758
2716
  _: 1
2759
2717
  }),
2760
- _(T(D), {
2718
+ _(w(E), {
2761
2719
  size: "small",
2762
- disabled: Ha.value,
2763
- onClick: rs
2720
+ disabled: _a.value,
2721
+ onClick: Io
2764
2722
  }, {
2765
- default: E(() => [_(T(At), { "aria-hidden": "true" }), t[144] ||= h("span", null, "新页面", -1)]),
2723
+ default: T(() => [_(w(Kt), { "aria-hidden": "true" }), t[93] ||= h("span", null, "新页面", -1)]),
2766
2724
  _: 1
2767
2725
  }, 8, ["disabled"]),
2768
- _(T(D), {
2726
+ _(w(E), {
2769
2727
  size: "small",
2770
- onClick: t[69] ||= (e) => q({ type: "select-all" })
2728
+ onClick: t[50] ||= (e) => Y({ type: "select-all" })
2771
2729
  }, {
2772
- default: E(() => [...t[145] ||= [h("span", null, "全选正文", -1)]]),
2730
+ default: T(() => [...t[94] ||= [h("span", null, "全选正文", -1)]]),
2773
2731
  _: 1
2774
2732
  })
2775
2733
  ])),
2776
- h("div", Br, [
2777
- _(T(O), {
2734
+ h("div", qn, [
2735
+ _(w(At), {
2778
2736
  class: "gd-contract-template-designer__context-menu-field gd-contract-template-designer__text-menu-font-size",
2779
- value: Ja.value,
2780
- options: Za.value,
2737
+ value: Ca.value,
2738
+ options: Ea.value,
2781
2739
  "show-search": "",
2782
2740
  "filter-option": !1,
2783
- "search-value": Ji.value,
2784
- onBlur: Ec,
2785
- onChange: xc,
2786
- onDropdownVisibleChange: Oc,
2787
- onInputKeyDown: Dc,
2788
- onSearch: Tc
2741
+ "search-value": _i.value,
2742
+ onBlur: mc,
2743
+ onChange: lc,
2744
+ onDropdownVisibleChange: gc,
2745
+ onInputKeyDown: hc,
2746
+ onSearch: pc
2789
2747
  }, null, 8, [
2790
2748
  "value",
2791
2749
  "options",
2792
2750
  "search-value"
2793
2751
  ]),
2794
- _(T(O), {
2752
+ _(w(At), {
2795
2753
  class: "gd-contract-template-designer__context-menu-field gd-contract-template-designer__text-menu-alignment",
2796
- value: W.value.textAlign,
2797
- options: T(ja),
2798
- onChange: yc
2754
+ value: G.value.textAlign,
2755
+ options: w(oa),
2756
+ onChange: sc
2799
2757
  }, null, 8, ["value", "options"]),
2800
- _(T(k), { title: "文字颜色" }, {
2801
- default: E(() => [h("input", {
2758
+ _(w(D), { title: "文字颜色" }, {
2759
+ default: T(() => [h("input", {
2802
2760
  class: "gd-contract-template-designer__context-menu-color",
2803
2761
  type: "color",
2804
2762
  "aria-label": "文字颜色",
2805
- value: Ya.value,
2806
- onInput: t[70] ||= (e) => wc(e.target.value)
2807
- }, null, 40, Vr)]),
2763
+ value: wa.value,
2764
+ onInput: t[51] ||= (e) => fc(e.target.value)
2765
+ }, null, 40, Jn)]),
2808
2766
  _: 1
2809
2767
  })
2810
2768
  ]),
2811
2769
  h("div", {
2812
2770
  class: "gd-contract-template-designer__text-menu-control-group",
2813
2771
  role: "group",
2814
- "aria-label": L.value.hasSelection ? "转换为正文控件" : "插入正文控件"
2772
+ "aria-label": z.value.hasSelection ? "转换为正文控件" : "插入正文控件"
2815
2773
  }, [
2816
- h("div", Ur, [h("strong", null, w(L.value.hasSelection ? "转换为正文控件" : "插入正文控件"), 1), h("span", null, w(L.value.hasSelection ? "替换选中内容" : "在光标处插入"), 1)]),
2817
- h("div", Wr, [(x(!0), m(u, null, C(Ba.value, (e) => (x(), f(T(k), {
2774
+ h("div", Xn, [h("strong", null, C(z.value.hasSelection ? "转换为正文控件" : "插入正文控件"), 1), h("span", null, C(z.value.hasSelection ? "替换选中内容" : "在光标处插入"), 1)]),
2775
+ h("div", Zn, [(x(!0), m(mt, null, yt(ha.value, (e) => (x(), f(w(D), {
2818
2776
  key: e.type,
2819
- title: L.value.hasSelection ? `转换为${e.label}控件` : `插入${e.label}控件`
2777
+ title: z.value.hasSelection ? `转换为${e.label}控件` : `插入${e.label}控件`
2820
2778
  }, {
2821
- default: E(() => [h("button", {
2779
+ default: T(() => [h("button", {
2822
2780
  type: "button",
2823
2781
  class: "gd-contract-template-designer__text-menu-control-option",
2824
- "aria-label": L.value.hasSelection ? `转换为${e.label}控件` : `插入${e.label}控件`,
2825
- onClick: (t) => bs(e.type)
2826
- }, [(x(), f(rt(e.icon), { "aria-hidden": "true" })), h("span", null, w(e.label), 1)], 8, Gr)]),
2782
+ "aria-label": z.value.hasSelection ? `转换为${e.label}控件` : `插入${e.label}控件`,
2783
+ onClick: (t) => es(e.type)
2784
+ }, [(x(), f(bt(e.icon), { "aria-hidden": "true" })), h("span", null, C(e.label), 1)], 8, Qn)]),
2827
2785
  _: 2
2828
2786
  }, 1032, ["title"]))), 128))]),
2829
- ia.value ? (x(), m(u, { key: 1 }, [_(T(ut), {
2830
- value: aa.value,
2831
- "onUpdate:value": t[71] ||= (e) => aa.value = e,
2787
+ Oi.value ? (x(), m(mt, { key: 1 }, [_(w(Et), {
2788
+ value: ki.value,
2789
+ "onUpdate:value": t[52] ||= (e) => ki.value = e,
2832
2790
  class: "gd-contract-template-designer__text-menu-bind-search",
2833
2791
  size: "small",
2834
2792
  "allow-clear": "",
2835
2793
  placeholder: "搜索已有控件",
2836
2794
  "aria-label": "搜索已有控件"
2837
- }, null, 8, ["value"]), h("div", qr, [(x(!0), m(u, null, C(Ua.value, (e) => (x(), m("button", {
2795
+ }, null, 8, ["value"]), h("div", er, [(x(!0), m(mt, null, yt(va.value, (e) => (x(), m("button", {
2838
2796
  key: e.id,
2839
2797
  type: "button",
2840
2798
  class: "gd-contract-template-designer__text-menu-bind-item",
2841
2799
  role: "option",
2842
- onClick: (t) => Ss(e)
2843
- }, [h("span", Yr, w(e.label), 1), h("span", Xr, w(Cs(e)) + " · " + w(e.key), 1)], 8, Jr))), 128)), Ua.value.length ? p("", !0) : (x(), m("p", Zr, " 暂无已有控件 "))])], 64)) : (x(), m("button", {
2800
+ onClick: (t) => ns(e)
2801
+ }, [h("span", nr, C(e.label), 1), h("span", rr, C(rs(e)) + " · " + C(e.key), 1)], 8, tr))), 128)), va.value.length ? p("", !0) : (x(), m("p", ir, " 暂无已有控件 "))])], 64)) : (x(), m("button", {
2844
2802
  key: 0,
2845
2803
  type: "button",
2846
2804
  class: "gd-contract-template-designer__text-menu-bind-toggle",
2847
- disabled: !j.value.variables.length,
2805
+ disabled: !P.value.variables.length,
2848
2806
  "aria-expanded": !1,
2849
2807
  "aria-label": "绑定已有控件",
2850
- onClick: ws
2851
- }, [t[146] ||= h("span", null, "绑定已有", -1), _(T(Dt), { "aria-hidden": "true" })], 8, Kr))
2852
- ], 8, Hr),
2853
- h("div", Qr, [
2854
- _(T(k), { title: "加粗" }, {
2855
- default: E(() => [_(T(D), {
2808
+ onClick: is
2809
+ }, [t[95] ||= h("span", null, "绑定已有", -1), _(w(Ut), { "aria-hidden": "true" })], 8, $n))
2810
+ ], 8, Yn),
2811
+ h("div", ar, [
2812
+ _(w(D), { title: "加粗" }, {
2813
+ default: T(() => [_(w(E), {
2856
2814
  size: "small",
2857
- class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": W.value.isBold }]),
2858
- "aria-pressed": W.value.isBold,
2815
+ class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": G.value.isBold }]),
2816
+ "aria-pressed": G.value.isBold,
2859
2817
  "aria-label": "加粗",
2860
- onClick: t[72] ||= (e) => q({ type: "toggle-bold" })
2818
+ onClick: t[53] ||= (e) => Y({ type: "toggle-bold" })
2861
2819
  }, {
2862
- default: E(() => [_(T(xt), { "aria-hidden": "true" })]),
2820
+ default: T(() => [_(w(Lt), { "aria-hidden": "true" })]),
2863
2821
  _: 1
2864
2822
  }, 8, ["class", "aria-pressed"])]),
2865
2823
  _: 1
2866
2824
  }),
2867
- _(T(k), { title: "斜体" }, {
2868
- default: E(() => [_(T(D), {
2825
+ _(w(D), { title: "斜体" }, {
2826
+ default: T(() => [_(w(E), {
2869
2827
  size: "small",
2870
- class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": W.value.isItalic }]),
2871
- "aria-pressed": W.value.isItalic,
2828
+ class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": G.value.isItalic }]),
2829
+ "aria-pressed": G.value.isItalic,
2872
2830
  "aria-label": "斜体",
2873
- onClick: t[73] ||= (e) => q({ type: "toggle-italic" })
2831
+ onClick: t[54] ||= (e) => Y({ type: "toggle-italic" })
2874
2832
  }, {
2875
- default: E(() => [_(T(Pt), { "aria-hidden": "true" })]),
2833
+ default: T(() => [_(w(Xt), { "aria-hidden": "true" })]),
2876
2834
  _: 1
2877
2835
  }, 8, ["class", "aria-pressed"])]),
2878
2836
  _: 1
2879
2837
  }),
2880
- _(T(k), { title: "下划线" }, {
2881
- default: E(() => [_(T(D), {
2838
+ _(w(D), { title: "下划线" }, {
2839
+ default: T(() => [_(w(E), {
2882
2840
  size: "small",
2883
- class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": W.value.isUnderline }]),
2884
- "aria-pressed": W.value.isUnderline,
2841
+ class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": G.value.isUnderline }]),
2842
+ "aria-pressed": G.value.isUnderline,
2885
2843
  "aria-label": "下划线",
2886
- onClick: t[74] ||= (e) => q({ type: "toggle-underline" })
2844
+ onClick: t[55] ||= (e) => Y({ type: "toggle-underline" })
2887
2845
  }, {
2888
- default: E(() => [_(T(Gt), { "aria-hidden": "true" })]),
2846
+ default: T(() => [_(w(on), { "aria-hidden": "true" })]),
2889
2847
  _: 1
2890
2848
  }, 8, ["class", "aria-pressed"])]),
2891
2849
  _: 1
2892
2850
  }),
2893
- t[147] ||= h("span", {
2851
+ t[96] ||= h("span", {
2894
2852
  class: "gd-contract-template-designer__text-menu-divider",
2895
2853
  "aria-hidden": "true"
2896
2854
  }, null, -1),
2897
- _(T(k), { title: "有序列表" }, {
2898
- default: E(() => [_(T(D), {
2855
+ _(w(D), { title: "有序列表" }, {
2856
+ default: T(() => [_(w(E), {
2899
2857
  size: "small",
2900
- class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": W.value.isOrderedList }]),
2901
- "aria-pressed": W.value.isOrderedList,
2858
+ class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": G.value.isOrderedList }]),
2859
+ "aria-pressed": G.value.isOrderedList,
2902
2860
  "aria-label": "有序列表",
2903
- onClick: t[75] ||= (e) => q({ type: "toggle-ordered-list" })
2861
+ onClick: t[56] ||= (e) => Y({ type: "toggle-ordered-list" })
2904
2862
  }, {
2905
- default: E(() => [_(T(Lt), { "aria-hidden": "true" })]),
2863
+ default: T(() => [_(w(Qt), { "aria-hidden": "true" })]),
2906
2864
  _: 1
2907
2865
  }, 8, ["class", "aria-pressed"])]),
2908
2866
  _: 1
2909
2867
  }),
2910
- _(T(k), { title: "无序列表" }, {
2911
- default: E(() => [_(T(D), {
2868
+ _(w(D), { title: "无序列表" }, {
2869
+ default: T(() => [_(w(E), {
2912
2870
  size: "small",
2913
- class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": W.value.isBulletList }]),
2914
- "aria-pressed": W.value.isBulletList,
2871
+ class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": G.value.isBulletList }]),
2872
+ "aria-pressed": G.value.isBulletList,
2915
2873
  "aria-label": "无序列表",
2916
- onClick: t[76] ||= (e) => q({ type: "toggle-bullet-list" })
2874
+ onClick: t[57] ||= (e) => Y({ type: "toggle-bullet-list" })
2917
2875
  }, {
2918
- default: E(() => [_(T(qt), { "aria-hidden": "true" })]),
2876
+ default: T(() => [_(w(cn), { "aria-hidden": "true" })]),
2919
2877
  _: 1
2920
2878
  }, 8, ["class", "aria-pressed"])]),
2921
2879
  _: 1
2922
2880
  })
2923
2881
  ]),
2924
- h("div", $r, [_(T(k), { title: "清除文字格式" }, {
2925
- default: E(() => [_(T(D), {
2882
+ h("div", or, [_(w(D), { title: "清除文字格式" }, {
2883
+ default: T(() => [_(w(E), {
2926
2884
  size: "small",
2927
2885
  class: "gd-contract-template-designer__text-menu-clear-action",
2928
2886
  "aria-label": "清除文字格式",
2929
- onClick: t[77] ||= (e) => q({ type: "clear-text-format" })
2887
+ onClick: t[58] ||= (e) => Y({ type: "clear-text-format" })
2930
2888
  }, {
2931
- default: E(() => [_(T(St), { "aria-hidden": "true" }), t[148] ||= h("span", null, "清文字", -1)]),
2889
+ default: T(() => [_(w(Rt), { "aria-hidden": "true" }), t[97] ||= h("span", null, "清文字", -1)]),
2932
2890
  _: 1
2933
2891
  })]),
2934
2892
  _: 1
2935
- }), _(T(k), { title: "清除段落格式" }, {
2936
- default: E(() => [_(T(D), {
2893
+ }), _(w(D), { title: "清除段落格式" }, {
2894
+ default: T(() => [_(w(E), {
2937
2895
  size: "small",
2938
2896
  class: "gd-contract-template-designer__text-menu-clear-action",
2939
2897
  "aria-label": "清除段落格式",
2940
- onClick: t[78] ||= (e) => q({ type: "clear-block-format" })
2898
+ onClick: t[59] ||= (e) => Y({ type: "clear-block-format" })
2941
2899
  }, {
2942
- default: E(() => [_(T(jt), { "aria-hidden": "true" }), t[149] ||= h("span", null, "清段落", -1)]),
2900
+ default: T(() => [_(w(qt), { "aria-hidden": "true" }), t[98] ||= h("span", null, "清段落", -1)]),
2943
2901
  _: 1
2944
2902
  })]),
2945
2903
  _: 1
@@ -2948,29 +2906,50 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
2948
2906
  ])),
2949
2907
  h("input", {
2950
2908
  ref_key: "imageFileInputElement",
2951
- ref: Oi,
2909
+ ref: Br,
2952
2910
  class: "gd-contract-template-designer__hidden-file-input",
2953
2911
  type: "file",
2954
2912
  accept: "image/png,image/jpeg,image/webp,image/gif,image/bmp",
2955
2913
  tabindex: "-1",
2956
2914
  "aria-hidden": "true",
2957
- onChange: es
2915
+ onChange: No
2958
2916
  }, null, 544),
2959
- h("span", ei, w(ua.value), 1),
2960
- _(T(ft), {
2961
- open: Li.value,
2962
- "onUpdate:open": t[79] ||= (e) => Li.value = e,
2917
+ h("span", sr, C(Pi.value), 1),
2918
+ _(w(Ot), {
2919
+ open: ii.value,
2920
+ "onUpdate:open": t[60] ||= (e) => ii.value = e,
2963
2921
  title: "模板预览",
2964
2922
  width: "min(1440px, calc(100vw - 32px))",
2965
2923
  centered: "",
2966
2924
  footer: null,
2967
2925
  "wrap-class-name": "gd-contract-template-designer__preview-modal",
2968
- onCancel: Ys
2926
+ onCancel: Os
2969
2927
  }, {
2970
- default: E(() => [h("div", ti, [(x(!0), m(u, null, C(_a.value, (e) => (x(), f(Re, {
2928
+ default: T(() => [h("div", { class: b(["gd-contract-template-designer__preview", { "is-multi-file": Gi.value.length > 0 }]) }, [Gi.value.length ? (x(), m("div", cr, [h("nav", lr, [t[99] ||= h("span", { class: "gd-contract-template-designer__preview-file-nav-title" }, "合同文件", -1), (x(!0), m(mt, null, yt(Gi.value, (e) => (x(), m("button", {
2929
+ key: e.file.id,
2930
+ type: "button",
2931
+ class: b(["gd-contract-template-designer__preview-file-tab", { "is-active": e.file.id === Ki.value?.file.id }]),
2932
+ "aria-current": e.file.id === Ki.value?.file.id ? "page" : void 0,
2933
+ onClick: (t) => si.value = e.file.id
2934
+ }, [
2935
+ _(w(Kt), { "aria-hidden": "true" }),
2936
+ h("span", null, C(e.file.name), 1),
2937
+ h("small", null, C(e.pages.length) + " 页", 1)
2938
+ ], 10, ur))), 128))]), Ki.value ? (x(), m("section", dr, [h("h3", fr, C(Ki.value.file.name), 1), (x(!0), m(mt, null, yt(Ki.value.pages, (e) => (x(), f(Re, {
2939
+ key: `${Ki.value.file.id}:${e.page.id}`,
2940
+ page: e.page,
2941
+ "fallback-page-size": Ki.value.file.template.pageSize,
2942
+ "content-html": e.contentHtml,
2943
+ "signing-placements": e.signingPlacements
2944
+ }, null, 8, [
2945
+ "page",
2946
+ "fallback-page-size",
2947
+ "content-html",
2948
+ "signing-placements"
2949
+ ]))), 128))])) : p("", !0)])) : (x(!0), m(mt, { key: 1 }, yt(Wi.value, (e) => (x(), f(Re, {
2971
2950
  key: e.page.id,
2972
2951
  page: e.page,
2973
- "fallback-page-size": Ri.value?.pageSize ?? T(be),
2952
+ "fallback-page-size": ai.value?.pageSize ?? w(pe),
2974
2953
  "content-html": e.contentHtml,
2975
2954
  "signing-placements": e.signingPlacements
2976
2955
  }, null, 8, [
@@ -2978,24 +2957,24 @@ var Xt = ["aria-label", "aria-expanded"], Zt = { class: "gd-contract-template-de
2978
2957
  "fallback-page-size",
2979
2958
  "content-html",
2980
2959
  "signing-placements"
2981
- ]))), 128))])]),
2960
+ ]))), 128))], 2)]),
2982
2961
  _: 1
2983
2962
  }, 8, ["open"]),
2984
- _(T(ft), {
2985
- open: zi.value,
2986
- "onUpdate:open": t[80] ||= (e) => zi.value = e,
2963
+ _(w(Ot), {
2964
+ open: ci.value,
2965
+ "onUpdate:open": t[61] ||= (e) => ci.value = e,
2987
2966
  title: "提交数据查看",
2988
2967
  width: "min(960px, calc(100vw - 48px))",
2989
2968
  centered: "",
2990
2969
  footer: null,
2991
2970
  "wrap-class-name": "gd-contract-template-designer__submit-data-modal",
2992
- onCancel: Qs
2971
+ onCancel: js
2993
2972
  }, {
2994
- default: E(() => [h("pre", ni, w(Bi.value), 1)]),
2973
+ default: T(() => [h("pre", pr, C(li.value), 1)]),
2995
2974
  _: 1
2996
2975
  }, 8, ["open"])
2997
2976
  ], 6));
2998
2977
  }
2999
2978
  });
3000
2979
  //#endregion
3001
- export { yi as default };
2980
+ export { Ar as default };