@rytass/bpm-core-react 0.17.7 → 0.17.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/chunks/{compose-DjEJi5Dv.cjs → compose-Cock_B2Q.cjs} +2 -2
  3. package/dist/chunks/{compose-DjEJi5Dv.cjs.map → compose-Cock_B2Q.cjs.map} +1 -1
  4. package/dist/chunks/{compose-WekGZj74.js → compose-jnvnnVfN.js} +2 -2
  5. package/dist/chunks/{compose-WekGZj74.js.map → compose-jnvnnVfN.js.map} +1 -1
  6. package/dist/chunks/{designer-D87ILhjz.js → designer-B8Gvew_k.js} +6 -2
  7. package/dist/chunks/designer-B8Gvew_k.js.map +1 -0
  8. package/dist/chunks/{designer-DESS0CMl.cjs → designer-CAEFV1ve.cjs} +2 -2
  9. package/dist/chunks/designer-CAEFV1ve.cjs.map +1 -0
  10. package/dist/chunks/{detail-URwxkcro.js → detail-CExpbazF.js} +926 -873
  11. package/dist/chunks/detail-CExpbazF.js.map +1 -0
  12. package/dist/chunks/detail-DIY-L4i-.cjs +2 -0
  13. package/dist/chunks/detail-DIY-L4i-.cjs.map +1 -0
  14. package/dist/chunks/{orgs-Lg7tXv2u.js → orgs-8hje_l2n.js} +9 -4
  15. package/dist/chunks/orgs-8hje_l2n.js.map +1 -0
  16. package/dist/chunks/{orgs-C8usknWb.cjs → orgs-BeeDDWL1.cjs} +2 -2
  17. package/dist/chunks/orgs-BeeDDWL1.cjs.map +1 -0
  18. package/dist/chunks/users-O2L_M3BK.cjs +2 -0
  19. package/dist/chunks/users-O2L_M3BK.cjs.map +1 -0
  20. package/dist/chunks/{users-DRbuDYF1.js → users-Pl6hY5Y5.js} +160 -93
  21. package/dist/chunks/users-Pl6hY5Y5.js.map +1 -0
  22. package/dist/pages/admin/orgs/index.cjs +1 -1
  23. package/dist/pages/admin/orgs/index.js +1 -1
  24. package/dist/pages/admin/users/index.cjs +1 -1
  25. package/dist/pages/admin/users/index.js +1 -1
  26. package/dist/pages/instances/detail/index.cjs +1 -1
  27. package/dist/pages/instances/detail/index.js +1 -1
  28. package/dist/pages/templates/compose/index.cjs +1 -1
  29. package/dist/pages/templates/compose/index.js +1 -1
  30. package/dist/pages/templates/designer/index.cjs +1 -1
  31. package/dist/pages/templates/designer/index.js +1 -1
  32. package/dist/views/admin/index.cjs +1 -1
  33. package/dist/views/admin/index.js +2 -2
  34. package/dist/views/admin/orgs/index.cjs +1 -1
  35. package/dist/views/admin/orgs/index.js +1 -1
  36. package/dist/views/admin/users/index.cjs +1 -1
  37. package/dist/views/admin/users/index.js +1 -1
  38. package/dist/views/inbox/index.cjs +1 -1
  39. package/dist/views/inbox/index.cjs.map +1 -1
  40. package/dist/views/inbox/index.js +159 -78
  41. package/dist/views/inbox/index.js.map +1 -1
  42. package/dist/views/instances/detail/index.cjs +1 -1
  43. package/dist/views/instances/detail/index.js +1 -1
  44. package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +9 -1
  45. package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +9 -1
  46. package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +7 -0
  47. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +7 -0
  48. package/dist/views/instances/detail/use-resubmit-comment-draft.d.cts +18 -0
  49. package/dist/views/instances/detail/use-resubmit-comment-draft.d.ts +18 -0
  50. package/dist/views/templates/compose/index.cjs +1 -1
  51. package/dist/views/templates/compose/index.js +1 -1
  52. package/dist/views/templates/designer/index.cjs +1 -1
  53. package/dist/views/templates/designer/index.js +1 -1
  54. package/package.json +3 -3
  55. package/dist/chunks/designer-D87ILhjz.js.map +0 -1
  56. package/dist/chunks/designer-DESS0CMl.cjs.map +0 -1
  57. package/dist/chunks/detail-D49NuNCn.cjs +0 -2
  58. package/dist/chunks/detail-D49NuNCn.cjs.map +0 -1
  59. package/dist/chunks/detail-URwxkcro.js.map +0 -1
  60. package/dist/chunks/orgs-C8usknWb.cjs.map +0 -1
  61. package/dist/chunks/orgs-Lg7tXv2u.js.map +0 -1
  62. package/dist/chunks/users-DRbuDYF1.js.map +0 -1
  63. package/dist/chunks/users-DVQicZIo.cjs +0 -2
  64. package/dist/chunks/users-DVQicZIo.cjs.map +0 -1
@@ -5,22 +5,22 @@ import { t as n } from "./bpm-form-field-Cao0rMol.js";
5
5
  import { t as r } from "./use-bpm-member-D57LKe_u.js";
6
6
  import { t as i } from "./format-member-label-DudVI55w.js";
7
7
  import { t as a } from "./task-node-label-CWZgOBj0.js";
8
- import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p, t as ee, u as m } from "./approver-filled-form-DuQGPtNB.js";
9
- import { o as te, t as ne } from "./FormRendererView-BsTwZkqU.js";
8
+ import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p, t as ee, u as te } from "./approver-filled-form-DuQGPtNB.js";
9
+ import { o as m, t as ne } from "./FormRendererView-BsTwZkqU.js";
10
10
  import '../style.css';import '../detail.css';/* empty css */
11
- import { Fragment as re, forwardRef as h, useCallback as ie, useEffect as g, useImperativeHandle as ae, useMemo as _, useRef as oe, useState as v } from "react";
12
- import { AutoComplete as se, Badge as ce, Button as y, Description as b, DescriptionContent as le, InlineMessage as x, Input as ue, Message as de, Modal as S, PageHeader as fe, Section as pe, SectionGroup as me, Select as C, Stepper as he, Table as ge, Textarea as _e, Tooltip as ve, Typography as w } from "@mezzanine-ui/react";
13
- import { Fragment as ye, jsx as T, jsxs as E } from "react/jsx-runtime";
14
- import { cancelAdhocDirective as be, cancelApprovalInstance as xe, configureAdhocCompletionNotification as Se, configureAdhocStageNotification as Ce, decideTask as we, listAdhocDirectives as Te, listAttachments as Ee, listTaskDecisions as D, listWorkflowWebhookDeliveries as De, readApprovalInstance as Oe, readAttachmentDownloadUrl as ke, readAttachmentPreviewUrl as Ae, readInstanceSignatures as je, requestAdhocCountersign as Me, requestAdhocPreApproval as Ne, resolveMemberProfiles as Pe, resubmitApprovalInstance as Fe, retryWorkflowWebhookDelivery as Ie, searchMembers as O, uploadAttachment as Le } from "@rytass/bpm-core-client/workflow";
15
- import Re from "@mezzanine-ui/react/ContentHeader";
16
- import { CheckedIcon as ze, ChevronLeftIcon as Be, ChevronRightIcon as Ve, DangerousOutlineIcon as He, DownloadIcon as Ue, FileSearchIcon as We, NotificationUnreadIcon as Ge, PlusIcon as Ke, RefreshCcwIcon as k, ResetIcon as qe, ShareIcon as Je, UserIcon as Ye, ZoomInIcon as Xe, ZoomOutIcon as A } from "@mezzanine-ui/icons";
17
- import { readNodeFillableFieldKeys as Ze, readRevealedFieldKeys as Qe, readTopLevelFieldKey as $e, resolveFieldAccess as et } from "@rytass/bpm-core-shared";
18
- import { buildFormRendererValues as tt, focusFormRendererField as nt, readFormDataSourceErrorMessage as rt, validateFormRendererValues as j } from "@rytass/bpm-core-client/form";
19
- import { Background as M, Controls as it, Handle as at, Position as N, ReactFlow as ot } from "@xyflow/react";
20
- import * as P from "dagre";
21
- import { Document as st, Page as ct } from "react-pdf";
22
- import { stepClasses as F } from "@mezzanine-ui/core/stepper";
23
- var I = {
11
+ import { Fragment as re, forwardRef as ie, useCallback as h, useEffect as g, useImperativeHandle as ae, useMemo as _, useRef as v, useState as y } from "react";
12
+ import { AutoComplete as oe, Badge as se, Button as b, Description as x, DescriptionContent as ce, InlineMessage as S, Input as le, Message as ue, Modal as C, PageHeader as de, Section as fe, SectionGroup as pe, Select as w, Stepper as me, Table as he, Textarea as ge, Tooltip as _e, Typography as T } from "@mezzanine-ui/react";
13
+ import { Fragment as ve, jsx as E, jsxs as D } from "react/jsx-runtime";
14
+ import { cancelAdhocDirective as ye, cancelApprovalInstance as be, configureAdhocCompletionNotification as xe, configureAdhocStageNotification as Se, decideTask as Ce, listAdhocDirectives as we, listAttachments as Te, listTaskDecisions as O, listWorkflowWebhookDeliveries as Ee, readApprovalInstance as De, readAttachmentDownloadUrl as Oe, readAttachmentPreviewUrl as ke, readInstanceSignatures as Ae, requestAdhocCountersign as je, requestAdhocPreApproval as Me, resolveMemberProfiles as Ne, resubmitApprovalInstance as Pe, retryWorkflowWebhookDelivery as Fe, searchMembers as k, uploadAttachment as Ie } from "@rytass/bpm-core-client/workflow";
15
+ import Le from "@mezzanine-ui/react/ContentHeader";
16
+ import { CheckedIcon as Re, ChevronLeftIcon as ze, ChevronRightIcon as Be, DangerousOutlineIcon as Ve, DownloadIcon as He, FileSearchIcon as Ue, NotificationUnreadIcon as We, PlusIcon as Ge, RefreshCcwIcon as Ke, ResetIcon as qe, ShareIcon as A, UserIcon as Je, ZoomInIcon as Ye, ZoomOutIcon as j } from "@mezzanine-ui/icons";
17
+ import { readNodeFillableFieldKeys as Xe, readRevealedFieldKeys as Ze, readTopLevelFieldKey as Qe, resolveFieldAccess as $e } from "@rytass/bpm-core-shared";
18
+ import { buildFormRendererValues as et, focusFormRendererField as tt, readFormDataSourceErrorMessage as M, validateFormRendererValues as nt } from "@rytass/bpm-core-client/form";
19
+ import { Background as rt, Controls as N, Handle as P, Position as F, ReactFlow as it } from "@xyflow/react";
20
+ import * as I from "dagre";
21
+ import { Document as at, Page as ot } from "react-pdf";
22
+ import { stepClasses as L } from "@mezzanine-ui/core/stepper";
23
+ var R = {
24
24
  root: "bpm_root_ehm7w",
25
25
  toolbar: "bpm_toolbar_R-tis",
26
26
  pageControls: "bpm_pageControls_jM-rC",
@@ -29,9 +29,9 @@ var I = {
29
29
  viewport: "bpm_viewport_DQXms",
30
30
  page: "bpm_page_Cv5Rg",
31
31
  state: "bpm_state_bpgp3"
32
- }, lt = 760, ut = 920, dt = 320, ft = 32, pt = .75, L = 1.75, mt = .25;
33
- function ht({ filename: e, fileUrl: t, onDownload: n }) {
34
- let r = oe(null), [i, a] = v(null), [o, s] = v(1), [c, l] = v(1), [u, d] = v(lt);
32
+ }, st = 760, ct = 920, lt = 320, ut = 32, dt = .75, ft = 1.75, pt = .25;
33
+ function mt({ filename: e, fileUrl: t, onDownload: n }) {
34
+ let r = v(null), [i, a] = y(null), [o, s] = y(1), [c, l] = y(1), [u, d] = y(st);
35
35
  g(() => {
36
36
  let e = r.current;
37
37
  if (!e || typeof ResizeObserver > "u") return;
@@ -44,41 +44,41 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
44
44
  a(null), s(1), l(1);
45
45
  }, [t]);
46
46
  let f = _(() => {
47
- let e = Math.max(dt, u - ft);
48
- return Math.round(Math.min(ut, e) * c);
49
- }, [c, u]), p = ie((e) => {
47
+ let e = Math.max(lt, u - ut);
48
+ return Math.round(Math.min(ct, e) * c);
49
+ }, [c, u]), p = h((e) => {
50
50
  a(e.numPages), s(1);
51
- }, []), ee = o > 1, m = i !== null && o < i, te = c > pt, ne = c < L, re = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, h = `${Math.round(c * 100)}%`;
52
- return /* @__PURE__ */ E("section", {
51
+ }, []), ee = o > 1, te = i !== null && o < i, m = c > dt, ne = c < ft, re = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, ie = `${Math.round(c * 100)}%`;
52
+ return /* @__PURE__ */ D("section", {
53
53
  "aria-label": `${e} PDF 預覽`,
54
- className: I.root,
55
- children: [/* @__PURE__ */ E("div", {
56
- className: I.toolbar,
54
+ className: R.root,
55
+ children: [/* @__PURE__ */ D("div", {
56
+ className: R.toolbar,
57
57
  children: [
58
- /* @__PURE__ */ E("div", {
59
- className: I.pageControls,
58
+ /* @__PURE__ */ D("div", {
59
+ className: R.pageControls,
60
60
  "aria-label": "頁面切換",
61
61
  children: [
62
- /* @__PURE__ */ T(y, {
62
+ /* @__PURE__ */ E(b, {
63
63
  "aria-label": "上一頁",
64
64
  disabled: !ee,
65
- icon: Be,
65
+ icon: ze,
66
66
  onClick: () => {
67
67
  s((e) => Math.max(1, e - 1));
68
68
  },
69
69
  size: "minor",
70
70
  variant: "base-secondary"
71
71
  }),
72
- /* @__PURE__ */ T(w, {
73
- className: I.counter,
72
+ /* @__PURE__ */ E(T, {
73
+ className: R.counter,
74
74
  component: "span",
75
75
  variant: "body",
76
76
  children: re
77
77
  }),
78
- /* @__PURE__ */ T(y, {
78
+ /* @__PURE__ */ E(b, {
79
79
  "aria-label": "下一頁",
80
- disabled: !m,
81
- icon: Ve,
80
+ disabled: !te,
81
+ icon: Be,
82
82
  onClick: () => {
83
83
  s((e) => i === null ? e : Math.min(i, e + 1));
84
84
  },
@@ -87,40 +87,40 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
87
87
  })
88
88
  ]
89
89
  }),
90
- /* @__PURE__ */ E("div", {
91
- className: I.zoomControls,
90
+ /* @__PURE__ */ D("div", {
91
+ className: R.zoomControls,
92
92
  "aria-label": "縮放",
93
93
  children: [
94
- /* @__PURE__ */ T(y, {
94
+ /* @__PURE__ */ E(b, {
95
95
  "aria-label": "縮小",
96
- disabled: !te,
97
- icon: A,
96
+ disabled: !m,
97
+ icon: j,
98
98
  onClick: () => {
99
- l((e) => Math.max(pt, e - mt));
99
+ l((e) => Math.max(dt, e - pt));
100
100
  },
101
101
  size: "minor",
102
102
  variant: "base-secondary"
103
103
  }),
104
- /* @__PURE__ */ T(w, {
105
- className: I.counter,
104
+ /* @__PURE__ */ E(T, {
105
+ className: R.counter,
106
106
  component: "span",
107
107
  variant: "body",
108
- children: h
108
+ children: ie
109
109
  }),
110
- /* @__PURE__ */ T(y, {
110
+ /* @__PURE__ */ E(b, {
111
111
  "aria-label": "放大",
112
112
  disabled: !ne,
113
- icon: Xe,
113
+ icon: Ye,
114
114
  onClick: () => {
115
- l((e) => Math.min(L, e + mt));
115
+ l((e) => Math.min(ft, e + pt));
116
116
  },
117
117
  size: "minor",
118
118
  variant: "base-secondary"
119
119
  })
120
120
  ]
121
121
  }),
122
- n ? /* @__PURE__ */ T(y, {
123
- icon: Ue,
122
+ n ? /* @__PURE__ */ E(b, {
123
+ icon: He,
124
124
  iconType: "leading",
125
125
  onClick: n,
126
126
  size: "minor",
@@ -128,19 +128,19 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
128
128
  children: "下載"
129
129
  }) : null
130
130
  ]
131
- }), /* @__PURE__ */ T("div", {
132
- className: I.viewport,
131
+ }), /* @__PURE__ */ E("div", {
132
+ className: R.viewport,
133
133
  ref: r,
134
- children: /* @__PURE__ */ T(st, {
135
- error: /* @__PURE__ */ T(R, { message: "PDF 無法載入。" }),
134
+ children: /* @__PURE__ */ E(at, {
135
+ error: /* @__PURE__ */ E(ht, { message: "PDF 無法載入。" }),
136
136
  file: t,
137
- loading: /* @__PURE__ */ T(R, { message: "正在載入 PDF..." }),
138
- noData: /* @__PURE__ */ T(R, { message: "沒有可預覽的 PDF。" }),
137
+ loading: /* @__PURE__ */ E(ht, { message: "正在載入 PDF..." }),
138
+ noData: /* @__PURE__ */ E(ht, { message: "沒有可預覽的 PDF。" }),
139
139
  onLoadSuccess: p,
140
140
  suspense: !1,
141
- children: /* @__PURE__ */ T(ct, {
142
- className: I.page,
143
- loading: /* @__PURE__ */ T(R, { message: "正在載入頁面..." }),
141
+ children: /* @__PURE__ */ E(ot, {
142
+ className: R.page,
143
+ loading: /* @__PURE__ */ E(ht, { message: "正在載入頁面..." }),
144
144
  pageNumber: o,
145
145
  renderAnnotationLayer: !0,
146
146
  renderTextLayer: !0,
@@ -150,10 +150,10 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
150
150
  })]
151
151
  });
152
152
  }
153
- function R({ message: e }) {
154
- return /* @__PURE__ */ T("div", {
155
- className: I.state,
156
- children: /* @__PURE__ */ T(w, {
153
+ function ht({ message: e }) {
154
+ return /* @__PURE__ */ E("div", {
155
+ className: R.state,
156
+ children: /* @__PURE__ */ E(T, {
157
157
  color: "text-neutral",
158
158
  variant: "body",
159
159
  children: e
@@ -174,47 +174,47 @@ function _t(e, t) {
174
174
  //#endregion
175
175
  //#region src/views/instances/detail/sections/shared.ts
176
176
  function vt(e) {
177
- let t = z(e, "from"), n = z(e, "to"), r = z(e, "reason");
177
+ let t = B(e, "from"), n = B(e, "to"), r = B(e, "reason");
178
178
  return !t || !n || !r ? null : {
179
179
  from: t,
180
180
  reason: r,
181
- ruleId: z(e, "ruleId"),
181
+ ruleId: B(e, "ruleId"),
182
182
  to: n
183
183
  };
184
184
  }
185
- function yt(e) {
185
+ function z(e) {
186
186
  try {
187
187
  let t = JSON.parse(e);
188
- return Array.isArray(t) ? t.map((e) => xt(e) ? vt(e) : null).filter((e) => e !== null) : [];
188
+ return Array.isArray(t) ? t.map((e) => bt(e) ? vt(e) : null).filter((e) => e !== null) : [];
189
189
  } catch {
190
190
  return [];
191
191
  }
192
192
  }
193
- function z(e, t) {
193
+ function B(e, t) {
194
194
  let n = e[t];
195
195
  return typeof n == "string" ? n : null;
196
196
  }
197
- function B(e, t) {
197
+ function V(e, t) {
198
198
  let n = e[t];
199
199
  return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
200
200
  }
201
- function bt(e, t) {
201
+ function yt(e, t) {
202
202
  let n = e[t];
203
203
  return typeof n == "number" ? n : null;
204
204
  }
205
- function V(e) {
205
+ function H(e) {
206
206
  return typeof e == "string" && e.trim().length > 0;
207
207
  }
208
- function xt(e) {
208
+ function bt(e) {
209
209
  return typeof e == "object" && !!e;
210
210
  }
211
- function St(e) {
211
+ function xt(e) {
212
212
  return e.status === "PENDING" || e.status === "IN_PROGRESS";
213
213
  }
214
- function H(e) {
215
- return rt(e) || (e instanceof Error ? e.message : "發生未知錯誤");
216
- }
217
214
  function U(e) {
215
+ return M(e) || (e instanceof Error ? e.message : "發生未知錯誤");
216
+ }
217
+ function St(e) {
218
218
  return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
219
219
  }
220
220
  function W(e) {
@@ -229,43 +229,43 @@ function wt(e) {
229
229
  function Tt(e) {
230
230
  return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
231
231
  }
232
- function G(e) {
232
+ function Et(e) {
233
233
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
234
234
  }
235
- function Et(e, t) {
235
+ function Dt(e, t) {
236
236
  return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
237
237
  }
238
- function K(e, t) {
238
+ function G(e, t) {
239
239
  if (!e) return "-";
240
240
  let n = t.get(e);
241
241
  return n ? i(n.name, n.email, "fullwidth") : e;
242
242
  }
243
- function Dt(e, t = /* @__PURE__ */ new Map()) {
244
- let n = yt(e.delegationChainJson);
245
- if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => K(e, t)).join("、")}` : "未指定";
246
- let r = K(e.assigneeMemberId, t), i = K(e.originalAssigneeMemberId, t);
243
+ function K(e, t = /* @__PURE__ */ new Map()) {
244
+ let n = z(e.delegationChainJson);
245
+ if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => G(e, t)).join("、")}` : "未指定";
246
+ let r = G(e.assigneeMemberId, t), i = G(e.originalAssigneeMemberId, t);
247
247
  return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
248
248
  }
249
- function Ot(e, t) {
249
+ function q(e, t) {
250
250
  return t ? e.assigneeMemberId === t || (e.openCandidateMemberIds ?? e.candidateMemberIds).includes(t) : !1;
251
251
  }
252
- function kt(e, t) {
253
- let n = e.filter((e) => Ot(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
252
+ function Ot(e, t) {
253
+ let n = e.filter((e) => q(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
254
254
  return n.find((e) => !e.isAdhoc) ?? n[0] ?? null;
255
255
  }
256
- function At(e, t) {
256
+ function kt(e, t) {
257
257
  if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
258
258
  if (t.data.returnBehavior.allowedTargets === "ANY") return e.nodes.filter((e) => e.id !== t.id).map((e) => ({
259
259
  id: e.id,
260
- name: `${e.data.label}(${G(e.type)})`
260
+ name: `${e.data.label}(${Et(e.type)})`
261
261
  }));
262
262
  let n = t.data.returnBehavior.allowedTargets === "INITIATOR" ? e.nodes.find((e) => e.type === "startEvent")?.id : e.edges.find((e) => e.target === t.id)?.source, r = e.nodes.find((e) => e.id === n);
263
263
  return r ? [{
264
264
  id: r.id,
265
- name: `${r.data.label}(${G(r.type)})`
265
+ name: `${r.data.label}(${Et(r.type)})`
266
266
  }] : [];
267
267
  }
268
- function q(e) {
268
+ function At(e) {
269
269
  return {
270
270
  email: e.email,
271
271
  id: e.memberId,
@@ -301,7 +301,7 @@ function Mt(e) {
301
301
  return !!e;
302
302
  }
303
303
  function Nt(e) {
304
- if (!xt(e)) return null;
304
+ if (!bt(e)) return null;
305
305
  let t = e.email, n = e.id, r = e.name;
306
306
  return typeof n == "string" && typeof r == "string" ? {
307
307
  email: typeof t == "string" ? t : null,
@@ -320,13 +320,13 @@ function Pt(e, t) {
320
320
  return r.length === 1 ? r[0] ?? null : null;
321
321
  }
322
322
  function J(e) {
323
- return V(e) ? {
323
+ return H(e) ? {
324
324
  text: e,
325
325
  type: "text"
326
326
  } : null;
327
327
  }
328
328
  function Ft(e, t, n = "neutral") {
329
- return V(t) ? {
329
+ return H(t) ? {
330
330
  label: e,
331
331
  text: t,
332
332
  tone: n,
@@ -346,35 +346,35 @@ function It(e, t, n, r) {
346
346
  function Y(e) {
347
347
  return !!e;
348
348
  }
349
- function X(e) {
349
+ function Lt(e) {
350
350
  let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
351
351
  return t === -1 ? e.length : t;
352
352
  }
353
- function Z(e) {
354
- return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || Lt(e) || Q(e.eventType, Ut(e));
353
+ function Rt(e) {
354
+ return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "INSTANCE_RESUBMITTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || zt(e) || Z(e.eventType, Ut(e));
355
355
  }
356
- function Lt(e) {
357
- return e.eventType === "TASK_CREATED" && B(Ut(e), "sequentialCandidateMemberIds").length > 0;
356
+ function zt(e) {
357
+ return e.eventType === "TASK_CREATED" && V(Ut(e), "sequentialCandidateMemberIds").length > 0;
358
358
  }
359
- function Rt(e) {
359
+ function Bt(e) {
360
360
  if (e.eventType !== "TASK_CANDIDATE_ACTIVATED" && e.eventType !== "TASK_CREATED") return [];
361
361
  let t = Ut(e);
362
362
  return [
363
- ...B(t, "sequentialCandidateMemberIds"),
364
- z(t, "candidateMemberId"),
365
- z(t, "previousMemberId")
366
- ].filter(V);
363
+ ...V(t, "sequentialCandidateMemberIds"),
364
+ B(t, "candidateMemberId"),
365
+ B(t, "previousMemberId")
366
+ ].filter(H);
367
367
  }
368
- var zt = /* @__PURE__ */ new Set([
368
+ var X = /* @__PURE__ */ new Set([
369
369
  "SERVICE_TASK_EXECUTED",
370
370
  "SERVICE_TASK_FAILED",
371
371
  "WEBHOOK_DELIVERY_RETRIED"
372
372
  ]);
373
- function Q(e, t) {
374
- return zt.has(e) && z(t, "action") === "NOTIFY_WEBHOOK";
373
+ function Z(e, t) {
374
+ return X.has(e) && B(t, "action") === "NOTIFY_WEBHOOK";
375
375
  }
376
- function Bt(e) {
377
- return z(e, "endpointLabel") ?? z(e, "endpointKey") ?? "外部系統";
376
+ function Q(e) {
377
+ return B(e, "endpointLabel") ?? B(e, "endpointKey") ?? "外部系統";
378
378
  }
379
379
  function Vt(e) {
380
380
  return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
@@ -383,16 +383,17 @@ function Ht(e, t) {
383
383
  if (e === "INSTANCE_STARTED") return "案件已發起";
384
384
  if (e === "INSTANCE_CANCELLED") return "案件已取消";
385
385
  if (e === "INSTANCE_EXPIRED") return "案件逾期,已由系統終止";
386
+ if (e === "INSTANCE_RESUBMITTED") return "申請人重新送出";
386
387
  if (e === "TOKEN_CREATED") return "流程路徑已建立";
387
388
  if (e === "ENGINE_PROCESS_REQUESTED") return "流程引擎已處理";
388
389
  if (e === "TOKEN_ADVANCED") return "流程已前進";
389
390
  if (e === "TASK_CREATED") return "待簽任務已建立";
390
391
  if (e === "TASK_CANDIDATE_ACTIVATED") return "輪到下一位簽核";
391
- if (e === "TASK_DECIDED") return Vt(z(t, "action"));
392
+ if (e === "TASK_DECIDED") return Vt(B(t, "action"));
392
393
  if (e === "SLA_TRIGGERED") return "時限提醒已觸發";
393
394
  if (e === "TASK_REASSIGNED") return "管理者改派待辦";
394
- if (Q(e, t)) {
395
- let n = Bt(t);
395
+ if (Z(e, t)) {
396
+ let n = Q(t);
396
397
  return e === "SERVICE_TASK_EXECUTED" ? `已通知外部系統:${n}` : e === "SERVICE_TASK_FAILED" ? `通知外部系統失敗:${n}` : `管理者重新傳送外部系統通知:${n}`;
397
398
  }
398
399
  return e;
@@ -400,13 +401,13 @@ function Ht(e, t) {
400
401
  function Ut(e) {
401
402
  try {
402
403
  let t = JSON.parse(e.payloadJson);
403
- return xt(t) ? t : {};
404
+ return bt(t) ? t : {};
404
405
  } catch {
405
406
  return {};
406
407
  }
407
408
  }
408
409
  function Wt(e, t) {
409
- return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && Q(e.eventType, t) || z(t, "action") === "REJECTED" || z(t, "instanceState") === "REJECTED";
410
+ return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && Z(e.eventType, t) || B(t, "action") === "REJECTED" || B(t, "instanceState") === "REJECTED";
410
411
  }
411
412
  function Gt(e) {
412
413
  return t(e);
@@ -414,52 +415,53 @@ function Gt(e) {
414
415
  function Kt(e, t, n, r) {
415
416
  if (e.eventType === "INSTANCE_STARTED") return _t({
416
417
  initiatorMemberId: e.actorMemberId,
417
- submittedByMemberId: z(t, "submittedByMemberId")
418
+ submittedByMemberId: B(t, "submittedByMemberId")
418
419
  }, r);
419
420
  if (e.eventType === "TASK_CANDIDATE_ACTIVATED") {
420
- let e = z(t, "candidateMemberId"), n = z(t, "previousMemberId");
421
+ let e = B(t, "candidateMemberId"), n = B(t, "previousMemberId");
421
422
  if (!e) return null;
422
- let i = K(e, r);
423
- return n ? `輪到:${i}(前一位:${K(n, r)})` : `輪到:${i}`;
423
+ let i = G(e, r);
424
+ return n ? `輪到:${i}(前一位:${G(n, r)})` : `輪到:${i}`;
424
425
  }
425
426
  if (e.eventType === "TASK_CREATED") {
426
- let e = B(t, "sequentialCandidateMemberIds");
427
- if (e.length) return `簽核順序:${e.map((e) => K(e, r)).join(" → ")}`;
428
- let n = z(t, "assigneeMemberId"), i = z(t, "originalAssigneeMemberId");
427
+ let e = V(t, "sequentialCandidateMemberIds");
428
+ if (e.length) return `簽核順序:${e.map((e) => G(e, r)).join(" → ")}`;
429
+ let n = B(t, "assigneeMemberId"), i = B(t, "originalAssigneeMemberId");
429
430
  if (!n) {
430
- let e = B(t, "candidateMemberIds");
431
- return e.length ? `候選簽核人:${e.map((e) => K(e, r)).join("、")}` : null;
431
+ let e = V(t, "candidateMemberIds");
432
+ return e.length ? `候選簽核人:${e.map((e) => G(e, r)).join("、")}` : null;
432
433
  }
433
- let a = K(n, r), o = K(i, r);
434
+ let a = G(n, r), o = G(i, r);
434
435
  return i && i !== n ? `待簽人:${a}(原簽核人:${o})` : `待簽人:${a}`;
435
436
  }
436
437
  if (e.eventType === "TASK_DECIDED") {
437
- let e = z(t, "action"), n = z(t, "comment"), i = e ? `決議:${Tt(e)}` : null, a = z(t, "transferToMemberId");
438
- return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(V).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(V).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${K(a, r)}`].filter(V).join(" · ") : i;
438
+ let e = B(t, "action"), n = B(t, "comment"), i = e ? `決議:${Tt(e)}` : null, a = B(t, "transferToMemberId");
439
+ return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(H).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(H).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${G(a, r)}`].filter(H).join(" · ") : i;
439
440
  }
440
441
  if (e.eventType === "TOKEN_ADVANCED") {
441
- let e = z(t, "action");
442
+ let e = B(t, "action");
442
443
  if (e) return `流程結果:${Tt(e)}`;
443
- let r = bt(t, "arrivedCount"), i = bt(t, "requiredCount");
444
+ let r = yt(t, "arrivedCount"), i = yt(t, "requiredCount");
444
445
  if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
445
- let a = z(t, "fromNodeId"), o = z(t, "toNodeId");
446
- if (a && o) return `由 ${Et(a, n)} 前進至 ${Et(o, n)}`;
446
+ let a = B(t, "fromNodeId"), o = B(t, "toNodeId");
447
+ if (a && o) return `由 ${Dt(a, n)} 前進至 ${Dt(o, n)}`;
447
448
  }
448
449
  if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
449
- let e = z(t, "state");
450
+ let e = B(t, "state");
450
451
  return e ? `案件狀態:${Ct(e)}` : null;
451
452
  }
452
453
  return null;
453
454
  }
454
455
  function qt(e, t, n, r, i, a, o, s = null) {
456
+ if (e.eventType === "INSTANCE_RESUBMITTED") return [Ft("簽核意見", B(t, "comment"))].filter(Y);
455
457
  if (e.eventType !== "TASK_DECIDED") return [J(Kt(e, t, n, o))].filter(Y);
456
- let c = e.taskId ? r.get(e.taskId) : null, l = z(t, "action") ?? c?.action ?? null, u = z(t, "comment") ?? c?.comment ?? null, d = z(t, "transferToMemberId") ?? c?.transferToMemberId ?? null, f = z(t, "signatureId") ?? c?.signatureId ?? null, p = f ? i.get(f) : null;
458
+ let c = e.taskId ? r.get(e.taskId) : null, l = B(t, "action") ?? c?.action ?? null, u = B(t, "comment") ?? c?.comment ?? null, d = B(t, "transferToMemberId") ?? c?.transferToMemberId ?? null, f = B(t, "signatureId") ?? c?.signatureId ?? null, p = f ? i.get(f) : null;
457
459
  return [
458
460
  J(l ? `決議:${Tt(l)}` : null),
459
461
  l === "REJECTED" ? Ft("拒絕原因", u ?? "-", "danger") : null,
460
462
  l === "APPROVED" ? Ft("同意說明", u) : null,
461
463
  l === "RETURNED" ? Ft("退回說明", u ?? "-") : null,
462
- l === "TRANSFERRED" ? J(`轉派給:${K(d, o)}`) : null,
464
+ l === "TRANSFERRED" ? J(`轉派給:${G(d, o)}`) : null,
463
465
  l === "TRANSFERRED" ? Ft("轉派說明", u ?? "-") : null,
464
466
  J(Jt(t, s)),
465
467
  p ? J(a?.valid ? `簽章:已驗證(${W(p.signedPayloadHash)})` : `簽章:待檢查(${W(p.signedPayloadHash)})`) : null
@@ -495,7 +497,7 @@ function Zt(e, t, n, r, i) {
495
497
  return Qt(e, n, r, i).reduce((e, t) => tn(e, $t(t, o, a)), /* @__PURE__ */ new Map());
496
498
  }
497
499
  function Qt(e, t, n, r) {
498
- let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(St).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
500
+ let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(xt).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
499
501
  ...i,
500
502
  ...a,
501
503
  ...o
@@ -525,8 +527,8 @@ function nn(e) {
525
527
  return e.type === "userTask" ? `未來簽核:${e.data.label}` : e.type === "serviceTask" ? `未來知會:${e.data.label}` : e.type === "exclusiveGateway" ? `未來分流:${e.data.label}` : e.type === "parallelGateway" ? `未來匯合:${e.data.label}` : e.type === "endEvent" ? `流程完成:${e.data.label}` : `未來節點:${e.data.label}`;
526
528
  }
527
529
  function rn(e, t, n, r, i, a, o, s, c, l = null) {
528
- let u = e.filter(Z).map((e) => {
529
- let t = Ut(e), n = e.nodeId ? Et(e.nodeId, r) : null;
530
+ let u = e.filter(Rt).map((e) => {
531
+ let t = Ut(e), n = e.nodeId ? Dt(e.nodeId, r) : null;
530
532
  return {
531
533
  descriptionParts: [
532
534
  J(n ? `節點:${n}` : "節點:全流程"),
@@ -538,17 +540,17 @@ function rn(e, t, n, r, i, a, o, s, c, l = null) {
538
540
  id: e.id,
539
541
  title: Ht(e.eventType, t)
540
542
  };
541
- }), d = t.filter(St).map((e) => ({
543
+ }), d = t.filter(xt).map((e) => ({
542
544
  descriptionParts: [
543
- J(`節點:${Et(e.nodeId, r)}`),
545
+ J(`節點:${Dt(e.nodeId, r)}`),
544
546
  It("處理者", e.assigneeMemberId, a, "未指定"),
545
547
  J(`建立時間:${Gt(e.createdAt)}`)
546
548
  ].filter(Y),
547
549
  error: !1,
548
550
  id: `pending-task-${e.id}`,
549
551
  title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
550
- })), f = new Set([...e.filter(Z).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(V)), p = r ? Xt(r, t, n, i, f).map((e) => ({
551
- descriptionParts: [J(`${G(e.type)} · 尚未抵達`)].filter(Y),
552
+ })), f = new Set([...e.filter(Rt).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(H)), p = r ? Xt(r, t, n, i, f).map((e) => ({
553
+ descriptionParts: [J(`${Et(e.type)} · 尚未抵達`)].filter(Y),
552
554
  error: !1,
553
555
  forcePending: !0,
554
556
  id: `future-node-${e.id}`,
@@ -581,17 +583,17 @@ var an = {
581
583
  function on(e, t, n, r) {
582
584
  let i = t.filter((t) => t.nodeId === e.id), a = i.find((e) => e.status === "PENDING" || e.status === "IN_PROGRESS"), o = i.find((e) => e.status === "CANCELLED"), s = i.find((e) => e.status === "COMPLETED"), c = n.filter((t) => t.currentNodeId === e.id), l = c.find((e) => e.status === "ACTIVE"), u = c.find((e) => e.status === "WAITING");
583
585
  if (a) return {
584
- secondaryLabel: `處理者 ${Dt(a)}`,
586
+ secondaryLabel: `處理者 ${K(a)}`,
585
587
  statusLabel: "待處理",
586
588
  tone: "current"
587
589
  };
588
590
  if (o) return {
589
- secondaryLabel: `已取消 ${Dt(o)}`,
591
+ secondaryLabel: `已取消 ${K(o)}`,
590
592
  statusLabel: "已取消",
591
593
  tone: "cancelled"
592
594
  };
593
595
  if (s) return {
594
- secondaryLabel: `已完成 ${Dt(s)}`,
596
+ secondaryLabel: `已完成 ${K(s)}`,
595
597
  statusLabel: "已完成",
596
598
  tone: "completed"
597
599
  };
@@ -615,7 +617,7 @@ function on(e, t, n, r) {
615
617
  ...d,
616
618
  secondaryLabel: r
617
619
  } : {
618
- secondaryLabel: G(e.type),
620
+ secondaryLabel: Et(e.type),
619
621
  statusLabel: "未抵達",
620
622
  tone: "neutral"
621
623
  };
@@ -627,15 +629,15 @@ async function sn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks
627
629
  n?.initiatorMemberId ?? null,
628
630
  n?.submittedByMemberId ?? null,
629
631
  ...e.map((e) => e.actorMemberId),
630
- ...e.flatMap(Rt),
632
+ ...e.flatMap(Bt),
631
633
  ...r.map((e) => e.assigneeMemberId),
632
634
  ...r.map((e) => e.originalAssigneeMemberId),
633
635
  ...r.flatMap((e) => e.candidateMemberIds),
634
- ...r.flatMap((e) => yt(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
636
+ ...r.flatMap((e) => z(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
635
637
  ...t.flatMap((e) => [e.createdByMemberId, ...cn(e.targetValueJson)])
636
- ].filter(V))];
638
+ ].filter(H))];
637
639
  try {
638
- return await Pe(i);
640
+ return await Ne(i);
639
641
  } catch {
640
642
  return [];
641
643
  }
@@ -648,7 +650,7 @@ function cn(e) {
648
650
  }
649
651
  }
650
652
  async function ln(e) {
651
- return (await Promise.all(e.map((e) => D(e.id)))).flat();
653
+ return (await Promise.all(e.map((e) => O(e.id)))).flat();
652
654
  }
653
655
  function un(e) {
654
656
  return e.reduce((e, t) => {
@@ -657,86 +659,129 @@ function un(e) {
657
659
  }, /* @__PURE__ */ new Map());
658
660
  }
659
661
  //#endregion
662
+ //#region src/views/instances/detail/use-resubmit-comment-draft.ts
663
+ function dn(e) {
664
+ let [t, n] = y({
665
+ instanceId: e,
666
+ text: ""
667
+ }), r = h((t) => n({
668
+ instanceId: e,
669
+ text: t
670
+ }), [e]);
671
+ return {
672
+ clearAfterResubmit: h((e) => n((t) => t.instanceId === e ? {
673
+ instanceId: e,
674
+ text: ""
675
+ } : t), []),
676
+ comment: t.instanceId === e ? t.text : "",
677
+ setComment: r
678
+ };
679
+ }
680
+ //#endregion
660
681
  //#region src/views/instances/detail/sections/InstanceFormSection.tsx
661
- var $ = {
682
+ var fn = {
662
683
  display: "grid",
663
684
  gap: 16
664
- }, dn = {
685
+ }, pn = {
665
686
  display: "flex",
666
687
  flexWrap: "wrap",
667
688
  gap: 8
689
+ }, mn = 2e3, hn = {
690
+ minWidth: "100%",
691
+ width: "100%"
668
692
  };
669
- function fn({ canResubmitInstance: e, deciding: t, error: n, fieldAccess: r, fieldLabelMarkers: i, fill: a = null, instance: o, loading: s, onDataSourceStateChange: c, onResubmitFormChange: l, onReloadAfterConflict: d = null, onResubmitInstance: f, onUploadAttachment: p, resubmitFormData: ee, resubmitFormErrors: m }) {
670
- let te = o?.formDefinitionSnapshot.schema, re = o?.workflowSnapshot, h = _(() => e && te && re ? u(te, re) : a?.schema ?? te, [
693
+ function $(e) {
694
+ e && (e.style.width = "100%");
695
+ }
696
+ function gn({ canResubmitInstance: e, deciding: t, error: r, fieldAccess: i, fieldLabelMarkers: a, fill: o = null, instance: s, loading: c, onDataSourceStateChange: l, onResubmitFormChange: d, onReloadAfterConflict: f = null, onResubmitCommentChange: p = null, onResubmitInstance: ee, onUploadAttachment: te, resubmitComment: m = "", resubmitFormData: re, resubmitFormErrors: ie }) {
697
+ let h = s?.formDefinitionSnapshot.schema, g = s?.workflowSnapshot, ae = _(() => e && h && g ? u(h, g) : o?.schema ?? h, [
671
698
  e,
672
- a?.schema,
673
- te,
674
- re
675
- ]), ie = !e && a !== null;
676
- return /* @__PURE__ */ E("div", {
677
- style: $,
699
+ o?.schema,
700
+ h,
701
+ g
702
+ ]), v = !e && o !== null;
703
+ return /* @__PURE__ */ D("div", {
704
+ style: fn,
678
705
  children: [
679
- n ? /* @__PURE__ */ T(w, {
706
+ r ? /* @__PURE__ */ E(T, {
680
707
  color: "text-error",
681
708
  variant: "body",
682
- children: n
709
+ children: r
683
710
  }) : null,
684
- s ? /* @__PURE__ */ T(w, {
711
+ c ? /* @__PURE__ */ E(T, {
685
712
  color: "text-neutral",
686
713
  variant: "body",
687
714
  children: "載入中..."
688
715
  }) : null,
689
- d ? /* @__PURE__ */ E("div", {
690
- style: $,
691
- children: [/* @__PURE__ */ T(x, {
716
+ f ? /* @__PURE__ */ D("div", {
717
+ style: fn,
718
+ children: [/* @__PURE__ */ E(S, {
692
719
  content: "表單在你填寫期間被更新了,你填的內容還在。請重新載入後確認再同意。",
693
720
  severity: "error"
694
- }), /* @__PURE__ */ T("div", {
695
- style: dn,
696
- children: /* @__PURE__ */ T(y, {
697
- disabled: s,
698
- icon: k,
721
+ }), /* @__PURE__ */ E("div", {
722
+ style: pn,
723
+ children: /* @__PURE__ */ E(b, {
724
+ disabled: c,
725
+ icon: Ke,
699
726
  iconType: "leading",
700
- onClick: d,
727
+ onClick: f,
701
728
  variant: "base-secondary",
702
729
  children: "重新載入"
703
730
  })
704
731
  })]
705
732
  }) : null,
706
- ie && a.fieldCount > 0 ? /* @__PURE__ */ T(x, {
707
- content: `本關需要你補填 ${a.fieldCount} 個欄位,按「同意」時會一起送出並納入簽章。`,
733
+ v && o.fieldCount > 0 ? /* @__PURE__ */ E(S, {
734
+ content: `本關需要你補填 ${o.fieldCount} 個欄位,按「同意」時會一起送出並納入簽章。`,
708
735
  severity: "info"
709
736
  }) : null,
710
- h && o?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ E(ye, { children: [/* @__PURE__ */ T(ne, {
711
- dataSourceContext: e ? {
712
- instanceId: o.id,
713
- kind: "runtime"
714
- } : void 0,
715
- dataSourceInitialValues: o.formData,
716
- errors: ie ? a.errors : m,
717
- ...!e && r ? { fieldAccess: r } : {},
718
- ...!e && i ? { fieldLabelMarkers: i } : {},
719
- onChange: (e) => {
720
- ie ? a.onChange(e) : l(e);
721
- },
722
- onDataSourceStateChange: c,
723
- onUploadAttachment: e ? p : void 0,
724
- optionSnapshots: o.formDataOptionSnapshot,
725
- readonly: !e,
726
- schema: h,
727
- uiSchema: o.formDefinitionSnapshot.uiSchema,
728
- value: e ? ee : ie ? a.value : o.formData
729
- }), e ? /* @__PURE__ */ T("div", {
730
- style: dn,
731
- children: /* @__PURE__ */ T(y, {
732
- disabled: t,
733
- icon: k,
734
- iconType: "leading",
735
- onClick: f,
736
- variant: "base-primary",
737
- children: "重新送出"
738
- })
739
- }) : null] }) : /* @__PURE__ */ T(w, {
737
+ ae && s?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ D(ve, { children: [
738
+ /* @__PURE__ */ E(ne, {
739
+ dataSourceContext: e ? {
740
+ instanceId: s.id,
741
+ kind: "runtime"
742
+ } : void 0,
743
+ dataSourceInitialValues: s.formData,
744
+ errors: v ? o.errors : ie,
745
+ ...!e && i ? { fieldAccess: i } : {},
746
+ ...!e && a ? { fieldLabelMarkers: a } : {},
747
+ onChange: (e) => {
748
+ v ? o.onChange(e) : d(e);
749
+ },
750
+ onDataSourceStateChange: l,
751
+ onUploadAttachment: e ? te : void 0,
752
+ optionSnapshots: s.formDataOptionSnapshot,
753
+ readonly: !e,
754
+ schema: ae,
755
+ uiSchema: s.formDefinitionSnapshot.uiSchema,
756
+ value: e ? re : v ? o.value : s.formData
757
+ }),
758
+ e && p ? /* @__PURE__ */ E(n, {
759
+ label: "簽核意見",
760
+ name: "resubmitComment",
761
+ children: /* @__PURE__ */ E(ge, {
762
+ disabled: t,
763
+ onChange: (e) => p(e.target.value),
764
+ placeholder: "選填,例如說明這次補正或修改了哪些內容",
765
+ maxLength: mn,
766
+ ref: $,
767
+ resize: "vertical",
768
+ rows: 4,
769
+ style: hn,
770
+ value: m
771
+ })
772
+ }) : null,
773
+ e ? /* @__PURE__ */ E("div", {
774
+ style: pn,
775
+ children: /* @__PURE__ */ E(b, {
776
+ disabled: t,
777
+ icon: Ke,
778
+ iconType: "leading",
779
+ onClick: ee,
780
+ variant: "base-primary",
781
+ children: "重新送出"
782
+ })
783
+ }) : null
784
+ ] }) : /* @__PURE__ */ E(T, {
740
785
  color: "text-neutral",
741
786
  variant: "body",
742
787
  children: "此案件沒有可顯示的表單快照。"
@@ -746,11 +791,11 @@ function fn({ canResubmitInstance: e, deciding: t, error: n, fieldAccess: r, fie
746
791
  }
747
792
  //#endregion
748
793
  //#region src/views/instances/detail/sections/InstanceAttachmentsSection.tsx
749
- var pn = {
794
+ var _n = {
750
795
  display: "grid",
751
796
  gap: 16
752
797
  };
753
- function mn({ attachments: e, onDownload: n, onPreview: r }) {
798
+ function vn({ attachments: e, onDownload: n, onPreview: r }) {
754
799
  let i = _(() => e.map((e) => ({
755
800
  attachment: e,
756
801
  createdAt: e.createdAt,
@@ -758,7 +803,7 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
758
803
  id: e.id,
759
804
  key: e.id,
760
805
  mimeType: e.mimeType,
761
- sizeLabel: U(Number(e.sizeBytes))
806
+ sizeLabel: St(Number(e.sizeBytes))
762
807
  })), [e]), a = _(() => [
763
808
  {
764
809
  dataIndex: "filename",
@@ -780,7 +825,7 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
780
825
  },
781
826
  {
782
827
  key: "createdAt",
783
- render: (e) => /* @__PURE__ */ T(w, {
828
+ render: (e) => /* @__PURE__ */ E(T, {
784
829
  component: "span",
785
830
  variant: "body",
786
831
  children: t(e.createdAt)
@@ -790,14 +835,14 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
790
835
  }
791
836
  ], []), o = _(() => ({
792
837
  render: (e) => [...e.mimeType === "application/pdf" ? [{
793
- icon: We,
838
+ icon: Ue,
794
839
  iconType: "leading",
795
840
  name: "預覽",
796
841
  onClick: () => {
797
842
  r(e.attachment);
798
843
  }
799
844
  }] : [], {
800
- icon: Ue,
845
+ icon: He,
801
846
  iconType: "leading",
802
847
  name: "下載",
803
848
  onClick: () => {
@@ -807,18 +852,18 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
807
852
  variant: "base-secondary",
808
853
  width: 160
809
854
  }), [n, r]);
810
- return /* @__PURE__ */ E("div", {
811
- style: pn,
812
- children: [/* @__PURE__ */ T(w, {
855
+ return /* @__PURE__ */ D("div", {
856
+ style: _n,
857
+ children: [/* @__PURE__ */ E(T, {
813
858
  component: "h2",
814
859
  variant: "h3",
815
860
  children: "附件"
816
- }), i.length > 0 ? /* @__PURE__ */ T(ge, {
861
+ }), i.length > 0 ? /* @__PURE__ */ E(he, {
817
862
  actions: o,
818
863
  columns: a,
819
864
  dataSource: i,
820
865
  fullWidth: !0
821
- }) : /* @__PURE__ */ T(w, {
866
+ }) : /* @__PURE__ */ E(T, {
822
867
  color: "text-neutral",
823
868
  variant: "body",
824
869
  children: "此案件沒有附件。"
@@ -827,58 +872,62 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
827
872
  }
828
873
  //#endregion
829
874
  //#region src/views/instances/detail/sections/InstanceTasksSection.tsx
830
- var hn = {
875
+ var yn = {
831
876
  display: "grid",
832
877
  gap: 12,
833
878
  width: "100%"
834
- }, gn = {
879
+ }, bn = {
835
880
  minWidth: "100%",
836
881
  width: "100%"
837
- }, _n = {
882
+ }, xn = {
838
883
  display: "grid",
839
884
  gap: 12,
840
885
  width: "100%"
841
- }, vn = { marginTop: 12 }, yn = { marginTop: 24 };
842
- function bn(e) {
886
+ }, Sn = { marginTop: 12 }, Cn = { marginTop: 24 };
887
+ function wn(e) {
843
888
  e && (e.style.width = "100%");
844
889
  }
845
- var xn = {
890
+ var Tn = {
846
891
  COMPLETION_NOTIFY: "結案通知",
847
892
  COUNTERSIGN: "臨時會簽",
848
893
  PRE_APPROVAL: "臨時加簽",
849
894
  STAGE_NOTIFY: "階段完成通知"
850
- }, Sn = {
895
+ }, En = {
851
896
  COMPLETION_NOTIFY: "本張單到達結案狀態(核准 / 拒絕 / 取消)後,通知指定對象。",
852
897
  COUNTERSIGN: "指定對象會併入下一層簽核,下一層需所有人都完成才會繼續。",
853
898
  PRE_APPROVAL: "指定對象需先完成加簽,本階段才會往下一層繼續。",
854
899
  STAGE_NOTIFY: "本階段完成後(不論通過與否)通知指定對象。"
855
- }, Cn = [{
900
+ }, Dn = [{
856
901
  id: "REJECT_INSTANCE",
857
902
  name: "加簽拒絕時整單駁回"
858
903
  }, {
859
904
  id: "RETURN_TO_ORIGIN",
860
905
  name: "加簽拒絕時退回給我重新處理"
861
- }], wn = [{
906
+ }], On = [{
862
907
  id: "MEMBER",
863
908
  name: "指定成員"
864
909
  }, {
865
910
  id: "WEBHOOK",
866
911
  name: "Webhook"
867
- }], Tn = h(function({ adhocDirectives: e, currentMemberId: r, fill: i = null, instance: o, memberProfilesById: s, onChanged: c, onFillApproveError: l, tasks: u }, d) {
868
- let [f, p] = v(!1), [ee, m] = v(null), [te, ne] = v(""), [re, h] = v(!1), [ie, g] = v(""), [oe, x] = v(null), [de, fe] = v(!1), [pe, me] = v(""), [he, ve] = v(!1), [xe, Te] = v(null), [Ee, D] = v(""), [De, Oe] = v(null), [ke, Ae] = v(!1), [je, Pe] = v([]), [Fe, Ie] = v(!1), [Le, Re] = v(""), [ze, Be] = v([]), [Ve, He] = v(!1), [Ue, We] = v([]), [Ge, Ke] = v(!1), [k, qe] = v("COUNTERSIGN"), [Je, Ye] = v("REJECT_INSTANCE"), [Xe, A] = v(!1), [Ze, Qe] = v("MEMBER"), [$e, et] = v(""), tt = ie.trim(), nt = pe.trim(), rt = Ee.trim(), j = _(() => kt(u, r), [r, u]), M = _(() => j && o ? o.workflowSnapshot.nodes.find((e) => e.id === j.nodeId) ?? null : null, [j, o]), it = _(() => M && o ? At(o.workflowSnapshot, M) : [], [M, o]), at = M?.type === "userTask" && M.data.returnBehavior.allowReturn, N = M?.type === "userTask" && M.data.allowReject !== !1, ot = M?.type === "userTask" && M.data.allowTransfer !== !1, P = M?.type === "userTask" && M.data.returnBehavior.requireComment === !0, st = M?.type === "userTask" && M.data.allowAddSigner, ct = _(() => e.filter((e) => e.status === "PENDING"), [e]), F = it.find((e) => e.id === xe) ?? it[0] ?? null, I = _(() => u.map((e) => ({
912
+ }], kn = ie(function({ adhocDirectives: e, currentMemberId: r, fill: i = null, instance: o, memberProfilesById: s, onChanged: c, onDecidingChange: l, onFillApproveError: u, tasks: d }, f) {
913
+ let [p, ee] = y(!1), [te, m] = y(null);
914
+ g(() => {
915
+ l?.(p);
916
+ }, [p, l]);
917
+ let [ne, re] = y(""), [ie, h] = y(!1), [v, S] = y(""), [ue, de] = y(null), [fe, pe] = y(!1), [me, _e] = y(""), [be, we] = y(!1), [Te, O] = y(null), [Ee, De] = y(""), [Oe, ke] = y(null), [Ae, Ne] = y(!1), [Pe, Fe] = y([]), [Ie, Le] = y(!1), [Re, ze] = y(""), [Be, Ve] = y([]), [He, Ue] = y(!1), [We, Ge] = y([]), [Ke, qe] = y(!1), [A, Je] = y("COUNTERSIGN"), [Ye, j] = y("REJECT_INSTANCE"), [Xe, Ze] = y(!1), [Qe, $e] = y("MEMBER"), [et, tt] = y(""), M = v.trim(), nt = me.trim(), rt = Ee.trim(), N = _(() => Ot(d, r), [r, d]), P = _(() => N && o ? o.workflowSnapshot.nodes.find((e) => e.id === N.nodeId) ?? null : null, [N, o]), F = _(() => P && o ? kt(o.workflowSnapshot, P) : [], [P, o]), it = P?.type === "userTask" && P.data.returnBehavior.allowReturn, I = P?.type === "userTask" && P.data.allowReject !== !1, at = P?.type === "userTask" && P.data.allowTransfer !== !1, ot = P?.type === "userTask" && P.data.returnBehavior.requireComment === !0, L = P?.type === "userTask" && P.data.allowAddSigner, R = _(() => e.filter((e) => e.status === "PENDING"), [e]), st = F.find((e) => e.id === Te) ?? F[0] ?? null, ct = _(() => d.map((e) => ({
869
918
  ...e,
870
- assigneeLabel: Dt(e, s),
871
- fillFieldCount: Dn(e, o?.workflowSnapshot ?? null),
919
+ assigneeLabel: K(e, s),
920
+ fillFieldCount: jn(e, o?.workflowSnapshot ?? null),
872
921
  key: e.id,
873
922
  nodeLabel: a({
874
923
  ...e,
875
- nodeLabel: Et(e.nodeId, o?.workflowSnapshot ?? null)
924
+ nodeLabel: Dt(e.nodeId, o?.workflowSnapshot ?? null)
876
925
  }),
877
926
  statusLabel: wt(e.status)
878
927
  })), [
879
928
  o,
880
929
  s,
881
- u
930
+ d
882
931
  ]), lt = _(() => [
883
932
  {
884
933
  dataIndex: "nodeLabel",
@@ -889,7 +938,7 @@ var xn = {
889
938
  {
890
939
  key: "assigneeMemberId",
891
940
  title: "處理者",
892
- render: (e) => /* @__PURE__ */ T(w, {
941
+ render: (e) => /* @__PURE__ */ E(T, {
893
942
  component: "span",
894
943
  variant: "body",
895
944
  children: e.assigneeLabel
@@ -904,7 +953,7 @@ var xn = {
904
953
  },
905
954
  {
906
955
  key: "fill",
907
- render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ T(ce, {
956
+ render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ E(se, {
908
957
  size: "sub",
909
958
  text: `需補填 ${e.fillFieldCount} 欄`,
910
959
  variant: "dot-warning"
@@ -914,7 +963,7 @@ var xn = {
914
963
  },
915
964
  {
916
965
  key: "createdAt",
917
- render: (e) => /* @__PURE__ */ T(w, {
966
+ render: (e) => /* @__PURE__ */ E(T, {
918
967
  component: "span",
919
968
  variant: "body",
920
969
  children: t(e.createdAt)
@@ -922,13 +971,13 @@ var xn = {
922
971
  title: "建立時間",
923
972
  width: 220
924
973
  }
925
- ], []), ut = _(() => ct.map((e) => ({
974
+ ], []), ut = _(() => R.map((e) => ({
926
975
  ...e,
927
- createdByLabel: K(e.createdByMemberId, s),
976
+ createdByLabel: G(e.createdByMemberId, s),
928
977
  key: e.id,
929
- targetLabel: En(e, s),
930
- typeLabel: xn[e.type]
931
- })), [s, ct]), dt = _(() => [
978
+ targetLabel: An(e, s),
979
+ typeLabel: Tn[e.type]
980
+ })), [s, R]), dt = _(() => [
932
981
  {
933
982
  dataIndex: "typeLabel",
934
983
  key: "typeLabel",
@@ -937,7 +986,7 @@ var xn = {
937
986
  },
938
987
  {
939
988
  key: "targetLabel",
940
- render: (e) => /* @__PURE__ */ T(w, {
989
+ render: (e) => /* @__PURE__ */ E(T, {
941
990
  component: "span",
942
991
  variant: "body",
943
992
  children: e.targetLabel
@@ -947,7 +996,7 @@ var xn = {
947
996
  },
948
997
  {
949
998
  key: "createdByLabel",
950
- render: (e) => /* @__PURE__ */ T(w, {
999
+ render: (e) => /* @__PURE__ */ E(T, {
951
1000
  component: "span",
952
1001
  variant: "body",
953
1002
  children: e.createdByLabel
@@ -957,7 +1006,7 @@ var xn = {
957
1006
  },
958
1007
  {
959
1008
  key: "createdAt",
960
- render: (e) => /* @__PURE__ */ T(w, {
1009
+ render: (e) => /* @__PURE__ */ E(T, {
961
1010
  component: "span",
962
1011
  variant: "body",
963
1012
  children: t(e.createdAt)
@@ -967,342 +1016,342 @@ var xn = {
967
1016
  },
968
1017
  {
969
1018
  key: "actions",
970
- render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ T(y, {
1019
+ render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ E(b, {
971
1020
  disabled: Xe,
972
- onClick: () => void Tt(e.id),
1021
+ onClick: () => void q(e.id),
973
1022
  size: "minor",
974
1023
  variant: "destructive-secondary",
975
1024
  children: "撤回"
976
- }) : /* @__PURE__ */ T(ye, {}),
1025
+ }) : /* @__PURE__ */ E(ve, {}),
977
1026
  title: "操作",
978
1027
  width: 100
979
1028
  }
980
1029
  ], [Xe, r]);
981
1030
  async function ft({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
982
- if (!r || !j || e === "REJECTED" && !N || e === "TRANSFERRED" && !ot) return !1;
983
- p(!0), m(null);
984
- let o = e === "APPROVED" && i !== null && !j.isAdhoc ? {
1031
+ if (!r || !N || e === "REJECTED" && !I || e === "TRANSFERRED" && !at) return !1;
1032
+ ee(!0), m(null);
1033
+ let o = e === "APPROVED" && i !== null && !N.isAdhoc ? {
985
1034
  expectedFormDataFingerprint: i.expectedFormDataFingerprint,
986
1035
  formData: i.formData
987
1036
  } : null;
988
1037
  try {
989
- await we({
1038
+ await Ce({
990
1039
  action: e,
991
1040
  comment: t,
992
1041
  decidedByMemberId: r,
993
1042
  fill: o,
994
1043
  returnToNodeId: n,
995
- taskId: j.id,
1044
+ taskId: N.id,
996
1045
  transferToMemberId: a
997
- }), fe(!1), ve(!1), Ie(!1), g(""), me(""), D(""), Oe(null), Te(null), x(null);
1046
+ }), pe(!1), we(!1), Le(!1), S(""), _e(""), De(""), ke(null), O(null), de(null);
998
1047
  } catch (e) {
999
- return p(!1), o !== null && e instanceof Error && l?.(e.message) === !0 ? (h(!1), !1) : (m(H(e)), !1);
1048
+ return ee(!1), o !== null && e instanceof Error && u?.(e.message) === !0 ? (h(!1), !1) : (m(U(e)), !1);
1000
1049
  }
1001
1050
  try {
1002
1051
  await c();
1003
1052
  } catch (e) {
1004
- m(H(e));
1053
+ m(U(e));
1005
1054
  } finally {
1006
- p(!1);
1055
+ ee(!1);
1007
1056
  }
1008
1057
  return !0;
1009
1058
  }
1010
1059
  function pt() {
1011
- r && j && (m(null), h(!0));
1060
+ r && N && (m(null), h(!0));
1012
1061
  }
1013
- function L() {
1014
- f || (h(!1), ne(""));
1062
+ function mt() {
1063
+ p || (h(!1), re(""));
1015
1064
  }
1016
- async function mt() {
1017
- f || await ft({
1065
+ async function ht() {
1066
+ p || await ft({
1018
1067
  action: "APPROVED",
1019
- comment: te.trim() || null
1020
- }) && (h(!1), ne(""));
1021
- }
1022
- function ht() {
1023
- N && (g(""), x(null), fe(!0));
1024
- }
1025
- function R() {
1026
- f || (fe(!1), g(""), x(null));
1068
+ comment: ne.trim() || null
1069
+ }) && (h(!1), re(""));
1027
1070
  }
1028
1071
  function gt() {
1029
- me(""), Te(it[0]?.id ?? null), ve(!0);
1072
+ I && (S(""), de(null), pe(!0));
1030
1073
  }
1031
1074
  function _t() {
1032
- f || (ve(!1), me(""), Te(null));
1075
+ p || (pe(!1), S(""), de(null));
1033
1076
  }
1034
1077
  function vt() {
1035
- ot && (D(""), Oe(null), Ie(!0), z(""));
1078
+ _e(""), O(F[0]?.id ?? null), we(!0);
1079
+ }
1080
+ function z() {
1081
+ p || (we(!1), _e(""), O(null));
1082
+ }
1083
+ function B() {
1084
+ at && (De(""), ke(null), Le(!0), yt(""));
1036
1085
  }
1037
- function yt() {
1038
- f || (Ie(!1), D(""), Oe(null));
1086
+ function V() {
1087
+ p || (Le(!1), De(""), ke(null));
1039
1088
  }
1040
- async function z(e) {
1041
- Ae(!0);
1089
+ async function yt(e) {
1090
+ Ne(!0);
1042
1091
  try {
1043
- Pe((await O(e)).filter((e) => e.memberId !== r).map(q));
1092
+ Fe((await k(e)).filter((e) => e.memberId !== r).map(At));
1044
1093
  } catch (e) {
1045
- m(H(e));
1094
+ m(U(e));
1046
1095
  } finally {
1047
- Ae(!1);
1096
+ Ne(!1);
1048
1097
  }
1049
1098
  }
1050
- async function B() {
1051
- N && (tt ? await ft({
1099
+ async function H() {
1100
+ I && (M ? await ft({
1052
1101
  action: "REJECTED",
1053
- comment: tt
1054
- }) : x("請輸入拒絕原因"));
1102
+ comment: M
1103
+ }) : de("請輸入拒絕原因"));
1055
1104
  }
1056
1105
  async function bt() {
1057
- ot && (De ? await ft({
1106
+ at && (Oe ? await ft({
1058
1107
  action: "TRANSFERRED",
1059
1108
  comment: rt || null,
1060
- transferToMemberId: De.id
1109
+ transferToMemberId: Oe.id
1061
1110
  }) : m("請選擇轉派對象"));
1062
1111
  }
1063
- async function V() {
1112
+ async function xt() {
1064
1113
  await ft({
1065
1114
  action: "RETURNED",
1066
1115
  comment: nt || null,
1067
- returnToNodeId: F?.id ?? null
1116
+ returnToNodeId: st?.id ?? null
1068
1117
  });
1069
1118
  }
1070
- function xt() {
1071
- Re(""), Be([]), Ye("REJECT_INSTANCE"), Qe("MEMBER"), et("");
1119
+ function St() {
1120
+ ze(""), Ve([]), j("REJECT_INSTANCE"), $e("MEMBER"), tt("");
1072
1121
  }
1073
- function St(e) {
1074
- qe(e), xt(), Ke(!0), W("");
1122
+ function W(e) {
1123
+ Je(e), St(), qe(!0), Tt("");
1075
1124
  }
1076
- function U() {
1077
- Xe || (Ke(!1), xt());
1125
+ function Ct() {
1126
+ Xe || (qe(!1), St());
1078
1127
  }
1079
- async function W(e) {
1080
- He(!0);
1128
+ async function Tt(e) {
1129
+ Ue(!0);
1081
1130
  try {
1082
- We((await O(e)).map(q));
1131
+ Ge((await k(e)).map(At));
1083
1132
  } catch (e) {
1084
- m(H(e));
1133
+ m(U(e));
1085
1134
  } finally {
1086
- He(!1);
1135
+ Ue(!1);
1087
1136
  }
1088
1137
  }
1089
- async function Ct() {
1090
- if (!j) return;
1091
- let e = (k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY") && Ze === "WEBHOOK", t = jt({
1092
- memberIds: ze.map((e) => e.id),
1138
+ async function Et() {
1139
+ if (!N) return;
1140
+ let e = (A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY") && Qe === "WEBHOOK", t = jt({
1141
+ memberIds: Be.map((e) => e.id),
1093
1142
  useWebhookTarget: e,
1094
- webhookUrl: $e
1143
+ webhookUrl: et
1095
1144
  });
1096
1145
  if (!t.valid) {
1097
1146
  m(t.error);
1098
1147
  return;
1099
1148
  }
1100
- let { target: n } = t, r = Le.trim() || null;
1101
- A(!0), m(null);
1149
+ let { target: n } = t, r = Re.trim() || null;
1150
+ Ze(!0), m(null);
1102
1151
  try {
1103
- k === "COUNTERSIGN" ? await Me({
1152
+ A === "COUNTERSIGN" ? await je({
1104
1153
  comment: r,
1105
1154
  target: n,
1106
- taskId: j.id
1107
- }) : k === "PRE_APPROVAL" ? await Ne({
1155
+ taskId: N.id
1156
+ }) : A === "PRE_APPROVAL" ? await Me({
1108
1157
  comment: r,
1109
- onReject: Je,
1158
+ onReject: Ye,
1110
1159
  target: n,
1111
- taskId: j.id
1112
- }) : k === "STAGE_NOTIFY" ? await Ce({
1160
+ taskId: N.id
1161
+ }) : A === "STAGE_NOTIFY" ? await Se({
1113
1162
  target: n,
1114
- taskId: j.id
1115
- }) : await Se({
1163
+ taskId: N.id
1164
+ }) : await xe({
1116
1165
  target: n,
1117
- taskId: j.id
1118
- }), Ke(!1), xt(), await c();
1166
+ taskId: N.id
1167
+ }), qe(!1), St(), await c();
1119
1168
  } catch (e) {
1120
- m(H(e));
1169
+ m(U(e));
1121
1170
  } finally {
1122
- A(!1);
1171
+ Ze(!1);
1123
1172
  }
1124
1173
  }
1125
- async function Tt(e) {
1126
- A(!0), m(null);
1174
+ async function q(e) {
1175
+ Ze(!0), m(null);
1127
1176
  try {
1128
- await be(e), await c();
1177
+ await ye(e), await c();
1129
1178
  } catch (e) {
1130
- m(H(e));
1179
+ m(U(e));
1131
1180
  } finally {
1132
- A(!1);
1181
+ Ze(!1);
1133
1182
  }
1134
1183
  }
1135
- ae(d, () => ({
1136
- canAddSignerCurrentTask: st,
1137
- canRejectCurrentTask: N,
1138
- canReturnCurrentTask: at,
1139
- canTransferCurrentTask: ot,
1140
- deciding: f,
1184
+ ae(f, () => ({
1185
+ canAddSignerCurrentTask: L,
1186
+ canRejectCurrentTask: I,
1187
+ canReturnCurrentTask: it,
1188
+ canTransferCurrentTask: at,
1189
+ deciding: p,
1141
1190
  handleApprove: pt,
1142
- hasCurrentTask: j !== null,
1143
- openAdhocModal: St,
1144
- openRejectModal: ht,
1145
- openReturnModal: gt,
1146
- openTransferModal: vt
1191
+ hasCurrentTask: N !== null,
1192
+ openAdhocModal: W,
1193
+ openRejectModal: gt,
1194
+ openReturnModal: vt,
1195
+ openTransferModal: B
1147
1196
  }), [
1148
- st,
1149
- N,
1197
+ L,
1198
+ I,
1199
+ it,
1150
1200
  at,
1151
- ot,
1152
1201
  r,
1153
- j,
1154
- f
1202
+ N,
1203
+ p
1155
1204
  ]);
1156
- let G = k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY", Ot = G && Ze === "WEBHOOK" ? !$e.trim() : ze.length === 0, J = Cn.find((e) => e.id === Je) ?? Cn[0], Ft = wn.find((e) => e.id === Ze) ?? wn[0];
1157
- return /* @__PURE__ */ E(ye, { children: [
1158
- /* @__PURE__ */ T(w, {
1205
+ let J = A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY", Ft = J && Qe === "WEBHOOK" ? !et.trim() : Be.length === 0, It = Dn.find((e) => e.id === Ye) ?? Dn[0], Y = On.find((e) => e.id === Qe) ?? On[0];
1206
+ return /* @__PURE__ */ D(ve, { children: [
1207
+ /* @__PURE__ */ E(T, {
1159
1208
  component: "h2",
1160
1209
  variant: "h3",
1161
1210
  children: "任務"
1162
1211
  }),
1163
- ee ? /* @__PURE__ */ T(w, {
1212
+ te ? /* @__PURE__ */ E(T, {
1164
1213
  color: "text-error",
1165
1214
  variant: "body",
1166
- children: ee
1215
+ children: te
1167
1216
  }) : null,
1168
- /* @__PURE__ */ T("div", {
1169
- style: vn,
1170
- children: /* @__PURE__ */ T(ge, {
1217
+ /* @__PURE__ */ E("div", {
1218
+ style: Sn,
1219
+ children: /* @__PURE__ */ E(he, {
1171
1220
  columns: lt,
1172
- dataSource: I,
1221
+ dataSource: ct,
1173
1222
  fullWidth: !0
1174
1223
  })
1175
1224
  }),
1176
- ct.length > 0 ? /* @__PURE__ */ E(ye, { children: [/* @__PURE__ */ T(w, {
1225
+ R.length > 0 ? /* @__PURE__ */ D(ve, { children: [/* @__PURE__ */ E(T, {
1177
1226
  component: "h3",
1178
- style: yn,
1227
+ style: Cn,
1179
1228
  variant: "h3",
1180
1229
  children: "待生效的臨時設定"
1181
- }), /* @__PURE__ */ T("div", {
1182
- style: vn,
1183
- children: /* @__PURE__ */ T(ge, {
1230
+ }), /* @__PURE__ */ E("div", {
1231
+ style: Sn,
1232
+ children: /* @__PURE__ */ E(he, {
1184
1233
  columns: dt,
1185
1234
  dataSource: ut,
1186
1235
  fullWidth: !0
1187
1236
  })
1188
1237
  })] }) : null,
1189
- /* @__PURE__ */ E(S, {
1238
+ /* @__PURE__ */ D(C, {
1190
1239
  cancelText: "取消",
1191
1240
  confirmText: "送出同意",
1192
- loading: f,
1241
+ loading: p,
1193
1242
  modalType: "standard",
1194
- onCancel: L,
1195
- onClose: L,
1196
- onConfirm: () => void mt(),
1197
- open: re,
1243
+ onCancel: mt,
1244
+ onClose: mt,
1245
+ onConfirm: () => void ht(),
1246
+ open: ie,
1198
1247
  showModalFooter: !0,
1199
1248
  showModalHeader: !0,
1200
1249
  size: "regular",
1201
1250
  supportingText: "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
1202
1251
  title: "簽核意見",
1203
1252
  children: [
1204
- ee ? /* @__PURE__ */ T(w, {
1253
+ te ? /* @__PURE__ */ E(T, {
1205
1254
  color: "text-error",
1206
1255
  role: "alert",
1207
1256
  variant: "body",
1208
- children: ee
1257
+ children: te
1209
1258
  }) : null,
1210
- i !== null && i.summary.length > 0 ? /* @__PURE__ */ E("div", {
1211
- style: hn,
1212
- children: [/* @__PURE__ */ T(w, {
1259
+ i !== null && i.summary.length > 0 ? /* @__PURE__ */ D("div", {
1260
+ style: yn,
1261
+ children: [/* @__PURE__ */ E(T, {
1213
1262
  variant: "body",
1214
1263
  children: "將一併送出的補填欄位:"
1215
- }), i.summary.map((e) => /* @__PURE__ */ T(b, {
1264
+ }), i.summary.map((e) => /* @__PURE__ */ E(x, {
1216
1265
  title: e.label,
1217
- children: /* @__PURE__ */ T(le, { children: e.text })
1266
+ children: /* @__PURE__ */ E(ce, { children: e.text })
1218
1267
  }, e.fieldKey))]
1219
1268
  }) : null,
1220
- /* @__PURE__ */ T("div", {
1221
- style: hn,
1222
- children: /* @__PURE__ */ T(n, {
1269
+ /* @__PURE__ */ E("div", {
1270
+ style: yn,
1271
+ children: /* @__PURE__ */ E(n, {
1223
1272
  label: "簽核意見",
1224
1273
  name: "approveComment",
1225
- children: /* @__PURE__ */ T(_e, {
1274
+ children: /* @__PURE__ */ E(ge, {
1226
1275
  autoFocus: !0,
1227
- onChange: (e) => ne(e.target.value),
1276
+ onChange: (e) => re(e.target.value),
1228
1277
  placeholder: "選填,例如補充核准的條件或提醒事項",
1229
- ref: bn,
1278
+ ref: wn,
1230
1279
  resize: "vertical",
1231
1280
  rows: 4,
1232
- style: gn,
1233
- value: te
1281
+ style: bn,
1282
+ value: ne
1234
1283
  })
1235
1284
  })
1236
1285
  })
1237
1286
  ]
1238
1287
  }),
1239
- /* @__PURE__ */ T(S, {
1288
+ /* @__PURE__ */ E(C, {
1240
1289
  cancelText: "取消",
1241
1290
  confirmButtonProps: {
1242
- disabled: !tt,
1291
+ disabled: !M,
1243
1292
  variant: "destructive-primary"
1244
1293
  },
1245
1294
  confirmText: "送出拒絕",
1246
- loading: f,
1295
+ loading: p,
1247
1296
  modalStatusType: "error",
1248
1297
  modalType: "standard",
1249
- onCancel: R,
1250
- onClose: R,
1251
- onConfirm: () => void B(),
1252
- open: de,
1298
+ onCancel: _t,
1299
+ onClose: _t,
1300
+ onConfirm: () => void H(),
1301
+ open: fe,
1253
1302
  showModalFooter: !0,
1254
1303
  showModalHeader: !0,
1255
1304
  size: "regular",
1256
1305
  supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
1257
1306
  title: "拒絕原因",
1258
- children: /* @__PURE__ */ E("div", {
1259
- style: hn,
1260
- children: [/* @__PURE__ */ T(n, {
1307
+ children: /* @__PURE__ */ D("div", {
1308
+ style: yn,
1309
+ children: [/* @__PURE__ */ E(n, {
1261
1310
  label: "拒絕原因",
1262
1311
  name: "rejectReason",
1263
1312
  required: !0,
1264
- children: /* @__PURE__ */ T(_e, {
1313
+ children: /* @__PURE__ */ E(ge, {
1265
1314
  autoFocus: !0,
1266
1315
  onChange: (e) => {
1267
- g(e.target.value), x(null);
1316
+ S(e.target.value), de(null);
1268
1317
  },
1269
1318
  placeholder: "請說明拒絕原因",
1270
- ref: bn,
1319
+ ref: wn,
1271
1320
  resize: "vertical",
1272
1321
  rows: 4,
1273
- style: gn,
1274
- type: oe ? "error" : "default",
1275
- value: ie
1322
+ style: bn,
1323
+ type: ue ? "error" : "default",
1324
+ value: v
1276
1325
  })
1277
- }), oe ? /* @__PURE__ */ T(w, {
1326
+ }), ue ? /* @__PURE__ */ E(T, {
1278
1327
  color: "text-error",
1279
1328
  variant: "body",
1280
- children: oe
1329
+ children: ue
1281
1330
  }) : null]
1282
1331
  })
1283
1332
  }),
1284
- /* @__PURE__ */ T(S, {
1333
+ /* @__PURE__ */ E(C, {
1285
1334
  cancelText: "取消",
1286
- confirmButtonProps: { disabled: !De },
1335
+ confirmButtonProps: { disabled: !Oe },
1287
1336
  confirmText: "送出轉派",
1288
- loading: f,
1337
+ loading: p,
1289
1338
  modalType: "standard",
1290
- onCancel: yt,
1291
- onClose: yt,
1339
+ onCancel: V,
1340
+ onClose: V,
1292
1341
  onConfirm: () => void bt(),
1293
- open: Fe,
1342
+ open: Ie,
1294
1343
  showModalFooter: !0,
1295
1344
  showModalHeader: !0,
1296
1345
  size: "regular",
1297
1346
  supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
1298
1347
  title: "轉派簽核",
1299
- children: /* @__PURE__ */ E("div", {
1300
- style: _n,
1301
- children: [/* @__PURE__ */ T(n, {
1348
+ children: /* @__PURE__ */ D("div", {
1349
+ style: xn,
1350
+ children: [/* @__PURE__ */ E(n, {
1302
1351
  label: "轉派對象",
1303
1352
  name: "transferToMemberId",
1304
1353
  required: !0,
1305
- children: /* @__PURE__ */ T(se, {
1354
+ children: /* @__PURE__ */ E(oe, {
1306
1355
  asyncData: !0,
1307
1356
  disabledOptionsFilter: !0,
1308
1357
  emptyText: "沒有符合的成員",
@@ -1312,147 +1361,147 @@ var xn = {
1312
1361
  name: "transfer-member-search",
1313
1362
  spellCheck: !1
1314
1363
  },
1315
- loading: ke,
1364
+ loading: Ae,
1316
1365
  loadingText: "搜尋成員中...",
1317
1366
  mode: "single",
1318
- onChange: (e) => Oe(Nt(e)),
1319
- onSearch: z,
1320
- onSearchTextChange: (e) => Oe(Pt(e, je)),
1367
+ onChange: (e) => ke(Nt(e)),
1368
+ onSearch: yt,
1369
+ onSearchTextChange: (e) => ke(Pt(e, Pe)),
1321
1370
  onVisibilityChange: (e) => {
1322
- e && z("");
1371
+ e && yt("");
1323
1372
  },
1324
- options: [...je],
1373
+ options: [...Pe],
1325
1374
  placeholder: "搜尋姓名或信箱",
1326
1375
  searchDebounceTime: 300,
1327
- value: De
1376
+ value: Oe
1328
1377
  })
1329
- }), /* @__PURE__ */ T(n, {
1378
+ }), /* @__PURE__ */ E(n, {
1330
1379
  label: "轉派說明",
1331
1380
  name: "transferComment",
1332
- children: /* @__PURE__ */ T(_e, {
1333
- onChange: (e) => D(e.target.value),
1381
+ children: /* @__PURE__ */ E(ge, {
1382
+ onChange: (e) => De(e.target.value),
1334
1383
  placeholder: "可補充轉派原因",
1335
- ref: bn,
1384
+ ref: wn,
1336
1385
  resize: "vertical",
1337
1386
  rows: 4,
1338
- style: gn,
1387
+ style: bn,
1339
1388
  value: Ee
1340
1389
  })
1341
1390
  })]
1342
1391
  })
1343
1392
  }),
1344
- /* @__PURE__ */ T(S, {
1393
+ /* @__PURE__ */ E(C, {
1345
1394
  cancelText: "取消",
1346
- confirmButtonProps: { disabled: !F || P && !nt },
1395
+ confirmButtonProps: { disabled: !st || ot && !nt },
1347
1396
  confirmText: "送出退回",
1348
- loading: f,
1397
+ loading: p,
1349
1398
  modalType: "standard",
1350
- onCancel: _t,
1351
- onClose: _t,
1352
- onConfirm: () => void V(),
1353
- open: he,
1399
+ onCancel: z,
1400
+ onClose: z,
1401
+ onConfirm: () => void xt(),
1402
+ open: be,
1354
1403
  showModalFooter: !0,
1355
1404
  showModalHeader: !0,
1356
1405
  size: "regular",
1357
1406
  supportingText: "退回後,流程會回到指定節點並等待重新處理。",
1358
1407
  title: "退回簽核",
1359
- children: /* @__PURE__ */ E("div", {
1360
- style: _n,
1361
- children: [/* @__PURE__ */ T(n, {
1408
+ children: /* @__PURE__ */ D("div", {
1409
+ style: xn,
1410
+ children: [/* @__PURE__ */ E(n, {
1362
1411
  label: "退回節點",
1363
1412
  name: "returnTargetNodeId",
1364
1413
  required: !0,
1365
- children: /* @__PURE__ */ T(C, {
1414
+ children: /* @__PURE__ */ E(w, {
1366
1415
  clearable: !1,
1367
1416
  fullWidth: !0,
1368
- onChange: (e) => Te(e?.id ?? null),
1369
- options: [...it],
1417
+ onChange: (e) => O(e?.id ?? null),
1418
+ options: [...F],
1370
1419
  placeholder: "選擇退回節點",
1371
- value: F
1420
+ value: st
1372
1421
  })
1373
- }), /* @__PURE__ */ T(n, {
1374
- hintText: P ? "此關卡設定退回時必須填寫意見。" : void 0,
1422
+ }), /* @__PURE__ */ E(n, {
1423
+ hintText: ot ? "此關卡設定退回時必須填寫意見。" : void 0,
1375
1424
  label: "退回說明",
1376
1425
  name: "returnComment",
1377
- required: P,
1378
- children: /* @__PURE__ */ T(_e, {
1379
- onChange: (e) => me(e.target.value),
1380
- placeholder: P ? "請說明退回原因" : "可補充需要修改的內容",
1381
- ref: bn,
1426
+ required: ot,
1427
+ children: /* @__PURE__ */ E(ge, {
1428
+ onChange: (e) => _e(e.target.value),
1429
+ placeholder: ot ? "請說明退回原因" : "可補充需要修改的內容",
1430
+ ref: wn,
1382
1431
  resize: "vertical",
1383
1432
  rows: 4,
1384
- style: gn,
1385
- value: pe
1433
+ style: bn,
1434
+ value: me
1386
1435
  })
1387
1436
  })]
1388
1437
  })
1389
1438
  }),
1390
- /* @__PURE__ */ T(S, {
1439
+ /* @__PURE__ */ E(C, {
1391
1440
  cancelText: "取消",
1392
- confirmButtonProps: { disabled: Ot },
1441
+ confirmButtonProps: { disabled: Ft },
1393
1442
  confirmText: "送出",
1394
1443
  loading: Xe,
1395
1444
  modalType: "standard",
1396
- onCancel: U,
1397
- onClose: U,
1398
- onConfirm: () => void Ct(),
1399
- open: Ge,
1445
+ onCancel: Ct,
1446
+ onClose: Ct,
1447
+ onConfirm: () => void Et(),
1448
+ open: Ke,
1400
1449
  showModalFooter: !0,
1401
1450
  showModalHeader: !0,
1402
1451
  size: "regular",
1403
- supportingText: Sn[k],
1404
- title: xn[k],
1405
- children: /* @__PURE__ */ E("div", {
1406
- style: _n,
1452
+ supportingText: En[A],
1453
+ title: Tn[A],
1454
+ children: /* @__PURE__ */ D("div", {
1455
+ style: xn,
1407
1456
  children: [
1408
- G ? /* @__PURE__ */ T(n, {
1457
+ J ? /* @__PURE__ */ E(n, {
1409
1458
  label: "通知時機",
1410
1459
  name: "adhocNotifyMode",
1411
1460
  required: !0,
1412
- children: /* @__PURE__ */ T(C, {
1461
+ children: /* @__PURE__ */ E(w, {
1413
1462
  clearable: !1,
1414
1463
  fullWidth: !0,
1415
- onChange: (e) => qe(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1464
+ onChange: (e) => Je(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1416
1465
  options: [{
1417
1466
  id: "STAGE_NOTIFY",
1418
- name: xn.STAGE_NOTIFY
1467
+ name: Tn.STAGE_NOTIFY
1419
1468
  }, {
1420
1469
  id: "COMPLETION_NOTIFY",
1421
- name: xn.COMPLETION_NOTIFY
1470
+ name: Tn.COMPLETION_NOTIFY
1422
1471
  }],
1423
1472
  value: {
1424
- id: k,
1425
- name: xn[k]
1473
+ id: A,
1474
+ name: Tn[A]
1426
1475
  }
1427
1476
  })
1428
1477
  }) : null,
1429
- G ? /* @__PURE__ */ T(n, {
1478
+ J ? /* @__PURE__ */ E(n, {
1430
1479
  label: "通知對象類型",
1431
1480
  name: "adhocTargetKind",
1432
1481
  required: !0,
1433
- children: /* @__PURE__ */ T(C, {
1482
+ children: /* @__PURE__ */ E(w, {
1434
1483
  clearable: !1,
1435
1484
  fullWidth: !0,
1436
- onChange: (e) => Qe(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1437
- options: [...wn],
1438
- value: Ft
1485
+ onChange: (e) => $e(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1486
+ options: [...On],
1487
+ value: Y
1439
1488
  })
1440
1489
  }) : null,
1441
- G && Ze === "WEBHOOK" ? /* @__PURE__ */ T(n, {
1490
+ J && Qe === "WEBHOOK" ? /* @__PURE__ */ E(n, {
1442
1491
  label: "Webhook URL",
1443
1492
  name: "adhocWebhookUrl",
1444
1493
  required: !0,
1445
- children: /* @__PURE__ */ T(ue, {
1494
+ children: /* @__PURE__ */ E(le, {
1446
1495
  fullWidth: !0,
1447
- onChange: (e) => et(e.target.value),
1496
+ onChange: (e) => tt(e.target.value),
1448
1497
  placeholder: "https://example.com/webhook",
1449
- value: $e
1498
+ value: et
1450
1499
  })
1451
- }) : /* @__PURE__ */ T(n, {
1452
- label: G ? "通知對象" : "簽核對象",
1500
+ }) : /* @__PURE__ */ E(n, {
1501
+ label: J ? "通知對象" : "簽核對象",
1453
1502
  name: "adhocMemberId",
1454
1503
  required: !0,
1455
- children: /* @__PURE__ */ T(se, {
1504
+ children: /* @__PURE__ */ E(oe, {
1456
1505
  asyncData: !0,
1457
1506
  disabledOptionsFilter: !0,
1458
1507
  emptyText: "沒有符合的成員",
@@ -1462,45 +1511,45 @@ var xn = {
1462
1511
  name: "adhoc-member-search",
1463
1512
  spellCheck: !1
1464
1513
  },
1465
- loading: Ve,
1514
+ loading: He,
1466
1515
  loadingText: "搜尋成員中...",
1467
1516
  menuMaxHeight: 320,
1468
1517
  mode: "multiple",
1469
- onChange: (e) => Be(e.map(Nt).filter(Mt)),
1470
- onSearch: W,
1518
+ onChange: (e) => Ve(e.map(Nt).filter(Mt)),
1519
+ onSearch: Tt,
1471
1520
  onVisibilityChange: (e) => {
1472
- e && W("");
1521
+ e && Tt("");
1473
1522
  },
1474
- options: [...Ue],
1523
+ options: [...We],
1475
1524
  overflowStrategy: "wrap",
1476
1525
  placeholder: "搜尋姓名或信箱,可加入多位",
1477
1526
  searchDebounceTime: 300,
1478
- value: [...ze]
1527
+ value: [...Be]
1479
1528
  })
1480
1529
  }),
1481
- k === "PRE_APPROVAL" ? /* @__PURE__ */ T(n, {
1530
+ A === "PRE_APPROVAL" ? /* @__PURE__ */ E(n, {
1482
1531
  label: "拒簽處理方式",
1483
1532
  name: "adhocOnReject",
1484
1533
  required: !0,
1485
- children: /* @__PURE__ */ T(C, {
1534
+ children: /* @__PURE__ */ E(w, {
1486
1535
  clearable: !1,
1487
1536
  fullWidth: !0,
1488
- onChange: (e) => Ye(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1489
- options: [...Cn],
1490
- value: J
1537
+ onChange: (e) => j(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1538
+ options: [...Dn],
1539
+ value: It
1491
1540
  })
1492
1541
  }) : null,
1493
- G ? null : /* @__PURE__ */ T(n, {
1542
+ J ? null : /* @__PURE__ */ E(n, {
1494
1543
  label: "說明",
1495
1544
  name: "adhocComment",
1496
- children: /* @__PURE__ */ T(_e, {
1497
- onChange: (e) => Re(e.target.value),
1545
+ children: /* @__PURE__ */ E(ge, {
1546
+ onChange: (e) => ze(e.target.value),
1498
1547
  placeholder: "可補充原因",
1499
- ref: bn,
1548
+ ref: wn,
1500
1549
  resize: "vertical",
1501
1550
  rows: 3,
1502
- style: gn,
1503
- value: Le
1551
+ style: bn,
1552
+ value: Re
1504
1553
  })
1505
1554
  })
1506
1555
  ]
@@ -1508,28 +1557,28 @@ var xn = {
1508
1557
  })
1509
1558
  ] });
1510
1559
  });
1511
- function En(e, t) {
1560
+ function An(e, t) {
1512
1561
  try {
1513
1562
  let n = JSON.parse(e.targetValueJson);
1514
- if (n.memberIds?.length) return n.memberIds.map((e) => K(e, t)).join("、");
1563
+ if (n.memberIds?.length) return n.memberIds.map((e) => G(e, t)).join("、");
1515
1564
  if (n.webhookUrl) return n.webhookUrl;
1516
1565
  if (n.positionId) return `職位 ${n.positionId}`;
1517
1566
  if (n.orgUnitId) return `部門 ${n.orgUnitId}`;
1518
1567
  } catch {}
1519
1568
  return e.targetKind;
1520
1569
  }
1521
- function Dn(e, t) {
1570
+ function jn(e, t) {
1522
1571
  if (e.isAdhoc || e.status !== "PENDING" && e.status !== "IN_PROGRESS") return 0;
1523
1572
  let n = t?.nodes.find((t) => t.id === e.nodeId);
1524
- return n?.type === "userTask" ? Ze(n).size : 0;
1573
+ return n?.type === "userTask" ? Xe(n).size : 0;
1525
1574
  }
1526
1575
  //#endregion
1527
1576
  //#region src/views/instances/detail/sections/InstanceSignaturesSection.tsx
1528
- var On = {
1577
+ var Mn = {
1529
1578
  display: "grid",
1530
1579
  gap: 16
1531
1580
  };
1532
- function kn({ signatureVerification: e, signatures: n }) {
1581
+ function Nn({ signatureVerification: e, signatures: n }) {
1533
1582
  let r = _(() => n.map((e) => ({
1534
1583
  algorithm: e.algorithm,
1535
1584
  hashLabel: W(e.signedPayloadHash),
@@ -1569,20 +1618,20 @@ function kn({ signatureVerification: e, signatures: n }) {
1569
1618
  width: 220
1570
1619
  }
1571
1620
  ], []);
1572
- return /* @__PURE__ */ E("div", {
1573
- style: On,
1621
+ return /* @__PURE__ */ D("div", {
1622
+ style: Mn,
1574
1623
  children: [
1575
- /* @__PURE__ */ T(w, {
1624
+ /* @__PURE__ */ E(T, {
1576
1625
  component: "h2",
1577
1626
  variant: "h3",
1578
1627
  children: "簽章"
1579
1628
  }),
1580
- /* @__PURE__ */ T(w, {
1629
+ /* @__PURE__ */ E(T, {
1581
1630
  color: e?.valid ? "text-success" : "text-error",
1582
1631
  variant: "body",
1583
1632
  children: e ? e.valid ? `簽章鏈已驗證,共 ${e.checkedCount} 筆。` : `簽章鏈驗證失敗:${e.errors.join("、")}` : "尚無簽章紀錄。"
1584
1633
  }),
1585
- r.length > 0 ? /* @__PURE__ */ T(ge, {
1634
+ r.length > 0 ? /* @__PURE__ */ E(he, {
1586
1635
  columns: i,
1587
1636
  dataSource: r,
1588
1637
  fullWidth: !0
@@ -1592,14 +1641,14 @@ function kn({ signatureVerification: e, signatures: n }) {
1592
1641
  }
1593
1642
  //#endregion
1594
1643
  //#region src/views/instances/detail/sections/InstanceHistorySection.tsx
1595
- var An = {
1644
+ var Pn = {
1596
1645
  display: "grid",
1597
1646
  gap: 16
1598
- }, jn = {
1647
+ }, Fn = {
1599
1648
  cursor: "help",
1600
1649
  textDecoration: "underline dotted",
1601
1650
  textUnderlineOffset: 3
1602
- }, Mn = {
1651
+ }, In = {
1603
1652
  borderLeftColor: "var(--mzn-color-border)",
1604
1653
  borderLeftStyle: "solid",
1605
1654
  borderLeftWidth: 2,
@@ -1608,41 +1657,41 @@ var An = {
1608
1657
  marginTop: 4,
1609
1658
  paddingLeft: 8,
1610
1659
  whiteSpace: "pre-wrap"
1611
- }, Nn = { color: "var(--mzn-color-text-secondary)" }, Pn = {
1612
- ...Mn,
1660
+ }, Ln = { color: "var(--mzn-color-text-secondary)" }, Rn = {
1661
+ ...In,
1613
1662
  borderLeftColor: "var(--mzn-color-text-error)",
1614
1663
  color: "var(--mzn-color-text-error)"
1615
1664
  };
1616
- function Fn(...e) {
1617
- return e.filter((e) => V(e ?? null)).join(" ");
1665
+ function zn(...e) {
1666
+ return e.filter((e) => H(e ?? null)).join(" ");
1618
1667
  }
1619
- var In = h(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: s, type: c = "number", ...l }, u) {
1668
+ var Bn = ie(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: s, type: c = "number", ...l }, u) {
1620
1669
  let d = r ? "pending" : o, f = t.filter((e) => e.type !== "comment"), p = t.filter((e) => e.type === "comment");
1621
- return /* @__PURE__ */ E("div", {
1670
+ return /* @__PURE__ */ D("div", {
1622
1671
  ...l,
1623
- className: Fn(F.host, c === "dot" ? F.dot : null, n && d !== "processing" ? F.error : null, a === "horizontal" ? F.horizontal : null, c === "number" ? F.number : null, d === "pending" ? F.pending : null, d === "processing" ? F.processing : null, n && d === "processing" ? F.processingError : null, !n && d === "succeeded" ? F.succeeded : null, a === "vertical" ? F.vertical : null, e),
1672
+ className: zn(L.host, c === "dot" ? L.dot : null, n && d !== "processing" ? L.error : null, a === "horizontal" ? L.horizontal : null, c === "number" ? L.number : null, d === "pending" ? L.pending : null, d === "processing" ? L.processing : null, n && d === "processing" ? L.processingError : null, !n && d === "succeeded" ? L.succeeded : null, a === "vertical" ? L.vertical : null, e),
1624
1673
  ref: u,
1625
- children: [c === "dot" ? /* @__PURE__ */ T("span", { className: Fn(F.statusIndicator, F.statusIndicatorDot) }) : /* @__PURE__ */ T("span", {
1626
- className: F.statusIndicator,
1674
+ children: [c === "dot" ? /* @__PURE__ */ E("span", { className: zn(L.statusIndicator, L.statusIndicatorDot) }) : /* @__PURE__ */ E("span", {
1675
+ className: L.statusIndicator,
1627
1676
  children: i + 1
1628
- }), /* @__PURE__ */ E("div", {
1629
- className: F.textContainer,
1677
+ }), /* @__PURE__ */ D("div", {
1678
+ className: L.textContainer,
1630
1679
  children: [
1631
- /* @__PURE__ */ E(w, {
1632
- className: F.title,
1680
+ /* @__PURE__ */ D(T, {
1681
+ className: L.title,
1633
1682
  variant: "label-primary-highlight",
1634
- children: [s, /* @__PURE__ */ T("span", { className: F.titleConnectLine })]
1683
+ children: [s, /* @__PURE__ */ E("span", { className: L.titleConnectLine })]
1635
1684
  }),
1636
- f.length > 0 ? /* @__PURE__ */ T(w, {
1637
- className: F.description,
1685
+ f.length > 0 ? /* @__PURE__ */ E(T, {
1686
+ className: L.description,
1638
1687
  variant: "caption",
1639
- children: f.map((e, t) => /* @__PURE__ */ E(re, { children: [t > 0 ? " · " : null, Ln(e)] }, `${e.type}-${t}`))
1688
+ children: f.map((e, t) => /* @__PURE__ */ D(re, { children: [t > 0 ? " · " : null, Vn(e)] }, `${e.type}-${t}`))
1640
1689
  }) : null,
1641
- p.map((e, t) => /* @__PURE__ */ E(w, {
1642
- style: e.tone === "danger" ? Pn : Mn,
1690
+ p.map((e, t) => /* @__PURE__ */ D(T, {
1691
+ style: e.tone === "danger" ? Rn : In,
1643
1692
  variant: "body",
1644
- children: [/* @__PURE__ */ E("span", {
1645
- style: e.tone === "danger" ? void 0 : Nn,
1693
+ children: [/* @__PURE__ */ D("span", {
1694
+ style: e.tone === "danger" ? void 0 : Ln,
1646
1695
  children: [e.label, ":"]
1647
1696
  }), e.text]
1648
1697
  }, `comment-${t}`))
@@ -1650,44 +1699,44 @@ var In = h(function({ className: e, descriptionParts: t, error: n, forcePending:
1650
1699
  })]
1651
1700
  });
1652
1701
  });
1653
- function Ln(e) {
1654
- return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ E(ye, { children: [
1702
+ function Vn(e) {
1703
+ return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ D(ve, { children: [
1655
1704
  e.prefix,
1656
1705
  ":",
1657
- /* @__PURE__ */ T(ve, {
1706
+ /* @__PURE__ */ E(_e, {
1658
1707
  title: e.email,
1659
- children: ({ ref: t, ...n }) => /* @__PURE__ */ T("span", {
1708
+ children: ({ ref: t, ...n }) => /* @__PURE__ */ E("span", {
1660
1709
  ...n,
1661
1710
  "data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
1662
1711
  ref: t,
1663
- style: jn,
1712
+ style: Fn,
1664
1713
  children: e.label
1665
1714
  })
1666
1715
  })
1667
1716
  ] }) : `${e.prefix}:${e.label}`;
1668
1717
  }
1669
- function Rn({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisionsByTaskId: o, tasks: s, workflowSnapshot: c, workflowTokens: l }) {
1670
- let u = rn(e, s, l, c, n, r, o, a, i, t), d = X(u), f = u.map((e) => ({
1718
+ function Hn({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisionsByTaskId: o, tasks: s, workflowSnapshot: c, workflowTokens: l }) {
1719
+ let u = rn(e, s, l, c, n, r, o, a, i, t), d = Lt(u), f = u.map((e) => ({
1671
1720
  ...e,
1672
1721
  descriptionParts: e.descriptionParts.filter(Y)
1673
1722
  }));
1674
- return /* @__PURE__ */ E("div", {
1675
- style: An,
1676
- children: [/* @__PURE__ */ T(w, {
1723
+ return /* @__PURE__ */ D("div", {
1724
+ style: Pn,
1725
+ children: [/* @__PURE__ */ E(T, {
1677
1726
  component: "h2",
1678
1727
  variant: "h3",
1679
1728
  children: "歷程"
1680
- }), f.length > 0 ? /* @__PURE__ */ T(he, {
1729
+ }), f.length > 0 ? /* @__PURE__ */ E(me, {
1681
1730
  currentStep: d,
1682
1731
  orientation: "vertical",
1683
1732
  type: "dot",
1684
- children: f.map((e) => /* @__PURE__ */ T(In, {
1733
+ children: f.map((e) => /* @__PURE__ */ E(Bn, {
1685
1734
  descriptionParts: e.descriptionParts,
1686
1735
  error: e.error,
1687
1736
  forcePending: e.forcePending,
1688
1737
  title: e.title
1689
1738
  }, e.id))
1690
- }) : /* @__PURE__ */ T(w, {
1739
+ }) : /* @__PURE__ */ E(T, {
1691
1740
  color: "text-neutral",
1692
1741
  variant: "body",
1693
1742
  children: "尚無歷程紀錄。"
@@ -1696,30 +1745,30 @@ function Rn({ activityLogs: e, formSchema: t = null, instanceState: n, memberPro
1696
1745
  }
1697
1746
  //#endregion
1698
1747
  //#region src/views/instances/detail/sections/InstanceWebhookDeliveriesSection.tsx
1699
- var zn = {
1748
+ var Un = {
1700
1749
  display: "grid",
1701
1750
  gap: 16
1702
- }, Bn = {
1751
+ }, Wn = {
1703
1752
  display: "grid",
1704
1753
  gap: 2
1705
- }, Vn = {
1754
+ }, Gn = {
1706
1755
  overflowWrap: "anywhere",
1707
1756
  whiteSpace: "pre-wrap"
1708
1757
  };
1709
- function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1710
- let [r, i] = v(null), [a, o] = v(!1), [s, c] = v(null), l = _(() => e.map((e) => ({
1758
+ function Kn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1759
+ let [r, i] = y(null), [a, o] = y(!1), [s, c] = y(null), l = _(() => e.map((e) => ({
1711
1760
  delivery: e,
1712
1761
  key: e.id
1713
1762
  })), [e]), u = _(() => [
1714
1763
  {
1715
1764
  key: "endpoint",
1716
- render: ({ delivery: e }) => /* @__PURE__ */ E("div", {
1717
- style: Bn,
1718
- children: [/* @__PURE__ */ T(w, {
1765
+ render: ({ delivery: e }) => /* @__PURE__ */ D("div", {
1766
+ style: Wn,
1767
+ children: [/* @__PURE__ */ E(T, {
1719
1768
  component: "span",
1720
1769
  variant: "body",
1721
1770
  children: e.endpointLabel ?? e.endpointKey
1722
- }), /* @__PURE__ */ E(w, {
1771
+ }), /* @__PURE__ */ D(T, {
1723
1772
  color: "text-neutral",
1724
1773
  component: "span",
1725
1774
  variant: "caption",
@@ -1738,13 +1787,13 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1738
1787
  },
1739
1788
  {
1740
1789
  key: "status",
1741
- render: ({ delivery: e }) => /* @__PURE__ */ T(Un, { status: e.status }),
1790
+ render: ({ delivery: e }) => /* @__PURE__ */ E(qn, { status: e.status }),
1742
1791
  title: "狀態",
1743
1792
  width: 120
1744
1793
  },
1745
1794
  {
1746
1795
  key: "attemptCount",
1747
- render: ({ delivery: e }) => /* @__PURE__ */ T(w, {
1796
+ render: ({ delivery: e }) => /* @__PURE__ */ E(T, {
1748
1797
  component: "span",
1749
1798
  variant: "body",
1750
1799
  children: e.attemptCount
@@ -1754,21 +1803,21 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1754
1803
  },
1755
1804
  {
1756
1805
  key: "lastError",
1757
- render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ E("div", {
1758
- style: Bn,
1759
- children: [/* @__PURE__ */ T(w, {
1806
+ render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ D("div", {
1807
+ style: Wn,
1808
+ children: [/* @__PURE__ */ E(T, {
1760
1809
  color: "text-error",
1761
1810
  component: "span",
1762
1811
  variant: "body",
1763
1812
  children: e.lastErrorCode
1764
- }), e.lastErrorDetail ? /* @__PURE__ */ T(w, {
1813
+ }), e.lastErrorDetail ? /* @__PURE__ */ E(T, {
1765
1814
  color: "text-neutral",
1766
1815
  component: "span",
1767
- style: Vn,
1816
+ style: Gn,
1768
1817
  variant: "caption",
1769
1818
  children: e.lastErrorDetail
1770
1819
  }) : null]
1771
- }) : /* @__PURE__ */ T(w, {
1820
+ }) : /* @__PURE__ */ E(T, {
1772
1821
  color: "text-neutral",
1773
1822
  component: "span",
1774
1823
  variant: "body",
@@ -1779,10 +1828,10 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1779
1828
  },
1780
1829
  {
1781
1830
  key: "time",
1782
- render: ({ delivery: e }) => /* @__PURE__ */ T(w, {
1831
+ render: ({ delivery: e }) => /* @__PURE__ */ E(T, {
1783
1832
  component: "span",
1784
1833
  variant: "body",
1785
- children: Wn(e)
1834
+ children: Jn(e)
1786
1835
  }),
1787
1836
  title: "時間",
1788
1837
  width: 220
@@ -1812,30 +1861,30 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1812
1861
  }
1813
1862
  }
1814
1863
  }
1815
- return /* @__PURE__ */ E("div", {
1816
- style: zn,
1864
+ return /* @__PURE__ */ D("div", {
1865
+ style: Un,
1817
1866
  children: [
1818
- /* @__PURE__ */ T(w, {
1867
+ /* @__PURE__ */ E(T, {
1819
1868
  component: "h2",
1820
1869
  variant: "h3",
1821
1870
  children: "外部系統通知"
1822
1871
  }),
1823
- s ? /* @__PURE__ */ T(w, {
1872
+ s ? /* @__PURE__ */ E(T, {
1824
1873
  color: "text-error",
1825
1874
  variant: "body",
1826
1875
  children: s
1827
1876
  }) : null,
1828
- l.length > 0 ? /* @__PURE__ */ T(ge, {
1877
+ l.length > 0 ? /* @__PURE__ */ E(he, {
1829
1878
  actions: d,
1830
1879
  columns: u,
1831
1880
  dataSource: l,
1832
1881
  fullWidth: !0
1833
- }) : /* @__PURE__ */ T(w, {
1882
+ }) : /* @__PURE__ */ E(T, {
1834
1883
  color: "text-neutral",
1835
1884
  variant: "body",
1836
1885
  children: "此案件沒有外部系統通知。"
1837
1886
  }),
1838
- /* @__PURE__ */ T(S, {
1887
+ /* @__PURE__ */ E(C, {
1839
1888
  cancelText: "取消",
1840
1889
  confirmText: "重新傳送",
1841
1890
  loading: a,
@@ -1849,7 +1898,7 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1849
1898
  showModalHeader: !0,
1850
1899
  supportingText: "會以相同的投遞編號重新送出,接收端可據此避免重複處理。",
1851
1900
  title: "重新傳送通知",
1852
- children: /* @__PURE__ */ E(w, {
1901
+ children: /* @__PURE__ */ D(T, {
1853
1902
  variant: "body",
1854
1903
  children: [
1855
1904
  "確定要重新通知「",
@@ -1861,49 +1910,49 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1861
1910
  ]
1862
1911
  });
1863
1912
  }
1864
- function Un({ status: e }) {
1865
- return e === "SENT" ? /* @__PURE__ */ T(ce, {
1913
+ function qn({ status: e }) {
1914
+ return e === "SENT" ? /* @__PURE__ */ E(se, {
1866
1915
  size: "sub",
1867
1916
  text: "已送達",
1868
1917
  variant: "dot-success"
1869
- }) : e === "FAILED" ? /* @__PURE__ */ T(ce, {
1918
+ }) : e === "FAILED" ? /* @__PURE__ */ E(se, {
1870
1919
  size: "sub",
1871
1920
  text: "失敗",
1872
1921
  variant: "dot-error"
1873
- }) : /* @__PURE__ */ T(ce, {
1922
+ }) : /* @__PURE__ */ E(se, {
1874
1923
  size: "sub",
1875
1924
  text: e === "PENDING" ? "等待傳送" : "傳送中",
1876
1925
  variant: "dot-info"
1877
1926
  });
1878
1927
  }
1879
- function Wn(e) {
1928
+ function Jn(e) {
1880
1929
  return e.sentAt ? `送達:${t(e.sentAt)}` : e.status === "PENDING" && e.nextRetryAt ? `下次重試:${t(e.nextRetryAt)}` : e.lastAttemptAt ? `最後嘗試:${t(e.lastAttemptAt)}` : `建立:${t(e.createdAt)}`;
1881
1930
  }
1882
1931
  //#endregion
1883
1932
  //#region src/views/instances/viewer-field-access.ts
1884
- function Gn(e, t) {
1933
+ function Yn(e, t) {
1885
1934
  let n = new Map(t.map((e) => [e.id, e]));
1886
1935
  return new Set(e.filter((e) => e.eventType === "TASK_CREATED").map((e) => e.taskId === null ? void 0 : n.get(e.taskId)).filter((e) => e !== void 0 && !e.isAdhoc).map((e) => e.nodeId));
1887
1936
  }
1888
- function Kn({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1937
+ function Xn({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1889
1938
  let i = n.workflowSnapshot;
1890
- return et({
1939
+ return $e({
1891
1940
  definition: i,
1892
1941
  fieldKeys: (n.formDefinitionSnapshot.schema?.fields ?? []).map((e) => e.fieldKey),
1893
1942
  isAdhocTask: t?.isAdhoc ?? !1,
1894
1943
  nodeId: t?.nodeId ?? null,
1895
- revealedFieldKeys: Qe(i, Gn(e, r))
1944
+ revealedFieldKeys: Ze(i, Yn(e, r))
1896
1945
  });
1897
1946
  }
1898
1947
  //#endregion
1899
1948
  //#region src/views/instances/detail/InstanceDetailView.tsx
1900
- function qn(e) {
1901
- return `還有 ${new Set(Object.keys(e).map($e)).size} 個補填欄位需要完成`;
1949
+ function Zn(e) {
1950
+ return `還有 ${new Set(Object.keys(e).map(Qe)).size} 個補填欄位需要完成`;
1902
1951
  }
1903
- var Jn = 3e3, Yn = 40, Xn = 184, Zn = 96, Qn = {
1952
+ var Qn = 3e3, $n = 40, er = 184, tr = 96, nr = {
1904
1953
  display: "grid",
1905
1954
  gap: 16
1906
- }, $n = {
1955
+ }, rr = {
1907
1956
  background: "#f8fafc",
1908
1957
  border: "1px solid #e2e8f0",
1909
1958
  borderRadius: 8,
@@ -1911,7 +1960,7 @@ var Jn = 3e3, Yn = 40, Xn = 184, Zn = 96, Qn = {
1911
1960
  minHeight: 440,
1912
1961
  overflow: "hidden",
1913
1962
  width: "min(80vw, 1040px)"
1914
- }, er = {
1963
+ }, ir = {
1915
1964
  background: "#ffffff",
1916
1965
  border: "1px solid #cbd5e1",
1917
1966
  borderRadius: 8,
@@ -1921,24 +1970,24 @@ var Jn = 3e3, Yn = 40, Xn = 184, Zn = 96, Qn = {
1921
1970
  minHeight: 82,
1922
1971
  padding: 12,
1923
1972
  width: 184
1924
- }, tr = {
1973
+ }, ar = {
1925
1974
  borderRadius: 999,
1926
1975
  fontSize: 12,
1927
1976
  fontWeight: 600,
1928
1977
  justifySelf: "start",
1929
1978
  lineHeight: "18px",
1930
1979
  padding: "0 8px"
1931
- }, nr = {
1980
+ }, or = {
1932
1981
  color: "#64748b",
1933
1982
  fontSize: 12,
1934
1983
  overflow: "hidden",
1935
1984
  textOverflow: "ellipsis",
1936
1985
  whiteSpace: "nowrap"
1937
- }, rr = { opacity: 0 }, ir = {
1986
+ }, sr = { opacity: 0 }, cr = {
1938
1987
  display: "flex",
1939
1988
  flexWrap: "wrap",
1940
1989
  gap: 8
1941
- }, ar = {
1990
+ }, lr = {
1942
1991
  alignItems: "center",
1943
1992
  background: "#ffffff",
1944
1993
  border: "1px solid #cbd5e1",
@@ -1950,29 +1999,29 @@ var Jn = 3e3, Yn = 40, Xn = 184, Zn = 96, Qn = {
1950
1999
  gap: 6,
1951
2000
  lineHeight: "20px",
1952
2001
  padding: "4px 8px"
1953
- }, or = {
2002
+ }, ur = {
1954
2003
  display: "grid",
1955
2004
  gap: 16
1956
- }, sr = { workflowRuntime: _r };
1957
- function cr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHistory: re = !0, showSignatures: h = !0, showTasks: ae = !0, showWebhookDeliveries: se = !0 }) {
1958
- let { member: ce } = e(), b = ce?.memberId ?? null, le = se && r(ce), [x, ue] = v([]), [C, he] = v(null), [ge, ve] = v([]), [be, Se] = v([]), [Ce, we] = v([]), [D, Me] = v([]), [Ne, Pe] = v(null), [O, Be] = v([]), [Ve, Ue] = v([]), [We, qe] = v([]), [Xe, A] = v(null), [Qe, $e] = v(!0), [et, rt] = v(!1), [at, N] = v(!1), [P, st] = v(""), [ct, F] = v(!1), [I, lt] = v({}), [ut, dt] = v({}), [ft, pt] = v({}), [L, mt] = v(null), [R, gt] = v(null), [vt, yt] = v([]), z = P.trim(), B = oe(null), bt = oe(0), xt = D.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
2005
+ }, dr = { workflowRuntime: xr };
2006
+ function fr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHistory: re = !0, showSignatures: ie = !0, showTasks: ae = !0, showWebhookDeliveries: oe = !0 }) {
2007
+ let { member: se } = e(), x = se?.memberId ?? null, ce = oe && r(se), [S, le] = y([]), [w, me] = y(null), [he, _e] = y([]), [ye, xe] = y([]), [Se, Ce] = y([]), [O, je] = y([]), [Me, Ne] = y(null), [k, ze] = y([]), [Be, He] = y([]), [Ue, qe] = y([]), [Ye, j] = y(null), [Ze, Qe] = y(!0), [$e, M] = y(!1), [P, F] = y(!1), [I, at] = y(!1), [ot, L] = y(""), [R, st] = y(!1), [ct, lt] = y({}), [ut, dt] = y({}), { clearAfterResubmit: ft, comment: pt, setComment: ht } = dn(i), [gt, vt] = y({}), [z, B] = y(null), [V, yt] = y(null), [bt, xt] = y([]), St = ot.trim(), W = v(null), wt = v(0), Tt = O.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
1959
2008
  g(() => {
1960
- Zt();
1961
- }, [b, i]), g(() => {
1962
- if (!le || !xt || bt.current >= Yn) return;
2009
+ nn();
2010
+ }, [x, i]), g(() => {
2011
+ if (!ce || !Tt || wt.current >= $n) return;
1963
2012
  let e = setTimeout(() => {
1964
- bt.current += 1, en();
1965
- }, Jn);
2013
+ wt.current += 1, on();
2014
+ }, Qn);
1966
2015
  return () => clearTimeout(e);
1967
2016
  }, [
1968
- le,
1969
- xt,
1970
- D
2017
+ ce,
2018
+ Tt,
2019
+ O
1971
2020
  ]), g(() => {
1972
- dt(C?.formData ?? {}), pt({});
1973
- }, [C]);
1974
- let St = ie((e, t) => {
1975
- pt((n) => {
2021
+ dt(w?.formData ?? {}), vt({});
2022
+ }, [w]);
2023
+ let Et = h((e, t) => {
2024
+ vt((n) => {
1976
2025
  let r = n[e];
1977
2026
  return r?.hasValue === t.hasValue && r.status === t.status ? n : {
1978
2027
  ...n,
@@ -1982,448 +2031,452 @@ function cr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHis
1982
2031
  }
1983
2032
  };
1984
2033
  });
1985
- }, []), U = _(() => kt(O, b), [b, O]), W = _(() => U && C ? C.workflowSnapshot.nodes.find((e) => e.id === U.nodeId) ?? null : null, [U, C]), wt = W?.type === "userTask" && W.data.returnBehavior.allowReturn, Tt = W?.type === "userTask" && W.data.allowReject !== !1, G = W?.type === "userTask" && W.data.allowTransfer !== !1, Dt = W?.type === "userTask" && W.data.allowAddSigner, Ot = !(!C || C.initiatorMemberId !== b || C.state !== "RUNNING" && C.state !== "RETURNED"), At = !!(C && C.initiatorMemberId === b && C.state === "RETURNED"), q = _(() => U && !U.isAdhoc && W?.type === "userTask" && Ze(W).size > 0 ? W : null, [U, W]), jt = q ? U?.id ?? null : null, [Mt, Nt] = v({}), [Pt, J] = v({}), [Ft, It] = v(!1);
2034
+ }, []), K = _(() => Ot(k, x), [x, k]), q = _(() => K && w ? w.workflowSnapshot.nodes.find((e) => e.id === K.nodeId) ?? null : null, [K, w]), kt = q?.type === "userTask" && q.data.returnBehavior.allowReturn, At = q?.type === "userTask" && q.data.allowReject !== !1, jt = q?.type === "userTask" && q.data.allowTransfer !== !1, Mt = q?.type === "userTask" && q.data.allowAddSigner, Nt = !(!w || w.initiatorMemberId !== x || w.state !== "RUNNING" && w.state !== "RETURNED"), Pt = !!(w && w.initiatorMemberId === x && w.state === "RETURNED"), J = _(() => K && !K.isAdhoc && q?.type === "userTask" && Xe(q).size > 0 ? q : null, [K, q]), Ft = J ? K?.id ?? null : null, [It, Y] = y({}), [Lt, Rt] = y({}), [zt, Bt] = y(!1);
1986
2035
  g(() => {
1987
- Nt({}), J({}), It(!1);
1988
- }, [jt]);
1989
- let Y = C?.formDefinitionSnapshot.schema ?? null, X = _(() => q && Y ? o(Y, q) : null, [q, Y]), Z = _(() => X && C ? tt(X.fields, {
1990
- ...C.formData,
1991
- ...Mt
2036
+ Y({}), Rt({}), Bt(!1);
2037
+ }, [Ft]);
2038
+ let X = w?.formDefinitionSnapshot.schema ?? null, Z = _(() => J && X ? o(X, J) : null, [J, X]), Q = _(() => Z && w ? et(Z.fields, {
2039
+ ...w.formData,
2040
+ ...It
1992
2041
  }) : null, [
1993
- Mt,
1994
- X,
1995
- C
1996
- ]), Lt = _(() => q && X && Z && C ? c({
1997
- draft: Mt,
1998
- node: q,
1999
- schema: X,
2000
- stored: C.formData,
2001
- values: Z
2042
+ It,
2043
+ Z,
2044
+ w
2045
+ ]), Vt = _(() => J && Z && Q && w ? c({
2046
+ draft: It,
2047
+ node: J,
2048
+ schema: Z,
2049
+ stored: w.formData,
2050
+ values: Q
2002
2051
  }) : {}, [
2003
- Mt,
2004
- q,
2005
- X,
2052
+ It,
2053
+ J,
2006
2054
  Z,
2007
- C
2008
- ]), Rt = _(() => C ? Kn({
2009
- activityLogs: x,
2010
- actingTask: U,
2011
- instance: C,
2012
- tasks: O
2055
+ Q,
2056
+ w
2057
+ ]), Ht = _(() => w ? Xn({
2058
+ activityLogs: S,
2059
+ actingTask: K,
2060
+ instance: w,
2061
+ tasks: k
2013
2062
  }) : void 0, [
2014
- x,
2015
- U,
2016
- C,
2017
- O
2018
- ]), zt = _(() => C ? d(C.workflowSnapshot, q) : void 0, [q, C]), Q = _(() => new Map(We.map((e) => [e.memberId, e])), [We]), Bt = _(() => q && Z && Y && C?.formDataFingerprint ? {
2019
- expectedFormDataFingerprint: C.formDataFingerprint,
2020
- formData: p(Lt, q),
2021
- summary: l(Y, q, Lt, new Map([...Q.keys()].map((e) => [e, K(e, Q)])))
2063
+ S,
2064
+ K,
2065
+ w,
2066
+ k
2067
+ ]), Ut = _(() => w ? d(w.workflowSnapshot, J) : void 0, [J, w]), Wt = _(() => new Map(Ue.map((e) => [e.memberId, e])), [Ue]), Gt = _(() => J && Q && X && w?.formDataFingerprint ? {
2068
+ expectedFormDataFingerprint: w.formDataFingerprint,
2069
+ formData: p(Vt, J),
2070
+ summary: l(X, J, Vt, new Map([...Wt.keys()].map((e) => [e, G(e, Wt)])))
2022
2071
  } : null, [
2023
- Lt,
2024
- q,
2025
- Z,
2026
- C,
2072
+ Vt,
2073
+ J,
2027
2074
  Q,
2028
- Y
2075
+ w,
2076
+ Wt,
2077
+ X
2029
2078
  ]);
2030
- function Vt(e) {
2031
- if (!q) return;
2032
- let t = Ze(q), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Z?.[e]));
2033
- Nt((e) => ({
2079
+ function Kt(e) {
2080
+ if (!J) return;
2081
+ let t = Xe(J), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Q?.[e]));
2082
+ Y((e) => ({
2034
2083
  ...e,
2035
2084
  ...Object.fromEntries(n)
2036
- })), J({});
2085
+ })), Rt({});
2037
2086
  }
2038
- function Ht() {
2039
- if (q && !C?.formDataFingerprint) de.error("無法確認表單版本,請重新整理頁面後再同意。");
2087
+ function qt() {
2088
+ if (J && !w?.formDataFingerprint) ue.error("無法確認表單版本,請重新整理頁面後再同意。");
2040
2089
  else {
2041
- if (q && Z && Y && C?.formDefinitionSnapshot.uiSchema) {
2042
- let e = j({
2043
- schema: m(Y, q),
2044
- uiSchema: C.formDefinitionSnapshot.uiSchema,
2045
- values: Z
2090
+ if (J && Q && X && w?.formDefinitionSnapshot.uiSchema) {
2091
+ let e = nt({
2092
+ schema: te(X, J),
2093
+ uiSchema: w.formDefinitionSnapshot.uiSchema,
2094
+ values: Q
2046
2095
  });
2047
2096
  if (!e.valid) {
2048
- J(e.errors), e.firstInvalidFieldKey && nt(e.firstInvalidFieldKey), de.warning(qn(e.errors));
2097
+ Rt(e.errors), e.firstInvalidFieldKey && tt(e.firstInvalidFieldKey), ue.warning(Zn(e.errors));
2049
2098
  return;
2050
2099
  }
2051
2100
  }
2052
- B.current?.handleApprove();
2101
+ W.current?.handleApprove();
2053
2102
  }
2054
2103
  }
2055
- function Ut(e) {
2056
- if (!q || !Y) return !1;
2057
- if (ee(e)) return It(!0), !0;
2058
- let t = s(e, Y, q);
2059
- return t ? (J(t), nt(Object.keys(t)[0] ?? ""), de.warning(qn(t)), !0) : !1;
2104
+ function Jt(e) {
2105
+ if (!J || !X) return !1;
2106
+ if (ee(e)) return Bt(!0), !0;
2107
+ let t = s(e, X, J);
2108
+ return t ? (Rt(t), tt(Object.keys(t)[0] ?? ""), ue.warning(Zn(t)), !0) : !1;
2060
2109
  }
2061
- async function Wt() {
2062
- await Zt(), It(!1);
2110
+ async function Yt() {
2111
+ await nn(), Bt(!1);
2063
2112
  }
2064
- let Gt = _(() => un(ge), [ge]), Kt = _(() => new Map(Ce.map((e) => [e.id, e])), [Ce]), qt = _(() => C ? pr(C.workflowSnapshot) : null, [C]), Jt = _(() => C && qt ? fr(qt, O, Ve, C.state) : [], [
2065
- C,
2066
- qt,
2067
- O,
2068
- Ve
2069
- ]), Yt = _(() => qt ? mr(qt) : [], [qt]), Xt = _(() => C ? ur(C.workflowSnapshot) : [], [C]);
2070
- async function Zt() {
2071
- $e(!0), A(null);
2113
+ let Xt = _(() => un(he), [he]), Zt = _(() => new Map(Se.map((e) => [e.id, e])), [Se]), Qt = _(() => w ? _r(w.workflowSnapshot) : null, [w]), $t = _(() => w && Qt ? gr(Qt, k, Be, w.state) : [], [
2114
+ w,
2115
+ Qt,
2116
+ k,
2117
+ Be
2118
+ ]), en = _(() => Qt ? vr(Qt) : [], [Qt]), tn = _(() => w ? mr(w.workflowSnapshot) : [], [w]);
2119
+ async function nn() {
2120
+ Qe(!0), j(null);
2072
2121
  try {
2073
- let e = await Oe(i);
2074
- ue(e.activityLogs), he(e.instance), Be(e.tasks), Ue(e.workflowTokens);
2075
- let t = await Te(e.instance.id), [n, r, a, o, s] = await Promise.all([
2122
+ let e = await De(i);
2123
+ le(e.activityLogs), me(e.instance), ze(e.tasks), He(e.workflowTokens);
2124
+ let t = await we(e.instance.id), [n, r, a, o, s] = await Promise.all([
2076
2125
  ln(e.tasks),
2077
2126
  sn({
2078
2127
  ...e,
2079
2128
  adhocDirectives: t
2080
2129
  }),
2081
- Ee(e.instance.id),
2082
- je(e.instance.id),
2083
- Qt(e.instance.id)
2130
+ Te(e.instance.id),
2131
+ Ae(e.instance.id),
2132
+ rn(e.instance.id)
2084
2133
  ]);
2085
- ve(n), qe(r), Se(a), we(o.signatures), Pe(o.verification), yt(t), Me(s);
2134
+ _e(n), qe(r), xe(a), Ce(o.signatures), Ne(o.verification), xt(t), je(s);
2086
2135
  } catch (e) {
2087
- A(H(e));
2136
+ j(U(e));
2088
2137
  } finally {
2089
- $e(!1);
2138
+ Qe(!1);
2090
2139
  }
2091
2140
  }
2092
- async function Qt(e) {
2093
- return le ? De(e).catch(() => []) : [];
2141
+ async function rn(e) {
2142
+ return ce ? Ee(e).catch(() => []) : [];
2094
2143
  }
2095
- async function $t(e) {
2096
- await Ie(e.id), bt.current = 0, await Zt();
2144
+ async function an(e) {
2145
+ await Fe(e.id), wt.current = 0, await nn();
2097
2146
  }
2098
- async function en() {
2099
- let e = await Qt(i);
2100
- e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? Me(e) : await Zt();
2147
+ async function on() {
2148
+ let e = await rn(i);
2149
+ e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? je(e) : await nn();
2101
2150
  }
2102
- async function tn(e, t) {
2103
- if (!b) throw Error("尚未登入,無法上傳附件");
2104
- return { id: (await Le({
2151
+ async function cn(e, t) {
2152
+ if (!x) throw Error("尚未登入,無法上傳附件");
2153
+ return { id: (await Ie({
2105
2154
  file: t,
2106
2155
  formFieldPath: `form.${e.fieldKey}`
2107
2156
  })).id };
2108
2157
  }
2109
- async function nn(e) {
2110
- if (!b) return;
2111
- let t = await ke({ id: e.id });
2158
+ async function fn(e) {
2159
+ if (!x) return;
2160
+ let t = await Oe({ id: e.id });
2112
2161
  window.open(t, "_blank", "noopener,noreferrer");
2113
2162
  }
2114
- async function rn(e) {
2115
- if (!b) return;
2116
- let t = await Ae({ id: e.id });
2117
- mt(e), gt(t);
2163
+ async function pn(e) {
2164
+ if (!x) return;
2165
+ let t = await ke({ id: e.id });
2166
+ B(e), yt(t);
2118
2167
  }
2119
- async function an() {
2120
- if (b && C && Ot) {
2121
- rt(!0), A(null), lt({});
2168
+ async function mn() {
2169
+ if (x && w && Nt) {
2170
+ M(!0), j(null), lt({});
2122
2171
  try {
2123
- await xe({
2124
- cancelledByMemberId: b,
2125
- comment: z || null,
2126
- instanceId: C.id
2127
- }), st(""), F(!1), await Zt();
2172
+ await be({
2173
+ cancelledByMemberId: x,
2174
+ comment: St || null,
2175
+ instanceId: w.id
2176
+ }), L(""), st(!1), await nn();
2128
2177
  } catch (e) {
2129
- A(H(e));
2178
+ j(U(e));
2130
2179
  } finally {
2131
- rt(!1);
2180
+ M(!1);
2132
2181
  }
2133
2182
  }
2134
2183
  }
2135
- async function on() {
2136
- if (!b || !C || !At) return;
2137
- rt(!0), A(null), lt({});
2138
- let e = te(Object.values(ft));
2184
+ async function hn() {
2185
+ if (!x || !w || !Pt) return;
2186
+ M(!0), j(null), lt({});
2187
+ let e = m(Object.values(gt));
2139
2188
  if (e) {
2140
- A(e), rt(!1);
2189
+ j(e), M(!1);
2141
2190
  return;
2142
2191
  }
2143
- let t = C.formDefinitionSnapshot.schema ? u(C.formDefinitionSnapshot.schema, C.workflowSnapshot) : null, n = f(t ? tt(t.fields, ut) : ut, C.workflowSnapshot);
2144
- if (t && C.formDefinitionSnapshot.uiSchema) {
2145
- let e = j({
2192
+ let t = w.formDefinitionSnapshot.schema ? u(w.formDefinitionSnapshot.schema, w.workflowSnapshot) : null, n = f(t ? et(t.fields, ut) : ut, w.workflowSnapshot);
2193
+ if (t && w.formDefinitionSnapshot.uiSchema) {
2194
+ let e = nt({
2146
2195
  schema: t,
2147
- uiSchema: C.formDefinitionSnapshot.uiSchema,
2196
+ uiSchema: w.formDefinitionSnapshot.uiSchema,
2148
2197
  values: n
2149
2198
  });
2150
2199
  if (!e.valid) {
2151
- lt(e.errors), A("請先補齊必填欄位。"), e.firstInvalidFieldKey && nt(e.firstInvalidFieldKey), rt(!1);
2200
+ lt(e.errors), j("請先補齊必填欄位。"), e.firstInvalidFieldKey && tt(e.firstInvalidFieldKey), M(!1);
2152
2201
  return;
2153
2202
  }
2154
2203
  }
2155
2204
  try {
2156
- await Fe({
2205
+ await Pe({
2206
+ comment: pt,
2157
2207
  formData: n,
2158
- initiatorMemberId: b,
2159
- instanceId: C.id,
2160
- title: C.title
2161
- }), await Zt();
2208
+ initiatorMemberId: x,
2209
+ instanceId: w.id,
2210
+ title: w.title
2211
+ }), ft(w.id), await nn();
2162
2212
  } catch (e) {
2163
- A(H(e));
2213
+ j(U(e));
2164
2214
  } finally {
2165
- rt(!1);
2215
+ M(!1);
2166
2216
  }
2167
2217
  }
2168
- let cn = B.current?.deciding ?? !1, $ = et || cn;
2169
- return /* @__PURE__ */ E(ye, { children: [
2170
- /* @__PURE__ */ T(fe, { children: /* @__PURE__ */ E(Re, {
2171
- description: C ? [
2172
- Ct(C.state),
2173
- t(C.startedAt),
2174
- _t(C, Q)
2175
- ].filter(V).join(" · ") : "載入案件內容。",
2176
- title: C?.title ?? "簽核案件",
2218
+ let $ = $e || P;
2219
+ return /* @__PURE__ */ D(ve, { children: [
2220
+ /* @__PURE__ */ E(de, { children: /* @__PURE__ */ D(Le, {
2221
+ description: w ? [
2222
+ Ct(w.state),
2223
+ t(w.startedAt),
2224
+ _t(w, Wt)
2225
+ ].filter(H).join(" · ") : "載入案件內容。",
2226
+ title: w?.title ?? "簽核案件",
2177
2227
  children: [
2178
- C ? /* @__PURE__ */ T(y, {
2228
+ w ? /* @__PURE__ */ E(b, {
2179
2229
  "aria-label": "查看流程圖",
2180
- icon: Je,
2230
+ icon: A,
2181
2231
  iconType: "icon-only",
2182
- onClick: () => N(!0),
2232
+ onClick: () => at(!0),
2183
2233
  title: "查看流程圖",
2184
2234
  variant: "base-secondary",
2185
2235
  children: "流程圖"
2186
2236
  }) : null,
2187
- Ot ? /* @__PURE__ */ T(y, {
2237
+ Nt ? /* @__PURE__ */ E(b, {
2188
2238
  disabled: $,
2189
- icon: He,
2239
+ icon: Ve,
2190
2240
  iconType: "leading",
2191
- onClick: () => F(!0),
2241
+ onClick: () => st(!0),
2192
2242
  variant: "destructive-secondary",
2193
2243
  children: "取消案件"
2194
2244
  }) : null,
2195
- U ? /* @__PURE__ */ E(ye, { children: [
2196
- Dt ? /* @__PURE__ */ E(ye, { children: [/* @__PURE__ */ T(y, {
2245
+ K ? /* @__PURE__ */ D(ve, { children: [
2246
+ Mt ? /* @__PURE__ */ D(ve, { children: [/* @__PURE__ */ E(b, {
2197
2247
  disabled: $,
2198
- icon: Ke,
2248
+ icon: Ge,
2199
2249
  iconType: "leading",
2200
- onClick: () => B.current?.openAdhocModal("COUNTERSIGN"),
2250
+ onClick: () => W.current?.openAdhocModal("COUNTERSIGN"),
2201
2251
  variant: "base-secondary",
2202
2252
  children: "會簽"
2203
- }, "adhoc-countersign"), /* @__PURE__ */ T(y, {
2253
+ }, "adhoc-countersign"), /* @__PURE__ */ E(b, {
2204
2254
  disabled: $,
2205
- icon: Ke,
2255
+ icon: Ge,
2206
2256
  iconType: "leading",
2207
- onClick: () => B.current?.openAdhocModal("PRE_APPROVAL"),
2257
+ onClick: () => W.current?.openAdhocModal("PRE_APPROVAL"),
2208
2258
  variant: "base-secondary",
2209
2259
  children: "加簽"
2210
2260
  }, "adhoc-pre-approval")] }) : null,
2211
- /* @__PURE__ */ T(y, {
2261
+ /* @__PURE__ */ E(b, {
2212
2262
  disabled: $,
2213
- icon: Ge,
2263
+ icon: We,
2214
2264
  iconType: "leading",
2215
- onClick: () => B.current?.openAdhocModal("STAGE_NOTIFY"),
2265
+ onClick: () => W.current?.openAdhocModal("STAGE_NOTIFY"),
2216
2266
  variant: "base-secondary",
2217
2267
  children: "通知設定"
2218
2268
  }, "adhoc-notify"),
2219
- wt ? /* @__PURE__ */ T(y, {
2269
+ kt ? /* @__PURE__ */ E(b, {
2220
2270
  disabled: $,
2221
- icon: k,
2271
+ icon: Ke,
2222
2272
  iconType: "leading",
2223
- onClick: () => B.current?.openReturnModal(),
2273
+ onClick: () => W.current?.openReturnModal(),
2224
2274
  variant: "base-secondary",
2225
2275
  children: "退回"
2226
2276
  }, "task-return") : null,
2227
- G ? /* @__PURE__ */ T(y, {
2277
+ jt ? /* @__PURE__ */ E(b, {
2228
2278
  disabled: $,
2229
- icon: Ye,
2279
+ icon: Je,
2230
2280
  iconType: "leading",
2231
- onClick: () => B.current?.openTransferModal(),
2281
+ onClick: () => W.current?.openTransferModal(),
2232
2282
  variant: "base-secondary",
2233
2283
  children: "轉派"
2234
2284
  }, "task-transfer") : null,
2235
- Tt ? /* @__PURE__ */ T(y, {
2285
+ At ? /* @__PURE__ */ E(b, {
2236
2286
  disabled: $,
2237
- icon: He,
2287
+ icon: Ve,
2238
2288
  iconType: "leading",
2239
- onClick: () => B.current?.openRejectModal(),
2289
+ onClick: () => W.current?.openRejectModal(),
2240
2290
  variant: "destructive-secondary",
2241
2291
  children: "拒絕"
2242
2292
  }, "task-reject") : null,
2243
- /* @__PURE__ */ T(y, {
2293
+ /* @__PURE__ */ E(b, {
2244
2294
  disabled: $,
2245
- icon: ze,
2295
+ icon: Re,
2246
2296
  iconType: "leading",
2247
- onClick: Ht,
2297
+ onClick: qt,
2248
2298
  variant: "base-primary",
2249
2299
  children: "同意"
2250
2300
  }, "task-approve")
2251
2301
  ] }) : null
2252
2302
  ]
2253
2303
  }) }),
2254
- /* @__PURE__ */ E(me, { children: [
2255
- ne ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(fn, {
2256
- canResubmitInstance: At,
2257
- deciding: et,
2258
- error: Xe,
2259
- fieldAccess: Rt,
2260
- fieldLabelMarkers: zt,
2261
- fill: X && Z && q ? {
2262
- errors: Pt,
2263
- fieldCount: Ze(q).size,
2264
- onChange: Vt,
2265
- schema: X,
2266
- value: Z
2304
+ /* @__PURE__ */ D(pe, { children: [
2305
+ ne ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(gn, {
2306
+ canResubmitInstance: Pt,
2307
+ deciding: $e,
2308
+ error: Ye,
2309
+ fieldAccess: Ht,
2310
+ fieldLabelMarkers: Ut,
2311
+ fill: Z && Q && J ? {
2312
+ errors: Lt,
2313
+ fieldCount: Xe(J).size,
2314
+ onChange: Kt,
2315
+ schema: Z,
2316
+ value: Q
2267
2317
  } : null,
2268
- instance: C,
2269
- loading: Qe,
2270
- onDataSourceStateChange: St,
2271
- onReloadAfterConflict: Ft ? () => void Wt() : null,
2318
+ instance: w,
2319
+ loading: Ze,
2320
+ onDataSourceStateChange: Et,
2321
+ onReloadAfterConflict: zt ? () => void Yt() : null,
2272
2322
  onResubmitFormChange: (e) => {
2273
2323
  dt(e), lt({});
2274
2324
  },
2275
- onResubmitInstance: () => void on(),
2276
- onUploadAttachment: tn,
2325
+ onResubmitCommentChange: ht,
2326
+ onResubmitInstance: () => void hn(),
2327
+ onUploadAttachment: cn,
2328
+ resubmitComment: pt,
2277
2329
  resubmitFormData: ut,
2278
- resubmitFormErrors: I
2330
+ resubmitFormErrors: ct
2279
2331
  }) }) : null,
2280
- a ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(mn, {
2281
- attachments: be,
2332
+ a ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(vn, {
2333
+ attachments: ye,
2282
2334
  onDownload: (e) => {
2283
- nn(e);
2335
+ fn(e);
2284
2336
  },
2285
2337
  onPreview: (e) => {
2286
- rn(e);
2338
+ pn(e);
2287
2339
  }
2288
2340
  }) }) : null,
2289
- ae ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(Tn, {
2290
- adhocDirectives: vt,
2291
- currentMemberId: b,
2292
- fill: Bt,
2293
- instance: C,
2294
- memberProfilesById: Q,
2295
- onChanged: Zt,
2296
- onFillApproveError: Ut,
2297
- ref: B,
2298
- tasks: O
2341
+ ae ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(kn, {
2342
+ adhocDirectives: bt,
2343
+ currentMemberId: x,
2344
+ fill: Gt,
2345
+ instance: w,
2346
+ memberProfilesById: Wt,
2347
+ onChanged: nn,
2348
+ onDecidingChange: F,
2349
+ onFillApproveError: Jt,
2350
+ ref: W,
2351
+ tasks: k
2299
2352
  }) }) : null,
2300
- h ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(kn, {
2301
- signatureVerification: Ne,
2302
- signatures: Ce
2353
+ ie ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(Nn, {
2354
+ signatureVerification: Me,
2355
+ signatures: Se
2303
2356
  }) }) : null,
2304
- le && D.length > 0 ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(Hn, {
2305
- deliveries: D,
2306
- onRetry: $t,
2307
- readNodeLabel: (e) => Et(e, C?.workflowSnapshot ?? null)
2357
+ ce && O.length > 0 ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(Kn, {
2358
+ deliveries: O,
2359
+ onRetry: an,
2360
+ readNodeLabel: (e) => Dt(e, w?.workflowSnapshot ?? null)
2308
2361
  }) }) : null,
2309
- re ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(Rn, {
2310
- activityLogs: x,
2311
- formSchema: Y,
2312
- instanceState: C?.state ?? "RUNNING",
2313
- memberProfilesById: Q,
2314
- signatureVerification: Ne,
2315
- signaturesById: Kt,
2316
- taskDecisionsByTaskId: Gt,
2317
- tasks: O,
2318
- workflowSnapshot: C?.workflowSnapshot ?? null,
2319
- workflowTokens: Ve
2362
+ re ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(Hn, {
2363
+ activityLogs: S,
2364
+ formSchema: X,
2365
+ instanceState: w?.state ?? "RUNNING",
2366
+ memberProfilesById: Wt,
2367
+ signatureVerification: Me,
2368
+ signaturesById: Zt,
2369
+ taskDecisionsByTaskId: Xt,
2370
+ tasks: k,
2371
+ workflowSnapshot: w?.workflowSnapshot ?? null,
2372
+ workflowTokens: Be
2320
2373
  }) }) : null
2321
2374
  ] }),
2322
- C ? /* @__PURE__ */ T(S, {
2375
+ w ? /* @__PURE__ */ E(C, {
2323
2376
  modalType: "standard",
2324
- onClose: () => N(!1),
2325
- open: at,
2377
+ onClose: () => at(!1),
2378
+ open: I,
2326
2379
  showModalHeader: !0,
2327
2380
  size: "wide",
2328
- supportingText: `${Ct(C.state)} · ${t(C.startedAt)}`,
2381
+ supportingText: `${Ct(w.state)} · ${t(w.startedAt)}`,
2329
2382
  title: "流程圖",
2330
- children: /* @__PURE__ */ E("div", {
2331
- style: Qn,
2332
- children: [/* @__PURE__ */ T("div", {
2333
- style: $n,
2334
- children: /* @__PURE__ */ E(ot, {
2335
- edges: Yt,
2383
+ children: /* @__PURE__ */ D("div", {
2384
+ style: nr,
2385
+ children: [/* @__PURE__ */ E("div", {
2386
+ style: rr,
2387
+ children: /* @__PURE__ */ D(it, {
2388
+ edges: en,
2336
2389
  fitView: !0,
2337
2390
  fitViewOptions: { padding: .18 },
2338
2391
  maxZoom: 1.2,
2339
2392
  minZoom: .2,
2340
- nodes: Jt,
2393
+ nodes: $t,
2341
2394
  nodesDraggable: !1,
2342
2395
  nodesFocusable: !1,
2343
- nodeTypes: sr,
2396
+ nodeTypes: dr,
2344
2397
  panOnDrag: !0,
2345
2398
  proOptions: { hideAttribution: !0 },
2346
- children: [/* @__PURE__ */ T(M, {}), /* @__PURE__ */ T(it, { showInteractive: !1 })]
2399
+ children: [/* @__PURE__ */ E(rt, {}), /* @__PURE__ */ E(N, { showInteractive: !1 })]
2347
2400
  })
2348
- }), Xt.length > 0 ? /* @__PURE__ */ T("div", {
2349
- style: ir,
2350
- children: Xt.map((e) => /* @__PURE__ */ T("span", {
2351
- style: ar,
2401
+ }), tn.length > 0 ? /* @__PURE__ */ E("div", {
2402
+ style: cr,
2403
+ children: tn.map((e) => /* @__PURE__ */ E("span", {
2404
+ style: lr,
2352
2405
  children: e
2353
2406
  }, e))
2354
2407
  }) : null]
2355
2408
  })
2356
2409
  }) : null,
2357
- /* @__PURE__ */ T(S, {
2410
+ /* @__PURE__ */ E(C, {
2358
2411
  modalType: "standard",
2359
2412
  onClose: () => {
2360
- mt(null), gt(null);
2413
+ B(null), yt(null);
2361
2414
  },
2362
- open: !!(L && R),
2415
+ open: !!(z && V),
2363
2416
  showModalHeader: !0,
2364
2417
  size: "wide",
2365
- supportingText: L?.filename ?? void 0,
2418
+ supportingText: z?.filename ?? void 0,
2366
2419
  title: "PDF 預覽",
2367
- children: R ? /* @__PURE__ */ T(ht, {
2368
- filename: L?.filename ?? "PDF 預覽",
2369
- fileUrl: R,
2370
- onDownload: L ? () => void nn(L) : void 0
2420
+ children: V ? /* @__PURE__ */ E(mt, {
2421
+ filename: z?.filename ?? "PDF 預覽",
2422
+ fileUrl: V,
2423
+ onDownload: z ? () => void fn(z) : void 0
2371
2424
  }) : null
2372
2425
  }),
2373
- /* @__PURE__ */ T(S, {
2426
+ /* @__PURE__ */ E(C, {
2374
2427
  cancelText: "保留案件",
2375
2428
  confirmButtonProps: { variant: "destructive-primary" },
2376
2429
  confirmText: "確認取消",
2377
- loading: et,
2430
+ loading: $e,
2378
2431
  modalStatusType: "error",
2379
2432
  modalType: "standard",
2380
- onCancel: () => F(!1),
2381
- onClose: () => F(!1),
2382
- onConfirm: () => void an(),
2383
- open: ct,
2433
+ onCancel: () => st(!1),
2434
+ onClose: () => st(!1),
2435
+ onConfirm: () => void mn(),
2436
+ open: R,
2384
2437
  showModalFooter: !0,
2385
2438
  showModalHeader: !0,
2386
2439
  supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
2387
2440
  title: "取消案件",
2388
- children: /* @__PURE__ */ E("div", {
2389
- style: or,
2390
- children: [/* @__PURE__ */ E(w, {
2441
+ children: /* @__PURE__ */ D("div", {
2442
+ style: ur,
2443
+ children: [/* @__PURE__ */ D(T, {
2391
2444
  variant: "body",
2392
2445
  children: [
2393
2446
  "確定要取消「",
2394
- C?.title ?? "",
2447
+ w?.title ?? "",
2395
2448
  "」嗎?"
2396
2449
  ]
2397
- }), /* @__PURE__ */ T(n, {
2450
+ }), /* @__PURE__ */ E(n, {
2398
2451
  label: "取消原因",
2399
2452
  name: "cancelComment",
2400
- children: /* @__PURE__ */ T(_e, {
2401
- onChange: (e) => st(e.target.value),
2453
+ children: /* @__PURE__ */ E(ge, {
2454
+ onChange: (e) => L(e.target.value),
2402
2455
  placeholder: "可填寫取消原因",
2403
2456
  resize: "vertical",
2404
2457
  rows: 3,
2405
- value: P
2458
+ value: ot
2406
2459
  })
2407
2460
  })]
2408
2461
  })
2409
2462
  })
2410
2463
  ] });
2411
2464
  }
2412
- function lr(e) {
2465
+ function pr(e) {
2413
2466
  return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
2414
2467
  }
2415
- function ur(e) {
2416
- return e.edges.map(lr).filter((e) => e.trim().length > 0);
2468
+ function mr(e) {
2469
+ return e.edges.map(pr).filter((e) => e.trim().length > 0);
2417
2470
  }
2418
- function dr(e) {
2471
+ function hr(e) {
2419
2472
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
2420
2473
  }
2421
- function fr(e, t, n, r) {
2474
+ function gr(e, t, n, r) {
2422
2475
  return e.nodes.map((e) => {
2423
2476
  let i = on(e, t, n, r);
2424
2477
  return {
2425
2478
  data: {
2426
- kindLabel: dr(e.type),
2479
+ kindLabel: hr(e.type),
2427
2480
  label: e.data.label,
2428
2481
  secondaryLabel: i.secondaryLabel,
2429
2482
  statusLabel: i.statusLabel,
@@ -2431,42 +2484,42 @@ function fr(e, t, n, r) {
2431
2484
  },
2432
2485
  id: e.id,
2433
2486
  position: e.position,
2434
- sourcePosition: N.Right,
2435
- targetPosition: N.Left,
2487
+ sourcePosition: F.Right,
2488
+ targetPosition: F.Left,
2436
2489
  type: "workflowRuntime"
2437
2490
  };
2438
2491
  });
2439
2492
  }
2440
- function pr(e) {
2441
- let t = new P.graphlib.Graph();
2493
+ function _r(e) {
2494
+ let t = new I.graphlib.Graph();
2442
2495
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
2443
2496
  nodesep: 56,
2444
2497
  rankdir: "LR",
2445
2498
  ranksep: 120
2446
2499
  }), e.nodes.forEach((e) => {
2447
2500
  t.setNode(e.id, {
2448
- height: Zn,
2449
- width: Xn
2501
+ height: tr,
2502
+ width: er
2450
2503
  });
2451
2504
  }), e.edges.forEach((e) => {
2452
2505
  t.setEdge(e.source, e.target);
2453
- }), P.layout(t), {
2506
+ }), I.layout(t), {
2454
2507
  ...e,
2455
2508
  nodes: e.nodes.map((e) => {
2456
2509
  let n = t.node(e.id);
2457
2510
  return n ? {
2458
2511
  ...e,
2459
2512
  position: {
2460
- x: n.x - Xn / 2,
2461
- y: n.y - Zn / 2
2513
+ x: n.x - er / 2,
2514
+ y: n.y - tr / 2
2462
2515
  }
2463
2516
  } : e;
2464
2517
  })
2465
2518
  };
2466
2519
  }
2467
- function mr(e) {
2520
+ function vr(e) {
2468
2521
  return e.edges.map((e) => {
2469
- let t = lr(e);
2522
+ let t = pr(e);
2470
2523
  return {
2471
2524
  animated: !1,
2472
2525
  id: e.id,
@@ -2494,25 +2547,25 @@ function mr(e) {
2494
2547
  };
2495
2548
  });
2496
2549
  }
2497
- function hr(e) {
2550
+ function yr(e) {
2498
2551
  return e === "current" ? {
2499
- ...er,
2552
+ ...ir,
2500
2553
  border: "1px solid var(--mzn-color-primary, #0057ff)",
2501
2554
  boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
2502
2555
  } : e === "completed" ? {
2503
- ...er,
2556
+ ...ir,
2504
2557
  border: "1px solid #16a34a"
2505
2558
  } : e === "cancelled" ? {
2506
- ...er,
2559
+ ...ir,
2507
2560
  border: "1px solid #dc2626",
2508
2561
  opacity: .72
2509
2562
  } : e === "waiting" ? {
2510
- ...er,
2563
+ ...ir,
2511
2564
  border: "1px dashed #64748b"
2512
- } : er;
2565
+ } : ir;
2513
2566
  }
2514
- function gr(e) {
2515
- let t = tr;
2567
+ function br(e) {
2568
+ let t = ar;
2516
2569
  return e === "current" ? {
2517
2570
  ...t,
2518
2571
  background: "#eff6ff",
@@ -2535,42 +2588,42 @@ function gr(e) {
2535
2588
  color: "#64748b"
2536
2589
  };
2537
2590
  }
2538
- function _r({ data: e }) {
2539
- return /* @__PURE__ */ E("div", {
2540
- style: hr(e.tone),
2591
+ function xr({ data: e }) {
2592
+ return /* @__PURE__ */ D("div", {
2593
+ style: yr(e.tone),
2541
2594
  children: [
2542
- /* @__PURE__ */ T(at, {
2595
+ /* @__PURE__ */ E(P, {
2543
2596
  isConnectable: !1,
2544
- position: N.Left,
2545
- style: rr,
2597
+ position: F.Left,
2598
+ style: sr,
2546
2599
  type: "target"
2547
2600
  }),
2548
- /* @__PURE__ */ T(w, {
2601
+ /* @__PURE__ */ E(T, {
2549
2602
  component: "span",
2550
2603
  ellipsis: !0,
2551
2604
  title: e.label,
2552
2605
  variant: "label-primary",
2553
2606
  children: e.label
2554
2607
  }),
2555
- /* @__PURE__ */ T("span", {
2556
- style: gr(e.tone),
2608
+ /* @__PURE__ */ E("span", {
2609
+ style: br(e.tone),
2557
2610
  children: e.statusLabel
2558
2611
  }),
2559
- /* @__PURE__ */ T("span", {
2612
+ /* @__PURE__ */ E("span", {
2560
2613
  title: e.secondaryLabel,
2561
- style: nr,
2614
+ style: or,
2562
2615
  children: e.secondaryLabel || e.kindLabel
2563
2616
  }),
2564
- /* @__PURE__ */ T(at, {
2617
+ /* @__PURE__ */ E(P, {
2565
2618
  isConnectable: !1,
2566
- position: N.Right,
2567
- style: rr,
2619
+ position: F.Right,
2620
+ style: sr,
2568
2621
  type: "source"
2569
2622
  })
2570
2623
  ]
2571
2624
  });
2572
2625
  }
2573
2626
  //#endregion
2574
- export { Tn as a, kn as i, Hn as n, mn as o, Rn as r, fn as s, cr as t };
2627
+ export { kn as a, Nn as i, Kn as n, vn as o, Hn as r, gn as s, fr as t };
2575
2628
 
2576
- //# sourceMappingURL=detail-URwxkcro.js.map
2629
+ //# sourceMappingURL=detail-CExpbazF.js.map