@treasuredata/tdx 2026.4.20 → 2026.4.21

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 (237) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.d.ts +47 -0
  27. package/dist/commands/engage-command.d.ts.map +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-command.js.map +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.js +1 -1
  41. package/dist/commands/profiles-command.js +1 -1
  42. package/dist/commands/query-command.js +1 -1
  43. package/dist/commands/schedule-command.js +1 -1
  44. package/dist/commands/segment-command.js +1 -1
  45. package/dist/commands/segment-create-command.js +1 -1
  46. package/dist/commands/segment-fields-command.js +1 -1
  47. package/dist/commands/segment-pull-command.js +1 -1
  48. package/dist/commands/segment-push-command.js +1 -1
  49. package/dist/commands/segment-update-command.js +1 -1
  50. package/dist/commands/segment-use-command.js +1 -1
  51. package/dist/commands/segment-validate-command.js +1 -1
  52. package/dist/commands/segments.js +1 -1
  53. package/dist/commands/show.js +1 -1
  54. package/dist/commands/status-command.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/user-cache.js +1 -1
  76. package/dist/core/version.js +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/mcp/server.js +1 -1
  79. package/dist/mcp/tools/index.js +1 -1
  80. package/dist/mcp/tools/tdx-run.js +1 -1
  81. package/dist/mcp/tools/tdx-search.js +1 -1
  82. package/dist/mcp/tools/work-create-item.js +1 -1
  83. package/dist/mcp/utils.js +1 -1
  84. package/dist/proxy/claude-usage-tracker.js +1 -1
  85. package/dist/proxy/passthrough-server.js +1 -1
  86. package/dist/proxy/sse-usage-parser.js +1 -1
  87. package/dist/sdk/agent/agent-config.js +1 -1
  88. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  89. package/dist/sdk/agent/agent-yaml.js +1 -1
  90. package/dist/sdk/agent/test/evaluator.js +1 -1
  91. package/dist/sdk/agent/test/executor.js +1 -1
  92. package/dist/sdk/agent/test/index.js +1 -1
  93. package/dist/sdk/agent/test/output.js +1 -1
  94. package/dist/sdk/agent/test/parser.js +1 -1
  95. package/dist/sdk/agent/tool-target-registry.js +1 -1
  96. package/dist/sdk/api.js +1 -1
  97. package/dist/sdk/cas/cas-api-client.js +1 -1
  98. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  99. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  100. package/dist/sdk/cas/index.js +1 -1
  101. package/dist/sdk/cas/pull-workflow.js +1 -1
  102. package/dist/sdk/cas/push-workflow.js +1 -1
  103. package/dist/sdk/client/cdp-api-client.js +1 -1
  104. package/dist/sdk/client/delivery-api-client.js +1 -1
  105. package/dist/sdk/client/endpoints.js +1 -1
  106. package/dist/sdk/client/engage-api-client.d.ts +50 -1
  107. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/engage-api-client.js.map +1 -1
  110. package/dist/sdk/client/http-client.js +1 -1
  111. package/dist/sdk/client/llm-api-client.js +1 -1
  112. package/dist/sdk/client/oauth-refresh.js +1 -1
  113. package/dist/sdk/client/rate-limiter.js +1 -1
  114. package/dist/sdk/client/td-api-client.js +1 -1
  115. package/dist/sdk/client/trino-api-client.js +1 -1
  116. package/dist/sdk/client/workflow-client.js +1 -1
  117. package/dist/sdk/connection-validator.js +1 -1
  118. package/dist/sdk/connection.js +1 -1
  119. package/dist/sdk/delivery.js +1 -1
  120. package/dist/sdk/engage/campaign-pull.js +1 -1
  121. package/dist/sdk/engage/campaign-push.js +1 -1
  122. package/dist/sdk/engage/campaign-validator.js +1 -1
  123. package/dist/sdk/engage/campaign-yaml.js +1 -1
  124. package/dist/sdk/engage/template-pull.js +1 -1
  125. package/dist/sdk/engage/template-push.js +1 -1
  126. package/dist/sdk/engage/template-validator.js +1 -1
  127. package/dist/sdk/engage/template-yaml.js +1 -1
  128. package/dist/sdk/engage/types/campaign-def.js +1 -1
  129. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  130. package/dist/sdk/engage/types/template-schema.js +1 -1
  131. package/dist/sdk/engage.d.ts +35 -1
  132. package/dist/sdk/engage.d.ts.map +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/engage.js.map +1 -1
  135. package/dist/sdk/errors.js +1 -1
  136. package/dist/sdk/index.js +1 -1
  137. package/dist/sdk/io/index.js +1 -1
  138. package/dist/sdk/io/node-filesystem.js +1 -1
  139. package/dist/sdk/job.js +1 -1
  140. package/dist/sdk/journey.js +1 -1
  141. package/dist/sdk/llm/chat-cache.js +1 -1
  142. package/dist/sdk/llm/index.js +1 -1
  143. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  144. package/dist/sdk/llm/model-factors.js +1 -1
  145. package/dist/sdk/personalization.js +1 -1
  146. package/dist/sdk/policy.js +1 -1
  147. package/dist/sdk/query/index.js +1 -1
  148. package/dist/sdk/query/sql-parser.js +1 -1
  149. package/dist/sdk/realtime.js +1 -1
  150. package/dist/sdk/schedule.js +1 -1
  151. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  152. package/dist/sdk/segment/fields-display.js +1 -1
  153. package/dist/sdk/segment/file-discovery.js +1 -1
  154. package/dist/sdk/segment/journey-utils.js +1 -1
  155. package/dist/sdk/segment/journey-validator.js +1 -1
  156. package/dist/sdk/segment/journey-yaml.js +1 -1
  157. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  158. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  159. package/dist/sdk/segment/pull-workflow.js +1 -1
  160. package/dist/sdk/segment/push-recovery.js +1 -1
  161. package/dist/sdk/segment/push-workflow.js +1 -1
  162. package/dist/sdk/segment/resolution-context.js +1 -1
  163. package/dist/sdk/segment/segment-path-parser.js +1 -1
  164. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  165. package/dist/sdk/segment/segment-validator.js +1 -1
  166. package/dist/sdk/segment/target-resolution.js +1 -1
  167. package/dist/sdk/segment/tdx-config.js +1 -1
  168. package/dist/sdk/segment/types/activation-schema.js +1 -1
  169. package/dist/sdk/segment/types/journey-def.js +1 -1
  170. package/dist/sdk/segment/types/journey-schema.js +1 -1
  171. package/dist/sdk/segment/types/segment-def.js +1 -1
  172. package/dist/sdk/segment/types/segment-schema.js +1 -1
  173. package/dist/sdk/segment/validate-files.js +1 -1
  174. package/dist/sdk/segment/yaml-validator.js +1 -1
  175. package/dist/sdk/segment.js +1 -1
  176. package/dist/sdk/types/engage.d.ts +53 -0
  177. package/dist/sdk/types/engage.d.ts.map +1 -1
  178. package/dist/sdk/types/index.d.ts +1 -1
  179. package/dist/sdk/types/index.d.ts.map +1 -1
  180. package/dist/sdk/types/index.js +1 -1
  181. package/dist/sdk/types/index.js.map +1 -1
  182. package/dist/sdk/types/progress.js +1 -1
  183. package/dist/sdk/types/workspace.js +1 -1
  184. package/dist/sdk/user.js +1 -1
  185. package/dist/sdk/util/format-detector.js +1 -1
  186. package/dist/sdk/util/formatters.js +1 -1
  187. package/dist/sdk/util/index.js +1 -1
  188. package/dist/sdk/util/paginate.js +1 -1
  189. package/dist/sdk/util/tree-formatter.js +1 -1
  190. package/dist/sdk/workflow/archive-validation.js +1 -1
  191. package/dist/sdk/workflow/clone-workflow.js +1 -1
  192. package/dist/sdk/workflow/index.js +1 -1
  193. package/dist/sdk/workflow/pull-workflow.js +1 -1
  194. package/dist/sdk/workflow/push-workflow.js +1 -1
  195. package/dist/sdk/workflow/task-graph.js +1 -1
  196. package/dist/sdk/workflow/tdx-config.js +1 -1
  197. package/dist/sdk/workflow/workflow-utils.js +1 -1
  198. package/dist/sdk/workspace/access-tracker.js +1 -1
  199. package/dist/sdk/workspace/frontmatter.js +1 -1
  200. package/dist/sdk/workspace/git.js +1 -1
  201. package/dist/sdk/workspace/index.js +1 -1
  202. package/dist/sdk/workspace/templates.js +1 -1
  203. package/dist/sdk/workspace/weekly.js +1 -1
  204. package/dist/sdk/workspace/wikilinks.js +1 -1
  205. package/dist/test-utils/command-runner.js +1 -1
  206. package/dist/test-utils/factories.js +1 -1
  207. package/dist/test-utils/fixtures.js +1 -1
  208. package/dist/test-utils/http-mock.js +1 -1
  209. package/dist/test-utils/index.js +1 -1
  210. package/dist/utils/async.js +1 -1
  211. package/dist/utils/colors.js +1 -1
  212. package/dist/utils/diff.js +1 -1
  213. package/dist/utils/file-permissions.js +1 -1
  214. package/dist/utils/file-reader.js +1 -1
  215. package/dist/utils/github-releases.js +1 -1
  216. package/dist/utils/global-cache.js +1 -1
  217. package/dist/utils/json-loader.js +1 -1
  218. package/dist/utils/local-cache.js +1 -1
  219. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  220. package/dist/utils/logger/formatters/index.js +1 -1
  221. package/dist/utils/logger/handlers/console-handler.js +1 -1
  222. package/dist/utils/logger/handlers/file-handler.js +1 -1
  223. package/dist/utils/logger/handlers/index.js +1 -1
  224. package/dist/utils/logger/handlers/null-handler.js +1 -1
  225. package/dist/utils/logger/index.js +1 -1
  226. package/dist/utils/logger/logger.js +1 -1
  227. package/dist/utils/logger/types.js +1 -1
  228. package/dist/utils/option-validation.js +1 -1
  229. package/dist/utils/process.js +1 -1
  230. package/dist/utils/prompt.js +1 -1
  231. package/dist/utils/spinner.js +1 -1
  232. package/dist/utils/sse-parser.js +1 -1
  233. package/dist/utils/string-utils.js +1 -1
  234. package/dist/utils/table-ref-parser.js +1 -1
  235. package/dist/utils/tdx-logger.js +1 -1
  236. package/dist/utils/version-check.js +1 -1
  237. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x3a8e1d,_0x2585d2){const _0x1a005e=a146_0x13e4,_0x3b6d50=_0x3a8e1d();while(!![]){try{const _0x15a9fb=parseInt(_0x1a005e(0x1e4))/0x1*(parseInt(_0x1a005e(0x191))/0x2)+parseInt(_0x1a005e(0x1d5))/0x3+parseInt(_0x1a005e(0x1ed))/0x4+-parseInt(_0x1a005e(0x20c))/0x5*(-parseInt(_0x1a005e(0x20b))/0x6)+-parseInt(_0x1a005e(0x1ca))/0x7*(-parseInt(_0x1a005e(0x21e))/0x8)+-parseInt(_0x1a005e(0x23b))/0x9+parseInt(_0x1a005e(0x1c4))/0xa*(-parseInt(_0x1a005e(0x1f3))/0xb);if(_0x15a9fb===_0x2585d2)break;else _0x3b6d50['push'](_0x3b6d50['shift']());}catch(_0x10dfea){_0x3b6d50['push'](_0x3b6d50['shift']());}}}(a146_0x1513,0xbda82));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function a146_0x1513(){const _0x2530f9=['launched','branch\x20\x27','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','variants','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','INVALID_AB_TEST_PERCENTAGES','Stage\x20\x27','Duplicate\x20step\x20name\x20\x27','INVALID_JUMP_TARGET','MISSING_SEGMENT_REFERENCE','length','MISSING_ACTIVATION_DEFINITION','version','startsWith','embeddedSegments','keys','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','condition','abs','\x27\x20of\x20\x27','MISSING_ACTIVATION_REF','.with.condition.segment','ref:','.with.branches','Embedded\x20segment\x20\x27','goalIsInherited','MISSING_WAIT_PARAMS','\x27\x20with\x20no\x20action\x20in\x20between','values','set','rule','Decision\x20branch\x20\x27','.steps[','Criteria\x20references\x20undefined\x20segment\x20\x27','exit_criteria','\x20(across\x20','name','19223540cQanFk','steps','ACTIVATION_SCHEMA_ERROR','path','segments','\x27\x20(from:\x20','9315733AljqAn','has','splice','journey','.with.activation','endsWith','some','Step\x20references\x20non-existent\x20step\x20\x27','\x20with\x20latest:\x20true','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','2365287DGMXKs','FEW_STEPS','MISSING_STAGES','timeout','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','replace','.with','INVALID_NEXT_REFERENCE','MISSING_NAME','reduce','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','entry_criteria','state','error','2182Ylbbnf','Jump\x20step\x20requires\x20a\x20target','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','level','Journey\x20name\x20is\x20required','.segment','UNUSED_EMBEDDED_SEGMENT','\x27\x20has\x20no\x20steps','activation','4812008cYNSjo','\x27\x20(first\x20defined\x20at\x20steps[','add','stage','push','.with.branches[','22Bchdsn','timeout\x20of\x20\x27','merge','MISSING_MILESTONE','decision_point','End\x20step\x20\x27','message','SINGLE_INPUT_MERGE','sort','INSUFFICIENT_STEPS','activationKeys','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','\x27\x20has\x20only\x20','JOURNEY_SCHEMA_ERROR','source','DUPLICATE_STEP_NAME','step\x20\x27','.entry_criteria','.milestone','.exit_criteria','versions','journeys','Merge\x20step\x20\x27','symbol','2301336cWadRi','15bBGIcD','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','skipSchema','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','.next','referencedSegments','warning','CONVERGENCE_WITHOUT_MERGE','MISSING_END_STEP','goal','excluded','journeys[','get','segment','MISSING_EXIT_CRITERIA','latest','segments.','issues','8BxdLYH','Activation\x20step\x20requires\x20an\x20activation\x20reference','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','MISSING_GOAL','.stages','milestone','document','activations','.with.target','journeys,\x20stages,\x20or\x20versions','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','wait','includes','.steps','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','END_STEP_HAS_NEXT_OR_WITH','.with.condition.timeout.next','stepNames','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','safeParse','MISSING_CONDITIONS','size','\x27\x20has\x20no\x20end\x20step','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names',').\x20Merge\x20is\x20unnecessary.','join','end','.type','data','3041658NXVoyu','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','type','entries','.with.condition','stages','branches','jump','filter','next','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','446BiFhpy','.with.condition.next','target','BRANCH_DIRECTLY_TO_MERGE','\x20stages\x20but\x20maximum\x20is\x20','TOO_MANY_STAGES','with','.rule','ab_test','variant\x20\x27','stages[','condition\x20of\x20\x27','map'];a146_0x1513=function(){return _0x2530f9;};return a146_0x1513();}function createIssue(_0x5f2e9d,_0x2e66de,_0x282c1d,_0x3b2a7a,_0x495e19,_0x7c0421){const _0x1b46ed=a146_0x13e4;return{'level':_0x5f2e9d,'path':_0x2e66de,'code':_0x282c1d,'message':_0x3b2a7a,'location':getLocationFromPath(_0x495e19[_0x1b46ed(0x224)],_0x495e19['source'],pathToArray(_0x7c0421??_0x2e66de))};}function validateVersionStructure(_0x2df7d7,_0x5b56a9){const _0x5e2c93=a146_0x13e4,_0x5d4107=[];return _0x2df7d7[_0x5e2c93(0x1a8)]>MAX_STAGES&&_0x5d4107[_0x5e2c93(0x1f1)](createIssue(_0x5e2c93(0x1e3),_0x5e2c93(0x18b),_0x5e2c93(0x196),'Journey\x20has\x20'+_0x2df7d7[_0x5e2c93(0x1a8)]+_0x5e2c93(0x195)+MAX_STAGES,_0x5b56a9)),_0x5d4107;}function validateStageStructure(_0x156df4,_0x4d3867,_0x3a1cd4,_0x1d7172){const _0x4961f4=a146_0x13e4,_0x3e181f=[],_0x25e0fc=_0x4961f4(0x19b)+_0x4d3867+']';_0x4d3867===0x0&&!_0x156df4[_0x4961f4(0x1e1)]&&_0x3e181f[_0x4961f4(0x1f1)](createIssue('error',_0x25e0fc+'.entry_criteria','MISSING_ENTRY_CRITERIA',_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+'\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)',_0x1d7172,_0x25e0fc));const _0xb98e6c=_0x4d3867===_0x3a1cd4-0x1;!_0xb98e6c&&!_0x156df4[_0x4961f4(0x223)]&&_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x1e3),_0x25e0fc+_0x4961f4(0x205),_0x4961f4(0x1f6),_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x1a0),_0x1d7172,_0x25e0fc));(!_0x156df4['exit_criteria']||_0x156df4[_0x4961f4(0x1c1)][_0x4961f4(0x1a8)]===0x0)&&_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x212),_0x25e0fc+_0x4961f4(0x206),_0x4961f4(0x21a),_0x4961f4(0x1a4)+_0x156df4['name']+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x1d7172,_0x25e0fc));const _0xf3eb9c=_0x156df4[_0x4961f4(0x1c5)]?.[_0x4961f4(0x1a8)]??0x0;if(_0xf3eb9c===0x0)_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x1e3),_0x25e0fc+_0x4961f4(0x22b),_0x4961f4(0x1fc),'Stage\x20\x27'+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x1eb),_0x1d7172,_0x25e0fc+_0x4961f4(0x22b)));else{if(_0xf3eb9c===0x1)_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x212),_0x25e0fc+_0x4961f4(0x22b),'INSUFFICIENT_STEPS',_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x23d),_0x1d7172,_0x25e0fc+'.steps'));else _0xf3eb9c<=0x3&&_0x3e181f['push'](createIssue(_0x4961f4(0x212),_0x25e0fc+_0x4961f4(0x22b),_0x4961f4(0x1d6),_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x1ff)+_0xf3eb9c+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x1d7172,_0x25e0fc+'.steps'));}return _0x3e181f;}function validateStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a){const _0x4cf71b=a146_0x13e4,_0x565ddd=[];if(_0x356637[_0x4cf71b(0x188)]===_0x4cf71b(0x238))return _0x356637[_0x4cf71b(0x18f)]&&_0x565ddd[_0x4cf71b(0x1f1)](createIssue('error',_0x225fde+_0x4cf71b(0x210),_0x4cf71b(0x22d),_0x4cf71b(0x1f8)+_0x356637[_0x4cf71b(0x1c3)]+_0x4cf71b(0x20f),_0x42b51e)),_0x4cf71b(0x197)in _0x356637&&_0x356637[_0x4cf71b(0x197)]!==undefined&&_0x565ddd[_0x4cf71b(0x1f1)](createIssue(_0x4cf71b(0x1e3),_0x225fde+_0x4cf71b(0x1dc),_0x4cf71b(0x22d),'End\x20step\x20\x27'+_0x356637['name']+_0x4cf71b(0x228),_0x42b51e)),_0x565ddd;_0x356637[_0x4cf71b(0x18f)]&&(_0x42b51e[_0x4cf71b(0x22f)]&&!_0x42b51e['stepNames'][_0x4cf71b(0x1cb)](_0x356637[_0x4cf71b(0x18f)])&&_0x565ddd[_0x4cf71b(0x1f1)](createIssue('error',_0x225fde+_0x4cf71b(0x210),'INVALID_NEXT_REFERENCE',_0x4cf71b(0x1d1)+_0x356637[_0x4cf71b(0x18f)]+'\x27',_0x42b51e)));switch(_0x356637[_0x4cf71b(0x188)]){case _0x4cf71b(0x229):_0x565ddd[_0x4cf71b(0x1f1)](...validateWaitStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a));break;case _0x4cf71b(0x1ec):_0x565ddd[_0x4cf71b(0x1f1)](...validateActivationStep(_0x356637,_0x225fde,_0x42b51e));break;case _0x4cf71b(0x1f7):_0x565ddd['push'](...validateDecisionPointStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a));break;case _0x4cf71b(0x199):_0x565ddd[_0x4cf71b(0x1f1)](...validateAbTestStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a));break;case _0x4cf71b(0x18d):_0x565ddd['push'](...validateJumpStep(_0x356637,_0x225fde,_0x42b51e));break;}return _0x565ddd;}function validateWaitStep(_0x167cbd,_0x31f3ce,_0x449895,_0x2a9e36){const _0x539f68=a146_0x13e4,_0x4987d8=[];if(!_0x167cbd[_0x539f68(0x197)])return _0x4987d8['push'](createIssue(_0x539f68(0x1e3),_0x31f3ce+_0x539f68(0x1dc),_0x539f68(0x1b9),_0x539f68(0x187),_0x449895,_0x31f3ce)),_0x4987d8;if(_0x167cbd[_0x539f68(0x197)]['condition']){const _0x75a963=_0x167cbd[_0x539f68(0x197)][_0x539f68(0x1b0)];if(_0x75a963[_0x539f68(0x219)]){_0x449895['referencedSegments']?.[_0x539f68(0x1ef)](_0x75a963[_0x539f68(0x219)]);!_0x75a963[_0x539f68(0x219)]['startsWith'](_0x539f68(0x1b5))&&(_0x449895[_0x539f68(0x1ac)]&&!_0x449895[_0x539f68(0x1ac)][_0x539f68(0x1cb)](_0x75a963[_0x539f68(0x219)])&&_0x4987d8[_0x539f68(0x1f1)](createIssue(_0x539f68(0x1e3),_0x31f3ce+_0x539f68(0x1b4),_0x539f68(0x1a7),'Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x75a963[_0x539f68(0x219)]+'\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.',_0x449895)));_0x75a963[_0x539f68(0x18f)]&&_0x449895[_0x539f68(0x22f)]&&!_0x449895[_0x539f68(0x22f)][_0x539f68(0x1cb)](_0x75a963[_0x539f68(0x18f)])&&_0x4987d8[_0x539f68(0x1f1)](createIssue(_0x539f68(0x1e3),_0x31f3ce+_0x539f68(0x192),'INVALID_NEXT_REFERENCE','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x75a963[_0x539f68(0x18f)]+'\x27',_0x449895));_0x75a963[_0x539f68(0x1d8)]?.['next']&&_0x449895[_0x539f68(0x22f)]&&!_0x449895[_0x539f68(0x22f)][_0x539f68(0x1cb)](_0x75a963[_0x539f68(0x1d8)][_0x539f68(0x18f)])&&_0x4987d8[_0x539f68(0x1f1)](createIssue('error',_0x31f3ce+'.with.condition.timeout.next',_0x539f68(0x1dd),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x75a963[_0x539f68(0x1d8)][_0x539f68(0x18f)]+'\x27',_0x449895));const _0xe552e4=_0x75a963[_0x539f68(0x18f)]||_0x167cbd['next'],_0x40b5d1=_0x75a963[_0x539f68(0x1d8)]?.['next']||_0x167cbd[_0x539f68(0x18f)];if(_0xe552e4){const _0xd2eb62=_0x2a9e36[_0x539f68(0x218)](_0xe552e4);_0xd2eb62?.[_0x539f68(0x188)]==='merge'&&_0x4987d8['push'](createIssue(_0x539f68(0x212),_0x31f3ce+'.with.condition.next',_0x539f68(0x194),_0x539f68(0x1af)+_0xe552e4+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x449895,_0x31f3ce+_0x539f68(0x18a)));}if(_0x40b5d1){const _0x315968=_0x2a9e36[_0x539f68(0x218)](_0x40b5d1);_0x315968?.[_0x539f68(0x188)]===_0x539f68(0x1f5)&&_0x4987d8[_0x539f68(0x1f1)](createIssue(_0x539f68(0x212),_0x31f3ce+_0x539f68(0x22e),'BRANCH_DIRECTLY_TO_MERGE',_0x539f68(0x1d9)+_0x40b5d1+_0x539f68(0x22c),_0x449895,_0x31f3ce+'.with.condition.timeout'));}}}return _0x4987d8;}function validateActivationStep(_0x892c39,_0x5bc3d8,_0x4c714f){const _0x20ac3c=a146_0x13e4,_0x46d3cc=[];if(!_0x892c39[_0x20ac3c(0x197)]?.[_0x20ac3c(0x1ec)])return _0x46d3cc[_0x20ac3c(0x1f1)](createIssue('error',_0x5bc3d8+'.with.activation',_0x20ac3c(0x1b3),_0x20ac3c(0x21f),_0x4c714f,_0x5bc3d8)),_0x46d3cc;const _0x5dfeec=_0x892c39[_0x20ac3c(0x197)]['activation'];return _0x4c714f['activationKeys']&&!_0x5dfeec[_0x20ac3c(0x1ab)](_0x20ac3c(0x1b5))&&(!_0x4c714f[_0x20ac3c(0x1fd)][_0x20ac3c(0x1cb)](_0x5dfeec)&&_0x46d3cc[_0x20ac3c(0x1f1)](createIssue(_0x20ac3c(0x1e3),_0x5bc3d8+_0x20ac3c(0x1ce),_0x20ac3c(0x1a9),_0x20ac3c(0x1d4)+_0x5dfeec+_0x20ac3c(0x1a2),_0x4c714f))),_0x46d3cc;}function validateDecisionPointStep(_0x158770,_0x456aa4,_0x37682f,_0x5a568e){const _0x59e4b6=a146_0x13e4,_0x4e108b=[];if(!_0x158770[_0x59e4b6(0x197)]?.[_0x59e4b6(0x18c)]||_0x158770[_0x59e4b6(0x197)]['branches'][_0x59e4b6(0x1a8)]===0x0)return _0x4e108b[_0x59e4b6(0x1f1)](createIssue(_0x59e4b6(0x1e3),_0x456aa4+_0x59e4b6(0x1b6),_0x59e4b6(0x232),_0x59e4b6(0x1ae),_0x37682f,_0x456aa4)),_0x4e108b;for(let _0x265d89=0x0;_0x265d89<_0x158770[_0x59e4b6(0x197)]['branches'][_0x59e4b6(0x1a8)];_0x265d89++){const _0x1b5d2b=_0x158770['with'][_0x59e4b6(0x18c)][_0x265d89],_0x4351f8=_0x456aa4+_0x59e4b6(0x1f2)+_0x265d89+']';_0x1b5d2b[_0x59e4b6(0x219)]&&!_0x1b5d2b[_0x59e4b6(0x216)]&&(_0x37682f[_0x59e4b6(0x211)]?.[_0x59e4b6(0x1ef)](_0x1b5d2b[_0x59e4b6(0x219)]),!_0x1b5d2b[_0x59e4b6(0x219)][_0x59e4b6(0x1ab)](_0x59e4b6(0x1b5))&&(_0x37682f['embeddedSegments']&&!_0x37682f['embeddedSegments'][_0x59e4b6(0x1cb)](_0x1b5d2b[_0x59e4b6(0x219)])&&_0x4e108b['push'](createIssue(_0x59e4b6(0x1e3),_0x4351f8+_0x59e4b6(0x1e9),'MISSING_SEGMENT_REFERENCE',_0x59e4b6(0x230)+_0x1b5d2b[_0x59e4b6(0x219)]+'\x27',_0x37682f))));_0x1b5d2b[_0x59e4b6(0x18f)]&&_0x37682f[_0x59e4b6(0x22f)]&&!_0x37682f['stepNames']['has'](_0x1b5d2b[_0x59e4b6(0x18f)])&&_0x4e108b['push'](createIssue(_0x59e4b6(0x1e3),_0x4351f8+_0x59e4b6(0x210),'INVALID_NEXT_REFERENCE','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0x1b5d2b[_0x59e4b6(0x18f)]+'\x27',_0x37682f));if(_0x1b5d2b[_0x59e4b6(0x18f)]){const _0xc9de6b=_0x5a568e['get'](_0x1b5d2b[_0x59e4b6(0x18f)]);_0xc9de6b?.['type']===_0x59e4b6(0x1f5)&&_0x4e108b[_0x59e4b6(0x1f1)](createIssue(_0x59e4b6(0x212),_0x4351f8+_0x59e4b6(0x210),_0x59e4b6(0x194),_0x59e4b6(0x1be)+_0x1b5d2b[_0x59e4b6(0x1c3)]+_0x59e4b6(0x1d3)+_0x1b5d2b[_0x59e4b6(0x18f)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x37682f));}}return _0x4e108b;}function validateAbTestStep(_0x25eba2,_0x5d2449,_0x3cafcf,_0xe9fb6a){const _0x14d217=a146_0x13e4,_0x12e24e=[];if(!_0x25eba2['with']?.[_0x14d217(0x1a1)]||_0x25eba2[_0x14d217(0x197)]['variants'][_0x14d217(0x1a8)]===0x0)return _0x12e24e['push'](createIssue('error',_0x5d2449+'.with.variants',_0x14d217(0x232),'A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x3cafcf,_0x5d2449)),_0x12e24e;const _0x249553=_0x25eba2[_0x14d217(0x197)][_0x14d217(0x1a1)][_0x14d217(0x1df)]((_0x58d0c5,_0xb77f87)=>_0x58d0c5+(_0xb77f87['percentage']||0x0),0x0);Math[_0x14d217(0x1b1)](_0x249553-0x64)>0.01&&_0x12e24e[_0x14d217(0x1f1)](createIssue('error',_0x5d2449+'.with.variants',_0x14d217(0x1a3),_0x14d217(0x190)+_0x249553+'%)',_0x3cafcf));for(let _0x267dd4=0x0;_0x267dd4<_0x25eba2['with'][_0x14d217(0x1a1)]['length'];_0x267dd4++){const _0xd7fb51=_0x25eba2[_0x14d217(0x197)]['variants'][_0x267dd4],_0x5aba97=_0x5d2449+'.with.variants['+_0x267dd4+']';_0xd7fb51[_0x14d217(0x18f)]&&_0x3cafcf[_0x14d217(0x22f)]&&!_0x3cafcf[_0x14d217(0x22f)][_0x14d217(0x1cb)](_0xd7fb51['next'])&&_0x12e24e['push'](createIssue(_0x14d217(0x1e3),_0x5aba97+_0x14d217(0x210),_0x14d217(0x1dd),_0x14d217(0x1da)+_0xd7fb51['next']+'\x27',_0x3cafcf));if(_0xd7fb51[_0x14d217(0x18f)]){const _0x322152=_0xe9fb6a[_0x14d217(0x218)](_0xd7fb51[_0x14d217(0x18f)]);_0x322152?.[_0x14d217(0x188)]==='merge'&&_0x12e24e[_0x14d217(0x1f1)](createIssue(_0x14d217(0x212),_0x5aba97+_0x14d217(0x210),_0x14d217(0x194),'A/B\x20test\x20variant\x20\x27'+_0xd7fb51['name']+_0x14d217(0x1d3)+_0xd7fb51['next']+_0x14d217(0x1ba),_0x3cafcf));}}return _0x12e24e;}function validateJumpStep(_0x5cbfe6,_0x4f7fcf,_0x55cea4){const _0x216322=a146_0x13e4,_0x1779f0=[];if(!_0x5cbfe6[_0x216322(0x197)]?.[_0x216322(0x193)])return _0x1779f0[_0x216322(0x1f1)](createIssue(_0x216322(0x1e3),_0x4f7fcf+'.with.target',_0x216322(0x1a6),_0x216322(0x1e5),_0x55cea4,_0x4f7fcf)),_0x1779f0;return(!_0x5cbfe6[_0x216322(0x197)][_0x216322(0x193)][_0x216322(0x1cd)]||!_0x5cbfe6[_0x216322(0x197)][_0x216322(0x193)][_0x216322(0x1f0)])&&_0x1779f0[_0x216322(0x1f1)](createIssue(_0x216322(0x1e3),_0x4f7fcf+_0x216322(0x226),'INVALID_JUMP_TARGET',_0x216322(0x235),_0x55cea4)),_0x1779f0;}function buildConvergenceMap(_0x16ce01){const _0x5402bf=a146_0x13e4,_0x2d0f0f=new Map();function _0x492627(_0x52a920,_0x16453e){const _0x36d891=a146_0x13e4,_0x57e5e0=_0x2d0f0f[_0x36d891(0x218)](_0x52a920)||[];_0x57e5e0[_0x36d891(0x1f1)](_0x16453e),_0x2d0f0f[_0x36d891(0x1bc)](_0x52a920,_0x57e5e0);}for(const _0x43db20 of _0x16ce01){_0x43db20[_0x5402bf(0x18f)]&&_0x492627(_0x43db20[_0x5402bf(0x18f)],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x203)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'});if(_0x43db20['type']===_0x5402bf(0x1f7)&&_0x43db20[_0x5402bf(0x197)]?.['branches'])for(const _0x54842f of _0x43db20[_0x5402bf(0x197)]['branches']){_0x54842f[_0x5402bf(0x18f)]&&_0x492627(_0x54842f[_0x5402bf(0x18f)],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x19f)+_0x54842f[_0x5402bf(0x1c3)]+_0x5402bf(0x1b2)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'});}if(_0x43db20[_0x5402bf(0x188)]===_0x5402bf(0x199)&&_0x43db20[_0x5402bf(0x197)]?.[_0x5402bf(0x1a1)])for(const _0x10f547 of _0x43db20[_0x5402bf(0x197)]['variants']){_0x10f547[_0x5402bf(0x18f)]&&_0x492627(_0x10f547['next'],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x19a)+_0x10f547[_0x5402bf(0x1c3)]+'\x27\x20of\x20\x27'+_0x43db20[_0x5402bf(0x1c3)]+'\x27'});}_0x43db20[_0x5402bf(0x188)]===_0x5402bf(0x229)&&_0x43db20['with']?.[_0x5402bf(0x1b0)]&&(_0x43db20[_0x5402bf(0x197)][_0x5402bf(0x1b0)][_0x5402bf(0x18f)]&&_0x492627(_0x43db20['with']['condition'][_0x5402bf(0x18f)],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x19c)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'}),_0x43db20[_0x5402bf(0x197)][_0x5402bf(0x1b0)]['timeout']?.[_0x5402bf(0x18f)]&&_0x492627(_0x43db20[_0x5402bf(0x197)][_0x5402bf(0x1b0)][_0x5402bf(0x1d8)]['next'],{'stepName':_0x43db20['name'],'description':_0x5402bf(0x1f4)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'}));}return _0x2d0f0f;}function a146_0x13e4(_0x16eac6,_0x53221e){_0x16eac6=_0x16eac6-0x187;const _0x151379=a146_0x1513();let _0x13e49e=_0x151379[_0x16eac6];return _0x13e49e;}function validateFlowControl(_0xde982b,_0x1ac113,_0x26d74b){const _0x3b30bb=a146_0x13e4,_0x55b828=[],_0x5eb467='stages['+_0x1ac113+']',_0x1fa47b=_0xde982b['steps']||[];if(_0x1fa47b[_0x3b30bb(0x1a8)]===0x0)return _0x55b828;const _0x574e21=new Map();for(const _0x384606 of _0x1fa47b){_0x384606[_0x3b30bb(0x1c3)]&&_0x574e21[_0x3b30bb(0x1bc)](_0x384606[_0x3b30bb(0x1c3)],_0x384606);}const _0x176565=buildConvergenceMap(_0x1fa47b),_0x195a5e=_0x1fa47b[_0x3b30bb(0x1d0)](_0x1b3855=>_0x1b3855[_0x3b30bb(0x188)]==='end');!_0x195a5e&&_0x55b828[_0x3b30bb(0x1f1)](createIssue(_0x3b30bb(0x1e3),_0x5eb467+_0x3b30bb(0x22b),_0x3b30bb(0x214),'Stage\x20\x27'+_0xde982b[_0x3b30bb(0x1c3)]+_0x3b30bb(0x234),_0x26d74b));for(const [_0x17add3,_0x332986]of _0x176565){const _0x721eb=_0x574e21['get'](_0x17add3);if(!_0x721eb)continue;if(_0x332986[_0x3b30bb(0x1a8)]>0x1&&_0x721eb[_0x3b30bb(0x188)]!=='merge'){const _0x57330a=_0x332986['map'](_0x12111f=>_0x12111f['description'])[_0x3b30bb(0x237)](',\x20');_0x55b828[_0x3b30bb(0x1f1)](createIssue(_0x3b30bb(0x1e3),_0x5eb467+_0x3b30bb(0x22b),_0x3b30bb(0x213),_0x3b30bb(0x23c)+_0x17add3+_0x3b30bb(0x1c9)+_0x57330a+').\x20Use\x20a\x20merge\x20step.',_0x26d74b));}_0x332986[_0x3b30bb(0x1a8)]===0x1&&_0x721eb['type']===_0x3b30bb(0x1f5)&&_0x55b828['push'](createIssue(_0x3b30bb(0x212),_0x5eb467+'.steps',_0x3b30bb(0x1fa),_0x3b30bb(0x209)+_0x17add3+_0x3b30bb(0x1e0)+_0x332986[0x0]['description']+_0x3b30bb(0x236),_0x26d74b));}for(const _0x17141a of _0x1fa47b){if(_0x17141a[_0x3b30bb(0x188)]===_0x3b30bb(0x1f5)&&_0x17141a[_0x3b30bb(0x18f)]){const _0x4695b9=_0x574e21[_0x3b30bb(0x218)](_0x17141a[_0x3b30bb(0x18f)]);_0x4695b9?.[_0x3b30bb(0x188)]==='merge'&&_0x55b828[_0x3b30bb(0x1f1)](createIssue(_0x3b30bb(0x1e3),_0x5eb467+'.steps','MERGE_TO_MERGE_CHAIN',_0x3b30bb(0x209)+_0x17141a[_0x3b30bb(0x1c3)]+_0x3b30bb(0x20d)+_0x17141a[_0x3b30bb(0x18f)]+_0x3b30bb(0x1fe),_0x26d74b));}}return _0x55b828;}function validateCriteria(_0x10756b,_0x4d55dc,_0x5913e5){const _0x4809ff=a146_0x13e4,_0x22982f=[];return _0x10756b[_0x4809ff(0x219)]&&(_0x5913e5[_0x4809ff(0x211)]?.[_0x4809ff(0x1ef)](_0x10756b[_0x4809ff(0x219)]),!_0x10756b[_0x4809ff(0x219)][_0x4809ff(0x1ab)](_0x4809ff(0x1b5))&&(_0x5913e5[_0x4809ff(0x1ac)]&&!_0x5913e5[_0x4809ff(0x1ac)][_0x4809ff(0x1cb)](_0x10756b[_0x4809ff(0x219)])&&_0x22982f[_0x4809ff(0x1f1)](createIssue(_0x4809ff(0x1e3),_0x4d55dc+_0x4809ff(0x1e9),_0x4809ff(0x1a7),_0x4809ff(0x1c0)+_0x10756b[_0x4809ff(0x219)]+'\x27',_0x5913e5)))),_0x22982f;}function validateEmbeddedSegment(_0x28440f,_0x1c9816,_0x5651af){const _0x401780=a146_0x13e4,_0x4367d5=[];return _0x28440f[_0x401780(0x1bd)]&&_0x4367d5['push'](...validateRuleDef(_0x28440f[_0x401780(0x1bd)],_0x1c9816+_0x401780(0x198),_0x5651af)),_0x4367d5;}function validateStage(_0x132f3e,_0x5de3f9,_0x35fa4a,_0x75bbab){const _0x3e5dde=a146_0x13e4,_0x596e0f=[],_0x28a385=_0x3e5dde(0x19b)+_0x5de3f9+']',_0x6f28a4=new Map(),_0x5cb50e=new Map();if(_0x132f3e[_0x3e5dde(0x1c5)]){for(let _0x2b561a=0x0;_0x2b561a<_0x132f3e[_0x3e5dde(0x1c5)][_0x3e5dde(0x1a8)];_0x2b561a++){const _0x392a77=_0x132f3e[_0x3e5dde(0x1c5)][_0x2b561a];_0x392a77['name']&&_0x6f28a4[_0x3e5dde(0x1bc)](_0x392a77[_0x3e5dde(0x1c3)],_0x392a77);}for(let _0x1a1b92=0x0;_0x1a1b92<_0x132f3e[_0x3e5dde(0x1c5)][_0x3e5dde(0x1a8)];_0x1a1b92++){const _0x1413a3=_0x132f3e[_0x3e5dde(0x1c5)][_0x1a1b92],_0x2acf6c=_0x28a385+_0x3e5dde(0x1bf)+_0x1a1b92+']';if(_0x1413a3['name']){if(_0x5cb50e[_0x3e5dde(0x1cb)](_0x1413a3['name'])){const _0x4bf0c3=_0x5cb50e['get'](_0x1413a3['name']);_0x596e0f['push'](createIssue('error',_0x2acf6c+'.name',_0x3e5dde(0x202),_0x3e5dde(0x1a5)+_0x1413a3[_0x3e5dde(0x1c3)]+_0x3e5dde(0x1ee)+_0x4bf0c3+'])',_0x75bbab));}else _0x5cb50e[_0x3e5dde(0x1bc)](_0x1413a3[_0x3e5dde(0x1c3)],_0x1a1b92);}_0x596e0f[_0x3e5dde(0x1f1)](...validateStep(_0x1413a3,_0x2acf6c,_0x75bbab,_0x6f28a4));}}_0x132f3e[_0x3e5dde(0x1e1)]&&_0x596e0f[_0x3e5dde(0x1f1)](...validateCriteria(_0x132f3e['entry_criteria'],_0x28a385+_0x3e5dde(0x204),_0x75bbab));if(_0x132f3e[_0x3e5dde(0x1c1)])for(let _0x1ffe49=0x0;_0x1ffe49<_0x132f3e[_0x3e5dde(0x1c1)][_0x3e5dde(0x1a8)];_0x1ffe49++){_0x596e0f['push'](...validateCriteria(_0x132f3e['exit_criteria'][_0x1ffe49],_0x28a385+'.exit_criteria['+_0x1ffe49+']',_0x75bbab));}return _0x132f3e[_0x3e5dde(0x223)]&&_0x596e0f['push'](...validateCriteria(_0x132f3e[_0x3e5dde(0x223)],_0x28a385+'.milestone',_0x75bbab)),_0x596e0f[_0x3e5dde(0x1f1)](...validateStageStructure(_0x132f3e,_0x5de3f9,_0x35fa4a,_0x75bbab)),_0x596e0f[_0x3e5dde(0x1f1)](...validateFlowControl(_0x132f3e,_0x5de3f9,_0x75bbab)),_0x596e0f;}function validateStagesForVersion(_0x1a4c81,_0xefe251,_0x3abe5e,_0x48cf11,_0x114add,_0x4dabe6,_0x2e71b0){const _0x306a44=a146_0x13e4;if(_0x1a4c81[_0x306a44(0x1a8)]===0x0){_0x114add[_0x306a44(0x1f1)]({'level':_0x306a44(0x1e3),'path':_0x48cf11+_0x306a44(0x18b),'code':_0x306a44(0x1d7),'message':_0x306a44(0x1e6),'location':getLocationFromPath(_0x3abe5e['document'],_0x3abe5e[_0x306a44(0x201)],[_0x306a44(0x18b)])});return;}const _0x2c5f7a=new Set();for(const _0x19ef31 of _0x1a4c81){if(_0x19ef31['steps'])for(const _0x5f3b23 of _0x19ef31[_0x306a44(0x1c5)]){_0x5f3b23[_0x306a44(0x1c3)]&&_0x2c5f7a[_0x306a44(0x1ef)](_0x5f3b23['name']);}}const _0x5849af={..._0x3abe5e,'stepNames':_0x2c5f7a},_0x16d835=validateVersionStructure(_0x1a4c81,_0x5849af);for(const _0x4125ce of _0x16d835){const _0xfa51a=_0x48cf11?{..._0x4125ce,'path':''+_0x48cf11+_0x4125ce[_0x306a44(0x1c7)]}:_0x4125ce;if(_0xfa51a[_0x306a44(0x1e7)]==='error')_0x114add[_0x306a44(0x1f1)](_0xfa51a);else _0x4dabe6[_0x306a44(0x1f1)](_0xfa51a);}for(let _0x9d3135=0x0;_0x9d3135<_0x1a4c81[_0x306a44(0x1a8)];_0x9d3135++){const _0x523e5c=validateStage(_0x1a4c81[_0x9d3135],_0x9d3135,_0x1a4c81[_0x306a44(0x1a8)],_0x5849af);for(const _0x570d01 of _0x523e5c){const _0x3500fb=_0x48cf11?{..._0x570d01,'path':''+_0x48cf11+_0x570d01[_0x306a44(0x1c7)]}:_0x570d01;if(_0x3500fb[_0x306a44(0x1e7)]==='error')_0x114add['push'](_0x3500fb);else _0x4dabe6['push'](_0x3500fb);}}if(_0xefe251[_0x306a44(0x215)]){const _0x52346d=_0x2e71b0?.[_0x306a44(0x1b8)]?'goal':_0x48cf11+'goal',_0x4e0bf8=validateCriteria(_0xefe251[_0x306a44(0x215)],_0x52346d,_0x5849af);for(const _0x27d82e of _0x4e0bf8){if(_0x27d82e['level']===_0x306a44(0x1e3))_0x114add[_0x306a44(0x1f1)](_0x27d82e);else _0x4dabe6[_0x306a44(0x1f1)](_0x27d82e);}}}function extractVersionIndex(_0x4ef1d6){const _0x20d4c6=_0x4ef1d6['match'](/^journeys\[(\d+)\]\./);return _0x20d4c6?_0x20d4c6[0x1]:undefined;}function deduplicateAcrossVersions(_0x1c45bd){const _0xef5f39=a146_0x13e4,_0x262f9e=new Map();for(let _0x39bd16=0x0;_0x39bd16<_0x1c45bd[_0xef5f39(0x1a8)];_0x39bd16++){const _0x5bb11e=_0x1c45bd[_0x39bd16]['code']+':'+_0x1c45bd[_0x39bd16][_0xef5f39(0x1f9)],_0x50eb9a=extractVersionIndex(_0x1c45bd[_0x39bd16][_0xef5f39(0x1c7)]),_0x361b60=_0x262f9e['get'](_0x5bb11e);if(_0x361b60){_0x361b60['indices'][_0xef5f39(0x1f1)](_0x39bd16);if(_0x50eb9a)_0x361b60['versions'][_0xef5f39(0x1ef)](_0x50eb9a);}else _0x262f9e[_0xef5f39(0x1bc)](_0x5bb11e,{'indices':[_0x39bd16],'versions':new Set(_0x50eb9a?[_0x50eb9a]:[])});}const _0x17ca41=new Set();for(const {indices:_0x4e461d,versions:_0x47a45e}of _0x262f9e[_0xef5f39(0x1bb)]()){if(_0x47a45e[_0xef5f39(0x233)]<=0x1)continue;const _0x1d9fa6=_0x1c45bd[_0x4e461d[0x0]];_0x1d9fa6[_0xef5f39(0x1c7)]=_0x1d9fa6['path'][_0xef5f39(0x1db)](/^journeys\[\d+\]\./,''),_0x1d9fa6[_0xef5f39(0x1f9)]=_0x1d9fa6['message']+_0xef5f39(0x1c2)+_0x47a45e[_0xef5f39(0x233)]+'\x20versions)';for(let _0x2cccd8=0x1;_0x2cccd8<_0x4e461d['length'];_0x2cccd8++){_0x17ca41[_0xef5f39(0x1ef)](_0x4e461d[_0x2cccd8]);}}const _0x399967=[..._0x17ca41][_0xef5f39(0x1fb)]((_0x520356,_0x3f6a90)=>_0x3f6a90-_0x520356);for(const _0x19dfc3 of _0x399967){_0x1c45bd[_0xef5f39(0x1cc)](_0x19dfc3,0x1);}}export function validateJourneyDef(_0x3c4053,_0x525174={},_0x370478={}){const _0x10caad=a146_0x13e4;if(_0x370478[_0x10caad(0x20e)])return runJourneySemanticChecks(_0x3c4053,_0x525174);const _0x4f71c7=JourneyDefSchema[_0x10caad(0x231)](_0x3c4053);if(_0x4f71c7['success'])return runJourneySemanticChecks(_0x4f71c7[_0x10caad(0x23a)],_0x525174);return zodErrorsToJourneyValidationResult(_0x4f71c7[_0x10caad(0x1e3)],_0x525174);}function zodErrorsToJourneyValidationResult(_0x49e553,_0x7d0f41){const _0x12e0f1=a146_0x13e4,_0x2b9664=flattenZodIssues(_0x49e553[_0x12e0f1(0x21d)]),_0x779c40=_0x2b9664[_0x12e0f1(0x19d)](_0x249527=>{const _0xb4f947=_0x12e0f1,_0x2f2028=formatZodPath(_0x249527[_0xb4f947(0x1c7)]),_0x51a8d5=mapJourneyZodIssueToCode(_0x249527,_0x2f2028),_0x40d7b7=getLocationFromPath(_0x7d0f41[_0xb4f947(0x224)],_0x7d0f41['source'],_0x249527[_0xb4f947(0x1c7)][_0xb4f947(0x19d)](_0x4461fd=>typeof _0x4461fd===_0xb4f947(0x20a)?String(_0x4461fd):_0x4461fd));return{'level':_0xb4f947(0x1e3),'path':_0x2f2028,'code':_0x51a8d5,'message':_0x249527[_0xb4f947(0x1f9)],..._0x40d7b7&&{'location':_0x40d7b7}};});return{'valid':![],'errors':_0x779c40,'warnings':[]};}function mapJourneyZodIssueToCode(_0x4cdb8b,_0x22c939){const _0x3dfe90=a146_0x13e4;if(_0x22c939===_0x3dfe90(0x1c3))return'MISSING_NAME';if(_0x22c939['endsWith'](_0x3dfe90(0x239))&&_0x22c939[_0x3dfe90(0x22a)](_0x3dfe90(0x1c5)))return _0x3dfe90(0x200);if(_0x22c939===_0x3dfe90(0x18b)||_0x22c939[_0x3dfe90(0x1cf)](_0x3dfe90(0x222)))return _0x3dfe90(0x1d7);if(_0x22c939===''&&_0x4cdb8b[_0x3dfe90(0x1f9)][_0x3dfe90(0x22a)](_0x3dfe90(0x227)))return _0x3dfe90(0x1d7);if(_0x22c939['includes'](_0x3dfe90(0x1ec)))return _0x3dfe90(0x1c6);return _0x3dfe90(0x200);}function runJourneySemanticChecks(_0x144293,_0x2f0981){const _0x2f1a30=a146_0x13e4,_0x2a40b5=[],_0x3b1c00=[];(!_0x144293['name']||_0x144293[_0x2f1a30(0x1c3)]['trim']()==='')&&_0x2a40b5['push']({'level':_0x2f1a30(0x1e3),'path':_0x2f1a30(0x1c3),'code':_0x2f1a30(0x1de),'message':_0x2f1a30(0x1e8),'location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981[_0x2f1a30(0x201)],[_0x2f1a30(0x1c3)])});const _0x1b7813=new Set();if(_0x144293[_0x2f1a30(0x1c8)])for(const _0xeedde3 of Object[_0x2f1a30(0x1ad)](_0x144293[_0x2f1a30(0x1c8)])){_0x1b7813[_0x2f1a30(0x1ef)](_0xeedde3);}const _0x4d9734=new Set();if(_0x144293['activations'])for(const _0x18e3a1 of Object[_0x2f1a30(0x1ad)](_0x144293[_0x2f1a30(0x225)])){_0x4d9734[_0x2f1a30(0x1ef)](_0x18e3a1);}const _0x159409=new Set(),_0x256978={..._0x2f0981,'embeddedSegments':_0x1b7813,'referencedSegments':_0x159409,'activationKeys':_0x4d9734['size']>0x0?_0x4d9734:undefined};if(_0x144293['segments'])for(const [_0x7e2442,_0x243a1e]of Object[_0x2f1a30(0x189)](_0x144293[_0x2f1a30(0x1c8)])){const _0x1999c0=validateEmbeddedSegment(_0x243a1e,_0x2f1a30(0x21c)+_0x7e2442,_0x256978);for(const _0x53acc6 of _0x1999c0){if(_0x53acc6[_0x2f1a30(0x1e7)]===_0x2f1a30(0x1e3))_0x2a40b5[_0x2f1a30(0x1f1)](_0x53acc6);else _0x3b1c00[_0x2f1a30(0x1f1)](_0x53acc6);}}const _0x29121b=!!_0x144293[_0x2f1a30(0x215)],_0x2f9d10=_0x144293[_0x2f1a30(0x208)]?.['every'](_0x1cf337=>!!_0x1cf337[_0x2f1a30(0x215)])??![];!_0x29121b&&!_0x2f9d10&&_0x3b1c00[_0x2f1a30(0x1f1)]({'level':_0x2f1a30(0x212),'path':_0x2f1a30(0x215),'code':_0x2f1a30(0x221),'message':'Journey\x20has\x20no\x20goal\x20defined','location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981[_0x2f1a30(0x201)],[_0x2f1a30(0x215)])});const _0xb902da=_0x144293['journeys']??_0x144293[_0x2f1a30(0x207)];if(_0xb902da&&_0xb902da[_0x2f1a30(0x18e)](_0x16f166=>_0x16f166[_0x2f1a30(0x21b)]===!![])[_0x2f1a30(0x1a8)]>0x1){const _0x134dd2=_0x144293[_0x2f1a30(0x208)]?_0x2f1a30(0x208):_0x2f1a30(0x207);_0x2a40b5[_0x2f1a30(0x1f1)]({'level':_0x2f1a30(0x1e3),'path':_0x134dd2,'code':'DUPLICATE_LATEST','message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x134dd2==='journeys'?'journey\x20entry':_0x2f1a30(0x1aa))+_0x2f1a30(0x1d2),'location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981[_0x2f1a30(0x201)],[_0x134dd2])});}if(_0x144293['journeys']&&_0x144293[_0x2f1a30(0x208)][_0x2f1a30(0x1a8)]>0x0)for(let _0x481677=0x0;_0x481677<_0x144293[_0x2f1a30(0x208)]['length'];_0x481677++){const _0x20890c=_0x144293['journeys'][_0x481677];if(_0x144293['journeys'][_0x2f1a30(0x1a8)]>0x1&&_0x20890c[_0x2f1a30(0x1e2)]==='launched')continue;const _0x287788=_0x20890c['stages']||[],_0x53f4bd=_0x2f1a30(0x217)+_0x481677+'].',_0x100381=!!_0x20890c[_0x2f1a30(0x215)],_0x4f55b3=_0x100381?{..._0x144293,'goal':_0x20890c[_0x2f1a30(0x215)]}:_0x144293;validateStagesForVersion(_0x287788,_0x4f55b3,_0x256978,_0x53f4bd,_0x2a40b5,_0x3b1c00,{'goalIsInherited':!_0x100381});}else{if(_0x144293['versions']&&_0x144293[_0x2f1a30(0x207)]['length']>0x0)for(let _0x5a57ad=0x0;_0x5a57ad<_0x144293[_0x2f1a30(0x207)][_0x2f1a30(0x1a8)];_0x5a57ad++){const _0x522de6=_0x144293['versions'][_0x5a57ad];if(_0x144293[_0x2f1a30(0x207)][_0x2f1a30(0x1a8)]>0x1&&_0x522de6['state']===_0x2f1a30(0x19e))continue;const _0x3523ae=_0x522de6[_0x2f1a30(0x18b)]||[],_0x1c21b6='versions['+_0x5a57ad+'].';validateStagesForVersion(_0x3523ae,_0x144293,_0x256978,_0x1c21b6,_0x2a40b5,_0x3b1c00);}else{const _0x3c9fba=_0x144293[_0x2f1a30(0x18b)]||[];validateStagesForVersion(_0x3c9fba,_0x144293,_0x256978,'',_0x2a40b5,_0x3b1c00);}}_0x144293[_0x2f1a30(0x208)]&&_0x144293[_0x2f1a30(0x208)][_0x2f1a30(0x1a8)]>0x1&&(deduplicateAcrossVersions(_0x2a40b5),deduplicateAcrossVersions(_0x3b1c00));for(const _0x13cfc1 of _0x1b7813){!_0x159409['has'](_0x13cfc1)&&!_0x13cfc1['startsWith']('excluded_')&&_0x3b1c00['push']({'level':_0x2f1a30(0x212),'path':_0x2f1a30(0x21c)+_0x13cfc1,'code':_0x2f1a30(0x1ea),'message':_0x2f1a30(0x1b7)+_0x13cfc1+_0x2f1a30(0x220),'location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981['source'],[_0x2f1a30(0x1c8),_0x13cfc1])});}return{'valid':_0x2a40b5[_0x2f1a30(0x1a8)]===0x0,'errors':_0x2a40b5,'warnings':_0x3b1c00};}
1
+ (function(_0x304f95,_0x580979){const _0x309cef=a146_0x35cf,_0x770ea3=_0x304f95();while(!![]){try{const _0x5b52cd=parseInt(_0x309cef(0x291))/0x1*(parseInt(_0x309cef(0x204))/0x2)+parseInt(_0x309cef(0x27e))/0x3+parseInt(_0x309cef(0x283))/0x4+-parseInt(_0x309cef(0x234))/0x5+-parseInt(_0x309cef(0x237))/0x6*(-parseInt(_0x309cef(0x266))/0x7)+-parseInt(_0x309cef(0x1f2))/0x8*(-parseInt(_0x309cef(0x235))/0x9)+parseInt(_0x309cef(0x23c))/0xa*(-parseInt(_0x309cef(0x20d))/0xb);if(_0x5b52cd===_0x580979)break;else _0x770ea3['push'](_0x770ea3['shift']());}catch(_0x581166){_0x770ea3['push'](_0x770ea3['shift']());}}}(a146_0x3dab,0x6bc92));import{JourneyDefSchema}from'./types/journey-schema.js';function a146_0x3dab(){const _0x42638c=['.with.condition.segment','Jump\x20step\x20requires\x20a\x20target','map','issues','70acVMLm','MISSING_SEGMENT_REFERENCE','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','abs','endsWith','DUPLICATE_LATEST','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','referencedSegments','.with.activation','\x27\x20has\x20only\x20','startsWith','path','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','variants','END_STEP_HAS_NEXT_OR_WITH','Step\x20references\x20non-existent\x20step\x20\x27','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','state','stepNames','.entry_criteria','.segment','rule','percentage','jump','485748DSCaAH','timeout','versions[','MISSING_CONDITIONS','launched','1723228foHxmK','INSUFFICIENT_STEPS','level','join','some','Journey\x20name\x20is\x20required','includes','latest','stages','condition\x20of\x20\x27','segments','JOURNEY_SCHEMA_ERROR','timeout\x20of\x20\x27','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','7397KTNHed','with','.with.condition.next','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','warning','message','journeys','.steps','splice','length','decision_point','description','.steps[','versions','MISSING_EXIT_CRITERIA','MERGE_TO_MERGE_CHAIN','INVALID_NEXT_REFERENCE','stage','size','8qWbfEb','end','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','INVALID_AB_TEST_PERCENTAGES','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','excluded','ref:','goal','FEW_STEPS','\x27\x20has\x20no\x20end\x20step','SINGLE_INPUT_MERGE','.with.target','.with.condition',').\x20Merge\x20is\x20unnecessary.','indices','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','.with.branches','.with.condition.timeout','136fwZEfj','symbol','Embedded\x20segment\x20\x27','condition','activationKeys','Duplicate\x20step\x20name\x20\x27','.milestone','source','data','3792899BdNEAG','INVALID_JUMP_TARGET','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','MISSING_NAME','\x27\x20(first\x20defined\x20at\x20steps[','type','\x27\x20with\x20no\x20action\x20in\x20between','activation','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','\x27\x20(from:\x20','get','target','keys','next','.with.branches[','has','set','\x20versions)','MISSING_MILESTONE','name','skipSchema','safeParse','branches','\x20stages\x20but\x20maximum\x20is\x20','End\x20step\x20\x27','\x27\x20of\x20\x27','push','BRANCH_DIRECTLY_TO_MERGE','MISSING_ENTRY_CRITERIA','add','wait','ACTIVATION_SCHEMA_ERROR','ab_test','match','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27',').\x20Use\x20a\x20merge\x20step.','merge','.exit_criteria[','DUPLICATE_STEP_NAME','4358015uMgLYR','6887880aLwVjI','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','498774JvdoGy','error','.next','journeys,\x20stages,\x20or\x20versions','MISSING_ACTIVATION_REF','40oHihzn','exit_criteria','.type','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','activations','Merge\x20step\x20\x27','.rule','.exit_criteria','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','.stages','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','Journey\x20has\x20no\x20goal\x20defined','reduce','filter','Journey\x20has\x20','trim','.name','.with','Stage\x20\x27','Journey\x20can\x20have\x20at\x20most\x20one\x20','\x20with\x20latest:\x20true','segment','milestone','MISSING_STAGES','steps','UNUSED_EMBEDDED_SEGMENT','Criteria\x20references\x20undefined\x20segment\x20\x27','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','.with.variants','embeddedSegments','.with.variants[','stages[','step\x20\x27','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','\x20(across\x20','success','document','entry_criteria'];a146_0x3dab=function(){return _0x42638c;};return a146_0x3dab();}import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0xaf0460,_0x53770c,_0x445775,_0x2063e7,_0x42c0c7,_0xd9049){const _0x25f5c2=a146_0x35cf;return{'level':_0xaf0460,'path':_0x53770c,'code':_0x445775,'message':_0x2063e7,'location':getLocationFromPath(_0x42c0c7[_0x25f5c2(0x260)],_0x42c0c7[_0x25f5c2(0x20b)],pathToArray(_0xd9049??_0x53770c))};}function validateVersionStructure(_0x392091,_0x1990e9){const _0x506db0=a146_0x35cf,_0x4a4b5f=[];return _0x392091[_0x506db0(0x1e8)]>MAX_STAGES&&_0x4a4b5f[_0x506db0(0x227)](createIssue(_0x506db0(0x238),_0x506db0(0x28b),'TOO_MANY_STAGES',_0x506db0(0x24a)+_0x392091[_0x506db0(0x1e8)]+_0x506db0(0x224)+MAX_STAGES,_0x1990e9)),_0x4a4b5f;}function validateStageStructure(_0x826ee5,_0x5185ce,_0x160df2,_0x430655){const _0x9e15bb=a146_0x35cf,_0x3e2aa0=[],_0x3d3753='stages['+_0x5185ce+']';_0x5185ce===0x0&&!_0x826ee5[_0x9e15bb(0x261)]&&_0x3e2aa0[_0x9e15bb(0x227)](createIssue(_0x9e15bb(0x238),_0x3d3753+_0x9e15bb(0x279),_0x9e15bb(0x229),_0x9e15bb(0x24e)+_0x826ee5[_0x9e15bb(0x220)]+_0x9e15bb(0x276),_0x430655,_0x3d3753));const _0x1aa064=_0x5185ce===_0x160df2-0x1;!_0x1aa064&&!_0x826ee5[_0x9e15bb(0x252)]&&_0x3e2aa0[_0x9e15bb(0x227)](createIssue(_0x9e15bb(0x238),_0x3d3753+_0x9e15bb(0x20a),_0x9e15bb(0x21f),'Stage\x20\x27'+_0x826ee5[_0x9e15bb(0x220)]+_0x9e15bb(0x26c),_0x430655,_0x3d3753));(!_0x826ee5[_0x9e15bb(0x23d)]||_0x826ee5[_0x9e15bb(0x23d)][_0x9e15bb(0x1e8)]===0x0)&&_0x3e2aa0[_0x9e15bb(0x227)](createIssue(_0x9e15bb(0x295),_0x3d3753+_0x9e15bb(0x243),_0x9e15bb(0x1ed),_0x9e15bb(0x24e)+_0x826ee5[_0x9e15bb(0x220)]+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x430655,_0x3d3753));const _0x3f7444=_0x826ee5['steps']?.[_0x9e15bb(0x1e8)]??0x0;if(_0x3f7444===0x0)_0x3e2aa0[_0x9e15bb(0x227)](createIssue(_0x9e15bb(0x238),_0x3d3753+_0x9e15bb(0x1e6),_0x9e15bb(0x284),'Stage\x20\x27'+_0x826ee5[_0x9e15bb(0x220)]+'\x27\x20has\x20no\x20steps',_0x430655,_0x3d3753+_0x9e15bb(0x1e6)));else{if(_0x3f7444===0x1)_0x3e2aa0['push'](createIssue(_0x9e15bb(0x295),_0x3d3753+_0x9e15bb(0x1e6),_0x9e15bb(0x284),_0x9e15bb(0x24e)+_0x826ee5['name']+'\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)',_0x430655,_0x3d3753+_0x9e15bb(0x1e6)));else _0x3f7444<=0x3&&_0x3e2aa0['push'](createIssue('warning',_0x3d3753+'.steps',_0x9e15bb(0x1fa),_0x9e15bb(0x24e)+_0x826ee5[_0x9e15bb(0x220)]+_0x9e15bb(0x26f)+_0x3f7444+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x430655,_0x3d3753+'.steps'));}return _0x3e2aa0;}function validateStep(_0x4dce66,_0x5611aa,_0x20d758,_0x17e159){const _0x379cd8=a146_0x35cf,_0x55a53c=[];if(_0x4dce66[_0x379cd8(0x212)]===_0x379cd8(0x1f3))return _0x4dce66[_0x379cd8(0x21a)]&&_0x55a53c[_0x379cd8(0x227)](createIssue(_0x379cd8(0x238),_0x5611aa+'.next',_0x379cd8(0x274),_0x379cd8(0x225)+_0x4dce66[_0x379cd8(0x220)]+_0x379cd8(0x1f6),_0x20d758)),_0x379cd8(0x292)in _0x4dce66&&_0x4dce66[_0x379cd8(0x292)]!==undefined&&_0x55a53c['push'](createIssue(_0x379cd8(0x238),_0x5611aa+'.with',_0x379cd8(0x274),_0x379cd8(0x225)+_0x4dce66[_0x379cd8(0x220)]+_0x379cd8(0x23f),_0x20d758)),_0x55a53c;_0x4dce66[_0x379cd8(0x21a)]&&(_0x20d758[_0x379cd8(0x278)]&&!_0x20d758[_0x379cd8(0x278)][_0x379cd8(0x21c)](_0x4dce66[_0x379cd8(0x21a)])&&_0x55a53c[_0x379cd8(0x227)](createIssue(_0x379cd8(0x238),_0x5611aa+_0x379cd8(0x239),_0x379cd8(0x1ef),_0x379cd8(0x275)+_0x4dce66[_0x379cd8(0x21a)]+'\x27',_0x20d758)));switch(_0x4dce66[_0x379cd8(0x212)]){case _0x379cd8(0x22b):_0x55a53c[_0x379cd8(0x227)](...validateWaitStep(_0x4dce66,_0x5611aa,_0x20d758,_0x17e159));break;case'activation':_0x55a53c[_0x379cd8(0x227)](...validateActivationStep(_0x4dce66,_0x5611aa,_0x20d758));break;case _0x379cd8(0x1e9):_0x55a53c[_0x379cd8(0x227)](...validateDecisionPointStep(_0x4dce66,_0x5611aa,_0x20d758,_0x17e159));break;case _0x379cd8(0x22d):_0x55a53c[_0x379cd8(0x227)](...validateAbTestStep(_0x4dce66,_0x5611aa,_0x20d758,_0x17e159));break;case _0x379cd8(0x27d):_0x55a53c[_0x379cd8(0x227)](...validateJumpStep(_0x4dce66,_0x5611aa,_0x20d758));break;}return _0x55a53c;}function validateWaitStep(_0x2f3556,_0x27a347,_0x350b89,_0x45c882){const _0x2e3187=a146_0x35cf,_0x1e2666=[];if(!_0x2f3556['with'])return _0x1e2666['push'](createIssue(_0x2e3187(0x238),_0x27a347+_0x2e3187(0x24d),'MISSING_WAIT_PARAMS',_0x2e3187(0x25d),_0x350b89,_0x27a347)),_0x1e2666;if(_0x2f3556['with'][_0x2e3187(0x207)]){const _0x323012=_0x2f3556[_0x2e3187(0x292)][_0x2e3187(0x207)];if(_0x323012[_0x2e3187(0x251)]){_0x350b89[_0x2e3187(0x26d)]?.[_0x2e3187(0x22a)](_0x323012[_0x2e3187(0x251)]);!_0x323012['segment'][_0x2e3187(0x270)](_0x2e3187(0x1f8))&&(_0x350b89[_0x2e3187(0x259)]&&!_0x350b89[_0x2e3187(0x259)][_0x2e3187(0x21c)](_0x323012[_0x2e3187(0x251)])&&_0x1e2666[_0x2e3187(0x227)](createIssue(_0x2e3187(0x238),_0x27a347+_0x2e3187(0x262),_0x2e3187(0x267),'Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x323012[_0x2e3187(0x251)]+_0x2e3187(0x20f),_0x350b89)));_0x323012[_0x2e3187(0x21a)]&&_0x350b89[_0x2e3187(0x278)]&&!_0x350b89[_0x2e3187(0x278)][_0x2e3187(0x21c)](_0x323012[_0x2e3187(0x21a)])&&_0x1e2666[_0x2e3187(0x227)](createIssue(_0x2e3187(0x238),_0x27a347+'.with.condition.next',_0x2e3187(0x1ef),_0x2e3187(0x272)+_0x323012[_0x2e3187(0x21a)]+'\x27',_0x350b89));_0x323012['timeout']?.[_0x2e3187(0x21a)]&&_0x350b89[_0x2e3187(0x278)]&&!_0x350b89[_0x2e3187(0x278)][_0x2e3187(0x21c)](_0x323012[_0x2e3187(0x27f)][_0x2e3187(0x21a)])&&_0x1e2666[_0x2e3187(0x227)](createIssue(_0x2e3187(0x238),_0x27a347+'.with.condition.timeout.next',_0x2e3187(0x1ef),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x323012['timeout']['next']+'\x27',_0x350b89));const _0x4160ea=_0x323012['next']||_0x2f3556['next'],_0x526f62=_0x323012[_0x2e3187(0x27f)]?.['next']||_0x2f3556[_0x2e3187(0x21a)];if(_0x4160ea){const _0xa7947d=_0x45c882[_0x2e3187(0x217)](_0x4160ea);_0xa7947d?.['type']==='merge'&&_0x1e2666['push'](createIssue(_0x2e3187(0x295),_0x27a347+_0x2e3187(0x293),_0x2e3187(0x228),_0x2e3187(0x22f)+_0x4160ea+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x350b89,_0x27a347+_0x2e3187(0x1fe)));}if(_0x526f62){const _0x1e8b70=_0x45c882['get'](_0x526f62);_0x1e8b70?.[_0x2e3187(0x212)]===_0x2e3187(0x231)&&_0x1e2666['push'](createIssue(_0x2e3187(0x295),_0x27a347+'.with.condition.timeout.next',_0x2e3187(0x228),_0x2e3187(0x294)+_0x526f62+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x350b89,_0x27a347+_0x2e3187(0x203)));}}}return _0x1e2666;}function validateActivationStep(_0x273b05,_0x4f394d,_0x10030c){const _0x367762=a146_0x35cf,_0x1c7aea=[];if(!_0x273b05[_0x367762(0x292)]?.[_0x367762(0x214)])return _0x1c7aea['push'](createIssue(_0x367762(0x238),_0x4f394d+_0x367762(0x26e),_0x367762(0x23b),'Activation\x20step\x20requires\x20an\x20activation\x20reference',_0x10030c,_0x4f394d)),_0x1c7aea;const _0x518924=_0x273b05[_0x367762(0x292)][_0x367762(0x214)];return _0x10030c['activationKeys']&&!_0x518924[_0x367762(0x270)](_0x367762(0x1f8))&&(!_0x10030c[_0x367762(0x208)][_0x367762(0x21c)](_0x518924)&&_0x1c7aea['push'](createIssue(_0x367762(0x238),_0x4f394d+_0x367762(0x26e),'MISSING_ACTIVATION_DEFINITION','Activation\x20step\x20references\x20undefined\x20activation\x20\x27'+_0x518924+_0x367762(0x201),_0x10030c))),_0x1c7aea;}function validateDecisionPointStep(_0x4f9a44,_0x1efdb4,_0x215715,_0x355ac3){const _0x2b0294=a146_0x35cf,_0x73fe92=[];if(!_0x4f9a44[_0x2b0294(0x292)]?.['branches']||_0x4f9a44[_0x2b0294(0x292)][_0x2b0294(0x223)]['length']===0x0)return _0x73fe92[_0x2b0294(0x227)](createIssue(_0x2b0294(0x238),_0x1efdb4+_0x2b0294(0x202),_0x2b0294(0x281),'Decision\x20point\x20requires\x20at\x20least\x20one\x20branch',_0x215715,_0x1efdb4)),_0x73fe92;for(let _0x2c58a5=0x0;_0x2c58a5<_0x4f9a44['with'][_0x2b0294(0x223)]['length'];_0x2c58a5++){const _0x51a77d=_0x4f9a44[_0x2b0294(0x292)][_0x2b0294(0x223)][_0x2c58a5],_0x570477=_0x1efdb4+_0x2b0294(0x21b)+_0x2c58a5+']';_0x51a77d['segment']&&!_0x51a77d[_0x2b0294(0x1f7)]&&(_0x215715[_0x2b0294(0x26d)]?.[_0x2b0294(0x22a)](_0x51a77d[_0x2b0294(0x251)]),!_0x51a77d['segment'][_0x2b0294(0x270)]('ref:')&&(_0x215715[_0x2b0294(0x259)]&&!_0x215715['embeddedSegments'][_0x2b0294(0x21c)](_0x51a77d[_0x2b0294(0x251)])&&_0x73fe92[_0x2b0294(0x227)](createIssue(_0x2b0294(0x238),_0x570477+'.segment',_0x2b0294(0x267),_0x2b0294(0x290)+_0x51a77d[_0x2b0294(0x251)]+'\x27',_0x215715))));_0x51a77d[_0x2b0294(0x21a)]&&_0x215715[_0x2b0294(0x278)]&&!_0x215715[_0x2b0294(0x278)][_0x2b0294(0x21c)](_0x51a77d[_0x2b0294(0x21a)])&&_0x73fe92['push'](createIssue(_0x2b0294(0x238),_0x570477+_0x2b0294(0x239),'INVALID_NEXT_REFERENCE','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0x51a77d[_0x2b0294(0x21a)]+'\x27',_0x215715));if(_0x51a77d[_0x2b0294(0x21a)]){const _0x2c7a7f=_0x355ac3[_0x2b0294(0x217)](_0x51a77d[_0x2b0294(0x21a)]);_0x2c7a7f?.['type']==='merge'&&_0x73fe92[_0x2b0294(0x227)](createIssue(_0x2b0294(0x295),_0x570477+_0x2b0294(0x239),_0x2b0294(0x228),'Decision\x20branch\x20\x27'+_0x51a77d[_0x2b0294(0x220)]+'\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x51a77d[_0x2b0294(0x21a)]+_0x2b0294(0x213),_0x215715));}}return _0x73fe92;}function validateAbTestStep(_0x2720f4,_0xc12d7a,_0x1a7095,_0x3ce237){const _0x132cc5=a146_0x35cf,_0x20a623=[];if(!_0x2720f4[_0x132cc5(0x292)]?.[_0x132cc5(0x273)]||_0x2720f4[_0x132cc5(0x292)]['variants'][_0x132cc5(0x1e8)]===0x0)return _0x20a623[_0x132cc5(0x227)](createIssue(_0x132cc5(0x238),_0xc12d7a+_0x132cc5(0x258),'MISSING_CONDITIONS','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x1a7095,_0xc12d7a)),_0x20a623;const _0x480cfd=_0x2720f4[_0x132cc5(0x292)]['variants'][_0x132cc5(0x248)]((_0x53bfc4,_0x315755)=>_0x53bfc4+(_0x315755[_0x132cc5(0x27c)]||0x0),0x0);Math[_0x132cc5(0x269)](_0x480cfd-0x64)>0.01&&_0x20a623[_0x132cc5(0x227)](createIssue(_0x132cc5(0x238),_0xc12d7a+_0x132cc5(0x258),_0x132cc5(0x1f5),_0x132cc5(0x244)+_0x480cfd+'%)',_0x1a7095));for(let _0x1ab526=0x0;_0x1ab526<_0x2720f4[_0x132cc5(0x292)][_0x132cc5(0x273)][_0x132cc5(0x1e8)];_0x1ab526++){const _0x1ec76e=_0x2720f4['with'][_0x132cc5(0x273)][_0x1ab526],_0x298d4f=_0xc12d7a+_0x132cc5(0x25a)+_0x1ab526+']';_0x1ec76e[_0x132cc5(0x21a)]&&_0x1a7095[_0x132cc5(0x278)]&&!_0x1a7095[_0x132cc5(0x278)][_0x132cc5(0x21c)](_0x1ec76e[_0x132cc5(0x21a)])&&_0x20a623[_0x132cc5(0x227)](createIssue(_0x132cc5(0x238),_0x298d4f+_0x132cc5(0x239),'INVALID_NEXT_REFERENCE','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27'+_0x1ec76e[_0x132cc5(0x21a)]+'\x27',_0x1a7095));if(_0x1ec76e['next']){const _0x3ac8cc=_0x3ce237[_0x132cc5(0x217)](_0x1ec76e['next']);_0x3ac8cc?.[_0x132cc5(0x212)]===_0x132cc5(0x231)&&_0x20a623['push'](createIssue(_0x132cc5(0x295),_0x298d4f+'.next',_0x132cc5(0x228),'A/B\x20test\x20variant\x20\x27'+_0x1ec76e[_0x132cc5(0x220)]+_0x132cc5(0x246)+_0x1ec76e['next']+_0x132cc5(0x213),_0x1a7095));}}return _0x20a623;}function a146_0x35cf(_0x5c12d5,_0x20deaf){_0x5c12d5=_0x5c12d5-0x1e5;const _0x3dabc3=a146_0x3dab();let _0x35cf12=_0x3dabc3[_0x5c12d5];return _0x35cf12;}function validateJumpStep(_0x2236b5,_0x4da913,_0x35a96f){const _0xa8cbfb=a146_0x35cf,_0x194e5e=[];if(!_0x2236b5[_0xa8cbfb(0x292)]?.[_0xa8cbfb(0x218)])return _0x194e5e[_0xa8cbfb(0x227)](createIssue(_0xa8cbfb(0x238),_0x4da913+'.with.target',_0xa8cbfb(0x20e),_0xa8cbfb(0x263),_0x35a96f,_0x4da913)),_0x194e5e;return(!_0x2236b5[_0xa8cbfb(0x292)]['target']['journey']||!_0x2236b5[_0xa8cbfb(0x292)][_0xa8cbfb(0x218)][_0xa8cbfb(0x1f0)])&&_0x194e5e['push'](createIssue('error',_0x4da913+_0xa8cbfb(0x1fd),_0xa8cbfb(0x20e),_0xa8cbfb(0x1f4),_0x35a96f)),_0x194e5e;}function buildConvergenceMap(_0x4d7484){const _0x16b19b=a146_0x35cf,_0x110303=new Map();function _0x159520(_0xfb9ba4,_0x4d780c){const _0x2c84b3=a146_0x35cf,_0x500a21=_0x110303['get'](_0xfb9ba4)||[];_0x500a21[_0x2c84b3(0x227)](_0x4d780c),_0x110303[_0x2c84b3(0x21d)](_0xfb9ba4,_0x500a21);}for(const _0x3475c0 of _0x4d7484){_0x3475c0['next']&&_0x159520(_0x3475c0[_0x16b19b(0x21a)],{'stepName':_0x3475c0[_0x16b19b(0x220)],'description':_0x16b19b(0x25c)+_0x3475c0[_0x16b19b(0x220)]+'\x27'});if(_0x3475c0[_0x16b19b(0x212)]===_0x16b19b(0x1e9)&&_0x3475c0[_0x16b19b(0x292)]?.[_0x16b19b(0x223)])for(const _0x11446c of _0x3475c0[_0x16b19b(0x292)][_0x16b19b(0x223)]){_0x11446c['next']&&_0x159520(_0x11446c['next'],{'stepName':_0x3475c0[_0x16b19b(0x220)],'description':'branch\x20\x27'+_0x11446c[_0x16b19b(0x220)]+_0x16b19b(0x226)+_0x3475c0['name']+'\x27'});}if(_0x3475c0[_0x16b19b(0x212)]===_0x16b19b(0x22d)&&_0x3475c0[_0x16b19b(0x292)]?.['variants'])for(const _0x52691a of _0x3475c0[_0x16b19b(0x292)]['variants']){_0x52691a['next']&&_0x159520(_0x52691a['next'],{'stepName':_0x3475c0['name'],'description':'variant\x20\x27'+_0x52691a['name']+_0x16b19b(0x226)+_0x3475c0['name']+'\x27'});}_0x3475c0['type']===_0x16b19b(0x22b)&&_0x3475c0[_0x16b19b(0x292)]?.[_0x16b19b(0x207)]&&(_0x3475c0[_0x16b19b(0x292)][_0x16b19b(0x207)]['next']&&_0x159520(_0x3475c0['with'][_0x16b19b(0x207)][_0x16b19b(0x21a)],{'stepName':_0x3475c0[_0x16b19b(0x220)],'description':_0x16b19b(0x28c)+_0x3475c0[_0x16b19b(0x220)]+'\x27'}),_0x3475c0[_0x16b19b(0x292)][_0x16b19b(0x207)][_0x16b19b(0x27f)]?.['next']&&_0x159520(_0x3475c0[_0x16b19b(0x292)][_0x16b19b(0x207)][_0x16b19b(0x27f)][_0x16b19b(0x21a)],{'stepName':_0x3475c0[_0x16b19b(0x220)],'description':_0x16b19b(0x28f)+_0x3475c0['name']+'\x27'}));}return _0x110303;}function validateFlowControl(_0x2868f0,_0x1b6d7f,_0x3942c1){const _0x20a29c=a146_0x35cf,_0x15434d=[],_0x4806ab=_0x20a29c(0x25b)+_0x1b6d7f+']',_0x5a3d72=_0x2868f0['steps']||[];if(_0x5a3d72['length']===0x0)return _0x15434d;const _0x12629b=new Map();for(const _0x170d57 of _0x5a3d72){_0x170d57[_0x20a29c(0x220)]&&_0x12629b['set'](_0x170d57['name'],_0x170d57);}const _0x5eb78d=buildConvergenceMap(_0x5a3d72),_0xb68608=_0x5a3d72[_0x20a29c(0x287)](_0x284eb5=>_0x284eb5[_0x20a29c(0x212)]===_0x20a29c(0x1f3));!_0xb68608&&_0x15434d['push'](createIssue('error',_0x4806ab+'.steps','MISSING_END_STEP',_0x20a29c(0x24e)+_0x2868f0['name']+_0x20a29c(0x1fb),_0x3942c1));for(const [_0xc0b610,_0x13fbf8]of _0x5eb78d){const _0xf08262=_0x12629b[_0x20a29c(0x217)](_0xc0b610);if(!_0xf08262)continue;if(_0x13fbf8['length']>0x1&&_0xf08262[_0x20a29c(0x212)]!==_0x20a29c(0x231)){const _0x2a12d0=_0x13fbf8[_0x20a29c(0x264)](_0x4160f3=>_0x4160f3[_0x20a29c(0x1ea)])[_0x20a29c(0x286)](',\x20');_0x15434d[_0x20a29c(0x227)](createIssue(_0x20a29c(0x238),_0x4806ab+_0x20a29c(0x1e6),'CONVERGENCE_WITHOUT_MERGE','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27'+_0xc0b610+_0x20a29c(0x216)+_0x2a12d0+_0x20a29c(0x230),_0x3942c1));}_0x13fbf8[_0x20a29c(0x1e8)]===0x1&&_0xf08262[_0x20a29c(0x212)]==='merge'&&_0x15434d[_0x20a29c(0x227)](createIssue(_0x20a29c(0x295),_0x4806ab+'.steps',_0x20a29c(0x1fc),'Merge\x20step\x20\x27'+_0xc0b610+_0x20a29c(0x215)+_0x13fbf8[0x0][_0x20a29c(0x1ea)]+_0x20a29c(0x1ff),_0x3942c1));}for(const _0x421455 of _0x5a3d72){if(_0x421455[_0x20a29c(0x212)]==='merge'&&_0x421455[_0x20a29c(0x21a)]){const _0x3d44ba=_0x12629b[_0x20a29c(0x217)](_0x421455[_0x20a29c(0x21a)]);_0x3d44ba?.[_0x20a29c(0x212)]===_0x20a29c(0x231)&&_0x15434d[_0x20a29c(0x227)](createIssue(_0x20a29c(0x238),_0x4806ab+'.steps',_0x20a29c(0x1ee),_0x20a29c(0x241)+_0x421455[_0x20a29c(0x220)]+_0x20a29c(0x268)+_0x421455[_0x20a29c(0x21a)]+_0x20a29c(0x236),_0x3942c1));}}return _0x15434d;}function validateCriteria(_0x2cafa9,_0x486a8a,_0x21a799){const _0x457a49=a146_0x35cf,_0x37a878=[];return _0x2cafa9[_0x457a49(0x251)]&&(_0x21a799['referencedSegments']?.[_0x457a49(0x22a)](_0x2cafa9[_0x457a49(0x251)]),!_0x2cafa9[_0x457a49(0x251)]['startsWith'](_0x457a49(0x1f8))&&(_0x21a799['embeddedSegments']&&!_0x21a799[_0x457a49(0x259)][_0x457a49(0x21c)](_0x2cafa9['segment'])&&_0x37a878['push'](createIssue(_0x457a49(0x238),_0x486a8a+_0x457a49(0x27a),_0x457a49(0x267),_0x457a49(0x256)+_0x2cafa9['segment']+'\x27',_0x21a799)))),_0x37a878;}function validateEmbeddedSegment(_0x247a26,_0x30af11,_0x222d5c){const _0x108b86=a146_0x35cf,_0x245dbd=[];return _0x247a26[_0x108b86(0x27b)]&&_0x245dbd['push'](...validateRuleDef(_0x247a26['rule'],_0x30af11+_0x108b86(0x242),_0x222d5c)),_0x245dbd;}function validateStage(_0x38b36b,_0x5e8d9b,_0x2a3325,_0x1ee874){const _0x2a2a72=a146_0x35cf,_0x6b82dd=[],_0x1076c5=_0x2a2a72(0x25b)+_0x5e8d9b+']',_0x36bb10=new Map(),_0x295aa3=new Map();if(_0x38b36b[_0x2a2a72(0x254)]){for(let _0x3655ea=0x0;_0x3655ea<_0x38b36b[_0x2a2a72(0x254)][_0x2a2a72(0x1e8)];_0x3655ea++){const _0x54c60c=_0x38b36b[_0x2a2a72(0x254)][_0x3655ea];_0x54c60c[_0x2a2a72(0x220)]&&_0x36bb10['set'](_0x54c60c[_0x2a2a72(0x220)],_0x54c60c);}for(let _0x45faff=0x0;_0x45faff<_0x38b36b[_0x2a2a72(0x254)][_0x2a2a72(0x1e8)];_0x45faff++){const _0x2e999a=_0x38b36b['steps'][_0x45faff],_0x441b93=_0x1076c5+_0x2a2a72(0x1eb)+_0x45faff+']';if(_0x2e999a[_0x2a2a72(0x220)]){if(_0x295aa3[_0x2a2a72(0x21c)](_0x2e999a[_0x2a2a72(0x220)])){const _0x5c2746=_0x295aa3[_0x2a2a72(0x217)](_0x2e999a['name']);_0x6b82dd[_0x2a2a72(0x227)](createIssue(_0x2a2a72(0x238),_0x441b93+_0x2a2a72(0x24c),_0x2a2a72(0x233),_0x2a2a72(0x209)+_0x2e999a[_0x2a2a72(0x220)]+_0x2a2a72(0x211)+_0x5c2746+'])',_0x1ee874));}else _0x295aa3[_0x2a2a72(0x21d)](_0x2e999a[_0x2a2a72(0x220)],_0x45faff);}_0x6b82dd[_0x2a2a72(0x227)](...validateStep(_0x2e999a,_0x441b93,_0x1ee874,_0x36bb10));}}_0x38b36b[_0x2a2a72(0x261)]&&_0x6b82dd['push'](...validateCriteria(_0x38b36b[_0x2a2a72(0x261)],_0x1076c5+_0x2a2a72(0x279),_0x1ee874));if(_0x38b36b[_0x2a2a72(0x23d)])for(let _0x10a371=0x0;_0x10a371<_0x38b36b[_0x2a2a72(0x23d)][_0x2a2a72(0x1e8)];_0x10a371++){_0x6b82dd['push'](...validateCriteria(_0x38b36b['exit_criteria'][_0x10a371],_0x1076c5+_0x2a2a72(0x232)+_0x10a371+']',_0x1ee874));}return _0x38b36b[_0x2a2a72(0x252)]&&_0x6b82dd[_0x2a2a72(0x227)](...validateCriteria(_0x38b36b[_0x2a2a72(0x252)],_0x1076c5+_0x2a2a72(0x20a),_0x1ee874)),_0x6b82dd[_0x2a2a72(0x227)](...validateStageStructure(_0x38b36b,_0x5e8d9b,_0x2a3325,_0x1ee874)),_0x6b82dd['push'](...validateFlowControl(_0x38b36b,_0x5e8d9b,_0x1ee874)),_0x6b82dd;}function validateStagesForVersion(_0x50605f,_0x249728,_0x18b941,_0x5553bd,_0x10bbd2,_0x3813bf,_0x53ee6b){const _0x14fe57=a146_0x35cf;if(_0x50605f[_0x14fe57(0x1e8)]===0x0){_0x10bbd2['push']({'level':_0x14fe57(0x238),'path':_0x5553bd+_0x14fe57(0x28b),'code':'MISSING_STAGES','message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x18b941[_0x14fe57(0x260)],_0x18b941[_0x14fe57(0x20b)],[_0x14fe57(0x28b)])});return;}const _0xee4d0e=new Set();for(const _0x41b3d0 of _0x50605f){if(_0x41b3d0['steps'])for(const _0x20036b of _0x41b3d0[_0x14fe57(0x254)]){_0x20036b[_0x14fe57(0x220)]&&_0xee4d0e[_0x14fe57(0x22a)](_0x20036b['name']);}}const _0xd6e375={..._0x18b941,'stepNames':_0xee4d0e},_0x36fda7=validateVersionStructure(_0x50605f,_0xd6e375);for(const _0x5d8b82 of _0x36fda7){const _0x22b129=_0x5553bd?{..._0x5d8b82,'path':''+_0x5553bd+_0x5d8b82[_0x14fe57(0x271)]}:_0x5d8b82;if(_0x22b129[_0x14fe57(0x285)]===_0x14fe57(0x238))_0x10bbd2[_0x14fe57(0x227)](_0x22b129);else _0x3813bf[_0x14fe57(0x227)](_0x22b129);}for(let _0x35d986=0x0;_0x35d986<_0x50605f[_0x14fe57(0x1e8)];_0x35d986++){const _0x789689=validateStage(_0x50605f[_0x35d986],_0x35d986,_0x50605f[_0x14fe57(0x1e8)],_0xd6e375);for(const _0x53a84d of _0x789689){const _0x547a78=_0x5553bd?{..._0x53a84d,'path':''+_0x5553bd+_0x53a84d[_0x14fe57(0x271)]}:_0x53a84d;if(_0x547a78[_0x14fe57(0x285)]==='error')_0x10bbd2[_0x14fe57(0x227)](_0x547a78);else _0x3813bf[_0x14fe57(0x227)](_0x547a78);}}if(_0x249728[_0x14fe57(0x1f9)]){const _0x4c8edd=_0x53ee6b?.['goalIsInherited']?_0x14fe57(0x1f9):_0x5553bd+'goal',_0xe60801=validateCriteria(_0x249728[_0x14fe57(0x1f9)],_0x4c8edd,_0xd6e375);for(const _0x1624bf of _0xe60801){if(_0x1624bf[_0x14fe57(0x285)]===_0x14fe57(0x238))_0x10bbd2[_0x14fe57(0x227)](_0x1624bf);else _0x3813bf[_0x14fe57(0x227)](_0x1624bf);}}}function extractVersionIndex(_0xde7c4){const _0x25616d=a146_0x35cf,_0x1ff6f5=_0xde7c4[_0x25616d(0x22e)](/^journeys\[(\d+)\]\./);return _0x1ff6f5?_0x1ff6f5[0x1]:undefined;}function deduplicateAcrossVersions(_0x4fc3b6){const _0x269822=a146_0x35cf,_0x2ae91a=new Map();for(let _0x5e3d3a=0x0;_0x5e3d3a<_0x4fc3b6[_0x269822(0x1e8)];_0x5e3d3a++){const _0x258fda=_0x4fc3b6[_0x5e3d3a]['code']+':'+_0x4fc3b6[_0x5e3d3a][_0x269822(0x296)],_0x2163a3=extractVersionIndex(_0x4fc3b6[_0x5e3d3a][_0x269822(0x271)]),_0x5070ff=_0x2ae91a[_0x269822(0x217)](_0x258fda);if(_0x5070ff){_0x5070ff[_0x269822(0x200)]['push'](_0x5e3d3a);if(_0x2163a3)_0x5070ff['versions']['add'](_0x2163a3);}else _0x2ae91a['set'](_0x258fda,{'indices':[_0x5e3d3a],'versions':new Set(_0x2163a3?[_0x2163a3]:[])});}const _0x55e86a=new Set();for(const {indices:_0x17d615,versions:_0x524caf}of _0x2ae91a['values']()){if(_0x524caf[_0x269822(0x1f1)]<=0x1)continue;const _0xdcbbd0=_0x4fc3b6[_0x17d615[0x0]];_0xdcbbd0[_0x269822(0x271)]=_0xdcbbd0[_0x269822(0x271)]['replace'](/^journeys\[\d+\]\./,''),_0xdcbbd0['message']=_0xdcbbd0['message']+_0x269822(0x25e)+_0x524caf[_0x269822(0x1f1)]+_0x269822(0x21e);for(let _0x42c166=0x1;_0x42c166<_0x17d615['length'];_0x42c166++){_0x55e86a[_0x269822(0x22a)](_0x17d615[_0x42c166]);}}const _0x255e41=[..._0x55e86a]['sort']((_0x398adc,_0x8f895c)=>_0x8f895c-_0x398adc);for(const _0x2c34c8 of _0x255e41){_0x4fc3b6[_0x269822(0x1e7)](_0x2c34c8,0x1);}}export function validateJourneyDef(_0x342132,_0x2435eb={},_0x525f4e={}){const _0x1433bd=a146_0x35cf;if(_0x525f4e[_0x1433bd(0x221)])return runJourneySemanticChecks(_0x342132,_0x2435eb);const _0x23f1a1=JourneyDefSchema[_0x1433bd(0x222)](_0x342132);if(_0x23f1a1[_0x1433bd(0x25f)])return runJourneySemanticChecks(_0x23f1a1[_0x1433bd(0x20c)],_0x2435eb);return zodErrorsToJourneyValidationResult(_0x23f1a1[_0x1433bd(0x238)],_0x2435eb);}function zodErrorsToJourneyValidationResult(_0x228e1b,_0x21290d){const _0x3e1da6=a146_0x35cf,_0x4bd79c=flattenZodIssues(_0x228e1b[_0x3e1da6(0x265)]),_0x2690cd=_0x4bd79c[_0x3e1da6(0x264)](_0xa65449=>{const _0x105775=_0x3e1da6,_0x109a9c=formatZodPath(_0xa65449[_0x105775(0x271)]),_0x454c51=mapJourneyZodIssueToCode(_0xa65449,_0x109a9c),_0x2a3f15=getLocationFromPath(_0x21290d[_0x105775(0x260)],_0x21290d[_0x105775(0x20b)],_0xa65449[_0x105775(0x271)][_0x105775(0x264)](_0x5eca54=>typeof _0x5eca54===_0x105775(0x205)?String(_0x5eca54):_0x5eca54));return{'level':_0x105775(0x238),'path':_0x109a9c,'code':_0x454c51,'message':_0xa65449[_0x105775(0x296)],..._0x2a3f15&&{'location':_0x2a3f15}};});return{'valid':![],'errors':_0x2690cd,'warnings':[]};}function mapJourneyZodIssueToCode(_0x3378b2,_0xc91b18){const _0x5be1c3=a146_0x35cf;if(_0xc91b18==='name')return _0x5be1c3(0x210);if(_0xc91b18['endsWith'](_0x5be1c3(0x23e))&&_0xc91b18[_0x5be1c3(0x289)](_0x5be1c3(0x254)))return _0x5be1c3(0x28e);if(_0xc91b18===_0x5be1c3(0x28b)||_0xc91b18[_0x5be1c3(0x26a)](_0x5be1c3(0x245)))return _0x5be1c3(0x253);if(_0xc91b18===''&&_0x3378b2[_0x5be1c3(0x296)][_0x5be1c3(0x289)](_0x5be1c3(0x23a)))return _0x5be1c3(0x253);if(_0xc91b18[_0x5be1c3(0x289)](_0x5be1c3(0x214)))return _0x5be1c3(0x22c);return _0x5be1c3(0x28e);}function runJourneySemanticChecks(_0x3c91da,_0xd1bf2d){const _0x473dc4=a146_0x35cf,_0x3411b3=[],_0x4b5585=[];(!_0x3c91da['name']||_0x3c91da[_0x473dc4(0x220)][_0x473dc4(0x24b)]()==='')&&_0x3411b3['push']({'level':'error','path':_0x473dc4(0x220),'code':_0x473dc4(0x210),'message':_0x473dc4(0x288),'location':getLocationFromPath(_0xd1bf2d['document'],_0xd1bf2d[_0x473dc4(0x20b)],[_0x473dc4(0x220)])});const _0xabb59c=new Set();if(_0x3c91da['segments'])for(const _0x29a9a3 of Object[_0x473dc4(0x219)](_0x3c91da[_0x473dc4(0x28d)])){_0xabb59c[_0x473dc4(0x22a)](_0x29a9a3);}const _0x5998eb=new Set();if(_0x3c91da[_0x473dc4(0x240)])for(const _0x5598a8 of Object['keys'](_0x3c91da['activations'])){_0x5998eb['add'](_0x5598a8);}const _0x2e88a8=new Set(),_0x4af2f4={..._0xd1bf2d,'embeddedSegments':_0xabb59c,'referencedSegments':_0x2e88a8,'activationKeys':_0x5998eb[_0x473dc4(0x1f1)]>0x0?_0x5998eb:undefined};if(_0x3c91da[_0x473dc4(0x28d)])for(const [_0x30c404,_0xd47376]of Object['entries'](_0x3c91da['segments'])){const _0x1a7540=validateEmbeddedSegment(_0xd47376,'segments.'+_0x30c404,_0x4af2f4);for(const _0xc66331 of _0x1a7540){if(_0xc66331['level']==='error')_0x3411b3[_0x473dc4(0x227)](_0xc66331);else _0x4b5585['push'](_0xc66331);}}const _0x84fb73=!!_0x3c91da[_0x473dc4(0x1f9)],_0x173d43=_0x3c91da[_0x473dc4(0x1e5)]?.['every'](_0x5070b6=>!!_0x5070b6[_0x473dc4(0x1f9)])??![];!_0x84fb73&&!_0x173d43&&_0x4b5585[_0x473dc4(0x227)]({'level':'warning','path':'goal','code':'MISSING_GOAL','message':_0x473dc4(0x247),'location':getLocationFromPath(_0xd1bf2d[_0x473dc4(0x260)],_0xd1bf2d['source'],[_0x473dc4(0x1f9)])});const _0x3f2d71=_0x3c91da[_0x473dc4(0x1e5)]??_0x3c91da[_0x473dc4(0x1ec)];if(_0x3f2d71&&_0x3f2d71[_0x473dc4(0x249)](_0x2acaec=>_0x2acaec[_0x473dc4(0x28a)]===!![])[_0x473dc4(0x1e8)]>0x1){const _0xded1d5=_0x3c91da[_0x473dc4(0x1e5)]?_0x473dc4(0x1e5):_0x473dc4(0x1ec);_0x3411b3['push']({'level':_0x473dc4(0x238),'path':_0xded1d5,'code':_0x473dc4(0x26b),'message':_0x473dc4(0x24f)+(_0xded1d5==='journeys'?'journey\x20entry':'version')+_0x473dc4(0x250),'location':getLocationFromPath(_0xd1bf2d[_0x473dc4(0x260)],_0xd1bf2d[_0x473dc4(0x20b)],[_0xded1d5])});}if(_0x3c91da['journeys']&&_0x3c91da['journeys']['length']>0x0)for(let _0x5ddecd=0x0;_0x5ddecd<_0x3c91da[_0x473dc4(0x1e5)][_0x473dc4(0x1e8)];_0x5ddecd++){const _0x431314=_0x3c91da[_0x473dc4(0x1e5)][_0x5ddecd];if(_0x3c91da['journeys'][_0x473dc4(0x1e8)]>0x1&&_0x431314[_0x473dc4(0x277)]===_0x473dc4(0x282))continue;const _0x53af1d=_0x431314['stages']||[],_0x55e97c='journeys['+_0x5ddecd+'].',_0x318c4d=!!_0x431314['goal'],_0x27394e=_0x318c4d?{..._0x3c91da,'goal':_0x431314['goal']}:_0x3c91da;validateStagesForVersion(_0x53af1d,_0x27394e,_0x4af2f4,_0x55e97c,_0x3411b3,_0x4b5585,{'goalIsInherited':!_0x318c4d});}else{if(_0x3c91da['versions']&&_0x3c91da[_0x473dc4(0x1ec)][_0x473dc4(0x1e8)]>0x0)for(let _0x28f20e=0x0;_0x28f20e<_0x3c91da[_0x473dc4(0x1ec)]['length'];_0x28f20e++){const _0x2db78d=_0x3c91da[_0x473dc4(0x1ec)][_0x28f20e];if(_0x3c91da[_0x473dc4(0x1ec)]['length']>0x1&&_0x2db78d[_0x473dc4(0x277)]==='launched')continue;const _0x2b450d=_0x2db78d['stages']||[],_0x4a1bca=_0x473dc4(0x280)+_0x28f20e+'].';validateStagesForVersion(_0x2b450d,_0x3c91da,_0x4af2f4,_0x4a1bca,_0x3411b3,_0x4b5585);}else{const _0x290f9e=_0x3c91da[_0x473dc4(0x28b)]||[];validateStagesForVersion(_0x290f9e,_0x3c91da,_0x4af2f4,'',_0x3411b3,_0x4b5585);}}_0x3c91da['journeys']&&_0x3c91da[_0x473dc4(0x1e5)][_0x473dc4(0x1e8)]>0x1&&(deduplicateAcrossVersions(_0x3411b3),deduplicateAcrossVersions(_0x4b5585));for(const _0xd20c85 of _0xabb59c){!_0x2e88a8[_0x473dc4(0x21c)](_0xd20c85)&&!_0xd20c85[_0x473dc4(0x270)]('excluded_')&&_0x4b5585[_0x473dc4(0x227)]({'level':_0x473dc4(0x295),'path':'segments.'+_0xd20c85,'code':_0x473dc4(0x255),'message':_0x473dc4(0x206)+_0xd20c85+_0x473dc4(0x257),'location':getLocationFromPath(_0xd1bf2d[_0x473dc4(0x260)],_0xd1bf2d['source'],[_0x473dc4(0x28d),_0xd20c85])});}return{'valid':_0x3411b3[_0x473dc4(0x1e8)]===0x0,'errors':_0x3411b3,'warnings':_0x4b5585};}
@@ -1 +1 @@
1
- function a147_0x3a14(_0x27eb77,_0x100db0){_0x27eb77=_0x27eb77-0x194;const _0x28af54=a147_0x28af();let _0x3a140a=_0x28af54[_0x27eb77];return _0x3a140a;}const a147_0x4d9c99=a147_0x3a14;(function(_0x39e0cc,_0x220508){const _0x49036d=a147_0x3a14,_0x9fea87=_0x39e0cc();while(!![]){try{const _0x57742a=parseInt(_0x49036d(0x246))/0x1*(parseInt(_0x49036d(0x1d2))/0x2)+parseInt(_0x49036d(0x20b))/0x3+parseInt(_0x49036d(0x1ca))/0x4*(-parseInt(_0x49036d(0x1d8))/0x5)+-parseInt(_0x49036d(0x1ab))/0x6+-parseInt(_0x49036d(0x224))/0x7+-parseInt(_0x49036d(0x1e0))/0x8*(-parseInt(_0x49036d(0x1cd))/0x9)+parseInt(_0x49036d(0x1d6))/0xa;if(_0x57742a===_0x220508)break;else _0x9fea87['push'](_0x9fea87['shift']());}catch(_0x5c71fc){_0x9fea87['push'](_0x9fea87['shift']());}}}(a147_0x28af,0x206db));import*as a147_0x327dd2 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(_0x43c424){const _0xadcb22=a147_0x3a14,_0x386446=_0x43c424[_0xadcb22(0x247)]();if(_0x386446===_0xadcb22(0x22d)||_0x386446===_0xadcb22(0x1ae))return _0xadcb22(0x1ae);if(_0x386446===_0xadcb22(0x1f0)||_0x386446===_0xadcb22(0x213))return _0xadcb22(0x213);return _0x43c424;}export function journeyResponseToDefSync(_0x2e3a2e){const _0x4f481c=a147_0x3a14,_0x35210e=_0x2e3a2e[_0x4f481c(0x202)],_0x7f1008=_0x35210e[_0x4f481c(0x19e)]||_0x35210e[_0x4f481c(0x1a5)],_0x2c714f={'stages':_0x35210e[_0x4f481c(0x228)][_0x4f481c(0x1ef)](convertApiStageToYaml),'id':_0x2e3a2e['id']};_0x35210e[_0x4f481c(0x22b)]&&(_0x2c714f[_0x4f481c(0x22b)]=convertApiCriteriaToYaml(_0x35210e[_0x4f481c(0x22b)]));_0x35210e[_0x4f481c(0x1a5)]&&_0x35210e[_0x4f481c(0x1a5)]!==_0x7f1008&&(_0x2c714f[_0x4f481c(0x226)]=_0x35210e[_0x4f481c(0x1a5)]);_0x35210e[_0x4f481c(0x1a7)]!==undefined&&(_0x2c714f['version_number']=_0x35210e[_0x4f481c(0x1a7)]);_0x35210e['state']&&(_0x2c714f[_0x4f481c(0x1cf)]=_0x35210e['state']==='launched'?_0x4f481c(0x1b1):_0x4f481c(0x1f1));const _0x5be2ec={'type':_0x4f481c(0x237),'name':_0x7f1008,'journeys':[_0x2c714f]};_0x35210e[_0x4f481c(0x225)]&&(_0x5be2ec[_0x4f481c(0x225)]=_0x35210e['description']);_0x35210e['goal']&&(_0x5be2ec[_0x4f481c(0x22b)]=convertApiCriteriaToYaml(_0x35210e[_0x4f481c(0x22b)]));if(_0x35210e[_0x4f481c(0x1f8)])_0x5be2ec['reentry']=_0x35210e[_0x4f481c(0x1f8)];else _0x35210e['allowReentry']!==undefined&&(_0x5be2ec[_0x4f481c(0x1e9)]=_0x35210e[_0x4f481c(0x23f)]?_0x4f481c(0x1d4):_0x4f481c(0x221));return _0x35210e[_0x4f481c(0x1bd)]&&(_0x5be2ec['bundle_id']=_0x35210e[_0x4f481c(0x1bd)]),_0x35210e[_0x4f481c(0x19e)]&&(_0x5be2ec[_0x4f481c(0x211)]=_0x35210e[_0x4f481c(0x19e)]),_0x2e3a2e[_0x4f481c(0x1d9)]?.['parentFolder']?.[_0x4f481c(0x1fe)]?.['id']&&(_0x5be2ec[_0x4f481c(0x19f)]=_0x2e3a2e[_0x4f481c(0x1d9)][_0x4f481c(0x1f4)][_0x4f481c(0x1fe)]['id']),_0x5be2ec;}export async function journeyResponseToDef(_0x2f340d,_0x26639d){const _0x1a4430=a147_0x3a14,_0x2ecf2a=journeyResponseToDefSync(_0x2f340d);if(!_0x26639d)return _0x2ecf2a;const _0xfdf875=new Set();collectSegmentIdsFromJourney(_0x2ecf2a,_0xfdf875);const _0x2d175e=new Set();collectActivationIdsFromJourney(_0x2ecf2a,_0x2d175e);const _0x143a99={},_0x5add38=new Map();for(const _0x37683e of Array['from'](_0xfdf875)[_0x1a4430(0x1bf)]()){if(_0x26639d[_0x1a4430(0x1cc)]){const _0x51498c=await _0x26639d[_0x1a4430(0x1cc)](_0x37683e);if(_0x51498c[_0x1a4430(0x1f7)]){_0x5add38[_0x1a4430(0x1b8)](_0x37683e,_0x51498c[_0x1a4430(0x1a5)]);if(_0x51498c[_0x1a4430(0x200)]){const _0x4722d3={..._0x51498c[_0x1a4430(0x200)],'rule':deepSortObject(_0x51498c[_0x1a4430(0x200)][_0x1a4430(0x1f3)])};_0x143a99[_0x51498c[_0x1a4430(0x1a5)]]=_0x4722d3;}}else _0x5add38[_0x1a4430(0x1b8)](_0x37683e,makeSegmentRef(_0x51498c['name']));}else{if(_0x26639d[_0x1a4430(0x212)]){const _0x1bf34f=await _0x26639d[_0x1a4430(0x212)](_0x37683e);_0x5add38[_0x1a4430(0x1b8)](_0x37683e,_0x1bf34f);}}}const _0x478f31={},_0x1b44b3=new Map();for(const _0x47613f of Array[_0x1a4430(0x19a)](_0x2d175e)[_0x1a4430(0x1bf)]()){if(_0x26639d['resolveActivation']){const _0x4e6cb3=await _0x26639d[_0x1a4430(0x1dc)](_0x47613f);_0x4e6cb3['isJourneyLocal']?(_0x1b44b3[_0x1a4430(0x1b8)](_0x47613f,_0x4e6cb3['name']),_0x4e6cb3[_0x1a4430(0x200)]&&(_0x478f31[_0x4e6cb3['name']]=_0x4e6cb3['definition'])):_0x1b44b3[_0x1a4430(0x1b8)](_0x47613f,makeSegmentRef(_0x4e6cb3[_0x1a4430(0x1a5)]));}else{if(_0x26639d[_0x1a4430(0x1e1)]){const _0x3bb4d0=await _0x26639d['resolveActivationName'](_0x47613f);_0x1b44b3[_0x1a4430(0x1b8)](_0x47613f,_0x3bb4d0);}}}_0x5add38['size']>0x0&&replaceSegmentIdsInJourney(_0x2ecf2a,_0x5add38);_0x1b44b3['size']>0x0&&replaceActivationIdsInJourney(_0x2ecf2a,_0x1b44b3);if(_0x26639d[_0x1a4430(0x1ea)]){const _0x5de1c3=[];collectJumpTargetsFromJourney(_0x2ecf2a,_0x5de1c3);if(_0x5de1c3[_0x1a4430(0x1e2)]>0x0){const _0x54d8a0=new Map();for(const _0x24633b of _0x5de1c3){try{const _0x3c54d1=await _0x26639d[_0x1a4430(0x1ea)](_0x24633b[_0x1a4430(0x22a)],_0x24633b[_0x1a4430(0x234)]);_0x54d8a0['set'](_0x24633b[_0x1a4430(0x22a)]+':'+_0x24633b[_0x1a4430(0x234)],_0x3c54d1);}catch{}}_0x54d8a0[_0x1a4430(0x1e8)]>0x0&&replaceJumpTargetsInJourney(_0x2ecf2a,_0x54d8a0);}}return Object['keys'](_0x143a99)[_0x1a4430(0x1e2)]>0x0&&(_0x2ecf2a['segments']=_0x143a99),Object[_0x1a4430(0x1c7)](_0x478f31)[_0x1a4430(0x1e2)]>0x0&&(_0x2ecf2a[_0x1a4430(0x1b6)]=_0x478f31),_0x2ecf2a;}function collectSegmentIdsFromJourney(_0x2d6418,_0x244525){const _0x43600b=a147_0x3a14;_0x2d6418[_0x43600b(0x22b)]?.['segment']&&_0x244525[_0x43600b(0x195)](_0x2d6418[_0x43600b(0x22b)][_0x43600b(0x208)]);const _0x52e211=_0x729efc=>{const _0x648ef0=_0x43600b;for(const _0x569897 of _0x729efc){_0x569897[_0x648ef0(0x21f)]?.[_0x648ef0(0x208)]&&_0x244525[_0x648ef0(0x195)](_0x569897[_0x648ef0(0x21f)][_0x648ef0(0x208)]);if(_0x569897[_0x648ef0(0x1c6)])for(const _0x5bef17 of _0x569897[_0x648ef0(0x1c6)]){_0x5bef17[_0x648ef0(0x208)]&&_0x244525[_0x648ef0(0x195)](_0x5bef17[_0x648ef0(0x208)]);}_0x569897[_0x648ef0(0x1ec)]?.['segment']&&_0x244525['add'](_0x569897[_0x648ef0(0x1ec)]['segment']);if(_0x569897['steps'])for(const _0x3939ac of _0x569897[_0x648ef0(0x206)]){if(_0x3939ac[_0x648ef0(0x1fb)]===_0x648ef0(0x255)){const _0x44836e=_0x3939ac;for(const _0x241e69 of _0x44836e[_0x648ef0(0x20f)][_0x648ef0(0x216)]){_0x241e69[_0x648ef0(0x208)]&&_0x244525[_0x648ef0(0x195)](_0x241e69[_0x648ef0(0x208)]);}}else{if(_0x3939ac[_0x648ef0(0x1fb)]===_0x648ef0(0x1b7)){const _0x1c2479=_0x3939ac;_0x1c2479[_0x648ef0(0x20f)][_0x648ef0(0x24b)]?.[_0x648ef0(0x208)]&&_0x244525['add'](_0x1c2479[_0x648ef0(0x20f)][_0x648ef0(0x24b)]['segment']);}}}}};if(_0x2d6418['journeys'])for(const _0x454c6b of _0x2d6418[_0x43600b(0x1e5)]){_0x454c6b[_0x43600b(0x22b)]?.['segment']&&_0x244525['add'](_0x454c6b[_0x43600b(0x22b)][_0x43600b(0x208)]),_0x52e211(_0x454c6b[_0x43600b(0x1a9)]);}_0x2d6418[_0x43600b(0x1a9)]&&_0x52e211(_0x2d6418[_0x43600b(0x1a9)]);if(_0x2d6418[_0x43600b(0x1c0)])for(const _0x58c2a1 of _0x2d6418[_0x43600b(0x1c0)]){_0x52e211(_0x58c2a1[_0x43600b(0x1a9)]);}}function replaceSegmentIdsInJourney(_0x351ea2,_0x3d0003){const _0x49ca66=a147_0x3a14,_0x250633=_0x42faf1=>_0x3d0003[_0x49ca66(0x232)](_0x42faf1)||_0x42faf1;_0x351ea2['goal']?.[_0x49ca66(0x208)]&&(_0x351ea2[_0x49ca66(0x22b)][_0x49ca66(0x208)]=_0x250633(_0x351ea2['goal'][_0x49ca66(0x208)]));const _0x27d492=_0x19b86a=>{const _0x5b878c=_0x49ca66;for(const _0x15dc43 of _0x19b86a){_0x15dc43[_0x5b878c(0x21f)]?.[_0x5b878c(0x208)]&&(_0x15dc43[_0x5b878c(0x21f)][_0x5b878c(0x208)]=_0x250633(_0x15dc43[_0x5b878c(0x21f)][_0x5b878c(0x208)]));if(_0x15dc43[_0x5b878c(0x1c6)])for(const _0x2b67a8 of _0x15dc43[_0x5b878c(0x1c6)]){_0x2b67a8['segment']&&(_0x2b67a8['segment']=_0x250633(_0x2b67a8[_0x5b878c(0x208)]));}_0x15dc43[_0x5b878c(0x1ec)]?.[_0x5b878c(0x208)]&&(_0x15dc43[_0x5b878c(0x1ec)][_0x5b878c(0x208)]=_0x250633(_0x15dc43['milestone']['segment']));if(_0x15dc43[_0x5b878c(0x206)])for(const _0x20e726 of _0x15dc43['steps']){if(_0x20e726[_0x5b878c(0x1fb)]==='decision_point'){const _0x11174b=_0x20e726;for(const _0x139594 of _0x11174b[_0x5b878c(0x20f)][_0x5b878c(0x216)]){_0x139594[_0x5b878c(0x208)]&&(_0x139594['segment']=_0x250633(_0x139594[_0x5b878c(0x208)]));}}else{if(_0x20e726[_0x5b878c(0x1fb)]===_0x5b878c(0x1b7)){const _0x3e60cb=_0x20e726;_0x3e60cb[_0x5b878c(0x20f)][_0x5b878c(0x24b)]?.[_0x5b878c(0x208)]&&(_0x3e60cb[_0x5b878c(0x20f)][_0x5b878c(0x24b)][_0x5b878c(0x208)]=_0x250633(_0x3e60cb[_0x5b878c(0x20f)][_0x5b878c(0x24b)][_0x5b878c(0x208)]));}}}}};if(_0x351ea2[_0x49ca66(0x1e5)])for(const _0x3222c3 of _0x351ea2[_0x49ca66(0x1e5)]){_0x3222c3[_0x49ca66(0x22b)]?.[_0x49ca66(0x208)]&&(_0x3222c3['goal'][_0x49ca66(0x208)]=_0x250633(_0x3222c3[_0x49ca66(0x22b)][_0x49ca66(0x208)])),_0x27d492(_0x3222c3['stages']);}_0x351ea2['stages']&&_0x27d492(_0x351ea2[_0x49ca66(0x1a9)]);if(_0x351ea2[_0x49ca66(0x1c0)])for(const _0x5d6eaf of _0x351ea2[_0x49ca66(0x1c0)]){_0x27d492(_0x5d6eaf[_0x49ca66(0x1a9)]);}}function collectActivationIdsFromJourney(_0x1200ff,_0x22d11e){const _0x4920f6=a147_0x3a14,_0x50e107=_0x332201=>{const _0x5c2533=a147_0x3a14;for(const _0x33cbef of _0x332201){if(_0x33cbef[_0x5c2533(0x206)])for(const _0x3d4e5d of _0x33cbef['steps']){if(_0x3d4e5d[_0x5c2533(0x1fb)]==='activation'){const _0x2ff2ef=_0x3d4e5d;_0x2ff2ef[_0x5c2533(0x20f)]['activation']&&/^\d+$/['test'](_0x2ff2ef[_0x5c2533(0x20f)][_0x5c2533(0x1a6)])&&_0x22d11e[_0x5c2533(0x195)](_0x2ff2ef[_0x5c2533(0x20f)][_0x5c2533(0x1a6)]);}}}};if(_0x1200ff[_0x4920f6(0x1e5)])for(const _0x4a04fa of _0x1200ff[_0x4920f6(0x1e5)]){_0x50e107(_0x4a04fa[_0x4920f6(0x1a9)]);}_0x1200ff[_0x4920f6(0x1a9)]&&_0x50e107(_0x1200ff[_0x4920f6(0x1a9)]);if(_0x1200ff[_0x4920f6(0x1c0)])for(const _0x571a40 of _0x1200ff[_0x4920f6(0x1c0)]){_0x50e107(_0x571a40[_0x4920f6(0x1a9)]);}}function replaceActivationIdsInJourney(_0x475001,_0x33dd1c){const _0x376325=a147_0x3a14,_0x568ce6=_0x59df81=>_0x33dd1c['get'](_0x59df81)||_0x59df81,_0x5af813=_0x4b28c1=>{const _0x48472e=a147_0x3a14;for(const _0x5dfceb of _0x4b28c1){if(_0x5dfceb['steps'])for(const _0x64b39f of _0x5dfceb['steps']){if(_0x64b39f['type']===_0x48472e(0x1a6)){const _0x1355a7=_0x64b39f;_0x1355a7[_0x48472e(0x20f)][_0x48472e(0x1a6)]&&(_0x1355a7[_0x48472e(0x20f)]['activation']=_0x568ce6(_0x1355a7[_0x48472e(0x20f)][_0x48472e(0x1a6)]));}}}};if(_0x475001[_0x376325(0x1e5)])for(const _0x4ec9b0 of _0x475001['journeys']){_0x5af813(_0x4ec9b0[_0x376325(0x1a9)]);}_0x475001['stages']&&_0x5af813(_0x475001[_0x376325(0x1a9)]);if(_0x475001[_0x376325(0x1c0)])for(const _0xd2e01a of _0x475001[_0x376325(0x1c0)]){_0x5af813(_0xd2e01a['stages']);}}function collectJumpTargetsFromJourney(_0x28aa44,_0x2c7160){const _0x3a9b10=a147_0x3a14,_0xf2ac45=new Set(),_0x43d162=_0x111481=>{const _0x20c713=a147_0x3a14;for(const _0x13313a of _0x111481){if(_0x13313a[_0x20c713(0x206)])for(const _0x2471de of _0x13313a[_0x20c713(0x206)]){if(_0x2471de['type']==='jump'){const _0x14370c=_0x2471de,_0xf3ffe3=_0x14370c['with']['target'];if(_0xf3ffe3[_0x20c713(0x237)]&&_0xf3ffe3[_0x20c713(0x1e3)]&&/^\d+$/['test'](_0xf3ffe3[_0x20c713(0x237)])&&/^\d+$/[_0x20c713(0x210)](_0xf3ffe3[_0x20c713(0x1e3)])){const _0xbe834b=_0xf3ffe3[_0x20c713(0x237)]+':'+_0xf3ffe3[_0x20c713(0x1e3)];!_0xf2ac45['has'](_0xbe834b)&&(_0xf2ac45[_0x20c713(0x195)](_0xbe834b),_0x2c7160['push']({'journeyId':_0xf3ffe3['journey'],'stageId':_0xf3ffe3[_0x20c713(0x1e3)]}));}}}}};if(_0x28aa44[_0x3a9b10(0x1e5)])for(const _0xcd88f9 of _0x28aa44['journeys']){_0x43d162(_0xcd88f9[_0x3a9b10(0x1a9)]);}_0x28aa44[_0x3a9b10(0x1a9)]&&_0x43d162(_0x28aa44[_0x3a9b10(0x1a9)]);if(_0x28aa44[_0x3a9b10(0x1c0)])for(const _0x186207 of _0x28aa44[_0x3a9b10(0x1c0)]){_0x43d162(_0x186207[_0x3a9b10(0x1a9)]);}}function replaceJumpTargetsInJourney(_0x616ca1,_0x4a0d8e){const _0x22fcdc=a147_0x3a14,_0x146b29=_0x1dcd92=>{const _0x3e7a91=a147_0x3a14;for(const _0x2075f3 of _0x1dcd92){if(_0x2075f3[_0x3e7a91(0x206)])for(const _0x5a6b28 of _0x2075f3[_0x3e7a91(0x206)]){if(_0x5a6b28[_0x3e7a91(0x1fb)]==='jump'){const _0xf4be15=_0x5a6b28,_0x2a22bc=_0xf4be15[_0x3e7a91(0x20f)]['target'],_0x3a5aed=_0x2a22bc[_0x3e7a91(0x237)]+':'+_0x2a22bc[_0x3e7a91(0x1e3)],_0x376d46=_0x4a0d8e[_0x3e7a91(0x232)](_0x3a5aed);_0x376d46&&(_0x2a22bc['journey']=_0x376d46[_0x3e7a91(0x242)],_0x2a22bc['stage']=_0x376d46[_0x3e7a91(0x1ba)]);}}}};if(_0x616ca1[_0x22fcdc(0x1e5)])for(const _0xf72cb6 of _0x616ca1[_0x22fcdc(0x1e5)]){_0x146b29(_0xf72cb6[_0x22fcdc(0x1a9)]);}_0x616ca1[_0x22fcdc(0x1a9)]&&_0x146b29(_0x616ca1[_0x22fcdc(0x1a9)]);if(_0x616ca1[_0x22fcdc(0x1c0)])for(const _0x323d10 of _0x616ca1['versions']){_0x146b29(_0x323d10['stages']);}}function generateReadableStepName(_0x9fe728,_0x4e1204){const _0x4e09dc=a147_0x3a14;if(_0x9fe728[_0x4e09dc(0x1a5)]&&_0x9fe728[_0x4e09dc(0x1a5)]!==_0x9fe728['type']){const _0x3ee81c=_0x9fe728[_0x4e09dc(0x1a5)]['trim']();if(_0x3ee81c&&/[a-z0-9\p{L}]/iu[_0x4e09dc(0x210)](_0x3ee81c))return _0x3ee81c;}const _0x3296ad=_0x9fe728[_0x4e09dc(0x1fb)][_0x4e09dc(0x247)]()[_0x4e09dc(0x1ad)](/step$/i,'');return _0x3296ad+'_'+(_0x4e1204+0x1);}function getStepNextRefs(_0x228eb9){const _0x4bb1a5=a147_0x3a14,_0xb4aac1=[];if(_0x228eb9[_0x4bb1a5(0x253)])_0xb4aac1[_0x4bb1a5(0x20c)](_0x228eb9['next']);if(_0x228eb9[_0x4bb1a5(0x216)])for(const _0x13f66b of _0x228eb9['branches']){if(_0x13f66b[_0x4bb1a5(0x253)])_0xb4aac1[_0x4bb1a5(0x20c)](_0x13f66b[_0x4bb1a5(0x253)]);}if(_0x228eb9[_0x4bb1a5(0x1ff)])for(const _0x210f57 of _0x228eb9[_0x4bb1a5(0x1ff)]){if(_0x210f57[_0x4bb1a5(0x253)])_0xb4aac1[_0x4bb1a5(0x20c)](_0x210f57[_0x4bb1a5(0x253)]);}if(_0x228eb9[_0x4bb1a5(0x1af)])for(const _0x5f5261 of _0x228eb9['conditions']){if(_0x5f5261[_0x4bb1a5(0x253)])_0xb4aac1['push'](_0x5f5261['next']);}return _0xb4aac1;}function parseJumpTargetDisplayName(_0x4f4a6c){const _0x1b7e99=a147_0x3a14,_0x45a149=_0x4f4a6c[_0x1b7e99(0x256)](/^(.+?)\s*\(([^/)]+)/);if(!_0x45a149)return undefined;const _0xabc774=_0x45a149[0x1][_0x1b7e99(0x1fd)](),_0x7e6b62=_0x45a149[0x2]['trim']();if(!_0xabc774||!_0x7e6b62)return undefined;return{'stageName':_0xabc774,'journeyName':_0x7e6b62};}function orderStepsFromRoot(_0x28c014,_0x1d5813){const _0x5cdfb4=a147_0x3a14,_0x30e151=Object[_0x5cdfb4(0x251)](_0x28c014);if(_0x30e151[_0x5cdfb4(0x1e2)]===0x0)return[];const _0x233389=new Set(_0x30e151[_0x5cdfb4(0x1ef)](([_0x34c533])=>_0x34c533)),_0x27bd75=new Set();for(const [,_0x3ca697]of _0x30e151){for(const _0xe964fd of getStepNextRefs(_0x3ca697)){if(_0x233389[_0x5cdfb4(0x21d)](_0xe964fd))_0x27bd75['add'](_0xe964fd);}}let _0x4fdc8d=_0x1d5813&&_0x233389[_0x5cdfb4(0x21d)](_0x1d5813)?_0x1d5813:undefined;if(!_0x4fdc8d){const _0x201b30=_0x30e151['filter'](([_0x5b1046])=>!_0x27bd75[_0x5cdfb4(0x21d)](_0x5b1046));_0x201b30[_0x5cdfb4(0x1e2)]>0x0?_0x4fdc8d=_0x201b30[0x0][0x0]:_0x4fdc8d=_0x30e151[0x0][0x0];}const _0x4fa739=[],_0x35f15e=new Set(),_0x5cdd58=[_0x4fdc8d];while(_0x5cdd58['length']>0x0){const _0x3f1a73=_0x5cdd58[_0x5cdfb4(0x207)]();if(_0x35f15e[_0x5cdfb4(0x21d)](_0x3f1a73))continue;_0x35f15e[_0x5cdfb4(0x195)](_0x3f1a73);const _0x546188=_0x28c014[_0x3f1a73];if(!_0x546188)continue;_0x4fa739[_0x5cdfb4(0x20c)]({'uuid':_0x3f1a73,'step':_0x546188});for(const _0x13a79b of getStepNextRefs(_0x546188)){_0x233389['has'](_0x13a79b)&&!_0x35f15e[_0x5cdfb4(0x21d)](_0x13a79b)&&_0x5cdd58['push'](_0x13a79b);}}for(const [_0x24e766,_0x54e1bf]of _0x30e151){!_0x35f15e[_0x5cdfb4(0x21d)](_0x24e766)&&_0x4fa739[_0x5cdfb4(0x20c)]({'uuid':_0x24e766,'step':_0x54e1bf});}return _0x4fa739;}function resolveStepReferences(_0x4a9d1d,_0x1265a8,_0x50087c,_0x50501f){const _0x2a97f9=a147_0x3a14;if(_0x4a9d1d[_0x2a97f9(0x1fb)]!==_0x2a97f9(0x1f5)){_0x4a9d1d['next']&&_0x50501f[_0x2a97f9(0x21d)](_0x4a9d1d[_0x2a97f9(0x253)])&&(_0x4a9d1d['next']=_0x50501f['get'](_0x4a9d1d['next']));const _0x4058ef=_0x1265a8+0x1;if(_0x4058ef<_0x50087c[_0x2a97f9(0x1e2)]){const _0x578b81=_0x50501f[_0x2a97f9(0x232)](_0x50087c[_0x4058ef][_0x2a97f9(0x1cb)]);_0x4a9d1d['next']===_0x578b81&&delete _0x4a9d1d[_0x2a97f9(0x253)];}}if(_0x4a9d1d['type']==='decision_point')for(const _0xfe17cc of _0x4a9d1d[_0x2a97f9(0x20f)]['branches']){_0xfe17cc['next']&&_0x50501f[_0x2a97f9(0x21d)](_0xfe17cc[_0x2a97f9(0x253)])&&(_0xfe17cc[_0x2a97f9(0x253)]=_0x50501f[_0x2a97f9(0x232)](_0xfe17cc['next']));}if(_0x4a9d1d[_0x2a97f9(0x1fb)]==='ab_test')for(const _0x1107bf of _0x4a9d1d[_0x2a97f9(0x20f)]['variants']){_0x1107bf['next']&&_0x50501f['has'](_0x1107bf[_0x2a97f9(0x253)])&&(_0x1107bf[_0x2a97f9(0x253)]=_0x50501f[_0x2a97f9(0x232)](_0x1107bf[_0x2a97f9(0x253)]));}if(_0x4a9d1d['type']===_0x2a97f9(0x1b7)&&_0x4a9d1d[_0x2a97f9(0x20f)][_0x2a97f9(0x24b)]){const _0x115692=_0x4a9d1d[_0x2a97f9(0x20f)][_0x2a97f9(0x24b)];_0x115692[_0x2a97f9(0x253)]&&_0x50501f[_0x2a97f9(0x21d)](_0x115692[_0x2a97f9(0x253)])&&(_0x115692['next']=_0x50501f['get'](_0x115692[_0x2a97f9(0x253)])),_0x115692['timeout']?.[_0x2a97f9(0x253)]&&_0x50501f[_0x2a97f9(0x21d)](_0x115692[_0x2a97f9(0x201)]['next'])&&(_0x115692[_0x2a97f9(0x201)][_0x2a97f9(0x253)]=_0x50501f['get'](_0x115692[_0x2a97f9(0x201)][_0x2a97f9(0x253)]));}}function convertApiStageToYaml(_0x527c53){const _0x27cfbe=a147_0x3a14,_0x1bb06c={'name':_0x527c53[_0x27cfbe(0x1a5)]};_0x527c53['id']&&(_0x1bb06c['id']=_0x527c53['id']);_0x527c53[_0x27cfbe(0x225)]&&(_0x1bb06c['description']=_0x527c53[_0x27cfbe(0x225)]);_0x527c53[_0x27cfbe(0x227)]&&(_0x1bb06c[_0x27cfbe(0x21f)]=convertApiCriteriaToYaml(_0x527c53[_0x27cfbe(0x227)]));_0x527c53[_0x27cfbe(0x1b9)]&&_0x527c53[_0x27cfbe(0x1b9)][_0x27cfbe(0x1e2)]>0x0&&(_0x1bb06c[_0x27cfbe(0x1c6)]=_0x527c53[_0x27cfbe(0x1b9)]['map'](convertApiCriteriaToYaml));_0x527c53[_0x27cfbe(0x1ec)]&&(_0x1bb06c[_0x27cfbe(0x1ec)]=convertApiCriteriaToYaml(_0x527c53['milestone']));if(_0x527c53['steps']&&Object[_0x27cfbe(0x1c7)](_0x527c53[_0x27cfbe(0x206)])[_0x27cfbe(0x1e2)]>0x0){const _0x22f910=orderStepsFromRoot(_0x527c53[_0x27cfbe(0x206)],_0x527c53['rootStep']),_0x44657c=new Map(),_0x321a83=new Set();for(let _0x2e7261=0x0;_0x2e7261<_0x22f910['length'];_0x2e7261++){const {uuid:_0x2a5ad5,step:_0x31bd8b}=_0x22f910[_0x2e7261];let _0xb8059c=generateReadableStepName(_0x31bd8b,_0x2e7261),_0x150173=_0xb8059c,_0x429da9=0x2;while(_0x321a83[_0x27cfbe(0x21d)](_0x150173)){_0x150173=_0xb8059c+'_'+_0x429da9,_0x429da9++;}_0x321a83['add'](_0x150173),_0x44657c[_0x27cfbe(0x1b8)](_0x2a5ad5,_0x150173);}_0x1bb06c['steps']=_0x22f910[_0x27cfbe(0x1ef)](({uuid:_0x15a0db,step:_0x2f239c},_0x33e328)=>{const _0x7b1ead=_0x27cfbe,_0x1e512b=convertApiStepToYaml(_0x2f239c,_0x44657c[_0x7b1ead(0x232)](_0x15a0db));return resolveStepReferences(_0x1e512b,_0x33e328,_0x22f910,_0x44657c),_0x1e512b;});}return _0x1bb06c;}function convertApiCriteriaToYaml(_0x737a9e){const _0x457a59=a147_0x3a14,_0xb7df49={'name':_0x737a9e['name'],'segment':_0x737a9e[_0x457a59(0x22e)]};_0x737a9e[_0x457a59(0x225)]&&(_0xb7df49['description']=_0x737a9e[_0x457a59(0x225)]);if(_0x737a9e['target']){let _0x128eac=_0x737a9e[_0x457a59(0x215)][_0x457a59(0x22a)],_0x3d2cda=_0x737a9e[_0x457a59(0x215)][_0x457a59(0x219)];if(_0x737a9e['target']['journeyName']){const _0x25f1a2=parseJumpTargetDisplayName(_0x737a9e[_0x457a59(0x215)][_0x457a59(0x242)]);_0x25f1a2&&(_0x3d2cda=_0x25f1a2[_0x457a59(0x1ba)],_0x128eac=_0x25f1a2[_0x457a59(0x242)]);}_0xb7df49['target']={'journey':_0x128eac,'stage':_0x3d2cda},_0x737a9e[_0x457a59(0x215)][_0x457a59(0x1bd)]&&(_0xb7df49['target'][_0x457a59(0x223)]=_0x737a9e[_0x457a59(0x215)][_0x457a59(0x1bd)]);}return _0xb7df49;}function convertApiStepToYaml(_0x48d1b7,_0x24d189){const _0x31ef26=a147_0x3a14;switch(_0x48d1b7[_0x31ef26(0x1fb)]){case _0x31ef26(0x1e4):{const _0x1c75ac={};if(_0x48d1b7['waitStepType']===_0x31ef26(0x214)&&_0x48d1b7[_0x31ef26(0x231)]!==undefined)_0x1c75ac[_0x31ef26(0x1eb)]=_0x48d1b7[_0x31ef26(0x231)],_0x1c75ac[_0x31ef26(0x222)]=_0x48d1b7[_0x31ef26(0x1d0)];else{if(_0x48d1b7['waitStepType']==='Date'&&_0x48d1b7[_0x31ef26(0x194)])_0x1c75ac[_0x31ef26(0x218)]=_0x48d1b7[_0x31ef26(0x194)];else{if(_0x48d1b7[_0x31ef26(0x22c)]===_0x31ef26(0x24d)&&_0x48d1b7['daysOfWeek'])_0x1c75ac['days_of_week']=_0x48d1b7[_0x31ef26(0x24f)];else{if(_0x48d1b7[_0x31ef26(0x22c)]===_0x31ef26(0x1e6)){if(_0x48d1b7['conditions']&&_0x48d1b7[_0x31ef26(0x1af)][_0x31ef26(0x1e2)]>0x0){const _0x21e6db=_0x48d1b7['conditions'][_0x31ef26(0x23a)](_0x1c9441=>!_0x1c9441[_0x31ef26(0x240)]),_0x49c646=_0x48d1b7['conditions']['find'](_0x20ac2c=>_0x20ac2c['timedOutPath']);_0x21e6db?.[_0x31ef26(0x22e)]&&(_0x1c75ac['condition']={'segment':_0x21e6db[_0x31ef26(0x22e)],..._0x21e6db[_0x31ef26(0x253)]?{'next':_0x21e6db['next']}:{}},_0x49c646&&_0x49c646[_0x31ef26(0x1ee)]!==undefined&&_0x49c646[_0x31ef26(0x222)]&&(_0x1c75ac[_0x31ef26(0x24b)][_0x31ef26(0x201)]={'duration':_0x49c646[_0x31ef26(0x1ee)],'unit':_0x49c646[_0x31ef26(0x222)],..._0x49c646[_0x31ef26(0x253)]?{'next':_0x49c646[_0x31ef26(0x253)]}:{}}));}else _0x48d1b7['conditionSegmentId']&&(_0x1c75ac[_0x31ef26(0x24b)]={'segment':_0x48d1b7['conditionSegmentId']},_0x48d1b7['conditionTimeoutDuration']!==undefined&&_0x48d1b7[_0x31ef26(0x1de)]&&(_0x1c75ac[_0x31ef26(0x24b)][_0x31ef26(0x201)]={'duration':_0x48d1b7[_0x31ef26(0x1db)],'unit':_0x48d1b7[_0x31ef26(0x1de)]}));}}}}const _0x5829bd={'type':_0x31ef26(0x1b7),'name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{},'with':_0x1c75ac};return _0x5829bd;}case _0x31ef26(0x21c):{const _0x4f7601={'type':'activation','name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7['next']}:{},'with':{'activation':_0x48d1b7[_0x31ef26(0x1bb)]||''}};return _0x4f7601;}case _0x31ef26(0x235):{const _0x451e82={'type':_0x31ef26(0x255),'name':_0x24d189,..._0x48d1b7['next']?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{},'with':{'branches':(_0x48d1b7[_0x31ef26(0x216)]||[])[_0x31ef26(0x1ef)](_0x162d25=>({'name':_0x162d25[_0x31ef26(0x1a5)],'segment':_0x162d25['segmentId'],'excluded':_0x162d25[_0x31ef26(0x204)],..._0x162d25[_0x31ef26(0x253)]?{'next':_0x162d25[_0x31ef26(0x253)]}:{}}))}};return _0x451e82;}case _0x31ef26(0x1bc):case _0x31ef26(0x1d7):case'Variant':{const _0x591756=_0x48d1b7[_0x31ef26(0x1ff)]||(_0x48d1b7[_0x31ef26(0x216)]||[])['map'](_0x4d1d82=>({'name':_0x4d1d82[_0x31ef26(0x1a5)],'percentage':0x0,'next':_0x4d1d82[_0x31ef26(0x253)]})),_0x428def={'type':_0x31ef26(0x1c3),'name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7['next']}:{},'with':{'customized_split':_0x48d1b7['customizedSplit'],'unique_id':_0x48d1b7[_0x31ef26(0x196)],'variants':_0x591756['map'](_0x4f0047=>({'name':_0x4f0047[_0x31ef26(0x1a5)],'percentage':_0x4f0047[_0x31ef26(0x1e7)],..._0x4f0047[_0x31ef26(0x253)]?{'next':_0x4f0047[_0x31ef26(0x253)]}:{}}))}};return _0x428def;}case'Merge':{const _0x1106eb={'type':_0x31ef26(0x24e),'name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{}};return _0x1106eb;}case _0x31ef26(0x1ac):{let _0x4fbc33='',_0x4da378='',_0x4e74d9;if(_0x48d1b7[_0x31ef26(0x215)]){_0x4fbc33=_0x48d1b7[_0x31ef26(0x215)][_0x31ef26(0x22a)],_0x4da378=_0x48d1b7[_0x31ef26(0x215)]['journeyStageId'],_0x4e74d9=_0x48d1b7[_0x31ef26(0x215)][_0x31ef26(0x1bd)];if(_0x48d1b7['target'][_0x31ef26(0x242)]){const _0x1c54f5=parseJumpTargetDisplayName(_0x48d1b7[_0x31ef26(0x215)]['journeyName']);_0x1c54f5&&(_0x4da378=_0x1c54f5['stageName'],_0x4fbc33=_0x1c54f5[_0x31ef26(0x242)]);}}const _0x4892e1={'type':'jump','name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{},'with':{'target':{'journey':_0x4fbc33,'stage':_0x4da378,..._0x4e74d9?{'bundle_id':_0x4e74d9}:{}}}};return _0x4892e1;}case'End':{const _0x4ad49f={'type':_0x31ef26(0x1f5),'name':_0x24d189};return _0x4ad49f;}default:{const _0x3f45ad={'type':_0x31ef26(0x1f5),'name':_0x24d189};return _0x3f45ad;}}}export async function journeyDefToRequest(_0x36e74a,_0x11024e,_0x3a9ea3){const _0x2b9442=a147_0x3a14,_0xf784ab=_0x36e74a[_0x2b9442(0x1a9)]||getActiveStages(_0x36e74a),_0x315a14=isJourneysArrayMode(_0x36e74a)||isMultiVersionMode(_0x36e74a)?getLatestJourneyEntry(_0x36e74a):undefined,_0x2fcd60=_0x315a14?.['version']??_0x36e74a[_0x2b9442(0x1a5)],_0x5b138a=_0x36e74a[_0x2b9442(0x20d)]||{},_0x30097e=_0x36e74a[_0x2b9442(0x1b6)]||{},_0x348aaa={'type':_0x2b9442(0x237),'attributes':{'name':_0x2fcd60,'audienceId':_0x11024e,'journeyStages':await Promise[_0x2b9442(0x1c1)](_0xf784ab['map'](_0x12f895=>convertYamlStageToApi(_0x12f895,_0x3a9ea3,_0x5b138a,_0x30097e)))}},_0x55b6ea=_0x315a14?.['id']??_0x36e74a['id'];_0x55b6ea&&(_0x348aaa['id']=_0x55b6ea);_0x36e74a['description']&&(_0x348aaa['attributes'][_0x2b9442(0x225)]=_0x36e74a[_0x2b9442(0x225)]);const _0x1b0ed2=getEffectiveGoal(_0x36e74a);_0x1b0ed2&&(_0x348aaa[_0x2b9442(0x202)][_0x2b9442(0x22b)]=await convertYamlCriteriaToApi(_0x1b0ed2,_0x3a9ea3,_0x5b138a));const _0x304192=getEffectiveReentry(_0x36e74a);return _0x304192&&(_0x348aaa[_0x2b9442(0x202)][_0x2b9442(0x1f8)]=_0x304192,_0x348aaa[_0x2b9442(0x202)][_0x2b9442(0x23f)]=_0x304192!==_0x2b9442(0x221)),_0x36e74a[_0x2b9442(0x19f)]&&(_0x348aaa[_0x2b9442(0x1d9)]={'parentFolder':{'data':{'id':_0x36e74a['folder_id'],'type':_0x2b9442(0x1f9)}}}),_0x348aaa;}async function convertYamlStageToApi(_0x5b9619,_0xe93332,_0x4a00dd={},_0x1acd12={}){const _0x3163b2=a147_0x3a14,_0x413658={'name':_0x5b9619[_0x3163b2(0x1a5)]};_0x5b9619['id']&&(_0x413658['id']=_0x5b9619['id']);_0x5b9619[_0x3163b2(0x225)]&&(_0x413658[_0x3163b2(0x225)]=_0x5b9619[_0x3163b2(0x225)]);_0x5b9619[_0x3163b2(0x21f)]&&(_0x413658[_0x3163b2(0x227)]=await convertYamlCriteriaToApi(_0x5b9619['entry_criteria'],_0xe93332,_0x4a00dd));_0x5b9619[_0x3163b2(0x1c6)]&&_0x5b9619[_0x3163b2(0x1c6)]['length']>0x0&&(_0x413658[_0x3163b2(0x1b9)]=await Promise[_0x3163b2(0x1c1)](_0x5b9619[_0x3163b2(0x1c6)]['map'](_0x421553=>convertYamlCriteriaToApi(_0x421553,_0xe93332,_0x4a00dd))));_0x5b9619['milestone']&&(_0x413658['milestone']=await convertYamlCriteriaToApi(_0x5b9619[_0x3163b2(0x1ec)],_0xe93332,_0x4a00dd));if(_0x5b9619[_0x3163b2(0x206)]&&_0x5b9619[_0x3163b2(0x206)]['length']>0x0){const _0x5d3e35={},_0x275a54=_0x5b9619['steps'][_0x3163b2(0x1ef)]((_0x440653,_0x42e842)=>{const _0x2cd20d=_0x3163b2,_0x26e410=_0x440653[_0x2cd20d(0x1cb)]||generateUUID(),_0x1a37c4=_0x440653[_0x2cd20d(0x1a5)]||_0x440653['type']+'_'+_0x42e842;return _0x5d3e35[_0x1a37c4]=_0x26e410,{..._0x440653,'name':_0x1a37c4};});_0x413658['rootStep']=_0x5d3e35[_0x275a54[0x0][_0x3163b2(0x1a5)]],_0x413658['steps']={};for(let _0x198f43=0x0;_0x198f43<_0x275a54[_0x3163b2(0x1e2)];_0x198f43++){const _0x1283ec=_0x275a54[_0x198f43],_0xf2cb3f=_0x5d3e35[_0x1283ec['name']],_0x26fb03=!_0x1283ec['next']&&_0x198f43<_0x275a54['length']-0x1&&_0x1283ec[_0x3163b2(0x1fb)]!==_0x3163b2(0x1f5)?_0x275a54[_0x198f43+0x1][_0x3163b2(0x1a5)]:_0x1283ec[_0x3163b2(0x253)],_0x4b904f=_0x26fb03!==_0x1283ec[_0x3163b2(0x253)]?{..._0x1283ec,'next':_0x26fb03}:_0x1283ec;_0x413658[_0x3163b2(0x206)][_0xf2cb3f]=await convertYamlStepToApi(_0x4b904f,_0xe93332,_0x4a00dd,_0x5d3e35,_0x1acd12);}}else _0x5b9619[_0x3163b2(0x1be)]&&(_0x413658['rootStep']=_0x5b9619['root_step']);return _0x413658;}async function convertYamlCriteriaToApi(_0x34c517,_0x15637f,_0x59b345={}){const _0x247652=a147_0x3a14;let _0x565010=_0x34c517[_0x247652(0x208)];if(_0x565010&&!/^\d+$/[_0x247652(0x210)](_0x565010)){const _0x171629=parseSegmentRef(_0x565010);if(_0x171629['type']===_0x247652(0x1c2))_0x15637f?.[_0x247652(0x198)]&&(_0x565010=await _0x15637f[_0x247652(0x198)](_0x171629['name']));else{if(_0x171629[_0x247652(0x1fb)]==='embedded'&&_0x59b345[_0x171629[_0x247652(0x1a5)]])_0x15637f?.['resolveEmbeddedSegmentId']&&(_0x565010=await _0x15637f[_0x247652(0x220)](_0x171629[_0x247652(0x1a5)],_0x59b345[_0x171629[_0x247652(0x1a5)]]));else _0x15637f?.[_0x247652(0x198)]&&(_0x565010=await _0x15637f[_0x247652(0x198)](_0x171629[_0x247652(0x1a5)]));}}const _0xe28c84={'name':_0x34c517['name'],'segmentId':_0x565010};_0x34c517[_0x247652(0x225)]&&(_0xe28c84[_0x247652(0x225)]=_0x34c517[_0x247652(0x225)]);if(_0x34c517['target']){const _0x288d90=_0x34c517['target']['journey'],_0x136d29=_0x34c517['target'][_0x247652(0x1e3)];let _0x545acf=_0x34c517[_0x247652(0x215)][_0x247652(0x237)];_0x15637f?.[_0x247652(0x19c)]&&!/^\d+$/[_0x247652(0x210)](_0x545acf)&&(_0x545acf=await _0x15637f[_0x247652(0x19c)](_0x545acf));let _0x37b9a7=_0x34c517[_0x247652(0x215)][_0x247652(0x1e3)];_0x15637f?.[_0x247652(0x197)]&&!/^\d+$/[_0x247652(0x210)](_0x37b9a7)&&(_0x37b9a7=await _0x15637f[_0x247652(0x197)](_0x545acf,_0x37b9a7));const _0xe2b486=!/^\d+$/['test'](_0x288d90)&&!isLocalJourneyRef(_0x288d90)?formatApiJourneyName(_0x288d90,_0x136d29):undefined;_0xe28c84[_0x247652(0x215)]={'journeyId':_0x545acf,'journeyStageId':_0x37b9a7,'journeyName':_0xe2b486,'confirmed':!![]},_0x34c517[_0x247652(0x215)][_0x247652(0x223)]&&(_0xe28c84[_0x247652(0x215)][_0x247652(0x1bd)]=_0x34c517[_0x247652(0x215)]['bundle_id']);}return _0xe28c84;}async function convertYamlStepToApi(_0x18609d,_0x3cdcb2,_0x32ec3c={},_0x1a70c4={},_0x4d6dad={}){const _0x3993c9=a147_0x3a14,_0x2979a8=async _0x76a450=>{const _0x1c5707=a147_0x3a14;if(/^\d+$/['test'](_0x76a450))return _0x76a450;const _0x1be3fb=parseSegmentRef(_0x76a450);if(_0x1be3fb['type']==='ref'){if(_0x3cdcb2?.[_0x1c5707(0x198)])return await _0x3cdcb2[_0x1c5707(0x198)](_0x1be3fb[_0x1c5707(0x1a5)]);}else{if(_0x1be3fb['type']===_0x1c5707(0x1a4)&&_0x32ec3c[_0x1be3fb[_0x1c5707(0x1a5)]]){if(_0x3cdcb2?.[_0x1c5707(0x220)])return await _0x3cdcb2['resolveEmbeddedSegmentId'](_0x1be3fb[_0x1c5707(0x1a5)],_0x32ec3c[_0x1be3fb[_0x1c5707(0x1a5)]]);}else{if(_0x3cdcb2?.[_0x1c5707(0x198)])return await _0x3cdcb2[_0x1c5707(0x198)](_0x1be3fb[_0x1c5707(0x1a5)]);}}return _0x76a450;},_0x254c21=async _0x382d37=>{const _0x5be8d9=a147_0x3a14;if(/^\d+$/[_0x5be8d9(0x210)](_0x382d37))return _0x382d37;const _0x8ce631=parseSegmentRef(_0x382d37);if(_0x8ce631[_0x5be8d9(0x1fb)]===_0x5be8d9(0x1c2)){if(_0x3cdcb2?.['resolveActivationId'])return await _0x3cdcb2['resolveActivationId'](_0x8ce631['name']);return _0x8ce631[_0x5be8d9(0x1a5)];}else{if(_0x8ce631['type']==='embedded'&&_0x4d6dad[_0x8ce631[_0x5be8d9(0x1a5)]]){if(_0x3cdcb2?.[_0x5be8d9(0x1a2)])return await _0x3cdcb2[_0x5be8d9(0x1a2)](_0x8ce631['name'],_0x4d6dad[_0x8ce631[_0x5be8d9(0x1a5)]]);if(_0x3cdcb2?.[_0x5be8d9(0x250)])return await _0x3cdcb2['resolveActivationId'](_0x8ce631[_0x5be8d9(0x1a5)]);}else{if(_0x3cdcb2?.[_0x5be8d9(0x250)])return await _0x3cdcb2[_0x5be8d9(0x250)](_0x8ce631[_0x5be8d9(0x1a5)]);}}return _0x382d37;},_0x4158ca=_0xa5604a=>{const _0x476c43=a147_0x3a14;if(!_0xa5604a)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x476c43(0x210)](_0xa5604a))return _0xa5604a;return _0x1a70c4[_0xa5604a]||_0xa5604a;};switch(_0x18609d['type']){case _0x3993c9(0x1b7):{const _0x400cf2=_0x18609d,_0x5056d9=_0x400cf2[_0x3993c9(0x20f)],_0x5cbf0f={'type':_0x3993c9(0x1e4),'name':_0x400cf2[_0x3993c9(0x1a5)],'next':_0x4158ca(_0x400cf2[_0x3993c9(0x253)])};if(_0x5056d9['duration']!==undefined&&_0x5056d9['unit'])_0x5cbf0f[_0x3993c9(0x22c)]='Duration',_0x5cbf0f['waitStep']=_0x5056d9[_0x3993c9(0x1eb)],_0x5cbf0f[_0x3993c9(0x1d0)]=normalizeWaitUnit(_0x5056d9[_0x3993c9(0x222)]);else{if(_0x5056d9[_0x3993c9(0x218)])_0x5cbf0f['waitStepType']=_0x3993c9(0x24a),_0x5cbf0f[_0x3993c9(0x194)]=_0x5056d9['wait_until'];else{if(_0x5056d9[_0x3993c9(0x1f2)])_0x5cbf0f[_0x3993c9(0x22c)]='DaysOfTheWeek',_0x5cbf0f[_0x3993c9(0x24f)]=_0x5056d9[_0x3993c9(0x1f2)];else{if(_0x5056d9[_0x3993c9(0x24b)]){_0x5cbf0f[_0x3993c9(0x22c)]=_0x3993c9(0x1e6);const _0x17ea8b=await _0x2979a8(_0x5056d9['condition'][_0x3993c9(0x208)]),_0x3b02d9=_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)]?.['next']!==undefined;if(_0x3b02d9){const _0x426091=[];_0x426091[_0x3993c9(0x20c)]({'id':generateUUID(),'segmentId':_0x17ea8b,'timedOutPath':![],'name':_0x3993c9(0x1a8),'next':_0x4158ca(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x253)]??_0x400cf2[_0x3993c9(0x253)])});if(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)]){const _0x19dae0=_0x5056d9[_0x3993c9(0x24b)]['timeout'][_0x3993c9(0x1eb)],_0x1ac83e=normalizeWaitUnit(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)]['unit']);_0x426091[_0x3993c9(0x20c)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x3993c9(0x1d3)+_0x19dae0+'\x20'+_0x1ac83e,'moveAfter':_0x19dae0,'unit':_0x1ac83e,'next':_0x4158ca(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)][_0x3993c9(0x253)])});}_0x5cbf0f[_0x3993c9(0x1af)]=_0x426091,delete _0x5cbf0f[_0x3993c9(0x253)];}else _0x5cbf0f[_0x3993c9(0x243)]=_0x17ea8b,_0x5056d9['condition']['timeout']&&(_0x5cbf0f[_0x3993c9(0x1db)]=_0x5056d9['condition'][_0x3993c9(0x201)][_0x3993c9(0x1eb)],_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)][_0x3993c9(0x222)]&&(_0x5cbf0f[_0x3993c9(0x1de)]=normalizeWaitUnit(_0x5056d9[_0x3993c9(0x24b)]['timeout'][_0x3993c9(0x222)])));}}}}return _0x5cbf0f;}case _0x3993c9(0x1a6):{const _0x177ab0=_0x18609d,_0x34551c=_0x177ab0[_0x3993c9(0x20f)][_0x3993c9(0x1a6)],_0x33cfbc=await _0x254c21(_0x34551c);return{'type':_0x3993c9(0x21c),'name':_0x177ab0[_0x3993c9(0x1a5)],'journeyActivationStepId':_0x33cfbc,'next':_0x4158ca(_0x177ab0[_0x3993c9(0x253)])};}case _0x3993c9(0x255):{const _0x17191b=_0x18609d,_0x5e2288=_0x17191b[_0x3993c9(0x20f)]['branches'];return{'type':'DecisionPoint','name':_0x17191b[_0x3993c9(0x1a5)],'branches':await Promise[_0x3993c9(0x1c1)](_0x5e2288[_0x3993c9(0x1ef)](async _0x4428b2=>{const _0x200b53=_0x3993c9;let _0x2d03c6='';if(!_0x4428b2[_0x200b53(0x19b)]){const _0x5931e6=_0x4428b2['segment']||_0x4428b2[_0x200b53(0x1a1)]||'';_0x2d03c6=_0x5931e6?await _0x2979a8(_0x5931e6):'';}return{'id':crypto[_0x200b53(0x1f6)](),'name':_0x4428b2['name'],'description':null,'segmentId':_0x2d03c6,'excludedPath':_0x4428b2[_0x200b53(0x19b)]??![],'next':_0x4158ca(_0x4428b2[_0x200b53(0x253)])};})),'next':_0x4158ca(_0x17191b[_0x3993c9(0x253)])};}case _0x3993c9(0x1c3):{const _0x44b6e3=_0x18609d,_0x25cf59=_0x44b6e3[_0x3993c9(0x20f)];return{'type':'ABTest','name':_0x44b6e3['name'],'customizedSplit':_0x25cf59[_0x3993c9(0x22f)],'uniqueId':_0x25cf59[_0x3993c9(0x199)],'variants':_0x25cf59[_0x3993c9(0x1ff)][_0x3993c9(0x1ef)](_0x51ba17=>({'id':_0x51ba17['id']||generateUUID(),'name':_0x51ba17[_0x3993c9(0x1a5)],'percentage':_0x51ba17['percentage'],'next':_0x4158ca(_0x51ba17[_0x3993c9(0x253)])})),'next':_0x4158ca(_0x44b6e3['next'])};}case _0x3993c9(0x24e):return{'type':'Merge','name':_0x18609d[_0x3993c9(0x1a5)],'next':_0x4158ca(_0x18609d[_0x3993c9(0x253)])};case _0x3993c9(0x20a):{const _0x389220=_0x18609d,_0x46db92=_0x389220[_0x3993c9(0x20f)]['target'],_0x918cc0=_0x46db92[_0x3993c9(0x237)],_0x10edaa=_0x46db92[_0x3993c9(0x1e3)];let _0x3b9cfa=_0x46db92[_0x3993c9(0x237)];_0x3cdcb2?.['resolveJourneyId']&&!/^\d+$/['test'](_0x3b9cfa)&&(_0x3b9cfa=await _0x3cdcb2[_0x3993c9(0x19c)](_0x3b9cfa));let _0x58b203=_0x46db92['stage'];_0x3cdcb2?.[_0x3993c9(0x197)]&&!/^\d+$/[_0x3993c9(0x210)](_0x58b203)&&(_0x58b203=await _0x3cdcb2['resolveStageId'](_0x3b9cfa,_0x58b203));const _0x4a1aad=!/^\d+$/[_0x3993c9(0x210)](_0x918cc0)&&!isLocalJourneyRef(_0x918cc0)?formatApiJourneyName(_0x918cc0,_0x10edaa):undefined;return{'type':_0x3993c9(0x1ac),'name':_0x389220[_0x3993c9(0x1a5)],'target':{'journeyId':_0x3b9cfa,'journeyStageId':_0x58b203,'journeyBundleId':_0x46db92[_0x3993c9(0x223)],'journeyName':_0x4a1aad,'confirmed':!![]},'next':_0x4158ca(_0x389220[_0x3993c9(0x253)])};}case _0x3993c9(0x1f5):return{'type':_0x3993c9(0x205),'name':_0x18609d[_0x3993c9(0x1a5)]};default:{const _0x2b39fc=_0x18609d;return{'type':'End','name':_0x2b39fc[_0x3993c9(0x1a5)]};}}}export function toYamlString(_0xa3190){const _0x2111af=a147_0x3a14,_0x3ed2b0=stripInternalFields(_0xa3190),_0x3be74e=a147_0x327dd2[_0x2111af(0x239)](_0x3ed2b0,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x2111af(0x1d1)}),_0x29a113=[_0x2111af(0x252),'activations:',_0x2111af(0x1ce),_0x2111af(0x248),_0x2111af(0x23d),'stages:','versions:'];let _0x1166ed=_0x3be74e;for(const _0x4471cb of _0x29a113){_0x1166ed=_0x1166ed[_0x2111af(0x1ad)](new RegExp('^('+_0x4471cb+')','m'),(_0x1c5fba,_0x27fba8,_0x5d4ff5)=>{if(_0x5d4ff5===0x0||_0x1166ed[_0x5d4ff5-0x1]==='\x0a'&&_0x1166ed[_0x5d4ff5-0x2]==='\x0a')return _0x27fba8;return'\x0a'+_0x27fba8;});}return _0x1166ed;}function stripInternalFields(_0x56d6f8){const _0x51ed1f=a147_0x3a14,{id:_0x39471c,folder_id:_0x2b15d1,bundle_id:_0x48c497,bundle_name:_0x22d7fe,version:_0x4f23b0,allow_reentry:_0x170995,..._0x517586}=_0x56d6f8;return _0x517586[_0x51ed1f(0x1e5)]&&(_0x517586['journeys']=_0x517586['journeys'][_0x51ed1f(0x1ef)](_0x3d8371=>{const _0x4c80cb=_0x51ed1f,{id:_0x580e55,..._0x10afc7}=_0x3d8371;return{..._0x10afc7,'stages':_0x10afc7['stages'][_0x4c80cb(0x1ef)](stripStageInternalFields),..._0x3d8371[_0x4c80cb(0x1dd)]===!![]?{'latest':!![]}:{},..._0x517586[_0x4c80cb(0x1e5)]['length']===0x1&&_0x10afc7[_0x4c80cb(0x226)]==='v1'?{'version':undefined}:{}};})),_0x517586[_0x51ed1f(0x1a9)]&&(_0x517586[_0x51ed1f(0x1a9)]=_0x517586[_0x51ed1f(0x1a9)][_0x51ed1f(0x1ef)](stripStageInternalFields)),_0x517586['versions']&&(_0x517586[_0x51ed1f(0x1c0)]=_0x517586[_0x51ed1f(0x1c0)]['map'](_0xcbc584=>{const _0x3ccf46=_0x51ed1f,{id:_0x237546,..._0x584504}=_0xcbc584;return{..._0x584504,'stages':_0x584504['stages'][_0x3ccf46(0x1ef)](stripStageInternalFields),..._0xcbc584[_0x3ccf46(0x1dd)]===!![]?{'latest':!![]}:{}};})),_0x517586;}function stripStageInternalFields(_0x50a488){const {id:_0x1be010,..._0x3434be}=_0x50a488;return _0x3434be;}export function parseYamlString(_0x49b1fd){return safeParseYaml(_0x49b1fd,JourneyDefSchema);}export function isJourneyDef(_0x2bc9bb){const _0x4f856a=a147_0x3a14;return typeof _0x2bc9bb==='object'&&_0x2bc9bb!==null&&_0x4f856a(0x1fb)in _0x2bc9bb&&_0x2bc9bb['type']===_0x4f856a(0x237);}export function generateTemplate(_0x1a65e8,_0x1d8967){const _0xda4d16=a147_0x3a14,_0x1f973f={'type':_0xda4d16(0x237),'name':_0x1a65e8,'description':'Journey\x20description','reentry':_0xda4d16(0x221),'goal':{'name':'Goal\x20Achieved','segment':'goal-segment'},'stages':[{'name':_0xda4d16(0x1c5),'description':_0xda4d16(0x1df),'entry_criteria':{'name':_0xda4d16(0x1d5),'segment':_0x1d8967},'steps':[{'type':_0xda4d16(0x1b7),'name':_0xda4d16(0x21b),'with':{'duration':0x1,'unit':_0xda4d16(0x1ae)}},{'type':_0xda4d16(0x1a6),'name':_0xda4d16(0x1da),'with':{'activation':_0xda4d16(0x23b)}},{'type':_0xda4d16(0x1f5),'name':_0xda4d16(0x1c4)}]}]};return toYamlString(_0x1f973f);}function generateUUID(){const _0x13e520=a147_0x3a14;return crypto[_0x13e520(0x1f6)]();}export const SEGMENT_REF_PREFIX=a147_0x4d9c99(0x24c);export function parseSegmentRef(_0x7cb59d){const _0x3c44bb=a147_0x4d9c99;if(_0x7cb59d[_0x3c44bb(0x217)](SEGMENT_REF_PREFIX))return{'type':_0x3c44bb(0x1c2),'name':_0x7cb59d['slice'](SEGMENT_REF_PREFIX[_0x3c44bb(0x1e2)])};if(/^\d+$/[_0x3c44bb(0x210)](_0x7cb59d))return{'type':'id','name':_0x7cb59d};return{'type':_0x3c44bb(0x1a4),'name':_0x7cb59d};}export function makeSegmentRef(_0x3c3e54){return''+SEGMENT_REF_PREFIX+_0x3c3e54;}export function isExternalSegmentRef(_0x2b9ddb){const _0x4b9286=a147_0x4d9c99;return _0x2b9ddb[_0x4b9286(0x217)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x2f2fc7){const _0x35d137=a147_0x4d9c99;return!!(_0x2f2fc7[_0x35d137(0x1e5)]&&_0x2f2fc7[_0x35d137(0x1e5)][_0x35d137(0x1e2)]>0x0);}export function isMultiVersionMode(_0x4e75d0){const _0x48459c=a147_0x4d9c99;return!!(_0x4e75d0['versions']&&_0x4e75d0[_0x48459c(0x1c0)][_0x48459c(0x1e2)]>0x0);}export function isSingleVersionMode(_0x3fb2f5){const _0xd52df6=a147_0x4d9c99;return!!(_0x3fb2f5['stages']&&_0x3fb2f5[_0xd52df6(0x1a9)]['length']>0x0);}export function hasMultipleVersions(_0x402313){const _0x2c4b19=a147_0x4d9c99;if(isJourneysArrayMode(_0x402313))return(_0x402313['journeys']?.[_0x2c4b19(0x1e2)]||0x0)>0x1;if(isMultiVersionMode(_0x402313))return(_0x402313['versions']?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x24a4e0){const _0x15865d=a147_0x4d9c99;if(isJourneysArrayMode(_0x24a4e0))return _0x24a4e0;if(isSingleVersionMode(_0x24a4e0)){const {stages:_0x572561,id:_0x2d0b25,version:_0x92c3b1,version_number:_0x44ec48,..._0x4c08af}=_0x24a4e0;return{..._0x4c08af,'journeys':[{'version':_0x92c3b1||'v1','stages':_0x572561||[],'id':_0x2d0b25,'version_number':_0x44ec48}]};}if(isMultiVersionMode(_0x24a4e0)){const {versions:_0x27b10,..._0xa26995}=_0x24a4e0;return{..._0xa26995,'journeys':(_0x27b10||[])['map'](_0x47be59=>({'version':_0x47be59['name'],'state':_0x47be59[_0x15865d(0x1cf)],'latest':_0x47be59['latest'],'stages':_0x47be59[_0x15865d(0x1a9)],'id':_0x47be59['id'],'version_number':_0x47be59['version_number']}))};}return _0x24a4e0;}export function normalizeJourneyDef(_0x49dc4c,_0x5a369f){const _0x38d313=a147_0x4d9c99,_0xb3b7c5=normalizeToJourneysFormat(_0x49dc4c),_0x1710ab=_0x5a369f?.[_0x38d313(0x20d)]?Object[_0x38d313(0x1c7)](_0x5a369f[_0x38d313(0x20d)]):undefined,_0x1bd692=_0x5a369f?.[_0x38d313(0x1b6)]?Object[_0x38d313(0x1c7)](_0x5a369f[_0x38d313(0x1b6)]):undefined;return{'type':_0x38d313(0x237),'name':_0xb3b7c5['name'],..._0xb3b7c5[_0x38d313(0x225)]!==undefined&&{'description':_0xb3b7c5['description']},..._0xb3b7c5[_0x38d313(0x22b)]&&{'goal':normalizeJourneyCriteria(_0xb3b7c5[_0x38d313(0x22b)])},..._0xb3b7c5['reentry']!==undefined&&{'reentry':_0xb3b7c5[_0x38d313(0x1e9)]},..._0xb3b7c5[_0x38d313(0x20d)]&&{'segments':normalizeEmbeddedSegments(_0xb3b7c5[_0x38d313(0x20d)],_0x1710ab)},..._0xb3b7c5[_0x38d313(0x1b6)]&&{'activations':normalizeEmbeddedActivations(_0xb3b7c5['activations'],_0x1bd692)},..._0xb3b7c5[_0x38d313(0x1e5)]&&{'journeys':_0xb3b7c5[_0x38d313(0x1e5)][_0x38d313(0x1ef)](_0x114b63=>normalizeJourneyEntry(_0x114b63,_0xb3b7c5[_0x38d313(0x1e5)][_0x38d313(0x1e2)]===0x1))}};}function normalizeJourneyEntry(_0xf012b6,_0x560c49){const _0xbaacc0=a147_0x4d9c99;return{...!_0x560c49&&_0xf012b6[_0xbaacc0(0x226)]!==undefined&&{'version':_0xf012b6['version']},..._0xf012b6[_0xbaacc0(0x1cf)]!==undefined&&{'state':_0xf012b6['state']},...!_0x560c49&&_0xf012b6['latest']!==undefined&&{'latest':_0xf012b6['latest']},..._0xf012b6[_0xbaacc0(0x1c9)]!==undefined&&{'version_number':_0xf012b6[_0xbaacc0(0x1c9)]},..._0xf012b6[_0xbaacc0(0x22b)]&&{'goal':normalizeJourneyCriteria(_0xf012b6['goal'])},..._0xf012b6[_0xbaacc0(0x1e9)]!==undefined&&{'reentry':_0xf012b6[_0xbaacc0(0x1e9)]},'stages':_0xf012b6[_0xbaacc0(0x1a9)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x1d341f){const _0x29c1b8=a147_0x4d9c99;return{'name':_0x1d341f[_0x29c1b8(0x1a5)],..._0x1d341f['description']!==undefined&&{'description':_0x1d341f[_0x29c1b8(0x225)]},..._0x1d341f[_0x29c1b8(0x21f)]&&{'entry_criteria':normalizeJourneyCriteria(_0x1d341f[_0x29c1b8(0x21f)])},..._0x1d341f[_0x29c1b8(0x1c6)]&&{'exit_criteria':_0x1d341f[_0x29c1b8(0x1c6)]['map'](normalizeJourneyCriteria)},..._0x1d341f[_0x29c1b8(0x1ec)]&&{'milestone':normalizeJourneyCriteria(_0x1d341f['milestone'])},..._0x1d341f['steps']&&{'steps':normalizeStepsWithImplicitNext(_0x1d341f[_0x29c1b8(0x206)])}};}function normalizeStepsWithImplicitNext(_0x35a906){const _0x47c17f=a147_0x4d9c99;return _0x35a906[_0x47c17f(0x1ef)]((_0x57a6d1,_0x31018b)=>{const _0x5c160e=_0x47c17f,_0x58314c=_0x31018b<_0x35a906['length']-0x1?_0x35a906[_0x31018b+0x1][_0x5c160e(0x1a5)]:undefined;return normalizeJourneyStep(_0x57a6d1,_0x58314c);});}function normalizeJourneyCriteria(_0x1c74cd){const _0xe29a16=a147_0x4d9c99;return{'name':_0x1c74cd[_0xe29a16(0x1a5)],..._0x1c74cd[_0xe29a16(0x225)]!==undefined&&{'description':_0x1c74cd[_0xe29a16(0x225)]},'segment':_0x1c74cd[_0xe29a16(0x208)],..._0x1c74cd['target']&&{'target':normalizeJumpTarget(_0x1c74cd['target'])}};}function normalizeJourneyStep(_0xbb80af,_0xb3260a){const _0x5557f2=a147_0x4d9c99,_0x793ec=_0xbb80af[_0x5557f2(0x253)]!==undefined&&_0xbb80af[_0x5557f2(0x253)]!==_0xb3260a,_0x3500a9={'type':_0xbb80af[_0x5557f2(0x1fb)],'name':_0xbb80af[_0x5557f2(0x1a5)],..._0x793ec&&{'next':_0xbb80af[_0x5557f2(0x253)]}};if(_0x5557f2(0x20f)in _0xbb80af&&_0xbb80af[_0x5557f2(0x20f)])return{..._0x3500a9,'with':normalizeStepParams(_0xbb80af['type'],_0xbb80af[_0x5557f2(0x20f)])};return _0x3500a9;}function normalizeStepParams(_0x55a2ab,_0xad3320){const _0x51c4c1=a147_0x4d9c99;switch(_0x55a2ab){case _0x51c4c1(0x1b7):{const _0x27a2e2=_0xad3320;let _0x33f83f;return _0x27a2e2[_0x51c4c1(0x24b)]&&(_0x33f83f={'segment':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x208)],..._0x27a2e2['condition'][_0x51c4c1(0x253)]!==undefined&&{'next':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x253)]},..._0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)]&&{'timeout':{'duration':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)][_0x51c4c1(0x1eb)],'unit':_0x27a2e2['condition']['timeout'][_0x51c4c1(0x222)],..._0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)][_0x51c4c1(0x253)]!==undefined&&{'next':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)][_0x51c4c1(0x253)]}}}}),{..._0x27a2e2['duration']!==undefined&&{'duration':_0x27a2e2[_0x51c4c1(0x1eb)]},..._0x27a2e2[_0x51c4c1(0x222)]!==undefined&&{'unit':_0x27a2e2['unit']},..._0x27a2e2[_0x51c4c1(0x218)]!==undefined&&{'wait_until':_0x27a2e2[_0x51c4c1(0x218)]},..._0x27a2e2[_0x51c4c1(0x1f2)]!==undefined&&{'days_of_week':_0x27a2e2[_0x51c4c1(0x1f2)]},..._0x33f83f&&{'condition':_0x33f83f}};}case _0x51c4c1(0x1a6):{const _0x799d24=_0xad3320;return{'activation':_0x799d24[_0x51c4c1(0x1a6)]};}case _0x51c4c1(0x255):{const _0x57e474=_0xad3320;return{'branches':_0x57e474[_0x51c4c1(0x216)][_0x51c4c1(0x1ef)](normalizeDecisionBranch)};}case _0x51c4c1(0x1c3):{const _0xb621b=_0xad3320;return{..._0xb621b[_0x51c4c1(0x22f)]!==undefined&&{'customized_split':_0xb621b[_0x51c4c1(0x22f)]},..._0xb621b[_0x51c4c1(0x199)]!==undefined&&{'unique_id':_0xb621b[_0x51c4c1(0x199)]},'variants':_0xb621b['variants']['map'](normalizeAbTestVariant)};}case _0x51c4c1(0x20a):{const _0x433eb4=_0xad3320;return{'target':normalizeJumpTarget(_0x433eb4[_0x51c4c1(0x215)])};}default:return _0xad3320;}}function normalizeDecisionBranch(_0x31bd47){const _0x569631=a147_0x4d9c99;return{'name':_0x31bd47[_0x569631(0x1a5)],..._0x31bd47[_0x569631(0x208)]!==undefined&&{'segment':_0x31bd47[_0x569631(0x208)]},..._0x31bd47[_0x569631(0x19b)]!==undefined&&{'excluded':_0x31bd47[_0x569631(0x19b)]},..._0x31bd47[_0x569631(0x253)]!==undefined&&{'next':_0x31bd47[_0x569631(0x253)]}};}function normalizeAbTestVariant(_0x58fd3e){const _0x5cdbb0=a147_0x4d9c99;return{..._0x58fd3e['id']!==undefined&&{'id':_0x58fd3e['id']},'name':_0x58fd3e[_0x5cdbb0(0x1a5)],'percentage':_0x58fd3e[_0x5cdbb0(0x1e7)],..._0x58fd3e[_0x5cdbb0(0x253)]!==undefined&&{'next':_0x58fd3e[_0x5cdbb0(0x253)]}};}function normalizeJumpTarget(_0x557476){const _0x138ba4=a147_0x4d9c99;return{'journey':_0x557476[_0x138ba4(0x237)],'stage':_0x557476[_0x138ba4(0x1e3)],..._0x557476[_0x138ba4(0x223)]!==undefined&&{'bundle_id':_0x557476[_0x138ba4(0x223)]}};}function normalizeEmbeddedSegments(_0x24ac8e,_0x5d63a8){const _0x4cb77a=a147_0x4d9c99,_0x167eeb={},_0x409e14=Object[_0x4cb77a(0x1c7)](_0x24ac8e),_0xc6aa30=_0x5d63a8?[..._0x5d63a8['filter'](_0x28b262=>_0x409e14[_0x4cb77a(0x209)](_0x28b262)),..._0x409e14[_0x4cb77a(0x236)](_0x2611d8=>!_0x5d63a8[_0x4cb77a(0x209)](_0x2611d8))[_0x4cb77a(0x1bf)]()]:_0x409e14[_0x4cb77a(0x1bf)]();for(const _0x36a177 of _0xc6aa30){const _0x34728f=_0x24ac8e[_0x36a177];if(_0x34728f[_0x4cb77a(0x1f3)]){const _0x3892a5=_0x34728f[_0x4cb77a(0x1f3)];if(_0x3892a5[_0x4cb77a(0x1fb)]!==_0x4cb77a(0x254)&&_0x3892a5['type']!=='Or'){const _0x5ad812=_0x3892a5[_0x4cb77a(0x1fb)]??_0x4cb77a(0x20e);throw new SDKError(ErrorCode[_0x4cb77a(0x230)],_0x4cb77a(0x1a0)+_0x36a177+'\x27:\x20'+(_0x4cb77a(0x1b5)+_0x5ad812+_0x4cb77a(0x21a))+'Expected\x20format:\x0a'+_0x4cb77a(0x1fa)+_0x4cb77a(0x1a3)+'\x20\x20\x20\x20conditions:\x0a'+_0x4cb77a(0x19d)+_0x4cb77a(0x203)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x3892a5[_0x4cb77a(0x1af)]||!Array[_0x4cb77a(0x241)](_0x3892a5['conditions']))throw new SDKError(ErrorCode[_0x4cb77a(0x230)],_0x4cb77a(0x1a0)+_0x36a177+_0x4cb77a(0x21e)+_0x4cb77a(0x1aa)+_0x4cb77a(0x1b3)+_0x4cb77a(0x1fa)+(_0x4cb77a(0x1ed)+_0x3892a5[_0x4cb77a(0x1fb)]+'\x0a')+_0x4cb77a(0x233)+_0x4cb77a(0x19d)+_0x4cb77a(0x203)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}_0x167eeb[_0x36a177]={..._0x34728f[_0x4cb77a(0x225)]&&_0x34728f[_0x4cb77a(0x225)]['trim']()&&{'description':_0x34728f['description']},..._0x34728f[_0x4cb77a(0x1f3)]&&{'rule':deepSortObject(_0x34728f[_0x4cb77a(0x1f3)])}};}return _0x167eeb;}function normalizeEmbeddedActivations(_0x5fd6a4,_0x4ea807){const _0x47f741=a147_0x4d9c99,_0x5040e1={},_0x536b58=Object[_0x47f741(0x1c7)](_0x5fd6a4),_0x360092=_0x4ea807?[..._0x4ea807[_0x47f741(0x236)](_0x41b4e1=>_0x536b58[_0x47f741(0x209)](_0x41b4e1)),..._0x536b58['filter'](_0x3e6fc4=>!_0x4ea807['includes'](_0x3e6fc4))[_0x47f741(0x1bf)]()]:_0x536b58['sort']();for(const _0x8bf5b7 of _0x360092){const _0x36c148=_0x5fd6a4[_0x8bf5b7];_0x5040e1[_0x8bf5b7]={'name':_0x36c148['name'],'connection':_0x36c148[_0x47f741(0x229)],..._0x36c148[_0x47f741(0x225)]!==undefined&&{'description':_0x36c148[_0x47f741(0x225)]},..._0x36c148['all_columns']!==undefined&&{'all_columns':_0x36c148['all_columns']},..._0x36c148['columns']!==undefined&&{'columns':_0x36c148[_0x47f741(0x1c8)]},..._0x36c148[_0x47f741(0x1b4)]!==undefined&&{'behavior':_0x36c148[_0x47f741(0x1b4)]},..._0x36c148[_0x47f741(0x1b2)]!==undefined&&{'schedule':_0x36c148['schedule']},..._0x36c148[_0x47f741(0x249)]!==undefined&&{'notification':_0x36c148[_0x47f741(0x249)]},..._0x36c148['connector_config']!==undefined&&{'connector_config':_0x36c148[_0x47f741(0x244)]},..._0x36c148[_0x47f741(0x23e)]!==undefined&&{'activation_template_id':_0x36c148[_0x47f741(0x23e)]}};}return _0x5040e1;}export function getActiveStages(_0x14282f){const _0x1134ac=a147_0x4d9c99;if(isJourneysArrayMode(_0x14282f)){const _0x1a5829=_0x14282f['journeys']||[],_0x3a1ab4=_0x1a5829[_0x1134ac(0x23a)](_0x7826ef=>_0x7826ef[_0x1134ac(0x1dd)]===!![])||_0x1a5829[0x0];return _0x3a1ab4?.['stages']||[];}if(isSingleVersionMode(_0x14282f))return _0x14282f[_0x1134ac(0x1a9)]||[];if(isMultiVersionMode(_0x14282f)){const _0x1fde7b=_0x14282f[_0x1134ac(0x1c0)]||[],_0x36ef07=_0x1fde7b['find'](_0x1288b6=>_0x1288b6['latest']===!![])||_0x1fde7b[0x0];return _0x36ef07?.[_0x1134ac(0x1a9)]||[];}return[];}export function getLatestJourneyEntry(_0x1d2edd){const _0x45f5a9=a147_0x4d9c99;if(isJourneysArrayMode(_0x1d2edd)){const _0x5945c1=_0x1d2edd[_0x45f5a9(0x1e5)]||[];return _0x5945c1['find'](_0x1c2738=>_0x1c2738['latest']===!![])||_0x5945c1[0x0];}if(isMultiVersionMode(_0x1d2edd)){const _0x1d5fd0=_0x1d2edd[_0x45f5a9(0x1c0)]||[],_0x1e4f3b=_0x1d5fd0['find'](_0x2f2a44=>_0x2f2a44[_0x45f5a9(0x1dd)]===!![])||_0x1d5fd0[0x0];if(_0x1e4f3b)return{'version':_0x1e4f3b[_0x45f5a9(0x1a5)],'state':_0x1e4f3b[_0x45f5a9(0x1cf)],'latest':_0x1e4f3b[_0x45f5a9(0x1dd)],'stages':_0x1e4f3b[_0x45f5a9(0x1a9)],'id':_0x1e4f3b['id'],'version_number':_0x1e4f3b[_0x45f5a9(0x1c9)]};}if(isSingleVersionMode(_0x1d2edd))return{'version':_0x1d2edd[_0x45f5a9(0x226)]||'v1','state':_0x45f5a9(0x1f1),'stages':_0x1d2edd[_0x45f5a9(0x1a9)]||[],'id':_0x1d2edd['id'],'version_number':_0x1d2edd['version_number'],'goal':_0x1d2edd[_0x45f5a9(0x22b)],'reentry':_0x1d2edd[_0x45f5a9(0x1e9)]};return undefined;}export function getLatestVersion(_0x48ac2d){const _0x40d348=a147_0x4d9c99;if(!isMultiVersionMode(_0x48ac2d))return undefined;const _0x47fdc6=_0x48ac2d[_0x40d348(0x1c0)]||[];return _0x47fdc6[_0x40d348(0x23a)](_0x3daf2a=>_0x3daf2a[_0x40d348(0x1dd)]===!![])||_0x47fdc6[0x0];}export function getEffectiveGoal(_0x3cc17f){const _0x15f102=a147_0x4d9c99,_0x26f14c=getLatestJourneyEntry(_0x3cc17f);return _0x26f14c?.[_0x15f102(0x22b)]||_0x3cc17f['goal'];}export function getEffectiveReentry(_0x195a6b){const _0x3726f2=a147_0x4d9c99,_0x34bafb=getLatestJourneyEntry(_0x195a6b);return _0x34bafb?.[_0x3726f2(0x1e9)]||_0x195a6b['reentry'];}export function collectSegmentRefs(_0x4b9264){const _0x2d4e29=a147_0x4d9c99,_0x1dc97b=new Set();_0x4b9264[_0x2d4e29(0x22b)]?.[_0x2d4e29(0x208)]&&_0x1dc97b[_0x2d4e29(0x195)](_0x4b9264['goal'][_0x2d4e29(0x208)]);const _0x294274=_0x10c8c4=>{const _0x164012=_0x2d4e29;for(const _0xf6b5cd of _0x10c8c4){_0xf6b5cd[_0x164012(0x21f)]?.[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0xf6b5cd[_0x164012(0x21f)]['segment']);if(_0xf6b5cd['exit_criteria'])for(const _0x560d88 of _0xf6b5cd[_0x164012(0x1c6)]){_0x560d88[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0x560d88['segment']);}_0xf6b5cd[_0x164012(0x1ec)]?.[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0xf6b5cd[_0x164012(0x1ec)]['segment']);if(_0xf6b5cd[_0x164012(0x206)])for(const _0x40db62 of _0xf6b5cd[_0x164012(0x206)]){if(_0x40db62['type']==='decision_point'){const _0x58ffe7=_0x40db62;for(const _0x40b447 of _0x58ffe7[_0x164012(0x20f)][_0x164012(0x216)]){_0x40b447[_0x164012(0x208)]&&_0x1dc97b['add'](_0x40b447[_0x164012(0x208)]);}}else{if(_0x40db62[_0x164012(0x1fb)]===_0x164012(0x1b7)){const _0x54f56d=_0x40db62;_0x54f56d['with'][_0x164012(0x24b)]?.[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0x54f56d[_0x164012(0x20f)]['condition'][_0x164012(0x208)]);}}}}};_0x4b9264[_0x2d4e29(0x1a9)]&&_0x294274(_0x4b9264[_0x2d4e29(0x1a9)]);if(_0x4b9264[_0x2d4e29(0x1c0)])for(const _0x1b41a5 of _0x4b9264[_0x2d4e29(0x1c0)]){_0x294274(_0x1b41a5[_0x2d4e29(0x1a9)]);}return _0x1dc97b;}export function validateSegmentRefs(_0x1739ba){const _0x2bff00=a147_0x4d9c99,_0xd7d76c=[],_0xb546a3=collectSegmentRefs(_0x1739ba),_0x16d0f7=new Set(Object[_0x2bff00(0x1c7)](_0x1739ba['segments']||{}));for(const _0x30e5bf of _0xb546a3){const _0xd0db04=parseSegmentRef(_0x30e5bf);_0xd0db04['type']===_0x2bff00(0x1a4)&&!_0x16d0f7[_0x2bff00(0x21d)](_0xd0db04[_0x2bff00(0x1a5)])&&_0xd7d76c[_0x2bff00(0x20c)](_0x2bff00(0x1b0)+_0xd0db04[_0x2bff00(0x1a5)]+_0x2bff00(0x1fc)+_0xd0db04[_0x2bff00(0x1a5)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0xd7d76c;}function a147_0x28af(){const _0x591466=['\x20\x20\x20\x20type:\x20And\x0a','embedded','name','activation','versionNumber','Met\x20condition(s)','stages','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','951246JLAsbb','Jump','replace','day','conditions','Unknown\x20segment\x20\x22','launched','schedule','Expected\x20format:\x0a','behavior','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','activations','wait','set','exitCriterias','stageName','journeyActivationStepId','ABTest','journeyBundleId','root_step','sort','versions','all','ref','ab_test','Stage\x20Complete','Stage\x201','exit_criteria','keys','columns','version_number','4iGqsts','uuid','resolveSegment','189693MpxHTa','goal:','state','waitStepUnit','null','26ibJSgI','*Max\x20wait\x20','reentry_always','Entry\x20Criteria','197920StoGAZ','AbTest','210970hixZsf','relationships','Send\x20Notification','conditionTimeoutDuration','resolveActivation','latest','conditionTimeoutUnit','First\x20stage\x20of\x20the\x20journey','8GUnBng','resolveActivationName','length','stage','WaitStep','journeys','Condition','percentage','size','reentry','resolveJumpTarget','duration','milestone','\x20\x20\x20\x20type:\x20','moveAfter','map','weeks','draft','days_of_week','rule','parentFolder','end','randomUUID','isJourneyLocal','reentryMode','folder','\x20\x20rule:\x0a','type','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','trim','data','variants','definition','timeout','attributes','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','excludedPath','End','steps','shift','segment','includes','jump','676920vLbLEd','push','segments','(missing)','with','test','bundle_name','resolveSegmentName','week','Duration','target','branches','startsWith','wait_until','journeyStageId','\x27.\x0a','Wait\x201\x20Day','Activation','has','\x27:\x20','entry_criteria','resolveEmbeddedSegmentId','no_reentry','unit','bundle_id','1297758nsgILC','description','version','entryCriteria','journeyStages','connection','journeyId','goal','waitStepType','days','segmentId','customized_split','JOURNEY_SYNTAX_ERROR','waitStep','get','\x20\x20\x20\x20conditions:\x0a','stageId','DecisionPoint','filter','journey','waitCondition','stringify','find','your-activation-name','object','journeys:','activation_template_id','allowReentry','timedOutPath','isArray','journeyName','conditionSegmentId','connector_config','exitCriteria','19419cQIbAP','toLowerCase','reentry:','notification','Date','condition','ref:','DaysOfTheWeek','merge','daysOfWeek','resolveActivationId','entries','segments:','next','And','decision_point','match','waitUntilDate','add','uniqueId','resolveStageId','resolveSegmentId','unique_id','from','excluded','resolveJourneyId','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','journeyBundleName','folder_id','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','segment_id','resolveEmbeddedActivationId'];a147_0x28af=function(){return _0x591466;};return a147_0x28af();}export function collectSegmentIdsFromJourneyApi(_0x40d09a){const _0x34af5b=a147_0x4d9c99,_0xf284e1=new Set();_0x40d09a['attributes'][_0x34af5b(0x22b)]?.[_0x34af5b(0x22e)]&&_0xf284e1['add'](_0x40d09a['attributes'][_0x34af5b(0x22b)][_0x34af5b(0x22e)]);const _0x2cbf1b=_0x40d09a['attributes'][_0x34af5b(0x228)];if(Array['isArray'](_0x2cbf1b))for(const _0x56f551 of _0x2cbf1b){_0x56f551['entryCriteria']?.[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x56f551['entryCriteria'][_0x34af5b(0x22e)]);const _0x249f8c=_0x56f551[_0x34af5b(0x1b9)]??_0x56f551[_0x34af5b(0x245)];if(Array[_0x34af5b(0x241)](_0x249f8c))for(const _0x5ec46f of _0x249f8c){_0x5ec46f['segmentId']&&_0xf284e1[_0x34af5b(0x195)](_0x5ec46f[_0x34af5b(0x22e)]);}_0x56f551[_0x34af5b(0x1ec)]?.[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x56f551[_0x34af5b(0x1ec)][_0x34af5b(0x22e)]);if(_0x56f551[_0x34af5b(0x206)]&&typeof _0x56f551[_0x34af5b(0x206)]===_0x34af5b(0x23c)){const _0x143afc=Array[_0x34af5b(0x241)](_0x56f551[_0x34af5b(0x206)])?_0x56f551[_0x34af5b(0x206)]:Object['values'](_0x56f551[_0x34af5b(0x206)]);for(const _0x4a6b19 of _0x143afc){_0x4a6b19[_0x34af5b(0x238)]?.[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x4a6b19[_0x34af5b(0x238)][_0x34af5b(0x22e)]);const _0x4cb0f7=_0x4a6b19;_0x4cb0f7[_0x34af5b(0x243)]&&_0xf284e1[_0x34af5b(0x195)](_0x4cb0f7['conditionSegmentId']);if(Array[_0x34af5b(0x241)](_0x4cb0f7[_0x34af5b(0x1af)]))for(const _0x4cad0e of _0x4cb0f7[_0x34af5b(0x1af)]){_0x4cad0e[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x4cad0e[_0x34af5b(0x22e)]);}if(Array[_0x34af5b(0x241)](_0x4a6b19[_0x34af5b(0x216)]))for(const _0x294e51 of _0x4a6b19['branches']){_0x294e51['segmentId']&&_0xf284e1[_0x34af5b(0x195)](_0x294e51[_0x34af5b(0x22e)]);}}}}return _0xf284e1;}
1
+ const a147_0x72352b=a147_0x4b77;(function(_0x107e7c,_0x128e9){const _0x59063e=a147_0x4b77,_0x1ec80a=_0x107e7c();while(!![]){try{const _0x188800=-parseInt(_0x59063e(0x1b6))/0x1+-parseInt(_0x59063e(0x207))/0x2*(-parseInt(_0x59063e(0x1b5))/0x3)+parseInt(_0x59063e(0x1f3))/0x4+parseInt(_0x59063e(0x18e))/0x5*(-parseInt(_0x59063e(0x17f))/0x6)+parseInt(_0x59063e(0x174))/0x7*(parseInt(_0x59063e(0x1ee))/0x8)+parseInt(_0x59063e(0x162))/0x9+-parseInt(_0x59063e(0x1f7))/0xa;if(_0x188800===_0x128e9)break;else _0x1ec80a['push'](_0x1ec80a['shift']());}catch(_0x33e3d0){_0x1ec80a['push'](_0x1ec80a['shift']());}}}(a147_0x5651,0x617cd));import*as a147_0x5aff14 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(_0x2cbb7c){const _0x570ed4=a147_0x4b77,_0x11458b=_0x2cbb7c[_0x570ed4(0x205)]();if(_0x11458b===_0x570ed4(0x1e6)||_0x11458b===_0x570ed4(0x15a))return _0x570ed4(0x15a);if(_0x11458b===_0x570ed4(0x1d9)||_0x11458b===_0x570ed4(0x186))return _0x570ed4(0x186);return _0x2cbb7c;}export function journeyResponseToDefSync(_0x4ac118){const _0x519c36=a147_0x4b77,_0x4c6869=_0x4ac118['attributes'],_0xbf9331=_0x4c6869['journeyBundleName']||_0x4c6869[_0x519c36(0x19b)],_0x5ead9b={'stages':_0x4c6869['journeyStages']['map'](convertApiStageToYaml),'id':_0x4ac118['id']};_0x4c6869[_0x519c36(0x202)]&&(_0x5ead9b['goal']=convertApiCriteriaToYaml(_0x4c6869['goal']));_0x4c6869[_0x519c36(0x19b)]&&_0x4c6869[_0x519c36(0x19b)]!==_0xbf9331&&(_0x5ead9b['version']=_0x4c6869['name']);_0x4c6869[_0x519c36(0x1d0)]!==undefined&&(_0x5ead9b['version_number']=_0x4c6869['versionNumber']);_0x4c6869[_0x519c36(0x1ec)]&&(_0x5ead9b[_0x519c36(0x1ec)]=_0x4c6869[_0x519c36(0x1ec)]===_0x519c36(0x181)?_0x519c36(0x181):_0x519c36(0x185));const _0xd9a7d5={'type':_0x519c36(0x1da),'name':_0xbf9331,'journeys':[_0x5ead9b]};_0x4c6869['description']&&(_0xd9a7d5[_0x519c36(0x1a8)]=_0x4c6869[_0x519c36(0x1a8)]);_0x4c6869[_0x519c36(0x202)]&&(_0xd9a7d5[_0x519c36(0x202)]=convertApiCriteriaToYaml(_0x4c6869[_0x519c36(0x202)]));if(_0x4c6869[_0x519c36(0x19a)])_0xd9a7d5[_0x519c36(0x193)]=_0x4c6869[_0x519c36(0x19a)];else _0x4c6869[_0x519c36(0x199)]!==undefined&&(_0xd9a7d5[_0x519c36(0x193)]=_0x4c6869[_0x519c36(0x199)]?_0x519c36(0x1ea):_0x519c36(0x151));return _0x4c6869[_0x519c36(0x1ed)]&&(_0xd9a7d5[_0x519c36(0x148)]=_0x4c6869[_0x519c36(0x1ed)]),_0x4c6869[_0x519c36(0x198)]&&(_0xd9a7d5[_0x519c36(0x208)]=_0x4c6869[_0x519c36(0x198)]),_0x4ac118[_0x519c36(0x1f4)]?.[_0x519c36(0x189)]?.[_0x519c36(0x1a9)]?.['id']&&(_0xd9a7d5['folder_id']=_0x4ac118[_0x519c36(0x1f4)][_0x519c36(0x189)][_0x519c36(0x1a9)]['id']),_0xd9a7d5;}export async function journeyResponseToDef(_0x2bc84d,_0x2a1675){const _0x4b24f0=a147_0x4b77,_0x28a7c8=journeyResponseToDefSync(_0x2bc84d);if(!_0x2a1675)return _0x28a7c8;const _0x18626a=new Set();collectSegmentIdsFromJourney(_0x28a7c8,_0x18626a);const _0x542450=new Set();collectActivationIdsFromJourney(_0x28a7c8,_0x542450);const _0x1448eb={},_0x22fc16=new Map();for(const _0x18c576 of Array[_0x4b24f0(0x176)](_0x18626a)[_0x4b24f0(0x1ab)]()){if(_0x2a1675[_0x4b24f0(0x18c)]){const _0x373dcd=await _0x2a1675[_0x4b24f0(0x18c)](_0x18c576);if(_0x373dcd[_0x4b24f0(0x14e)]){_0x22fc16[_0x4b24f0(0x158)](_0x18c576,_0x373dcd[_0x4b24f0(0x19b)]);if(_0x373dcd[_0x4b24f0(0x1b4)]){const _0x711b9a={..._0x373dcd['definition'],'rule':deepSortObject(_0x373dcd[_0x4b24f0(0x1b4)][_0x4b24f0(0x209)])};_0x1448eb[_0x373dcd[_0x4b24f0(0x19b)]]=_0x711b9a;}}else _0x22fc16[_0x4b24f0(0x158)](_0x18c576,makeSegmentRef(_0x373dcd[_0x4b24f0(0x19b)]));}else{if(_0x2a1675[_0x4b24f0(0x14c)]){const _0x38834d=await _0x2a1675[_0x4b24f0(0x14c)](_0x18c576);_0x22fc16[_0x4b24f0(0x158)](_0x18c576,_0x38834d);}}}const _0x4f82d1={},_0x37c589=new Map();for(const _0x19f68e of Array[_0x4b24f0(0x176)](_0x542450)[_0x4b24f0(0x1ab)]()){if(_0x2a1675[_0x4b24f0(0x1b7)]){const _0x4dd148=await _0x2a1675[_0x4b24f0(0x1b7)](_0x19f68e);_0x4dd148[_0x4b24f0(0x14e)]?(_0x37c589[_0x4b24f0(0x158)](_0x19f68e,_0x4dd148['name']),_0x4dd148['definition']&&(_0x4f82d1[_0x4dd148['name']]=_0x4dd148[_0x4b24f0(0x1b4)])):_0x37c589[_0x4b24f0(0x158)](_0x19f68e,makeSegmentRef(_0x4dd148[_0x4b24f0(0x19b)]));}else{if(_0x2a1675[_0x4b24f0(0x15b)]){const _0x48832c=await _0x2a1675[_0x4b24f0(0x15b)](_0x19f68e);_0x37c589[_0x4b24f0(0x158)](_0x19f68e,_0x48832c);}}}_0x22fc16[_0x4b24f0(0x1c5)]>0x0&&replaceSegmentIdsInJourney(_0x28a7c8,_0x22fc16);_0x37c589[_0x4b24f0(0x1c5)]>0x0&&replaceActivationIdsInJourney(_0x28a7c8,_0x37c589);if(_0x2a1675[_0x4b24f0(0x1e5)]){const _0x34b037=[];collectJumpTargetsFromJourney(_0x28a7c8,_0x34b037);if(_0x34b037[_0x4b24f0(0x16c)]>0x0){const _0x391acc=new Map();for(const _0x3541c3 of _0x34b037){try{const _0x5af402=await _0x2a1675[_0x4b24f0(0x1e5)](_0x3541c3['journeyId'],_0x3541c3[_0x4b24f0(0x1ac)]);_0x391acc[_0x4b24f0(0x158)](_0x3541c3[_0x4b24f0(0x152)]+':'+_0x3541c3['stageId'],_0x5af402);}catch{}}_0x391acc[_0x4b24f0(0x1c5)]>0x0&&replaceJumpTargetsInJourney(_0x28a7c8,_0x391acc);}}return Object[_0x4b24f0(0x1ff)](_0x1448eb)['length']>0x0&&(_0x28a7c8[_0x4b24f0(0x1e4)]=_0x1448eb),Object['keys'](_0x4f82d1)[_0x4b24f0(0x16c)]>0x0&&(_0x28a7c8[_0x4b24f0(0x16a)]=_0x4f82d1),_0x28a7c8;}function collectSegmentIdsFromJourney(_0x4071f1,_0x179c2e){const _0x563b77=a147_0x4b77;_0x4071f1['goal']?.[_0x563b77(0x1bb)]&&_0x179c2e[_0x563b77(0x161)](_0x4071f1[_0x563b77(0x202)]['segment']);const _0x57cd69=_0x2487b4=>{const _0x1b19af=_0x563b77;for(const _0x1bacbc of _0x2487b4){_0x1bacbc['entry_criteria']?.[_0x1b19af(0x1bb)]&&_0x179c2e[_0x1b19af(0x161)](_0x1bacbc['entry_criteria'][_0x1b19af(0x1bb)]);if(_0x1bacbc[_0x1b19af(0x1e3)])for(const _0x2a612f of _0x1bacbc[_0x1b19af(0x1e3)]){_0x2a612f[_0x1b19af(0x1bb)]&&_0x179c2e['add'](_0x2a612f[_0x1b19af(0x1bb)]);}_0x1bacbc[_0x1b19af(0x1a2)]?.[_0x1b19af(0x1bb)]&&_0x179c2e[_0x1b19af(0x161)](_0x1bacbc[_0x1b19af(0x1a2)][_0x1b19af(0x1bb)]);if(_0x1bacbc[_0x1b19af(0x1ca)])for(const _0x57caa1 of _0x1bacbc[_0x1b19af(0x1ca)]){if(_0x57caa1['type']===_0x1b19af(0x173)){const _0xa34f20=_0x57caa1;for(const _0x500a75 of _0xa34f20[_0x1b19af(0x197)][_0x1b19af(0x1be)]){_0x500a75['segment']&&_0x179c2e['add'](_0x500a75[_0x1b19af(0x1bb)]);}}else{if(_0x57caa1['type']==='wait'){const _0x5c0438=_0x57caa1;_0x5c0438['with']['condition']?.[_0x1b19af(0x1bb)]&&_0x179c2e[_0x1b19af(0x161)](_0x5c0438['with'][_0x1b19af(0x17a)]['segment']);}}}}};if(_0x4071f1[_0x563b77(0x1d6)])for(const _0x1d3e39 of _0x4071f1['journeys']){_0x1d3e39[_0x563b77(0x202)]?.[_0x563b77(0x1bb)]&&_0x179c2e['add'](_0x1d3e39[_0x563b77(0x202)][_0x563b77(0x1bb)]),_0x57cd69(_0x1d3e39[_0x563b77(0x1d2)]);}_0x4071f1['stages']&&_0x57cd69(_0x4071f1['stages']);if(_0x4071f1['versions'])for(const _0x513119 of _0x4071f1[_0x563b77(0x19d)]){_0x57cd69(_0x513119[_0x563b77(0x1d2)]);}}function replaceSegmentIdsInJourney(_0x1db164,_0x32782b){const _0x89796c=a147_0x4b77,_0x43ee39=_0x48574f=>_0x32782b[_0x89796c(0x18a)](_0x48574f)||_0x48574f;_0x1db164[_0x89796c(0x202)]?.[_0x89796c(0x1bb)]&&(_0x1db164[_0x89796c(0x202)][_0x89796c(0x1bb)]=_0x43ee39(_0x1db164[_0x89796c(0x202)]['segment']));const _0x13ece5=_0x47db3e=>{const _0xdf7b7b=_0x89796c;for(const _0x187ae2 of _0x47db3e){_0x187ae2[_0xdf7b7b(0x19e)]?.['segment']&&(_0x187ae2[_0xdf7b7b(0x19e)][_0xdf7b7b(0x1bb)]=_0x43ee39(_0x187ae2[_0xdf7b7b(0x19e)][_0xdf7b7b(0x1bb)]));if(_0x187ae2[_0xdf7b7b(0x1e3)])for(const _0x101924 of _0x187ae2[_0xdf7b7b(0x1e3)]){_0x101924['segment']&&(_0x101924['segment']=_0x43ee39(_0x101924[_0xdf7b7b(0x1bb)]));}_0x187ae2[_0xdf7b7b(0x1a2)]?.[_0xdf7b7b(0x1bb)]&&(_0x187ae2['milestone'][_0xdf7b7b(0x1bb)]=_0x43ee39(_0x187ae2[_0xdf7b7b(0x1a2)][_0xdf7b7b(0x1bb)]));if(_0x187ae2[_0xdf7b7b(0x1ca)])for(const _0x1faec6 of _0x187ae2[_0xdf7b7b(0x1ca)]){if(_0x1faec6[_0xdf7b7b(0x178)]===_0xdf7b7b(0x173)){const _0x42a09b=_0x1faec6;for(const _0xd266cd of _0x42a09b[_0xdf7b7b(0x197)][_0xdf7b7b(0x1be)]){_0xd266cd['segment']&&(_0xd266cd[_0xdf7b7b(0x1bb)]=_0x43ee39(_0xd266cd[_0xdf7b7b(0x1bb)]));}}else{if(_0x1faec6['type']===_0xdf7b7b(0x1c0)){const _0x149dea=_0x1faec6;_0x149dea['with'][_0xdf7b7b(0x17a)]?.[_0xdf7b7b(0x1bb)]&&(_0x149dea[_0xdf7b7b(0x197)][_0xdf7b7b(0x17a)][_0xdf7b7b(0x1bb)]=_0x43ee39(_0x149dea[_0xdf7b7b(0x197)][_0xdf7b7b(0x17a)][_0xdf7b7b(0x1bb)]));}}}}};if(_0x1db164['journeys'])for(const _0x849397 of _0x1db164[_0x89796c(0x1d6)]){_0x849397[_0x89796c(0x202)]?.['segment']&&(_0x849397['goal'][_0x89796c(0x1bb)]=_0x43ee39(_0x849397['goal']['segment'])),_0x13ece5(_0x849397[_0x89796c(0x1d2)]);}_0x1db164[_0x89796c(0x1d2)]&&_0x13ece5(_0x1db164['stages']);if(_0x1db164[_0x89796c(0x19d)])for(const _0x2b47ec of _0x1db164[_0x89796c(0x19d)]){_0x13ece5(_0x2b47ec[_0x89796c(0x1d2)]);}}function collectActivationIdsFromJourney(_0x3c098e,_0x419593){const _0x427d39=a147_0x4b77,_0x5e14db=_0x339077=>{const _0xdcf5a4=a147_0x4b77;for(const _0x522685 of _0x339077){if(_0x522685['steps'])for(const _0x105b4d of _0x522685[_0xdcf5a4(0x1ca)]){if(_0x105b4d[_0xdcf5a4(0x178)]===_0xdcf5a4(0x1b0)){const _0x115fa6=_0x105b4d;_0x115fa6[_0xdcf5a4(0x197)][_0xdcf5a4(0x1b0)]&&/^\d+$/[_0xdcf5a4(0x1dd)](_0x115fa6[_0xdcf5a4(0x197)][_0xdcf5a4(0x1b0)])&&_0x419593['add'](_0x115fa6['with'][_0xdcf5a4(0x1b0)]);}}}};if(_0x3c098e[_0x427d39(0x1d6)])for(const _0x5ef48f of _0x3c098e[_0x427d39(0x1d6)]){_0x5e14db(_0x5ef48f[_0x427d39(0x1d2)]);}_0x3c098e['stages']&&_0x5e14db(_0x3c098e[_0x427d39(0x1d2)]);if(_0x3c098e[_0x427d39(0x19d)])for(const _0x6fd002 of _0x3c098e[_0x427d39(0x19d)]){_0x5e14db(_0x6fd002[_0x427d39(0x1d2)]);}}function replaceActivationIdsInJourney(_0x517f29,_0x670925){const _0x39085a=a147_0x4b77,_0x5b8d57=_0x4b3681=>_0x670925[_0x39085a(0x18a)](_0x4b3681)||_0x4b3681,_0x344f1a=_0x27f13f=>{const _0x2d47e6=_0x39085a;for(const _0x348cb2 of _0x27f13f){if(_0x348cb2['steps'])for(const _0x505149 of _0x348cb2[_0x2d47e6(0x1ca)]){if(_0x505149[_0x2d47e6(0x178)]===_0x2d47e6(0x1b0)){const _0x1b8b5e=_0x505149;_0x1b8b5e[_0x2d47e6(0x197)]['activation']&&(_0x1b8b5e[_0x2d47e6(0x197)][_0x2d47e6(0x1b0)]=_0x5b8d57(_0x1b8b5e[_0x2d47e6(0x197)][_0x2d47e6(0x1b0)]));}}}};if(_0x517f29['journeys'])for(const _0x1aa2a0 of _0x517f29[_0x39085a(0x1d6)]){_0x344f1a(_0x1aa2a0[_0x39085a(0x1d2)]);}_0x517f29[_0x39085a(0x1d2)]&&_0x344f1a(_0x517f29[_0x39085a(0x1d2)]);if(_0x517f29[_0x39085a(0x19d)])for(const _0x2c63bf of _0x517f29[_0x39085a(0x19d)]){_0x344f1a(_0x2c63bf[_0x39085a(0x1d2)]);}}function collectJumpTargetsFromJourney(_0x385f64,_0x5cf9d0){const _0x1afe3f=a147_0x4b77,_0x3def70=new Set(),_0x166f03=_0x22a8a2=>{const _0x31fd4f=a147_0x4b77;for(const _0x501e68 of _0x22a8a2){if(_0x501e68[_0x31fd4f(0x1ca)])for(const _0x5f44b9 of _0x501e68[_0x31fd4f(0x1ca)]){if(_0x5f44b9['type']==='jump'){const _0x53bcd4=_0x5f44b9,_0x4d9f56=_0x53bcd4['with'][_0x31fd4f(0x195)];if(_0x4d9f56[_0x31fd4f(0x1da)]&&_0x4d9f56[_0x31fd4f(0x1ce)]&&/^\d+$/[_0x31fd4f(0x1dd)](_0x4d9f56[_0x31fd4f(0x1da)])&&/^\d+$/['test'](_0x4d9f56['stage'])){const _0x248766=_0x4d9f56[_0x31fd4f(0x1da)]+':'+_0x4d9f56[_0x31fd4f(0x1ce)];!_0x3def70[_0x31fd4f(0x1ad)](_0x248766)&&(_0x3def70[_0x31fd4f(0x161)](_0x248766),_0x5cf9d0[_0x31fd4f(0x1cd)]({'journeyId':_0x4d9f56[_0x31fd4f(0x1da)],'stageId':_0x4d9f56[_0x31fd4f(0x1ce)]}));}}}}};if(_0x385f64[_0x1afe3f(0x1d6)])for(const _0xb53788 of _0x385f64[_0x1afe3f(0x1d6)]){_0x166f03(_0xb53788[_0x1afe3f(0x1d2)]);}_0x385f64[_0x1afe3f(0x1d2)]&&_0x166f03(_0x385f64[_0x1afe3f(0x1d2)]);if(_0x385f64['versions'])for(const _0x4f08c9 of _0x385f64[_0x1afe3f(0x19d)]){_0x166f03(_0x4f08c9['stages']);}}function a147_0x5651(){const _0x40794a=['steps','slice','stageName','push','stage','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','versionNumber','resolveJourneyId','stages','version','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','journeyActivationStepId','journeys','resolveEmbeddedActivationId','waitStepUnit','weeks','journey','embedded','notification','test','journeyName','entries','variants','First\x20stage\x20of\x20the\x20journey','reentry:','exit_criteria','segments','resolveJumpTarget','days','null','ABTest','goal:','reentry_always','ref','state','journeyBundleId','3864040KAzOnR','resolveEmbeddedSegmentId','shift','DecisionPoint','And','588220kHNXNI','relationships','percentage','resolveActivationId','13441150UKPGTr','version_number','Variant','isArray','startsWith','waitStepType','DaysOfTheWeek','activation_template_id','keys','replace','schedule','goal','object','exitCriterias','toLowerCase','wait_until','158LaKcbL','bundle_name','rule','excludedPath','timedOutPath','versions:','bundle_id','all','\x20\x20\x20\x20type:\x20And\x0a','Send\x20Notification','resolveSegmentName','connector_config','isJourneyLocal','waitStep','waitUntilDate','no_reentry','journeyId','*Max\x20wait\x20','all_columns','waitCondition','duration','timeout','set','trim','day','resolveActivationName','merge','find','segment_id','folder_id','stages:','add','5986791iwTPeS','journeyStageId','conditionSegmentId','\x27:\x20','root_step','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','unique_id','filter','activations','excluded','length','conditionTimeoutDuration','resolveSegmentId','ref:','customized_split','End','JOURNEY_SYNTAX_ERROR','decision_point','7bIlTBc','Merge','from','conditions','type','\x27.\x0a','condition','goal-segment','daysOfWeek','activations:','latest','6bkOFNk','rootStep','launched','includes','attributes','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','draft','week','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','segmentId','parentFolder','get','map','resolveSegment','ab_test','1035565vBibJE','Date','days_of_week','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','Expected\x20format:\x0a','reentry','your-activation-name','target','conditionTimeoutUnit','with','journeyBundleName','allowReentry','reentryMode','name','moveAfter','versions','entry_criteria','values','journeyStages','journeys:','milestone','resolveStageId','Jump','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','next','entryCriteria','description','data','Journey\x20description','sort','stageId','has','end','Unknown\x20segment\x20\x22','activation','jump','\x20\x20rule:\x0a','stringify','definition','25335odLVfi','11877lJGOjE','resolveActivation','Activation','unit','connection','segment','randomUUID','behavior','branches','Condition','wait','customizedSplit','WaitStep','Duration','exitCriteria','size','(missing)','columns','\x20\x20\x20\x20type:\x20','Wait\x201\x20Day'];a147_0x5651=function(){return _0x40794a;};return a147_0x5651();}function replaceJumpTargetsInJourney(_0x48011c,_0x36be1a){const _0x541c5f=a147_0x4b77,_0x4603a5=_0x573370=>{const _0x45a427=a147_0x4b77;for(const _0x4bedbc of _0x573370){if(_0x4bedbc[_0x45a427(0x1ca)])for(const _0x2351d8 of _0x4bedbc['steps']){if(_0x2351d8[_0x45a427(0x178)]===_0x45a427(0x1b1)){const _0x2d04b7=_0x2351d8,_0x226e53=_0x2d04b7[_0x45a427(0x197)][_0x45a427(0x195)],_0x1b71cd=_0x226e53[_0x45a427(0x1da)]+':'+_0x226e53[_0x45a427(0x1ce)],_0x5866c5=_0x36be1a[_0x45a427(0x18a)](_0x1b71cd);_0x5866c5&&(_0x226e53[_0x45a427(0x1da)]=_0x5866c5['journeyName'],_0x226e53[_0x45a427(0x1ce)]=_0x5866c5[_0x45a427(0x1cc)]);}}}};if(_0x48011c[_0x541c5f(0x1d6)])for(const _0x548646 of _0x48011c[_0x541c5f(0x1d6)]){_0x4603a5(_0x548646[_0x541c5f(0x1d2)]);}_0x48011c['stages']&&_0x4603a5(_0x48011c[_0x541c5f(0x1d2)]);if(_0x48011c['versions'])for(const _0x27f8ad of _0x48011c[_0x541c5f(0x19d)]){_0x4603a5(_0x27f8ad[_0x541c5f(0x1d2)]);}}function generateReadableStepName(_0x1b2ce1,_0x108eaa){const _0x213d66=a147_0x4b77;if(_0x1b2ce1[_0x213d66(0x19b)]&&_0x1b2ce1[_0x213d66(0x19b)]!==_0x1b2ce1[_0x213d66(0x178)]){const _0x2b34e8=_0x1b2ce1['name']['trim']();if(_0x2b34e8&&/[a-z0-9\p{L}]/iu[_0x213d66(0x1dd)](_0x2b34e8))return _0x2b34e8;}const _0x1f4c10=_0x1b2ce1['type']['toLowerCase']()[_0x213d66(0x200)](/step$/i,'');return _0x1f4c10+'_'+(_0x108eaa+0x1);}function getStepNextRefs(_0x1935fd){const _0x1d6ea2=a147_0x4b77,_0x546c88=[];if(_0x1935fd[_0x1d6ea2(0x1a6)])_0x546c88[_0x1d6ea2(0x1cd)](_0x1935fd[_0x1d6ea2(0x1a6)]);if(_0x1935fd[_0x1d6ea2(0x1be)])for(const _0x2208b7 of _0x1935fd['branches']){if(_0x2208b7[_0x1d6ea2(0x1a6)])_0x546c88['push'](_0x2208b7[_0x1d6ea2(0x1a6)]);}if(_0x1935fd[_0x1d6ea2(0x1e0)])for(const _0x15651e of _0x1935fd[_0x1d6ea2(0x1e0)]){if(_0x15651e[_0x1d6ea2(0x1a6)])_0x546c88[_0x1d6ea2(0x1cd)](_0x15651e[_0x1d6ea2(0x1a6)]);}if(_0x1935fd[_0x1d6ea2(0x177)])for(const _0x56226e of _0x1935fd[_0x1d6ea2(0x177)]){if(_0x56226e[_0x1d6ea2(0x1a6)])_0x546c88[_0x1d6ea2(0x1cd)](_0x56226e[_0x1d6ea2(0x1a6)]);}return _0x546c88;}function parseJumpTargetDisplayName(_0x225e9b){const _0x5b9e63=a147_0x4b77,_0xd98125=_0x225e9b['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0xd98125)return undefined;const _0x515b69=_0xd98125[0x1]['trim'](),_0x2118d3=_0xd98125[0x2][_0x5b9e63(0x159)]();if(!_0x515b69||!_0x2118d3)return undefined;return{'stageName':_0x515b69,'journeyName':_0x2118d3};}function orderStepsFromRoot(_0x37f20b,_0x41acbc){const _0x240268=a147_0x4b77,_0x2c999c=Object[_0x240268(0x1df)](_0x37f20b);if(_0x2c999c['length']===0x0)return[];const _0x24e8d6=new Set(_0x2c999c[_0x240268(0x18b)](([_0x31651b])=>_0x31651b)),_0x5a5da2=new Set();for(const [,_0x553706]of _0x2c999c){for(const _0x5894da of getStepNextRefs(_0x553706)){if(_0x24e8d6[_0x240268(0x1ad)](_0x5894da))_0x5a5da2['add'](_0x5894da);}}let _0x1471fa=_0x41acbc&&_0x24e8d6[_0x240268(0x1ad)](_0x41acbc)?_0x41acbc:undefined;if(!_0x1471fa){const _0x38bdeb=_0x2c999c[_0x240268(0x169)](([_0x175589])=>!_0x5a5da2['has'](_0x175589));_0x38bdeb[_0x240268(0x16c)]>0x0?_0x1471fa=_0x38bdeb[0x0][0x0]:_0x1471fa=_0x2c999c[0x0][0x0];}const _0x1288ec=[],_0x55eef1=new Set(),_0x4a64f5=[_0x1471fa];while(_0x4a64f5[_0x240268(0x16c)]>0x0){const _0x70081=_0x4a64f5[_0x240268(0x1f0)]();if(_0x55eef1[_0x240268(0x1ad)](_0x70081))continue;_0x55eef1[_0x240268(0x161)](_0x70081);const _0x564f08=_0x37f20b[_0x70081];if(!_0x564f08)continue;_0x1288ec[_0x240268(0x1cd)]({'uuid':_0x70081,'step':_0x564f08});for(const _0x180930 of getStepNextRefs(_0x564f08)){_0x24e8d6[_0x240268(0x1ad)](_0x180930)&&!_0x55eef1[_0x240268(0x1ad)](_0x180930)&&_0x4a64f5[_0x240268(0x1cd)](_0x180930);}}for(const [_0xf1216c,_0x4bc18d]of _0x2c999c){!_0x55eef1['has'](_0xf1216c)&&_0x1288ec[_0x240268(0x1cd)]({'uuid':_0xf1216c,'step':_0x4bc18d});}return _0x1288ec;}function resolveStepReferences(_0xbe0918,_0x2a0835,_0x42704f,_0x597a36){const _0x32f1eb=a147_0x4b77;if(_0xbe0918[_0x32f1eb(0x178)]!==_0x32f1eb(0x1ae)){_0xbe0918['next']&&_0x597a36[_0x32f1eb(0x1ad)](_0xbe0918[_0x32f1eb(0x1a6)])&&(_0xbe0918[_0x32f1eb(0x1a6)]=_0x597a36['get'](_0xbe0918[_0x32f1eb(0x1a6)]));const _0x3b0bf0=_0x2a0835+0x1;if(_0x3b0bf0<_0x42704f[_0x32f1eb(0x16c)]){const _0x38fe2a=_0x597a36[_0x32f1eb(0x18a)](_0x42704f[_0x3b0bf0]['uuid']);_0xbe0918[_0x32f1eb(0x1a6)]===_0x38fe2a&&delete _0xbe0918['next'];}}if(_0xbe0918[_0x32f1eb(0x178)]===_0x32f1eb(0x173))for(const _0x4f9181 of _0xbe0918[_0x32f1eb(0x197)]['branches']){_0x4f9181[_0x32f1eb(0x1a6)]&&_0x597a36[_0x32f1eb(0x1ad)](_0x4f9181[_0x32f1eb(0x1a6)])&&(_0x4f9181[_0x32f1eb(0x1a6)]=_0x597a36[_0x32f1eb(0x18a)](_0x4f9181[_0x32f1eb(0x1a6)]));}if(_0xbe0918[_0x32f1eb(0x178)]===_0x32f1eb(0x18d))for(const _0x4b0b6b of _0xbe0918[_0x32f1eb(0x197)][_0x32f1eb(0x1e0)]){_0x4b0b6b['next']&&_0x597a36[_0x32f1eb(0x1ad)](_0x4b0b6b[_0x32f1eb(0x1a6)])&&(_0x4b0b6b['next']=_0x597a36['get'](_0x4b0b6b[_0x32f1eb(0x1a6)]));}if(_0xbe0918[_0x32f1eb(0x178)]==='wait'&&_0xbe0918[_0x32f1eb(0x197)][_0x32f1eb(0x17a)]){const _0x3c34d5=_0xbe0918['with'][_0x32f1eb(0x17a)];_0x3c34d5['next']&&_0x597a36['has'](_0x3c34d5['next'])&&(_0x3c34d5['next']=_0x597a36['get'](_0x3c34d5[_0x32f1eb(0x1a6)])),_0x3c34d5[_0x32f1eb(0x157)]?.['next']&&_0x597a36[_0x32f1eb(0x1ad)](_0x3c34d5[_0x32f1eb(0x157)][_0x32f1eb(0x1a6)])&&(_0x3c34d5[_0x32f1eb(0x157)][_0x32f1eb(0x1a6)]=_0x597a36[_0x32f1eb(0x18a)](_0x3c34d5[_0x32f1eb(0x157)][_0x32f1eb(0x1a6)]));}}function convertApiStageToYaml(_0x3d2c27){const _0x2a36b3=a147_0x4b77,_0xe91d5={'name':_0x3d2c27[_0x2a36b3(0x19b)]};_0x3d2c27['id']&&(_0xe91d5['id']=_0x3d2c27['id']);_0x3d2c27[_0x2a36b3(0x1a8)]&&(_0xe91d5[_0x2a36b3(0x1a8)]=_0x3d2c27['description']);_0x3d2c27['entryCriteria']&&(_0xe91d5['entry_criteria']=convertApiCriteriaToYaml(_0x3d2c27[_0x2a36b3(0x1a7)]));_0x3d2c27[_0x2a36b3(0x204)]&&_0x3d2c27[_0x2a36b3(0x204)][_0x2a36b3(0x16c)]>0x0&&(_0xe91d5[_0x2a36b3(0x1e3)]=_0x3d2c27['exitCriterias']['map'](convertApiCriteriaToYaml));_0x3d2c27[_0x2a36b3(0x1a2)]&&(_0xe91d5['milestone']=convertApiCriteriaToYaml(_0x3d2c27[_0x2a36b3(0x1a2)]));if(_0x3d2c27[_0x2a36b3(0x1ca)]&&Object[_0x2a36b3(0x1ff)](_0x3d2c27[_0x2a36b3(0x1ca)])['length']>0x0){const _0x37fbdf=orderStepsFromRoot(_0x3d2c27[_0x2a36b3(0x1ca)],_0x3d2c27['rootStep']),_0x411fc8=new Map(),_0x2a4672=new Set();for(let _0x130829=0x0;_0x130829<_0x37fbdf[_0x2a36b3(0x16c)];_0x130829++){const {uuid:_0x74b5c,step:_0x45a331}=_0x37fbdf[_0x130829];let _0x3bb4a5=generateReadableStepName(_0x45a331,_0x130829),_0x1bd3a2=_0x3bb4a5,_0x5d0c53=0x2;while(_0x2a4672[_0x2a36b3(0x1ad)](_0x1bd3a2)){_0x1bd3a2=_0x3bb4a5+'_'+_0x5d0c53,_0x5d0c53++;}_0x2a4672[_0x2a36b3(0x161)](_0x1bd3a2),_0x411fc8[_0x2a36b3(0x158)](_0x74b5c,_0x1bd3a2);}_0xe91d5[_0x2a36b3(0x1ca)]=_0x37fbdf['map'](({uuid:_0x44df87,step:_0x568b1c},_0x483747)=>{const _0x43774f=_0x2a36b3,_0xba75b7=convertApiStepToYaml(_0x568b1c,_0x411fc8[_0x43774f(0x18a)](_0x44df87));return resolveStepReferences(_0xba75b7,_0x483747,_0x37fbdf,_0x411fc8),_0xba75b7;});}return _0xe91d5;}function convertApiCriteriaToYaml(_0x2dafb5){const _0x38454a=a147_0x4b77,_0x8ca789={'name':_0x2dafb5[_0x38454a(0x19b)],'segment':_0x2dafb5[_0x38454a(0x188)]};_0x2dafb5['description']&&(_0x8ca789[_0x38454a(0x1a8)]=_0x2dafb5[_0x38454a(0x1a8)]);if(_0x2dafb5[_0x38454a(0x195)]){let _0x397add=_0x2dafb5[_0x38454a(0x195)][_0x38454a(0x152)],_0x5e8fa8=_0x2dafb5[_0x38454a(0x195)][_0x38454a(0x163)];if(_0x2dafb5['target'][_0x38454a(0x1de)]){const _0x4ac88a=parseJumpTargetDisplayName(_0x2dafb5[_0x38454a(0x195)][_0x38454a(0x1de)]);_0x4ac88a&&(_0x5e8fa8=_0x4ac88a[_0x38454a(0x1cc)],_0x397add=_0x4ac88a[_0x38454a(0x1de)]);}_0x8ca789[_0x38454a(0x195)]={'journey':_0x397add,'stage':_0x5e8fa8},_0x2dafb5[_0x38454a(0x195)]['journeyBundleId']&&(_0x8ca789['target'][_0x38454a(0x148)]=_0x2dafb5[_0x38454a(0x195)]['journeyBundleId']);}return _0x8ca789;}function convertApiStepToYaml(_0xe4d3af,_0x1649bd){const _0x43575e=a147_0x4b77;switch(_0xe4d3af[_0x43575e(0x178)]){case _0x43575e(0x1c2):{const _0x3536e3={};if(_0xe4d3af['waitStepType']===_0x43575e(0x1c3)&&_0xe4d3af[_0x43575e(0x14f)]!==undefined)_0x3536e3[_0x43575e(0x156)]=_0xe4d3af[_0x43575e(0x14f)],_0x3536e3[_0x43575e(0x1b9)]=_0xe4d3af[_0x43575e(0x1d8)];else{if(_0xe4d3af['waitStepType']===_0x43575e(0x18f)&&_0xe4d3af[_0x43575e(0x150)])_0x3536e3[_0x43575e(0x206)]=_0xe4d3af['waitUntilDate'];else{if(_0xe4d3af['waitStepType']===_0x43575e(0x1fd)&&_0xe4d3af[_0x43575e(0x17c)])_0x3536e3[_0x43575e(0x190)]=_0xe4d3af[_0x43575e(0x17c)];else{if(_0xe4d3af['waitStepType']===_0x43575e(0x1bf)){if(_0xe4d3af[_0x43575e(0x177)]&&_0xe4d3af[_0x43575e(0x177)][_0x43575e(0x16c)]>0x0){const _0x14e278=_0xe4d3af[_0x43575e(0x177)][_0x43575e(0x15d)](_0x5a371d=>!_0x5a371d[_0x43575e(0x146)]),_0x5acfc5=_0xe4d3af[_0x43575e(0x177)]['find'](_0x4a097a=>_0x4a097a[_0x43575e(0x146)]);_0x14e278?.[_0x43575e(0x188)]&&(_0x3536e3[_0x43575e(0x17a)]={'segment':_0x14e278[_0x43575e(0x188)],..._0x14e278[_0x43575e(0x1a6)]?{'next':_0x14e278[_0x43575e(0x1a6)]}:{}},_0x5acfc5&&_0x5acfc5[_0x43575e(0x19c)]!==undefined&&_0x5acfc5[_0x43575e(0x1b9)]&&(_0x3536e3['condition']['timeout']={'duration':_0x5acfc5[_0x43575e(0x19c)],'unit':_0x5acfc5[_0x43575e(0x1b9)],..._0x5acfc5['next']?{'next':_0x5acfc5[_0x43575e(0x1a6)]}:{}}));}else _0xe4d3af['conditionSegmentId']&&(_0x3536e3['condition']={'segment':_0xe4d3af['conditionSegmentId']},_0xe4d3af[_0x43575e(0x16d)]!==undefined&&_0xe4d3af[_0x43575e(0x196)]&&(_0x3536e3[_0x43575e(0x17a)]['timeout']={'duration':_0xe4d3af[_0x43575e(0x16d)],'unit':_0xe4d3af[_0x43575e(0x196)]}));}}}}const _0x12aa8c={'type':_0x43575e(0x1c0),'name':_0x1649bd,..._0xe4d3af[_0x43575e(0x1a6)]?{'next':_0xe4d3af[_0x43575e(0x1a6)]}:{},'with':_0x3536e3};return _0x12aa8c;}case'Activation':{const _0x1385b9={'type':_0x43575e(0x1b0),'name':_0x1649bd,..._0xe4d3af[_0x43575e(0x1a6)]?{'next':_0xe4d3af['next']}:{},'with':{'activation':_0xe4d3af[_0x43575e(0x1d5)]||''}};return _0x1385b9;}case _0x43575e(0x1f1):{const _0x3ed13a={'type':_0x43575e(0x173),'name':_0x1649bd,..._0xe4d3af[_0x43575e(0x1a6)]?{'next':_0xe4d3af[_0x43575e(0x1a6)]}:{},'with':{'branches':(_0xe4d3af[_0x43575e(0x1be)]||[])[_0x43575e(0x18b)](_0x913ddd=>({'name':_0x913ddd[_0x43575e(0x19b)],'segment':_0x913ddd['segmentId'],'excluded':_0x913ddd[_0x43575e(0x20a)],..._0x913ddd[_0x43575e(0x1a6)]?{'next':_0x913ddd[_0x43575e(0x1a6)]}:{}}))}};return _0x3ed13a;}case _0x43575e(0x1e8):case'AbTest':case _0x43575e(0x1f9):{const _0x2bd00a=_0xe4d3af[_0x43575e(0x1e0)]||(_0xe4d3af[_0x43575e(0x1be)]||[])['map'](_0x294bb2=>({'name':_0x294bb2[_0x43575e(0x19b)],'percentage':0x0,'next':_0x294bb2[_0x43575e(0x1a6)]})),_0x4aa308={'type':_0x43575e(0x18d),'name':_0x1649bd,..._0xe4d3af['next']?{'next':_0xe4d3af[_0x43575e(0x1a6)]}:{},'with':{'customized_split':_0xe4d3af[_0x43575e(0x1c1)],'unique_id':_0xe4d3af['uniqueId'],'variants':_0x2bd00a[_0x43575e(0x18b)](_0x5428b4=>({'name':_0x5428b4['name'],'percentage':_0x5428b4['percentage'],..._0x5428b4[_0x43575e(0x1a6)]?{'next':_0x5428b4['next']}:{}}))}};return _0x4aa308;}case _0x43575e(0x175):{const _0x32e89b={'type':_0x43575e(0x15c),'name':_0x1649bd,..._0xe4d3af[_0x43575e(0x1a6)]?{'next':_0xe4d3af['next']}:{}};return _0x32e89b;}case'Jump':{let _0x3c0801='',_0x364f4a='',_0x49e367;if(_0xe4d3af[_0x43575e(0x195)]){_0x3c0801=_0xe4d3af[_0x43575e(0x195)][_0x43575e(0x152)],_0x364f4a=_0xe4d3af[_0x43575e(0x195)][_0x43575e(0x163)],_0x49e367=_0xe4d3af[_0x43575e(0x195)][_0x43575e(0x1ed)];if(_0xe4d3af[_0x43575e(0x195)]['journeyName']){const _0x545917=parseJumpTargetDisplayName(_0xe4d3af[_0x43575e(0x195)][_0x43575e(0x1de)]);_0x545917&&(_0x364f4a=_0x545917[_0x43575e(0x1cc)],_0x3c0801=_0x545917[_0x43575e(0x1de)]);}}const _0x5e8034={'type':_0x43575e(0x1b1),'name':_0x1649bd,..._0xe4d3af[_0x43575e(0x1a6)]?{'next':_0xe4d3af['next']}:{},'with':{'target':{'journey':_0x3c0801,'stage':_0x364f4a,..._0x49e367?{'bundle_id':_0x49e367}:{}}}};return _0x5e8034;}case _0x43575e(0x171):{const _0x21c7b8={'type':_0x43575e(0x1ae),'name':_0x1649bd};return _0x21c7b8;}default:{const _0x9bf6a4={'type':_0x43575e(0x1ae),'name':_0x1649bd};return _0x9bf6a4;}}}export async function journeyDefToRequest(_0x546d49,_0x6794aa,_0x54f620){const _0x35c222=a147_0x4b77,_0x3ff655=_0x546d49[_0x35c222(0x1d2)]||getActiveStages(_0x546d49),_0x16c8c3=isJourneysArrayMode(_0x546d49)||isMultiVersionMode(_0x546d49)?getLatestJourneyEntry(_0x546d49):undefined,_0x1b7c29=_0x16c8c3?.[_0x35c222(0x1d3)]??_0x546d49['name'],_0x4785fc=_0x546d49[_0x35c222(0x1e4)]||{},_0xcbcf26=_0x546d49[_0x35c222(0x16a)]||{},_0x4c71e6={'type':_0x35c222(0x1da),'attributes':{'name':_0x1b7c29,'audienceId':_0x6794aa,'journeyStages':await Promise[_0x35c222(0x149)](_0x3ff655['map'](_0x3a1fa2=>convertYamlStageToApi(_0x3a1fa2,_0x54f620,_0x4785fc,_0xcbcf26)))}},_0x21ab76=_0x16c8c3?.['id']??_0x546d49['id'];_0x21ab76&&(_0x4c71e6['id']=_0x21ab76);_0x546d49[_0x35c222(0x1a8)]&&(_0x4c71e6[_0x35c222(0x183)][_0x35c222(0x1a8)]=_0x546d49[_0x35c222(0x1a8)]);const _0x322236=getEffectiveGoal(_0x546d49);_0x322236&&(_0x4c71e6[_0x35c222(0x183)][_0x35c222(0x202)]=await convertYamlCriteriaToApi(_0x322236,_0x54f620,_0x4785fc));const _0x4d15e8=getEffectiveReentry(_0x546d49);return _0x4d15e8&&(_0x4c71e6[_0x35c222(0x183)]['reentryMode']=_0x4d15e8,_0x4c71e6['attributes']['allowReentry']=_0x4d15e8!==_0x35c222(0x151)),_0x546d49['folder_id']&&(_0x4c71e6[_0x35c222(0x1f4)]={'parentFolder':{'data':{'id':_0x546d49[_0x35c222(0x15f)],'type':'folder'}}}),_0x4c71e6;}async function convertYamlStageToApi(_0x64a7,_0x1ba1a6,_0x15939c={},_0x44bbd1={}){const _0x78c49a=a147_0x4b77,_0x64f5fb={'name':_0x64a7['name']};_0x64a7['id']&&(_0x64f5fb['id']=_0x64a7['id']);_0x64a7[_0x78c49a(0x1a8)]&&(_0x64f5fb[_0x78c49a(0x1a8)]=_0x64a7[_0x78c49a(0x1a8)]);_0x64a7[_0x78c49a(0x19e)]&&(_0x64f5fb[_0x78c49a(0x1a7)]=await convertYamlCriteriaToApi(_0x64a7[_0x78c49a(0x19e)],_0x1ba1a6,_0x15939c));_0x64a7[_0x78c49a(0x1e3)]&&_0x64a7[_0x78c49a(0x1e3)]['length']>0x0&&(_0x64f5fb[_0x78c49a(0x204)]=await Promise[_0x78c49a(0x149)](_0x64a7['exit_criteria'][_0x78c49a(0x18b)](_0x28963e=>convertYamlCriteriaToApi(_0x28963e,_0x1ba1a6,_0x15939c))));_0x64a7[_0x78c49a(0x1a2)]&&(_0x64f5fb[_0x78c49a(0x1a2)]=await convertYamlCriteriaToApi(_0x64a7[_0x78c49a(0x1a2)],_0x1ba1a6,_0x15939c));if(_0x64a7['steps']&&_0x64a7[_0x78c49a(0x1ca)][_0x78c49a(0x16c)]>0x0){const _0x9e7fc4={},_0x5e292c=_0x64a7['steps'][_0x78c49a(0x18b)]((_0x2960ef,_0x499122)=>{const _0x5f44ee=_0x2960ef['uuid']||generateUUID(),_0x33dd97=_0x2960ef['name']||_0x2960ef['type']+'_'+_0x499122;return _0x9e7fc4[_0x33dd97]=_0x5f44ee,{..._0x2960ef,'name':_0x33dd97};});_0x64f5fb[_0x78c49a(0x180)]=_0x9e7fc4[_0x5e292c[0x0][_0x78c49a(0x19b)]],_0x64f5fb[_0x78c49a(0x1ca)]={};for(let _0xfcf401=0x0;_0xfcf401<_0x5e292c[_0x78c49a(0x16c)];_0xfcf401++){const _0x3dd239=_0x5e292c[_0xfcf401],_0x554ec2=_0x9e7fc4[_0x3dd239[_0x78c49a(0x19b)]],_0x1a565c=!_0x3dd239[_0x78c49a(0x1a6)]&&_0xfcf401<_0x5e292c[_0x78c49a(0x16c)]-0x1&&_0x3dd239[_0x78c49a(0x178)]!==_0x78c49a(0x1ae)?_0x5e292c[_0xfcf401+0x1][_0x78c49a(0x19b)]:_0x3dd239[_0x78c49a(0x1a6)],_0x3d99b1=_0x1a565c!==_0x3dd239['next']?{..._0x3dd239,'next':_0x1a565c}:_0x3dd239;_0x64f5fb[_0x78c49a(0x1ca)][_0x554ec2]=await convertYamlStepToApi(_0x3d99b1,_0x1ba1a6,_0x15939c,_0x9e7fc4,_0x44bbd1);}}else _0x64a7['root_step']&&(_0x64f5fb[_0x78c49a(0x180)]=_0x64a7[_0x78c49a(0x166)]);return _0x64f5fb;}async function convertYamlCriteriaToApi(_0x24c089,_0xa429c1,_0x35f8c7={}){const _0x300c31=a147_0x4b77;let _0x719a3f=_0x24c089['segment'];if(_0x719a3f&&!/^\d+$/[_0x300c31(0x1dd)](_0x719a3f)){const _0x286e60=parseSegmentRef(_0x719a3f);if(_0x286e60[_0x300c31(0x178)]===_0x300c31(0x1eb))_0xa429c1?.['resolveSegmentId']&&(_0x719a3f=await _0xa429c1[_0x300c31(0x16e)](_0x286e60[_0x300c31(0x19b)]));else{if(_0x286e60[_0x300c31(0x178)]===_0x300c31(0x1db)&&_0x35f8c7[_0x286e60['name']])_0xa429c1?.[_0x300c31(0x1ef)]&&(_0x719a3f=await _0xa429c1[_0x300c31(0x1ef)](_0x286e60[_0x300c31(0x19b)],_0x35f8c7[_0x286e60[_0x300c31(0x19b)]]));else _0xa429c1?.[_0x300c31(0x16e)]&&(_0x719a3f=await _0xa429c1['resolveSegmentId'](_0x286e60[_0x300c31(0x19b)]));}}const _0x10e4ca={'name':_0x24c089[_0x300c31(0x19b)],'segmentId':_0x719a3f};_0x24c089['description']&&(_0x10e4ca[_0x300c31(0x1a8)]=_0x24c089[_0x300c31(0x1a8)]);if(_0x24c089[_0x300c31(0x195)]){const _0x181be2=_0x24c089['target'][_0x300c31(0x1da)],_0x280ec7=_0x24c089['target']['stage'];let _0x509b5e=_0x24c089[_0x300c31(0x195)]['journey'];_0xa429c1?.[_0x300c31(0x1d1)]&&!/^\d+$/['test'](_0x509b5e)&&(_0x509b5e=await _0xa429c1[_0x300c31(0x1d1)](_0x509b5e));let _0x42448a=_0x24c089[_0x300c31(0x195)]['stage'];_0xa429c1?.[_0x300c31(0x1a3)]&&!/^\d+$/[_0x300c31(0x1dd)](_0x42448a)&&(_0x42448a=await _0xa429c1[_0x300c31(0x1a3)](_0x509b5e,_0x42448a));const _0x2a7dd6=!/^\d+$/[_0x300c31(0x1dd)](_0x181be2)&&!isLocalJourneyRef(_0x181be2)?formatApiJourneyName(_0x181be2,_0x280ec7):undefined;_0x10e4ca[_0x300c31(0x195)]={'journeyId':_0x509b5e,'journeyStageId':_0x42448a,'journeyName':_0x2a7dd6,'confirmed':!![]},_0x24c089[_0x300c31(0x195)][_0x300c31(0x148)]&&(_0x10e4ca[_0x300c31(0x195)]['journeyBundleId']=_0x24c089[_0x300c31(0x195)]['bundle_id']);}return _0x10e4ca;}async function convertYamlStepToApi(_0x2bec27,_0x472b85,_0xc4f5a4={},_0x3e9b41={},_0x27adab={}){const _0x3a673b=a147_0x4b77,_0x4c8fe1=async _0x5aa5c6=>{const _0x1b2c80=a147_0x4b77;if(/^\d+$/[_0x1b2c80(0x1dd)](_0x5aa5c6))return _0x5aa5c6;const _0x380e42=parseSegmentRef(_0x5aa5c6);if(_0x380e42[_0x1b2c80(0x178)]===_0x1b2c80(0x1eb)){if(_0x472b85?.['resolveSegmentId'])return await _0x472b85[_0x1b2c80(0x16e)](_0x380e42[_0x1b2c80(0x19b)]);}else{if(_0x380e42[_0x1b2c80(0x178)]===_0x1b2c80(0x1db)&&_0xc4f5a4[_0x380e42[_0x1b2c80(0x19b)]]){if(_0x472b85?.[_0x1b2c80(0x1ef)])return await _0x472b85[_0x1b2c80(0x1ef)](_0x380e42[_0x1b2c80(0x19b)],_0xc4f5a4[_0x380e42[_0x1b2c80(0x19b)]]);}else{if(_0x472b85?.[_0x1b2c80(0x16e)])return await _0x472b85['resolveSegmentId'](_0x380e42[_0x1b2c80(0x19b)]);}}return _0x5aa5c6;},_0x2317a8=async _0x5e8efe=>{const _0x1513c7=a147_0x4b77;if(/^\d+$/['test'](_0x5e8efe))return _0x5e8efe;const _0x31f401=parseSegmentRef(_0x5e8efe);if(_0x31f401[_0x1513c7(0x178)]===_0x1513c7(0x1eb)){if(_0x472b85?.[_0x1513c7(0x1f6)])return await _0x472b85['resolveActivationId'](_0x31f401['name']);return _0x31f401[_0x1513c7(0x19b)];}else{if(_0x31f401['type']==='embedded'&&_0x27adab[_0x31f401[_0x1513c7(0x19b)]]){if(_0x472b85?.[_0x1513c7(0x1d7)])return await _0x472b85[_0x1513c7(0x1d7)](_0x31f401[_0x1513c7(0x19b)],_0x27adab[_0x31f401['name']]);if(_0x472b85?.[_0x1513c7(0x1f6)])return await _0x472b85[_0x1513c7(0x1f6)](_0x31f401[_0x1513c7(0x19b)]);}else{if(_0x472b85?.[_0x1513c7(0x1f6)])return await _0x472b85[_0x1513c7(0x1f6)](_0x31f401['name']);}}return _0x5e8efe;},_0x2b289b=_0x2a0f27=>{const _0x4b41bc=a147_0x4b77;if(!_0x2a0f27)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x4b41bc(0x1dd)](_0x2a0f27))return _0x2a0f27;return _0x3e9b41[_0x2a0f27]||_0x2a0f27;};switch(_0x2bec27['type']){case _0x3a673b(0x1c0):{const _0x2e3c7f=_0x2bec27,_0x2e54ee=_0x2e3c7f[_0x3a673b(0x197)],_0xeb5b43={'type':_0x3a673b(0x1c2),'name':_0x2e3c7f[_0x3a673b(0x19b)],'next':_0x2b289b(_0x2e3c7f[_0x3a673b(0x1a6)])};if(_0x2e54ee['duration']!==undefined&&_0x2e54ee[_0x3a673b(0x1b9)])_0xeb5b43[_0x3a673b(0x1fc)]=_0x3a673b(0x1c3),_0xeb5b43[_0x3a673b(0x14f)]=_0x2e54ee[_0x3a673b(0x156)],_0xeb5b43[_0x3a673b(0x1d8)]=normalizeWaitUnit(_0x2e54ee[_0x3a673b(0x1b9)]);else{if(_0x2e54ee[_0x3a673b(0x206)])_0xeb5b43[_0x3a673b(0x1fc)]=_0x3a673b(0x18f),_0xeb5b43[_0x3a673b(0x150)]=_0x2e54ee[_0x3a673b(0x206)];else{if(_0x2e54ee[_0x3a673b(0x190)])_0xeb5b43[_0x3a673b(0x1fc)]=_0x3a673b(0x1fd),_0xeb5b43[_0x3a673b(0x17c)]=_0x2e54ee['days_of_week'];else{if(_0x2e54ee[_0x3a673b(0x17a)]){_0xeb5b43[_0x3a673b(0x1fc)]=_0x3a673b(0x1bf);const _0x474261=await _0x4c8fe1(_0x2e54ee[_0x3a673b(0x17a)]['segment']),_0x2a3a5a=_0x2e54ee[_0x3a673b(0x17a)][_0x3a673b(0x157)]?.[_0x3a673b(0x1a6)]!==undefined;if(_0x2a3a5a){const _0x2ec47b=[];_0x2ec47b['push']({'id':generateUUID(),'segmentId':_0x474261,'timedOutPath':![],'name':'Met\x20condition(s)','next':_0x2b289b(_0x2e54ee[_0x3a673b(0x17a)][_0x3a673b(0x1a6)]??_0x2e3c7f[_0x3a673b(0x1a6)])});if(_0x2e54ee['condition'][_0x3a673b(0x157)]){const _0x342d0a=_0x2e54ee[_0x3a673b(0x17a)][_0x3a673b(0x157)][_0x3a673b(0x156)],_0x16718a=normalizeWaitUnit(_0x2e54ee[_0x3a673b(0x17a)][_0x3a673b(0x157)][_0x3a673b(0x1b9)]);_0x2ec47b[_0x3a673b(0x1cd)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x3a673b(0x153)+_0x342d0a+'\x20'+_0x16718a,'moveAfter':_0x342d0a,'unit':_0x16718a,'next':_0x2b289b(_0x2e54ee[_0x3a673b(0x17a)][_0x3a673b(0x157)][_0x3a673b(0x1a6)])});}_0xeb5b43[_0x3a673b(0x177)]=_0x2ec47b,delete _0xeb5b43[_0x3a673b(0x1a6)];}else _0xeb5b43['conditionSegmentId']=_0x474261,_0x2e54ee[_0x3a673b(0x17a)][_0x3a673b(0x157)]&&(_0xeb5b43[_0x3a673b(0x16d)]=_0x2e54ee[_0x3a673b(0x17a)][_0x3a673b(0x157)][_0x3a673b(0x156)],_0x2e54ee[_0x3a673b(0x17a)][_0x3a673b(0x157)][_0x3a673b(0x1b9)]&&(_0xeb5b43[_0x3a673b(0x196)]=normalizeWaitUnit(_0x2e54ee[_0x3a673b(0x17a)]['timeout']['unit'])));}}}}return _0xeb5b43;}case _0x3a673b(0x1b0):{const _0x2f3969=_0x2bec27,_0x30c750=_0x2f3969['with'][_0x3a673b(0x1b0)],_0x29dacf=await _0x2317a8(_0x30c750);return{'type':_0x3a673b(0x1b8),'name':_0x2f3969['name'],'journeyActivationStepId':_0x29dacf,'next':_0x2b289b(_0x2f3969[_0x3a673b(0x1a6)])};}case _0x3a673b(0x173):{const _0x5a33d4=_0x2bec27,_0x578a2c=_0x5a33d4[_0x3a673b(0x197)][_0x3a673b(0x1be)];return{'type':_0x3a673b(0x1f1),'name':_0x5a33d4[_0x3a673b(0x19b)],'branches':await Promise['all'](_0x578a2c[_0x3a673b(0x18b)](async _0x30e49a=>{const _0x2f6621=_0x3a673b;let _0x528d0e='';if(!_0x30e49a[_0x2f6621(0x16b)]){const _0x3ad03e=_0x30e49a[_0x2f6621(0x1bb)]||_0x30e49a[_0x2f6621(0x15e)]||'';_0x528d0e=_0x3ad03e?await _0x4c8fe1(_0x3ad03e):'';}return{'id':crypto[_0x2f6621(0x1bc)](),'name':_0x30e49a[_0x2f6621(0x19b)],'description':null,'segmentId':_0x528d0e,'excludedPath':_0x30e49a[_0x2f6621(0x16b)]??![],'next':_0x2b289b(_0x30e49a[_0x2f6621(0x1a6)])};})),'next':_0x2b289b(_0x5a33d4[_0x3a673b(0x1a6)])};}case _0x3a673b(0x18d):{const _0x576080=_0x2bec27,_0x595dd4=_0x576080['with'];return{'type':'ABTest','name':_0x576080[_0x3a673b(0x19b)],'customizedSplit':_0x595dd4[_0x3a673b(0x170)],'uniqueId':_0x595dd4[_0x3a673b(0x168)],'variants':_0x595dd4[_0x3a673b(0x1e0)][_0x3a673b(0x18b)](_0x4beaf7=>({'id':_0x4beaf7['id']||generateUUID(),'name':_0x4beaf7[_0x3a673b(0x19b)],'percentage':_0x4beaf7[_0x3a673b(0x1f5)],'next':_0x2b289b(_0x4beaf7[_0x3a673b(0x1a6)])})),'next':_0x2b289b(_0x576080[_0x3a673b(0x1a6)])};}case'merge':return{'type':_0x3a673b(0x175),'name':_0x2bec27[_0x3a673b(0x19b)],'next':_0x2b289b(_0x2bec27[_0x3a673b(0x1a6)])};case'jump':{const _0xee23f=_0x2bec27,_0x32bb5f=_0xee23f[_0x3a673b(0x197)][_0x3a673b(0x195)],_0x33c42b=_0x32bb5f['journey'],_0x284255=_0x32bb5f[_0x3a673b(0x1ce)];let _0x57fef1=_0x32bb5f[_0x3a673b(0x1da)];_0x472b85?.[_0x3a673b(0x1d1)]&&!/^\d+$/['test'](_0x57fef1)&&(_0x57fef1=await _0x472b85[_0x3a673b(0x1d1)](_0x57fef1));let _0x2aac07=_0x32bb5f[_0x3a673b(0x1ce)];_0x472b85?.[_0x3a673b(0x1a3)]&&!/^\d+$/['test'](_0x2aac07)&&(_0x2aac07=await _0x472b85[_0x3a673b(0x1a3)](_0x57fef1,_0x2aac07));const _0x4bae5a=!/^\d+$/[_0x3a673b(0x1dd)](_0x33c42b)&&!isLocalJourneyRef(_0x33c42b)?formatApiJourneyName(_0x33c42b,_0x284255):undefined;return{'type':_0x3a673b(0x1a4),'name':_0xee23f['name'],'target':{'journeyId':_0x57fef1,'journeyStageId':_0x2aac07,'journeyBundleId':_0x32bb5f[_0x3a673b(0x148)],'journeyName':_0x4bae5a,'confirmed':!![]},'next':_0x2b289b(_0xee23f['next'])};}case _0x3a673b(0x1ae):return{'type':_0x3a673b(0x171),'name':_0x2bec27[_0x3a673b(0x19b)]};default:{const _0x3c0024=_0x2bec27;return{'type':_0x3a673b(0x171),'name':_0x3c0024[_0x3a673b(0x19b)]};}}}export function toYamlString(_0x59bf9b){const _0x106e61=a147_0x4b77,_0x206e23=stripInternalFields(_0x59bf9b),_0x53e05a=a147_0x5aff14[_0x106e61(0x1b3)](_0x206e23,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x106e61(0x1e7)}),_0x4fe337=['segments:',_0x106e61(0x17d),_0x106e61(0x1e9),_0x106e61(0x1e2),_0x106e61(0x1a1),_0x106e61(0x160),_0x106e61(0x147)];let _0x1e6deb=_0x53e05a;for(const _0x2c859d of _0x4fe337){_0x1e6deb=_0x1e6deb['replace'](new RegExp('^('+_0x2c859d+')','m'),(_0x20d29e,_0x16006d,_0x541c65)=>{if(_0x541c65===0x0||_0x1e6deb[_0x541c65-0x1]==='\x0a'&&_0x1e6deb[_0x541c65-0x2]==='\x0a')return _0x16006d;return'\x0a'+_0x16006d;});}return _0x1e6deb;}function a147_0x4b77(_0x1d78e9,_0x30d224){_0x1d78e9=_0x1d78e9-0x146;const _0x565192=a147_0x5651();let _0x4b77db=_0x565192[_0x1d78e9];return _0x4b77db;}function stripInternalFields(_0xe5c757){const _0x28f1a9=a147_0x4b77,{id:_0x51c45e,folder_id:_0x3f5466,bundle_id:_0x28acb8,bundle_name:_0x14318b,version:_0x185952,allow_reentry:_0x5b839f,..._0x39550d}=_0xe5c757;return _0x39550d[_0x28f1a9(0x1d6)]&&(_0x39550d[_0x28f1a9(0x1d6)]=_0x39550d[_0x28f1a9(0x1d6)][_0x28f1a9(0x18b)](_0x32cbc2=>{const _0x149456=_0x28f1a9,{id:_0x4bf769,..._0x42c42d}=_0x32cbc2;return{..._0x42c42d,'stages':_0x42c42d[_0x149456(0x1d2)][_0x149456(0x18b)](stripStageInternalFields),..._0x32cbc2[_0x149456(0x17e)]===!![]?{'latest':!![]}:{},..._0x39550d[_0x149456(0x1d6)][_0x149456(0x16c)]===0x1&&_0x42c42d[_0x149456(0x1d3)]==='v1'?{'version':undefined}:{}};})),_0x39550d[_0x28f1a9(0x1d2)]&&(_0x39550d[_0x28f1a9(0x1d2)]=_0x39550d[_0x28f1a9(0x1d2)][_0x28f1a9(0x18b)](stripStageInternalFields)),_0x39550d[_0x28f1a9(0x19d)]&&(_0x39550d[_0x28f1a9(0x19d)]=_0x39550d[_0x28f1a9(0x19d)]['map'](_0x200b5c=>{const _0x15f00d=_0x28f1a9,{id:_0x31e614,..._0x4b0013}=_0x200b5c;return{..._0x4b0013,'stages':_0x4b0013[_0x15f00d(0x1d2)]['map'](stripStageInternalFields),..._0x200b5c['latest']===!![]?{'latest':!![]}:{}};})),_0x39550d;}function stripStageInternalFields(_0x1e89b7){const {id:_0x37649a,..._0x88c871}=_0x1e89b7;return _0x88c871;}export function parseYamlString(_0x2c0ed7){return safeParseYaml(_0x2c0ed7,JourneyDefSchema);}export function isJourneyDef(_0x25e8ce){const _0x479164=a147_0x4b77;return typeof _0x25e8ce===_0x479164(0x203)&&_0x25e8ce!==null&&_0x479164(0x178)in _0x25e8ce&&_0x25e8ce[_0x479164(0x178)]==='journey';}export function generateTemplate(_0x5651e9,_0x3fd869){const _0xed7245=a147_0x4b77,_0x52fc39={'type':_0xed7245(0x1da),'name':_0x5651e9,'description':_0xed7245(0x1aa),'reentry':'no_reentry','goal':{'name':'Goal\x20Achieved','segment':_0xed7245(0x17b)},'stages':[{'name':'Stage\x201','description':_0xed7245(0x1e1),'entry_criteria':{'name':'Entry\x20Criteria','segment':_0x3fd869},'steps':[{'type':_0xed7245(0x1c0),'name':_0xed7245(0x1c9),'with':{'duration':0x1,'unit':'day'}},{'type':'activation','name':_0xed7245(0x14b),'with':{'activation':_0xed7245(0x194)}},{'type':'end','name':'Stage\x20Complete'}]}]};return toYamlString(_0x52fc39);}function generateUUID(){return crypto['randomUUID']();}export const SEGMENT_REF_PREFIX=a147_0x72352b(0x16f);export function parseSegmentRef(_0x4d397e){const _0x4c8704=a147_0x72352b;if(_0x4d397e[_0x4c8704(0x1fb)](SEGMENT_REF_PREFIX))return{'type':_0x4c8704(0x1eb),'name':_0x4d397e[_0x4c8704(0x1cb)](SEGMENT_REF_PREFIX[_0x4c8704(0x16c)])};if(/^\d+$/[_0x4c8704(0x1dd)](_0x4d397e))return{'type':'id','name':_0x4d397e};return{'type':_0x4c8704(0x1db),'name':_0x4d397e};}export function makeSegmentRef(_0x264c09){return''+SEGMENT_REF_PREFIX+_0x264c09;}export function isExternalSegmentRef(_0x193ab3){return _0x193ab3['startsWith'](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x2f9af6){const _0x3c331d=a147_0x72352b;return!!(_0x2f9af6[_0x3c331d(0x1d6)]&&_0x2f9af6[_0x3c331d(0x1d6)][_0x3c331d(0x16c)]>0x0);}export function isMultiVersionMode(_0x54675c){const _0x1500c6=a147_0x72352b;return!!(_0x54675c['versions']&&_0x54675c[_0x1500c6(0x19d)][_0x1500c6(0x16c)]>0x0);}export function isSingleVersionMode(_0xa820de){const _0x3175b3=a147_0x72352b;return!!(_0xa820de[_0x3175b3(0x1d2)]&&_0xa820de[_0x3175b3(0x1d2)][_0x3175b3(0x16c)]>0x0);}export function hasMultipleVersions(_0x316ce8){const _0xb4d315=a147_0x72352b;if(isJourneysArrayMode(_0x316ce8))return(_0x316ce8[_0xb4d315(0x1d6)]?.['length']||0x0)>0x1;if(isMultiVersionMode(_0x316ce8))return(_0x316ce8[_0xb4d315(0x19d)]?.[_0xb4d315(0x16c)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x4f1c73){const _0x319f74=a147_0x72352b;if(isJourneysArrayMode(_0x4f1c73))return _0x4f1c73;if(isSingleVersionMode(_0x4f1c73)){const {stages:_0x2c0abf,id:_0x1c422b,version:_0x4c8978,version_number:_0x5b002a,..._0x3abd04}=_0x4f1c73;return{..._0x3abd04,'journeys':[{'version':_0x4c8978||'v1','stages':_0x2c0abf||[],'id':_0x1c422b,'version_number':_0x5b002a}]};}if(isMultiVersionMode(_0x4f1c73)){const {versions:_0x5a0f89,..._0x187ad6}=_0x4f1c73;return{..._0x187ad6,'journeys':(_0x5a0f89||[])[_0x319f74(0x18b)](_0x793e5c=>({'version':_0x793e5c[_0x319f74(0x19b)],'state':_0x793e5c[_0x319f74(0x1ec)],'latest':_0x793e5c[_0x319f74(0x17e)],'stages':_0x793e5c[_0x319f74(0x1d2)],'id':_0x793e5c['id'],'version_number':_0x793e5c['version_number']}))};}return _0x4f1c73;}export function normalizeJourneyDef(_0x43c9ee,_0x7016b9){const _0x246fdd=a147_0x72352b,_0x4fb635=normalizeToJourneysFormat(_0x43c9ee),_0x57016f=_0x7016b9?.[_0x246fdd(0x1e4)]?Object[_0x246fdd(0x1ff)](_0x7016b9[_0x246fdd(0x1e4)]):undefined,_0x363f5b=_0x7016b9?.[_0x246fdd(0x16a)]?Object['keys'](_0x7016b9[_0x246fdd(0x16a)]):undefined;return{'type':_0x246fdd(0x1da),'name':_0x4fb635[_0x246fdd(0x19b)],..._0x4fb635[_0x246fdd(0x1a8)]!==undefined&&{'description':_0x4fb635['description']},..._0x4fb635[_0x246fdd(0x202)]&&{'goal':normalizeJourneyCriteria(_0x4fb635['goal'])},..._0x4fb635[_0x246fdd(0x193)]!==undefined&&{'reentry':_0x4fb635[_0x246fdd(0x193)]},..._0x4fb635[_0x246fdd(0x1e4)]&&{'segments':normalizeEmbeddedSegments(_0x4fb635[_0x246fdd(0x1e4)],_0x57016f)},..._0x4fb635[_0x246fdd(0x16a)]&&{'activations':normalizeEmbeddedActivations(_0x4fb635[_0x246fdd(0x16a)],_0x363f5b)},..._0x4fb635[_0x246fdd(0x1d6)]&&{'journeys':_0x4fb635[_0x246fdd(0x1d6)][_0x246fdd(0x18b)](_0x320ba2=>normalizeJourneyEntry(_0x320ba2,_0x4fb635[_0x246fdd(0x1d6)]['length']===0x1))}};}function normalizeJourneyEntry(_0x57cac3,_0x4c72be){const _0x1e089d=a147_0x72352b;return{...!_0x4c72be&&_0x57cac3[_0x1e089d(0x1d3)]!==undefined&&{'version':_0x57cac3['version']},..._0x57cac3[_0x1e089d(0x1ec)]!==undefined&&{'state':_0x57cac3[_0x1e089d(0x1ec)]},...!_0x4c72be&&_0x57cac3['latest']!==undefined&&{'latest':_0x57cac3['latest']},..._0x57cac3['version_number']!==undefined&&{'version_number':_0x57cac3[_0x1e089d(0x1f8)]},..._0x57cac3['goal']&&{'goal':normalizeJourneyCriteria(_0x57cac3[_0x1e089d(0x202)])},..._0x57cac3['reentry']!==undefined&&{'reentry':_0x57cac3[_0x1e089d(0x193)]},'stages':_0x57cac3[_0x1e089d(0x1d2)][_0x1e089d(0x18b)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x5dd0d1){const _0x18d177=a147_0x72352b;return{'name':_0x5dd0d1['name'],..._0x5dd0d1[_0x18d177(0x1a8)]!==undefined&&{'description':_0x5dd0d1['description']},..._0x5dd0d1[_0x18d177(0x19e)]&&{'entry_criteria':normalizeJourneyCriteria(_0x5dd0d1[_0x18d177(0x19e)])},..._0x5dd0d1[_0x18d177(0x1e3)]&&{'exit_criteria':_0x5dd0d1[_0x18d177(0x1e3)][_0x18d177(0x18b)](normalizeJourneyCriteria)},..._0x5dd0d1['milestone']&&{'milestone':normalizeJourneyCriteria(_0x5dd0d1[_0x18d177(0x1a2)])},..._0x5dd0d1[_0x18d177(0x1ca)]&&{'steps':normalizeStepsWithImplicitNext(_0x5dd0d1[_0x18d177(0x1ca)])}};}function normalizeStepsWithImplicitNext(_0x3a3842){const _0x436760=a147_0x72352b;return _0x3a3842[_0x436760(0x18b)]((_0x511336,_0xfa9e3c)=>{const _0x217cf9=_0x436760,_0x39159d=_0xfa9e3c<_0x3a3842[_0x217cf9(0x16c)]-0x1?_0x3a3842[_0xfa9e3c+0x1][_0x217cf9(0x19b)]:undefined;return normalizeJourneyStep(_0x511336,_0x39159d);});}function normalizeJourneyCriteria(_0x4fe2d7){const _0x1ec979=a147_0x72352b;return{'name':_0x4fe2d7['name'],..._0x4fe2d7[_0x1ec979(0x1a8)]!==undefined&&{'description':_0x4fe2d7[_0x1ec979(0x1a8)]},'segment':_0x4fe2d7['segment'],..._0x4fe2d7['target']&&{'target':normalizeJumpTarget(_0x4fe2d7[_0x1ec979(0x195)])}};}function normalizeJourneyStep(_0x265b1d,_0x2df744){const _0x471f38=a147_0x72352b,_0x357b46=_0x265b1d[_0x471f38(0x1a6)]!==undefined&&_0x265b1d[_0x471f38(0x1a6)]!==_0x2df744,_0x40f8d5={'type':_0x265b1d[_0x471f38(0x178)],'name':_0x265b1d['name'],..._0x357b46&&{'next':_0x265b1d[_0x471f38(0x1a6)]}};if(_0x471f38(0x197)in _0x265b1d&&_0x265b1d[_0x471f38(0x197)])return{..._0x40f8d5,'with':normalizeStepParams(_0x265b1d[_0x471f38(0x178)],_0x265b1d['with'])};return _0x40f8d5;}function normalizeStepParams(_0x167d06,_0x8e8358){const _0x1a44f9=a147_0x72352b;switch(_0x167d06){case'wait':{const _0x41fed4=_0x8e8358;let _0x2da4d8;return _0x41fed4['condition']&&(_0x2da4d8={'segment':_0x41fed4[_0x1a44f9(0x17a)][_0x1a44f9(0x1bb)],..._0x41fed4[_0x1a44f9(0x17a)][_0x1a44f9(0x1a6)]!==undefined&&{'next':_0x41fed4[_0x1a44f9(0x17a)][_0x1a44f9(0x1a6)]},..._0x41fed4['condition'][_0x1a44f9(0x157)]&&{'timeout':{'duration':_0x41fed4[_0x1a44f9(0x17a)]['timeout']['duration'],'unit':_0x41fed4[_0x1a44f9(0x17a)][_0x1a44f9(0x157)][_0x1a44f9(0x1b9)],..._0x41fed4[_0x1a44f9(0x17a)][_0x1a44f9(0x157)][_0x1a44f9(0x1a6)]!==undefined&&{'next':_0x41fed4[_0x1a44f9(0x17a)][_0x1a44f9(0x157)][_0x1a44f9(0x1a6)]}}}}),{..._0x41fed4['duration']!==undefined&&{'duration':_0x41fed4['duration']},..._0x41fed4['unit']!==undefined&&{'unit':_0x41fed4[_0x1a44f9(0x1b9)]},..._0x41fed4['wait_until']!==undefined&&{'wait_until':_0x41fed4[_0x1a44f9(0x206)]},..._0x41fed4[_0x1a44f9(0x190)]!==undefined&&{'days_of_week':_0x41fed4[_0x1a44f9(0x190)]},..._0x2da4d8&&{'condition':_0x2da4d8}};}case'activation':{const _0x4dae4c=_0x8e8358;return{'activation':_0x4dae4c[_0x1a44f9(0x1b0)]};}case _0x1a44f9(0x173):{const _0x431e85=_0x8e8358;return{'branches':_0x431e85['branches'][_0x1a44f9(0x18b)](normalizeDecisionBranch)};}case'ab_test':{const _0x5cdfad=_0x8e8358;return{..._0x5cdfad[_0x1a44f9(0x170)]!==undefined&&{'customized_split':_0x5cdfad[_0x1a44f9(0x170)]},..._0x5cdfad['unique_id']!==undefined&&{'unique_id':_0x5cdfad[_0x1a44f9(0x168)]},'variants':_0x5cdfad['variants']['map'](normalizeAbTestVariant)};}case'jump':{const _0x2258b1=_0x8e8358;return{'target':normalizeJumpTarget(_0x2258b1[_0x1a44f9(0x195)])};}default:return _0x8e8358;}}function normalizeDecisionBranch(_0x3cb6a2){const _0x438402=a147_0x72352b;return{'name':_0x3cb6a2[_0x438402(0x19b)],..._0x3cb6a2[_0x438402(0x1bb)]!==undefined&&{'segment':_0x3cb6a2[_0x438402(0x1bb)]},..._0x3cb6a2[_0x438402(0x16b)]!==undefined&&{'excluded':_0x3cb6a2[_0x438402(0x16b)]},..._0x3cb6a2[_0x438402(0x1a6)]!==undefined&&{'next':_0x3cb6a2['next']}};}function normalizeAbTestVariant(_0x22cb22){const _0x3ab51e=a147_0x72352b;return{..._0x22cb22['id']!==undefined&&{'id':_0x22cb22['id']},'name':_0x22cb22[_0x3ab51e(0x19b)],'percentage':_0x22cb22[_0x3ab51e(0x1f5)],..._0x22cb22['next']!==undefined&&{'next':_0x22cb22['next']}};}function normalizeJumpTarget(_0x20e972){const _0x3310e7=a147_0x72352b;return{'journey':_0x20e972[_0x3310e7(0x1da)],'stage':_0x20e972[_0x3310e7(0x1ce)],..._0x20e972[_0x3310e7(0x148)]!==undefined&&{'bundle_id':_0x20e972['bundle_id']}};}function normalizeEmbeddedSegments(_0xaab9c0,_0x8942c9){const _0x4af4f0=a147_0x72352b,_0x4deea3={},_0x1938ef=Object[_0x4af4f0(0x1ff)](_0xaab9c0),_0x2150e1=_0x8942c9?[..._0x8942c9[_0x4af4f0(0x169)](_0x116240=>_0x1938ef[_0x4af4f0(0x182)](_0x116240)),..._0x1938ef[_0x4af4f0(0x169)](_0x36e2a7=>!_0x8942c9[_0x4af4f0(0x182)](_0x36e2a7))[_0x4af4f0(0x1ab)]()]:_0x1938ef[_0x4af4f0(0x1ab)]();for(const _0x41d3e3 of _0x2150e1){const _0x443c4b=_0xaab9c0[_0x41d3e3];if(_0x443c4b[_0x4af4f0(0x209)]){const _0x3138de=_0x443c4b[_0x4af4f0(0x209)];if(_0x3138de[_0x4af4f0(0x178)]!==_0x4af4f0(0x1f2)&&_0x3138de['type']!=='Or'){const _0x457b92=_0x3138de[_0x4af4f0(0x178)]??_0x4af4f0(0x1c6);throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x4af4f0(0x187)+_0x41d3e3+_0x4af4f0(0x165)+(_0x4af4f0(0x1cf)+_0x457b92+_0x4af4f0(0x179))+_0x4af4f0(0x192)+_0x4af4f0(0x1b2)+_0x4af4f0(0x14a)+'\x20\x20\x20\x20conditions:\x0a'+_0x4af4f0(0x167)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x4af4f0(0x184));}if(!_0x3138de[_0x4af4f0(0x177)]||!Array[_0x4af4f0(0x1fa)](_0x3138de['conditions']))throw new SDKError(ErrorCode[_0x4af4f0(0x172)],_0x4af4f0(0x187)+_0x41d3e3+_0x4af4f0(0x165)+_0x4af4f0(0x1a5)+_0x4af4f0(0x192)+_0x4af4f0(0x1b2)+(_0x4af4f0(0x1c8)+_0x3138de[_0x4af4f0(0x178)]+'\x0a')+'\x20\x20\x20\x20conditions:\x0a'+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x4af4f0(0x1d4)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}_0x4deea3[_0x41d3e3]={..._0x443c4b[_0x4af4f0(0x1a8)]&&_0x443c4b[_0x4af4f0(0x1a8)][_0x4af4f0(0x159)]()&&{'description':_0x443c4b['description']},..._0x443c4b['rule']&&{'rule':deepSortObject(_0x443c4b[_0x4af4f0(0x209)])}};}return _0x4deea3;}function normalizeEmbeddedActivations(_0x1a364c,_0x47ce73){const _0x3aee1e=a147_0x72352b,_0xe243be={},_0x58f8ca=Object['keys'](_0x1a364c),_0x3339c8=_0x47ce73?[..._0x47ce73[_0x3aee1e(0x169)](_0x4e705d=>_0x58f8ca[_0x3aee1e(0x182)](_0x4e705d)),..._0x58f8ca[_0x3aee1e(0x169)](_0x7c63c4=>!_0x47ce73['includes'](_0x7c63c4))[_0x3aee1e(0x1ab)]()]:_0x58f8ca[_0x3aee1e(0x1ab)]();for(const _0x8cce30 of _0x3339c8){const _0x36add8=_0x1a364c[_0x8cce30];_0xe243be[_0x8cce30]={'name':_0x36add8[_0x3aee1e(0x19b)],'connection':_0x36add8[_0x3aee1e(0x1ba)],..._0x36add8[_0x3aee1e(0x1a8)]!==undefined&&{'description':_0x36add8[_0x3aee1e(0x1a8)]},..._0x36add8[_0x3aee1e(0x154)]!==undefined&&{'all_columns':_0x36add8[_0x3aee1e(0x154)]},..._0x36add8[_0x3aee1e(0x1c7)]!==undefined&&{'columns':_0x36add8[_0x3aee1e(0x1c7)]},..._0x36add8[_0x3aee1e(0x1bd)]!==undefined&&{'behavior':_0x36add8[_0x3aee1e(0x1bd)]},..._0x36add8[_0x3aee1e(0x201)]!==undefined&&{'schedule':_0x36add8[_0x3aee1e(0x201)]},..._0x36add8[_0x3aee1e(0x1dc)]!==undefined&&{'notification':_0x36add8[_0x3aee1e(0x1dc)]},..._0x36add8[_0x3aee1e(0x14d)]!==undefined&&{'connector_config':_0x36add8[_0x3aee1e(0x14d)]},..._0x36add8[_0x3aee1e(0x1fe)]!==undefined&&{'activation_template_id':_0x36add8['activation_template_id']}};}return _0xe243be;}export function getActiveStages(_0x33dd1b){const _0x4b055a=a147_0x72352b;if(isJourneysArrayMode(_0x33dd1b)){const _0x2eec3e=_0x33dd1b[_0x4b055a(0x1d6)]||[],_0x44f2fe=_0x2eec3e['find'](_0x316c4f=>_0x316c4f[_0x4b055a(0x17e)]===!![])||_0x2eec3e[0x0];return _0x44f2fe?.[_0x4b055a(0x1d2)]||[];}if(isSingleVersionMode(_0x33dd1b))return _0x33dd1b[_0x4b055a(0x1d2)]||[];if(isMultiVersionMode(_0x33dd1b)){const _0x21fd15=_0x33dd1b[_0x4b055a(0x19d)]||[],_0x3f4a53=_0x21fd15[_0x4b055a(0x15d)](_0x530dd5=>_0x530dd5[_0x4b055a(0x17e)]===!![])||_0x21fd15[0x0];return _0x3f4a53?.['stages']||[];}return[];}export function getLatestJourneyEntry(_0x495040){const _0xdba6e8=a147_0x72352b;if(isJourneysArrayMode(_0x495040)){const _0x1be101=_0x495040[_0xdba6e8(0x1d6)]||[];return _0x1be101[_0xdba6e8(0x15d)](_0x11d6b7=>_0x11d6b7[_0xdba6e8(0x17e)]===!![])||_0x1be101[0x0];}if(isMultiVersionMode(_0x495040)){const _0x10f867=_0x495040['versions']||[],_0x40a130=_0x10f867[_0xdba6e8(0x15d)](_0x38a56c=>_0x38a56c[_0xdba6e8(0x17e)]===!![])||_0x10f867[0x0];if(_0x40a130)return{'version':_0x40a130[_0xdba6e8(0x19b)],'state':_0x40a130[_0xdba6e8(0x1ec)],'latest':_0x40a130[_0xdba6e8(0x17e)],'stages':_0x40a130['stages'],'id':_0x40a130['id'],'version_number':_0x40a130[_0xdba6e8(0x1f8)]};}if(isSingleVersionMode(_0x495040))return{'version':_0x495040[_0xdba6e8(0x1d3)]||'v1','state':_0xdba6e8(0x185),'stages':_0x495040[_0xdba6e8(0x1d2)]||[],'id':_0x495040['id'],'version_number':_0x495040[_0xdba6e8(0x1f8)],'goal':_0x495040['goal'],'reentry':_0x495040[_0xdba6e8(0x193)]};return undefined;}export function getLatestVersion(_0x1abf8a){const _0xf8edff=a147_0x72352b;if(!isMultiVersionMode(_0x1abf8a))return undefined;const _0x2d22e1=_0x1abf8a[_0xf8edff(0x19d)]||[];return _0x2d22e1[_0xf8edff(0x15d)](_0x327733=>_0x327733[_0xf8edff(0x17e)]===!![])||_0x2d22e1[0x0];}export function getEffectiveGoal(_0x12d768){const _0x459e61=a147_0x72352b,_0x2be74c=getLatestJourneyEntry(_0x12d768);return _0x2be74c?.[_0x459e61(0x202)]||_0x12d768[_0x459e61(0x202)];}export function getEffectiveReentry(_0x322fb9){const _0x1edd72=a147_0x72352b,_0x594093=getLatestJourneyEntry(_0x322fb9);return _0x594093?.[_0x1edd72(0x193)]||_0x322fb9['reentry'];}export function collectSegmentRefs(_0x37f996){const _0x5c6bdd=a147_0x72352b,_0x6af90a=new Set();_0x37f996[_0x5c6bdd(0x202)]?.[_0x5c6bdd(0x1bb)]&&_0x6af90a[_0x5c6bdd(0x161)](_0x37f996[_0x5c6bdd(0x202)][_0x5c6bdd(0x1bb)]);const _0x4a5ddd=_0x30a46d=>{const _0x45a06d=_0x5c6bdd;for(const _0x31d7c4 of _0x30a46d){_0x31d7c4['entry_criteria']?.[_0x45a06d(0x1bb)]&&_0x6af90a[_0x45a06d(0x161)](_0x31d7c4[_0x45a06d(0x19e)][_0x45a06d(0x1bb)]);if(_0x31d7c4[_0x45a06d(0x1e3)])for(const _0x2ba564 of _0x31d7c4['exit_criteria']){_0x2ba564['segment']&&_0x6af90a[_0x45a06d(0x161)](_0x2ba564[_0x45a06d(0x1bb)]);}_0x31d7c4[_0x45a06d(0x1a2)]?.[_0x45a06d(0x1bb)]&&_0x6af90a['add'](_0x31d7c4[_0x45a06d(0x1a2)]['segment']);if(_0x31d7c4[_0x45a06d(0x1ca)])for(const _0x1c8338 of _0x31d7c4[_0x45a06d(0x1ca)]){if(_0x1c8338[_0x45a06d(0x178)]==='decision_point'){const _0x29fa9c=_0x1c8338;for(const _0x4db29b of _0x29fa9c[_0x45a06d(0x197)][_0x45a06d(0x1be)]){_0x4db29b[_0x45a06d(0x1bb)]&&_0x6af90a[_0x45a06d(0x161)](_0x4db29b[_0x45a06d(0x1bb)]);}}else{if(_0x1c8338[_0x45a06d(0x178)]===_0x45a06d(0x1c0)){const _0x4309c9=_0x1c8338;_0x4309c9[_0x45a06d(0x197)]['condition']?.['segment']&&_0x6af90a[_0x45a06d(0x161)](_0x4309c9[_0x45a06d(0x197)][_0x45a06d(0x17a)][_0x45a06d(0x1bb)]);}}}}};_0x37f996[_0x5c6bdd(0x1d2)]&&_0x4a5ddd(_0x37f996[_0x5c6bdd(0x1d2)]);if(_0x37f996[_0x5c6bdd(0x19d)])for(const _0xd99076 of _0x37f996['versions']){_0x4a5ddd(_0xd99076[_0x5c6bdd(0x1d2)]);}return _0x6af90a;}export function validateSegmentRefs(_0x236904){const _0x4473b2=a147_0x72352b,_0x4f0bcf=[],_0x29145a=collectSegmentRefs(_0x236904),_0x40c3d3=new Set(Object[_0x4473b2(0x1ff)](_0x236904[_0x4473b2(0x1e4)]||{}));for(const _0x5b8669 of _0x29145a){const _0x3c4642=parseSegmentRef(_0x5b8669);_0x3c4642['type']==='embedded'&&!_0x40c3d3[_0x4473b2(0x1ad)](_0x3c4642[_0x4473b2(0x19b)])&&_0x4f0bcf['push'](_0x4473b2(0x1af)+_0x3c4642['name']+'\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:'+_0x3c4642[_0x4473b2(0x19b)]+_0x4473b2(0x191));}return _0x4f0bcf;}export function collectSegmentIdsFromJourneyApi(_0x38383b){const _0x269796=a147_0x72352b,_0x2bd9ff=new Set();_0x38383b[_0x269796(0x183)]['goal']?.[_0x269796(0x188)]&&_0x2bd9ff[_0x269796(0x161)](_0x38383b['attributes'][_0x269796(0x202)]['segmentId']);const _0x20ce21=_0x38383b['attributes'][_0x269796(0x1a0)];if(Array[_0x269796(0x1fa)](_0x20ce21))for(const _0x85dd8d of _0x20ce21){_0x85dd8d['entryCriteria']?.['segmentId']&&_0x2bd9ff[_0x269796(0x161)](_0x85dd8d[_0x269796(0x1a7)][_0x269796(0x188)]);const _0x4d8e2f=_0x85dd8d['exitCriterias']??_0x85dd8d[_0x269796(0x1c4)];if(Array['isArray'](_0x4d8e2f))for(const _0x41cdd2 of _0x4d8e2f){_0x41cdd2['segmentId']&&_0x2bd9ff[_0x269796(0x161)](_0x41cdd2[_0x269796(0x188)]);}_0x85dd8d[_0x269796(0x1a2)]?.[_0x269796(0x188)]&&_0x2bd9ff[_0x269796(0x161)](_0x85dd8d['milestone']['segmentId']);if(_0x85dd8d[_0x269796(0x1ca)]&&typeof _0x85dd8d[_0x269796(0x1ca)]===_0x269796(0x203)){const _0x2d8fd9=Array[_0x269796(0x1fa)](_0x85dd8d['steps'])?_0x85dd8d[_0x269796(0x1ca)]:Object[_0x269796(0x19f)](_0x85dd8d['steps']);for(const _0x35e46e of _0x2d8fd9){_0x35e46e[_0x269796(0x155)]?.[_0x269796(0x188)]&&_0x2bd9ff['add'](_0x35e46e[_0x269796(0x155)]['segmentId']);const _0x5dc753=_0x35e46e;_0x5dc753[_0x269796(0x164)]&&_0x2bd9ff[_0x269796(0x161)](_0x5dc753[_0x269796(0x164)]);if(Array['isArray'](_0x5dc753['conditions']))for(const _0x4761bf of _0x5dc753[_0x269796(0x177)]){_0x4761bf[_0x269796(0x188)]&&_0x2bd9ff[_0x269796(0x161)](_0x4761bf[_0x269796(0x188)]);}if(Array[_0x269796(0x1fa)](_0x35e46e['branches']))for(const _0x350e5f of _0x35e46e[_0x269796(0x1be)]){_0x350e5f['segmentId']&&_0x2bd9ff[_0x269796(0x161)](_0x350e5f[_0x269796(0x188)]);}}}}return _0x2bd9ff;}
@@ -1 +1 @@
1
- const a148_0xfa874e=a148_0x1d58;(function(_0x4a1123,_0x5ad0c2){const _0x27e079=a148_0x1d58,_0x4ec10f=_0x4a1123();while(!![]){try{const _0x2e9136=-parseInt(_0x27e079(0x9e))/0x1+parseInt(_0x27e079(0xa8))/0x2+-parseInt(_0x27e079(0xd4))/0x3+parseInt(_0x27e079(0xb4))/0x4*(-parseInt(_0x27e079(0xad))/0x5)+parseInt(_0x27e079(0x9b))/0x6*(parseInt(_0x27e079(0x9c))/0x7)+-parseInt(_0x27e079(0xc0))/0x8*(-parseInt(_0x27e079(0xa4))/0x9)+parseInt(_0x27e079(0xb5))/0xa;if(_0x2e9136===_0x5ad0c2)break;else _0x4ec10f['push'](_0x4ec10f['shift']());}catch(_0x6acfe1){_0x4ec10f['push'](_0x4ec10f['shift']());}}}(a148_0x288c,0x4b3df));export const DEFAULT_TIME_RANGE=a148_0xfa874e(0x9f);function a148_0x288c(){const _0x2daeeb=['\x20LIMIT\x200','master','890508qFdWsB','7ylcFHE','\x27)\x0aLIMIT\x20','339871fOmKWt','-1d','\x0aLIMIT\x20','\x20=\x20a.','\x0aSELECT\x20m.','forEach','12105ZITfix','length','SELECT\x20*\x20FROM\x20','b.*','737332hPaNDl','column',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','trim','\x27)\x0a','4105hqWbbv','\x20b\x0a\x20\x20ON\x20m.','\x20m\x0aLEFT\x20JOIN\x20','SELECT\x20','source','\x0aLIMIT\x200\x0a','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','2540PgKQsy','11665960NPjxKB','\x0a\x20\x20ON\x20m.','map','columns','attributes','name','behaviors','\x20a\x0a\x20\x20ON\x20m.','\x0aFROM\x20','push','\x20=\x20b.','88KMBMgZ','all_columns','join','child_key','\x20IS\x20NOT\x20NULL\x0a','\x20m\x0a','\x20=\x20','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','\x0aWHERE\x20a.','m.*','table','parent_key','find','label','\x0aSELECT\x20','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','LEFT\x20JOIN\x20','\x20LIMIT\x20','(all\x20columns)','database','1587234bWFgPt','\x20m\x0aJOIN\x20','toLowerCase'];a148_0x288c=function(){return _0x2daeeb;};return a148_0x288c();}export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x557060,_0x5529ef,_0x1fb490){const _0x16eb5f=a148_0xfa874e,_0x28b516=_0x1fb490&&_0x1fb490[_0x16eb5f(0xa5)]>0x0?_0x1fb490[_0x16eb5f(0xc2)](',\x20'):'*';return _0x16eb5f(0xb0)+_0x28b516+'\x20FROM\x20'+_0x557060+'.'+_0x5529ef+_0x16eb5f(0xd7);}export function generateMasterCountSQL(_0x5df542){const _0x32606c=a148_0xfa874e,{database:_0x5df9ee,table:_0x5bc3fa}=_0x5df542['master'];return _0x32606c(0xb3)+_0x5df9ee+'.'+_0x5bc3fa;}function a148_0x1d58(_0x1986ed,_0x34f9fb){_0x1986ed=_0x1986ed-0x9b;const _0x288c46=a148_0x288c();let _0x1d58c5=_0x288c46[_0x1986ed];return _0x1d58c5;}export function generateMasterSampleSQL(_0x4faf32,_0x451e6d=0x5){const {database:_0x3be31e,table:_0x2fd58c}=_0x4faf32['master'];return'SELECT\x20*\x20FROM\x20'+_0x3be31e+'.'+_0x2fd58c+'\x20LIMIT\x20'+_0x451e6d;}export function generateAttributeCoverageSQL(_0xb1c02b,_0x45990d){const _0x25ca6a=a148_0xfa874e,_0x505c66=_0xb1c02b[_0x25ca6a(0xd8)];return('\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20'+_0x505c66['database']+'.'+_0x505c66[_0x25ca6a(0xca)]+_0x25ca6a(0xaf)+_0x45990d['source'][_0x25ca6a(0xd3)]+'.'+_0x45990d[_0x25ca6a(0xb1)][_0x25ca6a(0xca)]+_0x25ca6a(0xbc)+_0x45990d[_0x25ca6a(0xc2)]['parent_key']+_0x25ca6a(0xa1)+_0x45990d[_0x25ca6a(0xc2)]['child_key']+_0x25ca6a(0xc8)+_0x45990d['join']['child_key']+_0x25ca6a(0xc4))[_0x25ca6a(0xab)]();}export function generateBehaviorStatsSQL(_0x5bef8e,_0x3fb7e0,_0x1f1502=DEFAULT_TIME_RANGE){const _0x362748=a148_0xfa874e,_0x553820=_0x5bef8e[_0x362748(0xd8)];return(_0x362748(0xc7)+_0x3fb7e0[_0x362748(0xc2)][_0x362748(0xcb)]+_0x362748(0xaa)+_0x553820['database']+'.'+_0x553820[_0x362748(0xca)]+_0x362748(0xd5)+_0x3fb7e0[_0x362748(0xb1)]['database']+'.'+_0x3fb7e0[_0x362748(0xb1)]['table']+_0x362748(0xae)+_0x3fb7e0[_0x362748(0xc2)][_0x362748(0xcb)]+_0x362748(0xbf)+_0x3fb7e0[_0x362748(0xc2)][_0x362748(0xc3)]+_0x362748(0xcf)+_0x1f1502+_0x362748(0xac))['trim']();}export function generateAttributeSampleSQL(_0x52acd4,_0x3313d3,_0x340681=0x5){const _0x503aed=a148_0xfa874e,_0x23190d=_0x52acd4[_0x503aed(0xd8)],_0x20ebf2=_0x3313d3[_0x503aed(0xc2)]['parent_key'],_0x53fb9b=_0x3313d3[_0x503aed(0xb8)][_0x503aed(0xb7)](_0x27aa65=>'a.'+_0x27aa65[_0x503aed(0xa9)])['join'](',\x20');return(_0x503aed(0xa2)+_0x20ebf2+',\x20'+_0x53fb9b+_0x503aed(0xbd)+_0x23190d[_0x503aed(0xd3)]+'.'+_0x23190d[_0x503aed(0xca)]+'\x20m\x0aJOIN\x20'+_0x3313d3[_0x503aed(0xb1)][_0x503aed(0xd3)]+'.'+_0x3313d3[_0x503aed(0xb1)][_0x503aed(0xca)]+_0x503aed(0xbc)+_0x3313d3['join'][_0x503aed(0xcb)]+_0x503aed(0xa1)+_0x3313d3['join'][_0x503aed(0xc3)]+'\x0aLIMIT\x20'+_0x340681+'\x0a')['trim']();}export function generateBehaviorSampleSQL(_0x36484e,_0x22ca94,_0x106b18=0x5,_0x41aafd=DEFAULT_TIME_RANGE){const _0x35db29=a148_0xfa874e,_0x540452=_0x36484e[_0x35db29(0xd8)],_0x2c6af0=_0x22ca94[_0x35db29(0xc2)][_0x35db29(0xcb)];let _0x4f250c;if(_0x22ca94[_0x35db29(0xc1)])_0x4f250c=_0x35db29(0xa7);else _0x22ca94['columns']&&_0x22ca94[_0x35db29(0xb8)][_0x35db29(0xa5)]>0x0?_0x4f250c=_0x22ca94[_0x35db29(0xb8)]['map'](_0x18ee4c=>'b.'+_0x18ee4c[_0x35db29(0xa9)])[_0x35db29(0xc2)](',\x20'):_0x4f250c=_0x35db29(0xa7);return('\x0aSELECT\x20m.'+_0x2c6af0+',\x20'+_0x4f250c+_0x35db29(0xbd)+_0x540452[_0x35db29(0xd3)]+'.'+_0x540452[_0x35db29(0xca)]+_0x35db29(0xd5)+_0x22ca94[_0x35db29(0xb1)][_0x35db29(0xd3)]+'.'+_0x22ca94[_0x35db29(0xb1)]['table']+_0x35db29(0xae)+_0x22ca94[_0x35db29(0xc2)][_0x35db29(0xcb)]+'\x20=\x20b.'+_0x22ca94[_0x35db29(0xc2)][_0x35db29(0xc3)]+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x41aafd+_0x35db29(0x9d)+_0x106b18+'\x0a')[_0x35db29(0xab)]();}function quoteIdentifier(_0xabe715){if(/[\s\-\.\#\[\]\(\)]|^[0-9]/['test'](_0xabe715))return'\x22'+_0xabe715['replace'](/"/g,'\x22\x22')+'\x22';return _0xabe715;}export function generateEnrichedSQL(_0x592ff4,_0x2e5e2b=0x5){const _0x2927cd=a148_0xfa874e,_0x586fe4=_0x592ff4[_0x2927cd(0xd8)],_0x27dc50=_0x592ff4[_0x2927cd(0xb9)]||[];if(_0x27dc50[_0x2927cd(0xa5)]===0x0)return _0x2927cd(0xa6)+_0x586fe4[_0x2927cd(0xd3)]+'.'+_0x586fe4[_0x2927cd(0xca)]+_0x2927cd(0xd1)+_0x2e5e2b;const _0xc370b9=[_0x2927cd(0xc9)],_0x34bdc3=[];return _0x27dc50['forEach']((_0x4a846a,_0x451481)=>{const _0x413d1a=_0x2927cd,_0x1a003e='a'+_0x451481;_0x4a846a['columns'][_0x413d1a(0xa3)](_0x7d0332=>{const _0x1170c9=_0x413d1a,_0x29d062=quoteIdentifier(_0x7d0332[_0x1170c9(0xcd)]||_0x7d0332[_0x1170c9(0xa9)]);_0xc370b9[_0x1170c9(0xbe)](_0x1a003e+'.'+_0x7d0332[_0x1170c9(0xa9)]+'\x20AS\x20'+_0x29d062);}),_0x34bdc3[_0x413d1a(0xbe)](_0x413d1a(0xd0)+_0x4a846a[_0x413d1a(0xb1)][_0x413d1a(0xd3)]+'.'+_0x4a846a[_0x413d1a(0xb1)][_0x413d1a(0xca)]+'\x20'+_0x1a003e+_0x413d1a(0xb6)+_0x4a846a[_0x413d1a(0xc2)][_0x413d1a(0xcb)]+_0x413d1a(0xc6)+_0x1a003e+'.'+_0x4a846a[_0x413d1a(0xc2)][_0x413d1a(0xc3)]);}),(_0x2927cd(0xce)+_0xc370b9[_0x2927cd(0xc2)](',\x20')+_0x2927cd(0xbd)+_0x586fe4[_0x2927cd(0xd3)]+'.'+_0x586fe4[_0x2927cd(0xca)]+_0x2927cd(0xc5)+_0x34bdc3[_0x2927cd(0xc2)]('\x0a')+_0x2927cd(0xa0)+_0x2e5e2b+'\x0a')[_0x2927cd(0xab)]();}export function generateAttributeSchemaSQL(_0x121fcc,_0x162458){const _0x46eb98=a148_0xfa874e,_0x3f3b7e=_0x121fcc[_0x46eb98(0xd8)],_0x2c123b=_0x162458[_0x46eb98(0xc2)][_0x46eb98(0xcb)],_0x3e2467=_0x162458[_0x46eb98(0xb8)][_0x46eb98(0xb7)](_0x16760c=>'a.'+_0x16760c[_0x46eb98(0xa9)])[_0x46eb98(0xc2)](',\x20');return(_0x46eb98(0xa2)+_0x2c123b+',\x20'+_0x3e2467+_0x46eb98(0xbd)+_0x3f3b7e[_0x46eb98(0xd3)]+'.'+_0x3f3b7e[_0x46eb98(0xca)]+'\x20m\x0aJOIN\x20'+_0x162458[_0x46eb98(0xb1)][_0x46eb98(0xd3)]+'.'+_0x162458[_0x46eb98(0xb1)][_0x46eb98(0xca)]+_0x46eb98(0xbc)+_0x162458[_0x46eb98(0xc2)][_0x46eb98(0xcb)]+_0x46eb98(0xa1)+_0x162458[_0x46eb98(0xc2)][_0x46eb98(0xc3)]+_0x46eb98(0xb2))[_0x46eb98(0xab)]();}export function generateBehaviorSchemaSQL(_0x5a1995,_0x370a75){const _0x565523=a148_0xfa874e,_0x148db9=_0x5a1995[_0x565523(0xd8)],_0x4cdc80=_0x370a75[_0x565523(0xc2)]['parent_key'];let _0x3cff37;if(_0x370a75[_0x565523(0xc1)])_0x3cff37=_0x565523(0xa7);else _0x370a75[_0x565523(0xb8)]&&_0x370a75[_0x565523(0xb8)][_0x565523(0xa5)]>0x0?_0x3cff37=_0x370a75[_0x565523(0xb8)]['map'](_0x39b75b=>'b.'+_0x39b75b[_0x565523(0xa9)])[_0x565523(0xc2)](',\x20'):_0x3cff37=_0x565523(0xa7);return(_0x565523(0xa2)+_0x4cdc80+',\x20'+_0x3cff37+_0x565523(0xbd)+_0x148db9['database']+'.'+_0x148db9[_0x565523(0xca)]+_0x565523(0xd5)+_0x370a75[_0x565523(0xb1)][_0x565523(0xd3)]+'.'+_0x370a75['source'][_0x565523(0xca)]+_0x565523(0xae)+_0x370a75[_0x565523(0xc2)]['parent_key']+_0x565523(0xbf)+_0x370a75['join']['child_key']+_0x565523(0xb2))[_0x565523(0xab)]();}export function getAttributeColumns(_0x195a28){const _0x3fccd8=a148_0xfa874e;return _0x195a28[_0x3fccd8(0xb8)][_0x3fccd8(0xb7)](_0x2c4c77=>({'label':_0x2c4c77['label']||_0x2c4c77['column'],'column':_0x2c4c77[_0x3fccd8(0xa9)]}));}export function getBehaviorColumns(_0x3ac49f){const _0x1ee824=a148_0xfa874e;if(_0x3ac49f[_0x1ee824(0xc1)])return[{'label':'(all\x20columns)','column':'*'}];if(_0x3ac49f[_0x1ee824(0xb8)]&&_0x3ac49f[_0x1ee824(0xb8)][_0x1ee824(0xa5)]>0x0)return _0x3ac49f[_0x1ee824(0xb8)]['map'](_0x2d94e0=>({'label':_0x2d94e0[_0x1ee824(0xcd)]||_0x2d94e0[_0x1ee824(0xa9)],'column':_0x2d94e0[_0x1ee824(0xa9)]}));return[{'label':_0x1ee824(0xd2),'column':'*'}];}export function findAttributeByName(_0x43900c,_0x9caa2c){const _0x2bf551=a148_0xfa874e;return _0x43900c[_0x2bf551(0xb9)]?.[_0x2bf551(0xcc)](_0xf9a751=>_0xf9a751[_0x2bf551(0xba)][_0x2bf551(0xd6)]()===_0x9caa2c[_0x2bf551(0xd6)]());}export function findBehaviorByName(_0x41f4c4,_0x2bc993){const _0x2561eb=a148_0xfa874e;return _0x41f4c4[_0x2561eb(0xbb)]?.[_0x2561eb(0xcc)](_0x5e4ea8=>_0x5e4ea8[_0x2561eb(0xba)][_0x2561eb(0xd6)]()===_0x2bc993[_0x2561eb(0xd6)]());}
1
+ const a148_0x57d818=a148_0x409b;(function(_0x266a7a,_0x149214){const _0x506ced=a148_0x409b,_0x559c71=_0x266a7a();while(!![]){try{const _0x5273b4=parseInt(_0x506ced(0xc2))/0x1*(parseInt(_0x506ced(0xbb))/0x2)+-parseInt(_0x506ced(0xcf))/0x3*(parseInt(_0x506ced(0xb6))/0x4)+parseInt(_0x506ced(0xc6))/0x5*(parseInt(_0x506ced(0xa6))/0x6)+parseInt(_0x506ced(0xc7))/0x7+-parseInt(_0x506ced(0xb8))/0x8*(-parseInt(_0x506ced(0xad))/0x9)+-parseInt(_0x506ced(0x93))/0xa+-parseInt(_0x506ced(0xa8))/0xb;if(_0x5273b4===_0x149214)break;else _0x559c71['push'](_0x559c71['shift']());}catch(_0x889d14){_0x559c71['push'](_0x559c71['shift']());}}}(a148_0x549e,0xe0c64));export const DEFAULT_TIME_RANGE=a148_0x57d818(0xc5);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x43fafc,_0x3a3763,_0x118e60){const _0x1f4058=a148_0x57d818,_0x259f37=_0x118e60&&_0x118e60['length']>0x0?_0x118e60[_0x1f4058(0xb0)](',\x20'):'*';return _0x1f4058(0x9c)+_0x259f37+_0x1f4058(0xa5)+_0x43fafc+'.'+_0x3a3763+_0x1f4058(0x91);}function a148_0x409b(_0x115cee,_0xe25c78){_0x115cee=_0x115cee-0x91;const _0x549e0f=a148_0x549e();let _0x409ba7=_0x549e0f[_0x115cee];return _0x409ba7;}export function generateMasterCountSQL(_0x433dd8){const _0x40d3eb=a148_0x57d818,{database:_0x4b5d1e,table:_0x222735}=_0x433dd8[_0x40d3eb(0x92)];return _0x40d3eb(0xae)+_0x4b5d1e+'.'+_0x222735;}export function generateMasterSampleSQL(_0x2ce4bc,_0x27422e=0x5){const _0x137cac=a148_0x57d818,{database:_0x4b06e5,table:_0x439158}=_0x2ce4bc['master'];return _0x137cac(0xc4)+_0x4b06e5+'.'+_0x439158+_0x137cac(0x96)+_0x27422e;}export function generateAttributeCoverageSQL(_0x357e75,_0x1d1043){const _0x4b62c6=a148_0x57d818,_0x24bb74=_0x357e75[_0x4b62c6(0x92)];return(_0x4b62c6(0x9a)+_0x24bb74[_0x4b62c6(0xb3)]+'.'+_0x24bb74[_0x4b62c6(0xc8)]+_0x4b62c6(0xab)+_0x1d1043[_0x4b62c6(0xca)][_0x4b62c6(0xb3)]+'.'+_0x1d1043[_0x4b62c6(0xca)]['table']+_0x4b62c6(0x9e)+_0x1d1043['join'][_0x4b62c6(0xa9)]+_0x4b62c6(0xa0)+_0x1d1043[_0x4b62c6(0xb0)][_0x4b62c6(0xa4)]+_0x4b62c6(0xce)+_0x1d1043[_0x4b62c6(0xb0)][_0x4b62c6(0xa4)]+_0x4b62c6(0x95))[_0x4b62c6(0xb1)]();}export function generateBehaviorStatsSQL(_0x2c73b9,_0x31702d,_0x4f2771=DEFAULT_TIME_RANGE){const _0x2d7b66=a148_0x57d818,_0x23a26b=_0x2c73b9[_0x2d7b66(0x92)];return(_0x2d7b66(0xc9)+_0x31702d['join'][_0x2d7b66(0xa9)]+')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20'+_0x23a26b[_0x2d7b66(0xb3)]+'.'+_0x23a26b[_0x2d7b66(0xc8)]+_0x2d7b66(0xbd)+_0x31702d[_0x2d7b66(0xca)]['database']+'.'+_0x31702d[_0x2d7b66(0xca)][_0x2d7b66(0xc8)]+_0x2d7b66(0xac)+_0x31702d['join']['parent_key']+_0x2d7b66(0xa1)+_0x31702d['join'][_0x2d7b66(0xa4)]+_0x2d7b66(0xc3)+_0x4f2771+'\x27)\x0a')[_0x2d7b66(0xb1)]();}export function generateAttributeSampleSQL(_0x34d7de,_0x2e8bd6,_0xaa0418=0x5){const _0x12fd34=a148_0x57d818,_0x1ac153=_0x34d7de['master'],_0x36eb3a=_0x2e8bd6[_0x12fd34(0xb0)][_0x12fd34(0xa9)],_0x5effe3=_0x2e8bd6[_0x12fd34(0x9b)][_0x12fd34(0x94)](_0x4a3fe1=>'a.'+_0x4a3fe1[_0x12fd34(0xaa)])['join'](',\x20');return('\x0aSELECT\x20m.'+_0x36eb3a+',\x20'+_0x5effe3+'\x0aFROM\x20'+_0x1ac153['database']+'.'+_0x1ac153[_0x12fd34(0xc8)]+_0x12fd34(0xbd)+_0x2e8bd6[_0x12fd34(0xca)]['database']+'.'+_0x2e8bd6['source'][_0x12fd34(0xc8)]+_0x12fd34(0x9e)+_0x2e8bd6[_0x12fd34(0xb0)][_0x12fd34(0xa9)]+_0x12fd34(0xa0)+_0x2e8bd6['join'][_0x12fd34(0xa4)]+_0x12fd34(0xbe)+_0xaa0418+'\x0a')[_0x12fd34(0xb1)]();}export function generateBehaviorSampleSQL(_0x534add,_0x24f538,_0x18911e=0x5,_0xaa7844=DEFAULT_TIME_RANGE){const _0x25755c=a148_0x57d818,_0x1794f6=_0x534add[_0x25755c(0x92)],_0x3262f9=_0x24f538[_0x25755c(0xb0)][_0x25755c(0xa9)];let _0x34a5b7;if(_0x24f538[_0x25755c(0xcb)])_0x34a5b7=_0x25755c(0xb5);else _0x24f538['columns']&&_0x24f538[_0x25755c(0x9b)][_0x25755c(0xb4)]>0x0?_0x34a5b7=_0x24f538['columns'][_0x25755c(0x94)](_0xf4b372=>'b.'+_0xf4b372[_0x25755c(0xaa)])['join'](',\x20'):_0x34a5b7=_0x25755c(0xb5);return(_0x25755c(0xbf)+_0x3262f9+',\x20'+_0x34a5b7+_0x25755c(0xb2)+_0x1794f6[_0x25755c(0xb3)]+'.'+_0x1794f6[_0x25755c(0xc8)]+'\x20m\x0aJOIN\x20'+_0x24f538[_0x25755c(0xca)][_0x25755c(0xb3)]+'.'+_0x24f538[_0x25755c(0xca)]['table']+'\x20b\x0a\x20\x20ON\x20m.'+_0x24f538[_0x25755c(0xb0)][_0x25755c(0xa9)]+_0x25755c(0xa1)+_0x24f538[_0x25755c(0xb0)]['child_key']+_0x25755c(0xc3)+_0xaa7844+_0x25755c(0xcd)+_0x18911e+'\x0a')[_0x25755c(0xb1)]();}function a148_0x549e(){const _0x3a6d92=['b.*','4mVgFJC','replace','80PrMdmZ','behaviors','toLowerCase','2jQOdsw','\x20AS\x20','\x20m\x0aJOIN\x20','\x0aLIMIT\x20','\x0aSELECT\x20m.','name','\x20m\x0a','709153MMqMqv','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','SELECT\x20*\x20FROM\x20','-1d','11130qfPJaT','9998821AFWGmO','table','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','source','all_columns','test','\x27)\x0aLIMIT\x20','\x0aWHERE\x20a.','1712229KSIWcj','\x0aLIMIT\x200\x0a','\x20LIMIT\x200','master','15173220QBoyae','map','\x20IS\x20NOT\x20NULL\x0a','\x20LIMIT\x20','\x0a\x20\x20ON\x20m.','m.*','attributes','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','columns','SELECT\x20','LEFT\x20JOIN\x20','\x20a\x0a\x20\x20ON\x20m.','find','\x20=\x20a.','\x20=\x20b.','push','(all\x20columns)','child_key','\x20FROM\x20','4182IrhcAa','label','22189607QAQxRv','parent_key','column','\x20m\x0aLEFT\x20JOIN\x20','\x20b\x0a\x20\x20ON\x20m.','1203210mFvCDh','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','forEach','join','trim','\x0aFROM\x20','database','length'];a148_0x549e=function(){return _0x3a6d92;};return a148_0x549e();}function quoteIdentifier(_0x4aa18e){const _0x15ffe3=a148_0x57d818;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x15ffe3(0xcc)](_0x4aa18e))return'\x22'+_0x4aa18e[_0x15ffe3(0xb7)](/"/g,'\x22\x22')+'\x22';return _0x4aa18e;}export function generateEnrichedSQL(_0x5793fc,_0xd13c5c=0x5){const _0x3e8775=a148_0x57d818,_0x176983=_0x5793fc[_0x3e8775(0x92)],_0x1fe284=_0x5793fc['attributes']||[];if(_0x1fe284[_0x3e8775(0xb4)]===0x0)return _0x3e8775(0xc4)+_0x176983[_0x3e8775(0xb3)]+'.'+_0x176983[_0x3e8775(0xc8)]+_0x3e8775(0x96)+_0xd13c5c;const _0x5aaa7f=[_0x3e8775(0x98)],_0x8dacb2=[];return _0x1fe284[_0x3e8775(0xaf)]((_0x2811a7,_0x3ef1f8)=>{const _0x38d207=_0x3e8775,_0xc7987a='a'+_0x3ef1f8;_0x2811a7['columns']['forEach'](_0x5a89f8=>{const _0x1de880=a148_0x409b,_0x4ada27=quoteIdentifier(_0x5a89f8[_0x1de880(0xa7)]||_0x5a89f8[_0x1de880(0xaa)]);_0x5aaa7f[_0x1de880(0xa2)](_0xc7987a+'.'+_0x5a89f8['column']+_0x1de880(0xbc)+_0x4ada27);}),_0x8dacb2[_0x38d207(0xa2)](_0x38d207(0x9d)+_0x2811a7[_0x38d207(0xca)][_0x38d207(0xb3)]+'.'+_0x2811a7[_0x38d207(0xca)]['table']+'\x20'+_0xc7987a+_0x38d207(0x97)+_0x2811a7[_0x38d207(0xb0)][_0x38d207(0xa9)]+'\x20=\x20'+_0xc7987a+'.'+_0x2811a7[_0x38d207(0xb0)][_0x38d207(0xa4)]);}),('\x0aSELECT\x20'+_0x5aaa7f['join'](',\x20')+'\x0aFROM\x20'+_0x176983['database']+'.'+_0x176983[_0x3e8775(0xc8)]+_0x3e8775(0xc1)+_0x8dacb2[_0x3e8775(0xb0)]('\x0a')+_0x3e8775(0xbe)+_0xd13c5c+'\x0a')['trim']();}export function generateAttributeSchemaSQL(_0x52b072,_0xfceccf){const _0x1d1be5=a148_0x57d818,_0x5829b1=_0x52b072['master'],_0x5ec4b6=_0xfceccf[_0x1d1be5(0xb0)]['parent_key'],_0xd455a1=_0xfceccf['columns'][_0x1d1be5(0x94)](_0x3edc7f=>'a.'+_0x3edc7f[_0x1d1be5(0xaa)])[_0x1d1be5(0xb0)](',\x20');return(_0x1d1be5(0xbf)+_0x5ec4b6+',\x20'+_0xd455a1+'\x0aFROM\x20'+_0x5829b1[_0x1d1be5(0xb3)]+'.'+_0x5829b1[_0x1d1be5(0xc8)]+_0x1d1be5(0xbd)+_0xfceccf[_0x1d1be5(0xca)][_0x1d1be5(0xb3)]+'.'+_0xfceccf['source'][_0x1d1be5(0xc8)]+'\x20a\x0a\x20\x20ON\x20m.'+_0xfceccf[_0x1d1be5(0xb0)][_0x1d1be5(0xa9)]+_0x1d1be5(0xa0)+_0xfceccf[_0x1d1be5(0xb0)][_0x1d1be5(0xa4)]+_0x1d1be5(0xd0))[_0x1d1be5(0xb1)]();}export function generateBehaviorSchemaSQL(_0x1ffc10,_0xf7f9d9){const _0x93eece=a148_0x57d818,_0x18de3b=_0x1ffc10[_0x93eece(0x92)],_0x7f90fe=_0xf7f9d9[_0x93eece(0xb0)]['parent_key'];let _0x4b03be;if(_0xf7f9d9['all_columns'])_0x4b03be=_0x93eece(0xb5);else _0xf7f9d9[_0x93eece(0x9b)]&&_0xf7f9d9[_0x93eece(0x9b)][_0x93eece(0xb4)]>0x0?_0x4b03be=_0xf7f9d9[_0x93eece(0x9b)][_0x93eece(0x94)](_0x54d8bd=>'b.'+_0x54d8bd['column'])['join'](',\x20'):_0x4b03be='b.*';return('\x0aSELECT\x20m.'+_0x7f90fe+',\x20'+_0x4b03be+'\x0aFROM\x20'+_0x18de3b[_0x93eece(0xb3)]+'.'+_0x18de3b[_0x93eece(0xc8)]+_0x93eece(0xbd)+_0xf7f9d9[_0x93eece(0xca)][_0x93eece(0xb3)]+'.'+_0xf7f9d9[_0x93eece(0xca)][_0x93eece(0xc8)]+_0x93eece(0xac)+_0xf7f9d9[_0x93eece(0xb0)]['parent_key']+'\x20=\x20b.'+_0xf7f9d9['join']['child_key']+_0x93eece(0xd0))[_0x93eece(0xb1)]();}export function getAttributeColumns(_0x3ff3c5){const _0x5ac26c=a148_0x57d818;return _0x3ff3c5['columns'][_0x5ac26c(0x94)](_0x52678c=>({'label':_0x52678c[_0x5ac26c(0xa7)]||_0x52678c[_0x5ac26c(0xaa)],'column':_0x52678c['column']}));}export function getBehaviorColumns(_0x45d67f){const _0x39afb7=a148_0x57d818;if(_0x45d67f['all_columns'])return[{'label':'(all\x20columns)','column':'*'}];if(_0x45d67f[_0x39afb7(0x9b)]&&_0x45d67f[_0x39afb7(0x9b)][_0x39afb7(0xb4)]>0x0)return _0x45d67f[_0x39afb7(0x9b)][_0x39afb7(0x94)](_0x55ffed=>({'label':_0x55ffed[_0x39afb7(0xa7)]||_0x55ffed['column'],'column':_0x55ffed[_0x39afb7(0xaa)]}));return[{'label':_0x39afb7(0xa3),'column':'*'}];}export function findAttributeByName(_0x26da3b,_0x4b85ce){const _0x8d79e2=a148_0x57d818;return _0x26da3b[_0x8d79e2(0x99)]?.[_0x8d79e2(0x9f)](_0x2cbbdd=>_0x2cbbdd[_0x8d79e2(0xc0)][_0x8d79e2(0xba)]()===_0x4b85ce['toLowerCase']());}export function findBehaviorByName(_0x20ad3,_0x1d824b){const _0x2150b2=a148_0x57d818;return _0x20ad3[_0x2150b2(0xb9)]?.[_0x2150b2(0x9f)](_0xdb26bf=>_0xdb26bf[_0x2150b2(0xc0)]['toLowerCase']()===_0x1d824b[_0x2150b2(0xba)]());}