@rytass/bpm-core-react 0.13.4 → 0.14.0

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