@rytass/bpm-core-react 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/chunks/FormBuilderView-CLFlfDGe.cjs +3 -0
  3. package/dist/chunks/FormBuilderView-CLFlfDGe.cjs.map +1 -0
  4. package/dist/chunks/FormBuilderView-D4xIuPYB.js +1960 -0
  5. package/dist/chunks/FormBuilderView-D4xIuPYB.js.map +1 -0
  6. package/dist/chunks/FormRendererView-BxGT16z0.cjs +2 -0
  7. package/dist/chunks/FormRendererView-BxGT16z0.cjs.map +1 -0
  8. package/dist/chunks/FormRendererView-DUceSOXe.js +798 -0
  9. package/dist/chunks/FormRendererView-DUceSOXe.js.map +1 -0
  10. package/dist/chunks/{compose-CUOe5Ia9.js → compose-Bb-REfoB.js} +4 -4
  11. package/dist/chunks/{compose-CUOe5Ia9.js.map → compose-Bb-REfoB.js.map} +1 -1
  12. package/dist/chunks/{compose-CyRkXdeu.cjs → compose-DzRYZcqe.cjs} +2 -2
  13. package/dist/chunks/{compose-CyRkXdeu.cjs.map → compose-DzRYZcqe.cjs.map} +1 -1
  14. package/dist/chunks/{designer-Cb3WAC46.js → designer-C6oIO9Kq.js} +2 -2
  15. package/dist/chunks/{designer-Cb3WAC46.js.map → designer-C6oIO9Kq.js.map} +1 -1
  16. package/dist/chunks/{designer-zLliyrHu.cjs → designer-gFUdImeZ.cjs} +2 -2
  17. package/dist/chunks/{designer-zLliyrHu.cjs.map → designer-gFUdImeZ.cjs.map} +1 -1
  18. package/dist/chunks/{detail-Cmw-aQcu.js → detail-BgKgMvYx.js} +391 -390
  19. package/dist/chunks/{detail-Cmw-aQcu.js.map → detail-BgKgMvYx.js.map} +1 -1
  20. package/dist/chunks/{detail-Bp2Nv0cs.cjs → detail-Dnz5aaI-.cjs} +2 -2
  21. package/dist/chunks/{detail-Bp2Nv0cs.cjs.map → detail-Dnz5aaI-.cjs.map} +1 -1
  22. package/dist/pages/instances/detail/index.cjs +1 -1
  23. package/dist/pages/instances/detail/index.js +1 -1
  24. package/dist/pages/templates/compose/index.cjs +1 -1
  25. package/dist/pages/templates/compose/index.js +1 -1
  26. package/dist/pages/templates/designer/index.cjs +1 -1
  27. package/dist/pages/templates/designer/index.js +1 -1
  28. package/dist/views/forms/builder/index.cjs +1 -1
  29. package/dist/views/forms/builder/index.js +1 -1
  30. package/dist/views/forms/renderer/form-data-source-field.d.ts +16 -0
  31. package/dist/views/forms/renderer/index.cjs +1 -1
  32. package/dist/views/forms/renderer/index.js +1 -1
  33. package/dist/views/instances/detail/index.cjs +1 -1
  34. package/dist/views/instances/detail/index.js +1 -1
  35. package/dist/views/instances/new/index.cjs +1 -1
  36. package/dist/views/instances/new/index.cjs.map +1 -1
  37. package/dist/views/instances/new/index.js +48 -48
  38. package/dist/views/instances/new/index.js.map +1 -1
  39. package/dist/views/templates/compose/index.cjs +1 -1
  40. package/dist/views/templates/compose/index.js +1 -1
  41. package/dist/views/templates/designer/index.cjs +1 -1
  42. package/dist/views/templates/designer/index.js +1 -1
  43. package/package.json +3 -3
  44. package/dist/chunks/FormBuilderView-CAqjOYAP.cjs +0 -3
  45. package/dist/chunks/FormBuilderView-CAqjOYAP.cjs.map +0 -1
  46. package/dist/chunks/FormBuilderView-TzSezeqC.js +0 -1479
  47. package/dist/chunks/FormBuilderView-TzSezeqC.js.map +0 -1
  48. package/dist/chunks/FormRendererView-BurlEDUu.js +0 -580
  49. package/dist/chunks/FormRendererView-BurlEDUu.js.map +0 -1
  50. package/dist/chunks/FormRendererView-Dde1s3I0.cjs +0 -2
  51. package/dist/chunks/FormRendererView-Dde1s3I0.cjs.map +0 -1
@@ -2,20 +2,20 @@
2
2
  import { n as e } from "./auth-provider-B5oPmvk2.js";
3
3
  import { t } from "./format-date-time-CB-LxzqT.js";
4
4
  import { t as n } from "./bpm-form-field-Cao0rMol.js";
5
- import { i as r, t as i } from "./FormRendererView-BurlEDUu.js";
5
+ import { i as r, t as i } from "./FormRendererView-DUceSOXe.js";
6
6
  import '../style.css';import '../detail.css';/* empty css */
7
7
  import { Fragment as a, forwardRef as o, useCallback as s, useEffect as c, useImperativeHandle as l, useMemo as u, useRef as d, useState as f } from "react";
8
8
  import { AutoComplete as p, Button as m, Input as ee, Modal as h, PageHeader as te, Section as g, SectionGroup as _, Select as ne, Stepper as v, Table as re, Textarea as y, Tooltip as b, Typography as x } from "@mezzanine-ui/react";
9
9
  import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
10
10
  import { cancelAdhocDirective as T, cancelApprovalInstance as ie, configureAdhocCompletionNotification as ae, configureAdhocStageNotification as oe, decideTask as se, listAdhocDirectives as ce, listAttachments as le, listTaskDecisions as ue, readApprovalInstance as de, readAttachmentDownloadUrl as fe, readAttachmentPreviewUrl as pe, readInstanceSignatures as me, requestAdhocCountersign as he, requestAdhocPreApproval as ge, resolveMemberProfiles as _e, resubmitApprovalInstance as ve, searchMembers as ye, uploadAttachment as be } from "@rytass/bpm-core-client/workflow";
11
11
  import xe from "@mezzanine-ui/react/ContentHeader";
12
- import { CheckedIcon as Se, ChevronLeftIcon as Ce, ChevronRightIcon as E, DangerousOutlineIcon as we, DownloadIcon as Te, FileSearchIcon as D, NotificationUnreadIcon as Ee, PlusIcon as De, RefreshCcwIcon as Oe, ShareIcon as ke, UserIcon as Ae, ZoomInIcon as je, ZoomOutIcon as Me } from "@mezzanine-ui/icons";
13
- import { focusFormRendererField as Ne, readFormDataSourceErrorMessage as Pe, validateFormRendererValues as Fe } from "@rytass/bpm-core-client/form";
14
- import { Background as Ie, Controls as Le, Handle as Re, Position as O, ReactFlow as ze } from "@xyflow/react";
15
- import * as Be from "dagre";
16
- import { Document as k, Page as Ve } from "react-pdf";
17
- import { stepClasses as A } from "@mezzanine-ui/core/stepper";
18
- var j = {
12
+ import { CheckedIcon as Se, ChevronLeftIcon as Ce, ChevronRightIcon as E, DangerousOutlineIcon as we, DownloadIcon as D, FileSearchIcon as O, NotificationUnreadIcon as Te, PlusIcon as Ee, RefreshCcwIcon as De, ShareIcon as Oe, UserIcon as ke, ZoomInIcon as Ae, ZoomOutIcon as je } from "@mezzanine-ui/icons";
13
+ import { buildFormRendererValues as Me, focusFormRendererField as Ne, readFormDataSourceErrorMessage as Pe, validateFormRendererValues as Fe } from "@rytass/bpm-core-client/form";
14
+ import { Background as Ie, Controls as Le, Handle as Re, Position as k, ReactFlow as ze } from "@xyflow/react";
15
+ import * as A from "dagre";
16
+ import { Document as Be, Page as Ve } from "react-pdf";
17
+ import { stepClasses as j } from "@mezzanine-ui/core/stepper";
18
+ var M = {
19
19
  root: "bpm_root_ehm7w",
20
20
  toolbar: "bpm_toolbar_R-tis",
21
21
  pageControls: "bpm_pageControls_jM-rC",
@@ -24,9 +24,9 @@ var j = {
24
24
  viewport: "bpm_viewport_DQXms",
25
25
  page: "bpm_page_Cv5Rg",
26
26
  state: "bpm_state_bpgp3"
27
- }, M = 760, N = 920, P = 320, He = 32, F = .75, Ue = 1.75, I = .25;
28
- function We({ filename: e, fileUrl: t, onDownload: n }) {
29
- let r = d(null), [i, a] = f(null), [o, l] = f(1), [p, ee] = f(1), [h, te] = f(M);
27
+ }, N = 760, P = 920, He = 320, Ue = 32, F = .75, We = 1.75, I = .25;
28
+ function Ge({ filename: e, fileUrl: t, onDownload: n }) {
29
+ let r = d(null), [i, a] = f(null), [o, l] = f(1), [p, ee] = f(1), [h, te] = f(N);
30
30
  c(() => {
31
31
  let e = r.current;
32
32
  if (!e || typeof ResizeObserver > "u") return;
@@ -39,19 +39,19 @@ function We({ filename: e, fileUrl: t, onDownload: n }) {
39
39
  a(null), l(1), ee(1);
40
40
  }, [t]);
41
41
  let g = u(() => {
42
- let e = Math.max(P, h - He);
43
- return Math.round(Math.min(N, e) * p);
42
+ let e = Math.max(He, h - Ue);
43
+ return Math.round(Math.min(P, e) * p);
44
44
  }, [p, h]), _ = s((e) => {
45
45
  a(e.numPages), l(1);
46
- }, []), ne = o > 1, v = i !== null && o < i, re = p > F, y = p < Ue, b = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, S = `${Math.round(p * 100)}%`;
46
+ }, []), ne = o > 1, v = i !== null && o < i, re = p > F, y = p < We, b = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, S = `${Math.round(p * 100)}%`;
47
47
  return /* @__PURE__ */ w("section", {
48
48
  "aria-label": `${e} PDF 預覽`,
49
- className: j.root,
49
+ className: M.root,
50
50
  children: [/* @__PURE__ */ w("div", {
51
- className: j.toolbar,
51
+ className: M.toolbar,
52
52
  children: [
53
53
  /* @__PURE__ */ w("div", {
54
- className: j.pageControls,
54
+ className: M.pageControls,
55
55
  "aria-label": "頁面切換",
56
56
  children: [
57
57
  /* @__PURE__ */ C(m, {
@@ -65,7 +65,7 @@ function We({ filename: e, fileUrl: t, onDownload: n }) {
65
65
  variant: "base-secondary"
66
66
  }),
67
67
  /* @__PURE__ */ C(x, {
68
- className: j.counter,
68
+ className: M.counter,
69
69
  component: "span",
70
70
  variant: "body",
71
71
  children: b
@@ -83,13 +83,13 @@ function We({ filename: e, fileUrl: t, onDownload: n }) {
83
83
  ]
84
84
  }),
85
85
  /* @__PURE__ */ w("div", {
86
- className: j.zoomControls,
86
+ className: M.zoomControls,
87
87
  "aria-label": "縮放",
88
88
  children: [
89
89
  /* @__PURE__ */ C(m, {
90
90
  "aria-label": "縮小",
91
91
  disabled: !re,
92
- icon: Me,
92
+ icon: je,
93
93
  onClick: () => {
94
94
  ee((e) => Math.max(F, e - I));
95
95
  },
@@ -97,7 +97,7 @@ function We({ filename: e, fileUrl: t, onDownload: n }) {
97
97
  variant: "base-secondary"
98
98
  }),
99
99
  /* @__PURE__ */ C(x, {
100
- className: j.counter,
100
+ className: M.counter,
101
101
  component: "span",
102
102
  variant: "body",
103
103
  children: S
@@ -105,9 +105,9 @@ function We({ filename: e, fileUrl: t, onDownload: n }) {
105
105
  /* @__PURE__ */ C(m, {
106
106
  "aria-label": "放大",
107
107
  disabled: !y,
108
- icon: je,
108
+ icon: Ae,
109
109
  onClick: () => {
110
- ee((e) => Math.min(Ue, e + I));
110
+ ee((e) => Math.min(We, e + I));
111
111
  },
112
112
  size: "minor",
113
113
  variant: "base-secondary"
@@ -115,7 +115,7 @@ function We({ filename: e, fileUrl: t, onDownload: n }) {
115
115
  ]
116
116
  }),
117
117
  n ? /* @__PURE__ */ C(m, {
118
- icon: Te,
118
+ icon: D,
119
119
  iconType: "leading",
120
120
  onClick: n,
121
121
  size: "minor",
@@ -124,16 +124,16 @@ function We({ filename: e, fileUrl: t, onDownload: n }) {
124
124
  }) : null
125
125
  ]
126
126
  }), /* @__PURE__ */ C("div", {
127
- className: j.viewport,
127
+ className: M.viewport,
128
128
  ref: r,
129
- children: /* @__PURE__ */ C(k, {
129
+ children: /* @__PURE__ */ C(Be, {
130
130
  error: /* @__PURE__ */ C(L, { message: "PDF 無法載入。" }),
131
131
  file: t,
132
132
  loading: /* @__PURE__ */ C(L, { message: "正在載入 PDF..." }),
133
133
  noData: /* @__PURE__ */ C(L, { message: "沒有可預覽的 PDF。" }),
134
134
  onLoadSuccess: _,
135
135
  children: /* @__PURE__ */ C(Ve, {
136
- className: j.page,
136
+ className: M.page,
137
137
  loading: /* @__PURE__ */ C(L, { message: "正在載入頁面..." }),
138
138
  pageNumber: o,
139
139
  renderAnnotationLayer: !0,
@@ -146,7 +146,7 @@ function We({ filename: e, fileUrl: t, onDownload: n }) {
146
146
  }
147
147
  function L({ message: e }) {
148
148
  return /* @__PURE__ */ C("div", {
149
- className: j.state,
149
+ className: M.state,
150
150
  children: /* @__PURE__ */ C(x, {
151
151
  color: "text-neutral",
152
152
  variant: "body",
@@ -191,25 +191,25 @@ function U(e) {
191
191
  function W(e) {
192
192
  return typeof e == "object" && !!e;
193
193
  }
194
- function Ge(e) {
194
+ function Ke(e) {
195
195
  return e.status === "PENDING" || e.status === "IN_PROGRESS";
196
196
  }
197
197
  function G(e) {
198
198
  return Pe(e) || (e instanceof Error ? e.message : "發生未知錯誤");
199
199
  }
200
- function Ke(e) {
200
+ function qe(e) {
201
201
  return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
202
202
  }
203
- function qe(e) {
203
+ function Je(e) {
204
204
  return e.length > 16 ? `${e.slice(0, 12)}...` : e;
205
205
  }
206
- function Je(e) {
206
+ function Ye(e) {
207
207
  return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
208
208
  }
209
209
  function K(e) {
210
210
  return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
211
211
  }
212
- function Ye(e) {
212
+ function Xe(e) {
213
213
  return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
214
214
  }
215
215
  function q(e) {
@@ -223,16 +223,16 @@ function Y(e, t) {
223
223
  let n = t.get(e);
224
224
  return n ? `${n.name}(${n.email})` : e;
225
225
  }
226
- function Xe(e, t = /* @__PURE__ */ new Map()) {
226
+ function Ze(e, t = /* @__PURE__ */ new Map()) {
227
227
  let n = z(e.delegationChainJson);
228
228
  if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => Y(e, t)).join("、")}` : "未指定";
229
229
  let r = Y(e.assigneeMemberId, t), i = Y(e.originalAssigneeMemberId, t);
230
230
  return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
231
231
  }
232
- function Ze(e, t) {
232
+ function Qe(e, t) {
233
233
  return t ? e.assigneeMemberId === t || e.candidateMemberIds.includes(t) : !1;
234
234
  }
235
- function Qe(e, t) {
235
+ function $e(e, t) {
236
236
  if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
237
237
  if (t.data.returnBehavior.allowedTargets === "ANY") return e.nodes.filter((e) => e.id !== t.id).map((e) => ({
238
238
  id: e.id,
@@ -244,14 +244,14 @@ function Qe(e, t) {
244
244
  name: `${r.data.label}(${q(r.type)})`
245
245
  }] : [];
246
246
  }
247
- function $e(e) {
247
+ function et(e) {
248
248
  return {
249
249
  email: e.email,
250
250
  id: e.memberId,
251
251
  name: `${e.name} · ${e.email}`
252
252
  };
253
253
  }
254
- function et(e) {
254
+ function tt(e) {
255
255
  if (!W(e)) return null;
256
256
  let t = e.email, n = e.id, r = e.name;
257
257
  return typeof n == "string" && typeof r == "string" ? {
@@ -260,7 +260,7 @@ function et(e) {
260
260
  name: r
261
261
  } : null;
262
262
  }
263
- function tt(e, t) {
263
+ function nt(e, t) {
264
264
  let n = e.trim().toLocaleLowerCase();
265
265
  if (!n) return null;
266
266
  let r = t.filter((e) => [
@@ -276,13 +276,13 @@ function X(e) {
276
276
  type: "text"
277
277
  } : null;
278
278
  }
279
- function nt(e) {
279
+ function rt(e) {
280
280
  return U(e) ? {
281
281
  text: e,
282
282
  type: "dangerText"
283
283
  } : null;
284
284
  }
285
- function rt(e, t, n, r) {
285
+ function it(e, t, n, r) {
286
286
  let i = t ? n.get(t) : null;
287
287
  return {
288
288
  email: i?.email ?? null,
@@ -295,20 +295,20 @@ function rt(e, t, n, r) {
295
295
  function Z(e) {
296
296
  return !!e;
297
297
  }
298
- function it(e) {
298
+ function at(e) {
299
299
  let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
300
300
  return t === -1 ? e.length : t;
301
301
  }
302
- function at(e) {
302
+ function ot(e) {
303
303
  return e.eventType === "INSTANCE_STARTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED";
304
304
  }
305
- function ot(e) {
305
+ function st(e) {
306
306
  return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
307
307
  }
308
- function st(e, t) {
309
- return e === "INSTANCE_STARTED" ? "案件已發起" : e === "TOKEN_CREATED" ? "流程路徑已建立" : e === "ENGINE_PROCESS_REQUESTED" ? "流程引擎已處理" : e === "TOKEN_ADVANCED" ? "流程已前進" : e === "TASK_CREATED" ? "待簽任務已建立" : e === "TASK_DECIDED" ? ot(B(t, "action")) : e === "SLA_TRIGGERED" ? "時限提醒已觸發" : e;
308
+ function ct(e, t) {
309
+ return e === "INSTANCE_STARTED" ? "案件已發起" : e === "TOKEN_CREATED" ? "流程路徑已建立" : e === "ENGINE_PROCESS_REQUESTED" ? "流程引擎已處理" : e === "TOKEN_ADVANCED" ? "流程已前進" : e === "TASK_CREATED" ? "待簽任務已建立" : e === "TASK_DECIDED" ? st(B(t, "action")) : e === "SLA_TRIGGERED" ? "時限提醒已觸發" : e;
310
310
  }
311
- function ct(e) {
311
+ function lt(e) {
312
312
  try {
313
313
  let t = JSON.parse(e.payloadJson);
314
314
  return W(t) ? t : {};
@@ -316,13 +316,13 @@ function ct(e) {
316
316
  return {};
317
317
  }
318
318
  }
319
- function lt(e, t) {
319
+ function ut(e, t) {
320
320
  return e.eventType === "SLA_TRIGGERED" || B(t, "action") === "REJECTED" || B(t, "instanceState") === "REJECTED";
321
321
  }
322
- function ut(e) {
322
+ function dt(e) {
323
323
  return t(e);
324
324
  }
325
- function dt(e, t, n, r) {
325
+ function ft(e, t, n, r) {
326
326
  if (e.eventType === "TASK_CREATED") {
327
327
  let e = B(t, "assigneeMemberId"), n = B(t, "originalAssigneeMemberId");
328
328
  if (!e) {
@@ -333,12 +333,12 @@ function dt(e, t, n, r) {
333
333
  return n && n !== e ? `待簽人:${i}(原簽核人:${a})` : `待簽人:${i}`;
334
334
  }
335
335
  if (e.eventType === "TASK_DECIDED") {
336
- let e = B(t, "action"), n = B(t, "comment"), i = e ? `決議:${Ye(e)}` : null, a = B(t, "transferToMemberId");
336
+ let e = B(t, "action"), n = B(t, "comment"), i = e ? `決議:${Xe(e)}` : null, a = B(t, "transferToMemberId");
337
337
  return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(U).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(U).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${Y(a, r)}`].filter(U).join(" · ") : i;
338
338
  }
339
339
  if (e.eventType === "TOKEN_ADVANCED") {
340
340
  let e = B(t, "action");
341
- if (e) return `流程結果:${Ye(e)}`;
341
+ if (e) return `流程結果:${Xe(e)}`;
342
342
  let r = H(t, "arrivedCount"), i = H(t, "requiredCount");
343
343
  if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
344
344
  let a = B(t, "fromNodeId"), o = B(t, "toNodeId");
@@ -346,103 +346,103 @@ function dt(e, t, n, r) {
346
346
  }
347
347
  if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
348
348
  let e = B(t, "state");
349
- return e ? `案件狀態:${Je(e)}` : null;
349
+ return e ? `案件狀態:${Ye(e)}` : null;
350
350
  }
351
351
  return null;
352
352
  }
353
- function ft(e, t, n, r, i, a, o) {
354
- if (e.eventType !== "TASK_DECIDED") return [X(dt(e, t, n, o))].filter(Z);
353
+ function pt(e, t, n, r, i, a, o) {
354
+ if (e.eventType !== "TASK_DECIDED") return [X(ft(e, t, n, o))].filter(Z);
355
355
  let s = e.taskId ? r.get(e.taskId) : null, c = B(t, "action") ?? s?.action ?? null, l = B(t, "comment") ?? s?.comment ?? null, u = B(t, "transferToMemberId") ?? s?.transferToMemberId ?? null, d = B(t, "signatureId") ?? s?.signatureId ?? null, f = d ? i.get(d) : null;
356
356
  return [
357
- X(c ? `決議:${Ye(c)}` : null),
358
- c === "REJECTED" ? nt(`拒絕原因:${l ?? "-"}`) : null,
357
+ X(c ? `決議:${Xe(c)}` : null),
358
+ c === "REJECTED" ? rt(`拒絕原因:${l ?? "-"}`) : null,
359
359
  c === "APPROVED" && l ? X(`同意說明:${l}`) : null,
360
360
  c === "RETURNED" ? X(`退回說明:${l ?? "-"}`) : null,
361
361
  c === "TRANSFERRED" ? X(`轉派給:${Y(u, o)}`) : null,
362
362
  c === "TRANSFERRED" ? X(`轉派說明:${l ?? "-"}`) : null,
363
- f ? X(a?.valid ? `簽章:已驗證(${qe(f.signedPayloadHash)})` : `簽章:待檢查(${qe(f.signedPayloadHash)})`) : null
363
+ f ? X(a?.valid ? `簽章:已驗證(${Je(f.signedPayloadHash)})` : `簽章:待檢查(${Je(f.signedPayloadHash)})`) : null
364
364
  ].filter(Z);
365
365
  }
366
- function pt(e, t, n, r, i) {
366
+ function mt(e, t, n, r, i) {
367
367
  if (e.type === "startEvent" || i.has(e.id)) return !1;
368
368
  if (r === "REJECTED") return !0;
369
- let a = bt(e, t, n, r);
369
+ let a = xt(e, t, n, r);
370
370
  return a.tone === "neutral" || a.tone === "waiting";
371
371
  }
372
372
  function Q(e, t, n, r, i) {
373
373
  if (r !== "RUNNING" && r !== "REJECTED") return [];
374
- let a = e.nodes.filter((e) => pt(e, t, n, r, i)), o = mt(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
374
+ let a = e.nodes.filter((e) => mt(e, t, n, r, i)), o = ht(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
375
375
  return a.filter((e) => o.has(e.id)).sort((e, t) => {
376
376
  let n = o.get(e.id) ?? 0, r = o.get(t.id) ?? 0;
377
377
  return n === r ? e.position.x === t.position.x ? e.position.y === t.position.y ? (s.get(e.id) ?? 0) - (s.get(t.id) ?? 0) : e.position.y - t.position.y : e.position.x - t.position.x : n - r;
378
378
  });
379
379
  }
380
- function mt(e, t, n, r, i) {
380
+ function ht(e, t, n, r, i) {
381
381
  let a = new Set(t.map((e) => e.id)), o = e.edges.reduce((e, t) => {
382
382
  let n = [...e.get(t.source) ?? [], t.target];
383
383
  return new Map(e).set(t.source, n);
384
384
  }, /* @__PURE__ */ new Map());
385
- return ht(e, n, r, i).reduce((e, t) => vt(e, gt(t, o, a)), /* @__PURE__ */ new Map());
385
+ return gt(e, n, r, i).reduce((e, t) => yt(e, _t(t, o, a)), /* @__PURE__ */ new Map());
386
386
  }
387
- function ht(e, t, n, r) {
388
- let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(Ge).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
387
+ function gt(e, t, n, r) {
388
+ let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(Ke).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
389
389
  ...i,
390
390
  ...a,
391
391
  ...o
392
392
  ])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
393
393
  return s.length > 0 ? s : c;
394
394
  }
395
- function gt(e, t, n) {
396
- return _t([{
395
+ function _t(e, t, n) {
396
+ return vt([{
397
397
  distance: 0,
398
398
  nodeId: e
399
399
  }], t, n);
400
400
  }
401
- function _t(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
401
+ function vt(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
402
402
  let [a, ...o] = e;
403
403
  if (!a) return i;
404
- if (r.has(a.nodeId)) return _t(o, t, n, r, i);
404
+ if (r.has(a.nodeId)) return vt(o, t, n, r, i);
405
405
  let s = new Set(r).add(a.nodeId), c = n.has(a.nodeId) ? new Map(i).set(a.nodeId, Math.min(i.get(a.nodeId) ?? a.distance, a.distance)) : i;
406
- return _t([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
406
+ return vt([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
407
407
  distance: a.distance + 1,
408
408
  nodeId: e
409
409
  }))], t, n, s, c);
410
410
  }
411
- function vt(e, t) {
411
+ function yt(e, t) {
412
412
  return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
413
413
  }
414
- function yt(e) {
414
+ function $(e) {
415
415
  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}`;
416
416
  }
417
- function $(e, t, n, r, i, a, o, s, c) {
418
- let l = e.filter(at).map((e) => {
419
- let t = ct(e), n = e.nodeId ? J(e.nodeId, r) : null;
417
+ function bt(e, t, n, r, i, a, o, s, c) {
418
+ let l = e.filter(ot).map((e) => {
419
+ let t = lt(e), n = e.nodeId ? J(e.nodeId, r) : null;
420
420
  return {
421
421
  descriptionParts: [
422
422
  X(n ? `節點:${n}` : "節點:全流程"),
423
- rt("操作者", e.actorMemberId, a, "系統"),
424
- X(`時間:${ut(e.createdAt)}`),
425
- ...ft(e, t, r, o, s, c, a)
423
+ it("操作者", e.actorMemberId, a, "系統"),
424
+ X(`時間:${dt(e.createdAt)}`),
425
+ ...pt(e, t, r, o, s, c, a)
426
426
  ].filter(Z),
427
- error: lt(e, t),
427
+ error: ut(e, t),
428
428
  id: e.id,
429
- title: st(e.eventType, t)
429
+ title: ct(e.eventType, t)
430
430
  };
431
- }), u = t.filter(Ge).map((e) => ({
431
+ }), u = t.filter(Ke).map((e) => ({
432
432
  descriptionParts: [
433
433
  X(`節點:${J(e.nodeId, r)}`),
434
- rt("處理者", e.assigneeMemberId, a, "未指定"),
435
- X(`建立時間:${ut(e.createdAt)}`)
434
+ it("處理者", e.assigneeMemberId, a, "未指定"),
435
+ X(`建立時間:${dt(e.createdAt)}`)
436
436
  ].filter(Z),
437
437
  error: !1,
438
438
  id: `pending-task-${e.id}`,
439
439
  title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
440
- })), d = new Set([...e.filter(at).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(U)), f = r ? Q(r, t, n, i, d).map((e) => ({
440
+ })), d = new Set([...e.filter(ot).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(U)), f = r ? Q(r, t, n, i, d).map((e) => ({
441
441
  descriptionParts: [X(`${q(e.type)} · 尚未抵達`)].filter(Z),
442
442
  error: !1,
443
443
  forcePending: !0,
444
444
  id: `future-node-${e.id}`,
445
- title: yt(e)
445
+ title: $(e)
446
446
  })) : [];
447
447
  return [
448
448
  ...l,
@@ -450,18 +450,18 @@ function $(e, t, n, r, i, a, o, s, c) {
450
450
  ...f
451
451
  ];
452
452
  }
453
- function bt(e, t, n, r) {
453
+ function xt(e, t, n, r) {
454
454
  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");
455
455
  return a ? {
456
- secondaryLabel: `處理者 ${Xe(a)}`,
456
+ secondaryLabel: `處理者 ${Ze(a)}`,
457
457
  statusLabel: "待處理",
458
458
  tone: "current"
459
459
  } : o ? {
460
- secondaryLabel: `已取消 ${Xe(o)}`,
460
+ secondaryLabel: `已取消 ${Ze(o)}`,
461
461
  statusLabel: "已取消",
462
462
  tone: "cancelled"
463
463
  } : s ? {
464
- secondaryLabel: `已完成 ${Xe(s)}`,
464
+ secondaryLabel: `已完成 ${Ze(s)}`,
465
465
  statusLabel: "已完成",
466
466
  tone: "completed"
467
467
  } : l ? {
@@ -488,14 +488,14 @@ function bt(e, t, n, r) {
488
488
  }
489
489
  //#endregion
490
490
  //#region src/views/instances/detail/sections/container-helpers.ts
491
- async function xt({ activityLogs: e, adhocDirectives: t = [], tasks: n }) {
491
+ async function St({ activityLogs: e, adhocDirectives: t = [], tasks: n }) {
492
492
  let r = [...new Set([
493
493
  ...e.map((e) => e.actorMemberId),
494
494
  ...n.map((e) => e.assigneeMemberId),
495
495
  ...n.map((e) => e.originalAssigneeMemberId),
496
496
  ...n.flatMap((e) => e.candidateMemberIds),
497
497
  ...n.flatMap((e) => z(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
498
- ...t.flatMap((e) => [e.createdByMemberId, ...St(e.targetValueJson)])
498
+ ...t.flatMap((e) => [e.createdByMemberId, ...Ct(e.targetValueJson)])
499
499
  ].filter(U))];
500
500
  try {
501
501
  return await _e(r);
@@ -503,17 +503,17 @@ async function xt({ activityLogs: e, adhocDirectives: t = [], tasks: n }) {
503
503
  return [];
504
504
  }
505
505
  }
506
- function St(e) {
506
+ function Ct(e) {
507
507
  try {
508
508
  return (JSON.parse(e).memberIds ?? []).filter((e) => typeof e == "string");
509
509
  } catch {
510
510
  return [];
511
511
  }
512
512
  }
513
- async function Ct(e) {
513
+ async function wt(e) {
514
514
  return (await Promise.all(e.map((e) => ue(e.id)))).flat();
515
515
  }
516
- function wt(e) {
516
+ function Tt(e) {
517
517
  return e.reduce((e, t) => {
518
518
  let n = e.get(t.taskId), r = !n || new Date(t.decidedAt).getTime() > new Date(n.decidedAt).getTime() ? t : n;
519
519
  return new Map(e).set(t.taskId, r);
@@ -521,17 +521,17 @@ function wt(e) {
521
521
  }
522
522
  //#endregion
523
523
  //#region src/views/instances/detail/sections/InstanceFormSection.tsx
524
- var Tt = {
524
+ var Et = {
525
525
  display: "grid",
526
526
  gap: 16
527
- }, Et = {
527
+ }, Dt = {
528
528
  display: "flex",
529
529
  flexWrap: "wrap",
530
530
  gap: 8
531
531
  };
532
- function Dt({ canResubmitInstance: e, deciding: t, error: n, instance: r, loading: a, onDataSourceStateChange: o, onResubmitFormChange: s, onResubmitInstance: c, onUploadAttachment: l, resubmitFormData: u, resubmitFormErrors: d }) {
532
+ function Ot({ canResubmitInstance: e, deciding: t, error: n, instance: r, loading: a, onDataSourceStateChange: o, onResubmitFormChange: s, onResubmitInstance: c, onUploadAttachment: l, resubmitFormData: u, resubmitFormErrors: d }) {
533
533
  return /* @__PURE__ */ w("div", {
534
- style: Tt,
534
+ style: Et,
535
535
  children: [
536
536
  n ? /* @__PURE__ */ C(x, {
537
537
  color: "text-error",
@@ -561,10 +561,10 @@ function Dt({ canResubmitInstance: e, deciding: t, error: n, instance: r, loadin
561
561
  uiSchema: r.formDefinitionSnapshot.uiSchema,
562
562
  value: e ? u : r.formData
563
563
  }), e ? /* @__PURE__ */ C("div", {
564
- style: Et,
564
+ style: Dt,
565
565
  children: /* @__PURE__ */ C(m, {
566
566
  disabled: t,
567
- icon: Oe,
567
+ icon: De,
568
568
  iconType: "leading",
569
569
  onClick: c,
570
570
  variant: "base-primary",
@@ -580,11 +580,11 @@ function Dt({ canResubmitInstance: e, deciding: t, error: n, instance: r, loadin
580
580
  }
581
581
  //#endregion
582
582
  //#region src/views/instances/detail/sections/InstanceAttachmentsSection.tsx
583
- var Ot = {
583
+ var kt = {
584
584
  display: "grid",
585
585
  gap: 16
586
586
  };
587
- function kt({ attachments: e, onDownload: n, onPreview: r }) {
587
+ function At({ attachments: e, onDownload: n, onPreview: r }) {
588
588
  let i = u(() => e.map((e) => ({
589
589
  attachment: e,
590
590
  createdAt: e.createdAt,
@@ -592,7 +592,7 @@ function kt({ attachments: e, onDownload: n, onPreview: r }) {
592
592
  id: e.id,
593
593
  key: e.id,
594
594
  mimeType: e.mimeType,
595
- sizeLabel: Ke(Number(e.sizeBytes))
595
+ sizeLabel: qe(Number(e.sizeBytes))
596
596
  })), [e]), a = u(() => [
597
597
  {
598
598
  dataIndex: "filename",
@@ -624,14 +624,14 @@ function kt({ attachments: e, onDownload: n, onPreview: r }) {
624
624
  }
625
625
  ], []), o = u(() => ({
626
626
  render: (e) => [...e.mimeType === "application/pdf" ? [{
627
- icon: D,
627
+ icon: O,
628
628
  iconType: "leading",
629
629
  name: "預覽",
630
630
  onClick: () => {
631
631
  r(e.attachment);
632
632
  }
633
633
  }] : [], {
634
- icon: Te,
634
+ icon: D,
635
635
  iconType: "leading",
636
636
  name: "下載",
637
637
  onClick: () => {
@@ -642,7 +642,7 @@ function kt({ attachments: e, onDownload: n, onPreview: r }) {
642
642
  width: 160
643
643
  }), [n, r]);
644
644
  return /* @__PURE__ */ w("div", {
645
- style: Ot,
645
+ style: kt,
646
646
  children: [/* @__PURE__ */ C(x, {
647
647
  component: "h2",
648
648
  variant: "h3",
@@ -661,47 +661,47 @@ function kt({ attachments: e, onDownload: n, onPreview: r }) {
661
661
  }
662
662
  //#endregion
663
663
  //#region src/views/instances/detail/sections/InstanceTasksSection.tsx
664
- var At = {
664
+ var jt = {
665
665
  display: "grid",
666
666
  gap: 12,
667
667
  width: "100%"
668
- }, jt = {
668
+ }, Mt = {
669
669
  minWidth: "100%",
670
670
  width: "100%"
671
- }, Mt = {
671
+ }, Nt = {
672
672
  display: "grid",
673
673
  gap: 12,
674
674
  width: "100%"
675
- }, Nt = { marginTop: 12 }, Pt = { marginTop: 24 };
676
- function Ft(e) {
675
+ }, Pt = { marginTop: 12 }, Ft = { marginTop: 24 };
676
+ function It(e) {
677
677
  e && (e.style.width = "100%");
678
678
  }
679
- var It = {
679
+ var Lt = {
680
680
  COMPLETION_NOTIFY: "結案通知",
681
681
  COUNTERSIGN: "臨時會簽",
682
682
  PRE_APPROVAL: "臨時加簽",
683
683
  STAGE_NOTIFY: "階段完成通知"
684
- }, Lt = {
684
+ }, Rt = {
685
685
  COMPLETION_NOTIFY: "本張單到達結案狀態(核准 / 拒絕 / 取消)後,通知指定對象。",
686
686
  COUNTERSIGN: "指定對象會併入下一層簽核,下一層需所有人都完成才會繼續。",
687
687
  PRE_APPROVAL: "指定對象需先完成加簽,本階段才會往下一層繼續。",
688
688
  STAGE_NOTIFY: "本階段完成後(不論通過與否)通知指定對象。"
689
- }, Rt = [{
689
+ }, zt = [{
690
690
  id: "REJECT_INSTANCE",
691
691
  name: "加簽拒絕時整單駁回"
692
692
  }, {
693
693
  id: "RETURN_TO_ORIGIN",
694
694
  name: "加簽拒絕時退回給我重新處理"
695
- }], zt = [{
695
+ }], Bt = [{
696
696
  id: "MEMBER",
697
697
  name: "指定成員"
698
698
  }, {
699
699
  id: "WEBHOOK",
700
700
  name: "Webhook"
701
- }], Bt = o(function({ adhocDirectives: e, currentMemberId: r, instance: i, memberProfilesById: a, onChanged: o, tasks: s }, c) {
702
- let [d, te] = f(!1), [g, _] = f(null), [v, b] = f(""), [ie, ce] = f(!1), [le, ue] = f(""), [de, fe] = f(null), [pe, me] = f(!1), [_e, ve] = f(""), [be, xe] = f(!1), [Se, Ce] = f(null), [E, we] = f(""), [Te, D] = f(null), [Ee, De] = f(!1), [Oe, ke] = f([]), [Ae, je] = f(!1), [Me, Ne] = f(""), [Pe, Fe] = f(null), [Ie, Le] = f(!1), [Re, O] = f([]), [ze, Be] = f(!1), [k, Ve] = f("COUNTERSIGN"), [A, j] = f("REJECT_INSTANCE"), [M, N] = f(!1), [P, He] = f("MEMBER"), [F, Ue] = f(""), I = le.trim(), We = _e.trim(), L = E.trim(), R = u(() => s.find((e) => Ze(e, r) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [r, s]), z = u(() => R && i ? i.workflowSnapshot.nodes.find((e) => e.id === R.nodeId) ?? null : null, [R, i]), B = u(() => z && i ? Qe(i.workflowSnapshot, z) : [], [z, i]), V = z?.type === "userTask" && z.data.returnBehavior.allowReturn, H = z?.type === "userTask" && z.data.allowReject !== !1, U = z?.type === "userTask" && z.data.allowTransfer !== !1, W = z?.type === "userTask" && z.data.returnBehavior.requireComment === !0, Ge = z?.type === "userTask" && z.data.allowAddSigner, Ke = u(() => e.filter((e) => e.status === "PENDING"), [e]), qe = B.find((e) => e.id === Se) ?? B[0] ?? null, Je = u(() => s.map((e) => ({
701
+ }], Vt = o(function({ adhocDirectives: e, currentMemberId: r, instance: i, memberProfilesById: a, onChanged: o, tasks: s }, c) {
702
+ let [d, te] = f(!1), [g, _] = f(null), [v, b] = f(""), [ie, ce] = f(!1), [le, ue] = f(""), [de, fe] = f(null), [pe, me] = f(!1), [_e, ve] = f(""), [be, xe] = f(!1), [Se, Ce] = f(null), [E, we] = f(""), [D, O] = f(null), [Te, Ee] = f(!1), [De, Oe] = f([]), [ke, Ae] = f(!1), [je, Me] = f(""), [Ne, Pe] = f(null), [Fe, Ie] = f(!1), [Le, Re] = f([]), [k, ze] = f(!1), [A, Be] = f("COUNTERSIGN"), [Ve, j] = f("REJECT_INSTANCE"), [M, N] = f(!1), [P, He] = f("MEMBER"), [Ue, F] = f(""), We = le.trim(), I = _e.trim(), Ge = E.trim(), L = u(() => s.find((e) => Qe(e, r) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [r, s]), R = u(() => L && i ? i.workflowSnapshot.nodes.find((e) => e.id === L.nodeId) ?? null : null, [L, i]), z = u(() => R && i ? $e(i.workflowSnapshot, R) : [], [R, i]), B = R?.type === "userTask" && R.data.returnBehavior.allowReturn, V = R?.type === "userTask" && R.data.allowReject !== !1, H = R?.type === "userTask" && R.data.allowTransfer !== !1, U = R?.type === "userTask" && R.data.returnBehavior.requireComment === !0, W = R?.type === "userTask" && R.data.allowAddSigner, Ke = u(() => e.filter((e) => e.status === "PENDING"), [e]), qe = z.find((e) => e.id === Se) ?? z[0] ?? null, Je = u(() => s.map((e) => ({
703
703
  ...e,
704
- assigneeLabel: Xe(e, a),
704
+ assigneeLabel: Ze(e, a),
705
705
  key: e.id,
706
706
  nodeLabel: `${J(e.nodeId, i?.workflowSnapshot ?? null)}${e.isAdhoc ? e.adhocType === "COUNTERSIGN" ? "(臨時會簽)" : "(臨時加簽)" : ""}`,
707
707
  statusLabel: K(e.status)
@@ -742,13 +742,13 @@ var It = {
742
742
  title: "建立時間",
743
743
  width: 220
744
744
  }
745
- ], []), q = u(() => Ke.map((e) => ({
745
+ ], []), Xe = u(() => Ke.map((e) => ({
746
746
  ...e,
747
747
  createdByLabel: Y(e.createdByMemberId, a),
748
748
  key: e.id,
749
- targetLabel: Vt(e, a),
750
- typeLabel: It[e.type]
751
- })), [a, Ke]), X = u(() => [
749
+ targetLabel: Ht(e, a),
750
+ typeLabel: Lt[e.type]
751
+ })), [a, Ke]), q = u(() => [
752
752
  {
753
753
  dataIndex: "typeLabel",
754
754
  key: "typeLabel",
@@ -798,8 +798,8 @@ var It = {
798
798
  width: 100
799
799
  }
800
800
  ], [M, r]);
801
- async function nt({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: i = null }) {
802
- if (!r || !R || e === "REJECTED" && !H || e === "TRANSFERRED" && !U) return !1;
801
+ async function X({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: i = null }) {
802
+ if (!r || !L || e === "REJECTED" && !V || e === "TRANSFERRED" && !H) return !1;
803
803
  te(!0), _(null);
804
804
  try {
805
805
  await se({
@@ -807,9 +807,9 @@ var It = {
807
807
  comment: t,
808
808
  decidedByMemberId: r,
809
809
  returnToNodeId: n,
810
- taskId: R.id,
810
+ taskId: L.id,
811
811
  transferToMemberId: i
812
- }), me(!1), xe(!1), je(!1), ue(""), ve(""), we(""), D(null), Ce(null), fe(null);
812
+ }), me(!1), xe(!1), Ae(!1), ue(""), ve(""), we(""), O(null), Ce(null), fe(null);
813
813
  } catch (e) {
814
814
  return _(G(e)), te(!1), !1;
815
815
  }
@@ -823,99 +823,99 @@ var It = {
823
823
  return !0;
824
824
  }
825
825
  function rt() {
826
- !r || !R || (_(null), b(""), ce(!0));
826
+ !r || !L || (_(null), b(""), ce(!0));
827
827
  }
828
- function Z() {
828
+ function it() {
829
829
  d || (ce(!1), b(""));
830
830
  }
831
- async function it() {
832
- d || await nt({
831
+ async function Z() {
832
+ d || await X({
833
833
  action: "APPROVED",
834
834
  comment: v.trim() || null
835
835
  }) && (ce(!1), b(""));
836
836
  }
837
837
  function at() {
838
- H && (ue(""), fe(null), me(!0));
838
+ V && (ue(""), fe(null), me(!0));
839
839
  }
840
840
  function ot() {
841
841
  d || (me(!1), ue(""), fe(null));
842
842
  }
843
843
  function st() {
844
- ve(""), Ce(B[0]?.id ?? null), xe(!0);
844
+ ve(""), Ce(z[0]?.id ?? null), xe(!0);
845
845
  }
846
846
  function ct() {
847
847
  d || (xe(!1), ve(""), Ce(null));
848
848
  }
849
849
  function lt() {
850
- U && (we(""), D(null), je(!0), dt(""));
850
+ H && (we(""), O(null), Ae(!0), dt(""));
851
851
  }
852
852
  function ut() {
853
- d || (je(!1), we(""), D(null));
853
+ d || (Ae(!1), we(""), O(null));
854
854
  }
855
855
  async function dt(e) {
856
- De(!0);
856
+ Ee(!0);
857
857
  try {
858
- ke((await ye(e)).filter((e) => e.memberId !== r).map($e));
858
+ Oe((await ye(e)).filter((e) => e.memberId !== r).map(et));
859
859
  } catch (e) {
860
860
  _(G(e));
861
861
  } finally {
862
- De(!1);
862
+ Ee(!1);
863
863
  }
864
864
  }
865
865
  async function ft() {
866
- if (H) {
867
- if (!I) {
866
+ if (V) {
867
+ if (!We) {
868
868
  fe("請輸入拒絕原因");
869
869
  return;
870
870
  }
871
- await nt({
871
+ await X({
872
872
  action: "REJECTED",
873
- comment: I
873
+ comment: We
874
874
  });
875
875
  }
876
876
  }
877
877
  async function pt() {
878
- if (U) {
879
- if (!Te) {
878
+ if (H) {
879
+ if (!D) {
880
880
  _("請選擇轉派對象");
881
881
  return;
882
882
  }
883
- await nt({
883
+ await X({
884
884
  action: "TRANSFERRED",
885
- comment: L || null,
886
- transferToMemberId: Te.id
885
+ comment: Ge || null,
886
+ transferToMemberId: D.id
887
887
  });
888
888
  }
889
889
  }
890
- async function Q() {
891
- await nt({
890
+ async function mt() {
891
+ await X({
892
892
  action: "RETURNED",
893
- comment: We || null,
893
+ comment: I || null,
894
894
  returnToNodeId: qe?.id ?? null
895
895
  });
896
896
  }
897
- function mt() {
898
- Ne(""), Fe(null), j("REJECT_INSTANCE"), He("MEMBER"), Ue("");
897
+ function Q() {
898
+ Me(""), Pe(null), j("REJECT_INSTANCE"), He("MEMBER"), F("");
899
899
  }
900
900
  function ht(e) {
901
- Ve(e), mt(), Be(!0), _t("");
901
+ Be(e), Q(), ze(!0), _t("");
902
902
  }
903
903
  function gt() {
904
- M || (Be(!1), mt());
904
+ M || (ze(!1), Q());
905
905
  }
906
906
  async function _t(e) {
907
- Le(!0);
907
+ Ie(!0);
908
908
  try {
909
- O((await ye(e)).map($e));
909
+ Re((await ye(e)).map(et));
910
910
  } catch (e) {
911
911
  _(G(e));
912
912
  } finally {
913
- Le(!1);
913
+ Ie(!1);
914
914
  }
915
915
  }
916
916
  async function vt() {
917
- if (!R) return;
918
- let e = (k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY") && P === "WEBHOOK", t = F.trim(), n = Pe;
917
+ if (!L) return;
918
+ let e = (A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY") && P === "WEBHOOK", t = Ue.trim(), n = Ne;
919
919
  if (e && !t) {
920
920
  _("請輸入 Webhook URL");
921
921
  return;
@@ -930,25 +930,25 @@ var It = {
930
930
  } : {
931
931
  kind: "MEMBER",
932
932
  memberIds: [n.id]
933
- }, i = Me.trim() || null;
933
+ }, i = je.trim() || null;
934
934
  N(!0), _(null);
935
935
  try {
936
- k === "COUNTERSIGN" ? await he({
936
+ A === "COUNTERSIGN" ? await he({
937
937
  comment: i,
938
938
  target: r,
939
- taskId: R.id
940
- }) : k === "PRE_APPROVAL" ? await ge({
939
+ taskId: L.id
940
+ }) : A === "PRE_APPROVAL" ? await ge({
941
941
  comment: i,
942
- onReject: A,
942
+ onReject: Ve,
943
943
  target: r,
944
- taskId: R.id
945
- }) : k === "STAGE_NOTIFY" ? await oe({
944
+ taskId: L.id
945
+ }) : A === "STAGE_NOTIFY" ? await oe({
946
946
  target: r,
947
- taskId: R.id
947
+ taskId: L.id
948
948
  }) : await ae({
949
949
  target: r,
950
- taskId: R.id
951
- }), Be(!1), mt(), await o();
950
+ taskId: L.id
951
+ }), ze(!1), Q(), await o();
952
952
  } catch (e) {
953
953
  _(G(e));
954
954
  } finally {
@@ -966,27 +966,27 @@ var It = {
966
966
  }
967
967
  }
968
968
  l(c, () => ({
969
- canAddSignerCurrentTask: Ge,
970
- canRejectCurrentTask: H,
971
- canReturnCurrentTask: V,
972
- canTransferCurrentTask: U,
969
+ canAddSignerCurrentTask: W,
970
+ canRejectCurrentTask: V,
971
+ canReturnCurrentTask: B,
972
+ canTransferCurrentTask: H,
973
973
  deciding: d,
974
974
  handleApprove: rt,
975
- hasCurrentTask: R !== null,
975
+ hasCurrentTask: L !== null,
976
976
  openAdhocModal: ht,
977
977
  openRejectModal: at,
978
978
  openReturnModal: st,
979
979
  openTransferModal: lt
980
980
  }), [
981
- Ge,
982
- H,
981
+ W,
983
982
  V,
984
- U,
983
+ B,
984
+ H,
985
985
  r,
986
- R,
986
+ L,
987
987
  d
988
988
  ]);
989
- let $ = k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY", bt = $ && P === "WEBHOOK" ? !F.trim() : !Pe, xt = Rt.find((e) => e.id === A) ?? Rt[0], St = zt.find((e) => e.id === P) ?? zt[0];
989
+ let $ = A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY", bt = $ && P === "WEBHOOK" ? !Ue.trim() : !Ne, xt = zt.find((e) => e.id === Ve) ?? zt[0], St = Bt.find((e) => e.id === P) ?? Bt[0];
990
990
  return /* @__PURE__ */ w(S, { children: [
991
991
  /* @__PURE__ */ C(x, {
992
992
  component: "h2",
@@ -999,7 +999,7 @@ var It = {
999
999
  children: g
1000
1000
  }) : null,
1001
1001
  /* @__PURE__ */ C("div", {
1002
- style: Nt,
1002
+ style: Pt,
1003
1003
  children: /* @__PURE__ */ C(re, {
1004
1004
  columns: Ye,
1005
1005
  dataSource: Je,
@@ -1008,14 +1008,14 @@ var It = {
1008
1008
  }),
1009
1009
  Ke.length > 0 ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(x, {
1010
1010
  component: "h3",
1011
- style: Pt,
1011
+ style: Ft,
1012
1012
  variant: "h3",
1013
1013
  children: "待生效的臨時設定"
1014
1014
  }), /* @__PURE__ */ C("div", {
1015
- style: Nt,
1015
+ style: Pt,
1016
1016
  children: /* @__PURE__ */ C(re, {
1017
- columns: X,
1018
- dataSource: q,
1017
+ columns: q,
1018
+ dataSource: Xe,
1019
1019
  fullWidth: !0
1020
1020
  })
1021
1021
  })] }) : null,
@@ -1024,9 +1024,9 @@ var It = {
1024
1024
  confirmText: "送出同意",
1025
1025
  loading: d,
1026
1026
  modalType: "standard",
1027
- onCancel: Z,
1028
- onClose: Z,
1029
- onConfirm: () => void it(),
1027
+ onCancel: it,
1028
+ onClose: it,
1029
+ onConfirm: () => void Z(),
1030
1030
  open: ie,
1031
1031
  showModalFooter: !0,
1032
1032
  showModalHeader: !0,
@@ -1039,7 +1039,7 @@ var It = {
1039
1039
  variant: "body",
1040
1040
  children: g
1041
1041
  }) : null, /* @__PURE__ */ C("div", {
1042
- style: At,
1042
+ style: jt,
1043
1043
  children: /* @__PURE__ */ C(n, {
1044
1044
  label: "簽核意見",
1045
1045
  name: "approveComment",
@@ -1047,10 +1047,10 @@ var It = {
1047
1047
  autoFocus: !0,
1048
1048
  onChange: (e) => b(e.target.value),
1049
1049
  placeholder: "選填,例如補充核准的條件或提醒事項",
1050
- ref: Ft,
1050
+ ref: It,
1051
1051
  resize: "vertical",
1052
1052
  rows: 4,
1053
- style: jt,
1053
+ style: Mt,
1054
1054
  value: v
1055
1055
  })
1056
1056
  })
@@ -1059,7 +1059,7 @@ var It = {
1059
1059
  /* @__PURE__ */ C(h, {
1060
1060
  cancelText: "取消",
1061
1061
  confirmButtonProps: {
1062
- disabled: !I,
1062
+ disabled: !We,
1063
1063
  variant: "destructive-primary"
1064
1064
  },
1065
1065
  confirmText: "送出拒絕",
@@ -1076,7 +1076,7 @@ var It = {
1076
1076
  supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
1077
1077
  title: "拒絕原因",
1078
1078
  children: /* @__PURE__ */ w("div", {
1079
- style: At,
1079
+ style: jt,
1080
1080
  children: [/* @__PURE__ */ C(n, {
1081
1081
  label: "拒絕原因",
1082
1082
  name: "rejectReason",
@@ -1087,10 +1087,10 @@ var It = {
1087
1087
  ue(e.target.value), fe(null);
1088
1088
  },
1089
1089
  placeholder: "請說明拒絕原因",
1090
- ref: Ft,
1090
+ ref: It,
1091
1091
  resize: "vertical",
1092
1092
  rows: 4,
1093
- style: jt,
1093
+ style: Mt,
1094
1094
  type: de ? "error" : "default",
1095
1095
  value: le
1096
1096
  })
@@ -1103,21 +1103,21 @@ var It = {
1103
1103
  }),
1104
1104
  /* @__PURE__ */ C(h, {
1105
1105
  cancelText: "取消",
1106
- confirmButtonProps: { disabled: !Te },
1106
+ confirmButtonProps: { disabled: !D },
1107
1107
  confirmText: "送出轉派",
1108
1108
  loading: d,
1109
1109
  modalType: "standard",
1110
1110
  onCancel: ut,
1111
1111
  onClose: ut,
1112
1112
  onConfirm: () => void pt(),
1113
- open: Ae,
1113
+ open: ke,
1114
1114
  showModalFooter: !0,
1115
1115
  showModalHeader: !0,
1116
1116
  size: "regular",
1117
1117
  supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
1118
1118
  title: "轉派簽核",
1119
1119
  children: /* @__PURE__ */ w("div", {
1120
- style: Mt,
1120
+ style: Nt,
1121
1121
  children: [/* @__PURE__ */ C(n, {
1122
1122
  label: "轉派對象",
1123
1123
  name: "transferToMemberId",
@@ -1132,19 +1132,19 @@ var It = {
1132
1132
  name: "transfer-member-search",
1133
1133
  spellCheck: !1
1134
1134
  },
1135
- loading: Ee,
1135
+ loading: Te,
1136
1136
  loadingText: "搜尋成員中...",
1137
1137
  mode: "single",
1138
- onChange: (e) => D(et(e)),
1138
+ onChange: (e) => O(tt(e)),
1139
1139
  onSearch: dt,
1140
- onSearchTextChange: (e) => D(tt(e, Oe)),
1140
+ onSearchTextChange: (e) => O(nt(e, De)),
1141
1141
  onVisibilityChange: (e) => {
1142
1142
  e && dt("");
1143
1143
  },
1144
- options: [...Oe],
1144
+ options: [...De],
1145
1145
  placeholder: "搜尋姓名或信箱",
1146
1146
  searchDebounceTime: 300,
1147
- value: Te
1147
+ value: D
1148
1148
  })
1149
1149
  }), /* @__PURE__ */ C(n, {
1150
1150
  label: "轉派說明",
@@ -1152,10 +1152,10 @@ var It = {
1152
1152
  children: /* @__PURE__ */ C(y, {
1153
1153
  onChange: (e) => we(e.target.value),
1154
1154
  placeholder: "可補充轉派原因",
1155
- ref: Ft,
1155
+ ref: It,
1156
1156
  resize: "vertical",
1157
1157
  rows: 4,
1158
- style: jt,
1158
+ style: Mt,
1159
1159
  value: E
1160
1160
  })
1161
1161
  })]
@@ -1163,13 +1163,13 @@ var It = {
1163
1163
  }),
1164
1164
  /* @__PURE__ */ C(h, {
1165
1165
  cancelText: "取消",
1166
- confirmButtonProps: { disabled: !qe || W && !We },
1166
+ confirmButtonProps: { disabled: !qe || U && !I },
1167
1167
  confirmText: "送出退回",
1168
1168
  loading: d,
1169
1169
  modalType: "standard",
1170
1170
  onCancel: ct,
1171
1171
  onClose: ct,
1172
- onConfirm: () => void Q(),
1172
+ onConfirm: () => void mt(),
1173
1173
  open: be,
1174
1174
  showModalFooter: !0,
1175
1175
  showModalHeader: !0,
@@ -1177,7 +1177,7 @@ var It = {
1177
1177
  supportingText: "退回後,流程會回到指定節點並等待重新處理。",
1178
1178
  title: "退回簽核",
1179
1179
  children: /* @__PURE__ */ w("div", {
1180
- style: Mt,
1180
+ style: Nt,
1181
1181
  children: [/* @__PURE__ */ C(n, {
1182
1182
  label: "退回節點",
1183
1183
  name: "returnTargetNodeId",
@@ -1186,22 +1186,22 @@ var It = {
1186
1186
  clearable: !1,
1187
1187
  fullWidth: !0,
1188
1188
  onChange: (e) => Ce(e?.id ?? null),
1189
- options: [...B],
1189
+ options: [...z],
1190
1190
  placeholder: "選擇退回節點",
1191
1191
  value: qe
1192
1192
  })
1193
1193
  }), /* @__PURE__ */ C(n, {
1194
- hintText: W ? "此關卡設定退回時必須填寫意見。" : void 0,
1194
+ hintText: U ? "此關卡設定退回時必須填寫意見。" : void 0,
1195
1195
  label: "退回說明",
1196
1196
  name: "returnComment",
1197
- required: W,
1197
+ required: U,
1198
1198
  children: /* @__PURE__ */ C(y, {
1199
1199
  onChange: (e) => ve(e.target.value),
1200
- placeholder: W ? "請說明退回原因" : "可補充需要修改的內容",
1201
- ref: Ft,
1200
+ placeholder: U ? "請說明退回原因" : "可補充需要修改的內容",
1201
+ ref: It,
1202
1202
  resize: "vertical",
1203
1203
  rows: 4,
1204
- style: jt,
1204
+ style: Mt,
1205
1205
  value: _e
1206
1206
  })
1207
1207
  })]
@@ -1216,14 +1216,14 @@ var It = {
1216
1216
  onCancel: gt,
1217
1217
  onClose: gt,
1218
1218
  onConfirm: () => void vt(),
1219
- open: ze,
1219
+ open: k,
1220
1220
  showModalFooter: !0,
1221
1221
  showModalHeader: !0,
1222
1222
  size: "regular",
1223
- supportingText: Lt[k],
1224
- title: It[k],
1223
+ supportingText: Rt[A],
1224
+ title: Lt[A],
1225
1225
  children: /* @__PURE__ */ w("div", {
1226
- style: Mt,
1226
+ style: Nt,
1227
1227
  children: [
1228
1228
  $ ? /* @__PURE__ */ C(n, {
1229
1229
  label: "通知時機",
@@ -1232,17 +1232,17 @@ var It = {
1232
1232
  children: /* @__PURE__ */ C(ne, {
1233
1233
  clearable: !1,
1234
1234
  fullWidth: !0,
1235
- onChange: (e) => Ve(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1235
+ onChange: (e) => Be(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1236
1236
  options: [{
1237
1237
  id: "STAGE_NOTIFY",
1238
- name: It.STAGE_NOTIFY
1238
+ name: Lt.STAGE_NOTIFY
1239
1239
  }, {
1240
1240
  id: "COMPLETION_NOTIFY",
1241
- name: It.COMPLETION_NOTIFY
1241
+ name: Lt.COMPLETION_NOTIFY
1242
1242
  }],
1243
1243
  value: {
1244
- id: k,
1245
- name: It[k]
1244
+ id: A,
1245
+ name: Lt[A]
1246
1246
  }
1247
1247
  })
1248
1248
  }) : null,
@@ -1254,7 +1254,7 @@ var It = {
1254
1254
  clearable: !1,
1255
1255
  fullWidth: !0,
1256
1256
  onChange: (e) => He(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1257
- options: [...zt],
1257
+ options: [...Bt],
1258
1258
  value: St
1259
1259
  })
1260
1260
  }) : null,
@@ -1264,9 +1264,9 @@ var It = {
1264
1264
  required: !0,
1265
1265
  children: /* @__PURE__ */ C(ee, {
1266
1266
  fullWidth: !0,
1267
- onChange: (e) => Ue(e.target.value),
1267
+ onChange: (e) => F(e.target.value),
1268
1268
  placeholder: "https://example.com/webhook",
1269
- value: F
1269
+ value: Ue
1270
1270
  })
1271
1271
  }) : /* @__PURE__ */ C(n, {
1272
1272
  label: $ ? "通知對象" : "簽核對象",
@@ -1282,22 +1282,22 @@ var It = {
1282
1282
  name: "adhoc-member-search",
1283
1283
  spellCheck: !1
1284
1284
  },
1285
- loading: Ie,
1285
+ loading: Fe,
1286
1286
  loadingText: "搜尋成員中...",
1287
1287
  mode: "single",
1288
- onChange: (e) => Fe(et(e)),
1288
+ onChange: (e) => Pe(tt(e)),
1289
1289
  onSearch: _t,
1290
- onSearchTextChange: (e) => Fe(tt(e, Re)),
1290
+ onSearchTextChange: (e) => Pe(nt(e, Le)),
1291
1291
  onVisibilityChange: (e) => {
1292
1292
  e && _t("");
1293
1293
  },
1294
- options: [...Re],
1294
+ options: [...Le],
1295
1295
  placeholder: "搜尋姓名或信箱",
1296
1296
  searchDebounceTime: 300,
1297
- value: Pe
1297
+ value: Ne
1298
1298
  })
1299
1299
  }),
1300
- k === "PRE_APPROVAL" ? /* @__PURE__ */ C(n, {
1300
+ A === "PRE_APPROVAL" ? /* @__PURE__ */ C(n, {
1301
1301
  label: "拒簽處理方式",
1302
1302
  name: "adhocOnReject",
1303
1303
  required: !0,
@@ -1305,7 +1305,7 @@ var It = {
1305
1305
  clearable: !1,
1306
1306
  fullWidth: !0,
1307
1307
  onChange: (e) => j(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1308
- options: [...Rt],
1308
+ options: [...zt],
1309
1309
  value: xt
1310
1310
  })
1311
1311
  }) : null,
@@ -1313,13 +1313,13 @@ var It = {
1313
1313
  label: "說明",
1314
1314
  name: "adhocComment",
1315
1315
  children: /* @__PURE__ */ C(y, {
1316
- onChange: (e) => Ne(e.target.value),
1316
+ onChange: (e) => Me(e.target.value),
1317
1317
  placeholder: "可補充原因",
1318
- ref: Ft,
1318
+ ref: It,
1319
1319
  resize: "vertical",
1320
1320
  rows: 3,
1321
- style: jt,
1322
- value: Me
1321
+ style: Mt,
1322
+ value: je
1323
1323
  })
1324
1324
  })
1325
1325
  ]
@@ -1327,7 +1327,7 @@ var It = {
1327
1327
  })
1328
1328
  ] });
1329
1329
  });
1330
- function Vt(e, t) {
1330
+ function Ht(e, t) {
1331
1331
  try {
1332
1332
  let n = JSON.parse(e.targetValueJson);
1333
1333
  if (n.memberIds?.length) return n.memberIds.map((e) => Y(e, t)).join("、");
@@ -1339,14 +1339,14 @@ function Vt(e, t) {
1339
1339
  }
1340
1340
  //#endregion
1341
1341
  //#region src/views/instances/detail/sections/InstanceSignaturesSection.tsx
1342
- var Ht = {
1342
+ var Ut = {
1343
1343
  display: "grid",
1344
1344
  gap: 16
1345
1345
  };
1346
- function Ut({ signatureVerification: e, signatures: n }) {
1346
+ function Wt({ signatureVerification: e, signatures: n }) {
1347
1347
  let r = u(() => n.map((e) => ({
1348
1348
  algorithm: e.algorithm,
1349
- hashLabel: qe(e.signedPayloadHash),
1349
+ hashLabel: Je(e.signedPayloadHash),
1350
1350
  key: e.id,
1351
1351
  keyVersion: e.keyVersion,
1352
1352
  signedAtLabel: t(e.signedAt),
@@ -1384,7 +1384,7 @@ function Ut({ signatureVerification: e, signatures: n }) {
1384
1384
  }
1385
1385
  ], []);
1386
1386
  return /* @__PURE__ */ w("div", {
1387
- style: Ht,
1387
+ style: Ut,
1388
1388
  children: [
1389
1389
  /* @__PURE__ */ C(x, {
1390
1390
  component: "h2",
@@ -1406,43 +1406,43 @@ function Ut({ signatureVerification: e, signatures: n }) {
1406
1406
  }
1407
1407
  //#endregion
1408
1408
  //#region src/views/instances/detail/sections/InstanceHistorySection.tsx
1409
- var Wt = {
1409
+ var Gt = {
1410
1410
  display: "grid",
1411
1411
  gap: 16
1412
- }, Gt = {
1412
+ }, Kt = {
1413
1413
  cursor: "help",
1414
1414
  textDecoration: "underline dotted",
1415
1415
  textUnderlineOffset: 3
1416
- }, Kt = { color: "var(--mzn-color-text-error)" };
1417
- function qt(...e) {
1416
+ }, qt = { color: "var(--mzn-color-text-error)" };
1417
+ function Jt(...e) {
1418
1418
  return e.filter((e) => U(e ?? null)).join(" ");
1419
1419
  }
1420
- var Jt = o(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: o, status: s = "pending", title: c, type: l = "number", ...u }, d) {
1420
+ var Yt = o(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: o, status: s = "pending", title: c, type: l = "number", ...u }, d) {
1421
1421
  let f = r ? "pending" : s;
1422
1422
  return /* @__PURE__ */ w("div", {
1423
1423
  ...u,
1424
- className: qt(A.host, l === "dot" ? A.dot : null, n && f !== "processing" ? A.error : null, o === "horizontal" ? A.horizontal : null, l === "number" ? A.number : null, f === "pending" ? A.pending : null, f === "processing" ? A.processing : null, n && f === "processing" ? A.processingError : null, !n && f === "succeeded" ? A.succeeded : null, o === "vertical" ? A.vertical : null, e),
1424
+ className: Jt(j.host, l === "dot" ? j.dot : null, n && f !== "processing" ? j.error : null, o === "horizontal" ? j.horizontal : null, l === "number" ? j.number : null, f === "pending" ? j.pending : null, f === "processing" ? j.processing : null, n && f === "processing" ? j.processingError : null, !n && f === "succeeded" ? j.succeeded : null, o === "vertical" ? j.vertical : null, e),
1425
1425
  ref: d,
1426
- children: [l === "dot" ? /* @__PURE__ */ C("span", { className: qt(A.statusIndicator, A.statusIndicatorDot) }) : /* @__PURE__ */ C("span", {
1427
- className: A.statusIndicator,
1426
+ children: [l === "dot" ? /* @__PURE__ */ C("span", { className: Jt(j.statusIndicator, j.statusIndicatorDot) }) : /* @__PURE__ */ C("span", {
1427
+ className: j.statusIndicator,
1428
1428
  children: i + 1
1429
1429
  }), /* @__PURE__ */ w("div", {
1430
- className: A.textContainer,
1430
+ className: j.textContainer,
1431
1431
  children: [/* @__PURE__ */ w(x, {
1432
- className: A.title,
1432
+ className: j.title,
1433
1433
  variant: "label-primary-highlight",
1434
- children: [c, /* @__PURE__ */ C("span", { className: A.titleConnectLine })]
1434
+ children: [c, /* @__PURE__ */ C("span", { className: j.titleConnectLine })]
1435
1435
  }), t.length > 0 ? /* @__PURE__ */ C(x, {
1436
- className: A.description,
1436
+ className: j.description,
1437
1437
  variant: "caption",
1438
- children: t.map((e, t) => /* @__PURE__ */ w(a, { children: [t > 0 ? " · " : null, Yt(e)] }, `${e.type}-${t}`))
1438
+ children: t.map((e, t) => /* @__PURE__ */ w(a, { children: [t > 0 ? " · " : null, Xt(e)] }, `${e.type}-${t}`))
1439
1439
  }) : null]
1440
1440
  })]
1441
1441
  });
1442
1442
  });
1443
- function Yt(e) {
1443
+ function Xt(e) {
1444
1444
  return e.type === "text" ? e.text : e.type === "dangerText" ? /* @__PURE__ */ C("span", {
1445
- style: Kt,
1445
+ style: qt,
1446
1446
  children: e.text
1447
1447
  }) : e.email ? /* @__PURE__ */ w(S, { children: [
1448
1448
  e.prefix,
@@ -1454,19 +1454,19 @@ function Yt(e) {
1454
1454
  onMouseEnter: t,
1455
1455
  onMouseLeave: n,
1456
1456
  ref: r,
1457
- style: Gt,
1457
+ style: Kt,
1458
1458
  children: e.label
1459
1459
  })
1460
1460
  })
1461
1461
  ] }) : `${e.prefix}:${e.label}`;
1462
1462
  }
1463
- function Xt({ activityLogs: e, instanceState: t, memberProfilesById: n, signatureVerification: r, signaturesById: i, taskDecisionsByTaskId: a, tasks: o, workflowSnapshot: s, workflowTokens: c }) {
1464
- let l = $(e, o, c, s, t, n, a, i, r), u = it(l), d = l.map((e) => ({
1463
+ function Zt({ activityLogs: e, instanceState: t, memberProfilesById: n, signatureVerification: r, signaturesById: i, taskDecisionsByTaskId: a, tasks: o, workflowSnapshot: s, workflowTokens: c }) {
1464
+ let l = bt(e, o, c, s, t, n, a, i, r), u = at(l), d = l.map((e) => ({
1465
1465
  ...e,
1466
1466
  descriptionParts: e.descriptionParts.filter(Z)
1467
1467
  }));
1468
1468
  return /* @__PURE__ */ w("div", {
1469
- style: Wt,
1469
+ style: Gt,
1470
1470
  children: [/* @__PURE__ */ C(x, {
1471
1471
  component: "h2",
1472
1472
  variant: "h3",
@@ -1475,7 +1475,7 @@ function Xt({ activityLogs: e, instanceState: t, memberProfilesById: n, signatur
1475
1475
  currentStep: u,
1476
1476
  orientation: "vertical",
1477
1477
  type: "dot",
1478
- children: d.map((e) => /* @__PURE__ */ C(Jt, {
1478
+ children: d.map((e) => /* @__PURE__ */ C(Yt, {
1479
1479
  descriptionParts: e.descriptionParts,
1480
1480
  error: e.error,
1481
1481
  forcePending: e.forcePending,
@@ -1490,10 +1490,10 @@ function Xt({ activityLogs: e, instanceState: t, memberProfilesById: n, signatur
1490
1490
  }
1491
1491
  //#endregion
1492
1492
  //#region src/views/instances/detail/InstanceDetailView.tsx
1493
- var Zt = 184, Qt = 96, $t = {
1493
+ var Qt = 184, $t = 96, en = {
1494
1494
  display: "grid",
1495
1495
  gap: 16
1496
- }, en = {
1496
+ }, tn = {
1497
1497
  background: "#f8fafc",
1498
1498
  border: "1px solid #e2e8f0",
1499
1499
  borderRadius: 8,
@@ -1501,7 +1501,7 @@ var Zt = 184, Qt = 96, $t = {
1501
1501
  minHeight: 440,
1502
1502
  overflow: "hidden",
1503
1503
  width: "min(80vw, 1040px)"
1504
- }, tn = {
1504
+ }, nn = {
1505
1505
  background: "#ffffff",
1506
1506
  border: "1px solid #cbd5e1",
1507
1507
  borderRadius: 8,
@@ -1511,24 +1511,24 @@ var Zt = 184, Qt = 96, $t = {
1511
1511
  minHeight: 82,
1512
1512
  padding: 12,
1513
1513
  width: 184
1514
- }, nn = {
1514
+ }, rn = {
1515
1515
  borderRadius: 999,
1516
1516
  fontSize: 12,
1517
1517
  fontWeight: 600,
1518
1518
  justifySelf: "start",
1519
1519
  lineHeight: "18px",
1520
1520
  padding: "0 8px"
1521
- }, rn = {
1521
+ }, an = {
1522
1522
  color: "#64748b",
1523
1523
  fontSize: 12,
1524
1524
  overflow: "hidden",
1525
1525
  textOverflow: "ellipsis",
1526
1526
  whiteSpace: "nowrap"
1527
- }, an = { opacity: 0 }, on = {
1527
+ }, on = { opacity: 0 }, sn = {
1528
1528
  display: "flex",
1529
1529
  flexWrap: "wrap",
1530
1530
  gap: 8
1531
- }, sn = {
1531
+ }, cn = {
1532
1532
  alignItems: "center",
1533
1533
  background: "#ffffff",
1534
1534
  border: "1px solid #cbd5e1",
@@ -1540,18 +1540,18 @@ var Zt = 184, Qt = 96, $t = {
1540
1540
  gap: 6,
1541
1541
  lineHeight: "20px",
1542
1542
  padding: "4px 8px"
1543
- }, cn = {
1543
+ }, ln = {
1544
1544
  display: "grid",
1545
1545
  gap: 16
1546
- }, ln = { workflowRuntime: yn };
1547
- function un({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHistory: l = !0, showSignatures: p = !0, showTasks: ee = !0 }) {
1548
- let { member: ne } = e(), v = ne?.memberId ?? null, [re, b] = f([]), [T, ae] = f(null), [oe, se] = f([]), [ue, he] = f([]), [ge, _e] = f([]), [ye, Ce] = f(null), [E, Te] = f([]), [D, je] = f([]), [Me, Pe] = f([]), [Re, O] = f(null), [Be, k] = f(!0), [Ve, A] = f(!1), [j, M] = f(!1), [N, P] = f(""), [He, F] = f(!1), [Ue, I] = f({}), [L, R] = f({}), [z, B] = f({}), [V, H] = f(null), [U, W] = f(null), [Ge, Ke] = f([]), qe = N.trim(), K = d(null);
1546
+ }, un = { workflowRuntime: bn };
1547
+ function dn({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHistory: l = !0, showSignatures: p = !0, showTasks: ee = !0 }) {
1548
+ let { member: ne } = e(), v = ne?.memberId ?? null, [re, b] = f([]), [T, ae] = f(null), [oe, se] = f([]), [ue, he] = f([]), [ge, _e] = f([]), [ye, Ce] = f(null), [E, D] = f([]), [O, Ae] = f([]), [je, Pe] = f([]), [Re, k] = f(null), [A, Be] = f(!0), [Ve, j] = f(!1), [M, N] = f(!1), [P, He] = f(""), [Ue, F] = f(!1), [We, I] = f({}), [L, R] = f({}), [z, B] = f({}), [V, H] = f(null), [U, W] = f(null), [Ke, qe] = f([]), Je = P.trim(), K = d(null);
1549
1549
  c(() => {
1550
- st();
1550
+ ct();
1551
1551
  }, [v, i]), c(() => {
1552
1552
  R(T?.formData ?? {}), B({});
1553
1553
  }, [T]);
1554
- let Ye = s((e, t) => {
1554
+ let Xe = s((e, t) => {
1555
1555
  B((n) => {
1556
1556
  let r = n[e];
1557
1557
  return r?.hasValue === t.hasValue && r.status === t.status ? n : {
@@ -1562,114 +1562,115 @@ function un({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHist
1562
1562
  }
1563
1563
  };
1564
1564
  });
1565
- }, []), q = u(() => E.find((e) => Ze(e, v) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [v, E]), J = u(() => q && T ? T.workflowSnapshot.nodes.find((e) => e.id === q.nodeId) ?? null : null, [q, T]), Y = J?.type === "userTask" && J.data.returnBehavior.allowReturn, Xe = J?.type === "userTask" && J.data.allowReject !== !1, Qe = J?.type === "userTask" && J.data.allowTransfer !== !1, $e = J?.type === "userTask" && J.data.allowAddSigner, et = !!(T && T.initiatorMemberId === v && (T.state === "RUNNING" || T.state === "RETURNED")), tt = !!(T && T.initiatorMemberId === v && T.state === "RETURNED"), X = u(() => new Map(Me.map((e) => [e.memberId, e])), [Me]), nt = u(() => wt(oe), [oe]), rt = u(() => new Map(ge.map((e) => [e.id, e])), [ge]), Z = u(() => T ? hn(T.workflowSnapshot) : null, [T]), it = u(() => T && Z ? mn(Z, E, D, T.state) : [], [
1565
+ }, []), q = u(() => E.find((e) => Qe(e, v) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [v, E]), J = u(() => q && T ? T.workflowSnapshot.nodes.find((e) => e.id === q.nodeId) ?? null : null, [q, T]), Y = J?.type === "userTask" && J.data.returnBehavior.allowReturn, Ze = J?.type === "userTask" && J.data.allowReject !== !1, $e = J?.type === "userTask" && J.data.allowTransfer !== !1, et = J?.type === "userTask" && J.data.allowAddSigner, tt = !!(T && T.initiatorMemberId === v && (T.state === "RUNNING" || T.state === "RETURNED")), nt = !!(T && T.initiatorMemberId === v && T.state === "RETURNED"), X = u(() => new Map(je.map((e) => [e.memberId, e])), [je]), rt = u(() => Tt(oe), [oe]), it = u(() => new Map(ge.map((e) => [e.id, e])), [ge]), Z = u(() => T ? gn(T.workflowSnapshot) : null, [T]), at = u(() => T && Z ? hn(Z, E, O, T.state) : [], [
1566
1566
  T,
1567
1567
  Z,
1568
1568
  E,
1569
- D
1570
- ]), at = u(() => Z ? gn(Z) : [], [Z]), ot = u(() => T ? fn(T.workflowSnapshot) : [], [T]);
1571
- async function st() {
1572
- k(!0), O(null);
1569
+ O
1570
+ ]), ot = u(() => Z ? _n(Z) : [], [Z]), st = u(() => T ? pn(T.workflowSnapshot) : [], [T]);
1571
+ async function ct() {
1572
+ Be(!0), k(null);
1573
1573
  try {
1574
1574
  let e = await de(i);
1575
- b(e.activityLogs), ae(e.instance), Te(e.tasks), je(e.workflowTokens);
1575
+ b(e.activityLogs), ae(e.instance), D(e.tasks), Ae(e.workflowTokens);
1576
1576
  let t = await ce(e.instance.id), [n, r, a, o] = await Promise.all([
1577
- Ct(e.tasks),
1578
- xt({
1577
+ wt(e.tasks),
1578
+ St({
1579
1579
  ...e,
1580
1580
  adhocDirectives: t
1581
1581
  }),
1582
1582
  le(e.instance.id),
1583
1583
  me(e.instance.id)
1584
1584
  ]);
1585
- se(n), Pe(r), he(a), _e(o.signatures), Ce(o.verification), Ke(t);
1585
+ se(n), Pe(r), he(a), _e(o.signatures), Ce(o.verification), qe(t);
1586
1586
  } catch (e) {
1587
- O(G(e));
1587
+ k(G(e));
1588
1588
  } finally {
1589
- k(!1);
1589
+ Be(!1);
1590
1590
  }
1591
1591
  }
1592
- async function ct(e, t) {
1592
+ async function lt(e, t) {
1593
1593
  if (!v) throw Error("尚未登入,無法上傳附件");
1594
1594
  return { id: (await be({
1595
1595
  file: t,
1596
1596
  formFieldPath: `form.${e.fieldKey}`
1597
1597
  })).id };
1598
1598
  }
1599
- async function lt(e) {
1599
+ async function ut(e) {
1600
1600
  if (!v) return;
1601
1601
  let t = await fe({ id: e.id });
1602
1602
  window.open(t, "_blank", "noopener,noreferrer");
1603
1603
  }
1604
- async function ut(e) {
1604
+ async function dt(e) {
1605
1605
  if (!v) return;
1606
1606
  let t = await pe({ id: e.id });
1607
1607
  H(e), W(t);
1608
1608
  }
1609
- async function dt() {
1610
- if (!(!v || !T || !et)) {
1611
- A(!0), O(null), I({});
1609
+ async function ft() {
1610
+ if (!(!v || !T || !tt)) {
1611
+ j(!0), k(null), I({});
1612
1612
  try {
1613
1613
  await ie({
1614
1614
  cancelledByMemberId: v,
1615
- comment: qe || null,
1615
+ comment: Je || null,
1616
1616
  instanceId: T.id
1617
- }), P(""), F(!1), await st();
1617
+ }), He(""), F(!1), await ct();
1618
1618
  } catch (e) {
1619
- O(G(e));
1619
+ k(G(e));
1620
1620
  } finally {
1621
- A(!1);
1621
+ j(!1);
1622
1622
  }
1623
1623
  }
1624
1624
  }
1625
- async function ft() {
1626
- if (!v || !T || !tt) return;
1627
- A(!0), O(null), I({});
1625
+ async function pt() {
1626
+ if (!v || !T || !nt) return;
1627
+ j(!0), k(null), I({});
1628
1628
  let e = r(Object.values(z));
1629
1629
  if (e) {
1630
- O(e), A(!1);
1630
+ k(e), j(!1);
1631
1631
  return;
1632
1632
  }
1633
+ let t = T.formDefinitionSnapshot.schema ? Me(T.formDefinitionSnapshot.schema.fields, L) : L;
1633
1634
  if (T.formDefinitionSnapshot.schema && T.formDefinitionSnapshot.uiSchema) {
1634
1635
  let e = Fe({
1635
1636
  schema: T.formDefinitionSnapshot.schema,
1636
1637
  uiSchema: T.formDefinitionSnapshot.uiSchema,
1637
- values: L
1638
+ values: t
1638
1639
  });
1639
1640
  if (!e.valid) {
1640
- I(e.errors), O("請先補齊必填欄位。"), e.firstInvalidFieldKey && Ne(e.firstInvalidFieldKey), A(!1);
1641
+ I(e.errors), k("請先補齊必填欄位。"), e.firstInvalidFieldKey && Ne(e.firstInvalidFieldKey), j(!1);
1641
1642
  return;
1642
1643
  }
1643
1644
  }
1644
1645
  try {
1645
1646
  await ve({
1646
- formData: L,
1647
+ formData: t,
1647
1648
  initiatorMemberId: v,
1648
1649
  instanceId: T.id,
1649
1650
  title: T.title
1650
- }), await st();
1651
+ }), await ct();
1651
1652
  } catch (e) {
1652
- O(G(e));
1653
+ k(G(e));
1653
1654
  } finally {
1654
- A(!1);
1655
+ j(!1);
1655
1656
  }
1656
1657
  }
1657
- let pt = K.current?.deciding ?? !1, Q = Ve || pt;
1658
+ let mt = K.current?.deciding ?? !1, Q = Ve || mt;
1658
1659
  return /* @__PURE__ */ w(S, { children: [
1659
1660
  /* @__PURE__ */ C(te, { children: /* @__PURE__ */ w(xe, {
1660
- description: T ? `${Je(T.state)} · ${t(T.startedAt)}` : "載入案件內容。",
1661
+ description: T ? `${Ye(T.state)} · ${t(T.startedAt)}` : "載入案件內容。",
1661
1662
  title: T?.title ?? "簽核案件",
1662
1663
  children: [
1663
1664
  T ? /* @__PURE__ */ C(m, {
1664
1665
  "aria-label": "查看流程圖",
1665
- icon: ke,
1666
+ icon: Oe,
1666
1667
  iconType: "icon-only",
1667
- onClick: () => M(!0),
1668
+ onClick: () => N(!0),
1668
1669
  title: "查看流程圖",
1669
1670
  variant: "base-secondary",
1670
1671
  children: "流程圖"
1671
1672
  }) : null,
1672
- et ? /* @__PURE__ */ C(m, {
1673
+ tt ? /* @__PURE__ */ C(m, {
1673
1674
  disabled: Q,
1674
1675
  icon: we,
1675
1676
  iconType: "leading",
@@ -1678,16 +1679,16 @@ function un({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHist
1678
1679
  children: "取消案件"
1679
1680
  }) : null,
1680
1681
  q ? /* @__PURE__ */ w(S, { children: [
1681
- $e ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(m, {
1682
+ et ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(m, {
1682
1683
  disabled: Q,
1683
- icon: De,
1684
+ icon: Ee,
1684
1685
  iconType: "leading",
1685
1686
  onClick: () => K.current?.openAdhocModal("COUNTERSIGN"),
1686
1687
  variant: "base-secondary",
1687
1688
  children: "會簽"
1688
1689
  }, "adhoc-countersign"), /* @__PURE__ */ C(m, {
1689
1690
  disabled: Q,
1690
- icon: De,
1691
+ icon: Ee,
1691
1692
  iconType: "leading",
1692
1693
  onClick: () => K.current?.openAdhocModal("PRE_APPROVAL"),
1693
1694
  variant: "base-secondary",
@@ -1695,7 +1696,7 @@ function un({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHist
1695
1696
  }, "adhoc-pre-approval")] }) : null,
1696
1697
  /* @__PURE__ */ C(m, {
1697
1698
  disabled: Q,
1698
- icon: Ee,
1699
+ icon: Te,
1699
1700
  iconType: "leading",
1700
1701
  onClick: () => K.current?.openAdhocModal("STAGE_NOTIFY"),
1701
1702
  variant: "base-secondary",
@@ -1703,21 +1704,21 @@ function un({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHist
1703
1704
  }, "adhoc-notify"),
1704
1705
  Y ? /* @__PURE__ */ C(m, {
1705
1706
  disabled: Q,
1706
- icon: Oe,
1707
+ icon: De,
1707
1708
  iconType: "leading",
1708
1709
  onClick: () => K.current?.openReturnModal(),
1709
1710
  variant: "base-secondary",
1710
1711
  children: "退回"
1711
1712
  }, "task-return") : null,
1712
- Qe ? /* @__PURE__ */ C(m, {
1713
+ $e ? /* @__PURE__ */ C(m, {
1713
1714
  disabled: Q,
1714
- icon: Ae,
1715
+ icon: ke,
1715
1716
  iconType: "leading",
1716
1717
  onClick: () => K.current?.openTransferModal(),
1717
1718
  variant: "base-secondary",
1718
1719
  children: "轉派"
1719
1720
  }, "task-transfer") : null,
1720
- Xe ? /* @__PURE__ */ C(m, {
1721
+ Ze ? /* @__PURE__ */ C(m, {
1721
1722
  disabled: Q,
1722
1723
  icon: we,
1723
1724
  iconType: "leading",
@@ -1737,85 +1738,85 @@ function un({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHist
1737
1738
  ]
1738
1739
  }) }),
1739
1740
  /* @__PURE__ */ w(_, { children: [
1740
- o ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Dt, {
1741
- canResubmitInstance: tt,
1741
+ o ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Ot, {
1742
+ canResubmitInstance: nt,
1742
1743
  deciding: Ve,
1743
1744
  error: Re,
1744
1745
  instance: T,
1745
- loading: Be,
1746
- onDataSourceStateChange: Ye,
1746
+ loading: A,
1747
+ onDataSourceStateChange: Xe,
1747
1748
  onResubmitFormChange: (e) => {
1748
1749
  R(e), I({});
1749
1750
  },
1750
- onResubmitInstance: () => void ft(),
1751
- onUploadAttachment: ct,
1751
+ onResubmitInstance: () => void pt(),
1752
+ onUploadAttachment: lt,
1752
1753
  resubmitFormData: L,
1753
- resubmitFormErrors: Ue
1754
+ resubmitFormErrors: We
1754
1755
  }) }) : null,
1755
- a ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(kt, {
1756
+ a ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(At, {
1756
1757
  attachments: ue,
1757
1758
  onDownload: (e) => {
1758
- lt(e);
1759
+ ut(e);
1759
1760
  },
1760
1761
  onPreview: (e) => {
1761
- ut(e);
1762
+ dt(e);
1762
1763
  }
1763
1764
  }) }) : null,
1764
- ee ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Bt, {
1765
- adhocDirectives: Ge,
1765
+ ee ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Vt, {
1766
+ adhocDirectives: Ke,
1766
1767
  currentMemberId: v,
1767
1768
  instance: T,
1768
1769
  memberProfilesById: X,
1769
- onChanged: st,
1770
+ onChanged: ct,
1770
1771
  ref: K,
1771
1772
  tasks: E
1772
1773
  }) }) : null,
1773
- p ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Ut, {
1774
+ p ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Wt, {
1774
1775
  signatureVerification: ye,
1775
1776
  signatures: ge
1776
1777
  }) }) : null,
1777
- l ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Xt, {
1778
+ l ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Zt, {
1778
1779
  activityLogs: re,
1779
1780
  instanceState: T?.state ?? "RUNNING",
1780
1781
  memberProfilesById: X,
1781
1782
  signatureVerification: ye,
1782
- signaturesById: rt,
1783
- taskDecisionsByTaskId: nt,
1783
+ signaturesById: it,
1784
+ taskDecisionsByTaskId: rt,
1784
1785
  tasks: E,
1785
1786
  workflowSnapshot: T?.workflowSnapshot ?? null,
1786
- workflowTokens: D
1787
+ workflowTokens: O
1787
1788
  }) }) : null
1788
1789
  ] }),
1789
1790
  T ? /* @__PURE__ */ C(h, {
1790
1791
  modalType: "standard",
1791
- onClose: () => M(!1),
1792
- open: j,
1792
+ onClose: () => N(!1),
1793
+ open: M,
1793
1794
  showModalHeader: !0,
1794
1795
  size: "wide",
1795
- supportingText: `${Je(T.state)} · ${t(T.startedAt)}`,
1796
+ supportingText: `${Ye(T.state)} · ${t(T.startedAt)}`,
1796
1797
  title: "流程圖",
1797
1798
  children: /* @__PURE__ */ w("div", {
1798
- style: $t,
1799
+ style: en,
1799
1800
  children: [/* @__PURE__ */ C("div", {
1800
- style: en,
1801
+ style: tn,
1801
1802
  children: /* @__PURE__ */ w(ze, {
1802
- edges: at,
1803
+ edges: ot,
1803
1804
  fitView: !0,
1804
1805
  fitViewOptions: { padding: .18 },
1805
1806
  maxZoom: 1.2,
1806
1807
  minZoom: .2,
1807
- nodes: it,
1808
+ nodes: at,
1808
1809
  nodesDraggable: !1,
1809
1810
  nodesFocusable: !1,
1810
- nodeTypes: ln,
1811
+ nodeTypes: un,
1811
1812
  panOnDrag: !0,
1812
1813
  proOptions: { hideAttribution: !0 },
1813
1814
  children: [/* @__PURE__ */ C(Ie, {}), /* @__PURE__ */ C(Le, { showInteractive: !1 })]
1814
1815
  })
1815
- }), ot.length > 0 ? /* @__PURE__ */ C("div", {
1816
- style: on,
1817
- children: ot.map((e) => /* @__PURE__ */ C("span", {
1818
- style: sn,
1816
+ }), st.length > 0 ? /* @__PURE__ */ C("div", {
1817
+ style: sn,
1818
+ children: st.map((e) => /* @__PURE__ */ C("span", {
1819
+ style: cn,
1819
1820
  children: e
1820
1821
  }, e))
1821
1822
  }) : null]
@@ -1831,10 +1832,10 @@ function un({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHist
1831
1832
  size: "wide",
1832
1833
  supportingText: V?.filename ?? void 0,
1833
1834
  title: "PDF 預覽",
1834
- children: U ? /* @__PURE__ */ C(We, {
1835
+ children: U ? /* @__PURE__ */ C(Ge, {
1835
1836
  filename: V?.filename ?? "PDF 預覽",
1836
1837
  fileUrl: U,
1837
- onDownload: V ? () => void lt(V) : void 0
1838
+ onDownload: V ? () => void ut(V) : void 0
1838
1839
  }) : null
1839
1840
  }),
1840
1841
  /* @__PURE__ */ C(h, {
@@ -1846,14 +1847,14 @@ function un({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHist
1846
1847
  modalType: "standard",
1847
1848
  onCancel: () => F(!1),
1848
1849
  onClose: () => F(!1),
1849
- onConfirm: () => void dt(),
1850
- open: He,
1850
+ onConfirm: () => void ft(),
1851
+ open: Ue,
1851
1852
  showModalFooter: !0,
1852
1853
  showModalHeader: !0,
1853
1854
  supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
1854
1855
  title: "取消案件",
1855
1856
  children: /* @__PURE__ */ w("div", {
1856
- style: cn,
1857
+ style: ln,
1857
1858
  children: [/* @__PURE__ */ w(x, {
1858
1859
  variant: "body",
1859
1860
  children: [
@@ -1865,32 +1866,32 @@ function un({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHist
1865
1866
  label: "取消原因",
1866
1867
  name: "cancelComment",
1867
1868
  children: /* @__PURE__ */ C(y, {
1868
- onChange: (e) => P(e.target.value),
1869
+ onChange: (e) => He(e.target.value),
1869
1870
  placeholder: "可填寫取消原因",
1870
1871
  resize: "vertical",
1871
1872
  rows: 3,
1872
- value: N
1873
+ value: P
1873
1874
  })
1874
1875
  })]
1875
1876
  })
1876
1877
  })
1877
1878
  ] });
1878
1879
  }
1879
- function dn(e) {
1880
- return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
1881
- }
1882
1880
  function fn(e) {
1883
- return e.edges.map(dn).filter((e) => e.trim().length > 0);
1881
+ return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
1884
1882
  }
1885
1883
  function pn(e) {
1884
+ return e.edges.map(fn).filter((e) => e.trim().length > 0);
1885
+ }
1886
+ function mn(e) {
1886
1887
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
1887
1888
  }
1888
- function mn(e, t, n, r) {
1889
+ function hn(e, t, n, r) {
1889
1890
  return e.nodes.map((e) => {
1890
- let i = bt(e, t, n, r);
1891
+ let i = xt(e, t, n, r);
1891
1892
  return {
1892
1893
  data: {
1893
- kindLabel: pn(e.type),
1894
+ kindLabel: mn(e.type),
1894
1895
  label: e.data.label,
1895
1896
  secondaryLabel: i.secondaryLabel,
1896
1897
  statusLabel: i.statusLabel,
@@ -1898,42 +1899,42 @@ function mn(e, t, n, r) {
1898
1899
  },
1899
1900
  id: e.id,
1900
1901
  position: e.position,
1901
- sourcePosition: O.Right,
1902
- targetPosition: O.Left,
1902
+ sourcePosition: k.Right,
1903
+ targetPosition: k.Left,
1903
1904
  type: "workflowRuntime"
1904
1905
  };
1905
1906
  });
1906
1907
  }
1907
- function hn(e) {
1908
- let t = new Be.graphlib.Graph();
1908
+ function gn(e) {
1909
+ let t = new A.graphlib.Graph();
1909
1910
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
1910
1911
  nodesep: 56,
1911
1912
  rankdir: "LR",
1912
1913
  ranksep: 120
1913
1914
  }), e.nodes.forEach((e) => {
1914
1915
  t.setNode(e.id, {
1915
- height: Qt,
1916
- width: Zt
1916
+ height: $t,
1917
+ width: Qt
1917
1918
  });
1918
1919
  }), e.edges.forEach((e) => {
1919
1920
  t.setEdge(e.source, e.target);
1920
- }), Be.layout(t), {
1921
+ }), A.layout(t), {
1921
1922
  ...e,
1922
1923
  nodes: e.nodes.map((e) => {
1923
1924
  let n = t.node(e.id);
1924
1925
  return n ? {
1925
1926
  ...e,
1926
1927
  position: {
1927
- x: n.x - Zt / 2,
1928
- y: n.y - Qt / 2
1928
+ x: n.x - Qt / 2,
1929
+ y: n.y - $t / 2
1929
1930
  }
1930
1931
  } : e;
1931
1932
  })
1932
1933
  };
1933
1934
  }
1934
- function gn(e) {
1935
+ function _n(e) {
1935
1936
  return e.edges.map((e) => {
1936
- let t = dn(e);
1937
+ let t = fn(e);
1937
1938
  return {
1938
1939
  animated: !1,
1939
1940
  id: e.id,
@@ -1961,25 +1962,25 @@ function gn(e) {
1961
1962
  };
1962
1963
  });
1963
1964
  }
1964
- function _n(e) {
1965
+ function vn(e) {
1965
1966
  return e === "current" ? {
1966
- ...tn,
1967
+ ...nn,
1967
1968
  border: "1px solid var(--mzn-color-primary, #0057ff)",
1968
1969
  boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
1969
1970
  } : e === "completed" ? {
1970
- ...tn,
1971
+ ...nn,
1971
1972
  border: "1px solid #16a34a"
1972
1973
  } : e === "cancelled" ? {
1973
- ...tn,
1974
+ ...nn,
1974
1975
  border: "1px solid #dc2626",
1975
1976
  opacity: .72
1976
1977
  } : e === "waiting" ? {
1977
- ...tn,
1978
+ ...nn,
1978
1979
  border: "1px dashed #64748b"
1979
- } : tn;
1980
+ } : nn;
1980
1981
  }
1981
- function vn(e) {
1982
- let t = nn;
1982
+ function yn(e) {
1983
+ let t = rn;
1983
1984
  return e === "current" ? {
1984
1985
  ...t,
1985
1986
  background: "#eff6ff",
@@ -2002,14 +2003,14 @@ function vn(e) {
2002
2003
  color: "#64748b"
2003
2004
  };
2004
2005
  }
2005
- function yn({ data: e }) {
2006
+ function bn({ data: e }) {
2006
2007
  return /* @__PURE__ */ w("div", {
2007
- style: _n(e.tone),
2008
+ style: vn(e.tone),
2008
2009
  children: [
2009
2010
  /* @__PURE__ */ C(Re, {
2010
2011
  isConnectable: !1,
2011
- position: O.Left,
2012
- style: an,
2012
+ position: k.Left,
2013
+ style: on,
2013
2014
  type: "target"
2014
2015
  }),
2015
2016
  /* @__PURE__ */ C(x, {
@@ -2020,24 +2021,24 @@ function yn({ data: e }) {
2020
2021
  children: e.label
2021
2022
  }),
2022
2023
  /* @__PURE__ */ C("span", {
2023
- style: vn(e.tone),
2024
+ style: yn(e.tone),
2024
2025
  children: e.statusLabel
2025
2026
  }),
2026
2027
  /* @__PURE__ */ C("span", {
2027
2028
  title: e.secondaryLabel,
2028
- style: rn,
2029
+ style: an,
2029
2030
  children: e.secondaryLabel || e.kindLabel
2030
2031
  }),
2031
2032
  /* @__PURE__ */ C(Re, {
2032
2033
  isConnectable: !1,
2033
- position: O.Right,
2034
- style: an,
2034
+ position: k.Right,
2035
+ style: on,
2035
2036
  type: "source"
2036
2037
  })
2037
2038
  ]
2038
2039
  });
2039
2040
  }
2040
2041
  //#endregion
2041
- export { kt as a, Bt as i, Xt as n, Dt as o, Ut as r, un as t };
2042
+ export { At as a, Vt as i, Zt as n, Ot as o, Wt as r, dn as t };
2042
2043
 
2043
- //# sourceMappingURL=detail-Cmw-aQcu.js.map
2044
+ //# sourceMappingURL=detail-BgKgMvYx.js.map