@rytass/bpm-core-react 0.3.0 → 0.3.1

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