@rytass/bpm-core-react 0.3.0 → 0.3.1

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 (168) hide show
  1. package/README.md +13 -1
  2. package/dist/chunks/{app-navigation-BRRFCkxZ.cjs → app-navigation-C_mbz7jx.cjs} +2 -2
  3. package/dist/chunks/app-navigation-C_mbz7jx.cjs.map +1 -0
  4. package/dist/chunks/{app-navigation-rxhpHCch.js → app-navigation-uwbNEw9P.js} +65 -65
  5. package/dist/chunks/app-navigation-uwbNEw9P.js.map +1 -0
  6. package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs +2 -0
  7. package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs.map +1 -0
  8. package/dist/chunks/approval-instance-list-page-nmzMrj0b.js +281 -0
  9. package/dist/chunks/approval-instance-list-page-nmzMrj0b.js.map +1 -0
  10. package/dist/chunks/builder-DPhAH381.cjs +3 -0
  11. package/dist/chunks/builder-DPhAH381.cjs.map +1 -0
  12. package/dist/chunks/{builder-Du_0apkh.js → builder-DqZskyXC.js} +333 -330
  13. package/dist/chunks/builder-DqZskyXC.js.map +1 -0
  14. package/dist/chunks/categories-DEijUOnw.cjs +2 -0
  15. package/dist/chunks/categories-DEijUOnw.cjs.map +1 -0
  16. package/dist/chunks/{categories-DG4k7S8V.js → categories-DTEl182t.js} +129 -126
  17. package/dist/chunks/categories-DTEl182t.js.map +1 -0
  18. package/dist/chunks/{dashboard-page-DcDiWQp2.cjs → dashboard-page-DCmuB0Rw.cjs} +2 -2
  19. package/dist/chunks/dashboard-page-DCmuB0Rw.cjs.map +1 -0
  20. package/dist/chunks/dashboard-page-Dx5PeEeN.js +117 -0
  21. package/dist/chunks/dashboard-page-Dx5PeEeN.js.map +1 -0
  22. package/dist/chunks/delegations-C-ZrwzvU.js +572 -0
  23. package/dist/chunks/delegations-C-ZrwzvU.js.map +1 -0
  24. package/dist/chunks/delegations-C5PzZ5Kn.js +645 -0
  25. package/dist/chunks/delegations-C5PzZ5Kn.js.map +1 -0
  26. package/dist/chunks/delegations-DOGDvybX.cjs +2 -0
  27. package/dist/chunks/delegations-DOGDvybX.cjs.map +1 -0
  28. package/dist/chunks/delegations-DkDBWOQ7.cjs +2 -0
  29. package/dist/chunks/delegations-DkDBWOQ7.cjs.map +1 -0
  30. package/dist/chunks/detail-B2gcOPkd.cjs +2 -0
  31. package/dist/chunks/detail-B2gcOPkd.cjs.map +1 -0
  32. package/dist/chunks/{detail-DilI0PPe.js → detail-CfFyU5zC.js} +667 -664
  33. package/dist/chunks/detail-CfFyU5zC.js.map +1 -0
  34. package/dist/chunks/{format-date-time-hKLVMxq4.cjs → format-date-time-isOa3e9q.cjs} +2 -2
  35. package/dist/chunks/{format-date-time-hKLVMxq4.cjs.map → format-date-time-isOa3e9q.cjs.map} +1 -1
  36. package/dist/chunks/notifications-CPQ-nVar.cjs +2 -0
  37. package/dist/chunks/notifications-CPQ-nVar.cjs.map +1 -0
  38. package/dist/chunks/notifications-DweexUVy.js +197 -0
  39. package/dist/chunks/notifications-DweexUVy.js.map +1 -0
  40. package/dist/chunks/orgs-DgZ0DQ3-.cjs +2 -0
  41. package/dist/chunks/orgs-DgZ0DQ3-.cjs.map +1 -0
  42. package/dist/chunks/{orgs-c29y74w2.js → orgs-xrdhb3hS.js} +668 -665
  43. package/dist/chunks/orgs-xrdhb3hS.js.map +1 -0
  44. package/dist/chunks/templates-PK_VYvcy.js +383 -0
  45. package/dist/chunks/templates-PK_VYvcy.js.map +1 -0
  46. package/dist/chunks/{templates-Cd0WFheA.cjs → templates-x1OJZmsG.cjs} +2 -2
  47. package/dist/chunks/templates-x1OJZmsG.cjs.map +1 -0
  48. package/dist/chunks/users-CY4-NK3j.js +218 -0
  49. package/dist/chunks/users-CY4-NK3j.js.map +1 -0
  50. package/dist/chunks/users-DHnu_056.cjs +2 -0
  51. package/dist/chunks/users-DHnu_056.cjs.map +1 -0
  52. package/dist/components/app-navigation.d.ts +17 -10
  53. package/dist/index.cjs +1 -1
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/index.js +4 -4
  56. package/dist/index.js.map +1 -1
  57. package/dist/lib/notification-drawer-provider.d.ts +1 -1
  58. package/dist/lib/notification-unread-provider.d.ts +1 -1
  59. package/dist/lib/providers.d.ts +1 -1
  60. package/dist/pages/admin/delegations/index.cjs +1 -1
  61. package/dist/pages/admin/delegations/index.js +1 -1
  62. package/dist/pages/admin/orgs/index.cjs +1 -1
  63. package/dist/pages/admin/orgs/index.js +1 -1
  64. package/dist/pages/admin/users/index.cjs +1 -1
  65. package/dist/pages/admin/users/index.js +1 -1
  66. package/dist/pages/delegations/index.cjs +1 -1
  67. package/dist/pages/delegations/index.js +1 -1
  68. package/dist/pages/forms/builder/index.cjs +1 -1
  69. package/dist/pages/forms/builder/index.js +1 -1
  70. package/dist/pages/instances/detail/index.cjs +1 -1
  71. package/dist/pages/instances/detail/index.js +1 -1
  72. package/dist/pages/settings/notifications/index.cjs +1 -1
  73. package/dist/pages/settings/notifications/index.js +1 -1
  74. package/dist/pages/templates/categories/index.cjs +1 -1
  75. package/dist/pages/templates/categories/index.js +1 -1
  76. package/dist/pages/templates/index.cjs +1 -1
  77. package/dist/pages/templates/index.js +1 -1
  78. package/dist/views/admin/delegations/index.cjs +1 -1
  79. package/dist/views/admin/delegations/index.js +1 -1
  80. package/dist/views/admin/index.cjs +1 -1
  81. package/dist/views/admin/index.js +3 -3
  82. package/dist/views/admin/orgs/index.cjs +1 -1
  83. package/dist/views/admin/orgs/index.js +1 -1
  84. package/dist/views/admin/users/index.cjs +1 -1
  85. package/dist/views/admin/users/index.js +1 -1
  86. package/dist/views/cc/index.cjs +1 -1
  87. package/dist/views/cc/index.js +1 -1
  88. package/dist/views/dashboard/index.cjs +1 -1
  89. package/dist/views/dashboard/index.js +1 -1
  90. package/dist/views/delegations/index.cjs +1 -1
  91. package/dist/views/delegations/index.js +1 -1
  92. package/dist/views/forms/builder/index.cjs +1 -1
  93. package/dist/views/forms/builder/index.js +1 -1
  94. package/dist/views/forms/index.cjs +1 -1
  95. package/dist/views/forms/index.cjs.map +1 -1
  96. package/dist/views/forms/index.js +93 -90
  97. package/dist/views/forms/index.js.map +1 -1
  98. package/dist/views/inbox/index.cjs +1 -1
  99. package/dist/views/inbox/index.cjs.map +1 -1
  100. package/dist/views/inbox/index.js +127 -124
  101. package/dist/views/inbox/index.js.map +1 -1
  102. package/dist/views/instances/detail/index.cjs +1 -1
  103. package/dist/views/instances/detail/index.js +1 -1
  104. package/dist/views/instances/new/index.cjs +1 -1
  105. package/dist/views/instances/new/index.cjs.map +1 -1
  106. package/dist/views/instances/new/index.js +120 -114
  107. package/dist/views/instances/new/index.js.map +1 -1
  108. package/dist/views/search/index.cjs +1 -1
  109. package/dist/views/search/index.js +1 -1
  110. package/dist/views/sent/index.cjs +1 -1
  111. package/dist/views/sent/index.js +1 -1
  112. package/dist/views/settings/index.cjs +1 -1
  113. package/dist/views/settings/index.js +1 -1
  114. package/dist/views/settings/notifications/index.cjs +1 -1
  115. package/dist/views/settings/notifications/index.js +1 -1
  116. package/dist/views/templates/categories/index.cjs +1 -1
  117. package/dist/views/templates/categories/index.js +1 -1
  118. package/dist/views/templates/designer/index.cjs +2 -2
  119. package/dist/views/templates/designer/index.cjs.map +1 -1
  120. package/dist/views/templates/designer/index.js +573 -570
  121. package/dist/views/templates/designer/index.js.map +1 -1
  122. package/dist/views/templates/index.cjs +1 -1
  123. package/dist/views/templates/index.js +2 -2
  124. package/dist/views/templates/versions/index.cjs +1 -1
  125. package/dist/views/templates/versions/index.cjs.map +1 -1
  126. package/dist/views/templates/versions/index.js +50 -47
  127. package/dist/views/templates/versions/index.js.map +1 -1
  128. package/package.json +1 -1
  129. package/dist/chunks/app-navigation-BRRFCkxZ.cjs.map +0 -1
  130. package/dist/chunks/app-navigation-rxhpHCch.js.map +0 -1
  131. package/dist/chunks/approval-instance-list-page-2vUWc5-c.cjs +0 -2
  132. package/dist/chunks/approval-instance-list-page-2vUWc5-c.cjs.map +0 -1
  133. package/dist/chunks/approval-instance-list-page-BgE4vQw8.js +0 -278
  134. package/dist/chunks/approval-instance-list-page-BgE4vQw8.js.map +0 -1
  135. package/dist/chunks/builder-B8X-m6C5.cjs +0 -3
  136. package/dist/chunks/builder-B8X-m6C5.cjs.map +0 -1
  137. package/dist/chunks/builder-Du_0apkh.js.map +0 -1
  138. package/dist/chunks/categories-DG4k7S8V.js.map +0 -1
  139. package/dist/chunks/categories-DshBQG33.cjs +0 -2
  140. package/dist/chunks/categories-DshBQG33.cjs.map +0 -1
  141. package/dist/chunks/dashboard-page-CTBwpu_D.js +0 -114
  142. package/dist/chunks/dashboard-page-CTBwpu_D.js.map +0 -1
  143. package/dist/chunks/dashboard-page-DcDiWQp2.cjs.map +0 -1
  144. package/dist/chunks/delegations-BAZQbElH.js +0 -642
  145. package/dist/chunks/delegations-BAZQbElH.js.map +0 -1
  146. package/dist/chunks/delegations-DzrckrPp.js +0 -569
  147. package/dist/chunks/delegations-DzrckrPp.js.map +0 -1
  148. package/dist/chunks/delegations-Z8hTajLj.cjs +0 -2
  149. package/dist/chunks/delegations-Z8hTajLj.cjs.map +0 -1
  150. package/dist/chunks/delegations-hb9JoVZe.cjs +0 -2
  151. package/dist/chunks/delegations-hb9JoVZe.cjs.map +0 -1
  152. package/dist/chunks/detail-DilI0PPe.js.map +0 -1
  153. package/dist/chunks/detail-DuRg3Y7b.cjs +0 -2
  154. package/dist/chunks/detail-DuRg3Y7b.cjs.map +0 -1
  155. package/dist/chunks/notifications-B2Lk3grg.js +0 -194
  156. package/dist/chunks/notifications-B2Lk3grg.js.map +0 -1
  157. package/dist/chunks/notifications-C8ADhnxF.cjs +0 -2
  158. package/dist/chunks/notifications-C8ADhnxF.cjs.map +0 -1
  159. package/dist/chunks/orgs-CGv3VNDR.cjs +0 -2
  160. package/dist/chunks/orgs-CGv3VNDR.cjs.map +0 -1
  161. package/dist/chunks/orgs-c29y74w2.js.map +0 -1
  162. package/dist/chunks/templates-Cd0WFheA.cjs.map +0 -1
  163. package/dist/chunks/templates-Dn9QHFSy.js +0 -380
  164. package/dist/chunks/templates-Dn9QHFSy.js.map +0 -1
  165. package/dist/chunks/users-B-trMu0E.cjs +0 -2
  166. package/dist/chunks/users-B-trMu0E.cjs.map +0 -1
  167. package/dist/chunks/users-itVXXRj7.js +0 -215
  168. package/dist/chunks/users-itVXXRj7.js.map +0 -1
@@ -1,21 +1,21 @@
1
1
  "use client";
2
2
  import { n as e } from "./auth-provider-Bnox5gsx.js";
3
3
  import { t } from "./format-date-time-CB-LxzqT.js";
4
- import { t as n } from "./app-navigation-rxhpHCch.js";
4
+ import { t as n } from "./app-navigation-uwbNEw9P.js";
5
5
  import { t as r } from "./bpm-form-field-Cao0rMol.js";
6
6
  import { t as i } from "./FormRendererView-DrHsuSVo.js";
7
7
  import { Fragment as a, forwardRef as o, useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
8
- import { AutoComplete as f, Button as p, Layout as m, Modal as h, PageHeader as ee, Section as g, SectionGroup as te, Select as ne, Stepper as re, Table as ie, Textarea as _, Tooltip as ae, Typography as v } from "@mezzanine-ui/react";
9
- import { Fragment as oe, jsx as y, jsxs as b } from "react/jsx-runtime";
10
- import { cancelApprovalInstance as se, decideTask as ce, listAttachments as le, listTaskDecisions as x, readApprovalInstance as ue, readAttachmentDownloadUrl as de, readAttachmentPreviewUrl as fe, readInstanceSignatures as pe, resolveMemberProfiles as me, resubmitApprovalInstance as he, searchMembers as ge, uploadAttachment as _e } from "@rytass/bpm-core-client/workflow";
8
+ import { AutoComplete as f, Button as p, Modal as m, PageHeader as ee, Section as h, SectionGroup as te, Select as ne, Stepper as re, Table as ie, Textarea as g, Tooltip as ae, Typography as _ } from "@mezzanine-ui/react";
9
+ import { Fragment as oe, jsx as v, jsxs as y } from "react/jsx-runtime";
10
+ import { cancelApprovalInstance as se, decideTask as ce, listAttachments as le, listTaskDecisions as b, readApprovalInstance as ue, readAttachmentDownloadUrl as de, readAttachmentPreviewUrl as fe, readInstanceSignatures as pe, resolveMemberProfiles as me, resubmitApprovalInstance as he, searchMembers as ge, uploadAttachment as _e } from "@rytass/bpm-core-client/workflow";
11
11
  import { CheckedIcon as ve, ChevronLeftIcon as ye, ChevronRightIcon as be, DangerousOutlineIcon as xe, DownloadIcon as Se, FileSearchIcon as Ce, RefreshCcwIcon as we, ShareIcon as Te, UserIcon as Ee, ZoomInIcon as De, ZoomOutIcon as Oe } from "@mezzanine-ui/icons";
12
12
  import ke from "@mezzanine-ui/react/ContentHeader";
13
13
  import { focusFormRendererField as Ae, validateFormRendererValues as je } from "@rytass/bpm-core-client/form";
14
- import { Background as Me, Controls as Ne, Handle as S, Position as C, ReactFlow as Pe } from "@xyflow/react";
15
- import * as w from "dagre";
16
- import { stepClasses as T } from "@mezzanine-ui/core/stepper";
17
- import { Document as E, Page as Fe } from "react-pdf";
18
- import '../detail.css';var D = {
14
+ import { Background as Me, Controls as Ne, Handle as x, Position as S, ReactFlow as Pe } from "@xyflow/react";
15
+ import * as C from "dagre";
16
+ import { stepClasses as w } from "@mezzanine-ui/core/stepper";
17
+ import { Document as T, Page as Fe } from "react-pdf";
18
+ import '../detail.css';var E = {
19
19
  root: "bpm_root_ehm7w",
20
20
  toolbar: "bpm_toolbar_R-tis",
21
21
  pageControls: "bpm_pageControls_jM-rC",
@@ -24,39 +24,39 @@ import '../detail.css';var D = {
24
24
  viewport: "bpm_viewport_DQXms",
25
25
  page: "bpm_page_Cv5Rg",
26
26
  state: "bpm_state_bpgp3"
27
- }, Ie = 760, Le = 920, Re = 320, ze = 32, O = .75, Be = 1.75, Ve = .25;
27
+ }, Ie = 760, Le = 920, Re = 320, ze = 32, D = .75, Be = 1.75, Ve = .25;
28
28
  function He({ filename: e, fileUrl: t, onDownload: n }) {
29
- let r = u(null), [i, a] = d(null), [o, f] = d(1), [m, h] = d(1), [ee, g] = d(Ie);
29
+ let r = u(null), [i, a] = d(null), [o, f] = d(1), [m, ee] = d(1), [h, te] = d(Ie);
30
30
  c(() => {
31
31
  let e = r.current;
32
32
  if (!e || typeof ResizeObserver > "u") return;
33
33
  let t = new ResizeObserver((e) => {
34
34
  let t = e[0]?.contentRect.width;
35
- t && g(t);
35
+ t && te(t);
36
36
  });
37
37
  return t.observe(e), () => t.disconnect();
38
38
  }, []), c(() => {
39
- a(null), f(1), h(1);
39
+ a(null), f(1), ee(1);
40
40
  }, [t]);
41
- let te = l(() => {
42
- let e = Math.max(Re, ee - ze);
41
+ let ne = l(() => {
42
+ let e = Math.max(Re, h - ze);
43
43
  return Math.round(Math.min(Le, e) * m);
44
- }, [m, ee]), ne = s((e) => {
44
+ }, [m, h]), re = s((e) => {
45
45
  a(e.numPages), f(1);
46
- }, []), re = o > 1, ie = i !== null && o < i, _ = m > O, ae = m < Be, oe = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, se = `${Math.round(m * 100)}%`;
47
- return /* @__PURE__ */ b("section", {
46
+ }, []), ie = o > 1, g = i !== null && o < i, ae = m > D, oe = m < Be, se = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, ce = `${Math.round(m * 100)}%`;
47
+ return /* @__PURE__ */ y("section", {
48
48
  "aria-label": `${e} PDF 預覽`,
49
- className: D.root,
50
- children: [/* @__PURE__ */ b("div", {
51
- className: D.toolbar,
49
+ className: E.root,
50
+ children: [/* @__PURE__ */ y("div", {
51
+ className: E.toolbar,
52
52
  children: [
53
- /* @__PURE__ */ b("div", {
54
- className: D.pageControls,
53
+ /* @__PURE__ */ y("div", {
54
+ className: E.pageControls,
55
55
  "aria-label": "頁面切換",
56
56
  children: [
57
- /* @__PURE__ */ y(p, {
57
+ /* @__PURE__ */ v(p, {
58
58
  "aria-label": "上一頁",
59
- disabled: !re,
59
+ disabled: !ie,
60
60
  icon: ye,
61
61
  onClick: () => {
62
62
  f((e) => Math.max(1, e - 1));
@@ -64,15 +64,15 @@ function He({ filename: e, fileUrl: t, onDownload: n }) {
64
64
  size: "minor",
65
65
  variant: "base-secondary"
66
66
  }),
67
- /* @__PURE__ */ y(v, {
68
- className: D.counter,
67
+ /* @__PURE__ */ v(_, {
68
+ className: E.counter,
69
69
  component: "span",
70
70
  variant: "body",
71
- children: oe
71
+ children: se
72
72
  }),
73
- /* @__PURE__ */ y(p, {
73
+ /* @__PURE__ */ v(p, {
74
74
  "aria-label": "下一頁",
75
- disabled: !ie,
75
+ disabled: !g,
76
76
  icon: be,
77
77
  onClick: () => {
78
78
  f((e) => i === null ? e : Math.min(i, e + 1));
@@ -82,39 +82,39 @@ function He({ filename: e, fileUrl: t, onDownload: n }) {
82
82
  })
83
83
  ]
84
84
  }),
85
- /* @__PURE__ */ b("div", {
86
- className: D.zoomControls,
85
+ /* @__PURE__ */ y("div", {
86
+ className: E.zoomControls,
87
87
  "aria-label": "縮放",
88
88
  children: [
89
- /* @__PURE__ */ y(p, {
89
+ /* @__PURE__ */ v(p, {
90
90
  "aria-label": "縮小",
91
- disabled: !_,
91
+ disabled: !ae,
92
92
  icon: Oe,
93
93
  onClick: () => {
94
- h((e) => Math.max(O, e - Ve));
94
+ ee((e) => Math.max(D, e - Ve));
95
95
  },
96
96
  size: "minor",
97
97
  variant: "base-secondary"
98
98
  }),
99
- /* @__PURE__ */ y(v, {
100
- className: D.counter,
99
+ /* @__PURE__ */ v(_, {
100
+ className: E.counter,
101
101
  component: "span",
102
102
  variant: "body",
103
- children: se
103
+ children: ce
104
104
  }),
105
- /* @__PURE__ */ y(p, {
105
+ /* @__PURE__ */ v(p, {
106
106
  "aria-label": "放大",
107
- disabled: !ae,
107
+ disabled: !oe,
108
108
  icon: De,
109
109
  onClick: () => {
110
- h((e) => Math.min(Be, e + Ve));
110
+ ee((e) => Math.min(Be, e + Ve));
111
111
  },
112
112
  size: "minor",
113
113
  variant: "base-secondary"
114
114
  })
115
115
  ]
116
116
  }),
117
- n ? /* @__PURE__ */ y(p, {
117
+ n ? /* @__PURE__ */ v(p, {
118
118
  icon: Se,
119
119
  iconType: "leading",
120
120
  onClick: n,
@@ -123,31 +123,31 @@ function He({ filename: e, fileUrl: t, onDownload: n }) {
123
123
  children: "下載"
124
124
  }) : null
125
125
  ]
126
- }), /* @__PURE__ */ y("div", {
127
- className: D.viewport,
126
+ }), /* @__PURE__ */ v("div", {
127
+ className: E.viewport,
128
128
  ref: r,
129
- children: /* @__PURE__ */ y(E, {
130
- error: /* @__PURE__ */ y(k, { message: "PDF 無法載入。" }),
129
+ children: /* @__PURE__ */ v(T, {
130
+ error: /* @__PURE__ */ v(O, { message: "PDF 無法載入。" }),
131
131
  file: t,
132
- loading: /* @__PURE__ */ y(k, { message: "正在載入 PDF..." }),
133
- noData: /* @__PURE__ */ y(k, { message: "沒有可預覽的 PDF。" }),
134
- onLoadSuccess: ne,
135
- children: /* @__PURE__ */ y(Fe, {
136
- className: D.page,
137
- loading: /* @__PURE__ */ y(k, { message: "正在載入頁面..." }),
132
+ loading: /* @__PURE__ */ v(O, { message: "正在載入 PDF..." }),
133
+ noData: /* @__PURE__ */ v(O, { message: "沒有可預覽的 PDF。" }),
134
+ onLoadSuccess: re,
135
+ children: /* @__PURE__ */ v(Fe, {
136
+ className: E.page,
137
+ loading: /* @__PURE__ */ v(O, { message: "正在載入頁面..." }),
138
138
  pageNumber: o,
139
139
  renderAnnotationLayer: !0,
140
140
  renderTextLayer: !0,
141
- width: te
141
+ width: ne
142
142
  })
143
143
  })
144
144
  })]
145
145
  });
146
146
  }
147
- function k({ message: e }) {
148
- return /* @__PURE__ */ y("div", {
149
- className: D.state,
150
- children: /* @__PURE__ */ y(v, {
147
+ function O({ message: e }) {
148
+ return /* @__PURE__ */ v("div", {
149
+ className: E.state,
150
+ children: /* @__PURE__ */ v(_, {
151
151
  color: "text-neutral",
152
152
  variant: "body",
153
153
  children: e
@@ -156,14 +156,14 @@ function k({ message: e }) {
156
156
  }
157
157
  //#endregion
158
158
  //#region src/views/instances/detail/InstanceDetailView.tsx
159
- var A = {
159
+ var k = {
160
160
  display: "grid",
161
161
  gap: 16
162
162
  }, Ue = {
163
163
  display: "flex",
164
164
  flexWrap: "wrap",
165
165
  gap: 8
166
- }, j = 184, We = 96, Ge = {
166
+ }, A = 184, We = 96, Ge = {
167
167
  display: "grid",
168
168
  gap: 16
169
169
  }, Ke = {
@@ -185,7 +185,7 @@ var A = {
185
185
  minHeight: 440,
186
186
  overflow: "hidden",
187
187
  width: "min(80vw, 1040px)"
188
- }, M = {
188
+ }, j = {
189
189
  background: "#ffffff",
190
190
  border: "1px solid #cbd5e1",
191
191
  borderRadius: 8,
@@ -224,7 +224,7 @@ var A = {
224
224
  gap: 6,
225
225
  lineHeight: "20px",
226
226
  padding: "4px 8px"
227
- }, N = {
227
+ }, M = {
228
228
  cursor: "help",
229
229
  textDecoration: "underline dotted",
230
230
  textUnderlineOffset: 3
@@ -233,38 +233,38 @@ function nt(e) {
233
233
  e && (e.style.width = "100%");
234
234
  }
235
235
  var rt = { workflowRuntime: Y };
236
- function P({ instanceId: a }) {
237
- let { member: o } = e(), s = o?.memberId ?? null, [u, ae] = d([]), [x, me] = d(null), [ye, be] = d([]), [De, Oe] = d([]), [S, C] = d([]), [w, T] = d(null), [E, Fe] = d([]), [D, Ie] = d([]), [Le, Re] = d([]), [ze, O] = d(null), [Be, Ve] = d(!0), [k, j] = d(!1), [We, M] = d(!1), [Xe, Ze] = d(""), [Qe, N] = d(!1), [tt, P] = d(""), [I, L] = d(null), [R, dt] = d(!1), [ft, z] = d(""), [B, V] = d(!1), [mt, H] = d(null), [ht, gt] = d(""), [_t, U] = d(null), [vt, yt] = d(!1), [bt, xt] = d([]), [St, Ct] = d(!1), [wt, Tt] = d({}), [W, Mt] = d({}), [G, K] = d(null), [Nt, Lt] = d(null), Rt = tt.trim(), zt = Xe.trim(), q = ft.trim(), Bt = ht.trim();
236
+ function N({ instanceId: a }) {
237
+ let { member: o } = e(), s = o?.memberId ?? null, [u, ae] = d([]), [b, me] = d(null), [ye, be] = d([]), [De, Oe] = d([]), [x, S] = d([]), [C, w] = d(null), [T, Fe] = d([]), [E, Ie] = d([]), [Le, Re] = d([]), [ze, D] = d(null), [Be, Ve] = d(!0), [O, A] = d(!1), [We, j] = d(!1), [Xe, Ze] = d(""), [Qe, M] = d(!1), [tt, N] = d(""), [F, I] = d(null), [L, dt] = d(!1), [ft, R] = d(""), [z, B] = d(!1), [mt, V] = d(null), [ht, H] = d(""), [gt, U] = d(null), [_t, vt] = d(!1), [yt, bt] = d([]), [xt, St] = d(!1), [Ct, wt] = d({}), [W, jt] = d({}), [G, K] = d(null), [Mt, It] = d(null), Lt = tt.trim(), Rt = Xe.trim(), q = ft.trim(), zt = ht.trim();
238
238
  c(() => {
239
- ln();
239
+ cn();
240
240
  }, [s, a]), c(() => {
241
- Mt(x?.formData ?? {});
242
- }, [x]);
243
- let J = l(() => E.find((e) => At(e, s) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [s, E]), Y = l(() => J && x ? x.workflowSnapshot.nodes.find((e) => e.id === J.nodeId) ?? null : null, [J, x]), X = l(() => Y && x ? Dt(x.workflowSnapshot, Y) : [], [Y, x]), Z = Y?.type === "userTask" && Y.data.returnBehavior.allowReturn, Wt = X.find((e) => e.id === mt) ?? X[0] ?? null, Gt = !!(x && x.initiatorMemberId === s && (x.state === "RUNNING" || x.state === "RETURNED")), Q = !!(x && x.initiatorMemberId === s && x.state === "RETURNED"), qt = l(() => new Map(Le.map((e) => [e.memberId, e])), [Le]), Jt = l(() => E.map((e) => ({
241
+ jt(b?.formData ?? {});
242
+ }, [b]);
243
+ let J = l(() => T.find((e) => kt(e, s) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [s, T]), Y = l(() => J && b ? b.workflowSnapshot.nodes.find((e) => e.id === J.nodeId) ?? null : null, [J, b]), X = l(() => Y && b ? Et(b.workflowSnapshot, Y) : [], [Y, b]), Z = Y?.type === "userTask" && Y.data.returnBehavior.allowReturn, Ut = X.find((e) => e.id === mt) ?? X[0] ?? null, Wt = !!(b && b.initiatorMemberId === s && (b.state === "RUNNING" || b.state === "RETURNED")), Q = !!(b && b.initiatorMemberId === s && b.state === "RETURNED"), Kt = l(() => new Map(Le.map((e) => [e.memberId, e])), [Le]), qt = l(() => T.map((e) => ({
244
244
  ...e,
245
- assigneeLabel: kt(e, qt),
245
+ assigneeLabel: Ot(e, Kt),
246
246
  key: e.id,
247
- nodeLabel: Et(e.nodeId, x?.workflowSnapshot ?? null),
248
- statusLabel: Ot(e.status)
247
+ nodeLabel: Tt(e.nodeId, b?.workflowSnapshot ?? null),
248
+ statusLabel: Dt(e.status)
249
249
  })), [
250
- x,
251
- qt,
252
- E
253
- ]), Yt = l(() => lt(ye), [ye]), Xt = l(() => new Map(S.map((e) => [e.id, e])), [S]), Zt = l(() => ut(u, E, D, x?.workflowSnapshot ?? null, x?.state ?? "RUNNING", qt, Yt, Xt, w), [
250
+ b,
251
+ Kt,
252
+ T
253
+ ]), Jt = l(() => lt(ye), [ye]), Yt = l(() => new Map(x.map((e) => [e.id, e])), [x]), Xt = l(() => ut(u, T, E, b?.workflowSnapshot ?? null, b?.state ?? "RUNNING", Kt, Jt, Yt, C), [
254
254
  u,
255
- x,
256
- qt,
257
- w,
258
- Xt,
255
+ b,
256
+ Kt,
257
+ C,
259
258
  Yt,
260
- E,
261
- D
262
- ]), Qt = l(() => pt(Zt), [Zt]), $ = l(() => x ? Ht(x.workflowSnapshot) : null, [x]), $t = l(() => x && $ ? Vt($, E, D, x.state) : [], [
263
- x,
259
+ Jt,
260
+ T,
261
+ E
262
+ ]), Zt = l(() => pt(Xt), [Xt]), $ = l(() => b ? Vt(b.workflowSnapshot) : null, [b]), Qt = l(() => b && $ ? Bt($, T, E, b.state) : [], [
263
+ b,
264
264
  $,
265
- E,
266
- D
267
- ]), en = l(() => $ ? Ut($) : [], [$]), tn = l(() => x ? Kt(x.workflowSnapshot) : [], [x]), nn = l(() => [
265
+ T,
266
+ E
267
+ ]), $t = l(() => $ ? Ht($) : [], [$]), en = l(() => b ? Gt(b.workflowSnapshot) : [], [b]), tn = l(() => [
268
268
  {
269
269
  dataIndex: "nodeLabel",
270
270
  key: "nodeLabel",
@@ -274,7 +274,7 @@ function P({ instanceId: a }) {
274
274
  {
275
275
  key: "assigneeMemberId",
276
276
  title: "處理者",
277
- render: (e) => /* @__PURE__ */ y(v, {
277
+ render: (e) => /* @__PURE__ */ v(_, {
278
278
  component: "span",
279
279
  variant: "body",
280
280
  children: e.assigneeLabel
@@ -289,7 +289,7 @@ function P({ instanceId: a }) {
289
289
  },
290
290
  {
291
291
  key: "createdAt",
292
- render: (e) => /* @__PURE__ */ y(v, {
292
+ render: (e) => /* @__PURE__ */ v(_, {
293
293
  component: "span",
294
294
  variant: "body",
295
295
  children: t(e.createdAt)
@@ -297,7 +297,7 @@ function P({ instanceId: a }) {
297
297
  title: "建立時間",
298
298
  width: 220
299
299
  }
300
- ], []), rn = l(() => De.map((e) => ({
300
+ ], []), nn = l(() => De.map((e) => ({
301
301
  attachment: e,
302
302
  createdAt: e.createdAt,
303
303
  filename: e.filename,
@@ -305,7 +305,7 @@ function P({ instanceId: a }) {
305
305
  key: e.id,
306
306
  mimeType: e.mimeType,
307
307
  sizeLabel: it(Number(e.sizeBytes))
308
- })), [De]), an = l(() => [
308
+ })), [De]), rn = l(() => [
309
309
  {
310
310
  dataIndex: "filename",
311
311
  key: "filename",
@@ -326,7 +326,7 @@ function P({ instanceId: a }) {
326
326
  },
327
327
  {
328
328
  key: "createdAt",
329
- render: (e) => /* @__PURE__ */ y(v, {
329
+ render: (e) => /* @__PURE__ */ v(_, {
330
330
  component: "span",
331
331
  variant: "body",
332
332
  children: t(e.createdAt)
@@ -334,32 +334,32 @@ function P({ instanceId: a }) {
334
334
  title: "上傳時間",
335
335
  width: 220
336
336
  }
337
- ], []), on = l(() => ({
337
+ ], []), an = l(() => ({
338
338
  render: (e) => [...e.mimeType === "application/pdf" ? [{
339
339
  icon: Ce,
340
340
  iconType: "leading",
341
341
  name: "預覽",
342
342
  onClick: () => {
343
- fn(e.attachment);
343
+ dn(e.attachment);
344
344
  }
345
345
  }] : [], {
346
346
  icon: Se,
347
347
  iconType: "leading",
348
348
  name: "下載",
349
349
  onClick: () => {
350
- dn(e.attachment);
350
+ un(e.attachment);
351
351
  }
352
352
  }],
353
353
  variant: "base-secondary",
354
354
  width: 160
355
- }), []), sn = l(() => S.map((e) => ({
355
+ }), []), on = l(() => x.map((e) => ({
356
356
  algorithm: e.algorithm,
357
357
  hashLabel: at(e.signedPayloadHash),
358
358
  key: e.id,
359
359
  keyVersion: e.keyVersion,
360
360
  signedAtLabel: t(e.signedAt),
361
361
  signerMemberId: e.signerMemberId
362
- })), [S]), cn = l(() => [
362
+ })), [x]), sn = l(() => [
363
363
  {
364
364
  dataIndex: "signerMemberId",
365
365
  key: "signerMemberId",
@@ -391,8 +391,8 @@ function P({ instanceId: a }) {
391
391
  width: 220
392
392
  }
393
393
  ], []);
394
- async function ln() {
395
- Ve(!0), O(null);
394
+ async function cn() {
395
+ Ve(!0), D(null);
396
396
  try {
397
397
  let e = await ue(a);
398
398
  ae(e.activityLogs), me(e.instance), Fe(e.tasks), Ie(e.workflowTokens);
@@ -402,33 +402,33 @@ function P({ instanceId: a }) {
402
402
  le(e.instance.id),
403
403
  pe(e.instance.id)
404
404
  ]);
405
- be(t), Re(n), Oe(r), C(i.signatures), T(i.verification);
405
+ be(t), Re(n), Oe(r), S(i.signatures), w(i.verification);
406
406
  } catch (e) {
407
- O(F(e));
407
+ D(P(e));
408
408
  } finally {
409
409
  Ve(!1);
410
410
  }
411
411
  }
412
- async function un(e, t) {
412
+ async function ln(e, t) {
413
413
  if (!s) throw Error("尚未登入,無法上傳附件");
414
414
  return { id: (await _e({
415
415
  file: t,
416
416
  formFieldPath: `form.${e.fieldKey}`
417
417
  })).id };
418
418
  }
419
- async function dn(e) {
419
+ async function un(e) {
420
420
  if (!s) return;
421
421
  let t = await de({ id: e.id });
422
422
  window.open(t, "_blank", "noopener,noreferrer");
423
423
  }
424
- async function fn(e) {
424
+ async function dn(e) {
425
425
  if (!s) return;
426
426
  let t = await fe({ id: e.id });
427
- K(e), Lt(t);
427
+ K(e), It(t);
428
428
  }
429
- async function pn({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: r = null }) {
429
+ async function fn({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: r = null }) {
430
430
  if (!(!s || !J)) {
431
- j(!0), O(null);
431
+ A(!0), D(null);
432
432
  try {
433
433
  await ce({
434
434
  action: e,
@@ -437,524 +437,527 @@ function P({ instanceId: a }) {
437
437
  returnToNodeId: n,
438
438
  taskId: J.id,
439
439
  transferToMemberId: r
440
- }), dt(!1), V(!1), Ct(!1), P(""), z(""), gt(""), U(null), H(null), L(null), await ln();
440
+ }), dt(!1), B(!1), St(!1), N(""), R(""), H(""), U(null), V(null), I(null), await cn();
441
441
  } catch (e) {
442
- O(F(e));
442
+ D(P(e));
443
443
  } finally {
444
- j(!1);
444
+ A(!1);
445
445
  }
446
446
  }
447
447
  }
448
+ function pn() {
449
+ N(""), I(null), dt(!0);
450
+ }
448
451
  function mn() {
449
- P(""), L(null), dt(!0);
452
+ O || (dt(!1), N(""), I(null));
450
453
  }
451
454
  function hn() {
452
- k || (dt(!1), P(""), L(null));
455
+ R(""), V(X[0]?.id ?? null), B(!0);
453
456
  }
454
457
  function gn() {
455
- z(""), H(X[0]?.id ?? null), V(!0);
458
+ O || (B(!1), R(""), V(null));
456
459
  }
457
460
  function _n() {
458
- k || (V(!1), z(""), H(null));
461
+ H(""), U(null), St(!0), yn("");
459
462
  }
460
463
  function vn() {
461
- gt(""), U(null), Ct(!0), bn("");
462
- }
463
- function yn() {
464
- k || (Ct(!1), gt(""), U(null));
464
+ O || (St(!1), H(""), U(null));
465
465
  }
466
- async function bn(e) {
467
- yt(!0);
466
+ async function yn(e) {
467
+ vt(!0);
468
468
  try {
469
- xt((await ge(e)).filter((e) => e.memberId !== s).map(Pt));
469
+ bt((await ge(e)).filter((e) => e.memberId !== s).map(Nt));
470
470
  } catch (e) {
471
- O(F(e));
471
+ D(P(e));
472
472
  } finally {
473
- yt(!1);
473
+ vt(!1);
474
474
  }
475
475
  }
476
- async function xn() {
477
- if (!Rt) {
478
- L("請輸入拒絕原因");
476
+ async function bn() {
477
+ if (!Lt) {
478
+ I("請輸入拒絕原因");
479
479
  return;
480
480
  }
481
- await pn({
481
+ await fn({
482
482
  action: "REJECTED",
483
- comment: Rt
483
+ comment: Lt
484
484
  });
485
485
  }
486
- async function Sn() {
487
- if (!_t) {
488
- O("請選擇轉派對象");
486
+ async function xn() {
487
+ if (!gt) {
488
+ D("請選擇轉派對象");
489
489
  return;
490
490
  }
491
- await pn({
491
+ await fn({
492
492
  action: "TRANSFERRED",
493
- comment: Bt || null,
494
- transferToMemberId: _t.id
493
+ comment: zt || null,
494
+ transferToMemberId: gt.id
495
495
  });
496
496
  }
497
- async function Cn() {
498
- await pn({
497
+ async function Sn() {
498
+ await fn({
499
499
  action: "RETURNED",
500
500
  comment: q || null,
501
- returnToNodeId: Wt?.id ?? null
501
+ returnToNodeId: Ut?.id ?? null
502
502
  });
503
503
  }
504
- async function wn() {
505
- if (!(!s || !x || !Gt)) {
506
- if (j(!0), O(null), Tt({}), x.formDefinitionSnapshot.schema && x.formDefinitionSnapshot.uiSchema) {
504
+ async function Cn() {
505
+ if (!(!s || !b || !Wt)) {
506
+ if (A(!0), D(null), wt({}), b.formDefinitionSnapshot.schema && b.formDefinitionSnapshot.uiSchema) {
507
507
  let e = je({
508
- schema: x.formDefinitionSnapshot.schema,
509
- uiSchema: x.formDefinitionSnapshot.uiSchema,
508
+ schema: b.formDefinitionSnapshot.schema,
509
+ uiSchema: b.formDefinitionSnapshot.uiSchema,
510
510
  values: W
511
511
  });
512
512
  if (!e.valid) {
513
- Tt(e.errors), O("請先補齊必填欄位。"), e.firstInvalidFieldKey && Ae(e.firstInvalidFieldKey), j(!1);
513
+ wt(e.errors), D("請先補齊必填欄位。"), e.firstInvalidFieldKey && Ae(e.firstInvalidFieldKey), A(!1);
514
514
  return;
515
515
  }
516
516
  }
517
517
  try {
518
518
  await se({
519
519
  cancelledByMemberId: s,
520
- comment: zt || null,
521
- instanceId: x.id
522
- }), Ze(""), N(!1), await ln();
520
+ comment: Rt || null,
521
+ instanceId: b.id
522
+ }), Ze(""), M(!1), await cn();
523
523
  } catch (e) {
524
- O(F(e));
524
+ D(P(e));
525
525
  } finally {
526
- j(!1);
526
+ A(!1);
527
527
  }
528
528
  }
529
529
  }
530
- async function Tn() {
531
- if (!(!s || !x || !Q)) {
532
- j(!0), O(null);
530
+ async function wn() {
531
+ if (!(!s || !b || !Q)) {
532
+ A(!0), D(null);
533
533
  try {
534
534
  await he({
535
535
  formData: W,
536
536
  initiatorMemberId: s,
537
- instanceId: x.id,
538
- title: x.title
539
- }), await ln();
537
+ instanceId: b.id,
538
+ title: b.title
539
+ }), await cn();
540
540
  } catch (e) {
541
- O(F(e));
541
+ D(P(e));
542
542
  } finally {
543
- j(!1);
543
+ A(!1);
544
544
  }
545
545
  }
546
546
  }
547
- return /* @__PURE__ */ b(m, { children: [/* @__PURE__ */ y(n, { activeHref: "/inbox" }), /* @__PURE__ */ b(m.Main, { children: [
548
- /* @__PURE__ */ y(ee, { children: /* @__PURE__ */ b(ke, {
549
- description: x ? `${jt(x.state)} · ${t(x.startedAt)}` : "載入案件內容。",
550
- title: x?.title ?? "簽核案件",
551
- children: [
552
- x ? /* @__PURE__ */ y(p, {
553
- "aria-label": "查看流程圖",
554
- icon: Te,
555
- iconType: "icon-only",
556
- onClick: () => M(!0),
557
- title: "查看流程圖",
558
- variant: "base-secondary",
559
- children: "流程圖"
560
- }) : null,
561
- Gt ? /* @__PURE__ */ y(p, {
562
- disabled: k,
563
- icon: xe,
564
- iconType: "leading",
565
- onClick: () => N(!0),
566
- variant: "destructive-secondary",
567
- children: "取消案件"
568
- }) : null,
569
- J ? /* @__PURE__ */ b(oe, { children: [
570
- Z ? /* @__PURE__ */ y(p, {
571
- disabled: k,
572
- icon: we,
573
- iconType: "leading",
574
- onClick: gn,
547
+ return /* @__PURE__ */ y(n, {
548
+ activeHref: "/inbox",
549
+ children: [
550
+ /* @__PURE__ */ v(ee, { children: /* @__PURE__ */ y(ke, {
551
+ description: b ? `${At(b.state)} · ${t(b.startedAt)}` : "載入案件內容。",
552
+ title: b?.title ?? "簽核案件",
553
+ children: [
554
+ b ? /* @__PURE__ */ v(p, {
555
+ "aria-label": "查看流程圖",
556
+ icon: Te,
557
+ iconType: "icon-only",
558
+ onClick: () => j(!0),
559
+ title: "查看流程圖",
575
560
  variant: "base-secondary",
576
- children: "退回"
561
+ children: "流程圖"
577
562
  }) : null,
578
- /* @__PURE__ */ y(p, {
579
- disabled: k,
580
- icon: Ee,
581
- iconType: "leading",
582
- onClick: vn,
583
- variant: "base-secondary",
584
- children: "轉派"
585
- }),
586
- /* @__PURE__ */ y(p, {
587
- disabled: k,
563
+ Wt ? /* @__PURE__ */ v(p, {
564
+ disabled: O,
588
565
  icon: xe,
589
566
  iconType: "leading",
590
- onClick: mn,
567
+ onClick: () => M(!0),
591
568
  variant: "destructive-secondary",
592
- children: "拒絕"
593
- }),
594
- /* @__PURE__ */ y(p, {
595
- disabled: k,
596
- icon: ve,
597
- iconType: "leading",
598
- onClick: () => void pn({
599
- action: "APPROVED",
600
- comment: null
601
- }),
602
- variant: "base-primary",
603
- children: "同意"
604
- })
605
- ] }) : null
606
- ]
607
- }) }),
608
- /* @__PURE__ */ b(te, { children: [
609
- /* @__PURE__ */ y(g, { children: /* @__PURE__ */ b("div", {
610
- style: A,
611
- children: [
612
- ze ? /* @__PURE__ */ y(v, {
613
- color: "text-error",
614
- variant: "body",
615
- children: ze
616
- }) : null,
617
- Be ? /* @__PURE__ */ y(v, {
618
- color: "text-neutral",
619
- variant: "body",
620
- children: "載入中..."
569
+ children: "取消案件"
621
570
  }) : null,
622
- x?.formDefinitionSnapshot.schema && x.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ b(oe, { children: [/* @__PURE__ */ y(i, {
623
- errors: wt,
624
- onChange: (e) => {
625
- Mt(e), Tt({});
626
- },
627
- onUploadAttachment: Q ? un : void 0,
628
- readonly: !Q,
629
- schema: x.formDefinitionSnapshot.schema,
630
- uiSchema: x.formDefinitionSnapshot.uiSchema,
631
- value: Q ? W : x.formData
632
- }), Q ? /* @__PURE__ */ y("div", {
633
- style: Ue,
634
- children: /* @__PURE__ */ y(p, {
635
- disabled: k,
571
+ J ? /* @__PURE__ */ y(oe, { children: [
572
+ Z ? /* @__PURE__ */ v(p, {
573
+ disabled: O,
636
574
  icon: we,
637
575
  iconType: "leading",
638
- onClick: () => void Tn(),
576
+ onClick: hn,
577
+ variant: "base-secondary",
578
+ children: "退回"
579
+ }) : null,
580
+ /* @__PURE__ */ v(p, {
581
+ disabled: O,
582
+ icon: Ee,
583
+ iconType: "leading",
584
+ onClick: _n,
585
+ variant: "base-secondary",
586
+ children: "轉派"
587
+ }),
588
+ /* @__PURE__ */ v(p, {
589
+ disabled: O,
590
+ icon: xe,
591
+ iconType: "leading",
592
+ onClick: pn,
593
+ variant: "destructive-secondary",
594
+ children: "拒絕"
595
+ }),
596
+ /* @__PURE__ */ v(p, {
597
+ disabled: O,
598
+ icon: ve,
599
+ iconType: "leading",
600
+ onClick: () => void fn({
601
+ action: "APPROVED",
602
+ comment: null
603
+ }),
639
604
  variant: "base-primary",
640
- children: "重新送出"
605
+ children: "同意"
641
606
  })
642
- }) : null] }) : /* @__PURE__ */ y(v, {
643
- color: "text-neutral",
644
- variant: "body",
645
- children: "此案件沒有可顯示的表單快照。"
646
- })
607
+ ] }) : null
647
608
  ]
648
609
  }) }),
649
- /* @__PURE__ */ y(g, { children: /* @__PURE__ */ b("div", {
650
- style: A,
651
- children: [/* @__PURE__ */ y(v, {
652
- component: "h2",
653
- variant: "h3",
654
- children: "附件"
655
- }), rn.length > 0 ? /* @__PURE__ */ y(ie, {
656
- actions: on,
657
- columns: an,
658
- dataSource: rn,
659
- fullWidth: !0
660
- }) : /* @__PURE__ */ y(v, {
661
- color: "text-neutral",
662
- variant: "body",
663
- children: "此案件沒有附件。"
664
- })]
665
- }) }),
666
- /* @__PURE__ */ b(g, { children: [/* @__PURE__ */ y(v, {
667
- component: "h2",
668
- variant: "h3",
669
- children: "任務"
670
- }), /* @__PURE__ */ y(ie, {
671
- columns: nn,
672
- dataSource: Jt,
673
- fullWidth: !0
674
- })] }),
675
- /* @__PURE__ */ y(g, { children: /* @__PURE__ */ b("div", {
676
- style: A,
677
- children: [
678
- /* @__PURE__ */ y(v, {
610
+ /* @__PURE__ */ y(te, { children: [
611
+ /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y("div", {
612
+ style: k,
613
+ children: [
614
+ ze ? /* @__PURE__ */ v(_, {
615
+ color: "text-error",
616
+ variant: "body",
617
+ children: ze
618
+ }) : null,
619
+ Be ? /* @__PURE__ */ v(_, {
620
+ color: "text-neutral",
621
+ variant: "body",
622
+ children: "載入中..."
623
+ }) : null,
624
+ b?.formDefinitionSnapshot.schema && b.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ y(oe, { children: [/* @__PURE__ */ v(i, {
625
+ errors: Ct,
626
+ onChange: (e) => {
627
+ jt(e), wt({});
628
+ },
629
+ onUploadAttachment: Q ? ln : void 0,
630
+ readonly: !Q,
631
+ schema: b.formDefinitionSnapshot.schema,
632
+ uiSchema: b.formDefinitionSnapshot.uiSchema,
633
+ value: Q ? W : b.formData
634
+ }), Q ? /* @__PURE__ */ v("div", {
635
+ style: Ue,
636
+ children: /* @__PURE__ */ v(p, {
637
+ disabled: O,
638
+ icon: we,
639
+ iconType: "leading",
640
+ onClick: () => void wn(),
641
+ variant: "base-primary",
642
+ children: "重新送出"
643
+ })
644
+ }) : null] }) : /* @__PURE__ */ v(_, {
645
+ color: "text-neutral",
646
+ variant: "body",
647
+ children: "此案件沒有可顯示的表單快照。"
648
+ })
649
+ ]
650
+ }) }),
651
+ /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y("div", {
652
+ style: k,
653
+ children: [/* @__PURE__ */ v(_, {
679
654
  component: "h2",
680
655
  variant: "h3",
681
- children: "簽章"
682
- }),
683
- /* @__PURE__ */ y(v, {
684
- color: w?.valid ? "text-success" : "text-error",
685
- variant: "body",
686
- children: w ? w.valid ? `簽章鏈已驗證,共 ${w.checkedCount} 筆。` : `簽章鏈驗證失敗:${w.errors.join("、")}` : "尚無簽章紀錄。"
687
- }),
688
- sn.length > 0 ? /* @__PURE__ */ y(ie, {
689
- columns: cn,
690
- dataSource: sn,
656
+ children: "附件"
657
+ }), nn.length > 0 ? /* @__PURE__ */ v(ie, {
658
+ actions: an,
659
+ columns: rn,
660
+ dataSource: nn,
691
661
  fullWidth: !0
692
- }) : null
693
- ]
694
- }) }),
695
- /* @__PURE__ */ y(g, { children: /* @__PURE__ */ b("div", {
696
- style: A,
697
- children: [/* @__PURE__ */ y(v, {
662
+ }) : /* @__PURE__ */ v(_, {
663
+ color: "text-neutral",
664
+ variant: "body",
665
+ children: "此案件沒有附件。"
666
+ })]
667
+ }) }),
668
+ /* @__PURE__ */ y(h, { children: [/* @__PURE__ */ v(_, {
698
669
  component: "h2",
699
670
  variant: "h3",
700
- children: "歷程"
701
- }), Zt.length > 0 ? /* @__PURE__ */ y(re, {
702
- currentStep: Qt,
703
- orientation: "vertical",
704
- type: "dot",
705
- children: Zt.map((e) => /* @__PURE__ */ y(ot, {
706
- descriptionParts: e.descriptionParts,
707
- error: e.error,
708
- forcePending: e.forcePending,
709
- title: e.title
710
- }, e.id))
711
- }) : /* @__PURE__ */ y(v, {
712
- color: "text-neutral",
713
- variant: "body",
714
- children: "尚無歷程紀錄。"
715
- })]
716
- }) })
717
- ] }),
718
- x ? /* @__PURE__ */ y(h, {
719
- modalType: "standard",
720
- onClose: () => M(!1),
721
- open: We,
722
- showModalHeader: !0,
723
- size: "wide",
724
- supportingText: `${jt(x.state)} · ${t(x.startedAt)}`,
725
- title: "流程圖",
726
- children: /* @__PURE__ */ b("div", {
727
- style: Ge,
728
- children: [/* @__PURE__ */ y("div", {
729
- style: Ye,
730
- children: /* @__PURE__ */ b(Pe, {
731
- edges: en,
732
- fitView: !0,
733
- fitViewOptions: { padding: .18 },
734
- maxZoom: 1.2,
735
- minZoom: .2,
736
- nodes: $t,
737
- nodesDraggable: !1,
738
- nodesFocusable: !1,
739
- nodeTypes: rt,
740
- panOnDrag: !0,
741
- proOptions: { hideAttribution: !0 },
742
- children: [/* @__PURE__ */ y(Me, {}), /* @__PURE__ */ y(Ne, { showInteractive: !1 })]
743
- })
744
- }), tn.length > 0 ? /* @__PURE__ */ y("div", {
745
- style: $e,
746
- children: tn.map((e) => /* @__PURE__ */ y("span", {
747
- style: et,
748
- children: e
749
- }, e))
750
- }) : null]
751
- })
752
- }) : null,
753
- /* @__PURE__ */ y(h, {
754
- modalType: "standard",
755
- onClose: () => {
756
- K(null), Lt(null);
757
- },
758
- open: !!(G && Nt),
759
- showModalHeader: !0,
760
- size: "wide",
761
- supportingText: G?.filename ?? void 0,
762
- title: "PDF 預覽",
763
- children: Nt ? /* @__PURE__ */ y(He, {
764
- filename: G?.filename ?? "PDF 預覽",
765
- fileUrl: Nt,
766
- onDownload: G ? () => void dn(G) : void 0
767
- }) : null
768
- }),
769
- /* @__PURE__ */ y(h, {
770
- cancelText: "保留案件",
771
- confirmButtonProps: { variant: "destructive-primary" },
772
- confirmText: "確認取消",
773
- loading: k,
774
- modalStatusType: "error",
775
- modalType: "standard",
776
- onCancel: () => N(!1),
777
- onClose: () => N(!1),
778
- onConfirm: () => void wn(),
779
- open: Qe,
780
- showModalFooter: !0,
781
- showModalHeader: !0,
782
- supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
783
- title: "取消案件",
784
- children: /* @__PURE__ */ b("div", {
785
- style: A,
786
- children: [/* @__PURE__ */ b(v, {
787
- variant: "body",
671
+ children: "任務"
672
+ }), /* @__PURE__ */ v(ie, {
673
+ columns: tn,
674
+ dataSource: qt,
675
+ fullWidth: !0
676
+ })] }),
677
+ /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y("div", {
678
+ style: k,
788
679
  children: [
789
- "確定要取消「",
790
- x?.title ?? "",
791
- "」嗎?"
680
+ /* @__PURE__ */ v(_, {
681
+ component: "h2",
682
+ variant: "h3",
683
+ children: "簽章"
684
+ }),
685
+ /* @__PURE__ */ v(_, {
686
+ color: C?.valid ? "text-success" : "text-error",
687
+ variant: "body",
688
+ children: C ? C.valid ? `簽章鏈已驗證,共 ${C.checkedCount} 筆。` : `簽章鏈驗證失敗:${C.errors.join("、")}` : "尚無簽章紀錄。"
689
+ }),
690
+ on.length > 0 ? /* @__PURE__ */ v(ie, {
691
+ columns: sn,
692
+ dataSource: on,
693
+ fullWidth: !0
694
+ }) : null
792
695
  ]
793
- }), /* @__PURE__ */ y(r, {
794
- label: "取消原因",
795
- name: "cancelComment",
796
- children: /* @__PURE__ */ y(_, {
797
- onChange: (e) => Ze(e.target.value),
798
- placeholder: "可填寫取消原因",
799
- resize: "vertical",
800
- rows: 3,
801
- value: Xe
802
- })
803
- })]
804
- })
805
- }),
806
- /* @__PURE__ */ y(h, {
807
- cancelText: "取消",
808
- confirmButtonProps: {
809
- disabled: !Rt,
810
- variant: "destructive-primary"
811
- },
812
- confirmText: "送出拒絕",
813
- loading: k,
814
- modalStatusType: "error",
815
- modalType: "standard",
816
- onCancel: hn,
817
- onClose: hn,
818
- onConfirm: () => void xn(),
819
- open: R,
820
- showModalFooter: !0,
821
- showModalHeader: !0,
822
- size: "regular",
823
- supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
824
- title: "拒絕原因",
825
- children: /* @__PURE__ */ b("div", {
826
- style: Ke,
827
- children: [/* @__PURE__ */ y(r, {
828
- label: "拒絕原因",
829
- name: "rejectReason",
830
- required: !0,
831
- children: /* @__PURE__ */ y(_, {
832
- autoFocus: !0,
833
- onChange: (e) => {
834
- P(e.target.value), L(null);
835
- },
836
- placeholder: "請說明拒絕原因",
837
- ref: nt,
838
- resize: "vertical",
839
- rows: 4,
840
- style: qe,
841
- type: I ? "error" : "default",
842
- value: tt
843
- })
844
- }), I ? /* @__PURE__ */ y(v, {
845
- color: "text-error",
846
- variant: "body",
847
- children: I
848
- }) : null]
849
- })
850
- }),
851
- /* @__PURE__ */ y(h, {
852
- cancelText: "取消",
853
- confirmButtonProps: { disabled: !_t },
854
- confirmText: "送出轉派",
855
- loading: k,
856
- modalType: "standard",
857
- onCancel: yn,
858
- onClose: yn,
859
- onConfirm: () => void Sn(),
860
- open: St,
861
- showModalFooter: !0,
862
- showModalHeader: !0,
863
- size: "regular",
864
- supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
865
- title: "轉派簽核",
866
- children: /* @__PURE__ */ b("div", {
867
- style: Je,
868
- children: [/* @__PURE__ */ y(r, {
869
- label: "轉派對象",
870
- name: "transferToMemberId",
871
- required: !0,
872
- children: /* @__PURE__ */ y(f, {
873
- asyncData: !0,
874
- disabledOptionsFilter: !0,
875
- emptyText: "沒有符合的成員",
876
- inputProps: {
877
- autoCapitalize: "none",
878
- autoCorrect: "off",
879
- name: "transfer-member-search",
880
- spellCheck: !1
881
- },
882
- loading: vt,
883
- loadingText: "搜尋成員中...",
884
- mode: "single",
885
- onChange: (e) => U(Ft(e)),
886
- onSearch: bn,
887
- onSearchTextChange: (e) => U(It(e, bt)),
888
- onVisibilityChange: (e) => {
889
- e && bn("");
890
- },
891
- options: [...bt],
892
- placeholder: "搜尋姓名或信箱",
893
- searchDebounceTime: 300,
894
- value: _t
895
- })
896
- }), /* @__PURE__ */ y(r, {
897
- label: "轉派說明",
898
- name: "transferComment",
899
- children: /* @__PURE__ */ y(_, {
900
- onChange: (e) => gt(e.target.value),
901
- placeholder: "可補充轉派原因",
902
- ref: nt,
903
- resize: "vertical",
904
- rows: 4,
905
- style: qe,
906
- value: ht
907
- })
908
- })]
909
- })
910
- }),
911
- /* @__PURE__ */ y(h, {
912
- cancelText: "取消",
913
- confirmButtonProps: { disabled: !Wt },
914
- confirmText: "送出退回",
915
- loading: k,
916
- modalType: "standard",
917
- onCancel: _n,
918
- onClose: _n,
919
- onConfirm: () => void Cn(),
920
- open: B,
921
- showModalFooter: !0,
922
- showModalHeader: !0,
923
- size: "regular",
924
- supportingText: "退回後,流程會回到指定節點並等待重新處理。",
925
- title: "退回簽核",
926
- children: /* @__PURE__ */ b("div", {
927
- style: Je,
928
- children: [/* @__PURE__ */ y(r, {
929
- label: "退回節點",
930
- name: "returnTargetNodeId",
931
- required: !0,
932
- children: /* @__PURE__ */ y(ne, {
933
- clearable: !1,
934
- fullWidth: !0,
935
- onChange: (e) => H(e?.id ?? null),
936
- options: [...X],
937
- placeholder: "選擇退回節點",
938
- value: Wt
939
- })
940
- }), /* @__PURE__ */ y(r, {
941
- label: "退回說明",
942
- name: "returnComment",
943
- children: /* @__PURE__ */ y(_, {
944
- onChange: (e) => z(e.target.value),
945
- placeholder: "可補充需要修改的內容",
946
- ref: nt,
947
- resize: "vertical",
948
- rows: 4,
949
- style: qe,
950
- value: ft
951
- })
952
- })]
696
+ }) }),
697
+ /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y("div", {
698
+ style: k,
699
+ children: [/* @__PURE__ */ v(_, {
700
+ component: "h2",
701
+ variant: "h3",
702
+ children: "歷程"
703
+ }), Xt.length > 0 ? /* @__PURE__ */ v(re, {
704
+ currentStep: Zt,
705
+ orientation: "vertical",
706
+ type: "dot",
707
+ children: Xt.map((e) => /* @__PURE__ */ v(ot, {
708
+ descriptionParts: e.descriptionParts,
709
+ error: e.error,
710
+ forcePending: e.forcePending,
711
+ title: e.title
712
+ }, e.id))
713
+ }) : /* @__PURE__ */ v(_, {
714
+ color: "text-neutral",
715
+ variant: "body",
716
+ children: "尚無歷程紀錄。"
717
+ })]
718
+ }) })
719
+ ] }),
720
+ b ? /* @__PURE__ */ v(m, {
721
+ modalType: "standard",
722
+ onClose: () => j(!1),
723
+ open: We,
724
+ showModalHeader: !0,
725
+ size: "wide",
726
+ supportingText: `${At(b.state)} · ${t(b.startedAt)}`,
727
+ title: "流程圖",
728
+ children: /* @__PURE__ */ y("div", {
729
+ style: Ge,
730
+ children: [/* @__PURE__ */ v("div", {
731
+ style: Ye,
732
+ children: /* @__PURE__ */ y(Pe, {
733
+ edges: $t,
734
+ fitView: !0,
735
+ fitViewOptions: { padding: .18 },
736
+ maxZoom: 1.2,
737
+ minZoom: .2,
738
+ nodes: Qt,
739
+ nodesDraggable: !1,
740
+ nodesFocusable: !1,
741
+ nodeTypes: rt,
742
+ panOnDrag: !0,
743
+ proOptions: { hideAttribution: !0 },
744
+ children: [/* @__PURE__ */ v(Me, {}), /* @__PURE__ */ v(Ne, { showInteractive: !1 })]
745
+ })
746
+ }), en.length > 0 ? /* @__PURE__ */ v("div", {
747
+ style: $e,
748
+ children: en.map((e) => /* @__PURE__ */ v("span", {
749
+ style: et,
750
+ children: e
751
+ }, e))
752
+ }) : null]
753
+ })
754
+ }) : null,
755
+ /* @__PURE__ */ v(m, {
756
+ modalType: "standard",
757
+ onClose: () => {
758
+ K(null), It(null);
759
+ },
760
+ open: !!(G && Mt),
761
+ showModalHeader: !0,
762
+ size: "wide",
763
+ supportingText: G?.filename ?? void 0,
764
+ title: "PDF 預覽",
765
+ children: Mt ? /* @__PURE__ */ v(He, {
766
+ filename: G?.filename ?? "PDF 預覽",
767
+ fileUrl: Mt,
768
+ onDownload: G ? () => void un(G) : void 0
769
+ }) : null
770
+ }),
771
+ /* @__PURE__ */ v(m, {
772
+ cancelText: "保留案件",
773
+ confirmButtonProps: { variant: "destructive-primary" },
774
+ confirmText: "確認取消",
775
+ loading: O,
776
+ modalStatusType: "error",
777
+ modalType: "standard",
778
+ onCancel: () => M(!1),
779
+ onClose: () => M(!1),
780
+ onConfirm: () => void Cn(),
781
+ open: Qe,
782
+ showModalFooter: !0,
783
+ showModalHeader: !0,
784
+ supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
785
+ title: "取消案件",
786
+ children: /* @__PURE__ */ y("div", {
787
+ style: k,
788
+ children: [/* @__PURE__ */ y(_, {
789
+ variant: "body",
790
+ children: [
791
+ "確定要取消「",
792
+ b?.title ?? "",
793
+ "」嗎?"
794
+ ]
795
+ }), /* @__PURE__ */ v(r, {
796
+ label: "取消原因",
797
+ name: "cancelComment",
798
+ children: /* @__PURE__ */ v(g, {
799
+ onChange: (e) => Ze(e.target.value),
800
+ placeholder: "可填寫取消原因",
801
+ resize: "vertical",
802
+ rows: 3,
803
+ value: Xe
804
+ })
805
+ })]
806
+ })
807
+ }),
808
+ /* @__PURE__ */ v(m, {
809
+ cancelText: "取消",
810
+ confirmButtonProps: {
811
+ disabled: !Lt,
812
+ variant: "destructive-primary"
813
+ },
814
+ confirmText: "送出拒絕",
815
+ loading: O,
816
+ modalStatusType: "error",
817
+ modalType: "standard",
818
+ onCancel: mn,
819
+ onClose: mn,
820
+ onConfirm: () => void bn(),
821
+ open: L,
822
+ showModalFooter: !0,
823
+ showModalHeader: !0,
824
+ size: "regular",
825
+ supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
826
+ title: "拒絕原因",
827
+ children: /* @__PURE__ */ y("div", {
828
+ style: Ke,
829
+ children: [/* @__PURE__ */ v(r, {
830
+ label: "拒絕原因",
831
+ name: "rejectReason",
832
+ required: !0,
833
+ children: /* @__PURE__ */ v(g, {
834
+ autoFocus: !0,
835
+ onChange: (e) => {
836
+ N(e.target.value), I(null);
837
+ },
838
+ placeholder: "請說明拒絕原因",
839
+ ref: nt,
840
+ resize: "vertical",
841
+ rows: 4,
842
+ style: qe,
843
+ type: F ? "error" : "default",
844
+ value: tt
845
+ })
846
+ }), F ? /* @__PURE__ */ v(_, {
847
+ color: "text-error",
848
+ variant: "body",
849
+ children: F
850
+ }) : null]
851
+ })
852
+ }),
853
+ /* @__PURE__ */ v(m, {
854
+ cancelText: "取消",
855
+ confirmButtonProps: { disabled: !gt },
856
+ confirmText: "送出轉派",
857
+ loading: O,
858
+ modalType: "standard",
859
+ onCancel: vn,
860
+ onClose: vn,
861
+ onConfirm: () => void xn(),
862
+ open: xt,
863
+ showModalFooter: !0,
864
+ showModalHeader: !0,
865
+ size: "regular",
866
+ supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
867
+ title: "轉派簽核",
868
+ children: /* @__PURE__ */ y("div", {
869
+ style: Je,
870
+ children: [/* @__PURE__ */ v(r, {
871
+ label: "轉派對象",
872
+ name: "transferToMemberId",
873
+ required: !0,
874
+ children: /* @__PURE__ */ v(f, {
875
+ asyncData: !0,
876
+ disabledOptionsFilter: !0,
877
+ emptyText: "沒有符合的成員",
878
+ inputProps: {
879
+ autoCapitalize: "none",
880
+ autoCorrect: "off",
881
+ name: "transfer-member-search",
882
+ spellCheck: !1
883
+ },
884
+ loading: _t,
885
+ loadingText: "搜尋成員中...",
886
+ mode: "single",
887
+ onChange: (e) => U(Pt(e)),
888
+ onSearch: yn,
889
+ onSearchTextChange: (e) => U(Ft(e, yt)),
890
+ onVisibilityChange: (e) => {
891
+ e && yn("");
892
+ },
893
+ options: [...yt],
894
+ placeholder: "搜尋姓名或信箱",
895
+ searchDebounceTime: 300,
896
+ value: gt
897
+ })
898
+ }), /* @__PURE__ */ v(r, {
899
+ label: "轉派說明",
900
+ name: "transferComment",
901
+ children: /* @__PURE__ */ v(g, {
902
+ onChange: (e) => H(e.target.value),
903
+ placeholder: "可補充轉派原因",
904
+ ref: nt,
905
+ resize: "vertical",
906
+ rows: 4,
907
+ style: qe,
908
+ value: ht
909
+ })
910
+ })]
911
+ })
912
+ }),
913
+ /* @__PURE__ */ v(m, {
914
+ cancelText: "取消",
915
+ confirmButtonProps: { disabled: !Ut },
916
+ confirmText: "送出退回",
917
+ loading: O,
918
+ modalType: "standard",
919
+ onCancel: gn,
920
+ onClose: gn,
921
+ onConfirm: () => void Sn(),
922
+ open: z,
923
+ showModalFooter: !0,
924
+ showModalHeader: !0,
925
+ size: "regular",
926
+ supportingText: "退回後,流程會回到指定節點並等待重新處理。",
927
+ title: "退回簽核",
928
+ children: /* @__PURE__ */ y("div", {
929
+ style: Je,
930
+ children: [/* @__PURE__ */ v(r, {
931
+ label: "退回節點",
932
+ name: "returnTargetNodeId",
933
+ required: !0,
934
+ children: /* @__PURE__ */ v(ne, {
935
+ clearable: !1,
936
+ fullWidth: !0,
937
+ onChange: (e) => V(e?.id ?? null),
938
+ options: [...X],
939
+ placeholder: "選擇退回節點",
940
+ value: Ut
941
+ })
942
+ }), /* @__PURE__ */ v(r, {
943
+ label: "退回說明",
944
+ name: "returnComment",
945
+ children: /* @__PURE__ */ v(g, {
946
+ onChange: (e) => R(e.target.value),
947
+ placeholder: "可補充需要修改的內容",
948
+ ref: nt,
949
+ resize: "vertical",
950
+ rows: 4,
951
+ style: qe,
952
+ value: ft
953
+ })
954
+ })]
955
+ })
953
956
  })
954
- })
955
- ] })] });
957
+ ]
958
+ });
956
959
  }
957
- function F(e) {
960
+ function P(e) {
958
961
  return e instanceof Error ? e.message : "發生未知錯誤";
959
962
  }
960
963
  function it(e) {
@@ -963,47 +966,47 @@ function it(e) {
963
966
  function at(e) {
964
967
  return e.length > 16 ? `${e.slice(0, 12)}...` : e;
965
968
  }
966
- function I(...e) {
969
+ function F(...e) {
967
970
  return e.filter((e) => q(e ?? null)).join(" ");
968
971
  }
969
972
  var ot = 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) {
970
973
  let f = r ? "pending" : s;
971
- return /* @__PURE__ */ b("div", {
974
+ return /* @__PURE__ */ y("div", {
972
975
  ...u,
973
- className: I(T.host, l === "dot" ? T.dot : null, n && f !== "processing" ? T.error : null, o === "horizontal" ? T.horizontal : null, l === "number" ? T.number : null, f === "pending" ? T.pending : null, f === "processing" ? T.processing : null, n && f === "processing" ? T.processingError : null, !n && f === "succeeded" ? T.succeeded : null, o === "vertical" ? T.vertical : null, e),
976
+ className: F(w.host, l === "dot" ? w.dot : null, n && f !== "processing" ? w.error : null, o === "horizontal" ? w.horizontal : null, l === "number" ? w.number : null, f === "pending" ? w.pending : null, f === "processing" ? w.processing : null, n && f === "processing" ? w.processingError : null, !n && f === "succeeded" ? w.succeeded : null, o === "vertical" ? w.vertical : null, e),
974
977
  ref: d,
975
- children: [l === "dot" ? /* @__PURE__ */ y("span", { className: I(T.statusIndicator, T.statusIndicatorDot) }) : /* @__PURE__ */ y("span", {
976
- className: T.statusIndicator,
978
+ children: [l === "dot" ? /* @__PURE__ */ v("span", { className: F(w.statusIndicator, w.statusIndicatorDot) }) : /* @__PURE__ */ v("span", {
979
+ className: w.statusIndicator,
977
980
  children: i + 1
978
- }), /* @__PURE__ */ b("div", {
979
- className: T.textContainer,
980
- children: [/* @__PURE__ */ b(v, {
981
- className: T.title,
981
+ }), /* @__PURE__ */ y("div", {
982
+ className: w.textContainer,
983
+ children: [/* @__PURE__ */ y(_, {
984
+ className: w.title,
982
985
  variant: "label-primary-highlight",
983
- children: [c, /* @__PURE__ */ y("span", { className: T.titleConnectLine })]
984
- }), t.length > 0 ? /* @__PURE__ */ y(v, {
985
- className: T.description,
986
+ children: [c, /* @__PURE__ */ v("span", { className: w.titleConnectLine })]
987
+ }), t.length > 0 ? /* @__PURE__ */ v(_, {
988
+ className: w.description,
986
989
  variant: "caption",
987
- children: t.map((e, t) => /* @__PURE__ */ b(a, { children: [t > 0 ? " · " : null, L(e)] }, `${e.type}-${t}`))
990
+ children: t.map((e, t) => /* @__PURE__ */ y(a, { children: [t > 0 ? " · " : null, I(e)] }, `${e.type}-${t}`))
988
991
  }) : null]
989
992
  })]
990
993
  });
991
994
  });
992
- function L(e) {
993
- return e.type === "text" ? e.text : e.type === "dangerText" ? /* @__PURE__ */ y("span", {
995
+ function I(e) {
996
+ return e.type === "text" ? e.text : e.type === "dangerText" ? /* @__PURE__ */ v("span", {
994
997
  style: tt,
995
998
  children: e.text
996
- }) : e.email ? /* @__PURE__ */ b(oe, { children: [
999
+ }) : e.email ? /* @__PURE__ */ y(oe, { children: [
997
1000
  e.prefix,
998
1001
  ":",
999
- /* @__PURE__ */ y(ae, {
1002
+ /* @__PURE__ */ v(ae, {
1000
1003
  title: e.email,
1001
- children: ({ onMouseEnter: t, onMouseLeave: n, ref: r }) => /* @__PURE__ */ y("span", {
1004
+ children: ({ onMouseEnter: t, onMouseLeave: n, ref: r }) => /* @__PURE__ */ v("span", {
1002
1005
  "data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
1003
1006
  onMouseEnter: t,
1004
1007
  onMouseLeave: n,
1005
1008
  ref: r,
1006
- style: N,
1009
+ style: M,
1007
1010
  children: e.label
1008
1011
  })
1009
1012
  })
@@ -1015,7 +1018,7 @@ async function st({ activityLogs: e, tasks: t }) {
1015
1018
  ...t.map((e) => e.assigneeMemberId),
1016
1019
  ...t.map((e) => e.originalAssigneeMemberId),
1017
1020
  ...t.flatMap((e) => e.candidateMemberIds),
1018
- ...t.flatMap((e) => Lt(e.delegationChainJson).flatMap((e) => [e.from, e.to]))
1021
+ ...t.flatMap((e) => It(e.delegationChainJson).flatMap((e) => [e.from, e.to]))
1019
1022
  ].filter(q))];
1020
1023
  try {
1021
1024
  return await me(n);
@@ -1024,7 +1027,7 @@ async function st({ activityLogs: e, tasks: t }) {
1024
1027
  }
1025
1028
  }
1026
1029
  async function ct(e) {
1027
- return (await Promise.all(e.map((e) => x(e.id)))).flat();
1030
+ return (await Promise.all(e.map((e) => b(e.id)))).flat();
1028
1031
  }
1029
1032
  function lt(e) {
1030
1033
  return e.reduce((e, t) => {
@@ -1033,34 +1036,34 @@ function lt(e) {
1033
1036
  }, /* @__PURE__ */ new Map());
1034
1037
  }
1035
1038
  function ut(e, t, n, r, i, a, o, s, c) {
1036
- let l = e.filter(V).map((e) => {
1037
- let t = bt(e), n = Tt(e.nodeId, r);
1039
+ let l = e.filter(B).map((e) => {
1040
+ let t = yt(e), n = wt(e.nodeId, r);
1038
1041
  return {
1039
1042
  descriptionParts: [
1040
- R(n ? `節點:${n}` : "節點:全流程"),
1043
+ L(n ? `節點:${n}` : "節點:全流程"),
1041
1044
  ft("操作者", e.actorMemberId, a, "系統"),
1042
- R(`時間:${G(e.createdAt)}`),
1043
- ...wt(e, t, r, o, s, c, a)
1044
- ].filter(B),
1045
- error: Mt(e, t),
1045
+ L(`時間:${G(e.createdAt)}`),
1046
+ ...Ct(e, t, r, o, s, c, a)
1047
+ ].filter(z),
1048
+ error: jt(e, t),
1046
1049
  id: e.id,
1047
- title: xt(e.eventType, t)
1050
+ title: bt(e.eventType, t)
1048
1051
  };
1049
1052
  }), u = t.filter(J).map((e) => ({
1050
1053
  descriptionParts: [
1051
- R(`節點:${Et(e.nodeId, r)}`),
1054
+ L(`節點:${Tt(e.nodeId, r)}`),
1052
1055
  ft("處理者", e.assigneeMemberId, a, "未指定"),
1053
- R(`建立時間:${G(e.createdAt)}`)
1054
- ].filter(B),
1056
+ L(`建立時間:${G(e.createdAt)}`)
1057
+ ].filter(z),
1055
1058
  error: !1,
1056
1059
  id: `pending-task-${e.id}`,
1057
1060
  title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
1058
- })), d = new Set([...e.filter(V).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(q)), f = r ? H(r, t, n, i, d).map((e) => ({
1059
- descriptionParts: [R(`${Z(e.type)} · 尚未抵達`)].filter(B),
1061
+ })), d = new Set([...e.filter(B).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(q)), f = r ? V(r, t, n, i, d).map((e) => ({
1062
+ descriptionParts: [L(`${Z(e.type)} · 尚未抵達`)].filter(z),
1060
1063
  error: !1,
1061
1064
  forcePending: !0,
1062
1065
  id: `future-node-${e.id}`,
1063
- title: yt(e)
1066
+ title: vt(e)
1064
1067
  })) : [];
1065
1068
  return [
1066
1069
  ...l,
@@ -1068,7 +1071,7 @@ function ut(e, t, n, r, i, a, o, s, c) {
1068
1071
  ...f
1069
1072
  ];
1070
1073
  }
1071
- function R(e) {
1074
+ function L(e) {
1072
1075
  return q(e) ? {
1073
1076
  text: e,
1074
1077
  type: "text"
@@ -1090,19 +1093,19 @@ function ft(e, t, n, r) {
1090
1093
  type: "member"
1091
1094
  };
1092
1095
  }
1093
- function z(e, t) {
1096
+ function R(e, t) {
1094
1097
  if (!e) return "-";
1095
1098
  let n = t.get(e);
1096
1099
  return n ? `${n.name}(${n.email})` : e;
1097
1100
  }
1098
- function B(e) {
1101
+ function z(e) {
1099
1102
  return !!e;
1100
1103
  }
1101
1104
  function pt(e) {
1102
1105
  let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
1103
1106
  return t === -1 ? e.length : t;
1104
1107
  }
1105
- function V(e) {
1108
+ function B(e) {
1106
1109
  return e.eventType === "INSTANCE_STARTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED";
1107
1110
  }
1108
1111
  function mt(e, t, n, r, i) {
@@ -1111,7 +1114,7 @@ function mt(e, t, n, r, i) {
1111
1114
  let a = X(e, t, n, r);
1112
1115
  return a.tone === "neutral" || a.tone === "waiting";
1113
1116
  }
1114
- function H(e, t, n, r, i) {
1117
+ function V(e, t, n, r, i) {
1115
1118
  if (r !== "RUNNING" && r !== "REJECTED") return [];
1116
1119
  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]));
1117
1120
  return a.filter((e) => o.has(e.id)).sort((e, t) => {
@@ -1124,9 +1127,9 @@ function ht(e, t, n, r, i) {
1124
1127
  let n = [...e.get(t.source) ?? [], t.target];
1125
1128
  return new Map(e).set(t.source, n);
1126
1129
  }, /* @__PURE__ */ new Map());
1127
- return gt(e, n, r, i).reduce((e, t) => vt(e, _t(t, o, a)), /* @__PURE__ */ new Map());
1130
+ return H(e, n, r, i).reduce((e, t) => _t(e, gt(t, o, a)), /* @__PURE__ */ new Map());
1128
1131
  }
1129
- function gt(e, t, n, r) {
1132
+ function H(e, t, n, r) {
1130
1133
  let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(J).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [...new Set([
1131
1134
  ...i,
1132
1135
  ...a,
@@ -1134,7 +1137,7 @@ function gt(e, t, n, r) {
1134
1137
  ])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
1135
1138
  return s.length > 0 ? s : c;
1136
1139
  }
1137
- function _t(e, t, n) {
1140
+ function gt(e, t, n) {
1138
1141
  return U([{
1139
1142
  distance: 0,
1140
1143
  nodeId: e
@@ -1150,73 +1153,73 @@ function U(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()
1150
1153
  nodeId: e
1151
1154
  }))], t, n, s, c);
1152
1155
  }
1153
- function vt(e, t) {
1156
+ function _t(e, t) {
1154
1157
  return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
1155
1158
  }
1156
- function yt(e) {
1159
+ function vt(e) {
1157
1160
  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}`;
1158
1161
  }
1159
- function bt(e) {
1162
+ function yt(e) {
1160
1163
  try {
1161
1164
  let t = JSON.parse(e.payloadJson);
1162
- return Bt(t) ? t : {};
1165
+ return zt(t) ? t : {};
1163
1166
  } catch {
1164
1167
  return {};
1165
1168
  }
1166
1169
  }
1167
- function xt(e, t) {
1168
- return e === "INSTANCE_STARTED" ? "案件已發起" : e === "TOKEN_CREATED" ? "流程路徑已建立" : e === "ENGINE_PROCESS_REQUESTED" ? "流程引擎已處理" : e === "TOKEN_ADVANCED" ? "流程已前進" : e === "TASK_CREATED" ? "待簽任務已建立" : e === "TASK_DECIDED" ? St(K(t, "action")) : e === "SLA_TRIGGERED" ? "時限提醒已觸發" : e;
1170
+ function bt(e, t) {
1171
+ return e === "INSTANCE_STARTED" ? "案件已發起" : e === "TOKEN_CREATED" ? "流程路徑已建立" : e === "ENGINE_PROCESS_REQUESTED" ? "流程引擎已處理" : e === "TOKEN_ADVANCED" ? "流程已前進" : e === "TASK_CREATED" ? "待簽任務已建立" : e === "TASK_DECIDED" ? xt(K(t, "action")) : e === "SLA_TRIGGERED" ? "時限提醒已觸發" : e;
1169
1172
  }
1170
- function St(e) {
1173
+ function xt(e) {
1171
1174
  return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
1172
1175
  }
1173
- function Ct(e, t, n, r) {
1176
+ function St(e, t, n, r) {
1174
1177
  if (e.eventType === "TASK_CREATED") {
1175
1178
  let e = K(t, "assigneeMemberId"), n = K(t, "originalAssigneeMemberId");
1176
1179
  if (!e) {
1177
- let e = Nt(t, "candidateMemberIds");
1178
- return e.length ? `候選簽核人:${e.map((e) => z(e, r)).join("、")}` : null;
1180
+ let e = Mt(t, "candidateMemberIds");
1181
+ return e.length ? `候選簽核人:${e.map((e) => R(e, r)).join("、")}` : null;
1179
1182
  }
1180
- let i = z(e, r), a = z(n, r);
1183
+ let i = R(e, r), a = R(n, r);
1181
1184
  return n && n !== e ? `待簽人:${i}(原簽核人:${a})` : `待簽人:${i}`;
1182
1185
  }
1183
1186
  if (e.eventType === "TASK_DECIDED") {
1184
1187
  let e = K(t, "action"), n = K(t, "comment"), i = e ? `決議:${W(e)}` : null, a = K(t, "transferToMemberId");
1185
- return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(q).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${z(a, r)}`].filter(q).join(" · ") : i;
1188
+ return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(q).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${R(a, r)}`].filter(q).join(" · ") : i;
1186
1189
  }
1187
1190
  if (e.eventType === "TOKEN_ADVANCED") {
1188
1191
  let e = K(t, "action");
1189
1192
  if (e) return `流程結果:${W(e)}`;
1190
- let r = zt(t, "arrivedCount"), i = zt(t, "requiredCount");
1193
+ let r = Rt(t, "arrivedCount"), i = Rt(t, "requiredCount");
1191
1194
  if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
1192
1195
  let a = K(t, "fromNodeId"), o = K(t, "toNodeId");
1193
- if (a && o) return `由 ${Et(a, n)} 前進至 ${Et(o, n)}`;
1196
+ if (a && o) return `由 ${Tt(a, n)} 前進至 ${Tt(o, n)}`;
1194
1197
  }
1195
1198
  if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
1196
1199
  let e = K(t, "state");
1197
- return e ? `案件狀態:${jt(e)}` : null;
1200
+ return e ? `案件狀態:${At(e)}` : null;
1198
1201
  }
1199
1202
  return null;
1200
1203
  }
1201
- function wt(e, t, n, r, i, a, o) {
1202
- if (e.eventType !== "TASK_DECIDED") return [R(Ct(e, t, n, o))].filter(B);
1204
+ function Ct(e, t, n, r, i, a, o) {
1205
+ if (e.eventType !== "TASK_DECIDED") return [L(St(e, t, n, o))].filter(z);
1203
1206
  let s = e.taskId ? r.get(e.taskId) : null, c = K(t, "action") ?? s?.action ?? null, l = K(t, "comment") ?? s?.comment ?? null, u = K(t, "transferToMemberId") ?? s?.transferToMemberId ?? null, d = K(t, "signatureId") ?? s?.signatureId ?? null, f = d ? i.get(d) : null;
1204
1207
  return [
1205
- R(c ? `決議:${W(c)}` : null),
1208
+ L(c ? `決議:${W(c)}` : null),
1206
1209
  c === "REJECTED" ? dt(`拒絕原因:${l ?? "-"}`) : null,
1207
- c === "RETURNED" ? R(`退回說明:${l ?? "-"}`) : null,
1208
- c === "TRANSFERRED" ? R(`轉派給:${z(u, o)}`) : null,
1209
- c === "TRANSFERRED" ? R(`轉派說明:${l ?? "-"}`) : null,
1210
- f ? R(a?.valid ? `簽章:已驗證(${at(f.signedPayloadHash)})` : `簽章:待檢查(${at(f.signedPayloadHash)})`) : null
1211
- ].filter(B);
1210
+ c === "RETURNED" ? L(`退回說明:${l ?? "-"}`) : null,
1211
+ c === "TRANSFERRED" ? L(`轉派給:${R(u, o)}`) : null,
1212
+ c === "TRANSFERRED" ? L(`轉派說明:${l ?? "-"}`) : null,
1213
+ f ? L(a?.valid ? `簽章:已驗證(${at(f.signedPayloadHash)})` : `簽章:待檢查(${at(f.signedPayloadHash)})`) : null
1214
+ ].filter(z);
1212
1215
  }
1213
- function Tt(e, t) {
1214
- return e ? Et(e, t) : null;
1216
+ function wt(e, t) {
1217
+ return e ? Tt(e, t) : null;
1215
1218
  }
1216
- function Et(e, t) {
1219
+ function Tt(e, t) {
1217
1220
  return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
1218
1221
  }
1219
- function Dt(e, t) {
1222
+ function Et(e, t) {
1220
1223
  if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
1221
1224
  if (t.data.returnBehavior.allowedTargets === "ANY") return e.nodes.filter((e) => e.id !== t.id).map((e) => ({
1222
1225
  id: e.id,
@@ -1231,22 +1234,22 @@ function Dt(e, t) {
1231
1234
  function W(e) {
1232
1235
  return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
1233
1236
  }
1234
- function Ot(e) {
1237
+ function Dt(e) {
1235
1238
  return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
1236
1239
  }
1237
- function kt(e, t = /* @__PURE__ */ new Map()) {
1238
- let n = Lt(e.delegationChainJson);
1239
- if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => z(e, t)).join("、")}` : "未指定";
1240
- let r = z(e.assigneeMemberId, t), i = z(e.originalAssigneeMemberId, t);
1240
+ function Ot(e, t = /* @__PURE__ */ new Map()) {
1241
+ let n = It(e.delegationChainJson);
1242
+ if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => R(e, t)).join("、")}` : "未指定";
1243
+ let r = R(e.assigneeMemberId, t), i = R(e.originalAssigneeMemberId, t);
1241
1244
  return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
1242
1245
  }
1243
- function At(e, t) {
1246
+ function kt(e, t) {
1244
1247
  return t ? e.assigneeMemberId === t || e.candidateMemberIds.includes(t) : !1;
1245
1248
  }
1246
- function jt(e) {
1249
+ function At(e) {
1247
1250
  return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
1248
1251
  }
1249
- function Mt(e, t) {
1252
+ function jt(e, t) {
1250
1253
  return e.eventType === "SLA_TRIGGERED" || K(t, "action") === "REJECTED" || K(t, "instanceState") === "REJECTED";
1251
1254
  }
1252
1255
  function G(e) {
@@ -1256,19 +1259,19 @@ function K(e, t) {
1256
1259
  let n = e[t];
1257
1260
  return typeof n == "string" ? n : null;
1258
1261
  }
1259
- function Nt(e, t) {
1262
+ function Mt(e, t) {
1260
1263
  let n = e[t];
1261
1264
  return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
1262
1265
  }
1263
- function Pt(e) {
1266
+ function Nt(e) {
1264
1267
  return {
1265
1268
  email: e.email,
1266
1269
  id: e.memberId,
1267
1270
  name: `${e.name} · ${e.email}`
1268
1271
  };
1269
1272
  }
1270
- function Ft(e) {
1271
- if (!Bt(e)) return null;
1273
+ function Pt(e) {
1274
+ if (!zt(e)) return null;
1272
1275
  let t = e.email, n = e.id, r = e.name;
1273
1276
  return typeof n == "string" && typeof r == "string" ? {
1274
1277
  email: typeof t == "string" ? t : null,
@@ -1276,7 +1279,7 @@ function Ft(e) {
1276
1279
  name: r
1277
1280
  } : null;
1278
1281
  }
1279
- function It(e, t) {
1282
+ function Ft(e, t) {
1280
1283
  let n = e.trim().toLocaleLowerCase();
1281
1284
  if (!n) return null;
1282
1285
  let r = t.filter((e) => [
@@ -1286,15 +1289,15 @@ function It(e, t) {
1286
1289
  ].some((e) => e.toLocaleLowerCase().includes(n)));
1287
1290
  return r.length === 1 ? r[0] ?? null : null;
1288
1291
  }
1289
- function Lt(e) {
1292
+ function It(e) {
1290
1293
  try {
1291
1294
  let t = JSON.parse(e);
1292
- return Array.isArray(t) ? t.map((e) => Bt(e) ? Rt(e) : null).filter((e) => e !== null) : [];
1295
+ return Array.isArray(t) ? t.map((e) => zt(e) ? Lt(e) : null).filter((e) => e !== null) : [];
1293
1296
  } catch {
1294
1297
  return [];
1295
1298
  }
1296
1299
  }
1297
- function Rt(e) {
1300
+ function Lt(e) {
1298
1301
  let t = K(e, "from"), n = K(e, "to"), r = K(e, "reason");
1299
1302
  return !t || !n || !r ? null : {
1300
1303
  from: t,
@@ -1303,55 +1306,55 @@ function Rt(e) {
1303
1306
  to: n
1304
1307
  };
1305
1308
  }
1306
- function zt(e, t) {
1309
+ function Rt(e, t) {
1307
1310
  let n = e[t];
1308
1311
  return typeof n == "number" ? n : null;
1309
1312
  }
1310
1313
  function q(e) {
1311
1314
  return typeof e == "string" && e.trim().length > 0;
1312
1315
  }
1313
- function Bt(e) {
1316
+ function zt(e) {
1314
1317
  return typeof e == "object" && !!e;
1315
1318
  }
1316
1319
  function J(e) {
1317
1320
  return e.status === "PENDING" || e.status === "IN_PROGRESS";
1318
1321
  }
1319
1322
  function Y({ data: e }) {
1320
- return /* @__PURE__ */ b("div", {
1321
- style: Wt(e.tone),
1323
+ return /* @__PURE__ */ y("div", {
1324
+ style: Ut(e.tone),
1322
1325
  children: [
1323
- /* @__PURE__ */ y(S, {
1326
+ /* @__PURE__ */ v(x, {
1324
1327
  isConnectable: !1,
1325
- position: C.Left,
1328
+ position: S.Left,
1326
1329
  style: Qe,
1327
1330
  type: "target"
1328
1331
  }),
1329
- /* @__PURE__ */ y(v, {
1332
+ /* @__PURE__ */ v(_, {
1330
1333
  component: "span",
1331
1334
  ellipsis: !0,
1332
1335
  title: e.label,
1333
1336
  variant: "label-primary",
1334
1337
  children: e.label
1335
1338
  }),
1336
- /* @__PURE__ */ y("span", {
1337
- style: Gt(e.tone),
1339
+ /* @__PURE__ */ v("span", {
1340
+ style: Wt(e.tone),
1338
1341
  children: e.statusLabel
1339
1342
  }),
1340
- /* @__PURE__ */ y("span", {
1343
+ /* @__PURE__ */ v("span", {
1341
1344
  title: e.secondaryLabel,
1342
1345
  style: Ze,
1343
1346
  children: e.secondaryLabel || e.kindLabel
1344
1347
  }),
1345
- /* @__PURE__ */ y(S, {
1348
+ /* @__PURE__ */ v(x, {
1346
1349
  isConnectable: !1,
1347
- position: C.Right,
1350
+ position: S.Right,
1348
1351
  style: Qe,
1349
1352
  type: "source"
1350
1353
  })
1351
1354
  ]
1352
1355
  });
1353
1356
  }
1354
- function Vt(e, t, n, r) {
1357
+ function Bt(e, t, n, r) {
1355
1358
  return e.nodes.map((e) => {
1356
1359
  let i = X(e, t, n, r);
1357
1360
  return {
@@ -1364,14 +1367,14 @@ function Vt(e, t, n, r) {
1364
1367
  },
1365
1368
  id: e.id,
1366
1369
  position: e.position,
1367
- sourcePosition: C.Right,
1368
- targetPosition: C.Left,
1370
+ sourcePosition: S.Right,
1371
+ targetPosition: S.Left,
1369
1372
  type: "workflowRuntime"
1370
1373
  };
1371
1374
  });
1372
1375
  }
1373
- function Ht(e) {
1374
- let t = new w.graphlib.Graph();
1376
+ function Vt(e) {
1377
+ let t = new C.graphlib.Graph();
1375
1378
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
1376
1379
  nodesep: 56,
1377
1380
  rankdir: "LR",
@@ -1379,25 +1382,25 @@ function Ht(e) {
1379
1382
  }), e.nodes.forEach((e) => {
1380
1383
  t.setNode(e.id, {
1381
1384
  height: We,
1382
- width: j
1385
+ width: A
1383
1386
  });
1384
1387
  }), e.edges.forEach((e) => {
1385
1388
  t.setEdge(e.source, e.target);
1386
- }), w.layout(t), {
1389
+ }), C.layout(t), {
1387
1390
  ...e,
1388
1391
  nodes: e.nodes.map((e) => {
1389
1392
  let n = t.node(e.id);
1390
1393
  return n ? {
1391
1394
  ...e,
1392
1395
  position: {
1393
- x: n.x - j / 2,
1396
+ x: n.x - A / 2,
1394
1397
  y: n.y - We / 2
1395
1398
  }
1396
1399
  } : e;
1397
1400
  })
1398
1401
  };
1399
1402
  }
1400
- function Ut(e) {
1403
+ function Ht(e) {
1401
1404
  return e.edges.map((e) => {
1402
1405
  let t = Q(e);
1403
1406
  return {
@@ -1430,15 +1433,15 @@ function Ut(e) {
1430
1433
  function X(e, t, n, r) {
1431
1434
  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");
1432
1435
  return a ? {
1433
- secondaryLabel: `處理者 ${kt(a)}`,
1436
+ secondaryLabel: `處理者 ${Ot(a)}`,
1434
1437
  statusLabel: "待處理",
1435
1438
  tone: "current"
1436
1439
  } : o ? {
1437
- secondaryLabel: `已取消 ${kt(o)}`,
1440
+ secondaryLabel: `已取消 ${Ot(o)}`,
1438
1441
  statusLabel: "已取消",
1439
1442
  tone: "cancelled"
1440
1443
  } : s ? {
1441
- secondaryLabel: `已完成 ${kt(s)}`,
1444
+ secondaryLabel: `已完成 ${Ot(s)}`,
1442
1445
  statusLabel: "已完成",
1443
1446
  tone: "completed"
1444
1447
  } : l ? {
@@ -1466,24 +1469,24 @@ function X(e, t, n, r) {
1466
1469
  function Z(e) {
1467
1470
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
1468
1471
  }
1469
- function Wt(e) {
1472
+ function Ut(e) {
1470
1473
  return e === "current" ? {
1471
- ...M,
1474
+ ...j,
1472
1475
  border: "1px solid var(--mzn-color-primary, #0057ff)",
1473
1476
  boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
1474
1477
  } : e === "completed" ? {
1475
- ...M,
1478
+ ...j,
1476
1479
  border: "1px solid #16a34a"
1477
1480
  } : e === "cancelled" ? {
1478
- ...M,
1481
+ ...j,
1479
1482
  border: "1px solid #dc2626",
1480
1483
  opacity: .72
1481
1484
  } : e === "waiting" ? {
1482
- ...M,
1485
+ ...j,
1483
1486
  border: "1px dashed #64748b"
1484
- } : M;
1487
+ } : j;
1485
1488
  }
1486
- function Gt(e) {
1489
+ function Wt(e) {
1487
1490
  let t = Xe;
1488
1491
  return e === "current" ? {
1489
1492
  ...t,
@@ -1510,10 +1513,10 @@ function Gt(e) {
1510
1513
  function Q(e) {
1511
1514
  return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
1512
1515
  }
1513
- function Kt(e) {
1516
+ function Gt(e) {
1514
1517
  return e.edges.map(Q).filter((e) => e.trim().length > 0);
1515
1518
  }
1516
1519
  //#endregion
1517
- export { P as t };
1520
+ export { N as t };
1518
1521
 
1519
- //# sourceMappingURL=detail-DilI0PPe.js.map
1522
+ //# sourceMappingURL=detail-CfFyU5zC.js.map