@treasuredata/tdx 2026.4.16 → 2026.4.18

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 (220) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +17 -2
@@ -1 +1 @@
1
- (function(_0x5baf8d,_0x4e7c86){const _0x2591f7=a146_0x4f36,_0xf70980=_0x5baf8d();while(!![]){try{const _0x439b8a=-parseInt(_0x2591f7(0x15f))/0x1*(parseInt(_0x2591f7(0x140))/0x2)+-parseInt(_0x2591f7(0x196))/0x3*(-parseInt(_0x2591f7(0x17d))/0x4)+parseInt(_0x2591f7(0x193))/0x5*(parseInt(_0x2591f7(0x127))/0x6)+parseInt(_0x2591f7(0x178))/0x7+parseInt(_0x2591f7(0x17a))/0x8*(parseInt(_0x2591f7(0x16c))/0x9)+parseInt(_0x2591f7(0x118))/0xa+parseInt(_0x2591f7(0x115))/0xb*(-parseInt(_0x2591f7(0x13d))/0xc);if(_0x439b8a===_0x4e7c86)break;else _0xf70980['push'](_0xf70980['shift']());}catch(_0x36ea2d){_0xf70980['push'](_0xf70980['shift']());}}}(a146_0x2362,0xad3ce));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x1d4774,_0x1038b6,_0x38fdb9,_0x49d77c,_0x6f8e4d,_0x386a04){const _0x1aa346=a146_0x4f36;return{'level':_0x1d4774,'path':_0x1038b6,'code':_0x38fdb9,'message':_0x49d77c,'location':getLocationFromPath(_0x6f8e4d['document'],_0x6f8e4d[_0x1aa346(0x17b)],pathToArray(_0x386a04??_0x1038b6))};}function validateVersionStructure(_0x435f0c,_0x5c790a){const _0x39ddaf=a146_0x4f36,_0x23f6e4=[];return _0x435f0c[_0x39ddaf(0x105)]>MAX_STAGES&&_0x23f6e4['push'](createIssue(_0x39ddaf(0x10d),_0x39ddaf(0x1b9),_0x39ddaf(0x134),_0x39ddaf(0x18f)+_0x435f0c['length']+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x5c790a)),_0x23f6e4;}function validateStageStructure(_0x247547,_0x135d8f,_0x48f0c5,_0xaad58e){const _0x22d84c=a146_0x4f36,_0x17c62f=[],_0x3c5f91=_0x22d84c(0x19b)+_0x135d8f+']';_0x135d8f===0x0&&!_0x247547[_0x22d84c(0x1a0)]&&_0x17c62f['push'](createIssue('error',_0x3c5f91+_0x22d84c(0x18c),_0x22d84c(0x14d),_0x22d84c(0x131)+_0x247547[_0x22d84c(0x132)]+_0x22d84c(0x174),_0xaad58e,_0x3c5f91));const _0x1de5f2=_0x135d8f===_0x48f0c5-0x1;!_0x1de5f2&&!_0x247547[_0x22d84c(0x1bd)]&&_0x17c62f[_0x22d84c(0x163)](createIssue('error',_0x3c5f91+_0x22d84c(0x1c0),_0x22d84c(0x117),'Stage\x20\x27'+_0x247547[_0x22d84c(0x132)]+_0x22d84c(0x1ab),_0xaad58e,_0x3c5f91));(!_0x247547[_0x22d84c(0x14c)]||_0x247547[_0x22d84c(0x14c)][_0x22d84c(0x105)]===0x0)&&_0x17c62f[_0x22d84c(0x163)](createIssue('warning',_0x3c5f91+'.exit_criteria',_0x22d84c(0x11e),_0x22d84c(0x131)+_0x247547[_0x22d84c(0x132)]+_0x22d84c(0x12d),_0xaad58e,_0x3c5f91));const _0x1be19b=_0x247547[_0x22d84c(0x156)]?.[_0x22d84c(0x105)]??0x0;if(_0x1be19b===0x0)_0x17c62f[_0x22d84c(0x163)](createIssue(_0x22d84c(0x10d),_0x3c5f91+_0x22d84c(0x197),'INSUFFICIENT_STEPS','Stage\x20\x27'+_0x247547['name']+_0x22d84c(0x152),_0xaad58e,_0x3c5f91+_0x22d84c(0x197)));else{if(_0x1be19b===0x1)_0x17c62f[_0x22d84c(0x163)](createIssue(_0x22d84c(0x199),_0x3c5f91+_0x22d84c(0x197),_0x22d84c(0x124),_0x22d84c(0x131)+_0x247547['name']+_0x22d84c(0x18a),_0xaad58e,_0x3c5f91+_0x22d84c(0x197)));else _0x1be19b<=0x3&&_0x17c62f[_0x22d84c(0x163)](createIssue(_0x22d84c(0x199),_0x3c5f91+_0x22d84c(0x197),'FEW_STEPS',_0x22d84c(0x131)+_0x247547[_0x22d84c(0x132)]+_0x22d84c(0x1a6)+_0x1be19b+_0x22d84c(0x147),_0xaad58e,_0x3c5f91+'.steps'));}return _0x17c62f;}function validateStep(_0x356bb4,_0x49b54d,_0x1e7faa,_0x322226){const _0xb64c3f=a146_0x4f36,_0x5a72b9=[];if(_0x356bb4[_0xb64c3f(0x142)]===_0xb64c3f(0x1b6))return _0x356bb4[_0xb64c3f(0x102)]&&_0x5a72b9['push'](createIssue('error',_0x49b54d+'.next','END_STEP_HAS_NEXT_OR_WITH',_0xb64c3f(0x10f)+_0x356bb4[_0xb64c3f(0x132)]+_0xb64c3f(0x15d),_0x1e7faa)),_0xb64c3f(0x122)in _0x356bb4&&_0x356bb4[_0xb64c3f(0x122)]!==undefined&&_0x5a72b9[_0xb64c3f(0x163)](createIssue(_0xb64c3f(0x10d),_0x49b54d+_0xb64c3f(0x185),_0xb64c3f(0x135),_0xb64c3f(0x10f)+_0x356bb4[_0xb64c3f(0x132)]+_0xb64c3f(0x138),_0x1e7faa)),_0x5a72b9;_0x356bb4[_0xb64c3f(0x102)]&&(_0x1e7faa[_0xb64c3f(0x175)]&&!_0x1e7faa[_0xb64c3f(0x175)][_0xb64c3f(0x16d)](_0x356bb4[_0xb64c3f(0x102)])&&_0x5a72b9[_0xb64c3f(0x163)](createIssue(_0xb64c3f(0x10d),_0x49b54d+_0xb64c3f(0x10e),_0xb64c3f(0x18e),_0xb64c3f(0x108)+_0x356bb4[_0xb64c3f(0x102)]+'\x27',_0x1e7faa)));switch(_0x356bb4[_0xb64c3f(0x142)]){case _0xb64c3f(0x182):_0x5a72b9['push'](...validateWaitStep(_0x356bb4,_0x49b54d,_0x1e7faa,_0x322226));break;case _0xb64c3f(0x137):_0x5a72b9[_0xb64c3f(0x163)](...validateActivationStep(_0x356bb4,_0x49b54d,_0x1e7faa));break;case _0xb64c3f(0x16a):_0x5a72b9['push'](...validateDecisionPointStep(_0x356bb4,_0x49b54d,_0x1e7faa,_0x322226));break;case _0xb64c3f(0x136):_0x5a72b9[_0xb64c3f(0x163)](...validateAbTestStep(_0x356bb4,_0x49b54d,_0x1e7faa,_0x322226));break;case'jump':_0x5a72b9['push'](...validateJumpStep(_0x356bb4,_0x49b54d,_0x1e7faa));break;}return _0x5a72b9;}function validateWaitStep(_0x220f7a,_0x2eb4b1,_0x117c41,_0x1b169f){const _0x555cab=a146_0x4f36,_0x502126=[];if(!_0x220f7a[_0x555cab(0x122)])return _0x502126[_0x555cab(0x163)](createIssue('error',_0x2eb4b1+'.with','MISSING_WAIT_PARAMS',_0x555cab(0x107),_0x117c41,_0x2eb4b1)),_0x502126;if(_0x220f7a[_0x555cab(0x122)][_0x555cab(0x11a)]){const _0x2c9a59=_0x220f7a[_0x555cab(0x122)][_0x555cab(0x11a)];if(_0x2c9a59[_0x555cab(0x166)]){_0x117c41['referencedSegments']?.['add'](_0x2c9a59[_0x555cab(0x166)]);!_0x2c9a59[_0x555cab(0x166)][_0x555cab(0x172)](_0x555cab(0x168))&&(_0x117c41[_0x555cab(0x177)]&&!_0x117c41[_0x555cab(0x177)][_0x555cab(0x16d)](_0x2c9a59['segment'])&&_0x502126[_0x555cab(0x163)](createIssue('error',_0x2eb4b1+_0x555cab(0x145),_0x555cab(0x125),_0x555cab(0x17c)+_0x2c9a59[_0x555cab(0x166)]+_0x555cab(0x1bf),_0x117c41)));_0x2c9a59[_0x555cab(0x102)]&&_0x117c41[_0x555cab(0x175)]&&!_0x117c41['stepNames'][_0x555cab(0x16d)](_0x2c9a59[_0x555cab(0x102)])&&_0x502126[_0x555cab(0x163)](createIssue(_0x555cab(0x10d),_0x2eb4b1+_0x555cab(0x114),_0x555cab(0x18e),_0x555cab(0x116)+_0x2c9a59[_0x555cab(0x102)]+'\x27',_0x117c41));_0x2c9a59['timeout']?.[_0x555cab(0x102)]&&_0x117c41[_0x555cab(0x175)]&&!_0x117c41[_0x555cab(0x175)][_0x555cab(0x16d)](_0x2c9a59[_0x555cab(0x160)][_0x555cab(0x102)])&&_0x502126['push'](createIssue('error',_0x2eb4b1+_0x555cab(0x10b),_0x555cab(0x18e),_0x555cab(0x198)+_0x2c9a59[_0x555cab(0x160)]['next']+'\x27',_0x117c41));const _0x28a901=_0x2c9a59['next']||_0x220f7a[_0x555cab(0x102)],_0x323907=_0x2c9a59[_0x555cab(0x160)]?.[_0x555cab(0x102)]||_0x220f7a[_0x555cab(0x102)];if(_0x28a901){const _0x448801=_0x1b169f[_0x555cab(0x151)](_0x28a901);_0x448801?.['type']===_0x555cab(0x155)&&_0x502126[_0x555cab(0x163)](createIssue(_0x555cab(0x199),_0x2eb4b1+_0x555cab(0x114),_0x555cab(0x1ad),_0x555cab(0x19d)+_0x28a901+_0x555cab(0x17e),_0x117c41,_0x2eb4b1+_0x555cab(0x171)));}if(_0x323907){const _0x146161=_0x1b169f['get'](_0x323907);_0x146161?.[_0x555cab(0x142)]===_0x555cab(0x155)&&_0x502126[_0x555cab(0x163)](createIssue('warning',_0x2eb4b1+'.with.condition.timeout.next','BRANCH_DIRECTLY_TO_MERGE',_0x555cab(0x133)+_0x323907+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x117c41,_0x2eb4b1+_0x555cab(0x164)));}}}return _0x502126;}function validateActivationStep(_0x4cd54d,_0x1a682f,_0x526f71){const _0x49b572=a146_0x4f36,_0x302aa8=[];if(!_0x4cd54d[_0x49b572(0x122)]?.['activation'])return _0x302aa8[_0x49b572(0x163)](createIssue('error',_0x1a682f+_0x49b572(0x15c),'MISSING_ACTIVATION_REF',_0x49b572(0x10c),_0x526f71,_0x1a682f)),_0x302aa8;const _0x46f30=_0x4cd54d[_0x49b572(0x122)][_0x49b572(0x137)];return _0x526f71['activationKeys']&&!_0x46f30[_0x49b572(0x172)]('ref:')&&(!_0x526f71[_0x49b572(0x192)][_0x49b572(0x16d)](_0x46f30)&&_0x302aa8['push'](createIssue(_0x49b572(0x10d),_0x1a682f+_0x49b572(0x15c),_0x49b572(0x191),'Activation\x20step\x20references\x20undefined\x20activation\x20\x27'+_0x46f30+_0x49b572(0x100),_0x526f71))),_0x302aa8;}function validateDecisionPointStep(_0x120462,_0x3e48b2,_0x35481d,_0x480f66){const _0x47e21a=a146_0x4f36,_0x4c39da=[];if(!_0x120462[_0x47e21a(0x122)]?.[_0x47e21a(0x11c)]||_0x120462['with'][_0x47e21a(0x11c)][_0x47e21a(0x105)]===0x0)return _0x4c39da[_0x47e21a(0x163)](createIssue(_0x47e21a(0x10d),_0x3e48b2+_0x47e21a(0x159),_0x47e21a(0x14f),_0x47e21a(0x180),_0x35481d,_0x3e48b2)),_0x4c39da;for(let _0x4aadc7=0x0;_0x4aadc7<_0x120462['with']['branches'][_0x47e21a(0x105)];_0x4aadc7++){const _0x10092a=_0x120462[_0x47e21a(0x122)][_0x47e21a(0x11c)][_0x4aadc7],_0x5a2788=_0x3e48b2+_0x47e21a(0x184)+_0x4aadc7+']';_0x10092a[_0x47e21a(0x166)]&&!_0x10092a[_0x47e21a(0x13a)]&&(_0x35481d[_0x47e21a(0x12e)]?.[_0x47e21a(0x189)](_0x10092a['segment']),!_0x10092a[_0x47e21a(0x166)]['startsWith'](_0x47e21a(0x168))&&(_0x35481d[_0x47e21a(0x177)]&&!_0x35481d[_0x47e21a(0x177)]['has'](_0x10092a[_0x47e21a(0x166)])&&_0x4c39da['push'](createIssue(_0x47e21a(0x10d),_0x5a2788+_0x47e21a(0x1b2),_0x47e21a(0x125),'Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'+_0x10092a[_0x47e21a(0x166)]+'\x27',_0x35481d))));_0x10092a[_0x47e21a(0x102)]&&_0x35481d[_0x47e21a(0x175)]&&!_0x35481d[_0x47e21a(0x175)][_0x47e21a(0x16d)](_0x10092a['next'])&&_0x4c39da['push'](createIssue(_0x47e21a(0x10d),_0x5a2788+'.next','INVALID_NEXT_REFERENCE',_0x47e21a(0x18d)+_0x10092a[_0x47e21a(0x102)]+'\x27',_0x35481d));if(_0x10092a[_0x47e21a(0x102)]){const _0x64b4bd=_0x480f66['get'](_0x10092a[_0x47e21a(0x102)]);_0x64b4bd?.[_0x47e21a(0x142)]===_0x47e21a(0x155)&&_0x4c39da[_0x47e21a(0x163)](createIssue(_0x47e21a(0x199),_0x5a2788+'.next','BRANCH_DIRECTLY_TO_MERGE',_0x47e21a(0x1be)+_0x10092a[_0x47e21a(0x132)]+_0x47e21a(0x19c)+_0x10092a[_0x47e21a(0x102)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x35481d));}}return _0x4c39da;}function validateAbTestStep(_0x3fb938,_0x5c70de,_0x32a844,_0x2372c3){const _0x481c1a=a146_0x4f36,_0xf34ee7=[];if(!_0x3fb938[_0x481c1a(0x122)]?.[_0x481c1a(0x101)]||_0x3fb938['with'][_0x481c1a(0x101)][_0x481c1a(0x105)]===0x0)return _0xf34ee7[_0x481c1a(0x163)](createIssue(_0x481c1a(0x10d),_0x5c70de+_0x481c1a(0x1a7),_0x481c1a(0x14f),_0x481c1a(0x1b0),_0x32a844,_0x5c70de)),_0xf34ee7;const _0x3d8d00=_0x3fb938[_0x481c1a(0x122)]['variants'][_0x481c1a(0x19e)]((_0x2bec56,_0xd3beb0)=>_0x2bec56+(_0xd3beb0[_0x481c1a(0x141)]||0x0),0x0);Math[_0x481c1a(0x1b1)](_0x3d8d00-0x64)>0.01&&_0xf34ee7['push'](createIssue(_0x481c1a(0x10d),_0x5c70de+'.with.variants',_0x481c1a(0x157),_0x481c1a(0x1a9)+_0x3d8d00+'%)',_0x32a844));for(let _0x3d84b9=0x0;_0x3d84b9<_0x3fb938['with'][_0x481c1a(0x101)][_0x481c1a(0x105)];_0x3d84b9++){const _0x2d367f=_0x3fb938[_0x481c1a(0x122)][_0x481c1a(0x101)][_0x3d84b9],_0x46f282=_0x5c70de+_0x481c1a(0x173)+_0x3d84b9+']';_0x2d367f['next']&&_0x32a844['stepNames']&&!_0x32a844[_0x481c1a(0x175)]['has'](_0x2d367f['next'])&&_0xf34ee7[_0x481c1a(0x163)](createIssue(_0x481c1a(0x10d),_0x46f282+_0x481c1a(0x10e),_0x481c1a(0x18e),_0x481c1a(0x126)+_0x2d367f[_0x481c1a(0x102)]+'\x27',_0x32a844));if(_0x2d367f[_0x481c1a(0x102)]){const _0x5cec5c=_0x2372c3[_0x481c1a(0x151)](_0x2d367f['next']);_0x5cec5c?.[_0x481c1a(0x142)]===_0x481c1a(0x155)&&_0xf34ee7['push'](createIssue('warning',_0x46f282+_0x481c1a(0x10e),_0x481c1a(0x1ad),'A/B\x20test\x20variant\x20\x27'+_0x2d367f[_0x481c1a(0x132)]+_0x481c1a(0x19c)+_0x2d367f['next']+_0x481c1a(0x1ae),_0x32a844));}}return _0xf34ee7;}function validateJumpStep(_0xeee6f8,_0x5254bd,_0x9a3d0){const _0x54172d=a146_0x4f36,_0x7f6a13=[];if(!_0xeee6f8[_0x54172d(0x122)]?.['target'])return _0x7f6a13[_0x54172d(0x163)](createIssue(_0x54172d(0x10d),_0x5254bd+'.with.target',_0x54172d(0x158),_0x54172d(0x188),_0x9a3d0,_0x5254bd)),_0x7f6a13;return(!_0xeee6f8['with'][_0x54172d(0x183)][_0x54172d(0x18b)]||!_0xeee6f8[_0x54172d(0x122)][_0x54172d(0x183)][_0x54172d(0x162)])&&_0x7f6a13['push'](createIssue('error',_0x5254bd+_0x54172d(0x11f),_0x54172d(0x158),_0x54172d(0x128),_0x9a3d0)),_0x7f6a13;}function buildConvergenceMap(_0xe72302){const _0x2436f5=a146_0x4f36,_0x475352=new Map();function _0x5f562c(_0x1fcbcd,_0x238f1f){const _0x503ee9=a146_0x4f36,_0x5dd1d0=_0x475352['get'](_0x1fcbcd)||[];_0x5dd1d0[_0x503ee9(0x163)](_0x238f1f),_0x475352[_0x503ee9(0x150)](_0x1fcbcd,_0x5dd1d0);}for(const _0x4248f0 of _0xe72302){_0x4248f0[_0x2436f5(0x102)]&&_0x5f562c(_0x4248f0[_0x2436f5(0x102)],{'stepName':_0x4248f0[_0x2436f5(0x132)],'description':'step\x20\x27'+_0x4248f0['name']+'\x27'});if(_0x4248f0[_0x2436f5(0x142)]===_0x2436f5(0x16a)&&_0x4248f0[_0x2436f5(0x122)]?.[_0x2436f5(0x11c)])for(const _0x3af683 of _0x4248f0[_0x2436f5(0x122)]['branches']){_0x3af683[_0x2436f5(0x102)]&&_0x5f562c(_0x3af683[_0x2436f5(0x102)],{'stepName':_0x4248f0[_0x2436f5(0x132)],'description':_0x2436f5(0x12a)+_0x3af683[_0x2436f5(0x132)]+'\x27\x20of\x20\x27'+_0x4248f0[_0x2436f5(0x132)]+'\x27'});}if(_0x4248f0['type']===_0x2436f5(0x136)&&_0x4248f0[_0x2436f5(0x122)]?.[_0x2436f5(0x101)])for(const _0x5b72dd of _0x4248f0[_0x2436f5(0x122)]['variants']){_0x5b72dd[_0x2436f5(0x102)]&&_0x5f562c(_0x5b72dd[_0x2436f5(0x102)],{'stepName':_0x4248f0[_0x2436f5(0x132)],'description':'variant\x20\x27'+_0x5b72dd[_0x2436f5(0x132)]+_0x2436f5(0x13f)+_0x4248f0[_0x2436f5(0x132)]+'\x27'});}_0x4248f0['type']===_0x2436f5(0x182)&&_0x4248f0['with']?.[_0x2436f5(0x11a)]&&(_0x4248f0['with'][_0x2436f5(0x11a)]['next']&&_0x5f562c(_0x4248f0[_0x2436f5(0x122)][_0x2436f5(0x11a)][_0x2436f5(0x102)],{'stepName':_0x4248f0['name'],'description':_0x2436f5(0x165)+_0x4248f0[_0x2436f5(0x132)]+'\x27'}),_0x4248f0[_0x2436f5(0x122)][_0x2436f5(0x11a)]['timeout']?.[_0x2436f5(0x102)]&&_0x5f562c(_0x4248f0[_0x2436f5(0x122)][_0x2436f5(0x11a)][_0x2436f5(0x160)][_0x2436f5(0x102)],{'stepName':_0x4248f0['name'],'description':_0x2436f5(0x1b4)+_0x4248f0[_0x2436f5(0x132)]+'\x27'}));}return _0x475352;}function a146_0x2362(){const _0x1be466=['Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','Jump\x20step\x20requires\x20a\x20target','add','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','journey','.entry_criteria','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','INVALID_NEXT_REFERENCE','Journey\x20has\x20','.stages','MISSING_ACTIVATION_DEFINITION','activationKeys','1131265XjxfIz','MISSING_GOAL','journey\x20entry','6xsJAtq','.steps','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','warning','\x27\x20has\x20no\x20end\x20step','stages[','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','reduce','indices','entry_criteria','JOURNEY_SCHEMA_ERROR','journeys,\x20stages,\x20or\x20versions','rule','some','latest','\x27\x20has\x20only\x20','.with.variants','MERGE_TO_MERGE_CHAIN','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','versions','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','Journey\x20can\x20have\x20at\x20most\x20one\x20','BRANCH_DIRECTLY_TO_MERGE','\x27\x20with\x20no\x20action\x20in\x20between','filter','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','abs','.segment','level','timeout\x20of\x20\x27','map','end','every','ACTIVATION_SCHEMA_ERROR','stages','version','endsWith','replace','milestone','Decision\x20branch\x20\x27','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','.milestone','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','variants','next',').\x20Merge\x20is\x20unnecessary.','document','length','journeys[','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','Step\x20references\x20non-existent\x20step\x20\x27','segments','match','.with.condition.timeout.next','Activation\x20step\x20requires\x20an\x20activation\x20reference','error','.next','End\x20step\x20\x27','includes','DUPLICATE_LATEST','.steps[','journeys','.with.condition.next','40680618HjwxIp','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','MISSING_MILESTONE','10888040JmWITU','excluded_','condition','\x27\x20(from:\x20','branches','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','MISSING_EXIT_CRITERIA','.with.target',').\x20Use\x20a\x20merge\x20step.','issues','with','goal','INSUFFICIENT_STEPS','MISSING_SEGMENT_REFERENCE','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','12FUaSBm','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','branch\x20\x27','success','SINGLE_INPUT_MERGE','\x27\x20has\x20no\x20exit_criteria\x20defined','referencedSegments','safeParse','goalIsInherited','Stage\x20\x27','name','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','TOO_MANY_STAGES','END_STEP_HAS_NEXT_OR_WITH','ab_test','activation','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','.rule','excluded','path','splice','12ucbXRl','activations','\x27\x20of\x20\x27','2pETLlf','percentage','type','message','join','.with.condition.segment','.name','\x20steps\x20(may\x20be\x20too\x20simple)','skipSchema','keys','UNUSED_EMBEDDED_SEGMENT','Merge\x20step\x20\x27','exit_criteria','MISSING_ENTRY_CRITERIA','Criteria\x20references\x20undefined\x20segment\x20\x27','MISSING_CONDITIONS','set','get','\x27\x20has\x20no\x20steps','versions[','entries','merge','steps','INVALID_AB_TEST_PERCENTAGES','INVALID_JUMP_TARGET','.with.branches','sort','Journey\x20has\x20no\x20goal\x20defined','.with.activation','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','.exit_criteria[','12959wHTiGg','timeout','size','stage','push','.with.condition.timeout','condition\x20of\x20\x27','segment','MISSING_END_STEP','ref:','MISSING_STAGES','decision_point','\x20with\x20latest:\x20true','4093308UzFSRO','has','data','MISSING_NAME','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','.with.condition','startsWith','.with.variants[','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','stepNames','\x20(across\x20','embeddedSegments','7521969hcDeBd','state','16FsuPqZ','source','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','1790556AggNEO','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','\x27\x20(first\x20defined\x20at\x20steps[','wait','target','.with.branches[','.with','DUPLICATE_STEP_NAME'];a146_0x2362=function(){return _0x1be466;};return a146_0x2362();}function validateFlowControl(_0x236f3e,_0x52e0ab,_0xec7d3c){const _0x55eb99=a146_0x4f36,_0x1d2550=[],_0x5358ce=_0x55eb99(0x19b)+_0x52e0ab+']',_0x30a7c2=_0x236f3e['steps']||[];if(_0x30a7c2[_0x55eb99(0x105)]===0x0)return _0x1d2550;const _0x204987=new Map();for(const _0x34c2d0 of _0x30a7c2){_0x34c2d0[_0x55eb99(0x132)]&&_0x204987[_0x55eb99(0x150)](_0x34c2d0[_0x55eb99(0x132)],_0x34c2d0);}const _0x526a8c=buildConvergenceMap(_0x30a7c2),_0x3efc58=_0x30a7c2[_0x55eb99(0x1a4)](_0x4c7617=>_0x4c7617[_0x55eb99(0x142)]==='end');!_0x3efc58&&_0x1d2550[_0x55eb99(0x163)](createIssue('error',_0x5358ce+_0x55eb99(0x197),_0x55eb99(0x167),_0x55eb99(0x131)+_0x236f3e[_0x55eb99(0x132)]+_0x55eb99(0x19a),_0xec7d3c));for(const [_0x4bf2f5,_0x3ecfd4]of _0x526a8c){const _0x5bf947=_0x204987[_0x55eb99(0x151)](_0x4bf2f5);if(!_0x5bf947)continue;if(_0x3ecfd4[_0x55eb99(0x105)]>0x1&&_0x5bf947[_0x55eb99(0x142)]!==_0x55eb99(0x155)){const _0x17afd0=_0x3ecfd4['map'](_0x5bff0c=>_0x5bff0c['description'])[_0x55eb99(0x144)](',\x20');_0x1d2550[_0x55eb99(0x163)](createIssue(_0x55eb99(0x10d),_0x5358ce+_0x55eb99(0x197),'CONVERGENCE_WITHOUT_MERGE',_0x55eb99(0x187)+_0x4bf2f5+_0x55eb99(0x11b)+_0x17afd0+_0x55eb99(0x120),_0xec7d3c));}_0x3ecfd4['length']===0x1&&_0x5bf947[_0x55eb99(0x142)]===_0x55eb99(0x155)&&_0x1d2550[_0x55eb99(0x163)](createIssue(_0x55eb99(0x199),_0x5358ce+_0x55eb99(0x197),_0x55eb99(0x12c),_0x55eb99(0x14b)+_0x4bf2f5+_0x55eb99(0x170)+_0x3ecfd4[0x0]['description']+_0x55eb99(0x103),_0xec7d3c));}for(const _0x3fff8c of _0x30a7c2){if(_0x3fff8c[_0x55eb99(0x142)]===_0x55eb99(0x155)&&_0x3fff8c[_0x55eb99(0x102)]){const _0x51327e=_0x204987['get'](_0x3fff8c[_0x55eb99(0x102)]);_0x51327e?.[_0x55eb99(0x142)]===_0x55eb99(0x155)&&_0x1d2550[_0x55eb99(0x163)](createIssue(_0x55eb99(0x10d),_0x5358ce+'.steps',_0x55eb99(0x1a8),_0x55eb99(0x14b)+_0x3fff8c[_0x55eb99(0x132)]+_0x55eb99(0x17f)+_0x3fff8c[_0x55eb99(0x102)]+_0x55eb99(0x11d),_0xec7d3c));}}return _0x1d2550;}function validateCriteria(_0x1960f7,_0x5a8334,_0x115d1a){const _0x1aaf1e=a146_0x4f36,_0x4ae3fd=[];return _0x1960f7[_0x1aaf1e(0x166)]&&(_0x115d1a['referencedSegments']?.[_0x1aaf1e(0x189)](_0x1960f7['segment']),!_0x1960f7[_0x1aaf1e(0x166)][_0x1aaf1e(0x172)]('ref:')&&(_0x115d1a['embeddedSegments']&&!_0x115d1a['embeddedSegments'][_0x1aaf1e(0x16d)](_0x1960f7['segment'])&&_0x4ae3fd[_0x1aaf1e(0x163)](createIssue(_0x1aaf1e(0x10d),_0x5a8334+_0x1aaf1e(0x1b2),_0x1aaf1e(0x125),_0x1aaf1e(0x14e)+_0x1960f7[_0x1aaf1e(0x166)]+'\x27',_0x115d1a)))),_0x4ae3fd;}function validateEmbeddedSegment(_0x591045,_0x263014,_0x4199c0){const _0x4424ea=a146_0x4f36,_0x35c212=[];return _0x591045['rule']&&_0x35c212['push'](...validateRuleDef(_0x591045[_0x4424ea(0x1a3)],_0x263014+_0x4424ea(0x139),_0x4199c0)),_0x35c212;}function validateStage(_0x52d2c6,_0x200851,_0x5b4f8f,_0x50be2a){const _0x4f1829=a146_0x4f36,_0xb80d34=[],_0x284bc9=_0x4f1829(0x19b)+_0x200851+']',_0x4688e7=new Map(),_0x1e7f9d=new Map();if(_0x52d2c6[_0x4f1829(0x156)]){for(let _0x5636b0=0x0;_0x5636b0<_0x52d2c6[_0x4f1829(0x156)][_0x4f1829(0x105)];_0x5636b0++){const _0x3d57f3=_0x52d2c6['steps'][_0x5636b0];_0x3d57f3['name']&&_0x4688e7[_0x4f1829(0x150)](_0x3d57f3['name'],_0x3d57f3);}for(let _0x52e20d=0x0;_0x52e20d<_0x52d2c6[_0x4f1829(0x156)][_0x4f1829(0x105)];_0x52e20d++){const _0x16e694=_0x52d2c6['steps'][_0x52e20d],_0x18be3c=_0x284bc9+_0x4f1829(0x112)+_0x52e20d+']';if(_0x16e694[_0x4f1829(0x132)]){if(_0x1e7f9d['has'](_0x16e694['name'])){const _0x133586=_0x1e7f9d['get'](_0x16e694[_0x4f1829(0x132)]);_0xb80d34[_0x4f1829(0x163)](createIssue('error',_0x18be3c+_0x4f1829(0x146),_0x4f1829(0x186),'Duplicate\x20step\x20name\x20\x27'+_0x16e694['name']+_0x4f1829(0x181)+_0x133586+'])',_0x50be2a));}else _0x1e7f9d[_0x4f1829(0x150)](_0x16e694['name'],_0x52e20d);}_0xb80d34['push'](...validateStep(_0x16e694,_0x18be3c,_0x50be2a,_0x4688e7));}}_0x52d2c6['entry_criteria']&&_0xb80d34['push'](...validateCriteria(_0x52d2c6[_0x4f1829(0x1a0)],_0x284bc9+_0x4f1829(0x18c),_0x50be2a));if(_0x52d2c6['exit_criteria'])for(let _0x14cbf8=0x0;_0x14cbf8<_0x52d2c6['exit_criteria'][_0x4f1829(0x105)];_0x14cbf8++){_0xb80d34['push'](...validateCriteria(_0x52d2c6[_0x4f1829(0x14c)][_0x14cbf8],_0x284bc9+_0x4f1829(0x15e)+_0x14cbf8+']',_0x50be2a));}return _0x52d2c6[_0x4f1829(0x1bd)]&&_0xb80d34['push'](...validateCriteria(_0x52d2c6['milestone'],_0x284bc9+_0x4f1829(0x1c0),_0x50be2a)),_0xb80d34['push'](...validateStageStructure(_0x52d2c6,_0x200851,_0x5b4f8f,_0x50be2a)),_0xb80d34[_0x4f1829(0x163)](...validateFlowControl(_0x52d2c6,_0x200851,_0x50be2a)),_0xb80d34;}function validateStagesForVersion(_0x13eedb,_0x4488c0,_0x54b4fe,_0x582df3,_0x85349e,_0x25dda9,_0x4c9759){const _0x319cf9=a146_0x4f36;if(_0x13eedb[_0x319cf9(0x105)]===0x0){_0x85349e[_0x319cf9(0x163)]({'level':_0x319cf9(0x10d),'path':_0x582df3+_0x319cf9(0x1b9),'code':_0x319cf9(0x169),'message':_0x319cf9(0x129),'location':getLocationFromPath(_0x54b4fe[_0x319cf9(0x104)],_0x54b4fe[_0x319cf9(0x17b)],[_0x319cf9(0x1b9)])});return;}const _0x2e0708=new Set();for(const _0x3f293f of _0x13eedb){if(_0x3f293f['steps'])for(const _0x186271 of _0x3f293f[_0x319cf9(0x156)]){_0x186271[_0x319cf9(0x132)]&&_0x2e0708[_0x319cf9(0x189)](_0x186271['name']);}}const _0x45c2c2={..._0x54b4fe,'stepNames':_0x2e0708},_0x184a7a=validateVersionStructure(_0x13eedb,_0x45c2c2);for(const _0x15be7b of _0x184a7a){const _0x2cce47=_0x582df3?{..._0x15be7b,'path':''+_0x582df3+_0x15be7b[_0x319cf9(0x13b)]}:_0x15be7b;if(_0x2cce47['level']===_0x319cf9(0x10d))_0x85349e[_0x319cf9(0x163)](_0x2cce47);else _0x25dda9['push'](_0x2cce47);}for(let _0x28c31a=0x0;_0x28c31a<_0x13eedb[_0x319cf9(0x105)];_0x28c31a++){const _0x351329=validateStage(_0x13eedb[_0x28c31a],_0x28c31a,_0x13eedb[_0x319cf9(0x105)],_0x45c2c2);for(const _0x525bd2 of _0x351329){const _0x1e867c=_0x582df3?{..._0x525bd2,'path':''+_0x582df3+_0x525bd2[_0x319cf9(0x13b)]}:_0x525bd2;if(_0x1e867c[_0x319cf9(0x1b3)]===_0x319cf9(0x10d))_0x85349e['push'](_0x1e867c);else _0x25dda9['push'](_0x1e867c);}}if(_0x4488c0['goal']){const _0x4cb534=_0x4c9759?.[_0x319cf9(0x130)]?'goal':_0x582df3+'goal',_0x1fa99b=validateCriteria(_0x4488c0[_0x319cf9(0x123)],_0x4cb534,_0x45c2c2);for(const _0x2f3ffa of _0x1fa99b){if(_0x2f3ffa[_0x319cf9(0x1b3)]===_0x319cf9(0x10d))_0x85349e['push'](_0x2f3ffa);else _0x25dda9[_0x319cf9(0x163)](_0x2f3ffa);}}}function extractVersionIndex(_0x41fbad){const _0x4d45e3=a146_0x4f36,_0x1e6cd3=_0x41fbad[_0x4d45e3(0x10a)](/^journeys\[(\d+)\]\./);return _0x1e6cd3?_0x1e6cd3[0x1]:undefined;}function deduplicateAcrossVersions(_0xc6fc67){const _0x5186b4=a146_0x4f36,_0x2ac1a7=new Map();for(let _0x27abfb=0x0;_0x27abfb<_0xc6fc67[_0x5186b4(0x105)];_0x27abfb++){const _0x2fa2cb=_0xc6fc67[_0x27abfb]['code']+':'+_0xc6fc67[_0x27abfb][_0x5186b4(0x143)],_0x8dd928=extractVersionIndex(_0xc6fc67[_0x27abfb][_0x5186b4(0x13b)]),_0x1faaa1=_0x2ac1a7[_0x5186b4(0x151)](_0x2fa2cb);if(_0x1faaa1){_0x1faaa1[_0x5186b4(0x19f)]['push'](_0x27abfb);if(_0x8dd928)_0x1faaa1[_0x5186b4(0x1aa)][_0x5186b4(0x189)](_0x8dd928);}else _0x2ac1a7[_0x5186b4(0x150)](_0x2fa2cb,{'indices':[_0x27abfb],'versions':new Set(_0x8dd928?[_0x8dd928]:[])});}const _0x645df5=new Set();for(const {indices:_0x455eb4,versions:_0x2b101e}of _0x2ac1a7['values']()){if(_0x2b101e[_0x5186b4(0x161)]<=0x1)continue;const _0x3102de=_0xc6fc67[_0x455eb4[0x0]];_0x3102de[_0x5186b4(0x13b)]=_0x3102de[_0x5186b4(0x13b)][_0x5186b4(0x1bc)](/^journeys\[\d+\]\./,''),_0x3102de[_0x5186b4(0x143)]=_0x3102de[_0x5186b4(0x143)]+_0x5186b4(0x176)+_0x2b101e[_0x5186b4(0x161)]+'\x20versions)';for(let _0x4b7329=0x1;_0x4b7329<_0x455eb4[_0x5186b4(0x105)];_0x4b7329++){_0x645df5['add'](_0x455eb4[_0x4b7329]);}}const _0x87e8fc=[..._0x645df5][_0x5186b4(0x15a)]((_0x22ce56,_0x392e59)=>_0x392e59-_0x22ce56);for(const _0x3cb2d5 of _0x87e8fc){_0xc6fc67[_0x5186b4(0x13c)](_0x3cb2d5,0x1);}}export function validateJourneyDef(_0x245ac7,_0xf34bb2={},_0x17e2a0={}){const _0x59e967=a146_0x4f36;if(_0x17e2a0[_0x59e967(0x148)])return runJourneySemanticChecks(_0x245ac7,_0xf34bb2);const _0x3220e8=JourneyDefSchema[_0x59e967(0x12f)](_0x245ac7);if(_0x3220e8[_0x59e967(0x12b)])return runJourneySemanticChecks(_0x3220e8[_0x59e967(0x16e)],_0xf34bb2);return zodErrorsToJourneyValidationResult(_0x3220e8[_0x59e967(0x10d)],_0xf34bb2);}function zodErrorsToJourneyValidationResult(_0x4cfbcd,_0x58981c){const _0x25d55f=a146_0x4f36,_0x3cbc7f=flattenZodIssues(_0x4cfbcd[_0x25d55f(0x121)]),_0x4d723d=_0x3cbc7f[_0x25d55f(0x1b5)](_0xb86f04=>{const _0x37c482=_0x25d55f,_0x106680=formatZodPath(_0xb86f04['path']),_0x4aca91=mapJourneyZodIssueToCode(_0xb86f04,_0x106680),_0x152153=getLocationFromPath(_0x58981c[_0x37c482(0x104)],_0x58981c[_0x37c482(0x17b)],_0xb86f04['path'][_0x37c482(0x1b5)](_0x41d75c=>typeof _0x41d75c==='symbol'?String(_0x41d75c):_0x41d75c));return{'level':_0x37c482(0x10d),'path':_0x106680,'code':_0x4aca91,'message':_0xb86f04[_0x37c482(0x143)],..._0x152153&&{'location':_0x152153}};});return{'valid':![],'errors':_0x4d723d,'warnings':[]};}function a146_0x4f36(_0x16d0a3,_0x4ff2ec){_0x16d0a3=_0x16d0a3-0x100;const _0x2362cd=a146_0x2362();let _0x4f362b=_0x2362cd[_0x16d0a3];return _0x4f362b;}function mapJourneyZodIssueToCode(_0xc53454,_0x20c8da){const _0x38ca20=a146_0x4f36;if(_0x20c8da===_0x38ca20(0x132))return'MISSING_NAME';if(_0x20c8da[_0x38ca20(0x1bb)]('.type')&&_0x20c8da[_0x38ca20(0x110)]('steps'))return _0x38ca20(0x1a1);if(_0x20c8da===_0x38ca20(0x1b9)||_0x20c8da[_0x38ca20(0x1bb)](_0x38ca20(0x190)))return _0x38ca20(0x169);if(_0x20c8da===''&&_0xc53454['message'][_0x38ca20(0x110)](_0x38ca20(0x1a2)))return _0x38ca20(0x169);if(_0x20c8da[_0x38ca20(0x110)](_0x38ca20(0x137)))return _0x38ca20(0x1b8);return _0x38ca20(0x1a1);}function runJourneySemanticChecks(_0x101508,_0x595d94){const _0x4ffd77=a146_0x4f36,_0x1927f1=[],_0x235801=[];(!_0x101508[_0x4ffd77(0x132)]||_0x101508[_0x4ffd77(0x132)]['trim']()==='')&&_0x1927f1[_0x4ffd77(0x163)]({'level':_0x4ffd77(0x10d),'path':_0x4ffd77(0x132),'code':_0x4ffd77(0x16f),'message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x595d94[_0x4ffd77(0x104)],_0x595d94[_0x4ffd77(0x17b)],[_0x4ffd77(0x132)])});const _0x2bf202=new Set();if(_0x101508[_0x4ffd77(0x109)])for(const _0x37fe14 of Object[_0x4ffd77(0x149)](_0x101508[_0x4ffd77(0x109)])){_0x2bf202[_0x4ffd77(0x189)](_0x37fe14);}const _0x43bd5e=new Set();if(_0x101508['activations'])for(const _0x5850ad of Object[_0x4ffd77(0x149)](_0x101508[_0x4ffd77(0x13e)])){_0x43bd5e[_0x4ffd77(0x189)](_0x5850ad);}const _0x32a3aa=new Set(),_0x5a3128={..._0x595d94,'embeddedSegments':_0x2bf202,'referencedSegments':_0x32a3aa,'activationKeys':_0x43bd5e[_0x4ffd77(0x161)]>0x0?_0x43bd5e:undefined};if(_0x101508[_0x4ffd77(0x109)])for(const [_0x268056,_0x5c5646]of Object[_0x4ffd77(0x154)](_0x101508[_0x4ffd77(0x109)])){const _0x3862b4=validateEmbeddedSegment(_0x5c5646,'segments.'+_0x268056,_0x5a3128);for(const _0x35b079 of _0x3862b4){if(_0x35b079[_0x4ffd77(0x1b3)]==='error')_0x1927f1[_0x4ffd77(0x163)](_0x35b079);else _0x235801[_0x4ffd77(0x163)](_0x35b079);}}const _0x51cc75=!!_0x101508['goal'],_0x1d5755=_0x101508['journeys']?.[_0x4ffd77(0x1b7)](_0xe7220e=>!!_0xe7220e['goal'])??![];!_0x51cc75&&!_0x1d5755&&_0x235801[_0x4ffd77(0x163)]({'level':'warning','path':_0x4ffd77(0x123),'code':_0x4ffd77(0x194),'message':_0x4ffd77(0x15b),'location':getLocationFromPath(_0x595d94['document'],_0x595d94[_0x4ffd77(0x17b)],[_0x4ffd77(0x123)])});const _0x5cd111=_0x101508['journeys']??_0x101508[_0x4ffd77(0x1aa)];if(_0x5cd111&&_0x5cd111[_0x4ffd77(0x1af)](_0x38ede6=>_0x38ede6[_0x4ffd77(0x1a5)]===!![])['length']>0x1){const _0x532a44=_0x101508[_0x4ffd77(0x113)]?_0x4ffd77(0x113):_0x4ffd77(0x1aa);_0x1927f1[_0x4ffd77(0x163)]({'level':_0x4ffd77(0x10d),'path':_0x532a44,'code':_0x4ffd77(0x111),'message':_0x4ffd77(0x1ac)+(_0x532a44==='journeys'?_0x4ffd77(0x195):_0x4ffd77(0x1ba))+_0x4ffd77(0x16b),'location':getLocationFromPath(_0x595d94[_0x4ffd77(0x104)],_0x595d94[_0x4ffd77(0x17b)],[_0x532a44])});}if(_0x101508[_0x4ffd77(0x113)]&&_0x101508[_0x4ffd77(0x113)]['length']>0x0)for(let _0x187b96=0x0;_0x187b96<_0x101508[_0x4ffd77(0x113)][_0x4ffd77(0x105)];_0x187b96++){const _0x5c9588=_0x101508[_0x4ffd77(0x113)][_0x187b96];if(_0x101508['journeys'][_0x4ffd77(0x105)]>0x1&&_0x5c9588[_0x4ffd77(0x179)]==='launched')continue;const _0xf19d47=_0x5c9588[_0x4ffd77(0x1b9)]||[],_0x1ecf88=_0x4ffd77(0x106)+_0x187b96+'].',_0x461140=!!_0x5c9588[_0x4ffd77(0x123)],_0x3cd140=_0x461140?{..._0x101508,'goal':_0x5c9588[_0x4ffd77(0x123)]}:_0x101508;validateStagesForVersion(_0xf19d47,_0x3cd140,_0x5a3128,_0x1ecf88,_0x1927f1,_0x235801,{'goalIsInherited':!_0x461140});}else{if(_0x101508[_0x4ffd77(0x1aa)]&&_0x101508['versions'][_0x4ffd77(0x105)]>0x0)for(let _0x58431b=0x0;_0x58431b<_0x101508[_0x4ffd77(0x1aa)]['length'];_0x58431b++){const _0x30764d=_0x101508['versions'][_0x58431b];if(_0x101508[_0x4ffd77(0x1aa)][_0x4ffd77(0x105)]>0x1&&_0x30764d['state']==='launched')continue;const _0x517717=_0x30764d[_0x4ffd77(0x1b9)]||[],_0x286588=_0x4ffd77(0x153)+_0x58431b+'].';validateStagesForVersion(_0x517717,_0x101508,_0x5a3128,_0x286588,_0x1927f1,_0x235801);}else{const _0x564912=_0x101508[_0x4ffd77(0x1b9)]||[];validateStagesForVersion(_0x564912,_0x101508,_0x5a3128,'',_0x1927f1,_0x235801);}}_0x101508[_0x4ffd77(0x113)]&&_0x101508[_0x4ffd77(0x113)][_0x4ffd77(0x105)]>0x1&&(deduplicateAcrossVersions(_0x1927f1),deduplicateAcrossVersions(_0x235801));for(const _0x3c05da of _0x2bf202){!_0x32a3aa[_0x4ffd77(0x16d)](_0x3c05da)&&!_0x3c05da[_0x4ffd77(0x172)](_0x4ffd77(0x119))&&_0x235801[_0x4ffd77(0x163)]({'level':'warning','path':'segments.'+_0x3c05da,'code':_0x4ffd77(0x14a),'message':'Embedded\x20segment\x20\x27'+_0x3c05da+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x595d94[_0x4ffd77(0x104)],_0x595d94['source'],[_0x4ffd77(0x109),_0x3c05da])});}return{'valid':_0x1927f1[_0x4ffd77(0x105)]===0x0,'errors':_0x1927f1,'warnings':_0x235801};}
1
+ (function(_0x590ae7,_0x3b1fa6){const _0x5f21e3=a146_0x1110,_0x304082=_0x590ae7();while(!![]){try{const _0x2529bc=parseInt(_0x5f21e3(0x21e))/0x1+-parseInt(_0x5f21e3(0x275))/0x2+parseInt(_0x5f21e3(0x232))/0x3*(parseInt(_0x5f21e3(0x224))/0x4)+parseInt(_0x5f21e3(0x227))/0x5*(parseInt(_0x5f21e3(0x208))/0x6)+parseInt(_0x5f21e3(0x27d))/0x7*(-parseInt(_0x5f21e3(0x282))/0x8)+parseInt(_0x5f21e3(0x28e))/0x9*(-parseInt(_0x5f21e3(0x220))/0xa)+parseInt(_0x5f21e3(0x26e))/0xb*(-parseInt(_0x5f21e3(0x234))/0xc);if(_0x2529bc===_0x3b1fa6)break;else _0x304082['push'](_0x304082['shift']());}catch(_0x2a02a9){_0x304082['push'](_0x304082['shift']());}}}(a146_0x6b14,0x9f55f));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x1d18bb,_0x500aac,_0x3efbd6,_0x40a0a9,_0x218914,_0x1f6e50){const _0x52d067=a146_0x1110;return{'level':_0x1d18bb,'path':_0x500aac,'code':_0x3efbd6,'message':_0x40a0a9,'location':getLocationFromPath(_0x218914[_0x52d067(0x284)],_0x218914[_0x52d067(0x297)],pathToArray(_0x1f6e50??_0x500aac))};}function validateVersionStructure(_0x45edca,_0x4550c3){const _0x11daf2=a146_0x1110,_0x11cf37=[];return _0x45edca['length']>MAX_STAGES&&_0x11cf37[_0x11daf2(0x1fc)](createIssue(_0x11daf2(0x200),'stages',_0x11daf2(0x1ef),_0x11daf2(0x266)+_0x45edca[_0x11daf2(0x204)]+_0x11daf2(0x272)+MAX_STAGES,_0x4550c3)),_0x11cf37;}function validateStageStructure(_0x53bd88,_0x370e46,_0x1dd1a6,_0x18893f){const _0x198220=a146_0x1110,_0x5c90a6=[],_0x1f9cb5=_0x198220(0x217)+_0x370e46+']';_0x370e46===0x0&&!_0x53bd88['entry_criteria']&&_0x5c90a6[_0x198220(0x1fc)](createIssue('error',_0x1f9cb5+_0x198220(0x27e),_0x198220(0x238),_0x198220(0x1ed)+_0x53bd88[_0x198220(0x20e)]+_0x198220(0x1fe),_0x18893f,_0x1f9cb5));const _0x481cac=_0x370e46===_0x1dd1a6-0x1;!_0x481cac&&!_0x53bd88[_0x198220(0x247)]&&_0x5c90a6['push'](createIssue(_0x198220(0x200),_0x1f9cb5+_0x198220(0x287),_0x198220(0x249),'Stage\x20\x27'+_0x53bd88[_0x198220(0x20e)]+_0x198220(0x294),_0x18893f,_0x1f9cb5));(!_0x53bd88[_0x198220(0x28a)]||_0x53bd88[_0x198220(0x28a)][_0x198220(0x204)]===0x0)&&_0x5c90a6[_0x198220(0x1fc)](createIssue(_0x198220(0x24a),_0x1f9cb5+_0x198220(0x264),_0x198220(0x1ec),_0x198220(0x1ed)+_0x53bd88[_0x198220(0x20e)]+_0x198220(0x1f4),_0x18893f,_0x1f9cb5));const _0x409288=_0x53bd88[_0x198220(0x22d)]?.[_0x198220(0x204)]??0x0;if(_0x409288===0x0)_0x5c90a6[_0x198220(0x1fc)](createIssue(_0x198220(0x200),_0x1f9cb5+_0x198220(0x22f),_0x198220(0x28d),_0x198220(0x1ed)+_0x53bd88[_0x198220(0x20e)]+_0x198220(0x252),_0x18893f,_0x1f9cb5+'.steps'));else{if(_0x409288===0x1)_0x5c90a6['push'](createIssue(_0x198220(0x24a),_0x1f9cb5+_0x198220(0x22f),_0x198220(0x28d),'Stage\x20\x27'+_0x53bd88[_0x198220(0x20e)]+_0x198220(0x283),_0x18893f,_0x1f9cb5+_0x198220(0x22f)));else _0x409288<=0x3&&_0x5c90a6[_0x198220(0x1fc)](createIssue('warning',_0x1f9cb5+_0x198220(0x22f),_0x198220(0x1f6),_0x198220(0x1ed)+_0x53bd88[_0x198220(0x20e)]+_0x198220(0x257)+_0x409288+_0x198220(0x212),_0x18893f,_0x1f9cb5+'.steps'));}return _0x5c90a6;}function validateStep(_0x22cc44,_0x3c0915,_0x1d91c1,_0x4499a8){const _0x552366=a146_0x1110,_0x52eb33=[];if(_0x22cc44[_0x552366(0x241)]===_0x552366(0x1eb))return _0x22cc44[_0x552366(0x253)]&&_0x52eb33[_0x552366(0x1fc)](createIssue('error',_0x3c0915+_0x552366(0x259),_0x552366(0x27a),'End\x20step\x20\x27'+_0x22cc44[_0x552366(0x20e)]+_0x552366(0x290),_0x1d91c1)),'with'in _0x22cc44&&_0x22cc44['with']!==undefined&&_0x52eb33[_0x552366(0x1fc)](createIssue(_0x552366(0x200),_0x3c0915+_0x552366(0x27c),'END_STEP_HAS_NEXT_OR_WITH',_0x552366(0x298)+_0x22cc44['name']+_0x552366(0x25f),_0x1d91c1)),_0x52eb33;_0x22cc44[_0x552366(0x253)]&&(_0x1d91c1[_0x552366(0x26f)]&&!_0x1d91c1[_0x552366(0x26f)][_0x552366(0x1f8)](_0x22cc44[_0x552366(0x253)])&&_0x52eb33[_0x552366(0x1fc)](createIssue(_0x552366(0x200),_0x3c0915+_0x552366(0x259),_0x552366(0x1e9),_0x552366(0x244)+_0x22cc44[_0x552366(0x253)]+'\x27',_0x1d91c1)));switch(_0x22cc44['type']){case _0x552366(0x1f3):_0x52eb33[_0x552366(0x1fc)](...validateWaitStep(_0x22cc44,_0x3c0915,_0x1d91c1,_0x4499a8));break;case _0x552366(0x296):_0x52eb33[_0x552366(0x1fc)](...validateActivationStep(_0x22cc44,_0x3c0915,_0x1d91c1));break;case _0x552366(0x228):_0x52eb33[_0x552366(0x1fc)](...validateDecisionPointStep(_0x22cc44,_0x3c0915,_0x1d91c1,_0x4499a8));break;case _0x552366(0x261):_0x52eb33[_0x552366(0x1fc)](...validateAbTestStep(_0x22cc44,_0x3c0915,_0x1d91c1,_0x4499a8));break;case _0x552366(0x289):_0x52eb33['push'](...validateJumpStep(_0x22cc44,_0x3c0915,_0x1d91c1));break;}return _0x52eb33;}function a146_0x1110(_0x4ff792,_0x1da0d2){_0x4ff792=_0x4ff792-0x1e5;const _0x6b14e2=a146_0x6b14();let _0x111003=_0x6b14e2[_0x4ff792];return _0x111003;}function validateWaitStep(_0x159a03,_0x5c89f7,_0xd4ad08,_0xdd075f){const _0xf592ef=a146_0x1110,_0x9e6eca=[];if(!_0x159a03[_0xf592ef(0x1f1)])return _0x9e6eca['push'](createIssue('error',_0x5c89f7+'.with',_0xf592ef(0x21b),'Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field',_0xd4ad08,_0x5c89f7)),_0x9e6eca;if(_0x159a03[_0xf592ef(0x1f1)][_0xf592ef(0x23b)]){const _0x15f6d2=_0x159a03[_0xf592ef(0x1f1)][_0xf592ef(0x23b)];if(_0x15f6d2['segment']){_0xd4ad08[_0xf592ef(0x26b)]?.[_0xf592ef(0x218)](_0x15f6d2[_0xf592ef(0x21c)]);!_0x15f6d2[_0xf592ef(0x21c)][_0xf592ef(0x223)](_0xf592ef(0x1f7))&&(_0xd4ad08[_0xf592ef(0x280)]&&!_0xd4ad08[_0xf592ef(0x280)][_0xf592ef(0x1f8)](_0x15f6d2[_0xf592ef(0x21c)])&&_0x9e6eca[_0xf592ef(0x1fc)](createIssue(_0xf592ef(0x200),_0x5c89f7+_0xf592ef(0x273),_0xf592ef(0x236),_0xf592ef(0x29c)+_0x15f6d2[_0xf592ef(0x21c)]+_0xf592ef(0x1e8),_0xd4ad08)));_0x15f6d2[_0xf592ef(0x253)]&&_0xd4ad08[_0xf592ef(0x26f)]&&!_0xd4ad08[_0xf592ef(0x26f)][_0xf592ef(0x1f8)](_0x15f6d2[_0xf592ef(0x253)])&&_0x9e6eca[_0xf592ef(0x1fc)](createIssue(_0xf592ef(0x200),_0x5c89f7+'.with.condition.next',_0xf592ef(0x1e9),_0xf592ef(0x269)+_0x15f6d2['next']+'\x27',_0xd4ad08));_0x15f6d2[_0xf592ef(0x221)]?.[_0xf592ef(0x253)]&&_0xd4ad08['stepNames']&&!_0xd4ad08['stepNames'][_0xf592ef(0x1f8)](_0x15f6d2['timeout'][_0xf592ef(0x253)])&&_0x9e6eca[_0xf592ef(0x1fc)](createIssue(_0xf592ef(0x200),_0x5c89f7+'.with.condition.timeout.next',_0xf592ef(0x1e9),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x15f6d2[_0xf592ef(0x221)][_0xf592ef(0x253)]+'\x27',_0xd4ad08));const _0x2e930d=_0x15f6d2[_0xf592ef(0x253)]||_0x159a03[_0xf592ef(0x253)],_0x258478=_0x15f6d2[_0xf592ef(0x221)]?.[_0xf592ef(0x253)]||_0x159a03[_0xf592ef(0x253)];if(_0x2e930d){const _0x203e59=_0xdd075f[_0xf592ef(0x270)](_0x2e930d);_0x203e59?.[_0xf592ef(0x241)]==='merge'&&_0x9e6eca[_0xf592ef(0x1fc)](createIssue(_0xf592ef(0x24a),_0x5c89f7+'.with.condition.next','BRANCH_DIRECTLY_TO_MERGE',_0xf592ef(0x23e)+_0x2e930d+_0xf592ef(0x278),_0xd4ad08,_0x5c89f7+_0xf592ef(0x25d)));}if(_0x258478){const _0x464f84=_0xdd075f[_0xf592ef(0x270)](_0x258478);_0x464f84?.[_0xf592ef(0x241)]===_0xf592ef(0x24f)&&_0x9e6eca[_0xf592ef(0x1fc)](createIssue(_0xf592ef(0x24a),_0x5c89f7+'.with.condition.timeout.next',_0xf592ef(0x263),'Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x258478+_0xf592ef(0x278),_0xd4ad08,_0x5c89f7+_0xf592ef(0x246)));}}}return _0x9e6eca;}function validateActivationStep(_0x3f8c31,_0x20f627,_0x12dcaf){const _0x425c3a=a146_0x1110,_0x621b02=[];if(!_0x3f8c31[_0x425c3a(0x1f1)]?.[_0x425c3a(0x296)])return _0x621b02[_0x425c3a(0x1fc)](createIssue('error',_0x20f627+_0x425c3a(0x240),_0x425c3a(0x229),_0x425c3a(0x288),_0x12dcaf,_0x20f627)),_0x621b02;const _0x3d44c9=_0x3f8c31[_0x425c3a(0x1f1)]['activation'];return _0x12dcaf[_0x425c3a(0x24b)]&&!_0x3d44c9['startsWith']('ref:')&&(!_0x12dcaf[_0x425c3a(0x24b)][_0x425c3a(0x1f8)](_0x3d44c9)&&_0x621b02[_0x425c3a(0x1fc)](createIssue(_0x425c3a(0x200),_0x20f627+'.with.activation',_0x425c3a(0x299),_0x425c3a(0x242)+_0x3d44c9+_0x425c3a(0x268),_0x12dcaf))),_0x621b02;}function validateDecisionPointStep(_0x586e0f,_0x4762a6,_0x1b98dd,_0x246582){const _0x299b2c=a146_0x1110,_0x83e456=[];if(!_0x586e0f[_0x299b2c(0x1f1)]?.[_0x299b2c(0x25c)]||_0x586e0f[_0x299b2c(0x1f1)][_0x299b2c(0x25c)][_0x299b2c(0x204)]===0x0)return _0x83e456['push'](createIssue(_0x299b2c(0x200),_0x4762a6+_0x299b2c(0x291),_0x299b2c(0x23d),_0x299b2c(0x21d),_0x1b98dd,_0x4762a6)),_0x83e456;for(let _0x56dcb7=0x0;_0x56dcb7<_0x586e0f[_0x299b2c(0x1f1)][_0x299b2c(0x25c)][_0x299b2c(0x204)];_0x56dcb7++){const _0x1ddee9=_0x586e0f[_0x299b2c(0x1f1)][_0x299b2c(0x25c)][_0x56dcb7],_0x95a064=_0x4762a6+_0x299b2c(0x21f)+_0x56dcb7+']';_0x1ddee9['segment']&&!_0x1ddee9[_0x299b2c(0x1fb)]&&(_0x1b98dd[_0x299b2c(0x26b)]?.['add'](_0x1ddee9[_0x299b2c(0x21c)]),!_0x1ddee9[_0x299b2c(0x21c)][_0x299b2c(0x223)]('ref:')&&(_0x1b98dd[_0x299b2c(0x280)]&&!_0x1b98dd[_0x299b2c(0x280)][_0x299b2c(0x1f8)](_0x1ddee9['segment'])&&_0x83e456[_0x299b2c(0x1fc)](createIssue(_0x299b2c(0x200),_0x95a064+_0x299b2c(0x1fd),_0x299b2c(0x236),_0x299b2c(0x245)+_0x1ddee9[_0x299b2c(0x21c)]+'\x27',_0x1b98dd))));_0x1ddee9['next']&&_0x1b98dd['stepNames']&&!_0x1b98dd[_0x299b2c(0x26f)][_0x299b2c(0x1f8)](_0x1ddee9['next'])&&_0x83e456[_0x299b2c(0x1fc)](createIssue(_0x299b2c(0x200),_0x95a064+'.next',_0x299b2c(0x1e9),'Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0x1ddee9[_0x299b2c(0x253)]+'\x27',_0x1b98dd));if(_0x1ddee9['next']){const _0x31f2ec=_0x246582[_0x299b2c(0x270)](_0x1ddee9['next']);_0x31f2ec?.[_0x299b2c(0x241)]===_0x299b2c(0x24f)&&_0x83e456[_0x299b2c(0x1fc)](createIssue(_0x299b2c(0x24a),_0x95a064+_0x299b2c(0x259),_0x299b2c(0x263),'Decision\x20branch\x20\x27'+_0x1ddee9[_0x299b2c(0x20e)]+_0x299b2c(0x271)+_0x1ddee9[_0x299b2c(0x253)]+_0x299b2c(0x1e5),_0x1b98dd));}}return _0x83e456;}function validateAbTestStep(_0x1dc25b,_0x3d4cac,_0x36786f,_0x3d903a){const _0x43e2b6=a146_0x1110,_0x5a7677=[];if(!_0x1dc25b[_0x43e2b6(0x1f1)]?.['variants']||_0x1dc25b[_0x43e2b6(0x1f1)]['variants'][_0x43e2b6(0x204)]===0x0)return _0x5a7677[_0x43e2b6(0x1fc)](createIssue(_0x43e2b6(0x200),_0x3d4cac+_0x43e2b6(0x1e6),_0x43e2b6(0x23d),_0x43e2b6(0x23a),_0x36786f,_0x3d4cac)),_0x5a7677;const _0x3ac7d3=_0x1dc25b[_0x43e2b6(0x1f1)][_0x43e2b6(0x215)][_0x43e2b6(0x213)]((_0x29dfd5,_0x329e66)=>_0x29dfd5+(_0x329e66[_0x43e2b6(0x25e)]||0x0),0x0);Math[_0x43e2b6(0x24d)](_0x3ac7d3-0x64)>0.01&&_0x5a7677[_0x43e2b6(0x1fc)](createIssue(_0x43e2b6(0x200),_0x3d4cac+_0x43e2b6(0x1e6),_0x43e2b6(0x28f),_0x43e2b6(0x22b)+_0x3ac7d3+'%)',_0x36786f));for(let _0x149c47=0x0;_0x149c47<_0x1dc25b[_0x43e2b6(0x1f1)]['variants'][_0x43e2b6(0x204)];_0x149c47++){const _0x119e4b=_0x1dc25b[_0x43e2b6(0x1f1)][_0x43e2b6(0x215)][_0x149c47],_0x28522f=_0x3d4cac+'.with.variants['+_0x149c47+']';_0x119e4b['next']&&_0x36786f[_0x43e2b6(0x26f)]&&!_0x36786f['stepNames'][_0x43e2b6(0x1f8)](_0x119e4b['next'])&&_0x5a7677[_0x43e2b6(0x1fc)](createIssue(_0x43e2b6(0x200),_0x28522f+_0x43e2b6(0x259),'INVALID_NEXT_REFERENCE','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27'+_0x119e4b[_0x43e2b6(0x253)]+'\x27',_0x36786f));if(_0x119e4b[_0x43e2b6(0x253)]){const _0x277516=_0x3d903a[_0x43e2b6(0x270)](_0x119e4b[_0x43e2b6(0x253)]);_0x277516?.[_0x43e2b6(0x241)]===_0x43e2b6(0x24f)&&_0x5a7677[_0x43e2b6(0x1fc)](createIssue(_0x43e2b6(0x24a),_0x28522f+_0x43e2b6(0x259),_0x43e2b6(0x263),'A/B\x20test\x20variant\x20\x27'+_0x119e4b[_0x43e2b6(0x20e)]+_0x43e2b6(0x271)+_0x119e4b['next']+_0x43e2b6(0x1e5),_0x36786f));}}return _0x5a7677;}function validateJumpStep(_0xa6ef29,_0x1baf9d,_0x1e18ac){const _0x4b8494=a146_0x1110,_0x4ce462=[];if(!_0xa6ef29['with']?.[_0x4b8494(0x1f2)])return _0x4ce462['push'](createIssue(_0x4b8494(0x200),_0x1baf9d+'.with.target',_0x4b8494(0x25b),_0x4b8494(0x1f9),_0x1e18ac,_0x1baf9d)),_0x4ce462;return(!_0xa6ef29['with'][_0x4b8494(0x1f2)]['journey']||!_0xa6ef29[_0x4b8494(0x1f1)][_0x4b8494(0x1f2)][_0x4b8494(0x1ee)])&&_0x4ce462[_0x4b8494(0x1fc)](createIssue(_0x4b8494(0x200),_0x1baf9d+_0x4b8494(0x29a),_0x4b8494(0x25b),_0x4b8494(0x258),_0x1e18ac)),_0x4ce462;}function buildConvergenceMap(_0x14d30d){const _0x220201=a146_0x1110,_0xd4339d=new Map();function _0x37715b(_0x4e1464,_0x41a2ea){const _0x54b3f6=a146_0x1110,_0x1add42=_0xd4339d[_0x54b3f6(0x270)](_0x4e1464)||[];_0x1add42[_0x54b3f6(0x1fc)](_0x41a2ea),_0xd4339d[_0x54b3f6(0x21a)](_0x4e1464,_0x1add42);}for(const _0x31bd2b of _0x14d30d){_0x31bd2b['next']&&_0x37715b(_0x31bd2b[_0x220201(0x253)],{'stepName':_0x31bd2b[_0x220201(0x20e)],'description':_0x220201(0x286)+_0x31bd2b[_0x220201(0x20e)]+'\x27'});if(_0x31bd2b[_0x220201(0x241)]===_0x220201(0x228)&&_0x31bd2b[_0x220201(0x1f1)]?.[_0x220201(0x25c)])for(const _0x3d9f3a of _0x31bd2b[_0x220201(0x1f1)]['branches']){_0x3d9f3a[_0x220201(0x253)]&&_0x37715b(_0x3d9f3a[_0x220201(0x253)],{'stepName':_0x31bd2b[_0x220201(0x20e)],'description':'branch\x20\x27'+_0x3d9f3a['name']+_0x220201(0x20c)+_0x31bd2b['name']+'\x27'});}if(_0x31bd2b[_0x220201(0x241)]===_0x220201(0x261)&&_0x31bd2b['with']?.[_0x220201(0x215)])for(const _0x296571 of _0x31bd2b[_0x220201(0x1f1)][_0x220201(0x215)]){_0x296571['next']&&_0x37715b(_0x296571[_0x220201(0x253)],{'stepName':_0x31bd2b[_0x220201(0x20e)],'description':'variant\x20\x27'+_0x296571[_0x220201(0x20e)]+_0x220201(0x20c)+_0x31bd2b[_0x220201(0x20e)]+'\x27'});}_0x31bd2b[_0x220201(0x241)]===_0x220201(0x1f3)&&_0x31bd2b[_0x220201(0x1f1)]?.[_0x220201(0x23b)]&&(_0x31bd2b['with']['condition'][_0x220201(0x253)]&&_0x37715b(_0x31bd2b['with'][_0x220201(0x23b)][_0x220201(0x253)],{'stepName':_0x31bd2b[_0x220201(0x20e)],'description':_0x220201(0x1ea)+_0x31bd2b[_0x220201(0x20e)]+'\x27'}),_0x31bd2b[_0x220201(0x1f1)][_0x220201(0x23b)][_0x220201(0x221)]?.[_0x220201(0x253)]&&_0x37715b(_0x31bd2b[_0x220201(0x1f1)]['condition']['timeout']['next'],{'stepName':_0x31bd2b[_0x220201(0x20e)],'description':_0x220201(0x243)+_0x31bd2b[_0x220201(0x20e)]+'\x27'}));}return _0xd4339d;}function validateFlowControl(_0xe6b0b8,_0x46c220,_0x3af881){const _0x4b96f9=a146_0x1110,_0x3c65ad=[],_0x4e5536=_0x4b96f9(0x217)+_0x46c220+']',_0x3dcc7d=_0xe6b0b8[_0x4b96f9(0x22d)]||[];if(_0x3dcc7d[_0x4b96f9(0x204)]===0x0)return _0x3c65ad;const _0x5aa294=new Map();for(const _0x28186e of _0x3dcc7d){_0x28186e[_0x4b96f9(0x20e)]&&_0x5aa294[_0x4b96f9(0x21a)](_0x28186e[_0x4b96f9(0x20e)],_0x28186e);}const _0x25cdca=buildConvergenceMap(_0x3dcc7d),_0x3d5259=_0x3dcc7d[_0x4b96f9(0x26d)](_0x58d866=>_0x58d866['type']===_0x4b96f9(0x1eb));!_0x3d5259&&_0x3c65ad[_0x4b96f9(0x1fc)](createIssue(_0x4b96f9(0x200),_0x4e5536+_0x4b96f9(0x22f),_0x4b96f9(0x260),_0x4b96f9(0x1ed)+_0xe6b0b8[_0x4b96f9(0x20e)]+_0x4b96f9(0x279),_0x3af881));for(const [_0x2aeeeb,_0x3d4e6b]of _0x25cdca){const _0x4022b3=_0x5aa294[_0x4b96f9(0x270)](_0x2aeeeb);if(!_0x4022b3)continue;if(_0x3d4e6b['length']>0x1&&_0x4022b3[_0x4b96f9(0x241)]!=='merge'){const _0x5a5f44=_0x3d4e6b[_0x4b96f9(0x267)](_0x57c9c0=>_0x57c9c0[_0x4b96f9(0x28b)])[_0x4b96f9(0x216)](',\x20');_0x3c65ad[_0x4b96f9(0x1fc)](createIssue('error',_0x4e5536+_0x4b96f9(0x22f),_0x4b96f9(0x29b),_0x4b96f9(0x28c)+_0x2aeeeb+'\x27\x20(from:\x20'+_0x5a5f44+_0x4b96f9(0x293),_0x3af881));}_0x3d4e6b[_0x4b96f9(0x204)]===0x1&&_0x4022b3[_0x4b96f9(0x241)]===_0x4b96f9(0x24f)&&_0x3c65ad['push'](createIssue('warning',_0x4e5536+'.steps',_0x4b96f9(0x24e),'Merge\x20step\x20\x27'+_0x2aeeeb+_0x4b96f9(0x262)+_0x3d4e6b[0x0][_0x4b96f9(0x28b)]+').\x20Merge\x20is\x20unnecessary.',_0x3af881));}for(const _0x471ffa of _0x3dcc7d){if(_0x471ffa['type']===_0x4b96f9(0x24f)&&_0x471ffa[_0x4b96f9(0x253)]){const _0x2e15db=_0x5aa294[_0x4b96f9(0x270)](_0x471ffa[_0x4b96f9(0x253)]);_0x2e15db?.[_0x4b96f9(0x241)]===_0x4b96f9(0x24f)&&_0x3c65ad['push'](createIssue(_0x4b96f9(0x200),_0x4e5536+'.steps',_0x4b96f9(0x1e7),_0x4b96f9(0x20f)+_0x471ffa[_0x4b96f9(0x20e)]+'\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27'+_0x471ffa[_0x4b96f9(0x253)]+'\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.',_0x3af881));}}return _0x3c65ad;}function validateCriteria(_0x24ae6d,_0x22b64d,_0x1c80cc){const _0x210bb4=a146_0x1110,_0x407cd9=[];return _0x24ae6d[_0x210bb4(0x21c)]&&(_0x1c80cc[_0x210bb4(0x26b)]?.[_0x210bb4(0x218)](_0x24ae6d[_0x210bb4(0x21c)]),!_0x24ae6d['segment'][_0x210bb4(0x223)](_0x210bb4(0x1f7))&&(_0x1c80cc['embeddedSegments']&&!_0x1c80cc[_0x210bb4(0x280)]['has'](_0x24ae6d['segment'])&&_0x407cd9[_0x210bb4(0x1fc)](createIssue(_0x210bb4(0x200),_0x22b64d+'.segment',_0x210bb4(0x236),_0x210bb4(0x26c)+_0x24ae6d[_0x210bb4(0x21c)]+'\x27',_0x1c80cc)))),_0x407cd9;}function validateEmbeddedSegment(_0x2b5336,_0x528e6b,_0x3628e4){const _0x5175ac=a146_0x1110,_0x318750=[];return _0x2b5336[_0x5175ac(0x233)]&&_0x318750['push'](...validateRuleDef(_0x2b5336[_0x5175ac(0x233)],_0x528e6b+_0x5175ac(0x274),_0x3628e4)),_0x318750;}function validateStage(_0x47baf6,_0x2b7f8a,_0x53aa1c,_0x588066){const _0x463751=a146_0x1110,_0x180d07=[],_0x23b73e=_0x463751(0x217)+_0x2b7f8a+']',_0xec98ab=new Map(),_0x2b415e=new Map();if(_0x47baf6['steps']){for(let _0x3ce341=0x0;_0x3ce341<_0x47baf6[_0x463751(0x22d)][_0x463751(0x204)];_0x3ce341++){const _0x5a573f=_0x47baf6['steps'][_0x3ce341];_0x5a573f[_0x463751(0x20e)]&&_0xec98ab[_0x463751(0x21a)](_0x5a573f[_0x463751(0x20e)],_0x5a573f);}for(let _0x10e773=0x0;_0x10e773<_0x47baf6['steps'][_0x463751(0x204)];_0x10e773++){const _0x5df1a3=_0x47baf6[_0x463751(0x22d)][_0x10e773],_0x3f7986=_0x23b73e+_0x463751(0x211)+_0x10e773+']';if(_0x5df1a3['name']){if(_0x2b415e['has'](_0x5df1a3[_0x463751(0x20e)])){const _0x29d42c=_0x2b415e[_0x463751(0x270)](_0x5df1a3['name']);_0x180d07[_0x463751(0x1fc)](createIssue(_0x463751(0x200),_0x3f7986+_0x463751(0x254),_0x463751(0x22e),_0x463751(0x226)+_0x5df1a3[_0x463751(0x20e)]+_0x463751(0x1f5)+_0x29d42c+'])',_0x588066));}else _0x2b415e[_0x463751(0x21a)](_0x5df1a3[_0x463751(0x20e)],_0x10e773);}_0x180d07[_0x463751(0x1fc)](...validateStep(_0x5df1a3,_0x3f7986,_0x588066,_0xec98ab));}}_0x47baf6[_0x463751(0x292)]&&_0x180d07[_0x463751(0x1fc)](...validateCriteria(_0x47baf6['entry_criteria'],_0x23b73e+'.entry_criteria',_0x588066));if(_0x47baf6[_0x463751(0x28a)])for(let _0x32d8b2=0x0;_0x32d8b2<_0x47baf6[_0x463751(0x28a)][_0x463751(0x204)];_0x32d8b2++){_0x180d07[_0x463751(0x1fc)](...validateCriteria(_0x47baf6[_0x463751(0x28a)][_0x32d8b2],_0x23b73e+_0x463751(0x23c)+_0x32d8b2+']',_0x588066));}return _0x47baf6['milestone']&&_0x180d07[_0x463751(0x1fc)](...validateCriteria(_0x47baf6[_0x463751(0x247)],_0x23b73e+'.milestone',_0x588066)),_0x180d07['push'](...validateStageStructure(_0x47baf6,_0x2b7f8a,_0x53aa1c,_0x588066)),_0x180d07[_0x463751(0x1fc)](...validateFlowControl(_0x47baf6,_0x2b7f8a,_0x588066)),_0x180d07;}function validateStagesForVersion(_0x331821,_0x2d4e47,_0xb05f38,_0x4cd993,_0x386da3,_0x57def6,_0x1ac470){const _0xca2444=a146_0x1110;if(_0x331821['length']===0x0){_0x386da3[_0xca2444(0x1fc)]({'level':_0xca2444(0x200),'path':_0x4cd993+_0xca2444(0x23f),'code':_0xca2444(0x27b),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0xb05f38[_0xca2444(0x284)],_0xb05f38[_0xca2444(0x297)],[_0xca2444(0x23f)])});return;}const _0x55b39f=new Set();for(const _0x4e7160 of _0x331821){if(_0x4e7160['steps'])for(const _0x237ed4 of _0x4e7160[_0xca2444(0x22d)]){_0x237ed4['name']&&_0x55b39f[_0xca2444(0x218)](_0x237ed4[_0xca2444(0x20e)]);}}const _0x46abfe={..._0xb05f38,'stepNames':_0x55b39f},_0xc87ffc=validateVersionStructure(_0x331821,_0x46abfe);for(const _0x1cf6ea of _0xc87ffc){const _0x50abd6=_0x4cd993?{..._0x1cf6ea,'path':''+_0x4cd993+_0x1cf6ea[_0xca2444(0x239)]}:_0x1cf6ea;if(_0x50abd6[_0xca2444(0x222)]==='error')_0x386da3[_0xca2444(0x1fc)](_0x50abd6);else _0x57def6['push'](_0x50abd6);}for(let _0x3798a1=0x0;_0x3798a1<_0x331821[_0xca2444(0x204)];_0x3798a1++){const _0x485a70=validateStage(_0x331821[_0x3798a1],_0x3798a1,_0x331821['length'],_0x46abfe);for(const _0x5560a8 of _0x485a70){const _0x4194e1=_0x4cd993?{..._0x5560a8,'path':''+_0x4cd993+_0x5560a8[_0xca2444(0x239)]}:_0x5560a8;if(_0x4194e1['level']===_0xca2444(0x200))_0x386da3['push'](_0x4194e1);else _0x57def6['push'](_0x4194e1);}}if(_0x2d4e47[_0xca2444(0x22a)]){const _0x9dcf4c=_0x1ac470?.[_0xca2444(0x256)]?_0xca2444(0x22a):_0x4cd993+_0xca2444(0x22a),_0x2bd8bf=validateCriteria(_0x2d4e47[_0xca2444(0x22a)],_0x9dcf4c,_0x46abfe);for(const _0x2bdb21 of _0x2bd8bf){if(_0x2bdb21[_0xca2444(0x222)]===_0xca2444(0x200))_0x386da3[_0xca2444(0x1fc)](_0x2bdb21);else _0x57def6[_0xca2444(0x1fc)](_0x2bdb21);}}}function extractVersionIndex(_0x33086c){const _0x5124ce=a146_0x1110,_0x4f40ff=_0x33086c[_0x5124ce(0x27f)](/^journeys\[(\d+)\]\./);return _0x4f40ff?_0x4f40ff[0x1]:undefined;}function deduplicateAcrossVersions(_0x44c35d){const _0x1b76fb=a146_0x1110,_0x582420=new Map();for(let _0x37c24f=0x0;_0x37c24f<_0x44c35d['length'];_0x37c24f++){const _0x4fd0cb=_0x44c35d[_0x37c24f]['code']+':'+_0x44c35d[_0x37c24f][_0x1b76fb(0x285)],_0x34922d=extractVersionIndex(_0x44c35d[_0x37c24f][_0x1b76fb(0x239)]),_0x597121=_0x582420['get'](_0x4fd0cb);if(_0x597121){_0x597121[_0x1b76fb(0x203)][_0x1b76fb(0x1fc)](_0x37c24f);if(_0x34922d)_0x597121['versions'][_0x1b76fb(0x218)](_0x34922d);}else _0x582420[_0x1b76fb(0x21a)](_0x4fd0cb,{'indices':[_0x37c24f],'versions':new Set(_0x34922d?[_0x34922d]:[])});}const _0x3d95db=new Set();for(const {indices:_0x1a8fba,versions:_0x3ffb8d}of _0x582420['values']()){if(_0x3ffb8d[_0x1b76fb(0x230)]<=0x1)continue;const _0x4b6cc4=_0x44c35d[_0x1a8fba[0x0]];_0x4b6cc4[_0x1b76fb(0x239)]=_0x4b6cc4['path']['replace'](/^journeys\[\d+\]\./,''),_0x4b6cc4['message']=_0x4b6cc4[_0x1b76fb(0x285)]+_0x1b76fb(0x29d)+_0x3ffb8d[_0x1b76fb(0x230)]+_0x1b76fb(0x231);for(let _0x351fad=0x1;_0x351fad<_0x1a8fba[_0x1b76fb(0x204)];_0x351fad++){_0x3d95db['add'](_0x1a8fba[_0x351fad]);}}const _0x520d85=[..._0x3d95db][_0x1b76fb(0x237)]((_0x4b69b9,_0x479752)=>_0x479752-_0x4b69b9);for(const _0x375cb6 of _0x520d85){_0x44c35d[_0x1b76fb(0x248)](_0x375cb6,0x1);}}export function validateJourneyDef(_0x26632a,_0x96fd25={},_0x49b9b1={}){const _0x5b9c49=a146_0x1110;if(_0x49b9b1['skipSchema'])return runJourneySemanticChecks(_0x26632a,_0x96fd25);const _0x45885f=JourneyDefSchema['safeParse'](_0x26632a);if(_0x45885f[_0x5b9c49(0x281)])return runJourneySemanticChecks(_0x45885f[_0x5b9c49(0x235)],_0x96fd25);return zodErrorsToJourneyValidationResult(_0x45885f[_0x5b9c49(0x200)],_0x96fd25);}function zodErrorsToJourneyValidationResult(_0x3660e4,_0x4716d8){const _0x2edae5=a146_0x1110,_0x1607b0=flattenZodIssues(_0x3660e4[_0x2edae5(0x265)]),_0xaaf8f9=_0x1607b0[_0x2edae5(0x267)](_0x3aa5f4=>{const _0x5be3e5=_0x2edae5,_0x2c7f46=formatZodPath(_0x3aa5f4[_0x5be3e5(0x239)]),_0x96f16d=mapJourneyZodIssueToCode(_0x3aa5f4,_0x2c7f46),_0x22a35d=getLocationFromPath(_0x4716d8[_0x5be3e5(0x284)],_0x4716d8[_0x5be3e5(0x297)],_0x3aa5f4['path'][_0x5be3e5(0x267)](_0x2d04cc=>typeof _0x2d04cc===_0x5be3e5(0x1ff)?String(_0x2d04cc):_0x2d04cc));return{'level':_0x5be3e5(0x200),'path':_0x2c7f46,'code':_0x96f16d,'message':_0x3aa5f4[_0x5be3e5(0x285)],..._0x22a35d&&{'location':_0x22a35d}};});return{'valid':![],'errors':_0xaaf8f9,'warnings':[]};}function a146_0x6b14(){const _0x18c10e=['segments.','variants','join','stages[','add','.type','set','MISSING_WAIT_PARAMS','segment','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','1138265sCxGxW','.with.branches[','4723970BwbWus','timeout','level','startsWith','5093652IWIrcF','ACTIVATION_SCHEMA_ERROR','Duplicate\x20step\x20name\x20\x27','35pReZSV','decision_point','MISSING_ACTIVATION_REF','goal','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','excluded_','steps','DUPLICATE_STEP_NAME','.steps','size','\x20versions)','3hZjGuk','rule','1080Pixsuh','data','MISSING_SEGMENT_REFERENCE','sort','MISSING_ENTRY_CRITERIA','path','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','condition','.exit_criteria[','MISSING_CONDITIONS','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','stages','.with.activation','type','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','timeout\x20of\x20\x27','Step\x20references\x20non-existent\x20step\x20\x27','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','.with.condition.timeout','milestone','splice','MISSING_MILESTONE','warning','activationKeys','includes','abs','SINGLE_INPUT_MERGE','merge','segments','latest','\x27\x20has\x20no\x20steps','next','.name','.stages','goalIsInherited','\x27\x20has\x20only\x20','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','.next','endsWith','INVALID_JUMP_TARGET','branches','.with.condition','percentage','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','MISSING_END_STEP','ab_test','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','BRANCH_DIRECTLY_TO_MERGE','.exit_criteria','issues','Journey\x20has\x20','map','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','activations','referencedSegments','Criteria\x20references\x20undefined\x20segment\x20\x27','some','205150VAeINZ','stepNames','get','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','\x20stages\x20but\x20maximum\x20is\x20','.with.condition.segment','.rule','1707394BCqhsP','launched','Journey\x20can\x20have\x20at\x20most\x20one\x20','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','\x27\x20has\x20no\x20end\x20step','END_STEP_HAS_NEXT_OR_WITH','MISSING_STAGES','.with','182qZedIN','.entry_criteria','match','embeddedSegments','success','4072nAwcXk','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','document','message','step\x20\x27','.milestone','Activation\x20step\x20requires\x20an\x20activation\x20reference','jump','exit_criteria','description','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','INSUFFICIENT_STEPS','9cMaQLC','INVALID_AB_TEST_PERCENTAGES','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','.with.branches','entry_criteria',').\x20Use\x20a\x20merge\x20step.','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','journeys,\x20stages,\x20or\x20versions','activation','source','End\x20step\x20\x27','MISSING_ACTIVATION_DEFINITION','.with.target','CONVERGENCE_WITHOUT_MERGE','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','\x20(across\x20','journeys','JOURNEY_SCHEMA_ERROR','\x27\x20with\x20no\x20action\x20in\x20between','.with.variants','MERGE_TO_MERGE_CHAIN','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','INVALID_NEXT_REFERENCE','condition\x20of\x20\x27','end','MISSING_EXIT_CRITERIA','Stage\x20\x27','stage','TOO_MANY_STAGES','filter','with','target','wait','\x27\x20has\x20no\x20exit_criteria\x20defined','\x27\x20(first\x20defined\x20at\x20steps[','FEW_STEPS','ref:','has','Jump\x20step\x20requires\x20a\x20target','MISSING_GOAL','excluded','push','.segment','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','symbol','error','MISSING_NAME','state','indices','length','Embedded\x20segment\x20\x27','keys','\x20with\x20latest:\x20true','1078962Gnffsu','journeys[','versions[','versions','\x27\x20of\x20\x27','Journey\x20has\x20no\x20goal\x20defined','name','Merge\x20step\x20\x27','trim','.steps[','\x20steps\x20(may\x20be\x20too\x20simple)','reduce'];a146_0x6b14=function(){return _0x18c10e;};return a146_0x6b14();}function mapJourneyZodIssueToCode(_0x2286ff,_0x5c4ed7){const _0x7e0c13=a146_0x1110;if(_0x5c4ed7===_0x7e0c13(0x20e))return'MISSING_NAME';if(_0x5c4ed7[_0x7e0c13(0x25a)](_0x7e0c13(0x219))&&_0x5c4ed7['includes'](_0x7e0c13(0x22d)))return _0x7e0c13(0x29f);if(_0x5c4ed7==='stages'||_0x5c4ed7[_0x7e0c13(0x25a)](_0x7e0c13(0x255)))return _0x7e0c13(0x27b);if(_0x5c4ed7===''&&_0x2286ff[_0x7e0c13(0x285)][_0x7e0c13(0x24c)](_0x7e0c13(0x295)))return _0x7e0c13(0x27b);if(_0x5c4ed7[_0x7e0c13(0x24c)](_0x7e0c13(0x296)))return _0x7e0c13(0x225);return _0x7e0c13(0x29f);}function runJourneySemanticChecks(_0x1b04c8,_0x1e45cf){const _0x29b747=a146_0x1110,_0x4dec31=[],_0x53635e=[];(!_0x1b04c8[_0x29b747(0x20e)]||_0x1b04c8['name'][_0x29b747(0x210)]()==='')&&_0x4dec31[_0x29b747(0x1fc)]({'level':_0x29b747(0x200),'path':'name','code':_0x29b747(0x201),'message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x1e45cf[_0x29b747(0x284)],_0x1e45cf[_0x29b747(0x297)],['name'])});const _0x12877f=new Set();if(_0x1b04c8[_0x29b747(0x250)])for(const _0x435454 of Object[_0x29b747(0x206)](_0x1b04c8[_0x29b747(0x250)])){_0x12877f[_0x29b747(0x218)](_0x435454);}const _0x1388fc=new Set();if(_0x1b04c8[_0x29b747(0x26a)])for(const _0x5ad639 of Object[_0x29b747(0x206)](_0x1b04c8['activations'])){_0x1388fc[_0x29b747(0x218)](_0x5ad639);}const _0x3a4b75=new Set(),_0x4d1041={..._0x1e45cf,'embeddedSegments':_0x12877f,'referencedSegments':_0x3a4b75,'activationKeys':_0x1388fc[_0x29b747(0x230)]>0x0?_0x1388fc:undefined};if(_0x1b04c8[_0x29b747(0x250)])for(const [_0x117902,_0x3d0a31]of Object['entries'](_0x1b04c8[_0x29b747(0x250)])){const _0x1a1bbc=validateEmbeddedSegment(_0x3d0a31,_0x29b747(0x214)+_0x117902,_0x4d1041);for(const _0xe2bd32 of _0x1a1bbc){if(_0xe2bd32[_0x29b747(0x222)]===_0x29b747(0x200))_0x4dec31[_0x29b747(0x1fc)](_0xe2bd32);else _0x53635e['push'](_0xe2bd32);}}const _0x55abb0=!!_0x1b04c8[_0x29b747(0x22a)],_0x3263c8=_0x1b04c8['journeys']?.['every'](_0x1fb759=>!!_0x1fb759[_0x29b747(0x22a)])??![];!_0x55abb0&&!_0x3263c8&&_0x53635e['push']({'level':_0x29b747(0x24a),'path':_0x29b747(0x22a),'code':_0x29b747(0x1fa),'message':_0x29b747(0x20d),'location':getLocationFromPath(_0x1e45cf[_0x29b747(0x284)],_0x1e45cf[_0x29b747(0x297)],[_0x29b747(0x22a)])});const _0xaa5f05=_0x1b04c8[_0x29b747(0x29e)]??_0x1b04c8[_0x29b747(0x20b)];if(_0xaa5f05&&_0xaa5f05[_0x29b747(0x1f0)](_0xdc9385=>_0xdc9385[_0x29b747(0x251)]===!![])['length']>0x1){const _0x2d3a18=_0x1b04c8[_0x29b747(0x29e)]?_0x29b747(0x29e):_0x29b747(0x20b);_0x4dec31[_0x29b747(0x1fc)]({'level':_0x29b747(0x200),'path':_0x2d3a18,'code':'DUPLICATE_LATEST','message':_0x29b747(0x277)+(_0x2d3a18===_0x29b747(0x29e)?'journey\x20entry':'version')+_0x29b747(0x207),'location':getLocationFromPath(_0x1e45cf[_0x29b747(0x284)],_0x1e45cf[_0x29b747(0x297)],[_0x2d3a18])});}if(_0x1b04c8[_0x29b747(0x29e)]&&_0x1b04c8[_0x29b747(0x29e)][_0x29b747(0x204)]>0x0)for(let _0x5592f6=0x0;_0x5592f6<_0x1b04c8[_0x29b747(0x29e)][_0x29b747(0x204)];_0x5592f6++){const _0x5ab14f=_0x1b04c8[_0x29b747(0x29e)][_0x5592f6];if(_0x1b04c8[_0x29b747(0x29e)][_0x29b747(0x204)]>0x1&&_0x5ab14f[_0x29b747(0x202)]===_0x29b747(0x276))continue;const _0x1622bf=_0x5ab14f[_0x29b747(0x23f)]||[],_0x17b7f2=_0x29b747(0x209)+_0x5592f6+'].',_0x58da82=!!_0x5ab14f[_0x29b747(0x22a)],_0x39a2e7=_0x58da82?{..._0x1b04c8,'goal':_0x5ab14f[_0x29b747(0x22a)]}:_0x1b04c8;validateStagesForVersion(_0x1622bf,_0x39a2e7,_0x4d1041,_0x17b7f2,_0x4dec31,_0x53635e,{'goalIsInherited':!_0x58da82});}else{if(_0x1b04c8[_0x29b747(0x20b)]&&_0x1b04c8[_0x29b747(0x20b)]['length']>0x0)for(let _0x2b7742=0x0;_0x2b7742<_0x1b04c8[_0x29b747(0x20b)][_0x29b747(0x204)];_0x2b7742++){const _0x1ae545=_0x1b04c8[_0x29b747(0x20b)][_0x2b7742];if(_0x1b04c8[_0x29b747(0x20b)]['length']>0x1&&_0x1ae545[_0x29b747(0x202)]===_0x29b747(0x276))continue;const _0x3ff235=_0x1ae545[_0x29b747(0x23f)]||[],_0x320e1a=_0x29b747(0x20a)+_0x2b7742+'].';validateStagesForVersion(_0x3ff235,_0x1b04c8,_0x4d1041,_0x320e1a,_0x4dec31,_0x53635e);}else{const _0x441225=_0x1b04c8[_0x29b747(0x23f)]||[];validateStagesForVersion(_0x441225,_0x1b04c8,_0x4d1041,'',_0x4dec31,_0x53635e);}}_0x1b04c8[_0x29b747(0x29e)]&&_0x1b04c8['journeys'][_0x29b747(0x204)]>0x1&&(deduplicateAcrossVersions(_0x4dec31),deduplicateAcrossVersions(_0x53635e));for(const _0x14cb01 of _0x12877f){!_0x3a4b75[_0x29b747(0x1f8)](_0x14cb01)&&!_0x14cb01[_0x29b747(0x223)](_0x29b747(0x22c))&&_0x53635e['push']({'level':_0x29b747(0x24a),'path':_0x29b747(0x214)+_0x14cb01,'code':'UNUSED_EMBEDDED_SEGMENT','message':_0x29b747(0x205)+_0x14cb01+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x1e45cf[_0x29b747(0x284)],_0x1e45cf[_0x29b747(0x297)],[_0x29b747(0x250),_0x14cb01])});}return{'valid':_0x4dec31['length']===0x0,'errors':_0x4dec31,'warnings':_0x53635e};}
@@ -1 +1 @@
1
- const a147_0x21078b=a147_0x156b;(function(_0x165b9f,_0x3f2baa){const _0x1c9a05=a147_0x156b,_0x1f38cc=_0x165b9f();while(!![]){try{const _0x5eb60f=parseInt(_0x1c9a05(0x173))/0x1*(-parseInt(_0x1c9a05(0x1d4))/0x2)+-parseInt(_0x1c9a05(0x222))/0x3*(parseInt(_0x1c9a05(0x20b))/0x4)+-parseInt(_0x1c9a05(0x1ca))/0x5+-parseInt(_0x1c9a05(0x200))/0x6*(-parseInt(_0x1c9a05(0x1d0))/0x7)+-parseInt(_0x1c9a05(0x1fb))/0x8+parseInt(_0x1c9a05(0x1c0))/0x9*(-parseInt(_0x1c9a05(0x177))/0xa)+parseInt(_0x1c9a05(0x1fd))/0xb*(parseInt(_0x1c9a05(0x182))/0xc);if(_0x5eb60f===_0x3f2baa)break;else _0x1f38cc['push'](_0x1f38cc['shift']());}catch(_0x325d2f){_0x1f38cc['push'](_0x1f38cc['shift']());}}}(a147_0x1b2a,0xcda73));import*as a147_0x1e9c98 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(_0x2ce4c2){const _0x5da004=a147_0x156b,_0x7c2ecd=_0x2ce4c2[_0x5da004(0x1d6)]();if(_0x7c2ecd==='days'||_0x7c2ecd===_0x5da004(0x171))return'day';if(_0x7c2ecd===_0x5da004(0x1c6)||_0x7c2ecd===_0x5da004(0x183))return _0x5da004(0x183);return _0x2ce4c2;}export function journeyResponseToDefSync(_0x548ca0){const _0xc98bae=a147_0x156b,_0x2692f4=_0x548ca0[_0xc98bae(0x1b1)],_0x507959=_0x2692f4[_0xc98bae(0x1fc)]||_0x2692f4['name'],_0x180ab4={'stages':_0x2692f4[_0xc98bae(0x1fa)][_0xc98bae(0x217)](convertApiStageToYaml),'id':_0x548ca0['id']};_0x2692f4[_0xc98bae(0x21f)]&&(_0x180ab4[_0xc98bae(0x21f)]=convertApiCriteriaToYaml(_0x2692f4[_0xc98bae(0x21f)]));_0x2692f4['name']&&_0x2692f4['name']!==_0x507959&&(_0x180ab4[_0xc98bae(0x202)]=_0x2692f4[_0xc98bae(0x1de)]);_0x2692f4['versionNumber']!==undefined&&(_0x180ab4[_0xc98bae(0x1ec)]=_0x2692f4['versionNumber']);_0x2692f4[_0xc98bae(0x20f)]&&(_0x180ab4[_0xc98bae(0x20f)]=_0x2692f4[_0xc98bae(0x20f)]===_0xc98bae(0x176)?_0xc98bae(0x176):'draft');const _0x64e8cb={'type':_0xc98bae(0x19b),'name':_0x507959,'journeys':[_0x180ab4]};_0x2692f4[_0xc98bae(0x1b5)]&&(_0x64e8cb[_0xc98bae(0x1b5)]=_0x2692f4[_0xc98bae(0x1b5)]);_0x2692f4[_0xc98bae(0x21f)]&&(_0x64e8cb[_0xc98bae(0x21f)]=convertApiCriteriaToYaml(_0x2692f4[_0xc98bae(0x21f)]));if(_0x2692f4[_0xc98bae(0x1b6)])_0x64e8cb['reentry']=_0x2692f4[_0xc98bae(0x1b6)];else _0x2692f4[_0xc98bae(0x1a6)]!==undefined&&(_0x64e8cb['reentry']=_0x2692f4[_0xc98bae(0x1a6)]?_0xc98bae(0x1f6):_0xc98bae(0x1d8));return _0x2692f4['journeyBundleId']&&(_0x64e8cb[_0xc98bae(0x207)]=_0x2692f4[_0xc98bae(0x225)]),_0x2692f4[_0xc98bae(0x1fc)]&&(_0x64e8cb[_0xc98bae(0x209)]=_0x2692f4[_0xc98bae(0x1fc)]),_0x548ca0['relationships']?.['parentFolder']?.[_0xc98bae(0x181)]?.['id']&&(_0x64e8cb[_0xc98bae(0x17e)]=_0x548ca0[_0xc98bae(0x174)][_0xc98bae(0x19e)]['data']['id']),_0x64e8cb;}export async function journeyResponseToDef(_0x2acaab,_0x5387b7){const _0xff3e2d=a147_0x156b,_0x31eab8=journeyResponseToDefSync(_0x2acaab);if(!_0x5387b7)return _0x31eab8;const _0x534045=new Set();collectSegmentIdsFromJourney(_0x31eab8,_0x534045);const _0x2cb078=new Set();collectActivationIdsFromJourney(_0x31eab8,_0x2cb078);const _0x59908d={},_0x307ea7=new Map();for(const _0x116c78 of Array['from'](_0x534045)[_0xff3e2d(0x214)]()){if(_0x5387b7[_0xff3e2d(0x223)]){const _0x28650e=await _0x5387b7[_0xff3e2d(0x223)](_0x116c78);if(_0x28650e['isJourneyLocal']){_0x307ea7[_0xff3e2d(0x1d9)](_0x116c78,_0x28650e[_0xff3e2d(0x1de)]);if(_0x28650e['definition']){const _0x4f883f={..._0x28650e['definition'],'rule':deepSortObject(_0x28650e[_0xff3e2d(0x180)]['rule'])};_0x59908d[_0x28650e[_0xff3e2d(0x1de)]]=_0x4f883f;}}else _0x307ea7[_0xff3e2d(0x1d9)](_0x116c78,makeSegmentRef(_0x28650e['name']));}else{if(_0x5387b7[_0xff3e2d(0x1ea)]){const _0x5b78dd=await _0x5387b7[_0xff3e2d(0x1ea)](_0x116c78);_0x307ea7[_0xff3e2d(0x1d9)](_0x116c78,_0x5b78dd);}}}const _0x5de633={},_0x468f09=new Map();for(const _0x419c92 of Array['from'](_0x2cb078)[_0xff3e2d(0x214)]()){if(_0x5387b7[_0xff3e2d(0x1a5)]){const _0x1b9fb6=await _0x5387b7[_0xff3e2d(0x1a5)](_0x419c92);_0x1b9fb6['isJourneyLocal']?(_0x468f09[_0xff3e2d(0x1d9)](_0x419c92,_0x1b9fb6['name']),_0x1b9fb6['definition']&&(_0x5de633[_0x1b9fb6[_0xff3e2d(0x1de)]]=_0x1b9fb6[_0xff3e2d(0x180)])):_0x468f09[_0xff3e2d(0x1d9)](_0x419c92,makeSegmentRef(_0x1b9fb6[_0xff3e2d(0x1de)]));}else{if(_0x5387b7['resolveActivationName']){const _0x199706=await _0x5387b7[_0xff3e2d(0x210)](_0x419c92);_0x468f09[_0xff3e2d(0x1d9)](_0x419c92,_0x199706);}}}_0x307ea7[_0xff3e2d(0x17a)]>0x0&&replaceSegmentIdsInJourney(_0x31eab8,_0x307ea7);_0x468f09[_0xff3e2d(0x17a)]>0x0&&replaceActivationIdsInJourney(_0x31eab8,_0x468f09);if(_0x5387b7['resolveJumpTarget']){const _0x27a5eb=[];collectJumpTargetsFromJourney(_0x31eab8,_0x27a5eb);if(_0x27a5eb[_0xff3e2d(0x1ab)]>0x0){const _0x100686=new Map();for(const _0x565767 of _0x27a5eb){try{const _0x2360c9=await _0x5387b7[_0xff3e2d(0x226)](_0x565767[_0xff3e2d(0x21a)],_0x565767['stageId']);_0x100686['set'](_0x565767['journeyId']+':'+_0x565767[_0xff3e2d(0x216)],_0x2360c9);}catch{}}_0x100686['size']>0x0&&replaceJumpTargetsInJourney(_0x31eab8,_0x100686);}}return Object['keys'](_0x59908d)['length']>0x0&&(_0x31eab8['segments']=_0x59908d),Object['keys'](_0x5de633)[_0xff3e2d(0x1ab)]>0x0&&(_0x31eab8[_0xff3e2d(0x19f)]=_0x5de633),_0x31eab8;}function collectSegmentIdsFromJourney(_0x356a54,_0x3a98ea){const _0x4639e6=a147_0x156b;_0x356a54[_0x4639e6(0x21f)]?.[_0x4639e6(0x204)]&&_0x3a98ea[_0x4639e6(0x16d)](_0x356a54[_0x4639e6(0x21f)]['segment']);const _0x34e2ba=_0xbca5cf=>{const _0x28585c=_0x4639e6;for(const _0x529042 of _0xbca5cf){_0x529042['entry_criteria']?.['segment']&&_0x3a98ea['add'](_0x529042[_0x28585c(0x1d3)][_0x28585c(0x204)]);if(_0x529042[_0x28585c(0x18f)])for(const _0x2792a1 of _0x529042['exit_criteria']){_0x2792a1[_0x28585c(0x204)]&&_0x3a98ea[_0x28585c(0x16d)](_0x2792a1[_0x28585c(0x204)]);}_0x529042[_0x28585c(0x1e4)]?.['segment']&&_0x3a98ea[_0x28585c(0x16d)](_0x529042['milestone'][_0x28585c(0x204)]);if(_0x529042[_0x28585c(0x17f)])for(const _0x33cc5c of _0x529042[_0x28585c(0x17f)]){if(_0x33cc5c[_0x28585c(0x1dd)]===_0x28585c(0x1c3)){const _0x487a4c=_0x33cc5c;for(const _0xbfcd06 of _0x487a4c[_0x28585c(0x1b9)][_0x28585c(0x1ee)]){_0xbfcd06[_0x28585c(0x204)]&&_0x3a98ea[_0x28585c(0x16d)](_0xbfcd06[_0x28585c(0x204)]);}}else{if(_0x33cc5c[_0x28585c(0x1dd)]===_0x28585c(0x1e8)){const _0x938423=_0x33cc5c;_0x938423['with']['condition']?.['segment']&&_0x3a98ea[_0x28585c(0x16d)](_0x938423[_0x28585c(0x1b9)][_0x28585c(0x1b0)][_0x28585c(0x204)]);}}}}};if(_0x356a54[_0x4639e6(0x1e7)])for(const _0x499061 of _0x356a54[_0x4639e6(0x1e7)]){_0x499061['goal']?.[_0x4639e6(0x204)]&&_0x3a98ea[_0x4639e6(0x16d)](_0x499061[_0x4639e6(0x21f)][_0x4639e6(0x204)]),_0x34e2ba(_0x499061[_0x4639e6(0x1d7)]);}_0x356a54[_0x4639e6(0x1d7)]&&_0x34e2ba(_0x356a54['stages']);if(_0x356a54['versions'])for(const _0x8c8b5f of _0x356a54[_0x4639e6(0x21b)]){_0x34e2ba(_0x8c8b5f[_0x4639e6(0x1d7)]);}}function replaceSegmentIdsInJourney(_0x344b1b,_0x5dba22){const _0x38e5e5=a147_0x156b,_0x569568=_0x1af9b8=>_0x5dba22[_0x38e5e5(0x1a1)](_0x1af9b8)||_0x1af9b8;_0x344b1b['goal']?.[_0x38e5e5(0x204)]&&(_0x344b1b[_0x38e5e5(0x21f)][_0x38e5e5(0x204)]=_0x569568(_0x344b1b[_0x38e5e5(0x21f)]['segment']));const _0x50e3e7=_0x47457a=>{const _0x187582=_0x38e5e5;for(const _0x15fd5d of _0x47457a){_0x15fd5d[_0x187582(0x1d3)]?.['segment']&&(_0x15fd5d[_0x187582(0x1d3)][_0x187582(0x204)]=_0x569568(_0x15fd5d[_0x187582(0x1d3)][_0x187582(0x204)]));if(_0x15fd5d[_0x187582(0x18f)])for(const _0x4d8392 of _0x15fd5d[_0x187582(0x18f)]){_0x4d8392['segment']&&(_0x4d8392['segment']=_0x569568(_0x4d8392[_0x187582(0x204)]));}_0x15fd5d[_0x187582(0x1e4)]?.[_0x187582(0x204)]&&(_0x15fd5d[_0x187582(0x1e4)]['segment']=_0x569568(_0x15fd5d[_0x187582(0x1e4)]['segment']));if(_0x15fd5d[_0x187582(0x17f)])for(const _0x18dc84 of _0x15fd5d['steps']){if(_0x18dc84[_0x187582(0x1dd)]===_0x187582(0x1c3)){const _0xd9f5a0=_0x18dc84;for(const _0x242a1d of _0xd9f5a0[_0x187582(0x1b9)][_0x187582(0x1ee)]){_0x242a1d[_0x187582(0x204)]&&(_0x242a1d[_0x187582(0x204)]=_0x569568(_0x242a1d[_0x187582(0x204)]));}}else{if(_0x18dc84[_0x187582(0x1dd)]===_0x187582(0x1e8)){const _0x2eda9c=_0x18dc84;_0x2eda9c[_0x187582(0x1b9)][_0x187582(0x1b0)]?.[_0x187582(0x204)]&&(_0x2eda9c[_0x187582(0x1b9)][_0x187582(0x1b0)][_0x187582(0x204)]=_0x569568(_0x2eda9c[_0x187582(0x1b9)]['condition'][_0x187582(0x204)]));}}}}};if(_0x344b1b[_0x38e5e5(0x1e7)])for(const _0x165a7c of _0x344b1b['journeys']){_0x165a7c['goal']?.[_0x38e5e5(0x204)]&&(_0x165a7c['goal'][_0x38e5e5(0x204)]=_0x569568(_0x165a7c[_0x38e5e5(0x21f)][_0x38e5e5(0x204)])),_0x50e3e7(_0x165a7c['stages']);}_0x344b1b['stages']&&_0x50e3e7(_0x344b1b['stages']);if(_0x344b1b[_0x38e5e5(0x21b)])for(const _0xd39081 of _0x344b1b['versions']){_0x50e3e7(_0xd39081[_0x38e5e5(0x1d7)]);}}function collectActivationIdsFromJourney(_0x29abcc,_0x21b782){const _0x59591b=a147_0x156b,_0x21323f=_0x19dd4c=>{const _0x58e22c=a147_0x156b;for(const _0x44ede9 of _0x19dd4c){if(_0x44ede9[_0x58e22c(0x17f)])for(const _0x38000e of _0x44ede9[_0x58e22c(0x17f)]){if(_0x38000e['type']===_0x58e22c(0x1c5)){const _0xf5b9c4=_0x38000e;_0xf5b9c4[_0x58e22c(0x1b9)][_0x58e22c(0x1c5)]&&/^\d+$/[_0x58e22c(0x1df)](_0xf5b9c4['with'][_0x58e22c(0x1c5)])&&_0x21b782[_0x58e22c(0x16d)](_0xf5b9c4[_0x58e22c(0x1b9)][_0x58e22c(0x1c5)]);}}}};if(_0x29abcc['journeys'])for(const _0x4755a5 of _0x29abcc[_0x59591b(0x1e7)]){_0x21323f(_0x4755a5[_0x59591b(0x1d7)]);}_0x29abcc[_0x59591b(0x1d7)]&&_0x21323f(_0x29abcc[_0x59591b(0x1d7)]);if(_0x29abcc[_0x59591b(0x21b)])for(const _0x43ac81 of _0x29abcc[_0x59591b(0x21b)]){_0x21323f(_0x43ac81[_0x59591b(0x1d7)]);}}function replaceActivationIdsInJourney(_0x263c41,_0x59f0e6){const _0x350d80=a147_0x156b,_0x4ac9e0=_0x55a32b=>_0x59f0e6[_0x350d80(0x1a1)](_0x55a32b)||_0x55a32b,_0x215df3=_0x2c62a9=>{const _0x141728=_0x350d80;for(const _0x4121de of _0x2c62a9){if(_0x4121de['steps'])for(const _0x1e6e2c of _0x4121de[_0x141728(0x17f)]){if(_0x1e6e2c[_0x141728(0x1dd)]===_0x141728(0x1c5)){const _0x24e04d=_0x1e6e2c;_0x24e04d[_0x141728(0x1b9)][_0x141728(0x1c5)]&&(_0x24e04d[_0x141728(0x1b9)]['activation']=_0x4ac9e0(_0x24e04d[_0x141728(0x1b9)][_0x141728(0x1c5)]));}}}};if(_0x263c41[_0x350d80(0x1e7)])for(const _0x6c1d38 of _0x263c41['journeys']){_0x215df3(_0x6c1d38[_0x350d80(0x1d7)]);}_0x263c41['stages']&&_0x215df3(_0x263c41[_0x350d80(0x1d7)]);if(_0x263c41['versions'])for(const _0x2efaad of _0x263c41[_0x350d80(0x21b)]){_0x215df3(_0x2efaad[_0x350d80(0x1d7)]);}}function collectJumpTargetsFromJourney(_0xdf01d6,_0x595d44){const _0x177aaf=a147_0x156b,_0x1aeb19=new Set(),_0x440f89=_0x157b3f=>{const _0x3b8919=a147_0x156b;for(const _0x235611 of _0x157b3f){if(_0x235611[_0x3b8919(0x17f)])for(const _0x50f039 of _0x235611['steps']){if(_0x50f039['type']===_0x3b8919(0x192)){const _0x52ed6b=_0x50f039,_0x3e237c=_0x52ed6b[_0x3b8919(0x1b9)][_0x3b8919(0x18c)];if(_0x3e237c[_0x3b8919(0x19b)]&&_0x3e237c[_0x3b8919(0x188)]&&/^\d+$/[_0x3b8919(0x1df)](_0x3e237c[_0x3b8919(0x19b)])&&/^\d+$/[_0x3b8919(0x1df)](_0x3e237c[_0x3b8919(0x188)])){const _0x1634ec=_0x3e237c['journey']+':'+_0x3e237c[_0x3b8919(0x188)];!_0x1aeb19['has'](_0x1634ec)&&(_0x1aeb19[_0x3b8919(0x16d)](_0x1634ec),_0x595d44['push']({'journeyId':_0x3e237c[_0x3b8919(0x19b)],'stageId':_0x3e237c[_0x3b8919(0x188)]}));}}}}};if(_0xdf01d6[_0x177aaf(0x1e7)])for(const _0x51bed8 of _0xdf01d6[_0x177aaf(0x1e7)]){_0x440f89(_0x51bed8['stages']);}_0xdf01d6[_0x177aaf(0x1d7)]&&_0x440f89(_0xdf01d6[_0x177aaf(0x1d7)]);if(_0xdf01d6[_0x177aaf(0x21b)])for(const _0x45c670 of _0xdf01d6[_0x177aaf(0x21b)]){_0x440f89(_0x45c670[_0x177aaf(0x1d7)]);}}function replaceJumpTargetsInJourney(_0x7638fe,_0x3ff438){const _0x13f458=a147_0x156b,_0x5b95fd=_0x228727=>{const _0x3bb2d3=a147_0x156b;for(const _0x2a0d22 of _0x228727){if(_0x2a0d22['steps'])for(const _0x4715d0 of _0x2a0d22[_0x3bb2d3(0x17f)]){if(_0x4715d0[_0x3bb2d3(0x1dd)]===_0x3bb2d3(0x192)){const _0x99cfc5=_0x4715d0,_0x562fab=_0x99cfc5[_0x3bb2d3(0x1b9)][_0x3bb2d3(0x18c)],_0x1ccdeb=_0x562fab['journey']+':'+_0x562fab['stage'],_0xed68f7=_0x3ff438[_0x3bb2d3(0x1a1)](_0x1ccdeb);_0xed68f7&&(_0x562fab[_0x3bb2d3(0x19b)]=_0xed68f7[_0x3bb2d3(0x1e3)],_0x562fab['stage']=_0xed68f7[_0x3bb2d3(0x191)]);}}}};if(_0x7638fe[_0x13f458(0x1e7)])for(const _0x429122 of _0x7638fe[_0x13f458(0x1e7)]){_0x5b95fd(_0x429122[_0x13f458(0x1d7)]);}_0x7638fe[_0x13f458(0x1d7)]&&_0x5b95fd(_0x7638fe[_0x13f458(0x1d7)]);if(_0x7638fe[_0x13f458(0x21b)])for(const _0x26fe52 of _0x7638fe[_0x13f458(0x21b)]){_0x5b95fd(_0x26fe52[_0x13f458(0x1d7)]);}}function generateReadableStepName(_0x3ac71c,_0x34798c){const _0x4f39ab=a147_0x156b;if(_0x3ac71c[_0x4f39ab(0x1de)]&&_0x3ac71c[_0x4f39ab(0x1de)]!==_0x3ac71c['type']){const _0x1d6d57=_0x3ac71c[_0x4f39ab(0x1de)][_0x4f39ab(0x199)]();if(_0x1d6d57&&/[a-z0-9\p{L}]/iu[_0x4f39ab(0x1df)](_0x1d6d57))return _0x1d6d57;}const _0x12dc9b=_0x3ac71c['type'][_0x4f39ab(0x1d6)]()[_0x4f39ab(0x19c)](/step$/i,'');return _0x12dc9b+'_'+(_0x34798c+0x1);}function getStepNextRefs(_0x235a06){const _0x1b00b0=a147_0x156b,_0x221aa4=[];if(_0x235a06['next'])_0x221aa4[_0x1b00b0(0x1db)](_0x235a06[_0x1b00b0(0x1c8)]);if(_0x235a06[_0x1b00b0(0x1ee)])for(const _0xd70d86 of _0x235a06['branches']){if(_0xd70d86[_0x1b00b0(0x1c8)])_0x221aa4[_0x1b00b0(0x1db)](_0xd70d86['next']);}if(_0x235a06[_0x1b00b0(0x187)])for(const _0x17216a of _0x235a06[_0x1b00b0(0x187)]){if(_0x17216a[_0x1b00b0(0x1c8)])_0x221aa4[_0x1b00b0(0x1db)](_0x17216a[_0x1b00b0(0x1c8)]);}if(_0x235a06['conditions'])for(const _0x5df082 of _0x235a06[_0x1b00b0(0x1aa)]){if(_0x5df082[_0x1b00b0(0x1c8)])_0x221aa4[_0x1b00b0(0x1db)](_0x5df082[_0x1b00b0(0x1c8)]);}return _0x221aa4;}function parseJumpTargetDisplayName(_0x3918eb){const _0x33d185=a147_0x156b,_0x4528eb=_0x3918eb['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0x4528eb)return undefined;const _0xb4b035=_0x4528eb[0x1][_0x33d185(0x199)](),_0xb174ea=_0x4528eb[0x2][_0x33d185(0x199)]();if(!_0xb4b035||!_0xb174ea)return undefined;return{'stageName':_0xb4b035,'journeyName':_0xb174ea};}function orderStepsFromRoot(_0x8303e4,_0x44a95d){const _0x2464c7=a147_0x156b,_0x15670d=Object[_0x2464c7(0x1dc)](_0x8303e4);if(_0x15670d[_0x2464c7(0x1ab)]===0x0)return[];const _0x428e3d=new Set(_0x15670d[_0x2464c7(0x217)](([_0x1aa4fd])=>_0x1aa4fd)),_0x3a5f7f=new Set();for(const [,_0x507a97]of _0x15670d){for(const _0x99708e of getStepNextRefs(_0x507a97)){if(_0x428e3d[_0x2464c7(0x1e5)](_0x99708e))_0x3a5f7f[_0x2464c7(0x16d)](_0x99708e);}}let _0x1cf8ab=_0x44a95d&&_0x428e3d[_0x2464c7(0x1e5)](_0x44a95d)?_0x44a95d:undefined;if(!_0x1cf8ab){const _0x3d86b0=_0x15670d[_0x2464c7(0x172)](([_0x389934])=>!_0x3a5f7f[_0x2464c7(0x1e5)](_0x389934));_0x3d86b0['length']>0x0?_0x1cf8ab=_0x3d86b0[0x0][0x0]:_0x1cf8ab=_0x15670d[0x0][0x0];}const _0x59e5e7=[],_0x3930d1=new Set(),_0x459546=[_0x1cf8ab];while(_0x459546[_0x2464c7(0x1ab)]>0x0){const _0x4f5c96=_0x459546[_0x2464c7(0x203)]();if(_0x3930d1['has'](_0x4f5c96))continue;_0x3930d1[_0x2464c7(0x16d)](_0x4f5c96);const _0x34047e=_0x8303e4[_0x4f5c96];if(!_0x34047e)continue;_0x59e5e7[_0x2464c7(0x1db)]({'uuid':_0x4f5c96,'step':_0x34047e});for(const _0xba2411 of getStepNextRefs(_0x34047e)){_0x428e3d[_0x2464c7(0x1e5)](_0xba2411)&&!_0x3930d1[_0x2464c7(0x1e5)](_0xba2411)&&_0x459546[_0x2464c7(0x1db)](_0xba2411);}}for(const [_0x13f79a,_0x44d88e]of _0x15670d){!_0x3930d1[_0x2464c7(0x1e5)](_0x13f79a)&&_0x59e5e7[_0x2464c7(0x1db)]({'uuid':_0x13f79a,'step':_0x44d88e});}return _0x59e5e7;}function resolveStepReferences(_0x3348dc,_0x5ed7a1,_0x4ff81e,_0x4b14d9){const _0x5cdf4c=a147_0x156b;if(_0x3348dc['type']!==_0x5cdf4c(0x1bd)){_0x3348dc['next']&&_0x4b14d9[_0x5cdf4c(0x1e5)](_0x3348dc['next'])&&(_0x3348dc['next']=_0x4b14d9[_0x5cdf4c(0x1a1)](_0x3348dc[_0x5cdf4c(0x1c8)]));const _0x5855ff=_0x5ed7a1+0x1;if(_0x5855ff<_0x4ff81e[_0x5cdf4c(0x1ab)]){const _0x2f9e93=_0x4b14d9[_0x5cdf4c(0x1a1)](_0x4ff81e[_0x5855ff][_0x5cdf4c(0x184)]);_0x3348dc['next']===_0x2f9e93&&delete _0x3348dc[_0x5cdf4c(0x1c8)];}}if(_0x3348dc[_0x5cdf4c(0x1dd)]===_0x5cdf4c(0x1c3))for(const _0x598945 of _0x3348dc[_0x5cdf4c(0x1b9)][_0x5cdf4c(0x1ee)]){_0x598945[_0x5cdf4c(0x1c8)]&&_0x4b14d9['has'](_0x598945[_0x5cdf4c(0x1c8)])&&(_0x598945['next']=_0x4b14d9['get'](_0x598945[_0x5cdf4c(0x1c8)]));}if(_0x3348dc[_0x5cdf4c(0x1dd)]===_0x5cdf4c(0x201))for(const _0x4ea46f of _0x3348dc['with']['variants']){_0x4ea46f[_0x5cdf4c(0x1c8)]&&_0x4b14d9[_0x5cdf4c(0x1e5)](_0x4ea46f['next'])&&(_0x4ea46f[_0x5cdf4c(0x1c8)]=_0x4b14d9['get'](_0x4ea46f['next']));}if(_0x3348dc[_0x5cdf4c(0x1dd)]===_0x5cdf4c(0x1e8)&&_0x3348dc[_0x5cdf4c(0x1b9)][_0x5cdf4c(0x1b0)]){const _0x155468=_0x3348dc['with'][_0x5cdf4c(0x1b0)];_0x155468[_0x5cdf4c(0x1c8)]&&_0x4b14d9[_0x5cdf4c(0x1e5)](_0x155468[_0x5cdf4c(0x1c8)])&&(_0x155468[_0x5cdf4c(0x1c8)]=_0x4b14d9['get'](_0x155468[_0x5cdf4c(0x1c8)])),_0x155468[_0x5cdf4c(0x1d2)]?.[_0x5cdf4c(0x1c8)]&&_0x4b14d9['has'](_0x155468['timeout'][_0x5cdf4c(0x1c8)])&&(_0x155468['timeout'][_0x5cdf4c(0x1c8)]=_0x4b14d9[_0x5cdf4c(0x1a1)](_0x155468['timeout'][_0x5cdf4c(0x1c8)]));}}function convertApiStageToYaml(_0x3c5299){const _0xcb535c=a147_0x156b,_0x2706a3={'name':_0x3c5299[_0xcb535c(0x1de)]};_0x3c5299['id']&&(_0x2706a3['id']=_0x3c5299['id']);_0x3c5299['description']&&(_0x2706a3['description']=_0x3c5299[_0xcb535c(0x1b5)]);_0x3c5299[_0xcb535c(0x20a)]&&(_0x2706a3[_0xcb535c(0x1d3)]=convertApiCriteriaToYaml(_0x3c5299[_0xcb535c(0x20a)]));_0x3c5299[_0xcb535c(0x1ba)]&&_0x3c5299['exitCriterias'][_0xcb535c(0x1ab)]>0x0&&(_0x2706a3[_0xcb535c(0x18f)]=_0x3c5299[_0xcb535c(0x1ba)][_0xcb535c(0x217)](convertApiCriteriaToYaml));_0x3c5299['milestone']&&(_0x2706a3[_0xcb535c(0x1e4)]=convertApiCriteriaToYaml(_0x3c5299[_0xcb535c(0x1e4)]));if(_0x3c5299['steps']&&Object[_0xcb535c(0x193)](_0x3c5299[_0xcb535c(0x17f)])[_0xcb535c(0x1ab)]>0x0){const _0x10795a=orderStepsFromRoot(_0x3c5299[_0xcb535c(0x17f)],_0x3c5299[_0xcb535c(0x1c9)]),_0x5d1ffc=new Map(),_0x33327b=new Set();for(let _0x45736d=0x0;_0x45736d<_0x10795a[_0xcb535c(0x1ab)];_0x45736d++){const {uuid:_0x1853ee,step:_0x593ea4}=_0x10795a[_0x45736d];let _0x1ad23a=generateReadableStepName(_0x593ea4,_0x45736d),_0xa91f12=_0x1ad23a,_0x26ed37=0x2;while(_0x33327b['has'](_0xa91f12)){_0xa91f12=_0x1ad23a+'_'+_0x26ed37,_0x26ed37++;}_0x33327b[_0xcb535c(0x16d)](_0xa91f12),_0x5d1ffc[_0xcb535c(0x1d9)](_0x1853ee,_0xa91f12);}_0x2706a3[_0xcb535c(0x17f)]=_0x10795a[_0xcb535c(0x217)](({uuid:_0x51e2ea,step:_0x35d8f5},_0x39f20a)=>{const _0xe8bfa4=_0xcb535c,_0x2867ec=convertApiStepToYaml(_0x35d8f5,_0x5d1ffc[_0xe8bfa4(0x1a1)](_0x51e2ea));return resolveStepReferences(_0x2867ec,_0x39f20a,_0x10795a,_0x5d1ffc),_0x2867ec;});}return _0x2706a3;}function convertApiCriteriaToYaml(_0x2792c3){const _0x1d9ca6=a147_0x156b,_0x122867={'name':_0x2792c3[_0x1d9ca6(0x1de)],'segment':_0x2792c3['segmentId']};_0x2792c3[_0x1d9ca6(0x1b5)]&&(_0x122867['description']=_0x2792c3[_0x1d9ca6(0x1b5)]);if(_0x2792c3[_0x1d9ca6(0x18c)]){let _0x1bbcf3=_0x2792c3[_0x1d9ca6(0x18c)][_0x1d9ca6(0x21a)],_0x515f96=_0x2792c3['target'][_0x1d9ca6(0x189)];if(_0x2792c3[_0x1d9ca6(0x18c)][_0x1d9ca6(0x1e3)]){const _0x3e0678=parseJumpTargetDisplayName(_0x2792c3[_0x1d9ca6(0x18c)]['journeyName']);_0x3e0678&&(_0x515f96=_0x3e0678[_0x1d9ca6(0x191)],_0x1bbcf3=_0x3e0678['journeyName']);}_0x122867['target']={'journey':_0x1bbcf3,'stage':_0x515f96},_0x2792c3['target']['journeyBundleId']&&(_0x122867[_0x1d9ca6(0x18c)]['bundle_id']=_0x2792c3[_0x1d9ca6(0x18c)][_0x1d9ca6(0x225)]);}return _0x122867;}function convertApiStepToYaml(_0x59afeb,_0x3944d3){const _0x405a8a=a147_0x156b;switch(_0x59afeb['type']){case _0x405a8a(0x215):{const _0x4f35fc={};if(_0x59afeb[_0x405a8a(0x17b)]===_0x405a8a(0x1c1)&&_0x59afeb['waitStep']!==undefined)_0x4f35fc['duration']=_0x59afeb['waitStep'],_0x4f35fc['unit']=_0x59afeb['waitStepUnit'];else{if(_0x59afeb['waitStepType']===_0x405a8a(0x205)&&_0x59afeb[_0x405a8a(0x1f0)])_0x4f35fc[_0x405a8a(0x21e)]=_0x59afeb[_0x405a8a(0x1f0)];else{if(_0x59afeb[_0x405a8a(0x17b)]===_0x405a8a(0x1be)&&_0x59afeb[_0x405a8a(0x224)])_0x4f35fc[_0x405a8a(0x213)]=_0x59afeb[_0x405a8a(0x224)];else{if(_0x59afeb[_0x405a8a(0x17b)]==='Condition'){if(_0x59afeb[_0x405a8a(0x1aa)]&&_0x59afeb[_0x405a8a(0x1aa)][_0x405a8a(0x1ab)]>0x0){const _0x9bf820=_0x59afeb[_0x405a8a(0x1aa)][_0x405a8a(0x197)](_0x21c10e=>!_0x21c10e[_0x405a8a(0x1a4)]),_0x45fd8e=_0x59afeb[_0x405a8a(0x1aa)][_0x405a8a(0x197)](_0x274306=>_0x274306['timedOutPath']);_0x9bf820?.[_0x405a8a(0x18a)]&&(_0x4f35fc[_0x405a8a(0x1b0)]={'segment':_0x9bf820[_0x405a8a(0x18a)],..._0x9bf820[_0x405a8a(0x1c8)]?{'next':_0x9bf820[_0x405a8a(0x1c8)]}:{}},_0x45fd8e&&_0x45fd8e[_0x405a8a(0x1cf)]!==undefined&&_0x45fd8e[_0x405a8a(0x1bc)]&&(_0x4f35fc['condition'][_0x405a8a(0x1d2)]={'duration':_0x45fd8e[_0x405a8a(0x1cf)],'unit':_0x45fd8e['unit'],..._0x45fd8e[_0x405a8a(0x1c8)]?{'next':_0x45fd8e[_0x405a8a(0x1c8)]}:{}}));}else _0x59afeb['conditionSegmentId']&&(_0x4f35fc[_0x405a8a(0x1b0)]={'segment':_0x59afeb[_0x405a8a(0x211)]},_0x59afeb['conditionTimeoutDuration']!==undefined&&_0x59afeb[_0x405a8a(0x1a9)]&&(_0x4f35fc[_0x405a8a(0x1b0)]['timeout']={'duration':_0x59afeb['conditionTimeoutDuration'],'unit':_0x59afeb[_0x405a8a(0x1a9)]}));}}}}const _0x20713a={'type':'wait','name':_0x3944d3,..._0x59afeb['next']?{'next':_0x59afeb['next']}:{},'with':_0x4f35fc};return _0x20713a;}case _0x405a8a(0x1a0):{const _0x5ec400={'type':_0x405a8a(0x1c5),'name':_0x3944d3,..._0x59afeb[_0x405a8a(0x1c8)]?{'next':_0x59afeb[_0x405a8a(0x1c8)]}:{},'with':{'activation':_0x59afeb[_0x405a8a(0x196)]||''}};return _0x5ec400;}case'DecisionPoint':{const _0x12a535={'type':_0x405a8a(0x1c3),'name':_0x3944d3,..._0x59afeb['next']?{'next':_0x59afeb[_0x405a8a(0x1c8)]}:{},'with':{'branches':(_0x59afeb[_0x405a8a(0x1ee)]||[])[_0x405a8a(0x217)](_0x2d16a9=>({'name':_0x2d16a9[_0x405a8a(0x1de)],'segment':_0x2d16a9[_0x405a8a(0x18a)],'excluded':_0x2d16a9['excludedPath'],..._0x2d16a9['next']?{'next':_0x2d16a9[_0x405a8a(0x1c8)]}:{}}))}};return _0x12a535;}case _0x405a8a(0x1c2):case _0x405a8a(0x1b2):case'Variant':{const _0x526753=_0x59afeb[_0x405a8a(0x187)]||(_0x59afeb[_0x405a8a(0x1ee)]||[])[_0x405a8a(0x217)](_0x4d4d2d=>({'name':_0x4d4d2d[_0x405a8a(0x1de)],'percentage':0x0,'next':_0x4d4d2d[_0x405a8a(0x1c8)]})),_0x3667b8={'type':'ab_test','name':_0x3944d3,..._0x59afeb[_0x405a8a(0x1c8)]?{'next':_0x59afeb[_0x405a8a(0x1c8)]}:{},'with':{'customized_split':_0x59afeb[_0x405a8a(0x1a7)],'unique_id':_0x59afeb[_0x405a8a(0x1cb)],'variants':_0x526753['map'](_0x385565=>({'name':_0x385565[_0x405a8a(0x1de)],'percentage':_0x385565['percentage'],..._0x385565[_0x405a8a(0x1c8)]?{'next':_0x385565[_0x405a8a(0x1c8)]}:{}}))}};return _0x3667b8;}case _0x405a8a(0x19d):{const _0x36cf34={'type':_0x405a8a(0x1c4),'name':_0x3944d3,..._0x59afeb[_0x405a8a(0x1c8)]?{'next':_0x59afeb[_0x405a8a(0x1c8)]}:{}};return _0x36cf34;}case'Jump':{let _0x4f4559='',_0x187240='',_0x38ec75;if(_0x59afeb[_0x405a8a(0x18c)]){_0x4f4559=_0x59afeb[_0x405a8a(0x18c)][_0x405a8a(0x21a)],_0x187240=_0x59afeb[_0x405a8a(0x18c)][_0x405a8a(0x189)],_0x38ec75=_0x59afeb[_0x405a8a(0x18c)][_0x405a8a(0x225)];if(_0x59afeb[_0x405a8a(0x18c)][_0x405a8a(0x1e3)]){const _0x4e282a=parseJumpTargetDisplayName(_0x59afeb[_0x405a8a(0x18c)]['journeyName']);_0x4e282a&&(_0x187240=_0x4e282a[_0x405a8a(0x191)],_0x4f4559=_0x4e282a[_0x405a8a(0x1e3)]);}}const _0x49176e={'type':_0x405a8a(0x192),'name':_0x3944d3,..._0x59afeb[_0x405a8a(0x1c8)]?{'next':_0x59afeb[_0x405a8a(0x1c8)]}:{},'with':{'target':{'journey':_0x4f4559,'stage':_0x187240,..._0x38ec75?{'bundle_id':_0x38ec75}:{}}}};return _0x49176e;}case _0x405a8a(0x1cc):{const _0x156129={'type':_0x405a8a(0x1bd),'name':_0x3944d3};return _0x156129;}default:{const _0x1c5cbf={'type':_0x405a8a(0x1bd),'name':_0x3944d3};return _0x1c5cbf;}}}export async function journeyDefToRequest(_0x21b978,_0x2dd795,_0xf15d8){const _0x104dbf=a147_0x156b,_0x3763b6=_0x21b978['stages']||getActiveStages(_0x21b978),_0x58ba79=isJourneysArrayMode(_0x21b978)||isMultiVersionMode(_0x21b978)?getLatestJourneyEntry(_0x21b978):undefined,_0x2cf405=_0x58ba79?.[_0x104dbf(0x202)]??_0x21b978[_0x104dbf(0x1de)],_0x227827=_0x21b978[_0x104dbf(0x1e9)]||{},_0x5e6e28=_0x21b978[_0x104dbf(0x19f)]||{},_0x2ca28c={'type':_0x104dbf(0x19b),'attributes':{'name':_0x2cf405,'audienceId':_0x2dd795,'journeyStages':await Promise[_0x104dbf(0x1ac)](_0x3763b6[_0x104dbf(0x217)](_0x332f81=>convertYamlStageToApi(_0x332f81,_0xf15d8,_0x227827,_0x5e6e28)))}},_0x585685=_0x58ba79?.['id']??_0x21b978['id'];_0x585685&&(_0x2ca28c['id']=_0x585685);_0x21b978[_0x104dbf(0x1b5)]&&(_0x2ca28c['attributes'][_0x104dbf(0x1b5)]=_0x21b978['description']);const _0x51ce81=getEffectiveGoal(_0x21b978);_0x51ce81&&(_0x2ca28c[_0x104dbf(0x1b1)]['goal']=await convertYamlCriteriaToApi(_0x51ce81,_0xf15d8,_0x227827));const _0x2b8905=getEffectiveReentry(_0x21b978);return _0x2b8905&&(_0x2ca28c[_0x104dbf(0x1b1)][_0x104dbf(0x1b6)]=_0x2b8905,_0x2ca28c['attributes'][_0x104dbf(0x1a6)]=_0x2b8905!==_0x104dbf(0x1d8)),_0x21b978[_0x104dbf(0x17e)]&&(_0x2ca28c[_0x104dbf(0x174)]={'parentFolder':{'data':{'id':_0x21b978[_0x104dbf(0x17e)],'type':'folder'}}}),_0x2ca28c;}async function convertYamlStageToApi(_0x5e0013,_0x1b5c1e,_0x58851c={},_0x4b89fe={}){const _0x520e10=a147_0x156b,_0x32b09f={'name':_0x5e0013[_0x520e10(0x1de)]};_0x5e0013['id']&&(_0x32b09f['id']=_0x5e0013['id']);_0x5e0013[_0x520e10(0x1b5)]&&(_0x32b09f[_0x520e10(0x1b5)]=_0x5e0013[_0x520e10(0x1b5)]);_0x5e0013['entry_criteria']&&(_0x32b09f[_0x520e10(0x20a)]=await convertYamlCriteriaToApi(_0x5e0013[_0x520e10(0x1d3)],_0x1b5c1e,_0x58851c));_0x5e0013[_0x520e10(0x18f)]&&_0x5e0013[_0x520e10(0x18f)]['length']>0x0&&(_0x32b09f['exitCriterias']=await Promise[_0x520e10(0x1ac)](_0x5e0013[_0x520e10(0x18f)]['map'](_0x33e5e0=>convertYamlCriteriaToApi(_0x33e5e0,_0x1b5c1e,_0x58851c))));_0x5e0013[_0x520e10(0x1e4)]&&(_0x32b09f[_0x520e10(0x1e4)]=await convertYamlCriteriaToApi(_0x5e0013['milestone'],_0x1b5c1e,_0x58851c));if(_0x5e0013[_0x520e10(0x17f)]&&_0x5e0013[_0x520e10(0x17f)][_0x520e10(0x1ab)]>0x0){const _0x36ccdc={},_0x3f11db=_0x5e0013[_0x520e10(0x17f)][_0x520e10(0x217)]((_0x3add33,_0x3cfea2)=>{const _0x403e95=_0x520e10,_0x14b574=_0x3add33[_0x403e95(0x184)]||generateUUID(),_0x8081eb=_0x3add33[_0x403e95(0x1de)]||_0x3add33[_0x403e95(0x1dd)]+'_'+_0x3cfea2;return _0x36ccdc[_0x8081eb]=_0x14b574,{..._0x3add33,'name':_0x8081eb};});_0x32b09f[_0x520e10(0x1c9)]=_0x36ccdc[_0x3f11db[0x0][_0x520e10(0x1de)]],_0x32b09f['steps']={};for(let _0x308df7=0x0;_0x308df7<_0x3f11db[_0x520e10(0x1ab)];_0x308df7++){const _0x33b6d6=_0x3f11db[_0x308df7],_0x3d4397=_0x36ccdc[_0x33b6d6[_0x520e10(0x1de)]],_0x4ff592=!_0x33b6d6[_0x520e10(0x1c8)]&&_0x308df7<_0x3f11db['length']-0x1&&_0x33b6d6[_0x520e10(0x1dd)]!==_0x520e10(0x1bd)?_0x3f11db[_0x308df7+0x1]['name']:_0x33b6d6[_0x520e10(0x1c8)],_0x46087d=_0x4ff592!==_0x33b6d6['next']?{..._0x33b6d6,'next':_0x4ff592}:_0x33b6d6;_0x32b09f[_0x520e10(0x17f)][_0x3d4397]=await convertYamlStepToApi(_0x46087d,_0x1b5c1e,_0x58851c,_0x36ccdc,_0x4b89fe);}}else _0x5e0013[_0x520e10(0x198)]&&(_0x32b09f[_0x520e10(0x1c9)]=_0x5e0013['root_step']);return _0x32b09f;}async function convertYamlCriteriaToApi(_0x221f48,_0x191741,_0x4bbc6a={}){const _0x56f605=a147_0x156b;let _0x44161a=_0x221f48[_0x56f605(0x204)];if(_0x44161a&&!/^\d+$/[_0x56f605(0x1df)](_0x44161a)){const _0x5f1473=parseSegmentRef(_0x44161a);if(_0x5f1473[_0x56f605(0x1dd)]===_0x56f605(0x20c))_0x191741?.[_0x56f605(0x206)]&&(_0x44161a=await _0x191741[_0x56f605(0x206)](_0x5f1473[_0x56f605(0x1de)]));else{if(_0x5f1473[_0x56f605(0x1dd)]===_0x56f605(0x1f7)&&_0x4bbc6a[_0x5f1473[_0x56f605(0x1de)]])_0x191741?.[_0x56f605(0x19a)]&&(_0x44161a=await _0x191741[_0x56f605(0x19a)](_0x5f1473['name'],_0x4bbc6a[_0x5f1473[_0x56f605(0x1de)]]));else _0x191741?.[_0x56f605(0x206)]&&(_0x44161a=await _0x191741[_0x56f605(0x206)](_0x5f1473['name']));}}const _0x4d160f={'name':_0x221f48[_0x56f605(0x1de)],'segmentId':_0x44161a};_0x221f48[_0x56f605(0x1b5)]&&(_0x4d160f[_0x56f605(0x1b5)]=_0x221f48['description']);if(_0x221f48[_0x56f605(0x18c)]){const _0x2f6984=_0x221f48[_0x56f605(0x18c)][_0x56f605(0x19b)],_0x445ef4=_0x221f48['target'][_0x56f605(0x188)];let _0x12f527=_0x221f48['target'][_0x56f605(0x19b)];_0x191741?.[_0x56f605(0x1b8)]&&!/^\d+$/[_0x56f605(0x1df)](_0x12f527)&&(_0x12f527=await _0x191741['resolveJourneyId'](_0x12f527));let _0x691a4c=_0x221f48[_0x56f605(0x18c)][_0x56f605(0x188)];_0x191741?.['resolveStageId']&&!/^\d+$/['test'](_0x691a4c)&&(_0x691a4c=await _0x191741[_0x56f605(0x16c)](_0x12f527,_0x691a4c));const _0x3cf65a=!/^\d+$/['test'](_0x2f6984)&&!isLocalJourneyRef(_0x2f6984)?formatApiJourneyName(_0x2f6984,_0x445ef4):undefined;_0x4d160f[_0x56f605(0x18c)]={'journeyId':_0x12f527,'journeyStageId':_0x691a4c,'journeyName':_0x3cf65a,'confirmed':!![]},_0x221f48['target'][_0x56f605(0x207)]&&(_0x4d160f[_0x56f605(0x18c)][_0x56f605(0x225)]=_0x221f48[_0x56f605(0x18c)]['bundle_id']);}return _0x4d160f;}async function convertYamlStepToApi(_0x3b8c64,_0x43ef3f,_0x2cda7b={},_0x4a5494={},_0x1afc0a={}){const _0x3979a6=a147_0x156b,_0x5da310=async _0x20a5aa=>{const _0x560a56=a147_0x156b;if(/^\d+$/[_0x560a56(0x1df)](_0x20a5aa))return _0x20a5aa;const _0x482223=parseSegmentRef(_0x20a5aa);if(_0x482223[_0x560a56(0x1dd)]==='ref'){if(_0x43ef3f?.[_0x560a56(0x206)])return await _0x43ef3f[_0x560a56(0x206)](_0x482223[_0x560a56(0x1de)]);}else{if(_0x482223[_0x560a56(0x1dd)]===_0x560a56(0x1f7)&&_0x2cda7b[_0x482223[_0x560a56(0x1de)]]){if(_0x43ef3f?.[_0x560a56(0x19a)])return await _0x43ef3f[_0x560a56(0x19a)](_0x482223[_0x560a56(0x1de)],_0x2cda7b[_0x482223['name']]);}else{if(_0x43ef3f?.[_0x560a56(0x206)])return await _0x43ef3f[_0x560a56(0x206)](_0x482223['name']);}}return _0x20a5aa;},_0x2924a6=async _0x489077=>{const _0x403bbf=a147_0x156b;if(/^\d+$/[_0x403bbf(0x1df)](_0x489077))return _0x489077;const _0x32948e=parseSegmentRef(_0x489077);if(_0x32948e[_0x403bbf(0x1dd)]===_0x403bbf(0x20c)){if(_0x43ef3f?.[_0x403bbf(0x1cd)])return await _0x43ef3f[_0x403bbf(0x1cd)](_0x32948e['name']);return _0x32948e[_0x403bbf(0x1de)];}else{if(_0x32948e['type']===_0x403bbf(0x1f7)&&_0x1afc0a[_0x32948e[_0x403bbf(0x1de)]]){if(_0x43ef3f?.['resolveEmbeddedActivationId'])return await _0x43ef3f[_0x403bbf(0x1f8)](_0x32948e[_0x403bbf(0x1de)],_0x1afc0a[_0x32948e[_0x403bbf(0x1de)]]);if(_0x43ef3f?.[_0x403bbf(0x1cd)])return await _0x43ef3f[_0x403bbf(0x1cd)](_0x32948e[_0x403bbf(0x1de)]);}else{if(_0x43ef3f?.[_0x403bbf(0x1cd)])return await _0x43ef3f[_0x403bbf(0x1cd)](_0x32948e[_0x403bbf(0x1de)]);}}return _0x489077;},_0x520894=_0x454a84=>{const _0x3c9bef=a147_0x156b;if(!_0x454a84)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x3c9bef(0x1df)](_0x454a84))return _0x454a84;return _0x4a5494[_0x454a84]||_0x454a84;};switch(_0x3b8c64['type']){case _0x3979a6(0x1e8):{const _0x38c715=_0x3b8c64,_0x22d37e=_0x38c715[_0x3979a6(0x1b9)],_0x5c7e7b={'type':_0x3979a6(0x215),'name':_0x38c715[_0x3979a6(0x1de)],'next':_0x520894(_0x38c715[_0x3979a6(0x1c8)])};if(_0x22d37e[_0x3979a6(0x1ce)]!==undefined&&_0x22d37e[_0x3979a6(0x1bc)])_0x5c7e7b[_0x3979a6(0x17b)]=_0x3979a6(0x1c1),_0x5c7e7b[_0x3979a6(0x16f)]=_0x22d37e['duration'],_0x5c7e7b[_0x3979a6(0x1bb)]=normalizeWaitUnit(_0x22d37e[_0x3979a6(0x1bc)]);else{if(_0x22d37e[_0x3979a6(0x21e)])_0x5c7e7b[_0x3979a6(0x17b)]='Date',_0x5c7e7b['waitUntilDate']=_0x22d37e[_0x3979a6(0x21e)];else{if(_0x22d37e[_0x3979a6(0x213)])_0x5c7e7b[_0x3979a6(0x17b)]=_0x3979a6(0x1be),_0x5c7e7b[_0x3979a6(0x224)]=_0x22d37e['days_of_week'];else{if(_0x22d37e['condition']){_0x5c7e7b[_0x3979a6(0x17b)]=_0x3979a6(0x1eb);const _0x1df5c3=await _0x5da310(_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x204)]),_0x4e3234=_0x22d37e['condition'][_0x3979a6(0x1d2)]?.[_0x3979a6(0x1c8)]!==undefined;if(_0x4e3234){const _0x3c1795=[];_0x3c1795[_0x3979a6(0x1db)]({'id':generateUUID(),'segmentId':_0x1df5c3,'timedOutPath':![],'name':'Met\x20condition(s)','next':_0x520894(_0x22d37e['condition'][_0x3979a6(0x1c8)]??_0x38c715[_0x3979a6(0x1c8)])});if(_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x1d2)]){const _0x28d0cc=_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x1d2)][_0x3979a6(0x1ce)],_0x5e741a=normalizeWaitUnit(_0x22d37e[_0x3979a6(0x1b0)]['timeout'][_0x3979a6(0x1bc)]);_0x3c1795[_0x3979a6(0x1db)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x3979a6(0x20d)+_0x28d0cc+'\x20'+_0x5e741a,'moveAfter':_0x28d0cc,'unit':_0x5e741a,'next':_0x520894(_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x1d2)]['next'])});}_0x5c7e7b['conditions']=_0x3c1795,delete _0x5c7e7b[_0x3979a6(0x1c8)];}else _0x5c7e7b[_0x3979a6(0x211)]=_0x1df5c3,_0x22d37e[_0x3979a6(0x1b0)]['timeout']&&(_0x5c7e7b['conditionTimeoutDuration']=_0x22d37e['condition'][_0x3979a6(0x1d2)][_0x3979a6(0x1ce)],_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x1d2)][_0x3979a6(0x1bc)]&&(_0x5c7e7b[_0x3979a6(0x1a9)]=normalizeWaitUnit(_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x1d2)]['unit'])));}}}}return _0x5c7e7b;}case _0x3979a6(0x1c5):{const _0x3da1bb=_0x3b8c64,_0x5e986e=_0x3da1bb['with'][_0x3979a6(0x1c5)],_0x21ee48=await _0x2924a6(_0x5e986e);return{'type':_0x3979a6(0x1a0),'name':_0x3da1bb[_0x3979a6(0x1de)],'journeyActivationStepId':_0x21ee48,'next':_0x520894(_0x3da1bb[_0x3979a6(0x1c8)])};}case _0x3979a6(0x1c3):{const _0x5f1a97=_0x3b8c64,_0x534328=_0x5f1a97[_0x3979a6(0x1b9)]['branches'];return{'type':_0x3979a6(0x1a2),'name':_0x5f1a97[_0x3979a6(0x1de)],'branches':await Promise[_0x3979a6(0x1ac)](_0x534328[_0x3979a6(0x217)](async _0x41029f=>{const _0x8a62fd=_0x3979a6;let _0x703ab6='';if(!_0x41029f[_0x8a62fd(0x185)]){const _0x5b00d6=_0x41029f['segment']||_0x41029f[_0x8a62fd(0x1e2)]||'';_0x703ab6=_0x5b00d6?await _0x5da310(_0x5b00d6):'';}return{'id':crypto[_0x8a62fd(0x208)](),'name':_0x41029f['name'],'description':null,'segmentId':_0x703ab6,'excludedPath':_0x41029f[_0x8a62fd(0x185)]??![],'next':_0x520894(_0x41029f[_0x8a62fd(0x1c8)])};})),'next':_0x520894(_0x5f1a97[_0x3979a6(0x1c8)])};}case _0x3979a6(0x201):{const _0x96ca0d=_0x3b8c64,_0x2f0d2f=_0x96ca0d[_0x3979a6(0x1b9)];return{'type':_0x3979a6(0x1c2),'name':_0x96ca0d[_0x3979a6(0x1de)],'customizedSplit':_0x2f0d2f[_0x3979a6(0x179)],'uniqueId':_0x2f0d2f[_0x3979a6(0x1f5)],'variants':_0x2f0d2f[_0x3979a6(0x187)][_0x3979a6(0x217)](_0x4ce791=>({'id':_0x4ce791['id']||generateUUID(),'name':_0x4ce791[_0x3979a6(0x1de)],'percentage':_0x4ce791['percentage'],'next':_0x520894(_0x4ce791['next'])})),'next':_0x520894(_0x96ca0d[_0x3979a6(0x1c8)])};}case _0x3979a6(0x1c4):return{'type':_0x3979a6(0x19d),'name':_0x3b8c64[_0x3979a6(0x1de)],'next':_0x520894(_0x3b8c64[_0x3979a6(0x1c8)])};case _0x3979a6(0x192):{const _0x311115=_0x3b8c64,_0x1c9cd5=_0x311115[_0x3979a6(0x1b9)][_0x3979a6(0x18c)],_0x7cf944=_0x1c9cd5[_0x3979a6(0x19b)],_0x5e00da=_0x1c9cd5['stage'];let _0x1fe23e=_0x1c9cd5[_0x3979a6(0x19b)];_0x43ef3f?.[_0x3979a6(0x1b8)]&&!/^\d+$/['test'](_0x1fe23e)&&(_0x1fe23e=await _0x43ef3f[_0x3979a6(0x1b8)](_0x1fe23e));let _0x2fbf79=_0x1c9cd5['stage'];_0x43ef3f?.[_0x3979a6(0x16c)]&&!/^\d+$/['test'](_0x2fbf79)&&(_0x2fbf79=await _0x43ef3f[_0x3979a6(0x16c)](_0x1fe23e,_0x2fbf79));const _0x5eb4b5=!/^\d+$/[_0x3979a6(0x1df)](_0x7cf944)&&!isLocalJourneyRef(_0x7cf944)?formatApiJourneyName(_0x7cf944,_0x5e00da):undefined;return{'type':'Jump','name':_0x311115[_0x3979a6(0x1de)],'target':{'journeyId':_0x1fe23e,'journeyStageId':_0x2fbf79,'journeyBundleId':_0x1c9cd5[_0x3979a6(0x207)],'journeyName':_0x5eb4b5,'confirmed':!![]},'next':_0x520894(_0x311115[_0x3979a6(0x1c8)])};}case _0x3979a6(0x1bd):return{'type':_0x3979a6(0x1cc),'name':_0x3b8c64[_0x3979a6(0x1de)]};default:{const _0x53a486=_0x3b8c64;return{'type':_0x3979a6(0x1cc),'name':_0x53a486[_0x3979a6(0x1de)]};}}}export function toYamlString(_0x5f4690){const _0x546131=a147_0x156b,_0xfa6f15=stripInternalFields(_0x5f4690),_0x35c2c3=a147_0x1e9c98[_0x546131(0x1a8)](_0xfa6f15,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x546131(0x1b4)}),_0x1524dc=[_0x546131(0x16e),_0x546131(0x1ed),_0x546131(0x1ef),'reentry:',_0x546131(0x194),'stages:',_0x546131(0x1d5)];let _0x4d1e42=_0x35c2c3;for(const _0x150806 of _0x1524dc){_0x4d1e42=_0x4d1e42['replace'](new RegExp('^('+_0x150806+')','m'),(_0x203bac,_0x5cec96,_0x4d74c1)=>{if(_0x4d74c1===0x0||_0x4d1e42[_0x4d74c1-0x1]==='\x0a'&&_0x4d1e42[_0x4d74c1-0x2]==='\x0a')return _0x5cec96;return'\x0a'+_0x5cec96;});}return _0x4d1e42;}function stripInternalFields(_0x3f9ed8){const _0x2e7104=a147_0x156b,{id:_0xf191d0,folder_id:_0x1fbfe6,bundle_id:_0x2fd4dd,bundle_name:_0x501acf,version:_0x7b1260,allow_reentry:_0x4ebb9f,..._0x300ada}=_0x3f9ed8;return _0x300ada[_0x2e7104(0x1e7)]&&(_0x300ada['journeys']=_0x300ada[_0x2e7104(0x1e7)][_0x2e7104(0x217)](_0x57ce3e=>{const _0x169966=_0x2e7104,{id:_0x13bf3f,..._0x5841d8}=_0x57ce3e;return{..._0x5841d8,'stages':_0x5841d8[_0x169966(0x1d7)][_0x169966(0x217)](stripStageInternalFields),..._0x57ce3e[_0x169966(0x1ad)]===!![]?{'latest':!![]}:{},..._0x300ada['journeys'][_0x169966(0x1ab)]===0x1&&_0x5841d8[_0x169966(0x202)]==='v1'?{'version':undefined}:{}};})),_0x300ada[_0x2e7104(0x1d7)]&&(_0x300ada[_0x2e7104(0x1d7)]=_0x300ada['stages']['map'](stripStageInternalFields)),_0x300ada[_0x2e7104(0x21b)]&&(_0x300ada[_0x2e7104(0x21b)]=_0x300ada[_0x2e7104(0x21b)][_0x2e7104(0x217)](_0x41bd8e=>{const _0x452f90=_0x2e7104,{id:_0x31f047,..._0x552358}=_0x41bd8e;return{..._0x552358,'stages':_0x552358['stages'][_0x452f90(0x217)](stripStageInternalFields),..._0x41bd8e[_0x452f90(0x1ad)]===!![]?{'latest':!![]}:{}};})),_0x300ada;}function stripStageInternalFields(_0x3af5c1){const {id:_0x2046a2,..._0x41ae36}=_0x3af5c1;return _0x41ae36;}export function parseYamlString(_0x2e8ccc){return safeParseYaml(_0x2e8ccc,JourneyDefSchema);}export function isJourneyDef(_0x159fcc){const _0x2e5c75=a147_0x156b;return typeof _0x159fcc===_0x2e5c75(0x18d)&&_0x159fcc!==null&&_0x2e5c75(0x1dd)in _0x159fcc&&_0x159fcc[_0x2e5c75(0x1dd)]===_0x2e5c75(0x19b);}export function generateTemplate(_0x38bc85,_0x20355){const _0x3f00b7=a147_0x156b,_0x569220={'type':_0x3f00b7(0x19b),'name':_0x38bc85,'description':_0x3f00b7(0x190),'reentry':_0x3f00b7(0x1d8),'goal':{'name':'Goal\x20Achieved','segment':_0x3f00b7(0x195)},'stages':[{'name':_0x3f00b7(0x1e0),'description':_0x3f00b7(0x186),'entry_criteria':{'name':'Entry\x20Criteria','segment':_0x20355},'steps':[{'type':_0x3f00b7(0x1e8),'name':_0x3f00b7(0x17c),'with':{'duration':0x1,'unit':_0x3f00b7(0x171)}},{'type':_0x3f00b7(0x1c5),'name':_0x3f00b7(0x1f2),'with':{'activation':_0x3f00b7(0x1ae)}},{'type':'end','name':_0x3f00b7(0x1bf)}]}]};return toYamlString(_0x569220);}function generateUUID(){const _0xe87b56=a147_0x156b;return crypto[_0xe87b56(0x208)]();}export const SEGMENT_REF_PREFIX=a147_0x21078b(0x218);export function parseSegmentRef(_0xaa0607){const _0x49e0aa=a147_0x21078b;if(_0xaa0607[_0x49e0aa(0x220)](SEGMENT_REF_PREFIX))return{'type':_0x49e0aa(0x20c),'name':_0xaa0607['slice'](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/['test'](_0xaa0607))return{'type':'id','name':_0xaa0607};return{'type':_0x49e0aa(0x1f7),'name':_0xaa0607};}export function makeSegmentRef(_0x503129){return''+SEGMENT_REF_PREFIX+_0x503129;}export function isExternalSegmentRef(_0x16964e){const _0x546225=a147_0x21078b;return _0x16964e[_0x546225(0x220)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0xc4679f){const _0xcbb1cf=a147_0x21078b;return!!(_0xc4679f['journeys']&&_0xc4679f['journeys'][_0xcbb1cf(0x1ab)]>0x0);}export function isMultiVersionMode(_0x475a1a){const _0x1f42f6=a147_0x21078b;return!!(_0x475a1a[_0x1f42f6(0x21b)]&&_0x475a1a['versions'][_0x1f42f6(0x1ab)]>0x0);}export function isSingleVersionMode(_0x5c864d){const _0x3f1aaf=a147_0x21078b;return!!(_0x5c864d[_0x3f1aaf(0x1d7)]&&_0x5c864d['stages'][_0x3f1aaf(0x1ab)]>0x0);}export function hasMultipleVersions(_0xb8227a){const _0x382bd3=a147_0x21078b;if(isJourneysArrayMode(_0xb8227a))return(_0xb8227a[_0x382bd3(0x1e7)]?.[_0x382bd3(0x1ab)]||0x0)>0x1;if(isMultiVersionMode(_0xb8227a))return(_0xb8227a[_0x382bd3(0x21b)]?.[_0x382bd3(0x1ab)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x3ed851){const _0x39a6a6=a147_0x21078b;if(isJourneysArrayMode(_0x3ed851))return _0x3ed851;if(isSingleVersionMode(_0x3ed851)){const {stages:_0x45b298,id:_0x325707,version:_0x33f739,version_number:_0x6c3831,..._0x351169}=_0x3ed851;return{..._0x351169,'journeys':[{'version':_0x33f739||'v1','stages':_0x45b298||[],'id':_0x325707,'version_number':_0x6c3831}]};}if(isMultiVersionMode(_0x3ed851)){const {versions:_0x29c09e,..._0x3abee6}=_0x3ed851;return{..._0x3abee6,'journeys':(_0x29c09e||[])[_0x39a6a6(0x217)](_0x2b062d=>({'version':_0x2b062d['name'],'state':_0x2b062d['state'],'latest':_0x2b062d[_0x39a6a6(0x1ad)],'stages':_0x2b062d[_0x39a6a6(0x1d7)],'id':_0x2b062d['id'],'version_number':_0x2b062d['version_number']}))};}return _0x3ed851;}export function normalizeJourneyDef(_0x5e1d83,_0xce0d5d){const _0x287eec=a147_0x21078b,_0xc1516e=normalizeToJourneysFormat(_0x5e1d83),_0x5b5d8e=_0xce0d5d?.['segments']?Object[_0x287eec(0x193)](_0xce0d5d[_0x287eec(0x1e9)]):undefined,_0x5868e6=_0xce0d5d?.[_0x287eec(0x19f)]?Object[_0x287eec(0x193)](_0xce0d5d['activations']):undefined;return{'type':'journey','name':_0xc1516e[_0x287eec(0x1de)],..._0xc1516e[_0x287eec(0x1b5)]!==undefined&&{'description':_0xc1516e[_0x287eec(0x1b5)]},..._0xc1516e[_0x287eec(0x21f)]&&{'goal':normalizeJourneyCriteria(_0xc1516e[_0x287eec(0x21f)])},..._0xc1516e[_0x287eec(0x21c)]!==undefined&&{'reentry':_0xc1516e[_0x287eec(0x21c)]},..._0xc1516e['segments']&&{'segments':normalizeEmbeddedSegments(_0xc1516e[_0x287eec(0x1e9)],_0x5b5d8e)},..._0xc1516e[_0x287eec(0x19f)]&&{'activations':normalizeEmbeddedActivations(_0xc1516e[_0x287eec(0x19f)],_0x5868e6)},..._0xc1516e[_0x287eec(0x1e7)]&&{'journeys':_0xc1516e[_0x287eec(0x1e7)][_0x287eec(0x217)](_0x3e95f3=>normalizeJourneyEntry(_0x3e95f3,_0xc1516e['journeys'][_0x287eec(0x1ab)]===0x1))}};}function a147_0x1b2a(){const _0x223860=['replace','Merge','parentFolder','activations','Activation','get','DecisionPoint','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','timedOutPath','resolveActivation','allowReentry','customizedSplit','stringify','conditionTimeoutUnit','conditions','length','all','latest','your-activation-name','notification','condition','attributes','AbTest','rule','null','description','reentryMode','all_columns','resolveJourneyId','with','exitCriterias','waitStepUnit','unit','end','DaysOfTheWeek','Stage\x20Complete','71541JvJRqj','Duration','ABTest','decision_point','merge','activation','weeks','schedule','next','rootStep','304025ekxDOo','uniqueId','End','resolveActivationId','duration','moveAfter','7qnRyWY','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','timeout','entry_criteria','2968SfUlWf','versions:','toLowerCase','stages','no_reentry','set','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','push','entries','type','name','test','Stage\x201','(missing)','segment_id','journeyName','milestone','has','Expected\x20format:\x0a','journeys','wait','segments','resolveSegmentName','Condition','version_number','activations:','branches','goal:','waitUntilDate','\x20\x20\x20\x20conditions:\x0a','Send\x20Notification','isArray','\x20\x20rule:\x0a','unique_id','reentry_always','embedded','resolveEmbeddedActivationId','\x27.\x0a','journeyStages','10805600jXBJls','journeyBundleName','540397nZmjSA','activation_template_id','\x20\x20\x20\x20type:\x20And\x0a','7238298ynxtRY','ab_test','version','shift','segment','Date','resolveSegmentId','bundle_id','randomUUID','bundle_name','entryCriteria','45032bQgHQI','ref','*Max\x20wait\x20','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','state','resolveActivationName','conditionSegmentId','includes','days_of_week','sort','WaitStep','stageId','map','ref:','\x27:\x20','journeyId','versions','reentry','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','wait_until','goal','startsWith','connector_config','447eJdfke','resolveSegment','daysOfWeek','journeyBundleId','resolveJumpTarget','resolveStageId','add','segments:','waitStep','\x20\x20\x20\x20type:\x20','day','filter','559IPSFOD','relationships','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','launched','40jcTcRm','columns','customized_split','size','waitStepType','Wait\x201\x20Day','behavior','folder_id','steps','definition','data','876oQzZrZ','week','uuid','excluded','First\x20stage\x20of\x20the\x20journey','variants','stage','journeyStageId','segmentId','waitCondition','target','object','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','exit_criteria','Journey\x20description','stageName','jump','keys','journeys:','goal-segment','journeyActivationStepId','find','root_step','trim','resolveEmbeddedSegmentId','journey'];a147_0x1b2a=function(){return _0x223860;};return a147_0x1b2a();}function normalizeJourneyEntry(_0x4d4529,_0x7313db){const _0x2bb6ef=a147_0x21078b;return{...!_0x7313db&&_0x4d4529[_0x2bb6ef(0x202)]!==undefined&&{'version':_0x4d4529[_0x2bb6ef(0x202)]},..._0x4d4529[_0x2bb6ef(0x20f)]!==undefined&&{'state':_0x4d4529[_0x2bb6ef(0x20f)]},...!_0x7313db&&_0x4d4529[_0x2bb6ef(0x1ad)]!==undefined&&{'latest':_0x4d4529['latest']},..._0x4d4529[_0x2bb6ef(0x1ec)]!==undefined&&{'version_number':_0x4d4529['version_number']},..._0x4d4529[_0x2bb6ef(0x21f)]&&{'goal':normalizeJourneyCriteria(_0x4d4529['goal'])},..._0x4d4529[_0x2bb6ef(0x21c)]!==undefined&&{'reentry':_0x4d4529[_0x2bb6ef(0x21c)]},'stages':_0x4d4529[_0x2bb6ef(0x1d7)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0xf0eff6){const _0xd26428=a147_0x21078b;return{'name':_0xf0eff6['name'],..._0xf0eff6[_0xd26428(0x1b5)]!==undefined&&{'description':_0xf0eff6[_0xd26428(0x1b5)]},..._0xf0eff6['entry_criteria']&&{'entry_criteria':normalizeJourneyCriteria(_0xf0eff6[_0xd26428(0x1d3)])},..._0xf0eff6[_0xd26428(0x18f)]&&{'exit_criteria':_0xf0eff6[_0xd26428(0x18f)][_0xd26428(0x217)](normalizeJourneyCriteria)},..._0xf0eff6[_0xd26428(0x1e4)]&&{'milestone':normalizeJourneyCriteria(_0xf0eff6[_0xd26428(0x1e4)])},..._0xf0eff6[_0xd26428(0x17f)]&&{'steps':normalizeStepsWithImplicitNext(_0xf0eff6[_0xd26428(0x17f)])}};}function normalizeStepsWithImplicitNext(_0x4fbd61){return _0x4fbd61['map']((_0x26cc87,_0x5acc04)=>{const _0x15622d=a147_0x156b,_0xb0700e=_0x5acc04<_0x4fbd61[_0x15622d(0x1ab)]-0x1?_0x4fbd61[_0x5acc04+0x1][_0x15622d(0x1de)]:undefined;return normalizeJourneyStep(_0x26cc87,_0xb0700e);});}function normalizeJourneyCriteria(_0x149b6b){const _0x5c7169=a147_0x21078b;return{'name':_0x149b6b[_0x5c7169(0x1de)],..._0x149b6b['description']!==undefined&&{'description':_0x149b6b['description']},'segment':_0x149b6b[_0x5c7169(0x204)],..._0x149b6b[_0x5c7169(0x18c)]&&{'target':normalizeJumpTarget(_0x149b6b[_0x5c7169(0x18c)])}};}function normalizeJourneyStep(_0x5e2aa7,_0x3a39dc){const _0x29eb74=a147_0x21078b,_0x294d9d=_0x5e2aa7[_0x29eb74(0x1c8)]!==undefined&&_0x5e2aa7[_0x29eb74(0x1c8)]!==_0x3a39dc,_0x22964e={'type':_0x5e2aa7['type'],'name':_0x5e2aa7[_0x29eb74(0x1de)],..._0x294d9d&&{'next':_0x5e2aa7[_0x29eb74(0x1c8)]}};if('with'in _0x5e2aa7&&_0x5e2aa7[_0x29eb74(0x1b9)])return{..._0x22964e,'with':normalizeStepParams(_0x5e2aa7[_0x29eb74(0x1dd)],_0x5e2aa7['with'])};return _0x22964e;}function normalizeStepParams(_0x318250,_0x5bb963){const _0x38883d=a147_0x21078b;switch(_0x318250){case _0x38883d(0x1e8):{const _0x4b6bf3=_0x5bb963;let _0x611df0;return _0x4b6bf3['condition']&&(_0x611df0={'segment':_0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x204)],..._0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1c8)]!==undefined&&{'next':_0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1c8)]},..._0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1d2)]&&{'timeout':{'duration':_0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1d2)][_0x38883d(0x1ce)],'unit':_0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1d2)][_0x38883d(0x1bc)],..._0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1d2)][_0x38883d(0x1c8)]!==undefined&&{'next':_0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1d2)]['next']}}}}),{..._0x4b6bf3[_0x38883d(0x1ce)]!==undefined&&{'duration':_0x4b6bf3[_0x38883d(0x1ce)]},..._0x4b6bf3['unit']!==undefined&&{'unit':_0x4b6bf3[_0x38883d(0x1bc)]},..._0x4b6bf3['wait_until']!==undefined&&{'wait_until':_0x4b6bf3[_0x38883d(0x21e)]},..._0x4b6bf3[_0x38883d(0x213)]!==undefined&&{'days_of_week':_0x4b6bf3[_0x38883d(0x213)]},..._0x611df0&&{'condition':_0x611df0}};}case _0x38883d(0x1c5):{const _0x254acd=_0x5bb963;return{'activation':_0x254acd[_0x38883d(0x1c5)]};}case _0x38883d(0x1c3):{const _0x3a5d5a=_0x5bb963;return{'branches':_0x3a5d5a[_0x38883d(0x1ee)][_0x38883d(0x217)](normalizeDecisionBranch)};}case'ab_test':{const _0x70cbc7=_0x5bb963;return{..._0x70cbc7['customized_split']!==undefined&&{'customized_split':_0x70cbc7[_0x38883d(0x179)]},..._0x70cbc7[_0x38883d(0x1f5)]!==undefined&&{'unique_id':_0x70cbc7[_0x38883d(0x1f5)]},'variants':_0x70cbc7[_0x38883d(0x187)][_0x38883d(0x217)](normalizeAbTestVariant)};}case'jump':{const _0x1f8b9a=_0x5bb963;return{'target':normalizeJumpTarget(_0x1f8b9a['target'])};}default:return _0x5bb963;}}function normalizeDecisionBranch(_0x57c917){const _0x128e3=a147_0x21078b;return{'name':_0x57c917['name'],..._0x57c917['segment']!==undefined&&{'segment':_0x57c917[_0x128e3(0x204)]},..._0x57c917['excluded']!==undefined&&{'excluded':_0x57c917[_0x128e3(0x185)]},..._0x57c917[_0x128e3(0x1c8)]!==undefined&&{'next':_0x57c917[_0x128e3(0x1c8)]}};}function normalizeAbTestVariant(_0x42c20b){const _0x3495e1=a147_0x21078b;return{..._0x42c20b['id']!==undefined&&{'id':_0x42c20b['id']},'name':_0x42c20b[_0x3495e1(0x1de)],'percentage':_0x42c20b['percentage'],..._0x42c20b[_0x3495e1(0x1c8)]!==undefined&&{'next':_0x42c20b[_0x3495e1(0x1c8)]}};}function normalizeJumpTarget(_0x464e4c){const _0x58c14c=a147_0x21078b;return{'journey':_0x464e4c[_0x58c14c(0x19b)],'stage':_0x464e4c['stage'],..._0x464e4c['bundle_id']!==undefined&&{'bundle_id':_0x464e4c[_0x58c14c(0x207)]}};}function normalizeEmbeddedSegments(_0x151609,_0x16abf2){const _0x53479b=a147_0x21078b,_0x2dc680={},_0x4acd93=Object[_0x53479b(0x193)](_0x151609),_0xef854=_0x16abf2?[..._0x16abf2[_0x53479b(0x172)](_0x34c9a9=>_0x4acd93[_0x53479b(0x212)](_0x34c9a9)),..._0x4acd93['filter'](_0x1e3ee8=>!_0x16abf2[_0x53479b(0x212)](_0x1e3ee8))['sort']()]:_0x4acd93['sort']();for(const _0x5284ad of _0xef854){const _0x41710d=_0x151609[_0x5284ad];if(_0x41710d['rule']){const _0x4b76cc=_0x41710d[_0x53479b(0x1b3)];if(_0x4b76cc[_0x53479b(0x1dd)]!=='And'&&_0x4b76cc['type']!=='Or'){const _0x587d93=_0x4b76cc['type']??_0x53479b(0x1e1);throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x53479b(0x1a3)+_0x5284ad+_0x53479b(0x219)+(_0x53479b(0x1da)+_0x587d93+_0x53479b(0x1f9))+_0x53479b(0x1e6)+_0x53479b(0x1f4)+_0x53479b(0x1ff)+_0x53479b(0x1f1)+_0x53479b(0x18e)+_0x53479b(0x21d)+_0x53479b(0x20e));}if(!_0x4b76cc[_0x53479b(0x1aa)]||!Array['isArray'](_0x4b76cc[_0x53479b(0x1aa)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x53479b(0x1a3)+_0x5284ad+_0x53479b(0x219)+_0x53479b(0x175)+_0x53479b(0x1e6)+_0x53479b(0x1f4)+(_0x53479b(0x170)+_0x4b76cc[_0x53479b(0x1dd)]+'\x0a')+'\x20\x20\x20\x20conditions:\x0a'+_0x53479b(0x18e)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x53479b(0x20e));}_0x2dc680[_0x5284ad]={..._0x41710d[_0x53479b(0x1b5)]&&_0x41710d['description'][_0x53479b(0x199)]()&&{'description':_0x41710d[_0x53479b(0x1b5)]},..._0x41710d[_0x53479b(0x1b3)]&&{'rule':deepSortObject(_0x41710d[_0x53479b(0x1b3)])}};}return _0x2dc680;}function normalizeEmbeddedActivations(_0x15a2d6,_0x2af66c){const _0x504529=a147_0x21078b,_0x50b692={},_0x18da7e=Object[_0x504529(0x193)](_0x15a2d6),_0x20b2d3=_0x2af66c?[..._0x2af66c[_0x504529(0x172)](_0x1108ac=>_0x18da7e[_0x504529(0x212)](_0x1108ac)),..._0x18da7e[_0x504529(0x172)](_0x39c6b7=>!_0x2af66c['includes'](_0x39c6b7))['sort']()]:_0x18da7e[_0x504529(0x214)]();for(const _0x5ab496 of _0x20b2d3){const _0x1af6f4=_0x15a2d6[_0x5ab496];_0x50b692[_0x5ab496]={'name':_0x1af6f4['name'],'connection':_0x1af6f4['connection'],..._0x1af6f4[_0x504529(0x1b5)]!==undefined&&{'description':_0x1af6f4[_0x504529(0x1b5)]},..._0x1af6f4[_0x504529(0x1b7)]!==undefined&&{'all_columns':_0x1af6f4[_0x504529(0x1b7)]},..._0x1af6f4[_0x504529(0x178)]!==undefined&&{'columns':_0x1af6f4[_0x504529(0x178)]},..._0x1af6f4[_0x504529(0x17d)]!==undefined&&{'behavior':_0x1af6f4[_0x504529(0x17d)]},..._0x1af6f4[_0x504529(0x1c7)]!==undefined&&{'schedule':_0x1af6f4[_0x504529(0x1c7)]},..._0x1af6f4[_0x504529(0x1af)]!==undefined&&{'notification':_0x1af6f4[_0x504529(0x1af)]},..._0x1af6f4[_0x504529(0x221)]!==undefined&&{'connector_config':_0x1af6f4[_0x504529(0x221)]},..._0x1af6f4[_0x504529(0x1fe)]!==undefined&&{'activation_template_id':_0x1af6f4[_0x504529(0x1fe)]}};}return _0x50b692;}export function getActiveStages(_0x32a7de){const _0x28cc41=a147_0x21078b;if(isJourneysArrayMode(_0x32a7de)){const _0x20b70b=_0x32a7de[_0x28cc41(0x1e7)]||[],_0x1868b6=_0x20b70b[_0x28cc41(0x197)](_0x43a216=>_0x43a216[_0x28cc41(0x1ad)]===!![])||_0x20b70b[0x0];return _0x1868b6?.[_0x28cc41(0x1d7)]||[];}if(isSingleVersionMode(_0x32a7de))return _0x32a7de['stages']||[];if(isMultiVersionMode(_0x32a7de)){const _0x397731=_0x32a7de[_0x28cc41(0x21b)]||[],_0x5d1b42=_0x397731[_0x28cc41(0x197)](_0x114e6e=>_0x114e6e[_0x28cc41(0x1ad)]===!![])||_0x397731[0x0];return _0x5d1b42?.[_0x28cc41(0x1d7)]||[];}return[];}export function getLatestJourneyEntry(_0x4f3fc3){const _0x3f7c1b=a147_0x21078b;if(isJourneysArrayMode(_0x4f3fc3)){const _0x1913b1=_0x4f3fc3[_0x3f7c1b(0x1e7)]||[];return _0x1913b1[_0x3f7c1b(0x197)](_0x93ff18=>_0x93ff18[_0x3f7c1b(0x1ad)]===!![])||_0x1913b1[0x0];}if(isMultiVersionMode(_0x4f3fc3)){const _0x1ad8e7=_0x4f3fc3[_0x3f7c1b(0x21b)]||[],_0x46fad9=_0x1ad8e7[_0x3f7c1b(0x197)](_0x19a47a=>_0x19a47a[_0x3f7c1b(0x1ad)]===!![])||_0x1ad8e7[0x0];if(_0x46fad9)return{'version':_0x46fad9['name'],'state':_0x46fad9[_0x3f7c1b(0x20f)],'latest':_0x46fad9['latest'],'stages':_0x46fad9[_0x3f7c1b(0x1d7)],'id':_0x46fad9['id'],'version_number':_0x46fad9[_0x3f7c1b(0x1ec)]};}if(isSingleVersionMode(_0x4f3fc3))return{'version':_0x4f3fc3[_0x3f7c1b(0x202)]||'v1','state':'draft','stages':_0x4f3fc3[_0x3f7c1b(0x1d7)]||[],'id':_0x4f3fc3['id'],'version_number':_0x4f3fc3[_0x3f7c1b(0x1ec)],'goal':_0x4f3fc3[_0x3f7c1b(0x21f)],'reentry':_0x4f3fc3[_0x3f7c1b(0x21c)]};return undefined;}export function getLatestVersion(_0x4d0489){const _0x7d3829=a147_0x21078b;if(!isMultiVersionMode(_0x4d0489))return undefined;const _0x3db89f=_0x4d0489[_0x7d3829(0x21b)]||[];return _0x3db89f[_0x7d3829(0x197)](_0x1c4845=>_0x1c4845[_0x7d3829(0x1ad)]===!![])||_0x3db89f[0x0];}function a147_0x156b(_0x87e820,_0x5bac62){_0x87e820=_0x87e820-0x16c;const _0x1b2ac5=a147_0x1b2a();let _0x156b1c=_0x1b2ac5[_0x87e820];return _0x156b1c;}export function getEffectiveGoal(_0x1e6619){const _0x4d1380=a147_0x21078b,_0xf5231b=getLatestJourneyEntry(_0x1e6619);return _0xf5231b?.[_0x4d1380(0x21f)]||_0x1e6619[_0x4d1380(0x21f)];}export function getEffectiveReentry(_0x55fdc7){const _0x3e043a=a147_0x21078b,_0x26d5fd=getLatestJourneyEntry(_0x55fdc7);return _0x26d5fd?.[_0x3e043a(0x21c)]||_0x55fdc7[_0x3e043a(0x21c)];}export function collectSegmentRefs(_0x18237d){const _0x5c4bfc=a147_0x21078b,_0x2d065a=new Set();_0x18237d['goal']?.[_0x5c4bfc(0x204)]&&_0x2d065a[_0x5c4bfc(0x16d)](_0x18237d[_0x5c4bfc(0x21f)][_0x5c4bfc(0x204)]);const _0x579255=_0x56eed0=>{const _0x4c46a0=_0x5c4bfc;for(const _0x30940a of _0x56eed0){_0x30940a[_0x4c46a0(0x1d3)]?.['segment']&&_0x2d065a[_0x4c46a0(0x16d)](_0x30940a[_0x4c46a0(0x1d3)]['segment']);if(_0x30940a['exit_criteria'])for(const _0x21f28e of _0x30940a[_0x4c46a0(0x18f)]){_0x21f28e[_0x4c46a0(0x204)]&&_0x2d065a[_0x4c46a0(0x16d)](_0x21f28e[_0x4c46a0(0x204)]);}_0x30940a[_0x4c46a0(0x1e4)]?.[_0x4c46a0(0x204)]&&_0x2d065a['add'](_0x30940a[_0x4c46a0(0x1e4)][_0x4c46a0(0x204)]);if(_0x30940a[_0x4c46a0(0x17f)])for(const _0x318839 of _0x30940a[_0x4c46a0(0x17f)]){if(_0x318839[_0x4c46a0(0x1dd)]===_0x4c46a0(0x1c3)){const _0x3ab993=_0x318839;for(const _0x4a338c of _0x3ab993[_0x4c46a0(0x1b9)]['branches']){_0x4a338c[_0x4c46a0(0x204)]&&_0x2d065a[_0x4c46a0(0x16d)](_0x4a338c['segment']);}}else{if(_0x318839[_0x4c46a0(0x1dd)]===_0x4c46a0(0x1e8)){const _0x1d00dd=_0x318839;_0x1d00dd[_0x4c46a0(0x1b9)][_0x4c46a0(0x1b0)]?.[_0x4c46a0(0x204)]&&_0x2d065a[_0x4c46a0(0x16d)](_0x1d00dd[_0x4c46a0(0x1b9)][_0x4c46a0(0x1b0)]['segment']);}}}}};_0x18237d[_0x5c4bfc(0x1d7)]&&_0x579255(_0x18237d['stages']);if(_0x18237d[_0x5c4bfc(0x21b)])for(const _0xb84901 of _0x18237d[_0x5c4bfc(0x21b)]){_0x579255(_0xb84901['stages']);}return _0x2d065a;}export function validateSegmentRefs(_0x334bfd){const _0x24a19b=a147_0x21078b,_0x551617=[],_0x13eed4=collectSegmentRefs(_0x334bfd),_0x5db76f=new Set(Object[_0x24a19b(0x193)](_0x334bfd[_0x24a19b(0x1e9)]||{}));for(const _0xf54074 of _0x13eed4){const _0x303faa=parseSegmentRef(_0xf54074);_0x303faa[_0x24a19b(0x1dd)]==='embedded'&&!_0x5db76f[_0x24a19b(0x1e5)](_0x303faa[_0x24a19b(0x1de)])&&_0x551617[_0x24a19b(0x1db)]('Unknown\x20segment\x20\x22'+_0x303faa['name']+_0x24a19b(0x1d1)+_0x303faa[_0x24a19b(0x1de)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0x551617;}export function collectSegmentIdsFromJourneyApi(_0x4534f8){const _0x4c4992=a147_0x21078b,_0x5a8a4d=new Set();_0x4534f8[_0x4c4992(0x1b1)][_0x4c4992(0x21f)]?.[_0x4c4992(0x18a)]&&_0x5a8a4d[_0x4c4992(0x16d)](_0x4534f8[_0x4c4992(0x1b1)]['goal'][_0x4c4992(0x18a)]);const _0x27cd38=_0x4534f8[_0x4c4992(0x1b1)][_0x4c4992(0x1fa)];if(Array[_0x4c4992(0x1f3)](_0x27cd38))for(const _0x4b28a5 of _0x27cd38){_0x4b28a5[_0x4c4992(0x20a)]?.[_0x4c4992(0x18a)]&&_0x5a8a4d['add'](_0x4b28a5[_0x4c4992(0x20a)][_0x4c4992(0x18a)]);const _0x363f73=_0x4b28a5['exitCriterias']??_0x4b28a5['exitCriteria'];if(Array[_0x4c4992(0x1f3)](_0x363f73))for(const _0x464860 of _0x363f73){_0x464860[_0x4c4992(0x18a)]&&_0x5a8a4d[_0x4c4992(0x16d)](_0x464860[_0x4c4992(0x18a)]);}_0x4b28a5['milestone']?.[_0x4c4992(0x18a)]&&_0x5a8a4d[_0x4c4992(0x16d)](_0x4b28a5['milestone'][_0x4c4992(0x18a)]);if(_0x4b28a5[_0x4c4992(0x17f)]&&typeof _0x4b28a5[_0x4c4992(0x17f)]===_0x4c4992(0x18d)){const _0x3096f4=Array[_0x4c4992(0x1f3)](_0x4b28a5[_0x4c4992(0x17f)])?_0x4b28a5['steps']:Object['values'](_0x4b28a5[_0x4c4992(0x17f)]);for(const _0x3aaa7e of _0x3096f4){_0x3aaa7e['waitCondition']?.[_0x4c4992(0x18a)]&&_0x5a8a4d[_0x4c4992(0x16d)](_0x3aaa7e[_0x4c4992(0x18b)]['segmentId']);const _0x16ee0b=_0x3aaa7e;_0x16ee0b[_0x4c4992(0x211)]&&_0x5a8a4d['add'](_0x16ee0b[_0x4c4992(0x211)]);if(Array[_0x4c4992(0x1f3)](_0x16ee0b['conditions']))for(const _0x12aa6b of _0x16ee0b[_0x4c4992(0x1aa)]){_0x12aa6b[_0x4c4992(0x18a)]&&_0x5a8a4d[_0x4c4992(0x16d)](_0x12aa6b['segmentId']);}if(Array['isArray'](_0x3aaa7e['branches']))for(const _0x5c07c4 of _0x3aaa7e[_0x4c4992(0x1ee)]){_0x5c07c4['segmentId']&&_0x5a8a4d['add'](_0x5c07c4[_0x4c4992(0x18a)]);}}}}return _0x5a8a4d;}
1
+ (function(_0x15e6b6,_0x280786){const _0x1f50c1=a147_0x29fd,_0x19e888=_0x15e6b6();while(!![]){try{const _0x3dae01=parseInt(_0x1f50c1(0xf2))/0x1*(-parseInt(_0x1f50c1(0x15e))/0x2)+-parseInt(_0x1f50c1(0x17f))/0x3*(-parseInt(_0x1f50c1(0xc8))/0x4)+-parseInt(_0x1f50c1(0x112))/0x5*(parseInt(_0x1f50c1(0xeb))/0x6)+-parseInt(_0x1f50c1(0x147))/0x7+parseInt(_0x1f50c1(0x119))/0x8+parseInt(_0x1f50c1(0xff))/0x9+-parseInt(_0x1f50c1(0x138))/0xa;if(_0x3dae01===_0x280786)break;else _0x19e888['push'](_0x19e888['shift']());}catch(_0x586f01){_0x19e888['push'](_0x19e888['shift']());}}}(a147_0x187a,0xd84b3));import*as a147_0x57e329 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(_0x3671d3){const _0x304b43=a147_0x29fd,_0x575f98=_0x3671d3[_0x304b43(0x159)]();if(_0x575f98===_0x304b43(0xf0)||_0x575f98===_0x304b43(0x134))return _0x304b43(0x134);if(_0x575f98==='weeks'||_0x575f98===_0x304b43(0x120))return'week';return _0x3671d3;}export function journeyResponseToDefSync(_0x284175){const _0x5db161=a147_0x29fd,_0x36be56=_0x284175[_0x5db161(0xd9)],_0x5b9a2e=_0x36be56['journeyBundleName']||_0x36be56[_0x5db161(0x123)],_0x587c92={'stages':_0x36be56['journeyStages'][_0x5db161(0xdd)](convertApiStageToYaml),'id':_0x284175['id']};_0x36be56[_0x5db161(0x10c)]&&(_0x587c92[_0x5db161(0x10c)]=convertApiCriteriaToYaml(_0x36be56[_0x5db161(0x10c)]));_0x36be56[_0x5db161(0x123)]&&_0x36be56[_0x5db161(0x123)]!==_0x5b9a2e&&(_0x587c92[_0x5db161(0x118)]=_0x36be56[_0x5db161(0x123)]);_0x36be56['versionNumber']!==undefined&&(_0x587c92[_0x5db161(0x169)]=_0x36be56['versionNumber']);_0x36be56[_0x5db161(0xd1)]&&(_0x587c92[_0x5db161(0xd1)]=_0x36be56['state']===_0x5db161(0x167)?'launched':_0x5db161(0x170));const _0x3c9097={'type':_0x5db161(0xf4),'name':_0x5b9a2e,'journeys':[_0x587c92]};_0x36be56['description']&&(_0x3c9097['description']=_0x36be56[_0x5db161(0x156)]);_0x36be56[_0x5db161(0x10c)]&&(_0x3c9097['goal']=convertApiCriteriaToYaml(_0x36be56[_0x5db161(0x10c)]));if(_0x36be56[_0x5db161(0x132)])_0x3c9097['reentry']=_0x36be56['reentryMode'];else _0x36be56[_0x5db161(0x146)]!==undefined&&(_0x3c9097[_0x5db161(0x106)]=_0x36be56[_0x5db161(0x146)]?_0x5db161(0x168):_0x5db161(0x109));return _0x36be56[_0x5db161(0xfb)]&&(_0x3c9097['bundle_id']=_0x36be56[_0x5db161(0xfb)]),_0x36be56[_0x5db161(0x127)]&&(_0x3c9097[_0x5db161(0xf7)]=_0x36be56[_0x5db161(0x127)]),_0x284175[_0x5db161(0x17c)]?.['parentFolder']?.[_0x5db161(0x113)]?.['id']&&(_0x3c9097['folder_id']=_0x284175[_0x5db161(0x17c)][_0x5db161(0x143)][_0x5db161(0x113)]['id']),_0x3c9097;}export async function journeyResponseToDef(_0x5efb9e,_0x17120e){const _0x228e57=a147_0x29fd,_0x497b90=journeyResponseToDefSync(_0x5efb9e);if(!_0x17120e)return _0x497b90;const _0xb6fb60=new Set();collectSegmentIdsFromJourney(_0x497b90,_0xb6fb60);const _0x368501=new Set();collectActivationIdsFromJourney(_0x497b90,_0x368501);const _0x5e727f={},_0x327fdc=new Map();for(const _0x4b89f6 of Array[_0x228e57(0x125)](_0xb6fb60)[_0x228e57(0x158)]()){if(_0x17120e[_0x228e57(0xdb)]){const _0x39c823=await _0x17120e['resolveSegment'](_0x4b89f6);if(_0x39c823['isJourneyLocal']){_0x327fdc['set'](_0x4b89f6,_0x39c823[_0x228e57(0x123)]);if(_0x39c823[_0x228e57(0x15b)]){const _0x4025cb={..._0x39c823[_0x228e57(0x15b)],'rule':deepSortObject(_0x39c823[_0x228e57(0x15b)]['rule'])};_0x5e727f[_0x39c823[_0x228e57(0x123)]]=_0x4025cb;}}else _0x327fdc[_0x228e57(0x161)](_0x4b89f6,makeSegmentRef(_0x39c823[_0x228e57(0x123)]));}else{if(_0x17120e[_0x228e57(0x149)]){const _0x26e0c5=await _0x17120e['resolveSegmentName'](_0x4b89f6);_0x327fdc[_0x228e57(0x161)](_0x4b89f6,_0x26e0c5);}}}const _0x116955={},_0x30d328=new Map();for(const _0x246c80 of Array[_0x228e57(0x125)](_0x368501)[_0x228e57(0x158)]()){if(_0x17120e[_0x228e57(0x136)]){const _0x4c2f84=await _0x17120e[_0x228e57(0x136)](_0x246c80);_0x4c2f84[_0x228e57(0xf5)]?(_0x30d328[_0x228e57(0x161)](_0x246c80,_0x4c2f84[_0x228e57(0x123)]),_0x4c2f84[_0x228e57(0x15b)]&&(_0x116955[_0x4c2f84[_0x228e57(0x123)]]=_0x4c2f84['definition'])):_0x30d328[_0x228e57(0x161)](_0x246c80,makeSegmentRef(_0x4c2f84[_0x228e57(0x123)]));}else{if(_0x17120e[_0x228e57(0x11a)]){const _0x30248d=await _0x17120e[_0x228e57(0x11a)](_0x246c80);_0x30d328[_0x228e57(0x161)](_0x246c80,_0x30248d);}}}_0x327fdc[_0x228e57(0x15a)]>0x0&&replaceSegmentIdsInJourney(_0x497b90,_0x327fdc);_0x30d328[_0x228e57(0x15a)]>0x0&&replaceActivationIdsInJourney(_0x497b90,_0x30d328);if(_0x17120e[_0x228e57(0xcb)]){const _0x480269=[];collectJumpTargetsFromJourney(_0x497b90,_0x480269);if(_0x480269[_0x228e57(0x163)]>0x0){const _0x564244=new Map();for(const _0x35c9b9 of _0x480269){try{const _0x556339=await _0x17120e[_0x228e57(0xcb)](_0x35c9b9[_0x228e57(0xe0)],_0x35c9b9[_0x228e57(0xf6)]);_0x564244[_0x228e57(0x161)](_0x35c9b9[_0x228e57(0xe0)]+':'+_0x35c9b9[_0x228e57(0xf6)],_0x556339);}catch{}}_0x564244[_0x228e57(0x15a)]>0x0&&replaceJumpTargetsInJourney(_0x497b90,_0x564244);}}return Object['keys'](_0x5e727f)[_0x228e57(0x163)]>0x0&&(_0x497b90[_0x228e57(0x16d)]=_0x5e727f),Object['keys'](_0x116955)[_0x228e57(0x163)]>0x0&&(_0x497b90[_0x228e57(0x12c)]=_0x116955),_0x497b90;}function collectSegmentIdsFromJourney(_0x4bc5b8,_0x49300b){const _0x4cd9f9=a147_0x29fd;_0x4bc5b8[_0x4cd9f9(0x10c)]?.[_0x4cd9f9(0xd6)]&&_0x49300b['add'](_0x4bc5b8['goal'][_0x4cd9f9(0xd6)]);const _0x5d3488=_0x458d50=>{const _0x1213a3=_0x4cd9f9;for(const _0x4345d3 of _0x458d50){_0x4345d3[_0x1213a3(0x139)]?.[_0x1213a3(0xd6)]&&_0x49300b['add'](_0x4345d3[_0x1213a3(0x139)][_0x1213a3(0xd6)]);if(_0x4345d3['exit_criteria'])for(const _0x26db07 of _0x4345d3['exit_criteria']){_0x26db07['segment']&&_0x49300b[_0x1213a3(0x11e)](_0x26db07[_0x1213a3(0xd6)]);}_0x4345d3['milestone']?.[_0x1213a3(0xd6)]&&_0x49300b[_0x1213a3(0x11e)](_0x4345d3['milestone'][_0x1213a3(0xd6)]);if(_0x4345d3['steps'])for(const _0x455231 of _0x4345d3[_0x1213a3(0x102)]){if(_0x455231['type']===_0x1213a3(0x111)){const _0x216f40=_0x455231;for(const _0x584de1 of _0x216f40[_0x1213a3(0x176)][_0x1213a3(0x101)]){_0x584de1[_0x1213a3(0xd6)]&&_0x49300b[_0x1213a3(0x11e)](_0x584de1[_0x1213a3(0xd6)]);}}else{if(_0x455231[_0x1213a3(0x13a)]===_0x1213a3(0x10f)){const _0x2bacc5=_0x455231;_0x2bacc5['with'][_0x1213a3(0x16b)]?.['segment']&&_0x49300b['add'](_0x2bacc5['with']['condition'][_0x1213a3(0xd6)]);}}}}};if(_0x4bc5b8['journeys'])for(const _0x3293e7 of _0x4bc5b8['journeys']){_0x3293e7[_0x4cd9f9(0x10c)]?.[_0x4cd9f9(0xd6)]&&_0x49300b[_0x4cd9f9(0x11e)](_0x3293e7['goal'][_0x4cd9f9(0xd6)]),_0x5d3488(_0x3293e7[_0x4cd9f9(0x10e)]);}_0x4bc5b8[_0x4cd9f9(0x10e)]&&_0x5d3488(_0x4bc5b8[_0x4cd9f9(0x10e)]);if(_0x4bc5b8[_0x4cd9f9(0xda)])for(const _0x3330f3 of _0x4bc5b8[_0x4cd9f9(0xda)]){_0x5d3488(_0x3330f3['stages']);}}function replaceSegmentIdsInJourney(_0x3ca4f8,_0x1f32a9){const _0x420844=a147_0x29fd,_0x1576a9=_0x36f078=>_0x1f32a9[_0x420844(0x17a)](_0x36f078)||_0x36f078;_0x3ca4f8['goal']?.[_0x420844(0xd6)]&&(_0x3ca4f8[_0x420844(0x10c)][_0x420844(0xd6)]=_0x1576a9(_0x3ca4f8['goal'][_0x420844(0xd6)]));const _0x52a193=_0x3720e9=>{const _0x18d5dc=_0x420844;for(const _0x40fdde of _0x3720e9){_0x40fdde[_0x18d5dc(0x139)]?.['segment']&&(_0x40fdde[_0x18d5dc(0x139)][_0x18d5dc(0xd6)]=_0x1576a9(_0x40fdde['entry_criteria'][_0x18d5dc(0xd6)]));if(_0x40fdde['exit_criteria'])for(const _0x43dcb4 of _0x40fdde[_0x18d5dc(0x171)]){_0x43dcb4['segment']&&(_0x43dcb4[_0x18d5dc(0xd6)]=_0x1576a9(_0x43dcb4[_0x18d5dc(0xd6)]));}_0x40fdde['milestone']?.[_0x18d5dc(0xd6)]&&(_0x40fdde['milestone'][_0x18d5dc(0xd6)]=_0x1576a9(_0x40fdde['milestone'][_0x18d5dc(0xd6)]));if(_0x40fdde[_0x18d5dc(0x102)])for(const _0x559d9b of _0x40fdde['steps']){if(_0x559d9b[_0x18d5dc(0x13a)]===_0x18d5dc(0x111)){const _0x221234=_0x559d9b;for(const _0x1cbc36 of _0x221234[_0x18d5dc(0x176)]['branches']){_0x1cbc36[_0x18d5dc(0xd6)]&&(_0x1cbc36['segment']=_0x1576a9(_0x1cbc36[_0x18d5dc(0xd6)]));}}else{if(_0x559d9b[_0x18d5dc(0x13a)]==='wait'){const _0x55a653=_0x559d9b;_0x55a653[_0x18d5dc(0x176)][_0x18d5dc(0x16b)]?.[_0x18d5dc(0xd6)]&&(_0x55a653[_0x18d5dc(0x176)]['condition'][_0x18d5dc(0xd6)]=_0x1576a9(_0x55a653[_0x18d5dc(0x176)]['condition'][_0x18d5dc(0xd6)]));}}}}};if(_0x3ca4f8[_0x420844(0x126)])for(const _0x4744e9 of _0x3ca4f8['journeys']){_0x4744e9[_0x420844(0x10c)]?.['segment']&&(_0x4744e9['goal'][_0x420844(0xd6)]=_0x1576a9(_0x4744e9['goal']['segment'])),_0x52a193(_0x4744e9['stages']);}_0x3ca4f8[_0x420844(0x10e)]&&_0x52a193(_0x3ca4f8[_0x420844(0x10e)]);if(_0x3ca4f8[_0x420844(0xda)])for(const _0x374edb of _0x3ca4f8[_0x420844(0xda)]){_0x52a193(_0x374edb[_0x420844(0x10e)]);}}function collectActivationIdsFromJourney(_0x42d8d3,_0x64c76e){const _0x5c0061=a147_0x29fd,_0xb509ed=_0x195a73=>{const _0xe748f=a147_0x29fd;for(const _0x25854a of _0x195a73){if(_0x25854a[_0xe748f(0x102)])for(const _0x231e0f of _0x25854a['steps']){if(_0x231e0f[_0xe748f(0x13a)]===_0xe748f(0xd7)){const _0x36f99e=_0x231e0f;_0x36f99e[_0xe748f(0x176)][_0xe748f(0xd7)]&&/^\d+$/['test'](_0x36f99e['with'][_0xe748f(0xd7)])&&_0x64c76e['add'](_0x36f99e[_0xe748f(0x176)][_0xe748f(0xd7)]);}}}};if(_0x42d8d3['journeys'])for(const _0x2d5d0c of _0x42d8d3[_0x5c0061(0x126)]){_0xb509ed(_0x2d5d0c[_0x5c0061(0x10e)]);}_0x42d8d3[_0x5c0061(0x10e)]&&_0xb509ed(_0x42d8d3[_0x5c0061(0x10e)]);if(_0x42d8d3[_0x5c0061(0xda)])for(const _0x36763b of _0x42d8d3[_0x5c0061(0xda)]){_0xb509ed(_0x36763b[_0x5c0061(0x10e)]);}}function replaceActivationIdsInJourney(_0xbdba01,_0x245da5){const _0x64a98=a147_0x29fd,_0x5b049f=_0x353b9b=>_0x245da5[_0x64a98(0x17a)](_0x353b9b)||_0x353b9b,_0x2fa3cf=_0x5c9a79=>{const _0x517501=_0x64a98;for(const _0x4f9ba1 of _0x5c9a79){if(_0x4f9ba1[_0x517501(0x102)])for(const _0x2fff70 of _0x4f9ba1[_0x517501(0x102)]){if(_0x2fff70['type']===_0x517501(0xd7)){const _0x296fff=_0x2fff70;_0x296fff[_0x517501(0x176)]['activation']&&(_0x296fff[_0x517501(0x176)]['activation']=_0x5b049f(_0x296fff[_0x517501(0x176)]['activation']));}}}};if(_0xbdba01['journeys'])for(const _0x127272 of _0xbdba01['journeys']){_0x2fa3cf(_0x127272[_0x64a98(0x10e)]);}_0xbdba01[_0x64a98(0x10e)]&&_0x2fa3cf(_0xbdba01[_0x64a98(0x10e)]);if(_0xbdba01[_0x64a98(0xda)])for(const _0x537bab of _0xbdba01[_0x64a98(0xda)]){_0x2fa3cf(_0x537bab['stages']);}}function collectJumpTargetsFromJourney(_0x39434a,_0x5bb046){const _0x80ae84=a147_0x29fd,_0x27adcc=new Set(),_0x1ef8b6=_0x4cc2e1=>{const _0x1bf3e6=a147_0x29fd;for(const _0x4d5c38 of _0x4cc2e1){if(_0x4d5c38[_0x1bf3e6(0x102)])for(const _0x3df45d of _0x4d5c38[_0x1bf3e6(0x102)]){if(_0x3df45d[_0x1bf3e6(0x13a)]==='jump'){const _0x3022c3=_0x3df45d,_0x4d6d38=_0x3022c3[_0x1bf3e6(0x176)]['target'];if(_0x4d6d38[_0x1bf3e6(0xf4)]&&_0x4d6d38[_0x1bf3e6(0x164)]&&/^\d+$/[_0x1bf3e6(0x121)](_0x4d6d38[_0x1bf3e6(0xf4)])&&/^\d+$/[_0x1bf3e6(0x121)](_0x4d6d38[_0x1bf3e6(0x164)])){const _0x5542f4=_0x4d6d38['journey']+':'+_0x4d6d38[_0x1bf3e6(0x164)];!_0x27adcc['has'](_0x5542f4)&&(_0x27adcc[_0x1bf3e6(0x11e)](_0x5542f4),_0x5bb046[_0x1bf3e6(0x174)]({'journeyId':_0x4d6d38[_0x1bf3e6(0xf4)],'stageId':_0x4d6d38[_0x1bf3e6(0x164)]}));}}}}};if(_0x39434a[_0x80ae84(0x126)])for(const _0x926bb3 of _0x39434a['journeys']){_0x1ef8b6(_0x926bb3['stages']);}_0x39434a[_0x80ae84(0x10e)]&&_0x1ef8b6(_0x39434a['stages']);if(_0x39434a['versions'])for(const _0x461dd1 of _0x39434a[_0x80ae84(0xda)]){_0x1ef8b6(_0x461dd1['stages']);}}function replaceJumpTargetsInJourney(_0x3f93e5,_0x4768ae){const _0x61d9c7=a147_0x29fd,_0x11b41b=_0x18df9=>{const _0xca5a03=a147_0x29fd;for(const _0x5a2b1b of _0x18df9){if(_0x5a2b1b['steps'])for(const _0x1f51b9 of _0x5a2b1b['steps']){if(_0x1f51b9['type']===_0xca5a03(0x179)){const _0x4494b4=_0x1f51b9,_0x2675fd=_0x4494b4[_0xca5a03(0x176)][_0xca5a03(0x17e)],_0x4eb6c0=_0x2675fd[_0xca5a03(0xf4)]+':'+_0x2675fd[_0xca5a03(0x164)],_0x16ac71=_0x4768ae[_0xca5a03(0x17a)](_0x4eb6c0);_0x16ac71&&(_0x2675fd['journey']=_0x16ac71[_0xca5a03(0x122)],_0x2675fd['stage']=_0x16ac71['stageName']);}}}};if(_0x3f93e5[_0x61d9c7(0x126)])for(const _0xf6192d of _0x3f93e5[_0x61d9c7(0x126)]){_0x11b41b(_0xf6192d[_0x61d9c7(0x10e)]);}_0x3f93e5[_0x61d9c7(0x10e)]&&_0x11b41b(_0x3f93e5[_0x61d9c7(0x10e)]);if(_0x3f93e5[_0x61d9c7(0xda)])for(const _0x499894 of _0x3f93e5[_0x61d9c7(0xda)]){_0x11b41b(_0x499894[_0x61d9c7(0x10e)]);}}function generateReadableStepName(_0x4f7ab6,_0x57a247){const _0x5ab528=a147_0x29fd;if(_0x4f7ab6[_0x5ab528(0x123)]&&_0x4f7ab6['name']!==_0x4f7ab6['type']){const _0x3c29ac=_0x4f7ab6[_0x5ab528(0x123)][_0x5ab528(0x14b)]();if(_0x3c29ac&&/[a-z0-9\p{L}]/iu[_0x5ab528(0x121)](_0x3c29ac))return _0x3c29ac;}const _0x2e068a=_0x4f7ab6['type'][_0x5ab528(0x159)]()['replace'](/step$/i,'');return _0x2e068a+'_'+(_0x57a247+0x1);}function getStepNextRefs(_0x448c38){const _0x43143d=a147_0x29fd,_0x3734bd=[];if(_0x448c38[_0x43143d(0x175)])_0x3734bd[_0x43143d(0x174)](_0x448c38[_0x43143d(0x175)]);if(_0x448c38[_0x43143d(0x101)])for(const _0x3e4b26 of _0x448c38[_0x43143d(0x101)]){if(_0x3e4b26[_0x43143d(0x175)])_0x3734bd[_0x43143d(0x174)](_0x3e4b26['next']);}if(_0x448c38[_0x43143d(0x14c)])for(const _0x451f09 of _0x448c38['variants']){if(_0x451f09[_0x43143d(0x175)])_0x3734bd[_0x43143d(0x174)](_0x451f09['next']);}if(_0x448c38[_0x43143d(0xcc)])for(const _0x95b0cc of _0x448c38[_0x43143d(0xcc)]){if(_0x95b0cc[_0x43143d(0x175)])_0x3734bd[_0x43143d(0x174)](_0x95b0cc[_0x43143d(0x175)]);}return _0x3734bd;}function parseJumpTargetDisplayName(_0x1593de){const _0x18051f=a147_0x29fd,_0x565a7c=_0x1593de[_0x18051f(0x11c)](/^(.+?)\s*\(([^/)]+)/);if(!_0x565a7c)return undefined;const _0x46f26b=_0x565a7c[0x1]['trim'](),_0x268478=_0x565a7c[0x2][_0x18051f(0x14b)]();if(!_0x46f26b||!_0x268478)return undefined;return{'stageName':_0x46f26b,'journeyName':_0x268478};}function orderStepsFromRoot(_0x49f121,_0x4014b1){const _0x53fa88=a147_0x29fd,_0x488b25=Object[_0x53fa88(0x157)](_0x49f121);if(_0x488b25[_0x53fa88(0x163)]===0x0)return[];const _0x155f21=new Set(_0x488b25[_0x53fa88(0xdd)](([_0x4d548d])=>_0x4d548d)),_0x49e70e=new Set();for(const [,_0x4b88cd]of _0x488b25){for(const _0x3f8633 of getStepNextRefs(_0x4b88cd)){if(_0x155f21[_0x53fa88(0x152)](_0x3f8633))_0x49e70e[_0x53fa88(0x11e)](_0x3f8633);}}let _0xa73ba5=_0x4014b1&&_0x155f21[_0x53fa88(0x152)](_0x4014b1)?_0x4014b1:undefined;if(!_0xa73ba5){const _0x1cfd92=_0x488b25['filter'](([_0x4e7e2c])=>!_0x49e70e[_0x53fa88(0x152)](_0x4e7e2c));_0x1cfd92[_0x53fa88(0x163)]>0x0?_0xa73ba5=_0x1cfd92[0x0][0x0]:_0xa73ba5=_0x488b25[0x0][0x0];}const _0x551832=[],_0x52fdd4=new Set(),_0x575c83=[_0xa73ba5];while(_0x575c83[_0x53fa88(0x163)]>0x0){const _0x1f9e3a=_0x575c83[_0x53fa88(0x116)]();if(_0x52fdd4[_0x53fa88(0x152)](_0x1f9e3a))continue;_0x52fdd4[_0x53fa88(0x11e)](_0x1f9e3a);const _0x4169dc=_0x49f121[_0x1f9e3a];if(!_0x4169dc)continue;_0x551832[_0x53fa88(0x174)]({'uuid':_0x1f9e3a,'step':_0x4169dc});for(const _0x1f3164 of getStepNextRefs(_0x4169dc)){_0x155f21[_0x53fa88(0x152)](_0x1f3164)&&!_0x52fdd4[_0x53fa88(0x152)](_0x1f3164)&&_0x575c83[_0x53fa88(0x174)](_0x1f3164);}}for(const [_0x5b9d60,_0xf3c155]of _0x488b25){!_0x52fdd4[_0x53fa88(0x152)](_0x5b9d60)&&_0x551832['push']({'uuid':_0x5b9d60,'step':_0xf3c155});}return _0x551832;}function resolveStepReferences(_0x234895,_0x33aaa6,_0x14bf54,_0x38a7f6){const _0x5b249d=a147_0x29fd;if(_0x234895[_0x5b249d(0x13a)]!==_0x5b249d(0xd4)){_0x234895['next']&&_0x38a7f6[_0x5b249d(0x152)](_0x234895[_0x5b249d(0x175)])&&(_0x234895['next']=_0x38a7f6[_0x5b249d(0x17a)](_0x234895[_0x5b249d(0x175)]));const _0x3e6d7c=_0x33aaa6+0x1;if(_0x3e6d7c<_0x14bf54[_0x5b249d(0x163)]){const _0x3e3efe=_0x38a7f6[_0x5b249d(0x17a)](_0x14bf54[_0x3e6d7c][_0x5b249d(0x107)]);_0x234895[_0x5b249d(0x175)]===_0x3e3efe&&delete _0x234895[_0x5b249d(0x175)];}}if(_0x234895[_0x5b249d(0x13a)]==='decision_point')for(const _0x1a1426 of _0x234895[_0x5b249d(0x176)][_0x5b249d(0x101)]){_0x1a1426[_0x5b249d(0x175)]&&_0x38a7f6[_0x5b249d(0x152)](_0x1a1426['next'])&&(_0x1a1426[_0x5b249d(0x175)]=_0x38a7f6['get'](_0x1a1426[_0x5b249d(0x175)]));}if(_0x234895[_0x5b249d(0x13a)]===_0x5b249d(0xfa))for(const _0x105efc of _0x234895[_0x5b249d(0x176)][_0x5b249d(0x14c)]){_0x105efc['next']&&_0x38a7f6['has'](_0x105efc[_0x5b249d(0x175)])&&(_0x105efc[_0x5b249d(0x175)]=_0x38a7f6[_0x5b249d(0x17a)](_0x105efc[_0x5b249d(0x175)]));}if(_0x234895[_0x5b249d(0x13a)]===_0x5b249d(0x10f)&&_0x234895[_0x5b249d(0x176)][_0x5b249d(0x16b)]){const _0x1d1c3e=_0x234895[_0x5b249d(0x176)]['condition'];_0x1d1c3e[_0x5b249d(0x175)]&&_0x38a7f6[_0x5b249d(0x152)](_0x1d1c3e['next'])&&(_0x1d1c3e[_0x5b249d(0x175)]=_0x38a7f6[_0x5b249d(0x17a)](_0x1d1c3e[_0x5b249d(0x175)])),_0x1d1c3e[_0x5b249d(0xc7)]?.[_0x5b249d(0x175)]&&_0x38a7f6[_0x5b249d(0x152)](_0x1d1c3e[_0x5b249d(0xc7)]['next'])&&(_0x1d1c3e[_0x5b249d(0xc7)][_0x5b249d(0x175)]=_0x38a7f6[_0x5b249d(0x17a)](_0x1d1c3e['timeout'][_0x5b249d(0x175)]));}}function convertApiStageToYaml(_0x92749b){const _0x304c15=a147_0x29fd,_0x4d374e={'name':_0x92749b['name']};_0x92749b['id']&&(_0x4d374e['id']=_0x92749b['id']);_0x92749b[_0x304c15(0x156)]&&(_0x4d374e[_0x304c15(0x156)]=_0x92749b[_0x304c15(0x156)]);_0x92749b['entryCriteria']&&(_0x4d374e[_0x304c15(0x139)]=convertApiCriteriaToYaml(_0x92749b['entryCriteria']));_0x92749b[_0x304c15(0x162)]&&_0x92749b['exitCriterias'][_0x304c15(0x163)]>0x0&&(_0x4d374e[_0x304c15(0x171)]=_0x92749b[_0x304c15(0x162)][_0x304c15(0xdd)](convertApiCriteriaToYaml));_0x92749b[_0x304c15(0x15c)]&&(_0x4d374e[_0x304c15(0x15c)]=convertApiCriteriaToYaml(_0x92749b['milestone']));if(_0x92749b['steps']&&Object[_0x304c15(0xfc)](_0x92749b['steps'])[_0x304c15(0x163)]>0x0){const _0x4db59f=orderStepsFromRoot(_0x92749b[_0x304c15(0x102)],_0x92749b[_0x304c15(0x103)]),_0x3577e0=new Map(),_0x47e9da=new Set();for(let _0x3915ae=0x0;_0x3915ae<_0x4db59f['length'];_0x3915ae++){const {uuid:_0xc01c84,step:_0x378950}=_0x4db59f[_0x3915ae];let _0x2a2759=generateReadableStepName(_0x378950,_0x3915ae),_0x25936a=_0x2a2759,_0x5d1057=0x2;while(_0x47e9da[_0x304c15(0x152)](_0x25936a)){_0x25936a=_0x2a2759+'_'+_0x5d1057,_0x5d1057++;}_0x47e9da[_0x304c15(0x11e)](_0x25936a),_0x3577e0[_0x304c15(0x161)](_0xc01c84,_0x25936a);}_0x4d374e[_0x304c15(0x102)]=_0x4db59f[_0x304c15(0xdd)](({uuid:_0x7ccac2,step:_0x451655},_0x31a71f)=>{const _0x59ce9e=convertApiStepToYaml(_0x451655,_0x3577e0['get'](_0x7ccac2));return resolveStepReferences(_0x59ce9e,_0x31a71f,_0x4db59f,_0x3577e0),_0x59ce9e;});}return _0x4d374e;}function convertApiCriteriaToYaml(_0x38a8d){const _0x492948=a147_0x29fd,_0x3be58c={'name':_0x38a8d['name'],'segment':_0x38a8d[_0x492948(0x177)]};_0x38a8d['description']&&(_0x3be58c[_0x492948(0x156)]=_0x38a8d[_0x492948(0x156)]);if(_0x38a8d[_0x492948(0x17e)]){let _0x1ef200=_0x38a8d[_0x492948(0x17e)][_0x492948(0xe0)],_0x287a68=_0x38a8d['target'][_0x492948(0xe9)];if(_0x38a8d[_0x492948(0x17e)][_0x492948(0x122)]){const _0x68382d=parseJumpTargetDisplayName(_0x38a8d['target']['journeyName']);_0x68382d&&(_0x287a68=_0x68382d[_0x492948(0x16e)],_0x1ef200=_0x68382d['journeyName']);}_0x3be58c[_0x492948(0x17e)]={'journey':_0x1ef200,'stage':_0x287a68},_0x38a8d[_0x492948(0x17e)][_0x492948(0xfb)]&&(_0x3be58c[_0x492948(0x17e)][_0x492948(0xde)]=_0x38a8d[_0x492948(0x17e)][_0x492948(0xfb)]);}return _0x3be58c;}function convertApiStepToYaml(_0x4b2cea,_0x5aa2ae){const _0x11e498=a147_0x29fd;switch(_0x4b2cea[_0x11e498(0x13a)]){case _0x11e498(0x181):{const _0x23c53b={};if(_0x4b2cea[_0x11e498(0xdc)]===_0x11e498(0x16a)&&_0x4b2cea[_0x11e498(0x17d)]!==undefined)_0x23c53b[_0x11e498(0xd2)]=_0x4b2cea[_0x11e498(0x17d)],_0x23c53b[_0x11e498(0x12a)]=_0x4b2cea[_0x11e498(0x137)];else{if(_0x4b2cea[_0x11e498(0xdc)]===_0x11e498(0xc9)&&_0x4b2cea[_0x11e498(0x16f)])_0x23c53b[_0x11e498(0x100)]=_0x4b2cea[_0x11e498(0x16f)];else{if(_0x4b2cea[_0x11e498(0xdc)]===_0x11e498(0x13d)&&_0x4b2cea[_0x11e498(0xca)])_0x23c53b[_0x11e498(0x173)]=_0x4b2cea['daysOfWeek'];else{if(_0x4b2cea[_0x11e498(0xdc)]===_0x11e498(0xcf)){if(_0x4b2cea[_0x11e498(0xcc)]&&_0x4b2cea[_0x11e498(0xcc)][_0x11e498(0x163)]>0x0){const _0x1ece33=_0x4b2cea[_0x11e498(0xcc)]['find'](_0xccef0b=>!_0xccef0b[_0x11e498(0xfe)]),_0x1075e2=_0x4b2cea[_0x11e498(0xcc)][_0x11e498(0x140)](_0x2edef8=>_0x2edef8[_0x11e498(0xfe)]);_0x1ece33?.[_0x11e498(0x177)]&&(_0x23c53b[_0x11e498(0x16b)]={'segment':_0x1ece33['segmentId'],..._0x1ece33[_0x11e498(0x175)]?{'next':_0x1ece33['next']}:{}},_0x1075e2&&_0x1075e2['moveAfter']!==undefined&&_0x1075e2[_0x11e498(0x12a)]&&(_0x23c53b['condition']['timeout']={'duration':_0x1075e2[_0x11e498(0xf8)],'unit':_0x1075e2[_0x11e498(0x12a)],..._0x1075e2['next']?{'next':_0x1075e2['next']}:{}}));}else _0x4b2cea[_0x11e498(0x12b)]&&(_0x23c53b[_0x11e498(0x16b)]={'segment':_0x4b2cea[_0x11e498(0x12b)]},_0x4b2cea[_0x11e498(0xd5)]!==undefined&&_0x4b2cea[_0x11e498(0xd3)]&&(_0x23c53b[_0x11e498(0x16b)]['timeout']={'duration':_0x4b2cea[_0x11e498(0xd5)],'unit':_0x4b2cea[_0x11e498(0xd3)]}));}}}}const _0x3b81c8={'type':_0x11e498(0x10f),'name':_0x5aa2ae,..._0x4b2cea[_0x11e498(0x175)]?{'next':_0x4b2cea['next']}:{},'with':_0x23c53b};return _0x3b81c8;}case'Activation':{const _0x283978={'type':_0x11e498(0xd7),'name':_0x5aa2ae,..._0x4b2cea[_0x11e498(0x175)]?{'next':_0x4b2cea[_0x11e498(0x175)]}:{},'with':{'activation':_0x4b2cea[_0x11e498(0x13b)]||''}};return _0x283978;}case _0x11e498(0x151):{const _0x1f5d05={'type':_0x11e498(0x111),'name':_0x5aa2ae,..._0x4b2cea[_0x11e498(0x175)]?{'next':_0x4b2cea[_0x11e498(0x175)]}:{},'with':{'branches':(_0x4b2cea['branches']||[])[_0x11e498(0xdd)](_0x391a77=>({'name':_0x391a77['name'],'segment':_0x391a77[_0x11e498(0x177)],'excluded':_0x391a77['excludedPath'],..._0x391a77[_0x11e498(0x175)]?{'next':_0x391a77[_0x11e498(0x175)]}:{}}))}};return _0x1f5d05;}case'ABTest':case _0x11e498(0x144):case _0x11e498(0xdf):{const _0x2b9e2c=_0x4b2cea[_0x11e498(0x14c)]||(_0x4b2cea[_0x11e498(0x101)]||[])['map'](_0x2dc1c6=>({'name':_0x2dc1c6[_0x11e498(0x123)],'percentage':0x0,'next':_0x2dc1c6[_0x11e498(0x175)]})),_0x5d4c78={'type':_0x11e498(0xfa),'name':_0x5aa2ae,..._0x4b2cea[_0x11e498(0x175)]?{'next':_0x4b2cea['next']}:{},'with':{'customized_split':_0x4b2cea[_0x11e498(0x131)],'unique_id':_0x4b2cea[_0x11e498(0x15d)],'variants':_0x2b9e2c[_0x11e498(0xdd)](_0x3f9434=>({'name':_0x3f9434['name'],'percentage':_0x3f9434[_0x11e498(0x172)],..._0x3f9434[_0x11e498(0x175)]?{'next':_0x3f9434[_0x11e498(0x175)]}:{}}))}};return _0x5d4c78;}case'Merge':{const _0x533cef={'type':_0x11e498(0xf1),'name':_0x5aa2ae,..._0x4b2cea[_0x11e498(0x175)]?{'next':_0x4b2cea[_0x11e498(0x175)]}:{}};return _0x533cef;}case _0x11e498(0x150):{let _0x49167b='',_0x18ab6d='',_0x5f0e3a;if(_0x4b2cea[_0x11e498(0x17e)]){_0x49167b=_0x4b2cea['target'][_0x11e498(0xe0)],_0x18ab6d=_0x4b2cea[_0x11e498(0x17e)][_0x11e498(0xe9)],_0x5f0e3a=_0x4b2cea[_0x11e498(0x17e)][_0x11e498(0xfb)];if(_0x4b2cea[_0x11e498(0x17e)][_0x11e498(0x122)]){const _0x31dc21=parseJumpTargetDisplayName(_0x4b2cea[_0x11e498(0x17e)]['journeyName']);_0x31dc21&&(_0x18ab6d=_0x31dc21[_0x11e498(0x16e)],_0x49167b=_0x31dc21[_0x11e498(0x122)]);}}const _0x3888a5={'type':_0x11e498(0x179),'name':_0x5aa2ae,..._0x4b2cea[_0x11e498(0x175)]?{'next':_0x4b2cea['next']}:{},'with':{'target':{'journey':_0x49167b,'stage':_0x18ab6d,..._0x5f0e3a?{'bundle_id':_0x5f0e3a}:{}}}};return _0x3888a5;}case _0x11e498(0xd8):{const _0xa6db50={'type':_0x11e498(0xd4),'name':_0x5aa2ae};return _0xa6db50;}default:{const _0x4d0e0a={'type':_0x11e498(0xd4),'name':_0x5aa2ae};return _0x4d0e0a;}}}export async function journeyDefToRequest(_0x5b6d15,_0x5236f7,_0x4bb8cb){const _0x1894e8=a147_0x29fd,_0x3943fa=_0x5b6d15['stages']||getActiveStages(_0x5b6d15),_0x12062f=isJourneysArrayMode(_0x5b6d15)||isMultiVersionMode(_0x5b6d15)?getLatestJourneyEntry(_0x5b6d15):undefined,_0x5e5fe7=_0x12062f?.['version']??_0x5b6d15[_0x1894e8(0x123)],_0x27d6a1=_0x5b6d15[_0x1894e8(0x16d)]||{},_0x23f1df=_0x5b6d15['activations']||{},_0x18e16b={'type':_0x1894e8(0xf4),'attributes':{'name':_0x5e5fe7,'audienceId':_0x5236f7,'journeyStages':await Promise['all'](_0x3943fa['map'](_0x50dab2=>convertYamlStageToApi(_0x50dab2,_0x4bb8cb,_0x27d6a1,_0x23f1df)))}},_0x10f5dc=_0x12062f?.['id']??_0x5b6d15['id'];_0x10f5dc&&(_0x18e16b['id']=_0x10f5dc);_0x5b6d15[_0x1894e8(0x156)]&&(_0x18e16b[_0x1894e8(0xd9)][_0x1894e8(0x156)]=_0x5b6d15[_0x1894e8(0x156)]);const _0x2c1d38=getEffectiveGoal(_0x5b6d15);_0x2c1d38&&(_0x18e16b[_0x1894e8(0xd9)][_0x1894e8(0x10c)]=await convertYamlCriteriaToApi(_0x2c1d38,_0x4bb8cb,_0x27d6a1));const _0x236d33=getEffectiveReentry(_0x5b6d15);return _0x236d33&&(_0x18e16b[_0x1894e8(0xd9)][_0x1894e8(0x132)]=_0x236d33,_0x18e16b[_0x1894e8(0xd9)]['allowReentry']=_0x236d33!=='no_reentry'),_0x5b6d15[_0x1894e8(0x135)]&&(_0x18e16b[_0x1894e8(0x17c)]={'parentFolder':{'data':{'id':_0x5b6d15['folder_id'],'type':_0x1894e8(0x11b)}}}),_0x18e16b;}async function convertYamlStageToApi(_0x336630,_0x51f6e9,_0x19651d={},_0x119298={}){const _0x5aa085=a147_0x29fd,_0x36be7b={'name':_0x336630[_0x5aa085(0x123)]};_0x336630['id']&&(_0x36be7b['id']=_0x336630['id']);_0x336630[_0x5aa085(0x156)]&&(_0x36be7b[_0x5aa085(0x156)]=_0x336630[_0x5aa085(0x156)]);_0x336630['entry_criteria']&&(_0x36be7b['entryCriteria']=await convertYamlCriteriaToApi(_0x336630[_0x5aa085(0x139)],_0x51f6e9,_0x19651d));_0x336630[_0x5aa085(0x171)]&&_0x336630[_0x5aa085(0x171)][_0x5aa085(0x163)]>0x0&&(_0x36be7b['exitCriterias']=await Promise[_0x5aa085(0xe5)](_0x336630[_0x5aa085(0x171)][_0x5aa085(0xdd)](_0x2209e3=>convertYamlCriteriaToApi(_0x2209e3,_0x51f6e9,_0x19651d))));_0x336630[_0x5aa085(0x15c)]&&(_0x36be7b[_0x5aa085(0x15c)]=await convertYamlCriteriaToApi(_0x336630[_0x5aa085(0x15c)],_0x51f6e9,_0x19651d));if(_0x336630[_0x5aa085(0x102)]&&_0x336630[_0x5aa085(0x102)]['length']>0x0){const _0x3ab6c1={},_0x584e98=_0x336630[_0x5aa085(0x102)]['map']((_0xc30344,_0x53b36a)=>{const _0x1e8426=_0x5aa085,_0x3d5838=_0xc30344[_0x1e8426(0x107)]||generateUUID(),_0x23e79f=_0xc30344[_0x1e8426(0x123)]||_0xc30344[_0x1e8426(0x13a)]+'_'+_0x53b36a;return _0x3ab6c1[_0x23e79f]=_0x3d5838,{..._0xc30344,'name':_0x23e79f};});_0x36be7b[_0x5aa085(0x103)]=_0x3ab6c1[_0x584e98[0x0][_0x5aa085(0x123)]],_0x36be7b[_0x5aa085(0x102)]={};for(let _0x219f40=0x0;_0x219f40<_0x584e98[_0x5aa085(0x163)];_0x219f40++){const _0x3bc001=_0x584e98[_0x219f40],_0x162f98=_0x3ab6c1[_0x3bc001[_0x5aa085(0x123)]],_0x413e7d=!_0x3bc001[_0x5aa085(0x175)]&&_0x219f40<_0x584e98[_0x5aa085(0x163)]-0x1&&_0x3bc001[_0x5aa085(0x13a)]!==_0x5aa085(0xd4)?_0x584e98[_0x219f40+0x1][_0x5aa085(0x123)]:_0x3bc001[_0x5aa085(0x175)],_0x5d4940=_0x413e7d!==_0x3bc001[_0x5aa085(0x175)]?{..._0x3bc001,'next':_0x413e7d}:_0x3bc001;_0x36be7b[_0x5aa085(0x102)][_0x162f98]=await convertYamlStepToApi(_0x5d4940,_0x51f6e9,_0x19651d,_0x3ab6c1,_0x119298);}}else _0x336630[_0x5aa085(0xe4)]&&(_0x36be7b[_0x5aa085(0x103)]=_0x336630[_0x5aa085(0xe4)]);return _0x36be7b;}async function convertYamlCriteriaToApi(_0x234a77,_0x554966,_0x46996f={}){const _0x496b58=a147_0x29fd;let _0x2c25f8=_0x234a77[_0x496b58(0xd6)];if(_0x2c25f8&&!/^\d+$/[_0x496b58(0x121)](_0x2c25f8)){const _0x59de2c=parseSegmentRef(_0x2c25f8);if(_0x59de2c[_0x496b58(0x13a)]==='ref')_0x554966?.[_0x496b58(0x141)]&&(_0x2c25f8=await _0x554966[_0x496b58(0x141)](_0x59de2c[_0x496b58(0x123)]));else{if(_0x59de2c[_0x496b58(0x13a)]==='embedded'&&_0x46996f[_0x59de2c[_0x496b58(0x123)]])_0x554966?.[_0x496b58(0x133)]&&(_0x2c25f8=await _0x554966[_0x496b58(0x133)](_0x59de2c['name'],_0x46996f[_0x59de2c['name']]));else _0x554966?.[_0x496b58(0x141)]&&(_0x2c25f8=await _0x554966[_0x496b58(0x141)](_0x59de2c[_0x496b58(0x123)]));}}const _0x267794={'name':_0x234a77[_0x496b58(0x123)],'segmentId':_0x2c25f8};_0x234a77[_0x496b58(0x156)]&&(_0x267794['description']=_0x234a77['description']);if(_0x234a77[_0x496b58(0x17e)]){const _0x49ca69=_0x234a77['target'][_0x496b58(0xf4)],_0x24d9c3=_0x234a77[_0x496b58(0x17e)][_0x496b58(0x164)];let _0x4a7be5=_0x234a77['target']['journey'];_0x554966?.[_0x496b58(0x153)]&&!/^\d+$/['test'](_0x4a7be5)&&(_0x4a7be5=await _0x554966[_0x496b58(0x153)](_0x4a7be5));let _0x2d4a22=_0x234a77[_0x496b58(0x17e)]['stage'];_0x554966?.[_0x496b58(0x12d)]&&!/^\d+$/[_0x496b58(0x121)](_0x2d4a22)&&(_0x2d4a22=await _0x554966[_0x496b58(0x12d)](_0x4a7be5,_0x2d4a22));const _0x4f248f=!/^\d+$/[_0x496b58(0x121)](_0x49ca69)&&!isLocalJourneyRef(_0x49ca69)?formatApiJourneyName(_0x49ca69,_0x24d9c3):undefined;_0x267794[_0x496b58(0x17e)]={'journeyId':_0x4a7be5,'journeyStageId':_0x2d4a22,'journeyName':_0x4f248f,'confirmed':!![]},_0x234a77[_0x496b58(0x17e)][_0x496b58(0xde)]&&(_0x267794[_0x496b58(0x17e)][_0x496b58(0xfb)]=_0x234a77[_0x496b58(0x17e)][_0x496b58(0xde)]);}return _0x267794;}async function convertYamlStepToApi(_0x3db9d3,_0x20ba5e,_0x8ae6e8={},_0xe77ae9={},_0x447216={}){const _0x10b6d8=a147_0x29fd,_0x4993dd=async _0x5bbb3d=>{const _0xf8dbd1=a147_0x29fd;if(/^\d+$/[_0xf8dbd1(0x121)](_0x5bbb3d))return _0x5bbb3d;const _0xda5f5e=parseSegmentRef(_0x5bbb3d);if(_0xda5f5e[_0xf8dbd1(0x13a)]===_0xf8dbd1(0x14e)){if(_0x20ba5e?.[_0xf8dbd1(0x141)])return await _0x20ba5e['resolveSegmentId'](_0xda5f5e[_0xf8dbd1(0x123)]);}else{if(_0xda5f5e[_0xf8dbd1(0x13a)]===_0xf8dbd1(0x11f)&&_0x8ae6e8[_0xda5f5e[_0xf8dbd1(0x123)]]){if(_0x20ba5e?.[_0xf8dbd1(0x133)])return await _0x20ba5e['resolveEmbeddedSegmentId'](_0xda5f5e['name'],_0x8ae6e8[_0xda5f5e['name']]);}else{if(_0x20ba5e?.[_0xf8dbd1(0x141)])return await _0x20ba5e[_0xf8dbd1(0x141)](_0xda5f5e['name']);}}return _0x5bbb3d;},_0x139f24=async _0x1add1c=>{const _0x26be30=a147_0x29fd;if(/^\d+$/['test'](_0x1add1c))return _0x1add1c;const _0x761a49=parseSegmentRef(_0x1add1c);if(_0x761a49[_0x26be30(0x13a)]===_0x26be30(0x14e)){if(_0x20ba5e?.['resolveActivationId'])return await _0x20ba5e['resolveActivationId'](_0x761a49['name']);return _0x761a49[_0x26be30(0x123)];}else{if(_0x761a49[_0x26be30(0x13a)]===_0x26be30(0x11f)&&_0x447216[_0x761a49[_0x26be30(0x123)]]){if(_0x20ba5e?.[_0x26be30(0x178)])return await _0x20ba5e[_0x26be30(0x178)](_0x761a49[_0x26be30(0x123)],_0x447216[_0x761a49[_0x26be30(0x123)]]);if(_0x20ba5e?.[_0x26be30(0x155)])return await _0x20ba5e['resolveActivationId'](_0x761a49['name']);}else{if(_0x20ba5e?.['resolveActivationId'])return await _0x20ba5e[_0x26be30(0x155)](_0x761a49['name']);}}return _0x1add1c;},_0x51cdd3=_0xe03dde=>{const _0x353cb8=a147_0x29fd;if(!_0xe03dde)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x353cb8(0x121)](_0xe03dde))return _0xe03dde;return _0xe77ae9[_0xe03dde]||_0xe03dde;};switch(_0x3db9d3[_0x10b6d8(0x13a)]){case _0x10b6d8(0x10f):{const _0x546fbb=_0x3db9d3,_0x1bf61e=_0x546fbb[_0x10b6d8(0x176)],_0x52e68a={'type':_0x10b6d8(0x181),'name':_0x546fbb[_0x10b6d8(0x123)],'next':_0x51cdd3(_0x546fbb[_0x10b6d8(0x175)])};if(_0x1bf61e[_0x10b6d8(0xd2)]!==undefined&&_0x1bf61e['unit'])_0x52e68a[_0x10b6d8(0xdc)]=_0x10b6d8(0x16a),_0x52e68a[_0x10b6d8(0x17d)]=_0x1bf61e[_0x10b6d8(0xd2)],_0x52e68a[_0x10b6d8(0x137)]=normalizeWaitUnit(_0x1bf61e[_0x10b6d8(0x12a)]);else{if(_0x1bf61e[_0x10b6d8(0x100)])_0x52e68a[_0x10b6d8(0xdc)]=_0x10b6d8(0xc9),_0x52e68a[_0x10b6d8(0x16f)]=_0x1bf61e[_0x10b6d8(0x100)];else{if(_0x1bf61e['days_of_week'])_0x52e68a[_0x10b6d8(0xdc)]='DaysOfTheWeek',_0x52e68a[_0x10b6d8(0xca)]=_0x1bf61e['days_of_week'];else{if(_0x1bf61e[_0x10b6d8(0x16b)]){_0x52e68a[_0x10b6d8(0xdc)]=_0x10b6d8(0xcf);const _0x5d6ffa=await _0x4993dd(_0x1bf61e[_0x10b6d8(0x16b)]['segment']),_0x34b2f3=_0x1bf61e[_0x10b6d8(0x16b)][_0x10b6d8(0xc7)]?.[_0x10b6d8(0x175)]!==undefined;if(_0x34b2f3){const _0x3e5455=[];_0x3e5455[_0x10b6d8(0x174)]({'id':generateUUID(),'segmentId':_0x5d6ffa,'timedOutPath':![],'name':_0x10b6d8(0x117),'next':_0x51cdd3(_0x1bf61e[_0x10b6d8(0x16b)][_0x10b6d8(0x175)]??_0x546fbb[_0x10b6d8(0x175)])});if(_0x1bf61e['condition'][_0x10b6d8(0xc7)]){const _0x2efdcb=_0x1bf61e['condition'][_0x10b6d8(0xc7)][_0x10b6d8(0xd2)],_0x307a36=normalizeWaitUnit(_0x1bf61e['condition'][_0x10b6d8(0xc7)]['unit']);_0x3e5455[_0x10b6d8(0x174)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x10b6d8(0x105)+_0x2efdcb+'\x20'+_0x307a36,'moveAfter':_0x2efdcb,'unit':_0x307a36,'next':_0x51cdd3(_0x1bf61e[_0x10b6d8(0x16b)][_0x10b6d8(0xc7)][_0x10b6d8(0x175)])});}_0x52e68a[_0x10b6d8(0xcc)]=_0x3e5455,delete _0x52e68a[_0x10b6d8(0x175)];}else _0x52e68a[_0x10b6d8(0x12b)]=_0x5d6ffa,_0x1bf61e['condition'][_0x10b6d8(0xc7)]&&(_0x52e68a[_0x10b6d8(0xd5)]=_0x1bf61e['condition'][_0x10b6d8(0xc7)][_0x10b6d8(0xd2)],_0x1bf61e[_0x10b6d8(0x16b)][_0x10b6d8(0xc7)][_0x10b6d8(0x12a)]&&(_0x52e68a['conditionTimeoutUnit']=normalizeWaitUnit(_0x1bf61e[_0x10b6d8(0x16b)]['timeout'][_0x10b6d8(0x12a)])));}}}}return _0x52e68a;}case _0x10b6d8(0xd7):{const _0xf5dc6d=_0x3db9d3,_0x266943=_0xf5dc6d[_0x10b6d8(0x176)][_0x10b6d8(0xd7)],_0x55e4d3=await _0x139f24(_0x266943);return{'type':_0x10b6d8(0x10d),'name':_0xf5dc6d[_0x10b6d8(0x123)],'journeyActivationStepId':_0x55e4d3,'next':_0x51cdd3(_0xf5dc6d[_0x10b6d8(0x175)])};}case'decision_point':{const _0x406616=_0x3db9d3,_0x36656b=_0x406616[_0x10b6d8(0x176)]['branches'];return{'type':_0x10b6d8(0x151),'name':_0x406616[_0x10b6d8(0x123)],'branches':await Promise[_0x10b6d8(0xe5)](_0x36656b[_0x10b6d8(0xdd)](async _0xdbc3f8=>{const _0x3df691=_0x10b6d8;let _0x562644='';if(!_0xdbc3f8[_0x3df691(0x130)]){const _0xe23a2b=_0xdbc3f8[_0x3df691(0xd6)]||_0xdbc3f8[_0x3df691(0xf9)]||'';_0x562644=_0xe23a2b?await _0x4993dd(_0xe23a2b):'';}return{'id':crypto[_0x3df691(0x12f)](),'name':_0xdbc3f8[_0x3df691(0x123)],'description':null,'segmentId':_0x562644,'excludedPath':_0xdbc3f8[_0x3df691(0x130)]??![],'next':_0x51cdd3(_0xdbc3f8[_0x3df691(0x175)])};})),'next':_0x51cdd3(_0x406616[_0x10b6d8(0x175)])};}case'ab_test':{const _0x4c68f1=_0x3db9d3,_0x58905c=_0x4c68f1['with'];return{'type':_0x10b6d8(0x13c),'name':_0x4c68f1['name'],'customizedSplit':_0x58905c['customized_split'],'uniqueId':_0x58905c[_0x10b6d8(0x160)],'variants':_0x58905c[_0x10b6d8(0x14c)][_0x10b6d8(0xdd)](_0x2d9407=>({'id':_0x2d9407['id']||generateUUID(),'name':_0x2d9407[_0x10b6d8(0x123)],'percentage':_0x2d9407[_0x10b6d8(0x172)],'next':_0x51cdd3(_0x2d9407[_0x10b6d8(0x175)])})),'next':_0x51cdd3(_0x4c68f1['next'])};}case _0x10b6d8(0xf1):return{'type':_0x10b6d8(0xcd),'name':_0x3db9d3[_0x10b6d8(0x123)],'next':_0x51cdd3(_0x3db9d3[_0x10b6d8(0x175)])};case _0x10b6d8(0x179):{const _0x188e57=_0x3db9d3,_0x19bb7a=_0x188e57[_0x10b6d8(0x176)]['target'],_0x34b741=_0x19bb7a[_0x10b6d8(0xf4)],_0x163d6f=_0x19bb7a['stage'];let _0x394d66=_0x19bb7a[_0x10b6d8(0xf4)];_0x20ba5e?.[_0x10b6d8(0x153)]&&!/^\d+$/['test'](_0x394d66)&&(_0x394d66=await _0x20ba5e[_0x10b6d8(0x153)](_0x394d66));let _0x2ec2f0=_0x19bb7a['stage'];_0x20ba5e?.[_0x10b6d8(0x12d)]&&!/^\d+$/[_0x10b6d8(0x121)](_0x2ec2f0)&&(_0x2ec2f0=await _0x20ba5e[_0x10b6d8(0x12d)](_0x394d66,_0x2ec2f0));const _0x8c6d13=!/^\d+$/[_0x10b6d8(0x121)](_0x34b741)&&!isLocalJourneyRef(_0x34b741)?formatApiJourneyName(_0x34b741,_0x163d6f):undefined;return{'type':_0x10b6d8(0x150),'name':_0x188e57['name'],'target':{'journeyId':_0x394d66,'journeyStageId':_0x2ec2f0,'journeyBundleId':_0x19bb7a['bundle_id'],'journeyName':_0x8c6d13,'confirmed':!![]},'next':_0x51cdd3(_0x188e57['next'])};}case _0x10b6d8(0xd4):return{'type':_0x10b6d8(0xd8),'name':_0x3db9d3[_0x10b6d8(0x123)]};default:{const _0x479499=_0x3db9d3;return{'type':_0x10b6d8(0xd8),'name':_0x479499[_0x10b6d8(0x123)]};}}}export function toYamlString(_0x3c0705){const _0x1357bd=a147_0x29fd,_0x215ebf=stripInternalFields(_0x3c0705),_0xca4b8a=a147_0x57e329['stringify'](_0x215ebf,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x1357bd(0xef)}),_0x4417ca=[_0x1357bd(0x10b),'activations:',_0x1357bd(0xee),_0x1357bd(0xe1),_0x1357bd(0x148),'stages:',_0x1357bd(0x142)];let _0x7fc7e1=_0xca4b8a;for(const _0x4a693a of _0x4417ca){_0x7fc7e1=_0x7fc7e1[_0x1357bd(0xd0)](new RegExp('^('+_0x4a693a+')','m'),(_0x257e1c,_0x57fde7,_0x151b8d)=>{if(_0x151b8d===0x0||_0x7fc7e1[_0x151b8d-0x1]==='\x0a'&&_0x7fc7e1[_0x151b8d-0x2]==='\x0a')return _0x57fde7;return'\x0a'+_0x57fde7;});}return _0x7fc7e1;}function stripInternalFields(_0x4a8791){const _0x5d35a8=a147_0x29fd,{id:_0x58ab06,folder_id:_0x1a2152,bundle_id:_0x3cd16d,bundle_name:_0x58ebec,version:_0x1990dd,allow_reentry:_0x4a11db,..._0x296229}=_0x4a8791;return _0x296229[_0x5d35a8(0x126)]&&(_0x296229[_0x5d35a8(0x126)]=_0x296229[_0x5d35a8(0x126)]['map'](_0x5b3871=>{const _0x208100=_0x5d35a8,{id:_0x4f7dfa,..._0xa3ac60}=_0x5b3871;return{..._0xa3ac60,'stages':_0xa3ac60['stages'][_0x208100(0xdd)](stripStageInternalFields),..._0x5b3871['latest']===!![]?{'latest':!![]}:{},..._0x296229[_0x208100(0x126)][_0x208100(0x163)]===0x1&&_0xa3ac60[_0x208100(0x118)]==='v1'?{'version':undefined}:{}};})),_0x296229[_0x5d35a8(0x10e)]&&(_0x296229['stages']=_0x296229[_0x5d35a8(0x10e)]['map'](stripStageInternalFields)),_0x296229['versions']&&(_0x296229['versions']=_0x296229['versions'][_0x5d35a8(0xdd)](_0x2bf7be=>{const _0x3f6362=_0x5d35a8,{id:_0x5aa250,..._0x41bef4}=_0x2bf7be;return{..._0x41bef4,'stages':_0x41bef4[_0x3f6362(0x10e)]['map'](stripStageInternalFields),..._0x2bf7be[_0x3f6362(0xe3)]===!![]?{'latest':!![]}:{}};})),_0x296229;}function stripStageInternalFields(_0xd82566){const {id:_0x170ef4,..._0x21b496}=_0xd82566;return _0x21b496;}export function parseYamlString(_0x3a1635){return safeParseYaml(_0x3a1635,JourneyDefSchema);}export function isJourneyDef(_0x26d370){const _0x358e84=a147_0x29fd;return typeof _0x26d370===_0x358e84(0xfd)&&_0x26d370!==null&&'type'in _0x26d370&&_0x26d370[_0x358e84(0x13a)]===_0x358e84(0xf4);}export function generateTemplate(_0x1cd440,_0x3d7f1d){const _0x5268a9=a147_0x29fd,_0x1dee17={'type':_0x5268a9(0xf4),'name':_0x1cd440,'description':_0x5268a9(0x114),'reentry':_0x5268a9(0x109),'goal':{'name':_0x5268a9(0x124),'segment':_0x5268a9(0xec)},'stages':[{'name':_0x5268a9(0xe2),'description':'First\x20stage\x20of\x20the\x20journey','entry_criteria':{'name':'Entry\x20Criteria','segment':_0x3d7f1d},'steps':[{'type':_0x5268a9(0x10f),'name':_0x5268a9(0x115),'with':{'duration':0x1,'unit':'day'}},{'type':'activation','name':'Send\x20Notification','with':{'activation':_0x5268a9(0x15f)}},{'type':'end','name':_0x5268a9(0x128)}]}]};return toYamlString(_0x1dee17);}function generateUUID(){return crypto['randomUUID']();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x407ebf){const _0x45ef8d=a147_0x29fd;if(_0x407ebf[_0x45ef8d(0x13f)](SEGMENT_REF_PREFIX))return{'type':_0x45ef8d(0x14e),'name':_0x407ebf['slice'](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/['test'](_0x407ebf))return{'type':'id','name':_0x407ebf};return{'type':_0x45ef8d(0x11f),'name':_0x407ebf};}export function makeSegmentRef(_0xb38c43){return''+SEGMENT_REF_PREFIX+_0xb38c43;}export function isExternalSegmentRef(_0x268802){const _0x4dc06f=a147_0x29fd;return _0x268802[_0x4dc06f(0x13f)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x37a133){const _0x1154f0=a147_0x29fd;return!!(_0x37a133[_0x1154f0(0x126)]&&_0x37a133['journeys']['length']>0x0);}export function isMultiVersionMode(_0x5a3241){const _0x43c192=a147_0x29fd;return!!(_0x5a3241['versions']&&_0x5a3241[_0x43c192(0xda)][_0x43c192(0x163)]>0x0);}export function isSingleVersionMode(_0x3d1414){const _0x3326dc=a147_0x29fd;return!!(_0x3d1414[_0x3326dc(0x10e)]&&_0x3d1414['stages']['length']>0x0);}export function hasMultipleVersions(_0x36b211){const _0x5d5f8d=a147_0x29fd;if(isJourneysArrayMode(_0x36b211))return(_0x36b211['journeys']?.['length']||0x0)>0x1;if(isMultiVersionMode(_0x36b211))return(_0x36b211[_0x5d5f8d(0xda)]?.[_0x5d5f8d(0x163)]||0x0)>0x1;return![];}function a147_0x187a(){const _0x3c2831=['activation_template_id','no_reentry','\x27:\x20','segments:','goal','Activation','stages','wait','values','decision_point','35FAFXUm','data','Journey\x20description','Wait\x201\x20Day','shift','Met\x20condition(s)','version','8214904jeYNWJ','resolveActivationName','folder','match','rule','add','embedded','week','test','journeyName','name','Goal\x20Achieved','from','journeys','journeyBundleName','Stage\x20Complete','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','unit','conditionSegmentId','activations','resolveStageId','JOURNEY_SYNTAX_ERROR','randomUUID','excluded','customizedSplit','reentryMode','resolveEmbeddedSegmentId','day','folder_id','resolveActivation','waitStepUnit','8138730MPTEXC','entry_criteria','type','journeyActivationStepId','ABTest','DaysOfTheWeek','And','startsWith','find','resolveSegmentId','versions:','parentFolder','AbTest','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','allowReentry','2410569NhDeZX','journeys:','resolveSegmentName','entryCriteria','trim','variants','journeyStages','ref','isArray','Jump','DecisionPoint','has','resolveJourneyId','\x20\x20rule:\x0a','resolveActivationId','description','entries','sort','toLowerCase','size','definition','milestone','uniqueId','8maghoZ','your-activation-name','unique_id','set','exitCriterias','length','stage','\x20\x20\x20\x20conditions:\x0a','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','launched','reentry_always','version_number','Duration','condition','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','segments','stageName','waitUntilDate','draft','exit_criteria','percentage','days_of_week','push','next','with','segmentId','resolveEmbeddedActivationId','jump','get','connection','relationships','waitStep','target','9xSVFBL','customized_split','WaitStep','waitCondition','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','timeout','2360696LTKDSf','Date','daysOfWeek','resolveJumpTarget','conditions','Merge','connector_config','Condition','replace','state','duration','conditionTimeoutUnit','end','conditionTimeoutDuration','segment','activation','End','attributes','versions','resolveSegment','waitStepType','map','bundle_id','Variant','journeyId','reentry:','Stage\x201','latest','root_step','all','includes','all_columns','filter','journeyStageId','\x20\x20\x20\x20type:\x20','346182pyHodp','goal-segment','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','goal:','null','days','merge','311314DuxcZH','schedule','journey','isJourneyLocal','stageId','bundle_name','moveAfter','segment_id','ab_test','journeyBundleId','keys','object','timedOutPath','8063361jMkeKk','wait_until','branches','steps','rootStep','behavior','*Max\x20wait\x20','reentry','uuid'];a147_0x187a=function(){return _0x3c2831;};return a147_0x187a();}export function normalizeToJourneysFormat(_0x36b059){const _0x3e074e=a147_0x29fd;if(isJourneysArrayMode(_0x36b059))return _0x36b059;if(isSingleVersionMode(_0x36b059)){const {stages:_0x1017a8,id:_0x142c86,version:_0xd83009,version_number:_0x4955d8,..._0x1aa850}=_0x36b059;return{..._0x1aa850,'journeys':[{'version':_0xd83009||'v1','stages':_0x1017a8||[],'id':_0x142c86,'version_number':_0x4955d8}]};}if(isMultiVersionMode(_0x36b059)){const {versions:_0x1ae4a6,..._0x133bca}=_0x36b059;return{..._0x133bca,'journeys':(_0x1ae4a6||[])[_0x3e074e(0xdd)](_0x2c0c35=>({'version':_0x2c0c35[_0x3e074e(0x123)],'state':_0x2c0c35[_0x3e074e(0xd1)],'latest':_0x2c0c35[_0x3e074e(0xe3)],'stages':_0x2c0c35[_0x3e074e(0x10e)],'id':_0x2c0c35['id'],'version_number':_0x2c0c35[_0x3e074e(0x169)]}))};}return _0x36b059;}export function normalizeJourneyDef(_0x5556cd,_0x56679d){const _0x3cac6a=a147_0x29fd,_0x56e8a2=normalizeToJourneysFormat(_0x5556cd),_0x4dec2e=_0x56679d?.[_0x3cac6a(0x16d)]?Object['keys'](_0x56679d[_0x3cac6a(0x16d)]):undefined,_0x55ad9b=_0x56679d?.[_0x3cac6a(0x12c)]?Object[_0x3cac6a(0xfc)](_0x56679d[_0x3cac6a(0x12c)]):undefined;return{'type':'journey','name':_0x56e8a2[_0x3cac6a(0x123)],..._0x56e8a2[_0x3cac6a(0x156)]!==undefined&&{'description':_0x56e8a2[_0x3cac6a(0x156)]},..._0x56e8a2[_0x3cac6a(0x10c)]&&{'goal':normalizeJourneyCriteria(_0x56e8a2[_0x3cac6a(0x10c)])},..._0x56e8a2['reentry']!==undefined&&{'reentry':_0x56e8a2[_0x3cac6a(0x106)]},..._0x56e8a2[_0x3cac6a(0x16d)]&&{'segments':normalizeEmbeddedSegments(_0x56e8a2['segments'],_0x4dec2e)},..._0x56e8a2[_0x3cac6a(0x12c)]&&{'activations':normalizeEmbeddedActivations(_0x56e8a2[_0x3cac6a(0x12c)],_0x55ad9b)},..._0x56e8a2[_0x3cac6a(0x126)]&&{'journeys':_0x56e8a2[_0x3cac6a(0x126)]['map'](_0x194bf3=>normalizeJourneyEntry(_0x194bf3,_0x56e8a2['journeys'][_0x3cac6a(0x163)]===0x1))}};}function normalizeJourneyEntry(_0x50096f,_0x48af00){const _0x3d5d69=a147_0x29fd;return{...!_0x48af00&&_0x50096f[_0x3d5d69(0x118)]!==undefined&&{'version':_0x50096f[_0x3d5d69(0x118)]},..._0x50096f[_0x3d5d69(0xd1)]!==undefined&&{'state':_0x50096f['state']},...!_0x48af00&&_0x50096f[_0x3d5d69(0xe3)]!==undefined&&{'latest':_0x50096f['latest']},..._0x50096f['version_number']!==undefined&&{'version_number':_0x50096f[_0x3d5d69(0x169)]},..._0x50096f[_0x3d5d69(0x10c)]&&{'goal':normalizeJourneyCriteria(_0x50096f[_0x3d5d69(0x10c)])},..._0x50096f[_0x3d5d69(0x106)]!==undefined&&{'reentry':_0x50096f[_0x3d5d69(0x106)]},'stages':_0x50096f[_0x3d5d69(0x10e)][_0x3d5d69(0xdd)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x112734){const _0x2d4377=a147_0x29fd;return{'name':_0x112734[_0x2d4377(0x123)],..._0x112734[_0x2d4377(0x156)]!==undefined&&{'description':_0x112734[_0x2d4377(0x156)]},..._0x112734[_0x2d4377(0x139)]&&{'entry_criteria':normalizeJourneyCriteria(_0x112734[_0x2d4377(0x139)])},..._0x112734[_0x2d4377(0x171)]&&{'exit_criteria':_0x112734[_0x2d4377(0x171)][_0x2d4377(0xdd)](normalizeJourneyCriteria)},..._0x112734[_0x2d4377(0x15c)]&&{'milestone':normalizeJourneyCriteria(_0x112734[_0x2d4377(0x15c)])},..._0x112734[_0x2d4377(0x102)]&&{'steps':normalizeStepsWithImplicitNext(_0x112734[_0x2d4377(0x102)])}};}function normalizeStepsWithImplicitNext(_0x28f12c){const _0x3f031d=a147_0x29fd;return _0x28f12c[_0x3f031d(0xdd)]((_0xe9523a,_0x42622)=>{const _0x183bc7=_0x3f031d,_0x12e526=_0x42622<_0x28f12c[_0x183bc7(0x163)]-0x1?_0x28f12c[_0x42622+0x1][_0x183bc7(0x123)]:undefined;return normalizeJourneyStep(_0xe9523a,_0x12e526);});}function a147_0x29fd(_0x28432c,_0x124894){_0x28432c=_0x28432c-0xc7;const _0x187af5=a147_0x187a();let _0x29fdce=_0x187af5[_0x28432c];return _0x29fdce;}function normalizeJourneyCriteria(_0x37d117){const _0xe27401=a147_0x29fd;return{'name':_0x37d117['name'],..._0x37d117['description']!==undefined&&{'description':_0x37d117['description']},'segment':_0x37d117[_0xe27401(0xd6)],..._0x37d117[_0xe27401(0x17e)]&&{'target':normalizeJumpTarget(_0x37d117[_0xe27401(0x17e)])}};}function normalizeJourneyStep(_0x2ae7c3,_0x4949b5){const _0x47a4fe=a147_0x29fd,_0x5d9196=_0x2ae7c3['next']!==undefined&&_0x2ae7c3[_0x47a4fe(0x175)]!==_0x4949b5,_0x4f8392={'type':_0x2ae7c3[_0x47a4fe(0x13a)],'name':_0x2ae7c3['name'],..._0x5d9196&&{'next':_0x2ae7c3[_0x47a4fe(0x175)]}};if(_0x47a4fe(0x176)in _0x2ae7c3&&_0x2ae7c3[_0x47a4fe(0x176)])return{..._0x4f8392,'with':normalizeStepParams(_0x2ae7c3[_0x47a4fe(0x13a)],_0x2ae7c3[_0x47a4fe(0x176)])};return _0x4f8392;}function normalizeStepParams(_0x3b183c,_0x52ed74){const _0x332743=a147_0x29fd;switch(_0x3b183c){case _0x332743(0x10f):{const _0x3a6d4d=_0x52ed74;let _0x4f61be;return _0x3a6d4d[_0x332743(0x16b)]&&(_0x4f61be={'segment':_0x3a6d4d[_0x332743(0x16b)][_0x332743(0xd6)],..._0x3a6d4d[_0x332743(0x16b)][_0x332743(0x175)]!==undefined&&{'next':_0x3a6d4d[_0x332743(0x16b)][_0x332743(0x175)]},..._0x3a6d4d[_0x332743(0x16b)][_0x332743(0xc7)]&&{'timeout':{'duration':_0x3a6d4d[_0x332743(0x16b)][_0x332743(0xc7)][_0x332743(0xd2)],'unit':_0x3a6d4d[_0x332743(0x16b)][_0x332743(0xc7)][_0x332743(0x12a)],..._0x3a6d4d['condition'][_0x332743(0xc7)]['next']!==undefined&&{'next':_0x3a6d4d[_0x332743(0x16b)][_0x332743(0xc7)]['next']}}}}),{..._0x3a6d4d[_0x332743(0xd2)]!==undefined&&{'duration':_0x3a6d4d['duration']},..._0x3a6d4d[_0x332743(0x12a)]!==undefined&&{'unit':_0x3a6d4d['unit']},..._0x3a6d4d[_0x332743(0x100)]!==undefined&&{'wait_until':_0x3a6d4d[_0x332743(0x100)]},..._0x3a6d4d[_0x332743(0x173)]!==undefined&&{'days_of_week':_0x3a6d4d['days_of_week']},..._0x4f61be&&{'condition':_0x4f61be}};}case _0x332743(0xd7):{const _0x5e0708=_0x52ed74;return{'activation':_0x5e0708[_0x332743(0xd7)]};}case _0x332743(0x111):{const _0x48f429=_0x52ed74;return{'branches':_0x48f429[_0x332743(0x101)][_0x332743(0xdd)](normalizeDecisionBranch)};}case _0x332743(0xfa):{const _0x1f3f44=_0x52ed74;return{..._0x1f3f44['customized_split']!==undefined&&{'customized_split':_0x1f3f44[_0x332743(0x180)]},..._0x1f3f44['unique_id']!==undefined&&{'unique_id':_0x1f3f44[_0x332743(0x160)]},'variants':_0x1f3f44[_0x332743(0x14c)][_0x332743(0xdd)](normalizeAbTestVariant)};}case _0x332743(0x179):{const _0x14bad9=_0x52ed74;return{'target':normalizeJumpTarget(_0x14bad9[_0x332743(0x17e)])};}default:return _0x52ed74;}}function normalizeDecisionBranch(_0x43acd1){const _0x37a91e=a147_0x29fd;return{'name':_0x43acd1['name'],..._0x43acd1[_0x37a91e(0xd6)]!==undefined&&{'segment':_0x43acd1['segment']},..._0x43acd1[_0x37a91e(0x130)]!==undefined&&{'excluded':_0x43acd1[_0x37a91e(0x130)]},..._0x43acd1[_0x37a91e(0x175)]!==undefined&&{'next':_0x43acd1[_0x37a91e(0x175)]}};}function normalizeAbTestVariant(_0x3bcda9){const _0x52af9b=a147_0x29fd;return{..._0x3bcda9['id']!==undefined&&{'id':_0x3bcda9['id']},'name':_0x3bcda9[_0x52af9b(0x123)],'percentage':_0x3bcda9[_0x52af9b(0x172)],..._0x3bcda9['next']!==undefined&&{'next':_0x3bcda9[_0x52af9b(0x175)]}};}function normalizeJumpTarget(_0x22f906){const _0x10e89d=a147_0x29fd;return{'journey':_0x22f906[_0x10e89d(0xf4)],'stage':_0x22f906[_0x10e89d(0x164)],..._0x22f906[_0x10e89d(0xde)]!==undefined&&{'bundle_id':_0x22f906[_0x10e89d(0xde)]}};}function normalizeEmbeddedSegments(_0x34efd6,_0xc1a1b2){const _0x5ebad1=a147_0x29fd,_0x5b4f33={},_0x477a33=Object[_0x5ebad1(0xfc)](_0x34efd6),_0x40726f=_0xc1a1b2?[..._0xc1a1b2['filter'](_0x1ca7dd=>_0x477a33[_0x5ebad1(0xe6)](_0x1ca7dd)),..._0x477a33[_0x5ebad1(0xe8)](_0x4aceea=>!_0xc1a1b2[_0x5ebad1(0xe6)](_0x4aceea))[_0x5ebad1(0x158)]()]:_0x477a33[_0x5ebad1(0x158)]();for(const _0x4f7ee4 of _0x40726f){const _0x5c63c9=_0x34efd6[_0x4f7ee4];if(_0x5c63c9['rule']){const _0x53d305=_0x5c63c9[_0x5ebad1(0x11d)];if(_0x53d305[_0x5ebad1(0x13a)]!==_0x5ebad1(0x13e)&&_0x53d305['type']!=='Or'){const _0x8d065e=_0x53d305[_0x5ebad1(0x13a)]??'(missing)';throw new SDKError(ErrorCode[_0x5ebad1(0x12e)],_0x5ebad1(0x145)+_0x4f7ee4+'\x27:\x20'+(_0x5ebad1(0x129)+_0x8d065e+'\x27.\x0a')+'Expected\x20format:\x0a'+_0x5ebad1(0x154)+'\x20\x20\x20\x20type:\x20And\x0a'+_0x5ebad1(0x165)+_0x5ebad1(0x183)+_0x5ebad1(0xed)+_0x5ebad1(0x16c));}if(!_0x53d305[_0x5ebad1(0xcc)]||!Array[_0x5ebad1(0x14f)](_0x53d305[_0x5ebad1(0xcc)]))throw new SDKError(ErrorCode[_0x5ebad1(0x12e)],_0x5ebad1(0x145)+_0x4f7ee4+_0x5ebad1(0x10a)+'rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a'+'Expected\x20format:\x0a'+_0x5ebad1(0x154)+(_0x5ebad1(0xea)+_0x53d305[_0x5ebad1(0x13a)]+'\x0a')+_0x5ebad1(0x165)+_0x5ebad1(0x183)+_0x5ebad1(0xed)+_0x5ebad1(0x16c));}_0x5b4f33[_0x4f7ee4]={..._0x5c63c9[_0x5ebad1(0x156)]&&_0x5c63c9['description'][_0x5ebad1(0x14b)]()&&{'description':_0x5c63c9[_0x5ebad1(0x156)]},..._0x5c63c9[_0x5ebad1(0x11d)]&&{'rule':deepSortObject(_0x5c63c9['rule'])}};}return _0x5b4f33;}function normalizeEmbeddedActivations(_0x4132e9,_0x3838f){const _0x1d2bcd=a147_0x29fd,_0x419553={},_0x3b4f05=Object[_0x1d2bcd(0xfc)](_0x4132e9),_0xb29ccd=_0x3838f?[..._0x3838f[_0x1d2bcd(0xe8)](_0xfc22a6=>_0x3b4f05[_0x1d2bcd(0xe6)](_0xfc22a6)),..._0x3b4f05[_0x1d2bcd(0xe8)](_0x11d869=>!_0x3838f[_0x1d2bcd(0xe6)](_0x11d869))['sort']()]:_0x3b4f05[_0x1d2bcd(0x158)]();for(const _0x197c49 of _0xb29ccd){const _0x3eb734=_0x4132e9[_0x197c49];_0x419553[_0x197c49]={'name':_0x3eb734[_0x1d2bcd(0x123)],'connection':_0x3eb734[_0x1d2bcd(0x17b)],..._0x3eb734[_0x1d2bcd(0x156)]!==undefined&&{'description':_0x3eb734[_0x1d2bcd(0x156)]},..._0x3eb734[_0x1d2bcd(0xe7)]!==undefined&&{'all_columns':_0x3eb734['all_columns']},..._0x3eb734['columns']!==undefined&&{'columns':_0x3eb734['columns']},..._0x3eb734[_0x1d2bcd(0x104)]!==undefined&&{'behavior':_0x3eb734[_0x1d2bcd(0x104)]},..._0x3eb734[_0x1d2bcd(0xf3)]!==undefined&&{'schedule':_0x3eb734[_0x1d2bcd(0xf3)]},..._0x3eb734['notification']!==undefined&&{'notification':_0x3eb734['notification']},..._0x3eb734[_0x1d2bcd(0xce)]!==undefined&&{'connector_config':_0x3eb734[_0x1d2bcd(0xce)]},..._0x3eb734[_0x1d2bcd(0x108)]!==undefined&&{'activation_template_id':_0x3eb734[_0x1d2bcd(0x108)]}};}return _0x419553;}export function getActiveStages(_0xc5b5a2){const _0xfe7e43=a147_0x29fd;if(isJourneysArrayMode(_0xc5b5a2)){const _0x5c1a95=_0xc5b5a2[_0xfe7e43(0x126)]||[],_0x538914=_0x5c1a95[_0xfe7e43(0x140)](_0x571701=>_0x571701[_0xfe7e43(0xe3)]===!![])||_0x5c1a95[0x0];return _0x538914?.[_0xfe7e43(0x10e)]||[];}if(isSingleVersionMode(_0xc5b5a2))return _0xc5b5a2[_0xfe7e43(0x10e)]||[];if(isMultiVersionMode(_0xc5b5a2)){const _0x56d6b0=_0xc5b5a2[_0xfe7e43(0xda)]||[],_0x587d89=_0x56d6b0['find'](_0x333d54=>_0x333d54[_0xfe7e43(0xe3)]===!![])||_0x56d6b0[0x0];return _0x587d89?.[_0xfe7e43(0x10e)]||[];}return[];}export function getLatestJourneyEntry(_0x4fac1e){const _0x3bb1fc=a147_0x29fd;if(isJourneysArrayMode(_0x4fac1e)){const _0x5a1d9e=_0x4fac1e[_0x3bb1fc(0x126)]||[];return _0x5a1d9e[_0x3bb1fc(0x140)](_0x317b9a=>_0x317b9a[_0x3bb1fc(0xe3)]===!![])||_0x5a1d9e[0x0];}if(isMultiVersionMode(_0x4fac1e)){const _0x302bbf=_0x4fac1e[_0x3bb1fc(0xda)]||[],_0xd7ddd=_0x302bbf[_0x3bb1fc(0x140)](_0x18fc54=>_0x18fc54['latest']===!![])||_0x302bbf[0x0];if(_0xd7ddd)return{'version':_0xd7ddd[_0x3bb1fc(0x123)],'state':_0xd7ddd[_0x3bb1fc(0xd1)],'latest':_0xd7ddd[_0x3bb1fc(0xe3)],'stages':_0xd7ddd[_0x3bb1fc(0x10e)],'id':_0xd7ddd['id'],'version_number':_0xd7ddd[_0x3bb1fc(0x169)]};}if(isSingleVersionMode(_0x4fac1e))return{'version':_0x4fac1e[_0x3bb1fc(0x118)]||'v1','state':'draft','stages':_0x4fac1e['stages']||[],'id':_0x4fac1e['id'],'version_number':_0x4fac1e['version_number'],'goal':_0x4fac1e[_0x3bb1fc(0x10c)],'reentry':_0x4fac1e['reentry']};return undefined;}export function getLatestVersion(_0x57f79c){const _0x15186d=a147_0x29fd;if(!isMultiVersionMode(_0x57f79c))return undefined;const _0x10215d=_0x57f79c['versions']||[];return _0x10215d[_0x15186d(0x140)](_0x43db36=>_0x43db36[_0x15186d(0xe3)]===!![])||_0x10215d[0x0];}export function getEffectiveGoal(_0x5ef96f){const _0x132b10=a147_0x29fd,_0x59cf3e=getLatestJourneyEntry(_0x5ef96f);return _0x59cf3e?.[_0x132b10(0x10c)]||_0x5ef96f['goal'];}export function getEffectiveReentry(_0x31dfd6){const _0x147c7d=a147_0x29fd,_0x5efc43=getLatestJourneyEntry(_0x31dfd6);return _0x5efc43?.[_0x147c7d(0x106)]||_0x31dfd6[_0x147c7d(0x106)];}export function collectSegmentRefs(_0x1fd823){const _0x16122c=a147_0x29fd,_0x6b2100=new Set();_0x1fd823['goal']?.[_0x16122c(0xd6)]&&_0x6b2100[_0x16122c(0x11e)](_0x1fd823[_0x16122c(0x10c)][_0x16122c(0xd6)]);const _0x1d914b=_0x430596=>{const _0x38cba4=_0x16122c;for(const _0x437705 of _0x430596){_0x437705['entry_criteria']?.[_0x38cba4(0xd6)]&&_0x6b2100[_0x38cba4(0x11e)](_0x437705[_0x38cba4(0x139)]['segment']);if(_0x437705['exit_criteria'])for(const _0x371c62 of _0x437705[_0x38cba4(0x171)]){_0x371c62[_0x38cba4(0xd6)]&&_0x6b2100['add'](_0x371c62[_0x38cba4(0xd6)]);}_0x437705[_0x38cba4(0x15c)]?.[_0x38cba4(0xd6)]&&_0x6b2100[_0x38cba4(0x11e)](_0x437705[_0x38cba4(0x15c)][_0x38cba4(0xd6)]);if(_0x437705[_0x38cba4(0x102)])for(const _0x4345a7 of _0x437705['steps']){if(_0x4345a7['type']===_0x38cba4(0x111)){const _0xc65e78=_0x4345a7;for(const _0x3dbc2d of _0xc65e78['with'][_0x38cba4(0x101)]){_0x3dbc2d[_0x38cba4(0xd6)]&&_0x6b2100[_0x38cba4(0x11e)](_0x3dbc2d[_0x38cba4(0xd6)]);}}else{if(_0x4345a7['type']==='wait'){const _0x3e9ffb=_0x4345a7;_0x3e9ffb['with']['condition']?.[_0x38cba4(0xd6)]&&_0x6b2100[_0x38cba4(0x11e)](_0x3e9ffb['with'][_0x38cba4(0x16b)][_0x38cba4(0xd6)]);}}}}};_0x1fd823[_0x16122c(0x10e)]&&_0x1d914b(_0x1fd823[_0x16122c(0x10e)]);if(_0x1fd823[_0x16122c(0xda)])for(const _0x3ad583 of _0x1fd823[_0x16122c(0xda)]){_0x1d914b(_0x3ad583[_0x16122c(0x10e)]);}return _0x6b2100;}export function validateSegmentRefs(_0x11231f){const _0x17aec5=a147_0x29fd,_0x3c818c=[],_0x18640a=collectSegmentRefs(_0x11231f),_0x43d6fe=new Set(Object[_0x17aec5(0xfc)](_0x11231f[_0x17aec5(0x16d)]||{}));for(const _0x3b499b of _0x18640a){const _0x547b79=parseSegmentRef(_0x3b499b);_0x547b79[_0x17aec5(0x13a)]===_0x17aec5(0x11f)&&!_0x43d6fe[_0x17aec5(0x152)](_0x547b79[_0x17aec5(0x123)])&&_0x3c818c[_0x17aec5(0x174)]('Unknown\x20segment\x20\x22'+_0x547b79[_0x17aec5(0x123)]+_0x17aec5(0x166)+_0x547b79[_0x17aec5(0x123)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0x3c818c;}export function collectSegmentIdsFromJourneyApi(_0x7c414c){const _0x4f859d=a147_0x29fd,_0x5e845a=new Set();_0x7c414c[_0x4f859d(0xd9)][_0x4f859d(0x10c)]?.[_0x4f859d(0x177)]&&_0x5e845a[_0x4f859d(0x11e)](_0x7c414c[_0x4f859d(0xd9)][_0x4f859d(0x10c)]['segmentId']);const _0x2b817f=_0x7c414c[_0x4f859d(0xd9)][_0x4f859d(0x14d)];if(Array['isArray'](_0x2b817f))for(const _0x1d36ce of _0x2b817f){_0x1d36ce[_0x4f859d(0x14a)]?.[_0x4f859d(0x177)]&&_0x5e845a['add'](_0x1d36ce[_0x4f859d(0x14a)][_0x4f859d(0x177)]);const _0x24772f=_0x1d36ce[_0x4f859d(0x162)]??_0x1d36ce['exitCriteria'];if(Array[_0x4f859d(0x14f)](_0x24772f))for(const _0x1f2820 of _0x24772f){_0x1f2820[_0x4f859d(0x177)]&&_0x5e845a[_0x4f859d(0x11e)](_0x1f2820[_0x4f859d(0x177)]);}_0x1d36ce[_0x4f859d(0x15c)]?.[_0x4f859d(0x177)]&&_0x5e845a[_0x4f859d(0x11e)](_0x1d36ce['milestone']['segmentId']);if(_0x1d36ce[_0x4f859d(0x102)]&&typeof _0x1d36ce[_0x4f859d(0x102)]===_0x4f859d(0xfd)){const _0x3cce97=Array[_0x4f859d(0x14f)](_0x1d36ce['steps'])?_0x1d36ce[_0x4f859d(0x102)]:Object[_0x4f859d(0x110)](_0x1d36ce[_0x4f859d(0x102)]);for(const _0x4f1bbf of _0x3cce97){_0x4f1bbf['waitCondition']?.[_0x4f859d(0x177)]&&_0x5e845a[_0x4f859d(0x11e)](_0x4f1bbf[_0x4f859d(0x182)][_0x4f859d(0x177)]);const _0x5c0517=_0x4f1bbf;_0x5c0517['conditionSegmentId']&&_0x5e845a[_0x4f859d(0x11e)](_0x5c0517[_0x4f859d(0x12b)]);if(Array[_0x4f859d(0x14f)](_0x5c0517[_0x4f859d(0xcc)]))for(const _0x339e66 of _0x5c0517[_0x4f859d(0xcc)]){_0x339e66[_0x4f859d(0x177)]&&_0x5e845a['add'](_0x339e66[_0x4f859d(0x177)]);}if(Array[_0x4f859d(0x14f)](_0x4f1bbf[_0x4f859d(0x101)]))for(const _0x49827d of _0x4f1bbf['branches']){_0x49827d[_0x4f859d(0x177)]&&_0x5e845a['add'](_0x49827d['segmentId']);}}}}return _0x5e845a;}
@@ -1 +1 @@
1
- const a148_0x4dd79f=a148_0x42b2;(function(_0x193a06,_0x145b4e){const _0x40fb7d=a148_0x42b2,_0x31c62b=_0x193a06();while(!![]){try{const _0x15b54a=-parseInt(_0x40fb7d(0x15b))/0x1+-parseInt(_0x40fb7d(0x162))/0x2+-parseInt(_0x40fb7d(0x15d))/0x3*(parseInt(_0x40fb7d(0x165))/0x4)+-parseInt(_0x40fb7d(0x17b))/0x5+-parseInt(_0x40fb7d(0x184))/0x6+parseInt(_0x40fb7d(0x17f))/0x7+parseInt(_0x40fb7d(0x172))/0x8*(parseInt(_0x40fb7d(0x16f))/0x9);if(_0x15b54a===_0x145b4e)break;else _0x31c62b['push'](_0x31c62b['shift']());}catch(_0x430510){_0x31c62b['push'](_0x31c62b['shift']());}}}(a148_0x136e,0xe9cef));function a148_0x42b2(_0x5d6561,_0x4186ac){_0x5d6561=_0x5d6561-0x14a;const _0x136edd=a148_0x136e();let _0x42b28b=_0x136edd[_0x5d6561];return _0x42b28b;}export const DEFAULT_TIME_RANGE=a148_0x4dd79f(0x164);function a148_0x136e(){const _0x3772f2=['\x20IS\x20NOT\x20NULL\x0a','push','length','behaviors','\x20m\x0aJOIN\x20','find','map','\x20AS\x20','\x20=\x20a.','\x20b\x0a\x20\x20ON\x20m.','columns','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','table','\x20=\x20','841141qidcHl','\x0aLIMIT\x20','3232512IOaxJF','all_columns','forEach','parent_key','m.*','1679286xcAFxB','\x0aSELECT\x20','-1d','4IMpZPg','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','child_key','database','test','trim','\x20LIMIT\x200','LEFT\x20JOIN\x20','\x0aFROM\x20','\x20a\x0a\x20\x20ON\x20m.','54mLlUfm','(all\x20columns)','\x0aSELECT\x20m.','6533544LwriFP','attributes','\x20LIMIT\x20','master','SELECT\x20*\x20FROM\x20','\x20FROM\x20','b.*','source','column','552420ZGQupn','name','\x0aLIMIT\x200\x0a','join','774186hSUpNi','label','\x27)\x0a','\x0aWHERE\x20a.','SELECT\x20','7105830XHidvE','\x20=\x20b.','\x20m\x0a','toLowerCase','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20'];a148_0x136e=function(){return _0x3772f2;};return a148_0x136e();}export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x1203bb,_0x473604,_0x3da288){const _0x20162=a148_0x4dd79f,_0x1b5881=_0x3da288&&_0x3da288[_0x20162(0x14f)]>0x0?_0x3da288[_0x20162(0x17e)](',\x20'):'*';return _0x20162(0x183)+_0x1b5881+_0x20162(0x177)+_0x1203bb+'.'+_0x473604+_0x20162(0x16b);}export function generateMasterCountSQL(_0x2033be){const _0x540c1d=a148_0x4dd79f,{database:_0x524145,table:_0x1f630d}=_0x2033be[_0x540c1d(0x175)];return'SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20'+_0x524145+'.'+_0x1f630d;}export function generateMasterSampleSQL(_0x1da2a4,_0x58ac10=0x5){const _0x1e03b8=a148_0x4dd79f,{database:_0x5510f3,table:_0x44aa6c}=_0x1da2a4[_0x1e03b8(0x175)];return _0x1e03b8(0x176)+_0x5510f3+'.'+_0x44aa6c+_0x1e03b8(0x174)+_0x58ac10;}export function generateAttributeCoverageSQL(_0x3fd70b,_0x9207){const _0x508119=a148_0x4dd79f,_0x36a3e8=_0x3fd70b[_0x508119(0x175)];return(_0x508119(0x14c)+_0x36a3e8[_0x508119(0x168)]+'.'+_0x36a3e8[_0x508119(0x159)]+'\x20m\x0aLEFT\x20JOIN\x20'+_0x9207[_0x508119(0x179)][_0x508119(0x168)]+'.'+_0x9207['source'][_0x508119(0x159)]+_0x508119(0x16e)+_0x9207[_0x508119(0x17e)]['parent_key']+_0x508119(0x155)+_0x9207['join'][_0x508119(0x167)]+_0x508119(0x182)+_0x9207[_0x508119(0x17e)][_0x508119(0x167)]+_0x508119(0x14d))[_0x508119(0x16a)]();}export function generateBehaviorStatsSQL(_0x2beda2,_0x188c0d,_0x17ce1d=DEFAULT_TIME_RANGE){const _0x3a1edc=a148_0x4dd79f,_0x267692=_0x2beda2[_0x3a1edc(0x175)];return(_0x3a1edc(0x158)+_0x188c0d[_0x3a1edc(0x17e)][_0x3a1edc(0x160)]+')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20'+_0x267692[_0x3a1edc(0x168)]+'.'+_0x267692[_0x3a1edc(0x159)]+_0x3a1edc(0x151)+_0x188c0d[_0x3a1edc(0x179)][_0x3a1edc(0x168)]+'.'+_0x188c0d[_0x3a1edc(0x179)][_0x3a1edc(0x159)]+_0x3a1edc(0x156)+_0x188c0d[_0x3a1edc(0x17e)]['parent_key']+_0x3a1edc(0x185)+_0x188c0d['join'][_0x3a1edc(0x167)]+_0x3a1edc(0x166)+_0x17ce1d+_0x3a1edc(0x181))['trim']();}export function generateAttributeSampleSQL(_0xb556b3,_0x25b5aa,_0x2d07a4=0x5){const _0x409e2a=a148_0x4dd79f,_0x4d62e5=_0xb556b3[_0x409e2a(0x175)],_0x50e801=_0x25b5aa[_0x409e2a(0x17e)]['parent_key'],_0x54f70e=_0x25b5aa[_0x409e2a(0x157)][_0x409e2a(0x153)](_0x210bf9=>'a.'+_0x210bf9[_0x409e2a(0x17a)])[_0x409e2a(0x17e)](',\x20');return(_0x409e2a(0x171)+_0x50e801+',\x20'+_0x54f70e+_0x409e2a(0x16d)+_0x4d62e5[_0x409e2a(0x168)]+'.'+_0x4d62e5[_0x409e2a(0x159)]+'\x20m\x0aJOIN\x20'+_0x25b5aa[_0x409e2a(0x179)][_0x409e2a(0x168)]+'.'+_0x25b5aa['source']['table']+_0x409e2a(0x16e)+_0x25b5aa[_0x409e2a(0x17e)][_0x409e2a(0x160)]+_0x409e2a(0x155)+_0x25b5aa[_0x409e2a(0x17e)][_0x409e2a(0x167)]+_0x409e2a(0x15c)+_0x2d07a4+'\x0a')[_0x409e2a(0x16a)]();}export function generateBehaviorSampleSQL(_0x386917,_0x1907ff,_0x5be1dd=0x5,_0x14ebf1=DEFAULT_TIME_RANGE){const _0x504942=a148_0x4dd79f,_0x393c45=_0x386917[_0x504942(0x175)],_0x3020af=_0x1907ff[_0x504942(0x17e)]['parent_key'];let _0x389a44;if(_0x1907ff[_0x504942(0x15e)])_0x389a44='b.*';else _0x1907ff['columns']&&_0x1907ff[_0x504942(0x157)]['length']>0x0?_0x389a44=_0x1907ff[_0x504942(0x157)]['map'](_0x2a27ad=>'b.'+_0x2a27ad[_0x504942(0x17a)])['join'](',\x20'):_0x389a44=_0x504942(0x178);return('\x0aSELECT\x20m.'+_0x3020af+',\x20'+_0x389a44+'\x0aFROM\x20'+_0x393c45[_0x504942(0x168)]+'.'+_0x393c45['table']+_0x504942(0x151)+_0x1907ff[_0x504942(0x179)][_0x504942(0x168)]+'.'+_0x1907ff[_0x504942(0x179)][_0x504942(0x159)]+'\x20b\x0a\x20\x20ON\x20m.'+_0x1907ff[_0x504942(0x17e)]['parent_key']+_0x504942(0x185)+_0x1907ff[_0x504942(0x17e)][_0x504942(0x167)]+_0x504942(0x166)+_0x14ebf1+'\x27)\x0aLIMIT\x20'+_0x5be1dd+'\x0a')[_0x504942(0x16a)]();}function quoteIdentifier(_0x481d76){const _0x491496=a148_0x4dd79f;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x491496(0x169)](_0x481d76))return'\x22'+_0x481d76['replace'](/"/g,'\x22\x22')+'\x22';return _0x481d76;}export function generateEnrichedSQL(_0xd3081e,_0x315ad2=0x5){const _0x446e88=a148_0x4dd79f,_0x5ec52d=_0xd3081e[_0x446e88(0x175)],_0x4c2d45=_0xd3081e[_0x446e88(0x173)]||[];if(_0x4c2d45[_0x446e88(0x14f)]===0x0)return'SELECT\x20*\x20FROM\x20'+_0x5ec52d[_0x446e88(0x168)]+'.'+_0x5ec52d[_0x446e88(0x159)]+_0x446e88(0x174)+_0x315ad2;const _0x402b97=[_0x446e88(0x161)],_0x5d50fd=[];return _0x4c2d45[_0x446e88(0x15f)]((_0x957747,_0x4233d9)=>{const _0xca3a0c=_0x446e88,_0x266080='a'+_0x4233d9;_0x957747[_0xca3a0c(0x157)][_0xca3a0c(0x15f)](_0x2b184a=>{const _0x3bc4e0=_0xca3a0c,_0x4a438b=quoteIdentifier(_0x2b184a['label']||_0x2b184a[_0x3bc4e0(0x17a)]);_0x402b97[_0x3bc4e0(0x14e)](_0x266080+'.'+_0x2b184a[_0x3bc4e0(0x17a)]+_0x3bc4e0(0x154)+_0x4a438b);}),_0x5d50fd[_0xca3a0c(0x14e)](_0xca3a0c(0x16c)+_0x957747['source']['database']+'.'+_0x957747[_0xca3a0c(0x179)][_0xca3a0c(0x159)]+'\x20'+_0x266080+'\x0a\x20\x20ON\x20m.'+_0x957747['join'][_0xca3a0c(0x160)]+_0xca3a0c(0x15a)+_0x266080+'.'+_0x957747[_0xca3a0c(0x17e)]['child_key']);}),(_0x446e88(0x163)+_0x402b97[_0x446e88(0x17e)](',\x20')+_0x446e88(0x16d)+_0x5ec52d[_0x446e88(0x168)]+'.'+_0x5ec52d[_0x446e88(0x159)]+_0x446e88(0x14a)+_0x5d50fd['join']('\x0a')+_0x446e88(0x15c)+_0x315ad2+'\x0a')[_0x446e88(0x16a)]();}export function generateAttributeSchemaSQL(_0x16b78b,_0x562386){const _0x2f9f75=a148_0x4dd79f,_0x164cf9=_0x16b78b['master'],_0x43cb05=_0x562386['join']['parent_key'],_0x4acbfc=_0x562386[_0x2f9f75(0x157)][_0x2f9f75(0x153)](_0x554232=>'a.'+_0x554232[_0x2f9f75(0x17a)])[_0x2f9f75(0x17e)](',\x20');return(_0x2f9f75(0x171)+_0x43cb05+',\x20'+_0x4acbfc+'\x0aFROM\x20'+_0x164cf9[_0x2f9f75(0x168)]+'.'+_0x164cf9['table']+_0x2f9f75(0x151)+_0x562386[_0x2f9f75(0x179)]['database']+'.'+_0x562386[_0x2f9f75(0x179)]['table']+_0x2f9f75(0x16e)+_0x562386[_0x2f9f75(0x17e)][_0x2f9f75(0x160)]+_0x2f9f75(0x155)+_0x562386[_0x2f9f75(0x17e)][_0x2f9f75(0x167)]+_0x2f9f75(0x17d))[_0x2f9f75(0x16a)]();}export function generateBehaviorSchemaSQL(_0xc8d08a,_0xd843d6){const _0x546d5d=a148_0x4dd79f,_0x430cbc=_0xc8d08a[_0x546d5d(0x175)],_0x4aa3e0=_0xd843d6[_0x546d5d(0x17e)][_0x546d5d(0x160)];let _0xa8052e;if(_0xd843d6[_0x546d5d(0x15e)])_0xa8052e=_0x546d5d(0x178);else _0xd843d6[_0x546d5d(0x157)]&&_0xd843d6[_0x546d5d(0x157)][_0x546d5d(0x14f)]>0x0?_0xa8052e=_0xd843d6[_0x546d5d(0x157)]['map'](_0x20f50f=>'b.'+_0x20f50f[_0x546d5d(0x17a)])['join'](',\x20'):_0xa8052e='b.*';return(_0x546d5d(0x171)+_0x4aa3e0+',\x20'+_0xa8052e+'\x0aFROM\x20'+_0x430cbc[_0x546d5d(0x168)]+'.'+_0x430cbc[_0x546d5d(0x159)]+'\x20m\x0aJOIN\x20'+_0xd843d6['source'][_0x546d5d(0x168)]+'.'+_0xd843d6[_0x546d5d(0x179)][_0x546d5d(0x159)]+'\x20b\x0a\x20\x20ON\x20m.'+_0xd843d6['join'][_0x546d5d(0x160)]+_0x546d5d(0x185)+_0xd843d6[_0x546d5d(0x17e)]['child_key']+'\x0aLIMIT\x200\x0a')[_0x546d5d(0x16a)]();}export function getAttributeColumns(_0x4d987a){const _0x392531=a148_0x4dd79f;return _0x4d987a['columns']['map'](_0x2bd498=>({'label':_0x2bd498['label']||_0x2bd498[_0x392531(0x17a)],'column':_0x2bd498[_0x392531(0x17a)]}));}export function getBehaviorColumns(_0x1b8c9c){const _0x2394cb=a148_0x4dd79f;if(_0x1b8c9c['all_columns'])return[{'label':_0x2394cb(0x170),'column':'*'}];if(_0x1b8c9c['columns']&&_0x1b8c9c[_0x2394cb(0x157)]['length']>0x0)return _0x1b8c9c[_0x2394cb(0x157)][_0x2394cb(0x153)](_0x5d8e58=>({'label':_0x5d8e58[_0x2394cb(0x180)]||_0x5d8e58[_0x2394cb(0x17a)],'column':_0x5d8e58['column']}));return[{'label':_0x2394cb(0x170),'column':'*'}];}export function findAttributeByName(_0x3677b1,_0x28027c){const _0x359008=a148_0x4dd79f;return _0x3677b1[_0x359008(0x173)]?.[_0x359008(0x152)](_0x1a5569=>_0x1a5569[_0x359008(0x17c)][_0x359008(0x14b)]()===_0x28027c[_0x359008(0x14b)]());}export function findBehaviorByName(_0x47f7cd,_0xc35ef8){const _0x3bca55=a148_0x4dd79f;return _0x47f7cd[_0x3bca55(0x150)]?.[_0x3bca55(0x152)](_0x23f672=>_0x23f672[_0x3bca55(0x17c)][_0x3bca55(0x14b)]()===_0xc35ef8[_0x3bca55(0x14b)]());}
1
+ const a148_0x493cd7=a148_0x5eb2;(function(_0xed4756,_0x31c753){const _0x434d19=a148_0x5eb2,_0x2663e9=_0xed4756();while(!![]){try{const _0x49aa3a=-parseInt(_0x434d19(0x80))/0x1*(parseInt(_0x434d19(0x91))/0x2)+-parseInt(_0x434d19(0x8f))/0x3*(-parseInt(_0x434d19(0x67))/0x4)+-parseInt(_0x434d19(0x9b))/0x5+parseInt(_0x434d19(0x66))/0x6+-parseInt(_0x434d19(0x88))/0x7+parseInt(_0x434d19(0x78))/0x8+parseInt(_0x434d19(0x7d))/0x9;if(_0x49aa3a===_0x31c753)break;else _0x2663e9['push'](_0x2663e9['shift']());}catch(_0x13bfae){_0x2663e9['push'](_0x2663e9['shift']());}}}(a148_0x4a68,0x94489));export const DEFAULT_TIME_RANGE=a148_0x493cd7(0x89);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x2270b5,_0x5a0f71,_0x4042de){const _0x38ce10=a148_0x493cd7,_0x3b8644=_0x4042de&&_0x4042de[_0x38ce10(0x8b)]>0x0?_0x4042de[_0x38ce10(0x8e)](',\x20'):'*';return _0x38ce10(0x72)+_0x3b8644+'\x20FROM\x20'+_0x2270b5+'.'+_0x5a0f71+_0x38ce10(0x6f);}export function generateMasterCountSQL(_0x360c57){const {database:_0x3ef4c9,table:_0x557a3b}=_0x360c57['master'];return'SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20'+_0x3ef4c9+'.'+_0x557a3b;}export function generateMasterSampleSQL(_0x54973d,_0x2df0f4=0x5){const _0x4ab835=a148_0x493cd7,{database:_0x398458,table:_0x4af008}=_0x54973d[_0x4ab835(0x84)];return _0x4ab835(0x79)+_0x398458+'.'+_0x4af008+_0x4ab835(0x8c)+_0x2df0f4;}export function generateAttributeCoverageSQL(_0x4aeb9b,_0x1e4a52){const _0x4d5ea0=a148_0x493cd7,_0x68196d=_0x4aeb9b[_0x4d5ea0(0x84)];return(_0x4d5ea0(0x9a)+_0x68196d[_0x4d5ea0(0x76)]+'.'+_0x68196d['table']+_0x4d5ea0(0x6b)+_0x1e4a52['source'][_0x4d5ea0(0x76)]+'.'+_0x1e4a52[_0x4d5ea0(0x64)][_0x4d5ea0(0x73)]+_0x4d5ea0(0x83)+_0x1e4a52[_0x4d5ea0(0x8e)][_0x4d5ea0(0x85)]+_0x4d5ea0(0x6c)+_0x1e4a52['join']['child_key']+_0x4d5ea0(0x6d)+_0x1e4a52[_0x4d5ea0(0x8e)][_0x4d5ea0(0x86)]+'\x20IS\x20NOT\x20NULL\x0a')[_0x4d5ea0(0x93)]();}export function generateBehaviorStatsSQL(_0x3b2432,_0x200df8,_0xce75ec=DEFAULT_TIME_RANGE){const _0x498a66=a148_0x493cd7,_0xf2cfc4=_0x3b2432[_0x498a66(0x84)];return(_0x498a66(0x8a)+_0x200df8['join'][_0x498a66(0x85)]+_0x498a66(0x65)+_0xf2cfc4[_0x498a66(0x76)]+'.'+_0xf2cfc4[_0x498a66(0x73)]+_0x498a66(0x92)+_0x200df8[_0x498a66(0x64)][_0x498a66(0x76)]+'.'+_0x200df8['source'][_0x498a66(0x73)]+_0x498a66(0x98)+_0x200df8[_0x498a66(0x8e)][_0x498a66(0x85)]+_0x498a66(0x81)+_0x200df8[_0x498a66(0x8e)][_0x498a66(0x86)]+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0xce75ec+'\x27)\x0a')[_0x498a66(0x93)]();}export function generateAttributeSampleSQL(_0x1a7104,_0x295b57,_0x5f8759=0x5){const _0x3cf07e=a148_0x493cd7,_0xfab216=_0x1a7104['master'],_0xe28046=_0x295b57['join']['parent_key'],_0x52e0e2=_0x295b57[_0x3cf07e(0x7e)][_0x3cf07e(0x7c)](_0x588df6=>'a.'+_0x588df6[_0x3cf07e(0x9e)])[_0x3cf07e(0x8e)](',\x20');return(_0x3cf07e(0x9d)+_0xe28046+',\x20'+_0x52e0e2+_0x3cf07e(0x70)+_0xfab216[_0x3cf07e(0x76)]+'.'+_0xfab216['table']+_0x3cf07e(0x92)+_0x295b57[_0x3cf07e(0x64)][_0x3cf07e(0x76)]+'.'+_0x295b57[_0x3cf07e(0x64)][_0x3cf07e(0x73)]+_0x3cf07e(0x83)+_0x295b57['join']['parent_key']+_0x3cf07e(0x6c)+_0x295b57[_0x3cf07e(0x8e)][_0x3cf07e(0x86)]+'\x0aLIMIT\x20'+_0x5f8759+'\x0a')[_0x3cf07e(0x93)]();}export function generateBehaviorSampleSQL(_0x447e12,_0x16cb00,_0x3c14bf=0x5,_0x44ce26=DEFAULT_TIME_RANGE){const _0xa566dd=a148_0x493cd7,_0x194301=_0x447e12[_0xa566dd(0x84)],_0x2e435a=_0x16cb00[_0xa566dd(0x8e)][_0xa566dd(0x85)];let _0x4650a9;if(_0x16cb00[_0xa566dd(0x77)])_0x4650a9=_0xa566dd(0x6e);else _0x16cb00['columns']&&_0x16cb00['columns']['length']>0x0?_0x4650a9=_0x16cb00['columns'][_0xa566dd(0x7c)](_0x58bf5f=>'b.'+_0x58bf5f[_0xa566dd(0x9e)])[_0xa566dd(0x8e)](',\x20'):_0x4650a9=_0xa566dd(0x6e);return(_0xa566dd(0x9d)+_0x2e435a+',\x20'+_0x4650a9+_0xa566dd(0x70)+_0x194301[_0xa566dd(0x76)]+'.'+_0x194301[_0xa566dd(0x73)]+_0xa566dd(0x92)+_0x16cb00[_0xa566dd(0x64)][_0xa566dd(0x76)]+'.'+_0x16cb00[_0xa566dd(0x64)][_0xa566dd(0x73)]+_0xa566dd(0x98)+_0x16cb00[_0xa566dd(0x8e)]['parent_key']+_0xa566dd(0x81)+_0x16cb00[_0xa566dd(0x8e)]['child_key']+_0xa566dd(0x68)+_0x44ce26+_0xa566dd(0x69)+_0x3c14bf+'\x0a')[_0xa566dd(0x93)]();}function quoteIdentifier(_0x38e56e){if(/[\s\-\.\#\[\]\(\)]|^[0-9]/['test'](_0x38e56e))return'\x22'+_0x38e56e['replace'](/"/g,'\x22\x22')+'\x22';return _0x38e56e;}export function generateEnrichedSQL(_0x53480b,_0x31cd17=0x5){const _0x5f6093=a148_0x493cd7,_0x45925a=_0x53480b[_0x5f6093(0x84)],_0x1cafa5=_0x53480b[_0x5f6093(0x97)]||[];if(_0x1cafa5[_0x5f6093(0x8b)]===0x0)return'SELECT\x20*\x20FROM\x20'+_0x45925a[_0x5f6093(0x76)]+'.'+_0x45925a['table']+_0x5f6093(0x8c)+_0x31cd17;const _0x5b6843=[_0x5f6093(0x96)],_0x425fff=[];return _0x1cafa5[_0x5f6093(0x95)]((_0x45b7a9,_0x43a14a)=>{const _0x3d19b4=_0x5f6093,_0x3010d1='a'+_0x43a14a;_0x45b7a9['columns']['forEach'](_0x5d04ac=>{const _0x2b4ac5=a148_0x5eb2,_0x3b6146=quoteIdentifier(_0x5d04ac['label']||_0x5d04ac[_0x2b4ac5(0x9e)]);_0x5b6843[_0x2b4ac5(0x94)](_0x3010d1+'.'+_0x5d04ac[_0x2b4ac5(0x9e)]+_0x2b4ac5(0x75)+_0x3b6146);}),_0x425fff[_0x3d19b4(0x94)]('LEFT\x20JOIN\x20'+_0x45b7a9[_0x3d19b4(0x64)][_0x3d19b4(0x76)]+'.'+_0x45b7a9[_0x3d19b4(0x64)][_0x3d19b4(0x73)]+'\x20'+_0x3010d1+_0x3d19b4(0x71)+_0x45b7a9[_0x3d19b4(0x8e)][_0x3d19b4(0x85)]+_0x3d19b4(0x74)+_0x3010d1+'.'+_0x45b7a9['join'][_0x3d19b4(0x86)]);}),(_0x5f6093(0x9c)+_0x5b6843[_0x5f6093(0x8e)](',\x20')+'\x0aFROM\x20'+_0x45925a[_0x5f6093(0x76)]+'.'+_0x45925a[_0x5f6093(0x73)]+_0x5f6093(0x8d)+_0x425fff[_0x5f6093(0x8e)]('\x0a')+_0x5f6093(0x7a)+_0x31cd17+'\x0a')['trim']();}export function generateAttributeSchemaSQL(_0x189a9c,_0x4a7556){const _0x29b9f2=a148_0x493cd7,_0x28dc3f=_0x189a9c[_0x29b9f2(0x84)],_0x3317f4=_0x4a7556[_0x29b9f2(0x8e)]['parent_key'],_0x2166db=_0x4a7556[_0x29b9f2(0x7e)]['map'](_0xe1c66f=>'a.'+_0xe1c66f[_0x29b9f2(0x9e)])['join'](',\x20');return(_0x29b9f2(0x9d)+_0x3317f4+',\x20'+_0x2166db+_0x29b9f2(0x70)+_0x28dc3f[_0x29b9f2(0x76)]+'.'+_0x28dc3f['table']+'\x20m\x0aJOIN\x20'+_0x4a7556[_0x29b9f2(0x64)][_0x29b9f2(0x76)]+'.'+_0x4a7556['source'][_0x29b9f2(0x73)]+_0x29b9f2(0x83)+_0x4a7556[_0x29b9f2(0x8e)][_0x29b9f2(0x85)]+_0x29b9f2(0x6c)+_0x4a7556[_0x29b9f2(0x8e)][_0x29b9f2(0x86)]+'\x0aLIMIT\x200\x0a')[_0x29b9f2(0x93)]();}export function generateBehaviorSchemaSQL(_0x32835e,_0x519c03){const _0x214377=a148_0x493cd7,_0x321eb9=_0x32835e[_0x214377(0x84)],_0x5587f3=_0x519c03[_0x214377(0x8e)]['parent_key'];let _0x156800;if(_0x519c03[_0x214377(0x77)])_0x156800=_0x214377(0x6e);else _0x519c03[_0x214377(0x7e)]&&_0x519c03[_0x214377(0x7e)]['length']>0x0?_0x156800=_0x519c03[_0x214377(0x7e)]['map'](_0x15f2b5=>'b.'+_0x15f2b5[_0x214377(0x9e)])[_0x214377(0x8e)](',\x20'):_0x156800='b.*';return(_0x214377(0x9d)+_0x5587f3+',\x20'+_0x156800+_0x214377(0x70)+_0x321eb9[_0x214377(0x76)]+'.'+_0x321eb9['table']+_0x214377(0x92)+_0x519c03[_0x214377(0x64)][_0x214377(0x76)]+'.'+_0x519c03['source'][_0x214377(0x73)]+'\x20b\x0a\x20\x20ON\x20m.'+_0x519c03['join'][_0x214377(0x85)]+_0x214377(0x81)+_0x519c03[_0x214377(0x8e)][_0x214377(0x86)]+_0x214377(0x99))[_0x214377(0x93)]();}function a148_0x5eb2(_0x4d7817,_0x3866df){_0x4d7817=_0x4d7817-0x64;const _0x4a6805=a148_0x4a68();let _0x5eb201=_0x4a6805[_0x4d7817];return _0x5eb201;}export function getAttributeColumns(_0x42cf70){const _0x394567=a148_0x493cd7;return _0x42cf70[_0x394567(0x7e)]['map'](_0x19fc54=>({'label':_0x19fc54[_0x394567(0x87)]||_0x19fc54[_0x394567(0x9e)],'column':_0x19fc54['column']}));}export function getBehaviorColumns(_0x1293a8){const _0x2b80a8=a148_0x493cd7;if(_0x1293a8[_0x2b80a8(0x77)])return[{'label':_0x2b80a8(0x90),'column':'*'}];if(_0x1293a8[_0x2b80a8(0x7e)]&&_0x1293a8[_0x2b80a8(0x7e)][_0x2b80a8(0x8b)]>0x0)return _0x1293a8['columns'][_0x2b80a8(0x7c)](_0x2085ef=>({'label':_0x2085ef[_0x2b80a8(0x87)]||_0x2085ef[_0x2b80a8(0x9e)],'column':_0x2085ef[_0x2b80a8(0x9e)]}));return[{'label':_0x2b80a8(0x90),'column':'*'}];}function a148_0x4a68(){const _0x1008c9=['31503EryxSa','(all\x20columns)','6yzMeEx','\x20m\x0aJOIN\x20','trim','push','forEach','m.*','attributes','\x20b\x0a\x20\x20ON\x20m.','\x0aLIMIT\x200\x0a','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','5244920qFLjYL','\x0aSELECT\x20','\x0aSELECT\x20m.','column','source',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','4788774WhwyMM','304zCKKvW','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','\x27)\x0aLIMIT\x20','behaviors','\x20m\x0aLEFT\x20JOIN\x20','\x20=\x20a.','\x0aWHERE\x20a.','b.*','\x20LIMIT\x200','\x0aFROM\x20','\x0a\x20\x20ON\x20m.','SELECT\x20','table','\x20=\x20','\x20AS\x20','database','all_columns','4238288idiMNA','SELECT\x20*\x20FROM\x20','\x0aLIMIT\x20','find','map','2055834oMOEFa','columns','name','33185iWMKRS','\x20=\x20b.','toLowerCase','\x20a\x0a\x20\x20ON\x20m.','master','parent_key','child_key','label','4189563UBCjGH','-1d','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','length','\x20LIMIT\x20','\x20m\x0a','join'];a148_0x4a68=function(){return _0x1008c9;};return a148_0x4a68();}export function findAttributeByName(_0x4e143b,_0x55e4e9){const _0x43d85c=a148_0x493cd7;return _0x4e143b['attributes']?.['find'](_0x418820=>_0x418820[_0x43d85c(0x7f)][_0x43d85c(0x82)]()===_0x55e4e9[_0x43d85c(0x82)]());}export function findBehaviorByName(_0x49e302,_0x282316){const _0x529857=a148_0x493cd7;return _0x49e302[_0x529857(0x6a)]?.[_0x529857(0x7b)](_0x27ca4a=>_0x27ca4a[_0x529857(0x7f)][_0x529857(0x82)]()===_0x282316[_0x529857(0x82)]());}