@rytass/bpm-core-react 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +54 -6
  3. package/dist/chunks/{FormBuilderView-CLg-JYmu.js → FormBuilderView-BYL42M0d.js} +13 -33
  4. package/dist/chunks/FormBuilderView-BYL42M0d.js.map +1 -0
  5. package/dist/chunks/FormBuilderView-aBcA-_tt.cjs +3 -0
  6. package/dist/chunks/FormBuilderView-aBcA-_tt.cjs.map +1 -0
  7. package/dist/chunks/FormRendererView-DRFi_IH7.cjs +4 -0
  8. package/dist/chunks/FormRendererView-DRFi_IH7.cjs.map +1 -0
  9. package/dist/chunks/{FormRendererView-DU9LLrOF.js → FormRendererView-cZGOOjU5.js} +319 -332
  10. package/dist/chunks/FormRendererView-cZGOOjU5.js.map +1 -0
  11. package/dist/chunks/{admin-pickers-DLlG_1du.js → admin-pickers-DxhzECkD.js} +52 -51
  12. package/dist/chunks/admin-pickers-DxhzECkD.js.map +1 -0
  13. package/dist/chunks/admin-pickers-qe3j--gX.cjs +2 -0
  14. package/dist/chunks/admin-pickers-qe3j--gX.cjs.map +1 -0
  15. package/dist/chunks/approval-instance-list-page-CPXMP3PL.js.map +1 -1
  16. package/dist/chunks/approval-instance-list-page-ax0pm8bt.cjs.map +1 -1
  17. package/dist/chunks/auth-provider-4BeCw7cI.cjs.map +1 -1
  18. package/dist/chunks/auth-provider-B5oPmvk2.js.map +1 -1
  19. package/dist/chunks/bpm-form-field-Bc6k4ZEO.cjs.map +1 -1
  20. package/dist/chunks/bpm-form-field-Cao0rMol.js.map +1 -1
  21. package/dist/chunks/{categories-DGlxuC6X.js → categories-1gKxeEqw.js} +4 -10
  22. package/dist/chunks/categories-1gKxeEqw.js.map +1 -0
  23. package/dist/chunks/{categories-Yid05WAX.cjs → categories-DjENouRm.cjs} +2 -2
  24. package/dist/chunks/categories-DjENouRm.cjs.map +1 -0
  25. package/dist/chunks/{compose-BtQPBd1Q.js → compose-Crklayzy.js} +4 -4
  26. package/dist/chunks/compose-Crklayzy.js.map +1 -0
  27. package/dist/chunks/{compose-DZhTQOt4.cjs → compose-DZ7RKvUp.cjs} +2 -2
  28. package/dist/chunks/compose-DZ7RKvUp.cjs.map +1 -0
  29. package/dist/chunks/dashboard-page-BWQBSGDq.cjs +2 -0
  30. package/dist/chunks/dashboard-page-BWQBSGDq.cjs.map +1 -0
  31. package/dist/chunks/{dashboard-page-CeCLV1tp.js → dashboard-page-DdBvV6YI.js} +15 -16
  32. package/dist/chunks/dashboard-page-DdBvV6YI.js.map +1 -0
  33. package/dist/chunks/delegations-Ckf03icM.cjs +2 -0
  34. package/dist/chunks/delegations-Ckf03icM.cjs.map +1 -0
  35. package/dist/chunks/{delegations-DRupxJ4_.js → delegations-MxF3uJGW.js} +205 -215
  36. package/dist/chunks/delegations-MxF3uJGW.js.map +1 -0
  37. package/dist/chunks/delegations-V9HIe3_P.cjs +2 -0
  38. package/dist/chunks/delegations-V9HIe3_P.cjs.map +1 -0
  39. package/dist/chunks/{delegations-B8gLSt0i.js → delegations-xUt1tj8d.js} +168 -173
  40. package/dist/chunks/delegations-xUt1tj8d.js.map +1 -0
  41. package/dist/chunks/{designer-CrbBRPUU.js → designer-D9eFma1W.js} +1180 -1134
  42. package/dist/chunks/designer-D9eFma1W.js.map +1 -0
  43. package/dist/chunks/designer-sJGTGYOf.cjs +65 -0
  44. package/dist/chunks/designer-sJGTGYOf.cjs.map +1 -0
  45. package/dist/chunks/detail-DRCTnuKm.cjs +2 -0
  46. package/dist/chunks/detail-DRCTnuKm.cjs.map +1 -0
  47. package/dist/chunks/{detail-_c21WQla.js → detail-DScLf42P.js} +849 -836
  48. package/dist/chunks/detail-DScLf42P.js.map +1 -0
  49. package/dist/chunks/format-date-time-CB-LxzqT.js.map +1 -1
  50. package/dist/chunks/format-date-time-D-cx5M8z.cjs.map +1 -1
  51. package/dist/chunks/format-member-label-DudVI55w.js +13 -0
  52. package/dist/chunks/format-member-label-DudVI55w.js.map +1 -0
  53. package/dist/chunks/format-member-label-t7ANTF62.cjs +2 -0
  54. package/dist/chunks/format-member-label-t7ANTF62.cjs.map +1 -0
  55. package/dist/chunks/login-AtVxZBsC.cjs.map +1 -1
  56. package/dist/chunks/login-C6qlTC6F.js.map +1 -1
  57. package/dist/chunks/notifications-Bc4mgSds.cjs.map +1 -1
  58. package/dist/chunks/notifications-DJ5wzCye.js.map +1 -1
  59. package/dist/chunks/{orgs-BpqVu5ka.js → orgs-CY0i1fie.js} +787 -766
  60. package/dist/chunks/orgs-CY0i1fie.js.map +1 -0
  61. package/dist/chunks/orgs-Dr0FFoZo.cjs +2 -0
  62. package/dist/chunks/orgs-Dr0FFoZo.cjs.map +1 -0
  63. package/dist/chunks/providers-DHtDZFNA.cjs.map +1 -1
  64. package/dist/chunks/providers-J5eyByQj.js.map +1 -1
  65. package/dist/chunks/router-adapter--gYs13E8.cjs.map +1 -1
  66. package/dist/chunks/router-adapter-DftlFTOd.js.map +1 -1
  67. package/dist/chunks/routes-config-C1j_vFKo.cjs.map +1 -1
  68. package/dist/chunks/routes-config-yZbESPlw.js.map +1 -1
  69. package/dist/chunks/task-node-label-BF6UllxP.cjs.map +1 -1
  70. package/dist/chunks/task-node-label-CWZgOBj0.js.map +1 -1
  71. package/dist/chunks/use-bpm-member-D57LKe_u.js.map +1 -1
  72. package/dist/chunks/use-bpm-member-DpNAQtNC.cjs.map +1 -1
  73. package/dist/chunks/users-BCyePbwB.js +422 -0
  74. package/dist/chunks/users-BCyePbwB.js.map +1 -0
  75. package/dist/chunks/users-DVBJluFR.cjs +2 -0
  76. package/dist/chunks/users-DVBJluFR.cjs.map +1 -0
  77. package/dist/index.cjs +1 -1
  78. package/dist/index.cjs.map +1 -1
  79. package/dist/index.js +2 -2
  80. package/dist/index.js.map +1 -1
  81. package/dist/lib/format-member-label.d.ts +12 -0
  82. package/dist/next/index.cjs.map +1 -1
  83. package/dist/next/index.js.map +1 -1
  84. package/dist/next/workflow-chat-route.cjs.map +1 -1
  85. package/dist/next/workflow-chat-route.js.map +1 -1
  86. package/dist/pages/admin/delegations/index.cjs +1 -1
  87. package/dist/pages/admin/delegations/index.cjs.map +1 -1
  88. package/dist/pages/admin/delegations/index.js +1 -1
  89. package/dist/pages/admin/delegations/index.js.map +1 -1
  90. package/dist/pages/admin/orgs/index.cjs +1 -1
  91. package/dist/pages/admin/orgs/index.cjs.map +1 -1
  92. package/dist/pages/admin/orgs/index.js +1 -1
  93. package/dist/pages/admin/orgs/index.js.map +1 -1
  94. package/dist/pages/admin/users/index.cjs +1 -1
  95. package/dist/pages/admin/users/index.cjs.map +1 -1
  96. package/dist/pages/admin/users/index.js +1 -1
  97. package/dist/pages/admin/users/index.js.map +1 -1
  98. package/dist/pages/admin/webhook-endpoints/index.cjs.map +1 -1
  99. package/dist/pages/admin/webhook-endpoints/index.js.map +1 -1
  100. package/dist/pages/cc/index.cjs.map +1 -1
  101. package/dist/pages/cc/index.js.map +1 -1
  102. package/dist/pages/dashboard/index.cjs.map +1 -1
  103. package/dist/pages/dashboard/index.js.map +1 -1
  104. package/dist/pages/delegations/index.cjs +1 -1
  105. package/dist/pages/delegations/index.cjs.map +1 -1
  106. package/dist/pages/delegations/index.js +1 -1
  107. package/dist/pages/delegations/index.js.map +1 -1
  108. package/dist/pages/inbox/index.cjs.map +1 -1
  109. package/dist/pages/inbox/index.js.map +1 -1
  110. package/dist/pages/instances/detail/index.cjs +1 -1
  111. package/dist/pages/instances/detail/index.cjs.map +1 -1
  112. package/dist/pages/instances/detail/index.js +1 -1
  113. package/dist/pages/instances/detail/index.js.map +1 -1
  114. package/dist/pages/instances/new/index.cjs.map +1 -1
  115. package/dist/pages/instances/new/index.js.map +1 -1
  116. package/dist/pages/login/index.cjs.map +1 -1
  117. package/dist/pages/login/index.js.map +1 -1
  118. package/dist/pages/root/index.cjs.map +1 -1
  119. package/dist/pages/root/index.js.map +1 -1
  120. package/dist/pages/search/index.cjs.map +1 -1
  121. package/dist/pages/search/index.js.map +1 -1
  122. package/dist/pages/sent/index.cjs.map +1 -1
  123. package/dist/pages/sent/index.js.map +1 -1
  124. package/dist/pages/settings/notifications/index.cjs.map +1 -1
  125. package/dist/pages/settings/notifications/index.js.map +1 -1
  126. package/dist/pages/templates/categories/index.cjs +1 -1
  127. package/dist/pages/templates/categories/index.cjs.map +1 -1
  128. package/dist/pages/templates/categories/index.js +1 -1
  129. package/dist/pages/templates/categories/index.js.map +1 -1
  130. package/dist/pages/templates/compose/index.cjs +1 -1
  131. package/dist/pages/templates/compose/index.cjs.map +1 -1
  132. package/dist/pages/templates/compose/index.js +1 -1
  133. package/dist/pages/templates/compose/index.js.map +1 -1
  134. package/dist/pages/templates/designer/index.cjs +1 -1
  135. package/dist/pages/templates/designer/index.cjs.map +1 -1
  136. package/dist/pages/templates/designer/index.js +1 -1
  137. package/dist/pages/templates/designer/index.js.map +1 -1
  138. package/dist/pages/templates/index.cjs.map +1 -1
  139. package/dist/pages/templates/index.js.map +1 -1
  140. package/dist/pages/templates/versions/index.cjs.map +1 -1
  141. package/dist/pages/templates/versions/index.js.map +1 -1
  142. package/dist/views/admin/delegations/index.cjs +1 -1
  143. package/dist/views/admin/delegations/index.js +1 -2
  144. package/dist/views/admin/index.cjs +1 -1
  145. package/dist/views/admin/index.js +3 -3
  146. package/dist/views/admin/orgs/index.cjs +1 -1
  147. package/dist/views/admin/orgs/index.js +1 -2
  148. package/dist/views/admin/users/MemberTaskReassignModal.d.ts +13 -0
  149. package/dist/views/admin/users/index.cjs +1 -1
  150. package/dist/views/admin/users/index.js +1 -2
  151. package/dist/views/admin/webhook-endpoints/index.cjs.map +1 -1
  152. package/dist/views/admin/webhook-endpoints/index.js.map +1 -1
  153. package/dist/views/cc/index.cjs.map +1 -1
  154. package/dist/views/cc/index.js.map +1 -1
  155. package/dist/views/dashboard/index.cjs +1 -1
  156. package/dist/views/dashboard/index.cjs.map +1 -1
  157. package/dist/views/dashboard/index.js +1 -1
  158. package/dist/views/dashboard/index.js.map +1 -1
  159. package/dist/views/delegations/index.cjs +1 -1
  160. package/dist/views/delegations/index.js +1 -2
  161. package/dist/views/forms/builder/index.cjs +1 -1
  162. package/dist/views/forms/builder/index.js +1 -2
  163. package/dist/views/forms/renderer/index.cjs +1 -1
  164. package/dist/views/forms/renderer/index.js +1 -2
  165. package/dist/views/inbox/index.cjs +1 -1
  166. package/dist/views/inbox/index.cjs.map +1 -1
  167. package/dist/views/inbox/index.js +1 -5
  168. package/dist/views/inbox/index.js.map +1 -1
  169. package/dist/views/instances/detail/index.cjs +1 -1
  170. package/dist/views/instances/detail/index.js +1 -2
  171. package/dist/views/instances/index.js +1 -2
  172. package/dist/views/instances/new/index.cjs +1 -1
  173. package/dist/views/instances/new/index.cjs.map +1 -1
  174. package/dist/views/instances/new/index.js +4 -11
  175. package/dist/views/instances/new/index.js.map +1 -1
  176. package/dist/views/login/index.js +1 -2
  177. package/dist/views/search/index.cjs.map +1 -1
  178. package/dist/views/search/index.js.map +1 -1
  179. package/dist/views/sent/index.cjs.map +1 -1
  180. package/dist/views/sent/index.js.map +1 -1
  181. package/dist/views/settings/index.js +1 -2
  182. package/dist/views/settings/notifications/index.js +1 -2
  183. package/dist/views/templates/categories/index.cjs +1 -1
  184. package/dist/views/templates/categories/index.js +1 -2
  185. package/dist/views/templates/compose/index.cjs +1 -1
  186. package/dist/views/templates/compose/index.js +1 -2
  187. package/dist/views/templates/designer/index.cjs +1 -1
  188. package/dist/views/templates/designer/index.js +1 -2
  189. package/dist/views/templates/index.cjs +1 -1
  190. package/dist/views/templates/index.cjs.map +1 -1
  191. package/dist/views/templates/index.js +1 -1
  192. package/dist/views/templates/index.js.map +1 -1
  193. package/dist/views/templates/versions/index.cjs.map +1 -1
  194. package/dist/views/templates/versions/index.js.map +1 -1
  195. package/package.json +5 -5
  196. package/dist/chunks/FormBuilderView-6bCbIkz6.cjs +0 -3
  197. package/dist/chunks/FormBuilderView-6bCbIkz6.cjs.map +0 -1
  198. package/dist/chunks/FormBuilderView-CLg-JYmu.js.map +0 -1
  199. package/dist/chunks/FormRendererView-DU9LLrOF.js.map +0 -1
  200. package/dist/chunks/FormRendererView-gctFIqwC.cjs +0 -4
  201. package/dist/chunks/FormRendererView-gctFIqwC.cjs.map +0 -1
  202. package/dist/chunks/admin-pickers-Btvij1at.cjs +0 -2
  203. package/dist/chunks/admin-pickers-Btvij1at.cjs.map +0 -1
  204. package/dist/chunks/admin-pickers-DLlG_1du.js.map +0 -1
  205. package/dist/chunks/categories-DGlxuC6X.js.map +0 -1
  206. package/dist/chunks/categories-Yid05WAX.cjs.map +0 -1
  207. package/dist/chunks/compose-BtQPBd1Q.js.map +0 -1
  208. package/dist/chunks/compose-DZhTQOt4.cjs.map +0 -1
  209. package/dist/chunks/dashboard-page-CeCLV1tp.js.map +0 -1
  210. package/dist/chunks/dashboard-page-DooFJsxM.cjs +0 -2
  211. package/dist/chunks/dashboard-page-DooFJsxM.cjs.map +0 -1
  212. package/dist/chunks/delegations-8LsxcQM4.cjs +0 -2
  213. package/dist/chunks/delegations-8LsxcQM4.cjs.map +0 -1
  214. package/dist/chunks/delegations-B8gLSt0i.js.map +0 -1
  215. package/dist/chunks/delegations-DRupxJ4_.js.map +0 -1
  216. package/dist/chunks/delegations-DlYwMiAW.cjs +0 -2
  217. package/dist/chunks/delegations-DlYwMiAW.cjs.map +0 -1
  218. package/dist/chunks/designer-CrbBRPUU.js.map +0 -1
  219. package/dist/chunks/designer-D3_lWmfa.cjs +0 -65
  220. package/dist/chunks/designer-D3_lWmfa.cjs.map +0 -1
  221. package/dist/chunks/detail-CVXb5Vy8.cjs +0 -2
  222. package/dist/chunks/detail-CVXb5Vy8.cjs.map +0 -1
  223. package/dist/chunks/detail-_c21WQla.js.map +0 -1
  224. package/dist/chunks/orgs-BpqVu5ka.js.map +0 -1
  225. package/dist/chunks/orgs-D0-5BaHT.cjs +0 -2
  226. package/dist/chunks/orgs-D0-5BaHT.cjs.map +0 -1
  227. package/dist/chunks/users-C9LA-Rd7.cjs +0 -2
  228. package/dist/chunks/users-C9LA-Rd7.cjs.map +0 -1
  229. package/dist/chunks/users-FWrb3ehW.js +0 -214
  230. package/dist/chunks/users-FWrb3ehW.js.map +0 -1
@@ -2,28 +2,30 @@
2
2
  import { r as e } from "./router-adapter-DftlFTOd.js";
3
3
  import { r as t } from "./routes-config-yZbESPlw.js";
4
4
  import { t as n } from "./bpm-form-field-Cao0rMol.js";
5
- import { a as r, n as i, o as a, r as o } from "./admin-pickers-DLlG_1du.js";
6
- import { n as s, r as c } from "./FormRendererView-DU9LLrOF.js";
5
+ import { t as r } from "./format-member-label-DudVI55w.js";
6
+ import { a as i, n as a, o, r as s } from "./admin-pickers-DxhzECkD.js";
7
+ import { n as c, r as l } from "./FormRendererView-cZGOOjU5.js";
7
8
  import '../style.css';/* empty css */
8
- import { t as l } from "./FormBuilderView-CLg-JYmu.js";
9
- import { Fragment as u, useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
10
- import { AutoComplete as g, Button as _, Icon as v, Input as y, Modal as b, PageHeader as ee, Section as te, SectionGroup as ne, Select as x, Textarea as re, Toggle as S, Typography as C } from "@mezzanine-ui/react";
11
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
12
- import ie from "@mezzanine-ui/react/Drawer";
13
- import ae from "@mezzanine-ui/react/ContentHeader";
14
- import { CheckedIcon as oe, DotGridIcon as se, EyeIcon as ce, FilterIcon as le, MailIcon as ue, PlusIcon as de, SaveIcon as fe, TrashIcon as pe, UserIcon as me } from "@mezzanine-ui/icons";
15
- import { DefaultChatTransport as he, getToolName as ge, isToolUIPart as _e, lastAssistantMessageIsCompleteWithToolCalls as ve } from "ai";
16
- import { WORKFLOW_TOOLSET as D, applyWorkflowCommand as ye, applyWorkflowMacroCommand as be, executeWorkflowTool as xe, readWorkflowSnapshot as Se } from "@rytass/bpm-core-shared";
17
- import { readFormBuilder as Ce, readFormSchemaLintMessage as we } from "@rytass/bpm-core-client/form";
18
- import { isFormStaticOptionFieldDefinition as Te, isMemberFieldDefinition as Ee } from "@rytass/bpm-core-shared/form";
19
- import { readOrganizationDashboard as De } from "@rytass/bpm-core-client/organization";
20
- import { Background as Oe, ConnectionMode as ke, ControlButton as Ae, Controls as je, Handle as Me, MiniMap as Ne, Panel as Pe, Position as O, ReactFlow as Fe, applyNodeChanges as Ie, getViewportForBounds as Le } from "@xyflow/react";
9
+ import { t as u } from "./FormBuilderView-BYL42M0d.js";
10
+ import { Fragment as d, useCallback as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
11
+ import { AutoComplete as _, Button as v, Icon as ee, Input as te, Modal as y, PageHeader as ne, Section as re, SectionGroup as ie, Select as b, Textarea as ae, Toggle as x, Typography as S } from "@mezzanine-ui/react";
12
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
13
+ import oe from "@mezzanine-ui/react/Drawer";
14
+ import E from "@mezzanine-ui/react/ContentHeader";
15
+ import { CheckedIcon as se, DotGridIcon as ce, EyeIcon as le, FilterIcon as ue, MailIcon as de, PlusIcon as fe, SaveIcon as pe, TrashIcon as me, UserIcon as he } from "@mezzanine-ui/icons";
16
+ import { DefaultChatTransport as ge, getToolName as _e, isToolUIPart as ve, lastAssistantMessageIsCompleteWithToolCalls as D } from "ai";
17
+ import { WORKFLOW_TOOLSET as ye, applyWorkflowCommand as be, applyWorkflowMacroCommand as xe, executeWorkflowTool as Se, readWorkflowSnapshot as Ce } from "@rytass/bpm-core-shared";
18
+ import { readFormBuilder as we, readFormSchemaLintMessage as Te } from "@rytass/bpm-core-client/form";
19
+ import { isFormStaticOptionFieldDefinition as Ee, isMemberFieldDefinition as De } from "@rytass/bpm-core-shared/form";
20
+ import { readOrganizationDashboard as Oe } from "@rytass/bpm-core-client/organization";
21
+ import { Background as ke, ConnectionMode as Ae, ControlButton as je, Controls as Me, Handle as O, MiniMap as Ne, Panel as Pe, Position as k, ReactFlow as Fe, applyNodeChanges as Ie, getViewportForBounds as Le } from "@xyflow/react";
21
22
  import * as Re from "dagre";
22
23
  import { composeApprovalTemplateWithForm as ze, dryRunApprovalWorkflow as Be, forkApprovalTemplate as Ve, listWorkflowWebhookEndpoints as He, publishApprovalTemplateVersion as Ue, readTemplateDesigner as We, resolveMemberOptions as Ge, searchMemberOptions as Ke, searchPublishedFormVersionOptions as qe, updateApprovalTemplateDraft as Je } from "@rytass/bpm-core-client/template";
23
24
  import { useChat as Ye } from "@ai-sdk/react";
24
- import { DEFAULT_QUORUM_THRESHOLD as Xe, DEFAULT_SLA_CONFIG as Ze, NOTIFY_WEBHOOK_CONTEXT_PATHS as k, NOTIFY_WEBHOOK_TARGET_LIMIT as A, SLA_CALENDAR_MODE_OPTIONS as Qe, SLA_DURATION_UNIT_OPTIONS as $e, SLA_TIMEOUT_ACTION_OPTIONS as et, composeQuorumThreshold as tt, composeSlaDuration as j, createNotifyWebhookTarget as M, hasConfiguredConditionEdges as nt, isDecisionPolicyUnsatisfiable as rt, isFormFieldCompatibleWithWebhookParameter as it, isNotifyWebhookContextPath as N, isOrgManagerChainDecisionPolicyInvalid as at, readApproverResolverIssue as ot, readConditionOperatorIds as st, readDesignTimeApproverCount as ct, readExcludeInitiatorIssue as lt, readNotifyServiceTaskIssue as ut, readNotifyWebhookCatalogIssueMessage as dt, readNotifyWebhookStructureIssues as ft, readNotifyWebhookTargetCatalogIssues as pt, readNotifyWebhookTargets as mt, readSlaDurationParts as ht } from "@rytass/bpm-core-shared/workflow-graph";
25
+ import { readUnsupportedApproverFallbackType as Xe } from "@rytass/bpm-core-shared/workflow";
26
+ import { DEFAULT_QUORUM_THRESHOLD as A, DEFAULT_SLA_CONFIG as Ze, NOTIFY_WEBHOOK_CONTEXT_PATHS as j, NOTIFY_WEBHOOK_TARGET_LIMIT as M, SLA_CALENDAR_MODE_OPTIONS as Qe, SLA_DURATION_UNIT_OPTIONS as $e, SLA_TIMEOUT_ACTION_OPTIONS as et, composeQuorumThreshold as tt, composeSlaDuration as N, createNotifyWebhookTarget as nt, hasConfiguredConditionEdges as rt, isDecisionPolicyUnsatisfiable as it, isFormFieldCompatibleWithWebhookParameter as P, isNotifyWebhookContextPath as at, isOrgManagerChainDecisionPolicyInvalid as ot, readApproverResolverIssue as st, readConditionOperatorIds as ct, readDesignTimeApproverCount as lt, readExcludeInitiatorIssue as ut, readNotifyServiceTaskIssue as dt, readNotifyWebhookCatalogIssueMessage as ft, readNotifyWebhookStructureIssues as pt, readNotifyWebhookTargetCatalogIssues as mt, readNotifyWebhookTargets as ht, readSlaDurationParts as gt } from "@rytass/bpm-core-shared/workflow-graph";
25
27
  //#region src/views/templates/designer/decision-policy-options.ts
26
- var gt = [
28
+ var _t = [
27
29
  {
28
30
  id: "SINGLE",
29
31
  name: "單人簽核"
@@ -45,25 +47,25 @@ var gt = [
45
47
  name: "達到指定門檻"
46
48
  }
47
49
  ];
48
- function _t(e) {
50
+ function vt(e) {
49
51
  if (!e || e.type === "SINGLE" || e.type === "PARALLEL_ANY") return "可指定多位;多位時所有人都會收到待辦,任一人同意即可通過。";
50
52
  if (e.type === "PARALLEL_ALL") return "可指定多位;多位時所有人都會收到待辦,全部同意後才會通過。";
51
53
  if (e.type === "SEQUENTIAL") return "依簽核人順序一次開放一位,前一位核准後才輪到下一位;任一位拒絕或退回即結束此關。";
52
54
  let t = e.thresholdType === "PERCENTAGE" ? "%" : " 位簽核者";
53
55
  return `可指定多位;需達到 ${e.threshold}${t} 才會通過。`;
54
56
  }
55
- function vt(e) {
56
- return gt.find((t) => t.id === e) || {
57
+ function yt(e) {
58
+ return _t.find((t) => t.id === e) || {
57
59
  id: e,
58
60
  name: `未知決策方式(${e})`
59
61
  };
60
62
  }
61
63
  //#endregion
62
64
  //#region src/views/templates/designer/use-workflow-designer-controller.ts
63
- function yt({ directory: e, initialState: t, layout: n, onLayout: r }) {
64
- let [i, a] = h(t), o = m(t), s = m(e);
65
+ function bt({ directory: e, initialState: t, layout: n, onLayout: r }) {
66
+ let [i, a] = g(t), o = h(t), s = h(e);
65
67
  s.current = e;
66
- let c = d((e) => {
68
+ let c = f((e) => {
67
69
  if (!e.changed && !e.error) return e;
68
70
  let t = e.effects.layout ? n(e.state.definition) : e.state.definition, i = {
69
71
  ...e.state,
@@ -73,57 +75,53 @@ function yt({ directory: e, initialState: t, layout: n, onLayout: r }) {
73
75
  ...e,
74
76
  state: i
75
77
  };
76
- }, [n, r]), l = d((e) => c(ye(o.current, e)), [c]), u = d((e) => c(be(o.current, e)), [c]), f = d(async (e, t) => {
77
- let n = await xe(o.current, e, t, { directory: s.current });
78
+ }, [n, r]), l = f((e) => c(be(o.current, e)), [c]), u = f((e) => c(xe(o.current, e)), [c]), d = f(async (e, t) => {
79
+ let n = await Se(o.current, e, t, { directory: s.current });
78
80
  if (n.ok && (n.kind === "mutation" || n.kind === "macro")) {
79
81
  let e = c(n.result);
80
82
  return {
81
83
  ...n,
82
84
  result: e,
83
- snapshot: Se(e.state)
85
+ snapshot: Ce(e.state)
84
86
  };
85
87
  }
86
88
  return n;
87
- }, [c]), g = d((e) => {
89
+ }, [c]), p = f((e) => {
88
90
  let t = typeof e == "function" ? e(o.current) : e;
89
91
  o.current = t, a(t);
90
- }, []), _ = d(() => o.current, []), v = p(() => Se(i), [i]);
91
- return p(() => ({
92
+ }, []), _ = f(() => o.current, []), v = m(() => Ce(i), [i]);
93
+ return m(() => ({
92
94
  dispatch: l,
93
95
  dispatchMacro: u,
94
- executeTool: f,
96
+ executeTool: d,
95
97
  getState: _,
96
- replaceState: g,
98
+ replaceState: p,
97
99
  snapshot: v,
98
100
  state: i,
99
- tools: D
101
+ tools: ye
100
102
  }), [
101
103
  l,
102
104
  u,
103
- f,
105
+ d,
104
106
  _,
105
- g,
107
+ p,
106
108
  v,
107
109
  i
108
110
  ]);
109
111
  }
110
112
  //#endregion
111
113
  //#region src/views/templates/designer/use-workflow-chat.ts
112
- function bt({ controller: e, api: t = "/api/chat" }) {
113
- let n = p(() => new he({ api: t }), [t]), r = Ye({
114
+ function F({ controller: e, api: t = "/api/chat" }) {
115
+ let n = m(() => new ge({ api: t }), [t]), r = Ye({
114
116
  transport: n,
115
- sendAutomaticallyWhen: ve,
117
+ sendAutomaticallyWhen: D,
116
118
  async onToolCall({ toolCall: t }) {
117
119
  let n = await e.executeTool(t.toolName, t.input);
118
- if (n.ok) {
119
- r.addToolOutput({
120
- output: n.kind === "query" ? n.data : n.snapshot,
121
- tool: t.toolName,
122
- toolCallId: t.toolCallId
123
- });
124
- return;
125
- }
126
- r.addToolOutput({
120
+ n.ok ? r.addToolOutput({
121
+ output: n.kind === "query" ? n.data : n.snapshot,
122
+ tool: t.toolName,
123
+ toolCallId: t.toolCallId
124
+ }) : r.addToolOutput({
127
125
  errorText: n.error,
128
126
  state: "output-error",
129
127
  tool: t.toolName,
@@ -135,12 +133,12 @@ function bt({ controller: e, api: t = "/api/chat" }) {
135
133
  }
136
134
  //#endregion
137
135
  //#region src/views/templates/designer/chrome-workflow-chat.ts
138
- var P = 12;
139
- function xt() {
136
+ var xt = 12;
137
+ function I() {
140
138
  let e = globalThis.LanguageModel;
141
139
  return e && typeof e == "object" ? e : null;
142
140
  }
143
- var F = {
141
+ var St = {
144
142
  additionalProperties: !1,
145
143
  properties: {
146
144
  action: {
@@ -154,7 +152,7 @@ var F = {
154
152
  required: ["action"],
155
153
  type: "object"
156
154
  };
157
- function St() {
155
+ function Ct() {
158
156
  return `你是「簽核流程設計器」頁面的離線 AI 助理。只能透過下列工具操作這個流程畫布,其他請求一律婉拒並引導回流程設計。
159
157
 
160
158
  每一步只輸出一個 JSON 決策物件:
@@ -164,17 +162,17 @@ function St() {
164
162
  規則:先用 get_workflow_snapshot 了解現況再規劃;完成後用 validate_workflow 檢查並以 message 說明做了什麼。
165
163
 
166
164
  可用工具:
167
- ${D.map((e) => `- ${e.name}(${JSON.stringify(e.inputSchema.properties ?? {})}): ${e.description}`).join("\n")}`;
165
+ ${ye.map((e) => `- ${e.name}(${JSON.stringify(e.inputSchema.properties ?? {})}): ${e.description}`).join("\n")}`;
168
166
  }
169
- function Ct({ controller: e }) {
170
- let [t, n] = h(!1), [r, i] = h([]), [a, o] = h("ready"), s = m(0);
171
- f(() => {
172
- let e = xt();
167
+ function wt({ controller: e }) {
168
+ let [t, n] = g(!1), [r, i] = g([]), [a, o] = g("ready"), s = h(0);
169
+ p(() => {
170
+ let e = I();
173
171
  e && e.availability().then((e) => {
174
172
  n(e !== "unavailable");
175
173
  }).catch(() => n(!1));
176
174
  }, []);
177
- let c = d((e, t) => {
175
+ let c = f((e, t) => {
178
176
  s.current += 1, i((n) => [...n, {
179
177
  id: `chrome-${s.current}`,
180
178
  parts: [{
@@ -187,15 +185,15 @@ function Ct({ controller: e }) {
187
185
  return {
188
186
  available: t,
189
187
  messages: r,
190
- send: d((t) => {
191
- let n = xt();
192
- n && a === "ready" && (c("user", t), o("submitted"), wt({
188
+ send: f((t) => {
189
+ let n = I();
190
+ n && a === "ready" && (c("user", t), o("submitted"), Tt({
193
191
  appendMessage: c,
194
192
  controller: e,
195
193
  model: n,
196
194
  userText: t
197
195
  }).then(() => o("ready")).catch((e) => {
198
- c("assistant", Et(e)), o("error");
196
+ c("assistant", Dt(e)), o("error");
199
197
  }));
200
198
  }, [
201
199
  c,
@@ -205,15 +203,15 @@ function Ct({ controller: e }) {
205
203
  status: a
206
204
  };
207
205
  }
208
- async function wt({ appendMessage: e, controller: t, model: n, userText: r }) {
206
+ async function Tt({ appendMessage: e, controller: t, model: n, userText: r }) {
209
207
  let i = await n.create({ initialPrompts: [{
210
- content: St(),
208
+ content: Ct(),
211
209
  role: "system"
212
210
  }] });
213
211
  try {
214
212
  let n = `使用者需求:${r}\n目前流程:${JSON.stringify(t.snapshot)}`;
215
- for (let r = 0; r < P; r += 1) {
216
- let r = Tt(await i.prompt(n, { responseConstraint: F }));
213
+ for (let r = 0; r < xt; r += 1) {
214
+ let r = Et(await i.prompt(n, { responseConstraint: St }));
217
215
  if (!r || r.action === "message") {
218
216
  e("assistant", r?.text ?? "我已完成可處理的部分。");
219
217
  return;
@@ -233,7 +231,7 @@ async function wt({ appendMessage: e, controller: t, model: n, userText: r }) {
233
231
  i.destroy();
234
232
  }
235
233
  }
236
- function Tt(e) {
234
+ function Et(e) {
237
235
  try {
238
236
  let t = JSON.parse(e);
239
237
  return typeof t == "object" && t && t.action !== void 0 ? t : null;
@@ -241,51 +239,51 @@ function Tt(e) {
241
239
  return null;
242
240
  }
243
241
  }
244
- function Et(e) {
242
+ function Dt(e) {
245
243
  return e instanceof Error ? `離線模式發生錯誤:${e.message}` : "離線模式發生未知錯誤。";
246
244
  }
247
245
  //#endregion
248
246
  //#region src/views/templates/designer/workflow-chat-drawer.tsx
249
- var Dt = {
247
+ var Ot = {
250
248
  display: "flex",
251
249
  flexDirection: "column",
252
250
  gap: 12,
253
251
  height: "100%"
254
- }, Ot = {
252
+ }, kt = {
255
253
  display: "flex",
256
254
  flex: 1,
257
255
  flexDirection: "column",
258
256
  gap: 12,
259
257
  minHeight: 0,
260
258
  overflowY: "auto"
261
- }, kt = {
259
+ }, At = {
262
260
  display: "flex",
263
261
  gap: 8,
264
262
  paddingBottom: 4
265
- }, At = {
263
+ }, jt = {
266
264
  borderTop: "1px solid var(--mzn-color-border-neutral, #e5e7eb)",
267
265
  display: "flex",
268
266
  flexDirection: "column",
269
267
  gap: 8,
270
268
  paddingTop: 12
271
- }, jt = {
269
+ }, Mt = {
272
270
  display: "flex",
273
271
  justifyContent: "flex-end"
274
- }, Mt = { width: "100%" }, Nt = "workflow-chat-input-field", I = `
275
- .${Nt}.mzn-text-field {
272
+ }, Nt = { width: "100%" }, L = "workflow-chat-input-field", Pt = `
273
+ .${L}.mzn-text-field {
276
274
  width: 100%;
277
275
  }
278
- `, Pt = {
276
+ `, Ft = {
279
277
  color: "var(--mzn-color-text-secondary, #6b7280)",
280
278
  fontSize: 12,
281
279
  padding: "2px 0"
282
- }, Ft = {
280
+ }, It = {
283
281
  "input-available": "執行中…",
284
282
  "input-streaming": "準備中…",
285
283
  "output-available": "完成",
286
284
  "output-error": "失敗"
287
285
  };
288
- function It(e) {
286
+ function Lt(e) {
289
287
  let t = e === "user";
290
288
  return {
291
289
  alignSelf: t ? "flex-end" : "flex-start",
@@ -298,11 +296,11 @@ function It(e) {
298
296
  wordBreak: "break-word"
299
297
  };
300
298
  }
301
- function Lt({ api: e, controller: t, onClose: n, open: r }) {
302
- let i = bt({
299
+ function Rt({ api: e, controller: t, onClose: n, open: r }) {
300
+ let i = F({
303
301
  api: e,
304
302
  controller: t
305
- }), a = Ct({ controller: t }), [o, s] = h("online"), [c, l] = h(""), f = o === "offline" ? {
303
+ }), a = wt({ controller: t }), [o, s] = g("online"), [c, l] = g(""), u = o === "offline" ? {
306
304
  messages: a.messages,
307
305
  send: a.send,
308
306
  status: a.status
@@ -312,72 +310,72 @@ function Lt({ api: e, controller: t, onClose: n, open: r }) {
312
310
  i.sendMessage({ text: e });
313
311
  },
314
312
  status: i.status
315
- }, { messages: p, send: m } = f, g = f.status === "submitted" || f.status === "streaming", v = d(() => {
313
+ }, { messages: p, send: m } = u, h = u.status === "submitted" || u.status === "streaming", _ = f(() => {
316
314
  let e = c.trim();
317
- e && !g && (l(""), m(e));
315
+ e && !h && (l(""), m(e));
318
316
  }, [
319
- g,
317
+ h,
320
318
  c,
321
319
  m
322
- ]), y = d((e) => {
323
- e.nativeEvent.isComposing || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), v());
324
- }, [v]);
325
- return /* @__PURE__ */ E(ie, {
320
+ ]), ee = f((e) => {
321
+ e.nativeEvent.isComposing || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), _());
322
+ }, [_]);
323
+ return /* @__PURE__ */ T(oe, {
326
324
  headerTitle: "AI 流程助理",
327
325
  isHeaderDisplay: !0,
328
326
  onClose: n,
329
327
  open: r,
330
328
  size: "medium",
331
- children: [/* @__PURE__ */ T("style", { children: I }), /* @__PURE__ */ E("div", {
332
- style: Dt,
329
+ children: [/* @__PURE__ */ w("style", { children: Pt }), /* @__PURE__ */ T("div", {
330
+ style: Ot,
333
331
  children: [
334
- a.available ? /* @__PURE__ */ E("div", {
335
- style: kt,
336
- children: [/* @__PURE__ */ T(_, {
332
+ a.available ? /* @__PURE__ */ T("div", {
333
+ style: At,
334
+ children: [/* @__PURE__ */ w(v, {
337
335
  onClick: () => s("online"),
338
336
  variant: o === "online" ? "base-primary" : "base-tertiary",
339
337
  children: "線上"
340
- }), /* @__PURE__ */ T(_, {
338
+ }), /* @__PURE__ */ w(v, {
341
339
  onClick: () => s("offline"),
342
340
  variant: o === "offline" ? "base-primary" : "base-tertiary",
343
341
  children: "離線(裝置內,實驗)"
344
342
  })]
345
343
  }) : null,
346
- /* @__PURE__ */ E("div", {
344
+ /* @__PURE__ */ T("div", {
347
345
  role: "log",
348
- style: Ot,
346
+ style: kt,
349
347
  children: [
350
- p.length === 0 ? /* @__PURE__ */ T(C, {
348
+ p.length === 0 ? /* @__PURE__ */ w(S, {
351
349
  color: "text-neutral",
352
350
  variant: "body",
353
351
  children: "用一句話描述你想要的流程,例如:「建立三關簽核:部門主管 → 經理 → 財務,金額大於十萬走財務複核」。我會直接在畫布上幫你繪製。"
354
352
  }) : null,
355
- p.map((e) => /* @__PURE__ */ T(u, { children: Rt(e) }, e.id)),
356
- g ? /* @__PURE__ */ T(C, {
353
+ p.map((e) => /* @__PURE__ */ w(d, { children: zt(e) }, e.id)),
354
+ h ? /* @__PURE__ */ w(S, {
357
355
  color: "text-neutral",
358
356
  variant: "body",
359
357
  children: "思考中…"
360
358
  }) : null
361
359
  ]
362
360
  }),
363
- /* @__PURE__ */ E("div", {
364
- style: At,
365
- children: [/* @__PURE__ */ T(re, {
366
- className: Nt,
367
- disabled: g,
361
+ /* @__PURE__ */ T("div", {
362
+ style: jt,
363
+ children: [/* @__PURE__ */ w(ae, {
364
+ className: L,
365
+ disabled: h,
368
366
  maxLength: 2e3,
369
367
  onChange: (e) => l(e.target.value),
370
- onKeyDown: y,
368
+ onKeyDown: ee,
371
369
  placeholder: "描述你想要的流程…(Enter 送出,Shift + Enter 換行)",
372
370
  rows: 3,
373
- style: Mt,
371
+ style: Nt,
374
372
  value: c
375
- }), /* @__PURE__ */ T("div", {
376
- style: jt,
377
- children: /* @__PURE__ */ T(_, {
378
- disabled: g || c.trim().length === 0,
379
- loading: g,
380
- onClick: v,
373
+ }), /* @__PURE__ */ w("div", {
374
+ style: Mt,
375
+ children: /* @__PURE__ */ w(v, {
376
+ disabled: h || c.trim().length === 0,
377
+ loading: h,
378
+ onClick: _,
381
379
  type: "button",
382
380
  variant: "base-primary",
383
381
  children: "送出"
@@ -388,16 +386,16 @@ function Lt({ api: e, controller: t, onClose: n, open: r }) {
388
386
  })]
389
387
  });
390
388
  }
391
- function Rt(e) {
389
+ function zt(e) {
392
390
  return e.parts.map((t, n) => {
393
- if (t.type === "text") return /* @__PURE__ */ T("div", {
394
- style: It(e.role),
391
+ if (t.type === "text") return /* @__PURE__ */ w("div", {
392
+ style: Lt(e.role),
395
393
  children: t.text
396
394
  }, `${e.id}-${n}`);
397
- if (t.type === "dynamic-tool" || _e(t)) {
398
- let r = ge(t), i = Ft[t.state] ?? t.state;
399
- return /* @__PURE__ */ T("div", {
400
- style: Pt,
395
+ if (t.type === "dynamic-tool" || ve(t)) {
396
+ let r = _e(t), i = It[t.state] ?? t.state;
397
+ return /* @__PURE__ */ w("div", {
398
+ style: Ft,
401
399
  children: `⚙ ${r} · ${i}`
402
400
  }, `${e.id}-${n}`);
403
401
  }
@@ -406,7 +404,7 @@ function Rt(e) {
406
404
  }
407
405
  //#endregion
408
406
  //#region src/views/templates/designer/position-level-options.ts
409
- function zt(e, t) {
407
+ function Bt(e, t) {
410
408
  let n = [...new Set(e.map((e) => e.level))];
411
409
  return [...n.includes(t) ? n : [...n, t]].sort((e, t) => t - e).map((t) => {
412
410
  let n = e.filter((e) => e.level === t).map((e) => e.name);
@@ -417,12 +415,12 @@ function zt(e, t) {
417
415
  };
418
416
  });
419
417
  }
420
- function Bt(e) {
418
+ function R(e) {
421
419
  return e.reduce((e, t) => Math.max(e, t.level), 1);
422
420
  }
423
421
  //#endregion
424
422
  //#region src/views/templates/designer/notify-webhook-designer.ts
425
- var L = {
423
+ var Vt = {
426
424
  "initiator.memberId": "發起人會員編號",
427
425
  "instance.id": "案件編號",
428
426
  "instance.templateId": "模板編號",
@@ -430,14 +428,14 @@ var L = {
430
428
  "instance.title": "案件主旨",
431
429
  "node.id": "節點編號",
432
430
  "node.label": "節點名稱"
433
- }, Vt = {
431
+ }, z = {
434
432
  boolean: "是/否",
435
433
  json: "JSON",
436
434
  number: "數字",
437
435
  string: "文字",
438
436
  stringArray: "文字清單"
439
437
  };
440
- function R(e) {
438
+ function B(e) {
441
439
  return `${e.key}@${e.version}`;
442
440
  }
443
441
  function Ht(e, t) {
@@ -451,7 +449,7 @@ function Ut(e) {
451
449
  ];
452
450
  }
453
451
  function Wt(e, t) {
454
- return e.filter((e) => it(e, t));
452
+ return e.filter((e) => P(e, t));
455
453
  }
456
454
  function Gt(e, t, n) {
457
455
  return e === "FIELD" ? {
@@ -472,7 +470,7 @@ function qt(e, t) {
472
470
  return n ? Kt.test(n) ? Number(n) : t : null;
473
471
  }
474
472
  function Jt(e) {
475
- return !ft(e).some((e) => Yt.has(e.code));
473
+ return !pt(e).some((e) => Yt.has(e.code));
476
474
  }
477
475
  var Yt = /* @__PURE__ */ new Set([
478
476
  "BINDING_INVALID",
@@ -503,7 +501,7 @@ function Zt(e, t, n) {
503
501
  return {
504
502
  bindings: e.bindings.filter((r) => {
505
503
  let i = t.parameters.find((e) => e.key === r.parameter);
506
- return i !== void 0 && !pt({
504
+ return i !== void 0 && !mt({
507
505
  endpoint: { parameters: [{
508
506
  ...i,
509
507
  required: !1
@@ -523,14 +521,14 @@ function Zt(e, t, n) {
523
521
  };
524
522
  }
525
523
  function Qt({ definition: e, endpoints: t, formFields: n }) {
526
- return e.nodes.flatMap((e) => e.type !== "serviceTask" || e.data.action.type !== "NOTIFY" || ft(e.data.action.webhooks).length ? [] : mt(e.data.action).flatMap((r, i) => {
524
+ return e.nodes.flatMap((e) => e.type !== "serviceTask" || e.data.action.type !== "NOTIFY" || pt(e.data.action.webhooks).length ? [] : ht(e.data.action).flatMap((r, i) => {
527
525
  let a = Ht(t, r.endpoint);
528
- return pt({
526
+ return mt({
529
527
  endpoint: a,
530
528
  formFields: n,
531
529
  target: r
532
- }).map((t) => dt({
533
- endpointLabel: a?.label ?? R(r.endpoint),
530
+ }).map((t) => ft({
531
+ endpointLabel: a?.label ?? B(r.endpoint),
534
532
  issue: t,
535
533
  nodeLabel: e.data.label,
536
534
  targetIndex: i
@@ -581,9 +579,9 @@ var $t = {
581
579
  }, {
582
580
  id: "false",
583
581
  name: "否"
584
- }], sn = k.map((e) => ({
582
+ }], sn = j.map((e) => ({
585
583
  id: e,
586
- name: L[e]
584
+ name: Vt[e]
587
585
  }));
588
586
  function cn({ catalog: e, catalogState: t, formFields: n, onChange: r, targets: i }) {
589
587
  let a = e.filter((e) => !e.deprecated);
@@ -593,34 +591,34 @@ function cn({ catalog: e, catalogState: t, formFields: n, onChange: r, targets:
593
591
  }
594
592
  function s() {
595
593
  let [e] = a;
596
- e && r([...i, M({
594
+ e && r([...i, nt({
597
595
  key: e.key,
598
596
  version: e.version
599
597
  })]);
600
598
  }
601
- return /* @__PURE__ */ E("div", {
599
+ return /* @__PURE__ */ T("div", {
602
600
  style: $t,
603
601
  children: [
604
- /* @__PURE__ */ T(C, {
602
+ /* @__PURE__ */ w(S, {
605
603
  variant: "label-primary-highlight",
606
604
  children: "Webhook"
607
605
  }),
608
- /* @__PURE__ */ T(C, {
606
+ /* @__PURE__ */ w(S, {
609
607
  color: "text-neutral",
610
608
  variant: "caption",
611
609
  children: "知會節點抵達時,將指定的表單欄位或案件資訊送到外部系統。"
612
610
  }),
613
- t === "loading" ? /* @__PURE__ */ T(C, {
611
+ t === "loading" ? /* @__PURE__ */ w(S, {
614
612
  color: "text-neutral",
615
613
  variant: "body",
616
614
  children: "正在載入可用的 Webhook 端點…"
617
615
  }) : null,
618
- t === "unavailable" ? /* @__PURE__ */ T(C, {
616
+ t === "unavailable" ? /* @__PURE__ */ w(S, {
619
617
  color: "text-error",
620
618
  variant: "body",
621
619
  children: "目前無法載入 Webhook 端點,已設定的內容會保留,請稍後重試。"
622
620
  }) : null,
623
- i.map((s, c) => /* @__PURE__ */ T(ln, {
621
+ i.map((s, c) => /* @__PURE__ */ w(ln, {
624
622
  activeEndpoints: a,
625
623
  catalog: e,
626
624
  catalogState: t,
@@ -630,20 +628,20 @@ function cn({ catalog: e, catalogState: t, formFields: n, onChange: r, targets:
630
628
  onRemove: () => r(i.filter((e, t) => t !== c)),
631
629
  target: s
632
630
  }, s.id)),
633
- /* @__PURE__ */ T("div", { children: /* @__PURE__ */ T(_, {
634
- disabled: t !== "ready" || !a.length || i.length >= A,
635
- icon: de,
631
+ /* @__PURE__ */ w("div", { children: /* @__PURE__ */ w(v, {
632
+ disabled: t !== "ready" || !a.length || i.length >= M,
633
+ icon: fe,
636
634
  iconType: "leading",
637
635
  onClick: s,
638
636
  variant: "base-dashed",
639
637
  children: "新增 Webhook"
640
638
  }) }),
641
- i.length >= A ? /* @__PURE__ */ E(C, {
639
+ i.length >= M ? /* @__PURE__ */ T(S, {
642
640
  color: "text-neutral",
643
641
  variant: "caption",
644
642
  children: [
645
643
  "每個知會節點最多 ",
646
- A,
644
+ M,
647
645
  " 個 Webhook。"
648
646
  ]
649
647
  }) : null
@@ -651,42 +649,42 @@ function cn({ catalog: e, catalogState: t, formFields: n, onChange: r, targets:
651
649
  });
652
650
  }
653
651
  function ln({ activeEndpoints: e, catalog: t, catalogState: r, formFields: i, index: a, onChange: o, onRemove: s, target: c }) {
654
- let l = Ht(t, c.endpoint), u = R(c.endpoint), d = [...e.map((e) => ({
655
- id: R(e),
656
- name: z(e)
652
+ let l = Ht(t, c.endpoint), u = B(c.endpoint), d = [...e.map((e) => ({
653
+ id: B(e),
654
+ name: H(e)
657
655
  })), ...l && !l.deprecated ? [] : [{
658
656
  id: u,
659
- name: l ? z(l) : `${u}(找不到端點)`
657
+ name: l ? H(l) : `${u}(找不到端點)`
660
658
  }]], f = new Set((l?.parameters ?? []).map((e) => e.key)), p = l ? c.bindings.filter((e) => !f.has(e.parameter)) : [];
661
- return /* @__PURE__ */ E("div", {
659
+ return /* @__PURE__ */ T("div", {
662
660
  style: en,
663
661
  children: [
664
- /* @__PURE__ */ E("div", {
662
+ /* @__PURE__ */ T("div", {
665
663
  style: tn,
666
- children: [/* @__PURE__ */ E(C, {
664
+ children: [/* @__PURE__ */ T(S, {
667
665
  variant: "label-primary",
668
666
  children: [
669
667
  "第 ",
670
668
  a + 1,
671
669
  " 個 Webhook"
672
670
  ]
673
- }), /* @__PURE__ */ T(_, {
674
- icon: pe,
671
+ }), /* @__PURE__ */ w(v, {
672
+ icon: me,
675
673
  iconType: "leading",
676
674
  onClick: s,
677
675
  variant: "destructive-text-link",
678
676
  children: "移除"
679
677
  })]
680
678
  }),
681
- /* @__PURE__ */ T(n, {
679
+ /* @__PURE__ */ w(n, {
682
680
  label: "端點",
683
681
  name: `webhookEndpoint-${c.id}`,
684
682
  required: !0,
685
- children: /* @__PURE__ */ T(x, {
683
+ children: /* @__PURE__ */ w(b, {
686
684
  clearable: !1,
687
685
  disabled: r !== "ready",
688
686
  onChange: (t) => {
689
- let n = e.find((e) => R(e) === t?.id);
687
+ let n = e.find((e) => B(e) === t?.id);
690
688
  n && o(Zt(c, n, i ?? []));
691
689
  },
692
690
  options: [...d],
@@ -694,40 +692,40 @@ function ln({ activeEndpoints: e, catalog: t, catalogState: r, formFields: i, in
694
692
  value: d.find((e) => e.id === u) ?? null
695
693
  })
696
694
  }),
697
- r === "ready" && !l ? /* @__PURE__ */ T(C, {
695
+ r === "ready" && !l ? /* @__PURE__ */ w(S, {
698
696
  color: "text-warning",
699
697
  variant: "body",
700
698
  children: "找不到這個端點,設定會保留;請改選其他端點或移除,否則無法發布。"
701
699
  }) : null,
702
- l?.disabled ? /* @__PURE__ */ T(C, {
700
+ l?.disabled ? /* @__PURE__ */ w(S, {
703
701
  color: "text-warning",
704
702
  variant: "body",
705
703
  children: "這個端點已被管理者停用,不會再送出;設定會保留,請改選其他端點,否則無法發布。"
706
- }) : l?.deprecated ? /* @__PURE__ */ T(C, {
704
+ }) : l?.deprecated ? /* @__PURE__ */ w(S, {
707
705
  color: "text-warning",
708
706
  variant: "body",
709
707
  children: "這個端點不建議再使用,設定會保留;請改選其他端點,否則無法發布。"
710
708
  }) : null,
711
- l?.description ? /* @__PURE__ */ T(C, {
709
+ l?.description ? /* @__PURE__ */ w(S, {
712
710
  color: "text-neutral",
713
711
  variant: "caption",
714
712
  children: l.description
715
713
  }) : null,
716
- l && !l.parameters.length ? /* @__PURE__ */ T(C, {
714
+ l && !l.parameters.length ? /* @__PURE__ */ w(S, {
717
715
  color: "text-neutral",
718
716
  variant: "caption",
719
717
  children: "這個端點不需要參數。"
720
718
  }) : null,
721
- (l?.parameters ?? []).map((e) => /* @__PURE__ */ T(un, {
719
+ (l?.parameters ?? []).map((e) => /* @__PURE__ */ w(un, {
722
720
  formFields: i,
723
721
  onChange: (t) => o(Xt(c, e.key, t)),
724
722
  parameter: e,
725
723
  source: c.bindings.find((t) => t.parameter === e.key)?.from ?? null,
726
724
  targetId: c.id
727
725
  }, e.key)),
728
- p.map((e) => /* @__PURE__ */ E("div", {
726
+ p.map((e) => /* @__PURE__ */ T("div", {
729
727
  style: tn,
730
- children: [/* @__PURE__ */ E(C, {
728
+ children: [/* @__PURE__ */ T(S, {
731
729
  color: "text-warning",
732
730
  variant: "body",
733
731
  children: [
@@ -735,7 +733,7 @@ function ln({ activeEndpoints: e, catalog: t, catalogState: r, formFields: i, in
735
733
  e.parameter,
736
734
  "」已不在端點定義中。"
737
735
  ]
738
- }), /* @__PURE__ */ T(_, {
736
+ }), /* @__PURE__ */ w(v, {
739
737
  onClick: () => o(Xt(c, e.parameter, null)),
740
738
  variant: "base-text-link",
741
739
  children: "移除設定"
@@ -745,8 +743,8 @@ function ln({ activeEndpoints: e, catalog: t, catalogState: r, formFields: i, in
745
743
  });
746
744
  }
747
745
  function un({ formFields: e, onChange: t, parameter: r, source: i, targetId: a }) {
748
- let o = i?.kind === "FIELD" || Wt(e ?? [], r.type).length > 0, s = [...r.required ? [] : [rn], ...Ut(r.type).filter((e) => e !== "FIELD" || o).map((e) => an[e])], c = Vt[r.type];
749
- return /* @__PURE__ */ T(n, {
746
+ let o = i?.kind === "FIELD" || Wt(e ?? [], r.type).length > 0, s = [...r.required ? [] : [rn], ...Ut(r.type).filter((e) => e !== "FIELD" || o).map((e) => an[e])], c = z[r.type];
747
+ return /* @__PURE__ */ w(n, {
750
748
  hintText: [
751
749
  r.key,
752
750
  c,
@@ -755,18 +753,18 @@ function un({ formFields: e, onChange: t, parameter: r, source: i, targetId: a }
755
753
  label: r.label,
756
754
  name: `webhookBinding-${a}-${r.key}`,
757
755
  required: r.required,
758
- children: /* @__PURE__ */ E("div", {
756
+ children: /* @__PURE__ */ T("div", {
759
757
  style: nn,
760
- children: [/* @__PURE__ */ T(x, {
758
+ children: [/* @__PURE__ */ w(b, {
761
759
  clearable: !1,
762
760
  onChange: (n) => {
763
- let i = pn(n?.id ?? null);
761
+ let i = fn(n?.id ?? null);
764
762
  t(i ? Gt(i, r, e ?? []) : null);
765
763
  },
766
764
  options: [...s],
767
765
  placeholder: "選擇來源",
768
766
  value: i ? an[i.kind] : r.required ? null : rn
769
- }), i ? /* @__PURE__ */ T(dn, {
767
+ }), i ? /* @__PURE__ */ w(dn, {
770
768
  formFields: e,
771
769
  onChange: t,
772
770
  parameter: r,
@@ -777,7 +775,7 @@ function un({ formFields: e, onChange: t, parameter: r, source: i, targetId: a }
777
775
  }
778
776
  function dn({ formFields: e, onChange: t, parameter: n, source: r }) {
779
777
  if (r.kind === "FIELD") {
780
- if (!e) return /* @__PURE__ */ T(C, {
778
+ if (!e) return /* @__PURE__ */ w(S, {
781
779
  color: "text-neutral",
782
780
  variant: "caption",
783
781
  children: "請先綁定表單版本,才能選擇表單欄位。"
@@ -789,7 +787,7 @@ function dn({ formFields: e, onChange: t, parameter: n, source: r }) {
789
787
  id: r.fieldKey,
790
788
  name: `${r.fieldKey}(找不到相容欄位)`
791
789
  }] : i;
792
- return /* @__PURE__ */ T(x, {
790
+ return /* @__PURE__ */ w(b, {
793
791
  clearable: !1,
794
792
  onChange: (e) => t({
795
793
  fieldKey: e?.id ?? "",
@@ -800,17 +798,17 @@ function dn({ formFields: e, onChange: t, parameter: n, source: r }) {
800
798
  value: a.find((e) => e.id === r.fieldKey) ?? null
801
799
  });
802
800
  }
803
- return r.kind === "CONTEXT" ? /* @__PURE__ */ T(x, {
801
+ return r.kind === "CONTEXT" ? /* @__PURE__ */ w(b, {
804
802
  clearable: !1,
805
803
  onChange: (e) => {
806
- N(e?.id) && t({
804
+ at(e?.id) && t({
807
805
  kind: "CONTEXT",
808
806
  path: e.id
809
807
  });
810
808
  },
811
809
  options: [...sn],
812
810
  value: sn.find((e) => e.id === r.path) ?? null
813
- }) : n.type === "boolean" ? /* @__PURE__ */ T(x, {
811
+ }) : n.type === "boolean" ? /* @__PURE__ */ w(b, {
814
812
  clearable: !1,
815
813
  onChange: (e) => t({
816
814
  kind: "CONSTANT",
@@ -818,7 +816,7 @@ function dn({ formFields: e, onChange: t, parameter: n, source: r }) {
818
816
  }),
819
817
  options: [...on],
820
818
  value: typeof r.value == "boolean" ? on.find((e) => e.id === String(r.value)) ?? null : null
821
- }) : /* @__PURE__ */ T(fn, {
819
+ }) : /* @__PURE__ */ w(V, {
822
820
  onChange: (e) => t({
823
821
  kind: "CONSTANT",
824
822
  value: e
@@ -827,11 +825,11 @@ function dn({ formFields: e, onChange: t, parameter: n, source: r }) {
827
825
  value: r.value
828
826
  });
829
827
  }
830
- function fn({ onChange: e, type: t, value: n }) {
831
- let [r, i] = h(n === null ? "" : String(n));
832
- return f(() => {
828
+ function V({ onChange: e, type: t, value: n }) {
829
+ let [r, i] = g(n === null ? "" : String(n));
830
+ return p(() => {
833
831
  i((e) => qt(t, e) === n ? e : n === null ? "" : String(n));
834
- }, [t, n]), /* @__PURE__ */ T(y, {
832
+ }, [t, n]), /* @__PURE__ */ w(te, {
835
833
  inputProps: { inputMode: t === "number" ? "decimal" : void 0 },
836
834
  onChange: (n) => {
837
835
  i(n.target.value), e(qt(t, n.target.value));
@@ -841,7 +839,7 @@ function fn({ onChange: e, type: t, value: n }) {
841
839
  variant: "base"
842
840
  });
843
841
  }
844
- function z(e) {
842
+ function H(e) {
845
843
  let t = [
846
844
  `v${e.version}`,
847
845
  ...e.source === "DATABASE" ? ["後台維護"] : [],
@@ -849,61 +847,61 @@ function z(e) {
849
847
  ];
850
848
  return `${e.label}(${t.join(",")})`;
851
849
  }
852
- function pn(e) {
850
+ function fn(e) {
853
851
  return e === "FIELD" || e === "CONSTANT" || e === "CONTEXT" ? e : null;
854
852
  }
855
853
  //#endregion
856
854
  //#region src/views/templates/designer/dry-run-sample-data.ts
857
- function mn(e) {
855
+ function pn(e) {
858
856
  return (e?.fields ?? []).reduce((e, t) => ({
859
857
  ...e,
860
- [t.fieldKey]: gn(t)
858
+ [t.fieldKey]: hn(t)
861
859
  }), {});
862
860
  }
863
- function hn(e) {
861
+ function mn(e) {
864
862
  return `formMember:${e}`;
865
863
  }
866
- function gn(e) {
864
+ function hn(e) {
867
865
  if (e.type === "number") return 1e3;
868
866
  if (e.type === "boolean") return !0;
869
867
  if (e.type === "member") {
870
- let t = hn(e.fieldKey);
868
+ let t = mn(e.fieldKey);
871
869
  return e.multiple ? [t] : t;
872
870
  }
873
- return Te(e) ? e.type === "checkbox" ? e.options[0] ? [e.options[0].value] : [] : e.options[0]?.value ?? "" : e.type === "date" ? "2026-05-08" : e.type === "datetime" ? "2026-05-08T09:00:00+08:00" : e.placeholder ?? e.label;
871
+ return Ee(e) ? e.type === "checkbox" ? e.options[0] ? [e.options[0].value] : [] : e.options[0]?.value ?? "" : e.type === "date" ? "2026-05-08" : e.type === "datetime" ? "2026-05-08T09:00:00+08:00" : e.placeholder ?? e.label;
874
872
  }
875
873
  //#endregion
876
874
  //#region src/views/templates/designer/dry-run-assignee-label.ts
877
- function _n(e, t) {
875
+ function gn(e, t) {
878
876
  let [n, ...r] = e.split(":"), i = (e) => t.orgUnits.find((t) => t.id === e)?.name ?? e, a = (e) => t.positions.find((t) => t.id === e)?.name ?? e;
879
877
  return n === "position" && r.length === 1 && r[0] ? `職位:${a(r[0])}(送出時依當下人員決定)` : n === "orgUnitMember" && r.length === 1 && r[0] ? `組織任一人:${i(r[0])}` : n === "orgUnitPosition" && r.length === 2 && r[0] && r[1] ? `組織職位:${i(r[0])}/${a(r[1])}` : n === "orgUnitManager" && r.length === 1 && r[0] ? `組織主管:${i(r[0])}` : n === "formMember" && r.length === 1 && r[0] ? `表單欄位「${((e) => t.formFields.find((t) => t.fieldKey === e)?.label || e)(r[0])}」選的人(送出時依填寫內容決定)` : n === "orgManagerChain" && r.length === 1 && r[0] ? `主管鏈:簽到職等 ${r[0]}(送出時依組織決定實際主管)` : t.memberName(e) ?? e;
880
878
  }
881
879
  //#endregion
882
880
  //#region src/views/templates/designer/dynamic-form-resolver-options.ts
883
- var vn = "表單中沒有「人員選擇」欄位,請先到表單設計加入", yn = "原本指定的欄位已不在表單中,或已不是「人員選擇」欄位,請重新選擇。", bn = "此欄位非必填", xn = "此欄位可能被條件隱藏", B = "此欄位為隱藏欄位,申請人無法填寫", Sn = ",空白時此關會找不到人員,發佈時會被拒絕;請在表單設計將它設為必填且不隱藏";
884
- function Cn(e) {
881
+ var _n = "表單中沒有「人員選擇」欄位,請先到表單設計加入", vn = "原本指定的欄位已不在表單中,或已不是「人員選擇」欄位,請重新選擇。", yn = "此欄位非必填", U = "此欄位可能被條件隱藏", bn = "此欄位為隱藏欄位,申請人無法填寫", xn = ",空白時此關會找不到人員,發佈時會被拒絕;請在表單設計將它設為必填且不隱藏";
882
+ function Sn(e) {
885
883
  let t = [
886
- ...e.required ? [] : [bn],
887
- ...e.visibleWhen?.trim() ? [xn] : [],
888
- ...e.hidden ? [B] : []
884
+ ...e.required ? [] : [yn],
885
+ ...e.visibleWhen?.trim() ? [U] : [],
886
+ ...e.hidden ? [bn] : []
889
887
  ];
890
- return t.length > 0 ? `${t.join("、")}${Sn}` : void 0;
888
+ return t.length > 0 ? `${t.join("、")}${xn}` : void 0;
891
889
  }
892
- function wn(e) {
890
+ function Cn(e) {
893
891
  return `${e.required ? "" : "(非必填)"}${e.visibleWhen?.trim() ? "(可能被條件隱藏)" : ""}${e.hidden ? "(隱藏欄位)" : ""}`;
894
892
  }
895
- function Tn(e) {
896
- return (e?.fields ?? []).filter(Ee).map((e) => {
897
- let t = Cn(e);
893
+ function wn(e) {
894
+ return (e?.fields ?? []).filter(De).map((e) => {
895
+ let t = Sn(e);
898
896
  return {
899
897
  id: e.fieldKey,
900
- name: `${e.label} (${e.fieldKey})${wn(e)}`,
898
+ name: `${e.label} (${e.fieldKey})${Cn(e)}`,
901
899
  ...t ? { warning: t } : {}
902
900
  };
903
901
  });
904
902
  }
905
- function En(e, t) {
906
- let n = Tn(e), r = n.find((e) => e.id === t) ?? null;
903
+ function Tn(e, t) {
904
+ let n = wn(e), r = n.find((e) => e.id === t) ?? null;
907
905
  if (r) return {
908
906
  options: n,
909
907
  problem: r.warning ?? null,
@@ -916,46 +914,46 @@ function En(e, t) {
916
914
  };
917
915
  return {
918
916
  options: [...n, e],
919
- problem: yn,
917
+ problem: vn,
920
918
  selected: e
921
919
  };
922
920
  }
923
921
  return {
924
922
  options: n,
925
- problem: n.length === 0 ? vn : null,
923
+ problem: n.length === 0 ? _n : null,
926
924
  selected: null
927
925
  };
928
926
  }
929
- function Dn(e, t) {
927
+ function En(e, t) {
930
928
  if (!t.trim()) return "依表單欄位:未設定";
931
929
  let n = e?.fields.find((e) => e.fieldKey === t);
932
- return n && !Ee(n) ? `依表單欄位:${n.label || t}(非人員選擇欄位)` : `依表單欄位:${n?.label || t}`;
930
+ return n && !De(n) ? `依表單欄位:${n.label || t}(非人員選擇欄位)` : `依表單欄位:${n?.label || t}`;
933
931
  }
934
932
  //#endregion
935
933
  //#region src/views/templates/designer/designer-version-labels.ts
936
- function On(e) {
934
+ function Dn(e) {
937
935
  return `${e.draftVersion === null ? "尚未建立草稿" : `草稿 v${e.draftVersion}`} · ${e.publishedVersion === null ? e.hasPublishedVersion ? "已發布版本" : "尚未發布" : `已發布 v${e.publishedVersion}`}`;
938
936
  }
939
- function kn(e, t) {
937
+ function W(e, t) {
940
938
  return `表單:${e} v${t}`;
941
939
  }
942
940
  //#endregion
943
941
  //#region src/views/templates/designer/TemplateDesignerView.tsx
944
- var An = {
942
+ var On = {
945
943
  display: "grid",
946
944
  gap: 16
947
- }, jn = {
945
+ }, kn = {
948
946
  alignItems: "start",
949
947
  display: "grid",
950
948
  gap: 16,
951
949
  gridTemplateColumns: "minmax(0, 1fr) 420px"
952
- }, Mn = {
950
+ }, An = {
953
951
  border: "1px solid var(--mzn-color-border-neutral)",
954
952
  borderRadius: 6,
955
953
  height: 620,
956
954
  minWidth: 0,
957
955
  overflow: "hidden"
958
- }, Nn = {
956
+ }, jn = {
959
957
  alignItems: "center",
960
958
  boxSizing: "border-box",
961
959
  color: "var(--mzn-color-text-error)",
@@ -965,24 +963,24 @@ var An = {
965
963
  lineHeight: 0,
966
964
  padding: 0,
967
965
  width: 26
968
- }, Pn = {
966
+ }, Mn = {
969
967
  alignItems: "center",
970
968
  display: "flex",
971
969
  height: "100%",
972
970
  justifyContent: "center",
973
971
  width: "100%"
974
- }, Fn = "workflow-designer-side-panel", V = 96, In = `
975
- .${Fn} .mzn-form-field--stretch .mzn-form-field__label-area,
976
- .${Fn} .mzn-form-field--horizontal .mzn-form-field__label-area {
977
- flex: 0 0 ${V}px;
978
- width: ${V}px;
972
+ }, Nn = "workflow-designer-side-panel", Pn = 96, Fn = `
973
+ .${Nn} .mzn-form-field--stretch .mzn-form-field__label-area,
974
+ .${Nn} .mzn-form-field--horizontal .mzn-form-field__label-area {
975
+ flex: 0 0 ${Pn}px;
976
+ width: ${Pn}px;
979
977
  }
980
978
 
981
- .${Fn} .mzn-form-field--stretch .mzn-form-field__data-entry,
982
- .${Fn} .mzn-form-field--horizontal .mzn-form-field__data-entry {
979
+ .${Nn} .mzn-form-field--stretch .mzn-form-field__data-entry,
980
+ .${Nn} .mzn-form-field--horizontal .mzn-form-field__data-entry {
983
981
  min-width: 0;
984
982
  }
985
- `, Ln = "#2563eb", H = "#64748b", Rn = "var(--mzn-color-text-error, #dc2626)", zn = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", Bn = `
983
+ `, G = "#2563eb", In = "#64748b", Ln = "var(--mzn-color-text-error, #dc2626)", Rn = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", zn = `
986
984
  .workflow-selection-delete-control.react-flow__controls-button {
987
985
  align-items: center !important;
988
986
  display: flex !important;
@@ -1007,26 +1005,26 @@ var An = {
1007
1005
 
1008
1006
  .workflow-edge--selected .react-flow__edge-path,
1009
1007
  .react-flow__edge-path.workflow-edge--selected {
1010
- filter: ${zn};
1008
+ filter: ${Rn};
1011
1009
  opacity: 1 !important;
1012
- stroke: ${H} !important;
1010
+ stroke: ${In} !important;
1013
1011
  stroke-opacity: 1 !important;
1014
1012
  stroke-width: 1.5px !important;
1015
1013
  }
1016
1014
 
1017
1015
  .workflow-edge--selected {
1018
- --xy-edge-stroke: ${H};
1019
- --xy-edge-stroke-selected: ${H};
1016
+ --xy-edge-stroke: ${In};
1017
+ --xy-edge-stroke-selected: ${In};
1020
1018
  --xy-edge-stroke-width: 1.5px;
1021
1019
  }
1022
1020
 
1023
- `, Vn = {
1021
+ `, Bn = {
1024
1022
  display: "grid",
1025
1023
  gap: 12
1026
- }, U = {
1024
+ }, K = {
1027
1025
  display: "grid",
1028
1026
  gap: 12
1029
- }, Hn = {
1027
+ }, Vn = {
1030
1028
  border: "1px solid var(--mzn-color-border-neutral)",
1031
1029
  borderRadius: 6,
1032
1030
  display: "grid",
@@ -1034,26 +1032,26 @@ var An = {
1034
1032
  maxHeight: 360,
1035
1033
  overflow: "auto",
1036
1034
  padding: 12
1037
- }, Un = {
1035
+ }, Hn = {
1038
1036
  borderBottom: "1px solid var(--mzn-color-border-neutral)",
1039
1037
  display: "grid",
1040
1038
  gap: 4,
1041
1039
  padding: "0 0 8px"
1042
- }, Wn = {
1040
+ }, Un = {
1043
1041
  display: "flex",
1044
1042
  flexWrap: "wrap",
1045
1043
  gap: 8
1046
- }, Gn = {
1044
+ }, Wn = {
1047
1045
  alignItems: "center",
1048
1046
  display: "flex",
1049
1047
  gap: 8
1050
- }, Kn = {
1048
+ }, Gn = {
1051
1049
  flex: "1 1 auto",
1052
1050
  minWidth: 0
1053
- }, qn = { flex: "0 0 auto" }, Jn = {
1051
+ }, Kn = { flex: "0 0 auto" }, qn = {
1054
1052
  display: "grid",
1055
1053
  gap: 8
1056
- }, Yn = {
1054
+ }, q = {
1057
1055
  alignContent: "center",
1058
1056
  background: "var(--mzn-color-bg-surface)",
1059
1057
  border: "1px solid var(--mzn-color-border-neutral)",
@@ -1068,28 +1066,28 @@ var An = {
1068
1066
  padding: "10px 12px",
1069
1067
  textAlign: "center",
1070
1068
  width: "100%"
1071
- }, Xn = "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)", W = 64, G = 160, Zn = 20, Qn = 64, K = 180, q = {
1072
- ...Yn,
1069
+ }, J = "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)", Y = 64, Jn = 160, Yn = 20, X = 64, Xn = 180, Zn = {
1070
+ ...q,
1073
1071
  display: "grid",
1074
1072
  gap: 8,
1075
1073
  padding: "10px 12px"
1076
- }, $n = {
1077
- ...q,
1074
+ }, Qn = {
1075
+ ...Zn,
1078
1076
  background: "#eff6ff",
1079
1077
  border: "1px solid #2563eb"
1080
- }, er = {
1081
- ...q,
1078
+ }, $n = {
1079
+ ...Zn,
1082
1080
  background: "#f0fdfa",
1083
1081
  border: "1px solid #0f766e"
1084
- }, tr = {
1085
- ...Yn,
1082
+ }, er = {
1083
+ ...q,
1086
1084
  background: "#ffffff"
1087
- }, J = {
1088
- ...Yn,
1085
+ }, tr = {
1086
+ ...q,
1089
1087
  background: "#ecfdf3",
1090
1088
  border: "1px solid #2f855a"
1091
1089
  }, nr = {
1092
- ...Yn,
1090
+ ...q,
1093
1091
  background: "#fff4ed",
1094
1092
  border: "1px solid #c2410c"
1095
1093
  }, rr = {
@@ -1108,15 +1106,15 @@ var An = {
1108
1106
  startEvent: "開始",
1109
1107
  userTask: "簽核"
1110
1108
  }, cr = [{
1111
- icon: me,
1109
+ icon: he,
1112
1110
  label: "簽核節點",
1113
1111
  type: "userTask"
1114
1112
  }, {
1115
- icon: ue,
1113
+ icon: de,
1116
1114
  label: "知會節點",
1117
1115
  type: "serviceTask"
1118
1116
  }], lr = [{
1119
- icon: le,
1117
+ icon: ue,
1120
1118
  label: "條件分流",
1121
1119
  type: "exclusiveGateway"
1122
1120
  }], ur = [{
@@ -1191,7 +1189,7 @@ var An = {
1191
1189
  }, {
1192
1190
  id: "PERCENTAGE",
1193
1191
  name: "百分比"
1194
- }], Y = [
1192
+ }], hr = [
1195
1193
  {
1196
1194
  id: "1",
1197
1195
  name: "直屬主管",
@@ -1207,13 +1205,23 @@ var An = {
1207
1205
  name: "第三層主管",
1208
1206
  value: 3
1209
1207
  }
1210
- ], hr = [{
1211
- id: "NONE",
1212
- name: "停止流程並提示"
1213
- }, {
1214
- id: "DIRECT",
1215
- name: "固定改派"
1216
- }], gr = [
1208
+ ], gr = [
1209
+ {
1210
+ id: "NONE",
1211
+ name: "停止流程並提示"
1212
+ },
1213
+ {
1214
+ id: "DIRECT",
1215
+ name: "固定改派"
1216
+ },
1217
+ {
1218
+ id: "POSITION",
1219
+ name: "指定職位"
1220
+ }
1221
+ ], _r = {
1222
+ id: "UNSUPPORTED",
1223
+ name: "不支援的備援設定"
1224
+ }, vr = [
1217
1225
  {
1218
1226
  id: "INITIATOR_MANAGER",
1219
1227
  name: "改由申請人的直屬主管簽核"
@@ -1226,7 +1234,7 @@ var An = {
1226
1234
  id: "FAIL",
1227
1235
  name: "停止流程並提示"
1228
1236
  }
1229
- ], _r = { whenEmpty: "INITIATOR_MANAGER" }, vr = [
1237
+ ], yr = { whenEmpty: "INITIATOR_MANAGER" }, br = [
1230
1238
  {
1231
1239
  id: "EQUALS",
1232
1240
  name: "等於"
@@ -1259,14 +1267,14 @@ var An = {
1259
1267
  id: "IS_EMPTY",
1260
1268
  name: "未填寫"
1261
1269
  }
1262
- ], yr = [
1270
+ ], xr = [
1263
1271
  "EQUALS",
1264
1272
  "GREATER_THAN",
1265
1273
  "GREATER_THAN_OR_EQUALS",
1266
1274
  "LESS_THAN",
1267
1275
  "LESS_THAN_OR_EQUALS",
1268
1276
  "NOT_EQUALS"
1269
- ], br = [
1277
+ ], Sr = [
1270
1278
  {
1271
1279
  id: "NONE",
1272
1280
  name: "未設定"
@@ -1283,341 +1291,340 @@ var An = {
1283
1291
  id: "ORG_UNIT_POSITION",
1284
1292
  name: "指定組織職位"
1285
1293
  }
1286
- ], xr = {
1294
+ ], Cr = {
1287
1295
  id: "CUSTOM",
1288
1296
  name: "既有自訂規則"
1289
- }, Sr = "member-001", Cr = {
1297
+ }, wr = "member-001", Tr = {
1290
1298
  display: "flex",
1291
1299
  flexDirection: "column",
1292
1300
  height: "100%"
1293
- }, wr = {
1301
+ }, Er = {
1294
1302
  flex: 1,
1295
1303
  minHeight: 0,
1296
1304
  overflowY: "auto"
1297
- }, Tr = {
1305
+ }, Dr = {
1298
1306
  borderTop: "1px solid var(--mzn-color-border-neutral)",
1299
1307
  display: "flex",
1300
1308
  gap: 8,
1301
1309
  paddingTop: 12
1302
- }, Er = {
1310
+ }, Or = {
1303
1311
  fields: [],
1304
1312
  schemaVersion: 1
1305
- }, Dr = {
1313
+ }, kr = {
1306
1314
  layout: [],
1307
1315
  schemaVersion: 1
1308
- }, Or = {
1309
- endEvent: X,
1310
- exclusiveGateway: X,
1311
- parallelGateway: X,
1312
- serviceTask: X,
1313
- startEvent: X,
1314
- userTask: X
1316
+ }, Ar = {
1317
+ endEvent: Pr,
1318
+ exclusiveGateway: Pr,
1319
+ parallelGateway: Pr,
1320
+ serviceTask: Pr,
1321
+ startEvent: Pr,
1322
+ userTask: Pr
1315
1323
  };
1316
- function kr(e, t) {
1324
+ function jr(e, t) {
1317
1325
  return typeof e == "function" ? e(t) : e;
1318
1326
  }
1319
- function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride: u, initialInitiatorPolicyCel: se, initialWorkflowDefinition: le, onInitiatorPolicyChange: ue, onWorkflowChange: de, showAiAssistant: me = !1, showDryRun: he = !0, templateId: ge }) {
1320
- let _e = e(), ve = t(), [D, ye] = h(null), [be, xe] = h(null), [Se, we] = h(""), [Te, Ee] = h(null), [Me, Pe] = h(null), O = m(null), [Le, Re] = h(void 0), Ye = m([]), Xe = m([]), k = yt({
1321
- directory: p(() => ({
1322
- listOrgUnits: async () => Ye.current.map((e) => ({
1327
+ function Mr({ aiAssistantAvailable: r = !0, embedded: i = !1, formSchemaOverride: o, initialInitiatorPolicyCel: d, initialWorkflowDefinition: ce, onInitiatorPolicyChange: ue, onWorkflowChange: de, showAiAssistant: fe = !1, showDryRun: he = !0, templateId: ge }) {
1328
+ let _e = e(), ve = t(), [D, ye] = g(null), [be, xe] = g(null), [Se, Ce] = g(""), [Te, Ee] = g(null), [De, O] = g(null), Pe = h(null), [k, Le] = g(void 0), Re = h([]), Ye = h([]), A = bt({
1329
+ directory: m(() => ({
1330
+ listOrgUnits: async () => Re.current.map((e) => ({
1323
1331
  id: e.id,
1324
1332
  name: e.name
1325
1333
  })),
1326
- listPositions: async () => Xe.current.map((e) => ({
1334
+ listPositions: async () => Ye.current.map((e) => ({
1327
1335
  id: e.id,
1328
1336
  name: e.name
1329
1337
  })),
1330
- searchMembers: async (e) => Li(await Ke(e)).map((e) => ({
1338
+ searchMembers: async (e) => Vi(await Ke(e)).map((e) => ({
1331
1339
  email: e.email,
1332
1340
  id: e.memberId,
1333
1341
  name: e.name
1334
1342
  }))
1335
1343
  }), []),
1336
1344
  initialState: {
1337
- definition: a && le != null ? Vr(le) : Kr(),
1345
+ definition: i && ce != null ? Wr(ce) : Yr(),
1338
1346
  editingEdgeId: null,
1339
1347
  formDefinitionVersionId: null,
1340
1348
  formSchema: null,
1341
- initiatorPolicyCel: a && se !== void 0 ? se : null,
1349
+ initiatorPolicyCel: i && d !== void 0 ? d : null,
1342
1350
  selectedEdgeIds: [],
1343
- selectedNodeId: a && le != null ? le.nodes[0]?.id ?? "start" : "start"
1351
+ selectedNodeId: i && ce != null ? ce.nodes[0]?.id ?? "start" : "start"
1344
1352
  },
1345
- layout: Jr,
1353
+ layout: Zr,
1346
1354
  onLayout: (e) => {
1347
- let t = sa(e, O.current);
1348
- t && Re(t);
1355
+ let t = da(e, Pe.current);
1356
+ t && Le(t);
1349
1357
  }
1350
- }), A = k.state.definition, j = k.state.formDefinitionVersionId, M = k.state.initiatorPolicyCel, it = k.state.selectedNodeId, N = k.state.selectedEdgeIds, ot = k.state.editingEdgeId, st = (e) => k.replaceState((t) => ({
1358
+ }), j = A.state.definition, M = A.state.formDefinitionVersionId, N = A.state.initiatorPolicyCel, nt = A.state.selectedNodeId, P = A.state.selectedEdgeIds, at = A.state.editingEdgeId, st = (e) => A.replaceState((t) => ({
1351
1359
  ...t,
1352
- definition: kr(e, t.definition)
1353
- })), lt = (e) => k.replaceState((t) => ({
1360
+ definition: jr(e, t.definition)
1361
+ })), ct = (e) => A.replaceState((t) => ({
1354
1362
  ...t,
1355
- formDefinitionVersionId: kr(e, t.formDefinitionVersionId)
1356
- })), ut = (e) => k.replaceState((t) => ({
1363
+ formDefinitionVersionId: jr(e, t.formDefinitionVersionId)
1364
+ })), ut = (e) => A.replaceState((t) => ({
1357
1365
  ...t,
1358
- initiatorPolicyCel: kr(e, t.initiatorPolicyCel)
1359
- })), dt = (e) => k.replaceState((t) => ({
1366
+ initiatorPolicyCel: jr(e, t.initiatorPolicyCel)
1367
+ })), dt = (e) => A.replaceState((t) => ({
1360
1368
  ...t,
1361
- selectedNodeId: kr(e, t.selectedNodeId)
1362
- })), ft = (e) => k.replaceState((t) => ({
1369
+ selectedNodeId: jr(e, t.selectedNodeId)
1370
+ })), ft = (e) => A.replaceState((t) => ({
1363
1371
  ...t,
1364
- selectedEdgeIds: kr(e, t.selectedEdgeIds)
1365
- })), pt = (e) => k.replaceState((t) => ({
1372
+ selectedEdgeIds: jr(e, t.selectedEdgeIds)
1373
+ })), pt = (e) => A.replaceState((t) => ({
1366
1374
  ...t,
1367
- editingEdgeId: kr(e, t.editingEdgeId)
1368
- })), [bt, P] = h(null), [xt, F] = h(null);
1369
- f(() => {
1370
- F(null);
1371
- }, [it]);
1372
- let [St, Ct] = h(!0), [wt, Tt] = h(!1), [Et, Dt] = h(!1), [Ot, kt] = h([]), At = p(() => JSON.stringify({
1373
- formDefinitionVersionId: j,
1374
- initiatorPolicyCel: M,
1375
- workflowDefinition: A
1375
+ editingEdgeId: jr(e, t.editingEdgeId)
1376
+ })), [mt, F] = g(null), [xt, I] = g(null);
1377
+ p(() => {
1378
+ I(null);
1379
+ }, [nt]);
1380
+ let [St, Ct] = g(!0), [wt, Tt] = g(!1), [Et, Dt] = g(!1), [Ot, kt] = g([]), At = m(() => JSON.stringify({
1381
+ formDefinitionVersionId: M,
1382
+ initiatorPolicyCel: N,
1383
+ workflowDefinition: j
1376
1384
  }), [
1377
- j,
1378
1385
  M,
1379
- A
1380
- ]), jt = !!Se && At !== Se, [Mt, Nt] = h(!1), [I, Pt] = h([]), [Ft, It] = h([]), Rt = m(0), Bt = m(/* @__PURE__ */ new Set()), [L, Vt] = h([]), [R, Ht] = h([]), [Ut, Wt] = h([]);
1381
- Ye.current = L, Xe.current = R;
1382
- let [Gt, Kt] = h(!1), [qt, Yt] = h(!1), [Xt, Zt] = h("{}"), [$t, en] = h(null), [tn, nn] = h(null), [rn, an] = h([]), [on, sn] = h("loading"), [ln, un] = h(!1), [dn, fn] = h(!1), [z, pn] = h(null), [hn, gn] = h(!1), [vn, yn] = h(!1), bn = jt || hn ? "保存並發布" : be ? "發布草稿" : "已發布";
1383
- f(() => {
1384
- a ? $n() : er();
1385
- }, [a, ge]), f(() => {
1386
+ N,
1387
+ j
1388
+ ]), jt = !!Se && At !== Se, [Mt, Nt] = g(!1), [L, Pt] = g([]), [Ft, It] = g([]), Lt = h(0), zt = h(/* @__PURE__ */ new Set()), [R, Vt] = g([]), [z, B] = g([]), [Ht, Ut] = g([]);
1389
+ Re.current = R, Ye.current = z;
1390
+ let [Wt, Gt] = g(!1), [Kt, qt] = g(!1), [Yt, Xt] = g("{}"), [Zt, $t] = g(null), [en, tn] = g(null), [nn, rn] = g([]), [an, on] = g("loading"), [sn, ln] = g(!1), [un, dn] = g(!1), [V, H] = g(null), [fn, mn] = g(!1), [hn, _n] = g(!1), vn = jt || fn ? "保存並發布" : be ? "發布草稿" : "已發布";
1391
+ p(() => {
1392
+ i ? Zn() : Qn();
1393
+ }, [i, ge]), p(() => {
1386
1394
  function e(e) {
1387
1395
  jt && (e.preventDefault(), e.returnValue = "");
1388
1396
  }
1389
1397
  return window.addEventListener("beforeunload", e), () => {
1390
1398
  window.removeEventListener("beforeunload", e);
1391
1399
  };
1392
- }, [jt]), f(() => {
1393
- nr(A);
1394
- }, [A, I]), f(() => {
1395
- st((e) => Vr(e));
1396
- }, [A.edges, A.nodes]);
1397
- function xn() {
1400
+ }, [jt]), p(() => {
1401
+ tr(j);
1402
+ }, [j, L]), p(() => {
1403
+ st((e) => Wr(e));
1404
+ }, [j.edges, j.nodes]);
1405
+ function yn() {
1398
1406
  (!jt || window.confirm("目前有尚未儲存的流程草稿,確定要離開嗎?")) && _e.push(ve.templates());
1399
1407
  }
1400
- let B = p(() => A.nodes.find((e) => e.id === it) ?? null, [it, A.nodes]), Sn = B ? Ei(B) : !1, Cn = N.length > 0 || Sn, wn = d(() => {
1401
- k.getState().selectedEdgeIds.forEach((e) => k.dispatch({
1408
+ let U = m(() => j.nodes.find((e) => e.id === nt) ?? null, [nt, j.nodes]), bn = U ? Ai(U) : !1, xn = P.length > 0 || bn, Sn = f(() => {
1409
+ A.getState().selectedEdgeIds.forEach((e) => A.dispatch({
1402
1410
  edgeId: e,
1403
1411
  type: "deleteEdge"
1404
- })), B && Ei(B) && k.dispatch({
1405
- nodeId: B.id,
1412
+ })), U && Ai(U) && A.dispatch({
1413
+ nodeId: U.id,
1406
1414
  type: "deleteNode"
1407
1415
  });
1408
- }, [k, B]);
1409
- f(() => {
1410
- if (!Cn) return;
1416
+ }, [A, U]);
1417
+ p(() => {
1418
+ if (!xn) return;
1411
1419
  function e(e) {
1412
- (e.key === "Delete" || e.key === "Backspace") && (Ai(e.target) || (e.preventDefault(), wn()));
1420
+ (e.key === "Delete" || e.key === "Backspace") && (Pi(e.target) || (e.preventDefault(), Sn()));
1413
1421
  }
1414
1422
  return window.addEventListener("keydown", e), () => {
1415
1423
  window.removeEventListener("keydown", e);
1416
1424
  };
1417
- }, [Cn, wn]);
1418
- let Tn = p(() => A.edges.find((e) => e.id === ot) ?? null, [ot, A.edges]), Dn = p(() => N.length === 1 ? A.edges.find((e) => e.id === N[0]) ?? null : null, [N, A.edges]), kn = p(() => N.map((e) => A.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [N, A.edges]), V = p(() => Me ?? vi(M, Te), [
1419
- M,
1420
- Me,
1421
- Te
1422
- ]), Ln = p(() => A.edges.map((e) => Br(e, A.nodes, N.includes(e.id))), [
1425
+ }, [xn, Sn]);
1426
+ let Cn = m(() => j.edges.find((e) => e.id === at) ?? null, [at, j.edges]), wn = m(() => P.length === 1 ? j.edges.find((e) => e.id === P[0]) ?? null : null, [P, j.edges]), En = m(() => P.map((e) => j.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [P, j.edges]), W = m(() => De ?? Si(N, Te), [
1423
1427
  N,
1424
- A.edges,
1425
- A.nodes
1426
- ]), H = p(() => $(Ot, j) ?? $(ji(D?.formVersions ?? []), j), [
1427
- j,
1428
+ De,
1429
+ Te
1430
+ ]), Pn = m(() => j.edges.map((e) => Hr(e, j.nodes, P.includes(e.id))), [
1431
+ P,
1432
+ j.edges,
1433
+ j.nodes
1434
+ ]), G = m(() => $(Ot, M) ?? $(Fi(D?.formVersions ?? []), M), [
1435
+ M,
1428
1436
  Ot,
1429
1437
  D?.formVersions
1430
- ]), zn = p(() => Ii(Ot, H), [Ot, H]), Yn = H?.schema ?? null, Xn = a ? u ?? null : Yn;
1431
- f(() => {
1432
- k.getState().formSchema !== Xn && k.replaceState((e) => ({
1438
+ ]), In = m(() => Bi(Ot, G), [Ot, G]), Rn = G?.schema ?? null, q = i ? o ?? null : Rn;
1439
+ p(() => {
1440
+ A.getState().formSchema !== q && A.replaceState((e) => ({
1433
1441
  ...e,
1434
- formSchema: Xn
1442
+ formSchema: q
1435
1443
  }));
1436
- }, [k, Xn]);
1437
- let W = p(() => ca(A), [A]);
1438
- f(() => {
1444
+ }, [A, q]);
1445
+ let J = m(() => fa(j), [j]);
1446
+ p(() => {
1439
1447
  let e = !0;
1440
1448
  return He({ includeDeprecated: !0 }).then((t) => {
1441
- e && (an(t), sn("ready"));
1449
+ e && (rn(t), on("ready"));
1442
1450
  }).catch(() => {
1443
- e && sn("unavailable");
1451
+ e && on("unavailable");
1444
1452
  }), () => {
1445
1453
  e = !1;
1446
1454
  };
1447
1455
  }, []);
1448
- let G = hn && z ? z.schema : Xn, Zn = p(() => on === "ready" ? Qt({
1449
- definition: A,
1450
- endpoints: rn,
1451
- formFields: G?.fields ?? []
1456
+ let Y = fn && V ? V.schema : q, Jn = m(() => an === "ready" ? Qt({
1457
+ definition: j,
1458
+ endpoints: nn,
1459
+ formFields: Y?.fields ?? []
1452
1460
  })[0] ?? null : null, [
1453
- rn,
1454
- on,
1455
- G,
1456
- A
1457
- ]), Qn = p(() => A.nodes.map((e) => Ir(e, I, L, R, e.id === it, V, G)), [
1458
- V,
1459
- I,
1461
+ nn,
1462
+ an,
1463
+ Y,
1464
+ j
1465
+ ]), Yn = m(() => j.nodes.map((e) => zr(e, L, R, z, e.id === nt, W, Y)), [
1466
+ W,
1460
1467
  L,
1461
1468
  R,
1462
- it,
1463
- G,
1464
- A.nodes
1465
- ]), K = p(() => nt(A), [A]), q = p(() => yi(V), [V]);
1466
- f(() => {
1467
- a && de?.(A);
1468
- }, [a, A]), f(() => {
1469
- a && ue?.(M);
1470
- }, [a, M]);
1471
- async function $n() {
1472
- Ct(!0), P(null);
1469
+ z,
1470
+ nt,
1471
+ Y,
1472
+ j.nodes
1473
+ ]), X = m(() => rt(j), [j]), Xn = m(() => Ci(W), [W]);
1474
+ p(() => {
1475
+ i && de?.(j);
1476
+ }, [i, j]), p(() => {
1477
+ i && ue?.(N);
1478
+ }, [i, N]);
1479
+ async function Zn() {
1480
+ Ct(!0), F(null);
1473
1481
  try {
1474
- let e = await De();
1475
- Vt(e.orgUnits), Ht(e.positions), Wt(e.memberships);
1482
+ let e = await Oe();
1483
+ Vt(e.orgUnits), B(e.positions), Ut(e.memberships);
1476
1484
  } catch (e) {
1477
- P(ba(e));
1485
+ F(wa(e));
1478
1486
  } finally {
1479
1487
  Ct(!1);
1480
1488
  }
1481
1489
  }
1482
- async function er() {
1483
- Ct(!0), P(null), F(null);
1490
+ async function Qn() {
1491
+ Ct(!0), F(null), I(null);
1484
1492
  try {
1485
- let [e, t] = await Promise.all([We(ge), De()]), n = e.versions.find((e) => e.status === "DRAFT") ?? null, r = n ?? e.versions[0] ?? null;
1486
- ye(e), xe(n), Vt(t.orgUnits), Ht(t.positions), Wt(t.memberships), kt(ji(e.formVersions));
1487
- let i = Vr(r?.workflowDefinition ?? Kr()), a = r?.formDefinitionVersionId ?? e.formVersions[0]?.id ?? null, o = r?.initiatorPolicyCel ?? null;
1488
- st(i), lt(a), ut(o), we(JSON.stringify({
1493
+ let [e, t] = await Promise.all([We(ge), Oe()]), n = e.versions.find((e) => e.status === "DRAFT") ?? null, r = n ?? e.versions[0] ?? null;
1494
+ ye(e), xe(n), Vt(t.orgUnits), B(t.positions), Ut(t.memberships), kt(Fi(e.formVersions));
1495
+ let i = Wr(r?.workflowDefinition ?? Yr()), a = r?.formDefinitionVersionId ?? e.formVersions[0]?.id ?? null, o = r?.initiatorPolicyCel ?? null;
1496
+ st(i), ct(a), ut(o), Ce(JSON.stringify({
1489
1497
  formDefinitionVersionId: a,
1490
1498
  initiatorPolicyCel: o,
1491
1499
  workflowDefinition: i
1492
- })), Ee(r && !e.template.currentVersionId && !r.initiatorPolicyCel && qr(r.workflowDefinition) ? "NONE" : null), Pe(null), dt(r?.workflowDefinition.nodes[0]?.id ?? "start"), ft([]), pt(null), pn(null), gn(!1);
1500
+ })), Ee(r && !e.template.currentVersionId && !r.initiatorPolicyCel && Xr(r.workflowDefinition) ? "NONE" : null), O(null), dt(r?.workflowDefinition.nodes[0]?.id ?? "start"), ft([]), pt(null), H(null), mn(!1);
1493
1501
  } catch (e) {
1494
- P(ba(e));
1502
+ F(wa(e));
1495
1503
  } finally {
1496
1504
  Ct(!1);
1497
1505
  }
1498
1506
  }
1499
- async function tr(e) {
1500
- Dt(!0), P(null);
1507
+ async function $n(e) {
1508
+ Dt(!0), F(null);
1501
1509
  try {
1502
1510
  let t = await qe(e);
1503
- kt(Ii(ji(t), H));
1511
+ kt(Bi(Fi(t), G));
1504
1512
  } catch (e) {
1505
- P(ba(e));
1513
+ F(wa(e));
1506
1514
  } finally {
1507
1515
  Dt(!1);
1508
1516
  }
1509
1517
  }
1510
- async function J(e) {
1511
- Nt(!0), P(null);
1512
- let t = ++Rt.current;
1518
+ async function er(e) {
1519
+ Nt(!0), F(null);
1520
+ let t = ++Lt.current;
1513
1521
  try {
1514
- let n = Li(await Ke(e));
1515
- Pt((e) => Zi(e, n)), t === Rt.current && It(n);
1522
+ let n = Vi(await Ke(e));
1523
+ Pt((e) => ta(e, n)), t === Lt.current && It(n);
1516
1524
  } catch (e) {
1517
- t === Rt.current && P(ba(e));
1525
+ t === Lt.current && F(wa(e));
1518
1526
  } finally {
1519
- t === Rt.current && Nt(!1);
1527
+ t === Lt.current && Nt(!1);
1520
1528
  }
1521
1529
  }
1522
- async function nr(e) {
1523
- let t = $i(e), n = s(t.filter((e) => !I.some((t) => t.memberId === e && !t.unresolved)), Bt.current);
1530
+ async function tr(e) {
1531
+ let t = ra(e), n = c(t.filter((e) => !L.some((t) => t.memberId === e && !t.unresolved)), zt.current);
1524
1532
  if (n.length === 0) return;
1525
- let { profiles: r, skippedIds: i } = await c(n, Ge), a = new Set(r.map((e) => e.memberId)), o = n.filter((e) => !a.has(e) && !i.includes(e));
1526
- o.forEach((e) => Bt.current.add(e)), Pt((e) => Zi(e, [...Li(r), ...[...o, ...i].map(Ri)]));
1533
+ let { profiles: r, skippedIds: i } = await l(n, Ge), a = new Set(r.map((e) => e.memberId)), o = n.filter((e) => !a.has(e) && !i.includes(e));
1534
+ o.forEach((e) => zt.current.add(e)), Pt((e) => ta(e, [...Vi(r), ...[...o, ...i].map(Hi)]));
1527
1535
  }
1528
- async function rr(e) {
1529
- Tt(!0), P(null);
1536
+ async function nr(e) {
1537
+ Tt(!0), F(null);
1530
1538
  try {
1531
- let t = ca(A), n = yi(V), r = e ? Zn : null;
1539
+ let t = fa(j), n = Ci(W), r = e ? Jn : null;
1532
1540
  if (t || n || r) {
1533
1541
  let e = t ?? n ?? r ?? "流程設定未完成";
1534
- throw P(e), Error(e);
1542
+ throw F(e), Error(e);
1535
1543
  }
1536
- if (hn && z !== null) await ze({
1544
+ if (fn && V !== null) await ze({
1537
1545
  category: D?.template.category ?? null,
1538
1546
  categoryId: D?.template.categoryId ?? null,
1539
- formDefinitionId: H?.formDefinitionId ?? null,
1547
+ formDefinitionId: G?.formDefinitionId ?? null,
1540
1548
  formDescription: null,
1541
- formName: H?.formName ?? D?.template.name ?? "表單",
1542
- initiatorPolicyCel: M,
1549
+ formName: G?.formName ?? D?.template.name ?? "表單",
1550
+ initiatorPolicyCel: N,
1543
1551
  notificationConfig: null,
1544
1552
  publish: e,
1545
- schema: z.schema,
1553
+ schema: V.schema,
1546
1554
  slaDefaults: null,
1547
1555
  templateDescription: null,
1548
1556
  templateId: ge ?? null,
1549
1557
  templateName: D?.template.name ?? "模板",
1550
- uiSchema: z.uiSchema,
1551
- workflowDefinition: A
1552
- }), gn(!1), pn(null), await er();
1558
+ uiSchema: V.uiSchema,
1559
+ workflowDefinition: j
1560
+ }), mn(!1), H(null), await Qn();
1553
1561
  else {
1554
1562
  let t = be ?? await Ve(ge), n = await Je({
1555
- formDefinitionVersionId: j,
1556
- initiatorPolicyCel: M,
1563
+ formDefinitionVersionId: M,
1564
+ initiatorPolicyCel: N,
1557
1565
  versionId: t.id,
1558
- workflowDefinition: A
1566
+ workflowDefinition: j
1559
1567
  });
1560
- xe(n), e && await Ue(n.id), await er();
1568
+ xe(n), e && await Ue(n.id), await Qn();
1561
1569
  }
1562
1570
  } catch (e) {
1563
- throw P(ba(e)), e;
1571
+ throw F(wa(e)), e;
1564
1572
  } finally {
1565
1573
  Tt(!1);
1566
1574
  }
1567
1575
  }
1576
+ async function rr() {
1577
+ await nr(!1);
1578
+ }
1568
1579
  async function ir() {
1569
- await rr(!1);
1580
+ await nr(!0);
1570
1581
  }
1571
- async function ar() {
1572
- await rr(!0);
1582
+ function ar() {
1583
+ Xt(JSON.stringify(pn(Y), null, 2)), $t(null), tn(null), Gt(!0);
1573
1584
  }
1574
1585
  function or() {
1575
- Zt(JSON.stringify(mn(G), null, 2)), en(null), nn(null), Kt(!0);
1586
+ Kt || Gt(!1);
1576
1587
  }
1577
- function vr() {
1578
- qt || Kt(!1);
1579
- }
1580
- async function yr() {
1581
- Yt(!0), nn(null), en(null);
1588
+ async function br() {
1589
+ qt(!0), tn(null), $t(null);
1582
1590
  try {
1583
- let e = Mi(Xt), t = await Be({
1591
+ let e = Ii(Yt), t = await Be({
1584
1592
  formData: e,
1585
- initiatorMemberId: Sr,
1586
- initiatorMetadataSnapshot: Wi(Sr, Ut),
1587
- workflowDefinition: A
1593
+ initiatorMemberId: wr,
1594
+ initiatorMetadataSnapshot: Ji(wr, Ht),
1595
+ workflowDefinition: j
1588
1596
  });
1589
- en(t);
1597
+ $t(t);
1590
1598
  } catch (e) {
1591
- nn(ba(e));
1599
+ tn(wa(e));
1592
1600
  } finally {
1593
- Yt(!1);
1601
+ qt(!1);
1594
1602
  }
1595
1603
  }
1596
- async function Ar() {
1597
- if (fn(!0), z !== null) return;
1598
- let e = H?.formDefinitionId ?? null;
1599
- if (!e) {
1600
- pn({
1601
- schema: Er,
1602
- uiSchema: Dr
1603
- });
1604
- return;
1605
- }
1606
- yn(!0);
1607
- try {
1608
- let t = await Ce(e), n = t.versions.find((e) => e.status === "DRAFT") ?? t.versions.find((e) => e.id === t.definition.currentVersionId) ?? t.versions[0] ?? null;
1609
- pn({
1610
- schema: n?.schema ?? Er,
1611
- uiSchema: n?.uiSchema ?? Dr
1612
- });
1613
- } catch (e) {
1614
- P(ba(e));
1615
- } finally {
1616
- yn(!1);
1604
+ async function xr() {
1605
+ if (dn(!0), V !== null) return;
1606
+ let e = G?.formDefinitionId ?? null;
1607
+ if (!e) H({
1608
+ schema: Or,
1609
+ uiSchema: kr
1610
+ });
1611
+ else {
1612
+ _n(!0);
1613
+ try {
1614
+ let t = await we(e), n = t.versions.find((e) => e.status === "DRAFT") ?? t.versions.find((e) => e.id === t.definition.currentVersionId) ?? t.versions[0] ?? null;
1615
+ H({
1616
+ schema: n?.schema ?? Or,
1617
+ uiSchema: n?.uiSchema ?? kr
1618
+ });
1619
+ } catch (e) {
1620
+ F(wa(e));
1621
+ } finally {
1622
+ _n(!1);
1623
+ }
1617
1624
  }
1618
1625
  }
1619
- function X(e) {
1620
- let t = Ie(e, Qn);
1626
+ function Mr(e) {
1627
+ let t = Ie(e, Yn);
1621
1628
  st((e) => ({
1622
1629
  ...e,
1623
1630
  nodes: e.nodes.map((e) => {
@@ -1629,127 +1636,123 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
1629
1636
  })
1630
1637
  }));
1631
1638
  }
1632
- function Mr(e) {
1633
- wi(e, A.nodes) && e.source && e.target && k.dispatch({
1639
+ function Pr(e) {
1640
+ Oi(e, j.nodes) && e.source && e.target && A.dispatch({
1634
1641
  source: e.source,
1635
1642
  target: e.target,
1636
1643
  type: "connectEdge"
1637
1644
  });
1638
1645
  }
1639
- function Nr(e, t) {
1640
- e.stopPropagation(), ft((n) => e.shiftKey || e.metaKey || e.ctrlKey ? Ti(n, t.id) : [t.id]), dt(null);
1646
+ function Fr(e, t) {
1647
+ e.stopPropagation(), ft((n) => e.shiftKey || e.metaKey || e.ctrlKey ? ki(n, t.id) : [t.id]), dt(null);
1641
1648
  }
1642
- function Pr() {
1649
+ function Ir() {
1643
1650
  pt(null);
1644
1651
  }
1645
- function Fr(e) {
1646
- k.dispatch({
1652
+ function Lr(e) {
1653
+ A.dispatch({
1647
1654
  nodeType: e,
1648
1655
  type: "addNode"
1649
1656
  });
1650
1657
  }
1651
- function Lr(e) {
1652
- B && k.dispatch({
1658
+ function Rr(e) {
1659
+ U && A.dispatch({
1653
1660
  label: e,
1654
- nodeId: B.id,
1661
+ nodeId: U.id,
1655
1662
  type: "renameNode"
1656
1663
  });
1657
1664
  }
1658
1665
  function Z(e) {
1659
- if (!B || B.type !== "userTask") return;
1660
- let t = B.id, n = B.data.decisionPolicy;
1661
- if (k.dispatch({
1666
+ if (!U || U.type !== "userTask") return;
1667
+ let t = U.id, n = U.data.decisionPolicy;
1668
+ A.dispatch({
1662
1669
  approverResolver: e,
1663
1670
  nodeId: t,
1664
1671
  type: "setUserTaskApprover"
1665
- }), F(null), at(e, n)) {
1666
- F({
1667
- message: "主管鏈會依序加入多位主管,簽核方式已改為「依序簽核」。",
1668
- nodeId: t,
1669
- policyType: "SEQUENTIAL"
1670
- });
1671
- return;
1672
- }
1673
- rt(n, e) && F({
1674
- message: `簽核者已變更為 ${ct(e)} 位,不足原本設定的 ${n?.type === "QUORUM" ? n.threshold : 0} 位門檻,簽核政策已重設為單人簽核,請重新設定。`,
1672
+ }), I(null), ot(e, n) ? I({
1673
+ message: "主管鏈會依序加入多位主管,簽核方式已改為「依序簽核」。",
1674
+ nodeId: t,
1675
+ policyType: "SEQUENTIAL"
1676
+ }) : it(n, e) && I({
1677
+ message: `簽核者已變更為 ${lt(e)} 位,不足原本設定的 ${n?.type === "QUORUM" ? n.threshold : 0} 位門檻,簽核政策已重設為單人簽核,請重新設定。`,
1675
1678
  nodeId: t,
1676
1679
  policyType: "SINGLE"
1677
1680
  });
1678
1681
  }
1679
- function Rr(e) {
1680
- B && B.type === "userTask" && k.dispatch({
1681
- nodeId: B.id,
1682
+ function Br(e) {
1683
+ U && U.type === "userTask" && A.dispatch({
1684
+ nodeId: U.id,
1682
1685
  resubmitStrategy: e,
1683
1686
  type: "setUserTaskReturnResubmitStrategy"
1684
1687
  });
1685
1688
  }
1686
- function zr(e) {
1687
- B && B.type === "userTask" && k.dispatch({
1688
- nodeId: B.id,
1689
+ function Vr(e) {
1690
+ U && U.type === "userTask" && A.dispatch({
1691
+ nodeId: U.id,
1689
1692
  requireComment: e,
1690
1693
  type: "setUserTaskReturnRequireComment"
1691
1694
  });
1692
1695
  }
1693
1696
  function Q(e) {
1694
- B && B.type === "userTask" && k.dispatch({
1695
- nodeId: B.id,
1697
+ U && U.type === "userTask" && A.dispatch({
1698
+ nodeId: U.id,
1696
1699
  sla: e,
1697
1700
  type: "setUserTaskSla"
1698
1701
  });
1699
1702
  }
1700
- function Hr(e) {
1701
- B && B.type === "userTask" && k.dispatch({
1703
+ function Ur(e) {
1704
+ U && U.type === "userTask" && A.dispatch({
1702
1705
  excludeInitiator: e,
1703
- nodeId: B.id,
1706
+ nodeId: U.id,
1704
1707
  type: "setUserTaskExcludeInitiator"
1705
1708
  });
1706
1709
  }
1707
- function Ur(e) {
1708
- if (!B || B.type !== "userTask") return;
1709
- F(null);
1710
+ function Gr(e) {
1711
+ if (!U || U.type !== "userTask") return;
1712
+ I(null);
1710
1713
  let t = e.type === "QUORUM" ? {
1711
1714
  ...e,
1712
1715
  threshold: tt(e.threshold, e.thresholdType)
1713
1716
  } : e;
1714
- k.dispatch({
1717
+ A.dispatch({
1715
1718
  decisionPolicy: t,
1716
- nodeId: B.id,
1719
+ nodeId: U.id,
1717
1720
  type: "setUserTaskDecisionPolicy"
1718
1721
  });
1719
1722
  }
1720
- function Wr(e) {
1721
- B && B.type === "userTask" && k.dispatch({
1723
+ function Kr(e) {
1724
+ U && U.type === "userTask" && A.dispatch({
1722
1725
  ...e,
1723
- nodeId: B.id,
1726
+ nodeId: U.id,
1724
1727
  type: "setUserTaskOptions"
1725
1728
  });
1726
1729
  }
1727
- function Gr(e) {
1728
- B && B.type === "serviceTask" && k.dispatch({
1730
+ function qr(e) {
1731
+ U && U.type === "serviceTask" && A.dispatch({
1729
1732
  action: e,
1730
- nodeId: B.id,
1733
+ nodeId: U.id,
1731
1734
  type: "setServiceAction"
1732
1735
  });
1733
1736
  }
1734
- function li(e) {
1735
- Pe(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), Ee(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), ut(xi(e, L));
1737
+ function Jr(e) {
1738
+ O(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), Ee(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), ut(Ti(e, R));
1736
1739
  }
1737
- function _i(e) {
1738
- B && B.type !== "startEvent" && k.dispatch({
1739
- nodeId: B.id,
1740
+ function fi(e) {
1741
+ U && U.type !== "startEvent" && A.dispatch({
1742
+ nodeId: U.id,
1740
1743
  triggerMode: e,
1741
1744
  type: "setNodeTriggerMode"
1742
1745
  });
1743
1746
  }
1744
- function bi(e, t) {
1745
- k.dispatch({
1747
+ function hi(e, t) {
1748
+ A.dispatch({
1746
1749
  edgeId: e,
1747
1750
  isDefault: t,
1748
1751
  type: "setEdgeDefault"
1749
1752
  });
1750
1753
  }
1751
- function Si({ edgeId: e, fieldKey: t, operator: n, value: r }) {
1752
- k.dispatch({
1754
+ function xi({ edgeId: e, fieldKey: t, operator: n, value: r }) {
1755
+ A.dispatch({
1753
1756
  edgeId: e,
1754
1757
  fieldKey: t,
1755
1758
  operator: n,
@@ -1757,293 +1760,293 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
1757
1760
  value: r
1758
1761
  });
1759
1762
  }
1760
- function Di() {
1761
- k.dispatch({ type: "autoLayout" });
1763
+ function wi() {
1764
+ A.dispatch({ type: "autoLayout" });
1762
1765
  }
1763
- return /* @__PURE__ */ E(w, { children: [
1764
- /* @__PURE__ */ T("style", { children: In }),
1765
- a ? null : /* @__PURE__ */ T(ee, { children: /* @__PURE__ */ E(ae, {
1766
- description: On({
1766
+ return /* @__PURE__ */ T(C, { children: [
1767
+ /* @__PURE__ */ w("style", { children: Fn }),
1768
+ i ? null : /* @__PURE__ */ w(ne, { children: /* @__PURE__ */ T(E, {
1769
+ description: Dn({
1767
1770
  draftVersion: be?.version ?? null,
1768
1771
  hasPublishedVersion: !!D?.template.currentVersionId,
1769
1772
  publishedVersion: D?.versions.find((e) => e.id === D.template.currentVersionId)?.version ?? null
1770
1773
  }),
1771
- onBackClick: xn,
1774
+ onBackClick: yn,
1772
1775
  title: D?.template.name ?? "流程設計器",
1773
1776
  children: [
1774
- me ? /* @__PURE__ */ T(_, {
1777
+ fe ? /* @__PURE__ */ w(v, {
1775
1778
  disabled: !r,
1776
- onClick: () => un((e) => !e),
1777
- variant: ln ? "base-primary" : "base-secondary",
1779
+ onClick: () => ln((e) => !e),
1780
+ variant: sn ? "base-primary" : "base-secondary",
1778
1781
  children: r ? "AI 助理" : "AI 助理(未設定)"
1779
1782
  }) : null,
1780
- /* @__PURE__ */ T(_, {
1783
+ /* @__PURE__ */ w(v, {
1781
1784
  "aria-label": "儲存草稿",
1782
- disabled: wt || !!W || !!q,
1783
- icon: fe,
1785
+ disabled: wt || !!J || !!Xn,
1786
+ icon: pe,
1784
1787
  iconType: "icon-only",
1785
- onClick: () => void ir(),
1788
+ onClick: () => void rr(),
1786
1789
  variant: "base-secondary",
1787
1790
  children: "儲存草稿"
1788
1791
  }),
1789
- he ? /* @__PURE__ */ T(_, {
1790
- disabled: St || !!W || !!q,
1791
- icon: ce,
1792
+ he ? /* @__PURE__ */ w(v, {
1793
+ disabled: St || !!J || !!Xn,
1794
+ icon: le,
1792
1795
  iconType: "leading",
1793
- onClick: or,
1796
+ onClick: ar,
1794
1797
  variant: "base-secondary",
1795
1798
  children: "試跑流程"
1796
1799
  }) : null,
1797
- /* @__PURE__ */ T(_, {
1798
- disabled: wt || !be && !jt && !hn || !!W || !!q || !!Zn,
1799
- icon: oe,
1800
+ /* @__PURE__ */ w(v, {
1801
+ disabled: wt || !be && !jt && !fn || !!J || !!Xn || !!Jn,
1802
+ icon: se,
1800
1803
  iconType: "leading",
1801
- onClick: () => void ar(),
1804
+ onClick: () => void ir(),
1802
1805
  variant: "base-primary",
1803
- children: bn
1806
+ children: vn
1804
1807
  })
1805
1808
  ]
1806
1809
  }) }),
1807
- /* @__PURE__ */ T(ne, { children: /* @__PURE__ */ T(te, { children: /* @__PURE__ */ E("div", {
1808
- style: An,
1810
+ /* @__PURE__ */ w(ie, { children: /* @__PURE__ */ w(re, { children: /* @__PURE__ */ T("div", {
1811
+ style: On,
1809
1812
  children: [
1810
- bt ? /* @__PURE__ */ T(C, {
1813
+ mt ? /* @__PURE__ */ w(S, {
1811
1814
  color: "text-error",
1812
1815
  variant: "body",
1813
- children: bt
1816
+ children: mt
1814
1817
  }) : null,
1815
- xt && xt.nodeId === B?.id && B.type === "userTask" && (B.data.decisionPolicy?.type ?? "SINGLE") === xt.policyType ? /* @__PURE__ */ T(C, {
1818
+ xt && xt.nodeId === U?.id && U.type === "userTask" && (U.data.decisionPolicy?.type ?? "SINGLE") === xt.policyType ? /* @__PURE__ */ w(S, {
1816
1819
  color: "text-warning",
1817
1820
  variant: "body",
1818
1821
  children: xt.message
1819
1822
  }) : null,
1820
- W ? /* @__PURE__ */ T(C, {
1823
+ J ? /* @__PURE__ */ w(S, {
1821
1824
  color: "text-error",
1822
1825
  variant: "body",
1823
- children: W
1826
+ children: J
1824
1827
  }) : null,
1825
- q ? /* @__PURE__ */ T(C, {
1828
+ Xn ? /* @__PURE__ */ w(S, {
1826
1829
  color: "text-error",
1827
1830
  variant: "body",
1828
- children: q
1831
+ children: Xn
1829
1832
  }) : null,
1830
- !W && Zn ? /* @__PURE__ */ E(C, {
1833
+ !J && Jn ? /* @__PURE__ */ T(S, {
1831
1834
  color: "text-error",
1832
1835
  variant: "body",
1833
- children: ["發布前需修正:", Zn]
1836
+ children: ["發布前需修正:", Jn]
1834
1837
  }) : null,
1835
- a ? null : /* @__PURE__ */ T("div", {
1836
- style: U,
1837
- children: /* @__PURE__ */ T(n, {
1838
- hintText: K ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
1838
+ i ? null : /* @__PURE__ */ w("div", {
1839
+ style: K,
1840
+ children: /* @__PURE__ */ w(n, {
1841
+ hintText: X ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
1839
1842
  label: "綁定表單版本",
1840
1843
  name: "formDefinitionVersionId",
1841
1844
  required: !0,
1842
- children: /* @__PURE__ */ E("div", {
1843
- style: Gn,
1844
- children: [/* @__PURE__ */ T("div", {
1845
- style: Kn,
1846
- children: /* @__PURE__ */ T(g, {
1845
+ children: /* @__PURE__ */ T("div", {
1846
+ style: Wn,
1847
+ children: [/* @__PURE__ */ w("div", {
1848
+ style: Gn,
1849
+ children: /* @__PURE__ */ w(_, {
1847
1850
  asyncData: !0,
1848
- disabled: St || K,
1851
+ disabled: St || X,
1849
1852
  disabledOptionsFilter: !0,
1850
1853
  emptyText: "沒有符合的已發布表單版本",
1851
- isForceClearable: !!j && !K,
1854
+ isForceClearable: !!M && !X,
1852
1855
  loading: Et,
1853
1856
  loadingText: "搜尋表單版本中...",
1854
1857
  mode: "single",
1855
1858
  onChange: (e) => {
1856
- K || lt(e?.id ?? null);
1859
+ X || ct(e?.id ?? null);
1857
1860
  },
1858
1861
  onClear: () => {
1859
- K || lt(null);
1862
+ X || ct(null);
1860
1863
  },
1861
- onSearch: tr,
1864
+ onSearch: $n,
1862
1865
  onVisibilityChange: (e) => {
1863
- e && !K && tr("");
1866
+ e && !X && $n("");
1864
1867
  },
1865
- options: [...zn],
1868
+ options: [...In],
1866
1869
  placeholder: "選擇已發布表單版本",
1867
1870
  searchDebounceTime: 300,
1868
- value: H
1871
+ value: G
1869
1872
  })
1870
- }), /* @__PURE__ */ T(_, {
1873
+ }), /* @__PURE__ */ w(v, {
1871
1874
  disabled: St,
1872
1875
  onClick: () => {
1873
- Ar();
1876
+ xr();
1874
1877
  },
1875
- style: qn,
1878
+ style: Kn,
1876
1879
  variant: "base-secondary",
1877
1880
  children: "編輯表單"
1878
1881
  })]
1879
1882
  })
1880
1883
  })
1881
1884
  }),
1882
- /* @__PURE__ */ E("div", {
1883
- style: jn,
1884
- children: [/* @__PURE__ */ T("div", {
1885
- ref: O,
1886
- style: Mn,
1887
- children: /* @__PURE__ */ E(Fe, {
1888
- connectionMode: ke.Strict,
1889
- edges: Ln,
1885
+ /* @__PURE__ */ T("div", {
1886
+ style: kn,
1887
+ children: [/* @__PURE__ */ w("div", {
1888
+ ref: Pe,
1889
+ style: An,
1890
+ children: /* @__PURE__ */ T(Fe, {
1891
+ connectionMode: Ae.Strict,
1892
+ edges: Pn,
1890
1893
  fitView: !0,
1891
- isValidConnection: (e) => wi(e, A.nodes),
1892
- nodeTypes: Or,
1893
- nodes: Qn,
1894
+ isValidConnection: (e) => Oi(e, j.nodes),
1895
+ nodeTypes: Ar,
1896
+ nodes: Yn,
1894
1897
  deleteKeyCode: null,
1895
1898
  multiSelectionKeyCode: [
1896
1899
  "Shift",
1897
1900
  "Meta",
1898
1901
  "Control"
1899
1902
  ],
1900
- onConnect: Mr,
1901
- onEdgeClick: Nr,
1903
+ onConnect: Pr,
1904
+ onEdgeClick: Fr,
1902
1905
  onNodeClick: (e, t) => {
1903
1906
  dt(t.id), ft([]);
1904
1907
  },
1905
- onNodesChange: X,
1908
+ onNodesChange: Mr,
1906
1909
  onPaneClick: () => {
1907
1910
  dt(null), ft([]);
1908
1911
  },
1909
- onViewportChange: Re,
1910
- viewport: Le,
1912
+ onViewportChange: Le,
1913
+ viewport: k,
1911
1914
  children: [
1912
- /* @__PURE__ */ T(Oe, {}),
1913
- /* @__PURE__ */ T("style", { children: Bn }),
1914
- /* @__PURE__ */ T(je, { children: Cn ? /* @__PURE__ */ T(Ae, {
1915
+ /* @__PURE__ */ w(ke, {}),
1916
+ /* @__PURE__ */ w("style", { children: zn }),
1917
+ /* @__PURE__ */ w(Me, { children: xn ? /* @__PURE__ */ w(je, {
1915
1918
  "aria-label": "刪除選取項目",
1916
1919
  className: "workflow-selection-delete-control",
1917
- onClick: wn,
1918
- style: Nn,
1920
+ onClick: Sn,
1921
+ style: jn,
1919
1922
  title: "刪除選取項目",
1920
- children: /* @__PURE__ */ T("span", {
1921
- style: Pn,
1922
- children: /* @__PURE__ */ T(v, {
1923
+ children: /* @__PURE__ */ w("span", {
1924
+ style: Mn,
1925
+ children: /* @__PURE__ */ w(ee, {
1923
1926
  color: "error",
1924
- icon: pe,
1927
+ icon: me,
1925
1928
  size: 16
1926
1929
  })
1927
1930
  })
1928
1931
  }) : null }),
1929
- /* @__PURE__ */ T(jr, { onApplyAutoLayout: Di }),
1930
- /* @__PURE__ */ T(Ne, {})
1932
+ /* @__PURE__ */ w(Nr, { onApplyAutoLayout: wi }),
1933
+ /* @__PURE__ */ w(Ne, {})
1931
1934
  ]
1932
1935
  })
1933
- }), /* @__PURE__ */ E("div", {
1934
- className: Fn,
1935
- style: Vn,
1936
+ }), /* @__PURE__ */ T("div", {
1937
+ className: Nn,
1938
+ style: Bn,
1936
1939
  children: [
1937
- /* @__PURE__ */ T(C, {
1940
+ /* @__PURE__ */ w(S, {
1938
1941
  component: "h2",
1939
1942
  variant: "h3",
1940
1943
  children: "流程工具"
1941
1944
  }),
1942
- a && me ? /* @__PURE__ */ E("div", {
1943
- style: Jn,
1944
- children: [/* @__PURE__ */ T(C, {
1945
+ i && fe ? /* @__PURE__ */ T("div", {
1946
+ style: qn,
1947
+ children: [/* @__PURE__ */ w(S, {
1945
1948
  color: "text-neutral",
1946
1949
  variant: "caption",
1947
1950
  children: "AI 協助"
1948
- }), /* @__PURE__ */ T("div", {
1949
- style: Wn,
1950
- children: /* @__PURE__ */ T(_, {
1951
+ }), /* @__PURE__ */ w("div", {
1952
+ style: Un,
1953
+ children: /* @__PURE__ */ w(v, {
1951
1954
  disabled: !r,
1952
- onClick: () => un((e) => !e),
1955
+ onClick: () => ln((e) => !e),
1953
1956
  size: "sub",
1954
- variant: ln ? "base-primary" : "base-secondary",
1957
+ variant: sn ? "base-primary" : "base-secondary",
1955
1958
  children: r ? "AI 助理" : "AI 助理(未設定)"
1956
1959
  })
1957
1960
  })]
1958
1961
  }) : null,
1959
- /* @__PURE__ */ E("div", {
1960
- style: Jn,
1961
- children: [/* @__PURE__ */ T(C, {
1962
+ /* @__PURE__ */ T("div", {
1963
+ style: qn,
1964
+ children: [/* @__PURE__ */ w(S, {
1962
1965
  color: "text-neutral",
1963
1966
  variant: "caption",
1964
1967
  children: "動作節點"
1965
- }), /* @__PURE__ */ T("div", {
1966
- style: Wn,
1967
- children: cr.map((e) => /* @__PURE__ */ T(_, {
1968
+ }), /* @__PURE__ */ w("div", {
1969
+ style: Un,
1970
+ children: cr.map((e) => /* @__PURE__ */ w(v, {
1968
1971
  icon: e.icon,
1969
1972
  iconType: "leading",
1970
- onClick: () => Fr(e.type),
1973
+ onClick: () => Lr(e.type),
1971
1974
  size: "sub",
1972
1975
  variant: "base-secondary",
1973
1976
  children: e.label
1974
1977
  }, e.type))
1975
1978
  })]
1976
1979
  }),
1977
- /* @__PURE__ */ E("div", {
1978
- style: Jn,
1979
- children: [/* @__PURE__ */ T(C, {
1980
+ /* @__PURE__ */ T("div", {
1981
+ style: qn,
1982
+ children: [/* @__PURE__ */ w(S, {
1980
1983
  color: "text-neutral",
1981
1984
  variant: "caption",
1982
1985
  children: "流程控制"
1983
- }), /* @__PURE__ */ T("div", {
1984
- style: Wn,
1985
- children: lr.map((e) => /* @__PURE__ */ T(_, {
1986
+ }), /* @__PURE__ */ w("div", {
1987
+ style: Un,
1988
+ children: lr.map((e) => /* @__PURE__ */ w(v, {
1986
1989
  icon: e.icon,
1987
1990
  iconType: "leading",
1988
- onClick: () => Fr(e.type),
1991
+ onClick: () => Lr(e.type),
1989
1992
  size: "sub",
1990
1993
  variant: "base-secondary",
1991
1994
  children: e.label
1992
1995
  }, e.type))
1993
1996
  })]
1994
1997
  }),
1995
- kn.length > 1 ? Ki(kn) : null,
1996
- kn.length === 1 && Dn ? qi(Dn) : null,
1997
- kn.length === 0 && B ? ki(B) : null
1998
+ En.length > 1 ? qi(En) : null,
1999
+ En.length === 1 && wn ? Yi(wn) : null,
2000
+ En.length === 0 && U ? ji(U) : null
1998
2001
  ]
1999
2002
  })]
2000
2003
  })
2001
2004
  ]
2002
2005
  }) }) }),
2003
- Ji(Tn),
2004
- !a && he ? Oi() : null,
2005
- me && r ? /* @__PURE__ */ T(Lt, {
2006
- controller: k,
2007
- onClose: () => un(!1),
2008
- open: ln
2006
+ Xi(Cn),
2007
+ !i && he ? Ei() : null,
2008
+ fe && r ? /* @__PURE__ */ w(Rt, {
2009
+ controller: A,
2010
+ onClose: () => ln(!1),
2011
+ open: sn
2009
2012
  }) : null,
2010
- a ? null : /* @__PURE__ */ T(ie, {
2013
+ i ? null : /* @__PURE__ */ w(oe, {
2011
2014
  headerTitle: "編輯表單",
2012
2015
  isHeaderDisplay: !0,
2013
- onClose: () => fn(!1),
2014
- open: dn,
2016
+ onClose: () => dn(!1),
2017
+ open: un,
2015
2018
  size: "wide",
2016
- children: /* @__PURE__ */ E("div", {
2017
- style: Cr,
2018
- children: [/* @__PURE__ */ T("div", {
2019
- style: wr,
2020
- children: vn ? /* @__PURE__ */ T(C, {
2019
+ children: /* @__PURE__ */ T("div", {
2020
+ style: Tr,
2021
+ children: [/* @__PURE__ */ w("div", {
2022
+ style: Er,
2023
+ children: hn ? /* @__PURE__ */ w(S, {
2021
2024
  color: "text-neutral",
2022
2025
  variant: "body",
2023
2026
  children: "載入中…"
2024
- }) : /* @__PURE__ */ T(l, {
2027
+ }) : /* @__PURE__ */ w(u, {
2025
2028
  onChange: (e) => {
2026
- pn(e);
2029
+ H(e);
2027
2030
  },
2028
- value: z ?? {
2029
- schema: Er,
2030
- uiSchema: Dr
2031
+ value: V ?? {
2032
+ schema: Or,
2033
+ uiSchema: kr
2031
2034
  }
2032
2035
  })
2033
- }), /* @__PURE__ */ E("div", {
2034
- style: Tr,
2035
- children: [/* @__PURE__ */ T(_, {
2036
- disabled: vn,
2036
+ }), /* @__PURE__ */ T("div", {
2037
+ style: Dr,
2038
+ children: [/* @__PURE__ */ w(v, {
2039
+ disabled: hn,
2037
2040
  onClick: () => {
2038
- z !== null && (gn(!0), k.replaceState((e) => ({
2041
+ V !== null && (mn(!0), A.replaceState((e) => ({
2039
2042
  ...e,
2040
- formSchema: z.schema
2041
- }))), fn(!1);
2043
+ formSchema: V.schema
2044
+ }))), dn(!1);
2042
2045
  },
2043
2046
  variant: "base-primary",
2044
2047
  children: "套用"
2045
- }), /* @__PURE__ */ T(_, {
2046
- onClick: () => fn(!1),
2048
+ }), /* @__PURE__ */ w(v, {
2049
+ onClick: () => dn(!1),
2047
2050
  variant: "base-secondary",
2048
2051
  children: "取消"
2049
2052
  })]
@@ -2051,85 +2054,85 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2051
2054
  })
2052
2055
  })
2053
2056
  ] });
2054
- function Oi() {
2057
+ function Ei() {
2055
2058
  let e = {
2056
- formFields: G?.fields ?? [],
2057
- memberName: (e) => I.find((t) => t.memberId === e && !t.unresolved)?.displayName ?? null,
2058
- orgUnits: L,
2059
- positions: R
2059
+ formFields: Y?.fields ?? [],
2060
+ memberName: (e) => L.find((t) => t.memberId === e && !t.unresolved)?.displayName ?? null,
2061
+ orgUnits: R,
2062
+ positions: z
2060
2063
  };
2061
- return /* @__PURE__ */ T(b, {
2064
+ return /* @__PURE__ */ w(y, {
2062
2065
  cancelText: "關閉",
2063
2066
  confirmText: "執行試跑",
2064
- loading: qt,
2067
+ loading: Kt,
2065
2068
  modalType: "standard",
2066
- onCancel: vr,
2067
- onClose: vr,
2068
- onConfirm: () => void yr(),
2069
- open: Gt,
2069
+ onCancel: or,
2070
+ onClose: or,
2071
+ onConfirm: () => void br(),
2072
+ open: Wt,
2070
2073
  showModalFooter: !0,
2071
2074
  showModalHeader: !0,
2072
2075
  size: "wide",
2073
- supportingText: `使用 ${Sr} 與範例表單資料模擬目前畫布流程,不會建立案件。`,
2076
+ supportingText: `使用 ${wr} 與範例表單資料模擬目前畫布流程,不會建立案件。`,
2074
2077
  title: "試跑流程",
2075
- children: /* @__PURE__ */ E("div", {
2076
- style: U,
2078
+ children: /* @__PURE__ */ T("div", {
2079
+ style: K,
2077
2080
  children: [
2078
- /* @__PURE__ */ T(n, {
2081
+ /* @__PURE__ */ w(n, {
2079
2082
  label: "表單資料 JSON",
2080
2083
  name: "dryRunFormDataJson",
2081
2084
  required: !0,
2082
- children: /* @__PURE__ */ T(re, {
2083
- onChange: (e) => Zt(e.target.value),
2085
+ children: /* @__PURE__ */ w(ae, {
2086
+ onChange: (e) => Xt(e.target.value),
2084
2087
  resize: "vertical",
2085
2088
  rows: 8,
2086
- value: Xt
2089
+ value: Yt
2087
2090
  })
2088
2091
  }),
2089
- tn ? /* @__PURE__ */ T(C, {
2092
+ en ? /* @__PURE__ */ w(S, {
2090
2093
  color: "text-error",
2091
2094
  variant: "body",
2092
- children: tn
2095
+ children: en
2093
2096
  }) : null,
2094
- $t ? /* @__PURE__ */ E("div", {
2095
- style: Hn,
2097
+ Zt ? /* @__PURE__ */ T("div", {
2098
+ style: Vn,
2096
2099
  children: [
2097
- /* @__PURE__ */ T(C, {
2098
- color: $t.valid ? "text-success" : "text-error",
2100
+ /* @__PURE__ */ w(S, {
2101
+ color: Zt.valid ? "text-success" : "text-error",
2099
2102
  variant: "label-primary-highlight",
2100
- children: $t.valid ? "試跑通過" : "試跑失敗"
2103
+ children: Zt.valid ? "試跑通過" : "試跑失敗"
2101
2104
  }),
2102
- $t.errors.map((e) => /* @__PURE__ */ T(C, {
2105
+ Zt.errors.map((e) => /* @__PURE__ */ w(S, {
2103
2106
  color: "text-error",
2104
2107
  variant: "body",
2105
2108
  children: e
2106
2109
  }, e)),
2107
- $t.steps.map((t) => /* @__PURE__ */ E("div", {
2108
- style: Un,
2110
+ Zt.steps.map((t) => /* @__PURE__ */ T("div", {
2111
+ style: Hn,
2109
2112
  children: [
2110
- /* @__PURE__ */ E(C, {
2113
+ /* @__PURE__ */ T(S, {
2111
2114
  variant: "label-primary-highlight",
2112
2115
  children: [
2113
2116
  t.nodeLabel,
2114
2117
  " · ",
2115
- Pi(t.status)
2118
+ Ri(t.status)
2116
2119
  ]
2117
2120
  }),
2118
- /* @__PURE__ */ E(C, {
2121
+ /* @__PURE__ */ T(S, {
2119
2122
  color: "text-neutral",
2120
2123
  variant: "caption",
2121
2124
  children: [
2122
- Fi(t.nodeType),
2123
- t.assigneeMemberId ? ` · 處理者:${_n(t.assigneeMemberId, e)}` : "",
2125
+ zi(t.nodeType),
2126
+ t.assigneeMemberId ? ` · 處理者:${gn(t.assigneeMemberId, e)}` : "",
2124
2127
  t.edgeLabel ? ` · 來源線段:${t.edgeLabel}` : ""
2125
2128
  ]
2126
2129
  }),
2127
- t.edgeReason ? /* @__PURE__ */ T(C, {
2130
+ t.edgeReason ? /* @__PURE__ */ w(S, {
2128
2131
  color: "text-neutral",
2129
2132
  variant: "caption",
2130
2133
  children: t.edgeReason
2131
2134
  }) : null,
2132
- t.entryCondition ? /* @__PURE__ */ E(C, {
2135
+ t.entryCondition ? /* @__PURE__ */ T(S, {
2133
2136
  color: "text-neutral",
2134
2137
  variant: "caption",
2135
2138
  children: [
@@ -2140,12 +2143,12 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2140
2143
  t.entryCondition
2141
2144
  ]
2142
2145
  }) : null,
2143
- /* @__PURE__ */ T(C, {
2146
+ /* @__PURE__ */ w(S, {
2144
2147
  color: "text-neutral",
2145
2148
  variant: "body",
2146
2149
  children: t.message
2147
2150
  }),
2148
- (t.status === "SKIPPED" ? [] : ia(A, t.nodeId, rn)).map((e) => /* @__PURE__ */ E(C, {
2151
+ (t.status === "SKIPPED" ? [] : ca(j, t.nodeId, nn)).map((e) => /* @__PURE__ */ T(S, {
2149
2152
  color: "text-neutral",
2150
2153
  variant: "caption",
2151
2154
  children: ["將送出 Webhook:", e.label]
@@ -2158,16 +2161,16 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2158
2161
  })
2159
2162
  });
2160
2163
  }
2161
- function ki(e) {
2162
- return /* @__PURE__ */ E("div", {
2163
- style: U,
2164
+ function ji(e) {
2165
+ return /* @__PURE__ */ T("div", {
2166
+ style: K,
2164
2167
  children: [
2165
- /* @__PURE__ */ T(C, {
2168
+ /* @__PURE__ */ w(S, {
2166
2169
  component: "h2",
2167
2170
  variant: "h3",
2168
2171
  children: "節點屬性"
2169
2172
  }),
2170
- /* @__PURE__ */ E(C, {
2173
+ /* @__PURE__ */ T(S, {
2171
2174
  color: "text-neutral",
2172
2175
  variant: "body",
2173
2176
  children: [
@@ -2176,141 +2179,141 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2176
2179
  e.id
2177
2180
  ]
2178
2181
  }),
2179
- /* @__PURE__ */ T(n, {
2182
+ /* @__PURE__ */ w(n, {
2180
2183
  label: "顯示名稱",
2181
2184
  name: "nodeLabel",
2182
2185
  required: !0,
2183
- children: /* @__PURE__ */ T(y, {
2184
- onChange: (e) => Lr(e.target.value),
2186
+ children: /* @__PURE__ */ w(te, {
2187
+ onChange: (e) => Rr(e.target.value),
2185
2188
  value: e.data.label,
2186
2189
  variant: "base"
2187
2190
  })
2188
2191
  }),
2189
- e.type === "startEvent" ? Ni() : null,
2190
- e.type === "startEvent" ? null : Hi(e),
2191
- e.type === "userTask" ? Ui(e) : null,
2192
- e.type === "serviceTask" ? Gi(e) : null
2192
+ e.type === "startEvent" ? Mi() : null,
2193
+ e.type === "startEvent" ? null : Ni(e),
2194
+ e.type === "userTask" ? Li(e) : null,
2195
+ e.type === "serviceTask" ? Ki(e) : null
2193
2196
  ]
2194
2197
  });
2195
2198
  }
2196
- function Ni() {
2197
- let e = V.mode === "CUSTOM" ? [...br, xr] : [...br], t = V.mode === "ORG_UNIT" || V.mode === "ORG_UNIT_POSITION" ? Bi(L, V.orgUnitId ?? "") : null, r = V.mode === "ORG_UNIT_POSITION" ? Vi(R, V.positionId ?? "") : null, a = V.mode === "ORG_UNIT_POSITION" ? Yi({
2198
- includeDescendants: !!V.includeDescendants,
2199
- memberships: Ut,
2200
- orgUnitId: V.orgUnitId ?? "",
2201
- orgUnits: L,
2202
- positions: R
2199
+ function Mi() {
2200
+ let e = W.mode === "CUSTOM" ? [...Sr, Cr] : [...Sr], t = W.mode === "ORG_UNIT" || W.mode === "ORG_UNIT_POSITION" ? Wi(R, W.orgUnitId ?? "") : null, r = W.mode === "ORG_UNIT_POSITION" ? Gi(z, W.positionId ?? "") : null, i = W.mode === "ORG_UNIT_POSITION" ? $i({
2201
+ includeDescendants: !!W.includeDescendants,
2202
+ memberships: Ht,
2203
+ orgUnitId: W.orgUnitId ?? "",
2204
+ orgUnits: R,
2205
+ positions: z
2203
2206
  }) : [];
2204
- return /* @__PURE__ */ E(w, { children: [
2205
- /* @__PURE__ */ T(n, {
2206
- hintText: V.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
2207
+ return /* @__PURE__ */ T(C, { children: [
2208
+ /* @__PURE__ */ w(n, {
2209
+ hintText: W.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
2207
2210
  label: "發起權限",
2208
2211
  name: "initiatorPolicyMode",
2209
2212
  required: !0,
2210
- children: /* @__PURE__ */ T(x, {
2213
+ children: /* @__PURE__ */ w(b, {
2211
2214
  clearable: !1,
2212
2215
  onChange: (e) => {
2213
2216
  if (e?.id === "CUSTOM") {
2214
- Ee(null), Pe(null);
2217
+ Ee(null), O(null);
2215
2218
  return;
2216
2219
  }
2217
- let t = gi(e?.id ?? null), n = Ci(t);
2218
- Ee(t === "ALL" ? null : t), Pe(t === "ALL" ? null : n), ut(xi(n, L));
2220
+ let t = bi(e?.id ?? null), n = Di(t);
2221
+ Ee(t === "ALL" ? null : t), O(t === "ALL" ? null : n), ut(Ti(n, R));
2219
2222
  },
2220
2223
  options: e,
2221
2224
  placeholder: "選擇誰可以發起",
2222
- value: $(e, V.mode)
2225
+ value: $(e, W.mode)
2223
2226
  })
2224
2227
  }),
2225
- V.mode === "ORG_UNIT" || V.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
2228
+ W.mode === "ORG_UNIT" || W.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
2226
2229
  label: "組織",
2227
2230
  name: "initiatorOrgUnitId",
2228
2231
  required: !0,
2229
- children: /* @__PURE__ */ T(i, {
2232
+ children: /* @__PURE__ */ w(a, {
2230
2233
  name: "initiatorOrgUnitId",
2231
- onChange: (e) => li({
2232
- ...V,
2234
+ onChange: (e) => Jr({
2235
+ ...W,
2233
2236
  orgUnitId: e?.id ?? "",
2234
2237
  positionId: "",
2235
2238
  value: e?.id ?? ""
2236
2239
  }),
2237
- orgUnits: L,
2240
+ orgUnits: R,
2238
2241
  placeholder: "選擇組織",
2239
2242
  value: t
2240
2243
  })
2241
2244
  }) : null,
2242
- V.mode === "ORG_UNIT" || V.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
2245
+ W.mode === "ORG_UNIT" || W.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
2243
2246
  label: "包含下層",
2244
2247
  name: "initiatorIncludeDescendants",
2245
- children: /* @__PURE__ */ T(S, {
2246
- checked: !!V.includeDescendants,
2247
- onChange: (e) => li({
2248
- ...V,
2248
+ children: /* @__PURE__ */ w(x, {
2249
+ checked: !!W.includeDescendants,
2250
+ onChange: (e) => Jr({
2251
+ ...W,
2249
2252
  includeDescendants: e.target.checked,
2250
- ...V.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
2253
+ ...W.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
2251
2254
  })
2252
2255
  })
2253
2256
  }) : null,
2254
- V.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
2257
+ W.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
2255
2258
  label: "職位",
2256
2259
  name: "initiatorPositionId",
2257
2260
  required: !0,
2258
- children: /* @__PURE__ */ T(o, {
2259
- disabled: !V.orgUnitId?.trim(),
2261
+ children: /* @__PURE__ */ w(s, {
2262
+ disabled: !W.orgUnitId?.trim(),
2260
2263
  name: "initiatorPositionId",
2261
- onChange: (e) => li({
2262
- ...V,
2264
+ onChange: (e) => Jr({
2265
+ ...W,
2263
2266
  positionId: e?.id ?? ""
2264
2267
  }),
2265
- placeholder: V.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
2266
- positions: a,
2268
+ placeholder: W.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
2269
+ positions: i,
2267
2270
  value: r
2268
2271
  })
2269
2272
  }) : null
2270
2273
  ] });
2271
2274
  }
2272
- function Hi(e) {
2273
- let t = A.edges.filter((t) => t.target === e.id).length, r = t < 2, i = r ? "AND" : e.data.triggerMode ?? "AND";
2274
- return /* @__PURE__ */ T(n, {
2275
+ function Ni(e) {
2276
+ let t = j.edges.filter((t) => t.target === e.id).length, r = t < 2, i = r ? "AND" : e.data.triggerMode ?? "AND";
2277
+ return /* @__PURE__ */ w(n, {
2275
2278
  hintText: r ? "需要至少兩條前置連線,才可切換為任一前置完成。" : t > 1 ? `${t} 條前置連線會依此規則觸發。` : "只有一條前置連線時,兩種設定效果相同。",
2276
2279
  label: "前置條件",
2277
2280
  name: "triggerMode",
2278
2281
  required: !0,
2279
- children: /* @__PURE__ */ T(x, {
2282
+ children: /* @__PURE__ */ w(b, {
2280
2283
  clearable: !1,
2281
- onChange: (e) => r ? void 0 : _i(Yr(e?.id ?? null)),
2284
+ onChange: (e) => r ? void 0 : fi(Qr(e?.id ?? null)),
2282
2285
  options: [...ur],
2283
2286
  readOnly: r,
2284
2287
  value: $(ur, i)
2285
2288
  })
2286
2289
  });
2287
2290
  }
2288
- function Ui(e) {
2289
- let t = e.data.approverResolver, r = ui(t.type), a = t.type === "DIRECT" ? t.memberIds.map((e) => zi(I, e)) : [], s = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? Bi(L, t.orgUnitId) : null, c = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? Vi(R, t.positionId) : null, l = t.type === "ORG_UNIT_POSITION" ? Yi({
2291
+ function Li(e) {
2292
+ let t = e.data.approverResolver, r = pi(t.type), i = t.type === "DIRECT" ? t.memberIds.map((e) => Ui(L, e)) : [], o = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? Wi(R, t.orgUnitId) : null, c = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? Gi(z, t.positionId) : null, l = t.type === "ORG_UNIT_POSITION" ? $i({
2290
2293
  includeDescendants: !!t.includeDescendants,
2291
- memberships: Ut,
2294
+ memberships: Ht,
2292
2295
  orgUnitId: t.orgUnitId,
2293
- orgUnits: L,
2294
- positions: R
2295
- }) : [], u = t.type === "DYNAMIC_FORM" ? En(G, t.formPath) : null, d = t.type === "ORG_MANAGER" ? mi(t.levelsUp) : Y[0], f = t.type === "ORG_MANAGER" || t.type === "ORG_MANAGER_CHAIN" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, p = t.type === "ORG_MANAGER_CHAIN" ? zt(R, t.minPositionLevel) : [], m = f.type === "DIRECT" && f.memberId ? zi(I, f.memberId) : null, h = e.data.returnBehavior.resubmitStrategy ?? "RESTART", _ = e.data.sla ?? null, v = e.data.excludeInitiator ?? null, b = _ ? ht(_.duration) : null, ee = b?.unit ?? "DAY", te = ii(_?.warningAt ?? null), ne = mi(_?.escalateLevelsUp ?? 1), re = Zr(e.data.decisionPolicy), C = $r(e.data.decisionPolicy);
2296
- return /* @__PURE__ */ E(w, { children: [
2297
- /* @__PURE__ */ T(n, {
2296
+ orgUnits: R,
2297
+ positions: z
2298
+ }) : [], u = t.type === "DYNAMIC_FORM" ? Tn(Y, t.formPath) : null, d = t.type === "ORG_MANAGER" ? vi(t.levelsUp) : hr[0], f = t.type === "ORG_MANAGER" || t.type === "ORG_MANAGER_CHAIN" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, p = Xe(f), m = p === null ? gr : [...gr, _r], h = t.type === "ORG_MANAGER_CHAIN" ? Bt(z, t.minPositionLevel) : [], g = f.type === "DIRECT" && f.memberId ? Ui(L, f.memberId) : null, v = f.type === "POSITION" ? Gi(z, f.positionId) : null, ee = e.data.returnBehavior.resubmitStrategy ?? "RESTART", y = e.data.sla ?? null, ne = e.data.excludeInitiator ?? null, re = y ? gt(y.duration) : null, ie = re?.unit ?? "DAY", ae = si(y?.warningAt ?? null), S = vi(y?.escalateLevelsUp ?? 1), oe = ei(e.data.decisionPolicy), E = ni(e.data.decisionPolicy);
2299
+ return /* @__PURE__ */ T(C, { children: [
2300
+ /* @__PURE__ */ w(n, {
2298
2301
  label: "簽核來源",
2299
2302
  name: "approverResolverType",
2300
2303
  required: !0,
2301
- children: /* @__PURE__ */ T(x, {
2304
+ children: /* @__PURE__ */ w(b, {
2302
2305
  clearable: !1,
2303
- onChange: (e) => Z(di(e?.id ?? null, R)),
2306
+ onChange: (e) => Z(mi(e?.id ?? null, z)),
2304
2307
  options: [...pr],
2305
2308
  value: $(pr, r)
2306
2309
  })
2307
2310
  }),
2308
- t.type === "DIRECT" ? /* @__PURE__ */ T(n, {
2309
- hintText: _t(e.data.decisionPolicy),
2311
+ t.type === "DIRECT" ? /* @__PURE__ */ w(n, {
2312
+ hintText: vt(e.data.decisionPolicy),
2310
2313
  label: "簽核者",
2311
2314
  name: "memberId",
2312
2315
  required: !0,
2313
- children: /* @__PURE__ */ T(g, {
2316
+ children: /* @__PURE__ */ w(_, {
2314
2317
  asyncData: !0,
2315
2318
  disabledOptionsFilter: !0,
2316
2319
  emptyText: "沒有符合的成員",
@@ -2327,22 +2330,22 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2327
2330
  memberIds: e.map((e) => e.id),
2328
2331
  type: "DIRECT"
2329
2332
  }),
2330
- onSearch: J,
2333
+ onSearch: er,
2331
2334
  onVisibilityChange: (e) => {
2332
- e && (It([]), J(""));
2335
+ e && (It([]), er(""));
2333
2336
  },
2334
- options: [...Zi(a, Ft)],
2337
+ options: [...ta(i, Ft)],
2335
2338
  placeholder: "搜尋姓名或信箱",
2336
2339
  searchDebounceTime: 300,
2337
- value: a
2340
+ value: i
2338
2341
  })
2339
2342
  }) : null,
2340
- t.type === "DYNAMIC_FORM" ? /* @__PURE__ */ T(n, {
2343
+ t.type === "DYNAMIC_FORM" ? /* @__PURE__ */ w(n, {
2341
2344
  hintText: u?.problem ?? "簽核人取自申請人送出表單時在該欄位選的人員。",
2342
2345
  label: "表單欄位",
2343
2346
  name: "approverFormPath",
2344
2347
  required: !0,
2345
- children: /* @__PURE__ */ T(x, {
2348
+ children: /* @__PURE__ */ w(b, {
2346
2349
  clearable: !1,
2347
2350
  onChange: (e) => Z({
2348
2351
  formPath: e?.id ?? "",
@@ -2353,43 +2356,44 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2353
2356
  value: u?.selected ?? void 0
2354
2357
  })
2355
2358
  }) : null,
2356
- t.type === "ORG_MANAGER" ? /* @__PURE__ */ T(n, {
2359
+ t.type === "ORG_MANAGER" ? /* @__PURE__ */ w(n, {
2357
2360
  hintText: "依發起人的有效會員歸屬與主管解析規則決定簽核人。",
2358
2361
  label: "主管層級",
2359
2362
  name: "managerLevelsUp",
2360
2363
  required: !0,
2361
- children: /* @__PURE__ */ T(x, {
2364
+ children: /* @__PURE__ */ w(b, {
2362
2365
  clearable: !1,
2363
2366
  onChange: (e) => Z({
2364
2367
  baseFromInitiator: !0,
2365
- levelsUp: hi(e?.id ?? null).value,
2368
+ ...t.fallback ? { fallback: t.fallback } : {},
2369
+ levelsUp: yi(e?.id ?? null).value,
2366
2370
  type: "ORG_MANAGER"
2367
2371
  }),
2368
- options: [...Y],
2372
+ options: [...hr],
2369
2373
  value: d
2370
2374
  })
2371
2375
  }) : null,
2372
- t.type === "ORG_MANAGER_CHAIN" ? /* @__PURE__ */ T(n, {
2376
+ t.type === "ORG_MANAGER_CHAIN" ? /* @__PURE__ */ w(n, {
2373
2377
  hintText: "從發起人的直屬主管開始往上,職等比前一位高的主管依序加入,簽到職等達此值的主管為止。沒有職位的主管會略過。",
2374
2378
  label: "簽到職等",
2375
2379
  name: "minPositionLevel",
2376
2380
  required: !0,
2377
- children: /* @__PURE__ */ T(x, {
2381
+ children: /* @__PURE__ */ w(b, {
2378
2382
  clearable: !1,
2379
2383
  onChange: (e) => Z({
2380
2384
  ...t,
2381
2385
  minPositionLevel: Number(e?.id ?? t.minPositionLevel)
2382
2386
  }),
2383
- options: [...p],
2384
- value: $(p, String(t.minPositionLevel))
2387
+ options: [...h],
2388
+ value: $(h, String(t.minPositionLevel))
2385
2389
  })
2386
2390
  }) : null,
2387
- t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
2391
+ t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
2388
2392
  hintText: t.type === "ORG_UNIT_MANAGER" ? "依指定組織或其上層的主管解析規則決定簽核人。" : "依指定組織目前有效會員歸屬建立候選簽核人。",
2389
2393
  label: "組織",
2390
2394
  name: "orgUnitId",
2391
2395
  required: !0,
2392
- children: /* @__PURE__ */ T(i, {
2396
+ children: /* @__PURE__ */ w(a, {
2393
2397
  name: "orgUnitId",
2394
2398
  onChange: (e) => Z(t.type === "ORG_UNIT_MEMBER" ? {
2395
2399
  includeDescendants: t.includeDescendants,
@@ -2405,17 +2409,17 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2405
2409
  orgUnitId: e?.id ?? "",
2406
2410
  type: "ORG_UNIT_MANAGER"
2407
2411
  }),
2408
- orgUnits: L,
2412
+ orgUnits: R,
2409
2413
  placeholder: "選擇組織",
2410
- value: s
2414
+ value: o
2411
2415
  })
2412
2416
  }) : null,
2413
- t.type === "ORG_MANAGER" || t.type === "ORG_MANAGER_CHAIN" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ E(w, { children: [
2414
- t.type === "ORG_MANAGER_CHAIN" ? null : /* @__PURE__ */ T(n, {
2417
+ t.type === "ORG_MANAGER" || t.type === "ORG_MANAGER_CHAIN" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ T(C, { children: [
2418
+ t.type === "ORG_MANAGER_CHAIN" ? null : /* @__PURE__ */ w(n, {
2415
2419
  hintText: "開啟後只取離該員最近一層的主管規則;掛在上層單位、涵蓋範圍較大的規則不會再一併加入簽核人。",
2416
2420
  label: "只取最近一層主管",
2417
2421
  name: "preferClosestOrgUnit",
2418
- children: /* @__PURE__ */ T(S, {
2422
+ children: /* @__PURE__ */ w(x, {
2419
2423
  checked: !!t.preferClosestOrgUnit,
2420
2424
  inputProps: {
2421
2425
  id: "preferClosestOrgUnit",
@@ -2427,26 +2431,25 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2427
2431
  })
2428
2432
  })
2429
2433
  }),
2430
- /* @__PURE__ */ T(n, {
2431
- hintText: t.type === "ORG_MANAGER_CHAIN" ? "預設會停止流程並提示;若設定固定人,主管鏈在達到簽核職等前就結束時,會再加上該會員作為最後一關。" : "預設會停止流程並提示;若設定固定人,找不到主管時會改派給該會員。",
2434
+ /* @__PURE__ */ w(n, {
2435
+ hintText: p === null ? t.type === "ORG_MANAGER_CHAIN" ? "預設會停止流程並提示;若設定固定人,主管鏈在達到簽核職等前就結束時,會再加上該會員作為最後一關。" : "預設會停止流程並提示;若設定固定人,找不到主管時會改派給該會員。" : "此改派設定來自較新版本的 BPMCore,本版本無法執行也無法編輯;請升級後再編輯。這裡選擇其他模式會覆寫原設定。",
2432
2436
  label: "無主管時",
2433
2437
  name: "approverFallbackMode",
2434
2438
  required: !0,
2435
- children: /* @__PURE__ */ T(x, {
2439
+ children: /* @__PURE__ */ w(b, {
2436
2440
  clearable: !1,
2437
- onChange: (e) => Z(pi(t, fi(e?.id ?? null) === "DIRECT" ? {
2438
- memberId: "",
2439
- type: "DIRECT"
2440
- } : { type: "NONE" })),
2441
- options: [...hr],
2442
- value: $(hr, f.type)
2441
+ onChange: (e) => {
2442
+ e?.id !== "UNSUPPORTED" && Z(_i(t, gi(e?.id ?? null)));
2443
+ },
2444
+ options: [...m],
2445
+ value: p === null ? $(gr, f.type) : _r
2443
2446
  })
2444
2447
  }),
2445
- f.type === "DIRECT" ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(n, {
2448
+ f.type === "DIRECT" ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(n, {
2446
2449
  label: "改派人員",
2447
2450
  name: "approverFallbackMemberId",
2448
2451
  required: !0,
2449
- children: /* @__PURE__ */ T(g, {
2452
+ children: /* @__PURE__ */ w(_, {
2450
2453
  asyncData: !0,
2451
2454
  disabledOptionsFilter: !0,
2452
2455
  emptyText: "沒有符合的成員",
@@ -2459,42 +2462,75 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2459
2462
  loading: Mt,
2460
2463
  loadingText: "搜尋成員中...",
2461
2464
  mode: "single",
2462
- onChange: (e) => Z(pi(t, {
2465
+ onChange: (e) => Z(_i(t, {
2463
2466
  allowInitiatorSelfApproval: f.allowInitiatorSelfApproval,
2464
2467
  memberId: e?.id ?? "",
2465
2468
  type: "DIRECT"
2466
2469
  })),
2467
- onSearch: J,
2470
+ onSearch: er,
2468
2471
  onVisibilityChange: (e) => {
2469
- e && (It([]), J(""));
2472
+ e && (It([]), er(""));
2470
2473
  },
2471
- options: [...Zi(Ft, m ? [m] : [])],
2474
+ options: [...ta(Ft, g ? [g] : [])],
2472
2475
  placeholder: "搜尋姓名或信箱",
2473
2476
  searchDebounceTime: 300,
2474
- value: m
2477
+ value: g
2475
2478
  })
2476
- }), /* @__PURE__ */ T(n, {
2479
+ }), /* @__PURE__ */ w(n, {
2477
2480
  hintText: "預設禁止申請人簽自己的案件;只有此流程允許自簽時才開啟。",
2478
2481
  label: "允許自簽",
2479
2482
  name: "allowInitiatorSelfApproval",
2480
- children: /* @__PURE__ */ T(S, {
2483
+ children: /* @__PURE__ */ w(x, {
2481
2484
  checked: !!f.allowInitiatorSelfApproval,
2482
2485
  inputProps: {
2483
2486
  id: "allowInitiatorSelfApproval",
2484
2487
  name: "allowInitiatorSelfApproval"
2485
2488
  },
2486
- onChange: (e) => Z(pi(t, {
2489
+ onChange: (e) => Z(_i(t, {
2487
2490
  allowInitiatorSelfApproval: e.target.checked,
2488
2491
  memberId: f.memberId,
2489
2492
  type: "DIRECT"
2490
2493
  }))
2491
2494
  })
2495
+ })] }) : null,
2496
+ f.type === "POSITION" ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(n, {
2497
+ hintText: "指派給目前有效歸屬中擁有此職位的會員;主要歸屬優先。多人時全部成為簽核人,依上方的決策政策處理。",
2498
+ label: "改派職位",
2499
+ name: "approverFallbackPositionId",
2500
+ required: !0,
2501
+ children: /* @__PURE__ */ w(s, {
2502
+ name: "approverFallbackPositionId",
2503
+ onChange: (e) => Z(_i(t, {
2504
+ allowInitiatorSelfApproval: f.allowInitiatorSelfApproval,
2505
+ positionId: e?.id ?? "",
2506
+ type: "POSITION"
2507
+ })),
2508
+ placeholder: "選擇職位",
2509
+ positions: z,
2510
+ value: v
2511
+ })
2512
+ }), /* @__PURE__ */ w(n, {
2513
+ hintText: "預設禁止申請人簽自己的案件;只有此流程允許自簽時才開啟。",
2514
+ label: "允許自簽",
2515
+ name: "allowInitiatorSelfApproval",
2516
+ children: /* @__PURE__ */ w(x, {
2517
+ checked: !!f.allowInitiatorSelfApproval,
2518
+ inputProps: {
2519
+ id: "allowInitiatorSelfApproval",
2520
+ name: "allowInitiatorSelfApproval"
2521
+ },
2522
+ onChange: (e) => Z(_i(t, {
2523
+ allowInitiatorSelfApproval: e.target.checked,
2524
+ positionId: f.positionId,
2525
+ type: "POSITION"
2526
+ }))
2527
+ })
2492
2528
  })] }) : null
2493
2529
  ] }) : null,
2494
- t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
2530
+ t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
2495
2531
  label: "包含下層",
2496
2532
  name: "includeDescendants",
2497
- children: /* @__PURE__ */ T(S, {
2533
+ children: /* @__PURE__ */ w(x, {
2498
2534
  checked: !!t.includeDescendants,
2499
2535
  inputProps: {
2500
2536
  id: "includeDescendants",
@@ -2507,28 +2543,28 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2507
2543
  })
2508
2544
  })
2509
2545
  }) : null,
2510
- t.type === "POSITION" ? /* @__PURE__ */ T(n, {
2546
+ t.type === "POSITION" ? /* @__PURE__ */ w(n, {
2511
2547
  hintText: "指派給目前有效歸屬中擁有此職位的會員;主要歸屬優先。",
2512
2548
  label: "職位",
2513
2549
  name: "positionId",
2514
2550
  required: !0,
2515
- children: /* @__PURE__ */ T(o, {
2551
+ children: /* @__PURE__ */ w(s, {
2516
2552
  name: "positionId",
2517
2553
  onChange: (e) => Z({
2518
2554
  positionId: e?.id ?? "",
2519
2555
  type: "POSITION"
2520
2556
  }),
2521
2557
  placeholder: "選擇職位",
2522
- positions: R,
2558
+ positions: z,
2523
2559
  value: c
2524
2560
  })
2525
2561
  }) : null,
2526
- t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
2562
+ t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
2527
2563
  hintText: "只納入指定組織範圍內擁有此職位的有效會員。",
2528
2564
  label: "職位",
2529
2565
  name: "orgUnitPositionId",
2530
2566
  required: !0,
2531
- children: /* @__PURE__ */ T(o, {
2567
+ children: /* @__PURE__ */ w(s, {
2532
2568
  disabled: !t.orgUnitId.trim(),
2533
2569
  name: "orgUnitPositionId",
2534
2570
  onChange: (e) => Z({
@@ -2542,85 +2578,85 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2542
2578
  value: c
2543
2579
  })
2544
2580
  }) : null,
2545
- /* @__PURE__ */ T(n, {
2581
+ /* @__PURE__ */ w(n, {
2546
2582
  hintText: "決定這一關要幾位簽核者同意才會通過;單人簽核與任一人同意的效果完全相同,皆為其中一人同意即通過。",
2547
2583
  label: "決策方式",
2548
2584
  name: "decisionPolicy",
2549
2585
  required: !0,
2550
- children: /* @__PURE__ */ T(x, {
2586
+ children: /* @__PURE__ */ w(b, {
2551
2587
  clearable: !1,
2552
- onChange: (t) => Ur(Qr(t?.id ?? null, e.data.decisionPolicy)),
2553
- options: [...gt.filter((e) => t.type !== "ORG_MANAGER_CHAIN" || e.id === "SEQUENTIAL" || e.id === "PARALLEL_ALL")],
2554
- value: vt(re)
2588
+ onChange: (t) => Gr(ti(t?.id ?? null, e.data.decisionPolicy)),
2589
+ options: [..._t.filter((e) => t.type !== "ORG_MANAGER_CHAIN" || e.id === "SEQUENTIAL" || e.id === "PARALLEL_ALL")],
2590
+ value: yt(oe)
2555
2591
  })
2556
2592
  }),
2557
- re === "QUORUM" ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(n, {
2593
+ oe === "QUORUM" ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(n, {
2558
2594
  label: "門檻計算方式",
2559
2595
  name: "quorumThresholdType",
2560
2596
  required: !0,
2561
- children: /* @__PURE__ */ T(x, {
2597
+ children: /* @__PURE__ */ w(b, {
2562
2598
  clearable: !1,
2563
- onChange: (e) => Ur({
2564
- threshold: C.threshold,
2565
- thresholdType: ei(e?.id ?? null),
2599
+ onChange: (e) => Gr({
2600
+ threshold: E.threshold,
2601
+ thresholdType: ri(e?.id ?? null),
2566
2602
  type: "QUORUM"
2567
2603
  }),
2568
2604
  options: [...mr],
2569
- value: $(mr, C.thresholdType)
2605
+ value: $(mr, E.thresholdType)
2570
2606
  })
2571
- }), /* @__PURE__ */ T(n, {
2572
- hintText: C.thresholdType === "PERCENTAGE" ? "達到簽核者總數的這個百分比即通過,換算人數時無條件進位;超過 100 的輸入會自動夾至 100。" : "達到這個同意人數即通過;門檻超過實際簽核者人數時,這一關將永遠無法通過,請勿設定超過實際簽核者人數。",
2573
- label: C.thresholdType === "PERCENTAGE" ? "門檻百分比" : "門檻人數",
2607
+ }), /* @__PURE__ */ w(n, {
2608
+ hintText: E.thresholdType === "PERCENTAGE" ? "達到簽核者總數的這個百分比即通過,換算人數時無條件進位;超過 100 的輸入會自動夾至 100。" : "達到這個同意人數即通過;門檻超過實際簽核者人數時,這一關將永遠無法通過,請勿設定超過實際簽核者人數。",
2609
+ label: E.thresholdType === "PERCENTAGE" ? "門檻百分比" : "門檻人數",
2574
2610
  name: "quorumThreshold",
2575
2611
  required: !0,
2576
- children: /* @__PURE__ */ T(y, {
2612
+ children: /* @__PURE__ */ w(te, {
2577
2613
  id: "quorumThreshold",
2578
- inputProps: C.thresholdType === "PERCENTAGE" ? {
2614
+ inputProps: E.thresholdType === "PERCENTAGE" ? {
2579
2615
  max: 100,
2580
2616
  min: 1
2581
2617
  } : { min: 1 },
2582
2618
  inputType: "number",
2583
2619
  name: "quorumThreshold",
2584
- onChange: (e) => Ur({
2585
- threshold: tt(Number(e.target.value), C.thresholdType),
2586
- thresholdType: C.thresholdType,
2620
+ onChange: (e) => Gr({
2621
+ threshold: tt(Number(e.target.value), E.thresholdType),
2622
+ thresholdType: E.thresholdType,
2587
2623
  type: "QUORUM"
2588
2624
  }),
2589
- value: String(C.threshold),
2625
+ value: String(E.threshold),
2590
2626
  variant: "base"
2591
2627
  })
2592
2628
  })] }) : null,
2593
- e.data.returnBehavior.allowReturn ? /* @__PURE__ */ T(n, {
2629
+ e.data.returnBehavior.allowReturn ? /* @__PURE__ */ w(n, {
2594
2630
  hintText: "退回發起人後,重新送出時要從流程開始重跑,或直接回到退回的簽核節點。",
2595
2631
  label: "重送策略",
2596
2632
  name: "returnResubmitStrategy",
2597
2633
  required: !0,
2598
- children: /* @__PURE__ */ T(x, {
2634
+ children: /* @__PURE__ */ w(b, {
2599
2635
  clearable: !1,
2600
- onChange: (e) => Rr(Xr(e?.id ?? null)),
2636
+ onChange: (e) => Br($r(e?.id ?? null)),
2601
2637
  options: [...dr],
2602
- value: $(dr, h)
2638
+ value: $(dr, ee)
2603
2639
  })
2604
2640
  }) : null,
2605
- e.data.returnBehavior.allowReturn ? /* @__PURE__ */ T(n, {
2641
+ e.data.returnBehavior.allowReturn ? /* @__PURE__ */ w(n, {
2606
2642
  hintText: "開啟後,簽核者按下退回時必須填寫意見,未填寫會被擋下。",
2607
2643
  label: "退回時意見必填",
2608
2644
  name: "returnRequireComment",
2609
- children: /* @__PURE__ */ T(S, {
2645
+ children: /* @__PURE__ */ w(x, {
2610
2646
  checked: e.data.returnBehavior.requireComment === !0,
2611
2647
  inputProps: {
2612
2648
  id: "returnRequireComment",
2613
2649
  name: "returnRequireComment"
2614
2650
  },
2615
- onChange: (e) => zr(e.target.checked)
2651
+ onChange: (e) => Vr(e.target.checked)
2616
2652
  })
2617
2653
  }) : null,
2618
- /* @__PURE__ */ T(n, {
2654
+ /* @__PURE__ */ w(n, {
2619
2655
  hintText: "開啟後可設定簽核期限,逾時將依下方設定處理。",
2620
2656
  label: "啟用時效",
2621
2657
  name: "slaEnabled",
2622
- children: /* @__PURE__ */ T(S, {
2623
- checked: !!_,
2658
+ children: /* @__PURE__ */ w(x, {
2659
+ checked: !!y,
2624
2660
  inputProps: {
2625
2661
  id: "slaEnabled",
2626
2662
  name: "slaEnabled"
@@ -2628,171 +2664,171 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2628
2664
  onChange: (e) => Q(e.target.checked ? Ze : null)
2629
2665
  })
2630
2666
  }),
2631
- _ && !b ? /* @__PURE__ */ T(n, {
2667
+ y && !re ? /* @__PURE__ */ w(n, {
2632
2668
  hintText: "此期限混用了日與時,無法在表單中編輯。請改以單一單位設定,或透過 API 維護。",
2633
2669
  label: "時效期限",
2634
2670
  name: "slaDurationRaw",
2635
- children: /* @__PURE__ */ T(y, {
2671
+ children: /* @__PURE__ */ w(te, {
2636
2672
  disabled: !0,
2637
- value: _.duration,
2673
+ value: y.duration,
2638
2674
  variant: "base"
2639
2675
  })
2640
2676
  }) : null,
2641
- _ && b ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(n, {
2677
+ y && re ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(n, {
2642
2678
  label: "時效期限",
2643
2679
  name: "slaDurationValue",
2644
2680
  required: !0,
2645
- children: /* @__PURE__ */ T(y, {
2681
+ children: /* @__PURE__ */ w(te, {
2646
2682
  id: "slaDurationValue",
2647
2683
  inputProps: { min: 1 },
2648
2684
  inputType: "number",
2649
2685
  name: "slaDurationValue",
2650
- onChange: (e) => Q(oi(_, {
2651
- unit: ee,
2686
+ onChange: (e) => Q(li(y, {
2687
+ unit: ie,
2652
2688
  value: Number(e.target.value)
2653
2689
  })),
2654
- value: String(b.value),
2690
+ value: String(re.value),
2655
2691
  variant: "base"
2656
2692
  })
2657
- }), /* @__PURE__ */ T(n, {
2693
+ }), /* @__PURE__ */ w(n, {
2658
2694
  label: "期限單位",
2659
2695
  name: "slaDurationUnit",
2660
2696
  required: !0,
2661
- children: /* @__PURE__ */ T(x, {
2697
+ children: /* @__PURE__ */ w(b, {
2662
2698
  clearable: !1,
2663
- onChange: (e) => Q(oi(_, {
2664
- unit: ti(e?.id ?? null),
2665
- value: b.value
2699
+ onChange: (e) => Q(li(y, {
2700
+ unit: ii(e?.id ?? null),
2701
+ value: re.value
2666
2702
  })),
2667
2703
  options: [...$e],
2668
- value: $($e, ee)
2704
+ value: $($e, ie)
2669
2705
  })
2670
2706
  })] }) : null,
2671
- _ && ee === "DAY" ? /* @__PURE__ */ T(n, {
2707
+ y && ie === "DAY" ? /* @__PURE__ */ w(n, {
2672
2708
  hintText: "工作日會跳過週末與行事曆上的假日,補班日仍計為工作日;行事曆由系統管理者設定。",
2673
2709
  label: "計算方式",
2674
2710
  name: "slaCalendar",
2675
2711
  required: !0,
2676
- children: /* @__PURE__ */ T(x, {
2712
+ children: /* @__PURE__ */ w(b, {
2677
2713
  clearable: !1,
2678
2714
  onChange: (e) => Q({
2679
- ..._,
2680
- calendar: ni(e?.id ?? null)
2715
+ ...y,
2716
+ calendar: ai(e?.id ?? null)
2681
2717
  }),
2682
2718
  options: [...Qe],
2683
- value: $(Qe, _.calendar ?? "CALENDAR")
2719
+ value: $(Qe, y.calendar ?? "CALENDAR")
2684
2720
  })
2685
2721
  }) : null,
2686
- _ ? /* @__PURE__ */ T(n, {
2722
+ y ? /* @__PURE__ */ w(n, {
2687
2723
  label: "逾時處理",
2688
2724
  name: "slaOnTimeout",
2689
2725
  required: !0,
2690
- children: /* @__PURE__ */ T(x, {
2726
+ children: /* @__PURE__ */ w(b, {
2691
2727
  clearable: !1,
2692
- onChange: (e) => Q(si(_, ri(e?.id ?? null))),
2728
+ onChange: (e) => Q(ui(y, oi(e?.id ?? null))),
2693
2729
  options: [...et],
2694
- value: $(et, _.onTimeout)
2730
+ value: $(et, y.onTimeout)
2695
2731
  })
2696
2732
  }) : null,
2697
- _?.onTimeout === "ESCALATE" ? /* @__PURE__ */ T(n, {
2733
+ y?.onTimeout === "ESCALATE" ? /* @__PURE__ */ w(n, {
2698
2734
  hintText: "逾時後改派給簽核者的上層主管,只會升級一次。",
2699
2735
  label: "升級層級",
2700
2736
  name: "slaEscalateLevelsUp",
2701
2737
  required: !0,
2702
- children: /* @__PURE__ */ T(x, {
2738
+ children: /* @__PURE__ */ w(b, {
2703
2739
  clearable: !1,
2704
2740
  onChange: (e) => Q({
2705
- ..._,
2706
- escalateLevelsUp: hi(e?.id ?? null).value
2741
+ ...y,
2742
+ escalateLevelsUp: yi(e?.id ?? null).value
2707
2743
  }),
2708
- options: [...Y],
2709
- value: ne
2744
+ options: [...hr],
2745
+ value: S
2710
2746
  })
2711
2747
  }) : null,
2712
- _ ? /* @__PURE__ */ T(n, {
2748
+ y ? /* @__PURE__ */ w(n, {
2713
2749
  hintText: "在期限到達前先送出一次提醒。",
2714
2750
  label: "預警提醒",
2715
2751
  name: "slaWarningAt",
2716
- children: /* @__PURE__ */ T(x, {
2752
+ children: /* @__PURE__ */ w(b, {
2717
2753
  clearable: !1,
2718
- onChange: (e) => Q(ci(_, ai(e?.id ?? null).value)),
2754
+ onChange: (e) => Q(di(y, ci(e?.id ?? null).value)),
2719
2755
  options: [...fr],
2720
- value: te
2756
+ value: ae
2721
2757
  })
2722
2758
  }) : null,
2723
- /* @__PURE__ */ T(n, {
2759
+ /* @__PURE__ */ w(n, {
2724
2760
  hintText: "關閉後,簽核者在此關卡看不到「拒絕」按鈕。",
2725
2761
  label: "允許拒絕",
2726
2762
  name: "allowReject",
2727
- children: /* @__PURE__ */ T(S, {
2763
+ children: /* @__PURE__ */ w(x, {
2728
2764
  checked: e.data.allowReject,
2729
2765
  inputProps: {
2730
2766
  id: "allowReject",
2731
2767
  name: "allowReject"
2732
2768
  },
2733
- onChange: (e) => Wr({ allowReject: e.target.checked })
2769
+ onChange: (e) => Kr({ allowReject: e.target.checked })
2734
2770
  })
2735
2771
  }),
2736
- /* @__PURE__ */ T(n, {
2772
+ /* @__PURE__ */ w(n, {
2737
2773
  hintText: "關閉後,簽核者無法把此關卡的任務轉派給其他人。",
2738
2774
  label: "允許轉派",
2739
2775
  name: "allowTransfer",
2740
- children: /* @__PURE__ */ T(S, {
2776
+ children: /* @__PURE__ */ w(x, {
2741
2777
  checked: e.data.allowTransfer,
2742
2778
  inputProps: {
2743
2779
  id: "allowTransfer",
2744
2780
  name: "allowTransfer"
2745
2781
  },
2746
- onChange: (e) => Wr({ allowTransfer: e.target.checked })
2782
+ onChange: (e) => Kr({ allowTransfer: e.target.checked })
2747
2783
  })
2748
2784
  }),
2749
- /* @__PURE__ */ T(n, {
2785
+ /* @__PURE__ */ w(n, {
2750
2786
  hintText: "開啟後,簽核者可在此關卡臨時加入其他簽核人;會簽為平行處理,加簽則需等加入者簽完才往下。",
2751
2787
  label: "允許加簽",
2752
2788
  name: "allowAddSigner",
2753
- children: /* @__PURE__ */ T(S, {
2789
+ children: /* @__PURE__ */ w(x, {
2754
2790
  checked: e.data.allowAddSigner,
2755
2791
  inputProps: {
2756
2792
  id: "allowAddSigner",
2757
2793
  name: "allowAddSigner"
2758
2794
  },
2759
- onChange: (e) => Wr({ allowAddSigner: e.target.checked })
2795
+ onChange: (e) => Kr({ allowAddSigner: e.target.checked })
2760
2796
  })
2761
2797
  }),
2762
- /* @__PURE__ */ T(n, {
2798
+ /* @__PURE__ */ w(n, {
2763
2799
  hintText: "開啟後,申請人本人(含其代理人)不會成為此關的簽核人,也不能被轉簽或加簽到此關。",
2764
2800
  label: "申請人不可簽核自己的單",
2765
2801
  name: "excludeInitiator",
2766
- children: /* @__PURE__ */ T(S, {
2767
- checked: !!v,
2802
+ children: /* @__PURE__ */ w(x, {
2803
+ checked: !!ne,
2768
2804
  inputProps: {
2769
2805
  id: "excludeInitiator",
2770
2806
  name: "excludeInitiator"
2771
2807
  },
2772
- onChange: (e) => Hr(e.target.checked ? _r : null)
2808
+ onChange: (e) => Ur(e.target.checked ? yr : null)
2773
2809
  })
2774
2810
  }),
2775
- v ? /* @__PURE__ */ T(n, {
2811
+ ne ? /* @__PURE__ */ w(n, {
2776
2812
  label: "排除後沒有簽核人時",
2777
2813
  name: "excludeInitiatorWhenEmpty",
2778
2814
  required: !0,
2779
- children: /* @__PURE__ */ T(x, {
2815
+ children: /* @__PURE__ */ w(b, {
2780
2816
  clearable: !1,
2781
- onChange: (e) => Hr({ whenEmpty: $(gr, e?.id ?? null)?.id ?? _r.whenEmpty }),
2782
- options: [...gr],
2783
- value: $(gr, v.whenEmpty)
2817
+ onChange: (e) => Ur({ whenEmpty: $(vr, e?.id ?? null)?.id ?? yr.whenEmpty }),
2818
+ options: [...vr],
2819
+ value: $(vr, ne.whenEmpty)
2784
2820
  })
2785
2821
  }) : null
2786
2822
  ] });
2787
2823
  }
2788
- function Gi(e) {
2789
- let t = e.data.action, r = ya(t).map((e) => zi(I, e)), i = t.type === "NOTIFY" && t.recipients.type !== "DIRECT" ? ta(t.recipients, I, L, R, G) : null;
2824
+ function Ki(e) {
2825
+ let t = e.data.action, r = Ca(t).map((e) => Ui(L, e)), i = t.type === "NOTIFY" && t.recipients.type !== "DIRECT" ? aa(t.recipients, L, R, z, Y) : null;
2790
2826
  function a(e) {
2791
2827
  let n = {
2792
2828
  memberIds: [...e],
2793
2829
  type: "DIRECT"
2794
2830
  };
2795
- Gr(t.type === "NOTIFY" ? {
2831
+ qr(t.type === "NOTIFY" ? {
2796
2832
  ...t,
2797
2833
  recipients: n
2798
2834
  } : {
@@ -2802,17 +2838,17 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2802
2838
  });
2803
2839
  }
2804
2840
  function o(e) {
2805
- t.type === "NOTIFY" && Gr({
2841
+ t.type === "NOTIFY" && qr({
2806
2842
  ...t,
2807
2843
  webhooks: e
2808
2844
  });
2809
2845
  }
2810
- return /* @__PURE__ */ E(w, { children: [
2811
- /* @__PURE__ */ T(n, {
2846
+ return /* @__PURE__ */ T(C, { children: [
2847
+ /* @__PURE__ */ w(n, {
2812
2848
  hintText: i ? `目前知會對象為「${i}」;在此選擇成員會改為指定成員。` : t.type === "NOTIFY" ? "可只設定 Webhook,不指定知會對象。" : void 0,
2813
2849
  label: "知會對象",
2814
2850
  name: "notifyMemberIds",
2815
- children: /* @__PURE__ */ T(g, {
2851
+ children: /* @__PURE__ */ w(_, {
2816
2852
  asyncData: !0,
2817
2853
  disabledOptionsFilter: !0,
2818
2854
  emptyText: "沒有符合的成員",
@@ -2820,46 +2856,46 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2820
2856
  loadingText: "搜尋成員中...",
2821
2857
  mode: "multiple",
2822
2858
  onChange: (e) => a(e.map((e) => e.id)),
2823
- onSearch: J,
2859
+ onSearch: er,
2824
2860
  onVisibilityChange: (e) => {
2825
- e && (It([]), J(""));
2861
+ e && (It([]), er(""));
2826
2862
  },
2827
- options: [...Zi(r, Ft)],
2863
+ options: [...ta(r, Ft)],
2828
2864
  overflowStrategy: "wrap",
2829
2865
  placeholder: "搜尋姓名或信箱",
2830
2866
  searchDebounceTime: 300,
2831
2867
  value: [...r]
2832
2868
  })
2833
2869
  }),
2834
- t.type === "NOTIFY" && !Jt(t.webhooks) ? /* @__PURE__ */ E("div", {
2835
- style: U,
2836
- children: [/* @__PURE__ */ T(C, {
2870
+ t.type === "NOTIFY" && !Jt(t.webhooks) ? /* @__PURE__ */ T("div", {
2871
+ style: K,
2872
+ children: [/* @__PURE__ */ w(S, {
2837
2873
  color: "text-warning",
2838
2874
  variant: "body",
2839
2875
  children: "這個節點的 Webhook 設定格式錯誤,無法在此編輯。清除後可重新新增。"
2840
- }), /* @__PURE__ */ T("div", { children: /* @__PURE__ */ T(_, {
2876
+ }), /* @__PURE__ */ w("div", { children: /* @__PURE__ */ w(v, {
2841
2877
  onClick: () => o([]),
2842
2878
  variant: "destructive-secondary",
2843
2879
  children: "清除 Webhook 設定"
2844
2880
  }) })]
2845
2881
  }) : null,
2846
- t.type === "NOTIFY" && Jt(t.webhooks) ? /* @__PURE__ */ T(cn, {
2847
- catalog: rn,
2848
- catalogState: on,
2849
- formFields: G?.fields ?? null,
2882
+ t.type === "NOTIFY" && Jt(t.webhooks) ? /* @__PURE__ */ w(cn, {
2883
+ catalog: nn,
2884
+ catalogState: an,
2885
+ formFields: Y?.fields ?? null,
2850
2886
  onChange: o,
2851
- targets: mt(t)
2887
+ targets: ht(t)
2852
2888
  }) : null
2853
2889
  ] });
2854
2890
  }
2855
- function Ki(e) {
2856
- return /* @__PURE__ */ E("div", {
2857
- style: U,
2858
- children: [/* @__PURE__ */ T(C, {
2891
+ function qi(e) {
2892
+ return /* @__PURE__ */ T("div", {
2893
+ style: K,
2894
+ children: [/* @__PURE__ */ w(S, {
2859
2895
  component: "h2",
2860
2896
  variant: "h3",
2861
2897
  children: "已選取線段"
2862
- }), /* @__PURE__ */ E(C, {
2898
+ }), /* @__PURE__ */ T(S, {
2863
2899
  color: "text-neutral",
2864
2900
  variant: "body",
2865
2901
  children: [
@@ -2870,17 +2906,17 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2870
2906
  })]
2871
2907
  });
2872
2908
  }
2873
- function qi(e) {
2874
- let t = _a(e, A.nodes);
2875
- return /* @__PURE__ */ E("div", {
2876
- style: U,
2909
+ function Yi(e) {
2910
+ let t = xa(e, j.nodes);
2911
+ return /* @__PURE__ */ T("div", {
2912
+ style: K,
2877
2913
  children: [
2878
- /* @__PURE__ */ T(C, {
2914
+ /* @__PURE__ */ w(S, {
2879
2915
  component: "h2",
2880
2916
  variant: "h3",
2881
2917
  children: t ? "條件設定" : "線段屬性"
2882
2918
  }),
2883
- /* @__PURE__ */ E(C, {
2919
+ /* @__PURE__ */ T(S, {
2884
2920
  color: "text-neutral",
2885
2921
  variant: "body",
2886
2922
  children: [
@@ -2889,7 +2925,7 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2889
2925
  e.target
2890
2926
  ]
2891
2927
  }),
2892
- t ? Xi(e) : /* @__PURE__ */ T(C, {
2928
+ t ? Zi(e) : /* @__PURE__ */ w(S, {
2893
2929
  color: "text-neutral",
2894
2930
  variant: "body",
2895
2931
  children: "這條線會直接把流程送到下一個節點。"
@@ -2897,63 +2933,63 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2897
2933
  ]
2898
2934
  });
2899
2935
  }
2900
- function Ji(e) {
2901
- return !e || !_a(e, A.nodes) ? null : /* @__PURE__ */ T(b, {
2936
+ function Xi(e) {
2937
+ return !e || !xa(e, j.nodes) ? null : /* @__PURE__ */ w(y, {
2902
2938
  cancelText: "取消",
2903
2939
  confirmButtonProps: { disabled: !e.data.isDefault && !e.data.condition },
2904
2940
  confirmText: "完成",
2905
2941
  modalType: "standard",
2906
- onCancel: Pr,
2907
- onClose: Pr,
2908
- onConfirm: Pr,
2909
- open: !!ot,
2942
+ onCancel: Ir,
2943
+ onClose: Ir,
2944
+ onConfirm: Ir,
2945
+ open: !!at,
2910
2946
  showModalFooter: !0,
2911
2947
  showModalHeader: !0,
2912
2948
  size: "regular",
2913
2949
  supportingText: "條件分流的輸出連線需要指定條件,條件會直接顯示在線上。",
2914
2950
  title: "條件設定",
2915
- children: Xi(e)
2951
+ children: Zi(e)
2916
2952
  });
2917
2953
  }
2918
- function Xi(e) {
2919
- let t = ha(e, A.nodes), r = la(H?.schema ?? null), i = ua(H?.schema ?? null, e.data.conditionFieldKey ?? null), a = da(i), o = pa(i), s = $(a, e.data.conditionOperator ?? null), c = !e.data.isDefault && !e.data.condition;
2920
- return /* @__PURE__ */ E("div", {
2921
- style: U,
2954
+ function Zi(e) {
2955
+ let t = ya(e, j.nodes), r = pa(G?.schema ?? null), i = ma(G?.schema ?? null, e.data.conditionFieldKey ?? null), a = ha(i), o = _a(i), s = $(a, e.data.conditionOperator ?? null), c = !e.data.isDefault && !e.data.condition;
2956
+ return /* @__PURE__ */ T("div", {
2957
+ style: K,
2922
2958
  children: [
2923
- /* @__PURE__ */ E(C, {
2959
+ /* @__PURE__ */ T(S, {
2924
2960
  color: "text-neutral",
2925
2961
  variant: "body",
2926
2962
  children: [
2927
2963
  "畫布上的這條線目前會顯示「",
2928
- /* @__PURE__ */ T("span", {
2929
- style: { color: c ? Rn : void 0 },
2964
+ /* @__PURE__ */ w("span", {
2965
+ style: { color: c ? Ln : void 0 },
2930
2966
  children: t ?? "請設定條件"
2931
2967
  }),
2932
2968
  "」。"
2933
2969
  ]
2934
2970
  }),
2935
- /* @__PURE__ */ T(S, {
2971
+ /* @__PURE__ */ w(x, {
2936
2972
  checked: !!e.data.isDefault,
2937
2973
  label: "其他情況走這條",
2938
- onChange: (t) => bi(e.id, t.target.checked)
2974
+ onChange: (t) => hi(e.id, t.target.checked)
2939
2975
  }),
2940
- e.data.isDefault ? /* @__PURE__ */ T(C, {
2976
+ e.data.isDefault ? /* @__PURE__ */ w(S, {
2941
2977
  color: "text-neutral",
2942
2978
  variant: "body",
2943
2979
  children: "其他條件都不符合時,流程會走這條線。"
2944
- }) : /* @__PURE__ */ E(w, { children: [
2945
- H ? null : /* @__PURE__ */ T(C, {
2980
+ }) : /* @__PURE__ */ T(C, { children: [
2981
+ G ? null : /* @__PURE__ */ w(S, {
2946
2982
  color: "text-neutral",
2947
2983
  variant: "body",
2948
2984
  children: "請先綁定表單版本,才能選擇條件欄位。"
2949
2985
  }),
2950
- /* @__PURE__ */ T(n, {
2986
+ /* @__PURE__ */ w(n, {
2951
2987
  label: "條件欄位",
2952
2988
  name: "edgeConditionField",
2953
2989
  required: !0,
2954
- children: /* @__PURE__ */ T(x, {
2990
+ children: /* @__PURE__ */ w(b, {
2955
2991
  clearable: !1,
2956
- onChange: (t) => Si({
2992
+ onChange: (t) => xi({
2957
2993
  edgeId: e.id,
2958
2994
  fieldKey: t?.id ?? null,
2959
2995
  operator: null,
@@ -2964,15 +3000,15 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2964
3000
  value: $(r, e.data.conditionFieldKey ?? null)
2965
3001
  })
2966
3002
  }),
2967
- /* @__PURE__ */ T(n, {
3003
+ /* @__PURE__ */ w(n, {
2968
3004
  label: "條件判斷",
2969
3005
  name: "edgeConditionOperator",
2970
3006
  required: !0,
2971
- children: /* @__PURE__ */ T(x, {
3007
+ children: /* @__PURE__ */ w(b, {
2972
3008
  clearable: !1,
2973
- onChange: (t) => Si({
3009
+ onChange: (t) => xi({
2974
3010
  edgeId: e.id,
2975
- operator: fa(t?.id ?? null),
3011
+ operator: ga(t?.id ?? null),
2976
3012
  value: null
2977
3013
  }),
2978
3014
  options: [...a],
@@ -2980,21 +3016,21 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
2980
3016
  value: s
2981
3017
  })
2982
3018
  }),
2983
- s && ma(s.id) ? /* @__PURE__ */ T(n, {
3019
+ s && va(s.id) ? /* @__PURE__ */ w(n, {
2984
3020
  label: "條件值",
2985
3021
  name: "edgeConditionValue",
2986
3022
  required: !0,
2987
- children: o.length > 0 ? /* @__PURE__ */ T(x, {
3023
+ children: o.length > 0 ? /* @__PURE__ */ w(b, {
2988
3024
  clearable: !1,
2989
- onChange: (t) => Si({
3025
+ onChange: (t) => xi({
2990
3026
  edgeId: e.id,
2991
3027
  value: t?.id ?? null
2992
3028
  }),
2993
3029
  options: [...o],
2994
3030
  placeholder: "選擇條件值",
2995
3031
  value: $(o, e.data.conditionValue ?? null)
2996
- }) : /* @__PURE__ */ T(y, {
2997
- onChange: (t) => Si({
3032
+ }) : /* @__PURE__ */ w(te, {
3033
+ onChange: (t) => xi({
2998
3034
  edgeId: e.id,
2999
3035
  value: t.target.value
3000
3036
  }),
@@ -3008,14 +3044,14 @@ function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
3008
3044
  });
3009
3045
  }
3010
3046
  }
3011
- function jr({ onApplyAutoLayout: e }) {
3047
+ function Nr({ onApplyAutoLayout: e }) {
3012
3048
  function t() {
3013
3049
  e();
3014
3050
  }
3015
- return /* @__PURE__ */ T(Pe, {
3051
+ return /* @__PURE__ */ w(Pe, {
3016
3052
  position: "top-right",
3017
- children: /* @__PURE__ */ T(_, {
3018
- icon: se,
3053
+ children: /* @__PURE__ */ w(v, {
3054
+ icon: ce,
3019
3055
  iconType: "leading",
3020
3056
  onClick: t,
3021
3057
  size: "sub",
@@ -3024,15 +3060,15 @@ function jr({ onApplyAutoLayout: e }) {
3024
3060
  })
3025
3061
  });
3026
3062
  }
3027
- function X({ data: e, selected: t, type: n }) {
3028
- let r = e.approverLines ?? [e.approverSummary ?? e.label], i = Mr(e), a = Nr(n, t);
3029
- return /* @__PURE__ */ E("div", {
3063
+ function Pr({ data: e, selected: t, type: n }) {
3064
+ let r = e.approverLines ?? [e.approverSummary ?? e.label], i = Fr(e), a = Ir(n, t);
3065
+ return /* @__PURE__ */ T("div", {
3030
3066
  style: a,
3031
3067
  children: [
3032
- Fr(e),
3033
- /* @__PURE__ */ T("div", {
3068
+ Rr(e),
3069
+ /* @__PURE__ */ w("div", {
3034
3070
  style: ir,
3035
- children: r.map((e, t) => /* @__PURE__ */ T(C, {
3071
+ children: r.map((e, t) => /* @__PURE__ */ w(S, {
3036
3072
  component: "span",
3037
3073
  ellipsis: !0,
3038
3074
  style: rr,
@@ -3041,7 +3077,7 @@ function X({ data: e, selected: t, type: n }) {
3041
3077
  children: e
3042
3078
  }, `${e}_${t}`))
3043
3079
  }),
3044
- /* @__PURE__ */ T(C, {
3080
+ /* @__PURE__ */ w(S, {
3045
3081
  color: "text-neutral",
3046
3082
  component: "span",
3047
3083
  ellipsis: !0,
@@ -3053,106 +3089,106 @@ function X({ data: e, selected: t, type: n }) {
3053
3089
  ]
3054
3090
  });
3055
3091
  }
3056
- function Mr(e) {
3092
+ function Fr(e) {
3057
3093
  return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" : sr[e.nodeKind];
3058
3094
  }
3059
- function Nr(e, t) {
3060
- let n = Pr(e);
3095
+ function Ir(e, t) {
3096
+ let n = Lr(e);
3061
3097
  return t ? {
3062
3098
  ...n,
3063
3099
  border: "1px solid var(--mzn-color-primary, #0057ff)",
3064
- boxShadow: Xn
3100
+ boxShadow: J
3065
3101
  } : n;
3066
3102
  }
3067
- function Pr(e) {
3068
- return e === "exclusiveGateway" ? $n : e === "parallelGateway" ? er : e === "startEvent" ? J : e === "endEvent" ? nr : e === "userTask" ? tr : Yn;
3103
+ function Lr(e) {
3104
+ return e === "exclusiveGateway" ? Qn : e === "parallelGateway" ? $n : e === "startEvent" ? tr : e === "endEvent" ? nr : e === "userTask" ? er : q;
3069
3105
  }
3070
- function Fr(e) {
3071
- return !e.hasInput && e.hasOutput ? /* @__PURE__ */ T(Me, {
3106
+ function Rr(e) {
3107
+ return !e.hasInput && e.hasOutput ? /* @__PURE__ */ w(O, {
3072
3108
  id: or,
3073
- position: O.Right,
3109
+ position: k.Right,
3074
3110
  type: "source"
3075
- }) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ T(Me, {
3111
+ }) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ w(O, {
3076
3112
  id: ar,
3077
- position: O.Left,
3113
+ position: k.Left,
3078
3114
  type: "target"
3079
- }) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ T(Me, {
3115
+ }) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ w(O, {
3080
3116
  id: ar,
3081
- position: O.Left,
3117
+ position: k.Left,
3082
3118
  type: "target"
3083
- }, "target"), /* @__PURE__ */ T(Me, {
3119
+ }, "target"), /* @__PURE__ */ w(O, {
3084
3120
  id: or,
3085
- position: O.Right,
3121
+ position: k.Right,
3086
3122
  type: "source"
3087
3123
  }, "source")];
3088
3124
  }
3089
- function Ir(e, t, n, r, i, a, o) {
3090
- let s = Lr(e);
3125
+ function zr(e, t, n, r, i, a, o) {
3126
+ let s = Z(e);
3091
3127
  return {
3092
3128
  data: {
3093
- approverLines: na(e, t, n, r, o),
3094
- approverSummary: ea(e, t, n, r, o),
3095
- hasInput: Di(e),
3096
- hasOutput: Oi(e),
3097
- initiatorPolicySummary: e.type === "startEvent" ? Si(a, n, r) : null,
3129
+ approverLines: oa(e, t, n, r, o),
3130
+ approverSummary: ia(e, t, n, r, o),
3131
+ hasInput: ji(e),
3132
+ hasOutput: Mi(e),
3133
+ initiatorPolicySummary: e.type === "startEvent" ? Ei(a, n, r) : null,
3098
3134
  label: e.data.label,
3099
3135
  nodeKind: e.type
3100
3136
  },
3101
3137
  height: s.height,
3102
- handles: Z(e),
3138
+ handles: Br(e),
3103
3139
  id: e.id,
3104
3140
  initialHeight: s.height,
3105
3141
  initialWidth: s.width,
3106
3142
  position: e.position,
3107
3143
  selected: i,
3108
- sourcePosition: O.Right,
3109
- targetPosition: O.Left,
3144
+ sourcePosition: k.Right,
3145
+ targetPosition: k.Left,
3110
3146
  type: e.type,
3111
3147
  width: s.width
3112
3148
  };
3113
3149
  }
3114
- function Lr(e) {
3150
+ function Z(e) {
3115
3151
  return e.type === "exclusiveGateway" || e.type === "parallelGateway" ? {
3116
- height: Qn,
3117
- width: K
3152
+ height: X,
3153
+ width: Xn
3118
3154
  } : e.type === "serviceTask" ? {
3119
- height: W + (ra(e.data.action) - 1) * Zn,
3120
- width: G
3155
+ height: Y + (sa(e.data.action) - 1) * Yn,
3156
+ width: Jn
3121
3157
  } : {
3122
- height: W,
3123
- width: G
3158
+ height: Y,
3159
+ width: Jn
3124
3160
  };
3125
3161
  }
3126
- function Z(e) {
3127
- let t = Lr(e);
3128
- return [...Di(e) ? [Rr(t)] : [], ...Oi(e) ? [zr(t)] : []];
3162
+ function Br(e) {
3163
+ let t = Z(e);
3164
+ return [...ji(e) ? [Vr(t)] : [], ...Mi(e) ? [Q(t)] : []];
3129
3165
  }
3130
- function Rr({ height: e }) {
3166
+ function Vr({ height: e }) {
3131
3167
  let t = e / 2 - 9 / 2;
3132
3168
  return {
3133
3169
  height: 9,
3134
3170
  id: ar,
3135
- position: O.Left,
3171
+ position: k.Left,
3136
3172
  type: "target",
3137
3173
  width: 9,
3138
3174
  x: -9 / 2,
3139
3175
  y: t
3140
3176
  };
3141
3177
  }
3142
- function zr({ height: e, width: t }) {
3178
+ function Q({ height: e, width: t }) {
3143
3179
  let n = e / 2 - 9 / 2;
3144
3180
  return {
3145
3181
  height: 9,
3146
3182
  id: or,
3147
- position: O.Right,
3183
+ position: k.Right,
3148
3184
  type: "source",
3149
3185
  width: 9,
3150
3186
  x: t - 9 / 2,
3151
3187
  y: n
3152
3188
  };
3153
3189
  }
3154
- function Br(e, t, n) {
3155
- let r = ha(e, t), i = _a(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? Rn : i ? Ln : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", c = a ? Rn : i ? Ln : H;
3190
+ function Hr(e, t, n) {
3191
+ let r = ya(e, t), i = xa(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? Ln : i ? G : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", c = a ? Ln : i ? G : In;
3156
3192
  return {
3157
3193
  className: n ? "workflow-edge--selected" : void 0,
3158
3194
  data: e.data,
@@ -3175,9 +3211,9 @@ function Br(e, t, n) {
3175
3211
  source: e.source,
3176
3212
  sourceHandle: e.sourceHandle,
3177
3213
  style: {
3178
- filter: n ? zn : void 0,
3214
+ filter: n ? Rn : void 0,
3179
3215
  opacity: 1,
3180
- stroke: H,
3216
+ stroke: In,
3181
3217
  strokeOpacity: 1,
3182
3218
  strokeWidth: 1.5
3183
3219
  },
@@ -3186,7 +3222,7 @@ function Br(e, t, n) {
3186
3222
  type: e.type ?? "smoothstep"
3187
3223
  };
3188
3224
  }
3189
- function Q(e, t) {
3225
+ function Ur(e, t) {
3190
3226
  return e.type === "startEvent" ? e : (e.type === "endEvent" || e.type === "userTask" || e.type === "serviceTask" || e.type, {
3191
3227
  ...e,
3192
3228
  data: {
@@ -3195,10 +3231,10 @@ function Q(e, t) {
3195
3231
  }
3196
3232
  });
3197
3233
  }
3198
- function Vr(e) {
3199
- return Gr(Ur(Wr(Hr(e))));
3234
+ function Wr(e) {
3235
+ return Jr(Kr(qr(Gr(e))));
3200
3236
  }
3201
- function Hr(e) {
3237
+ function Gr(e) {
3202
3238
  let t = e.edges.map((e) => {
3203
3239
  let t = e.data ?? {};
3204
3240
  return e.data === t ? e : {
@@ -3211,7 +3247,7 @@ function Hr(e) {
3211
3247
  edges: t
3212
3248
  } : e;
3213
3249
  }
3214
- function Ur(e) {
3250
+ function Kr(e) {
3215
3251
  let t = e.nodes.map((e) => {
3216
3252
  if (e.type !== "userTask") return e;
3217
3253
  let t = e.data.allowAddSigner ?? !1, n = e.data.allowReject ?? !0, r = e.data.allowTransfer ?? !0, i = !e.data.decisionPolicy;
@@ -3231,24 +3267,24 @@ function Ur(e) {
3231
3267
  nodes: t
3232
3268
  } : e;
3233
3269
  }
3234
- function Wr(e) {
3235
- let t = new Set(e.nodes.filter((e) => ki(e)).map((e) => e.id)), n = e.edges.filter((e) => !t.has(e.source));
3270
+ function qr(e) {
3271
+ let t = new Set(e.nodes.filter((e) => Ni(e)).map((e) => e.id)), n = e.edges.filter((e) => !t.has(e.source));
3236
3272
  return n.length === e.edges.length ? e : {
3237
3273
  ...e,
3238
3274
  edges: n
3239
3275
  };
3240
3276
  }
3241
- function Gr(e) {
3277
+ function Jr(e) {
3242
3278
  let t = e.edges.reduce((e, t) => ({
3243
3279
  ...e,
3244
3280
  [t.target]: (e[t.target] ?? 0) + 1
3245
- }), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? Q(e, "AND") : e);
3281
+ }), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? Ur(e, "AND") : e);
3246
3282
  return n.some((t, n) => t !== e.nodes[n]) ? {
3247
3283
  ...e,
3248
3284
  nodes: n
3249
3285
  } : e;
3250
3286
  }
3251
- function Kr() {
3287
+ function Yr() {
3252
3288
  return {
3253
3289
  edges: [],
3254
3290
  meta: { schemaVersion: 1 },
@@ -3275,16 +3311,16 @@ function Kr() {
3275
3311
  }]
3276
3312
  };
3277
3313
  }
3278
- function qr(e) {
3314
+ function Xr(e) {
3279
3315
  return e.edges.length === 0 && e.nodes.length === 2 && e.nodes.some((e) => e.type === "startEvent") && e.nodes.some((e) => e.type === "endEvent");
3280
3316
  }
3281
- function Jr(e) {
3317
+ function Zr(e) {
3282
3318
  let t = new Re.graphlib.Graph();
3283
3319
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
3284
3320
  rankdir: "LR",
3285
3321
  ranksep: 120
3286
3322
  }), e.nodes.forEach((e) => {
3287
- t.setNode(e.id, Lr(e));
3323
+ t.setNode(e.id, Z(e));
3288
3324
  }), e.edges.forEach((e) => {
3289
3325
  t.setEdge(e.source, e.target);
3290
3326
  }), Re.layout(t), {
@@ -3294,8 +3330,8 @@ function Jr(e) {
3294
3330
  return n ? {
3295
3331
  ...e,
3296
3332
  position: {
3297
- x: n.x - Lr(e).width / 2,
3298
- y: n.y - Lr(e).height / 2
3333
+ x: n.x - Z(e).width / 2,
3334
+ y: n.y - Z(e).height / 2
3299
3335
  }
3300
3336
  } : e;
3301
3337
  })
@@ -3304,51 +3340,51 @@ function Jr(e) {
3304
3340
  function $(e, t) {
3305
3341
  return t ? e.find((e) => e.id === t) ?? null : null;
3306
3342
  }
3307
- function Yr(e) {
3343
+ function Qr(e) {
3308
3344
  return e === "OR" ? "OR" : "AND";
3309
3345
  }
3310
- function Xr(e) {
3346
+ function $r(e) {
3311
3347
  return e === "FROM_RETURN_POINT" ? "FROM_RETURN_POINT" : "RESTART";
3312
3348
  }
3313
- function Zr(e) {
3349
+ function ei(e) {
3314
3350
  return e?.type ?? "SINGLE";
3315
3351
  }
3316
- function Qr(e, t) {
3352
+ function ti(e, t) {
3317
3353
  return e === "QUORUM" ? t?.type === "QUORUM" ? t : {
3318
- threshold: Xe,
3354
+ threshold: A,
3319
3355
  thresholdType: "COUNT",
3320
3356
  type: "QUORUM"
3321
3357
  } : e === "PARALLEL_ALL" || e === "PARALLEL_ANY" || e === "SEQUENTIAL" ? { type: e } : { type: "SINGLE" };
3322
3358
  }
3323
- function $r(e) {
3359
+ function ni(e) {
3324
3360
  return e?.type === "QUORUM" ? {
3325
- threshold: Number.isFinite(e.threshold) ? e.threshold : Xe,
3326
- thresholdType: ei(e.thresholdType ?? null)
3361
+ threshold: Number.isFinite(e.threshold) ? e.threshold : A,
3362
+ thresholdType: ri(e.thresholdType ?? null)
3327
3363
  } : {
3328
- threshold: Xe,
3364
+ threshold: A,
3329
3365
  thresholdType: "COUNT"
3330
3366
  };
3331
3367
  }
3332
- function ei(e) {
3368
+ function ri(e) {
3333
3369
  return e === "PERCENTAGE" ? "PERCENTAGE" : "COUNT";
3334
3370
  }
3335
- function ti(e) {
3371
+ function ii(e) {
3336
3372
  return e === "HOUR" ? "HOUR" : "DAY";
3337
3373
  }
3338
- function ni(e) {
3374
+ function ai(e) {
3339
3375
  return e === "BUSINESS_DAY" ? "BUSINESS_DAY" : "CALENDAR";
3340
3376
  }
3341
- function ri(e) {
3377
+ function oi(e) {
3342
3378
  return et.find((t) => t.id === e)?.id ?? "REMIND";
3343
3379
  }
3344
- function ii(e) {
3380
+ function si(e) {
3345
3381
  return fr.find((t) => t.value === e) ?? fr[0];
3346
3382
  }
3347
- function ai(e) {
3383
+ function ci(e) {
3348
3384
  return fr.find((t) => t.id === e) ?? fr[0];
3349
3385
  }
3350
- function oi(e, t) {
3351
- let n = Number.isFinite(t.value) ? Math.trunc(t.value) : 1, r = j({
3386
+ function li(e, t) {
3387
+ let n = Number.isFinite(t.value) ? Math.trunc(t.value) : 1, r = N({
3352
3388
  unit: t.unit,
3353
3389
  value: n
3354
3390
  });
@@ -3358,30 +3394,30 @@ function oi(e, t) {
3358
3394
  duration: r
3359
3395
  };
3360
3396
  }
3361
- function si(e, t) {
3397
+ function ui(e, t) {
3362
3398
  return t === "ESCALATE" ? {
3363
3399
  ...e,
3364
3400
  escalateLevelsUp: e.escalateLevelsUp ?? 1,
3365
3401
  onTimeout: t
3366
3402
  } : {
3367
- ...li(e, "escalateLevelsUp"),
3403
+ ...fi(e, "escalateLevelsUp"),
3368
3404
  onTimeout: t
3369
3405
  };
3370
3406
  }
3371
- function ci(e, t) {
3372
- return t === null ? li(e, "warningAt") : {
3407
+ function di(e, t) {
3408
+ return t === null ? fi(e, "warningAt") : {
3373
3409
  ...e,
3374
3410
  warningAt: t
3375
3411
  };
3376
3412
  }
3377
- function li(e, t) {
3413
+ function fi(e, t) {
3378
3414
  return Object.fromEntries(Object.entries(e).filter(([e]) => e !== t));
3379
3415
  }
3380
- function ui(e) {
3416
+ function pi(e) {
3381
3417
  return e === "DYNAMIC_FORM" || e === "ORG_MANAGER" || e === "ORG_MANAGER_CHAIN" || e === "ORG_UNIT_MANAGER" || e === "ORG_UNIT_MEMBER" || e === "ORG_UNIT_POSITION" || e === "POSITION" ? e : "DIRECT";
3382
3418
  }
3383
- function di(e, t) {
3384
- let n = ui(e ?? "DIRECT");
3419
+ function mi(e, t) {
3420
+ let n = pi(e ?? "DIRECT");
3385
3421
  return n === "DYNAMIC_FORM" ? {
3386
3422
  formPath: "",
3387
3423
  type: "DYNAMIC_FORM"
@@ -3390,7 +3426,7 @@ function di(e, t) {
3390
3426
  levelsUp: 1,
3391
3427
  type: "ORG_MANAGER"
3392
3428
  } : n === "ORG_MANAGER_CHAIN" ? {
3393
- minPositionLevel: Bt(t),
3429
+ minPositionLevel: R(t),
3394
3430
  type: "ORG_MANAGER_CHAIN"
3395
3431
  } : n === "ORG_UNIT_MANAGER" ? {
3396
3432
  orgUnitId: "",
@@ -3412,31 +3448,41 @@ function di(e, t) {
3412
3448
  type: "DIRECT"
3413
3449
  };
3414
3450
  }
3415
- function fi(e) {
3416
- return e === "DIRECT" ? "DIRECT" : "NONE";
3451
+ function hi(e) {
3452
+ return e === "DIRECT" || e === "POSITION" ? e : "NONE";
3453
+ }
3454
+ function gi(e) {
3455
+ let t = hi(e);
3456
+ return t === "DIRECT" ? {
3457
+ memberId: "",
3458
+ type: "DIRECT"
3459
+ } : t === "POSITION" ? {
3460
+ positionId: "",
3461
+ type: "POSITION"
3462
+ } : { type: "NONE" };
3417
3463
  }
3418
- function pi(e, t) {
3464
+ function _i(e, t) {
3419
3465
  return e.type === "ORG_MANAGER" || e.type === "ORG_MANAGER_CHAIN" || e.type === "ORG_UNIT_MANAGER" ? {
3420
3466
  ...e,
3421
3467
  fallback: t
3422
3468
  } : e;
3423
3469
  }
3424
- function mi(e) {
3425
- return Y.find((t) => t.value === e) ?? Y[0];
3470
+ function vi(e) {
3471
+ return hr.find((t) => t.value === e) ?? hr[0];
3426
3472
  }
3427
- function hi(e) {
3428
- return Y.find((t) => t.id === e) ?? Y[0];
3473
+ function yi(e) {
3474
+ return hr.find((t) => t.id === e) ?? hr[0];
3429
3475
  }
3430
- function gi(e) {
3476
+ function bi(e) {
3431
3477
  return e === "ORG_UNIT" || e === "ORG_UNIT_POSITION" || e === "NONE" ? e : "ALL";
3432
3478
  }
3433
- function _i(e) {
3479
+ function xi(e) {
3434
3480
  let t = e?.trim();
3435
3481
  if (!t) return {
3436
3482
  mode: "ALL",
3437
3483
  value: ""
3438
3484
  };
3439
- let n = bi(t, /"([^"]+)" in subject\.orgUnitIds/gu), r = bi(t, /"([^"]+)" in subject\.positionIds/gu);
3485
+ let n = wi(t, /"([^"]+)" in subject\.orgUnitIds/gu), r = wi(t, /"([^"]+)" in subject\.positionIds/gu);
3440
3486
  return n.length > 0 && r.length > 0 ? {
3441
3487
  includeDescendants: n.length > 1,
3442
3488
  mode: "ORG_UNIT_POSITION",
@@ -3453,32 +3499,32 @@ function _i(e) {
3453
3499
  value: t
3454
3500
  };
3455
3501
  }
3456
- function vi(e, t) {
3457
- let n = _i(e);
3502
+ function Si(e, t) {
3503
+ let n = xi(e);
3458
3504
  return !t || t === "ALL" || t === "NONE" ? t === "ALL" || t === "NONE" ? {
3459
3505
  mode: t,
3460
3506
  value: ""
3461
- } : n : n.mode === t ? n : Ci(t);
3507
+ } : n : n.mode === t ? n : Di(t);
3462
3508
  }
3463
- function yi(e) {
3509
+ function Ci(e) {
3464
3510
  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;
3465
3511
  }
3466
- function bi(e, t) {
3512
+ function wi(e, t) {
3467
3513
  return [...e.matchAll(t)].map((e) => e[1]).filter((e) => !!e);
3468
3514
  }
3469
- function xi(e, t) {
3515
+ function Ti(e, t) {
3470
3516
  if (e.mode === "ALL" || e.mode === "NONE") return null;
3471
3517
  let n = e.orgUnitId?.trim() ?? "";
3472
3518
  if (!n) return null;
3473
- let r = Xi(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
3519
+ let r = ea(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
3474
3520
  if (e.mode === "ORG_UNIT") return r ? `(${r})` : null;
3475
3521
  let i = e.positionId?.trim() ?? "";
3476
3522
  return i && r ? `(${r}) && ${JSON.stringify(i)} in subject.positionIds` : null;
3477
3523
  }
3478
- function Si(e, t, n) {
3479
- return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${Hi(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${Hi(t, e.orgUnitId)} / ${Ui(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
3524
+ function Ei(e, t, n) {
3525
+ return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${Ki(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${Ki(t, e.orgUnitId)} / ${qi(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
3480
3526
  }
3481
- function Ci(e) {
3527
+ function Di(e) {
3482
3528
  return {
3483
3529
  includeDescendants: !0,
3484
3530
  mode: e,
@@ -3487,64 +3533,64 @@ function Ci(e) {
3487
3533
  value: ""
3488
3534
  };
3489
3535
  }
3490
- function wi(e, t) {
3536
+ function Oi(e, t) {
3491
3537
  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;
3492
- return !!n && !!r && e.source !== e.target && e.sourceHandle === or && e.targetHandle === ar && !!(n && Oi(n)) && !!(r && Di(r));
3538
+ return !!n && !!r && e.source !== e.target && e.sourceHandle === or && e.targetHandle === ar && !!(n && Mi(n)) && !!(r && ji(r));
3493
3539
  }
3494
- function Ti(e, t) {
3540
+ function ki(e, t) {
3495
3541
  return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
3496
3542
  }
3497
- function Ei(e) {
3543
+ function Ai(e) {
3498
3544
  return e.type !== "startEvent" && e.type !== "endEvent";
3499
3545
  }
3500
- function Di(e) {
3546
+ function ji(e) {
3501
3547
  return e.type !== "startEvent";
3502
3548
  }
3503
- function Oi(e) {
3504
- return e.type !== "endEvent" && !ki(e);
3549
+ function Mi(e) {
3550
+ return e.type !== "endEvent" && !Ni(e);
3505
3551
  }
3506
- function ki(e) {
3552
+ function Ni(e) {
3507
3553
  return e.type === "serviceTask" && e.data.action.type === "NOTIFY";
3508
3554
  }
3509
- function Ai(e) {
3555
+ function Pi(e) {
3510
3556
  return e instanceof HTMLElement ? e.isContentEditable || e.tagName === "INPUT" || e.tagName === "TEXTAREA" || e.tagName === "SELECT" || !!e.closest("[contenteditable=\"true\"]") : !1;
3511
3557
  }
3512
- function ji(e) {
3558
+ function Fi(e) {
3513
3559
  return e.map((e) => ({
3514
3560
  formDefinitionId: e.formDefinitionId,
3515
3561
  formName: e.formName,
3516
3562
  id: e.id,
3517
- name: kn(e.formName, e.version),
3563
+ name: W(e.formName, e.version),
3518
3564
  schema: e.schema
3519
3565
  }));
3520
3566
  }
3521
- function Mi(e) {
3567
+ function Ii(e) {
3522
3568
  let t = JSON.parse(e);
3523
- if (!Ni(t)) throw Error("表單資料 JSON 必須是物件。");
3569
+ if (!Li(t)) throw Error("表單資料 JSON 必須是物件。");
3524
3570
  return t;
3525
3571
  }
3526
- function Ni(e) {
3572
+ function Li(e) {
3527
3573
  return typeof e == "object" && !!e && !Array.isArray(e);
3528
3574
  }
3529
- function Pi(e) {
3575
+ function Ri(e) {
3530
3576
  return e === "COMPLETED" ? "完成" : e === "PASSED" ? "通過" : e === "SKIPPED" ? "略過" : e === "STOPPED" ? "已停止" : e === "WAITING" ? "將等待簽核" : e;
3531
3577
  }
3532
- function Fi(e) {
3578
+ function zi(e) {
3533
3579
  return e in sr ? sr[e] : e;
3534
3580
  }
3535
- function Ii(e, t) {
3581
+ function Bi(e, t) {
3536
3582
  return t && !e.some((e) => e.id === t.id) ? [t, ...e] : e;
3537
3583
  }
3538
- function Li(e) {
3584
+ function Vi(e) {
3539
3585
  return e.map((e) => ({
3540
3586
  displayName: e.name,
3541
3587
  email: e.email,
3542
3588
  id: e.memberId,
3543
3589
  memberId: e.memberId,
3544
- name: oa(e.name, e.email)
3590
+ name: ua(e.name, e.email)
3545
3591
  }));
3546
3592
  }
3547
- function Ri(e) {
3593
+ function Hi(e) {
3548
3594
  return {
3549
3595
  displayName: "未知會員",
3550
3596
  email: "",
@@ -3554,101 +3600,101 @@ function Ri(e) {
3554
3600
  unresolved: !0
3555
3601
  };
3556
3602
  }
3557
- function zi(e, t) {
3558
- return e.find((e) => e.memberId === t) ?? Ri(t);
3603
+ function Ui(e, t) {
3604
+ return e.find((e) => e.memberId === t) ?? Hi(t);
3559
3605
  }
3560
- function Bi(e, t) {
3606
+ function Wi(e, t) {
3561
3607
  let n = e.find((e) => e.id === t);
3562
- return n ? r(n) : null;
3608
+ return n ? i(n) : null;
3563
3609
  }
3564
- function Vi(e, t) {
3610
+ function Gi(e, t) {
3565
3611
  let n = e.find((e) => e.id === t);
3566
- return n ? a(n) : null;
3612
+ return n ? o(n) : null;
3567
3613
  }
3568
- function Hi(e, t) {
3569
- return Bi(e, t)?.name ?? "未指定組織";
3614
+ function Ki(e, t) {
3615
+ return Wi(e, t)?.name ?? "未指定組織";
3570
3616
  }
3571
- function Ui(e, t) {
3572
- return Vi(e, t)?.name ?? "未指定職位";
3617
+ function qi(e, t) {
3618
+ return Gi(e, t)?.name ?? "未指定職位";
3573
3619
  }
3574
- function Wi(e, t) {
3575
- let n = Gi(), r = t.filter((t) => t.memberId === e && Ki(t, n)), i = r.reduce((e, t) => e && qi(e, t) <= 0 ? e : t, null);
3620
+ function Ji(e, t) {
3621
+ let n = Yi(), r = t.filter((t) => t.memberId === e && Xi(t, n)), i = r.reduce((e, t) => e && Zi(e, t) <= 0 ? e : t, null);
3576
3622
  return {
3577
3623
  customFields: {},
3578
3624
  managerMemberId: "member-002",
3579
3625
  memberId: e,
3580
3626
  orgCode: "HQ",
3581
- orgUnitIds: Ji(r.map((e) => e.orgUnitId)),
3627
+ orgUnitIds: Qi(r.map((e) => e.orgUnitId)),
3582
3628
  positionId: i?.positionId ?? null,
3583
- positionIds: Ji(r.map((e) => e.positionId)),
3629
+ positionIds: Qi(r.map((e) => e.positionId)),
3584
3630
  primaryOrgUnitId: i?.orgUnitId ?? null,
3585
3631
  roles: ["manager"]
3586
3632
  };
3587
3633
  }
3588
- function Gi() {
3634
+ function Yi() {
3589
3635
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
3590
3636
  }
3591
- function Ki(e, t) {
3637
+ function Xi(e, t) {
3592
3638
  return e.effectiveFrom <= t && (!e.effectiveTo || e.effectiveTo >= t);
3593
3639
  }
3594
- function qi(e, t) {
3640
+ function Zi(e, t) {
3595
3641
  return e.isPrimary === t.isPrimary ? t.effectiveFrom.localeCompare(e.effectiveFrom) : e.isPrimary ? -1 : 1;
3596
3642
  }
3597
- function Ji(e) {
3643
+ function Qi(e) {
3598
3644
  return e.reduce((e, t) => t && !e.includes(t) ? [...e, t] : e, []);
3599
3645
  }
3600
- function Yi({ includeDescendants: e, memberships: t, orgUnitId: n, orgUnits: r, positions: i }) {
3601
- let a = new Set(Xi(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
3646
+ function $i({ includeDescendants: e, memberships: t, orgUnitId: n, orgUnits: r, positions: i }) {
3647
+ let a = new Set(ea(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
3602
3648
  return i.filter((e) => o.has(e.id));
3603
3649
  }
3604
- function Xi(e, t, n) {
3650
+ function ea(e, t, n) {
3605
3651
  let r = e.find((e) => e.id === t);
3606
3652
  return r ? n ? e.filter((e) => e.id === r.id || e.path.startsWith(`${r.path}.`)).map((e) => e.id) : [r.id] : t.trim() ? [t] : [];
3607
3653
  }
3608
- function Zi(e, t) {
3654
+ function ta(e, t) {
3609
3655
  let n = new Map(t.filter((e) => !e.unresolved).map((e) => [e.memberId, e])), r = new Set(e.map((e) => e.memberId)), i = t.filter((e) => !r.has(e.memberId)), a = e.map((e) => (e.unresolved ? n.get(e.memberId) : null) ?? e);
3610
3656
  return i.length > 0 || a.some((t, n) => t !== e[n]) ? [...a, ...i] : e;
3611
3657
  }
3612
- function Qi(e) {
3658
+ function na(e) {
3613
3659
  return e.type === "DIRECT" ? e.memberIds : (e.type === "ORG_MANAGER" || e.type === "ORG_MANAGER_CHAIN" || e.type === "ORG_UNIT_MANAGER") && e.fallback?.type === "DIRECT" && e.fallback.memberId ? [e.fallback.memberId] : [];
3614
3660
  }
3615
- function $i(e) {
3616
- return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ? Qi(e.data.approverResolver) : e.type === "serviceTask" ? ya(e.data.action) : []))];
3661
+ function ra(e) {
3662
+ return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ? na(e.data.approverResolver) : e.type === "serviceTask" ? Ca(e.data.action) : []))];
3617
3663
  }
3618
- function ea(e, t, n, r, i) {
3619
- return e.type === "userTask" ? ta(e.data.approverResolver, t, n, r, i) : null;
3664
+ function ia(e, t, n, r, i) {
3665
+ return e.type === "userTask" ? aa(e.data.approverResolver, t, n, r, i) : null;
3620
3666
  }
3621
- function ta(e, t, n, r, i) {
3622
- return e.type === "DIRECT" ? aa(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? mi(e.levelsUp).name : e.type === "ORG_MANAGER_CHAIN" ? `主管鏈:簽到職等 ${e.minPositionLevel}` : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${Hi(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${Hi(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${Hi(n, e.orgUnitId)} / ${Ui(r, e.positionId)}` : e.type === "POSITION" ? `職位:${Ui(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? Dn(i, e.formPath) : "自訂表達式";
3667
+ function aa(e, t, n, r, i) {
3668
+ return e.type === "DIRECT" ? la(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? vi(e.levelsUp).name : e.type === "ORG_MANAGER_CHAIN" ? `主管鏈:簽到職等 ${e.minPositionLevel}` : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${Ki(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${Ki(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${Ki(n, e.orgUnitId)} / ${qi(r, e.positionId)}` : e.type === "POSITION" ? `職位:${qi(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? En(i, e.formPath) : "自訂表達式";
3623
3669
  }
3624
- function na(e, t, n, r, i) {
3670
+ function oa(e, t, n, r, i) {
3625
3671
  if (e.type !== "serviceTask") return null;
3626
- let a = e.data.action, o = a.type === "NOTIFY" && a.recipients.type !== "DIRECT" ? [ta(a.recipients, t, n, r, i)] : ya(a).map((e) => zi(t, e).name), s = mt(a).length, c = [...o, ...s ? [`Webhook ${s} 個`] : []];
3672
+ let a = e.data.action, o = a.type === "NOTIFY" && a.recipients.type !== "DIRECT" ? [aa(a.recipients, t, n, r, i)] : Ca(a).map((e) => Ui(t, e).name), s = ht(a).length, c = [...o, ...s ? [`Webhook ${s} 個`] : []];
3627
3673
  return c.length ? c : ["未指定知會對象"];
3628
3674
  }
3629
- function ra(e) {
3630
- let t = e.type === "NOTIFY" && e.recipients.type !== "DIRECT" ? 1 : ya(e).length, n = +!!mt(e).length;
3675
+ function sa(e) {
3676
+ let t = e.type === "NOTIFY" && e.recipients.type !== "DIRECT" ? 1 : Ca(e).length, n = +!!ht(e).length;
3631
3677
  return Math.max(1, t + n);
3632
3678
  }
3633
- function ia(e, t, n) {
3679
+ function ca(e, t, n) {
3634
3680
  let r = e.nodes.find((e) => e.id === t);
3635
- return r?.type === "serviceTask" && r.data.action.type === "NOTIFY" && Jt(r.data.action.webhooks) ? mt(r.data.action).map((e) => ({
3681
+ return r?.type === "serviceTask" && r.data.action.type === "NOTIFY" && Jt(r.data.action.webhooks) ? ht(r.data.action).map((e) => ({
3636
3682
  key: e.id,
3637
- label: Ht(n, e.endpoint)?.label ?? R(e.endpoint)
3683
+ label: Ht(n, e.endpoint)?.label ?? B(e.endpoint)
3638
3684
  })) : [];
3639
3685
  }
3640
- function aa(e, t, n) {
3641
- let r = e.map((e) => zi(t, e).name);
3686
+ function la(e, t, n) {
3687
+ let r = e.map((e) => Ui(t, e).name);
3642
3688
  return r.length === 0 ? n : r.length <= 2 ? r.join("、") : `${r.slice(0, 2).join("、")} 等 ${r.length} 人`;
3643
3689
  }
3644
- function oa(e, t) {
3645
- return `${e} (${t})`;
3690
+ function ua(e, t) {
3691
+ return r(e, t);
3646
3692
  }
3647
- function sa(e, t) {
3693
+ function da(e, t) {
3648
3694
  let n = t?.getBoundingClientRect();
3649
3695
  if (!n || e.nodes.length === 0) return null;
3650
3696
  let r = e.nodes.reduce((e, t) => {
3651
- let n = Lr(t);
3697
+ let n = Z(t);
3652
3698
  return {
3653
3699
  maxX: Math.max(e.maxX, t.position.x + n.width),
3654
3700
  maxY: Math.max(e.maxY, t.position.y + n.height),
@@ -3668,64 +3714,64 @@ function sa(e, t) {
3668
3714
  y: r.minY
3669
3715
  }, n.width, n.height, .1, 1, .2);
3670
3716
  }
3671
- function ca(e) {
3672
- let t = e.nodes.find((e) => e.type === "userTask" && !!ot(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "userTask" && !!lt(e.data.excludeInitiator)), r = e.nodes.map((e) => ut(e)).find((e) => e !== null) ?? null, i = e.edges.find((t) => _a(t, e.nodes) && !t.data.isDefault && !t.data.condition), a = e.nodes.find((e) => e.type === "userTask" && at(e.data.approverResolver, e.data.decisionPolicy));
3673
- return t && t.type === "userTask" ? ot(t.data.approverResolver) : a && a.type === "userTask" ? `簽核節點「${a.data.label}」使用「沿主管鏈簽核」時,決策方式必須是「依序簽核或全部同意」,否則任一位主管簽完就會結案。` : n && n.type === "userTask" ? lt(n.data.excludeInitiator) : r || (i ? "條件分流的每條輸出連線都需要先設定條件。" : null);
3717
+ function fa(e) {
3718
+ let t = e.nodes.find((e) => e.type === "userTask" && !!st(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "userTask" && !!ut(e.data.excludeInitiator)), r = e.nodes.map((e) => dt(e)).find((e) => e !== null) ?? null, i = e.edges.find((t) => xa(t, e.nodes) && !t.data.isDefault && !t.data.condition), a = e.nodes.find((e) => e.type === "userTask" && ot(e.data.approverResolver, e.data.decisionPolicy));
3719
+ return t && t.type === "userTask" ? st(t.data.approverResolver) : a && a.type === "userTask" ? `簽核節點「${a.data.label}」使用「沿主管鏈簽核」時,決策方式必須是「依序簽核或全部同意」,否則任一位主管簽完就會結案。` : n && n.type === "userTask" ? ut(n.data.excludeInitiator) : r || (i ? "條件分流的每條輸出連線都需要先設定條件。" : null);
3674
3720
  }
3675
- function la(e) {
3721
+ function pa(e) {
3676
3722
  return e?.fields.map((e) => ({
3677
3723
  fieldType: e.type,
3678
3724
  id: e.fieldKey,
3679
3725
  name: `${e.label} (${e.fieldKey})`
3680
3726
  })) ?? [];
3681
3727
  }
3682
- function ua(e, t) {
3728
+ function ma(e, t) {
3683
3729
  return t ? e?.fields.find((e) => e.fieldKey === t) ?? null : null;
3684
3730
  }
3685
- function da(e) {
3731
+ function ha(e) {
3686
3732
  if (!e) return [];
3687
- let t = st(e);
3688
- return vr.filter((e) => t.includes(e.id));
3733
+ let t = ct(e);
3734
+ return br.filter((e) => t.includes(e.id));
3689
3735
  }
3690
- function fa(e) {
3691
- return vr.some((t) => t.id === e) ? e : null;
3736
+ function ga(e) {
3737
+ return br.some((t) => t.id === e) ? e : null;
3692
3738
  }
3693
- function pa(e) {
3739
+ function _a(e) {
3694
3740
  return e ? e.type === "boolean" ? [{
3695
3741
  id: "true",
3696
3742
  name: "是"
3697
3743
  }, {
3698
3744
  id: "false",
3699
3745
  name: "否"
3700
- }] : Te(e) ? e.options.map((e) => ({
3746
+ }] : Ee(e) ? e.options.map((e) => ({
3701
3747
  id: e.value,
3702
3748
  name: e.label
3703
3749
  })) : [] : [];
3704
3750
  }
3705
- function ma(e) {
3706
- return yr.includes(e);
3751
+ function va(e) {
3752
+ return xr.includes(e);
3707
3753
  }
3708
- function ha(e, t) {
3754
+ function ya(e, t) {
3709
3755
  if (e.data.label) return e.data.label;
3710
- if (_a(e, t)) return ga(e);
3711
- if (va(e, t)) return "同時進行";
3756
+ if (xa(e, t)) return ba(e);
3757
+ if (Sa(e, t)) return "同時進行";
3712
3758
  }
3713
- function ga(e) {
3759
+ function ba(e) {
3714
3760
  return e.data.isDefault ? "其他情況" : "請設定條件";
3715
3761
  }
3716
- function _a(e, t) {
3762
+ function xa(e, t) {
3717
3763
  return t.some((t) => t.id === e.source && t.type === "exclusiveGateway");
3718
3764
  }
3719
- function va(e, t) {
3765
+ function Sa(e, t) {
3720
3766
  return t.some((t) => t.id === e.source && t.type === "parallelGateway");
3721
3767
  }
3722
- function ya(e) {
3768
+ function Ca(e) {
3723
3769
  return e.type === "NOTIFY" && e.recipients.type === "DIRECT" ? e.recipients.memberIds : [];
3724
3770
  }
3725
- function ba(e) {
3726
- return e instanceof Error ? e.message.includes("WORKFLOW_WEBHOOK_") ? `Webhook 設定未通過發布檢查:${e.message}` : we(e.message) : "發生未知錯誤";
3771
+ function wa(e) {
3772
+ return e instanceof Error ? e.message.includes("WORKFLOW_WEBHOOK_") ? `Webhook 設定未通過發布檢查:${e.message}` : Te(e.message) : "發生未知錯誤";
3727
3773
  }
3728
3774
  //#endregion
3729
- export { Ar as t };
3775
+ export { Mr as t };
3730
3776
 
3731
- //# sourceMappingURL=designer-CrbBRPUU.js.map
3777
+ //# sourceMappingURL=designer-D9eFma1W.js.map