@rytass/bpm-core-react 0.3.8 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/README.md +69 -4
  3. package/dist/chunks/approval-instance-list-page-BtEc8Cs3.js +278 -0
  4. package/dist/chunks/approval-instance-list-page-BtEc8Cs3.js.map +1 -0
  5. package/dist/chunks/approval-instance-list-page-UNIIgUZy.cjs +2 -0
  6. package/dist/chunks/approval-instance-list-page-UNIIgUZy.cjs.map +1 -0
  7. package/dist/chunks/auth-provider-D2P-qWmY.cjs +2 -0
  8. package/dist/chunks/auth-provider-D2P-qWmY.cjs.map +1 -0
  9. package/dist/chunks/auth-provider-TTO9eNZV.js +83 -0
  10. package/dist/chunks/auth-provider-TTO9eNZV.js.map +1 -0
  11. package/dist/chunks/{builder-D950gct_.js → builder-C3E-8OJu.js} +474 -478
  12. package/dist/chunks/builder-C3E-8OJu.js.map +1 -0
  13. package/dist/chunks/builder-f-Q_0NUs.cjs +3 -0
  14. package/dist/chunks/builder-f-Q_0NUs.cjs.map +1 -0
  15. package/dist/chunks/categories-B6QZKZRt.cjs +2 -0
  16. package/dist/chunks/categories-B6QZKZRt.cjs.map +1 -0
  17. package/dist/chunks/categories-DBPoSrsi.js +382 -0
  18. package/dist/chunks/categories-DBPoSrsi.js.map +1 -0
  19. package/dist/chunks/chunk-CMqjfN_6.cjs +1 -0
  20. package/dist/chunks/dashboard-page-CQRBJxze.js +119 -0
  21. package/dist/chunks/dashboard-page-CQRBJxze.js.map +1 -0
  22. package/dist/chunks/dashboard-page-DrDChhg1.cjs +2 -0
  23. package/dist/chunks/dashboard-page-DrDChhg1.cjs.map +1 -0
  24. package/dist/chunks/delegations-CFXaJrdX.cjs +2 -0
  25. package/dist/chunks/delegations-CFXaJrdX.cjs.map +1 -0
  26. package/dist/chunks/delegations-D5pPEWsP.js +641 -0
  27. package/dist/chunks/delegations-D5pPEWsP.js.map +1 -0
  28. package/dist/chunks/delegations-DwbYkNUg.cjs +2 -0
  29. package/dist/chunks/delegations-DwbYkNUg.cjs.map +1 -0
  30. package/dist/chunks/delegations-FTLaWo1Y.js +568 -0
  31. package/dist/chunks/delegations-FTLaWo1Y.js.map +1 -0
  32. package/dist/chunks/detail-B9JkYNHc.cjs +2 -0
  33. package/dist/chunks/detail-B9JkYNHc.cjs.map +1 -0
  34. package/dist/chunks/detail-CSxI04gB.js +1518 -0
  35. package/dist/chunks/detail-CSxI04gB.js.map +1 -0
  36. package/dist/chunks/format-date-time-XxBzF0F5.cjs +2 -0
  37. package/dist/chunks/{format-date-time-26_pFvv4.cjs.map → format-date-time-XxBzF0F5.cjs.map} +1 -1
  38. package/dist/chunks/login-BfmfCclF.cjs +2 -0
  39. package/dist/chunks/{login-CQ9MfwcC.cjs.map → login-BfmfCclF.cjs.map} +1 -1
  40. package/dist/chunks/{login-C20yVxbc.js → login-xgI4wLHe.js} +3 -2
  41. package/dist/chunks/{login-C20yVxbc.js.map → login-xgI4wLHe.js.map} +1 -1
  42. package/dist/chunks/notifications-BoNa1BXD.js +193 -0
  43. package/dist/chunks/notifications-BoNa1BXD.js.map +1 -0
  44. package/dist/chunks/notifications-a-FCxV02.cjs +2 -0
  45. package/dist/chunks/notifications-a-FCxV02.cjs.map +1 -0
  46. package/dist/chunks/orgs-BIiqzHvb.cjs +2 -0
  47. package/dist/chunks/orgs-BIiqzHvb.cjs.map +1 -0
  48. package/dist/chunks/orgs-Cc18umVt.js +1944 -0
  49. package/dist/chunks/orgs-Cc18umVt.js.map +1 -0
  50. package/dist/chunks/router-adapter-BdHZXLS3.js +23 -0
  51. package/dist/chunks/router-adapter-BdHZXLS3.js.map +1 -0
  52. package/dist/chunks/router-adapter-BybHrCNP.cjs +2 -0
  53. package/dist/chunks/router-adapter-BybHrCNP.cjs.map +1 -0
  54. package/dist/chunks/templates-CL8bPvgn.cjs +2 -0
  55. package/dist/chunks/templates-CL8bPvgn.cjs.map +1 -0
  56. package/dist/chunks/templates-DNfDOPGm.js +380 -0
  57. package/dist/chunks/templates-DNfDOPGm.js.map +1 -0
  58. package/dist/chunks/users-CUY139DF.js +214 -0
  59. package/dist/chunks/users-CUY139DF.js.map +1 -0
  60. package/dist/chunks/users-qghSMtLn.cjs +2 -0
  61. package/dist/chunks/users-qghSMtLn.cjs.map +1 -0
  62. package/dist/components/approval-instance-list-page.d.ts +1 -2
  63. package/dist/components/bpm-notification-bell-button.d.ts +22 -0
  64. package/dist/components/dashboard-page.d.ts +1 -4
  65. package/dist/index.cjs +1 -1
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.css +1 -0
  68. package/dist/index.d.ts +3 -1
  69. package/dist/index.js +206 -97
  70. package/dist/index.js.map +1 -1
  71. package/dist/lib/notification-drawer-provider.d.ts +3 -2
  72. package/dist/lib/notification-unread-provider.d.ts +6 -5
  73. package/dist/lib/providers.d.ts +3 -2
  74. package/dist/lib/use-bpm-logout.d.ts +12 -0
  75. package/dist/lib/use-bpm-member.d.ts +11 -0
  76. package/dist/pages/admin/delegations/index.cjs +1 -1
  77. package/dist/pages/admin/delegations/index.js +1 -1
  78. package/dist/pages/admin/orgs/index.cjs +1 -1
  79. package/dist/pages/admin/orgs/index.js +1 -1
  80. package/dist/pages/admin/users/index.cjs +1 -1
  81. package/dist/pages/admin/users/index.js +1 -1
  82. package/dist/pages/delegations/index.cjs +1 -1
  83. package/dist/pages/delegations/index.js +1 -1
  84. package/dist/pages/forms/builder/index.cjs +1 -1
  85. package/dist/pages/forms/builder/index.js +1 -1
  86. package/dist/pages/instances/detail/index.cjs +1 -1
  87. package/dist/pages/instances/detail/index.js +1 -1
  88. package/dist/pages/login/index.cjs +1 -1
  89. package/dist/pages/login/index.js +1 -1
  90. package/dist/pages/settings/notifications/index.cjs +1 -1
  91. package/dist/pages/settings/notifications/index.js +1 -1
  92. package/dist/pages/templates/categories/index.cjs +1 -1
  93. package/dist/pages/templates/categories/index.js +1 -1
  94. package/dist/pages/templates/index.cjs +1 -1
  95. package/dist/pages/templates/index.js +1 -1
  96. package/dist/views/admin/delegations/AdminDelegationsView.d.ts +1 -4
  97. package/dist/views/admin/delegations/index.cjs +1 -1
  98. package/dist/views/admin/delegations/index.js +1 -1
  99. package/dist/views/admin/index.cjs +1 -1
  100. package/dist/views/admin/index.js +3 -3
  101. package/dist/views/admin/orgs/AdminOrgsView.d.ts +1 -4
  102. package/dist/views/admin/orgs/index.cjs +1 -1
  103. package/dist/views/admin/orgs/index.js +1 -1
  104. package/dist/views/admin/users/AdminUsersView.d.ts +1 -4
  105. package/dist/views/admin/users/index.cjs +1 -1
  106. package/dist/views/admin/users/index.js +1 -1
  107. package/dist/views/cc/CcView.d.ts +1 -3
  108. package/dist/views/cc/index.cjs +1 -1
  109. package/dist/views/cc/index.cjs.map +1 -1
  110. package/dist/views/cc/index.js +2 -3
  111. package/dist/views/cc/index.js.map +1 -1
  112. package/dist/views/dashboard/DashboardView.d.ts +1 -3
  113. package/dist/views/dashboard/index.cjs +1 -1
  114. package/dist/views/dashboard/index.cjs.map +1 -1
  115. package/dist/views/dashboard/index.js +3 -3
  116. package/dist/views/dashboard/index.js.map +1 -1
  117. package/dist/views/delegations/DelegationsView.d.ts +1 -4
  118. package/dist/views/delegations/index.cjs +1 -1
  119. package/dist/views/delegations/index.js +1 -1
  120. package/dist/views/forms/FormsView.d.ts +1 -3
  121. package/dist/views/forms/builder/index.cjs +1 -1
  122. package/dist/views/forms/builder/index.js +1 -1
  123. package/dist/views/forms/index.cjs +1 -1
  124. package/dist/views/forms/index.cjs.map +1 -1
  125. package/dist/views/forms/index.js +95 -99
  126. package/dist/views/forms/index.js.map +1 -1
  127. package/dist/views/inbox/InboxView.d.ts +1 -3
  128. package/dist/views/inbox/index.cjs +1 -1
  129. package/dist/views/inbox/index.cjs.map +1 -1
  130. package/dist/views/inbox/index.js +91 -94
  131. package/dist/views/inbox/index.js.map +1 -1
  132. package/dist/views/instances/detail/index.cjs +1 -1
  133. package/dist/views/instances/detail/index.js +1 -1
  134. package/dist/views/instances/new/index.cjs +1 -1
  135. package/dist/views/instances/new/index.cjs.map +1 -1
  136. package/dist/views/instances/new/index.js +71 -77
  137. package/dist/views/instances/new/index.js.map +1 -1
  138. package/dist/views/login/index.cjs +1 -1
  139. package/dist/views/login/index.js +1 -1
  140. package/dist/views/root/RootView.d.ts +1 -3
  141. package/dist/views/search/SearchView.d.ts +1 -3
  142. package/dist/views/search/index.cjs +1 -1
  143. package/dist/views/search/index.cjs.map +1 -1
  144. package/dist/views/search/index.js +2 -3
  145. package/dist/views/search/index.js.map +1 -1
  146. package/dist/views/sent/SentView.d.ts +1 -3
  147. package/dist/views/sent/index.cjs +1 -1
  148. package/dist/views/sent/index.cjs.map +1 -1
  149. package/dist/views/sent/index.js +2 -3
  150. package/dist/views/sent/index.js.map +1 -1
  151. package/dist/views/settings/index.cjs +1 -1
  152. package/dist/views/settings/index.js +1 -1
  153. package/dist/views/settings/notifications/SettingsNotificationsView.d.ts +1 -4
  154. package/dist/views/settings/notifications/index.cjs +1 -1
  155. package/dist/views/settings/notifications/index.js +1 -1
  156. package/dist/views/templates/TemplatesView.d.ts +1 -4
  157. package/dist/views/templates/categories/TemplateCategoriesView.d.ts +1 -4
  158. package/dist/views/templates/categories/index.cjs +1 -1
  159. package/dist/views/templates/categories/index.js +1 -1
  160. package/dist/views/templates/designer/TemplateDesignerView.d.ts +1 -2
  161. package/dist/views/templates/designer/index.cjs +7 -7
  162. package/dist/views/templates/designer/index.cjs.map +1 -1
  163. package/dist/views/templates/designer/index.js +707 -711
  164. package/dist/views/templates/designer/index.js.map +1 -1
  165. package/dist/views/templates/index.cjs +1 -1
  166. package/dist/views/templates/index.js +2 -2
  167. package/dist/views/templates/versions/TemplateVersionsView.d.ts +1 -2
  168. package/dist/views/templates/versions/index.cjs +1 -1
  169. package/dist/views/templates/versions/index.cjs.map +1 -1
  170. package/dist/views/templates/versions/index.js +45 -49
  171. package/dist/views/templates/versions/index.js.map +1 -1
  172. package/package.json +2 -2
  173. package/dist/app-navigation.css +0 -1
  174. package/dist/chunks/app-navigation-BSkMsEhy.js +0 -268
  175. package/dist/chunks/app-navigation-BSkMsEhy.js.map +0 -1
  176. package/dist/chunks/app-navigation-KnlJCUp1.cjs +0 -2
  177. package/dist/chunks/app-navigation-KnlJCUp1.cjs.map +0 -1
  178. package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs +0 -2
  179. package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs.map +0 -1
  180. package/dist/chunks/approval-instance-list-page-CqNdoZqx.js +0 -282
  181. package/dist/chunks/approval-instance-list-page-CqNdoZqx.js.map +0 -1
  182. package/dist/chunks/auth-provider-BV8Iiwfb.cjs +0 -2
  183. package/dist/chunks/auth-provider-BV8Iiwfb.cjs.map +0 -1
  184. package/dist/chunks/auth-provider-Bnox5gsx.js +0 -98
  185. package/dist/chunks/auth-provider-Bnox5gsx.js.map +0 -1
  186. package/dist/chunks/builder-CMlJfQHE.cjs +0 -3
  187. package/dist/chunks/builder-CMlJfQHE.cjs.map +0 -1
  188. package/dist/chunks/builder-D950gct_.js.map +0 -1
  189. package/dist/chunks/categories-5yEM3p3N.cjs +0 -2
  190. package/dist/chunks/categories-5yEM3p3N.cjs.map +0 -1
  191. package/dist/chunks/categories-BIpOG451.js +0 -387
  192. package/dist/chunks/categories-BIpOG451.js.map +0 -1
  193. package/dist/chunks/dashboard-page-Bx1-Ys3e.js +0 -122
  194. package/dist/chunks/dashboard-page-Bx1-Ys3e.js.map +0 -1
  195. package/dist/chunks/dashboard-page-CQNRbMkJ.cjs +0 -2
  196. package/dist/chunks/dashboard-page-CQNRbMkJ.cjs.map +0 -1
  197. package/dist/chunks/delegations-B2j-wNEO.js +0 -646
  198. package/dist/chunks/delegations-B2j-wNEO.js.map +0 -1
  199. package/dist/chunks/delegations-CsB9ozLu.cjs +0 -2
  200. package/dist/chunks/delegations-CsB9ozLu.cjs.map +0 -1
  201. package/dist/chunks/delegations-CvtwTXNP.cjs +0 -2
  202. package/dist/chunks/delegations-CvtwTXNP.cjs.map +0 -1
  203. package/dist/chunks/delegations-dKodb0WW.js +0 -573
  204. package/dist/chunks/delegations-dKodb0WW.js.map +0 -1
  205. package/dist/chunks/detail-BcGAqJ_R.js +0 -1523
  206. package/dist/chunks/detail-BcGAqJ_R.js.map +0 -1
  207. package/dist/chunks/detail-CqjqLd65.cjs +0 -2
  208. package/dist/chunks/detail-CqjqLd65.cjs.map +0 -1
  209. package/dist/chunks/format-date-time-26_pFvv4.cjs +0 -2
  210. package/dist/chunks/login-CQ9MfwcC.cjs +0 -2
  211. package/dist/chunks/notifications-2swRqDPF.js +0 -198
  212. package/dist/chunks/notifications-2swRqDPF.js.map +0 -1
  213. package/dist/chunks/notifications-BaYDebFt.cjs +0 -2
  214. package/dist/chunks/notifications-BaYDebFt.cjs.map +0 -1
  215. package/dist/chunks/orgs-CuHxxd_n.js +0 -1949
  216. package/dist/chunks/orgs-CuHxxd_n.js.map +0 -1
  217. package/dist/chunks/orgs-YMiVLNvL.cjs +0 -2
  218. package/dist/chunks/orgs-YMiVLNvL.cjs.map +0 -1
  219. package/dist/chunks/templates-DTkbSgFY.cjs +0 -2
  220. package/dist/chunks/templates-DTkbSgFY.cjs.map +0 -1
  221. package/dist/chunks/templates-DoDWM68t.js +0 -384
  222. package/dist/chunks/templates-DoDWM68t.js.map +0 -1
  223. package/dist/chunks/users-3ySyUW4u.cjs +0 -2
  224. package/dist/chunks/users-3ySyUW4u.cjs.map +0 -1
  225. package/dist/chunks/users-sMfrSjRQ.js +0 -219
  226. package/dist/chunks/users-sMfrSjRQ.js.map +0 -1
  227. package/dist/components/app-navigation.d.ts +0 -41
@@ -1,34 +1,33 @@
1
1
  "use client";
2
- import { a as e } from "../../../chunks/auth-provider-Bnox5gsx.js";
3
- import { t } from "../../../chunks/app-navigation-BSkMsEhy.js";
4
- import { r as n } from "../../../chunks/routes-config-dxahImVe.js";
5
- import { a as r, n as i, o as a, r as o } from "../../../chunks/admin-pickers-DLlG_1du.js";
6
- import { t as s } from "../../../chunks/bpm-form-field-Cao0rMol.js";
7
- import { useCallback as ee, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
8
- import { AutoComplete as te, Button as f, Icon as ne, Input as re, Modal as ie, PageHeader as ae, Section as oe, SectionGroup as se, Select as p, Textarea as ce, Toggle as le, Typography as m } from "@mezzanine-ui/react";
9
- import { Fragment as ue, jsx as h, jsxs as g } from "react/jsx-runtime";
2
+ import { r as e } from "../../../chunks/router-adapter-BdHZXLS3.js";
3
+ import { r as t } from "../../../chunks/routes-config-dxahImVe.js";
4
+ import { a as n, n as r, o as i, r as a } from "../../../chunks/admin-pickers-DLlG_1du.js";
5
+ import { t as o } from "../../../chunks/bpm-form-field-Cao0rMol.js";
6
+ import { useCallback as s, useEffect as c, useMemo as l, useRef as ee, useState as u } from "react";
7
+ import { AutoComplete as te, Button as d, Icon as ne, Input as re, Modal as ie, PageHeader as ae, Section as oe, SectionGroup as se, Select as f, Textarea as ce, Toggle as le, Typography as p } from "@mezzanine-ui/react";
8
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
9
+ import ue from "@mezzanine-ui/react/ContentHeader";
10
10
  import { CheckedIcon as de, DotGridIcon as fe, EyeIcon as pe, FilterIcon as me, MailIcon as he, SaveIcon as ge, TrashIcon as _e, UserIcon as ve } from "@mezzanine-ui/icons";
11
- import ye from "@mezzanine-ui/react/ContentHeader";
12
- import { readOrganizationDashboard as be } from "@rytass/bpm-core-client/organization";
13
- import { Background as xe, ConnectionMode as Se, ControlButton as Ce, Controls as we, Handle as Te, MiniMap as Ee, Panel as De, Position as _, ReactFlow as Oe, applyNodeChanges as ke, getViewportForBounds as v } from "@xyflow/react";
14
- import * as y from "dagre";
15
- import { dryRunApprovalWorkflow as Ae, forkApprovalTemplate as je, publishApprovalTemplateVersion as Me, readTemplateDesigner as Ne, resolveMemberOptions as Pe, searchMemberOptions as Fe, searchPublishedFormVersionOptions as Ie, updateApprovalTemplateDraft as Le } from "@rytass/bpm-core-client/template";
11
+ import { readOrganizationDashboard as ye } from "@rytass/bpm-core-client/organization";
12
+ import { Background as be, ConnectionMode as xe, ControlButton as Se, Controls as Ce, Handle as _, MiniMap as we, Panel as v, Position as y, ReactFlow as Te, applyNodeChanges as Ee, getViewportForBounds as De } from "@xyflow/react";
13
+ import * as Oe from "dagre";
14
+ import { dryRunApprovalWorkflow as ke, forkApprovalTemplate as Ae, publishApprovalTemplateVersion as je, readTemplateDesigner as Me, resolveMemberOptions as Ne, searchMemberOptions as Pe, searchPublishedFormVersionOptions as Fe, updateApprovalTemplateDraft as Ie } from "@rytass/bpm-core-client/template";
16
15
  //#region src/views/templates/designer/TemplateDesignerView.tsx
17
- var Re = {
16
+ var Le = {
18
17
  display: "grid",
19
18
  gap: 16
20
- }, ze = {
19
+ }, Re = {
21
20
  alignItems: "start",
22
21
  display: "grid",
23
22
  gap: 16,
24
23
  gridTemplateColumns: "minmax(0, 1fr) 420px"
25
- }, Be = {
24
+ }, ze = {
26
25
  border: "1px solid var(--mzn-color-border-neutral)",
27
26
  borderRadius: 6,
28
27
  height: 620,
29
28
  minWidth: 0,
30
29
  overflow: "hidden"
31
- }, Ve = {
30
+ }, Be = {
32
31
  alignItems: "center",
33
32
  boxSizing: "border-box",
34
33
  color: "var(--mzn-color-text-error)",
@@ -38,24 +37,24 @@ var Re = {
38
37
  lineHeight: 0,
39
38
  padding: 0,
40
39
  width: 26
41
- }, He = {
40
+ }, Ve = {
42
41
  alignItems: "center",
43
42
  display: "flex",
44
43
  height: "100%",
45
44
  justifyContent: "center",
46
45
  width: "100%"
47
- }, Ue = "workflow-designer-side-panel", We = 96, Ge = `
48
- .${Ue} .mzn-form-field--stretch .mzn-form-field__label-area,
49
- .${Ue} .mzn-form-field--horizontal .mzn-form-field__label-area {
50
- flex: 0 0 ${We}px;
51
- width: ${We}px;
46
+ }, He = "workflow-designer-side-panel", b = 96, Ue = `
47
+ .${He} .mzn-form-field--stretch .mzn-form-field__label-area,
48
+ .${He} .mzn-form-field--horizontal .mzn-form-field__label-area {
49
+ flex: 0 0 ${b}px;
50
+ width: ${b}px;
52
51
  }
53
52
 
54
- .${Ue} .mzn-form-field--stretch .mzn-form-field__data-entry,
55
- .${Ue} .mzn-form-field--horizontal .mzn-form-field__data-entry {
53
+ .${He} .mzn-form-field--stretch .mzn-form-field__data-entry,
54
+ .${He} .mzn-form-field--horizontal .mzn-form-field__data-entry {
56
55
  min-width: 0;
57
56
  }
58
- `, Ke = "#2563eb", b = "#64748b", qe = "var(--mzn-color-text-error, #dc2626)", Je = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", Ye = `
57
+ `, We = "#2563eb", x = "#64748b", Ge = "var(--mzn-color-text-error, #dc2626)", Ke = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", qe = `
59
58
  .workflow-selection-delete-control.react-flow__controls-button {
60
59
  align-items: center !important;
61
60
  display: flex !important;
@@ -80,26 +79,26 @@ var Re = {
80
79
 
81
80
  .workflow-edge--selected .react-flow__edge-path,
82
81
  .react-flow__edge-path.workflow-edge--selected {
83
- filter: ${Je};
82
+ filter: ${Ke};
84
83
  opacity: 1 !important;
85
- stroke: ${b} !important;
84
+ stroke: ${x} !important;
86
85
  stroke-opacity: 1 !important;
87
86
  stroke-width: 1.5px !important;
88
87
  }
89
88
 
90
89
  .workflow-edge--selected {
91
- --xy-edge-stroke: ${b};
92
- --xy-edge-stroke-selected: ${b};
90
+ --xy-edge-stroke: ${x};
91
+ --xy-edge-stroke-selected: ${x};
93
92
  --xy-edge-stroke-width: 1.5px;
94
93
  }
95
94
 
96
- `, Xe = {
95
+ `, Je = {
97
96
  display: "grid",
98
97
  gap: 12
99
- }, x = {
98
+ }, S = {
100
99
  display: "grid",
101
100
  gap: 12
102
- }, Ze = {
101
+ }, Ye = {
103
102
  border: "1px solid var(--mzn-color-border-neutral)",
104
103
  borderRadius: 6,
105
104
  display: "grid",
@@ -107,19 +106,19 @@ var Re = {
107
106
  maxHeight: 360,
108
107
  overflow: "auto",
109
108
  padding: 12
110
- }, Qe = {
109
+ }, Xe = {
111
110
  borderBottom: "1px solid var(--mzn-color-border-neutral)",
112
111
  display: "grid",
113
112
  gap: 4,
114
113
  padding: "0 0 8px"
115
- }, $e = {
114
+ }, Ze = {
116
115
  display: "flex",
117
116
  flexWrap: "wrap",
118
117
  gap: 8
119
- }, et = {
118
+ }, Qe = {
120
119
  display: "grid",
121
120
  gap: 8
122
- }, S = {
121
+ }, C = {
123
122
  alignContent: "center",
124
123
  background: "var(--mzn-color-bg-surface)",
125
124
  border: "1px solid var(--mzn-color-border-neutral)",
@@ -134,46 +133,46 @@ var Re = {
134
133
  padding: "10px 12px",
135
134
  textAlign: "center",
136
135
  width: "100%"
137
- }, tt = "0 8px 20px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--mzn-color-primary, #0057ff), 0 0 10px rgba(0, 87, 255, 0.3)", nt = 64, C = 160, rt = 20, it = 64, w = 180, T = {
138
- ...S,
136
+ }, $e = "0 8px 20px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--mzn-color-primary, #0057ff), 0 0 10px rgba(0, 87, 255, 0.3)", et = 64, w = 160, T = 20, E = 64, D = 180, O = {
137
+ ...C,
139
138
  display: "grid",
140
139
  gap: 8,
141
140
  padding: "10px 12px"
142
- }, E = {
143
- ...T,
141
+ }, tt = {
142
+ ...O,
144
143
  background: "#eff6ff",
145
144
  border: "1px solid #2563eb"
146
- }, D = {
147
- ...T,
145
+ }, k = {
146
+ ...O,
148
147
  background: "#f0fdfa",
149
148
  border: "1px solid #0f766e"
150
- }, at = {
151
- ...S,
149
+ }, nt = {
150
+ ...C,
152
151
  background: "#ffffff"
153
- }, O = {
154
- ...S,
152
+ }, A = {
153
+ ...C,
155
154
  background: "#ecfdf3",
156
155
  border: "1px solid #2f855a"
157
- }, ot = {
158
- ...S,
156
+ }, rt = {
157
+ ...C,
159
158
  background: "#fff4ed",
160
159
  border: "1px solid #c2410c"
161
- }, k = {
160
+ }, it = {
162
161
  display: "block",
163
162
  maxWidth: "100%",
164
163
  minWidth: 0
165
- }, st = {
164
+ }, at = {
166
165
  display: "grid",
167
166
  gap: 2,
168
167
  minWidth: 0
169
- }, A = "input", j = "output", ct = {
168
+ }, j = "input", ot = "output", st = {
170
169
  endEvent: "結束",
171
170
  exclusiveGateway: "條件分流",
172
171
  parallelGateway: "並行處理",
173
172
  serviceTask: "系統",
174
173
  startEvent: "開始",
175
174
  userTask: "簽核"
176
- }, lt = [{
175
+ }, ct = [{
177
176
  icon: ve,
178
177
  label: "簽核節點",
179
178
  type: "userTask"
@@ -181,23 +180,23 @@ var Re = {
181
180
  icon: he,
182
181
  label: "知會節點",
183
182
  type: "serviceTask"
184
- }], ut = [{
183
+ }], lt = [{
185
184
  icon: me,
186
185
  label: "條件分流",
187
186
  type: "exclusiveGateway"
188
- }], dt = [{
187
+ }], ut = [{
189
188
  id: "AND",
190
189
  name: "全部前置完成"
191
190
  }, {
192
191
  id: "OR",
193
192
  name: "任一前置完成"
194
- }], ft = [{
193
+ }], dt = [{
195
194
  id: "RESTART",
196
195
  name: "重新送出後從開始重跑"
197
196
  }, {
198
197
  id: "FROM_RETURN_POINT",
199
198
  name: "重新送出後回到退回節點"
200
- }], pt = [
199
+ }], ft = [
201
200
  {
202
201
  id: "DIRECT",
203
202
  name: "指定會員"
@@ -238,13 +237,13 @@ var Re = {
238
237
  name: "第三層主管",
239
238
  value: 3
240
239
  }
241
- ], mt = [{
240
+ ], pt = [{
242
241
  id: "NONE",
243
242
  name: "停止流程並提示"
244
243
  }, {
245
244
  id: "DIRECT",
246
245
  name: "固定改派"
247
- }], N = [
246
+ }], mt = [
248
247
  {
249
248
  id: "EQUALS",
250
249
  name: "等於"
@@ -305,178 +304,178 @@ var Re = {
305
304
  id: "CUSTOM",
306
305
  name: "既有自訂規則"
307
306
  }, vt = "member-001", yt = {
308
- endEvent: P,
309
- exclusiveGateway: P,
310
- parallelGateway: P,
311
- serviceTask: P,
312
- startEvent: P,
313
- userTask: P
307
+ endEvent: N,
308
+ exclusiveGateway: N,
309
+ parallelGateway: N,
310
+ serviceTask: N,
311
+ startEvent: N,
312
+ userTask: N
314
313
  };
315
- function bt({ templateId: r, activeHref: a }) {
316
- let fe = e(), me = n(), he = a ?? me.templates(), [ve, Te] = d(null), [De, _] = d(null), [v, y] = d(zt()), [We, Ke] = d(""), [b, Je] = d(null), [S, tt] = d(null), [nt, C] = d(null), [rt, it] = d(null), [w, T] = d("start"), [E, D] = d([]), [at, O] = d(null), [ot, k] = d(null), [st, A] = d(!0), [j, N] = d(!1), [ht, bt] = d(!1), [P, St] = d([]), Ct = l(() => JSON.stringify({
314
+ function bt({ templateId: n }) {
315
+ let i = e(), fe = t(), [me, he] = u(null), [ve, _] = u(null), [v, y] = u(zt()), [De, Oe] = u(""), [b, We] = u(null), [x, Ke] = u(null), [C, $e] = u(null), [et, w] = u(null), [T, E] = u("start"), [D, O] = u([]), [tt, k] = u(null), [nt, A] = u(null), [rt, it] = u(!0), [at, j] = u(!1), [ot, mt] = u(!1), [ht, bt] = u([]), N = l(() => JSON.stringify({
317
316
  formDefinitionVersionId: b,
318
- initiatorPolicyCel: S,
317
+ initiatorPolicyCel: x,
319
318
  workflowDefinition: v
320
319
  }), [
321
320
  b,
322
- S,
321
+ x,
323
322
  v
324
- ]), wt = !!We && Ct !== We, [Tt, F] = d(!1), [I, Dt] = d([]), [L, Mt] = d([]), [R, It] = d([]), [Lt, Rt] = d([]), [Zt, en] = d(!1), [nn, V] = d(!1), [H, cn] = d("{}"), [U, pn] = d(null), [W, G] = d(null), [wn, Tn] = d(void 0), En = u(null);
323
+ ]), St = !!De && N !== De, [Ct, wt] = u(!1), [P, F] = u([]), [I, Et] = u([]), [L, jt] = u([]), [Mt, It] = u([]), [Lt, Rt] = u(!1), [Zt, en] = u(!1), [nn, B] = u("{}"), [V, cn] = u(null), [fn, mn] = u(null), [H, U] = u(void 0), Tn = ee(null);
325
324
  c(() => {
326
- er();
327
- }, [r]), c(() => {
325
+ Qn();
326
+ }, [n]), c(() => {
328
327
  function e(e) {
329
- wt && (e.preventDefault(), e.returnValue = "");
328
+ St && (e.preventDefault(), e.returnValue = "");
330
329
  }
331
330
  return window.addEventListener("beforeunload", e), () => {
332
331
  window.removeEventListener("beforeunload", e);
333
332
  };
334
- }, [wt]), c(() => {
335
- ar(v);
336
- }, [v, I]), c(() => {
337
- y((e) => jt(e));
333
+ }, [St]), c(() => {
334
+ nr(v);
335
+ }, [v, P]), c(() => {
336
+ y((e) => At(e));
338
337
  }, [v.edges, v.nodes]);
339
- function Dn() {
340
- wt && !window.confirm("目前有尚未儲存的流程草稿,確定要離開嗎?") || fe.push(me.templates());
338
+ function En() {
339
+ St && !window.confirm("目前有尚未儲存的流程草稿,確定要離開嗎?") || i.push(fe.templates());
341
340
  }
342
- let K = l(() => v.nodes.find((e) => e.id === w) ?? null, [w, v.nodes]), jn = K ? sn(K) : !1, Mn = E.length > 0 || jn, Nn = ee(() => {
343
- let e = K && sn(K) ? K.id : null;
341
+ let W = l(() => v.nodes.find((e) => e.id === T) ?? null, [T, v.nodes]), Dn = W ? sn(W) : !1, kn = D.length > 0 || Dn, Mn = s(() => {
342
+ let e = W && sn(W) ? W.id : null;
344
343
  y((t) => ({
345
344
  ...t,
346
- edges: t.edges.filter((t) => !E.includes(t.id) && t.source !== e && t.target !== e),
345
+ edges: t.edges.filter((t) => !D.includes(t.id) && t.source !== e && t.target !== e),
347
346
  nodes: e ? t.nodes.filter((t) => t.id !== e) : t.nodes
348
- })), D([]), O(null), e && T("start");
349
- }, [E, K]);
347
+ })), O([]), k(null), e && E("start");
348
+ }, [D, W]);
350
349
  c(() => {
351
- if (!Mn) return;
350
+ if (!kn) return;
352
351
  function e(e) {
353
- e.key !== "Delete" && e.key !== "Backspace" || ln(e.target) || (e.preventDefault(), Nn());
352
+ e.key !== "Delete" && e.key !== "Backspace" || ln(e.target) || (e.preventDefault(), Mn());
354
353
  }
355
354
  return window.addEventListener("keydown", e), () => {
356
355
  window.removeEventListener("keydown", e);
357
356
  };
358
- }, [Mn, Nn]);
359
- let Pn = l(() => v.edges.find((e) => e.id === at) ?? null, [at, v.edges]), Fn = l(() => E.length === 1 ? v.edges.find((e) => e.id === E[0]) ?? null : null, [E, v.edges]), q = l(() => E.map((e) => v.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [E, v.edges]), J = l(() => rt ?? Qt(S, nt), [
360
- S,
361
- rt,
362
- nt
363
- ]), Jn = l(() => v.nodes.map((e) => Et(e, I, L, R, e.id === w, J)), [
364
- J,
357
+ }, [kn, Mn]);
358
+ let Nn = l(() => v.edges.find((e) => e.id === tt) ?? null, [tt, v.edges]), Pn = l(() => D.length === 1 ? v.edges.find((e) => e.id === D[0]) ?? null : null, [D, v.edges]), Fn = l(() => D.map((e) => v.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [D, v.edges]), G = l(() => et ?? Qt(x, C), [
359
+ x,
360
+ et,
361
+ C
362
+ ]), Rn = l(() => v.nodes.map((e) => Tt(e, P, I, L, e.id === T, G)), [
363
+ G,
364
+ P,
365
365
  I,
366
366
  L,
367
- R,
368
- w,
367
+ T,
369
368
  v.nodes
370
- ]), Yn = l(() => v.edges.map((e) => Ot(e, v.nodes, E.includes(e.id))), [
371
- E,
369
+ ]), Wn = l(() => v.edges.map((e) => Dt(e, v.nodes, D.includes(e.id))), [
370
+ D,
372
371
  v.edges,
373
372
  v.nodes
374
- ]), Y = l(() => B(P, b) ?? B(un(ve?.formVersions ?? []), b), [
373
+ ]), K = l(() => z(ht, b) ?? z(un(me?.formVersions ?? []), b), [
375
374
  b,
376
- P,
377
- ve?.formVersions
378
- ]), Zn = l(() => gn(P, Y), [P, Y]), X = l(() => Ln(v), [v]), Z = l(() => Rn(v), [v]), $n = l(() => $t(J), [J]);
379
- async function er() {
380
- A(!0), k(null);
375
+ ht,
376
+ me?.formVersions
377
+ ]), Xn = l(() => _n(ht, K), [ht, K]), q = l(() => Ln(v), [v]), J = l(() => zn(v), [v]), Y = l(() => $t(G), [G]);
378
+ async function Qn() {
379
+ it(!0), A(null);
381
380
  try {
382
- let [e, t] = await Promise.all([Ne(r), be()]), n = e.versions.find((e) => e.status === "DRAFT") ?? null, i = n ?? e.versions[0] ?? null;
383
- Te(e), _(n), Mt(t.orgUnits), It(t.positions), Rt(t.memberships), St(un(e.formVersions));
381
+ let [e, t] = await Promise.all([Me(n), ye()]), r = e.versions.find((e) => e.status === "DRAFT") ?? null, i = r ?? e.versions[0] ?? null;
382
+ he(e), _(r), Et(t.orgUnits), jt(t.positions), It(t.memberships), bt(un(e.formVersions));
384
383
  let a = i?.workflowDefinition ?? zt(), o = i?.formDefinitionVersionId ?? e.formVersions[0]?.id ?? null, s = i?.initiatorPolicyCel ?? null;
385
- y(a), Je(o), tt(s), Ke(JSON.stringify({
384
+ y(a), We(o), Ke(s), Oe(JSON.stringify({
386
385
  formDefinitionVersionId: o,
387
386
  initiatorPolicyCel: s,
388
387
  workflowDefinition: a
389
- })), C(i && !e.template.currentVersionId && !i.initiatorPolicyCel && Bt(i.workflowDefinition) ? "NONE" : null), it(null), T(i?.workflowDefinition.nodes[0]?.id ?? "start"), D([]), O(null);
388
+ })), $e(i && !e.template.currentVersionId && !i.initiatorPolicyCel && Bt(i.workflowDefinition) ? "NONE" : null), w(null), E(i?.workflowDefinition.nodes[0]?.id ?? "start"), O([]), k(null);
390
389
  } catch (e) {
391
- k(nr(e));
390
+ A(Q(e));
392
391
  } finally {
393
- A(!1);
392
+ it(!1);
394
393
  }
395
394
  }
396
- async function rr(e) {
397
- bt(!0), k(null);
395
+ async function er(e) {
396
+ mt(!0), A(null);
398
397
  try {
399
- St(gn(un(await Ie(e)), Y));
398
+ bt(_n(un(await Fe(e)), K));
400
399
  } catch (e) {
401
- k(nr(e));
400
+ A(Q(e));
402
401
  } finally {
403
- bt(!1);
402
+ mt(!1);
404
403
  }
405
404
  }
406
- async function ir(e) {
407
- F(!0), k(null);
405
+ async function Z(e) {
406
+ wt(!0), A(null);
408
407
  try {
409
- let t = await Fe(e);
410
- Dt((e) => kn(e, _n(t)));
408
+ let t = await Pe(e);
409
+ F((e) => An(e, vn(t)));
411
410
  } catch (e) {
412
- k(nr(e));
411
+ A(Q(e));
413
412
  } finally {
414
- F(!1);
413
+ wt(!1);
415
414
  }
416
415
  }
417
- async function ar(e) {
418
- let t = An(e).filter((e) => !I.some((t) => t.memberId === e));
416
+ async function nr(e) {
417
+ let t = jn(e).filter((e) => !P.some((t) => t.memberId === e));
419
418
  if (t.length !== 0) try {
420
- let e = await Pe(t);
421
- Dt((t) => kn(t, _n(e)));
419
+ let e = await Ne(t);
420
+ F((t) => An(t, vn(e)));
422
421
  } catch {
423
- Dt((e) => kn(e, t.map(vn)));
422
+ F((e) => An(e, t.map(yn)));
424
423
  }
425
424
  }
426
- async function or() {
427
- N(!0), k(null);
425
+ async function rr() {
426
+ j(!0), A(null);
428
427
  try {
429
- let e = Ln(v), t = $t(J);
428
+ let e = Ln(v), t = $t(G);
430
429
  if (e || t) {
431
430
  let n = e ?? t ?? "流程設定未完成";
432
- throw k(n), Error(n);
431
+ throw A(n), Error(n);
433
432
  }
434
- let n = await Le({
433
+ let r = await Ie({
435
434
  formDefinitionVersionId: b,
436
- initiatorPolicyCel: S,
437
- versionId: (De ?? await je(r)).id,
435
+ initiatorPolicyCel: x,
436
+ versionId: (ve ?? await Ae(n)).id,
438
437
  workflowDefinition: v
439
438
  });
440
- return _(n), await er(), n;
439
+ return _(r), await Qn(), r;
441
440
  } catch (e) {
442
- throw k(nr(e)), e;
441
+ throw A(Q(e)), e;
443
442
  } finally {
444
- N(!1);
443
+ j(!1);
445
444
  }
446
445
  }
447
- async function sr() {
448
- N(!0), k(null);
446
+ async function ir() {
447
+ j(!0), A(null);
449
448
  try {
450
- await Me((await or()).id), await er();
449
+ await je((await rr()).id), await Qn();
451
450
  } catch (e) {
452
- k(nr(e));
451
+ A(Q(e));
453
452
  } finally {
454
- N(!1);
453
+ j(!1);
455
454
  }
456
455
  }
457
- function cr() {
458
- cn(JSON.stringify(dn(Y), null, 2)), pn(null), G(null), en(!0);
456
+ function ar() {
457
+ B(JSON.stringify(dn(K), null, 2)), cn(null), mn(null), Rt(!0);
459
458
  }
460
- function lr() {
461
- nn || en(!1);
459
+ function or() {
460
+ Zt || Rt(!1);
462
461
  }
463
- async function ur() {
464
- V(!0), G(null), pn(null);
462
+ async function sr() {
463
+ en(!0), mn(null), cn(null);
465
464
  try {
466
- pn(await Ae({
467
- formData: fn(H),
465
+ cn(await ke({
466
+ formData: pn(nn),
468
467
  initiatorMemberId: vt,
469
- initiatorMetadataSnapshot: Cn(vt, Lt),
468
+ initiatorMetadataSnapshot: wn(vt, Mt),
470
469
  workflowDefinition: v
471
470
  }));
472
471
  } catch (e) {
473
- G(nr(e));
472
+ mn(Q(e));
474
473
  } finally {
475
- V(!1);
474
+ en(!1);
476
475
  }
477
476
  }
478
- function dr(e) {
479
- let t = ke(e, Jn);
477
+ function cr(e) {
478
+ let t = Ee(e, Rn);
480
479
  y((e) => ({
481
480
  ...e,
482
481
  nodes: e.nodes.map((e) => {
@@ -488,34 +487,34 @@ function bt({ templateId: r, activeHref: a }) {
488
487
  })
489
488
  }));
490
489
  }
491
- function fr(e) {
490
+ function lr(e) {
492
491
  if (!an(e, v.nodes)) return;
493
- let t = v.nodes.some((t) => t.id === e.source && t.type === "exclusiveGateway"), n = z(e.source, e.target, {});
492
+ let t = v.nodes.some((t) => t.id === e.source && t.type === "exclusiveGateway"), n = R(e.source, e.target, {});
494
493
  y((e) => ({
495
494
  ...e,
496
495
  edges: [...e.edges, n]
497
- })), T(null), D([n.id]), O(t ? n.id : null);
496
+ })), E(null), O([n.id]), k(t ? n.id : null);
498
497
  }
499
- function pr(e, t) {
500
- e.stopPropagation(), D((n) => e.shiftKey || e.metaKey || e.ctrlKey ? on(n, t.id) : [t.id]), T(null);
498
+ function ur(e, t) {
499
+ e.stopPropagation(), O((n) => e.shiftKey || e.metaKey || e.ctrlKey ? on(n, t.id) : [t.id]), E(null);
501
500
  }
502
- function mr() {
503
- O(null);
501
+ function dr() {
502
+ k(null);
504
503
  }
505
- function hr(e) {
504
+ function fr(e) {
506
505
  let t = Ft({
507
506
  definition: v,
508
507
  node: Nt(e, Pt(v.nodes, e)),
509
- selectedEdgeId: E.length === 1 ? E[0] : null,
510
- selectedNodeId: w
511
- }), n = Vt(t.definition), r = In(n, En.current);
512
- y(n), T(t.selectedNodeId), D(t.selectedEdgeIds), O(t.editingEdgeId), r && Tn(r);
508
+ selectedEdgeId: D.length === 1 ? D[0] : null,
509
+ selectedNodeId: T
510
+ }), n = Vt(t.definition), r = In(n, Tn.current);
511
+ y(n), E(t.selectedNodeId), O(t.selectedEdgeIds), k(t.editingEdgeId), r && U(r);
513
512
  }
514
- function gr(e) {
515
- K && xr(K.id, (t) => kt(t, e));
513
+ function pr(e) {
514
+ W && vr(W.id, (t) => Ot(t, e));
516
515
  }
517
516
  function $(e) {
518
- !K || K.type !== "userTask" || xr(K.id, (t) => t.type === "userTask" ? {
517
+ !W || W.type !== "userTask" || vr(W.id, (t) => t.type === "userTask" ? {
519
518
  ...t,
520
519
  data: {
521
520
  ...t.data,
@@ -524,8 +523,8 @@ function bt({ templateId: r, activeHref: a }) {
524
523
  }
525
524
  } : t);
526
525
  }
527
- function _r(e) {
528
- !K || K.type !== "userTask" || xr(K.id, (t) => t.type === "userTask" ? {
526
+ function mr(e) {
527
+ !W || W.type !== "userTask" || vr(W.id, (t) => t.type === "userTask" ? {
529
528
  ...t,
530
529
  data: {
531
530
  ...t.data,
@@ -536,8 +535,8 @@ function bt({ templateId: r, activeHref: a }) {
536
535
  }
537
536
  } : t);
538
537
  }
539
- function vr(e) {
540
- !K || K.type !== "serviceTask" || xr(K.id, (t) => t.type === "serviceTask" ? {
538
+ function hr(e) {
539
+ !W || W.type !== "serviceTask" || vr(W.id, (t) => t.type === "serviceTask" ? {
541
540
  ...t,
542
541
  data: {
543
542
  ...t.data,
@@ -545,30 +544,30 @@ function bt({ templateId: r, activeHref: a }) {
545
544
  }
546
545
  } : t);
547
546
  }
548
- function yr(e) {
549
- it(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), C(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), tt(tn(e, L));
547
+ function gr(e) {
548
+ w(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), $e(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), Ke(tn(e, I));
550
549
  }
551
- function br(e) {
552
- !K || K.type === "startEvent" || xr(K.id, (t) => At(t, e));
550
+ function _r(e) {
551
+ !W || W.type === "startEvent" || vr(W.id, (t) => kt(t, e));
553
552
  }
554
- function xr(e, t) {
553
+ function vr(e, t) {
555
554
  y((n) => ({
556
555
  ...n,
557
556
  nodes: n.nodes.map((n) => n.id === e ? t(n) : n)
558
557
  }));
559
558
  }
560
- function Sr(e, t) {
559
+ function yr(e, t) {
561
560
  y((n) => ({
562
561
  ...n,
563
562
  edges: n.edges.map((n) => n.id === e ? t(n) : n)
564
563
  }));
565
564
  }
566
- function Cr(e, t) {
565
+ function br(e, t) {
567
566
  y((n) => {
568
567
  let r = n.edges.find((t) => t.id === e);
569
568
  return r ? {
570
569
  ...n,
571
- edges: n.edges.map((e) => t && e.source === r.source && e.id !== r.id && Q(e, n.nodes) ? {
570
+ edges: n.edges.map((e) => t && e.source === r.source && e.id !== r.id && X(e, n.nodes) ? {
572
571
  ...e,
573
572
  data: {
574
573
  ...e.data,
@@ -584,296 +583,293 @@ function bt({ templateId: r, activeHref: a }) {
584
583
  } : n;
585
584
  });
586
585
  }
587
- function wr({ edgeId: e, fieldKey: t, operator: n, value: r }) {
588
- let i = Y?.schema ?? null;
589
- Sr(e, (e) => {
590
- let a = Bn(i, t ?? e.data.conditionFieldKey ?? null), o = Wn(a, n ?? e.data.conditionOperator ?? null), s = Gn(a, o, r ?? e.data.conditionValue ?? null), ee = qn(a, o, s);
586
+ function xr({ edgeId: e, fieldKey: t, operator: n, value: r }) {
587
+ let i = K?.schema ?? null;
588
+ yr(e, (e) => {
589
+ let a = Vn(i, t ?? e.data.conditionFieldKey ?? null), o = Kn(a, n ?? e.data.conditionOperator ?? null), s = qn(a, o, r ?? e.data.conditionValue ?? null), c = Yn(a, o, s);
591
590
  return {
592
591
  ...e,
593
592
  data: {
594
593
  ...e.data,
595
- condition: Xn(a, o, s),
594
+ condition: Zn(a, o, s),
596
595
  conditionFieldKey: a?.fieldKey,
597
596
  conditionOperator: o,
598
597
  conditionValue: s,
599
598
  isDefault: !1,
600
- label: ee
599
+ label: c
601
600
  }
602
601
  };
603
602
  });
604
603
  }
605
- function Tr() {
606
- let e = Vt(v), t = In(e, En.current);
607
- y(e), t && Tn(t);
604
+ function Sr() {
605
+ let e = Vt(v), t = In(e, Tn.current);
606
+ y(e), t && U(t);
608
607
  }
609
- return /* @__PURE__ */ g(t, {
610
- activeHref: he,
611
- children: [
612
- /* @__PURE__ */ h("style", { children: Ge }),
613
- /* @__PURE__ */ h(ae, { children: /* @__PURE__ */ g(ye, {
614
- description: `${De ? `草稿 v${De.version}` : "尚未建立草稿"} ·${ve?.template.currentVersionId ? " 已發布版本" : " 尚未發布"}`,
615
- onBackClick: Dn,
616
- title: ve?.template.name ?? "流程設計器",
617
- children: [
618
- /* @__PURE__ */ h(f, {
619
- "aria-label": "儲存草稿",
620
- disabled: j || !!X || !!$n,
621
- icon: ge,
622
- iconType: "icon-only",
623
- onClick: () => void or(),
624
- variant: "base-secondary",
625
- children: "儲存草稿"
626
- }),
627
- /* @__PURE__ */ h(f, {
628
- disabled: st || !!X || !!$n,
629
- icon: pe,
630
- iconType: "leading",
631
- onClick: cr,
632
- variant: "base-secondary",
633
- children: "試跑流程"
634
- }),
635
- /* @__PURE__ */ h(f, {
636
- disabled: j || !De || !!X || !!$n,
637
- icon: de,
638
- iconType: "leading",
639
- onClick: () => void sr(),
640
- variant: "base-primary",
641
- children: "發布版本"
642
- })
643
- ]
644
- }) }),
645
- /* @__PURE__ */ h(se, { children: /* @__PURE__ */ h(oe, { children: /* @__PURE__ */ g("div", {
646
- style: Re,
647
- children: [
648
- ot ? /* @__PURE__ */ h(m, {
649
- color: "text-error",
650
- variant: "body",
651
- children: ot
652
- }) : null,
653
- X ? /* @__PURE__ */ h(m, {
654
- color: "text-error",
655
- variant: "body",
656
- children: X
657
- }) : null,
658
- $n ? /* @__PURE__ */ h(m, {
659
- color: "text-error",
660
- variant: "body",
661
- children: $n
662
- }) : null,
663
- /* @__PURE__ */ h("div", {
664
- style: x,
665
- children: /* @__PURE__ */ h(s, {
666
- hintText: Z ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
667
- label: "綁定表單版本",
668
- name: "formDefinitionVersionId",
669
- required: !0,
670
- children: /* @__PURE__ */ h(te, {
671
- asyncData: !0,
672
- disabled: st || Z,
673
- disabledOptionsFilter: !0,
674
- emptyText: "沒有符合的已發布表單版本",
675
- isForceClearable: !!b && !Z,
676
- loading: ht,
677
- loadingText: "搜尋表單版本中...",
678
- mode: "single",
679
- onChange: (e) => {
680
- Z || Je(e?.id ?? null);
681
- },
682
- onClear: () => {
683
- Z || Je(null);
684
- },
685
- onSearch: rr,
686
- onVisibilityChange: (e) => {
687
- e && !Z && rr("");
688
- },
689
- options: [...Zn],
690
- placeholder: "選擇已發布表單版本",
691
- searchDebounceTime: 300,
692
- value: Y
693
- })
608
+ return /* @__PURE__ */ g(m, { children: [
609
+ /* @__PURE__ */ h("style", { children: Ue }),
610
+ /* @__PURE__ */ h(ae, { children: /* @__PURE__ */ g(ue, {
611
+ description: `${ve ? `草稿 v${ve.version}` : "尚未建立草稿"} ·${me?.template.currentVersionId ? " 已發布版本" : " 尚未發布"}`,
612
+ onBackClick: En,
613
+ title: me?.template.name ?? "流程設計器",
614
+ children: [
615
+ /* @__PURE__ */ h(d, {
616
+ "aria-label": "儲存草稿",
617
+ disabled: at || !!q || !!Y,
618
+ icon: ge,
619
+ iconType: "icon-only",
620
+ onClick: () => void rr(),
621
+ variant: "base-secondary",
622
+ children: "儲存草稿"
623
+ }),
624
+ /* @__PURE__ */ h(d, {
625
+ disabled: rt || !!q || !!Y,
626
+ icon: pe,
627
+ iconType: "leading",
628
+ onClick: ar,
629
+ variant: "base-secondary",
630
+ children: "試跑流程"
631
+ }),
632
+ /* @__PURE__ */ h(d, {
633
+ disabled: at || !ve || !!q || !!Y,
634
+ icon: de,
635
+ iconType: "leading",
636
+ onClick: () => void ir(),
637
+ variant: "base-primary",
638
+ children: "發布版本"
639
+ })
640
+ ]
641
+ }) }),
642
+ /* @__PURE__ */ h(se, { children: /* @__PURE__ */ h(oe, { children: /* @__PURE__ */ g("div", {
643
+ style: Le,
644
+ children: [
645
+ nt ? /* @__PURE__ */ h(p, {
646
+ color: "text-error",
647
+ variant: "body",
648
+ children: nt
649
+ }) : null,
650
+ q ? /* @__PURE__ */ h(p, {
651
+ color: "text-error",
652
+ variant: "body",
653
+ children: q
654
+ }) : null,
655
+ Y ? /* @__PURE__ */ h(p, {
656
+ color: "text-error",
657
+ variant: "body",
658
+ children: Y
659
+ }) : null,
660
+ /* @__PURE__ */ h("div", {
661
+ style: S,
662
+ children: /* @__PURE__ */ h(o, {
663
+ hintText: J ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
664
+ label: "綁定表單版本",
665
+ name: "formDefinitionVersionId",
666
+ required: !0,
667
+ children: /* @__PURE__ */ h(te, {
668
+ asyncData: !0,
669
+ disabled: rt || J,
670
+ disabledOptionsFilter: !0,
671
+ emptyText: "沒有符合的已發布表單版本",
672
+ isForceClearable: !!b && !J,
673
+ loading: ot,
674
+ loadingText: "搜尋表單版本中...",
675
+ mode: "single",
676
+ onChange: (e) => {
677
+ J || We(e?.id ?? null);
678
+ },
679
+ onClear: () => {
680
+ J || We(null);
681
+ },
682
+ onSearch: er,
683
+ onVisibilityChange: (e) => {
684
+ e && !J && er("");
685
+ },
686
+ options: [...Xn],
687
+ placeholder: "選擇已發布表單版本",
688
+ searchDebounceTime: 300,
689
+ value: K
694
690
  })
695
- }),
696
- /* @__PURE__ */ g("div", {
691
+ })
692
+ }),
693
+ /* @__PURE__ */ g("div", {
694
+ style: Re,
695
+ children: [/* @__PURE__ */ h("div", {
696
+ ref: Tn,
697
697
  style: ze,
698
- children: [/* @__PURE__ */ h("div", {
699
- ref: En,
700
- style: Be,
701
- children: /* @__PURE__ */ g(Oe, {
702
- connectionMode: Se.Strict,
703
- edges: Yn,
704
- fitView: !0,
705
- isValidConnection: (e) => an(e, v.nodes),
706
- nodeTypes: yt,
707
- nodes: Jn,
708
- deleteKeyCode: null,
709
- multiSelectionKeyCode: [
710
- "Shift",
711
- "Meta",
712
- "Control"
713
- ],
714
- onConnect: fr,
715
- onEdgeClick: pr,
716
- onNodeClick: (e, t) => {
717
- T(t.id), D([]);
718
- },
719
- onNodesChange: dr,
720
- onPaneClick: () => {
721
- T(null), D([]);
722
- },
723
- onViewportChange: Tn,
724
- viewport: wn,
725
- children: [
726
- /* @__PURE__ */ h(xe, {}),
727
- /* @__PURE__ */ h("style", { children: Ye }),
728
- /* @__PURE__ */ h(we, { children: Mn ? /* @__PURE__ */ h(Ce, {
729
- "aria-label": "刪除選取項目",
730
- className: "workflow-selection-delete-control",
731
- onClick: Nn,
698
+ children: /* @__PURE__ */ g(Te, {
699
+ connectionMode: xe.Strict,
700
+ edges: Wn,
701
+ fitView: !0,
702
+ isValidConnection: (e) => an(e, v.nodes),
703
+ nodeTypes: yt,
704
+ nodes: Rn,
705
+ deleteKeyCode: null,
706
+ multiSelectionKeyCode: [
707
+ "Shift",
708
+ "Meta",
709
+ "Control"
710
+ ],
711
+ onConnect: lr,
712
+ onEdgeClick: ur,
713
+ onNodeClick: (e, t) => {
714
+ E(t.id), O([]);
715
+ },
716
+ onNodesChange: cr,
717
+ onPaneClick: () => {
718
+ E(null), O([]);
719
+ },
720
+ onViewportChange: U,
721
+ viewport: H,
722
+ children: [
723
+ /* @__PURE__ */ h(be, {}),
724
+ /* @__PURE__ */ h("style", { children: qe }),
725
+ /* @__PURE__ */ h(Ce, { children: kn ? /* @__PURE__ */ h(Se, {
726
+ "aria-label": "刪除選取項目",
727
+ className: "workflow-selection-delete-control",
728
+ onClick: Mn,
729
+ style: Be,
730
+ title: "刪除選取項目",
731
+ children: /* @__PURE__ */ h("span", {
732
732
  style: Ve,
733
- title: "刪除選取項目",
734
- children: /* @__PURE__ */ h("span", {
735
- style: He,
736
- children: /* @__PURE__ */ h(ne, {
737
- color: "error",
738
- icon: _e,
739
- size: 16
740
- })
733
+ children: /* @__PURE__ */ h(ne, {
734
+ color: "error",
735
+ icon: _e,
736
+ size: 16
741
737
  })
742
- }) : null }),
743
- /* @__PURE__ */ h(xt, { onApplyAutoLayout: Tr }),
744
- /* @__PURE__ */ h(Ee, {})
745
- ]
746
- })
747
- }), /* @__PURE__ */ g("div", {
748
- className: Ue,
749
- style: Xe,
750
- children: [
751
- /* @__PURE__ */ h(m, {
752
- component: "h2",
753
- variant: "h3",
754
- children: "流程工具"
755
- }),
756
- /* @__PURE__ */ g("div", {
757
- style: et,
758
- children: [/* @__PURE__ */ h(m, {
759
- color: "text-neutral",
760
- variant: "caption",
761
- children: "動作節點"
762
- }), /* @__PURE__ */ h("div", {
763
- style: $e,
764
- children: lt.map((e) => /* @__PURE__ */ h(f, {
765
- icon: e.icon,
766
- iconType: "leading",
767
- onClick: () => hr(e.type),
768
- size: "sub",
769
- variant: "base-secondary",
770
- children: e.label
771
- }, e.type))
772
- })]
773
- }),
774
- /* @__PURE__ */ g("div", {
775
- style: et,
776
- children: [/* @__PURE__ */ h(m, {
777
- color: "text-neutral",
778
- variant: "caption",
779
- children: "流程控制"
780
- }), /* @__PURE__ */ h("div", {
781
- style: $e,
782
- children: ut.map((e) => /* @__PURE__ */ h(f, {
783
- icon: e.icon,
784
- iconType: "leading",
785
- onClick: () => hr(e.type),
786
- size: "sub",
787
- variant: "base-secondary",
788
- children: e.label
789
- }, e.type))
790
- })]
791
- }),
792
- q.length > 1 ? Mr(q) : null,
793
- q.length === 1 && Fn ? Nr(Fn) : null,
794
- q.length === 0 && K ? Dr(K) : null
738
+ })
739
+ }) : null }),
740
+ /* @__PURE__ */ h(xt, { onApplyAutoLayout: Sr }),
741
+ /* @__PURE__ */ h(we, {})
795
742
  ]
796
- })]
797
- })
798
- ]
799
- }) }) }),
800
- Pr(Pn),
801
- Er()
802
- ]
803
- });
804
- function Er() {
743
+ })
744
+ }), /* @__PURE__ */ g("div", {
745
+ className: He,
746
+ style: Je,
747
+ children: [
748
+ /* @__PURE__ */ h(p, {
749
+ component: "h2",
750
+ variant: "h3",
751
+ children: "流程工具"
752
+ }),
753
+ /* @__PURE__ */ g("div", {
754
+ style: Qe,
755
+ children: [/* @__PURE__ */ h(p, {
756
+ color: "text-neutral",
757
+ variant: "caption",
758
+ children: "動作節點"
759
+ }), /* @__PURE__ */ h("div", {
760
+ style: Ze,
761
+ children: ct.map((e) => /* @__PURE__ */ h(d, {
762
+ icon: e.icon,
763
+ iconType: "leading",
764
+ onClick: () => fr(e.type),
765
+ size: "sub",
766
+ variant: "base-secondary",
767
+ children: e.label
768
+ }, e.type))
769
+ })]
770
+ }),
771
+ /* @__PURE__ */ g("div", {
772
+ style: Qe,
773
+ children: [/* @__PURE__ */ h(p, {
774
+ color: "text-neutral",
775
+ variant: "caption",
776
+ children: "流程控制"
777
+ }), /* @__PURE__ */ h("div", {
778
+ style: Ze,
779
+ children: lt.map((e) => /* @__PURE__ */ h(d, {
780
+ icon: e.icon,
781
+ iconType: "leading",
782
+ onClick: () => fr(e.type),
783
+ size: "sub",
784
+ variant: "base-secondary",
785
+ children: e.label
786
+ }, e.type))
787
+ })]
788
+ }),
789
+ Fn.length > 1 ? kr(Fn) : null,
790
+ Fn.length === 1 && Pn ? Ar(Pn) : null,
791
+ Fn.length === 0 && W ? wr(W) : null
792
+ ]
793
+ })]
794
+ })
795
+ ]
796
+ }) }) }),
797
+ jr(Nn),
798
+ Cr()
799
+ ] });
800
+ function Cr() {
805
801
  return /* @__PURE__ */ h(ie, {
806
802
  cancelText: "關閉",
807
803
  confirmText: "執行試跑",
808
- loading: nn,
804
+ loading: Zt,
809
805
  modalType: "standard",
810
- onCancel: lr,
811
- onClose: lr,
812
- onConfirm: () => void ur(),
813
- open: Zt,
806
+ onCancel: or,
807
+ onClose: or,
808
+ onConfirm: () => void sr(),
809
+ open: Lt,
814
810
  showModalFooter: !0,
815
811
  showModalHeader: !0,
816
812
  size: "wide",
817
813
  supportingText: `使用 ${vt} 與範例表單資料模擬目前畫布流程,不會建立案件。`,
818
814
  title: "試跑流程",
819
815
  children: /* @__PURE__ */ g("div", {
820
- style: x,
816
+ style: S,
821
817
  children: [
822
- /* @__PURE__ */ h(s, {
818
+ /* @__PURE__ */ h(o, {
823
819
  label: "表單資料 JSON",
824
820
  name: "dryRunFormDataJson",
825
821
  required: !0,
826
822
  children: /* @__PURE__ */ h(ce, {
827
- onChange: (e) => cn(e.target.value),
823
+ onChange: (e) => B(e.target.value),
828
824
  resize: "vertical",
829
825
  rows: 8,
830
- value: H
826
+ value: nn
831
827
  })
832
828
  }),
833
- W ? /* @__PURE__ */ h(m, {
829
+ fn ? /* @__PURE__ */ h(p, {
834
830
  color: "text-error",
835
831
  variant: "body",
836
- children: W
832
+ children: fn
837
833
  }) : null,
838
- U ? /* @__PURE__ */ g("div", {
839
- style: Ze,
834
+ V ? /* @__PURE__ */ g("div", {
835
+ style: Ye,
840
836
  children: [
841
- /* @__PURE__ */ h(m, {
842
- color: U.valid ? "text-success" : "text-error",
837
+ /* @__PURE__ */ h(p, {
838
+ color: V.valid ? "text-success" : "text-error",
843
839
  variant: "label-primary-highlight",
844
- children: U.valid ? "試跑通過" : "試跑失敗"
840
+ children: V.valid ? "試跑通過" : "試跑失敗"
845
841
  }),
846
- U.errors.map((e) => /* @__PURE__ */ h(m, {
842
+ V.errors.map((e) => /* @__PURE__ */ h(p, {
847
843
  color: "text-error",
848
844
  variant: "body",
849
845
  children: e
850
846
  }, e)),
851
- U.steps.map((e) => /* @__PURE__ */ g("div", {
852
- style: Qe,
847
+ V.steps.map((e) => /* @__PURE__ */ g("div", {
848
+ style: Xe,
853
849
  children: [
854
- /* @__PURE__ */ g(m, {
850
+ /* @__PURE__ */ g(p, {
855
851
  variant: "label-primary-highlight",
856
852
  children: [
857
853
  e.nodeLabel,
858
854
  " · ",
859
- mn(e.status)
855
+ hn(e.status)
860
856
  ]
861
857
  }),
862
- /* @__PURE__ */ g(m, {
858
+ /* @__PURE__ */ g(p, {
863
859
  color: "text-neutral",
864
860
  variant: "caption",
865
861
  children: [
866
- hn(e.nodeType),
862
+ gn(e.nodeType),
867
863
  e.assigneeMemberId ? ` · 處理者:${e.assigneeMemberId}` : "",
868
864
  e.edgeLabel ? ` · 來源線段:${e.edgeLabel}` : ""
869
865
  ]
870
866
  }),
871
- e.edgeReason ? /* @__PURE__ */ h(m, {
867
+ e.edgeReason ? /* @__PURE__ */ h(p, {
872
868
  color: "text-neutral",
873
869
  variant: "caption",
874
870
  children: e.edgeReason
875
871
  }) : null,
876
- e.entryCondition ? /* @__PURE__ */ g(m, {
872
+ e.entryCondition ? /* @__PURE__ */ g(p, {
877
873
  color: "text-neutral",
878
874
  variant: "caption",
879
875
  children: [
@@ -884,7 +880,7 @@ function bt({ templateId: r, activeHref: a }) {
884
880
  e.entryCondition
885
881
  ]
886
882
  }) : null,
887
- /* @__PURE__ */ h(m, {
883
+ /* @__PURE__ */ h(p, {
888
884
  color: "text-neutral",
889
885
  variant: "body",
890
886
  children: e.message
@@ -897,154 +893,154 @@ function bt({ templateId: r, activeHref: a }) {
897
893
  })
898
894
  });
899
895
  }
900
- function Dr(e) {
896
+ function wr(e) {
901
897
  return /* @__PURE__ */ g("div", {
902
- style: x,
898
+ style: S,
903
899
  children: [
904
- /* @__PURE__ */ h(m, {
900
+ /* @__PURE__ */ h(p, {
905
901
  component: "h2",
906
902
  variant: "h3",
907
903
  children: "節點屬性"
908
904
  }),
909
- /* @__PURE__ */ g(m, {
905
+ /* @__PURE__ */ g(p, {
910
906
  color: "text-neutral",
911
907
  variant: "body",
912
908
  children: [
913
- ct[e.type],
909
+ st[e.type],
914
910
  " · ",
915
911
  e.id
916
912
  ]
917
913
  }),
918
- /* @__PURE__ */ h(s, {
914
+ /* @__PURE__ */ h(o, {
919
915
  label: "顯示名稱",
920
916
  name: "nodeLabel",
921
917
  required: !0,
922
918
  children: /* @__PURE__ */ h(re, {
923
- onChange: (e) => gr(e.target.value),
919
+ onChange: (e) => pr(e.target.value),
924
920
  value: e.data.label,
925
921
  variant: "base"
926
922
  })
927
923
  }),
928
- e.type === "startEvent" ? Or() : null,
929
- e.type === "startEvent" ? null : kr(e),
930
- e.type === "userTask" ? Ar(e) : null,
931
- e.type === "serviceTask" ? jr(e) : null
924
+ e.type === "startEvent" ? Tr() : null,
925
+ e.type === "startEvent" ? null : Er(e),
926
+ e.type === "userTask" ? Dr(e) : null,
927
+ e.type === "serviceTask" ? Or(e) : null
932
928
  ]
933
929
  });
934
930
  }
935
- function Or() {
936
- let e = J.mode === "CUSTOM" ? [...gt, _t] : [...gt], t = J.mode === "ORG_UNIT" || J.mode === "ORG_UNIT_POSITION" ? xn(L, J.orgUnitId ?? "") : null, n = J.mode === "ORG_UNIT_POSITION" ? Sn(R, J.positionId ?? "") : null, r = J.mode === "ORG_UNIT_POSITION" ? On({
937
- includeDescendants: !!J.includeDescendants,
938
- memberships: Lt,
939
- orgUnitId: J.orgUnitId ?? "",
940
- orgUnits: L,
941
- positions: R
931
+ function Tr() {
932
+ let e = G.mode === "CUSTOM" ? [...gt, _t] : [...gt], t = G.mode === "ORG_UNIT" || G.mode === "ORG_UNIT_POSITION" ? Sn(I, G.orgUnitId ?? "") : null, n = G.mode === "ORG_UNIT_POSITION" ? Cn(L, G.positionId ?? "") : null, i = G.mode === "ORG_UNIT_POSITION" ? On({
933
+ includeDescendants: !!G.includeDescendants,
934
+ memberships: Mt,
935
+ orgUnitId: G.orgUnitId ?? "",
936
+ orgUnits: I,
937
+ positions: L
942
938
  }) : [];
943
- return /* @__PURE__ */ g(ue, { children: [
944
- /* @__PURE__ */ h(s, {
945
- hintText: J.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
939
+ return /* @__PURE__ */ g(m, { children: [
940
+ /* @__PURE__ */ h(o, {
941
+ hintText: G.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
946
942
  label: "發起權限",
947
943
  name: "initiatorPolicyMode",
948
944
  required: !0,
949
- children: /* @__PURE__ */ h(p, {
945
+ children: /* @__PURE__ */ h(f, {
950
946
  clearable: !1,
951
947
  onChange: (e) => {
952
948
  if (e?.id === "CUSTOM") {
953
- C(null), it(null);
949
+ $e(null), w(null);
954
950
  return;
955
951
  }
956
952
  let t = Xt(e?.id ?? null), n = rn(t);
957
- C(t === "ALL" ? null : t), it(t === "ALL" ? null : n), tt(tn(n, L));
953
+ $e(t === "ALL" ? null : t), w(t === "ALL" ? null : n), Ke(tn(n, I));
958
954
  },
959
955
  options: e,
960
956
  placeholder: "選擇誰可以發起",
961
- value: B(e, J.mode)
957
+ value: z(e, G.mode)
962
958
  })
963
959
  }),
964
- J.mode === "ORG_UNIT" || J.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
960
+ G.mode === "ORG_UNIT" || G.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
965
961
  label: "組織",
966
962
  name: "initiatorOrgUnitId",
967
963
  required: !0,
968
- children: /* @__PURE__ */ h(i, {
964
+ children: /* @__PURE__ */ h(r, {
969
965
  name: "initiatorOrgUnitId",
970
- onChange: (e) => yr({
971
- ...J,
966
+ onChange: (e) => gr({
967
+ ...G,
972
968
  orgUnitId: e?.id ?? "",
973
969
  positionId: "",
974
970
  value: e?.id ?? ""
975
971
  }),
976
- orgUnits: L,
972
+ orgUnits: I,
977
973
  placeholder: "選擇組織",
978
974
  value: t
979
975
  })
980
976
  }) : null,
981
- J.mode === "ORG_UNIT" || J.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
977
+ G.mode === "ORG_UNIT" || G.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
982
978
  label: "包含下層",
983
979
  name: "initiatorIncludeDescendants",
984
980
  children: /* @__PURE__ */ h(le, {
985
- checked: !!J.includeDescendants,
986
- onChange: (e) => yr({
987
- ...J,
981
+ checked: !!G.includeDescendants,
982
+ onChange: (e) => gr({
983
+ ...G,
988
984
  includeDescendants: e.target.checked,
989
- ...J.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
985
+ ...G.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
990
986
  })
991
987
  })
992
988
  }) : null,
993
- J.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
989
+ G.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
994
990
  label: "職位",
995
991
  name: "initiatorPositionId",
996
992
  required: !0,
997
- children: /* @__PURE__ */ h(o, {
998
- disabled: !J.orgUnitId?.trim(),
993
+ children: /* @__PURE__ */ h(a, {
994
+ disabled: !G.orgUnitId?.trim(),
999
995
  name: "initiatorPositionId",
1000
- onChange: (e) => yr({
1001
- ...J,
996
+ onChange: (e) => gr({
997
+ ...G,
1002
998
  positionId: e?.id ?? ""
1003
999
  }),
1004
- placeholder: J.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
1005
- positions: r,
1000
+ placeholder: G.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
1001
+ positions: i,
1006
1002
  value: n
1007
1003
  })
1008
1004
  }) : null
1009
1005
  ] });
1010
1006
  }
1011
- function kr(e) {
1007
+ function Er(e) {
1012
1008
  let t = v.edges.filter((t) => t.target === e.id).length, n = t < 2, r = n ? "AND" : e.data.triggerMode ?? "AND";
1013
- return /* @__PURE__ */ h(s, {
1009
+ return /* @__PURE__ */ h(o, {
1014
1010
  hintText: n ? "需要至少兩條前置連線,才可切換為任一前置完成。" : t > 1 ? `${t} 條前置連線會依此規則觸發。` : "只有一條前置連線時,兩種設定效果相同。",
1015
1011
  label: "前置條件",
1016
1012
  name: "triggerMode",
1017
1013
  required: !0,
1018
- children: /* @__PURE__ */ h(p, {
1014
+ children: /* @__PURE__ */ h(f, {
1019
1015
  clearable: !1,
1020
- onChange: (e) => n ? void 0 : br(Ht(e?.id ?? null)),
1021
- options: [...dt],
1016
+ onChange: (e) => n ? void 0 : _r(Ht(e?.id ?? null)),
1017
+ options: [...ut],
1022
1018
  readOnly: n,
1023
- value: B(dt, r)
1019
+ value: z(ut, r)
1024
1020
  })
1025
1021
  });
1026
1022
  }
1027
- function Ar(e) {
1028
- let t = e.data.approverResolver, n = Wt(t.type), r = t.type === "DIRECT" ? bn(t.memberIds, I) : null, a = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? xn(L, t.orgUnitId) : null, ee = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? Sn(R, t.positionId) : null, c = t.type === "ORG_UNIT_POSITION" ? On({
1023
+ function Dr(e) {
1024
+ let t = e.data.approverResolver, n = Wt(t.type), i = t.type === "DIRECT" ? xn(t.memberIds, P) : null, s = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? Sn(I, t.orgUnitId) : null, c = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? Cn(L, t.positionId) : null, l = t.type === "ORG_UNIT_POSITION" ? On({
1029
1025
  includeDescendants: !!t.includeDescendants,
1030
- memberships: Lt,
1026
+ memberships: Mt,
1031
1027
  orgUnitId: t.orgUnitId,
1032
- orgUnits: L,
1033
- positions: R
1034
- }) : [], l = t.type === "ORG_MANAGER" ? Jt(t.levelsUp) : M[0], u = t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, d = u.type === "DIRECT" ? yn(I, u.memberId) : null, f = e.data.returnBehavior.resubmitStrategy ?? "RESTART";
1035
- return /* @__PURE__ */ g(ue, { children: [
1036
- /* @__PURE__ */ h(s, {
1028
+ orgUnits: I,
1029
+ positions: L
1030
+ }) : [], ee = t.type === "ORG_MANAGER" ? Jt(t.levelsUp) : M[0], u = t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, d = u.type === "DIRECT" ? bn(P, u.memberId) : null, ne = e.data.returnBehavior.resubmitStrategy ?? "RESTART";
1031
+ return /* @__PURE__ */ g(m, { children: [
1032
+ /* @__PURE__ */ h(o, {
1037
1033
  label: "簽核來源",
1038
1034
  name: "approverResolverType",
1039
1035
  required: !0,
1040
- children: /* @__PURE__ */ h(p, {
1036
+ children: /* @__PURE__ */ h(f, {
1041
1037
  clearable: !1,
1042
1038
  onChange: (e) => $(Gt(e?.id ?? null)),
1043
- options: [...pt],
1044
- value: B(pt, n)
1039
+ options: [...ft],
1040
+ value: z(ft, n)
1045
1041
  })
1046
1042
  }),
1047
- t.type === "DIRECT" ? /* @__PURE__ */ h(s, {
1043
+ t.type === "DIRECT" ? /* @__PURE__ */ h(o, {
1048
1044
  label: "簽核者",
1049
1045
  name: "memberId",
1050
1046
  required: !0,
@@ -1058,29 +1054,29 @@ function bt({ templateId: r, activeHref: a }) {
1058
1054
  name: "workflow-approver-search",
1059
1055
  spellCheck: !1
1060
1056
  },
1061
- loading: Tt,
1057
+ loading: Ct,
1062
1058
  loadingText: "搜尋成員中...",
1063
1059
  mode: "single",
1064
1060
  onChange: (e) => $({
1065
1061
  memberIds: e?.id ? [e.id] : [],
1066
1062
  type: "DIRECT"
1067
1063
  }),
1068
- onSearch: ir,
1064
+ onSearch: Z,
1069
1065
  onVisibilityChange: (e) => {
1070
- e && ir("");
1066
+ e && Z("");
1071
1067
  },
1072
- options: [...I],
1068
+ options: [...P],
1073
1069
  placeholder: "搜尋姓名或信箱",
1074
1070
  searchDebounceTime: 300,
1075
- value: r
1071
+ value: i
1076
1072
  })
1077
1073
  }) : null,
1078
- t.type === "ORG_MANAGER" ? /* @__PURE__ */ h(s, {
1074
+ t.type === "ORG_MANAGER" ? /* @__PURE__ */ h(o, {
1079
1075
  hintText: "依發起人的有效會員歸屬與主管解析規則決定簽核人。",
1080
1076
  label: "主管層級",
1081
1077
  name: "managerLevelsUp",
1082
1078
  required: !0,
1083
- children: /* @__PURE__ */ h(p, {
1079
+ children: /* @__PURE__ */ h(f, {
1084
1080
  clearable: !1,
1085
1081
  onChange: (e) => $({
1086
1082
  baseFromInitiator: !0,
@@ -1088,15 +1084,15 @@ function bt({ templateId: r, activeHref: a }) {
1088
1084
  type: "ORG_MANAGER"
1089
1085
  }),
1090
1086
  options: [...M],
1091
- value: l
1087
+ value: ee
1092
1088
  })
1093
1089
  }) : null,
1094
- t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
1090
+ t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
1095
1091
  hintText: t.type === "ORG_UNIT_MANAGER" ? "依指定組織或其上層的主管解析規則決定簽核人。" : "依指定組織目前有效會員歸屬建立候選簽核人。",
1096
1092
  label: "組織",
1097
1093
  name: "orgUnitId",
1098
1094
  required: !0,
1099
- children: /* @__PURE__ */ h(i, {
1095
+ children: /* @__PURE__ */ h(r, {
1100
1096
  name: "orgUnitId",
1101
1097
  onChange: (e) => $(t.type === "ORG_UNIT_MEMBER" ? {
1102
1098
  includeDescendants: t.includeDescendants,
@@ -1112,26 +1108,26 @@ function bt({ templateId: r, activeHref: a }) {
1112
1108
  orgUnitId: e?.id ?? "",
1113
1109
  type: "ORG_UNIT_MANAGER"
1114
1110
  }),
1115
- orgUnits: L,
1111
+ orgUnits: I,
1116
1112
  placeholder: "選擇組織",
1117
- value: a
1113
+ value: s
1118
1114
  })
1119
1115
  }) : null,
1120
- t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ g(ue, { children: [/* @__PURE__ */ h(s, {
1116
+ t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(o, {
1121
1117
  hintText: "預設會停止流程並提示;若設定固定人,找不到主管時會改派給該會員。",
1122
1118
  label: "無主管時",
1123
1119
  name: "approverFallbackMode",
1124
1120
  required: !0,
1125
- children: /* @__PURE__ */ h(p, {
1121
+ children: /* @__PURE__ */ h(f, {
1126
1122
  clearable: !1,
1127
1123
  onChange: (e) => $(qt(t, Kt(e?.id ?? null) === "DIRECT" ? {
1128
1124
  memberId: "",
1129
1125
  type: "DIRECT"
1130
1126
  } : { type: "NONE" })),
1131
- options: [...mt],
1132
- value: B(mt, u.type)
1127
+ options: [...pt],
1128
+ value: z(pt, u.type)
1133
1129
  })
1134
- }), u.type === "DIRECT" ? /* @__PURE__ */ g(ue, { children: [/* @__PURE__ */ h(s, {
1130
+ }), u.type === "DIRECT" ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(o, {
1135
1131
  label: "改派人員",
1136
1132
  name: "approverFallbackMemberId",
1137
1133
  required: !0,
@@ -1145,7 +1141,7 @@ function bt({ templateId: r, activeHref: a }) {
1145
1141
  name: "workflow-approver-fallback-search",
1146
1142
  spellCheck: !1
1147
1143
  },
1148
- loading: Tt,
1144
+ loading: Ct,
1149
1145
  loadingText: "搜尋成員中...",
1150
1146
  mode: "single",
1151
1147
  onChange: (e) => $(qt(t, {
@@ -1153,16 +1149,16 @@ function bt({ templateId: r, activeHref: a }) {
1153
1149
  memberId: e?.id ?? "",
1154
1150
  type: "DIRECT"
1155
1151
  })),
1156
- onSearch: ir,
1152
+ onSearch: Z,
1157
1153
  onVisibilityChange: (e) => {
1158
- e && ir("");
1154
+ e && Z("");
1159
1155
  },
1160
- options: [...I],
1156
+ options: [...P],
1161
1157
  placeholder: "搜尋姓名或信箱",
1162
1158
  searchDebounceTime: 300,
1163
1159
  value: d
1164
1160
  })
1165
- }), /* @__PURE__ */ h(s, {
1161
+ }), /* @__PURE__ */ h(o, {
1166
1162
  hintText: "預設禁止申請人簽自己的案件;只有此流程允許自簽時才開啟。",
1167
1163
  label: "允許自簽",
1168
1164
  name: "allowInitiatorSelfApproval",
@@ -1175,7 +1171,7 @@ function bt({ templateId: r, activeHref: a }) {
1175
1171
  }))
1176
1172
  })
1177
1173
  })] }) : null] }) : null,
1178
- t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
1174
+ t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
1179
1175
  label: "包含下層",
1180
1176
  name: "includeDescendants",
1181
1177
  children: /* @__PURE__ */ h(le, {
@@ -1187,28 +1183,28 @@ function bt({ templateId: r, activeHref: a }) {
1187
1183
  })
1188
1184
  })
1189
1185
  }) : null,
1190
- t.type === "POSITION" ? /* @__PURE__ */ h(s, {
1186
+ t.type === "POSITION" ? /* @__PURE__ */ h(o, {
1191
1187
  hintText: "指派給目前有效歸屬中擁有此職位的會員;主要歸屬優先。",
1192
1188
  label: "職位",
1193
1189
  name: "positionId",
1194
1190
  required: !0,
1195
- children: /* @__PURE__ */ h(o, {
1191
+ children: /* @__PURE__ */ h(a, {
1196
1192
  name: "positionId",
1197
1193
  onChange: (e) => $({
1198
1194
  positionId: e?.id ?? "",
1199
1195
  type: "POSITION"
1200
1196
  }),
1201
1197
  placeholder: "選擇職位",
1202
- positions: R,
1203
- value: ee
1198
+ positions: L,
1199
+ value: c
1204
1200
  })
1205
1201
  }) : null,
1206
- t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
1202
+ t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
1207
1203
  hintText: "只納入指定組織範圍內擁有此職位的有效會員。",
1208
1204
  label: "職位",
1209
1205
  name: "orgUnitPositionId",
1210
1206
  required: !0,
1211
- children: /* @__PURE__ */ h(o, {
1207
+ children: /* @__PURE__ */ h(a, {
1212
1208
  disabled: !t.orgUnitId.trim(),
1213
1209
  name: "orgUnitPositionId",
1214
1210
  onChange: (e) => $({
@@ -1218,27 +1214,27 @@ function bt({ templateId: r, activeHref: a }) {
1218
1214
  type: "ORG_UNIT_POSITION"
1219
1215
  }),
1220
1216
  placeholder: t.orgUnitId.trim() ? "選擇職位" : "請先選擇組織",
1221
- positions: c,
1222
- value: ee
1217
+ positions: l,
1218
+ value: c
1223
1219
  })
1224
1220
  }) : null,
1225
- e.data.returnBehavior.allowReturn ? /* @__PURE__ */ h(s, {
1221
+ e.data.returnBehavior.allowReturn ? /* @__PURE__ */ h(o, {
1226
1222
  hintText: "退回發起人後,重新送出時要從流程開始重跑,或直接回到退回的簽核節點。",
1227
1223
  label: "重送策略",
1228
1224
  name: "returnResubmitStrategy",
1229
1225
  required: !0,
1230
- children: /* @__PURE__ */ h(p, {
1226
+ children: /* @__PURE__ */ h(f, {
1231
1227
  clearable: !1,
1232
- onChange: (e) => _r(Ut(e?.id ?? null)),
1233
- options: [...ft],
1234
- value: B(ft, f)
1228
+ onChange: (e) => mr(Ut(e?.id ?? null)),
1229
+ options: [...dt],
1230
+ value: z(dt, ne)
1235
1231
  })
1236
1232
  }) : null
1237
1233
  ] });
1238
1234
  }
1239
- function jr(e) {
1240
- let t = tr(e.data.action).map((e) => yn(I, e));
1241
- return /* @__PURE__ */ h(s, {
1235
+ function Or(e) {
1236
+ let t = tr(e.data.action).map((e) => bn(P, e));
1237
+ return /* @__PURE__ */ h(o, {
1242
1238
  label: "知會對象",
1243
1239
  name: "notifyMemberIds",
1244
1240
  required: !0,
@@ -1246,10 +1242,10 @@ function bt({ templateId: r, activeHref: a }) {
1246
1242
  asyncData: !0,
1247
1243
  disabledOptionsFilter: !0,
1248
1244
  emptyText: "沒有符合的成員",
1249
- loading: Tt,
1245
+ loading: Ct,
1250
1246
  loadingText: "搜尋成員中...",
1251
1247
  mode: "multiple",
1252
- onChange: (e) => vr({
1248
+ onChange: (e) => hr({
1253
1249
  channels: ["IN_APP"],
1254
1250
  recipients: {
1255
1251
  memberIds: e.map((e) => e.id),
@@ -1257,11 +1253,11 @@ function bt({ templateId: r, activeHref: a }) {
1257
1253
  },
1258
1254
  type: "NOTIFY"
1259
1255
  }),
1260
- onSearch: ir,
1256
+ onSearch: Z,
1261
1257
  onVisibilityChange: (e) => {
1262
- e && ir("");
1258
+ e && Z("");
1263
1259
  },
1264
- options: [...I],
1260
+ options: [...P],
1265
1261
  overflowStrategy: "wrap",
1266
1262
  placeholder: "搜尋姓名或信箱",
1267
1263
  searchDebounceTime: 300,
@@ -1269,14 +1265,14 @@ function bt({ templateId: r, activeHref: a }) {
1269
1265
  })
1270
1266
  });
1271
1267
  }
1272
- function Mr(e) {
1268
+ function kr(e) {
1273
1269
  return /* @__PURE__ */ g("div", {
1274
- style: x,
1275
- children: [/* @__PURE__ */ h(m, {
1270
+ style: S,
1271
+ children: [/* @__PURE__ */ h(p, {
1276
1272
  component: "h2",
1277
1273
  variant: "h3",
1278
1274
  children: "已選取線段"
1279
- }), /* @__PURE__ */ g(m, {
1275
+ }), /* @__PURE__ */ g(p, {
1280
1276
  color: "text-neutral",
1281
1277
  variant: "body",
1282
1278
  children: [
@@ -1287,17 +1283,17 @@ function bt({ templateId: r, activeHref: a }) {
1287
1283
  })]
1288
1284
  });
1289
1285
  }
1290
- function Nr(e) {
1291
- let t = Q(e, v.nodes);
1286
+ function Ar(e) {
1287
+ let t = X(e, v.nodes);
1292
1288
  return /* @__PURE__ */ g("div", {
1293
- style: x,
1289
+ style: S,
1294
1290
  children: [
1295
- /* @__PURE__ */ h(m, {
1291
+ /* @__PURE__ */ h(p, {
1296
1292
  component: "h2",
1297
1293
  variant: "h3",
1298
1294
  children: t ? "條件設定" : "線段屬性"
1299
1295
  }),
1300
- /* @__PURE__ */ g(m, {
1296
+ /* @__PURE__ */ g(p, {
1301
1297
  color: "text-neutral",
1302
1298
  variant: "body",
1303
1299
  children: [
@@ -1306,7 +1302,7 @@ function bt({ templateId: r, activeHref: a }) {
1306
1302
  e.target
1307
1303
  ]
1308
1304
  }),
1309
- t ? Fr(e) : /* @__PURE__ */ h(m, {
1305
+ t ? Mr(e) : /* @__PURE__ */ h(p, {
1310
1306
  color: "text-neutral",
1311
1307
  variant: "body",
1312
1308
  children: "這條線會直接把流程送到下一個節點。"
@@ -1314,36 +1310,36 @@ function bt({ templateId: r, activeHref: a }) {
1314
1310
  ]
1315
1311
  });
1316
1312
  }
1317
- function Pr(e) {
1318
- return !e || !Q(e, v.nodes) ? null : /* @__PURE__ */ h(ie, {
1313
+ function jr(e) {
1314
+ return !e || !X(e, v.nodes) ? null : /* @__PURE__ */ h(ie, {
1319
1315
  cancelText: "取消",
1320
1316
  confirmButtonProps: { disabled: !e.data.isDefault && !e.data.condition },
1321
1317
  confirmText: "完成",
1322
1318
  modalType: "standard",
1323
- onCancel: mr,
1324
- onClose: mr,
1325
- onConfirm: mr,
1326
- open: !!at,
1319
+ onCancel: dr,
1320
+ onClose: dr,
1321
+ onConfirm: dr,
1322
+ open: !!tt,
1327
1323
  showModalFooter: !0,
1328
1324
  showModalHeader: !0,
1329
1325
  size: "regular",
1330
1326
  supportingText: "條件分流的輸出連線需要指定條件,條件會直接顯示在線上。",
1331
1327
  title: "條件設定",
1332
- children: Fr(e)
1328
+ children: Mr(e)
1333
1329
  });
1334
1330
  }
1335
- function Fr(e) {
1336
- let t = Qn(e, v.nodes), n = zn(Y?.schema ?? null), r = Bn(Y?.schema ?? null, e.data.conditionFieldKey ?? null), i = Vn(r), a = Un(r), o = B(i, e.data.conditionOperator ?? null);
1331
+ function Mr(e) {
1332
+ let t = $n(e, v.nodes), n = Bn(K?.schema ?? null), r = Vn(K?.schema ?? null, e.data.conditionFieldKey ?? null), i = Hn(r), a = Gn(r), s = z(i, e.data.conditionOperator ?? null);
1337
1333
  return /* @__PURE__ */ g("div", {
1338
- style: x,
1334
+ style: S,
1339
1335
  children: [
1340
- /* @__PURE__ */ g(m, {
1336
+ /* @__PURE__ */ g(p, {
1341
1337
  color: "text-neutral",
1342
1338
  variant: "body",
1343
1339
  children: [
1344
1340
  "畫布上的這條線目前會顯示「",
1345
1341
  /* @__PURE__ */ h("span", {
1346
- style: { color: !e.data.isDefault && !e.data.condition ? qe : void 0 },
1342
+ style: { color: !e.data.isDefault && !e.data.condition ? Ge : void 0 },
1347
1343
  children: t ?? "請設定條件"
1348
1344
  }),
1349
1345
  "」。"
@@ -1352,25 +1348,25 @@ function bt({ templateId: r, activeHref: a }) {
1352
1348
  /* @__PURE__ */ h(le, {
1353
1349
  checked: !!e.data.isDefault,
1354
1350
  label: "其他情況走這條",
1355
- onChange: (t) => Cr(e.id, t.target.checked)
1351
+ onChange: (t) => br(e.id, t.target.checked)
1356
1352
  }),
1357
- e.data.isDefault ? /* @__PURE__ */ h(m, {
1353
+ e.data.isDefault ? /* @__PURE__ */ h(p, {
1358
1354
  color: "text-neutral",
1359
1355
  variant: "body",
1360
1356
  children: "其他條件都不符合時,流程會走這條線。"
1361
- }) : /* @__PURE__ */ g(ue, { children: [
1362
- Y ? null : /* @__PURE__ */ h(m, {
1357
+ }) : /* @__PURE__ */ g(m, { children: [
1358
+ K ? null : /* @__PURE__ */ h(p, {
1363
1359
  color: "text-neutral",
1364
1360
  variant: "body",
1365
1361
  children: "請先綁定表單版本,才能選擇條件欄位。"
1366
1362
  }),
1367
- /* @__PURE__ */ h(s, {
1363
+ /* @__PURE__ */ h(o, {
1368
1364
  label: "條件欄位",
1369
1365
  name: "edgeConditionField",
1370
1366
  required: !0,
1371
- children: /* @__PURE__ */ h(p, {
1367
+ children: /* @__PURE__ */ h(f, {
1372
1368
  clearable: !1,
1373
- onChange: (t) => wr({
1369
+ onChange: (t) => xr({
1374
1370
  edgeId: e.id,
1375
1371
  fieldKey: t?.id ?? null,
1376
1372
  operator: null,
@@ -1378,40 +1374,40 @@ function bt({ templateId: r, activeHref: a }) {
1378
1374
  }),
1379
1375
  options: [...n],
1380
1376
  placeholder: "選擇條件欄位",
1381
- value: B(n, e.data.conditionFieldKey ?? null)
1377
+ value: z(n, e.data.conditionFieldKey ?? null)
1382
1378
  })
1383
1379
  }),
1384
- /* @__PURE__ */ h(s, {
1380
+ /* @__PURE__ */ h(o, {
1385
1381
  label: "條件判斷",
1386
1382
  name: "edgeConditionOperator",
1387
1383
  required: !0,
1388
- children: /* @__PURE__ */ h(p, {
1384
+ children: /* @__PURE__ */ h(f, {
1389
1385
  clearable: !1,
1390
- onChange: (t) => wr({
1386
+ onChange: (t) => xr({
1391
1387
  edgeId: e.id,
1392
- operator: Hn(t?.id ?? null),
1388
+ operator: Un(t?.id ?? null),
1393
1389
  value: null
1394
1390
  }),
1395
1391
  options: [...i],
1396
1392
  placeholder: "選擇判斷方式",
1397
- value: o
1393
+ value: s
1398
1394
  })
1399
1395
  }),
1400
- o && Kn(o.id) ? /* @__PURE__ */ h(s, {
1396
+ s && Jn(s.id) ? /* @__PURE__ */ h(o, {
1401
1397
  label: "條件值",
1402
1398
  name: "edgeConditionValue",
1403
1399
  required: !0,
1404
- children: a.length > 0 ? /* @__PURE__ */ h(p, {
1400
+ children: a.length > 0 ? /* @__PURE__ */ h(f, {
1405
1401
  clearable: !1,
1406
- onChange: (t) => wr({
1402
+ onChange: (t) => xr({
1407
1403
  edgeId: e.id,
1408
1404
  value: t?.id ?? null
1409
1405
  }),
1410
1406
  options: [...a],
1411
1407
  placeholder: "選擇條件值",
1412
- value: B(a, e.data.conditionValue ?? null)
1408
+ value: z(a, e.data.conditionValue ?? null)
1413
1409
  }) : /* @__PURE__ */ h(re, {
1414
- onChange: (t) => wr({
1410
+ onChange: (t) => xr({
1415
1411
  edgeId: e.id,
1416
1412
  value: t.target.value
1417
1413
  }),
@@ -1429,9 +1425,9 @@ function xt({ onApplyAutoLayout: e }) {
1429
1425
  function t() {
1430
1426
  e();
1431
1427
  }
1432
- return /* @__PURE__ */ h(De, {
1428
+ return /* @__PURE__ */ h(v, {
1433
1429
  position: "top-right",
1434
- children: /* @__PURE__ */ h(f, {
1430
+ children: /* @__PURE__ */ h(d, {
1435
1431
  icon: fe,
1436
1432
  iconType: "leading",
1437
1433
  onClick: t,
@@ -1441,28 +1437,28 @@ function xt({ onApplyAutoLayout: e }) {
1441
1437
  })
1442
1438
  });
1443
1439
  }
1444
- function P({ data: e, selected: t, type: n }) {
1440
+ function N({ data: e, selected: t, type: n }) {
1445
1441
  let r = e.approverLines ?? [e.approverSummary ?? e.label], i = St(e);
1446
1442
  return /* @__PURE__ */ g("div", {
1447
1443
  style: Ct(n, t),
1448
1444
  children: [
1449
- Tt(e),
1445
+ P(e),
1450
1446
  /* @__PURE__ */ h("div", {
1451
- style: st,
1452
- children: r.map((e, t) => /* @__PURE__ */ h(m, {
1447
+ style: at,
1448
+ children: r.map((e, t) => /* @__PURE__ */ h(p, {
1453
1449
  component: "span",
1454
1450
  ellipsis: !0,
1455
- style: k,
1451
+ style: it,
1456
1452
  title: e,
1457
1453
  variant: "label-primary",
1458
1454
  children: e
1459
1455
  }, `${e}_${t}`))
1460
1456
  }),
1461
- /* @__PURE__ */ h(m, {
1457
+ /* @__PURE__ */ h(p, {
1462
1458
  color: "text-neutral",
1463
1459
  component: "span",
1464
1460
  ellipsis: !0,
1465
- style: k,
1461
+ style: it,
1466
1462
  title: i,
1467
1463
  variant: "caption",
1468
1464
  children: i
@@ -1471,46 +1467,46 @@ function P({ data: e, selected: t, type: n }) {
1471
1467
  });
1472
1468
  }
1473
1469
  function St(e) {
1474
- return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" : ct[e.nodeKind];
1470
+ return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" : st[e.nodeKind];
1475
1471
  }
1476
1472
  function Ct(e, t) {
1477
1473
  let n = wt(e);
1478
1474
  return t ? {
1479
1475
  ...n,
1480
1476
  border: "1px solid var(--mzn-color-primary, #0057ff)",
1481
- boxShadow: tt
1477
+ boxShadow: $e
1482
1478
  } : n;
1483
1479
  }
1484
1480
  function wt(e) {
1485
- return e === "exclusiveGateway" ? E : e === "parallelGateway" ? D : e === "startEvent" ? O : e === "endEvent" ? ot : e === "userTask" ? at : S;
1481
+ return e === "exclusiveGateway" ? tt : e === "parallelGateway" ? k : e === "startEvent" ? A : e === "endEvent" ? rt : e === "userTask" ? nt : C;
1486
1482
  }
1487
- function Tt(e) {
1488
- return !e.hasInput && e.hasOutput ? /* @__PURE__ */ h(Te, {
1489
- id: j,
1490
- position: _.Right,
1483
+ function P(e) {
1484
+ return !e.hasInput && e.hasOutput ? /* @__PURE__ */ h(_, {
1485
+ id: ot,
1486
+ position: y.Right,
1491
1487
  type: "source"
1492
- }) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ h(Te, {
1493
- id: A,
1494
- position: _.Left,
1495
- type: "target"
1496
- }) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ h(Te, {
1497
- id: A,
1498
- position: _.Left,
1488
+ }) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ h(_, {
1489
+ id: j,
1490
+ position: y.Left,
1499
1491
  type: "target"
1500
- }, "target"), /* @__PURE__ */ h(Te, {
1492
+ }) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ h(_, {
1501
1493
  id: j,
1502
- position: _.Right,
1494
+ position: y.Left,
1495
+ type: "target"
1496
+ }, "target"), /* @__PURE__ */ h(_, {
1497
+ id: ot,
1498
+ position: y.Right,
1503
1499
  type: "source"
1504
1500
  }, "source")];
1505
1501
  }
1506
- function Et(e, t, n, r, i, a) {
1502
+ function Tt(e, t, n, r, i, a) {
1507
1503
  let o = F(e);
1508
1504
  return {
1509
1505
  data: {
1510
- approverLines: Nn(e, t),
1511
- approverSummary: jn(e, t, n, r),
1512
- hasInput: V(e),
1513
- hasOutput: H(e),
1506
+ approverLines: Pn(e, t),
1507
+ approverSummary: Mn(e, t, n, r),
1508
+ hasInput: B(e),
1509
+ hasOutput: V(e),
1514
1510
  initiatorPolicySummary: e.type === "startEvent" ? nn(a, n, r) : null,
1515
1511
  label: e.data.label,
1516
1512
  nodeKind: e.type
@@ -1522,34 +1518,34 @@ function Et(e, t, n, r, i, a) {
1522
1518
  initialWidth: o.width,
1523
1519
  position: e.position,
1524
1520
  selected: i,
1525
- sourcePosition: _.Right,
1526
- targetPosition: _.Left,
1521
+ sourcePosition: y.Right,
1522
+ targetPosition: y.Left,
1527
1523
  type: e.type,
1528
1524
  width: o.width
1529
1525
  };
1530
1526
  }
1531
1527
  function F(e) {
1532
1528
  return e.type === "exclusiveGateway" || e.type === "parallelGateway" ? {
1533
- height: it,
1534
- width: w
1529
+ height: E,
1530
+ width: D
1535
1531
  } : e.type === "serviceTask" ? {
1536
- height: nt + (Math.max(1, tr(e.data.action).length) - 1) * rt,
1537
- width: C
1532
+ height: et + (Math.max(1, tr(e.data.action).length) - 1) * T,
1533
+ width: w
1538
1534
  } : {
1539
- height: nt,
1540
- width: C
1535
+ height: et,
1536
+ width: w
1541
1537
  };
1542
1538
  }
1543
1539
  function I(e) {
1544
1540
  let t = F(e);
1545
- return [...V(e) ? [Dt(t)] : [], ...H(e) ? [L(t)] : []];
1541
+ return [...B(e) ? [Et(t)] : [], ...V(e) ? [L(t)] : []];
1546
1542
  }
1547
- function Dt({ height: e }) {
1543
+ function Et({ height: e }) {
1548
1544
  let t = e / 2 - 9 / 2;
1549
1545
  return {
1550
1546
  height: 9,
1551
- id: A,
1552
- position: _.Left,
1547
+ id: j,
1548
+ position: y.Left,
1553
1549
  type: "target",
1554
1550
  width: 9,
1555
1551
  x: -9 / 2,
@@ -1560,16 +1556,16 @@ function L({ height: e, width: t }) {
1560
1556
  let n = e / 2 - 9 / 2;
1561
1557
  return {
1562
1558
  height: 9,
1563
- id: j,
1564
- position: _.Right,
1559
+ id: ot,
1560
+ position: y.Right,
1565
1561
  type: "source",
1566
1562
  width: 9,
1567
1563
  x: t - 9 / 2,
1568
1564
  y: n
1569
1565
  };
1570
1566
  }
1571
- function Ot(e, t, n) {
1572
- let r = Qn(e, t), i = Q(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? qe : i ? Ke : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", ee = a ? qe : i ? Ke : b;
1567
+ function Dt(e, t, n) {
1568
+ let r = $n(e, t), i = X(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? Ge : i ? We : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", c = a ? Ge : i ? We : x;
1573
1569
  return {
1574
1570
  className: n ? "workflow-edge--selected" : void 0,
1575
1571
  data: e.data,
@@ -1579,7 +1575,7 @@ function Ot(e, t, n) {
1579
1575
  labelBgPadding: [8, 4],
1580
1576
  labelBgStyle: {
1581
1577
  fill: s,
1582
- stroke: ee,
1578
+ stroke: c,
1583
1579
  strokeWidth: 1
1584
1580
  },
1585
1581
  labelShowBg: !!r,
@@ -1592,9 +1588,9 @@ function Ot(e, t, n) {
1592
1588
  source: e.source,
1593
1589
  sourceHandle: e.sourceHandle,
1594
1590
  style: {
1595
- filter: n ? Je : void 0,
1591
+ filter: n ? Ke : void 0,
1596
1592
  opacity: 1,
1597
- stroke: b,
1593
+ stroke: x,
1598
1594
  strokeOpacity: 1,
1599
1595
  strokeWidth: 1.5
1600
1596
  },
@@ -1603,7 +1599,7 @@ function Ot(e, t, n) {
1603
1599
  type: e.type ?? "smoothstep"
1604
1600
  };
1605
1601
  }
1606
- function kt(e, t) {
1602
+ function Ot(e, t) {
1607
1603
  return e.type === "startEvent" || e.type === "endEvent" || e.type === "userTask" || e.type === "serviceTask" || e.type, {
1608
1604
  ...e,
1609
1605
  data: {
@@ -1612,7 +1608,7 @@ function kt(e, t) {
1612
1608
  }
1613
1609
  };
1614
1610
  }
1615
- function At(e, t) {
1611
+ function kt(e, t) {
1616
1612
  return e.type === "startEvent" ? e : (e.type === "endEvent" || e.type === "userTask" || e.type === "serviceTask" || e.type, {
1617
1613
  ...e,
1618
1614
  data: {
@@ -1621,21 +1617,21 @@ function At(e, t) {
1621
1617
  }
1622
1618
  });
1623
1619
  }
1624
- function jt(e) {
1625
- return R(Mt(e));
1620
+ function At(e) {
1621
+ return Mt(jt(e));
1626
1622
  }
1627
- function Mt(e) {
1623
+ function jt(e) {
1628
1624
  let t = new Set(e.nodes.filter((e) => cn(e)).map((e) => e.id)), n = e.edges.filter((e) => !t.has(e.source));
1629
1625
  return n.length === e.edges.length ? e : {
1630
1626
  ...e,
1631
1627
  edges: n
1632
1628
  };
1633
1629
  }
1634
- function R(e) {
1630
+ function Mt(e) {
1635
1631
  let t = e.edges.reduce((e, t) => ({
1636
1632
  ...e,
1637
1633
  [t.target]: (e[t.target] ?? 0) + 1
1638
- }), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? At(e, "AND") : e);
1634
+ }), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? kt(e, "AND") : e);
1639
1635
  return n.some((t, n) => t !== e.nodes[n]) ? {
1640
1636
  ...e,
1641
1637
  nodes: n
@@ -1711,14 +1707,14 @@ function Ft({ definition: e, node: t, selectedEdgeId: n, selectedNodeId: r }) {
1711
1707
  };
1712
1708
  }
1713
1709
  function It(e, t, n) {
1714
- if (!V(t)) return {
1710
+ if (!B(t)) return {
1715
1711
  definition: e,
1716
1712
  editingEdgeId: null,
1717
1713
  selectedEdgeIds: [n.id],
1718
1714
  selectedNodeId: null
1719
1715
  };
1720
- if (!H(t)) {
1721
- let r = z(n.source, t.id, {});
1716
+ if (!V(t)) {
1717
+ let r = R(n.source, t.id, {});
1722
1718
  return {
1723
1719
  definition: {
1724
1720
  ...e,
@@ -1730,7 +1726,7 @@ function It(e, t, n) {
1730
1726
  selectedNodeId: t.id
1731
1727
  };
1732
1728
  }
1733
- let r = z(n.source, t.id, n.data), i = z(t.id, n.target, Rt(t, n)), a = Q(i, [...e.nodes, t]);
1729
+ let r = R(n.source, t.id, n.data), i = R(t.id, n.target, Rt(t, n)), a = X(i, [...e.nodes, t]);
1734
1730
  return {
1735
1731
  definition: {
1736
1732
  ...e,
@@ -1743,7 +1739,7 @@ function It(e, t, n) {
1743
1739
  };
1744
1740
  }
1745
1741
  function Lt(e, t, n) {
1746
- if (!H(n)) return {
1742
+ if (!V(n)) return {
1747
1743
  definition: {
1748
1744
  ...e,
1749
1745
  nodes: [...e.nodes, t]
@@ -1753,10 +1749,10 @@ function Lt(e, t, n) {
1753
1749
  selectedNodeId: t.id
1754
1750
  };
1755
1751
  let r = e.edges.find((e) => e.source === n.id) ?? null;
1756
- if (r && H(t)) return It(e, t, r);
1752
+ if (r && V(t)) return It(e, t, r);
1757
1753
  let i = e.nodes.find((e) => e.type === "endEvent");
1758
- if (i && n.id !== i.id && H(t)) {
1759
- let r = z(n.id, t.id, {}), a = z(t.id, i.id, Rt(t, r)), o = Q(a, [...e.nodes, t]);
1754
+ if (i && n.id !== i.id && V(t)) {
1755
+ let r = R(n.id, t.id, {}), a = R(t.id, i.id, Rt(t, r)), o = X(a, [...e.nodes, t]);
1760
1756
  return {
1761
1757
  definition: {
1762
1758
  ...e,
@@ -1772,7 +1768,7 @@ function Lt(e, t, n) {
1772
1768
  selectedNodeId: o ? null : t.id
1773
1769
  };
1774
1770
  }
1775
- let a = z(n.id, t.id, {});
1771
+ let a = R(n.id, t.id, {});
1776
1772
  return {
1777
1773
  definition: {
1778
1774
  ...e,
@@ -1784,14 +1780,14 @@ function Lt(e, t, n) {
1784
1780
  selectedNodeId: t.id
1785
1781
  };
1786
1782
  }
1787
- function z(e, t, n) {
1783
+ function R(e, t, n) {
1788
1784
  return {
1789
1785
  data: n,
1790
1786
  id: `edge_${e}_${t}_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
1791
1787
  source: e,
1792
- sourceHandle: j,
1788
+ sourceHandle: ot,
1793
1789
  target: t,
1794
- targetHandle: A,
1790
+ targetHandle: j,
1795
1791
  type: "smoothstep"
1796
1792
  };
1797
1793
  }
@@ -1832,7 +1828,7 @@ function Bt(e) {
1832
1828
  return e.edges.length === 0 && e.nodes.length === 2 && e.nodes.some((e) => e.type === "startEvent") && e.nodes.some((e) => e.type === "endEvent");
1833
1829
  }
1834
1830
  function Vt(e) {
1835
- let t = new y.graphlib.Graph();
1831
+ let t = new Oe.graphlib.Graph();
1836
1832
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
1837
1833
  rankdir: "LR",
1838
1834
  ranksep: 120
@@ -1840,7 +1836,7 @@ function Vt(e) {
1840
1836
  t.setNode(e.id, F(e));
1841
1837
  }), e.edges.forEach((e) => {
1842
1838
  t.setEdge(e.source, e.target);
1843
- }), y.layout(t), {
1839
+ }), Oe.layout(t), {
1844
1840
  ...e,
1845
1841
  nodes: e.nodes.map((e) => {
1846
1842
  let n = t.node(e.id);
@@ -1854,7 +1850,7 @@ function Vt(e) {
1854
1850
  })
1855
1851
  };
1856
1852
  }
1857
- function B(e, t) {
1853
+ function z(e, t) {
1858
1854
  return t ? e.find((e) => e.id === t) ?? null : null;
1859
1855
  }
1860
1856
  function Ht(e) {
@@ -1950,13 +1946,13 @@ function tn(e, t) {
1950
1946
  if (e.mode === "ALL" || e.mode === "NONE") return null;
1951
1947
  let n = e.orgUnitId?.trim() ?? "";
1952
1948
  if (!n) return null;
1953
- let r = K(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
1949
+ let r = kn(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
1954
1950
  if (e.mode === "ORG_UNIT") return r ? `(${r})` : null;
1955
1951
  let i = e.positionId?.trim() ?? "";
1956
1952
  return i && r ? `(${r}) && ${JSON.stringify(i)} in subject.positionIds` : null;
1957
1953
  }
1958
1954
  function nn(e, t, n) {
1959
- return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${W(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${W(t, e.orgUnitId)} / ${G(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
1955
+ return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${H(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${H(t, e.orgUnitId)} / ${U(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
1960
1956
  }
1961
1957
  function rn(e) {
1962
1958
  return {
@@ -1969,7 +1965,7 @@ function rn(e) {
1969
1965
  }
1970
1966
  function an(e, t) {
1971
1967
  let n = e.source ? t.find((t) => t.id === e.source) ?? null : null, r = e.target ? t.find((t) => t.id === e.target) ?? null : null;
1972
- return !!n && !!r && e.source !== e.target && e.sourceHandle === j && e.targetHandle === A && !!(n && H(n)) && !!(r && V(r));
1968
+ return !!n && !!r && e.source !== e.target && e.sourceHandle === ot && e.targetHandle === j && !!(n && V(n)) && !!(r && B(r));
1973
1969
  }
1974
1970
  function on(e, t) {
1975
1971
  return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
@@ -1977,10 +1973,10 @@ function on(e, t) {
1977
1973
  function sn(e) {
1978
1974
  return e.type !== "startEvent" && e.type !== "endEvent";
1979
1975
  }
1980
- function V(e) {
1976
+ function B(e) {
1981
1977
  return e.type !== "startEvent";
1982
1978
  }
1983
- function H(e) {
1979
+ function V(e) {
1984
1980
  return e.type !== "endEvent" && !cn(e);
1985
1981
  }
1986
1982
  function cn(e) {
@@ -1999,39 +1995,39 @@ function un(e) {
1999
1995
  function dn(e) {
2000
1996
  return (e?.schema.fields ?? []).reduce((e, t) => ({
2001
1997
  ...e,
2002
- [t.fieldKey]: U(t)
1998
+ [t.fieldKey]: fn(t)
2003
1999
  }), {});
2004
2000
  }
2005
- function U(e) {
2001
+ function fn(e) {
2006
2002
  return e.type === "number" ? 1e3 : e.type === "boolean" ? !0 : e.type === "select" ? e.options[0]?.value ?? "" : e.type === "checkbox" ? e.options[0] ? [e.options[0].value] : [] : e.type === "date" ? "2026-05-08" : e.type === "datetime" ? "2026-05-08T09:00:00+08:00" : e.placeholder ?? e.label;
2007
2003
  }
2008
- function fn(e) {
2004
+ function pn(e) {
2009
2005
  let t = JSON.parse(e);
2010
- if (!pn(t)) throw Error("表單資料 JSON 必須是物件。");
2006
+ if (!mn(t)) throw Error("表單資料 JSON 必須是物件。");
2011
2007
  return t;
2012
2008
  }
2013
- function pn(e) {
2009
+ function mn(e) {
2014
2010
  return typeof e == "object" && !!e && !Array.isArray(e);
2015
2011
  }
2016
- function mn(e) {
2012
+ function hn(e) {
2017
2013
  return e === "COMPLETED" ? "完成" : e === "PASSED" ? "通過" : e === "SKIPPED" ? "略過" : e === "STOPPED" ? "已停止" : e === "WAITING" ? "將等待簽核" : e;
2018
2014
  }
2019
- function hn(e) {
2020
- return e in ct ? ct[e] : e;
2015
+ function gn(e) {
2016
+ return e in st ? st[e] : e;
2021
2017
  }
2022
- function gn(e, t) {
2018
+ function _n(e, t) {
2023
2019
  return t && !e.some((e) => e.id === t.id) ? [t, ...e] : e;
2024
2020
  }
2025
- function _n(e) {
2021
+ function vn(e) {
2026
2022
  return e.map((e) => ({
2027
2023
  displayName: e.name,
2028
2024
  email: e.email,
2029
2025
  id: e.memberId,
2030
2026
  memberId: e.memberId,
2031
- name: Fn(e.name, e.email)
2027
+ name: G(e.name, e.email)
2032
2028
  }));
2033
2029
  }
2034
- function vn(e) {
2030
+ function yn(e) {
2035
2031
  return {
2036
2032
  displayName: "未知會員",
2037
2033
  email: "",
@@ -2040,29 +2036,29 @@ function vn(e) {
2040
2036
  name: "未知會員"
2041
2037
  };
2042
2038
  }
2043
- function yn(e, t) {
2044
- return e.find((e) => e.memberId === t) ?? vn(t);
2045
- }
2046
2039
  function bn(e, t) {
2047
- let n = e[0];
2048
- return n ? yn(t, n) : null;
2040
+ return e.find((e) => e.memberId === t) ?? yn(t);
2049
2041
  }
2050
2042
  function xn(e, t) {
2051
- let n = e.find((e) => e.id === t);
2052
- return n ? r(n) : null;
2043
+ let n = e[0];
2044
+ return n ? bn(t, n) : null;
2053
2045
  }
2054
2046
  function Sn(e, t) {
2047
+ let r = e.find((e) => e.id === t);
2048
+ return r ? n(r) : null;
2049
+ }
2050
+ function Cn(e, t) {
2055
2051
  let n = e.find((e) => e.id === t);
2056
- return n ? a(n) : null;
2052
+ return n ? i(n) : null;
2057
2053
  }
2058
- function W(e, t) {
2059
- return xn(e, t)?.name ?? "未指定組織";
2054
+ function H(e, t) {
2055
+ return Sn(e, t)?.name ?? "未指定組織";
2060
2056
  }
2061
- function G(e, t) {
2062
- return Sn(e, t)?.name ?? "未指定職位";
2057
+ function U(e, t) {
2058
+ return Cn(e, t)?.name ?? "未指定職位";
2063
2059
  }
2064
- function Cn(e, t) {
2065
- let n = wn(), r = t.filter((t) => t.memberId === e && Tn(t, n)), i = r.reduce((e, t) => e && En(e, t) <= 0 ? e : t, null);
2060
+ function wn(e, t) {
2061
+ let n = Tn(), r = t.filter((t) => t.memberId === e && En(t, n)), i = r.reduce((e, t) => e && W(e, t) <= 0 ? e : t, null);
2066
2062
  return {
2067
2063
  customFields: {},
2068
2064
  managerMemberId: "member-002",
@@ -2075,49 +2071,49 @@ function Cn(e, t) {
2075
2071
  roles: ["manager"]
2076
2072
  };
2077
2073
  }
2078
- function wn() {
2074
+ function Tn() {
2079
2075
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
2080
2076
  }
2081
- function Tn(e, t) {
2077
+ function En(e, t) {
2082
2078
  return e.effectiveFrom <= t && (!e.effectiveTo || e.effectiveTo >= t);
2083
2079
  }
2084
- function En(e, t) {
2080
+ function W(e, t) {
2085
2081
  return e.isPrimary === t.isPrimary ? t.effectiveFrom.localeCompare(e.effectiveFrom) : e.isPrimary ? -1 : 1;
2086
2082
  }
2087
2083
  function Dn(e) {
2088
2084
  return e.reduce((e, t) => t && !e.includes(t) ? [...e, t] : e, []);
2089
2085
  }
2090
2086
  function On({ includeDescendants: e, memberships: t, orgUnitId: n, orgUnits: r, positions: i }) {
2091
- let a = new Set(K(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
2087
+ let a = new Set(kn(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
2092
2088
  return i.filter((e) => o.has(e.id));
2093
2089
  }
2094
- function K(e, t, n) {
2090
+ function kn(e, t, n) {
2095
2091
  let r = e.find((e) => e.id === t);
2096
2092
  return r ? n ? e.filter((e) => e.id === r.id || e.path.startsWith(`${r.path}.`)).map((e) => e.id) : [r.id] : t.trim() ? [t] : [];
2097
2093
  }
2098
- function kn(e, t) {
2094
+ function An(e, t) {
2099
2095
  let n = new Set(e.map((e) => e.memberId)), r = t.filter((e) => !n.has(e.memberId));
2100
2096
  return [...e, ...r];
2101
2097
  }
2102
- function An(e) {
2098
+ function jn(e) {
2103
2099
  return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ? e.data.approverResolver.type === "DIRECT" ? e.data.approverResolver.memberIds : [] : e.type === "serviceTask" ? tr(e.data.action) : []))];
2104
2100
  }
2105
- function jn(e, t, n, r) {
2106
- return e.type === "userTask" ? Mn(e.data.approverResolver, t, n, r) : null;
2107
- }
2108
2101
  function Mn(e, t, n, r) {
2109
- return e.type === "DIRECT" ? Pn(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? Jt(e.levelsUp).name : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${W(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${W(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${W(n, e.orgUnitId)} / ${G(r, e.positionId)}` : e.type === "POSITION" ? `職位:${G(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? `表單欄位:${e.formPath || "未設定"}` : "自訂表達式";
2102
+ return e.type === "userTask" ? Nn(e.data.approverResolver, t, n, r) : null;
2110
2103
  }
2111
- function Nn(e, t) {
2104
+ function Nn(e, t, n, r) {
2105
+ return e.type === "DIRECT" ? Fn(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? Jt(e.levelsUp).name : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${H(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${H(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${H(n, e.orgUnitId)} / ${U(r, e.positionId)}` : e.type === "POSITION" ? `職位:${U(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? `表單欄位:${e.formPath || "未設定"}` : "自訂表達式";
2106
+ }
2107
+ function Pn(e, t) {
2112
2108
  if (e.type !== "serviceTask") return null;
2113
2109
  let n = tr(e.data.action);
2114
- return n.length === 0 ? ["未指定知會對象"] : n.map((e) => yn(t, e).name);
2110
+ return n.length === 0 ? ["未指定知會對象"] : n.map((e) => bn(t, e).name);
2115
2111
  }
2116
- function Pn(e, t, n) {
2117
- let r = e.map((e) => yn(t, e).name);
2112
+ function Fn(e, t, n) {
2113
+ let r = e.map((e) => bn(t, e).name);
2118
2114
  return r.length === 0 ? n : r.length <= 2 ? r.join("、") : `${r.slice(0, 2).join("、")} 等 ${r.length} 人`;
2119
2115
  }
2120
- function Fn(e, t) {
2116
+ function G(e, t) {
2121
2117
  return `${e} (${t})`;
2122
2118
  }
2123
2119
  function In(e, t) {
@@ -2137,7 +2133,7 @@ function In(e, t) {
2137
2133
  minX: Infinity,
2138
2134
  minY: Infinity
2139
2135
  });
2140
- return v({
2136
+ return De({
2141
2137
  height: r.maxY - r.minY,
2142
2138
  width: r.maxX - r.minX,
2143
2139
  x: r.minX,
@@ -2145,34 +2141,34 @@ function In(e, t) {
2145
2141
  }, n.width, n.height, .1, 1, .2);
2146
2142
  }
2147
2143
  function Ln(e) {
2148
- let t = e.nodes.find((e) => e.type === "userTask" && !!q(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "serviceTask" && e.data.action.type === "NOTIFY" && tr(e.data.action).length === 0), r = e.edges.find((t) => Q(t, e.nodes) && !t.data.isDefault && !t.data.condition);
2149
- return t && t.type === "userTask" ? q(t.data.approverResolver) : n ? "知會節點需要至少一位知會對象。" : r ? "條件分流的每條輸出連線都需要先設定條件。" : null;
2150
- }
2151
- function q(e) {
2152
- return e.type === "DIRECT" && e.memberIds.length === 0 ? "簽核節點需要指定簽核會員。" : e.type === "ORG_MANAGER" && e.levelsUp < 1 ? "簽核節點需要指定有效的主管層級。" : e.type === "ORG_UNIT_MANAGER" && !e.orgUnitId.trim() || e.type === "ORG_UNIT_MEMBER" && !e.orgUnitId.trim() ? "簽核節點需要指定組織。" : e.type === "ORG_UNIT_POSITION" && (!e.orgUnitId.trim() || !e.positionId.trim()) ? "簽核節點需要指定組織與職位。" : (e.type === "ORG_MANAGER" || e.type === "ORG_UNIT_MANAGER") && e.fallback?.type === "DIRECT" && !e.fallback.memberId.trim() ? "簽核節點需要指定改派固定人。" : e.type === "POSITION" && !e.positionId.trim() ? "簽核節點需要指定職位。" : null;
2144
+ let t = e.nodes.find((e) => e.type === "userTask" && !!Rn(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "serviceTask" && e.data.action.type === "NOTIFY" && tr(e.data.action).length === 0), r = e.edges.find((t) => X(t, e.nodes) && !t.data.isDefault && !t.data.condition);
2145
+ return t && t.type === "userTask" ? Rn(t.data.approverResolver) : n ? "知會節點需要至少一位知會對象。" : r ? "條件分流的每條輸出連線都需要先設定條件。" : null;
2153
2146
  }
2154
2147
  function Rn(e) {
2155
- return e.edges.some((t) => Q(t, e.nodes) && !!(t.data.condition || t.data.conditionFieldKey || t.data.conditionOperator || t.data.conditionValue));
2148
+ return e.type === "DIRECT" && e.memberIds.length === 0 ? "簽核節點需要指定簽核會員。" : e.type === "ORG_MANAGER" && e.levelsUp < 1 ? "簽核節點需要指定有效的主管層級。" : e.type === "ORG_UNIT_MANAGER" && !e.orgUnitId.trim() || e.type === "ORG_UNIT_MEMBER" && !e.orgUnitId.trim() ? "簽核節點需要指定組織。" : e.type === "ORG_UNIT_POSITION" && (!e.orgUnitId.trim() || !e.positionId.trim()) ? "簽核節點需要指定組織與職位。" : (e.type === "ORG_MANAGER" || e.type === "ORG_UNIT_MANAGER") && e.fallback?.type === "DIRECT" && !e.fallback.memberId.trim() ? "簽核節點需要指定改派固定人。" : e.type === "POSITION" && !e.positionId.trim() ? "簽核節點需要指定職位。" : null;
2156
2149
  }
2157
2150
  function zn(e) {
2151
+ return e.edges.some((t) => X(t, e.nodes) && !!(t.data.condition || t.data.conditionFieldKey || t.data.conditionOperator || t.data.conditionValue));
2152
+ }
2153
+ function Bn(e) {
2158
2154
  return e?.fields.map((e) => ({
2159
2155
  fieldType: e.type,
2160
2156
  id: e.fieldKey,
2161
2157
  name: `${e.label} (${e.fieldKey})`
2162
2158
  })) ?? [];
2163
2159
  }
2164
- function Bn(e, t) {
2160
+ function Vn(e, t) {
2165
2161
  return t ? e?.fields.find((e) => e.fieldKey === t) ?? null : null;
2166
2162
  }
2167
- function Vn(e) {
2163
+ function Hn(e) {
2168
2164
  if (!e) return [];
2169
- let t = J(e);
2170
- return N.filter((e) => t.includes(e.id));
2165
+ let t = Wn(e);
2166
+ return mt.filter((e) => t.includes(e.id));
2171
2167
  }
2172
- function Hn(e) {
2173
- return N.some((t) => t.id === e) ? e : null;
2168
+ function Un(e) {
2169
+ return mt.some((t) => t.id === e) ? e : null;
2174
2170
  }
2175
- function J(e) {
2171
+ function Wn(e) {
2176
2172
  return e.type === "file_upload" ? ["IS_FILLED", "IS_EMPTY"] : e.type === "boolean" ? [
2177
2173
  "EQUALS",
2178
2174
  "NOT_EQUALS",
@@ -2194,7 +2190,7 @@ function J(e) {
2194
2190
  "IS_EMPTY"
2195
2191
  ];
2196
2192
  }
2197
- function Un(e) {
2193
+ function Gn(e) {
2198
2194
  return e ? e.type === "boolean" ? [{
2199
2195
  id: "true",
2200
2196
  name: "是"
@@ -2206,68 +2202,68 @@ function Un(e) {
2206
2202
  name: e.label
2207
2203
  })) : [] : [];
2208
2204
  }
2209
- function Wn(e, t) {
2205
+ function Kn(e, t) {
2210
2206
  if (!e) return;
2211
- let n = J(e);
2207
+ let n = Wn(e);
2212
2208
  return t && n.includes(t) ? t : n[0];
2213
2209
  }
2214
- function Gn(e, t, n) {
2215
- if (!e || !t || !Kn(t)) return;
2216
- let r = Un(e);
2210
+ function qn(e, t, n) {
2211
+ if (!e || !t || !Jn(t)) return;
2212
+ let r = Gn(e);
2217
2213
  return r.length === 0 || r.some((e) => e.id === n) ? n ?? void 0 : r[0]?.id;
2218
2214
  }
2219
- function Kn(e) {
2215
+ function Jn(e) {
2220
2216
  return ht.includes(e);
2221
2217
  }
2222
- function qn(e, t, n) {
2218
+ function Yn(e, t, n) {
2223
2219
  if (!e || !t) return;
2224
- let r = Jn(t);
2225
- if (!Kn(t)) return `${e.label} ${r}`;
2226
- if (n) return `${e.label} ${r} ${Yn(e, n)}`;
2220
+ let r = K(t);
2221
+ if (!Jn(t)) return `${e.label} ${r}`;
2222
+ if (n) return `${e.label} ${r} ${Xn(e, n)}`;
2227
2223
  }
2228
- function Jn(e) {
2229
- return N.find((t) => t.id === e)?.name ?? e;
2224
+ function K(e) {
2225
+ return mt.find((t) => t.id === e)?.name ?? e;
2230
2226
  }
2231
- function Yn(e, t) {
2232
- return e.type === "boolean" ? t === "true" ? "是" : "否" : e.type === "checkbox" || e.type === "radio" || e.type === "select" ? Y(e.options, t)?.label ?? t : t;
2227
+ function Xn(e, t) {
2228
+ return e.type === "boolean" ? t === "true" ? "是" : "否" : e.type === "checkbox" || e.type === "radio" || e.type === "select" ? q(e.options, t)?.label ?? t : t;
2233
2229
  }
2234
- function Y(e, t) {
2230
+ function q(e, t) {
2235
2231
  return e.find((e) => e.value === t) ?? null;
2236
2232
  }
2237
- function Xn(e, t, n) {
2233
+ function Zn(e, t, n) {
2238
2234
  if (!e || !t) return;
2239
- let r = Zn(e.fieldKey);
2235
+ let r = J(e.fieldKey);
2240
2236
  if (t === "IS_FILLED") return `${r} != null && ${r} != ""`;
2241
2237
  if (t === "IS_EMPTY") return `${r} == null || ${r} == ""`;
2242
- if (n) return `${r} ${X(t)} ${Z(e, n)}`;
2238
+ if (n) return `${r} ${Y(t)} ${Qn(e, n)}`;
2243
2239
  }
2244
- function Zn(e) {
2240
+ function J(e) {
2245
2241
  return /^[A-Za-z_][A-Za-z0-9_]*$/u.test(e) ? `form.${e}` : `form[${JSON.stringify(e)}]`;
2246
2242
  }
2247
- function X(e) {
2243
+ function Y(e) {
2248
2244
  return e === "EQUALS" ? "==" : e === "NOT_EQUALS" ? "!=" : e === "GREATER_THAN" ? ">" : e === "GREATER_THAN_OR_EQUALS" ? ">=" : e === "LESS_THAN" ? "<" : "<=";
2249
2245
  }
2250
- function Z(e, t) {
2246
+ function Qn(e, t) {
2251
2247
  return e.type === "boolean" ? t === "true" ? "true" : "false" : (e.type === "money" || e.type === "number") && Number.isFinite(Number(t)) ? t : JSON.stringify(t);
2252
2248
  }
2253
- function Qn(e, t) {
2249
+ function $n(e, t) {
2254
2250
  if (e.data.label) return e.data.label;
2255
- if (Q(e, t)) return $n(e);
2256
- if (er(e, t)) return "同時進行";
2251
+ if (X(e, t)) return er(e);
2252
+ if (Z(e, t)) return "同時進行";
2257
2253
  }
2258
- function $n(e) {
2254
+ function er(e) {
2259
2255
  return e.data.isDefault ? "其他情況" : "請設定條件";
2260
2256
  }
2261
- function Q(e, t) {
2257
+ function X(e, t) {
2262
2258
  return t.some((t) => t.id === e.source && t.type === "exclusiveGateway");
2263
2259
  }
2264
- function er(e, t) {
2260
+ function Z(e, t) {
2265
2261
  return t.some((t) => t.id === e.source && t.type === "parallelGateway");
2266
2262
  }
2267
2263
  function tr(e) {
2268
2264
  return e.type === "NOTIFY" && e.recipients.type === "DIRECT" ? e.recipients.memberIds : [];
2269
2265
  }
2270
- function nr(e) {
2266
+ function Q(e) {
2271
2267
  return e instanceof Error ? e.message : "發生未知錯誤";
2272
2268
  }
2273
2269
  //#endregion