@rytass/bpm-core-react 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (418) hide show
  1. package/dist/chunks/app-navigation-BRRFCkxZ.cjs +2 -0
  2. package/dist/chunks/{app-navigation-DAC5gFbG.cjs.map → app-navigation-BRRFCkxZ.cjs.map} +1 -1
  3. package/dist/chunks/{app-navigation-CATITRM7.js → app-navigation-rxhpHCch.js} +2 -3
  4. package/dist/chunks/{app-navigation-CATITRM7.js.map → app-navigation-rxhpHCch.js.map} +1 -1
  5. package/dist/chunks/approval-instance-list-page-2vUWc5-c.cjs +2 -0
  6. package/dist/chunks/{approval-instance-list-page-DIAmwhvl.cjs.map → approval-instance-list-page-2vUWc5-c.cjs.map} +1 -1
  7. package/dist/chunks/{approval-instance-list-page-B6vAGvOb.js → approval-instance-list-page-BgE4vQw8.js} +3 -3
  8. package/dist/chunks/{approval-instance-list-page-B6vAGvOb.js.map → approval-instance-list-page-BgE4vQw8.js.map} +1 -1
  9. package/dist/chunks/auth-provider-BV8Iiwfb.cjs +2 -0
  10. package/dist/chunks/auth-provider-BV8Iiwfb.cjs.map +1 -0
  11. package/dist/chunks/auth-provider-Bnox5gsx.js +98 -0
  12. package/dist/chunks/auth-provider-Bnox5gsx.js.map +1 -0
  13. package/dist/chunks/builder-B8X-m6C5.cjs +3 -0
  14. package/dist/chunks/builder-B8X-m6C5.cjs.map +1 -0
  15. package/dist/chunks/{FormBuilderView-CvChAvgD.js → builder-Du_0apkh.js} +3 -3
  16. package/dist/chunks/builder-Du_0apkh.js.map +1 -0
  17. package/dist/chunks/{TemplateCategoriesView-CgZciaSd.js → categories-DG4k7S8V.js} +86 -85
  18. package/dist/chunks/categories-DG4k7S8V.js.map +1 -0
  19. package/dist/chunks/categories-DshBQG33.cjs +2 -0
  20. package/dist/chunks/categories-DshBQG33.cjs.map +1 -0
  21. package/dist/chunks/{dashboard-page-BsW8t104.js → dashboard-page-CTBwpu_D.js} +3 -4
  22. package/dist/chunks/{dashboard-page-BsW8t104.js.map → dashboard-page-CTBwpu_D.js.map} +1 -1
  23. package/dist/chunks/dashboard-page-DcDiWQp2.cjs +2 -0
  24. package/dist/chunks/{dashboard-page-udYhnyMW.cjs.map → dashboard-page-DcDiWQp2.cjs.map} +1 -1
  25. package/dist/chunks/{AdminDelegationsView-DydMZ9ED.js → delegations-BAZQbElH.js} +4 -4
  26. package/dist/chunks/delegations-BAZQbElH.js.map +1 -0
  27. package/dist/chunks/{DelegationsView-DQUqOUV5.js → delegations-DzrckrPp.js} +4 -4
  28. package/dist/chunks/delegations-DzrckrPp.js.map +1 -0
  29. package/dist/chunks/delegations-Z8hTajLj.cjs +2 -0
  30. package/dist/chunks/delegations-Z8hTajLj.cjs.map +1 -0
  31. package/dist/chunks/delegations-hb9JoVZe.cjs +2 -0
  32. package/dist/chunks/delegations-hb9JoVZe.cjs.map +1 -0
  33. package/dist/chunks/{InstanceDetailView-C-A-LOCG.js → detail-DilI0PPe.js} +10 -10
  34. package/dist/chunks/detail-DilI0PPe.js.map +1 -0
  35. package/dist/chunks/detail-DuRg3Y7b.cjs +2 -0
  36. package/dist/chunks/detail-DuRg3Y7b.cjs.map +1 -0
  37. package/dist/chunks/{format-date-time-BQyH5U8z.cjs → format-date-time-hKLVMxq4.cjs} +2 -2
  38. package/dist/chunks/{format-date-time-BQyH5U8z.cjs.map → format-date-time-hKLVMxq4.cjs.map} +1 -1
  39. package/dist/chunks/{LoginView-a1iu3cfc.js → login-C20yVxbc.js} +9 -9
  40. package/dist/chunks/login-C20yVxbc.js.map +1 -0
  41. package/dist/chunks/login-CQ9MfwcC.cjs +2 -0
  42. package/dist/chunks/login-CQ9MfwcC.cjs.map +1 -0
  43. package/dist/chunks/{SettingsNotificationsView-B6F6fa7U.js → notifications-B2Lk3grg.js} +4 -4
  44. package/dist/chunks/notifications-B2Lk3grg.js.map +1 -0
  45. package/dist/chunks/notifications-C8ADhnxF.cjs +2 -0
  46. package/dist/chunks/notifications-C8ADhnxF.cjs.map +1 -0
  47. package/dist/chunks/orgs-CGv3VNDR.cjs +2 -0
  48. package/dist/chunks/orgs-CGv3VNDR.cjs.map +1 -0
  49. package/dist/chunks/{AdminOrgsView-DZaVAbaQ.js → orgs-c29y74w2.js} +52 -52
  50. package/dist/chunks/orgs-c29y74w2.js.map +1 -0
  51. package/dist/chunks/templates-Cd0WFheA.cjs +2 -0
  52. package/dist/chunks/templates-Cd0WFheA.cjs.map +1 -0
  53. package/dist/chunks/{TemplatesView-BLj9f-XI.js → templates-Dn9QHFSy.js} +4 -4
  54. package/dist/chunks/templates-Dn9QHFSy.js.map +1 -0
  55. package/dist/chunks/users-B-trMu0E.cjs +2 -0
  56. package/dist/chunks/users-B-trMu0E.cjs.map +1 -0
  57. package/dist/chunks/{AdminUsersView-C0oO05Br.js → users-itVXXRj7.js} +3 -3
  58. package/dist/chunks/users-itVXXRj7.js.map +1 -0
  59. package/dist/index.cjs +1 -1
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.js +12 -13
  62. package/dist/index.js.map +1 -1
  63. package/dist/next/BPMNextProviders.d.ts +6 -0
  64. package/dist/next/index.cjs +2 -0
  65. package/dist/next/index.cjs.map +1 -0
  66. package/dist/next/index.d.ts +1 -0
  67. package/dist/next/index.js +33 -0
  68. package/dist/next/index.js.map +1 -0
  69. package/dist/pages/admin/delegations/index.cjs +1 -1
  70. package/dist/pages/admin/delegations/index.cjs.map +1 -1
  71. package/dist/pages/admin/delegations/index.js +1 -1
  72. package/dist/pages/admin/delegations/index.js.map +1 -1
  73. package/dist/pages/admin/orgs/index.cjs +1 -1
  74. package/dist/pages/admin/orgs/index.cjs.map +1 -1
  75. package/dist/pages/admin/orgs/index.js +1 -1
  76. package/dist/pages/admin/orgs/index.js.map +1 -1
  77. package/dist/pages/admin/users/index.cjs +1 -1
  78. package/dist/pages/admin/users/index.cjs.map +1 -1
  79. package/dist/pages/admin/users/index.js +1 -1
  80. package/dist/pages/admin/users/index.js.map +1 -1
  81. package/dist/pages/cc/index.cjs +1 -1
  82. package/dist/pages/cc/index.cjs.map +1 -1
  83. package/dist/pages/cc/index.js +1 -1
  84. package/dist/pages/cc/index.js.map +1 -1
  85. package/dist/pages/dashboard/index.cjs +1 -1
  86. package/dist/pages/dashboard/index.cjs.map +1 -1
  87. package/dist/pages/dashboard/index.js +1 -1
  88. package/dist/pages/dashboard/index.js.map +1 -1
  89. package/dist/pages/delegations/index.cjs +1 -1
  90. package/dist/pages/delegations/index.cjs.map +1 -1
  91. package/dist/pages/delegations/index.js +1 -1
  92. package/dist/pages/delegations/index.js.map +1 -1
  93. package/dist/pages/forms/builder/index.cjs +1 -1
  94. package/dist/pages/forms/builder/index.cjs.map +1 -1
  95. package/dist/pages/forms/builder/index.d.ts +5 -7
  96. package/dist/pages/forms/builder/index.js +1 -1
  97. package/dist/pages/forms/builder/index.js.map +1 -1
  98. package/dist/pages/forms/index.cjs +1 -1
  99. package/dist/pages/forms/index.cjs.map +1 -1
  100. package/dist/pages/forms/index.js +1 -1
  101. package/dist/pages/forms/index.js.map +1 -1
  102. package/dist/pages/inbox/index.cjs +1 -1
  103. package/dist/pages/inbox/index.cjs.map +1 -1
  104. package/dist/pages/inbox/index.js +1 -1
  105. package/dist/pages/inbox/index.js.map +1 -1
  106. package/dist/pages/instances/detail/index.cjs +1 -1
  107. package/dist/pages/instances/detail/index.cjs.map +1 -1
  108. package/dist/pages/instances/detail/index.d.ts +1 -1
  109. package/dist/pages/instances/detail/index.js +1 -1
  110. package/dist/pages/instances/detail/index.js.map +1 -1
  111. package/dist/pages/instances/new/index.cjs +1 -1
  112. package/dist/pages/instances/new/index.cjs.map +1 -1
  113. package/dist/pages/instances/new/index.d.ts +5 -1
  114. package/dist/pages/instances/new/index.js +4 -3
  115. package/dist/pages/instances/new/index.js.map +1 -1
  116. package/dist/pages/login/index.cjs +1 -1
  117. package/dist/pages/login/index.cjs.map +1 -1
  118. package/dist/pages/login/index.d.ts +5 -1
  119. package/dist/pages/login/index.js +4 -3
  120. package/dist/pages/login/index.js.map +1 -1
  121. package/dist/pages/root/index.cjs +1 -1
  122. package/dist/pages/root/index.cjs.map +1 -1
  123. package/dist/pages/root/index.d.ts +7 -5
  124. package/dist/pages/root/index.js +5 -6
  125. package/dist/pages/root/index.js.map +1 -1
  126. package/dist/pages/search/index.cjs +1 -1
  127. package/dist/pages/search/index.cjs.map +1 -1
  128. package/dist/pages/search/index.js +1 -1
  129. package/dist/pages/search/index.js.map +1 -1
  130. package/dist/pages/sent/index.cjs +1 -1
  131. package/dist/pages/sent/index.cjs.map +1 -1
  132. package/dist/pages/sent/index.js +1 -1
  133. package/dist/pages/sent/index.js.map +1 -1
  134. package/dist/pages/settings/notifications/index.cjs +1 -1
  135. package/dist/pages/settings/notifications/index.cjs.map +1 -1
  136. package/dist/pages/settings/notifications/index.js +1 -1
  137. package/dist/pages/settings/notifications/index.js.map +1 -1
  138. package/dist/pages/templates/categories/index.cjs +1 -1
  139. package/dist/pages/templates/categories/index.cjs.map +1 -1
  140. package/dist/pages/templates/categories/index.js +1 -1
  141. package/dist/pages/templates/categories/index.js.map +1 -1
  142. package/dist/pages/templates/designer/index.cjs +1 -1
  143. package/dist/pages/templates/designer/index.cjs.map +1 -1
  144. package/dist/pages/templates/designer/index.d.ts +2 -4
  145. package/dist/pages/templates/designer/index.js +1 -1
  146. package/dist/pages/templates/designer/index.js.map +1 -1
  147. package/dist/pages/templates/index.cjs +1 -1
  148. package/dist/pages/templates/index.cjs.map +1 -1
  149. package/dist/pages/templates/index.js +1 -1
  150. package/dist/pages/templates/index.js.map +1 -1
  151. package/dist/pages/templates/versions/index.cjs +1 -1
  152. package/dist/pages/templates/versions/index.cjs.map +1 -1
  153. package/dist/pages/templates/versions/index.d.ts +2 -4
  154. package/dist/pages/templates/versions/index.js +1 -1
  155. package/dist/pages/templates/versions/index.js.map +1 -1
  156. package/dist/views/admin/delegations/index.cjs +1 -1
  157. package/dist/views/admin/delegations/index.js +1 -1
  158. package/dist/views/admin/index.cjs +1 -0
  159. package/dist/views/admin/index.d.ts +3 -0
  160. package/dist/views/admin/index.js +4 -0
  161. package/dist/views/admin/orgs/index.cjs +1 -1
  162. package/dist/views/admin/orgs/index.js +1 -1
  163. package/dist/views/admin/users/index.cjs +1 -1
  164. package/dist/views/admin/users/index.js +1 -1
  165. package/dist/views/cc/index.cjs +2 -1
  166. package/dist/views/cc/index.cjs.map +1 -0
  167. package/dist/views/cc/index.js +19 -2
  168. package/dist/views/cc/index.js.map +1 -0
  169. package/dist/views/dashboard/index.cjs +2 -1
  170. package/dist/views/dashboard/index.cjs.map +1 -0
  171. package/dist/views/dashboard/index.js +11 -2
  172. package/dist/views/dashboard/index.js.map +1 -0
  173. package/dist/views/delegations/index.cjs +1 -1
  174. package/dist/views/delegations/index.js +1 -1
  175. package/dist/views/forms/builder/index.cjs +1 -1
  176. package/dist/views/forms/builder/index.js +1 -1
  177. package/dist/views/forms/index.cjs +2 -1
  178. package/dist/views/forms/index.cjs.map +1 -0
  179. package/dist/views/forms/index.d.ts +1 -0
  180. package/dist/views/forms/index.js +186 -2
  181. package/dist/views/forms/index.js.map +1 -0
  182. package/dist/views/inbox/index.cjs +2 -1
  183. package/dist/views/inbox/index.cjs.map +1 -0
  184. package/dist/views/inbox/index.js +290 -2
  185. package/dist/views/inbox/index.js.map +1 -0
  186. package/dist/views/instances/detail/index.cjs +1 -1
  187. package/dist/views/instances/detail/index.js +1 -1
  188. package/dist/views/instances/index.cjs +1 -0
  189. package/dist/views/instances/index.d.ts +1 -0
  190. package/dist/views/instances/index.js +2 -0
  191. package/dist/views/instances/new/InstanceNewView.d.ts +3 -3
  192. package/dist/views/instances/new/index.cjs +2 -1
  193. package/dist/views/instances/new/index.cjs.map +1 -0
  194. package/dist/views/instances/new/index.js +189 -2
  195. package/dist/views/instances/new/index.js.map +1 -0
  196. package/dist/views/login/index.cjs +1 -1
  197. package/dist/views/login/index.js +1 -1
  198. package/dist/views/search/index.cjs +2 -1
  199. package/dist/views/search/index.cjs.map +1 -0
  200. package/dist/views/search/index.js +19 -2
  201. package/dist/views/search/index.js.map +1 -0
  202. package/dist/views/sent/index.cjs +2 -1
  203. package/dist/views/sent/index.cjs.map +1 -0
  204. package/dist/views/sent/index.js +19 -2
  205. package/dist/views/sent/index.js.map +1 -0
  206. package/dist/views/settings/index.cjs +1 -0
  207. package/dist/views/settings/index.d.ts +1 -0
  208. package/dist/views/settings/index.js +2 -0
  209. package/dist/views/settings/notifications/index.cjs +1 -1
  210. package/dist/views/settings/notifications/index.js +1 -1
  211. package/dist/views/templates/categories/index.cjs +1 -1
  212. package/dist/views/templates/categories/index.js +1 -1
  213. package/dist/views/templates/designer/index.cjs +51 -1
  214. package/dist/views/templates/designer/index.cjs.map +1 -0
  215. package/dist/views/templates/designer/index.js +2272 -2
  216. package/dist/views/templates/designer/index.js.map +1 -0
  217. package/dist/views/templates/index.cjs +1 -1
  218. package/dist/views/templates/index.d.ts +2 -0
  219. package/dist/views/templates/index.js +4 -2
  220. package/dist/views/templates/versions/index.cjs +2 -1
  221. package/dist/views/templates/versions/index.cjs.map +1 -0
  222. package/dist/views/templates/versions/index.js +110 -2
  223. package/dist/views/templates/versions/index.js.map +1 -0
  224. package/dist/views/workflow/index.cjs +1 -0
  225. package/dist/views/workflow/index.d.ts +4 -0
  226. package/dist/views/workflow/index.js +5 -0
  227. package/package.json +28 -3
  228. package/dist/chunks/AdminDelegationsView-CqNmlVWx.cjs +0 -2
  229. package/dist/chunks/AdminDelegationsView-CqNmlVWx.cjs.map +0 -1
  230. package/dist/chunks/AdminDelegationsView-DydMZ9ED.js.map +0 -1
  231. package/dist/chunks/AdminOrgsView-DZaVAbaQ.js.map +0 -1
  232. package/dist/chunks/AdminOrgsView-bSsIyMvk.cjs +0 -2
  233. package/dist/chunks/AdminOrgsView-bSsIyMvk.cjs.map +0 -1
  234. package/dist/chunks/AdminUsersView-C0oO05Br.js.map +0 -1
  235. package/dist/chunks/AdminUsersView-DlArLlIr.cjs +0 -2
  236. package/dist/chunks/AdminUsersView-DlArLlIr.cjs.map +0 -1
  237. package/dist/chunks/CcView-BsVsya5F.cjs +0 -2
  238. package/dist/chunks/CcView-BsVsya5F.cjs.map +0 -1
  239. package/dist/chunks/CcView-Bv0GzA5C.js +0 -19
  240. package/dist/chunks/CcView-Bv0GzA5C.js.map +0 -1
  241. package/dist/chunks/DashboardView-Dk1ZQmmk.js +0 -11
  242. package/dist/chunks/DashboardView-Dk1ZQmmk.js.map +0 -1
  243. package/dist/chunks/DashboardView-_0zh-rxT.cjs +0 -2
  244. package/dist/chunks/DashboardView-_0zh-rxT.cjs.map +0 -1
  245. package/dist/chunks/DelegationsView-DQUqOUV5.js.map +0 -1
  246. package/dist/chunks/DelegationsView-pKeFV2LN.cjs +0 -2
  247. package/dist/chunks/DelegationsView-pKeFV2LN.cjs.map +0 -1
  248. package/dist/chunks/FormBuilderView-BKtyW55e.cjs +0 -3
  249. package/dist/chunks/FormBuilderView-BKtyW55e.cjs.map +0 -1
  250. package/dist/chunks/FormBuilderView-CvChAvgD.js.map +0 -1
  251. package/dist/chunks/FormsView-DYEuik8W.js +0 -185
  252. package/dist/chunks/FormsView-DYEuik8W.js.map +0 -1
  253. package/dist/chunks/FormsView-RjJEkIfZ.cjs +0 -2
  254. package/dist/chunks/FormsView-RjJEkIfZ.cjs.map +0 -1
  255. package/dist/chunks/InboxView-DDWwmWhA.cjs +0 -2
  256. package/dist/chunks/InboxView-DDWwmWhA.cjs.map +0 -1
  257. package/dist/chunks/InboxView-YSoyrYLk.js +0 -291
  258. package/dist/chunks/InboxView-YSoyrYLk.js.map +0 -1
  259. package/dist/chunks/InstanceDetailView-C-A-LOCG.js.map +0 -1
  260. package/dist/chunks/InstanceDetailView-l_kNDCz2.cjs +0 -2
  261. package/dist/chunks/InstanceDetailView-l_kNDCz2.cjs.map +0 -1
  262. package/dist/chunks/InstanceNewView-B5hz-FWd.js +0 -190
  263. package/dist/chunks/InstanceNewView-B5hz-FWd.js.map +0 -1
  264. package/dist/chunks/InstanceNewView-CdCsxQIu.cjs +0 -2
  265. package/dist/chunks/InstanceNewView-CdCsxQIu.cjs.map +0 -1
  266. package/dist/chunks/LoginView-BED07v-7.cjs +0 -2
  267. package/dist/chunks/LoginView-BED07v-7.cjs.map +0 -1
  268. package/dist/chunks/LoginView-a1iu3cfc.js.map +0 -1
  269. package/dist/chunks/RootClientView-rXJt4TDd.cjs +0 -2
  270. package/dist/chunks/RootClientView-rXJt4TDd.cjs.map +0 -1
  271. package/dist/chunks/RootClientView-wAkXUEZw.js +0 -34
  272. package/dist/chunks/RootClientView-wAkXUEZw.js.map +0 -1
  273. package/dist/chunks/SearchView-CgXPssgE.cjs +0 -2
  274. package/dist/chunks/SearchView-CgXPssgE.cjs.map +0 -1
  275. package/dist/chunks/SearchView-WXMbZwRw.js +0 -19
  276. package/dist/chunks/SearchView-WXMbZwRw.js.map +0 -1
  277. package/dist/chunks/SentView-BTDoFBrG.cjs +0 -2
  278. package/dist/chunks/SentView-BTDoFBrG.cjs.map +0 -1
  279. package/dist/chunks/SentView-CdOL92Rq.js +0 -19
  280. package/dist/chunks/SentView-CdOL92Rq.js.map +0 -1
  281. package/dist/chunks/SettingsNotificationsView-B6F6fa7U.js.map +0 -1
  282. package/dist/chunks/SettingsNotificationsView-Bnz0CmoJ.cjs +0 -2
  283. package/dist/chunks/SettingsNotificationsView-Bnz0CmoJ.cjs.map +0 -1
  284. package/dist/chunks/TemplateCategoriesView-CgZciaSd.js.map +0 -1
  285. package/dist/chunks/TemplateCategoriesView-U0stGUBc.cjs +0 -2
  286. package/dist/chunks/TemplateCategoriesView-U0stGUBc.cjs.map +0 -1
  287. package/dist/chunks/TemplateDesignerView-A38DyYD4.cjs +0 -51
  288. package/dist/chunks/TemplateDesignerView-A38DyYD4.cjs.map +0 -1
  289. package/dist/chunks/TemplateDesignerView-Dffx-VZ-.js +0 -2272
  290. package/dist/chunks/TemplateDesignerView-Dffx-VZ-.js.map +0 -1
  291. package/dist/chunks/TemplateVersionsView-6sVQbBem.js +0 -110
  292. package/dist/chunks/TemplateVersionsView-6sVQbBem.js.map +0 -1
  293. package/dist/chunks/TemplateVersionsView-CMqw3ieU.cjs +0 -2
  294. package/dist/chunks/TemplateVersionsView-CMqw3ieU.cjs.map +0 -1
  295. package/dist/chunks/TemplatesView-BLj9f-XI.js.map +0 -1
  296. package/dist/chunks/TemplatesView-DIOQTUUl.cjs +0 -2
  297. package/dist/chunks/TemplatesView-DIOQTUUl.cjs.map +0 -1
  298. package/dist/chunks/app-navigation-DAC5gFbG.cjs +0 -2
  299. package/dist/chunks/approval-instance-list-page-DIAmwhvl.cjs +0 -2
  300. package/dist/chunks/auth-provider-D2P-qWmY.cjs +0 -2
  301. package/dist/chunks/auth-provider-D2P-qWmY.cjs.map +0 -1
  302. package/dist/chunks/auth-provider-TTO9eNZV.js +0 -83
  303. package/dist/chunks/auth-provider-TTO9eNZV.js.map +0 -1
  304. package/dist/chunks/dashboard-page-udYhnyMW.cjs +0 -2
  305. package/dist/chunks/router-adapter-BdHZXLS3.js +0 -23
  306. package/dist/chunks/router-adapter-BdHZXLS3.js.map +0 -1
  307. package/dist/chunks/router-adapter-BybHrCNP.cjs +0 -2
  308. package/dist/chunks/router-adapter-BybHrCNP.cjs.map +0 -1
  309. package/dist/chunks/templates.module-B5bg_goX.js +0 -8
  310. package/dist/chunks/templates.module-B5bg_goX.js.map +0 -1
  311. package/dist/chunks/templates.module-ClRnQQX4.cjs +0 -2
  312. package/dist/chunks/templates.module-ClRnQQX4.cjs.map +0 -1
  313. package/dist/pages/admin/delegations/AdminDelegationsClientView.cjs +0 -2
  314. package/dist/pages/admin/delegations/AdminDelegationsClientView.cjs.map +0 -1
  315. package/dist/pages/admin/delegations/AdminDelegationsClientView.d.ts +0 -3
  316. package/dist/pages/admin/delegations/AdminDelegationsClientView.js +0 -28
  317. package/dist/pages/admin/delegations/AdminDelegationsClientView.js.map +0 -1
  318. package/dist/pages/admin/orgs/AdminOrgsClientView.cjs +0 -2
  319. package/dist/pages/admin/orgs/AdminOrgsClientView.cjs.map +0 -1
  320. package/dist/pages/admin/orgs/AdminOrgsClientView.d.ts +0 -3
  321. package/dist/pages/admin/orgs/AdminOrgsClientView.js +0 -28
  322. package/dist/pages/admin/orgs/AdminOrgsClientView.js.map +0 -1
  323. package/dist/pages/admin/users/AdminUsersClientView.cjs +0 -2
  324. package/dist/pages/admin/users/AdminUsersClientView.cjs.map +0 -1
  325. package/dist/pages/admin/users/AdminUsersClientView.d.ts +0 -3
  326. package/dist/pages/admin/users/AdminUsersClientView.js +0 -28
  327. package/dist/pages/admin/users/AdminUsersClientView.js.map +0 -1
  328. package/dist/pages/cc/CcClientView.cjs +0 -2
  329. package/dist/pages/cc/CcClientView.cjs.map +0 -1
  330. package/dist/pages/cc/CcClientView.d.ts +0 -7
  331. package/dist/pages/cc/CcClientView.js +0 -28
  332. package/dist/pages/cc/CcClientView.js.map +0 -1
  333. package/dist/pages/dashboard/DashboardClientView.cjs +0 -2
  334. package/dist/pages/dashboard/DashboardClientView.cjs.map +0 -1
  335. package/dist/pages/dashboard/DashboardClientView.d.ts +0 -9
  336. package/dist/pages/dashboard/DashboardClientView.js +0 -28
  337. package/dist/pages/dashboard/DashboardClientView.js.map +0 -1
  338. package/dist/pages/delegations/DelegationsClientView.cjs +0 -2
  339. package/dist/pages/delegations/DelegationsClientView.cjs.map +0 -1
  340. package/dist/pages/delegations/DelegationsClientView.d.ts +0 -3
  341. package/dist/pages/delegations/DelegationsClientView.js +0 -28
  342. package/dist/pages/delegations/DelegationsClientView.js.map +0 -1
  343. package/dist/pages/forms/FormsClientView.cjs +0 -2
  344. package/dist/pages/forms/FormsClientView.cjs.map +0 -1
  345. package/dist/pages/forms/FormsClientView.d.ts +0 -10
  346. package/dist/pages/forms/FormsClientView.js +0 -28
  347. package/dist/pages/forms/FormsClientView.js.map +0 -1
  348. package/dist/pages/forms/builder/FormBuilderClientView.cjs +0 -2
  349. package/dist/pages/forms/builder/FormBuilderClientView.cjs.map +0 -1
  350. package/dist/pages/forms/builder/FormBuilderClientView.d.ts +0 -11
  351. package/dist/pages/forms/builder/FormBuilderClientView.js +0 -28
  352. package/dist/pages/forms/builder/FormBuilderClientView.js.map +0 -1
  353. package/dist/pages/inbox/InboxClientView.cjs +0 -2
  354. package/dist/pages/inbox/InboxClientView.cjs.map +0 -1
  355. package/dist/pages/inbox/InboxClientView.d.ts +0 -9
  356. package/dist/pages/inbox/InboxClientView.js +0 -28
  357. package/dist/pages/inbox/InboxClientView.js.map +0 -1
  358. package/dist/pages/instances/detail/InstanceDetailClientView.cjs +0 -2
  359. package/dist/pages/instances/detail/InstanceDetailClientView.cjs.map +0 -1
  360. package/dist/pages/instances/detail/InstanceDetailClientView.d.ts +0 -9
  361. package/dist/pages/instances/detail/InstanceDetailClientView.js +0 -28
  362. package/dist/pages/instances/detail/InstanceDetailClientView.js.map +0 -1
  363. package/dist/pages/instances/new/InstanceNewClientView.cjs +0 -2
  364. package/dist/pages/instances/new/InstanceNewClientView.cjs.map +0 -1
  365. package/dist/pages/instances/new/InstanceNewClientView.d.ts +0 -8
  366. package/dist/pages/instances/new/InstanceNewClientView.js +0 -28
  367. package/dist/pages/instances/new/InstanceNewClientView.js.map +0 -1
  368. package/dist/pages/login/LoginClientView.cjs +0 -2
  369. package/dist/pages/login/LoginClientView.cjs.map +0 -1
  370. package/dist/pages/login/LoginClientView.d.ts +0 -11
  371. package/dist/pages/login/LoginClientView.js +0 -29
  372. package/dist/pages/login/LoginClientView.js.map +0 -1
  373. package/dist/pages/root/RootClientView.cjs +0 -1
  374. package/dist/pages/root/RootClientView.d.ts +0 -8
  375. package/dist/pages/root/RootClientView.js +0 -2
  376. package/dist/pages/search/SearchClientView.cjs +0 -2
  377. package/dist/pages/search/SearchClientView.cjs.map +0 -1
  378. package/dist/pages/search/SearchClientView.d.ts +0 -7
  379. package/dist/pages/search/SearchClientView.js +0 -28
  380. package/dist/pages/search/SearchClientView.js.map +0 -1
  381. package/dist/pages/sent/SentClientView.cjs +0 -2
  382. package/dist/pages/sent/SentClientView.cjs.map +0 -1
  383. package/dist/pages/sent/SentClientView.d.ts +0 -7
  384. package/dist/pages/sent/SentClientView.js +0 -28
  385. package/dist/pages/sent/SentClientView.js.map +0 -1
  386. package/dist/pages/settings/notifications/SettingsNotificationsClientView.cjs +0 -2
  387. package/dist/pages/settings/notifications/SettingsNotificationsClientView.cjs.map +0 -1
  388. package/dist/pages/settings/notifications/SettingsNotificationsClientView.d.ts +0 -3
  389. package/dist/pages/settings/notifications/SettingsNotificationsClientView.js +0 -28
  390. package/dist/pages/settings/notifications/SettingsNotificationsClientView.js.map +0 -1
  391. package/dist/pages/templates/TemplatesClientView.cjs +0 -2
  392. package/dist/pages/templates/TemplatesClientView.cjs.map +0 -1
  393. package/dist/pages/templates/TemplatesClientView.d.ts +0 -3
  394. package/dist/pages/templates/TemplatesClientView.js +0 -28
  395. package/dist/pages/templates/TemplatesClientView.js.map +0 -1
  396. package/dist/pages/templates/categories/TemplateCategoriesClientView.cjs +0 -2
  397. package/dist/pages/templates/categories/TemplateCategoriesClientView.cjs.map +0 -1
  398. package/dist/pages/templates/categories/TemplateCategoriesClientView.d.ts +0 -3
  399. package/dist/pages/templates/categories/TemplateCategoriesClientView.js +0 -28
  400. package/dist/pages/templates/categories/TemplateCategoriesClientView.js.map +0 -1
  401. package/dist/pages/templates/designer/TemplateDesignerClientView.cjs +0 -2
  402. package/dist/pages/templates/designer/TemplateDesignerClientView.cjs.map +0 -1
  403. package/dist/pages/templates/designer/TemplateDesignerClientView.d.ts +0 -3
  404. package/dist/pages/templates/designer/TemplateDesignerClientView.js +0 -28
  405. package/dist/pages/templates/designer/TemplateDesignerClientView.js.map +0 -1
  406. package/dist/pages/templates/versions/TemplateVersionsClientView.cjs +0 -2
  407. package/dist/pages/templates/versions/TemplateVersionsClientView.cjs.map +0 -1
  408. package/dist/pages/templates/versions/TemplateVersionsClientView.d.ts +0 -3
  409. package/dist/pages/templates/versions/TemplateVersionsClientView.js +0 -28
  410. package/dist/pages/templates/versions/TemplateVersionsClientView.js.map +0 -1
  411. /package/dist/{templates.css → categories.css} +0 -0
  412. /package/dist/{AdminDelegationsView.css → delegations.css} +0 -0
  413. /package/dist/{DelegationsView.css → delegations2.css} +0 -0
  414. /package/dist/{InstanceDetailView.css → detail.css} +0 -0
  415. /package/dist/{LoginView.css → login.css} +0 -0
  416. /package/dist/{SettingsNotificationsView.css → notifications.css} +0 -0
  417. /package/dist/{AdminOrgsView.css → orgs.css} +0 -0
  418. /package/dist/{AdminUsersView.css → users.css} +0 -0
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/LoginView-a1iu3cfc.js";
1
+ import { t as e } from "../../chunks/login-C20yVxbc.js";
2
2
  export { e as LoginView };
@@ -1 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/SearchView-CgXPssgE.cjs");exports.SearchView=e.t;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-2vUWc5-c.cjs");let t=require("react/jsx-runtime");function n(n={}){return(0,t.jsx)(e.t,{activeHref:`/search`,defaultState:null,description:`以關鍵字與狀態查詢你有權限查看的簽核案件。`,emptyMessage:`沒有符合條件的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`案件搜尋`,view:`ALL`})}exports.SearchView=n;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../src/views/search/SearchView.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement } from 'react';\nimport { ApprovalInstanceListPage } from '../../components/approval-instance-list-page';\n\nexport interface SearchViewProps {}\n\n/**\n * Framework-agnostic view for the BPM case search page — list of all\n * instances the current member has visibility on. Mechanical port of\n * `apps/client/src/app/search/page.tsx`.\n */\nexport function SearchView(_props: SearchViewProps = {}): ReactElement {\n return (\n <ApprovalInstanceListPage\n activeHref=\"/search\"\n defaultState={null}\n description=\"以關鍵字與狀態查詢你有權限查看的簽核案件。\"\n emptyMessage=\"沒有符合條件的簽核案件。\"\n searchPlaceholder=\"關鍵字:搜尋案件、發起人、模板或狀態\"\n title=\"案件搜尋\"\n view=\"ALL\"\n />\n );\n}\n"],"mappings":"4LAYA,SAAgB,EAAW,EAA0B,CAAC,EAAiB,CACrE,OACE,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,WAAW,UACX,aAAc,KACd,YAAY,wBACZ,aAAa,eACb,kBAAkB,qBAClB,MAAM,OACN,KAAK,KACN,CAAA,CAEL"}
@@ -1,2 +1,19 @@
1
- import { t as e } from "../../chunks/SearchView-WXMbZwRw.js";
2
- export { e as SearchView };
1
+ "use client";
2
+ import { t as e } from "../../chunks/approval-instance-list-page-BgE4vQw8.js";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ //#region src/views/search/SearchView.tsx
5
+ function n(n = {}) {
6
+ return /* @__PURE__ */ t(e, {
7
+ activeHref: "/search",
8
+ defaultState: null,
9
+ description: "以關鍵字與狀態查詢你有權限查看的簽核案件。",
10
+ emptyMessage: "沒有符合條件的簽核案件。",
11
+ searchPlaceholder: "關鍵字:搜尋案件、發起人、模板或狀態",
12
+ title: "案件搜尋",
13
+ view: "ALL"
14
+ });
15
+ }
16
+ //#endregion
17
+ export { n as SearchView };
18
+
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/views/search/SearchView.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement } from 'react';\nimport { ApprovalInstanceListPage } from '../../components/approval-instance-list-page';\n\nexport interface SearchViewProps {}\n\n/**\n * Framework-agnostic view for the BPM case search page — list of all\n * instances the current member has visibility on. Mechanical port of\n * `apps/client/src/app/search/page.tsx`.\n */\nexport function SearchView(_props: SearchViewProps = {}): ReactElement {\n return (\n <ApprovalInstanceListPage\n activeHref=\"/search\"\n defaultState={null}\n description=\"以關鍵字與狀態查詢你有權限查看的簽核案件。\"\n emptyMessage=\"沒有符合條件的簽核案件。\"\n searchPlaceholder=\"關鍵字:搜尋案件、發起人、模板或狀態\"\n title=\"案件搜尋\"\n view=\"ALL\"\n />\n );\n}\n"],"mappings":";;;;AAYA,SAAgB,EAAW,IAA0B,CAAC,GAAiB;CACrE,OACE,kBAAC,GAAD;EACE,YAAW;EACX,cAAc;EACd,aAAY;EACZ,cAAa;EACb,mBAAkB;EAClB,OAAM;EACN,MAAK;CACN,CAAA;AAEL"}
@@ -1 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/SentView-BTDoFBrG.cjs");exports.SentView=e.t;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-2vUWc5-c.cjs");let t=require("react/jsx-runtime");function n(n={}){return(0,t.jsx)(e.t,{activeHref:`/sent`,defaultState:null,description:`查看由你發起的簽核案件與目前流程狀態。`,emptyMessage:`目前沒有由你發起的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`我發起的`,view:`SENT`})}exports.SentView=n;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../src/views/sent/SentView.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement } from 'react';\nimport { ApprovalInstanceListPage } from '../../components/approval-instance-list-page';\n\nexport interface SentViewProps {}\n\n/**\n * Framework-agnostic view for the BPM \"sent\" inbox — instances the current\n * member has initiated. Mechanical port of\n * `apps/client/src/app/sent/page.tsx`.\n */\nexport function SentView(_props: SentViewProps = {}): ReactElement {\n return (\n <ApprovalInstanceListPage\n activeHref=\"/sent\"\n defaultState={null}\n description=\"查看由你發起的簽核案件與目前流程狀態。\"\n emptyMessage=\"目前沒有由你發起的簽核案件。\"\n searchPlaceholder=\"關鍵字:搜尋案件、發起人、模板或狀態\"\n title=\"我發起的\"\n view=\"SENT\"\n />\n );\n}\n"],"mappings":"4LAYA,SAAgB,EAAS,EAAwB,CAAC,EAAiB,CACjE,OACE,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,WAAW,QACX,aAAc,KACd,YAAY,sBACZ,aAAa,iBACb,kBAAkB,qBAClB,MAAM,OACN,KAAK,MACN,CAAA,CAEL"}
@@ -1,2 +1,19 @@
1
- import { t as e } from "../../chunks/SentView-CdOL92Rq.js";
2
- export { e as SentView };
1
+ "use client";
2
+ import { t as e } from "../../chunks/approval-instance-list-page-BgE4vQw8.js";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ //#region src/views/sent/SentView.tsx
5
+ function n(n = {}) {
6
+ return /* @__PURE__ */ t(e, {
7
+ activeHref: "/sent",
8
+ defaultState: null,
9
+ description: "查看由你發起的簽核案件與目前流程狀態。",
10
+ emptyMessage: "目前沒有由你發起的簽核案件。",
11
+ searchPlaceholder: "關鍵字:搜尋案件、發起人、模板或狀態",
12
+ title: "我發起的",
13
+ view: "SENT"
14
+ });
15
+ }
16
+ //#endregion
17
+ export { n as SentView };
18
+
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/views/sent/SentView.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement } from 'react';\nimport { ApprovalInstanceListPage } from '../../components/approval-instance-list-page';\n\nexport interface SentViewProps {}\n\n/**\n * Framework-agnostic view for the BPM \"sent\" inbox — instances the current\n * member has initiated. Mechanical port of\n * `apps/client/src/app/sent/page.tsx`.\n */\nexport function SentView(_props: SentViewProps = {}): ReactElement {\n return (\n <ApprovalInstanceListPage\n activeHref=\"/sent\"\n defaultState={null}\n description=\"查看由你發起的簽核案件與目前流程狀態。\"\n emptyMessage=\"目前沒有由你發起的簽核案件。\"\n searchPlaceholder=\"關鍵字:搜尋案件、發起人、模板或狀態\"\n title=\"我發起的\"\n view=\"SENT\"\n />\n );\n}\n"],"mappings":";;;;AAYA,SAAgB,EAAS,IAAwB,CAAC,GAAiB;CACjE,OACE,kBAAC,GAAD;EACE,YAAW;EACX,cAAc;EACd,aAAY;EACZ,cAAa;EACb,mBAAkB;EAClB,OAAM;EACN,MAAK;CACN,CAAA;AAEL"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/notifications-C8ADhnxF.cjs");exports.SettingsNotificationsView=e.t;
@@ -0,0 +1 @@
1
+ export * from './notifications';
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../../chunks/notifications-B2Lk3grg.js";
2
+ export { e as SettingsNotificationsView };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/SettingsNotificationsView-Bnz0CmoJ.cjs");exports.SettingsNotificationsView=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/notifications-C8ADhnxF.cjs");exports.SettingsNotificationsView=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../../chunks/SettingsNotificationsView-B6F6fa7U.js";
1
+ import { t as e } from "../../../chunks/notifications-B2Lk3grg.js";
2
2
  export { e as SettingsNotificationsView };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/TemplateCategoriesView-U0stGUBc.cjs");exports.TemplateCategoriesView=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/categories-DshBQG33.cjs");exports.TemplateCategoriesView=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../../chunks/TemplateCategoriesView-CgZciaSd.js";
1
+ import { t as e } from "../../../chunks/categories-DG4k7S8V.js";
2
2
  export { e as TemplateCategoriesView };
@@ -1 +1,51 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/TemplateDesignerView-A38DyYD4.cjs");exports.TemplateDesignerView=e.t;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/app-navigation-BRRFCkxZ.cjs"),t=require("../../../chunks/auth-provider-BV8Iiwfb.cjs"),n=require("../../../chunks/admin-pickers-Btvij1at.cjs"),r=require("../../../chunks/bpm-form-field-Bc6k4ZEO.cjs");let i=require("react"),a=require("@mezzanine-ui/react"),o=require("react/jsx-runtime"),s=require("@mezzanine-ui/icons"),c=require("@mezzanine-ui/react/ContentHeader");c=e.o(c,1);let l=require("@rytass/bpm-core-client/organization"),u=require("@xyflow/react"),d=require("dagre");d=e.o(d,1);let f=require("@rytass/bpm-core-client/template");var ee={display:`grid`,gap:16},te={alignItems:`start`,display:`grid`,gap:16,gridTemplateColumns:`minmax(0, 1fr) 420px`},ne={border:`1px solid var(--mzn-color-border-neutral)`,borderRadius:6,height:620,minWidth:0,overflow:`hidden`},re={alignItems:`center`,boxSizing:`border-box`,color:`var(--mzn-color-text-error)`,display:`flex`,height:26,justifyContent:`center`,lineHeight:0,padding:0,width:26},ie={alignItems:`center`,display:`flex`,height:`100%`,justifyContent:`center`,width:`100%`},p=`workflow-designer-side-panel`,ae=96,oe=`
2
+ .${p} .mzn-form-field--stretch .mzn-form-field__label-area,
3
+ .${p} .mzn-form-field--horizontal .mzn-form-field__label-area {
4
+ flex: 0 0 ${ae}px;
5
+ width: ${ae}px;
6
+ }
7
+
8
+ .${p} .mzn-form-field--stretch .mzn-form-field__data-entry,
9
+ .${p} .mzn-form-field--horizontal .mzn-form-field__data-entry {
10
+ min-width: 0;
11
+ }
12
+ `,se=`#2563eb`,m=`#64748b`,ce=`var(--mzn-color-text-error, #dc2626)`,le=`drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))`,ue=`
13
+ .workflow-selection-delete-control.react-flow__controls-button {
14
+ align-items: center !important;
15
+ display: flex !important;
16
+ height: 26px !important;
17
+ justify-content: center !important;
18
+ padding: 0 !important;
19
+ width: 26px !important;
20
+ }
21
+
22
+ .workflow-selection-delete-control .mzn-icon {
23
+ align-items: center;
24
+ display: flex;
25
+ justify-content: center;
26
+ }
27
+
28
+ .workflow-selection-delete-control .mzn-icon svg {
29
+ height: 16px !important;
30
+ max-height: none !important;
31
+ max-width: none !important;
32
+ width: 16px !important;
33
+ }
34
+
35
+ .workflow-edge--selected .react-flow__edge-path,
36
+ .react-flow__edge-path.workflow-edge--selected {
37
+ filter: ${le};
38
+ opacity: 1 !important;
39
+ stroke: ${m} !important;
40
+ stroke-opacity: 1 !important;
41
+ stroke-width: 1.5px !important;
42
+ }
43
+
44
+ .workflow-edge--selected {
45
+ --xy-edge-stroke: ${m};
46
+ --xy-edge-stroke-selected: ${m};
47
+ --xy-edge-stroke-width: 1.5px;
48
+ }
49
+
50
+ `,de={display:`grid`,gap:12},h={display:`grid`,gap:12},fe={border:`1px solid var(--mzn-color-border-neutral)`,borderRadius:6,display:`grid`,gap:8,maxHeight:360,overflow:`auto`,padding:12},pe={borderBottom:`1px solid var(--mzn-color-border-neutral)`,display:`grid`,gap:4,padding:`0 0 8px`},me={display:`flex`,flexWrap:`wrap`,gap:8},he={display:`grid`,gap:8},g={alignContent:`center`,background:`var(--mzn-color-bg-surface)`,border:`1px solid var(--mzn-color-border-neutral)`,borderRadius:6,boxShadow:`0 8px 20px rgba(15, 23, 42, 0.08)`,boxSizing:`border-box`,display:`grid`,gap:4,height:`100%`,minWidth:132,overflow:`visible`,padding:`10px 12px`,textAlign:`center`,width:`100%`},ge=`0 8px 20px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--mzn-color-primary, #0057ff), 0 0 10px rgba(0, 87, 255, 0.3)`,_=64,v=160,_e=20,ve=64,y=180,ye={...g,display:`grid`,gap:8,padding:`10px 12px`},b={...ye,background:`#eff6ff`,border:`1px solid #2563eb`},be={...ye,background:`#f0fdfa`,border:`1px solid #0f766e`},xe={...g,background:`#ffffff`},Se={...g,background:`#ecfdf3`,border:`1px solid #2f855a`},Ce={...g,background:`#fff4ed`,border:`1px solid #c2410c`},x={display:`block`,maxWidth:`100%`,minWidth:0},S={display:`grid`,gap:2,minWidth:0},C=`input`,w=`output`,we={endEvent:`結束`,exclusiveGateway:`條件分流`,parallelGateway:`並行處理`,serviceTask:`系統`,startEvent:`開始`,userTask:`簽核`},Te=[{icon:s.UserIcon,label:`簽核節點`,type:`userTask`},{icon:s.MailIcon,label:`知會節點`,type:`serviceTask`}],Ee=[{icon:s.FilterIcon,label:`條件分流`,type:`exclusiveGateway`}],De=[{id:`AND`,name:`全部前置完成`},{id:`OR`,name:`任一前置完成`}],Oe=[{id:`RESTART`,name:`重新送出後從開始重跑`},{id:`FROM_RETURN_POINT`,name:`重新送出後回到退回節點`}],ke=[{id:`DIRECT`,name:`指定會員`},{id:`ORG_MANAGER`,name:`發起人主管`},{id:`ORG_UNIT_MANAGER`,name:`指定組織主管`},{id:`ORG_UNIT_MEMBER`,name:`組織任一人`},{id:`ORG_UNIT_POSITION`,name:`組織特定職位`},{id:`POSITION`,name:`指定職位`}],T=[{id:`1`,name:`直屬主管`,value:1},{id:`2`,name:`第二層主管`,value:2},{id:`3`,name:`第三層主管`,value:3}],Ae=[{id:`NONE`,name:`停止流程並提示`},{id:`DIRECT`,name:`固定改派`}],E=[{id:`EQUALS`,name:`等於`},{id:`NOT_EQUALS`,name:`不等於`},{id:`GREATER_THAN`,name:`大於`},{id:`GREATER_THAN_OR_EQUALS`,name:`大於等於`},{id:`LESS_THAN`,name:`小於`},{id:`LESS_THAN_OR_EQUALS`,name:`小於等於`},{id:`IS_FILLED`,name:`已填寫`},{id:`IS_EMPTY`,name:`未填寫`}],je=[`EQUALS`,`GREATER_THAN`,`GREATER_THAN_OR_EQUALS`,`LESS_THAN`,`LESS_THAN_OR_EQUALS`,`NOT_EQUALS`],Me=[{id:`NONE`,name:`未設定`},{id:`ALL`,name:`所有人`},{id:`ORG_UNIT`,name:`指定組織`},{id:`ORG_UNIT_POSITION`,name:`指定組織職位`}],Ne={id:`CUSTOM`,name:`既有自訂規則`},Pe=`member-001`,Fe={endEvent:O,exclusiveGateway:O,parallelGateway:O,serviceTask:O,startEvent:O,userTask:O};function D({templateId:d,activeHref:ae=`/templates`}){let se=t.a(),[m,le]=(0,i.useState)(null),[g,ge]=(0,i.useState)(null),[_,v]=(0,i.useState)(et()),[_e,ve]=(0,i.useState)(``),[y,ye]=(0,i.useState)(null),[b,be]=(0,i.useState)(null),[xe,Se]=(0,i.useState)(null),[Ce,x]=(0,i.useState)(null),[S,C]=(0,i.useState)(`start`),[w,E]=(0,i.useState)([]),[je,D]=(0,i.useState)(null),[O,k]=(0,i.useState)(null),[Le,Re]=(0,i.useState)(!0),[ze,A]=(0,i.useState)(!1),[Ve,He]=(0,i.useState)(!1),[j,qe]=(0,i.useState)([]),Je=(0,i.useMemo)(()=>JSON.stringify({formDefinitionVersionId:y,initiatorPolicyCel:b,workflowDefinition:_}),[y,b,_]),M=!!_e&&Je!==_e,[Qe,$e]=(0,i.useState)(!1),[F,I]=(0,i.useState)([]),[L,R]=(0,i.useState)([]),[z,yt]=(0,i.useState)([]),[Ct,Tt]=(0,i.useState)([]),[V,H]=(0,i.useState)(!1),[Ft,It]=(0,i.useState)(!1),[Lt,Rt]=(0,i.useState)(`{}`),[U,Ht]=(0,i.useState)(null),[Ut,Wt]=(0,i.useState)(null),[Gt,Kt]=(0,i.useState)(void 0),W=(0,i.useRef)(null);(0,i.useEffect)(()=>{xn()},[d]),(0,i.useEffect)(()=>{function e(e){M&&(e.preventDefault(),e.returnValue=``)}return window.addEventListener(`beforeunload`,e),()=>{window.removeEventListener(`beforeunload`,e)}},[M]),(0,i.useEffect)(()=>{Cn(_)},[_,F]),(0,i.useEffect)(()=>{v(e=>Ke(e))},[_.edges,_.nodes]);function en(){M&&!window.confirm(`目前有尚未儲存的流程草稿,確定要離開嗎?`)||se.push(`/templates`)}let G=(0,i.useMemo)(()=>_.nodes.find(e=>e.id===S)??null,[S,_.nodes]),sn=G?vt(G):!1,cn=w.length>0||sn,un=(0,i.useCallback)(()=>{let e=G&&vt(G)?G.id:null;v(t=>({...t,edges:t.edges.filter(t=>!w.includes(t.id)&&t.source!==e&&t.target!==e),nodes:e?t.nodes.filter(t=>t.id!==e):t.nodes})),E([]),D(null),e&&C(`start`)},[w,G]);(0,i.useEffect)(()=>{if(!cn)return;function e(e){e.key!==`Delete`&&e.key!==`Backspace`||bt(e.target)||(e.preventDefault(),un())}return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[cn,un]);let dn=(0,i.useMemo)(()=>_.edges.find(e=>e.id===je)??null,[je,_.edges]),fn=(0,i.useMemo)(()=>w.length===1?_.edges.find(e=>e.id===w[0])??null:null,[w,_.edges]),mn=(0,i.useMemo)(()=>w.map(e=>_.edges.find(t=>t.id===e)??null).filter(e=>!!e),[w,_.edges]),q=(0,i.useMemo)(()=>Ce??ft(b,xe),[b,Ce,xe]),gn=(0,i.useMemo)(()=>_.nodes.map(e=>Be(e,F,L,z,e.id===S,q)),[q,F,L,z,S,_.nodes]),_n=(0,i.useMemo)(()=>_.edges.map(e=>Ue(e,_.nodes,w.includes(e.id))),[w,_.edges,_.nodes]),Y=(0,i.useMemo)(()=>P(j,y)??P(xt(m?.formVersions??[]),y),[y,j,m?.formVersions]),vn=(0,i.useMemo)(()=>Ot(j,Y),[j,Y]),yn=(0,i.useMemo)(()=>Jt(_),[_]),X=(0,i.useMemo)(()=>Yt(_),[_]),bn=(0,i.useMemo)(()=>pt(q),[q]);async function xn(){Re(!0),k(null);try{let[e,t]=await Promise.all([(0,f.readTemplateDesigner)(d),(0,l.readOrganizationDashboard)()]),n=e.versions.find(e=>e.status===`DRAFT`)??null,r=n??e.versions[0]??null;le(e),ge(n),R(t.orgUnits),yt(t.positions),Tt(t.memberships),qe(xt(e.formVersions));let i=r?.workflowDefinition??et(),a=r?.formDefinitionVersionId??e.formVersions[0]?.id??null,o=r?.initiatorPolicyCel??null;v(i),ye(a),be(o),ve(JSON.stringify({formDefinitionVersionId:a,initiatorPolicyCel:o,workflowDefinition:i})),Se(r&&!e.template.currentVersionId&&!r.initiatorPolicyCel&&tt(r.workflowDefinition)?`NONE`:null),x(null),C(r?.workflowDefinition.nodes[0]?.id??`start`),E([]),D(null)}catch(e){k(J(e))}finally{Re(!1)}}async function Sn(e){He(!0),k(null);try{qe(Ot(xt(await(0,f.searchPublishedFormVersionOptions)(e)),Y))}catch(e){k(J(e))}finally{He(!1)}}async function Z(e){$e(!0),k(null);try{let t=await(0,f.searchMemberOptions)(e);I(e=>Bt(e,kt(t)))}catch(e){k(J(e))}finally{$e(!1)}}async function Cn(e){let t=Vt(e).filter(e=>!F.some(t=>t.memberId===e));if(t.length!==0)try{let e=await(0,f.resolveMemberOptions)(t);I(t=>Bt(t,kt(e)))}catch{I(e=>Bt(e,t.map(At)))}}async function wn(){A(!0),k(null);try{let e=Jt(_),t=pt(q);if(e||t){let n=e??t??`流程設定未完成`;throw k(n),Error(n)}let n=await(0,f.updateApprovalTemplateDraft)({formDefinitionVersionId:y,initiatorPolicyCel:b,versionId:(g??await(0,f.forkApprovalTemplate)(d)).id,workflowDefinition:_});return ge(n),await xn(),n}catch(e){throw k(J(e)),e}finally{A(!1)}}async function Tn(){A(!0),k(null);try{await(0,f.publishApprovalTemplateVersion)((await wn()).id),await xn()}catch(e){k(J(e))}finally{A(!1)}}function En(){Rt(JSON.stringify(St(Y),null,2)),Ht(null),Wt(null),H(!0)}function Dn(){Ft||H(!1)}async function On(){It(!0),Wt(null),Ht(null);try{Ht(await(0,f.dryRunApprovalWorkflow)({formData:wt(Lt),initiatorMemberId:Pe,initiatorMetadataSnapshot:Pt(Pe,Ct),workflowDefinition:_}))}catch(e){Wt(J(e))}finally{It(!1)}}function kn(e){let t=(0,u.applyNodeChanges)(e,gn);v(e=>({...e,nodes:e.nodes.map(e=>{let n=t.find(t=>t.id===e.id);return n?{...e,position:n.position}:e})}))}function An(e){if(!gt(e,_.nodes))return;let t=_.nodes.some(t=>t.id===e.source&&t.type===`exclusiveGateway`),n=N(e.source,e.target,{});v(e=>({...e,edges:[...e.edges,n]})),C(null),E([n.id]),D(t?n.id:null)}function jn(e,t){e.stopPropagation(),E(n=>e.shiftKey||e.metaKey||e.ctrlKey?_t(n,t.id):[t.id]),C(null)}function Mn(){D(null)}function Nn(e){let t=Ze({definition:_,node:Ye(e,Xe(_.nodes,e)),selectedEdgeId:w.length===1?w[0]:null,selectedNodeId:S}),n=nt(t.definition),r=qt(n,W.current);v(n),C(t.selectedNodeId),E(t.selectedEdgeIds),D(t.editingEdgeId),r&&Kt(r)}function Pn(e){G&&$(G.id,t=>We(t,e))}function Q(e){!G||G.type!==`userTask`||$(G.id,t=>t.type===`userTask`?{...t,data:{...t.data,approverResolver:e,decisionPolicy:{type:`SINGLE`}}}:t)}function Fn(e){!G||G.type!==`userTask`||$(G.id,t=>t.type===`userTask`?{...t,data:{...t.data,returnBehavior:{...t.data.returnBehavior,resubmitStrategy:e}}}:t)}function In(e){!G||G.type!==`serviceTask`||$(G.id,t=>t.type===`serviceTask`?{...t,data:{...t.data,action:e}}:t)}function Ln(e){x(e.mode===`ALL`||e.mode===`CUSTOM`?null:e),Se(e.mode===`ALL`||e.mode===`CUSTOM`?null:e.mode),be(mt(e,L))}function Rn(e){!G||G.type===`startEvent`||$(G.id,t=>Ge(t,e))}function $(e,t){v(n=>({...n,nodes:n.nodes.map(n=>n.id===e?t(n):n)}))}function zn(e,t){v(n=>({...n,edges:n.edges.map(n=>n.id===e?t(n):n)}))}function Bn(e,t){v(n=>{let r=n.edges.find(t=>t.id===e);return r?{...n,edges:n.edges.map(e=>t&&e.source===r.source&&e.id!==r.id&&K(e,n.nodes)?{...e,data:{...e.data,isDefault:!1}}:e.id===r.id?{...e,data:{...e.data,isDefault:t}}:e)}:n})}function Vn({edgeId:e,fieldKey:t,operator:n,value:r}){let i=Y?.schema??null;zn(e,e=>{let a=Zt(i,t??e.data.conditionFieldKey??null),o=nn(a,n??e.data.conditionOperator??null),s=rn(a,o,r??e.data.conditionValue??null),c=on(a,o,s);return{...e,data:{...e.data,condition:ln(a,o,s),conditionFieldKey:a?.fieldKey,conditionOperator:o,conditionValue:s,isDefault:!1,label:c}}})}function Hn(){let e=nt(_),t=qt(e,W.current);v(e),t&&Kt(t)}return(0,o.jsxs)(a.Layout,{children:[(0,o.jsx)(e.t,{activeHref:ae}),(0,o.jsxs)(a.Layout.Main,{children:[(0,o.jsx)(`style`,{children:oe}),(0,o.jsx)(a.PageHeader,{children:(0,o.jsxs)(c.default,{description:`${g?`草稿 v${g.version}`:`尚未建立草稿`} ·${m?.template.currentVersionId?` 已發布版本`:` 尚未發布`}`,onBackClick:en,title:m?.template.name??`流程設計器`,children:[(0,o.jsx)(a.Button,{"aria-label":`儲存草稿`,disabled:ze||!!yn||!!bn,icon:s.SaveIcon,iconType:`icon-only`,onClick:()=>void wn(),variant:`base-secondary`,children:`儲存草稿`}),(0,o.jsx)(a.Button,{disabled:Le||!!yn||!!bn,icon:s.EyeIcon,iconType:`leading`,onClick:En,variant:`base-secondary`,children:`試跑流程`}),(0,o.jsx)(a.Button,{disabled:ze||!g||!!yn||!!bn,icon:s.CheckedIcon,iconType:`leading`,onClick:()=>void Tn(),variant:`base-primary`,children:`發布版本`})]})}),(0,o.jsx)(a.SectionGroup,{children:(0,o.jsx)(a.Section,{children:(0,o.jsxs)(`div`,{style:ee,children:[O?(0,o.jsx)(a.Typography,{color:`text-error`,variant:`body`,children:O}):null,yn?(0,o.jsx)(a.Typography,{color:`text-error`,variant:`body`,children:yn}):null,bn?(0,o.jsx)(a.Typography,{color:`text-error`,variant:`body`,children:bn}):null,(0,o.jsx)(`div`,{style:h,children:(0,o.jsx)(r.t,{hintText:X?`已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。`:void 0,label:`綁定表單版本`,name:`formDefinitionVersionId`,required:!0,children:(0,o.jsx)(a.AutoComplete,{asyncData:!0,disabled:Le||X,disabledOptionsFilter:!0,emptyText:`沒有符合的已發布表單版本`,isForceClearable:!!y&&!X,loading:Ve,loadingText:`搜尋表單版本中...`,mode:`single`,onChange:e=>{X||ye(e?.id??null)},onClear:()=>{X||ye(null)},onSearch:Sn,onVisibilityChange:e=>{e&&!X&&Sn(``)},options:[...vn],placeholder:`選擇已發布表單版本`,searchDebounceTime:300,value:Y})})}),(0,o.jsxs)(`div`,{style:te,children:[(0,o.jsx)(`div`,{ref:W,style:ne,children:(0,o.jsxs)(u.ReactFlow,{connectionMode:u.ConnectionMode.Strict,edges:_n,fitView:!0,isValidConnection:e=>gt(e,_.nodes),nodeTypes:Fe,nodes:gn,deleteKeyCode:null,multiSelectionKeyCode:[`Shift`,`Meta`,`Control`],onConnect:An,onEdgeClick:jn,onNodeClick:(e,t)=>{C(t.id),E([])},onNodesChange:kn,onPaneClick:()=>{C(null),E([])},onViewportChange:Kt,viewport:Gt,children:[(0,o.jsx)(u.Background,{}),(0,o.jsx)(`style`,{children:ue}),(0,o.jsx)(u.Controls,{children:cn?(0,o.jsx)(u.ControlButton,{"aria-label":`刪除選取項目`,className:`workflow-selection-delete-control`,onClick:un,style:re,title:`刪除選取項目`,children:(0,o.jsx)(`span`,{style:ie,children:(0,o.jsx)(a.Icon,{color:`error`,icon:s.TrashIcon,size:16})})}):null}),(0,o.jsx)(Ie,{onApplyAutoLayout:Hn}),(0,o.jsx)(u.MiniMap,{})]})}),(0,o.jsxs)(`div`,{className:p,style:de,children:[(0,o.jsx)(a.Typography,{component:`h2`,variant:`h3`,children:`流程工具`}),(0,o.jsxs)(`div`,{style:he,children:[(0,o.jsx)(a.Typography,{color:`text-neutral`,variant:`caption`,children:`動作節點`}),(0,o.jsx)(`div`,{style:me,children:Te.map(e=>(0,o.jsx)(a.Button,{icon:e.icon,iconType:`leading`,onClick:()=>Nn(e.type),size:`sub`,variant:`base-secondary`,children:e.label},e.type))})]}),(0,o.jsxs)(`div`,{style:he,children:[(0,o.jsx)(a.Typography,{color:`text-neutral`,variant:`caption`,children:`流程控制`}),(0,o.jsx)(`div`,{style:me,children:Ee.map(e=>(0,o.jsx)(a.Button,{icon:e.icon,iconType:`leading`,onClick:()=>Nn(e.type),size:`sub`,variant:`base-secondary`,children:e.label},e.type))})]}),mn.length>1?Yn(mn):null,mn.length===1&&fn?Xn(fn):null,mn.length===0&&G?Wn(G):null]})]})]})})}),Zn(dn),Un()]})]});function Un(){return(0,o.jsx)(a.Modal,{cancelText:`關閉`,confirmText:`執行試跑`,loading:Ft,modalType:`standard`,onCancel:Dn,onClose:Dn,onConfirm:()=>void On(),open:V,showModalFooter:!0,showModalHeader:!0,size:`wide`,supportingText:`使用 ${Pe} 與範例表單資料模擬目前畫布流程,不會建立案件。`,title:`試跑流程`,children:(0,o.jsxs)(`div`,{style:h,children:[(0,o.jsx)(r.t,{label:`表單資料 JSON`,name:`dryRunFormDataJson`,required:!0,children:(0,o.jsx)(a.Textarea,{onChange:e=>Rt(e.target.value),resize:`vertical`,rows:8,value:Lt})}),Ut?(0,o.jsx)(a.Typography,{color:`text-error`,variant:`body`,children:Ut}):null,U?(0,o.jsxs)(`div`,{style:fe,children:[(0,o.jsx)(a.Typography,{color:U.valid?`text-success`:`text-error`,variant:`label-primary-highlight`,children:U.valid?`試跑通過`:`試跑失敗`}),U.errors.map(e=>(0,o.jsx)(a.Typography,{color:`text-error`,variant:`body`,children:e},e)),U.steps.map(e=>(0,o.jsxs)(`div`,{style:pe,children:[(0,o.jsxs)(a.Typography,{variant:`label-primary-highlight`,children:[e.nodeLabel,` · `,Et(e.status)]}),(0,o.jsxs)(a.Typography,{color:`text-neutral`,variant:`caption`,children:[Dt(e.nodeType),e.assigneeMemberId?` · 處理者:${e.assigneeMemberId}`:``,e.edgeLabel?` · 來源線段:${e.edgeLabel}`:``]}),e.edgeReason?(0,o.jsx)(a.Typography,{color:`text-neutral`,variant:`caption`,children:e.edgeReason}):null,e.entryCondition?(0,o.jsxs)(a.Typography,{color:`text-neutral`,variant:`caption`,children:[`進入條件:`,e.entryConditionMatched?`符合`:`不符合`,` ·`,` `,e.entryCondition]}):null,(0,o.jsx)(a.Typography,{color:`text-neutral`,variant:`body`,children:e.message})]},e.id))]}):null]})})}function Wn(e){return(0,o.jsxs)(`div`,{style:h,children:[(0,o.jsx)(a.Typography,{component:`h2`,variant:`h3`,children:`節點屬性`}),(0,o.jsxs)(a.Typography,{color:`text-neutral`,variant:`body`,children:[we[e.type],` · `,e.id]}),(0,o.jsx)(r.t,{label:`顯示名稱`,name:`nodeLabel`,required:!0,children:(0,o.jsx)(a.Input,{onChange:e=>Pn(e.target.value),value:e.data.label,variant:`base`})}),e.type===`startEvent`?Gn():null,e.type===`startEvent`?null:Kn(e),e.type===`userTask`?qn(e):null,e.type===`serviceTask`?Jn(e):null]})}function Gn(){let e=q.mode===`CUSTOM`?[...Me,Ne]:[...Me],t=q.mode===`ORG_UNIT`||q.mode===`ORG_UNIT_POSITION`?Mt(L,q.orgUnitId??``):null,i=q.mode===`ORG_UNIT_POSITION`?Nt(z,q.positionId??``):null,s=q.mode===`ORG_UNIT_POSITION`?zt({includeDescendants:!!q.includeDescendants,memberships:Ct,orgUnitId:q.orgUnitId??``,orgUnits:L,positions:z}):[];return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.t,{hintText:q.mode===`CUSTOM`?`這是舊版表達式規則;切換成標準選項後會改由 UI 管理。`:void 0,label:`發起權限`,name:`initiatorPolicyMode`,required:!0,children:(0,o.jsx)(a.Select,{clearable:!1,onChange:e=>{if(e?.id===`CUSTOM`){Se(null),x(null);return}let t=dt(e?.id??null),n=ht(t);Se(t===`ALL`?null:t),x(t===`ALL`?null:n),be(mt(n,L))},options:e,placeholder:`選擇誰可以發起`,value:P(e,q.mode)})}),q.mode===`ORG_UNIT`||q.mode===`ORG_UNIT_POSITION`?(0,o.jsx)(r.t,{label:`組織`,name:`initiatorOrgUnitId`,required:!0,children:(0,o.jsx)(n.n,{name:`initiatorOrgUnitId`,onChange:e=>Ln({...q,orgUnitId:e?.id??``,positionId:``,value:e?.id??``}),orgUnits:L,placeholder:`選擇組織`,value:t})}):null,q.mode===`ORG_UNIT`||q.mode===`ORG_UNIT_POSITION`?(0,o.jsx)(r.t,{label:`包含下層`,name:`initiatorIncludeDescendants`,children:(0,o.jsx)(a.Toggle,{checked:!!q.includeDescendants,onChange:e=>Ln({...q,includeDescendants:e.target.checked,...q.mode===`ORG_UNIT_POSITION`?{positionId:``}:{}})})}):null,q.mode===`ORG_UNIT_POSITION`?(0,o.jsx)(r.t,{label:`職位`,name:`initiatorPositionId`,required:!0,children:(0,o.jsx)(n.r,{disabled:!q.orgUnitId?.trim(),name:`initiatorPositionId`,onChange:e=>Ln({...q,positionId:e?.id??``}),placeholder:q.orgUnitId?.trim()?`選擇職位`:`請先選擇組織`,positions:s,value:i})}):null]})}function Kn(e){let t=_.edges.filter(t=>t.target===e.id).length,n=t<2,i=n?`AND`:e.data.triggerMode??`AND`;return(0,o.jsx)(r.t,{hintText:n?`需要至少兩條前置連線,才可切換為任一前置完成。`:t>1?`${t} 條前置連線會依此規則觸發。`:`只有一條前置連線時,兩種設定效果相同。`,label:`前置條件`,name:`triggerMode`,required:!0,children:(0,o.jsx)(a.Select,{clearable:!1,onChange:e=>n?void 0:Rn(rt(e?.id??null)),options:[...De],readOnly:n,value:P(De,i)})})}function qn(e){let t=e.data.approverResolver,i=at(t.type),s=t.type===`DIRECT`?jt(t.memberIds,F):null,c=t.type===`ORG_UNIT_MANAGER`||t.type===`ORG_UNIT_MEMBER`||t.type===`ORG_UNIT_POSITION`?Mt(L,t.orgUnitId):null,l=t.type===`POSITION`||t.type===`ORG_UNIT_POSITION`?Nt(z,t.positionId):null,u=t.type===`ORG_UNIT_POSITION`?zt({includeDescendants:!!t.includeDescendants,memberships:Ct,orgUnitId:t.orgUnitId,orgUnits:L,positions:z}):[],d=t.type===`ORG_MANAGER`?lt(t.levelsUp):T[0],f=t.type===`ORG_MANAGER`||t.type===`ORG_UNIT_MANAGER`?t.fallback??{type:`NONE`}:{type:`NONE`},ee=f.type===`DIRECT`?B(F,f.memberId):null,te=e.data.returnBehavior.resubmitStrategy??`RESTART`;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.t,{label:`簽核來源`,name:`approverResolverType`,required:!0,children:(0,o.jsx)(a.Select,{clearable:!1,onChange:e=>Q(ot(e?.id??null)),options:[...ke],value:P(ke,i)})}),t.type===`DIRECT`?(0,o.jsx)(r.t,{label:`簽核者`,name:`memberId`,required:!0,children:(0,o.jsx)(a.AutoComplete,{asyncData:!0,disabledOptionsFilter:!0,emptyText:`沒有符合的成員`,inputProps:{autoCapitalize:`none`,autoCorrect:`off`,name:`workflow-approver-search`,spellCheck:!1},loading:Qe,loadingText:`搜尋成員中...`,mode:`single`,onChange:e=>Q({memberIds:e?.id?[e.id]:[],type:`DIRECT`}),onSearch:Z,onVisibilityChange:e=>{e&&Z(``)},options:[...F],placeholder:`搜尋姓名或信箱`,searchDebounceTime:300,value:s})}):null,t.type===`ORG_MANAGER`?(0,o.jsx)(r.t,{hintText:`依發起人的有效會員歸屬與主管解析規則決定簽核人。`,label:`主管層級`,name:`managerLevelsUp`,required:!0,children:(0,o.jsx)(a.Select,{clearable:!1,onChange:e=>Q({baseFromInitiator:!0,levelsUp:ut(e?.id??null).value,type:`ORG_MANAGER`}),options:[...T],value:d})}):null,t.type===`ORG_UNIT_MANAGER`||t.type===`ORG_UNIT_MEMBER`||t.type===`ORG_UNIT_POSITION`?(0,o.jsx)(r.t,{hintText:t.type===`ORG_UNIT_MANAGER`?`依指定組織或其上層的主管解析規則決定簽核人。`:`依指定組織目前有效會員歸屬建立候選簽核人。`,label:`組織`,name:`orgUnitId`,required:!0,children:(0,o.jsx)(n.n,{name:`orgUnitId`,onChange:e=>Q(t.type===`ORG_UNIT_MEMBER`?{includeDescendants:t.includeDescendants,orgUnitId:e?.id??``,type:`ORG_UNIT_MEMBER`}:t.type===`ORG_UNIT_POSITION`?{includeDescendants:t.includeDescendants,orgUnitId:e?.id??``,positionId:``,type:`ORG_UNIT_POSITION`}:{fallback:t.fallback,orgUnitId:e?.id??``,type:`ORG_UNIT_MANAGER`}),orgUnits:L,placeholder:`選擇組織`,value:c})}):null,t.type===`ORG_MANAGER`||t.type===`ORG_UNIT_MANAGER`?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.t,{hintText:`預設會停止流程並提示;若設定固定人,找不到主管時會改派給該會員。`,label:`無主管時`,name:`approverFallbackMode`,required:!0,children:(0,o.jsx)(a.Select,{clearable:!1,onChange:e=>Q(ct(t,st(e?.id??null)===`DIRECT`?{memberId:``,type:`DIRECT`}:{type:`NONE`})),options:[...Ae],value:P(Ae,f.type)})}),f.type===`DIRECT`?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.t,{label:`改派人員`,name:`approverFallbackMemberId`,required:!0,children:(0,o.jsx)(a.AutoComplete,{asyncData:!0,disabledOptionsFilter:!0,emptyText:`沒有符合的成員`,inputProps:{autoCapitalize:`none`,autoCorrect:`off`,name:`workflow-approver-fallback-search`,spellCheck:!1},loading:Qe,loadingText:`搜尋成員中...`,mode:`single`,onChange:e=>Q(ct(t,{allowInitiatorSelfApproval:f.allowInitiatorSelfApproval,memberId:e?.id??``,type:`DIRECT`})),onSearch:Z,onVisibilityChange:e=>{e&&Z(``)},options:[...F],placeholder:`搜尋姓名或信箱`,searchDebounceTime:300,value:ee})}),(0,o.jsx)(r.t,{hintText:`預設禁止申請人簽自己的案件;只有此流程允許自簽時才開啟。`,label:`允許自簽`,name:`allowInitiatorSelfApproval`,children:(0,o.jsx)(a.Toggle,{checked:!!f.allowInitiatorSelfApproval,onChange:e=>Q(ct(t,{allowInitiatorSelfApproval:e.target.checked,memberId:f.memberId,type:`DIRECT`}))})})]}):null]}):null,t.type===`ORG_UNIT_MEMBER`||t.type===`ORG_UNIT_POSITION`?(0,o.jsx)(r.t,{label:`包含下層`,name:`includeDescendants`,children:(0,o.jsx)(a.Toggle,{checked:!!t.includeDescendants,onChange:e=>Q({...t,includeDescendants:e.target.checked,...t.type===`ORG_UNIT_POSITION`?{positionId:``}:{}})})}):null,t.type===`POSITION`?(0,o.jsx)(r.t,{hintText:`指派給目前有效歸屬中擁有此職位的會員;主要歸屬優先。`,label:`職位`,name:`positionId`,required:!0,children:(0,o.jsx)(n.r,{name:`positionId`,onChange:e=>Q({positionId:e?.id??``,type:`POSITION`}),placeholder:`選擇職位`,positions:z,value:l})}):null,t.type===`ORG_UNIT_POSITION`?(0,o.jsx)(r.t,{hintText:`只納入指定組織範圍內擁有此職位的有效會員。`,label:`職位`,name:`orgUnitPositionId`,required:!0,children:(0,o.jsx)(n.r,{disabled:!t.orgUnitId.trim(),name:`orgUnitPositionId`,onChange:e=>Q({includeDescendants:t.includeDescendants,orgUnitId:t.orgUnitId,positionId:e?.id??``,type:`ORG_UNIT_POSITION`}),placeholder:t.orgUnitId.trim()?`選擇職位`:`請先選擇組織`,positions:u,value:l})}):null,e.data.returnBehavior.allowReturn?(0,o.jsx)(r.t,{hintText:`退回發起人後,重新送出時要從流程開始重跑,或直接回到退回的簽核節點。`,label:`重送策略`,name:`returnResubmitStrategy`,required:!0,children:(0,o.jsx)(a.Select,{clearable:!1,onChange:e=>Fn(it(e?.id??null)),options:[...Oe],value:P(Oe,te)})}):null]})}function Jn(e){let t=hn(e.data.action).map(e=>B(F,e));return(0,o.jsx)(r.t,{label:`知會對象`,name:`notifyMemberIds`,required:!0,children:(0,o.jsx)(a.AutoComplete,{asyncData:!0,disabledOptionsFilter:!0,emptyText:`沒有符合的成員`,loading:Qe,loadingText:`搜尋成員中...`,mode:`multiple`,onChange:e=>In({channels:[`IN_APP`],recipients:{memberIds:e.map(e=>e.id),type:`DIRECT`},type:`NOTIFY`}),onSearch:Z,onVisibilityChange:e=>{e&&Z(``)},options:[...F],overflowStrategy:`wrap`,placeholder:`搜尋姓名或信箱`,searchDebounceTime:300,value:[...t]})})}function Yn(e){return(0,o.jsxs)(`div`,{style:h,children:[(0,o.jsx)(a.Typography,{component:`h2`,variant:`h3`,children:`已選取線段`}),(0,o.jsxs)(a.Typography,{color:`text-neutral`,variant:`body`,children:[`已選取 `,e.length,` 條線段,可使用 Delete 或控制面板刪除。`]})]})}function Xn(e){let t=K(e,_.nodes);return(0,o.jsxs)(`div`,{style:h,children:[(0,o.jsx)(a.Typography,{component:`h2`,variant:`h3`,children:t?`條件設定`:`線段屬性`}),(0,o.jsxs)(a.Typography,{color:`text-neutral`,variant:`body`,children:[e.source,` → `,e.target]}),t?Qn(e):(0,o.jsx)(a.Typography,{color:`text-neutral`,variant:`body`,children:`這條線會直接把流程送到下一個節點。`})]})}function Zn(e){return!e||!K(e,_.nodes)?null:(0,o.jsx)(a.Modal,{cancelText:`取消`,confirmButtonProps:{disabled:!e.data.isDefault&&!e.data.condition},confirmText:`完成`,modalType:`standard`,onCancel:Mn,onClose:Mn,onConfirm:Mn,open:!!je,showModalFooter:!0,showModalHeader:!0,size:`regular`,supportingText:`條件分流的輸出連線需要指定條件,條件會直接顯示在線上。`,title:`條件設定`,children:Qn(e)})}function Qn(e){let t=pn(e,_.nodes),n=Xt(Y?.schema??null),i=Zt(Y?.schema??null,e.data.conditionFieldKey??null),s=Qt(i),c=tn(i),l=P(s,e.data.conditionOperator??null);return(0,o.jsxs)(`div`,{style:h,children:[(0,o.jsxs)(a.Typography,{color:`text-neutral`,variant:`body`,children:[`畫布上的這條線目前會顯示「`,(0,o.jsx)(`span`,{style:{color:!e.data.isDefault&&!e.data.condition?ce:void 0},children:t??`請設定條件`}),`」。`]}),(0,o.jsx)(a.Toggle,{checked:!!e.data.isDefault,label:`其他情況走這條`,onChange:t=>Bn(e.id,t.target.checked)}),e.data.isDefault?(0,o.jsx)(a.Typography,{color:`text-neutral`,variant:`body`,children:`其他條件都不符合時,流程會走這條線。`}):(0,o.jsxs)(o.Fragment,{children:[Y?null:(0,o.jsx)(a.Typography,{color:`text-neutral`,variant:`body`,children:`請先綁定表單版本,才能選擇條件欄位。`}),(0,o.jsx)(r.t,{label:`條件欄位`,name:`edgeConditionField`,required:!0,children:(0,o.jsx)(a.Select,{clearable:!1,onChange:t=>Vn({edgeId:e.id,fieldKey:t?.id??null,operator:null,value:null}),options:[...n],placeholder:`選擇條件欄位`,value:P(n,e.data.conditionFieldKey??null)})}),(0,o.jsx)(r.t,{label:`條件判斷`,name:`edgeConditionOperator`,required:!0,children:(0,o.jsx)(a.Select,{clearable:!1,onChange:t=>Vn({edgeId:e.id,operator:$t(t?.id??null),value:null}),options:[...s],placeholder:`選擇判斷方式`,value:l})}),l&&an(l.id)?(0,o.jsx)(r.t,{label:`條件值`,name:`edgeConditionValue`,required:!0,children:c.length>0?(0,o.jsx)(a.Select,{clearable:!1,onChange:t=>Vn({edgeId:e.id,value:t?.id??null}),options:[...c],placeholder:`選擇條件值`,value:P(c,e.data.conditionValue??null)}):(0,o.jsx)(a.Input,{onChange:t=>Vn({edgeId:e.id,value:t.target.value}),placeholder:`輸入要比對的值`,value:e.data.conditionValue??``,variant:`base`})}):null]})]})}}function Ie({onApplyAutoLayout:e}){function t(){e()}return(0,o.jsx)(u.Panel,{position:`top-right`,children:(0,o.jsx)(a.Button,{icon:s.DotGridIcon,iconType:`leading`,onClick:t,size:`sub`,variant:`base-secondary`,children:`自動排版`})})}function O({data:e,selected:t,type:n}){let r=e.approverLines??[e.approverSummary??e.label],i=k(e);return(0,o.jsxs)(`div`,{style:Le(n,t),children:[ze(e),(0,o.jsx)(`div`,{style:S,children:r.map((e,t)=>(0,o.jsx)(a.Typography,{component:`span`,ellipsis:!0,style:x,title:e,variant:`label-primary`,children:e},`${e}_${t}`))}),(0,o.jsx)(a.Typography,{color:`text-neutral`,component:`span`,ellipsis:!0,style:x,title:i,variant:`caption`,children:i})]})}function k(e){return e.nodeKind===`startEvent`?e.initiatorPolicySummary??`所有人`:e.approverSummary||e.approverLines?e.label:e.nodeKind===`exclusiveGateway`?`條件在線上`:e.nodeKind===`parallelGateway`?`多條路徑同時進行`:we[e.nodeKind]}function Le(e,t){let n=Re(e);return t?{...n,border:`1px solid var(--mzn-color-primary, #0057ff)`,boxShadow:ge}:n}function Re(e){return e===`exclusiveGateway`?b:e===`parallelGateway`?be:e===`startEvent`?Se:e===`endEvent`?Ce:e===`userTask`?xe:g}function ze(e){return!e.hasInput&&e.hasOutput?(0,o.jsx)(u.Handle,{id:w,position:u.Position.Right,type:`source`}):e.hasInput&&!e.hasOutput?(0,o.jsx)(u.Handle,{id:C,position:u.Position.Left,type:`target`}):!e.hasInput&&!e.hasOutput?null:[(0,o.jsx)(u.Handle,{id:C,position:u.Position.Left,type:`target`},`target`),(0,o.jsx)(u.Handle,{id:w,position:u.Position.Right,type:`source`},`source`)]}function Be(e,t,n,r,i,a){let o=A(e);return{data:{approverLines:Wt(e,t),approverSummary:Ht(e,t,n,r),hasInput:R(e),hasOutput:z(e),initiatorPolicySummary:e.type===`startEvent`?L(a,n,r):null,label:e.data.label,nodeKind:e.type},height:o.height,handles:Ve(e),id:e.id,initialHeight:o.height,initialWidth:o.width,position:e.position,selected:i,sourcePosition:u.Position.Right,targetPosition:u.Position.Left,type:e.type,width:o.width}}function A(e){return e.type===`exclusiveGateway`||e.type===`parallelGateway`?{height:ve,width:y}:e.type===`serviceTask`?{height:_+(Math.max(1,hn(e.data.action).length)-1)*_e,width:v}:{height:_,width:v}}function Ve(e){let t=A(e);return[...R(e)?[He(t)]:[],...z(e)?[j(t)]:[]]}function He({height:e}){let t=e/2-9/2;return{height:9,id:C,position:u.Position.Left,type:`target`,width:9,x:-9/2,y:t}}function j({height:e,width:t}){let n=e/2-9/2;return{height:9,id:w,position:u.Position.Right,type:`source`,width:9,x:t-9/2,y:n}}function Ue(e,t,n){let r=pn(e,t),i=K(e,t),a=i&&!e.data.isDefault&&!e.data.condition,o=a?ce:i?se:`#475569`,s=a?`#fef2f2`:i?`#eff6ff`:`#ffffff`,c=a?ce:i?se:m;return{className:n?`workflow-edge--selected`:void 0,data:e.data,id:e.id,label:r,labelBgBorderRadius:6,labelBgPadding:[8,4],labelBgStyle:{fill:s,stroke:c,strokeWidth:1},labelShowBg:!!r,labelStyle:{fill:o,fontSize:12,fontWeight:600},selected:n,source:e.source,sourceHandle:e.sourceHandle,style:{filter:n?le:void 0,opacity:1,stroke:m,strokeOpacity:1,strokeWidth:1.5},target:e.target,targetHandle:e.targetHandle,type:e.type??`smoothstep`}}function We(e,t){return e.type===`startEvent`||e.type===`endEvent`||e.type===`userTask`||e.type===`serviceTask`||e.type,{...e,data:{...e.data,label:t}}}function Ge(e,t){return e.type===`startEvent`?e:(e.type===`endEvent`||e.type===`userTask`||e.type===`serviceTask`||e.type,{...e,data:{...e.data,triggerMode:t}})}function Ke(e){return Je(qe(e))}function qe(e){let t=new Set(e.nodes.filter(e=>yt(e)).map(e=>e.id)),n=e.edges.filter(e=>!t.has(e.source));return n.length===e.edges.length?e:{...e,edges:n}}function Je(e){let t=e.edges.reduce((e,t)=>({...e,[t.target]:(e[t.target]??0)+1}),{}),n=e.nodes.map(e=>e.type===`startEvent`?e:(t[e.id]??0)<2&&e.data.triggerMode!==`AND`?Ge(e,`AND`):e);return n.some((t,n)=>t!==e.nodes[n])?{...e,nodes:n}:e}function Ye(e,t){let n={id:`${e}_${t}`,position:{x:260+t*48,y:120+t*42}};return e===`userTask`?{...n,data:{allowAddSigner:!1,allowReject:!0,allowTransfer:!0,approverResolver:{memberIds:[`member-001`],type:`DIRECT`},decisionPolicy:{type:`SINGLE`},label:`簽核節點 ${t}`,returnBehavior:{allowReturn:!0,allowedTargets:`INITIATOR`,resubmitStrategy:`RESTART`},triggerMode:`AND`},type:e}:e===`serviceTask`?{...n,data:{action:{channels:[`IN_APP`],recipients:{memberIds:[`member-001`],type:`DIRECT`},type:`NOTIFY`},label:`知會節點 ${t}`,triggerMode:`AND`},type:e}:{...n,data:{direction:`split`,label:`條件分流 ${t}`,triggerMode:`AND`},type:e}}function Xe(e,t){let n=new Set(e.filter(e=>e.type===t).map(e=>Number(e.id.replace(`${t}_`,``))).filter(e=>Number.isInteger(e)&&e>0));return Array.from({length:e.length+1},(e,t)=>t+1).find(e=>!n.has(e))??e.length+1}function Ze({definition:e,node:t,selectedEdgeId:n,selectedNodeId:r}){let i=n?e.edges.find(e=>e.id===n)??null:null,a=r?e.nodes.find(e=>e.id===r)??null:null;return i?M(e,t,i):a?Qe(e,t,a):{definition:{...e,nodes:[...e.nodes,t]},editingEdgeId:null,selectedEdgeIds:[],selectedNodeId:t.id}}function M(e,t,n){if(!R(t))return{definition:e,editingEdgeId:null,selectedEdgeIds:[n.id],selectedNodeId:null};if(!z(t)){let r=N(n.source,t.id,{});return{definition:{...e,edges:[...e.edges,r],nodes:[...e.nodes,t]},editingEdgeId:null,selectedEdgeIds:[],selectedNodeId:t.id}}let r=N(n.source,t.id,n.data),i=N(t.id,n.target,$e(t,n)),a=K(i,[...e.nodes,t]);return{definition:{...e,edges:e.edges.flatMap(e=>e.id===n.id?[r,i]:[e]),nodes:[...e.nodes,t]},editingEdgeId:a?i.id:null,selectedEdgeIds:a?[i.id]:[],selectedNodeId:a?null:t.id}}function Qe(e,t,n){if(!z(n))return{definition:{...e,nodes:[...e.nodes,t]},editingEdgeId:null,selectedEdgeIds:[],selectedNodeId:t.id};let r=e.edges.find(e=>e.source===n.id)??null;if(r&&z(t))return M(e,t,r);let i=e.nodes.find(e=>e.type===`endEvent`);if(i&&n.id!==i.id&&z(t)){let r=N(n.id,t.id,{}),a=N(t.id,i.id,$e(t,r)),o=K(a,[...e.nodes,t]);return{definition:{...e,edges:[...e.edges,r,a],nodes:[...e.nodes,t]},editingEdgeId:o?a.id:null,selectedEdgeIds:o?[a.id]:[],selectedNodeId:o?null:t.id}}let a=N(n.id,t.id,{});return{definition:{...e,edges:[...e.edges,a],nodes:[...e.nodes,t]},editingEdgeId:null,selectedEdgeIds:[],selectedNodeId:t.id}}function N(e,t,n){return{data:n,id:`edge_${e}_${t}_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,source:e,sourceHandle:w,target:t,targetHandle:C,type:`smoothstep`}}function $e(e,t){return e.type===`exclusiveGateway`?{isDefault:!0,label:`其他情況`}:{}}function et(){return{edges:[],meta:{schemaVersion:1},nodes:[{data:{label:`開始`},id:`start`,position:{x:80,y:160},type:`startEvent`},{data:{endState:`APPROVED`,label:`完成`,triggerMode:`AND`},id:`end`,position:{x:560,y:160},type:`endEvent`}]}}function tt(e){return e.edges.length===0&&e.nodes.length===2&&e.nodes.some(e=>e.type===`startEvent`)&&e.nodes.some(e=>e.type===`endEvent`)}function nt(e){let t=new d.graphlib.Graph;return t.setDefaultEdgeLabel(()=>({})),t.setGraph({rankdir:`LR`,ranksep:120}),e.nodes.forEach(e=>{t.setNode(e.id,A(e))}),e.edges.forEach(e=>{t.setEdge(e.source,e.target)}),d.layout(t),{...e,nodes:e.nodes.map(e=>{let n=t.node(e.id);return n?{...e,position:{x:n.x-A(e).width/2,y:n.y-A(e).height/2}}:e})}}function P(e,t){return t?e.find(e=>e.id===t)??null:null}function rt(e){return e===`OR`?`OR`:`AND`}function it(e){return e===`FROM_RETURN_POINT`?`FROM_RETURN_POINT`:`RESTART`}function at(e){return e===`ORG_MANAGER`||e===`ORG_UNIT_MANAGER`||e===`ORG_UNIT_MEMBER`||e===`ORG_UNIT_POSITION`||e===`POSITION`?e:`DIRECT`}function ot(e){let t=at(e??`DIRECT`);return t===`ORG_MANAGER`?{baseFromInitiator:!0,levelsUp:1,type:`ORG_MANAGER`}:t===`ORG_UNIT_MANAGER`?{orgUnitId:``,type:`ORG_UNIT_MANAGER`}:t===`ORG_UNIT_MEMBER`?{includeDescendants:!1,orgUnitId:``,type:`ORG_UNIT_MEMBER`}:t===`ORG_UNIT_POSITION`?{includeDescendants:!1,orgUnitId:``,positionId:``,type:`ORG_UNIT_POSITION`}:t===`POSITION`?{positionId:``,type:`POSITION`}:{memberIds:[],type:`DIRECT`}}function st(e){return e===`DIRECT`?`DIRECT`:`NONE`}function ct(e,t){return e.type===`ORG_MANAGER`||e.type===`ORG_UNIT_MANAGER`?{...e,fallback:t}:e}function lt(e){return T.find(t=>t.value===e)??T[0]}function ut(e){return T.find(t=>t.id===e)??T[0]}function dt(e){return e===`ORG_UNIT`||e===`ORG_UNIT_POSITION`||e===`NONE`?e:`ALL`}function F(e){let t=e?.trim();if(!t)return{mode:`ALL`,value:``};let n=I(t,/"([^"]+)" in subject\.orgUnitIds/gu),r=I(t,/"([^"]+)" in subject\.positionIds/gu);return n.length>0&&r.length>0?{includeDescendants:n.length>1,mode:`ORG_UNIT_POSITION`,orgUnitId:n[0],positionId:r[0],value:n[0]??``}:n.length>0?{includeDescendants:n.length>1,mode:`ORG_UNIT`,orgUnitId:n[0],value:n[0]??``}:{mode:`CUSTOM`,value:t}}function ft(e,t){let n=F(e);return!t||t===`ALL`||t===`NONE`?t===`ALL`||t===`NONE`?{mode:t,value:``}:n:n.mode===t?n:ht(t)}function pt(e){return e.mode===`NONE`?`發起權限需要選擇誰可以發起。`:(e.mode===`ORG_UNIT`||e.mode===`ORG_UNIT_POSITION`)&&!e.orgUnitId?.trim()?`指定組織發起時,需要選擇組織。`:e.mode===`ORG_UNIT_POSITION`&&!e.positionId?.trim()?`指定組織職位發起時,需要選擇職位。`:null}function I(e,t){return[...e.matchAll(t)].map(e=>e[1]).filter(e=>!!e)}function mt(e,t){if(e.mode===`ALL`||e.mode===`NONE`)return null;let n=e.orgUnitId?.trim()??``;if(!n)return null;let r=U(t,n,!!e.includeDescendants).map(e=>`${JSON.stringify(e)} in subject.orgUnitIds`).join(` || `);if(e.mode===`ORG_UNIT`)return r?`(${r})`:null;let i=e.positionId?.trim()??``;return i&&r?`(${r}) && ${JSON.stringify(i)} in subject.positionIds`:null}function L(e,t,n){return e.mode===`NONE`?`未設定`:e.mode===`ORG_UNIT`?e.orgUnitId?`組織:${V(t,e.orgUnitId)}`:`指定組織`:e.mode===`ORG_UNIT_POSITION`?e.orgUnitId&&e.positionId?`組織職位:${V(t,e.orgUnitId)} / ${H(n,e.positionId)}`:`指定組織職位`:e.mode===`CUSTOM`?`既有自訂規則`:`所有人`}function ht(e){return{includeDescendants:!0,mode:e,orgUnitId:``,positionId:``,value:``}}function gt(e,t){let n=e.source?t.find(t=>t.id===e.source)??null:null,r=e.target?t.find(t=>t.id===e.target)??null:null;return!!n&&!!r&&e.source!==e.target&&e.sourceHandle===w&&e.targetHandle===C&&!!(n&&z(n))&&!!(r&&R(r))}function _t(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function vt(e){return e.type!==`startEvent`&&e.type!==`endEvent`}function R(e){return e.type!==`startEvent`}function z(e){return e.type!==`endEvent`&&!yt(e)}function yt(e){return e.type===`serviceTask`&&e.data.action.type===`NOTIFY`}function bt(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`||!!e.closest(`[contenteditable="true"]`):!1}function xt(e){return e.map(e=>({id:e.id,name:`${e.formName} | v${e.version}`,schema:e.schema}))}function St(e){return(e?.schema.fields??[]).reduce((e,t)=>({...e,[t.fieldKey]:Ct(t)}),{})}function Ct(e){return e.type===`number`?1e3:e.type===`boolean`?!0:e.type===`select`?e.options[0]?.value??``:e.type===`checkbox`?e.options[0]?[e.options[0].value]:[]:e.type===`date`?`2026-05-08`:e.type===`datetime`?`2026-05-08T09:00:00+08:00`:e.placeholder??e.label}function wt(e){let t=JSON.parse(e);if(!Tt(t))throw Error(`表單資料 JSON 必須是物件。`);return t}function Tt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Et(e){return e===`COMPLETED`?`完成`:e===`PASSED`?`通過`:e===`SKIPPED`?`略過`:e===`STOPPED`?`已停止`:e===`WAITING`?`將等待簽核`:e}function Dt(e){return e in we?we[e]:e}function Ot(e,t){return t&&!e.some(e=>e.id===t.id)?[t,...e]:e}function kt(e){return e.map(e=>({displayName:e.name,email:e.email,id:e.memberId,memberId:e.memberId,name:Kt(e.name,e.email)}))}function At(e){return{displayName:`未知會員`,email:``,id:e,memberId:e,name:`未知會員`}}function B(e,t){return e.find(e=>e.memberId===t)??At(t)}function jt(e,t){let n=e[0];return n?B(t,n):null}function Mt(e,t){let r=e.find(e=>e.id===t);return r?n.a(r):null}function Nt(e,t){let r=e.find(e=>e.id===t);return r?n.o(r):null}function V(e,t){return Mt(e,t)?.name??`未指定組織`}function H(e,t){return Nt(e,t)?.name??`未指定職位`}function Pt(e,t){let n=Ft(),r=t.filter(t=>t.memberId===e&&It(t,n)),i=r.reduce((e,t)=>e&&Lt(e,t)<=0?e:t,null);return{customFields:{},managerMemberId:`member-002`,memberId:e,orgCode:`HQ`,orgUnitIds:Rt(r.map(e=>e.orgUnitId)),positionId:i?.positionId??null,positionIds:Rt(r.map(e=>e.positionId)),primaryOrgUnitId:i?.orgUnitId??null,roles:[`manager`]}}function Ft(){return new Date().toISOString().slice(0,10)}function It(e,t){return e.effectiveFrom<=t&&(!e.effectiveTo||e.effectiveTo>=t)}function Lt(e,t){return e.isPrimary===t.isPrimary?t.effectiveFrom.localeCompare(e.effectiveFrom):e.isPrimary?-1:1}function Rt(e){return e.reduce((e,t)=>t&&!e.includes(t)?[...e,t]:e,[])}function zt({includeDescendants:e,memberships:t,orgUnitId:n,orgUnits:r,positions:i}){let a=new Set(U(r,n,e)),o=new Set(t.filter(e=>a.has(e.orgUnitId)).map(e=>e.positionId).filter(e=>!!e));return i.filter(e=>o.has(e.id))}function U(e,t,n){let r=e.find(e=>e.id===t);return r?n?e.filter(e=>e.id===r.id||e.path.startsWith(`${r.path}.`)).map(e=>e.id):[r.id]:t.trim()?[t]:[]}function Bt(e,t){let n=new Set(e.map(e=>e.memberId)),r=t.filter(e=>!n.has(e.memberId));return[...e,...r]}function Vt(e){return[...new Set(e.nodes.flatMap(e=>e.type===`userTask`?e.data.approverResolver.type===`DIRECT`?e.data.approverResolver.memberIds:[]:e.type===`serviceTask`?hn(e.data.action):[]))]}function Ht(e,t,n,r){return e.type===`userTask`?Ut(e.data.approverResolver,t,n,r):null}function Ut(e,t,n,r){return e.type===`DIRECT`?Gt(e.memberIds,t,`未指定簽核者`):e.type===`ORG_MANAGER`?lt(e.levelsUp).name:e.type===`ORG_UNIT_MANAGER`?`組織主管:${V(n,e.orgUnitId)}`:e.type===`ORG_UNIT_MEMBER`?`組織任一人:${V(n,e.orgUnitId)}`:e.type===`ORG_UNIT_POSITION`?`組織職位:${V(n,e.orgUnitId)} / ${H(r,e.positionId)}`:e.type===`POSITION`?`職位:${H(r,e.positionId)}`:e.type===`DYNAMIC_FORM`?`表單欄位:${e.formPath||`未設定`}`:`自訂表達式`}function Wt(e,t){if(e.type!==`serviceTask`)return null;let n=hn(e.data.action);return n.length===0?[`未指定知會對象`]:n.map(e=>B(t,e).name)}function Gt(e,t,n){let r=e.map(e=>B(t,e).name);return r.length===0?n:r.length<=2?r.join(`、`):`${r.slice(0,2).join(`、`)} 等 ${r.length} 人`}function Kt(e,t){return`${e} (${t})`}function qt(e,t){let n=t?.getBoundingClientRect();if(!n||e.nodes.length===0)return null;let r=e.nodes.reduce((e,t)=>{let n=A(t);return{maxX:Math.max(e.maxX,t.position.x+n.width),maxY:Math.max(e.maxY,t.position.y+n.height),minX:Math.min(e.minX,t.position.x),minY:Math.min(e.minY,t.position.y)}},{maxX:-1/0,maxY:-1/0,minX:1/0,minY:1/0});return(0,u.getViewportForBounds)({height:r.maxY-r.minY,width:r.maxX-r.minX,x:r.minX,y:r.minY},n.width,n.height,.1,1,.2)}function Jt(e){let t=e.nodes.find(e=>e.type===`userTask`&&!!W(e.data.approverResolver)),n=e.nodes.find(e=>e.type===`serviceTask`&&e.data.action.type===`NOTIFY`&&hn(e.data.action).length===0),r=e.edges.find(t=>K(t,e.nodes)&&!t.data.isDefault&&!t.data.condition);return t&&t.type===`userTask`?W(t.data.approverResolver):n?`知會節點需要至少一位知會對象。`:r?`條件分流的每條輸出連線都需要先設定條件。`:null}function W(e){return e.type===`DIRECT`&&e.memberIds.length===0?`簽核節點需要指定簽核會員。`:e.type===`ORG_MANAGER`&&e.levelsUp<1?`簽核節點需要指定有效的主管層級。`:e.type===`ORG_UNIT_MANAGER`&&!e.orgUnitId.trim()||e.type===`ORG_UNIT_MEMBER`&&!e.orgUnitId.trim()?`簽核節點需要指定組織。`:e.type===`ORG_UNIT_POSITION`&&(!e.orgUnitId.trim()||!e.positionId.trim())?`簽核節點需要指定組織與職位。`:(e.type===`ORG_MANAGER`||e.type===`ORG_UNIT_MANAGER`)&&e.fallback?.type===`DIRECT`&&!e.fallback.memberId.trim()?`簽核節點需要指定改派固定人。`:e.type===`POSITION`&&!e.positionId.trim()?`簽核節點需要指定職位。`:null}function Yt(e){return e.edges.some(t=>K(t,e.nodes)&&!!(t.data.condition||t.data.conditionFieldKey||t.data.conditionOperator||t.data.conditionValue))}function Xt(e){return e?.fields.map(e=>({fieldType:e.type,id:e.fieldKey,name:`${e.label} (${e.fieldKey})`}))??[]}function Zt(e,t){return t?e?.fields.find(e=>e.fieldKey===t)??null:null}function Qt(e){if(!e)return[];let t=en(e);return E.filter(e=>t.includes(e.id))}function $t(e){return E.some(t=>t.id===e)?e:null}function en(e){return e.type===`file_upload`?[`IS_FILLED`,`IS_EMPTY`]:e.type===`boolean`?[`EQUALS`,`NOT_EQUALS`,`IS_FILLED`,`IS_EMPTY`]:e.type===`date`||e.type===`datetime`||e.type===`money`||e.type===`number`?[`EQUALS`,`NOT_EQUALS`,`GREATER_THAN`,`GREATER_THAN_OR_EQUALS`,`LESS_THAN`,`LESS_THAN_OR_EQUALS`,`IS_FILLED`,`IS_EMPTY`]:[`EQUALS`,`NOT_EQUALS`,`IS_FILLED`,`IS_EMPTY`]}function tn(e){return e?e.type===`boolean`?[{id:`true`,name:`是`},{id:`false`,name:`否`}]:e.type===`checkbox`||e.type===`radio`||e.type===`select`?e.options.map(e=>({id:e.value,name:e.label})):[]:[]}function nn(e,t){if(!e)return;let n=en(e);return t&&n.includes(t)?t:n[0]}function rn(e,t,n){if(!e||!t||!an(t))return;let r=tn(e);return r.length===0||r.some(e=>e.id===n)?n??void 0:r[0]?.id}function an(e){return je.includes(e)}function on(e,t,n){if(!e||!t)return;let r=G(t);if(!an(t))return`${e.label} ${r}`;if(n)return`${e.label} ${r} ${sn(e,n)}`}function G(e){return E.find(t=>t.id===e)?.name??e}function sn(e,t){return e.type===`boolean`?t===`true`?`是`:`否`:e.type===`checkbox`||e.type===`radio`||e.type===`select`?cn(e.options,t)?.label??t:t}function cn(e,t){return e.find(e=>e.value===t)??null}function ln(e,t,n){if(!e||!t)return;let r=un(e.fieldKey);if(t===`IS_FILLED`)return`${r} != null && ${r} != ""`;if(t===`IS_EMPTY`)return`${r} == null || ${r} == ""`;if(n)return`${r} ${dn(t)} ${fn(e,n)}`}function un(e){return/^[A-Za-z_][A-Za-z0-9_]*$/u.test(e)?`form.${e}`:`form[${JSON.stringify(e)}]`}function dn(e){return e===`EQUALS`?`==`:e===`NOT_EQUALS`?`!=`:e===`GREATER_THAN`?`>`:e===`GREATER_THAN_OR_EQUALS`?`>=`:e===`LESS_THAN`?`<`:`<=`}function fn(e,t){return e.type===`boolean`?t===`true`?`true`:`false`:(e.type===`money`||e.type===`number`)&&Number.isFinite(Number(t))?t:JSON.stringify(t)}function pn(e,t){if(e.data.label)return e.data.label;if(K(e,t))return mn(e);if(q(e,t))return`同時進行`}function mn(e){return e.data.isDefault?`其他情況`:`請設定條件`}function K(e,t){return t.some(t=>t.id===e.source&&t.type===`exclusiveGateway`)}function q(e,t){return t.some(t=>t.id===e.source&&t.type===`parallelGateway`)}function hn(e){return e.type===`NOTIFY`&&e.recipients.type===`DIRECT`?e.recipients.memberIds:[]}function J(e){return e instanceof Error?e.message:`發生未知錯誤`}exports.TemplateDesignerView=D;
51
+ //# sourceMappingURL=index.cjs.map