@rytass/bpm-core-react 0.8.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +18 -2
  3. package/dist/chunks/FormBuilderView-BPLwAJGv.cjs +3 -0
  4. package/dist/chunks/FormBuilderView-BPLwAJGv.cjs.map +1 -0
  5. package/dist/chunks/FormBuilderView-Do9-MIAe.js +1477 -0
  6. package/dist/chunks/FormBuilderView-Do9-MIAe.js.map +1 -0
  7. package/dist/chunks/FormRendererView-C5POZbWz.js +492 -0
  8. package/dist/chunks/FormRendererView-C5POZbWz.js.map +1 -0
  9. package/dist/chunks/FormRendererView-DNtNodNl.cjs +2 -0
  10. package/dist/chunks/FormRendererView-DNtNodNl.cjs.map +1 -0
  11. package/dist/chunks/{approval-instance-list-page-YZcGGDD8.js → approval-instance-list-page-BjX2kaoF.js} +56 -54
  12. package/dist/chunks/approval-instance-list-page-BjX2kaoF.js.map +1 -0
  13. package/dist/chunks/approval-instance-list-page-C408vxE2.cjs +2 -0
  14. package/dist/chunks/approval-instance-list-page-C408vxE2.cjs.map +1 -0
  15. package/dist/chunks/{categories-DBPoSrsi.js → categories-DGlxuC6X.js} +5 -5
  16. package/dist/chunks/{categories-DBPoSrsi.js.map → categories-DGlxuC6X.js.map} +1 -1
  17. package/dist/chunks/{categories-B6QZKZRt.cjs → categories-DUfldZ_9.cjs} +2 -2
  18. package/dist/chunks/{categories-B6QZKZRt.cjs.map → categories-DUfldZ_9.cjs.map} +1 -1
  19. package/dist/chunks/compose-CULMDsLS.cjs +2 -0
  20. package/dist/chunks/compose-CULMDsLS.cjs.map +1 -0
  21. package/dist/chunks/{compose-CQHDT7vh.js → compose-DJBlA5PD.js} +60 -58
  22. package/dist/chunks/compose-DJBlA5PD.js.map +1 -0
  23. package/dist/chunks/{delegations-DDEk-WI6.cjs → delegations-CGj-tZNO.cjs} +2 -2
  24. package/dist/chunks/{delegations-DDEk-WI6.cjs.map → delegations-CGj-tZNO.cjs.map} +1 -1
  25. package/dist/chunks/{delegations-iVnRi3QE.js → delegations-DLEEFBlH.js} +231 -231
  26. package/dist/chunks/{delegations-iVnRi3QE.js.map → delegations-DLEEFBlH.js.map} +1 -1
  27. package/dist/chunks/{delegations-ZNtodFaD.js → delegations-DqMpI_Nk.js} +168 -167
  28. package/dist/chunks/delegations-DqMpI_Nk.js.map +1 -0
  29. package/dist/chunks/delegations-kbMOSEif.cjs +2 -0
  30. package/dist/chunks/delegations-kbMOSEif.cjs.map +1 -0
  31. package/dist/chunks/{designer-CUbVXEtS.js → designer-BszXJ5RO.js} +1227 -990
  32. package/dist/chunks/designer-BszXJ5RO.js.map +1 -0
  33. package/dist/chunks/designer-CmqAU92b.cjs +65 -0
  34. package/dist/chunks/designer-CmqAU92b.cjs.map +1 -0
  35. package/dist/chunks/detail-CDexqBoU.cjs +2 -0
  36. package/dist/chunks/detail-CDexqBoU.cjs.map +1 -0
  37. package/dist/chunks/{detail-Cts5_gVp.js → detail-DAak2OXS.js} +704 -622
  38. package/dist/chunks/detail-DAak2OXS.js.map +1 -0
  39. package/dist/chunks/notifications--hwl-DR0.cjs +2 -0
  40. package/dist/chunks/{notifications-BKs4--96.cjs.map → notifications--hwl-DR0.cjs.map} +1 -1
  41. package/dist/chunks/{notifications-CSulztkU.js → notifications-DJ5wzCye.js} +7 -7
  42. package/dist/chunks/{notifications-CSulztkU.js.map → notifications-DJ5wzCye.js.map} +1 -1
  43. package/dist/chunks/{orgs-CrNxqlwp.js → orgs-DytLvZ_X.js} +243 -241
  44. package/dist/chunks/{orgs-CrNxqlwp.js.map → orgs-DytLvZ_X.js.map} +1 -1
  45. package/dist/chunks/orgs-Ni22buHs.cjs +2 -0
  46. package/dist/chunks/orgs-Ni22buHs.cjs.map +1 -0
  47. package/dist/chunks/providers-DEqcuXw9.js +506 -0
  48. package/dist/chunks/providers-DEqcuXw9.js.map +1 -0
  49. package/dist/chunks/providers-D_zTbkQH.cjs +2 -0
  50. package/dist/chunks/providers-D_zTbkQH.cjs.map +1 -0
  51. package/dist/chunks/{users-qghSMtLn.cjs → users-0HqlM_VQ.cjs} +2 -2
  52. package/dist/chunks/{users-qghSMtLn.cjs.map → users-0HqlM_VQ.cjs.map} +1 -1
  53. package/dist/chunks/{users-CUY139DF.js → users-FWrb3ehW.js} +5 -5
  54. package/dist/chunks/{users-CUY139DF.js.map → users-FWrb3ehW.js.map} +1 -1
  55. package/dist/components/notification-drawer.d.ts +4 -3
  56. package/dist/index.cjs +1 -1
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.js +21 -428
  59. package/dist/index.js.map +1 -1
  60. package/dist/next/index.cjs +1 -1
  61. package/dist/next/index.cjs.map +1 -1
  62. package/dist/next/index.js +16 -15
  63. package/dist/next/index.js.map +1 -1
  64. package/dist/pages/admin/delegations/index.cjs +1 -1
  65. package/dist/pages/admin/delegations/index.js +1 -1
  66. package/dist/pages/admin/orgs/index.cjs +1 -1
  67. package/dist/pages/admin/orgs/index.js +1 -1
  68. package/dist/pages/admin/users/index.cjs +1 -1
  69. package/dist/pages/admin/users/index.js +1 -1
  70. package/dist/pages/delegations/index.cjs +1 -1
  71. package/dist/pages/delegations/index.js +1 -1
  72. package/dist/pages/instances/detail/index.cjs +1 -1
  73. package/dist/pages/instances/detail/index.js +1 -1
  74. package/dist/pages/settings/notifications/index.cjs +1 -1
  75. package/dist/pages/settings/notifications/index.js +1 -1
  76. package/dist/pages/templates/categories/index.cjs +1 -1
  77. package/dist/pages/templates/categories/index.js +1 -1
  78. package/dist/pages/templates/compose/index.cjs +1 -1
  79. package/dist/pages/templates/compose/index.js +1 -1
  80. package/dist/pages/templates/designer/index.cjs +1 -1
  81. package/dist/pages/templates/designer/index.js +1 -1
  82. package/dist/views/admin/delegations/index.cjs +1 -1
  83. package/dist/views/admin/delegations/index.js +1 -1
  84. package/dist/views/admin/index.cjs +1 -1
  85. package/dist/views/admin/index.js +3 -3
  86. package/dist/views/admin/orgs/index.cjs +1 -1
  87. package/dist/views/admin/orgs/index.js +1 -1
  88. package/dist/views/admin/users/index.cjs +1 -1
  89. package/dist/views/admin/users/index.js +1 -1
  90. package/dist/views/cc/index.cjs +1 -1
  91. package/dist/views/cc/index.js +1 -1
  92. package/dist/views/delegations/index.cjs +1 -1
  93. package/dist/views/delegations/index.js +1 -1
  94. package/dist/views/forms/builder/index.cjs +1 -1
  95. package/dist/views/forms/builder/index.js +1 -1
  96. package/dist/views/forms/renderer/FormRendererView.d.ts +7 -2
  97. package/dist/views/forms/renderer/form-data-source-field.d.ts +34 -0
  98. package/dist/views/forms/renderer/index.cjs +1 -1
  99. package/dist/views/forms/renderer/index.d.ts +1 -0
  100. package/dist/views/forms/renderer/index.js +2 -2
  101. package/dist/views/instances/detail/index.cjs +1 -1
  102. package/dist/views/instances/detail/index.js +1 -1
  103. package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +4 -1
  104. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +5 -1
  105. package/dist/views/instances/new/index.cjs +1 -1
  106. package/dist/views/instances/new/index.cjs.map +1 -1
  107. package/dist/views/instances/new/index.js +105 -86
  108. package/dist/views/instances/new/index.js.map +1 -1
  109. package/dist/views/search/index.cjs +1 -1
  110. package/dist/views/search/index.js +1 -1
  111. package/dist/views/sent/index.cjs +1 -1
  112. package/dist/views/sent/index.js +1 -1
  113. package/dist/views/settings/index.cjs +1 -1
  114. package/dist/views/settings/index.js +1 -1
  115. package/dist/views/settings/notifications/index.cjs +1 -1
  116. package/dist/views/settings/notifications/index.js +1 -1
  117. package/dist/views/templates/categories/index.cjs +1 -1
  118. package/dist/views/templates/categories/index.js +1 -1
  119. package/dist/views/templates/compose/TemplateComposeWizardView.d.ts +3 -2
  120. package/dist/views/templates/compose/index.cjs +1 -1
  121. package/dist/views/templates/compose/index.js +1 -1
  122. package/dist/views/templates/designer/index.cjs +1 -1
  123. package/dist/views/templates/designer/index.js +1 -1
  124. package/dist/views/templates/index.cjs +1 -1
  125. package/dist/views/templates/index.cjs.map +1 -1
  126. package/dist/views/templates/index.js +153 -112
  127. package/dist/views/templates/index.js.map +1 -1
  128. package/package.json +56 -11
  129. package/dist/chunks/FormBuilderView-B_KGPjlp.cjs +0 -3
  130. package/dist/chunks/FormBuilderView-B_KGPjlp.cjs.map +0 -1
  131. package/dist/chunks/FormBuilderView-D8DrQOXD.js +0 -1090
  132. package/dist/chunks/FormBuilderView-D8DrQOXD.js.map +0 -1
  133. package/dist/chunks/FormRendererView-BwVsH2eX.cjs +0 -2
  134. package/dist/chunks/FormRendererView-BwVsH2eX.cjs.map +0 -1
  135. package/dist/chunks/FormRendererView-DrHsuSVo.js +0 -220
  136. package/dist/chunks/FormRendererView-DrHsuSVo.js.map +0 -1
  137. package/dist/chunks/approval-instance-list-page-BMUKxzcz.cjs +0 -2
  138. package/dist/chunks/approval-instance-list-page-BMUKxzcz.cjs.map +0 -1
  139. package/dist/chunks/approval-instance-list-page-YZcGGDD8.js.map +0 -1
  140. package/dist/chunks/compose-CQHDT7vh.js.map +0 -1
  141. package/dist/chunks/compose-Ds_cAefe.cjs +0 -2
  142. package/dist/chunks/compose-Ds_cAefe.cjs.map +0 -1
  143. package/dist/chunks/delegations-C2wLWsDQ.cjs +0 -2
  144. package/dist/chunks/delegations-C2wLWsDQ.cjs.map +0 -1
  145. package/dist/chunks/delegations-ZNtodFaD.js.map +0 -1
  146. package/dist/chunks/designer-CQ9hxSdD.cjs +0 -65
  147. package/dist/chunks/designer-CQ9hxSdD.cjs.map +0 -1
  148. package/dist/chunks/designer-CUbVXEtS.js.map +0 -1
  149. package/dist/chunks/detail-B-Q4W-iw.cjs +0 -2
  150. package/dist/chunks/detail-B-Q4W-iw.cjs.map +0 -1
  151. package/dist/chunks/detail-Cts5_gVp.js.map +0 -1
  152. package/dist/chunks/notifications-BKs4--96.cjs +0 -2
  153. package/dist/chunks/orgs-iNJ0QEcK.cjs +0 -2
  154. package/dist/chunks/orgs-iNJ0QEcK.cjs.map +0 -1
@@ -1,27 +1,28 @@
1
1
  "use client";
2
2
  import { r as e } from "./router-adapter-DftlFTOd.js";
3
3
  import { r as t } from "./routes-config-RBYQtUd0.js";
4
- import { a as n, n as r, o as i, r as a } from "./admin-pickers-DLlG_1du.js";
5
- import { t as o } from "./bpm-form-field-Cao0rMol.js";
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
6
  import '../style.css';/* empty css */
7
- import { t as s } from "./FormBuilderView-D8DrQOXD.js";
7
+ import { t as s } from "./FormBuilderView-Do9-MIAe.js";
8
8
  import { Fragment as c, useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
9
- import { AutoComplete as m, Button as h, Icon as g, Input as _, Modal as v, PageHeader as ee, Section as te, SectionGroup as ne, Select as y, Textarea as re, Toggle as ie, Typography as b } from "@mezzanine-ui/react";
10
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
11
- import ae from "@mezzanine-ui/react/Drawer";
12
- import oe from "@mezzanine-ui/react/ContentHeader";
13
- import { CheckedIcon as se, DotGridIcon as ce, EyeIcon as le, FilterIcon as ue, MailIcon as de, SaveIcon as fe, TrashIcon as pe, UserIcon as me } from "@mezzanine-ui/icons";
14
- import { DefaultChatTransport as he, getToolName as ge, isToolUIPart as _e, lastAssistantMessageIsCompleteWithToolCalls as ve } from "ai";
15
- import { WORKFLOW_TOOLSET as ye, applyWorkflowCommand as w, applyWorkflowMacroCommand as be, executeWorkflowTool as xe, readWorkflowSnapshot as Se } from "@rytass/bpm-core-shared";
16
- import { readFormBuilder as Ce } from "@rytass/bpm-core-client/form";
9
+ import { AutoComplete as m, Button as h, Icon as g, Input as _, Modal as v, PageHeader as ee, Section as te, SectionGroup as ne, Select as y, Textarea as b, Toggle as x, Typography as S } from "@mezzanine-ui/react";
10
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
11
+ import re from "@mezzanine-ui/react/Drawer";
12
+ import ie from "@mezzanine-ui/react/ContentHeader";
13
+ import { CheckedIcon as ae, DotGridIcon as oe, EyeIcon as se, FilterIcon as ce, MailIcon as le, SaveIcon as ue, TrashIcon as de, UserIcon as fe } from "@mezzanine-ui/icons";
14
+ import { DefaultChatTransport as pe, getToolName as me, isToolUIPart as he, lastAssistantMessageIsCompleteWithToolCalls as ge } from "ai";
15
+ import { WORKFLOW_TOOLSET as _e, applyWorkflowCommand as E, applyWorkflowMacroCommand as ve, executeWorkflowTool as ye, readWorkflowSnapshot as be } from "@rytass/bpm-core-shared";
16
+ import { readFormBuilder as xe, readFormSchemaLintMessage as Se } from "@rytass/bpm-core-client/form";
17
+ import { isFormStaticOptionFieldDefinition as Ce } from "@rytass/bpm-core-shared/form";
17
18
  import { readOrganizationDashboard as we } from "@rytass/bpm-core-client/organization";
18
- import { Background as Te, ConnectionMode as Ee, ControlButton as De, Controls as Oe, Handle as T, MiniMap as ke, Panel as Ae, Position as E, ReactFlow as je, applyNodeChanges as Me, getViewportForBounds as Ne } from "@xyflow/react";
19
- import * as Pe from "dagre";
20
- import { composeApprovalTemplateWithForm as Fe, dryRunApprovalWorkflow as Ie, forkApprovalTemplate as Le, publishApprovalTemplateVersion as Re, readTemplateDesigner as ze, resolveMemberOptions as Be, searchMemberOptions as Ve, searchPublishedFormVersionOptions as He, updateApprovalTemplateDraft as Ue } from "@rytass/bpm-core-client/template";
21
- import { useChat as We } from "@ai-sdk/react";
22
- import { DEFAULT_SLA_CONFIG as Ge, SLA_CALENDAR_MODE_OPTIONS as Ke, SLA_DURATION_UNIT_OPTIONS as qe, SLA_TIMEOUT_ACTION_OPTIONS as Je, composeSlaDuration as Ye, readSlaDurationParts as Xe } from "@rytass/bpm-core-shared/workflow-graph";
19
+ import { Background as Te, ConnectionMode as Ee, ControlButton as De, Controls as Oe, Handle as ke, MiniMap as Ae, Panel as je, Position as D, ReactFlow as Me, applyNodeChanges as Ne, getViewportForBounds as Pe } from "@xyflow/react";
20
+ import * as Fe from "dagre";
21
+ import { composeApprovalTemplateWithForm as Ie, dryRunApprovalWorkflow as Le, forkApprovalTemplate as Re, publishApprovalTemplateVersion as ze, readTemplateDesigner as Be, resolveMemberOptions as Ve, searchMemberOptions as He, searchPublishedFormVersionOptions as Ue, updateApprovalTemplateDraft as We } from "@rytass/bpm-core-client/template";
22
+ import { useChat as Ge } from "@ai-sdk/react";
23
+ import { DEFAULT_QUORUM_THRESHOLD as Ke, DEFAULT_SLA_CONFIG as qe, SLA_CALENDAR_MODE_OPTIONS as Je, SLA_DURATION_UNIT_OPTIONS as Ye, SLA_TIMEOUT_ACTION_OPTIONS as Xe, composeQuorumThreshold as Ze, composeSlaDuration as Qe, isDecisionPolicyUnsatisfiable as $e, readDesignTimeApproverCount as et, readSlaDurationParts as tt } from "@rytass/bpm-core-shared/workflow-graph";
23
24
  //#region src/views/templates/designer/use-workflow-designer-controller.ts
24
- function Ze({ directory: e, initialState: t, layout: n, onLayout: r }) {
25
+ function nt({ directory: e, initialState: t, layout: n, onLayout: r }) {
25
26
  let [i, a] = p(t), o = f(t), s = f(e);
26
27
  s.current = e;
27
28
  let c = l((e) => {
@@ -34,21 +35,21 @@ function Ze({ directory: e, initialState: t, layout: n, onLayout: r }) {
34
35
  ...e,
35
36
  state: i
36
37
  };
37
- }, [n, r]), u = l((e) => c(w(o.current, e)), [c]), m = l((e) => c(be(o.current, e)), [c]), h = l(async (e, t) => {
38
- let n = await xe(o.current, e, t, { directory: s.current });
38
+ }, [n, r]), u = l((e) => c(E(o.current, e)), [c]), m = l((e) => c(ve(o.current, e)), [c]), h = l(async (e, t) => {
39
+ let n = await ye(o.current, e, t, { directory: s.current });
39
40
  if (n.ok && (n.kind === "mutation" || n.kind === "macro")) {
40
41
  let e = c(n.result);
41
42
  return {
42
43
  ...n,
43
44
  result: e,
44
- snapshot: Se(e.state)
45
+ snapshot: be(e.state)
45
46
  };
46
47
  }
47
48
  return n;
48
49
  }, [c]), g = l((e) => {
49
50
  let t = typeof e == "function" ? e(o.current) : e;
50
51
  o.current = t, a(t);
51
- }, []), _ = l(() => o.current, []), v = d(() => Se(i), [i]);
52
+ }, []), _ = l(() => o.current, []), v = d(() => be(i), [i]);
52
53
  return d(() => ({
53
54
  dispatch: u,
54
55
  dispatchMacro: m,
@@ -57,7 +58,7 @@ function Ze({ directory: e, initialState: t, layout: n, onLayout: r }) {
57
58
  replaceState: g,
58
59
  snapshot: v,
59
60
  state: i,
60
- tools: ye
61
+ tools: _e
61
62
  }), [
62
63
  u,
63
64
  m,
@@ -70,10 +71,10 @@ function Ze({ directory: e, initialState: t, layout: n, onLayout: r }) {
70
71
  }
71
72
  //#endregion
72
73
  //#region src/views/templates/designer/use-workflow-chat.ts
73
- function Qe({ controller: e, api: t = "/api/chat" }) {
74
- let n = We({
75
- transport: d(() => new he({ api: t }), [t]),
76
- sendAutomaticallyWhen: ve,
74
+ function rt({ controller: e, api: t = "/api/chat" }) {
75
+ let n = Ge({
76
+ transport: d(() => new pe({ api: t }), [t]),
77
+ sendAutomaticallyWhen: ge,
77
78
  async onToolCall({ toolCall: t }) {
78
79
  let r = await e.executeTool(t.toolName, t.input);
79
80
  if (r.ok) {
@@ -96,12 +97,12 @@ function Qe({ controller: e, api: t = "/api/chat" }) {
96
97
  }
97
98
  //#endregion
98
99
  //#region src/views/templates/designer/chrome-workflow-chat.ts
99
- var $e = 12;
100
- function et() {
100
+ var O = 12;
101
+ function k() {
101
102
  let e = globalThis.LanguageModel;
102
103
  return e && typeof e == "object" ? e : null;
103
104
  }
104
- var tt = {
105
+ var A = {
105
106
  additionalProperties: !1,
106
107
  properties: {
107
108
  action: {
@@ -115,7 +116,7 @@ var tt = {
115
116
  required: ["action"],
116
117
  type: "object"
117
118
  };
118
- function D() {
119
+ function j() {
119
120
  return `你是「簽核流程設計器」頁面的離線 AI 助理。只能透過下列工具操作這個流程畫布,其他請求一律婉拒並引導回流程設計。
120
121
 
121
122
  每一步只輸出一個 JSON 決策物件:
@@ -125,12 +126,12 @@ function D() {
125
126
  規則:先用 get_workflow_snapshot 了解現況再規劃;完成後用 validate_workflow 檢查並以 message 說明做了什麼。
126
127
 
127
128
  可用工具:
128
- ${ye.map((e) => `- ${e.name}(${JSON.stringify(e.inputSchema.properties ?? {})}): ${e.description}`).join("\n")}`;
129
+ ${_e.map((e) => `- ${e.name}(${JSON.stringify(e.inputSchema.properties ?? {})}): ${e.description}`).join("\n")}`;
129
130
  }
130
- function O({ controller: e }) {
131
+ function it({ controller: e }) {
131
132
  let [t, n] = p(!1), [r, i] = p([]), [a, o] = p("ready"), s = f(0);
132
133
  u(() => {
133
- let e = et();
134
+ let e = k();
134
135
  e && e.availability().then((e) => {
135
136
  n(e !== "unavailable");
136
137
  }).catch(() => n(!1));
@@ -149,14 +150,14 @@ function O({ controller: e }) {
149
150
  available: t,
150
151
  messages: r,
151
152
  send: l((t) => {
152
- let n = et();
153
- !n || a !== "ready" || (c("user", t), o("submitted"), k({
153
+ let n = k();
154
+ !n || a !== "ready" || (c("user", t), o("submitted"), M({
154
155
  appendMessage: c,
155
156
  controller: e,
156
157
  model: n,
157
158
  userText: t
158
159
  }).then(() => o("ready")).catch((e) => {
159
- c("assistant", nt(e)), o("error");
160
+ c("assistant", ot(e)), o("error");
160
161
  }));
161
162
  }, [
162
163
  c,
@@ -166,15 +167,15 @@ function O({ controller: e }) {
166
167
  status: a
167
168
  };
168
169
  }
169
- async function k({ appendMessage: e, controller: t, model: n, userText: r }) {
170
+ async function M({ appendMessage: e, controller: t, model: n, userText: r }) {
170
171
  let i = await n.create({ initialPrompts: [{
171
- content: D(),
172
+ content: j(),
172
173
  role: "system"
173
174
  }] });
174
175
  try {
175
176
  let n = `使用者需求:${r}\n目前流程:${JSON.stringify(t.snapshot)}`;
176
- for (let r = 0; r < $e; r += 1) {
177
- let r = A(await i.prompt(n, { responseConstraint: tt }));
177
+ for (let r = 0; r < O; r += 1) {
178
+ let r = at(await i.prompt(n, { responseConstraint: A }));
178
179
  if (!r || r.action === "message") {
179
180
  e("assistant", r?.text ?? "我已完成可處理的部分。");
180
181
  return;
@@ -194,7 +195,7 @@ async function k({ appendMessage: e, controller: t, model: n, userText: r }) {
194
195
  i.destroy();
195
196
  }
196
197
  }
197
- function A(e) {
198
+ function at(e) {
198
199
  try {
199
200
  let t = JSON.parse(e);
200
201
  return typeof t == "object" && t && t.action !== void 0 ? t : null;
@@ -202,51 +203,51 @@ function A(e) {
202
203
  return null;
203
204
  }
204
205
  }
205
- function nt(e) {
206
+ function ot(e) {
206
207
  return e instanceof Error ? `離線模式發生錯誤:${e.message}` : "離線模式發生未知錯誤。";
207
208
  }
208
209
  //#endregion
209
210
  //#region src/views/templates/designer/workflow-chat-drawer.tsx
210
- var j = {
211
+ var st = {
211
212
  display: "flex",
212
213
  flexDirection: "column",
213
214
  gap: 12,
214
215
  height: "100%"
215
- }, rt = {
216
+ }, ct = {
216
217
  display: "flex",
217
218
  flex: 1,
218
219
  flexDirection: "column",
219
220
  gap: 12,
220
221
  minHeight: 0,
221
222
  overflowY: "auto"
222
- }, it = {
223
+ }, lt = {
223
224
  display: "flex",
224
225
  gap: 8,
225
226
  paddingBottom: 4
226
- }, at = {
227
+ }, ut = {
227
228
  borderTop: "1px solid var(--mzn-color-border-neutral, #e5e7eb)",
228
229
  display: "flex",
229
230
  flexDirection: "column",
230
231
  gap: 8,
231
232
  paddingTop: 12
232
- }, ot = {
233
+ }, dt = {
233
234
  display: "flex",
234
235
  justifyContent: "flex-end"
235
- }, st = { width: "100%" }, ct = "workflow-chat-input-field", lt = `
236
- .${ct}.mzn-text-field {
236
+ }, ft = { width: "100%" }, N = "workflow-chat-input-field", pt = `
237
+ .${N}.mzn-text-field {
237
238
  width: 100%;
238
239
  }
239
- `, ut = {
240
+ `, mt = {
240
241
  color: "var(--mzn-color-text-secondary, #6b7280)",
241
242
  fontSize: 12,
242
243
  padding: "2px 0"
243
- }, M = {
244
+ }, ht = {
244
245
  "input-available": "執行中…",
245
246
  "input-streaming": "準備中…",
246
247
  "output-available": "完成",
247
248
  "output-error": "失敗"
248
249
  };
249
- function dt(e) {
250
+ function gt(e) {
250
251
  let t = e === "user";
251
252
  return {
252
253
  alignSelf: t ? "flex-end" : "flex-start",
@@ -259,11 +260,11 @@ function dt(e) {
259
260
  wordBreak: "break-word"
260
261
  };
261
262
  }
262
- function ft({ api: e, controller: t, onClose: n, open: r }) {
263
- let i = Qe({
263
+ function _t({ api: e, controller: t, onClose: n, open: r }) {
264
+ let i = rt({
264
265
  api: e,
265
266
  controller: t
266
- }), a = O({ controller: t }), [o, s] = p("online"), [u, d] = p(""), f = o === "offline" ? {
267
+ }), a = it({ controller: t }), [o, s] = p("online"), [u, d] = p(""), f = o === "offline" ? {
267
268
  messages: a.messages,
268
269
  send: a.send,
269
270
  status: a.status
@@ -283,59 +284,59 @@ function ft({ api: e, controller: t, onClose: n, open: r }) {
283
284
  ]), ee = l((e) => {
284
285
  e.nativeEvent.isComposing || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), v());
285
286
  }, [v]);
286
- return /* @__PURE__ */ C(ae, {
287
+ return /* @__PURE__ */ T(re, {
287
288
  headerTitle: "AI 流程助理",
288
289
  isHeaderDisplay: !0,
289
290
  onClose: n,
290
291
  open: r,
291
292
  size: "medium",
292
- children: [/* @__PURE__ */ S("style", { children: lt }), /* @__PURE__ */ C("div", {
293
- style: j,
293
+ children: [/* @__PURE__ */ w("style", { children: pt }), /* @__PURE__ */ T("div", {
294
+ style: st,
294
295
  children: [
295
- a.available ? /* @__PURE__ */ C("div", {
296
- style: it,
297
- children: [/* @__PURE__ */ S(h, {
296
+ a.available ? /* @__PURE__ */ T("div", {
297
+ style: lt,
298
+ children: [/* @__PURE__ */ w(h, {
298
299
  onClick: () => s("online"),
299
300
  variant: o === "online" ? "base-primary" : "base-tertiary",
300
301
  children: "線上"
301
- }), /* @__PURE__ */ S(h, {
302
+ }), /* @__PURE__ */ w(h, {
302
303
  onClick: () => s("offline"),
303
304
  variant: o === "offline" ? "base-primary" : "base-tertiary",
304
305
  children: "離線(裝置內,實驗)"
305
306
  })]
306
307
  }) : null,
307
- /* @__PURE__ */ C("div", {
308
+ /* @__PURE__ */ T("div", {
308
309
  role: "log",
309
- style: rt,
310
+ style: ct,
310
311
  children: [
311
- m.length === 0 ? /* @__PURE__ */ S(b, {
312
+ m.length === 0 ? /* @__PURE__ */ w(S, {
312
313
  color: "text-neutral",
313
314
  variant: "body",
314
315
  children: "用一句話描述你想要的流程,例如:「建立三關簽核:部門主管 → 經理 → 財務,金額大於十萬走財務複核」。我會直接在畫布上幫你繪製。"
315
316
  }) : null,
316
- m.map((e) => /* @__PURE__ */ S(c, { children: pt(e) }, e.id)),
317
- _ ? /* @__PURE__ */ S(b, {
317
+ m.map((e) => /* @__PURE__ */ w(c, { children: vt(e) }, e.id)),
318
+ _ ? /* @__PURE__ */ w(S, {
318
319
  color: "text-neutral",
319
320
  variant: "body",
320
321
  children: "思考中…"
321
322
  }) : null
322
323
  ]
323
324
  }),
324
- /* @__PURE__ */ C("div", {
325
- style: at,
326
- children: [/* @__PURE__ */ S(re, {
327
- className: ct,
325
+ /* @__PURE__ */ T("div", {
326
+ style: ut,
327
+ children: [/* @__PURE__ */ w(b, {
328
+ className: N,
328
329
  disabled: _,
329
330
  maxLength: 2e3,
330
331
  onChange: (e) => d(e.target.value),
331
332
  onKeyDown: ee,
332
333
  placeholder: "描述你想要的流程…(Enter 送出,Shift + Enter 換行)",
333
334
  rows: 3,
334
- style: st,
335
+ style: ft,
335
336
  value: u
336
- }), /* @__PURE__ */ S("div", {
337
- style: ot,
338
- children: /* @__PURE__ */ S(h, {
337
+ }), /* @__PURE__ */ w("div", {
338
+ style: dt,
339
+ children: /* @__PURE__ */ w(h, {
339
340
  disabled: _ || u.trim().length === 0,
340
341
  loading: _,
341
342
  onClick: v,
@@ -349,32 +350,32 @@ function ft({ api: e, controller: t, onClose: n, open: r }) {
349
350
  })]
350
351
  });
351
352
  }
352
- function pt(e) {
353
- return e.parts.map((t, n) => t.type === "text" ? /* @__PURE__ */ S("div", {
354
- style: dt(e.role),
353
+ function vt(e) {
354
+ return e.parts.map((t, n) => t.type === "text" ? /* @__PURE__ */ w("div", {
355
+ style: gt(e.role),
355
356
  children: t.text
356
- }, `${e.id}-${n}`) : t.type === "dynamic-tool" || _e(t) ? /* @__PURE__ */ S("div", {
357
- style: ut,
358
- children: `⚙ ${ge(t)} · ${M[t.state] ?? t.state}`
357
+ }, `${e.id}-${n}`) : t.type === "dynamic-tool" || he(t) ? /* @__PURE__ */ w("div", {
358
+ style: mt,
359
+ children: `⚙ ${me(t)} · ${ht[t.state] ?? t.state}`
359
360
  }, `${e.id}-${n}`) : null);
360
361
  }
361
362
  //#endregion
362
363
  //#region src/views/templates/designer/TemplateDesignerView.tsx
363
- var mt = {
364
+ var yt = {
364
365
  display: "grid",
365
366
  gap: 16
366
- }, ht = {
367
+ }, bt = {
367
368
  alignItems: "start",
368
369
  display: "grid",
369
370
  gap: 16,
370
371
  gridTemplateColumns: "minmax(0, 1fr) 420px"
371
- }, gt = {
372
+ }, xt = {
372
373
  border: "1px solid var(--mzn-color-border-neutral)",
373
374
  borderRadius: 6,
374
375
  height: 620,
375
376
  minWidth: 0,
376
377
  overflow: "hidden"
377
- }, _t = {
378
+ }, St = {
378
379
  alignItems: "center",
379
380
  boxSizing: "border-box",
380
381
  color: "var(--mzn-color-text-error)",
@@ -384,24 +385,24 @@ var mt = {
384
385
  lineHeight: 0,
385
386
  padding: 0,
386
387
  width: 26
387
- }, vt = {
388
+ }, Ct = {
388
389
  alignItems: "center",
389
390
  display: "flex",
390
391
  height: "100%",
391
392
  justifyContent: "center",
392
393
  width: "100%"
393
- }, yt = "workflow-designer-side-panel", bt = 96, xt = `
394
- .${yt} .mzn-form-field--stretch .mzn-form-field__label-area,
395
- .${yt} .mzn-form-field--horizontal .mzn-form-field__label-area {
396
- flex: 0 0 ${bt}px;
397
- width: ${bt}px;
394
+ }, wt = "workflow-designer-side-panel", Tt = 96, Et = `
395
+ .${wt} .mzn-form-field--stretch .mzn-form-field__label-area,
396
+ .${wt} .mzn-form-field--horizontal .mzn-form-field__label-area {
397
+ flex: 0 0 ${Tt}px;
398
+ width: ${Tt}px;
398
399
  }
399
400
 
400
- .${yt} .mzn-form-field--stretch .mzn-form-field__data-entry,
401
- .${yt} .mzn-form-field--horizontal .mzn-form-field__data-entry {
401
+ .${wt} .mzn-form-field--stretch .mzn-form-field__data-entry,
402
+ .${wt} .mzn-form-field--horizontal .mzn-form-field__data-entry {
402
403
  min-width: 0;
403
404
  }
404
- `, St = "#2563eb", Ct = "#64748b", wt = "var(--mzn-color-text-error, #dc2626)", Tt = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", Et = `
405
+ `, Dt = "#2563eb", P = "#64748b", Ot = "var(--mzn-color-text-error, #dc2626)", kt = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", At = `
405
406
  .workflow-selection-delete-control.react-flow__controls-button {
406
407
  align-items: center !important;
407
408
  display: flex !important;
@@ -426,26 +427,26 @@ var mt = {
426
427
 
427
428
  .workflow-edge--selected .react-flow__edge-path,
428
429
  .react-flow__edge-path.workflow-edge--selected {
429
- filter: ${Tt};
430
+ filter: ${kt};
430
431
  opacity: 1 !important;
431
- stroke: ${Ct} !important;
432
+ stroke: ${P} !important;
432
433
  stroke-opacity: 1 !important;
433
434
  stroke-width: 1.5px !important;
434
435
  }
435
436
 
436
437
  .workflow-edge--selected {
437
- --xy-edge-stroke: ${Ct};
438
- --xy-edge-stroke-selected: ${Ct};
438
+ --xy-edge-stroke: ${P};
439
+ --xy-edge-stroke-selected: ${P};
439
440
  --xy-edge-stroke-width: 1.5px;
440
441
  }
441
442
 
442
- `, Dt = {
443
+ `, jt = {
443
444
  display: "grid",
444
445
  gap: 12
445
- }, Ot = {
446
+ }, Mt = {
446
447
  display: "grid",
447
448
  gap: 12
448
- }, kt = {
449
+ }, Nt = {
449
450
  border: "1px solid var(--mzn-color-border-neutral)",
450
451
  borderRadius: 6,
451
452
  display: "grid",
@@ -453,26 +454,26 @@ var mt = {
453
454
  maxHeight: 360,
454
455
  overflow: "auto",
455
456
  padding: 12
456
- }, At = {
457
+ }, Pt = {
457
458
  borderBottom: "1px solid var(--mzn-color-border-neutral)",
458
459
  display: "grid",
459
460
  gap: 4,
460
461
  padding: "0 0 8px"
461
- }, jt = {
462
+ }, Ft = {
462
463
  display: "flex",
463
464
  flexWrap: "wrap",
464
465
  gap: 8
465
- }, Mt = {
466
+ }, It = {
466
467
  alignItems: "center",
467
468
  display: "flex",
468
469
  gap: 8
469
- }, Nt = {
470
+ }, Lt = {
470
471
  flex: "1 1 auto",
471
472
  minWidth: 0
472
- }, Pt = { flex: "0 0 auto" }, Ft = {
473
+ }, Rt = { flex: "0 0 auto" }, zt = {
473
474
  display: "grid",
474
475
  gap: 8
475
- }, N = {
476
+ }, F = {
476
477
  alignContent: "center",
477
478
  background: "var(--mzn-color-bg-surface)",
478
479
  border: "1px solid var(--mzn-color-border-neutral)",
@@ -487,70 +488,70 @@ var mt = {
487
488
  padding: "10px 12px",
488
489
  textAlign: "center",
489
490
  width: "100%"
490
- }, It = "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)", Lt = 64, P = 160, Rt = 20, zt = 64, F = 180, Bt = {
491
- ...N,
491
+ }, Bt = "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)", I = 64, Vt = 160, Ht = 20, L = 64, Ut = 180, Wt = {
492
+ ...F,
492
493
  display: "grid",
493
494
  gap: 8,
494
495
  padding: "10px 12px"
495
- }, I = {
496
- ...Bt,
496
+ }, Gt = {
497
+ ...Wt,
497
498
  background: "#eff6ff",
498
499
  border: "1px solid #2563eb"
499
- }, Vt = {
500
- ...Bt,
500
+ }, Kt = {
501
+ ...Wt,
501
502
  background: "#f0fdfa",
502
503
  border: "1px solid #0f766e"
503
- }, L = {
504
- ...N,
504
+ }, R = {
505
+ ...F,
505
506
  background: "#ffffff"
506
- }, Ht = {
507
- ...N,
507
+ }, qt = {
508
+ ...F,
508
509
  background: "#ecfdf3",
509
510
  border: "1px solid #2f855a"
510
- }, Ut = {
511
- ...N,
511
+ }, z = {
512
+ ...F,
512
513
  background: "#fff4ed",
513
514
  border: "1px solid #c2410c"
514
- }, Wt = {
515
+ }, Jt = {
515
516
  display: "block",
516
517
  maxWidth: "100%",
517
518
  minWidth: 0
518
- }, Gt = {
519
+ }, Yt = {
519
520
  display: "grid",
520
521
  gap: 2,
521
522
  minWidth: 0
522
- }, Kt = "input", qt = "output", Jt = {
523
+ }, Xt = "input", Zt = "output", Qt = {
523
524
  endEvent: "結束",
524
525
  exclusiveGateway: "條件分流",
525
526
  parallelGateway: "並行處理",
526
527
  serviceTask: "系統",
527
528
  startEvent: "開始",
528
529
  userTask: "簽核"
529
- }, Yt = [{
530
- icon: me,
530
+ }, $t = [{
531
+ icon: fe,
531
532
  label: "簽核節點",
532
533
  type: "userTask"
533
534
  }, {
534
- icon: de,
535
+ icon: le,
535
536
  label: "知會節點",
536
537
  type: "serviceTask"
537
- }], Xt = [{
538
- icon: ue,
538
+ }], en = [{
539
+ icon: ce,
539
540
  label: "條件分流",
540
541
  type: "exclusiveGateway"
541
- }], Zt = [{
542
+ }], tn = [{
542
543
  id: "AND",
543
544
  name: "全部前置完成"
544
545
  }, {
545
546
  id: "OR",
546
547
  name: "任一前置完成"
547
- }], Qt = [{
548
+ }], nn = [{
548
549
  id: "RESTART",
549
550
  name: "重新送出後從開始重跑"
550
551
  }, {
551
552
  id: "FROM_RETURN_POINT",
552
553
  name: "重新送出後回到退回節點"
553
- }], $t = [
554
+ }], rn = [
554
555
  {
555
556
  id: "NONE",
556
557
  name: "不提醒",
@@ -571,7 +572,7 @@ var mt = {
571
572
  name: "剩十分之一時提醒",
572
573
  value: .9
573
574
  }
574
- ], en = [
575
+ ], an = [
575
576
  {
576
577
  id: "DIRECT",
577
578
  name: "指定會員"
@@ -596,7 +597,30 @@ var mt = {
596
597
  id: "POSITION",
597
598
  name: "指定職位"
598
599
  }
599
- ], R = [
600
+ ], on = [
601
+ {
602
+ id: "SINGLE",
603
+ name: "單人簽核"
604
+ },
605
+ {
606
+ id: "PARALLEL_ANY",
607
+ name: "任一人同意"
608
+ },
609
+ {
610
+ id: "PARALLEL_ALL",
611
+ name: "全部同意"
612
+ },
613
+ {
614
+ id: "QUORUM",
615
+ name: "達到指定門檻"
616
+ }
617
+ ], sn = [{
618
+ id: "COUNT",
619
+ name: "人數"
620
+ }, {
621
+ id: "PERCENTAGE",
622
+ name: "百分比"
623
+ }], B = [
600
624
  {
601
625
  id: "1",
602
626
  name: "直屬主管",
@@ -612,13 +636,13 @@ var mt = {
612
636
  name: "第三層主管",
613
637
  value: 3
614
638
  }
615
- ], tn = [{
639
+ ], cn = [{
616
640
  id: "NONE",
617
641
  name: "停止流程並提示"
618
642
  }, {
619
643
  id: "DIRECT",
620
644
  name: "固定改派"
621
- }], nn = [
645
+ }], ln = [
622
646
  {
623
647
  id: "EQUALS",
624
648
  name: "等於"
@@ -651,14 +675,14 @@ var mt = {
651
675
  id: "IS_EMPTY",
652
676
  name: "未填寫"
653
677
  }
654
- ], rn = [
678
+ ], un = [
655
679
  "EQUALS",
656
680
  "GREATER_THAN",
657
681
  "GREATER_THAN_OR_EQUALS",
658
682
  "LESS_THAN",
659
683
  "LESS_THAN_OR_EQUALS",
660
684
  "NOT_EQUALS"
661
- ], an = [
685
+ ], dn = [
662
686
  {
663
687
  id: "NONE",
664
688
  name: "未設定"
@@ -675,317 +699,322 @@ var mt = {
675
699
  id: "ORG_UNIT_POSITION",
676
700
  name: "指定組織職位"
677
701
  }
678
- ], on = {
702
+ ], fn = {
679
703
  id: "CUSTOM",
680
704
  name: "既有自訂規則"
681
- }, sn = "member-001", cn = {
705
+ }, pn = "member-001", mn = {
682
706
  display: "flex",
683
707
  flexDirection: "column",
684
708
  height: "100%"
685
- }, ln = {
709
+ }, hn = {
686
710
  flex: 1,
687
711
  minHeight: 0,
688
712
  overflowY: "auto"
689
- }, un = {
713
+ }, gn = {
690
714
  borderTop: "1px solid var(--mzn-color-border-neutral)",
691
715
  display: "flex",
692
716
  gap: 8,
693
717
  paddingTop: 12
694
- }, dn = {
718
+ }, _n = {
695
719
  fields: [],
696
720
  schemaVersion: 1
697
- }, fn = {
721
+ }, vn = {
698
722
  layout: [],
699
723
  schemaVersion: 1
700
- }, pn = {
701
- endEvent: B,
702
- exclusiveGateway: B,
703
- parallelGateway: B,
704
- serviceTask: B,
705
- startEvent: B,
706
- userTask: B
724
+ }, yn = {
725
+ endEvent: V,
726
+ exclusiveGateway: V,
727
+ parallelGateway: V,
728
+ serviceTask: V,
729
+ startEvent: V,
730
+ userTask: V
707
731
  };
708
- function z(e, t) {
732
+ function bn(e, t) {
709
733
  return typeof e == "function" ? e(t) : e;
710
734
  }
711
- function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride: c, initialInitiatorPolicyCel: ce, initialWorkflowDefinition: ue, onInitiatorPolicyChange: de, onWorkflowChange: me, showAiAssistant: he = !1, showDryRun: ge = !0, templateId: _e }) {
712
- let ve = e(), ye = t(), [w, be] = p(null), [xe, Se] = p(null), [T, Ae] = p(""), [E, Ne] = p(null), [Pe, We] = p(null), Ye = f(null), [Qe, $e] = p(void 0), et = f([]), tt = f([]), D = Ze({
735
+ function xn({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride: c, initialInitiatorPolicyCel: oe, initialWorkflowDefinition: ce, onInitiatorPolicyChange: le, onWorkflowChange: fe, showAiAssistant: pe = !1, showDryRun: me = !0, templateId: he }) {
736
+ let ge = e(), _e = t(), [E, ve] = p(null), [ye, be] = p(null), [Se, Ce] = p(""), [ke, je] = p(null), [D, Pe] = p(null), Fe = f(null), [Ge, Ke] = p(void 0), Qe = f([]), rt = f([]), O = nt({
713
737
  directory: d(() => ({
714
- listOrgUnits: async () => et.current.map((e) => ({
738
+ listOrgUnits: async () => Qe.current.map((e) => ({
715
739
  id: e.id,
716
740
  name: e.name
717
741
  })),
718
- listPositions: async () => tt.current.map((e) => ({
742
+ listPositions: async () => rt.current.map((e) => ({
719
743
  id: e.id,
720
744
  name: e.name
721
745
  })),
722
- searchMembers: async (e) => gr(await Ve(e)).map((e) => ({
746
+ searchMembers: async (e) => jr(await He(e)).map((e) => ({
723
747
  email: e.email,
724
748
  id: e.memberId,
725
749
  name: e.name
726
750
  }))
727
751
  }), []),
728
752
  initialState: {
729
- definition: i && ue != null ? ue : On(),
753
+ definition: a && ce != null ? Nn(ce) : Ln(),
730
754
  editingEdgeId: null,
731
755
  formDefinitionVersionId: null,
732
756
  formSchema: null,
733
- initiatorPolicyCel: i && ce !== void 0 ? ce : null,
757
+ initiatorPolicyCel: a && oe !== void 0 ? oe : null,
734
758
  selectedEdgeIds: [],
735
- selectedNodeId: i && ue != null ? ue.nodes[0]?.id ?? "start" : "start"
759
+ selectedNodeId: a && ce != null ? ce.nodes[0]?.id ?? "start" : "start"
736
760
  },
737
- layout: An,
761
+ layout: zn,
738
762
  onLayout: (e) => {
739
- let t = Nr(e, Ye.current);
740
- t && $e(t);
763
+ let t = Jr(e, Fe.current);
764
+ t && Ke(t);
741
765
  }
742
- }), O = D.state.definition, k = D.state.formDefinitionVersionId, A = D.state.initiatorPolicyCel, nt = D.state.selectedNodeId, j = D.state.selectedEdgeIds, rt = D.state.editingEdgeId, it = (e) => D.replaceState((t) => ({
766
+ }), k = O.state.definition, A = O.state.formDefinitionVersionId, j = O.state.initiatorPolicyCel, it = O.state.selectedNodeId, M = O.state.selectedEdgeIds, at = O.state.editingEdgeId, ot = (e) => O.replaceState((t) => ({
743
767
  ...t,
744
- definition: z(e, t.definition)
745
- })), at = (e) => D.replaceState((t) => ({
768
+ definition: bn(e, t.definition)
769
+ })), st = (e) => O.replaceState((t) => ({
746
770
  ...t,
747
- formDefinitionVersionId: z(e, t.formDefinitionVersionId)
748
- })), ot = (e) => D.replaceState((t) => ({
771
+ formDefinitionVersionId: bn(e, t.formDefinitionVersionId)
772
+ })), ct = (e) => O.replaceState((t) => ({
749
773
  ...t,
750
- initiatorPolicyCel: z(e, t.initiatorPolicyCel)
751
- })), st = (e) => D.replaceState((t) => ({
774
+ initiatorPolicyCel: bn(e, t.initiatorPolicyCel)
775
+ })), lt = (e) => O.replaceState((t) => ({
752
776
  ...t,
753
- selectedNodeId: z(e, t.selectedNodeId)
754
- })), ct = (e) => D.replaceState((t) => ({
777
+ selectedNodeId: bn(e, t.selectedNodeId)
778
+ })), ut = (e) => O.replaceState((t) => ({
755
779
  ...t,
756
- selectedEdgeIds: z(e, t.selectedEdgeIds)
757
- })), lt = (e) => D.replaceState((t) => ({
780
+ selectedEdgeIds: bn(e, t.selectedEdgeIds)
781
+ })), dt = (e) => O.replaceState((t) => ({
758
782
  ...t,
759
- editingEdgeId: z(e, t.editingEdgeId)
760
- })), [ut, M] = p(null), [dt, pt] = p(!0), [bt, St] = p(!1), [Ct, Tt] = p(!1), [N, It] = p([]), Lt = d(() => JSON.stringify({
761
- formDefinitionVersionId: k,
762
- initiatorPolicyCel: A,
763
- workflowDefinition: O
783
+ editingEdgeId: bn(e, t.editingEdgeId)
784
+ })), [ft, N] = p(null), [pt, mt] = p(null);
785
+ u(() => {
786
+ mt(null);
787
+ }, [it]);
788
+ let [ht, gt] = p(!0), [vt, Tt] = p(!1), [Dt, P] = p(!1), [kt, F] = p([]), Bt = d(() => JSON.stringify({
789
+ formDefinitionVersionId: A,
790
+ initiatorPolicyCel: j,
791
+ workflowDefinition: k
764
792
  }), [
765
- k,
766
793
  A,
767
- O
768
- ]), P = !!T && Lt !== T, [Rt, zt] = p(!1), [F, Bt] = p([]), [I, Vt] = p([]), [L, Ht] = p([]), [Ut, Wt] = p([]);
769
- et.current = I, tt.current = L;
770
- let [Gt, Kt] = p(!1), [qt, nn] = p(!1), [rn, mn] = p("{}"), [B, gn] = p(null), [_n, vn] = p(null), [yn, V] = p(!1), [xn, Sn] = p(!1), [H, wn] = p(null), [En, Dn] = p(!1), [Vn, Yn] = p(!1), Qn = P || En ? "保存並發布" : xe ? "發布草稿" : "已發布";
794
+ j,
795
+ k
796
+ ]), I = !!Se && Bt !== Se, [Vt, Ht] = p(!1), [L, Ut] = p([]), [Wt, Gt] = p([]), Kt = f(0), [R, qt] = p([]), [z, Jt] = p([]), [Yt, Xt] = p([]);
797
+ Qe.current = R, rt.current = z;
798
+ let [Zt, ln] = p(!1), [un, xn] = p(!1), [V, Cn] = p("{}"), [wn, Tn] = p(null), [En, H] = p(null), [On, kn] = p(!1), [An, Mn] = p(!1), [U, Pn] = p(null), [Fn, In] = p(!1), [nr, ur] = p(!1), pr = I || Fn ? "保存並發布" : ye ? "發布草稿" : "已發布";
771
799
  u(() => {
772
- i ? Fr() : Vr();
773
- }, [i, _e]), u(() => {
800
+ a ? qr() : Xr();
801
+ }, [a, he]), u(() => {
774
802
  function e(e) {
775
- P && (e.preventDefault(), e.returnValue = "");
803
+ I && (e.preventDefault(), e.returnValue = "");
776
804
  }
777
805
  return window.addEventListener("beforeunload", e), () => {
778
806
  window.removeEventListener("beforeunload", e);
779
807
  };
780
- }, [P]), u(() => {
781
- Jr(O);
782
- }, [O, F]), u(() => {
783
- it((e) => Tn(e));
784
- }, [O.edges, O.nodes]);
785
- function er() {
786
- P && !window.confirm("目前有尚未儲存的流程草稿,確定要離開嗎?") || ve.push(ye.templates());
808
+ }, [I]), u(() => {
809
+ si(k);
810
+ }, [k, L]), u(() => {
811
+ ot((e) => Nn(e));
812
+ }, [k.edges, k.nodes]);
813
+ function hr() {
814
+ I && !window.confirm("目前有尚未儲存的流程草稿,確定要離開嗎?") || ge.push(_e.templates());
787
815
  }
788
- let W = d(() => O.nodes.find((e) => e.id === nt) ?? null, [nt, O.nodes]), ar = W ? ir(W) : !1, or = j.length > 0 || ar, ur = l(() => {
789
- D.getState().selectedEdgeIds.forEach((e) => D.dispatch({
816
+ let G = d(() => k.nodes.find((e) => e.id === it) ?? null, [it, k.nodes]), br = G ? yr(G) : !1, xr = M.length > 0 || br, Tr = l(() => {
817
+ O.getState().selectedEdgeIds.forEach((e) => O.dispatch({
790
818
  edgeId: e,
791
819
  type: "deleteEdge"
792
- })), W && ir(W) && D.dispatch({
793
- nodeId: W.id,
820
+ })), G && yr(G) && O.dispatch({
821
+ nodeId: G.id,
794
822
  type: "deleteNode"
795
823
  });
796
- }, [D, W]);
824
+ }, [O, G]);
797
825
  u(() => {
798
- if (!or) return;
826
+ if (!xr) return;
799
827
  function e(e) {
800
- e.key !== "Delete" && e.key !== "Backspace" || sr(e.target) || (e.preventDefault(), ur());
828
+ e.key !== "Delete" && e.key !== "Backspace" || Sr(e.target) || (e.preventDefault(), Tr());
801
829
  }
802
830
  return window.addEventListener("keydown", e), () => {
803
831
  window.removeEventListener("keydown", e);
804
832
  };
805
- }, [or, ur]);
806
- let fr = d(() => O.edges.find((e) => e.id === rt) ?? null, [rt, O.edges]), G = d(() => j.length === 1 ? O.edges.find((e) => e.id === j[0]) ?? null : null, [j, O.edges]), K = d(() => j.map((e) => O.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [j, O.edges]), q = d(() => Pe ?? Xn(A, E), [
807
- A,
808
- Pe,
809
- E
810
- ]), Cr = d(() => O.nodes.map((e) => bn(e, F, I, L, e.id === nt, q)), [
811
- q,
812
- F,
813
- I,
814
- L,
815
- nt,
816
- O.nodes
817
- ]), wr = d(() => O.edges.map((e) => Cn(e, O.nodes, j.includes(e.id))), [
833
+ }, [xr, Tr]);
834
+ let Dr = d(() => k.edges.find((e) => e.id === at) ?? null, [at, k.edges]), K = d(() => M.length === 1 ? k.edges.find((e) => e.id === M[0]) ?? null : null, [M, k.edges]), q = d(() => M.map((e) => k.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [M, k.edges]), J = d(() => D ?? dr(j, ke), [
818
835
  j,
819
- O.edges,
820
- O.nodes
821
- ]), J = d(() => U(N, k) ?? U(cr(w?.formVersions ?? []), k), [
822
- k,
823
- N,
824
- w?.formVersions
825
- ]), Er = d(() => hr(N, J), [N, J]), kr = J?.schema ?? null, Ar = i ? c ?? null : kr;
836
+ D,
837
+ ke
838
+ ]), Lr = d(() => k.nodes.map((e) => Dn(e, L, R, z, e.id === it, J)), [
839
+ J,
840
+ L,
841
+ R,
842
+ z,
843
+ it,
844
+ k.nodes
845
+ ]), Rr = d(() => k.edges.map((e) => jn(e, k.nodes, M.includes(e.id))), [
846
+ M,
847
+ k.edges,
848
+ k.nodes
849
+ ]), Y = d(() => W(kt, A) ?? W(Cr(E?.formVersions ?? []), A), [
850
+ A,
851
+ kt,
852
+ E?.formVersions
853
+ ]), Br = d(() => Ar(kt, Y), [kt, Y]), Hr = Y?.schema ?? null, Wr = a ? c ?? null : Hr;
826
854
  u(() => {
827
- D.getState().formSchema !== Ar && D.replaceState((e) => ({
855
+ O.getState().formSchema !== Wr && O.replaceState((e) => ({
828
856
  ...e,
829
- formSchema: Ar
857
+ formSchema: Wr
830
858
  }));
831
- }, [D, Ar]);
832
- let jr = d(() => Pr(O), [O]), Y = d(() => Ir(O), [O]), Mr = d(() => Zn(q), [q]);
859
+ }, [O, Wr]);
860
+ let Gr = d(() => Yr(k), [k]), X = d(() => Zr(k), [k]), Kr = d(() => fr(J), [J]);
833
861
  u(() => {
834
- i && me?.(O);
835
- }, [i, O]), u(() => {
836
- i && de?.(A);
837
- }, [i, A]);
838
- async function Fr() {
839
- pt(!0), M(null);
862
+ a && fe?.(k);
863
+ }, [a, k]), u(() => {
864
+ a && le?.(j);
865
+ }, [a, j]);
866
+ async function qr() {
867
+ gt(!0), N(null);
840
868
  try {
841
869
  let e = await we();
842
- Vt(e.orgUnits), Ht(e.positions), Wt(e.memberships);
870
+ qt(e.orgUnits), Jt(e.positions), Xt(e.memberships);
843
871
  } catch (e) {
844
- M(Z(e));
872
+ N(li(e));
845
873
  } finally {
846
- pt(!1);
874
+ gt(!1);
847
875
  }
848
876
  }
849
- async function Vr() {
850
- pt(!0), M(null);
877
+ async function Xr() {
878
+ gt(!0), N(null), mt(null);
851
879
  try {
852
- let [e, t] = await Promise.all([ze(_e), we()]), n = e.versions.find((e) => e.status === "DRAFT") ?? null, r = n ?? e.versions[0] ?? null;
853
- be(e), Se(n), Vt(t.orgUnits), Ht(t.positions), Wt(t.memberships), It(cr(e.formVersions));
854
- let i = r?.workflowDefinition ?? On(), a = r?.formDefinitionVersionId ?? e.formVersions[0]?.id ?? null, o = r?.initiatorPolicyCel ?? null;
855
- it(i), at(a), ot(o), Ae(JSON.stringify({
880
+ let [e, t] = await Promise.all([Be(he), we()]), n = e.versions.find((e) => e.status === "DRAFT") ?? null, r = n ?? e.versions[0] ?? null;
881
+ ve(e), be(n), qt(t.orgUnits), Jt(t.positions), Xt(t.memberships), F(Cr(e.formVersions));
882
+ let i = Nn(r?.workflowDefinition ?? Ln()), a = r?.formDefinitionVersionId ?? e.formVersions[0]?.id ?? null, o = r?.initiatorPolicyCel ?? null;
883
+ ot(i), st(a), ct(o), Ce(JSON.stringify({
856
884
  formDefinitionVersionId: a,
857
885
  initiatorPolicyCel: o,
858
886
  workflowDefinition: i
859
- })), Ne(r && !e.template.currentVersionId && !r.initiatorPolicyCel && kn(r.workflowDefinition) ? "NONE" : null), We(null), st(r?.workflowDefinition.nodes[0]?.id ?? "start"), ct([]), lt(null), wn(null), Dn(!1);
887
+ })), je(r && !e.template.currentVersionId && !r.initiatorPolicyCel && Rn(r.workflowDefinition) ? "NONE" : null), Pe(null), lt(r?.workflowDefinition.nodes[0]?.id ?? "start"), ut([]), dt(null), Pn(null), In(!1);
860
888
  } catch (e) {
861
- M(Z(e));
889
+ N(li(e));
862
890
  } finally {
863
- pt(!1);
891
+ gt(!1);
864
892
  }
865
893
  }
866
- async function Gr(e) {
867
- Tt(!0), M(null);
894
+ async function ni(e) {
895
+ P(!0), N(null);
868
896
  try {
869
- It(hr(cr(await He(e)), J));
897
+ F(Ar(Cr(await Ue(e)), Y));
870
898
  } catch (e) {
871
- M(Z(e));
899
+ N(li(e));
872
900
  } finally {
873
- Tt(!1);
901
+ P(!1);
874
902
  }
875
903
  }
876
- async function X(e) {
877
- zt(!0), M(null);
904
+ async function Z(e) {
905
+ Ht(!0), N(null);
906
+ let t = ++Kt.current;
878
907
  try {
879
- let t = await Ve(e);
880
- Bt((e) => Dr(e, gr(t)));
908
+ let n = jr(await He(e));
909
+ Ut((e) => Vr(e, n)), t === Kt.current && Gt(n);
881
910
  } catch (e) {
882
- M(Z(e));
911
+ t === Kt.current && N(li(e));
883
912
  } finally {
884
- zt(!1);
913
+ t === Kt.current && Ht(!1);
885
914
  }
886
915
  }
887
- async function Jr(e) {
888
- let t = Or(e).filter((e) => !F.some((t) => t.memberId === e));
916
+ async function si(e) {
917
+ let t = Ur(e).filter((e) => !L.some((t) => t.memberId === e && !t.unresolved));
889
918
  if (t.length !== 0) try {
890
- let e = await Be(t);
891
- Bt((t) => Dr(t, gr(e)));
919
+ let e = await Ve(t);
920
+ Ut((t) => Vr(t, jr(e)));
892
921
  } catch {
893
- Bt((e) => Dr(e, t.map(_r)));
922
+ Ut((e) => Vr(e, t.map(Mr)));
894
923
  }
895
924
  }
896
- async function Yr(e) {
897
- St(!0), M(null);
925
+ async function ui(e) {
926
+ Tt(!0), N(null);
898
927
  try {
899
- let t = Pr(O), n = Zn(q);
928
+ let t = Yr(k), n = fr(J);
900
929
  if (t || n) {
901
930
  let e = t ?? n ?? "流程設定未完成";
902
- throw M(e), Error(e);
931
+ throw N(e), Error(e);
903
932
  }
904
- if (En && H !== null) await Fe({
905
- category: w?.template.category ?? null,
906
- categoryId: w?.template.categoryId ?? null,
907
- formDefinitionId: J?.formDefinitionId ?? null,
933
+ if (Fn && U !== null) await Ie({
934
+ category: E?.template.category ?? null,
935
+ categoryId: E?.template.categoryId ?? null,
936
+ formDefinitionId: Y?.formDefinitionId ?? null,
908
937
  formDescription: null,
909
- formName: J?.formName ?? w?.template.name ?? "表單",
910
- initiatorPolicyCel: A,
938
+ formName: Y?.formName ?? E?.template.name ?? "表單",
939
+ initiatorPolicyCel: j,
911
940
  notificationConfig: null,
912
941
  publish: e,
913
- schema: H.schema,
942
+ schema: U.schema,
914
943
  slaDefaults: null,
915
944
  templateDescription: null,
916
- templateId: _e ?? null,
917
- templateName: w?.template.name ?? "模板",
918
- uiSchema: H.uiSchema,
919
- workflowDefinition: O
920
- }), Dn(!1), wn(null), await Vr();
945
+ templateId: he ?? null,
946
+ templateName: E?.template.name ?? "模板",
947
+ uiSchema: U.uiSchema,
948
+ workflowDefinition: k
949
+ }), In(!1), Pn(null), await Xr();
921
950
  else {
922
- let t = await Ue({
923
- formDefinitionVersionId: k,
924
- initiatorPolicyCel: A,
925
- versionId: (xe ?? await Le(_e)).id,
926
- workflowDefinition: O
951
+ let t = await We({
952
+ formDefinitionVersionId: A,
953
+ initiatorPolicyCel: j,
954
+ versionId: (ye ?? await Re(he)).id,
955
+ workflowDefinition: k
927
956
  });
928
- Se(t), e && await Re(t.id), await Vr();
957
+ be(t), e && await ze(t.id), await Xr();
929
958
  }
930
959
  } catch (e) {
931
- throw M(Z(e)), e;
960
+ throw N(li(e)), e;
932
961
  } finally {
933
- St(!1);
962
+ Tt(!1);
934
963
  }
935
964
  }
936
- async function Xr() {
937
- await Yr(!1);
965
+ async function di() {
966
+ await ui(!1);
938
967
  }
939
- async function Zr() {
940
- await Yr(!0);
968
+ async function fi() {
969
+ await ui(!0);
941
970
  }
942
- function Qr() {
943
- mn(JSON.stringify(lr(J), null, 2)), gn(null), vn(null), Kt(!0);
971
+ function pi() {
972
+ Cn(JSON.stringify(wr(Y), null, 2)), Tn(null), H(null), ln(!0);
944
973
  }
945
- function $r() {
946
- qt || Kt(!1);
974
+ function mi() {
975
+ un || ln(!1);
947
976
  }
948
- async function ei() {
949
- nn(!0), vn(null), gn(null);
977
+ async function hi() {
978
+ xn(!0), H(null), Tn(null);
950
979
  try {
951
- gn(await Ie({
952
- formData: dr(rn),
953
- initiatorMemberId: sn,
954
- initiatorMetadataSnapshot: Sr(sn, Ut),
955
- workflowDefinition: O
980
+ Tn(await Le({
981
+ formData: Er(V),
982
+ initiatorMemberId: pn,
983
+ initiatorMetadataSnapshot: Ir(pn, Yt),
984
+ workflowDefinition: k
956
985
  }));
957
986
  } catch (e) {
958
- vn(Z(e));
987
+ H(li(e));
959
988
  } finally {
960
- nn(!1);
989
+ xn(!1);
961
990
  }
962
991
  }
963
- async function ti() {
964
- if (Sn(!0), H !== null) return;
965
- let e = J?.formDefinitionId ?? null;
992
+ async function gi() {
993
+ if (Mn(!0), U !== null) return;
994
+ let e = Y?.formDefinitionId ?? null;
966
995
  if (!e) {
967
- wn({
968
- schema: dn,
969
- uiSchema: fn
996
+ Pn({
997
+ schema: _n,
998
+ uiSchema: vn
970
999
  });
971
1000
  return;
972
1001
  }
973
- Yn(!0);
1002
+ ur(!0);
974
1003
  try {
975
- 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;
976
- wn({
977
- schema: n?.schema ?? dn,
978
- uiSchema: n?.uiSchema ?? fn
1004
+ let t = await xe(e), n = t.versions.find((e) => e.status === "DRAFT") ?? t.versions.find((e) => e.id === t.definition.currentVersionId) ?? t.versions[0] ?? null;
1005
+ Pn({
1006
+ schema: n?.schema ?? _n,
1007
+ uiSchema: n?.uiSchema ?? vn
979
1008
  });
980
1009
  } catch (e) {
981
- M(Z(e));
1010
+ N(li(e));
982
1011
  } finally {
983
- Yn(!1);
1012
+ ur(!1);
984
1013
  }
985
1014
  }
986
- function ni(e) {
987
- let t = Me(e, Cr);
988
- it((e) => ({
1015
+ function _i(e) {
1016
+ let t = Ne(e, Lr);
1017
+ ot((e) => ({
989
1018
  ...e,
990
1019
  nodes: e.nodes.map((e) => {
991
1020
  let n = t.find((t) => t.id === e.id);
@@ -996,86 +1025,111 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
996
1025
  })
997
1026
  }));
998
1027
  }
999
- function ri(e) {
1000
- !nr(e, O.nodes) || !e.source || !e.target || D.dispatch({
1028
+ function vi(e) {
1029
+ !_r(e, k.nodes) || !e.source || !e.target || O.dispatch({
1001
1030
  source: e.source,
1002
1031
  target: e.target,
1003
1032
  type: "connectEdge"
1004
1033
  });
1005
1034
  }
1006
- function ii(e, t) {
1007
- e.stopPropagation(), ct((n) => e.shiftKey || e.metaKey || e.ctrlKey ? rr(n, t.id) : [t.id]), st(null);
1035
+ function yi(e, t) {
1036
+ e.stopPropagation(), ut((n) => e.shiftKey || e.metaKey || e.ctrlKey ? vr(n, t.id) : [t.id]), lt(null);
1008
1037
  }
1009
- function ai() {
1010
- lt(null);
1038
+ function bi() {
1039
+ dt(null);
1011
1040
  }
1012
- function oi(e) {
1013
- D.dispatch({
1041
+ function xi(e) {
1042
+ O.dispatch({
1014
1043
  nodeType: e,
1015
1044
  type: "addNode"
1016
1045
  });
1017
1046
  }
1018
- function si(e) {
1019
- W && D.dispatch({
1047
+ function Si(e) {
1048
+ G && O.dispatch({
1020
1049
  label: e,
1021
- nodeId: W.id,
1050
+ nodeId: G.id,
1022
1051
  type: "renameNode"
1023
1052
  });
1024
1053
  }
1025
1054
  function Q(e) {
1026
- !W || W.type !== "userTask" || D.dispatch({
1055
+ if (!G || G.type !== "userTask") return;
1056
+ let t = G.id, n = G.data.decisionPolicy;
1057
+ O.dispatch({
1027
1058
  approverResolver: e,
1028
- nodeId: W.id,
1059
+ nodeId: t,
1029
1060
  type: "setUserTaskApprover"
1061
+ }), mt(null), $e(n, e) && mt({
1062
+ message: `簽核者已變更為 ${et(e)} 位,不足原本設定的 ${n?.type === "QUORUM" ? n.threshold : 0} 位門檻,簽核政策已重設為單人簽核,請重新設定。`,
1063
+ nodeId: t
1030
1064
  });
1031
1065
  }
1032
- function ci(e) {
1033
- !W || W.type !== "userTask" || D.dispatch({
1034
- nodeId: W.id,
1066
+ function Ci(e) {
1067
+ !G || G.type !== "userTask" || O.dispatch({
1068
+ nodeId: G.id,
1035
1069
  resubmitStrategy: e,
1036
1070
  type: "setUserTaskReturnResubmitStrategy"
1037
1071
  });
1038
1072
  }
1039
- function li(e) {
1040
- !W || W.type !== "userTask" || D.dispatch({
1041
- nodeId: W.id,
1073
+ function wi(e) {
1074
+ !G || G.type !== "userTask" || O.dispatch({
1075
+ nodeId: G.id,
1042
1076
  requireComment: e,
1043
1077
  type: "setUserTaskReturnRequireComment"
1044
1078
  });
1045
1079
  }
1046
1080
  function $(e) {
1047
- !W || W.type !== "userTask" || D.dispatch({
1048
- nodeId: W.id,
1081
+ !G || G.type !== "userTask" || O.dispatch({
1082
+ nodeId: G.id,
1049
1083
  sla: e,
1050
1084
  type: "setUserTaskSla"
1051
1085
  });
1052
1086
  }
1053
- function ui(e) {
1054
- !W || W.type !== "serviceTask" || D.dispatch({
1087
+ function Ti(e) {
1088
+ if (!G || G.type !== "userTask") return;
1089
+ mt(null);
1090
+ let t = e.type === "QUORUM" ? {
1091
+ ...e,
1092
+ threshold: Ze(e.threshold, e.thresholdType)
1093
+ } : e;
1094
+ O.dispatch({
1095
+ decisionPolicy: t,
1096
+ nodeId: G.id,
1097
+ type: "setUserTaskDecisionPolicy"
1098
+ });
1099
+ }
1100
+ function Ei(e) {
1101
+ !G || G.type !== "userTask" || O.dispatch({
1102
+ ...e,
1103
+ nodeId: G.id,
1104
+ type: "setUserTaskOptions"
1105
+ });
1106
+ }
1107
+ function Di(e) {
1108
+ !G || G.type !== "serviceTask" || O.dispatch({
1055
1109
  action: e,
1056
- nodeId: W.id,
1110
+ nodeId: G.id,
1057
1111
  type: "setServiceAction"
1058
1112
  });
1059
1113
  }
1060
- function di(e) {
1061
- We(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), Ne(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), ot($n(e, I));
1114
+ function Oi(e) {
1115
+ Pe(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), je(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), ct(mr(e, R));
1062
1116
  }
1063
- function fi(e) {
1064
- !W || W.type === "startEvent" || D.dispatch({
1065
- nodeId: W.id,
1117
+ function ki(e) {
1118
+ !G || G.type === "startEvent" || O.dispatch({
1119
+ nodeId: G.id,
1066
1120
  triggerMode: e,
1067
1121
  type: "setNodeTriggerMode"
1068
1122
  });
1069
1123
  }
1070
- function pi(e, t) {
1071
- D.dispatch({
1124
+ function Ai(e, t) {
1125
+ O.dispatch({
1072
1126
  edgeId: e,
1073
1127
  isDefault: t,
1074
1128
  type: "setEdgeDefault"
1075
1129
  });
1076
1130
  }
1077
- function mi({ edgeId: e, fieldKey: t, operator: n, value: r }) {
1078
- D.dispatch({
1131
+ function ji({ edgeId: e, fieldKey: t, operator: n, value: r }) {
1132
+ O.dispatch({
1079
1133
  edgeId: e,
1080
1134
  fieldKey: t,
1081
1135
  operator: n,
@@ -1083,279 +1137,284 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1083
1137
  value: r
1084
1138
  });
1085
1139
  }
1086
- function hi() {
1087
- D.dispatch({ type: "autoLayout" });
1140
+ function Mi() {
1141
+ O.dispatch({ type: "autoLayout" });
1088
1142
  }
1089
- return /* @__PURE__ */ C(x, { children: [
1090
- /* @__PURE__ */ S("style", { children: xt }),
1091
- i ? null : /* @__PURE__ */ S(ee, { children: /* @__PURE__ */ C(oe, {
1092
- description: `${xe ? `草稿 v${xe.version}` : "尚未建立草稿"} ·${w?.template.currentVersionId ? " 已發布版本" : " 尚未發布"}`,
1093
- onBackClick: er,
1094
- title: w?.template.name ?? "流程設計器",
1143
+ return /* @__PURE__ */ T(C, { children: [
1144
+ /* @__PURE__ */ w("style", { children: Et }),
1145
+ a ? null : /* @__PURE__ */ w(ee, { children: /* @__PURE__ */ T(ie, {
1146
+ description: `${ye ? `草稿 v${ye.version}` : "尚未建立草稿"} ·${E?.template.currentVersionId ? " 已發布版本" : " 尚未發布"}`,
1147
+ onBackClick: hr,
1148
+ title: E?.template.name ?? "流程設計器",
1095
1149
  children: [
1096
- he ? /* @__PURE__ */ S(h, {
1097
- disabled: !n,
1098
- onClick: () => V((e) => !e),
1099
- variant: yn ? "base-primary" : "base-secondary",
1100
- children: n ? "AI 助理" : "AI 助理(未設定)"
1150
+ pe ? /* @__PURE__ */ w(h, {
1151
+ disabled: !r,
1152
+ onClick: () => kn((e) => !e),
1153
+ variant: On ? "base-primary" : "base-secondary",
1154
+ children: r ? "AI 助理" : "AI 助理(未設定)"
1101
1155
  }) : null,
1102
- /* @__PURE__ */ S(h, {
1156
+ /* @__PURE__ */ w(h, {
1103
1157
  "aria-label": "儲存草稿",
1104
- disabled: bt || !!jr || !!Mr,
1105
- icon: fe,
1158
+ disabled: vt || !!Gr || !!Kr,
1159
+ icon: ue,
1106
1160
  iconType: "icon-only",
1107
- onClick: () => void Xr(),
1161
+ onClick: () => void di(),
1108
1162
  variant: "base-secondary",
1109
1163
  children: "儲存草稿"
1110
1164
  }),
1111
- ge ? /* @__PURE__ */ S(h, {
1112
- disabled: dt || !!jr || !!Mr,
1113
- icon: le,
1165
+ me ? /* @__PURE__ */ w(h, {
1166
+ disabled: ht || !!Gr || !!Kr,
1167
+ icon: se,
1114
1168
  iconType: "leading",
1115
- onClick: Qr,
1169
+ onClick: pi,
1116
1170
  variant: "base-secondary",
1117
1171
  children: "試跑流程"
1118
1172
  }) : null,
1119
- /* @__PURE__ */ S(h, {
1120
- disabled: bt || !xe && !P && !En || !!jr || !!Mr,
1121
- icon: se,
1173
+ /* @__PURE__ */ w(h, {
1174
+ disabled: vt || !ye && !I && !Fn || !!Gr || !!Kr,
1175
+ icon: ae,
1122
1176
  iconType: "leading",
1123
- onClick: () => void Zr(),
1177
+ onClick: () => void fi(),
1124
1178
  variant: "base-primary",
1125
- children: Qn
1179
+ children: pr
1126
1180
  })
1127
1181
  ]
1128
1182
  }) }),
1129
- /* @__PURE__ */ S(ne, { children: /* @__PURE__ */ S(te, { children: /* @__PURE__ */ C("div", {
1130
- style: mt,
1183
+ /* @__PURE__ */ w(ne, { children: /* @__PURE__ */ w(te, { children: /* @__PURE__ */ T("div", {
1184
+ style: yt,
1131
1185
  children: [
1132
- ut ? /* @__PURE__ */ S(b, {
1186
+ ft ? /* @__PURE__ */ w(S, {
1133
1187
  color: "text-error",
1134
1188
  variant: "body",
1135
- children: ut
1189
+ children: ft
1190
+ }) : null,
1191
+ pt && pt.nodeId === G?.id && G.type === "userTask" && (G.data.decisionPolicy?.type ?? "SINGLE") === "SINGLE" ? /* @__PURE__ */ w(S, {
1192
+ color: "text-warning",
1193
+ variant: "body",
1194
+ children: pt.message
1136
1195
  }) : null,
1137
- jr ? /* @__PURE__ */ S(b, {
1196
+ Gr ? /* @__PURE__ */ w(S, {
1138
1197
  color: "text-error",
1139
1198
  variant: "body",
1140
- children: jr
1199
+ children: Gr
1141
1200
  }) : null,
1142
- Mr ? /* @__PURE__ */ S(b, {
1201
+ Kr ? /* @__PURE__ */ w(S, {
1143
1202
  color: "text-error",
1144
1203
  variant: "body",
1145
- children: Mr
1204
+ children: Kr
1146
1205
  }) : null,
1147
- i ? null : /* @__PURE__ */ S("div", {
1148
- style: Ot,
1149
- children: /* @__PURE__ */ S(o, {
1150
- hintText: Y ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
1206
+ a ? null : /* @__PURE__ */ w("div", {
1207
+ style: Mt,
1208
+ children: /* @__PURE__ */ w(n, {
1209
+ hintText: X ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
1151
1210
  label: "綁定表單版本",
1152
1211
  name: "formDefinitionVersionId",
1153
1212
  required: !0,
1154
- children: /* @__PURE__ */ C("div", {
1155
- style: Mt,
1156
- children: [/* @__PURE__ */ S("div", {
1157
- style: Nt,
1158
- children: /* @__PURE__ */ S(m, {
1213
+ children: /* @__PURE__ */ T("div", {
1214
+ style: It,
1215
+ children: [/* @__PURE__ */ w("div", {
1216
+ style: Lt,
1217
+ children: /* @__PURE__ */ w(m, {
1159
1218
  asyncData: !0,
1160
- disabled: dt || Y,
1219
+ disabled: ht || X,
1161
1220
  disabledOptionsFilter: !0,
1162
1221
  emptyText: "沒有符合的已發布表單版本",
1163
- isForceClearable: !!k && !Y,
1164
- loading: Ct,
1222
+ isForceClearable: !!A && !X,
1223
+ loading: Dt,
1165
1224
  loadingText: "搜尋表單版本中...",
1166
1225
  mode: "single",
1167
1226
  onChange: (e) => {
1168
- Y || at(e?.id ?? null);
1227
+ X || st(e?.id ?? null);
1169
1228
  },
1170
1229
  onClear: () => {
1171
- Y || at(null);
1230
+ X || st(null);
1172
1231
  },
1173
- onSearch: Gr,
1232
+ onSearch: ni,
1174
1233
  onVisibilityChange: (e) => {
1175
- e && !Y && Gr("");
1234
+ e && !X && ni("");
1176
1235
  },
1177
- options: [...Er],
1236
+ options: [...Br],
1178
1237
  placeholder: "選擇已發布表單版本",
1179
1238
  searchDebounceTime: 300,
1180
- value: J
1239
+ value: Y
1181
1240
  })
1182
- }), /* @__PURE__ */ S(h, {
1183
- disabled: dt,
1241
+ }), /* @__PURE__ */ w(h, {
1242
+ disabled: ht,
1184
1243
  onClick: () => {
1185
- ti();
1244
+ gi();
1186
1245
  },
1187
- style: Pt,
1246
+ style: Rt,
1188
1247
  variant: "base-secondary",
1189
1248
  children: "編輯表單"
1190
1249
  })]
1191
1250
  })
1192
1251
  })
1193
1252
  }),
1194
- /* @__PURE__ */ C("div", {
1195
- style: ht,
1196
- children: [/* @__PURE__ */ S("div", {
1197
- ref: Ye,
1198
- style: gt,
1199
- children: /* @__PURE__ */ C(je, {
1253
+ /* @__PURE__ */ T("div", {
1254
+ style: bt,
1255
+ children: [/* @__PURE__ */ w("div", {
1256
+ ref: Fe,
1257
+ style: xt,
1258
+ children: /* @__PURE__ */ T(Me, {
1200
1259
  connectionMode: Ee.Strict,
1201
- edges: wr,
1260
+ edges: Rr,
1202
1261
  fitView: !0,
1203
- isValidConnection: (e) => nr(e, O.nodes),
1204
- nodeTypes: pn,
1205
- nodes: Cr,
1262
+ isValidConnection: (e) => _r(e, k.nodes),
1263
+ nodeTypes: yn,
1264
+ nodes: Lr,
1206
1265
  deleteKeyCode: null,
1207
1266
  multiSelectionKeyCode: [
1208
1267
  "Shift",
1209
1268
  "Meta",
1210
1269
  "Control"
1211
1270
  ],
1212
- onConnect: ri,
1213
- onEdgeClick: ii,
1271
+ onConnect: vi,
1272
+ onEdgeClick: yi,
1214
1273
  onNodeClick: (e, t) => {
1215
- st(t.id), ct([]);
1274
+ lt(t.id), ut([]);
1216
1275
  },
1217
- onNodesChange: ni,
1276
+ onNodesChange: _i,
1218
1277
  onPaneClick: () => {
1219
- st(null), ct([]);
1278
+ lt(null), ut([]);
1220
1279
  },
1221
- onViewportChange: $e,
1222
- viewport: Qe,
1280
+ onViewportChange: Ke,
1281
+ viewport: Ge,
1223
1282
  children: [
1224
- /* @__PURE__ */ S(Te, {}),
1225
- /* @__PURE__ */ S("style", { children: Et }),
1226
- /* @__PURE__ */ S(Oe, { children: or ? /* @__PURE__ */ S(De, {
1283
+ /* @__PURE__ */ w(Te, {}),
1284
+ /* @__PURE__ */ w("style", { children: At }),
1285
+ /* @__PURE__ */ w(Oe, { children: xr ? /* @__PURE__ */ w(De, {
1227
1286
  "aria-label": "刪除選取項目",
1228
1287
  className: "workflow-selection-delete-control",
1229
- onClick: ur,
1230
- style: _t,
1288
+ onClick: Tr,
1289
+ style: St,
1231
1290
  title: "刪除選取項目",
1232
- children: /* @__PURE__ */ S("span", {
1233
- style: vt,
1234
- children: /* @__PURE__ */ S(g, {
1291
+ children: /* @__PURE__ */ w("span", {
1292
+ style: Ct,
1293
+ children: /* @__PURE__ */ w(g, {
1235
1294
  color: "error",
1236
- icon: pe,
1295
+ icon: de,
1237
1296
  size: 16
1238
1297
  })
1239
1298
  })
1240
1299
  }) : null }),
1241
- /* @__PURE__ */ S(hn, { onApplyAutoLayout: hi }),
1242
- /* @__PURE__ */ S(ke, {})
1300
+ /* @__PURE__ */ w(Sn, { onApplyAutoLayout: Mi }),
1301
+ /* @__PURE__ */ w(Ae, {})
1243
1302
  ]
1244
1303
  })
1245
- }), /* @__PURE__ */ C("div", {
1246
- className: yt,
1247
- style: Dt,
1304
+ }), /* @__PURE__ */ T("div", {
1305
+ className: wt,
1306
+ style: jt,
1248
1307
  children: [
1249
- /* @__PURE__ */ S(b, {
1308
+ /* @__PURE__ */ w(S, {
1250
1309
  component: "h2",
1251
1310
  variant: "h3",
1252
1311
  children: "流程工具"
1253
1312
  }),
1254
- i && he ? /* @__PURE__ */ C("div", {
1255
- style: Ft,
1256
- children: [/* @__PURE__ */ S(b, {
1313
+ a && pe ? /* @__PURE__ */ T("div", {
1314
+ style: zt,
1315
+ children: [/* @__PURE__ */ w(S, {
1257
1316
  color: "text-neutral",
1258
1317
  variant: "caption",
1259
1318
  children: "AI 協助"
1260
- }), /* @__PURE__ */ S("div", {
1261
- style: jt,
1262
- children: /* @__PURE__ */ S(h, {
1263
- disabled: !n,
1264
- onClick: () => V((e) => !e),
1319
+ }), /* @__PURE__ */ w("div", {
1320
+ style: Ft,
1321
+ children: /* @__PURE__ */ w(h, {
1322
+ disabled: !r,
1323
+ onClick: () => kn((e) => !e),
1265
1324
  size: "sub",
1266
- variant: yn ? "base-primary" : "base-secondary",
1267
- children: n ? "AI 助理" : "AI 助理(未設定)"
1325
+ variant: On ? "base-primary" : "base-secondary",
1326
+ children: r ? "AI 助理" : "AI 助理(未設定)"
1268
1327
  })
1269
1328
  })]
1270
1329
  }) : null,
1271
- /* @__PURE__ */ C("div", {
1272
- style: Ft,
1273
- children: [/* @__PURE__ */ S(b, {
1330
+ /* @__PURE__ */ T("div", {
1331
+ style: zt,
1332
+ children: [/* @__PURE__ */ w(S, {
1274
1333
  color: "text-neutral",
1275
1334
  variant: "caption",
1276
1335
  children: "動作節點"
1277
- }), /* @__PURE__ */ S("div", {
1278
- style: jt,
1279
- children: Yt.map((e) => /* @__PURE__ */ S(h, {
1336
+ }), /* @__PURE__ */ w("div", {
1337
+ style: Ft,
1338
+ children: $t.map((e) => /* @__PURE__ */ w(h, {
1280
1339
  icon: e.icon,
1281
1340
  iconType: "leading",
1282
- onClick: () => oi(e.type),
1341
+ onClick: () => xi(e.type),
1283
1342
  size: "sub",
1284
1343
  variant: "base-secondary",
1285
1344
  children: e.label
1286
1345
  }, e.type))
1287
1346
  })]
1288
1347
  }),
1289
- /* @__PURE__ */ C("div", {
1290
- style: Ft,
1291
- children: [/* @__PURE__ */ S(b, {
1348
+ /* @__PURE__ */ T("div", {
1349
+ style: zt,
1350
+ children: [/* @__PURE__ */ w(S, {
1292
1351
  color: "text-neutral",
1293
1352
  variant: "caption",
1294
1353
  children: "流程控制"
1295
- }), /* @__PURE__ */ S("div", {
1296
- style: jt,
1297
- children: Xt.map((e) => /* @__PURE__ */ S(h, {
1354
+ }), /* @__PURE__ */ w("div", {
1355
+ style: Ft,
1356
+ children: en.map((e) => /* @__PURE__ */ w(h, {
1298
1357
  icon: e.icon,
1299
1358
  iconType: "leading",
1300
- onClick: () => oi(e.type),
1359
+ onClick: () => xi(e.type),
1301
1360
  size: "sub",
1302
1361
  variant: "base-secondary",
1303
1362
  children: e.label
1304
1363
  }, e.type))
1305
1364
  })]
1306
1365
  }),
1307
- K.length > 1 ? Si(K) : null,
1308
- K.length === 1 && G ? Ci(G) : null,
1309
- K.length === 0 && W ? _i(W) : null
1366
+ q.length > 1 ? zi(q) : null,
1367
+ q.length === 1 && K ? Bi(K) : null,
1368
+ q.length === 0 && G ? Pi(G) : null
1310
1369
  ]
1311
1370
  })]
1312
1371
  })
1313
1372
  ]
1314
1373
  }) }) }),
1315
- wi(fr),
1316
- !i && ge ? gi() : null,
1317
- he && n ? /* @__PURE__ */ S(ft, {
1318
- controller: D,
1319
- onClose: () => V(!1),
1320
- open: yn
1374
+ Vi(Dr),
1375
+ !a && me ? Ni() : null,
1376
+ pe && r ? /* @__PURE__ */ w(_t, {
1377
+ controller: O,
1378
+ onClose: () => kn(!1),
1379
+ open: On
1321
1380
  }) : null,
1322
- i ? null : /* @__PURE__ */ S(ae, {
1381
+ a ? null : /* @__PURE__ */ w(re, {
1323
1382
  headerTitle: "編輯表單",
1324
1383
  isHeaderDisplay: !0,
1325
- onClose: () => Sn(!1),
1326
- open: xn,
1384
+ onClose: () => Mn(!1),
1385
+ open: An,
1327
1386
  size: "wide",
1328
- children: /* @__PURE__ */ C("div", {
1329
- style: cn,
1330
- children: [/* @__PURE__ */ S("div", {
1331
- style: ln,
1332
- children: Vn ? /* @__PURE__ */ S(b, {
1387
+ children: /* @__PURE__ */ T("div", {
1388
+ style: mn,
1389
+ children: [/* @__PURE__ */ w("div", {
1390
+ style: hn,
1391
+ children: nr ? /* @__PURE__ */ w(S, {
1333
1392
  color: "text-neutral",
1334
1393
  variant: "body",
1335
1394
  children: "載入中…"
1336
- }) : /* @__PURE__ */ S(s, {
1395
+ }) : /* @__PURE__ */ w(s, {
1337
1396
  onChange: (e) => {
1338
- wn(e);
1397
+ Pn(e);
1339
1398
  },
1340
- value: H ?? {
1341
- schema: dn,
1342
- uiSchema: fn
1399
+ value: U ?? {
1400
+ schema: _n,
1401
+ uiSchema: vn
1343
1402
  }
1344
1403
  })
1345
- }), /* @__PURE__ */ C("div", {
1346
- style: un,
1347
- children: [/* @__PURE__ */ S(h, {
1348
- disabled: Vn,
1404
+ }), /* @__PURE__ */ T("div", {
1405
+ style: gn,
1406
+ children: [/* @__PURE__ */ w(h, {
1407
+ disabled: nr,
1349
1408
  onClick: () => {
1350
- H !== null && (Dn(!0), D.replaceState((e) => ({
1409
+ U !== null && (In(!0), O.replaceState((e) => ({
1351
1410
  ...e,
1352
- formSchema: H.schema
1353
- }))), Sn(!1);
1411
+ formSchema: U.schema
1412
+ }))), Mn(!1);
1354
1413
  },
1355
1414
  variant: "base-primary",
1356
1415
  children: "套用"
1357
- }), /* @__PURE__ */ S(h, {
1358
- onClick: () => Sn(!1),
1416
+ }), /* @__PURE__ */ w(h, {
1417
+ onClick: () => Mn(!1),
1359
1418
  variant: "base-secondary",
1360
1419
  children: "取消"
1361
1420
  })]
@@ -1363,79 +1422,79 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1363
1422
  })
1364
1423
  })
1365
1424
  ] });
1366
- function gi() {
1367
- return /* @__PURE__ */ S(v, {
1425
+ function Ni() {
1426
+ return /* @__PURE__ */ w(v, {
1368
1427
  cancelText: "關閉",
1369
1428
  confirmText: "執行試跑",
1370
- loading: qt,
1429
+ loading: un,
1371
1430
  modalType: "standard",
1372
- onCancel: $r,
1373
- onClose: $r,
1374
- onConfirm: () => void ei(),
1375
- open: Gt,
1431
+ onCancel: mi,
1432
+ onClose: mi,
1433
+ onConfirm: () => void hi(),
1434
+ open: Zt,
1376
1435
  showModalFooter: !0,
1377
1436
  showModalHeader: !0,
1378
1437
  size: "wide",
1379
- supportingText: `使用 ${sn} 與範例表單資料模擬目前畫布流程,不會建立案件。`,
1438
+ supportingText: `使用 ${pn} 與範例表單資料模擬目前畫布流程,不會建立案件。`,
1380
1439
  title: "試跑流程",
1381
- children: /* @__PURE__ */ C("div", {
1382
- style: Ot,
1440
+ children: /* @__PURE__ */ T("div", {
1441
+ style: Mt,
1383
1442
  children: [
1384
- /* @__PURE__ */ S(o, {
1443
+ /* @__PURE__ */ w(n, {
1385
1444
  label: "表單資料 JSON",
1386
1445
  name: "dryRunFormDataJson",
1387
1446
  required: !0,
1388
- children: /* @__PURE__ */ S(re, {
1389
- onChange: (e) => mn(e.target.value),
1447
+ children: /* @__PURE__ */ w(b, {
1448
+ onChange: (e) => Cn(e.target.value),
1390
1449
  resize: "vertical",
1391
1450
  rows: 8,
1392
- value: rn
1451
+ value: V
1393
1452
  })
1394
1453
  }),
1395
- _n ? /* @__PURE__ */ S(b, {
1454
+ En ? /* @__PURE__ */ w(S, {
1396
1455
  color: "text-error",
1397
1456
  variant: "body",
1398
- children: _n
1457
+ children: En
1399
1458
  }) : null,
1400
- B ? /* @__PURE__ */ C("div", {
1401
- style: kt,
1459
+ wn ? /* @__PURE__ */ T("div", {
1460
+ style: Nt,
1402
1461
  children: [
1403
- /* @__PURE__ */ S(b, {
1404
- color: B.valid ? "text-success" : "text-error",
1462
+ /* @__PURE__ */ w(S, {
1463
+ color: wn.valid ? "text-success" : "text-error",
1405
1464
  variant: "label-primary-highlight",
1406
- children: B.valid ? "試跑通過" : "試跑失敗"
1465
+ children: wn.valid ? "試跑通過" : "試跑失敗"
1407
1466
  }),
1408
- B.errors.map((e) => /* @__PURE__ */ S(b, {
1467
+ wn.errors.map((e) => /* @__PURE__ */ w(S, {
1409
1468
  color: "text-error",
1410
1469
  variant: "body",
1411
1470
  children: e
1412
1471
  }, e)),
1413
- B.steps.map((e) => /* @__PURE__ */ C("div", {
1414
- style: At,
1472
+ wn.steps.map((e) => /* @__PURE__ */ T("div", {
1473
+ style: Pt,
1415
1474
  children: [
1416
- /* @__PURE__ */ C(b, {
1475
+ /* @__PURE__ */ T(S, {
1417
1476
  variant: "label-primary-highlight",
1418
1477
  children: [
1419
1478
  e.nodeLabel,
1420
1479
  " · ",
1421
- pr(e.status)
1480
+ Or(e.status)
1422
1481
  ]
1423
1482
  }),
1424
- /* @__PURE__ */ C(b, {
1483
+ /* @__PURE__ */ T(S, {
1425
1484
  color: "text-neutral",
1426
1485
  variant: "caption",
1427
1486
  children: [
1428
- mr(e.nodeType),
1487
+ kr(e.nodeType),
1429
1488
  e.assigneeMemberId ? ` · 處理者:${e.assigneeMemberId}` : "",
1430
1489
  e.edgeLabel ? ` · 來源線段:${e.edgeLabel}` : ""
1431
1490
  ]
1432
1491
  }),
1433
- e.edgeReason ? /* @__PURE__ */ S(b, {
1492
+ e.edgeReason ? /* @__PURE__ */ w(S, {
1434
1493
  color: "text-neutral",
1435
1494
  variant: "caption",
1436
1495
  children: e.edgeReason
1437
1496
  }) : null,
1438
- e.entryCondition ? /* @__PURE__ */ C(b, {
1497
+ e.entryCondition ? /* @__PURE__ */ T(S, {
1439
1498
  color: "text-neutral",
1440
1499
  variant: "caption",
1441
1500
  children: [
@@ -1446,7 +1505,7 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1446
1505
  e.entryCondition
1447
1506
  ]
1448
1507
  }) : null,
1449
- /* @__PURE__ */ S(b, {
1508
+ /* @__PURE__ */ w(S, {
1450
1509
  color: "text-neutral",
1451
1510
  variant: "body",
1452
1511
  children: e.message
@@ -1459,158 +1518,159 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1459
1518
  })
1460
1519
  });
1461
1520
  }
1462
- function _i(e) {
1463
- return /* @__PURE__ */ C("div", {
1464
- style: Ot,
1521
+ function Pi(e) {
1522
+ return /* @__PURE__ */ T("div", {
1523
+ style: Mt,
1465
1524
  children: [
1466
- /* @__PURE__ */ S(b, {
1525
+ /* @__PURE__ */ w(S, {
1467
1526
  component: "h2",
1468
1527
  variant: "h3",
1469
1528
  children: "節點屬性"
1470
1529
  }),
1471
- /* @__PURE__ */ C(b, {
1530
+ /* @__PURE__ */ T(S, {
1472
1531
  color: "text-neutral",
1473
1532
  variant: "body",
1474
1533
  children: [
1475
- Jt[e.type],
1534
+ Qt[e.type],
1476
1535
  " · ",
1477
1536
  e.id
1478
1537
  ]
1479
1538
  }),
1480
- /* @__PURE__ */ S(o, {
1539
+ /* @__PURE__ */ w(n, {
1481
1540
  label: "顯示名稱",
1482
1541
  name: "nodeLabel",
1483
1542
  required: !0,
1484
- children: /* @__PURE__ */ S(_, {
1485
- onChange: (e) => si(e.target.value),
1543
+ children: /* @__PURE__ */ w(_, {
1544
+ onChange: (e) => Si(e.target.value),
1486
1545
  value: e.data.label,
1487
1546
  variant: "base"
1488
1547
  })
1489
1548
  }),
1490
- e.type === "startEvent" ? vi() : null,
1491
- e.type === "startEvent" ? null : yi(e),
1492
- e.type === "userTask" ? bi(e) : null,
1493
- e.type === "serviceTask" ? xi(e) : null
1549
+ e.type === "startEvent" ? Fi() : null,
1550
+ e.type === "startEvent" ? null : Ii(e),
1551
+ e.type === "userTask" ? Li(e) : null,
1552
+ e.type === "serviceTask" ? Ri(e) : null
1494
1553
  ]
1495
1554
  });
1496
1555
  }
1497
- function vi() {
1498
- let e = q.mode === "CUSTOM" ? [...an, on] : [...an], t = q.mode === "ORG_UNIT" || q.mode === "ORG_UNIT_POSITION" ? br(I, q.orgUnitId ?? "") : null, n = q.mode === "ORG_UNIT_POSITION" ? xr(L, q.positionId ?? "") : null, i = q.mode === "ORG_UNIT_POSITION" ? Tr({
1499
- includeDescendants: !!q.includeDescendants,
1500
- memberships: Ut,
1501
- orgUnitId: q.orgUnitId ?? "",
1502
- orgUnits: I,
1503
- positions: L
1556
+ function Fi() {
1557
+ let e = J.mode === "CUSTOM" ? [...dn, fn] : [...dn], t = J.mode === "ORG_UNIT" || J.mode === "ORG_UNIT_POSITION" ? Pr(R, J.orgUnitId ?? "") : null, r = J.mode === "ORG_UNIT_POSITION" ? Fr(z, J.positionId ?? "") : null, a = J.mode === "ORG_UNIT_POSITION" ? zr({
1558
+ includeDescendants: !!J.includeDescendants,
1559
+ memberships: Yt,
1560
+ orgUnitId: J.orgUnitId ?? "",
1561
+ orgUnits: R,
1562
+ positions: z
1504
1563
  }) : [];
1505
- return /* @__PURE__ */ C(x, { children: [
1506
- /* @__PURE__ */ S(o, {
1507
- hintText: q.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
1564
+ return /* @__PURE__ */ T(C, { children: [
1565
+ /* @__PURE__ */ w(n, {
1566
+ hintText: J.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
1508
1567
  label: "發起權限",
1509
1568
  name: "initiatorPolicyMode",
1510
1569
  required: !0,
1511
- children: /* @__PURE__ */ S(y, {
1570
+ children: /* @__PURE__ */ w(y, {
1512
1571
  clearable: !1,
1513
1572
  onChange: (e) => {
1514
1573
  if (e?.id === "CUSTOM") {
1515
- Ne(null), We(null);
1574
+ je(null), Pe(null);
1516
1575
  return;
1517
1576
  }
1518
- let t = Jn(e?.id ?? null), n = tr(t);
1519
- Ne(t === "ALL" ? null : t), We(t === "ALL" ? null : n), ot($n(n, I));
1577
+ let t = lr(e?.id ?? null), n = gr(t);
1578
+ je(t === "ALL" ? null : t), Pe(t === "ALL" ? null : n), ct(mr(n, R));
1520
1579
  },
1521
1580
  options: e,
1522
1581
  placeholder: "選擇誰可以發起",
1523
- value: U(e, q.mode)
1582
+ value: W(e, J.mode)
1524
1583
  })
1525
1584
  }),
1526
- q.mode === "ORG_UNIT" || q.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ S(o, {
1585
+ J.mode === "ORG_UNIT" || J.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
1527
1586
  label: "組織",
1528
1587
  name: "initiatorOrgUnitId",
1529
1588
  required: !0,
1530
- children: /* @__PURE__ */ S(r, {
1589
+ children: /* @__PURE__ */ w(i, {
1531
1590
  name: "initiatorOrgUnitId",
1532
- onChange: (e) => di({
1533
- ...q,
1591
+ onChange: (e) => Oi({
1592
+ ...J,
1534
1593
  orgUnitId: e?.id ?? "",
1535
1594
  positionId: "",
1536
1595
  value: e?.id ?? ""
1537
1596
  }),
1538
- orgUnits: I,
1597
+ orgUnits: R,
1539
1598
  placeholder: "選擇組織",
1540
1599
  value: t
1541
1600
  })
1542
1601
  }) : null,
1543
- q.mode === "ORG_UNIT" || q.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ S(o, {
1602
+ J.mode === "ORG_UNIT" || J.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
1544
1603
  label: "包含下層",
1545
1604
  name: "initiatorIncludeDescendants",
1546
- children: /* @__PURE__ */ S(ie, {
1547
- checked: !!q.includeDescendants,
1548
- onChange: (e) => di({
1549
- ...q,
1605
+ children: /* @__PURE__ */ w(x, {
1606
+ checked: !!J.includeDescendants,
1607
+ onChange: (e) => Oi({
1608
+ ...J,
1550
1609
  includeDescendants: e.target.checked,
1551
- ...q.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
1610
+ ...J.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
1552
1611
  })
1553
1612
  })
1554
1613
  }) : null,
1555
- q.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ S(o, {
1614
+ J.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
1556
1615
  label: "職位",
1557
1616
  name: "initiatorPositionId",
1558
1617
  required: !0,
1559
- children: /* @__PURE__ */ S(a, {
1560
- disabled: !q.orgUnitId?.trim(),
1618
+ children: /* @__PURE__ */ w(o, {
1619
+ disabled: !J.orgUnitId?.trim(),
1561
1620
  name: "initiatorPositionId",
1562
- onChange: (e) => di({
1563
- ...q,
1621
+ onChange: (e) => Oi({
1622
+ ...J,
1564
1623
  positionId: e?.id ?? ""
1565
1624
  }),
1566
- placeholder: q.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
1567
- positions: i,
1568
- value: n
1625
+ placeholder: J.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
1626
+ positions: a,
1627
+ value: r
1569
1628
  })
1570
1629
  }) : null
1571
1630
  ] });
1572
1631
  }
1573
- function yi(e) {
1574
- let t = O.edges.filter((t) => t.target === e.id).length, n = t < 2, r = n ? "AND" : e.data.triggerMode ?? "AND";
1575
- return /* @__PURE__ */ S(o, {
1576
- hintText: n ? "需要至少兩條前置連線,才可切換為任一前置完成。" : t > 1 ? `${t} 條前置連線會依此規則觸發。` : "只有一條前置連線時,兩種設定效果相同。",
1632
+ function Ii(e) {
1633
+ let t = k.edges.filter((t) => t.target === e.id).length, r = t < 2, i = r ? "AND" : e.data.triggerMode ?? "AND";
1634
+ return /* @__PURE__ */ w(n, {
1635
+ hintText: r ? "需要至少兩條前置連線,才可切換為任一前置完成。" : t > 1 ? `${t} 條前置連線會依此規則觸發。` : "只有一條前置連線時,兩種設定效果相同。",
1577
1636
  label: "前置條件",
1578
1637
  name: "triggerMode",
1579
1638
  required: !0,
1580
- children: /* @__PURE__ */ S(y, {
1639
+ children: /* @__PURE__ */ w(y, {
1581
1640
  clearable: !1,
1582
- onChange: (e) => n ? void 0 : fi(jn(e?.id ?? null)),
1583
- options: [...Zt],
1584
- readOnly: n,
1585
- value: U(Zt, r)
1641
+ onChange: (e) => r ? void 0 : ki(Bn(e?.id ?? null)),
1642
+ options: [...tn],
1643
+ readOnly: r,
1644
+ value: W(tn, i)
1586
1645
  })
1587
1646
  });
1588
1647
  }
1589
- function bi(e) {
1590
- let t = e.data.approverResolver, n = Hn(t.type), i = t.type === "DIRECT" ? yr(t.memberIds, F) : null, s = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? br(I, t.orgUnitId) : null, c = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? xr(L, t.positionId) : null, l = t.type === "ORG_UNIT_POSITION" ? Tr({
1648
+ function Li(e) {
1649
+ let t = e.data.approverResolver, r = rr(t.type), a = t.type === "DIRECT" ? t.memberIds.map((e) => Nr(L, e)) : [], s = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? Pr(R, t.orgUnitId) : null, c = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? Fr(z, t.positionId) : null, l = t.type === "ORG_UNIT_POSITION" ? zr({
1591
1650
  includeDescendants: !!t.includeDescendants,
1592
- memberships: Ut,
1651
+ memberships: Yt,
1593
1652
  orgUnitId: t.orgUnitId,
1594
- orgUnits: I,
1595
- positions: L
1596
- }) : [], u = t.type === "ORG_MANAGER" ? Kn(t.levelsUp) : R[0], d = t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, f = d.type === "DIRECT" ? vr(F, d.memberId) : null, p = e.data.returnBehavior.resubmitStrategy ?? "RESTART", h = e.data.sla ?? null, g = h ? Xe(h.duration) : null, v = g?.unit ?? "DAY", ee = In(h?.warningAt ?? null), te = Kn(h?.escalateLevelsUp ?? 1);
1597
- return /* @__PURE__ */ C(x, { children: [
1598
- /* @__PURE__ */ S(o, {
1653
+ orgUnits: R,
1654
+ positions: z
1655
+ }) : [], u = t.type === "ORG_MANAGER" ? sr(t.levelsUp) : B[0], d = t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, f = d.type === "DIRECT" && d.memberId ? Nr(L, d.memberId) : null, p = e.data.returnBehavior.resubmitStrategy ?? "RESTART", h = e.data.sla ?? null, g = h ? tt(h.duration) : null, v = g?.unit ?? "DAY", ee = Zn(h?.warningAt ?? null), te = sr(h?.escalateLevelsUp ?? 1), ne = Un(e.data.decisionPolicy), b = Kn(e.data.decisionPolicy);
1656
+ return /* @__PURE__ */ T(C, { children: [
1657
+ /* @__PURE__ */ w(n, {
1599
1658
  label: "簽核來源",
1600
1659
  name: "approverResolverType",
1601
1660
  required: !0,
1602
- children: /* @__PURE__ */ S(y, {
1661
+ children: /* @__PURE__ */ w(y, {
1603
1662
  clearable: !1,
1604
- onChange: (e) => Q(Un(e?.id ?? null)),
1605
- options: [...en],
1606
- value: U(en, n)
1663
+ onChange: (e) => Q(ir(e?.id ?? null)),
1664
+ options: [...an],
1665
+ value: W(an, r)
1607
1666
  })
1608
1667
  }),
1609
- t.type === "DIRECT" ? /* @__PURE__ */ S(o, {
1668
+ t.type === "DIRECT" ? /* @__PURE__ */ w(n, {
1669
+ hintText: Hn(e.data.decisionPolicy),
1610
1670
  label: "簽核者",
1611
1671
  name: "memberId",
1612
1672
  required: !0,
1613
- children: /* @__PURE__ */ S(m, {
1673
+ children: /* @__PURE__ */ w(m, {
1614
1674
  asyncData: !0,
1615
1675
  disabledOptionsFilter: !0,
1616
1676
  emptyText: "沒有符合的成員",
@@ -1620,45 +1680,45 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1620
1680
  name: "workflow-approver-search",
1621
1681
  spellCheck: !1
1622
1682
  },
1623
- loading: Rt,
1683
+ loading: Vt,
1624
1684
  loadingText: "搜尋成員中...",
1625
- mode: "single",
1685
+ mode: "multiple",
1626
1686
  onChange: (e) => Q({
1627
- memberIds: e?.id ? [e.id] : [],
1687
+ memberIds: e.map((e) => e.id),
1628
1688
  type: "DIRECT"
1629
1689
  }),
1630
- onSearch: X,
1690
+ onSearch: Z,
1631
1691
  onVisibilityChange: (e) => {
1632
- e && X("");
1692
+ e && (Gt([]), Z(""));
1633
1693
  },
1634
- options: [...F],
1694
+ options: [...Vr(a, Wt)],
1635
1695
  placeholder: "搜尋姓名或信箱",
1636
1696
  searchDebounceTime: 300,
1637
- value: i
1697
+ value: a
1638
1698
  })
1639
1699
  }) : null,
1640
- t.type === "ORG_MANAGER" ? /* @__PURE__ */ S(o, {
1700
+ t.type === "ORG_MANAGER" ? /* @__PURE__ */ w(n, {
1641
1701
  hintText: "依發起人的有效會員歸屬與主管解析規則決定簽核人。",
1642
1702
  label: "主管層級",
1643
1703
  name: "managerLevelsUp",
1644
1704
  required: !0,
1645
- children: /* @__PURE__ */ S(y, {
1705
+ children: /* @__PURE__ */ w(y, {
1646
1706
  clearable: !1,
1647
1707
  onChange: (e) => Q({
1648
1708
  baseFromInitiator: !0,
1649
- levelsUp: qn(e?.id ?? null).value,
1709
+ levelsUp: cr(e?.id ?? null).value,
1650
1710
  type: "ORG_MANAGER"
1651
1711
  }),
1652
- options: [...R],
1712
+ options: [...B],
1653
1713
  value: u
1654
1714
  })
1655
1715
  }) : null,
1656
- t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ S(o, {
1716
+ t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
1657
1717
  hintText: t.type === "ORG_UNIT_MANAGER" ? "依指定組織或其上層的主管解析規則決定簽核人。" : "依指定組織目前有效會員歸屬建立候選簽核人。",
1658
1718
  label: "組織",
1659
1719
  name: "orgUnitId",
1660
1720
  required: !0,
1661
- children: /* @__PURE__ */ S(r, {
1721
+ children: /* @__PURE__ */ w(i, {
1662
1722
  name: "orgUnitId",
1663
1723
  onChange: (e) => Q(t.type === "ORG_UNIT_MEMBER" ? {
1664
1724
  includeDescendants: t.includeDescendants,
@@ -1674,77 +1734,96 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1674
1734
  orgUnitId: e?.id ?? "",
1675
1735
  type: "ORG_UNIT_MANAGER"
1676
1736
  }),
1677
- orgUnits: I,
1737
+ orgUnits: R,
1678
1738
  placeholder: "選擇組織",
1679
1739
  value: s
1680
1740
  })
1681
1741
  }) : null,
1682
- t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(o, {
1683
- hintText: "預設會停止流程並提示;若設定固定人,找不到主管時會改派給該會員。",
1684
- label: "無主管時",
1685
- name: "approverFallbackMode",
1686
- required: !0,
1687
- children: /* @__PURE__ */ S(y, {
1688
- clearable: !1,
1689
- onChange: (e) => Q(Gn(t, Wn(e?.id ?? null) === "DIRECT" ? {
1690
- memberId: "",
1691
- type: "DIRECT"
1692
- } : { type: "NONE" })),
1693
- options: [...tn],
1694
- value: U(tn, d.type)
1695
- })
1696
- }), d.type === "DIRECT" ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(o, {
1697
- label: "改派人員",
1698
- name: "approverFallbackMemberId",
1699
- required: !0,
1700
- children: /* @__PURE__ */ S(m, {
1701
- asyncData: !0,
1702
- disabledOptionsFilter: !0,
1703
- emptyText: "沒有符合的成員",
1704
- inputProps: {
1705
- autoCapitalize: "none",
1706
- autoCorrect: "off",
1707
- name: "workflow-approver-fallback-search",
1708
- spellCheck: !1
1709
- },
1710
- loading: Rt,
1711
- loadingText: "搜尋成員中...",
1712
- mode: "single",
1713
- onChange: (e) => Q(Gn(t, {
1714
- allowInitiatorSelfApproval: d.allowInitiatorSelfApproval,
1715
- memberId: e?.id ?? "",
1716
- type: "DIRECT"
1717
- })),
1718
- onSearch: X,
1719
- onVisibilityChange: (e) => {
1720
- e && X("");
1721
- },
1722
- options: [...F],
1723
- placeholder: "搜尋姓名或信箱",
1724
- searchDebounceTime: 300,
1725
- value: f
1726
- })
1727
- }), /* @__PURE__ */ S(o, {
1728
- hintText: "預設禁止申請人簽自己的案件;只有此流程允許自簽時才開啟。",
1729
- label: "允許自簽",
1730
- name: "allowInitiatorSelfApproval",
1731
- children: /* @__PURE__ */ S(ie, {
1732
- checked: !!d.allowInitiatorSelfApproval,
1733
- inputProps: {
1734
- id: "allowInitiatorSelfApproval",
1735
- name: "allowInitiatorSelfApproval"
1736
- },
1737
- onChange: (e) => Q(Gn(t, {
1738
- allowInitiatorSelfApproval: e.target.checked,
1739
- memberId: d.memberId,
1740
- type: "DIRECT"
1741
- }))
1742
- })
1743
- })] }) : null] }) : null,
1744
- t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ S(o, {
1742
+ t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ T(C, { children: [
1743
+ /* @__PURE__ */ w(n, {
1744
+ hintText: "開啟後只取離該員最近一層的主管規則;掛在上層單位、涵蓋範圍較大的規則不會再一併加入簽核人。",
1745
+ label: "只取最近一層主管",
1746
+ name: "preferClosestOrgUnit",
1747
+ children: /* @__PURE__ */ w(x, {
1748
+ checked: !!t.preferClosestOrgUnit,
1749
+ inputProps: {
1750
+ id: "preferClosestOrgUnit",
1751
+ name: "preferClosestOrgUnit"
1752
+ },
1753
+ onChange: (e) => Q({
1754
+ ...t,
1755
+ preferClosestOrgUnit: e.target.checked
1756
+ })
1757
+ })
1758
+ }),
1759
+ /* @__PURE__ */ w(n, {
1760
+ hintText: "預設會停止流程並提示;若設定固定人,找不到主管時會改派給該會員。",
1761
+ label: "無主管時",
1762
+ name: "approverFallbackMode",
1763
+ required: !0,
1764
+ children: /* @__PURE__ */ w(y, {
1765
+ clearable: !1,
1766
+ onChange: (e) => Q(or(t, ar(e?.id ?? null) === "DIRECT" ? {
1767
+ memberId: "",
1768
+ type: "DIRECT"
1769
+ } : { type: "NONE" })),
1770
+ options: [...cn],
1771
+ value: W(cn, d.type)
1772
+ })
1773
+ }),
1774
+ d.type === "DIRECT" ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(n, {
1775
+ label: "改派人員",
1776
+ name: "approverFallbackMemberId",
1777
+ required: !0,
1778
+ children: /* @__PURE__ */ w(m, {
1779
+ asyncData: !0,
1780
+ disabledOptionsFilter: !0,
1781
+ emptyText: "沒有符合的成員",
1782
+ inputProps: {
1783
+ autoCapitalize: "none",
1784
+ autoCorrect: "off",
1785
+ name: "workflow-approver-fallback-search",
1786
+ spellCheck: !1
1787
+ },
1788
+ loading: Vt,
1789
+ loadingText: "搜尋成員中...",
1790
+ mode: "single",
1791
+ onChange: (e) => Q(or(t, {
1792
+ allowInitiatorSelfApproval: d.allowInitiatorSelfApproval,
1793
+ memberId: e?.id ?? "",
1794
+ type: "DIRECT"
1795
+ })),
1796
+ onSearch: Z,
1797
+ onVisibilityChange: (e) => {
1798
+ e && (Gt([]), Z(""));
1799
+ },
1800
+ options: [...Vr(Wt, f ? [f] : [])],
1801
+ placeholder: "搜尋姓名或信箱",
1802
+ searchDebounceTime: 300,
1803
+ value: f
1804
+ })
1805
+ }), /* @__PURE__ */ w(n, {
1806
+ hintText: "預設禁止申請人簽自己的案件;只有此流程允許自簽時才開啟。",
1807
+ label: "允許自簽",
1808
+ name: "allowInitiatorSelfApproval",
1809
+ children: /* @__PURE__ */ w(x, {
1810
+ checked: !!d.allowInitiatorSelfApproval,
1811
+ inputProps: {
1812
+ id: "allowInitiatorSelfApproval",
1813
+ name: "allowInitiatorSelfApproval"
1814
+ },
1815
+ onChange: (e) => Q(or(t, {
1816
+ allowInitiatorSelfApproval: e.target.checked,
1817
+ memberId: d.memberId,
1818
+ type: "DIRECT"
1819
+ }))
1820
+ })
1821
+ })] }) : null
1822
+ ] }) : null,
1823
+ t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
1745
1824
  label: "包含下層",
1746
1825
  name: "includeDescendants",
1747
- children: /* @__PURE__ */ S(ie, {
1826
+ children: /* @__PURE__ */ w(x, {
1748
1827
  checked: !!t.includeDescendants,
1749
1828
  inputProps: {
1750
1829
  id: "includeDescendants",
@@ -1757,28 +1836,28 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1757
1836
  })
1758
1837
  })
1759
1838
  }) : null,
1760
- t.type === "POSITION" ? /* @__PURE__ */ S(o, {
1839
+ t.type === "POSITION" ? /* @__PURE__ */ w(n, {
1761
1840
  hintText: "指派給目前有效歸屬中擁有此職位的會員;主要歸屬優先。",
1762
1841
  label: "職位",
1763
1842
  name: "positionId",
1764
1843
  required: !0,
1765
- children: /* @__PURE__ */ S(a, {
1844
+ children: /* @__PURE__ */ w(o, {
1766
1845
  name: "positionId",
1767
1846
  onChange: (e) => Q({
1768
1847
  positionId: e?.id ?? "",
1769
1848
  type: "POSITION"
1770
1849
  }),
1771
1850
  placeholder: "選擇職位",
1772
- positions: L,
1851
+ positions: z,
1773
1852
  value: c
1774
1853
  })
1775
1854
  }) : null,
1776
- t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ S(o, {
1855
+ t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ w(n, {
1777
1856
  hintText: "只納入指定組織範圍內擁有此職位的有效會員。",
1778
1857
  label: "職位",
1779
1858
  name: "orgUnitPositionId",
1780
1859
  required: !0,
1781
- children: /* @__PURE__ */ S(a, {
1860
+ children: /* @__PURE__ */ w(o, {
1782
1861
  disabled: !t.orgUnitId.trim(),
1783
1862
  name: "orgUnitPositionId",
1784
1863
  onChange: (e) => Q({
@@ -1792,152 +1871,239 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1792
1871
  value: c
1793
1872
  })
1794
1873
  }) : null,
1795
- e.data.returnBehavior.allowReturn ? /* @__PURE__ */ S(o, {
1874
+ /* @__PURE__ */ w(n, {
1875
+ hintText: "決定這一關要幾位簽核者同意才會通過;單人簽核與任一人同意的效果完全相同,皆為其中一人同意即通過。",
1876
+ label: "決策方式",
1877
+ name: "decisionPolicy",
1878
+ required: !0,
1879
+ children: /* @__PURE__ */ w(y, {
1880
+ clearable: !1,
1881
+ onChange: (t) => Ti(Gn(t?.id ?? null, e.data.decisionPolicy)),
1882
+ options: [...on],
1883
+ value: Wn(ne)
1884
+ })
1885
+ }),
1886
+ ne === "QUORUM" ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(n, {
1887
+ label: "門檻計算方式",
1888
+ name: "quorumThresholdType",
1889
+ required: !0,
1890
+ children: /* @__PURE__ */ w(y, {
1891
+ clearable: !1,
1892
+ onChange: (e) => Ti({
1893
+ threshold: b.threshold,
1894
+ thresholdType: qn(e?.id ?? null),
1895
+ type: "QUORUM"
1896
+ }),
1897
+ options: [...sn],
1898
+ value: W(sn, b.thresholdType)
1899
+ })
1900
+ }), /* @__PURE__ */ w(n, {
1901
+ hintText: b.thresholdType === "PERCENTAGE" ? "達到簽核者總數的這個百分比即通過,換算人數時無條件進位;超過 100 的輸入會自動夾至 100。" : "達到這個同意人數即通過;門檻超過實際簽核者人數時,這一關將永遠無法通過,請勿設定超過實際簽核者人數。",
1902
+ label: b.thresholdType === "PERCENTAGE" ? "門檻百分比" : "門檻人數",
1903
+ name: "quorumThreshold",
1904
+ required: !0,
1905
+ children: /* @__PURE__ */ w(_, {
1906
+ id: "quorumThreshold",
1907
+ inputProps: b.thresholdType === "PERCENTAGE" ? {
1908
+ max: 100,
1909
+ min: 1
1910
+ } : { min: 1 },
1911
+ inputType: "number",
1912
+ name: "quorumThreshold",
1913
+ onChange: (e) => Ti({
1914
+ threshold: Ze(Number(e.target.value), b.thresholdType),
1915
+ thresholdType: b.thresholdType,
1916
+ type: "QUORUM"
1917
+ }),
1918
+ value: String(b.threshold),
1919
+ variant: "base"
1920
+ })
1921
+ })] }) : null,
1922
+ e.data.returnBehavior.allowReturn ? /* @__PURE__ */ w(n, {
1796
1923
  hintText: "退回發起人後,重新送出時要從流程開始重跑,或直接回到退回的簽核節點。",
1797
1924
  label: "重送策略",
1798
1925
  name: "returnResubmitStrategy",
1799
1926
  required: !0,
1800
- children: /* @__PURE__ */ S(y, {
1927
+ children: /* @__PURE__ */ w(y, {
1801
1928
  clearable: !1,
1802
- onChange: (e) => ci(Mn(e?.id ?? null)),
1803
- options: [...Qt],
1804
- value: U(Qt, p)
1929
+ onChange: (e) => Ci(Vn(e?.id ?? null)),
1930
+ options: [...nn],
1931
+ value: W(nn, p)
1805
1932
  })
1806
1933
  }) : null,
1807
- e.data.returnBehavior.allowReturn ? /* @__PURE__ */ S(o, {
1934
+ e.data.returnBehavior.allowReturn ? /* @__PURE__ */ w(n, {
1808
1935
  hintText: "開啟後,簽核者按下退回時必須填寫意見,未填寫會被擋下。",
1809
1936
  label: "退回時意見必填",
1810
1937
  name: "returnRequireComment",
1811
- children: /* @__PURE__ */ S(ie, {
1938
+ children: /* @__PURE__ */ w(x, {
1812
1939
  checked: e.data.returnBehavior.requireComment === !0,
1813
1940
  inputProps: {
1814
1941
  id: "returnRequireComment",
1815
1942
  name: "returnRequireComment"
1816
1943
  },
1817
- onChange: (e) => li(e.target.checked)
1944
+ onChange: (e) => wi(e.target.checked)
1818
1945
  })
1819
1946
  }) : null,
1820
- /* @__PURE__ */ S(o, {
1947
+ /* @__PURE__ */ w(n, {
1821
1948
  hintText: "開啟後可設定簽核期限,逾時將依下方設定處理。",
1822
1949
  label: "啟用時效",
1823
1950
  name: "slaEnabled",
1824
- children: /* @__PURE__ */ S(ie, {
1951
+ children: /* @__PURE__ */ w(x, {
1825
1952
  checked: !!h,
1826
1953
  inputProps: {
1827
1954
  id: "slaEnabled",
1828
1955
  name: "slaEnabled"
1829
1956
  },
1830
- onChange: (e) => $(e.target.checked ? Ge : null)
1957
+ onChange: (e) => $(e.target.checked ? qe : null)
1831
1958
  })
1832
1959
  }),
1833
- h && !g ? /* @__PURE__ */ S(o, {
1960
+ h && !g ? /* @__PURE__ */ w(n, {
1834
1961
  hintText: "此期限混用了日與時,無法在表單中編輯。請改以單一單位設定,或透過 API 維護。",
1835
1962
  label: "時效期限",
1836
1963
  name: "slaDurationRaw",
1837
- children: /* @__PURE__ */ S(_, {
1964
+ children: /* @__PURE__ */ w(_, {
1838
1965
  disabled: !0,
1839
1966
  value: h.duration,
1840
1967
  variant: "base"
1841
1968
  })
1842
1969
  }) : null,
1843
- h && g ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(o, {
1970
+ h && g ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(n, {
1844
1971
  label: "時效期限",
1845
1972
  name: "slaDurationValue",
1846
1973
  required: !0,
1847
- children: /* @__PURE__ */ S(_, {
1974
+ children: /* @__PURE__ */ w(_, {
1848
1975
  id: "slaDurationValue",
1849
1976
  inputProps: { min: 1 },
1850
1977
  inputType: "number",
1851
1978
  name: "slaDurationValue",
1852
- onChange: (e) => $(Rn(h, {
1979
+ onChange: (e) => $($n(h, {
1853
1980
  unit: v,
1854
1981
  value: Number(e.target.value)
1855
1982
  })),
1856
1983
  value: String(g.value),
1857
1984
  variant: "base"
1858
1985
  })
1859
- }), /* @__PURE__ */ S(o, {
1986
+ }), /* @__PURE__ */ w(n, {
1860
1987
  label: "期限單位",
1861
1988
  name: "slaDurationUnit",
1862
1989
  required: !0,
1863
- children: /* @__PURE__ */ S(y, {
1990
+ children: /* @__PURE__ */ w(y, {
1864
1991
  clearable: !1,
1865
- onChange: (e) => $(Rn(h, {
1866
- unit: Nn(e?.id ?? null),
1992
+ onChange: (e) => $($n(h, {
1993
+ unit: Jn(e?.id ?? null),
1867
1994
  value: g.value
1868
1995
  })),
1869
- options: [...qe],
1870
- value: U(qe, v)
1996
+ options: [...Ye],
1997
+ value: W(Ye, v)
1871
1998
  })
1872
1999
  })] }) : null,
1873
- h && v === "DAY" ? /* @__PURE__ */ S(o, {
2000
+ h && v === "DAY" ? /* @__PURE__ */ w(n, {
1874
2001
  hintText: "工作日會跳過週末與行事曆上的假日,補班日仍計為工作日;行事曆由系統管理者設定。",
1875
2002
  label: "計算方式",
1876
2003
  name: "slaCalendar",
1877
2004
  required: !0,
1878
- children: /* @__PURE__ */ S(y, {
2005
+ children: /* @__PURE__ */ w(y, {
1879
2006
  clearable: !1,
1880
2007
  onChange: (e) => $({
1881
2008
  ...h,
1882
- calendar: Pn(e?.id ?? null)
2009
+ calendar: Yn(e?.id ?? null)
1883
2010
  }),
1884
- options: [...Ke],
1885
- value: U(Ke, h.calendar ?? "CALENDAR")
2011
+ options: [...Je],
2012
+ value: W(Je, h.calendar ?? "CALENDAR")
1886
2013
  })
1887
2014
  }) : null,
1888
- h ? /* @__PURE__ */ S(o, {
2015
+ h ? /* @__PURE__ */ w(n, {
1889
2016
  label: "逾時處理",
1890
2017
  name: "slaOnTimeout",
1891
2018
  required: !0,
1892
- children: /* @__PURE__ */ S(y, {
2019
+ children: /* @__PURE__ */ w(y, {
1893
2020
  clearable: !1,
1894
- onChange: (e) => $(zn(h, Fn(e?.id ?? null))),
1895
- options: [...Je],
1896
- value: U(Je, h.onTimeout)
2021
+ onChange: (e) => $(er(h, Xn(e?.id ?? null))),
2022
+ options: [...Xe],
2023
+ value: W(Xe, h.onTimeout)
1897
2024
  })
1898
2025
  }) : null,
1899
- h?.onTimeout === "ESCALATE" ? /* @__PURE__ */ S(o, {
2026
+ h?.onTimeout === "ESCALATE" ? /* @__PURE__ */ w(n, {
1900
2027
  hintText: "逾時後改派給簽核者的上層主管,只會升級一次。",
1901
2028
  label: "升級層級",
1902
2029
  name: "slaEscalateLevelsUp",
1903
2030
  required: !0,
1904
- children: /* @__PURE__ */ S(y, {
2031
+ children: /* @__PURE__ */ w(y, {
1905
2032
  clearable: !1,
1906
2033
  onChange: (e) => $({
1907
2034
  ...h,
1908
- escalateLevelsUp: qn(e?.id ?? null).value
2035
+ escalateLevelsUp: cr(e?.id ?? null).value
1909
2036
  }),
1910
- options: [...R],
2037
+ options: [...B],
1911
2038
  value: te
1912
2039
  })
1913
2040
  }) : null,
1914
- h ? /* @__PURE__ */ S(o, {
2041
+ h ? /* @__PURE__ */ w(n, {
1915
2042
  hintText: "在期限到達前先送出一次提醒。",
1916
2043
  label: "預警提醒",
1917
2044
  name: "slaWarningAt",
1918
- children: /* @__PURE__ */ S(y, {
2045
+ children: /* @__PURE__ */ w(y, {
1919
2046
  clearable: !1,
1920
- onChange: (e) => $(Bn(h, Ln(e?.id ?? null).value)),
1921
- options: [...$t],
2047
+ onChange: (e) => $(tr(h, Qn(e?.id ?? null).value)),
2048
+ options: [...rn],
1922
2049
  value: ee
1923
2050
  })
1924
- }) : null
2051
+ }) : null,
2052
+ /* @__PURE__ */ w(n, {
2053
+ hintText: "關閉後,簽核者在此關卡看不到「拒絕」按鈕。",
2054
+ label: "允許拒絕",
2055
+ name: "allowReject",
2056
+ children: /* @__PURE__ */ w(x, {
2057
+ checked: e.data.allowReject,
2058
+ inputProps: {
2059
+ id: "allowReject",
2060
+ name: "allowReject"
2061
+ },
2062
+ onChange: (e) => Ei({ allowReject: e.target.checked })
2063
+ })
2064
+ }),
2065
+ /* @__PURE__ */ w(n, {
2066
+ hintText: "關閉後,簽核者無法把此關卡的任務轉派給其他人。",
2067
+ label: "允許轉派",
2068
+ name: "allowTransfer",
2069
+ children: /* @__PURE__ */ w(x, {
2070
+ checked: e.data.allowTransfer,
2071
+ inputProps: {
2072
+ id: "allowTransfer",
2073
+ name: "allowTransfer"
2074
+ },
2075
+ onChange: (e) => Ei({ allowTransfer: e.target.checked })
2076
+ })
2077
+ }),
2078
+ /* @__PURE__ */ w(n, {
2079
+ hintText: "開啟後,簽核者可在此關卡臨時加入其他簽核人;會簽為平行處理,加簽則需等加入者簽完才往下。",
2080
+ label: "允許加簽",
2081
+ name: "allowAddSigner",
2082
+ children: /* @__PURE__ */ w(x, {
2083
+ checked: e.data.allowAddSigner,
2084
+ inputProps: {
2085
+ id: "allowAddSigner",
2086
+ name: "allowAddSigner"
2087
+ },
2088
+ onChange: (e) => Ei({ allowAddSigner: e.target.checked })
2089
+ })
2090
+ })
1925
2091
  ] });
1926
2092
  }
1927
- function xi(e) {
1928
- let t = qr(e.data.action).map((e) => vr(F, e));
1929
- return /* @__PURE__ */ S(o, {
2093
+ function Ri(e) {
2094
+ let t = ci(e.data.action).map((e) => Nr(L, e));
2095
+ return /* @__PURE__ */ w(n, {
1930
2096
  label: "知會對象",
1931
2097
  name: "notifyMemberIds",
1932
2098
  required: !0,
1933
- children: /* @__PURE__ */ S(m, {
2099
+ children: /* @__PURE__ */ w(m, {
1934
2100
  asyncData: !0,
1935
2101
  disabledOptionsFilter: !0,
1936
2102
  emptyText: "沒有符合的成員",
1937
- loading: Rt,
2103
+ loading: Vt,
1938
2104
  loadingText: "搜尋成員中...",
1939
2105
  mode: "multiple",
1940
- onChange: (e) => ui({
2106
+ onChange: (e) => Di({
1941
2107
  channels: ["IN_APP"],
1942
2108
  recipients: {
1943
2109
  memberIds: e.map((e) => e.id),
@@ -1945,11 +2111,11 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1945
2111
  },
1946
2112
  type: "NOTIFY"
1947
2113
  }),
1948
- onSearch: X,
2114
+ onSearch: Z,
1949
2115
  onVisibilityChange: (e) => {
1950
- e && X("");
2116
+ e && (Gt([]), Z(""));
1951
2117
  },
1952
- options: [...F],
2118
+ options: [...Vr(t, Wt)],
1953
2119
  overflowStrategy: "wrap",
1954
2120
  placeholder: "搜尋姓名或信箱",
1955
2121
  searchDebounceTime: 300,
@@ -1957,14 +2123,14 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1957
2123
  })
1958
2124
  });
1959
2125
  }
1960
- function Si(e) {
1961
- return /* @__PURE__ */ C("div", {
1962
- style: Ot,
1963
- children: [/* @__PURE__ */ S(b, {
2126
+ function zi(e) {
2127
+ return /* @__PURE__ */ T("div", {
2128
+ style: Mt,
2129
+ children: [/* @__PURE__ */ w(S, {
1964
2130
  component: "h2",
1965
2131
  variant: "h3",
1966
2132
  children: "已選取線段"
1967
- }), /* @__PURE__ */ C(b, {
2133
+ }), /* @__PURE__ */ T(S, {
1968
2134
  color: "text-neutral",
1969
2135
  variant: "body",
1970
2136
  children: [
@@ -1975,17 +2141,17 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1975
2141
  })]
1976
2142
  });
1977
2143
  }
1978
- function Ci(e) {
1979
- let t = Kr(e, O.nodes);
1980
- return /* @__PURE__ */ C("div", {
1981
- style: Ot,
2144
+ function Bi(e) {
2145
+ let t = oi(e, k.nodes);
2146
+ return /* @__PURE__ */ T("div", {
2147
+ style: Mt,
1982
2148
  children: [
1983
- /* @__PURE__ */ S(b, {
2149
+ /* @__PURE__ */ w(S, {
1984
2150
  component: "h2",
1985
2151
  variant: "h3",
1986
2152
  children: t ? "條件設定" : "線段屬性"
1987
2153
  }),
1988
- /* @__PURE__ */ C(b, {
2154
+ /* @__PURE__ */ T(S, {
1989
2155
  color: "text-neutral",
1990
2156
  variant: "body",
1991
2157
  children: [
@@ -1994,7 +2160,7 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
1994
2160
  e.target
1995
2161
  ]
1996
2162
  }),
1997
- t ? Ti(e) : /* @__PURE__ */ S(b, {
2163
+ t ? Hi(e) : /* @__PURE__ */ w(S, {
1998
2164
  color: "text-neutral",
1999
2165
  variant: "body",
2000
2166
  children: "這條線會直接把流程送到下一個節點。"
@@ -2002,104 +2168,104 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
2002
2168
  ]
2003
2169
  });
2004
2170
  }
2005
- function wi(e) {
2006
- return !e || !Kr(e, O.nodes) ? null : /* @__PURE__ */ S(v, {
2171
+ function Vi(e) {
2172
+ return !e || !oi(e, k.nodes) ? null : /* @__PURE__ */ w(v, {
2007
2173
  cancelText: "取消",
2008
2174
  confirmButtonProps: { disabled: !e.data.isDefault && !e.data.condition },
2009
2175
  confirmText: "完成",
2010
2176
  modalType: "standard",
2011
- onCancel: ai,
2012
- onClose: ai,
2013
- onConfirm: ai,
2014
- open: !!rt,
2177
+ onCancel: bi,
2178
+ onClose: bi,
2179
+ onConfirm: bi,
2180
+ open: !!at,
2015
2181
  showModalFooter: !0,
2016
2182
  showModalHeader: !0,
2017
2183
  size: "regular",
2018
2184
  supportingText: "條件分流的輸出連線需要指定條件,條件會直接顯示在線上。",
2019
2185
  title: "條件設定",
2020
- children: Ti(e)
2186
+ children: Hi(e)
2021
2187
  });
2022
2188
  }
2023
- function Ti(e) {
2024
- let t = Wr(e, O.nodes), n = Lr(J?.schema ?? null), r = Rr(J?.schema ?? null, e.data.conditionFieldKey ?? null), i = zr(r), a = Hr(r), s = U(i, e.data.conditionOperator ?? null);
2025
- return /* @__PURE__ */ C("div", {
2026
- style: Ot,
2189
+ function Hi(e) {
2190
+ let t = ai(e, k.nodes), r = Qr(Y?.schema ?? null), i = $r(Y?.schema ?? null, e.data.conditionFieldKey ?? null), a = ei(i), o = ri(i), s = W(a, e.data.conditionOperator ?? null);
2191
+ return /* @__PURE__ */ T("div", {
2192
+ style: Mt,
2027
2193
  children: [
2028
- /* @__PURE__ */ C(b, {
2194
+ /* @__PURE__ */ T(S, {
2029
2195
  color: "text-neutral",
2030
2196
  variant: "body",
2031
2197
  children: [
2032
2198
  "畫布上的這條線目前會顯示「",
2033
- /* @__PURE__ */ S("span", {
2034
- style: { color: !e.data.isDefault && !e.data.condition ? wt : void 0 },
2199
+ /* @__PURE__ */ w("span", {
2200
+ style: { color: !e.data.isDefault && !e.data.condition ? Ot : void 0 },
2035
2201
  children: t ?? "請設定條件"
2036
2202
  }),
2037
2203
  "」。"
2038
2204
  ]
2039
2205
  }),
2040
- /* @__PURE__ */ S(ie, {
2206
+ /* @__PURE__ */ w(x, {
2041
2207
  checked: !!e.data.isDefault,
2042
2208
  label: "其他情況走這條",
2043
- onChange: (t) => pi(e.id, t.target.checked)
2209
+ onChange: (t) => Ai(e.id, t.target.checked)
2044
2210
  }),
2045
- e.data.isDefault ? /* @__PURE__ */ S(b, {
2211
+ e.data.isDefault ? /* @__PURE__ */ w(S, {
2046
2212
  color: "text-neutral",
2047
2213
  variant: "body",
2048
2214
  children: "其他條件都不符合時,流程會走這條線。"
2049
- }) : /* @__PURE__ */ C(x, { children: [
2050
- J ? null : /* @__PURE__ */ S(b, {
2215
+ }) : /* @__PURE__ */ T(C, { children: [
2216
+ Y ? null : /* @__PURE__ */ w(S, {
2051
2217
  color: "text-neutral",
2052
2218
  variant: "body",
2053
2219
  children: "請先綁定表單版本,才能選擇條件欄位。"
2054
2220
  }),
2055
- /* @__PURE__ */ S(o, {
2221
+ /* @__PURE__ */ w(n, {
2056
2222
  label: "條件欄位",
2057
2223
  name: "edgeConditionField",
2058
2224
  required: !0,
2059
- children: /* @__PURE__ */ S(y, {
2225
+ children: /* @__PURE__ */ w(y, {
2060
2226
  clearable: !1,
2061
- onChange: (t) => mi({
2227
+ onChange: (t) => ji({
2062
2228
  edgeId: e.id,
2063
2229
  fieldKey: t?.id ?? null,
2064
2230
  operator: null,
2065
2231
  value: null
2066
2232
  }),
2067
- options: [...n],
2233
+ options: [...r],
2068
2234
  placeholder: "選擇條件欄位",
2069
- value: U(n, e.data.conditionFieldKey ?? null)
2235
+ value: W(r, e.data.conditionFieldKey ?? null)
2070
2236
  })
2071
2237
  }),
2072
- /* @__PURE__ */ S(o, {
2238
+ /* @__PURE__ */ w(n, {
2073
2239
  label: "條件判斷",
2074
2240
  name: "edgeConditionOperator",
2075
2241
  required: !0,
2076
- children: /* @__PURE__ */ S(y, {
2242
+ children: /* @__PURE__ */ w(y, {
2077
2243
  clearable: !1,
2078
- onChange: (t) => mi({
2244
+ onChange: (t) => ji({
2079
2245
  edgeId: e.id,
2080
- operator: Br(t?.id ?? null),
2246
+ operator: ti(t?.id ?? null),
2081
2247
  value: null
2082
2248
  }),
2083
- options: [...i],
2249
+ options: [...a],
2084
2250
  placeholder: "選擇判斷方式",
2085
2251
  value: s
2086
2252
  })
2087
2253
  }),
2088
- s && Ur(s.id) ? /* @__PURE__ */ S(o, {
2254
+ s && ii(s.id) ? /* @__PURE__ */ w(n, {
2089
2255
  label: "條件值",
2090
2256
  name: "edgeConditionValue",
2091
2257
  required: !0,
2092
- children: a.length > 0 ? /* @__PURE__ */ S(y, {
2258
+ children: o.length > 0 ? /* @__PURE__ */ w(y, {
2093
2259
  clearable: !1,
2094
- onChange: (t) => mi({
2260
+ onChange: (t) => ji({
2095
2261
  edgeId: e.id,
2096
2262
  value: t?.id ?? null
2097
2263
  }),
2098
- options: [...a],
2264
+ options: [...o],
2099
2265
  placeholder: "選擇條件值",
2100
- value: U(a, e.data.conditionValue ?? null)
2101
- }) : /* @__PURE__ */ S(_, {
2102
- onChange: (t) => mi({
2266
+ value: W(o, e.data.conditionValue ?? null)
2267
+ }) : /* @__PURE__ */ w(_, {
2268
+ onChange: (t) => ji({
2103
2269
  edgeId: e.id,
2104
2270
  value: t.target.value
2105
2271
  }),
@@ -2113,14 +2279,14 @@ function mn({ aiAssistantAvailable: n = !0, embedded: i = !1, formSchemaOverride
2113
2279
  });
2114
2280
  }
2115
2281
  }
2116
- function hn({ onApplyAutoLayout: e }) {
2282
+ function Sn({ onApplyAutoLayout: e }) {
2117
2283
  function t() {
2118
2284
  e();
2119
2285
  }
2120
- return /* @__PURE__ */ S(Ae, {
2286
+ return /* @__PURE__ */ w(je, {
2121
2287
  position: "top-right",
2122
- children: /* @__PURE__ */ S(h, {
2123
- icon: ce,
2288
+ children: /* @__PURE__ */ w(h, {
2289
+ icon: oe,
2124
2290
  iconType: "leading",
2125
2291
  onClick: t,
2126
2292
  size: "sub",
@@ -2129,28 +2295,28 @@ function hn({ onApplyAutoLayout: e }) {
2129
2295
  })
2130
2296
  });
2131
2297
  }
2132
- function B({ data: e, selected: t, type: n }) {
2133
- let r = e.approverLines ?? [e.approverSummary ?? e.label], i = gn(e);
2134
- return /* @__PURE__ */ C("div", {
2135
- style: _n(n, t),
2298
+ function V({ data: e, selected: t, type: n }) {
2299
+ let r = e.approverLines ?? [e.approverSummary ?? e.label], i = Cn(e);
2300
+ return /* @__PURE__ */ T("div", {
2301
+ style: wn(n, t),
2136
2302
  children: [
2137
- yn(e),
2138
- /* @__PURE__ */ S("div", {
2139
- style: Gt,
2140
- children: r.map((e, t) => /* @__PURE__ */ S(b, {
2303
+ En(e),
2304
+ /* @__PURE__ */ w("div", {
2305
+ style: Yt,
2306
+ children: r.map((e, t) => /* @__PURE__ */ w(S, {
2141
2307
  component: "span",
2142
2308
  ellipsis: !0,
2143
- style: Wt,
2309
+ style: Jt,
2144
2310
  title: e,
2145
2311
  variant: "label-primary",
2146
2312
  children: e
2147
2313
  }, `${e}_${t}`))
2148
2314
  }),
2149
- /* @__PURE__ */ S(b, {
2315
+ /* @__PURE__ */ w(S, {
2150
2316
  color: "text-neutral",
2151
2317
  component: "span",
2152
2318
  ellipsis: !0,
2153
- style: Wt,
2319
+ style: Jt,
2154
2320
  title: i,
2155
2321
  variant: "caption",
2156
2322
  children: i
@@ -2158,106 +2324,106 @@ function B({ data: e, selected: t, type: n }) {
2158
2324
  ]
2159
2325
  });
2160
2326
  }
2161
- function gn(e) {
2162
- return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" : Jt[e.nodeKind];
2327
+ function Cn(e) {
2328
+ return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" : Qt[e.nodeKind];
2163
2329
  }
2164
- function _n(e, t) {
2165
- let n = vn(e);
2330
+ function wn(e, t) {
2331
+ let n = Tn(e);
2166
2332
  return t ? {
2167
2333
  ...n,
2168
2334
  border: "1px solid var(--mzn-color-primary, #0057ff)",
2169
- boxShadow: It
2335
+ boxShadow: Bt
2170
2336
  } : n;
2171
2337
  }
2172
- function vn(e) {
2173
- return e === "exclusiveGateway" ? I : e === "parallelGateway" ? Vt : e === "startEvent" ? Ht : e === "endEvent" ? Ut : e === "userTask" ? L : N;
2338
+ function Tn(e) {
2339
+ return e === "exclusiveGateway" ? Gt : e === "parallelGateway" ? Kt : e === "startEvent" ? qt : e === "endEvent" ? z : e === "userTask" ? R : F;
2174
2340
  }
2175
- function yn(e) {
2176
- return !e.hasInput && e.hasOutput ? /* @__PURE__ */ S(T, {
2177
- id: qt,
2178
- position: E.Right,
2341
+ function En(e) {
2342
+ return !e.hasInput && e.hasOutput ? /* @__PURE__ */ w(ke, {
2343
+ id: Zt,
2344
+ position: D.Right,
2179
2345
  type: "source"
2180
- }) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ S(T, {
2181
- id: Kt,
2182
- position: E.Left,
2346
+ }) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ w(ke, {
2347
+ id: Xt,
2348
+ position: D.Left,
2183
2349
  type: "target"
2184
- }) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ S(T, {
2185
- id: Kt,
2186
- position: E.Left,
2350
+ }) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ w(ke, {
2351
+ id: Xt,
2352
+ position: D.Left,
2187
2353
  type: "target"
2188
- }, "target"), /* @__PURE__ */ S(T, {
2189
- id: qt,
2190
- position: E.Right,
2354
+ }, "target"), /* @__PURE__ */ w(ke, {
2355
+ id: Zt,
2356
+ position: D.Right,
2191
2357
  type: "source"
2192
2358
  }, "source")];
2193
2359
  }
2194
- function bn(e, t, n, r, i, a) {
2195
- let o = V(e);
2360
+ function Dn(e, t, n, r, i, a) {
2361
+ let o = H(e);
2196
2362
  return {
2197
2363
  data: {
2198
- approverLines: jr(e, t),
2199
- approverSummary: kr(e, t, n, r),
2200
- hasInput: W(e),
2201
- hasOutput: ar(e),
2202
- initiatorPolicySummary: e.type === "startEvent" ? er(a, n, r) : null,
2364
+ approverLines: X(e, t),
2365
+ approverSummary: Wr(e, t, n, r),
2366
+ hasInput: G(e),
2367
+ hasOutput: br(e),
2368
+ initiatorPolicySummary: e.type === "startEvent" ? hr(a, n, r) : null,
2203
2369
  label: e.data.label,
2204
2370
  nodeKind: e.type
2205
2371
  },
2206
2372
  height: o.height,
2207
- handles: xn(e),
2373
+ handles: On(e),
2208
2374
  id: e.id,
2209
2375
  initialHeight: o.height,
2210
2376
  initialWidth: o.width,
2211
2377
  position: e.position,
2212
2378
  selected: i,
2213
- sourcePosition: E.Right,
2214
- targetPosition: E.Left,
2379
+ sourcePosition: D.Right,
2380
+ targetPosition: D.Left,
2215
2381
  type: e.type,
2216
2382
  width: o.width
2217
2383
  };
2218
2384
  }
2219
- function V(e) {
2385
+ function H(e) {
2220
2386
  return e.type === "exclusiveGateway" || e.type === "parallelGateway" ? {
2221
- height: zt,
2222
- width: F
2387
+ height: L,
2388
+ width: Ut
2223
2389
  } : e.type === "serviceTask" ? {
2224
- height: Lt + (Math.max(1, qr(e.data.action).length) - 1) * Rt,
2225
- width: P
2390
+ height: I + (Math.max(1, ci(e.data.action).length) - 1) * Ht,
2391
+ width: Vt
2226
2392
  } : {
2227
- height: Lt,
2228
- width: P
2393
+ height: I,
2394
+ width: Vt
2229
2395
  };
2230
2396
  }
2231
- function xn(e) {
2232
- let t = V(e);
2233
- return [...W(e) ? [Sn(t)] : [], ...ar(e) ? [H(t)] : []];
2397
+ function On(e) {
2398
+ let t = H(e);
2399
+ return [...G(e) ? [kn(t)] : [], ...br(e) ? [An(t)] : []];
2234
2400
  }
2235
- function Sn({ height: e }) {
2401
+ function kn({ height: e }) {
2236
2402
  let t = e / 2 - 9 / 2;
2237
2403
  return {
2238
2404
  height: 9,
2239
- id: Kt,
2240
- position: E.Left,
2405
+ id: Xt,
2406
+ position: D.Left,
2241
2407
  type: "target",
2242
2408
  width: 9,
2243
2409
  x: -9 / 2,
2244
2410
  y: t
2245
2411
  };
2246
2412
  }
2247
- function H({ height: e, width: t }) {
2413
+ function An({ height: e, width: t }) {
2248
2414
  let n = e / 2 - 9 / 2;
2249
2415
  return {
2250
2416
  height: 9,
2251
- id: qt,
2252
- position: E.Right,
2417
+ id: Zt,
2418
+ position: D.Right,
2253
2419
  type: "source",
2254
2420
  width: 9,
2255
2421
  x: t - 9 / 2,
2256
2422
  y: n
2257
2423
  };
2258
2424
  }
2259
- function Cn(e, t, n) {
2260
- let r = Wr(e, t), i = Kr(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? wt : i ? St : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", c = a ? wt : i ? St : Ct;
2425
+ function jn(e, t, n) {
2426
+ let r = ai(e, t), i = oi(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? Ot : i ? Dt : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", c = a ? Ot : i ? Dt : P;
2261
2427
  return {
2262
2428
  className: n ? "workflow-edge--selected" : void 0,
2263
2429
  data: e.data,
@@ -2280,9 +2446,9 @@ function Cn(e, t, n) {
2280
2446
  source: e.source,
2281
2447
  sourceHandle: e.sourceHandle,
2282
2448
  style: {
2283
- filter: n ? Tt : void 0,
2449
+ filter: n ? kt : void 0,
2284
2450
  opacity: 1,
2285
- stroke: Ct,
2451
+ stroke: P,
2286
2452
  strokeOpacity: 1,
2287
2453
  strokeWidth: 1.5
2288
2454
  },
@@ -2291,7 +2457,7 @@ function Cn(e, t, n) {
2291
2457
  type: e.type ?? "smoothstep"
2292
2458
  };
2293
2459
  }
2294
- function wn(e, t) {
2460
+ function Mn(e, t) {
2295
2461
  return e.type === "startEvent" ? e : (e.type === "endEvent" || e.type === "userTask" || e.type === "serviceTask" || e.type, {
2296
2462
  ...e,
2297
2463
  data: {
@@ -2300,27 +2466,60 @@ function wn(e, t) {
2300
2466
  }
2301
2467
  });
2302
2468
  }
2303
- function Tn(e) {
2304
- return Dn(En(e));
2469
+ function Nn(e) {
2470
+ return In(Pn(Fn(U(e))));
2305
2471
  }
2306
- function En(e) {
2307
- let t = new Set(e.nodes.filter((e) => or(e)).map((e) => e.id)), n = e.edges.filter((e) => !t.has(e.source));
2472
+ function U(e) {
2473
+ let t = e.edges.map((e) => {
2474
+ let t = e.data ?? {};
2475
+ return e.data === t ? e : {
2476
+ ...e,
2477
+ data: t
2478
+ };
2479
+ });
2480
+ return t.some((t, n) => t !== e.edges[n]) ? {
2481
+ ...e,
2482
+ edges: t
2483
+ } : e;
2484
+ }
2485
+ function Pn(e) {
2486
+ let t = e.nodes.map((e) => {
2487
+ if (e.type !== "userTask") return e;
2488
+ let t = e.data.allowAddSigner ?? !1, n = e.data.allowReject ?? !0, r = e.data.allowTransfer ?? !0, i = !e.data.decisionPolicy;
2489
+ return e.data.allowAddSigner === t && e.data.allowReject === n && e.data.allowTransfer === r && !i ? e : {
2490
+ ...e,
2491
+ data: {
2492
+ ...e.data,
2493
+ allowAddSigner: t,
2494
+ allowReject: n,
2495
+ allowTransfer: r,
2496
+ decisionPolicy: e.data.decisionPolicy ?? { type: "SINGLE" }
2497
+ }
2498
+ };
2499
+ });
2500
+ return t.some((t, n) => t !== e.nodes[n]) ? {
2501
+ ...e,
2502
+ nodes: t
2503
+ } : e;
2504
+ }
2505
+ function Fn(e) {
2506
+ let t = new Set(e.nodes.filter((e) => xr(e)).map((e) => e.id)), n = e.edges.filter((e) => !t.has(e.source));
2308
2507
  return n.length === e.edges.length ? e : {
2309
2508
  ...e,
2310
2509
  edges: n
2311
2510
  };
2312
2511
  }
2313
- function Dn(e) {
2512
+ function In(e) {
2314
2513
  let t = e.edges.reduce((e, t) => ({
2315
2514
  ...e,
2316
2515
  [t.target]: (e[t.target] ?? 0) + 1
2317
- }), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? wn(e, "AND") : e);
2516
+ }), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? Mn(e, "AND") : e);
2318
2517
  return n.some((t, n) => t !== e.nodes[n]) ? {
2319
2518
  ...e,
2320
2519
  nodes: n
2321
2520
  } : e;
2322
2521
  }
2323
- function On() {
2522
+ function Ln() {
2324
2523
  return {
2325
2524
  edges: [],
2326
2525
  meta: { schemaVersion: 1 },
@@ -2347,58 +2546,96 @@ function On() {
2347
2546
  }]
2348
2547
  };
2349
2548
  }
2350
- function kn(e) {
2549
+ function Rn(e) {
2351
2550
  return e.edges.length === 0 && e.nodes.length === 2 && e.nodes.some((e) => e.type === "startEvent") && e.nodes.some((e) => e.type === "endEvent");
2352
2551
  }
2353
- function An(e) {
2354
- let t = new Pe.graphlib.Graph();
2552
+ function zn(e) {
2553
+ let t = new Fe.graphlib.Graph();
2355
2554
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
2356
2555
  rankdir: "LR",
2357
2556
  ranksep: 120
2358
2557
  }), e.nodes.forEach((e) => {
2359
- t.setNode(e.id, V(e));
2558
+ t.setNode(e.id, H(e));
2360
2559
  }), e.edges.forEach((e) => {
2361
2560
  t.setEdge(e.source, e.target);
2362
- }), Pe.layout(t), {
2561
+ }), Fe.layout(t), {
2363
2562
  ...e,
2364
2563
  nodes: e.nodes.map((e) => {
2365
2564
  let n = t.node(e.id);
2366
2565
  return n ? {
2367
2566
  ...e,
2368
2567
  position: {
2369
- x: n.x - V(e).width / 2,
2370
- y: n.y - V(e).height / 2
2568
+ x: n.x - H(e).width / 2,
2569
+ y: n.y - H(e).height / 2
2371
2570
  }
2372
2571
  } : e;
2373
2572
  })
2374
2573
  };
2375
2574
  }
2376
- function U(e, t) {
2575
+ function W(e, t) {
2377
2576
  return t ? e.find((e) => e.id === t) ?? null : null;
2378
2577
  }
2379
- function jn(e) {
2578
+ function Bn(e) {
2380
2579
  return e === "OR" ? "OR" : "AND";
2381
2580
  }
2382
- function Mn(e) {
2581
+ function Vn(e) {
2383
2582
  return e === "FROM_RETURN_POINT" ? "FROM_RETURN_POINT" : "RESTART";
2384
2583
  }
2385
- function Nn(e) {
2584
+ function Hn(e) {
2585
+ if (!e || e.type === "SINGLE" || e.type === "PARALLEL_ANY") return "可指定多位;多位時所有人都會收到待辦,任一人同意即可通過。";
2586
+ if (e.type === "PARALLEL_ALL") return "可指定多位;多位時所有人都會收到待辦,全部同意後才會通過。";
2587
+ if (e.type === "SEQUENTIAL") return "可指定多位;所有人會同時收到待辦,需全部同意後才會通過。";
2588
+ let t = e.thresholdType === "PERCENTAGE" ? "%" : " 位簽核者";
2589
+ return `可指定多位;需達到 ${e.threshold}${t} 才會通過。`;
2590
+ }
2591
+ function Un(e) {
2592
+ return e?.type ?? "SINGLE";
2593
+ }
2594
+ function Wn(e) {
2595
+ return on.find((t) => t.id === e) || (e === "SEQUENTIAL" ? {
2596
+ id: e,
2597
+ name: "全部同意(既有設定)"
2598
+ } : {
2599
+ id: e,
2600
+ name: `未知決策方式(${e})`
2601
+ });
2602
+ }
2603
+ function Gn(e, t) {
2604
+ return e === "QUORUM" ? t?.type === "QUORUM" ? t : {
2605
+ threshold: Ke,
2606
+ thresholdType: "COUNT",
2607
+ type: "QUORUM"
2608
+ } : e === "PARALLEL_ALL" || e === "PARALLEL_ANY" || e === "SEQUENTIAL" ? { type: e } : { type: "SINGLE" };
2609
+ }
2610
+ function Kn(e) {
2611
+ return e?.type === "QUORUM" ? {
2612
+ threshold: Number.isFinite(e.threshold) ? e.threshold : Ke,
2613
+ thresholdType: qn(e.thresholdType ?? null)
2614
+ } : {
2615
+ threshold: Ke,
2616
+ thresholdType: "COUNT"
2617
+ };
2618
+ }
2619
+ function qn(e) {
2620
+ return e === "PERCENTAGE" ? "PERCENTAGE" : "COUNT";
2621
+ }
2622
+ function Jn(e) {
2386
2623
  return e === "HOUR" ? "HOUR" : "DAY";
2387
2624
  }
2388
- function Pn(e) {
2625
+ function Yn(e) {
2389
2626
  return e === "BUSINESS_DAY" ? "BUSINESS_DAY" : "CALENDAR";
2390
2627
  }
2391
- function Fn(e) {
2392
- return Je.find((t) => t.id === e)?.id ?? "REMIND";
2628
+ function Xn(e) {
2629
+ return Xe.find((t) => t.id === e)?.id ?? "REMIND";
2393
2630
  }
2394
- function In(e) {
2395
- return $t.find((t) => t.value === e) ?? $t[0];
2631
+ function Zn(e) {
2632
+ return rn.find((t) => t.value === e) ?? rn[0];
2396
2633
  }
2397
- function Ln(e) {
2398
- return $t.find((t) => t.id === e) ?? $t[0];
2634
+ function Qn(e) {
2635
+ return rn.find((t) => t.id === e) ?? rn[0];
2399
2636
  }
2400
- function Rn(e, t) {
2401
- let n = Number.isFinite(t.value) ? Math.trunc(t.value) : 1, r = Ye({
2637
+ function $n(e, t) {
2638
+ let n = Number.isFinite(t.value) ? Math.trunc(t.value) : 1, r = Qe({
2402
2639
  unit: t.unit,
2403
2640
  value: n
2404
2641
  });
@@ -2408,30 +2645,30 @@ function Rn(e, t) {
2408
2645
  duration: r
2409
2646
  };
2410
2647
  }
2411
- function zn(e, t) {
2648
+ function er(e, t) {
2412
2649
  return t === "ESCALATE" ? {
2413
2650
  ...e,
2414
2651
  escalateLevelsUp: e.escalateLevelsUp ?? 1,
2415
2652
  onTimeout: t
2416
2653
  } : {
2417
- ...Vn(e, "escalateLevelsUp"),
2654
+ ...nr(e, "escalateLevelsUp"),
2418
2655
  onTimeout: t
2419
2656
  };
2420
2657
  }
2421
- function Bn(e, t) {
2422
- return t === null ? Vn(e, "warningAt") : {
2658
+ function tr(e, t) {
2659
+ return t === null ? nr(e, "warningAt") : {
2423
2660
  ...e,
2424
2661
  warningAt: t
2425
2662
  };
2426
2663
  }
2427
- function Vn(e, t) {
2664
+ function nr(e, t) {
2428
2665
  return Object.fromEntries(Object.entries(e).filter(([e]) => e !== t));
2429
2666
  }
2430
- function Hn(e) {
2667
+ function rr(e) {
2431
2668
  return e === "ORG_MANAGER" || e === "ORG_UNIT_MANAGER" || e === "ORG_UNIT_MEMBER" || e === "ORG_UNIT_POSITION" || e === "POSITION" ? e : "DIRECT";
2432
2669
  }
2433
- function Un(e) {
2434
- let t = Hn(e ?? "DIRECT");
2670
+ function ir(e) {
2671
+ let t = rr(e ?? "DIRECT");
2435
2672
  return t === "ORG_MANAGER" ? {
2436
2673
  baseFromInitiator: !0,
2437
2674
  levelsUp: 1,
@@ -2456,31 +2693,31 @@ function Un(e) {
2456
2693
  type: "DIRECT"
2457
2694
  };
2458
2695
  }
2459
- function Wn(e) {
2696
+ function ar(e) {
2460
2697
  return e === "DIRECT" ? "DIRECT" : "NONE";
2461
2698
  }
2462
- function Gn(e, t) {
2699
+ function or(e, t) {
2463
2700
  return e.type === "ORG_MANAGER" || e.type === "ORG_UNIT_MANAGER" ? {
2464
2701
  ...e,
2465
2702
  fallback: t
2466
2703
  } : e;
2467
2704
  }
2468
- function Kn(e) {
2469
- return R.find((t) => t.value === e) ?? R[0];
2705
+ function sr(e) {
2706
+ return B.find((t) => t.value === e) ?? B[0];
2470
2707
  }
2471
- function qn(e) {
2472
- return R.find((t) => t.id === e) ?? R[0];
2708
+ function cr(e) {
2709
+ return B.find((t) => t.id === e) ?? B[0];
2473
2710
  }
2474
- function Jn(e) {
2711
+ function lr(e) {
2475
2712
  return e === "ORG_UNIT" || e === "ORG_UNIT_POSITION" || e === "NONE" ? e : "ALL";
2476
2713
  }
2477
- function Yn(e) {
2714
+ function ur(e) {
2478
2715
  let t = e?.trim();
2479
2716
  if (!t) return {
2480
2717
  mode: "ALL",
2481
2718
  value: ""
2482
2719
  };
2483
- let n = Qn(t, /"([^"]+)" in subject\.orgUnitIds/gu), r = Qn(t, /"([^"]+)" in subject\.positionIds/gu);
2720
+ let n = pr(t, /"([^"]+)" in subject\.orgUnitIds/gu), r = pr(t, /"([^"]+)" in subject\.positionIds/gu);
2484
2721
  return n.length > 0 && r.length > 0 ? {
2485
2722
  includeDescendants: n.length > 1,
2486
2723
  mode: "ORG_UNIT_POSITION",
@@ -2497,32 +2734,32 @@ function Yn(e) {
2497
2734
  value: t
2498
2735
  };
2499
2736
  }
2500
- function Xn(e, t) {
2501
- let n = Yn(e);
2737
+ function dr(e, t) {
2738
+ let n = ur(e);
2502
2739
  return !t || t === "ALL" || t === "NONE" ? t === "ALL" || t === "NONE" ? {
2503
2740
  mode: t,
2504
2741
  value: ""
2505
- } : n : n.mode === t ? n : tr(t);
2742
+ } : n : n.mode === t ? n : gr(t);
2506
2743
  }
2507
- function Zn(e) {
2744
+ function fr(e) {
2508
2745
  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;
2509
2746
  }
2510
- function Qn(e, t) {
2747
+ function pr(e, t) {
2511
2748
  return [...e.matchAll(t)].map((e) => e[1]).filter((e) => !!e);
2512
2749
  }
2513
- function $n(e, t) {
2750
+ function mr(e, t) {
2514
2751
  if (e.mode === "ALL" || e.mode === "NONE") return null;
2515
2752
  let n = e.orgUnitId?.trim() ?? "";
2516
2753
  if (!n) return null;
2517
- let r = Er(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
2754
+ let r = Br(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
2518
2755
  if (e.mode === "ORG_UNIT") return r ? `(${r})` : null;
2519
2756
  let i = e.positionId?.trim() ?? "";
2520
2757
  return i && r ? `(${r}) && ${JSON.stringify(i)} in subject.positionIds` : null;
2521
2758
  }
2522
- function er(e, t, n) {
2523
- return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${G(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${G(t, e.orgUnitId)} / ${K(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
2759
+ function hr(e, t, n) {
2760
+ return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${K(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${K(t, e.orgUnitId)} / ${q(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
2524
2761
  }
2525
- function tr(e) {
2762
+ function gr(e) {
2526
2763
  return {
2527
2764
  includeDescendants: !0,
2528
2765
  mode: e,
@@ -2531,29 +2768,29 @@ function tr(e) {
2531
2768
  value: ""
2532
2769
  };
2533
2770
  }
2534
- function nr(e, t) {
2771
+ function _r(e, t) {
2535
2772
  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;
2536
- return !!n && !!r && e.source !== e.target && e.sourceHandle === qt && e.targetHandle === Kt && !!(n && ar(n)) && !!(r && W(r));
2773
+ return !!n && !!r && e.source !== e.target && e.sourceHandle === Zt && e.targetHandle === Xt && !!(n && br(n)) && !!(r && G(r));
2537
2774
  }
2538
- function rr(e, t) {
2775
+ function vr(e, t) {
2539
2776
  return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
2540
2777
  }
2541
- function ir(e) {
2778
+ function yr(e) {
2542
2779
  return e.type !== "startEvent" && e.type !== "endEvent";
2543
2780
  }
2544
- function W(e) {
2781
+ function G(e) {
2545
2782
  return e.type !== "startEvent";
2546
2783
  }
2547
- function ar(e) {
2548
- return e.type !== "endEvent" && !or(e);
2784
+ function br(e) {
2785
+ return e.type !== "endEvent" && !xr(e);
2549
2786
  }
2550
- function or(e) {
2787
+ function xr(e) {
2551
2788
  return e.type === "serviceTask" && e.data.action.type === "NOTIFY";
2552
2789
  }
2553
- function sr(e) {
2790
+ function Sr(e) {
2554
2791
  return e instanceof HTMLElement ? e.isContentEditable || e.tagName === "INPUT" || e.tagName === "TEXTAREA" || e.tagName === "SELECT" || !!e.closest("[contenteditable=\"true\"]") : !1;
2555
2792
  }
2556
- function cr(e) {
2793
+ function Cr(e) {
2557
2794
  return e.map((e) => ({
2558
2795
  formDefinitionId: e.formDefinitionId,
2559
2796
  formName: e.formName,
@@ -2562,135 +2799,135 @@ function cr(e) {
2562
2799
  schema: e.schema
2563
2800
  }));
2564
2801
  }
2565
- function lr(e) {
2802
+ function wr(e) {
2566
2803
  return (e?.schema.fields ?? []).reduce((e, t) => ({
2567
2804
  ...e,
2568
- [t.fieldKey]: ur(t)
2805
+ [t.fieldKey]: Tr(t)
2569
2806
  }), {});
2570
2807
  }
2571
- function ur(e) {
2572
- return e.type === "number" ? 1e3 : e.type === "boolean" ? !0 : e.type === "select" ? e.options[0]?.value ?? "" : e.type === "checkbox" ? e.options[0] ? [e.options[0].value] : [] : e.type === "date" ? "2026-05-08" : e.type === "datetime" ? "2026-05-08T09:00:00+08:00" : e.placeholder ?? e.label;
2808
+ function Tr(e) {
2809
+ return e.type === "number" ? 1e3 : e.type === "boolean" ? !0 : Ce(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;
2573
2810
  }
2574
- function dr(e) {
2811
+ function Er(e) {
2575
2812
  let t = JSON.parse(e);
2576
- if (!fr(t)) throw Error("表單資料 JSON 必須是物件。");
2813
+ if (!Dr(t)) throw Error("表單資料 JSON 必須是物件。");
2577
2814
  return t;
2578
2815
  }
2579
- function fr(e) {
2816
+ function Dr(e) {
2580
2817
  return typeof e == "object" && !!e && !Array.isArray(e);
2581
2818
  }
2582
- function pr(e) {
2819
+ function Or(e) {
2583
2820
  return e === "COMPLETED" ? "完成" : e === "PASSED" ? "通過" : e === "SKIPPED" ? "略過" : e === "STOPPED" ? "已停止" : e === "WAITING" ? "將等待簽核" : e;
2584
2821
  }
2585
- function mr(e) {
2586
- return e in Jt ? Jt[e] : e;
2822
+ function kr(e) {
2823
+ return e in Qt ? Qt[e] : e;
2587
2824
  }
2588
- function hr(e, t) {
2825
+ function Ar(e, t) {
2589
2826
  return t && !e.some((e) => e.id === t.id) ? [t, ...e] : e;
2590
2827
  }
2591
- function gr(e) {
2828
+ function jr(e) {
2592
2829
  return e.map((e) => ({
2593
2830
  displayName: e.name,
2594
2831
  email: e.email,
2595
2832
  id: e.memberId,
2596
2833
  memberId: e.memberId,
2597
- name: Mr(e.name, e.email)
2834
+ name: qr(e.name, e.email)
2598
2835
  }));
2599
2836
  }
2600
- function _r(e) {
2837
+ function Mr(e) {
2601
2838
  return {
2602
2839
  displayName: "未知會員",
2603
2840
  email: "",
2604
2841
  id: e,
2605
2842
  memberId: e,
2606
- name: "未知會員"
2843
+ name: "未知會員",
2844
+ unresolved: !0
2607
2845
  };
2608
2846
  }
2609
- function vr(e, t) {
2610
- return e.find((e) => e.memberId === t) ?? _r(t);
2611
- }
2612
- function yr(e, t) {
2613
- let n = e[0];
2614
- return n ? vr(t, n) : null;
2615
- }
2616
- function br(e, t) {
2617
- let r = e.find((e) => e.id === t);
2618
- return r ? n(r) : null;
2847
+ function Nr(e, t) {
2848
+ return e.find((e) => e.memberId === t) ?? Mr(t);
2619
2849
  }
2620
- function xr(e, t) {
2850
+ function Pr(e, t) {
2621
2851
  let n = e.find((e) => e.id === t);
2622
- return n ? i(n) : null;
2852
+ return n ? r(n) : null;
2623
2853
  }
2624
- function G(e, t) {
2625
- return br(e, t)?.name ?? "未指定組織";
2854
+ function Fr(e, t) {
2855
+ let n = e.find((e) => e.id === t);
2856
+ return n ? a(n) : null;
2626
2857
  }
2627
2858
  function K(e, t) {
2628
- return xr(e, t)?.name ?? "未指定職位";
2859
+ return Pr(e, t)?.name ?? "未指定組織";
2629
2860
  }
2630
- function Sr(e, t) {
2631
- let n = q(), r = t.filter((t) => t.memberId === e && Cr(t, n)), i = r.reduce((e, t) => e && wr(e, t) <= 0 ? e : t, null);
2861
+ function q(e, t) {
2862
+ return Fr(e, t)?.name ?? "未指定職位";
2863
+ }
2864
+ function Ir(e, t) {
2865
+ let n = J(), r = t.filter((t) => t.memberId === e && Lr(t, n)), i = r.reduce((e, t) => e && Rr(e, t) <= 0 ? e : t, null);
2632
2866
  return {
2633
2867
  customFields: {},
2634
2868
  managerMemberId: "member-002",
2635
2869
  memberId: e,
2636
2870
  orgCode: "HQ",
2637
- orgUnitIds: J(r.map((e) => e.orgUnitId)),
2871
+ orgUnitIds: Y(r.map((e) => e.orgUnitId)),
2638
2872
  positionId: i?.positionId ?? null,
2639
- positionIds: J(r.map((e) => e.positionId)),
2873
+ positionIds: Y(r.map((e) => e.positionId)),
2640
2874
  primaryOrgUnitId: i?.orgUnitId ?? null,
2641
2875
  roles: ["manager"]
2642
2876
  };
2643
2877
  }
2644
- function q() {
2878
+ function J() {
2645
2879
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
2646
2880
  }
2647
- function Cr(e, t) {
2881
+ function Lr(e, t) {
2648
2882
  return e.effectiveFrom <= t && (!e.effectiveTo || e.effectiveTo >= t);
2649
2883
  }
2650
- function wr(e, t) {
2884
+ function Rr(e, t) {
2651
2885
  return e.isPrimary === t.isPrimary ? t.effectiveFrom.localeCompare(e.effectiveFrom) : e.isPrimary ? -1 : 1;
2652
2886
  }
2653
- function J(e) {
2887
+ function Y(e) {
2654
2888
  return e.reduce((e, t) => t && !e.includes(t) ? [...e, t] : e, []);
2655
2889
  }
2656
- function Tr({ includeDescendants: e, memberships: t, orgUnitId: n, orgUnits: r, positions: i }) {
2657
- let a = new Set(Er(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
2890
+ function zr({ includeDescendants: e, memberships: t, orgUnitId: n, orgUnits: r, positions: i }) {
2891
+ let a = new Set(Br(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
2658
2892
  return i.filter((e) => o.has(e.id));
2659
2893
  }
2660
- function Er(e, t, n) {
2894
+ function Br(e, t, n) {
2661
2895
  let r = e.find((e) => e.id === t);
2662
2896
  return r ? n ? e.filter((e) => e.id === r.id || e.path.startsWith(`${r.path}.`)).map((e) => e.id) : [r.id] : t.trim() ? [t] : [];
2663
2897
  }
2664
- function Dr(e, t) {
2665
- let n = new Set(e.map((e) => e.memberId)), r = t.filter((e) => !n.has(e.memberId));
2666
- return [...e, ...r];
2898
+ function Vr(e, t) {
2899
+ 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);
2900
+ return i.length > 0 || a.some((t, n) => t !== e[n]) ? [...a, ...i] : e;
2667
2901
  }
2668
- function Or(e) {
2669
- return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ? e.data.approverResolver.type === "DIRECT" ? e.data.approverResolver.memberIds : [] : e.type === "serviceTask" ? qr(e.data.action) : []))];
2902
+ function Hr(e) {
2903
+ return e.type === "DIRECT" ? e.memberIds : (e.type === "ORG_MANAGER" || e.type === "ORG_UNIT_MANAGER") && e.fallback?.type === "DIRECT" && e.fallback.memberId ? [e.fallback.memberId] : [];
2670
2904
  }
2671
- function kr(e, t, n, r) {
2672
- return e.type === "userTask" ? Ar(e.data.approverResolver, t, n, r) : null;
2905
+ function Ur(e) {
2906
+ return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ? Hr(e.data.approverResolver) : e.type === "serviceTask" ? ci(e.data.action) : []))];
2907
+ }
2908
+ function Wr(e, t, n, r) {
2909
+ return e.type === "userTask" ? Gr(e.data.approverResolver, t, n, r) : null;
2673
2910
  }
2674
- function Ar(e, t, n, r) {
2675
- return e.type === "DIRECT" ? Y(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? Kn(e.levelsUp).name : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${G(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${G(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${G(n, e.orgUnitId)} / ${K(r, e.positionId)}` : e.type === "POSITION" ? `職位:${K(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? `表單欄位:${e.formPath || "未設定"}` : "自訂表達式";
2911
+ function Gr(e, t, n, r) {
2912
+ return e.type === "DIRECT" ? Kr(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? sr(e.levelsUp).name : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${K(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${K(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${K(n, e.orgUnitId)} / ${q(r, e.positionId)}` : e.type === "POSITION" ? `職位:${q(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? `表單欄位:${e.formPath || "未設定"}` : "自訂表達式";
2676
2913
  }
2677
- function jr(e, t) {
2914
+ function X(e, t) {
2678
2915
  if (e.type !== "serviceTask") return null;
2679
- let n = qr(e.data.action);
2680
- return n.length === 0 ? ["未指定知會對象"] : n.map((e) => vr(t, e).name);
2916
+ let n = ci(e.data.action);
2917
+ return n.length === 0 ? ["未指定知會對象"] : n.map((e) => Nr(t, e).name);
2681
2918
  }
2682
- function Y(e, t, n) {
2683
- let r = e.map((e) => vr(t, e).name);
2919
+ function Kr(e, t, n) {
2920
+ let r = e.map((e) => Nr(t, e).name);
2684
2921
  return r.length === 0 ? n : r.length <= 2 ? r.join("、") : `${r.slice(0, 2).join("、")} 等 ${r.length} 人`;
2685
2922
  }
2686
- function Mr(e, t) {
2923
+ function qr(e, t) {
2687
2924
  return `${e} (${t})`;
2688
2925
  }
2689
- function Nr(e, t) {
2926
+ function Jr(e, t) {
2690
2927
  let n = t?.getBoundingClientRect();
2691
2928
  if (!n || e.nodes.length === 0) return null;
2692
2929
  let r = e.nodes.reduce((e, t) => {
2693
- let n = V(t);
2930
+ let n = H(t);
2694
2931
  return {
2695
2932
  maxX: Math.max(e.maxX, t.position.x + n.width),
2696
2933
  maxY: Math.max(e.maxY, t.position.y + n.height),
@@ -2703,42 +2940,42 @@ function Nr(e, t) {
2703
2940
  minX: Infinity,
2704
2941
  minY: Infinity
2705
2942
  });
2706
- return Ne({
2943
+ return Pe({
2707
2944
  height: r.maxY - r.minY,
2708
2945
  width: r.maxX - r.minX,
2709
2946
  x: r.minX,
2710
2947
  y: r.minY
2711
2948
  }, n.width, n.height, .1, 1, .2);
2712
2949
  }
2713
- function Pr(e) {
2714
- let t = e.nodes.find((e) => e.type === "userTask" && !!Fr(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "serviceTask" && e.data.action.type === "NOTIFY" && qr(e.data.action).length === 0), r = e.edges.find((t) => Kr(t, e.nodes) && !t.data.isDefault && !t.data.condition);
2715
- return t && t.type === "userTask" ? Fr(t.data.approverResolver) : n ? "知會節點需要至少一位知會對象。" : r ? "條件分流的每條輸出連線都需要先設定條件。" : null;
2950
+ function Yr(e) {
2951
+ let t = e.nodes.find((e) => e.type === "userTask" && !!Xr(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "serviceTask" && e.data.action.type === "NOTIFY" && ci(e.data.action).length === 0), r = e.edges.find((t) => oi(t, e.nodes) && !t.data.isDefault && !t.data.condition);
2952
+ return t && t.type === "userTask" ? Xr(t.data.approverResolver) : n ? "知會節點需要至少一位知會對象。" : r ? "條件分流的每條輸出連線都需要先設定條件。" : null;
2716
2953
  }
2717
- function Fr(e) {
2954
+ function Xr(e) {
2718
2955
  return e.type === "DIRECT" && e.memberIds.length === 0 ? "簽核節點需要指定簽核會員。" : e.type === "ORG_MANAGER" && e.levelsUp < 1 ? "簽核節點需要指定有效的主管層級。" : e.type === "ORG_UNIT_MANAGER" && !e.orgUnitId.trim() || e.type === "ORG_UNIT_MEMBER" && !e.orgUnitId.trim() ? "簽核節點需要指定組織。" : e.type === "ORG_UNIT_POSITION" && (!e.orgUnitId.trim() || !e.positionId.trim()) ? "簽核節點需要指定組織與職位。" : (e.type === "ORG_MANAGER" || e.type === "ORG_UNIT_MANAGER") && e.fallback?.type === "DIRECT" && !e.fallback.memberId.trim() ? "簽核節點需要指定改派固定人。" : e.type === "POSITION" && !e.positionId.trim() ? "簽核節點需要指定職位。" : null;
2719
2956
  }
2720
- function Ir(e) {
2721
- return e.edges.some((t) => Kr(t, e.nodes) && !!(t.data.condition || t.data.conditionFieldKey || t.data.conditionOperator || t.data.conditionValue));
2957
+ function Zr(e) {
2958
+ return e.edges.some((t) => oi(t, e.nodes) && !!(t.data.condition || t.data.conditionFieldKey || t.data.conditionOperator || t.data.conditionValue));
2722
2959
  }
2723
- function Lr(e) {
2960
+ function Qr(e) {
2724
2961
  return e?.fields.map((e) => ({
2725
2962
  fieldType: e.type,
2726
2963
  id: e.fieldKey,
2727
2964
  name: `${e.label} (${e.fieldKey})`
2728
2965
  })) ?? [];
2729
2966
  }
2730
- function Rr(e, t) {
2967
+ function $r(e, t) {
2731
2968
  return t ? e?.fields.find((e) => e.fieldKey === t) ?? null : null;
2732
2969
  }
2733
- function zr(e) {
2970
+ function ei(e) {
2734
2971
  if (!e) return [];
2735
- let t = Vr(e);
2736
- return nn.filter((e) => t.includes(e.id));
2972
+ let t = ni(e);
2973
+ return ln.filter((e) => t.includes(e.id));
2737
2974
  }
2738
- function Br(e) {
2739
- return nn.some((t) => t.id === e) ? e : null;
2975
+ function ti(e) {
2976
+ return ln.some((t) => t.id === e) ? e : null;
2740
2977
  }
2741
- function Vr(e) {
2978
+ function ni(e) {
2742
2979
  return e.type === "file_upload" ? ["IS_FILLED", "IS_EMPTY"] : e.type === "boolean" ? [
2743
2980
  "EQUALS",
2744
2981
  "NOT_EQUALS",
@@ -2760,42 +2997,42 @@ function Vr(e) {
2760
2997
  "IS_EMPTY"
2761
2998
  ];
2762
2999
  }
2763
- function Hr(e) {
3000
+ function ri(e) {
2764
3001
  return e ? e.type === "boolean" ? [{
2765
3002
  id: "true",
2766
3003
  name: "是"
2767
3004
  }, {
2768
3005
  id: "false",
2769
3006
  name: "否"
2770
- }] : e.type === "checkbox" || e.type === "radio" || e.type === "select" ? e.options.map((e) => ({
3007
+ }] : Ce(e) ? e.options.map((e) => ({
2771
3008
  id: e.value,
2772
3009
  name: e.label
2773
3010
  })) : [] : [];
2774
3011
  }
2775
- function Ur(e) {
2776
- return rn.includes(e);
3012
+ function ii(e) {
3013
+ return un.includes(e);
2777
3014
  }
2778
- function Wr(e, t) {
3015
+ function ai(e, t) {
2779
3016
  if (e.data.label) return e.data.label;
2780
- if (Kr(e, t)) return Gr(e);
2781
- if (X(e, t)) return "同時進行";
3017
+ if (oi(e, t)) return Z(e);
3018
+ if (si(e, t)) return "同時進行";
2782
3019
  }
2783
- function Gr(e) {
3020
+ function Z(e) {
2784
3021
  return e.data.isDefault ? "其他情況" : "請設定條件";
2785
3022
  }
2786
- function Kr(e, t) {
3023
+ function oi(e, t) {
2787
3024
  return t.some((t) => t.id === e.source && t.type === "exclusiveGateway");
2788
3025
  }
2789
- function X(e, t) {
3026
+ function si(e, t) {
2790
3027
  return t.some((t) => t.id === e.source && t.type === "parallelGateway");
2791
3028
  }
2792
- function qr(e) {
3029
+ function ci(e) {
2793
3030
  return e.type === "NOTIFY" && e.recipients.type === "DIRECT" ? e.recipients.memberIds : [];
2794
3031
  }
2795
- function Z(e) {
2796
- return e instanceof Error ? e.message : "發生未知錯誤";
3032
+ function li(e) {
3033
+ return e instanceof Error ? Se(e.message) : "發生未知錯誤";
2797
3034
  }
2798
3035
  //#endregion
2799
- export { mn as t };
3036
+ export { xn as t };
2800
3037
 
2801
- //# sourceMappingURL=designer-CUbVXEtS.js.map
3038
+ //# sourceMappingURL=designer-BszXJ5RO.js.map