@lovrabet/rabetbase-cli 2.5.6 → 2.5.7

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 (395) 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.d.ts +2 -0
  132. package/lib/commands/flow/page-list.js +1 -0
  133. package/lib/commands/flow/publish.js +1 -1
  134. package/lib/commands/flow/runtime-resources-shared.d.ts +1 -1
  135. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  136. package/lib/commands/flow/runtime-role-list.js +1 -1
  137. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  138. package/lib/commands/flow/runtime-user-search.js +1 -1
  139. package/lib/commands/flow/shared.d.ts +6 -2
  140. package/lib/commands/flow/shared.js +1 -1
  141. package/lib/commands/flow/update.js +1 -1
  142. package/lib/commands/flow/validate.js +1 -1
  143. package/lib/commands/instant-api-policy/current.js +1 -1
  144. package/lib/commands/instant-api-policy/index.js +1 -1
  145. package/lib/commands/instant-api-policy/init.js +1 -1
  146. package/lib/commands/instant-api-policy/publish.js +1 -1
  147. package/lib/commands/instant-api-policy/pull.js +1 -1
  148. package/lib/commands/instant-api-policy/revision.js +1 -1
  149. package/lib/commands/instant-api-policy/revisions.js +1 -1
  150. package/lib/commands/instant-api-policy/rollback.js +1 -1
  151. package/lib/commands/instant-api-policy/shared.js +1 -1
  152. package/lib/commands/instant-api-policy/validate.js +1 -1
  153. package/lib/commands/issue/index.js +1 -1
  154. package/lib/commands/issue/nudge.js +1 -1
  155. package/lib/commands/issue/report.js +1 -1
  156. package/lib/commands/issue/shared.js +1 -1
  157. package/lib/commands/kb/create.js +1 -1
  158. package/lib/commands/kb/delete.js +1 -1
  159. package/lib/commands/kb/detail.js +1 -1
  160. package/lib/commands/kb/index.js +1 -1
  161. package/lib/commands/kb/list.js +1 -1
  162. package/lib/commands/kb/search.js +1 -1
  163. package/lib/commands/kb/shared.js +1 -1
  164. package/lib/commands/kb/update.js +1 -1
  165. package/lib/commands/logs/index.js +1 -1
  166. package/lib/commands/menu/asset-update.js +1 -1
  167. package/lib/commands/menu/delete.js +1 -1
  168. package/lib/commands/menu/external-link-create.js +1 -1
  169. package/lib/commands/menu/external-link-update.js +1 -1
  170. package/lib/commands/menu/group-create.js +1 -1
  171. package/lib/commands/menu/group-update.js +1 -1
  172. package/lib/commands/menu/index.js +1 -1
  173. package/lib/commands/menu/list.js +1 -1
  174. package/lib/commands/menu/move.js +1 -1
  175. package/lib/commands/menu/regroup-start.js +1 -1
  176. package/lib/commands/menu/rename.js +1 -1
  177. package/lib/commands/menu/shared/compare-table.js +1 -1
  178. package/lib/commands/menu/shared/delete-plan.js +1 -1
  179. package/lib/commands/menu/shared/facts.js +1 -1
  180. package/lib/commands/menu/shared/index.js +1 -1
  181. package/lib/commands/menu/shared/inquirer.js +1 -1
  182. package/lib/commands/menu/shared/local-pages.js +1 -1
  183. package/lib/commands/menu/shared/logic.js +1 -1
  184. package/lib/commands/menu/shared/mutations.js +1 -1
  185. package/lib/commands/menu/shared/path.js +1 -1
  186. package/lib/commands/menu/shared/service.js +1 -1
  187. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  188. package/lib/commands/menu/shared/sync-core.js +1 -1
  189. package/lib/commands/menu/shared/update-core.js +1 -1
  190. package/lib/commands/menu/shared/valid-url.js +1 -1
  191. package/lib/commands/menu/subapp-assets-status.js +1 -1
  192. package/lib/commands/menu/subapp-assets-update.js +1 -1
  193. package/lib/commands/menu/sync.js +1 -1
  194. package/lib/commands/menu/visibility-update.js +1 -1
  195. package/lib/commands/notification/config-create.js +1 -1
  196. package/lib/commands/notification/config-delete.js +1 -1
  197. package/lib/commands/notification/config-list.js +1 -1
  198. package/lib/commands/notification/config-update.js +1 -1
  199. package/lib/commands/notification/index.js +1 -1
  200. package/lib/commands/notification/shared.js +1 -1
  201. package/lib/commands/ocr/index.js +1 -1
  202. package/lib/commands/page/create.js +1 -1
  203. package/lib/commands/page/custom/detail.js +1 -1
  204. package/lib/commands/page/custom/list.js +1 -1
  205. package/lib/commands/page/custom/publish.js +1 -1
  206. package/lib/commands/page/custom/shared.js +1 -1
  207. package/lib/commands/page/custom/syntax.js +1 -1
  208. package/lib/commands/page/custom/update.js +1 -1
  209. package/lib/commands/page/data-list-status.js +1 -1
  210. package/lib/commands/page/generate-start.js +1 -1
  211. package/lib/commands/page/generate-status.js +1 -1
  212. package/lib/commands/page/index.js +1 -1
  213. package/lib/commands/page/pull.js +1 -1
  214. package/lib/commands/page/push.js +1 -1
  215. package/lib/commands/page/relation-audit.js +1 -1
  216. package/lib/commands/page/restore.js +1 -1
  217. package/lib/commands/page/shared.js +1 -1
  218. package/lib/commands/page/sync.js +1 -1
  219. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  220. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  221. package/lib/commands/project/create/format-elapsed.js +1 -1
  222. package/lib/commands/project/create/main.js +1 -1
  223. package/lib/commands/project/create/materialize-project-template.js +1 -1
  224. package/lib/commands/project/create/project-name.js +1 -1
  225. package/lib/commands/project/create/project-template-archive.js +1 -1
  226. package/lib/commands/project/create/project-template-path.js +1 -1
  227. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  228. package/lib/commands/project/create/use-format-code.js +1 -1
  229. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  230. package/lib/commands/project/domain-routing-sync.js +1 -1
  231. package/lib/commands/project/index.js +1 -1
  232. package/lib/commands/project/upgrade.js +1 -1
  233. package/lib/commands/registry.js +1 -1
  234. package/lib/commands/role/delete.js +1 -1
  235. package/lib/commands/role/detail.js +1 -1
  236. package/lib/commands/role/index.js +1 -1
  237. package/lib/commands/role/list.js +1 -1
  238. package/lib/commands/role/shared.js +1 -1
  239. package/lib/commands/role/update.js +1 -1
  240. package/lib/commands/role/user-add.js +1 -1
  241. package/lib/commands/role/user-remove.js +1 -1
  242. package/lib/commands/role/user-resolve.js +1 -1
  243. package/lib/commands/rule/get.js +1 -1
  244. package/lib/commands/rule/index.js +1 -1
  245. package/lib/commands/rule/list.js +1 -1
  246. package/lib/commands/rule/set.js +1 -1
  247. package/lib/commands/rule/shared.js +1 -1
  248. package/lib/commands/run/index.js +1 -1
  249. package/lib/commands/schema.js +1 -1
  250. package/lib/commands/sql/create.js +1 -1
  251. package/lib/commands/sql/delete.js +1 -1
  252. package/lib/commands/sql/detail.js +1 -1
  253. package/lib/commands/sql/exec.js +1 -1
  254. package/lib/commands/sql/index.js +1 -1
  255. package/lib/commands/sql/list.js +1 -1
  256. package/lib/commands/sql/pull.js +1 -1
  257. package/lib/commands/sql/push.js +1 -1
  258. package/lib/commands/sql/shared.js +1 -1
  259. package/lib/commands/sql/status.js +1 -1
  260. package/lib/commands/sql/validate.js +1 -1
  261. package/lib/commands/task/index.js +1 -1
  262. package/lib/commands/task/status.js +1 -1
  263. package/lib/commands/tenant/index.js +1 -1
  264. package/lib/commands/tenant/members-list.js +1 -1
  265. package/lib/commands/tenant/shared.js +1 -1
  266. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  267. package/lib/commands/user-account/feishu-bind.js +1 -1
  268. package/lib/commands/user-account/index.js +1 -1
  269. package/lib/commands/workspace/add.js +1 -1
  270. package/lib/commands/workspace/index.js +1 -1
  271. package/lib/commands/workspace/remove.js +1 -1
  272. package/lib/config/domain-config.js +1 -1
  273. package/lib/config/project-domain-routing.js +1 -1
  274. package/lib/config/region-config.js +1 -1
  275. package/lib/config/schema.js +1 -1
  276. package/lib/constant/cdn.js +1 -1
  277. package/lib/constant/cli.js +1 -1
  278. package/lib/constant/defaults.js +1 -1
  279. package/lib/constant/domain.js +1 -1
  280. package/lib/constant/env.js +1 -1
  281. package/lib/constant/output.js +1 -1
  282. package/lib/constant/paths.js +1 -1
  283. package/lib/constant/region.js +1 -1
  284. package/lib/constant/risk.js +1 -1
  285. package/lib/constant/routing-profile.js +1 -1
  286. package/lib/context/app-resolver.js +1 -1
  287. package/lib/context/auth-resolver.js +1 -1
  288. package/lib/context/config-loader.js +1 -1
  289. package/lib/context.js +1 -1
  290. package/lib/core/alias-resolver.js +1 -1
  291. package/lib/core/api-client.d.ts +26 -6
  292. package/lib/core/api-client.js +1 -1
  293. package/lib/core/bff/config.js +1 -1
  294. package/lib/core/bff/file-system.js +1 -1
  295. package/lib/core/bff/hash.js +1 -1
  296. package/lib/core/bff/hook-directory.js +1 -1
  297. package/lib/core/bff/lock.js +1 -1
  298. package/lib/core/bff/utils.js +1 -1
  299. package/lib/core/cross-db-analysis.js +1 -1
  300. package/lib/core/cross-db-relation.js +1 -1
  301. package/lib/core/db-resolver.js +1 -1
  302. package/lib/core/flow-config.d.ts +12 -0
  303. package/lib/core/flow-config.js +1 -1
  304. package/lib/core/instant-api-policy/config.js +1 -1
  305. package/lib/core/kb-search-client.js +1 -1
  306. package/lib/core/page/file-system.js +1 -1
  307. package/lib/core/page/hash.js +1 -1
  308. package/lib/core/page/lock.js +1 -1
  309. package/lib/core/page/lr-smart-jsx.js +1 -1
  310. package/lib/core/sql-index-auditor.js +1 -1
  311. package/lib/core/sql-sync/config.js +1 -1
  312. package/lib/core/sql-sync/file-system.js +1 -1
  313. package/lib/core/sql-sync/hash.js +1 -1
  314. package/lib/core/sql-sync/lock.js +1 -1
  315. package/lib/core/sql-sync/utils.js +1 -1
  316. package/lib/core/sql-validator.js +1 -1
  317. package/lib/errors.js +1 -1
  318. package/lib/framework/build-all-flags.js +1 -1
  319. package/lib/framework/error-output.js +1 -1
  320. package/lib/framework/explicit-yes.js +1 -1
  321. package/lib/framework/flags.js +1 -1
  322. package/lib/framework/help.js +1 -1
  323. package/lib/framework/index.js +1 -1
  324. package/lib/framework/output.js +1 -1
  325. package/lib/framework/response.js +1 -1
  326. package/lib/framework/runner-alias.js +1 -1
  327. package/lib/framework/runner.js +1 -1
  328. package/lib/framework/schema-export.js +1 -1
  329. package/lib/framework/supported-flags.js +1 -1
  330. package/lib/framework/types.js +1 -1
  331. package/lib/generated/build-info.d.ts +4 -4
  332. package/lib/generated/build-info.js +1 -1
  333. package/lib/generated/official-routing.js +1 -1
  334. package/lib/generated/routing-contract.js +1 -1
  335. package/lib/help.js +1 -1
  336. package/lib/postinstall.js +1 -1
  337. package/lib/runtime/confirmation.js +1 -1
  338. package/lib/runtime/event.js +1 -1
  339. package/lib/runtime/index.js +1 -1
  340. package/lib/runtime/queue.js +1 -1
  341. package/lib/runtime/resolve.js +1 -1
  342. package/lib/services/dataset-design/checkpoint.js +1 -1
  343. package/lib/services/dataset-design/commands.js +1 -1
  344. package/lib/services/dataset-design/contract.js +1 -1
  345. package/lib/skills/builtin-skill.js +1 -1
  346. package/lib/skills/main.js +1 -1
  347. package/lib/skills/npx-skills-add.js +1 -1
  348. package/lib/skills/skill-presence.js +1 -1
  349. package/lib/telemetry/cli-command-trace.js +1 -1
  350. package/lib/telemetry/cli-help-trace.js +1 -1
  351. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  352. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  353. package/lib/telemetry/send-cli-trace-log.js +1 -1
  354. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  355. package/lib/utils/ai_config.js +1 -1
  356. package/lib/utils/apply-jq-filter.js +1 -1
  357. package/lib/utils/cdn-config.js +1 -1
  358. package/lib/utils/check-sdk-version.js +1 -1
  359. package/lib/utils/cli-version-check.js +1 -1
  360. package/lib/utils/cli-version-policy.js +1 -1
  361. package/lib/utils/config.js +1 -1
  362. package/lib/utils/entity-with-id.js +1 -1
  363. package/lib/utils/file-utils.js +1 -1
  364. package/lib/utils/guides-cdn.js +1 -1
  365. package/lib/utils/http-client.js +1 -1
  366. package/lib/utils/is-non-interactive.js +1 -1
  367. package/lib/utils/logger.js +1 -1
  368. package/lib/utils/params.js +1 -1
  369. package/lib/utils/platform.js +1 -1
  370. package/lib/utils/sleep.js +1 -1
  371. package/lib/utils/template-replacer.js +1 -1
  372. package/lib/utils/update-notice.js +1 -1
  373. package/lib/utils/version.js +1 -1
  374. package/lib/utils/with-active-cookie.js +1 -1
  375. package/lib/utils/write-cli-side-channel.js +1 -1
  376. package/package.json +1 -1
  377. package/skills/rabetbase/SKILL.md +8 -4
  378. package/skills/rabetbase/guides/approval-flow-development-workflow.md +52 -13
  379. package/skills/rabetbase/guides/backend-function.md +26 -4
  380. package/skills/rabetbase/guides/bff-creation-workflow.md +9 -0
  381. package/skills/rabetbase/guides/cross-database-bff.md +1 -0
  382. package/skills/rabetbase/guides/custom-page-flow-sdk.md +2 -0
  383. package/skills/rabetbase/guides/data-api-guidelines.md +2 -0
  384. package/skills/rabetbase/guides/flow-config-examples.md +75 -0
  385. package/skills/rabetbase/guides/form-flow-start.md +61 -0
  386. package/skills/rabetbase/guides/typescript-sdk.md +1 -1
  387. package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +18 -4
  388. package/skills/rabetbase/references/rabetbase-codegen-sdk.md +5 -4
  389. package/skills/rabetbase/references/rabetbase-flow-commands.md +21 -2
  390. package/skills/rabetbase/references/rabetbase-flow-resources.md +21 -3
  391. package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +6 -2
  392. package/skills/rabetbase/references/rabetbase-kb.md +4 -1
  393. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  394. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  395. package/skills/rabetbase.manifest.json +5 -3
@@ -1 +1 @@
1
- const a298_0x4ad4d2=a298_0x3720;(function(_0x2b8bee,_0x19d835){const _0xba3adf=a298_0x3720,_0x56c00e=_0x2b8bee();while(!![]){try{const _0x44b375=parseInt(_0xba3adf(0x21c))/0x1+parseInt(_0xba3adf(0x250))/0x2*(parseInt(_0xba3adf(0x2c2))/0x3)+parseInt(_0xba3adf(0x222))/0x4+-parseInt(_0xba3adf(0x31f))/0x5+-parseInt(_0xba3adf(0x2a6))/0x6*(-parseInt(_0xba3adf(0x30a))/0x7)+parseInt(_0xba3adf(0x290))/0x8*(parseInt(_0xba3adf(0x311))/0x9)+-parseInt(_0xba3adf(0x23d))/0xa;if(_0x44b375===_0x19d835)break;else _0x56c00e['push'](_0x56c00e['shift']());}catch(_0x1da0ee){_0x56c00e['push'](_0x56c00e['shift']());}}}(a298_0x36ad,0xa10f9));function a298_0x3720(_0x5b4d10,_0x812e99){_0x5b4d10=_0x5b4d10-0x1c4;const _0x36ad8f=a298_0x36ad();let _0x372089=_0x36ad8f[_0x5b4d10];return _0x372089;}import{randomUUID}from'node:crypto';import{chmod,link,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{resolve}from'node:path';export const FLOW_CONFIG_JSON_SCHEMA={'$schema':a298_0x4ad4d2(0x24f),'$id':'https://lovrabet.com/schema/rabetbase-flow-config.json','title':a298_0x4ad4d2(0x276),'type':a298_0x4ad4d2(0x224),'required':['flowName',a298_0x4ad4d2(0x26a),a298_0x4ad4d2(0x2f9)],'$defs':{'userId':{'anyOf':[{'type':a298_0x4ad4d2(0x283),'minLength':0x1},{'type':a298_0x4ad4d2(0x2cf),'minimum':0x1}]},'position':{'type':a298_0x4ad4d2(0x224),'required':['x','y'],'properties':{'x':{'type':a298_0x4ad4d2(0x292),'minimum':0x0},'y':{'type':a298_0x4ad4d2(0x292),'minimum':0x0}},'additionalProperties':!![]},'timeAmount':{'type':a298_0x4ad4d2(0x224),'required':[a298_0x4ad4d2(0x285),'unit'],'properties':{'value':{'type':a298_0x4ad4d2(0x2cf),'minimum':0x1},'unit':{'enum':[a298_0x4ad4d2(0x22c),a298_0x4ad4d2(0x1f3),a298_0x4ad4d2(0x2b1),a298_0x4ad4d2(0x1d5)]}},'additionalProperties':!![]},'flowNode':{'type':'object','required':['id',a298_0x4ad4d2(0x2f2),a298_0x4ad4d2(0x1c5),'position'],'properties':{'id':{'type':a298_0x4ad4d2(0x283),'pattern':a298_0x4ad4d2(0x2ab)},'type':{'enum':[a298_0x4ad4d2(0x238),a298_0x4ad4d2(0x1e2),'APPROVAL',a298_0x4ad4d2(0x2e3),a298_0x4ad4d2(0x212),'NOTIFICATION']},'name':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'path':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'position':{'$ref':'#/$defs/position'},'approvalMode':{'enum':[a298_0x4ad4d2(0x260),a298_0x4ad4d2(0x229),'ANY']},'taskMode':{'enum':[a298_0x4ad4d2(0x26c),'HANDLE']},'assignee':{'type':a298_0x4ad4d2(0x224),'required':[a298_0x4ad4d2(0x1f4)],'properties':{'strategy':{'enum':[a298_0x4ad4d2(0x24b),a298_0x4ad4d2(0x314)]},'userIds':{'type':'array','minItems':0x1,'items':{'$ref':a298_0x4ad4d2(0x2f4)}},'roleId':{'anyOf':[{'type':a298_0x4ad4d2(0x2cf),'minimum':0x1},{'type':a298_0x4ad4d2(0x283),'pattern':a298_0x4ad4d2(0x2fb)}]}},'additionalProperties':!![]},'transferCandidates':{'type':'object','required':[a298_0x4ad4d2(0x1f4),a298_0x4ad4d2(0x26e)],'properties':{'strategy':{'const':a298_0x4ad4d2(0x24b)},'userIds':{'type':a298_0x4ad4d2(0x1dc),'minItems':0x1,'items':{'$ref':a298_0x4ad4d2(0x2f4)}}},'additionalProperties':!![]},'sequential':{'type':a298_0x4ad4d2(0x1ee)},'result':{'enum':[a298_0x4ad4d2(0x261),a298_0x4ad4d2(0x21f)]},'scriptName':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'resultVariable':{'type':a298_0x4ad4d2(0x283),'pattern':a298_0x4ad4d2(0x2ab)},'async':{'type':a298_0x4ad4d2(0x224),'properties':{'enabled':{'type':a298_0x4ad4d2(0x1ee)},'retryCount':{'type':a298_0x4ad4d2(0x2cf),'minimum':0x1,'maximum':0xa},'retryInterval':{'$ref':'#/$defs/timeAmount'}},'additionalProperties':!![]},'timeout':{'type':a298_0x4ad4d2(0x224),'properties':{'enabled':{'type':'boolean'},'duration':{'$ref':a298_0x4ad4d2(0x319)},'action':{'enum':[a298_0x4ad4d2(0x235),'AUTO_REJECT','EXECUTE_BFF']},'interrupting':{'type':a298_0x4ad4d2(0x1ee)},'scriptName':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'resultVariable':{'type':'string','pattern':a298_0x4ad4d2(0x2ab)}},'additionalProperties':!![]},'cc':{'type':a298_0x4ad4d2(0x224),'required':[a298_0x4ad4d2(0x1e9)],'properties':{'recipientUserIds':{'type':a298_0x4ad4d2(0x1dc),'minItems':0x1,'maxItems':0x64,'uniqueItems':!![],'items':{'type':a298_0x4ad4d2(0x283),'minLength':0x1}},'visible':{'type':a298_0x4ad4d2(0x1dc),'uniqueItems':!![],'items':{'type':a298_0x4ad4d2(0x283),'minLength':0x1}},'readSources':![]},'additionalProperties':!![]},'config':{'type':a298_0x4ad4d2(0x224),'required':[a298_0x4ad4d2(0x255),a298_0x4ad4d2(0x2d3)],'properties':{'version':{'enum':['v1']},'configCode':{'type':'string','minLength':0x1},'failurePolicy':{'enum':[a298_0x4ad4d2(0x1e5),a298_0x4ad4d2(0x2ec)]},'template':{'type':a298_0x4ad4d2(0x224),'required':[a298_0x4ad4d2(0x31c),a298_0x4ad4d2(0x2a1)],'properties':{'title':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'summary':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'detailMarkdown':{'type':'string'},'facts':{'type':a298_0x4ad4d2(0x1dc),'maxItems':0x8,'items':{'type':'object','required':[a298_0x4ad4d2(0x1f6),a298_0x4ad4d2(0x285)],'properties':{'label':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'value':{'type':a298_0x4ad4d2(0x283),'minLength':0x1}},'additionalProperties':!![]}},'actions':{'type':a298_0x4ad4d2(0x1dc),'maxItems':0x2,'items':{'type':a298_0x4ad4d2(0x224),'required':['text',a298_0x4ad4d2(0x320)],'properties':{'text':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'url':{'type':a298_0x4ad4d2(0x283),'minLength':0x1}},'additionalProperties':!![]}}},'additionalProperties':!![]},'recipients':{'type':a298_0x4ad4d2(0x1dc),'items':{'type':a298_0x4ad4d2(0x224),'required':[a298_0x4ad4d2(0x2f2),a298_0x4ad4d2(0x285)],'properties':{'type':{'enum':['USER',a298_0x4ad4d2(0x314),a298_0x4ad4d2(0x259)]},'value':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'role':{'enum':['TO','CC',a298_0x4ad4d2(0x2a2)]}},'additionalProperties':!![]}}},'additionalProperties':!![]},'form':![],'formPermission':![]},'additionalProperties':!![]},'flowEdge':{'type':'object','properties':{'id':{'type':a298_0x4ad4d2(0x283),'pattern':a298_0x4ad4d2(0x2ab)},'source':{'type':'string','minLength':0x1},'target':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'sourceNodeId':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'targetNodeId':{'type':'string','minLength':0x1},'conditionType':{'enum':[a298_0x4ad4d2(0x232),'APPROVED',a298_0x4ad4d2(0x21f),a298_0x4ad4d2(0x29c)]},'expression':{'type':'string'},'defaultFlow':{'type':'boolean'},'name':{'type':a298_0x4ad4d2(0x283)},'waypoints':{'type':a298_0x4ad4d2(0x1dc),'items':{'$ref':a298_0x4ad4d2(0x1de)}}},'allOf':[{'anyOf':[{'required':[a298_0x4ad4d2(0x2f8)]},{'required':[a298_0x4ad4d2(0x301)]}]},{'anyOf':[{'required':[a298_0x4ad4d2(0x2c1)]},{'required':[a298_0x4ad4d2(0x28a)]}]}],'additionalProperties':!![]}},'properties':{'id':![],'appCode':![],'flowName':{'type':'string','minLength':0x1},'flowDesc':{'type':a298_0x4ad4d2(0x283)},'flowType':{'enum':[a298_0x4ad4d2(0x1f5),'INDEPENDENT_FLOW']},'datasetCode':{'type':a298_0x4ad4d2(0x283),'minLength':0x1},'pageId':{'type':a298_0x4ad4d2(0x2cf)},'templateName':![],'flowJson':{'type':a298_0x4ad4d2(0x224),'required':[a298_0x4ad4d2(0x277),a298_0x4ad4d2(0x1c6)],'properties':{'flowKey':![],'flowCode':![],'flowName':![],'bindDatasetCode':![],'datasetCode':![],'appCode':![],'pageId':![],'templateName':![],'schemaVersion':{'type':a298_0x4ad4d2(0x283),'const':a298_0x4ad4d2(0x2ee),'description':a298_0x4ad4d2(0x244)},'formSchema':![],'formDefinitions':![],'formPermissions':![],'pageMode':{'const':a298_0x4ad4d2(0x2ed)},'startPageId':![],'startPath':{'type':'string','minLength':0x1},'nodes':{'type':a298_0x4ad4d2(0x1dc),'minItems':0x1,'items':{'$ref':'#/$defs/flowNode'}},'edges':{'type':a298_0x4ad4d2(0x1dc),'minItems':0x1,'items':{'$ref':a298_0x4ad4d2(0x293)}}},'additionalProperties':!![]}},'additionalProperties':!![]};const REMOVED_FLOW_JSON_FIELDS=[a298_0x4ad4d2(0x1ef),'flowCode',a298_0x4ad4d2(0x28e),'bindDatasetCode',a298_0x4ad4d2(0x1fa),a298_0x4ad4d2(0x209),a298_0x4ad4d2(0x1e4),a298_0x4ad4d2(0x223)],REMOVED_ROOT_FIELDS=['id','appCode','templateName'],DEFAULT_FLOW_SCHEMA_VERSION=a298_0x4ad4d2(0x2ee),NODE_TYPES=new Set([a298_0x4ad4d2(0x238),'END',a298_0x4ad4d2(0x26c),'CONDITION','SCRIPT',a298_0x4ad4d2(0x2bc)]),CONDITION_TYPES=new Set([a298_0x4ad4d2(0x232),'APPROVED',a298_0x4ad4d2(0x21f),a298_0x4ad4d2(0x29c)]),APPROVAL_MODES=new Set([a298_0x4ad4d2(0x260),a298_0x4ad4d2(0x229),'ANY']),APPROVAL_TASK_MODES=new Set(['APPROVAL',a298_0x4ad4d2(0x308)]),FLOW_TIME_UNITS=new Set([a298_0x4ad4d2(0x22c),'MINUTES',a298_0x4ad4d2(0x2b1),a298_0x4ad4d2(0x1d5)]),APPROVAL_TIMEOUT_ACTIONS=new Set(['AUTO_APPROVE',a298_0x4ad4d2(0x2ff),a298_0x4ad4d2(0x299)]),FLOW_TYPES=new Set([a298_0x4ad4d2(0x1f5),a298_0x4ad4d2(0x2af)]),FLOW_PAGE_MODES=new Set([a298_0x4ad4d2(0x2ed),'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([a298_0x4ad4d2(0x1e5),a298_0x4ad4d2(0x2ec)]),NOTIFICATION_RECIPIENT_TYPES=new Set([a298_0x4ad4d2(0x270),a298_0x4ad4d2(0x314),'EMAIL']),NOTIFICATION_RECIPIENT_ROLES=new Set(['TO','CC',a298_0x4ad4d2(0x2a2)]),MAX_NOTIFICATION_FACTS=0x8,MAX_NOTIFICATION_ACTIONS=0x2,MAX_ASYNC_RETRY_COUNT=0xa,MAX_CC_RECIPIENTS=0x64,DEFAULT_SCRIPT_RESULT_VARIABLE=a298_0x4ad4d2(0x210),UNSUPPORTED_FORM_MESSAGE='Custom\x20form\x20configuration\x20is\x20not\x20supported\x20by\x20this\x20rabetbase\x20version;\x20use\x20a\x20business\x20custom\x20page\x20instead.',UNSUPPORTED_PLATFORM_FORM_MESSAGE=a298_0x4ad4d2(0x202),RESERVED_RESULT_VARIABLES=new Set([a298_0x4ad4d2(0x240),'approved','approval_sys_appCode',a298_0x4ad4d2(0x23c),'approval_sys_initiatorUserId',a298_0x4ad4d2(0x29b),'approval_sys_datasetCode',a298_0x4ad4d2(0x2ac),a298_0x4ad4d2(0x20e),a298_0x4ad4d2(0x1f0)]);export function normalizeFlowConfig(_0x2087d4){const _0x346617=a298_0x4ad4d2;if(!isRecord(_0x2087d4))throw new TypeError(_0x346617(0x20f));const _0x440749=cloneJsonValue(_0x2087d4),_0x7c8d62=_0x440749[_0x346617(0x2f9)],_0x54795c=isRecord(_0x7c8d62)?cloneJsonValue(_0x7c8d62):{},_0x18a7be=[],_0x392dd2=[];for(const _0x30930e of REMOVED_ROOT_FIELDS){if(!Object['prototype']['hasOwnProperty'][_0x346617(0x268)](_0x440749,_0x30930e))continue;delete _0x440749[_0x30930e],_0x392dd2[_0x346617(0x28c)](_0x30930e),_0x18a7be[_0x346617(0x28c)]({'code':_0x346617(0x2c6),'path':_0x30930e,'message':_0x30930e+'\x20is\x20not\x20part\x20of\x20the\x20portable\x20FlowConfig\x20and\x20was\x20removed.'});}for(const _0x425c4b of REMOVED_FLOW_JSON_FIELDS){if(!Object[_0x346617(0x2e4)]['hasOwnProperty'][_0x346617(0x268)](_0x54795c,_0x425c4b))continue;const _0x34dfa6=_0x346617(0x304)+_0x425c4b;delete _0x54795c[_0x425c4b],_0x392dd2[_0x346617(0x28c)](_0x34dfa6),_0x18a7be[_0x346617(0x28c)]({'code':_0x346617(0x2c6),'path':_0x34dfa6,'message':_0x34dfa6+'\x20is\x20not\x20part\x20of\x20the\x20portable\x20FlowConfig\x20and\x20was\x20removed.'});}if(Object[_0x346617(0x2e4)]['hasOwnProperty']['call'](_0x54795c,_0x346617(0x1f9))){const _0xd88b92=_0x54795c['schemaVersion'],_0x3fd199=typeof _0xd88b92===_0x346617(0x283)?_0xd88b92[_0x346617(0x2e1)]():_0xd88b92;if(isEmptyJsonValue(_0xd88b92)||_0x3fd199===DEFAULT_FLOW_SCHEMA_VERSION){const _0x2934cd=_0x346617(0x22d);delete _0x54795c[_0x346617(0x1f9)],_0x392dd2[_0x346617(0x28c)](_0x2934cd),_0x18a7be[_0x346617(0x28c)]({'code':'legacy_field_removed','path':_0x2934cd,'message':_0x2934cd+_0x346617(0x21d)+DEFAULT_FLOW_SCHEMA_VERSION+'\x20value\x20and\x20was\x20removed\x20from\x20the\x20portable\x20FlowConfig.'});}}removeEmptyMetadata(_0x54795c,_0x346617(0x2f9),_0x18a7be,_0x392dd2);_0x440749['flowType']===_0x346617(0x2af)&&!Object[_0x346617(0x2e4)][_0x346617(0x26f)][_0x346617(0x268)](_0x54795c,_0x346617(0x258))&&(_0x54795c[_0x346617(0x258)]=_0x346617(0x2ed));_0x440749[_0x346617(0x2f9)]=_0x54795c;if(typeof _0x440749[_0x346617(0x28e)]==='string')_0x440749[_0x346617(0x28e)]=_0x440749[_0x346617(0x28e)]['trim']();return{'config':_0x440749,'warnings':_0x18a7be,'removedPaths':_0x392dd2};}export function validateFlowConfig(_0x2f2eb7){const _0x315ff3=a298_0x4ad4d2;let _0x367ac1;try{_0x367ac1=normalizeFlowConfig(_0x2f2eb7);}catch(_0x2d4e8e){const _0x5a5ed0=_0x2d4e8e instanceof Error?_0x2d4e8e[_0x315ff3(0x2e5)]:String(_0x2d4e8e),_0x466934={'flowJson':{}};return{'valid':![],'errors':[{'path':'$','message':_0x5a5ed0}],'warnings':[],'normalized':_0x466934,'validationConfig':_0x466934};}const _0xeca9b2=_0x367ac1[_0x315ff3(0x2a7)],_0x547d72=cloneJsonValue(_0xeca9b2),_0x30321d=_0x547d72[_0x315ff3(0x2f9)];_0x30321d[_0x315ff3(0x1ef)]=_0x315ff3(0x281),_0x30321d['flowName']=_0xeca9b2[_0x315ff3(0x28e)];typeof _0xeca9b2[_0x315ff3(0x1fa)]==='string'&&_0xeca9b2['datasetCode'][_0x315ff3(0x2e1)]()&&(_0x30321d[_0x315ff3(0x287)]=_0xeca9b2[_0x315ff3(0x1fa)][_0x315ff3(0x2e1)]());const _0x3f86da=[];return validateOuterMetadata(_0xeca9b2,_0x3f86da),validateFlowClassification(_0xeca9b2,_0x3f86da),validateGraph(_0xeca9b2[_0x315ff3(0x2f9)],_0x3f86da),{'valid':_0x3f86da[_0x315ff3(0x2f1)]===0x0,'errors':_0x3f86da,'warnings':_0x367ac1[_0x315ff3(0x2e2)],'normalized':_0xeca9b2,'validationConfig':_0x547d72};}function validateFlowClassification(_0x56bf4,_0x2b7bba){const _0x468c4a=a298_0x4ad4d2;if(!isRecord(_0x56bf4[_0x468c4a(0x2f9)]))return;const _0x39c519=_0x56bf4['flowType'],_0x17006c=_0x56bf4['flowJson']['pageMode'];_0x17006c!==undefined&&(typeof _0x17006c!==_0x468c4a(0x283)||!FLOW_PAGE_MODES[_0x468c4a(0x27a)](_0x17006c))&&_0x2b7bba[_0x468c4a(0x28c)]({'path':'flowJson.pageMode','message':_0x468c4a(0x2e9)+String(_0x17006c)+'.'});_0x39c519===_0x468c4a(0x1f5)&&_0x17006c!==undefined&&_0x2b7bba[_0x468c4a(0x28c)]({'path':'flowJson.pageMode','message':_0x468c4a(0x286)});_0x39c519==='INDEPENDENT_FLOW'&&_0x17006c===_0x468c4a(0x241)&&_0x2b7bba[_0x468c4a(0x28c)]({'path':_0x468c4a(0x289),'message':UNSUPPORTED_PLATFORM_FORM_MESSAGE});(_0x39c519==='FORM_FLOW'||_0x39c519===_0x468c4a(0x2af))&&validateCustomPageNavigation(_0x56bf4,_0x39c519,_0x17006c,_0x2b7bba);if(_0x39c519!==_0x468c4a(0x1f5)||!Array[_0x468c4a(0x28d)](_0x56bf4[_0x468c4a(0x2f9)][_0x468c4a(0x277)]))return;_0x56bf4['flowJson'][_0x468c4a(0x277)][_0x468c4a(0x237)]((_0x480266,_0x182ef1)=>{const _0x1aa583=_0x468c4a;isRecord(_0x480266)&&_0x480266[_0x1aa583(0x2f2)]==='APPROVAL'&&_0x480266[_0x1aa583(0x1c4)]==='HANDLE'&&_0x2b7bba[_0x1aa583(0x28c)]({'path':_0x1aa583(0x279)+_0x182ef1+_0x1aa583(0x288),'message':'FORM_FLOW\x20is\x20an\x20approval\x20flow\x20and\x20cannot\x20contain\x20HANDLE\x20tasks;\x20use\x20INDEPENDENT_FLOW\x20for\x20workflows.'});});}function validateCustomPageNavigation(_0x559710,_0x21d19d,_0x247ad7,_0xf3c29e){const _0xe6c61e=a298_0x4ad4d2,_0x273bb8=_0x559710[_0xe6c61e(0x2f9)][_0xe6c61e(0x272)];_0x273bb8!==undefined&&_0xf3c29e[_0xe6c61e(0x28c)]({'path':_0xe6c61e(0x291),'message':_0xe6c61e(0x22e)});const _0x1ff831=_0x559710['flowJson']['startPath'];_0x1ff831!==undefined&&(typeof _0x1ff831!=='string'||_0x1ff831['trim']()==='')&&_0xf3c29e[_0xe6c61e(0x28c)]({'path':'flowJson.startPath','message':_0xe6c61e(0x234)});const _0x20015a=Array[_0xe6c61e(0x28d)](_0x559710[_0xe6c61e(0x2f9)][_0xe6c61e(0x277)])?_0x559710[_0xe6c61e(0x2f9)][_0xe6c61e(0x277)]['map']((_0x4ad930,_0x3b021)=>({'node':_0x4ad930,'index':_0x3b021}))[_0xe6c61e(0x2b8)](({node:_0x3d061b})=>isRecord(_0x3d061b)&&_0x3d061b[_0xe6c61e(0x23f)]!==undefined):[],_0x2e137d=_0x1ff831!==undefined||_0x20015a[_0xe6c61e(0x2f1)]>0x0,_0x221c4c=_0x247ad7===undefined&&_0x21d19d===_0xe6c61e(0x2af)?_0xe6c61e(0x2ed):_0x247ad7;_0x2e137d&&(_0x21d19d!=='INDEPENDENT_FLOW'||_0x221c4c!==_0xe6c61e(0x2ed))&&(_0x1ff831!==undefined&&_0xf3c29e[_0xe6c61e(0x28c)]({'path':'flowJson.startPath','message':_0xe6c61e(0x207)}),_0x20015a[_0xe6c61e(0x237)](({index:_0x332486})=>{const _0x2c36ac=_0xe6c61e;_0xf3c29e[_0x2c36ac(0x28c)]({'path':'flowJson.nodes['+_0x332486+_0x2c36ac(0x2ea),'message':_0x2c36ac(0x2c7)});}));}export async function writeNormalizedFlowConfig(_0x43881e,_0x3bd5c0,_0x5483f0={}){const _0x3587d4=a298_0x4ad4d2,_0x3c7d4d=resolve(_0x43881e),_0x26e96c=_0x3c7d4d+'.'+process[_0x3587d4(0x297)]+'.'+randomUUID()+_0x3587d4(0x2d8),_0x2d11fc=JSON[_0x3587d4(0x2b5)](_0x3bd5c0,null,0x2)+'\x0a';let _0x4561aa;try{try{_0x4561aa=(await stat(_0x3c7d4d))[_0x3587d4(0x271)]&0x1ff;}catch{_0x4561aa=undefined;}await writeFile(_0x26e96c,_0x2d11fc,{'encoding':_0x3587d4(0x269),'flag':'wx','mode':_0x4561aa??0x1a4});if(_0x4561aa!==undefined)await chmod(_0x26e96c,_0x4561aa);_0x5483f0['overwrite']===![]?(await link(_0x26e96c,_0x3c7d4d),await unlink(_0x26e96c)):await rename(_0x26e96c,_0x3c7d4d);}finally{await unlink(_0x26e96c)['catch'](()=>undefined);}}function validateOuterMetadata(_0x3188bd,_0x300f6a){const _0x209c8a=a298_0x4ad4d2;(typeof _0x3188bd[_0x209c8a(0x28e)]!==_0x209c8a(0x283)||_0x3188bd[_0x209c8a(0x28e)]['trim']()==='')&&_0x300f6a[_0x209c8a(0x28c)]({'path':_0x209c8a(0x28e),'message':_0x209c8a(0x1e7)});_0x3188bd['flowDesc']!==undefined&&typeof _0x3188bd[_0x209c8a(0x25a)]!==_0x209c8a(0x283)&&_0x300f6a[_0x209c8a(0x28c)]({'path':_0x209c8a(0x25a),'message':_0x209c8a(0x275)});if(_0x3188bd[_0x209c8a(0x26a)]===undefined||_0x3188bd[_0x209c8a(0x26a)]===null)_0x300f6a['push']({'path':_0x209c8a(0x26a),'message':_0x209c8a(0x230)});else(typeof _0x3188bd['flowType']!==_0x209c8a(0x283)||!FLOW_TYPES['has'](_0x3188bd['flowType']))&&_0x300f6a[_0x209c8a(0x28c)]({'path':_0x209c8a(0x26a),'message':_0x209c8a(0x263)+String(_0x3188bd[_0x209c8a(0x26a)])+'.'});_0x3188bd[_0x209c8a(0x1fa)]!==undefined&&typeof _0x3188bd[_0x209c8a(0x1fa)]!==_0x209c8a(0x283)&&_0x300f6a[_0x209c8a(0x28c)]({'path':_0x209c8a(0x1fa),'message':_0x209c8a(0x236)}),_0x3188bd[_0x209c8a(0x1e4)]!==undefined&&(!Number[_0x209c8a(0x1c9)](_0x3188bd[_0x209c8a(0x1e4)])||_0x3188bd[_0x209c8a(0x1e4)]<0x0)&&_0x300f6a[_0x209c8a(0x28c)]({'path':'pageId','message':_0x209c8a(0x2b7)}),_0x3188bd[_0x209c8a(0x26a)]===_0x209c8a(0x2af)&&_0x3188bd[_0x209c8a(0x1fa)]!==undefined&&_0x300f6a[_0x209c8a(0x28c)]({'path':_0x209c8a(0x1fa),'message':_0x209c8a(0x1d2)}),_0x3188bd[_0x209c8a(0x26a)]===_0x209c8a(0x2af)&&_0x3188bd[_0x209c8a(0x1e4)]!==undefined&&_0x300f6a['push']({'path':_0x209c8a(0x1e4),'message':'INDEPENDENT_FLOW\x20cannot\x20bind\x20pageId.'});}function validateGraph(_0x4cb6c6,_0x195b29){const _0x1f2314=a298_0x4ad4d2;if(!isRecord(_0x4cb6c6)){_0x195b29[_0x1f2314(0x28c)]({'path':_0x1f2314(0x2f9),'message':_0x1f2314(0x2a3)});return;}!Array[_0x1f2314(0x28d)](_0x4cb6c6[_0x1f2314(0x277)])&&_0x195b29[_0x1f2314(0x28c)]({'path':_0x1f2314(0x2c5),'message':_0x1f2314(0x30e)});!Array[_0x1f2314(0x28d)](_0x4cb6c6[_0x1f2314(0x1c6)])&&_0x195b29[_0x1f2314(0x28c)]({'path':_0x1f2314(0x2da),'message':_0x1f2314(0x27d)});Object[_0x1f2314(0x2e4)][_0x1f2314(0x26f)][_0x1f2314(0x268)](_0x4cb6c6,_0x1f2314(0x1f9))&&_0x195b29[_0x1f2314(0x28c)]({'path':_0x1f2314(0x22d),'message':_0x1f2314(0x2cb)+String(_0x4cb6c6[_0x1f2314(0x1f9)])+_0x1f2314(0x200)+DEFAULT_FLOW_SCHEMA_VERSION+'.'});for(const _0x36609e of[_0x1f2314(0x2f0),_0x1f2314(0x20b),'formPermissions']){Object[_0x1f2314(0x2e4)][_0x1f2314(0x26f)]['call'](_0x4cb6c6,_0x36609e)&&_0x195b29[_0x1f2314(0x28c)]({'path':'flowJson.'+_0x36609e,'message':UNSUPPORTED_FORM_MESSAGE});}if(!Array['isArray'](_0x4cb6c6[_0x1f2314(0x277)])||!Array[_0x1f2314(0x28d)](_0x4cb6c6['edges']))return;const _0x2f421f=new Map(),_0x34bf8d=[],_0x1fdd76=[],_0x279ca4=new Map(),_0x269ddd=new Map(),_0x375f96=new Set();let _0x5824db=0x0;_0x4cb6c6['nodes'][_0x1f2314(0x237)]((_0x2242fa,_0x10962e)=>{const _0x40ec0a=_0x1f2314,_0x4d327c=_0x40ec0a(0x279)+_0x10962e+']';if(!isRecord(_0x2242fa)){_0x195b29[_0x40ec0a(0x28c)]({'path':_0x4d327c,'message':_0x40ec0a(0x313)});return;}const _0x6087c1=_0x2242fa;if(typeof _0x6087c1['id']!=='string'||!BPMN_ID_PATTERN[_0x40ec0a(0x1f1)](_0x6087c1['id']))_0x195b29[_0x40ec0a(0x28c)]({'path':_0x4d327c+_0x40ec0a(0x27e),'message':_0x40ec0a(0x305)});else _0x2f421f[_0x40ec0a(0x27a)](_0x6087c1['id'])?_0x195b29['push']({'path':_0x4d327c+_0x40ec0a(0x27e),'message':_0x40ec0a(0x1eb)+_0x6087c1['id']+'.'}):(_0x2f421f[_0x40ec0a(0x214)](_0x6087c1['id'],_0x6087c1),_0x375f96[_0x40ec0a(0x2e7)](_0x6087c1['id']));if(!NODE_TYPES[_0x40ec0a(0x27a)](_0x6087c1[_0x40ec0a(0x2f2)]))_0x195b29[_0x40ec0a(0x28c)]({'path':_0x4d327c+_0x40ec0a(0x205),'message':_0x40ec0a(0x257)+String(_0x6087c1[_0x40ec0a(0x2f2)])+'.'});else{if(_0x6087c1[_0x40ec0a(0x2f2)]===_0x40ec0a(0x238))_0x34bf8d[_0x40ec0a(0x28c)](_0x6087c1['id']);else _0x6087c1[_0x40ec0a(0x2f2)]===_0x40ec0a(0x1e2)&&_0x1fdd76[_0x40ec0a(0x28c)](_0x6087c1['id']);}_0x6087c1['type']===_0x40ec0a(0x26c)&&(_0x6087c1[_0x40ec0a(0x1c4)]===undefined||_0x6087c1[_0x40ec0a(0x1c4)]===_0x40ec0a(0x26c))&&(_0x5824db+=0x1);validateNode(_0x6087c1,_0x4d327c,_0x195b29);if(_0x6087c1[_0x40ec0a(0x2f2)]===_0x40ec0a(0x212)){const _0x4b7760=resolveEffectiveResultVariable(_0x6087c1[_0x40ec0a(0x2bd)],![]);_0x4b7760&&(registerResultVariableOwner(_0x269ddd,_0x4b7760,_0x6087c1['id'],_0x195b29),!_0x279ca4[_0x40ec0a(0x27a)](_0x4b7760)&&_0x279ca4[_0x40ec0a(0x214)](_0x4b7760,_0x6087c1['id']));}if(_0x6087c1['type']===_0x40ec0a(0x26c)&&isRecord(_0x6087c1[_0x40ec0a(0x309)])&&_0x6087c1[_0x40ec0a(0x309)][_0x40ec0a(0x300)]===!![]&&_0x6087c1[_0x40ec0a(0x309)]['action']===_0x40ec0a(0x299)){const _0x3d70ef=resolveEffectiveResultVariable(_0x6087c1['timeout']['resultVariable'],!![]);_0x3d70ef&&registerResultVariableOwner(_0x269ddd,_0x3d70ef,_0x6087c1['id']+_0x40ec0a(0x1f7),_0x195b29);}});_0x34bf8d[_0x1f2314(0x2f1)]!==0x1&&_0x195b29['push']({'path':_0x1f2314(0x2c5),'message':_0x1f2314(0x23a)});_0x1fdd76[_0x1f2314(0x2f1)]===0x0&&_0x195b29[_0x1f2314(0x28c)]({'path':_0x1f2314(0x2c5),'message':'Flow\x20must\x20contain\x20at\x20least\x20one\x20END\x20node.'});const _0x413ae6=new Map(),_0x18ab1c=new Map(),_0x4b6421=new Map(),_0x397f85=new Set();_0x4cb6c6[_0x1f2314(0x1c6)][_0x1f2314(0x237)]((_0x410e7f,_0xe80644)=>{const _0x2297b6=_0x1f2314,_0x2d858f=_0x2297b6(0x2a9)+_0xe80644+']';if(!isRecord(_0x410e7f)){_0x195b29[_0x2297b6(0x28c)]({'path':_0x2d858f,'message':_0x2297b6(0x24e)});return;}const _0x3f8e17=_0x410e7f;_0x4b6421['set'](_0x3f8e17,_0x2d858f);const _0x2d63d1=resolveEdgeEndpoint(_0x3f8e17[_0x2297b6(0x2f8)],_0x3f8e17[_0x2297b6(0x301)]),_0xb3555f=resolveEdgeEndpoint(_0x3f8e17[_0x2297b6(0x2c1)],_0x3f8e17[_0x2297b6(0x28a)]);if(!_0x2d63d1)_0x195b29[_0x2297b6(0x28c)]({'path':_0x2d858f+'.source','message':_0x2297b6(0x1ca)});if(!_0xb3555f)_0x195b29[_0x2297b6(0x28c)]({'path':_0x2d858f+_0x2297b6(0x2ce),'message':_0x2297b6(0x2a8)});_0x2d63d1&&!_0x2f421f[_0x2297b6(0x27a)](_0x2d63d1)&&_0x195b29[_0x2297b6(0x28c)]({'path':_0x2d858f+_0x2297b6(0x2b9),'message':_0x2297b6(0x2bb)+_0x2d63d1+'.'});_0xb3555f&&!_0x2f421f[_0x2297b6(0x27a)](_0xb3555f)&&_0x195b29[_0x2297b6(0x28c)]({'path':_0x2d858f+_0x2297b6(0x2ce),'message':_0x2297b6(0x1ce)+_0xb3555f+'.'});if(_0x3f8e17['id']!==undefined){if(typeof _0x3f8e17['id']!==_0x2297b6(0x283)||!BPMN_ID_PATTERN[_0x2297b6(0x1f1)](_0x3f8e17['id']))_0x195b29[_0x2297b6(0x28c)]({'path':_0x2d858f+_0x2297b6(0x27e),'message':_0x2297b6(0x248)});else{if(_0x375f96[_0x2297b6(0x27a)](_0x3f8e17['id']))_0x195b29[_0x2297b6(0x28c)]({'path':_0x2d858f+_0x2297b6(0x27e),'message':_0x2297b6(0x1e1)+_0x3f8e17['id']+'.'});else!_0x375f96[_0x2297b6(0x27a)](_0x3f8e17['id'])&&_0x375f96[_0x2297b6(0x2e7)](_0x3f8e17['id']);}}if(_0x2d63d1&&_0xb3555f){const _0x2819cd=_0x2d63d1+'\x00'+_0xb3555f+'\x00'+(_0x3f8e17[_0x2297b6(0x28b)]??_0x2297b6(0x232));_0x397f85[_0x2297b6(0x27a)](_0x2819cd)?_0x195b29[_0x2297b6(0x28c)]({'path':_0x2d858f,'message':'Duplicate\x20edge\x20route:\x20'+_0x2d63d1+'\x20->\x20'+_0xb3555f+'\x20('+(_0x3f8e17[_0x2297b6(0x28b)]??_0x2297b6(0x232))+').'}):_0x397f85[_0x2297b6(0x2e7)](_0x2819cd);}validateEdge(_0x3f8e17,_0x2d858f,_0x195b29),_0x2d63d1&&_0xb3555f&&(_0x413ae6[_0x2297b6(0x2b0)](_0x2d63d1)?.['push'](_0x3f8e17)??_0x413ae6[_0x2297b6(0x214)](_0x2d63d1,[_0x3f8e17]),_0x18ab1c[_0x2297b6(0x2b0)](_0xb3555f)?.[_0x2297b6(0x28c)](_0x3f8e17)??_0x18ab1c['set'](_0xb3555f,[_0x3f8e17]));});if(_0x34bf8d[_0x1f2314(0x2f1)]!==0x1)return;validateGraphShape(_0x2f421f,_0x34bf8d[0x0],_0x1fdd76,_0x413ae6,_0x18ab1c,_0x4b6421,_0x195b29),validateScriptResultReferences(_0x2f421f,_0x34bf8d[0x0],_0x413ae6,_0x18ab1c,_0x4b6421,_0x279ca4,_0x195b29),validateApprovalResults(_0x2f421f,_0x5824db,_0x1fdd76,_0x195b29);}function validateNode(_0x1d1ddc,_0x2f9ba9,_0x1cf854){const _0x1a22a1=a298_0x4ad4d2;for(const _0x257767 of[_0x1a22a1(0x273),'formPermission']){Object[_0x1a22a1(0x2e4)][_0x1a22a1(0x26f)]['call'](_0x1d1ddc,_0x257767)&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+'.'+_0x257767,'message':UNSUPPORTED_FORM_MESSAGE});}if(!NODE_TYPES[_0x1a22a1(0x27a)](_0x1d1ddc[_0x1a22a1(0x2f2)]))return;(typeof _0x1d1ddc[_0x1a22a1(0x1c5)]!==_0x1a22a1(0x283)||_0x1d1ddc[_0x1a22a1(0x1c5)]['trim']()==='')&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x1e8),'message':'Every\x20node\x20requires\x20a\x20non-empty\x20name.'});_0x1d1ddc['pageId']!==undefined&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+'.pageId','message':_0x1a22a1(0x2d6)});if(_0x1d1ddc[_0x1a22a1(0x23f)]!==undefined){if(typeof _0x1d1ddc[_0x1a22a1(0x23f)]!=='string'||_0x1d1ddc['path'][_0x1a22a1(0x2e1)]()==='')_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x1cf),'message':'node\x20path\x20must\x20be\x20a\x20non-empty\x20string.'});else _0x1d1ddc[_0x1a22a1(0x2f2)]!=='APPROVAL'&&_0x1d1ddc[_0x1a22a1(0x2f2)]!==_0x1a22a1(0x1e2)&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+'.path','message':_0x1a22a1(0x1c7)});}const _0x292c23=_0x1d1ddc['position'];if(!isRecord(_0x292c23))_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+'.position','message':_0x1a22a1(0x2d2)});else for(const _0x1070e2 of['x','y']){const _0x158ba6=_0x292c23[_0x1070e2];(typeof _0x158ba6!==_0x1a22a1(0x292)||!Number[_0x1a22a1(0x203)](_0x158ba6)||_0x158ba6<0x0)&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x2df)+_0x1070e2,'message':_0x1a22a1(0x25e)+_0x1070e2+_0x1a22a1(0x306)});}if(_0x1d1ddc[_0x1a22a1(0x2f2)]===_0x1a22a1(0x26c)){const _0x4fa38a=_0x1d1ddc['approvalMode']??_0x1a22a1(0x260),_0x372c89=_0x1d1ddc[_0x1a22a1(0x1c4)]??_0x1a22a1(0x26c);!APPROVAL_TASK_MODES['has'](_0x372c89)&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x317),'message':_0x1a22a1(0x1d7)+String(_0x372c89)+'.'});!APPROVAL_MODES[_0x1a22a1(0x27a)](_0x4fa38a)&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x1da),'message':_0x1a22a1(0x1db)+String(_0x4fa38a)+'.'});if(!isRecord(_0x1d1ddc[_0x1a22a1(0x1ff)]))_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x1e3),'message':_0x1a22a1(0x239)});else{const _0x43cd89=_0x1d1ddc[_0x1a22a1(0x1ff)][_0x1a22a1(0x1f4)];_0x43cd89!==_0x1a22a1(0x24b)&&_0x43cd89!==_0x1a22a1(0x314)&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x24a),'message':_0x1a22a1(0x2f6)});if(_0x43cd89===_0x1a22a1(0x24b)){const _0x33cc74=_0x1d1ddc[_0x1a22a1(0x1ff)][_0x1a22a1(0x26e)];if(!Array[_0x1a22a1(0x28d)](_0x33cc74)||_0x33cc74[_0x1a22a1(0x2f1)]===0x0)_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x1d3),'message':_0x1a22a1(0x217)});else{const _0x42460e=_0x33cc74[_0x1a22a1(0x295)](_0x59eaa9=>!isValidUserId(_0x59eaa9));_0x42460e>=0x0&&_0x1cf854['push']({'path':_0x2f9ba9+_0x1a22a1(0x206)+_0x42460e+']','message':_0x1a22a1(0x2c4)});const _0x5a54f0=new Set(_0x33cc74[_0x1a22a1(0x2b8)](isValidUserId)['map'](_0x55b96c=>String(_0x55b96c)[_0x1a22a1(0x2e1)]()));_0x4fa38a===_0x1a22a1(0x260)&&_0x5a54f0[_0x1a22a1(0x1f8)]>0x1&&_0x1cf854['push']({'path':_0x2f9ba9+_0x1a22a1(0x1d3),'message':'SINGLE\x20approval\x20supports\x20only\x20one\x20fixed\x20user.'});}}if(_0x43cd89===_0x1a22a1(0x314)){const _0x247f1d=_0x1d1ddc[_0x1a22a1(0x1ff)][_0x1a22a1(0x296)],_0x1080d4=typeof _0x247f1d===_0x1a22a1(0x292)||typeof _0x247f1d==='string'?Number(String(_0x247f1d)['trim']()):Number[_0x1a22a1(0x20d)];(!Number['isSafeInteger'](_0x1080d4)||_0x1080d4<=0x0)&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+'.assignee.roleId','message':_0x1a22a1(0x220)});}}if(_0x1d1ddc['transferCandidates']!==undefined){if(!isRecord(_0x1d1ddc['transferCandidates']))_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x215),'message':'transferCandidates\x20must\x20be\x20an\x20object.'});else{if(_0x1d1ddc[_0x1a22a1(0x2ae)][_0x1a22a1(0x1f4)]!==_0x1a22a1(0x24b))_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x243),'message':'transferCandidates\x20currently\x20supports\x20FIXED\x20only.'});else{const _0x3a6ab5=_0x1d1ddc[_0x1a22a1(0x2ae)][_0x1a22a1(0x26e)];if(!Array[_0x1a22a1(0x28d)](_0x3a6ab5)||_0x3a6ab5['length']===0x0)_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+'.transferCandidates.userIds','message':_0x1a22a1(0x26b)});else{const _0x414e36=_0x3a6ab5[_0x1a22a1(0x295)](_0x338ed4=>!isValidUserId(_0x338ed4));_0x414e36>=0x0&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x252)+_0x414e36+']','message':'transfer\x20candidate\x20userId\x20must\x20be\x20a\x20non-empty\x20string\x20or\x20positive\x20integer.'});}}}}}_0x1d1ddc[_0x1a22a1(0x20a)]!==undefined&&typeof _0x1d1ddc['sequential']!=='boolean'&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x228),'message':_0x1a22a1(0x2a5)});if(_0x1d1ddc[_0x1a22a1(0x2f2)]==='SCRIPT'){(typeof _0x1d1ddc['scriptName']!==_0x1a22a1(0x283)||_0x1d1ddc[_0x1a22a1(0x225)][_0x1a22a1(0x2e1)]()==='')&&_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x25d),'message':_0x1a22a1(0x294)});if(_0x1d1ddc[_0x1a22a1(0x2bd)]!==undefined){if(typeof _0x1d1ddc[_0x1a22a1(0x2bd)]!==_0x1a22a1(0x283)||!VARIABLE_PATTERN[_0x1a22a1(0x1f1)](_0x1d1ddc[_0x1a22a1(0x2bd)]))_0x1cf854[_0x1a22a1(0x28c)]({'path':_0x2f9ba9+_0x1a22a1(0x1c8),'message':_0x1a22a1(0x2b3)});else(RESERVED_RESULT_VARIABLES['has'](_0x1d1ddc[_0x1a22a1(0x2bd)])||_0x1d1ddc[_0x1a22a1(0x2bd)][_0x1a22a1(0x2d7)]('approval_sys_'))&&_0x1cf854['push']({'path':_0x2f9ba9+_0x1a22a1(0x1c8),'message':_0x1a22a1(0x307)+_0x1d1ddc[_0x1a22a1(0x2bd)]+'.'});}}validateAsyncExecution(_0x1d1ddc,_0x2f9ba9,_0x1cf854),validateApprovalTimeout(_0x1d1ddc,_0x2f9ba9,_0x1cf854),validateCcConfig(_0x1d1ddc,_0x2f9ba9,_0x1cf854),_0x1d1ddc['type']===_0x1a22a1(0x2bc)&&validateNotificationConfig(_0x1d1ddc[_0x1a22a1(0x2a7)],_0x2f9ba9+_0x1a22a1(0x22a),_0x1cf854);}function validateAsyncExecution(_0x10b33d,_0x2c1eb6,_0x281991){const _0x3d0040=a298_0x4ad4d2;if(_0x10b33d['async']===undefined)return;if(!isRecord(_0x10b33d[_0x3d0040(0x208)])){_0x281991[_0x3d0040(0x28c)]({'path':_0x2c1eb6+'.async','message':_0x3d0040(0x316)});return;}if(_0x10b33d['async'][_0x3d0040(0x300)]!==undefined&&typeof _0x10b33d['async']['enabled']!==_0x3d0040(0x1ee)){_0x281991[_0x3d0040(0x28c)]({'path':_0x2c1eb6+_0x3d0040(0x274),'message':'async.enabled\x20must\x20be\x20a\x20boolean.'});return;}if(_0x10b33d[_0x3d0040(0x208)]['enabled']!==!![])return;_0x10b33d['type']!==_0x3d0040(0x212)&&_0x281991[_0x3d0040(0x28c)]({'path':_0x2c1eb6+_0x3d0040(0x26d),'message':'async\x20execution\x20is\x20only\x20supported\x20by\x20SCRIPT\x20node.'});const _0x518064=_0x10b33d['async'][_0x3d0040(0x262)]??0x3;(!Number[_0x3d0040(0x1c9)](_0x518064)||_0x518064<0x1||_0x518064>MAX_ASYNC_RETRY_COUNT)&&_0x281991[_0x3d0040(0x28c)]({'path':_0x2c1eb6+_0x3d0040(0x211),'message':_0x3d0040(0x302)+MAX_ASYNC_RETRY_COUNT+'.'}),_0x10b33d['async'][_0x3d0040(0x2c0)]!==undefined&&validateTimeAmount(_0x10b33d[_0x3d0040(0x208)][_0x3d0040(0x2c0)],_0x2c1eb6+_0x3d0040(0x1cb),_0x281991);}function validateApprovalTimeout(_0x3ce409,_0x199f2a,_0x364045){const _0x48dcb0=a298_0x4ad4d2;if(_0x3ce409['timeout']===undefined)return;if(!isRecord(_0x3ce409['timeout'])){_0x364045[_0x48dcb0(0x28c)]({'path':_0x199f2a+'.timeout','message':_0x48dcb0(0x2c8)});return;}if(_0x3ce409[_0x48dcb0(0x309)][_0x48dcb0(0x300)]!==undefined&&typeof _0x3ce409[_0x48dcb0(0x309)][_0x48dcb0(0x300)]!==_0x48dcb0(0x1ee)){_0x364045[_0x48dcb0(0x28c)]({'path':_0x199f2a+'.timeout.enabled','message':_0x48dcb0(0x265)});return;}if(_0x3ce409['timeout']['enabled']!==!![])return;if(_0x3ce409[_0x48dcb0(0x309)][_0x48dcb0(0x27c)]!==undefined&&typeof _0x3ce409[_0x48dcb0(0x309)][_0x48dcb0(0x27c)]!=='boolean'){_0x364045[_0x48dcb0(0x28c)]({'path':_0x199f2a+_0x48dcb0(0x322),'message':_0x48dcb0(0x2ca)});return;}_0x3ce409['type']!=='APPROVAL'&&_0x364045[_0x48dcb0(0x28c)]({'path':_0x199f2a+_0x48dcb0(0x1f7),'message':_0x48dcb0(0x216)});validateTimeAmount(_0x3ce409['timeout']['duration'],_0x199f2a+_0x48dcb0(0x2bf),_0x364045);const _0x1588de=_0x3ce409[_0x48dcb0(0x309)][_0x48dcb0(0x1cc)];if(!APPROVAL_TIMEOUT_ACTIONS['has'](_0x1588de)){_0x364045[_0x48dcb0(0x28c)]({'path':_0x199f2a+_0x48dcb0(0x29a),'message':'timeout.action\x20must\x20be\x20AUTO_APPROVE,\x20AUTO_REJECT,\x20or\x20EXECUTE_BFF.'});return;}(_0x3ce409[_0x48dcb0(0x1c4)]??_0x48dcb0(0x26c))===_0x48dcb0(0x308)&&_0x1588de!==_0x48dcb0(0x299)&&_0x364045[_0x48dcb0(0x28c)]({'path':_0x199f2a+_0x48dcb0(0x29a),'message':'HANDLE\x20task\x20timeout\x20only\x20supports\x20EXECUTE_BFF.'});const _0x2a7d1d=_0x3ce409['timeout'][_0x48dcb0(0x27c)]??_0x1588de!==_0x48dcb0(0x299);if(_0x1588de===_0x48dcb0(0x299))_0x2a7d1d&&_0x364045[_0x48dcb0(0x28c)]({'path':_0x199f2a+'.timeout.interrupting','message':'EXECUTE_BFF\x20timeout\x20must\x20not\x20interrupt\x20the\x20approval\x20task.'}),(typeof _0x3ce409[_0x48dcb0(0x309)]['scriptName']!=='string'||_0x3ce409[_0x48dcb0(0x309)][_0x48dcb0(0x225)][_0x48dcb0(0x2e1)]()==='')&&_0x364045[_0x48dcb0(0x28c)]({'path':_0x199f2a+'.timeout.scriptName','message':_0x48dcb0(0x30d)}),validateOptionalResultVariable(_0x3ce409[_0x48dcb0(0x309)][_0x48dcb0(0x2bd)],_0x199f2a+_0x48dcb0(0x201),_0x364045);else!_0x2a7d1d&&_0x364045['push']({'path':_0x199f2a+_0x48dcb0(0x322),'message':_0x1588de+_0x48dcb0(0x25f)});}function validateTimeAmount(_0x590b2f,_0xaa0591,_0x251d09){const _0x40011d=a298_0x4ad4d2;if(!isRecord(_0x590b2f)){_0x251d09[_0x40011d(0x28c)]({'path':_0xaa0591,'message':_0x40011d(0x1fd)});return;}(!Number['isInteger'](_0x590b2f[_0x40011d(0x285)])||Number(_0x590b2f[_0x40011d(0x285)])<=0x0)&&_0x251d09[_0x40011d(0x28c)]({'path':_0xaa0591+_0x40011d(0x31d),'message':_0x40011d(0x2b2)}),!FLOW_TIME_UNITS[_0x40011d(0x27a)](_0x590b2f[_0x40011d(0x22f)])&&_0x251d09['push']({'path':_0xaa0591+_0x40011d(0x23e),'message':_0x40011d(0x2f3)});}function validateOptionalResultVariable(_0x55615c,_0x138787,_0x2b7185){const _0x5aa265=a298_0x4ad4d2;if(_0x55615c===undefined||_0x55615c===null||_0x55615c==='')return;if(typeof _0x55615c!=='string'||!VARIABLE_PATTERN['test'](_0x55615c))_0x2b7185[_0x5aa265(0x28c)]({'path':_0x138787,'message':_0x5aa265(0x2b3)});else(RESERVED_RESULT_VARIABLES[_0x5aa265(0x27a)](_0x55615c)||_0x55615c[_0x5aa265(0x2d7)](_0x5aa265(0x2fa)))&&_0x2b7185[_0x5aa265(0x28c)]({'path':_0x138787,'message':_0x5aa265(0x307)+_0x55615c+'.'});}function validateCcConfig(_0x354b07,_0x111943,_0xfe1c26){const _0x5905b6=a298_0x4ad4d2;if(_0x354b07['cc']===undefined)return;if(!isRecord(_0x354b07['cc'])){_0xfe1c26[_0x5905b6(0x28c)]({'path':_0x111943+_0x5905b6(0x20c),'message':_0x5905b6(0x321)});return;}_0x354b07[_0x5905b6(0x2f2)]!==_0x5905b6(0x1e2)&&_0x354b07[_0x5905b6(0x2f2)]!==_0x5905b6(0x26c)&&_0xfe1c26[_0x5905b6(0x28c)]({'path':_0x111943+_0x5905b6(0x20c),'message':_0x5905b6(0x1e0)});Object[_0x5905b6(0x2e4)][_0x5905b6(0x26f)][_0x5905b6(0x268)](_0x354b07['cc'],'readSources')&&_0xfe1c26[_0x5905b6(0x28c)]({'path':_0x111943+'.cc.readSources','message':UNSUPPORTED_FORM_MESSAGE});const _0x319dd2=_0x354b07['cc'][_0x5905b6(0x1e9)];if(!Array['isArray'](_0x319dd2)||_0x319dd2[_0x5905b6(0x2f1)]===0x0)_0xfe1c26[_0x5905b6(0x28c)]({'path':_0x111943+_0x5905b6(0x2fe),'message':_0x5905b6(0x267)});else{_0x319dd2[_0x5905b6(0x2f1)]>MAX_CC_RECIPIENTS&&_0xfe1c26[_0x5905b6(0x28c)]({'path':_0x111943+'.cc.recipientUserIds','message':_0x5905b6(0x1d0)+MAX_CC_RECIPIENTS+_0x5905b6(0x2cc)});const _0x110c08=new Set();_0x319dd2['forEach']((_0xcdc480,_0x4cbfc5)=>{const _0x2427b4=_0x5905b6;if(typeof _0xcdc480!==_0x2427b4(0x283)||_0xcdc480[_0x2427b4(0x2e1)]()==='')_0xfe1c26['push']({'path':_0x111943+_0x2427b4(0x245)+_0x4cbfc5+']','message':_0x2427b4(0x2db)});else _0x110c08[_0x2427b4(0x27a)](_0xcdc480[_0x2427b4(0x2e1)]())?_0xfe1c26[_0x2427b4(0x28c)]({'path':_0x111943+_0x2427b4(0x245)+_0x4cbfc5+']','message':'Duplicate\x20cc\x20recipient\x20userId:\x20'+_0xcdc480['trim']()+'.'}):_0x110c08[_0x2427b4(0x2e7)](_0xcdc480[_0x2427b4(0x2e1)]());});}validateStringArray(_0x354b07['cc']['visible'],_0x111943+_0x5905b6(0x31e),_0xfe1c26);}function validateStringArray(_0x2c4eac,_0x50ac5a,_0x291659){const _0x274dac=a298_0x4ad4d2;if(_0x2c4eac===undefined)return;if(!Array[_0x274dac(0x28d)](_0x2c4eac)){_0x291659[_0x274dac(0x28c)]({'path':_0x50ac5a,'message':_0x274dac(0x24d)});return;}const _0x5e62c4=new Set();_0x2c4eac[_0x274dac(0x237)]((_0x1f8720,_0x41579d)=>{const _0x407f05=_0x274dac;if(typeof _0x1f8720!==_0x407f05(0x283)||_0x1f8720[_0x407f05(0x2e1)]()==='')_0x291659[_0x407f05(0x28c)]({'path':_0x50ac5a+'['+_0x41579d+']','message':_0x407f05(0x29f)});else _0x5e62c4[_0x407f05(0x27a)](_0x1f8720['trim']())?_0x291659[_0x407f05(0x28c)]({'path':_0x50ac5a+'['+_0x41579d+']','message':_0x407f05(0x2aa)+_0x1f8720['trim']()+'.'}):_0x5e62c4[_0x407f05(0x2e7)](_0x1f8720['trim']());});}function a298_0x36ad(){const _0x42ebb2=['A\x20default\x20flow\x20must\x20not\x20have\x20an\x20expression.','DAYS','toUpperCase','Unsupported\x20task\x20mode:\x20','Unsupported\x20notification\x20placeholder:\x20',',\x20but\x20node\x20','.approvalMode','Unsupported\x20approval\x20mode:\x20','array','\x20was\x20empty\x20and\x20was\x20removed.','#/$defs/position','.text','Default\x20cc\x20is\x20only\x20supported\x20by\x20APPROVAL\x20or\x20END\x20node.','Duplicate\x20BPMN\x20element\x20id:\x20','END','.assignee','pageId','CONTINUE','Notification\x20fact.','flowName\x20is\x20required.','.name','recipientUserIds','Notification\x20recipient.value\x20is\x20required.','Duplicate\x20node\x20id:\x20','.expression','END\x20node\x20must\x20not\x20have\x20outgoing\x20edges.','boolean','flowKey','approval_sys_dataId','test','EXPRESSION\x20edge\x20requires\x20expression.','MINUTES','strategy','FORM_FLOW','label','.timeout','size','schemaVersion','datasetCode','A\x20default\x20flow\x20must\x20use\x20conditionType\x20ALWAYS.','detailMarkdown','duration\x20requires\x20value\x20and\x20unit.','Notification\x20version\x20must\x20be\x20a\x20string.','assignee','.\x20This\x20CLI\x20supports\x20only\x20','.timeout.resultVariable','PLATFORM_FORM\x20is\x20not\x20supported\x20by\x20this\x20rabetbase\x20version;\x20use\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.','isFinite','.actions','.type','.assignee.userIds[','startPath\x20applies\x20only\x20to\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.','async','appCode','sequential','formDefinitions','.cc','NaN','approval_sys_operationType','FlowConfig\x20must\x20be\x20a\x20JSON\x20object.','scriptResult','.async.retryCount','SCRIPT','.template','set','.transferCandidates','timeout\x20is\x20only\x20supported\x20by\x20APPROVAL\x20node.','FIXED\x20assignee\x20requires\x20userIds.','keys','some','Node\x20cannot\x20reach\x20any\x20END.','.conditionType','661200IkYLmh','\x20was\x20empty\x20or\x20used\x20the\x20default\x20','Notification\x20fact\x20must\x20be\x20an\x20object.','REJECTED','ROLE\x20assignee\x20requires\x20a\x20positive\x20integer\x20roleId.','failurePolicy\x20must\x20be\x20CONTINUE\x20or\x20FAIL.','1239620rzPKkX','templateName','object','scriptName','.detailMarkdown','text','.sequential','ALL','.config','\x20facts.','SECONDS','flowJson.schemaVersion','startPageId\x20is\x20no\x20longer\x20supported;\x20use\x20startPath\x20instead.','unit','flowType\x20is\x20required.','APPROVAL\x20node\x20requires\x20exactly\x20one\x20APPROVED\x20outgoing\x20edge.','ALWAYS','HANDLE\x20task\x20requires\x20exactly\x20one\x20outgoing\x20edge.','startPath\x20must\x20be\x20a\x20non-empty\x20string.','AUTO_APPROVE','datasetCode\x20must\x20be\x20a\x20string.','forEach','START','APPROVAL\x20node\x20requires\x20assignee.','Flow\x20must\x20contain\x20exactly\x20one\x20START\x20node.','Notification\x20template.','approval_sys_processInstanceId','5253370rmBaai','.unit','path','formData','PLATFORM_FORM','CONDITION\x20default\x20edge\x20must\x20use\x20conditionType\x20ALWAYS.','.transferCandidates.strategy','Accepted\x20as\x20legacy\x20input\x20and\x20removed\x20during\x20normalization;\x20other\x20versions\x20are\x20unsupported.','.cc.recipientUserIds[','Notification\x20template.actions\x20must\x20be\x20an\x20array.','Notification\x20configCode\x20is\x20required.','edge\x20id\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','Notification\x20template.facts\x20must\x20be\x20an\x20array.','.assignee.strategy','FIXED','Duplicate\x20resultVariable:\x20','value\x20must\x20be\x20an\x20array.','edge\x20must\x20be\x20an\x20object.','https://json-schema.org/draft/2020-12/schema','1467382RjKOXL','empty_metadata_removed','.transferCandidates.userIds[','Unsupported\x20notification\x20version:\x20','failurePolicy','configCode','Notification\x20recipient.type\x20is\x20required.','Unsupported\x20node\x20type:\x20','pageMode','EMAIL','flowDesc','expression','No\x20END\x20node\x20is\x20reachable\x20from\x20START.','.scriptName','position.','\x20timeout\x20must\x20interrupt\x20the\x20approval\x20task.','SINGLE','APPROVED','retryCount','Unsupported\x20flowType:\x20','recipients','timeout.enabled\x20must\x20be\x20a\x20boolean.','.waypoints','cc.recipientUserIds\x20must\x20be\x20a\x20non-empty\x20array.','call','utf8','flowType','FIXED\x20transferCandidates\x20requires\x20non-empty\x20userIds.','APPROVAL','.async','userIds','hasOwnProperty','USER','mode','startPageId','form','.async.enabled','flowDesc\x20must\x20be\x20a\x20string.','Rabetbase\x20FlowConfig','nodes','waypoints','flowJson.nodes[','has','Notification\x20action.url\x20is\x20required.','interrupting','edges\x20must\x20be\x20an\x20array.','.id','slice','role','__rabetbase_local_validation__','Unsupported\x20condition\x20type:\x20','string','.role','value','pageMode\x20applies\x20only\x20to\x20INDEPENDENT_FLOW.','bindDatasetCode','].taskMode','flowJson.pageMode','targetNodeId','conditionType','push','isArray','flowName','Notification\x20recipient.type\x20must\x20be\x20USER,\x20ROLE,\x20or\x20EMAIL.','45576WrFCEh','flowJson.startPageId','number','#/$defs/flowEdge','SCRIPT\x20node\x20requires\x20scriptName.','findIndex','roleId','pid','.defaultFlow','EXECUTE_BFF','.timeout.action','approval_sys_initiatorUsername','EXPRESSION','matchAll','HANDLE\x20task\x20outgoing\x20edge\x20must\x20use\x20ALWAYS\x20without\x20defaultFlow\x20or\x20expression.','value\x20must\x20be\x20a\x20non-empty\x20string.','.configCode','summary','BCC','flowJson\x20must\x20be\x20an\x20object.','metadata','sequential\x20must\x20be\x20a\x20boolean.','12eQvBen','config','edge\x20target\x20is\x20required.','flowJson.edges[','Duplicate\x20value:\x20','^[A-Za-z_][A-Za-z0-9_]*$','approval_sys_pageId','.waypoints[','transferCandidates','INDEPENDENT_FLOW','get','HOURS','duration\x20value\x20must\x20be\x20a\x20positive\x20integer.','resultVariable\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','waypoint\x20must\x20contain\x20numeric\x20x\x20and\x20y\x20coordinates.','stringify','CONDITION\x20node\x20requires\x20exactly\x20one\x20default\x20outgoing\x20edge.','pageId\x20must\x20be\x20a\x20non-negative\x20integer.','filter','.source','waypoints\x20must\x20be\x20an\x20array.','Edge\x20source\x20node\x20not\x20found:\x20','NOTIFICATION','resultVariable','.url','.timeout.duration','retryInterval','target','3nkOCpK','\x20is\x20required.','fixed\x20assignee\x20userId\x20must\x20be\x20a\x20non-empty\x20string\x20or\x20positive\x20integer.','flowJson.nodes','legacy_field_removed','node\x20path\x20applies\x20only\x20to\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.','timeout\x20must\x20be\x20an\x20object.','CONDITION\x20non-default\x20edge\x20must\x20use\x20conditionType\x20EXPRESSION.','timeout.interrupting\x20must\x20be\x20a\x20boolean.','Unsupported\x20schemaVersion:\x20','\x20users.','version','.target','integer','Notification\x20recipient.role\x20must\x20be\x20a\x20string.','failurePolicy\x20must\x20be\x20a\x20string.','Every\x20node\x20requires\x20position.x\x20and\x20position.y.','template','defaultFlow','every','node\x20pageId\x20is\x20no\x20longer\x20supported;\x20use\x20node\x20path\x20instead.','startsWith','.tmp','Notification\x20text\x20contains\x20a\x20malformed\x20placeholder.','flowJson.edges','cc\x20recipient\x20userId\x20must\x20be\x20a\x20non-empty\x20string.','Notification\x20action\x20must\x20be\x20an\x20object.','actions','Notification\x20template\x20supports\x20at\x20most\x20','.position.','edge\x20name\x20must\x20be\x20a\x20string.','trim','warnings','CONDITION','prototype','message','.failurePolicy','add','flowJson.nodes.','Unsupported\x20pageMode:\x20','].path','replace','FAIL','CUSTOM_PAGE','approval.simple-flow.v1','.version','formSchema','length','type','duration\x20unit\x20must\x20be\x20SECONDS,\x20MINUTES,\x20HOURS,\x20or\x20DAYS.','#/$defs/userId','Notification\x20action.url\x20must\x20use\x20http/https\x20or\x20a\x20complete\x20supported\x20placeholder.','assignee.strategy\x20must\x20be\x20FIXED\x20or\x20ROLE.','Node\x20is\x20not\x20reachable\x20from\x20START.','source','flowJson','approval_sys_','^[1-9][0-9]*$','parse','includes','.cc.recipientUserIds','AUTO_REJECT','enabled','sourceNodeId','SCRIPT\x20async\x20retryCount\x20must\x20be\x20between\x201\x20and\x20','APPROVAL\x20node\x20requires\x20exactly\x20one\x20REJECTED\x20outgoing\x20edge.','flowJson.','node\x20id\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','\x20must\x20be\x20a\x20finite\x20number\x20greater\x20than\x20or\x20equal\x20to\x200.','Reserved\x20resultVariable:\x20','HANDLE','timeout','977165XUJWxR','CONDITION\x20non-default\x20edge\x20requires\x20a\x20non-empty\x20expression.','NOTIFICATION\x20node\x20requires\x20config.','EXECUTE_BFF\x20timeout\x20requires\x20scriptName.','nodes\x20must\x20be\x20an\x20array.','CONDITION\x20default\x20edge\x20must\x20not\x20define\x20expression.','NOTIFICATION\x20node\x20requires\x20template.','351vxEvRX','map','node\x20must\x20be\x20an\x20object.','ROLE','Node\x20has\x20no\x20incoming\x20edge.','async\x20must\x20be\x20an\x20object.','.taskMode','Approval\x20flow\x20requires\x20an\x20END\x20node\x20with\x20result\x20','#/$defs/timeAmount','waypoint.','event','title','.value','.cc.visible','5105635pXeOaW','url','cc\x20must\x20be\x20an\x20object.','.timeout.interrupting','taskMode','name','edges','node\x20path\x20is\x20supported\x20only\x20on\x20APPROVAL\x20or\x20END\x20nodes.','.resultVariable','isInteger','edge\x20source\x20is\x20required.','.async.retryInterval','action','result','Edge\x20target\x20node\x20not\x20found:\x20','.path','cc.recipientUserIds\x20supports\x20at\x20most\x20','\x20is\x20not\x20on\x20every\x20upstream\x20path\x20to\x20','INDEPENDENT_FLOW\x20cannot\x20bind\x20datasetCode.','.assignee.userIds'];a298_0x36ad=function(){return _0x42ebb2;};return a298_0x36ad();}function validateNotificationConfig(_0x43f150,_0x3d43de,_0x22b051){const _0x5be40d=a298_0x4ad4d2;if(!isRecord(_0x43f150)){_0x22b051[_0x5be40d(0x28c)]({'path':_0x3d43de,'message':_0x5be40d(0x30c)});return;}if(_0x43f150[_0x5be40d(0x2cd)]!==undefined&&_0x43f150[_0x5be40d(0x2cd)]!==null){if(typeof _0x43f150['version']!=='string')_0x22b051[_0x5be40d(0x28c)]({'path':_0x3d43de+_0x5be40d(0x2ef),'message':_0x5be40d(0x1fe)});else _0x43f150[_0x5be40d(0x2cd)]['trim']()&&_0x43f150['version']['trim']()!=='v1'&&_0x22b051[_0x5be40d(0x28c)]({'path':_0x3d43de+_0x5be40d(0x2ef),'message':_0x5be40d(0x253)+_0x43f150[_0x5be40d(0x2cd)]+'.'});}const _0x1b50b2=requireNotificationString(_0x43f150[_0x5be40d(0x255)],_0x3d43de+_0x5be40d(0x2a0),_0x5be40d(0x247),_0x22b051);_0x1b50b2?.[_0x5be40d(0x2fd)]('${')&&_0x22b051['push']({'path':_0x3d43de+'.configCode','message':'Notification\x20configCode\x20must\x20be\x20a\x20fixed\x20value.'});if(_0x43f150[_0x5be40d(0x254)]!==undefined&&_0x43f150['failurePolicy']!==null){if(typeof _0x43f150['failurePolicy']!==_0x5be40d(0x283))_0x22b051['push']({'path':_0x3d43de+_0x5be40d(0x2e6),'message':_0x5be40d(0x2d1)});else!NOTIFICATION_FAILURE_POLICIES['has'](_0x43f150['failurePolicy'][_0x5be40d(0x2e1)]()[_0x5be40d(0x1d6)]())&&_0x22b051[_0x5be40d(0x28c)]({'path':_0x3d43de+'.failurePolicy','message':_0x5be40d(0x221)});}!isRecord(_0x43f150[_0x5be40d(0x2d3)])?_0x22b051['push']({'path':_0x3d43de+_0x5be40d(0x213),'message':_0x5be40d(0x310)}):validateNotificationTemplate(_0x43f150['template'],_0x3d43de+_0x5be40d(0x213),_0x22b051),validateNotificationRecipients(_0x43f150[_0x5be40d(0x264)],_0x3d43de+'.recipients',_0x22b051);}function validateNotificationTemplate(_0x5de86f,_0x99c764,_0x163b84){const _0x3cb569=a298_0x4ad4d2;for(const _0x597146 of[_0x3cb569(0x31c),_0x3cb569(0x2a1)]){const _0x2c3316=requireNotificationString(_0x5de86f[_0x597146],_0x99c764+'.'+_0x597146,_0x3cb569(0x23b)+_0x597146+_0x3cb569(0x2c3),_0x163b84);if(_0x2c3316)validateNotificationPlaceholders(_0x2c3316,_0x99c764+'.'+_0x597146,_0x163b84);}_0x5de86f[_0x3cb569(0x1fc)]!==undefined&&_0x5de86f[_0x3cb569(0x1fc)]!==null&&(typeof _0x5de86f[_0x3cb569(0x1fc)]!==_0x3cb569(0x283)?_0x163b84[_0x3cb569(0x28c)]({'path':_0x99c764+_0x3cb569(0x226),'message':'Notification\x20template.detailMarkdown\x20must\x20be\x20a\x20string.'}):validateNotificationPlaceholders(_0x5de86f['detailMarkdown'],_0x99c764+'.detailMarkdown',_0x163b84)),validateNotificationFacts(_0x5de86f['facts'],_0x99c764+'.facts',_0x163b84),validateNotificationActions(_0x5de86f[_0x3cb569(0x2dd)],_0x99c764+_0x3cb569(0x204),_0x163b84);}function validateNotificationFacts(_0x24662b,_0x4473d3,_0x14c507){const _0x40b116=a298_0x4ad4d2;if(_0x24662b===undefined||_0x24662b===null)return;if(!Array[_0x40b116(0x28d)](_0x24662b)){_0x14c507[_0x40b116(0x28c)]({'path':_0x4473d3,'message':_0x40b116(0x249)});return;}_0x24662b[_0x40b116(0x2f1)]>MAX_NOTIFICATION_FACTS&&_0x14c507[_0x40b116(0x28c)]({'path':_0x4473d3,'message':_0x40b116(0x2de)+MAX_NOTIFICATION_FACTS+_0x40b116(0x22b)}),_0x24662b[_0x40b116(0x237)]((_0x28c68f,_0x3bec55)=>{const _0x5bd442=_0x40b116,_0x3f11f6=_0x4473d3+'['+_0x3bec55+']';if(!isRecord(_0x28c68f)){_0x14c507['push']({'path':_0x3f11f6,'message':_0x5bd442(0x21e)});return;}for(const _0x5e00a7 of[_0x5bd442(0x1f6),_0x5bd442(0x285)]){const _0x12cd5c=requireNotificationString(_0x28c68f[_0x5e00a7],_0x3f11f6+'.'+_0x5e00a7,_0x5bd442(0x1e6)+_0x5e00a7+_0x5bd442(0x2c3),_0x14c507);_0x12cd5c&&validateNotificationPlaceholders(_0x12cd5c,_0x3f11f6+'.'+_0x5e00a7,_0x14c507);}});}function validateNotificationActions(_0x30f2cd,_0x55e608,_0x1d0e58){const _0x238654=a298_0x4ad4d2;if(_0x30f2cd===undefined||_0x30f2cd===null)return;if(!Array[_0x238654(0x28d)](_0x30f2cd)){_0x1d0e58[_0x238654(0x28c)]({'path':_0x55e608,'message':_0x238654(0x246)});return;}_0x30f2cd[_0x238654(0x2f1)]>MAX_NOTIFICATION_ACTIONS&&_0x1d0e58[_0x238654(0x28c)]({'path':_0x55e608,'message':'Notification\x20template\x20supports\x20at\x20most\x20'+MAX_NOTIFICATION_ACTIONS+'\x20actions.'}),_0x30f2cd[_0x238654(0x237)]((_0x144169,_0x2f8fee)=>{const _0x466389=_0x238654,_0x48bdee=_0x55e608+'['+_0x2f8fee+']';if(!isRecord(_0x144169)){_0x1d0e58[_0x466389(0x28c)]({'path':_0x48bdee,'message':_0x466389(0x2dc)});return;}const _0x570a60=requireNotificationString(_0x144169[_0x466389(0x227)],_0x48bdee+_0x466389(0x1df),'Notification\x20action.text\x20is\x20required.',_0x1d0e58);if(_0x570a60)validateNotificationPlaceholders(_0x570a60,_0x48bdee+_0x466389(0x1df),_0x1d0e58);const _0x45756e=requireNotificationString(_0x144169[_0x466389(0x320)],_0x48bdee+_0x466389(0x2be),_0x466389(0x27b),_0x1d0e58);if(!_0x45756e)return;validateNotificationPlaceholders(_0x45756e,_0x48bdee+'.url',_0x1d0e58),!/^https?:\/\//i[_0x466389(0x1f1)](_0x45756e)&&!NOTIFICATION_ACTION_URL_PLACEHOLDER_PATTERN[_0x466389(0x1f1)](_0x45756e)&&_0x1d0e58['push']({'path':_0x48bdee+_0x466389(0x2be),'message':_0x466389(0x2f5)});});}function validateNotificationRecipients(_0x5bd9ea,_0x3b44e9,_0x41a4f2){const _0x126fde=a298_0x4ad4d2;if(_0x5bd9ea===undefined||_0x5bd9ea===null)return;if(!Array[_0x126fde(0x28d)](_0x5bd9ea)){_0x41a4f2[_0x126fde(0x28c)]({'path':_0x3b44e9,'message':'Notification\x20recipients\x20must\x20be\x20an\x20array.'});return;}let _0x261f05=![];_0x5bd9ea[_0x126fde(0x237)]((_0x472fe4,_0x571457)=>{const _0x3d5236=_0x126fde,_0x17812d=_0x3b44e9+'['+_0x571457+']';if(!isRecord(_0x472fe4)){_0x41a4f2[_0x3d5236(0x28c)]({'path':_0x17812d,'message':'Notification\x20recipient\x20must\x20be\x20an\x20object.'});return;}const _0x1030f9=requireNotificationString(_0x472fe4[_0x3d5236(0x2f2)],_0x17812d+_0x3d5236(0x205),_0x3d5236(0x256),_0x41a4f2);_0x1030f9&&!NOTIFICATION_RECIPIENT_TYPES[_0x3d5236(0x27a)](_0x1030f9['toUpperCase']())&&_0x41a4f2['push']({'path':_0x17812d+'.type','message':_0x3d5236(0x28f)});let _0x34a5a5='TO';_0x472fe4[_0x3d5236(0x280)]!==undefined&&_0x472fe4[_0x3d5236(0x280)]!==null&&(typeof _0x472fe4[_0x3d5236(0x280)]!==_0x3d5236(0x283)?(_0x41a4f2[_0x3d5236(0x28c)]({'path':_0x17812d+_0x3d5236(0x284),'message':_0x3d5236(0x2d0)}),_0x34a5a5=''):(_0x34a5a5=_0x472fe4[_0x3d5236(0x280)][_0x3d5236(0x2e1)]()[_0x3d5236(0x1d6)](),!NOTIFICATION_RECIPIENT_ROLES[_0x3d5236(0x27a)](_0x34a5a5)&&_0x41a4f2[_0x3d5236(0x28c)]({'path':_0x17812d+'.role','message':'Notification\x20recipient.role\x20must\x20be\x20TO,\x20CC,\x20or\x20BCC.'})));if(_0x34a5a5==='TO')_0x261f05=!![];const _0x1c75a1=requireNotificationString(_0x472fe4['value'],_0x17812d+'.value',_0x3d5236(0x1ea),_0x41a4f2);_0x1c75a1&&validateNotificationPlaceholders(_0x1c75a1,_0x17812d+'.value',_0x41a4f2);}),_0x5bd9ea[_0x126fde(0x2f1)]>0x0&&!_0x261f05&&_0x41a4f2[_0x126fde(0x28c)]({'path':_0x3b44e9,'message':'Explicit\x20notification\x20recipients\x20require\x20at\x20least\x20one\x20TO.'});}function requireNotificationString(_0x10749e,_0x223a1c,_0x55c428,_0x435aa0){const _0x42c829=a298_0x4ad4d2;if(typeof _0x10749e!==_0x42c829(0x283)||_0x10749e[_0x42c829(0x2e1)]()==='')return _0x435aa0['push']({'path':_0x223a1c,'message':_0x55c428}),undefined;return _0x10749e[_0x42c829(0x2e1)]();}function validateNotificationPlaceholders(_0x46de9c,_0x5494e0,_0x428bc5){const _0x8f3fc4=a298_0x4ad4d2;for(const _0x342951 of _0x46de9c[_0x8f3fc4(0x29d)](NOTIFICATION_PLACEHOLDER_PATTERN)){const _0x2eb244=_0x342951[0x1]?.[_0x8f3fc4(0x2e1)]()??'',_0x33a9b6=_0x2eb244['indexOf']('.'),_0x8e2d3c=_0x33a9b6>=0x0?_0x2eb244[_0x8f3fc4(0x27f)](0x0,_0x33a9b6):_0x2eb244,_0x46cbab=_0x33a9b6>=0x0?_0x2eb244[_0x8f3fc4(0x27f)](_0x33a9b6+0x1)['trim']():'';(![_0x8f3fc4(0x31b),'context','variables'][_0x8f3fc4(0x2fd)](_0x8e2d3c)||_0x46cbab==='')&&_0x428bc5[_0x8f3fc4(0x28c)]({'path':_0x5494e0,'message':_0x8f3fc4(0x1d8)+_0x342951[0x0]+'.'});}_0x46de9c[_0x8f3fc4(0x2eb)](NOTIFICATION_PLACEHOLDER_PATTERN,'')[_0x8f3fc4(0x2fd)]('${')&&_0x428bc5[_0x8f3fc4(0x28c)]({'path':_0x5494e0,'message':_0x8f3fc4(0x2d9)});}function validateEdge(_0x1acfd6,_0x4ac4ac,_0x5889db){const _0x530be9=a298_0x4ad4d2;_0x1acfd6[_0x530be9(0x1c5)]!==undefined&&typeof _0x1acfd6[_0x530be9(0x1c5)]!==_0x530be9(0x283)&&_0x5889db[_0x530be9(0x28c)]({'path':_0x4ac4ac+_0x530be9(0x1e8),'message':_0x530be9(0x2e0)}),_0x1acfd6['defaultFlow']!==undefined&&typeof _0x1acfd6['defaultFlow']!=='boolean'&&_0x5889db['push']({'path':_0x4ac4ac+_0x530be9(0x298),'message':'defaultFlow\x20must\x20be\x20a\x20boolean.'}),_0x1acfd6[_0x530be9(0x278)]!==undefined&&(!Array[_0x530be9(0x28d)](_0x1acfd6['waypoints'])?_0x5889db[_0x530be9(0x28c)]({'path':_0x4ac4ac+_0x530be9(0x266),'message':_0x530be9(0x2ba)}):_0x1acfd6[_0x530be9(0x278)][_0x530be9(0x237)]((_0x2e521f,_0x46fde0)=>{const _0x4bd583=_0x530be9;if(!isRecord(_0x2e521f)){_0x5889db[_0x4bd583(0x28c)]({'path':_0x4ac4ac+_0x4bd583(0x2ad)+_0x46fde0+']','message':_0x4bd583(0x2b4)});return;}for(const _0xa9fb67 of['x','y']){const _0x474beb=_0x2e521f[_0xa9fb67];(typeof _0x474beb!==_0x4bd583(0x292)||!Number['isFinite'](_0x474beb))&&_0x5889db[_0x4bd583(0x28c)]({'path':_0x4ac4ac+'.waypoints['+_0x46fde0+'].'+_0xa9fb67,'message':_0x4bd583(0x31a)+_0xa9fb67+'\x20must\x20be\x20a\x20finite\x20number.'});}})),_0x1acfd6[_0x530be9(0x28b)]!==undefined&&!CONDITION_TYPES[_0x530be9(0x27a)](_0x1acfd6['conditionType'])&&_0x5889db[_0x530be9(0x28c)]({'path':_0x4ac4ac+_0x530be9(0x21b),'message':_0x530be9(0x282)+String(_0x1acfd6['conditionType'])+'.'}),_0x1acfd6[_0x530be9(0x28b)]==='EXPRESSION'&&(typeof _0x1acfd6[_0x530be9(0x25b)]!=='string'||_0x1acfd6[_0x530be9(0x25b)][_0x530be9(0x2e1)]()==='')&&_0x5889db['push']({'path':_0x4ac4ac+_0x530be9(0x1ec),'message':_0x530be9(0x1f2)}),_0x1acfd6['defaultFlow']===!![]&&_0x1acfd6[_0x530be9(0x28b)]!==_0x530be9(0x232)&&_0x5889db[_0x530be9(0x28c)]({'path':_0x4ac4ac+'.defaultFlow','message':_0x530be9(0x1fb)}),_0x1acfd6[_0x530be9(0x2d4)]===!![]&&typeof _0x1acfd6[_0x530be9(0x25b)]==='string'&&_0x1acfd6['expression'][_0x530be9(0x2e1)]()!==''&&_0x5889db[_0x530be9(0x28c)]({'path':_0x4ac4ac+_0x530be9(0x1ec),'message':_0x530be9(0x1d4)});}function validateGraphShape(_0x287926,_0x54e144,_0x47be1b,_0x3dd4dd,_0x477b63,_0x248ef6,_0x416a55){const _0x214942=a298_0x4ad4d2;for(const [_0x46b1cf,_0x1f5f17]of _0x287926){const _0x49c947=_0x477b63[_0x214942(0x2b0)](_0x46b1cf)??[],_0x2d671d=_0x3dd4dd[_0x214942(0x2b0)](_0x46b1cf)??[];_0x1f5f17[_0x214942(0x2f2)]!==_0x214942(0x238)&&_0x49c947['length']===0x0&&_0x416a55[_0x214942(0x28c)]({'path':_0x214942(0x2e8)+_0x46b1cf,'message':_0x214942(0x315)});_0x1f5f17[_0x214942(0x2f2)]!=='END'&&_0x2d671d[_0x214942(0x2f1)]===0x0&&_0x416a55[_0x214942(0x28c)]({'path':'flowJson.nodes.'+_0x46b1cf,'message':'Node\x20has\x20no\x20outgoing\x20edge.'});_0x1f5f17[_0x214942(0x2f2)]===_0x214942(0x238)&&_0x49c947[_0x214942(0x2f1)]>0x0&&_0x416a55[_0x214942(0x28c)]({'path':_0x214942(0x2e8)+_0x46b1cf,'message':'START\x20node\x20must\x20not\x20have\x20incoming\x20edges.'});_0x1f5f17[_0x214942(0x2f2)]===_0x214942(0x1e2)&&_0x2d671d['length']>0x0&&_0x416a55[_0x214942(0x28c)]({'path':_0x214942(0x2e8)+_0x46b1cf,'message':_0x214942(0x1ed)});if(_0x1f5f17[_0x214942(0x2f2)]===_0x214942(0x2e3)){_0x2d671d['length']<0x2&&_0x416a55[_0x214942(0x28c)]({'path':'flowJson.nodes.'+_0x46b1cf,'message':'CONDITION\x20node\x20requires\x20at\x20least\x20two\x20outgoing\x20edges.'});const _0x538b65=_0x2d671d[_0x214942(0x2b8)](_0x537088=>_0x537088[_0x214942(0x2d4)]===!![]);_0x538b65['length']!==0x1&&_0x416a55[_0x214942(0x28c)]({'path':_0x214942(0x2e8)+_0x46b1cf,'message':_0x214942(0x2b6)});if(_0x538b65[_0x214942(0x2f1)]===0x1){const _0x53c907=_0x538b65[0x0],_0x5a01a8=_0x248ef6[_0x214942(0x2b0)](_0x53c907)??_0x214942(0x2da);_0x53c907[_0x214942(0x28b)]!==_0x214942(0x232)&&_0x416a55[_0x214942(0x28c)]({'path':_0x5a01a8+_0x214942(0x21b),'message':_0x214942(0x242)});_0x53c907['expression']!==undefined&&_0x416a55[_0x214942(0x28c)]({'path':_0x5a01a8+_0x214942(0x1ec),'message':_0x214942(0x30f)});for(const _0x11275f of _0x2d671d){if(_0x11275f===_0x53c907)continue;const _0x45460a=_0x248ef6[_0x214942(0x2b0)](_0x11275f)??_0x214942(0x2da);if(_0x11275f[_0x214942(0x28b)]!==_0x214942(0x29c))_0x416a55[_0x214942(0x28c)]({'path':_0x45460a+'.conditionType','message':_0x214942(0x2c9)});else(typeof _0x11275f[_0x214942(0x25b)]!==_0x214942(0x283)||_0x11275f[_0x214942(0x25b)][_0x214942(0x2e1)]()==='')&&_0x416a55[_0x214942(0x28c)]({'path':_0x45460a+_0x214942(0x1ec),'message':_0x214942(0x30b)});}}}if(_0x1f5f17[_0x214942(0x2f2)]===_0x214942(0x26c)&&(_0x1f5f17[_0x214942(0x1c4)]??_0x214942(0x26c))==='HANDLE'){if(_0x2d671d[_0x214942(0x2f1)]!==0x1)_0x416a55['push']({'path':_0x214942(0x2e8)+_0x46b1cf,'message':_0x214942(0x233)});else{const _0x5ce820=_0x2d671d[0x0];((_0x5ce820[_0x214942(0x28b)]??_0x214942(0x232))!==_0x214942(0x232)||_0x5ce820[_0x214942(0x2d4)]===!![]||typeof _0x5ce820[_0x214942(0x25b)]===_0x214942(0x283)&&_0x5ce820[_0x214942(0x25b)]['trim']()!=='')&&_0x416a55[_0x214942(0x28c)]({'path':_0x248ef6['get'](_0x5ce820)??_0x214942(0x2da),'message':_0x214942(0x29e)});}}else{if(_0x1f5f17[_0x214942(0x2f2)]===_0x214942(0x26c)){const _0xba4903=_0x2d671d[_0x214942(0x312)](_0x57ece2=>_0x57ece2[_0x214942(0x28b)]??_0x214942(0x232)),_0x15d6bb=_0xba4903['filter'](_0x3cd1ac=>_0x3cd1ac!==_0x214942(0x261)&&_0x3cd1ac!=='REJECTED');_0x15d6bb[_0x214942(0x2f1)]>0x0&&_0x416a55[_0x214942(0x28c)]({'path':_0x214942(0x2e8)+_0x46b1cf,'message':'APPROVAL\x20node\x20outgoing\x20edges\x20must\x20use\x20APPROVED\x20or\x20REJECTED.'}),_0xba4903[_0x214942(0x2b8)](_0x12eb64=>_0x12eb64===_0x214942(0x261))[_0x214942(0x2f1)]!==0x1&&_0x416a55[_0x214942(0x28c)]({'path':_0x214942(0x2e8)+_0x46b1cf,'message':_0x214942(0x231)}),_0xba4903[_0x214942(0x2b8)](_0x4dd1d5=>_0x4dd1d5===_0x214942(0x21f))[_0x214942(0x2f1)]!==0x1&&_0x416a55[_0x214942(0x28c)]({'path':_0x214942(0x2e8)+_0x46b1cf,'message':_0x214942(0x303)}),_0x2d671d[_0x214942(0x219)](_0x12d041=>_0x12d041[_0x214942(0x2d4)]===!![])&&_0x416a55[_0x214942(0x28c)]({'path':_0x214942(0x2e8)+_0x46b1cf,'message':'APPROVAL\x20task\x20decision\x20edges\x20must\x20not\x20be\x20default\x20flows.'});}}}const _0xfc63cf=new Set(),_0x46cc02=_0x48e77d=>{const _0x40fe92=_0x214942;if(_0xfc63cf[_0x40fe92(0x27a)](_0x48e77d))return;_0xfc63cf[_0x40fe92(0x2e7)](_0x48e77d);for(const _0x1a6976 of _0x3dd4dd[_0x40fe92(0x2b0)](_0x48e77d)??[]){const _0x5ed8bd=resolveEdgeEndpoint(_0x1a6976[_0x40fe92(0x2c1)],_0x1a6976[_0x40fe92(0x28a)]);if(_0x5ed8bd&&_0x287926[_0x40fe92(0x27a)](_0x5ed8bd))_0x46cc02(_0x5ed8bd);}};_0x46cc02(_0x54e144);for(const _0x544763 of _0x287926['keys']()){!_0xfc63cf[_0x214942(0x27a)](_0x544763)&&_0x416a55[_0x214942(0x28c)]({'path':_0x214942(0x2e8)+_0x544763,'message':_0x214942(0x2f7)});}const _0x3c2821=_0x47be1b['some'](_0x1c88ff=>_0xfc63cf[_0x214942(0x27a)](_0x1c88ff));if(!_0x3c2821){_0x416a55[_0x214942(0x28c)]({'path':'flowJson.edges','message':_0x214942(0x25c)});return;}const _0x140ab1=new Set(),_0x295adc=_0x49bdb9=>{const _0xac2837=_0x214942;if(_0x140ab1[_0xac2837(0x27a)](_0x49bdb9))return;_0x140ab1['add'](_0x49bdb9);for(const _0x5dca93 of _0x477b63[_0xac2837(0x2b0)](_0x49bdb9)??[]){const _0x5003d3=resolveEdgeEndpoint(_0x5dca93[_0xac2837(0x2f8)],_0x5dca93[_0xac2837(0x301)]);if(_0x5003d3&&_0x287926[_0xac2837(0x27a)](_0x5003d3))_0x295adc(_0x5003d3);}};for(const _0x476471 of _0x47be1b){if(_0x287926[_0x214942(0x27a)](_0x476471))_0x295adc(_0x476471);}for(const _0x450db5 of _0xfc63cf){!_0x140ab1[_0x214942(0x27a)](_0x450db5)&&_0x416a55[_0x214942(0x28c)]({'path':_0x214942(0x2e8)+_0x450db5,'message':_0x214942(0x21a)});}}function validateApprovalResults(_0x1a190d,_0x4a1d84,_0x2398d5,_0x444398){const _0x3a79c2=a298_0x4ad4d2;if(_0x4a1d84===0x0)return;const _0x9aed46=new Set(_0x2398d5[_0x3a79c2(0x312)](_0x1a6ccf=>_0x1a190d[_0x3a79c2(0x2b0)](_0x1a6ccf)?.[_0x3a79c2(0x1cd)])[_0x3a79c2(0x2b8)](_0x4c3ac8=>typeof _0x4c3ac8==='string'));for(const _0x1facd7 of[_0x3a79c2(0x261),_0x3a79c2(0x21f)]){!_0x9aed46[_0x3a79c2(0x27a)](_0x1facd7)&&_0x444398['push']({'path':'flowJson.nodes','message':_0x3a79c2(0x318)+_0x1facd7+'.'});}}function validateScriptResultReferences(_0x200003,_0x1c7e48,_0x443c04,_0x4f1547,_0x2e8e8a,_0x20416b,_0x154006){const _0x3c63da=a298_0x4ad4d2;if(_0x20416b[_0x3c63da(0x1f8)]===0x0)return;const _0x59e074=new Set(),_0x379a6a=_0x1a7eec=>{const _0x8fe98f=_0x3c63da;if(!_0x59e074['has'](_0x1a7eec)&&_0x200003[_0x8fe98f(0x27a)](_0x1a7eec)){_0x59e074[_0x8fe98f(0x2e7)](_0x1a7eec);for(const _0x24fc4d of _0x443c04[_0x8fe98f(0x2b0)](_0x1a7eec)??[]){const _0x281a80=resolveEdgeEndpoint(_0x24fc4d['target'],_0x24fc4d[_0x8fe98f(0x28a)]);if(_0x281a80)_0x379a6a(_0x281a80);}}};_0x379a6a(_0x1c7e48);const _0x3aa1a1=new Map();for(const _0x35190a of _0x59e074){_0x3aa1a1['set'](_0x35190a,_0x35190a===_0x1c7e48?new Set([_0x1c7e48]):new Set(_0x59e074));}let _0x58db18=!![];while(_0x58db18){_0x58db18=![];for(const _0x388886 of _0x59e074){if(_0x388886===_0x1c7e48)continue;const _0x8ddb14=(_0x4f1547['get'](_0x388886)??[])['map'](_0x1e397a=>resolveEdgeEndpoint(_0x1e397a['source'],_0x1e397a['sourceNodeId']))[_0x3c63da(0x2b8)](_0x1600db=>Boolean(_0x1600db&&_0x59e074['has'](_0x1600db)));if(_0x8ddb14['length']===0x0)continue;const _0x6d3f7c=new Set(_0x3aa1a1[_0x3c63da(0x2b0)](_0x8ddb14[0x0])??[]);for(const _0xe1af5 of _0x8ddb14[_0x3c63da(0x27f)](0x1)){const _0x44d9e4=_0x3aa1a1['get'](_0xe1af5)??new Set();for(const _0x202173 of _0x6d3f7c){if(!_0x44d9e4[_0x3c63da(0x27a)](_0x202173))_0x6d3f7c['delete'](_0x202173);}}_0x6d3f7c[_0x3c63da(0x2e7)](_0x388886);const _0x23fc6d=_0x3aa1a1[_0x3c63da(0x2b0)](_0x388886);!setsEqual(_0x23fc6d,_0x6d3f7c)&&(_0x3aa1a1['set'](_0x388886,_0x6d3f7c),_0x58db18=!![]);}}for(const [_0x24ece2,_0x34344a]of _0x443c04){const _0x3b2042=_0x3aa1a1[_0x3c63da(0x2b0)](_0x24ece2);if(!_0x3b2042)continue;for(const _0x5b398f of _0x34344a){if(_0x5b398f[_0x3c63da(0x28b)]!=='EXPRESSION'||typeof _0x5b398f[_0x3c63da(0x25b)]!==_0x3c63da(0x283))continue;for(const [_0x1d8c6e,_0x16eb20]of _0x20416b){expressionReferencesVariable(_0x5b398f[_0x3c63da(0x25b)],_0x1d8c6e)&&!_0x3b2042[_0x3c63da(0x27a)](_0x16eb20)&&_0x154006[_0x3c63da(0x28c)]({'path':(_0x2e8e8a['get'](_0x5b398f)??_0x3c63da(0x2da))+'.expression','message':'Expression\x20references\x20SCRIPT\x20resultVariable\x20'+_0x1d8c6e+_0x3c63da(0x1d9)+_0x16eb20+_0x3c63da(0x1d1)+_0x24ece2+'.'});}}}}function expressionReferencesVariable(_0x5d785f,_0x11117a){const _0x204cd0=a298_0x4ad4d2;let _0x38753c=0x0;while(_0x38753c<_0x5d785f[_0x204cd0(0x2f1)]){const _0x24e0ee=_0x5d785f[_0x38753c];if(_0x24e0ee==='\x27'||_0x24e0ee==='\x22'){_0x38753c=skipQuotedExpressionSegment(_0x5d785f,_0x38753c,_0x24e0ee);continue;}if(!/[A-Za-z_]/[_0x204cd0(0x1f1)](_0x24e0ee)){_0x38753c+=0x1;continue;}const _0xa12ea7=_0x38753c;_0x38753c+=0x1;while(_0x38753c<_0x5d785f[_0x204cd0(0x2f1)]&&/[A-Za-z0-9_]/[_0x204cd0(0x1f1)](_0x5d785f[_0x38753c])){_0x38753c+=0x1;}if(_0x5d785f[_0x204cd0(0x27f)](_0xa12ea7,_0x38753c)!==_0x11117a)continue;let _0x30427c=_0xa12ea7-0x1;while(_0x30427c>=0x0&&/\s/[_0x204cd0(0x1f1)](_0x5d785f[_0x30427c])){_0x30427c-=0x1;}if(_0x5d785f[_0x30427c]!=='.')return!![];}return![];}function skipQuotedExpressionSegment(_0x3b05bc,_0x419f97,_0x43d134){let _0x1ee12f=_0x419f97+0x1;while(_0x1ee12f<_0x3b05bc['length']){if(_0x3b05bc[_0x1ee12f]==='\x5c'){_0x1ee12f+=0x2;continue;}if(_0x3b05bc[_0x1ee12f]===_0x43d134)return _0x1ee12f+0x1;_0x1ee12f+=0x1;}return _0x1ee12f;}function resolveEffectiveResultVariable(_0x47b64d,_0x3fc9e1){const _0x4ee89e=a298_0x4ad4d2;if(_0x47b64d===undefined||_0x47b64d===null||_0x3fc9e1&&_0x47b64d==='')return DEFAULT_SCRIPT_RESULT_VARIABLE;if(typeof _0x47b64d!==_0x4ee89e(0x283)||!VARIABLE_PATTERN[_0x4ee89e(0x1f1)](_0x47b64d)||RESERVED_RESULT_VARIABLES[_0x4ee89e(0x27a)](_0x47b64d)||_0x47b64d['startsWith']('approval_sys_'))return undefined;return _0x47b64d;}function registerResultVariableOwner(_0x43acf8,_0x53a1d6,_0x3dcb59,_0x2bab54){const _0x14c131=a298_0x4ad4d2;if(_0x43acf8[_0x14c131(0x27a)](_0x53a1d6)){_0x2bab54[_0x14c131(0x28c)]({'path':'flowJson.nodes','message':_0x14c131(0x24c)+_0x53a1d6+'.'});return;}_0x43acf8['set'](_0x53a1d6,_0x3dcb59);}function setsEqual(_0x48661b,_0x2412d1){const _0xa08c96=a298_0x4ad4d2;return _0x48661b[_0xa08c96(0x1f8)]===_0x2412d1[_0xa08c96(0x1f8)]&&[..._0x48661b][_0xa08c96(0x2d5)](_0x4fae44=>_0x2412d1[_0xa08c96(0x27a)](_0x4fae44));}function isValidUserId(_0x31c6f4){const _0x316b02=a298_0x4ad4d2;if(typeof _0x31c6f4===_0x316b02(0x283))return _0x31c6f4[_0x316b02(0x2e1)]()['length']>0x0;return Number['isSafeInteger'](_0x31c6f4)&&Number(_0x31c6f4)>0x0;}function resolveEdgeEndpoint(_0x2f99e8,_0x1cc0d4){const _0x45f978=a298_0x4ad4d2;if(typeof _0x2f99e8==='string'&&_0x2f99e8[_0x45f978(0x2e1)]())return _0x2f99e8[_0x45f978(0x2e1)]();if(typeof _0x1cc0d4===_0x45f978(0x283)&&_0x1cc0d4[_0x45f978(0x2e1)]())return _0x1cc0d4[_0x45f978(0x2e1)]();return undefined;}function removeEmptyMetadata(_0x2cec10,_0x40b89e,_0x21c6ad,_0x373868){const _0x174200=a298_0x4ad4d2;if(Array[_0x174200(0x28d)](_0x2cec10)){_0x2cec10[_0x174200(0x237)]((_0x34b4e1,_0x521c0c)=>removeEmptyMetadata(_0x34b4e1,_0x40b89e+'['+_0x521c0c+']',_0x21c6ad,_0x373868));return;}if(!isRecord(_0x2cec10))return;for(const [_0x2a7265,_0x598d7f]of Object['entries'](_0x2cec10)){const _0x4052bb=_0x40b89e+'.'+_0x2a7265;if(_0x2a7265===_0x174200(0x2a4)&&isEmptyJsonValue(_0x598d7f)){delete _0x2cec10[_0x2a7265],_0x373868[_0x174200(0x28c)](_0x4052bb),_0x21c6ad['push']({'code':_0x174200(0x251),'path':_0x4052bb,'message':_0x4052bb+_0x174200(0x1dd)});continue;}removeEmptyMetadata(_0x598d7f,_0x4052bb,_0x21c6ad,_0x373868);}}function isEmptyJsonValue(_0x148750){const _0x1f706b=a298_0x4ad4d2;if(_0x148750===null||_0x148750===undefined)return!![];if(typeof _0x148750===_0x1f706b(0x283))return _0x148750['trim']()==='';if(Array[_0x1f706b(0x28d)](_0x148750))return _0x148750[_0x1f706b(0x2f1)]===0x0;return isRecord(_0x148750)&&Object[_0x1f706b(0x218)](_0x148750)[_0x1f706b(0x2f1)]===0x0;}function isRecord(_0x26d103){const _0x4ecce3=a298_0x4ad4d2;return typeof _0x26d103===_0x4ecce3(0x224)&&_0x26d103!==null&&!Array[_0x4ecce3(0x28d)](_0x26d103);}function cloneJsonValue(_0x440b01){const _0x34c6fc=a298_0x4ad4d2;return JSON[_0x34c6fc(0x2fc)](JSON[_0x34c6fc(0x2b5)](_0x440b01));}export async function readFlowConfigFile(_0x4086d7){const _0x510fb2=a298_0x4ad4d2,_0x54514d=await readFile(resolve(_0x4086d7),_0x510fb2(0x269));return JSON[_0x510fb2(0x2fc)](_0x54514d);}
1
+ const a299_0x3624a4=a299_0xbc96;(function(_0x15c048,_0x55b99b){const _0x2f133c=a299_0xbc96,_0x2c586c=_0x15c048();while(!![]){try{const _0x5f6a68=-parseInt(_0x2f133c(0x26b))/0x1+-parseInt(_0x2f133c(0x335))/0x2+-parseInt(_0x2f133c(0x275))/0x3+parseInt(_0x2f133c(0x29c))/0x4+-parseInt(_0x2f133c(0x295))/0x5*(parseInt(_0x2f133c(0x1d8))/0x6)+-parseInt(_0x2f133c(0x339))/0x7*(parseInt(_0x2f133c(0x23b))/0x8)+parseInt(_0x2f133c(0x26d))/0x9*(parseInt(_0x2f133c(0x1ef))/0xa);if(_0x5f6a68===_0x55b99b)break;else _0x2c586c['push'](_0x2c586c['shift']());}catch(_0x1c3fbf){_0x2c586c['push'](_0x2c586c['shift']());}}}(a299_0x5d1c,0xc8323));import{randomUUID}from'node:crypto';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_0x3624a4(0x309),'$id':a299_0x3624a4(0x221),'title':a299_0x3624a4(0x2f5),'type':a299_0x3624a4(0x322),'required':['flowName',a299_0x3624a4(0x288),'flowJson'],'$defs':{'userId':{'anyOf':[{'type':'string','minLength':0x1},{'type':a299_0x3624a4(0x23d),'minimum':0x1}]},'position':{'type':'object','required':['x','y'],'properties':{'x':{'type':a299_0x3624a4(0x1e3),'minimum':0x0},'y':{'type':a299_0x3624a4(0x1e3),'minimum':0x0}},'additionalProperties':!![]},'timeAmount':{'type':a299_0x3624a4(0x322),'required':['value','unit'],'properties':{'value':{'type':'integer','minimum':0x1},'unit':{'enum':[a299_0x3624a4(0x2bf),'MINUTES',a299_0x3624a4(0x2af),a299_0x3624a4(0x298)]}},'additionalProperties':!![]},'flowNode':{'type':a299_0x3624a4(0x322),'required':['id',a299_0x3624a4(0x314),a299_0x3624a4(0x336),a299_0x3624a4(0x27d)],'properties':{'id':{'type':a299_0x3624a4(0x2b1),'pattern':a299_0x3624a4(0x252)},'type':{'enum':['START',a299_0x3624a4(0x23a),'APPROVAL',a299_0x3624a4(0x329),a299_0x3624a4(0x2c5),'NOTIFICATION']},'name':{'type':'string','minLength':0x1},'path':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'position':{'$ref':a299_0x3624a4(0x2fa)},'approvalMode':{'enum':[a299_0x3624a4(0x312),'ALL',a299_0x3624a4(0x1db)]},'taskMode':{'enum':[a299_0x3624a4(0x204),a299_0x3624a4(0x284)]},'assignee':{'type':a299_0x3624a4(0x322),'required':[a299_0x3624a4(0x25f)],'properties':{'strategy':{'enum':['FIXED',a299_0x3624a4(0x20e)]},'userIds':{'type':'array','minItems':0x1,'items':{'$ref':'#/$defs/userId'}},'roleId':{'anyOf':[{'type':a299_0x3624a4(0x23d),'minimum':0x1},{'type':a299_0x3624a4(0x2b1),'pattern':a299_0x3624a4(0x2bd)}]}},'additionalProperties':!![]},'transferCandidates':{'type':a299_0x3624a4(0x322),'required':['strategy','userIds'],'properties':{'strategy':{'const':'FIXED'},'userIds':{'type':a299_0x3624a4(0x2b3),'minItems':0x1,'items':{'$ref':a299_0x3624a4(0x2a7)}}},'additionalProperties':!![]},'sequential':{'type':a299_0x3624a4(0x1d1)},'result':{'enum':[a299_0x3624a4(0x28f),a299_0x3624a4(0x2b2)]},'scriptName':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'resultVariable':{'type':a299_0x3624a4(0x2b1),'pattern':a299_0x3624a4(0x252)},'async':{'type':'object','properties':{'enabled':{'type':a299_0x3624a4(0x1d1)},'retryCount':{'type':'integer','minimum':0x1,'maximum':0xa},'retryInterval':{'$ref':a299_0x3624a4(0x25e)}},'additionalProperties':!![]},'timeout':{'type':a299_0x3624a4(0x322),'properties':{'enabled':{'type':'boolean'},'duration':{'$ref':'#/$defs/timeAmount'},'action':{'enum':[a299_0x3624a4(0x2f2),a299_0x3624a4(0x1fc),a299_0x3624a4(0x303)]},'interrupting':{'type':a299_0x3624a4(0x1d1)},'scriptName':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'resultVariable':{'type':a299_0x3624a4(0x2b1),'pattern':a299_0x3624a4(0x252)}},'additionalProperties':!![]},'cc':{'type':a299_0x3624a4(0x322),'required':['recipientUserIds'],'properties':{'recipientUserIds':{'type':a299_0x3624a4(0x2b3),'minItems':0x1,'maxItems':0x64,'uniqueItems':!![],'items':{'type':a299_0x3624a4(0x2b1),'minLength':0x1}},'visible':{'type':a299_0x3624a4(0x2b3),'uniqueItems':!![],'items':{'type':a299_0x3624a4(0x2b1),'minLength':0x1}},'readSources':![]},'additionalProperties':!![]},'config':{'type':'object','required':[a299_0x3624a4(0x2f7),a299_0x3624a4(0x2ab)],'properties':{'version':{'enum':['v1']},'configCode':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'failurePolicy':{'enum':[a299_0x3624a4(0x33f),a299_0x3624a4(0x223)]},'template':{'type':a299_0x3624a4(0x322),'required':['title',a299_0x3624a4(0x2e9)],'properties':{'title':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'summary':{'type':'string','minLength':0x1},'detailMarkdown':{'type':'string'},'facts':{'type':a299_0x3624a4(0x2b3),'maxItems':0x8,'items':{'type':'object','required':[a299_0x3624a4(0x258),a299_0x3624a4(0x22f)],'properties':{'label':{'type':'string','minLength':0x1},'value':{'type':a299_0x3624a4(0x2b1),'minLength':0x1}},'additionalProperties':!![]}},'actions':{'type':a299_0x3624a4(0x2b3),'maxItems':0x2,'items':{'type':a299_0x3624a4(0x322),'required':[a299_0x3624a4(0x33e),a299_0x3624a4(0x257)],'properties':{'text':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'url':{'type':'string','minLength':0x1}},'additionalProperties':!![]}}},'additionalProperties':!![]},'recipients':{'type':a299_0x3624a4(0x2b3),'items':{'type':'object','required':['type',a299_0x3624a4(0x22f)],'properties':{'type':{'enum':[a299_0x3624a4(0x2cb),'ROLE','EMAIL']},'value':{'type':'string','minLength':0x1},'role':{'enum':['TO','CC','BCC']}},'additionalProperties':!![]}}},'additionalProperties':!![]},'form':![],'formPermission':![]},'additionalProperties':!![]},'flowEdge':{'type':a299_0x3624a4(0x322),'properties':{'id':{'type':a299_0x3624a4(0x2b1),'pattern':a299_0x3624a4(0x252)},'source':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'target':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'sourceNodeId':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'targetNodeId':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'conditionType':{'enum':[a299_0x3624a4(0x29d),'APPROVED',a299_0x3624a4(0x2b2),a299_0x3624a4(0x27e)]},'expression':{'type':a299_0x3624a4(0x2b1)},'defaultFlow':{'type':a299_0x3624a4(0x1d1)},'name':{'type':a299_0x3624a4(0x2b1)},'waypoints':{'type':a299_0x3624a4(0x2b3),'items':{'$ref':'#/$defs/position'}}},'allOf':[{'anyOf':[{'required':[a299_0x3624a4(0x24b)]},{'required':['sourceNodeId']}]},{'anyOf':[{'required':[a299_0x3624a4(0x1f7)]},{'required':[a299_0x3624a4(0x2df)]}]}],'additionalProperties':!![]}},'properties':{'id':![],'appCode':![],'flowName':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'flowDesc':{'type':a299_0x3624a4(0x2b1)},'flowType':{'enum':[a299_0x3624a4(0x2b0),a299_0x3624a4(0x229)]},'datasetCode':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'pageId':{'type':'integer','minimum':0x1,'maximum':Number[a299_0x3624a4(0x2d0)]},'pageIds':{'type':a299_0x3624a4(0x2b3),'items':{'type':a299_0x3624a4(0x23d),'minimum':0x1,'maximum':Number[a299_0x3624a4(0x2d0)]}},'templateName':![],'flowJson':{'type':a299_0x3624a4(0x322),'required':[a299_0x3624a4(0x231),a299_0x3624a4(0x29e)],'properties':{'flowKey':![],'flowCode':![],'flowName':![],'bindDatasetCode':![],'datasetCode':![],'appCode':![],'pageId':![],'templateName':![],'schemaVersion':{'type':a299_0x3624a4(0x2b1),'const':a299_0x3624a4(0x28c),'description':a299_0x3624a4(0x299)},'formSchema':![],'formDefinitions':![],'formPermissions':![],'pageMode':{'const':a299_0x3624a4(0x286)},'startPageId':![],'startPath':{'type':a299_0x3624a4(0x2b1),'minLength':0x1},'nodes':{'type':a299_0x3624a4(0x2b3),'minItems':0x1,'items':{'$ref':a299_0x3624a4(0x327)}},'edges':{'type':'array','minItems':0x1,'items':{'$ref':a299_0x3624a4(0x22a)}}},'additionalProperties':!![]}},'additionalProperties':!![]};const REMOVED_FLOW_JSON_FIELDS=[a299_0x3624a4(0x26c),a299_0x3624a4(0x313),a299_0x3624a4(0x333),a299_0x3624a4(0x31f),a299_0x3624a4(0x2aa),'appCode',a299_0x3624a4(0x315),a299_0x3624a4(0x25c)],REMOVED_ROOT_FIELDS=['id',a299_0x3624a4(0x25b),a299_0x3624a4(0x25c)],DEFAULT_FLOW_SCHEMA_VERSION=a299_0x3624a4(0x28c),NODE_TYPES=new Set([a299_0x3624a4(0x282),'END',a299_0x3624a4(0x204),a299_0x3624a4(0x329),a299_0x3624a4(0x2c5),a299_0x3624a4(0x300)]),CONDITION_TYPES=new Set([a299_0x3624a4(0x29d),a299_0x3624a4(0x28f),a299_0x3624a4(0x2b2),a299_0x3624a4(0x27e)]),APPROVAL_MODES=new Set([a299_0x3624a4(0x312),a299_0x3624a4(0x2a3),'ANY']),APPROVAL_TASK_MODES=new Set([a299_0x3624a4(0x204),a299_0x3624a4(0x284)]),FLOW_TIME_UNITS=new Set([a299_0x3624a4(0x2bf),a299_0x3624a4(0x1e6),'HOURS',a299_0x3624a4(0x298)]),APPROVAL_TIMEOUT_ACTIONS=new Set([a299_0x3624a4(0x2f2),a299_0x3624a4(0x1fc),a299_0x3624a4(0x303)]),FLOW_TYPES=new Set([a299_0x3624a4(0x2b0),a299_0x3624a4(0x229)]),FLOW_PAGE_MODES=new Set(['CUSTOM_PAGE',a299_0x3624a4(0x263)]),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(['CONTINUE',a299_0x3624a4(0x223)]),NOTIFICATION_RECIPIENT_TYPES=new Set([a299_0x3624a4(0x2cb),'ROLE',a299_0x3624a4(0x211)]),NOTIFICATION_RECIPIENT_ROLES=new Set(['TO','CC',a299_0x3624a4(0x1d9)]),MAX_NOTIFICATION_FACTS=0x8,MAX_NOTIFICATION_ACTIONS=0x2,MAX_ASYNC_RETRY_COUNT=0xa,MAX_CC_RECIPIENTS=0x64,DEFAULT_SCRIPT_RESULT_VARIABLE='scriptResult',UNSUPPORTED_FORM_MESSAGE=a299_0x3624a4(0x2e6),UNSUPPORTED_PLATFORM_FORM_MESSAGE=a299_0x3624a4(0x296),RESERVED_RESULT_VARIABLES=new Set(['formData',a299_0x3624a4(0x27a),a299_0x3624a4(0x2e2),a299_0x3624a4(0x344),a299_0x3624a4(0x246),a299_0x3624a4(0x2e4),a299_0x3624a4(0x317),'approval_sys_pageId',a299_0x3624a4(0x2d4),'approval_sys_dataId']);export function normalizeFlowConfig(_0xaff28e){const _0x1e18c5=a299_0x3624a4;if(!isRecord(_0xaff28e))throw new TypeError(_0x1e18c5(0x2e8));const _0x4d0f2b=cloneJsonValue(_0xaff28e),_0x501d25=_0x4d0f2b[_0x1e18c5(0x262)],_0x19090c=isRecord(_0x501d25)?cloneJsonValue(_0x501d25):{},_0x102c79=[],_0x465d93=[];for(const _0x5bff7b of REMOVED_ROOT_FIELDS){if(!Object['prototype'][_0x1e18c5(0x2c3)][_0x1e18c5(0x2e1)](_0x4d0f2b,_0x5bff7b))continue;delete _0x4d0f2b[_0x5bff7b],_0x465d93['push'](_0x5bff7b),_0x102c79[_0x1e18c5(0x217)]({'code':_0x1e18c5(0x2f3),'path':_0x5bff7b,'message':_0x5bff7b+'\x20is\x20not\x20part\x20of\x20the\x20portable\x20FlowConfig\x20and\x20was\x20removed.'});}for(const _0xb8dbcc of REMOVED_FLOW_JSON_FIELDS){if(!Object[_0x1e18c5(0x1f8)]['hasOwnProperty'][_0x1e18c5(0x2e1)](_0x19090c,_0xb8dbcc))continue;const _0x284a5a=_0x1e18c5(0x320)+_0xb8dbcc;delete _0x19090c[_0xb8dbcc],_0x465d93[_0x1e18c5(0x217)](_0x284a5a),_0x102c79['push']({'code':_0x1e18c5(0x2f3),'path':_0x284a5a,'message':_0x284a5a+'\x20is\x20not\x20part\x20of\x20the\x20portable\x20FlowConfig\x20and\x20was\x20removed.'});}if(Object[_0x1e18c5(0x1f8)]['hasOwnProperty'][_0x1e18c5(0x2e1)](_0x19090c,_0x1e18c5(0x32b))){const _0xff6319=_0x19090c[_0x1e18c5(0x32b)],_0x43d330=typeof _0xff6319===_0x1e18c5(0x2b1)?_0xff6319['trim']():_0xff6319;if(isEmptyJsonValue(_0xff6319)||_0x43d330===DEFAULT_FLOW_SCHEMA_VERSION){const _0x4e172d=_0x1e18c5(0x31a);delete _0x19090c[_0x1e18c5(0x32b)],_0x465d93['push'](_0x4e172d),_0x102c79[_0x1e18c5(0x217)]({'code':_0x1e18c5(0x2f3),'path':_0x4e172d,'message':_0x4e172d+_0x1e18c5(0x236)+DEFAULT_FLOW_SCHEMA_VERSION+_0x1e18c5(0x2ad)});}}removeEmptyMetadata(_0x19090c,_0x1e18c5(0x262),_0x102c79,_0x465d93);_0x4d0f2b['flowType']===_0x1e18c5(0x229)&&!Object[_0x1e18c5(0x1f8)][_0x1e18c5(0x2c3)][_0x1e18c5(0x2e1)](_0x19090c,'pageMode')&&(_0x19090c[_0x1e18c5(0x239)]=_0x1e18c5(0x286));_0x4d0f2b[_0x1e18c5(0x262)]=_0x19090c;if(typeof _0x4d0f2b[_0x1e18c5(0x333)]===_0x1e18c5(0x2b1))_0x4d0f2b[_0x1e18c5(0x333)]=_0x4d0f2b[_0x1e18c5(0x333)][_0x1e18c5(0x1de)]();return{'config':_0x4d0f2b,'warnings':_0x102c79,'removedPaths':_0x465d93};}export function validateFlowConfig(_0x45fa02){const _0x31dc61=a299_0x3624a4;let _0x49c29f;try{_0x49c29f=normalizeFlowConfig(_0x45fa02);}catch(_0xe6261e){const _0x3107b1=_0xe6261e instanceof Error?_0xe6261e[_0x31dc61(0x338)]:String(_0xe6261e),_0x591757={'flowJson':{}};return{'valid':![],'errors':[{'path':'$','message':_0x3107b1}],'warnings':[],'normalized':_0x591757,'validationConfig':_0x591757};}const _0x185be2=_0x49c29f[_0x31dc61(0x24a)],_0x29196b=cloneJsonValue(_0x185be2),_0x1ba05c=_0x29196b[_0x31dc61(0x262)];_0x1ba05c[_0x31dc61(0x26c)]=_0x31dc61(0x2c8),_0x1ba05c[_0x31dc61(0x333)]=_0x185be2[_0x31dc61(0x333)];typeof _0x185be2[_0x31dc61(0x2aa)]===_0x31dc61(0x2b1)&&_0x185be2[_0x31dc61(0x2aa)]['trim']()&&(_0x1ba05c[_0x31dc61(0x31f)]=_0x185be2[_0x31dc61(0x2aa)][_0x31dc61(0x1de)]());const _0x49424a=[];return validateOuterMetadata(_0x185be2,_0x49424a),validateFlowClassification(_0x185be2,_0x49424a),validateGraph(_0x185be2[_0x31dc61(0x262)],_0x49424a),{'valid':_0x49424a[_0x31dc61(0x2fc)]===0x0,'errors':_0x49424a,'warnings':_0x49c29f[_0x31dc61(0x218)],'normalized':_0x185be2,'validationConfig':_0x29196b};}function validateFlowClassification(_0x13076f,_0x146fe6){const _0x2441e4=a299_0x3624a4;if(!isRecord(_0x13076f[_0x2441e4(0x262)]))return;const _0x3f7a23=_0x13076f[_0x2441e4(0x288)],_0x47be33=_0x13076f[_0x2441e4(0x262)][_0x2441e4(0x239)];_0x47be33!==undefined&&(typeof _0x47be33!==_0x2441e4(0x2b1)||!FLOW_PAGE_MODES[_0x2441e4(0x227)](_0x47be33))&&_0x146fe6[_0x2441e4(0x217)]({'path':_0x2441e4(0x22e),'message':_0x2441e4(0x307)+String(_0x47be33)+'.'});_0x3f7a23===_0x2441e4(0x2b0)&&_0x47be33!==undefined&&_0x146fe6['push']({'path':'flowJson.pageMode','message':'pageMode\x20applies\x20only\x20to\x20INDEPENDENT_FLOW.'});_0x3f7a23==='INDEPENDENT_FLOW'&&_0x47be33===_0x2441e4(0x263)&&_0x146fe6['push']({'path':_0x2441e4(0x22e),'message':UNSUPPORTED_PLATFORM_FORM_MESSAGE});(_0x3f7a23===_0x2441e4(0x2b0)||_0x3f7a23===_0x2441e4(0x229))&&validateCustomPageNavigation(_0x13076f,_0x3f7a23,_0x47be33,_0x146fe6);if(_0x3f7a23!==_0x2441e4(0x2b0)||!Array[_0x2441e4(0x32d)](_0x13076f[_0x2441e4(0x262)]['nodes']))return;_0x13076f[_0x2441e4(0x262)][_0x2441e4(0x231)][_0x2441e4(0x340)]((_0x42f742,_0x107340)=>{const _0x932eeb=_0x2441e4;isRecord(_0x42f742)&&_0x42f742[_0x932eeb(0x314)]==='APPROVAL'&&_0x42f742[_0x932eeb(0x225)]===_0x932eeb(0x284)&&_0x146fe6[_0x932eeb(0x217)]({'path':_0x932eeb(0x2c9)+_0x107340+'].taskMode','message':_0x932eeb(0x319)});});}function validateCustomPageNavigation(_0x505f96,_0x36cdd6,_0x14b5c4,_0x2f5c8b){const _0x697b63=a299_0x3624a4,_0x174cbb=_0x505f96[_0x697b63(0x262)][_0x697b63(0x2a2)];_0x174cbb!==undefined&&_0x2f5c8b[_0x697b63(0x217)]({'path':_0x697b63(0x1e4),'message':_0x697b63(0x210)});const _0x57feed=_0x505f96[_0x697b63(0x262)][_0x697b63(0x201)];_0x57feed!==undefined&&(typeof _0x57feed!==_0x697b63(0x2b1)||_0x57feed['trim']()==='')&&_0x2f5c8b[_0x697b63(0x217)]({'path':_0x697b63(0x277),'message':_0x697b63(0x249)});const _0x3bc3a0=Array[_0x697b63(0x32d)](_0x505f96['flowJson']['nodes'])?_0x505f96[_0x697b63(0x262)][_0x697b63(0x231)][_0x697b63(0x21b)]((_0x5ccd12,_0x2237d9)=>({'node':_0x5ccd12,'index':_0x2237d9}))[_0x697b63(0x342)](({node:_0x1bd874})=>isRecord(_0x1bd874)&&_0x1bd874[_0x697b63(0x283)]!==undefined):[],_0x37b092=_0x57feed!==undefined||_0x3bc3a0[_0x697b63(0x2fc)]>0x0,_0x4b700f=_0x14b5c4===undefined&&_0x36cdd6===_0x697b63(0x229)?_0x697b63(0x286):_0x14b5c4;_0x37b092&&(_0x36cdd6!=='INDEPENDENT_FLOW'||_0x4b700f!==_0x697b63(0x286))&&(_0x57feed!==undefined&&_0x2f5c8b[_0x697b63(0x217)]({'path':_0x697b63(0x277),'message':_0x697b63(0x242)}),_0x3bc3a0[_0x697b63(0x340)](({index:_0x1fe0e3})=>{const _0x22dbf7=_0x697b63;_0x2f5c8b['push']({'path':_0x22dbf7(0x2c9)+_0x1fe0e3+_0x22dbf7(0x214),'message':_0x22dbf7(0x30e)});}));}export async function writeNormalizedFlowConfig(_0x5afb33,_0x11dd90,_0x386b39={}){const _0xe37b2b=a299_0x3624a4,_0x991d88=resolve(_0x5afb33),_0x2b7e87=_0x991d88+'.'+process['pid']+'.'+randomUUID()+_0xe37b2b(0x1e1),_0x592f4a=JSON[_0xe37b2b(0x31e)](_0x11dd90,null,0x2)+'\x0a';let _0x33dc5a;try{try{_0x33dc5a=(await stat(_0x991d88))[_0xe37b2b(0x269)]&0x1ff;}catch{_0x33dc5a=undefined;}await writeFile(_0x2b7e87,_0x592f4a,{'encoding':_0xe37b2b(0x261),'flag':'wx','mode':_0x33dc5a??0x1a4});if(_0x33dc5a!==undefined)await chmod(_0x2b7e87,_0x33dc5a);_0x386b39[_0xe37b2b(0x2d9)]===![]?(await link(_0x2b7e87,_0x991d88),await unlink(_0x2b7e87)):await rename(_0x2b7e87,_0x991d88);}finally{await unlink(_0x2b7e87)[_0xe37b2b(0x1f2)](()=>undefined);}}function validateOuterMetadata(_0xa8c476,_0x1140af){const _0x526a68=a299_0x3624a4;(typeof _0xa8c476[_0x526a68(0x333)]!==_0x526a68(0x2b1)||_0xa8c476[_0x526a68(0x333)][_0x526a68(0x1de)]()==='')&&_0x1140af[_0x526a68(0x217)]({'path':_0x526a68(0x333),'message':'flowName\x20is\x20required.'});_0xa8c476['flowDesc']!==undefined&&typeof _0xa8c476[_0x526a68(0x2d6)]!==_0x526a68(0x2b1)&&_0x1140af[_0x526a68(0x217)]({'path':_0x526a68(0x2d6),'message':_0x526a68(0x235)});if(_0xa8c476[_0x526a68(0x288)]===undefined||_0xa8c476[_0x526a68(0x288)]===null)_0x1140af[_0x526a68(0x217)]({'path':'flowType','message':'flowType\x20is\x20required.'});else(typeof _0xa8c476[_0x526a68(0x288)]!==_0x526a68(0x2b1)||!FLOW_TYPES['has'](_0xa8c476[_0x526a68(0x288)]))&&_0x1140af['push']({'path':_0x526a68(0x288),'message':'Unsupported\x20flowType:\x20'+String(_0xa8c476[_0x526a68(0x288)])+'.'});_0xa8c476[_0x526a68(0x2aa)]!==undefined&&typeof _0xa8c476[_0x526a68(0x2aa)]!==_0x526a68(0x2b1)&&_0x1140af['push']({'path':'datasetCode','message':_0x526a68(0x33d)});_0xa8c476['pageIds']===undefined&&_0xa8c476[_0x526a68(0x315)]!==undefined&&(!Number[_0x526a68(0x26f)](_0xa8c476[_0x526a68(0x315)])||_0xa8c476[_0x526a68(0x315)]<=0x0)&&_0x1140af[_0x526a68(0x217)]({'path':_0x526a68(0x315),'message':'pageId\x20must\x20be\x20a\x20positive\x20safe\x20integer.'});if(_0xa8c476[_0x526a68(0x268)]!==undefined){if(!Array[_0x526a68(0x32d)](_0xa8c476[_0x526a68(0x268)])||_0xa8c476['pageIds'][_0x526a68(0x267)](_0x485f20=>!Number[_0x526a68(0x26f)](_0x485f20)||_0x485f20<=0x0))_0x1140af[_0x526a68(0x217)]({'path':_0x526a68(0x268),'message':_0x526a68(0x1f1)});else[...new Set(_0xa8c476[_0x526a68(0x268)])][_0x526a68(0x2c6)](',')[_0x526a68(0x2fc)]>0x800&&_0x1140af['push']({'path':'pageIds','message':_0x526a68(0x2de)});_0xa8c476[_0x526a68(0x288)]===_0x526a68(0x229)&&Array[_0x526a68(0x32d)](_0xa8c476['pageIds'])&&_0xa8c476[_0x526a68(0x268)][_0x526a68(0x2fc)]>0x0&&_0x1140af[_0x526a68(0x217)]({'path':'pageIds','message':'INDEPENDENT_FLOW\x20cannot\x20bind\x20pageIds.'});}_0xa8c476[_0x526a68(0x288)]===_0x526a68(0x229)&&_0xa8c476[_0x526a68(0x2aa)]!==undefined&&_0x1140af[_0x526a68(0x217)]({'path':_0x526a68(0x2aa),'message':'INDEPENDENT_FLOW\x20cannot\x20bind\x20datasetCode.'}),_0xa8c476[_0x526a68(0x288)]==='INDEPENDENT_FLOW'&&_0xa8c476[_0x526a68(0x268)]===undefined&&_0xa8c476[_0x526a68(0x315)]!==undefined&&_0x1140af[_0x526a68(0x217)]({'path':_0x526a68(0x315),'message':_0x526a68(0x1f3)});}function validateGraph(_0x412f39,_0x131f42){const _0x2e4559=a299_0x3624a4;if(!isRecord(_0x412f39)){_0x131f42['push']({'path':_0x2e4559(0x262),'message':'flowJson\x20must\x20be\x20an\x20object.'});return;}!Array[_0x2e4559(0x32d)](_0x412f39[_0x2e4559(0x231)])&&_0x131f42[_0x2e4559(0x217)]({'path':_0x2e4559(0x2d8),'message':_0x2e4559(0x26e)});!Array[_0x2e4559(0x32d)](_0x412f39[_0x2e4559(0x29e)])&&_0x131f42[_0x2e4559(0x217)]({'path':_0x2e4559(0x2bb),'message':'edges\x20must\x20be\x20an\x20array.'});Object['prototype']['hasOwnProperty']['call'](_0x412f39,_0x2e4559(0x32b))&&_0x131f42[_0x2e4559(0x217)]({'path':'flowJson.schemaVersion','message':_0x2e4559(0x28b)+String(_0x412f39[_0x2e4559(0x32b)])+_0x2e4559(0x311)+DEFAULT_FLOW_SCHEMA_VERSION+'.'});for(const _0x4aaa69 of['formSchema',_0x2e4559(0x331),'formPermissions']){Object['prototype'][_0x2e4559(0x2c3)][_0x2e4559(0x2e1)](_0x412f39,_0x4aaa69)&&_0x131f42[_0x2e4559(0x217)]({'path':_0x2e4559(0x320)+_0x4aaa69,'message':UNSUPPORTED_FORM_MESSAGE});}if(!Array[_0x2e4559(0x32d)](_0x412f39[_0x2e4559(0x231)])||!Array[_0x2e4559(0x32d)](_0x412f39[_0x2e4559(0x29e)]))return;const _0x1244c1=new Map(),_0x14add1=[],_0x59c936=[],_0x3aa61d=new Map(),_0x421faf=new Map(),_0x71cd9a=new Set();let _0x21d6ae=0x0;_0x412f39[_0x2e4559(0x231)][_0x2e4559(0x340)]((_0x5625dc,_0x3ff46a)=>{const _0x2fffbc=_0x2e4559,_0x4b4912='flowJson.nodes['+_0x3ff46a+']';if(!isRecord(_0x5625dc)){_0x131f42['push']({'path':_0x4b4912,'message':_0x2fffbc(0x1fe)});return;}const _0x2720a1=_0x5625dc;if(typeof _0x2720a1['id']!=='string'||!BPMN_ID_PATTERN[_0x2fffbc(0x226)](_0x2720a1['id']))_0x131f42[_0x2fffbc(0x217)]({'path':_0x4b4912+_0x2fffbc(0x2db),'message':_0x2fffbc(0x290)});else _0x1244c1['has'](_0x2720a1['id'])?_0x131f42['push']({'path':_0x4b4912+'.id','message':_0x2fffbc(0x251)+_0x2720a1['id']+'.'}):(_0x1244c1[_0x2fffbc(0x289)](_0x2720a1['id'],_0x2720a1),_0x71cd9a[_0x2fffbc(0x224)](_0x2720a1['id']));if(!NODE_TYPES[_0x2fffbc(0x227)](_0x2720a1[_0x2fffbc(0x314)]))_0x131f42[_0x2fffbc(0x217)]({'path':_0x4b4912+'.type','message':_0x2fffbc(0x341)+String(_0x2720a1[_0x2fffbc(0x314)])+'.'});else{if(_0x2720a1['type']==='START')_0x14add1['push'](_0x2720a1['id']);else _0x2720a1[_0x2fffbc(0x314)]==='END'&&_0x59c936[_0x2fffbc(0x217)](_0x2720a1['id']);}_0x2720a1[_0x2fffbc(0x314)]===_0x2fffbc(0x204)&&(_0x2720a1[_0x2fffbc(0x225)]===undefined||_0x2720a1[_0x2fffbc(0x225)]===_0x2fffbc(0x204))&&(_0x21d6ae+=0x1);validateNode(_0x2720a1,_0x4b4912,_0x131f42);if(_0x2720a1[_0x2fffbc(0x314)]===_0x2fffbc(0x2c5)){const _0x15ffa2=resolveEffectiveResultVariable(_0x2720a1[_0x2fffbc(0x232)],![]);_0x15ffa2&&(registerResultVariableOwner(_0x421faf,_0x15ffa2,_0x2720a1['id'],_0x131f42),!_0x3aa61d['has'](_0x15ffa2)&&_0x3aa61d[_0x2fffbc(0x289)](_0x15ffa2,_0x2720a1['id']));}if(_0x2720a1[_0x2fffbc(0x314)]===_0x2fffbc(0x204)&&isRecord(_0x2720a1[_0x2fffbc(0x304)])&&_0x2720a1[_0x2fffbc(0x304)][_0x2fffbc(0x2ed)]===!![]&&_0x2720a1[_0x2fffbc(0x304)][_0x2fffbc(0x32c)]===_0x2fffbc(0x303)){const _0x230665=resolveEffectiveResultVariable(_0x2720a1[_0x2fffbc(0x304)][_0x2fffbc(0x232)],!![]);_0x230665&&registerResultVariableOwner(_0x421faf,_0x230665,_0x2720a1['id']+'.timeout',_0x131f42);}});_0x14add1[_0x2e4559(0x2fc)]!==0x1&&_0x131f42['push']({'path':_0x2e4559(0x2d8),'message':_0x2e4559(0x2a1)});_0x59c936['length']===0x0&&_0x131f42[_0x2e4559(0x217)]({'path':_0x2e4559(0x2d8),'message':_0x2e4559(0x2f4)});const _0x1c154a=new Map(),_0x742a6d=new Map(),_0x262fc6=new Map(),_0x1dfca5=new Set();_0x412f39[_0x2e4559(0x29e)]['forEach']((_0x294c4f,_0x1c55a8)=>{const _0x5dd63b=_0x2e4559,_0x652b56=_0x5dd63b(0x228)+_0x1c55a8+']';if(!isRecord(_0x294c4f)){_0x131f42[_0x5dd63b(0x217)]({'path':_0x652b56,'message':_0x5dd63b(0x2ea)});return;}const _0x254ddb=_0x294c4f;_0x262fc6[_0x5dd63b(0x289)](_0x254ddb,_0x652b56);const _0x4d80e9=resolveEdgeEndpoint(_0x254ddb[_0x5dd63b(0x24b)],_0x254ddb[_0x5dd63b(0x1f4)]),_0x29170c=resolveEdgeEndpoint(_0x254ddb[_0x5dd63b(0x1f7)],_0x254ddb['targetNodeId']);if(!_0x4d80e9)_0x131f42[_0x5dd63b(0x217)]({'path':_0x652b56+_0x5dd63b(0x208),'message':_0x5dd63b(0x2a6)});if(!_0x29170c)_0x131f42[_0x5dd63b(0x217)]({'path':_0x652b56+'.target','message':_0x5dd63b(0x30c)});_0x4d80e9&&!_0x1244c1[_0x5dd63b(0x227)](_0x4d80e9)&&_0x131f42[_0x5dd63b(0x217)]({'path':_0x652b56+_0x5dd63b(0x208),'message':_0x5dd63b(0x1fa)+_0x4d80e9+'.'});_0x29170c&&!_0x1244c1[_0x5dd63b(0x227)](_0x29170c)&&_0x131f42[_0x5dd63b(0x217)]({'path':_0x652b56+_0x5dd63b(0x1e5),'message':_0x5dd63b(0x308)+_0x29170c+'.'});if(_0x254ddb['id']!==undefined){if(typeof _0x254ddb['id']!==_0x5dd63b(0x2b1)||!BPMN_ID_PATTERN[_0x5dd63b(0x226)](_0x254ddb['id']))_0x131f42[_0x5dd63b(0x217)]({'path':_0x652b56+_0x5dd63b(0x2db),'message':_0x5dd63b(0x205)});else{if(_0x71cd9a[_0x5dd63b(0x227)](_0x254ddb['id']))_0x131f42[_0x5dd63b(0x217)]({'path':_0x652b56+_0x5dd63b(0x2db),'message':_0x5dd63b(0x310)+_0x254ddb['id']+'.'});else!_0x71cd9a[_0x5dd63b(0x227)](_0x254ddb['id'])&&_0x71cd9a[_0x5dd63b(0x224)](_0x254ddb['id']);}}if(_0x4d80e9&&_0x29170c){const _0x4529be=_0x4d80e9+'\x00'+_0x29170c+'\x00'+(_0x254ddb[_0x5dd63b(0x2dc)]??_0x5dd63b(0x29d));_0x1dfca5['has'](_0x4529be)?_0x131f42['push']({'path':_0x652b56,'message':_0x5dd63b(0x212)+_0x4d80e9+_0x5dd63b(0x332)+_0x29170c+'\x20('+(_0x254ddb['conditionType']??_0x5dd63b(0x29d))+').'}):_0x1dfca5[_0x5dd63b(0x224)](_0x4529be);}validateEdge(_0x254ddb,_0x652b56,_0x131f42),_0x4d80e9&&_0x29170c&&(_0x1c154a[_0x5dd63b(0x1f5)](_0x4d80e9)?.['push'](_0x254ddb)??_0x1c154a['set'](_0x4d80e9,[_0x254ddb]),_0x742a6d[_0x5dd63b(0x1f5)](_0x29170c)?.[_0x5dd63b(0x217)](_0x254ddb)??_0x742a6d[_0x5dd63b(0x289)](_0x29170c,[_0x254ddb]));});if(_0x14add1[_0x2e4559(0x2fc)]!==0x1)return;validateGraphShape(_0x1244c1,_0x14add1[0x0],_0x59c936,_0x1c154a,_0x742a6d,_0x262fc6,_0x131f42),validateScriptResultReferences(_0x1244c1,_0x14add1[0x0],_0x1c154a,_0x742a6d,_0x262fc6,_0x3aa61d,_0x131f42),validateApprovalResults(_0x1244c1,_0x21d6ae,_0x59c936,_0x131f42);}function validateNode(_0x1db3cb,_0x54431b,_0x51e9f3){const _0x578bae=a299_0x3624a4;for(const _0x5c4c24 of[_0x578bae(0x1dd),'formPermission']){Object[_0x578bae(0x1f8)]['hasOwnProperty'][_0x578bae(0x2e1)](_0x1db3cb,_0x5c4c24)&&_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+'.'+_0x5c4c24,'message':UNSUPPORTED_FORM_MESSAGE});}if(!NODE_TYPES[_0x578bae(0x227)](_0x1db3cb[_0x578bae(0x314)]))return;(typeof _0x1db3cb[_0x578bae(0x336)]!=='string'||_0x1db3cb[_0x578bae(0x336)][_0x578bae(0x1de)]()==='')&&_0x51e9f3['push']({'path':_0x54431b+_0x578bae(0x301),'message':_0x578bae(0x250)});_0x1db3cb[_0x578bae(0x315)]!==undefined&&_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x248),'message':_0x578bae(0x2b5)});if(_0x1db3cb['path']!==undefined){if(typeof _0x1db3cb[_0x578bae(0x283)]!==_0x578bae(0x2b1)||_0x1db3cb[_0x578bae(0x283)][_0x578bae(0x1de)]()==='')_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x33c),'message':_0x578bae(0x1d7)});else _0x1db3cb['type']!=='APPROVAL'&&_0x1db3cb['type']!==_0x578bae(0x23a)&&_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+'.path','message':_0x578bae(0x21c)});}const _0x8cf0ed=_0x1db3cb['position'];if(!isRecord(_0x8cf0ed))_0x51e9f3['push']({'path':_0x54431b+_0x578bae(0x213),'message':_0x578bae(0x292)});else for(const _0x136caf of['x','y']){const _0x49a3ad=_0x8cf0ed[_0x136caf];(typeof _0x49a3ad!==_0x578bae(0x1e3)||!Number[_0x578bae(0x27c)](_0x49a3ad)||_0x49a3ad<0x0)&&_0x51e9f3['push']({'path':_0x54431b+_0x578bae(0x20f)+_0x136caf,'message':_0x578bae(0x260)+_0x136caf+_0x578bae(0x1d2)});}if(_0x1db3cb[_0x578bae(0x314)]===_0x578bae(0x204)){const _0x19f7e2=_0x1db3cb[_0x578bae(0x1d0)]??_0x578bae(0x312),_0x315d00=_0x1db3cb[_0x578bae(0x225)]??_0x578bae(0x204);!APPROVAL_TASK_MODES[_0x578bae(0x227)](_0x315d00)&&_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x2f8),'message':_0x578bae(0x297)+String(_0x315d00)+'.'});!APPROVAL_MODES[_0x578bae(0x227)](_0x19f7e2)&&_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x29a),'message':_0x578bae(0x22c)+String(_0x19f7e2)+'.'});if(!isRecord(_0x1db3cb[_0x578bae(0x330)]))_0x51e9f3['push']({'path':_0x54431b+_0x578bae(0x1ce),'message':_0x578bae(0x234)});else{const _0x2ee881=_0x1db3cb[_0x578bae(0x330)][_0x578bae(0x25f)];_0x2ee881!==_0x578bae(0x1d3)&&_0x2ee881!==_0x578bae(0x20e)&&_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x23c),'message':_0x578bae(0x2a9)});if(_0x2ee881===_0x578bae(0x1d3)){const _0x2e8bab=_0x1db3cb[_0x578bae(0x330)][_0x578bae(0x2b4)];if(!Array[_0x578bae(0x32d)](_0x2e8bab)||_0x2e8bab[_0x578bae(0x2fc)]===0x0)_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x1fd),'message':_0x578bae(0x21a)});else{const _0x2752eb=_0x2e8bab[_0x578bae(0x1f6)](_0x540abc=>!isValidUserId(_0x540abc));_0x2752eb>=0x0&&_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x1f9)+_0x2752eb+']','message':_0x578bae(0x215)});const _0x3113f4=new Set(_0x2e8bab[_0x578bae(0x342)](isValidUserId)['map'](_0x36a73d=>String(_0x36a73d)['trim']()));_0x19f7e2===_0x578bae(0x312)&&_0x3113f4[_0x578bae(0x27b)]>0x1&&_0x51e9f3['push']({'path':_0x54431b+_0x578bae(0x1fd),'message':_0x578bae(0x20d)});}}if(_0x2ee881===_0x578bae(0x20e)){const _0x4f79d3=_0x1db3cb['assignee'][_0x578bae(0x238)],_0x268b1e=typeof _0x4f79d3===_0x578bae(0x1e3)||typeof _0x4f79d3===_0x578bae(0x2b1)?Number(String(_0x4f79d3)['trim']()):Number[_0x578bae(0x2a0)];(!Number[_0x578bae(0x26f)](_0x268b1e)||_0x268b1e<=0x0)&&_0x51e9f3['push']({'path':_0x54431b+_0x578bae(0x1ec),'message':_0x578bae(0x2c0)});}}if(_0x1db3cb['transferCandidates']!==undefined){if(!isRecord(_0x1db3cb[_0x578bae(0x30f)]))_0x51e9f3['push']({'path':_0x54431b+_0x578bae(0x207),'message':'transferCandidates\x20must\x20be\x20an\x20object.'});else{if(_0x1db3cb[_0x578bae(0x30f)]['strategy']!==_0x578bae(0x1d3))_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x264),'message':_0x578bae(0x1d4)});else{const _0x571dbd=_0x1db3cb['transferCandidates']['userIds'];if(!Array[_0x578bae(0x32d)](_0x571dbd)||_0x571dbd[_0x578bae(0x2fc)]===0x0)_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x216),'message':_0x578bae(0x20b)});else{const _0x3f6ece=_0x571dbd[_0x578bae(0x1f6)](_0xf926ac=>!isValidUserId(_0xf926ac));_0x3f6ece>=0x0&&_0x51e9f3['push']({'path':_0x54431b+_0x578bae(0x2ae)+_0x3f6ece+']','message':_0x578bae(0x33b)});}}}}}_0x1db3cb[_0x578bae(0x294)]!==undefined&&typeof _0x1db3cb[_0x578bae(0x294)]!==_0x578bae(0x1d1)&&_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x2f0),'message':_0x578bae(0x2e3)});if(_0x1db3cb[_0x578bae(0x314)]===_0x578bae(0x2c5)){(typeof _0x1db3cb['scriptName']!=='string'||_0x1db3cb['scriptName'][_0x578bae(0x1de)]()==='')&&_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+'.scriptName','message':'SCRIPT\x20node\x20requires\x20scriptName.'});if(_0x1db3cb['resultVariable']!==undefined){if(typeof _0x1db3cb[_0x578bae(0x232)]!==_0x578bae(0x2b1)||!VARIABLE_PATTERN[_0x578bae(0x226)](_0x1db3cb[_0x578bae(0x232)]))_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x324),'message':_0x578bae(0x2b9)});else(RESERVED_RESULT_VARIABLES[_0x578bae(0x227)](_0x1db3cb['resultVariable'])||_0x1db3cb[_0x578bae(0x232)][_0x578bae(0x2b7)](_0x578bae(0x230)))&&_0x51e9f3[_0x578bae(0x217)]({'path':_0x54431b+_0x578bae(0x324),'message':_0x578bae(0x326)+_0x1db3cb[_0x578bae(0x232)]+'.'});}}validateAsyncExecution(_0x1db3cb,_0x54431b,_0x51e9f3),validateApprovalTimeout(_0x1db3cb,_0x54431b,_0x51e9f3),validateCcConfig(_0x1db3cb,_0x54431b,_0x51e9f3),_0x1db3cb[_0x578bae(0x314)]===_0x578bae(0x300)&&validateNotificationConfig(_0x1db3cb['config'],_0x54431b+_0x578bae(0x2ee),_0x51e9f3);}function validateAsyncExecution(_0x53b508,_0x2112c8,_0x2659e9){const _0x3a5164=a299_0x3624a4;if(_0x53b508[_0x3a5164(0x203)]===undefined)return;if(!isRecord(_0x53b508['async'])){_0x2659e9[_0x3a5164(0x217)]({'path':_0x2112c8+_0x3a5164(0x1e7),'message':_0x3a5164(0x2be)});return;}if(_0x53b508[_0x3a5164(0x203)][_0x3a5164(0x2ed)]!==undefined&&typeof _0x53b508['async']['enabled']!==_0x3a5164(0x1d1)){_0x2659e9['push']({'path':_0x2112c8+_0x3a5164(0x1df),'message':'async.enabled\x20must\x20be\x20a\x20boolean.'});return;}if(_0x53b508['async'][_0x3a5164(0x2ed)]!==!![])return;_0x53b508[_0x3a5164(0x314)]!=='SCRIPT'&&_0x2659e9[_0x3a5164(0x217)]({'path':_0x2112c8+_0x3a5164(0x1e7),'message':'async\x20execution\x20is\x20only\x20supported\x20by\x20SCRIPT\x20node.'});const _0x244653=_0x53b508[_0x3a5164(0x203)][_0x3a5164(0x273)]??0x3;(!Number['isInteger'](_0x244653)||_0x244653<0x1||_0x244653>MAX_ASYNC_RETRY_COUNT)&&_0x2659e9[_0x3a5164(0x217)]({'path':_0x2112c8+_0x3a5164(0x33a),'message':_0x3a5164(0x209)+MAX_ASYNC_RETRY_COUNT+'.'}),_0x53b508[_0x3a5164(0x203)]['retryInterval']!==undefined&&validateTimeAmount(_0x53b508[_0x3a5164(0x203)][_0x3a5164(0x1f0)],_0x2112c8+_0x3a5164(0x253),_0x2659e9);}function validateApprovalTimeout(_0x1e2936,_0x21ede2,_0x5a4cad){const _0x40b235=a299_0x3624a4;if(_0x1e2936[_0x40b235(0x304)]===undefined)return;if(!isRecord(_0x1e2936[_0x40b235(0x304)])){_0x5a4cad[_0x40b235(0x217)]({'path':_0x21ede2+_0x40b235(0x24c),'message':_0x40b235(0x30a)});return;}if(_0x1e2936[_0x40b235(0x304)][_0x40b235(0x2ed)]!==undefined&&typeof _0x1e2936[_0x40b235(0x304)][_0x40b235(0x2ed)]!==_0x40b235(0x1d1)){_0x5a4cad[_0x40b235(0x217)]({'path':_0x21ede2+_0x40b235(0x2ff),'message':_0x40b235(0x24e)});return;}if(_0x1e2936[_0x40b235(0x304)][_0x40b235(0x2ed)]!==!![])return;if(_0x1e2936[_0x40b235(0x304)][_0x40b235(0x2f1)]!==undefined&&typeof _0x1e2936[_0x40b235(0x304)][_0x40b235(0x2f1)]!==_0x40b235(0x1d1)){_0x5a4cad['push']({'path':_0x21ede2+_0x40b235(0x2d1),'message':_0x40b235(0x305)});return;}_0x1e2936[_0x40b235(0x314)]!==_0x40b235(0x204)&&_0x5a4cad[_0x40b235(0x217)]({'path':_0x21ede2+'.timeout','message':'timeout\x20is\x20only\x20supported\x20by\x20APPROVAL\x20node.'});validateTimeAmount(_0x1e2936['timeout'][_0x40b235(0x23e)],_0x21ede2+'.timeout.duration',_0x5a4cad);const _0x349b88=_0x1e2936[_0x40b235(0x304)][_0x40b235(0x32c)];if(!APPROVAL_TIMEOUT_ACTIONS['has'](_0x349b88)){_0x5a4cad['push']({'path':_0x21ede2+_0x40b235(0x222),'message':_0x40b235(0x26a)});return;}(_0x1e2936[_0x40b235(0x225)]??'APPROVAL')===_0x40b235(0x284)&&_0x349b88!=='EXECUTE_BFF'&&_0x5a4cad[_0x40b235(0x217)]({'path':_0x21ede2+_0x40b235(0x222),'message':_0x40b235(0x2e7)});const _0x1943fa=_0x1e2936[_0x40b235(0x304)]['interrupting']??_0x349b88!==_0x40b235(0x303);if(_0x349b88===_0x40b235(0x303))_0x1943fa&&_0x5a4cad['push']({'path':_0x21ede2+_0x40b235(0x2d1),'message':_0x40b235(0x2ba)}),(typeof _0x1e2936['timeout'][_0x40b235(0x31b)]!==_0x40b235(0x2b1)||_0x1e2936['timeout'][_0x40b235(0x31b)]['trim']()==='')&&_0x5a4cad[_0x40b235(0x217)]({'path':_0x21ede2+'.timeout.scriptName','message':_0x40b235(0x2fd)}),validateOptionalResultVariable(_0x1e2936[_0x40b235(0x304)][_0x40b235(0x232)],_0x21ede2+'.timeout.resultVariable',_0x5a4cad);else!_0x1943fa&&_0x5a4cad[_0x40b235(0x217)]({'path':_0x21ede2+_0x40b235(0x2d1),'message':_0x349b88+_0x40b235(0x256)});}function a299_0xbc96(_0x2675a4,_0x5a486d){_0x2675a4=_0x2675a4-0x1cc;const _0x5d1c48=a299_0x5d1c();let _0xbc963f=_0x5d1c48[_0x2675a4];return _0xbc963f;}function validateTimeAmount(_0x164946,_0x308fee,_0x15873c){const _0x515605=a299_0x3624a4;if(!isRecord(_0x164946)){_0x15873c[_0x515605(0x217)]({'path':_0x308fee,'message':_0x515605(0x27f)});return;}(!Number['isInteger'](_0x164946[_0x515605(0x22f)])||Number(_0x164946['value'])<=0x0)&&_0x15873c['push']({'path':_0x308fee+_0x515605(0x2f6),'message':_0x515605(0x323)}),!FLOW_TIME_UNITS[_0x515605(0x227)](_0x164946['unit'])&&_0x15873c[_0x515605(0x217)]({'path':_0x308fee+_0x515605(0x31c),'message':'duration\x20unit\x20must\x20be\x20SECONDS,\x20MINUTES,\x20HOURS,\x20or\x20DAYS.'});}function validateOptionalResultVariable(_0x3b34f1,_0x574e97,_0x325be7){const _0x4789d8=a299_0x3624a4;if(_0x3b34f1===undefined||_0x3b34f1===null||_0x3b34f1==='')return;if(typeof _0x3b34f1!==_0x4789d8(0x2b1)||!VARIABLE_PATTERN['test'](_0x3b34f1))_0x325be7[_0x4789d8(0x217)]({'path':_0x574e97,'message':_0x4789d8(0x2b9)});else(RESERVED_RESULT_VARIABLES[_0x4789d8(0x227)](_0x3b34f1)||_0x3b34f1['startsWith'](_0x4789d8(0x230)))&&_0x325be7[_0x4789d8(0x217)]({'path':_0x574e97,'message':_0x4789d8(0x326)+_0x3b34f1+'.'});}function validateCcConfig(_0x25093a,_0x19b9b5,_0x5bc627){const _0x1f7820=a299_0x3624a4;if(_0x25093a['cc']===undefined)return;if(!isRecord(_0x25093a['cc'])){_0x5bc627[_0x1f7820(0x217)]({'path':_0x19b9b5+_0x1f7820(0x28d),'message':_0x1f7820(0x21f)});return;}_0x25093a[_0x1f7820(0x314)]!==_0x1f7820(0x23a)&&_0x25093a[_0x1f7820(0x314)]!=='APPROVAL'&&_0x5bc627[_0x1f7820(0x217)]({'path':_0x19b9b5+_0x1f7820(0x28d),'message':_0x1f7820(0x2cd)});Object[_0x1f7820(0x1f8)][_0x1f7820(0x2c3)][_0x1f7820(0x2e1)](_0x25093a['cc'],'readSources')&&_0x5bc627['push']({'path':_0x19b9b5+'.cc.readSources','message':UNSUPPORTED_FORM_MESSAGE});const _0x421dba=_0x25093a['cc'][_0x1f7820(0x32a)];if(!Array[_0x1f7820(0x32d)](_0x421dba)||_0x421dba[_0x1f7820(0x2fc)]===0x0)_0x5bc627[_0x1f7820(0x217)]({'path':_0x19b9b5+_0x1f7820(0x2e5),'message':_0x1f7820(0x245)});else{_0x421dba[_0x1f7820(0x2fc)]>MAX_CC_RECIPIENTS&&_0x5bc627[_0x1f7820(0x217)]({'path':_0x19b9b5+_0x1f7820(0x2e5),'message':_0x1f7820(0x28e)+MAX_CC_RECIPIENTS+_0x1f7820(0x2ca)});const _0x4ecfde=new Set();_0x421dba[_0x1f7820(0x340)]((_0x18a0f3,_0x4ea6a6)=>{const _0x511004=_0x1f7820;if(typeof _0x18a0f3!==_0x511004(0x2b1)||_0x18a0f3['trim']()==='')_0x5bc627[_0x511004(0x217)]({'path':_0x19b9b5+'.cc.recipientUserIds['+_0x4ea6a6+']','message':_0x511004(0x1dc)});else _0x4ecfde[_0x511004(0x227)](_0x18a0f3[_0x511004(0x1de)]())?_0x5bc627[_0x511004(0x217)]({'path':_0x19b9b5+'.cc.recipientUserIds['+_0x4ea6a6+']','message':'Duplicate\x20cc\x20recipient\x20userId:\x20'+_0x18a0f3['trim']()+'.'}):_0x4ecfde[_0x511004(0x224)](_0x18a0f3[_0x511004(0x1de)]());});}validateStringArray(_0x25093a['cc'][_0x1f7820(0x271)],_0x19b9b5+_0x1f7820(0x334),_0x5bc627);}function validateStringArray(_0x32ec87,_0x3bba58,_0x1870e6){const _0x580dca=a299_0x3624a4;if(_0x32ec87===undefined)return;if(!Array['isArray'](_0x32ec87)){_0x1870e6[_0x580dca(0x217)]({'path':_0x3bba58,'message':_0x580dca(0x293)});return;}const _0x8c9629=new Set();_0x32ec87[_0x580dca(0x340)]((_0x38d091,_0x17624c)=>{const _0x42ca25=_0x580dca;if(typeof _0x38d091!==_0x42ca25(0x2b1)||_0x38d091[_0x42ca25(0x1de)]()==='')_0x1870e6[_0x42ca25(0x217)]({'path':_0x3bba58+'['+_0x17624c+']','message':_0x42ca25(0x2c7)});else _0x8c9629[_0x42ca25(0x227)](_0x38d091[_0x42ca25(0x1de)]())?_0x1870e6[_0x42ca25(0x217)]({'path':_0x3bba58+'['+_0x17624c+']','message':_0x42ca25(0x202)+_0x38d091[_0x42ca25(0x1de)]()+'.'}):_0x8c9629[_0x42ca25(0x224)](_0x38d091[_0x42ca25(0x1de)]());});}function a299_0x5d1c(){const _0x109b9d=['MAX_SAFE_INTEGER','.timeout.interrupting','.expression','Notification\x20recipient.type\x20is\x20required.','approval_sys_operationType','result','flowDesc','Node\x20cannot\x20reach\x20any\x20END.','flowJson.nodes','overwrite','waypoints','.id','conditionType','.configCode','pageIds\x20exceeds\x20the\x202048-character\x20binding\x20limit.','targetNodeId','slice','call','approval_sys_appCode','sequential\x20must\x20be\x20a\x20boolean.','approval_sys_initiatorUsername','.cc.recipientUserIds','Custom\x20form\x20configuration\x20is\x20not\x20supported\x20by\x20this\x20rabetbase\x20version;\x20use\x20a\x20business\x20custom\x20page\x20instead.','HANDLE\x20task\x20timeout\x20only\x20supports\x20EXECUTE_BFF.','FlowConfig\x20must\x20be\x20a\x20JSON\x20object.','summary','edge\x20must\x20be\x20an\x20object.','CONDITION\x20default\x20edge\x20must\x20use\x20conditionType\x20ALWAYS.','Unsupported\x20notification\x20placeholder:\x20','enabled','.config','facts','.sequential','interrupting','AUTO_APPROVE','legacy_field_removed','Flow\x20must\x20contain\x20at\x20least\x20one\x20END\x20node.','Rabetbase\x20FlowConfig','.value','configCode','.taskMode','defaultFlow','#/$defs/position','.version','length','EXECUTE_BFF\x20timeout\x20requires\x20scriptName.','A\x20default\x20flow\x20must\x20not\x20have\x20an\x20expression.','.timeout.enabled','NOTIFICATION','.name','recipients','EXECUTE_BFF','timeout','timeout.interrupting\x20must\x20be\x20a\x20boolean.','Node\x20is\x20not\x20reachable\x20from\x20START.','Unsupported\x20pageMode:\x20','Edge\x20target\x20node\x20not\x20found:\x20','https://json-schema.org/draft/2020-12/schema','timeout\x20must\x20be\x20an\x20object.','Notification\x20template.detailMarkdown\x20must\x20be\x20a\x20string.','edge\x20target\x20is\x20required.','waypoint\x20must\x20contain\x20numeric\x20x\x20and\x20y\x20coordinates.','node\x20path\x20applies\x20only\x20to\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.','transferCandidates','Duplicate\x20BPMN\x20element\x20id:\x20','.\x20This\x20CLI\x20supports\x20only\x20','SINGLE','flowCode','type','pageId','parse','approval_sys_datasetCode','\x20is\x20not\x20on\x20every\x20upstream\x20path\x20to\x20','FORM_FLOW\x20is\x20an\x20approval\x20flow\x20and\x20cannot\x20contain\x20HANDLE\x20tasks;\x20use\x20INDEPENDENT_FLOW\x20for\x20workflows.','flowJson.schemaVersion','scriptName','.unit','includes','stringify','bindDatasetCode','flowJson.','APPROVAL\x20node\x20requires\x20exactly\x20one\x20APPROVED\x20outgoing\x20edge.','object','duration\x20value\x20must\x20be\x20a\x20positive\x20integer.','.resultVariable','CONDITION\x20node\x20requires\x20exactly\x20one\x20default\x20outgoing\x20edge.','Reserved\x20resultVariable:\x20','#/$defs/flowNode','waypoints\x20must\x20be\x20an\x20array.','CONDITION','recipientUserIds','schemaVersion','action','isArray','delete','Notification\x20template.facts\x20must\x20be\x20an\x20array.','assignee','formDefinitions','\x20->\x20','flowName','.cc.visible','2525428KpSShu','name','.failurePolicy','message','21aQPOaz','.async.retryCount','transfer\x20candidate\x20userId\x20must\x20be\x20a\x20non-empty\x20string\x20or\x20positive\x20integer.','.path','datasetCode\x20must\x20be\x20a\x20string.','text','CONTINUE','forEach','Unsupported\x20node\x20type:\x20','filter','.role','approval_sys_processInstanceId','.conditionType','Node\x20has\x20no\x20outgoing\x20edge.','.assignee','Node\x20has\x20no\x20incoming\x20edge.','approvalMode','boolean','\x20must\x20be\x20a\x20finite\x20number\x20greater\x20than\x20or\x20equal\x20to\x200.','FIXED','transferCandidates\x20currently\x20supports\x20FIXED\x20only.','HANDLE\x20task\x20requires\x20exactly\x20one\x20outgoing\x20edge.','Notification\x20fact\x20must\x20be\x20an\x20object.','node\x20path\x20must\x20be\x20a\x20non-empty\x20string.','7346082iKOcPJ','BCC','.detailMarkdown','ANY','cc\x20recipient\x20userId\x20must\x20be\x20a\x20non-empty\x20string.','form','trim','.async.enabled','Notification\x20version\x20must\x20be\x20a\x20string.','.tmp','Expression\x20references\x20SCRIPT\x20resultVariable\x20','number','flowJson.startPageId','.target','MINUTES','.async','END\x20node\x20must\x20not\x20have\x20outgoing\x20edges.','Notification\x20template.actions\x20must\x20be\x20an\x20array.','APPROVAL\x20task\x20decision\x20edges\x20must\x20not\x20be\x20default\x20flows.','event','.assignee.roleId','role','NOTIFICATION\x20node\x20requires\x20config.','10ZzBmyz','retryInterval','pageIds\x20must\x20be\x20an\x20array\x20of\x20positive\x20safe\x20integers.','catch','INDEPENDENT_FLOW\x20cannot\x20bind\x20pageId.','sourceNodeId','get','findIndex','target','prototype','.assignee.userIds[','Edge\x20source\x20node\x20not\x20found:\x20','.template','AUTO_REJECT','.assignee.userIds','node\x20must\x20be\x20an\x20object.','Notification\x20recipient\x20must\x20be\x20an\x20object.','\x20actions.','startPath','Duplicate\x20value:\x20','async','APPROVAL','edge\x20id\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','\x20facts.','.transferCandidates','.source','SCRIPT\x20async\x20retryCount\x20must\x20be\x20between\x201\x20and\x20','Notification\x20recipient.type\x20must\x20be\x20USER,\x20ROLE,\x20or\x20EMAIL.','FIXED\x20transferCandidates\x20requires\x20non-empty\x20userIds.','A\x20default\x20flow\x20must\x20use\x20conditionType\x20ALWAYS.','SINGLE\x20approval\x20supports\x20only\x20one\x20fixed\x20user.','ROLE','.position.','startPageId\x20is\x20no\x20longer\x20supported;\x20use\x20startPath\x20instead.','EMAIL','Duplicate\x20edge\x20route:\x20','.position','].path','fixed\x20assignee\x20userId\x20must\x20be\x20a\x20non-empty\x20string\x20or\x20positive\x20integer.','.transferCandidates.userIds','push','warnings','No\x20END\x20node\x20is\x20reachable\x20from\x20START.','FIXED\x20assignee\x20requires\x20userIds.','map','node\x20path\x20is\x20supported\x20only\x20on\x20APPROVAL\x20or\x20END\x20nodes.','failurePolicy','version','cc\x20must\x20be\x20an\x20object.','Notification\x20action.url\x20must\x20use\x20http/https\x20or\x20a\x20complete\x20supported\x20placeholder.','https://lovrabet.com/schema/rabetbase-flow-config.json','.timeout.action','FAIL','add','taskMode','test','has','flowJson.edges[','INDEPENDENT_FLOW','#/$defs/flowEdge','indexOf','Unsupported\x20approval\x20mode:\x20','Notification\x20recipient.role\x20must\x20be\x20a\x20string.','flowJson.pageMode','value','approval_sys_','nodes','resultVariable','.url','APPROVAL\x20node\x20requires\x20assignee.','flowDesc\x20must\x20be\x20a\x20string.','\x20was\x20empty\x20or\x20used\x20the\x20default\x20','.defaultFlow','roleId','pageMode','END','4355304QAsoqP','.assignee.strategy','integer','duration','APPROVAL\x20node\x20requires\x20exactly\x20one\x20REJECTED\x20outgoing\x20edge.',',\x20but\x20node\x20','replace','startPath\x20applies\x20only\x20to\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.','entries','Unsupported\x20condition\x20type:\x20','cc.recipientUserIds\x20must\x20be\x20a\x20non-empty\x20array.','approval_sys_initiatorUserId','Notification\x20template\x20supports\x20at\x20most\x20','.pageId','startPath\x20must\x20be\x20a\x20non-empty\x20string.','config','source','.timeout','Unsupported\x20notification\x20version:\x20','timeout.enabled\x20must\x20be\x20a\x20boolean.','failurePolicy\x20must\x20be\x20a\x20string.','Every\x20node\x20requires\x20a\x20non-empty\x20name.','Duplicate\x20node\x20id:\x20','^[A-Za-z_][A-Za-z0-9_]*$','.async.retryInterval','Notification\x20action\x20must\x20be\x20an\x20object.','START\x20node\x20must\x20not\x20have\x20incoming\x20edges.','\x20timeout\x20must\x20interrupt\x20the\x20approval\x20task.','url','label','keys','Notification\x20template.','appCode','templateName','flowJson.nodes.','#/$defs/timeAmount','strategy','position.','utf8','flowJson','PLATFORM_FORM','.transferCandidates.strategy','Notification\x20action.url\x20is\x20required.','NOTIFICATION\x20node\x20requires\x20template.','some','pageIds','mode','timeout.action\x20must\x20be\x20AUTO_APPROVE,\x20AUTO_REJECT,\x20or\x20EXECUTE_BFF.','580469DpsQff','flowKey','46448577CRuhRz','nodes\x20must\x20be\x20an\x20array.','isSafeInteger','waypoint.','visible','.recipients','retryCount','\x20must\x20be\x20a\x20finite\x20number.','438750bEzpFs','.facts','flowJson.startPath','Approval\x20flow\x20requires\x20an\x20END\x20node\x20with\x20result\x20','Notification\x20fact.','approved','size','isFinite','position','EXPRESSION','duration\x20requires\x20value\x20and\x20unit.','variables','every','START','path','HANDLE','EXPRESSION\x20edge\x20requires\x20expression.','CUSTOM_PAGE','actions','flowType','set','expression','Unsupported\x20schemaVersion:\x20','approval.simple-flow.v1','.cc','cc.recipientUserIds\x20supports\x20at\x20most\x20','APPROVED','node\x20id\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','matchAll','Every\x20node\x20requires\x20position.x\x20and\x20position.y.','value\x20must\x20be\x20an\x20array.','sequential','5ypXDcG','PLATFORM_FORM\x20is\x20not\x20supported\x20by\x20this\x20rabetbase\x20version;\x20use\x20INDEPENDENT_FLOW\x20with\x20CUSTOM_PAGE.','Unsupported\x20task\x20mode:\x20','DAYS','Accepted\x20as\x20legacy\x20input\x20and\x20removed\x20during\x20normalization;\x20other\x20versions\x20are\x20unsupported.','.approvalMode','.waypoints','2024276GMvDjh','ALWAYS','edges','Notification\x20configCode\x20is\x20required.','NaN','Flow\x20must\x20contain\x20exactly\x20one\x20START\x20node.','startPageId','ALL','detailMarkdown','HANDLE\x20task\x20outgoing\x20edge\x20must\x20use\x20ALWAYS\x20without\x20defaultFlow\x20or\x20expression.','edge\x20source\x20is\x20required.','#/$defs/userId','Duplicate\x20resultVariable:\x20','assignee.strategy\x20must\x20be\x20FIXED\x20or\x20ROLE.','datasetCode','template','Notification\x20recipients\x20must\x20be\x20an\x20array.','\x20value\x20and\x20was\x20removed\x20from\x20the\x20portable\x20FlowConfig.','.transferCandidates.userIds[','HOURS','FORM_FLOW','string','REJECTED','array','userIds','node\x20pageId\x20is\x20no\x20longer\x20supported;\x20use\x20node\x20path\x20instead.','.text','startsWith','CONDITION\x20non-default\x20edge\x20requires\x20a\x20non-empty\x20expression.','resultVariable\x20must\x20match\x20[A-Za-z_][A-Za-z0-9_]*.','EXECUTE_BFF\x20timeout\x20must\x20not\x20interrupt\x20the\x20approval\x20task.','flowJson.edges','.waypoints[','^[1-9][0-9]*$','async\x20must\x20be\x20an\x20object.','SECONDS','ROLE\x20assignee\x20requires\x20a\x20positive\x20integer\x20roleId.','toUpperCase','empty_metadata_removed','hasOwnProperty','metadata','SCRIPT','join','value\x20must\x20be\x20a\x20non-empty\x20string.','__rabetbase_local_validation__','flowJson.nodes[','\x20users.','USER','context','Default\x20cc\x20is\x20only\x20supported\x20by\x20APPROVAL\x20or\x20END\x20node.','\x20is\x20required.','Notification\x20action.text\x20is\x20required.'];a299_0x5d1c=function(){return _0x109b9d;};return a299_0x5d1c();}function validateNotificationConfig(_0x403601,_0x3fb7f1,_0x169840){const _0x435206=a299_0x3624a4;if(!isRecord(_0x403601)){_0x169840[_0x435206(0x217)]({'path':_0x3fb7f1,'message':_0x435206(0x1ee)});return;}if(_0x403601['version']!==undefined&&_0x403601[_0x435206(0x21e)]!==null){if(typeof _0x403601[_0x435206(0x21e)]!==_0x435206(0x2b1))_0x169840['push']({'path':_0x3fb7f1+_0x435206(0x2fb),'message':_0x435206(0x1e0)});else _0x403601[_0x435206(0x21e)][_0x435206(0x1de)]()&&_0x403601[_0x435206(0x21e)][_0x435206(0x1de)]()!=='v1'&&_0x169840['push']({'path':_0x3fb7f1+_0x435206(0x2fb),'message':_0x435206(0x24d)+_0x403601[_0x435206(0x21e)]+'.'});}const _0xcc5cec=requireNotificationString(_0x403601['configCode'],_0x3fb7f1+_0x435206(0x2dd),_0x435206(0x29f),_0x169840);_0xcc5cec?.[_0x435206(0x31d)]('${')&&_0x169840[_0x435206(0x217)]({'path':_0x3fb7f1+_0x435206(0x2dd),'message':'Notification\x20configCode\x20must\x20be\x20a\x20fixed\x20value.'});if(_0x403601[_0x435206(0x21d)]!==undefined&&_0x403601['failurePolicy']!==null){if(typeof _0x403601[_0x435206(0x21d)]!==_0x435206(0x2b1))_0x169840[_0x435206(0x217)]({'path':_0x3fb7f1+_0x435206(0x337),'message':_0x435206(0x24f)});else!NOTIFICATION_FAILURE_POLICIES['has'](_0x403601['failurePolicy'][_0x435206(0x1de)]()[_0x435206(0x2c1)]())&&_0x169840[_0x435206(0x217)]({'path':_0x3fb7f1+_0x435206(0x337),'message':'failurePolicy\x20must\x20be\x20CONTINUE\x20or\x20FAIL.'});}!isRecord(_0x403601[_0x435206(0x2ab)])?_0x169840['push']({'path':_0x3fb7f1+_0x435206(0x1fb),'message':_0x435206(0x266)}):validateNotificationTemplate(_0x403601[_0x435206(0x2ab)],_0x3fb7f1+_0x435206(0x1fb),_0x169840),validateNotificationRecipients(_0x403601[_0x435206(0x302)],_0x3fb7f1+_0x435206(0x272),_0x169840);}function validateNotificationTemplate(_0x1b37c8,_0x4ebe40,_0x56ff83){const _0xfd021c=a299_0x3624a4;for(const _0x30dc1a of['title',_0xfd021c(0x2e9)]){const _0xb19dd7=requireNotificationString(_0x1b37c8[_0x30dc1a],_0x4ebe40+'.'+_0x30dc1a,_0xfd021c(0x25a)+_0x30dc1a+_0xfd021c(0x2ce),_0x56ff83);if(_0xb19dd7)validateNotificationPlaceholders(_0xb19dd7,_0x4ebe40+'.'+_0x30dc1a,_0x56ff83);}_0x1b37c8[_0xfd021c(0x2a4)]!==undefined&&_0x1b37c8['detailMarkdown']!==null&&(typeof _0x1b37c8[_0xfd021c(0x2a4)]!==_0xfd021c(0x2b1)?_0x56ff83[_0xfd021c(0x217)]({'path':_0x4ebe40+'.detailMarkdown','message':_0xfd021c(0x30b)}):validateNotificationPlaceholders(_0x1b37c8[_0xfd021c(0x2a4)],_0x4ebe40+_0xfd021c(0x1da),_0x56ff83)),validateNotificationFacts(_0x1b37c8[_0xfd021c(0x2ef)],_0x4ebe40+_0xfd021c(0x276),_0x56ff83),validateNotificationActions(_0x1b37c8[_0xfd021c(0x287)],_0x4ebe40+'.actions',_0x56ff83);}function validateNotificationFacts(_0x509584,_0x337dc7,_0x53d3dd){const _0x5492dc=a299_0x3624a4;if(_0x509584===undefined||_0x509584===null)return;if(!Array[_0x5492dc(0x32d)](_0x509584)){_0x53d3dd[_0x5492dc(0x217)]({'path':_0x337dc7,'message':_0x5492dc(0x32f)});return;}_0x509584['length']>MAX_NOTIFICATION_FACTS&&_0x53d3dd['push']({'path':_0x337dc7,'message':_0x5492dc(0x247)+MAX_NOTIFICATION_FACTS+_0x5492dc(0x206)}),_0x509584[_0x5492dc(0x340)]((_0x48ac49,_0x41ee04)=>{const _0x92b6d2=_0x5492dc,_0x164b3a=_0x337dc7+'['+_0x41ee04+']';if(!isRecord(_0x48ac49)){_0x53d3dd[_0x92b6d2(0x217)]({'path':_0x164b3a,'message':_0x92b6d2(0x1d6)});return;}for(const _0x311889 of['label','value']){const _0x476470=requireNotificationString(_0x48ac49[_0x311889],_0x164b3a+'.'+_0x311889,_0x92b6d2(0x279)+_0x311889+_0x92b6d2(0x2ce),_0x53d3dd);_0x476470&&validateNotificationPlaceholders(_0x476470,_0x164b3a+'.'+_0x311889,_0x53d3dd);}});}function validateNotificationActions(_0x273e9e,_0xfda2c1,_0x405ae8){const _0x59cf6a=a299_0x3624a4;if(_0x273e9e===undefined||_0x273e9e===null)return;if(!Array[_0x59cf6a(0x32d)](_0x273e9e)){_0x405ae8[_0x59cf6a(0x217)]({'path':_0xfda2c1,'message':_0x59cf6a(0x1e9)});return;}_0x273e9e[_0x59cf6a(0x2fc)]>MAX_NOTIFICATION_ACTIONS&&_0x405ae8[_0x59cf6a(0x217)]({'path':_0xfda2c1,'message':'Notification\x20template\x20supports\x20at\x20most\x20'+MAX_NOTIFICATION_ACTIONS+_0x59cf6a(0x200)}),_0x273e9e[_0x59cf6a(0x340)]((_0x1bf9b5,_0x41b63c)=>{const _0x1cf036=_0x59cf6a,_0x23b1b8=_0xfda2c1+'['+_0x41b63c+']';if(!isRecord(_0x1bf9b5)){_0x405ae8['push']({'path':_0x23b1b8,'message':_0x1cf036(0x254)});return;}const _0x3fe08d=requireNotificationString(_0x1bf9b5[_0x1cf036(0x33e)],_0x23b1b8+'.text',_0x1cf036(0x2cf),_0x405ae8);if(_0x3fe08d)validateNotificationPlaceholders(_0x3fe08d,_0x23b1b8+_0x1cf036(0x2b6),_0x405ae8);const _0x1fa7c3=requireNotificationString(_0x1bf9b5['url'],_0x23b1b8+'.url',_0x1cf036(0x265),_0x405ae8);if(!_0x1fa7c3)return;validateNotificationPlaceholders(_0x1fa7c3,_0x23b1b8+_0x1cf036(0x233),_0x405ae8),!/^https?:\/\//i[_0x1cf036(0x226)](_0x1fa7c3)&&!NOTIFICATION_ACTION_URL_PLACEHOLDER_PATTERN[_0x1cf036(0x226)](_0x1fa7c3)&&_0x405ae8[_0x1cf036(0x217)]({'path':_0x23b1b8+_0x1cf036(0x233),'message':_0x1cf036(0x220)});});}function validateNotificationRecipients(_0x2d0da5,_0x3f334e,_0x3950e5){const _0x1d1b38=a299_0x3624a4;if(_0x2d0da5===undefined||_0x2d0da5===null)return;if(!Array[_0x1d1b38(0x32d)](_0x2d0da5)){_0x3950e5[_0x1d1b38(0x217)]({'path':_0x3f334e,'message':_0x1d1b38(0x2ac)});return;}let _0xa1c9c2=![];_0x2d0da5[_0x1d1b38(0x340)]((_0x4b8ae3,_0x522744)=>{const _0x541b5c=_0x1d1b38,_0x5aa661=_0x3f334e+'['+_0x522744+']';if(!isRecord(_0x4b8ae3)){_0x3950e5[_0x541b5c(0x217)]({'path':_0x5aa661,'message':_0x541b5c(0x1ff)});return;}const _0x4acb0e=requireNotificationString(_0x4b8ae3[_0x541b5c(0x314)],_0x5aa661+'.type',_0x541b5c(0x2d3),_0x3950e5);_0x4acb0e&&!NOTIFICATION_RECIPIENT_TYPES[_0x541b5c(0x227)](_0x4acb0e[_0x541b5c(0x2c1)]())&&_0x3950e5[_0x541b5c(0x217)]({'path':_0x5aa661+'.type','message':_0x541b5c(0x20a)});let _0x515743='TO';_0x4b8ae3['role']!==undefined&&_0x4b8ae3['role']!==null&&(typeof _0x4b8ae3['role']!==_0x541b5c(0x2b1)?(_0x3950e5[_0x541b5c(0x217)]({'path':_0x5aa661+_0x541b5c(0x343),'message':_0x541b5c(0x22d)}),_0x515743=''):(_0x515743=_0x4b8ae3[_0x541b5c(0x1ed)]['trim']()['toUpperCase'](),!NOTIFICATION_RECIPIENT_ROLES[_0x541b5c(0x227)](_0x515743)&&_0x3950e5[_0x541b5c(0x217)]({'path':_0x5aa661+_0x541b5c(0x343),'message':'Notification\x20recipient.role\x20must\x20be\x20TO,\x20CC,\x20or\x20BCC.'})));if(_0x515743==='TO')_0xa1c9c2=!![];const _0x21ac23=requireNotificationString(_0x4b8ae3[_0x541b5c(0x22f)],_0x5aa661+_0x541b5c(0x2f6),'Notification\x20recipient.value\x20is\x20required.',_0x3950e5);_0x21ac23&&validateNotificationPlaceholders(_0x21ac23,_0x5aa661+_0x541b5c(0x2f6),_0x3950e5);}),_0x2d0da5['length']>0x0&&!_0xa1c9c2&&_0x3950e5[_0x1d1b38(0x217)]({'path':_0x3f334e,'message':'Explicit\x20notification\x20recipients\x20require\x20at\x20least\x20one\x20TO.'});}function requireNotificationString(_0x2be432,_0x56c324,_0xfcd921,_0xdc426){const _0x3282f2=a299_0x3624a4;if(typeof _0x2be432!==_0x3282f2(0x2b1)||_0x2be432[_0x3282f2(0x1de)]()==='')return _0xdc426[_0x3282f2(0x217)]({'path':_0x56c324,'message':_0xfcd921}),undefined;return _0x2be432[_0x3282f2(0x1de)]();}function validateNotificationPlaceholders(_0x29e7d6,_0x5a7e64,_0x2ca408){const _0x26eef1=a299_0x3624a4;for(const _0x388e2c of _0x29e7d6[_0x26eef1(0x291)](NOTIFICATION_PLACEHOLDER_PATTERN)){const _0x238071=_0x388e2c[0x1]?.[_0x26eef1(0x1de)]()??'',_0x2950a9=_0x238071[_0x26eef1(0x22b)]('.'),_0xd41dae=_0x2950a9>=0x0?_0x238071[_0x26eef1(0x2e0)](0x0,_0x2950a9):_0x238071,_0x796934=_0x2950a9>=0x0?_0x238071[_0x26eef1(0x2e0)](_0x2950a9+0x1)[_0x26eef1(0x1de)]():'';(![_0x26eef1(0x1eb),_0x26eef1(0x2cc),_0x26eef1(0x280)][_0x26eef1(0x31d)](_0xd41dae)||_0x796934==='')&&_0x2ca408[_0x26eef1(0x217)]({'path':_0x5a7e64,'message':_0x26eef1(0x2ec)+_0x388e2c[0x0]+'.'});}_0x29e7d6[_0x26eef1(0x241)](NOTIFICATION_PLACEHOLDER_PATTERN,'')[_0x26eef1(0x31d)]('${')&&_0x2ca408['push']({'path':_0x5a7e64,'message':'Notification\x20text\x20contains\x20a\x20malformed\x20placeholder.'});}function validateEdge(_0x5305f4,_0x5ed3ef,_0xe0e33d){const _0x1c3a7f=a299_0x3624a4;_0x5305f4[_0x1c3a7f(0x336)]!==undefined&&typeof _0x5305f4[_0x1c3a7f(0x336)]!==_0x1c3a7f(0x2b1)&&_0xe0e33d['push']({'path':_0x5ed3ef+_0x1c3a7f(0x301),'message':'edge\x20name\x20must\x20be\x20a\x20string.'}),_0x5305f4[_0x1c3a7f(0x2f9)]!==undefined&&typeof _0x5305f4[_0x1c3a7f(0x2f9)]!==_0x1c3a7f(0x1d1)&&_0xe0e33d[_0x1c3a7f(0x217)]({'path':_0x5ed3ef+_0x1c3a7f(0x237),'message':'defaultFlow\x20must\x20be\x20a\x20boolean.'}),_0x5305f4[_0x1c3a7f(0x2da)]!==undefined&&(!Array[_0x1c3a7f(0x32d)](_0x5305f4[_0x1c3a7f(0x2da)])?_0xe0e33d[_0x1c3a7f(0x217)]({'path':_0x5ed3ef+_0x1c3a7f(0x29b),'message':_0x1c3a7f(0x328)}):_0x5305f4['waypoints'][_0x1c3a7f(0x340)]((_0x14d0d0,_0x3aafa2)=>{const _0x34ff75=_0x1c3a7f;if(!isRecord(_0x14d0d0)){_0xe0e33d['push']({'path':_0x5ed3ef+_0x34ff75(0x2bc)+_0x3aafa2+']','message':_0x34ff75(0x30d)});return;}for(const _0x452bc4 of['x','y']){const _0x153371=_0x14d0d0[_0x452bc4];(typeof _0x153371!==_0x34ff75(0x1e3)||!Number[_0x34ff75(0x27c)](_0x153371))&&_0xe0e33d['push']({'path':_0x5ed3ef+_0x34ff75(0x2bc)+_0x3aafa2+'].'+_0x452bc4,'message':_0x34ff75(0x270)+_0x452bc4+_0x34ff75(0x274)});}})),_0x5305f4[_0x1c3a7f(0x2dc)]!==undefined&&!CONDITION_TYPES[_0x1c3a7f(0x227)](_0x5305f4[_0x1c3a7f(0x2dc)])&&_0xe0e33d[_0x1c3a7f(0x217)]({'path':_0x5ed3ef+_0x1c3a7f(0x1cc),'message':_0x1c3a7f(0x244)+String(_0x5305f4[_0x1c3a7f(0x2dc)])+'.'}),_0x5305f4[_0x1c3a7f(0x2dc)]===_0x1c3a7f(0x27e)&&(typeof _0x5305f4[_0x1c3a7f(0x28a)]!==_0x1c3a7f(0x2b1)||_0x5305f4[_0x1c3a7f(0x28a)][_0x1c3a7f(0x1de)]()==='')&&_0xe0e33d['push']({'path':_0x5ed3ef+_0x1c3a7f(0x2d2),'message':_0x1c3a7f(0x285)}),_0x5305f4[_0x1c3a7f(0x2f9)]===!![]&&_0x5305f4[_0x1c3a7f(0x2dc)]!==_0x1c3a7f(0x29d)&&_0xe0e33d[_0x1c3a7f(0x217)]({'path':_0x5ed3ef+_0x1c3a7f(0x237),'message':_0x1c3a7f(0x20c)}),_0x5305f4[_0x1c3a7f(0x2f9)]===!![]&&typeof _0x5305f4[_0x1c3a7f(0x28a)]==='string'&&_0x5305f4[_0x1c3a7f(0x28a)][_0x1c3a7f(0x1de)]()!==''&&_0xe0e33d[_0x1c3a7f(0x217)]({'path':_0x5ed3ef+_0x1c3a7f(0x2d2),'message':_0x1c3a7f(0x2fe)});}function validateGraphShape(_0x3f9e67,_0x54e105,_0x1ee399,_0x210fd0,_0x5bb583,_0xbb1ac6,_0x27fca0){const _0x3d28f8=a299_0x3624a4;for(const [_0x4bcb68,_0x41b29e]of _0x3f9e67){const _0x495731=_0x5bb583[_0x3d28f8(0x1f5)](_0x4bcb68)??[],_0x545939=_0x210fd0[_0x3d28f8(0x1f5)](_0x4bcb68)??[];_0x41b29e[_0x3d28f8(0x314)]!==_0x3d28f8(0x282)&&_0x495731[_0x3d28f8(0x2fc)]===0x0&&_0x27fca0[_0x3d28f8(0x217)]({'path':_0x3d28f8(0x25d)+_0x4bcb68,'message':_0x3d28f8(0x1cf)});_0x41b29e[_0x3d28f8(0x314)]!==_0x3d28f8(0x23a)&&_0x545939[_0x3d28f8(0x2fc)]===0x0&&_0x27fca0['push']({'path':_0x3d28f8(0x25d)+_0x4bcb68,'message':_0x3d28f8(0x1cd)});_0x41b29e[_0x3d28f8(0x314)]==='START'&&_0x495731['length']>0x0&&_0x27fca0['push']({'path':_0x3d28f8(0x25d)+_0x4bcb68,'message':_0x3d28f8(0x255)});_0x41b29e[_0x3d28f8(0x314)]===_0x3d28f8(0x23a)&&_0x545939[_0x3d28f8(0x2fc)]>0x0&&_0x27fca0[_0x3d28f8(0x217)]({'path':_0x3d28f8(0x25d)+_0x4bcb68,'message':_0x3d28f8(0x1e8)});if(_0x41b29e[_0x3d28f8(0x314)]==='CONDITION'){_0x545939[_0x3d28f8(0x2fc)]<0x2&&_0x27fca0[_0x3d28f8(0x217)]({'path':_0x3d28f8(0x25d)+_0x4bcb68,'message':'CONDITION\x20node\x20requires\x20at\x20least\x20two\x20outgoing\x20edges.'});const _0x185f75=_0x545939['filter'](_0x248593=>_0x248593['defaultFlow']===!![]);_0x185f75[_0x3d28f8(0x2fc)]!==0x1&&_0x27fca0['push']({'path':_0x3d28f8(0x25d)+_0x4bcb68,'message':_0x3d28f8(0x325)});if(_0x185f75[_0x3d28f8(0x2fc)]===0x1){const _0x58e9e2=_0x185f75[0x0],_0x1c9f07=_0xbb1ac6[_0x3d28f8(0x1f5)](_0x58e9e2)??_0x3d28f8(0x2bb);_0x58e9e2['conditionType']!==_0x3d28f8(0x29d)&&_0x27fca0[_0x3d28f8(0x217)]({'path':_0x1c9f07+'.conditionType','message':_0x3d28f8(0x2eb)});_0x58e9e2[_0x3d28f8(0x28a)]!==undefined&&_0x27fca0['push']({'path':_0x1c9f07+_0x3d28f8(0x2d2),'message':'CONDITION\x20default\x20edge\x20must\x20not\x20define\x20expression.'});for(const _0x3a292c of _0x545939){if(_0x3a292c===_0x58e9e2)continue;const _0x8f4e2=_0xbb1ac6[_0x3d28f8(0x1f5)](_0x3a292c)??_0x3d28f8(0x2bb);if(_0x3a292c['conditionType']!==_0x3d28f8(0x27e))_0x27fca0[_0x3d28f8(0x217)]({'path':_0x8f4e2+_0x3d28f8(0x1cc),'message':'CONDITION\x20non-default\x20edge\x20must\x20use\x20conditionType\x20EXPRESSION.'});else(typeof _0x3a292c[_0x3d28f8(0x28a)]!=='string'||_0x3a292c[_0x3d28f8(0x28a)][_0x3d28f8(0x1de)]()==='')&&_0x27fca0['push']({'path':_0x8f4e2+'.expression','message':_0x3d28f8(0x2b8)});}}}if(_0x41b29e[_0x3d28f8(0x314)]==='APPROVAL'&&(_0x41b29e[_0x3d28f8(0x225)]??_0x3d28f8(0x204))===_0x3d28f8(0x284)){if(_0x545939[_0x3d28f8(0x2fc)]!==0x1)_0x27fca0[_0x3d28f8(0x217)]({'path':'flowJson.nodes.'+_0x4bcb68,'message':_0x3d28f8(0x1d5)});else{const _0x46eafc=_0x545939[0x0];((_0x46eafc[_0x3d28f8(0x2dc)]??'ALWAYS')!==_0x3d28f8(0x29d)||_0x46eafc['defaultFlow']===!![]||typeof _0x46eafc[_0x3d28f8(0x28a)]===_0x3d28f8(0x2b1)&&_0x46eafc[_0x3d28f8(0x28a)][_0x3d28f8(0x1de)]()!=='')&&_0x27fca0[_0x3d28f8(0x217)]({'path':_0xbb1ac6[_0x3d28f8(0x1f5)](_0x46eafc)??_0x3d28f8(0x2bb),'message':_0x3d28f8(0x2a5)});}}else{if(_0x41b29e['type']===_0x3d28f8(0x204)){const _0x1b83fd=_0x545939[_0x3d28f8(0x21b)](_0x3861b4=>_0x3861b4[_0x3d28f8(0x2dc)]??_0x3d28f8(0x29d)),_0x1279be=_0x1b83fd[_0x3d28f8(0x342)](_0x5b086c=>_0x5b086c!==_0x3d28f8(0x28f)&&_0x5b086c!==_0x3d28f8(0x2b2));_0x1279be['length']>0x0&&_0x27fca0[_0x3d28f8(0x217)]({'path':'flowJson.nodes.'+_0x4bcb68,'message':'APPROVAL\x20node\x20outgoing\x20edges\x20must\x20use\x20APPROVED\x20or\x20REJECTED.'}),_0x1b83fd['filter'](_0x133d91=>_0x133d91===_0x3d28f8(0x28f))['length']!==0x1&&_0x27fca0[_0x3d28f8(0x217)]({'path':_0x3d28f8(0x25d)+_0x4bcb68,'message':_0x3d28f8(0x321)}),_0x1b83fd['filter'](_0x371a98=>_0x371a98===_0x3d28f8(0x2b2))['length']!==0x1&&_0x27fca0[_0x3d28f8(0x217)]({'path':'flowJson.nodes.'+_0x4bcb68,'message':_0x3d28f8(0x23f)}),_0x545939[_0x3d28f8(0x267)](_0x5c91c4=>_0x5c91c4[_0x3d28f8(0x2f9)]===!![])&&_0x27fca0[_0x3d28f8(0x217)]({'path':_0x3d28f8(0x25d)+_0x4bcb68,'message':_0x3d28f8(0x1ea)});}}}const _0x1f5473=new Set(),_0xa490e0=_0x29bc72=>{const _0xdffbc0=_0x3d28f8;if(_0x1f5473[_0xdffbc0(0x227)](_0x29bc72))return;_0x1f5473[_0xdffbc0(0x224)](_0x29bc72);for(const _0x4d869e of _0x210fd0[_0xdffbc0(0x1f5)](_0x29bc72)??[]){const _0xb67da3=resolveEdgeEndpoint(_0x4d869e[_0xdffbc0(0x1f7)],_0x4d869e[_0xdffbc0(0x2df)]);if(_0xb67da3&&_0x3f9e67[_0xdffbc0(0x227)](_0xb67da3))_0xa490e0(_0xb67da3);}};_0xa490e0(_0x54e105);for(const _0x31143a of _0x3f9e67[_0x3d28f8(0x259)]()){!_0x1f5473[_0x3d28f8(0x227)](_0x31143a)&&_0x27fca0['push']({'path':_0x3d28f8(0x25d)+_0x31143a,'message':_0x3d28f8(0x306)});}const _0x4d4fae=_0x1ee399[_0x3d28f8(0x267)](_0x5117fb=>_0x1f5473[_0x3d28f8(0x227)](_0x5117fb));if(!_0x4d4fae){_0x27fca0[_0x3d28f8(0x217)]({'path':_0x3d28f8(0x2bb),'message':_0x3d28f8(0x219)});return;}const _0x2d738f=new Set(),_0xfc0280=_0x2bd22c=>{const _0x1a9e67=_0x3d28f8;if(_0x2d738f['has'](_0x2bd22c))return;_0x2d738f['add'](_0x2bd22c);for(const _0x3b4da1 of _0x5bb583[_0x1a9e67(0x1f5)](_0x2bd22c)??[]){const _0x290126=resolveEdgeEndpoint(_0x3b4da1[_0x1a9e67(0x24b)],_0x3b4da1[_0x1a9e67(0x1f4)]);if(_0x290126&&_0x3f9e67[_0x1a9e67(0x227)](_0x290126))_0xfc0280(_0x290126);}};for(const _0x8e06f9 of _0x1ee399){if(_0x3f9e67[_0x3d28f8(0x227)](_0x8e06f9))_0xfc0280(_0x8e06f9);}for(const _0x8cb2ef of _0x1f5473){!_0x2d738f[_0x3d28f8(0x227)](_0x8cb2ef)&&_0x27fca0['push']({'path':_0x3d28f8(0x25d)+_0x8cb2ef,'message':_0x3d28f8(0x2d7)});}}function validateApprovalResults(_0x243de8,_0x408496,_0x14131a,_0x26e97c){const _0xaf6534=a299_0x3624a4;if(_0x408496===0x0)return;const _0xbbbcd=new Set(_0x14131a['map'](_0x51bef0=>_0x243de8[_0xaf6534(0x1f5)](_0x51bef0)?.[_0xaf6534(0x2d5)])[_0xaf6534(0x342)](_0x37dc91=>typeof _0x37dc91==='string'));for(const _0x40c343 of['APPROVED',_0xaf6534(0x2b2)]){!_0xbbbcd[_0xaf6534(0x227)](_0x40c343)&&_0x26e97c['push']({'path':'flowJson.nodes','message':_0xaf6534(0x278)+_0x40c343+'.'});}}function validateScriptResultReferences(_0x5bcdf8,_0x4b4a14,_0x4757fc,_0x2fd2ed,_0x32057c,_0x59db6a,_0x2dbca2){const _0x5abacd=a299_0x3624a4;if(_0x59db6a[_0x5abacd(0x27b)]===0x0)return;const _0x970cc5=new Set(),_0xc3734=_0x502d82=>{const _0x51ea4b=_0x5abacd;if(!_0x970cc5[_0x51ea4b(0x227)](_0x502d82)&&_0x5bcdf8[_0x51ea4b(0x227)](_0x502d82)){_0x970cc5['add'](_0x502d82);for(const _0x39f28b of _0x4757fc[_0x51ea4b(0x1f5)](_0x502d82)??[]){const _0x17d92a=resolveEdgeEndpoint(_0x39f28b['target'],_0x39f28b['targetNodeId']);if(_0x17d92a)_0xc3734(_0x17d92a);}}};_0xc3734(_0x4b4a14);const _0x50df65=new Map();for(const _0x5e1bbe of _0x970cc5){_0x50df65[_0x5abacd(0x289)](_0x5e1bbe,_0x5e1bbe===_0x4b4a14?new Set([_0x4b4a14]):new Set(_0x970cc5));}let _0x128faf=!![];while(_0x128faf){_0x128faf=![];for(const _0x56bdaf of _0x970cc5){if(_0x56bdaf===_0x4b4a14)continue;const _0x2e55d2=(_0x2fd2ed['get'](_0x56bdaf)??[])['map'](_0x57ac3f=>resolveEdgeEndpoint(_0x57ac3f[_0x5abacd(0x24b)],_0x57ac3f[_0x5abacd(0x1f4)]))[_0x5abacd(0x342)](_0x349055=>Boolean(_0x349055&&_0x970cc5['has'](_0x349055)));if(_0x2e55d2['length']===0x0)continue;const _0x68462c=new Set(_0x50df65[_0x5abacd(0x1f5)](_0x2e55d2[0x0])??[]);for(const _0x3f4eee of _0x2e55d2['slice'](0x1)){const _0x644d4=_0x50df65[_0x5abacd(0x1f5)](_0x3f4eee)??new Set();for(const _0x7c1a8d of _0x68462c){if(!_0x644d4[_0x5abacd(0x227)](_0x7c1a8d))_0x68462c[_0x5abacd(0x32e)](_0x7c1a8d);}}_0x68462c[_0x5abacd(0x224)](_0x56bdaf);const _0x4195ab=_0x50df65['get'](_0x56bdaf);!setsEqual(_0x4195ab,_0x68462c)&&(_0x50df65[_0x5abacd(0x289)](_0x56bdaf,_0x68462c),_0x128faf=!![]);}}for(const [_0x40fce0,_0x3b1d4c]of _0x4757fc){const _0x9e87a=_0x50df65[_0x5abacd(0x1f5)](_0x40fce0);if(!_0x9e87a)continue;for(const _0x29beed of _0x3b1d4c){if(_0x29beed[_0x5abacd(0x2dc)]!==_0x5abacd(0x27e)||typeof _0x29beed['expression']!=='string')continue;for(const [_0x251bab,_0x24847c]of _0x59db6a){expressionReferencesVariable(_0x29beed['expression'],_0x251bab)&&!_0x9e87a[_0x5abacd(0x227)](_0x24847c)&&_0x2dbca2[_0x5abacd(0x217)]({'path':(_0x32057c['get'](_0x29beed)??'flowJson.edges')+'.expression','message':_0x5abacd(0x1e2)+_0x251bab+_0x5abacd(0x240)+_0x24847c+_0x5abacd(0x318)+_0x40fce0+'.'});}}}}function expressionReferencesVariable(_0x14a119,_0x54aa0a){const _0x24434e=a299_0x3624a4;let _0x26731a=0x0;while(_0x26731a<_0x14a119[_0x24434e(0x2fc)]){const _0x489201=_0x14a119[_0x26731a];if(_0x489201==='\x27'||_0x489201==='\x22'){_0x26731a=skipQuotedExpressionSegment(_0x14a119,_0x26731a,_0x489201);continue;}if(!/[A-Za-z_]/[_0x24434e(0x226)](_0x489201)){_0x26731a+=0x1;continue;}const _0x16d416=_0x26731a;_0x26731a+=0x1;while(_0x26731a<_0x14a119[_0x24434e(0x2fc)]&&/[A-Za-z0-9_]/[_0x24434e(0x226)](_0x14a119[_0x26731a])){_0x26731a+=0x1;}if(_0x14a119[_0x24434e(0x2e0)](_0x16d416,_0x26731a)!==_0x54aa0a)continue;let _0x552ee6=_0x16d416-0x1;while(_0x552ee6>=0x0&&/\s/['test'](_0x14a119[_0x552ee6])){_0x552ee6-=0x1;}if(_0x14a119[_0x552ee6]!=='.')return!![];}return![];}function skipQuotedExpressionSegment(_0x187b98,_0x57267b,_0x4b0a26){const _0x596469=a299_0x3624a4;let _0x5f53c7=_0x57267b+0x1;while(_0x5f53c7<_0x187b98[_0x596469(0x2fc)]){if(_0x187b98[_0x5f53c7]==='\x5c'){_0x5f53c7+=0x2;continue;}if(_0x187b98[_0x5f53c7]===_0x4b0a26)return _0x5f53c7+0x1;_0x5f53c7+=0x1;}return _0x5f53c7;}function resolveEffectiveResultVariable(_0x20d7ce,_0x4e3c21){const _0x52ee12=a299_0x3624a4;if(_0x20d7ce===undefined||_0x20d7ce===null||_0x4e3c21&&_0x20d7ce==='')return DEFAULT_SCRIPT_RESULT_VARIABLE;if(typeof _0x20d7ce!==_0x52ee12(0x2b1)||!VARIABLE_PATTERN[_0x52ee12(0x226)](_0x20d7ce)||RESERVED_RESULT_VARIABLES[_0x52ee12(0x227)](_0x20d7ce)||_0x20d7ce['startsWith'](_0x52ee12(0x230)))return undefined;return _0x20d7ce;}function registerResultVariableOwner(_0x4f33f1,_0x25b9ca,_0x4d480d,_0x475775){const _0x30183b=a299_0x3624a4;if(_0x4f33f1['has'](_0x25b9ca)){_0x475775['push']({'path':'flowJson.nodes','message':_0x30183b(0x2a8)+_0x25b9ca+'.'});return;}_0x4f33f1[_0x30183b(0x289)](_0x25b9ca,_0x4d480d);}function setsEqual(_0xd11c2e,_0x2b6544){const _0xd68ad6=a299_0x3624a4;return _0xd11c2e['size']===_0x2b6544[_0xd68ad6(0x27b)]&&[..._0xd11c2e][_0xd68ad6(0x281)](_0x224669=>_0x2b6544[_0xd68ad6(0x227)](_0x224669));}function isValidUserId(_0x55086e){const _0xf2ff80=a299_0x3624a4;if(typeof _0x55086e==='string')return _0x55086e[_0xf2ff80(0x1de)]()[_0xf2ff80(0x2fc)]>0x0;return Number[_0xf2ff80(0x26f)](_0x55086e)&&Number(_0x55086e)>0x0;}function resolveEdgeEndpoint(_0x52f3b8,_0x41c7db){const _0x46c5f4=a299_0x3624a4;if(typeof _0x52f3b8==='string'&&_0x52f3b8[_0x46c5f4(0x1de)]())return _0x52f3b8[_0x46c5f4(0x1de)]();if(typeof _0x41c7db===_0x46c5f4(0x2b1)&&_0x41c7db[_0x46c5f4(0x1de)]())return _0x41c7db[_0x46c5f4(0x1de)]();return undefined;}function removeEmptyMetadata(_0x3c4442,_0x27f60d,_0x4a853e,_0x469573){const _0x4016e9=a299_0x3624a4;if(Array[_0x4016e9(0x32d)](_0x3c4442)){_0x3c4442[_0x4016e9(0x340)]((_0xf69adf,_0x587399)=>removeEmptyMetadata(_0xf69adf,_0x27f60d+'['+_0x587399+']',_0x4a853e,_0x469573));return;}if(!isRecord(_0x3c4442))return;for(const [_0x361d2c,_0x54b973]of Object[_0x4016e9(0x243)](_0x3c4442)){const _0x1ae53f=_0x27f60d+'.'+_0x361d2c;if(_0x361d2c===_0x4016e9(0x2c4)&&isEmptyJsonValue(_0x54b973)){delete _0x3c4442[_0x361d2c],_0x469573[_0x4016e9(0x217)](_0x1ae53f),_0x4a853e[_0x4016e9(0x217)]({'code':_0x4016e9(0x2c2),'path':_0x1ae53f,'message':_0x1ae53f+'\x20was\x20empty\x20and\x20was\x20removed.'});continue;}removeEmptyMetadata(_0x54b973,_0x1ae53f,_0x4a853e,_0x469573);}}function isEmptyJsonValue(_0x321ff7){const _0x2e594e=a299_0x3624a4;if(_0x321ff7===null||_0x321ff7===undefined)return!![];if(typeof _0x321ff7===_0x2e594e(0x2b1))return _0x321ff7[_0x2e594e(0x1de)]()==='';if(Array[_0x2e594e(0x32d)](_0x321ff7))return _0x321ff7[_0x2e594e(0x2fc)]===0x0;return isRecord(_0x321ff7)&&Object[_0x2e594e(0x259)](_0x321ff7)['length']===0x0;}function isRecord(_0x5b7a89){const _0x5c2270=a299_0x3624a4;return typeof _0x5b7a89===_0x5c2270(0x322)&&_0x5b7a89!==null&&!Array['isArray'](_0x5b7a89);}function cloneJsonValue(_0x26c694){const _0x412fa5=a299_0x3624a4;return JSON[_0x412fa5(0x316)](JSON[_0x412fa5(0x31e)](_0x26c694));}export async function readFlowConfigFile(_0x243048){const _0x27e646=a299_0x3624a4,_0x25f792=await readFile(resolve(_0x243048),_0x27e646(0x261));return JSON[_0x27e646(0x316)](_0x25f792);}
@@ -1 +1 @@
1
- const a299_0x26a777=a299_0x3a1c;(function(_0x1ca209,_0x3a1e46){const _0xd82de6=a299_0x3a1c,_0x590411=_0x1ca209();while(!![]){try{const _0x548051=-parseInt(_0xd82de6(0x1f7))/0x1*(-parseInt(_0xd82de6(0x232))/0x2)+-parseInt(_0xd82de6(0x1f2))/0x3+-parseInt(_0xd82de6(0x209))/0x4+parseInt(_0xd82de6(0x218))/0x5*(parseInt(_0xd82de6(0x213))/0x6)+parseInt(_0xd82de6(0x20d))/0x7+-parseInt(_0xd82de6(0x228))/0x8+-parseInt(_0xd82de6(0x20c))/0x9*(-parseInt(_0xd82de6(0x1f8))/0xa);if(_0x548051===_0x3a1e46)break;else _0x590411['push'](_0x590411['shift']());}catch(_0x528279){_0x590411['push'](_0x590411['shift']());}}}(a299_0x544a,0x8874e));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=a299_0x26a777(0x229);export const INSTANT_API_POLICY_FILE_NAME='policy.json';export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x4df514,_0x165401,_0x531972){return new CliError(_0x4df514,0x1,_0x165401,_0x531972);}export function loadInstantApiPolicyLocalConfig(_0x5294bd,_0x3ddaec){assertSafeAppCode(_0x5294bd);const _0x3d88a5=resolve(_0x3ddaec??findProjectRootDirectory()),_0x14ef2a=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x5294bd+'/'+INSTANT_API_POLICY_FILE_NAME,_0x57710c=resolve(_0x3d88a5,INSTANT_API_POLICY_RELATIVE_ROOT,_0x5294bd),_0x109738=resolve(_0x57710c,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x3d88a5,'appCode':_0x5294bd,'policyRoot':_0x57710c,'policyFilePath':_0x109738,'policyRelativePath':_0x14ef2a};}export function createDefaultInstantApiPolicyConfig(_0x1adde8,_0x5cd441='allow'){return assertSafeAppCode(_0x1adde8),{'version':'2','appCode':_0x1adde8,'defaults':{'instantApi':_0x5cd441},'rules':[]};}function a299_0x3a1c(_0xf258de,_0xabfdbb){_0xf258de=_0xf258de-0x1f2;const _0x544a46=a299_0x544a();let _0x3a1c7a=_0x544a46[_0xf258de];return _0x3a1c7a;}function a299_0x544a(){const _0x2ec6b7=['Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_file_unwritable','4373016GtpuDU','instantApi','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','9054RPXHnh','1878478RWwNLn','Review\x20the\x20file\x20before\x20retrying.','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','ENOENT','isArray','decode','5952684qAnooA','utf8','object','trim','pid','5TaTbGF','created','catch','instant_api_policy_version_invalid','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','instant_api_policy_file_invalid','policyFilePath','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','parse','instant_api_policy_defaults_invalid','appCode','instant_api_policy_json_invalid','version','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','4225568bYrIza','.rabetbase/instant-api-policy','force','byteLength','instant_api_policy_app_code_mismatch','length','defaults','includes','.tmp','instant_api_policy_app_code_invalid','2mjKSOz','393240wNSQtC','unchanged','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','size','policyRoot','169732oLezwn','8760fjCSIx','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_file_unreadable','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','rules','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','instant_api_policy_rules_invalid','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','string','code','overwritten','Policy\x20defaults.instantApi\x20is\x20required.','stringify','instant_api_policy_file_too_large'];a299_0x544a=function(){return _0x2ec6b7;};return a299_0x544a();}export async function readInstantApiPolicyConfigFile(_0x19ef65){const _0x1e462a=a299_0x26a777;let _0x4a6711;try{_0x4a6711=await stat(_0x19ef65[_0x1e462a(0x220)]);}catch(_0xebd619){throw instantApiPolicyError('instant_api_policy_file_missing',_0x1e462a(0x21d)+_0x19ef65[_0x1e462a(0x220)],_0x1e462a(0x1fd));}if(!_0x4a6711['isFile']())throw instantApiPolicyError(_0x1e462a(0x21f),_0x1e462a(0x21c)+_0x19ef65[_0x1e462a(0x220)]);if(_0x4a6711[_0x1e462a(0x1f5)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1e462a(0x205),_0x1e462a(0x227));let _0x30ef57;try{_0x30ef57=await readFile(_0x19ef65['policyFilePath']);}catch{throw instantApiPolicyError(_0x1e462a(0x1fa),_0x1e462a(0x1fb)+_0x19ef65[_0x1e462a(0x220)]);}if(_0x30ef57[_0x1e462a(0x22b)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1e462a(0x205),_0x1e462a(0x227));let _0x3f461f;try{_0x3f461f=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x1e462a(0x212)](_0x30ef57);}catch{throw instantApiPolicyError(_0x1e462a(0x21f),_0x1e462a(0x20b)+_0x19ef65[_0x1e462a(0x220)]);}let _0x3facd6;try{_0x3facd6=JSON[_0x1e462a(0x222)](_0x3f461f);}catch{throw instantApiPolicyError(_0x1e462a(0x225),_0x1e462a(0x206)+_0x19ef65[_0x1e462a(0x220)]);}return assertLocalPolicyContract(_0x3facd6,_0x19ef65['appCode']);}export async function writeInstantApiPolicyConfigFile(_0x277d62,_0x26b028,_0xc13757={}){const _0x783127=a299_0x26a777,_0xc15a8e=assertLocalPolicyContract(_0x26b028,_0x277d62['appCode']),_0x288d23=JSON[_0x783127(0x204)](_0xc15a8e,null,0x2)+'\x0a';if(Buffer['byteLength'](_0x288d23,_0x783127(0x214))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x783127(0x205),_0x783127(0x227));await mkdir(_0x277d62[_0x783127(0x1f6)],{'recursive':!![]});let _0x570d8a;try{_0x570d8a=await readFile(_0x277d62[_0x783127(0x220)],_0x783127(0x214));}catch(_0x261b8d){if(!isMissingFile(_0x261b8d))throw instantApiPolicyError('instant_api_policy_file_unreadable',_0x783127(0x1f9)+_0x277d62[_0x783127(0x220)]);}if(_0x570d8a===_0x288d23)return{'action':_0x783127(0x1f3),'filePath':_0x277d62[_0x783127(0x220)]};if(_0x570d8a!==undefined&&!_0xc13757[_0x783127(0x22a)])throw instantApiPolicyError('instant_api_policy_file_exists','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20'+_0x277d62['policyFilePath'],_0x783127(0x21e));if(_0x570d8a===undefined)try{return await writeFile(_0x277d62[_0x783127(0x220)],_0x288d23,{'encoding':_0x783127(0x214),'flag':'wx'}),{'action':_0x783127(0x219),'filePath':_0x277d62[_0x783127(0x220)]};}catch(_0x50ea82){if(!isAlreadyExists(_0x50ea82))throw instantApiPolicyError(_0x783127(0x208),'Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20'+_0x277d62[_0x783127(0x220)]);if(!_0xc13757[_0x783127(0x22a)])throw instantApiPolicyError('instant_api_policy_file_exists',_0x783127(0x1ff)+_0x277d62[_0x783127(0x220)],_0x783127(0x20e));}const _0x2e8800=resolve(dirname(_0x277d62[_0x783127(0x220)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x783127(0x217)]+'.'+randomUUID()+_0x783127(0x230));try{await writeFile(_0x2e8800,_0x288d23,{'encoding':_0x783127(0x214),'flag':'wx'}),await rename(_0x2e8800,_0x277d62['policyFilePath']);}catch{await unlink(_0x2e8800)[_0x783127(0x21a)](()=>undefined);throw instantApiPolicyError('instant_api_policy_file_unwritable',_0x783127(0x207)+_0x277d62[_0x783127(0x220)]);}return{'action':_0x783127(0x202),'filePath':_0x277d62[_0x783127(0x220)]};}function assertSafeAppCode(_0x1cba79){const _0x4e33c0=a299_0x26a777,_0x1fc9b4=_0x1cba79[_0x4e33c0(0x216)]();if(!_0x1fc9b4||_0x1fc9b4!==_0x1cba79||_0x1fc9b4[_0x4e33c0(0x22d)]>0x64||_0x1fc9b4==='.'||_0x1fc9b4==='..'||_0x1fc9b4[_0x4e33c0(0x22f)]('/')||_0x1fc9b4['includes']('\x5c')||_0x1fc9b4['includes']('\x00'))throw instantApiPolicyError(_0x4e33c0(0x231),'appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.');}function assertLocalPolicyContract(_0x3f2194,_0x34183e){const _0x3bf9f8=a299_0x26a777;if(!isObject(_0x3f2194))throw instantApiPolicyError(_0x3bf9f8(0x225),_0x3bf9f8(0x1f4));if(_0x3f2194[_0x3bf9f8(0x226)]!=='1'&&_0x3f2194[_0x3bf9f8(0x226)]!=='2')throw instantApiPolicyError(_0x3bf9f8(0x21b),_0x3bf9f8(0x221),'version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.');if(_0x3f2194[_0x3bf9f8(0x224)]!==_0x34183e)throw instantApiPolicyError(_0x3bf9f8(0x22c),'Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20'+_0x34183e+'.');if(!isObject(_0x3f2194[_0x3bf9f8(0x22e)])||typeof _0x3f2194[_0x3bf9f8(0x22e)][_0x3bf9f8(0x20a)]!==_0x3bf9f8(0x200))throw instantApiPolicyError(_0x3bf9f8(0x223),_0x3bf9f8(0x203));if(_0x3f2194[_0x3bf9f8(0x1fc)]!==undefined&&_0x3f2194[_0x3bf9f8(0x1fc)]!==null&&!Array[_0x3bf9f8(0x211)](_0x3f2194[_0x3bf9f8(0x1fc)]))throw instantApiPolicyError(_0x3bf9f8(0x1fe),_0x3bf9f8(0x20f));return _0x3f2194;}function isObject(_0xfa722){const _0x5952da=a299_0x26a777;return _0xfa722!==null&&typeof _0xfa722===_0x5952da(0x215)&&!Array[_0x5952da(0x211)](_0xfa722);}function isMissingFile(_0x8a517e){const _0x442958=a299_0x26a777;return Boolean(_0x8a517e&&typeof _0x8a517e===_0x442958(0x215)&&_0x8a517e[_0x442958(0x201)]===_0x442958(0x210));}function isAlreadyExists(_0x2f97bc){const _0x61f0d4=a299_0x26a777;return Boolean(_0x2f97bc&&typeof _0x2f97bc===_0x61f0d4(0x215)&&_0x2f97bc[_0x61f0d4(0x201)]==='EEXIST');}
1
+ const a300_0x185215=a300_0x42b4;(function(_0x11f7ff,_0x4f8c4d){const _0x257a1c=a300_0x42b4,_0x207f43=_0x11f7ff();while(!![]){try{const _0x2b8d9f=-parseInt(_0x257a1c(0x8f))/0x1*(-parseInt(_0x257a1c(0xac))/0x2)+parseInt(_0x257a1c(0xa8))/0x3+parseInt(_0x257a1c(0x93))/0x4+parseInt(_0x257a1c(0xaf))/0x5+parseInt(_0x257a1c(0x95))/0x6+-parseInt(_0x257a1c(0x91))/0x7+-parseInt(_0x257a1c(0x94))/0x8;if(_0x2b8d9f===_0x4f8c4d)break;else _0x207f43['push'](_0x207f43['shift']());}catch(_0x280df8){_0x207f43['push'](_0x207f43['shift']());}}}(a300_0x334b,0xe1438));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='.rabetbase/instant-api-policy';export const INSTANT_API_POLICY_FILE_NAME=a300_0x185215(0x92);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0xfdf1e7,_0x446a1d,_0x3eb7e1){return new CliError(_0xfdf1e7,0x1,_0x446a1d,_0x3eb7e1);}export function loadInstantApiPolicyLocalConfig(_0x164c1c,_0x1f9d29){assertSafeAppCode(_0x164c1c);const _0xd42f3a=resolve(_0x1f9d29??findProjectRootDirectory()),_0x5c5799=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x164c1c+'/'+INSTANT_API_POLICY_FILE_NAME,_0xd3b3d2=resolve(_0xd42f3a,INSTANT_API_POLICY_RELATIVE_ROOT,_0x164c1c),_0x273155=resolve(_0xd3b3d2,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0xd42f3a,'appCode':_0x164c1c,'policyRoot':_0xd3b3d2,'policyFilePath':_0x273155,'policyRelativePath':_0x5c5799};}export function createDefaultInstantApiPolicyConfig(_0x4b2df5,_0x26635a='allow'){return assertSafeAppCode(_0x4b2df5),{'version':'2','appCode':_0x4b2df5,'defaults':{'instantApi':_0x26635a},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x13da20){const _0x3fa30f=a300_0x185215;let _0x126c62;try{_0x126c62=await stat(_0x13da20[_0x3fa30f(0x9d)]);}catch(_0x31d340){throw instantApiPolicyError(_0x3fa30f(0xaa),'Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20'+_0x13da20[_0x3fa30f(0x9d)],_0x3fa30f(0x7b));}if(!_0x126c62[_0x3fa30f(0x89)]())throw instantApiPolicyError('instant_api_policy_file_invalid',_0x3fa30f(0x97)+_0x13da20[_0x3fa30f(0x9d)]);if(_0x126c62[_0x3fa30f(0xa9)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x3fa30f(0x72));let _0x3172c3;try{_0x3172c3=await readFile(_0x13da20[_0x3fa30f(0x9d)]);}catch{throw instantApiPolicyError(_0x3fa30f(0xa0),'Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20'+_0x13da20[_0x3fa30f(0x9d)]);}if(_0x3172c3[_0x3fa30f(0x76)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x3fa30f(0x73),_0x3fa30f(0x72));let _0x3de1a8;try{_0x3de1a8=new TextDecoder(_0x3fa30f(0xa4),{'fatal':!![],'ignoreBOM':!![]})[_0x3fa30f(0xa3)](_0x3172c3);}catch{throw instantApiPolicyError('instant_api_policy_file_invalid',_0x3fa30f(0x7c)+_0x13da20[_0x3fa30f(0x9d)]);}let _0x5d7e66;try{_0x5d7e66=JSON[_0x3fa30f(0x74)](_0x3de1a8);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid',_0x3fa30f(0x86)+_0x13da20['policyFilePath']);}return assertLocalPolicyContract(_0x5d7e66,_0x13da20[_0x3fa30f(0xa2)]);}export async function writeInstantApiPolicyConfigFile(_0x195ba9,_0x24bdc7,_0x17658c={}){const _0x44ae15=a300_0x185215,_0x54ae44=assertLocalPolicyContract(_0x24bdc7,_0x195ba9['appCode']),_0x30f427=JSON[_0x44ae15(0x9a)](_0x54ae44,null,0x2)+'\x0a';if(Buffer[_0x44ae15(0x76)](_0x30f427,_0x44ae15(0x7a))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x44ae15(0x73),_0x44ae15(0x72));await mkdir(_0x195ba9['policyRoot'],{'recursive':!![]});let _0x56d4e9;try{_0x56d4e9=await readFile(_0x195ba9[_0x44ae15(0x9d)],'utf8');}catch(_0x42fc30){if(!isMissingFile(_0x42fc30))throw instantApiPolicyError(_0x44ae15(0xa0),_0x44ae15(0x83)+_0x195ba9['policyFilePath']);}if(_0x56d4e9===_0x30f427)return{'action':_0x44ae15(0x80),'filePath':_0x195ba9[_0x44ae15(0x9d)]};if(_0x56d4e9!==undefined&&!_0x17658c[_0x44ae15(0x90)])throw instantApiPolicyError(_0x44ae15(0x75),'Instant\x20API\x20policy\x20file\x20already\x20exists:\x20'+_0x195ba9[_0x44ae15(0x9d)],_0x44ae15(0x8b));if(_0x56d4e9===undefined)try{return await writeFile(_0x195ba9[_0x44ae15(0x9d)],_0x30f427,{'encoding':_0x44ae15(0x7a),'flag':'wx'}),{'action':_0x44ae15(0x79),'filePath':_0x195ba9[_0x44ae15(0x9d)]};}catch(_0x278044){if(!isAlreadyExists(_0x278044))throw instantApiPolicyError(_0x44ae15(0x87),_0x44ae15(0x7e)+_0x195ba9[_0x44ae15(0x9d)]);if(!_0x17658c[_0x44ae15(0x90)])throw instantApiPolicyError(_0x44ae15(0x75),'Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20'+_0x195ba9[_0x44ae15(0x9d)],_0x44ae15(0x96));}const _0x1d3305=resolve(dirname(_0x195ba9[_0x44ae15(0x9d)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x44ae15(0x7f)]+'.'+randomUUID()+_0x44ae15(0x8d));try{await writeFile(_0x1d3305,_0x30f427,{'encoding':'utf8','flag':'wx'}),await rename(_0x1d3305,_0x195ba9[_0x44ae15(0x9d)]);}catch{await unlink(_0x1d3305)[_0x44ae15(0x9e)](()=>undefined);throw instantApiPolicyError('instant_api_policy_file_unwritable',_0x44ae15(0x81)+_0x195ba9[_0x44ae15(0x9d)]);}return{'action':'overwritten','filePath':_0x195ba9['policyFilePath']};}function assertSafeAppCode(_0x37d014){const _0x4512c4=a300_0x185215,_0x5928cb=_0x37d014[_0x4512c4(0x9b)]();if(!_0x5928cb||_0x5928cb!==_0x37d014||_0x5928cb[_0x4512c4(0xa1)]>0x64||_0x5928cb==='.'||_0x5928cb==='..'||_0x5928cb[_0x4512c4(0xa5)]('/')||_0x5928cb[_0x4512c4(0xa5)]('\x5c')||_0x5928cb['includes']('\x00'))throw instantApiPolicyError('instant_api_policy_app_code_invalid',_0x4512c4(0x9f));}function assertLocalPolicyContract(_0x256b8d,_0x1ee902){const _0x501187=a300_0x185215;if(!isObject(_0x256b8d))throw instantApiPolicyError(_0x501187(0x98),_0x501187(0x8c));if(_0x256b8d[_0x501187(0x99)]!=='1'&&_0x256b8d[_0x501187(0x99)]!=='2')throw instantApiPolicyError(_0x501187(0xae),_0x501187(0x78),'version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.');if(_0x256b8d['appCode']!==_0x1ee902)throw instantApiPolicyError(_0x501187(0x82),_0x501187(0x9c)+_0x1ee902+'.');if(!isObject(_0x256b8d[_0x501187(0xa7)])||typeof _0x256b8d[_0x501187(0xa7)][_0x501187(0xa6)]!=='string')throw instantApiPolicyError('instant_api_policy_defaults_invalid',_0x501187(0xab));if(_0x256b8d[_0x501187(0x88)]!==undefined&&_0x256b8d[_0x501187(0x88)]!==null&&!Array[_0x501187(0x85)](_0x256b8d[_0x501187(0x88)]))throw instantApiPolicyError(_0x501187(0x8a),_0x501187(0xad));return _0x256b8d;}function a300_0x42b4(_0x117b05,_0x18cf20){_0x117b05=_0x117b05-0x72;const _0x334bb7=a300_0x334b();let _0x42b407=_0x334bb7[_0x117b05];return _0x42b407;}function isObject(_0x5801cc){const _0x36c14c=a300_0x185215;return _0x5801cc!==null&&typeof _0x5801cc===_0x36c14c(0x7d)&&!Array[_0x36c14c(0x85)](_0x5801cc);}function isMissingFile(_0x4ba0cb){const _0x200b2b=a300_0x185215;return Boolean(_0x4ba0cb&&typeof _0x4ba0cb===_0x200b2b(0x7d)&&_0x4ba0cb[_0x200b2b(0x84)]===_0x200b2b(0x8e));}function a300_0x334b(){const _0x322442=['decode','utf-8','includes','instantApi','defaults','3372042kuoDWy','size','instant_api_policy_file_missing','Policy\x20defaults.instantApi\x20is\x20required.','16VfKUvN','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','instant_api_policy_version_invalid','8211040UKMMZS','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','instant_api_policy_file_too_large','parse','instant_api_policy_file_exists','byteLength','EEXIST','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','created','utf8','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','object','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','pid','unchanged','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_app_code_mismatch','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','code','isArray','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','instant_api_policy_file_unwritable','rules','isFile','instant_api_policy_rules_invalid','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','.tmp','ENOENT','77588hLQfKg','force','8609643PnGixO','policy.json','5837972yZxyPa','28019544ZqptYj','4851918UGPYbl','Review\x20the\x20file\x20before\x20retrying.','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','instant_api_policy_json_invalid','version','stringify','trim','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','policyFilePath','catch','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','instant_api_policy_file_unreadable','length','appCode'];a300_0x334b=function(){return _0x322442;};return a300_0x334b();}function isAlreadyExists(_0x195854){const _0x5978ca=a300_0x185215;return Boolean(_0x195854&&typeof _0x195854===_0x5978ca(0x7d)&&_0x195854[_0x5978ca(0x84)]===_0x5978ca(0x77));}
@@ -1 +1 @@
1
- const a300_0x7e2592=a300_0x4b16;(function(_0x4fc064,_0x449bef){const _0x20e34f=a300_0x4b16,_0x479c71=_0x4fc064();while(!![]){try{const _0x2689a6=parseInt(_0x20e34f(0xd3))/0x1+-parseInt(_0x20e34f(0x10c))/0x2+parseInt(_0x20e34f(0xf8))/0x3+-parseInt(_0x20e34f(0x10a))/0x4*(parseInt(_0x20e34f(0xf9))/0x5)+-parseInt(_0x20e34f(0xfb))/0x6+parseInt(_0x20e34f(0x11c))/0x7*(parseInt(_0x20e34f(0xd7))/0x8)+parseInt(_0x20e34f(0xe3))/0x9;if(_0x2689a6===_0x449bef)break;else _0x479c71['push'](_0x479c71['shift']());}catch(_0x89eac3){_0x479c71['push'](_0x479c71['shift']());}}}(a300_0x1cc8,0x274c5));function a300_0x1cc8(){const _0x60e778=['json','length','scope','POST','total','607464QSFSMe','362980rAWvTZ','KB\x20Service\x20knowledge\x20search\x20was\x20rate\x20limited\x20(HTTP\x20429).','523344BJTlat','validation','content-type','isSafeInteger','get','timingsMs','no-store','KB\x20Service\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','schemaVersion','apiError','/v2/development/apps/','strategyFingerprint','revision','KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.','hits','16sVqCLk','rank','415082USJNJc','TimeoutError','cli:rabetbase','KB\x20Service\x20knowledge\x20search\x20returned\x20an\x20invalid\x20response\x20contract.','stringify','timeout','application/json','Knowledge\x20search\x20appCode\x20is\x20required.','topK','isFinite','https:','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','AbortError','toLowerCase','string','Knowledge\x20search\x20cancelled.','8701LBfpst','KB\x20Service\x20knowledge\x20search\x20failed\x20(HTTP\x20','tags','/knowledge/search','origin','Knowledge\x20search\x20query\x20is\x20required.','search','hash','appCode','object','text','signal','authRequired','cookie','248472ScamAx','KB\x20Service\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','isArray','chunkId','1384QXFPGd','scoreKind','trim','entries','score','response','documentId','status','hits[','protocol','networkError','cache-control','721035CYSqPM','aborted','rawScore','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','development','split','headers','name','test','serviceUrl','finalScore','pathname','map','some','sort','title'];a300_0x1cc8=function(){return _0x60e778;};return a300_0x1cc8();}import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a300_0x7e2592(0x103),'profile',a300_0x7e2592(0xf7),a300_0x7e2592(0x109),a300_0x7e2592(0x106),a300_0x7e2592(0x100)],HIT_KEYS=['documentId','revision','chunkId',a300_0x7e2592(0xf5),a300_0x7e2592(0xf2),a300_0x7e2592(0xcf),a300_0x7e2592(0x11e),'rank',a300_0x7e2592(0xe5),a300_0x7e2592(0xed),'scoreKind'];export function normalizeKbServiceOrigin(_0x19abe9){const _0x16ff53=a300_0x7e2592,_0x47095c=()=>CliErrors['validation']('Invalid\x20--kb-service-url:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.'),_0x5c9a37=_0x19abe9?.[_0x16ff53(0xd9)]();if(!_0x5c9a37||/[\u0000-\u0020\u007f]/['test'](_0x5c9a37)||!/^https:\/\/[^/?#@\\]+\/?$/i[_0x16ff53(0xeb)](_0x5c9a37))throw _0x47095c();let _0x18fe06;try{_0x18fe06=new URL(_0x5c9a37);}catch{throw _0x47095c();}if(_0x18fe06[_0x16ff53(0xe0)]!==_0x16ff53(0x116)||!_0x18fe06['hostname']||_0x18fe06['username']||_0x18fe06['password']||_0x18fe06[_0x16ff53(0xee)]!=='/'||_0x18fe06[_0x16ff53(0x122)]||_0x18fe06[_0x16ff53(0xcc)])throw _0x47095c();return _0x18fe06[_0x16ff53(0x120)];}function a300_0x4b16(_0x154d1b,_0x233706){_0x154d1b=_0x154d1b-0xcc;const _0x1cc8fe=a300_0x1cc8();let _0x4b163b=_0x1cc8fe[_0x154d1b];return _0x4b163b;}export async function searchDirectKnowledge(_0x440807){const _0x6db7b5=a300_0x7e2592,_0xa9504b=_0x440807[_0x6db7b5(0xcd)]['trim'](),_0x5067fa=_0x440807['query']['trim']();if(!_0xa9504b)throw CliErrors[_0x6db7b5(0xfc)](_0x6db7b5(0x113));if(!_0x440807[_0x6db7b5(0xd2)]['trim']())throw CliErrors['authRequired']();if(!_0x5067fa)throw CliErrors['validation'](_0x6db7b5(0x121));validateTopK(_0x440807[_0x6db7b5(0x114)]);const _0x50e988=normalizeKbServiceOrigin(_0x440807[_0x6db7b5(0xec)]),_0x2c1262=AbortSignal[_0x6db7b5(0x111)](0xea60),_0x12e217=_0x440807[_0x6db7b5(0xd0)]?AbortSignal['any']([_0x440807[_0x6db7b5(0xd0)],_0x2c1262]):_0x2c1262;let _0x44886d;try{_0x44886d=await fetch(_0x50e988+_0x6db7b5(0x105)+encodeURIComponent(_0xa9504b)+_0x6db7b5(0x11f),{'method':_0x6db7b5(0xf6),'redirect':'error','headers':{'Content-Type':_0x6db7b5(0x112),'Cookie':_0x440807['cookie'],'X-Invoke-Source':_0x6db7b5(0x10e)},'body':JSON[_0x6db7b5(0x110)]({'query':_0x5067fa,..._0x440807[_0x6db7b5(0x114)]!==undefined?{'topK':_0x440807[_0x6db7b5(0x114)]}:{}}),'signal':_0x12e217});}catch(_0x2bb589){if(_0x440807[_0x6db7b5(0xd0)]?.[_0x6db7b5(0xe4)])throw new DOMException(_0x6db7b5(0x11b),_0x6db7b5(0x118));if(_0x2bb589 instanceof Error&&_0x2bb589[_0x6db7b5(0xea)]===_0x6db7b5(0x10d))throw CliErrors[_0x6db7b5(0xe1)](_0x6db7b5(0x108));throw CliErrors[_0x6db7b5(0xe1)]('KB\x20Service\x20knowledge\x20search\x20request\x20failed.');}if(_0x44886d[_0x6db7b5(0xde)]===0x191)throw CliErrors[_0x6db7b5(0xd1)]();if(_0x44886d[_0x6db7b5(0xde)]===0x1ad)throw CliErrors[_0x6db7b5(0x104)](_0x6db7b5(0xfa));if(!_0x44886d['ok'])throw CliErrors[_0x6db7b5(0x104)](_0x6db7b5(0x11d)+_0x44886d[_0x6db7b5(0xde)]+').');if(!hasNoStore(_0x44886d['headers']))throw CliErrors['apiError']('KB\x20Service\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.');if(!(_0x44886d[_0x6db7b5(0xe9)]['get'](_0x6db7b5(0xfd))??'')['toLowerCase']()['includes']('application/json'))throw CliErrors['apiError'](_0x6db7b5(0x102));let _0x12475a;try{_0x12475a=await _0x44886d[_0x6db7b5(0xf3)]();}catch(_0x165323){if(_0x440807[_0x6db7b5(0xd0)]?.[_0x6db7b5(0xe4)])throw new DOMException(_0x6db7b5(0x11b),_0x6db7b5(0x118));if(_0x2c1262[_0x6db7b5(0xe4)]||_0x165323 instanceof Error&&_0x165323[_0x6db7b5(0xea)]===_0x6db7b5(0x10d))throw CliErrors[_0x6db7b5(0xe1)]('KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.');throw CliErrors[_0x6db7b5(0x104)](_0x6db7b5(0xd4));}try{const _0x490a83=requireExactRecord(_0x12475a,['hits',_0x6db7b5(0x106),_0x6db7b5(0x100)],_0x6db7b5(0xdc));if(!Array[_0x6db7b5(0xd5)](_0x490a83['hits']))throw invalidContract('hits');return parseDevelopmentSearchResponse({'schemaVersion':0x2,'profile':'development','total':_0x490a83['hits']['length'],'hits':_0x490a83['hits'],'strategyFingerprint':_0x490a83[_0x6db7b5(0x106)],'timingsMs':_0x490a83['timingsMs']},_0x440807[_0x6db7b5(0x114)]??0xa);}catch(_0x23896d){if(_0x23896d instanceof CliError)throw CliErrors['apiError'](_0x6db7b5(0x10f));throw _0x23896d;}}function validateTopK(_0x1d77fe){const _0x2595c0=a300_0x7e2592;if(_0x1d77fe!==undefined&&(!Number['isSafeInteger'](_0x1d77fe)||_0x1d77fe<0x1||_0x1d77fe>0x32))throw CliErrors['validation'](_0x2595c0(0xe6));}function hasNoStore(_0x47a7ad){const _0x5d556f=a300_0x7e2592;return(_0x47a7ad[_0x5d556f(0xff)](_0x5d556f(0xe2))??'')[_0x5d556f(0xe8)](',')['some'](_0x3fd289=>_0x3fd289['trim']()[_0x5d556f(0x119)]()===_0x5d556f(0x101));}function parseDevelopmentSearchResponse(_0x20ab9e,_0x38c4fd){const _0x435378=a300_0x7e2592,_0x3e88b0=requireExactRecord(_0x20ab9e,RESPONSE_KEYS,_0x435378(0xdc));if(_0x3e88b0[_0x435378(0x103)]!==0x2||_0x3e88b0['profile']!==_0x435378(0xe7))throw invalidContract('profile');if(!Array[_0x435378(0xd5)](_0x3e88b0['hits'])||_0x3e88b0['hits'][_0x435378(0xf4)]>(_0x38c4fd??0x32))throw invalidContract('hits');if(typeof _0x3e88b0['strategyFingerprint']!=='string'||!/^sha256:[0-9a-f]{64}$/[_0x435378(0xeb)](_0x3e88b0[_0x435378(0x106)]))throw invalidContract(_0x435378(0x106));const _0x3a426f=requireRecord(_0x3e88b0[_0x435378(0x100)],_0x435378(0x100)),_0x57cca5={};for(const [_0x4be520,_0x7ec717]of Object[_0x435378(0xda)](_0x3a426f)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x435378(0xeb)](_0x4be520)||typeof _0x7ec717!=='number'||!Number[_0x435378(0x115)](_0x7ec717)||_0x7ec717<0x0)throw invalidContract('timingsMs');_0x57cca5[_0x4be520]=_0x7ec717;}const _0xcb4e89=_0x3e88b0[_0x435378(0x109)][_0x435378(0xef)]((_0x383390,_0x3caf9a)=>parseHit(_0x383390,_0x3caf9a));if(!Number[_0x435378(0xfe)](_0x3e88b0['total'])||_0x3e88b0[_0x435378(0xf7)]!==_0xcb4e89['length'])throw invalidContract(_0x435378(0xf7));return{'schemaVersion':_0x3e88b0['schemaVersion'],'profile':_0x3e88b0['profile'],'total':_0x3e88b0['total'],'strategyFingerprint':_0x3e88b0['strategyFingerprint'],'timingsMs':_0x57cca5,'hits':_0xcb4e89};}function parseHit(_0x4db547,_0x17acb2){const _0xc96500=a300_0x7e2592,_0x3fdf27=requireExactRecord(_0x4db547,HIT_KEYS,_0xc96500(0xdf)+_0x17acb2+']'),_0x4a6e81=_0x315cc3=>{const _0x2f56f7=_0xc96500,_0x20530e=_0x3fdf27[_0x315cc3];if(typeof _0x20530e!==_0x2f56f7(0x11a)||!_0x20530e)throw invalidContract(_0x315cc3);return _0x20530e;};if(!Number[_0xc96500(0xfe)](_0x3fdf27[_0xc96500(0x107)])||_0x3fdf27[_0xc96500(0x107)]<0x1)throw invalidContract(_0xc96500(0x107));if(_0x3fdf27['scope']!=='public'&&_0x3fdf27['scope']!=='company')throw invalidContract(_0xc96500(0xf5));if(typeof _0x3fdf27['title']!=='string'||typeof _0x3fdf27['text']!==_0xc96500(0x11a))throw invalidContract(_0xc96500(0xcf));if(!Array[_0xc96500(0xd5)](_0x3fdf27[_0xc96500(0x11e)])||_0x3fdf27['tags'][_0xc96500(0xf0)](_0x527e6b=>typeof _0x527e6b!==_0xc96500(0x11a)))throw invalidContract(_0xc96500(0x11e));if(!Number['isSafeInteger'](_0x3fdf27[_0xc96500(0x10b)])||_0x3fdf27[_0xc96500(0x10b)]!==_0x17acb2+0x1)throw invalidContract(_0xc96500(0x10b));if(!isFiniteNumber(_0x3fdf27[_0xc96500(0xe5)])||!isFiniteNumber(_0x3fdf27[_0xc96500(0xed)]))throw invalidContract(_0xc96500(0xdb));return{'documentId':_0x4a6e81(_0xc96500(0xdd)),'revision':_0x3fdf27[_0xc96500(0x107)],'chunkId':_0x4a6e81(_0xc96500(0xd6)),'scope':_0x3fdf27[_0xc96500(0xf5)],'title':_0x3fdf27[_0xc96500(0xf2)],'text':_0x3fdf27[_0xc96500(0xcf)],'tags':[..._0x3fdf27[_0xc96500(0x11e)]],'rank':_0x3fdf27[_0xc96500(0x10b)],'rawScore':_0x3fdf27[_0xc96500(0xe5)],'finalScore':_0x3fdf27[_0xc96500(0xed)],'scoreKind':_0x4a6e81(_0xc96500(0xd8))};}function requireExactRecord(_0x146fde,_0x23fa2b,_0x50dda7){const _0x39b782=a300_0x7e2592,_0x382fde=requireRecord(_0x146fde,_0x50dda7),_0x6b71f4=Object['keys'](_0x382fde)[_0x39b782(0xf1)](),_0x590364=[..._0x23fa2b][_0x39b782(0xf1)]();if(_0x6b71f4['length']!==_0x590364[_0x39b782(0xf4)]||_0x6b71f4[_0x39b782(0xf0)]((_0x93e8c0,_0x3341ac)=>_0x93e8c0!==_0x590364[_0x3341ac]))throw invalidContract(_0x50dda7);return _0x382fde;}function requireRecord(_0x506b00,_0x8b457){const _0x376050=a300_0x7e2592;if(!_0x506b00||typeof _0x506b00!==_0x376050(0xce)||Array[_0x376050(0xd5)](_0x506b00))throw invalidContract(_0x8b457);return _0x506b00;}function isFiniteNumber(_0x4a6432){const _0x576457=a300_0x7e2592;return typeof _0x4a6432==='number'&&Number[_0x576457(0x115)](_0x4a6432);}function invalidContract(_0x1c7bd8){const _0x299ab6=a300_0x7e2592;return CliErrors['apiError'](_0x299ab6(0x117)+_0x1c7bd8+'\x20contract.');}
1
+ const a301_0x4283cc=a301_0x1997;function a301_0x497d(){const _0x4d24c5=['authRequired','some','signal','hostname','keys','aborted','KB\x20Service\x20knowledge\x20search\x20request\x20failed.','includes','documentId','status','text','tags','KB\x20Service\x20knowledge\x20search\x20was\x20rate\x20limited\x20(HTTP\x20429).','231544rZkkOG','trim','pathname','origin','rank','username','test','object','4NkRGyz','POST','cache-control','get','toLowerCase','topK','KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.','protocol','string','isSafeInteger','strategyFingerprint','isFinite','Knowledge\x20search\x20cancelled.','error','scope','hits[','hits','score','json','revision','1879455xnLUms','484836HoBcPe','any','headers','entries','chunkId','password','KB\x20Service\x20knowledge\x20search\x20returned\x20an\x20invalid\x20response\x20contract.','development','networkError','Invalid\x20--kb-service-url:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','content-type','28zUJwBy','search','2079eYPwFp','title','4796448ChMItw','cli:rabetbase','application/json','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','3470evdhWD','schemaVersion','3373155OHyjkh','/v2/development/apps/','Knowledge\x20search\x20query\x20is\x20required.','finalScore','AbortError','number','scoreKind','\x20contract.','apiError','KB\x20Service\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','stringify','total','hash','profile','KB\x20Service\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','no-store','TimeoutError','isArray','length','timingsMs','timeout','/knowledge/search','validation','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','591034eHxiCa','sort','rawScore'];a301_0x497d=function(){return _0x4d24c5;};return a301_0x497d();}(function(_0x1b7f2e,_0x525905){const _0x4c2bd5=a301_0x1997,_0xd93506=_0x1b7f2e();while(!![]){try{const _0x1df4a8=parseInt(_0x4c2bd5(0xd1))/0x1+-parseInt(_0x4c2bd5(0xe1))/0x2+-parseInt(_0x4c2bd5(0xb9))/0x3*(parseInt(_0x4c2bd5(0x8f))/0x4)+parseInt(_0x4c2bd5(0xa3))/0x5+parseInt(_0x4c2bd5(0xa4))/0x6*(parseInt(_0x4c2bd5(0xaf))/0x7)+parseInt(_0x4c2bd5(0xb3))/0x8+-parseInt(_0x4c2bd5(0xb1))/0x9*(parseInt(_0x4c2bd5(0xb7))/0xa);if(_0x1df4a8===_0x525905)break;else _0xd93506['push'](_0xd93506['shift']());}catch(_0x3f4fac){_0xd93506['push'](_0xd93506['shift']());}}}(a301_0x497d,0x8b02f));import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a301_0x4283cc(0xb8),a301_0x4283cc(0xc6),a301_0x4283cc(0xc4),a301_0x4283cc(0x9f),a301_0x4283cc(0x99),a301_0x4283cc(0xcc)],HIT_KEYS=['documentId',a301_0x4283cc(0xa2),a301_0x4283cc(0xa8),a301_0x4283cc(0x9d),a301_0x4283cc(0xb2),a301_0x4283cc(0xde),a301_0x4283cc(0xdf),'rank',a301_0x4283cc(0xd3),a301_0x4283cc(0xbc),a301_0x4283cc(0xbf)];export function normalizeKbServiceOrigin(_0xf44bd9){const _0x37061f=a301_0x4283cc,_0x2c7959=()=>CliErrors['validation'](_0x37061f(0xad)),_0x39c0e2=_0xf44bd9?.[_0x37061f(0xe2)]();if(!_0x39c0e2||/[\u0000-\u0020\u007f]/[_0x37061f(0x8d)](_0x39c0e2)||!/^https:\/\/[^/?#@\\]+\/?$/i['test'](_0x39c0e2))throw _0x2c7959();let _0xb66238;try{_0xb66238=new URL(_0x39c0e2);}catch{throw _0x2c7959();}if(_0xb66238[_0x37061f(0x96)]!=='https:'||!_0xb66238[_0x37061f(0xd7)]||_0xb66238[_0x37061f(0x8c)]||_0xb66238[_0x37061f(0xa9)]||_0xb66238[_0x37061f(0x89)]!=='/'||_0xb66238[_0x37061f(0xb0)]||_0xb66238[_0x37061f(0xc5)])throw _0x2c7959();return _0xb66238[_0x37061f(0x8a)];}export async function searchDirectKnowledge(_0x49429a){const _0x39a95f=a301_0x4283cc,_0x56dea0=_0x49429a['appCode']['trim'](),_0x53e863=_0x49429a['query'][_0x39a95f(0xe2)]();if(!_0x56dea0)throw CliErrors[_0x39a95f(0xcf)]('Knowledge\x20search\x20appCode\x20is\x20required.');if(!_0x49429a['cookie'][_0x39a95f(0xe2)]())throw CliErrors[_0x39a95f(0xd4)]();if(!_0x53e863)throw CliErrors['validation'](_0x39a95f(0xbb));validateTopK(_0x49429a[_0x39a95f(0x94)]);const _0xb6b20b=normalizeKbServiceOrigin(_0x49429a['serviceUrl']),_0x270522=AbortSignal[_0x39a95f(0xcd)](0xea60),_0x3f5bd9=_0x49429a['signal']?AbortSignal[_0x39a95f(0xa5)]([_0x49429a[_0x39a95f(0xd6)],_0x270522]):_0x270522;let _0x576032;try{_0x576032=await fetch(_0xb6b20b+_0x39a95f(0xba)+encodeURIComponent(_0x56dea0)+_0x39a95f(0xce),{'method':_0x39a95f(0x90),'redirect':_0x39a95f(0x9c),'headers':{'Content-Type':_0x39a95f(0xb5),'Cookie':_0x49429a['cookie'],'X-Invoke-Source':_0x39a95f(0xb4)},'body':JSON[_0x39a95f(0xc3)]({'query':_0x53e863,..._0x49429a[_0x39a95f(0x94)]!==undefined?{'topK':_0x49429a[_0x39a95f(0x94)]}:{}}),'signal':_0x3f5bd9});}catch(_0x2ff20e){if(_0x49429a[_0x39a95f(0xd6)]?.['aborted'])throw new DOMException('Knowledge\x20search\x20cancelled.','AbortError');if(_0x2ff20e instanceof Error&&_0x2ff20e['name']===_0x39a95f(0xc9))throw CliErrors['networkError'](_0x39a95f(0x95));throw CliErrors[_0x39a95f(0xac)](_0x39a95f(0xda));}if(_0x576032['status']===0x191)throw CliErrors[_0x39a95f(0xd4)]();if(_0x576032[_0x39a95f(0xdd)]===0x1ad)throw CliErrors[_0x39a95f(0xc1)](_0x39a95f(0xe0));if(!_0x576032['ok'])throw CliErrors[_0x39a95f(0xc1)]('KB\x20Service\x20knowledge\x20search\x20failed\x20(HTTP\x20'+_0x576032[_0x39a95f(0xdd)]+').');if(!hasNoStore(_0x576032['headers']))throw CliErrors[_0x39a95f(0xc1)]('KB\x20Service\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.');if(!(_0x576032[_0x39a95f(0xa6)][_0x39a95f(0x92)](_0x39a95f(0xae))??'')[_0x39a95f(0x93)]()[_0x39a95f(0xdb)]('application/json'))throw CliErrors['apiError'](_0x39a95f(0xc7));let _0x90a66;try{_0x90a66=await _0x576032[_0x39a95f(0xa1)]();}catch(_0x563525){if(_0x49429a[_0x39a95f(0xd6)]?.['aborted'])throw new DOMException(_0x39a95f(0x9b),_0x39a95f(0xbd));if(_0x270522[_0x39a95f(0xd9)]||_0x563525 instanceof Error&&_0x563525['name']===_0x39a95f(0xc9))throw CliErrors[_0x39a95f(0xac)]('KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.');throw CliErrors[_0x39a95f(0xc1)](_0x39a95f(0xc2));}try{const _0xca7319=requireExactRecord(_0x90a66,['hits',_0x39a95f(0x99),_0x39a95f(0xcc)],'response');if(!Array['isArray'](_0xca7319[_0x39a95f(0x9f)]))throw invalidContract(_0x39a95f(0x9f));return parseDevelopmentSearchResponse({'schemaVersion':0x2,'profile':'development','total':_0xca7319[_0x39a95f(0x9f)][_0x39a95f(0xcb)],'hits':_0xca7319['hits'],'strategyFingerprint':_0xca7319['strategyFingerprint'],'timingsMs':_0xca7319['timingsMs']},_0x49429a[_0x39a95f(0x94)]??0xa);}catch(_0x5cfbc1){if(_0x5cfbc1 instanceof CliError)throw CliErrors[_0x39a95f(0xc1)](_0x39a95f(0xaa));throw _0x5cfbc1;}}function validateTopK(_0xdbc001){const _0x2a77a6=a301_0x4283cc;if(_0xdbc001!==undefined&&(!Number['isSafeInteger'](_0xdbc001)||_0xdbc001<0x1||_0xdbc001>0x32))throw CliErrors[_0x2a77a6(0xcf)](_0x2a77a6(0xd0));}function hasNoStore(_0x3631a9){const _0x3baa27=a301_0x4283cc;return(_0x3631a9[_0x3baa27(0x92)](_0x3baa27(0x91))??'')['split'](',')[_0x3baa27(0xd5)](_0x5f4da7=>_0x5f4da7['trim']()[_0x3baa27(0x93)]()===_0x3baa27(0xc8));}function parseDevelopmentSearchResponse(_0xe82088,_0x154cd4){const _0x3f348b=a301_0x4283cc,_0x1143e8=requireExactRecord(_0xe82088,RESPONSE_KEYS,'response');if(_0x1143e8[_0x3f348b(0xb8)]!==0x2||_0x1143e8[_0x3f348b(0xc6)]!==_0x3f348b(0xab))throw invalidContract(_0x3f348b(0xc6));if(!Array[_0x3f348b(0xca)](_0x1143e8[_0x3f348b(0x9f)])||_0x1143e8[_0x3f348b(0x9f)][_0x3f348b(0xcb)]>(_0x154cd4??0x32))throw invalidContract(_0x3f348b(0x9f));if(typeof _0x1143e8[_0x3f348b(0x99)]!==_0x3f348b(0x97)||!/^sha256:[0-9a-f]{64}$/[_0x3f348b(0x8d)](_0x1143e8[_0x3f348b(0x99)]))throw invalidContract(_0x3f348b(0x99));const _0x4a061e=requireRecord(_0x1143e8[_0x3f348b(0xcc)],_0x3f348b(0xcc)),_0x1a18b4={};for(const [_0x510d17,_0x17c885]of Object[_0x3f348b(0xa7)](_0x4a061e)){if(!/^[A-Za-z][A-Za-z0-9]*$/['test'](_0x510d17)||typeof _0x17c885!==_0x3f348b(0xbe)||!Number[_0x3f348b(0x9a)](_0x17c885)||_0x17c885<0x0)throw invalidContract(_0x3f348b(0xcc));_0x1a18b4[_0x510d17]=_0x17c885;}const _0x2656a1=_0x1143e8['hits']['map']((_0x4990e5,_0x396901)=>parseHit(_0x4990e5,_0x396901));if(!Number[_0x3f348b(0x98)](_0x1143e8['total'])||_0x1143e8[_0x3f348b(0xc4)]!==_0x2656a1[_0x3f348b(0xcb)])throw invalidContract(_0x3f348b(0xc4));return{'schemaVersion':_0x1143e8[_0x3f348b(0xb8)],'profile':_0x1143e8[_0x3f348b(0xc6)],'total':_0x1143e8[_0x3f348b(0xc4)],'strategyFingerprint':_0x1143e8[_0x3f348b(0x99)],'timingsMs':_0x1a18b4,'hits':_0x2656a1};}function parseHit(_0x44a9b8,_0x3bf9e3){const _0x431b86=a301_0x4283cc,_0x2c3d14=requireExactRecord(_0x44a9b8,HIT_KEYS,_0x431b86(0x9e)+_0x3bf9e3+']'),_0x5768df=_0x522ffd=>{const _0x42c053=_0x431b86,_0xc1aa01=_0x2c3d14[_0x522ffd];if(typeof _0xc1aa01!==_0x42c053(0x97)||!_0xc1aa01)throw invalidContract(_0x522ffd);return _0xc1aa01;};if(!Number[_0x431b86(0x98)](_0x2c3d14[_0x431b86(0xa2)])||_0x2c3d14[_0x431b86(0xa2)]<0x1)throw invalidContract(_0x431b86(0xa2));if(_0x2c3d14[_0x431b86(0x9d)]!=='public'&&_0x2c3d14['scope']!=='company')throw invalidContract(_0x431b86(0x9d));if(typeof _0x2c3d14[_0x431b86(0xb2)]!=='string'||typeof _0x2c3d14['text']!==_0x431b86(0x97))throw invalidContract('text');if(!Array[_0x431b86(0xca)](_0x2c3d14[_0x431b86(0xdf)])||_0x2c3d14['tags']['some'](_0xfac8f7=>typeof _0xfac8f7!==_0x431b86(0x97)))throw invalidContract(_0x431b86(0xdf));if(!Number[_0x431b86(0x98)](_0x2c3d14['rank'])||_0x2c3d14['rank']!==_0x3bf9e3+0x1)throw invalidContract(_0x431b86(0x8b));if(!isFiniteNumber(_0x2c3d14[_0x431b86(0xd3)])||!isFiniteNumber(_0x2c3d14[_0x431b86(0xbc)]))throw invalidContract(_0x431b86(0xa0));return{'documentId':_0x5768df(_0x431b86(0xdc)),'revision':_0x2c3d14[_0x431b86(0xa2)],'chunkId':_0x5768df(_0x431b86(0xa8)),'scope':_0x2c3d14[_0x431b86(0x9d)],'title':_0x2c3d14[_0x431b86(0xb2)],'text':_0x2c3d14['text'],'tags':[..._0x2c3d14[_0x431b86(0xdf)]],'rank':_0x2c3d14[_0x431b86(0x8b)],'rawScore':_0x2c3d14[_0x431b86(0xd3)],'finalScore':_0x2c3d14[_0x431b86(0xbc)],'scoreKind':_0x5768df(_0x431b86(0xbf))};}function a301_0x1997(_0x2e76e8,_0x3f4f26){_0x2e76e8=_0x2e76e8-0x89;const _0x497d31=a301_0x497d();let _0x1997d6=_0x497d31[_0x2e76e8];return _0x1997d6;}function requireExactRecord(_0x58ac3a,_0x15ef70,_0x559cb8){const _0x4bb7d8=a301_0x4283cc,_0x384f73=requireRecord(_0x58ac3a,_0x559cb8),_0x485640=Object[_0x4bb7d8(0xd8)](_0x384f73)[_0x4bb7d8(0xd2)](),_0x408bad=[..._0x15ef70][_0x4bb7d8(0xd2)]();if(_0x485640[_0x4bb7d8(0xcb)]!==_0x408bad[_0x4bb7d8(0xcb)]||_0x485640[_0x4bb7d8(0xd5)]((_0x5b94fd,_0x3e3146)=>_0x5b94fd!==_0x408bad[_0x3e3146]))throw invalidContract(_0x559cb8);return _0x384f73;}function requireRecord(_0x1962cf,_0x1a898b){const _0x20ed70=a301_0x4283cc;if(!_0x1962cf||typeof _0x1962cf!==_0x20ed70(0x8e)||Array[_0x20ed70(0xca)](_0x1962cf))throw invalidContract(_0x1a898b);return _0x1962cf;}function isFiniteNumber(_0xcbfa7f){const _0xc5e34c=a301_0x4283cc;return typeof _0xcbfa7f===_0xc5e34c(0xbe)&&Number['isFinite'](_0xcbfa7f);}function invalidContract(_0x1e93d9){const _0x37e943=a301_0x4283cc;return CliErrors['apiError'](_0x37e943(0xb6)+_0x1e93d9+_0x37e943(0xc0));}
@@ -1 +1 @@
1
- const a301_0x2bf3cb=a301_0x7980;(function(_0x27ccc4,_0x36a604){const _0x4e02f8=a301_0x7980,_0xbf64b8=_0x27ccc4();while(!![]){try{const _0x440277=parseInt(_0x4e02f8(0x19e))/0x1+-parseInt(_0x4e02f8(0x1ad))/0x2+parseInt(_0x4e02f8(0x1a5))/0x3+-parseInt(_0x4e02f8(0x1a4))/0x4+parseInt(_0x4e02f8(0x1ac))/0x5+-parseInt(_0x4e02f8(0x1a9))/0x6+-parseInt(_0x4e02f8(0x19b))/0x7;if(_0x440277===_0x36a604)break;else _0xbf64b8['push'](_0xbf64b8['shift']());}catch(_0x4f03b6){_0xbf64b8['push'](_0xbf64b8['shift']());}}}(a301_0x373a,0xc24e3));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';function a301_0x373a(){const _0x4768ef=['appPagesDir','isDirectory','Page\x20directory\x20not\x20found:\x20','.json','3740436ylxflx','.rabetbase','page-dir','1373522JfKtnm','trim','split','cwd','join','toUpperCase','4127128WOgsCY','4218717LVfsCD','flagMissing','F_OK','localeCompare','3634392xrtYeI','utf8','validation','5631095kbihEq','1876486XVTwrm','name'];a301_0x373a=function(){return _0x4768ef;};return a301_0x373a();}export function loadPageProjectConfig(_0x4f2d03,_0x24d5ea=process[a301_0x2bf3cb(0x1a1)]()){const _0x52fe76=a301_0x2bf3cb,_0x367e8c=resolve(_0x24d5ea),_0x7a3835=join(_0x367e8c,_0x52fe76(0x19c),'page');return{'projectRoot':_0x367e8c,'pagesBaseDir':_0x7a3835,'appPagesDir':join(_0x7a3835,_0x4f2d03),'lockFilePath':join(_0x367e8c,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0x1c0c8e,_0x3acfdf){const _0x3223b=a301_0x2bf3cb;return _0x1c0c8e+'-'+_0x3acfdf[_0x3223b(0x1a3)]()+_0x3223b(0x19a);}export function resolvePageFilePath(_0x53748a,_0x4a287b,_0x26cfbf){const _0x5b6a76=a301_0x2bf3cb;return join(_0x53748a[_0x5b6a76(0x1af)],buildPageFileName(_0x4a287b,_0x26cfbf));}export async function ensureParentDirectory(_0x13d6c1){await mkdir(dirname(_0x13d6c1),{'recursive':!![]});}export async function fileExists(_0x4782e5){const _0x1dd335=a301_0x2bf3cb;try{return await access(_0x4782e5,constants[_0x1dd335(0x1a7)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x56e6cc){const _0x555670=a301_0x2bf3cb,_0x5eced5=_0x56e6cc[_0x555670(0x19f)]();if(!_0x5eced5)throw CliErrors[_0x555670(0x1a6)](_0x555670(0x19d));const _0x435a41=resolve(_0x5eced5);let _0x1daee4;try{_0x1daee4=await lstat(_0x435a41);}catch{throw CliErrors[_0x555670(0x1ab)](_0x555670(0x199)+_0x5eced5);}if(!_0x1daee4[_0x555670(0x198)]())throw CliErrors[_0x555670(0x1ab)]('Page\x20directory\x20is\x20not\x20a\x20directory:\x20'+_0x5eced5);const _0x4ebdab={};return await readDirectory(_0x435a41,_0x435a41,_0x4ebdab),_0x4ebdab;}function a301_0x7980(_0x5e938c,_0x580d24){_0x5e938c=_0x5e938c-0x198;const _0x373af2=a301_0x373a();let _0x79805=_0x373af2[_0x5e938c];return _0x79805;}async function readDirectory(_0xb004cb,_0x1793e9,_0x497360){const _0x266762=a301_0x2bf3cb,_0x381555=await readdir(_0x1793e9,{'withFileTypes':!![]});for(const _0x55b049 of _0x381555['sort']((_0x4850f0,_0x5a3c85)=>_0x4850f0[_0x266762(0x1ae)][_0x266762(0x1a8)](_0x5a3c85['name']))){const _0x5578ac=join(_0x1793e9,_0x55b049['name']);if(_0x55b049['isDirectory']()){await readDirectory(_0xb004cb,_0x5578ac,_0x497360);continue;}if(!_0x55b049['isFile']())throw CliErrors[_0x266762(0x1ab)]('Unsupported\x20file\x20in\x20page\x20directory:\x20'+_0x5578ac);_0x497360[relative(_0xb004cb,_0x5578ac)[_0x266762(0x1a0)](sep)[_0x266762(0x1a2)]('/')]=await readFile(_0x5578ac,_0x266762(0x1aa));}}
1
+ const a302_0x3ff2ec=a302_0xf163;function a302_0x2b42(){const _0x250543=['localeCompare','flagMissing','utf8','2259066apdDzs','2298VdoZEr','validation','page-dir','.rabetbase','toUpperCase','appPagesDir','isDirectory','name','page.lock.json','split','3070193BBjdRX','1058xmnszw','isFile','F_OK','join','394329EWJFuY','1351600fuBsaB','1523364awQjqL','87111XfFgQT','.json','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','cwd','368wKFXpP'];a302_0x2b42=function(){return _0x250543;};return a302_0x2b42();}(function(_0x21d154,_0x3e4fd4){const _0x22bde5=a302_0xf163,_0x3eda9a=_0x21d154();while(!![]){try{const _0xb2b1c9=parseInt(_0x22bde5(0xd0))/0x1+parseInt(_0x22bde5(0xcc))/0x2*(-parseInt(_0x22bde5(0xc1))/0x3)+-parseInt(_0x22bde5(0xb7))/0x4+parseInt(_0x22bde5(0xb6))/0x5+parseInt(_0x22bde5(0xc0))/0x6+parseInt(_0x22bde5(0xcb))/0x7+parseInt(_0x22bde5(0xbc))/0x8*(-parseInt(_0x22bde5(0xb8))/0x9);if(_0xb2b1c9===_0x3e4fd4)break;else _0x3eda9a['push'](_0x3eda9a['shift']());}catch(_0x44a3b0){_0x3eda9a['push'](_0x3eda9a['shift']());}}}(a302_0x2b42,0x3ca96));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x106046,_0x1dc683=process[a302_0x3ff2ec(0xbb)]()){const _0x4e2352=a302_0x3ff2ec,_0x1b0dcc=resolve(_0x1dc683),_0x2fb1ec=join(_0x1b0dcc,_0x4e2352(0xc4),'page');return{'projectRoot':_0x1b0dcc,'pagesBaseDir':_0x2fb1ec,'appPagesDir':join(_0x2fb1ec,_0x106046),'lockFilePath':join(_0x1b0dcc,'.rabetbase',_0x4e2352(0xc9))};}function a302_0xf163(_0x16a35e,_0x1d98f2){_0x16a35e=_0x16a35e-0xb6;const _0x2b42ae=a302_0x2b42();let _0xf16335=_0x2b42ae[_0x16a35e];return _0xf16335;}export function buildPageFileName(_0x39f730,_0x2a18e2){const _0x2751da=a302_0x3ff2ec;return _0x39f730+'-'+_0x2a18e2[_0x2751da(0xc5)]()+_0x2751da(0xb9);}export function resolvePageFilePath(_0x3bebdf,_0x5dcb90,_0x646966){const _0x53bbf8=a302_0x3ff2ec;return join(_0x3bebdf[_0x53bbf8(0xc6)],buildPageFileName(_0x5dcb90,_0x646966));}export async function ensureParentDirectory(_0x2f8f2a){await mkdir(dirname(_0x2f8f2a),{'recursive':!![]});}export async function fileExists(_0x4b115f){const _0x1a0cd5=a302_0x3ff2ec;try{return await access(_0x4b115f,constants[_0x1a0cd5(0xce)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x3bcd79){const _0x4181e4=a302_0x3ff2ec,_0x48dae7=_0x3bcd79['trim']();if(!_0x48dae7)throw CliErrors[_0x4181e4(0xbe)](_0x4181e4(0xc3));const _0x24a872=resolve(_0x48dae7);let _0x45e587;try{_0x45e587=await lstat(_0x24a872);}catch{throw CliErrors[_0x4181e4(0xc2)]('Page\x20directory\x20not\x20found:\x20'+_0x48dae7);}if(!_0x45e587[_0x4181e4(0xc7)]())throw CliErrors[_0x4181e4(0xc2)](_0x4181e4(0xba)+_0x48dae7);const _0x19f2d1={};return await readDirectory(_0x24a872,_0x24a872,_0x19f2d1),_0x19f2d1;}async function readDirectory(_0x472fee,_0xb10bea,_0x2ce394){const _0x4eb548=a302_0x3ff2ec,_0x20af1b=await readdir(_0xb10bea,{'withFileTypes':!![]});for(const _0x130216 of _0x20af1b['sort']((_0x3d5bc4,_0x11c170)=>_0x3d5bc4['name'][_0x4eb548(0xbd)](_0x11c170['name']))){const _0xb34757=join(_0xb10bea,_0x130216[_0x4eb548(0xc8)]);if(_0x130216[_0x4eb548(0xc7)]()){await readDirectory(_0x472fee,_0xb34757,_0x2ce394);continue;}if(!_0x130216[_0x4eb548(0xcd)]())throw CliErrors[_0x4eb548(0xc2)]('Unsupported\x20file\x20in\x20page\x20directory:\x20'+_0xb34757);_0x2ce394[relative(_0x472fee,_0xb34757)[_0x4eb548(0xca)](sep)[_0x4eb548(0xcf)]('/')]=await readFile(_0xb34757,_0x4eb548(0xbf));}}
@@ -1 +1 @@
1
- function a302_0x5938(){const _0x20039a=['621NFSWew','4BsHdCw','590aQSDVC','126CUXmdY','md5','12HxPLCF','digest','33271LjsxPg','3473885bZqvrG','3ibUNba','852726RaABtt','4045888nYiifE','hex','3236486nectok','1708652DQjtIz','createHash'];a302_0x5938=function(){return _0x20039a;};return a302_0x5938();}(function(_0x4c0d10,_0x2eae55){const _0x5e1c54=a302_0x4a28,_0x36ee9c=_0x4c0d10();while(!![]){try{const _0x4b903=parseInt(_0x5e1c54(0x114))/0x1+parseInt(_0x5e1c54(0x118))/0x2*(-parseInt(_0x5e1c54(0x113))/0x3)+-parseInt(_0x5e1c54(0x11b))/0x4*(-parseInt(_0x5e1c54(0x112))/0x5)+parseInt(_0x5e1c54(0x10d))/0x6*(parseInt(_0x5e1c54(0x111))/0x7)+-parseInt(_0x5e1c54(0x115))/0x8+-parseInt(_0x5e1c54(0x11a))/0x9*(parseInt(_0x5e1c54(0x11c))/0xa)+-parseInt(_0x5e1c54(0x117))/0xb*(-parseInt(_0x5e1c54(0x10f))/0xc);if(_0x4b903===_0x2eae55)break;else _0x36ee9c['push'](_0x36ee9c['shift']());}catch(_0x5ea7ee){_0x36ee9c['push'](_0x36ee9c['shift']());}}}(a302_0x5938,0x8cf81));function a302_0x4a28(_0x59c3ba,_0x4d34d6){_0x59c3ba=_0x59c3ba-0x10d;const _0x59386e=a302_0x5938();let _0x4a286c=_0x59386e[_0x59c3ba];return _0x4a286c;}import a302_0xb55ffc from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x45576a){return JSON['stringify'](JSON['parse'](_0x45576a),null,0x2)+'\x0a';}export function computePageContentHash(_0x3e97bb){const _0x371858=a302_0x4a28;return a302_0xb55ffc[_0x371858(0x119)](_0x371858(0x10e))['update'](_0x3e97bb)[_0x371858(0x110)](_0x371858(0x116));}export function computeSerializedSchemaHash(_0x21eb33){return computePageContentHash(serializePageSchemaForFile(_0x21eb33));}export async function computePageFileHash(_0x378166){const _0x31dd1e=await readFile(_0x378166,'utf8');return computePageContentHash(_0x31dd1e);}
1
+ (function(_0x4abe96,_0x19d6c6){const _0xb7ec84=a303_0x1d71,_0x12c01b=_0x4abe96();while(!![]){try{const _0x3a663d=-parseInt(_0xb7ec84(0x8d))/0x1*(-parseInt(_0xb7ec84(0x86))/0x2)+parseInt(_0xb7ec84(0x8a))/0x3+-parseInt(_0xb7ec84(0x87))/0x4*(parseInt(_0xb7ec84(0x91))/0x5)+parseInt(_0xb7ec84(0x8f))/0x6+-parseInt(_0xb7ec84(0x8b))/0x7+-parseInt(_0xb7ec84(0x93))/0x8+parseInt(_0xb7ec84(0x90))/0x9;if(_0x3a663d===_0x19d6c6)break;else _0x12c01b['push'](_0x12c01b['shift']());}catch(_0x54082d){_0x12c01b['push'](_0x12c01b['shift']());}}}(a303_0x551f,0xcd30e));import a303_0x3b723b from'node:crypto';function a303_0x1d71(_0x3567a1,_0x5a7a4f){_0x3567a1=_0x3567a1-0x86;const _0x551fa6=a303_0x551f();let _0x1d7139=_0x551fa6[_0x3567a1];return _0x1d7139;}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x1283d7){const _0x13d1fb=a303_0x1d71;return JSON[_0x13d1fb(0x8e)](JSON['parse'](_0x1283d7),null,0x2)+'\x0a';}export function computePageContentHash(_0x138351){const _0x268bf8=a303_0x1d71;return a303_0x3b723b['createHash'](_0x268bf8(0x88))[_0x268bf8(0x92)](_0x138351)[_0x268bf8(0x89)]('hex');}export function computeSerializedSchemaHash(_0x57c7e3){return computePageContentHash(serializePageSchemaForFile(_0x57c7e3));}function a303_0x551f(){const _0x3e1c0e=['48999LWxNDl','stringify','6009084XzrMYa','11207655lMRXip','4958495QIECDs','update','13268248teLLwr','26ilSYBD','4vULAPU','md5','digest','3549663DzUDxa','4034275UJNInA','utf8'];a303_0x551f=function(){return _0x3e1c0e;};return a303_0x551f();}export async function computePageFileHash(_0x5480df){const _0xc5a853=a303_0x1d71,_0x2d766d=await readFile(_0x5480df,_0xc5a853(0x8c));return computePageContentHash(_0x2d766d);}