@treasuredata/tdx 2026.4.23 → 2026.5.0

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 (292) hide show
  1. package/README.md +5 -5
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.d.ts +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.d.ts +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/auth-command.js +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-command.js.map +1 -1
  20. package/dist/commands/claude-statusline-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/delivery-command.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-command.js +1 -1
  31. package/dist/commands/engage-template-pull-command.js +1 -1
  32. package/dist/commands/engage-template-push-command.js +1 -1
  33. package/dist/commands/engage-template-validate-command.js +1 -1
  34. package/dist/commands/job-command.d.ts +1 -1
  35. package/dist/commands/job-command.js +1 -1
  36. package/dist/commands/journey-command.d.ts +1 -1
  37. package/dist/commands/journey-command.d.ts.map +1 -1
  38. package/dist/commands/journey-command.js +1 -1
  39. package/dist/commands/journey-command.js.map +1 -1
  40. package/dist/commands/journey-validate-command.js +1 -1
  41. package/dist/commands/llm-command.js +1 -1
  42. package/dist/commands/mcp-command.js +1 -1
  43. package/dist/commands/parent-segment-command.js +1 -1
  44. package/dist/commands/policy-command.js +1 -1
  45. package/dist/commands/profile-command.js +1 -1
  46. package/dist/commands/profiles-command.js +1 -1
  47. package/dist/commands/query-command.js +1 -1
  48. package/dist/commands/schedule-command.d.ts +1 -1
  49. package/dist/commands/schedule-command.js +1 -1
  50. package/dist/commands/segment-command.js +1 -1
  51. package/dist/commands/segment-create-command.js +1 -1
  52. package/dist/commands/segment-fields-command.js +1 -1
  53. package/dist/commands/segment-pull-command.d.ts +1 -1
  54. package/dist/commands/segment-pull-command.js +1 -1
  55. package/dist/commands/segment-push-command.d.ts +3 -3
  56. package/dist/commands/segment-push-command.d.ts.map +1 -1
  57. package/dist/commands/segment-push-command.js +1 -1
  58. package/dist/commands/segment-push-command.js.map +1 -1
  59. package/dist/commands/segment-update-command.js +1 -1
  60. package/dist/commands/segment-use-command.js +1 -1
  61. package/dist/commands/segment-validate-command.js +1 -1
  62. package/dist/commands/segments.js +1 -1
  63. package/dist/commands/show.js +1 -1
  64. package/dist/commands/status-command.js +1 -1
  65. package/dist/commands/table-deleted.d.ts +31 -0
  66. package/dist/commands/table-deleted.d.ts.map +1 -0
  67. package/dist/commands/table-deleted.js +1 -0
  68. package/dist/commands/table-deleted.js.map +1 -0
  69. package/dist/commands/tables.js +1 -1
  70. package/dist/commands/unset-command.js +1 -1
  71. package/dist/commands/upgrade-command.js +1 -1
  72. package/dist/commands/use-command.js +1 -1
  73. package/dist/commands/user-command.js +1 -1
  74. package/dist/commands/work-command.js +1 -1
  75. package/dist/commands/workflow-command.d.ts +5 -5
  76. package/dist/commands/workflow-command.d.ts.map +1 -1
  77. package/dist/commands/workflow-command.js +1 -1
  78. package/dist/commands/workflow-command.js.map +1 -1
  79. package/dist/core/auth.js +1 -1
  80. package/dist/core/command-output.js +1 -1
  81. package/dist/core/config.js +1 -1
  82. package/dist/core/connection-cache.js +1 -1
  83. package/dist/core/constants.js +1 -1
  84. package/dist/core/constants.js.map +1 -1
  85. package/dist/core/credential-cache.js +1 -1
  86. package/dist/core/global-context.js +1 -1
  87. package/dist/core/keychain.js +1 -1
  88. package/dist/core/oauth-keychain.js +1 -1
  89. package/dist/core/oauth.js +1 -1
  90. package/dist/core/profile.js +1 -1
  91. package/dist/core/project-config.js +1 -1
  92. package/dist/core/session.js +1 -1
  93. package/dist/core/user-cache.js +1 -1
  94. package/dist/core/version.js +1 -1
  95. package/dist/index.d.ts +1 -1
  96. package/dist/index.js +1 -1
  97. package/dist/mcp/server.js +1 -1
  98. package/dist/mcp/tools/index.js +1 -1
  99. package/dist/mcp/tools/tdx-run.js +1 -1
  100. package/dist/mcp/tools/tdx-search.js +1 -1
  101. package/dist/mcp/tools/work-create-item.js +1 -1
  102. package/dist/mcp/utils.js +1 -1
  103. package/dist/proxy/claude-usage-tracker.js +1 -1
  104. package/dist/proxy/passthrough-server.js +1 -1
  105. package/dist/proxy/sse-usage-parser.js +1 -1
  106. package/dist/sdk/agent/agent-config.js +1 -1
  107. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  108. package/dist/sdk/agent/agent-yaml.js +1 -1
  109. package/dist/sdk/agent/test/evaluator.js +1 -1
  110. package/dist/sdk/agent/test/executor.js +1 -1
  111. package/dist/sdk/agent/test/index.js +1 -1
  112. package/dist/sdk/agent/test/output.js +1 -1
  113. package/dist/sdk/agent/test/parser.js +1 -1
  114. package/dist/sdk/agent/tool-target-registry.js +1 -1
  115. package/dist/sdk/api.d.ts +1 -1
  116. package/dist/sdk/api.js +1 -1
  117. package/dist/sdk/cas/cas-api-client.js +1 -1
  118. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  119. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  120. package/dist/sdk/cas/index.js +1 -1
  121. package/dist/sdk/cas/pull-workflow.js +1 -1
  122. package/dist/sdk/cas/push-workflow.js +1 -1
  123. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  124. package/dist/sdk/client/cdp-api-client.js +1 -1
  125. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  126. package/dist/sdk/client/delivery-api-client.js +1 -1
  127. package/dist/sdk/client/endpoints.d.ts +1 -1
  128. package/dist/sdk/client/endpoints.js +1 -1
  129. package/dist/sdk/client/engage-api-client.js +1 -1
  130. package/dist/sdk/client/http-client.js +1 -1
  131. package/dist/sdk/client/llm-api-client.d.ts +1 -1
  132. package/dist/sdk/client/llm-api-client.js +1 -1
  133. package/dist/sdk/client/oauth-refresh.js +1 -1
  134. package/dist/sdk/client/rate-limiter.js +1 -1
  135. package/dist/sdk/client/td-api-client.d.ts +23 -2
  136. package/dist/sdk/client/td-api-client.d.ts.map +1 -1
  137. package/dist/sdk/client/td-api-client.js +1 -1
  138. package/dist/sdk/client/td-api-client.js.map +1 -1
  139. package/dist/sdk/client/trino-api-client.d.ts +1 -1
  140. package/dist/sdk/client/trino-api-client.js +1 -1
  141. package/dist/sdk/client/trino-api-client.js.map +1 -1
  142. package/dist/sdk/client/workflow-client.d.ts +2 -2
  143. package/dist/sdk/client/workflow-client.js +1 -1
  144. package/dist/sdk/connection-validator.js +1 -1
  145. package/dist/sdk/connection.js +1 -1
  146. package/dist/sdk/delivery.js +1 -1
  147. package/dist/sdk/engage/campaign-pull.js +1 -1
  148. package/dist/sdk/engage/campaign-push.js +1 -1
  149. package/dist/sdk/engage/campaign-validator.js +1 -1
  150. package/dist/sdk/engage/campaign-yaml.js +1 -1
  151. package/dist/sdk/engage/template-pull.js +1 -1
  152. package/dist/sdk/engage/template-push.js +1 -1
  153. package/dist/sdk/engage/template-validator.js +1 -1
  154. package/dist/sdk/engage/template-yaml.js +1 -1
  155. package/dist/sdk/engage/types/campaign-def.js +1 -1
  156. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  157. package/dist/sdk/engage/types/template-schema.js +1 -1
  158. package/dist/sdk/engage.js +1 -1
  159. package/dist/sdk/errors.js +1 -1
  160. package/dist/sdk/index.d.ts +2 -2
  161. package/dist/sdk/index.js +1 -1
  162. package/dist/sdk/io/index.js +1 -1
  163. package/dist/sdk/io/node-filesystem.js +1 -1
  164. package/dist/sdk/job.js +1 -1
  165. package/dist/sdk/journey.js +1 -1
  166. package/dist/sdk/llm/chat-cache.js +1 -1
  167. package/dist/sdk/llm/index.d.ts.map +1 -1
  168. package/dist/sdk/llm/index.js +1 -1
  169. package/dist/sdk/llm/index.js.map +1 -1
  170. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  171. package/dist/sdk/llm/model-factors.js +1 -1
  172. package/dist/sdk/llm/user-settings.d.ts +3 -0
  173. package/dist/sdk/llm/user-settings.d.ts.map +1 -0
  174. package/dist/sdk/llm/user-settings.js +1 -0
  175. package/dist/sdk/llm/user-settings.js.map +1 -0
  176. package/dist/sdk/personalization.js +1 -1
  177. package/dist/sdk/policy.js +1 -1
  178. package/dist/sdk/query/deleted-table-validation.d.ts +19 -0
  179. package/dist/sdk/query/deleted-table-validation.d.ts.map +1 -0
  180. package/dist/sdk/query/deleted-table-validation.js +1 -0
  181. package/dist/sdk/query/deleted-table-validation.js.map +1 -0
  182. package/dist/sdk/query/index.d.ts +43 -0
  183. package/dist/sdk/query/index.d.ts.map +1 -1
  184. package/dist/sdk/query/index.js +1 -1
  185. package/dist/sdk/query/index.js.map +1 -1
  186. package/dist/sdk/query/sql-parser.js +1 -1
  187. package/dist/sdk/realtime.js +1 -1
  188. package/dist/sdk/schedule.js +1 -1
  189. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  190. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  191. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  192. package/dist/sdk/segment/fields-display.js +1 -1
  193. package/dist/sdk/segment/file-discovery.js +1 -1
  194. package/dist/sdk/segment/journey-utils.js +1 -1
  195. package/dist/sdk/segment/journey-validator.js +1 -1
  196. package/dist/sdk/segment/journey-yaml.js +1 -1
  197. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  198. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  199. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  200. package/dist/sdk/segment/pull-workflow.d.ts +2 -2
  201. package/dist/sdk/segment/pull-workflow.js +1 -1
  202. package/dist/sdk/segment/push-recovery.js +1 -1
  203. package/dist/sdk/segment/push-workflow.d.ts +1 -1
  204. package/dist/sdk/segment/push-workflow.js +1 -1
  205. package/dist/sdk/segment/resolution-context.js +1 -1
  206. package/dist/sdk/segment/segment-path-parser.js +1 -1
  207. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  208. package/dist/sdk/segment/segment-validator.js +1 -1
  209. package/dist/sdk/segment/segment-validator.js.map +1 -1
  210. package/dist/sdk/segment/target-resolution.js +1 -1
  211. package/dist/sdk/segment/tdx-config.js +1 -1
  212. package/dist/sdk/segment/types/activation-schema.js +1 -1
  213. package/dist/sdk/segment/types/journey-def.js +1 -1
  214. package/dist/sdk/segment/types/journey-schema.js +1 -1
  215. package/dist/sdk/segment/types/segment-def.js +1 -1
  216. package/dist/sdk/segment/types/segment-schema.d.ts +4 -2
  217. package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
  218. package/dist/sdk/segment/types/segment-schema.js +1 -1
  219. package/dist/sdk/segment/types/segment-schema.js.map +1 -1
  220. package/dist/sdk/segment/validate-files.js +1 -1
  221. package/dist/sdk/segment/yaml-validator.js +1 -1
  222. package/dist/sdk/segment.d.ts +1 -1
  223. package/dist/sdk/segment.js +1 -1
  224. package/dist/sdk/types/cdp.d.ts +7 -3
  225. package/dist/sdk/types/cdp.d.ts.map +1 -1
  226. package/dist/sdk/types/connection.d.ts +1 -1
  227. package/dist/sdk/types/database.d.ts +28 -0
  228. package/dist/sdk/types/database.d.ts.map +1 -1
  229. package/dist/sdk/types/index.d.ts +1 -1
  230. package/dist/sdk/types/index.d.ts.map +1 -1
  231. package/dist/sdk/types/index.js +1 -1
  232. package/dist/sdk/types/llm.d.ts +7 -3
  233. package/dist/sdk/types/llm.d.ts.map +1 -1
  234. package/dist/sdk/types/progress.js +1 -1
  235. package/dist/sdk/types/workspace.js +1 -1
  236. package/dist/sdk/user.js +1 -1
  237. package/dist/sdk/util/format-detector.js +1 -1
  238. package/dist/sdk/util/formatters.js +1 -1
  239. package/dist/sdk/util/index.js +1 -1
  240. package/dist/sdk/util/paginate.js +1 -1
  241. package/dist/sdk/util/tree-formatter.js +1 -1
  242. package/dist/sdk/workflow/archive-validation.js +1 -1
  243. package/dist/sdk/workflow/clone-workflow.js +1 -1
  244. package/dist/sdk/workflow/index.d.ts +2 -2
  245. package/dist/sdk/workflow/index.d.ts.map +1 -1
  246. package/dist/sdk/workflow/index.js +1 -1
  247. package/dist/sdk/workflow/index.js.map +1 -1
  248. package/dist/sdk/workflow/pull-workflow.js +1 -1
  249. package/dist/sdk/workflow/push-workflow.js +1 -1
  250. package/dist/sdk/workflow/task-graph.js +1 -1
  251. package/dist/sdk/workflow/tdx-config.js +1 -1
  252. package/dist/sdk/workflow/workflow-utils.js +1 -1
  253. package/dist/sdk/workspace/access-tracker.js +1 -1
  254. package/dist/sdk/workspace/frontmatter.js +1 -1
  255. package/dist/sdk/workspace/git.js +1 -1
  256. package/dist/sdk/workspace/index.js +1 -1
  257. package/dist/sdk/workspace/templates.js +1 -1
  258. package/dist/sdk/workspace/weekly.js +1 -1
  259. package/dist/sdk/workspace/wikilinks.js +1 -1
  260. package/dist/test-utils/command-runner.js +1 -1
  261. package/dist/test-utils/factories.js +1 -1
  262. package/dist/test-utils/fixtures.js +1 -1
  263. package/dist/test-utils/http-mock.js +1 -1
  264. package/dist/test-utils/index.js +1 -1
  265. package/dist/utils/async.js +1 -1
  266. package/dist/utils/colors.js +1 -1
  267. package/dist/utils/diff.js +1 -1
  268. package/dist/utils/file-permissions.js +1 -1
  269. package/dist/utils/file-reader.js +1 -1
  270. package/dist/utils/github-releases.js +1 -1
  271. package/dist/utils/global-cache.js +1 -1
  272. package/dist/utils/json-loader.js +1 -1
  273. package/dist/utils/local-cache.js +1 -1
  274. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  275. package/dist/utils/logger/formatters/index.js +1 -1
  276. package/dist/utils/logger/handlers/console-handler.js +1 -1
  277. package/dist/utils/logger/handlers/file-handler.js +1 -1
  278. package/dist/utils/logger/handlers/index.js +1 -1
  279. package/dist/utils/logger/handlers/null-handler.js +1 -1
  280. package/dist/utils/logger/index.js +1 -1
  281. package/dist/utils/logger/logger.js +1 -1
  282. package/dist/utils/logger/types.js +1 -1
  283. package/dist/utils/option-validation.js +1 -1
  284. package/dist/utils/process.js +1 -1
  285. package/dist/utils/prompt.js +1 -1
  286. package/dist/utils/spinner.js +1 -1
  287. package/dist/utils/sse-parser.js +1 -1
  288. package/dist/utils/string-utils.js +1 -1
  289. package/dist/utils/table-ref-parser.js +1 -1
  290. package/dist/utils/tdx-logger.js +1 -1
  291. package/dist/utils/version-check.js +1 -1
  292. package/package.json +17 -12
@@ -1 +1 @@
1
- (function(_0x2b1465,_0x5434ca){const _0x16751e=a144_0x38c2,_0xacef59=_0x2b1465();while(!![]){try{const _0x3ba61e=parseInt(_0x16751e(0x97))/0x1*(-parseInt(_0x16751e(0x96))/0x2)+parseInt(_0x16751e(0x92))/0x3+parseInt(_0x16751e(0x8f))/0x4*(-parseInt(_0x16751e(0x91))/0x5)+parseInt(_0x16751e(0x86))/0x6+-parseInt(_0x16751e(0x8a))/0x7*(-parseInt(_0x16751e(0x8d))/0x8)+-parseInt(_0x16751e(0x87))/0x9+parseInt(_0x16751e(0x99))/0xa;if(_0x3ba61e===_0x5434ca)break;else _0xacef59['push'](_0xacef59['shift']());}catch(_0x53bc2f){_0xacef59['push'](_0xacef59['shift']());}}}(a144_0x1fb0,0x708c4));import{readdirSync,statSync}from'fs';import a144_0x450f65 from'path';export function findYamlFiles(_0x4df15f){const _0x45cb80=[];function _0x4957a5(_0x1868f5){const _0x1bb850=a144_0x38c2,_0x363a3b=readdirSync(_0x1868f5,{'withFileTypes':!![]});for(const _0x31e7b3 of _0x363a3b){const _0x1a0ec8=a144_0x450f65[_0x1bb850(0x85)](_0x1868f5,_0x31e7b3[_0x1bb850(0x9a)]);if(_0x31e7b3[_0x1bb850(0x8c)]())_0x4957a5(_0x1a0ec8);else(_0x31e7b3[_0x1bb850(0x9a)]['endsWith'](_0x1bb850(0x88))||_0x31e7b3['name'][_0x1bb850(0x9c)](_0x1bb850(0x89)))&&_0x45cb80[_0x1bb850(0x9b)](_0x1a0ec8);}}return _0x4957a5(_0x4df15f),_0x45cb80;}function a144_0x38c2(_0x21d687,_0x231817){_0x21d687=_0x21d687-0x85;const _0x1fb08d=a144_0x1fb0();let _0x38c2dc=_0x1fb08d[_0x21d687];return _0x38c2dc;}export function discoverYamlFiles(_0x3def0d){const _0x1b87a6=a144_0x38c2,_0x530474=findYamlFiles(_0x3def0d);return _0x530474[_0x1b87a6(0x95)](_0x1a96f4=>{const _0x1c5c94=_0x1b87a6,_0x31472e=a144_0x450f65[_0x1c5c94(0x90)](_0x3def0d,_0x1a96f4),_0x496c06=a144_0x450f65[_0x1c5c94(0x8e)](_0x31472e);return{'absolutePath':_0x1a96f4,'relativePath':_0x31472e,'folderPath':_0x496c06==='.'?'':_0x496c06[_0x1c5c94(0x8b)](/\\/g,'/')};});}function a144_0x1fb0(){const _0x4d392b=['37845bhvwqH','extname','9894880CoBUDt','name','push','endsWith','join','4560354KRBNfC','6697179TpzLev','.yml','.yaml','42Njqago','replace','isDirectory','38024IsrXam','dirname','12kwEhLg','relative','815735UFXjQk','1225464iVNsvC','toLowerCase','isFile','map','26qCejBv'];a144_0x1fb0=function(){return _0x4d392b;};return a144_0x1fb0();}export function isYamlFile(_0x5ae150){const _0x4fde24=a144_0x38c2;try{const _0x4ba0c9=statSync(_0x5ae150);if(!_0x4ba0c9[_0x4fde24(0x94)]())return![];const _0x49602c=a144_0x450f65[_0x4fde24(0x98)](_0x5ae150)[_0x4fde24(0x93)]();return _0x49602c===_0x4fde24(0x88)||_0x49602c===_0x4fde24(0x89);}catch{return![];}}
1
+ (function(_0x2bfec0,_0x334b04){const _0x13e09b=a147_0x4ca9,_0x292121=_0x2bfec0();while(!![]){try{const _0x5c49bc=parseInt(_0x13e09b(0x77))/0x1+parseInt(_0x13e09b(0x6e))/0x2*(parseInt(_0x13e09b(0x71))/0x3)+-parseInt(_0x13e09b(0x74))/0x4+-parseInt(_0x13e09b(0x72))/0x5*(-parseInt(_0x13e09b(0x73))/0x6)+parseInt(_0x13e09b(0x7a))/0x7*(-parseInt(_0x13e09b(0x6c))/0x8)+-parseInt(_0x13e09b(0x6f))/0x9+-parseInt(_0x13e09b(0x68))/0xa*(-parseInt(_0x13e09b(0x66))/0xb);if(_0x5c49bc===_0x334b04)break;else _0x292121['push'](_0x292121['shift']());}catch(_0x2750f9){_0x292121['push'](_0x292121['shift']());}}}(a147_0x3208,0xe41f4));import{readdirSync,statSync}from'fs';import a147_0x513858 from'path';export function findYamlFiles(_0x34affc){const _0x55598d=[];function _0x3528b2(_0x3b3050){const _0x3a411a=a147_0x4ca9,_0x17230f=readdirSync(_0x3b3050,{'withFileTypes':!![]});for(const _0x4507cf of _0x17230f){const _0x44e4cd=a147_0x513858[_0x3a411a(0x6a)](_0x3b3050,_0x4507cf[_0x3a411a(0x79)]);if(_0x4507cf[_0x3a411a(0x70)]())_0x3528b2(_0x44e4cd);else(_0x4507cf['name']['endsWith'](_0x3a411a(0x67))||_0x4507cf[_0x3a411a(0x79)][_0x3a411a(0x6d)](_0x3a411a(0x75)))&&_0x55598d[_0x3a411a(0x69)](_0x44e4cd);}}return _0x3528b2(_0x34affc),_0x55598d;}function a147_0x4ca9(_0x213871,_0x4e888e){_0x213871=_0x213871-0x66;const _0x320800=a147_0x3208();let _0x4ca9a3=_0x320800[_0x213871];return _0x4ca9a3;}export function discoverYamlFiles(_0x884293){const _0x5148f5=a147_0x4ca9,_0x377769=findYamlFiles(_0x884293);return _0x377769[_0x5148f5(0x6b)](_0x558b1d=>{const _0x4047ad=_0x5148f5,_0x1b0f71=a147_0x513858[_0x4047ad(0x76)](_0x884293,_0x558b1d),_0x3faa88=a147_0x513858['dirname'](_0x1b0f71);return{'absolutePath':_0x558b1d,'relativePath':_0x1b0f71,'folderPath':_0x3faa88==='.'?'':_0x3faa88['replace'](/\\/g,'/')};});}function a147_0x3208(){const _0x23bea4=['215aBdpGn','201138UHchEh','1848808NDLejt','.yaml','relative','848030cHvgUc','extname','name','28NhBnvK','10245191vFAanT','.yml','10uXqXEj','push','join','map','1282392lwMRdq','endsWith','10214oVolcU','14095251ApfHAy','isDirectory','225mbgWCa'];a147_0x3208=function(){return _0x23bea4;};return a147_0x3208();}export function isYamlFile(_0x42673e){const _0x3d9cd3=a147_0x4ca9;try{const _0x3020d3=statSync(_0x42673e);if(!_0x3020d3['isFile']())return![];const _0x3f9cc9=a147_0x513858[_0x3d9cd3(0x78)](_0x42673e)['toLowerCase']();return _0x3f9cc9===_0x3d9cd3(0x67)||_0x3f9cc9===_0x3d9cd3(0x75);}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x99cccc,_0x41f9fe){const _0x161476=a145_0x4ecf,_0xa69acb=_0x99cccc();while(!![]){try{const _0x2e2b1e=-parseInt(_0x161476(0x193))/0x1*(-parseInt(_0x161476(0x191))/0x2)+parseInt(_0x161476(0x163))/0x3+-parseInt(_0x161476(0x145))/0x4+-parseInt(_0x161476(0x15d))/0x5*(parseInt(_0x161476(0x18e))/0x6)+-parseInt(_0x161476(0x180))/0x7+parseInt(_0x161476(0x160))/0x8+-parseInt(_0x161476(0x15c))/0x9*(-parseInt(_0x161476(0x15e))/0xa);if(_0x2e2b1e===_0x41f9fe)break;else _0xa69acb['push'](_0xa69acb['shift']());}catch(_0x349b7a){_0xa69acb['push'](_0xa69acb['shift']());}}}(a145_0x3a8b,0xcfeec));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x6ce6f0){const _0x3ffc26=a145_0x4ecf;return _0x6ce6f0[_0x3ffc26(0x166)]()[_0x3ffc26(0x17c)](/\s+/g,'_')['replace'](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x3ffc26(0x17c)](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0x48ba7c){const _0x3edc90=a145_0x4ecf,_0xf300f4=_0x48ba7c[_0x3edc90(0x16e)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0xf300f4){const _0x1acaa6=_0xf300f4[0x1][_0x3edc90(0x166)](),_0x38e8ef=_0xf300f4[0x2],_0x1a67ef=_0x38e8ef[_0x3edc90(0x17c)](/-/g,'')['slice'](0x0,0x4)['toLowerCase']();return _0x1acaa6+'_'+_0x1a67ef;}const _0x3b9472=_0x48ba7c[_0x3edc90(0x16e)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x3b9472){const _0xac3dcf=_0x3b9472[0x1],_0x308964=_0x3b9472[0x2][_0x3edc90(0x166)](),_0x525fe6=_0xac3dcf[_0x3edc90(0x17c)](/-/g,'')[_0x3edc90(0x153)](0x0,0x4)[_0x3edc90(0x166)]();return _0x308964+'_'+_0x525fe6;}return undefined;}function stableStringify(_0x48ab10){const _0x4fa6da=a145_0x4ecf;if(Array[_0x4fa6da(0x190)](_0x48ab10))return'['+_0x48ab10['map'](_0x58bdea=>stableStringify(_0x58bdea))[_0x4fa6da(0x147)](',')+']';if(_0x48ab10&&typeof _0x48ab10===_0x4fa6da(0x17d)){const _0xe813a7=_0x48ab10,_0x183254=Object[_0x4fa6da(0x17a)](_0xe813a7)[_0x4fa6da(0x14f)](),_0x2f4fa6=_0x183254['map'](_0x189e07=>'\x22'+_0x189e07+'\x22:'+stableStringify(_0xe813a7[_0x189e07]));return'{'+_0x2f4fa6[_0x4fa6da(0x147)](',')+'}';}const _0x551b28=JSON[_0x4fa6da(0x14c)](_0x48ab10);return _0x551b28===undefined?_0x4fa6da(0x158):_0x551b28;}export function consolidateActivationsByContent(_0x472c48){const _0x5313c9=a145_0x4ecf,_0x46abd0={},_0x350db5=new Map(),_0x433afe=new Map();for(const _0x3d23f4 of _0x472c48){if(!_0x3d23f4)continue;for(const [_0x4ef848,_0x10bf09]of Object[_0x5313c9(0x173)](_0x3d23f4)){const _0x342994={'name':_0x10bf09[_0x5313c9(0x171)],'connection':_0x10bf09[_0x5313c9(0x14d)],..._0x10bf09[_0x5313c9(0x17e)]!==undefined&&{'all_columns':_0x10bf09['all_columns']},..._0x10bf09[_0x5313c9(0x168)]!==undefined&&{'columns':_0x10bf09[_0x5313c9(0x168)]},..._0x10bf09[_0x5313c9(0x16d)]!==undefined&&{'behavior':_0x10bf09[_0x5313c9(0x16d)]},..._0x10bf09[_0x5313c9(0x154)]!==undefined&&{'schedule':_0x10bf09[_0x5313c9(0x154)]},..._0x10bf09['notification']!==undefined&&{'notification':_0x10bf09[_0x5313c9(0x186)]},..._0x10bf09[_0x5313c9(0x156)]!==undefined&&{'connector_config':_0x10bf09[_0x5313c9(0x156)]},..._0x10bf09['activation_template_id']!==undefined&&{'activation_template_id':_0x10bf09[_0x5313c9(0x146)]}},_0x5a3729=stableStringify(_0x342994),_0x5c9d08=_0x433afe[_0x5313c9(0x179)](_0x5a3729);_0x5c9d08?_0x350db5['set'](_0x4ef848,_0x5c9d08):(_0x46abd0[_0x4ef848]=_0x10bf09,_0x350db5['set'](_0x4ef848,_0x4ef848),_0x433afe[_0x5313c9(0x188)](_0x5a3729,_0x4ef848));}}return{'merged':_0x46abd0,'nameMapping':_0x350db5};}export function updateActivationReferences(_0x22b932,_0x1ff1ca){const _0x708717=a145_0x4ecf;if(!_0x22b932)return;for(const _0x14122f of _0x22b932){if(!_0x14122f[_0x708717(0x164)])continue;for(const _0x9e0f57 of _0x14122f[_0x708717(0x164)]){if(_0x9e0f57['type']===_0x708717(0x178)&&_0x9e0f57[_0x708717(0x149)]?.[_0x708717(0x178)]){const _0x1d7b2d=_0x1ff1ca[_0x708717(0x179)](_0x9e0f57[_0x708717(0x149)][_0x708717(0x178)]);_0x1d7b2d&&_0x1d7b2d!==_0x9e0f57[_0x708717(0x149)][_0x708717(0x178)]&&(_0x9e0f57['with'][_0x708717(0x178)]=_0x1d7b2d);}}}}export function consolidateSegmentsByContent(_0x64b0b3,_0x356d4d){const _0x20b6b3=a145_0x4ecf,_0x428253={},_0x33a390=new Map(),_0x288652=new Map();for(const _0x4c9be4 of _0x64b0b3){if(!_0x4c9be4)continue;for(const [_0x451537,_0x296f22]of Object[_0x20b6b3(0x173)](_0x4c9be4)){if(!_0x296f22['rule']){_0x428253[_0x451537]=_0x296f22,_0x33a390[_0x20b6b3(0x188)](_0x451537,_0x451537);continue;}const _0x30cc6c=_0x296f22[_0x20b6b3(0x162)]&&_0x296f22['description'][_0x20b6b3(0x18f)]()?_0x296f22[_0x20b6b3(0x162)]:undefined,_0x22fd6a=JSON[_0x20b6b3(0x14c)]({'description':_0x30cc6c,'rule':deepSortObject(_0x296f22[_0x20b6b3(0x150)])}),_0x4dcf32=_0x288652['get'](_0x22fd6a);if(_0x4dcf32){const _0x50ba5e={..._0x296f22[_0x20b6b3(0x162)]!==undefined&&{'description':_0x296f22[_0x20b6b3(0x162)]},'rule':_0x296f22[_0x20b6b3(0x150)]?deepSortObject(_0x296f22[_0x20b6b3(0x150)]):_0x296f22[_0x20b6b3(0x150)]};if(_0x451537<_0x4dcf32){_0x428253[_0x451537]=_0x50ba5e,delete _0x428253[_0x4dcf32];for(const [_0xc2ce7c,_0x83182f]of _0x33a390['entries']()){_0x83182f===_0x4dcf32&&_0x33a390[_0x20b6b3(0x188)](_0xc2ce7c,_0x451537);}_0x33a390['set'](_0x451537,_0x451537),_0x288652['set'](_0x22fd6a,_0x451537);}else _0x428253[_0x4dcf32]=_0x50ba5e,_0x33a390['set'](_0x451537,_0x4dcf32);}else{let _0x5cfe1b=_0x451537;if(_0x356d4d){const _0x5781dd=_0x356d4d[_0x20b6b3(0x179)](_0x22fd6a);_0x5781dd&&_0x5781dd[_0x20b6b3(0x194)]>0x0&&(_0x5cfe1b=_0x5781dd['slice']()[_0x20b6b3(0x14f)]()[0x0]);}const _0x1b6b3d={..._0x296f22[_0x20b6b3(0x162)]!==undefined&&{'description':_0x296f22['description']},'rule':_0x296f22[_0x20b6b3(0x150)]?deepSortObject(_0x296f22[_0x20b6b3(0x150)]):_0x296f22[_0x20b6b3(0x150)]};_0x428253[_0x5cfe1b]=_0x1b6b3d,_0x33a390['set'](_0x451537,_0x5cfe1b),_0x288652['set'](_0x22fd6a,_0x5cfe1b);}}}return{'merged':_0x428253,'nameMapping':_0x33a390};}export function updateSegmentReferences(_0x597ce3,_0x397f52){const _0x5a2503=a145_0x4ecf;if(!_0x597ce3)return;for(const _0x51b844 of _0x597ce3){if(_0x51b844[_0x5a2503(0x189)]?.[_0x5a2503(0x165)]){const _0x3871b6=_0x397f52[_0x5a2503(0x179)](_0x51b844[_0x5a2503(0x189)][_0x5a2503(0x165)]);_0x3871b6&&(_0x51b844[_0x5a2503(0x189)][_0x5a2503(0x165)]=_0x3871b6);}if(_0x51b844[_0x5a2503(0x15b)])for(const _0x230827 of _0x51b844[_0x5a2503(0x15b)]){if(_0x230827['segment']){const _0x7fd8ea=_0x397f52[_0x5a2503(0x179)](_0x230827[_0x5a2503(0x165)]);_0x7fd8ea&&(_0x230827[_0x5a2503(0x165)]=_0x7fd8ea);}}if(_0x51b844[_0x5a2503(0x18c)]?.[_0x5a2503(0x165)]){const _0x27153c=_0x397f52[_0x5a2503(0x179)](_0x51b844[_0x5a2503(0x18c)][_0x5a2503(0x165)]);_0x27153c&&(_0x51b844[_0x5a2503(0x18c)][_0x5a2503(0x165)]=_0x27153c);}if(_0x51b844[_0x5a2503(0x164)])for(const _0x1add37 of _0x51b844[_0x5a2503(0x164)]){if(_0x1add37['type']===_0x5a2503(0x18d)&&_0x1add37[_0x5a2503(0x149)]?.['branches'])for(const _0x34358b of _0x1add37[_0x5a2503(0x149)][_0x5a2503(0x170)]){if(_0x34358b['segment']){const _0xd34ca0=_0x397f52[_0x5a2503(0x179)](_0x34358b[_0x5a2503(0x165)]);_0xd34ca0&&(_0x34358b[_0x5a2503(0x165)]=_0xd34ca0);}}if(_0x1add37[_0x5a2503(0x14b)]==='wait'&&_0x1add37['with']?.['condition']?.[_0x5a2503(0x165)]){const _0x330679=_0x397f52[_0x5a2503(0x179)](_0x1add37[_0x5a2503(0x149)][_0x5a2503(0x15f)]['segment']);_0x330679&&(_0x1add37['with'][_0x5a2503(0x15f)][_0x5a2503(0x165)]=_0x330679);}}}}export function updateSegmentRefsInSegments(_0x246ea5,_0x195bf6){const _0x41c84b=a145_0x4ecf;for(const _0x30ee5f of Object[_0x41c84b(0x15a)](_0x246ea5)){_0x30ee5f[_0x41c84b(0x150)]&&updateSegmentRefsInRule(_0x30ee5f['rule'],_0x195bf6);}}function updateSegmentRefsInRule(_0x565e01,_0x105c56){const _0xd5e262=a145_0x4ecf;if(_0x565e01===null||typeof _0x565e01!==_0xd5e262(0x17d))return;if(Array[_0xd5e262(0x190)](_0x565e01)){for(const _0x4d3f19 of _0x565e01){updateSegmentRefsInRule(_0x4d3f19,_0x105c56);}return;}const _0x42e954=_0x565e01;if((_0x42e954['type']==='include'||_0x42e954['type']==='exclude')&&typeof _0x42e954['segment']===_0xd5e262(0x14e)){const _0x1b4436=_0x105c56['get'](_0x42e954[_0xd5e262(0x165)]);_0x1b4436&&(_0x42e954[_0xd5e262(0x165)]=_0x1b4436);}if(_0x42e954[_0xd5e262(0x14a)]&&Array[_0xd5e262(0x190)](_0x42e954['conditions']))for(const _0x58e321 of _0x42e954['conditions']){updateSegmentRefsInRule(_0x58e321,_0x105c56);}}function a145_0x4ecf(_0x58e0cb,_0x38aa0){_0x58e0cb=_0x58e0cb-0x143;const _0x3a8b03=a145_0x3a8b();let _0x4ecff2=_0x3a8b03[_0x58e0cb];return _0x4ecff2;}export function buildJourneysArray(_0x31828e,_0x56c4d8){const _0x24ec7e=a145_0x4ecf;return _0x31828e[_0x24ec7e(0x192)](_0x3ff518=>{const _0x10875a=_0x24ec7e,_0x57f851=_0x56c4d8?_0x3ff518[_0x10875a(0x183)]['id']===_0x56c4d8:_0x31828e[_0x10875a(0x194)]===0x1,_0x2fe333=_0x3ff518[_0x10875a(0x181)][_0x10875a(0x167)]?.[0x0],_0x59b2fa=_0x2fe333?.[_0x10875a(0x18a)]||_0x3ff518[_0x10875a(0x181)][_0x10875a(0x18a)],_0x10272a={'version':_0x2fe333?.[_0x10875a(0x172)]||_0x3ff518[_0x10875a(0x181)]['version']||_0x3ff518['item'][_0x10875a(0x171)],'state':_0x3ff518[_0x10875a(0x183)][_0x10875a(0x155)]===_0x10875a(0x143)?_0x10875a(0x143):_0x10875a(0x187),'stages':_0x2fe333?.[_0x10875a(0x176)]||_0x3ff518[_0x10875a(0x181)][_0x10875a(0x176)]||[],'id':_0x2fe333?.['id']||_0x3ff518[_0x10875a(0x181)]['id'],'version_number':_0x2fe333?.[_0x10875a(0x174)]||_0x3ff518['yaml'][_0x10875a(0x174)]};return _0x59b2fa&&(_0x10272a['goal']=_0x59b2fa),_0x57f851&&(_0x10272a[_0x10875a(0x16c)]=!![]),_0x10272a;});}function a145_0x3a8b(){const _0x296294=['index','branches','name','version','entries','version_number','journeyStages','stages','endsWith','activation','get','keys','versions','replace','object','all_columns','wait','10101413FLEnCT','yaml','find','item','startsWith','.yaml','notification','draft','set','entry_criteria','goal','reentry','milestone','decision_point','6unnsTq','trim','isArray','21014AFEdUL','map','100mCJFFo','length','launched','bundle_id','6793796SMxzvM','activation_template_id','join','segments','with','conditions','type','stringify','connection','string','sort','rule','activations','bundle_name','slice','schedule','state','connector_config','merged','null','journeyBundleName','values','exit_criteria','18oHrSxi','4727295oDSyhD','13557680mkasCz','condition','9038880FlLrck','journey','description','139689CxYpcL','steps','segment','toLowerCase','journeys','columns','push','some','attributes','latest','behavior','match'];a145_0x3a8b=function(){return _0x296294;};return a145_0x3a8b();}export function buildMergedJourneyDef(_0x22f6fe,_0x1d6e42,_0x3bce7f){const _0x27f5d8=a145_0x4ecf,_0xa4b233=_0x22f6fe[0x0]['yaml'],_0x2931a6=buildJourneysArray(_0x22f6fe,_0x3bce7f),{merged:_0x4e9d66,nameMapping:_0x1ed67c}=consolidateSegmentsByContent(_0x22f6fe[_0x27f5d8(0x192)](_0x5c76e3=>_0x5c76e3[_0x27f5d8(0x181)][_0x27f5d8(0x148)]),_0x1d6e42);updateSegmentRefsInSegments(_0x4e9d66,_0x1ed67c);const _0x50c52b=Array['from'](_0x1ed67c[_0x27f5d8(0x173)]())[_0x27f5d8(0x16a)](([_0x5d9179,_0x19db01])=>_0x5d9179!==_0x19db01&&_0x5d9179[_0x27f5d8(0x184)](_0x27f5d8(0x189)));let _0x13c900=_0x4e9d66,_0x26c3a5=new Map();if(_0x50c52b){const _0x42db74=consolidateSegmentsByContent([_0x4e9d66],_0x1d6e42);_0x13c900=_0x42db74[_0x27f5d8(0x157)],_0x26c3a5=_0x42db74['nameMapping'];}const _0x5888ca=new Map(_0x1ed67c);for(const [_0x242135,_0x4b3981]of _0x26c3a5['entries']()){_0x5888ca['set'](_0x242135,_0x4b3981);}for(const [_0xc9da23,_0x575a14]of _0x5888ca['entries']()){let _0x26c555=_0x575a14,_0x57a999=0x0;while(_0x5888ca['has'](_0x26c555)&&_0x5888ca[_0x27f5d8(0x179)](_0x26c555)!==_0x26c555&&_0x57a999<MAX_MAPPING_CHAIN_DEPTH){_0x26c555=_0x5888ca['get'](_0x26c555),_0x57a999++;}_0x26c555!==_0x575a14&&_0x5888ca['set'](_0xc9da23,_0x26c555);}for(const _0x339e50 of _0x2931a6){updateSegmentReferences(_0x339e50[_0x27f5d8(0x176)],_0x5888ca);}const {merged:_0x3f3105,nameMapping:_0x18faa3}=consolidateActivationsByContent(_0x22f6fe[_0x27f5d8(0x192)](_0x5c064a=>_0x5c064a[_0x27f5d8(0x181)][_0x27f5d8(0x151)]));for(const _0x3573d1 of _0x2931a6){updateActivationReferences(_0x3573d1[_0x27f5d8(0x176)],_0x18faa3);}let _0x471ef1=_0xa4b233[_0x27f5d8(0x18a)];if(_0x471ef1?.[_0x27f5d8(0x165)]){const _0x4b190a=_0x5888ca['get'](_0x471ef1[_0x27f5d8(0x165)]);_0x4b190a&&(_0x471ef1={..._0x471ef1,'segment':_0x4b190a});}for(const _0x51a097 of _0x2931a6){if(_0x51a097[_0x27f5d8(0x18a)]?.['segment']){const _0x3c8533=_0x5888ca[_0x27f5d8(0x179)](_0x51a097['goal'][_0x27f5d8(0x165)]);_0x3c8533&&(_0x51a097[_0x27f5d8(0x18a)]={..._0x51a097[_0x27f5d8(0x18a)],'segment':_0x3c8533});}}return _0x2931a6[_0x27f5d8(0x16a)](_0x2bc5f8=>_0x2bc5f8[_0x27f5d8(0x18a)])&&(_0x471ef1=undefined),{'type':_0x27f5d8(0x161),'name':_0xa4b233[_0x27f5d8(0x171)],'description':_0xa4b233[_0x27f5d8(0x162)],'goal':_0x471ef1,'reentry':_0xa4b233[_0x27f5d8(0x18b)],'segments':Object[_0x27f5d8(0x17a)](_0x13c900)['length']>0x0?_0x13c900:undefined,'activations':Object[_0x27f5d8(0x17a)](_0x3f3105)[_0x27f5d8(0x194)]>0x0?_0x3f3105:undefined,'journeys':_0x2931a6,'bundle_id':_0xa4b233[_0x27f5d8(0x144)],'bundle_name':_0xa4b233[_0x27f5d8(0x152)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x3c8a95,_0x3a2d0e,_0x1253f4,_0x2558d0){const _0x47f7cb=a145_0x4ecf,_0x3f752b=_0x3c8a95+':'+_0x3a2d0e,_0x29dbaa=_0x1253f4[_0x47f7cb(0x179)](_0x3f752b);if(_0x29dbaa)return _0x29dbaa;const _0x1fde78=await _0x2558d0(_0x3c8a95),_0x3c301e=_0x1fde78[_0x47f7cb(0x16b)][_0x47f7cb(0x159)]||_0x1fde78[_0x47f7cb(0x16b)][_0x47f7cb(0x171)],_0x4427e9=_0x1fde78[_0x47f7cb(0x16b)][_0x47f7cb(0x175)][_0x47f7cb(0x182)](_0x166af3=>String(_0x166af3['id'])===String(_0x3a2d0e)),_0x29ff14=_0x4427e9?.['name']||_0x3a2d0e,_0x2bc9e5={'journeyName':_0x3c301e,'stageName':_0x29ff14};return _0x1253f4['set'](_0x3f752b,_0x2bc9e5),_0x2bc9e5;}export function formatApiJourneyName(_0x2a1747,_0x2ea932){return _0x2ea932+'\x20('+_0x2a1747+')';}export function isLocalJourneyRef(_0x11ea03){const _0x11e1b0=a145_0x4ecf;return _0x11ea03['endsWith']('.yml')||_0x11ea03[_0x11e1b0(0x177)](_0x11e1b0(0x185));}export function buildLocalRuleToNameMapping(_0x180e3d){const _0x3bee91=a145_0x4ecf,_0x468072=new Map();if(!_0x180e3d)return _0x468072;for(const [_0x469eb3,_0x46a744]of Object[_0x3bee91(0x173)](_0x180e3d)){if(_0x46a744['rule']){const _0x18035e=serializeRule(_0x46a744[_0x3bee91(0x150)]),_0x287b9d=_0x468072[_0x3bee91(0x179)](_0x18035e)||[];_0x287b9d['push'](_0x469eb3),_0x468072[_0x3bee91(0x188)](_0x18035e,_0x287b9d);}}return _0x468072;}export function buildLocalRuleToNameMappingFromJourney(_0x103ab8){const _0x269df1=a145_0x4ecf,_0x16e520=_0x103ab8[_0x269df1(0x148)];if(!_0x16e520)return new Map();const _0x53e1ab=collectSegmentUsageCounts(_0x103ab8),_0x468a59=new Map();let _0x2fcbcc=0x0;for(const [_0x15dfad,_0x85c296]of Object[_0x269df1(0x173)](_0x16e520)){if(!_0x85c296[_0x269df1(0x150)]){_0x2fcbcc++;continue;}const _0x2012c4=serializeRule(_0x85c296[_0x269df1(0x150)]),_0x53f433=_0x468a59[_0x269df1(0x179)](_0x2012c4)||[];_0x53f433[_0x269df1(0x169)]({'name':_0x15dfad,'index':_0x2fcbcc}),_0x468a59['set'](_0x2012c4,_0x53f433),_0x2fcbcc++;}const _0x29b104=new Map();for(const [_0x3d5721,_0x370cd8]of _0x468a59){const _0x26c07a=_0x370cd8['slice']()[_0x269df1(0x14f)]((_0x229191,_0x3e408c)=>{const _0x55c81c=_0x269df1,_0x29425d=_0x53e1ab[_0x55c81c(0x179)](_0x229191['name'])||0x0,_0x46a9c0=_0x53e1ab['get'](_0x3e408c['name'])||0x0;if(_0x29425d!==_0x46a9c0)return _0x46a9c0-_0x29425d;return _0x229191[_0x55c81c(0x16f)]-_0x3e408c[_0x55c81c(0x16f)];})[_0x269df1(0x192)](_0x3bfa60=>_0x3bfa60[_0x269df1(0x171)]);_0x29b104[_0x269df1(0x188)](_0x3d5721,_0x26c07a);}return _0x29b104;}export function collectSegmentUsageCounts(_0x4fc69d){const _0x1196df=a145_0x4ecf,_0x76d871=new Map(),_0x562a7c=_0x416d5f=>{const _0x21f61b=a145_0x4ecf;if(!_0x416d5f)return;_0x76d871[_0x21f61b(0x188)](_0x416d5f,(_0x76d871['get'](_0x416d5f)||0x0)+0x1);},_0x429eb9=_0x1d598a=>{const _0x25ce04=a145_0x4ecf;for(const _0x320588 of _0x1d598a){_0x562a7c(_0x320588[_0x25ce04(0x189)]?.[_0x25ce04(0x165)]);if(_0x320588[_0x25ce04(0x15b)])for(const _0x300d2b of _0x320588[_0x25ce04(0x15b)]){_0x562a7c(_0x300d2b[_0x25ce04(0x165)]);}_0x562a7c(_0x320588[_0x25ce04(0x18c)]?.[_0x25ce04(0x165)]);if(_0x320588['steps'])for(const _0x47a0e5 of _0x320588[_0x25ce04(0x164)]){if(_0x47a0e5[_0x25ce04(0x14b)]===_0x25ce04(0x18d))for(const _0x40567b of _0x47a0e5[_0x25ce04(0x149)][_0x25ce04(0x170)]){_0x562a7c(_0x40567b[_0x25ce04(0x165)]);}else _0x47a0e5[_0x25ce04(0x14b)]===_0x25ce04(0x17f)&&_0x562a7c(_0x47a0e5[_0x25ce04(0x149)][_0x25ce04(0x15f)]?.[_0x25ce04(0x165)]);}}};_0x562a7c(_0x4fc69d[_0x1196df(0x18a)]?.['segment']);if(_0x4fc69d[_0x1196df(0x167)])for(const _0x364cbb of _0x4fc69d['journeys']){_0x562a7c(_0x364cbb[_0x1196df(0x18a)]?.[_0x1196df(0x165)]),_0x429eb9(_0x364cbb[_0x1196df(0x176)]);}_0x4fc69d[_0x1196df(0x176)]&&_0x429eb9(_0x4fc69d[_0x1196df(0x176)]);if(_0x4fc69d[_0x1196df(0x17b)])for(const _0x1166f5 of _0x4fc69d[_0x1196df(0x17b)]){_0x429eb9(_0x1166f5[_0x1196df(0x176)]);}return _0x76d871;}
1
+ (function(_0x547a29,_0x390cb1){const _0x4101eb=a148_0x35c2,_0x1e80f9=_0x547a29();while(!![]){try{const _0x524270=parseInt(_0x4101eb(0x131))/0x1*(parseInt(_0x4101eb(0x132))/0x2)+-parseInt(_0x4101eb(0x128))/0x3+parseInt(_0x4101eb(0x155))/0x4+-parseInt(_0x4101eb(0x142))/0x5*(-parseInt(_0x4101eb(0x152))/0x6)+-parseInt(_0x4101eb(0x15c))/0x7+parseInt(_0x4101eb(0x13c))/0x8*(parseInt(_0x4101eb(0x120))/0x9)+-parseInt(_0x4101eb(0x14b))/0xa;if(_0x524270===_0x390cb1)break;else _0x1e80f9['push'](_0x1e80f9['shift']());}catch(_0x40e362){_0x1e80f9['push'](_0x1e80f9['shift']());}}}(a148_0x434f,0x4f3da));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x2984f1){const _0x5731bf=a148_0x35c2;return _0x2984f1[_0x5731bf(0x15a)]()[_0x5731bf(0x129)](/\s+/g,'_')[_0x5731bf(0x129)](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x5731bf(0x129)](/_+/g,'_')[_0x5731bf(0x129)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x3a0cab){const _0x318d23=a148_0x35c2,_0x4d5782=_0x3a0cab['match'](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x4d5782){const _0x372b4e=_0x4d5782[0x1]['toLowerCase'](),_0x388a36=_0x4d5782[0x2],_0x506068=_0x388a36['replace'](/-/g,'')[_0x318d23(0x150)](0x0,0x4)[_0x318d23(0x15a)]();return _0x372b4e+'_'+_0x506068;}const _0x1696a3=_0x3a0cab['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x1696a3){const _0x41ac3d=_0x1696a3[0x1],_0x47a134=_0x1696a3[0x2]['toLowerCase'](),_0x454755=_0x41ac3d['replace'](/-/g,'')[_0x318d23(0x150)](0x0,0x4)['toLowerCase']();return _0x47a134+'_'+_0x454755;}return undefined;}function stableStringify(_0x425779){const _0x3ce3b5=a148_0x35c2;if(Array['isArray'](_0x425779))return'['+_0x425779[_0x3ce3b5(0x156)](_0x14487d=>stableStringify(_0x14487d))[_0x3ce3b5(0x11e)](',')+']';if(_0x425779&&typeof _0x425779===_0x3ce3b5(0x15d)){const _0xc9e5ea=_0x425779,_0x25351c=Object['keys'](_0xc9e5ea)[_0x3ce3b5(0x126)](),_0x1d454e=_0x25351c[_0x3ce3b5(0x156)](_0x57f37d=>'\x22'+_0x57f37d+'\x22:'+stableStringify(_0xc9e5ea[_0x57f37d]));return'{'+_0x1d454e[_0x3ce3b5(0x11e)](',')+'}';}const _0x18d43e=JSON['stringify'](_0x425779);return _0x18d43e===undefined?_0x3ce3b5(0x160):_0x18d43e;}export function consolidateActivationsByContent(_0xf33419){const _0x2f726b=a148_0x35c2,_0x564379={},_0x1bf4ac=new Map(),_0x425474=new Map();for(const _0x19805a of _0xf33419){if(!_0x19805a)continue;for(const [_0x341d46,_0x3f3b1c]of Object[_0x2f726b(0x14a)](_0x19805a)){const _0x410fee={'name':_0x3f3b1c['name'],'connection':_0x3f3b1c[_0x2f726b(0x153)],..._0x3f3b1c[_0x2f726b(0x12b)]!==undefined&&{'all_columns':_0x3f3b1c[_0x2f726b(0x12b)]},..._0x3f3b1c[_0x2f726b(0x15f)]!==undefined&&{'columns':_0x3f3b1c['columns']},..._0x3f3b1c['behavior']!==undefined&&{'behavior':_0x3f3b1c[_0x2f726b(0x139)]},..._0x3f3b1c[_0x2f726b(0x11f)]!==undefined&&{'schedule':_0x3f3b1c[_0x2f726b(0x11f)]},..._0x3f3b1c[_0x2f726b(0x163)]!==undefined&&{'notification':_0x3f3b1c['notification']},..._0x3f3b1c[_0x2f726b(0x124)]!==undefined&&{'connector_config':_0x3f3b1c[_0x2f726b(0x124)]},..._0x3f3b1c['activation_template_id']!==undefined&&{'activation_template_id':_0x3f3b1c[_0x2f726b(0x127)]}},_0x527cbc=stableStringify(_0x410fee),_0x5b37b1=_0x425474['get'](_0x527cbc);_0x5b37b1?_0x1bf4ac['set'](_0x341d46,_0x5b37b1):(_0x564379[_0x341d46]=_0x3f3b1c,_0x1bf4ac[_0x2f726b(0x11a)](_0x341d46,_0x341d46),_0x425474[_0x2f726b(0x11a)](_0x527cbc,_0x341d46));}}return{'merged':_0x564379,'nameMapping':_0x1bf4ac};}function a148_0x434f(){const _0x60da47=['replace','journeys','all_columns','journeyBundleName','name','activations','index','endsWith','1JIFnpp','292408WWjICK','isArray','.yaml','journeyStages','wait','conditions','draft','behavior','exit_criteria','version','8cwYcXZ','push','startsWith','get','decision_point','length','90CWNJxF','version_number','has','entry_criteria','include','find','stages','rule','entries','2095770IZaVez','branches','segments','bundle_name','reentry','slice','type','33414tytvyz','connection','with','1937232aKlTvT','map','activation','attributes','state','toLowerCase','values','1147139stRUzN','object','string','columns','null','milestone','versions','notification','goal','segment','some','journey','trim','set','launched','description','steps','join','schedule','1391301ACtrCo','yaml','merged','keys','connector_config','condition','sort','activation_template_id','561957cFKHKC'];a148_0x434f=function(){return _0x60da47;};return a148_0x434f();}export function updateActivationReferences(_0x5d1b19,_0x177610){const _0x3be4ae=a148_0x35c2;if(!_0x5d1b19)return;for(const _0xe049ef of _0x5d1b19){if(!_0xe049ef[_0x3be4ae(0x11d)])continue;for(const _0x222569 of _0xe049ef[_0x3be4ae(0x11d)]){if(_0x222569[_0x3be4ae(0x151)]===_0x3be4ae(0x157)&&_0x222569['with']?.[_0x3be4ae(0x157)]){const _0x22dfb6=_0x177610[_0x3be4ae(0x13f)](_0x222569[_0x3be4ae(0x154)][_0x3be4ae(0x157)]);_0x22dfb6&&_0x22dfb6!==_0x222569[_0x3be4ae(0x154)][_0x3be4ae(0x157)]&&(_0x222569[_0x3be4ae(0x154)][_0x3be4ae(0x157)]=_0x22dfb6);}}}}export function consolidateSegmentsByContent(_0x3c46c7,_0x2accd7){const _0x2313f9=a148_0x35c2,_0x1b5666={},_0x561c6c=new Map(),_0x5a37d7=new Map();for(const _0x28a5ca of _0x3c46c7){if(!_0x28a5ca)continue;for(const [_0x37bdeb,_0x18ac6c]of Object[_0x2313f9(0x14a)](_0x28a5ca)){if(!_0x18ac6c[_0x2313f9(0x149)]){_0x1b5666[_0x37bdeb]=_0x18ac6c,_0x561c6c[_0x2313f9(0x11a)](_0x37bdeb,_0x37bdeb);continue;}const _0x227f8e=_0x18ac6c[_0x2313f9(0x11c)]&&_0x18ac6c[_0x2313f9(0x11c)][_0x2313f9(0x119)]()?_0x18ac6c[_0x2313f9(0x11c)]:undefined,_0x7b72eb=JSON['stringify']({'description':_0x227f8e,'rule':deepSortObject(_0x18ac6c[_0x2313f9(0x149)])}),_0x124c71=_0x5a37d7['get'](_0x7b72eb);if(_0x124c71){const _0x33d3ee={..._0x18ac6c[_0x2313f9(0x11c)]!==undefined&&{'description':_0x18ac6c[_0x2313f9(0x11c)]},'rule':_0x18ac6c[_0x2313f9(0x149)]?deepSortObject(_0x18ac6c[_0x2313f9(0x149)]):_0x18ac6c[_0x2313f9(0x149)]};if(_0x37bdeb<_0x124c71){_0x1b5666[_0x37bdeb]=_0x33d3ee,delete _0x1b5666[_0x124c71];for(const [_0x11d3bd,_0x231c25]of _0x561c6c[_0x2313f9(0x14a)]()){_0x231c25===_0x124c71&&_0x561c6c[_0x2313f9(0x11a)](_0x11d3bd,_0x37bdeb);}_0x561c6c['set'](_0x37bdeb,_0x37bdeb),_0x5a37d7['set'](_0x7b72eb,_0x37bdeb);}else _0x1b5666[_0x124c71]=_0x33d3ee,_0x561c6c[_0x2313f9(0x11a)](_0x37bdeb,_0x124c71);}else{let _0x22d2ee=_0x37bdeb;if(_0x2accd7){const _0xb8fb33=_0x2accd7['get'](_0x7b72eb);_0xb8fb33&&_0xb8fb33[_0x2313f9(0x141)]>0x0&&(_0x22d2ee=_0xb8fb33['slice']()['sort']()[0x0]);}const _0x3ec8c6={..._0x18ac6c['description']!==undefined&&{'description':_0x18ac6c[_0x2313f9(0x11c)]},'rule':_0x18ac6c[_0x2313f9(0x149)]?deepSortObject(_0x18ac6c[_0x2313f9(0x149)]):_0x18ac6c[_0x2313f9(0x149)]};_0x1b5666[_0x22d2ee]=_0x3ec8c6,_0x561c6c[_0x2313f9(0x11a)](_0x37bdeb,_0x22d2ee),_0x5a37d7[_0x2313f9(0x11a)](_0x7b72eb,_0x22d2ee);}}}return{'merged':_0x1b5666,'nameMapping':_0x561c6c};}function a148_0x35c2(_0x493d9c,_0xe8efe6){_0x493d9c=_0x493d9c-0x115;const _0x434f6c=a148_0x434f();let _0x35c22f=_0x434f6c[_0x493d9c];return _0x35c22f;}export function updateSegmentReferences(_0x2b4ba5,_0xc7e65d){const _0x50cb8b=a148_0x35c2;if(!_0x2b4ba5)return;for(const _0x4dac55 of _0x2b4ba5){if(_0x4dac55[_0x50cb8b(0x145)]?.[_0x50cb8b(0x116)]){const _0x14020c=_0xc7e65d[_0x50cb8b(0x13f)](_0x4dac55['entry_criteria']['segment']);_0x14020c&&(_0x4dac55[_0x50cb8b(0x145)][_0x50cb8b(0x116)]=_0x14020c);}if(_0x4dac55[_0x50cb8b(0x13a)])for(const _0x10d0af of _0x4dac55[_0x50cb8b(0x13a)]){if(_0x10d0af[_0x50cb8b(0x116)]){const _0xde73d2=_0xc7e65d[_0x50cb8b(0x13f)](_0x10d0af[_0x50cb8b(0x116)]);_0xde73d2&&(_0x10d0af[_0x50cb8b(0x116)]=_0xde73d2);}}if(_0x4dac55['milestone']?.[_0x50cb8b(0x116)]){const _0x2c5102=_0xc7e65d[_0x50cb8b(0x13f)](_0x4dac55[_0x50cb8b(0x161)][_0x50cb8b(0x116)]);_0x2c5102&&(_0x4dac55['milestone']['segment']=_0x2c5102);}if(_0x4dac55[_0x50cb8b(0x11d)])for(const _0x5926c9 of _0x4dac55[_0x50cb8b(0x11d)]){if(_0x5926c9[_0x50cb8b(0x151)]===_0x50cb8b(0x140)&&_0x5926c9['with']?.['branches'])for(const _0x293c60 of _0x5926c9[_0x50cb8b(0x154)][_0x50cb8b(0x14c)]){if(_0x293c60[_0x50cb8b(0x116)]){const _0x2ac6da=_0xc7e65d[_0x50cb8b(0x13f)](_0x293c60[_0x50cb8b(0x116)]);_0x2ac6da&&(_0x293c60[_0x50cb8b(0x116)]=_0x2ac6da);}}if(_0x5926c9[_0x50cb8b(0x151)]===_0x50cb8b(0x136)&&_0x5926c9['with']?.[_0x50cb8b(0x125)]?.[_0x50cb8b(0x116)]){const _0x1a8e39=_0xc7e65d[_0x50cb8b(0x13f)](_0x5926c9['with'][_0x50cb8b(0x125)]['segment']);_0x1a8e39&&(_0x5926c9['with'][_0x50cb8b(0x125)][_0x50cb8b(0x116)]=_0x1a8e39);}}}}export function updateSegmentRefsInSegments(_0x30eadb,_0x442790){const _0x15260e=a148_0x35c2;for(const _0x5f37be of Object[_0x15260e(0x15b)](_0x30eadb)){_0x5f37be['rule']&&updateSegmentRefsInRule(_0x5f37be[_0x15260e(0x149)],_0x442790);}}function updateSegmentRefsInRule(_0x240694,_0x205a9a){const _0x492eeb=a148_0x35c2;if(_0x240694===null||typeof _0x240694!==_0x492eeb(0x15d))return;if(Array[_0x492eeb(0x133)](_0x240694)){for(const _0x1fd6fc of _0x240694){updateSegmentRefsInRule(_0x1fd6fc,_0x205a9a);}return;}const _0x4998cc=_0x240694;if((_0x4998cc[_0x492eeb(0x151)]===_0x492eeb(0x146)||_0x4998cc[_0x492eeb(0x151)]==='exclude')&&typeof _0x4998cc[_0x492eeb(0x116)]===_0x492eeb(0x15e)){const _0x63c437=_0x205a9a[_0x492eeb(0x13f)](_0x4998cc['segment']);_0x63c437&&(_0x4998cc[_0x492eeb(0x116)]=_0x63c437);}if(_0x4998cc[_0x492eeb(0x137)]&&Array[_0x492eeb(0x133)](_0x4998cc[_0x492eeb(0x137)]))for(const _0x413233 of _0x4998cc[_0x492eeb(0x137)]){updateSegmentRefsInRule(_0x413233,_0x205a9a);}}export function buildJourneysArray(_0x4241d2,_0x2404a4){const _0x17e80f=a148_0x35c2;return _0x4241d2[_0x17e80f(0x156)](_0x1e3534=>{const _0x3d22e0=_0x17e80f,_0x46a945=_0x2404a4?_0x1e3534['item']['id']===_0x2404a4:_0x4241d2[_0x3d22e0(0x141)]===0x1,_0x51fdec=_0x1e3534[_0x3d22e0(0x121)][_0x3d22e0(0x12a)]?.[0x0],_0xbdb7bd=_0x51fdec?.['goal']||_0x1e3534[_0x3d22e0(0x121)]['goal'],_0x10a342={'version':_0x51fdec?.[_0x3d22e0(0x13b)]||_0x1e3534[_0x3d22e0(0x121)][_0x3d22e0(0x13b)]||_0x1e3534['item'][_0x3d22e0(0x12d)],'state':_0x1e3534['item'][_0x3d22e0(0x159)]==='launched'?_0x3d22e0(0x11b):_0x3d22e0(0x138),'stages':_0x51fdec?.[_0x3d22e0(0x148)]||_0x1e3534[_0x3d22e0(0x121)][_0x3d22e0(0x148)]||[],'id':_0x51fdec?.['id']||_0x1e3534[_0x3d22e0(0x121)]['id'],'version_number':_0x51fdec?.[_0x3d22e0(0x143)]||_0x1e3534[_0x3d22e0(0x121)][_0x3d22e0(0x143)]};return _0xbdb7bd&&(_0x10a342[_0x3d22e0(0x115)]=_0xbdb7bd),_0x46a945&&(_0x10a342['latest']=!![]),_0x10a342;});}export function buildMergedJourneyDef(_0x439d7c,_0x2b0950,_0x473c2c){const _0xdfb4=a148_0x35c2,_0x475ef1=_0x439d7c[0x0][_0xdfb4(0x121)],_0x38f40a=buildJourneysArray(_0x439d7c,_0x473c2c),{merged:_0x957ed7,nameMapping:_0x434551}=consolidateSegmentsByContent(_0x439d7c['map'](_0x52072c=>_0x52072c[_0xdfb4(0x121)][_0xdfb4(0x14d)]),_0x2b0950);updateSegmentRefsInSegments(_0x957ed7,_0x434551);const _0x598169=Array['from'](_0x434551[_0xdfb4(0x14a)]())['some'](([_0x1ce274,_0x33390f])=>_0x1ce274!==_0x33390f&&_0x1ce274[_0xdfb4(0x13e)](_0xdfb4(0x145)));let _0x372226=_0x957ed7,_0x8b43a=new Map();if(_0x598169){const _0x1a464e=consolidateSegmentsByContent([_0x957ed7],_0x2b0950);_0x372226=_0x1a464e[_0xdfb4(0x122)],_0x8b43a=_0x1a464e['nameMapping'];}const _0x21f504=new Map(_0x434551);for(const [_0x578655,_0x4efdab]of _0x8b43a[_0xdfb4(0x14a)]()){_0x21f504['set'](_0x578655,_0x4efdab);}for(const [_0x35c690,_0x266318]of _0x21f504['entries']()){let _0x57c838=_0x266318,_0x454454=0x0;while(_0x21f504[_0xdfb4(0x144)](_0x57c838)&&_0x21f504[_0xdfb4(0x13f)](_0x57c838)!==_0x57c838&&_0x454454<MAX_MAPPING_CHAIN_DEPTH){_0x57c838=_0x21f504[_0xdfb4(0x13f)](_0x57c838),_0x454454++;}_0x57c838!==_0x266318&&_0x21f504[_0xdfb4(0x11a)](_0x35c690,_0x57c838);}for(const _0x57c7c1 of _0x38f40a){updateSegmentReferences(_0x57c7c1[_0xdfb4(0x148)],_0x21f504);}const {merged:_0x394135,nameMapping:_0x2d2a9d}=consolidateActivationsByContent(_0x439d7c['map'](_0x40bc00=>_0x40bc00['yaml'][_0xdfb4(0x12e)]));for(const _0x2f6cf2 of _0x38f40a){updateActivationReferences(_0x2f6cf2[_0xdfb4(0x148)],_0x2d2a9d);}let _0xd4e9fd=_0x475ef1[_0xdfb4(0x115)];if(_0xd4e9fd?.['segment']){const _0x10d925=_0x21f504[_0xdfb4(0x13f)](_0xd4e9fd['segment']);_0x10d925&&(_0xd4e9fd={..._0xd4e9fd,'segment':_0x10d925});}for(const _0x4deda5 of _0x38f40a){if(_0x4deda5[_0xdfb4(0x115)]?.[_0xdfb4(0x116)]){const _0x3767a9=_0x21f504[_0xdfb4(0x13f)](_0x4deda5[_0xdfb4(0x115)]['segment']);_0x3767a9&&(_0x4deda5[_0xdfb4(0x115)]={..._0x4deda5[_0xdfb4(0x115)],'segment':_0x3767a9});}}return _0x38f40a[_0xdfb4(0x117)](_0x5b0728=>_0x5b0728[_0xdfb4(0x115)])&&(_0xd4e9fd=undefined),{'type':_0xdfb4(0x118),'name':_0x475ef1[_0xdfb4(0x12d)],'description':_0x475ef1[_0xdfb4(0x11c)],'goal':_0xd4e9fd,'reentry':_0x475ef1[_0xdfb4(0x14f)],'segments':Object['keys'](_0x372226)[_0xdfb4(0x141)]>0x0?_0x372226:undefined,'activations':Object[_0xdfb4(0x123)](_0x394135)[_0xdfb4(0x141)]>0x0?_0x394135:undefined,'journeys':_0x38f40a,'bundle_id':_0x475ef1['bundle_id'],'bundle_name':_0x475ef1[_0xdfb4(0x14e)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x4bfc77,_0x626882,_0x27839b,_0x535019){const _0x373b2b=a148_0x35c2,_0x456efb=_0x4bfc77+':'+_0x626882,_0xd7c013=_0x27839b[_0x373b2b(0x13f)](_0x456efb);if(_0xd7c013)return _0xd7c013;const _0xd697a8=await _0x535019(_0x4bfc77),_0x11726b=_0xd697a8[_0x373b2b(0x158)][_0x373b2b(0x12c)]||_0xd697a8[_0x373b2b(0x158)]['name'],_0x45ccee=_0xd697a8[_0x373b2b(0x158)][_0x373b2b(0x135)][_0x373b2b(0x147)](_0x3171fd=>String(_0x3171fd['id'])===String(_0x626882)),_0xac28eb=_0x45ccee?.['name']||_0x626882,_0x1eb3c3={'journeyName':_0x11726b,'stageName':_0xac28eb};return _0x27839b[_0x373b2b(0x11a)](_0x456efb,_0x1eb3c3),_0x1eb3c3;}export function formatApiJourneyName(_0x58da2e,_0x497cba){return _0x497cba+'\x20('+_0x58da2e+')';}export function isLocalJourneyRef(_0x3fc363){const _0x35563b=a148_0x35c2;return _0x3fc363[_0x35563b(0x130)]('.yml')||_0x3fc363[_0x35563b(0x130)](_0x35563b(0x134));}export function buildLocalRuleToNameMapping(_0x18a37e){const _0x250000=a148_0x35c2,_0x36f8d6=new Map();if(!_0x18a37e)return _0x36f8d6;for(const [_0x13e55f,_0x45b2f2]of Object['entries'](_0x18a37e)){if(_0x45b2f2[_0x250000(0x149)]){const _0x3e1ac5=serializeRule(_0x45b2f2['rule']),_0x513631=_0x36f8d6[_0x250000(0x13f)](_0x3e1ac5)||[];_0x513631['push'](_0x13e55f),_0x36f8d6[_0x250000(0x11a)](_0x3e1ac5,_0x513631);}}return _0x36f8d6;}export function buildLocalRuleToNameMappingFromJourney(_0x5a5f18){const _0x52e27d=a148_0x35c2,_0x4d6dd2=_0x5a5f18[_0x52e27d(0x14d)];if(!_0x4d6dd2)return new Map();const _0x1a480a=collectSegmentUsageCounts(_0x5a5f18),_0x3fc9db=new Map();let _0x26c299=0x0;for(const [_0x560688,_0x5662ae]of Object[_0x52e27d(0x14a)](_0x4d6dd2)){if(!_0x5662ae[_0x52e27d(0x149)]){_0x26c299++;continue;}const _0x25e2bc=serializeRule(_0x5662ae[_0x52e27d(0x149)]),_0x4712ec=_0x3fc9db['get'](_0x25e2bc)||[];_0x4712ec[_0x52e27d(0x13d)]({'name':_0x560688,'index':_0x26c299}),_0x3fc9db['set'](_0x25e2bc,_0x4712ec),_0x26c299++;}const _0x4c4179=new Map();for(const [_0xb89f97,_0x17082d]of _0x3fc9db){const _0x48865b=_0x17082d[_0x52e27d(0x150)]()['sort']((_0x51f042,_0x324239)=>{const _0x55c3aa=_0x52e27d,_0x10e9f0=_0x1a480a[_0x55c3aa(0x13f)](_0x51f042[_0x55c3aa(0x12d)])||0x0,_0x687405=_0x1a480a[_0x55c3aa(0x13f)](_0x324239['name'])||0x0;if(_0x10e9f0!==_0x687405)return _0x687405-_0x10e9f0;return _0x51f042[_0x55c3aa(0x12f)]-_0x324239['index'];})[_0x52e27d(0x156)](_0x23469c=>_0x23469c[_0x52e27d(0x12d)]);_0x4c4179['set'](_0xb89f97,_0x48865b);}return _0x4c4179;}export function collectSegmentUsageCounts(_0x16b128){const _0x2db62c=a148_0x35c2,_0x33821f=new Map(),_0x5b7be2=_0x1ab1c8=>{const _0x2a2e91=a148_0x35c2;if(!_0x1ab1c8)return;_0x33821f['set'](_0x1ab1c8,(_0x33821f[_0x2a2e91(0x13f)](_0x1ab1c8)||0x0)+0x1);},_0x4ac48a=_0x492773=>{const _0x5b1c3c=a148_0x35c2;for(const _0x6c49d0 of _0x492773){_0x5b7be2(_0x6c49d0[_0x5b1c3c(0x145)]?.[_0x5b1c3c(0x116)]);if(_0x6c49d0[_0x5b1c3c(0x13a)])for(const _0x2c4af3 of _0x6c49d0['exit_criteria']){_0x5b7be2(_0x2c4af3[_0x5b1c3c(0x116)]);}_0x5b7be2(_0x6c49d0[_0x5b1c3c(0x161)]?.['segment']);if(_0x6c49d0[_0x5b1c3c(0x11d)])for(const _0x2d57f9 of _0x6c49d0[_0x5b1c3c(0x11d)]){if(_0x2d57f9[_0x5b1c3c(0x151)]===_0x5b1c3c(0x140))for(const _0x20c470 of _0x2d57f9[_0x5b1c3c(0x154)][_0x5b1c3c(0x14c)]){_0x5b7be2(_0x20c470['segment']);}else _0x2d57f9[_0x5b1c3c(0x151)]===_0x5b1c3c(0x136)&&_0x5b7be2(_0x2d57f9['with'][_0x5b1c3c(0x125)]?.[_0x5b1c3c(0x116)]);}}};_0x5b7be2(_0x16b128[_0x2db62c(0x115)]?.[_0x2db62c(0x116)]);if(_0x16b128[_0x2db62c(0x12a)])for(const _0x3b095e of _0x16b128[_0x2db62c(0x12a)]){_0x5b7be2(_0x3b095e[_0x2db62c(0x115)]?.[_0x2db62c(0x116)]),_0x4ac48a(_0x3b095e['stages']);}_0x16b128['stages']&&_0x4ac48a(_0x16b128[_0x2db62c(0x148)]);if(_0x16b128[_0x2db62c(0x162)])for(const _0x2d5109 of _0x16b128[_0x2db62c(0x162)]){_0x4ac48a(_0x2d5109[_0x2db62c(0x148)]);}return _0x33821f;}
@@ -1 +1 @@
1
- (function(_0x17d7a1,_0x11fd93){const _0x5e1059=a146_0x2f2f,_0x1e91ff=_0x17d7a1();while(!![]){try{const _0x5427d8=-parseInt(_0x5e1059(0x11c))/0x1*(parseInt(_0x5e1059(0x114))/0x2)+parseInt(_0x5e1059(0x142))/0x3+parseInt(_0x5e1059(0xf2))/0x4+parseInt(_0x5e1059(0x151))/0x5+parseInt(_0x5e1059(0x14b))/0x6*(parseInt(_0x5e1059(0xfe))/0x7)+-parseInt(_0x5e1059(0x13e))/0x8*(-parseInt(_0x5e1059(0x116))/0x9)+-parseInt(_0x5e1059(0x163))/0xa;if(_0x5427d8===_0x11fd93)break;else _0x1e91ff['push'](_0x1e91ff['shift']());}catch(_0x16833d){_0x1e91ff['push'](_0x1e91ff['shift']());}}}(a146_0x68b2,0x68b71));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x344904,_0x35bac2,_0x18d48f,_0x38e38e,_0x35f705,_0x34f521){const _0x393f4a=a146_0x2f2f;return{'level':_0x344904,'path':_0x35bac2,'code':_0x18d48f,'message':_0x38e38e,'location':getLocationFromPath(_0x35f705[_0x393f4a(0x122)],_0x35f705[_0x393f4a(0x157)],pathToArray(_0x34f521??_0x35bac2))};}function validateVersionStructure(_0x3d2a1a,_0x2f0bd8){const _0x4dd4ab=a146_0x2f2f,_0x3addd4=[];return _0x3d2a1a[_0x4dd4ab(0x125)]>MAX_STAGES&&_0x3addd4['push'](createIssue('error','stages','TOO_MANY_STAGES',_0x4dd4ab(0x17d)+_0x3d2a1a[_0x4dd4ab(0x125)]+_0x4dd4ab(0x11b)+MAX_STAGES,_0x2f0bd8)),_0x3addd4;}function validateStageStructure(_0x1dd860,_0x2867ee,_0x4fe440,_0x4b41ba){const _0x557b3b=a146_0x2f2f,_0x47789d=[],_0x49a179=_0x557b3b(0x15c)+_0x2867ee+']';_0x2867ee===0x0&&!_0x1dd860[_0x557b3b(0x111)]&&_0x47789d[_0x557b3b(0x13d)](createIssue('error',_0x49a179+_0x557b3b(0xd3),_0x557b3b(0xd5),'Stage\x20\x27'+_0x1dd860[_0x557b3b(0x188)]+_0x557b3b(0x166),_0x4b41ba,_0x49a179));const _0xe56d08=_0x2867ee===_0x4fe440-0x1;!_0xe56d08&&!_0x1dd860[_0x557b3b(0x109)]&&_0x47789d[_0x557b3b(0x13d)](createIssue('error',_0x49a179+_0x557b3b(0xf1),'MISSING_MILESTONE',_0x557b3b(0x14c)+_0x1dd860[_0x557b3b(0x188)]+_0x557b3b(0x170),_0x4b41ba,_0x49a179));(!_0x1dd860['exit_criteria']||_0x1dd860[_0x557b3b(0x11d)][_0x557b3b(0x125)]===0x0)&&_0x47789d[_0x557b3b(0x13d)](createIssue(_0x557b3b(0x168),_0x49a179+_0x557b3b(0x141),_0x557b3b(0x12d),'Stage\x20\x27'+_0x1dd860[_0x557b3b(0x188)]+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x4b41ba,_0x49a179));const _0x332fd2=_0x1dd860[_0x557b3b(0x152)]?.[_0x557b3b(0x125)]??0x0;if(_0x332fd2===0x0)_0x47789d['push'](createIssue('error',_0x49a179+'.steps','INSUFFICIENT_STEPS',_0x557b3b(0x14c)+_0x1dd860['name']+'\x27\x20has\x20no\x20steps',_0x4b41ba,_0x49a179+_0x557b3b(0x113)));else{if(_0x332fd2===0x1)_0x47789d[_0x557b3b(0x13d)](createIssue(_0x557b3b(0x168),_0x49a179+_0x557b3b(0x113),_0x557b3b(0xf8),_0x557b3b(0x14c)+_0x1dd860[_0x557b3b(0x188)]+_0x557b3b(0x131),_0x4b41ba,_0x49a179+_0x557b3b(0x113)));else _0x332fd2<=0x3&&_0x47789d['push'](createIssue(_0x557b3b(0x168),_0x49a179+_0x557b3b(0x113),_0x557b3b(0x167),_0x557b3b(0x14c)+_0x1dd860[_0x557b3b(0x188)]+_0x557b3b(0x14f)+_0x332fd2+_0x557b3b(0x14a),_0x4b41ba,_0x49a179+_0x557b3b(0x113)));}return _0x47789d;}function validateStep(_0x234a59,_0xe8a7ac,_0x50981e,_0x2ce189){const _0x8556ae=a146_0x2f2f,_0x1e7d72=[];if(_0x234a59['type']===_0x8556ae(0x123))return _0x234a59['next']&&_0x1e7d72[_0x8556ae(0x13d)](createIssue(_0x8556ae(0x16b),_0xe8a7ac+_0x8556ae(0xde),_0x8556ae(0x18a),'End\x20step\x20\x27'+_0x234a59[_0x8556ae(0x188)]+_0x8556ae(0x162),_0x50981e)),_0x8556ae(0x16c)in _0x234a59&&_0x234a59[_0x8556ae(0x16c)]!==undefined&&_0x1e7d72[_0x8556ae(0x13d)](createIssue(_0x8556ae(0x16b),_0xe8a7ac+_0x8556ae(0xea),_0x8556ae(0x18a),_0x8556ae(0x10b)+_0x234a59[_0x8556ae(0x188)]+_0x8556ae(0xec),_0x50981e)),_0x1e7d72;_0x234a59[_0x8556ae(0x154)]&&(_0x50981e[_0x8556ae(0x137)]&&!_0x50981e[_0x8556ae(0x137)][_0x8556ae(0xed)](_0x234a59[_0x8556ae(0x154)])&&_0x1e7d72[_0x8556ae(0x13d)](createIssue(_0x8556ae(0x16b),_0xe8a7ac+_0x8556ae(0xde),_0x8556ae(0xd8),_0x8556ae(0xe9)+_0x234a59[_0x8556ae(0x154)]+'\x27',_0x50981e)));switch(_0x234a59[_0x8556ae(0x144)]){case _0x8556ae(0x10d):_0x1e7d72['push'](...validateWaitStep(_0x234a59,_0xe8a7ac,_0x50981e,_0x2ce189));break;case'activation':_0x1e7d72[_0x8556ae(0x13d)](...validateActivationStep(_0x234a59,_0xe8a7ac,_0x50981e));break;case _0x8556ae(0x110):_0x1e7d72['push'](...validateDecisionPointStep(_0x234a59,_0xe8a7ac,_0x50981e,_0x2ce189));break;case'ab_test':_0x1e7d72[_0x8556ae(0x13d)](...validateAbTestStep(_0x234a59,_0xe8a7ac,_0x50981e,_0x2ce189));break;case _0x8556ae(0x139):_0x1e7d72[_0x8556ae(0x13d)](...validateJumpStep(_0x234a59,_0xe8a7ac,_0x50981e));break;}return _0x1e7d72;}function validateWaitStep(_0x4f52ab,_0x58ea07,_0x45162f,_0x53a282){const _0x2f47ca=a146_0x2f2f,_0x40ce1e=[];if(!_0x4f52ab['with'])return _0x40ce1e[_0x2f47ca(0x13d)](createIssue('error',_0x58ea07+_0x2f47ca(0xea),_0x2f47ca(0xe4),_0x2f47ca(0x10a),_0x45162f,_0x58ea07)),_0x40ce1e;if(_0x4f52ab[_0x2f47ca(0x16c)][_0x2f47ca(0x15d)]){const _0x48664a=_0x4f52ab['with']['condition'];if(_0x48664a[_0x2f47ca(0xe6)]){_0x45162f['referencedSegments']?.[_0x2f47ca(0x134)](_0x48664a['segment']);!_0x48664a[_0x2f47ca(0xe6)][_0x2f47ca(0x12b)](_0x2f47ca(0x112))&&(_0x45162f['embeddedSegments']&&!_0x45162f['embeddedSegments'][_0x2f47ca(0xed)](_0x48664a[_0x2f47ca(0xe6)])&&_0x40ce1e[_0x2f47ca(0x13d)](createIssue(_0x2f47ca(0x16b),_0x58ea07+_0x2f47ca(0x11f),_0x2f47ca(0xee),_0x2f47ca(0x128)+_0x48664a[_0x2f47ca(0xe6)]+_0x2f47ca(0x155),_0x45162f)));_0x48664a[_0x2f47ca(0x154)]&&_0x45162f[_0x2f47ca(0x137)]&&!_0x45162f[_0x2f47ca(0x137)][_0x2f47ca(0xed)](_0x48664a[_0x2f47ca(0x154)])&&_0x40ce1e[_0x2f47ca(0x13d)](createIssue(_0x2f47ca(0x16b),_0x58ea07+_0x2f47ca(0x124),'INVALID_NEXT_REFERENCE',_0x2f47ca(0xf6)+_0x48664a[_0x2f47ca(0x154)]+'\x27',_0x45162f));_0x48664a[_0x2f47ca(0xe2)]?.['next']&&_0x45162f[_0x2f47ca(0x137)]&&!_0x45162f[_0x2f47ca(0x137)][_0x2f47ca(0xed)](_0x48664a[_0x2f47ca(0xe2)][_0x2f47ca(0x154)])&&_0x40ce1e['push'](createIssue('error',_0x58ea07+'.with.condition.timeout.next',_0x2f47ca(0xd8),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x48664a[_0x2f47ca(0xe2)]['next']+'\x27',_0x45162f));const _0x6918f1=_0x48664a[_0x2f47ca(0x154)]||_0x4f52ab['next'],_0x5ec98f=_0x48664a['timeout']?.[_0x2f47ca(0x154)]||_0x4f52ab[_0x2f47ca(0x154)];if(_0x6918f1){const _0x24cc1d=_0x53a282['get'](_0x6918f1);_0x24cc1d?.[_0x2f47ca(0x144)]===_0x2f47ca(0x149)&&_0x40ce1e['push'](createIssue(_0x2f47ca(0x168),_0x58ea07+_0x2f47ca(0x124),_0x2f47ca(0xdd),_0x2f47ca(0x147)+_0x6918f1+_0x2f47ca(0x178),_0x45162f,_0x58ea07+_0x2f47ca(0x171)));}if(_0x5ec98f){const _0x43777b=_0x53a282['get'](_0x5ec98f);_0x43777b?.[_0x2f47ca(0x144)]===_0x2f47ca(0x149)&&_0x40ce1e[_0x2f47ca(0x13d)](createIssue(_0x2f47ca(0x168),_0x58ea07+'.with.condition.timeout.next',_0x2f47ca(0xdd),_0x2f47ca(0x18f)+_0x5ec98f+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x45162f,_0x58ea07+_0x2f47ca(0xf0)));}}}return _0x40ce1e;}function validateActivationStep(_0x1e85f4,_0x245c8d,_0x488e17){const _0x477578=a146_0x2f2f,_0x4a7107=[];if(!_0x1e85f4[_0x477578(0x16c)]?.[_0x477578(0x187)])return _0x4a7107['push'](createIssue('error',_0x245c8d+_0x477578(0x158),_0x477578(0x165),_0x477578(0xdc),_0x488e17,_0x245c8d)),_0x4a7107;const _0x5db8c7=_0x1e85f4[_0x477578(0x16c)][_0x477578(0x187)];return _0x488e17[_0x477578(0x186)]&&!_0x5db8c7[_0x477578(0x12b)](_0x477578(0x112))&&(!_0x488e17[_0x477578(0x186)][_0x477578(0xed)](_0x5db8c7)&&_0x4a7107[_0x477578(0x13d)](createIssue(_0x477578(0x16b),_0x245c8d+_0x477578(0x158),_0x477578(0x175),_0x477578(0x10e)+_0x5db8c7+_0x477578(0x189),_0x488e17))),_0x4a7107;}function validateDecisionPointStep(_0x5d6efa,_0x46f719,_0x22931e,_0x106fd0){const _0x5ee9cf=a146_0x2f2f,_0x43e9a5=[];if(!_0x5d6efa['with']?.[_0x5ee9cf(0x12e)]||_0x5d6efa['with']['branches'][_0x5ee9cf(0x125)]===0x0)return _0x43e9a5['push'](createIssue(_0x5ee9cf(0x16b),_0x46f719+_0x5ee9cf(0x179),_0x5ee9cf(0xfa),'Decision\x20point\x20requires\x20at\x20least\x20one\x20branch',_0x22931e,_0x46f719)),_0x43e9a5;for(let _0x7ec15b=0x0;_0x7ec15b<_0x5d6efa[_0x5ee9cf(0x16c)][_0x5ee9cf(0x12e)][_0x5ee9cf(0x125)];_0x7ec15b++){const _0x255875=_0x5d6efa['with']['branches'][_0x7ec15b],_0x30ca3c=_0x46f719+_0x5ee9cf(0x15f)+_0x7ec15b+']';_0x255875[_0x5ee9cf(0xe6)]&&!_0x255875['excluded']&&(_0x22931e[_0x5ee9cf(0x133)]?.['add'](_0x255875[_0x5ee9cf(0xe6)]),!_0x255875['segment'][_0x5ee9cf(0x12b)](_0x5ee9cf(0x112))&&(_0x22931e[_0x5ee9cf(0x10c)]&&!_0x22931e[_0x5ee9cf(0x10c)][_0x5ee9cf(0xed)](_0x255875[_0x5ee9cf(0xe6)])&&_0x43e9a5[_0x5ee9cf(0x13d)](createIssue(_0x5ee9cf(0x16b),_0x30ca3c+'.segment',_0x5ee9cf(0xee),_0x5ee9cf(0x161)+_0x255875['segment']+'\x27',_0x22931e))));_0x255875[_0x5ee9cf(0x154)]&&_0x22931e[_0x5ee9cf(0x137)]&&!_0x22931e[_0x5ee9cf(0x137)][_0x5ee9cf(0xed)](_0x255875[_0x5ee9cf(0x154)])&&_0x43e9a5['push'](createIssue(_0x5ee9cf(0x16b),_0x30ca3c+_0x5ee9cf(0xde),'INVALID_NEXT_REFERENCE',_0x5ee9cf(0xd4)+_0x255875[_0x5ee9cf(0x154)]+'\x27',_0x22931e));if(_0x255875[_0x5ee9cf(0x154)]){const _0x1c0569=_0x106fd0[_0x5ee9cf(0x121)](_0x255875[_0x5ee9cf(0x154)]);_0x1c0569?.[_0x5ee9cf(0x144)]===_0x5ee9cf(0x149)&&_0x43e9a5[_0x5ee9cf(0x13d)](createIssue(_0x5ee9cf(0x168),_0x30ca3c+_0x5ee9cf(0xde),_0x5ee9cf(0xdd),'Decision\x20branch\x20\x27'+_0x255875[_0x5ee9cf(0x188)]+'\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x255875[_0x5ee9cf(0x154)]+_0x5ee9cf(0x140),_0x22931e));}}return _0x43e9a5;}function validateAbTestStep(_0x32b2c2,_0x4be9f0,_0x5f544b,_0x19cc65){const _0x202ac1=a146_0x2f2f,_0x137c1c=[];if(!_0x32b2c2[_0x202ac1(0x16c)]?.[_0x202ac1(0x146)]||_0x32b2c2[_0x202ac1(0x16c)][_0x202ac1(0x146)][_0x202ac1(0x125)]===0x0)return _0x137c1c[_0x202ac1(0x13d)](createIssue('error',_0x4be9f0+_0x202ac1(0x12c),_0x202ac1(0xfa),_0x202ac1(0xe8),_0x5f544b,_0x4be9f0)),_0x137c1c;const _0x4fc046=_0x32b2c2[_0x202ac1(0x16c)][_0x202ac1(0x146)][_0x202ac1(0x180)]((_0xa73f92,_0x22141c)=>_0xa73f92+(_0x22141c[_0x202ac1(0x173)]||0x0),0x0);Math[_0x202ac1(0x148)](_0x4fc046-0x64)>0.01&&_0x137c1c['push'](createIssue('error',_0x4be9f0+_0x202ac1(0x12c),_0x202ac1(0x11a),_0x202ac1(0x15e)+_0x4fc046+'%)',_0x5f544b));for(let _0x3900b0=0x0;_0x3900b0<_0x32b2c2[_0x202ac1(0x16c)][_0x202ac1(0x146)]['length'];_0x3900b0++){const _0x3cb47e=_0x32b2c2['with']['variants'][_0x3900b0],_0x45ae0d=_0x4be9f0+_0x202ac1(0x17b)+_0x3900b0+']';_0x3cb47e[_0x202ac1(0x154)]&&_0x5f544b[_0x202ac1(0x137)]&&!_0x5f544b['stepNames']['has'](_0x3cb47e[_0x202ac1(0x154)])&&_0x137c1c['push'](createIssue(_0x202ac1(0x16b),_0x45ae0d+_0x202ac1(0xde),'INVALID_NEXT_REFERENCE',_0x202ac1(0x135)+_0x3cb47e['next']+'\x27',_0x5f544b));if(_0x3cb47e[_0x202ac1(0x154)]){const _0x3d6d94=_0x19cc65[_0x202ac1(0x121)](_0x3cb47e[_0x202ac1(0x154)]);_0x3d6d94?.['type']==='merge'&&_0x137c1c[_0x202ac1(0x13d)](createIssue('warning',_0x45ae0d+_0x202ac1(0xde),_0x202ac1(0xdd),_0x202ac1(0xf4)+_0x3cb47e[_0x202ac1(0x188)]+_0x202ac1(0x12a)+_0x3cb47e['next']+_0x202ac1(0x140),_0x5f544b));}}return _0x137c1c;}function validateJumpStep(_0x437018,_0x4e92f5,_0x379488){const _0x5138f7=a146_0x2f2f,_0x57d093=[];if(!_0x437018[_0x5138f7(0x16c)]?.[_0x5138f7(0x160)])return _0x57d093[_0x5138f7(0x13d)](createIssue(_0x5138f7(0x16b),_0x4e92f5+_0x5138f7(0xe0),_0x5138f7(0x182),'Jump\x20step\x20requires\x20a\x20target',_0x379488,_0x4e92f5)),_0x57d093;return(!_0x437018['with'][_0x5138f7(0x160)][_0x5138f7(0x16a)]||!_0x437018['with'][_0x5138f7(0x160)][_0x5138f7(0xe5)])&&_0x57d093[_0x5138f7(0x13d)](createIssue('error',_0x4e92f5+'.with.target',_0x5138f7(0x182),_0x5138f7(0x17c),_0x379488)),_0x57d093;}function buildConvergenceMap(_0x37ad3d){const _0x502642=a146_0x2f2f,_0x660603=new Map();function _0x5b62d0(_0x56d2c0,_0xf89d6d){const _0x37a2e0=a146_0x2f2f,_0x421467=_0x660603[_0x37a2e0(0x121)](_0x56d2c0)||[];_0x421467[_0x37a2e0(0x13d)](_0xf89d6d),_0x660603[_0x37a2e0(0x12f)](_0x56d2c0,_0x421467);}for(const _0x53daf3 of _0x37ad3d){_0x53daf3[_0x502642(0x154)]&&_0x5b62d0(_0x53daf3[_0x502642(0x154)],{'stepName':_0x53daf3[_0x502642(0x188)],'description':'step\x20\x27'+_0x53daf3[_0x502642(0x188)]+'\x27'});if(_0x53daf3['type']===_0x502642(0x110)&&_0x53daf3[_0x502642(0x16c)]?.[_0x502642(0x12e)])for(const _0x1608b0 of _0x53daf3['with'][_0x502642(0x12e)]){_0x1608b0[_0x502642(0x154)]&&_0x5b62d0(_0x1608b0['next'],{'stepName':_0x53daf3[_0x502642(0x188)],'description':_0x502642(0x107)+_0x1608b0[_0x502642(0x188)]+_0x502642(0x16d)+_0x53daf3[_0x502642(0x188)]+'\x27'});}if(_0x53daf3[_0x502642(0x144)]===_0x502642(0x108)&&_0x53daf3[_0x502642(0x16c)]?.[_0x502642(0x146)])for(const _0x3aea69 of _0x53daf3[_0x502642(0x16c)]['variants']){_0x3aea69[_0x502642(0x154)]&&_0x5b62d0(_0x3aea69[_0x502642(0x154)],{'stepName':_0x53daf3[_0x502642(0x188)],'description':_0x502642(0x118)+_0x3aea69[_0x502642(0x188)]+_0x502642(0x16d)+_0x53daf3[_0x502642(0x188)]+'\x27'});}_0x53daf3[_0x502642(0x144)]===_0x502642(0x10d)&&_0x53daf3['with']?.['condition']&&(_0x53daf3['with'][_0x502642(0x15d)][_0x502642(0x154)]&&_0x5b62d0(_0x53daf3[_0x502642(0x16c)][_0x502642(0x15d)]['next'],{'stepName':_0x53daf3[_0x502642(0x188)],'description':_0x502642(0x104)+_0x53daf3[_0x502642(0x188)]+'\x27'}),_0x53daf3[_0x502642(0x16c)][_0x502642(0x15d)][_0x502642(0xe2)]?.['next']&&_0x5b62d0(_0x53daf3[_0x502642(0x16c)]['condition'][_0x502642(0xe2)][_0x502642(0x154)],{'stepName':_0x53daf3[_0x502642(0x188)],'description':_0x502642(0x156)+_0x53daf3['name']+'\x27'}));}return _0x660603;}function validateFlowControl(_0xa3b451,_0x493b14,_0x4397a1){const _0x397deb=a146_0x2f2f,_0x568519=[],_0x3ad2d5=_0x397deb(0x15c)+_0x493b14+']',_0x65132b=_0xa3b451[_0x397deb(0x152)]||[];if(_0x65132b[_0x397deb(0x125)]===0x0)return _0x568519;const _0x4d2921=new Map();for(const _0x36b955 of _0x65132b){_0x36b955[_0x397deb(0x188)]&&_0x4d2921[_0x397deb(0x12f)](_0x36b955[_0x397deb(0x188)],_0x36b955);}const _0x34d3f2=buildConvergenceMap(_0x65132b),_0x581367=_0x65132b[_0x397deb(0xf7)](_0x598a62=>_0x598a62[_0x397deb(0x144)]===_0x397deb(0x123));!_0x581367&&_0x568519[_0x397deb(0x13d)](createIssue(_0x397deb(0x16b),_0x3ad2d5+_0x397deb(0x113),_0x397deb(0xfd),_0x397deb(0x14c)+_0xa3b451[_0x397deb(0x188)]+_0x397deb(0x153),_0x4397a1));for(const [_0x5c9fce,_0x42cf87]of _0x34d3f2){const _0x516a2c=_0x4d2921['get'](_0x5c9fce);if(!_0x516a2c)continue;if(_0x42cf87[_0x397deb(0x125)]>0x1&&_0x516a2c[_0x397deb(0x144)]!==_0x397deb(0x149)){const _0x2a392c=_0x42cf87[_0x397deb(0xe3)](_0x71e89f=>_0x71e89f[_0x397deb(0x16f)])['join'](',\x20');_0x568519[_0x397deb(0x13d)](createIssue('error',_0x3ad2d5+_0x397deb(0x113),_0x397deb(0x129),'Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27'+_0x5c9fce+'\x27\x20(from:\x20'+_0x2a392c+_0x397deb(0x172),_0x4397a1));}_0x42cf87[_0x397deb(0x125)]===0x1&&_0x516a2c[_0x397deb(0x144)]==='merge'&&_0x568519[_0x397deb(0x13d)](createIssue(_0x397deb(0x168),_0x3ad2d5+'.steps',_0x397deb(0x174),_0x397deb(0xf9)+_0x5c9fce+_0x397deb(0x10f)+_0x42cf87[0x0][_0x397deb(0x16f)]+_0x397deb(0xdf),_0x4397a1));}for(const _0x6f7ebe of _0x65132b){if(_0x6f7ebe[_0x397deb(0x144)]===_0x397deb(0x149)&&_0x6f7ebe[_0x397deb(0x154)]){const _0x5a3819=_0x4d2921[_0x397deb(0x121)](_0x6f7ebe[_0x397deb(0x154)]);_0x5a3819?.[_0x397deb(0x144)]===_0x397deb(0x149)&&_0x568519[_0x397deb(0x13d)](createIssue(_0x397deb(0x16b),_0x3ad2d5+_0x397deb(0x113),_0x397deb(0x14e),_0x397deb(0xf9)+_0x6f7ebe[_0x397deb(0x188)]+_0x397deb(0x15a)+_0x6f7ebe[_0x397deb(0x154)]+_0x397deb(0x132),_0x4397a1));}}return _0x568519;}function a146_0x2f2f(_0x161ef7,_0x2edfba){_0x161ef7=_0x161ef7-0xd3;const _0x68b283=a146_0x68b2();let _0x2f2fc8=_0x68b283[_0x161ef7];return _0x2f2fc8;}function validateCriteria(_0x3af5f8,_0x34ab3e,_0x4d3190){const _0x3cd351=a146_0x2f2f,_0x139415=[];return _0x3af5f8[_0x3cd351(0xe6)]&&(_0x4d3190['referencedSegments']?.['add'](_0x3af5f8[_0x3cd351(0xe6)]),!_0x3af5f8[_0x3cd351(0xe6)][_0x3cd351(0x12b)](_0x3cd351(0x112))&&(_0x4d3190[_0x3cd351(0x10c)]&&!_0x4d3190[_0x3cd351(0x10c)][_0x3cd351(0xed)](_0x3af5f8[_0x3cd351(0xe6)])&&_0x139415[_0x3cd351(0x13d)](createIssue(_0x3cd351(0x16b),_0x34ab3e+_0x3cd351(0x13b),_0x3cd351(0xee),'Criteria\x20references\x20undefined\x20segment\x20\x27'+_0x3af5f8[_0x3cd351(0xe6)]+'\x27',_0x4d3190)))),_0x139415;}function validateEmbeddedSegment(_0x1bf3a4,_0x5e00e9,_0x1a237b){const _0x359721=a146_0x2f2f,_0x565fe8=[];return _0x1bf3a4[_0x359721(0x138)]&&_0x565fe8['push'](...validateRuleDef(_0x1bf3a4[_0x359721(0x138)],_0x5e00e9+_0x359721(0x18d),_0x1a237b)),_0x565fe8;}function validateStage(_0x563a09,_0x548903,_0x3a0981,_0x2505bc){const _0x4f85a7=a146_0x2f2f,_0x30d222=[],_0x9c8f11=_0x4f85a7(0x15c)+_0x548903+']',_0x437c9b=new Map(),_0x30c2a4=new Map();if(_0x563a09[_0x4f85a7(0x152)]){for(let _0x4c9bfd=0x0;_0x4c9bfd<_0x563a09[_0x4f85a7(0x152)]['length'];_0x4c9bfd++){const _0x1cbc3e=_0x563a09['steps'][_0x4c9bfd];_0x1cbc3e[_0x4f85a7(0x188)]&&_0x437c9b[_0x4f85a7(0x12f)](_0x1cbc3e[_0x4f85a7(0x188)],_0x1cbc3e);}for(let _0x785daf=0x0;_0x785daf<_0x563a09[_0x4f85a7(0x152)]['length'];_0x785daf++){const _0x438d5b=_0x563a09[_0x4f85a7(0x152)][_0x785daf],_0x1aed41=_0x9c8f11+'.steps['+_0x785daf+']';if(_0x438d5b['name']){if(_0x30c2a4[_0x4f85a7(0xed)](_0x438d5b[_0x4f85a7(0x188)])){const _0x2a550b=_0x30c2a4[_0x4f85a7(0x121)](_0x438d5b[_0x4f85a7(0x188)]);_0x30d222[_0x4f85a7(0x13d)](createIssue('error',_0x1aed41+_0x4f85a7(0x102),_0x4f85a7(0x13c),'Duplicate\x20step\x20name\x20\x27'+_0x438d5b[_0x4f85a7(0x188)]+_0x4f85a7(0x117)+_0x2a550b+'])',_0x2505bc));}else _0x30c2a4[_0x4f85a7(0x12f)](_0x438d5b[_0x4f85a7(0x188)],_0x785daf);}_0x30d222[_0x4f85a7(0x13d)](...validateStep(_0x438d5b,_0x1aed41,_0x2505bc,_0x437c9b));}}_0x563a09[_0x4f85a7(0x111)]&&_0x30d222[_0x4f85a7(0x13d)](...validateCriteria(_0x563a09['entry_criteria'],_0x9c8f11+_0x4f85a7(0xd3),_0x2505bc));if(_0x563a09[_0x4f85a7(0x11d)])for(let _0x2ea9ad=0x0;_0x2ea9ad<_0x563a09['exit_criteria'][_0x4f85a7(0x125)];_0x2ea9ad++){_0x30d222[_0x4f85a7(0x13d)](...validateCriteria(_0x563a09[_0x4f85a7(0x11d)][_0x2ea9ad],_0x9c8f11+_0x4f85a7(0x16e)+_0x2ea9ad+']',_0x2505bc));}return _0x563a09['milestone']&&_0x30d222[_0x4f85a7(0x13d)](...validateCriteria(_0x563a09['milestone'],_0x9c8f11+_0x4f85a7(0xf1),_0x2505bc)),_0x30d222[_0x4f85a7(0x13d)](...validateStageStructure(_0x563a09,_0x548903,_0x3a0981,_0x2505bc)),_0x30d222[_0x4f85a7(0x13d)](...validateFlowControl(_0x563a09,_0x548903,_0x2505bc)),_0x30d222;}function a146_0x68b2(){const _0x286b50=['Journey\x20must\x20have\x20at\x20least\x20one\x20stage','.rule','ACTIVATION_SCHEMA_ERROR','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','version','.entry_criteria','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','MISSING_ENTRY_CRITERIA','Journey\x20name\x20is\x20required','segments.','INVALID_NEXT_REFERENCE','keys','MISSING_STAGES','skipSchema','Activation\x20step\x20requires\x20an\x20activation\x20reference','BRANCH_DIRECTLY_TO_MERGE','.next',').\x20Merge\x20is\x20unnecessary.','.with.target','values','timeout','map','MISSING_WAIT_PARAMS','stage','segment','journeys[','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','Step\x20references\x20non-existent\x20step\x20\x27','.with','activations','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','has','MISSING_SEGMENT_REFERENCE','\x20(across\x20','.with.condition.timeout','.milestone','2898512JShEtY','size','A/B\x20test\x20variant\x20\x27','JOURNEY_SCHEMA_ERROR','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','some','INSUFFICIENT_STEPS','Merge\x20step\x20\x27','MISSING_CONDITIONS','journeys,\x20stages,\x20or\x20versions','\x20with\x20latest:\x20true','MISSING_END_STEP','5529916tgaNQN','MISSING_GOAL','latest','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','.name','level','condition\x20of\x20\x27','endsWith','includes','branch\x20\x27','ab_test','milestone','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','End\x20step\x20\x27','embeddedSegments','wait','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','decision_point','entry_criteria','ref:','.steps','4WTypGH','goal','9yEEhFi','\x27\x20(first\x20defined\x20at\x20steps[','variant\x20\x27','versions','INVALID_AB_TEST_PERCENTAGES','\x20stages\x20but\x20maximum\x20is\x20','172237xqqkcQ','exit_criteria','journeys','.with.condition.segment','splice','get','document','end','.with.condition.next','length','versions[','DUPLICATE_LATEST','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','CONVERGENCE_WITHOUT_MERGE','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','startsWith','.with.variants','MISSING_EXIT_CRITERIA','branches','set','path','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','referencedSegments','add','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','symbol','stepNames','rule','jump','MISSING_NAME','.segment','DUPLICATE_STEP_NAME','push','6205864DviEYi','.stages','\x27\x20with\x20no\x20action\x20in\x20between','.exit_criteria','2550951wpIbPz','journey\x20entry','type','goalIsInherited','variants','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','abs','merge','\x20steps\x20(may\x20be\x20too\x20simple)','6iSNahZ','Stage\x20\x27','sort','MERGE_TO_MERGE_CHAIN','\x27\x20has\x20only\x20','trim','1620145EXEXym','steps','\x27\x20has\x20no\x20end\x20step','next','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','timeout\x20of\x20\x27','source','.with.activation','Journey\x20has\x20no\x20goal\x20defined','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','stages','stages[','condition','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','.with.branches[','target','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','26913080PTVOYN','UNUSED_EMBEDDED_SEGMENT','MISSING_ACTIVATION_REF','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','FEW_STEPS','warning','message','journey','error','with','\x27\x20of\x20\x27','.exit_criteria[','description','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','.with.condition',').\x20Use\x20a\x20merge\x20step.','percentage','SINGLE_INPUT_MERGE','MISSING_ACTIVATION_DEFINITION','filter','state','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','.with.branches','replace','.with.variants[','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','Journey\x20has\x20','segments','indices','reduce','match','INVALID_JUMP_TARGET','.type','issues','launched','activationKeys','activation','name','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','END_STEP_HAS_NEXT_OR_WITH','excluded_'];a146_0x68b2=function(){return _0x286b50;};return a146_0x68b2();}function validateStagesForVersion(_0xa40b84,_0x542b8,_0x9684c4,_0x2320de,_0x5b0aee,_0x470416,_0xba5cfd){const _0x43513c=a146_0x2f2f;if(_0xa40b84['length']===0x0){_0x5b0aee[_0x43513c(0x13d)]({'level':_0x43513c(0x16b),'path':_0x2320de+_0x43513c(0x15b),'code':_0x43513c(0xda),'message':_0x43513c(0x18c),'location':getLocationFromPath(_0x9684c4['document'],_0x9684c4[_0x43513c(0x157)],[_0x43513c(0x15b)])});return;}const _0x3968f4=new Set();for(const _0x58c3c9 of _0xa40b84){if(_0x58c3c9[_0x43513c(0x152)])for(const _0x28f211 of _0x58c3c9['steps']){_0x28f211[_0x43513c(0x188)]&&_0x3968f4['add'](_0x28f211['name']);}}const _0x2ae3fb={..._0x9684c4,'stepNames':_0x3968f4},_0x4d3a0f=validateVersionStructure(_0xa40b84,_0x2ae3fb);for(const _0x4fc4d0 of _0x4d3a0f){const _0x5194a0=_0x2320de?{..._0x4fc4d0,'path':''+_0x2320de+_0x4fc4d0['path']}:_0x4fc4d0;if(_0x5194a0[_0x43513c(0x103)]===_0x43513c(0x16b))_0x5b0aee[_0x43513c(0x13d)](_0x5194a0);else _0x470416[_0x43513c(0x13d)](_0x5194a0);}for(let _0x570bab=0x0;_0x570bab<_0xa40b84[_0x43513c(0x125)];_0x570bab++){const _0x167a30=validateStage(_0xa40b84[_0x570bab],_0x570bab,_0xa40b84[_0x43513c(0x125)],_0x2ae3fb);for(const _0x2158bc of _0x167a30){const _0x4df438=_0x2320de?{..._0x2158bc,'path':''+_0x2320de+_0x2158bc[_0x43513c(0x130)]}:_0x2158bc;if(_0x4df438['level']===_0x43513c(0x16b))_0x5b0aee[_0x43513c(0x13d)](_0x4df438);else _0x470416[_0x43513c(0x13d)](_0x4df438);}}if(_0x542b8['goal']){const _0x96cd1a=_0xba5cfd?.[_0x43513c(0x145)]?_0x43513c(0x115):_0x2320de+'goal',_0xeb7604=validateCriteria(_0x542b8[_0x43513c(0x115)],_0x96cd1a,_0x2ae3fb);for(const _0x4f352b of _0xeb7604){if(_0x4f352b[_0x43513c(0x103)]===_0x43513c(0x16b))_0x5b0aee[_0x43513c(0x13d)](_0x4f352b);else _0x470416['push'](_0x4f352b);}}}function extractVersionIndex(_0x33a39c){const _0x11c781=a146_0x2f2f,_0x179505=_0x33a39c[_0x11c781(0x181)](/^journeys\[(\d+)\]\./);return _0x179505?_0x179505[0x1]:undefined;}function deduplicateAcrossVersions(_0x4839c0){const _0x3072ff=a146_0x2f2f,_0x9da02f=new Map();for(let _0x1e6256=0x0;_0x1e6256<_0x4839c0[_0x3072ff(0x125)];_0x1e6256++){const _0x2621fb=_0x4839c0[_0x1e6256]['code']+':'+_0x4839c0[_0x1e6256]['message'],_0x5bd753=extractVersionIndex(_0x4839c0[_0x1e6256][_0x3072ff(0x130)]),_0x1050f5=_0x9da02f['get'](_0x2621fb);if(_0x1050f5){_0x1050f5[_0x3072ff(0x17f)]['push'](_0x1e6256);if(_0x5bd753)_0x1050f5['versions']['add'](_0x5bd753);}else _0x9da02f[_0x3072ff(0x12f)](_0x2621fb,{'indices':[_0x1e6256],'versions':new Set(_0x5bd753?[_0x5bd753]:[])});}const _0x3ed81d=new Set();for(const {indices:_0x130a5d,versions:_0x164fb4}of _0x9da02f[_0x3072ff(0xe1)]()){if(_0x164fb4['size']<=0x1)continue;const _0x10b7a7=_0x4839c0[_0x130a5d[0x0]];_0x10b7a7[_0x3072ff(0x130)]=_0x10b7a7[_0x3072ff(0x130)][_0x3072ff(0x17a)](/^journeys\[\d+\]\./,''),_0x10b7a7[_0x3072ff(0x169)]=_0x10b7a7[_0x3072ff(0x169)]+_0x3072ff(0xef)+_0x164fb4[_0x3072ff(0xf3)]+'\x20versions)';for(let _0x432f07=0x1;_0x432f07<_0x130a5d[_0x3072ff(0x125)];_0x432f07++){_0x3ed81d[_0x3072ff(0x134)](_0x130a5d[_0x432f07]);}}const _0x24696b=[..._0x3ed81d][_0x3072ff(0x14d)]((_0x1efdb6,_0x8f4860)=>_0x8f4860-_0x1efdb6);for(const _0x43aed6 of _0x24696b){_0x4839c0[_0x3072ff(0x120)](_0x43aed6,0x1);}}export function validateJourneyDef(_0x2d3bfc,_0x302079={},_0x544859={}){const _0x5e7329=a146_0x2f2f;if(_0x544859[_0x5e7329(0xdb)])return runJourneySemanticChecks(_0x2d3bfc,_0x302079);const _0x1a9f82=JourneyDefSchema['safeParse'](_0x2d3bfc);if(_0x1a9f82['success'])return runJourneySemanticChecks(_0x1a9f82['data'],_0x302079);return zodErrorsToJourneyValidationResult(_0x1a9f82[_0x5e7329(0x16b)],_0x302079);}function zodErrorsToJourneyValidationResult(_0x50d32d,_0x2b8fa8){const _0x7b31cd=a146_0x2f2f,_0xf5c5b0=flattenZodIssues(_0x50d32d[_0x7b31cd(0x184)]),_0x4c7317=_0xf5c5b0[_0x7b31cd(0xe3)](_0x34113b=>{const _0x5a55f0=_0x7b31cd,_0x3f5631=formatZodPath(_0x34113b[_0x5a55f0(0x130)]),_0x3a027c=mapJourneyZodIssueToCode(_0x34113b,_0x3f5631),_0x29d93a=getLocationFromPath(_0x2b8fa8[_0x5a55f0(0x122)],_0x2b8fa8[_0x5a55f0(0x157)],_0x34113b['path'][_0x5a55f0(0xe3)](_0x2a9114=>typeof _0x2a9114===_0x5a55f0(0x136)?String(_0x2a9114):_0x2a9114));return{'level':_0x5a55f0(0x16b),'path':_0x3f5631,'code':_0x3a027c,'message':_0x34113b['message'],..._0x29d93a&&{'location':_0x29d93a}};});return{'valid':![],'errors':_0x4c7317,'warnings':[]};}function mapJourneyZodIssueToCode(_0x5604a6,_0x57256b){const _0x379076=a146_0x2f2f;if(_0x57256b===_0x379076(0x188))return _0x379076(0x13a);if(_0x57256b[_0x379076(0x105)](_0x379076(0x183))&&_0x57256b[_0x379076(0x106)](_0x379076(0x152)))return _0x379076(0xf5);if(_0x57256b===_0x379076(0x15b)||_0x57256b[_0x379076(0x105)](_0x379076(0x13f)))return _0x379076(0xda);if(_0x57256b===''&&_0x5604a6[_0x379076(0x169)][_0x379076(0x106)](_0x379076(0xfb)))return _0x379076(0xda);if(_0x57256b[_0x379076(0x106)](_0x379076(0x187)))return _0x379076(0x18e);return'JOURNEY_SCHEMA_ERROR';}function runJourneySemanticChecks(_0x50c26f,_0x400522){const _0x54f21a=a146_0x2f2f,_0x617892=[],_0x15681e=[];(!_0x50c26f['name']||_0x50c26f[_0x54f21a(0x188)][_0x54f21a(0x150)]()==='')&&_0x617892[_0x54f21a(0x13d)]({'level':_0x54f21a(0x16b),'path':_0x54f21a(0x188),'code':'MISSING_NAME','message':_0x54f21a(0xd6),'location':getLocationFromPath(_0x400522[_0x54f21a(0x122)],_0x400522[_0x54f21a(0x157)],['name'])});const _0x3d5a4e=new Set();if(_0x50c26f[_0x54f21a(0x17e)])for(const _0xb040f9 of Object[_0x54f21a(0xd9)](_0x50c26f[_0x54f21a(0x17e)])){_0x3d5a4e[_0x54f21a(0x134)](_0xb040f9);}const _0x239dcb=new Set();if(_0x50c26f[_0x54f21a(0xeb)])for(const _0x442a4a of Object[_0x54f21a(0xd9)](_0x50c26f[_0x54f21a(0xeb)])){_0x239dcb[_0x54f21a(0x134)](_0x442a4a);}const _0x411a04=new Set(),_0x3efdb3={..._0x400522,'embeddedSegments':_0x3d5a4e,'referencedSegments':_0x411a04,'activationKeys':_0x239dcb[_0x54f21a(0xf3)]>0x0?_0x239dcb:undefined};if(_0x50c26f['segments'])for(const [_0xc76393,_0x229720]of Object['entries'](_0x50c26f[_0x54f21a(0x17e)])){const _0x332664=validateEmbeddedSegment(_0x229720,_0x54f21a(0xd7)+_0xc76393,_0x3efdb3);for(const _0x37a0da of _0x332664){if(_0x37a0da[_0x54f21a(0x103)]===_0x54f21a(0x16b))_0x617892[_0x54f21a(0x13d)](_0x37a0da);else _0x15681e['push'](_0x37a0da);}}const _0x6388b0=!!_0x50c26f['goal'],_0xa1bb1=_0x50c26f[_0x54f21a(0x11e)]?.['every'](_0x186c39=>!!_0x186c39[_0x54f21a(0x115)])??![];!_0x6388b0&&!_0xa1bb1&&_0x15681e[_0x54f21a(0x13d)]({'level':_0x54f21a(0x168),'path':'goal','code':_0x54f21a(0xff),'message':_0x54f21a(0x159),'location':getLocationFromPath(_0x400522['document'],_0x400522['source'],[_0x54f21a(0x115)])});const _0x25002e=_0x50c26f[_0x54f21a(0x11e)]??_0x50c26f[_0x54f21a(0x119)];if(_0x25002e&&_0x25002e[_0x54f21a(0x176)](_0x119a1d=>_0x119a1d[_0x54f21a(0x100)]===!![])[_0x54f21a(0x125)]>0x1){const _0x81a020=_0x50c26f[_0x54f21a(0x11e)]?_0x54f21a(0x11e):'versions';_0x617892[_0x54f21a(0x13d)]({'level':_0x54f21a(0x16b),'path':_0x81a020,'code':_0x54f21a(0x127),'message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x81a020==='journeys'?_0x54f21a(0x143):_0x54f21a(0x190))+_0x54f21a(0xfc),'location':getLocationFromPath(_0x400522['document'],_0x400522[_0x54f21a(0x157)],[_0x81a020])});}if(_0x50c26f[_0x54f21a(0x11e)]&&_0x50c26f[_0x54f21a(0x11e)][_0x54f21a(0x125)]>0x0)for(let _0x2ca068=0x0;_0x2ca068<_0x50c26f[_0x54f21a(0x11e)][_0x54f21a(0x125)];_0x2ca068++){const _0x23045b=_0x50c26f[_0x54f21a(0x11e)][_0x2ca068];if(_0x50c26f['journeys'][_0x54f21a(0x125)]>0x1&&_0x23045b[_0x54f21a(0x177)]==='launched')continue;const _0x123e46=_0x23045b[_0x54f21a(0x15b)]||[],_0x4ec872=_0x54f21a(0xe7)+_0x2ca068+'].',_0x41ba28=!!_0x23045b[_0x54f21a(0x115)],_0x9f0e87=_0x41ba28?{..._0x50c26f,'goal':_0x23045b['goal']}:_0x50c26f;validateStagesForVersion(_0x123e46,_0x9f0e87,_0x3efdb3,_0x4ec872,_0x617892,_0x15681e,{'goalIsInherited':!_0x41ba28});}else{if(_0x50c26f['versions']&&_0x50c26f[_0x54f21a(0x119)][_0x54f21a(0x125)]>0x0)for(let _0x360048=0x0;_0x360048<_0x50c26f[_0x54f21a(0x119)]['length'];_0x360048++){const _0x3dae=_0x50c26f['versions'][_0x360048];if(_0x50c26f[_0x54f21a(0x119)]['length']>0x1&&_0x3dae[_0x54f21a(0x177)]===_0x54f21a(0x185))continue;const _0xe9045e=_0x3dae[_0x54f21a(0x15b)]||[],_0x26d194=_0x54f21a(0x126)+_0x360048+'].';validateStagesForVersion(_0xe9045e,_0x50c26f,_0x3efdb3,_0x26d194,_0x617892,_0x15681e);}else{const _0x121e80=_0x50c26f[_0x54f21a(0x15b)]||[];validateStagesForVersion(_0x121e80,_0x50c26f,_0x3efdb3,'',_0x617892,_0x15681e);}}_0x50c26f[_0x54f21a(0x11e)]&&_0x50c26f[_0x54f21a(0x11e)][_0x54f21a(0x125)]>0x1&&(deduplicateAcrossVersions(_0x617892),deduplicateAcrossVersions(_0x15681e));for(const _0x2ddf7e of _0x3d5a4e){!_0x411a04[_0x54f21a(0xed)](_0x2ddf7e)&&!_0x2ddf7e[_0x54f21a(0x12b)](_0x54f21a(0x18b))&&_0x15681e[_0x54f21a(0x13d)]({'level':_0x54f21a(0x168),'path':_0x54f21a(0xd7)+_0x2ddf7e,'code':_0x54f21a(0x164),'message':'Embedded\x20segment\x20\x27'+_0x2ddf7e+_0x54f21a(0x101),'location':getLocationFromPath(_0x400522[_0x54f21a(0x122)],_0x400522[_0x54f21a(0x157)],[_0x54f21a(0x17e),_0x2ddf7e])});}return{'valid':_0x617892[_0x54f21a(0x125)]===0x0,'errors':_0x617892,'warnings':_0x15681e};}
1
+ (function(_0x410442,_0x582016){const _0x24d380=a149_0x4ad7,_0x5911ec=_0x410442();while(!![]){try{const _0x211ea7=-parseInt(_0x24d380(0x124))/0x1+-parseInt(_0x24d380(0xfb))/0x2+-parseInt(_0x24d380(0x137))/0x3+parseInt(_0x24d380(0x129))/0x4+-parseInt(_0x24d380(0x175))/0x5+-parseInt(_0x24d380(0x181))/0x6+-parseInt(_0x24d380(0x116))/0x7*(-parseInt(_0x24d380(0x172))/0x8);if(_0x211ea7===_0x582016)break;else _0x5911ec['push'](_0x5911ec['shift']());}catch(_0x23cee4){_0x5911ec['push'](_0x5911ec['shift']());}}}(a149_0x1bc7,0x9cae3));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x1001f9,_0x383a9d,_0x3da4fe,_0x24c6cf,_0x43eb9b,_0x1cb37f){const _0x477a59=a149_0x4ad7;return{'level':_0x1001f9,'path':_0x383a9d,'code':_0x3da4fe,'message':_0x24c6cf,'location':getLocationFromPath(_0x43eb9b[_0x477a59(0xf4)],_0x43eb9b[_0x477a59(0x15a)],pathToArray(_0x1cb37f??_0x383a9d))};}function validateVersionStructure(_0x3c342a,_0xcb990b){const _0x295f82=a149_0x4ad7,_0x3edcca=[];return _0x3c342a[_0x295f82(0xd6)]>MAX_STAGES&&_0x3edcca[_0x295f82(0x152)](createIssue(_0x295f82(0xf2),_0x295f82(0x102),_0x295f82(0x11b),_0x295f82(0xf0)+_0x3c342a['length']+_0x295f82(0x109)+MAX_STAGES,_0xcb990b)),_0x3edcca;}function validateStageStructure(_0x53a00b,_0x48d83d,_0x33fccc,_0x426aca){const _0x442109=a149_0x4ad7,_0x57db43=[],_0x1bc803=_0x442109(0x11e)+_0x48d83d+']';_0x48d83d===0x0&&!_0x53a00b[_0x442109(0xdf)]&&_0x57db43[_0x442109(0x152)](createIssue(_0x442109(0xf2),_0x1bc803+_0x442109(0x17d),_0x442109(0x13f),_0x442109(0x143)+_0x53a00b[_0x442109(0x17a)]+_0x442109(0xdb),_0x426aca,_0x1bc803));const _0x5e3f34=_0x48d83d===_0x33fccc-0x1;!_0x5e3f34&&!_0x53a00b[_0x442109(0x166)]&&_0x57db43[_0x442109(0x152)](createIssue(_0x442109(0xf2),_0x1bc803+_0x442109(0x114),_0x442109(0xfc),_0x442109(0x143)+_0x53a00b[_0x442109(0x17a)]+_0x442109(0xf7),_0x426aca,_0x1bc803));(!_0x53a00b[_0x442109(0xd4)]||_0x53a00b['exit_criteria']['length']===0x0)&&_0x57db43[_0x442109(0x152)](createIssue(_0x442109(0xf3),_0x1bc803+_0x442109(0x183),_0x442109(0x156),_0x442109(0x143)+_0x53a00b[_0x442109(0x17a)]+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x426aca,_0x1bc803));const _0x116b96=_0x53a00b['steps']?.[_0x442109(0xd6)]??0x0;if(_0x116b96===0x0)_0x57db43[_0x442109(0x152)](createIssue('error',_0x1bc803+_0x442109(0xea),'INSUFFICIENT_STEPS','Stage\x20\x27'+_0x53a00b[_0x442109(0x17a)]+_0x442109(0x157),_0x426aca,_0x1bc803+_0x442109(0xea)));else{if(_0x116b96===0x1)_0x57db43[_0x442109(0x152)](createIssue(_0x442109(0xf3),_0x1bc803+_0x442109(0xea),_0x442109(0x134),_0x442109(0x143)+_0x53a00b[_0x442109(0x17a)]+_0x442109(0xdd),_0x426aca,_0x1bc803+'.steps'));else _0x116b96<=0x3&&_0x57db43[_0x442109(0x152)](createIssue(_0x442109(0xf3),_0x1bc803+_0x442109(0xea),_0x442109(0x185),_0x442109(0x143)+_0x53a00b[_0x442109(0x17a)]+_0x442109(0xd9)+_0x116b96+_0x442109(0x164),_0x426aca,_0x1bc803+_0x442109(0xea)));}return _0x57db43;}function validateStep(_0xebc6cd,_0xecf011,_0x551c4e,_0x565e0f){const _0x19e97a=a149_0x4ad7,_0x1e5a44=[];if(_0xebc6cd[_0x19e97a(0x130)]===_0x19e97a(0x151))return _0xebc6cd[_0x19e97a(0x15d)]&&_0x1e5a44['push'](createIssue(_0x19e97a(0xf2),_0xecf011+'.next','END_STEP_HAS_NEXT_OR_WITH',_0x19e97a(0x186)+_0xebc6cd['name']+_0x19e97a(0x13c),_0x551c4e)),_0x19e97a(0xff)in _0xebc6cd&&_0xebc6cd[_0x19e97a(0xff)]!==undefined&&_0x1e5a44[_0x19e97a(0x152)](createIssue(_0x19e97a(0xf2),_0xecf011+'.with','END_STEP_HAS_NEXT_OR_WITH',_0x19e97a(0x186)+_0xebc6cd[_0x19e97a(0x17a)]+_0x19e97a(0x17f),_0x551c4e)),_0x1e5a44;_0xebc6cd[_0x19e97a(0x15d)]&&(_0x551c4e[_0x19e97a(0x170)]&&!_0x551c4e[_0x19e97a(0x170)][_0x19e97a(0x105)](_0xebc6cd[_0x19e97a(0x15d)])&&_0x1e5a44[_0x19e97a(0x152)](createIssue('error',_0xecf011+_0x19e97a(0xe4),_0x19e97a(0x165),_0x19e97a(0x141)+_0xebc6cd[_0x19e97a(0x15d)]+'\x27',_0x551c4e)));switch(_0xebc6cd[_0x19e97a(0x130)]){case _0x19e97a(0x145):_0x1e5a44[_0x19e97a(0x152)](...validateWaitStep(_0xebc6cd,_0xecf011,_0x551c4e,_0x565e0f));break;case _0x19e97a(0x106):_0x1e5a44[_0x19e97a(0x152)](...validateActivationStep(_0xebc6cd,_0xecf011,_0x551c4e));break;case _0x19e97a(0x140):_0x1e5a44['push'](...validateDecisionPointStep(_0xebc6cd,_0xecf011,_0x551c4e,_0x565e0f));break;case _0x19e97a(0xf5):_0x1e5a44[_0x19e97a(0x152)](...validateAbTestStep(_0xebc6cd,_0xecf011,_0x551c4e,_0x565e0f));break;case'jump':_0x1e5a44['push'](...validateJumpStep(_0xebc6cd,_0xecf011,_0x551c4e));break;}return _0x1e5a44;}function validateWaitStep(_0x226742,_0x2a4c1c,_0x556b18,_0x4b5426){const _0x5b5df8=a149_0x4ad7,_0x488847=[];if(!_0x226742[_0x5b5df8(0xff)])return _0x488847[_0x5b5df8(0x152)](createIssue(_0x5b5df8(0xf2),_0x2a4c1c+_0x5b5df8(0x10b),_0x5b5df8(0xf9),_0x5b5df8(0x158),_0x556b18,_0x2a4c1c)),_0x488847;if(_0x226742['with'][_0x5b5df8(0x18a)]){const _0x235897=_0x226742[_0x5b5df8(0xff)][_0x5b5df8(0x18a)];if(_0x235897['segment']){_0x556b18[_0x5b5df8(0x173)]?.[_0x5b5df8(0x14d)](_0x235897[_0x5b5df8(0x142)]);!_0x235897['segment'][_0x5b5df8(0xf6)](_0x5b5df8(0x104))&&(_0x556b18[_0x5b5df8(0xd5)]&&!_0x556b18[_0x5b5df8(0xd5)][_0x5b5df8(0x105)](_0x235897[_0x5b5df8(0x142)])&&_0x488847[_0x5b5df8(0x152)](createIssue(_0x5b5df8(0xf2),_0x2a4c1c+_0x5b5df8(0x136),_0x5b5df8(0x169),_0x5b5df8(0x12f)+_0x235897[_0x5b5df8(0x142)]+_0x5b5df8(0x184),_0x556b18)));_0x235897[_0x5b5df8(0x15d)]&&_0x556b18['stepNames']&&!_0x556b18[_0x5b5df8(0x170)]['has'](_0x235897[_0x5b5df8(0x15d)])&&_0x488847['push'](createIssue('error',_0x2a4c1c+_0x5b5df8(0x10c),'INVALID_NEXT_REFERENCE',_0x5b5df8(0x13a)+_0x235897['next']+'\x27',_0x556b18));_0x235897['timeout']?.[_0x5b5df8(0x15d)]&&_0x556b18[_0x5b5df8(0x170)]&&!_0x556b18[_0x5b5df8(0x170)][_0x5b5df8(0x105)](_0x235897[_0x5b5df8(0x17e)]['next'])&&_0x488847['push'](createIssue(_0x5b5df8(0xf2),_0x2a4c1c+'.with.condition.timeout.next',_0x5b5df8(0x165),_0x5b5df8(0x187)+_0x235897[_0x5b5df8(0x17e)][_0x5b5df8(0x15d)]+'\x27',_0x556b18));const _0x2e092b=_0x235897[_0x5b5df8(0x15d)]||_0x226742[_0x5b5df8(0x15d)],_0x4566dd=_0x235897['timeout']?.[_0x5b5df8(0x15d)]||_0x226742['next'];if(_0x2e092b){const _0x2e590a=_0x4b5426['get'](_0x2e092b);_0x2e590a?.[_0x5b5df8(0x130)]===_0x5b5df8(0x14b)&&_0x488847[_0x5b5df8(0x152)](createIssue('warning',_0x2a4c1c+_0x5b5df8(0x10c),'BRANCH_DIRECTLY_TO_MERGE',_0x5b5df8(0x155)+_0x2e092b+_0x5b5df8(0x161),_0x556b18,_0x2a4c1c+_0x5b5df8(0x110)));}if(_0x4566dd){const _0x64255c=_0x4b5426[_0x5b5df8(0x10f)](_0x4566dd);_0x64255c?.[_0x5b5df8(0x130)]===_0x5b5df8(0x14b)&&_0x488847[_0x5b5df8(0x152)](createIssue(_0x5b5df8(0xf3),_0x2a4c1c+_0x5b5df8(0x180),_0x5b5df8(0x14f),_0x5b5df8(0x174)+_0x4566dd+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x556b18,_0x2a4c1c+_0x5b5df8(0x125)));}}}return _0x488847;}function validateActivationStep(_0x1d6df6,_0x584e77,_0x34ab4f){const _0x1829b8=a149_0x4ad7,_0x50ae57=[];if(!_0x1d6df6[_0x1829b8(0xff)]?.['activation'])return _0x50ae57[_0x1829b8(0x152)](createIssue(_0x1829b8(0xf2),_0x584e77+_0x1829b8(0x120),'MISSING_ACTIVATION_REF','Activation\x20step\x20requires\x20an\x20activation\x20reference',_0x34ab4f,_0x584e77)),_0x50ae57;const _0x2ad385=_0x1d6df6[_0x1829b8(0xff)][_0x1829b8(0x106)];return _0x34ab4f[_0x1829b8(0x100)]&&!_0x2ad385['startsWith'](_0x1829b8(0x104))&&(!_0x34ab4f['activationKeys']['has'](_0x2ad385)&&_0x50ae57['push'](createIssue(_0x1829b8(0xf2),_0x584e77+_0x1829b8(0x120),_0x1829b8(0x107),_0x1829b8(0x12d)+_0x2ad385+'\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.',_0x34ab4f))),_0x50ae57;}function validateDecisionPointStep(_0xa79897,_0x56e809,_0x63bf62,_0x5d9d56){const _0x5e1f40=a149_0x4ad7,_0x2faa38=[];if(!_0xa79897['with']?.['branches']||_0xa79897['with'][_0x5e1f40(0xda)]['length']===0x0)return _0x2faa38['push'](createIssue('error',_0x56e809+_0x5e1f40(0x13e),'MISSING_CONDITIONS',_0x5e1f40(0xeb),_0x63bf62,_0x56e809)),_0x2faa38;for(let _0x2a4ef6=0x0;_0x2a4ef6<_0xa79897[_0x5e1f40(0xff)][_0x5e1f40(0xda)][_0x5e1f40(0xd6)];_0x2a4ef6++){const _0x394cc2=_0xa79897[_0x5e1f40(0xff)][_0x5e1f40(0xda)][_0x2a4ef6],_0x53beb7=_0x56e809+_0x5e1f40(0xe6)+_0x2a4ef6+']';_0x394cc2['segment']&&!_0x394cc2[_0x5e1f40(0x139)]&&(_0x63bf62[_0x5e1f40(0x173)]?.['add'](_0x394cc2[_0x5e1f40(0x142)]),!_0x394cc2[_0x5e1f40(0x142)]['startsWith'](_0x5e1f40(0x104))&&(_0x63bf62[_0x5e1f40(0xd5)]&&!_0x63bf62[_0x5e1f40(0xd5)]['has'](_0x394cc2['segment'])&&_0x2faa38[_0x5e1f40(0x152)](createIssue(_0x5e1f40(0xf2),_0x53beb7+_0x5e1f40(0x113),_0x5e1f40(0x169),_0x5e1f40(0x138)+_0x394cc2[_0x5e1f40(0x142)]+'\x27',_0x63bf62))));_0x394cc2[_0x5e1f40(0x15d)]&&_0x63bf62[_0x5e1f40(0x170)]&&!_0x63bf62['stepNames'][_0x5e1f40(0x105)](_0x394cc2[_0x5e1f40(0x15d)])&&_0x2faa38[_0x5e1f40(0x152)](createIssue(_0x5e1f40(0xf2),_0x53beb7+_0x5e1f40(0xe4),_0x5e1f40(0x165),_0x5e1f40(0xf8)+_0x394cc2[_0x5e1f40(0x15d)]+'\x27',_0x63bf62));if(_0x394cc2[_0x5e1f40(0x15d)]){const _0x2d33ab=_0x5d9d56[_0x5e1f40(0x10f)](_0x394cc2['next']);_0x2d33ab?.['type']===_0x5e1f40(0x14b)&&_0x2faa38[_0x5e1f40(0x152)](createIssue(_0x5e1f40(0xf3),_0x53beb7+_0x5e1f40(0xe4),'BRANCH_DIRECTLY_TO_MERGE','Decision\x20branch\x20\x27'+_0x394cc2[_0x5e1f40(0x17a)]+_0x5e1f40(0x126)+_0x394cc2['next']+'\x27\x20with\x20no\x20action\x20in\x20between',_0x63bf62));}}return _0x2faa38;}function validateAbTestStep(_0x27099c,_0x57df7d,_0x54c2eb,_0x4b2ea1){const _0x4de4f7=a149_0x4ad7,_0x3ec8ea=[];if(!_0x27099c[_0x4de4f7(0xff)]?.[_0x4de4f7(0x15c)]||_0x27099c[_0x4de4f7(0xff)][_0x4de4f7(0x15c)]['length']===0x0)return _0x3ec8ea['push'](createIssue('error',_0x57df7d+_0x4de4f7(0xe9),_0x4de4f7(0x118),_0x4de4f7(0x163),_0x54c2eb,_0x57df7d)),_0x3ec8ea;const _0x387e74=_0x27099c[_0x4de4f7(0xff)][_0x4de4f7(0x15c)][_0x4de4f7(0x150)]((_0x345f30,_0x42dfea)=>_0x345f30+(_0x42dfea[_0x4de4f7(0x176)]||0x0),0x0);Math[_0x4de4f7(0x144)](_0x387e74-0x64)>0.01&&_0x3ec8ea[_0x4de4f7(0x152)](createIssue(_0x4de4f7(0xf2),_0x57df7d+_0x4de4f7(0xe9),_0x4de4f7(0xd7),_0x4de4f7(0x12c)+_0x387e74+'%)',_0x54c2eb));for(let _0x4b6d33=0x0;_0x4b6d33<_0x27099c[_0x4de4f7(0xff)][_0x4de4f7(0x15c)][_0x4de4f7(0xd6)];_0x4b6d33++){const _0x576db4=_0x27099c['with'][_0x4de4f7(0x15c)][_0x4b6d33],_0x36f9b0=_0x57df7d+'.with.variants['+_0x4b6d33+']';_0x576db4['next']&&_0x54c2eb[_0x4de4f7(0x170)]&&!_0x54c2eb['stepNames']['has'](_0x576db4[_0x4de4f7(0x15d)])&&_0x3ec8ea['push'](createIssue(_0x4de4f7(0xf2),_0x36f9b0+_0x4de4f7(0xe4),_0x4de4f7(0x165),_0x4de4f7(0x11c)+_0x576db4['next']+'\x27',_0x54c2eb));if(_0x576db4[_0x4de4f7(0x15d)]){const _0x5c4a05=_0x4b2ea1[_0x4de4f7(0x10f)](_0x576db4['next']);_0x5c4a05?.[_0x4de4f7(0x130)]===_0x4de4f7(0x14b)&&_0x3ec8ea[_0x4de4f7(0x152)](createIssue('warning',_0x36f9b0+'.next',_0x4de4f7(0x14f),_0x4de4f7(0xfa)+_0x576db4['name']+'\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x576db4[_0x4de4f7(0x15d)]+_0x4de4f7(0x179),_0x54c2eb));}}return _0x3ec8ea;}function a149_0x4ad7(_0x6f968,_0x578306){_0x6f968=_0x6f968-0xd4;const _0x1bc7a0=a149_0x1bc7();let _0x4ad781=_0x1bc7a0[_0x6f968];return _0x4ad781;}function validateJumpStep(_0x46477c,_0x20a9f6,_0x26be4b){const _0x44928b=a149_0x4ad7,_0x532a42=[];if(!_0x46477c[_0x44928b(0xff)]?.[_0x44928b(0x162)])return _0x532a42[_0x44928b(0x152)](createIssue(_0x44928b(0xf2),_0x20a9f6+'.with.target','INVALID_JUMP_TARGET','Jump\x20step\x20requires\x20a\x20target',_0x26be4b,_0x20a9f6)),_0x532a42;return(!_0x46477c[_0x44928b(0xff)]['target'][_0x44928b(0xe8)]||!_0x46477c[_0x44928b(0xff)]['target']['stage'])&&_0x532a42['push'](createIssue('error',_0x20a9f6+'.with.target','INVALID_JUMP_TARGET',_0x44928b(0xe0),_0x26be4b)),_0x532a42;}function buildConvergenceMap(_0x1bb051){const _0x1d0c79=a149_0x4ad7,_0xd8d982=new Map();function _0xc380bb(_0x1da804,_0x2737b4){const _0x283452=a149_0x4ad7,_0xbbb67=_0xd8d982['get'](_0x1da804)||[];_0xbbb67['push'](_0x2737b4),_0xd8d982[_0x283452(0x13d)](_0x1da804,_0xbbb67);}for(const _0x1a0be2 of _0x1bb051){_0x1a0be2[_0x1d0c79(0x15d)]&&_0xc380bb(_0x1a0be2[_0x1d0c79(0x15d)],{'stepName':_0x1a0be2[_0x1d0c79(0x17a)],'description':_0x1d0c79(0xe5)+_0x1a0be2[_0x1d0c79(0x17a)]+'\x27'});if(_0x1a0be2[_0x1d0c79(0x130)]==='decision_point'&&_0x1a0be2[_0x1d0c79(0xff)]?.['branches'])for(const _0x4a42fa of _0x1a0be2[_0x1d0c79(0xff)][_0x1d0c79(0xda)]){_0x4a42fa['next']&&_0xc380bb(_0x4a42fa[_0x1d0c79(0x15d)],{'stepName':_0x1a0be2[_0x1d0c79(0x17a)],'description':_0x1d0c79(0x177)+_0x4a42fa[_0x1d0c79(0x17a)]+_0x1d0c79(0x127)+_0x1a0be2[_0x1d0c79(0x17a)]+'\x27'});}if(_0x1a0be2['type']===_0x1d0c79(0xf5)&&_0x1a0be2[_0x1d0c79(0xff)]?.[_0x1d0c79(0x15c)])for(const _0x3a20fd of _0x1a0be2[_0x1d0c79(0xff)]['variants']){_0x3a20fd[_0x1d0c79(0x15d)]&&_0xc380bb(_0x3a20fd[_0x1d0c79(0x15d)],{'stepName':_0x1a0be2[_0x1d0c79(0x17a)],'description':_0x1d0c79(0x11f)+_0x3a20fd['name']+_0x1d0c79(0x127)+_0x1a0be2[_0x1d0c79(0x17a)]+'\x27'});}_0x1a0be2[_0x1d0c79(0x130)]==='wait'&&_0x1a0be2[_0x1d0c79(0xff)]?.['condition']&&(_0x1a0be2[_0x1d0c79(0xff)][_0x1d0c79(0x18a)][_0x1d0c79(0x15d)]&&_0xc380bb(_0x1a0be2[_0x1d0c79(0xff)][_0x1d0c79(0x18a)][_0x1d0c79(0x15d)],{'stepName':_0x1a0be2[_0x1d0c79(0x17a)],'description':'condition\x20of\x20\x27'+_0x1a0be2[_0x1d0c79(0x17a)]+'\x27'}),_0x1a0be2[_0x1d0c79(0xff)][_0x1d0c79(0x18a)][_0x1d0c79(0x17e)]?.['next']&&_0xc380bb(_0x1a0be2[_0x1d0c79(0xff)][_0x1d0c79(0x18a)]['timeout'][_0x1d0c79(0x15d)],{'stepName':_0x1a0be2['name'],'description':_0x1d0c79(0x16d)+_0x1a0be2[_0x1d0c79(0x17a)]+'\x27'}));}return _0xd8d982;}function validateFlowControl(_0x3168e3,_0x4f2004,_0x20ad12){const _0x508b9d=a149_0x4ad7,_0x196eda=[],_0x1ed826=_0x508b9d(0x11e)+_0x4f2004+']',_0x4f9aba=_0x3168e3[_0x508b9d(0x16b)]||[];if(_0x4f9aba['length']===0x0)return _0x196eda;const _0x5257de=new Map();for(const _0x357ce9 of _0x4f9aba){_0x357ce9['name']&&_0x5257de['set'](_0x357ce9[_0x508b9d(0x17a)],_0x357ce9);}const _0x2ddd79=buildConvergenceMap(_0x4f9aba),_0x586ab9=_0x4f9aba[_0x508b9d(0x182)](_0x264959=>_0x264959[_0x508b9d(0x130)]===_0x508b9d(0x151));!_0x586ab9&&_0x196eda[_0x508b9d(0x152)](createIssue('error',_0x1ed826+_0x508b9d(0xea),'MISSING_END_STEP',_0x508b9d(0x143)+_0x3168e3[_0x508b9d(0x17a)]+_0x508b9d(0x14e),_0x20ad12));for(const [_0x574664,_0x481773]of _0x2ddd79){const _0x282830=_0x5257de['get'](_0x574664);if(!_0x282830)continue;if(_0x481773['length']>0x1&&_0x282830[_0x508b9d(0x130)]!==_0x508b9d(0x14b)){const _0x47460a=_0x481773[_0x508b9d(0x17b)](_0x17791e=>_0x17791e[_0x508b9d(0xfe)])[_0x508b9d(0x10d)](',\x20');_0x196eda['push'](createIssue(_0x508b9d(0xf2),_0x1ed826+_0x508b9d(0xea),_0x508b9d(0x12a),_0x508b9d(0x13b)+_0x574664+_0x508b9d(0x149)+_0x47460a+_0x508b9d(0xee),_0x20ad12));}_0x481773[_0x508b9d(0xd6)]===0x1&&_0x282830['type']===_0x508b9d(0x14b)&&_0x196eda['push'](createIssue(_0x508b9d(0xf3),_0x1ed826+_0x508b9d(0xea),_0x508b9d(0x117),_0x508b9d(0xdc)+_0x574664+_0x508b9d(0x11a)+_0x481773[0x0][_0x508b9d(0xfe)]+_0x508b9d(0x14c),_0x20ad12));}for(const _0x443709 of _0x4f9aba){if(_0x443709[_0x508b9d(0x130)]===_0x508b9d(0x14b)&&_0x443709[_0x508b9d(0x15d)]){const _0x5bda69=_0x5257de[_0x508b9d(0x10f)](_0x443709[_0x508b9d(0x15d)]);_0x5bda69?.[_0x508b9d(0x130)]===_0x508b9d(0x14b)&&_0x196eda[_0x508b9d(0x152)](createIssue(_0x508b9d(0xf2),_0x1ed826+_0x508b9d(0xea),'MERGE_TO_MERGE_CHAIN',_0x508b9d(0xdc)+_0x443709['name']+_0x508b9d(0x12e)+_0x443709['next']+'\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.',_0x20ad12));}}return _0x196eda;}function validateCriteria(_0x4c9d1f,_0x1d4dfb,_0x338a60){const _0x5e95eb=a149_0x4ad7,_0x2f0475=[];return _0x4c9d1f['segment']&&(_0x338a60['referencedSegments']?.[_0x5e95eb(0x14d)](_0x4c9d1f[_0x5e95eb(0x142)]),!_0x4c9d1f[_0x5e95eb(0x142)][_0x5e95eb(0xf6)](_0x5e95eb(0x104))&&(_0x338a60[_0x5e95eb(0xd5)]&&!_0x338a60['embeddedSegments'][_0x5e95eb(0x105)](_0x4c9d1f[_0x5e95eb(0x142)])&&_0x2f0475[_0x5e95eb(0x152)](createIssue(_0x5e95eb(0xf2),_0x1d4dfb+_0x5e95eb(0x113),_0x5e95eb(0x169),_0x5e95eb(0x154)+_0x4c9d1f[_0x5e95eb(0x142)]+'\x27',_0x338a60)))),_0x2f0475;}function validateEmbeddedSegment(_0x59380c,_0x4f9d11,_0x17af16){const _0x660a10=a149_0x4ad7,_0x12a3ff=[];return _0x59380c[_0x660a10(0x111)]&&_0x12a3ff['push'](...validateRuleDef(_0x59380c[_0x660a10(0x111)],_0x4f9d11+'.rule',_0x17af16)),_0x12a3ff;}function validateStage(_0x4e467a,_0x6e2e8a,_0x524c99,_0x174909){const _0x139619=a149_0x4ad7,_0x236a72=[],_0xaac7ad=_0x139619(0x11e)+_0x6e2e8a+']',_0x1f2a67=new Map(),_0x1db093=new Map();if(_0x4e467a[_0x139619(0x16b)]){for(let _0x5df55b=0x0;_0x5df55b<_0x4e467a[_0x139619(0x16b)][_0x139619(0xd6)];_0x5df55b++){const _0x8caabe=_0x4e467a[_0x139619(0x16b)][_0x5df55b];_0x8caabe[_0x139619(0x17a)]&&_0x1f2a67[_0x139619(0x13d)](_0x8caabe[_0x139619(0x17a)],_0x8caabe);}for(let _0x5cfdf2=0x0;_0x5cfdf2<_0x4e467a['steps'][_0x139619(0xd6)];_0x5cfdf2++){const _0x333621=_0x4e467a[_0x139619(0x16b)][_0x5cfdf2],_0x105bf2=_0xaac7ad+'.steps['+_0x5cfdf2+']';if(_0x333621[_0x139619(0x17a)]){if(_0x1db093[_0x139619(0x105)](_0x333621[_0x139619(0x17a)])){const _0x522976=_0x1db093['get'](_0x333621['name']);_0x236a72[_0x139619(0x152)](createIssue('error',_0x105bf2+_0x139619(0xed),_0x139619(0x132),_0x139619(0x115)+_0x333621['name']+_0x139619(0xd8)+_0x522976+'])',_0x174909));}else _0x1db093['set'](_0x333621['name'],_0x5cfdf2);}_0x236a72['push'](...validateStep(_0x333621,_0x105bf2,_0x174909,_0x1f2a67));}}_0x4e467a[_0x139619(0xdf)]&&_0x236a72['push'](...validateCriteria(_0x4e467a[_0x139619(0xdf)],_0xaac7ad+_0x139619(0x17d),_0x174909));if(_0x4e467a[_0x139619(0xd4)])for(let _0x2645cb=0x0;_0x2645cb<_0x4e467a[_0x139619(0xd4)]['length'];_0x2645cb++){_0x236a72[_0x139619(0x152)](...validateCriteria(_0x4e467a[_0x139619(0xd4)][_0x2645cb],_0xaac7ad+'.exit_criteria['+_0x2645cb+']',_0x174909));}return _0x4e467a[_0x139619(0x166)]&&_0x236a72[_0x139619(0x152)](...validateCriteria(_0x4e467a[_0x139619(0x166)],_0xaac7ad+_0x139619(0x114),_0x174909)),_0x236a72[_0x139619(0x152)](...validateStageStructure(_0x4e467a,_0x6e2e8a,_0x524c99,_0x174909)),_0x236a72[_0x139619(0x152)](...validateFlowControl(_0x4e467a,_0x6e2e8a,_0x174909)),_0x236a72;}function validateStagesForVersion(_0x5c78ec,_0x51b80d,_0x1840f3,_0x1b250a,_0x79b83f,_0x1906db,_0x27bfcc){const _0x3c59a1=a149_0x4ad7;if(_0x5c78ec['length']===0x0){_0x79b83f['push']({'level':_0x3c59a1(0xf2),'path':_0x1b250a+_0x3c59a1(0x102),'code':'MISSING_STAGES','message':_0x3c59a1(0x11d),'location':getLocationFromPath(_0x1840f3[_0x3c59a1(0xf4)],_0x1840f3['source'],['stages'])});return;}const _0x35c609=new Set();for(const _0x2ee7ad of _0x5c78ec){if(_0x2ee7ad[_0x3c59a1(0x16b)])for(const _0x2738ee of _0x2ee7ad[_0x3c59a1(0x16b)]){_0x2738ee['name']&&_0x35c609[_0x3c59a1(0x14d)](_0x2738ee['name']);}}const _0x2a32eb={..._0x1840f3,'stepNames':_0x35c609},_0x52d2ac=validateVersionStructure(_0x5c78ec,_0x2a32eb);for(const _0x1c51ad of _0x52d2ac){const _0x9238a0=_0x1b250a?{..._0x1c51ad,'path':''+_0x1b250a+_0x1c51ad[_0x3c59a1(0x10a)]}:_0x1c51ad;if(_0x9238a0[_0x3c59a1(0x146)]===_0x3c59a1(0xf2))_0x79b83f[_0x3c59a1(0x152)](_0x9238a0);else _0x1906db['push'](_0x9238a0);}for(let _0x4355fc=0x0;_0x4355fc<_0x5c78ec['length'];_0x4355fc++){const _0x194194=validateStage(_0x5c78ec[_0x4355fc],_0x4355fc,_0x5c78ec[_0x3c59a1(0xd6)],_0x2a32eb);for(const _0x1caa43 of _0x194194){const _0xb42a0c=_0x1b250a?{..._0x1caa43,'path':''+_0x1b250a+_0x1caa43[_0x3c59a1(0x10a)]}:_0x1caa43;if(_0xb42a0c[_0x3c59a1(0x146)]===_0x3c59a1(0xf2))_0x79b83f[_0x3c59a1(0x152)](_0xb42a0c);else _0x1906db[_0x3c59a1(0x152)](_0xb42a0c);}}if(_0x51b80d[_0x3c59a1(0x160)]){const _0x1b489d=_0x27bfcc?.[_0x3c59a1(0x17c)]?'goal':_0x1b250a+_0x3c59a1(0x160),_0x192bf5=validateCriteria(_0x51b80d[_0x3c59a1(0x160)],_0x1b489d,_0x2a32eb);for(const _0x372aa8 of _0x192bf5){if(_0x372aa8[_0x3c59a1(0x146)]===_0x3c59a1(0xf2))_0x79b83f[_0x3c59a1(0x152)](_0x372aa8);else _0x1906db[_0x3c59a1(0x152)](_0x372aa8);}}}function extractVersionIndex(_0x1fbac5){const _0x1b38f5=a149_0x4ad7,_0x4fd5dd=_0x1fbac5[_0x1b38f5(0x15b)](/^journeys\[(\d+)\]\./);return _0x4fd5dd?_0x4fd5dd[0x1]:undefined;}function a149_0x1bc7(){const _0x35df44=['excluded','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','set','.with.branches','MISSING_ENTRY_CRITERIA','decision_point','Step\x20references\x20non-existent\x20step\x20\x27','segment','Stage\x20\x27','abs','wait','level','version','.type','\x27\x20(from:\x20','size','merge',').\x20Merge\x20is\x20unnecessary.','add','\x27\x20has\x20no\x20end\x20step','BRANCH_DIRECTLY_TO_MERGE','reduce','end','push','filter','Criteria\x20references\x20undefined\x20segment\x20\x27','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','MISSING_EXIT_CRITERIA','\x27\x20has\x20no\x20steps','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','indices','source','match','variants','next','MISSING_STAGES','MISSING_NAME','goal','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','target','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','\x20steps\x20(may\x20be\x20too\x20simple)','INVALID_NEXT_REFERENCE','milestone','endsWith','message','MISSING_SEGMENT_REFERENCE','symbol','steps','Journey\x20name\x20is\x20required','timeout\x20of\x20\x27','issues','latest','stepNames','JOURNEY_SCHEMA_ERROR','448MDLiJX','referencedSegments','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','2949245VNiksk','percentage','branch\x20\x27','safeParse','\x27\x20with\x20no\x20action\x20in\x20between','name','map','goalIsInherited','.entry_criteria','timeout','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','.with.condition.timeout.next','2992818toYHbb','some','.exit_criteria','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','FEW_STEPS','End\x20step\x20\x27','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','journeys','skipSchema','condition','exit_criteria','embeddedSegments','length','INVALID_AB_TEST_PERCENTAGES','\x27\x20(first\x20defined\x20at\x20steps[','\x27\x20has\x20only\x20','branches','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','Merge\x20step\x20\x27','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','MISSING_GOAL','entry_criteria','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','versions[','data','ACTIVATION_SCHEMA_ERROR','.next','step\x20\x27','.with.branches[','includes','journey','.with.variants','.steps','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','launched','.name',').\x20Use\x20a\x20merge\x20step.','activations','Journey\x20has\x20','segments.','error','warning','document','ab_test','startsWith','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','MISSING_WAIT_PARAMS','A/B\x20test\x20variant\x20\x27','2059334rAIvyR','MISSING_MILESTONE','\x20with\x20latest:\x20true','description','with','activationKeys','\x20(across\x20','stages','journeys[','ref:','has','activation','MISSING_ACTIVATION_DEFINITION','keys','\x20stages\x20but\x20maximum\x20is\x20','path','.with','.with.condition.next','join','UNUSED_EMBEDDED_SEGMENT','get','.with.condition','rule','Embedded\x20segment\x20\x27','.segment','.milestone','Duplicate\x20step\x20name\x20\x27','538132GDUrWr','SINGLE_INPUT_MERGE','MISSING_CONDITIONS','entries','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','TOO_MANY_STAGES','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','stages[','variant\x20\x27','.with.activation','sort','journey\x20entry','replace','979586eJNSls','.with.condition.timeout','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','\x27\x20of\x20\x27','journeys,\x20stages,\x20or\x20versions','179536QnEZET','CONVERGENCE_WITHOUT_MERGE','Journey\x20has\x20no\x20goal\x20defined','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','type','segments','DUPLICATE_STEP_NAME','versions','INSUFFICIENT_STEPS','\x20versions)','.with.condition.segment','1830816QmvANm','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'];a149_0x1bc7=function(){return _0x35df44;};return a149_0x1bc7();}function deduplicateAcrossVersions(_0x4ec366){const _0x2aad5d=a149_0x4ad7,_0x4c9fc2=new Map();for(let _0x20be3f=0x0;_0x20be3f<_0x4ec366[_0x2aad5d(0xd6)];_0x20be3f++){const _0x5e3564=_0x4ec366[_0x20be3f]['code']+':'+_0x4ec366[_0x20be3f][_0x2aad5d(0x168)],_0x58ce17=extractVersionIndex(_0x4ec366[_0x20be3f][_0x2aad5d(0x10a)]),_0x1c7c64=_0x4c9fc2[_0x2aad5d(0x10f)](_0x5e3564);if(_0x1c7c64){_0x1c7c64[_0x2aad5d(0x159)][_0x2aad5d(0x152)](_0x20be3f);if(_0x58ce17)_0x1c7c64[_0x2aad5d(0x133)]['add'](_0x58ce17);}else _0x4c9fc2[_0x2aad5d(0x13d)](_0x5e3564,{'indices':[_0x20be3f],'versions':new Set(_0x58ce17?[_0x58ce17]:[])});}const _0x3b8056=new Set();for(const {indices:_0x3640f3,versions:_0x593420}of _0x4c9fc2['values']()){if(_0x593420[_0x2aad5d(0x14a)]<=0x1)continue;const _0x3304f7=_0x4ec366[_0x3640f3[0x0]];_0x3304f7['path']=_0x3304f7[_0x2aad5d(0x10a)][_0x2aad5d(0x123)](/^journeys\[\d+\]\./,''),_0x3304f7['message']=_0x3304f7[_0x2aad5d(0x168)]+_0x2aad5d(0x101)+_0x593420[_0x2aad5d(0x14a)]+_0x2aad5d(0x135);for(let _0x29d585=0x1;_0x29d585<_0x3640f3[_0x2aad5d(0xd6)];_0x29d585++){_0x3b8056[_0x2aad5d(0x14d)](_0x3640f3[_0x29d585]);}}const _0x1cb448=[..._0x3b8056][_0x2aad5d(0x121)]((_0x59aa52,_0x23a14d)=>_0x23a14d-_0x59aa52);for(const _0x274aa4 of _0x1cb448){_0x4ec366['splice'](_0x274aa4,0x1);}}export function validateJourneyDef(_0x2c8cf5,_0x4960b8={},_0x557e75={}){const _0x292b86=a149_0x4ad7;if(_0x557e75[_0x292b86(0x189)])return runJourneySemanticChecks(_0x2c8cf5,_0x4960b8);const _0x84993c=JourneyDefSchema[_0x292b86(0x178)](_0x2c8cf5);if(_0x84993c['success'])return runJourneySemanticChecks(_0x84993c[_0x292b86(0xe2)],_0x4960b8);return zodErrorsToJourneyValidationResult(_0x84993c[_0x292b86(0xf2)],_0x4960b8);}function zodErrorsToJourneyValidationResult(_0x2a22f1,_0x208658){const _0x31698d=a149_0x4ad7,_0x3cebd9=flattenZodIssues(_0x2a22f1[_0x31698d(0x16e)]),_0x4c7070=_0x3cebd9[_0x31698d(0x17b)](_0x1a19c7=>{const _0x6b2c14=_0x31698d,_0x54c45f=formatZodPath(_0x1a19c7[_0x6b2c14(0x10a)]),_0x4e2a3b=mapJourneyZodIssueToCode(_0x1a19c7,_0x54c45f),_0x5a30c3=getLocationFromPath(_0x208658[_0x6b2c14(0xf4)],_0x208658['source'],_0x1a19c7['path'][_0x6b2c14(0x17b)](_0x414655=>typeof _0x414655===_0x6b2c14(0x16a)?String(_0x414655):_0x414655));return{'level':_0x6b2c14(0xf2),'path':_0x54c45f,'code':_0x4e2a3b,'message':_0x1a19c7['message'],..._0x5a30c3&&{'location':_0x5a30c3}};});return{'valid':![],'errors':_0x4c7070,'warnings':[]};}function mapJourneyZodIssueToCode(_0x1d8271,_0x323692){const _0x5727f1=a149_0x4ad7;if(_0x323692===_0x5727f1(0x17a))return'MISSING_NAME';if(_0x323692[_0x5727f1(0x167)](_0x5727f1(0x148))&&_0x323692['includes'](_0x5727f1(0x16b)))return'JOURNEY_SCHEMA_ERROR';if(_0x323692===_0x5727f1(0x102)||_0x323692['endsWith']('.stages'))return _0x5727f1(0x15e);if(_0x323692===''&&_0x1d8271[_0x5727f1(0x168)][_0x5727f1(0xe7)](_0x5727f1(0x128)))return _0x5727f1(0x15e);if(_0x323692['includes'](_0x5727f1(0x106)))return _0x5727f1(0xe3);return _0x5727f1(0x171);}function runJourneySemanticChecks(_0x3b60d2,_0x337573){const _0x34ec41=a149_0x4ad7,_0xfd880f=[],_0x59364d=[];(!_0x3b60d2[_0x34ec41(0x17a)]||_0x3b60d2[_0x34ec41(0x17a)]['trim']()==='')&&_0xfd880f[_0x34ec41(0x152)]({'level':_0x34ec41(0xf2),'path':'name','code':_0x34ec41(0x15f),'message':_0x34ec41(0x16c),'location':getLocationFromPath(_0x337573[_0x34ec41(0xf4)],_0x337573['source'],[_0x34ec41(0x17a)])});const _0x1df933=new Set();if(_0x3b60d2[_0x34ec41(0x131)])for(const _0x2448ae of Object[_0x34ec41(0x108)](_0x3b60d2['segments'])){_0x1df933['add'](_0x2448ae);}const _0x50675b=new Set();if(_0x3b60d2[_0x34ec41(0xef)])for(const _0x874c8a of Object[_0x34ec41(0x108)](_0x3b60d2[_0x34ec41(0xef)])){_0x50675b[_0x34ec41(0x14d)](_0x874c8a);}const _0x215ed7=new Set(),_0x4f4cef={..._0x337573,'embeddedSegments':_0x1df933,'referencedSegments':_0x215ed7,'activationKeys':_0x50675b[_0x34ec41(0x14a)]>0x0?_0x50675b:undefined};if(_0x3b60d2[_0x34ec41(0x131)])for(const [_0x15fcaa,_0x4cd444]of Object[_0x34ec41(0x119)](_0x3b60d2['segments'])){const _0x505261=validateEmbeddedSegment(_0x4cd444,_0x34ec41(0xf1)+_0x15fcaa,_0x4f4cef);for(const _0x146b5b of _0x505261){if(_0x146b5b[_0x34ec41(0x146)]===_0x34ec41(0xf2))_0xfd880f['push'](_0x146b5b);else _0x59364d[_0x34ec41(0x152)](_0x146b5b);}}const _0x4855b9=!!_0x3b60d2['goal'],_0x2d5521=_0x3b60d2[_0x34ec41(0x188)]?.['every'](_0x3261a2=>!!_0x3261a2['goal'])??![];!_0x4855b9&&!_0x2d5521&&_0x59364d[_0x34ec41(0x152)]({'level':'warning','path':'goal','code':_0x34ec41(0xde),'message':_0x34ec41(0x12b),'location':getLocationFromPath(_0x337573[_0x34ec41(0xf4)],_0x337573[_0x34ec41(0x15a)],[_0x34ec41(0x160)])});const _0x5d3dd6=_0x3b60d2['journeys']??_0x3b60d2[_0x34ec41(0x133)];if(_0x5d3dd6&&_0x5d3dd6[_0x34ec41(0x153)](_0xba7d34=>_0xba7d34[_0x34ec41(0x16f)]===!![])['length']>0x1){const _0x28daf4=_0x3b60d2[_0x34ec41(0x188)]?_0x34ec41(0x188):_0x34ec41(0x133);_0xfd880f[_0x34ec41(0x152)]({'level':_0x34ec41(0xf2),'path':_0x28daf4,'code':'DUPLICATE_LATEST','message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x28daf4===_0x34ec41(0x188)?_0x34ec41(0x122):_0x34ec41(0x147))+_0x34ec41(0xfd),'location':getLocationFromPath(_0x337573['document'],_0x337573[_0x34ec41(0x15a)],[_0x28daf4])});}if(_0x3b60d2['journeys']&&_0x3b60d2[_0x34ec41(0x188)][_0x34ec41(0xd6)]>0x0)for(let _0x569fca=0x0;_0x569fca<_0x3b60d2[_0x34ec41(0x188)][_0x34ec41(0xd6)];_0x569fca++){const _0x57cd27=_0x3b60d2[_0x34ec41(0x188)][_0x569fca];if(_0x3b60d2[_0x34ec41(0x188)][_0x34ec41(0xd6)]>0x1&&_0x57cd27['state']===_0x34ec41(0xec))continue;const _0x2feaad=_0x57cd27[_0x34ec41(0x102)]||[],_0x379d73=_0x34ec41(0x103)+_0x569fca+'].',_0x18a358=!!_0x57cd27[_0x34ec41(0x160)],_0x9d76c8=_0x18a358?{..._0x3b60d2,'goal':_0x57cd27[_0x34ec41(0x160)]}:_0x3b60d2;validateStagesForVersion(_0x2feaad,_0x9d76c8,_0x4f4cef,_0x379d73,_0xfd880f,_0x59364d,{'goalIsInherited':!_0x18a358});}else{if(_0x3b60d2[_0x34ec41(0x133)]&&_0x3b60d2[_0x34ec41(0x133)][_0x34ec41(0xd6)]>0x0)for(let _0x29ca26=0x0;_0x29ca26<_0x3b60d2[_0x34ec41(0x133)][_0x34ec41(0xd6)];_0x29ca26++){const _0x1a9a4a=_0x3b60d2[_0x34ec41(0x133)][_0x29ca26];if(_0x3b60d2[_0x34ec41(0x133)]['length']>0x1&&_0x1a9a4a['state']==='launched')continue;const _0x5df079=_0x1a9a4a[_0x34ec41(0x102)]||[],_0x2759b2=_0x34ec41(0xe1)+_0x29ca26+'].';validateStagesForVersion(_0x5df079,_0x3b60d2,_0x4f4cef,_0x2759b2,_0xfd880f,_0x59364d);}else{const _0xe41143=_0x3b60d2[_0x34ec41(0x102)]||[];validateStagesForVersion(_0xe41143,_0x3b60d2,_0x4f4cef,'',_0xfd880f,_0x59364d);}}_0x3b60d2['journeys']&&_0x3b60d2[_0x34ec41(0x188)]['length']>0x1&&(deduplicateAcrossVersions(_0xfd880f),deduplicateAcrossVersions(_0x59364d));for(const _0x43f473 of _0x1df933){!_0x215ed7[_0x34ec41(0x105)](_0x43f473)&&!_0x43f473[_0x34ec41(0xf6)]('excluded_')&&_0x59364d['push']({'level':_0x34ec41(0xf3),'path':_0x34ec41(0xf1)+_0x43f473,'code':_0x34ec41(0x10e),'message':_0x34ec41(0x112)+_0x43f473+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x337573['document'],_0x337573[_0x34ec41(0x15a)],[_0x34ec41(0x131),_0x43f473])});}return{'valid':_0xfd880f[_0x34ec41(0xd6)]===0x0,'errors':_0xfd880f,'warnings':_0x59364d};}