@lovrabet/rabetbase-cli 2.5.8-beta.2 → 2.5.8

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 (376) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/api-group.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.js +1 -1
  6. package/lib/api/legacy-api-file.js +1 -1
  7. package/lib/api/model-registry-file.js +1 -1
  8. package/lib/api/model-registry-scaffold.js +1 -1
  9. package/lib/api/model-source.js +1 -1
  10. package/lib/auth/auth-server-ui.js +1 -1
  11. package/lib/auth/auth-server.js +1 -1
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.js +1 -1
  14. package/lib/auth/get-session-user.js +1 -1
  15. package/lib/auth/is-session-valid.js +1 -1
  16. package/lib/auth/login-success-html.js +1 -1
  17. package/lib/auth/logout.js +1 -1
  18. package/lib/cli-flags.js +1 -1
  19. package/lib/cli.js +1 -1
  20. package/lib/commands/api/generate.js +1 -1
  21. package/lib/commands/api/index.js +1 -1
  22. package/lib/commands/api/list.js +1 -1
  23. package/lib/commands/api/pull.js +1 -1
  24. package/lib/commands/api/shared.js +1 -1
  25. package/lib/commands/app/detail.js +1 -1
  26. package/lib/commands/app/index.js +1 -1
  27. package/lib/commands/app/list.js +1 -1
  28. package/lib/commands/app/members-list.js +1 -1
  29. package/lib/commands/app/remote-directory.js +1 -1
  30. package/lib/commands/app/shared.js +1 -1
  31. package/lib/commands/app-config/delete.js +1 -1
  32. package/lib/commands/app-config/get.js +1 -1
  33. package/lib/commands/app-config/index.js +1 -1
  34. package/lib/commands/app-config/list.js +1 -1
  35. package/lib/commands/app-config/set.js +1 -1
  36. package/lib/commands/app-config/shared.js +1 -1
  37. package/lib/commands/auth/index.js +1 -1
  38. package/lib/commands/bff/create.js +1 -1
  39. package/lib/commands/bff/delete.js +1 -1
  40. package/lib/commands/bff/detail.js +1 -1
  41. package/lib/commands/bff/index.js +1 -1
  42. package/lib/commands/bff/list.js +1 -1
  43. package/lib/commands/bff/logs.js +1 -1
  44. package/lib/commands/bff/pull.js +1 -1
  45. package/lib/commands/bff/push.js +1 -1
  46. package/lib/commands/bff/status.js +1 -1
  47. package/lib/commands/cli-skill/index.js +1 -1
  48. package/lib/commands/cli-update.js +1 -1
  49. package/lib/commands/codegen/index.js +1 -1
  50. package/lib/commands/codegen/sdk.js +1 -1
  51. package/lib/commands/codegen/sql.js +1 -1
  52. package/lib/commands/common/app-registry.js +1 -1
  53. package/lib/commands/common/app-selector.js +1 -1
  54. package/lib/commands/common/async-task.js +1 -1
  55. package/lib/commands/common/dry-run.js +1 -1
  56. package/lib/commands/common/flags.js +1 -1
  57. package/lib/commands/common/local-file.js +1 -1
  58. package/lib/commands/common/validate.js +1 -1
  59. package/lib/commands/config/delete.js +1 -1
  60. package/lib/commands/config/get.js +1 -1
  61. package/lib/commands/config/index.js +1 -1
  62. package/lib/commands/config/init.js +1 -1
  63. package/lib/commands/config/list.js +1 -1
  64. package/lib/commands/config/set.js +1 -1
  65. package/lib/commands/config/shared.js +1 -1
  66. package/lib/commands/dataset/batch-design.js +1 -1
  67. package/lib/commands/dataset/business-group-update.js +1 -1
  68. package/lib/commands/dataset/business-groups.js +1 -1
  69. package/lib/commands/dataset/capability.js +1 -1
  70. package/lib/commands/dataset/cross-relation-create.js +1 -1
  71. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  72. package/lib/commands/dataset/cross-relation-list.js +1 -1
  73. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  74. package/lib/commands/dataset/cross-relation-update.js +1 -1
  75. package/lib/commands/dataset/delete.js +1 -1
  76. package/lib/commands/dataset/design-context.js +1 -1
  77. package/lib/commands/dataset/design-start.js +1 -1
  78. package/lib/commands/dataset/design-status.js +1 -1
  79. package/lib/commands/dataset/design-sync-retry.js +1 -1
  80. package/lib/commands/dataset/design-sync-status.js +1 -1
  81. package/lib/commands/dataset/design-validate.js +1 -1
  82. package/lib/commands/dataset/detail.js +1 -1
  83. package/lib/commands/dataset/extend-update.js +1 -1
  84. package/lib/commands/dataset/field-restore.js +1 -1
  85. package/lib/commands/dataset/field-update.js +1 -1
  86. package/lib/commands/dataset/generate.js +1 -1
  87. package/lib/commands/dataset/index.js +1 -1
  88. package/lib/commands/dataset/list.js +1 -1
  89. package/lib/commands/dataset/operations.js +1 -1
  90. package/lib/commands/dataset/relation-audit.js +1 -1
  91. package/lib/commands/dataset/relation-create.js +1 -1
  92. package/lib/commands/dataset/relation-delete.js +1 -1
  93. package/lib/commands/dataset/relation-shared.js +1 -1
  94. package/lib/commands/dataset/relation-update.js +1 -1
  95. package/lib/commands/dataset/relations.js +1 -1
  96. package/lib/commands/dataset/rename.js +1 -1
  97. package/lib/commands/dataset/restore.js +1 -1
  98. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  99. package/lib/commands/db/analysis-batching.js +1 -1
  100. package/lib/commands/db/analyze-batch-plan.js +1 -1
  101. package/lib/commands/db/analyze-cancel.js +1 -1
  102. package/lib/commands/db/analyze-start.js +1 -1
  103. package/lib/commands/db/analyze-status.js +1 -1
  104. package/lib/commands/db/create.js +1 -1
  105. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  106. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  109. package/lib/commands/db/delete.js +1 -1
  110. package/lib/commands/db/detail.js +1 -1
  111. package/lib/commands/db/diff-refresh-start.js +1 -1
  112. package/lib/commands/db/diff-refresh-status.js +1 -1
  113. package/lib/commands/db/diff.js +1 -1
  114. package/lib/commands/db/index.js +1 -1
  115. package/lib/commands/db/list.js +1 -1
  116. package/lib/commands/db/shared.js +1 -1
  117. package/lib/commands/db/table-diff-shared.js +1 -1
  118. package/lib/commands/db/tables.js +1 -1
  119. package/lib/commands/db/test.js +1 -1
  120. package/lib/commands/db/update.js +1 -1
  121. package/lib/commands/deployment/index.js +1 -1
  122. package/lib/commands/deployment/sync-all.js +1 -1
  123. package/lib/commands/deployment/sync-jobs.js +1 -1
  124. package/lib/commands/deployment/sync-status.js +1 -1
  125. package/lib/commands/doctor.js +1 -1
  126. package/lib/commands/file/index.js +1 -1
  127. package/lib/commands/flow/create.js +1 -1
  128. package/lib/commands/flow/detail.js +1 -1
  129. package/lib/commands/flow/index.js +1 -1
  130. package/lib/commands/flow/list.js +1 -1
  131. package/lib/commands/flow/page-list.js +1 -1
  132. package/lib/commands/flow/publish.js +1 -1
  133. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  134. package/lib/commands/flow/runtime-role-list.js +1 -1
  135. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  136. package/lib/commands/flow/runtime-user-search.js +1 -1
  137. package/lib/commands/flow/shared.js +1 -1
  138. package/lib/commands/flow/update.js +1 -1
  139. package/lib/commands/flow/validate.js +1 -1
  140. package/lib/commands/instant-api-policy/current.js +1 -1
  141. package/lib/commands/instant-api-policy/index.js +1 -1
  142. package/lib/commands/instant-api-policy/init.js +1 -1
  143. package/lib/commands/instant-api-policy/publish.js +1 -1
  144. package/lib/commands/instant-api-policy/pull.js +1 -1
  145. package/lib/commands/instant-api-policy/revision.js +1 -1
  146. package/lib/commands/instant-api-policy/revisions.js +1 -1
  147. package/lib/commands/instant-api-policy/rollback.js +1 -1
  148. package/lib/commands/instant-api-policy/shared.js +1 -1
  149. package/lib/commands/instant-api-policy/validate.js +1 -1
  150. package/lib/commands/issue/index.js +1 -1
  151. package/lib/commands/issue/nudge.js +1 -1
  152. package/lib/commands/issue/report.js +1 -1
  153. package/lib/commands/issue/shared.js +1 -1
  154. package/lib/commands/kb/create.js +1 -1
  155. package/lib/commands/kb/delete.js +1 -1
  156. package/lib/commands/kb/detail.js +1 -1
  157. package/lib/commands/kb/index.js +1 -1
  158. package/lib/commands/kb/list.js +1 -1
  159. package/lib/commands/kb/search.js +1 -1
  160. package/lib/commands/kb/shared.js +1 -1
  161. package/lib/commands/kb/update.js +1 -1
  162. package/lib/commands/logs/index.js +1 -1
  163. package/lib/commands/menu/asset-update.js +1 -1
  164. package/lib/commands/menu/delete.js +1 -1
  165. package/lib/commands/menu/external-link-create.js +1 -1
  166. package/lib/commands/menu/external-link-update.js +1 -1
  167. package/lib/commands/menu/group-create.js +1 -1
  168. package/lib/commands/menu/group-update.js +1 -1
  169. package/lib/commands/menu/index.js +1 -1
  170. package/lib/commands/menu/list.js +1 -1
  171. package/lib/commands/menu/move.js +1 -1
  172. package/lib/commands/menu/regroup-start.js +1 -1
  173. package/lib/commands/menu/rename.js +1 -1
  174. package/lib/commands/menu/shared/compare-table.js +1 -1
  175. package/lib/commands/menu/shared/delete-plan.js +1 -1
  176. package/lib/commands/menu/shared/facts.js +1 -1
  177. package/lib/commands/menu/shared/index.js +1 -1
  178. package/lib/commands/menu/shared/inquirer.js +1 -1
  179. package/lib/commands/menu/shared/local-pages.js +1 -1
  180. package/lib/commands/menu/shared/logic.js +1 -1
  181. package/lib/commands/menu/shared/mutations.js +1 -1
  182. package/lib/commands/menu/shared/path.js +1 -1
  183. package/lib/commands/menu/shared/service.js +1 -1
  184. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  185. package/lib/commands/menu/shared/sync-core.js +1 -1
  186. package/lib/commands/menu/shared/update-core.js +1 -1
  187. package/lib/commands/menu/shared/valid-url.js +1 -1
  188. package/lib/commands/menu/subapp-assets-status.js +1 -1
  189. package/lib/commands/menu/subapp-assets-update.js +1 -1
  190. package/lib/commands/menu/sync.js +1 -1
  191. package/lib/commands/menu/visibility-update.js +1 -1
  192. package/lib/commands/notification/config-create.js +1 -1
  193. package/lib/commands/notification/config-delete.js +1 -1
  194. package/lib/commands/notification/config-list.js +1 -1
  195. package/lib/commands/notification/config-update.js +1 -1
  196. package/lib/commands/notification/index.js +1 -1
  197. package/lib/commands/notification/shared.js +1 -1
  198. package/lib/commands/ocr/index.js +1 -1
  199. package/lib/commands/page/create.js +1 -1
  200. package/lib/commands/page/custom/detail.js +1 -1
  201. package/lib/commands/page/custom/list.js +1 -1
  202. package/lib/commands/page/custom/publish.js +1 -1
  203. package/lib/commands/page/custom/shared.js +1 -1
  204. package/lib/commands/page/custom/syntax.js +1 -1
  205. package/lib/commands/page/custom/update.js +1 -1
  206. package/lib/commands/page/data-list-status.js +1 -1
  207. package/lib/commands/page/generate-start.js +1 -1
  208. package/lib/commands/page/generate-status.js +1 -1
  209. package/lib/commands/page/index.js +1 -1
  210. package/lib/commands/page/pull.js +1 -1
  211. package/lib/commands/page/push.js +1 -1
  212. package/lib/commands/page/relation-audit.js +1 -1
  213. package/lib/commands/page/restore.js +1 -1
  214. package/lib/commands/page/shared.js +1 -1
  215. package/lib/commands/page/sync.js +1 -1
  216. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  217. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  218. package/lib/commands/project/create/format-elapsed.js +1 -1
  219. package/lib/commands/project/create/main.js +1 -1
  220. package/lib/commands/project/create/materialize-project-template.js +1 -1
  221. package/lib/commands/project/create/project-name.js +1 -1
  222. package/lib/commands/project/create/project-template-archive.js +1 -1
  223. package/lib/commands/project/create/project-template-path.js +1 -1
  224. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  225. package/lib/commands/project/create/use-format-code.js +1 -1
  226. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  227. package/lib/commands/project/domain-routing-sync.js +1 -1
  228. package/lib/commands/project/index.js +1 -1
  229. package/lib/commands/project/upgrade.js +1 -1
  230. package/lib/commands/registry.js +1 -1
  231. package/lib/commands/role/delete.js +1 -1
  232. package/lib/commands/role/detail.js +1 -1
  233. package/lib/commands/role/index.js +1 -1
  234. package/lib/commands/role/list.js +1 -1
  235. package/lib/commands/role/shared.js +1 -1
  236. package/lib/commands/role/update.js +1 -1
  237. package/lib/commands/role/user-add.js +1 -1
  238. package/lib/commands/role/user-remove.js +1 -1
  239. package/lib/commands/role/user-resolve.js +1 -1
  240. package/lib/commands/rule/get.js +1 -1
  241. package/lib/commands/rule/index.js +1 -1
  242. package/lib/commands/rule/list.js +1 -1
  243. package/lib/commands/rule/set.js +1 -1
  244. package/lib/commands/rule/shared.js +1 -1
  245. package/lib/commands/run/index.js +1 -1
  246. package/lib/commands/schema.js +1 -1
  247. package/lib/commands/sql/create.js +1 -1
  248. package/lib/commands/sql/delete.js +1 -1
  249. package/lib/commands/sql/detail.js +1 -1
  250. package/lib/commands/sql/exec.js +1 -1
  251. package/lib/commands/sql/index.js +1 -1
  252. package/lib/commands/sql/list.js +1 -1
  253. package/lib/commands/sql/pull.js +1 -1
  254. package/lib/commands/sql/push.js +1 -1
  255. package/lib/commands/sql/shared.js +1 -1
  256. package/lib/commands/sql/status.js +1 -1
  257. package/lib/commands/sql/validate.js +1 -1
  258. package/lib/commands/task/index.js +1 -1
  259. package/lib/commands/task/status.js +1 -1
  260. package/lib/commands/tenant/index.js +1 -1
  261. package/lib/commands/tenant/members-list.js +1 -1
  262. package/lib/commands/tenant/shared.js +1 -1
  263. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  264. package/lib/commands/user-account/feishu-bind.js +1 -1
  265. package/lib/commands/user-account/index.js +1 -1
  266. package/lib/commands/workspace/add.js +1 -1
  267. package/lib/commands/workspace/index.js +1 -1
  268. package/lib/commands/workspace/remove.js +1 -1
  269. package/lib/config/domain-config.js +1 -1
  270. package/lib/config/project-domain-routing.js +1 -1
  271. package/lib/config/region-config.js +1 -1
  272. package/lib/config/schema.js +1 -1
  273. package/lib/constant/cdn.js +1 -1
  274. package/lib/constant/cli.js +1 -1
  275. package/lib/constant/defaults.js +1 -1
  276. package/lib/constant/domain.js +1 -1
  277. package/lib/constant/env.js +1 -1
  278. package/lib/constant/output.js +1 -1
  279. package/lib/constant/paths.js +1 -1
  280. package/lib/constant/region.js +1 -1
  281. package/lib/constant/risk.js +1 -1
  282. package/lib/constant/routing-profile.js +1 -1
  283. package/lib/context/app-resolver.js +1 -1
  284. package/lib/context/auth-resolver.js +1 -1
  285. package/lib/context/config-loader.js +1 -1
  286. package/lib/context.js +1 -1
  287. package/lib/core/alias-resolver.js +1 -1
  288. package/lib/core/api-client.js +1 -1
  289. package/lib/core/bff/config.js +1 -1
  290. package/lib/core/bff/file-system.js +1 -1
  291. package/lib/core/bff/hash.js +1 -1
  292. package/lib/core/bff/hook-directory.js +1 -1
  293. package/lib/core/bff/lock.js +1 -1
  294. package/lib/core/bff/utils.js +1 -1
  295. package/lib/core/cross-db-analysis.js +1 -1
  296. package/lib/core/cross-db-relation.js +1 -1
  297. package/lib/core/db-resolver.js +1 -1
  298. package/lib/core/flow-config.js +1 -1
  299. package/lib/core/instant-api-policy/config.js +1 -1
  300. package/lib/core/kb-management-client.js +1 -1
  301. package/lib/core/kb-search-client.js +1 -1
  302. package/lib/core/page/file-system.js +1 -1
  303. package/lib/core/page/hash.js +1 -1
  304. package/lib/core/page/lock.js +1 -1
  305. package/lib/core/page/lr-smart-jsx.js +1 -1
  306. package/lib/core/sql-index-auditor.js +1 -1
  307. package/lib/core/sql-sync/config.js +1 -1
  308. package/lib/core/sql-sync/file-system.js +1 -1
  309. package/lib/core/sql-sync/hash.js +1 -1
  310. package/lib/core/sql-sync/lock.js +1 -1
  311. package/lib/core/sql-sync/utils.js +1 -1
  312. package/lib/core/sql-validator.js +1 -1
  313. package/lib/errors.js +1 -1
  314. package/lib/framework/build-all-flags.js +1 -1
  315. package/lib/framework/error-output.js +1 -1
  316. package/lib/framework/explicit-yes.js +1 -1
  317. package/lib/framework/flags.js +1 -1
  318. package/lib/framework/help.js +1 -1
  319. package/lib/framework/index.js +1 -1
  320. package/lib/framework/output.js +1 -1
  321. package/lib/framework/response.js +1 -1
  322. package/lib/framework/runner-alias.js +1 -1
  323. package/lib/framework/runner.js +1 -1
  324. package/lib/framework/schema-export.js +1 -1
  325. package/lib/framework/supported-flags.js +1 -1
  326. package/lib/framework/types.js +1 -1
  327. package/lib/generated/build-info.d.ts +4 -4
  328. package/lib/generated/build-info.js +1 -1
  329. package/lib/generated/official-routing.js +1 -1
  330. package/lib/generated/routing-contract.js +1 -1
  331. package/lib/help.js +1 -1
  332. package/lib/postinstall.js +1 -1
  333. package/lib/runtime/confirmation.js +1 -1
  334. package/lib/runtime/event.js +1 -1
  335. package/lib/runtime/index.js +1 -1
  336. package/lib/runtime/queue.js +1 -1
  337. package/lib/runtime/resolve.js +1 -1
  338. package/lib/services/dataset-design/checkpoint.js +1 -1
  339. package/lib/services/dataset-design/commands.js +1 -1
  340. package/lib/services/dataset-design/contract.js +1 -1
  341. package/lib/skills/builtin-skill.js +1 -1
  342. package/lib/skills/main.js +1 -1
  343. package/lib/skills/npx-skills-add.js +1 -1
  344. package/lib/skills/skill-presence.js +1 -1
  345. package/lib/telemetry/cli-command-trace.js +1 -1
  346. package/lib/telemetry/cli-help-trace.js +1 -1
  347. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  348. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  349. package/lib/telemetry/send-cli-trace-log.js +1 -1
  350. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  351. package/lib/utils/ai_config.js +1 -1
  352. package/lib/utils/apply-jq-filter.js +1 -1
  353. package/lib/utils/cdn-config.js +1 -1
  354. package/lib/utils/check-sdk-version.js +1 -1
  355. package/lib/utils/cli-version-check.js +1 -1
  356. package/lib/utils/cli-version-policy.js +1 -1
  357. package/lib/utils/config.js +1 -1
  358. package/lib/utils/entity-with-id.js +1 -1
  359. package/lib/utils/file-utils.js +1 -1
  360. package/lib/utils/guides-cdn.js +1 -1
  361. package/lib/utils/http-client.js +1 -1
  362. package/lib/utils/is-non-interactive.js +1 -1
  363. package/lib/utils/logger.js +1 -1
  364. package/lib/utils/params.js +1 -1
  365. package/lib/utils/platform.js +1 -1
  366. package/lib/utils/sleep.js +1 -1
  367. package/lib/utils/template-replacer.js +1 -1
  368. package/lib/utils/update-notice.js +1 -1
  369. package/lib/utils/version.js +1 -1
  370. package/lib/utils/with-active-cookie.js +1 -1
  371. package/lib/utils/write-cli-side-channel.js +1 -1
  372. package/package.json +1 -1
  373. package/skills/rabetbase/SKILL.md +1 -1
  374. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  375. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  376. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a299_0x15fb09=a299_0x3f2b;(function(_0x52681d,_0x22288d){const _0x393054=a299_0x3f2b,_0x120d91=_0x52681d();while(!![]){try{const _0x2239d7=-parseInt(_0x393054(0x1b6))/0x1*(-parseInt(_0x393054(0x25c))/0x2)+parseInt(_0x393054(0x119))/0x3+-parseInt(_0x393054(0x12e))/0x4*(parseInt(_0x393054(0x1ef))/0x5)+parseInt(_0x393054(0x180))/0x6+parseInt(_0x393054(0x200))/0x7*(parseInt(_0x393054(0x14d))/0x8)+parseInt(_0x393054(0x16c))/0x9+-parseInt(_0x393054(0x224))/0xa*(parseInt(_0x393054(0x126))/0xb);if(_0x2239d7===_0x22288d)break;else _0x120d91['push'](_0x120d91['shift']());}catch(_0x13e5d3){_0x120d91['push'](_0x120d91['shift']());}}}(a299_0x2763,0x36907));import{randomUUID}from'node:crypto';function a299_0x2763(){const _0x4f8310=['failurePolicy','CONDITION\x20non-default\x20edge\x20must\x20use\x20conditionType\x20EXPRESSION.','ROLE','.transferCandidates.userIds','.timeout.action','Duplicate\x20node\x20id:\x20','hasOwnProperty','.cc.recipientUserIds','isArray','parse','.timeout.interrupting','mode','HANDLE\x20task\x20requires\x20exactly\x20one\x20outgoing\x20edge.','approval_sys_dataId','APPROVAL\x20node\x20requires\x20exactly\x20one\x20REJECTED\x20outgoing\x20edge.','^[1-9][0-9]*$','EMAIL','approval_sys_datasetCode','Flow\x20must\x20contain\x20exactly\x20one\x20START\x20node.','interrupting','duration\x20requires\x20value\x20and\x20unit.','edge\x20must\x20be\x20an\x20object.','.text','flowDesc','defaultFlow\x20must\x20be\x20a\x20boolean.','23mvZKvD','SINGLE','map','Default\x20cc\x20is\x20only\x20supported\x20by\x20APPROVAL\x20or\x20END\x20node.','FIXED','approval_sys_pageId','assignee','flowJson.startPath','.async.enabled','Every\x20node\x20requires\x20position.x\x20and\x20position.y.','timeout\x20must\x20be\x20an\x20object.','approval_sys_initiatorUsername','Unsupported\x20pageMode:\x20','integer','flowName','recipientUserIds','bindDatasetCode','HANDLE\x20task\x20timeout\x20only\x20supports\x20EXECUTE_BFF.','string','EXECUTE_BFF\x20timeout\x20requires\x20scriptName.','configCode','APPROVAL','USER','.position','Reserved\x20resultVariable:\x20','version','.\x20This\x20CLI\x20supports\x20only\x20','approval_sys_processInstanceId','entries','sourceNodeId','A\x20default\x20flow\x20must\x20not\x20have\x20an\x20expression.','#/$defs/flowNode','fixed\x20assignee\x20userId\x20must\x20be\x20a\x20non-empty\x20string\x20or\x20positive\x20integer.','PLATFORM_FORM\x20is\x20not\x20supported\x20by\x20this\x20rabetbase\x20version;\x20use\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.','#/$defs/flowEdge','^[A-Za-z_][A-Za-z0-9_]*$','trim','APPROVAL\x20task\x20decision\x20edges\x20must\x20not\x20be\x20default\x20flows.','legacy_field_removed','Unsupported\x20schemaVersion:\x20','Accepted\x20as\x20legacy\x20input\x20and\x20removed\x20during\x20normalization;\x20other\x20versions\x20are\x20unsupported.','SECONDS','startPath','Notification\x20configCode\x20is\x20required.','waypoints','node\x20id\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','retryCount','.assignee.roleId','empty_metadata_removed','async\x20execution\x20is\x20only\x20supported\x20by\x20SCRIPT\x20node.','Node\x20has\x20no\x20outgoing\x20edge.','BCC','approval_sys_','.value','resultVariable','Notification\x20action.text\x20is\x20required.','value\x20must\x20be\x20an\x20array.','1209535XcTRzk','approval_sys_initiatorUserId','matchAll','.timeout.resultVariable','.url','transferCandidates\x20currently\x20supports\x20FIXED\x20only.','length','approval_sys_appCode','Flow\x20must\x20contain\x20at\x20least\x20one\x20END\x20node.','context','APPROVED','.taskMode','.timeout','Notification\x20recipients\x20must\x20be\x20an\x20array.','formPermission','approvalMode','EXECUTE_BFF','1006887JsUjmU','.position.','NaN','metadata','prototype','pageMode\x20applies\x20only\x20to\x20INDEPENDENT_FLOW.','Duplicate\x20BPMN\x20element\x20id:\x20','userIds','INDEPENDENT_FLOW','position','FORM_FLOW\x20is\x20an\x20approval\x20flow\x20and\x20cannot\x20contain\x20HANDLE\x20tasks;\x20use\x20INDEPENDENT_FLOW\x20for\x20workflows.','approval.simple-flow.v1','formSchema','roleId','visible','test','call','source','warnings','flowName\x20is\x20required.','edge\x20name\x20must\x20be\x20a\x20string.','unit','Edge\x20target\x20node\x20not\x20found:\x20','ALWAYS','includes','summary','HANDLE','every','Unsupported\x20notification\x20version:\x20','Notification\x20action.url\x20is\x20required.','Duplicate\x20value:\x20','toUpperCase','flowJson.','flowJson.edges[','join','conditionType','39940zColti','indexOf','\x20->\x20','FAIL','Custom\x20form\x20configuration\x20is\x20not\x20supported\x20by\x20this\x20rabetbase\x20version;\x20use\x20a\x20business\x20custom\x20page\x20instead.','#/$defs/userId','object','templateName','flowJson.nodes','detailMarkdown','async.enabled\x20must\x20be\x20a\x20boolean.','INDEPENDENT_FLOW\x20cannot\x20bind\x20pageIds.','.assignee.strategy','].path','flowJson.nodes[',',\x20but\x20node\x20','\x20value\x20and\x20was\x20removed\x20from\x20the\x20portable\x20FlowConfig.','.conditionType','boolean','result','variables','sequential','actions','START','schemaVersion','timeout\x20is\x20only\x20supported\x20by\x20APPROVAL\x20node.','flowCode','path','Notification\x20recipient.role\x20must\x20be\x20TO,\x20CC,\x20or\x20BCC.','REJECTED','#/$defs/timeAmount','Duplicate\x20edge\x20route:\x20','enabled','MAX_SAFE_INTEGER','.id','value','].taskMode','.source','startPageId\x20is\x20no\x20longer\x20supported;\x20use\x20startPath\x20instead.','isFinite','flowJson.nodes.','Notification\x20action.url\x20must\x20use\x20http/https\x20or\x20a\x20complete\x20supported\x20placeholder.','cc.recipientUserIds\x20supports\x20at\x20most\x20','SINGLE\x20approval\x20supports\x20only\x20one\x20fixed\x20user.','SCRIPT\x20async\x20retryCount\x20must\x20be\x20between\x201\x20and\x20','set','duration\x20unit\x20must\x20be\x20SECONDS,\x20MINUTES,\x20HOURS,\x20or\x20DAYS.','CONDITION','cc.recipientUserIds\x20must\x20be\x20a\x20non-empty\x20array.','flowJson','catch','datasetCode','.sequential','.defaultFlow','isSafeInteger','.detailMarkdown','30598YXOmuO','startPath\x20applies\x20only\x20to\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.','\x20users.','Notification\x20configCode\x20must\x20be\x20a\x20fixed\x20value.','assignee.strategy\x20must\x20be\x20FIXED\x20or\x20ROLE.','APPROVAL\x20node\x20outgoing\x20edges\x20must\x20use\x20APPROVED\x20or\x20REJECTED.','Notification\x20fact\x20must\x20be\x20an\x20object.','.target','.tmp','Unsupported\x20task\x20mode:\x20','.approvalMode','.recipients','name','ALL','\x20was\x20empty\x20or\x20used\x20the\x20default\x20','edges','CONTINUE','url','Node\x20cannot\x20reach\x20any\x20END.','\x20is\x20required.','.failurePolicy','label','template','flowJson\x20must\x20be\x20an\x20object.','\x20must\x20be\x20a\x20finite\x20number.','approved','push','\x20must\x20be\x20a\x20finite\x20number\x20greater\x20than\x20or\x20equal\x20to\x200.','flowType','.role','action','.transferCandidates.userIds[','scriptName','slice','message','.transferCandidates.strategy','HOURS','Unsupported\x20condition\x20type:\x20','waypoint.','type','119217fJorni','has','async','strategy','END','utf8','INDEPENDENT_FLOW\x20cannot\x20bind\x20datasetCode.','edge\x20id\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','Duplicate\x20resultVariable:\x20','FORM_FLOW','START\x20node\x20must\x20not\x20have\x20incoming\x20edges.','targetNodeId','.timeout.scriptName','2310NpbZel','ANY','pageIds\x20exceeds\x20the\x202048-character\x20binding\x20limit.','.cc.visible','size','\x20actions.','expression','node\x20path\x20must\x20be\x20a\x20non-empty\x20string.','4AWAOQn','AUTO_APPROVE','add','position.','CONDITION\x20node\x20requires\x20exactly\x20one\x20default\x20outgoing\x20edge.','flowType\x20is\x20required.','.waypoints[','title','.version','.assignee','https://json-schema.org/draft/2020-12/schema','get','target','.name','PLATFORM_FORM','.actions','pageIds','.path','Notification\x20recipient.type\x20must\x20be\x20USER,\x20ROLE,\x20or\x20EMAIL.','findIndex','INDEPENDENT_FLOW\x20cannot\x20bind\x20pageId.','appCode','number','.config','replace','Unsupported\x20notification\x20placeholder:\x20','defaultFlow','event','CONDITION\x20default\x20edge\x20must\x20use\x20conditionType\x20ALWAYS.','keys','edge\x20target\x20is\x20required.','24HsBEWx','.scriptName','SCRIPT','retryInterval','Notification\x20recipient.value\x20is\x20required.','pageId','Notification\x20text\x20contains\x20a\x20malformed\x20placeholder.','scriptResult','.async.retryInterval','flowJson.pageMode','taskMode','some','cc\x20recipient\x20userId\x20must\x20be\x20a\x20non-empty\x20string.','transferCandidates','array','SCRIPT\x20node\x20requires\x20scriptName.','async\x20must\x20be\x20an\x20object.','https://lovrabet.com/schema/rabetbase-flow-config.json','pageMode','startPageId','NOTIFICATION','flowDesc\x20must\x20be\x20a\x20string.','FIXED\x20transferCandidates\x20requires\x20non-empty\x20userIds.','facts','pageId\x20must\x20be\x20a\x20positive\x20safe\x20integer.','approval_sys_operationType','role','datasetCode\x20must\x20be\x20a\x20string.','AUTO_REJECT','Expression\x20references\x20SCRIPT\x20resultVariable\x20','delete','2274084CpYcCX','Notification\x20recipient\x20must\x20be\x20an\x20object.','nodes','DAYS','flowJson.edges','END\x20node\x20must\x20not\x20have\x20outgoing\x20edges.','.async.retryCount','.cc.recipientUserIds[','\x20was\x20empty\x20and\x20was\x20removed.','\x20is\x20not\x20part\x20of\x20the\x20portable\x20FlowConfig\x20and\x20was\x20removed.','resultVariable\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','MINUTES','.resultVariable','Notification\x20template\x20supports\x20at\x20most\x20','#/$defs/position','.expression','flowKey','isInteger','CUSTOM_PAGE','cc\x20must\x20be\x20an\x20object.','1369962cnBFur','stringify','Edge\x20source\x20node\x20not\x20found:\x20','timeout','Notification\x20recipient.role\x20must\x20be\x20a\x20string.','flowJson.schemaVersion','Unsupported\x20node\x20type:\x20','EXPRESSION','forEach','pid','.configCode','formDefinitions','APPROVAL\x20node\x20requires\x20exactly\x20one\x20APPROVED\x20outgoing\x20edge.','.type','transfer\x20candidate\x20userId\x20must\x20be\x20a\x20non-empty\x20string\x20or\x20positive\x20integer.','.facts','failurePolicy\x20must\x20be\x20a\x20string.','startsWith','.template','.assignee.userIds','\x20facts.','.timeout.duration','.async','filter','sequential\x20must\x20be\x20a\x20boolean.','Approval\x20flow\x20requires\x20an\x20END\x20node\x20with\x20result\x20','node\x20pageId\x20is\x20no\x20longer\x20supported;\x20use\x20node\x20path\x20instead.','transferCandidates\x20must\x20be\x20an\x20object.','edges\x20must\x20be\x20an\x20array.'];a299_0x2763=function(){return _0x4f8310;};return a299_0x2763();}import{chmod,link,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{resolve}from'node:path';export const FLOW_CONFIG_JSON_SCHEMA={'$schema':a299_0x15fb09(0x138),'$id':a299_0x15fb09(0x15e),'title':'Rabetbase\x20FlowConfig','type':a299_0x15fb09(0x22a),'required':[a299_0x15fb09(0x1c4),a299_0x15fb09(0x10d),a299_0x15fb09(0x255)],'$defs':{'userId':{'anyOf':[{'type':a299_0x15fb09(0x1c8),'minLength':0x1},{'type':'integer','minimum':0x1}]},'position':{'type':a299_0x15fb09(0x22a),'required':['x','y'],'properties':{'x':{'type':a299_0x15fb09(0x144),'minimum':0x0},'y':{'type':a299_0x15fb09(0x144),'minimum':0x0}},'additionalProperties':!![]},'timeAmount':{'type':a299_0x15fb09(0x22a),'required':['value',a299_0x15fb09(0x215)],'properties':{'value':{'type':'integer','minimum':0x1},'unit':{'enum':[a299_0x15fb09(0x1df),a299_0x15fb09(0x177),'HOURS',a299_0x15fb09(0x16f)]}},'additionalProperties':!![]},'flowNode':{'type':a299_0x15fb09(0x22a),'required':['id',a299_0x15fb09(0x118),a299_0x15fb09(0x268),'position'],'properties':{'id':{'type':'string','pattern':a299_0x15fb09(0x1d9)},'type':{'enum':[a299_0x15fb09(0x23b),a299_0x15fb09(0x11d),'APPROVAL',a299_0x15fb09(0x253),a299_0x15fb09(0x14f),'NOTIFICATION']},'name':{'type':'string','minLength':0x1},'path':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'position':{'$ref':a299_0x15fb09(0x17a)},'approvalMode':{'enum':[a299_0x15fb09(0x1b7),'ALL',a299_0x15fb09(0x127)]},'taskMode':{'enum':[a299_0x15fb09(0x1cb),a299_0x15fb09(0x21a)]},'assignee':{'type':a299_0x15fb09(0x22a),'required':[a299_0x15fb09(0x11c)],'properties':{'strategy':{'enum':[a299_0x15fb09(0x1ba),'ROLE']},'userIds':{'type':a299_0x15fb09(0x15b),'minItems':0x1,'items':{'$ref':a299_0x15fb09(0x229)}},'roleId':{'anyOf':[{'type':'integer','minimum':0x1},{'type':a299_0x15fb09(0x1c8),'pattern':a299_0x15fb09(0x1ac)}]}},'additionalProperties':!![]},'transferCandidates':{'type':a299_0x15fb09(0x22a),'required':[a299_0x15fb09(0x11c),a299_0x15fb09(0x207)],'properties':{'strategy':{'const':'FIXED'},'userIds':{'type':a299_0x15fb09(0x15b),'minItems':0x1,'items':{'$ref':a299_0x15fb09(0x229)}}},'additionalProperties':!![]},'sequential':{'type':a299_0x15fb09(0x236)},'result':{'enum':[a299_0x15fb09(0x1f9),a299_0x15fb09(0x241)]},'scriptName':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'resultVariable':{'type':'string','pattern':'^[A-Za-z_][A-Za-z0-9_]*$'},'async':{'type':'object','properties':{'enabled':{'type':a299_0x15fb09(0x236)},'retryCount':{'type':a299_0x15fb09(0x1c3),'minimum':0x1,'maximum':0xa},'retryInterval':{'$ref':'#/$defs/timeAmount'}},'additionalProperties':!![]},'timeout':{'type':a299_0x15fb09(0x22a),'properties':{'enabled':{'type':a299_0x15fb09(0x236)},'duration':{'$ref':a299_0x15fb09(0x242)},'action':{'enum':[a299_0x15fb09(0x12f),'AUTO_REJECT','EXECUTE_BFF']},'interrupting':{'type':a299_0x15fb09(0x236)},'scriptName':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'resultVariable':{'type':a299_0x15fb09(0x1c8),'pattern':a299_0x15fb09(0x1d9)}},'additionalProperties':!![]},'cc':{'type':'object','required':[a299_0x15fb09(0x1c5)],'properties':{'recipientUserIds':{'type':'array','minItems':0x1,'maxItems':0x64,'uniqueItems':!![],'items':{'type':a299_0x15fb09(0x1c8),'minLength':0x1}},'visible':{'type':a299_0x15fb09(0x15b),'uniqueItems':!![],'items':{'type':'string','minLength':0x1}},'readSources':![]},'additionalProperties':!![]},'config':{'type':'object','required':[a299_0x15fb09(0x1ca),a299_0x15fb09(0x107)],'properties':{'version':{'enum':['v1']},'configCode':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'failurePolicy':{'enum':[a299_0x15fb09(0x101),a299_0x15fb09(0x227)]},'template':{'type':'object','required':[a299_0x15fb09(0x135),'summary'],'properties':{'title':{'type':'string','minLength':0x1},'summary':{'type':'string','minLength':0x1},'detailMarkdown':{'type':a299_0x15fb09(0x1c8)},'facts':{'type':a299_0x15fb09(0x15b),'maxItems':0x8,'items':{'type':a299_0x15fb09(0x22a),'required':[a299_0x15fb09(0x106),a299_0x15fb09(0x247)],'properties':{'label':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'value':{'type':'string','minLength':0x1}},'additionalProperties':!![]}},'actions':{'type':a299_0x15fb09(0x15b),'maxItems':0x2,'items':{'type':'object','required':['text',a299_0x15fb09(0x102)],'properties':{'text':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'url':{'type':a299_0x15fb09(0x1c8),'minLength':0x1}},'additionalProperties':!![]}}},'additionalProperties':!![]},'recipients':{'type':a299_0x15fb09(0x15b),'items':{'type':'object','required':['type','value'],'properties':{'type':{'enum':['USER',a299_0x15fb09(0x19f),'EMAIL']},'value':{'type':'string','minLength':0x1},'role':{'enum':['TO','CC',a299_0x15fb09(0x1e9)]}},'additionalProperties':!![]}}},'additionalProperties':!![]},'form':![],'formPermission':![]},'additionalProperties':!![]},'flowEdge':{'type':a299_0x15fb09(0x22a),'properties':{'id':{'type':a299_0x15fb09(0x1c8),'pattern':a299_0x15fb09(0x1d9)},'source':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'target':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'sourceNodeId':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'targetNodeId':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'conditionType':{'enum':['ALWAYS',a299_0x15fb09(0x1f9),a299_0x15fb09(0x241),a299_0x15fb09(0x187)]},'expression':{'type':a299_0x15fb09(0x1c8)},'defaultFlow':{'type':'boolean'},'name':{'type':a299_0x15fb09(0x1c8)},'waypoints':{'type':a299_0x15fb09(0x15b),'items':{'$ref':a299_0x15fb09(0x17a)}}},'allOf':[{'anyOf':[{'required':['source']},{'required':[a299_0x15fb09(0x1d3)]}]},{'anyOf':[{'required':[a299_0x15fb09(0x13a)]},{'required':['targetNodeId']}]}],'additionalProperties':!![]}},'properties':{'id':![],'appCode':![],'flowName':{'type':'string','minLength':0x1},'flowDesc':{'type':a299_0x15fb09(0x1c8)},'flowType':{'enum':[a299_0x15fb09(0x122),a299_0x15fb09(0x208)]},'datasetCode':{'type':'string','minLength':0x1},'pageId':{'type':a299_0x15fb09(0x1c3),'minimum':0x1,'maximum':Number[a299_0x15fb09(0x245)]},'pageIds':{'type':'array','items':{'type':a299_0x15fb09(0x1c3),'minimum':0x1,'maximum':Number[a299_0x15fb09(0x245)]}},'templateName':![],'flowJson':{'type':a299_0x15fb09(0x22a),'required':['nodes',a299_0x15fb09(0x26b)],'properties':{'flowKey':![],'flowCode':![],'flowName':![],'bindDatasetCode':![],'datasetCode':![],'appCode':![],'pageId':![],'templateName':![],'schemaVersion':{'type':a299_0x15fb09(0x1c8),'const':a299_0x15fb09(0x20b),'description':a299_0x15fb09(0x1de)},'formSchema':![],'formDefinitions':![],'formPermissions':![],'pageMode':{'const':a299_0x15fb09(0x17e)},'startPageId':![],'startPath':{'type':a299_0x15fb09(0x1c8),'minLength':0x1},'nodes':{'type':a299_0x15fb09(0x15b),'minItems':0x1,'items':{'$ref':a299_0x15fb09(0x1d5)}},'edges':{'type':'array','minItems':0x1,'items':{'$ref':a299_0x15fb09(0x1d8)}}},'additionalProperties':!![]}},'additionalProperties':!![]};const REMOVED_FLOW_JSON_FIELDS=[a299_0x15fb09(0x17c),a299_0x15fb09(0x23e),a299_0x15fb09(0x1c4),a299_0x15fb09(0x1c6),a299_0x15fb09(0x257),a299_0x15fb09(0x143),a299_0x15fb09(0x152),'templateName'],REMOVED_ROOT_FIELDS=['id',a299_0x15fb09(0x143),a299_0x15fb09(0x22b)],DEFAULT_FLOW_SCHEMA_VERSION=a299_0x15fb09(0x20b),NODE_TYPES=new Set([a299_0x15fb09(0x23b),a299_0x15fb09(0x11d),a299_0x15fb09(0x1cb),a299_0x15fb09(0x253),a299_0x15fb09(0x14f),a299_0x15fb09(0x161)]),CONDITION_TYPES=new Set([a299_0x15fb09(0x217),a299_0x15fb09(0x1f9),a299_0x15fb09(0x241),a299_0x15fb09(0x187)]),APPROVAL_MODES=new Set([a299_0x15fb09(0x1b7),a299_0x15fb09(0x269),'ANY']),APPROVAL_TASK_MODES=new Set([a299_0x15fb09(0x1cb),a299_0x15fb09(0x21a)]),FLOW_TIME_UNITS=new Set([a299_0x15fb09(0x1df),a299_0x15fb09(0x177),a299_0x15fb09(0x115),a299_0x15fb09(0x16f)]),APPROVAL_TIMEOUT_ACTIONS=new Set([a299_0x15fb09(0x12f),a299_0x15fb09(0x169),a299_0x15fb09(0x1ff)]),FLOW_TYPES=new Set([a299_0x15fb09(0x122),'INDEPENDENT_FLOW']),FLOW_PAGE_MODES=new Set([a299_0x15fb09(0x17e),a299_0x15fb09(0x13c)]),BPMN_ID_PATTERN=/^[A-Za-z_][A-Za-z0-9_]*$/,VARIABLE_PATTERN=/^[A-Za-z_][A-Za-z0-9_]*$/,NOTIFICATION_PLACEHOLDER_PATTERN=/\$\{([^{}]+)\}/g,NOTIFICATION_ACTION_URL_PLACEHOLDER_PATTERN=/^\$\{(?:event|context|variables)\.[^{}]+\}$/,NOTIFICATION_FAILURE_POLICIES=new Set([a299_0x15fb09(0x101),a299_0x15fb09(0x227)]),NOTIFICATION_RECIPIENT_TYPES=new Set([a299_0x15fb09(0x1cc),a299_0x15fb09(0x19f),a299_0x15fb09(0x1ad)]),NOTIFICATION_RECIPIENT_ROLES=new Set(['TO','CC','BCC']),MAX_NOTIFICATION_FACTS=0x8,MAX_NOTIFICATION_ACTIONS=0x2,MAX_ASYNC_RETRY_COUNT=0xa,MAX_CC_RECIPIENTS=0x64,DEFAULT_SCRIPT_RESULT_VARIABLE=a299_0x15fb09(0x154),UNSUPPORTED_FORM_MESSAGE=a299_0x15fb09(0x228),UNSUPPORTED_PLATFORM_FORM_MESSAGE=a299_0x15fb09(0x1d7),RESERVED_RESULT_VARIABLES=new Set(['formData',a299_0x15fb09(0x10a),a299_0x15fb09(0x1f6),a299_0x15fb09(0x1d1),a299_0x15fb09(0x1f0),a299_0x15fb09(0x1c1),a299_0x15fb09(0x1ae),a299_0x15fb09(0x1bb),a299_0x15fb09(0x166),a299_0x15fb09(0x1aa)]);export function normalizeFlowConfig(_0x2a8a10){const _0x3a657c=a299_0x15fb09;if(!isRecord(_0x2a8a10))throw new TypeError('FlowConfig\x20must\x20be\x20a\x20JSON\x20object.');const _0x1bcb67=cloneJsonValue(_0x2a8a10),_0x42b0ed=_0x1bcb67[_0x3a657c(0x255)],_0x51cf73=isRecord(_0x42b0ed)?cloneJsonValue(_0x42b0ed):{},_0x49b63a=[],_0x3f9f6b=[];for(const _0x31d9aa of REMOVED_ROOT_FIELDS){if(!Object['prototype'][_0x3a657c(0x1a3)][_0x3a657c(0x210)](_0x1bcb67,_0x31d9aa))continue;delete _0x1bcb67[_0x31d9aa],_0x3f9f6b[_0x3a657c(0x10b)](_0x31d9aa),_0x49b63a[_0x3a657c(0x10b)]({'code':_0x3a657c(0x1dc),'path':_0x31d9aa,'message':_0x31d9aa+_0x3a657c(0x175)});}for(const _0x5844d7 of REMOVED_FLOW_JSON_FIELDS){if(!Object['prototype'][_0x3a657c(0x1a3)][_0x3a657c(0x210)](_0x51cf73,_0x5844d7))continue;const _0x46a545=_0x3a657c(0x220)+_0x5844d7;delete _0x51cf73[_0x5844d7],_0x3f9f6b[_0x3a657c(0x10b)](_0x46a545),_0x49b63a['push']({'code':_0x3a657c(0x1dc),'path':_0x46a545,'message':_0x46a545+_0x3a657c(0x175)});}if(Object[_0x3a657c(0x204)][_0x3a657c(0x1a3)]['call'](_0x51cf73,_0x3a657c(0x23c))){const _0x1427c5=_0x51cf73[_0x3a657c(0x23c)],_0x59c635=typeof _0x1427c5===_0x3a657c(0x1c8)?_0x1427c5[_0x3a657c(0x1da)]():_0x1427c5;if(isEmptyJsonValue(_0x1427c5)||_0x59c635===DEFAULT_FLOW_SCHEMA_VERSION){const _0x1abe8e=_0x3a657c(0x185);delete _0x51cf73[_0x3a657c(0x23c)],_0x3f9f6b[_0x3a657c(0x10b)](_0x1abe8e),_0x49b63a[_0x3a657c(0x10b)]({'code':_0x3a657c(0x1dc),'path':_0x1abe8e,'message':_0x1abe8e+_0x3a657c(0x26a)+DEFAULT_FLOW_SCHEMA_VERSION+_0x3a657c(0x234)});}}removeEmptyMetadata(_0x51cf73,_0x3a657c(0x255),_0x49b63a,_0x3f9f6b);_0x1bcb67[_0x3a657c(0x10d)]==='INDEPENDENT_FLOW'&&!Object['prototype']['hasOwnProperty'][_0x3a657c(0x210)](_0x51cf73,_0x3a657c(0x15f))&&(_0x51cf73[_0x3a657c(0x15f)]=_0x3a657c(0x17e));_0x1bcb67['flowJson']=_0x51cf73;if(typeof _0x1bcb67[_0x3a657c(0x1c4)]==='string')_0x1bcb67['flowName']=_0x1bcb67[_0x3a657c(0x1c4)]['trim']();return{'config':_0x1bcb67,'warnings':_0x49b63a,'removedPaths':_0x3f9f6b};}export function validateFlowConfig(_0x195b6d){const _0x4fe4fc=a299_0x15fb09;let _0x152679;try{_0x152679=normalizeFlowConfig(_0x195b6d);}catch(_0x4899c0){const _0x1f37e2=_0x4899c0 instanceof Error?_0x4899c0[_0x4fe4fc(0x113)]:String(_0x4899c0),_0x2bf5d1={'flowJson':{}};return{'valid':![],'errors':[{'path':'$','message':_0x1f37e2}],'warnings':[],'normalized':_0x2bf5d1,'validationConfig':_0x2bf5d1};}const _0x451b46=_0x152679['config'],_0xa8bbf=cloneJsonValue(_0x451b46),_0x48e540=_0xa8bbf[_0x4fe4fc(0x255)];_0x48e540['flowKey']='__rabetbase_local_validation__',_0x48e540[_0x4fe4fc(0x1c4)]=_0x451b46[_0x4fe4fc(0x1c4)];typeof _0x451b46[_0x4fe4fc(0x257)]==='string'&&_0x451b46[_0x4fe4fc(0x257)][_0x4fe4fc(0x1da)]()&&(_0x48e540[_0x4fe4fc(0x1c6)]=_0x451b46[_0x4fe4fc(0x257)][_0x4fe4fc(0x1da)]());const _0x383825=[];return validateOuterMetadata(_0x451b46,_0x383825),validateFlowClassification(_0x451b46,_0x383825),validateGraph(_0x451b46[_0x4fe4fc(0x255)],_0x383825),{'valid':_0x383825[_0x4fe4fc(0x1f5)]===0x0,'errors':_0x383825,'warnings':_0x152679[_0x4fe4fc(0x212)],'normalized':_0x451b46,'validationConfig':_0xa8bbf};}function validateFlowClassification(_0x67ef0,_0x57f53b){const _0x5a5c89=a299_0x15fb09;if(!isRecord(_0x67ef0[_0x5a5c89(0x255)]))return;const _0x43a57b=_0x67ef0[_0x5a5c89(0x10d)],_0x187d87=_0x67ef0[_0x5a5c89(0x255)][_0x5a5c89(0x15f)];_0x187d87!==undefined&&(typeof _0x187d87!==_0x5a5c89(0x1c8)||!FLOW_PAGE_MODES[_0x5a5c89(0x11a)](_0x187d87))&&_0x57f53b[_0x5a5c89(0x10b)]({'path':'flowJson.pageMode','message':_0x5a5c89(0x1c2)+String(_0x187d87)+'.'});_0x43a57b===_0x5a5c89(0x122)&&_0x187d87!==undefined&&_0x57f53b['push']({'path':_0x5a5c89(0x156),'message':_0x5a5c89(0x205)});_0x43a57b==='INDEPENDENT_FLOW'&&_0x187d87===_0x5a5c89(0x13c)&&_0x57f53b['push']({'path':'flowJson.pageMode','message':UNSUPPORTED_PLATFORM_FORM_MESSAGE});(_0x43a57b==='FORM_FLOW'||_0x43a57b===_0x5a5c89(0x208))&&validateCustomPageNavigation(_0x67ef0,_0x43a57b,_0x187d87,_0x57f53b);if(_0x43a57b!=='FORM_FLOW'||!Array[_0x5a5c89(0x1a5)](_0x67ef0['flowJson'][_0x5a5c89(0x16e)]))return;_0x67ef0[_0x5a5c89(0x255)][_0x5a5c89(0x16e)][_0x5a5c89(0x188)]((_0x266ac0,_0x1e62f6)=>{const _0xa7342b=_0x5a5c89;isRecord(_0x266ac0)&&_0x266ac0[_0xa7342b(0x118)]==='APPROVAL'&&_0x266ac0[_0xa7342b(0x157)]==='HANDLE'&&_0x57f53b['push']({'path':_0xa7342b(0x232)+_0x1e62f6+_0xa7342b(0x248),'message':_0xa7342b(0x20a)});});}function validateCustomPageNavigation(_0x5e0b1e,_0x3e819e,_0x40a6c1,_0x2f7e69){const _0x25211a=a299_0x15fb09,_0x26caa8=_0x5e0b1e[_0x25211a(0x255)][_0x25211a(0x160)];_0x26caa8!==undefined&&_0x2f7e69[_0x25211a(0x10b)]({'path':'flowJson.startPageId','message':_0x25211a(0x24a)});const _0x2dbd44=_0x5e0b1e[_0x25211a(0x255)][_0x25211a(0x1e0)];_0x2dbd44!==undefined&&(typeof _0x2dbd44!=='string'||_0x2dbd44[_0x25211a(0x1da)]()==='')&&_0x2f7e69[_0x25211a(0x10b)]({'path':_0x25211a(0x1bd),'message':'startPath\x20must\x20be\x20a\x20non-empty\x20string.'});const _0xe0d50=Array['isArray'](_0x5e0b1e['flowJson'][_0x25211a(0x16e)])?_0x5e0b1e[_0x25211a(0x255)]['nodes']['map']((_0x1fccde,_0x31d257)=>({'node':_0x1fccde,'index':_0x31d257}))[_0x25211a(0x197)](({node:_0x1985e3})=>isRecord(_0x1985e3)&&_0x1985e3[_0x25211a(0x23f)]!==undefined):[],_0x31205c=_0x2dbd44!==undefined||_0xe0d50[_0x25211a(0x1f5)]>0x0,_0x204341=_0x40a6c1===undefined&&_0x3e819e===_0x25211a(0x208)?_0x25211a(0x17e):_0x40a6c1;_0x31205c&&(_0x3e819e!==_0x25211a(0x208)||_0x204341!=='CUSTOM_PAGE')&&(_0x2dbd44!==undefined&&_0x2f7e69[_0x25211a(0x10b)]({'path':'flowJson.startPath','message':_0x25211a(0x25d)}),_0xe0d50[_0x25211a(0x188)](({index:_0x483a14})=>{const _0x231def=_0x25211a;_0x2f7e69[_0x231def(0x10b)]({'path':_0x231def(0x232)+_0x483a14+_0x231def(0x231),'message':'node\x20path\x20applies\x20only\x20to\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.'});}));}export async function writeNormalizedFlowConfig(_0xf93043,_0x4ddd12,_0x53cc30={}){const _0x40b55e=a299_0x15fb09,_0x486866=resolve(_0xf93043),_0x562f93=_0x486866+'.'+process[_0x40b55e(0x189)]+'.'+randomUUID()+_0x40b55e(0x264),_0x2b8929=JSON[_0x40b55e(0x181)](_0x4ddd12,null,0x2)+'\x0a';let _0x144900;try{try{_0x144900=(await stat(_0x486866))[_0x40b55e(0x1a8)]&0x1ff;}catch{_0x144900=undefined;}await writeFile(_0x562f93,_0x2b8929,{'encoding':_0x40b55e(0x11e),'flag':'wx','mode':_0x144900??0x1a4});if(_0x144900!==undefined)await chmod(_0x562f93,_0x144900);_0x53cc30['overwrite']===![]?(await link(_0x562f93,_0x486866),await unlink(_0x562f93)):await rename(_0x562f93,_0x486866);}finally{await unlink(_0x562f93)[_0x40b55e(0x256)](()=>undefined);}}function validateOuterMetadata(_0x2377c6,_0x42c8e2){const _0x10c307=a299_0x15fb09;(typeof _0x2377c6[_0x10c307(0x1c4)]!==_0x10c307(0x1c8)||_0x2377c6[_0x10c307(0x1c4)]['trim']()==='')&&_0x42c8e2[_0x10c307(0x10b)]({'path':_0x10c307(0x1c4),'message':_0x10c307(0x213)});_0x2377c6[_0x10c307(0x1b4)]!==undefined&&typeof _0x2377c6[_0x10c307(0x1b4)]!==_0x10c307(0x1c8)&&_0x42c8e2[_0x10c307(0x10b)]({'path':'flowDesc','message':_0x10c307(0x162)});if(_0x2377c6['flowType']===undefined||_0x2377c6['flowType']===null)_0x42c8e2[_0x10c307(0x10b)]({'path':_0x10c307(0x10d),'message':_0x10c307(0x133)});else(typeof _0x2377c6['flowType']!=='string'||!FLOW_TYPES['has'](_0x2377c6['flowType']))&&_0x42c8e2[_0x10c307(0x10b)]({'path':'flowType','message':'Unsupported\x20flowType:\x20'+String(_0x2377c6['flowType'])+'.'});_0x2377c6['datasetCode']!==undefined&&typeof _0x2377c6['datasetCode']!==_0x10c307(0x1c8)&&_0x42c8e2[_0x10c307(0x10b)]({'path':_0x10c307(0x257),'message':_0x10c307(0x168)});_0x2377c6[_0x10c307(0x13e)]===undefined&&_0x2377c6[_0x10c307(0x152)]!==undefined&&(!Number[_0x10c307(0x25a)](_0x2377c6[_0x10c307(0x152)])||_0x2377c6['pageId']<=0x0)&&_0x42c8e2['push']({'path':_0x10c307(0x152),'message':_0x10c307(0x165)});if(_0x2377c6[_0x10c307(0x13e)]!==undefined){if(!Array[_0x10c307(0x1a5)](_0x2377c6[_0x10c307(0x13e)])||_0x2377c6['pageIds'][_0x10c307(0x158)](_0xa9ae50=>!Number[_0x10c307(0x25a)](_0xa9ae50)||_0xa9ae50<=0x0))_0x42c8e2[_0x10c307(0x10b)]({'path':_0x10c307(0x13e),'message':'pageIds\x20must\x20be\x20an\x20array\x20of\x20positive\x20safe\x20integers.'});else[...new Set(_0x2377c6[_0x10c307(0x13e)])][_0x10c307(0x222)](',')[_0x10c307(0x1f5)]>0x800&&_0x42c8e2[_0x10c307(0x10b)]({'path':_0x10c307(0x13e),'message':_0x10c307(0x128)});_0x2377c6['flowType']===_0x10c307(0x208)&&Array[_0x10c307(0x1a5)](_0x2377c6[_0x10c307(0x13e)])&&_0x2377c6['pageIds']['length']>0x0&&_0x42c8e2[_0x10c307(0x10b)]({'path':_0x10c307(0x13e),'message':_0x10c307(0x22f)});}_0x2377c6[_0x10c307(0x10d)]===_0x10c307(0x208)&&_0x2377c6[_0x10c307(0x257)]!==undefined&&_0x42c8e2[_0x10c307(0x10b)]({'path':_0x10c307(0x257),'message':_0x10c307(0x11f)}),_0x2377c6[_0x10c307(0x10d)]===_0x10c307(0x208)&&_0x2377c6['pageIds']===undefined&&_0x2377c6[_0x10c307(0x152)]!==undefined&&_0x42c8e2[_0x10c307(0x10b)]({'path':_0x10c307(0x152),'message':_0x10c307(0x142)});}function validateGraph(_0x13064e,_0x245bab){const _0x40e181=a299_0x15fb09;if(!isRecord(_0x13064e)){_0x245bab[_0x40e181(0x10b)]({'path':_0x40e181(0x255),'message':_0x40e181(0x108)});return;}!Array['isArray'](_0x13064e[_0x40e181(0x16e)])&&_0x245bab[_0x40e181(0x10b)]({'path':'flowJson.nodes','message':'nodes\x20must\x20be\x20an\x20array.'});!Array[_0x40e181(0x1a5)](_0x13064e['edges'])&&_0x245bab['push']({'path':_0x40e181(0x170),'message':_0x40e181(0x19c)});Object['prototype'][_0x40e181(0x1a3)]['call'](_0x13064e,'schemaVersion')&&_0x245bab[_0x40e181(0x10b)]({'path':_0x40e181(0x185),'message':_0x40e181(0x1dd)+String(_0x13064e[_0x40e181(0x23c)])+_0x40e181(0x1d0)+DEFAULT_FLOW_SCHEMA_VERSION+'.'});for(const _0xa81d9c of[_0x40e181(0x20c),_0x40e181(0x18b),'formPermissions']){Object[_0x40e181(0x204)]['hasOwnProperty'][_0x40e181(0x210)](_0x13064e,_0xa81d9c)&&_0x245bab[_0x40e181(0x10b)]({'path':_0x40e181(0x220)+_0xa81d9c,'message':UNSUPPORTED_FORM_MESSAGE});}if(!Array[_0x40e181(0x1a5)](_0x13064e[_0x40e181(0x16e)])||!Array[_0x40e181(0x1a5)](_0x13064e[_0x40e181(0x26b)]))return;const _0x7bc366=new Map(),_0x3e715e=[],_0x53b4c3=[],_0x2b7640=new Map(),_0x286e96=new Map(),_0x5b8517=new Set();let _0x4a424e=0x0;_0x13064e[_0x40e181(0x16e)][_0x40e181(0x188)]((_0x3278f8,_0x26cebf)=>{const _0x4b3f78=_0x40e181,_0x4dc595=_0x4b3f78(0x232)+_0x26cebf+']';if(!isRecord(_0x3278f8)){_0x245bab[_0x4b3f78(0x10b)]({'path':_0x4dc595,'message':'node\x20must\x20be\x20an\x20object.'});return;}const _0x4b9ba5=_0x3278f8;if(typeof _0x4b9ba5['id']!==_0x4b3f78(0x1c8)||!BPMN_ID_PATTERN['test'](_0x4b9ba5['id']))_0x245bab['push']({'path':_0x4dc595+_0x4b3f78(0x246),'message':_0x4b3f78(0x1e3)});else _0x7bc366['has'](_0x4b9ba5['id'])?_0x245bab['push']({'path':_0x4dc595+_0x4b3f78(0x246),'message':_0x4b3f78(0x1a2)+_0x4b9ba5['id']+'.'}):(_0x7bc366[_0x4b3f78(0x251)](_0x4b9ba5['id'],_0x4b9ba5),_0x5b8517[_0x4b3f78(0x130)](_0x4b9ba5['id']));if(!NODE_TYPES[_0x4b3f78(0x11a)](_0x4b9ba5['type']))_0x245bab[_0x4b3f78(0x10b)]({'path':_0x4dc595+_0x4b3f78(0x18d),'message':_0x4b3f78(0x186)+String(_0x4b9ba5[_0x4b3f78(0x118)])+'.'});else{if(_0x4b9ba5['type']===_0x4b3f78(0x23b))_0x3e715e['push'](_0x4b9ba5['id']);else _0x4b9ba5[_0x4b3f78(0x118)]===_0x4b3f78(0x11d)&&_0x53b4c3[_0x4b3f78(0x10b)](_0x4b9ba5['id']);}_0x4b9ba5[_0x4b3f78(0x118)]===_0x4b3f78(0x1cb)&&(_0x4b9ba5[_0x4b3f78(0x157)]===undefined||_0x4b9ba5[_0x4b3f78(0x157)]==='APPROVAL')&&(_0x4a424e+=0x1);validateNode(_0x4b9ba5,_0x4dc595,_0x245bab);if(_0x4b9ba5[_0x4b3f78(0x118)]===_0x4b3f78(0x14f)){const _0x3a807a=resolveEffectiveResultVariable(_0x4b9ba5[_0x4b3f78(0x1ec)],![]);_0x3a807a&&(registerResultVariableOwner(_0x286e96,_0x3a807a,_0x4b9ba5['id'],_0x245bab),!_0x2b7640['has'](_0x3a807a)&&_0x2b7640[_0x4b3f78(0x251)](_0x3a807a,_0x4b9ba5['id']));}if(_0x4b9ba5['type']==='APPROVAL'&&isRecord(_0x4b9ba5[_0x4b3f78(0x183)])&&_0x4b9ba5[_0x4b3f78(0x183)][_0x4b3f78(0x244)]===!![]&&_0x4b9ba5[_0x4b3f78(0x183)][_0x4b3f78(0x10f)]===_0x4b3f78(0x1ff)){const _0xdfaaa6=resolveEffectiveResultVariable(_0x4b9ba5[_0x4b3f78(0x183)][_0x4b3f78(0x1ec)],!![]);_0xdfaaa6&&registerResultVariableOwner(_0x286e96,_0xdfaaa6,_0x4b9ba5['id']+'.timeout',_0x245bab);}});_0x3e715e[_0x40e181(0x1f5)]!==0x1&&_0x245bab[_0x40e181(0x10b)]({'path':_0x40e181(0x22c),'message':_0x40e181(0x1af)});_0x53b4c3[_0x40e181(0x1f5)]===0x0&&_0x245bab[_0x40e181(0x10b)]({'path':_0x40e181(0x22c),'message':_0x40e181(0x1f7)});const _0x4a42b5=new Map(),_0x52a145=new Map(),_0x5b6fc2=new Map(),_0xea1bf8=new Set();_0x13064e[_0x40e181(0x26b)][_0x40e181(0x188)]((_0x366ca2,_0x24d268)=>{const _0x5bd62b=_0x40e181,_0x11f068=_0x5bd62b(0x221)+_0x24d268+']';if(!isRecord(_0x366ca2)){_0x245bab[_0x5bd62b(0x10b)]({'path':_0x11f068,'message':_0x5bd62b(0x1b2)});return;}const _0x231acc=_0x366ca2;_0x5b6fc2[_0x5bd62b(0x251)](_0x231acc,_0x11f068);const _0x9af2d2=resolveEdgeEndpoint(_0x231acc[_0x5bd62b(0x211)],_0x231acc[_0x5bd62b(0x1d3)]),_0x1eb946=resolveEdgeEndpoint(_0x231acc['target'],_0x231acc['targetNodeId']);if(!_0x9af2d2)_0x245bab[_0x5bd62b(0x10b)]({'path':_0x11f068+_0x5bd62b(0x249),'message':'edge\x20source\x20is\x20required.'});if(!_0x1eb946)_0x245bab[_0x5bd62b(0x10b)]({'path':_0x11f068+_0x5bd62b(0x263),'message':_0x5bd62b(0x14c)});_0x9af2d2&&!_0x7bc366['has'](_0x9af2d2)&&_0x245bab['push']({'path':_0x11f068+_0x5bd62b(0x249),'message':_0x5bd62b(0x182)+_0x9af2d2+'.'});_0x1eb946&&!_0x7bc366[_0x5bd62b(0x11a)](_0x1eb946)&&_0x245bab[_0x5bd62b(0x10b)]({'path':_0x11f068+_0x5bd62b(0x263),'message':_0x5bd62b(0x216)+_0x1eb946+'.'});if(_0x231acc['id']!==undefined){if(typeof _0x231acc['id']!==_0x5bd62b(0x1c8)||!BPMN_ID_PATTERN['test'](_0x231acc['id']))_0x245bab['push']({'path':_0x11f068+_0x5bd62b(0x246),'message':_0x5bd62b(0x120)});else{if(_0x5b8517[_0x5bd62b(0x11a)](_0x231acc['id']))_0x245bab[_0x5bd62b(0x10b)]({'path':_0x11f068+_0x5bd62b(0x246),'message':_0x5bd62b(0x206)+_0x231acc['id']+'.'});else!_0x5b8517[_0x5bd62b(0x11a)](_0x231acc['id'])&&_0x5b8517[_0x5bd62b(0x130)](_0x231acc['id']);}}if(_0x9af2d2&&_0x1eb946){const _0x1968e6=_0x9af2d2+'\x00'+_0x1eb946+'\x00'+(_0x231acc[_0x5bd62b(0x223)]??_0x5bd62b(0x217));_0xea1bf8['has'](_0x1968e6)?_0x245bab[_0x5bd62b(0x10b)]({'path':_0x11f068,'message':_0x5bd62b(0x243)+_0x9af2d2+_0x5bd62b(0x226)+_0x1eb946+'\x20('+(_0x231acc[_0x5bd62b(0x223)]??_0x5bd62b(0x217))+').'}):_0xea1bf8[_0x5bd62b(0x130)](_0x1968e6);}validateEdge(_0x231acc,_0x11f068,_0x245bab),_0x9af2d2&&_0x1eb946&&(_0x4a42b5[_0x5bd62b(0x139)](_0x9af2d2)?.[_0x5bd62b(0x10b)](_0x231acc)??_0x4a42b5['set'](_0x9af2d2,[_0x231acc]),_0x52a145[_0x5bd62b(0x139)](_0x1eb946)?.['push'](_0x231acc)??_0x52a145[_0x5bd62b(0x251)](_0x1eb946,[_0x231acc]));});if(_0x3e715e[_0x40e181(0x1f5)]!==0x1)return;validateGraphShape(_0x7bc366,_0x3e715e[0x0],_0x53b4c3,_0x4a42b5,_0x52a145,_0x5b6fc2,_0x245bab),validateScriptResultReferences(_0x7bc366,_0x3e715e[0x0],_0x4a42b5,_0x52a145,_0x5b6fc2,_0x2b7640,_0x245bab),validateApprovalResults(_0x7bc366,_0x4a424e,_0x53b4c3,_0x245bab);}function validateNode(_0x4b35d8,_0x3bac81,_0x596318){const _0x14c055=a299_0x15fb09;for(const _0x450ddb of['form',_0x14c055(0x1fd)]){Object['prototype']['hasOwnProperty'][_0x14c055(0x210)](_0x4b35d8,_0x450ddb)&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+'.'+_0x450ddb,'message':UNSUPPORTED_FORM_MESSAGE});}if(!NODE_TYPES['has'](_0x4b35d8[_0x14c055(0x118)]))return;(typeof _0x4b35d8[_0x14c055(0x268)]!==_0x14c055(0x1c8)||_0x4b35d8[_0x14c055(0x268)][_0x14c055(0x1da)]()==='')&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+'.name','message':'Every\x20node\x20requires\x20a\x20non-empty\x20name.'});_0x4b35d8[_0x14c055(0x152)]!==undefined&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+'.pageId','message':_0x14c055(0x19a)});if(_0x4b35d8[_0x14c055(0x23f)]!==undefined){if(typeof _0x4b35d8[_0x14c055(0x23f)]!==_0x14c055(0x1c8)||_0x4b35d8[_0x14c055(0x23f)][_0x14c055(0x1da)]()==='')_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x13f),'message':_0x14c055(0x12d)});else _0x4b35d8[_0x14c055(0x118)]!==_0x14c055(0x1cb)&&_0x4b35d8[_0x14c055(0x118)]!==_0x14c055(0x11d)&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x13f),'message':'node\x20path\x20is\x20supported\x20only\x20on\x20APPROVAL\x20or\x20END\x20nodes.'});}const _0x96f44b=_0x4b35d8[_0x14c055(0x209)];if(!isRecord(_0x96f44b))_0x596318['push']({'path':_0x3bac81+_0x14c055(0x1cd),'message':_0x14c055(0x1bf)});else for(const _0x4369ab of['x','y']){const _0x5c137b=_0x96f44b[_0x4369ab];(typeof _0x5c137b!==_0x14c055(0x144)||!Number[_0x14c055(0x24b)](_0x5c137b)||_0x5c137b<0x0)&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x201)+_0x4369ab,'message':_0x14c055(0x131)+_0x4369ab+_0x14c055(0x10c)});}if(_0x4b35d8['type']===_0x14c055(0x1cb)){const _0x463035=_0x4b35d8[_0x14c055(0x1fe)]??_0x14c055(0x1b7),_0x55ed24=_0x4b35d8[_0x14c055(0x157)]??'APPROVAL';!APPROVAL_TASK_MODES['has'](_0x55ed24)&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x1fa),'message':_0x14c055(0x265)+String(_0x55ed24)+'.'});!APPROVAL_MODES['has'](_0x463035)&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x266),'message':'Unsupported\x20approval\x20mode:\x20'+String(_0x463035)+'.'});if(!isRecord(_0x4b35d8[_0x14c055(0x1bc)]))_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x137),'message':'APPROVAL\x20node\x20requires\x20assignee.'});else{const _0x33b46e=_0x4b35d8[_0x14c055(0x1bc)][_0x14c055(0x11c)];_0x33b46e!==_0x14c055(0x1ba)&&_0x33b46e!==_0x14c055(0x19f)&&_0x596318['push']({'path':_0x3bac81+_0x14c055(0x230),'message':_0x14c055(0x260)});if(_0x33b46e===_0x14c055(0x1ba)){const _0x1d00ef=_0x4b35d8[_0x14c055(0x1bc)][_0x14c055(0x207)];if(!Array[_0x14c055(0x1a5)](_0x1d00ef)||_0x1d00ef[_0x14c055(0x1f5)]===0x0)_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x193),'message':'FIXED\x20assignee\x20requires\x20userIds.'});else{const _0xff14ef=_0x1d00ef[_0x14c055(0x141)](_0x3d32c5=>!isValidUserId(_0x3d32c5));_0xff14ef>=0x0&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+'.assignee.userIds['+_0xff14ef+']','message':_0x14c055(0x1d6)});const _0x3ca286=new Set(_0x1d00ef[_0x14c055(0x197)](isValidUserId)[_0x14c055(0x1b8)](_0xcacb06=>String(_0xcacb06)[_0x14c055(0x1da)]()));_0x463035===_0x14c055(0x1b7)&&_0x3ca286['size']>0x1&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x193),'message':_0x14c055(0x24f)});}}if(_0x33b46e==='ROLE'){const _0x23ffb9=_0x4b35d8[_0x14c055(0x1bc)][_0x14c055(0x20d)],_0x41cbd4=typeof _0x23ffb9===_0x14c055(0x144)||typeof _0x23ffb9===_0x14c055(0x1c8)?Number(String(_0x23ffb9)['trim']()):Number[_0x14c055(0x202)];(!Number[_0x14c055(0x25a)](_0x41cbd4)||_0x41cbd4<=0x0)&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x1e5),'message':'ROLE\x20assignee\x20requires\x20a\x20positive\x20integer\x20roleId.'});}}if(_0x4b35d8[_0x14c055(0x15a)]!==undefined){if(!isRecord(_0x4b35d8['transferCandidates']))_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+'.transferCandidates','message':_0x14c055(0x19b)});else{if(_0x4b35d8[_0x14c055(0x15a)][_0x14c055(0x11c)]!=='FIXED')_0x596318['push']({'path':_0x3bac81+_0x14c055(0x114),'message':_0x14c055(0x1f4)});else{const _0x4e7b2b=_0x4b35d8[_0x14c055(0x15a)][_0x14c055(0x207)];if(!Array[_0x14c055(0x1a5)](_0x4e7b2b)||_0x4e7b2b[_0x14c055(0x1f5)]===0x0)_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x1a0),'message':_0x14c055(0x163)});else{const _0x22d152=_0x4e7b2b[_0x14c055(0x141)](_0x12bef0=>!isValidUserId(_0x12bef0));_0x22d152>=0x0&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x110)+_0x22d152+']','message':_0x14c055(0x18e)});}}}}}_0x4b35d8[_0x14c055(0x239)]!==undefined&&typeof _0x4b35d8[_0x14c055(0x239)]!==_0x14c055(0x236)&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x258),'message':_0x14c055(0x198)});if(_0x4b35d8[_0x14c055(0x118)]==='SCRIPT'){(typeof _0x4b35d8[_0x14c055(0x111)]!==_0x14c055(0x1c8)||_0x4b35d8[_0x14c055(0x111)][_0x14c055(0x1da)]()==='')&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x14e),'message':_0x14c055(0x15c)});if(_0x4b35d8['resultVariable']!==undefined){if(typeof _0x4b35d8[_0x14c055(0x1ec)]!==_0x14c055(0x1c8)||!VARIABLE_PATTERN[_0x14c055(0x20f)](_0x4b35d8['resultVariable']))_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x178),'message':_0x14c055(0x176)});else(RESERVED_RESULT_VARIABLES[_0x14c055(0x11a)](_0x4b35d8['resultVariable'])||_0x4b35d8[_0x14c055(0x1ec)][_0x14c055(0x191)](_0x14c055(0x1ea)))&&_0x596318[_0x14c055(0x10b)]({'path':_0x3bac81+_0x14c055(0x178),'message':_0x14c055(0x1ce)+_0x4b35d8[_0x14c055(0x1ec)]+'.'});}}validateAsyncExecution(_0x4b35d8,_0x3bac81,_0x596318),validateApprovalTimeout(_0x4b35d8,_0x3bac81,_0x596318),validateCcConfig(_0x4b35d8,_0x3bac81,_0x596318),_0x4b35d8[_0x14c055(0x118)]===_0x14c055(0x161)&&validateNotificationConfig(_0x4b35d8['config'],_0x3bac81+_0x14c055(0x145),_0x596318);}function validateAsyncExecution(_0x5296e6,_0x320535,_0xea4fad){const _0x20f1c5=a299_0x15fb09;if(_0x5296e6['async']===undefined)return;if(!isRecord(_0x5296e6[_0x20f1c5(0x11b)])){_0xea4fad[_0x20f1c5(0x10b)]({'path':_0x320535+'.async','message':_0x20f1c5(0x15d)});return;}if(_0x5296e6[_0x20f1c5(0x11b)][_0x20f1c5(0x244)]!==undefined&&typeof _0x5296e6[_0x20f1c5(0x11b)]['enabled']!==_0x20f1c5(0x236)){_0xea4fad[_0x20f1c5(0x10b)]({'path':_0x320535+_0x20f1c5(0x1be),'message':_0x20f1c5(0x22e)});return;}if(_0x5296e6[_0x20f1c5(0x11b)][_0x20f1c5(0x244)]!==!![])return;_0x5296e6[_0x20f1c5(0x118)]!=='SCRIPT'&&_0xea4fad[_0x20f1c5(0x10b)]({'path':_0x320535+_0x20f1c5(0x196),'message':_0x20f1c5(0x1e7)});const _0x18c5c9=_0x5296e6[_0x20f1c5(0x11b)][_0x20f1c5(0x1e4)]??0x3;(!Number[_0x20f1c5(0x17d)](_0x18c5c9)||_0x18c5c9<0x1||_0x18c5c9>MAX_ASYNC_RETRY_COUNT)&&_0xea4fad['push']({'path':_0x320535+_0x20f1c5(0x172),'message':_0x20f1c5(0x250)+MAX_ASYNC_RETRY_COUNT+'.'}),_0x5296e6[_0x20f1c5(0x11b)][_0x20f1c5(0x150)]!==undefined&&validateTimeAmount(_0x5296e6[_0x20f1c5(0x11b)][_0x20f1c5(0x150)],_0x320535+_0x20f1c5(0x155),_0xea4fad);}function validateApprovalTimeout(_0x5abc9f,_0x4f39e6,_0x17ca75){const _0x4f65e3=a299_0x15fb09;if(_0x5abc9f['timeout']===undefined)return;if(!isRecord(_0x5abc9f[_0x4f65e3(0x183)])){_0x17ca75[_0x4f65e3(0x10b)]({'path':_0x4f39e6+_0x4f65e3(0x1fb),'message':_0x4f65e3(0x1c0)});return;}if(_0x5abc9f[_0x4f65e3(0x183)][_0x4f65e3(0x244)]!==undefined&&typeof _0x5abc9f['timeout'][_0x4f65e3(0x244)]!=='boolean'){_0x17ca75[_0x4f65e3(0x10b)]({'path':_0x4f39e6+'.timeout.enabled','message':'timeout.enabled\x20must\x20be\x20a\x20boolean.'});return;}if(_0x5abc9f['timeout'][_0x4f65e3(0x244)]!==!![])return;if(_0x5abc9f[_0x4f65e3(0x183)][_0x4f65e3(0x1b0)]!==undefined&&typeof _0x5abc9f[_0x4f65e3(0x183)]['interrupting']!==_0x4f65e3(0x236)){_0x17ca75[_0x4f65e3(0x10b)]({'path':_0x4f39e6+_0x4f65e3(0x1a7),'message':'timeout.interrupting\x20must\x20be\x20a\x20boolean.'});return;}_0x5abc9f['type']!==_0x4f65e3(0x1cb)&&_0x17ca75[_0x4f65e3(0x10b)]({'path':_0x4f39e6+_0x4f65e3(0x1fb),'message':_0x4f65e3(0x23d)});validateTimeAmount(_0x5abc9f[_0x4f65e3(0x183)]['duration'],_0x4f39e6+_0x4f65e3(0x195),_0x17ca75);const _0x592316=_0x5abc9f[_0x4f65e3(0x183)][_0x4f65e3(0x10f)];if(!APPROVAL_TIMEOUT_ACTIONS[_0x4f65e3(0x11a)](_0x592316)){_0x17ca75['push']({'path':_0x4f39e6+'.timeout.action','message':'timeout.action\x20must\x20be\x20AUTO_APPROVE,\x20AUTO_REJECT,\x20or\x20EXECUTE_BFF.'});return;}(_0x5abc9f[_0x4f65e3(0x157)]??_0x4f65e3(0x1cb))==='HANDLE'&&_0x592316!=='EXECUTE_BFF'&&_0x17ca75[_0x4f65e3(0x10b)]({'path':_0x4f39e6+_0x4f65e3(0x1a1),'message':_0x4f65e3(0x1c7)});const _0x31ed8f=_0x5abc9f[_0x4f65e3(0x183)][_0x4f65e3(0x1b0)]??_0x592316!==_0x4f65e3(0x1ff);if(_0x592316===_0x4f65e3(0x1ff))_0x31ed8f&&_0x17ca75[_0x4f65e3(0x10b)]({'path':_0x4f39e6+_0x4f65e3(0x1a7),'message':'EXECUTE_BFF\x20timeout\x20must\x20not\x20interrupt\x20the\x20approval\x20task.'}),(typeof _0x5abc9f[_0x4f65e3(0x183)][_0x4f65e3(0x111)]!==_0x4f65e3(0x1c8)||_0x5abc9f[_0x4f65e3(0x183)][_0x4f65e3(0x111)]['trim']()==='')&&_0x17ca75[_0x4f65e3(0x10b)]({'path':_0x4f39e6+_0x4f65e3(0x125),'message':_0x4f65e3(0x1c9)}),validateOptionalResultVariable(_0x5abc9f['timeout'][_0x4f65e3(0x1ec)],_0x4f39e6+_0x4f65e3(0x1f2),_0x17ca75);else!_0x31ed8f&&_0x17ca75[_0x4f65e3(0x10b)]({'path':_0x4f39e6+_0x4f65e3(0x1a7),'message':_0x592316+'\x20timeout\x20must\x20interrupt\x20the\x20approval\x20task.'});}function validateTimeAmount(_0x2a3164,_0x43edec,_0x500a06){const _0x5b38db=a299_0x15fb09;if(!isRecord(_0x2a3164)){_0x500a06[_0x5b38db(0x10b)]({'path':_0x43edec,'message':_0x5b38db(0x1b1)});return;}(!Number['isInteger'](_0x2a3164[_0x5b38db(0x247)])||Number(_0x2a3164[_0x5b38db(0x247)])<=0x0)&&_0x500a06[_0x5b38db(0x10b)]({'path':_0x43edec+_0x5b38db(0x1eb),'message':'duration\x20value\x20must\x20be\x20a\x20positive\x20integer.'}),!FLOW_TIME_UNITS[_0x5b38db(0x11a)](_0x2a3164[_0x5b38db(0x215)])&&_0x500a06['push']({'path':_0x43edec+'.unit','message':_0x5b38db(0x252)});}function validateOptionalResultVariable(_0xbb3995,_0x206678,_0x4fceb4){const _0x245419=a299_0x15fb09;if(_0xbb3995===undefined||_0xbb3995===null||_0xbb3995==='')return;if(typeof _0xbb3995!==_0x245419(0x1c8)||!VARIABLE_PATTERN[_0x245419(0x20f)](_0xbb3995))_0x4fceb4[_0x245419(0x10b)]({'path':_0x206678,'message':_0x245419(0x176)});else(RESERVED_RESULT_VARIABLES['has'](_0xbb3995)||_0xbb3995[_0x245419(0x191)](_0x245419(0x1ea)))&&_0x4fceb4['push']({'path':_0x206678,'message':_0x245419(0x1ce)+_0xbb3995+'.'});}function validateCcConfig(_0xe3adb8,_0xf6c797,_0x480bd5){const _0x34b3f2=a299_0x15fb09;if(_0xe3adb8['cc']===undefined)return;if(!isRecord(_0xe3adb8['cc'])){_0x480bd5[_0x34b3f2(0x10b)]({'path':_0xf6c797+'.cc','message':_0x34b3f2(0x17f)});return;}_0xe3adb8[_0x34b3f2(0x118)]!==_0x34b3f2(0x11d)&&_0xe3adb8[_0x34b3f2(0x118)]!=='APPROVAL'&&_0x480bd5['push']({'path':_0xf6c797+'.cc','message':_0x34b3f2(0x1b9)});Object[_0x34b3f2(0x204)]['hasOwnProperty'][_0x34b3f2(0x210)](_0xe3adb8['cc'],'readSources')&&_0x480bd5['push']({'path':_0xf6c797+'.cc.readSources','message':UNSUPPORTED_FORM_MESSAGE});const _0x39da3d=_0xe3adb8['cc'][_0x34b3f2(0x1c5)];if(!Array[_0x34b3f2(0x1a5)](_0x39da3d)||_0x39da3d[_0x34b3f2(0x1f5)]===0x0)_0x480bd5[_0x34b3f2(0x10b)]({'path':_0xf6c797+_0x34b3f2(0x1a4),'message':_0x34b3f2(0x254)});else{_0x39da3d[_0x34b3f2(0x1f5)]>MAX_CC_RECIPIENTS&&_0x480bd5['push']({'path':_0xf6c797+_0x34b3f2(0x1a4),'message':_0x34b3f2(0x24e)+MAX_CC_RECIPIENTS+_0x34b3f2(0x25e)});const _0x3df6d6=new Set();_0x39da3d[_0x34b3f2(0x188)]((_0x9dd6fc,_0x2bc374)=>{const _0x242333=_0x34b3f2;if(typeof _0x9dd6fc!==_0x242333(0x1c8)||_0x9dd6fc[_0x242333(0x1da)]()==='')_0x480bd5[_0x242333(0x10b)]({'path':_0xf6c797+_0x242333(0x173)+_0x2bc374+']','message':_0x242333(0x159)});else _0x3df6d6[_0x242333(0x11a)](_0x9dd6fc['trim']())?_0x480bd5[_0x242333(0x10b)]({'path':_0xf6c797+'.cc.recipientUserIds['+_0x2bc374+']','message':'Duplicate\x20cc\x20recipient\x20userId:\x20'+_0x9dd6fc['trim']()+'.'}):_0x3df6d6[_0x242333(0x130)](_0x9dd6fc[_0x242333(0x1da)]());});}validateStringArray(_0xe3adb8['cc'][_0x34b3f2(0x20e)],_0xf6c797+_0x34b3f2(0x129),_0x480bd5);}function validateStringArray(_0x9ce804,_0x120768,_0xf6adac){const _0x191918=a299_0x15fb09;if(_0x9ce804===undefined)return;if(!Array['isArray'](_0x9ce804)){_0xf6adac['push']({'path':_0x120768,'message':_0x191918(0x1ee)});return;}const _0x111486=new Set();_0x9ce804['forEach']((_0x970967,_0x5de72b)=>{const _0x34bff4=_0x191918;if(typeof _0x970967!==_0x34bff4(0x1c8)||_0x970967['trim']()==='')_0xf6adac[_0x34bff4(0x10b)]({'path':_0x120768+'['+_0x5de72b+']','message':'value\x20must\x20be\x20a\x20non-empty\x20string.'});else _0x111486[_0x34bff4(0x11a)](_0x970967['trim']())?_0xf6adac[_0x34bff4(0x10b)]({'path':_0x120768+'['+_0x5de72b+']','message':_0x34bff4(0x21e)+_0x970967[_0x34bff4(0x1da)]()+'.'}):_0x111486['add'](_0x970967['trim']());});}function validateNotificationConfig(_0x131d6f,_0x45c70f,_0x5e7603){const _0x4c55bc=a299_0x15fb09;if(!isRecord(_0x131d6f)){_0x5e7603[_0x4c55bc(0x10b)]({'path':_0x45c70f,'message':'NOTIFICATION\x20node\x20requires\x20config.'});return;}if(_0x131d6f[_0x4c55bc(0x1cf)]!==undefined&&_0x131d6f[_0x4c55bc(0x1cf)]!==null){if(typeof _0x131d6f[_0x4c55bc(0x1cf)]!=='string')_0x5e7603['push']({'path':_0x45c70f+_0x4c55bc(0x136),'message':'Notification\x20version\x20must\x20be\x20a\x20string.'});else _0x131d6f['version'][_0x4c55bc(0x1da)]()&&_0x131d6f['version']['trim']()!=='v1'&&_0x5e7603[_0x4c55bc(0x10b)]({'path':_0x45c70f+_0x4c55bc(0x136),'message':_0x4c55bc(0x21c)+_0x131d6f[_0x4c55bc(0x1cf)]+'.'});}const _0x1dbdfe=requireNotificationString(_0x131d6f[_0x4c55bc(0x1ca)],_0x45c70f+_0x4c55bc(0x18a),_0x4c55bc(0x1e1),_0x5e7603);_0x1dbdfe?.['includes']('${')&&_0x5e7603[_0x4c55bc(0x10b)]({'path':_0x45c70f+_0x4c55bc(0x18a),'message':_0x4c55bc(0x25f)});if(_0x131d6f['failurePolicy']!==undefined&&_0x131d6f[_0x4c55bc(0x19d)]!==null){if(typeof _0x131d6f['failurePolicy']!==_0x4c55bc(0x1c8))_0x5e7603[_0x4c55bc(0x10b)]({'path':_0x45c70f+_0x4c55bc(0x105),'message':_0x4c55bc(0x190)});else!NOTIFICATION_FAILURE_POLICIES[_0x4c55bc(0x11a)](_0x131d6f[_0x4c55bc(0x19d)][_0x4c55bc(0x1da)]()[_0x4c55bc(0x21f)]())&&_0x5e7603[_0x4c55bc(0x10b)]({'path':_0x45c70f+_0x4c55bc(0x105),'message':'failurePolicy\x20must\x20be\x20CONTINUE\x20or\x20FAIL.'});}!isRecord(_0x131d6f[_0x4c55bc(0x107)])?_0x5e7603[_0x4c55bc(0x10b)]({'path':_0x45c70f+_0x4c55bc(0x192),'message':'NOTIFICATION\x20node\x20requires\x20template.'}):validateNotificationTemplate(_0x131d6f['template'],_0x45c70f+'.template',_0x5e7603),validateNotificationRecipients(_0x131d6f['recipients'],_0x45c70f+_0x4c55bc(0x267),_0x5e7603);}function validateNotificationTemplate(_0x4664ab,_0x5a9ca2,_0x185a63){const _0x500d16=a299_0x15fb09;for(const _0x3821f3 of['title',_0x500d16(0x219)]){const _0x31f1fe=requireNotificationString(_0x4664ab[_0x3821f3],_0x5a9ca2+'.'+_0x3821f3,'Notification\x20template.'+_0x3821f3+'\x20is\x20required.',_0x185a63);if(_0x31f1fe)validateNotificationPlaceholders(_0x31f1fe,_0x5a9ca2+'.'+_0x3821f3,_0x185a63);}_0x4664ab['detailMarkdown']!==undefined&&_0x4664ab[_0x500d16(0x22d)]!==null&&(typeof _0x4664ab[_0x500d16(0x22d)]!==_0x500d16(0x1c8)?_0x185a63['push']({'path':_0x5a9ca2+_0x500d16(0x25b),'message':'Notification\x20template.detailMarkdown\x20must\x20be\x20a\x20string.'}):validateNotificationPlaceholders(_0x4664ab['detailMarkdown'],_0x5a9ca2+_0x500d16(0x25b),_0x185a63)),validateNotificationFacts(_0x4664ab[_0x500d16(0x164)],_0x5a9ca2+_0x500d16(0x18f),_0x185a63),validateNotificationActions(_0x4664ab[_0x500d16(0x23a)],_0x5a9ca2+_0x500d16(0x13d),_0x185a63);}function validateNotificationFacts(_0x2c6408,_0x2454eb,_0x46f53){const _0x46ac65=a299_0x15fb09;if(_0x2c6408===undefined||_0x2c6408===null)return;if(!Array[_0x46ac65(0x1a5)](_0x2c6408)){_0x46f53['push']({'path':_0x2454eb,'message':'Notification\x20template.facts\x20must\x20be\x20an\x20array.'});return;}_0x2c6408['length']>MAX_NOTIFICATION_FACTS&&_0x46f53[_0x46ac65(0x10b)]({'path':_0x2454eb,'message':_0x46ac65(0x179)+MAX_NOTIFICATION_FACTS+_0x46ac65(0x194)}),_0x2c6408[_0x46ac65(0x188)]((_0x53f755,_0x2e49f6)=>{const _0x4bd403=_0x46ac65,_0x5e76d7=_0x2454eb+'['+_0x2e49f6+']';if(!isRecord(_0x53f755)){_0x46f53['push']({'path':_0x5e76d7,'message':_0x4bd403(0x262)});return;}for(const _0xbc8112 of[_0x4bd403(0x106),'value']){const _0x5b0651=requireNotificationString(_0x53f755[_0xbc8112],_0x5e76d7+'.'+_0xbc8112,'Notification\x20fact.'+_0xbc8112+_0x4bd403(0x104),_0x46f53);_0x5b0651&&validateNotificationPlaceholders(_0x5b0651,_0x5e76d7+'.'+_0xbc8112,_0x46f53);}});}function validateNotificationActions(_0x51d33c,_0x4e7c34,_0x34b4d1){const _0x5dc52a=a299_0x15fb09;if(_0x51d33c===undefined||_0x51d33c===null)return;if(!Array['isArray'](_0x51d33c)){_0x34b4d1[_0x5dc52a(0x10b)]({'path':_0x4e7c34,'message':'Notification\x20template.actions\x20must\x20be\x20an\x20array.'});return;}_0x51d33c[_0x5dc52a(0x1f5)]>MAX_NOTIFICATION_ACTIONS&&_0x34b4d1['push']({'path':_0x4e7c34,'message':'Notification\x20template\x20supports\x20at\x20most\x20'+MAX_NOTIFICATION_ACTIONS+_0x5dc52a(0x12b)}),_0x51d33c[_0x5dc52a(0x188)]((_0x2d5203,_0x4064f2)=>{const _0x315515=_0x5dc52a,_0x49c789=_0x4e7c34+'['+_0x4064f2+']';if(!isRecord(_0x2d5203)){_0x34b4d1[_0x315515(0x10b)]({'path':_0x49c789,'message':'Notification\x20action\x20must\x20be\x20an\x20object.'});return;}const _0x4b75d3=requireNotificationString(_0x2d5203['text'],_0x49c789+_0x315515(0x1b3),_0x315515(0x1ed),_0x34b4d1);if(_0x4b75d3)validateNotificationPlaceholders(_0x4b75d3,_0x49c789+_0x315515(0x1b3),_0x34b4d1);const _0x4f57f4=requireNotificationString(_0x2d5203['url'],_0x49c789+_0x315515(0x1f3),_0x315515(0x21d),_0x34b4d1);if(!_0x4f57f4)return;validateNotificationPlaceholders(_0x4f57f4,_0x49c789+_0x315515(0x1f3),_0x34b4d1),!/^https?:\/\//i[_0x315515(0x20f)](_0x4f57f4)&&!NOTIFICATION_ACTION_URL_PLACEHOLDER_PATTERN[_0x315515(0x20f)](_0x4f57f4)&&_0x34b4d1[_0x315515(0x10b)]({'path':_0x49c789+'.url','message':_0x315515(0x24d)});});}function validateNotificationRecipients(_0x27bec2,_0x218674,_0x3587d0){const _0x14df1a=a299_0x15fb09;if(_0x27bec2===undefined||_0x27bec2===null)return;if(!Array[_0x14df1a(0x1a5)](_0x27bec2)){_0x3587d0[_0x14df1a(0x10b)]({'path':_0x218674,'message':_0x14df1a(0x1fc)});return;}let _0x4b2d02=![];_0x27bec2[_0x14df1a(0x188)]((_0xbe2123,_0x495291)=>{const _0x382ef3=_0x14df1a,_0x1ace50=_0x218674+'['+_0x495291+']';if(!isRecord(_0xbe2123)){_0x3587d0['push']({'path':_0x1ace50,'message':_0x382ef3(0x16d)});return;}const _0x5acc9b=requireNotificationString(_0xbe2123[_0x382ef3(0x118)],_0x1ace50+_0x382ef3(0x18d),'Notification\x20recipient.type\x20is\x20required.',_0x3587d0);_0x5acc9b&&!NOTIFICATION_RECIPIENT_TYPES[_0x382ef3(0x11a)](_0x5acc9b[_0x382ef3(0x21f)]())&&_0x3587d0['push']({'path':_0x1ace50+_0x382ef3(0x18d),'message':_0x382ef3(0x140)});let _0x548812='TO';_0xbe2123[_0x382ef3(0x167)]!==undefined&&_0xbe2123['role']!==null&&(typeof _0xbe2123[_0x382ef3(0x167)]!==_0x382ef3(0x1c8)?(_0x3587d0[_0x382ef3(0x10b)]({'path':_0x1ace50+_0x382ef3(0x10e),'message':_0x382ef3(0x184)}),_0x548812=''):(_0x548812=_0xbe2123[_0x382ef3(0x167)][_0x382ef3(0x1da)]()[_0x382ef3(0x21f)](),!NOTIFICATION_RECIPIENT_ROLES[_0x382ef3(0x11a)](_0x548812)&&_0x3587d0['push']({'path':_0x1ace50+_0x382ef3(0x10e),'message':_0x382ef3(0x240)})));if(_0x548812==='TO')_0x4b2d02=!![];const _0x425997=requireNotificationString(_0xbe2123['value'],_0x1ace50+'.value',_0x382ef3(0x151),_0x3587d0);_0x425997&&validateNotificationPlaceholders(_0x425997,_0x1ace50+_0x382ef3(0x1eb),_0x3587d0);}),_0x27bec2[_0x14df1a(0x1f5)]>0x0&&!_0x4b2d02&&_0x3587d0[_0x14df1a(0x10b)]({'path':_0x218674,'message':'Explicit\x20notification\x20recipients\x20require\x20at\x20least\x20one\x20TO.'});}function requireNotificationString(_0x136f8f,_0x301959,_0x1b2f0b,_0x143048){const _0xffb60b=a299_0x15fb09;if(typeof _0x136f8f!==_0xffb60b(0x1c8)||_0x136f8f[_0xffb60b(0x1da)]()==='')return _0x143048[_0xffb60b(0x10b)]({'path':_0x301959,'message':_0x1b2f0b}),undefined;return _0x136f8f[_0xffb60b(0x1da)]();}function validateNotificationPlaceholders(_0x25e31b,_0x524d0b,_0x5b9c29){const _0x3e8db1=a299_0x15fb09;for(const _0x1736ec of _0x25e31b[_0x3e8db1(0x1f1)](NOTIFICATION_PLACEHOLDER_PATTERN)){const _0x1738c2=_0x1736ec[0x1]?.[_0x3e8db1(0x1da)]()??'',_0x473f49=_0x1738c2[_0x3e8db1(0x225)]('.'),_0x5c23f9=_0x473f49>=0x0?_0x1738c2['slice'](0x0,_0x473f49):_0x1738c2,_0x25a139=_0x473f49>=0x0?_0x1738c2['slice'](_0x473f49+0x1)[_0x3e8db1(0x1da)]():'';(![_0x3e8db1(0x149),_0x3e8db1(0x1f8),_0x3e8db1(0x238)]['includes'](_0x5c23f9)||_0x25a139==='')&&_0x5b9c29['push']({'path':_0x524d0b,'message':_0x3e8db1(0x147)+_0x1736ec[0x0]+'.'});}_0x25e31b[_0x3e8db1(0x146)](NOTIFICATION_PLACEHOLDER_PATTERN,'')[_0x3e8db1(0x218)]('${')&&_0x5b9c29['push']({'path':_0x524d0b,'message':_0x3e8db1(0x153)});}function validateEdge(_0x25f742,_0x2be609,_0x40b3e7){const _0x1db789=a299_0x15fb09;_0x25f742[_0x1db789(0x268)]!==undefined&&typeof _0x25f742[_0x1db789(0x268)]!==_0x1db789(0x1c8)&&_0x40b3e7[_0x1db789(0x10b)]({'path':_0x2be609+_0x1db789(0x13b),'message':_0x1db789(0x214)}),_0x25f742[_0x1db789(0x148)]!==undefined&&typeof _0x25f742[_0x1db789(0x148)]!=='boolean'&&_0x40b3e7[_0x1db789(0x10b)]({'path':_0x2be609+_0x1db789(0x259),'message':_0x1db789(0x1b5)}),_0x25f742['waypoints']!==undefined&&(!Array['isArray'](_0x25f742['waypoints'])?_0x40b3e7[_0x1db789(0x10b)]({'path':_0x2be609+'.waypoints','message':'waypoints\x20must\x20be\x20an\x20array.'}):_0x25f742[_0x1db789(0x1e2)][_0x1db789(0x188)]((_0x42641e,_0x786935)=>{const _0x1165f8=_0x1db789;if(!isRecord(_0x42641e)){_0x40b3e7[_0x1165f8(0x10b)]({'path':_0x2be609+_0x1165f8(0x134)+_0x786935+']','message':'waypoint\x20must\x20contain\x20numeric\x20x\x20and\x20y\x20coordinates.'});return;}for(const _0x22806b of['x','y']){const _0x24c201=_0x42641e[_0x22806b];(typeof _0x24c201!=='number'||!Number['isFinite'](_0x24c201))&&_0x40b3e7[_0x1165f8(0x10b)]({'path':_0x2be609+_0x1165f8(0x134)+_0x786935+'].'+_0x22806b,'message':_0x1165f8(0x117)+_0x22806b+_0x1165f8(0x109)});}})),_0x25f742[_0x1db789(0x223)]!==undefined&&!CONDITION_TYPES[_0x1db789(0x11a)](_0x25f742[_0x1db789(0x223)])&&_0x40b3e7[_0x1db789(0x10b)]({'path':_0x2be609+_0x1db789(0x235),'message':_0x1db789(0x116)+String(_0x25f742[_0x1db789(0x223)])+'.'}),_0x25f742[_0x1db789(0x223)]===_0x1db789(0x187)&&(typeof _0x25f742[_0x1db789(0x12c)]!=='string'||_0x25f742[_0x1db789(0x12c)][_0x1db789(0x1da)]()==='')&&_0x40b3e7[_0x1db789(0x10b)]({'path':_0x2be609+'.expression','message':'EXPRESSION\x20edge\x20requires\x20expression.'}),_0x25f742[_0x1db789(0x148)]===!![]&&_0x25f742[_0x1db789(0x223)]!==_0x1db789(0x217)&&_0x40b3e7[_0x1db789(0x10b)]({'path':_0x2be609+_0x1db789(0x259),'message':'A\x20default\x20flow\x20must\x20use\x20conditionType\x20ALWAYS.'}),_0x25f742[_0x1db789(0x148)]===!![]&&typeof _0x25f742[_0x1db789(0x12c)]===_0x1db789(0x1c8)&&_0x25f742['expression'][_0x1db789(0x1da)]()!==''&&_0x40b3e7[_0x1db789(0x10b)]({'path':_0x2be609+_0x1db789(0x17b),'message':_0x1db789(0x1d4)});}function validateGraphShape(_0x493ee6,_0x4b9d20,_0xe70d14,_0x2dd100,_0x22d0f8,_0x6602a0,_0x5c1c16){const _0x2d5ef0=a299_0x15fb09;for(const [_0xa1e635,_0x4d3a52]of _0x493ee6){const _0x10168e=_0x22d0f8[_0x2d5ef0(0x139)](_0xa1e635)??[],_0x2fe420=_0x2dd100[_0x2d5ef0(0x139)](_0xa1e635)??[];_0x4d3a52[_0x2d5ef0(0x118)]!==_0x2d5ef0(0x23b)&&_0x10168e[_0x2d5ef0(0x1f5)]===0x0&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x2d5ef0(0x24c)+_0xa1e635,'message':'Node\x20has\x20no\x20incoming\x20edge.'});_0x4d3a52[_0x2d5ef0(0x118)]!==_0x2d5ef0(0x11d)&&_0x2fe420[_0x2d5ef0(0x1f5)]===0x0&&_0x5c1c16['push']({'path':_0x2d5ef0(0x24c)+_0xa1e635,'message':_0x2d5ef0(0x1e8)});_0x4d3a52[_0x2d5ef0(0x118)]===_0x2d5ef0(0x23b)&&_0x10168e[_0x2d5ef0(0x1f5)]>0x0&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x2d5ef0(0x24c)+_0xa1e635,'message':_0x2d5ef0(0x123)});_0x4d3a52[_0x2d5ef0(0x118)]==='END'&&_0x2fe420[_0x2d5ef0(0x1f5)]>0x0&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x2d5ef0(0x24c)+_0xa1e635,'message':_0x2d5ef0(0x171)});if(_0x4d3a52[_0x2d5ef0(0x118)]===_0x2d5ef0(0x253)){_0x2fe420[_0x2d5ef0(0x1f5)]<0x2&&_0x5c1c16['push']({'path':'flowJson.nodes.'+_0xa1e635,'message':'CONDITION\x20node\x20requires\x20at\x20least\x20two\x20outgoing\x20edges.'});const _0x5875a8=_0x2fe420['filter'](_0x102036=>_0x102036[_0x2d5ef0(0x148)]===!![]);_0x5875a8['length']!==0x1&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x2d5ef0(0x24c)+_0xa1e635,'message':_0x2d5ef0(0x132)});if(_0x5875a8['length']===0x1){const _0x563175=_0x5875a8[0x0],_0x47499a=_0x6602a0[_0x2d5ef0(0x139)](_0x563175)??_0x2d5ef0(0x170);_0x563175[_0x2d5ef0(0x223)]!==_0x2d5ef0(0x217)&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x47499a+_0x2d5ef0(0x235),'message':_0x2d5ef0(0x14a)});_0x563175[_0x2d5ef0(0x12c)]!==undefined&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x47499a+'.expression','message':'CONDITION\x20default\x20edge\x20must\x20not\x20define\x20expression.'});for(const _0x371d6f of _0x2fe420){if(_0x371d6f===_0x563175)continue;const _0x4a2333=_0x6602a0[_0x2d5ef0(0x139)](_0x371d6f)??'flowJson.edges';if(_0x371d6f[_0x2d5ef0(0x223)]!==_0x2d5ef0(0x187))_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x4a2333+_0x2d5ef0(0x235),'message':_0x2d5ef0(0x19e)});else(typeof _0x371d6f[_0x2d5ef0(0x12c)]!=='string'||_0x371d6f[_0x2d5ef0(0x12c)][_0x2d5ef0(0x1da)]()==='')&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x4a2333+'.expression','message':'CONDITION\x20non-default\x20edge\x20requires\x20a\x20non-empty\x20expression.'});}}}if(_0x4d3a52['type']===_0x2d5ef0(0x1cb)&&(_0x4d3a52['taskMode']??'APPROVAL')==='HANDLE'){if(_0x2fe420[_0x2d5ef0(0x1f5)]!==0x1)_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x2d5ef0(0x24c)+_0xa1e635,'message':_0x2d5ef0(0x1a9)});else{const _0x4ff518=_0x2fe420[0x0];((_0x4ff518[_0x2d5ef0(0x223)]??'ALWAYS')!==_0x2d5ef0(0x217)||_0x4ff518[_0x2d5ef0(0x148)]===!![]||typeof _0x4ff518['expression']==='string'&&_0x4ff518[_0x2d5ef0(0x12c)][_0x2d5ef0(0x1da)]()!=='')&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x6602a0[_0x2d5ef0(0x139)](_0x4ff518)??'flowJson.edges','message':'HANDLE\x20task\x20outgoing\x20edge\x20must\x20use\x20ALWAYS\x20without\x20defaultFlow\x20or\x20expression.'});}}else{if(_0x4d3a52[_0x2d5ef0(0x118)]===_0x2d5ef0(0x1cb)){const _0x1d4226=_0x2fe420[_0x2d5ef0(0x1b8)](_0xb8f79e=>_0xb8f79e[_0x2d5ef0(0x223)]??_0x2d5ef0(0x217)),_0x534f63=_0x1d4226[_0x2d5ef0(0x197)](_0x20813c=>_0x20813c!==_0x2d5ef0(0x1f9)&&_0x20813c!==_0x2d5ef0(0x241));_0x534f63[_0x2d5ef0(0x1f5)]>0x0&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x2d5ef0(0x24c)+_0xa1e635,'message':_0x2d5ef0(0x261)}),_0x1d4226[_0x2d5ef0(0x197)](_0x2e80bb=>_0x2e80bb===_0x2d5ef0(0x1f9))['length']!==0x1&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x2d5ef0(0x24c)+_0xa1e635,'message':_0x2d5ef0(0x18c)}),_0x1d4226[_0x2d5ef0(0x197)](_0x1caccb=>_0x1caccb==='REJECTED')[_0x2d5ef0(0x1f5)]!==0x1&&_0x5c1c16['push']({'path':'flowJson.nodes.'+_0xa1e635,'message':_0x2d5ef0(0x1ab)}),_0x2fe420['some'](_0x959118=>_0x959118['defaultFlow']===!![])&&_0x5c1c16[_0x2d5ef0(0x10b)]({'path':_0x2d5ef0(0x24c)+_0xa1e635,'message':_0x2d5ef0(0x1db)});}}}const _0x456636=new Set(),_0x5c51da=_0x81d4c8=>{const _0x2d9d65=_0x2d5ef0;if(_0x456636['has'](_0x81d4c8))return;_0x456636[_0x2d9d65(0x130)](_0x81d4c8);for(const _0x4e0b0a of _0x2dd100['get'](_0x81d4c8)??[]){const _0x326653=resolveEdgeEndpoint(_0x4e0b0a[_0x2d9d65(0x13a)],_0x4e0b0a[_0x2d9d65(0x124)]);if(_0x326653&&_0x493ee6['has'](_0x326653))_0x5c51da(_0x326653);}};_0x5c51da(_0x4b9d20);for(const _0x1695a3 of _0x493ee6[_0x2d5ef0(0x14b)]()){!_0x456636[_0x2d5ef0(0x11a)](_0x1695a3)&&_0x5c1c16['push']({'path':_0x2d5ef0(0x24c)+_0x1695a3,'message':'Node\x20is\x20not\x20reachable\x20from\x20START.'});}const _0x4ac382=_0xe70d14[_0x2d5ef0(0x158)](_0x5daf39=>_0x456636[_0x2d5ef0(0x11a)](_0x5daf39));if(!_0x4ac382){_0x5c1c16['push']({'path':_0x2d5ef0(0x170),'message':'No\x20END\x20node\x20is\x20reachable\x20from\x20START.'});return;}const _0x435343=new Set(),_0x35249d=_0x3f9a8d=>{const _0x5b85e0=_0x2d5ef0;if(_0x435343[_0x5b85e0(0x11a)](_0x3f9a8d))return;_0x435343[_0x5b85e0(0x130)](_0x3f9a8d);for(const _0x2a3ca4 of _0x22d0f8[_0x5b85e0(0x139)](_0x3f9a8d)??[]){const _0x33ddc5=resolveEdgeEndpoint(_0x2a3ca4[_0x5b85e0(0x211)],_0x2a3ca4[_0x5b85e0(0x1d3)]);if(_0x33ddc5&&_0x493ee6['has'](_0x33ddc5))_0x35249d(_0x33ddc5);}};for(const _0x3c2c0a of _0xe70d14){if(_0x493ee6[_0x2d5ef0(0x11a)](_0x3c2c0a))_0x35249d(_0x3c2c0a);}for(const _0x339134 of _0x456636){!_0x435343['has'](_0x339134)&&_0x5c1c16['push']({'path':_0x2d5ef0(0x24c)+_0x339134,'message':_0x2d5ef0(0x103)});}}function validateApprovalResults(_0x4c56a9,_0x2ed97c,_0x588a27,_0x2865bd){const _0x2e900c=a299_0x15fb09;if(_0x2ed97c===0x0)return;const _0x4bcaa4=new Set(_0x588a27[_0x2e900c(0x1b8)](_0x3f32e8=>_0x4c56a9['get'](_0x3f32e8)?.[_0x2e900c(0x237)])[_0x2e900c(0x197)](_0x2900b1=>typeof _0x2900b1===_0x2e900c(0x1c8)));for(const _0x4f2064 of[_0x2e900c(0x1f9),_0x2e900c(0x241)]){!_0x4bcaa4[_0x2e900c(0x11a)](_0x4f2064)&&_0x2865bd[_0x2e900c(0x10b)]({'path':_0x2e900c(0x22c),'message':_0x2e900c(0x199)+_0x4f2064+'.'});}}function validateScriptResultReferences(_0xc219fa,_0xf3c769,_0x12fcba,_0x539920,_0x38719f,_0x2d8fb2,_0x383fc1){const _0x5193e5=a299_0x15fb09;if(_0x2d8fb2[_0x5193e5(0x12a)]===0x0)return;const _0x5ab2a1=new Set(),_0x4500ed=_0x22e6f1=>{const _0x24fa32=_0x5193e5;if(!_0x5ab2a1[_0x24fa32(0x11a)](_0x22e6f1)&&_0xc219fa['has'](_0x22e6f1)){_0x5ab2a1[_0x24fa32(0x130)](_0x22e6f1);for(const _0x33dc32 of _0x12fcba[_0x24fa32(0x139)](_0x22e6f1)??[]){const _0x121eab=resolveEdgeEndpoint(_0x33dc32['target'],_0x33dc32['targetNodeId']);if(_0x121eab)_0x4500ed(_0x121eab);}}};_0x4500ed(_0xf3c769);const _0x383d16=new Map();for(const _0x32e4fd of _0x5ab2a1){_0x383d16['set'](_0x32e4fd,_0x32e4fd===_0xf3c769?new Set([_0xf3c769]):new Set(_0x5ab2a1));}let _0x11a423=!![];while(_0x11a423){_0x11a423=![];for(const _0x10a723 of _0x5ab2a1){if(_0x10a723===_0xf3c769)continue;const _0x4976eb=(_0x539920['get'](_0x10a723)??[])['map'](_0x4b9a28=>resolveEdgeEndpoint(_0x4b9a28[_0x5193e5(0x211)],_0x4b9a28['sourceNodeId']))[_0x5193e5(0x197)](_0xfa6ec3=>Boolean(_0xfa6ec3&&_0x5ab2a1['has'](_0xfa6ec3)));if(_0x4976eb[_0x5193e5(0x1f5)]===0x0)continue;const _0x18557c=new Set(_0x383d16[_0x5193e5(0x139)](_0x4976eb[0x0])??[]);for(const _0x23605b of _0x4976eb[_0x5193e5(0x112)](0x1)){const _0x54696a=_0x383d16['get'](_0x23605b)??new Set();for(const _0x544ecc of _0x18557c){if(!_0x54696a[_0x5193e5(0x11a)](_0x544ecc))_0x18557c[_0x5193e5(0x16b)](_0x544ecc);}}_0x18557c[_0x5193e5(0x130)](_0x10a723);const _0xf25c21=_0x383d16['get'](_0x10a723);!setsEqual(_0xf25c21,_0x18557c)&&(_0x383d16['set'](_0x10a723,_0x18557c),_0x11a423=!![]);}}for(const [_0x5db42f,_0x2200db]of _0x12fcba){const _0x1f7f5b=_0x383d16[_0x5193e5(0x139)](_0x5db42f);if(!_0x1f7f5b)continue;for(const _0x378dd5 of _0x2200db){if(_0x378dd5[_0x5193e5(0x223)]!==_0x5193e5(0x187)||typeof _0x378dd5[_0x5193e5(0x12c)]!=='string')continue;for(const [_0x33be31,_0x499372]of _0x2d8fb2){expressionReferencesVariable(_0x378dd5[_0x5193e5(0x12c)],_0x33be31)&&!_0x1f7f5b['has'](_0x499372)&&_0x383fc1['push']({'path':(_0x38719f['get'](_0x378dd5)??_0x5193e5(0x170))+_0x5193e5(0x17b),'message':_0x5193e5(0x16a)+_0x33be31+_0x5193e5(0x233)+_0x499372+'\x20is\x20not\x20on\x20every\x20upstream\x20path\x20to\x20'+_0x5db42f+'.'});}}}}function expressionReferencesVariable(_0x408d4e,_0x11dbc6){const _0x5aab7c=a299_0x15fb09;let _0x54c595=0x0;while(_0x54c595<_0x408d4e[_0x5aab7c(0x1f5)]){const _0x2be054=_0x408d4e[_0x54c595];if(_0x2be054==='\x27'||_0x2be054==='\x22'){_0x54c595=skipQuotedExpressionSegment(_0x408d4e,_0x54c595,_0x2be054);continue;}if(!/[A-Za-z_]/['test'](_0x2be054)){_0x54c595+=0x1;continue;}const _0x3a87b3=_0x54c595;_0x54c595+=0x1;while(_0x54c595<_0x408d4e[_0x5aab7c(0x1f5)]&&/[A-Za-z0-9_]/['test'](_0x408d4e[_0x54c595])){_0x54c595+=0x1;}if(_0x408d4e[_0x5aab7c(0x112)](_0x3a87b3,_0x54c595)!==_0x11dbc6)continue;let _0x543636=_0x3a87b3-0x1;while(_0x543636>=0x0&&/\s/[_0x5aab7c(0x20f)](_0x408d4e[_0x543636])){_0x543636-=0x1;}if(_0x408d4e[_0x543636]!=='.')return!![];}return![];}function skipQuotedExpressionSegment(_0x233b16,_0x50627a,_0x2a4594){const _0x55797e=a299_0x15fb09;let _0x568afb=_0x50627a+0x1;while(_0x568afb<_0x233b16[_0x55797e(0x1f5)]){if(_0x233b16[_0x568afb]==='\x5c'){_0x568afb+=0x2;continue;}if(_0x233b16[_0x568afb]===_0x2a4594)return _0x568afb+0x1;_0x568afb+=0x1;}return _0x568afb;}function resolveEffectiveResultVariable(_0x3e1ae7,_0x55eace){const _0x4b3836=a299_0x15fb09;if(_0x3e1ae7===undefined||_0x3e1ae7===null||_0x55eace&&_0x3e1ae7==='')return DEFAULT_SCRIPT_RESULT_VARIABLE;if(typeof _0x3e1ae7!==_0x4b3836(0x1c8)||!VARIABLE_PATTERN['test'](_0x3e1ae7)||RESERVED_RESULT_VARIABLES[_0x4b3836(0x11a)](_0x3e1ae7)||_0x3e1ae7['startsWith'](_0x4b3836(0x1ea)))return undefined;return _0x3e1ae7;}function registerResultVariableOwner(_0x1edb80,_0xa763ef,_0x377f66,_0x223a9d){const _0x3a3923=a299_0x15fb09;if(_0x1edb80[_0x3a3923(0x11a)](_0xa763ef)){_0x223a9d[_0x3a3923(0x10b)]({'path':_0x3a3923(0x22c),'message':_0x3a3923(0x121)+_0xa763ef+'.'});return;}_0x1edb80[_0x3a3923(0x251)](_0xa763ef,_0x377f66);}function setsEqual(_0x41a14e,_0x57563a){const _0x44e33c=a299_0x15fb09;return _0x41a14e[_0x44e33c(0x12a)]===_0x57563a[_0x44e33c(0x12a)]&&[..._0x41a14e][_0x44e33c(0x21b)](_0x2b0194=>_0x57563a['has'](_0x2b0194));}function isValidUserId(_0x482b64){const _0x29ef3c=a299_0x15fb09;if(typeof _0x482b64==='string')return _0x482b64['trim']()[_0x29ef3c(0x1f5)]>0x0;return Number[_0x29ef3c(0x25a)](_0x482b64)&&Number(_0x482b64)>0x0;}function resolveEdgeEndpoint(_0x3db74e,_0x323ef4){const _0x4e6d52=a299_0x15fb09;if(typeof _0x3db74e===_0x4e6d52(0x1c8)&&_0x3db74e[_0x4e6d52(0x1da)]())return _0x3db74e['trim']();if(typeof _0x323ef4===_0x4e6d52(0x1c8)&&_0x323ef4[_0x4e6d52(0x1da)]())return _0x323ef4[_0x4e6d52(0x1da)]();return undefined;}function removeEmptyMetadata(_0x4364c9,_0x1bb0e8,_0x565cfd,_0x4b4a4e){const _0x116306=a299_0x15fb09;if(Array['isArray'](_0x4364c9)){_0x4364c9[_0x116306(0x188)]((_0x28ea1f,_0x262337)=>removeEmptyMetadata(_0x28ea1f,_0x1bb0e8+'['+_0x262337+']',_0x565cfd,_0x4b4a4e));return;}if(!isRecord(_0x4364c9))return;for(const [_0x17333e,_0x5887cc]of Object[_0x116306(0x1d2)](_0x4364c9)){const _0x12c57a=_0x1bb0e8+'.'+_0x17333e;if(_0x17333e===_0x116306(0x203)&&isEmptyJsonValue(_0x5887cc)){delete _0x4364c9[_0x17333e],_0x4b4a4e[_0x116306(0x10b)](_0x12c57a),_0x565cfd[_0x116306(0x10b)]({'code':_0x116306(0x1e6),'path':_0x12c57a,'message':_0x12c57a+_0x116306(0x174)});continue;}removeEmptyMetadata(_0x5887cc,_0x12c57a,_0x565cfd,_0x4b4a4e);}}function isEmptyJsonValue(_0x44aca9){const _0x15991e=a299_0x15fb09;if(_0x44aca9===null||_0x44aca9===undefined)return!![];if(typeof _0x44aca9==='string')return _0x44aca9[_0x15991e(0x1da)]()==='';if(Array[_0x15991e(0x1a5)](_0x44aca9))return _0x44aca9['length']===0x0;return isRecord(_0x44aca9)&&Object[_0x15991e(0x14b)](_0x44aca9)['length']===0x0;}function isRecord(_0x459b8b){const _0x3c8aad=a299_0x15fb09;return typeof _0x459b8b==='object'&&_0x459b8b!==null&&!Array[_0x3c8aad(0x1a5)](_0x459b8b);}function cloneJsonValue(_0x55ac79){const _0x21102e=a299_0x15fb09;return JSON['parse'](JSON[_0x21102e(0x181)](_0x55ac79));}function a299_0x3f2b(_0x244dd7,_0x4dacec){_0x244dd7=_0x244dd7-0x101;const _0x2763ef=a299_0x2763();let _0x3f2b95=_0x2763ef[_0x244dd7];return _0x3f2b95;}export async function readFlowConfigFile(_0x3f1a35){const _0xa3f4a=a299_0x15fb09,_0x2eebf4=await readFile(resolve(_0x3f1a35),'utf8');return JSON[_0xa3f4a(0x1a6)](_0x2eebf4);}
1
+ const a299_0x305ad7=a299_0x2fc6;(function(_0x5b36ec,_0x3ec61f){const _0x28a4fb=a299_0x2fc6,_0x2f9d8e=_0x5b36ec();while(!![]){try{const _0x4b2cb8=parseInt(_0x28a4fb(0x11b))/0x1+parseInt(_0x28a4fb(0xe6))/0x2+parseInt(_0x28a4fb(0x1d2))/0x3+parseInt(_0x28a4fb(0x103))/0x4+parseInt(_0x28a4fb(0x18f))/0x5+parseInt(_0x28a4fb(0x1b5))/0x6+-parseInt(_0x28a4fb(0x19b))/0x7;if(_0x4b2cb8===_0x3ec61f)break;else _0x2f9d8e['push'](_0x2f9d8e['shift']());}catch(_0x48c24a){_0x2f9d8e['push'](_0x2f9d8e['shift']());}}}(a299_0x2810,0x57916));import{randomUUID}from'node:crypto';import{chmod,link,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{resolve}from'node:path';function a299_0x2810(){const _0x211692=['mode','EXECUTE_BFF\x20timeout\x20must\x20not\x20interrupt\x20the\x20approval\x20task.','NOTIFICATION','scriptName','approval_sys_datasetCode','Notification\x20fact\x20must\x20be\x20an\x20object.','toUpperCase','#/$defs/position','transferCandidates\x20currently\x20supports\x20FIXED\x20only.','Notification\x20configCode\x20is\x20required.','.waypoints','16707957TLjsFd','.defaultFlow','CUSTOM_PAGE','.assignee.strategy','FlowConfig\x20must\x20be\x20a\x20JSON\x20object.','pageMode','EXECUTE_BFF','Notification\x20recipient.type\x20is\x20required.','.assignee.userIds','CONDITION\x20non-default\x20edge\x20must\x20use\x20conditionType\x20EXPRESSION.','get','facts','.failurePolicy','AUTO_REJECT','HANDLE\x20task\x20requires\x20exactly\x20one\x20outgoing\x20edge.','.timeout.action','object','.role','EXECUTE_BFF\x20timeout\x20requires\x20scriptName.','Every\x20node\x20requires\x20position.x\x20and\x20position.y.','interrupting','\x20actions.','USER','datasetCode\x20must\x20be\x20a\x20string.','CONDITION\x20node\x20requires\x20exactly\x20one\x20default\x20outgoing\x20edge.','INDEPENDENT_FLOW\x20cannot\x20bind\x20pageId.','2182290NzVFhb','sequential\x20must\x20be\x20a\x20boolean.','startPageId\x20is\x20no\x20longer\x20supported;\x20use\x20startPath\x20instead.','Notification\x20fact.','flowJson.nodes[','Notification\x20version\x20must\x20be\x20a\x20string.','waypoint.','.transferCandidates.strategy','Notification\x20recipient.role\x20must\x20be\x20a\x20string.','value','HANDLE','value\x20must\x20be\x20a\x20non-empty\x20string.','delete','APPROVAL\x20node\x20outgoing\x20edges\x20must\x20use\x20APPROVED\x20or\x20REJECTED.','test','pageMode\x20applies\x20only\x20to\x20INDEPENDENT_FLOW.','scriptResult','schemaVersion','cc.recipientUserIds\x20supports\x20at\x20most\x20','.cc.recipientUserIds[','some','REJECTED','template','INDEPENDENT_FLOW\x20cannot\x20bind\x20datasetCode.','approval_sys_initiatorUsername','isSafeInteger','].taskMode','has','async','1897173fJZzpE','.cc.recipientUserIds','#/$defs/timeAmount','.transferCandidates.userIds','flowJson','title','FIXED','CONTINUE','slice','.assignee.userIds[','INDEPENDENT_FLOW\x20cannot\x20bind\x20pageIds.','FORM_FLOW','forEach','NOTIFICATION\x20node\x20requires\x20template.','.position','\x20was\x20empty\x20or\x20used\x20the\x20default\x20','.target','Unsupported\x20condition\x20type:\x20','cc.recipientUserIds\x20must\x20be\x20a\x20non-empty\x20array.','approval_sys_pageId','NaN','source','.resultVariable','flowJson.pageMode','entries','filter','unit','detailMarkdown','approval_sys_','APPROVAL\x20node\x20requires\x20assignee.','EMAIL','size','APPROVED','.url','.cc.readSources','conditionType','timeout','approved','Duplicate\x20node\x20id:\x20','flowCode','add','number','Accepted\x20as\x20legacy\x20input\x20and\x20removed\x20during\x20normalization;\x20other\x20versions\x20are\x20unsupported.','flowKey','waypoints','configCode','hasOwnProperty','duration\x20requires\x20value\x20and\x20unit.','Rabetbase\x20FlowConfig','expression','.cc','flowType','APPROVAL\x20node\x20requires\x20exactly\x20one\x20APPROVED\x20outgoing\x20edge.','ROLE','flowDesc\x20must\x20be\x20a\x20string.','Notification\x20template\x20supports\x20at\x20most\x20','Notification\x20action.url\x20must\x20use\x20http/https\x20or\x20a\x20complete\x20supported\x20placeholder.','.id','nodes\x20must\x20be\x20an\x20array.','flowJson.nodes','failurePolicy','Notification\x20action.text\x20is\x20required.','CONDITION\x20default\x20edge\x20must\x20use\x20conditionType\x20ALWAYS.','startPath\x20must\x20be\x20a\x20non-empty\x20string.','SECONDS','Node\x20cannot\x20reach\x20any\x20END.','Approval\x20flow\x20requires\x20an\x20END\x20node\x20with\x20result\x20','.assignee.roleId','flowJson.edges[','resultVariable','failurePolicy\x20must\x20be\x20CONTINUE\x20or\x20FAIL.','Flow\x20must\x20contain\x20exactly\x20one\x20START\x20node.','approvalMode','transfer\x20candidate\x20userId\x20must\x20be\x20a\x20non-empty\x20string\x20or\x20positive\x20integer.','push','pageIds','No\x20END\x20node\x20is\x20reachable\x20from\x20START.','APPROVAL\x20node\x20requires\x20exactly\x20one\x20REJECTED\x20outgoing\x20edge.','ANY','pageId','.async','defaultFlow','.transferCandidates.userIds[','string','DAYS','Node\x20has\x20no\x20outgoing\x20edge.','#/$defs/flowEdge','node\x20id\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','.transferCandidates','SINGLE','MAX_SAFE_INTEGER','templateName','position.','edges\x20must\x20be\x20an\x20array.','sourceNodeId','.detailMarkdown','FIXED\x20transferCandidates\x20requires\x20non-empty\x20userIds.','includes','assignee','flowJson.edges','edge\x20name\x20must\x20be\x20a\x20string.','array','summary','approval_sys_operationType','formDefinitions','Node\x20is\x20not\x20reachable\x20from\x20START.','https://lovrabet.com/schema/rabetbase-flow-config.json','.timeout','name','prototype','userIds','HANDLE\x20task\x20outgoing\x20edge\x20must\x20use\x20ALWAYS\x20without\x20defaultFlow\x20or\x20expression.','findIndex','datasetCode','.path','FAIL','672278hIHSrX','ALWAYS','pageIds\x20exceeds\x20the\x202048-character\x20binding\x20limit.','sequential','enabled','.position.','Unsupported\x20node\x20type:\x20','integer','A\x20default\x20flow\x20must\x20use\x20conditionType\x20ALWAYS.','\x20must\x20be\x20a\x20finite\x20number\x20greater\x20than\x20or\x20equal\x20to\x200.','CONDITION','retryCount','__rabetbase_local_validation__','empty_metadata_removed','.sequential','edge\x20must\x20be\x20an\x20object.','Duplicate\x20value:\x20','retryInterval','.async.enabled','roleId','taskMode','cc\x20recipient\x20userId\x20must\x20be\x20a\x20non-empty\x20string.','value\x20must\x20be\x20an\x20array.','.tmp','.actions','startPath\x20applies\x20only\x20to\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.','startPageId','text','async\x20execution\x20is\x20only\x20supported\x20by\x20SCRIPT\x20node.','2764292FMDCwT','SCRIPT\x20node\x20requires\x20scriptName.','transferCandidates','Edge\x20target\x20node\x20not\x20found:\x20','APPROVAL','isArray','config','isFinite','Custom\x20form\x20configuration\x20is\x20not\x20supported\x20by\x20this\x20rabetbase\x20version;\x20use\x20a\x20business\x20custom\x20page\x20instead.','parse','Edge\x20source\x20node\x20not\x20found:\x20','visible','^[1-9][0-9]*$','\x20is\x20not\x20on\x20every\x20upstream\x20path\x20to\x20','flowName','SCRIPT\x20async\x20retryCount\x20must\x20be\x20between\x201\x20and\x20','defaultFlow\x20must\x20be\x20a\x20boolean.','.config','url','flowDesc','START','approval_sys_initiatorUserId','targetNodeId','HOURS','353959MPlBQC','node\x20must\x20be\x20an\x20object.','call','appCode','trim',',\x20but\x20node\x20','waypoints\x20must\x20be\x20an\x20array.','Unsupported\x20approval\x20mode:\x20','.timeout.duration','.cc.visible','async\x20must\x20be\x20an\x20object.','PLATFORM_FORM','legacy_field_removed','pageIds\x20must\x20be\x20an\x20array\x20of\x20positive\x20safe\x20integers.','approval_sys_dataId','APPROVAL\x20task\x20decision\x20edges\x20must\x20not\x20be\x20default\x20flows.','boolean','SINGLE\x20approval\x20supports\x20only\x20one\x20fixed\x20user.','flowJson.schemaVersion','\x20is\x20not\x20part\x20of\x20the\x20portable\x20FlowConfig\x20and\x20was\x20removed.','indexOf','\x20timeout\x20must\x20interrupt\x20the\x20approval\x20task.','SCRIPT','type','timeout.interrupting\x20must\x20be\x20a\x20boolean.','\x20->\x20','startsWith','flowType\x20is\x20required.','approval_sys_appCode','approval.simple-flow.v1','EXPRESSION\x20edge\x20requires\x20expression.','actions','HANDLE\x20task\x20timeout\x20only\x20supports\x20EXECUTE_BFF.','recipients','flowName\x20is\x20required.','Notification\x20action\x20must\x20be\x20an\x20object.','Expression\x20references\x20SCRIPT\x20resultVariable\x20','version','.recipients','flowJson.startPageId','END','Notification\x20recipient.type\x20must\x20be\x20USER,\x20ROLE,\x20or\x20EMAIL.','transferCandidates\x20must\x20be\x20an\x20object.','.timeout.scriptName','target','AUTO_APPROVE','FIXED\x20assignee\x20requires\x20userIds.','result','resultVariable\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','path','assignee.strategy\x20must\x20be\x20FIXED\x20or\x20ROLE.','.pageId','fixed\x20assignee\x20userId\x20must\x20be\x20a\x20non-empty\x20string\x20or\x20positive\x20integer.','.value','metadata','label','Node\x20has\x20no\x20incoming\x20edge.','#/$defs/userId','nodes','action','Notification\x20recipients\x20must\x20be\x20an\x20array.','strategy','.timeout.interrupting','.scriptName','.\x20This\x20CLI\x20supports\x20only\x20','.approvalMode','position','recipientUserIds','ALL','map','.configCode','ROLE\x20assignee\x20requires\x20a\x20positive\x20integer\x20roleId.','Unsupported\x20schemaVersion:\x20','flowJson.nodes.','MINUTES','utf8','duration\x20unit\x20must\x20be\x20SECONDS,\x20MINUTES,\x20HOURS,\x20or\x20DAYS.','BCC','Notification\x20text\x20contains\x20a\x20malformed\x20placeholder.','set','readSources','pid','.version','.name','async.enabled\x20must\x20be\x20a\x20boolean.','timeout\x20is\x20only\x20supported\x20by\x20APPROVAL\x20node.','isInteger','.timeout.enabled','^[A-Za-z_][A-Za-z0-9_]*$','.conditionType','Duplicate\x20BPMN\x20element\x20id:\x20','\x20must\x20be\x20a\x20finite\x20number.','CONDITION\x20non-default\x20edge\x20requires\x20a\x20non-empty\x20expression.','edge\x20source\x20is\x20required.','.expression','replace','edges','.template','length','.text','context','formPermission','timeout.enabled\x20must\x20be\x20a\x20boolean.','.unit','Notification\x20template.actions\x20must\x20be\x20an\x20array.','flowJson.startPath','role','INDEPENDENT_FLOW','Notification\x20recipient\x20must\x20be\x20an\x20object.','Reserved\x20resultVariable:\x20','.waypoints[','timeout.action\x20must\x20be\x20AUTO_APPROVE,\x20AUTO_REJECT,\x20or\x20EXECUTE_BFF.','matchAll','stringify','.type','EXPRESSION','1841260UgrUOC'];a299_0x2810=function(){return _0x211692;};return a299_0x2810();}export const FLOW_CONFIG_JSON_SCHEMA={'$schema':'https://json-schema.org/draft/2020-12/schema','$id':a299_0x305ad7(0xdc),'title':a299_0x305ad7(0xa2),'type':'object','required':[a299_0x305ad7(0x111),a299_0x305ad7(0xa5),a299_0x305ad7(0x1d6)],'$defs':{'userId':{'anyOf':[{'type':a299_0x305ad7(0xc5),'minLength':0x1},{'type':'integer','minimum':0x1}]},'position':{'type':a299_0x305ad7(0x1ab),'required':['x','y'],'properties':{'x':{'type':a299_0x305ad7(0x9b),'minimum':0x0},'y':{'type':a299_0x305ad7(0x9b),'minimum':0x0}},'additionalProperties':!![]},'timeAmount':{'type':a299_0x305ad7(0x1ab),'required':[a299_0x305ad7(0x1be),a299_0x305ad7(0x1ec)],'properties':{'value':{'type':'integer','minimum':0x1},'unit':{'enum':[a299_0x305ad7(0xb2),a299_0x305ad7(0x165),'HOURS',a299_0x305ad7(0xc6)]}},'additionalProperties':!![]},'flowNode':{'type':'object','required':['id',a299_0x305ad7(0x132),'name',a299_0x305ad7(0x15d)],'properties':{'id':{'type':a299_0x305ad7(0xc5),'pattern':a299_0x305ad7(0x173)},'type':{'enum':['START','END',a299_0x305ad7(0x107),'CONDITION','SCRIPT','NOTIFICATION']},'name':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'path':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'position':{'$ref':a299_0x305ad7(0x197)},'approvalMode':{'enum':['SINGLE',a299_0x305ad7(0x15f),a299_0x305ad7(0xc0)]},'taskMode':{'enum':[a299_0x305ad7(0x107),a299_0x305ad7(0x1bf)]},'assignee':{'type':'object','required':['strategy'],'properties':{'strategy':{'enum':['FIXED','ROLE']},'userIds':{'type':a299_0x305ad7(0xd7),'minItems':0x1,'items':{'$ref':a299_0x305ad7(0x154)}},'roleId':{'anyOf':[{'type':'integer','minimum':0x1},{'type':a299_0x305ad7(0xc5),'pattern':a299_0x305ad7(0x10f)}]}},'additionalProperties':!![]},'transferCandidates':{'type':a299_0x305ad7(0x1ab),'required':[a299_0x305ad7(0x158),'userIds'],'properties':{'strategy':{'const':a299_0x305ad7(0x1d8)},'userIds':{'type':a299_0x305ad7(0xd7),'minItems':0x1,'items':{'$ref':'#/$defs/userId'}}},'additionalProperties':!![]},'sequential':{'type':a299_0x305ad7(0x12b)},'result':{'enum':['APPROVED',a299_0x305ad7(0x1ca)]},'scriptName':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'resultVariable':{'type':'string','pattern':'^[A-Za-z_][A-Za-z0-9_]*$'},'async':{'type':'object','properties':{'enabled':{'type':a299_0x305ad7(0x12b)},'retryCount':{'type':a299_0x305ad7(0xed),'minimum':0x1,'maximum':0xa},'retryInterval':{'$ref':a299_0x305ad7(0x1d4)}},'additionalProperties':!![]},'timeout':{'type':a299_0x305ad7(0x1ab),'properties':{'enabled':{'type':a299_0x305ad7(0x12b)},'duration':{'$ref':a299_0x305ad7(0x1d4)},'action':{'enum':[a299_0x305ad7(0x148),a299_0x305ad7(0x1a8),a299_0x305ad7(0x1a1)]},'interrupting':{'type':'boolean'},'scriptName':{'type':'string','minLength':0x1},'resultVariable':{'type':a299_0x305ad7(0xc5),'pattern':a299_0x305ad7(0x173)}},'additionalProperties':!![]},'cc':{'type':'object','required':[a299_0x305ad7(0x15e)],'properties':{'recipientUserIds':{'type':'array','minItems':0x1,'maxItems':0x64,'uniqueItems':!![],'items':{'type':a299_0x305ad7(0xc5),'minLength':0x1}},'visible':{'type':a299_0x305ad7(0xd7),'uniqueItems':!![],'items':{'type':a299_0x305ad7(0xc5),'minLength':0x1}},'readSources':![]},'additionalProperties':!![]},'config':{'type':a299_0x305ad7(0x1ab),'required':[a299_0x305ad7(0x9f),a299_0x305ad7(0x1cb)],'properties':{'version':{'enum':['v1']},'configCode':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'failurePolicy':{'enum':['CONTINUE',a299_0x305ad7(0xe5)]},'template':{'type':a299_0x305ad7(0x1ab),'required':[a299_0x305ad7(0x1d7),a299_0x305ad7(0xd8)],'properties':{'title':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'summary':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'detailMarkdown':{'type':'string'},'facts':{'type':a299_0x305ad7(0xd7),'maxItems':0x8,'items':{'type':a299_0x305ad7(0x1ab),'required':[a299_0x305ad7(0x152),'value'],'properties':{'label':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'value':{'type':a299_0x305ad7(0xc5),'minLength':0x1}},'additionalProperties':!![]}},'actions':{'type':a299_0x305ad7(0xd7),'maxItems':0x2,'items':{'type':a299_0x305ad7(0x1ab),'required':[a299_0x305ad7(0x101),'url'],'properties':{'text':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'url':{'type':a299_0x305ad7(0xc5),'minLength':0x1}},'additionalProperties':!![]}}},'additionalProperties':!![]},'recipients':{'type':a299_0x305ad7(0xd7),'items':{'type':a299_0x305ad7(0x1ab),'required':[a299_0x305ad7(0x132),a299_0x305ad7(0x1be)],'properties':{'type':{'enum':[a299_0x305ad7(0x1b1),a299_0x305ad7(0xa7),a299_0x305ad7(0x1f0)]},'value':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'role':{'enum':['TO','CC',a299_0x305ad7(0x168)]}},'additionalProperties':!![]}}},'additionalProperties':!![]},'form':![],'formPermission':![]},'additionalProperties':!![]},'flowEdge':{'type':a299_0x305ad7(0x1ab),'properties':{'id':{'type':a299_0x305ad7(0xc5),'pattern':a299_0x305ad7(0x173)},'source':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'target':{'type':'string','minLength':0x1},'sourceNodeId':{'type':'string','minLength':0x1},'targetNodeId':{'type':'string','minLength':0x1},'conditionType':{'enum':[a299_0x305ad7(0xe7),'APPROVED',a299_0x305ad7(0x1ca),a299_0x305ad7(0x18e)]},'expression':{'type':a299_0x305ad7(0xc5)},'defaultFlow':{'type':a299_0x305ad7(0x12b)},'name':{'type':a299_0x305ad7(0xc5)},'waypoints':{'type':a299_0x305ad7(0xd7),'items':{'$ref':'#/$defs/position'}}},'allOf':[{'anyOf':[{'required':[a299_0x305ad7(0x1e7)]},{'required':[a299_0x305ad7(0xd0)]}]},{'anyOf':[{'required':[a299_0x305ad7(0x147)]},{'required':['targetNodeId']}]}],'additionalProperties':!![]}},'properties':{'id':![],'appCode':![],'flowName':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'flowDesc':{'type':'string'},'flowType':{'enum':[a299_0x305ad7(0x1dd),a299_0x305ad7(0x186)]},'datasetCode':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'pageId':{'type':a299_0x305ad7(0xed),'minimum':0x1,'maximum':Number[a299_0x305ad7(0xcc)]},'pageIds':{'type':a299_0x305ad7(0xd7),'items':{'type':'integer','minimum':0x1,'maximum':Number[a299_0x305ad7(0xcc)]}},'templateName':![],'flowJson':{'type':'object','required':[a299_0x305ad7(0x155),'edges'],'properties':{'flowKey':![],'flowCode':![],'flowName':![],'bindDatasetCode':![],'datasetCode':![],'appCode':![],'pageId':![],'templateName':![],'schemaVersion':{'type':'string','const':a299_0x305ad7(0x138),'description':a299_0x305ad7(0x9c)},'formSchema':![],'formDefinitions':![],'formPermissions':![],'pageMode':{'const':'CUSTOM_PAGE'},'startPageId':![],'startPath':{'type':a299_0x305ad7(0xc5),'minLength':0x1},'nodes':{'type':a299_0x305ad7(0xd7),'minItems':0x1,'items':{'$ref':'#/$defs/flowNode'}},'edges':{'type':a299_0x305ad7(0xd7),'minItems':0x1,'items':{'$ref':a299_0x305ad7(0xc8)}}},'additionalProperties':!![]}},'additionalProperties':!![]};const REMOVED_FLOW_JSON_FIELDS=['flowKey',a299_0x305ad7(0x99),'flowName','bindDatasetCode',a299_0x305ad7(0xe3),a299_0x305ad7(0x11e),a299_0x305ad7(0xc1),'templateName'],REMOVED_ROOT_FIELDS=['id','appCode',a299_0x305ad7(0xcd)],DEFAULT_FLOW_SCHEMA_VERSION=a299_0x305ad7(0x138),NODE_TYPES=new Set(['START',a299_0x305ad7(0x143),'APPROVAL',a299_0x305ad7(0xf0),a299_0x305ad7(0x131),a299_0x305ad7(0x192)]),CONDITION_TYPES=new Set([a299_0x305ad7(0xe7),'APPROVED','REJECTED',a299_0x305ad7(0x18e)]),APPROVAL_MODES=new Set([a299_0x305ad7(0xcb),'ALL','ANY']),APPROVAL_TASK_MODES=new Set([a299_0x305ad7(0x107),a299_0x305ad7(0x1bf)]),FLOW_TIME_UNITS=new Set([a299_0x305ad7(0xb2),a299_0x305ad7(0x165),a299_0x305ad7(0x11a),a299_0x305ad7(0xc6)]),APPROVAL_TIMEOUT_ACTIONS=new Set(['AUTO_APPROVE',a299_0x305ad7(0x1a8),a299_0x305ad7(0x1a1)]),FLOW_TYPES=new Set([a299_0x305ad7(0x1dd),a299_0x305ad7(0x186)]),FLOW_PAGE_MODES=new Set(['CUSTOM_PAGE','PLATFORM_FORM']),BPMN_ID_PATTERN=/^[A-Za-z_][A-Za-z0-9_]*$/,VARIABLE_PATTERN=/^[A-Za-z_][A-Za-z0-9_]*$/,NOTIFICATION_PLACEHOLDER_PATTERN=/\$\{([^{}]+)\}/g,NOTIFICATION_ACTION_URL_PLACEHOLDER_PATTERN=/^\$\{(?:event|context|variables)\.[^{}]+\}$/,NOTIFICATION_FAILURE_POLICIES=new Set([a299_0x305ad7(0x1d9),a299_0x305ad7(0xe5)]),NOTIFICATION_RECIPIENT_TYPES=new Set([a299_0x305ad7(0x1b1),a299_0x305ad7(0xa7),'EMAIL']),NOTIFICATION_RECIPIENT_ROLES=new Set(['TO','CC',a299_0x305ad7(0x168)]),MAX_NOTIFICATION_FACTS=0x8,MAX_NOTIFICATION_ACTIONS=0x2,MAX_ASYNC_RETRY_COUNT=0xa,MAX_CC_RECIPIENTS=0x64,DEFAULT_SCRIPT_RESULT_VARIABLE=a299_0x305ad7(0x1c5),UNSUPPORTED_FORM_MESSAGE=a299_0x305ad7(0x10b),UNSUPPORTED_PLATFORM_FORM_MESSAGE='PLATFORM_FORM\x20is\x20not\x20supported\x20by\x20this\x20rabetbase\x20version;\x20use\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.',RESERVED_RESULT_VARIABLES=new Set(['formData',a299_0x305ad7(0x97),a299_0x305ad7(0x137),'approval_sys_processInstanceId',a299_0x305ad7(0x118),a299_0x305ad7(0x1cd),a299_0x305ad7(0x194),a299_0x305ad7(0x1e5),a299_0x305ad7(0xd9),a299_0x305ad7(0x129)]);export function normalizeFlowConfig(_0x3d0232){const _0x15bca5=a299_0x305ad7;if(!isRecord(_0x3d0232))throw new TypeError(_0x15bca5(0x19f));const _0x559132=cloneJsonValue(_0x3d0232),_0x541146=_0x559132['flowJson'],_0x1ec91e=isRecord(_0x541146)?cloneJsonValue(_0x541146):{},_0x535a8e=[],_0x321ba3=[];for(const _0x36798f of REMOVED_ROOT_FIELDS){if(!Object[_0x15bca5(0xdf)][_0x15bca5(0xa0)][_0x15bca5(0x11d)](_0x559132,_0x36798f))continue;delete _0x559132[_0x36798f],_0x321ba3[_0x15bca5(0xbc)](_0x36798f),_0x535a8e[_0x15bca5(0xbc)]({'code':_0x15bca5(0x127),'path':_0x36798f,'message':_0x36798f+_0x15bca5(0x12e)});}for(const _0x498746 of REMOVED_FLOW_JSON_FIELDS){if(!Object[_0x15bca5(0xdf)]['hasOwnProperty'][_0x15bca5(0x11d)](_0x1ec91e,_0x498746))continue;const _0xe32313='flowJson.'+_0x498746;delete _0x1ec91e[_0x498746],_0x321ba3[_0x15bca5(0xbc)](_0xe32313),_0x535a8e[_0x15bca5(0xbc)]({'code':_0x15bca5(0x127),'path':_0xe32313,'message':_0xe32313+_0x15bca5(0x12e)});}if(Object[_0x15bca5(0xdf)][_0x15bca5(0xa0)][_0x15bca5(0x11d)](_0x1ec91e,'schemaVersion')){const _0x33cd22=_0x1ec91e[_0x15bca5(0x1c6)],_0x51cdd0=typeof _0x33cd22==='string'?_0x33cd22[_0x15bca5(0x11f)]():_0x33cd22;if(isEmptyJsonValue(_0x33cd22)||_0x51cdd0===DEFAULT_FLOW_SCHEMA_VERSION){const _0x318aae=_0x15bca5(0x12d);delete _0x1ec91e['schemaVersion'],_0x321ba3[_0x15bca5(0xbc)](_0x318aae),_0x535a8e[_0x15bca5(0xbc)]({'code':_0x15bca5(0x127),'path':_0x318aae,'message':_0x318aae+_0x15bca5(0x1e1)+DEFAULT_FLOW_SCHEMA_VERSION+'\x20value\x20and\x20was\x20removed\x20from\x20the\x20portable\x20FlowConfig.'});}}removeEmptyMetadata(_0x1ec91e,'flowJson',_0x535a8e,_0x321ba3);_0x559132['flowType']==='INDEPENDENT_FLOW'&&!Object[_0x15bca5(0xdf)][_0x15bca5(0xa0)][_0x15bca5(0x11d)](_0x1ec91e,_0x15bca5(0x1a0))&&(_0x1ec91e[_0x15bca5(0x1a0)]=_0x15bca5(0x19d));_0x559132[_0x15bca5(0x1d6)]=_0x1ec91e;if(typeof _0x559132['flowName']==='string')_0x559132[_0x15bca5(0x111)]=_0x559132['flowName'][_0x15bca5(0x11f)]();return{'config':_0x559132,'warnings':_0x535a8e,'removedPaths':_0x321ba3};}export function validateFlowConfig(_0x26071d){const _0x459a8f=a299_0x305ad7;let _0x1049dc;try{_0x1049dc=normalizeFlowConfig(_0x26071d);}catch(_0x23f38c){const _0x22a6bf=_0x23f38c instanceof Error?_0x23f38c['message']:String(_0x23f38c),_0x3c17b={'flowJson':{}};return{'valid':![],'errors':[{'path':'$','message':_0x22a6bf}],'warnings':[],'normalized':_0x3c17b,'validationConfig':_0x3c17b};}const _0x17f667=_0x1049dc[_0x459a8f(0x109)],_0x32b215=cloneJsonValue(_0x17f667),_0x90a633=_0x32b215[_0x459a8f(0x1d6)];_0x90a633[_0x459a8f(0x9d)]=_0x459a8f(0xf2),_0x90a633['flowName']=_0x17f667[_0x459a8f(0x111)];typeof _0x17f667['datasetCode']===_0x459a8f(0xc5)&&_0x17f667[_0x459a8f(0xe3)][_0x459a8f(0x11f)]()&&(_0x90a633['bindDatasetCode']=_0x17f667[_0x459a8f(0xe3)][_0x459a8f(0x11f)]());const _0x4d7948=[];return validateOuterMetadata(_0x17f667,_0x4d7948),validateFlowClassification(_0x17f667,_0x4d7948),validateGraph(_0x17f667['flowJson'],_0x4d7948),{'valid':_0x4d7948[_0x459a8f(0x17d)]===0x0,'errors':_0x4d7948,'warnings':_0x1049dc['warnings'],'normalized':_0x17f667,'validationConfig':_0x32b215};}function validateFlowClassification(_0x512fb5,_0x58d83c){const _0x48d579=a299_0x305ad7;if(!isRecord(_0x512fb5['flowJson']))return;const _0x1a20cc=_0x512fb5[_0x48d579(0xa5)],_0x76a2ef=_0x512fb5[_0x48d579(0x1d6)][_0x48d579(0x1a0)];_0x76a2ef!==undefined&&(typeof _0x76a2ef!==_0x48d579(0xc5)||!FLOW_PAGE_MODES[_0x48d579(0x1d0)](_0x76a2ef))&&_0x58d83c[_0x48d579(0xbc)]({'path':_0x48d579(0x1e9),'message':'Unsupported\x20pageMode:\x20'+String(_0x76a2ef)+'.'});_0x1a20cc===_0x48d579(0x1dd)&&_0x76a2ef!==undefined&&_0x58d83c[_0x48d579(0xbc)]({'path':_0x48d579(0x1e9),'message':_0x48d579(0x1c4)});_0x1a20cc==='INDEPENDENT_FLOW'&&_0x76a2ef===_0x48d579(0x126)&&_0x58d83c[_0x48d579(0xbc)]({'path':_0x48d579(0x1e9),'message':UNSUPPORTED_PLATFORM_FORM_MESSAGE});(_0x1a20cc===_0x48d579(0x1dd)||_0x1a20cc===_0x48d579(0x186))&&validateCustomPageNavigation(_0x512fb5,_0x1a20cc,_0x76a2ef,_0x58d83c);if(_0x1a20cc!==_0x48d579(0x1dd)||!Array[_0x48d579(0x108)](_0x512fb5[_0x48d579(0x1d6)][_0x48d579(0x155)]))return;_0x512fb5[_0x48d579(0x1d6)][_0x48d579(0x155)][_0x48d579(0x1de)]((_0x5357bc,_0x3ecc87)=>{const _0xbcd404=_0x48d579;isRecord(_0x5357bc)&&_0x5357bc[_0xbcd404(0x132)]==='APPROVAL'&&_0x5357bc[_0xbcd404(0xfa)]===_0xbcd404(0x1bf)&&_0x58d83c['push']({'path':_0xbcd404(0x1b9)+_0x3ecc87+_0xbcd404(0x1cf),'message':'FORM_FLOW\x20is\x20an\x20approval\x20flow\x20and\x20cannot\x20contain\x20HANDLE\x20tasks;\x20use\x20INDEPENDENT_FLOW\x20for\x20workflows.'});});}function validateCustomPageNavigation(_0x50f62a,_0x55e5ba,_0x38405b,_0x3fbd1d){const _0x1bf5cf=a299_0x305ad7,_0x4becf7=_0x50f62a[_0x1bf5cf(0x1d6)][_0x1bf5cf(0x100)];_0x4becf7!==undefined&&_0x3fbd1d[_0x1bf5cf(0xbc)]({'path':_0x1bf5cf(0x142),'message':_0x1bf5cf(0x1b7)});const _0x1134f7=_0x50f62a[_0x1bf5cf(0x1d6)]['startPath'];_0x1134f7!==undefined&&(typeof _0x1134f7!=='string'||_0x1134f7[_0x1bf5cf(0x11f)]()==='')&&_0x3fbd1d['push']({'path':_0x1bf5cf(0x184),'message':_0x1bf5cf(0xb1)});const _0x2218e2=Array[_0x1bf5cf(0x108)](_0x50f62a['flowJson']['nodes'])?_0x50f62a['flowJson'][_0x1bf5cf(0x155)]['map']((_0x22fcb6,_0x3f5fa0)=>({'node':_0x22fcb6,'index':_0x3f5fa0}))[_0x1bf5cf(0x1eb)](({node:_0x3fe1e3})=>isRecord(_0x3fe1e3)&&_0x3fe1e3[_0x1bf5cf(0x14c)]!==undefined):[],_0x4b113c=_0x1134f7!==undefined||_0x2218e2['length']>0x0,_0x32b458=_0x38405b===undefined&&_0x55e5ba===_0x1bf5cf(0x186)?'CUSTOM_PAGE':_0x38405b;_0x4b113c&&(_0x55e5ba!==_0x1bf5cf(0x186)||_0x32b458!=='CUSTOM_PAGE')&&(_0x1134f7!==undefined&&_0x3fbd1d[_0x1bf5cf(0xbc)]({'path':'flowJson.startPath','message':_0x1bf5cf(0xff)}),_0x2218e2['forEach'](({index:_0x5a566f})=>{const _0x452d8c=_0x1bf5cf;_0x3fbd1d[_0x452d8c(0xbc)]({'path':'flowJson.nodes['+_0x5a566f+'].path','message':'node\x20path\x20applies\x20only\x20to\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.'});}));}export async function writeNormalizedFlowConfig(_0x22333d,_0x477125,_0x5a08b3={}){const _0x3a9ede=a299_0x305ad7,_0x3add82=resolve(_0x22333d),_0x59d2e4=_0x3add82+'.'+process[_0x3a9ede(0x16c)]+'.'+randomUUID()+_0x3a9ede(0xfd),_0x18aa24=JSON['stringify'](_0x477125,null,0x2)+'\x0a';let _0x5388ad;try{try{_0x5388ad=(await stat(_0x3add82))[_0x3a9ede(0x190)]&0x1ff;}catch{_0x5388ad=undefined;}await writeFile(_0x59d2e4,_0x18aa24,{'encoding':'utf8','flag':'wx','mode':_0x5388ad??0x1a4});if(_0x5388ad!==undefined)await chmod(_0x59d2e4,_0x5388ad);_0x5a08b3['overwrite']===![]?(await link(_0x59d2e4,_0x3add82),await unlink(_0x59d2e4)):await rename(_0x59d2e4,_0x3add82);}finally{await unlink(_0x59d2e4)['catch'](()=>undefined);}}function validateOuterMetadata(_0x18f636,_0x4aa356){const _0x48be0f=a299_0x305ad7;(typeof _0x18f636['flowName']!==_0x48be0f(0xc5)||_0x18f636[_0x48be0f(0x111)]['trim']()==='')&&_0x4aa356['push']({'path':_0x48be0f(0x111),'message':_0x48be0f(0x13d)});_0x18f636[_0x48be0f(0x116)]!==undefined&&typeof _0x18f636['flowDesc']!==_0x48be0f(0xc5)&&_0x4aa356[_0x48be0f(0xbc)]({'path':'flowDesc','message':_0x48be0f(0xa8)});if(_0x18f636[_0x48be0f(0xa5)]===undefined||_0x18f636[_0x48be0f(0xa5)]===null)_0x4aa356[_0x48be0f(0xbc)]({'path':_0x48be0f(0xa5),'message':_0x48be0f(0x136)});else(typeof _0x18f636['flowType']!==_0x48be0f(0xc5)||!FLOW_TYPES[_0x48be0f(0x1d0)](_0x18f636[_0x48be0f(0xa5)]))&&_0x4aa356[_0x48be0f(0xbc)]({'path':_0x48be0f(0xa5),'message':'Unsupported\x20flowType:\x20'+String(_0x18f636[_0x48be0f(0xa5)])+'.'});_0x18f636['datasetCode']!==undefined&&typeof _0x18f636['datasetCode']!=='string'&&_0x4aa356[_0x48be0f(0xbc)]({'path':_0x48be0f(0xe3),'message':_0x48be0f(0x1b2)});_0x18f636[_0x48be0f(0xbd)]===undefined&&_0x18f636[_0x48be0f(0xc1)]!==undefined&&(!Number['isSafeInteger'](_0x18f636[_0x48be0f(0xc1)])||_0x18f636[_0x48be0f(0xc1)]<=0x0)&&_0x4aa356[_0x48be0f(0xbc)]({'path':_0x48be0f(0xc1),'message':'pageId\x20must\x20be\x20a\x20positive\x20safe\x20integer.'});if(_0x18f636[_0x48be0f(0xbd)]!==undefined){if(!Array[_0x48be0f(0x108)](_0x18f636['pageIds'])||_0x18f636[_0x48be0f(0xbd)][_0x48be0f(0x1c9)](_0x503e30=>!Number[_0x48be0f(0x1ce)](_0x503e30)||_0x503e30<=0x0))_0x4aa356[_0x48be0f(0xbc)]({'path':_0x48be0f(0xbd),'message':_0x48be0f(0x128)});else[...new Set(_0x18f636[_0x48be0f(0xbd)])]['join'](',')[_0x48be0f(0x17d)]>0x800&&_0x4aa356[_0x48be0f(0xbc)]({'path':_0x48be0f(0xbd),'message':_0x48be0f(0xe8)});_0x18f636[_0x48be0f(0xa5)]===_0x48be0f(0x186)&&Array[_0x48be0f(0x108)](_0x18f636[_0x48be0f(0xbd)])&&_0x18f636['pageIds']['length']>0x0&&_0x4aa356['push']({'path':_0x48be0f(0xbd),'message':_0x48be0f(0x1dc)});}_0x18f636['flowType']===_0x48be0f(0x186)&&_0x18f636[_0x48be0f(0xe3)]!==undefined&&_0x4aa356[_0x48be0f(0xbc)]({'path':_0x48be0f(0xe3),'message':_0x48be0f(0x1cc)}),_0x18f636[_0x48be0f(0xa5)]==='INDEPENDENT_FLOW'&&_0x18f636[_0x48be0f(0xbd)]===undefined&&_0x18f636[_0x48be0f(0xc1)]!==undefined&&_0x4aa356[_0x48be0f(0xbc)]({'path':_0x48be0f(0xc1),'message':_0x48be0f(0x1b4)});}function validateGraph(_0x481773,_0x4bc604){const _0x49404a=a299_0x305ad7;if(!isRecord(_0x481773)){_0x4bc604[_0x49404a(0xbc)]({'path':_0x49404a(0x1d6),'message':'flowJson\x20must\x20be\x20an\x20object.'});return;}!Array['isArray'](_0x481773[_0x49404a(0x155)])&&_0x4bc604[_0x49404a(0xbc)]({'path':'flowJson.nodes','message':_0x49404a(0xac)});!Array[_0x49404a(0x108)](_0x481773['edges'])&&_0x4bc604[_0x49404a(0xbc)]({'path':_0x49404a(0xd5),'message':_0x49404a(0xcf)});Object[_0x49404a(0xdf)][_0x49404a(0xa0)][_0x49404a(0x11d)](_0x481773,_0x49404a(0x1c6))&&_0x4bc604['push']({'path':_0x49404a(0x12d),'message':_0x49404a(0x163)+String(_0x481773[_0x49404a(0x1c6)])+_0x49404a(0x15b)+DEFAULT_FLOW_SCHEMA_VERSION+'.'});for(const _0x494794 of['formSchema',_0x49404a(0xda),'formPermissions']){Object[_0x49404a(0xdf)][_0x49404a(0xa0)][_0x49404a(0x11d)](_0x481773,_0x494794)&&_0x4bc604[_0x49404a(0xbc)]({'path':'flowJson.'+_0x494794,'message':UNSUPPORTED_FORM_MESSAGE});}if(!Array[_0x49404a(0x108)](_0x481773[_0x49404a(0x155)])||!Array[_0x49404a(0x108)](_0x481773[_0x49404a(0x17b)]))return;const _0x54bea5=new Map(),_0x5c9299=[],_0x23a9ce=[],_0x3fb5d7=new Map(),_0x3e9290=new Map(),_0x3ebf6e=new Set();let _0x435230=0x0;_0x481773[_0x49404a(0x155)][_0x49404a(0x1de)]((_0x3820c4,_0x1a5581)=>{const _0xc3208f=_0x49404a,_0x3387b4=_0xc3208f(0x1b9)+_0x1a5581+']';if(!isRecord(_0x3820c4)){_0x4bc604['push']({'path':_0x3387b4,'message':_0xc3208f(0x11c)});return;}const _0x46c364=_0x3820c4;if(typeof _0x46c364['id']!==_0xc3208f(0xc5)||!BPMN_ID_PATTERN['test'](_0x46c364['id']))_0x4bc604[_0xc3208f(0xbc)]({'path':_0x3387b4+'.id','message':_0xc3208f(0xc9)});else _0x54bea5['has'](_0x46c364['id'])?_0x4bc604[_0xc3208f(0xbc)]({'path':_0x3387b4+_0xc3208f(0xab),'message':_0xc3208f(0x98)+_0x46c364['id']+'.'}):(_0x54bea5[_0xc3208f(0x16a)](_0x46c364['id'],_0x46c364),_0x3ebf6e[_0xc3208f(0x9a)](_0x46c364['id']));if(!NODE_TYPES[_0xc3208f(0x1d0)](_0x46c364[_0xc3208f(0x132)]))_0x4bc604[_0xc3208f(0xbc)]({'path':_0x3387b4+'.type','message':_0xc3208f(0xec)+String(_0x46c364[_0xc3208f(0x132)])+'.'});else{if(_0x46c364[_0xc3208f(0x132)]===_0xc3208f(0x117))_0x5c9299['push'](_0x46c364['id']);else _0x46c364[_0xc3208f(0x132)]===_0xc3208f(0x143)&&_0x23a9ce[_0xc3208f(0xbc)](_0x46c364['id']);}_0x46c364[_0xc3208f(0x132)]===_0xc3208f(0x107)&&(_0x46c364[_0xc3208f(0xfa)]===undefined||_0x46c364[_0xc3208f(0xfa)]===_0xc3208f(0x107))&&(_0x435230+=0x1);validateNode(_0x46c364,_0x3387b4,_0x4bc604);if(_0x46c364[_0xc3208f(0x132)]==='SCRIPT'){const _0x1c657e=resolveEffectiveResultVariable(_0x46c364[_0xc3208f(0xb7)],![]);_0x1c657e&&(registerResultVariableOwner(_0x3e9290,_0x1c657e,_0x46c364['id'],_0x4bc604),!_0x3fb5d7[_0xc3208f(0x1d0)](_0x1c657e)&&_0x3fb5d7[_0xc3208f(0x16a)](_0x1c657e,_0x46c364['id']));}if(_0x46c364[_0xc3208f(0x132)]===_0xc3208f(0x107)&&isRecord(_0x46c364['timeout'])&&_0x46c364['timeout'][_0xc3208f(0xea)]===!![]&&_0x46c364['timeout'][_0xc3208f(0x156)]===_0xc3208f(0x1a1)){const _0x3a040e=resolveEffectiveResultVariable(_0x46c364[_0xc3208f(0x1f6)]['resultVariable'],!![]);_0x3a040e&&registerResultVariableOwner(_0x3e9290,_0x3a040e,_0x46c364['id']+_0xc3208f(0xdd),_0x4bc604);}});_0x5c9299[_0x49404a(0x17d)]!==0x1&&_0x4bc604['push']({'path':_0x49404a(0xad),'message':_0x49404a(0xb9)});_0x23a9ce[_0x49404a(0x17d)]===0x0&&_0x4bc604[_0x49404a(0xbc)]({'path':_0x49404a(0xad),'message':'Flow\x20must\x20contain\x20at\x20least\x20one\x20END\x20node.'});const _0x2ab3c0=new Map(),_0x390834=new Map(),_0x307246=new Map(),_0x1fe7e9=new Set();_0x481773[_0x49404a(0x17b)]['forEach']((_0x336599,_0x4466bb)=>{const _0x3e1fab=_0x49404a,_0x2ca162=_0x3e1fab(0xb6)+_0x4466bb+']';if(!isRecord(_0x336599)){_0x4bc604[_0x3e1fab(0xbc)]({'path':_0x2ca162,'message':_0x3e1fab(0xf5)});return;}const _0x146096=_0x336599;_0x307246[_0x3e1fab(0x16a)](_0x146096,_0x2ca162);const _0x3e36eb=resolveEdgeEndpoint(_0x146096['source'],_0x146096[_0x3e1fab(0xd0)]),_0xd562b5=resolveEdgeEndpoint(_0x146096['target'],_0x146096['targetNodeId']);if(!_0x3e36eb)_0x4bc604[_0x3e1fab(0xbc)]({'path':_0x2ca162+'.source','message':_0x3e1fab(0x178)});if(!_0xd562b5)_0x4bc604[_0x3e1fab(0xbc)]({'path':_0x2ca162+_0x3e1fab(0x1e2),'message':'edge\x20target\x20is\x20required.'});_0x3e36eb&&!_0x54bea5[_0x3e1fab(0x1d0)](_0x3e36eb)&&_0x4bc604[_0x3e1fab(0xbc)]({'path':_0x2ca162+'.source','message':_0x3e1fab(0x10d)+_0x3e36eb+'.'});_0xd562b5&&!_0x54bea5[_0x3e1fab(0x1d0)](_0xd562b5)&&_0x4bc604[_0x3e1fab(0xbc)]({'path':_0x2ca162+_0x3e1fab(0x1e2),'message':_0x3e1fab(0x106)+_0xd562b5+'.'});if(_0x146096['id']!==undefined){if(typeof _0x146096['id']!==_0x3e1fab(0xc5)||!BPMN_ID_PATTERN[_0x3e1fab(0x1c3)](_0x146096['id']))_0x4bc604[_0x3e1fab(0xbc)]({'path':_0x2ca162+_0x3e1fab(0xab),'message':'edge\x20id\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.'});else{if(_0x3ebf6e[_0x3e1fab(0x1d0)](_0x146096['id']))_0x4bc604[_0x3e1fab(0xbc)]({'path':_0x2ca162+_0x3e1fab(0xab),'message':_0x3e1fab(0x175)+_0x146096['id']+'.'});else!_0x3ebf6e[_0x3e1fab(0x1d0)](_0x146096['id'])&&_0x3ebf6e[_0x3e1fab(0x9a)](_0x146096['id']);}}if(_0x3e36eb&&_0xd562b5){const _0x29ebdf=_0x3e36eb+'\x00'+_0xd562b5+'\x00'+(_0x146096[_0x3e1fab(0x1f5)]??'ALWAYS');_0x1fe7e9[_0x3e1fab(0x1d0)](_0x29ebdf)?_0x4bc604[_0x3e1fab(0xbc)]({'path':_0x2ca162,'message':'Duplicate\x20edge\x20route:\x20'+_0x3e36eb+_0x3e1fab(0x134)+_0xd562b5+'\x20('+(_0x146096[_0x3e1fab(0x1f5)]??'ALWAYS')+').'}):_0x1fe7e9[_0x3e1fab(0x9a)](_0x29ebdf);}validateEdge(_0x146096,_0x2ca162,_0x4bc604),_0x3e36eb&&_0xd562b5&&(_0x2ab3c0[_0x3e1fab(0x1a5)](_0x3e36eb)?.[_0x3e1fab(0xbc)](_0x146096)??_0x2ab3c0['set'](_0x3e36eb,[_0x146096]),_0x390834[_0x3e1fab(0x1a5)](_0xd562b5)?.['push'](_0x146096)??_0x390834[_0x3e1fab(0x16a)](_0xd562b5,[_0x146096]));});if(_0x5c9299[_0x49404a(0x17d)]!==0x1)return;validateGraphShape(_0x54bea5,_0x5c9299[0x0],_0x23a9ce,_0x2ab3c0,_0x390834,_0x307246,_0x4bc604),validateScriptResultReferences(_0x54bea5,_0x5c9299[0x0],_0x2ab3c0,_0x390834,_0x307246,_0x3fb5d7,_0x4bc604),validateApprovalResults(_0x54bea5,_0x435230,_0x23a9ce,_0x4bc604);}function validateNode(_0xbbe2dc,_0x36ed08,_0x42d5b5){const _0xcac107=a299_0x305ad7;for(const _0x2bfc37 of['form',_0xcac107(0x180)]){Object['prototype']['hasOwnProperty'][_0xcac107(0x11d)](_0xbbe2dc,_0x2bfc37)&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+'.'+_0x2bfc37,'message':UNSUPPORTED_FORM_MESSAGE});}if(!NODE_TYPES['has'](_0xbbe2dc[_0xcac107(0x132)]))return;(typeof _0xbbe2dc[_0xcac107(0xde)]!=='string'||_0xbbe2dc[_0xcac107(0xde)][_0xcac107(0x11f)]()==='')&&_0x42d5b5['push']({'path':_0x36ed08+_0xcac107(0x16e),'message':'Every\x20node\x20requires\x20a\x20non-empty\x20name.'});_0xbbe2dc[_0xcac107(0xc1)]!==undefined&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0x14e),'message':'node\x20pageId\x20is\x20no\x20longer\x20supported;\x20use\x20node\x20path\x20instead.'});if(_0xbbe2dc['path']!==undefined){if(typeof _0xbbe2dc[_0xcac107(0x14c)]!==_0xcac107(0xc5)||_0xbbe2dc[_0xcac107(0x14c)][_0xcac107(0x11f)]()==='')_0x42d5b5['push']({'path':_0x36ed08+'.path','message':'node\x20path\x20must\x20be\x20a\x20non-empty\x20string.'});else _0xbbe2dc[_0xcac107(0x132)]!==_0xcac107(0x107)&&_0xbbe2dc['type']!==_0xcac107(0x143)&&_0x42d5b5['push']({'path':_0x36ed08+_0xcac107(0xe4),'message':'node\x20path\x20is\x20supported\x20only\x20on\x20APPROVAL\x20or\x20END\x20nodes.'});}const _0x1f2bab=_0xbbe2dc[_0xcac107(0x15d)];if(!isRecord(_0x1f2bab))_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0x1e0),'message':_0xcac107(0x1ae)});else for(const _0x3867cf of['x','y']){const _0x455dfc=_0x1f2bab[_0x3867cf];(typeof _0x455dfc!=='number'||!Number[_0xcac107(0x10a)](_0x455dfc)||_0x455dfc<0x0)&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0xeb)+_0x3867cf,'message':_0xcac107(0xce)+_0x3867cf+_0xcac107(0xef)});}if(_0xbbe2dc[_0xcac107(0x132)]===_0xcac107(0x107)){const _0x5bebd3=_0xbbe2dc[_0xcac107(0xba)]??_0xcac107(0xcb),_0x2b0b72=_0xbbe2dc[_0xcac107(0xfa)]??_0xcac107(0x107);!APPROVAL_TASK_MODES[_0xcac107(0x1d0)](_0x2b0b72)&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+'.taskMode','message':'Unsupported\x20task\x20mode:\x20'+String(_0x2b0b72)+'.'});!APPROVAL_MODES[_0xcac107(0x1d0)](_0x5bebd3)&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0x15c),'message':_0xcac107(0x122)+String(_0x5bebd3)+'.'});if(!isRecord(_0xbbe2dc[_0xcac107(0xd4)]))_0x42d5b5['push']({'path':_0x36ed08+'.assignee','message':_0xcac107(0x1ef)});else{const _0x24a674=_0xbbe2dc[_0xcac107(0xd4)][_0xcac107(0x158)];_0x24a674!==_0xcac107(0x1d8)&&_0x24a674!==_0xcac107(0xa7)&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0x19e),'message':_0xcac107(0x14d)});if(_0x24a674===_0xcac107(0x1d8)){const _0x1f0869=_0xbbe2dc[_0xcac107(0xd4)]['userIds'];if(!Array['isArray'](_0x1f0869)||_0x1f0869[_0xcac107(0x17d)]===0x0)_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0x1a3),'message':_0xcac107(0x149)});else{const _0x1eb6f7=_0x1f0869['findIndex'](_0x5c39b8=>!isValidUserId(_0x5c39b8));_0x1eb6f7>=0x0&&_0x42d5b5['push']({'path':_0x36ed08+_0xcac107(0x1db)+_0x1eb6f7+']','message':_0xcac107(0x14f)});const _0x693f74=new Set(_0x1f0869[_0xcac107(0x1eb)](isValidUserId)[_0xcac107(0x160)](_0xb45145=>String(_0xb45145)['trim']()));_0x5bebd3===_0xcac107(0xcb)&&_0x693f74[_0xcac107(0x1f1)]>0x1&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+'.assignee.userIds','message':_0xcac107(0x12c)});}}if(_0x24a674===_0xcac107(0xa7)){const _0x459f3d=_0xbbe2dc[_0xcac107(0xd4)][_0xcac107(0xf9)],_0x13e2ef=typeof _0x459f3d==='number'||typeof _0x459f3d===_0xcac107(0xc5)?Number(String(_0x459f3d)[_0xcac107(0x11f)]()):Number[_0xcac107(0x1e6)];(!Number[_0xcac107(0x1ce)](_0x13e2ef)||_0x13e2ef<=0x0)&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0xb5),'message':_0xcac107(0x162)});}}if(_0xbbe2dc[_0xcac107(0x105)]!==undefined){if(!isRecord(_0xbbe2dc[_0xcac107(0x105)]))_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0xca),'message':_0xcac107(0x145)});else{if(_0xbbe2dc[_0xcac107(0x105)]['strategy']!=='FIXED')_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0x1bc),'message':_0xcac107(0x198)});else{const _0x878643=_0xbbe2dc[_0xcac107(0x105)][_0xcac107(0xe0)];if(!Array[_0xcac107(0x108)](_0x878643)||_0x878643['length']===0x0)_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0x1d5),'message':_0xcac107(0xd2)});else{const _0x14c74d=_0x878643[_0xcac107(0xe2)](_0x4990d0=>!isValidUserId(_0x4990d0));_0x14c74d>=0x0&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0xc4)+_0x14c74d+']','message':_0xcac107(0xbb)});}}}}}_0xbbe2dc['sequential']!==undefined&&typeof _0xbbe2dc[_0xcac107(0xe9)]!==_0xcac107(0x12b)&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0xf4),'message':_0xcac107(0x1b6)});if(_0xbbe2dc[_0xcac107(0x132)]==='SCRIPT'){(typeof _0xbbe2dc['scriptName']!==_0xcac107(0xc5)||_0xbbe2dc[_0xcac107(0x193)][_0xcac107(0x11f)]()==='')&&_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+_0xcac107(0x15a),'message':_0xcac107(0x104)});if(_0xbbe2dc['resultVariable']!==undefined){if(typeof _0xbbe2dc[_0xcac107(0xb7)]!==_0xcac107(0xc5)||!VARIABLE_PATTERN[_0xcac107(0x1c3)](_0xbbe2dc[_0xcac107(0xb7)]))_0x42d5b5[_0xcac107(0xbc)]({'path':_0x36ed08+'.resultVariable','message':_0xcac107(0x14b)});else(RESERVED_RESULT_VARIABLES[_0xcac107(0x1d0)](_0xbbe2dc[_0xcac107(0xb7)])||_0xbbe2dc[_0xcac107(0xb7)]['startsWith']('approval_sys_'))&&_0x42d5b5['push']({'path':_0x36ed08+_0xcac107(0x1e8),'message':_0xcac107(0x188)+_0xbbe2dc[_0xcac107(0xb7)]+'.'});}}validateAsyncExecution(_0xbbe2dc,_0x36ed08,_0x42d5b5),validateApprovalTimeout(_0xbbe2dc,_0x36ed08,_0x42d5b5),validateCcConfig(_0xbbe2dc,_0x36ed08,_0x42d5b5),_0xbbe2dc['type']===_0xcac107(0x192)&&validateNotificationConfig(_0xbbe2dc[_0xcac107(0x109)],_0x36ed08+_0xcac107(0x114),_0x42d5b5);}function validateAsyncExecution(_0x5dbeed,_0x2d78d1,_0x4b86ef){const _0x4a54c3=a299_0x305ad7;if(_0x5dbeed['async']===undefined)return;if(!isRecord(_0x5dbeed[_0x4a54c3(0x1d1)])){_0x4b86ef[_0x4a54c3(0xbc)]({'path':_0x2d78d1+_0x4a54c3(0xc2),'message':_0x4a54c3(0x125)});return;}if(_0x5dbeed['async']['enabled']!==undefined&&typeof _0x5dbeed[_0x4a54c3(0x1d1)][_0x4a54c3(0xea)]!==_0x4a54c3(0x12b)){_0x4b86ef['push']({'path':_0x2d78d1+_0x4a54c3(0xf8),'message':_0x4a54c3(0x16f)});return;}if(_0x5dbeed[_0x4a54c3(0x1d1)][_0x4a54c3(0xea)]!==!![])return;_0x5dbeed[_0x4a54c3(0x132)]!==_0x4a54c3(0x131)&&_0x4b86ef[_0x4a54c3(0xbc)]({'path':_0x2d78d1+_0x4a54c3(0xc2),'message':_0x4a54c3(0x102)});const _0x3e1a2d=_0x5dbeed[_0x4a54c3(0x1d1)][_0x4a54c3(0xf1)]??0x3;(!Number[_0x4a54c3(0x171)](_0x3e1a2d)||_0x3e1a2d<0x1||_0x3e1a2d>MAX_ASYNC_RETRY_COUNT)&&_0x4b86ef[_0x4a54c3(0xbc)]({'path':_0x2d78d1+'.async.retryCount','message':_0x4a54c3(0x112)+MAX_ASYNC_RETRY_COUNT+'.'}),_0x5dbeed[_0x4a54c3(0x1d1)][_0x4a54c3(0xf7)]!==undefined&&validateTimeAmount(_0x5dbeed[_0x4a54c3(0x1d1)]['retryInterval'],_0x2d78d1+'.async.retryInterval',_0x4b86ef);}function validateApprovalTimeout(_0x2390a9,_0x3b706d,_0xcc9e8c){const _0x8ce389=a299_0x305ad7;if(_0x2390a9[_0x8ce389(0x1f6)]===undefined)return;if(!isRecord(_0x2390a9['timeout'])){_0xcc9e8c['push']({'path':_0x3b706d+'.timeout','message':'timeout\x20must\x20be\x20an\x20object.'});return;}if(_0x2390a9[_0x8ce389(0x1f6)]['enabled']!==undefined&&typeof _0x2390a9[_0x8ce389(0x1f6)]['enabled']!=='boolean'){_0xcc9e8c['push']({'path':_0x3b706d+_0x8ce389(0x172),'message':_0x8ce389(0x181)});return;}if(_0x2390a9[_0x8ce389(0x1f6)]['enabled']!==!![])return;if(_0x2390a9[_0x8ce389(0x1f6)][_0x8ce389(0x1af)]!==undefined&&typeof _0x2390a9[_0x8ce389(0x1f6)][_0x8ce389(0x1af)]!==_0x8ce389(0x12b)){_0xcc9e8c['push']({'path':_0x3b706d+'.timeout.interrupting','message':_0x8ce389(0x133)});return;}_0x2390a9[_0x8ce389(0x132)]!=='APPROVAL'&&_0xcc9e8c[_0x8ce389(0xbc)]({'path':_0x3b706d+'.timeout','message':_0x8ce389(0x170)});validateTimeAmount(_0x2390a9[_0x8ce389(0x1f6)]['duration'],_0x3b706d+_0x8ce389(0x123),_0xcc9e8c);const _0x526c19=_0x2390a9[_0x8ce389(0x1f6)][_0x8ce389(0x156)];if(!APPROVAL_TIMEOUT_ACTIONS[_0x8ce389(0x1d0)](_0x526c19)){_0xcc9e8c[_0x8ce389(0xbc)]({'path':_0x3b706d+_0x8ce389(0x1aa),'message':_0x8ce389(0x18a)});return;}(_0x2390a9[_0x8ce389(0xfa)]??_0x8ce389(0x107))===_0x8ce389(0x1bf)&&_0x526c19!=='EXECUTE_BFF'&&_0xcc9e8c[_0x8ce389(0xbc)]({'path':_0x3b706d+'.timeout.action','message':_0x8ce389(0x13b)});const _0x86cb80=_0x2390a9[_0x8ce389(0x1f6)][_0x8ce389(0x1af)]??_0x526c19!==_0x8ce389(0x1a1);if(_0x526c19===_0x8ce389(0x1a1))_0x86cb80&&_0xcc9e8c['push']({'path':_0x3b706d+_0x8ce389(0x159),'message':_0x8ce389(0x191)}),(typeof _0x2390a9['timeout'][_0x8ce389(0x193)]!==_0x8ce389(0xc5)||_0x2390a9[_0x8ce389(0x1f6)][_0x8ce389(0x193)][_0x8ce389(0x11f)]()==='')&&_0xcc9e8c[_0x8ce389(0xbc)]({'path':_0x3b706d+_0x8ce389(0x146),'message':_0x8ce389(0x1ad)}),validateOptionalResultVariable(_0x2390a9[_0x8ce389(0x1f6)]['resultVariable'],_0x3b706d+'.timeout.resultVariable',_0xcc9e8c);else!_0x86cb80&&_0xcc9e8c[_0x8ce389(0xbc)]({'path':_0x3b706d+_0x8ce389(0x159),'message':_0x526c19+_0x8ce389(0x130)});}function validateTimeAmount(_0x245505,_0x538bef,_0x2733cd){const _0x1a29b5=a299_0x305ad7;if(!isRecord(_0x245505)){_0x2733cd[_0x1a29b5(0xbc)]({'path':_0x538bef,'message':_0x1a29b5(0xa1)});return;}(!Number[_0x1a29b5(0x171)](_0x245505['value'])||Number(_0x245505[_0x1a29b5(0x1be)])<=0x0)&&_0x2733cd[_0x1a29b5(0xbc)]({'path':_0x538bef+_0x1a29b5(0x150),'message':'duration\x20value\x20must\x20be\x20a\x20positive\x20integer.'}),!FLOW_TIME_UNITS[_0x1a29b5(0x1d0)](_0x245505[_0x1a29b5(0x1ec)])&&_0x2733cd[_0x1a29b5(0xbc)]({'path':_0x538bef+_0x1a29b5(0x182),'message':_0x1a29b5(0x167)});}function validateOptionalResultVariable(_0x4d74a6,_0xae3c5f,_0x5838e1){const _0x8cd973=a299_0x305ad7;if(_0x4d74a6===undefined||_0x4d74a6===null||_0x4d74a6==='')return;if(typeof _0x4d74a6!==_0x8cd973(0xc5)||!VARIABLE_PATTERN['test'](_0x4d74a6))_0x5838e1[_0x8cd973(0xbc)]({'path':_0xae3c5f,'message':'resultVariable\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.'});else(RESERVED_RESULT_VARIABLES[_0x8cd973(0x1d0)](_0x4d74a6)||_0x4d74a6[_0x8cd973(0x135)](_0x8cd973(0x1ee)))&&_0x5838e1[_0x8cd973(0xbc)]({'path':_0xae3c5f,'message':_0x8cd973(0x188)+_0x4d74a6+'.'});}function validateCcConfig(_0x249a02,_0x20e5fe,_0x18e4e4){const _0x752b60=a299_0x305ad7;if(_0x249a02['cc']===undefined)return;if(!isRecord(_0x249a02['cc'])){_0x18e4e4[_0x752b60(0xbc)]({'path':_0x20e5fe+_0x752b60(0xa4),'message':'cc\x20must\x20be\x20an\x20object.'});return;}_0x249a02[_0x752b60(0x132)]!=='END'&&_0x249a02[_0x752b60(0x132)]!==_0x752b60(0x107)&&_0x18e4e4[_0x752b60(0xbc)]({'path':_0x20e5fe+_0x752b60(0xa4),'message':'Default\x20cc\x20is\x20only\x20supported\x20by\x20APPROVAL\x20or\x20END\x20node.'});Object[_0x752b60(0xdf)]['hasOwnProperty']['call'](_0x249a02['cc'],_0x752b60(0x16b))&&_0x18e4e4[_0x752b60(0xbc)]({'path':_0x20e5fe+_0x752b60(0x1f4),'message':UNSUPPORTED_FORM_MESSAGE});const _0x221f13=_0x249a02['cc'][_0x752b60(0x15e)];if(!Array[_0x752b60(0x108)](_0x221f13)||_0x221f13[_0x752b60(0x17d)]===0x0)_0x18e4e4[_0x752b60(0xbc)]({'path':_0x20e5fe+_0x752b60(0x1d3),'message':_0x752b60(0x1e4)});else{_0x221f13['length']>MAX_CC_RECIPIENTS&&_0x18e4e4[_0x752b60(0xbc)]({'path':_0x20e5fe+_0x752b60(0x1d3),'message':_0x752b60(0x1c7)+MAX_CC_RECIPIENTS+'\x20users.'});const _0x183b65=new Set();_0x221f13[_0x752b60(0x1de)]((_0x37b60c,_0x43e376)=>{const _0x5376a0=_0x752b60;if(typeof _0x37b60c!==_0x5376a0(0xc5)||_0x37b60c[_0x5376a0(0x11f)]()==='')_0x18e4e4[_0x5376a0(0xbc)]({'path':_0x20e5fe+_0x5376a0(0x1c8)+_0x43e376+']','message':_0x5376a0(0xfb)});else _0x183b65[_0x5376a0(0x1d0)](_0x37b60c[_0x5376a0(0x11f)]())?_0x18e4e4[_0x5376a0(0xbc)]({'path':_0x20e5fe+_0x5376a0(0x1c8)+_0x43e376+']','message':'Duplicate\x20cc\x20recipient\x20userId:\x20'+_0x37b60c[_0x5376a0(0x11f)]()+'.'}):_0x183b65[_0x5376a0(0x9a)](_0x37b60c[_0x5376a0(0x11f)]());});}validateStringArray(_0x249a02['cc'][_0x752b60(0x10e)],_0x20e5fe+_0x752b60(0x124),_0x18e4e4);}function validateStringArray(_0x37f582,_0x5229bb,_0x5d86d5){const _0x1c60a3=a299_0x305ad7;if(_0x37f582===undefined)return;if(!Array[_0x1c60a3(0x108)](_0x37f582)){_0x5d86d5['push']({'path':_0x5229bb,'message':_0x1c60a3(0xfc)});return;}const _0x26cabc=new Set();_0x37f582[_0x1c60a3(0x1de)]((_0x180a57,_0xc04f6)=>{const _0x5deba7=_0x1c60a3;if(typeof _0x180a57!=='string'||_0x180a57[_0x5deba7(0x11f)]()==='')_0x5d86d5[_0x5deba7(0xbc)]({'path':_0x5229bb+'['+_0xc04f6+']','message':_0x5deba7(0x1c0)});else _0x26cabc['has'](_0x180a57[_0x5deba7(0x11f)]())?_0x5d86d5['push']({'path':_0x5229bb+'['+_0xc04f6+']','message':_0x5deba7(0xf6)+_0x180a57[_0x5deba7(0x11f)]()+'.'}):_0x26cabc[_0x5deba7(0x9a)](_0x180a57[_0x5deba7(0x11f)]());});}function validateNotificationConfig(_0x4b31db,_0x4b8a98,_0x2f0108){const _0x5879f1=a299_0x305ad7;if(!isRecord(_0x4b31db)){_0x2f0108[_0x5879f1(0xbc)]({'path':_0x4b8a98,'message':'NOTIFICATION\x20node\x20requires\x20config.'});return;}if(_0x4b31db['version']!==undefined&&_0x4b31db[_0x5879f1(0x140)]!==null){if(typeof _0x4b31db[_0x5879f1(0x140)]!=='string')_0x2f0108[_0x5879f1(0xbc)]({'path':_0x4b8a98+_0x5879f1(0x16d),'message':_0x5879f1(0x1ba)});else _0x4b31db[_0x5879f1(0x140)]['trim']()&&_0x4b31db['version'][_0x5879f1(0x11f)]()!=='v1'&&_0x2f0108[_0x5879f1(0xbc)]({'path':_0x4b8a98+_0x5879f1(0x16d),'message':'Unsupported\x20notification\x20version:\x20'+_0x4b31db[_0x5879f1(0x140)]+'.'});}const _0x56a915=requireNotificationString(_0x4b31db[_0x5879f1(0x9f)],_0x4b8a98+'.configCode',_0x5879f1(0x199),_0x2f0108);_0x56a915?.['includes']('${')&&_0x2f0108[_0x5879f1(0xbc)]({'path':_0x4b8a98+_0x5879f1(0x161),'message':'Notification\x20configCode\x20must\x20be\x20a\x20fixed\x20value.'});if(_0x4b31db[_0x5879f1(0xae)]!==undefined&&_0x4b31db[_0x5879f1(0xae)]!==null){if(typeof _0x4b31db[_0x5879f1(0xae)]!==_0x5879f1(0xc5))_0x2f0108['push']({'path':_0x4b8a98+_0x5879f1(0x1a7),'message':'failurePolicy\x20must\x20be\x20a\x20string.'});else!NOTIFICATION_FAILURE_POLICIES[_0x5879f1(0x1d0)](_0x4b31db[_0x5879f1(0xae)][_0x5879f1(0x11f)]()[_0x5879f1(0x196)]())&&_0x2f0108[_0x5879f1(0xbc)]({'path':_0x4b8a98+_0x5879f1(0x1a7),'message':_0x5879f1(0xb8)});}!isRecord(_0x4b31db['template'])?_0x2f0108[_0x5879f1(0xbc)]({'path':_0x4b8a98+_0x5879f1(0x17c),'message':_0x5879f1(0x1df)}):validateNotificationTemplate(_0x4b31db['template'],_0x4b8a98+_0x5879f1(0x17c),_0x2f0108),validateNotificationRecipients(_0x4b31db[_0x5879f1(0x13c)],_0x4b8a98+_0x5879f1(0x141),_0x2f0108);}function validateNotificationTemplate(_0x5851fc,_0x268a15,_0x434102){const _0x58f6a7=a299_0x305ad7;for(const _0x23af81 of['title',_0x58f6a7(0xd8)]){const _0x556ce0=requireNotificationString(_0x5851fc[_0x23af81],_0x268a15+'.'+_0x23af81,'Notification\x20template.'+_0x23af81+'\x20is\x20required.',_0x434102);if(_0x556ce0)validateNotificationPlaceholders(_0x556ce0,_0x268a15+'.'+_0x23af81,_0x434102);}_0x5851fc['detailMarkdown']!==undefined&&_0x5851fc['detailMarkdown']!==null&&(typeof _0x5851fc[_0x58f6a7(0x1ed)]!=='string'?_0x434102['push']({'path':_0x268a15+_0x58f6a7(0xd1),'message':'Notification\x20template.detailMarkdown\x20must\x20be\x20a\x20string.'}):validateNotificationPlaceholders(_0x5851fc[_0x58f6a7(0x1ed)],_0x268a15+'.detailMarkdown',_0x434102)),validateNotificationFacts(_0x5851fc[_0x58f6a7(0x1a6)],_0x268a15+'.facts',_0x434102),validateNotificationActions(_0x5851fc[_0x58f6a7(0x13a)],_0x268a15+_0x58f6a7(0xfe),_0x434102);}function validateNotificationFacts(_0x4d853f,_0x5b5b2f,_0x2497d4){const _0x5a46e4=a299_0x305ad7;if(_0x4d853f===undefined||_0x4d853f===null)return;if(!Array[_0x5a46e4(0x108)](_0x4d853f)){_0x2497d4[_0x5a46e4(0xbc)]({'path':_0x5b5b2f,'message':'Notification\x20template.facts\x20must\x20be\x20an\x20array.'});return;}_0x4d853f[_0x5a46e4(0x17d)]>MAX_NOTIFICATION_FACTS&&_0x2497d4['push']({'path':_0x5b5b2f,'message':'Notification\x20template\x20supports\x20at\x20most\x20'+MAX_NOTIFICATION_FACTS+'\x20facts.'}),_0x4d853f[_0x5a46e4(0x1de)]((_0x24e178,_0x172c15)=>{const _0x5ffa8a=_0x5a46e4,_0x348a48=_0x5b5b2f+'['+_0x172c15+']';if(!isRecord(_0x24e178)){_0x2497d4[_0x5ffa8a(0xbc)]({'path':_0x348a48,'message':_0x5ffa8a(0x195)});return;}for(const _0x87c1bb of[_0x5ffa8a(0x152),_0x5ffa8a(0x1be)]){const _0x14cdab=requireNotificationString(_0x24e178[_0x87c1bb],_0x348a48+'.'+_0x87c1bb,_0x5ffa8a(0x1b8)+_0x87c1bb+'\x20is\x20required.',_0x2497d4);_0x14cdab&&validateNotificationPlaceholders(_0x14cdab,_0x348a48+'.'+_0x87c1bb,_0x2497d4);}});}function validateNotificationActions(_0x1fb88c,_0x319d9e,_0x7cbd83){const _0xa01ec2=a299_0x305ad7;if(_0x1fb88c===undefined||_0x1fb88c===null)return;if(!Array[_0xa01ec2(0x108)](_0x1fb88c)){_0x7cbd83[_0xa01ec2(0xbc)]({'path':_0x319d9e,'message':_0xa01ec2(0x183)});return;}_0x1fb88c[_0xa01ec2(0x17d)]>MAX_NOTIFICATION_ACTIONS&&_0x7cbd83[_0xa01ec2(0xbc)]({'path':_0x319d9e,'message':_0xa01ec2(0xa9)+MAX_NOTIFICATION_ACTIONS+_0xa01ec2(0x1b0)}),_0x1fb88c[_0xa01ec2(0x1de)]((_0x445bd7,_0x214240)=>{const _0x2582e9=_0xa01ec2,_0x3f9b3e=_0x319d9e+'['+_0x214240+']';if(!isRecord(_0x445bd7)){_0x7cbd83['push']({'path':_0x3f9b3e,'message':_0x2582e9(0x13e)});return;}const _0x110aa6=requireNotificationString(_0x445bd7[_0x2582e9(0x101)],_0x3f9b3e+'.text',_0x2582e9(0xaf),_0x7cbd83);if(_0x110aa6)validateNotificationPlaceholders(_0x110aa6,_0x3f9b3e+_0x2582e9(0x17e),_0x7cbd83);const _0xf813a7=requireNotificationString(_0x445bd7[_0x2582e9(0x115)],_0x3f9b3e+_0x2582e9(0x1f3),'Notification\x20action.url\x20is\x20required.',_0x7cbd83);if(!_0xf813a7)return;validateNotificationPlaceholders(_0xf813a7,_0x3f9b3e+'.url',_0x7cbd83),!/^https?:\/\//i['test'](_0xf813a7)&&!NOTIFICATION_ACTION_URL_PLACEHOLDER_PATTERN[_0x2582e9(0x1c3)](_0xf813a7)&&_0x7cbd83['push']({'path':_0x3f9b3e+'.url','message':_0x2582e9(0xaa)});});}function validateNotificationRecipients(_0x49747e,_0x347eab,_0x55a6a4){const _0x784ee0=a299_0x305ad7;if(_0x49747e===undefined||_0x49747e===null)return;if(!Array[_0x784ee0(0x108)](_0x49747e)){_0x55a6a4[_0x784ee0(0xbc)]({'path':_0x347eab,'message':_0x784ee0(0x157)});return;}let _0x4352e4=![];_0x49747e[_0x784ee0(0x1de)]((_0x14d17f,_0x116dc0)=>{const _0x14a40d=_0x784ee0,_0x6e5f45=_0x347eab+'['+_0x116dc0+']';if(!isRecord(_0x14d17f)){_0x55a6a4[_0x14a40d(0xbc)]({'path':_0x6e5f45,'message':_0x14a40d(0x187)});return;}const _0x410658=requireNotificationString(_0x14d17f[_0x14a40d(0x132)],_0x6e5f45+_0x14a40d(0x18d),_0x14a40d(0x1a2),_0x55a6a4);_0x410658&&!NOTIFICATION_RECIPIENT_TYPES[_0x14a40d(0x1d0)](_0x410658[_0x14a40d(0x196)]())&&_0x55a6a4['push']({'path':_0x6e5f45+_0x14a40d(0x18d),'message':_0x14a40d(0x144)});let _0x299037='TO';_0x14d17f[_0x14a40d(0x185)]!==undefined&&_0x14d17f[_0x14a40d(0x185)]!==null&&(typeof _0x14d17f[_0x14a40d(0x185)]!==_0x14a40d(0xc5)?(_0x55a6a4[_0x14a40d(0xbc)]({'path':_0x6e5f45+'.role','message':_0x14a40d(0x1bd)}),_0x299037=''):(_0x299037=_0x14d17f[_0x14a40d(0x185)]['trim']()[_0x14a40d(0x196)](),!NOTIFICATION_RECIPIENT_ROLES[_0x14a40d(0x1d0)](_0x299037)&&_0x55a6a4[_0x14a40d(0xbc)]({'path':_0x6e5f45+_0x14a40d(0x1ac),'message':'Notification\x20recipient.role\x20must\x20be\x20TO,\x20CC,\x20or\x20BCC.'})));if(_0x299037==='TO')_0x4352e4=!![];const _0xfd0d2a=requireNotificationString(_0x14d17f[_0x14a40d(0x1be)],_0x6e5f45+_0x14a40d(0x150),'Notification\x20recipient.value\x20is\x20required.',_0x55a6a4);_0xfd0d2a&&validateNotificationPlaceholders(_0xfd0d2a,_0x6e5f45+'.value',_0x55a6a4);}),_0x49747e[_0x784ee0(0x17d)]>0x0&&!_0x4352e4&&_0x55a6a4[_0x784ee0(0xbc)]({'path':_0x347eab,'message':'Explicit\x20notification\x20recipients\x20require\x20at\x20least\x20one\x20TO.'});}function requireNotificationString(_0x31279e,_0xc41fbc,_0x2fac72,_0x349ac5){const _0xe18275=a299_0x305ad7;if(typeof _0x31279e!==_0xe18275(0xc5)||_0x31279e['trim']()==='')return _0x349ac5[_0xe18275(0xbc)]({'path':_0xc41fbc,'message':_0x2fac72}),undefined;return _0x31279e['trim']();}function validateNotificationPlaceholders(_0x3238e9,_0x2d3816,_0x57f33c){const _0x1f06a3=a299_0x305ad7;for(const _0x28802e of _0x3238e9[_0x1f06a3(0x18b)](NOTIFICATION_PLACEHOLDER_PATTERN)){const _0x4ba9d3=_0x28802e[0x1]?.[_0x1f06a3(0x11f)]()??'',_0x5181f0=_0x4ba9d3[_0x1f06a3(0x12f)]('.'),_0x17be4d=_0x5181f0>=0x0?_0x4ba9d3[_0x1f06a3(0x1da)](0x0,_0x5181f0):_0x4ba9d3,_0x4c8e6b=_0x5181f0>=0x0?_0x4ba9d3[_0x1f06a3(0x1da)](_0x5181f0+0x1)['trim']():'';(!['event',_0x1f06a3(0x17f),'variables']['includes'](_0x17be4d)||_0x4c8e6b==='')&&_0x57f33c[_0x1f06a3(0xbc)]({'path':_0x2d3816,'message':'Unsupported\x20notification\x20placeholder:\x20'+_0x28802e[0x0]+'.'});}_0x3238e9[_0x1f06a3(0x17a)](NOTIFICATION_PLACEHOLDER_PATTERN,'')[_0x1f06a3(0xd3)]('${')&&_0x57f33c['push']({'path':_0x2d3816,'message':_0x1f06a3(0x169)});}function validateEdge(_0xe28037,_0x47b32c,_0x4af30a){const _0x3046ca=a299_0x305ad7;_0xe28037[_0x3046ca(0xde)]!==undefined&&typeof _0xe28037['name']!=='string'&&_0x4af30a['push']({'path':_0x47b32c+'.name','message':_0x3046ca(0xd6)}),_0xe28037['defaultFlow']!==undefined&&typeof _0xe28037[_0x3046ca(0xc3)]!==_0x3046ca(0x12b)&&_0x4af30a[_0x3046ca(0xbc)]({'path':_0x47b32c+_0x3046ca(0x19c),'message':_0x3046ca(0x113)}),_0xe28037['waypoints']!==undefined&&(!Array[_0x3046ca(0x108)](_0xe28037[_0x3046ca(0x9e)])?_0x4af30a[_0x3046ca(0xbc)]({'path':_0x47b32c+_0x3046ca(0x19a),'message':_0x3046ca(0x121)}):_0xe28037[_0x3046ca(0x9e)]['forEach']((_0x394e23,_0x148cd6)=>{const _0x20cff9=_0x3046ca;if(!isRecord(_0x394e23)){_0x4af30a[_0x20cff9(0xbc)]({'path':_0x47b32c+_0x20cff9(0x189)+_0x148cd6+']','message':'waypoint\x20must\x20contain\x20numeric\x20x\x20and\x20y\x20coordinates.'});return;}for(const _0x414127 of['x','y']){const _0x5d9102=_0x394e23[_0x414127];(typeof _0x5d9102!=='number'||!Number['isFinite'](_0x5d9102))&&_0x4af30a['push']({'path':_0x47b32c+'.waypoints['+_0x148cd6+'].'+_0x414127,'message':_0x20cff9(0x1bb)+_0x414127+_0x20cff9(0x176)});}})),_0xe28037[_0x3046ca(0x1f5)]!==undefined&&!CONDITION_TYPES[_0x3046ca(0x1d0)](_0xe28037[_0x3046ca(0x1f5)])&&_0x4af30a[_0x3046ca(0xbc)]({'path':_0x47b32c+_0x3046ca(0x174),'message':_0x3046ca(0x1e3)+String(_0xe28037[_0x3046ca(0x1f5)])+'.'}),_0xe28037[_0x3046ca(0x1f5)]===_0x3046ca(0x18e)&&(typeof _0xe28037[_0x3046ca(0xa3)]!==_0x3046ca(0xc5)||_0xe28037[_0x3046ca(0xa3)][_0x3046ca(0x11f)]()==='')&&_0x4af30a[_0x3046ca(0xbc)]({'path':_0x47b32c+_0x3046ca(0x179),'message':_0x3046ca(0x139)}),_0xe28037[_0x3046ca(0xc3)]===!![]&&_0xe28037['conditionType']!==_0x3046ca(0xe7)&&_0x4af30a[_0x3046ca(0xbc)]({'path':_0x47b32c+'.defaultFlow','message':_0x3046ca(0xee)}),_0xe28037[_0x3046ca(0xc3)]===!![]&&typeof _0xe28037['expression']==='string'&&_0xe28037['expression'][_0x3046ca(0x11f)]()!==''&&_0x4af30a[_0x3046ca(0xbc)]({'path':_0x47b32c+_0x3046ca(0x179),'message':'A\x20default\x20flow\x20must\x20not\x20have\x20an\x20expression.'});}function validateGraphShape(_0x11fd54,_0x488b16,_0x246941,_0x1213d9,_0x32db33,_0x8ac4b8,_0x5d6358){const _0x315540=a299_0x305ad7;for(const [_0x4940ee,_0x4e45e2]of _0x11fd54){const _0x97372e=_0x32db33[_0x315540(0x1a5)](_0x4940ee)??[],_0x198f2a=_0x1213d9[_0x315540(0x1a5)](_0x4940ee)??[];_0x4e45e2['type']!==_0x315540(0x117)&&_0x97372e[_0x315540(0x17d)]===0x0&&_0x5d6358['push']({'path':_0x315540(0x164)+_0x4940ee,'message':_0x315540(0x153)});_0x4e45e2[_0x315540(0x132)]!==_0x315540(0x143)&&_0x198f2a[_0x315540(0x17d)]===0x0&&_0x5d6358['push']({'path':_0x315540(0x164)+_0x4940ee,'message':_0x315540(0xc7)});_0x4e45e2[_0x315540(0x132)]===_0x315540(0x117)&&_0x97372e[_0x315540(0x17d)]>0x0&&_0x5d6358['push']({'path':'flowJson.nodes.'+_0x4940ee,'message':'START\x20node\x20must\x20not\x20have\x20incoming\x20edges.'});_0x4e45e2[_0x315540(0x132)]===_0x315540(0x143)&&_0x198f2a['length']>0x0&&_0x5d6358[_0x315540(0xbc)]({'path':_0x315540(0x164)+_0x4940ee,'message':'END\x20node\x20must\x20not\x20have\x20outgoing\x20edges.'});if(_0x4e45e2[_0x315540(0x132)]===_0x315540(0xf0)){_0x198f2a[_0x315540(0x17d)]<0x2&&_0x5d6358[_0x315540(0xbc)]({'path':_0x315540(0x164)+_0x4940ee,'message':'CONDITION\x20node\x20requires\x20at\x20least\x20two\x20outgoing\x20edges.'});const _0x5b0e60=_0x198f2a[_0x315540(0x1eb)](_0x527d9d=>_0x527d9d[_0x315540(0xc3)]===!![]);_0x5b0e60['length']!==0x1&&_0x5d6358[_0x315540(0xbc)]({'path':'flowJson.nodes.'+_0x4940ee,'message':_0x315540(0x1b3)});if(_0x5b0e60[_0x315540(0x17d)]===0x1){const _0x3da352=_0x5b0e60[0x0],_0x2a3ab4=_0x8ac4b8[_0x315540(0x1a5)](_0x3da352)??_0x315540(0xd5);_0x3da352[_0x315540(0x1f5)]!==_0x315540(0xe7)&&_0x5d6358['push']({'path':_0x2a3ab4+_0x315540(0x174),'message':_0x315540(0xb0)});_0x3da352[_0x315540(0xa3)]!==undefined&&_0x5d6358[_0x315540(0xbc)]({'path':_0x2a3ab4+'.expression','message':'CONDITION\x20default\x20edge\x20must\x20not\x20define\x20expression.'});for(const _0x1951f7 of _0x198f2a){if(_0x1951f7===_0x3da352)continue;const _0x1b2f6a=_0x8ac4b8[_0x315540(0x1a5)](_0x1951f7)??_0x315540(0xd5);if(_0x1951f7[_0x315540(0x1f5)]!=='EXPRESSION')_0x5d6358[_0x315540(0xbc)]({'path':_0x1b2f6a+_0x315540(0x174),'message':_0x315540(0x1a4)});else(typeof _0x1951f7[_0x315540(0xa3)]!==_0x315540(0xc5)||_0x1951f7[_0x315540(0xa3)][_0x315540(0x11f)]()==='')&&_0x5d6358[_0x315540(0xbc)]({'path':_0x1b2f6a+_0x315540(0x179),'message':_0x315540(0x177)});}}}if(_0x4e45e2[_0x315540(0x132)]==='APPROVAL'&&(_0x4e45e2['taskMode']??_0x315540(0x107))===_0x315540(0x1bf)){if(_0x198f2a['length']!==0x1)_0x5d6358[_0x315540(0xbc)]({'path':'flowJson.nodes.'+_0x4940ee,'message':_0x315540(0x1a9)});else{const _0x4b9488=_0x198f2a[0x0];((_0x4b9488[_0x315540(0x1f5)]??_0x315540(0xe7))!==_0x315540(0xe7)||_0x4b9488[_0x315540(0xc3)]===!![]||typeof _0x4b9488['expression']===_0x315540(0xc5)&&_0x4b9488[_0x315540(0xa3)][_0x315540(0x11f)]()!=='')&&_0x5d6358[_0x315540(0xbc)]({'path':_0x8ac4b8[_0x315540(0x1a5)](_0x4b9488)??_0x315540(0xd5),'message':_0x315540(0xe1)});}}else{if(_0x4e45e2['type']===_0x315540(0x107)){const _0x2a8a97=_0x198f2a[_0x315540(0x160)](_0x208a28=>_0x208a28[_0x315540(0x1f5)]??_0x315540(0xe7)),_0x5914a1=_0x2a8a97[_0x315540(0x1eb)](_0x56cf10=>_0x56cf10!==_0x315540(0x1f2)&&_0x56cf10!=='REJECTED');_0x5914a1[_0x315540(0x17d)]>0x0&&_0x5d6358[_0x315540(0xbc)]({'path':'flowJson.nodes.'+_0x4940ee,'message':_0x315540(0x1c2)}),_0x2a8a97['filter'](_0x578d79=>_0x578d79===_0x315540(0x1f2))[_0x315540(0x17d)]!==0x1&&_0x5d6358[_0x315540(0xbc)]({'path':_0x315540(0x164)+_0x4940ee,'message':_0x315540(0xa6)}),_0x2a8a97['filter'](_0x5b6730=>_0x5b6730===_0x315540(0x1ca))[_0x315540(0x17d)]!==0x1&&_0x5d6358[_0x315540(0xbc)]({'path':'flowJson.nodes.'+_0x4940ee,'message':_0x315540(0xbf)}),_0x198f2a['some'](_0x466ea4=>_0x466ea4[_0x315540(0xc3)]===!![])&&_0x5d6358[_0x315540(0xbc)]({'path':_0x315540(0x164)+_0x4940ee,'message':_0x315540(0x12a)});}}}const _0x5bb1d5=new Set(),_0x1c7fd0=_0x1c6d1d=>{const _0x5091b7=_0x315540;if(_0x5bb1d5['has'](_0x1c6d1d))return;_0x5bb1d5[_0x5091b7(0x9a)](_0x1c6d1d);for(const _0x5acd6a of _0x1213d9[_0x5091b7(0x1a5)](_0x1c6d1d)??[]){const _0x172905=resolveEdgeEndpoint(_0x5acd6a[_0x5091b7(0x147)],_0x5acd6a[_0x5091b7(0x119)]);if(_0x172905&&_0x11fd54[_0x5091b7(0x1d0)](_0x172905))_0x1c7fd0(_0x172905);}};_0x1c7fd0(_0x488b16);for(const _0x2ea10e of _0x11fd54['keys']()){!_0x5bb1d5[_0x315540(0x1d0)](_0x2ea10e)&&_0x5d6358[_0x315540(0xbc)]({'path':_0x315540(0x164)+_0x2ea10e,'message':_0x315540(0xdb)});}const _0x4f88c9=_0x246941[_0x315540(0x1c9)](_0x1ebe6b=>_0x5bb1d5[_0x315540(0x1d0)](_0x1ebe6b));if(!_0x4f88c9){_0x5d6358[_0x315540(0xbc)]({'path':_0x315540(0xd5),'message':_0x315540(0xbe)});return;}const _0x2b55ae=new Set(),_0x466420=_0x4b77f0=>{const _0x1b13b6=_0x315540;if(_0x2b55ae[_0x1b13b6(0x1d0)](_0x4b77f0))return;_0x2b55ae['add'](_0x4b77f0);for(const _0x25c46b of _0x32db33['get'](_0x4b77f0)??[]){const _0x19657f=resolveEdgeEndpoint(_0x25c46b[_0x1b13b6(0x1e7)],_0x25c46b[_0x1b13b6(0xd0)]);if(_0x19657f&&_0x11fd54[_0x1b13b6(0x1d0)](_0x19657f))_0x466420(_0x19657f);}};for(const _0x29a541 of _0x246941){if(_0x11fd54['has'](_0x29a541))_0x466420(_0x29a541);}for(const _0x28700 of _0x5bb1d5){!_0x2b55ae[_0x315540(0x1d0)](_0x28700)&&_0x5d6358[_0x315540(0xbc)]({'path':_0x315540(0x164)+_0x28700,'message':_0x315540(0xb3)});}}function validateApprovalResults(_0x48666c,_0x3fd691,_0x37e7bb,_0x4cceba){const _0x4926c5=a299_0x305ad7;if(_0x3fd691===0x0)return;const _0x73982d=new Set(_0x37e7bb[_0x4926c5(0x160)](_0x16ec95=>_0x48666c[_0x4926c5(0x1a5)](_0x16ec95)?.[_0x4926c5(0x14a)])[_0x4926c5(0x1eb)](_0x43976a=>typeof _0x43976a===_0x4926c5(0xc5)));for(const _0x27440a of[_0x4926c5(0x1f2),_0x4926c5(0x1ca)]){!_0x73982d['has'](_0x27440a)&&_0x4cceba['push']({'path':'flowJson.nodes','message':_0x4926c5(0xb4)+_0x27440a+'.'});}}function validateScriptResultReferences(_0x10d5a0,_0x48c8c4,_0x29ef54,_0x298913,_0x173510,_0x6eed32,_0x387932){const _0x31bb35=a299_0x305ad7;if(_0x6eed32[_0x31bb35(0x1f1)]===0x0)return;const _0x1ea31b=new Set(),_0x18beda=_0x3d2b39=>{const _0xdde7d2=_0x31bb35;if(!_0x1ea31b[_0xdde7d2(0x1d0)](_0x3d2b39)&&_0x10d5a0[_0xdde7d2(0x1d0)](_0x3d2b39)){_0x1ea31b['add'](_0x3d2b39);for(const _0x393a9a of _0x29ef54[_0xdde7d2(0x1a5)](_0x3d2b39)??[]){const _0x3dfb92=resolveEdgeEndpoint(_0x393a9a[_0xdde7d2(0x147)],_0x393a9a[_0xdde7d2(0x119)]);if(_0x3dfb92)_0x18beda(_0x3dfb92);}}};_0x18beda(_0x48c8c4);const _0x1e375d=new Map();for(const _0xce17f9 of _0x1ea31b){_0x1e375d['set'](_0xce17f9,_0xce17f9===_0x48c8c4?new Set([_0x48c8c4]):new Set(_0x1ea31b));}let _0x2e126e=!![];while(_0x2e126e){_0x2e126e=![];for(const _0x98452f of _0x1ea31b){if(_0x98452f===_0x48c8c4)continue;const _0x54d3c4=(_0x298913[_0x31bb35(0x1a5)](_0x98452f)??[])[_0x31bb35(0x160)](_0x5f5df8=>resolveEdgeEndpoint(_0x5f5df8[_0x31bb35(0x1e7)],_0x5f5df8[_0x31bb35(0xd0)]))[_0x31bb35(0x1eb)](_0x17e013=>Boolean(_0x17e013&&_0x1ea31b[_0x31bb35(0x1d0)](_0x17e013)));if(_0x54d3c4['length']===0x0)continue;const _0xeb586d=new Set(_0x1e375d[_0x31bb35(0x1a5)](_0x54d3c4[0x0])??[]);for(const _0x1e827f of _0x54d3c4[_0x31bb35(0x1da)](0x1)){const _0x24a7e2=_0x1e375d[_0x31bb35(0x1a5)](_0x1e827f)??new Set();for(const _0x3e2748 of _0xeb586d){if(!_0x24a7e2[_0x31bb35(0x1d0)](_0x3e2748))_0xeb586d[_0x31bb35(0x1c1)](_0x3e2748);}}_0xeb586d[_0x31bb35(0x9a)](_0x98452f);const _0x3dcc4a=_0x1e375d['get'](_0x98452f);!setsEqual(_0x3dcc4a,_0xeb586d)&&(_0x1e375d[_0x31bb35(0x16a)](_0x98452f,_0xeb586d),_0x2e126e=!![]);}}for(const [_0x2f246a,_0x5a3efb]of _0x29ef54){const _0x2aafdf=_0x1e375d[_0x31bb35(0x1a5)](_0x2f246a);if(!_0x2aafdf)continue;for(const _0x1f4e14 of _0x5a3efb){if(_0x1f4e14[_0x31bb35(0x1f5)]!=='EXPRESSION'||typeof _0x1f4e14[_0x31bb35(0xa3)]!=='string')continue;for(const [_0x4ff6dc,_0x2a6794]of _0x6eed32){expressionReferencesVariable(_0x1f4e14['expression'],_0x4ff6dc)&&!_0x2aafdf[_0x31bb35(0x1d0)](_0x2a6794)&&_0x387932[_0x31bb35(0xbc)]({'path':(_0x173510[_0x31bb35(0x1a5)](_0x1f4e14)??_0x31bb35(0xd5))+'.expression','message':_0x31bb35(0x13f)+_0x4ff6dc+_0x31bb35(0x120)+_0x2a6794+_0x31bb35(0x110)+_0x2f246a+'.'});}}}}function expressionReferencesVariable(_0x1c7d1e,_0x245a60){const _0x9bd1d8=a299_0x305ad7;let _0x1972b1=0x0;while(_0x1972b1<_0x1c7d1e['length']){const _0x56fd41=_0x1c7d1e[_0x1972b1];if(_0x56fd41==='\x27'||_0x56fd41==='\x22'){_0x1972b1=skipQuotedExpressionSegment(_0x1c7d1e,_0x1972b1,_0x56fd41);continue;}if(!/[A-Za-z_]/[_0x9bd1d8(0x1c3)](_0x56fd41)){_0x1972b1+=0x1;continue;}const _0x60862=_0x1972b1;_0x1972b1+=0x1;while(_0x1972b1<_0x1c7d1e[_0x9bd1d8(0x17d)]&&/[A-Za-z0-9_]/['test'](_0x1c7d1e[_0x1972b1])){_0x1972b1+=0x1;}if(_0x1c7d1e['slice'](_0x60862,_0x1972b1)!==_0x245a60)continue;let _0x25d54f=_0x60862-0x1;while(_0x25d54f>=0x0&&/\s/['test'](_0x1c7d1e[_0x25d54f])){_0x25d54f-=0x1;}if(_0x1c7d1e[_0x25d54f]!=='.')return!![];}return![];}function skipQuotedExpressionSegment(_0x1d847e,_0x46d443,_0x1da33b){const _0x26c8f3=a299_0x305ad7;let _0x42d557=_0x46d443+0x1;while(_0x42d557<_0x1d847e[_0x26c8f3(0x17d)]){if(_0x1d847e[_0x42d557]==='\x5c'){_0x42d557+=0x2;continue;}if(_0x1d847e[_0x42d557]===_0x1da33b)return _0x42d557+0x1;_0x42d557+=0x1;}return _0x42d557;}function resolveEffectiveResultVariable(_0x12a050,_0x5eae44){const _0x184d8b=a299_0x305ad7;if(_0x12a050===undefined||_0x12a050===null||_0x5eae44&&_0x12a050==='')return DEFAULT_SCRIPT_RESULT_VARIABLE;if(typeof _0x12a050!==_0x184d8b(0xc5)||!VARIABLE_PATTERN['test'](_0x12a050)||RESERVED_RESULT_VARIABLES[_0x184d8b(0x1d0)](_0x12a050)||_0x12a050[_0x184d8b(0x135)](_0x184d8b(0x1ee)))return undefined;return _0x12a050;}function registerResultVariableOwner(_0x1a3ac7,_0x597b4a,_0x5a10af,_0x3f1e93){const _0x1c2432=a299_0x305ad7;if(_0x1a3ac7[_0x1c2432(0x1d0)](_0x597b4a)){_0x3f1e93[_0x1c2432(0xbc)]({'path':'flowJson.nodes','message':'Duplicate\x20resultVariable:\x20'+_0x597b4a+'.'});return;}_0x1a3ac7[_0x1c2432(0x16a)](_0x597b4a,_0x5a10af);}function setsEqual(_0xeaf7fc,_0x2653db){const _0x5e0bc5=a299_0x305ad7;return _0xeaf7fc[_0x5e0bc5(0x1f1)]===_0x2653db['size']&&[..._0xeaf7fc]['every'](_0x4a395c=>_0x2653db[_0x5e0bc5(0x1d0)](_0x4a395c));}function isValidUserId(_0x1d42a5){const _0x2326f4=a299_0x305ad7;if(typeof _0x1d42a5==='string')return _0x1d42a5[_0x2326f4(0x11f)]()[_0x2326f4(0x17d)]>0x0;return Number[_0x2326f4(0x1ce)](_0x1d42a5)&&Number(_0x1d42a5)>0x0;}function resolveEdgeEndpoint(_0x3b0f13,_0x31aeb9){const _0x3db8bf=a299_0x305ad7;if(typeof _0x3b0f13===_0x3db8bf(0xc5)&&_0x3b0f13[_0x3db8bf(0x11f)]())return _0x3b0f13[_0x3db8bf(0x11f)]();if(typeof _0x31aeb9===_0x3db8bf(0xc5)&&_0x31aeb9[_0x3db8bf(0x11f)]())return _0x31aeb9['trim']();return undefined;}function a299_0x2fc6(_0x15412d,_0x14a6d5){_0x15412d=_0x15412d-0x97;const _0x281057=a299_0x2810();let _0x2fc6c2=_0x281057[_0x15412d];return _0x2fc6c2;}function removeEmptyMetadata(_0xa4eb56,_0x288bf1,_0xefc36,_0x22092d){const _0x114d05=a299_0x305ad7;if(Array[_0x114d05(0x108)](_0xa4eb56)){_0xa4eb56[_0x114d05(0x1de)]((_0xd7d6c6,_0x47d1f1)=>removeEmptyMetadata(_0xd7d6c6,_0x288bf1+'['+_0x47d1f1+']',_0xefc36,_0x22092d));return;}if(!isRecord(_0xa4eb56))return;for(const [_0x158088,_0x2ffb36]of Object[_0x114d05(0x1ea)](_0xa4eb56)){const _0x323123=_0x288bf1+'.'+_0x158088;if(_0x158088===_0x114d05(0x151)&&isEmptyJsonValue(_0x2ffb36)){delete _0xa4eb56[_0x158088],_0x22092d['push'](_0x323123),_0xefc36[_0x114d05(0xbc)]({'code':_0x114d05(0xf3),'path':_0x323123,'message':_0x323123+'\x20was\x20empty\x20and\x20was\x20removed.'});continue;}removeEmptyMetadata(_0x2ffb36,_0x323123,_0xefc36,_0x22092d);}}function isEmptyJsonValue(_0x4914cd){const _0x450645=a299_0x305ad7;if(_0x4914cd===null||_0x4914cd===undefined)return!![];if(typeof _0x4914cd===_0x450645(0xc5))return _0x4914cd[_0x450645(0x11f)]()==='';if(Array[_0x450645(0x108)](_0x4914cd))return _0x4914cd[_0x450645(0x17d)]===0x0;return isRecord(_0x4914cd)&&Object['keys'](_0x4914cd)[_0x450645(0x17d)]===0x0;}function isRecord(_0x3d9d55){const _0x3c2511=a299_0x305ad7;return typeof _0x3d9d55===_0x3c2511(0x1ab)&&_0x3d9d55!==null&&!Array[_0x3c2511(0x108)](_0x3d9d55);}function cloneJsonValue(_0x5c5795){const _0x5ca127=a299_0x305ad7;return JSON[_0x5ca127(0x10c)](JSON[_0x5ca127(0x18c)](_0x5c5795));}export async function readFlowConfigFile(_0x313187){const _0x37d67c=a299_0x305ad7,_0x405cbd=await readFile(resolve(_0x313187),_0x37d67c(0x166));return JSON[_0x37d67c(0x10c)](_0x405cbd);}
@@ -1 +1 @@
1
- const a300_0x7e0a40=a300_0x58a1;(function(_0x2bafd5,_0x90cea5){const _0x293989=a300_0x58a1,_0x1ca46c=_0x2bafd5();while(!![]){try{const _0x4eaa4c=-parseInt(_0x293989(0x171))/0x1+-parseInt(_0x293989(0x182))/0x2+parseInt(_0x293989(0x183))/0x3*(-parseInt(_0x293989(0x189))/0x4)+parseInt(_0x293989(0x15f))/0x5*(-parseInt(_0x293989(0x193))/0x6)+parseInt(_0x293989(0x192))/0x7*(parseInt(_0x293989(0x17b))/0x8)+-parseInt(_0x293989(0x177))/0x9*(-parseInt(_0x293989(0x18e))/0xa)+parseInt(_0x293989(0x198))/0xb*(parseInt(_0x293989(0x169))/0xc);if(_0x4eaa4c===_0x90cea5)break;else _0x1ca46c['push'](_0x1ca46c['shift']());}catch(_0x590658){_0x1ca46c['push'](_0x1ca46c['shift']());}}}(a300_0xa5fb,0xbae5e));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';function a300_0xa5fb(){const _0x5a7a79=['37138761HmKChH','instantApi','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','instant_api_policy_rules_invalid','length','instant_api_policy_json_invalid','140820HQgAjd','instant_api_policy_app_code_mismatch','version','decode','appCode','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','pid','.tmp','defaults','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','12PmBHrF','includes','instant_api_policy_file_too_large','stringify','created','instant_api_policy_file_unwritable','EEXIST','.rabetbase/instant-api-policy','771665rTVngv','string','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','size','policyFilePath','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','648AMxxaL','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','force','8ynhLfA','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','object','policy.json','isArray','code','1256016ZRWqJT','4534899wtimyG','utf8','byteLength','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','parse','4WPvGrR','allow','instant_api_policy_file_unreadable','instant_api_policy_version_invalid','trim','66740EbAJwQ','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','instant_api_policy_file_invalid','utf-8','711907MwYVCo','60FQcTZF','policyRoot','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','rules'];a300_0xa5fb=function(){return _0x5a7a79;};return a300_0xa5fb();}function a300_0x58a1(_0x313ac6,_0x34ac2d){_0x313ac6=_0x313ac6-0x15d;const _0xa5fbbe=a300_0xa5fb();let _0x58a1d0=_0xa5fbbe[_0x313ac6];return _0x58a1d0;}import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a300_0x7e0a40(0x170);export const INSTANT_API_POLICY_FILE_NAME=a300_0x7e0a40(0x17f);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x3b8bd1,_0x48d0d5,_0x598871){return new CliError(_0x3b8bd1,0x1,_0x48d0d5,_0x598871);}export function loadInstantApiPolicyLocalConfig(_0x287d61,_0x3644c2){assertSafeAppCode(_0x287d61);const _0x3588d1=resolve(_0x3644c2??findProjectRootDirectory()),_0x10d6fa=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x287d61+'/'+INSTANT_API_POLICY_FILE_NAME,_0x43da82=resolve(_0x3588d1,INSTANT_API_POLICY_RELATIVE_ROOT,_0x287d61),_0x298c3c=resolve(_0x43da82,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x3588d1,'appCode':_0x287d61,'policyRoot':_0x43da82,'policyFilePath':_0x298c3c,'policyRelativePath':_0x10d6fa};}export function createDefaultInstantApiPolicyConfig(_0x25bc18,_0x33a385=a300_0x7e0a40(0x18a)){return assertSafeAppCode(_0x25bc18),{'version':'2','appCode':_0x25bc18,'defaults':{'instantApi':_0x33a385},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x4619ed){const _0x22065b=a300_0x7e0a40;let _0x5aae71;try{_0x5aae71=await stat(_0x4619ed['policyFilePath']);}catch(_0x55c28d){throw instantApiPolicyError('instant_api_policy_file_missing',_0x22065b(0x196)+_0x4619ed[_0x22065b(0x175)],_0x22065b(0x195));}if(!_0x5aae71['isFile']())throw instantApiPolicyError(_0x22065b(0x190),'Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x4619ed[_0x22065b(0x175)]);if(_0x5aae71[_0x22065b(0x174)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x22065b(0x16b),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0xd3a8e9;try{_0xd3a8e9=await readFile(_0x4619ed[_0x22065b(0x175)]);}catch{throw instantApiPolicyError(_0x22065b(0x18b),_0x22065b(0x173)+_0x4619ed[_0x22065b(0x175)]);}if(_0xd3a8e9[_0x22065b(0x185)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x22065b(0x16b),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0x54034c;try{_0x54034c=new TextDecoder(_0x22065b(0x191),{'fatal':!![],'ignoreBOM':!![]})[_0x22065b(0x162)](_0xd3a8e9);}catch{throw instantApiPolicyError('instant_api_policy_file_invalid',_0x22065b(0x176)+_0x4619ed[_0x22065b(0x175)]);}let _0x39ccad;try{_0x39ccad=JSON[_0x22065b(0x188)](_0x54034c);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid',_0x22065b(0x178)+_0x4619ed[_0x22065b(0x175)]);}return assertLocalPolicyContract(_0x39ccad,_0x4619ed['appCode']);}export async function writeInstantApiPolicyConfigFile(_0xfda23c,_0x29d5a5,_0x1d9c1e={}){const _0x439bdb=a300_0x7e0a40,_0x9eb210=assertLocalPolicyContract(_0x29d5a5,_0xfda23c['appCode']),_0x23f6df=JSON[_0x439bdb(0x16c)](_0x9eb210,null,0x2)+'\x0a';if(Buffer[_0x439bdb(0x185)](_0x23f6df,_0x439bdb(0x184))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');await mkdir(_0xfda23c[_0x439bdb(0x194)],{'recursive':!![]});let _0x3261d6;try{_0x3261d6=await readFile(_0xfda23c[_0x439bdb(0x175)],'utf8');}catch(_0x26527b){if(!isMissingFile(_0x26527b))throw instantApiPolicyError(_0x439bdb(0x18b),'Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20'+_0xfda23c['policyFilePath']);}if(_0x3261d6===_0x23f6df)return{'action':'unchanged','filePath':_0xfda23c[_0x439bdb(0x175)]};if(_0x3261d6!==undefined&&!_0x1d9c1e[_0x439bdb(0x17a)])throw instantApiPolicyError('instant_api_policy_file_exists',_0x439bdb(0x17d)+_0xfda23c[_0x439bdb(0x175)],_0x439bdb(0x18f));if(_0x3261d6===undefined)try{return await writeFile(_0xfda23c[_0x439bdb(0x175)],_0x23f6df,{'encoding':_0x439bdb(0x184),'flag':'wx'}),{'action':_0x439bdb(0x16d),'filePath':_0xfda23c['policyFilePath']};}catch(_0x28d135){if(!isAlreadyExists(_0x28d135))throw instantApiPolicyError(_0x439bdb(0x16e),'Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20'+_0xfda23c[_0x439bdb(0x175)]);if(!_0x1d9c1e[_0x439bdb(0x17a)])throw instantApiPolicyError('instant_api_policy_file_exists','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20'+_0xfda23c[_0x439bdb(0x175)],'Review\x20the\x20file\x20before\x20retrying.');}const _0x36f49d=resolve(dirname(_0xfda23c[_0x439bdb(0x175)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x439bdb(0x165)]+'.'+randomUUID()+_0x439bdb(0x166));try{await writeFile(_0x36f49d,_0x23f6df,{'encoding':'utf8','flag':'wx'}),await rename(_0x36f49d,_0xfda23c[_0x439bdb(0x175)]);}catch{await unlink(_0x36f49d)['catch'](()=>undefined);throw instantApiPolicyError(_0x439bdb(0x16e),_0x439bdb(0x179)+_0xfda23c['policyFilePath']);}return{'action':'overwritten','filePath':_0xfda23c[_0x439bdb(0x175)]};}function assertSafeAppCode(_0x2e6947){const _0x159e1d=a300_0x7e0a40,_0x35e800=_0x2e6947[_0x159e1d(0x18d)]();if(!_0x35e800||_0x35e800!==_0x2e6947||_0x35e800[_0x159e1d(0x15d)]>0x64||_0x35e800==='.'||_0x35e800==='..'||_0x35e800[_0x159e1d(0x16a)]('/')||_0x35e800[_0x159e1d(0x16a)]('\x5c')||_0x35e800[_0x159e1d(0x16a)]('\x00'))throw instantApiPolicyError('instant_api_policy_app_code_invalid',_0x159e1d(0x17c));}function assertLocalPolicyContract(_0x50313d,_0x363927){const _0x59a3ae=a300_0x7e0a40;if(!isObject(_0x50313d))throw instantApiPolicyError(_0x59a3ae(0x15e),_0x59a3ae(0x187));if(_0x50313d[_0x59a3ae(0x161)]!=='1'&&_0x50313d[_0x59a3ae(0x161)]!=='2')throw instantApiPolicyError(_0x59a3ae(0x18c),_0x59a3ae(0x168),_0x59a3ae(0x186));if(_0x50313d[_0x59a3ae(0x163)]!==_0x363927)throw instantApiPolicyError(_0x59a3ae(0x160),_0x59a3ae(0x19a)+_0x363927+'.');if(!isObject(_0x50313d[_0x59a3ae(0x167)])||typeof _0x50313d['defaults'][_0x59a3ae(0x199)]!==_0x59a3ae(0x172))throw instantApiPolicyError('instant_api_policy_defaults_invalid','Policy\x20defaults.instantApi\x20is\x20required.');if(_0x50313d[_0x59a3ae(0x197)]!==undefined&&_0x50313d[_0x59a3ae(0x197)]!==null&&!Array[_0x59a3ae(0x180)](_0x50313d['rules']))throw instantApiPolicyError(_0x59a3ae(0x19b),_0x59a3ae(0x164));return _0x50313d;}function isObject(_0x525b4e){const _0x2f1f35=a300_0x7e0a40;return _0x525b4e!==null&&typeof _0x525b4e==='object'&&!Array[_0x2f1f35(0x180)](_0x525b4e);}function isMissingFile(_0x3a0d5b){const _0x5773e0=a300_0x7e0a40;return Boolean(_0x3a0d5b&&typeof _0x3a0d5b===_0x5773e0(0x17e)&&_0x3a0d5b[_0x5773e0(0x181)]==='ENOENT');}function isAlreadyExists(_0x272d9b){const _0xd4d4dd=a300_0x7e0a40;return Boolean(_0x272d9b&&typeof _0x272d9b===_0xd4d4dd(0x17e)&&_0x272d9b[_0xd4d4dd(0x181)]===_0xd4d4dd(0x16f));}
1
+ const a300_0x21322c=a300_0x46ab;function a300_0x4556(){const _0x1c5aa7=['pid','instant_api_policy_defaults_invalid','instant_api_policy_app_code_mismatch','7xtGBBQ','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','5nfpUXO','decode','rules','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','stringify','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','string','44DBuQQK','426984iBYQuu','.tmp','instant_api_policy_json_invalid','Policy\x20defaults.instantApi\x20is\x20required.','.rabetbase/instant-api-policy','instant_api_policy_app_code_invalid','instant_api_policy_file_unwritable','utf-8','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','utf8','Review\x20the\x20file\x20before\x20retrying.','length','ENOENT','5418OLTWSU','allow','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','16407bTWgBQ','1027736bapqdh','policyFilePath','11395461ixoydd','instantApi','instant_api_policy_file_missing','code','instant_api_policy_file_too_large','policyRoot','EEXIST','130056KnILmw','instant_api_policy_file_invalid','appCode','object','instant_api_policy_file_unreadable','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','instant_api_policy_rules_invalid','parse','force','created','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','overwritten','byteLength','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_file_exists','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','3670BCkQXF','instant_api_policy_version_invalid','247665LGEEMH'];a300_0x4556=function(){return _0x1c5aa7;};return a300_0x4556();}(function(_0x2dd612,_0x4de952){const _0x335175=a300_0x46ab,_0x4e127e=_0x2dd612();while(!![]){try{const _0x4c9356=-parseInt(_0x335175(0x198))/0x1+-parseInt(_0x335175(0x1a9))/0x2*(parseInt(_0x335175(0x17b))/0x3)+-parseInt(_0x335175(0x17c))/0x4*(parseInt(_0x335175(0x19f))/0x5)+parseInt(_0x335175(0x1aa))/0x6*(-parseInt(_0x335175(0x19c))/0x7)+parseInt(_0x335175(0x185))/0x8+-parseInt(_0x335175(0x1b7))/0x9*(parseInt(_0x335175(0x196))/0xa)+parseInt(_0x335175(0x17e))/0xb;if(_0x4c9356===_0x4de952)break;else _0x4e127e['push'](_0x4e127e['shift']());}catch(_0x3fd48d){_0x4e127e['push'](_0x4e127e['shift']());}}}(a300_0x4556,0x21019));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a300_0x21322c(0x1ae);export const INSTANT_API_POLICY_FILE_NAME='policy.json';export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;function a300_0x46ab(_0x3ccef1,_0x43ef2e){_0x3ccef1=_0x3ccef1-0x179;const _0x4556b5=a300_0x4556();let _0x46ab37=_0x4556b5[_0x3ccef1];return _0x46ab37;}export function instantApiPolicyError(_0x149af0,_0x1dd407,_0xf91658){return new CliError(_0x149af0,0x1,_0x1dd407,_0xf91658);}export function loadInstantApiPolicyLocalConfig(_0x3e9d6e,_0x2d782a){assertSafeAppCode(_0x3e9d6e);const _0x5cc93d=resolve(_0x2d782a??findProjectRootDirectory()),_0x29d264=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x3e9d6e+'/'+INSTANT_API_POLICY_FILE_NAME,_0x2ed7e8=resolve(_0x5cc93d,INSTANT_API_POLICY_RELATIVE_ROOT,_0x3e9d6e),_0x45b2f9=resolve(_0x2ed7e8,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x5cc93d,'appCode':_0x3e9d6e,'policyRoot':_0x2ed7e8,'policyFilePath':_0x45b2f9,'policyRelativePath':_0x29d264};}export function createDefaultInstantApiPolicyConfig(_0x4f1f37,_0x16e4c0=a300_0x21322c(0x1b8)){return assertSafeAppCode(_0x4f1f37),{'version':'2','appCode':_0x4f1f37,'defaults':{'instantApi':_0x16e4c0},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x3f5544){const _0x163dab=a300_0x21322c;let _0x47cd24;try{_0x47cd24=await stat(_0x3f5544[_0x163dab(0x17d)]);}catch(_0x1f8d7e){throw instantApiPolicyError(_0x163dab(0x180),'Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20'+_0x3f5544['policyFilePath'],_0x163dab(0x18a));}if(!_0x47cd24['isFile']())throw instantApiPolicyError(_0x163dab(0x186),_0x163dab(0x179)+_0x3f5544[_0x163dab(0x17d)]);if(_0x47cd24['size']>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x163dab(0x182),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0x4c732d;try{_0x4c732d=await readFile(_0x3f5544[_0x163dab(0x17d)]);}catch{throw instantApiPolicyError(_0x163dab(0x189),_0x163dab(0x193)+_0x3f5544[_0x163dab(0x17d)]);}if(_0x4c732d[_0x163dab(0x191)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x163dab(0x182),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0x479fab;try{_0x479fab=new TextDecoder(_0x163dab(0x1b1),{'fatal':!![],'ignoreBOM':!![]})[_0x163dab(0x1a0)](_0x4c732d);}catch{throw instantApiPolicyError(_0x163dab(0x186),_0x163dab(0x1a5)+_0x3f5544[_0x163dab(0x17d)]);}let _0x1cfc04;try{_0x1cfc04=JSON[_0x163dab(0x18c)](_0x479fab);}catch{throw instantApiPolicyError(_0x163dab(0x1ac),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x3f5544[_0x163dab(0x17d)]);}return assertLocalPolicyContract(_0x1cfc04,_0x3f5544['appCode']);}export async function writeInstantApiPolicyConfigFile(_0x4cc055,_0x9d8f8a,_0x58b5e1={}){const _0x1617df=a300_0x21322c,_0x25813d=assertLocalPolicyContract(_0x9d8f8a,_0x4cc055[_0x1617df(0x187)]),_0x36f084=JSON[_0x1617df(0x1a6)](_0x25813d,null,0x2)+'\x0a';if(Buffer['byteLength'](_0x36f084,_0x1617df(0x1b3))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1617df(0x182),_0x1617df(0x1a7));await mkdir(_0x4cc055[_0x1617df(0x183)],{'recursive':!![]});let _0x497b63;try{_0x497b63=await readFile(_0x4cc055[_0x1617df(0x17d)],_0x1617df(0x1b3));}catch(_0x1fd7d3){if(!isMissingFile(_0x1fd7d3))throw instantApiPolicyError(_0x1617df(0x189),_0x1617df(0x1a2)+_0x4cc055['policyFilePath']);}if(_0x497b63===_0x36f084)return{'action':'unchanged','filePath':_0x4cc055[_0x1617df(0x17d)]};if(_0x497b63!==undefined&&!_0x58b5e1[_0x1617df(0x18d)])throw instantApiPolicyError(_0x1617df(0x194),'Instant\x20API\x20policy\x20file\x20already\x20exists:\x20'+_0x4cc055[_0x1617df(0x17d)],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x497b63===undefined)try{return await writeFile(_0x4cc055[_0x1617df(0x17d)],_0x36f084,{'encoding':_0x1617df(0x1b3),'flag':'wx'}),{'action':_0x1617df(0x18e),'filePath':_0x4cc055['policyFilePath']};}catch(_0xbde4){if(!isAlreadyExists(_0xbde4))throw instantApiPolicyError(_0x1617df(0x1b0),_0x1617df(0x1a3)+_0x4cc055['policyFilePath']);if(!_0x58b5e1[_0x1617df(0x18d)])throw instantApiPolicyError(_0x1617df(0x194),_0x1617df(0x195)+_0x4cc055[_0x1617df(0x17d)],_0x1617df(0x1b4));}const _0x516a79=resolve(dirname(_0x4cc055[_0x1617df(0x17d)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x1617df(0x199)]+'.'+randomUUID()+_0x1617df(0x1ab));try{await writeFile(_0x516a79,_0x36f084,{'encoding':_0x1617df(0x1b3),'flag':'wx'}),await rename(_0x516a79,_0x4cc055[_0x1617df(0x17d)]);}catch{await unlink(_0x516a79)['catch'](()=>undefined);throw instantApiPolicyError('instant_api_policy_file_unwritable',_0x1617df(0x19d)+_0x4cc055[_0x1617df(0x17d)]);}return{'action':_0x1617df(0x190),'filePath':_0x4cc055[_0x1617df(0x17d)]};}function assertSafeAppCode(_0x1cd85b){const _0x21a4ab=a300_0x21322c,_0x1795a1=_0x1cd85b['trim']();if(!_0x1795a1||_0x1795a1!==_0x1cd85b||_0x1795a1[_0x21a4ab(0x1b5)]>0x64||_0x1795a1==='.'||_0x1795a1==='..'||_0x1795a1['includes']('/')||_0x1795a1['includes']('\x5c')||_0x1795a1['includes']('\x00'))throw instantApiPolicyError(_0x21a4ab(0x1af),_0x21a4ab(0x192));}function assertLocalPolicyContract(_0x2b517,_0x46f423){const _0x3943ef=a300_0x21322c;if(!isObject(_0x2b517))throw instantApiPolicyError('instant_api_policy_json_invalid',_0x3943ef(0x19e));if(_0x2b517['version']!=='1'&&_0x2b517['version']!=='2')throw instantApiPolicyError(_0x3943ef(0x197),_0x3943ef(0x1b2),_0x3943ef(0x1a4));if(_0x2b517[_0x3943ef(0x187)]!==_0x46f423)throw instantApiPolicyError(_0x3943ef(0x19b),_0x3943ef(0x17a)+_0x46f423+'.');if(!isObject(_0x2b517['defaults'])||typeof _0x2b517['defaults'][_0x3943ef(0x17f)]!==_0x3943ef(0x1a8))throw instantApiPolicyError(_0x3943ef(0x19a),_0x3943ef(0x1ad));if(_0x2b517[_0x3943ef(0x1a1)]!==undefined&&_0x2b517[_0x3943ef(0x1a1)]!==null&&!Array['isArray'](_0x2b517['rules']))throw instantApiPolicyError(_0x3943ef(0x18b),_0x3943ef(0x18f));return _0x2b517;}function isObject(_0x46a543){const _0x3bde59=a300_0x21322c;return _0x46a543!==null&&typeof _0x46a543===_0x3bde59(0x188)&&!Array['isArray'](_0x46a543);}function isMissingFile(_0x5accee){const _0x4cd1ec=a300_0x21322c;return Boolean(_0x5accee&&typeof _0x5accee==='object'&&_0x5accee[_0x4cd1ec(0x181)]===_0x4cd1ec(0x1b6));}function isAlreadyExists(_0x59d9ab){const _0x4dbbc0=a300_0x21322c;return Boolean(_0x59d9ab&&typeof _0x59d9ab===_0x4dbbc0(0x188)&&_0x59d9ab[_0x4dbbc0(0x181)]===_0x4dbbc0(0x184));}
@@ -1 +1 @@
1
- const a301_0x3ebf70=a301_0x3e20;(function(_0x208109,_0x46f940){const _0x1e61e7=a301_0x3e20,_0x57eb83=_0x208109();while(!![]){try{const _0x5521a6=-parseInt(_0x1e61e7(0x1e7))/0x1*(-parseInt(_0x1e61e7(0x20e))/0x2)+parseInt(_0x1e61e7(0x1f7))/0x3+-parseInt(_0x1e61e7(0x207))/0x4*(parseInt(_0x1e61e7(0x1f0))/0x5)+-parseInt(_0x1e61e7(0x21a))/0x6*(parseInt(_0x1e61e7(0x1ee))/0x7)+-parseInt(_0x1e61e7(0x206))/0x8+-parseInt(_0x1e61e7(0x1f2))/0x9+-parseInt(_0x1e61e7(0x219))/0xa*(-parseInt(_0x1e61e7(0x1f8))/0xb);if(_0x5521a6===_0x46f940)break;else _0x57eb83['push'](_0x57eb83['shift']());}catch(_0x3768a0){_0x57eb83['push'](_0x57eb83['shift']());}}}(a301_0x1559,0x32c40));import{AsyncLocalStorage}from'node:async_hooks';function a301_0x1559(){const _0x309627=['cookie','json','transportFailure','105','status','3106872kQSVzA','8KlYUBJ','data','Invalid\x20kbServiceDomain:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','GET','isArray','remoteErrorCode','httpStatus','30848iRZvZN','body','byteLength','/admin/knowledge-base/get-list','origin','string','Knowledge\x20management\x20request\x20timed\x20out.','getStore','success','pageTooLarge','application/json','30dABbOk','17844MctJTL','headers','api_error','kb-browser-v1','method','error','aborted','cancelled','Knowledge\x20management\x20returned\x20an\x20invalid\x20response\x20(HTTP\x20','17xqkHou','LEGACY_LIST_TOO_LARGE','Knowledge\x20management\x20request\x20failed\x20(HTTP\x20','Knowledge\x20management\x20request\x20failed\x20or\x20was\x20cancelled.','boolean','signal','run','581UhBszg','errorCode','831595XSolMu','includes','2208564oKNDie','cli:rabetbase','hasOwn','content-type','stringify','977544GsMZea','3054755ZuOAKg','Configure\x20kbServiceDomain\x20with\x20a\x20trusted\x20HTTPS\x20origin\x20for\x20knowledge\x20management.','validation','test','errorMsg','trim','Invalid\x20knowledge\x20management\x20API\x20path.','toLowerCase','authRequired'];a301_0x1559=function(){return _0x309627;};return a301_0x1559();}import{getKbServiceDomain}from'../constant/domain.js';import{normalizeKbServiceOrigin}from'../core/kb-search-client.js';import{CliError,CliErrors}from'../errors.js';const MAX_BODY_BYTES=0x20*0x400*0x400,session=new AsyncLocalStorage();export class KbManagementError extends CliError{[a301_0x3ebf70(0x203)];[a301_0x3ebf70(0x20c)];[a301_0x3ebf70(0x20d)];[a301_0x3ebf70(0x217)];constructor(_0x57d9e2,_0x5097db=![],_0x12ef5c,_0x1d195e,_0x5bc21a=![]){const _0x1babf7=a301_0x3ebf70;super(_0x1babf7(0x21c),0x1,_0x57d9e2,_0x12ef5c?'API\x20error\x20code:\x20'+_0x12ef5c:undefined),this[_0x1babf7(0x203)]=_0x5097db,this[_0x1babf7(0x20c)]=_0x12ef5c,this[_0x1babf7(0x20d)]=_0x1d195e,this[_0x1babf7(0x217)]=_0x5bc21a;if(_0x12ef5c)Object['defineProperty'](this,'data',{'value':{'remoteErrorCode':_0x12ef5c},'enumerable':![]});}}function resolveOrigin(){const _0x1786cb=a301_0x3ebf70,_0x47be87=getKbServiceDomain();if(!_0x47be87)throw CliErrors['validation'](_0x1786cb(0x1f9));try{return normalizeKbServiceOrigin(_0x47be87);}catch{throw CliErrors[_0x1786cb(0x1fa)](_0x1786cb(0x209));}}function a301_0x3e20(_0x3351fe,_0x1bfc29){_0x3351fe=_0x3351fe-0x1e4;const _0x155903=a301_0x1559();let _0x3e2066=_0x155903[_0x3351fe];return _0x3e2066;}export function withKbManagementSession(_0x184fa2,_0x443dc0){const _0x229034=a301_0x3ebf70;return session[_0x229034(0x1ed)]({'origin':resolveOrigin(),'signal':_0x184fa2},_0x443dc0);}export async function kbManagementRequest(_0x44844d,_0x5e5c91){const _0x523e95=a301_0x3ebf70;if(!/^\/admin\/knowledge-base\/(get-list|get-one|create|update|delete)(\?[^#]*)?$/[_0x523e95(0x1fb)](_0x44844d))throw CliErrors[_0x523e95(0x1fa)](_0x523e95(0x1fe));const _0x4fa1e0=session['getStore']()?.[_0x523e95(0x212)]??resolveOrigin();if(!_0x5e5c91[_0x523e95(0x201)][_0x523e95(0x1fd)]())throw CliErrors['authRequired']();const _0x27eb0a=_0x5e5c91[_0x523e95(0x20f)]===undefined?undefined:JSON[_0x523e95(0x1f6)](_0x5e5c91[_0x523e95(0x20f)]);if(_0x27eb0a!==undefined&&Buffer[_0x523e95(0x210)](_0x27eb0a,'utf8')>MAX_BODY_BYTES)throw CliErrors[_0x523e95(0x1fa)]('Knowledge\x20management\x20request\x20exceeds\x20the\x2032\x20MiB\x20JSON\x20limit.\x20Keep\x20the\x20source\x20file\x20and\x20reduce\x20the\x20request\x20size.');const _0x13e05d=/\/(create|update|delete)$/[_0x523e95(0x1fb)](_0x44844d),_0x4ea346=new AbortController(),_0x1efb1f=_0x5e5c91[_0x523e95(0x1ec)]??session[_0x523e95(0x215)]()?.['signal'],_0x1c83ef=_0x1efb1f?AbortSignal['any']([_0x1efb1f,_0x4ea346[_0x523e95(0x1ec)]]):_0x4ea346['signal'];if(_0x1c83ef[_0x523e95(0x1e4)])throw CliErrors[_0x523e95(0x1e5)]('Knowledge\x20management\x20request\x20cancelled.');const _0x1435d7=setTimeout(()=>_0x4ea346['abort'](),0xea60);try{let _0x5c1b34;try{_0x5c1b34=await fetch(''+_0x4fa1e0+_0x44844d,{'method':_0x5e5c91[_0x523e95(0x21e)]??_0x523e95(0x20a),'redirect':_0x523e95(0x21f),'signal':_0x1c83ef,'headers':{'Content-Type':_0x523e95(0x218),'Cookie':_0x5e5c91[_0x523e95(0x201)],'X-Invoke-Source':_0x523e95(0x1f3),..._0x13e05d?{'X-CSRF-Token':_0x523e95(0x21d)}:{}},..._0x27eb0a===undefined?{}:{'body':_0x27eb0a}});}catch{throw new KbManagementError(_0x4ea346[_0x523e95(0x1ec)]['aborted']?_0x523e95(0x214):_0x523e95(0x1ea),!![]);}if(_0x5c1b34[_0x523e95(0x205)]===0x191)throw CliErrors[_0x523e95(0x200)]();const _0x5be6c7=()=>new KbManagementError(_0x523e95(0x1e6)+_0x5c1b34['status']+').',_0x5c1b34['ok']||_0x13e05d&&_0x5c1b34[_0x523e95(0x205)]>=0x1f4,undefined,_0x5c1b34[_0x523e95(0x205)]);if(!(_0x5c1b34[_0x523e95(0x21b)]['get'](_0x523e95(0x1f5))??'')[_0x523e95(0x1ff)]()[_0x523e95(0x1f1)](_0x523e95(0x218)))throw _0x5be6c7();let _0x1280d6;try{_0x1280d6=await _0x5c1b34[_0x523e95(0x202)]();}catch{throw _0x5be6c7();}if(!_0x1280d6||typeof _0x1280d6!=='object'||Array[_0x523e95(0x20b)](_0x1280d6))throw _0x5be6c7();const _0x4cae4a=_0x1280d6;if(typeof _0x4cae4a[_0x523e95(0x216)]!==_0x523e95(0x1eb)||typeof _0x4cae4a[_0x523e95(0x1ef)]!==_0x523e95(0x213)||!/^\d{1,8}$/[_0x523e95(0x1fb)](_0x4cae4a[_0x523e95(0x1ef)])||!Object[_0x523e95(0x1f4)](_0x4cae4a,_0x523e95(0x208))||_0x4cae4a['success']&&_0x4cae4a[_0x523e95(0x1ef)]!=='0000'||!_0x4cae4a['success']&&_0x4cae4a['errorCode']==='0000')throw _0x5be6c7();if(!_0x5c1b34['ok']||!_0x4cae4a['success'])throw new KbManagementError(_0x523e95(0x1e9)+_0x5c1b34['status']+').',![],_0x4cae4a[_0x523e95(0x1ef)],_0x5c1b34[_0x523e95(0x205)],_0x44844d===_0x523e95(0x211)&&_0x5c1b34['status']===0x19d&&_0x4cae4a[_0x523e95(0x1ef)]===_0x523e95(0x204)&&_0x4cae4a[_0x523e95(0x1fc)]===_0x523e95(0x1e8));return _0x4cae4a['data'];}finally{clearTimeout(_0x1435d7);}}
1
+ const a301_0x4a78f1=a301_0x31b2;(function(_0x65d9da,_0x3e68e0){const _0x2f1264=a301_0x31b2,_0x5833a4=_0x65d9da();while(!![]){try{const _0x5e325b=parseInt(_0x2f1264(0xb7))/0x1+-parseInt(_0x2f1264(0xcb))/0x2*(-parseInt(_0x2f1264(0xb6))/0x3)+parseInt(_0x2f1264(0xbb))/0x4*(parseInt(_0x2f1264(0xd4))/0x5)+parseInt(_0x2f1264(0xc5))/0x6+parseInt(_0x2f1264(0xc4))/0x7+parseInt(_0x2f1264(0xdb))/0x8*(-parseInt(_0x2f1264(0xc6))/0x9)+-parseInt(_0x2f1264(0xb0))/0xa;if(_0x5e325b===_0x3e68e0)break;else _0x5833a4['push'](_0x5833a4['shift']());}catch(_0x1086ab){_0x5833a4['push'](_0x5833a4['shift']());}}}(a301_0x1157,0x6858b));import{AsyncLocalStorage}from'node:async_hooks';import{getKbServiceDomain}from'../constant/domain.js';import{normalizeKbServiceOrigin}from'../core/kb-search-client.js';import{CliError,CliErrors}from'../errors.js';const MAX_BODY_BYTES=0x20*0x400*0x400,session=new AsyncLocalStorage();function a301_0x1157(){const _0x1db14d=['cookie','Configure\x20kbServiceDomain\x20with\x20a\x20trusted\x20HTTPS\x20origin\x20for\x20knowledge\x20management.','aborted','errorMsg','2745932zvZPkt','4638GVqEow','144TLUcIK','application/json','hasOwn','boolean','errorCode','8QUynyE','Knowledge\x20management\x20request\x20failed\x20(HTTP\x20','trim','includes','signal','get','test','body','pageTooLarge','5maMsey','content-type','validation','toLowerCase','method','any','/admin/knowledge-base/get-list','138064DnHVvu','Knowledge\x20management\x20request\x20exceeds\x20the\x2032\x20MiB\x20JSON\x20limit.\x20Keep\x20the\x20source\x20file\x20and\x20reduce\x20the\x20request\x20size.','status','Invalid\x20kbServiceDomain:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','kb-browser-v1','stringify','0000','isArray','Knowledge\x20management\x20request\x20failed\x20or\x20was\x20cancelled.','success','authRequired','transportFailure','API\x20error\x20code:\x20','defineProperty','getStore','105','cancelled','14419130Cwtwyu','utf8','origin','error','Knowledge\x20management\x20returned\x20an\x20invalid\x20response\x20(HTTP\x20','httpStatus','446511eaSnWj','602496NMQaFP','data','json','Knowledge\x20management\x20request\x20cancelled.','2218204gHtdrK','Invalid\x20knowledge\x20management\x20API\x20path.','Knowledge\x20management\x20request\x20timed\x20out.','run','LEGACY_LIST_TOO_LARGE'];a301_0x1157=function(){return _0x1db14d;};return a301_0x1157();}export class KbManagementError extends CliError{[a301_0x4a78f1(0xaa)];['remoteErrorCode'];[a301_0x4a78f1(0xb5)];[a301_0x4a78f1(0xd3)];constructor(_0x1a1ffd,_0x3a111d=![],_0x2e1028,_0x3fa607,_0x531425=![]){const _0x56c6b3=a301_0x4a78f1;super('api_error',0x1,_0x1a1ffd,_0x2e1028?_0x56c6b3(0xab)+_0x2e1028:undefined),this['transportFailure']=_0x3a111d,this['remoteErrorCode']=_0x2e1028,this[_0x56c6b3(0xb5)]=_0x3fa607,this[_0x56c6b3(0xd3)]=_0x531425;if(_0x2e1028)Object[_0x56c6b3(0xac)](this,_0x56c6b3(0xb8),{'value':{'remoteErrorCode':_0x2e1028},'enumerable':![]});}}function resolveOrigin(){const _0x863f2d=a301_0x4a78f1,_0x133b4d=getKbServiceDomain();if(!_0x133b4d)throw CliErrors[_0x863f2d(0xd6)](_0x863f2d(0xc1));try{return normalizeKbServiceOrigin(_0x133b4d);}catch{throw CliErrors[_0x863f2d(0xd6)](_0x863f2d(0xde));}}function a301_0x31b2(_0x158400,_0x2981a1){_0x158400=_0x158400-0xa7;const _0x1157d4=a301_0x1157();let _0x31b248=_0x1157d4[_0x158400];return _0x31b248;}export function withKbManagementSession(_0x7689c5,_0x59e56a){const _0x116a4e=a301_0x4a78f1;return session[_0x116a4e(0xbe)]({'origin':resolveOrigin(),'signal':_0x7689c5},_0x59e56a);}export async function kbManagementRequest(_0x468593,_0x11cc9a){const _0x1b496c=a301_0x4a78f1;if(!/^\/admin\/knowledge-base\/(get-list|get-one|create|update|delete)(\?[^#]*)?$/[_0x1b496c(0xd1)](_0x468593))throw CliErrors[_0x1b496c(0xd6)](_0x1b496c(0xbc));const _0xe66709=session[_0x1b496c(0xad)]()?.[_0x1b496c(0xb2)]??resolveOrigin();if(!_0x11cc9a[_0x1b496c(0xc0)][_0x1b496c(0xcd)]())throw CliErrors['authRequired']();const _0x4d65c5=_0x11cc9a[_0x1b496c(0xd2)]===undefined?undefined:JSON[_0x1b496c(0xe0)](_0x11cc9a[_0x1b496c(0xd2)]);if(_0x4d65c5!==undefined&&Buffer['byteLength'](_0x4d65c5,_0x1b496c(0xb1))>MAX_BODY_BYTES)throw CliErrors[_0x1b496c(0xd6)](_0x1b496c(0xdc));const _0x2beb58=/\/(create|update|delete)$/['test'](_0x468593),_0x3665cb=new AbortController(),_0x2e38aa=_0x11cc9a[_0x1b496c(0xcf)]??session[_0x1b496c(0xad)]()?.[_0x1b496c(0xcf)],_0x47c062=_0x2e38aa?AbortSignal[_0x1b496c(0xd9)]([_0x2e38aa,_0x3665cb[_0x1b496c(0xcf)]]):_0x3665cb['signal'];if(_0x47c062[_0x1b496c(0xc2)])throw CliErrors[_0x1b496c(0xaf)](_0x1b496c(0xba));const _0x192cb4=setTimeout(()=>_0x3665cb['abort'](),0xea60);try{let _0x5dfd90;try{_0x5dfd90=await fetch(''+_0xe66709+_0x468593,{'method':_0x11cc9a[_0x1b496c(0xd8)]??'GET','redirect':_0x1b496c(0xb3),'signal':_0x47c062,'headers':{'Content-Type':_0x1b496c(0xc7),'Cookie':_0x11cc9a['cookie'],'X-Invoke-Source':'cli:rabetbase',..._0x2beb58?{'X-CSRF-Token':_0x1b496c(0xdf)}:{}},..._0x4d65c5===undefined?{}:{'body':_0x4d65c5}});}catch{throw new KbManagementError(_0x3665cb[_0x1b496c(0xcf)][_0x1b496c(0xc2)]?_0x1b496c(0xbd):_0x1b496c(0xa7),!![]);}if(_0x5dfd90[_0x1b496c(0xdd)]===0x191)throw CliErrors[_0x1b496c(0xa9)]();const _0x133635=()=>new KbManagementError(_0x1b496c(0xb4)+_0x5dfd90[_0x1b496c(0xdd)]+').',_0x5dfd90['ok']||_0x2beb58&&_0x5dfd90[_0x1b496c(0xdd)]>=0x1f4,undefined,_0x5dfd90[_0x1b496c(0xdd)]);if(!(_0x5dfd90['headers'][_0x1b496c(0xd0)](_0x1b496c(0xd5))??'')[_0x1b496c(0xd7)]()[_0x1b496c(0xce)](_0x1b496c(0xc7)))throw _0x133635();let _0x12483f;try{_0x12483f=await _0x5dfd90[_0x1b496c(0xb9)]();}catch{throw _0x133635();}if(!_0x12483f||typeof _0x12483f!=='object'||Array[_0x1b496c(0xe2)](_0x12483f))throw _0x133635();const _0x376bd2=_0x12483f;if(typeof _0x376bd2[_0x1b496c(0xa8)]!==_0x1b496c(0xc9)||typeof _0x376bd2['errorCode']!=='string'||!/^\d{1,8}$/[_0x1b496c(0xd1)](_0x376bd2[_0x1b496c(0xca)])||!Object[_0x1b496c(0xc8)](_0x376bd2,_0x1b496c(0xb8))||_0x376bd2[_0x1b496c(0xa8)]&&_0x376bd2[_0x1b496c(0xca)]!==_0x1b496c(0xe1)||!_0x376bd2[_0x1b496c(0xa8)]&&_0x376bd2[_0x1b496c(0xca)]==='0000')throw _0x133635();if(!_0x5dfd90['ok']||!_0x376bd2[_0x1b496c(0xa8)])throw new KbManagementError(_0x1b496c(0xcc)+_0x5dfd90[_0x1b496c(0xdd)]+').',![],_0x376bd2[_0x1b496c(0xca)],_0x5dfd90[_0x1b496c(0xdd)],_0x468593===_0x1b496c(0xda)&&_0x5dfd90[_0x1b496c(0xdd)]===0x19d&&_0x376bd2[_0x1b496c(0xca)]===_0x1b496c(0xae)&&_0x376bd2[_0x1b496c(0xc3)]===_0x1b496c(0xbf));return _0x376bd2['data'];}finally{clearTimeout(_0x192cb4);}}