@rytass/bpm-core-react 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/chunks/FormBuilderView-CHaAQL5v.cjs +3 -0
  3. package/dist/chunks/FormBuilderView-CHaAQL5v.cjs.map +1 -0
  4. package/dist/chunks/{FormBuilderView-BVKY1j_0.js → FormBuilderView-vQfVc08Z.js} +485 -481
  5. package/dist/chunks/FormBuilderView-vQfVc08Z.js.map +1 -0
  6. package/dist/chunks/{FormRendererView-BsTwZkqU.js → FormRendererView-CTLlG13b.js} +300 -189
  7. package/dist/chunks/FormRendererView-CTLlG13b.js.map +1 -0
  8. package/dist/chunks/FormRendererView-ChmM_4Yc.cjs +4 -0
  9. package/dist/chunks/FormRendererView-ChmM_4Yc.cjs.map +1 -0
  10. package/dist/chunks/admin-pickers-BjbkBpSJ.cjs +2 -0
  11. package/dist/chunks/admin-pickers-BjbkBpSJ.cjs.map +1 -0
  12. package/dist/chunks/{admin-pickers-Djq3h-UR.js → admin-pickers-DfGxsjpp.js} +42 -42
  13. package/dist/chunks/admin-pickers-DfGxsjpp.js.map +1 -0
  14. package/dist/chunks/{approval-instance-list-page-CPXMP3PL.js → approval-instance-list-page-BnI4t5mD.js} +7 -8
  15. package/dist/chunks/{approval-instance-list-page-CPXMP3PL.js.map → approval-instance-list-page-BnI4t5mD.js.map} +1 -1
  16. package/dist/chunks/{approval-instance-list-page-ax0pm8bt.cjs → approval-instance-list-page-fqvmkBlg.cjs} +2 -2
  17. package/dist/chunks/{approval-instance-list-page-ax0pm8bt.cjs.map → approval-instance-list-page-fqvmkBlg.cjs.map} +1 -1
  18. package/dist/chunks/{approver-filled-form-Dm3Iw7iw.cjs → approver-filled-form-B4zPg9kz.cjs} +2 -2
  19. package/dist/chunks/approver-filled-form-B4zPg9kz.cjs.map +1 -0
  20. package/dist/chunks/{approver-filled-form-ZEwpmsHJ.js → approver-filled-form-Bgazhbvd.js} +40 -36
  21. package/dist/chunks/approver-filled-form-Bgazhbvd.js.map +1 -0
  22. package/dist/chunks/auth-provider-4BeCw7cI.cjs.map +1 -1
  23. package/dist/chunks/{auth-provider-B5oPmvk2.js → auth-provider-C2b-5mGt.js} +2 -3
  24. package/dist/chunks/{auth-provider-B5oPmvk2.js.map → auth-provider-C2b-5mGt.js.map} +1 -1
  25. package/dist/chunks/{bpm-form-field-Cao0rMol.js → bpm-form-field-9B-Det0u.js} +2 -3
  26. package/dist/chunks/{bpm-form-field-Cao0rMol.js.map → bpm-form-field-9B-Det0u.js.map} +1 -1
  27. package/dist/chunks/bpm-form-field-Bc6k4ZEO.cjs.map +1 -1
  28. package/dist/chunks/{categories-riC33J_j.js → categories-BAdxjNSA.js} +14 -15
  29. package/dist/chunks/{categories-riC33J_j.js.map → categories-BAdxjNSA.js.map} +1 -1
  30. package/dist/chunks/{categories-AxxhqjLZ.cjs → categories-DQUtVEiV.cjs} +2 -2
  31. package/dist/chunks/{categories-AxxhqjLZ.cjs.map → categories-DQUtVEiV.cjs.map} +1 -1
  32. package/dist/chunks/{compose-B1GlrZW9.js → compose-D9ipJpF_.js} +131 -148
  33. package/dist/chunks/compose-D9ipJpF_.js.map +1 -0
  34. package/dist/chunks/compose-DtfX8DQ9.cjs +2 -0
  35. package/dist/chunks/compose-DtfX8DQ9.cjs.map +1 -0
  36. package/dist/chunks/{dashboard-page-DdBvV6YI.js → dashboard-page-BoqNhjT_.js} +5 -6
  37. package/dist/chunks/{dashboard-page-DdBvV6YI.js.map → dashboard-page-BoqNhjT_.js.map} +1 -1
  38. package/dist/chunks/{dashboard-page-BWQBSGDq.cjs → dashboard-page-D7YJ3udk.cjs} +2 -2
  39. package/dist/chunks/{dashboard-page-BWQBSGDq.cjs.map → dashboard-page-D7YJ3udk.cjs.map} +1 -1
  40. package/dist/chunks/{delegations-MxF3uJGW.js → delegations-BfhCDz5e.js} +15 -16
  41. package/dist/chunks/{delegations-MxF3uJGW.js.map → delegations-BfhCDz5e.js.map} +1 -1
  42. package/dist/chunks/{delegations-Ckf03icM.cjs → delegations-BmFGcuhA.cjs} +2 -2
  43. package/dist/chunks/{delegations-Ckf03icM.cjs.map → delegations-BmFGcuhA.cjs.map} +1 -1
  44. package/dist/chunks/{delegations-V9HIe3_P.cjs → delegations-CcS0SHbf.cjs} +2 -2
  45. package/dist/chunks/{delegations-V9HIe3_P.cjs.map → delegations-CcS0SHbf.cjs.map} +1 -1
  46. package/dist/chunks/{delegations-xUt1tj8d.js → delegations-DBh5TT6G.js} +16 -17
  47. package/dist/chunks/{delegations-xUt1tj8d.js.map → delegations-DBh5TT6G.js.map} +1 -1
  48. package/dist/chunks/designer-Df79YzUn.cjs +65 -0
  49. package/dist/chunks/designer-Df79YzUn.cjs.map +1 -0
  50. package/dist/chunks/{designer-BCLrjb4H.js → designer-ubnZbP-A.js} +1791 -1407
  51. package/dist/chunks/designer-ubnZbP-A.js.map +1 -0
  52. package/dist/chunks/detail-BBC9kqXd.cjs +5 -0
  53. package/dist/chunks/detail-BBC9kqXd.cjs.map +1 -0
  54. package/dist/chunks/{detail-4F39ggBn.js → detail-C6XKZjlF.js} +1033 -1005
  55. package/dist/chunks/detail-C6XKZjlF.js.map +1 -0
  56. package/dist/chunks/{format-date-time-CB-LxzqT.js → format-date-time-B0LdmWg4.js} +2 -3
  57. package/dist/chunks/{format-date-time-CB-LxzqT.js.map → format-date-time-B0LdmWg4.js.map} +1 -1
  58. package/dist/chunks/format-date-time-D-cx5M8z.cjs.map +1 -1
  59. package/dist/chunks/{format-member-label-DudVI55w.js → format-member-label-C73FuP-d.js} +2 -3
  60. package/dist/chunks/{format-member-label-DudVI55w.js.map → format-member-label-C73FuP-d.js.map} +1 -1
  61. package/dist/chunks/format-member-label-t7ANTF62.cjs.map +1 -1
  62. package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +1 -1
  63. package/dist/chunks/{language-provider-B3cEbLe4.js → language-provider-phkWOapf.js} +2 -3
  64. package/dist/chunks/{language-provider-B3cEbLe4.js.map → language-provider-phkWOapf.js.map} +1 -1
  65. package/dist/chunks/{login-C6qlTC6F.js → login-D6cc3bo7.js} +4 -5
  66. package/dist/chunks/{login-C6qlTC6F.js.map → login-D6cc3bo7.js.map} +1 -1
  67. package/dist/chunks/{login-AtVxZBsC.cjs → login-uvVcltrS.cjs} +2 -2
  68. package/dist/chunks/{login-AtVxZBsC.cjs.map → login-uvVcltrS.cjs.map} +1 -1
  69. package/dist/chunks/notifications-Bc4mgSds.cjs.map +1 -1
  70. package/dist/chunks/{notifications-DJ5wzCye.js → notifications-Cvme5Qbl.js} +2 -3
  71. package/dist/chunks/{notifications-DJ5wzCye.js.map → notifications-Cvme5Qbl.js.map} +1 -1
  72. package/dist/chunks/orgs-B_2J2tLX.cjs +2 -0
  73. package/dist/chunks/{orgs-BeeDDWL1.cjs.map → orgs-B_2J2tLX.cjs.map} +1 -1
  74. package/dist/chunks/{orgs-8hje_l2n.js → orgs-DqxMds26.js} +48 -49
  75. package/dist/chunks/{orgs-8hje_l2n.js.map → orgs-DqxMds26.js.map} +1 -1
  76. package/dist/chunks/{providers-B_d5tbCL.js → providers-BbCs23sk.js} +21 -25
  77. package/dist/chunks/{providers-B_d5tbCL.js.map → providers-BbCs23sk.js.map} +1 -1
  78. package/dist/chunks/{providers-chuJvMgv.cjs → providers-D_KAgOOu.cjs} +2 -2
  79. package/dist/chunks/{providers-chuJvMgv.cjs.map → providers-D_KAgOOu.cjs.map} +1 -1
  80. package/dist/chunks/router-adapter--gYs13E8.cjs.map +1 -1
  81. package/dist/chunks/{router-adapter-DftlFTOd.js → router-adapter-CkxCyzf5.js} +2 -3
  82. package/dist/chunks/{router-adapter-DftlFTOd.js.map → router-adapter-CkxCyzf5.js.map} +1 -1
  83. package/dist/chunks/{routes-config-yZbESPlw.js → routes-config-BcNaWJWJ.js} +2 -3
  84. package/dist/chunks/{routes-config-yZbESPlw.js.map → routes-config-BcNaWJWJ.js.map} +1 -1
  85. package/dist/chunks/routes-config-C1j_vFKo.cjs.map +1 -1
  86. package/dist/chunks/task-decision-3d17ZvZE.js +29 -0
  87. package/dist/chunks/task-decision-3d17ZvZE.js.map +1 -0
  88. package/dist/chunks/task-decision-CqZ4WQOC.cjs +2 -0
  89. package/dist/chunks/task-decision-CqZ4WQOC.cjs.map +1 -0
  90. package/dist/chunks/{use-bpm-member-D57LKe_u.js → use-bpm-member-BPzcNU1g.js} +3 -4
  91. package/dist/chunks/{use-bpm-member-D57LKe_u.js.map → use-bpm-member-BPzcNU1g.js.map} +1 -1
  92. package/dist/chunks/use-bpm-member-DpNAQtNC.cjs.map +1 -1
  93. package/dist/chunks/{users-Pl6hY5Y5.js → users-BBtiZ9QQ.js} +22 -25
  94. package/dist/chunks/{users-Pl6hY5Y5.js.map → users-BBtiZ9QQ.js.map} +1 -1
  95. package/dist/chunks/{users-O2L_M3BK.cjs → users-EqSzDhuj.cjs} +2 -2
  96. package/dist/chunks/{users-O2L_M3BK.cjs.map → users-EqSzDhuj.cjs.map} +1 -1
  97. package/dist/components/admin-picker-options.d.cts +11 -0
  98. package/dist/components/admin-picker-options.d.ts +11 -0
  99. package/dist/components/admin-pickers.d.cts +2 -11
  100. package/dist/components/admin-pickers.d.ts +2 -11
  101. package/dist/index.cjs +1 -1
  102. package/dist/index.cjs.map +1 -1
  103. package/dist/index.js +17 -19
  104. package/dist/index.js.map +1 -1
  105. package/dist/lib/task-decision.d.cts +16 -0
  106. package/dist/lib/task-decision.d.ts +16 -0
  107. package/dist/lib/use-org-unit-names.d.cts +10 -0
  108. package/dist/lib/use-org-unit-names.d.ts +10 -0
  109. package/dist/next/index.cjs +1 -1
  110. package/dist/next/index.cjs.map +1 -1
  111. package/dist/next/index.js +7 -8
  112. package/dist/next/index.js.map +1 -1
  113. package/dist/next/workflow-chat-route.cjs +19 -1
  114. package/dist/next/workflow-chat-route.cjs.map +1 -1
  115. package/dist/next/workflow-chat-route.js +2 -3
  116. package/dist/next/workflow-chat-route.js.map +1 -1
  117. package/dist/pages/admin/delegations/index.cjs +1 -1
  118. package/dist/pages/admin/delegations/index.cjs.map +1 -1
  119. package/dist/pages/admin/delegations/index.js +2 -3
  120. package/dist/pages/admin/orgs/index.cjs +1 -1
  121. package/dist/pages/admin/orgs/index.cjs.map +1 -1
  122. package/dist/pages/admin/orgs/index.js +2 -3
  123. package/dist/pages/admin/users/index.cjs +1 -1
  124. package/dist/pages/admin/users/index.cjs.map +1 -1
  125. package/dist/pages/admin/users/index.js +2 -3
  126. package/dist/pages/admin/webhook-endpoints/index.cjs.map +1 -1
  127. package/dist/pages/admin/webhook-endpoints/index.js +1 -2
  128. package/dist/pages/cc/index.cjs.map +1 -1
  129. package/dist/pages/cc/index.js +1 -2
  130. package/dist/pages/dashboard/index.cjs.map +1 -1
  131. package/dist/pages/dashboard/index.js +1 -2
  132. package/dist/pages/delegations/index.cjs +1 -1
  133. package/dist/pages/delegations/index.cjs.map +1 -1
  134. package/dist/pages/delegations/index.js +2 -3
  135. package/dist/pages/inbox/index.cjs.map +1 -1
  136. package/dist/pages/inbox/index.js +1 -2
  137. package/dist/pages/instances/detail/index.cjs +1 -1
  138. package/dist/pages/instances/detail/index.cjs.map +1 -1
  139. package/dist/pages/instances/detail/index.js +2 -3
  140. package/dist/pages/instances/new/index.cjs.map +1 -1
  141. package/dist/pages/instances/new/index.js +1 -2
  142. package/dist/pages/login/index.cjs +1 -1
  143. package/dist/pages/login/index.cjs.map +1 -1
  144. package/dist/pages/login/index.js +2 -3
  145. package/dist/pages/root/index.cjs.map +1 -1
  146. package/dist/pages/root/index.js +1 -2
  147. package/dist/pages/search/index.cjs.map +1 -1
  148. package/dist/pages/search/index.js +1 -2
  149. package/dist/pages/sent/index.cjs.map +1 -1
  150. package/dist/pages/sent/index.js +1 -2
  151. package/dist/pages/settings/notifications/index.cjs.map +1 -1
  152. package/dist/pages/settings/notifications/index.js +2 -3
  153. package/dist/pages/templates/categories/index.cjs +1 -1
  154. package/dist/pages/templates/categories/index.cjs.map +1 -1
  155. package/dist/pages/templates/categories/index.js +2 -3
  156. package/dist/pages/templates/compose/index.cjs +1 -1
  157. package/dist/pages/templates/compose/index.cjs.map +1 -1
  158. package/dist/pages/templates/compose/index.js +2 -3
  159. package/dist/pages/templates/designer/index.cjs +1 -1
  160. package/dist/pages/templates/designer/index.cjs.map +1 -1
  161. package/dist/pages/templates/designer/index.js +2 -3
  162. package/dist/pages/templates/index.cjs.map +1 -1
  163. package/dist/pages/templates/index.js +1 -2
  164. package/dist/pages/templates/versions/index.cjs.map +1 -1
  165. package/dist/pages/templates/versions/index.js +1 -2
  166. package/dist/views/admin/delegations/index.cjs +1 -1
  167. package/dist/views/admin/delegations/index.js +1 -1
  168. package/dist/views/admin/index.cjs +1 -1
  169. package/dist/views/admin/index.js +3 -3
  170. package/dist/views/admin/orgs/index.cjs +1 -1
  171. package/dist/views/admin/orgs/index.js +1 -1
  172. package/dist/views/admin/users/index.cjs +1 -1
  173. package/dist/views/admin/users/index.js +1 -1
  174. package/dist/views/admin/webhook-endpoints/index.cjs +1 -1
  175. package/dist/views/admin/webhook-endpoints/index.cjs.map +1 -1
  176. package/dist/views/admin/webhook-endpoints/index.js +52 -53
  177. package/dist/views/admin/webhook-endpoints/index.js.map +1 -1
  178. package/dist/views/cc/index.cjs +1 -1
  179. package/dist/views/cc/index.cjs.map +1 -1
  180. package/dist/views/cc/index.js +2 -3
  181. package/dist/views/dashboard/index.cjs +1 -1
  182. package/dist/views/dashboard/index.cjs.map +1 -1
  183. package/dist/views/dashboard/index.js +2 -3
  184. package/dist/views/delegations/index.cjs +1 -1
  185. package/dist/views/delegations/index.js +1 -1
  186. package/dist/views/forms/builder/index.cjs +1 -1
  187. package/dist/views/forms/builder/index.js +1 -1
  188. package/dist/views/forms/renderer/index.cjs +1 -1
  189. package/dist/views/forms/renderer/index.js +1 -1
  190. package/dist/views/forms/renderer/org-unit-field-options.d.cts +44 -0
  191. package/dist/views/forms/renderer/org-unit-field-options.d.ts +44 -0
  192. package/dist/views/forms/renderer/org-unit-field.d.cts +23 -0
  193. package/dist/views/forms/renderer/org-unit-field.d.ts +23 -0
  194. package/dist/views/inbox/index.cjs +1 -1
  195. package/dist/views/inbox/index.cjs.map +1 -1
  196. package/dist/views/inbox/index.js +133 -137
  197. package/dist/views/inbox/index.js.map +1 -1
  198. package/dist/views/instances/approver-filled-form.d.cts +9 -2
  199. package/dist/views/instances/approver-filled-form.d.ts +9 -2
  200. package/dist/views/instances/detail/index.cjs +1 -1
  201. package/dist/views/instances/detail/index.js +1 -1
  202. package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +8 -1
  203. package/dist/views/instances/detail/sections/InstanceHistorySection.d.ts +8 -1
  204. package/dist/views/instances/detail/sections/container-helpers.d.cts +0 -1
  205. package/dist/views/instances/detail/sections/container-helpers.d.ts +0 -1
  206. package/dist/views/instances/detail/sections/shared.d.cts +2 -2
  207. package/dist/views/instances/detail/sections/shared.d.ts +2 -2
  208. package/dist/views/instances/new/index.cjs +1 -1
  209. package/dist/views/instances/new/index.cjs.map +1 -1
  210. package/dist/views/instances/new/index.js +14 -15
  211. package/dist/views/instances/new/index.js.map +1 -1
  212. package/dist/views/login/index.cjs +1 -1
  213. package/dist/views/login/index.js +1 -1
  214. package/dist/views/search/index.cjs +1 -1
  215. package/dist/views/search/index.cjs.map +1 -1
  216. package/dist/views/search/index.js +2 -3
  217. package/dist/views/sent/index.cjs +1 -1
  218. package/dist/views/sent/index.cjs.map +1 -1
  219. package/dist/views/sent/index.js +2 -3
  220. package/dist/views/settings/index.js +1 -1
  221. package/dist/views/settings/notifications/index.js +1 -1
  222. package/dist/views/templates/categories/index.cjs +1 -1
  223. package/dist/views/templates/categories/index.js +1 -1
  224. package/dist/views/templates/compose/index.cjs +1 -1
  225. package/dist/views/templates/compose/index.js +1 -1
  226. package/dist/views/templates/designer/approver-resolver-model.d.cts +211 -0
  227. package/dist/views/templates/designer/approver-resolver-model.d.ts +211 -0
  228. package/dist/views/templates/designer/dry-run-assignee-label.d.cts +2 -0
  229. package/dist/views/templates/designer/dry-run-assignee-label.d.ts +2 -0
  230. package/dist/views/templates/designer/dry-run-sample-data.d.cts +6 -0
  231. package/dist/views/templates/designer/dry-run-sample-data.d.ts +6 -0
  232. package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +25 -0
  233. package/dist/views/templates/designer/dynamic-form-resolver-options.d.ts +25 -0
  234. package/dist/views/templates/designer/index.cjs +1 -1
  235. package/dist/views/templates/designer/index.js +1 -1
  236. package/dist/views/templates/designer/node-actor-resolver-options.d.cts +38 -0
  237. package/dist/views/templates/designer/node-actor-resolver-options.d.ts +38 -0
  238. package/dist/views/templates/index.cjs +1 -1
  239. package/dist/views/templates/index.cjs.map +1 -1
  240. package/dist/views/templates/index.js +50 -51
  241. package/dist/views/templates/index.js.map +1 -1
  242. package/dist/views/templates/versions/index.cjs +1 -1
  243. package/dist/views/templates/versions/index.cjs.map +1 -1
  244. package/dist/views/templates/versions/index.js +7 -8
  245. package/dist/views/templates/versions/index.js.map +1 -1
  246. package/package.json +3 -3
  247. package/dist/chunks/FormBuilderView-BVKY1j_0.js.map +0 -1
  248. package/dist/chunks/FormBuilderView-SrGltzFT.cjs +0 -3
  249. package/dist/chunks/FormBuilderView-SrGltzFT.cjs.map +0 -1
  250. package/dist/chunks/FormRendererView-BsTwZkqU.js.map +0 -1
  251. package/dist/chunks/FormRendererView-GpsE03np.cjs +0 -4
  252. package/dist/chunks/FormRendererView-GpsE03np.cjs.map +0 -1
  253. package/dist/chunks/admin-pickers-BRHk3qKq.cjs +0 -2
  254. package/dist/chunks/admin-pickers-BRHk3qKq.cjs.map +0 -1
  255. package/dist/chunks/admin-pickers-Djq3h-UR.js.map +0 -1
  256. package/dist/chunks/approver-filled-form-Dm3Iw7iw.cjs.map +0 -1
  257. package/dist/chunks/approver-filled-form-ZEwpmsHJ.js.map +0 -1
  258. package/dist/chunks/compose-B1GlrZW9.js.map +0 -1
  259. package/dist/chunks/compose-DZk-SfHT.cjs +0 -2
  260. package/dist/chunks/compose-DZk-SfHT.cjs.map +0 -1
  261. package/dist/chunks/designer-BCLrjb4H.js.map +0 -1
  262. package/dist/chunks/designer-BYYxEN9L.cjs +0 -65
  263. package/dist/chunks/designer-BYYxEN9L.cjs.map +0 -1
  264. package/dist/chunks/detail-4F39ggBn.js.map +0 -1
  265. package/dist/chunks/detail-BkMtA_0K.cjs +0 -2
  266. package/dist/chunks/detail-BkMtA_0K.cjs.map +0 -1
  267. package/dist/chunks/orgs-BeeDDWL1.cjs +0 -2
  268. package/dist/chunks/task-node-label-BF6UllxP.cjs +0 -2
  269. package/dist/chunks/task-node-label-BF6UllxP.cjs.map +0 -1
  270. package/dist/chunks/task-node-label-CWZgOBj0.js +0 -9
  271. package/dist/chunks/task-node-label-CWZgOBj0.js.map +0 -1
@@ -1,27 +1,42 @@
1
1
  "use client";
2
- import { n as e } from "./auth-provider-B5oPmvk2.js";
3
- import { t } from "./format-date-time-CB-LxzqT.js";
4
- import { t as n } from "./bpm-form-field-Cao0rMol.js";
5
- import { t as r } from "./use-bpm-member-D57LKe_u.js";
6
- import { t as i } from "./format-member-label-DudVI55w.js";
7
- import { t as a } from "./task-node-label-CWZgOBj0.js";
8
- import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p, t as ee, u as te } from "./approver-filled-form-ZEwpmsHJ.js";
9
- import { o as m, t as ne } from "./FormRendererView-BsTwZkqU.js";
10
2
  import '../style.css';import '../detail.css';/* empty css */
11
- import { Fragment as re, forwardRef as ie, useCallback as h, useEffect as g, useImperativeHandle as ae, useMemo as _, useRef as v, useState as y } from "react";
12
- import { AutoComplete as oe, Badge as se, Button as b, Description as x, DescriptionContent as ce, InlineMessage as S, Input as le, Message as ue, Modal as C, PageHeader as de, Section as fe, SectionGroup as pe, Select as w, Stepper as me, Table as he, Textarea as ge, Tooltip as _e, Typography as T } from "@mezzanine-ui/react";
13
- import { Fragment as ve, jsx as E, jsxs as D } from "react/jsx-runtime";
14
- import { cancelAdhocDirective as ye, cancelApprovalInstance as be, configureAdhocCompletionNotification as xe, configureAdhocStageNotification as Se, decideTask as Ce, listAdhocDirectives as we, listAttachments as Te, listTaskDecisions as O, listWorkflowWebhookDeliveries as Ee, readApprovalInstance as De, readAttachmentDownloadUrl as Oe, readAttachmentPreviewUrl as ke, readInstanceSignatures as Ae, requestAdhocCountersign as je, requestAdhocPreApproval as Me, resolveMemberProfiles as Ne, resubmitApprovalInstance as Pe, retryWorkflowWebhookDelivery as Fe, searchMembers as k, uploadAttachment as Ie } from "@rytass/bpm-core-client/workflow";
15
- import Le from "@mezzanine-ui/react/ContentHeader";
16
- import { CheckedIcon as Re, ChevronLeftIcon as ze, ChevronRightIcon as Be, DangerousOutlineIcon as Ve, DownloadIcon as He, FileSearchIcon as Ue, NotificationUnreadIcon as We, PlusIcon as Ge, RefreshCcwIcon as Ke, ResetIcon as qe, ShareIcon as A, UserIcon as Je, ZoomInIcon as Ye, ZoomOutIcon as j } from "@mezzanine-ui/icons";
17
- import { readNodeFillableFieldKeys as Xe, readRevealedFieldKeys as Ze, readTopLevelFieldKey as Qe, resolveFieldAccess as $e } from "@rytass/bpm-core-shared";
18
- import { buildFormRendererValues as et, focusFormRendererField as tt, readFormDataSourceErrorMessage as M, validateFormRendererValuesInWorker as nt } from "@rytass/bpm-core-client/form";
19
- import { Background as rt, Controls as N, Handle as P, Position as F, ReactFlow as it } from "@xyflow/react";
20
- import * as at from "dagre";
21
- import { Document as ot, Page as st } from "react-pdf";
22
- import { readSelectableReturnTargetNodeIds as ct } from "@rytass/bpm-core-shared/workflow-graph";
23
- import { stepClasses as I } from "@mezzanine-ui/core/stepper";
24
- var L = {
3
+ import { t as e } from "./bpm-form-field-9B-Det0u.js";
4
+ import { t } from "./format-date-time-B0LdmWg4.js";
5
+ import { n } from "./auth-provider-C2b-5mGt.js";
6
+ import { t as r } from "./use-bpm-member-BPzcNU1g.js";
7
+ import { n as i, s as a, t as o } from "./FormRendererView-CTLlG13b.js";
8
+ import { a as s, n as c, o as l, r as u, t as d } from "./task-decision-3d17ZvZE.js";
9
+ import { t as f } from "./format-member-label-C73FuP-d.js";
10
+ import { a as p, c as m, d as h, i as g, l as ee, n as te, o as ne, r as _, s as re, t as ie, u as v } from "./approver-filled-form-Bgazhbvd.js";
11
+ import { Fragment as ae, forwardRef as y, useCallback as oe, useEffect as se, useImperativeHandle as ce, useMemo as b, useRef as le, useState as x } from "react";
12
+ import { AutoComplete as ue, Badge as de, Button as S, Description as C, DescriptionContent as fe, InlineMessage as w, Input as pe, Message as me, Modal as T, PageHeader as he, Section as ge, SectionGroup as _e, Select as ve, Stepper as ye, Table as be, Textarea as xe, Tooltip as Se, Typography as E } from "@mezzanine-ui/react";
13
+ import { Fragment as Ce, jsx as D, jsxs as O } from "react/jsx-runtime";
14
+ import { cancelAdhocDirective as we, cancelApprovalInstance as Te, configureAdhocCompletionNotification as Ee, configureAdhocStageNotification as De, decideTask as Oe, listAdhocDirectives as ke, listAttachments as Ae, listTaskDecisions as k, listWorkflowWebhookDeliveries as je, readApprovalInstance as Me, readAttachmentDownloadUrl as Ne, readAttachmentPreviewUrl as Pe, readInstanceSignatures as Fe, requestAdhocCountersign as Ie, requestAdhocPreApproval as Le, resolveMemberProfiles as Re, resubmitApprovalInstance as ze, retryWorkflowWebhookDelivery as Be, searchMembers as Ve, uploadAttachment as He } from "@rytass/bpm-core-client/workflow";
15
+ import Ue from "@mezzanine-ui/react/ContentHeader";
16
+ import { CheckedIcon as We, ChevronLeftIcon as Ge, ChevronRightIcon as Ke, DangerousOutlineIcon as qe, DownloadIcon as A, FileSearchIcon as Je, NotificationUnreadIcon as Ye, PlusIcon as Xe, RefreshCcwIcon as Ze, ResetIcon as Qe, ShareIcon as $e, UserIcon as et, ZoomInIcon as tt, ZoomOutIcon as j } from "@mezzanine-ui/icons";
17
+ import { readNodeFillableFieldKeys as nt, readRevealedFieldKeys as rt, readTopLevelFieldKey as it, resolveFieldAccess as M } from "@rytass/bpm-core-shared";
18
+ import { buildFormRendererValues as N, focusFormRendererField as at, readFormDataSourceErrorMessage as ot, validateFormRendererValuesInWorker as st } from "@rytass/bpm-core-client/form";
19
+ import { resolveOrgUnitOptions as ct } from "@rytass/bpm-core-client/organization";
20
+ import { Background as lt, Controls as ut, Handle as dt, Position as P, ReactFlow as ft } from "@xyflow/react";
21
+ import * as pt from "dagre";
22
+ import { Document as mt, Page as ht } from "react-pdf";
23
+ import { readSelectableReturnTargetNodeIds as gt } from "@rytass/bpm-core-shared/workflow-graph";
24
+ import { stepClasses as F } from "@mezzanine-ui/core/stepper";
25
+ function _t(e) {
26
+ let [t, n] = x(/* @__PURE__ */ new Map()), r = e.join("\n");
27
+ return se(() => {
28
+ let e = r ? [...new Set(r.split("\n"))].filter((e) => !t.has(e)) : [], a = !1;
29
+ return e.length === 0 ? () => void 0 : (ct(e).then((e) => e.map(i)).catch(() => []).then((t) => {
30
+ a || n((n) => new Map([...n, ...e.map((e) => [e, t.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? null])]));
31
+ }), () => {
32
+ a = !0;
33
+ });
34
+ }, [r, t]), b(() => new Map((r ? [...new Set(r.split("\n"))] : []).flatMap((e) => {
35
+ let n = t.get(e);
36
+ return n === null ? [] : [[e, n ?? "讀取中…"]];
37
+ })), [r, t]);
38
+ }
39
+ var I = {
25
40
  root: "bpm_root_ehm7w",
26
41
  toolbar: "bpm_toolbar_R-tis",
27
42
  pageControls: "bpm_pageControls_jM-rC",
@@ -30,10 +45,10 @@ var L = {
30
45
  viewport: "bpm_viewport_DQXms",
31
46
  page: "bpm_page_Cv5Rg",
32
47
  state: "bpm_state_bpgp3"
33
- }, lt = 760, ut = 920, dt = 320, ft = 32, R = .75, pt = 1.75, mt = .25;
34
- function ht({ filename: e, fileUrl: t, onDownload: n }) {
35
- let r = v(null), [i, a] = y(null), [o, s] = y(1), [c, l] = y(1), [u, d] = y(lt);
36
- g(() => {
48
+ }, vt = 760, yt = 920, bt = 320, xt = 32, St = .75, Ct = 1.75, L = .25;
49
+ function wt({ filename: e, fileUrl: t, onDownload: n }) {
50
+ let r = le(null), [i, a] = x(null), [o, s] = x(1), [c, l] = x(1), [u, d] = x(vt);
51
+ se(() => {
37
52
  let e = r.current;
38
53
  if (!e || typeof ResizeObserver > "u") return;
39
54
  let t = new ResizeObserver((e) => {
@@ -41,45 +56,45 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
41
56
  t && d(t);
42
57
  });
43
58
  return t.observe(e), () => t.disconnect();
44
- }, []), g(() => {
59
+ }, []), se(() => {
45
60
  a(null), s(1), l(1);
46
61
  }, [t]);
47
- let f = _(() => {
48
- let e = Math.max(dt, u - ft);
49
- return Math.round(Math.min(ut, e) * c);
50
- }, [c, u]), p = h((e) => {
62
+ let f = b(() => {
63
+ let e = Math.max(bt, u - xt);
64
+ return Math.round(Math.min(yt, e) * c);
65
+ }, [c, u]), p = oe((e) => {
51
66
  a(e.numPages), s(1);
52
- }, []), ee = o > 1, te = i !== null && o < i, m = c > R, ne = c < pt, re = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, ie = `${Math.round(c * 100)}%`;
53
- return /* @__PURE__ */ D("section", {
67
+ }, []), m = o > 1, h = i !== null && o < i, g = c > St, ee = c < Ct, te = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, ne = `${Math.round(c * 100)}%`;
68
+ return /* @__PURE__ */ O("section", {
54
69
  "aria-label": `${e} PDF 預覽`,
55
- className: L.root,
56
- children: [/* @__PURE__ */ D("div", {
57
- className: L.toolbar,
70
+ className: I.root,
71
+ children: [/* @__PURE__ */ O("div", {
72
+ className: I.toolbar,
58
73
  children: [
59
- /* @__PURE__ */ D("div", {
60
- className: L.pageControls,
74
+ /* @__PURE__ */ O("div", {
75
+ className: I.pageControls,
61
76
  "aria-label": "頁面切換",
62
77
  children: [
63
- /* @__PURE__ */ E(b, {
78
+ /* @__PURE__ */ D(S, {
64
79
  "aria-label": "上一頁",
65
- disabled: !ee,
66
- icon: ze,
80
+ disabled: !m,
81
+ icon: Ge,
67
82
  onClick: () => {
68
83
  s((e) => Math.max(1, e - 1));
69
84
  },
70
85
  size: "minor",
71
86
  variant: "base-secondary"
72
87
  }),
73
- /* @__PURE__ */ E(T, {
74
- className: L.counter,
88
+ /* @__PURE__ */ D(E, {
89
+ className: I.counter,
75
90
  component: "span",
76
91
  variant: "body",
77
- children: re
92
+ children: te
78
93
  }),
79
- /* @__PURE__ */ E(b, {
94
+ /* @__PURE__ */ D(S, {
80
95
  "aria-label": "下一頁",
81
- disabled: !te,
82
- icon: Be,
96
+ disabled: !h,
97
+ icon: Ke,
83
98
  onClick: () => {
84
99
  s((e) => i === null ? e : Math.min(i, e + 1));
85
100
  },
@@ -88,40 +103,40 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
88
103
  })
89
104
  ]
90
105
  }),
91
- /* @__PURE__ */ D("div", {
92
- className: L.zoomControls,
106
+ /* @__PURE__ */ O("div", {
107
+ className: I.zoomControls,
93
108
  "aria-label": "縮放",
94
109
  children: [
95
- /* @__PURE__ */ E(b, {
110
+ /* @__PURE__ */ D(S, {
96
111
  "aria-label": "縮小",
97
- disabled: !m,
112
+ disabled: !g,
98
113
  icon: j,
99
114
  onClick: () => {
100
- l((e) => Math.max(R, e - mt));
115
+ l((e) => Math.max(St, e - L));
101
116
  },
102
117
  size: "minor",
103
118
  variant: "base-secondary"
104
119
  }),
105
- /* @__PURE__ */ E(T, {
106
- className: L.counter,
120
+ /* @__PURE__ */ D(E, {
121
+ className: I.counter,
107
122
  component: "span",
108
123
  variant: "body",
109
- children: ie
124
+ children: ne
110
125
  }),
111
- /* @__PURE__ */ E(b, {
126
+ /* @__PURE__ */ D(S, {
112
127
  "aria-label": "放大",
113
- disabled: !ne,
114
- icon: Ye,
128
+ disabled: !ee,
129
+ icon: tt,
115
130
  onClick: () => {
116
- l((e) => Math.min(pt, e + mt));
131
+ l((e) => Math.min(Ct, e + L));
117
132
  },
118
133
  size: "minor",
119
134
  variant: "base-secondary"
120
135
  })
121
136
  ]
122
137
  }),
123
- n ? /* @__PURE__ */ E(b, {
124
- icon: He,
138
+ n ? /* @__PURE__ */ D(S, {
139
+ icon: A,
125
140
  iconType: "leading",
126
141
  onClick: n,
127
142
  size: "minor",
@@ -129,19 +144,19 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
129
144
  children: "下載"
130
145
  }) : null
131
146
  ]
132
- }), /* @__PURE__ */ E("div", {
133
- className: L.viewport,
147
+ }), /* @__PURE__ */ D("div", {
148
+ className: I.viewport,
134
149
  ref: r,
135
- children: /* @__PURE__ */ E(ot, {
136
- error: /* @__PURE__ */ E(gt, { message: "PDF 無法載入。" }),
150
+ children: /* @__PURE__ */ D(mt, {
151
+ error: /* @__PURE__ */ D(Tt, { message: "PDF 無法載入。" }),
137
152
  file: t,
138
- loading: /* @__PURE__ */ E(gt, { message: "正在載入 PDF..." }),
139
- noData: /* @__PURE__ */ E(gt, { message: "沒有可預覽的 PDF。" }),
153
+ loading: /* @__PURE__ */ D(Tt, { message: "正在載入 PDF..." }),
154
+ noData: /* @__PURE__ */ D(Tt, { message: "沒有可預覽的 PDF。" }),
140
155
  onLoadSuccess: p,
141
156
  suspense: !1,
142
- children: /* @__PURE__ */ E(st, {
143
- className: L.page,
144
- loading: /* @__PURE__ */ E(gt, { message: "正在載入頁面..." }),
157
+ children: /* @__PURE__ */ D(ht, {
158
+ className: I.page,
159
+ loading: /* @__PURE__ */ D(Tt, { message: "正在載入頁面..." }),
145
160
  pageNumber: o,
146
161
  renderAnnotationLayer: !0,
147
162
  renderTextLayer: !0,
@@ -151,132 +166,130 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
151
166
  })]
152
167
  });
153
168
  }
154
- function gt({ message: e }) {
155
- return /* @__PURE__ */ E("div", {
156
- className: L.state,
157
- children: /* @__PURE__ */ E(T, {
169
+ function Tt({ message: e }) {
170
+ return /* @__PURE__ */ D("div", {
171
+ className: I.state,
172
+ children: /* @__PURE__ */ D(E, {
158
173
  color: "text-neutral",
159
174
  variant: "body",
160
175
  children: e
161
176
  })
162
177
  });
163
178
  }
164
- //#endregion
165
- //#region src/views/instances/detail/submitted-by.ts
166
- function _t({ initiatorMemberId: e, submittedByMemberId: t }) {
179
+ // src/views/instances/detail/submitted-by.ts
180
+ function Et({ initiatorMemberId: e, submittedByMemberId: t }) {
167
181
  return t && t !== e ? t : null;
168
182
  }
169
- function vt(e, t) {
170
- let n = _t(e);
183
+ function Dt(e, t) {
184
+ let n = Et(e);
171
185
  if (!n || !e.initiatorMemberId) return null;
172
186
  let r = (e) => t.get(e)?.name ?? e;
173
187
  return `由 ${r(n)} 代 ${r(e.initiatorMemberId)} 送出`;
174
188
  }
175
- //#endregion
176
- //#region src/views/instances/detail/sections/shared.ts
177
- function yt(e) {
178
- let t = z(e, "from"), n = z(e, "to"), r = z(e, "reason");
189
+ // src/views/instances/detail/sections/shared.ts
190
+ function Ot(e) {
191
+ let t = R(e, "from"), n = R(e, "to"), r = R(e, "reason");
179
192
  return !t || !n || !r ? null : {
180
193
  from: t,
181
194
  reason: r,
182
- ruleId: z(e, "ruleId"),
195
+ ruleId: R(e, "ruleId"),
183
196
  to: n
184
197
  };
185
198
  }
186
- function bt(e) {
199
+ function kt(e) {
187
200
  try {
188
201
  let t = JSON.parse(e);
189
- return Array.isArray(t) ? t.map((e) => St(e) ? yt(e) : null).filter((e) => e !== null) : [];
202
+ return Array.isArray(t) ? t.map((e) => jt(e) ? Ot(e) : null).filter((e) => e !== null) : [];
190
203
  } catch {
191
204
  return [];
192
205
  }
193
206
  }
194
- function z(e, t) {
207
+ function R(e, t) {
195
208
  let n = e[t];
196
209
  return typeof n == "string" ? n : null;
197
210
  }
198
- function B(e, t) {
211
+ function At(e, t) {
199
212
  let n = e[t];
200
213
  return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
201
214
  }
202
- function xt(e, t) {
215
+ function z(e, t) {
203
216
  let n = e[t];
204
217
  return typeof n == "number" ? n : null;
205
218
  }
206
- function V(e) {
219
+ function B(e) {
207
220
  return typeof e == "string" && e.trim().length > 0;
208
221
  }
209
- function St(e) {
222
+ function jt(e) {
210
223
  return typeof e == "object" && !!e;
211
224
  }
212
- function Ct(e) {
225
+ function Mt(e) {
213
226
  return e.status === "PENDING" || e.status === "IN_PROGRESS";
214
227
  }
215
- function H(e) {
216
- return M(e) || (e instanceof Error ? e.message : "發生未知錯誤");
228
+ function V(e) {
229
+ return ot(e) || (e instanceof Error ? e.message : "發生未知錯誤");
217
230
  }
218
- function wt(e) {
231
+ function Nt(e) {
219
232
  return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
220
233
  }
221
- function Tt(e) {
234
+ function H(e) {
222
235
  return e.length > 16 ? `${e.slice(0, 12)}...` : e;
223
236
  }
224
- function Et(e) {
237
+ function Pt(e) {
225
238
  return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
226
239
  }
227
240
  function U(e) {
228
241
  return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
229
242
  }
230
- function Dt(e) {
243
+ function Ft(e) {
231
244
  return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
232
245
  }
233
- function Ot(e) {
246
+ function It(e) {
234
247
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
235
248
  }
236
- function kt(e, t) {
249
+ function Lt(e, t) {
237
250
  return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
238
251
  }
239
252
  function W(e, t) {
240
253
  if (!e) return "-";
241
254
  let n = t.get(e);
242
- return n ? i(n.name, n.email, "fullwidth") : e;
255
+ return n ? f(n.name, n.email, "fullwidth") : e;
243
256
  }
244
- function At(e, t = /* @__PURE__ */ new Map()) {
245
- let n = bt(e.delegationChainJson);
257
+ function Rt(e, t = /* @__PURE__ */ new Map()) {
258
+ let n = kt(e.delegationChainJson);
246
259
  if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => W(e, t)).join("、")}` : "未指定";
247
260
  let r = W(e.assigneeMemberId, t), i = W(e.originalAssigneeMemberId, t);
248
261
  return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
249
262
  }
250
- function G(e, t) {
263
+ function zt(e, t) {
251
264
  return t ? e.assigneeMemberId === t || (e.openCandidateMemberIds ?? e.candidateMemberIds).includes(t) : !1;
252
265
  }
253
- function jt(e, t) {
254
- let n = e.filter((e) => G(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
266
+ function Bt(e, t) {
267
+ let n = e.filter((e) => zt(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
255
268
  return n.find((e) => !e.isAdhoc) ?? n[0] ?? null;
256
269
  }
257
- function K(e, t) {
270
+ function Vt(e, t) {
258
271
  if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
259
272
  if (t.data.returnBehavior.allowedTargets === "ANY") {
260
- let n = ct(e, t.id);
273
+ let n = gt(e, t.id);
261
274
  return e.nodes.filter((e) => n.includes(e.id)).map((e) => ({
262
275
  id: e.id,
263
- name: `${e.data.label}(${Ot(e.type)})`
276
+ name: `${e.data.label}(${It(e.type)})`
264
277
  }));
265
278
  }
266
279
  let n = t.data.returnBehavior.allowedTargets === "INITIATOR" ? e.nodes.find((e) => e.type === "startEvent")?.id : e.edges.find((e) => e.target === t.id)?.source, r = e.nodes.find((e) => e.id === n);
267
280
  return r ? [{
268
281
  id: r.id,
269
- name: `${r.data.label}(${Ot(r.type)})`
282
+ name: `${r.data.label}(${It(r.type)})`
270
283
  }] : [];
271
284
  }
272
- function Mt(e) {
285
+ function Ht(e) {
273
286
  return {
274
287
  email: e.email,
275
288
  id: e.memberId,
276
- name: i(e.name, e.email, "dot")
289
+ name: f(e.name, e.email, "dot")
277
290
  };
278
291
  }
279
- function Nt({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
292
+ function G({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
280
293
  if (t) {
281
294
  let e = n.trim();
282
295
  return e ? {
@@ -301,11 +314,11 @@ function Nt({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
301
314
  valid: !1
302
315
  };
303
316
  }
304
- function Pt(e) {
317
+ function Ut(e) {
305
318
  return !!e;
306
319
  }
307
- function Ft(e) {
308
- if (!St(e)) return null;
320
+ function Wt(e) {
321
+ if (!jt(e)) return null;
309
322
  let t = e.email, n = e.id, r = e.name;
310
323
  return typeof n == "string" && typeof r == "string" ? {
311
324
  email: typeof t == "string" ? t : null,
@@ -313,7 +326,7 @@ function Ft(e) {
313
326
  name: r
314
327
  } : null;
315
328
  }
316
- function It(e, t) {
329
+ function Gt(e, t) {
317
330
  let n = e.trim().toLocaleLowerCase();
318
331
  if (!n) return null;
319
332
  let r = t.filter((e) => [
@@ -323,21 +336,21 @@ function It(e, t) {
323
336
  ].some((e) => e.toLocaleLowerCase().includes(n)));
324
337
  return r.length === 1 ? r[0] ?? null : null;
325
338
  }
326
- function q(e) {
327
- return V(e) ? {
339
+ function K(e) {
340
+ return B(e) ? {
328
341
  text: e,
329
342
  type: "text"
330
343
  } : null;
331
344
  }
332
- function J(e, t, n = "neutral") {
333
- return V(t) ? {
345
+ function q(e, t, n = "neutral") {
346
+ return B(t) ? {
334
347
  label: e,
335
348
  text: t,
336
349
  tone: n,
337
350
  type: "comment"
338
351
  } : null;
339
352
  }
340
- function Lt(e, t, n, r) {
353
+ function Kt(e, t, n, r) {
341
354
  let i = t ? n.get(t) : null;
342
355
  return {
343
356
  email: i?.email ?? null,
@@ -347,43 +360,43 @@ function Lt(e, t, n, r) {
347
360
  type: "member"
348
361
  };
349
362
  }
350
- function Y(e) {
363
+ function J(e) {
351
364
  return !!e;
352
365
  }
353
- function Rt(e) {
366
+ function Y(e) {
354
367
  let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
355
368
  return t === -1 ? e.length : t;
356
369
  }
357
- function zt(e) {
358
- return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "INSTANCE_RESUBMITTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || Bt(e) || X(e.eventType, Wt(e));
370
+ function X(e) {
371
+ return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "INSTANCE_RESUBMITTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || Z(e) || Yt(e.eventType, $t(e));
359
372
  }
360
- function Bt(e) {
361
- return e.eventType === "TASK_CREATED" && B(Wt(e), "sequentialCandidateMemberIds").length > 0;
373
+ function Z(e) {
374
+ return e.eventType === "TASK_CREATED" && At($t(e), "sequentialCandidateMemberIds").length > 0;
362
375
  }
363
- function Vt(e) {
376
+ function qt(e) {
364
377
  if (e.eventType !== "TASK_CANDIDATE_ACTIVATED" && e.eventType !== "TASK_CREATED") return [];
365
- let t = Wt(e);
378
+ let t = $t(e);
366
379
  return [
367
- ...B(t, "sequentialCandidateMemberIds"),
368
- z(t, "candidateMemberId"),
369
- z(t, "previousMemberId")
370
- ].filter(V);
380
+ ...At(t, "sequentialCandidateMemberIds"),
381
+ R(t, "candidateMemberId"),
382
+ R(t, "previousMemberId")
383
+ ].filter(B);
371
384
  }
372
- var Ht = /* @__PURE__ */ new Set([
385
+ var Jt = /* @__PURE__ */ new Set([
373
386
  "SERVICE_TASK_EXECUTED",
374
387
  "SERVICE_TASK_FAILED",
375
388
  "WEBHOOK_DELIVERY_RETRIED"
376
389
  ]);
377
- function X(e, t) {
378
- return Ht.has(e) && z(t, "action") === "NOTIFY_WEBHOOK";
390
+ function Yt(e, t) {
391
+ return Jt.has(e) && R(t, "action") === "NOTIFY_WEBHOOK";
379
392
  }
380
- function Z(e) {
381
- return z(e, "endpointLabel") ?? z(e, "endpointKey") ?? "外部系統";
393
+ function Xt(e) {
394
+ return R(e, "endpointLabel") ?? R(e, "endpointKey") ?? "外部系統";
382
395
  }
383
- function Q(e) {
396
+ function Zt(e) {
384
397
  return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
385
398
  }
386
- function Ut(e, t) {
399
+ function Qt(e, t) {
387
400
  if (e === "INSTANCE_STARTED") return "案件已發起";
388
401
  if (e === "INSTANCE_CANCELLED") return "案件已取消";
389
402
  if (e === "INSTANCE_EXPIRED") return "案件逾期,已由系統終止";
@@ -393,85 +406,102 @@ function Ut(e, t) {
393
406
  if (e === "TOKEN_ADVANCED") return "流程已前進";
394
407
  if (e === "TASK_CREATED") return "待簽任務已建立";
395
408
  if (e === "TASK_CANDIDATE_ACTIVATED") return "輪到下一位簽核";
396
- if (e === "TASK_DECIDED") return Q(z(t, "action"));
409
+ if (e === "TASK_DECIDED") return Zt(R(t, "action"));
397
410
  if (e === "SLA_TRIGGERED") return "時限提醒已觸發";
398
411
  if (e === "TASK_REASSIGNED") return "管理者改派待辦";
399
- if (X(e, t)) {
400
- let n = Z(t);
412
+ if (Yt(e, t)) {
413
+ let n = Xt(t);
401
414
  return e === "SERVICE_TASK_EXECUTED" ? `已通知外部系統:${n}` : e === "SERVICE_TASK_FAILED" ? `通知外部系統失敗:${n}` : `管理者重新傳送外部系統通知:${n}`;
402
415
  }
403
416
  return e;
404
417
  }
405
- function Wt(e) {
418
+ function $t(e) {
406
419
  try {
407
420
  let t = JSON.parse(e.payloadJson);
408
- return St(t) ? t : {};
421
+ return jt(t) ? t : {};
409
422
  } catch {
410
423
  return {};
411
424
  }
412
425
  }
413
- function Gt(e, t) {
414
- return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && X(e.eventType, t) || z(t, "action") === "REJECTED" || z(t, "instanceState") === "REJECTED";
426
+ function en(e, t) {
427
+ return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && Yt(e.eventType, t) || R(t, "action") === "REJECTED" || R(t, "instanceState") === "REJECTED";
415
428
  }
416
- function Kt(e) {
429
+ function tn(e) {
417
430
  return t(e);
418
431
  }
419
- function qt(e, t, n, r) {
420
- if (e.eventType === "INSTANCE_STARTED") return vt({
432
+ function nn(e, t, n, r) {
433
+ if (e.eventType === "INSTANCE_STARTED") return Dt({
421
434
  initiatorMemberId: e.actorMemberId,
422
- submittedByMemberId: z(t, "submittedByMemberId")
435
+ submittedByMemberId: R(t, "submittedByMemberId")
423
436
  }, r);
424
437
  if (e.eventType === "TASK_CANDIDATE_ACTIVATED") {
425
- let e = z(t, "candidateMemberId"), n = z(t, "previousMemberId");
438
+ let e = R(t, "candidateMemberId"), n = R(t, "previousMemberId");
426
439
  if (!e) return null;
427
440
  let i = W(e, r);
428
441
  return n ? `輪到:${i}(前一位:${W(n, r)})` : `輪到:${i}`;
429
442
  }
430
443
  if (e.eventType === "TASK_CREATED") {
431
- let e = B(t, "sequentialCandidateMemberIds");
444
+ let e = At(t, "sequentialCandidateMemberIds");
432
445
  if (e.length) return `簽核順序:${e.map((e) => W(e, r)).join(" → ")}`;
433
- let n = z(t, "assigneeMemberId"), i = z(t, "originalAssigneeMemberId");
446
+ let n = R(t, "assigneeMemberId"), i = R(t, "originalAssigneeMemberId");
434
447
  if (!n) {
435
- let e = B(t, "candidateMemberIds");
448
+ let e = At(t, "candidateMemberIds");
436
449
  return e.length ? `候選簽核人:${e.map((e) => W(e, r)).join("、")}` : null;
437
450
  }
438
451
  let a = W(n, r), o = W(i, r);
439
452
  return i && i !== n ? `待簽人:${a}(原簽核人:${o})` : `待簽人:${a}`;
440
453
  }
441
454
  if (e.eventType === "TASK_DECIDED") {
442
- let e = z(t, "action"), n = z(t, "comment"), i = e ? `決議:${Dt(e)}` : null, a = z(t, "transferToMemberId");
443
- return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(V).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(V).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${W(a, r)}`].filter(V).join(" · ") : i;
455
+ let e = R(t, "action"), n = R(t, "comment"), i = e ? `決議:${Ft(e)}` : null, a = R(t, "transferToMemberId");
456
+ return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(B).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(B).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${W(a, r)}`].filter(B).join(" · ") : i;
444
457
  }
445
458
  if (e.eventType === "TOKEN_ADVANCED") {
446
- let e = z(t, "action");
447
- if (e) return `流程結果:${Dt(e)}`;
448
- let r = xt(t, "arrivedCount"), i = xt(t, "requiredCount");
459
+ let e = R(t, "action");
460
+ if (e) return `流程結果:${Ft(e)}`;
461
+ let r = z(t, "arrivedCount"), i = z(t, "requiredCount");
449
462
  if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
450
- let a = z(t, "fromNodeId"), o = z(t, "toNodeId");
451
- if (a && o) return `由 ${kt(a, n)} 前進至 ${kt(o, n)}`;
463
+ let a = R(t, "fromNodeId"), o = R(t, "toNodeId");
464
+ if (a && o) return `由 ${Lt(a, n)} 前進至 ${Lt(o, n)}`;
452
465
  }
453
466
  if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
454
- let e = z(t, "state");
455
- return e ? `案件狀態:${Et(e)}` : null;
467
+ let e = R(t, "state");
468
+ return e ? `案件狀態:${Pt(e)}` : null;
456
469
  }
457
470
  return null;
458
471
  }
459
- function Jt(e, t, n, r, i, a, o, s = null) {
460
- if (e.eventType === "INSTANCE_RESUBMITTED") return [J("簽核意見", z(t, "comment"))].filter(Y);
461
- if (e.eventType !== "TASK_DECIDED") return [q(qt(e, t, n, o))].filter(Y);
462
- let c = e.taskId ? r.get(e.taskId) : null, l = z(t, "action") ?? c?.action ?? null, u = z(t, "comment") ?? c?.comment ?? null, d = z(t, "transferToMemberId") ?? c?.transferToMemberId ?? null, f = z(t, "signatureId") ?? c?.signatureId ?? null, p = f ? i.get(f) : null;
472
+ function rn(e, t, n, r, i, a, o, s = null, c = null) {
473
+ if (e.eventType === "INSTANCE_RESUBMITTED") return [q("簽核意見", R(t, "comment"))].filter(J);
474
+ if (e.eventType !== "TASK_DECIDED") return [K(nn(e, t, n, o))].filter(J);
475
+ let l = an(e, t, r, c), u = R(t, "action") ?? l?.action ?? null, d = R(t, "comment") ?? l?.comment ?? null, f = R(t, "transferToMemberId") ?? l?.transferToMemberId ?? null, p = R(t, "signatureId") ?? l?.signatureId ?? null, m = p ? i.get(p) : null;
463
476
  return [
464
- q(l ? `決議:${Dt(l)}` : null),
465
- l === "REJECTED" ? J("拒絕原因", u ?? "-", "danger") : null,
466
- l === "APPROVED" ? J("同意說明", u) : null,
467
- l === "RETURNED" ? J("退回說明", u ?? "-") : null,
468
- l === "TRANSFERRED" ? q(`轉派給:${W(d, o)}`) : null,
469
- l === "TRANSFERRED" ? J("轉派說明", u ?? "-") : null,
470
- q(Yt(t, s)),
471
- p ? q(a?.valid ? `簽章:已驗證(${Tt(p.signedPayloadHash)})` : `簽章:待檢查(${Tt(p.signedPayloadHash)})`) : null
472
- ].filter(Y);
477
+ K(u ? `決議:${Ft(u)}` : null),
478
+ u === "REJECTED" ? q("拒絕原因", d ?? "-", "danger") : null,
479
+ u === "APPROVED" ? q("同意說明", d) : null,
480
+ u === "RETURNED" ? q("退回說明", d ?? "-") : null,
481
+ u === "TRANSFERRED" ? K(`轉派給:${W(f, o)}`) : null,
482
+ u === "TRANSFERRED" ? q("轉派說明", d ?? "-") : null,
483
+ K(sn(t, s)),
484
+ m ? K(a?.valid ? `簽章:已驗證(${H(m.signedPayloadHash)})` : `簽章:待檢查(${H(m.signedPayloadHash)})`) : null
485
+ ].filter(J);
486
+ }
487
+ function an(e, t, n, r) {
488
+ let i = e.taskId;
489
+ if (!i) return null;
490
+ let a = R(t, "decisionId"), o = (t) => a ? t.id === a : t.decidedByMemberId === e.actorMemberId;
491
+ if (!r) {
492
+ let e = n.get(i) ?? null;
493
+ return e && o(e) ? e : null;
494
+ }
495
+ return on(r.filter((e) => e.taskId === i && o(e)), new Date(e.createdAt).getTime());
473
496
  }
474
- function Yt(e, t) {
497
+ function on(e, t) {
498
+ let n = (e) => Math.abs(u(e) - t), r = (e, t) => {
499
+ let r = n(e) - n(t);
500
+ return r < 0 || !(r > 0) && d(e, t) < 0;
501
+ };
502
+ return e.reduce((e, t) => !e || r(t, e) ? t : e, null);
503
+ }
504
+ function sn(e, t) {
475
505
  let n = e.changedFieldKeys;
476
506
  if (!Array.isArray(n)) return null;
477
507
  let r = n.filter((e) => typeof e == "string" && e !== "");
@@ -479,94 +509,94 @@ function Yt(e, t) {
479
509
  let i = r.map((e) => t?.fields.find((t) => t.fieldKey === e)?.label || e);
480
510
  return `補填 ${r.length} 個欄位:${i.join("、")}`;
481
511
  }
482
- function Xt(e, t, n, r, i) {
512
+ function cn(e, t, n, r, i) {
483
513
  if (e.type === "startEvent" || i.has(e.id)) return !1;
484
514
  if (r === "REJECTED") return !0;
485
- let a = sn(e, t, n, r);
515
+ let a = _n(e, t, n, r);
486
516
  return a.tone === "neutral" || a.tone === "waiting";
487
517
  }
488
- function Zt(e, t, n, r, i) {
518
+ function ln(e, t, n, r, i) {
489
519
  if (r !== "RUNNING" && r !== "REJECTED") return [];
490
- let a = e.nodes.filter((e) => Xt(e, t, n, r, i)), o = Qt(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
520
+ let a = e.nodes.filter((e) => cn(e, t, n, r, i)), o = Q(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
491
521
  return a.filter((e) => o.has(e.id)).sort((e, t) => {
492
522
  let n = o.get(e.id) ?? 0, r = o.get(t.id) ?? 0;
493
523
  return n === r ? e.position.x === t.position.x ? e.position.y === t.position.y ? (s.get(e.id) ?? 0) - (s.get(t.id) ?? 0) : e.position.y - t.position.y : e.position.x - t.position.x : n - r;
494
524
  });
495
525
  }
496
- function Qt(e, t, n, r, i) {
526
+ function Q(e, t, n, r, i) {
497
527
  let a = new Set(t.map((e) => e.id)), o = e.edges.reduce((e, t) => {
498
528
  let n = [...e.get(t.source) ?? [], t.target];
499
529
  return new Map(e).set(t.source, n);
500
530
  }, /* @__PURE__ */ new Map());
501
- return $t(e, n, r, i).reduce((e, t) => nn(e, en(t, o, a)), /* @__PURE__ */ new Map());
531
+ return un(e, n, r, i).reduce((e, t) => pn(e, dn(t, o, a)), /* @__PURE__ */ new Map());
502
532
  }
503
- function $t(e, t, n, r) {
504
- let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(Ct).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
533
+ function un(e, t, n, r) {
534
+ let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(Mt).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
505
535
  ...i,
506
536
  ...a,
507
537
  ...o
508
538
  ])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
509
539
  return s.length > 0 ? s : c;
510
540
  }
511
- function en(e, t, n) {
512
- return tn([{
541
+ function dn(e, t, n) {
542
+ return fn([{
513
543
  distance: 0,
514
544
  nodeId: e
515
545
  }], t, n);
516
546
  }
517
- function tn(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
547
+ function fn(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
518
548
  let [a, ...o] = e;
519
549
  if (!a) return i;
520
- if (r.has(a.nodeId)) return tn(o, t, n, r, i);
550
+ if (r.has(a.nodeId)) return fn(o, t, n, r, i);
521
551
  let s = new Set(r).add(a.nodeId), c = n.has(a.nodeId) ? new Map(i).set(a.nodeId, Math.min(i.get(a.nodeId) ?? a.distance, a.distance)) : i;
522
- return tn([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
552
+ return fn([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
523
553
  distance: a.distance + 1,
524
554
  nodeId: e
525
555
  }))], t, n, s, c);
526
556
  }
527
- function nn(e, t) {
557
+ function pn(e, t) {
528
558
  return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
529
559
  }
530
- function rn(e) {
560
+ function mn(e) {
531
561
  return e.type === "userTask" ? `未來簽核:${e.data.label}` : e.type === "serviceTask" ? `未來知會:${e.data.label}` : e.type === "exclusiveGateway" ? `未來分流:${e.data.label}` : e.type === "parallelGateway" ? `未來匯合:${e.data.label}` : e.type === "endEvent" ? `流程完成:${e.data.label}` : `未來節點:${e.data.label}`;
532
562
  }
533
- function an(e, t, n, r, i, a, o, s, c, l = null) {
534
- let u = e.filter(zt).map((e) => {
535
- let t = Wt(e), n = e.nodeId ? kt(e.nodeId, r) : null;
563
+ function hn(e, t, n, r, i, a, o, s, l, u = null, d = null) {
564
+ let f = d ? c(d) : null, p = e.filter(X).map((e) => {
565
+ let t = $t(e), n = e.nodeId ? Lt(e.nodeId, r) : null;
536
566
  return {
537
567
  descriptionParts: [
538
- q(n ? `節點:${n}` : "節點:全流程"),
539
- Lt("操作者", e.actorMemberId, a, "系統"),
540
- q(`時間:${Kt(e.createdAt)}`),
541
- ...Jt(e, t, r, o, s, c, a, l)
542
- ].filter(Y),
543
- error: Gt(e, t),
568
+ K(n ? `節點:${n}` : "節點:全流程"),
569
+ Kt("操作者", e.actorMemberId, a, "系統"),
570
+ K(`時間:${tn(e.createdAt)}`),
571
+ ...rn(e, t, r, o, s, l, a, u, f ? f.get(e.taskId ?? "") ?? [] : null)
572
+ ].filter(J),
573
+ error: en(e, t),
544
574
  id: e.id,
545
- title: Ut(e.eventType, t)
575
+ title: Qt(e.eventType, t)
546
576
  };
547
- }), d = t.filter(Ct).map((e) => ({
577
+ }), m = t.filter(Mt).map((e) => ({
548
578
  descriptionParts: [
549
- q(`節點:${kt(e.nodeId, r)}`),
550
- Lt("處理者", e.assigneeMemberId, a, "未指定"),
551
- q(`建立時間:${Kt(e.createdAt)}`)
552
- ].filter(Y),
579
+ K(`節點:${Lt(e.nodeId, r)}`),
580
+ Kt("處理者", e.assigneeMemberId, a, "未指定"),
581
+ K(`建立時間:${tn(e.createdAt)}`)
582
+ ].filter(J),
553
583
  error: !1,
554
584
  id: `pending-task-${e.id}`,
555
585
  title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
556
- })), f = new Set([...e.filter(zt).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(V)), p = r ? Zt(r, t, n, i, f).map((e) => ({
557
- descriptionParts: [q(`${Ot(e.type)} · 尚未抵達`)].filter(Y),
586
+ })), h = new Set([...e.filter(X).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(B)), g = r ? ln(r, t, n, i, h).map((e) => ({
587
+ descriptionParts: [K(`${It(e.type)} · 尚未抵達`)].filter(J),
558
588
  error: !1,
559
589
  forcePending: !0,
560
590
  id: `future-node-${e.id}`,
561
- title: rn(e)
591
+ title: mn(e)
562
592
  })) : [];
563
593
  return [
564
- ...u,
565
- ...d,
566
- ...p
594
+ ...p,
595
+ ...m,
596
+ ...g
567
597
  ];
568
598
  }
569
- var on = {
599
+ var gn = {
570
600
  APPROVED: {
571
601
  statusLabel: "已完成",
572
602
  tone: "completed"
@@ -584,20 +614,20 @@ var on = {
584
614
  tone: "cancelled"
585
615
  }
586
616
  };
587
- function sn(e, t, n, r) {
617
+ function _n(e, t, n, r) {
588
618
  let i = t.filter((t) => t.nodeId === e.id), a = i.find((e) => e.status === "PENDING" || e.status === "IN_PROGRESS"), o = i.find((e) => e.status === "CANCELLED"), s = i.find((e) => e.status === "COMPLETED"), c = n.filter((t) => t.currentNodeId === e.id), l = c.find((e) => e.status === "ACTIVE"), u = c.find((e) => e.status === "WAITING");
589
619
  if (a) return {
590
- secondaryLabel: `處理者 ${At(a)}`,
620
+ secondaryLabel: `處理者 ${Rt(a)}`,
591
621
  statusLabel: "待處理",
592
622
  tone: "current"
593
623
  };
594
624
  if (o) return {
595
- secondaryLabel: `已取消 ${At(o)}`,
625
+ secondaryLabel: `已取消 ${Rt(o)}`,
596
626
  statusLabel: "已取消",
597
627
  tone: "cancelled"
598
628
  };
599
629
  if (s) return {
600
- secondaryLabel: `已完成 ${At(s)}`,
630
+ secondaryLabel: `已完成 ${Rt(s)}`,
601
631
  statusLabel: "已完成",
602
632
  tone: "completed"
603
633
  };
@@ -616,64 +646,56 @@ function sn(e, t, n, r) {
616
646
  statusLabel: "已發起",
617
647
  tone: "completed"
618
648
  };
619
- let d = e.type === "endEvent" ? on[r] : void 0;
649
+ let d = e.type === "endEvent" ? gn[r] : void 0;
620
650
  return d ? {
621
651
  ...d,
622
652
  secondaryLabel: r
623
653
  } : {
624
- secondaryLabel: Ot(e.type),
654
+ secondaryLabel: It(e.type),
625
655
  statusLabel: "未抵達",
626
656
  tone: "neutral"
627
657
  };
628
658
  }
629
- //#endregion
630
- //#region src/views/instances/detail/sections/container-helpers.ts
631
- async function cn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks: r }) {
659
+ // src/views/instances/detail/sections/container-helpers.ts
660
+ async function vn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks: r }) {
632
661
  let i = [...new Set([
633
662
  n?.initiatorMemberId ?? null,
634
663
  n?.submittedByMemberId ?? null,
635
664
  ...e.map((e) => e.actorMemberId),
636
- ...e.flatMap(Vt),
665
+ ...e.flatMap(qt),
637
666
  ...r.map((e) => e.assigneeMemberId),
638
667
  ...r.map((e) => e.originalAssigneeMemberId),
639
668
  ...r.flatMap((e) => e.candidateMemberIds),
640
- ...r.flatMap((e) => bt(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
641
- ...t.flatMap((e) => [e.createdByMemberId, ...ln(e.targetValueJson)])
642
- ].filter(V))];
669
+ ...r.flatMap((e) => kt(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
670
+ ...t.flatMap((e) => [e.createdByMemberId, ...$(e.targetValueJson)])
671
+ ].filter(B))];
643
672
  try {
644
- return await Ne(i);
673
+ return await Re(i);
645
674
  } catch {
646
675
  return [];
647
676
  }
648
677
  }
649
- function ln(e) {
678
+ function $(e) {
650
679
  try {
651
680
  return (JSON.parse(e).memberIds ?? []).filter((e) => typeof e == "string");
652
681
  } catch {
653
682
  return [];
654
683
  }
655
684
  }
656
- async function un(e) {
657
- return (await Promise.all(e.map((e) => O(e.id)))).flat();
685
+ async function yn(e) {
686
+ return (await Promise.all(e.map((e) => k(e.id)))).flat();
658
687
  }
659
- function dn(e) {
660
- return e.reduce((e, t) => {
661
- let n = e.get(t.taskId), r = !n || new Date(t.decidedAt).getTime() > new Date(n.decidedAt).getTime() ? t : n;
662
- return new Map(e).set(t.taskId, r);
663
- }, /* @__PURE__ */ new Map());
664
- }
665
- //#endregion
666
- //#region src/views/instances/detail/use-resubmit-comment-draft.ts
667
- function fn(e) {
668
- let [t, n] = y({
688
+ // src/views/instances/detail/use-resubmit-comment-draft.ts
689
+ function bn(e) {
690
+ let [t, n] = x({
669
691
  instanceId: e,
670
692
  text: ""
671
- }), r = h((t) => n({
693
+ }), r = oe((t) => n({
672
694
  instanceId: e,
673
695
  text: t
674
696
  }), [e]);
675
697
  return {
676
- clearAfterResubmit: h((e) => n((t) => t.instanceId === e ? {
698
+ clearAfterResubmit: oe((e) => n((t) => t.instanceId === e ? {
677
699
  instanceId: e,
678
700
  text: ""
679
701
  } : t), []),
@@ -681,52 +703,51 @@ function fn(e) {
681
703
  setComment: r
682
704
  };
683
705
  }
684
- //#endregion
685
- //#region src/views/instances/detail/sections/InstanceFormSection.tsx
686
- var pn = {
706
+ // src/views/instances/detail/sections/InstanceFormSection.tsx
707
+ var xn = {
687
708
  display: "grid",
688
709
  gap: 16
689
- }, mn = {
710
+ }, Sn = {
690
711
  display: "flex",
691
712
  flexWrap: "wrap",
692
713
  gap: 8
693
- }, hn = 2e3, gn = {
714
+ }, Cn = 2e3, wn = {
694
715
  minWidth: "100%",
695
716
  width: "100%"
696
717
  };
697
- function _n(e) {
718
+ function Tn(e) {
698
719
  e && (e.style.width = "100%");
699
720
  }
700
- function vn({ canResubmitInstance: e, deciding: t, error: r, fieldAccess: i, fieldLabelMarkers: a, fill: o = null, instance: s, loading: c, onDataSourceStateChange: l, onResubmitFormChange: d, onReloadAfterConflict: f = null, onResubmitCommentChange: p = null, onResubmitInstance: ee, onUploadAttachment: te, resubmitComment: m = "", resubmitFormData: re, resubmitFormErrors: ie }) {
701
- let h = s?.formDefinitionSnapshot.schema, g = s?.workflowSnapshot, ae = _(() => e && h && g ? u(h, g) : o?.schema ?? h, [
702
- e,
703
- o?.schema,
704
- h,
705
- g
706
- ]), v = !e && o !== null;
707
- return /* @__PURE__ */ D("div", {
708
- style: pn,
721
+ function En({ canResubmitInstance: t, deciding: n, error: r, fieldAccess: i, fieldLabelMarkers: a, fill: s = null, instance: c, loading: l, onDataSourceStateChange: u, onResubmitFormChange: d, onReloadAfterConflict: f = null, onResubmitCommentChange: p = null, onResubmitInstance: m, onUploadAttachment: h, resubmitComment: g = "", resubmitFormData: ee, resubmitFormErrors: ne }) {
722
+ let _ = c?.formDefinitionSnapshot.schema, re = c?.workflowSnapshot, ie = b(() => t && _ && re ? te(_, re) : s?.schema ?? _, [
723
+ t,
724
+ s?.schema,
725
+ _,
726
+ re
727
+ ]), v = !t && s !== null;
728
+ return /* @__PURE__ */ O("div", {
729
+ style: xn,
709
730
  children: [
710
- r ? /* @__PURE__ */ E(T, {
731
+ r ? /* @__PURE__ */ D(E, {
711
732
  color: "text-error",
712
733
  variant: "body",
713
734
  children: r
714
735
  }) : null,
715
- c ? /* @__PURE__ */ E(T, {
736
+ l ? /* @__PURE__ */ D(E, {
716
737
  color: "text-neutral",
717
738
  variant: "body",
718
739
  children: "載入中..."
719
740
  }) : null,
720
- f ? /* @__PURE__ */ D("div", {
721
- style: pn,
722
- children: [/* @__PURE__ */ E(S, {
741
+ f ? /* @__PURE__ */ O("div", {
742
+ style: xn,
743
+ children: [/* @__PURE__ */ D(w, {
723
744
  content: "表單在你填寫期間被更新了,你填的內容還在。請重新載入後確認再同意。",
724
745
  severity: "error"
725
- }), /* @__PURE__ */ E("div", {
726
- style: mn,
727
- children: /* @__PURE__ */ E(b, {
728
- disabled: c,
729
- icon: Ke,
746
+ }), /* @__PURE__ */ D("div", {
747
+ style: Sn,
748
+ children: /* @__PURE__ */ D(S, {
749
+ disabled: l,
750
+ icon: Ze,
730
751
  iconType: "leading",
731
752
  onClick: f,
732
753
  variant: "base-secondary",
@@ -734,58 +755,58 @@ function vn({ canResubmitInstance: e, deciding: t, error: r, fieldAccess: i, fie
734
755
  })
735
756
  })]
736
757
  }) : null,
737
- v && o.fieldCount > 0 ? /* @__PURE__ */ E(S, {
738
- content: `本關需要你補填 ${o.fieldCount} 個欄位,按「同意」時會一起送出並納入簽章。`,
758
+ v && s.fieldCount > 0 ? /* @__PURE__ */ D(w, {
759
+ content: `本關需要你補填 ${s.fieldCount} 個欄位,按「同意」時會一起送出並納入簽章。`,
739
760
  severity: "info"
740
761
  }) : null,
741
- ae && s?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ D(ve, { children: [
742
- /* @__PURE__ */ E(ne, {
743
- dataSourceContext: e ? {
744
- instanceId: s.id,
762
+ ie && c?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ O(Ce, { children: [
763
+ /* @__PURE__ */ D(o, {
764
+ dataSourceContext: t ? {
765
+ instanceId: c.id,
745
766
  kind: "runtime"
746
767
  } : void 0,
747
- dataSourceInitialValues: s.formData,
748
- errors: v ? o.errors : ie,
749
- ...!e && i ? { fieldAccess: i } : {},
750
- ...!e && a ? { fieldLabelMarkers: a } : {},
768
+ dataSourceInitialValues: c.formData,
769
+ errors: v ? s.errors : ne,
770
+ ...!t && i ? { fieldAccess: i } : {},
771
+ ...!t && a ? { fieldLabelMarkers: a } : {},
751
772
  onChange: (e) => {
752
- v ? o.onChange(e) : d(e);
773
+ v ? s.onChange(e) : d(e);
753
774
  },
754
- onDataSourceStateChange: l,
755
- onUploadAttachment: e ? te : void 0,
756
- optionSnapshots: s.formDataOptionSnapshot,
757
- readonly: !e,
758
- schema: ae,
759
- uiSchema: s.formDefinitionSnapshot.uiSchema,
760
- value: e ? re : v ? o.value : s.formData
775
+ onDataSourceStateChange: u,
776
+ onUploadAttachment: t ? h : void 0,
777
+ optionSnapshots: c.formDataOptionSnapshot,
778
+ readonly: !t,
779
+ schema: ie,
780
+ uiSchema: c.formDefinitionSnapshot.uiSchema,
781
+ value: t ? ee : v ? s.value : c.formData
761
782
  }),
762
- e && p ? /* @__PURE__ */ E(n, {
783
+ t && p ? /* @__PURE__ */ D(e, {
763
784
  label: "簽核意見",
764
785
  name: "resubmitComment",
765
- children: /* @__PURE__ */ E(ge, {
766
- disabled: t,
786
+ children: /* @__PURE__ */ D(xe, {
787
+ disabled: n,
767
788
  onChange: (e) => p(e.target.value),
768
789
  placeholder: "選填,例如說明這次補正或修改了哪些內容",
769
- maxLength: hn,
770
- ref: _n,
790
+ maxLength: Cn,
791
+ ref: Tn,
771
792
  resize: "vertical",
772
793
  rows: 4,
773
- style: gn,
774
- value: m
794
+ style: wn,
795
+ value: g
775
796
  })
776
797
  }) : null,
777
- e ? /* @__PURE__ */ E("div", {
778
- style: mn,
779
- children: /* @__PURE__ */ E(b, {
780
- disabled: t,
781
- icon: Ke,
798
+ t ? /* @__PURE__ */ D("div", {
799
+ style: Sn,
800
+ children: /* @__PURE__ */ D(S, {
801
+ disabled: n,
802
+ icon: Ze,
782
803
  iconType: "leading",
783
- onClick: ee,
804
+ onClick: m,
784
805
  variant: "base-primary",
785
806
  children: "重新送出"
786
807
  })
787
808
  }) : null
788
- ] }) : /* @__PURE__ */ E(T, {
809
+ ] }) : /* @__PURE__ */ D(E, {
789
810
  color: "text-neutral",
790
811
  variant: "body",
791
812
  children: "此案件沒有可顯示的表單快照。"
@@ -793,22 +814,21 @@ function vn({ canResubmitInstance: e, deciding: t, error: r, fieldAccess: i, fie
793
814
  ]
794
815
  });
795
816
  }
796
- //#endregion
797
- //#region src/views/instances/detail/sections/InstanceAttachmentsSection.tsx
798
- var $ = {
817
+ // src/views/instances/detail/sections/InstanceAttachmentsSection.tsx
818
+ var Dn = {
799
819
  display: "grid",
800
820
  gap: 16
801
821
  };
802
- function yn({ attachments: e, onDownload: n, onPreview: r }) {
803
- let i = _(() => e.map((e) => ({
822
+ function On({ attachments: e, onDownload: n, onPreview: r }) {
823
+ let i = b(() => e.map((e) => ({
804
824
  attachment: e,
805
825
  createdAt: e.createdAt,
806
826
  filename: e.filename,
807
827
  id: e.id,
808
828
  key: e.id,
809
829
  mimeType: e.mimeType,
810
- sizeLabel: wt(Number(e.sizeBytes))
811
- })), [e]), a = _(() => [
830
+ sizeLabel: Nt(Number(e.sizeBytes))
831
+ })), [e]), a = b(() => [
812
832
  {
813
833
  dataIndex: "filename",
814
834
  key: "filename",
@@ -829,7 +849,7 @@ function yn({ attachments: e, onDownload: n, onPreview: r }) {
829
849
  },
830
850
  {
831
851
  key: "createdAt",
832
- render: (e) => /* @__PURE__ */ E(T, {
852
+ render: (e) => /* @__PURE__ */ D(E, {
833
853
  component: "span",
834
854
  variant: "body",
835
855
  children: t(e.createdAt)
@@ -837,16 +857,16 @@ function yn({ attachments: e, onDownload: n, onPreview: r }) {
837
857
  title: "上傳時間",
838
858
  width: 220
839
859
  }
840
- ], []), o = _(() => ({
860
+ ], []), o = b(() => ({
841
861
  render: (e) => [...e.mimeType === "application/pdf" ? [{
842
- icon: Ue,
862
+ icon: Je,
843
863
  iconType: "leading",
844
864
  name: "預覽",
845
865
  onClick: () => {
846
866
  r(e.attachment);
847
867
  }
848
868
  }] : [], {
849
- icon: He,
869
+ icon: A,
850
870
  iconType: "leading",
851
871
  name: "下載",
852
872
  onClick: () => {
@@ -856,83 +876,82 @@ function yn({ attachments: e, onDownload: n, onPreview: r }) {
856
876
  variant: "base-secondary",
857
877
  width: 160
858
878
  }), [n, r]);
859
- return /* @__PURE__ */ D("div", {
860
- style: $,
861
- children: [/* @__PURE__ */ E(T, {
879
+ return /* @__PURE__ */ O("div", {
880
+ style: Dn,
881
+ children: [/* @__PURE__ */ D(E, {
862
882
  component: "h2",
863
883
  variant: "h3",
864
884
  children: "附件"
865
- }), i.length > 0 ? /* @__PURE__ */ E(he, {
885
+ }), i.length > 0 ? /* @__PURE__ */ D(be, {
866
886
  actions: o,
867
887
  columns: a,
868
888
  dataSource: i,
869
889
  fullWidth: !0
870
- }) : /* @__PURE__ */ E(T, {
890
+ }) : /* @__PURE__ */ D(E, {
871
891
  color: "text-neutral",
872
892
  variant: "body",
873
893
  children: "此案件沒有附件。"
874
894
  })]
875
895
  });
876
896
  }
877
- //#endregion
878
- //#region src/views/instances/detail/sections/InstanceTasksSection.tsx
879
- var bn = {
897
+ // src/views/instances/detail/sections/InstanceTasksSection.tsx
898
+ var kn = {
880
899
  display: "grid",
881
900
  gap: 12,
882
901
  width: "100%"
883
- }, xn = {
902
+ }, An = {
884
903
  minWidth: "100%",
885
904
  width: "100%"
886
- }, Sn = {
905
+ }, jn = {
887
906
  display: "grid",
888
907
  gap: 12,
889
908
  width: "100%"
890
- }, Cn = { marginTop: 12 }, wn = { marginTop: 24 };
891
- function Tn(e) {
909
+ }, Mn = { marginTop: 12 }, Nn = { marginTop: 24 };
910
+ function Pn(e) {
892
911
  e && (e.style.width = "100%");
893
912
  }
894
- var En = {
913
+ var Fn = {
895
914
  COMPLETION_NOTIFY: "結案通知",
896
915
  COUNTERSIGN: "臨時會簽",
897
916
  PRE_APPROVAL: "臨時加簽",
898
917
  STAGE_NOTIFY: "階段完成通知"
899
- }, Dn = {
918
+ }, In = {
900
919
  COMPLETION_NOTIFY: "本張單到達結案狀態(核准 / 拒絕 / 取消)後,通知指定對象。",
901
920
  COUNTERSIGN: "指定對象會併入下一層簽核,下一層需所有人都完成才會繼續。",
902
921
  PRE_APPROVAL: "指定對象需先完成加簽,本階段才會往下一層繼續。",
903
922
  STAGE_NOTIFY: "本階段完成後(不論通過與否)通知指定對象。"
904
- }, On = [{
923
+ }, Ln = [{
905
924
  id: "REJECT_INSTANCE",
906
925
  name: "加簽拒絕時整單駁回"
907
926
  }, {
908
927
  id: "RETURN_TO_ORIGIN",
909
928
  name: "加簽拒絕時退回給我重新處理"
910
- }], kn = [{
929
+ }], Rn = [{
911
930
  id: "MEMBER",
912
931
  name: "指定成員"
913
932
  }, {
914
933
  id: "WEBHOOK",
915
934
  name: "Webhook"
916
- }], An = ie(function({ adhocDirectives: e, currentMemberId: r, fill: i = null, instance: o, memberProfilesById: s, onChanged: c, onDecidingChange: l, onFillApproveError: u, tasks: d }, f) {
917
- let [p, ee] = y(!1), [te, m] = y(null);
918
- g(() => {
919
- l?.(p);
920
- }, [p, l]);
921
- let [ne, re] = y(""), [ie, h] = y(!1), [v, S] = y(""), [ue, de] = y(null), [fe, pe] = y(!1), [me, _e] = y(""), [be, we] = y(!1), [Te, O] = y(null), [Ee, De] = y(""), [Oe, ke] = y(null), [Ae, Ne] = y(!1), [Pe, Fe] = y([]), [Ie, Le] = y(!1), [Re, ze] = y(""), [Be, Ve] = y([]), [He, Ue] = y(!1), [We, Ge] = y([]), [Ke, qe] = y(!1), [A, Je] = y("COUNTERSIGN"), [Ye, j] = y("REJECT_INSTANCE"), [Xe, Ze] = y(!1), [Qe, $e] = y("MEMBER"), [et, tt] = y(""), M = v.trim(), nt = me.trim(), rt = Ee.trim(), N = _(() => jt(d, r), [r, d]), P = _(() => N && o ? o.workflowSnapshot.nodes.find((e) => e.id === N.nodeId) ?? null : null, [N, o]), F = _(() => P && o ? K(o.workflowSnapshot, P) : [], [P, o]), it = P?.type === "userTask" && P.data.returnBehavior.allowReturn, at = P?.type === "userTask" && P.data.allowReject !== !1, ot = P?.type === "userTask" && P.data.allowTransfer !== !1, st = P?.type === "userTask" && P.data.returnBehavior.requireComment === !0, ct = P?.type === "userTask" && P.data.allowAddSigner, I = _(() => e.filter((e) => e.status === "PENDING"), [e]), L = F.find((e) => e.id === Te) ?? F[0] ?? null, lt = _(() => d.map((e) => ({
935
+ }], zn = y(function({ adhocDirectives: n, currentMemberId: r, fill: i = null, instance: a, memberProfilesById: o, onChanged: s, onDecidingChange: c, onFillApproveError: u, tasks: d }, f) {
936
+ let [p, m] = x(!1), [h, g] = x(null);
937
+ se(() => {
938
+ c?.(p);
939
+ }, [p, c]);
940
+ let [ee, te] = x(""), [ne, _] = x(!1), [re, ie] = x(""), [v, ae] = x(null), [y, oe] = x(!1), [le, w] = x(""), [me, he] = x(!1), [ge, _e] = x(null), [ye, Se] = x(""), [Te, ke] = x(null), [Ae, k] = x(!1), [je, Me] = x([]), [Ne, Pe] = x(!1), [Fe, Re] = x(""), [ze, Be] = x([]), [He, Ue] = x(!1), [We, Ge] = x([]), [Ke, qe] = x(!1), [A, Je] = x("COUNTERSIGN"), [Ye, Xe] = x("REJECT_INSTANCE"), [Ze, Qe] = x(!1), [$e, et] = x("MEMBER"), [tt, j] = x(""), nt = re.trim(), rt = le.trim(), it = ye.trim(), M = b(() => Bt(d, r), [r, d]), N = b(() => M && a ? a.workflowSnapshot.nodes.find((e) => e.id === M.nodeId) ?? null : null, [M, a]), at = b(() => N && a ? Vt(a.workflowSnapshot, N) : [], [N, a]), ot = N?.type === "userTask" && N.data.returnBehavior.allowReturn, st = N?.type === "userTask" && N.data.allowReject !== !1, ct = N?.type === "userTask" && N.data.allowTransfer !== !1, lt = N?.type === "userTask" && N.data.returnBehavior.requireComment === !0, ut = N?.type === "userTask" && N.data.allowAddSigner, dt = b(() => n.filter((e) => e.status === "PENDING"), [n]), P = at.find((e) => e.id === ge) ?? at[0] ?? null, ft = b(() => d.map((e) => ({
922
941
  ...e,
923
- assigneeLabel: At(e, s),
924
- fillFieldCount: Mn(e, o?.workflowSnapshot ?? null),
942
+ assigneeLabel: Rt(e, o),
943
+ fillFieldCount: Vn(e, a?.workflowSnapshot ?? null),
925
944
  key: e.id,
926
- nodeLabel: a({
945
+ nodeLabel: l({
927
946
  ...e,
928
- nodeLabel: kt(e.nodeId, o?.workflowSnapshot ?? null)
947
+ nodeLabel: Lt(e.nodeId, a?.workflowSnapshot ?? null)
929
948
  }),
930
949
  statusLabel: U(e.status)
931
950
  })), [
951
+ a,
932
952
  o,
933
- s,
934
953
  d
935
- ]), ut = _(() => [
954
+ ]), pt = b(() => [
936
955
  {
937
956
  dataIndex: "nodeLabel",
938
957
  key: "nodeLabel",
@@ -942,7 +961,7 @@ var En = {
942
961
  {
943
962
  key: "assigneeMemberId",
944
963
  title: "處理者",
945
- render: (e) => /* @__PURE__ */ E(T, {
964
+ render: (e) => /* @__PURE__ */ D(E, {
946
965
  component: "span",
947
966
  variant: "body",
948
967
  children: e.assigneeLabel
@@ -957,7 +976,7 @@ var En = {
957
976
  },
958
977
  {
959
978
  key: "fill",
960
- render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ E(se, {
979
+ render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ D(de, {
961
980
  size: "sub",
962
981
  text: `需補填 ${e.fillFieldCount} 欄`,
963
982
  variant: "dot-warning"
@@ -967,7 +986,7 @@ var En = {
967
986
  },
968
987
  {
969
988
  key: "createdAt",
970
- render: (e) => /* @__PURE__ */ E(T, {
989
+ render: (e) => /* @__PURE__ */ D(E, {
971
990
  component: "span",
972
991
  variant: "body",
973
992
  children: t(e.createdAt)
@@ -975,13 +994,13 @@ var En = {
975
994
  title: "建立時間",
976
995
  width: 220
977
996
  }
978
- ], []), dt = _(() => I.map((e) => ({
997
+ ], []), mt = b(() => dt.map((e) => ({
979
998
  ...e,
980
- createdByLabel: W(e.createdByMemberId, s),
999
+ createdByLabel: W(e.createdByMemberId, o),
981
1000
  key: e.id,
982
- targetLabel: jn(e, s),
983
- typeLabel: En[e.type]
984
- })), [s, I]), ft = _(() => [
1001
+ targetLabel: Bn(e, o),
1002
+ typeLabel: Fn[e.type]
1003
+ })), [o, dt]), ht = b(() => [
985
1004
  {
986
1005
  dataIndex: "typeLabel",
987
1006
  key: "typeLabel",
@@ -990,7 +1009,7 @@ var En = {
990
1009
  },
991
1010
  {
992
1011
  key: "targetLabel",
993
- render: (e) => /* @__PURE__ */ E(T, {
1012
+ render: (e) => /* @__PURE__ */ D(E, {
994
1013
  component: "span",
995
1014
  variant: "body",
996
1015
  children: e.targetLabel
@@ -1000,7 +1019,7 @@ var En = {
1000
1019
  },
1001
1020
  {
1002
1021
  key: "createdByLabel",
1003
- render: (e) => /* @__PURE__ */ E(T, {
1022
+ render: (e) => /* @__PURE__ */ D(E, {
1004
1023
  component: "span",
1005
1024
  variant: "body",
1006
1025
  children: e.createdByLabel
@@ -1010,7 +1029,7 @@ var En = {
1010
1029
  },
1011
1030
  {
1012
1031
  key: "createdAt",
1013
- render: (e) => /* @__PURE__ */ E(T, {
1032
+ render: (e) => /* @__PURE__ */ D(E, {
1014
1033
  component: "span",
1015
1034
  variant: "body",
1016
1035
  children: t(e.createdAt)
@@ -1020,342 +1039,342 @@ var En = {
1020
1039
  },
1021
1040
  {
1022
1041
  key: "actions",
1023
- render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ E(b, {
1024
- disabled: Xe,
1025
- onClick: () => void Ot(e.id),
1042
+ render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ D(S, {
1043
+ disabled: Ze,
1044
+ onClick: () => void z(e.id),
1026
1045
  size: "minor",
1027
1046
  variant: "destructive-secondary",
1028
1047
  children: "撤回"
1029
- }) : /* @__PURE__ */ E(ve, {}),
1048
+ }) : /* @__PURE__ */ D(Ce, {}),
1030
1049
  title: "操作",
1031
1050
  width: 100
1032
1051
  }
1033
- ], [Xe, r]);
1034
- async function R({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
1035
- if (!r || !N || e === "REJECTED" && !at || e === "TRANSFERRED" && !ot) return !1;
1036
- ee(!0), m(null);
1037
- let o = e === "APPROVED" && i !== null && !N.isAdhoc ? {
1052
+ ], [Ze, r]);
1053
+ async function gt({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
1054
+ if (!r || !M || e === "REJECTED" && !st || e === "TRANSFERRED" && !ct) return !1;
1055
+ m(!0), g(null);
1056
+ let o = e === "APPROVED" && i !== null && !M.isAdhoc ? {
1038
1057
  expectedFormDataFingerprint: i.expectedFormDataFingerprint,
1039
1058
  formData: i.formData
1040
1059
  } : null;
1041
1060
  try {
1042
- await Ce({
1061
+ await Oe({
1043
1062
  action: e,
1044
1063
  comment: t,
1045
1064
  decidedByMemberId: r,
1046
1065
  fill: o,
1047
1066
  returnToNodeId: n,
1048
- taskId: N.id,
1067
+ taskId: M.id,
1049
1068
  transferToMemberId: a
1050
- }), pe(!1), we(!1), Le(!1), S(""), _e(""), De(""), ke(null), O(null), de(null);
1069
+ }), oe(!1), he(!1), Pe(!1), ie(""), w(""), Se(""), ke(null), _e(null), ae(null);
1051
1070
  } catch (e) {
1052
- return ee(!1), o !== null && e instanceof Error && u?.(e.message) === !0 ? (h(!1), !1) : (m(H(e)), !1);
1071
+ return m(!1), o !== null && e instanceof Error && u?.(e.message) === !0 ? (_(!1), !1) : (g(V(e)), !1);
1053
1072
  }
1054
1073
  try {
1055
- await c();
1074
+ await s();
1056
1075
  } catch (e) {
1057
- m(H(e));
1076
+ g(V(e));
1058
1077
  } finally {
1059
- ee(!1);
1078
+ m(!1);
1060
1079
  }
1061
1080
  return !0;
1062
1081
  }
1063
- function pt() {
1064
- r && N && (m(null), h(!0));
1082
+ function F() {
1083
+ r && M && (g(null), _(!0));
1065
1084
  }
1066
- function mt() {
1067
- p || (h(!1), re(""));
1085
+ function _t() {
1086
+ p || (_(!1), te(""));
1068
1087
  }
1069
- async function ht() {
1070
- p || await R({
1088
+ async function I() {
1089
+ p || await gt({
1071
1090
  action: "APPROVED",
1072
- comment: ne.trim() || null
1073
- }) && (h(!1), re(""));
1074
- }
1075
- function gt() {
1076
- at && (S(""), de(null), pe(!0));
1077
- }
1078
- function _t() {
1079
- p || (pe(!1), S(""), de(null));
1091
+ comment: ee.trim() || null
1092
+ }) && (_(!1), te(""));
1080
1093
  }
1081
1094
  function vt() {
1082
- _e(""), O(F[0]?.id ?? null), we(!0);
1095
+ st && (ie(""), ae(null), oe(!0));
1083
1096
  }
1084
1097
  function yt() {
1085
- p || (we(!1), _e(""), O(null));
1098
+ p || (oe(!1), ie(""), ae(null));
1086
1099
  }
1087
1100
  function bt() {
1088
- ot && (De(""), ke(null), Le(!0), B(""));
1101
+ w(""), _e(at[0]?.id ?? null), he(!0);
1089
1102
  }
1090
- function z() {
1091
- p || (Le(!1), De(""), ke(null));
1103
+ function xt() {
1104
+ p || (he(!1), w(""), _e(null));
1092
1105
  }
1093
- async function B(e) {
1094
- Ne(!0);
1106
+ function St() {
1107
+ ct && (Se(""), ke(null), Pe(!0), L(""));
1108
+ }
1109
+ function Ct() {
1110
+ p || (Pe(!1), Se(""), ke(null));
1111
+ }
1112
+ async function L(e) {
1113
+ k(!0);
1095
1114
  try {
1096
- Fe((await k(e)).filter((e) => e.memberId !== r).map(Mt));
1115
+ Me((await Ve(e)).filter((e) => e.memberId !== r).map(Ht));
1097
1116
  } catch (e) {
1098
- m(H(e));
1117
+ g(V(e));
1099
1118
  } finally {
1100
- Ne(!1);
1119
+ k(!1);
1101
1120
  }
1102
1121
  }
1103
- async function xt() {
1104
- at && (M ? await R({
1122
+ async function wt() {
1123
+ st && (nt ? await gt({
1105
1124
  action: "REJECTED",
1106
- comment: M
1107
- }) : de("請輸入拒絕原因"));
1125
+ comment: nt
1126
+ }) : ae("請輸入拒絕原因"));
1108
1127
  }
1109
- async function V() {
1110
- ot && (Oe ? await R({
1128
+ async function Tt() {
1129
+ ct && (Te ? await gt({
1111
1130
  action: "TRANSFERRED",
1112
- comment: rt || null,
1113
- transferToMemberId: Oe.id
1114
- }) : m("請選擇轉派對象"));
1131
+ comment: it || null,
1132
+ transferToMemberId: Te.id
1133
+ }) : g("請選擇轉派對象"));
1115
1134
  }
1116
- async function St() {
1117
- await R({
1135
+ async function Et() {
1136
+ await gt({
1118
1137
  action: "RETURNED",
1119
- comment: nt || null,
1120
- returnToNodeId: L?.id ?? null
1138
+ comment: rt || null,
1139
+ returnToNodeId: P?.id ?? null
1121
1140
  });
1122
1141
  }
1123
- function Ct() {
1124
- ze(""), Ve([]), j("REJECT_INSTANCE"), $e("MEMBER"), tt("");
1142
+ function Dt() {
1143
+ Re(""), Be([]), Xe("REJECT_INSTANCE"), et("MEMBER"), j("");
1125
1144
  }
1126
- function wt(e) {
1127
- Je(e), Ct(), qe(!0), Et("");
1145
+ function Ot(e) {
1146
+ Je(e), Dt(), qe(!0), R("");
1128
1147
  }
1129
- function Tt() {
1130
- Xe || (qe(!1), Ct());
1148
+ function kt() {
1149
+ Ze || (qe(!1), Dt());
1131
1150
  }
1132
- async function Et(e) {
1151
+ async function R(e) {
1133
1152
  Ue(!0);
1134
1153
  try {
1135
- Ge((await k(e)).map(Mt));
1154
+ Ge((await Ve(e)).map(Ht));
1136
1155
  } catch (e) {
1137
- m(H(e));
1156
+ g(V(e));
1138
1157
  } finally {
1139
1158
  Ue(!1);
1140
1159
  }
1141
1160
  }
1142
- async function Dt() {
1143
- if (!N) return;
1144
- let e = (A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY") && Qe === "WEBHOOK", t = Nt({
1145
- memberIds: Be.map((e) => e.id),
1161
+ async function At() {
1162
+ if (!M) return;
1163
+ let e = (A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY") && $e === "WEBHOOK", t = G({
1164
+ memberIds: ze.map((e) => e.id),
1146
1165
  useWebhookTarget: e,
1147
- webhookUrl: et
1166
+ webhookUrl: tt
1148
1167
  });
1149
1168
  if (!t.valid) {
1150
- m(t.error);
1169
+ g(t.error);
1151
1170
  return;
1152
1171
  }
1153
- let { target: n } = t, r = Re.trim() || null;
1154
- Ze(!0), m(null);
1172
+ let { target: n } = t, r = Fe.trim() || null;
1173
+ Qe(!0), g(null);
1155
1174
  try {
1156
- A === "COUNTERSIGN" ? await je({
1175
+ A === "COUNTERSIGN" ? await Ie({
1157
1176
  comment: r,
1158
1177
  target: n,
1159
- taskId: N.id
1160
- }) : A === "PRE_APPROVAL" ? await Me({
1178
+ taskId: M.id
1179
+ }) : A === "PRE_APPROVAL" ? await Le({
1161
1180
  comment: r,
1162
1181
  onReject: Ye,
1163
1182
  target: n,
1164
- taskId: N.id
1165
- }) : A === "STAGE_NOTIFY" ? await Se({
1183
+ taskId: M.id
1184
+ }) : A === "STAGE_NOTIFY" ? await De({
1166
1185
  target: n,
1167
- taskId: N.id
1168
- }) : await xe({
1186
+ taskId: M.id
1187
+ }) : await Ee({
1169
1188
  target: n,
1170
- taskId: N.id
1171
- }), qe(!1), Ct(), await c();
1189
+ taskId: M.id
1190
+ }), qe(!1), Dt(), await s();
1172
1191
  } catch (e) {
1173
- m(H(e));
1192
+ g(V(e));
1174
1193
  } finally {
1175
- Ze(!1);
1194
+ Qe(!1);
1176
1195
  }
1177
1196
  }
1178
- async function Ot(e) {
1179
- Ze(!0), m(null);
1197
+ async function z(e) {
1198
+ Qe(!0), g(null);
1180
1199
  try {
1181
- await ye(e), await c();
1200
+ await we(e), await s();
1182
1201
  } catch (e) {
1183
- m(H(e));
1202
+ g(V(e));
1184
1203
  } finally {
1185
- Ze(!1);
1204
+ Qe(!1);
1186
1205
  }
1187
1206
  }
1188
- ae(f, () => ({
1189
- canAddSignerCurrentTask: ct,
1190
- canRejectCurrentTask: at,
1191
- canReturnCurrentTask: it,
1192
- canTransferCurrentTask: ot,
1207
+ ce(f, () => ({
1208
+ canAddSignerCurrentTask: ut,
1209
+ canRejectCurrentTask: st,
1210
+ canReturnCurrentTask: ot,
1211
+ canTransferCurrentTask: ct,
1193
1212
  deciding: p,
1194
- handleApprove: pt,
1195
- hasCurrentTask: N !== null,
1196
- openAdhocModal: wt,
1197
- openRejectModal: gt,
1198
- openReturnModal: vt,
1199
- openTransferModal: bt
1213
+ handleApprove: F,
1214
+ hasCurrentTask: M !== null,
1215
+ openAdhocModal: Ot,
1216
+ openRejectModal: vt,
1217
+ openReturnModal: bt,
1218
+ openTransferModal: St
1200
1219
  }), [
1201
- ct,
1202
- at,
1203
- it,
1220
+ ut,
1221
+ st,
1204
1222
  ot,
1223
+ ct,
1205
1224
  r,
1206
- N,
1225
+ M,
1207
1226
  p
1208
1227
  ]);
1209
- let G = A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY", q = G && Qe === "WEBHOOK" ? !et.trim() : Be.length === 0, J = On.find((e) => e.id === Ye) ?? On[0], Lt = kn.find((e) => e.id === Qe) ?? kn[0];
1210
- return /* @__PURE__ */ D(ve, { children: [
1211
- /* @__PURE__ */ E(T, {
1228
+ let B = A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY", jt = B && $e === "WEBHOOK" ? !tt.trim() : ze.length === 0, Mt = Ln.find((e) => e.id === Ye) ?? Ln[0], Nt = Rn.find((e) => e.id === $e) ?? Rn[0];
1229
+ return /* @__PURE__ */ O(Ce, { children: [
1230
+ /* @__PURE__ */ D(E, {
1212
1231
  component: "h2",
1213
1232
  variant: "h3",
1214
1233
  children: "任務"
1215
1234
  }),
1216
- te ? /* @__PURE__ */ E(T, {
1235
+ h ? /* @__PURE__ */ D(E, {
1217
1236
  color: "text-error",
1218
1237
  variant: "body",
1219
- children: te
1238
+ children: h
1220
1239
  }) : null,
1221
- /* @__PURE__ */ E("div", {
1222
- style: Cn,
1223
- children: /* @__PURE__ */ E(he, {
1224
- columns: ut,
1225
- dataSource: lt,
1240
+ /* @__PURE__ */ D("div", {
1241
+ style: Mn,
1242
+ children: /* @__PURE__ */ D(be, {
1243
+ columns: pt,
1244
+ dataSource: ft,
1226
1245
  fullWidth: !0
1227
1246
  })
1228
1247
  }),
1229
- I.length > 0 ? /* @__PURE__ */ D(ve, { children: [/* @__PURE__ */ E(T, {
1248
+ dt.length > 0 ? /* @__PURE__ */ O(Ce, { children: [/* @__PURE__ */ D(E, {
1230
1249
  component: "h3",
1231
- style: wn,
1250
+ style: Nn,
1232
1251
  variant: "h3",
1233
1252
  children: "待生效的臨時設定"
1234
- }), /* @__PURE__ */ E("div", {
1235
- style: Cn,
1236
- children: /* @__PURE__ */ E(he, {
1237
- columns: ft,
1238
- dataSource: dt,
1253
+ }), /* @__PURE__ */ D("div", {
1254
+ style: Mn,
1255
+ children: /* @__PURE__ */ D(be, {
1256
+ columns: ht,
1257
+ dataSource: mt,
1239
1258
  fullWidth: !0
1240
1259
  })
1241
1260
  })] }) : null,
1242
- /* @__PURE__ */ D(C, {
1261
+ /* @__PURE__ */ O(T, {
1243
1262
  cancelText: "取消",
1244
1263
  confirmText: "送出同意",
1245
1264
  loading: p,
1246
1265
  modalType: "standard",
1247
- onCancel: mt,
1248
- onClose: mt,
1249
- onConfirm: () => void ht(),
1250
- open: ie,
1266
+ onCancel: _t,
1267
+ onClose: _t,
1268
+ onConfirm: () => void I(),
1269
+ open: ne,
1251
1270
  showModalFooter: !0,
1252
1271
  showModalHeader: !0,
1253
1272
  size: "regular",
1254
1273
  supportingText: "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
1255
1274
  title: "簽核意見",
1256
1275
  children: [
1257
- te ? /* @__PURE__ */ E(T, {
1276
+ h ? /* @__PURE__ */ D(E, {
1258
1277
  color: "text-error",
1259
1278
  role: "alert",
1260
1279
  variant: "body",
1261
- children: te
1280
+ children: h
1262
1281
  }) : null,
1263
- i !== null && i.summary.length > 0 ? /* @__PURE__ */ D("div", {
1264
- style: bn,
1265
- children: [/* @__PURE__ */ E(T, {
1282
+ i !== null && i.summary.length > 0 ? /* @__PURE__ */ O("div", {
1283
+ style: kn,
1284
+ children: [/* @__PURE__ */ D(E, {
1266
1285
  variant: "body",
1267
1286
  children: "將一併送出的補填欄位:"
1268
- }), i.summary.map((e) => /* @__PURE__ */ E(x, {
1287
+ }), i.summary.map((e) => /* @__PURE__ */ D(C, {
1269
1288
  title: e.label,
1270
- children: /* @__PURE__ */ E(ce, { children: e.text })
1289
+ children: /* @__PURE__ */ D(fe, { children: e.text })
1271
1290
  }, e.fieldKey))]
1272
1291
  }) : null,
1273
- /* @__PURE__ */ E("div", {
1274
- style: bn,
1275
- children: /* @__PURE__ */ E(n, {
1292
+ /* @__PURE__ */ D("div", {
1293
+ style: kn,
1294
+ children: /* @__PURE__ */ D(e, {
1276
1295
  label: "簽核意見",
1277
1296
  name: "approveComment",
1278
- children: /* @__PURE__ */ E(ge, {
1297
+ children: /* @__PURE__ */ D(xe, {
1279
1298
  autoFocus: !0,
1280
- onChange: (e) => re(e.target.value),
1299
+ onChange: (e) => te(e.target.value),
1281
1300
  placeholder: "選填,例如補充核准的條件或提醒事項",
1282
- ref: Tn,
1301
+ ref: Pn,
1283
1302
  resize: "vertical",
1284
1303
  rows: 4,
1285
- style: xn,
1286
- value: ne
1304
+ style: An,
1305
+ value: ee
1287
1306
  })
1288
1307
  })
1289
1308
  })
1290
1309
  ]
1291
1310
  }),
1292
- /* @__PURE__ */ E(C, {
1311
+ /* @__PURE__ */ D(T, {
1293
1312
  cancelText: "取消",
1294
1313
  confirmButtonProps: {
1295
- disabled: !M,
1314
+ disabled: !nt,
1296
1315
  variant: "destructive-primary"
1297
1316
  },
1298
1317
  confirmText: "送出拒絕",
1299
1318
  loading: p,
1300
1319
  modalStatusType: "error",
1301
1320
  modalType: "standard",
1302
- onCancel: _t,
1303
- onClose: _t,
1304
- onConfirm: () => void xt(),
1305
- open: fe,
1321
+ onCancel: yt,
1322
+ onClose: yt,
1323
+ onConfirm: () => void wt(),
1324
+ open: y,
1306
1325
  showModalFooter: !0,
1307
1326
  showModalHeader: !0,
1308
1327
  size: "regular",
1309
1328
  supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
1310
1329
  title: "拒絕原因",
1311
- children: /* @__PURE__ */ D("div", {
1312
- style: bn,
1313
- children: [/* @__PURE__ */ E(n, {
1330
+ children: /* @__PURE__ */ O("div", {
1331
+ style: kn,
1332
+ children: [/* @__PURE__ */ D(e, {
1314
1333
  label: "拒絕原因",
1315
1334
  name: "rejectReason",
1316
1335
  required: !0,
1317
- children: /* @__PURE__ */ E(ge, {
1336
+ children: /* @__PURE__ */ D(xe, {
1318
1337
  autoFocus: !0,
1319
1338
  onChange: (e) => {
1320
- S(e.target.value), de(null);
1339
+ ie(e.target.value), ae(null);
1321
1340
  },
1322
1341
  placeholder: "請說明拒絕原因",
1323
- ref: Tn,
1342
+ ref: Pn,
1324
1343
  resize: "vertical",
1325
1344
  rows: 4,
1326
- style: xn,
1327
- type: ue ? "error" : "default",
1328
- value: v
1345
+ style: An,
1346
+ type: v ? "error" : "default",
1347
+ value: re
1329
1348
  })
1330
- }), ue ? /* @__PURE__ */ E(T, {
1349
+ }), v ? /* @__PURE__ */ D(E, {
1331
1350
  color: "text-error",
1332
1351
  variant: "body",
1333
- children: ue
1352
+ children: v
1334
1353
  }) : null]
1335
1354
  })
1336
1355
  }),
1337
- /* @__PURE__ */ E(C, {
1356
+ /* @__PURE__ */ D(T, {
1338
1357
  cancelText: "取消",
1339
- confirmButtonProps: { disabled: !Oe },
1358
+ confirmButtonProps: { disabled: !Te },
1340
1359
  confirmText: "送出轉派",
1341
1360
  loading: p,
1342
1361
  modalType: "standard",
1343
- onCancel: z,
1344
- onClose: z,
1345
- onConfirm: () => void V(),
1346
- open: Ie,
1362
+ onCancel: Ct,
1363
+ onClose: Ct,
1364
+ onConfirm: () => void Tt(),
1365
+ open: Ne,
1347
1366
  showModalFooter: !0,
1348
1367
  showModalHeader: !0,
1349
1368
  size: "regular",
1350
1369
  supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
1351
1370
  title: "轉派簽核",
1352
- children: /* @__PURE__ */ D("div", {
1353
- style: Sn,
1354
- children: [/* @__PURE__ */ E(n, {
1371
+ children: /* @__PURE__ */ O("div", {
1372
+ style: jn,
1373
+ children: [/* @__PURE__ */ D(e, {
1355
1374
  label: "轉派對象",
1356
1375
  name: "transferToMemberId",
1357
1376
  required: !0,
1358
- children: /* @__PURE__ */ E(oe, {
1377
+ children: /* @__PURE__ */ D(ue, {
1359
1378
  asyncData: !0,
1360
1379
  disabledOptionsFilter: !0,
1361
1380
  emptyText: "沒有符合的成員",
@@ -1368,144 +1387,144 @@ var En = {
1368
1387
  loading: Ae,
1369
1388
  loadingText: "搜尋成員中...",
1370
1389
  mode: "single",
1371
- onChange: (e) => ke(Ft(e)),
1372
- onSearch: B,
1373
- onSearchTextChange: (e) => ke(It(e, Pe)),
1390
+ onChange: (e) => ke(Wt(e)),
1391
+ onSearch: L,
1392
+ onSearchTextChange: (e) => ke(Gt(e, je)),
1374
1393
  onVisibilityChange: (e) => {
1375
- e && B("");
1394
+ e && L("");
1376
1395
  },
1377
- options: [...Pe],
1396
+ options: [...je],
1378
1397
  placeholder: "搜尋姓名或信箱",
1379
1398
  searchDebounceTime: 300,
1380
- value: Oe
1399
+ value: Te
1381
1400
  })
1382
- }), /* @__PURE__ */ E(n, {
1401
+ }), /* @__PURE__ */ D(e, {
1383
1402
  label: "轉派說明",
1384
1403
  name: "transferComment",
1385
- children: /* @__PURE__ */ E(ge, {
1386
- onChange: (e) => De(e.target.value),
1404
+ children: /* @__PURE__ */ D(xe, {
1405
+ onChange: (e) => Se(e.target.value),
1387
1406
  placeholder: "可補充轉派原因",
1388
- ref: Tn,
1407
+ ref: Pn,
1389
1408
  resize: "vertical",
1390
1409
  rows: 4,
1391
- style: xn,
1392
- value: Ee
1410
+ style: An,
1411
+ value: ye
1393
1412
  })
1394
1413
  })]
1395
1414
  })
1396
1415
  }),
1397
- /* @__PURE__ */ E(C, {
1416
+ /* @__PURE__ */ D(T, {
1398
1417
  cancelText: "取消",
1399
- confirmButtonProps: { disabled: !L || st && !nt },
1418
+ confirmButtonProps: { disabled: !P || lt && !rt },
1400
1419
  confirmText: "送出退回",
1401
1420
  loading: p,
1402
1421
  modalType: "standard",
1403
- onCancel: yt,
1404
- onClose: yt,
1405
- onConfirm: () => void St(),
1406
- open: be,
1422
+ onCancel: xt,
1423
+ onClose: xt,
1424
+ onConfirm: () => void Et(),
1425
+ open: me,
1407
1426
  showModalFooter: !0,
1408
1427
  showModalHeader: !0,
1409
1428
  size: "regular",
1410
1429
  supportingText: "退回後,流程會回到指定節點並等待重新處理。",
1411
1430
  title: "退回簽核",
1412
- children: /* @__PURE__ */ D("div", {
1413
- style: Sn,
1414
- children: [/* @__PURE__ */ E(n, {
1431
+ children: /* @__PURE__ */ O("div", {
1432
+ style: jn,
1433
+ children: [/* @__PURE__ */ D(e, {
1415
1434
  label: "退回節點",
1416
1435
  name: "returnTargetNodeId",
1417
1436
  required: !0,
1418
- children: /* @__PURE__ */ E(w, {
1437
+ children: /* @__PURE__ */ D(ve, {
1419
1438
  clearable: !1,
1420
1439
  fullWidth: !0,
1421
- onChange: (e) => O(e?.id ?? null),
1422
- options: [...F],
1440
+ onChange: (e) => _e(e?.id ?? null),
1441
+ options: [...at],
1423
1442
  placeholder: "選擇退回節點",
1424
- value: L
1443
+ value: P
1425
1444
  })
1426
- }), /* @__PURE__ */ E(n, {
1427
- hintText: st ? "此關卡設定退回時必須填寫意見。" : void 0,
1445
+ }), /* @__PURE__ */ D(e, {
1446
+ hintText: lt ? "此關卡設定退回時必須填寫意見。" : void 0,
1428
1447
  label: "退回說明",
1429
1448
  name: "returnComment",
1430
- required: st,
1431
- children: /* @__PURE__ */ E(ge, {
1432
- onChange: (e) => _e(e.target.value),
1433
- placeholder: st ? "請說明退回原因" : "可補充需要修改的內容",
1434
- ref: Tn,
1449
+ required: lt,
1450
+ children: /* @__PURE__ */ D(xe, {
1451
+ onChange: (e) => w(e.target.value),
1452
+ placeholder: lt ? "請說明退回原因" : "可補充需要修改的內容",
1453
+ ref: Pn,
1435
1454
  resize: "vertical",
1436
1455
  rows: 4,
1437
- style: xn,
1438
- value: me
1456
+ style: An,
1457
+ value: le
1439
1458
  })
1440
1459
  })]
1441
1460
  })
1442
1461
  }),
1443
- /* @__PURE__ */ E(C, {
1462
+ /* @__PURE__ */ D(T, {
1444
1463
  cancelText: "取消",
1445
- confirmButtonProps: { disabled: q },
1464
+ confirmButtonProps: { disabled: jt },
1446
1465
  confirmText: "送出",
1447
- loading: Xe,
1466
+ loading: Ze,
1448
1467
  modalType: "standard",
1449
- onCancel: Tt,
1450
- onClose: Tt,
1451
- onConfirm: () => void Dt(),
1468
+ onCancel: kt,
1469
+ onClose: kt,
1470
+ onConfirm: () => void At(),
1452
1471
  open: Ke,
1453
1472
  showModalFooter: !0,
1454
1473
  showModalHeader: !0,
1455
1474
  size: "regular",
1456
- supportingText: Dn[A],
1457
- title: En[A],
1458
- children: /* @__PURE__ */ D("div", {
1459
- style: Sn,
1475
+ supportingText: In[A],
1476
+ title: Fn[A],
1477
+ children: /* @__PURE__ */ O("div", {
1478
+ style: jn,
1460
1479
  children: [
1461
- G ? /* @__PURE__ */ E(n, {
1480
+ B ? /* @__PURE__ */ D(e, {
1462
1481
  label: "通知時機",
1463
1482
  name: "adhocNotifyMode",
1464
1483
  required: !0,
1465
- children: /* @__PURE__ */ E(w, {
1484
+ children: /* @__PURE__ */ D(ve, {
1466
1485
  clearable: !1,
1467
1486
  fullWidth: !0,
1468
1487
  onChange: (e) => Je(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1469
1488
  options: [{
1470
1489
  id: "STAGE_NOTIFY",
1471
- name: En.STAGE_NOTIFY
1490
+ name: Fn.STAGE_NOTIFY
1472
1491
  }, {
1473
1492
  id: "COMPLETION_NOTIFY",
1474
- name: En.COMPLETION_NOTIFY
1493
+ name: Fn.COMPLETION_NOTIFY
1475
1494
  }],
1476
1495
  value: {
1477
1496
  id: A,
1478
- name: En[A]
1497
+ name: Fn[A]
1479
1498
  }
1480
1499
  })
1481
1500
  }) : null,
1482
- G ? /* @__PURE__ */ E(n, {
1501
+ B ? /* @__PURE__ */ D(e, {
1483
1502
  label: "通知對象類型",
1484
1503
  name: "adhocTargetKind",
1485
1504
  required: !0,
1486
- children: /* @__PURE__ */ E(w, {
1505
+ children: /* @__PURE__ */ D(ve, {
1487
1506
  clearable: !1,
1488
1507
  fullWidth: !0,
1489
- onChange: (e) => $e(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1490
- options: [...kn],
1491
- value: Lt
1508
+ onChange: (e) => et(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1509
+ options: [...Rn],
1510
+ value: Nt
1492
1511
  })
1493
1512
  }) : null,
1494
- G && Qe === "WEBHOOK" ? /* @__PURE__ */ E(n, {
1513
+ B && $e === "WEBHOOK" ? /* @__PURE__ */ D(e, {
1495
1514
  label: "Webhook URL",
1496
1515
  name: "adhocWebhookUrl",
1497
1516
  required: !0,
1498
- children: /* @__PURE__ */ E(le, {
1517
+ children: /* @__PURE__ */ D(pe, {
1499
1518
  fullWidth: !0,
1500
- onChange: (e) => tt(e.target.value),
1519
+ onChange: (e) => j(e.target.value),
1501
1520
  placeholder: "https://example.com/webhook",
1502
- value: et
1521
+ value: tt
1503
1522
  })
1504
- }) : /* @__PURE__ */ E(n, {
1505
- label: G ? "通知對象" : "簽核對象",
1523
+ }) : /* @__PURE__ */ D(e, {
1524
+ label: B ? "通知對象" : "簽核對象",
1506
1525
  name: "adhocMemberId",
1507
1526
  required: !0,
1508
- children: /* @__PURE__ */ E(oe, {
1527
+ children: /* @__PURE__ */ D(ue, {
1509
1528
  asyncData: !0,
1510
1529
  disabledOptionsFilter: !0,
1511
1530
  emptyText: "沒有符合的成員",
@@ -1519,41 +1538,41 @@ var En = {
1519
1538
  loadingText: "搜尋成員中...",
1520
1539
  menuMaxHeight: 320,
1521
1540
  mode: "multiple",
1522
- onChange: (e) => Ve(e.map(Ft).filter(Pt)),
1523
- onSearch: Et,
1541
+ onChange: (e) => Be(e.map(Wt).filter(Ut)),
1542
+ onSearch: R,
1524
1543
  onVisibilityChange: (e) => {
1525
- e && Et("");
1544
+ e && R("");
1526
1545
  },
1527
1546
  options: [...We],
1528
1547
  overflowStrategy: "wrap",
1529
1548
  placeholder: "搜尋姓名或信箱,可加入多位",
1530
1549
  searchDebounceTime: 300,
1531
- value: [...Be]
1550
+ value: [...ze]
1532
1551
  })
1533
1552
  }),
1534
- A === "PRE_APPROVAL" ? /* @__PURE__ */ E(n, {
1553
+ A === "PRE_APPROVAL" ? /* @__PURE__ */ D(e, {
1535
1554
  label: "拒簽處理方式",
1536
1555
  name: "adhocOnReject",
1537
1556
  required: !0,
1538
- children: /* @__PURE__ */ E(w, {
1557
+ children: /* @__PURE__ */ D(ve, {
1539
1558
  clearable: !1,
1540
1559
  fullWidth: !0,
1541
- onChange: (e) => j(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1542
- options: [...On],
1543
- value: J
1560
+ onChange: (e) => Xe(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1561
+ options: [...Ln],
1562
+ value: Mt
1544
1563
  })
1545
1564
  }) : null,
1546
- G ? null : /* @__PURE__ */ E(n, {
1565
+ B ? null : /* @__PURE__ */ D(e, {
1547
1566
  label: "說明",
1548
1567
  name: "adhocComment",
1549
- children: /* @__PURE__ */ E(ge, {
1550
- onChange: (e) => ze(e.target.value),
1568
+ children: /* @__PURE__ */ D(xe, {
1569
+ onChange: (e) => Re(e.target.value),
1551
1570
  placeholder: "可補充原因",
1552
- ref: Tn,
1571
+ ref: Pn,
1553
1572
  resize: "vertical",
1554
1573
  rows: 3,
1555
- style: xn,
1556
- value: Re
1574
+ style: An,
1575
+ value: Fe
1557
1576
  })
1558
1577
  })
1559
1578
  ]
@@ -1561,7 +1580,7 @@ var En = {
1561
1580
  })
1562
1581
  ] });
1563
1582
  });
1564
- function jn(e, t) {
1583
+ function Bn(e, t) {
1565
1584
  try {
1566
1585
  let n = JSON.parse(e.targetValueJson);
1567
1586
  if (n.memberIds?.length) return n.memberIds.map((e) => W(e, t)).join("、");
@@ -1571,26 +1590,25 @@ function jn(e, t) {
1571
1590
  } catch {}
1572
1591
  return e.targetKind;
1573
1592
  }
1574
- function Mn(e, t) {
1593
+ function Vn(e, t) {
1575
1594
  if (e.isAdhoc || e.status !== "PENDING" && e.status !== "IN_PROGRESS") return 0;
1576
1595
  let n = t?.nodes.find((t) => t.id === e.nodeId);
1577
- return n?.type === "userTask" ? Xe(n).size : 0;
1596
+ return n?.type === "userTask" ? nt(n).size : 0;
1578
1597
  }
1579
- //#endregion
1580
- //#region src/views/instances/detail/sections/InstanceSignaturesSection.tsx
1581
- var Nn = {
1598
+ // src/views/instances/detail/sections/InstanceSignaturesSection.tsx
1599
+ var Hn = {
1582
1600
  display: "grid",
1583
1601
  gap: 16
1584
1602
  };
1585
- function Pn({ signatureVerification: e, signatures: n }) {
1586
- let r = _(() => n.map((e) => ({
1603
+ function Un({ signatureVerification: e, signatures: n }) {
1604
+ let r = b(() => n.map((e) => ({
1587
1605
  algorithm: e.algorithm,
1588
- hashLabel: Tt(e.signedPayloadHash),
1606
+ hashLabel: H(e.signedPayloadHash),
1589
1607
  key: e.id,
1590
1608
  keyVersion: e.keyVersion,
1591
1609
  signedAtLabel: t(e.signedAt),
1592
1610
  signerMemberId: e.signerMemberId
1593
- })), [n]), i = _(() => [
1611
+ })), [n]), i = b(() => [
1594
1612
  {
1595
1613
  dataIndex: "signerMemberId",
1596
1614
  key: "signerMemberId",
@@ -1622,20 +1640,20 @@ function Pn({ signatureVerification: e, signatures: n }) {
1622
1640
  width: 220
1623
1641
  }
1624
1642
  ], []);
1625
- return /* @__PURE__ */ D("div", {
1626
- style: Nn,
1643
+ return /* @__PURE__ */ O("div", {
1644
+ style: Hn,
1627
1645
  children: [
1628
- /* @__PURE__ */ E(T, {
1646
+ /* @__PURE__ */ D(E, {
1629
1647
  component: "h2",
1630
1648
  variant: "h3",
1631
1649
  children: "簽章"
1632
1650
  }),
1633
- /* @__PURE__ */ E(T, {
1651
+ /* @__PURE__ */ D(E, {
1634
1652
  color: e?.valid ? "text-success" : "text-error",
1635
1653
  variant: "body",
1636
1654
  children: e ? e.valid ? `簽章鏈已驗證,共 ${e.checkedCount} 筆。` : `簽章鏈驗證失敗:${e.errors.join("、")}` : "尚無簽章紀錄。"
1637
1655
  }),
1638
- r.length > 0 ? /* @__PURE__ */ E(he, {
1656
+ r.length > 0 ? /* @__PURE__ */ D(be, {
1639
1657
  columns: i,
1640
1658
  dataSource: r,
1641
1659
  fullWidth: !0
@@ -1643,16 +1661,15 @@ function Pn({ signatureVerification: e, signatures: n }) {
1643
1661
  ]
1644
1662
  });
1645
1663
  }
1646
- //#endregion
1647
- //#region src/views/instances/detail/sections/InstanceHistorySection.tsx
1648
- var Fn = {
1664
+ // src/views/instances/detail/sections/InstanceHistorySection.tsx
1665
+ var Wn = {
1649
1666
  display: "grid",
1650
1667
  gap: 16
1651
- }, In = {
1668
+ }, Gn = {
1652
1669
  cursor: "help",
1653
1670
  textDecoration: "underline dotted",
1654
1671
  textUnderlineOffset: 3
1655
- }, Ln = {
1672
+ }, Kn = {
1656
1673
  borderLeftColor: "var(--mzn-color-border)",
1657
1674
  borderLeftStyle: "solid",
1658
1675
  borderLeftWidth: 2,
@@ -1661,41 +1678,42 @@ var Fn = {
1661
1678
  marginTop: 4,
1662
1679
  paddingLeft: 8,
1663
1680
  whiteSpace: "pre-wrap"
1664
- }, Rn = { color: "var(--mzn-color-text-secondary)" }, zn = {
1665
- ...Ln,
1681
+ }, qn = { color: "var(--mzn-color-text-secondary)" }, Jn = {
1682
+ ...Kn,
1666
1683
  borderLeftColor: "var(--mzn-color-text-error)",
1667
1684
  color: "var(--mzn-color-text-error)"
1668
1685
  };
1669
- function Bn(...e) {
1670
- return e.filter((e) => V(e ?? null)).join(" ");
1686
+ function Yn(...e) {
1687
+ return e.filter((e) => B(e ?? null)).join(" ");
1671
1688
  }
1672
- var Vn = ie(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: s, type: c = "number", ...l }, u) {
1689
+ var Xn = y(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: s, type: c = "number", ...l }, u) {
1673
1690
  let d = r ? "pending" : o, f = t.filter((e) => e.type !== "comment"), p = t.filter((e) => e.type === "comment");
1674
- return /* @__PURE__ */ D("div", {
1691
+ return /* @__PURE__ */ O("div", {
1675
1692
  ...l,
1676
- className: Bn(I.host, c === "dot" ? I.dot : null, n && d !== "processing" ? I.error : null, a === "horizontal" ? I.horizontal : null, c === "number" ? I.number : null, d === "pending" ? I.pending : null, d === "processing" ? I.processing : null, n && d === "processing" ? I.processingError : null, !n && d === "succeeded" ? I.succeeded : null, a === "vertical" ? I.vertical : null, e),
1693
+ className: Yn(F.host, c === "dot" ? F.dot : null, n && d !== "processing" ? F.error : null, a === "horizontal" ? F.horizontal : null, c === "number" ? F.number : null, d === "pending" ? F.pending : null, d === "processing" ? F.processing : null, n && d === "processing" ? F.processingError : null, !n && d === "succeeded" ? F.succeeded : null, a === "vertical" ? F.vertical : null, e),
1677
1694
  ref: u,
1678
- children: [c === "dot" ? /* @__PURE__ */ E("span", { className: Bn(I.statusIndicator, I.statusIndicatorDot) }) : /* @__PURE__ */ E("span", {
1679
- className: I.statusIndicator,
1695
+ children: [c === "dot" ? /* @__PURE__ */ D("span", { className: Yn(F.statusIndicator, F.statusIndicatorDot) }) : /* @__PURE__ */ D("span", {
1696
+ className: F.statusIndicator,
1680
1697
  children: i + 1
1681
- }), /* @__PURE__ */ D("div", {
1682
- className: I.textContainer,
1698
+ }), /* @__PURE__ */ O("div", {
1699
+ className: F.textContainer,
1683
1700
  children: [
1684
- /* @__PURE__ */ D(T, {
1685
- className: I.title,
1701
+ /* @__PURE__ */ O(E, {
1702
+ className: F.title,
1686
1703
  variant: "label-primary-highlight",
1687
- children: [s, /* @__PURE__ */ E("span", { className: I.titleConnectLine })]
1704
+ children: [s, /* @__PURE__ */ D("span", { className: F.titleConnectLine })]
1688
1705
  }),
1689
- f.length > 0 ? /* @__PURE__ */ E(T, {
1690
- className: I.description,
1691
- variant: "caption",
1692
- children: f.map((e, t) => /* @__PURE__ */ D(re, { children: [t > 0 ? " · " : null, Hn(e)] }, `${e.type}-${t}`))
1706
+ f.length > 0 ? /* @__PURE__ */ D(E, {
1707
+ className: F.description,
1708
+ component: "div",
1709
+ variant: "body",
1710
+ children: f.map((e, t) => /* @__PURE__ */ O(ae, { children: [t > 0 ? " · " : null, Zn(e)] }, `${e.type}-${t}`))
1693
1711
  }) : null,
1694
- p.map((e, t) => /* @__PURE__ */ D(T, {
1695
- style: e.tone === "danger" ? zn : Ln,
1712
+ p.map((e, t) => /* @__PURE__ */ O(E, {
1713
+ style: e.tone === "danger" ? Jn : Kn,
1696
1714
  variant: "body",
1697
- children: [/* @__PURE__ */ D("span", {
1698
- style: e.tone === "danger" ? void 0 : Rn,
1715
+ children: [/* @__PURE__ */ O("span", {
1716
+ style: e.tone === "danger" ? void 0 : qn,
1699
1717
  children: [e.label, ":"]
1700
1718
  }), e.text]
1701
1719
  }, `comment-${t}`))
@@ -1703,76 +1721,87 @@ var Vn = ie(function({ className: e, descriptionParts: t, error: n, forcePending
1703
1721
  })]
1704
1722
  });
1705
1723
  });
1706
- function Hn(e) {
1707
- return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ D(ve, { children: [
1724
+ function Zn(e) {
1725
+ return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ O(Ce, { children: [
1708
1726
  e.prefix,
1709
1727
  ":",
1710
- /* @__PURE__ */ E(_e, {
1728
+ /* @__PURE__ */ D(Se, {
1711
1729
  title: e.email,
1712
- children: ({ ref: t, ...n }) => /* @__PURE__ */ E("span", {
1730
+ children: ({ ref: t, ...n }) => /* @__PURE__ */ D("span", {
1713
1731
  ...n,
1714
1732
  "data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
1715
1733
  ref: t,
1716
- style: In,
1734
+ style: Gn,
1717
1735
  children: e.label
1718
1736
  })
1719
1737
  })
1720
1738
  ] }) : `${e.prefix}:${e.label}`;
1721
1739
  }
1722
- function Un({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisionsByTaskId: o, tasks: s, workflowSnapshot: c, workflowTokens: l }) {
1723
- let u = an(e, s, l, c, n, r, o, a, i, t), d = Rt(u), f = u.map((e) => ({
1740
+ function Qn({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisions: o = null, taskDecisionsByTaskId: s, tasks: c, workflowSnapshot: l, workflowTokens: u }) {
1741
+ let d = b(() => hn(e, c, u, l, n, r, s, a, i, t, o), [
1742
+ e,
1743
+ t,
1744
+ n,
1745
+ r,
1746
+ i,
1747
+ a,
1748
+ o,
1749
+ s,
1750
+ c,
1751
+ l,
1752
+ u
1753
+ ]), f = Y(d), p = d.map((e) => ({
1724
1754
  ...e,
1725
- descriptionParts: e.descriptionParts.filter(Y)
1755
+ descriptionParts: e.descriptionParts.filter(J)
1726
1756
  }));
1727
- return /* @__PURE__ */ D("div", {
1728
- style: Fn,
1729
- children: [/* @__PURE__ */ E(T, {
1757
+ return /* @__PURE__ */ O("div", {
1758
+ style: Wn,
1759
+ children: [/* @__PURE__ */ D(E, {
1730
1760
  component: "h2",
1731
1761
  variant: "h3",
1732
1762
  children: "歷程"
1733
- }), f.length > 0 ? /* @__PURE__ */ E(me, {
1734
- currentStep: d,
1763
+ }), p.length > 0 ? /* @__PURE__ */ D(ye, {
1764
+ currentStep: f,
1735
1765
  orientation: "vertical",
1736
1766
  type: "dot",
1737
- children: f.map((e) => /* @__PURE__ */ E(Vn, {
1767
+ children: p.map((e) => /* @__PURE__ */ D(Xn, {
1738
1768
  descriptionParts: e.descriptionParts,
1739
1769
  error: e.error,
1740
1770
  forcePending: e.forcePending,
1741
1771
  title: e.title
1742
1772
  }, e.id))
1743
- }) : /* @__PURE__ */ E(T, {
1773
+ }) : /* @__PURE__ */ D(E, {
1744
1774
  color: "text-neutral",
1745
1775
  variant: "body",
1746
1776
  children: "尚無歷程紀錄。"
1747
1777
  })]
1748
1778
  });
1749
1779
  }
1750
- //#endregion
1751
- //#region src/views/instances/detail/sections/InstanceWebhookDeliveriesSection.tsx
1752
- var Wn = {
1780
+ // src/views/instances/detail/sections/InstanceWebhookDeliveriesSection.tsx
1781
+ var $n = {
1753
1782
  display: "grid",
1754
1783
  gap: 16
1755
- }, Gn = {
1784
+ }, er = {
1756
1785
  display: "grid",
1757
1786
  gap: 2
1758
- }, Kn = {
1787
+ }, tr = {
1759
1788
  overflowWrap: "anywhere",
1760
1789
  whiteSpace: "pre-wrap"
1761
1790
  };
1762
- function qn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1763
- let [r, i] = y(null), [a, o] = y(!1), [s, c] = y(null), l = _(() => e.map((e) => ({
1791
+ function nr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1792
+ let [r, i] = x(null), [a, o] = x(!1), [s, c] = x(null), l = b(() => e.map((e) => ({
1764
1793
  delivery: e,
1765
1794
  key: e.id
1766
- })), [e]), u = _(() => [
1795
+ })), [e]), u = b(() => [
1767
1796
  {
1768
1797
  key: "endpoint",
1769
- render: ({ delivery: e }) => /* @__PURE__ */ D("div", {
1770
- style: Gn,
1771
- children: [/* @__PURE__ */ E(T, {
1798
+ render: ({ delivery: e }) => /* @__PURE__ */ O("div", {
1799
+ style: er,
1800
+ children: [/* @__PURE__ */ D(E, {
1772
1801
  component: "span",
1773
1802
  variant: "body",
1774
1803
  children: e.endpointLabel ?? e.endpointKey
1775
- }), /* @__PURE__ */ D(T, {
1804
+ }), /* @__PURE__ */ O(E, {
1776
1805
  color: "text-neutral",
1777
1806
  component: "span",
1778
1807
  variant: "caption",
@@ -1791,13 +1820,13 @@ function qn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1791
1820
  },
1792
1821
  {
1793
1822
  key: "status",
1794
- render: ({ delivery: e }) => /* @__PURE__ */ E(Jn, { status: e.status }),
1823
+ render: ({ delivery: e }) => /* @__PURE__ */ D(rr, { status: e.status }),
1795
1824
  title: "狀態",
1796
1825
  width: 120
1797
1826
  },
1798
1827
  {
1799
1828
  key: "attemptCount",
1800
- render: ({ delivery: e }) => /* @__PURE__ */ E(T, {
1829
+ render: ({ delivery: e }) => /* @__PURE__ */ D(E, {
1801
1830
  component: "span",
1802
1831
  variant: "body",
1803
1832
  children: e.attemptCount
@@ -1807,21 +1836,21 @@ function qn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1807
1836
  },
1808
1837
  {
1809
1838
  key: "lastError",
1810
- render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ D("div", {
1811
- style: Gn,
1812
- children: [/* @__PURE__ */ E(T, {
1839
+ render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ O("div", {
1840
+ style: er,
1841
+ children: [/* @__PURE__ */ D(E, {
1813
1842
  color: "text-error",
1814
1843
  component: "span",
1815
1844
  variant: "body",
1816
1845
  children: e.lastErrorCode
1817
- }), e.lastErrorDetail ? /* @__PURE__ */ E(T, {
1846
+ }), e.lastErrorDetail ? /* @__PURE__ */ D(E, {
1818
1847
  color: "text-neutral",
1819
1848
  component: "span",
1820
- style: Kn,
1849
+ style: tr,
1821
1850
  variant: "caption",
1822
1851
  children: e.lastErrorDetail
1823
1852
  }) : null]
1824
- }) : /* @__PURE__ */ E(T, {
1853
+ }) : /* @__PURE__ */ D(E, {
1825
1854
  color: "text-neutral",
1826
1855
  component: "span",
1827
1856
  variant: "body",
@@ -1832,18 +1861,18 @@ function qn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1832
1861
  },
1833
1862
  {
1834
1863
  key: "time",
1835
- render: ({ delivery: e }) => /* @__PURE__ */ E(T, {
1864
+ render: ({ delivery: e }) => /* @__PURE__ */ D(E, {
1836
1865
  component: "span",
1837
1866
  variant: "body",
1838
- children: Yn(e)
1867
+ children: ir(e)
1839
1868
  }),
1840
1869
  title: "時間",
1841
1870
  width: 220
1842
1871
  }
1843
- ], [n]), d = _(() => ({
1872
+ ], [n]), d = b(() => ({
1844
1873
  render: ({ delivery: e }) => e.status === "FAILED" && e.attemptCount > 0 ? [{
1845
1874
  disabled: () => a,
1846
- icon: qe,
1875
+ icon: Qe,
1847
1876
  iconType: "leading",
1848
1877
  name: "重新傳送",
1849
1878
  onClick: () => {
@@ -1865,30 +1894,30 @@ function qn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1865
1894
  }
1866
1895
  }
1867
1896
  }
1868
- return /* @__PURE__ */ D("div", {
1869
- style: Wn,
1897
+ return /* @__PURE__ */ O("div", {
1898
+ style: $n,
1870
1899
  children: [
1871
- /* @__PURE__ */ E(T, {
1900
+ /* @__PURE__ */ D(E, {
1872
1901
  component: "h2",
1873
1902
  variant: "h3",
1874
1903
  children: "外部系統通知"
1875
1904
  }),
1876
- s ? /* @__PURE__ */ E(T, {
1905
+ s ? /* @__PURE__ */ D(E, {
1877
1906
  color: "text-error",
1878
1907
  variant: "body",
1879
1908
  children: s
1880
1909
  }) : null,
1881
- l.length > 0 ? /* @__PURE__ */ E(he, {
1910
+ l.length > 0 ? /* @__PURE__ */ D(be, {
1882
1911
  actions: d,
1883
1912
  columns: u,
1884
1913
  dataSource: l,
1885
1914
  fullWidth: !0
1886
- }) : /* @__PURE__ */ E(T, {
1915
+ }) : /* @__PURE__ */ D(E, {
1887
1916
  color: "text-neutral",
1888
1917
  variant: "body",
1889
1918
  children: "此案件沒有外部系統通知。"
1890
1919
  }),
1891
- /* @__PURE__ */ E(C, {
1920
+ /* @__PURE__ */ D(T, {
1892
1921
  cancelText: "取消",
1893
1922
  confirmText: "重新傳送",
1894
1923
  loading: a,
@@ -1902,7 +1931,7 @@ function qn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1902
1931
  showModalHeader: !0,
1903
1932
  supportingText: "會以相同的投遞編號重新送出,接收端可據此避免重複處理。",
1904
1933
  title: "重新傳送通知",
1905
- children: /* @__PURE__ */ D(T, {
1934
+ children: /* @__PURE__ */ O(E, {
1906
1935
  variant: "body",
1907
1936
  children: [
1908
1937
  "確定要重新通知「",
@@ -1914,49 +1943,47 @@ function qn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1914
1943
  ]
1915
1944
  });
1916
1945
  }
1917
- function Jn({ status: e }) {
1918
- return e === "SENT" ? /* @__PURE__ */ E(se, {
1946
+ function rr({ status: e }) {
1947
+ return e === "SENT" ? /* @__PURE__ */ D(de, {
1919
1948
  size: "sub",
1920
1949
  text: "已送達",
1921
1950
  variant: "dot-success"
1922
- }) : e === "FAILED" ? /* @__PURE__ */ E(se, {
1951
+ }) : e === "FAILED" ? /* @__PURE__ */ D(de, {
1923
1952
  size: "sub",
1924
1953
  text: "失敗",
1925
1954
  variant: "dot-error"
1926
- }) : /* @__PURE__ */ E(se, {
1955
+ }) : /* @__PURE__ */ D(de, {
1927
1956
  size: "sub",
1928
1957
  text: e === "PENDING" ? "等待傳送" : "傳送中",
1929
1958
  variant: "dot-info"
1930
1959
  });
1931
1960
  }
1932
- function Yn(e) {
1961
+ function ir(e) {
1933
1962
  return e.sentAt ? `送達:${t(e.sentAt)}` : e.status === "PENDING" && e.nextRetryAt ? `下次重試:${t(e.nextRetryAt)}` : e.lastAttemptAt ? `最後嘗試:${t(e.lastAttemptAt)}` : `建立:${t(e.createdAt)}`;
1934
1963
  }
1935
- //#endregion
1936
- //#region src/views/instances/viewer-field-access.ts
1937
- function Xn(e, t) {
1964
+ // src/views/instances/viewer-field-access.ts
1965
+ function ar(e, t) {
1938
1966
  let n = new Map(t.map((e) => [e.id, e]));
1939
1967
  return new Set(e.filter((e) => e.eventType === "TASK_CREATED").map((e) => e.taskId === null ? void 0 : n.get(e.taskId)).filter((e) => e !== void 0 && !e.isAdhoc).map((e) => e.nodeId));
1940
1968
  }
1941
- function Zn({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1969
+ function or({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1942
1970
  let i = n.workflowSnapshot;
1943
- return $e({
1971
+ return M({
1944
1972
  definition: i,
1945
1973
  fieldKeys: (n.formDefinitionSnapshot.schema?.fields ?? []).map((e) => e.fieldKey),
1946
1974
  isAdhocTask: t?.isAdhoc ?? !1,
1947
1975
  nodeId: t?.nodeId ?? null,
1948
- revealedFieldKeys: Ze(i, Xn(e, r))
1976
+ revealedFieldKeys: rt(i, ar(e, r))
1949
1977
  });
1950
1978
  }
1951
- //#endregion
1952
- //#region src/views/instances/detail/InstanceDetailView.tsx
1953
- function Qn(e) {
1954
- return `還有 ${new Set(Object.keys(e).map(Qe)).size} 個補填欄位需要完成`;
1979
+ // src/views/instances/detail/InstanceDetailView.tsx
1980
+ function sr(e) {
1981
+ return `還有 ${new Set(Object.keys(e).map(it)).size} 個補填欄位需要完成`;
1955
1982
  }
1956
- var $n = 3e3, er = 40, tr = 184, nr = 96, rr = {
1983
+ var cr = 3e3, lr = 40, ur = 184, dr = 96, fr = {
1957
1984
  display: "grid",
1958
1985
  gap: 16
1959
- }, ir = {
1986
+ }, pr = {
1960
1987
  background: "#f8fafc",
1961
1988
  border: "1px solid #e2e8f0",
1962
1989
  borderRadius: 8,
@@ -1964,7 +1991,7 @@ var $n = 3e3, er = 40, tr = 184, nr = 96, rr = {
1964
1991
  minHeight: 440,
1965
1992
  overflow: "hidden",
1966
1993
  width: "min(80vw, 1040px)"
1967
- }, ar = {
1994
+ }, mr = {
1968
1995
  background: "#ffffff",
1969
1996
  border: "1px solid #cbd5e1",
1970
1997
  borderRadius: 8,
@@ -1974,24 +2001,24 @@ var $n = 3e3, er = 40, tr = 184, nr = 96, rr = {
1974
2001
  minHeight: 82,
1975
2002
  padding: 12,
1976
2003
  width: 184
1977
- }, or = {
2004
+ }, hr = {
1978
2005
  borderRadius: 999,
1979
2006
  fontSize: 12,
1980
2007
  fontWeight: 600,
1981
2008
  justifySelf: "start",
1982
2009
  lineHeight: "18px",
1983
2010
  padding: "0 8px"
1984
- }, sr = {
2011
+ }, gr = {
1985
2012
  color: "#64748b",
1986
2013
  fontSize: 12,
1987
2014
  overflow: "hidden",
1988
2015
  textOverflow: "ellipsis",
1989
2016
  whiteSpace: "nowrap"
1990
- }, cr = { opacity: 0 }, lr = {
2017
+ }, _r = { opacity: 0 }, vr = {
1991
2018
  display: "flex",
1992
2019
  flexWrap: "wrap",
1993
2020
  gap: 8
1994
- }, ur = {
2021
+ }, yr = {
1995
2022
  alignItems: "center",
1996
2023
  background: "#ffffff",
1997
2024
  border: "1px solid #cbd5e1",
@@ -2003,29 +2030,29 @@ var $n = 3e3, er = 40, tr = 184, nr = 96, rr = {
2003
2030
  gap: 6,
2004
2031
  lineHeight: "20px",
2005
2032
  padding: "4px 8px"
2006
- }, dr = {
2033
+ }, br = {
2007
2034
  display: "grid",
2008
2035
  gap: 16
2009
- }, fr = { workflowRuntime: Sr };
2010
- function pr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHistory: re = !0, showSignatures: ie = !0, showTasks: ae = !0, showWebhookDeliveries: oe = !0 }) {
2011
- let { member: se } = e(), x = se?.memberId ?? null, ce = oe && r(se), [S, le] = y([]), [w, me] = y(null), [he, _e] = y([]), [ye, xe] = y([]), [Se, Ce] = y([]), [O, je] = y([]), [Me, Ne] = y(null), [k, ze] = y([]), [Be, He] = y([]), [Ue, qe] = y([]), [Ye, j] = y(null), [Ze, Qe] = y(!0), [$e, M] = y(!1), [P, F] = y(!1), [at, ot] = y(!1), [st, ct] = y(!1), [I, L] = y(""), [lt, ut] = y(!1), [dt, ft] = y({}), [R, pt] = y({}), { clearAfterResubmit: mt, comment: gt, setComment: _t } = fn(i), [yt, bt] = y({}), [z, B] = y(null), [xt, St] = y(null), [Ct, wt] = y([]), Tt = I.trim(), U = v(null), Dt = v(0), Ot = O.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
2012
- g(() => {
2013
- an();
2014
- }, [x, i]), g(() => {
2015
- if (!ce || !Ot || Dt.current >= er) return;
2036
+ }, xr = { workflowRuntime: jr };
2037
+ function Sr({ instanceId: i, showAttachments: o = !0, showForm: c = !0, showHistory: l = !0, showSignatures: u = !0, showTasks: d = !0, showWebhookDeliveries: f = !0 }) {
2038
+ let { member: ae } = n(), y = ae?.memberId ?? null, ce = f && r(ae), [ue, de] = x([]), [C, fe] = x(null), [w, pe] = x([]), [ve, ye] = x([]), [be, Se] = x([]), [we, Ee] = x([]), [De, Oe] = x(null), [k, Ie] = x([]), [Le, Re] = x([]), [Ve, Ge] = x([]), [Ke, A] = x(null), [Je, Qe] = x(!0), [tt, j] = x(!1), [rt, it] = x(!1), [M, ot] = x(!1), [ct, dt] = x(!1), [P, pt] = x(""), [mt, ht] = x(!1), [gt, F] = x({}), [I, vt] = x({}), { clearAfterResubmit: yt, comment: bt, setComment: xt } = bn(i), [St, Ct] = x({}), [L, Tt] = x(null), [Et, Ot] = x(null), [kt, R] = x([]), At = P.trim(), z = le(null), jt = le(0), Mt = we.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
2039
+ se(() => {
2040
+ Q();
2041
+ }, [y, i]), se(() => {
2042
+ if (!ce || !Mt || jt.current >= lr) return;
2016
2043
  let e = setTimeout(() => {
2017
- Dt.current += 1, ln();
2018
- }, $n);
2044
+ jt.current += 1, fn();
2045
+ }, cr);
2019
2046
  return () => clearTimeout(e);
2020
2047
  }, [
2021
2048
  ce,
2022
- Ot,
2023
- O
2024
- ]), g(() => {
2025
- pt(w?.formData ?? {}), bt({});
2026
- }, [w]);
2027
- let At = h((e, t) => {
2028
- bt((n) => {
2049
+ Mt,
2050
+ we
2051
+ ]), se(() => {
2052
+ vt(C?.formData ?? {}), Ct({});
2053
+ }, [C]);
2054
+ let Nt = oe((e, t) => {
2055
+ Ct((n) => {
2029
2056
  let r = n[e];
2030
2057
  return r?.hasValue === t.hasValue && r.status === t.status ? n : {
2031
2058
  ...n,
@@ -2035,273 +2062,274 @@ function pr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHis
2035
2062
  }
2036
2063
  };
2037
2064
  });
2038
- }, []), G = _(() => jt(k, x), [x, k]), K = _(() => G && w ? w.workflowSnapshot.nodes.find((e) => e.id === G.nodeId) ?? null : null, [G, w]), Mt = K?.type === "userTask" && K.data.returnBehavior.allowReturn, Nt = K?.type === "userTask" && K.data.allowReject !== !1, Pt = K?.type === "userTask" && K.data.allowTransfer !== !1, Ft = K?.type === "userTask" && K.data.allowAddSigner, It = !(!w || w.initiatorMemberId !== x || w.state !== "RUNNING" && w.state !== "RETURNED"), q = !!(w && w.initiatorMemberId === x && w.state === "RETURNED"), J = _(() => G && !G.isAdhoc && K?.type === "userTask" && Xe(K).size > 0 ? K : null, [G, K]), Lt = J ? G?.id ?? null : null, [Y, Rt] = y({}), [zt, Bt] = y({}), [Vt, Ht] = y(!1);
2039
- g(() => {
2040
- Rt({}), Bt({}), Ht(!1);
2041
- }, [Lt]);
2042
- let X = w?.formDefinitionSnapshot.schema ?? null, Z = _(() => J && X ? o(X, J) : null, [J, X]), Q = _(() => Z && w ? et(Z.fields, {
2043
- ...w.formData,
2044
- ...Y
2065
+ }, []), H = b(() => Bt(k, y), [y, k]), U = b(() => H && C ? C.workflowSnapshot.nodes.find((e) => e.id === H.nodeId) ?? null : null, [H, C]), Ft = U?.type === "userTask" && U.data.returnBehavior.allowReturn, It = U?.type === "userTask" && U.data.allowReject !== !1, Rt = U?.type === "userTask" && U.data.allowTransfer !== !1, zt = U?.type === "userTask" && U.data.allowAddSigner, Vt = !(!C || C.initiatorMemberId !== y || C.state !== "RUNNING" && C.state !== "RETURNED"), Ht = !!(C && C.initiatorMemberId === y && C.state === "RETURNED"), G = b(() => H && !H.isAdhoc && U?.type === "userTask" && nt(U).size > 0 ? U : null, [H, U]), Ut = G ? H?.id ?? null : null, [Wt, Gt] = x({}), [K, q] = x({}), [Kt, J] = x(!1);
2066
+ se(() => {
2067
+ Gt({}), q({}), J(!1);
2068
+ }, [Ut]);
2069
+ let Y = C?.formDefinitionSnapshot.schema ?? null, X = b(() => G && Y ? p(Y, G) : null, [G, Y]), Z = b(() => X && C ? N(X.fields, {
2070
+ ...C.formData,
2071
+ ...Wt
2045
2072
  }) : null, [
2046
- Y,
2047
- Z,
2048
- w
2049
- ]), Ut = _(() => J && Z && Q && w ? c({
2050
- draft: Y,
2051
- node: J,
2052
- schema: Z,
2053
- stored: w.formData,
2054
- values: Q
2073
+ Wt,
2074
+ X,
2075
+ C
2076
+ ]), qt = b(() => G && X && Z && C ? g({
2077
+ draft: Wt,
2078
+ node: G,
2079
+ schema: X,
2080
+ stored: C.formData,
2081
+ values: Z
2055
2082
  }) : {}, [
2056
- Y,
2057
- J,
2083
+ Wt,
2084
+ G,
2085
+ X,
2058
2086
  Z,
2059
- Q,
2060
- w
2061
- ]), Wt = _(() => w ? Zn({
2062
- activityLogs: S,
2063
- actingTask: G,
2064
- instance: w,
2087
+ C
2088
+ ]), Jt = b(() => C ? or({
2089
+ activityLogs: ue,
2090
+ actingTask: H,
2091
+ instance: C,
2065
2092
  tasks: k
2066
2093
  }) : void 0, [
2067
- S,
2068
- G,
2069
- w,
2094
+ ue,
2095
+ H,
2096
+ C,
2070
2097
  k
2071
- ]), Gt = _(() => w ? d(w.workflowSnapshot, J) : void 0, [J, w]), Kt = _(() => new Map(Ue.map((e) => [e.memberId, e])), [Ue]), qt = _(() => J && Q && X && w?.formDataFingerprint ? {
2072
- expectedFormDataFingerprint: w.formDataFingerprint,
2073
- formData: p(Ut, J),
2074
- summary: l(X, J, Ut, new Map([...Kt.keys()].map((e) => [e, W(e, Kt)])))
2098
+ ]), Yt = b(() => C ? ne(C.workflowSnapshot, G) : void 0, [G, C]), Xt = b(() => new Map(Ve.map((e) => [e.memberId, e])), [Ve]), Zt = _t(b(() => Y ? re(Y, qt) : [], [qt, Y])), Qt = b(() => G && Z && Y && C?.formDataFingerprint ? {
2099
+ expectedFormDataFingerprint: C.formDataFingerprint,
2100
+ formData: m(qt, G),
2101
+ summary: v(Y, G, qt, new Map([...Xt.keys()].map((e) => [e, W(e, Xt)])), Zt)
2075
2102
  } : null, [
2076
- Ut,
2077
- J,
2078
- Q,
2079
- w,
2080
- Kt,
2081
- X
2103
+ qt,
2104
+ G,
2105
+ Zt,
2106
+ Z,
2107
+ C,
2108
+ Xt,
2109
+ Y
2082
2110
  ]);
2083
- function Jt(e) {
2084
- if (!J) return;
2085
- let t = Xe(J), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Q?.[e]));
2086
- Rt((e) => ({
2111
+ function $t(e) {
2112
+ if (!G) return;
2113
+ let t = nt(G), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Z?.[e]));
2114
+ Gt((e) => ({
2087
2115
  ...e,
2088
2116
  ...Object.fromEntries(n)
2089
- })), Bt({});
2117
+ })), q({});
2090
2118
  }
2091
- async function Yt() {
2092
- if (J && !w?.formDataFingerprint) ue.error("無法確認表單版本,請重新整理頁面後再同意。");
2119
+ async function en() {
2120
+ if (G && !C?.formDataFingerprint) me.error("無法確認表單版本,請重新整理頁面後再同意。");
2093
2121
  else {
2094
- if (J && Q && X && w?.formDefinitionSnapshot.uiSchema) {
2095
- F(!0);
2096
- let e = await nt({
2097
- schema: te(X, J),
2098
- uiSchema: w.formDefinitionSnapshot.uiSchema,
2099
- values: Q
2100
- }).catch((e) => (ue.error(H(e)), null)).finally(() => F(!1));
2122
+ if (G && Z && Y && C?.formDefinitionSnapshot.uiSchema) {
2123
+ it(!0);
2124
+ let e = await st({
2125
+ schema: h(Y, G),
2126
+ uiSchema: C.formDefinitionSnapshot.uiSchema,
2127
+ values: Z
2128
+ }).catch((e) => (me.error(V(e)), null)).finally(() => it(!1));
2101
2129
  if (!e) return;
2102
2130
  if (!e.valid) {
2103
- Bt(e.errors), e.firstInvalidFieldKey && tt(e.firstInvalidFieldKey), ue.warning(Qn(e.errors));
2131
+ q(e.errors), e.firstInvalidFieldKey && at(e.firstInvalidFieldKey), me.warning(sr(e.errors));
2104
2132
  return;
2105
2133
  }
2106
2134
  }
2107
- U.current?.handleApprove();
2135
+ z.current?.handleApprove();
2108
2136
  }
2109
2137
  }
2110
- function Xt(e) {
2111
- if (!J || !X) return !1;
2112
- if (ee(e)) return Ht(!0), !0;
2113
- let t = s(e, X, J);
2114
- return t ? (Bt(t), tt(Object.keys(t)[0] ?? ""), ue.warning(Qn(t)), !0) : !1;
2138
+ function tn(e) {
2139
+ if (!G || !Y) return !1;
2140
+ if (ie(e)) return J(!0), !0;
2141
+ let t = ee(e, Y, G);
2142
+ return t ? (q(t), at(Object.keys(t)[0] ?? ""), me.warning(sr(t)), !0) : !1;
2115
2143
  }
2116
- async function Zt() {
2117
- await an(), Ht(!1);
2144
+ async function nn() {
2145
+ await Q(), J(!1);
2118
2146
  }
2119
- let Qt = _(() => dn(he), [he]), $t = _(() => new Map(Se.map((e) => [e.id, e])), [Se]), en = _(() => w ? vr(w.workflowSnapshot) : null, [w]), tn = _(() => w && en ? _r(en, k, Be, w.state) : [], [
2120
- w,
2121
- en,
2147
+ let rn = b(() => s(w), [w]), an = b(() => new Map(be.map((e) => [e.id, e])), [be]), on = b(() => C ? Dr(C.workflowSnapshot) : null, [C]), sn = b(() => C && on ? Er(on, k, Le, C.state) : [], [
2148
+ C,
2149
+ on,
2122
2150
  k,
2123
- Be
2124
- ]), nn = _(() => en ? yr(en) : [], [en]), rn = _(() => w ? hr(w.workflowSnapshot) : [], [w]);
2125
- async function an() {
2126
- Qe(!0), j(null);
2151
+ Le
2152
+ ]), cn = b(() => on ? Or(on) : [], [on]), ln = b(() => C ? wr(C.workflowSnapshot) : [], [C]);
2153
+ async function Q() {
2154
+ Qe(!0), A(null);
2127
2155
  try {
2128
- let e = await De(i);
2129
- le(e.activityLogs), me(e.instance), ze(e.tasks), He(e.workflowTokens);
2130
- let t = await we(e.instance.id), [n, r, a, o, s] = await Promise.all([
2131
- un(e.tasks),
2132
- cn({
2156
+ let e = await Me(i);
2157
+ de(e.activityLogs), fe(e.instance), Ie(e.tasks), Re(e.workflowTokens);
2158
+ let t = await ke(e.instance.id), [n, r, a, o, s] = await Promise.all([
2159
+ yn(e.tasks),
2160
+ vn({
2133
2161
  ...e,
2134
2162
  adhocDirectives: t
2135
2163
  }),
2136
- Te(e.instance.id),
2137
2164
  Ae(e.instance.id),
2138
- on(e.instance.id)
2165
+ Fe(e.instance.id),
2166
+ un(e.instance.id)
2139
2167
  ]);
2140
- _e(n), qe(r), xe(a), Ce(o.signatures), Ne(o.verification), wt(t), je(s);
2168
+ pe(n), Ge(r), ye(a), Se(o.signatures), Oe(o.verification), R(t), Ee(s);
2141
2169
  } catch (e) {
2142
- j(H(e));
2170
+ A(V(e));
2143
2171
  } finally {
2144
2172
  Qe(!1);
2145
2173
  }
2146
2174
  }
2147
- async function on(e) {
2148
- return ce ? Ee(e).catch(() => []) : [];
2175
+ async function un(e) {
2176
+ return ce ? je(e).catch(() => []) : [];
2149
2177
  }
2150
- async function sn(e) {
2151
- await Fe(e.id), Dt.current = 0, await an();
2178
+ async function dn(e) {
2179
+ await Be(e.id), jt.current = 0, await Q();
2152
2180
  }
2153
- async function ln() {
2154
- let e = await on(i);
2155
- e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? je(e) : await an();
2181
+ async function fn() {
2182
+ let e = await un(i);
2183
+ e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? Ee(e) : await Q();
2156
2184
  }
2157
2185
  async function pn(e, t) {
2158
- if (!x) throw Error("尚未登入,無法上傳附件");
2159
- return { id: (await Ie({
2186
+ if (!y) throw Error("尚未登入,無法上傳附件");
2187
+ return { id: (await He({
2160
2188
  file: t,
2161
2189
  formFieldPath: `form.${e.fieldKey}`
2162
2190
  })).id };
2163
2191
  }
2164
2192
  async function mn(e) {
2165
- if (!x) return;
2166
- let t = await Oe({ id: e.id });
2193
+ if (!y) return;
2194
+ let t = await Ne({ id: e.id });
2167
2195
  window.open(t, "_blank", "noopener,noreferrer");
2168
2196
  }
2169
2197
  async function hn(e) {
2170
- if (!x) return;
2171
- let t = await ke({ id: e.id });
2172
- B(e), St(t);
2198
+ if (!y) return;
2199
+ let t = await Pe({ id: e.id });
2200
+ Tt(e), Ot(t);
2173
2201
  }
2174
2202
  async function gn() {
2175
- if (x && w && It) {
2176
- M(!0), j(null), ft({});
2203
+ if (y && C && Vt) {
2204
+ j(!0), A(null), F({});
2177
2205
  try {
2178
- await be({
2179
- cancelledByMemberId: x,
2180
- comment: Tt || null,
2181
- instanceId: w.id
2182
- }), L(""), ut(!1), await an();
2206
+ await Te({
2207
+ cancelledByMemberId: y,
2208
+ comment: At || null,
2209
+ instanceId: C.id
2210
+ }), pt(""), ht(!1), await Q();
2183
2211
  } catch (e) {
2184
- j(H(e));
2212
+ A(V(e));
2185
2213
  } finally {
2186
- M(!1);
2214
+ j(!1);
2187
2215
  }
2188
2216
  }
2189
2217
  }
2190
2218
  async function _n() {
2191
- if (!x || !w || !q) return;
2192
- M(!0), j(null), ft({});
2193
- let e = m(Object.values(yt));
2219
+ if (!y || !C || !Ht) return;
2220
+ j(!0), A(null), F({});
2221
+ let e = a(Object.values(St));
2194
2222
  if (e) {
2195
- j(e), M(!1);
2223
+ A(e), j(!1);
2196
2224
  return;
2197
2225
  }
2198
- let t = w.formDefinitionSnapshot.schema ? u(w.formDefinitionSnapshot.schema, w.workflowSnapshot) : null, n = f(t ? et(t.fields, R) : R, w.workflowSnapshot);
2226
+ let t = C.formDefinitionSnapshot.schema ? te(C.formDefinitionSnapshot.schema, C.workflowSnapshot) : null, n = _(t ? N(t.fields, I) : I, C.workflowSnapshot);
2199
2227
  try {
2200
- if (t && w.formDefinitionSnapshot.uiSchema) {
2201
- let e = await nt({
2228
+ if (t && C.formDefinitionSnapshot.uiSchema) {
2229
+ let e = await st({
2202
2230
  schema: t,
2203
- uiSchema: w.formDefinitionSnapshot.uiSchema,
2231
+ uiSchema: C.formDefinitionSnapshot.uiSchema,
2204
2232
  values: n
2205
2233
  });
2206
2234
  if (!e.valid) {
2207
- ft(e.errors), j("請先修正表單中標示的欄位。"), e.firstInvalidFieldKey && tt(e.firstInvalidFieldKey);
2235
+ F(e.errors), A("請先修正表單中標示的欄位。"), e.firstInvalidFieldKey && at(e.firstInvalidFieldKey);
2208
2236
  return;
2209
2237
  }
2210
2238
  }
2211
- await Pe({
2212
- comment: gt,
2239
+ await ze({
2240
+ comment: bt,
2213
2241
  formData: n,
2214
- initiatorMemberId: x,
2215
- instanceId: w.id,
2216
- title: w.title
2217
- }), mt(w.id), await an();
2242
+ initiatorMemberId: y,
2243
+ instanceId: C.id,
2244
+ title: C.title
2245
+ }), yt(C.id), await Q();
2218
2246
  } catch (e) {
2219
- j(H(e));
2247
+ A(V(e));
2220
2248
  } finally {
2221
- M(!1);
2249
+ j(!1);
2222
2250
  }
2223
2251
  }
2224
- let $ = $e || at || P;
2225
- return /* @__PURE__ */ D(ve, { children: [
2226
- /* @__PURE__ */ E(de, { children: /* @__PURE__ */ D(Le, {
2227
- description: w ? [
2228
- Et(w.state),
2229
- t(w.startedAt),
2230
- vt(w, Kt)
2231
- ].filter(V).join(" · ") : "載入案件內容。",
2232
- title: w?.title ?? "簽核案件",
2252
+ let $ = tt || M || rt;
2253
+ return /* @__PURE__ */ O(Ce, { children: [
2254
+ /* @__PURE__ */ D(he, { children: /* @__PURE__ */ O(Ue, {
2255
+ description: C ? [
2256
+ Pt(C.state),
2257
+ t(C.startedAt),
2258
+ Dt(C, Xt)
2259
+ ].filter(B).join(" · ") : "載入案件內容。",
2260
+ title: C?.title ?? "簽核案件",
2233
2261
  children: [
2234
- w ? /* @__PURE__ */ E(b, {
2262
+ C ? /* @__PURE__ */ D(S, {
2235
2263
  "aria-label": "查看流程圖",
2236
- icon: A,
2264
+ icon: $e,
2237
2265
  iconType: "icon-only",
2238
- onClick: () => ct(!0),
2266
+ onClick: () => dt(!0),
2239
2267
  title: "查看流程圖",
2240
2268
  variant: "base-secondary",
2241
2269
  children: "流程圖"
2242
2270
  }) : null,
2243
- It ? /* @__PURE__ */ E(b, {
2271
+ Vt ? /* @__PURE__ */ D(S, {
2244
2272
  disabled: $,
2245
- icon: Ve,
2273
+ icon: qe,
2246
2274
  iconType: "leading",
2247
- onClick: () => ut(!0),
2275
+ onClick: () => ht(!0),
2248
2276
  variant: "destructive-secondary",
2249
2277
  children: "取消案件"
2250
2278
  }) : null,
2251
- G ? /* @__PURE__ */ D(ve, { children: [
2252
- Ft ? /* @__PURE__ */ D(ve, { children: [/* @__PURE__ */ E(b, {
2279
+ H ? /* @__PURE__ */ O(Ce, { children: [
2280
+ zt ? /* @__PURE__ */ O(Ce, { children: [/* @__PURE__ */ D(S, {
2253
2281
  disabled: $,
2254
- icon: Ge,
2282
+ icon: Xe,
2255
2283
  iconType: "leading",
2256
- onClick: () => U.current?.openAdhocModal("COUNTERSIGN"),
2284
+ onClick: () => z.current?.openAdhocModal("COUNTERSIGN"),
2257
2285
  variant: "base-secondary",
2258
2286
  children: "會簽"
2259
- }, "adhoc-countersign"), /* @__PURE__ */ E(b, {
2287
+ }, "adhoc-countersign"), /* @__PURE__ */ D(S, {
2260
2288
  disabled: $,
2261
- icon: Ge,
2289
+ icon: Xe,
2262
2290
  iconType: "leading",
2263
- onClick: () => U.current?.openAdhocModal("PRE_APPROVAL"),
2291
+ onClick: () => z.current?.openAdhocModal("PRE_APPROVAL"),
2264
2292
  variant: "base-secondary",
2265
2293
  children: "加簽"
2266
2294
  }, "adhoc-pre-approval")] }) : null,
2267
- /* @__PURE__ */ E(b, {
2295
+ /* @__PURE__ */ D(S, {
2268
2296
  disabled: $,
2269
- icon: We,
2297
+ icon: Ye,
2270
2298
  iconType: "leading",
2271
- onClick: () => U.current?.openAdhocModal("STAGE_NOTIFY"),
2299
+ onClick: () => z.current?.openAdhocModal("STAGE_NOTIFY"),
2272
2300
  variant: "base-secondary",
2273
2301
  children: "通知設定"
2274
2302
  }, "adhoc-notify"),
2275
- Mt ? /* @__PURE__ */ E(b, {
2303
+ Ft ? /* @__PURE__ */ D(S, {
2276
2304
  disabled: $,
2277
- icon: Ke,
2305
+ icon: Ze,
2278
2306
  iconType: "leading",
2279
- onClick: () => U.current?.openReturnModal(),
2307
+ onClick: () => z.current?.openReturnModal(),
2280
2308
  variant: "base-secondary",
2281
2309
  children: "退回"
2282
2310
  }, "task-return") : null,
2283
- Pt ? /* @__PURE__ */ E(b, {
2311
+ Rt ? /* @__PURE__ */ D(S, {
2284
2312
  disabled: $,
2285
- icon: Je,
2313
+ icon: et,
2286
2314
  iconType: "leading",
2287
- onClick: () => U.current?.openTransferModal(),
2315
+ onClick: () => z.current?.openTransferModal(),
2288
2316
  variant: "base-secondary",
2289
2317
  children: "轉派"
2290
2318
  }, "task-transfer") : null,
2291
- Nt ? /* @__PURE__ */ E(b, {
2319
+ It ? /* @__PURE__ */ D(S, {
2292
2320
  disabled: $,
2293
- icon: Ve,
2321
+ icon: qe,
2294
2322
  iconType: "leading",
2295
- onClick: () => U.current?.openRejectModal(),
2323
+ onClick: () => z.current?.openRejectModal(),
2296
2324
  variant: "destructive-secondary",
2297
2325
  children: "拒絕"
2298
2326
  }, "task-reject") : null,
2299
- /* @__PURE__ */ E(b, {
2327
+ /* @__PURE__ */ D(S, {
2300
2328
  disabled: $,
2301
- icon: Re,
2329
+ icon: We,
2302
2330
  iconType: "leading",
2303
2331
  onClick: () => {
2304
- Yt();
2332
+ en();
2305
2333
  },
2306
2334
  variant: "base-primary",
2307
2335
  children: "同意"
@@ -2309,36 +2337,36 @@ function pr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHis
2309
2337
  ] }) : null
2310
2338
  ]
2311
2339
  }) }),
2312
- /* @__PURE__ */ D(pe, { children: [
2313
- ne ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(vn, {
2314
- canResubmitInstance: q,
2315
- deciding: $e,
2316
- error: Ye,
2317
- fieldAccess: Wt,
2318
- fieldLabelMarkers: Gt,
2319
- fill: Z && Q && J ? {
2320
- errors: zt,
2321
- fieldCount: Xe(J).size,
2322
- onChange: Jt,
2323
- schema: Z,
2324
- value: Q
2340
+ /* @__PURE__ */ O(_e, { children: [
2341
+ c ? /* @__PURE__ */ D(ge, { children: /* @__PURE__ */ D(En, {
2342
+ canResubmitInstance: Ht,
2343
+ deciding: tt,
2344
+ error: Ke,
2345
+ fieldAccess: Jt,
2346
+ fieldLabelMarkers: Yt,
2347
+ fill: X && Z && G ? {
2348
+ errors: K,
2349
+ fieldCount: nt(G).size,
2350
+ onChange: $t,
2351
+ schema: X,
2352
+ value: Z
2325
2353
  } : null,
2326
- instance: w,
2327
- loading: Ze,
2328
- onDataSourceStateChange: At,
2329
- onReloadAfterConflict: Vt ? () => void Zt() : null,
2354
+ instance: C,
2355
+ loading: Je,
2356
+ onDataSourceStateChange: Nt,
2357
+ onReloadAfterConflict: Kt ? () => void nn() : null,
2330
2358
  onResubmitFormChange: (e) => {
2331
- pt(e), ft({});
2359
+ vt(e), F({});
2332
2360
  },
2333
- onResubmitCommentChange: _t,
2361
+ onResubmitCommentChange: xt,
2334
2362
  onResubmitInstance: () => void _n(),
2335
2363
  onUploadAttachment: pn,
2336
- resubmitComment: gt,
2337
- resubmitFormData: R,
2338
- resubmitFormErrors: dt
2364
+ resubmitComment: bt,
2365
+ resubmitFormData: I,
2366
+ resubmitFormErrors: gt
2339
2367
  }) }) : null,
2340
- a ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(yn, {
2341
- attachments: ye,
2368
+ o ? /* @__PURE__ */ D(ge, { children: /* @__PURE__ */ D(On, {
2369
+ attachments: ve,
2342
2370
  onDownload: (e) => {
2343
2371
  mn(e);
2344
2372
  },
@@ -2346,145 +2374,146 @@ function pr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHis
2346
2374
  hn(e);
2347
2375
  }
2348
2376
  }) }) : null,
2349
- ae ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(An, {
2350
- adhocDirectives: Ct,
2351
- currentMemberId: x,
2352
- fill: qt,
2353
- instance: w,
2354
- memberProfilesById: Kt,
2355
- onChanged: an,
2377
+ d ? /* @__PURE__ */ D(ge, { children: /* @__PURE__ */ D(zn, {
2378
+ adhocDirectives: kt,
2379
+ currentMemberId: y,
2380
+ fill: Qt,
2381
+ instance: C,
2382
+ memberProfilesById: Xt,
2383
+ onChanged: Q,
2356
2384
  onDecidingChange: ot,
2357
- onFillApproveError: Xt,
2358
- ref: U,
2385
+ onFillApproveError: tn,
2386
+ ref: z,
2359
2387
  tasks: k
2360
2388
  }) }) : null,
2361
- ie ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(Pn, {
2362
- signatureVerification: Me,
2363
- signatures: Se
2389
+ u ? /* @__PURE__ */ D(ge, { children: /* @__PURE__ */ D(Un, {
2390
+ signatureVerification: De,
2391
+ signatures: be
2364
2392
  }) }) : null,
2365
- ce && O.length > 0 ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(qn, {
2366
- deliveries: O,
2367
- onRetry: sn,
2368
- readNodeLabel: (e) => kt(e, w?.workflowSnapshot ?? null)
2393
+ ce && we.length > 0 ? /* @__PURE__ */ D(ge, { children: /* @__PURE__ */ D(nr, {
2394
+ deliveries: we,
2395
+ onRetry: dn,
2396
+ readNodeLabel: (e) => Lt(e, C?.workflowSnapshot ?? null)
2369
2397
  }) }) : null,
2370
- re ? /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ E(Un, {
2371
- activityLogs: S,
2372
- formSchema: X,
2373
- instanceState: w?.state ?? "RUNNING",
2374
- memberProfilesById: Kt,
2375
- signatureVerification: Me,
2376
- signaturesById: $t,
2377
- taskDecisionsByTaskId: Qt,
2398
+ l ? /* @__PURE__ */ D(ge, { children: /* @__PURE__ */ D(Qn, {
2399
+ activityLogs: ue,
2400
+ formSchema: Y,
2401
+ instanceState: C?.state ?? "RUNNING",
2402
+ memberProfilesById: Xt,
2403
+ signatureVerification: De,
2404
+ signaturesById: an,
2405
+ taskDecisions: w,
2406
+ taskDecisionsByTaskId: rn,
2378
2407
  tasks: k,
2379
- workflowSnapshot: w?.workflowSnapshot ?? null,
2380
- workflowTokens: Be
2408
+ workflowSnapshot: C?.workflowSnapshot ?? null,
2409
+ workflowTokens: Le
2381
2410
  }) }) : null
2382
2411
  ] }),
2383
- w ? /* @__PURE__ */ E(C, {
2412
+ C ? /* @__PURE__ */ D(T, {
2384
2413
  modalType: "standard",
2385
- onClose: () => ct(!1),
2386
- open: st,
2414
+ onClose: () => dt(!1),
2415
+ open: ct,
2387
2416
  showModalHeader: !0,
2388
2417
  size: "wide",
2389
- supportingText: `${Et(w.state)} · ${t(w.startedAt)}`,
2418
+ supportingText: `${Pt(C.state)} · ${t(C.startedAt)}`,
2390
2419
  title: "流程圖",
2391
- children: /* @__PURE__ */ D("div", {
2392
- style: rr,
2393
- children: [/* @__PURE__ */ E("div", {
2394
- style: ir,
2395
- children: /* @__PURE__ */ D(it, {
2396
- edges: nn,
2420
+ children: /* @__PURE__ */ O("div", {
2421
+ style: fr,
2422
+ children: [/* @__PURE__ */ D("div", {
2423
+ style: pr,
2424
+ children: /* @__PURE__ */ O(ft, {
2425
+ edges: cn,
2397
2426
  fitView: !0,
2398
2427
  fitViewOptions: { padding: .18 },
2399
2428
  maxZoom: 1.2,
2400
2429
  minZoom: .2,
2401
- nodes: tn,
2430
+ nodes: sn,
2402
2431
  nodesDraggable: !1,
2403
2432
  nodesFocusable: !1,
2404
- nodeTypes: fr,
2433
+ nodeTypes: xr,
2405
2434
  panOnDrag: !0,
2406
2435
  proOptions: { hideAttribution: !0 },
2407
- children: [/* @__PURE__ */ E(rt, {}), /* @__PURE__ */ E(N, { showInteractive: !1 })]
2436
+ children: [/* @__PURE__ */ D(lt, {}), /* @__PURE__ */ D(ut, { showInteractive: !1 })]
2408
2437
  })
2409
- }), rn.length > 0 ? /* @__PURE__ */ E("div", {
2410
- style: lr,
2411
- children: rn.map((e) => /* @__PURE__ */ E("span", {
2412
- style: ur,
2438
+ }), ln.length > 0 ? /* @__PURE__ */ D("div", {
2439
+ style: vr,
2440
+ children: ln.map((e) => /* @__PURE__ */ D("span", {
2441
+ style: yr,
2413
2442
  children: e
2414
2443
  }, e))
2415
2444
  }) : null]
2416
2445
  })
2417
2446
  }) : null,
2418
- /* @__PURE__ */ E(C, {
2447
+ /* @__PURE__ */ D(T, {
2419
2448
  modalType: "standard",
2420
2449
  onClose: () => {
2421
- B(null), St(null);
2450
+ Tt(null), Ot(null);
2422
2451
  },
2423
- open: !!(z && xt),
2452
+ open: !!(L && Et),
2424
2453
  showModalHeader: !0,
2425
2454
  size: "wide",
2426
- supportingText: z?.filename ?? void 0,
2455
+ supportingText: L?.filename ?? void 0,
2427
2456
  title: "PDF 預覽",
2428
- children: xt ? /* @__PURE__ */ E(ht, {
2429
- filename: z?.filename ?? "PDF 預覽",
2430
- fileUrl: xt,
2431
- onDownload: z ? () => void mn(z) : void 0
2457
+ children: Et ? /* @__PURE__ */ D(wt, {
2458
+ filename: L?.filename ?? "PDF 預覽",
2459
+ fileUrl: Et,
2460
+ onDownload: L ? () => void mn(L) : void 0
2432
2461
  }) : null
2433
2462
  }),
2434
- /* @__PURE__ */ E(C, {
2463
+ /* @__PURE__ */ D(T, {
2435
2464
  cancelText: "保留案件",
2436
2465
  confirmButtonProps: { variant: "destructive-primary" },
2437
2466
  confirmText: "確認取消",
2438
- loading: $e,
2467
+ loading: tt,
2439
2468
  modalStatusType: "error",
2440
2469
  modalType: "standard",
2441
- onCancel: () => ut(!1),
2442
- onClose: () => ut(!1),
2470
+ onCancel: () => ht(!1),
2471
+ onClose: () => ht(!1),
2443
2472
  onConfirm: () => void gn(),
2444
- open: lt,
2473
+ open: mt,
2445
2474
  showModalFooter: !0,
2446
2475
  showModalHeader: !0,
2447
2476
  supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
2448
2477
  title: "取消案件",
2449
- children: /* @__PURE__ */ D("div", {
2450
- style: dr,
2451
- children: [/* @__PURE__ */ D(T, {
2478
+ children: /* @__PURE__ */ O("div", {
2479
+ style: br,
2480
+ children: [/* @__PURE__ */ O(E, {
2452
2481
  variant: "body",
2453
2482
  children: [
2454
2483
  "確定要取消「",
2455
- w?.title ?? "",
2484
+ C?.title ?? "",
2456
2485
  "」嗎?"
2457
2486
  ]
2458
- }), /* @__PURE__ */ E(n, {
2487
+ }), /* @__PURE__ */ D(e, {
2459
2488
  label: "取消原因",
2460
2489
  name: "cancelComment",
2461
- children: /* @__PURE__ */ E(ge, {
2462
- onChange: (e) => L(e.target.value),
2490
+ children: /* @__PURE__ */ D(xe, {
2491
+ onChange: (e) => pt(e.target.value),
2463
2492
  placeholder: "可填寫取消原因",
2464
2493
  resize: "vertical",
2465
2494
  rows: 3,
2466
- value: I
2495
+ value: P
2467
2496
  })
2468
2497
  })]
2469
2498
  })
2470
2499
  })
2471
2500
  ] });
2472
2501
  }
2473
- function mr(e) {
2502
+ function Cr(e) {
2474
2503
  return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
2475
2504
  }
2476
- function hr(e) {
2477
- return e.edges.map(mr).filter((e) => e.trim().length > 0);
2505
+ function wr(e) {
2506
+ return e.edges.map(Cr).filter((e) => e.trim().length > 0);
2478
2507
  }
2479
- function gr(e) {
2508
+ function Tr(e) {
2480
2509
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
2481
2510
  }
2482
- function _r(e, t, n, r) {
2511
+ function Er(e, t, n, r) {
2483
2512
  return e.nodes.map((e) => {
2484
- let i = sn(e, t, n, r);
2513
+ let i = _n(e, t, n, r);
2485
2514
  return {
2486
2515
  data: {
2487
- kindLabel: gr(e.type),
2516
+ kindLabel: Tr(e.type),
2488
2517
  label: e.data.label,
2489
2518
  secondaryLabel: i.secondaryLabel,
2490
2519
  statusLabel: i.statusLabel,
@@ -2492,42 +2521,42 @@ function _r(e, t, n, r) {
2492
2521
  },
2493
2522
  id: e.id,
2494
2523
  position: e.position,
2495
- sourcePosition: F.Right,
2496
- targetPosition: F.Left,
2524
+ sourcePosition: P.Right,
2525
+ targetPosition: P.Left,
2497
2526
  type: "workflowRuntime"
2498
2527
  };
2499
2528
  });
2500
2529
  }
2501
- function vr(e) {
2502
- let t = new at.graphlib.Graph();
2530
+ function Dr(e) {
2531
+ let t = new pt.graphlib.Graph();
2503
2532
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
2504
2533
  nodesep: 56,
2505
2534
  rankdir: "LR",
2506
2535
  ranksep: 120
2507
2536
  }), e.nodes.forEach((e) => {
2508
2537
  t.setNode(e.id, {
2509
- height: nr,
2510
- width: tr
2538
+ height: dr,
2539
+ width: ur
2511
2540
  });
2512
2541
  }), e.edges.forEach((e) => {
2513
2542
  t.setEdge(e.source, e.target);
2514
- }), at.layout(t), {
2543
+ }), pt.layout(t), {
2515
2544
  ...e,
2516
2545
  nodes: e.nodes.map((e) => {
2517
2546
  let n = t.node(e.id);
2518
2547
  return n ? {
2519
2548
  ...e,
2520
2549
  position: {
2521
- x: n.x - tr / 2,
2522
- y: n.y - nr / 2
2550
+ x: n.x - ur / 2,
2551
+ y: n.y - dr / 2
2523
2552
  }
2524
2553
  } : e;
2525
2554
  })
2526
2555
  };
2527
2556
  }
2528
- function yr(e) {
2557
+ function Or(e) {
2529
2558
  return e.edges.map((e) => {
2530
- let t = mr(e);
2559
+ let t = Cr(e);
2531
2560
  return {
2532
2561
  animated: !1,
2533
2562
  id: e.id,
@@ -2555,25 +2584,25 @@ function yr(e) {
2555
2584
  };
2556
2585
  });
2557
2586
  }
2558
- function br(e) {
2587
+ function kr(e) {
2559
2588
  return e === "current" ? {
2560
- ...ar,
2589
+ ...mr,
2561
2590
  border: "1px solid var(--mzn-color-primary, #0057ff)",
2562
2591
  boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
2563
2592
  } : e === "completed" ? {
2564
- ...ar,
2593
+ ...mr,
2565
2594
  border: "1px solid #16a34a"
2566
2595
  } : e === "cancelled" ? {
2567
- ...ar,
2596
+ ...mr,
2568
2597
  border: "1px solid #dc2626",
2569
2598
  opacity: .72
2570
2599
  } : e === "waiting" ? {
2571
- ...ar,
2600
+ ...mr,
2572
2601
  border: "1px dashed #64748b"
2573
- } : ar;
2602
+ } : mr;
2574
2603
  }
2575
- function xr(e) {
2576
- let t = or;
2604
+ function Ar(e) {
2605
+ let t = hr;
2577
2606
  return e === "current" ? {
2578
2607
  ...t,
2579
2608
  background: "#eff6ff",
@@ -2596,42 +2625,41 @@ function xr(e) {
2596
2625
  color: "#64748b"
2597
2626
  };
2598
2627
  }
2599
- function Sr({ data: e }) {
2600
- return /* @__PURE__ */ D("div", {
2601
- style: br(e.tone),
2628
+ function jr({ data: e }) {
2629
+ return /* @__PURE__ */ O("div", {
2630
+ style: kr(e.tone),
2602
2631
  children: [
2603
- /* @__PURE__ */ E(P, {
2632
+ /* @__PURE__ */ D(dt, {
2604
2633
  isConnectable: !1,
2605
- position: F.Left,
2606
- style: cr,
2634
+ position: P.Left,
2635
+ style: _r,
2607
2636
  type: "target"
2608
2637
  }),
2609
- /* @__PURE__ */ E(T, {
2638
+ /* @__PURE__ */ D(E, {
2610
2639
  component: "span",
2611
2640
  ellipsis: !0,
2612
2641
  title: e.label,
2613
2642
  variant: "label-primary",
2614
2643
  children: e.label
2615
2644
  }),
2616
- /* @__PURE__ */ E("span", {
2617
- style: xr(e.tone),
2645
+ /* @__PURE__ */ D("span", {
2646
+ style: Ar(e.tone),
2618
2647
  children: e.statusLabel
2619
2648
  }),
2620
- /* @__PURE__ */ E("span", {
2649
+ /* @__PURE__ */ D("span", {
2621
2650
  title: e.secondaryLabel,
2622
- style: sr,
2651
+ style: gr,
2623
2652
  children: e.secondaryLabel || e.kindLabel
2624
2653
  }),
2625
- /* @__PURE__ */ E(P, {
2654
+ /* @__PURE__ */ D(dt, {
2626
2655
  isConnectable: !1,
2627
- position: F.Right,
2628
- style: cr,
2656
+ position: P.Right,
2657
+ style: _r,
2629
2658
  type: "source"
2630
2659
  })
2631
2660
  ]
2632
2661
  });
2633
2662
  }
2634
- //#endregion
2635
- export { An as a, Pn as i, qn as n, yn as o, Un as r, vn as s, pr as t };
2663
+ export { zn as a, Un as i, nr as n, On as o, Qn as r, En as s, Sr as t };
2636
2664
 
2637
- //# sourceMappingURL=detail-4F39ggBn.js.map
2665
+ //# sourceMappingURL=detail-C6XKZjlF.js.map