@treasuredata/tdx 2026.3.29 → 2026.3.31

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 (268) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.d.ts.map +1 -1
  5. package/dist/cli-categories.js +1 -1
  6. package/dist/cli-categories.js.map +1 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/activations.js +1 -1
  11. package/dist/commands/agent-command.js +1 -1
  12. package/dist/commands/agent-test-command.js +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/api-command.js.map +1 -1
  15. package/dist/commands/auth-command.js +1 -1
  16. package/dist/commands/auth-login-command.js +1 -1
  17. package/dist/commands/cas-command.d.ts +55 -0
  18. package/dist/commands/cas-command.d.ts.map +1 -0
  19. package/dist/commands/cas-command.js +1 -0
  20. package/dist/commands/cas-command.js.map +1 -0
  21. package/dist/commands/cas-segment-command.d.ts +18 -0
  22. package/dist/commands/cas-segment-command.d.ts.map +1 -0
  23. package/dist/commands/cas-segment-command.js +1 -0
  24. package/dist/commands/cas-segment-command.js.map +1 -0
  25. package/dist/commands/chat-command.js +1 -1
  26. package/dist/commands/claude-command.js +1 -1
  27. package/dist/commands/claude-statusline-command.js +1 -1
  28. package/dist/commands/claude-usage-command.js +1 -1
  29. package/dist/commands/command.js +1 -1
  30. package/dist/commands/connection-command.js +1 -1
  31. package/dist/commands/databases.js +1 -1
  32. package/dist/commands/delivery-command.js +1 -1
  33. package/dist/commands/describe.js +1 -1
  34. package/dist/commands/engage-campaign-pull-command.js +1 -1
  35. package/dist/commands/engage-campaign-push-command.js +1 -1
  36. package/dist/commands/engage-campaign-validate-command.js +1 -1
  37. package/dist/commands/engage-command.js +1 -1
  38. package/dist/commands/engage-template-pull-command.js +1 -1
  39. package/dist/commands/engage-template-push-command.js +1 -1
  40. package/dist/commands/engage-template-validate-command.js +1 -1
  41. package/dist/commands/job-command.js +1 -1
  42. package/dist/commands/journey-command.js +1 -1
  43. package/dist/commands/journey-validate-command.js +1 -1
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/mcp-command.js +1 -1
  46. package/dist/commands/parent-segment-command.js +1 -1
  47. package/dist/commands/policy-command.js +1 -1
  48. package/dist/commands/profile-command.js +1 -1
  49. package/dist/commands/profiles-command.js +1 -1
  50. package/dist/commands/query-command.js +1 -1
  51. package/dist/commands/schedule-command.js +1 -1
  52. package/dist/commands/segment-command.js +1 -1
  53. package/dist/commands/segment-create-command.js +1 -1
  54. package/dist/commands/segment-fields-command.js +1 -1
  55. package/dist/commands/segment-pull-command.js +1 -1
  56. package/dist/commands/segment-push-command.js +1 -1
  57. package/dist/commands/segment-update-command.js +1 -1
  58. package/dist/commands/segment-use-command.js +1 -1
  59. package/dist/commands/segment-validate-command.js +1 -1
  60. package/dist/commands/segments.js +1 -1
  61. package/dist/commands/show.js +1 -1
  62. package/dist/commands/status-command.js +1 -1
  63. package/dist/commands/tables.js +1 -1
  64. package/dist/commands/unset-command.d.ts.map +1 -1
  65. package/dist/commands/unset-command.js +1 -1
  66. package/dist/commands/unset-command.js.map +1 -1
  67. package/dist/commands/upgrade-command.js +1 -1
  68. package/dist/commands/use-command.d.ts.map +1 -1
  69. package/dist/commands/use-command.js +1 -1
  70. package/dist/commands/use-command.js.map +1 -1
  71. package/dist/commands/user-command.js +1 -1
  72. package/dist/commands/workflow-command.js +1 -1
  73. package/dist/core/auth.js +1 -1
  74. package/dist/core/command-output.js +1 -1
  75. package/dist/core/config.js +1 -1
  76. package/dist/core/connection-cache.js +1 -1
  77. package/dist/core/constants.js +1 -1
  78. package/dist/core/credential-cache.js +1 -1
  79. package/dist/core/global-context.d.ts +1 -0
  80. package/dist/core/global-context.d.ts.map +1 -1
  81. package/dist/core/global-context.js +1 -1
  82. package/dist/core/global-context.js.map +1 -1
  83. package/dist/core/keychain.js +1 -1
  84. package/dist/core/oauth-keychain.js +1 -1
  85. package/dist/core/oauth.js +1 -1
  86. package/dist/core/profile.js +1 -1
  87. package/dist/core/project-config.js +1 -1
  88. package/dist/core/session.d.ts +2 -1
  89. package/dist/core/session.d.ts.map +1 -1
  90. package/dist/core/session.js +1 -1
  91. package/dist/core/session.js.map +1 -1
  92. package/dist/core/user-cache.js +1 -1
  93. package/dist/core/version.js +1 -1
  94. package/dist/index.js +1 -1
  95. package/dist/mcp/server.js +1 -1
  96. package/dist/mcp/tools/index.js +1 -1
  97. package/dist/mcp/tools/tdx-run.js +1 -1
  98. package/dist/mcp/tools/tdx-search.js +1 -1
  99. package/dist/mcp/utils.js +1 -1
  100. package/dist/proxy/claude-usage-tracker.js +1 -1
  101. package/dist/proxy/passthrough-server.js +1 -1
  102. package/dist/proxy/sse-usage-parser.js +1 -1
  103. package/dist/sdk/agent/agent-config.js +1 -1
  104. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  105. package/dist/sdk/agent/agent-yaml.js +1 -1
  106. package/dist/sdk/agent/test/evaluator.js +1 -1
  107. package/dist/sdk/agent/test/executor.js +1 -1
  108. package/dist/sdk/agent/test/index.js +1 -1
  109. package/dist/sdk/agent/test/output.js +1 -1
  110. package/dist/sdk/agent/test/parser.js +1 -1
  111. package/dist/sdk/agent/tool-target-registry.js +1 -1
  112. package/dist/sdk/api.js +1 -1
  113. package/dist/sdk/cas/cas-api-client.d.ts +77 -0
  114. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -0
  115. package/dist/sdk/cas/cas-api-client.js +1 -0
  116. package/dist/sdk/cas/cas-api-client.js.map +1 -0
  117. package/dist/sdk/cas/cas-audience-yaml.d.ts +32 -0
  118. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -0
  119. package/dist/sdk/cas/cas-audience-yaml.js +1 -0
  120. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -0
  121. package/dist/sdk/cas/cas-segment-yaml.d.ts +38 -0
  122. package/dist/sdk/cas/cas-segment-yaml.d.ts.map +1 -0
  123. package/dist/sdk/cas/cas-segment-yaml.js +1 -0
  124. package/dist/sdk/cas/cas-segment-yaml.js.map +1 -0
  125. package/dist/sdk/cas/index.d.ts +61 -0
  126. package/dist/sdk/cas/index.d.ts.map +1 -0
  127. package/dist/sdk/cas/index.js +1 -0
  128. package/dist/sdk/cas/index.js.map +1 -0
  129. package/dist/sdk/cas/pull-workflow.d.ts +53 -0
  130. package/dist/sdk/cas/pull-workflow.d.ts.map +1 -0
  131. package/dist/sdk/cas/pull-workflow.js +1 -0
  132. package/dist/sdk/cas/pull-workflow.js.map +1 -0
  133. package/dist/sdk/cas/push-workflow.d.ts +50 -0
  134. package/dist/sdk/cas/push-workflow.d.ts.map +1 -0
  135. package/dist/sdk/cas/push-workflow.js +1 -0
  136. package/dist/sdk/cas/push-workflow.js.map +1 -0
  137. package/dist/sdk/cas/types.d.ts +115 -0
  138. package/dist/sdk/cas/types.d.ts.map +1 -0
  139. package/dist/sdk/cas/types.js +1 -0
  140. package/dist/sdk/cas/types.js.map +1 -0
  141. package/dist/sdk/client/cdp-api-client.js +1 -1
  142. package/dist/sdk/client/delivery-api-client.js +1 -1
  143. package/dist/sdk/client/endpoints.d.ts +4 -0
  144. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  145. package/dist/sdk/client/endpoints.js +1 -1
  146. package/dist/sdk/client/endpoints.js.map +1 -1
  147. package/dist/sdk/client/engage-api-client.js +1 -1
  148. package/dist/sdk/client/http-client.js +1 -1
  149. package/dist/sdk/client/llm-api-client.js +1 -1
  150. package/dist/sdk/client/oauth-refresh.js +1 -1
  151. package/dist/sdk/client/rate-limiter.js +1 -1
  152. package/dist/sdk/client/td-api-client.js +1 -1
  153. package/dist/sdk/client/trino-api-client.js +1 -1
  154. package/dist/sdk/client/workflow-client.js +1 -1
  155. package/dist/sdk/connection-validator.js +1 -1
  156. package/dist/sdk/connection.js +1 -1
  157. package/dist/sdk/delivery.js +1 -1
  158. package/dist/sdk/engage/campaign-pull.js +1 -1
  159. package/dist/sdk/engage/campaign-push.js +1 -1
  160. package/dist/sdk/engage/campaign-validator.js +1 -1
  161. package/dist/sdk/engage/campaign-yaml.js +1 -1
  162. package/dist/sdk/engage/template-pull.js +1 -1
  163. package/dist/sdk/engage/template-push.js +1 -1
  164. package/dist/sdk/engage/template-validator.js +1 -1
  165. package/dist/sdk/engage/template-yaml.js +1 -1
  166. package/dist/sdk/engage/types/campaign-def.js +1 -1
  167. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  168. package/dist/sdk/engage/types/template-schema.js +1 -1
  169. package/dist/sdk/engage.js +1 -1
  170. package/dist/sdk/errors.js +1 -1
  171. package/dist/sdk/index.d.ts +6 -0
  172. package/dist/sdk/index.d.ts.map +1 -1
  173. package/dist/sdk/index.js +1 -1
  174. package/dist/sdk/index.js.map +1 -1
  175. package/dist/sdk/io/index.js +1 -1
  176. package/dist/sdk/io/node-filesystem.js +1 -1
  177. package/dist/sdk/job.js +1 -1
  178. package/dist/sdk/journey.js +1 -1
  179. package/dist/sdk/llm/chat-cache.js +1 -1
  180. package/dist/sdk/llm/index.js +1 -1
  181. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  182. package/dist/sdk/llm/model-factors.js +1 -1
  183. package/dist/sdk/personalization.js +1 -1
  184. package/dist/sdk/policy.js +1 -1
  185. package/dist/sdk/query/index.js +1 -1
  186. package/dist/sdk/query/sql-parser.js +1 -1
  187. package/dist/sdk/realtime.js +1 -1
  188. package/dist/sdk/schedule.js +1 -1
  189. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  190. package/dist/sdk/segment/fields-display.js +1 -1
  191. package/dist/sdk/segment/file-discovery.js +1 -1
  192. package/dist/sdk/segment/journey-utils.js +1 -1
  193. package/dist/sdk/segment/journey-validator.js +1 -1
  194. package/dist/sdk/segment/journey-yaml.js +1 -1
  195. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  196. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  197. package/dist/sdk/segment/pull-workflow.js +1 -1
  198. package/dist/sdk/segment/push-recovery.js +1 -1
  199. package/dist/sdk/segment/push-workflow.js +1 -1
  200. package/dist/sdk/segment/resolution-context.js +1 -1
  201. package/dist/sdk/segment/segment-path-parser.js +1 -1
  202. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  203. package/dist/sdk/segment/segment-validator.js +1 -1
  204. package/dist/sdk/segment/target-resolution.js +1 -1
  205. package/dist/sdk/segment/tdx-config.js +1 -1
  206. package/dist/sdk/segment/types/activation-schema.js +1 -1
  207. package/dist/sdk/segment/types/journey-def.js +1 -1
  208. package/dist/sdk/segment/types/journey-schema.js +1 -1
  209. package/dist/sdk/segment/types/segment-def.js +1 -1
  210. package/dist/sdk/segment/types/segment-schema.js +1 -1
  211. package/dist/sdk/segment/validate-files.js +1 -1
  212. package/dist/sdk/segment/yaml-validator.js +1 -1
  213. package/dist/sdk/segment.js +1 -1
  214. package/dist/sdk/types/cas.d.ts +242 -0
  215. package/dist/sdk/types/cas.d.ts.map +1 -0
  216. package/dist/sdk/types/cas.js +1 -0
  217. package/dist/sdk/types/cas.js.map +1 -0
  218. package/dist/sdk/types/index.d.ts +3 -1
  219. package/dist/sdk/types/index.d.ts.map +1 -1
  220. package/dist/sdk/types/index.js +1 -1
  221. package/dist/sdk/types/index.js.map +1 -1
  222. package/dist/sdk/types/progress.js +1 -1
  223. package/dist/sdk/user.js +1 -1
  224. package/dist/sdk/util/format-detector.js +1 -1
  225. package/dist/sdk/util/formatters.js +1 -1
  226. package/dist/sdk/util/index.js +1 -1
  227. package/dist/sdk/util/paginate.js +1 -1
  228. package/dist/sdk/util/tree-formatter.js +1 -1
  229. package/dist/sdk/workflow/archive-validation.js +1 -1
  230. package/dist/sdk/workflow/clone-workflow.js +1 -1
  231. package/dist/sdk/workflow/index.js +1 -1
  232. package/dist/sdk/workflow/pull-workflow.js +1 -1
  233. package/dist/sdk/workflow/push-workflow.js +1 -1
  234. package/dist/sdk/workflow/tdx-config.js +1 -1
  235. package/dist/sdk/workflow/workflow-utils.js +1 -1
  236. package/dist/test-utils/command-runner.js +1 -1
  237. package/dist/test-utils/factories.js +1 -1
  238. package/dist/test-utils/fixtures.js +1 -1
  239. package/dist/test-utils/http-mock.js +1 -1
  240. package/dist/test-utils/index.js +1 -1
  241. package/dist/utils/async.js +1 -1
  242. package/dist/utils/colors.js +1 -1
  243. package/dist/utils/diff.js +1 -1
  244. package/dist/utils/file-permissions.js +1 -1
  245. package/dist/utils/file-reader.js +1 -1
  246. package/dist/utils/github-releases.js +1 -1
  247. package/dist/utils/global-cache.js +1 -1
  248. package/dist/utils/json-loader.js +1 -1
  249. package/dist/utils/local-cache.js +1 -1
  250. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  251. package/dist/utils/logger/formatters/index.js +1 -1
  252. package/dist/utils/logger/handlers/console-handler.js +1 -1
  253. package/dist/utils/logger/handlers/file-handler.js +1 -1
  254. package/dist/utils/logger/handlers/index.js +1 -1
  255. package/dist/utils/logger/handlers/null-handler.js +1 -1
  256. package/dist/utils/logger/index.js +1 -1
  257. package/dist/utils/logger/logger.js +1 -1
  258. package/dist/utils/logger/types.js +1 -1
  259. package/dist/utils/option-validation.js +1 -1
  260. package/dist/utils/process.js +1 -1
  261. package/dist/utils/prompt.js +1 -1
  262. package/dist/utils/spinner.js +1 -1
  263. package/dist/utils/sse-parser.js +1 -1
  264. package/dist/utils/string-utils.js +1 -1
  265. package/dist/utils/table-ref-parser.js +1 -1
  266. package/dist/utils/tdx-logger.js +1 -1
  267. package/dist/utils/version-check.js +1 -1
  268. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x46cedc,_0xdf82ed){const _0x94e07c=a136_0x37d7,_0x73d15c=_0x46cedc();while(!![]){try{const _0x550817=-parseInt(_0x94e07c(0x11d))/0x1+parseInt(_0x94e07c(0x16e))/0x2*(parseInt(_0x94e07c(0xd8))/0x3)+parseInt(_0x94e07c(0xd9))/0x4*(-parseInt(_0x94e07c(0x12e))/0x5)+parseInt(_0x94e07c(0x11f))/0x6+-parseInt(_0x94e07c(0x106))/0x7+-parseInt(_0x94e07c(0x135))/0x8*(-parseInt(_0x94e07c(0x148))/0x9)+parseInt(_0x94e07c(0xd7))/0xa;if(_0x550817===_0xdf82ed)break;else _0x73d15c['push'](_0x73d15c['shift']());}catch(_0x37d459){_0x73d15c['push'](_0x73d15c['shift']());}}}(a136_0xe277,0xe312e));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';function a136_0x37d7(_0x35d306,_0x507d6d){_0x35d306=_0x35d306-0xcb;const _0xe277f=a136_0xe277();let _0x37d707=_0xe277f[_0x35d306];return _0x37d707;}const MAX_STAGES=0x8;function createIssue(_0x46eec0,_0x3b05bd,_0xca51df,_0x218abc,_0x1a3825,_0x3906ff){const _0x43e00b=a136_0x37d7;return{'level':_0x46eec0,'path':_0x3b05bd,'code':_0xca51df,'message':_0x218abc,'location':getLocationFromPath(_0x1a3825[_0x43e00b(0x150)],_0x1a3825['source'],pathToArray(_0x3906ff??_0x3b05bd))};}function validateVersionStructure(_0x46ab7f,_0x468b63){const _0x4707f7=a136_0x37d7,_0x343334=[];return _0x46ab7f['length']>MAX_STAGES&&_0x343334[_0x4707f7(0x13d)](createIssue(_0x4707f7(0xf4),_0x4707f7(0xd0),_0x4707f7(0xd6),_0x4707f7(0x127)+_0x46ab7f[_0x4707f7(0x183)]+_0x4707f7(0x15f)+MAX_STAGES,_0x468b63)),_0x343334;}function validateStageStructure(_0x466735,_0x1640d4,_0xcb41b9,_0x203a74){const _0x3380c0=a136_0x37d7,_0x13eb85=[],_0x538acc='stages['+_0x1640d4+']';_0x1640d4===0x0&&!_0x466735[_0x3380c0(0x13b)]&&_0x13eb85[_0x3380c0(0x13d)](createIssue(_0x3380c0(0xf4),_0x538acc+_0x3380c0(0xe1),_0x3380c0(0x16f),_0x3380c0(0x131)+_0x466735['name']+_0x3380c0(0xce),_0x203a74,_0x538acc));const _0x42214f=_0x1640d4===_0xcb41b9-0x1;!_0x42214f&&!_0x466735['milestone']&&_0x13eb85[_0x3380c0(0x13d)](createIssue('error',_0x538acc+'.milestone','MISSING_MILESTONE',_0x3380c0(0x131)+_0x466735[_0x3380c0(0x100)]+'\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone',_0x203a74,_0x538acc));(!_0x466735[_0x3380c0(0x172)]||_0x466735[_0x3380c0(0x172)][_0x3380c0(0x183)]===0x0)&&_0x13eb85[_0x3380c0(0x13d)](createIssue(_0x3380c0(0x145),_0x538acc+_0x3380c0(0x113),_0x3380c0(0x13f),_0x3380c0(0x131)+_0x466735[_0x3380c0(0x100)]+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x203a74,_0x538acc));const _0x10452f=_0x466735[_0x3380c0(0x185)]?.[_0x3380c0(0x183)]??0x0;if(_0x10452f===0x0)_0x13eb85['push'](createIssue('error',_0x538acc+_0x3380c0(0x17e),'INSUFFICIENT_STEPS',_0x3380c0(0x131)+_0x466735[_0x3380c0(0x100)]+_0x3380c0(0x116),_0x203a74,_0x538acc+_0x3380c0(0x17e)));else{if(_0x10452f===0x1)_0x13eb85[_0x3380c0(0x13d)](createIssue(_0x3380c0(0x145),_0x538acc+'.steps',_0x3380c0(0x161),_0x3380c0(0x131)+_0x466735[_0x3380c0(0x100)]+_0x3380c0(0x178),_0x203a74,_0x538acc+_0x3380c0(0x17e)));else _0x10452f<=0x3&&_0x13eb85['push'](createIssue(_0x3380c0(0x145),_0x538acc+'.steps',_0x3380c0(0x10b),_0x3380c0(0x131)+_0x466735[_0x3380c0(0x100)]+'\x27\x20has\x20only\x20'+_0x10452f+_0x3380c0(0x119),_0x203a74,_0x538acc+_0x3380c0(0x17e)));}return _0x13eb85;}function validateStep(_0x4b66f3,_0x3d3bfa,_0x424e62,_0x15ccd4){const _0x4a4c60=a136_0x37d7,_0x2f5ab6=[];if(_0x4b66f3[_0x4a4c60(0xeb)]===_0x4a4c60(0x129))return _0x4b66f3[_0x4a4c60(0xdc)]&&_0x2f5ab6[_0x4a4c60(0x13d)](createIssue(_0x4a4c60(0xf4),_0x3d3bfa+'.next',_0x4a4c60(0x144),'End\x20step\x20\x27'+_0x4b66f3[_0x4a4c60(0x100)]+_0x4a4c60(0x14a),_0x424e62)),'with'in _0x4b66f3&&_0x4b66f3[_0x4a4c60(0xf1)]!==undefined&&_0x2f5ab6[_0x4a4c60(0x13d)](createIssue(_0x4a4c60(0xf4),_0x3d3bfa+_0x4a4c60(0xd3),_0x4a4c60(0x144),'End\x20step\x20\x27'+_0x4b66f3[_0x4a4c60(0x100)]+'\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field',_0x424e62)),_0x2f5ab6;_0x4b66f3['next']&&(_0x424e62[_0x4a4c60(0x16b)]&&!_0x424e62['stepNames'][_0x4a4c60(0x17c)](_0x4b66f3[_0x4a4c60(0xdc)])&&_0x2f5ab6[_0x4a4c60(0x13d)](createIssue(_0x4a4c60(0xf4),_0x3d3bfa+_0x4a4c60(0x117),_0x4a4c60(0x104),_0x4a4c60(0x143)+_0x4b66f3['next']+'\x27',_0x424e62)));switch(_0x4b66f3[_0x4a4c60(0xeb)]){case'wait':_0x2f5ab6[_0x4a4c60(0x13d)](...validateWaitStep(_0x4b66f3,_0x3d3bfa,_0x424e62,_0x15ccd4));break;case _0x4a4c60(0xdf):_0x2f5ab6[_0x4a4c60(0x13d)](...validateActivationStep(_0x4b66f3,_0x3d3bfa,_0x424e62));break;case _0x4a4c60(0x108):_0x2f5ab6['push'](...validateDecisionPointStep(_0x4b66f3,_0x3d3bfa,_0x424e62,_0x15ccd4));break;case _0x4a4c60(0x12a):_0x2f5ab6[_0x4a4c60(0x13d)](...validateAbTestStep(_0x4b66f3,_0x3d3bfa,_0x424e62,_0x15ccd4));break;case _0x4a4c60(0x110):_0x2f5ab6[_0x4a4c60(0x13d)](...validateJumpStep(_0x4b66f3,_0x3d3bfa,_0x424e62));break;}return _0x2f5ab6;}function validateWaitStep(_0x536b8e,_0x370159,_0x46103b,_0x58481d){const _0x5c4dde=a136_0x37d7,_0xc3cc10=[];if(!_0x536b8e[_0x5c4dde(0xf1)])return _0xc3cc10[_0x5c4dde(0x13d)](createIssue(_0x5c4dde(0xf4),_0x370159+_0x5c4dde(0xd3),_0x5c4dde(0x10a),_0x5c4dde(0xf0),_0x46103b,_0x370159)),_0xc3cc10;if(_0x536b8e[_0x5c4dde(0xf1)]['condition']){const _0xb7d9b9=_0x536b8e[_0x5c4dde(0xf1)]['condition'];if(_0xb7d9b9[_0x5c4dde(0xf5)]){_0x46103b[_0x5c4dde(0x109)]?.[_0x5c4dde(0x123)](_0xb7d9b9[_0x5c4dde(0xf5)]);!_0xb7d9b9[_0x5c4dde(0xf5)][_0x5c4dde(0xcf)](_0x5c4dde(0x10f))&&(_0x46103b[_0x5c4dde(0x179)]&&!_0x46103b[_0x5c4dde(0x179)][_0x5c4dde(0x17c)](_0xb7d9b9[_0x5c4dde(0xf5)])&&_0xc3cc10[_0x5c4dde(0x13d)](createIssue(_0x5c4dde(0xf4),_0x370159+'.with.condition.segment',_0x5c4dde(0x154),_0x5c4dde(0x134)+_0xb7d9b9['segment']+_0x5c4dde(0xfe),_0x46103b)));_0xb7d9b9[_0x5c4dde(0xdc)]&&_0x46103b['stepNames']&&!_0x46103b[_0x5c4dde(0x16b)]['has'](_0xb7d9b9['next'])&&_0xc3cc10[_0x5c4dde(0x13d)](createIssue(_0x5c4dde(0xf4),_0x370159+_0x5c4dde(0xe6),'INVALID_NEXT_REFERENCE','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0xb7d9b9[_0x5c4dde(0xdc)]+'\x27',_0x46103b));_0xb7d9b9[_0x5c4dde(0xfa)]?.[_0x5c4dde(0xdc)]&&_0x46103b[_0x5c4dde(0x16b)]&&!_0x46103b[_0x5c4dde(0x16b)][_0x5c4dde(0x17c)](_0xb7d9b9[_0x5c4dde(0xfa)][_0x5c4dde(0xdc)])&&_0xc3cc10[_0x5c4dde(0x13d)](createIssue(_0x5c4dde(0xf4),_0x370159+_0x5c4dde(0xdd),_0x5c4dde(0x104),_0x5c4dde(0x174)+_0xb7d9b9[_0x5c4dde(0xfa)][_0x5c4dde(0xdc)]+'\x27',_0x46103b));const _0x3e7a5f=_0xb7d9b9['next']||_0x536b8e[_0x5c4dde(0xdc)],_0x46dc43=_0xb7d9b9[_0x5c4dde(0xfa)]?.['next']||_0x536b8e['next'];if(_0x3e7a5f){const _0x6ab2eb=_0x58481d[_0x5c4dde(0x102)](_0x3e7a5f);_0x6ab2eb?.[_0x5c4dde(0xeb)]===_0x5c4dde(0x114)&&_0xc3cc10[_0x5c4dde(0x13d)](createIssue(_0x5c4dde(0x145),_0x370159+_0x5c4dde(0xe6),_0x5c4dde(0x139),_0x5c4dde(0x163)+_0x3e7a5f+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x46103b,_0x370159+_0x5c4dde(0x146)));}if(_0x46dc43){const _0x4e3b24=_0x58481d[_0x5c4dde(0x102)](_0x46dc43);_0x4e3b24?.[_0x5c4dde(0xeb)]==='merge'&&_0xc3cc10[_0x5c4dde(0x13d)](createIssue(_0x5c4dde(0x145),_0x370159+_0x5c4dde(0xdd),_0x5c4dde(0x139),_0x5c4dde(0x17d)+_0x46dc43+_0x5c4dde(0x12d),_0x46103b,_0x370159+_0x5c4dde(0xef)));}}}return _0xc3cc10;}function validateActivationStep(_0x15ea9a,_0x4f6931,_0xa68e63){const _0x5bc6fd=a136_0x37d7,_0x50cc0e=[];if(!_0x15ea9a[_0x5bc6fd(0xf1)]?.['activation'])return _0x50cc0e[_0x5bc6fd(0x13d)](createIssue(_0x5bc6fd(0xf4),_0x4f6931+_0x5bc6fd(0x149),_0x5bc6fd(0xed),'Activation\x20step\x20requires\x20an\x20activation\x20reference',_0xa68e63,_0x4f6931)),_0x50cc0e;const _0x13f836=_0x15ea9a[_0x5bc6fd(0xf1)][_0x5bc6fd(0xdf)];return _0xa68e63[_0x5bc6fd(0xe0)]&&!_0x13f836[_0x5bc6fd(0xcf)](_0x5bc6fd(0x10f))&&(!_0xa68e63[_0x5bc6fd(0xe0)][_0x5bc6fd(0x17c)](_0x13f836)&&_0x50cc0e['push'](createIssue(_0x5bc6fd(0xf4),_0x4f6931+'.with.activation',_0x5bc6fd(0x159),_0x5bc6fd(0x175)+_0x13f836+_0x5bc6fd(0x14f),_0xa68e63))),_0x50cc0e;}function validateDecisionPointStep(_0x316444,_0x12b7b7,_0x3e1f0d,_0x511ef6){const _0x1253bb=a136_0x37d7,_0xff5353=[];if(!_0x316444[_0x1253bb(0xf1)]?.['branches']||_0x316444['with']['branches'][_0x1253bb(0x183)]===0x0)return _0xff5353[_0x1253bb(0x13d)](createIssue(_0x1253bb(0xf4),_0x12b7b7+'.with.branches',_0x1253bb(0x15e),_0x1253bb(0x101),_0x3e1f0d,_0x12b7b7)),_0xff5353;for(let _0x3fb8c7=0x0;_0x3fb8c7<_0x316444[_0x1253bb(0xf1)][_0x1253bb(0x157)]['length'];_0x3fb8c7++){const _0x1b88cc=_0x316444[_0x1253bb(0xf1)][_0x1253bb(0x157)][_0x3fb8c7],_0x290a23=_0x12b7b7+_0x1253bb(0x147)+_0x3fb8c7+']';_0x1b88cc[_0x1253bb(0xf5)]&&!_0x1b88cc[_0x1253bb(0x12c)]&&(_0x3e1f0d[_0x1253bb(0x109)]?.['add'](_0x1b88cc[_0x1253bb(0xf5)]),!_0x1b88cc['segment'][_0x1253bb(0xcf)]('ref:')&&(_0x3e1f0d[_0x1253bb(0x179)]&&!_0x3e1f0d[_0x1253bb(0x179)][_0x1253bb(0x17c)](_0x1b88cc['segment'])&&_0xff5353[_0x1253bb(0x13d)](createIssue(_0x1253bb(0xf4),_0x290a23+_0x1253bb(0xe9),_0x1253bb(0x154),'Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'+_0x1b88cc[_0x1253bb(0xf5)]+'\x27',_0x3e1f0d))));_0x1b88cc['next']&&_0x3e1f0d[_0x1253bb(0x16b)]&&!_0x3e1f0d[_0x1253bb(0x16b)][_0x1253bb(0x17c)](_0x1b88cc[_0x1253bb(0xdc)])&&_0xff5353['push'](createIssue('error',_0x290a23+_0x1253bb(0x117),_0x1253bb(0x104),'Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0x1b88cc[_0x1253bb(0xdc)]+'\x27',_0x3e1f0d));if(_0x1b88cc['next']){const _0x4d3d2e=_0x511ef6[_0x1253bb(0x102)](_0x1b88cc[_0x1253bb(0xdc)]);_0x4d3d2e?.['type']===_0x1253bb(0x114)&&_0xff5353[_0x1253bb(0x13d)](createIssue(_0x1253bb(0x145),_0x290a23+_0x1253bb(0x117),_0x1253bb(0x139),_0x1253bb(0x153)+_0x1b88cc[_0x1253bb(0x100)]+'\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x1b88cc[_0x1253bb(0xdc)]+_0x1253bb(0x120),_0x3e1f0d));}}return _0xff5353;}function validateAbTestStep(_0x9f4b98,_0x5d198f,_0x4e6a91,_0x9d76a){const _0xdd5a2=a136_0x37d7,_0x2f69ec=[];if(!_0x9f4b98[_0xdd5a2(0xf1)]?.['variants']||_0x9f4b98[_0xdd5a2(0xf1)][_0xdd5a2(0xf2)][_0xdd5a2(0x183)]===0x0)return _0x2f69ec[_0xdd5a2(0x13d)](createIssue(_0xdd5a2(0xf4),_0x5d198f+_0xdd5a2(0xf9),_0xdd5a2(0x15e),_0xdd5a2(0xf3),_0x4e6a91,_0x5d198f)),_0x2f69ec;const _0xd237e6=_0x9f4b98[_0xdd5a2(0xf1)][_0xdd5a2(0xf2)][_0xdd5a2(0x126)]((_0x25f9ad,_0xaac974)=>_0x25f9ad+(_0xaac974[_0xdd5a2(0x17b)]||0x0),0x0);Math[_0xdd5a2(0xea)](_0xd237e6-0x64)>0.01&&_0x2f69ec[_0xdd5a2(0x13d)](createIssue('error',_0x5d198f+_0xdd5a2(0xf9),_0xdd5a2(0xee),_0xdd5a2(0x168)+_0xd237e6+'%)',_0x4e6a91));for(let _0x2a2cf7=0x0;_0x2a2cf7<_0x9f4b98['with'][_0xdd5a2(0xf2)]['length'];_0x2a2cf7++){const _0x44d94e=_0x9f4b98['with']['variants'][_0x2a2cf7],_0x46ac09=_0x5d198f+_0xdd5a2(0x151)+_0x2a2cf7+']';_0x44d94e[_0xdd5a2(0xdc)]&&_0x4e6a91[_0xdd5a2(0x16b)]&&!_0x4e6a91[_0xdd5a2(0x16b)][_0xdd5a2(0x17c)](_0x44d94e['next'])&&_0x2f69ec[_0xdd5a2(0x13d)](createIssue(_0xdd5a2(0xf4),_0x46ac09+'.next','INVALID_NEXT_REFERENCE',_0xdd5a2(0x142)+_0x44d94e[_0xdd5a2(0xdc)]+'\x27',_0x4e6a91));if(_0x44d94e[_0xdd5a2(0xdc)]){const _0x523bfe=_0x9d76a[_0xdd5a2(0x102)](_0x44d94e[_0xdd5a2(0xdc)]);_0x523bfe?.[_0xdd5a2(0xeb)]===_0xdd5a2(0x114)&&_0x2f69ec['push'](createIssue(_0xdd5a2(0x145),_0x46ac09+'.next',_0xdd5a2(0x139),_0xdd5a2(0x112)+_0x44d94e[_0xdd5a2(0x100)]+_0xdd5a2(0x167)+_0x44d94e['next']+_0xdd5a2(0x120),_0x4e6a91));}}return _0x2f69ec;}function validateJumpStep(_0x475ec3,_0x4399e2,_0x5d05f0){const _0x29c8a7=a136_0x37d7,_0x59efd9=[];if(!_0x475ec3[_0x29c8a7(0xf1)]?.[_0x29c8a7(0x121)])return _0x59efd9['push'](createIssue(_0x29c8a7(0xf4),_0x4399e2+_0x29c8a7(0x124),_0x29c8a7(0x107),_0x29c8a7(0x10e),_0x5d05f0,_0x4399e2)),_0x59efd9;return(!_0x475ec3['with'][_0x29c8a7(0x121)][_0x29c8a7(0x111)]||!_0x475ec3['with'][_0x29c8a7(0x121)][_0x29c8a7(0x176)])&&_0x59efd9['push'](createIssue('error',_0x4399e2+_0x29c8a7(0x124),_0x29c8a7(0x107),_0x29c8a7(0x17a),_0x5d05f0)),_0x59efd9;}function a136_0xe277(){const _0x58c974=['journeys','Criteria\x20references\x20undefined\x20segment\x20\x27','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','190184NttrFk','source','variant\x20\x27','branch\x20\x27','BRANCH_DIRECTLY_TO_MERGE','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','entry_criteria','excluded_','push','level','MISSING_EXIT_CRITERIA','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','Step\x20references\x20non-existent\x20step\x20\x27','END_STEP_HAS_NEXT_OR_WITH','warning','.with.condition','.with.branches[','558KHXRoJ','.with.activation','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','.exit_criteria[','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','journeys[','Duplicate\x20step\x20name\x20\x27','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','document','.with.variants[','values','Decision\x20branch\x20\x27','MISSING_SEGMENT_REFERENCE','code','journey\x20entry','branches','skipSchema','MISSING_ACTIVATION_DEFINITION','.milestone','Embedded\x20segment\x20\x27','description','size','MISSING_CONDITIONS','\x20stages\x20but\x20maximum\x20is\x20','versions[','INSUFFICIENT_STEPS','Journey\x20can\x20have\x20at\x20most\x20one\x20','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.type','MERGE_TO_MERGE_CHAIN','step\x20\x27','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20',').\x20Use\x20a\x20merge\x20step.','keys','stepNames','JOURNEY_SCHEMA_ERROR','indices','1563286JPiuof','MISSING_ENTRY_CRITERIA','\x27\x20has\x20no\x20end\x20step','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','exit_criteria',').\x20Merge\x20is\x20unnecessary.','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','stage','Journey\x20has\x20no\x20goal\x20defined','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','embeddedSegments','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','percentage','has','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.steps','milestone','\x27\x20of\x20\x27','versions','endsWith','length','MISSING_END_STEP','steps','goal','MISSING_NAME','sort','journeys,\x20stages,\x20or\x20versions','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','startsWith','stages','launched','MISSING_STAGES','.with','\x27\x20(first\x20defined\x20at\x20steps[','activations','TOO_MANY_STAGES','29003220MFFqSs','3GdTPNO','19948ZHjwZF','message','every','next','.with.condition.timeout.next','filter','activation','activationKeys','.entry_criteria','DUPLICATE_STEP_NAME','\x20versions)','issues','safeParse','.with.condition.next','state','.stages','.segment','abs','type','path','MISSING_ACTIVATION_REF','INVALID_AB_TEST_PERCENTAGES','.with.condition.timeout','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','with','variants','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','error','segment','.name','map','data','.with.variants','timeout','join','UNUSED_EMBEDDED_SEGMENT','timeout\x20of\x20\x27','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','\x27\x20(from:\x20','name','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','get','condition','INVALID_NEXT_REFERENCE','DUPLICATE_LATEST','11069611cNQBfE','INVALID_JUMP_TARGET','decision_point','referencedSegments','MISSING_WAIT_PARAMS','FEW_STEPS','set','version','Jump\x20step\x20requires\x20a\x20target','ref:','jump','journey','A/B\x20test\x20variant\x20\x27','.exit_criteria','merge','includes','\x27\x20has\x20no\x20steps','.next','replace','\x20steps\x20(may\x20be\x20too\x20simple)','\x20with\x20latest:\x20true','segments.','success','1006807xJclWq','Merge\x20step\x20\x27','557232laBgNC','\x27\x20with\x20no\x20action\x20in\x20between','target','.rule','add','.with.target','entries','reduce','Journey\x20has\x20','segments','end','ab_test','Journey\x20name\x20is\x20required','excluded','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','1735gWNYKj','goalIsInherited','MISSING_GOAL','Stage\x20\x27'];a136_0xe277=function(){return _0x58c974;};return a136_0xe277();}function buildConvergenceMap(_0x2df303){const _0x2e2c68=a136_0x37d7,_0x4b20fb=new Map();function _0x4d8b57(_0x4828c0,_0x57d5ce){const _0x322c7f=a136_0x37d7,_0x251fe5=_0x4b20fb['get'](_0x4828c0)||[];_0x251fe5[_0x322c7f(0x13d)](_0x57d5ce),_0x4b20fb[_0x322c7f(0x10c)](_0x4828c0,_0x251fe5);}for(const _0x150b61 of _0x2df303){_0x150b61[_0x2e2c68(0xdc)]&&_0x4d8b57(_0x150b61[_0x2e2c68(0xdc)],{'stepName':_0x150b61[_0x2e2c68(0x100)],'description':_0x2e2c68(0x166)+_0x150b61[_0x2e2c68(0x100)]+'\x27'});if(_0x150b61[_0x2e2c68(0xeb)]===_0x2e2c68(0x108)&&_0x150b61[_0x2e2c68(0xf1)]?.[_0x2e2c68(0x157)])for(const _0x4b60cd of _0x150b61[_0x2e2c68(0xf1)][_0x2e2c68(0x157)]){_0x4b60cd[_0x2e2c68(0xdc)]&&_0x4d8b57(_0x4b60cd[_0x2e2c68(0xdc)],{'stepName':_0x150b61[_0x2e2c68(0x100)],'description':_0x2e2c68(0x138)+_0x4b60cd[_0x2e2c68(0x100)]+_0x2e2c68(0x180)+_0x150b61['name']+'\x27'});}if(_0x150b61[_0x2e2c68(0xeb)]===_0x2e2c68(0x12a)&&_0x150b61[_0x2e2c68(0xf1)]?.[_0x2e2c68(0xf2)])for(const _0x23341f of _0x150b61[_0x2e2c68(0xf1)][_0x2e2c68(0xf2)]){_0x23341f['next']&&_0x4d8b57(_0x23341f[_0x2e2c68(0xdc)],{'stepName':_0x150b61['name'],'description':_0x2e2c68(0x137)+_0x23341f[_0x2e2c68(0x100)]+_0x2e2c68(0x180)+_0x150b61[_0x2e2c68(0x100)]+'\x27'});}_0x150b61[_0x2e2c68(0xeb)]==='wait'&&_0x150b61[_0x2e2c68(0xf1)]?.[_0x2e2c68(0x103)]&&(_0x150b61[_0x2e2c68(0xf1)][_0x2e2c68(0x103)][_0x2e2c68(0xdc)]&&_0x4d8b57(_0x150b61['with'][_0x2e2c68(0x103)][_0x2e2c68(0xdc)],{'stepName':_0x150b61[_0x2e2c68(0x100)],'description':'condition\x20of\x20\x27'+_0x150b61[_0x2e2c68(0x100)]+'\x27'}),_0x150b61[_0x2e2c68(0xf1)][_0x2e2c68(0x103)]['timeout']?.[_0x2e2c68(0xdc)]&&_0x4d8b57(_0x150b61[_0x2e2c68(0xf1)][_0x2e2c68(0x103)][_0x2e2c68(0xfa)][_0x2e2c68(0xdc)],{'stepName':_0x150b61['name'],'description':_0x2e2c68(0xfd)+_0x150b61[_0x2e2c68(0x100)]+'\x27'}));}return _0x4b20fb;}function validateFlowControl(_0x1a42a8,_0x591ce9,_0x35b293){const _0x5f3cd7=a136_0x37d7,_0x2f7308=[],_0x3b6f5f='stages['+_0x591ce9+']',_0x5238a0=_0x1a42a8[_0x5f3cd7(0x185)]||[];if(_0x5238a0[_0x5f3cd7(0x183)]===0x0)return _0x2f7308;const _0x391d19=new Map();for(const _0x4eb8bf of _0x5238a0){_0x4eb8bf[_0x5f3cd7(0x100)]&&_0x391d19['set'](_0x4eb8bf['name'],_0x4eb8bf);}const _0x2752e0=buildConvergenceMap(_0x5238a0),_0x433193=_0x5238a0['some'](_0x175946=>_0x175946[_0x5f3cd7(0xeb)]==='end');!_0x433193&&_0x2f7308[_0x5f3cd7(0x13d)](createIssue(_0x5f3cd7(0xf4),_0x3b6f5f+_0x5f3cd7(0x17e),_0x5f3cd7(0x184),_0x5f3cd7(0x131)+_0x1a42a8[_0x5f3cd7(0x100)]+_0x5f3cd7(0x170),_0x35b293));for(const [_0x2cb6ad,_0x2214cd]of _0x2752e0){const _0x183320=_0x391d19[_0x5f3cd7(0x102)](_0x2cb6ad);if(!_0x183320)continue;if(_0x2214cd[_0x5f3cd7(0x183)]>0x1&&_0x183320['type']!==_0x5f3cd7(0x114)){const _0x5cadc7=_0x2214cd[_0x5f3cd7(0xf7)](_0x1772c8=>_0x1772c8[_0x5f3cd7(0x15c)])[_0x5f3cd7(0xfb)](',\x20');_0x2f7308['push'](createIssue(_0x5f3cd7(0xf4),_0x3b6f5f+_0x5f3cd7(0x17e),'CONVERGENCE_WITHOUT_MERGE','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27'+_0x2cb6ad+_0x5f3cd7(0xff)+_0x5cadc7+_0x5f3cd7(0x169),_0x35b293));}_0x2214cd['length']===0x1&&_0x183320[_0x5f3cd7(0xeb)]===_0x5f3cd7(0x114)&&_0x2f7308[_0x5f3cd7(0x13d)](createIssue(_0x5f3cd7(0x145),_0x3b6f5f+_0x5f3cd7(0x17e),'SINGLE_INPUT_MERGE',_0x5f3cd7(0x11e)+_0x2cb6ad+_0x5f3cd7(0x171)+_0x2214cd[0x0]['description']+_0x5f3cd7(0x173),_0x35b293));}for(const _0x58ac0d of _0x5238a0){if(_0x58ac0d[_0x5f3cd7(0xeb)]===_0x5f3cd7(0x114)&&_0x58ac0d[_0x5f3cd7(0xdc)]){const _0x1146cb=_0x391d19[_0x5f3cd7(0x102)](_0x58ac0d[_0x5f3cd7(0xdc)]);_0x1146cb?.['type']===_0x5f3cd7(0x114)&&_0x2f7308[_0x5f3cd7(0x13d)](createIssue(_0x5f3cd7(0xf4),_0x3b6f5f+_0x5f3cd7(0x17e),_0x5f3cd7(0x165),'Merge\x20step\x20\x27'+_0x58ac0d[_0x5f3cd7(0x100)]+_0x5f3cd7(0x141)+_0x58ac0d[_0x5f3cd7(0xdc)]+_0x5f3cd7(0x13a),_0x35b293));}}return _0x2f7308;}function validateCriteria(_0x4354fa,_0xcf0d9b,_0x1f79a0){const _0x193f09=a136_0x37d7,_0x3c39c8=[];return _0x4354fa[_0x193f09(0xf5)]&&(_0x1f79a0[_0x193f09(0x109)]?.[_0x193f09(0x123)](_0x4354fa[_0x193f09(0xf5)]),!_0x4354fa[_0x193f09(0xf5)][_0x193f09(0xcf)](_0x193f09(0x10f))&&(_0x1f79a0[_0x193f09(0x179)]&&!_0x1f79a0[_0x193f09(0x179)][_0x193f09(0x17c)](_0x4354fa[_0x193f09(0xf5)])&&_0x3c39c8[_0x193f09(0x13d)](createIssue('error',_0xcf0d9b+_0x193f09(0xe9),_0x193f09(0x154),_0x193f09(0x133)+_0x4354fa['segment']+'\x27',_0x1f79a0)))),_0x3c39c8;}function validateEmbeddedSegment(_0x5355ef,_0x3e17c4,_0x410b9f){const _0x33ae70=a136_0x37d7,_0x5e4b4e=[];return _0x5355ef['rule']&&_0x5e4b4e[_0x33ae70(0x13d)](...validateRuleDef(_0x5355ef['rule'],_0x3e17c4+_0x33ae70(0x122),_0x410b9f)),_0x5e4b4e;}function validateStage(_0x5317b8,_0x143495,_0x2ff606,_0x631615){const _0x10536c=a136_0x37d7,_0x4fa8ee=[],_0x109e0a='stages['+_0x143495+']',_0x1729d4=new Map(),_0x24f046=new Map();if(_0x5317b8[_0x10536c(0x185)]){for(let _0x59bf66=0x0;_0x59bf66<_0x5317b8[_0x10536c(0x185)][_0x10536c(0x183)];_0x59bf66++){const _0x3a401a=_0x5317b8[_0x10536c(0x185)][_0x59bf66];_0x3a401a[_0x10536c(0x100)]&&_0x1729d4[_0x10536c(0x10c)](_0x3a401a[_0x10536c(0x100)],_0x3a401a);}for(let _0x4d5fb9=0x0;_0x4d5fb9<_0x5317b8[_0x10536c(0x185)][_0x10536c(0x183)];_0x4d5fb9++){const _0x1b0caf=_0x5317b8[_0x10536c(0x185)][_0x4d5fb9],_0x43692f=_0x109e0a+'.steps['+_0x4d5fb9+']';if(_0x1b0caf[_0x10536c(0x100)]){if(_0x24f046[_0x10536c(0x17c)](_0x1b0caf['name'])){const _0x166748=_0x24f046[_0x10536c(0x102)](_0x1b0caf['name']);_0x4fa8ee[_0x10536c(0x13d)](createIssue(_0x10536c(0xf4),_0x43692f+_0x10536c(0xf6),_0x10536c(0xe2),_0x10536c(0x14e)+_0x1b0caf[_0x10536c(0x100)]+_0x10536c(0xd4)+_0x166748+'])',_0x631615));}else _0x24f046[_0x10536c(0x10c)](_0x1b0caf[_0x10536c(0x100)],_0x4d5fb9);}_0x4fa8ee[_0x10536c(0x13d)](...validateStep(_0x1b0caf,_0x43692f,_0x631615,_0x1729d4));}}_0x5317b8['entry_criteria']&&_0x4fa8ee[_0x10536c(0x13d)](...validateCriteria(_0x5317b8[_0x10536c(0x13b)],_0x109e0a+_0x10536c(0xe1),_0x631615));if(_0x5317b8[_0x10536c(0x172)])for(let _0x43a354=0x0;_0x43a354<_0x5317b8[_0x10536c(0x172)]['length'];_0x43a354++){_0x4fa8ee[_0x10536c(0x13d)](...validateCriteria(_0x5317b8['exit_criteria'][_0x43a354],_0x109e0a+_0x10536c(0x14b)+_0x43a354+']',_0x631615));}return _0x5317b8[_0x10536c(0x17f)]&&_0x4fa8ee[_0x10536c(0x13d)](...validateCriteria(_0x5317b8[_0x10536c(0x17f)],_0x109e0a+_0x10536c(0x15a),_0x631615)),_0x4fa8ee[_0x10536c(0x13d)](...validateStageStructure(_0x5317b8,_0x143495,_0x2ff606,_0x631615)),_0x4fa8ee[_0x10536c(0x13d)](...validateFlowControl(_0x5317b8,_0x143495,_0x631615)),_0x4fa8ee;}function validateStagesForVersion(_0x30a295,_0x2e13cb,_0x374c51,_0x1de5cc,_0x5caa19,_0x375fed,_0x3b1176){const _0x42d2e4=a136_0x37d7;if(_0x30a295[_0x42d2e4(0x183)]===0x0){_0x5caa19[_0x42d2e4(0x13d)]({'level':_0x42d2e4(0xf4),'path':_0x1de5cc+_0x42d2e4(0xd0),'code':_0x42d2e4(0xd2),'message':_0x42d2e4(0x140),'location':getLocationFromPath(_0x374c51['document'],_0x374c51[_0x42d2e4(0x136)],[_0x42d2e4(0xd0)])});return;}const _0x2539e4=new Set();for(const _0x2081d2 of _0x30a295){if(_0x2081d2[_0x42d2e4(0x185)])for(const _0x147707 of _0x2081d2[_0x42d2e4(0x185)]){_0x147707[_0x42d2e4(0x100)]&&_0x2539e4[_0x42d2e4(0x123)](_0x147707[_0x42d2e4(0x100)]);}}const _0x1ae6df={..._0x374c51,'stepNames':_0x2539e4},_0x5bfeec=validateVersionStructure(_0x30a295,_0x1ae6df);for(const _0x4167ec of _0x5bfeec){const _0x9c27b1=_0x1de5cc?{..._0x4167ec,'path':''+_0x1de5cc+_0x4167ec[_0x42d2e4(0xec)]}:_0x4167ec;if(_0x9c27b1['level']===_0x42d2e4(0xf4))_0x5caa19[_0x42d2e4(0x13d)](_0x9c27b1);else _0x375fed[_0x42d2e4(0x13d)](_0x9c27b1);}for(let _0x9f08f9=0x0;_0x9f08f9<_0x30a295[_0x42d2e4(0x183)];_0x9f08f9++){const _0x541d3b=validateStage(_0x30a295[_0x9f08f9],_0x9f08f9,_0x30a295['length'],_0x1ae6df);for(const _0x170100 of _0x541d3b){const _0x1a3851=_0x1de5cc?{..._0x170100,'path':''+_0x1de5cc+_0x170100[_0x42d2e4(0xec)]}:_0x170100;if(_0x1a3851[_0x42d2e4(0x13e)]==='error')_0x5caa19[_0x42d2e4(0x13d)](_0x1a3851);else _0x375fed[_0x42d2e4(0x13d)](_0x1a3851);}}if(_0x2e13cb[_0x42d2e4(0x186)]){const _0x1a180c=_0x3b1176?.[_0x42d2e4(0x12f)]?_0x42d2e4(0x186):_0x1de5cc+_0x42d2e4(0x186),_0x3f184d=validateCriteria(_0x2e13cb[_0x42d2e4(0x186)],_0x1a180c,_0x1ae6df);for(const _0x4ac404 of _0x3f184d){if(_0x4ac404['level']===_0x42d2e4(0xf4))_0x5caa19[_0x42d2e4(0x13d)](_0x4ac404);else _0x375fed[_0x42d2e4(0x13d)](_0x4ac404);}}}function extractVersionIndex(_0x59e7cc){const _0x2ea3ba=_0x59e7cc['match'](/^journeys\[(\d+)\]\./);return _0x2ea3ba?_0x2ea3ba[0x1]:undefined;}function deduplicateAcrossVersions(_0x1622d0){const _0x48b8d5=a136_0x37d7,_0x1e614c=new Map();for(let _0x3ca2cf=0x0;_0x3ca2cf<_0x1622d0[_0x48b8d5(0x183)];_0x3ca2cf++){const _0x2daf97=_0x1622d0[_0x3ca2cf][_0x48b8d5(0x155)]+':'+_0x1622d0[_0x3ca2cf][_0x48b8d5(0xda)],_0x257671=extractVersionIndex(_0x1622d0[_0x3ca2cf][_0x48b8d5(0xec)]),_0x5a386a=_0x1e614c[_0x48b8d5(0x102)](_0x2daf97);if(_0x5a386a){_0x5a386a[_0x48b8d5(0x16d)][_0x48b8d5(0x13d)](_0x3ca2cf);if(_0x257671)_0x5a386a['versions'][_0x48b8d5(0x123)](_0x257671);}else _0x1e614c['set'](_0x2daf97,{'indices':[_0x3ca2cf],'versions':new Set(_0x257671?[_0x257671]:[])});}const _0x14cb6d=new Set();for(const {indices:_0x15eb00,versions:_0x4ff664}of _0x1e614c[_0x48b8d5(0x152)]()){if(_0x4ff664[_0x48b8d5(0x15d)]<=0x1)continue;const _0x25050e=_0x1622d0[_0x15eb00[0x0]];_0x25050e[_0x48b8d5(0xec)]=_0x25050e['path'][_0x48b8d5(0x118)](/^journeys\[\d+\]\./,''),_0x25050e[_0x48b8d5(0xda)]=_0x25050e[_0x48b8d5(0xda)]+'\x20(across\x20'+_0x4ff664[_0x48b8d5(0x15d)]+_0x48b8d5(0xe3);for(let _0x4ff12f=0x1;_0x4ff12f<_0x15eb00['length'];_0x4ff12f++){_0x14cb6d['add'](_0x15eb00[_0x4ff12f]);}}const _0x1fe551=[..._0x14cb6d][_0x48b8d5(0xcc)]((_0x3ca029,_0x14debe)=>_0x14debe-_0x3ca029);for(const _0x7a67cf of _0x1fe551){_0x1622d0['splice'](_0x7a67cf,0x1);}}export function validateJourneyDef(_0x23e8a6,_0x2ea053={},_0x58c6f2={}){const _0x4d8971=a136_0x37d7;if(_0x58c6f2[_0x4d8971(0x158)])return runJourneySemanticChecks(_0x23e8a6,_0x2ea053);const _0x4630a8=JourneyDefSchema[_0x4d8971(0xe5)](_0x23e8a6);if(_0x4630a8[_0x4d8971(0x11c)])return runJourneySemanticChecks(_0x4630a8[_0x4d8971(0xf8)],_0x2ea053);return zodErrorsToJourneyValidationResult(_0x4630a8[_0x4d8971(0xf4)],_0x2ea053);}function zodErrorsToJourneyValidationResult(_0x2359eb,_0x48666d){const _0x65560c=a136_0x37d7,_0x300df9=flattenZodIssues(_0x2359eb[_0x65560c(0xe4)]),_0x4b1509=_0x300df9['map'](_0x1da123=>{const _0xcef4ca=_0x65560c,_0x4e96cc=formatZodPath(_0x1da123[_0xcef4ca(0xec)]),_0x4435a8=mapJourneyZodIssueToCode(_0x1da123,_0x4e96cc),_0x1825b=getLocationFromPath(_0x48666d[_0xcef4ca(0x150)],_0x48666d['source'],_0x1da123[_0xcef4ca(0xec)][_0xcef4ca(0xf7)](_0x48bbcc=>typeof _0x48bbcc==='symbol'?String(_0x48bbcc):_0x48bbcc));return{'level':_0xcef4ca(0xf4),'path':_0x4e96cc,'code':_0x4435a8,'message':_0x1da123[_0xcef4ca(0xda)],..._0x1825b&&{'location':_0x1825b}};});return{'valid':![],'errors':_0x4b1509,'warnings':[]};}function mapJourneyZodIssueToCode(_0x240688,_0x60ceb9){const _0xce74d1=a136_0x37d7;if(_0x60ceb9===_0xce74d1(0x100))return _0xce74d1(0xcb);if(_0x60ceb9[_0xce74d1(0x182)](_0xce74d1(0x164))&&_0x60ceb9[_0xce74d1(0x115)](_0xce74d1(0x185)))return'JOURNEY_SCHEMA_ERROR';if(_0x60ceb9==='stages'||_0x60ceb9[_0xce74d1(0x182)](_0xce74d1(0xe8)))return _0xce74d1(0xd2);if(_0x60ceb9===''&&_0x240688[_0xce74d1(0xda)][_0xce74d1(0x115)](_0xce74d1(0xcd)))return'MISSING_STAGES';if(_0x60ceb9[_0xce74d1(0x115)](_0xce74d1(0xdf)))return'ACTIVATION_SCHEMA_ERROR';return _0xce74d1(0x16c);}function runJourneySemanticChecks(_0x162f93,_0x35a404){const _0x2a3784=a136_0x37d7,_0x51f12e=[],_0x4ee358=[];(!_0x162f93[_0x2a3784(0x100)]||_0x162f93[_0x2a3784(0x100)]['trim']()==='')&&_0x51f12e[_0x2a3784(0x13d)]({'level':_0x2a3784(0xf4),'path':_0x2a3784(0x100),'code':'MISSING_NAME','message':_0x2a3784(0x12b),'location':getLocationFromPath(_0x35a404[_0x2a3784(0x150)],_0x35a404[_0x2a3784(0x136)],[_0x2a3784(0x100)])});const _0x53b595=new Set();if(_0x162f93[_0x2a3784(0x128)])for(const _0x30d15b of Object['keys'](_0x162f93[_0x2a3784(0x128)])){_0x53b595[_0x2a3784(0x123)](_0x30d15b);}const _0x14f3c3=new Set();if(_0x162f93[_0x2a3784(0xd5)])for(const _0x17cd11 of Object[_0x2a3784(0x16a)](_0x162f93[_0x2a3784(0xd5)])){_0x14f3c3[_0x2a3784(0x123)](_0x17cd11);}const _0xe11387=new Set(),_0x296254={..._0x35a404,'embeddedSegments':_0x53b595,'referencedSegments':_0xe11387,'activationKeys':_0x14f3c3[_0x2a3784(0x15d)]>0x0?_0x14f3c3:undefined};if(_0x162f93['segments'])for(const [_0x70fb0a,_0x218cfb]of Object[_0x2a3784(0x125)](_0x162f93[_0x2a3784(0x128)])){const _0x233cf9=validateEmbeddedSegment(_0x218cfb,_0x2a3784(0x11b)+_0x70fb0a,_0x296254);for(const _0x222c14 of _0x233cf9){if(_0x222c14[_0x2a3784(0x13e)]===_0x2a3784(0xf4))_0x51f12e[_0x2a3784(0x13d)](_0x222c14);else _0x4ee358[_0x2a3784(0x13d)](_0x222c14);}}const _0x5506fa=!!_0x162f93[_0x2a3784(0x186)],_0x54e979=_0x162f93[_0x2a3784(0x132)]?.[_0x2a3784(0xdb)](_0x4a243b=>!!_0x4a243b[_0x2a3784(0x186)])??![];!_0x5506fa&&!_0x54e979&&_0x4ee358['push']({'level':_0x2a3784(0x145),'path':_0x2a3784(0x186),'code':_0x2a3784(0x130),'message':_0x2a3784(0x177),'location':getLocationFromPath(_0x35a404[_0x2a3784(0x150)],_0x35a404[_0x2a3784(0x136)],[_0x2a3784(0x186)])});const _0x2a188a=_0x162f93[_0x2a3784(0x132)]??_0x162f93[_0x2a3784(0x181)];if(_0x2a188a&&_0x2a188a[_0x2a3784(0xde)](_0x3fde29=>_0x3fde29['latest']===!![])[_0x2a3784(0x183)]>0x1){const _0x44db43=_0x162f93['journeys']?_0x2a3784(0x132):'versions';_0x51f12e[_0x2a3784(0x13d)]({'level':_0x2a3784(0xf4),'path':_0x44db43,'code':_0x2a3784(0x105),'message':_0x2a3784(0x162)+(_0x44db43===_0x2a3784(0x132)?_0x2a3784(0x156):_0x2a3784(0x10d))+_0x2a3784(0x11a),'location':getLocationFromPath(_0x35a404[_0x2a3784(0x150)],_0x35a404['source'],[_0x44db43])});}if(_0x162f93[_0x2a3784(0x132)]&&_0x162f93[_0x2a3784(0x132)][_0x2a3784(0x183)]>0x0)for(let _0x207ee9=0x0;_0x207ee9<_0x162f93[_0x2a3784(0x132)]['length'];_0x207ee9++){const _0x3a46e4=_0x162f93[_0x2a3784(0x132)][_0x207ee9];if(_0x162f93[_0x2a3784(0x132)][_0x2a3784(0x183)]>0x1&&_0x3a46e4[_0x2a3784(0xe7)]===_0x2a3784(0xd1))continue;const _0xd929b4=_0x3a46e4[_0x2a3784(0xd0)]||[],_0x3cb89d=_0x2a3784(0x14d)+_0x207ee9+'].',_0x262848=!!_0x3a46e4[_0x2a3784(0x186)],_0x3c912b=_0x262848?{..._0x162f93,'goal':_0x3a46e4['goal']}:_0x162f93;validateStagesForVersion(_0xd929b4,_0x3c912b,_0x296254,_0x3cb89d,_0x51f12e,_0x4ee358,{'goalIsInherited':!_0x262848});}else{if(_0x162f93[_0x2a3784(0x181)]&&_0x162f93['versions']['length']>0x0)for(let _0x308f2a=0x0;_0x308f2a<_0x162f93[_0x2a3784(0x181)][_0x2a3784(0x183)];_0x308f2a++){const _0x2dd0f2=_0x162f93['versions'][_0x308f2a];if(_0x162f93[_0x2a3784(0x181)]['length']>0x1&&_0x2dd0f2['state']===_0x2a3784(0xd1))continue;const _0x340808=_0x2dd0f2[_0x2a3784(0xd0)]||[],_0x291117=_0x2a3784(0x160)+_0x308f2a+'].';validateStagesForVersion(_0x340808,_0x162f93,_0x296254,_0x291117,_0x51f12e,_0x4ee358);}else{const _0x29671f=_0x162f93['stages']||[];validateStagesForVersion(_0x29671f,_0x162f93,_0x296254,'',_0x51f12e,_0x4ee358);}}_0x162f93[_0x2a3784(0x132)]&&_0x162f93[_0x2a3784(0x132)][_0x2a3784(0x183)]>0x1&&(deduplicateAcrossVersions(_0x51f12e),deduplicateAcrossVersions(_0x4ee358));for(const _0x179cea of _0x53b595){!_0xe11387['has'](_0x179cea)&&!_0x179cea[_0x2a3784(0xcf)](_0x2a3784(0x13c))&&_0x4ee358[_0x2a3784(0x13d)]({'level':'warning','path':_0x2a3784(0x11b)+_0x179cea,'code':_0x2a3784(0xfc),'message':_0x2a3784(0x15b)+_0x179cea+_0x2a3784(0x14c),'location':getLocationFromPath(_0x35a404[_0x2a3784(0x150)],_0x35a404[_0x2a3784(0x136)],[_0x2a3784(0x128),_0x179cea])});}return{'valid':_0x51f12e[_0x2a3784(0x183)]===0x0,'errors':_0x51f12e,'warnings':_0x4ee358};}
1
+ function a145_0x2ecc(_0x462ad0,_0x266037){_0x462ad0=_0x462ad0-0x163;const _0x566c13=a145_0x566c();let _0x2ecc0a=_0x566c13[_0x462ad0];return _0x2ecc0a;}(function(_0x49d080,_0x257450){const _0x4904dd=a145_0x2ecc,_0x2076e8=_0x49d080();while(!![]){try{const _0x40f98e=-parseInt(_0x4904dd(0x1ca))/0x1*(parseInt(_0x4904dd(0x1df))/0x2)+-parseInt(_0x4904dd(0x20b))/0x3*(parseInt(_0x4904dd(0x18e))/0x4)+parseInt(_0x4904dd(0x212))/0x5+-parseInt(_0x4904dd(0x168))/0x6+-parseInt(_0x4904dd(0x1f5))/0x7+parseInt(_0x4904dd(0x1c0))/0x8*(-parseInt(_0x4904dd(0x1d1))/0x9)+parseInt(_0x4904dd(0x1d8))/0xa;if(_0x40f98e===_0x257450)break;else _0x2076e8['push'](_0x2076e8['shift']());}catch(_0x51e40a){_0x2076e8['push'](_0x2076e8['shift']());}}}(a145_0x566c,0x70dfc));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x5d06db,_0x50b033,_0x43d929,_0x1bd13e,_0x2f4821,_0x1361a8){const _0x2ec27b=a145_0x2ecc;return{'level':_0x5d06db,'path':_0x50b033,'code':_0x43d929,'message':_0x1bd13e,'location':getLocationFromPath(_0x2f4821[_0x2ec27b(0x1da)],_0x2f4821[_0x2ec27b(0x20d)],pathToArray(_0x1361a8??_0x50b033))};}function validateVersionStructure(_0x2f45c9,_0x46bcb2){const _0x4cc851=a145_0x2ecc,_0xba7266=[];return _0x2f45c9[_0x4cc851(0x1a7)]>MAX_STAGES&&_0xba7266[_0x4cc851(0x1c1)](createIssue(_0x4cc851(0x1ff),'stages',_0x4cc851(0x180),_0x4cc851(0x1e2)+_0x2f45c9[_0x4cc851(0x1a7)]+_0x4cc851(0x19b)+MAX_STAGES,_0x46bcb2)),_0xba7266;}function validateStageStructure(_0x1845d3,_0x219373,_0x11bc6a,_0x2be91f){const _0x455d48=a145_0x2ecc,_0x37357f=[],_0x4759d2=_0x455d48(0x186)+_0x219373+']';_0x219373===0x0&&!_0x1845d3['entry_criteria']&&_0x37357f[_0x455d48(0x1c1)](createIssue(_0x455d48(0x1ff),_0x4759d2+_0x455d48(0x1a4),_0x455d48(0x1db),_0x455d48(0x1a3)+_0x1845d3[_0x455d48(0x1e4)]+_0x455d48(0x17c),_0x2be91f,_0x4759d2));const _0x440886=_0x219373===_0x11bc6a-0x1;!_0x440886&&!_0x1845d3[_0x455d48(0x1ce)]&&_0x37357f[_0x455d48(0x1c1)](createIssue(_0x455d48(0x1ff),_0x4759d2+_0x455d48(0x178),_0x455d48(0x1f9),'Stage\x20\x27'+_0x1845d3[_0x455d48(0x1e4)]+_0x455d48(0x19d),_0x2be91f,_0x4759d2));(!_0x1845d3['exit_criteria']||_0x1845d3['exit_criteria'][_0x455d48(0x1a7)]===0x0)&&_0x37357f[_0x455d48(0x1c1)](createIssue(_0x455d48(0x1f1),_0x4759d2+_0x455d48(0x1fa),_0x455d48(0x1cf),'Stage\x20\x27'+_0x1845d3['name']+_0x455d48(0x16f),_0x2be91f,_0x4759d2));const _0x3115da=_0x1845d3['steps']?.[_0x455d48(0x1a7)]??0x0;if(_0x3115da===0x0)_0x37357f['push'](createIssue(_0x455d48(0x1ff),_0x4759d2+_0x455d48(0x187),_0x455d48(0x208),'Stage\x20\x27'+_0x1845d3[_0x455d48(0x1e4)]+_0x455d48(0x177),_0x2be91f,_0x4759d2+_0x455d48(0x187)));else{if(_0x3115da===0x1)_0x37357f[_0x455d48(0x1c1)](createIssue('warning',_0x4759d2+_0x455d48(0x187),'INSUFFICIENT_STEPS',_0x455d48(0x1a3)+_0x1845d3[_0x455d48(0x1e4)]+'\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)',_0x2be91f,_0x4759d2+_0x455d48(0x187)));else _0x3115da<=0x3&&_0x37357f[_0x455d48(0x1c1)](createIssue(_0x455d48(0x1f1),_0x4759d2+_0x455d48(0x187),_0x455d48(0x205),_0x455d48(0x1a3)+_0x1845d3[_0x455d48(0x1e4)]+_0x455d48(0x214)+_0x3115da+_0x455d48(0x1ef),_0x2be91f,_0x4759d2+_0x455d48(0x187)));}return _0x37357f;}function validateStep(_0x4286d8,_0x13347a,_0x6aea12,_0x2c243f){const _0x4ec831=a145_0x2ecc,_0x3c0591=[];if(_0x4286d8[_0x4ec831(0x1f2)]==='end')return _0x4286d8['next']&&_0x3c0591[_0x4ec831(0x1c1)](createIssue(_0x4ec831(0x1ff),_0x13347a+'.next',_0x4ec831(0x1b7),_0x4ec831(0x1dd)+_0x4286d8[_0x4ec831(0x1e4)]+_0x4ec831(0x20c),_0x6aea12)),_0x4ec831(0x1dc)in _0x4286d8&&_0x4286d8[_0x4ec831(0x1dc)]!==undefined&&_0x3c0591[_0x4ec831(0x1c1)](createIssue('error',_0x13347a+_0x4ec831(0x19e),'END_STEP_HAS_NEXT_OR_WITH','End\x20step\x20\x27'+_0x4286d8[_0x4ec831(0x1e4)]+'\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field',_0x6aea12)),_0x3c0591;_0x4286d8[_0x4ec831(0x1f0)]&&(_0x6aea12[_0x4ec831(0x1e5)]&&!_0x6aea12[_0x4ec831(0x1e5)][_0x4ec831(0x1e8)](_0x4286d8[_0x4ec831(0x1f0)])&&_0x3c0591[_0x4ec831(0x1c1)](createIssue(_0x4ec831(0x1ff),_0x13347a+'.next','INVALID_NEXT_REFERENCE',_0x4ec831(0x192)+_0x4286d8[_0x4ec831(0x1f0)]+'\x27',_0x6aea12)));switch(_0x4286d8[_0x4ec831(0x1f2)]){case _0x4ec831(0x1c8):_0x3c0591[_0x4ec831(0x1c1)](...validateWaitStep(_0x4286d8,_0x13347a,_0x6aea12,_0x2c243f));break;case'activation':_0x3c0591[_0x4ec831(0x1c1)](...validateActivationStep(_0x4286d8,_0x13347a,_0x6aea12));break;case _0x4ec831(0x1ac):_0x3c0591[_0x4ec831(0x1c1)](...validateDecisionPointStep(_0x4286d8,_0x13347a,_0x6aea12,_0x2c243f));break;case'ab_test':_0x3c0591[_0x4ec831(0x1c1)](...validateAbTestStep(_0x4286d8,_0x13347a,_0x6aea12,_0x2c243f));break;case _0x4ec831(0x203):_0x3c0591[_0x4ec831(0x1c1)](...validateJumpStep(_0x4286d8,_0x13347a,_0x6aea12));break;}return _0x3c0591;}function validateWaitStep(_0x58f043,_0x2f10a1,_0x259330,_0x2ce6a4){const _0x454fb7=a145_0x2ecc,_0x53ee71=[];if(!_0x58f043[_0x454fb7(0x1dc)])return _0x53ee71[_0x454fb7(0x1c1)](createIssue(_0x454fb7(0x1ff),_0x2f10a1+'.with','MISSING_WAIT_PARAMS',_0x454fb7(0x174),_0x259330,_0x2f10a1)),_0x53ee71;if(_0x58f043[_0x454fb7(0x1dc)]['condition']){const _0x5ee0f6=_0x58f043[_0x454fb7(0x1dc)][_0x454fb7(0x179)];if(_0x5ee0f6[_0x454fb7(0x170)]){_0x259330[_0x454fb7(0x1c5)]?.[_0x454fb7(0x1b1)](_0x5ee0f6['segment']);!_0x5ee0f6['segment']['startsWith'](_0x454fb7(0x20a))&&(_0x259330[_0x454fb7(0x185)]&&!_0x259330[_0x454fb7(0x185)][_0x454fb7(0x1e8)](_0x5ee0f6[_0x454fb7(0x170)])&&_0x53ee71['push'](createIssue(_0x454fb7(0x1ff),_0x2f10a1+_0x454fb7(0x1ee),_0x454fb7(0x16e),'Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x5ee0f6['segment']+_0x454fb7(0x164),_0x259330)));_0x5ee0f6[_0x454fb7(0x1f0)]&&_0x259330[_0x454fb7(0x1e5)]&&!_0x259330[_0x454fb7(0x1e5)]['has'](_0x5ee0f6[_0x454fb7(0x1f0)])&&_0x53ee71['push'](createIssue('error',_0x2f10a1+_0x454fb7(0x16b),_0x454fb7(0x1c9),'Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x5ee0f6[_0x454fb7(0x1f0)]+'\x27',_0x259330));_0x5ee0f6[_0x454fb7(0x1a5)]?.[_0x454fb7(0x1f0)]&&_0x259330[_0x454fb7(0x1e5)]&&!_0x259330['stepNames'][_0x454fb7(0x1e8)](_0x5ee0f6[_0x454fb7(0x1a5)]['next'])&&_0x53ee71[_0x454fb7(0x1c1)](createIssue(_0x454fb7(0x1ff),_0x2f10a1+'.with.condition.timeout.next',_0x454fb7(0x1c9),_0x454fb7(0x1fb)+_0x5ee0f6[_0x454fb7(0x1a5)][_0x454fb7(0x1f0)]+'\x27',_0x259330));const _0x11cf1c=_0x5ee0f6[_0x454fb7(0x1f0)]||_0x58f043[_0x454fb7(0x1f0)],_0x564ee9=_0x5ee0f6[_0x454fb7(0x1a5)]?.['next']||_0x58f043[_0x454fb7(0x1f0)];if(_0x11cf1c){const _0x2df811=_0x2ce6a4[_0x454fb7(0x19c)](_0x11cf1c);_0x2df811?.[_0x454fb7(0x1f2)]===_0x454fb7(0x17f)&&_0x53ee71[_0x454fb7(0x1c1)](createIssue('warning',_0x2f10a1+_0x454fb7(0x16b),'BRANCH_DIRECTLY_TO_MERGE',_0x454fb7(0x175)+_0x11cf1c+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x259330,_0x2f10a1+_0x454fb7(0x1f3)));}if(_0x564ee9){const _0x264daf=_0x2ce6a4[_0x454fb7(0x19c)](_0x564ee9);_0x264daf?.[_0x454fb7(0x1f2)]==='merge'&&_0x53ee71[_0x454fb7(0x1c1)](createIssue(_0x454fb7(0x1f1),_0x2f10a1+_0x454fb7(0x176),'BRANCH_DIRECTLY_TO_MERGE',_0x454fb7(0x1d6)+_0x564ee9+_0x454fb7(0x17b),_0x259330,_0x2f10a1+_0x454fb7(0x173)));}}}return _0x53ee71;}function validateActivationStep(_0x157970,_0x55c31c,_0x236881){const _0x517bf2=a145_0x2ecc,_0x28e4ba=[];if(!_0x157970[_0x517bf2(0x1dc)]?.[_0x517bf2(0x1a9)])return _0x28e4ba[_0x517bf2(0x1c1)](createIssue('error',_0x55c31c+_0x517bf2(0x1b0),_0x517bf2(0x193),_0x517bf2(0x1e6),_0x236881,_0x55c31c)),_0x28e4ba;const _0x5633d8=_0x157970[_0x517bf2(0x1dc)][_0x517bf2(0x1a9)];return _0x236881[_0x517bf2(0x1f6)]&&!_0x5633d8['startsWith'](_0x517bf2(0x20a))&&(!_0x236881[_0x517bf2(0x1f6)][_0x517bf2(0x1e8)](_0x5633d8)&&_0x28e4ba[_0x517bf2(0x1c1)](createIssue(_0x517bf2(0x1ff),_0x55c31c+_0x517bf2(0x1b0),_0x517bf2(0x197),_0x517bf2(0x19a)+_0x5633d8+_0x517bf2(0x1a8),_0x236881))),_0x28e4ba;}function validateDecisionPointStep(_0x53f15a,_0x4d0620,_0x1c797b,_0x5afb22){const _0x2b0e95=a145_0x2ecc,_0xaf35f0=[];if(!_0x53f15a[_0x2b0e95(0x1dc)]?.[_0x2b0e95(0x1f8)]||_0x53f15a[_0x2b0e95(0x1dc)][_0x2b0e95(0x1f8)][_0x2b0e95(0x1a7)]===0x0)return _0xaf35f0[_0x2b0e95(0x1c1)](createIssue(_0x2b0e95(0x1ff),_0x4d0620+_0x2b0e95(0x1c2),_0x2b0e95(0x213),_0x2b0e95(0x200),_0x1c797b,_0x4d0620)),_0xaf35f0;for(let _0x248a6e=0x0;_0x248a6e<_0x53f15a[_0x2b0e95(0x1dc)][_0x2b0e95(0x1f8)]['length'];_0x248a6e++){const _0xd0f4ee=_0x53f15a[_0x2b0e95(0x1dc)][_0x2b0e95(0x1f8)][_0x248a6e],_0x87e9ff=_0x4d0620+_0x2b0e95(0x172)+_0x248a6e+']';_0xd0f4ee[_0x2b0e95(0x170)]&&!_0xd0f4ee[_0x2b0e95(0x20f)]&&(_0x1c797b['referencedSegments']?.['add'](_0xd0f4ee[_0x2b0e95(0x170)]),!_0xd0f4ee[_0x2b0e95(0x170)][_0x2b0e95(0x17e)]('ref:')&&(_0x1c797b[_0x2b0e95(0x185)]&&!_0x1c797b[_0x2b0e95(0x185)][_0x2b0e95(0x1e8)](_0xd0f4ee[_0x2b0e95(0x170)])&&_0xaf35f0[_0x2b0e95(0x1c1)](createIssue(_0x2b0e95(0x1ff),_0x87e9ff+'.segment',_0x2b0e95(0x16e),_0x2b0e95(0x167)+_0xd0f4ee[_0x2b0e95(0x170)]+'\x27',_0x1c797b))));_0xd0f4ee[_0x2b0e95(0x1f0)]&&_0x1c797b[_0x2b0e95(0x1e5)]&&!_0x1c797b[_0x2b0e95(0x1e5)][_0x2b0e95(0x1e8)](_0xd0f4ee[_0x2b0e95(0x1f0)])&&_0xaf35f0[_0x2b0e95(0x1c1)](createIssue(_0x2b0e95(0x1ff),_0x87e9ff+_0x2b0e95(0x1a1),'INVALID_NEXT_REFERENCE',_0x2b0e95(0x169)+_0xd0f4ee[_0x2b0e95(0x1f0)]+'\x27',_0x1c797b));if(_0xd0f4ee[_0x2b0e95(0x1f0)]){const _0x42c31e=_0x5afb22['get'](_0xd0f4ee[_0x2b0e95(0x1f0)]);_0x42c31e?.[_0x2b0e95(0x1f2)]===_0x2b0e95(0x17f)&&_0xaf35f0[_0x2b0e95(0x1c1)](createIssue(_0x2b0e95(0x1f1),_0x87e9ff+_0x2b0e95(0x1a1),_0x2b0e95(0x194),'Decision\x20branch\x20\x27'+_0xd0f4ee[_0x2b0e95(0x1e4)]+_0x2b0e95(0x18f)+_0xd0f4ee['next']+_0x2b0e95(0x1bf),_0x1c797b));}}return _0xaf35f0;}function validateAbTestStep(_0x3122ad,_0x1e4ed0,_0x151c2b,_0x51f0c8){const _0x2a0fc6=a145_0x2ecc,_0x45de24=[];if(!_0x3122ad[_0x2a0fc6(0x1dc)]?.['variants']||_0x3122ad[_0x2a0fc6(0x1dc)][_0x2a0fc6(0x171)][_0x2a0fc6(0x1a7)]===0x0)return _0x45de24[_0x2a0fc6(0x1c1)](createIssue(_0x2a0fc6(0x1ff),_0x1e4ed0+_0x2a0fc6(0x1cb),_0x2a0fc6(0x213),'A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x151c2b,_0x1e4ed0)),_0x45de24;const _0x457c23=_0x3122ad['with'][_0x2a0fc6(0x171)][_0x2a0fc6(0x1fc)]((_0x379300,_0x203f3b)=>_0x379300+(_0x203f3b['percentage']||0x0),0x0);Math[_0x2a0fc6(0x190)](_0x457c23-0x64)>0.01&&_0x45de24[_0x2a0fc6(0x1c1)](createIssue(_0x2a0fc6(0x1ff),_0x1e4ed0+_0x2a0fc6(0x1cb),_0x2a0fc6(0x18d),_0x2a0fc6(0x1e7)+_0x457c23+'%)',_0x151c2b));for(let _0x12ac69=0x0;_0x12ac69<_0x3122ad[_0x2a0fc6(0x1dc)]['variants']['length'];_0x12ac69++){const _0x5be158=_0x3122ad[_0x2a0fc6(0x1dc)][_0x2a0fc6(0x171)][_0x12ac69],_0x418c73=_0x1e4ed0+_0x2a0fc6(0x1bb)+_0x12ac69+']';_0x5be158[_0x2a0fc6(0x1f0)]&&_0x151c2b[_0x2a0fc6(0x1e5)]&&!_0x151c2b[_0x2a0fc6(0x1e5)][_0x2a0fc6(0x1e8)](_0x5be158[_0x2a0fc6(0x1f0)])&&_0x45de24[_0x2a0fc6(0x1c1)](createIssue('error',_0x418c73+'.next',_0x2a0fc6(0x1c9),_0x2a0fc6(0x189)+_0x5be158[_0x2a0fc6(0x1f0)]+'\x27',_0x151c2b));if(_0x5be158['next']){const _0x135f52=_0x51f0c8[_0x2a0fc6(0x19c)](_0x5be158[_0x2a0fc6(0x1f0)]);_0x135f52?.[_0x2a0fc6(0x1f2)]==='merge'&&_0x45de24[_0x2a0fc6(0x1c1)](createIssue(_0x2a0fc6(0x1f1),_0x418c73+_0x2a0fc6(0x1a1),_0x2a0fc6(0x194),_0x2a0fc6(0x1d5)+_0x5be158[_0x2a0fc6(0x1e4)]+_0x2a0fc6(0x18f)+_0x5be158[_0x2a0fc6(0x1f0)]+_0x2a0fc6(0x1bf),_0x151c2b));}}return _0x45de24;}function validateJumpStep(_0x4f148a,_0x152db3,_0x394489){const _0x543de8=a145_0x2ecc,_0x1d3a8e=[];if(!_0x4f148a[_0x543de8(0x1dc)]?.['target'])return _0x1d3a8e[_0x543de8(0x1c1)](createIssue('error',_0x152db3+_0x543de8(0x1fe),'INVALID_JUMP_TARGET',_0x543de8(0x206),_0x394489,_0x152db3)),_0x1d3a8e;return(!_0x4f148a[_0x543de8(0x1dc)][_0x543de8(0x1d3)][_0x543de8(0x16c)]||!_0x4f148a['with'][_0x543de8(0x1d3)][_0x543de8(0x166)])&&_0x1d3a8e[_0x543de8(0x1c1)](createIssue(_0x543de8(0x1ff),_0x152db3+'.with.target',_0x543de8(0x195),'Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names',_0x394489)),_0x1d3a8e;}function buildConvergenceMap(_0x328588){const _0x303137=a145_0x2ecc,_0x303041=new Map();function _0x241a14(_0x289ed7,_0x52ac2d){const _0x583da2=a145_0x2ecc,_0x497fa3=_0x303041[_0x583da2(0x19c)](_0x289ed7)||[];_0x497fa3[_0x583da2(0x1c1)](_0x52ac2d),_0x303041[_0x583da2(0x17d)](_0x289ed7,_0x497fa3);}for(const _0x1c97b4 of _0x328588){_0x1c97b4[_0x303137(0x1f0)]&&_0x241a14(_0x1c97b4[_0x303137(0x1f0)],{'stepName':_0x1c97b4[_0x303137(0x1e4)],'description':_0x303137(0x1ec)+_0x1c97b4[_0x303137(0x1e4)]+'\x27'});if(_0x1c97b4[_0x303137(0x1f2)]===_0x303137(0x1ac)&&_0x1c97b4['with']?.[_0x303137(0x1f8)])for(const _0x2189ea of _0x1c97b4['with']['branches']){_0x2189ea[_0x303137(0x1f0)]&&_0x241a14(_0x2189ea[_0x303137(0x1f0)],{'stepName':_0x1c97b4[_0x303137(0x1e4)],'description':_0x303137(0x1d9)+_0x2189ea[_0x303137(0x1e4)]+'\x27\x20of\x20\x27'+_0x1c97b4[_0x303137(0x1e4)]+'\x27'});}if(_0x1c97b4[_0x303137(0x1f2)]===_0x303137(0x216)&&_0x1c97b4['with']?.[_0x303137(0x171)])for(const _0xd94b51 of _0x1c97b4[_0x303137(0x1dc)][_0x303137(0x171)]){_0xd94b51[_0x303137(0x1f0)]&&_0x241a14(_0xd94b51['next'],{'stepName':_0x1c97b4[_0x303137(0x1e4)],'description':'variant\x20\x27'+_0xd94b51[_0x303137(0x1e4)]+'\x27\x20of\x20\x27'+_0x1c97b4[_0x303137(0x1e4)]+'\x27'});}_0x1c97b4[_0x303137(0x1f2)]===_0x303137(0x1c8)&&_0x1c97b4['with']?.[_0x303137(0x179)]&&(_0x1c97b4[_0x303137(0x1dc)][_0x303137(0x179)][_0x303137(0x1f0)]&&_0x241a14(_0x1c97b4[_0x303137(0x1dc)][_0x303137(0x179)][_0x303137(0x1f0)],{'stepName':_0x1c97b4['name'],'description':_0x303137(0x202)+_0x1c97b4['name']+'\x27'}),_0x1c97b4[_0x303137(0x1dc)][_0x303137(0x179)][_0x303137(0x1a5)]?.[_0x303137(0x1f0)]&&_0x241a14(_0x1c97b4[_0x303137(0x1dc)]['condition'][_0x303137(0x1a5)][_0x303137(0x1f0)],{'stepName':_0x1c97b4[_0x303137(0x1e4)],'description':_0x303137(0x182)+_0x1c97b4['name']+'\x27'}));}return _0x303041;}function validateFlowControl(_0x1b1bb9,_0xea7682,_0x39a770){const _0x32e410=a145_0x2ecc,_0x14bfe8=[],_0x49f2f6=_0x32e410(0x186)+_0xea7682+']',_0x7b7844=_0x1b1bb9[_0x32e410(0x1c7)]||[];if(_0x7b7844[_0x32e410(0x1a7)]===0x0)return _0x14bfe8;const _0xe4fb5=new Map();for(const _0xf332da of _0x7b7844){_0xf332da['name']&&_0xe4fb5[_0x32e410(0x17d)](_0xf332da[_0x32e410(0x1e4)],_0xf332da);}const _0x7cafae=buildConvergenceMap(_0x7b7844),_0x5ccae7=_0x7b7844[_0x32e410(0x1b4)](_0x94a318=>_0x94a318[_0x32e410(0x1f2)]==='end');!_0x5ccae7&&_0x14bfe8[_0x32e410(0x1c1)](createIssue(_0x32e410(0x1ff),_0x49f2f6+'.steps','MISSING_END_STEP',_0x32e410(0x1a3)+_0x1b1bb9[_0x32e410(0x1e4)]+_0x32e410(0x217),_0x39a770));for(const [_0x400b76,_0x257f2a]of _0x7cafae){const _0x356700=_0xe4fb5['get'](_0x400b76);if(!_0x356700)continue;if(_0x257f2a['length']>0x1&&_0x356700[_0x32e410(0x1f2)]!==_0x32e410(0x17f)){const _0x436c01=_0x257f2a['map'](_0x5f3def=>_0x5f3def['description'])[_0x32e410(0x181)](',\x20');_0x14bfe8[_0x32e410(0x1c1)](createIssue(_0x32e410(0x1ff),_0x49f2f6+_0x32e410(0x187),_0x32e410(0x1fd),'Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27'+_0x400b76+'\x27\x20(from:\x20'+_0x436c01+_0x32e410(0x1c6),_0x39a770));}_0x257f2a['length']===0x1&&_0x356700[_0x32e410(0x1f2)]===_0x32e410(0x17f)&&_0x14bfe8[_0x32e410(0x1c1)](createIssue('warning',_0x49f2f6+_0x32e410(0x187),_0x32e410(0x18b),_0x32e410(0x1d0)+_0x400b76+_0x32e410(0x1e9)+_0x257f2a[0x0]['description']+_0x32e410(0x1cd),_0x39a770));}for(const _0x3411c8 of _0x7b7844){if(_0x3411c8[_0x32e410(0x1f2)]===_0x32e410(0x17f)&&_0x3411c8[_0x32e410(0x1f0)]){const _0x5c191a=_0xe4fb5['get'](_0x3411c8['next']);_0x5c191a?.[_0x32e410(0x1f2)]===_0x32e410(0x17f)&&_0x14bfe8[_0x32e410(0x1c1)](createIssue(_0x32e410(0x1ff),_0x49f2f6+'.steps','MERGE_TO_MERGE_CHAIN',_0x32e410(0x1d0)+_0x3411c8[_0x32e410(0x1e4)]+'\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27'+_0x3411c8['next']+_0x32e410(0x1bd),_0x39a770));}}return _0x14bfe8;}function validateCriteria(_0x2fbb91,_0x4b035d,_0x3e5c09){const _0x5996a3=a145_0x2ecc,_0x4513e3=[];return _0x2fbb91[_0x5996a3(0x170)]&&(_0x3e5c09['referencedSegments']?.[_0x5996a3(0x1b1)](_0x2fbb91['segment']),!_0x2fbb91[_0x5996a3(0x170)][_0x5996a3(0x17e)](_0x5996a3(0x20a))&&(_0x3e5c09[_0x5996a3(0x185)]&&!_0x3e5c09['embeddedSegments'][_0x5996a3(0x1e8)](_0x2fbb91[_0x5996a3(0x170)])&&_0x4513e3['push'](createIssue('error',_0x4b035d+'.segment','MISSING_SEGMENT_REFERENCE','Criteria\x20references\x20undefined\x20segment\x20\x27'+_0x2fbb91[_0x5996a3(0x170)]+'\x27',_0x3e5c09)))),_0x4513e3;}function validateEmbeddedSegment(_0xb082be,_0x7bb3ff,_0x477396){const _0x3ba7d3=a145_0x2ecc,_0x1dd91d=[];return _0xb082be[_0x3ba7d3(0x198)]&&_0x1dd91d[_0x3ba7d3(0x1c1)](...validateRuleDef(_0xb082be[_0x3ba7d3(0x198)],_0x7bb3ff+_0x3ba7d3(0x1eb),_0x477396)),_0x1dd91d;}function validateStage(_0x4e4724,_0x6c8f64,_0x1a8735,_0x2c5caf){const _0x1544db=a145_0x2ecc,_0xc4d280=[],_0x39d33c='stages['+_0x6c8f64+']',_0x1f90e4=new Map(),_0x53a13b=new Map();if(_0x4e4724[_0x1544db(0x1c7)]){for(let _0x41ff69=0x0;_0x41ff69<_0x4e4724[_0x1544db(0x1c7)][_0x1544db(0x1a7)];_0x41ff69++){const _0x318190=_0x4e4724[_0x1544db(0x1c7)][_0x41ff69];_0x318190['name']&&_0x1f90e4[_0x1544db(0x17d)](_0x318190[_0x1544db(0x1e4)],_0x318190);}for(let _0x8bacfa=0x0;_0x8bacfa<_0x4e4724[_0x1544db(0x1c7)][_0x1544db(0x1a7)];_0x8bacfa++){const _0x436603=_0x4e4724[_0x1544db(0x1c7)][_0x8bacfa],_0xeb1c0b=_0x39d33c+_0x1544db(0x1a6)+_0x8bacfa+']';if(_0x436603['name']){if(_0x53a13b['has'](_0x436603[_0x1544db(0x1e4)])){const _0x743c85=_0x53a13b['get'](_0x436603[_0x1544db(0x1e4)]);_0xc4d280[_0x1544db(0x1c1)](createIssue(_0x1544db(0x1ff),_0xeb1c0b+_0x1544db(0x16d),'DUPLICATE_STEP_NAME',_0x1544db(0x219)+_0x436603[_0x1544db(0x1e4)]+'\x27\x20(first\x20defined\x20at\x20steps['+_0x743c85+'])',_0x2c5caf));}else _0x53a13b[_0x1544db(0x17d)](_0x436603[_0x1544db(0x1e4)],_0x8bacfa);}_0xc4d280[_0x1544db(0x1c1)](...validateStep(_0x436603,_0xeb1c0b,_0x2c5caf,_0x1f90e4));}}_0x4e4724[_0x1544db(0x1d7)]&&_0xc4d280[_0x1544db(0x1c1)](...validateCriteria(_0x4e4724[_0x1544db(0x1d7)],_0x39d33c+_0x1544db(0x1a4),_0x2c5caf));if(_0x4e4724['exit_criteria'])for(let _0x585081=0x0;_0x585081<_0x4e4724[_0x1544db(0x1f4)][_0x1544db(0x1a7)];_0x585081++){_0xc4d280[_0x1544db(0x1c1)](...validateCriteria(_0x4e4724[_0x1544db(0x1f4)][_0x585081],_0x39d33c+_0x1544db(0x1d4)+_0x585081+']',_0x2c5caf));}return _0x4e4724[_0x1544db(0x1ce)]&&_0xc4d280['push'](...validateCriteria(_0x4e4724['milestone'],_0x39d33c+_0x1544db(0x178),_0x2c5caf)),_0xc4d280[_0x1544db(0x1c1)](...validateStageStructure(_0x4e4724,_0x6c8f64,_0x1a8735,_0x2c5caf)),_0xc4d280[_0x1544db(0x1c1)](...validateFlowControl(_0x4e4724,_0x6c8f64,_0x2c5caf)),_0xc4d280;}function validateStagesForVersion(_0xb22838,_0x27e32b,_0x2f17e0,_0x51500d,_0x2c030e,_0x30d5f6,_0x70f621){const _0x77efc9=a145_0x2ecc;if(_0xb22838[_0x77efc9(0x1a7)]===0x0){_0x2c030e[_0x77efc9(0x1c1)]({'level':'error','path':_0x51500d+_0x77efc9(0x1b3),'code':'MISSING_STAGES','message':_0x77efc9(0x209),'location':getLocationFromPath(_0x2f17e0[_0x77efc9(0x1da)],_0x2f17e0[_0x77efc9(0x20d)],[_0x77efc9(0x1b3)])});return;}const _0x2d0837=new Set();for(const _0x349565 of _0xb22838){if(_0x349565['steps'])for(const _0x3badf5 of _0x349565[_0x77efc9(0x1c7)]){_0x3badf5[_0x77efc9(0x1e4)]&&_0x2d0837['add'](_0x3badf5[_0x77efc9(0x1e4)]);}}const _0x13008c={..._0x2f17e0,'stepNames':_0x2d0837},_0x1b9ab9=validateVersionStructure(_0xb22838,_0x13008c);for(const _0x5c8e3f of _0x1b9ab9){const _0xf5aa73=_0x51500d?{..._0x5c8e3f,'path':''+_0x51500d+_0x5c8e3f['path']}:_0x5c8e3f;if(_0xf5aa73[_0x77efc9(0x1bc)]==='error')_0x2c030e[_0x77efc9(0x1c1)](_0xf5aa73);else _0x30d5f6[_0x77efc9(0x1c1)](_0xf5aa73);}for(let _0x5b3138=0x0;_0x5b3138<_0xb22838[_0x77efc9(0x1a7)];_0x5b3138++){const _0x8bb0b3=validateStage(_0xb22838[_0x5b3138],_0x5b3138,_0xb22838[_0x77efc9(0x1a7)],_0x13008c);for(const _0x4251b3 of _0x8bb0b3){const _0x29af85=_0x51500d?{..._0x4251b3,'path':''+_0x51500d+_0x4251b3[_0x77efc9(0x1ae)]}:_0x4251b3;if(_0x29af85[_0x77efc9(0x1bc)]===_0x77efc9(0x1ff))_0x2c030e[_0x77efc9(0x1c1)](_0x29af85);else _0x30d5f6['push'](_0x29af85);}}if(_0x27e32b[_0x77efc9(0x18a)]){const _0x53262b=_0x70f621?.['goalIsInherited']?'goal':_0x51500d+_0x77efc9(0x18a),_0x51610c=validateCriteria(_0x27e32b[_0x77efc9(0x18a)],_0x53262b,_0x13008c);for(const _0x20902d of _0x51610c){if(_0x20902d[_0x77efc9(0x1bc)]===_0x77efc9(0x1ff))_0x2c030e[_0x77efc9(0x1c1)](_0x20902d);else _0x30d5f6[_0x77efc9(0x1c1)](_0x20902d);}}}function extractVersionIndex(_0x1dcb7f){const _0x3fde18=_0x1dcb7f['match'](/^journeys\[(\d+)\]\./);return _0x3fde18?_0x3fde18[0x1]:undefined;}function deduplicateAcrossVersions(_0x305126){const _0x1d2a83=a145_0x2ecc,_0x462967=new Map();for(let _0x3162bc=0x0;_0x3162bc<_0x305126[_0x1d2a83(0x1a7)];_0x3162bc++){const _0x18cfff=_0x305126[_0x3162bc][_0x1d2a83(0x215)]+':'+_0x305126[_0x3162bc]['message'],_0x5c1c17=extractVersionIndex(_0x305126[_0x3162bc]['path']),_0x14b587=_0x462967[_0x1d2a83(0x19c)](_0x18cfff);if(_0x14b587){_0x14b587[_0x1d2a83(0x1ab)][_0x1d2a83(0x1c1)](_0x3162bc);if(_0x5c1c17)_0x14b587[_0x1d2a83(0x1e1)]['add'](_0x5c1c17);}else _0x462967[_0x1d2a83(0x17d)](_0x18cfff,{'indices':[_0x3162bc],'versions':new Set(_0x5c1c17?[_0x5c1c17]:[])});}const _0x973af4=new Set();for(const {indices:_0x2b9827,versions:_0x30c82f}of _0x462967['values']()){if(_0x30c82f[_0x1d2a83(0x1f7)]<=0x1)continue;const _0x5394b4=_0x305126[_0x2b9827[0x0]];_0x5394b4[_0x1d2a83(0x1ae)]=_0x5394b4[_0x1d2a83(0x1ae)][_0x1d2a83(0x1b5)](/^journeys\[\d+\]\./,''),_0x5394b4['message']=_0x5394b4['message']+_0x1d2a83(0x1e3)+_0x30c82f[_0x1d2a83(0x1f7)]+_0x1d2a83(0x191);for(let _0x30839f=0x1;_0x30839f<_0x2b9827[_0x1d2a83(0x1a7)];_0x30839f++){_0x973af4['add'](_0x2b9827[_0x30839f]);}}const _0x2f9902=[..._0x973af4]['sort']((_0x4773c7,_0x2a4d9c)=>_0x2a4d9c-_0x4773c7);for(const _0x7baef1 of _0x2f9902){_0x305126[_0x1d2a83(0x1d2)](_0x7baef1,0x1);}}export function validateJourneyDef(_0x436b7e,_0x44d543={},_0x34c5ea={}){const _0x105aec=a145_0x2ecc;if(_0x34c5ea[_0x105aec(0x1b9)])return runJourneySemanticChecks(_0x436b7e,_0x44d543);const _0x348762=JourneyDefSchema[_0x105aec(0x1de)](_0x436b7e);if(_0x348762[_0x105aec(0x1a0)])return runJourneySemanticChecks(_0x348762[_0x105aec(0x1b6)],_0x44d543);return zodErrorsToJourneyValidationResult(_0x348762[_0x105aec(0x1ff)],_0x44d543);}function zodErrorsToJourneyValidationResult(_0x425e1a,_0x35a1b9){const _0x75fcdf=a145_0x2ecc,_0x136f20=flattenZodIssues(_0x425e1a['issues']),_0x1bdbed=_0x136f20[_0x75fcdf(0x1e0)](_0x57a431=>{const _0x5acea7=_0x75fcdf,_0x30d020=formatZodPath(_0x57a431['path']),_0x320b71=mapJourneyZodIssueToCode(_0x57a431,_0x30d020),_0x41802d=getLocationFromPath(_0x35a1b9['document'],_0x35a1b9[_0x5acea7(0x20d)],_0x57a431['path'][_0x5acea7(0x1e0)](_0x6d3db0=>typeof _0x6d3db0===_0x5acea7(0x1b2)?String(_0x6d3db0):_0x6d3db0));return{'level':_0x5acea7(0x1ff),'path':_0x30d020,'code':_0x320b71,'message':_0x57a431[_0x5acea7(0x1be)],..._0x41802d&&{'location':_0x41802d}};});return{'valid':![],'errors':_0x1bdbed,'warnings':[]};}function a145_0x566c(){const _0x48140c=['error','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','MISSING_NAME','condition\x20of\x20\x27','jump','DUPLICATE_LATEST','FEW_STEPS','Jump\x20step\x20requires\x20a\x20target','journey\x20entry','INSUFFICIENT_STEPS','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','ref:','27DhDncy','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','source','state','excluded','journeys,\x20stages,\x20or\x20versions','version','1303090KVwUdz','MISSING_CONDITIONS','\x27\x20has\x20only\x20','code','ab_test','\x27\x20has\x20no\x20end\x20step','latest','Duplicate\x20step\x20name\x20\x27','segments','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','MISSING_GOAL','stage','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','3594900VTYtGj','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','versions[','.with.condition.next','journey','.name','MISSING_SEGMENT_REFERENCE','\x27\x20has\x20no\x20exit_criteria\x20defined','segment','variants','.with.branches[','.with.condition.timeout','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.with.condition.timeout.next','\x27\x20has\x20no\x20steps','.milestone','condition','keys','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','set','startsWith','merge','TOO_MANY_STAGES','join','timeout\x20of\x20\x27','endsWith','.type','embeddedSegments','stages[','.steps','Journey\x20can\x20have\x20at\x20most\x20one\x20','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','goal','SINGLE_INPUT_MERGE','Journey\x20name\x20is\x20required','INVALID_AB_TEST_PERCENTAGES','7116yAklcM','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','abs','\x20versions)','Step\x20references\x20non-existent\x20step\x20\x27','MISSING_ACTIVATION_REF','BRANCH_DIRECTLY_TO_MERGE','INVALID_JUMP_TARGET','activations','MISSING_ACTIVATION_DEFINITION','rule','includes','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','\x20stages\x20but\x20maximum\x20is\x20','get','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','.with','excluded_','success','.next','Embedded\x20segment\x20\x27','Stage\x20\x27','.entry_criteria','timeout','.steps[','length','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','activation','filter','indices','decision_point','segments.','path','journeys','.with.activation','add','symbol','stages','some','replace','data','END_STEP_HAS_NEXT_OR_WITH','.stages','skipSchema','\x20with\x20latest:\x20true','.with.variants[','level','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','message','\x27\x20with\x20no\x20action\x20in\x20between','40rZRMjC','push','.with.branches','launched','entries','referencedSegments',').\x20Use\x20a\x20merge\x20step.','steps','wait','INVALID_NEXT_REFERENCE','1mLamBc','.with.variants','JOURNEY_SCHEMA_ERROR',').\x20Merge\x20is\x20unnecessary.','milestone','MISSING_EXIT_CRITERIA','Merge\x20step\x20\x27','1552671rkdopt','splice','target','.exit_criteria[','A/B\x20test\x20variant\x20\x27','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','entry_criteria','28328290imKKHk','branch\x20\x27','document','MISSING_ENTRY_CRITERIA','with','End\x20step\x20\x27','safeParse','1682988rzVbUk','map','versions','Journey\x20has\x20','\x20(across\x20','name','stepNames','Activation\x20step\x20requires\x20an\x20activation\x20reference','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','has','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','MISSING_STAGES','.rule','step\x20\x27','journeys[','.with.condition.segment','\x20steps\x20(may\x20be\x20too\x20simple)','next','warning','type','.with.condition','exit_criteria','2183055EgAxSi','activationKeys','size','branches','MISSING_MILESTONE','.exit_criteria','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','reduce','CONVERGENCE_WITHOUT_MERGE','.with.target'];a145_0x566c=function(){return _0x48140c;};return a145_0x566c();}function mapJourneyZodIssueToCode(_0xe27bcb,_0x338dc){const _0x24a2e9=a145_0x2ecc;if(_0x338dc===_0x24a2e9(0x1e4))return _0x24a2e9(0x201);if(_0x338dc[_0x24a2e9(0x183)](_0x24a2e9(0x184))&&_0x338dc[_0x24a2e9(0x199)](_0x24a2e9(0x1c7)))return _0x24a2e9(0x1cc);if(_0x338dc===_0x24a2e9(0x1b3)||_0x338dc[_0x24a2e9(0x183)](_0x24a2e9(0x1b8)))return _0x24a2e9(0x1ea);if(_0x338dc===''&&_0xe27bcb['message'][_0x24a2e9(0x199)](_0x24a2e9(0x210)))return _0x24a2e9(0x1ea);if(_0x338dc[_0x24a2e9(0x199)]('activation'))return'ACTIVATION_SCHEMA_ERROR';return _0x24a2e9(0x1cc);}function runJourneySemanticChecks(_0x120e44,_0x402fae){const _0x4d4220=a145_0x2ecc,_0x443d1d=[],_0x553713=[];(!_0x120e44['name']||_0x120e44[_0x4d4220(0x1e4)]['trim']()==='')&&_0x443d1d[_0x4d4220(0x1c1)]({'level':_0x4d4220(0x1ff),'path':_0x4d4220(0x1e4),'code':_0x4d4220(0x201),'message':_0x4d4220(0x18c),'location':getLocationFromPath(_0x402fae[_0x4d4220(0x1da)],_0x402fae[_0x4d4220(0x20d)],['name'])});const _0x279c06=new Set();if(_0x120e44['segments'])for(const _0x5ab765 of Object[_0x4d4220(0x17a)](_0x120e44['segments'])){_0x279c06[_0x4d4220(0x1b1)](_0x5ab765);}const _0x88a95=new Set();if(_0x120e44[_0x4d4220(0x196)])for(const _0x17ba34 of Object[_0x4d4220(0x17a)](_0x120e44[_0x4d4220(0x196)])){_0x88a95[_0x4d4220(0x1b1)](_0x17ba34);}const _0x3fe01b=new Set(),_0x51ae4e={..._0x402fae,'embeddedSegments':_0x279c06,'referencedSegments':_0x3fe01b,'activationKeys':_0x88a95[_0x4d4220(0x1f7)]>0x0?_0x88a95:undefined};if(_0x120e44[_0x4d4220(0x163)])for(const [_0x11cf48,_0x1174d4]of Object[_0x4d4220(0x1c4)](_0x120e44[_0x4d4220(0x163)])){const _0x3fa107=validateEmbeddedSegment(_0x1174d4,_0x4d4220(0x1ad)+_0x11cf48,_0x51ae4e);for(const _0x3bae1c of _0x3fa107){if(_0x3bae1c[_0x4d4220(0x1bc)]===_0x4d4220(0x1ff))_0x443d1d[_0x4d4220(0x1c1)](_0x3bae1c);else _0x553713[_0x4d4220(0x1c1)](_0x3bae1c);}}const _0x2425b6=!!_0x120e44[_0x4d4220(0x18a)],_0x45038a=_0x120e44['journeys']?.['every'](_0x2629a2=>!!_0x2629a2[_0x4d4220(0x18a)])??![];!_0x2425b6&&!_0x45038a&&_0x553713['push']({'level':_0x4d4220(0x1f1),'path':_0x4d4220(0x18a),'code':_0x4d4220(0x165),'message':'Journey\x20has\x20no\x20goal\x20defined','location':getLocationFromPath(_0x402fae[_0x4d4220(0x1da)],_0x402fae[_0x4d4220(0x20d)],[_0x4d4220(0x18a)])});const _0x34b451=_0x120e44[_0x4d4220(0x1af)]??_0x120e44[_0x4d4220(0x1e1)];if(_0x34b451&&_0x34b451[_0x4d4220(0x1aa)](_0xa30835=>_0xa30835[_0x4d4220(0x218)]===!![])[_0x4d4220(0x1a7)]>0x1){const _0x5ebcf6=_0x120e44[_0x4d4220(0x1af)]?_0x4d4220(0x1af):_0x4d4220(0x1e1);_0x443d1d['push']({'level':_0x4d4220(0x1ff),'path':_0x5ebcf6,'code':_0x4d4220(0x204),'message':_0x4d4220(0x188)+(_0x5ebcf6==='journeys'?_0x4d4220(0x207):_0x4d4220(0x211))+_0x4d4220(0x1ba),'location':getLocationFromPath(_0x402fae[_0x4d4220(0x1da)],_0x402fae[_0x4d4220(0x20d)],[_0x5ebcf6])});}if(_0x120e44[_0x4d4220(0x1af)]&&_0x120e44[_0x4d4220(0x1af)]['length']>0x0)for(let _0x5c2b77=0x0;_0x5c2b77<_0x120e44[_0x4d4220(0x1af)][_0x4d4220(0x1a7)];_0x5c2b77++){const _0x64ab62=_0x120e44[_0x4d4220(0x1af)][_0x5c2b77];if(_0x120e44[_0x4d4220(0x1af)]['length']>0x1&&_0x64ab62[_0x4d4220(0x20e)]===_0x4d4220(0x1c3))continue;const _0x629ab6=_0x64ab62['stages']||[],_0x4b859e=_0x4d4220(0x1ed)+_0x5c2b77+'].',_0x5cec5d=!!_0x64ab62[_0x4d4220(0x18a)],_0x3bec26=_0x5cec5d?{..._0x120e44,'goal':_0x64ab62[_0x4d4220(0x18a)]}:_0x120e44;validateStagesForVersion(_0x629ab6,_0x3bec26,_0x51ae4e,_0x4b859e,_0x443d1d,_0x553713,{'goalIsInherited':!_0x5cec5d});}else{if(_0x120e44[_0x4d4220(0x1e1)]&&_0x120e44[_0x4d4220(0x1e1)][_0x4d4220(0x1a7)]>0x0)for(let _0x2689be=0x0;_0x2689be<_0x120e44['versions'][_0x4d4220(0x1a7)];_0x2689be++){const _0x3087ad=_0x120e44[_0x4d4220(0x1e1)][_0x2689be];if(_0x120e44['versions'][_0x4d4220(0x1a7)]>0x1&&_0x3087ad['state']===_0x4d4220(0x1c3))continue;const _0xd5992f=_0x3087ad[_0x4d4220(0x1b3)]||[],_0x14d084=_0x4d4220(0x16a)+_0x2689be+'].';validateStagesForVersion(_0xd5992f,_0x120e44,_0x51ae4e,_0x14d084,_0x443d1d,_0x553713);}else{const _0x43ad0c=_0x120e44[_0x4d4220(0x1b3)]||[];validateStagesForVersion(_0x43ad0c,_0x120e44,_0x51ae4e,'',_0x443d1d,_0x553713);}}_0x120e44[_0x4d4220(0x1af)]&&_0x120e44[_0x4d4220(0x1af)]['length']>0x1&&(deduplicateAcrossVersions(_0x443d1d),deduplicateAcrossVersions(_0x553713));for(const _0x5b8630 of _0x279c06){!_0x3fe01b[_0x4d4220(0x1e8)](_0x5b8630)&&!_0x5b8630[_0x4d4220(0x17e)](_0x4d4220(0x19f))&&_0x553713[_0x4d4220(0x1c1)]({'level':_0x4d4220(0x1f1),'path':'segments.'+_0x5b8630,'code':'UNUSED_EMBEDDED_SEGMENT','message':_0x4d4220(0x1a2)+_0x5b8630+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x402fae[_0x4d4220(0x1da)],_0x402fae[_0x4d4220(0x20d)],[_0x4d4220(0x163),_0x5b8630])});}return{'valid':_0x443d1d[_0x4d4220(0x1a7)]===0x0,'errors':_0x443d1d,'warnings':_0x553713};}
@@ -1 +1 @@
1
- const a137_0x111164=a137_0x49f2;(function(_0x213711,_0x568361){const _0x130d02=a137_0x49f2,_0x517c70=_0x213711();while(!![]){try{const _0x47e9af=-parseInt(_0x130d02(0x119))/0x1*(parseInt(_0x130d02(0x128))/0x2)+parseInt(_0x130d02(0x10f))/0x3+parseInt(_0x130d02(0xf7))/0x4+-parseInt(_0x130d02(0xa0))/0x5*(-parseInt(_0x130d02(0xc7))/0x6)+parseInt(_0x130d02(0x118))/0x7+parseInt(_0x130d02(0xfa))/0x8*(-parseInt(_0x130d02(0xba))/0x9)+-parseInt(_0x130d02(0x11c))/0xa;if(_0x47e9af===_0x568361)break;else _0x517c70['push'](_0x517c70['shift']());}catch(_0x13788){_0x517c70['push'](_0x517c70['shift']());}}}(a137_0x1845,0x83925));import*as a137_0x460fb8 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x422342){const _0xc97c89=a137_0x49f2,_0x22bf91=_0x422342['toLowerCase']();if(_0x22bf91===_0xc97c89(0xa7)||_0x22bf91===_0xc97c89(0x11f))return _0xc97c89(0x11f);if(_0x22bf91===_0xc97c89(0xdd)||_0x22bf91===_0xc97c89(0x8d))return'week';return _0x422342;}export function journeyResponseToDefSync(_0x306973){const _0x16fcaa=a137_0x49f2,_0x35d542=_0x306973[_0x16fcaa(0xb0)],_0x3bc57b=_0x35d542[_0x16fcaa(0xd6)]||_0x35d542[_0x16fcaa(0xc3)],_0x11999f={'stages':_0x35d542[_0x16fcaa(0xc8)]['map'](convertApiStageToYaml),'id':_0x306973['id']};_0x35d542['goal']&&(_0x11999f[_0x16fcaa(0x13c)]=convertApiCriteriaToYaml(_0x35d542['goal']));_0x35d542[_0x16fcaa(0xc3)]&&_0x35d542[_0x16fcaa(0xc3)]!==_0x3bc57b&&(_0x11999f['version']=_0x35d542[_0x16fcaa(0xc3)]);_0x35d542[_0x16fcaa(0xf0)]!==undefined&&(_0x11999f[_0x16fcaa(0x7f)]=_0x35d542[_0x16fcaa(0xf0)]);_0x35d542[_0x16fcaa(0xea)]&&(_0x11999f[_0x16fcaa(0xea)]=_0x35d542['state']===_0x16fcaa(0x8e)?_0x16fcaa(0x8e):_0x16fcaa(0x8b));const _0x1ad1cc={'type':_0x16fcaa(0x125),'name':_0x3bc57b,'journeys':[_0x11999f]};_0x35d542['description']&&(_0x1ad1cc[_0x16fcaa(0x107)]=_0x35d542[_0x16fcaa(0x107)]);_0x35d542[_0x16fcaa(0x13c)]&&(_0x1ad1cc[_0x16fcaa(0x13c)]=convertApiCriteriaToYaml(_0x35d542[_0x16fcaa(0x13c)]));if(_0x35d542[_0x16fcaa(0xa5)])_0x1ad1cc[_0x16fcaa(0x100)]=_0x35d542[_0x16fcaa(0xa5)];else _0x35d542['allowReentry']!==undefined&&(_0x1ad1cc[_0x16fcaa(0x100)]=_0x35d542[_0x16fcaa(0xee)]?'reentry_always':'no_reentry');return _0x35d542[_0x16fcaa(0x114)]&&(_0x1ad1cc[_0x16fcaa(0xb1)]=_0x35d542[_0x16fcaa(0x114)]),_0x35d542['journeyBundleName']&&(_0x1ad1cc[_0x16fcaa(0x10c)]=_0x35d542[_0x16fcaa(0xd6)]),_0x306973[_0x16fcaa(0xc0)]?.[_0x16fcaa(0xfb)]?.['data']?.['id']&&(_0x1ad1cc[_0x16fcaa(0x91)]=_0x306973[_0x16fcaa(0xc0)]['parentFolder'][_0x16fcaa(0x96)]['id']),_0x1ad1cc;}export async function journeyResponseToDef(_0xdb0a85,_0xea45da){const _0x3f2e08=a137_0x49f2,_0x359d8c=journeyResponseToDefSync(_0xdb0a85);if(!_0xea45da)return _0x359d8c;const _0x2a6e56=new Set();collectSegmentIdsFromJourney(_0x359d8c,_0x2a6e56);const _0x9450fe=new Set();collectActivationIdsFromJourney(_0x359d8c,_0x9450fe);const _0x38e8ba={},_0x59a905=new Map();for(const _0x18e381 of Array[_0x3f2e08(0x124)](_0x2a6e56)['sort']()){if(_0xea45da[_0x3f2e08(0x8f)]){const _0x9f8ce4=await _0xea45da[_0x3f2e08(0x8f)](_0x18e381);if(_0x9f8ce4[_0x3f2e08(0xef)]){_0x59a905[_0x3f2e08(0x89)](_0x18e381,_0x9f8ce4[_0x3f2e08(0xc3)]);if(_0x9f8ce4[_0x3f2e08(0x84)]){const _0x42cc30={..._0x9f8ce4['definition'],'rule':deepSortObject(_0x9f8ce4[_0x3f2e08(0x84)][_0x3f2e08(0x142)])};_0x38e8ba[_0x9f8ce4[_0x3f2e08(0xc3)]]=_0x42cc30;}}else _0x59a905[_0x3f2e08(0x89)](_0x18e381,makeSegmentRef(_0x9f8ce4['name']));}else{if(_0xea45da['resolveSegmentName']){const _0x163891=await _0xea45da[_0x3f2e08(0xaa)](_0x18e381);_0x59a905['set'](_0x18e381,_0x163891);}}}const _0x224608={},_0x37ecf1=new Map();for(const _0x5103c1 of Array[_0x3f2e08(0x124)](_0x9450fe)['sort']()){if(_0xea45da['resolveActivation']){const _0x1e81be=await _0xea45da[_0x3f2e08(0xf8)](_0x5103c1);_0x1e81be[_0x3f2e08(0xef)]?(_0x37ecf1[_0x3f2e08(0x89)](_0x5103c1,_0x1e81be[_0x3f2e08(0xc3)]),_0x1e81be[_0x3f2e08(0x84)]&&(_0x224608[_0x1e81be[_0x3f2e08(0xc3)]]=_0x1e81be[_0x3f2e08(0x84)])):_0x37ecf1[_0x3f2e08(0x89)](_0x5103c1,makeSegmentRef(_0x1e81be[_0x3f2e08(0xc3)]));}else{if(_0xea45da[_0x3f2e08(0xd4)]){const _0x5915e9=await _0xea45da[_0x3f2e08(0xd4)](_0x5103c1);_0x37ecf1['set'](_0x5103c1,_0x5915e9);}}}_0x59a905[_0x3f2e08(0xd3)]>0x0&&replaceSegmentIdsInJourney(_0x359d8c,_0x59a905);_0x37ecf1[_0x3f2e08(0xd3)]>0x0&&replaceActivationIdsInJourney(_0x359d8c,_0x37ecf1);if(_0xea45da[_0x3f2e08(0x108)]){const _0x43c04a=[];collectJumpTargetsFromJourney(_0x359d8c,_0x43c04a);if(_0x43c04a['length']>0x0){const _0x5a99f1=new Map();for(const _0x21713e of _0x43c04a){try{const _0x1e2465=await _0xea45da[_0x3f2e08(0x108)](_0x21713e[_0x3f2e08(0x102)],_0x21713e[_0x3f2e08(0xce)]);_0x5a99f1[_0x3f2e08(0x89)](_0x21713e['journeyId']+':'+_0x21713e['stageId'],_0x1e2465);}catch{}}_0x5a99f1[_0x3f2e08(0xd3)]>0x0&&replaceJumpTargetsInJourney(_0x359d8c,_0x5a99f1);}}return Object[_0x3f2e08(0x123)](_0x38e8ba)[_0x3f2e08(0x9d)]>0x0&&(_0x359d8c[_0x3f2e08(0xdb)]=_0x38e8ba),Object[_0x3f2e08(0x123)](_0x224608)[_0x3f2e08(0x9d)]>0x0&&(_0x359d8c[_0x3f2e08(0xc2)]=_0x224608),_0x359d8c;}function a137_0x49f2(_0x131171,_0x18207a){_0x131171=_0x131171-0x7e;const _0x184578=a137_0x1845();let _0x49f2d5=_0x184578[_0x131171];return _0x49f2d5;}function collectSegmentIdsFromJourney(_0x20f723,_0x3ac039){const _0x23f70c=a137_0x49f2;_0x20f723[_0x23f70c(0x13c)]?.[_0x23f70c(0xb5)]&&_0x3ac039['add'](_0x20f723[_0x23f70c(0x13c)][_0x23f70c(0xb5)]);const _0x550987=_0x2d0f5e=>{const _0x1f273e=_0x23f70c;for(const _0x121b95 of _0x2d0f5e){_0x121b95[_0x1f273e(0x136)]?.[_0x1f273e(0xb5)]&&_0x3ac039['add'](_0x121b95[_0x1f273e(0x136)][_0x1f273e(0xb5)]);if(_0x121b95[_0x1f273e(0x140)])for(const _0x375016 of _0x121b95['exit_criteria']){_0x375016[_0x1f273e(0xb5)]&&_0x3ac039[_0x1f273e(0xac)](_0x375016[_0x1f273e(0xb5)]);}_0x121b95['milestone']?.[_0x1f273e(0xb5)]&&_0x3ac039['add'](_0x121b95[_0x1f273e(0xf9)][_0x1f273e(0xb5)]);if(_0x121b95['steps'])for(const _0xdd04f2 of _0x121b95[_0x1f273e(0x132)]){if(_0xdd04f2[_0x1f273e(0xb6)]===_0x1f273e(0x141)){const _0x395c79=_0xdd04f2;for(const _0x26b5c7 of _0x395c79['with'][_0x1f273e(0x9c)]){_0x26b5c7[_0x1f273e(0xb5)]&&_0x3ac039['add'](_0x26b5c7[_0x1f273e(0xb5)]);}}else{if(_0xdd04f2[_0x1f273e(0xb6)]==='wait'){const _0x234501=_0xdd04f2;_0x234501[_0x1f273e(0xd9)][_0x1f273e(0x122)]?.[_0x1f273e(0xb5)]&&_0x3ac039[_0x1f273e(0xac)](_0x234501['with'][_0x1f273e(0x122)]['segment']);}}}}};if(_0x20f723['journeys'])for(const _0x5c5398 of _0x20f723['journeys']){_0x5c5398[_0x23f70c(0x13c)]?.[_0x23f70c(0xb5)]&&_0x3ac039[_0x23f70c(0xac)](_0x5c5398[_0x23f70c(0x13c)][_0x23f70c(0xb5)]),_0x550987(_0x5c5398[_0x23f70c(0x115)]);}_0x20f723['stages']&&_0x550987(_0x20f723[_0x23f70c(0x115)]);if(_0x20f723[_0x23f70c(0xaf)])for(const _0x264c69 of _0x20f723[_0x23f70c(0xaf)]){_0x550987(_0x264c69[_0x23f70c(0x115)]);}}function replaceSegmentIdsInJourney(_0x35ecba,_0x1c9c54){const _0x245f6b=a137_0x49f2,_0x35230e=_0x2ca493=>_0x1c9c54[_0x245f6b(0xed)](_0x2ca493)||_0x2ca493;_0x35ecba[_0x245f6b(0x13c)]?.[_0x245f6b(0xb5)]&&(_0x35ecba[_0x245f6b(0x13c)]['segment']=_0x35230e(_0x35ecba[_0x245f6b(0x13c)]['segment']));const _0x3b8eaa=_0x34af08=>{const _0x239405=_0x245f6b;for(const _0x3c8870 of _0x34af08){_0x3c8870[_0x239405(0x136)]?.[_0x239405(0xb5)]&&(_0x3c8870[_0x239405(0x136)][_0x239405(0xb5)]=_0x35230e(_0x3c8870['entry_criteria'][_0x239405(0xb5)]));if(_0x3c8870['exit_criteria'])for(const _0x283e7a of _0x3c8870[_0x239405(0x140)]){_0x283e7a[_0x239405(0xb5)]&&(_0x283e7a[_0x239405(0xb5)]=_0x35230e(_0x283e7a['segment']));}_0x3c8870[_0x239405(0xf9)]?.[_0x239405(0xb5)]&&(_0x3c8870[_0x239405(0xf9)][_0x239405(0xb5)]=_0x35230e(_0x3c8870[_0x239405(0xf9)]['segment']));if(_0x3c8870[_0x239405(0x132)])for(const _0x299280 of _0x3c8870[_0x239405(0x132)]){if(_0x299280['type']===_0x239405(0x141)){const _0x54ebde=_0x299280;for(const _0x1e7217 of _0x54ebde['with']['branches']){_0x1e7217[_0x239405(0xb5)]&&(_0x1e7217['segment']=_0x35230e(_0x1e7217[_0x239405(0xb5)]));}}else{if(_0x299280[_0x239405(0xb6)]===_0x239405(0xcf)){const _0x24637e=_0x299280;_0x24637e[_0x239405(0xd9)][_0x239405(0x122)]?.[_0x239405(0xb5)]&&(_0x24637e[_0x239405(0xd9)][_0x239405(0x122)][_0x239405(0xb5)]=_0x35230e(_0x24637e['with'][_0x239405(0x122)][_0x239405(0xb5)]));}}}}};if(_0x35ecba[_0x245f6b(0xbd)])for(const _0x3dc19f of _0x35ecba[_0x245f6b(0xbd)]){_0x3dc19f[_0x245f6b(0x13c)]?.[_0x245f6b(0xb5)]&&(_0x3dc19f['goal'][_0x245f6b(0xb5)]=_0x35230e(_0x3dc19f[_0x245f6b(0x13c)][_0x245f6b(0xb5)])),_0x3b8eaa(_0x3dc19f[_0x245f6b(0x115)]);}_0x35ecba[_0x245f6b(0x115)]&&_0x3b8eaa(_0x35ecba[_0x245f6b(0x115)]);if(_0x35ecba[_0x245f6b(0xaf)])for(const _0x30e420 of _0x35ecba[_0x245f6b(0xaf)]){_0x3b8eaa(_0x30e420['stages']);}}function collectActivationIdsFromJourney(_0x12e4cf,_0x45a845){const _0x5a083c=a137_0x49f2,_0x213797=_0x22b8d1=>{const _0x258c71=a137_0x49f2;for(const _0x30143c of _0x22b8d1){if(_0x30143c['steps'])for(const _0x465c80 of _0x30143c[_0x258c71(0x132)]){if(_0x465c80[_0x258c71(0xb6)]==='activation'){const _0x7c4461=_0x465c80;_0x7c4461[_0x258c71(0xd9)][_0x258c71(0xe1)]&&/^\d+$/['test'](_0x7c4461['with'][_0x258c71(0xe1)])&&_0x45a845[_0x258c71(0xac)](_0x7c4461[_0x258c71(0xd9)]['activation']);}}}};if(_0x12e4cf[_0x5a083c(0xbd)])for(const _0x366f1a of _0x12e4cf[_0x5a083c(0xbd)]){_0x213797(_0x366f1a[_0x5a083c(0x115)]);}_0x12e4cf[_0x5a083c(0x115)]&&_0x213797(_0x12e4cf[_0x5a083c(0x115)]);if(_0x12e4cf['versions'])for(const _0x189b0c of _0x12e4cf[_0x5a083c(0xaf)]){_0x213797(_0x189b0c[_0x5a083c(0x115)]);}}function replaceActivationIdsInJourney(_0x39eb26,_0x46e871){const _0x1c6254=a137_0x49f2,_0x504c1c=_0x45ab4e=>_0x46e871[_0x1c6254(0xed)](_0x45ab4e)||_0x45ab4e,_0x5dda6d=_0x4ce26e=>{const _0x491a68=_0x1c6254;for(const _0x403dfe of _0x4ce26e){if(_0x403dfe['steps'])for(const _0x24f764 of _0x403dfe[_0x491a68(0x132)]){if(_0x24f764[_0x491a68(0xb6)]===_0x491a68(0xe1)){const _0x5c21c6=_0x24f764;_0x5c21c6[_0x491a68(0xd9)][_0x491a68(0xe1)]&&(_0x5c21c6[_0x491a68(0xd9)][_0x491a68(0xe1)]=_0x504c1c(_0x5c21c6[_0x491a68(0xd9)][_0x491a68(0xe1)]));}}}};if(_0x39eb26['journeys'])for(const _0x2fb02a of _0x39eb26[_0x1c6254(0xbd)]){_0x5dda6d(_0x2fb02a['stages']);}_0x39eb26['stages']&&_0x5dda6d(_0x39eb26[_0x1c6254(0x115)]);if(_0x39eb26['versions'])for(const _0x12eb92 of _0x39eb26[_0x1c6254(0xaf)]){_0x5dda6d(_0x12eb92[_0x1c6254(0x115)]);}}function collectJumpTargetsFromJourney(_0xdd6f06,_0x32dc79){const _0x595a78=a137_0x49f2,_0x5e78e6=new Set(),_0x18cb31=_0x8039d=>{const _0x51f09a=a137_0x49f2;for(const _0x3b50b5 of _0x8039d){if(_0x3b50b5[_0x51f09a(0x132)])for(const _0x504bf8 of _0x3b50b5['steps']){if(_0x504bf8['type']===_0x51f09a(0x12c)){const _0x452e12=_0x504bf8,_0x3bd6b7=_0x452e12[_0x51f09a(0xd9)][_0x51f09a(0x9a)];if(_0x3bd6b7[_0x51f09a(0x125)]&&_0x3bd6b7[_0x51f09a(0x109)]&&/^\d+$/[_0x51f09a(0xbf)](_0x3bd6b7[_0x51f09a(0x125)])&&/^\d+$/[_0x51f09a(0xbf)](_0x3bd6b7[_0x51f09a(0x109)])){const _0xabffdf=_0x3bd6b7['journey']+':'+_0x3bd6b7['stage'];!_0x5e78e6[_0x51f09a(0x98)](_0xabffdf)&&(_0x5e78e6[_0x51f09a(0xac)](_0xabffdf),_0x32dc79['push']({'journeyId':_0x3bd6b7['journey'],'stageId':_0x3bd6b7[_0x51f09a(0x109)]}));}}}}};if(_0xdd6f06['journeys'])for(const _0x5b8ab7 of _0xdd6f06['journeys']){_0x18cb31(_0x5b8ab7[_0x595a78(0x115)]);}_0xdd6f06[_0x595a78(0x115)]&&_0x18cb31(_0xdd6f06[_0x595a78(0x115)]);if(_0xdd6f06['versions'])for(const _0x35dc1e of _0xdd6f06[_0x595a78(0xaf)]){_0x18cb31(_0x35dc1e[_0x595a78(0x115)]);}}function replaceJumpTargetsInJourney(_0x494573,_0x1edda8){const _0x1627c5=a137_0x49f2,_0x4f171f=_0x3916db=>{const _0x517cb3=a137_0x49f2;for(const _0x487f9c of _0x3916db){if(_0x487f9c[_0x517cb3(0x132)])for(const _0x2e5679 of _0x487f9c[_0x517cb3(0x132)]){if(_0x2e5679[_0x517cb3(0xb6)]===_0x517cb3(0x12c)){const _0x31e771=_0x2e5679,_0x2f326d=_0x31e771['with'][_0x517cb3(0x9a)],_0x282df5=_0x2f326d[_0x517cb3(0x125)]+':'+_0x2f326d[_0x517cb3(0x109)],_0x13ae48=_0x1edda8[_0x517cb3(0xed)](_0x282df5);_0x13ae48&&(_0x2f326d[_0x517cb3(0x125)]=_0x13ae48[_0x517cb3(0xcd)],_0x2f326d[_0x517cb3(0x109)]=_0x13ae48[_0x517cb3(0x11e)]);}}}};if(_0x494573[_0x1627c5(0xbd)])for(const _0x228cae of _0x494573[_0x1627c5(0xbd)]){_0x4f171f(_0x228cae[_0x1627c5(0x115)]);}_0x494573[_0x1627c5(0x115)]&&_0x4f171f(_0x494573[_0x1627c5(0x115)]);if(_0x494573['versions'])for(const _0x3f08d4 of _0x494573[_0x1627c5(0xaf)]){_0x4f171f(_0x3f08d4[_0x1627c5(0x115)]);}}function generateReadableStepName(_0x5bfae3,_0x400e0b){const _0x10c5f9=a137_0x49f2;if(_0x5bfae3[_0x10c5f9(0xc3)]&&_0x5bfae3[_0x10c5f9(0xc3)]!==_0x5bfae3[_0x10c5f9(0xb6)]){const _0x4d6ffa=_0x5bfae3[_0x10c5f9(0xc3)]['trim']();if(_0x4d6ffa&&/[a-z0-9\p{L}]/iu[_0x10c5f9(0xbf)](_0x4d6ffa))return _0x4d6ffa;}const _0x1d0f32=_0x5bfae3[_0x10c5f9(0xb6)][_0x10c5f9(0x12f)]()[_0x10c5f9(0x129)](/step$/i,'');return _0x1d0f32+'_'+(_0x400e0b+0x1);}function getStepNextRefs(_0x2fbf40){const _0x4d4040=a137_0x49f2,_0xd96b6f=[];if(_0x2fbf40[_0x4d4040(0xec)])_0xd96b6f['push'](_0x2fbf40[_0x4d4040(0xec)]);if(_0x2fbf40['branches'])for(const _0xabab2e of _0x2fbf40['branches']){if(_0xabab2e[_0x4d4040(0xec)])_0xd96b6f['push'](_0xabab2e[_0x4d4040(0xec)]);}if(_0x2fbf40['variants'])for(const _0x4625cb of _0x2fbf40[_0x4d4040(0x116)]){if(_0x4625cb[_0x4d4040(0xec)])_0xd96b6f[_0x4d4040(0xb9)](_0x4625cb[_0x4d4040(0xec)]);}if(_0x2fbf40[_0x4d4040(0x106)])for(const _0x78aba3 of _0x2fbf40[_0x4d4040(0x106)]){if(_0x78aba3[_0x4d4040(0xec)])_0xd96b6f[_0x4d4040(0xb9)](_0x78aba3['next']);}return _0xd96b6f;}function parseJumpTargetDisplayName(_0x42faee){const _0x4666de=a137_0x49f2,_0x660dea=_0x42faee[_0x4666de(0x133)](/^(.+?)\s*\(([^/)]+)/);if(!_0x660dea)return undefined;const _0x4e4aaf=_0x660dea[0x1][_0x4666de(0x13b)](),_0x2fb636=_0x660dea[0x2][_0x4666de(0x13b)]();if(!_0x4e4aaf||!_0x2fb636)return undefined;return{'stageName':_0x4e4aaf,'journeyName':_0x2fb636};}function orderStepsFromRoot(_0x3911b7,_0xe0de6f){const _0x5b0ba1=a137_0x49f2,_0x2870b8=Object[_0x5b0ba1(0xbc)](_0x3911b7);if(_0x2870b8[_0x5b0ba1(0x9d)]===0x0)return[];const _0x496da2=new Set(_0x2870b8['map'](([_0x2a5b70])=>_0x2a5b70)),_0x6e5dcf=new Set();for(const [,_0x4f7eb4]of _0x2870b8){for(const _0xca9170 of getStepNextRefs(_0x4f7eb4)){if(_0x496da2[_0x5b0ba1(0x98)](_0xca9170))_0x6e5dcf[_0x5b0ba1(0xac)](_0xca9170);}}let _0x5ae5ff=_0xe0de6f&&_0x496da2[_0x5b0ba1(0x98)](_0xe0de6f)?_0xe0de6f:undefined;if(!_0x5ae5ff){const _0x27cf55=_0x2870b8[_0x5b0ba1(0x12b)](([_0x140c07])=>!_0x6e5dcf[_0x5b0ba1(0x98)](_0x140c07));_0x27cf55['length']>0x0?_0x5ae5ff=_0x27cf55[0x0][0x0]:_0x5ae5ff=_0x2870b8[0x0][0x0];}const _0x3eed97=[],_0x2c99df=new Set(),_0x1f148f=[_0x5ae5ff];while(_0x1f148f[_0x5b0ba1(0x9d)]>0x0){const _0x5aa3ad=_0x1f148f[_0x5b0ba1(0xd1)]();if(_0x2c99df[_0x5b0ba1(0x98)](_0x5aa3ad))continue;_0x2c99df[_0x5b0ba1(0xac)](_0x5aa3ad);const _0x1c0f51=_0x3911b7[_0x5aa3ad];if(!_0x1c0f51)continue;_0x3eed97[_0x5b0ba1(0xb9)]({'uuid':_0x5aa3ad,'step':_0x1c0f51});for(const _0x53d6b4 of getStepNextRefs(_0x1c0f51)){_0x496da2[_0x5b0ba1(0x98)](_0x53d6b4)&&!_0x2c99df[_0x5b0ba1(0x98)](_0x53d6b4)&&_0x1f148f['push'](_0x53d6b4);}}for(const [_0x348a2b,_0x351c08]of _0x2870b8){!_0x2c99df[_0x5b0ba1(0x98)](_0x348a2b)&&_0x3eed97[_0x5b0ba1(0xb9)]({'uuid':_0x348a2b,'step':_0x351c08});}return _0x3eed97;}function resolveStepReferences(_0x592b80,_0xe64660,_0x529609,_0x430eba){const _0x35e4a7=a137_0x49f2;if(_0x592b80['type']!==_0x35e4a7(0xc9)){_0x592b80['next']&&_0x430eba[_0x35e4a7(0x98)](_0x592b80[_0x35e4a7(0xec)])&&(_0x592b80[_0x35e4a7(0xec)]=_0x430eba[_0x35e4a7(0xed)](_0x592b80[_0x35e4a7(0xec)]));const _0x5d354a=_0xe64660+0x1;if(_0x5d354a<_0x529609[_0x35e4a7(0x9d)]){const _0x4ab4fb=_0x430eba[_0x35e4a7(0xed)](_0x529609[_0x5d354a][_0x35e4a7(0xae)]);_0x592b80['next']===_0x4ab4fb&&delete _0x592b80[_0x35e4a7(0xec)];}}if(_0x592b80[_0x35e4a7(0xb6)]===_0x35e4a7(0x141))for(const _0x46915d of _0x592b80[_0x35e4a7(0xd9)][_0x35e4a7(0x9c)]){_0x46915d[_0x35e4a7(0xec)]&&_0x430eba['has'](_0x46915d[_0x35e4a7(0xec)])&&(_0x46915d[_0x35e4a7(0xec)]=_0x430eba[_0x35e4a7(0xed)](_0x46915d[_0x35e4a7(0xec)]));}if(_0x592b80[_0x35e4a7(0xb6)]===_0x35e4a7(0xf4))for(const _0x4df2d4 of _0x592b80[_0x35e4a7(0xd9)][_0x35e4a7(0x116)]){_0x4df2d4[_0x35e4a7(0xec)]&&_0x430eba[_0x35e4a7(0x98)](_0x4df2d4[_0x35e4a7(0xec)])&&(_0x4df2d4[_0x35e4a7(0xec)]=_0x430eba[_0x35e4a7(0xed)](_0x4df2d4[_0x35e4a7(0xec)]));}if(_0x592b80['type']===_0x35e4a7(0xcf)&&_0x592b80['with'][_0x35e4a7(0x122)]){const _0x2ca788=_0x592b80[_0x35e4a7(0xd9)]['condition'];_0x2ca788[_0x35e4a7(0xec)]&&_0x430eba[_0x35e4a7(0x98)](_0x2ca788[_0x35e4a7(0xec)])&&(_0x2ca788[_0x35e4a7(0xec)]=_0x430eba[_0x35e4a7(0xed)](_0x2ca788[_0x35e4a7(0xec)])),_0x2ca788[_0x35e4a7(0x137)]?.[_0x35e4a7(0xec)]&&_0x430eba[_0x35e4a7(0x98)](_0x2ca788['timeout'][_0x35e4a7(0xec)])&&(_0x2ca788['timeout'][_0x35e4a7(0xec)]=_0x430eba[_0x35e4a7(0xed)](_0x2ca788[_0x35e4a7(0x137)][_0x35e4a7(0xec)]));}}function convertApiStageToYaml(_0x4a83d5){const _0x5734ce=a137_0x49f2,_0x13e9df={'name':_0x4a83d5['name']};_0x4a83d5['id']&&(_0x13e9df['id']=_0x4a83d5['id']);_0x4a83d5[_0x5734ce(0x107)]&&(_0x13e9df[_0x5734ce(0x107)]=_0x4a83d5[_0x5734ce(0x107)]);_0x4a83d5[_0x5734ce(0x99)]&&(_0x13e9df[_0x5734ce(0x136)]=convertApiCriteriaToYaml(_0x4a83d5['entryCriteria']));_0x4a83d5['exitCriterias']&&_0x4a83d5[_0x5734ce(0x135)][_0x5734ce(0x9d)]>0x0&&(_0x13e9df[_0x5734ce(0x140)]=_0x4a83d5[_0x5734ce(0x135)][_0x5734ce(0x143)](convertApiCriteriaToYaml));_0x4a83d5[_0x5734ce(0xf9)]&&(_0x13e9df[_0x5734ce(0xf9)]=convertApiCriteriaToYaml(_0x4a83d5[_0x5734ce(0xf9)]));if(_0x4a83d5[_0x5734ce(0x132)]&&Object[_0x5734ce(0x123)](_0x4a83d5[_0x5734ce(0x132)])[_0x5734ce(0x9d)]>0x0){const _0xa37e8f=orderStepsFromRoot(_0x4a83d5[_0x5734ce(0x132)],_0x4a83d5[_0x5734ce(0xf5)]),_0x477600=new Map(),_0x28d44d=new Set();for(let _0x25a32a=0x0;_0x25a32a<_0xa37e8f['length'];_0x25a32a++){const {uuid:_0x407de5,step:_0x41d162}=_0xa37e8f[_0x25a32a];let _0x4f4bb4=generateReadableStepName(_0x41d162,_0x25a32a),_0x14e3e0=_0x4f4bb4,_0x1bb693=0x2;while(_0x28d44d[_0x5734ce(0x98)](_0x14e3e0)){_0x14e3e0=_0x4f4bb4+'_'+_0x1bb693,_0x1bb693++;}_0x28d44d['add'](_0x14e3e0),_0x477600[_0x5734ce(0x89)](_0x407de5,_0x14e3e0);}_0x13e9df[_0x5734ce(0x132)]=_0xa37e8f[_0x5734ce(0x143)](({uuid:_0x24d94b,step:_0x205c48},_0x12b941)=>{const _0x18abe0=_0x5734ce,_0xc541aa=convertApiStepToYaml(_0x205c48,_0x477600[_0x18abe0(0xed)](_0x24d94b));return resolveStepReferences(_0xc541aa,_0x12b941,_0xa37e8f,_0x477600),_0xc541aa;});}return _0x13e9df;}function convertApiCriteriaToYaml(_0x5a18f9){const _0x1fb89c=a137_0x49f2,_0x447cec={'name':_0x5a18f9[_0x1fb89c(0xc3)],'segment':_0x5a18f9[_0x1fb89c(0x126)]};_0x5a18f9[_0x1fb89c(0x107)]&&(_0x447cec[_0x1fb89c(0x107)]=_0x5a18f9[_0x1fb89c(0x107)]);if(_0x5a18f9['target']){let _0x3e7ae1=_0x5a18f9['target'][_0x1fb89c(0x102)],_0x145fa9=_0x5a18f9[_0x1fb89c(0x9a)][_0x1fb89c(0x10e)];if(_0x5a18f9[_0x1fb89c(0x9a)][_0x1fb89c(0xcd)]){const _0x4fe5ac=parseJumpTargetDisplayName(_0x5a18f9['target'][_0x1fb89c(0xcd)]);_0x4fe5ac&&(_0x145fa9=_0x4fe5ac['stageName'],_0x3e7ae1=_0x4fe5ac[_0x1fb89c(0xcd)]);}_0x447cec[_0x1fb89c(0x9a)]={'journey':_0x3e7ae1,'stage':_0x145fa9},_0x5a18f9[_0x1fb89c(0x9a)][_0x1fb89c(0x114)]&&(_0x447cec[_0x1fb89c(0x9a)][_0x1fb89c(0xb1)]=_0x5a18f9['target'][_0x1fb89c(0x114)]);}return _0x447cec;}function convertApiStepToYaml(_0x506615,_0xfae709){const _0x5ad554=a137_0x49f2;switch(_0x506615[_0x5ad554(0xb6)]){case _0x5ad554(0x139):{const _0x367f29={};if(_0x506615['waitStepType']===_0x5ad554(0xf2)&&_0x506615[_0x5ad554(0x10a)]!==undefined)_0x367f29[_0x5ad554(0xd5)]=_0x506615[_0x5ad554(0x10a)],_0x367f29[_0x5ad554(0xc4)]=_0x506615[_0x5ad554(0xfe)];else{if(_0x506615['waitStepType']==='Date'&&_0x506615[_0x5ad554(0x110)])_0x367f29[_0x5ad554(0xd0)]=_0x506615[_0x5ad554(0x110)];else{if(_0x506615[_0x5ad554(0x13a)]==='DaysOfTheWeek'&&_0x506615[_0x5ad554(0xb7)])_0x367f29['days_of_week']=_0x506615[_0x5ad554(0xb7)];else{if(_0x506615[_0x5ad554(0x13a)]==='Condition'){if(_0x506615[_0x5ad554(0x106)]&&_0x506615[_0x5ad554(0x106)][_0x5ad554(0x9d)]>0x0){const _0x4cb0d8=_0x506615[_0x5ad554(0x106)][_0x5ad554(0x104)](_0x343081=>!_0x343081[_0x5ad554(0x13f)]),_0x419356=_0x506615[_0x5ad554(0x106)][_0x5ad554(0x104)](_0x4fe9cd=>_0x4fe9cd[_0x5ad554(0x13f)]);_0x4cb0d8?.[_0x5ad554(0x126)]&&(_0x367f29[_0x5ad554(0x122)]={'segment':_0x4cb0d8[_0x5ad554(0x126)],..._0x4cb0d8['next']?{'next':_0x4cb0d8['next']}:{}},_0x419356&&_0x419356[_0x5ad554(0xe0)]!==undefined&&_0x419356[_0x5ad554(0xc4)]&&(_0x367f29[_0x5ad554(0x122)]['timeout']={'duration':_0x419356[_0x5ad554(0xe0)],'unit':_0x419356[_0x5ad554(0xc4)],..._0x419356[_0x5ad554(0xec)]?{'next':_0x419356['next']}:{}}));}else _0x506615[_0x5ad554(0xad)]&&(_0x367f29[_0x5ad554(0x122)]={'segment':_0x506615['conditionSegmentId']},_0x506615['conditionTimeoutDuration']!==undefined&&_0x506615['conditionTimeoutUnit']&&(_0x367f29[_0x5ad554(0x122)][_0x5ad554(0x137)]={'duration':_0x506615['conditionTimeoutDuration'],'unit':_0x506615[_0x5ad554(0xc5)]}));}}}}const _0x277f2f={'type':_0x5ad554(0xcf),'name':_0xfae709,..._0x506615[_0x5ad554(0xec)]?{'next':_0x506615[_0x5ad554(0xec)]}:{},'with':_0x367f29};return _0x277f2f;}case _0x5ad554(0xc6):{const _0x55ef54={'type':_0x5ad554(0xe1),'name':_0xfae709,..._0x506615['next']?{'next':_0x506615[_0x5ad554(0xec)]}:{},'with':{'activation':_0x506615[_0x5ad554(0xdf)]||''}};return _0x55ef54;}case'DecisionPoint':{const _0x1b5734={'type':_0x5ad554(0x141),'name':_0xfae709,..._0x506615[_0x5ad554(0xec)]?{'next':_0x506615[_0x5ad554(0xec)]}:{},'with':{'branches':(_0x506615[_0x5ad554(0x9c)]||[])['map'](_0x4496d7=>({'name':_0x4496d7[_0x5ad554(0xc3)],'segment':_0x4496d7[_0x5ad554(0x126)],'excluded':_0x4496d7['excludedPath'],..._0x4496d7[_0x5ad554(0xec)]?{'next':_0x4496d7[_0x5ad554(0xec)]}:{}}))}};return _0x1b5734;}case'ABTest':case _0x5ad554(0xa4):case _0x5ad554(0xde):{const _0x28c40f=_0x506615['variants']||(_0x506615['branches']||[])[_0x5ad554(0x143)](_0x99a90=>({'name':_0x99a90[_0x5ad554(0xc3)],'percentage':0x0,'next':_0x99a90['next']})),_0x271743={'type':_0x5ad554(0xf4),'name':_0xfae709,..._0x506615[_0x5ad554(0xec)]?{'next':_0x506615['next']}:{},'with':{'customized_split':_0x506615[_0x5ad554(0xab)],'unique_id':_0x506615[_0x5ad554(0xe9)],'variants':_0x28c40f['map'](_0x173875=>({'name':_0x173875['name'],'percentage':_0x173875[_0x5ad554(0x93)],..._0x173875[_0x5ad554(0xec)]?{'next':_0x173875['next']}:{}}))}};return _0x271743;}case _0x5ad554(0x127):{const _0x522576={'type':_0x5ad554(0x9b),'name':_0xfae709,..._0x506615[_0x5ad554(0xec)]?{'next':_0x506615['next']}:{}};return _0x522576;}case _0x5ad554(0x130):{let _0x1b0134='',_0x273758='',_0xd03dd;if(_0x506615['target']){_0x1b0134=_0x506615[_0x5ad554(0x9a)][_0x5ad554(0x102)],_0x273758=_0x506615['target'][_0x5ad554(0x10e)],_0xd03dd=_0x506615[_0x5ad554(0x9a)][_0x5ad554(0x114)];if(_0x506615[_0x5ad554(0x9a)]['journeyName']){const _0x408df5=parseJumpTargetDisplayName(_0x506615['target']['journeyName']);_0x408df5&&(_0x273758=_0x408df5[_0x5ad554(0x11e)],_0x1b0134=_0x408df5[_0x5ad554(0xcd)]);}}const _0x51fe7a={'type':_0x5ad554(0x12c),'name':_0xfae709,..._0x506615[_0x5ad554(0xec)]?{'next':_0x506615[_0x5ad554(0xec)]}:{},'with':{'target':{'journey':_0x1b0134,'stage':_0x273758,..._0xd03dd?{'bundle_id':_0xd03dd}:{}}}};return _0x51fe7a;}case _0x5ad554(0xb3):{const _0x3b3e0e={'type':_0x5ad554(0xc9),'name':_0xfae709};return _0x3b3e0e;}default:{const _0x245f7c={'type':'end','name':_0xfae709};return _0x245f7c;}}}export async function journeyDefToRequest(_0x1dcc95,_0x445a0a,_0x179b95){const _0xd249c7=a137_0x49f2,_0xc61471=_0x1dcc95['stages']||getActiveStages(_0x1dcc95),_0x33076f=isJourneysArrayMode(_0x1dcc95)||isMultiVersionMode(_0x1dcc95)?getLatestJourneyEntry(_0x1dcc95):undefined,_0x3dc458=_0x33076f?.['version']??_0x1dcc95[_0xd249c7(0xc3)],_0x1058d6=_0x1dcc95['segments']||{},_0x2bd85b=_0x1dcc95[_0xd249c7(0xc2)]||{},_0x5df16f={'type':_0xd249c7(0x125),'attributes':{'name':_0x3dc458,'audienceId':_0x445a0a,'journeyStages':await Promise[_0xd249c7(0x97)](_0xc61471['map'](_0x110b04=>convertYamlStageToApi(_0x110b04,_0x179b95,_0x1058d6,_0x2bd85b)))}},_0x3860ab=_0x33076f?.['id']??_0x1dcc95['id'];_0x3860ab&&(_0x5df16f['id']=_0x3860ab);_0x1dcc95['description']&&(_0x5df16f[_0xd249c7(0xb0)]['description']=_0x1dcc95['description']);const _0x430478=getEffectiveGoal(_0x1dcc95);_0x430478&&(_0x5df16f[_0xd249c7(0xb0)][_0xd249c7(0x13c)]=await convertYamlCriteriaToApi(_0x430478,_0x179b95,_0x1058d6));const _0x3fdc8b=getEffectiveReentry(_0x1dcc95);return _0x3fdc8b&&(_0x5df16f[_0xd249c7(0xb0)][_0xd249c7(0xa5)]=_0x3fdc8b,_0x5df16f['attributes'][_0xd249c7(0xee)]=_0x3fdc8b!=='no_reentry'),_0x1dcc95[_0xd249c7(0x91)]&&(_0x5df16f[_0xd249c7(0xc0)]={'parentFolder':{'data':{'id':_0x1dcc95['folder_id'],'type':_0xd249c7(0xb4)}}}),_0x5df16f;}async function convertYamlStageToApi(_0x404b2a,_0x5ada59,_0x1f6f54={},_0x1f5f8a={}){const _0x5d5b15=a137_0x49f2,_0x952e26={'name':_0x404b2a[_0x5d5b15(0xc3)]};_0x404b2a['id']&&(_0x952e26['id']=_0x404b2a['id']);_0x404b2a[_0x5d5b15(0x107)]&&(_0x952e26[_0x5d5b15(0x107)]=_0x404b2a[_0x5d5b15(0x107)]);_0x404b2a['entry_criteria']&&(_0x952e26[_0x5d5b15(0x99)]=await convertYamlCriteriaToApi(_0x404b2a[_0x5d5b15(0x136)],_0x5ada59,_0x1f6f54));_0x404b2a[_0x5d5b15(0x140)]&&_0x404b2a[_0x5d5b15(0x140)][_0x5d5b15(0x9d)]>0x0&&(_0x952e26[_0x5d5b15(0x135)]=await Promise[_0x5d5b15(0x97)](_0x404b2a[_0x5d5b15(0x140)]['map'](_0x111af6=>convertYamlCriteriaToApi(_0x111af6,_0x5ada59,_0x1f6f54))));_0x404b2a[_0x5d5b15(0xf9)]&&(_0x952e26[_0x5d5b15(0xf9)]=await convertYamlCriteriaToApi(_0x404b2a[_0x5d5b15(0xf9)],_0x5ada59,_0x1f6f54));if(_0x404b2a[_0x5d5b15(0x132)]&&_0x404b2a['steps']['length']>0x0){const _0x56771c={},_0x339c3b=_0x404b2a['steps']['map']((_0x2ebe33,_0x38b108)=>{const _0x5521d8=_0x5d5b15,_0xde478=_0x2ebe33['uuid']||generateUUID(),_0x4e9a51=_0x2ebe33['name']||_0x2ebe33[_0x5521d8(0xb6)]+'_'+_0x38b108;return _0x56771c[_0x4e9a51]=_0xde478,{..._0x2ebe33,'name':_0x4e9a51};});_0x952e26[_0x5d5b15(0xf5)]=_0x56771c[_0x339c3b[0x0][_0x5d5b15(0xc3)]],_0x952e26[_0x5d5b15(0x132)]={};for(let _0x359021=0x0;_0x359021<_0x339c3b[_0x5d5b15(0x9d)];_0x359021++){const _0x29dd9e=_0x339c3b[_0x359021],_0x2a40ba=_0x56771c[_0x29dd9e[_0x5d5b15(0xc3)]],_0x75d468=!_0x29dd9e[_0x5d5b15(0xec)]&&_0x359021<_0x339c3b[_0x5d5b15(0x9d)]-0x1&&_0x29dd9e[_0x5d5b15(0xb6)]!==_0x5d5b15(0xc9)?_0x339c3b[_0x359021+0x1][_0x5d5b15(0xc3)]:_0x29dd9e[_0x5d5b15(0xec)],_0xdba155=_0x75d468!==_0x29dd9e['next']?{..._0x29dd9e,'next':_0x75d468}:_0x29dd9e;_0x952e26[_0x5d5b15(0x132)][_0x2a40ba]=await convertYamlStepToApi(_0xdba155,_0x5ada59,_0x1f6f54,_0x56771c,_0x1f5f8a);}}else _0x404b2a[_0x5d5b15(0xa8)]&&(_0x952e26['rootStep']=_0x404b2a['root_step']);return _0x952e26;}async function convertYamlCriteriaToApi(_0x2fcedf,_0x41d7d0,_0x9c202a={}){const _0x5c720d=a137_0x49f2;let _0x40eebb=_0x2fcedf[_0x5c720d(0xb5)];if(_0x40eebb&&!/^\d+$/[_0x5c720d(0xbf)](_0x40eebb)){const _0x190ed5=parseSegmentRef(_0x40eebb);if(_0x190ed5[_0x5c720d(0xb6)]===_0x5c720d(0x121))_0x41d7d0?.['resolveSegmentId']&&(_0x40eebb=await _0x41d7d0[_0x5c720d(0xb8)](_0x190ed5['name']));else{if(_0x190ed5[_0x5c720d(0xb6)]===_0x5c720d(0x13d)&&_0x9c202a[_0x190ed5[_0x5c720d(0xc3)]])_0x41d7d0?.[_0x5c720d(0x81)]&&(_0x40eebb=await _0x41d7d0[_0x5c720d(0x81)](_0x190ed5[_0x5c720d(0xc3)],_0x9c202a[_0x190ed5['name']]));else _0x41d7d0?.['resolveSegmentId']&&(_0x40eebb=await _0x41d7d0[_0x5c720d(0xb8)](_0x190ed5[_0x5c720d(0xc3)]));}}const _0x5d7f0c={'name':_0x2fcedf[_0x5c720d(0xc3)],'segmentId':_0x40eebb};_0x2fcedf[_0x5c720d(0x107)]&&(_0x5d7f0c[_0x5c720d(0x107)]=_0x2fcedf['description']);if(_0x2fcedf[_0x5c720d(0x9a)]){const _0x5f5d71=_0x2fcedf[_0x5c720d(0x9a)][_0x5c720d(0x125)],_0xe890a2=_0x2fcedf[_0x5c720d(0x9a)][_0x5c720d(0x109)];let _0x31c872=_0x2fcedf['target']['journey'];_0x41d7d0?.[_0x5c720d(0x134)]&&!/^\d+$/['test'](_0x31c872)&&(_0x31c872=await _0x41d7d0[_0x5c720d(0x134)](_0x31c872));let _0x1df025=_0x2fcedf['target'][_0x5c720d(0x109)];_0x41d7d0?.[_0x5c720d(0xc1)]&&!/^\d+$/['test'](_0x1df025)&&(_0x1df025=await _0x41d7d0[_0x5c720d(0xc1)](_0x31c872,_0x1df025));const _0x85cf77=!/^\d+$/[_0x5c720d(0xbf)](_0x5f5d71)&&!isLocalJourneyRef(_0x5f5d71)?formatApiJourneyName(_0x5f5d71,_0xe890a2):undefined;_0x5d7f0c[_0x5c720d(0x9a)]={'journeyId':_0x31c872,'journeyStageId':_0x1df025,'journeyName':_0x85cf77,'confirmed':!![]},_0x2fcedf['target'][_0x5c720d(0xb1)]&&(_0x5d7f0c[_0x5c720d(0x9a)][_0x5c720d(0x114)]=_0x2fcedf[_0x5c720d(0x9a)]['bundle_id']);}return _0x5d7f0c;}async function convertYamlStepToApi(_0x3c2c7e,_0x24493c,_0x8d9d61={},_0x7d4224={},_0x33be05={}){const _0x11f7e9=a137_0x49f2,_0x4f2731=async _0x29c3e9=>{const _0x3dcb56=a137_0x49f2;if(/^\d+$/['test'](_0x29c3e9))return _0x29c3e9;const _0x4deb77=parseSegmentRef(_0x29c3e9);if(_0x4deb77[_0x3dcb56(0xb6)]===_0x3dcb56(0x121)){if(_0x24493c?.['resolveSegmentId'])return await _0x24493c[_0x3dcb56(0xb8)](_0x4deb77[_0x3dcb56(0xc3)]);}else{if(_0x4deb77[_0x3dcb56(0xb6)]===_0x3dcb56(0x13d)&&_0x8d9d61[_0x4deb77[_0x3dcb56(0xc3)]]){if(_0x24493c?.[_0x3dcb56(0x81)])return await _0x24493c[_0x3dcb56(0x81)](_0x4deb77['name'],_0x8d9d61[_0x4deb77['name']]);}else{if(_0x24493c?.[_0x3dcb56(0xb8)])return await _0x24493c[_0x3dcb56(0xb8)](_0x4deb77[_0x3dcb56(0xc3)]);}}return _0x29c3e9;},_0x21e2f5=async _0x150a18=>{const _0x530327=a137_0x49f2;if(/^\d+$/[_0x530327(0xbf)](_0x150a18))return _0x150a18;const _0x53a191=parseSegmentRef(_0x150a18);if(_0x53a191[_0x530327(0xb6)]==='ref'){if(_0x24493c?.[_0x530327(0x11b)])return await _0x24493c[_0x530327(0x11b)](_0x53a191[_0x530327(0xc3)]);return _0x53a191[_0x530327(0xc3)];}else{if(_0x53a191['type']===_0x530327(0x13d)&&_0x33be05[_0x53a191[_0x530327(0xc3)]]){if(_0x24493c?.[_0x530327(0x95)])return await _0x24493c[_0x530327(0x95)](_0x53a191['name'],_0x33be05[_0x53a191['name']]);if(_0x24493c?.['resolveActivationId'])return await _0x24493c['resolveActivationId'](_0x53a191[_0x530327(0xc3)]);}else{if(_0x24493c?.[_0x530327(0x11b)])return await _0x24493c[_0x530327(0x11b)](_0x53a191[_0x530327(0xc3)]);}}return _0x150a18;},_0x4fc85b=_0x2d67b8=>{const _0x465d60=a137_0x49f2;if(!_0x2d67b8)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x465d60(0xbf)](_0x2d67b8))return _0x2d67b8;return _0x7d4224[_0x2d67b8]||_0x2d67b8;};switch(_0x3c2c7e[_0x11f7e9(0xb6)]){case _0x11f7e9(0xcf):{const _0x48e98f=_0x3c2c7e,_0x19ebe1=_0x48e98f[_0x11f7e9(0xd9)],_0x1bf9e9={'type':_0x11f7e9(0x139),'name':_0x48e98f[_0x11f7e9(0xc3)],'next':_0x4fc85b(_0x48e98f[_0x11f7e9(0xec)])};if(_0x19ebe1[_0x11f7e9(0xd5)]!==undefined&&_0x19ebe1['unit'])_0x1bf9e9[_0x11f7e9(0x13a)]=_0x11f7e9(0xf2),_0x1bf9e9['waitStep']=_0x19ebe1[_0x11f7e9(0xd5)],_0x1bf9e9['waitStepUnit']=normalizeWaitUnit(_0x19ebe1[_0x11f7e9(0xc4)]);else{if(_0x19ebe1['wait_until'])_0x1bf9e9[_0x11f7e9(0x13a)]=_0x11f7e9(0x94),_0x1bf9e9[_0x11f7e9(0x110)]=_0x19ebe1['wait_until'];else{if(_0x19ebe1[_0x11f7e9(0x13e)])_0x1bf9e9[_0x11f7e9(0x13a)]=_0x11f7e9(0x11d),_0x1bf9e9[_0x11f7e9(0xb7)]=_0x19ebe1[_0x11f7e9(0x13e)];else{if(_0x19ebe1[_0x11f7e9(0x122)]){_0x1bf9e9[_0x11f7e9(0x13a)]='Condition';const _0x2c9570=await _0x4f2731(_0x19ebe1[_0x11f7e9(0x122)]['segment']),_0x49b258=_0x19ebe1[_0x11f7e9(0x122)]['timeout']?.[_0x11f7e9(0xec)]!==undefined;if(_0x49b258){const _0x1a23ab=[];_0x1a23ab[_0x11f7e9(0xb9)]({'id':generateUUID(),'segmentId':_0x2c9570,'timedOutPath':![],'name':_0x11f7e9(0xeb),'next':_0x4fc85b(_0x19ebe1[_0x11f7e9(0x122)][_0x11f7e9(0xec)]??_0x48e98f[_0x11f7e9(0xec)])});if(_0x19ebe1[_0x11f7e9(0x122)][_0x11f7e9(0x137)]){const _0x52e1d1=_0x19ebe1[_0x11f7e9(0x122)][_0x11f7e9(0x137)][_0x11f7e9(0xd5)],_0x59452e=normalizeWaitUnit(_0x19ebe1[_0x11f7e9(0x122)][_0x11f7e9(0x137)]['unit']);_0x1a23ab['push']({'id':generateUUID(),'timedOutPath':!![],'name':_0x11f7e9(0xbb)+_0x52e1d1+'\x20'+_0x59452e,'moveAfter':_0x52e1d1,'unit':_0x59452e,'next':_0x4fc85b(_0x19ebe1[_0x11f7e9(0x122)][_0x11f7e9(0x137)][_0x11f7e9(0xec)])});}_0x1bf9e9[_0x11f7e9(0x106)]=_0x1a23ab,delete _0x1bf9e9['next'];}else _0x1bf9e9[_0x11f7e9(0xad)]=_0x2c9570,_0x19ebe1['condition']['timeout']&&(_0x1bf9e9['conditionTimeoutDuration']=_0x19ebe1['condition'][_0x11f7e9(0x137)]['duration'],_0x19ebe1[_0x11f7e9(0x122)][_0x11f7e9(0x137)][_0x11f7e9(0xc4)]&&(_0x1bf9e9[_0x11f7e9(0xc5)]=normalizeWaitUnit(_0x19ebe1[_0x11f7e9(0x122)][_0x11f7e9(0x137)][_0x11f7e9(0xc4)])));}}}}return _0x1bf9e9;}case _0x11f7e9(0xe1):{const _0x1c09e7=_0x3c2c7e,_0x398467=_0x1c09e7[_0x11f7e9(0xd9)][_0x11f7e9(0xe1)],_0xd0566e=await _0x21e2f5(_0x398467);return{'type':_0x11f7e9(0xc6),'name':_0x1c09e7[_0x11f7e9(0xc3)],'journeyActivationStepId':_0xd0566e,'next':_0x4fc85b(_0x1c09e7[_0x11f7e9(0xec)])};}case _0x11f7e9(0x141):{const _0x59d670=_0x3c2c7e,_0x40d2d6=_0x59d670[_0x11f7e9(0xd9)][_0x11f7e9(0x9c)];return{'type':_0x11f7e9(0xfc),'name':_0x59d670['name'],'branches':await Promise[_0x11f7e9(0x97)](_0x40d2d6[_0x11f7e9(0x143)](async _0x24fd75=>{const _0x45b97c=_0x11f7e9;let _0x258c34='';if(!_0x24fd75[_0x45b97c(0xbe)]){const _0x5dc05b=_0x24fd75['segment']||_0x24fd75[_0x45b97c(0x9f)]||'';_0x258c34=_0x5dc05b?await _0x4f2731(_0x5dc05b):'';}return{'id':crypto[_0x45b97c(0xd7)](),'name':_0x24fd75['name'],'description':null,'segmentId':_0x258c34,'excludedPath':_0x24fd75['excluded']??![],'next':_0x4fc85b(_0x24fd75[_0x45b97c(0xec)])};})),'next':_0x4fc85b(_0x59d670[_0x11f7e9(0xec)])};}case _0x11f7e9(0xf4):{const _0x403a53=_0x3c2c7e,_0x48af66=_0x403a53[_0x11f7e9(0xd9)];return{'type':_0x11f7e9(0x8c),'name':_0x403a53['name'],'customizedSplit':_0x48af66[_0x11f7e9(0x7e)],'uniqueId':_0x48af66[_0x11f7e9(0x112)],'variants':_0x48af66[_0x11f7e9(0x116)][_0x11f7e9(0x143)](_0x1e7d55=>({'id':_0x1e7d55['id']||generateUUID(),'name':_0x1e7d55[_0x11f7e9(0xc3)],'percentage':_0x1e7d55[_0x11f7e9(0x93)],'next':_0x4fc85b(_0x1e7d55[_0x11f7e9(0xec)])})),'next':_0x4fc85b(_0x403a53['next'])};}case _0x11f7e9(0x9b):return{'type':_0x11f7e9(0x127),'name':_0x3c2c7e[_0x11f7e9(0xc3)],'next':_0x4fc85b(_0x3c2c7e[_0x11f7e9(0xec)])};case _0x11f7e9(0x12c):{const _0x34c6cd=_0x3c2c7e,_0x13dc7d=_0x34c6cd['with'][_0x11f7e9(0x9a)],_0x3f5ca6=_0x13dc7d[_0x11f7e9(0x125)],_0x492c04=_0x13dc7d[_0x11f7e9(0x109)];let _0x143f3b=_0x13dc7d[_0x11f7e9(0x125)];_0x24493c?.[_0x11f7e9(0x134)]&&!/^\d+$/[_0x11f7e9(0xbf)](_0x143f3b)&&(_0x143f3b=await _0x24493c[_0x11f7e9(0x134)](_0x143f3b));let _0x336644=_0x13dc7d[_0x11f7e9(0x109)];_0x24493c?.[_0x11f7e9(0xc1)]&&!/^\d+$/[_0x11f7e9(0xbf)](_0x336644)&&(_0x336644=await _0x24493c[_0x11f7e9(0xc1)](_0x143f3b,_0x336644));const _0x4ccc12=!/^\d+$/[_0x11f7e9(0xbf)](_0x3f5ca6)&&!isLocalJourneyRef(_0x3f5ca6)?formatApiJourneyName(_0x3f5ca6,_0x492c04):undefined;return{'type':'Jump','name':_0x34c6cd[_0x11f7e9(0xc3)],'target':{'journeyId':_0x143f3b,'journeyStageId':_0x336644,'journeyBundleId':_0x13dc7d['bundle_id'],'journeyName':_0x4ccc12,'confirmed':!![]},'next':_0x4fc85b(_0x34c6cd[_0x11f7e9(0xec)])};}case _0x11f7e9(0xc9):return{'type':_0x11f7e9(0xb3),'name':_0x3c2c7e[_0x11f7e9(0xc3)]};default:{const _0x229958=_0x3c2c7e;return{'type':_0x11f7e9(0xb3),'name':_0x229958[_0x11f7e9(0xc3)]};}}}export function toYamlString(_0x508250){const _0x26188b=a137_0x49f2,_0x100483=stripInternalFields(_0x508250),_0x3d468b=a137_0x460fb8[_0x26188b(0x138)](_0x100483,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x26188b(0xe7)}),_0x29678f=[_0x26188b(0xcc),'activations:',_0x26188b(0x9e),'reentry:',_0x26188b(0xa1),_0x26188b(0x12a),_0x26188b(0x90)];let _0x352195=_0x3d468b;for(const _0x54e185 of _0x29678f){_0x352195=_0x352195[_0x26188b(0x129)](new RegExp('^('+_0x54e185+')','m'),(_0x5a443f,_0x16411f,_0x377c40)=>{if(_0x377c40===0x0||_0x352195[_0x377c40-0x1]==='\x0a'&&_0x352195[_0x377c40-0x2]==='\x0a')return _0x16411f;return'\x0a'+_0x16411f;});}return _0x352195;}function stripInternalFields(_0x2cb96d){const _0x4d0fa9=a137_0x49f2,{id:_0x290816,folder_id:_0x2b1cbd,bundle_id:_0x5c64fc,bundle_name:_0x1ce7c3,version:_0x2333df,allow_reentry:_0x46c742,..._0x104adb}=_0x2cb96d;return _0x104adb[_0x4d0fa9(0xbd)]&&(_0x104adb['journeys']=_0x104adb[_0x4d0fa9(0xbd)][_0x4d0fa9(0x143)](_0x21c8d8=>{const _0xbfdc09=_0x4d0fa9,{id:_0x23b11b,..._0x580b18}=_0x21c8d8;return{..._0x580b18,'stages':_0x580b18[_0xbfdc09(0x115)][_0xbfdc09(0x143)](stripStageInternalFields),..._0x21c8d8[_0xbfdc09(0x10b)]===!![]?{'latest':!![]}:{},..._0x104adb[_0xbfdc09(0xbd)][_0xbfdc09(0x9d)]===0x1&&_0x580b18[_0xbfdc09(0xf3)]==='v1'?{'version':undefined}:{}};})),_0x104adb[_0x4d0fa9(0x115)]&&(_0x104adb[_0x4d0fa9(0x115)]=_0x104adb[_0x4d0fa9(0x115)][_0x4d0fa9(0x143)](stripStageInternalFields)),_0x104adb[_0x4d0fa9(0xaf)]&&(_0x104adb[_0x4d0fa9(0xaf)]=_0x104adb['versions'][_0x4d0fa9(0x143)](_0x13e526=>{const _0x4069ab=_0x4d0fa9,{id:_0x36818c,..._0x294d29}=_0x13e526;return{..._0x294d29,'stages':_0x294d29['stages'][_0x4069ab(0x143)](stripStageInternalFields),..._0x13e526[_0x4069ab(0x10b)]===!![]?{'latest':!![]}:{}};})),_0x104adb;}function stripStageInternalFields(_0xc4bfe){const {id:_0x206244,..._0x1cb8f1}=_0xc4bfe;return _0x1cb8f1;}export function parseYamlString(_0x2ca303){return safeParseYaml(_0x2ca303,JourneyDefSchema);}export function isJourneyDef(_0xbe736a){const _0xd7aad3=a137_0x49f2;return typeof _0xbe736a==='object'&&_0xbe736a!==null&&_0xd7aad3(0xb6)in _0xbe736a&&_0xbe736a[_0xd7aad3(0xb6)]==='journey';}export function generateTemplate(_0x571330,_0x1a9025){const _0x4ac2f1=a137_0x49f2,_0x6cf233={'type':_0x4ac2f1(0x125),'name':_0x571330,'description':'Journey\x20description','reentry':_0x4ac2f1(0xcb),'goal':{'name':'Goal\x20Achieved','segment':'goal-segment'},'stages':[{'name':_0x4ac2f1(0xdc),'description':'First\x20stage\x20of\x20the\x20journey','entry_criteria':{'name':_0x4ac2f1(0x83),'segment':_0x1a9025},'steps':[{'type':_0x4ac2f1(0xcf),'name':_0x4ac2f1(0xca),'with':{'duration':0x1,'unit':_0x4ac2f1(0x11f)}},{'type':'activation','name':_0x4ac2f1(0xa6),'with':{'activation':_0x4ac2f1(0xda)}},{'type':_0x4ac2f1(0xc9),'name':_0x4ac2f1(0x10d)}]}]};return toYamlString(_0x6cf233);}function generateUUID(){return crypto['randomUUID']();}export const SEGMENT_REF_PREFIX=a137_0x111164(0x88);function a137_0x1845(){const _0x40d0db=['embedded','days_of_week','timedOutPath','exit_criteria','decision_point','rule','map','customized_split','version_number','sort','resolveEmbeddedSegmentId','isArray','Entry\x20Criteria','definition','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','And','\x20\x20\x20\x20conditions:\x0a','ref:','set','Expected\x20format:\x0a','draft','ABTest','week','launched','resolveSegment','versions:','folder_id','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','percentage','Date','resolveEmbeddedActivationId','data','all','has','entryCriteria','target','merge','branches','length','goal:','segment_id','1935HxvUUf','journeys:','\x20\x20rule:\x0a','all_columns','AbTest','reentryMode','Send\x20Notification','days','root_step','waitCondition','resolveSegmentName','customizedSplit','add','conditionSegmentId','uuid','versions','attributes','bundle_id','schedule','End','folder','segment','type','daysOfWeek','resolveSegmentId','push','9CDyGOR','*Max\x20wait\x20','entries','journeys','excluded','test','relationships','resolveStageId','activations','name','unit','conditionTimeoutUnit','Activation','16320GDUMFg','journeyStages','end','Wait\x201\x20Day','no_reentry','segments:','journeyName','stageId','wait','wait_until','shift','activation_template_id','size','resolveActivationName','duration','journeyBundleName','randomUUID','connection','with','your-activation-name','segments','Stage\x201','weeks','Variant','journeyActivationStepId','moveAfter','activation','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','includes','(missing)','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','startsWith','null','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','uniqueId','state','Met\x20condition(s)','next','get','allowReentry','isJourneyLocal','versionNumber','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','Duration','version','ab_test','rootStep','connector_config','342988jdhFFh','resolveActivation','milestone','2280992DcZXEv','parentFolder','DecisionPoint','object','waitStepUnit','values','reentry','Unknown\x20segment\x20\x22','journeyId','JOURNEY_SYNTAX_ERROR','find','behavior','conditions','description','resolveJumpTarget','stage','waitStep','latest','bundle_name','Stage\x20Complete','journeyStageId','2960652Mcnoio','waitUntilDate','columns','unique_id','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','journeyBundleId','stages','variants','notification','454090fQHFKZ','68041Ktyjqx','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','resolveActivationId','12980590jlHHEy','DaysOfTheWeek','stageName','day','\x27:\x20','ref','condition','keys','from','journey','segmentId','Merge','2FFMRgp','replace','stages:','filter','jump','\x20\x20\x20\x20type:\x20And\x0a','\x27.\x0a','toLowerCase','Jump','\x20\x20\x20\x20type:\x20','steps','match','resolveJourneyId','exitCriterias','entry_criteria','timeout','stringify','WaitStep','waitStepType','trim','goal'];a137_0x1845=function(){return _0x40d0db;};return a137_0x1845();}export function parseSegmentRef(_0x310282){const _0x448128=a137_0x111164;if(_0x310282['startsWith'](SEGMENT_REF_PREFIX))return{'type':_0x448128(0x121),'name':_0x310282['slice'](SEGMENT_REF_PREFIX[_0x448128(0x9d)])};if(/^\d+$/[_0x448128(0xbf)](_0x310282))return{'type':'id','name':_0x310282};return{'type':_0x448128(0x13d),'name':_0x310282};}export function makeSegmentRef(_0x8910ff){return''+SEGMENT_REF_PREFIX+_0x8910ff;}export function isExternalSegmentRef(_0x91ab1d){const _0x12fe30=a137_0x111164;return _0x91ab1d[_0x12fe30(0xe6)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0xcca7bc){const _0x32260f=a137_0x111164;return!!(_0xcca7bc[_0x32260f(0xbd)]&&_0xcca7bc[_0x32260f(0xbd)][_0x32260f(0x9d)]>0x0);}export function isMultiVersionMode(_0x1297e8){const _0x19718b=a137_0x111164;return!!(_0x1297e8[_0x19718b(0xaf)]&&_0x1297e8[_0x19718b(0xaf)][_0x19718b(0x9d)]>0x0);}export function isSingleVersionMode(_0x3eae25){const _0x303e60=a137_0x111164;return!!(_0x3eae25[_0x303e60(0x115)]&&_0x3eae25[_0x303e60(0x115)][_0x303e60(0x9d)]>0x0);}export function hasMultipleVersions(_0x8a964e){const _0x5d9a5e=a137_0x111164;if(isJourneysArrayMode(_0x8a964e))return(_0x8a964e[_0x5d9a5e(0xbd)]?.['length']||0x0)>0x1;if(isMultiVersionMode(_0x8a964e))return(_0x8a964e[_0x5d9a5e(0xaf)]?.[_0x5d9a5e(0x9d)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x19aa6f){const _0x4be9e8=a137_0x111164;if(isJourneysArrayMode(_0x19aa6f))return _0x19aa6f;if(isSingleVersionMode(_0x19aa6f)){const {stages:_0x5b5a58,id:_0x5018d3,version:_0x3670ee,version_number:_0x3fb7aa,..._0x4d0f5b}=_0x19aa6f;return{..._0x4d0f5b,'journeys':[{'version':_0x3670ee||'v1','stages':_0x5b5a58||[],'id':_0x5018d3,'version_number':_0x3fb7aa}]};}if(isMultiVersionMode(_0x19aa6f)){const {versions:_0x578486,..._0x4abc26}=_0x19aa6f;return{..._0x4abc26,'journeys':(_0x578486||[])[_0x4be9e8(0x143)](_0x11d604=>({'version':_0x11d604[_0x4be9e8(0xc3)],'state':_0x11d604[_0x4be9e8(0xea)],'latest':_0x11d604[_0x4be9e8(0x10b)],'stages':_0x11d604[_0x4be9e8(0x115)],'id':_0x11d604['id'],'version_number':_0x11d604[_0x4be9e8(0x7f)]}))};}return _0x19aa6f;}export function normalizeJourneyDef(_0x433587,_0x4fcbf0){const _0x28d45c=a137_0x111164,_0x5cf3cc=normalizeToJourneysFormat(_0x433587),_0x41807a=_0x4fcbf0?.[_0x28d45c(0xdb)]?Object[_0x28d45c(0x123)](_0x4fcbf0[_0x28d45c(0xdb)]):undefined,_0x4e8f91=_0x4fcbf0?.[_0x28d45c(0xc2)]?Object[_0x28d45c(0x123)](_0x4fcbf0[_0x28d45c(0xc2)]):undefined;return{'type':'journey','name':_0x5cf3cc[_0x28d45c(0xc3)],..._0x5cf3cc['description']!==undefined&&{'description':_0x5cf3cc[_0x28d45c(0x107)]},..._0x5cf3cc[_0x28d45c(0x13c)]&&{'goal':normalizeJourneyCriteria(_0x5cf3cc['goal'])},..._0x5cf3cc['reentry']!==undefined&&{'reentry':_0x5cf3cc[_0x28d45c(0x100)]},..._0x5cf3cc[_0x28d45c(0xdb)]&&{'segments':normalizeEmbeddedSegments(_0x5cf3cc[_0x28d45c(0xdb)],_0x41807a)},..._0x5cf3cc[_0x28d45c(0xc2)]&&{'activations':normalizeEmbeddedActivations(_0x5cf3cc[_0x28d45c(0xc2)],_0x4e8f91)},..._0x5cf3cc[_0x28d45c(0xbd)]&&{'journeys':_0x5cf3cc['journeys'][_0x28d45c(0x143)](_0x30a593=>normalizeJourneyEntry(_0x30a593,_0x5cf3cc[_0x28d45c(0xbd)]['length']===0x1))}};}function normalizeJourneyEntry(_0x37e348,_0x518bc2){const _0x15be2b=a137_0x111164;return{...!_0x518bc2&&_0x37e348[_0x15be2b(0xf3)]!==undefined&&{'version':_0x37e348[_0x15be2b(0xf3)]},..._0x37e348[_0x15be2b(0xea)]!==undefined&&{'state':_0x37e348['state']},...!_0x518bc2&&_0x37e348[_0x15be2b(0x10b)]!==undefined&&{'latest':_0x37e348[_0x15be2b(0x10b)]},..._0x37e348[_0x15be2b(0x7f)]!==undefined&&{'version_number':_0x37e348['version_number']},..._0x37e348['goal']&&{'goal':normalizeJourneyCriteria(_0x37e348[_0x15be2b(0x13c)])},..._0x37e348[_0x15be2b(0x100)]!==undefined&&{'reentry':_0x37e348['reentry']},'stages':_0x37e348[_0x15be2b(0x115)][_0x15be2b(0x143)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x521b3a){const _0x520dce=a137_0x111164;return{'name':_0x521b3a['name'],..._0x521b3a['description']!==undefined&&{'description':_0x521b3a['description']},..._0x521b3a[_0x520dce(0x136)]&&{'entry_criteria':normalizeJourneyCriteria(_0x521b3a['entry_criteria'])},..._0x521b3a['exit_criteria']&&{'exit_criteria':_0x521b3a['exit_criteria']['map'](normalizeJourneyCriteria)},..._0x521b3a['milestone']&&{'milestone':normalizeJourneyCriteria(_0x521b3a[_0x520dce(0xf9)])},..._0x521b3a[_0x520dce(0x132)]&&{'steps':normalizeStepsWithImplicitNext(_0x521b3a[_0x520dce(0x132)])}};}function normalizeStepsWithImplicitNext(_0x36fc2c){const _0x2eae5a=a137_0x111164;return _0x36fc2c[_0x2eae5a(0x143)]((_0x3c1a94,_0x1b45f8)=>{const _0x8d884b=_0x2eae5a,_0x3035f8=_0x1b45f8<_0x36fc2c[_0x8d884b(0x9d)]-0x1?_0x36fc2c[_0x1b45f8+0x1][_0x8d884b(0xc3)]:undefined;return normalizeJourneyStep(_0x3c1a94,_0x3035f8);});}function normalizeJourneyCriteria(_0x4ce50d){const _0x362a44=a137_0x111164;return{'name':_0x4ce50d[_0x362a44(0xc3)],..._0x4ce50d['description']!==undefined&&{'description':_0x4ce50d[_0x362a44(0x107)]},'segment':_0x4ce50d['segment'],..._0x4ce50d[_0x362a44(0x9a)]&&{'target':normalizeJumpTarget(_0x4ce50d[_0x362a44(0x9a)])}};}function normalizeJourneyStep(_0x306198,_0x39901e){const _0x4f1df0=a137_0x111164,_0x4eff7e=_0x306198[_0x4f1df0(0xec)]!==undefined&&_0x306198[_0x4f1df0(0xec)]!==_0x39901e,_0x488772={'type':_0x306198['type'],'name':_0x306198[_0x4f1df0(0xc3)],..._0x4eff7e&&{'next':_0x306198[_0x4f1df0(0xec)]}};if(_0x4f1df0(0xd9)in _0x306198&&_0x306198['with'])return{..._0x488772,'with':normalizeStepParams(_0x306198[_0x4f1df0(0xb6)],_0x306198[_0x4f1df0(0xd9)])};return _0x488772;}function normalizeStepParams(_0x3e8b5c,_0x5db9de){const _0x1517ba=a137_0x111164;switch(_0x3e8b5c){case _0x1517ba(0xcf):{const _0x30a1bc=_0x5db9de;let _0x1232f3;return _0x30a1bc[_0x1517ba(0x122)]&&(_0x1232f3={'segment':_0x30a1bc[_0x1517ba(0x122)]['segment'],..._0x30a1bc[_0x1517ba(0x122)]['next']!==undefined&&{'next':_0x30a1bc[_0x1517ba(0x122)][_0x1517ba(0xec)]},..._0x30a1bc['condition'][_0x1517ba(0x137)]&&{'timeout':{'duration':_0x30a1bc[_0x1517ba(0x122)][_0x1517ba(0x137)][_0x1517ba(0xd5)],'unit':_0x30a1bc[_0x1517ba(0x122)][_0x1517ba(0x137)][_0x1517ba(0xc4)],..._0x30a1bc[_0x1517ba(0x122)][_0x1517ba(0x137)][_0x1517ba(0xec)]!==undefined&&{'next':_0x30a1bc[_0x1517ba(0x122)][_0x1517ba(0x137)]['next']}}}}),{..._0x30a1bc[_0x1517ba(0xd5)]!==undefined&&{'duration':_0x30a1bc[_0x1517ba(0xd5)]},..._0x30a1bc[_0x1517ba(0xc4)]!==undefined&&{'unit':_0x30a1bc[_0x1517ba(0xc4)]},..._0x30a1bc[_0x1517ba(0xd0)]!==undefined&&{'wait_until':_0x30a1bc[_0x1517ba(0xd0)]},..._0x30a1bc[_0x1517ba(0x13e)]!==undefined&&{'days_of_week':_0x30a1bc[_0x1517ba(0x13e)]},..._0x1232f3&&{'condition':_0x1232f3}};}case _0x1517ba(0xe1):{const _0x4fb00e=_0x5db9de;return{'activation':_0x4fb00e[_0x1517ba(0xe1)]};}case _0x1517ba(0x141):{const _0x3e162e=_0x5db9de;return{'branches':_0x3e162e['branches']['map'](normalizeDecisionBranch)};}case _0x1517ba(0xf4):{const _0x222175=_0x5db9de;return{..._0x222175['customized_split']!==undefined&&{'customized_split':_0x222175[_0x1517ba(0x7e)]},..._0x222175['unique_id']!==undefined&&{'unique_id':_0x222175[_0x1517ba(0x112)]},'variants':_0x222175[_0x1517ba(0x116)][_0x1517ba(0x143)](normalizeAbTestVariant)};}case _0x1517ba(0x12c):{const _0x2b6415=_0x5db9de;return{'target':normalizeJumpTarget(_0x2b6415['target'])};}default:return _0x5db9de;}}function normalizeDecisionBranch(_0x53a225){const _0x166ec3=a137_0x111164;return{'name':_0x53a225[_0x166ec3(0xc3)],..._0x53a225[_0x166ec3(0xb5)]!==undefined&&{'segment':_0x53a225[_0x166ec3(0xb5)]},..._0x53a225[_0x166ec3(0xbe)]!==undefined&&{'excluded':_0x53a225[_0x166ec3(0xbe)]},..._0x53a225[_0x166ec3(0xec)]!==undefined&&{'next':_0x53a225[_0x166ec3(0xec)]}};}function normalizeAbTestVariant(_0x2d2483){const _0x1516a6=a137_0x111164;return{..._0x2d2483['id']!==undefined&&{'id':_0x2d2483['id']},'name':_0x2d2483[_0x1516a6(0xc3)],'percentage':_0x2d2483['percentage'],..._0x2d2483[_0x1516a6(0xec)]!==undefined&&{'next':_0x2d2483['next']}};}function normalizeJumpTarget(_0x5b6bdf){const _0x542c14=a137_0x111164;return{'journey':_0x5b6bdf[_0x542c14(0x125)],'stage':_0x5b6bdf[_0x542c14(0x109)],..._0x5b6bdf[_0x542c14(0xb1)]!==undefined&&{'bundle_id':_0x5b6bdf[_0x542c14(0xb1)]}};}function normalizeEmbeddedSegments(_0x387ef6,_0x2ac1b9){const _0xd801ba=a137_0x111164,_0x52c4a3={},_0x26d73f=Object[_0xd801ba(0x123)](_0x387ef6),_0x158da9=_0x2ac1b9?[..._0x2ac1b9[_0xd801ba(0x12b)](_0x308935=>_0x26d73f[_0xd801ba(0xe3)](_0x308935)),..._0x26d73f[_0xd801ba(0x12b)](_0xcc6e06=>!_0x2ac1b9[_0xd801ba(0xe3)](_0xcc6e06))[_0xd801ba(0x80)]()]:_0x26d73f[_0xd801ba(0x80)]();for(const _0x5b35b0 of _0x158da9){const _0x10715e=_0x387ef6[_0x5b35b0];if(_0x10715e['rule']){const _0x27b0d2=_0x10715e['rule'];if(_0x27b0d2[_0xd801ba(0xb6)]!==_0xd801ba(0x86)&&_0x27b0d2[_0xd801ba(0xb6)]!=='Or'){const _0x22dbee=_0x27b0d2[_0xd801ba(0xb6)]??_0xd801ba(0xe4);throw new SDKError(ErrorCode[_0xd801ba(0x103)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x5b35b0+_0xd801ba(0x120)+(_0xd801ba(0x11a)+_0x22dbee+_0xd801ba(0x12e))+_0xd801ba(0x8a)+_0xd801ba(0xa2)+_0xd801ba(0x12d)+_0xd801ba(0x87)+_0xd801ba(0x85)+_0xd801ba(0x113)+_0xd801ba(0xe8));}if(!_0x27b0d2[_0xd801ba(0x106)]||!Array[_0xd801ba(0x82)](_0x27b0d2[_0xd801ba(0x106)]))throw new SDKError(ErrorCode[_0xd801ba(0x103)],_0xd801ba(0xe2)+_0x5b35b0+_0xd801ba(0x120)+_0xd801ba(0x92)+_0xd801ba(0x8a)+_0xd801ba(0xa2)+(_0xd801ba(0x131)+_0x27b0d2['type']+'\x0a')+_0xd801ba(0x87)+_0xd801ba(0x85)+_0xd801ba(0x113)+_0xd801ba(0xe8));}_0x52c4a3[_0x5b35b0]={..._0x10715e[_0xd801ba(0x107)]&&_0x10715e[_0xd801ba(0x107)][_0xd801ba(0x13b)]()&&{'description':_0x10715e[_0xd801ba(0x107)]},..._0x10715e['rule']&&{'rule':deepSortObject(_0x10715e[_0xd801ba(0x142)])}};}return _0x52c4a3;}function normalizeEmbeddedActivations(_0x49170c,_0x2458af){const _0xe7f41e=a137_0x111164,_0x365fb7={},_0x2f9a5d=Object[_0xe7f41e(0x123)](_0x49170c),_0x4f1fc=_0x2458af?[..._0x2458af[_0xe7f41e(0x12b)](_0x462bc5=>_0x2f9a5d['includes'](_0x462bc5)),..._0x2f9a5d[_0xe7f41e(0x12b)](_0x2fbf2e=>!_0x2458af[_0xe7f41e(0xe3)](_0x2fbf2e))['sort']()]:_0x2f9a5d[_0xe7f41e(0x80)]();for(const _0x1803f9 of _0x4f1fc){const _0x58653e=_0x49170c[_0x1803f9];_0x365fb7[_0x1803f9]={'name':_0x58653e['name'],'connection':_0x58653e[_0xe7f41e(0xd8)],..._0x58653e[_0xe7f41e(0x107)]!==undefined&&{'description':_0x58653e[_0xe7f41e(0x107)]},..._0x58653e[_0xe7f41e(0xa3)]!==undefined&&{'all_columns':_0x58653e['all_columns']},..._0x58653e[_0xe7f41e(0x111)]!==undefined&&{'columns':_0x58653e['columns']},..._0x58653e['behavior']!==undefined&&{'behavior':_0x58653e[_0xe7f41e(0x105)]},..._0x58653e[_0xe7f41e(0xb2)]!==undefined&&{'schedule':_0x58653e[_0xe7f41e(0xb2)]},..._0x58653e['notification']!==undefined&&{'notification':_0x58653e[_0xe7f41e(0x117)]},..._0x58653e[_0xe7f41e(0xf6)]!==undefined&&{'connector_config':_0x58653e[_0xe7f41e(0xf6)]},..._0x58653e[_0xe7f41e(0xd2)]!==undefined&&{'activation_template_id':_0x58653e['activation_template_id']}};}return _0x365fb7;}export function getActiveStages(_0x1fbeb2){const _0x46ab05=a137_0x111164;if(isJourneysArrayMode(_0x1fbeb2)){const _0x410ee9=_0x1fbeb2[_0x46ab05(0xbd)]||[],_0x342302=_0x410ee9[_0x46ab05(0x104)](_0x461f0c=>_0x461f0c['latest']===!![])||_0x410ee9[0x0];return _0x342302?.[_0x46ab05(0x115)]||[];}if(isSingleVersionMode(_0x1fbeb2))return _0x1fbeb2[_0x46ab05(0x115)]||[];if(isMultiVersionMode(_0x1fbeb2)){const _0x4b417f=_0x1fbeb2['versions']||[],_0x170cb1=_0x4b417f['find'](_0x343a22=>_0x343a22['latest']===!![])||_0x4b417f[0x0];return _0x170cb1?.[_0x46ab05(0x115)]||[];}return[];}export function getLatestJourneyEntry(_0x29ca6f){const _0xf381cf=a137_0x111164;if(isJourneysArrayMode(_0x29ca6f)){const _0x34843f=_0x29ca6f[_0xf381cf(0xbd)]||[];return _0x34843f[_0xf381cf(0x104)](_0x5448bf=>_0x5448bf[_0xf381cf(0x10b)]===!![])||_0x34843f[0x0];}if(isMultiVersionMode(_0x29ca6f)){const _0x481449=_0x29ca6f[_0xf381cf(0xaf)]||[],_0x15bffb=_0x481449[_0xf381cf(0x104)](_0x51e893=>_0x51e893[_0xf381cf(0x10b)]===!![])||_0x481449[0x0];if(_0x15bffb)return{'version':_0x15bffb[_0xf381cf(0xc3)],'state':_0x15bffb[_0xf381cf(0xea)],'latest':_0x15bffb[_0xf381cf(0x10b)],'stages':_0x15bffb[_0xf381cf(0x115)],'id':_0x15bffb['id'],'version_number':_0x15bffb[_0xf381cf(0x7f)]};}if(isSingleVersionMode(_0x29ca6f))return{'version':_0x29ca6f['version']||'v1','state':_0xf381cf(0x8b),'stages':_0x29ca6f[_0xf381cf(0x115)]||[],'id':_0x29ca6f['id'],'version_number':_0x29ca6f[_0xf381cf(0x7f)],'goal':_0x29ca6f[_0xf381cf(0x13c)],'reentry':_0x29ca6f[_0xf381cf(0x100)]};return undefined;}export function getLatestVersion(_0x3e465a){const _0x222dc3=a137_0x111164;if(!isMultiVersionMode(_0x3e465a))return undefined;const _0x2def94=_0x3e465a[_0x222dc3(0xaf)]||[];return _0x2def94[_0x222dc3(0x104)](_0x7f614=>_0x7f614[_0x222dc3(0x10b)]===!![])||_0x2def94[0x0];}export function getEffectiveGoal(_0x25f10a){const _0x3ef616=a137_0x111164,_0x1e3a08=getLatestJourneyEntry(_0x25f10a);return _0x1e3a08?.[_0x3ef616(0x13c)]||_0x25f10a[_0x3ef616(0x13c)];}export function getEffectiveReentry(_0x35b8e2){const _0x274e1e=a137_0x111164,_0x3217ea=getLatestJourneyEntry(_0x35b8e2);return _0x3217ea?.[_0x274e1e(0x100)]||_0x35b8e2[_0x274e1e(0x100)];}export function collectSegmentRefs(_0x550554){const _0x8ae18e=a137_0x111164,_0x34835=new Set();_0x550554['goal']?.[_0x8ae18e(0xb5)]&&_0x34835[_0x8ae18e(0xac)](_0x550554[_0x8ae18e(0x13c)][_0x8ae18e(0xb5)]);const _0x42175e=_0x264a96=>{const _0xc6dac7=_0x8ae18e;for(const _0x21e5c7 of _0x264a96){_0x21e5c7[_0xc6dac7(0x136)]?.[_0xc6dac7(0xb5)]&&_0x34835[_0xc6dac7(0xac)](_0x21e5c7[_0xc6dac7(0x136)][_0xc6dac7(0xb5)]);if(_0x21e5c7[_0xc6dac7(0x140)])for(const _0x506a33 of _0x21e5c7['exit_criteria']){_0x506a33['segment']&&_0x34835[_0xc6dac7(0xac)](_0x506a33['segment']);}_0x21e5c7[_0xc6dac7(0xf9)]?.['segment']&&_0x34835[_0xc6dac7(0xac)](_0x21e5c7[_0xc6dac7(0xf9)][_0xc6dac7(0xb5)]);if(_0x21e5c7[_0xc6dac7(0x132)])for(const _0x11d35b of _0x21e5c7[_0xc6dac7(0x132)]){if(_0x11d35b['type']===_0xc6dac7(0x141)){const _0x50f8da=_0x11d35b;for(const _0x2d52c5 of _0x50f8da[_0xc6dac7(0xd9)][_0xc6dac7(0x9c)]){_0x2d52c5[_0xc6dac7(0xb5)]&&_0x34835['add'](_0x2d52c5[_0xc6dac7(0xb5)]);}}else{if(_0x11d35b[_0xc6dac7(0xb6)]===_0xc6dac7(0xcf)){const _0x254e1b=_0x11d35b;_0x254e1b[_0xc6dac7(0xd9)]['condition']?.[_0xc6dac7(0xb5)]&&_0x34835['add'](_0x254e1b['with'][_0xc6dac7(0x122)]['segment']);}}}}};_0x550554['stages']&&_0x42175e(_0x550554['stages']);if(_0x550554['versions'])for(const _0xb3c2e of _0x550554[_0x8ae18e(0xaf)]){_0x42175e(_0xb3c2e[_0x8ae18e(0x115)]);}return _0x34835;}export function validateSegmentRefs(_0x52cfc0){const _0x52f6bf=a137_0x111164,_0x4dafff=[],_0x5a6b0b=collectSegmentRefs(_0x52cfc0),_0x22afa2=new Set(Object[_0x52f6bf(0x123)](_0x52cfc0[_0x52f6bf(0xdb)]||{}));for(const _0x197c02 of _0x5a6b0b){const _0x3a3efa=parseSegmentRef(_0x197c02);_0x3a3efa[_0x52f6bf(0xb6)]===_0x52f6bf(0x13d)&&!_0x22afa2[_0x52f6bf(0x98)](_0x3a3efa[_0x52f6bf(0xc3)])&&_0x4dafff['push'](_0x52f6bf(0x101)+_0x3a3efa[_0x52f6bf(0xc3)]+_0x52f6bf(0xe5)+_0x3a3efa[_0x52f6bf(0xc3)]+_0x52f6bf(0xf1));}return _0x4dafff;}export function collectSegmentIdsFromJourneyApi(_0xf94d27){const _0xf60a8f=a137_0x111164,_0x4a628e=new Set();_0xf94d27[_0xf60a8f(0xb0)][_0xf60a8f(0x13c)]?.[_0xf60a8f(0x126)]&&_0x4a628e['add'](_0xf94d27['attributes']['goal'][_0xf60a8f(0x126)]);const _0x1867f5=_0xf94d27[_0xf60a8f(0xb0)][_0xf60a8f(0xc8)];if(Array[_0xf60a8f(0x82)](_0x1867f5))for(const _0x40115c of _0x1867f5){_0x40115c[_0xf60a8f(0x99)]?.[_0xf60a8f(0x126)]&&_0x4a628e[_0xf60a8f(0xac)](_0x40115c[_0xf60a8f(0x99)]['segmentId']);const _0xd7b14c=_0x40115c[_0xf60a8f(0x135)]??_0x40115c['exitCriteria'];if(Array['isArray'](_0xd7b14c))for(const _0x579b2f of _0xd7b14c){_0x579b2f[_0xf60a8f(0x126)]&&_0x4a628e[_0xf60a8f(0xac)](_0x579b2f[_0xf60a8f(0x126)]);}_0x40115c[_0xf60a8f(0xf9)]?.[_0xf60a8f(0x126)]&&_0x4a628e[_0xf60a8f(0xac)](_0x40115c[_0xf60a8f(0xf9)][_0xf60a8f(0x126)]);if(_0x40115c[_0xf60a8f(0x132)]&&typeof _0x40115c[_0xf60a8f(0x132)]===_0xf60a8f(0xfd)){const _0x381672=Array[_0xf60a8f(0x82)](_0x40115c['steps'])?_0x40115c['steps']:Object[_0xf60a8f(0xff)](_0x40115c[_0xf60a8f(0x132)]);for(const _0x46c288 of _0x381672){_0x46c288[_0xf60a8f(0xa9)]?.[_0xf60a8f(0x126)]&&_0x4a628e['add'](_0x46c288['waitCondition'][_0xf60a8f(0x126)]);const _0x106008=_0x46c288;_0x106008[_0xf60a8f(0xad)]&&_0x4a628e[_0xf60a8f(0xac)](_0x106008[_0xf60a8f(0xad)]);if(Array['isArray'](_0x106008[_0xf60a8f(0x106)]))for(const _0x1cedf4 of _0x106008[_0xf60a8f(0x106)]){_0x1cedf4[_0xf60a8f(0x126)]&&_0x4a628e[_0xf60a8f(0xac)](_0x1cedf4[_0xf60a8f(0x126)]);}if(Array[_0xf60a8f(0x82)](_0x46c288[_0xf60a8f(0x9c)]))for(const _0x47e1ae of _0x46c288[_0xf60a8f(0x9c)]){_0x47e1ae['segmentId']&&_0x4a628e[_0xf60a8f(0xac)](_0x47e1ae[_0xf60a8f(0x126)]);}}}}return _0x4a628e;}
1
+ const a146_0x6eff7=a146_0x417f;(function(_0x2a5ad6,_0x6245e3){const _0x4511cb=a146_0x417f,_0x4c7883=_0x2a5ad6();while(!![]){try{const _0x25f061=parseInt(_0x4511cb(0x1ad))/0x1+-parseInt(_0x4511cb(0x16f))/0x2+parseInt(_0x4511cb(0x16e))/0x3+-parseInt(_0x4511cb(0x1d2))/0x4+-parseInt(_0x4511cb(0x1c1))/0x5+parseInt(_0x4511cb(0x1ec))/0x6+parseInt(_0x4511cb(0x190))/0x7*(parseInt(_0x4511cb(0x185))/0x8);if(_0x25f061===_0x6245e3)break;else _0x4c7883['push'](_0x4c7883['shift']());}catch(_0x26bcbf){_0x4c7883['push'](_0x4c7883['shift']());}}}(a146_0x55fb,0xe5c1d));import*as a146_0x577435 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0xc995e5){const _0x327a5d=a146_0x417f,_0xcc2e87=_0xc995e5['toLowerCase']();if(_0xcc2e87===_0x327a5d(0x13b)||_0xcc2e87===_0x327a5d(0x1d7))return _0x327a5d(0x1d7);if(_0xcc2e87==='weeks'||_0xcc2e87===_0x327a5d(0x1d3))return _0x327a5d(0x1d3);return _0xc995e5;}export function journeyResponseToDefSync(_0x177cba){const _0x32bf28=a146_0x417f,_0x538d42=_0x177cba[_0x32bf28(0x13e)],_0x7fea3d=_0x538d42[_0x32bf28(0x1e5)]||_0x538d42[_0x32bf28(0x152)],_0x121695={'stages':_0x538d42[_0x32bf28(0x1db)][_0x32bf28(0x171)](convertApiStageToYaml),'id':_0x177cba['id']};_0x538d42['goal']&&(_0x121695[_0x32bf28(0x19e)]=convertApiCriteriaToYaml(_0x538d42[_0x32bf28(0x19e)]));_0x538d42[_0x32bf28(0x152)]&&_0x538d42['name']!==_0x7fea3d&&(_0x121695[_0x32bf28(0x163)]=_0x538d42[_0x32bf28(0x152)]);_0x538d42[_0x32bf28(0x1d5)]!==undefined&&(_0x121695['version_number']=_0x538d42[_0x32bf28(0x1d5)]);_0x538d42[_0x32bf28(0x158)]&&(_0x121695[_0x32bf28(0x158)]=_0x538d42[_0x32bf28(0x158)]===_0x32bf28(0x1dc)?_0x32bf28(0x1dc):'draft');const _0x12e68f={'type':_0x32bf28(0x13c),'name':_0x7fea3d,'journeys':[_0x121695]};_0x538d42[_0x32bf28(0x18c)]&&(_0x12e68f[_0x32bf28(0x18c)]=_0x538d42[_0x32bf28(0x18c)]);_0x538d42[_0x32bf28(0x19e)]&&(_0x12e68f[_0x32bf28(0x19e)]=convertApiCriteriaToYaml(_0x538d42[_0x32bf28(0x19e)]));if(_0x538d42['reentryMode'])_0x12e68f[_0x32bf28(0x132)]=_0x538d42[_0x32bf28(0x162)];else _0x538d42['allowReentry']!==undefined&&(_0x12e68f[_0x32bf28(0x132)]=_0x538d42['allowReentry']?_0x32bf28(0x17a):_0x32bf28(0x19c));return _0x538d42[_0x32bf28(0x14e)]&&(_0x12e68f[_0x32bf28(0x191)]=_0x538d42['journeyBundleId']),_0x538d42['journeyBundleName']&&(_0x12e68f['bundle_name']=_0x538d42[_0x32bf28(0x1e5)]),_0x177cba[_0x32bf28(0x13f)]?.[_0x32bf28(0x17f)]?.[_0x32bf28(0x16b)]?.['id']&&(_0x12e68f[_0x32bf28(0x138)]=_0x177cba['relationships']['parentFolder'][_0x32bf28(0x16b)]['id']),_0x12e68f;}export async function journeyResponseToDef(_0x59578c,_0x59e943){const _0x526b66=a146_0x417f,_0x559e7c=journeyResponseToDefSync(_0x59578c);if(!_0x59e943)return _0x559e7c;const _0xd6c384=new Set();collectSegmentIdsFromJourney(_0x559e7c,_0xd6c384);const _0x370c3c=new Set();collectActivationIdsFromJourney(_0x559e7c,_0x370c3c);const _0x245208={},_0x208eb1=new Map();for(const _0x36b21e of Array[_0x526b66(0x1eb)](_0xd6c384)[_0x526b66(0x18a)]()){if(_0x59e943[_0x526b66(0x1c2)]){const _0x103942=await _0x59e943['resolveSegment'](_0x36b21e);if(_0x103942[_0x526b66(0x1a4)]){_0x208eb1['set'](_0x36b21e,_0x103942[_0x526b66(0x152)]);if(_0x103942['definition']){const _0x4bfb4f={..._0x103942[_0x526b66(0x1c3)],'rule':deepSortObject(_0x103942[_0x526b66(0x1c3)][_0x526b66(0x1c9)])};_0x245208[_0x103942[_0x526b66(0x152)]]=_0x4bfb4f;}}else _0x208eb1[_0x526b66(0x18f)](_0x36b21e,makeSegmentRef(_0x103942[_0x526b66(0x152)]));}else{if(_0x59e943[_0x526b66(0x18b)]){const _0x57c89b=await _0x59e943[_0x526b66(0x18b)](_0x36b21e);_0x208eb1[_0x526b66(0x18f)](_0x36b21e,_0x57c89b);}}}const _0x11a64e={},_0x1ab527=new Map();for(const _0xe3e9d5 of Array[_0x526b66(0x1eb)](_0x370c3c)[_0x526b66(0x18a)]()){if(_0x59e943['resolveActivation']){const _0x1f2aa7=await _0x59e943['resolveActivation'](_0xe3e9d5);_0x1f2aa7[_0x526b66(0x1a4)]?(_0x1ab527[_0x526b66(0x18f)](_0xe3e9d5,_0x1f2aa7[_0x526b66(0x152)]),_0x1f2aa7['definition']&&(_0x11a64e[_0x1f2aa7['name']]=_0x1f2aa7[_0x526b66(0x1c3)])):_0x1ab527[_0x526b66(0x18f)](_0xe3e9d5,makeSegmentRef(_0x1f2aa7['name']));}else{if(_0x59e943['resolveActivationName']){const _0x2fa649=await _0x59e943[_0x526b66(0x1d9)](_0xe3e9d5);_0x1ab527[_0x526b66(0x18f)](_0xe3e9d5,_0x2fa649);}}}_0x208eb1[_0x526b66(0x167)]>0x0&&replaceSegmentIdsInJourney(_0x559e7c,_0x208eb1);_0x1ab527[_0x526b66(0x167)]>0x0&&replaceActivationIdsInJourney(_0x559e7c,_0x1ab527);if(_0x59e943[_0x526b66(0x1d0)]){const _0xa5182a=[];collectJumpTargetsFromJourney(_0x559e7c,_0xa5182a);if(_0xa5182a[_0x526b66(0x19b)]>0x0){const _0x2df367=new Map();for(const _0x347ecf of _0xa5182a){try{const _0x15a2ac=await _0x59e943[_0x526b66(0x1d0)](_0x347ecf['journeyId'],_0x347ecf['stageId']);_0x2df367['set'](_0x347ecf[_0x526b66(0x19d)]+':'+_0x347ecf[_0x526b66(0x15f)],_0x15a2ac);}catch{}}_0x2df367[_0x526b66(0x167)]>0x0&&replaceJumpTargetsInJourney(_0x559e7c,_0x2df367);}}return Object[_0x526b66(0x15c)](_0x245208)['length']>0x0&&(_0x559e7c['segments']=_0x245208),Object[_0x526b66(0x15c)](_0x11a64e)[_0x526b66(0x19b)]>0x0&&(_0x559e7c[_0x526b66(0x164)]=_0x11a64e),_0x559e7c;}function collectSegmentIdsFromJourney(_0x5e20ba,_0x2c0bc2){const _0x56e936=a146_0x417f;_0x5e20ba[_0x56e936(0x19e)]?.[_0x56e936(0x186)]&&_0x2c0bc2['add'](_0x5e20ba['goal'][_0x56e936(0x186)]);const _0x3cfb02=_0x43b883=>{const _0xf84c75=_0x56e936;for(const _0x4a7c81 of _0x43b883){_0x4a7c81[_0xf84c75(0x18d)]?.[_0xf84c75(0x186)]&&_0x2c0bc2[_0xf84c75(0x192)](_0x4a7c81[_0xf84c75(0x18d)][_0xf84c75(0x186)]);if(_0x4a7c81['exit_criteria'])for(const _0x32bd5f of _0x4a7c81[_0xf84c75(0x1cc)]){_0x32bd5f['segment']&&_0x2c0bc2[_0xf84c75(0x192)](_0x32bd5f['segment']);}_0x4a7c81[_0xf84c75(0x1ce)]?.[_0xf84c75(0x186)]&&_0x2c0bc2[_0xf84c75(0x192)](_0x4a7c81[_0xf84c75(0x1ce)][_0xf84c75(0x186)]);if(_0x4a7c81[_0xf84c75(0x1e8)])for(const _0x4c38fa of _0x4a7c81['steps']){if(_0x4c38fa[_0xf84c75(0x1a7)]==='decision_point'){const _0x2740ba=_0x4c38fa;for(const _0xce1f5a of _0x2740ba['with'][_0xf84c75(0x1ee)]){_0xce1f5a[_0xf84c75(0x186)]&&_0x2c0bc2[_0xf84c75(0x192)](_0xce1f5a[_0xf84c75(0x186)]);}}else{if(_0x4c38fa[_0xf84c75(0x1a7)]===_0xf84c75(0x1b9)){const _0x460d3f=_0x4c38fa;_0x460d3f[_0xf84c75(0x1bb)][_0xf84c75(0x160)]?.[_0xf84c75(0x186)]&&_0x2c0bc2[_0xf84c75(0x192)](_0x460d3f[_0xf84c75(0x1bb)][_0xf84c75(0x160)]['segment']);}}}}};if(_0x5e20ba['journeys'])for(const _0x488a02 of _0x5e20ba[_0x56e936(0x146)]){_0x488a02[_0x56e936(0x19e)]?.[_0x56e936(0x186)]&&_0x2c0bc2[_0x56e936(0x192)](_0x488a02['goal']['segment']),_0x3cfb02(_0x488a02[_0x56e936(0x1b3)]);}_0x5e20ba[_0x56e936(0x1b3)]&&_0x3cfb02(_0x5e20ba[_0x56e936(0x1b3)]);if(_0x5e20ba['versions'])for(const _0x167404 of _0x5e20ba['versions']){_0x3cfb02(_0x167404['stages']);}}function replaceSegmentIdsInJourney(_0x2a8023,_0x4e9160){const _0x1fb128=a146_0x417f,_0x3dfd35=_0x3c6c01=>_0x4e9160['get'](_0x3c6c01)||_0x3c6c01;_0x2a8023['goal']?.[_0x1fb128(0x186)]&&(_0x2a8023[_0x1fb128(0x19e)][_0x1fb128(0x186)]=_0x3dfd35(_0x2a8023[_0x1fb128(0x19e)][_0x1fb128(0x186)]));const _0x30f103=_0x4164dc=>{const _0x5a1969=_0x1fb128;for(const _0x345b7a of _0x4164dc){_0x345b7a[_0x5a1969(0x18d)]?.[_0x5a1969(0x186)]&&(_0x345b7a['entry_criteria'][_0x5a1969(0x186)]=_0x3dfd35(_0x345b7a['entry_criteria'][_0x5a1969(0x186)]));if(_0x345b7a['exit_criteria'])for(const _0x3c1e16 of _0x345b7a[_0x5a1969(0x1cc)]){_0x3c1e16['segment']&&(_0x3c1e16[_0x5a1969(0x186)]=_0x3dfd35(_0x3c1e16[_0x5a1969(0x186)]));}_0x345b7a[_0x5a1969(0x1ce)]?.[_0x5a1969(0x186)]&&(_0x345b7a[_0x5a1969(0x1ce)][_0x5a1969(0x186)]=_0x3dfd35(_0x345b7a[_0x5a1969(0x1ce)][_0x5a1969(0x186)]));if(_0x345b7a[_0x5a1969(0x1e8)])for(const _0x96fbaa of _0x345b7a['steps']){if(_0x96fbaa[_0x5a1969(0x1a7)]===_0x5a1969(0x1df)){const _0x40dc08=_0x96fbaa;for(const _0x5c2929 of _0x40dc08[_0x5a1969(0x1bb)]['branches']){_0x5c2929['segment']&&(_0x5c2929[_0x5a1969(0x186)]=_0x3dfd35(_0x5c2929[_0x5a1969(0x186)]));}}else{if(_0x96fbaa['type']==='wait'){const _0x3163bc=_0x96fbaa;_0x3163bc[_0x5a1969(0x1bb)][_0x5a1969(0x160)]?.[_0x5a1969(0x186)]&&(_0x3163bc[_0x5a1969(0x1bb)]['condition'][_0x5a1969(0x186)]=_0x3dfd35(_0x3163bc['with'][_0x5a1969(0x160)]['segment']));}}}}};if(_0x2a8023[_0x1fb128(0x146)])for(const _0x14a88e of _0x2a8023['journeys']){_0x14a88e[_0x1fb128(0x19e)]?.[_0x1fb128(0x186)]&&(_0x14a88e[_0x1fb128(0x19e)][_0x1fb128(0x186)]=_0x3dfd35(_0x14a88e[_0x1fb128(0x19e)][_0x1fb128(0x186)])),_0x30f103(_0x14a88e[_0x1fb128(0x1b3)]);}_0x2a8023[_0x1fb128(0x1b3)]&&_0x30f103(_0x2a8023['stages']);if(_0x2a8023['versions'])for(const _0x5ad7da of _0x2a8023[_0x1fb128(0x147)]){_0x30f103(_0x5ad7da[_0x1fb128(0x1b3)]);}}function collectActivationIdsFromJourney(_0x5ae166,_0x2032ae){const _0xe42bc8=a146_0x417f,_0x14f0d2=_0xc62c8f=>{const _0x31e1c0=a146_0x417f;for(const _0x233f9b of _0xc62c8f){if(_0x233f9b[_0x31e1c0(0x1e8)])for(const _0x1f35f2 of _0x233f9b[_0x31e1c0(0x1e8)]){if(_0x1f35f2[_0x31e1c0(0x1a7)]===_0x31e1c0(0x1af)){const _0x45de8d=_0x1f35f2;_0x45de8d[_0x31e1c0(0x1bb)][_0x31e1c0(0x1af)]&&/^\d+$/[_0x31e1c0(0x1a2)](_0x45de8d[_0x31e1c0(0x1bb)][_0x31e1c0(0x1af)])&&_0x2032ae['add'](_0x45de8d['with'][_0x31e1c0(0x1af)]);}}}};if(_0x5ae166[_0xe42bc8(0x146)])for(const _0x3770c7 of _0x5ae166[_0xe42bc8(0x146)]){_0x14f0d2(_0x3770c7['stages']);}_0x5ae166[_0xe42bc8(0x1b3)]&&_0x14f0d2(_0x5ae166[_0xe42bc8(0x1b3)]);if(_0x5ae166[_0xe42bc8(0x147)])for(const _0x229ff8 of _0x5ae166[_0xe42bc8(0x147)]){_0x14f0d2(_0x229ff8['stages']);}}function replaceActivationIdsInJourney(_0x164baa,_0x549819){const _0x2d905c=a146_0x417f,_0x1d9064=_0x1b4360=>_0x549819[_0x2d905c(0x155)](_0x1b4360)||_0x1b4360,_0x490c33=_0x36d396=>{const _0x203c13=_0x2d905c;for(const _0x59e36a of _0x36d396){if(_0x59e36a[_0x203c13(0x1e8)])for(const _0x32e202 of _0x59e36a[_0x203c13(0x1e8)]){if(_0x32e202[_0x203c13(0x1a7)]==='activation'){const _0x55d407=_0x32e202;_0x55d407[_0x203c13(0x1bb)][_0x203c13(0x1af)]&&(_0x55d407[_0x203c13(0x1bb)][_0x203c13(0x1af)]=_0x1d9064(_0x55d407[_0x203c13(0x1bb)]['activation']));}}}};if(_0x164baa[_0x2d905c(0x146)])for(const _0x3b629f of _0x164baa[_0x2d905c(0x146)]){_0x490c33(_0x3b629f[_0x2d905c(0x1b3)]);}_0x164baa['stages']&&_0x490c33(_0x164baa[_0x2d905c(0x1b3)]);if(_0x164baa[_0x2d905c(0x147)])for(const _0x5e2a9d of _0x164baa[_0x2d905c(0x147)]){_0x490c33(_0x5e2a9d[_0x2d905c(0x1b3)]);}}function collectJumpTargetsFromJourney(_0x303b83,_0x35a5c3){const _0x11e9b6=a146_0x417f,_0x17af35=new Set(),_0x56444a=_0x44eda0=>{const _0x38bf9b=a146_0x417f;for(const _0x4ad913 of _0x44eda0){if(_0x4ad913[_0x38bf9b(0x1e8)])for(const _0x43e1cf of _0x4ad913[_0x38bf9b(0x1e8)]){if(_0x43e1cf[_0x38bf9b(0x1a7)]===_0x38bf9b(0x142)){const _0x947b11=_0x43e1cf,_0x8647a8=_0x947b11[_0x38bf9b(0x1bb)][_0x38bf9b(0x199)];if(_0x8647a8[_0x38bf9b(0x13c)]&&_0x8647a8['stage']&&/^\d+$/['test'](_0x8647a8[_0x38bf9b(0x13c)])&&/^\d+$/[_0x38bf9b(0x1a2)](_0x8647a8['stage'])){const _0xe6c116=_0x8647a8['journey']+':'+_0x8647a8[_0x38bf9b(0x169)];!_0x17af35['has'](_0xe6c116)&&(_0x17af35['add'](_0xe6c116),_0x35a5c3[_0x38bf9b(0x188)]({'journeyId':_0x8647a8[_0x38bf9b(0x13c)],'stageId':_0x8647a8['stage']}));}}}}};if(_0x303b83[_0x11e9b6(0x146)])for(const _0xee8ae6 of _0x303b83[_0x11e9b6(0x146)]){_0x56444a(_0xee8ae6[_0x11e9b6(0x1b3)]);}_0x303b83[_0x11e9b6(0x1b3)]&&_0x56444a(_0x303b83['stages']);if(_0x303b83[_0x11e9b6(0x147)])for(const _0x5ad6d2 of _0x303b83['versions']){_0x56444a(_0x5ad6d2[_0x11e9b6(0x1b3)]);}}function replaceJumpTargetsInJourney(_0x181ab6,_0x2eda2d){const _0xb661cb=a146_0x417f,_0x462e33=_0x56d272=>{const _0x7bf0ff=a146_0x417f;for(const _0x2a6127 of _0x56d272){if(_0x2a6127['steps'])for(const _0x1ace5e of _0x2a6127[_0x7bf0ff(0x1e8)]){if(_0x1ace5e[_0x7bf0ff(0x1a7)]===_0x7bf0ff(0x142)){const _0x38612c=_0x1ace5e,_0x1038a7=_0x38612c[_0x7bf0ff(0x1bb)][_0x7bf0ff(0x199)],_0x105166=_0x1038a7[_0x7bf0ff(0x13c)]+':'+_0x1038a7[_0x7bf0ff(0x169)],_0x1ec7de=_0x2eda2d[_0x7bf0ff(0x155)](_0x105166);_0x1ec7de&&(_0x1038a7[_0x7bf0ff(0x13c)]=_0x1ec7de[_0x7bf0ff(0x1b4)],_0x1038a7['stage']=_0x1ec7de[_0x7bf0ff(0x149)]);}}}};if(_0x181ab6[_0xb661cb(0x146)])for(const _0x5d6a31 of _0x181ab6['journeys']){_0x462e33(_0x5d6a31[_0xb661cb(0x1b3)]);}_0x181ab6[_0xb661cb(0x1b3)]&&_0x462e33(_0x181ab6[_0xb661cb(0x1b3)]);if(_0x181ab6[_0xb661cb(0x147)])for(const _0x17ed90 of _0x181ab6[_0xb661cb(0x147)]){_0x462e33(_0x17ed90[_0xb661cb(0x1b3)]);}}function generateReadableStepName(_0x359b7c,_0x108f4f){const _0x148551=a146_0x417f;if(_0x359b7c[_0x148551(0x152)]&&_0x359b7c[_0x148551(0x152)]!==_0x359b7c[_0x148551(0x1a7)]){const _0xbcfec7=_0x359b7c[_0x148551(0x152)][_0x148551(0x14d)]();if(_0xbcfec7&&/[a-z0-9\p{L}]/iu['test'](_0xbcfec7))return _0xbcfec7;}const _0x993e08=_0x359b7c[_0x148551(0x1a7)][_0x148551(0x15a)]()['replace'](/step$/i,'');return _0x993e08+'_'+(_0x108f4f+0x1);}function getStepNextRefs(_0x577d97){const _0x3814fa=a146_0x417f,_0x28cc29=[];if(_0x577d97[_0x3814fa(0x1bf)])_0x28cc29['push'](_0x577d97[_0x3814fa(0x1bf)]);if(_0x577d97[_0x3814fa(0x1ee)])for(const _0x5617a1 of _0x577d97['branches']){if(_0x5617a1[_0x3814fa(0x1bf)])_0x28cc29['push'](_0x5617a1[_0x3814fa(0x1bf)]);}if(_0x577d97[_0x3814fa(0x1b1)])for(const _0x3325f5 of _0x577d97[_0x3814fa(0x1b1)]){if(_0x3325f5[_0x3814fa(0x1bf)])_0x28cc29[_0x3814fa(0x188)](_0x3325f5[_0x3814fa(0x1bf)]);}if(_0x577d97[_0x3814fa(0x161)])for(const _0x20575f of _0x577d97[_0x3814fa(0x161)]){if(_0x20575f[_0x3814fa(0x1bf)])_0x28cc29[_0x3814fa(0x188)](_0x20575f[_0x3814fa(0x1bf)]);}return _0x28cc29;}function parseJumpTargetDisplayName(_0x28d3d1){const _0x154a58=a146_0x417f,_0x59958b=_0x28d3d1['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0x59958b)return undefined;const _0x5c7ef6=_0x59958b[0x1]['trim'](),_0x2d8e22=_0x59958b[0x2][_0x154a58(0x14d)]();if(!_0x5c7ef6||!_0x2d8e22)return undefined;return{'stageName':_0x5c7ef6,'journeyName':_0x2d8e22};}function orderStepsFromRoot(_0x576e13,_0xf8a01c){const _0x5023ee=a146_0x417f,_0x84c2e7=Object['entries'](_0x576e13);if(_0x84c2e7[_0x5023ee(0x19b)]===0x0)return[];const _0x45624c=new Set(_0x84c2e7['map'](([_0x5548cc])=>_0x5548cc)),_0x7d47c3=new Set();for(const [,_0xbaa30f]of _0x84c2e7){for(const _0x15aadc of getStepNextRefs(_0xbaa30f)){if(_0x45624c[_0x5023ee(0x1b8)](_0x15aadc))_0x7d47c3[_0x5023ee(0x192)](_0x15aadc);}}let _0x4dc2a0=_0xf8a01c&&_0x45624c['has'](_0xf8a01c)?_0xf8a01c:undefined;if(!_0x4dc2a0){const _0x347844=_0x84c2e7[_0x5023ee(0x1cb)](([_0x51b12c])=>!_0x7d47c3[_0x5023ee(0x1b8)](_0x51b12c));_0x347844[_0x5023ee(0x19b)]>0x0?_0x4dc2a0=_0x347844[0x0][0x0]:_0x4dc2a0=_0x84c2e7[0x0][0x0];}const _0x5aca9c=[],_0x43d095=new Set(),_0xcb1757=[_0x4dc2a0];while(_0xcb1757[_0x5023ee(0x19b)]>0x0){const _0x1ba001=_0xcb1757[_0x5023ee(0x13d)]();if(_0x43d095[_0x5023ee(0x1b8)](_0x1ba001))continue;_0x43d095[_0x5023ee(0x192)](_0x1ba001);const _0x2ff66d=_0x576e13[_0x1ba001];if(!_0x2ff66d)continue;_0x5aca9c[_0x5023ee(0x188)]({'uuid':_0x1ba001,'step':_0x2ff66d});for(const _0x51908d of getStepNextRefs(_0x2ff66d)){_0x45624c[_0x5023ee(0x1b8)](_0x51908d)&&!_0x43d095[_0x5023ee(0x1b8)](_0x51908d)&&_0xcb1757[_0x5023ee(0x188)](_0x51908d);}}for(const [_0x514803,_0x33348f]of _0x84c2e7){!_0x43d095[_0x5023ee(0x1b8)](_0x514803)&&_0x5aca9c[_0x5023ee(0x188)]({'uuid':_0x514803,'step':_0x33348f});}return _0x5aca9c;}function resolveStepReferences(_0x172748,_0x4a9302,_0x3d2a63,_0x8a92f7){const _0x1cc2f8=a146_0x417f;if(_0x172748[_0x1cc2f8(0x1a7)]!==_0x1cc2f8(0x15b)){_0x172748[_0x1cc2f8(0x1bf)]&&_0x8a92f7[_0x1cc2f8(0x1b8)](_0x172748['next'])&&(_0x172748[_0x1cc2f8(0x1bf)]=_0x8a92f7[_0x1cc2f8(0x155)](_0x172748['next']));const _0x36676b=_0x4a9302+0x1;if(_0x36676b<_0x3d2a63['length']){const _0x34de7b=_0x8a92f7[_0x1cc2f8(0x155)](_0x3d2a63[_0x36676b][_0x1cc2f8(0x1d1)]);_0x172748['next']===_0x34de7b&&delete _0x172748['next'];}}if(_0x172748[_0x1cc2f8(0x1a7)]==='decision_point')for(const _0x31377c of _0x172748[_0x1cc2f8(0x1bb)][_0x1cc2f8(0x1ee)]){_0x31377c[_0x1cc2f8(0x1bf)]&&_0x8a92f7['has'](_0x31377c['next'])&&(_0x31377c['next']=_0x8a92f7[_0x1cc2f8(0x155)](_0x31377c['next']));}if(_0x172748[_0x1cc2f8(0x1a7)]===_0x1cc2f8(0x1c4))for(const _0x498585 of _0x172748[_0x1cc2f8(0x1bb)][_0x1cc2f8(0x1b1)]){_0x498585[_0x1cc2f8(0x1bf)]&&_0x8a92f7[_0x1cc2f8(0x1b8)](_0x498585[_0x1cc2f8(0x1bf)])&&(_0x498585[_0x1cc2f8(0x1bf)]=_0x8a92f7[_0x1cc2f8(0x155)](_0x498585['next']));}if(_0x172748['type']===_0x1cc2f8(0x1b9)&&_0x172748[_0x1cc2f8(0x1bb)][_0x1cc2f8(0x160)]){const _0x4cc610=_0x172748[_0x1cc2f8(0x1bb)][_0x1cc2f8(0x160)];_0x4cc610[_0x1cc2f8(0x1bf)]&&_0x8a92f7[_0x1cc2f8(0x1b8)](_0x4cc610[_0x1cc2f8(0x1bf)])&&(_0x4cc610[_0x1cc2f8(0x1bf)]=_0x8a92f7[_0x1cc2f8(0x155)](_0x4cc610[_0x1cc2f8(0x1bf)])),_0x4cc610[_0x1cc2f8(0x1be)]?.[_0x1cc2f8(0x1bf)]&&_0x8a92f7['has'](_0x4cc610['timeout'][_0x1cc2f8(0x1bf)])&&(_0x4cc610['timeout'][_0x1cc2f8(0x1bf)]=_0x8a92f7['get'](_0x4cc610[_0x1cc2f8(0x1be)][_0x1cc2f8(0x1bf)]));}}function convertApiStageToYaml(_0x2b4b9d){const _0x29d36e=a146_0x417f,_0x26adf5={'name':_0x2b4b9d[_0x29d36e(0x152)]};_0x2b4b9d['id']&&(_0x26adf5['id']=_0x2b4b9d['id']);_0x2b4b9d[_0x29d36e(0x18c)]&&(_0x26adf5[_0x29d36e(0x18c)]=_0x2b4b9d[_0x29d36e(0x18c)]);_0x2b4b9d['entryCriteria']&&(_0x26adf5['entry_criteria']=convertApiCriteriaToYaml(_0x2b4b9d['entryCriteria']));_0x2b4b9d[_0x29d36e(0x159)]&&_0x2b4b9d[_0x29d36e(0x159)][_0x29d36e(0x19b)]>0x0&&(_0x26adf5['exit_criteria']=_0x2b4b9d[_0x29d36e(0x159)]['map'](convertApiCriteriaToYaml));_0x2b4b9d[_0x29d36e(0x1ce)]&&(_0x26adf5[_0x29d36e(0x1ce)]=convertApiCriteriaToYaml(_0x2b4b9d[_0x29d36e(0x1ce)]));if(_0x2b4b9d[_0x29d36e(0x1e8)]&&Object[_0x29d36e(0x15c)](_0x2b4b9d[_0x29d36e(0x1e8)])[_0x29d36e(0x19b)]>0x0){const _0x234878=orderStepsFromRoot(_0x2b4b9d[_0x29d36e(0x1e8)],_0x2b4b9d['rootStep']),_0x499bf1=new Map(),_0x1f77b6=new Set();for(let _0x30c942=0x0;_0x30c942<_0x234878[_0x29d36e(0x19b)];_0x30c942++){const {uuid:_0x3ebcd4,step:_0x3271b9}=_0x234878[_0x30c942];let _0x196680=generateReadableStepName(_0x3271b9,_0x30c942),_0x31a9ec=_0x196680,_0x34933a=0x2;while(_0x1f77b6[_0x29d36e(0x1b8)](_0x31a9ec)){_0x31a9ec=_0x196680+'_'+_0x34933a,_0x34933a++;}_0x1f77b6[_0x29d36e(0x192)](_0x31a9ec),_0x499bf1[_0x29d36e(0x18f)](_0x3ebcd4,_0x31a9ec);}_0x26adf5[_0x29d36e(0x1e8)]=_0x234878[_0x29d36e(0x171)](({uuid:_0x5e3f4d,step:_0xee506e},_0x3c74f6)=>{const _0x23fe60=_0x29d36e,_0x4182d5=convertApiStepToYaml(_0xee506e,_0x499bf1[_0x23fe60(0x155)](_0x5e3f4d));return resolveStepReferences(_0x4182d5,_0x3c74f6,_0x234878,_0x499bf1),_0x4182d5;});}return _0x26adf5;}function convertApiCriteriaToYaml(_0x424b5a){const _0x361526=a146_0x417f,_0x4a69e2={'name':_0x424b5a[_0x361526(0x152)],'segment':_0x424b5a['segmentId']};_0x424b5a[_0x361526(0x18c)]&&(_0x4a69e2[_0x361526(0x18c)]=_0x424b5a[_0x361526(0x18c)]);if(_0x424b5a['target']){let _0x3da91c=_0x424b5a[_0x361526(0x199)][_0x361526(0x19d)],_0x53f8b9=_0x424b5a[_0x361526(0x199)]['journeyStageId'];if(_0x424b5a[_0x361526(0x199)][_0x361526(0x1b4)]){const _0x102680=parseJumpTargetDisplayName(_0x424b5a[_0x361526(0x199)][_0x361526(0x1b4)]);_0x102680&&(_0x53f8b9=_0x102680[_0x361526(0x149)],_0x3da91c=_0x102680[_0x361526(0x1b4)]);}_0x4a69e2[_0x361526(0x199)]={'journey':_0x3da91c,'stage':_0x53f8b9},_0x424b5a['target'][_0x361526(0x14e)]&&(_0x4a69e2[_0x361526(0x199)][_0x361526(0x191)]=_0x424b5a[_0x361526(0x199)]['journeyBundleId']);}return _0x4a69e2;}function convertApiStepToYaml(_0x4a5b02,_0x415daa){const _0x26944f=a146_0x417f;switch(_0x4a5b02[_0x26944f(0x1a7)]){case _0x26944f(0x156):{const _0xbd93c5={};if(_0x4a5b02[_0x26944f(0x187)]==='Duration'&&_0x4a5b02[_0x26944f(0x17e)]!==undefined)_0xbd93c5[_0x26944f(0x172)]=_0x4a5b02[_0x26944f(0x17e)],_0xbd93c5[_0x26944f(0x181)]=_0x4a5b02[_0x26944f(0x1bc)];else{if(_0x4a5b02[_0x26944f(0x187)]===_0x26944f(0x1b2)&&_0x4a5b02['waitUntilDate'])_0xbd93c5[_0x26944f(0x1c7)]=_0x4a5b02['waitUntilDate'];else{if(_0x4a5b02[_0x26944f(0x187)]==='DaysOfTheWeek'&&_0x4a5b02[_0x26944f(0x178)])_0xbd93c5['days_of_week']=_0x4a5b02[_0x26944f(0x178)];else{if(_0x4a5b02['waitStepType']===_0x26944f(0x18e)){if(_0x4a5b02[_0x26944f(0x161)]&&_0x4a5b02[_0x26944f(0x161)][_0x26944f(0x19b)]>0x0){const _0x487957=_0x4a5b02['conditions']['find'](_0x13ff09=>!_0x13ff09[_0x26944f(0x198)]),_0x141dd4=_0x4a5b02[_0x26944f(0x161)][_0x26944f(0x183)](_0x10610f=>_0x10610f[_0x26944f(0x198)]);_0x487957?.['segmentId']&&(_0xbd93c5[_0x26944f(0x160)]={'segment':_0x487957[_0x26944f(0x1b7)],..._0x487957[_0x26944f(0x1bf)]?{'next':_0x487957[_0x26944f(0x1bf)]}:{}},_0x141dd4&&_0x141dd4['moveAfter']!==undefined&&_0x141dd4['unit']&&(_0xbd93c5[_0x26944f(0x160)][_0x26944f(0x1be)]={'duration':_0x141dd4['moveAfter'],'unit':_0x141dd4[_0x26944f(0x181)],..._0x141dd4[_0x26944f(0x1bf)]?{'next':_0x141dd4['next']}:{}}));}else _0x4a5b02[_0x26944f(0x157)]&&(_0xbd93c5['condition']={'segment':_0x4a5b02[_0x26944f(0x157)]},_0x4a5b02['conditionTimeoutDuration']!==undefined&&_0x4a5b02['conditionTimeoutUnit']&&(_0xbd93c5['condition']['timeout']={'duration':_0x4a5b02[_0x26944f(0x1a3)],'unit':_0x4a5b02['conditionTimeoutUnit']}));}}}}const _0x4e7b34={'type':_0x26944f(0x1b9),'name':_0x415daa,..._0x4a5b02[_0x26944f(0x1bf)]?{'next':_0x4a5b02[_0x26944f(0x1bf)]}:{},'with':_0xbd93c5};return _0x4e7b34;}case _0x26944f(0x1a8):{const _0x104175={'type':'activation','name':_0x415daa,..._0x4a5b02[_0x26944f(0x1bf)]?{'next':_0x4a5b02[_0x26944f(0x1bf)]}:{},'with':{'activation':_0x4a5b02[_0x26944f(0x1ef)]||''}};return _0x104175;}case'DecisionPoint':{const _0x3ad6f6={'type':_0x26944f(0x1df),'name':_0x415daa,..._0x4a5b02[_0x26944f(0x1bf)]?{'next':_0x4a5b02['next']}:{},'with':{'branches':(_0x4a5b02['branches']||[])[_0x26944f(0x171)](_0x403aa4=>({'name':_0x403aa4[_0x26944f(0x152)],'segment':_0x403aa4[_0x26944f(0x1b7)],'excluded':_0x403aa4['excludedPath'],..._0x403aa4[_0x26944f(0x1bf)]?{'next':_0x403aa4['next']}:{}}))}};return _0x3ad6f6;}case _0x26944f(0x184):case _0x26944f(0x150):case _0x26944f(0x165):{const _0x4158b1=_0x4a5b02[_0x26944f(0x1b1)]||(_0x4a5b02['branches']||[])[_0x26944f(0x171)](_0x310fe1=>({'name':_0x310fe1[_0x26944f(0x152)],'percentage':0x0,'next':_0x310fe1[_0x26944f(0x1bf)]})),_0x171407={'type':_0x26944f(0x1c4),'name':_0x415daa,..._0x4a5b02[_0x26944f(0x1bf)]?{'next':_0x4a5b02[_0x26944f(0x1bf)]}:{},'with':{'customized_split':_0x4a5b02[_0x26944f(0x168)],'unique_id':_0x4a5b02[_0x26944f(0x14a)],'variants':_0x4158b1['map'](_0x544e74=>({'name':_0x544e74[_0x26944f(0x152)],'percentage':_0x544e74[_0x26944f(0x1a9)],..._0x544e74[_0x26944f(0x1bf)]?{'next':_0x544e74[_0x26944f(0x1bf)]}:{}}))}};return _0x171407;}case'Merge':{const _0x56b459={'type':_0x26944f(0x1e6),'name':_0x415daa,..._0x4a5b02[_0x26944f(0x1bf)]?{'next':_0x4a5b02['next']}:{}};return _0x56b459;}case'Jump':{let _0x3aafca='',_0xdfb6e4='',_0x571404;if(_0x4a5b02['target']){_0x3aafca=_0x4a5b02['target'][_0x26944f(0x19d)],_0xdfb6e4=_0x4a5b02[_0x26944f(0x199)]['journeyStageId'],_0x571404=_0x4a5b02['target'][_0x26944f(0x14e)];if(_0x4a5b02[_0x26944f(0x199)][_0x26944f(0x1b4)]){const _0x4a174b=parseJumpTargetDisplayName(_0x4a5b02[_0x26944f(0x199)][_0x26944f(0x1b4)]);_0x4a174b&&(_0xdfb6e4=_0x4a174b['stageName'],_0x3aafca=_0x4a174b[_0x26944f(0x1b4)]);}}const _0x13f38e={'type':_0x26944f(0x142),'name':_0x415daa,..._0x4a5b02[_0x26944f(0x1bf)]?{'next':_0x4a5b02[_0x26944f(0x1bf)]}:{},'with':{'target':{'journey':_0x3aafca,'stage':_0xdfb6e4,..._0x571404?{'bundle_id':_0x571404}:{}}}};return _0x13f38e;}case _0x26944f(0x173):{const _0x338898={'type':'end','name':_0x415daa};return _0x338898;}default:{const _0x1d184d={'type':_0x26944f(0x15b),'name':_0x415daa};return _0x1d184d;}}}export async function journeyDefToRequest(_0x10605a,_0x16a4cc,_0x53cdf7){const _0x4346ce=a146_0x417f,_0x47964d=_0x10605a[_0x4346ce(0x1b3)]||getActiveStages(_0x10605a),_0x5c6428=isJourneysArrayMode(_0x10605a)||isMultiVersionMode(_0x10605a)?getLatestJourneyEntry(_0x10605a):undefined,_0x5c901a=_0x5c6428?.[_0x4346ce(0x163)]??_0x10605a[_0x4346ce(0x152)],_0x313f08=_0x10605a[_0x4346ce(0x1ac)]||{},_0x372511=_0x10605a[_0x4346ce(0x164)]||{},_0x340f13={'type':_0x4346ce(0x13c),'attributes':{'name':_0x5c901a,'audienceId':_0x16a4cc,'journeyStages':await Promise[_0x4346ce(0x15d)](_0x47964d['map'](_0x3a2490=>convertYamlStageToApi(_0x3a2490,_0x53cdf7,_0x313f08,_0x372511)))}},_0x4bd8a1=_0x5c6428?.['id']??_0x10605a['id'];_0x4bd8a1&&(_0x340f13['id']=_0x4bd8a1);_0x10605a['description']&&(_0x340f13[_0x4346ce(0x13e)][_0x4346ce(0x18c)]=_0x10605a[_0x4346ce(0x18c)]);const _0x2816f1=getEffectiveGoal(_0x10605a);_0x2816f1&&(_0x340f13[_0x4346ce(0x13e)][_0x4346ce(0x19e)]=await convertYamlCriteriaToApi(_0x2816f1,_0x53cdf7,_0x313f08));const _0xdbac51=getEffectiveReentry(_0x10605a);return _0xdbac51&&(_0x340f13[_0x4346ce(0x13e)][_0x4346ce(0x162)]=_0xdbac51,_0x340f13[_0x4346ce(0x13e)][_0x4346ce(0x17c)]=_0xdbac51!=='no_reentry'),_0x10605a[_0x4346ce(0x138)]&&(_0x340f13[_0x4346ce(0x13f)]={'parentFolder':{'data':{'id':_0x10605a[_0x4346ce(0x138)],'type':_0x4346ce(0x1e0)}}}),_0x340f13;}async function convertYamlStageToApi(_0x9fd43d,_0x57a2e2,_0x4dd6e6={},_0x3d079d={}){const _0x451041=a146_0x417f,_0x5dfc13={'name':_0x9fd43d[_0x451041(0x152)]};_0x9fd43d['id']&&(_0x5dfc13['id']=_0x9fd43d['id']);_0x9fd43d[_0x451041(0x18c)]&&(_0x5dfc13[_0x451041(0x18c)]=_0x9fd43d[_0x451041(0x18c)]);_0x9fd43d[_0x451041(0x18d)]&&(_0x5dfc13[_0x451041(0x1b5)]=await convertYamlCriteriaToApi(_0x9fd43d[_0x451041(0x18d)],_0x57a2e2,_0x4dd6e6));_0x9fd43d[_0x451041(0x1cc)]&&_0x9fd43d['exit_criteria']['length']>0x0&&(_0x5dfc13[_0x451041(0x159)]=await Promise[_0x451041(0x15d)](_0x9fd43d[_0x451041(0x1cc)][_0x451041(0x171)](_0x493566=>convertYamlCriteriaToApi(_0x493566,_0x57a2e2,_0x4dd6e6))));_0x9fd43d[_0x451041(0x1ce)]&&(_0x5dfc13[_0x451041(0x1ce)]=await convertYamlCriteriaToApi(_0x9fd43d[_0x451041(0x1ce)],_0x57a2e2,_0x4dd6e6));if(_0x9fd43d[_0x451041(0x1e8)]&&_0x9fd43d[_0x451041(0x1e8)][_0x451041(0x19b)]>0x0){const _0x12ea0e={},_0xc3a68c=_0x9fd43d[_0x451041(0x1e8)][_0x451041(0x171)]((_0x175847,_0x102b33)=>{const _0x24abdf=_0x451041,_0x1e5940=_0x175847[_0x24abdf(0x1d1)]||generateUUID(),_0x4db122=_0x175847[_0x24abdf(0x152)]||_0x175847[_0x24abdf(0x1a7)]+'_'+_0x102b33;return _0x12ea0e[_0x4db122]=_0x1e5940,{..._0x175847,'name':_0x4db122};});_0x5dfc13[_0x451041(0x1c5)]=_0x12ea0e[_0xc3a68c[0x0][_0x451041(0x152)]],_0x5dfc13[_0x451041(0x1e8)]={};for(let _0x26565b=0x0;_0x26565b<_0xc3a68c['length'];_0x26565b++){const _0x5dbb92=_0xc3a68c[_0x26565b],_0x260e11=_0x12ea0e[_0x5dbb92[_0x451041(0x152)]],_0x42829e=!_0x5dbb92[_0x451041(0x1bf)]&&_0x26565b<_0xc3a68c[_0x451041(0x19b)]-0x1&&_0x5dbb92[_0x451041(0x1a7)]!==_0x451041(0x15b)?_0xc3a68c[_0x26565b+0x1][_0x451041(0x152)]:_0x5dbb92[_0x451041(0x1bf)],_0x20ca28=_0x42829e!==_0x5dbb92[_0x451041(0x1bf)]?{..._0x5dbb92,'next':_0x42829e}:_0x5dbb92;_0x5dfc13[_0x451041(0x1e8)][_0x260e11]=await convertYamlStepToApi(_0x20ca28,_0x57a2e2,_0x4dd6e6,_0x12ea0e,_0x3d079d);}}else _0x9fd43d[_0x451041(0x1ca)]&&(_0x5dfc13['rootStep']=_0x9fd43d['root_step']);return _0x5dfc13;}async function convertYamlCriteriaToApi(_0x3e08bd,_0x18703d,_0x3aa8a0={}){const _0xe62be9=a146_0x417f;let _0x1d9735=_0x3e08bd[_0xe62be9(0x186)];if(_0x1d9735&&!/^\d+$/['test'](_0x1d9735)){const _0x547be7=parseSegmentRef(_0x1d9735);if(_0x547be7[_0xe62be9(0x1a7)]===_0xe62be9(0x1ae))_0x18703d?.[_0xe62be9(0x140)]&&(_0x1d9735=await _0x18703d[_0xe62be9(0x140)](_0x547be7[_0xe62be9(0x152)]));else{if(_0x547be7[_0xe62be9(0x1a7)]===_0xe62be9(0x1c6)&&_0x3aa8a0[_0x547be7[_0xe62be9(0x152)]])_0x18703d?.['resolveEmbeddedSegmentId']&&(_0x1d9735=await _0x18703d[_0xe62be9(0x1e4)](_0x547be7[_0xe62be9(0x152)],_0x3aa8a0[_0x547be7[_0xe62be9(0x152)]]));else _0x18703d?.['resolveSegmentId']&&(_0x1d9735=await _0x18703d[_0xe62be9(0x140)](_0x547be7['name']));}}const _0x4d5ab9={'name':_0x3e08bd[_0xe62be9(0x152)],'segmentId':_0x1d9735};_0x3e08bd[_0xe62be9(0x18c)]&&(_0x4d5ab9[_0xe62be9(0x18c)]=_0x3e08bd['description']);if(_0x3e08bd[_0xe62be9(0x199)]){const _0x1ed8b4=_0x3e08bd[_0xe62be9(0x199)][_0xe62be9(0x13c)],_0x1e9480=_0x3e08bd['target']['stage'];let _0x35c8a8=_0x3e08bd[_0xe62be9(0x199)][_0xe62be9(0x13c)];_0x18703d?.[_0xe62be9(0x1da)]&&!/^\d+$/[_0xe62be9(0x1a2)](_0x35c8a8)&&(_0x35c8a8=await _0x18703d[_0xe62be9(0x1da)](_0x35c8a8));let _0x21c0a9=_0x3e08bd['target'][_0xe62be9(0x169)];_0x18703d?.['resolveStageId']&&!/^\d+$/[_0xe62be9(0x1a2)](_0x21c0a9)&&(_0x21c0a9=await _0x18703d[_0xe62be9(0x1cd)](_0x35c8a8,_0x21c0a9));const _0x1d05ae=!/^\d+$/[_0xe62be9(0x1a2)](_0x1ed8b4)&&!isLocalJourneyRef(_0x1ed8b4)?formatApiJourneyName(_0x1ed8b4,_0x1e9480):undefined;_0x4d5ab9['target']={'journeyId':_0x35c8a8,'journeyStageId':_0x21c0a9,'journeyName':_0x1d05ae,'confirmed':!![]},_0x3e08bd[_0xe62be9(0x199)][_0xe62be9(0x191)]&&(_0x4d5ab9['target']['journeyBundleId']=_0x3e08bd[_0xe62be9(0x199)][_0xe62be9(0x191)]);}return _0x4d5ab9;}async function convertYamlStepToApi(_0x51daed,_0x5b577e,_0xd63b23={},_0x3c3139={},_0x5a5ac0={}){const _0x70c623=a146_0x417f,_0x48f7a5=async _0x31b095=>{const _0x1a84cf=a146_0x417f;if(/^\d+$/[_0x1a84cf(0x1a2)](_0x31b095))return _0x31b095;const _0x3fd5a7=parseSegmentRef(_0x31b095);if(_0x3fd5a7[_0x1a84cf(0x1a7)]===_0x1a84cf(0x1ae)){if(_0x5b577e?.['resolveSegmentId'])return await _0x5b577e[_0x1a84cf(0x140)](_0x3fd5a7[_0x1a84cf(0x152)]);}else{if(_0x3fd5a7['type']===_0x1a84cf(0x1c6)&&_0xd63b23[_0x3fd5a7[_0x1a84cf(0x152)]]){if(_0x5b577e?.[_0x1a84cf(0x1e4)])return await _0x5b577e[_0x1a84cf(0x1e4)](_0x3fd5a7[_0x1a84cf(0x152)],_0xd63b23[_0x3fd5a7[_0x1a84cf(0x152)]]);}else{if(_0x5b577e?.[_0x1a84cf(0x140)])return await _0x5b577e[_0x1a84cf(0x140)](_0x3fd5a7['name']);}}return _0x31b095;},_0x48735d=async _0x1e4b6d=>{const _0x3325a4=a146_0x417f;if(/^\d+$/['test'](_0x1e4b6d))return _0x1e4b6d;const _0x378ca0=parseSegmentRef(_0x1e4b6d);if(_0x378ca0[_0x3325a4(0x1a7)]===_0x3325a4(0x1ae)){if(_0x5b577e?.[_0x3325a4(0x1bd)])return await _0x5b577e[_0x3325a4(0x1bd)](_0x378ca0['name']);return _0x378ca0[_0x3325a4(0x152)];}else{if(_0x378ca0[_0x3325a4(0x1a7)]==='embedded'&&_0x5a5ac0[_0x378ca0['name']]){if(_0x5b577e?.[_0x3325a4(0x135)])return await _0x5b577e[_0x3325a4(0x135)](_0x378ca0[_0x3325a4(0x152)],_0x5a5ac0[_0x378ca0[_0x3325a4(0x152)]]);if(_0x5b577e?.[_0x3325a4(0x1bd)])return await _0x5b577e['resolveActivationId'](_0x378ca0[_0x3325a4(0x152)]);}else{if(_0x5b577e?.[_0x3325a4(0x1bd)])return await _0x5b577e['resolveActivationId'](_0x378ca0[_0x3325a4(0x152)]);}}return _0x1e4b6d;},_0x5f3220=_0x4102bd=>{if(!_0x4102bd)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0x4102bd))return _0x4102bd;return _0x3c3139[_0x4102bd]||_0x4102bd;};switch(_0x51daed['type']){case _0x70c623(0x1b9):{const _0x7fe6a9=_0x51daed,_0x580823=_0x7fe6a9[_0x70c623(0x1bb)],_0x2fa362={'type':_0x70c623(0x156),'name':_0x7fe6a9[_0x70c623(0x152)],'next':_0x5f3220(_0x7fe6a9[_0x70c623(0x1bf)])};if(_0x580823['duration']!==undefined&&_0x580823[_0x70c623(0x181)])_0x2fa362[_0x70c623(0x187)]=_0x70c623(0x19f),_0x2fa362['waitStep']=_0x580823[_0x70c623(0x172)],_0x2fa362[_0x70c623(0x1bc)]=normalizeWaitUnit(_0x580823['unit']);else{if(_0x580823[_0x70c623(0x1c7)])_0x2fa362['waitStepType']=_0x70c623(0x1b2),_0x2fa362[_0x70c623(0x197)]=_0x580823['wait_until'];else{if(_0x580823['days_of_week'])_0x2fa362['waitStepType']=_0x70c623(0x196),_0x2fa362[_0x70c623(0x178)]=_0x580823[_0x70c623(0x17b)];else{if(_0x580823['condition']){_0x2fa362[_0x70c623(0x187)]=_0x70c623(0x18e);const _0x296a6d=await _0x48f7a5(_0x580823[_0x70c623(0x160)][_0x70c623(0x186)]),_0x22fe1a=_0x580823[_0x70c623(0x160)][_0x70c623(0x1be)]?.[_0x70c623(0x1bf)]!==undefined;if(_0x22fe1a){const _0x6378e9=[];_0x6378e9[_0x70c623(0x188)]({'id':generateUUID(),'segmentId':_0x296a6d,'timedOutPath':![],'name':_0x70c623(0x1d4),'next':_0x5f3220(_0x580823[_0x70c623(0x160)][_0x70c623(0x1bf)]??_0x7fe6a9[_0x70c623(0x1bf)])});if(_0x580823[_0x70c623(0x160)][_0x70c623(0x1be)]){const _0x324ae6=_0x580823['condition'][_0x70c623(0x1be)]['duration'],_0x1b934d=normalizeWaitUnit(_0x580823[_0x70c623(0x160)][_0x70c623(0x1be)][_0x70c623(0x181)]);_0x6378e9[_0x70c623(0x188)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x70c623(0x175)+_0x324ae6+'\x20'+_0x1b934d,'moveAfter':_0x324ae6,'unit':_0x1b934d,'next':_0x5f3220(_0x580823['condition'][_0x70c623(0x1be)]['next'])});}_0x2fa362[_0x70c623(0x161)]=_0x6378e9,delete _0x2fa362[_0x70c623(0x1bf)];}else _0x2fa362[_0x70c623(0x157)]=_0x296a6d,_0x580823[_0x70c623(0x160)]['timeout']&&(_0x2fa362[_0x70c623(0x1a3)]=_0x580823[_0x70c623(0x160)]['timeout'][_0x70c623(0x172)],_0x580823['condition']['timeout'][_0x70c623(0x181)]&&(_0x2fa362[_0x70c623(0x16a)]=normalizeWaitUnit(_0x580823['condition']['timeout'][_0x70c623(0x181)])));}}}}return _0x2fa362;}case _0x70c623(0x1af):{const _0x12293d=_0x51daed,_0x127e37=_0x12293d[_0x70c623(0x1bb)][_0x70c623(0x1af)],_0x4a1dbc=await _0x48735d(_0x127e37);return{'type':_0x70c623(0x1a8),'name':_0x12293d[_0x70c623(0x152)],'journeyActivationStepId':_0x4a1dbc,'next':_0x5f3220(_0x12293d['next'])};}case _0x70c623(0x1df):{const _0x20d180=_0x51daed,_0x350241=_0x20d180[_0x70c623(0x1bb)][_0x70c623(0x1ee)];return{'type':_0x70c623(0x1a0),'name':_0x20d180['name'],'branches':await Promise['all'](_0x350241[_0x70c623(0x171)](async _0x2bc6b=>{const _0x191c88=_0x70c623;let _0x51198e='';if(!_0x2bc6b['excluded']){const _0x321e9b=_0x2bc6b[_0x191c88(0x186)]||_0x2bc6b[_0x191c88(0x141)]||'';_0x51198e=_0x321e9b?await _0x48f7a5(_0x321e9b):'';}return{'id':crypto[_0x191c88(0x182)](),'name':_0x2bc6b[_0x191c88(0x152)],'description':null,'segmentId':_0x51198e,'excludedPath':_0x2bc6b['excluded']??![],'next':_0x5f3220(_0x2bc6b[_0x191c88(0x1bf)])};})),'next':_0x5f3220(_0x20d180[_0x70c623(0x1bf)])};}case'ab_test':{const _0x65c2b7=_0x51daed,_0x1f2813=_0x65c2b7[_0x70c623(0x1bb)];return{'type':_0x70c623(0x184),'name':_0x65c2b7[_0x70c623(0x152)],'customizedSplit':_0x1f2813['customized_split'],'uniqueId':_0x1f2813[_0x70c623(0x195)],'variants':_0x1f2813[_0x70c623(0x1b1)][_0x70c623(0x171)](_0x4b69e1=>({'id':_0x4b69e1['id']||generateUUID(),'name':_0x4b69e1[_0x70c623(0x152)],'percentage':_0x4b69e1[_0x70c623(0x1a9)],'next':_0x5f3220(_0x4b69e1[_0x70c623(0x1bf)])})),'next':_0x5f3220(_0x65c2b7['next'])};}case _0x70c623(0x1e6):return{'type':'Merge','name':_0x51daed[_0x70c623(0x152)],'next':_0x5f3220(_0x51daed[_0x70c623(0x1bf)])};case _0x70c623(0x142):{const _0x538bf4=_0x51daed,_0x14dc06=_0x538bf4['with'][_0x70c623(0x199)],_0x361e2a=_0x14dc06[_0x70c623(0x13c)],_0x4e2f0f=_0x14dc06[_0x70c623(0x169)];let _0x3cbba9=_0x14dc06['journey'];_0x5b577e?.[_0x70c623(0x1da)]&&!/^\d+$/[_0x70c623(0x1a2)](_0x3cbba9)&&(_0x3cbba9=await _0x5b577e['resolveJourneyId'](_0x3cbba9));let _0x54ebb3=_0x14dc06['stage'];_0x5b577e?.['resolveStageId']&&!/^\d+$/[_0x70c623(0x1a2)](_0x54ebb3)&&(_0x54ebb3=await _0x5b577e[_0x70c623(0x1cd)](_0x3cbba9,_0x54ebb3));const _0x6fa021=!/^\d+$/['test'](_0x361e2a)&&!isLocalJourneyRef(_0x361e2a)?formatApiJourneyName(_0x361e2a,_0x4e2f0f):undefined;return{'type':'Jump','name':_0x538bf4['name'],'target':{'journeyId':_0x3cbba9,'journeyStageId':_0x54ebb3,'journeyBundleId':_0x14dc06[_0x70c623(0x191)],'journeyName':_0x6fa021,'confirmed':!![]},'next':_0x5f3220(_0x538bf4['next'])};}case _0x70c623(0x15b):return{'type':_0x70c623(0x173),'name':_0x51daed[_0x70c623(0x152)]};default:{const _0x467a0e=_0x51daed;return{'type':_0x70c623(0x173),'name':_0x467a0e['name']};}}}export function toYamlString(_0x872acf){const _0x38be4f=a146_0x417f,_0x27494e=stripInternalFields(_0x872acf),_0x591a44=a146_0x577435[_0x38be4f(0x143)](_0x27494e,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x38be4f(0x16c)}),_0x566576=[_0x38be4f(0x189),'activations:','goal:',_0x38be4f(0x194),_0x38be4f(0x174),_0x38be4f(0x1ed),_0x38be4f(0x136)];let _0xcaa696=_0x591a44;for(const _0xdd1f4 of _0x566576){_0xcaa696=_0xcaa696[_0x38be4f(0x14b)](new RegExp('^('+_0xdd1f4+')','m'),(_0x5a1e24,_0x1111b0,_0x14657b)=>{if(_0x14657b===0x0||_0xcaa696[_0x14657b-0x1]==='\x0a'&&_0xcaa696[_0x14657b-0x2]==='\x0a')return _0x1111b0;return'\x0a'+_0x1111b0;});}return _0xcaa696;}function stripInternalFields(_0x46c188){const _0x5da430=a146_0x417f,{id:_0xa3af2e,folder_id:_0x11d0f1,bundle_id:_0x3fa7c2,bundle_name:_0x25d9f6,version:_0x132312,allow_reentry:_0x1e54d9,..._0x466976}=_0x46c188;return _0x466976[_0x5da430(0x146)]&&(_0x466976[_0x5da430(0x146)]=_0x466976[_0x5da430(0x146)]['map'](_0x218e4a=>{const _0x13ac00=_0x5da430,{id:_0x51aaa3,..._0x16c600}=_0x218e4a;return{..._0x16c600,'stages':_0x16c600[_0x13ac00(0x1b3)][_0x13ac00(0x171)](stripStageInternalFields),..._0x218e4a[_0x13ac00(0x1ba)]===!![]?{'latest':!![]}:{},..._0x466976[_0x13ac00(0x146)]['length']===0x1&&_0x16c600[_0x13ac00(0x163)]==='v1'?{'version':undefined}:{}};})),_0x466976[_0x5da430(0x1b3)]&&(_0x466976[_0x5da430(0x1b3)]=_0x466976['stages'][_0x5da430(0x171)](stripStageInternalFields)),_0x466976[_0x5da430(0x147)]&&(_0x466976[_0x5da430(0x147)]=_0x466976['versions'][_0x5da430(0x171)](_0x598a53=>{const _0x527e5c=_0x5da430,{id:_0x1861a8,..._0x708370}=_0x598a53;return{..._0x708370,'stages':_0x708370[_0x527e5c(0x1b3)][_0x527e5c(0x171)](stripStageInternalFields),..._0x598a53[_0x527e5c(0x1ba)]===!![]?{'latest':!![]}:{}};})),_0x466976;}function stripStageInternalFields(_0x3f5764){const {id:_0x19509a,..._0x574fc2}=_0x3f5764;return _0x574fc2;}export function parseYamlString(_0x56e5d5){return safeParseYaml(_0x56e5d5,JourneyDefSchema);}export function isJourneyDef(_0x7b3a03){const _0x2fa996=a146_0x417f;return typeof _0x7b3a03===_0x2fa996(0x1b6)&&_0x7b3a03!==null&&_0x2fa996(0x1a7)in _0x7b3a03&&_0x7b3a03[_0x2fa996(0x1a7)]===_0x2fa996(0x13c);}export function generateTemplate(_0x129de0,_0x7768db){const _0x292bf0=a146_0x417f,_0x4d7ad4={'type':_0x292bf0(0x13c),'name':_0x129de0,'description':_0x292bf0(0x1e2),'reentry':_0x292bf0(0x19c),'goal':{'name':_0x292bf0(0x166),'segment':_0x292bf0(0x153)},'stages':[{'name':_0x292bf0(0x139),'description':_0x292bf0(0x1e1),'entry_criteria':{'name':_0x292bf0(0x180),'segment':_0x7768db},'steps':[{'type':_0x292bf0(0x1b9),'name':_0x292bf0(0x193),'with':{'duration':0x1,'unit':_0x292bf0(0x1d7)}},{'type':_0x292bf0(0x1af),'name':_0x292bf0(0x134),'with':{'activation':_0x292bf0(0x15e)}},{'type':'end','name':_0x292bf0(0x1e7)}]}]};return toYamlString(_0x4d7ad4);}function generateUUID(){const _0x47ad35=a146_0x417f;return crypto[_0x47ad35(0x182)]();}export const SEGMENT_REF_PREFIX=a146_0x6eff7(0x1aa);export function parseSegmentRef(_0x221f1d){const _0x2947df=a146_0x6eff7;if(_0x221f1d[_0x2947df(0x176)](SEGMENT_REF_PREFIX))return{'type':_0x2947df(0x1ae),'name':_0x221f1d[_0x2947df(0x170)](SEGMENT_REF_PREFIX[_0x2947df(0x19b)])};if(/^\d+$/[_0x2947df(0x1a2)](_0x221f1d))return{'type':'id','name':_0x221f1d};return{'type':_0x2947df(0x1c6),'name':_0x221f1d};}export function makeSegmentRef(_0x87a4de){return''+SEGMENT_REF_PREFIX+_0x87a4de;}export function isExternalSegmentRef(_0x5c8d77){const _0x3ce8c5=a146_0x6eff7;return _0x5c8d77[_0x3ce8c5(0x176)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x4ec26f){const _0x578c1a=a146_0x6eff7;return!!(_0x4ec26f[_0x578c1a(0x146)]&&_0x4ec26f[_0x578c1a(0x146)][_0x578c1a(0x19b)]>0x0);}export function isMultiVersionMode(_0x2f4248){const _0x2f7728=a146_0x6eff7;return!!(_0x2f4248[_0x2f7728(0x147)]&&_0x2f4248[_0x2f7728(0x147)][_0x2f7728(0x19b)]>0x0);}export function isSingleVersionMode(_0x256403){const _0x5acbcb=a146_0x6eff7;return!!(_0x256403[_0x5acbcb(0x1b3)]&&_0x256403[_0x5acbcb(0x1b3)][_0x5acbcb(0x19b)]>0x0);}export function hasMultipleVersions(_0x1ce6ee){const _0x150272=a146_0x6eff7;if(isJourneysArrayMode(_0x1ce6ee))return(_0x1ce6ee[_0x150272(0x146)]?.['length']||0x0)>0x1;if(isMultiVersionMode(_0x1ce6ee))return(_0x1ce6ee[_0x150272(0x147)]?.['length']||0x0)>0x1;return![];}function a146_0x417f(_0x9b6907,_0x20962b){_0x9b6907=_0x9b6907-0x130;const _0x55fb14=a146_0x55fb();let _0x417fcd=_0x55fb14[_0x9b6907];return _0x417fcd;}export function normalizeToJourneysFormat(_0x5375db){const _0x56e6f9=a146_0x6eff7;if(isJourneysArrayMode(_0x5375db))return _0x5375db;if(isSingleVersionMode(_0x5375db)){const {stages:_0x4a01e6,id:_0x1497a2,version:_0x54390a,version_number:_0x32ff61,..._0x352492}=_0x5375db;return{..._0x352492,'journeys':[{'version':_0x54390a||'v1','stages':_0x4a01e6||[],'id':_0x1497a2,'version_number':_0x32ff61}]};}if(isMultiVersionMode(_0x5375db)){const {versions:_0x3e3e45,..._0x5c2682}=_0x5375db;return{..._0x5c2682,'journeys':(_0x3e3e45||[])['map'](_0x15509e=>({'version':_0x15509e[_0x56e6f9(0x152)],'state':_0x15509e[_0x56e6f9(0x158)],'latest':_0x15509e['latest'],'stages':_0x15509e[_0x56e6f9(0x1b3)],'id':_0x15509e['id'],'version_number':_0x15509e['version_number']}))};}return _0x5375db;}export function normalizeJourneyDef(_0x147c58,_0x6fe91){const _0x576f3b=a146_0x6eff7,_0x2ee8f1=normalizeToJourneysFormat(_0x147c58),_0x3ea158=_0x6fe91?.[_0x576f3b(0x1ac)]?Object[_0x576f3b(0x15c)](_0x6fe91[_0x576f3b(0x1ac)]):undefined,_0x10c80c=_0x6fe91?.[_0x576f3b(0x164)]?Object[_0x576f3b(0x15c)](_0x6fe91[_0x576f3b(0x164)]):undefined;return{'type':'journey','name':_0x2ee8f1[_0x576f3b(0x152)],..._0x2ee8f1[_0x576f3b(0x18c)]!==undefined&&{'description':_0x2ee8f1['description']},..._0x2ee8f1['goal']&&{'goal':normalizeJourneyCriteria(_0x2ee8f1[_0x576f3b(0x19e)])},..._0x2ee8f1[_0x576f3b(0x132)]!==undefined&&{'reentry':_0x2ee8f1['reentry']},..._0x2ee8f1['segments']&&{'segments':normalizeEmbeddedSegments(_0x2ee8f1['segments'],_0x3ea158)},..._0x2ee8f1[_0x576f3b(0x164)]&&{'activations':normalizeEmbeddedActivations(_0x2ee8f1['activations'],_0x10c80c)},..._0x2ee8f1[_0x576f3b(0x146)]&&{'journeys':_0x2ee8f1[_0x576f3b(0x146)][_0x576f3b(0x171)](_0x44eb00=>normalizeJourneyEntry(_0x44eb00,_0x2ee8f1[_0x576f3b(0x146)][_0x576f3b(0x19b)]===0x1))}};}function normalizeJourneyEntry(_0x38534c,_0x5a4912){const _0x547028=a146_0x6eff7;return{...!_0x5a4912&&_0x38534c['version']!==undefined&&{'version':_0x38534c['version']},..._0x38534c[_0x547028(0x158)]!==undefined&&{'state':_0x38534c[_0x547028(0x158)]},...!_0x5a4912&&_0x38534c[_0x547028(0x1ba)]!==undefined&&{'latest':_0x38534c[_0x547028(0x1ba)]},..._0x38534c['version_number']!==undefined&&{'version_number':_0x38534c[_0x547028(0x1d6)]},..._0x38534c['goal']&&{'goal':normalizeJourneyCriteria(_0x38534c[_0x547028(0x19e)])},..._0x38534c['reentry']!==undefined&&{'reentry':_0x38534c[_0x547028(0x132)]},'stages':_0x38534c[_0x547028(0x1b3)][_0x547028(0x171)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x107461){const _0x3f2959=a146_0x6eff7;return{'name':_0x107461[_0x3f2959(0x152)],..._0x107461[_0x3f2959(0x18c)]!==undefined&&{'description':_0x107461['description']},..._0x107461[_0x3f2959(0x18d)]&&{'entry_criteria':normalizeJourneyCriteria(_0x107461[_0x3f2959(0x18d)])},..._0x107461[_0x3f2959(0x1cc)]&&{'exit_criteria':_0x107461[_0x3f2959(0x1cc)][_0x3f2959(0x171)](normalizeJourneyCriteria)},..._0x107461[_0x3f2959(0x1ce)]&&{'milestone':normalizeJourneyCriteria(_0x107461[_0x3f2959(0x1ce)])},..._0x107461[_0x3f2959(0x1e8)]&&{'steps':normalizeStepsWithImplicitNext(_0x107461[_0x3f2959(0x1e8)])}};}function a146_0x55fb(){const _0x19a69f=['schedule','trim','journeyBundleId','values','AbTest','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','name','goal-segment','draft','get','WaitStep','conditionSegmentId','state','exitCriterias','toLowerCase','end','keys','all','your-activation-name','stageId','condition','conditions','reentryMode','version','activations','Variant','Goal\x20Achieved','size','customizedSplit','stage','conditionTimeoutUnit','data','null','columns','491052ZqdqLW','137836VfnWME','slice','map','duration','End','journeys:','*Max\x20wait\x20','startsWith','\x27.\x0a','daysOfWeek','\x20\x20rule:\x0a','reentry_always','days_of_week','allowReentry','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','waitStep','parentFolder','Entry\x20Criteria','unit','randomUUID','find','ABTest','16080zPIsGh','segment','waitStepType','push','segments:','sort','resolveSegmentName','description','entry_criteria','Condition','set','6181EyIJIu','bundle_id','add','Wait\x201\x20Day','reentry:','unique_id','DaysOfTheWeek','waitUntilDate','timedOutPath','target','(missing)','length','no_reentry','journeyId','goal','Duration','DecisionPoint','\x20\x20\x20\x20type:\x20','test','conditionTimeoutDuration','isJourneyLocal','behavior','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','type','Activation','percentage','ref:','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','segments','1025877htWWNq','ref','activation','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','variants','Date','stages','journeyName','entryCriteria','object','segmentId','has','wait','latest','with','waitStepUnit','resolveActivationId','timeout','next','isArray','1726805DqGwjU','resolveSegment','definition','ab_test','rootStep','embedded','wait_until','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','rule','root_step','filter','exit_criteria','resolveStageId','milestone','notification','resolveJumpTarget','uuid','6712620oULQRc','week','Met\x20condition(s)','versionNumber','version_number','day','\x20\x20\x20\x20type:\x20And\x0a','resolveActivationName','resolveJourneyId','journeyStages','launched','\x20\x20\x20\x20conditions:\x0a','JOURNEY_SYNTAX_ERROR','decision_point','folder','First\x20stage\x20of\x20the\x20journey','Journey\x20description','connector_config','resolveEmbeddedSegmentId','journeyBundleName','merge','Stage\x20Complete','steps','activation_template_id','\x27:\x20','from','414768XmaQVr','stages:','branches','journeyActivationStepId','all_columns','And','reentry','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','Send\x20Notification','resolveEmbeddedActivationId','versions:','exitCriteria','folder_id','Stage\x201','waitCondition','days','journey','shift','attributes','relationships','resolveSegmentId','segment_id','jump','stringify','Expected\x20format:\x0a','excluded','journeys','versions','includes','stageName','uniqueId','replace'];a146_0x55fb=function(){return _0x19a69f;};return a146_0x55fb();}function normalizeStepsWithImplicitNext(_0x208220){return _0x208220['map']((_0x4eaab1,_0xcc9fe)=>{const _0x132300=a146_0x417f,_0x38e2dc=_0xcc9fe<_0x208220[_0x132300(0x19b)]-0x1?_0x208220[_0xcc9fe+0x1][_0x132300(0x152)]:undefined;return normalizeJourneyStep(_0x4eaab1,_0x38e2dc);});}function normalizeJourneyCriteria(_0x30181d){const _0x7ec33f=a146_0x6eff7;return{'name':_0x30181d[_0x7ec33f(0x152)],..._0x30181d[_0x7ec33f(0x18c)]!==undefined&&{'description':_0x30181d[_0x7ec33f(0x18c)]},'segment':_0x30181d[_0x7ec33f(0x186)],..._0x30181d[_0x7ec33f(0x199)]&&{'target':normalizeJumpTarget(_0x30181d['target'])}};}function normalizeJourneyStep(_0x30c9ab,_0x28e9b0){const _0x3d25a8=a146_0x6eff7,_0x33e25e=_0x30c9ab[_0x3d25a8(0x1bf)]!==undefined&&_0x30c9ab[_0x3d25a8(0x1bf)]!==_0x28e9b0,_0x54ccf7={'type':_0x30c9ab[_0x3d25a8(0x1a7)],'name':_0x30c9ab['name'],..._0x33e25e&&{'next':_0x30c9ab[_0x3d25a8(0x1bf)]}};if(_0x3d25a8(0x1bb)in _0x30c9ab&&_0x30c9ab[_0x3d25a8(0x1bb)])return{..._0x54ccf7,'with':normalizeStepParams(_0x30c9ab[_0x3d25a8(0x1a7)],_0x30c9ab[_0x3d25a8(0x1bb)])};return _0x54ccf7;}function normalizeStepParams(_0x2f88e0,_0x3b1b01){const _0x2cd212=a146_0x6eff7;switch(_0x2f88e0){case _0x2cd212(0x1b9):{const _0x28d818=_0x3b1b01;let _0x2f532f;return _0x28d818[_0x2cd212(0x160)]&&(_0x2f532f={'segment':_0x28d818['condition']['segment'],..._0x28d818['condition'][_0x2cd212(0x1bf)]!==undefined&&{'next':_0x28d818[_0x2cd212(0x160)][_0x2cd212(0x1bf)]},..._0x28d818[_0x2cd212(0x160)][_0x2cd212(0x1be)]&&{'timeout':{'duration':_0x28d818[_0x2cd212(0x160)]['timeout'][_0x2cd212(0x172)],'unit':_0x28d818[_0x2cd212(0x160)][_0x2cd212(0x1be)]['unit'],..._0x28d818[_0x2cd212(0x160)][_0x2cd212(0x1be)][_0x2cd212(0x1bf)]!==undefined&&{'next':_0x28d818['condition'][_0x2cd212(0x1be)][_0x2cd212(0x1bf)]}}}}),{..._0x28d818[_0x2cd212(0x172)]!==undefined&&{'duration':_0x28d818[_0x2cd212(0x172)]},..._0x28d818[_0x2cd212(0x181)]!==undefined&&{'unit':_0x28d818[_0x2cd212(0x181)]},..._0x28d818[_0x2cd212(0x1c7)]!==undefined&&{'wait_until':_0x28d818[_0x2cd212(0x1c7)]},..._0x28d818[_0x2cd212(0x17b)]!==undefined&&{'days_of_week':_0x28d818['days_of_week']},..._0x2f532f&&{'condition':_0x2f532f}};}case _0x2cd212(0x1af):{const _0x100b39=_0x3b1b01;return{'activation':_0x100b39[_0x2cd212(0x1af)]};}case _0x2cd212(0x1df):{const _0x3e45b5=_0x3b1b01;return{'branches':_0x3e45b5[_0x2cd212(0x1ee)]['map'](normalizeDecisionBranch)};}case'ab_test':{const _0x19ddf8=_0x3b1b01;return{..._0x19ddf8['customized_split']!==undefined&&{'customized_split':_0x19ddf8['customized_split']},..._0x19ddf8['unique_id']!==undefined&&{'unique_id':_0x19ddf8['unique_id']},'variants':_0x19ddf8[_0x2cd212(0x1b1)][_0x2cd212(0x171)](normalizeAbTestVariant)};}case _0x2cd212(0x142):{const _0x53f571=_0x3b1b01;return{'target':normalizeJumpTarget(_0x53f571['target'])};}default:return _0x3b1b01;}}function normalizeDecisionBranch(_0x1d7124){const _0x460bb4=a146_0x6eff7;return{'name':_0x1d7124[_0x460bb4(0x152)],..._0x1d7124[_0x460bb4(0x186)]!==undefined&&{'segment':_0x1d7124[_0x460bb4(0x186)]},..._0x1d7124[_0x460bb4(0x145)]!==undefined&&{'excluded':_0x1d7124[_0x460bb4(0x145)]},..._0x1d7124[_0x460bb4(0x1bf)]!==undefined&&{'next':_0x1d7124[_0x460bb4(0x1bf)]}};}function normalizeAbTestVariant(_0xe16193){const _0x5e2db0=a146_0x6eff7;return{..._0xe16193['id']!==undefined&&{'id':_0xe16193['id']},'name':_0xe16193['name'],'percentage':_0xe16193[_0x5e2db0(0x1a9)],..._0xe16193[_0x5e2db0(0x1bf)]!==undefined&&{'next':_0xe16193[_0x5e2db0(0x1bf)]}};}function normalizeJumpTarget(_0x668fea){const _0x461954=a146_0x6eff7;return{'journey':_0x668fea['journey'],'stage':_0x668fea[_0x461954(0x169)],..._0x668fea[_0x461954(0x191)]!==undefined&&{'bundle_id':_0x668fea[_0x461954(0x191)]}};}function normalizeEmbeddedSegments(_0x361cbb,_0x2c18ba){const _0x4038c9=a146_0x6eff7,_0x1a9012={},_0x3d489c=Object[_0x4038c9(0x15c)](_0x361cbb),_0x3ce200=_0x2c18ba?[..._0x2c18ba[_0x4038c9(0x1cb)](_0x15954e=>_0x3d489c[_0x4038c9(0x148)](_0x15954e)),..._0x3d489c[_0x4038c9(0x1cb)](_0xaeed93=>!_0x2c18ba['includes'](_0xaeed93))[_0x4038c9(0x18a)]()]:_0x3d489c[_0x4038c9(0x18a)]();for(const _0x4ec126 of _0x3ce200){const _0x13d204=_0x361cbb[_0x4ec126];if(_0x13d204[_0x4038c9(0x1c9)]){const _0x17dcf9=_0x13d204[_0x4038c9(0x1c9)];if(_0x17dcf9[_0x4038c9(0x1a7)]!==_0x4038c9(0x131)&&_0x17dcf9[_0x4038c9(0x1a7)]!=='Or'){const _0x368508=_0x17dcf9['type']??_0x4038c9(0x19a);throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x4038c9(0x151)+_0x4ec126+_0x4038c9(0x1ea)+(_0x4038c9(0x133)+_0x368508+_0x4038c9(0x177))+_0x4038c9(0x144)+_0x4038c9(0x179)+_0x4038c9(0x1d8)+_0x4038c9(0x1dd)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x4038c9(0x1ab)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x17dcf9[_0x4038c9(0x161)]||!Array[_0x4038c9(0x1c0)](_0x17dcf9['conditions']))throw new SDKError(ErrorCode[_0x4038c9(0x1de)],_0x4038c9(0x151)+_0x4ec126+_0x4038c9(0x1ea)+_0x4038c9(0x17d)+_0x4038c9(0x144)+'\x20\x20rule:\x0a'+(_0x4038c9(0x1a1)+_0x17dcf9[_0x4038c9(0x1a7)]+'\x0a')+_0x4038c9(0x1dd)+_0x4038c9(0x1b0)+_0x4038c9(0x1ab)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}_0x1a9012[_0x4ec126]={..._0x13d204['description']&&_0x13d204[_0x4038c9(0x18c)][_0x4038c9(0x14d)]()&&{'description':_0x13d204[_0x4038c9(0x18c)]},..._0x13d204[_0x4038c9(0x1c9)]&&{'rule':deepSortObject(_0x13d204['rule'])}};}return _0x1a9012;}function normalizeEmbeddedActivations(_0x5a9603,_0x2b5856){const _0x32c684=a146_0x6eff7,_0x3b42cf={},_0x1d0317=Object[_0x32c684(0x15c)](_0x5a9603),_0x467f05=_0x2b5856?[..._0x2b5856[_0x32c684(0x1cb)](_0x3d2d14=>_0x1d0317[_0x32c684(0x148)](_0x3d2d14)),..._0x1d0317['filter'](_0x10ed77=>!_0x2b5856[_0x32c684(0x148)](_0x10ed77))['sort']()]:_0x1d0317[_0x32c684(0x18a)]();for(const _0x66915c of _0x467f05){const _0x12b2f6=_0x5a9603[_0x66915c];_0x3b42cf[_0x66915c]={'name':_0x12b2f6[_0x32c684(0x152)],'connection':_0x12b2f6['connection'],..._0x12b2f6[_0x32c684(0x18c)]!==undefined&&{'description':_0x12b2f6['description']},..._0x12b2f6[_0x32c684(0x130)]!==undefined&&{'all_columns':_0x12b2f6[_0x32c684(0x130)]},..._0x12b2f6[_0x32c684(0x16d)]!==undefined&&{'columns':_0x12b2f6[_0x32c684(0x16d)]},..._0x12b2f6[_0x32c684(0x1a5)]!==undefined&&{'behavior':_0x12b2f6[_0x32c684(0x1a5)]},..._0x12b2f6[_0x32c684(0x14c)]!==undefined&&{'schedule':_0x12b2f6['schedule']},..._0x12b2f6[_0x32c684(0x1cf)]!==undefined&&{'notification':_0x12b2f6[_0x32c684(0x1cf)]},..._0x12b2f6[_0x32c684(0x1e3)]!==undefined&&{'connector_config':_0x12b2f6[_0x32c684(0x1e3)]},..._0x12b2f6[_0x32c684(0x1e9)]!==undefined&&{'activation_template_id':_0x12b2f6[_0x32c684(0x1e9)]}};}return _0x3b42cf;}export function getActiveStages(_0x4d2133){const _0x181e84=a146_0x6eff7;if(isJourneysArrayMode(_0x4d2133)){const _0x30e711=_0x4d2133[_0x181e84(0x146)]||[],_0x521ab3=_0x30e711[_0x181e84(0x183)](_0x3bea2b=>_0x3bea2b['latest']===!![])||_0x30e711[0x0];return _0x521ab3?.[_0x181e84(0x1b3)]||[];}if(isSingleVersionMode(_0x4d2133))return _0x4d2133[_0x181e84(0x1b3)]||[];if(isMultiVersionMode(_0x4d2133)){const _0x22d615=_0x4d2133[_0x181e84(0x147)]||[],_0x12366c=_0x22d615[_0x181e84(0x183)](_0x1ac40b=>_0x1ac40b[_0x181e84(0x1ba)]===!![])||_0x22d615[0x0];return _0x12366c?.[_0x181e84(0x1b3)]||[];}return[];}export function getLatestJourneyEntry(_0x449516){const _0x5840dd=a146_0x6eff7;if(isJourneysArrayMode(_0x449516)){const _0x3e1fc0=_0x449516[_0x5840dd(0x146)]||[];return _0x3e1fc0[_0x5840dd(0x183)](_0x399521=>_0x399521['latest']===!![])||_0x3e1fc0[0x0];}if(isMultiVersionMode(_0x449516)){const _0x36a7b5=_0x449516[_0x5840dd(0x147)]||[],_0x288941=_0x36a7b5[_0x5840dd(0x183)](_0x4bbd0b=>_0x4bbd0b[_0x5840dd(0x1ba)]===!![])||_0x36a7b5[0x0];if(_0x288941)return{'version':_0x288941[_0x5840dd(0x152)],'state':_0x288941[_0x5840dd(0x158)],'latest':_0x288941[_0x5840dd(0x1ba)],'stages':_0x288941[_0x5840dd(0x1b3)],'id':_0x288941['id'],'version_number':_0x288941[_0x5840dd(0x1d6)]};}if(isSingleVersionMode(_0x449516))return{'version':_0x449516[_0x5840dd(0x163)]||'v1','state':_0x5840dd(0x154),'stages':_0x449516[_0x5840dd(0x1b3)]||[],'id':_0x449516['id'],'version_number':_0x449516[_0x5840dd(0x1d6)],'goal':_0x449516[_0x5840dd(0x19e)],'reentry':_0x449516[_0x5840dd(0x132)]};return undefined;}export function getLatestVersion(_0x9020e2){const _0x481fcd=a146_0x6eff7;if(!isMultiVersionMode(_0x9020e2))return undefined;const _0x5ae2ba=_0x9020e2['versions']||[];return _0x5ae2ba[_0x481fcd(0x183)](_0x1293a1=>_0x1293a1['latest']===!![])||_0x5ae2ba[0x0];}export function getEffectiveGoal(_0x2098a1){const _0x59ca44=a146_0x6eff7,_0x30e390=getLatestJourneyEntry(_0x2098a1);return _0x30e390?.[_0x59ca44(0x19e)]||_0x2098a1[_0x59ca44(0x19e)];}export function getEffectiveReentry(_0x3b70cb){const _0x4a7369=a146_0x6eff7,_0x4763d5=getLatestJourneyEntry(_0x3b70cb);return _0x4763d5?.[_0x4a7369(0x132)]||_0x3b70cb[_0x4a7369(0x132)];}export function collectSegmentRefs(_0x11cc71){const _0x5704c1=a146_0x6eff7,_0x4db272=new Set();_0x11cc71[_0x5704c1(0x19e)]?.[_0x5704c1(0x186)]&&_0x4db272['add'](_0x11cc71[_0x5704c1(0x19e)]['segment']);const _0x10605e=_0x4865aa=>{const _0x5b7665=_0x5704c1;for(const _0x517fe5 of _0x4865aa){_0x517fe5[_0x5b7665(0x18d)]?.[_0x5b7665(0x186)]&&_0x4db272[_0x5b7665(0x192)](_0x517fe5[_0x5b7665(0x18d)][_0x5b7665(0x186)]);if(_0x517fe5[_0x5b7665(0x1cc)])for(const _0x4288eb of _0x517fe5['exit_criteria']){_0x4288eb[_0x5b7665(0x186)]&&_0x4db272['add'](_0x4288eb[_0x5b7665(0x186)]);}_0x517fe5[_0x5b7665(0x1ce)]?.[_0x5b7665(0x186)]&&_0x4db272[_0x5b7665(0x192)](_0x517fe5[_0x5b7665(0x1ce)][_0x5b7665(0x186)]);if(_0x517fe5['steps'])for(const _0x593d7c of _0x517fe5[_0x5b7665(0x1e8)]){if(_0x593d7c[_0x5b7665(0x1a7)]==='decision_point'){const _0x136a88=_0x593d7c;for(const _0x494770 of _0x136a88[_0x5b7665(0x1bb)][_0x5b7665(0x1ee)]){_0x494770[_0x5b7665(0x186)]&&_0x4db272[_0x5b7665(0x192)](_0x494770['segment']);}}else{if(_0x593d7c[_0x5b7665(0x1a7)]===_0x5b7665(0x1b9)){const _0xf7a5bf=_0x593d7c;_0xf7a5bf[_0x5b7665(0x1bb)][_0x5b7665(0x160)]?.[_0x5b7665(0x186)]&&_0x4db272['add'](_0xf7a5bf[_0x5b7665(0x1bb)][_0x5b7665(0x160)][_0x5b7665(0x186)]);}}}}};_0x11cc71[_0x5704c1(0x1b3)]&&_0x10605e(_0x11cc71[_0x5704c1(0x1b3)]);if(_0x11cc71[_0x5704c1(0x147)])for(const _0x27d91e of _0x11cc71[_0x5704c1(0x147)]){_0x10605e(_0x27d91e[_0x5704c1(0x1b3)]);}return _0x4db272;}export function validateSegmentRefs(_0x3696e5){const _0x29a306=a146_0x6eff7,_0x566b0a=[],_0x24f923=collectSegmentRefs(_0x3696e5),_0x3bd6f0=new Set(Object['keys'](_0x3696e5[_0x29a306(0x1ac)]||{}));for(const _0x366747 of _0x24f923){const _0x2f8301=parseSegmentRef(_0x366747);_0x2f8301[_0x29a306(0x1a7)]===_0x29a306(0x1c6)&&!_0x3bd6f0[_0x29a306(0x1b8)](_0x2f8301[_0x29a306(0x152)])&&_0x566b0a[_0x29a306(0x188)]('Unknown\x20segment\x20\x22'+_0x2f8301[_0x29a306(0x152)]+_0x29a306(0x1a6)+_0x2f8301[_0x29a306(0x152)]+_0x29a306(0x1c8));}return _0x566b0a;}export function collectSegmentIdsFromJourneyApi(_0x116929){const _0x219ad4=a146_0x6eff7,_0x58104b=new Set();_0x116929[_0x219ad4(0x13e)]['goal']?.[_0x219ad4(0x1b7)]&&_0x58104b[_0x219ad4(0x192)](_0x116929[_0x219ad4(0x13e)][_0x219ad4(0x19e)][_0x219ad4(0x1b7)]);const _0x24a8b7=_0x116929[_0x219ad4(0x13e)][_0x219ad4(0x1db)];if(Array['isArray'](_0x24a8b7))for(const _0x3cf11e of _0x24a8b7){_0x3cf11e[_0x219ad4(0x1b5)]?.[_0x219ad4(0x1b7)]&&_0x58104b[_0x219ad4(0x192)](_0x3cf11e[_0x219ad4(0x1b5)][_0x219ad4(0x1b7)]);const _0x228507=_0x3cf11e[_0x219ad4(0x159)]??_0x3cf11e[_0x219ad4(0x137)];if(Array[_0x219ad4(0x1c0)](_0x228507))for(const _0x12e2b5 of _0x228507){_0x12e2b5['segmentId']&&_0x58104b[_0x219ad4(0x192)](_0x12e2b5[_0x219ad4(0x1b7)]);}_0x3cf11e['milestone']?.[_0x219ad4(0x1b7)]&&_0x58104b[_0x219ad4(0x192)](_0x3cf11e[_0x219ad4(0x1ce)][_0x219ad4(0x1b7)]);if(_0x3cf11e[_0x219ad4(0x1e8)]&&typeof _0x3cf11e[_0x219ad4(0x1e8)]===_0x219ad4(0x1b6)){const _0x123ef0=Array[_0x219ad4(0x1c0)](_0x3cf11e[_0x219ad4(0x1e8)])?_0x3cf11e[_0x219ad4(0x1e8)]:Object[_0x219ad4(0x14f)](_0x3cf11e[_0x219ad4(0x1e8)]);for(const _0x5f2ff3 of _0x123ef0){_0x5f2ff3[_0x219ad4(0x13a)]?.[_0x219ad4(0x1b7)]&&_0x58104b[_0x219ad4(0x192)](_0x5f2ff3[_0x219ad4(0x13a)][_0x219ad4(0x1b7)]);const _0x166c37=_0x5f2ff3;_0x166c37[_0x219ad4(0x157)]&&_0x58104b[_0x219ad4(0x192)](_0x166c37[_0x219ad4(0x157)]);if(Array[_0x219ad4(0x1c0)](_0x166c37['conditions']))for(const _0x37520e of _0x166c37[_0x219ad4(0x161)]){_0x37520e[_0x219ad4(0x1b7)]&&_0x58104b[_0x219ad4(0x192)](_0x37520e['segmentId']);}if(Array['isArray'](_0x5f2ff3[_0x219ad4(0x1ee)]))for(const _0x2c128b of _0x5f2ff3[_0x219ad4(0x1ee)]){_0x2c128b[_0x219ad4(0x1b7)]&&_0x58104b[_0x219ad4(0x192)](_0x2c128b[_0x219ad4(0x1b7)]);}}}}return _0x58104b;}
@@ -1 +1 @@
1
- const a138_0x5dc222=a138_0x140f;(function(_0x30f056,_0x3fc1f2){const _0x9893e=a138_0x140f,_0x5d4cdc=_0x30f056();while(!![]){try{const _0x26daec=-parseInt(_0x9893e(0x12f))/0x1+parseInt(_0x9893e(0x13c))/0x2*(parseInt(_0x9893e(0x153))/0x3)+-parseInt(_0x9893e(0x156))/0x4*(-parseInt(_0x9893e(0x12b))/0x5)+-parseInt(_0x9893e(0x11d))/0x6*(-parseInt(_0x9893e(0x13a))/0x7)+-parseInt(_0x9893e(0x14c))/0x8+-parseInt(_0x9893e(0x155))/0x9+parseInt(_0x9893e(0x12c))/0xa;if(_0x26daec===_0x3fc1f2)break;else _0x5d4cdc['push'](_0x5d4cdc['shift']());}catch(_0x59b18d){_0x5d4cdc['push'](_0x5d4cdc['shift']());}}}(a138_0x5d3f,0x968c7));export const DEFAULT_TIME_RANGE=a138_0x5dc222(0x145);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x4984e8,_0x3ea8b2,_0x2d60c8){const _0x2a24b5=a138_0x5dc222,_0x3ac6fe=_0x2d60c8&&_0x2d60c8[_0x2a24b5(0x142)]>0x0?_0x2d60c8[_0x2a24b5(0x12e)](',\x20'):'*';return _0x2a24b5(0x140)+_0x3ac6fe+_0x2a24b5(0x11e)+_0x4984e8+'.'+_0x3ea8b2+_0x2a24b5(0x12a);}export function generateMasterCountSQL(_0x21a150){const _0x3505e0=a138_0x5dc222,{database:_0x3c7bca,table:_0x27785e}=_0x21a150[_0x3505e0(0x144)];return'SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20'+_0x3c7bca+'.'+_0x27785e;}export function generateMasterSampleSQL(_0x57b9dd,_0x37c860=0x5){const _0x583597=a138_0x5dc222,{database:_0x5d84bb,table:_0x2146db}=_0x57b9dd[_0x583597(0x144)];return _0x583597(0x14e)+_0x5d84bb+'.'+_0x2146db+'\x20LIMIT\x20'+_0x37c860;}export function generateAttributeCoverageSQL(_0x3ca6a2,_0xeba4bf){const _0x30ceb1=a138_0x5dc222,_0x10cbec=_0x3ca6a2[_0x30ceb1(0x144)];return(_0x30ceb1(0x14d)+_0x10cbec[_0x30ceb1(0x141)]+'.'+_0x10cbec[_0x30ceb1(0x11a)]+_0x30ceb1(0x148)+_0xeba4bf[_0x30ceb1(0x13f)][_0x30ceb1(0x141)]+'.'+_0xeba4bf[_0x30ceb1(0x13f)][_0x30ceb1(0x11a)]+_0x30ceb1(0x125)+_0xeba4bf[_0x30ceb1(0x12e)][_0x30ceb1(0x11f)]+_0x30ceb1(0x11c)+_0xeba4bf[_0x30ceb1(0x12e)][_0x30ceb1(0x12d)]+_0x30ceb1(0x139)+_0xeba4bf[_0x30ceb1(0x12e)][_0x30ceb1(0x12d)]+_0x30ceb1(0x152))[_0x30ceb1(0x126)]();}export function generateBehaviorStatsSQL(_0x23a754,_0x5cb321,_0x7f57eb=DEFAULT_TIME_RANGE){const _0x5d37ce=a138_0x5dc222,_0x5a71b9=_0x23a754[_0x5d37ce(0x144)];return(_0x5d37ce(0x14f)+_0x5cb321[_0x5d37ce(0x12e)][_0x5d37ce(0x11f)]+')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20'+_0x5a71b9['database']+'.'+_0x5a71b9['table']+_0x5d37ce(0x13e)+_0x5cb321['source'][_0x5d37ce(0x141)]+'.'+_0x5cb321['source'][_0x5d37ce(0x11a)]+_0x5d37ce(0x13d)+_0x5cb321[_0x5d37ce(0x12e)][_0x5d37ce(0x11f)]+_0x5d37ce(0x151)+_0x5cb321[_0x5d37ce(0x12e)][_0x5d37ce(0x12d)]+_0x5d37ce(0x132)+_0x7f57eb+_0x5d37ce(0x123))[_0x5d37ce(0x126)]();}export function generateAttributeSampleSQL(_0x1b2324,_0x2966b9,_0x5d7fa5=0x5){const _0x10a960=a138_0x5dc222,_0x35e873=_0x1b2324['master'],_0x36a05c=_0x2966b9['join']['parent_key'],_0x5edb75=_0x2966b9[_0x10a960(0x146)][_0x10a960(0x138)](_0x1d68e9=>'a.'+_0x1d68e9[_0x10a960(0x121)])[_0x10a960(0x12e)](',\x20');return(_0x10a960(0x135)+_0x36a05c+',\x20'+_0x5edb75+_0x10a960(0x120)+_0x35e873['database']+'.'+_0x35e873[_0x10a960(0x11a)]+_0x10a960(0x13e)+_0x2966b9[_0x10a960(0x13f)][_0x10a960(0x141)]+'.'+_0x2966b9[_0x10a960(0x13f)][_0x10a960(0x11a)]+_0x10a960(0x125)+_0x2966b9[_0x10a960(0x12e)][_0x10a960(0x11f)]+_0x10a960(0x11c)+_0x2966b9[_0x10a960(0x12e)][_0x10a960(0x12d)]+_0x10a960(0x128)+_0x5d7fa5+'\x0a')[_0x10a960(0x126)]();}export function generateBehaviorSampleSQL(_0x21662a,_0xc3c9de,_0x427047=0x5,_0x47854e=DEFAULT_TIME_RANGE){const _0x540490=a138_0x5dc222,_0x24ad3e=_0x21662a['master'],_0x48388d=_0xc3c9de['join'][_0x540490(0x11f)];let _0x25d165;if(_0xc3c9de[_0x540490(0x124)])_0x25d165='b.*';else _0xc3c9de[_0x540490(0x146)]&&_0xc3c9de['columns'][_0x540490(0x142)]>0x0?_0x25d165=_0xc3c9de['columns'][_0x540490(0x138)](_0x3fbd25=>'b.'+_0x3fbd25[_0x540490(0x121)])[_0x540490(0x12e)](',\x20'):_0x25d165=_0x540490(0x137);return(_0x540490(0x135)+_0x48388d+',\x20'+_0x25d165+_0x540490(0x120)+_0x24ad3e[_0x540490(0x141)]+'.'+_0x24ad3e['table']+_0x540490(0x13e)+_0xc3c9de[_0x540490(0x13f)][_0x540490(0x141)]+'.'+_0xc3c9de[_0x540490(0x13f)]['table']+_0x540490(0x13d)+_0xc3c9de['join'][_0x540490(0x11f)]+_0x540490(0x151)+_0xc3c9de[_0x540490(0x12e)]['child_key']+_0x540490(0x132)+_0x47854e+'\x27)\x0aLIMIT\x20'+_0x427047+'\x0a')['trim']();}function quoteIdentifier(_0x3048b8){const _0x3e15f3=a138_0x5dc222;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x3e15f3(0x134)](_0x3048b8))return'\x22'+_0x3048b8[_0x3e15f3(0x154)](/"/g,'\x22\x22')+'\x22';return _0x3048b8;}export function generateEnrichedSQL(_0xe1e96c,_0x463dc1=0x5){const _0x24254a=a138_0x5dc222,_0x5e3cff=_0xe1e96c[_0x24254a(0x144)],_0x4320bb=_0xe1e96c[_0x24254a(0x133)]||[];if(_0x4320bb[_0x24254a(0x142)]===0x0)return _0x24254a(0x14e)+_0x5e3cff[_0x24254a(0x141)]+'.'+_0x5e3cff[_0x24254a(0x11a)]+_0x24254a(0x150)+_0x463dc1;const _0x48b72c=[_0x24254a(0x136)],_0x4e30ef=[];return _0x4320bb[_0x24254a(0x147)]((_0x351f8c,_0x44c459)=>{const _0x5d7443=_0x24254a,_0x223948='a'+_0x44c459;_0x351f8c[_0x5d7443(0x146)][_0x5d7443(0x147)](_0x4e00e0=>{const _0x4b4183=_0x5d7443,_0x2e0e98=quoteIdentifier(_0x4e00e0[_0x4b4183(0x129)]||_0x4e00e0['column']);_0x48b72c['push'](_0x223948+'.'+_0x4e00e0[_0x4b4183(0x121)]+_0x4b4183(0x13b)+_0x2e0e98);}),_0x4e30ef['push'](_0x5d7443(0x119)+_0x351f8c['source']['database']+'.'+_0x351f8c[_0x5d7443(0x13f)]['table']+'\x20'+_0x223948+_0x5d7443(0x149)+_0x351f8c[_0x5d7443(0x12e)][_0x5d7443(0x11f)]+'\x20=\x20'+_0x223948+'.'+_0x351f8c[_0x5d7443(0x12e)][_0x5d7443(0x12d)]);}),(_0x24254a(0x130)+_0x48b72c[_0x24254a(0x12e)](',\x20')+_0x24254a(0x120)+_0x5e3cff[_0x24254a(0x141)]+'.'+_0x5e3cff['table']+_0x24254a(0x122)+_0x4e30ef[_0x24254a(0x12e)]('\x0a')+_0x24254a(0x128)+_0x463dc1+'\x0a')[_0x24254a(0x126)]();}export function generateAttributeSchemaSQL(_0x49feb2,_0x547abf){const _0x22c781=a138_0x5dc222,_0x9af6ee=_0x49feb2[_0x22c781(0x144)],_0x219be3=_0x547abf['join'][_0x22c781(0x11f)],_0x1fae20=_0x547abf[_0x22c781(0x146)][_0x22c781(0x138)](_0x27bb2b=>'a.'+_0x27bb2b[_0x22c781(0x121)])['join'](',\x20');return(_0x22c781(0x135)+_0x219be3+',\x20'+_0x1fae20+_0x22c781(0x120)+_0x9af6ee['database']+'.'+_0x9af6ee[_0x22c781(0x11a)]+_0x22c781(0x13e)+_0x547abf[_0x22c781(0x13f)][_0x22c781(0x141)]+'.'+_0x547abf[_0x22c781(0x13f)][_0x22c781(0x11a)]+_0x22c781(0x125)+_0x547abf[_0x22c781(0x12e)][_0x22c781(0x11f)]+_0x22c781(0x11c)+_0x547abf[_0x22c781(0x12e)]['child_key']+'\x0aLIMIT\x200\x0a')[_0x22c781(0x126)]();}function a138_0x5d3f(){const _0x2aba52=['1828USBVpc','\x20b\x0a\x20\x20ON\x20m.','\x20m\x0aJOIN\x20','source','SELECT\x20','database','length','toLowerCase','master','-1d','columns','forEach','\x20m\x0aLEFT\x20JOIN\x20','\x0a\x20\x20ON\x20m.','name','\x0aLIMIT\x200\x0a','4664088YLxQen','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','SELECT\x20*\x20FROM\x20','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','\x20LIMIT\x20','\x20=\x20b.','\x20IS\x20NOT\x20NULL\x0a','57eDWpcC','replace','5070348zAFDTJ','84156LniWId','LEFT\x20JOIN\x20','table','find','\x20=\x20a.','24NqkCqc','\x20FROM\x20','parent_key','\x0aFROM\x20','column','\x20m\x0a','\x27)\x0a','all_columns','\x20a\x0a\x20\x20ON\x20m.','trim','(all\x20columns)','\x0aLIMIT\x20','label','\x20LIMIT\x200','140RTjrtM','16475310IZDvKv','child_key','join','896671nhShEj','\x0aSELECT\x20','behaviors','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','attributes','test','\x0aSELECT\x20m.','m.*','b.*','map','\x0aWHERE\x20a.','709996EtWmjm','\x20AS\x20'];a138_0x5d3f=function(){return _0x2aba52;};return a138_0x5d3f();}export function generateBehaviorSchemaSQL(_0x149fed,_0x4693de){const _0x202851=a138_0x5dc222,_0x3cf4f4=_0x149fed['master'],_0x354c11=_0x4693de[_0x202851(0x12e)][_0x202851(0x11f)];let _0x17b12e;if(_0x4693de[_0x202851(0x124)])_0x17b12e='b.*';else _0x4693de[_0x202851(0x146)]&&_0x4693de[_0x202851(0x146)][_0x202851(0x142)]>0x0?_0x17b12e=_0x4693de['columns'][_0x202851(0x138)](_0x3b616d=>'b.'+_0x3b616d[_0x202851(0x121)])[_0x202851(0x12e)](',\x20'):_0x17b12e='b.*';return(_0x202851(0x135)+_0x354c11+',\x20'+_0x17b12e+_0x202851(0x120)+_0x3cf4f4[_0x202851(0x141)]+'.'+_0x3cf4f4['table']+_0x202851(0x13e)+_0x4693de[_0x202851(0x13f)][_0x202851(0x141)]+'.'+_0x4693de[_0x202851(0x13f)]['table']+_0x202851(0x13d)+_0x4693de[_0x202851(0x12e)][_0x202851(0x11f)]+'\x20=\x20b.'+_0x4693de[_0x202851(0x12e)][_0x202851(0x12d)]+_0x202851(0x14b))[_0x202851(0x126)]();}function a138_0x140f(_0x1aecc1,_0x82edc){_0x1aecc1=_0x1aecc1-0x119;const _0x5d3f5a=a138_0x5d3f();let _0x140fb2=_0x5d3f5a[_0x1aecc1];return _0x140fb2;}export function getAttributeColumns(_0x1e8ddf){const _0x334a80=a138_0x5dc222;return _0x1e8ddf[_0x334a80(0x146)][_0x334a80(0x138)](_0x467247=>({'label':_0x467247[_0x334a80(0x129)]||_0x467247[_0x334a80(0x121)],'column':_0x467247[_0x334a80(0x121)]}));}export function getBehaviorColumns(_0x29aa52){const _0x17c4a8=a138_0x5dc222;if(_0x29aa52[_0x17c4a8(0x124)])return[{'label':_0x17c4a8(0x127),'column':'*'}];if(_0x29aa52['columns']&&_0x29aa52[_0x17c4a8(0x146)][_0x17c4a8(0x142)]>0x0)return _0x29aa52[_0x17c4a8(0x146)]['map'](_0x550660=>({'label':_0x550660[_0x17c4a8(0x129)]||_0x550660[_0x17c4a8(0x121)],'column':_0x550660[_0x17c4a8(0x121)]}));return[{'label':_0x17c4a8(0x127),'column':'*'}];}export function findAttributeByName(_0x11a0d5,_0x833e53){const _0x598626=a138_0x5dc222;return _0x11a0d5[_0x598626(0x133)]?.['find'](_0x25038f=>_0x25038f[_0x598626(0x14a)][_0x598626(0x143)]()===_0x833e53[_0x598626(0x143)]());}export function findBehaviorByName(_0x562d07,_0x49e133){const _0x25e9d6=a138_0x5dc222;return _0x562d07[_0x25e9d6(0x131)]?.[_0x25e9d6(0x11b)](_0x1e6f40=>_0x1e6f40[_0x25e9d6(0x14a)][_0x25e9d6(0x143)]()===_0x49e133['toLowerCase']());}
1
+ (function(_0x423cfc,_0x371935){const _0x48a1a9=a147_0x5c44,_0x4d9ff1=_0x423cfc();while(!![]){try{const _0x4ca699=parseInt(_0x48a1a9(0x1ad))/0x1+-parseInt(_0x48a1a9(0x1b9))/0x2+-parseInt(_0x48a1a9(0x194))/0x3*(parseInt(_0x48a1a9(0x1ca))/0x4)+parseInt(_0x48a1a9(0x1a0))/0x5*(-parseInt(_0x48a1a9(0x1a4))/0x6)+-parseInt(_0x48a1a9(0x1af))/0x7+-parseInt(_0x48a1a9(0x1b7))/0x8+parseInt(_0x48a1a9(0x1ba))/0x9*(parseInt(_0x48a1a9(0x19b))/0xa);if(_0x4ca699===_0x371935)break;else _0x4d9ff1['push'](_0x4d9ff1['shift']());}catch(_0x1b7d63){_0x4d9ff1['push'](_0x4d9ff1['shift']());}}}(a147_0x31c1,0x28d7c));export const DEFAULT_TIME_RANGE='-1d';export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x1170a0,_0x3ce734,_0x2675e2){const _0x6749c3=a147_0x5c44,_0x57a7fd=_0x2675e2&&_0x2675e2[_0x6749c3(0x196)]>0x0?_0x2675e2[_0x6749c3(0x1b5)](',\x20'):'*';return'SELECT\x20'+_0x57a7fd+'\x20FROM\x20'+_0x1170a0+'.'+_0x3ce734+_0x6749c3(0x1b2);}export function generateMasterCountSQL(_0x5b5ace){const _0xdeb3b1=a147_0x5c44,{database:_0x4f9ba3,table:_0x184628}=_0x5b5ace[_0xdeb3b1(0x1c1)];return'SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20'+_0x4f9ba3+'.'+_0x184628;}export function generateMasterSampleSQL(_0x5568bb,_0x4dc96c=0x5){const _0xb187bd=a147_0x5c44,{database:_0x4d30d3,table:_0x2c6573}=_0x5568bb[_0xb187bd(0x1c1)];return _0xb187bd(0x193)+_0x4d30d3+'.'+_0x2c6573+'\x20LIMIT\x20'+_0x4dc96c;}export function generateAttributeCoverageSQL(_0x2f3067,_0x31f5a0){const _0x45af10=a147_0x5c44,_0x504c6c=_0x2f3067[_0x45af10(0x1c1)];return('\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20'+_0x504c6c[_0x45af10(0x1b6)]+'.'+_0x504c6c[_0x45af10(0x1a8)]+_0x45af10(0x19e)+_0x31f5a0[_0x45af10(0x1a1)][_0x45af10(0x1b6)]+'.'+_0x31f5a0['source'][_0x45af10(0x1a8)]+_0x45af10(0x195)+_0x31f5a0[_0x45af10(0x1b5)][_0x45af10(0x1b4)]+_0x45af10(0x1a9)+_0x31f5a0[_0x45af10(0x1b5)][_0x45af10(0x1c4)]+_0x45af10(0x1c3)+_0x31f5a0[_0x45af10(0x1b5)][_0x45af10(0x1c4)]+_0x45af10(0x1c0))['trim']();}export function generateBehaviorStatsSQL(_0x2c9994,_0x8a9c54,_0x103112=DEFAULT_TIME_RANGE){const _0x2914da=a147_0x5c44,_0x49b8ef=_0x2c9994[_0x2914da(0x1c1)];return(_0x2914da(0x1bb)+_0x8a9c54['join'][_0x2914da(0x1b4)]+')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20'+_0x49b8ef['database']+'.'+_0x49b8ef[_0x2914da(0x1a8)]+_0x2914da(0x1c9)+_0x8a9c54[_0x2914da(0x1a1)][_0x2914da(0x1b6)]+'.'+_0x8a9c54['source'][_0x2914da(0x1a8)]+_0x2914da(0x1aa)+_0x8a9c54[_0x2914da(0x1b5)][_0x2914da(0x1b4)]+_0x2914da(0x19c)+_0x8a9c54[_0x2914da(0x1b5)][_0x2914da(0x1c4)]+_0x2914da(0x1c6)+_0x103112+_0x2914da(0x199))[_0x2914da(0x1b0)]();}export function generateAttributeSampleSQL(_0x310d84,_0x1b4fa2,_0x236bfd=0x5){const _0x17159e=a147_0x5c44,_0x26512b=_0x310d84[_0x17159e(0x1c1)],_0x23b1fe=_0x1b4fa2[_0x17159e(0x1b5)][_0x17159e(0x1b4)],_0x2ac371=_0x1b4fa2[_0x17159e(0x1b1)]['map'](_0x5b4a4d=>'a.'+_0x5b4a4d[_0x17159e(0x19f)])[_0x17159e(0x1b5)](',\x20');return(_0x17159e(0x1be)+_0x23b1fe+',\x20'+_0x2ac371+_0x17159e(0x1c5)+_0x26512b[_0x17159e(0x1b6)]+'.'+_0x26512b['table']+_0x17159e(0x1c9)+_0x1b4fa2[_0x17159e(0x1a1)][_0x17159e(0x1b6)]+'.'+_0x1b4fa2[_0x17159e(0x1a1)][_0x17159e(0x1a8)]+_0x17159e(0x195)+_0x1b4fa2['join'][_0x17159e(0x1b4)]+_0x17159e(0x1a9)+_0x1b4fa2['join'][_0x17159e(0x1c4)]+_0x17159e(0x1ab)+_0x236bfd+'\x0a')['trim']();}export function generateBehaviorSampleSQL(_0x139998,_0x3dc948,_0x36f8ab=0x5,_0x209742=DEFAULT_TIME_RANGE){const _0x21b479=a147_0x5c44,_0x11961f=_0x139998[_0x21b479(0x1c1)],_0x1160bf=_0x3dc948[_0x21b479(0x1b5)][_0x21b479(0x1b4)];let _0x4989dc;if(_0x3dc948[_0x21b479(0x197)])_0x4989dc='b.*';else _0x3dc948[_0x21b479(0x1b1)]&&_0x3dc948[_0x21b479(0x1b1)]['length']>0x0?_0x4989dc=_0x3dc948['columns'][_0x21b479(0x19d)](_0x2a317b=>'b.'+_0x2a317b[_0x21b479(0x19f)])[_0x21b479(0x1b5)](',\x20'):_0x4989dc=_0x21b479(0x1a2);return(_0x21b479(0x1be)+_0x1160bf+',\x20'+_0x4989dc+'\x0aFROM\x20'+_0x11961f['database']+'.'+_0x11961f[_0x21b479(0x1a8)]+_0x21b479(0x1c9)+_0x3dc948[_0x21b479(0x1a1)]['database']+'.'+_0x3dc948[_0x21b479(0x1a1)][_0x21b479(0x1a8)]+'\x20b\x0a\x20\x20ON\x20m.'+_0x3dc948[_0x21b479(0x1b5)][_0x21b479(0x1b4)]+_0x21b479(0x19c)+_0x3dc948[_0x21b479(0x1b5)][_0x21b479(0x1c4)]+_0x21b479(0x1c6)+_0x209742+_0x21b479(0x198)+_0x36f8ab+'\x0a')['trim']();}function quoteIdentifier(_0x312304){const _0x380dd1=a147_0x5c44;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x380dd1(0x1a6)](_0x312304))return'\x22'+_0x312304[_0x380dd1(0x1c8)](/"/g,'\x22\x22')+'\x22';return _0x312304;}export function generateEnrichedSQL(_0x2e3a42,_0x3c7112=0x5){const _0x2a827b=a147_0x5c44,_0x1ad4d1=_0x2e3a42[_0x2a827b(0x1c1)],_0x16563e=_0x2e3a42[_0x2a827b(0x1c7)]||[];if(_0x16563e[_0x2a827b(0x196)]===0x0)return _0x2a827b(0x193)+_0x1ad4d1[_0x2a827b(0x1b6)]+'.'+_0x1ad4d1[_0x2a827b(0x1a8)]+_0x2a827b(0x1bd)+_0x3c7112;const _0x5b9b14=[_0x2a827b(0x192)],_0x4f2099=[];return _0x16563e[_0x2a827b(0x1cb)]((_0xcff895,_0x423d4e)=>{const _0x4bd220=_0x2a827b,_0xb11d66='a'+_0x423d4e;_0xcff895[_0x4bd220(0x1b1)]['forEach'](_0x320508=>{const _0x3e59a9=_0x4bd220,_0x12a476=quoteIdentifier(_0x320508[_0x3e59a9(0x1c2)]||_0x320508[_0x3e59a9(0x19f)]);_0x5b9b14[_0x3e59a9(0x1a3)](_0xb11d66+'.'+_0x320508[_0x3e59a9(0x19f)]+_0x3e59a9(0x1b3)+_0x12a476);}),_0x4f2099[_0x4bd220(0x1a3)](_0x4bd220(0x1a7)+_0xcff895[_0x4bd220(0x1a1)][_0x4bd220(0x1b6)]+'.'+_0xcff895['source']['table']+'\x20'+_0xb11d66+'\x0a\x20\x20ON\x20m.'+_0xcff895[_0x4bd220(0x1b5)][_0x4bd220(0x1b4)]+'\x20=\x20'+_0xb11d66+'.'+_0xcff895[_0x4bd220(0x1b5)][_0x4bd220(0x1c4)]);}),(_0x2a827b(0x1b8)+_0x5b9b14[_0x2a827b(0x1b5)](',\x20')+'\x0aFROM\x20'+_0x1ad4d1[_0x2a827b(0x1b6)]+'.'+_0x1ad4d1[_0x2a827b(0x1a8)]+_0x2a827b(0x1ac)+_0x4f2099[_0x2a827b(0x1b5)]('\x0a')+_0x2a827b(0x1ab)+_0x3c7112+'\x0a')[_0x2a827b(0x1b0)]();}function a147_0x31c1(){const _0x457d10=['\x0aFROM\x20','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','attributes','replace','\x20m\x0aJOIN\x20','894308hVxPmE','forEach','(all\x20columns)','m.*','SELECT\x20*\x20FROM\x20','3tJkoTH','\x20a\x0a\x20\x20ON\x20m.','length','all_columns','\x27)\x0aLIMIT\x20','\x27)\x0a','\x0aLIMIT\x200\x0a','462440cPkgUL','\x20=\x20b.','map','\x20m\x0aLEFT\x20JOIN\x20','column','150235Cknrof','source','b.*','push','42pSvRYF','name','test','LEFT\x20JOIN\x20','table','\x20=\x20a.','\x20b\x0a\x20\x20ON\x20m.','\x0aLIMIT\x20','\x20m\x0a','71866eDmbni','behaviors','1608768yblRuv','trim','columns','\x20LIMIT\x200','\x20AS\x20','parent_key','join','database','237792YEMAIf','\x0aSELECT\x20','364488yffKSY','189RYIrne','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','toLowerCase','\x20LIMIT\x20','\x0aSELECT\x20m.','find','\x20IS\x20NOT\x20NULL\x0a','master','label','\x0aWHERE\x20a.','child_key'];a147_0x31c1=function(){return _0x457d10;};return a147_0x31c1();}export function generateAttributeSchemaSQL(_0x296231,_0x49f380){const _0x4ab9b9=a147_0x5c44,_0x10bdae=_0x296231[_0x4ab9b9(0x1c1)],_0x51b5b0=_0x49f380[_0x4ab9b9(0x1b5)][_0x4ab9b9(0x1b4)],_0x265c14=_0x49f380['columns'][_0x4ab9b9(0x19d)](_0x3bcdcb=>'a.'+_0x3bcdcb[_0x4ab9b9(0x19f)])['join'](',\x20');return('\x0aSELECT\x20m.'+_0x51b5b0+',\x20'+_0x265c14+'\x0aFROM\x20'+_0x10bdae[_0x4ab9b9(0x1b6)]+'.'+_0x10bdae[_0x4ab9b9(0x1a8)]+_0x4ab9b9(0x1c9)+_0x49f380[_0x4ab9b9(0x1a1)][_0x4ab9b9(0x1b6)]+'.'+_0x49f380['source']['table']+_0x4ab9b9(0x195)+_0x49f380['join'][_0x4ab9b9(0x1b4)]+_0x4ab9b9(0x1a9)+_0x49f380[_0x4ab9b9(0x1b5)][_0x4ab9b9(0x1c4)]+_0x4ab9b9(0x19a))[_0x4ab9b9(0x1b0)]();}export function generateBehaviorSchemaSQL(_0x3b3b5b,_0x297f2a){const _0x2a0aaa=a147_0x5c44,_0x24f810=_0x3b3b5b['master'],_0x23857b=_0x297f2a[_0x2a0aaa(0x1b5)][_0x2a0aaa(0x1b4)];let _0x3a8a31;if(_0x297f2a[_0x2a0aaa(0x197)])_0x3a8a31=_0x2a0aaa(0x1a2);else _0x297f2a['columns']&&_0x297f2a[_0x2a0aaa(0x1b1)][_0x2a0aaa(0x196)]>0x0?_0x3a8a31=_0x297f2a[_0x2a0aaa(0x1b1)][_0x2a0aaa(0x19d)](_0x5dbd8e=>'b.'+_0x5dbd8e[_0x2a0aaa(0x19f)])[_0x2a0aaa(0x1b5)](',\x20'):_0x3a8a31=_0x2a0aaa(0x1a2);return(_0x2a0aaa(0x1be)+_0x23857b+',\x20'+_0x3a8a31+_0x2a0aaa(0x1c5)+_0x24f810[_0x2a0aaa(0x1b6)]+'.'+_0x24f810[_0x2a0aaa(0x1a8)]+'\x20m\x0aJOIN\x20'+_0x297f2a[_0x2a0aaa(0x1a1)][_0x2a0aaa(0x1b6)]+'.'+_0x297f2a[_0x2a0aaa(0x1a1)][_0x2a0aaa(0x1a8)]+'\x20b\x0a\x20\x20ON\x20m.'+_0x297f2a[_0x2a0aaa(0x1b5)][_0x2a0aaa(0x1b4)]+_0x2a0aaa(0x19c)+_0x297f2a[_0x2a0aaa(0x1b5)]['child_key']+_0x2a0aaa(0x19a))[_0x2a0aaa(0x1b0)]();}export function getAttributeColumns(_0x5eca96){const _0x4e6c1d=a147_0x5c44;return _0x5eca96[_0x4e6c1d(0x1b1)]['map'](_0x5343d7=>({'label':_0x5343d7[_0x4e6c1d(0x1c2)]||_0x5343d7[_0x4e6c1d(0x19f)],'column':_0x5343d7[_0x4e6c1d(0x19f)]}));}function a147_0x5c44(_0x5f04a6,_0x28d271){_0x5f04a6=_0x5f04a6-0x191;const _0x31c177=a147_0x31c1();let _0x5c4461=_0x31c177[_0x5f04a6];return _0x5c4461;}export function getBehaviorColumns(_0x272c10){const _0x5bff8e=a147_0x5c44;if(_0x272c10[_0x5bff8e(0x197)])return[{'label':_0x5bff8e(0x191),'column':'*'}];if(_0x272c10['columns']&&_0x272c10[_0x5bff8e(0x1b1)][_0x5bff8e(0x196)]>0x0)return _0x272c10[_0x5bff8e(0x1b1)][_0x5bff8e(0x19d)](_0x168f74=>({'label':_0x168f74[_0x5bff8e(0x1c2)]||_0x168f74[_0x5bff8e(0x19f)],'column':_0x168f74[_0x5bff8e(0x19f)]}));return[{'label':_0x5bff8e(0x191),'column':'*'}];}export function findAttributeByName(_0x2c64cf,_0x2adc64){const _0x564b4d=a147_0x5c44;return _0x2c64cf['attributes']?.[_0x564b4d(0x1bf)](_0x56fb99=>_0x56fb99[_0x564b4d(0x1a5)][_0x564b4d(0x1bc)]()===_0x2adc64[_0x564b4d(0x1bc)]());}export function findBehaviorByName(_0x17d09f,_0x3cc13a){const _0x2b722b=a147_0x5c44;return _0x17d09f[_0x2b722b(0x1ae)]?.[_0x2b722b(0x1bf)](_0x58f18e=>_0x58f18e[_0x2b722b(0x1a5)][_0x2b722b(0x1bc)]()===_0x3cc13a[_0x2b722b(0x1bc)]());}