@treasuredata/tdx 2026.3.33 → 2026.3.34

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 (253) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/auth-login-command.js +1 -1
  13. package/dist/commands/cas-command.js +1 -1
  14. package/dist/commands/cas-segment-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segment-validate-command.js +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/show.js +1 -1
  52. package/dist/commands/status-command.js +1 -1
  53. package/dist/commands/tables.js +1 -1
  54. package/dist/commands/unset-command.js +1 -1
  55. package/dist/commands/upgrade-command.js +1 -1
  56. package/dist/commands/use-command.js +1 -1
  57. package/dist/commands/user-command.js +1 -1
  58. package/dist/commands/work-command.js +1 -1
  59. package/dist/commands/workflow-command.js +1 -1
  60. package/dist/core/auth.js +1 -1
  61. package/dist/core/command-output.js +1 -1
  62. package/dist/core/config.js +1 -1
  63. package/dist/core/connection-cache.js +1 -1
  64. package/dist/core/constants.js +1 -1
  65. package/dist/core/credential-cache.js +1 -1
  66. package/dist/core/global-context.js +1 -1
  67. package/dist/core/keychain.js +1 -1
  68. package/dist/core/oauth-keychain.js +1 -1
  69. package/dist/core/oauth.js +1 -1
  70. package/dist/core/profile.js +1 -1
  71. package/dist/core/project-config.js +1 -1
  72. package/dist/core/session.js +1 -1
  73. package/dist/core/user-cache.js +1 -1
  74. package/dist/core/version.js +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/mcp/server.js +1 -1
  77. package/dist/mcp/tools/index.js +1 -1
  78. package/dist/mcp/tools/tdx-run.js +1 -1
  79. package/dist/mcp/tools/tdx-search.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.d.ts.map +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/api.js.map +1 -1
  96. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  97. package/dist/sdk/cas/cas-api-client.js +1 -1
  98. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  99. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  100. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  101. package/dist/sdk/cas/index.js +1 -1
  102. package/dist/sdk/cas/pull-workflow.js +1 -1
  103. package/dist/sdk/cas/push-workflow.js +1 -1
  104. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  107. package/dist/sdk/client/delivery-api-client.d.ts.map +1 -1
  108. package/dist/sdk/client/delivery-api-client.js +1 -1
  109. package/dist/sdk/client/delivery-api-client.js.map +1 -1
  110. package/dist/sdk/client/endpoints.js +1 -1
  111. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  112. package/dist/sdk/client/engage-api-client.js +1 -1
  113. package/dist/sdk/client/engage-api-client.js.map +1 -1
  114. package/dist/sdk/client/http-client.d.ts +7 -0
  115. package/dist/sdk/client/http-client.d.ts.map +1 -1
  116. package/dist/sdk/client/http-client.js +1 -1
  117. package/dist/sdk/client/http-client.js.map +1 -1
  118. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  119. package/dist/sdk/client/llm-api-client.js +1 -1
  120. package/dist/sdk/client/llm-api-client.js.map +1 -1
  121. package/dist/sdk/client/oauth-refresh.js +1 -1
  122. package/dist/sdk/client/rate-limiter.js +1 -1
  123. package/dist/sdk/client/td-api-client.d.ts.map +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/td-api-client.js.map +1 -1
  126. package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
  127. package/dist/sdk/client/trino-api-client.js +1 -1
  128. package/dist/sdk/client/trino-api-client.js.map +1 -1
  129. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  130. package/dist/sdk/client/workflow-client.js +1 -1
  131. package/dist/sdk/client/workflow-client.js.map +1 -1
  132. package/dist/sdk/connection-validator.js +1 -1
  133. package/dist/sdk/connection.js +1 -1
  134. package/dist/sdk/delivery.js +1 -1
  135. package/dist/sdk/engage/campaign-pull.js +1 -1
  136. package/dist/sdk/engage/campaign-push.js +1 -1
  137. package/dist/sdk/engage/campaign-validator.js +1 -1
  138. package/dist/sdk/engage/campaign-yaml.js +1 -1
  139. package/dist/sdk/engage/template-pull.js +1 -1
  140. package/dist/sdk/engage/template-push.js +1 -1
  141. package/dist/sdk/engage/template-validator.js +1 -1
  142. package/dist/sdk/engage/template-yaml.js +1 -1
  143. package/dist/sdk/engage/types/campaign-def.js +1 -1
  144. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  145. package/dist/sdk/engage/types/template-schema.js +1 -1
  146. package/dist/sdk/engage.js +1 -1
  147. package/dist/sdk/errors.js +1 -1
  148. package/dist/sdk/index.d.ts +12 -0
  149. package/dist/sdk/index.d.ts.map +1 -1
  150. package/dist/sdk/index.js +1 -1
  151. package/dist/sdk/index.js.map +1 -1
  152. package/dist/sdk/io/index.js +1 -1
  153. package/dist/sdk/io/node-filesystem.js +1 -1
  154. package/dist/sdk/job.js +1 -1
  155. package/dist/sdk/journey.js +1 -1
  156. package/dist/sdk/llm/chat-cache.js +1 -1
  157. package/dist/sdk/llm/index.js +1 -1
  158. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  159. package/dist/sdk/llm/model-factors.js +1 -1
  160. package/dist/sdk/personalization.d.ts.map +1 -1
  161. package/dist/sdk/personalization.js +1 -1
  162. package/dist/sdk/personalization.js.map +1 -1
  163. package/dist/sdk/policy.d.ts.map +1 -1
  164. package/dist/sdk/policy.js +1 -1
  165. package/dist/sdk/policy.js.map +1 -1
  166. package/dist/sdk/query/index.js +1 -1
  167. package/dist/sdk/query/sql-parser.js +1 -1
  168. package/dist/sdk/realtime.d.ts.map +1 -1
  169. package/dist/sdk/realtime.js +1 -1
  170. package/dist/sdk/realtime.js.map +1 -1
  171. package/dist/sdk/schedule.js +1 -1
  172. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  173. package/dist/sdk/segment/fields-display.js +1 -1
  174. package/dist/sdk/segment/file-discovery.js +1 -1
  175. package/dist/sdk/segment/journey-utils.js +1 -1
  176. package/dist/sdk/segment/journey-validator.js +1 -1
  177. package/dist/sdk/segment/journey-yaml.js +1 -1
  178. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  179. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  180. package/dist/sdk/segment/pull-workflow.js +1 -1
  181. package/dist/sdk/segment/push-recovery.js +1 -1
  182. package/dist/sdk/segment/push-workflow.js +1 -1
  183. package/dist/sdk/segment/resolution-context.js +1 -1
  184. package/dist/sdk/segment/segment-path-parser.js +1 -1
  185. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  186. package/dist/sdk/segment/segment-validator.js +1 -1
  187. package/dist/sdk/segment/target-resolution.js +1 -1
  188. package/dist/sdk/segment/tdx-config.js +1 -1
  189. package/dist/sdk/segment/types/activation-schema.js +1 -1
  190. package/dist/sdk/segment/types/journey-def.js +1 -1
  191. package/dist/sdk/segment/types/journey-schema.js +1 -1
  192. package/dist/sdk/segment/types/segment-def.js +1 -1
  193. package/dist/sdk/segment/types/segment-schema.js +1 -1
  194. package/dist/sdk/segment/validate-files.js +1 -1
  195. package/dist/sdk/segment/yaml-validator.js +1 -1
  196. package/dist/sdk/segment.js +1 -1
  197. package/dist/sdk/types/index.js +1 -1
  198. package/dist/sdk/types/progress.js +1 -1
  199. package/dist/sdk/types/workspace.d.ts +1 -0
  200. package/dist/sdk/types/workspace.d.ts.map +1 -1
  201. package/dist/sdk/types/workspace.js +1 -1
  202. package/dist/sdk/user.js +1 -1
  203. package/dist/sdk/util/format-detector.js +1 -1
  204. package/dist/sdk/util/formatters.js +1 -1
  205. package/dist/sdk/util/index.js +1 -1
  206. package/dist/sdk/util/paginate.js +1 -1
  207. package/dist/sdk/util/tree-formatter.js +1 -1
  208. package/dist/sdk/workflow/archive-validation.js +1 -1
  209. package/dist/sdk/workflow/clone-workflow.js +1 -1
  210. package/dist/sdk/workflow/index.js +1 -1
  211. package/dist/sdk/workflow/pull-workflow.js +1 -1
  212. package/dist/sdk/workflow/push-workflow.js +1 -1
  213. package/dist/sdk/workflow/tdx-config.js +1 -1
  214. package/dist/sdk/workflow/workflow-utils.js +1 -1
  215. package/dist/sdk/workspace/frontmatter.js +1 -1
  216. package/dist/sdk/workspace/git.js +1 -1
  217. package/dist/sdk/workspace/index.js +1 -1
  218. package/dist/sdk/workspace/templates.js +1 -1
  219. package/dist/sdk/workspace/weekly.js +1 -1
  220. package/dist/sdk/workspace/wikilinks.js +1 -1
  221. package/dist/test-utils/command-runner.js +1 -1
  222. package/dist/test-utils/factories.js +1 -1
  223. package/dist/test-utils/fixtures.js +1 -1
  224. package/dist/test-utils/http-mock.js +1 -1
  225. package/dist/test-utils/index.js +1 -1
  226. package/dist/utils/async.js +1 -1
  227. package/dist/utils/colors.js +1 -1
  228. package/dist/utils/diff.js +1 -1
  229. package/dist/utils/file-permissions.js +1 -1
  230. package/dist/utils/file-reader.js +1 -1
  231. package/dist/utils/github-releases.js +1 -1
  232. package/dist/utils/global-cache.js +1 -1
  233. package/dist/utils/json-loader.js +1 -1
  234. package/dist/utils/local-cache.js +1 -1
  235. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  236. package/dist/utils/logger/formatters/index.js +1 -1
  237. package/dist/utils/logger/handlers/console-handler.js +1 -1
  238. package/dist/utils/logger/handlers/file-handler.js +1 -1
  239. package/dist/utils/logger/handlers/index.js +1 -1
  240. package/dist/utils/logger/handlers/null-handler.js +1 -1
  241. package/dist/utils/logger/index.js +1 -1
  242. package/dist/utils/logger/logger.js +1 -1
  243. package/dist/utils/logger/types.js +1 -1
  244. package/dist/utils/option-validation.js +1 -1
  245. package/dist/utils/process.js +1 -1
  246. package/dist/utils/prompt.js +1 -1
  247. package/dist/utils/spinner.js +1 -1
  248. package/dist/utils/sse-parser.js +1 -1
  249. package/dist/utils/string-utils.js +1 -1
  250. package/dist/utils/table-ref-parser.js +1 -1
  251. package/dist/utils/tdx-logger.js +1 -1
  252. package/dist/utils/version-check.js +1 -1
  253. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x1ff901=a26_0xd38e;(function(_0x50be23,_0x1dd34e){const _0x3d6aa5=a26_0xd38e,_0x26f491=_0x50be23();while(!![]){try{const _0x18cef3=parseInt(_0x3d6aa5(0x183))/0x1+parseInt(_0x3d6aa5(0x15a))/0x2*(-parseInt(_0x3d6aa5(0x16a))/0x3)+-parseInt(_0x3d6aa5(0x16f))/0x4+parseInt(_0x3d6aa5(0x176))/0x5*(parseInt(_0x3d6aa5(0x17b))/0x6)+parseInt(_0x3d6aa5(0x186))/0x7+parseInt(_0x3d6aa5(0x17f))/0x8+-parseInt(_0x3d6aa5(0x172))/0x9;if(_0x18cef3===_0x1dd34e)break;else _0x26f491['push'](_0x26f491['shift']());}catch(_0x4d6cee){_0x26f491['push'](_0x26f491['shift']());}}}(a26_0x571f,0x8c81d));function a26_0x571f(){const _0x109756=['26368VENVFA','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','template','log','validCount','endsWith','cwd','\x20non-template\x20file(s)\x20skipped)','\x20non-template\x20file(s)\x20skipped','Validation\x20failed:\x20','description','skippedCount','✔\x20All\x20','name','\x20(skipped:\x20','resolve','24dtwAhu','red','Error:\x20Directory\x20not\x20found:\x20','\x20error(s)','length','4576100eqZyNJ','Validate\x20template\x20YAML\x20files','execute','3706821IUAQzE','\x20warning(s)\x20found','reason','warnings','6470TknbCY','hasErrors','No\x20template\x20YAML\x20files\x20found\x20in\x20','invalidCount','yellow','5190xlMtbd','relativePath','warningCount','dim','1024368jOvPNr','engage:template:validate','green','\x20warning(s)','960136rOzpjN','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yaml','205737FtIvmW','valid','error'];a26_0x571f=function(){return _0x109756;};return a26_0x571f();}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x5f20d0 from'chalk';function a26_0xd38e(_0xc42a18,_0x307731){_0xc42a18=_0xc42a18-0x15a;const _0x571f1c=a26_0x571f();let _0xd38e18=_0x571f1c[_0xc42a18];return _0xd38e18;}import a26_0x32322c from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a26_0x1ff901(0x167)]=a26_0x1ff901(0x180);[a26_0x1ff901(0x164)]=a26_0x1ff901(0x170);async[a26_0x1ff901(0x171)](_0x7e0834){const _0xa29c5=a26_0x1ff901,{options:_0x16f017,args:_0x76d731}=_0x7e0834,_0xfa798b=_0x16f017,_0x4ce965=_0x76d731[0x0],_0x17f90a=_0x4ce965?a26_0x32322c[_0xa29c5(0x169)](_0x4ce965):undefined,_0x4451d6=_0x17f90a?isYamlFile(_0x17f90a):![];let _0x56ca4f,_0x435884;if(_0x4451d6&&_0x17f90a)_0x56ca4f=a26_0x32322c['dirname'](_0x17f90a),_0x435884=_0x17f90a;else _0x17f90a?_0x56ca4f=_0x17f90a:_0x56ca4f=process[_0xa29c5(0x160)]();if(!_0x435884&&!existsSync(_0x56ca4f))return console[_0xa29c5(0x188)](a26_0x5f20d0['red'](_0xa29c5(0x16c)+_0x56ca4f+'\x0a')),0x1;let _0x15242f;if(_0x435884){if(!_0x435884[_0xa29c5(0x15f)]('.yml')&&!_0x435884['endsWith'](_0xa29c5(0x185)))return console[_0xa29c5(0x188)](a26_0x5f20d0[_0xa29c5(0x16b)](_0xa29c5(0x15b)+_0x435884+'\x0a')),0x1;_0x15242f=[_0x435884];}else _0x15242f=findYamlFiles(_0x56ca4f);if(_0x15242f[_0xa29c5(0x16e)]===0x0)return console[_0xa29c5(0x188)](a26_0x5f20d0['red'](_0xa29c5(0x184)+_0x56ca4f+'\x0a')),0x1;const _0x418fa8=validateYamlFiles(_0x15242f,_0x56ca4f,{'filterType':_0xa29c5(0x15c)}),_0x13f3c3=calculateSummary(_0x418fa8),_0x4f5299=_0x418fa8['filter'](isValidationResult);if(_0x4f5299['length']===0x0)return console['error'](a26_0x5f20d0[_0xa29c5(0x17a)](_0xa29c5(0x178)+_0x56ca4f+'\x0a')),_0x13f3c3['skippedCount']>0x0&&console[_0xa29c5(0x188)](a26_0x5f20d0['dim']('('+_0x13f3c3[_0xa29c5(0x165)]+_0xa29c5(0x161))),0x0;for(const _0x3b49a7 of _0x418fa8){if(!isValidationResult(_0x3b49a7)){_0xfa798b['verbose']&&console[_0xa29c5(0x15d)](a26_0x5f20d0['dim']('-\x20'+_0x3b49a7[_0xa29c5(0x17c)]+_0xa29c5(0x168)+_0x3b49a7[_0xa29c5(0x174)]+')'));continue;}const {relativePath:_0x176c9e,source:_0x4eef01,result:_0x92690e}=_0x3b49a7;if(_0x92690e[_0xa29c5(0x187)]&&_0x92690e[_0xa29c5(0x175)][_0xa29c5(0x16e)]===0x0)_0xfa798b['verbose']&&console[_0xa29c5(0x15d)](a26_0x5f20d0['green']('✔\x20'+_0x176c9e));else _0x92690e['valid']?(console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x17a)]('⚠\x20'+_0x176c9e+':\x20'+_0x92690e[_0xa29c5(0x175)]['length']+_0xa29c5(0x182))),console['log'](formatValidationResult(_0x92690e,_0x4eef01,_0x176c9e))):(console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x16b)]('✖\x20'+_0x176c9e+':\x20'+_0x92690e['errors'][_0xa29c5(0x16e)]+_0xa29c5(0x16d))),console[_0xa29c5(0x15d)](formatValidationResult(_0x92690e,_0x4eef01,_0x176c9e)));}return console[_0xa29c5(0x15d)](''),_0x13f3c3[_0xa29c5(0x177)]?(console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x16b)](_0xa29c5(0x163)+_0x13f3c3[_0xa29c5(0x179)]+'\x20template(s)\x20with\x20errors,\x20'+_0x13f3c3[_0xa29c5(0x15e)]+'\x20valid')),_0x13f3c3[_0xa29c5(0x17d)]>0x0&&console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x17a)](_0x13f3c3[_0xa29c5(0x17d)]+'\x20warning(s)\x20found')),_0x13f3c3['skippedCount']>0x0&&console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x17e)](_0x13f3c3['skippedCount']+_0xa29c5(0x162))),0x1):(console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x181)](_0xa29c5(0x166)+_0x13f3c3[_0xa29c5(0x15e)]+'\x20template(s)\x20valid')),_0x13f3c3[_0xa29c5(0x17d)]>0x0&&console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x17a)](_0x13f3c3['warningCount']+_0xa29c5(0x173))),_0x13f3c3['skippedCount']>0x0&&console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x17e)](_0x13f3c3[_0xa29c5(0x165)]+_0xa29c5(0x162))),0x0);}}
1
+ const a26_0x1980be=a26_0x5d9a;(function(_0x2a7729,_0x28a63c){const _0x6255c6=a26_0x5d9a,_0x583bf4=_0x2a7729();while(!![]){try{const _0x257a32=parseInt(_0x6255c6(0x1ad))/0x1*(-parseInt(_0x6255c6(0x1a2))/0x2)+-parseInt(_0x6255c6(0x1b0))/0x3*(-parseInt(_0x6255c6(0x19d))/0x4)+-parseInt(_0x6255c6(0x1c0))/0x5*(-parseInt(_0x6255c6(0x1a4))/0x6)+parseInt(_0x6255c6(0x1aa))/0x7*(parseInt(_0x6255c6(0x1a5))/0x8)+parseInt(_0x6255c6(0x199))/0x9*(-parseInt(_0x6255c6(0x19f))/0xa)+-parseInt(_0x6255c6(0x18d))/0xb*(-parseInt(_0x6255c6(0x18b))/0xc)+parseInt(_0x6255c6(0x1a3))/0xd*(-parseInt(_0x6255c6(0x1a0))/0xe);if(_0x257a32===_0x28a63c)break;else _0x583bf4['push'](_0x583bf4['shift']());}catch(_0x24ec0a){_0x583bf4['push'](_0x583bf4['shift']());}}}(a26_0x1d38,0x2ceb7));import{BaseCommand}from'./command.js';function a26_0x5d9a(_0x1add11,_0xe3cc8c){_0x1add11=_0x1add11-0x189;const _0x1d387d=a26_0x1d38();let _0x5d9a6c=_0x1d387d[_0x1add11];return _0x5d9a6c;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a26_0x1d38(){const _0x4e67bb=['13139csDmSw','yellow','.yml','68067jtDbCW','\x20template(s)\x20with\x20errors,\x20','warningCount','18NKwWTP','\x20non-template\x20file(s)\x20skipped','cwd','template','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','valid','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20template(s)\x20valid','reason','hasErrors','engage:template:validate','resolve','dim','relativePath','.yaml','\x20warning(s)\x20found','5lTzfDI','Validation\x20failed:\x20','\x20(skipped:\x20','64548MqPrGA','warnings','704UEqvGx','name','validCount','green','No\x20template\x20YAML\x20files\x20found\x20in\x20','errors','endsWith','length','verbose','✔\x20All\x20','log','\x20valid','1179ANCcSu','description','filter','Validate\x20template\x20YAML\x20files','235588OZjMCA','skippedCount','19420gMkwJy','14upgMDh','error','8UBIlBg','1424839NBQexG','105084OEiBmc','448UBAsBK','Error:\x20Directory\x20not\x20found:\x20','\x20error(s)','\x20non-template\x20file(s)\x20skipped)','red'];a26_0x1d38=function(){return _0x4e67bb;};return a26_0x1d38();}import{existsSync}from'fs';import a26_0x54e1a9 from'chalk';import a26_0x26af47 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a26_0x1980be(0x18e)]=a26_0x1980be(0x1ba);[a26_0x1980be(0x19a)]=a26_0x1980be(0x19c);async['execute'](_0x54c637){const _0x478d18=a26_0x1980be,{options:_0x328c07,args:_0x8e689d}=_0x54c637,_0x2907cc=_0x328c07,_0x3a0f20=_0x8e689d[0x0],_0x1bd3fc=_0x3a0f20?a26_0x26af47[_0x478d18(0x1bb)](_0x3a0f20):undefined,_0x3d9e6c=_0x1bd3fc?isYamlFile(_0x1bd3fc):![];let _0x1e7c7c,_0xe7c17a;if(_0x3d9e6c&&_0x1bd3fc)_0x1e7c7c=a26_0x26af47['dirname'](_0x1bd3fc),_0xe7c17a=_0x1bd3fc;else _0x1bd3fc?_0x1e7c7c=_0x1bd3fc:_0x1e7c7c=process[_0x478d18(0x1b2)]();if(!_0xe7c17a&&!existsSync(_0x1e7c7c))return console[_0x478d18(0x1a1)](a26_0x54e1a9[_0x478d18(0x1a9)](_0x478d18(0x1a6)+_0x1e7c7c+'\x0a')),0x1;let _0x4da411;if(_0xe7c17a){if(!_0xe7c17a[_0x478d18(0x193)](_0x478d18(0x1ac))&&!_0xe7c17a[_0x478d18(0x193)](_0x478d18(0x1be)))return console['error'](a26_0x54e1a9[_0x478d18(0x1a9)](_0x478d18(0x1b4)+_0xe7c17a+'\x0a')),0x1;_0x4da411=[_0xe7c17a];}else _0x4da411=findYamlFiles(_0x1e7c7c);if(_0x4da411[_0x478d18(0x194)]===0x0)return console['error'](a26_0x54e1a9[_0x478d18(0x1a9)](_0x478d18(0x1b6)+_0x1e7c7c+'\x0a')),0x1;const _0x598c22=validateYamlFiles(_0x4da411,_0x1e7c7c,{'filterType':_0x478d18(0x1b3)}),_0x481317=calculateSummary(_0x598c22),_0x137b57=_0x598c22[_0x478d18(0x19b)](isValidationResult);if(_0x137b57[_0x478d18(0x194)]===0x0)return console[_0x478d18(0x1a1)](a26_0x54e1a9['yellow'](_0x478d18(0x191)+_0x1e7c7c+'\x0a')),_0x481317['skippedCount']>0x0&&console[_0x478d18(0x1a1)](a26_0x54e1a9[_0x478d18(0x1bc)]('('+_0x481317['skippedCount']+_0x478d18(0x1a8))),0x0;for(const _0xcb2b41 of _0x598c22){if(!isValidationResult(_0xcb2b41)){_0x2907cc[_0x478d18(0x195)]&&console[_0x478d18(0x197)](a26_0x54e1a9[_0x478d18(0x1bc)]('-\x20'+_0xcb2b41[_0x478d18(0x1bd)]+_0x478d18(0x18a)+_0xcb2b41[_0x478d18(0x1b8)]+')'));continue;}const {relativePath:_0x3873b5,source:_0x5b35e0,result:_0x2c789f}=_0xcb2b41;if(_0x2c789f[_0x478d18(0x1b5)]&&_0x2c789f[_0x478d18(0x18c)][_0x478d18(0x194)]===0x0)_0x2907cc[_0x478d18(0x195)]&&console['log'](a26_0x54e1a9[_0x478d18(0x190)]('✔\x20'+_0x3873b5));else _0x2c789f[_0x478d18(0x1b5)]?(console[_0x478d18(0x197)](a26_0x54e1a9[_0x478d18(0x1ab)]('⚠\x20'+_0x3873b5+':\x20'+_0x2c789f['warnings'][_0x478d18(0x194)]+'\x20warning(s)')),console[_0x478d18(0x197)](formatValidationResult(_0x2c789f,_0x5b35e0,_0x3873b5))):(console[_0x478d18(0x197)](a26_0x54e1a9['red']('✖\x20'+_0x3873b5+':\x20'+_0x2c789f[_0x478d18(0x192)][_0x478d18(0x194)]+_0x478d18(0x1a7))),console[_0x478d18(0x197)](formatValidationResult(_0x2c789f,_0x5b35e0,_0x3873b5)));}return console[_0x478d18(0x197)](''),_0x481317[_0x478d18(0x1b9)]?(console['log'](a26_0x54e1a9[_0x478d18(0x1a9)](_0x478d18(0x189)+_0x481317['invalidCount']+_0x478d18(0x1ae)+_0x481317[_0x478d18(0x18f)]+_0x478d18(0x198))),_0x481317[_0x478d18(0x1af)]>0x0&&console['log'](a26_0x54e1a9[_0x478d18(0x1ab)](_0x481317[_0x478d18(0x1af)]+_0x478d18(0x1bf))),_0x481317['skippedCount']>0x0&&console[_0x478d18(0x197)](a26_0x54e1a9['dim'](_0x481317['skippedCount']+_0x478d18(0x1b1))),0x1):(console['log'](a26_0x54e1a9[_0x478d18(0x190)](_0x478d18(0x196)+_0x481317[_0x478d18(0x18f)]+_0x478d18(0x1b7))),_0x481317['warningCount']>0x0&&console[_0x478d18(0x197)](a26_0x54e1a9[_0x478d18(0x1ab)](_0x481317[_0x478d18(0x1af)]+_0x478d18(0x1bf))),_0x481317['skippedCount']>0x0&&console['log'](a26_0x54e1a9['dim'](_0x481317[_0x478d18(0x19e)]+_0x478d18(0x1b1))),0x0);}}
@@ -1 +1 @@
1
- const a27_0x43e345=a27_0x2d2c;(function(_0x2c854a,_0x33b3db){const _0x18c139=a27_0x2d2c,_0x3e8655=_0x2c854a();while(!![]){try{const _0x47457f=parseInt(_0x18c139(0x1a4))/0x1+-parseInt(_0x18c139(0x1be))/0x2+parseInt(_0x18c139(0x1a3))/0x3*(parseInt(_0x18c139(0x1db))/0x4)+-parseInt(_0x18c139(0x1bc))/0x5+parseInt(_0x18c139(0x1cb))/0x6*(-parseInt(_0x18c139(0x1ca))/0x7)+parseInt(_0x18c139(0x1c8))/0x8*(parseInt(_0x18c139(0x189))/0x9)+-parseInt(_0x18c139(0x1b0))/0xa*(-parseInt(_0x18c139(0x191))/0xb);if(_0x47457f===_0x33b3db)break;else _0x3e8655['push'](_0x3e8655['shift']());}catch(_0x1bfc1f){_0x3e8655['push'](_0x3e8655['shift']());}}}(a27_0x1e92,0x3069e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';function a27_0x2d2c(_0x3c7d54,_0x160acb){_0x3c7d54=_0x3c7d54-0x184;const _0x1e9207=a27_0x1e92();let _0x2d2c55=_0x1e9207[_0x3c7d54];return _0x2d2c55;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x4481ac from'chalk';function formatDuration(_0x20c435){const _0x10c64a=a27_0x2d2c;if(_0x20c435<0x3c)return _0x20c435+'s';if(_0x20c435<0xe10)return Math[_0x10c64a(0x186)](_0x20c435/0x3c)+'m\x20'+_0x20c435%0x3c+'s';const _0x239862=Math[_0x10c64a(0x186)](_0x20c435/0xe10),_0x5db3f3=Math[_0x10c64a(0x186)](_0x20c435%0xe10/0x3c);return _0x5db3f3>0x0?_0x239862+'h\x20'+_0x5db3f3+'m':_0x239862+'h';}function formatRelativeTime(_0xf97f53){const _0x15ecd8=a27_0x2d2c,_0x41389c=Date['now']()-_0xf97f53[_0x15ecd8(0x1a0)](),_0x467cdb=Math[_0x15ecd8(0x186)](Math['abs'](_0x41389c)/0x3e8);if(_0x467cdb<0x3c)return'just\x20now';const _0x170389=Math[_0x15ecd8(0x186)](_0x467cdb/0x3c);if(_0x170389<0x3c)return _0x170389+_0x15ecd8(0x19c);const _0x401d3b=Math[_0x15ecd8(0x186)](_0x170389/0x3c);if(_0x401d3b<0x18)return _0x401d3b+_0x15ecd8(0x1aa);const _0x59fc9d=Math[_0x15ecd8(0x186)](_0x401d3b/0x18);if(_0x59fc9d<0x1e)return _0x59fc9d+_0x15ecd8(0x1a5);return Math['floor'](_0x59fc9d/0x1e)+_0x15ecd8(0x19a);}export class JobListCommand extends BaseCommand{[a27_0x43e345(0x1c1)]=a27_0x43e345(0x1a2);[a27_0x43e345(0x1d6)]=a27_0x43e345(0x1a1);async['execute'](_0x46908f){const _0x37d205=a27_0x43e345,{options:_0x529b0a,tdx:_0x572901}=_0x46908f,_0x3e1dad=resolveLimit(_0x529b0a['limit'],DEFAULT_DISPLAY_LIMIT),_0x21dd4a=_0x529b0a[_0x37d205(0x1a7)];_0x529b0a['verbose']&&(console[_0x37d205(0x1b8)](_0x37d205(0x1a9)+_0x3e1dad+_0x37d205(0x1b5)),_0x21dd4a&&console[_0x37d205(0x1b8)](_0x37d205(0x199)+_0x21dd4a));const _0x2f9bf1=await withSpinner(_0x37d205(0x187),()=>_0x572901[_0x37d205(0x1a2)]['list']({'from':0x0,'to':_0x3e1dad-0x1,'status':_0x21dd4a}),{'verbose':_0x529b0a[_0x37d205(0x1c9)]}),_0x46109d=_0x2f9bf1[_0x37d205(0x1d1)];console[_0x37d205(0x1b8)](_0x37d205(0x1d3)+_0x46109d[_0x37d205(0x185)]+_0x37d205(0x1bb)+(_0x46109d[_0x37d205(0x185)]!==0x1?'s':''));const _0x4a9f34=_0x529b0a['site'];if(isStructuredFormat(_0x529b0a)){const _0x2a4781=_0x46109d['map'](_0x104e73=>{const _0x2995b7=_0x37d205;let _0x45e3ce;if(_0x104e73['start_at']&&_0x104e73[_0x2995b7(0x18f)]){const _0x1e2555=new Date(_0x104e73['start_at'])[_0x2995b7(0x1a0)](),_0x53441a=new Date(_0x104e73[_0x2995b7(0x18f)])[_0x2995b7(0x1a0)]();_0x45e3ce=Math['round']((_0x53441a-_0x1e2555)/0x3e8);}return{'job_id':_0x104e73[_0x2995b7(0x1ac)],'type':_0x104e73[_0x2995b7(0x1bd)]===_0x2995b7(0x1b1)?_0x2995b7(0x18e):_0x104e73[_0x2995b7(0x1bd)],'status':_0x104e73[_0x2995b7(0x1a7)],'user_name':_0x104e73[_0x2995b7(0x194)],'duration_sec':_0x45e3ce,'created_at':_0x104e73[_0x2995b7(0x1af)],'started_at':_0x104e73[_0x2995b7(0x18c)],'end_at':_0x104e73[_0x2995b7(0x18f)]};});await handleSDKOutput(_0x2a4781,_0x529b0a);}else for(const _0x56cda7 of _0x46109d){const _0x50f111=_0x56cda7['status']===_0x37d205(0x19d)?a27_0x4481ac['green']:_0x56cda7[_0x37d205(0x1a7)]===_0x37d205(0x1b8)?a27_0x4481ac[_0x37d205(0x1c5)]:a27_0x4481ac[_0x37d205(0x195)],_0x5a88d2=_0x50f111(_0x56cda7[_0x37d205(0x1a7)]),_0x3eb216=getJobUrl(_0x4a9f34,_0x56cda7[_0x37d205(0x1ac)]),_0x29b555=hyperlink(_0x56cda7[_0x37d205(0x1ac)],_0x3eb216),_0x13f602=a27_0x4481ac[_0x37d205(0x195)](_0x56cda7[_0x37d205(0x1bd)]==='presto'?'trino':_0x56cda7['type']),_0x2ee313=[];if(_0x56cda7['start_at']&&_0x56cda7[_0x37d205(0x18f)]){const _0x4cd6c4=Math[_0x37d205(0x1ae)]((new Date(_0x56cda7[_0x37d205(0x18f)])[_0x37d205(0x1a0)]()-new Date(_0x56cda7[_0x37d205(0x18c)])['getTime']())/0x3e8);_0x2ee313[_0x37d205(0x1b3)](formatDuration(_0x4cd6c4));}if(_0x56cda7[_0x37d205(0x18f)])_0x2ee313['push'](formatRelativeTime(new Date(_0x56cda7[_0x37d205(0x18f)])));else _0x56cda7[_0x37d205(0x18c)]&&_0x2ee313[_0x37d205(0x1b3)](formatRelativeTime(new Date(_0x56cda7[_0x37d205(0x18c)])));const _0x57de23=_0x2ee313[_0x37d205(0x185)]>0x0?a27_0x4481ac[_0x37d205(0x195)]('\x20'+_0x2ee313['join'](',\x20')):'';console[_0x37d205(0x1bf)]('⚡\x20'+_0x29b555+'\x20'+_0x13f602+'\x20'+_0x5a88d2+_0x57de23);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a27_0x43e345(0x19f);['description']=a27_0x43e345(0x1d4);[a27_0x43e345(0x1ce)](_0x24a212){const _0x4d813b=a27_0x43e345,_0x3bc3c8=_0x24a212[_0x4d813b(0x1a6)][0x0];if(!_0x3bc3c8)return _0x4d813b(0x1c4);return undefined;}async[a27_0x43e345(0x1d8)](_0x6b3431){const _0x249b34=a27_0x43e345,{options:_0x602122,args:_0x41a173,tdx:_0x1c3ca7}=_0x6b3431,_0x426fc6=_0x41a173[0x0],_0x269138=await withSpinner(_0x249b34(0x1b2),()=>_0x1c3ca7[_0x249b34(0x1a2)]['show'](_0x426fc6),{'verbose':_0x602122[_0x249b34(0x1c9)]}),_0x238047=_0x269138[_0x249b34(0x1d1)];let _0x4b6c43;if(_0x238047['start_at']&&_0x238047[_0x249b34(0x18f)]){const _0x34e6a7=new Date(_0x238047['start_at'])[_0x249b34(0x1a0)](),_0x4da16b=new Date(_0x238047[_0x249b34(0x18f)])[_0x249b34(0x1a0)]();_0x4b6c43=Math[_0x249b34(0x1ae)]((_0x4da16b-_0x34e6a7)/0x3e8);}const _0x5e10a1={'job_id':_0x238047['job_id'],'type':_0x238047[_0x249b34(0x1bd)],'status':_0x238047[_0x249b34(0x1a7)],..._0x238047['user_name']&&{'user_name':_0x238047[_0x249b34(0x194)]},..._0x4b6c43!==undefined&&{'duration_sec':_0x4b6c43},..._0x238047[_0x249b34(0x1af)]&&{'created_at':_0x238047[_0x249b34(0x1af)]},..._0x238047[_0x249b34(0x18c)]&&{'started_at':_0x238047['start_at']},..._0x238047[_0x249b34(0x18f)]&&{'end_at':_0x238047['end_at']},..._0x238047[_0x249b34(0x1c6)]&&{'database':_0x238047[_0x249b34(0x1c6)]},..._0x238047['priority']!==undefined&&{'priority':_0x238047[_0x249b34(0x18a)]},..._0x238047[_0x249b34(0x1d7)]&&{'url':_0x238047[_0x249b34(0x1d7)]},..._0x238047[_0x249b34(0x198)]&&{'query':_0x238047[_0x249b34(0x198)]},..._0x238047[_0x249b34(0x19b)]&&{'debug':_0x238047[_0x249b34(0x19b)]}};return await handleSingleObjectOutput(_0x5e10a1,_0x602122),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x43e345(0x1c1)]=a27_0x43e345(0x1cd);[a27_0x43e345(0x1d6)]=a27_0x43e345(0x1c0);['validate'](_0x265dd0){const _0x519636=a27_0x43e345,_0x3297cf=_0x265dd0[_0x519636(0x1a6)][0x0];if(!_0x3297cf)return _0x519636(0x184);return undefined;}async[a27_0x43e345(0x1d8)](_0x5986b1){const _0x12a19d=a27_0x43e345,{options:_0x2deb0f,args:_0x15cb2d,tdx:_0x489211}=_0x5986b1,_0x319541=_0x15cb2d[0x0];if(!_0x2deb0f[_0x12a19d(0x18d)]){const _0x584d79=await confirm(_0x12a19d(0x1c2)+_0x319541+'?');if(!_0x584d79)return console['error'](_0x12a19d(0x1cc)),0x0;}return await withSpinner(_0x12a19d(0x1d2),()=>_0x489211[_0x12a19d(0x1a2)]['kill'](_0x319541),{'verbose':_0x2deb0f[_0x12a19d(0x1c9)]}),console[_0x12a19d(0x1b8)](_0x12a19d(0x1d5)+_0x319541),console['error']('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x319541+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x43e345(0x1c1)]=a27_0x43e345(0x188);['description']='Submit\x20a\x20job';async[a27_0x43e345(0x1d8)](_0x26f7a0){const _0x52b7b1=a27_0x43e345,{options:_0x3406c5,args:_0x2b6b3a,tdx:_0x2b212a}=_0x26f7a0,_0xfccd5e=_0x3406c5[_0x52b7b1(0x1c3)]||_0x52b7b1(0x18e),_0x4da754=_0x3406c5[_0x52b7b1(0x1cf)],_0x365da6=_0x3406c5[_0x52b7b1(0x1c6)]||'information_schema',_0x27bb94=_0x3406c5[_0x52b7b1(0x19e)];if(_0xfccd5e!=='trino'&&_0xfccd5e!==_0x52b7b1(0x1ad))throw new SDKError(ErrorCode[_0x52b7b1(0x192)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x534b7b;if(_0x4da754){if(_0x2b6b3a[0x0])throw new SDKError(ErrorCode[_0x52b7b1(0x192)],_0x52b7b1(0x1ab));const _0x22cc3f=readSqlStatementsFromFile(_0x4da754);if(_0x22cc3f['length']===0x0)throw new SDKError(ErrorCode[_0x52b7b1(0x192)],_0x52b7b1(0x1ba));if(_0x22cc3f[_0x52b7b1(0x185)]>0x1)throw new SDKError(ErrorCode[_0x52b7b1(0x192)],_0x52b7b1(0x197));_0x534b7b=_0x22cc3f[0x0];}else{if(!_0x2b6b3a[0x0])throw new SDKError(ErrorCode[_0x52b7b1(0x192)],_0x52b7b1(0x1b9));_0x534b7b=_0x2b6b3a[0x0];}_0x3406c5[_0x52b7b1(0x1c9)]&&(console['error'](_0x52b7b1(0x1b6)+_0xfccd5e),console['error'](_0x52b7b1(0x190)+_0x365da6),console['error'](_0x52b7b1(0x193)+_0x534b7b['substring'](0x0,0x64)+(_0x534b7b[_0x52b7b1(0x185)]>0x64?'...':'')));const _0x1e4762=await withSpinner(_0x52b7b1(0x196),()=>_0x2b212a['jobs'][_0x52b7b1(0x1b4)](_0x365da6,_0x534b7b,_0xfccd5e,_0x27bb94),{'verbose':_0x3406c5[_0x52b7b1(0x1c9)]}),_0x14726d=_0x1e4762['data'];return console['error'](_0x52b7b1(0x1d9)),console[_0x52b7b1(0x1b8)]('\x20\x20Job\x20ID:\x20'+_0x14726d[_0x52b7b1(0x1ac)]),await handleSDKOutput([_0x14726d],_0x3406c5),0x0;}}function a27_0x1e92(){const _0x37af8e=['job:result','error','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','No\x20SQL\x20statements\x20found\x20in\x20file','\x20job','1329705BfzJGj','type','556420tNcdGp','log','Kill\x20a\x20job','name','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','jobType','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','red','database','Get\x20job\x20results','364808JqJtOW','verbose','4844NzTYSI','2172afVgUc','Cancelled','job:kill','validate','file','✔\x20Retrieved\x20','data','Submitting\x20kill\x20request...','✔\x20Found\x20','Show\x20job\x20details','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','description','url','execute','✔\x20Job\x20submitted','Getting\x20job\x20results...','11672fSaRFr','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','length','floor','Listing\x20jobs...','job:submit','9EAKrtH','priority','\x20row','start_at','yes','trino','end_at','Database:\x20','3047JUtrBz','INVALID_ARGUMENT','Query:\x20','user_name','dim','Submitting\x20job...','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','query','Status\x20filter:\x20','mo\x20ago','debug','m\x20ago','success','result','job:show','getTime','List\x20jobs','jobs','63FWpguf','109647KdHTgD','d\x20ago','args','status','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Limit:\x20','h\x20ago','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','job_id','hive','round','created_at','28030LQeibk','presto','Getting\x20job\x20details...','push','submit','\x20jobs','Job\x20type:\x20'];a27_0x1e92=function(){return _0x37af8e;};return a27_0x1e92();}export class JobResultCommand extends BaseCommand{['name']=a27_0x43e345(0x1b7);[a27_0x43e345(0x1d6)]=a27_0x43e345(0x1c7);[a27_0x43e345(0x1ce)](_0x6b857a){const _0x28350d=a27_0x43e345,_0x15eed1=_0x6b857a['args'][0x0];if(!_0x15eed1)return _0x28350d(0x1a8);return undefined;}async[a27_0x43e345(0x1d8)](_0x3df34b){const _0x3b54ac=a27_0x43e345,{options:_0x181fb6,args:_0x14bf6d,tdx:_0xa93758}=_0x3df34b,_0x1fdbbb=_0x14bf6d[0x0],_0x437bc6=await withSpinner(_0x3b54ac(0x1da),()=>_0xa93758['jobs'][_0x3b54ac(0x19e)](_0x1fdbbb),{'verbose':_0x181fb6[_0x3b54ac(0x1c9)]}),_0x541be9=_0x437bc6[_0x3b54ac(0x1d1)];return console[_0x3b54ac(0x1b8)](_0x3b54ac(0x1d0)+_0x541be9['length']+_0x3b54ac(0x18b)+(_0x541be9[_0x3b54ac(0x185)]!==0x1?'s':'')),await handleSDKOutput(_0x541be9,_0x181fb6),0x0;}}
1
+ const a27_0x3a1f23=a27_0x47cc;function a27_0x47cc(_0x54a56b,_0x16441c){_0x54a56b=_0x54a56b-0xb9;const _0x117792=a27_0x1177();let _0x47cc7d=_0x117792[_0x54a56b];return _0x47cc7d;}(function(_0x164be6,_0x444db6){const _0x4a5092=a27_0x47cc,_0x2c6763=_0x164be6();while(!![]){try{const _0x52f3b8=-parseInt(_0x4a5092(0xcd))/0x1*(parseInt(_0x4a5092(0xdd))/0x2)+-parseInt(_0x4a5092(0x104))/0x3*(-parseInt(_0x4a5092(0xe3))/0x4)+-parseInt(_0x4a5092(0xdf))/0x5+-parseInt(_0x4a5092(0xef))/0x6+parseInt(_0x4a5092(0xda))/0x7+-parseInt(_0x4a5092(0x109))/0x8+-parseInt(_0x4a5092(0xbd))/0x9*(-parseInt(_0x4a5092(0x105))/0xa);if(_0x52f3b8===_0x444db6)break;else _0x2c6763['push'](_0x2c6763['shift']());}catch(_0x8630d7){_0x2c6763['push'](_0x2c6763['shift']());}}}(a27_0x1177,0xf3a69));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x5be4ff from'chalk';function formatDuration(_0x17af83){const _0x10ccac=a27_0x47cc;if(_0x17af83<0x3c)return _0x17af83+'s';if(_0x17af83<0xe10)return Math['floor'](_0x17af83/0x3c)+'m\x20'+_0x17af83%0x3c+'s';const _0x533331=Math[_0x10ccac(0xc2)](_0x17af83/0xe10),_0xcdfef0=Math['floor'](_0x17af83%0xe10/0x3c);return _0xcdfef0>0x0?_0x533331+'h\x20'+_0xcdfef0+'m':_0x533331+'h';}function a27_0x1177(){const _0x4d8c50=['verbose','length','jobs','trino','success','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','3846VZUEXA','10rDtVDS','Query:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','end_at','12246928DOBMaQ','\x20job','file','\x20row','name','getTime','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Kill\x20a\x20job','information_schema','log','Getting\x20job\x20details...','Submitting\x20job...','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job:result','m\x20ago','Listing\x20jobs...','debug','41317407jogfRC','Limit:\x20','just\x20now','yes','abs','floor','Status\x20filter:\x20','round','✔\x20Job\x20submitted','job_id','args','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','site','\x20jobs','push','presto','3pQrEdL','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','user_name','list','priority','result','start_at','No\x20SQL\x20statements\x20found\x20in\x20file','Submit\x20a\x20job','show','status','validate','job:show','384776pTGquc','d\x20ago','green','87732IrnxIC','\x20\x20Job\x20ID:\x20','9795545BLCPif','kill','submit','database','1228WudlJa','query','error','Get\x20job\x20results','✔\x20Retrieved\x20','job:kill','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','description','now','Show\x20job\x20details','join','2518794FIeFJR','red','data','substring','execute','\x27\x20to\x20verify\x20the\x20job\x20status','List\x20jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Cancelled','dim','type','created_at','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','...','url'];a27_0x1177=function(){return _0x4d8c50;};return a27_0x1177();}function formatRelativeTime(_0x435c6f){const _0x35cd88=a27_0x47cc,_0x8ab0de=Date[_0x35cd88(0xec)]()-_0x435c6f['getTime'](),_0x12721c=Math['floor'](Math[_0x35cd88(0xc1)](_0x8ab0de)/0x3e8);if(_0x12721c<0x3c)return _0x35cd88(0xbf);const _0x1be853=Math['floor'](_0x12721c/0x3c);if(_0x1be853<0x3c)return _0x1be853+_0x35cd88(0xba);const _0x2acdcb=Math[_0x35cd88(0xc2)](_0x1be853/0x3c);if(_0x2acdcb<0x18)return _0x2acdcb+'h\x20ago';const _0x4c5901=Math[_0x35cd88(0xc2)](_0x2acdcb/0x18);if(_0x4c5901<0x1e)return _0x4c5901+_0x35cd88(0xdb);return Math['floor'](_0x4c5901/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0x100);['description']=a27_0x3a1f23(0xf5);async['execute'](_0x484fca){const _0x579016=a27_0x3a1f23,{options:_0x559115,tdx:_0x5982cf}=_0x484fca,_0x118958=resolveLimit(_0x559115['limit'],DEFAULT_DISPLAY_LIMIT),_0x57b4bc=_0x559115[_0x579016(0xd7)];_0x559115['verbose']&&(console['error'](_0x579016(0xbe)+_0x118958+_0x579016(0xca)),_0x57b4bc&&console['error'](_0x579016(0xc3)+_0x57b4bc));const _0x21ad68=await withSpinner(_0x579016(0xbb),()=>_0x5982cf[_0x579016(0x100)][_0x579016(0xd0)]({'from':0x0,'to':_0x118958-0x1,'status':_0x57b4bc}),{'verbose':_0x559115[_0x579016(0xfe)]}),_0x29f6b2=_0x21ad68['data'];console[_0x579016(0xe5)]('✔\x20Found\x20'+_0x29f6b2[_0x579016(0xff)]+_0x579016(0x10a)+(_0x29f6b2['length']!==0x1?'s':''));const _0x266017=_0x559115[_0x579016(0xc9)];if(isStructuredFormat(_0x559115)){const _0x3f2be9=_0x29f6b2['map'](_0x443ba2=>{const _0x236ead=_0x579016;let _0x56aa51;if(_0x443ba2[_0x236ead(0xd3)]&&_0x443ba2[_0x236ead(0x108)]){const _0x3673c9=new Date(_0x443ba2[_0x236ead(0xd3)])[_0x236ead(0x10e)](),_0x45d5e9=new Date(_0x443ba2[_0x236ead(0x108)])[_0x236ead(0x10e)]();_0x56aa51=Math[_0x236ead(0xc4)]((_0x45d5e9-_0x3673c9)/0x3e8);}return{'job_id':_0x443ba2[_0x236ead(0xc6)],'type':_0x443ba2['type']==='presto'?_0x236ead(0x101):_0x443ba2[_0x236ead(0xf9)],'status':_0x443ba2['status'],'user_name':_0x443ba2[_0x236ead(0xcf)],'duration_sec':_0x56aa51,'created_at':_0x443ba2[_0x236ead(0xfa)],'started_at':_0x443ba2[_0x236ead(0xd3)],'end_at':_0x443ba2[_0x236ead(0x108)]};});await handleSDKOutput(_0x3f2be9,_0x559115);}else for(const _0x49f548 of _0x29f6b2){const _0x33a558=_0x49f548[_0x579016(0xd7)]===_0x579016(0x102)?a27_0x5be4ff[_0x579016(0xdc)]:_0x49f548[_0x579016(0xd7)]===_0x579016(0xe5)?a27_0x5be4ff[_0x579016(0xf0)]:a27_0x5be4ff['dim'],_0x3d32c3=_0x33a558(_0x49f548[_0x579016(0xd7)]),_0x104837=getJobUrl(_0x266017,_0x49f548['job_id']),_0x14afbf=hyperlink(_0x49f548[_0x579016(0xc6)],_0x104837),_0x1c43ac=a27_0x5be4ff[_0x579016(0xf8)](_0x49f548[_0x579016(0xf9)]===_0x579016(0xcc)?_0x579016(0x101):_0x49f548[_0x579016(0xf9)]),_0x4cb8b4=[];if(_0x49f548['start_at']&&_0x49f548[_0x579016(0x108)]){const _0x2015a3=Math[_0x579016(0xc4)]((new Date(_0x49f548['end_at'])[_0x579016(0x10e)]()-new Date(_0x49f548[_0x579016(0xd3)])[_0x579016(0x10e)]())/0x3e8);_0x4cb8b4[_0x579016(0xcb)](formatDuration(_0x2015a3));}if(_0x49f548[_0x579016(0x108)])_0x4cb8b4['push'](formatRelativeTime(new Date(_0x49f548[_0x579016(0x108)])));else _0x49f548['start_at']&&_0x4cb8b4['push'](formatRelativeTime(new Date(_0x49f548[_0x579016(0xd3)])));const _0x261911=_0x4cb8b4[_0x579016(0xff)]>0x0?a27_0x5be4ff['dim']('\x20'+_0x4cb8b4[_0x579016(0xee)](',\x20')):'';console[_0x579016(0x112)]('⚡\x20'+_0x14afbf+'\x20'+_0x1c43ac+'\x20'+_0x3d32c3+_0x261911);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0xd9);[a27_0x3a1f23(0xeb)]=a27_0x3a1f23(0xed);[a27_0x3a1f23(0xd8)](_0x52417){const _0x34c942=a27_0x3a1f23,_0x47ecaf=_0x52417[_0x34c942(0xc7)][0x0];if(!_0x47ecaf)return _0x34c942(0xea);return undefined;}async[a27_0x3a1f23(0xf3)](_0x2f7027){const _0x4eda61=a27_0x3a1f23,{options:_0x26818e,args:_0x5ec631,tdx:_0x17b7c2}=_0x2f7027,_0x51d9c2=_0x5ec631[0x0],_0x35fb0a=await withSpinner(_0x4eda61(0x113),()=>_0x17b7c2[_0x4eda61(0x100)][_0x4eda61(0xd6)](_0x51d9c2),{'verbose':_0x26818e[_0x4eda61(0xfe)]}),_0x17f393=_0x35fb0a['data'];let _0x4308a0;if(_0x17f393[_0x4eda61(0xd3)]&&_0x17f393[_0x4eda61(0x108)]){const _0x5079bf=new Date(_0x17f393[_0x4eda61(0xd3)])['getTime'](),_0x2104e3=new Date(_0x17f393[_0x4eda61(0x108)])[_0x4eda61(0x10e)]();_0x4308a0=Math[_0x4eda61(0xc4)]((_0x2104e3-_0x5079bf)/0x3e8);}const _0x3bf383={'job_id':_0x17f393[_0x4eda61(0xc6)],'type':_0x17f393['type'],'status':_0x17f393[_0x4eda61(0xd7)],..._0x17f393[_0x4eda61(0xcf)]&&{'user_name':_0x17f393[_0x4eda61(0xcf)]},..._0x4308a0!==undefined&&{'duration_sec':_0x4308a0},..._0x17f393[_0x4eda61(0xfa)]&&{'created_at':_0x17f393['created_at']},..._0x17f393['start_at']&&{'started_at':_0x17f393['start_at']},..._0x17f393[_0x4eda61(0x108)]&&{'end_at':_0x17f393['end_at']},..._0x17f393['database']&&{'database':_0x17f393[_0x4eda61(0xe2)]},..._0x17f393[_0x4eda61(0xd1)]!==undefined&&{'priority':_0x17f393[_0x4eda61(0xd1)]},..._0x17f393[_0x4eda61(0xfd)]&&{'url':_0x17f393[_0x4eda61(0xfd)]},..._0x17f393[_0x4eda61(0xe4)]&&{'query':_0x17f393[_0x4eda61(0xe4)]},..._0x17f393[_0x4eda61(0xbc)]&&{'debug':_0x17f393[_0x4eda61(0xbc)]}};return await handleSingleObjectOutput(_0x3bf383,_0x26818e),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0xe8);[a27_0x3a1f23(0xeb)]=a27_0x3a1f23(0x110);[a27_0x3a1f23(0xd8)](_0x36ab59){const _0x2cc145=a27_0x3a1f23,_0x4721e=_0x36ab59['args'][0x0];if(!_0x4721e)return _0x2cc145(0xf6);return undefined;}async[a27_0x3a1f23(0xf3)](_0xe3d9b7){const _0x2f0589=a27_0x3a1f23,{options:_0x2c906b,args:_0xd63c38,tdx:_0x2b1bad}=_0xe3d9b7,_0x455889=_0xd63c38[0x0];if(!_0x2c906b[_0x2f0589(0xc0)]){const _0x3b4bd7=await confirm(_0x2f0589(0xfb)+_0x455889+'?');if(!_0x3b4bd7)return console['error'](_0x2f0589(0xf7)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x2b1bad[_0x2f0589(0x100)][_0x2f0589(0xe0)](_0x455889),{'verbose':_0x2c906b[_0x2f0589(0xfe)]}),console[_0x2f0589(0xe5)](_0x2f0589(0xc8)+_0x455889),console['error'](_0x2f0589(0x103)+_0x455889+_0x2f0589(0xf4)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]='job:submit';['description']=a27_0x3a1f23(0xd5);async[a27_0x3a1f23(0xf3)](_0x31d990){const _0x3a231f=a27_0x3a1f23,{options:_0x36b158,args:_0x2a5ee2,tdx:_0x5ce0fb}=_0x31d990,_0x6616cc=_0x36b158['jobType']||_0x3a231f(0x101),_0x215163=_0x36b158[_0x3a231f(0x10b)],_0x9930e5=_0x36b158[_0x3a231f(0xe2)]||_0x3a231f(0x111),_0x40e440=_0x36b158[_0x3a231f(0xd2)];if(_0x6616cc!=='trino'&&_0x6616cc!=='hive')throw new SDKError(ErrorCode[_0x3a231f(0xe9)],_0x3a231f(0x10f));let _0x89b8a;if(_0x215163){if(_0x2a5ee2[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3a231f(0xce));const _0x38c7fa=readSqlStatementsFromFile(_0x215163);if(_0x38c7fa[_0x3a231f(0xff)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3a231f(0xd4));if(_0x38c7fa['length']>0x1)throw new SDKError(ErrorCode[_0x3a231f(0xe9)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x89b8a=_0x38c7fa[0x0];}else{if(!_0x2a5ee2[0x0])throw new SDKError(ErrorCode[_0x3a231f(0xe9)],_0x3a231f(0x115));_0x89b8a=_0x2a5ee2[0x0];}_0x36b158[_0x3a231f(0xfe)]&&(console[_0x3a231f(0xe5)]('Job\x20type:\x20'+_0x6616cc),console[_0x3a231f(0xe5)]('Database:\x20'+_0x9930e5),console['error'](_0x3a231f(0x106)+_0x89b8a[_0x3a231f(0xf2)](0x0,0x64)+(_0x89b8a['length']>0x64?_0x3a231f(0xfc):'')));const _0x2ad675=await withSpinner(_0x3a231f(0x114),()=>_0x5ce0fb[_0x3a231f(0x100)][_0x3a231f(0xe1)](_0x9930e5,_0x89b8a,_0x6616cc,_0x40e440),{'verbose':_0x36b158['verbose']}),_0x3bd794=_0x2ad675[_0x3a231f(0xf1)];return console[_0x3a231f(0xe5)](_0x3a231f(0xc5)),console[_0x3a231f(0xe5)](_0x3a231f(0xde)+_0x3bd794[_0x3a231f(0xc6)]),await handleSDKOutput([_0x3bd794],_0x36b158),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0xb9);[a27_0x3a1f23(0xeb)]=a27_0x3a1f23(0xe6);['validate'](_0x35095d){const _0x12e5db=a27_0x3a1f23,_0x1b94de=_0x35095d[_0x12e5db(0xc7)][0x0];if(!_0x1b94de)return _0x12e5db(0x107);return undefined;}async[a27_0x3a1f23(0xf3)](_0x248bb2){const _0x556be8=a27_0x3a1f23,{options:_0x2b6b38,args:_0x1eb123,tdx:_0x563ae7}=_0x248bb2,_0xa7cfe3=_0x1eb123[0x0],_0x464dfa=await withSpinner('Getting\x20job\x20results...',()=>_0x563ae7[_0x556be8(0x100)][_0x556be8(0xd2)](_0xa7cfe3),{'verbose':_0x2b6b38[_0x556be8(0xfe)]}),_0x48981d=_0x464dfa[_0x556be8(0xf1)];return console[_0x556be8(0xe5)](_0x556be8(0xe7)+_0x48981d[_0x556be8(0xff)]+_0x556be8(0x10c)+(_0x48981d[_0x556be8(0xff)]!==0x1?'s':'')),await handleSDKOutput(_0x48981d,_0x2b6b38),0x0;}}
@@ -1 +1 @@
1
- const a28_0x19c35c=a28_0x4a8b;function a28_0x4e20(){const _0x12ea31=['add','bold','Getting\x20version\x20','Getting\x20column\x20mapping...','repeat','1718130tyXvxs','Database:\x20','📁\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','test','pause','conversion','completeMilestoneRate','\x22\x20not\x20found','no_parent','Parent\x20segment:\x20','\x20journey','exitOrJumpRate','goalSize','folderPath','table','history','blue','hasPeriod','Error:\x20Parent\x20segment\x20context\x20required','Error:\x20Journey\x20\x27','881391ksztmS','format','Pausing\x20journey...','absolutePath','...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','(paused)','type','push','createdAt','Error:\x20Invalid\x20version\x20number:\x20','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20\x20Statistics\x20not\x20available','(draft)','yes','/j/da','activation_','Available\x20stages:\x20','stageNameMap','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','activation','\x20(rule\x20match)','\x20versions)','toLowerCase','all','includeHistory','🗺️\x20','\x5c$&','journey:push','listVersions','(running)','98396WSHfmf','map','user','stage','then','session','\x27\x20not\x20found\x20in\x20','kind','List\x20activations\x20for\x20a\x20journey','segmentPushCommand','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','/e/','rootFolderId','links','Resolving\x20journey...','size','root\x20folder','\x20\x20Folder\x20path:\x20','No\x20statistics\x20available\x20for\x20journey:\x20','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Listing\x20journey\x20activations...','5346xizisX','journeyBundleId','✔\x20Context\x20set:\x20','cyan','state','Fetching\x20users\x20and\x20connections...','\x20(ID:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','reentryMode','Fetching\x20parent\x20segment...','length','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','message','relativePath','hasChanges','localeCompare','getTrafficData','journey','Error:\x20Invalid\x20--type\x20\x22','tdx.json','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Target\x20file:\x20','Creating\x20new\x20version...','data','segments','✔\x20Journey\x20\x22','options','journeyBundleName','enteredSize','(root)','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Table:\x20','Options:','join','json','journeyStages','journeyName','575901bfeHQq','\x22\x20paused','Error:\x20Stage\x20\x22','\x20not\x20found.\x20Available:\x20','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','listJourneysWithFolders','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','resolveJourneyId','Resolved\x20YAML\x20file:\x20','resolveSegment','Listing\x20journeys...','entries','Show\x20journey\x20table\x20column\x20mapping','description','execute','Resume\x20a\x20paused\x20journey','base','stringify','(archived)','jsonl','verbose','\x20activation','\x20changed\x20files','version','Write\x20','limit','Resolving\x20parent\x20segment...','buildIdToNameMap','\x20=\x20','\x20Opening\x20','Folder\x20path:\x20','15WbXfrC','file','journey:stats','-\x20no\x20files\x20written','set','from','journey:version:create','.yml','375FfSiIu','✔\x20Pulled\x20','cwd','folderId','Fetching\x20journeys\x20and\x20folders...','getJourney','List\x20all\x20versions\x20of\x20a\x20journey','stages','INVALID_ARGUMENT','Getting\x20journey\x20traffic\x20data...','journeyId','4497328wQbRJv','filter','dryRun','journey:pause','10ALrHGO','✔\x20Found\x20','\x20->\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey',',\x20version:\x20','Getting\x20journey\x20statistics...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','columns','replace','database','connection','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','completed','\x20Created\x20v','goal','listJourneysFromParentSegment','site','journey:version:view','segment','paused','parent_segment','targetDir','error','getActivation','completionRate','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Journey\x20ID:\x20','Input:\x20','No\x20journeys\x20found','find','\x20details...','Show\x20journey\x20statistics','parentSegment','getColumnMapping','green','Pause\x20a\x20running\x20journey','buildIdToEmailMap','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getStatistics','get','resourceName','attributes','Fetching\x20','\x20new\x20files','\x0aError:','content','\x20files?','draft','args','launched','\x20unchanged\x20files','8rMagdW','isNew','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','journey:activations','getParentFull','\x20\x20Parent\x20segment:\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20version','exitOrJumpSize','journey:pull','\x20(draft)\x20—\x20\x22','dim','has','Resolving\x20version...','web','sort','updatedAt','values','\x20\x20-\x20','filePath','renderStats','listActivationsFlat','51199zfZhNY','nodes','Error:\x20Version\x20','tsv','/j/da/je','rule','Cancelled','name','yellow','utf-8','\x20\x20Target:\x20','connector_config','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','log','\x20\x20Name:\x20','split','versionNumber','journey:view','Found\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','journey:traffic'];a28_0x4e20=function(){return _0x12ea31;};return a28_0x4e20();}(function(_0x1fceae,_0x1726f8){const _0x26a7e1=a28_0x4a8b,_0xc50cd2=_0x1fceae();while(!![]){try{const _0x1b7810=-parseInt(_0x26a7e1(0x16c))/0x1*(-parseInt(_0x26a7e1(0x122))/0x2)+parseInt(_0x26a7e1(0x10b))/0x3*(parseInt(_0x26a7e1(0x1be))/0x4)+parseInt(_0x26a7e1(0x113))/0x5*(parseInt(_0x26a7e1(0x1d3))/0x6)+parseInt(_0x26a7e1(0x19c))/0x7*(-parseInt(_0x26a7e1(0x156))/0x8)+parseInt(_0x26a7e1(0xec))/0x9+parseInt(_0x26a7e1(0x186))/0xa+-parseInt(_0x26a7e1(0x11e))/0xb;if(_0x1b7810===_0x1726f8)break;else _0xc50cd2['push'](_0xc50cd2['shift']());}catch(_0x5e7477){_0xc50cd2['push'](_0xc50cd2['shift']());}}}(a28_0x4e20,0x23da8));import a28_0x420ea5 from'chalk';import a28_0x21de12 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';function a28_0x4a8b(_0x300638,_0x22d7d3){_0x300638=_0x300638-0xe5;const _0x4e20bc=a28_0x4e20();let _0x4a8b45=_0x4e20bc[_0x300638];return _0x4a8b45;}import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x13149f){const _0x245791=a28_0x4a8b;return!_0x13149f&&(console['error'](_0x245791(0x12d)),console[_0x245791(0x138)](_0x245791(0xf0))),!!_0x13149f;}function withJsonFormat(_0x15a6c0){const _0x414251=a28_0x4a8b;if(!_0x15a6c0[_0x414251(0x19d)]&&!_0x15a6c0[_0x414251(0xe9)]&&!_0x15a6c0[_0x414251(0xff)]&&!_0x15a6c0[_0x414251(0x16f)])return{..._0x15a6c0,'format':_0x414251(0xe9),'json':!![]};return _0x15a6c0;}function formatJourneyState(_0x512ff0){const _0xbb9e35=a28_0x4a8b;switch(_0x512ff0){case _0xbb9e35(0x154):return a28_0x420ea5[_0xbb9e35(0x145)](_0xbb9e35(0x1bd));case _0xbb9e35(0x152):return a28_0x420ea5['dim'](_0xbb9e35(0x1ac));case _0xbb9e35(0x135):return a28_0x420ea5[_0xbb9e35(0x174)](_0xbb9e35(0x1a4));case _0xbb9e35(0x12e):return a28_0x420ea5[_0xbb9e35(0x198)]('(completed)');case'archived':return a28_0x420ea5[_0xbb9e35(0x161)](_0xbb9e35(0xfe));default:return'('+_0x512ff0+')';}}function formatJourneyItem(_0x2053f4,_0x4bf770='',_0x54f862){const _0x40908d=a28_0x4a8b,_0x3a7477=formatJourneyState(_0x2053f4['state']),_0x2494f6=_0x54f862?hyperlink(_0x2053f4[_0x40908d(0x1ee)],_0x54f862):_0x2053f4[_0x40908d(0x1ee)];return _0x4bf770+_0x40908d(0x1b9)+_0x2494f6+'\x20'+_0x3a7477;}function escapeRegex(_0x4f2aaf){const _0x362907=a28_0x4a8b;return _0x4f2aaf[_0x362907(0x12a)](/[.*+?^${}()|[\]\\]/g,_0x362907(0x1ba));}function globToRegex(_0x14a46e){const _0x4ef8b2=a28_0x4a8b,_0x5ca649=_0x14a46e[_0x4ef8b2(0x17b)]('*')['map'](escapeRegex);return new RegExp(_0x5ca649[_0x4ef8b2(0xe8)]('.*'),'i');}function buildRuleToNameMapping(_0x9e2599){const _0x521e80=a28_0x4a8b,_0x3fe5d0=new Map();if(_0x9e2599[_0x521e80(0x1eb)])for(const [_0x1549da,_0x4320fc]of Object[_0x521e80(0xf7)](_0x9e2599['segments'])){if(_0x4320fc['rule']){const _0x32922e=serializeRule(_0x4320fc[_0x521e80(0x171)]),_0x2861a4=_0x3fe5d0[_0x521e80(0x14a)](_0x32922e);_0x2861a4?_0x2861a4[_0x521e80(0x1a6)](_0x1549da):_0x3fe5d0[_0x521e80(0x10f)](_0x32922e,[_0x1549da]);}}return _0x3fe5d0;}async function resolveJourneyIdFromInput(_0xf13106,_0x2b43d8,_0x3940a9){const _0x30fee9=a28_0x4a8b,_0xb9b066=await resolveJourneyTarget(_0xf13106,_0x2b43d8[_0x30fee9(0x143)],_0x2b43d8['verbose']),_0x4d27c2=_0xb9b066[_0x30fee9(0x143)];if(!_0x4d27c2)throw new SDKError(ErrorCode[_0x30fee9(0x11b)],_0x30fee9(0x1e7));const _0x2c52ef=await withSpinner(_0x30fee9(0x106),()=>_0x3940a9[_0x30fee9(0x134)][_0x30fee9(0x1a9)](_0x4d27c2),{'verbose':_0x2b43d8['verbose']}),_0x4cf691=_0x2c52ef['data'],_0x1405dd=await withSpinner(_0x30fee9(0x1cc),()=>_0x3940a9['journey'][_0x30fee9(0xf3)](_0x4cf691,_0xb9b066[_0x30fee9(0xeb)]),{'verbose':_0x2b43d8[_0x30fee9(0x100)]});return{'journeyId':_0x1405dd[_0x30fee9(0x1ea)],'journeyName':_0xb9b066['journeyName'],'parentSegmentId':_0x4cf691};}async function resolveJourneyTarget(_0x27aa80,_0x56f861,_0x246556){const _0x67c5fd=a28_0x4a8b;if(isYamlFilePath(_0x27aa80))try{const _0x3ee7d2=await resolveYamlFilePath(_0x27aa80);return _0x246556&&(console['error'](_0x67c5fd(0xf4)+_0x27aa80),console[_0x67c5fd(0x138)](_0x67c5fd(0x15b)+_0x3ee7d2[_0x67c5fd(0x143)]),console['error'](_0x67c5fd(0x17a)+_0x3ee7d2['segmentName']),console[_0x67c5fd(0x138)](_0x67c5fd(0x1cf)+(_0x3ee7d2[_0x67c5fd(0x195)]||_0x67c5fd(0x1f0)))),{'journeyName':_0x3ee7d2['segmentName'],'parentSegment':_0x3ee7d2['parentSegment'],'resolved':_0x3ee7d2};}catch(_0x17a69a){throw new SDKError(ErrorCode[_0x67c5fd(0x11b)],_0x67c5fd(0x178)+_0x17a69a[_0x67c5fd(0x1df)]);}if(!_0x56f861)throw new SDKError(ErrorCode[_0x67c5fd(0x11b)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x27aa80,'parentSegment':_0x56f861};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a28_0x19c35c(0xf9)]='List\x20journeys\x20in\x20current\x20context';async[a28_0x19c35c(0xfa)](_0xbddb77){const _0x334b71=a28_0x19c35c,{options:_0x33800e,args:_0x49ee04,tdx:_0x2afa0e}=_0xbddb77,_0x620c6a=_0x49ee04[0x0],_0x5d5685=_0x33800e[_0x334b71(0x143)];if(!_0x5d5685)return console['error'](_0x334b71(0x19a)),console[_0x334b71(0x138)](_0x334b71(0x128)),0x1;const _0x556456=await withSpinner(_0x334b71(0x106),()=>_0x2afa0e[_0x334b71(0x134)][_0x334b71(0x1a9)](_0x5d5685),{'verbose':_0x33800e[_0x334b71(0x100)]}),_0x3963b9=_0x556456[_0x334b71(0x1ea)];_0x33800e['verbose']&&(console[_0x334b71(0x138)]('Parent\x20segment:\x20'+_0x5d5685+_0x334b71(0x1d9)+_0x3963b9+')'),_0x620c6a&&console[_0x334b71(0x138)]('Pattern:\x20'+_0x620c6a));const _0x28b966=await withSpinner(_0x334b71(0x1dc),()=>_0x2afa0e['segment'][_0x334b71(0x15a)](_0x3963b9),{'verbose':_0x33800e['verbose']}),_0x11ccc8=_0x28b966['data'],_0x24fea2=_0x11ccc8[_0x334b71(0x1ca)],_0x1e4d83=await withSpinner(_0x334b71(0xf6),()=>_0x2afa0e[_0x334b71(0x1e4)][_0x334b71(0xf1)](_0x3963b9,_0x24fea2),{'verbose':_0x33800e[_0x334b71(0x100)]});let _0x52f726=_0x1e4d83[_0x334b71(0x1ea)]['journeys'];const _0x61f83=_0x1e4d83[_0x334b71(0x1ea)]['folders'],_0x591d42=new Map();for(const _0x128511 of _0x61f83){_0x591d42[_0x334b71(0x10f)](_0x128511['id'],_0x128511[_0x334b71(0x173)]);}if(_0x620c6a){const _0xbfdf4a=globToRegex(_0x620c6a);_0x52f726=_0x52f726['filter'](_0x35ce79=>_0xbfdf4a[_0x334b71(0x18b)](_0x35ce79[_0x334b71(0x1ee)]));}console['error'](_0x334b71(0x123)+_0x52f726[_0x334b71(0x1dd)]+_0x334b71(0x192)+(_0x52f726[_0x334b71(0x1dd)]!==0x1?'s':''));const _0x4c4172=_0x4ae2a6=>{const _0x4d8c87=_0x334b71;return getConsoleNextUrl(_0x33800e['site'],'/app/ps/'+_0x3963b9+_0x4d8c87(0x1c9)+_0x4ae2a6+_0x4d8c87(0x1ae));};if(_0x33800e['format']==='table')await handleSDKOutput(_0x52f726,_0x33800e);else{if(_0x33800e[_0x334b71(0x19d)]===_0x334b71(0xe9)){const _0x2db9b1=_0x52f726[_0x334b71(0x1bf)](_0x2bcca8=>({..._0x2bcca8,'url':_0x4c4172(_0x2bcca8['id'])}));await handleSDKOutput(_0x2db9b1,_0x33800e);}else{console['log']('['+_0x5d5685+']');const _0x1f60e4=new Map(),_0x6ffb8a=[];for(const _0x325e1d of _0x52f726){if(!_0x325e1d['folderId']||_0x325e1d[_0x334b71(0x116)]===_0x24fea2)_0x6ffb8a['push'](_0x325e1d);else{const _0x25f51d=_0x1f60e4['get'](_0x325e1d[_0x334b71(0x116)])||[];_0x25f51d[_0x334b71(0x1a6)](_0x325e1d),_0x1f60e4[_0x334b71(0x10f)](_0x325e1d[_0x334b71(0x116)],_0x25f51d);}}const _0x5a23b8=(_0x1d382c,_0x4b318f)=>_0x1d382c[_0x334b71(0x1ee)][_0x334b71(0x1e2)](_0x4b318f[_0x334b71(0x1ee)],undefined,{'sensitivity':_0x334b71(0xfc)});_0x6ffb8a['sort'](_0x5a23b8);for(const _0x5f5a40 of _0x6ffb8a){console[_0x334b71(0x179)](formatJourneyItem(_0x5f5a40,'',_0x4c4172(_0x5f5a40['id'])));}const _0x3c3546=[..._0x1f60e4[_0x334b71(0xf7)]()][_0x334b71(0x165)]((_0x1819c7,_0x1fecbe)=>{const _0xb83403=_0x334b71,_0x20f893=_0x591d42[_0xb83403(0x14a)](_0x1819c7[0x0])||_0x1819c7[0x0],_0x56cdf8=_0x591d42[_0xb83403(0x14a)](_0x1fecbe[0x0])||_0x1fecbe[0x0];return _0x20f893[_0xb83403(0x1e2)](_0x56cdf8,undefined,{'sensitivity':'base'});});for(const [_0x277726,_0x175725]of _0x3c3546){const _0x423152=_0x591d42[_0x334b71(0x14a)](_0x277726)||_0x277726;console[_0x334b71(0x179)](_0x334b71(0x188)+_0x423152),_0x175725[_0x334b71(0x165)](_0x5a23b8);for(const _0x331b2f of _0x175725){console[_0x334b71(0x179)](formatJourneyItem(_0x331b2f,'\x20\x20',_0x4c4172(_0x331b2f['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x17d);[a28_0x19c35c(0xf9)]='Show\x20journey\x20details';async[a28_0x19c35c(0xfa)](_0x5ee974){const _0x277dbb=a28_0x19c35c,{options:_0x260f16,args:_0x3ac48d,tdx:_0xed1e84}=_0x5ee974,_0x7b15a1=_0x3ac48d[0x0];if(!_0x7b15a1)return console[_0x277dbb(0x138)](_0x277dbb(0x12d)),console[_0x277dbb(0x138)](_0x277dbb(0x189)),console[_0x277dbb(0x138)](_0x277dbb(0xe7)),console['error'](_0x277dbb(0x1de)),0x1;_0x260f16[_0x277dbb(0x100)]&&console[_0x277dbb(0x138)]('Input:\x20'+_0x7b15a1);const {journeyId:_0x3abda9,parentSegmentId:_0x1e541c}=await resolveJourneyIdFromInput(_0x7b15a1,_0x260f16,_0xed1e84);if(_0x260f16[_0x277dbb(0x164)]){const _0x4dd083=getConsoleNextUrl(_0x260f16['site'],'/app/ps/'+_0x1e541c+'/e/'+_0x3abda9+'/j/da/je');return console[_0x277dbb(0x138)](a28_0x420ea5[_0x277dbb(0x145)]('✔')+_0x277dbb(0x109)+a28_0x420ea5[_0x277dbb(0x1d6)](_0x4dd083)),openBrowser(_0x4dd083),0x0;}const _0x1c750e=await withSpinner('Getting\x20journey\x20details...',()=>_0xed1e84[_0x277dbb(0x1e4)][_0x277dbb(0x118)](_0x3abda9),{'verbose':_0x260f16[_0x277dbb(0x100)]}),_0x5b0fef=_0x1c750e['data'],_0x1cac81=_0x260f16['includeStats'];let _0x43d018;if(_0x1cac81)try{const _0x332947=await withSpinner('Getting\x20journey\x20statistics...',()=>_0xed1e84[_0x277dbb(0x1e4)][_0x277dbb(0x149)](_0x3abda9),{'verbose':_0x260f16[_0x277dbb(0x100)]});_0x43d018=_0x332947[_0x277dbb(0x1ea)];}catch{_0x260f16[_0x277dbb(0x100)]&&console[_0x277dbb(0x138)](_0x277dbb(0x1ab));}const _0x56555d=getConsoleNextUrl(_0x260f16['site'],'/app/ps/'+_0x1e541c+_0x277dbb(0x1c9)+_0x3abda9+_0x277dbb(0x170)),_0x1d3581={'id':_0x5b0fef['id'],'name':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0x173)],'description':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0xf9)],'state':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0x1d7)],'paused':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0x135)],'reentry_mode':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0x1db)],'stages':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0xea)]?.[_0x277dbb(0x1dd)]||0x0,..._0x5b0fef['attributes']['goal']&&{'goal':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0x130)]['name']},..._0x43d018&&{'statistics':{'size':_0x43d018['size'],'entered':_0x43d018[_0x277dbb(0x1ef)],'goal_achieved':_0x43d018[_0x277dbb(0x194)],'completion_rate':_0x43d018[_0x277dbb(0x13a)],'exit_or_jump':_0x43d018['exitOrJumpSize'],'exit_or_jump_rate':_0x43d018['exitOrJumpRate'],'stages':_0x43d018['stages']}},'url':_0x56555d};return await handleSingleObjectOutput(_0x1d3581,_0x260f16),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x10d);[a28_0x19c35c(0xf9)]=a28_0x19c35c(0x142);async[a28_0x19c35c(0xfa)](_0x545d9c){const _0x327bd9=a28_0x19c35c,{options:_0x211815,args:_0x4897ee,tdx:_0x43d083}=_0x545d9c,_0x58ba95=_0x4897ee[0x0];if(!requireNameOrPath(_0x58ba95))return 0x1;_0x211815[_0x327bd9(0x100)]&&console[_0x327bd9(0x138)]('Input:\x20'+_0x58ba95);const _0x3edc91=_0x211815,_0x33cd64=_0x3edc91[_0x327bd9(0x110)],_0x261cdf=_0x3edc91['to'],_0x5c6c6c=_0x3edc91['includeHistory'],_0x28ea28=_0x3edc91[_0x327bd9(0x1c1)];_0x5c6c6c&&!_0x33cd64&&!_0x261cdf&&console[_0x327bd9(0x138)](_0x327bd9(0x1a3));const _0x5c4784=_0x5c6c6c?withJsonFormat(_0x211815):_0x211815,{journeyId:_0xea1ad7,journeyName:_0x2b40a8}=await resolveJourneyIdFromInput(_0x58ba95,_0x5c4784,_0x43d083),_0x4c7e40=_0x33cd64||_0x261cdf?{'from':_0x33cd64,'to':_0x261cdf}:undefined,_0x3831d5=await withSpinner(_0x327bd9(0x127),()=>Promise[_0x327bd9(0x1b7)]([_0x43d083['journey'][_0x327bd9(0x118)](_0xea1ad7),_0x43d083[_0x327bd9(0x1e4)]['getStatistics'](_0xea1ad7,_0x4c7e40)]),{'verbose':_0x5c4784[_0x327bd9(0x100)]}),[_0x43e3b4,_0x84e96c]=_0x3831d5[_0x327bd9(0x1ea)];if(!_0x84e96c||_0x84e96c['journeyId']===null)return console[_0x327bd9(0x138)](_0x327bd9(0x1d0)+_0x2b40a8),console[_0x327bd9(0x138)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x3354f0=buildStageNameMap(_0x43e3b4),_0x12fabf=!!(_0x4c7e40&&_0x84e96c[_0x327bd9(0x197)]?.['length']),_0x191b99={'stageNameMap':_0x3354f0,'hasPeriod':_0x12fabf,'includeHistory':!!_0x5c6c6c};if(_0x28ea28&&_0x84e96c[_0x327bd9(0x11a)]){const _0x5496f4=_0x84e96c['stages']['find'](_0x4ec259=>{const _0x1ac49c=_0x327bd9,_0x187e88=_0x3354f0['get'](_0x4ec259['id'])??'';return _0x187e88[_0x1ac49c(0x1b6)]()===_0x28ea28[_0x1ac49c(0x1b6)]();});if(_0x5496f4)return await handleSingleObjectOutput(formatStageStats(_0x5496f4,_0x191b99),_0x5c4784),0x0;const _0x1eecb2=_0x84e96c[_0x327bd9(0x11a)][_0x327bd9(0x1bf)](_0x676c80=>_0x3354f0[_0x327bd9(0x14a)](_0x676c80['id'])??_0x676c80['id']);return console[_0x327bd9(0x138)](_0x327bd9(0xee)+_0x28ea28+_0x327bd9(0x18f)),console[_0x327bd9(0x138)](_0x327bd9(0x1b0)+_0x1eecb2[_0x327bd9(0xe8)](',\x20')),0x1;}const _0x2749cf=_0x84e96c[_0x327bd9(0x11a)]?.['map'](_0x348f44=>formatStageStats(_0x348f44,_0x191b99)),_0x1defde=assembleJourneyStats(_0x84e96c,{'from':_0x33cd64,'to':_0x261cdf,'includeHistory':_0x5c6c6c});return await this[_0x327bd9(0x16a)](_0x1defde,_0x2749cf??[],_0x5c4784),0x0;}async[a28_0x19c35c(0x16a)](_0xe8553f,_0x12f900,_0x57980d){const _0x46181d=a28_0x19c35c,_0x4dbaac=_0x57980d[_0x46181d(0x19d)]===_0x46181d(0xe9)||_0x57980d[_0x46181d(0x19d)]===_0x46181d(0xff)||_0x57980d[_0x46181d(0xe9)]||_0x57980d[_0x46181d(0xff)];if(_0x4dbaac){_0xe8553f[_0x46181d(0x11a)]=_0x12f900,await handleSingleObjectOutput(_0xe8553f,_0x57980d);return;}await handleSingleObjectOutput(_0xe8553f,_0x57980d);for(const _0x446141 of _0x12f900){console[_0x46181d(0x179)](''),console['log'](String(a28_0x420ea5[_0x46181d(0x1d6)][_0x46181d(0x182)]('['+_0x446141[_0x46181d(0x173)]+']'))+a28_0x420ea5[_0x46181d(0x161)]('\x20'+_0x446141['id']));const {id:_0xec8181,name:_0x5ed70b,..._0xbe8a59}=_0x446141;await handleSingleObjectOutput(_0xbe8a59,_0x57980d);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x180);['description']=a28_0x19c35c(0x17f);async[a28_0x19c35c(0xfa)](_0x3bd377){const _0xff7b06=a28_0x19c35c,{options:_0x384b4b,args:_0x4e9370,tdx:_0x183cf0}=_0x3bd377,_0x27f40f=_0x4e9370[0x0];if(!requireNameOrPath(_0x27f40f))return 0x1;_0x384b4b[_0xff7b06(0x100)]&&console['error'](_0xff7b06(0x13e)+_0x27f40f);const _0x4c6784=_0x384b4b,_0xff5c93=_0x4c6784[_0xff7b06(0x1a5)],_0x23c646=_0x4c6784[_0xff7b06(0x110)],_0x58f0f6=_0x4c6784['to'],_0x52863d=_0x4c6784[_0xff7b06(0x105)];if(_0xff5c93&&_0xff5c93!==_0xff7b06(0x18d)&&_0xff5c93!==_0xff7b06(0x1b3))return console[_0xff7b06(0x138)](_0xff7b06(0x1e5)+_0xff5c93+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x38eb0e=withJsonFormat(_0x384b4b),{journeyId:_0x20ed81,journeyName:_0x549d89}=await resolveJourneyIdFromInput(_0x27f40f,_0x38eb0e,_0x183cf0),_0x358f09={'type':_0xff5c93,'from':_0x23c646,'to':_0x58f0f6,'limit':_0x52863d},_0x9a45a=await withSpinner(_0xff7b06(0x11c),()=>_0x183cf0[_0xff7b06(0x1e4)][_0xff7b06(0x1e3)](_0x20ed81,_0x358f09),{'verbose':_0x38eb0e[_0xff7b06(0x100)]}),_0x5d7095=_0x9a45a[_0xff7b06(0x1ea)],_0x36e5bc=_0x5d7095['conversion']&&(_0x5d7095[_0xff7b06(0x18d)][_0xff7b06(0x16d)]['length']>0x0||_0x5d7095[_0xff7b06(0x18d)][_0xff7b06(0x1cb)]['length']>0x0),_0x2735a6=_0x5d7095['activation']&&_0x5d7095[_0xff7b06(0x1b3)][_0xff7b06(0x1dd)]>0x0;if(!_0x36e5bc&&!_0x2735a6)return console[_0xff7b06(0x138)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x549d89),console[_0xff7b06(0x138)](_0xff7b06(0x15c)),_0x23c646&&_0x58f0f6&&console[_0xff7b06(0x138)](_0xff7b06(0x1a1)),0x0;return await handleSingleObjectOutput(_0x5d7095,_0x38eb0e),0x0;}}function formatStageStats(_0x5015e4,_0x542558){const _0x6c6e61=a28_0x19c35c,_0xd0d59b=_0x542558[_0x6c6e61(0x199)]&&_0x5015e4['history']?.[_0x6c6e61(0x1dd)]?aggregateStageHistory(_0x5015e4[_0x6c6e61(0x197)]):{'size':_0x5015e4[_0x6c6e61(0x1cd)],'entered':_0x5015e4['enteredSize'],'milestone':_0x5015e4['milestoneSize'],'milestone_rate':_0x5015e4[_0x6c6e61(0x18e)],'exit_or_jump':_0x5015e4[_0x6c6e61(0x15e)],'exit_or_jump_rate':_0x5015e4[_0x6c6e61(0x193)]},_0x6354e7={'id':_0x5015e4['id'],'name':_0x542558[_0x6c6e61(0x1b1)][_0x6c6e61(0x14a)](_0x5015e4['id'])??_0x5015e4['id'],..._0xd0d59b};return _0x542558['hasPeriod']&&_0x542558[_0x6c6e61(0x1b8)]&&_0x5015e4[_0x6c6e61(0x197)]&&(_0x6354e7[_0x6c6e61(0x197)]=_0x5015e4[_0x6c6e61(0x197)]),_0x6354e7;}export class JourneyPauseCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x121);[a28_0x19c35c(0xf9)]=a28_0x19c35c(0x146);async['execute'](_0x5c8e31){const _0x23e393=a28_0x19c35c,{options:_0x40cb58,args:_0x2798ca,tdx:_0x5bee65}=_0x5c8e31,_0x3d605d=_0x2798ca[0x0];if(!requireNameOrPath(_0x3d605d))return 0x1;_0x40cb58[_0x23e393(0x100)]&&console[_0x23e393(0x138)](_0x23e393(0x13e)+_0x3d605d);const {journeyId:_0x15c0c8,journeyName:_0x1b3fd2}=await resolveJourneyIdFromInput(_0x3d605d,_0x40cb58,_0x5bee65);if(!_0x40cb58[_0x23e393(0x1ad)]){const _0x5b3cb1=await confirm(_0x23e393(0x1c8)+_0x1b3fd2+'\x22?');if(!_0x5b3cb1)return console[_0x23e393(0x138)](_0x23e393(0x172)),0x0;}const _0x37facd=await withSpinner(_0x23e393(0x19e),()=>_0x5bee65[_0x23e393(0x1e4)][_0x23e393(0x18c)](_0x15c0c8),{'verbose':_0x40cb58[_0x23e393(0x100)]}),_0x1f2ca9=_0x37facd[_0x23e393(0x1ea)];return console[_0x23e393(0x138)](_0x23e393(0x1ec)+_0x1f2ca9[_0x23e393(0x14c)][_0x23e393(0x173)]+_0x23e393(0xed)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x19c35c(0x173)]='journey:resume';[a28_0x19c35c(0xf9)]=a28_0x19c35c(0xfb);async[a28_0x19c35c(0xfa)](_0x45793d){const _0x19d163=a28_0x19c35c,{options:_0xee6042,args:_0x512e27,tdx:_0x26568c}=_0x45793d,_0x1ca654=_0x512e27[0x0];if(!requireNameOrPath(_0x1ca654))return 0x1;_0xee6042[_0x19d163(0x100)]&&console[_0x19d163(0x138)]('Input:\x20'+_0x1ca654);const {journeyId:_0x387b23,journeyName:_0x4f7b95}=await resolveJourneyIdFromInput(_0x1ca654,_0xee6042,_0x26568c);if(!_0xee6042[_0x19d163(0x1ad)]){const _0xab4d3d=await confirm(_0x19d163(0x158)+_0x4f7b95+'\x22?');if(!_0xab4d3d)return console[_0x19d163(0x138)](_0x19d163(0x172)),0x0;}const _0x731844=await withSpinner('Resuming\x20journey...',()=>_0x26568c[_0x19d163(0x1e4)]['resume'](_0x387b23),{'verbose':_0xee6042[_0x19d163(0x100)]}),_0x1cc784=_0x731844['data'];return console[_0x19d163(0x138)]('✔\x20Journey\x20\x22'+_0x1cc784['attributes'][_0x19d163(0x173)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x15f);[a28_0x19c35c(0xf9)]=a28_0x19c35c(0x1da);async[a28_0x19c35c(0xfa)](_0x2d8b06){const _0x556839=a28_0x19c35c,{options:_0x235c4e,args:_0x26c7cd,tdx:_0x2fa5da}=_0x2d8b06,_0x4b1bfa=_0x235c4e,_0x1a5a43=_0x26c7cd[0x0],_0x1fee96=_0x1a5a43&&isYamlFilePath(_0x1a5a43),_0xcd82ee=await resolveTarget({'arg':_0x1fee96?_0x1a5a43:undefined,'contextParent':_0x235c4e[_0x556839(0x143)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xcd82ee))return _0xcd82ee['errorCode']===_0x556839(0x190)?(console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x174)](_0x556839(0x13c))),console[_0x556839(0x138)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x556839(0x138)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x556839(0x1aa)),console[_0x556839(0x138)](_0x556839(0xf2))):(console[_0x556839(0x138)](a28_0x420ea5['red']('Error:\x20'+_0xcd82ee[_0x556839(0x1df)]+'\x0a')),_0xcd82ee['helpText']&&console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x1d6)](_0xcd82ee['helpText']))),0x1;let _0x4a7f5c=_0x1fee96?undefined:_0x1a5a43,_0x59dbfb,_0x3f66ac;_0xcd82ee[_0x556839(0x1a5)]==='file'&&(_0x4a7f5c=_0xcd82ee[_0x556839(0x14b)],_0x59dbfb=_0xcd82ee[_0x556839(0x169)],_0x3f66ac=_0xcd82ee[_0x556839(0x195)]);const _0x83de8b=_0xcd82ee['parentName'],_0x4d0585=_0xcd82ee[_0x556839(0x137)];_0x4b1bfa[_0x556839(0x100)]&&(console['error'](_0x556839(0x191)+_0x83de8b),console[_0x556839(0x138)]('Target\x20directory:\x20'+_0x4d0585),_0x4a7f5c&&console[_0x556839(0x138)]('Journey\x20name:\x20'+_0x4a7f5c),_0x59dbfb&&console['error'](_0x556839(0x1e8)+_0x59dbfb),_0x3f66ac&&console['error'](_0x556839(0x10a)+_0x3f66ac));const _0xa50a88=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2fa5da[_0x556839(0x134)][_0x556839(0x1a9)](_0x83de8b),{'verbose':_0x235c4e[_0x556839(0x100)]}),_0x1e2efe=_0xa50a88[_0x556839(0x1ea)],{journeys:_0xdd565b,folders:_0x413a10}=await withSpinner(_0x556839(0x117),async()=>{const _0x1d569d=_0x556839,[_0x4645e4,_0x5bca2a]=await Promise[_0x1d569d(0x1b7)]([_0x2fa5da[_0x1d569d(0x1e4)][_0x1d569d(0x131)](_0x1e2efe,undefined,{'includeAllVersions':!![]}),_0x2fa5da[_0x1d569d(0x134)]['listFolders'](_0x1e2efe)]);return{'journeys':_0x4645e4,'folders':_0x5bca2a};},{'verbose':_0x235c4e[_0x556839(0x100)]})[_0x556839(0x1c2)](_0x55d2c8=>_0x55d2c8[_0x556839(0x1ea)]);let _0x56f4e3=_0xdd565b;const _0xcdc3b8=buildFolderIdToPathMap(_0x413a10);if(_0x4a7f5c){const _0x2848f8=_0x56f4e3[_0x556839(0x11f)](_0xf2253d=>_0xf2253d[_0x556839(0x1ee)][_0x556839(0x1b6)]()===_0x4a7f5c[_0x556839(0x1b6)]());if(_0x2848f8['length']===0x0)return console[_0x556839(0x138)]('Error:\x20Journey\x20not\x20found:\x20'+_0x4a7f5c),console[_0x556839(0x138)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x56f4e3=_0x2848f8;}if(_0x3f66ac!==undefined){const _0x5cd35a=_0x56f4e3['filter'](_0x51dd07=>{const _0x35a63b=_0x556839,_0x5e0594=_0x51dd07['folderId']?_0xcdc3b8[_0x35a63b(0x14a)](_0x51dd07['folderId'])||'':'';return _0x5e0594===_0x3f66ac;});if(_0x5cd35a[_0x556839(0x1dd)]===0x0&&_0x56f4e3['length']>0x0){console['error'](_0x556839(0x19b)+_0x4a7f5c+_0x556839(0x1c4)+(_0x3f66ac||_0x556839(0x1ce))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x5df909 of _0x56f4e3){const _0x360b9c=_0x5df909[_0x556839(0x116)]?_0xcdc3b8['get'](_0x5df909[_0x556839(0x116)])||'':'';console['error'](_0x556839(0x168)+(_0x360b9c||_0x556839(0x1f0))+'/'+_0x5df909[_0x556839(0x1ee)]);}return 0x1;}_0x56f4e3=_0x5cd35a;}if(_0x56f4e3[_0x556839(0x1dd)]===0x0)return console[_0x556839(0x138)](_0x556839(0x13f)),0x0;const _0x27ab89=new Map();for(const _0x4b306e of _0x56f4e3){const _0x3940c1=_0x4b306e[_0x556839(0x1d4)];!_0x27ab89[_0x556839(0x162)](_0x3940c1)&&_0x27ab89[_0x556839(0x10f)](_0x3940c1,[]),_0x27ab89['get'](_0x3940c1)[_0x556839(0x1a6)](_0x4b306e);}for(const _0x4a8f32 of _0x27ab89[_0x556839(0x167)]()){_0x4a8f32['sort']((_0x3b3c05,_0x2729d1)=>(_0x3b3c05[_0x556839(0x17c)]||0x0)-(_0x2729d1[_0x556839(0x17c)]||0x0));}const _0x45127d=[],{idToEmailMap:_0xfd805a,connectionIdToNameMap:_0x3abbd1}=await withSpinner(_0x556839(0x1d8),async()=>{const _0x45523a=_0x556839,[_0x1a9bbc,_0x377597]=await Promise[_0x45523a(0x1b7)]([_0x2fa5da[_0x45523a(0x1c0)][_0x45523a(0x147)](),_0x2fa5da[_0x45523a(0x12c)][_0x45523a(0x107)]()]);return{'idToEmailMap':_0x1a9bbc,'connectionIdToNameMap':_0x377597};},{'verbose':_0x235c4e[_0x556839(0x100)]})[_0x556839(0x1c2)](_0xb72bff=>_0xb72bff[_0x556839(0x1ea)]);for(const _0x1790d1 of _0x27ab89[_0x556839(0x167)]()){const _0x53d061=_0x1790d1[0x0][_0x556839(0x1ee)],_0x489730=_0x1790d1[0x0]['folderId'],_0x5d1aec=_0x489730?_0xcdc3b8['get'](_0x489730)||'':'',_0x224dc8=_0x5d1aec?a28_0x21de12[_0x556839(0xe8)](_0x4d0585,_0x5d1aec):_0x4d0585,_0x3a8b17=_0x59dbfb||a28_0x21de12[_0x556839(0xe8)](_0x224dc8,sanitizeFileName(_0x53d061)+_0x556839(0x112));let _0xa66147,_0x2dbbdf;if(existsSync(_0x3a8b17))try{const _0x17a76e=readFileSync(_0x3a8b17,_0x556839(0x175)),_0x5efebc=parseYamlString(_0x17a76e);_0x2dbbdf=_0x5efebc,_0xa66147=buildRuleToNameMapping(_0x5efebc),_0x4b1bfa[_0x556839(0x100)]&&_0xa66147[_0x556839(0x1cd)]>0x0&&console['error'](_0x556839(0x17e)+_0xa66147[_0x556839(0x1cd)]+_0x556839(0x18a)+_0x53d061);}catch(_0x28ffe7){_0x4b1bfa[_0x556839(0x100)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x28ffe7[_0x556839(0x1df)]);}const _0x583f4f=[],_0x1216f0=new Set(),_0x566ea9=new Map(),_0x3d59ba=new Map(),_0x20074f=new Set(),_0x55033b=new Map(),_0x45f4fc=new Map(),_0x283081=createJumpTargetCache();await withProgressSpinner(_0x556839(0x14d)+_0x53d061+_0x556839(0x1a0),async _0x3f0c63=>{const _0x29d087=_0x556839;for(const _0x38ce39 of _0x1790d1){const _0x252ee4=_0x1790d1[_0x29d087(0x1dd)]>0x1?_0x38ce39['journeyBundleName']+'\x20v'+(_0x38ce39['versionNumber']||0x1):_0x38ce39[_0x29d087(0x1ee)];_0x3f0c63['setPhase'](_0x29d087(0x14d)+_0x252ee4);const _0x3d42be=await _0x2fa5da[_0x29d087(0x1e4)][_0x29d087(0x118)](_0x38ce39['id']),_0x307675=_0x3d42be[_0x29d087(0x14c)]?.['audienceId'],_0x1d6dcf={'resolveSegment':async _0x2aa555=>{const _0x4e4221=_0x29d087;if(!_0x307675)return{'name':_0x2aa555,'isJourneyLocal':![]};const _0x482279=_0x566ea9[_0x4e4221(0x14a)](_0x2aa555);if(_0x482279)return _0x482279;try{const _0x24ad7b=await _0x2fa5da[_0x4e4221(0x134)]['getSegment'](_0x307675,_0x2aa555),_0x2b1330=_0x24ad7b[_0x4e4221(0x1c5)]===SEGMENT_KIND_JOURNEY;let _0x274590,_0x2426a9=_0x24ad7b[_0x4e4221(0x173)];if(_0x2b1330&&_0x24ad7b[_0x4e4221(0x171)]){const _0x5825ca=await segmentResponseToDef(_0x24ad7b,{'resolveSegmentName':async _0xd2940c=>{const _0x45cbfc=_0x4e4221,_0x452770=_0x566ea9[_0x45cbfc(0x14a)](_0xd2940c);if(_0x452770)return _0x452770[_0x45cbfc(0x173)];const _0x1b9ef0=await _0x1d6dcf[_0x45cbfc(0xf5)](_0xd2940c);return _0x1b9ef0[_0x45cbfc(0x173)];}}),_0x3453f5=_0x5825ca['rule'];_0x274590={'description':_0x24ad7b['description'],'rule':_0x3453f5};const _0x8654=serializeRule(_0x3453f5),_0x324ab4=_0x3d59ba[_0x4e4221(0x14a)](_0x8654);if(_0x324ab4)_0x2426a9=_0x324ab4,_0x274590=undefined,_0x4b1bfa[_0x4e4221(0x100)]&&console[_0x4e4221(0x138)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x24ad7b[_0x4e4221(0x173)]+_0x4e4221(0x124)+_0x324ab4);else{let _0x21a955=![];if(_0xa66147){const _0x495c65=_0xa66147[_0x4e4221(0x14a)](_0x8654);if(_0x495c65){const _0x1939e2=_0x495c65[_0x4e4221(0x140)](_0xa82143=>!_0x1216f0[_0x4e4221(0x162)](_0xa82143));_0x1939e2&&(_0x2426a9=_0x1939e2,_0x1216f0[_0x4e4221(0x181)](_0x1939e2),_0x3d59ba[_0x4e4221(0x10f)](_0x8654,_0x1939e2),_0x21a955=!![],_0x4b1bfa[_0x4e4221(0x100)]&&console[_0x4e4221(0x138)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x1939e2+_0x4e4221(0x1b4)));}}if(!_0x21a955){const _0x1751f1=generateJourneyLocalName(_0x24ad7b[_0x4e4221(0x173)]);_0x1751f1&&(_0x2426a9=_0x1751f1);let _0x5279eb=_0x2426a9,_0x42c6db=0x2;while(_0x1216f0['has'](_0x5279eb)){_0x5279eb=_0x2426a9+'_'+_0x42c6db,_0x42c6db++;}_0x1216f0[_0x4e4221(0x181)](_0x5279eb),_0x3d59ba['set'](_0x8654,_0x5279eb),_0x2426a9=_0x5279eb;}}}const _0x3b8dda={'name':_0x2426a9,'isJourneyLocal':_0x2b1330,'definition':_0x274590};return _0x566ea9[_0x4e4221(0x10f)](_0x2aa555,_0x3b8dda),_0x3b8dda;}catch(_0x5672d2){return _0x235c4e[_0x4e4221(0x100)]&&console[_0x4e4221(0x138)](_0x4e4221(0x1d1)+_0x2aa555+':\x20'+_0x5672d2[_0x4e4221(0x1df)]),{'name':_0x2aa555,'isJourneyLocal':![]};}},'resolveActivation':async _0x5519c2=>{const _0x41b686=_0x29d087,_0x20e503=_0x55033b[_0x41b686(0x14a)](_0x5519c2);if(_0x20e503)return _0x20e503;try{const _0x512bdc=await _0x2fa5da['journey'][_0x41b686(0x139)](_0x38ce39['id'],_0x5519c2),_0x7bea0e=journeyActivationStepToYaml(_0x512bdc,_0xfd805a,_0x3abbd1),_0x2f8132=JSON[_0x41b686(0xfd)]({'name':_0x7bea0e['name'],'connection':_0x7bea0e[_0x41b686(0x12c)],'connector_config':_0x7bea0e[_0x41b686(0x177)]}),_0x456baa=_0x45f4fc[_0x41b686(0x14a)](_0x2f8132);if(_0x456baa){const _0x2c20b4={'name':_0x456baa,'isJourneyLocal':!![],'definition':_0x7bea0e};return _0x55033b['set'](_0x5519c2,_0x2c20b4),_0x2c20b4;}const _0x1dd971=_0x512bdc[_0x41b686(0x14c)]['activationParams'][_0x41b686(0x173)]||_0x5519c2,_0x592adb=sanitizeYamlKey(_0x1dd971)||_0x41b686(0x1af)+_0x5519c2;let _0x5057b7=_0x592adb,_0x74645a=0x2;while(_0x20074f[_0x41b686(0x162)](_0x5057b7)){_0x5057b7=_0x592adb+'_'+_0x74645a,_0x74645a++;}_0x20074f[_0x41b686(0x181)](_0x5057b7),_0x45f4fc[_0x41b686(0x10f)](_0x2f8132,_0x5057b7);const _0x50919f={'name':_0x5057b7,'isJourneyLocal':!![],'definition':_0x7bea0e};return _0x55033b['set'](_0x5519c2,_0x50919f),_0x50919f;}catch(_0x37a7da){return _0x235c4e['verbose']&&console[_0x41b686(0x138)](_0x41b686(0xe5)+_0x5519c2+':\x20'+_0x37a7da[_0x41b686(0x1df)]),{'name':_0x5519c2,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x17089b,_0x2e620a)=>{const _0x427b4f=_0x29d087;return resolveJumpTarget(_0x17089b,_0x2e620a,_0x283081,_0x5ca7a3=>_0x2fa5da[_0x427b4f(0x1e4)][_0x427b4f(0x118)](_0x5ca7a3));}},_0x58b208=await journeyResponseToDef(_0x3d42be,_0x1d6dcf);_0x583f4f['push']({'item':_0x38ce39,'yaml':_0x58b208});}},{'verbose':_0x235c4e['verbose']});const _0x300823=await _0x2fa5da[_0x556839(0x1e4)]['getLatestJourneyId'](_0x1790d1[0x0]['journeyBundleId']),_0x10b655=buildMergedJourneyDef(_0x583f4f,_0xa66147,_0x300823),_0x42d814=normalizeJourneyDef(_0x10b655,_0x2dbbdf),_0x28e26e=toYamlString(_0x42d814),_0x42edff=_0x59dbfb||a28_0x21de12[_0x556839(0xe8)](_0x224dc8,sanitizeFileName(_0x53d061)+_0x556839(0x112));!_0x59dbfb&&_0x5d1aec&&!existsSync(_0x224dc8)&&mkdirSync(_0x224dc8,{'recursive':!![]});const _0x377062=a28_0x21de12['relative'](process[_0x556839(0x115)](),_0x42edff);if(existsSync(_0x42edff)){const _0x12e71d=readFileSync(_0x42edff,'utf-8'),_0x445b79=generateDiff(_0x12e71d,_0x28e26e),_0x9307a=hasChanges(_0x445b79);_0x45127d[_0x556839(0x1a6)]({'relativePath':_0x377062,'absolutePath':_0x42edff,'content':_0x28e26e,'isNew':![],'hasChanges':_0x9307a,'diff':_0x9307a?formatDiffWithColors(_0x445b79):undefined});}else _0x45127d[_0x556839(0x1a6)]({'relativePath':_0x377062,'absolutePath':_0x42edff,'content':_0x28e26e,'isNew':!![],'hasChanges':![]});}const _0x29d443=_0x45127d[_0x556839(0x11f)](_0x1e001f=>_0x1e001f[_0x556839(0x157)]),_0x5b4223=_0x45127d[_0x556839(0x11f)](_0x2ed84b=>!_0x2ed84b[_0x556839(0x157)]&&_0x2ed84b['hasChanges']),_0x4b2420=_0x45127d[_0x556839(0x11f)](_0x9d31e7=>!_0x9d31e7[_0x556839(0x157)]&&!_0x9d31e7[_0x556839(0x1e1)]),_0x578dd7=_0x56f4e3[_0x556839(0x1dd)],_0x518788=_0x27ab89[_0x556839(0x1cd)],_0xd75b4e=_0x578dd7>_0x518788?'\x20('+_0x578dd7+_0x556839(0x1b5):'';console[_0x556839(0x138)]('\x0aPull\x20summary:'),console[_0x556839(0x138)]('\x20\x20'+a28_0x420ea5[_0x556839(0x1d6)](_0x518788+'\x20journeys')+a28_0x420ea5[_0x556839(0x161)](_0xd75b4e)),console[_0x556839(0x138)]('\x20\x20'+a28_0x420ea5[_0x556839(0x145)]('+\x20'+_0x29d443[_0x556839(0x1dd)]+_0x556839(0x14e))),console[_0x556839(0x138)]('\x20\x20'+a28_0x420ea5[_0x556839(0x174)]('~\x20'+_0x5b4223[_0x556839(0x1dd)]+_0x556839(0x102))),console['error']('\x20\x20'+a28_0x420ea5[_0x556839(0x161)]('=\x20'+_0x4b2420['length']+_0x556839(0x155))),console['error'](_0x556839(0x176)+a28_0x420ea5[_0x556839(0x1d6)](_0x4d0585)+'\x0a');if(_0x5b4223[_0x556839(0x1dd)]>0x0)for(const _0x41b3ee of _0x5b4223){console[_0x556839(0x138)]('\x0aChanges\x20to\x20\x27'+_0x41b3ee[_0x556839(0x1e0)]+'\x27:'),console[_0x556839(0x138)]('─'['repeat'](0x3c)),console['error'](_0x41b3ee['diff']),console[_0x556839(0x138)]('─'[_0x556839(0x185)](0x3c));}if(_0x4b1bfa[_0x556839(0x120)])return console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x174)](_0x556839(0x13b))),0x0;if(_0x29d443['length']===0x0&&_0x5b4223['length']===0x0)return console['error'](a28_0x420ea5[_0x556839(0x145)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x83de8b},_0x4b1bfa[_0x556839(0x1c3)]),console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x145)](_0x556839(0x1d5)+a28_0x420ea5[_0x556839(0x161)](_0x556839(0x136))+_0x556839(0x108)+a28_0x420ea5['cyan'](_0x83de8b))),0x0;if(!_0x4b1bfa[_0x556839(0x1ad)]&&(_0x29d443[_0x556839(0x1dd)]>0x0||_0x5b4223[_0x556839(0x1dd)]>0x0)){if(!isInteractive())return console[_0x556839(0x138)](a28_0x420ea5['red'](_0x556839(0x14f)),_0x556839(0x1b2)),console['error'](a28_0x420ea5[_0x556839(0x161)](_0x556839(0x148))),0x1;const _0x5a054f=await confirmKey(_0x556839(0x104)+(_0x29d443['length']+_0x5b4223[_0x556839(0x1dd)])+_0x556839(0x151));if(!_0x5a054f)return console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x174)]('Aborted.'),_0x556839(0x10e)),0x1;}!existsSync(_0x4d0585)&&mkdirSync(_0x4d0585,{'recursive':!![]});const _0x3c8ecc=a28_0x21de12[_0x556839(0xe8)](_0x4d0585,_0x556839(0x1e6));writeFileSync(_0x3c8ecc,createTdxConfigContent(_0x83de8b),'utf-8');for(const _0x148126 of _0x45127d){(_0x148126[_0x556839(0x157)]||_0x148126[_0x556839(0x1e1)])&&writeFileSync(_0x148126[_0x556839(0x19f)],_0x148126[_0x556839(0x150)],_0x556839(0x175));}return console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x145)](_0x556839(0x114)+(_0x29d443[_0x556839(0x1dd)]+_0x5b4223[_0x556839(0x1dd)])+'\x20journey\x20files\x20to\x20'+_0x4d0585)),saveSessionContext({'parent_segment':_0x83de8b},_0x4b1bfa[_0x556839(0x1c3)]),console['error'](a28_0x420ea5[_0x556839(0x145)]('✔\x20Context\x20set:\x20'+a28_0x420ea5[_0x556839(0x161)](_0x556839(0x136))+_0x556839(0x108)+a28_0x420ea5[_0x556839(0x1d6)](_0x83de8b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x19c35c(0x173)]='journey:columns';[a28_0x19c35c(0xf9)]=a28_0x19c35c(0xf8);async[a28_0x19c35c(0xfa)](_0x519d0a){const _0x514cb7=a28_0x19c35c,{options:_0x202d20,args:_0x298668,tdx:_0x4ff602}=_0x519d0a,_0x212004=_0x298668[0x0];if(!requireNameOrPath(_0x212004))return 0x1;_0x202d20[_0x514cb7(0x100)]&&console[_0x514cb7(0x138)](_0x514cb7(0x13e)+_0x212004);const {journeyId:_0x3dfb92}=await resolveJourneyIdFromInput(_0x212004,_0x202d20,_0x4ff602),_0x7d951f=await withSpinner(_0x514cb7(0x184),()=>_0x4ff602['journey'][_0x514cb7(0x144)](_0x3dfb92),{'verbose':_0x202d20[_0x514cb7(0x100)]}),_0x31577c=_0x7d951f[_0x514cb7(0x1ea)];return console[_0x514cb7(0x179)](_0x514cb7(0x187)+_0x31577c[_0x514cb7(0x12b)]),console[_0x514cb7(0x179)](_0x514cb7(0xe6)+_0x31577c[_0x514cb7(0x196)]),await handleSDKOutput(_0x31577c[_0x514cb7(0x129)],_0x202d20),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x159);[a28_0x19c35c(0xf9)]=a28_0x19c35c(0x1c6);async[a28_0x19c35c(0xfa)](_0x2c83f7){const _0x3ea682=a28_0x19c35c,{options:_0x254fa1,args:_0x12649d,tdx:_0x409f87}=_0x2c83f7,_0x43ef2a=_0x12649d[0x0];if(!requireNameOrPath(_0x43ef2a))return 0x1;_0x254fa1[_0x3ea682(0x100)]&&console['error'](_0x3ea682(0x13e)+_0x43ef2a);const {journeyId:_0x2bd887}=await resolveJourneyIdFromInput(_0x43ef2a,_0x254fa1,_0x409f87),_0x3aa4e3=await withSpinner(_0x3ea682(0x1d2),()=>_0x409f87['journey'][_0x3ea682(0x16b)](_0x2bd887),{'verbose':_0x254fa1[_0x3ea682(0x100)]}),_0xd968cb=_0x3aa4e3[_0x3ea682(0x1ea)];return console['error'](_0x3ea682(0x17e)+_0xd968cb[_0x3ea682(0x1dd)]+_0x3ea682(0x101)+(_0xd968cb[_0x3ea682(0x1dd)]!==0x1?'s':'')),await handleSDKOutput(_0xd968cb,_0x254fa1),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a28_0x19c35c(0x1bb);[a28_0x19c35c(0xf9)]=a28_0x19c35c(0x1a2);[a28_0x19c35c(0x1c7)]=new SegmentPushCommand();async[a28_0x19c35c(0xfa)](_0x51ab03){const _0x28fdd2=a28_0x19c35c,_0x37b624=_0x51ab03[_0x28fdd2(0x153)][0x0];let _0x1a7686;if(_0x37b624){const _0x445ae7=await resolveTarget({'arg':_0x37b624,'contextParent':_0x51ab03[_0x28fdd2(0x1ed)]['parentSegment'],'cwd':process[_0x28fdd2(0x115)]()});isSuccessfulResolution(_0x445ae7)&&_0x445ae7[_0x28fdd2(0x1a5)]===_0x28fdd2(0x10c)&&(_0x1a7686=_0x445ae7[_0x28fdd2(0x169)]);}const _0x493d37={..._0x51ab03,'options':{..._0x51ab03['options'],'journeysOnly':!![],..._0x1a7686&&{'singleFilePath':_0x1a7686}}};return this[_0x28fdd2(0x1c7)][_0x28fdd2(0xfa)](_0x493d37);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x19c35c(0x173)]='journey:versions';['description']=a28_0x19c35c(0x119);async[a28_0x19c35c(0xfa)](_0x1eac2f){const _0x352c15=a28_0x19c35c,{options:_0x6a7a84,args:_0xb3b8ff,tdx:_0x5d0737}=_0x1eac2f,_0x3dabe9=_0xb3b8ff[0x0];if(!requireNameOrPath(_0x3dabe9))return 0x1;if(_0x6a7a84[_0x352c15(0x100)])console['error'](_0x352c15(0x13e)+_0x3dabe9);const {journeyId:_0x247bd8}=await resolveJourneyIdFromInput(_0x3dabe9,_0x6a7a84,_0x5d0737),_0x50614f=await withSpinner('Listing\x20journey\x20versions...',()=>_0x5d0737[_0x352c15(0x1e4)][_0x352c15(0x1bc)](_0x247bd8),{'verbose':_0x6a7a84[_0x352c15(0x100)]}),{bundleName:_0x212481,versions:_0x32f834,latestJourneyId:_0x25e9ff}=_0x50614f['data'];console[_0x352c15(0x138)](_0x212481+':\x20'+_0x32f834[_0x352c15(0x1dd)]+_0x352c15(0x15d)+(_0x32f834[_0x352c15(0x1dd)]!==0x1?'s':''));const _0x9a672c=_0x32f834['map'](_0x6d0b5f=>({'version':_0x6d0b5f['versionNumber'],'journey_id':_0x6d0b5f[_0x352c15(0x11d)],'name':_0x6d0b5f[_0x352c15(0x173)],'state':_0x6d0b5f[_0x352c15(0x1d7)],'paused':_0x6d0b5f['paused'],'latest':_0x6d0b5f['journeyId']===_0x25e9ff,'created_at':_0x6d0b5f[_0x352c15(0x1a7)]}));return await handleSDKOutput(_0x9a672c,_0x6a7a84),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x111);['description']=a28_0x19c35c(0x125);async['execute'](_0x1a7b16){const _0x32b666=a28_0x19c35c,{options:_0x32131c,args:_0x4764a9,tdx:_0xa21b9e}=_0x1a7b16,_0x51e6e4=_0x4764a9[0x0];if(!requireNameOrPath(_0x51e6e4))return 0x1;if(_0x32131c[_0x32b666(0x100)])console[_0x32b666(0x138)](_0x32b666(0x13e)+_0x51e6e4);const {journeyId:_0x1c28ca,journeyName:_0x29a8b3}=await resolveJourneyIdFromInput(_0x51e6e4,_0x32131c,_0xa21b9e);if(!_0x32131c[_0x32b666(0x1ad)]){const _0x20081e=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x29a8b3+'\x22?');if(!_0x20081e)return console['error']('Cancelled'),0x0;}const _0xfa76d0=await withSpinner(_0x32b666(0x1e9),()=>_0xa21b9e[_0x32b666(0x1e4)]['createVersion'](_0x1c28ca),{'verbose':_0x32131c[_0x32b666(0x100)]}),_0x4666fb=_0xfa76d0[_0x32b666(0x1ea)];return console[_0x32b666(0x138)](a28_0x420ea5[_0x32b666(0x145)]('✔')+_0x32b666(0x12f)+_0x4666fb[_0x32b666(0x14c)][_0x32b666(0x17c)]+_0x32b666(0x160)+_0x4666fb[_0x32b666(0x14c)][_0x32b666(0x173)]+'\x22'),console[_0x32b666(0x138)](_0x32b666(0x13d)+_0x4666fb['id']),await handleSingleObjectOutput({'id':_0x4666fb['id'],'name':_0x4666fb[_0x32b666(0x14c)][_0x32b666(0x173)],'version':_0x4666fb[_0x32b666(0x14c)]['versionNumber'],'state':_0x4666fb[_0x32b666(0x14c)]['state'],'bundle_id':_0x4666fb[_0x32b666(0x14c)]['journeyBundleId'],'created_at':_0x4666fb[_0x32b666(0x14c)][_0x32b666(0x1a7)]},_0x32131c),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x133);[a28_0x19c35c(0xf9)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a28_0x19c35c(0xfa)](_0x76282a){const _0x5e4942=a28_0x19c35c,{options:_0x57278f,args:_0x2eb618,tdx:_0x549d38}=_0x76282a,_0xce4fe8=_0x2eb618[0x0];if(!requireNameOrPath(_0xce4fe8))return 0x1;const _0x490bec=_0x57278f[_0x5e4942(0x103)];if(!_0x490bec)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x2f51af=parseInt(_0x490bec,0xa);if(isNaN(_0x2f51af)||_0x2f51af<0x1)return console[_0x5e4942(0x138)](_0x5e4942(0x1a8)+_0x490bec),0x1;if(_0x57278f['verbose'])console[_0x5e4942(0x138)](_0x5e4942(0x13e)+_0xce4fe8+_0x5e4942(0x126)+_0x2f51af);const {journeyId:_0x149876,parentSegmentId:_0x23814f}=await resolveJourneyIdFromInput(_0xce4fe8,_0x57278f,_0x549d38),_0x476a7b=await withSpinner(_0x5e4942(0x163),()=>_0x549d38[_0x5e4942(0x1e4)][_0x5e4942(0x1bc)](_0x149876),{'verbose':_0x57278f[_0x5e4942(0x100)]}),{versions:_0xcd7958,latestJourneyId:_0x3c4a81}=_0x476a7b['data'],_0x3dcc93=_0xcd7958[_0x5e4942(0x140)](_0x401835=>_0x401835[_0x5e4942(0x17c)]===_0x2f51af);if(!_0x3dcc93){const _0x33250d=_0xcd7958[_0x5e4942(0x1bf)](_0x2a0b6b=>'v'+_0x2a0b6b[_0x5e4942(0x17c)])[_0x5e4942(0xe8)](',\x20');return console[_0x5e4942(0x138)](_0x5e4942(0x16e)+_0x2f51af+_0x5e4942(0xef)+_0x33250d),0x1;}const _0x59c416=await withSpinner(_0x5e4942(0x183)+_0x2f51af+_0x5e4942(0x141),()=>_0x549d38['journey'][_0x5e4942(0x118)](_0x3dcc93[_0x5e4942(0x11d)]),{'verbose':_0x57278f['verbose']}),_0x2f7a35=_0x59c416[_0x5e4942(0x1ea)],_0x17b14e=getConsoleNextUrl(_0x57278f[_0x5e4942(0x132)],'/app/ps/'+_0x23814f+_0x5e4942(0x1c9)+_0x3dcc93['journeyId']+_0x5e4942(0x170));return await handleSingleObjectOutput({'id':_0x2f7a35['id'],'name':_0x2f7a35['attributes'][_0x5e4942(0x173)],'version':_0x2f7a35[_0x5e4942(0x14c)]['versionNumber'],'description':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0xf9)],'state':_0x2f7a35['attributes'][_0x5e4942(0x1d7)],'paused':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x135)],'reentry_mode':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x1db)],'stages':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0xea)]?.[_0x5e4942(0x1dd)]||0x0,..._0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x130)]&&{'goal':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x130)][_0x5e4942(0x173)]},'latest':_0x3dcc93['journeyId']===_0x3c4a81,'created_at':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x1a7)],'updated_at':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x166)],'url':_0x17b14e},_0x57278f),0x0;}}
1
+ const a28_0xdd66dd=a28_0x187d;(function(_0x4ebe83,_0x1b7e20){const _0x38def2=a28_0x187d,_0x16b38c=_0x4ebe83();while(!![]){try{const _0x3f9d8c=parseInt(_0x38def2(0x1cb))/0x1+parseInt(_0x38def2(0x145))/0x2*(parseInt(_0x38def2(0x18e))/0x3)+-parseInt(_0x38def2(0x19f))/0x4*(parseInt(_0x38def2(0x1a3))/0x5)+parseInt(_0x38def2(0x1e1))/0x6*(-parseInt(_0x38def2(0x135))/0x7)+-parseInt(_0x38def2(0x119))/0x8*(-parseInt(_0x38def2(0x18a))/0x9)+parseInt(_0x38def2(0x1e9))/0xa+-parseInt(_0x38def2(0x101))/0xb*(parseInt(_0x38def2(0x140))/0xc);if(_0x3f9d8c===_0x1b7e20)break;else _0x16b38c['push'](_0x16b38c['shift']());}catch(_0x166a19){_0x16b38c['push'](_0x16b38c['shift']());}}}(a28_0x4df2,0x68fc2));import a28_0x1f0e80 from'chalk';import a28_0x16999a from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a28_0x187d(_0xe54cbd,_0xb8a120){_0xe54cbd=_0xe54cbd-0xe7;const _0x4df25e=a28_0x4df2();let _0x187dfb=_0x4df25e[_0xe54cbd];return _0x187dfb;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x306fb4){const _0x3fe459=a28_0x187d;return!_0x306fb4&&(console[_0x3fe459(0x139)](_0x3fe459(0x120)),console[_0x3fe459(0x139)](_0x3fe459(0x162))),!!_0x306fb4;}function withJsonFormat(_0x57f9a5){const _0x51a475=a28_0x187d;if(!_0x57f9a5[_0x51a475(0x16d)]&&!_0x57f9a5[_0x51a475(0x197)]&&!_0x57f9a5['jsonl']&&!_0x57f9a5[_0x51a475(0x11c)])return{..._0x57f9a5,'format':'json','json':!![]};return _0x57f9a5;}function formatJourneyState(_0x3f612d){const _0x148058=a28_0x187d;switch(_0x3f612d){case _0x148058(0x111):return a28_0x1f0e80['green'](_0x148058(0xf6));case _0x148058(0x1a0):return a28_0x1f0e80['dim'](_0x148058(0x17e));case _0x148058(0x127):return a28_0x1f0e80['yellow'](_0x148058(0x128));case _0x148058(0x1c7):return a28_0x1f0e80[_0x148058(0xe7)]('(completed)');case _0x148058(0x156):return a28_0x1f0e80[_0x148058(0xff)](_0x148058(0x15a));default:return'('+_0x3f612d+')';}}function formatJourneyItem(_0x8e9060,_0x311861='',_0x1fd5d5){const _0x5c6692=a28_0x187d,_0x23a1d3=formatJourneyState(_0x8e9060['state']),_0x4a7bc3=_0x1fd5d5?hyperlink(_0x8e9060[_0x5c6692(0x131)],_0x1fd5d5):_0x8e9060[_0x5c6692(0x131)];return _0x311861+'🗺️\x20'+_0x4a7bc3+'\x20'+_0x23a1d3;}function escapeRegex(_0x2c8b16){const _0x4a84cb=a28_0x187d;return _0x2c8b16[_0x4a84cb(0xea)](/[.*+?^${}()|[\]\\]/g,_0x4a84cb(0x14c));}function globToRegex(_0x36ceb8){const _0x5cefd9=a28_0x187d,_0x482664=_0x36ceb8[_0x5cefd9(0x14f)]('*')[_0x5cefd9(0x19a)](escapeRegex);return new RegExp(_0x482664[_0x5cefd9(0x1c6)]('.*'),'i');}function buildRuleToNameMapping(_0x5e3f0e){const _0xb78c7b=a28_0x187d,_0x1dba9d=new Map();if(_0x5e3f0e['segments'])for(const [_0x295749,_0x46b0af]of Object[_0xb78c7b(0x16a)](_0x5e3f0e[_0xb78c7b(0xeb)])){if(_0x46b0af[_0xb78c7b(0x147)]){const _0x47beb8=serializeRule(_0x46b0af['rule']),_0x56e2f6=_0x1dba9d[_0xb78c7b(0x122)](_0x47beb8);_0x56e2f6?_0x56e2f6[_0xb78c7b(0x163)](_0x295749):_0x1dba9d[_0xb78c7b(0x13f)](_0x47beb8,[_0x295749]);}}return _0x1dba9d;}async function resolveJourneyIdFromInput(_0x4480e1,_0x3fca8c,_0xf7e1e7){const _0x429bb9=a28_0x187d,_0x4d093f=await resolveJourneyTarget(_0x4480e1,_0x3fca8c[_0x429bb9(0xfe)],_0x3fca8c['verbose']),_0x25d5a6=_0x4d093f['parentSegment'];if(!_0x25d5a6)throw new SDKError(ErrorCode[_0x429bb9(0x123)],_0x429bb9(0x138));const _0x343207=await withSpinner(_0x429bb9(0x1e2),()=>_0xf7e1e7[_0x429bb9(0x105)][_0x429bb9(0x142)](_0x25d5a6),{'verbose':_0x3fca8c['verbose']}),_0x2b0ec1=_0x343207[_0x429bb9(0x14d)],_0x2c3a0a=await withSpinner(_0x429bb9(0x1a8),()=>_0xf7e1e7[_0x429bb9(0x1bf)][_0x429bb9(0x1e6)](_0x2b0ec1,_0x4d093f['journeyName']),{'verbose':_0x3fca8c[_0x429bb9(0x1bc)]});return{'journeyId':_0x2c3a0a[_0x429bb9(0x14d)],'journeyName':_0x4d093f[_0x429bb9(0x155)],'parentSegmentId':_0x2b0ec1};}async function resolveJourneyTarget(_0x1178d8,_0x235cc3,_0x1a5c57){const _0x1b0ba9=a28_0x187d;if(isYamlFilePath(_0x1178d8))try{const _0xd009f=await resolveYamlFilePath(_0x1178d8);return _0x1a5c57&&(console[_0x1b0ba9(0x139)](_0x1b0ba9(0x1b2)+_0x1178d8),console[_0x1b0ba9(0x139)](_0x1b0ba9(0x164)+_0xd009f['parentSegment']),console[_0x1b0ba9(0x139)]('\x20\x20Name:\x20'+_0xd009f[_0x1b0ba9(0x1f5)]),console[_0x1b0ba9(0x139)]('\x20\x20Folder\x20path:\x20'+(_0xd009f[_0x1b0ba9(0x14b)]||_0x1b0ba9(0x12d)))),{'journeyName':_0xd009f[_0x1b0ba9(0x1f5)],'parentSegment':_0xd009f[_0x1b0ba9(0xfe)],'resolved':_0xd009f};}catch(_0x12d6fd){throw new SDKError(ErrorCode[_0x1b0ba9(0x123)],_0x1b0ba9(0x1da)+_0x12d6fd[_0x1b0ba9(0x110)]);}if(!_0x235cc3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1b0ba9(0xf1));return{'journeyName':_0x1178d8,'parentSegment':_0x235cc3};}export class JourneyListCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x18f);[a28_0xdd66dd(0x1a4)]='List\x20journeys\x20in\x20current\x20context';async[a28_0xdd66dd(0x1b1)](_0x2a053d){const _0x141376=a28_0xdd66dd,{options:_0xd61c91,args:_0x6b2ddb,tdx:_0x242f62}=_0x2a053d,_0x313fc0=_0x6b2ddb[0x0],_0x4376da=_0xd61c91[_0x141376(0xfe)];if(!_0x4376da)return console[_0x141376(0x139)](_0x141376(0x15e)),console['error'](_0x141376(0x134)),0x1;const _0x5a65d0=await withSpinner(_0x141376(0x1e2),()=>_0x242f62[_0x141376(0x105)]['resolveParentId'](_0x4376da),{'verbose':_0xd61c91[_0x141376(0x1bc)]}),_0x4a1dce=_0x5a65d0['data'];_0xd61c91[_0x141376(0x1bc)]&&(console[_0x141376(0x139)](_0x141376(0x149)+_0x4376da+'\x20(ID:\x20'+_0x4a1dce+')'),_0x313fc0&&console[_0x141376(0x139)](_0x141376(0x182)+_0x313fc0));const _0x73ea9=await withSpinner(_0x141376(0x1ee),()=>_0x242f62['segment'][_0x141376(0x12a)](_0x4a1dce),{'verbose':_0xd61c91[_0x141376(0x1bc)]}),_0x1bc91f=_0x73ea9[_0x141376(0x14d)],_0xfe038f=_0x1bc91f['rootFolderId'],_0x1e506e=await withSpinner('Listing\x20journeys...',()=>_0x242f62[_0x141376(0x1bf)]['listJourneysWithFolders'](_0x4a1dce,_0xfe038f),{'verbose':_0xd61c91[_0x141376(0x1bc)]});let _0x4b9399=_0x1e506e[_0x141376(0x14d)][_0x141376(0x1c5)];const _0x5e9555=_0x1e506e[_0x141376(0x14d)][_0x141376(0x17b)],_0x4bb7fd=new Map();for(const _0x2a1441 of _0x5e9555){_0x4bb7fd[_0x141376(0x13f)](_0x2a1441['id'],_0x2a1441[_0x141376(0x10b)]);}if(_0x313fc0){const _0xeccb60=globToRegex(_0x313fc0);_0x4b9399=_0x4b9399[_0x141376(0x10e)](_0x5410a6=>_0xeccb60['test'](_0x5410a6[_0x141376(0x131)]));}console[_0x141376(0x139)](_0x141376(0x195)+_0x4b9399[_0x141376(0x1b6)]+_0x141376(0x1d3)+(_0x4b9399['length']!==0x1?'s':''));const _0x7ee818=_0x42bec3=>{const _0xcb3a3a=_0x141376;return getConsoleNextUrl(_0xd61c91['site'],_0xcb3a3a(0x104)+_0x4a1dce+_0xcb3a3a(0x1c3)+_0x42bec3+_0xcb3a3a(0x161));};if(_0xd61c91[_0x141376(0x16d)]===_0x141376(0x1c4))await handleSDKOutput(_0x4b9399,_0xd61c91);else{if(_0xd61c91[_0x141376(0x16d)]==='json'){const _0x16c4fc=_0x4b9399[_0x141376(0x19a)](_0x2fae5e=>({..._0x2fae5e,'url':_0x7ee818(_0x2fae5e['id'])}));await handleSDKOutput(_0x16c4fc,_0xd61c91);}else{console['log']('['+_0x4376da+']');const _0x4e8d4f=new Map(),_0x2aae63=[];for(const _0x2a1018 of _0x4b9399){if(!_0x2a1018[_0x141376(0x191)]||_0x2a1018[_0x141376(0x191)]===_0xfe038f)_0x2aae63[_0x141376(0x163)](_0x2a1018);else{const _0x5f32f4=_0x4e8d4f[_0x141376(0x122)](_0x2a1018[_0x141376(0x191)])||[];_0x5f32f4[_0x141376(0x163)](_0x2a1018),_0x4e8d4f[_0x141376(0x13f)](_0x2a1018['folderId'],_0x5f32f4);}}const _0x2343c1=(_0x55aeec,_0x395a29)=>_0x55aeec[_0x141376(0x131)]['localeCompare'](_0x395a29[_0x141376(0x131)],undefined,{'sensitivity':_0x141376(0x190)});_0x2aae63[_0x141376(0x148)](_0x2343c1);for(const _0x2ff21b of _0x2aae63){console[_0x141376(0x169)](formatJourneyItem(_0x2ff21b,'',_0x7ee818(_0x2ff21b['id'])));}const _0x313ac9=[..._0x4e8d4f[_0x141376(0x16a)]()][_0x141376(0x148)]((_0x27eac9,_0x48614c)=>{const _0x2313bf=_0x141376,_0x1334d4=_0x4bb7fd['get'](_0x27eac9[0x0])||_0x27eac9[0x0],_0x4f8f7b=_0x4bb7fd[_0x2313bf(0x122)](_0x48614c[0x0])||_0x48614c[0x0];return _0x1334d4[_0x2313bf(0x1a6)](_0x4f8f7b,undefined,{'sensitivity':_0x2313bf(0x190)});});for(const [_0x52ba94,_0x2f71f1]of _0x313ac9){const _0x354e9d=_0x4bb7fd['get'](_0x52ba94)||_0x52ba94;console[_0x141376(0x169)](_0x141376(0x13e)+_0x354e9d),_0x2f71f1[_0x141376(0x148)](_0x2343c1);for(const _0x354699 of _0x2f71f1){console['log'](formatJourneyItem(_0x354699,'\x20\x20',_0x7ee818(_0x354699['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1f4);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x1f6);async[a28_0xdd66dd(0x1b1)](_0x1e9556){const _0x61943a=a28_0xdd66dd,{options:_0xda01dd,args:_0x4538d4,tdx:_0x534d91}=_0x1e9556,_0x1b44b0=_0x4538d4[0x0];if(!_0x1b44b0)return console['error'](_0x61943a(0x120)),console['error'](_0x61943a(0x196)),console[_0x61943a(0x139)](_0x61943a(0x154)),console['error'](_0x61943a(0x150)),0x1;_0xda01dd[_0x61943a(0x1bc)]&&console['error'](_0x61943a(0x1ce)+_0x1b44b0);const {journeyId:_0x3af257,parentSegmentId:_0x46a301}=await resolveJourneyIdFromInput(_0x1b44b0,_0xda01dd,_0x534d91);if(_0xda01dd[_0x61943a(0x1ec)]){const _0x26413c=getConsoleNextUrl(_0xda01dd[_0x61943a(0x1db)],'/app/ps/'+_0x46a301+_0x61943a(0x1c3)+_0x3af257+'/j/da/je');return console[_0x61943a(0x139)](a28_0x1f0e80['green']('✔')+_0x61943a(0x17a)+a28_0x1f0e80[_0x61943a(0x1f1)](_0x26413c)),openBrowser(_0x26413c),0x0;}const _0xdcb42c=await withSpinner(_0x61943a(0x170),()=>_0x534d91[_0x61943a(0x1bf)]['getJourney'](_0x3af257),{'verbose':_0xda01dd[_0x61943a(0x1bc)]}),_0x2ddadc=_0xdcb42c[_0x61943a(0x14d)],_0x40794a=_0xda01dd[_0x61943a(0x1dd)];let _0x5ccd86;if(_0x40794a)try{const _0x55ea28=await withSpinner(_0x61943a(0x1d1),()=>_0x534d91[_0x61943a(0x1bf)][_0x61943a(0x1f0)](_0x3af257),{'verbose':_0xda01dd[_0x61943a(0x1bc)]});_0x5ccd86=_0x55ea28['data'];}catch{_0xda01dd[_0x61943a(0x1bc)]&&console['error'](_0x61943a(0xec));}const _0x511450=getConsoleNextUrl(_0xda01dd[_0x61943a(0x1db)],_0x61943a(0x104)+_0x46a301+_0x61943a(0x1c3)+_0x3af257+'/j/da/je'),_0x1fac0d={'id':_0x2ddadc['id'],'name':_0x2ddadc[_0x61943a(0x158)][_0x61943a(0x10b)],'description':_0x2ddadc['attributes']['description'],'state':_0x2ddadc[_0x61943a(0x158)][_0x61943a(0x1d6)],'paused':_0x2ddadc[_0x61943a(0x158)]['paused'],'reentry_mode':_0x2ddadc[_0x61943a(0x158)]['reentryMode'],'stages':_0x2ddadc['attributes']['journeyStages']?.[_0x61943a(0x1b6)]||0x0,..._0x2ddadc[_0x61943a(0x158)][_0x61943a(0x179)]&&{'goal':_0x2ddadc[_0x61943a(0x158)]['goal']['name']},..._0x5ccd86&&{'statistics':{'size':_0x5ccd86[_0x61943a(0x146)],'entered':_0x5ccd86[_0x61943a(0x1c1)],'goal_achieved':_0x5ccd86[_0x61943a(0x19d)],'completion_rate':_0x5ccd86[_0x61943a(0x130)],'exit_or_jump':_0x5ccd86[_0x61943a(0xfd)],'exit_or_jump_rate':_0x5ccd86[_0x61943a(0x10a)],'stages':_0x5ccd86['stages']}},'url':_0x511450};return await handleSingleObjectOutput(_0x1fac0d,_0xda01dd),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a28_0xdd66dd(0x1f8);[a28_0xdd66dd(0x1a4)]='Show\x20journey\x20statistics';async[a28_0xdd66dd(0x1b1)](_0x4f70b0){const _0x39d189=a28_0xdd66dd,{options:_0x44ffa8,args:_0x3a287e,tdx:_0x318c32}=_0x4f70b0,_0x4cee97=_0x3a287e[0x0];if(!requireNameOrPath(_0x4cee97))return 0x1;_0x44ffa8[_0x39d189(0x1bc)]&&console[_0x39d189(0x139)]('Input:\x20'+_0x4cee97);const _0x32d7ae=_0x44ffa8,_0x393410=_0x32d7ae['from'],_0x598ebd=_0x32d7ae['to'],_0x229e01=_0x32d7ae[_0x39d189(0x157)],_0x5dd969=_0x32d7ae[_0x39d189(0x125)];_0x229e01&&!_0x393410&&!_0x598ebd&&console['error'](_0x39d189(0x11b));const _0x36757d=_0x229e01?withJsonFormat(_0x44ffa8):_0x44ffa8,{journeyId:_0x10f04c,journeyName:_0x5067b5}=await resolveJourneyIdFromInput(_0x4cee97,_0x36757d,_0x318c32),_0x44a140=_0x393410||_0x598ebd?{'from':_0x393410,'to':_0x598ebd}:undefined,_0x50de06=await withSpinner(_0x39d189(0x1d1),()=>Promise[_0x39d189(0x12b)]([_0x318c32['journey'][_0x39d189(0x11d)](_0x10f04c),_0x318c32[_0x39d189(0x1bf)][_0x39d189(0x1f0)](_0x10f04c,_0x44a140)]),{'verbose':_0x36757d[_0x39d189(0x1bc)]}),[_0xf29cae,_0x863319]=_0x50de06[_0x39d189(0x14d)];if(!_0x863319||_0x863319[_0x39d189(0x103)]===null)return console[_0x39d189(0x139)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x5067b5),console[_0x39d189(0x139)](_0x39d189(0xee)),0x0;const _0x1a5161=buildStageNameMap(_0xf29cae),_0x4662fe=!!(_0x44a140&&_0x863319['history']?.['length']),_0x176976={'stageNameMap':_0x1a5161,'hasPeriod':_0x4662fe,'includeHistory':!!_0x229e01};if(_0x5dd969&&_0x863319[_0x39d189(0x1ed)]){const _0xb15ea0=_0x863319[_0x39d189(0x1ed)][_0x39d189(0x16b)](_0x46529c=>{const _0x45395e=_0x39d189,_0x24abbb=_0x1a5161['get'](_0x46529c['id'])??'';return _0x24abbb['toLowerCase']()===_0x5dd969[_0x45395e(0x1ab)]();});if(_0xb15ea0)return await handleSingleObjectOutput(formatStageStats(_0xb15ea0,_0x176976),_0x36757d),0x0;const _0x36061a=_0x863319[_0x39d189(0x1ed)][_0x39d189(0x19a)](_0x47ac22=>_0x1a5161[_0x39d189(0x122)](_0x47ac22['id'])??_0x47ac22['id']);return console['error'](_0x39d189(0x1e8)+_0x5dd969+_0x39d189(0x1d0)),console[_0x39d189(0x139)](_0x39d189(0xfc)+_0x36061a[_0x39d189(0x1c6)](',\x20')),0x1;}const _0x50e127=_0x863319[_0x39d189(0x1ed)]?.['map'](_0x2695b0=>formatStageStats(_0x2695b0,_0x176976)),_0x4fbd51=assembleJourneyStats(_0x863319,{'from':_0x393410,'to':_0x598ebd,'includeHistory':_0x229e01});return await this[_0x39d189(0x114)](_0x4fbd51,_0x50e127??[],_0x36757d),0x0;}async[a28_0xdd66dd(0x114)](_0x316c87,_0xa2bbf1,_0x142d42){const _0x251c4f=a28_0xdd66dd,_0x3b0509=_0x142d42[_0x251c4f(0x16d)]===_0x251c4f(0x197)||_0x142d42[_0x251c4f(0x16d)]===_0x251c4f(0x1cd)||_0x142d42['json']||_0x142d42[_0x251c4f(0x1cd)];if(_0x3b0509){_0x316c87['stages']=_0xa2bbf1,await handleSingleObjectOutput(_0x316c87,_0x142d42);return;}await handleSingleObjectOutput(_0x316c87,_0x142d42);for(const _0x18f447 of _0xa2bbf1){console[_0x251c4f(0x169)](''),console[_0x251c4f(0x169)](String(a28_0x1f0e80['cyan'][_0x251c4f(0x1c2)]('['+_0x18f447[_0x251c4f(0x10b)]+']'))+a28_0x1f0e80['dim']('\x20'+_0x18f447['id']));const {id:_0x27c55e,name:_0x1cde37,..._0x48757a}=_0x18f447;await handleSingleObjectOutput(_0x48757a,_0x142d42);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x121);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x16c);async[a28_0xdd66dd(0x1b1)](_0x1ea6f5){const _0x104606=a28_0xdd66dd,{options:_0x3f0599,args:_0x11d040,tdx:_0x10b23a}=_0x1ea6f5,_0x3a16ce=_0x11d040[0x0];if(!requireNameOrPath(_0x3a16ce))return 0x1;_0x3f0599['verbose']&&console[_0x104606(0x139)](_0x104606(0x1ce)+_0x3a16ce);const _0x2bb78d=_0x3f0599,_0x553f22=_0x2bb78d[_0x104606(0xf4)],_0x5c5af1=_0x2bb78d[_0x104606(0x13d)],_0x2aadb5=_0x2bb78d['to'],_0x45956f=_0x2bb78d['limit'];if(_0x553f22&&_0x553f22!==_0x104606(0x1ae)&&_0x553f22!==_0x104606(0x1a7))return console[_0x104606(0x139)](_0x104606(0x1c8)+_0x553f22+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x36d386=withJsonFormat(_0x3f0599),{journeyId:_0xdd462f,journeyName:_0x2727d4}=await resolveJourneyIdFromInput(_0x3a16ce,_0x36d386,_0x10b23a),_0x5ac7e9={'type':_0x553f22,'from':_0x5c5af1,'to':_0x2aadb5,'limit':_0x45956f},_0x4a82b0=await withSpinner(_0x104606(0x1cf),()=>_0x10b23a[_0x104606(0x1bf)][_0x104606(0x143)](_0xdd462f,_0x5ac7e9),{'verbose':_0x36d386[_0x104606(0x1bc)]}),_0x1511a1=_0x4a82b0[_0x104606(0x14d)],_0x20c387=_0x1511a1[_0x104606(0x1ae)]&&(_0x1511a1[_0x104606(0x1ae)][_0x104606(0x177)][_0x104606(0x1b6)]>0x0||_0x1511a1['conversion'][_0x104606(0x11e)][_0x104606(0x1b6)]>0x0),_0x3a8cba=_0x1511a1[_0x104606(0x1a7)]&&_0x1511a1['activation'][_0x104606(0x1b6)]>0x0;if(!_0x20c387&&!_0x3a8cba)return console[_0x104606(0x139)](_0x104606(0x1e4)+_0x2727d4),console['error'](_0x104606(0xe9)),_0x5c5af1&&_0x2aadb5&&console[_0x104606(0x139)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x1511a1,_0x36d386),0x0;}}function formatStageStats(_0x31cdd1,_0x49e7a0){const _0x159a56=a28_0xdd66dd,_0x56cebe=_0x49e7a0[_0x159a56(0x189)]&&_0x31cdd1[_0x159a56(0x1dc)]?.['length']?aggregateStageHistory(_0x31cdd1[_0x159a56(0x1dc)]):{'size':_0x31cdd1[_0x159a56(0x146)],'entered':_0x31cdd1[_0x159a56(0x1c1)],'milestone':_0x31cdd1[_0x159a56(0x167)],'milestone_rate':_0x31cdd1[_0x159a56(0x1a9)],'exit_or_jump':_0x31cdd1[_0x159a56(0xfd)],'exit_or_jump_rate':_0x31cdd1['exitOrJumpRate']},_0x407655={'id':_0x31cdd1['id'],'name':_0x49e7a0['stageNameMap'][_0x159a56(0x122)](_0x31cdd1['id'])??_0x31cdd1['id'],..._0x56cebe};return _0x49e7a0['hasPeriod']&&_0x49e7a0[_0x159a56(0x157)]&&_0x31cdd1[_0x159a56(0x1dc)]&&(_0x407655['history']=_0x31cdd1[_0x159a56(0x1dc)]),_0x407655;}function a28_0x4df2(){const _0x5f2be7=['sort','Parent\x20segment:\x20','segmentPushCommand','folderPath','\x5c$&','data','utf-8','split','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','relativePath','\x20(rule\x20match)','Journey\x20name:\x20','Options:','journeyName','archived','includeHistory','attributes','args','(archived)','journeyStages','Error:\x20--version\x20option\x20is\x20required','Fetching\x20users\x20and\x20connections...','Error:\x20Parent\x20segment\x20context\x20required','resourceName','No\x20journeys\x20found','/j/da','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','push','\x20\x20Parent\x20segment:\x20','setPhase','activation_','milestoneSize','List\x20activations\x20for\x20a\x20journey','log','entries','find','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','format','journey:pull','then','Getting\x20journey\x20details...','Found\x20','Getting\x20column\x20mapping...','journeyBundleId','database','yellow','isNew','nodes','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','goal','\x20Opening\x20','folders','repeat','Listing\x20journey\x20activations...','(draft)','List\x20all\x20versions\x20of\x20a\x20journey','reentryMode','file','Pattern:\x20','\x20->\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Folder\x20path:\x20','listJourneysFromParentSegment','Cancelled','Table:\x20','hasPeriod','62388TWgYeW','\x20(draft)\x20—\x20\x22','\x20journey\x20files\x20to\x20','createdAt','52755KXdjpd','journey:list','base','folderId','buildIdToNameMap','\x20versions)','✔\x20Context\x20set:\x20','✔\x20Found\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','json','Pause\x20a\x20running\x20journey','filePath','map','user',',\x20version:\x20','goalSize','tdx.json','32QJhacU','draft','yes','Warning:\x20Could\x20not\x20resolve\x20activation\x20','121015GlDSWh','description','targetDir','localeCompare','activation','Resolving\x20journey...','completeMilestoneRate','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','toLowerCase','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x22\x20resumed','conversion','journey:version:view','connection','execute','Resolved\x20YAML\x20file:\x20','\x20Created\x20v','/j/da/je','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','length','Error:\x20Invalid\x20version\x20number:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','getLatestJourneyId','audienceId','\x20version','verbose','✔\x20Journey\x20\x22','red','journey','green','enteredSize','bold','/e/','table','journeys','join','completed','Error:\x20Invalid\x20--type\x20\x22','journey:resume','\x20not\x20found.\x20Available:\x20','463084NpmEza','no_parent','jsonl','Input:\x20','Getting\x20journey\x20traffic\x20data...','\x22\x20not\x20found','Getting\x20journey\x20statistics...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20journey','parent_segment','\x20\x20Journey\x20ID:\x20','state','journey:versions','Show\x20journey\x20table\x20column\x20mapping','Fetching\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','site','history','includeStats','root\x20folder','.yml','\x20=\x20','14754BrPQUt','Resolving\x20parent\x20segment...','\x20details...','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','diff','resolveJourneyId','\x20\x20-\x20','Error:\x20Stage\x20\x22','5402020hwWCjs','\x0aPull\x20summary:','Resume\x20a\x20paused\x20journey','web','stages','Fetching\x20parent\x20segment...','has','getStatistics','cyan','✔\x20Pulled\x20','\x0aChanges\x20to\x20\x27','journey:view','segmentName','Show\x20journey\x20details','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','journey:stats','journey:columns','blue','relative','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','replace','segments','\x20\x20Statistics\x20not\x20available','hasChanges','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20activation','listFolders','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Journey\x20\x27','buildIdToEmailMap','type','Getting\x20version\x20','(running)','\x20files?','values','Creating\x20new\x20version...','listVersions','session','Available\x20stages:\x20','exitOrJumpSize','parentSegment','dim','Aborted.','22zKzJUK','helpText','journeyId','/app/ps/','segment','\x20journeys','...','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','\x22\x20paused','exitOrJumpRate','name','getColumnMapping','\x20\x20Target:\x20','filter','versionNumber','message','launched','content','\x20unchanged\x20files','renderStats','version','parentName','errorCode','stringify','16YjsWEd','journey:push','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','tsv','getJourney','links','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','journey:traffic','get','INVALID_ARGUMENT','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','stage','\x20new\x20files','paused','(paused)','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','getParentFull','all','connector_config','(root)','options','Error:\x20','completionRate','journeyBundleName','cwd','Pausing\x20journey...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','651RWidUw','journey:activations','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','error','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','kind','add','from','📁\x20','set','1094436ZdjVwZ','\x27\x20not\x20found\x20in\x20','resolveParentId','getTrafficData','activationParams','2bIUOQU','size','rule'];a28_0x4df2=function(){return _0x5f2be7;};return a28_0x4df2();}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x198);async[a28_0xdd66dd(0x1b1)](_0x38ddbe){const _0x34de6c=a28_0xdd66dd,{options:_0x1c9e0a,args:_0x32e70b,tdx:_0x289a93}=_0x38ddbe,_0x5745b8=_0x32e70b[0x0];if(!requireNameOrPath(_0x5745b8))return 0x1;_0x1c9e0a['verbose']&&console[_0x34de6c(0x139)]('Input:\x20'+_0x5745b8);const {journeyId:_0x597d0c,journeyName:_0x4181a9}=await resolveJourneyIdFromInput(_0x5745b8,_0x1c9e0a,_0x289a93);if(!_0x1c9e0a[_0x34de6c(0x1a1)]){const _0x2167b5=await confirm(_0x34de6c(0x108)+_0x4181a9+'\x22?');if(!_0x2167b5)return console[_0x34de6c(0x139)]('Cancelled'),0x0;}const _0x53b052=await withSpinner(_0x34de6c(0x133),()=>_0x289a93[_0x34de6c(0x1bf)]['pause'](_0x597d0c),{'verbose':_0x1c9e0a[_0x34de6c(0x1bc)]}),_0xdd4c91=_0x53b052[_0x34de6c(0x14d)];return console[_0x34de6c(0x139)](_0x34de6c(0x1bd)+_0xdd4c91[_0x34de6c(0x158)][_0x34de6c(0x10b)]+_0x34de6c(0x109)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1c9);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x1eb);async[a28_0xdd66dd(0x1b1)](_0x68c3ca){const _0x3e79bb=a28_0xdd66dd,{options:_0x25ff15,args:_0x28a1e0,tdx:_0x430897}=_0x68c3ca,_0x268df0=_0x28a1e0[0x0];if(!requireNameOrPath(_0x268df0))return 0x1;_0x25ff15[_0x3e79bb(0x1bc)]&&console[_0x3e79bb(0x139)](_0x3e79bb(0x1ce)+_0x268df0);const {journeyId:_0xaf5754,journeyName:_0x4eda48}=await resolveJourneyIdFromInput(_0x268df0,_0x25ff15,_0x430897);if(!_0x25ff15['yes']){const _0x3fd60c=await confirm(_0x3e79bb(0x178)+_0x4eda48+'\x22?');if(!_0x3fd60c)return console['error'](_0x3e79bb(0x187)),0x0;}const _0x45a715=await withSpinner('Resuming\x20journey...',()=>_0x430897['journey']['resume'](_0xaf5754),{'verbose':_0x25ff15[_0x3e79bb(0x1bc)]}),_0x357086=_0x45a715['data'];return console['error'](_0x3e79bb(0x1bd)+_0x357086[_0x3e79bb(0x158)]['name']+_0x3e79bb(0x1ad)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x16e);[a28_0xdd66dd(0x1a4)]='Export\x20journey(s)\x20as\x20YAML\x20files';async['execute'](_0x6ef1ca){const _0x319a88=a28_0xdd66dd,{options:_0x295521,args:_0x1e2f85,tdx:_0x36638e}=_0x6ef1ca,_0x5097b6=_0x295521,_0x5a9afe=_0x1e2f85[0x0],_0x217d59=_0x5a9afe&&isYamlFilePath(_0x5a9afe),_0x410d9d=await resolveTarget({'arg':_0x217d59?_0x5a9afe:undefined,'contextParent':_0x295521[_0x319a88(0xfe)],'cwd':process[_0x319a88(0x132)]()});if(!isSuccessfulResolution(_0x410d9d))return _0x410d9d[_0x319a88(0x117)]===_0x319a88(0x1cc)?(console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x175)](_0x319a88(0x1f7))),console[_0x319a88(0x139)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x319a88(0x139)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x319a88(0x139)](_0x319a88(0x1d2)),console[_0x319a88(0x139)](_0x319a88(0x11f))):(console[_0x319a88(0x139)](a28_0x1f0e80['red'](_0x319a88(0x12f)+_0x410d9d[_0x319a88(0x110)]+'\x0a')),_0x410d9d[_0x319a88(0x102)]&&console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x1f1)](_0x410d9d['helpText']))),0x1;let _0x2de97b=_0x217d59?undefined:_0x5a9afe,_0x503319,_0x202464;_0x410d9d[_0x319a88(0xf4)]===_0x319a88(0x181)&&(_0x2de97b=_0x410d9d[_0x319a88(0x15f)],_0x503319=_0x410d9d[_0x319a88(0x199)],_0x202464=_0x410d9d['folderPath']);const _0x304681=_0x410d9d[_0x319a88(0x116)],_0x4bee6=_0x410d9d[_0x319a88(0x1a5)];_0x5097b6['verbose']&&(console[_0x319a88(0x139)](_0x319a88(0x149)+_0x304681),console['error']('Target\x20directory:\x20'+_0x4bee6),_0x2de97b&&console[_0x319a88(0x139)](_0x319a88(0x153)+_0x2de97b),_0x503319&&console[_0x319a88(0x139)]('Target\x20file:\x20'+_0x503319),_0x202464&&console[_0x319a88(0x139)](_0x319a88(0x185)+_0x202464));const _0x14086a=await withSpinner(_0x319a88(0x1e2),()=>_0x36638e[_0x319a88(0x105)]['resolveParentId'](_0x304681),{'verbose':_0x295521[_0x319a88(0x1bc)]}),_0x27cdcb=_0x14086a[_0x319a88(0x14d)],{journeys:_0x3bbd3e,folders:_0x5a8bf3}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x8f8ade=_0x319a88,[_0x11cefe,_0x3ecd65]=await Promise[_0x8f8ade(0x12b)]([_0x36638e[_0x8f8ade(0x1bf)][_0x8f8ade(0x186)](_0x27cdcb,undefined,{'includeAllVersions':!![]}),_0x36638e[_0x8f8ade(0x105)][_0x8f8ade(0xf0)](_0x27cdcb)]);return{'journeys':_0x11cefe,'folders':_0x3ecd65};},{'verbose':_0x295521[_0x319a88(0x1bc)]})[_0x319a88(0x16f)](_0x14fa00=>_0x14fa00[_0x319a88(0x14d)]);let _0x358d23=_0x3bbd3e;const _0x43b3b1=buildFolderIdToPathMap(_0x5a8bf3);if(_0x2de97b){const _0x1765cd=_0x358d23['filter'](_0x5d15f9=>_0x5d15f9['journeyBundleName']['toLowerCase']()===_0x2de97b['toLowerCase']());if(_0x1765cd['length']===0x0)return console[_0x319a88(0x139)]('Error:\x20Journey\x20not\x20found:\x20'+_0x2de97b),console[_0x319a88(0x139)](_0x319a88(0x124)),0x1;_0x358d23=_0x1765cd;}if(_0x202464!==undefined){const _0xe82a90=_0x358d23[_0x319a88(0x10e)](_0xbb65bb=>{const _0x4f1a03=_0x319a88,_0x50341d=_0xbb65bb[_0x4f1a03(0x191)]?_0x43b3b1[_0x4f1a03(0x122)](_0xbb65bb['folderId'])||'':'';return _0x50341d===_0x202464;});if(_0xe82a90[_0x319a88(0x1b6)]===0x0&&_0x358d23['length']>0x0){console[_0x319a88(0x139)](_0x319a88(0xf2)+_0x2de97b+_0x319a88(0x141)+(_0x202464||_0x319a88(0x1de))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x8532d0 of _0x358d23){const _0xc3f517=_0x8532d0['folderId']?_0x43b3b1[_0x319a88(0x122)](_0x8532d0[_0x319a88(0x191)])||'':'';console[_0x319a88(0x139)](_0x319a88(0x1e7)+(_0xc3f517||_0x319a88(0x12d))+'/'+_0x8532d0[_0x319a88(0x131)]);}return 0x1;}_0x358d23=_0xe82a90;}if(_0x358d23['length']===0x0)return console[_0x319a88(0x139)](_0x319a88(0x160)),0x0;const _0xab4efa=new Map();for(const _0x575029 of _0x358d23){const _0x3f4f3b=_0x575029[_0x319a88(0x173)];!_0xab4efa[_0x319a88(0x1ef)](_0x3f4f3b)&&_0xab4efa['set'](_0x3f4f3b,[]),_0xab4efa['get'](_0x3f4f3b)[_0x319a88(0x163)](_0x575029);}for(const _0xc64383 of _0xab4efa[_0x319a88(0xf8)]()){_0xc64383['sort']((_0x237e1a,_0x129659)=>(_0x237e1a[_0x319a88(0x10f)]||0x0)-(_0x129659[_0x319a88(0x10f)]||0x0));}const _0x28c9f8=[],{idToEmailMap:_0x5b94a1,connectionIdToNameMap:_0x3ef929}=await withSpinner(_0x319a88(0x15d),async()=>{const _0x2b16a0=_0x319a88,[_0x2a4daf,_0x178ce7]=await Promise[_0x2b16a0(0x12b)]([_0x36638e[_0x2b16a0(0x19b)][_0x2b16a0(0xf3)](),_0x36638e[_0x2b16a0(0x1b0)][_0x2b16a0(0x192)]()]);return{'idToEmailMap':_0x2a4daf,'connectionIdToNameMap':_0x178ce7};},{'verbose':_0x295521[_0x319a88(0x1bc)]})['then'](_0x46dcf1=>_0x46dcf1['data']);for(const _0x8aada3 of _0xab4efa[_0x319a88(0xf8)]()){const _0x1fdb3e=_0x8aada3[0x0][_0x319a88(0x131)],_0x36f412=_0x8aada3[0x0][_0x319a88(0x191)],_0x15b6f3=_0x36f412?_0x43b3b1[_0x319a88(0x122)](_0x36f412)||'':'',_0x4feb5c=_0x15b6f3?a28_0x16999a['join'](_0x4bee6,_0x15b6f3):_0x4bee6,_0x599b33=_0x503319||a28_0x16999a[_0x319a88(0x1c6)](_0x4feb5c,sanitizeFileName(_0x1fdb3e)+_0x319a88(0x1df));let _0x2fb054,_0x57c690;if(existsSync(_0x599b33))try{const _0x44c4da=readFileSync(_0x599b33,_0x319a88(0x14e)),_0x540aee=parseYamlString(_0x44c4da);_0x57c690=_0x540aee,_0x2fb054=buildRuleToNameMapping(_0x540aee),_0x5097b6['verbose']&&_0x2fb054['size']>0x0&&console['error'](_0x319a88(0x171)+_0x2fb054[_0x319a88(0x146)]+_0x319a88(0x1aa)+_0x1fdb3e);}catch(_0x3476f7){_0x5097b6[_0x319a88(0x1bc)]&&console[_0x319a88(0x139)](_0x319a88(0x184)+_0x3476f7[_0x319a88(0x110)]);}const _0x191575=[],_0x10a970=new Set(),_0x545933=new Map(),_0x1965cf=new Map(),_0xc15d9f=new Set(),_0x1dd76a=new Map(),_0x1580d6=new Map(),_0x2da72e=createJumpTargetCache();await withProgressSpinner(_0x319a88(0x1d9)+_0x1fdb3e+_0x319a88(0x107),async _0x3acf67=>{const _0x31bf95=_0x319a88;for(const _0x564650 of _0x8aada3){const _0x539dff=_0x8aada3['length']>0x1?_0x564650[_0x31bf95(0x131)]+'\x20v'+(_0x564650['versionNumber']||0x1):_0x564650[_0x31bf95(0x131)];_0x3acf67[_0x31bf95(0x165)](_0x31bf95(0x1d9)+_0x539dff);const _0x2e6980=await _0x36638e[_0x31bf95(0x1bf)][_0x31bf95(0x11d)](_0x564650['id']),_0x5b03dd=_0x2e6980[_0x31bf95(0x158)]?.[_0x31bf95(0x1ba)],_0x323dde={'resolveSegment':async _0x2bf6f6=>{const _0x528466=_0x31bf95;if(!_0x5b03dd)return{'name':_0x2bf6f6,'isJourneyLocal':![]};const _0x2e105d=_0x545933[_0x528466(0x122)](_0x2bf6f6);if(_0x2e105d)return _0x2e105d;try{const _0x1a78c1=await _0x36638e[_0x528466(0x105)]['getSegment'](_0x5b03dd,_0x2bf6f6),_0x5cdd28=_0x1a78c1[_0x528466(0x13b)]===SEGMENT_KIND_JOURNEY;let _0x273ce1,_0x472d25=_0x1a78c1[_0x528466(0x10b)];if(_0x5cdd28&&_0x1a78c1[_0x528466(0x147)]){const _0x4a2d2d=await segmentResponseToDef(_0x1a78c1,{'resolveSegmentName':async _0x50fc27=>{const _0x88930d=_0x528466,_0x27afc9=_0x545933[_0x88930d(0x122)](_0x50fc27);if(_0x27afc9)return _0x27afc9[_0x88930d(0x10b)];const _0x18c429=await _0x323dde['resolveSegment'](_0x50fc27);return _0x18c429['name'];}}),_0x4cb2f9=_0x4a2d2d[_0x528466(0x147)];_0x273ce1={'description':_0x1a78c1[_0x528466(0x1a4)],'rule':_0x4cb2f9};const _0x445c6a=serializeRule(_0x4cb2f9),_0x3f4245=_0x1965cf[_0x528466(0x122)](_0x445c6a);if(_0x3f4245)_0x472d25=_0x3f4245,_0x273ce1=undefined,_0x5097b6[_0x528466(0x1bc)]&&console[_0x528466(0x139)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x1a78c1['name']+_0x528466(0x183)+_0x3f4245);else{let _0x50c728=![];if(_0x2fb054){const _0x110a2f=_0x2fb054['get'](_0x445c6a);if(_0x110a2f){const _0x22be6c=_0x110a2f[_0x528466(0x16b)](_0x49aea8=>!_0x10a970[_0x528466(0x1ef)](_0x49aea8));_0x22be6c&&(_0x472d25=_0x22be6c,_0x10a970['add'](_0x22be6c),_0x1965cf[_0x528466(0x13f)](_0x445c6a,_0x22be6c),_0x50c728=!![],_0x5097b6[_0x528466(0x1bc)]&&console[_0x528466(0x139)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x22be6c+_0x528466(0x152)));}}if(!_0x50c728){const _0x2989d2=generateJourneyLocalName(_0x1a78c1[_0x528466(0x10b)]);_0x2989d2&&(_0x472d25=_0x2989d2);let _0x4deee4=_0x472d25,_0xcb741=0x2;while(_0x10a970[_0x528466(0x1ef)](_0x4deee4)){_0x4deee4=_0x472d25+'_'+_0xcb741,_0xcb741++;}_0x10a970[_0x528466(0x13c)](_0x4deee4),_0x1965cf[_0x528466(0x13f)](_0x445c6a,_0x4deee4),_0x472d25=_0x4deee4;}}}const _0x59e86b={'name':_0x472d25,'isJourneyLocal':_0x5cdd28,'definition':_0x273ce1};return _0x545933[_0x528466(0x13f)](_0x2bf6f6,_0x59e86b),_0x59e86b;}catch(_0x108fa9){return _0x295521[_0x528466(0x1bc)]&&console[_0x528466(0x139)](_0x528466(0x137)+_0x2bf6f6+':\x20'+_0x108fa9['message']),{'name':_0x2bf6f6,'isJourneyLocal':![]};}},'resolveActivation':async _0x4985de=>{const _0x4ecfe1=_0x31bf95,_0x214780=_0x1dd76a['get'](_0x4985de);if(_0x214780)return _0x214780;try{const _0x2aa56d=await _0x36638e[_0x4ecfe1(0x1bf)]['getActivation'](_0x564650['id'],_0x4985de),_0x376d67=journeyActivationStepToYaml(_0x2aa56d,_0x5b94a1,_0x3ef929),_0x203284=JSON[_0x4ecfe1(0x118)]({'name':_0x376d67['name'],'connection':_0x376d67[_0x4ecfe1(0x1b0)],'connector_config':_0x376d67[_0x4ecfe1(0x12c)]}),_0x260410=_0x1580d6[_0x4ecfe1(0x122)](_0x203284);if(_0x260410){const _0x5d2159={'name':_0x260410,'isJourneyLocal':!![],'definition':_0x376d67};return _0x1dd76a['set'](_0x4985de,_0x5d2159),_0x5d2159;}const _0x383324=_0x2aa56d['attributes'][_0x4ecfe1(0x144)]['name']||_0x4985de,_0x294faa=sanitizeYamlKey(_0x383324)||_0x4ecfe1(0x166)+_0x4985de;let _0x557153=_0x294faa,_0x5ee1a4=0x2;while(_0xc15d9f['has'](_0x557153)){_0x557153=_0x294faa+'_'+_0x5ee1a4,_0x5ee1a4++;}_0xc15d9f[_0x4ecfe1(0x13c)](_0x557153),_0x1580d6[_0x4ecfe1(0x13f)](_0x203284,_0x557153);const _0x1262c3={'name':_0x557153,'isJourneyLocal':!![],'definition':_0x376d67};return _0x1dd76a['set'](_0x4985de,_0x1262c3),_0x1262c3;}catch(_0x2e1ae2){return _0x295521[_0x4ecfe1(0x1bc)]&&console[_0x4ecfe1(0x139)](_0x4ecfe1(0x1a2)+_0x4985de+':\x20'+_0x2e1ae2[_0x4ecfe1(0x110)]),{'name':_0x4985de,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x2d3c1e,_0x31bca7)=>{const _0x24d35b=_0x31bf95;return resolveJumpTarget(_0x2d3c1e,_0x31bca7,_0x2da72e,_0x492c10=>_0x36638e[_0x24d35b(0x1bf)][_0x24d35b(0x11d)](_0x492c10));}},_0x3175f8=await journeyResponseToDef(_0x2e6980,_0x323dde);_0x191575['push']({'item':_0x564650,'yaml':_0x3175f8});}},{'verbose':_0x295521['verbose']});const _0x195433=await _0x36638e[_0x319a88(0x1bf)][_0x319a88(0x1b9)](_0x8aada3[0x0][_0x319a88(0x173)]),_0x42b796=buildMergedJourneyDef(_0x191575,_0x2fb054,_0x195433),_0x13c9ed=normalizeJourneyDef(_0x42b796,_0x57c690),_0x287738=toYamlString(_0x13c9ed),_0x145492=_0x503319||a28_0x16999a['join'](_0x4feb5c,sanitizeFileName(_0x1fdb3e)+'.yml');!_0x503319&&_0x15b6f3&&!existsSync(_0x4feb5c)&&mkdirSync(_0x4feb5c,{'recursive':!![]});const _0x1f844d=a28_0x16999a[_0x319a88(0xe8)](process['cwd'](),_0x145492);if(existsSync(_0x145492)){const _0x3e346e=readFileSync(_0x145492,_0x319a88(0x14e)),_0x5661ef=generateDiff(_0x3e346e,_0x287738),_0x16dda1=hasChanges(_0x5661ef);_0x28c9f8[_0x319a88(0x163)]({'relativePath':_0x1f844d,'absolutePath':_0x145492,'content':_0x287738,'isNew':![],'hasChanges':_0x16dda1,'diff':_0x16dda1?formatDiffWithColors(_0x5661ef):undefined});}else _0x28c9f8[_0x319a88(0x163)]({'relativePath':_0x1f844d,'absolutePath':_0x145492,'content':_0x287738,'isNew':!![],'hasChanges':![]});}const _0x55d5f5=_0x28c9f8[_0x319a88(0x10e)](_0x415c6c=>_0x415c6c[_0x319a88(0x176)]),_0x1f6cc4=_0x28c9f8['filter'](_0x8c231c=>!_0x8c231c[_0x319a88(0x176)]&&_0x8c231c[_0x319a88(0xed)]),_0x237154=_0x28c9f8['filter'](_0x52b35f=>!_0x52b35f[_0x319a88(0x176)]&&!_0x52b35f[_0x319a88(0xed)]),_0x5043b0=_0x358d23[_0x319a88(0x1b6)],_0x3d4f48=_0xab4efa[_0x319a88(0x146)],_0x346af8=_0x5043b0>_0x3d4f48?'\x20('+_0x5043b0+_0x319a88(0x193):'';console[_0x319a88(0x139)](_0x319a88(0x1ea)),console[_0x319a88(0x139)]('\x20\x20'+a28_0x1f0e80[_0x319a88(0x1f1)](_0x3d4f48+_0x319a88(0x106))+a28_0x1f0e80[_0x319a88(0xff)](_0x346af8)),console['error']('\x20\x20'+a28_0x1f0e80[_0x319a88(0x1c0)]('+\x20'+_0x55d5f5['length']+_0x319a88(0x126))),console[_0x319a88(0x139)]('\x20\x20'+a28_0x1f0e80[_0x319a88(0x175)]('~\x20'+_0x1f6cc4[_0x319a88(0x1b6)]+'\x20changed\x20files')),console[_0x319a88(0x139)]('\x20\x20'+a28_0x1f0e80['dim']('=\x20'+_0x237154[_0x319a88(0x1b6)]+_0x319a88(0x113))),console[_0x319a88(0x139)](_0x319a88(0x10d)+a28_0x1f0e80['cyan'](_0x4bee6)+'\x0a');if(_0x1f6cc4[_0x319a88(0x1b6)]>0x0)for(const _0x31c8b7 of _0x1f6cc4){console['error'](_0x319a88(0x1f3)+_0x31c8b7[_0x319a88(0x151)]+'\x27:'),console['error']('─'[_0x319a88(0x17c)](0x3c)),console['error'](_0x31c8b7[_0x319a88(0x1e5)]),console['error']('─'[_0x319a88(0x17c)](0x3c));}if(_0x5097b6['dryRun'])return console['error'](a28_0x1f0e80[_0x319a88(0x175)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x55d5f5[_0x319a88(0x1b6)]===0x0&&_0x1f6cc4[_0x319a88(0x1b6)]===0x0)return console['error'](a28_0x1f0e80['green'](_0x319a88(0x1b8))),saveSessionContext({'parent_segment':_0x304681},_0x5097b6['session']),console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x1c0)](_0x319a88(0x194)+a28_0x1f0e80['dim'](_0x319a88(0x1d4))+'\x20=\x20'+a28_0x1f0e80[_0x319a88(0x1f1)](_0x304681))),0x0;if(!_0x5097b6[_0x319a88(0x1a1)]&&(_0x55d5f5[_0x319a88(0x1b6)]>0x0||_0x1f6cc4['length']>0x0)){if(!isInteractive())return console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x1be)]('\x0aError:'),_0x319a88(0x1ac)),console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0xff)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2d2313=await confirmKey('Write\x20'+(_0x55d5f5['length']+_0x1f6cc4[_0x319a88(0x1b6)])+_0x319a88(0xf7));if(!_0x2d2313)return console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x175)](_0x319a88(0x100)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x4bee6)&&mkdirSync(_0x4bee6,{'recursive':!![]});const _0x28251d=a28_0x16999a[_0x319a88(0x1c6)](_0x4bee6,_0x319a88(0x19e));writeFileSync(_0x28251d,createTdxConfigContent(_0x304681),_0x319a88(0x14e));for(const _0x40de64 of _0x28c9f8){(_0x40de64['isNew']||_0x40de64['hasChanges'])&&writeFileSync(_0x40de64['absolutePath'],_0x40de64[_0x319a88(0x112)],_0x319a88(0x14e));}return console['error'](a28_0x1f0e80[_0x319a88(0x1c0)](_0x319a88(0x1f2)+(_0x55d5f5[_0x319a88(0x1b6)]+_0x1f6cc4['length'])+_0x319a88(0x18c)+_0x4bee6)),saveSessionContext({'parent_segment':_0x304681},_0x5097b6[_0x319a88(0xfb)]),console[_0x319a88(0x139)](a28_0x1f0e80['green'](_0x319a88(0x194)+a28_0x1f0e80[_0x319a88(0xff)](_0x319a88(0x1d4))+_0x319a88(0x1e0)+a28_0x1f0e80['cyan'](_0x304681))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1f9);['description']=a28_0xdd66dd(0x1d8);async[a28_0xdd66dd(0x1b1)](_0x5433ea){const _0x3c3e0d=a28_0xdd66dd,{options:_0x1a08c0,args:_0x423937,tdx:_0x2ef318}=_0x5433ea,_0x3fde14=_0x423937[0x0];if(!requireNameOrPath(_0x3fde14))return 0x1;_0x1a08c0['verbose']&&console['error'](_0x3c3e0d(0x1ce)+_0x3fde14);const {journeyId:_0x48f845}=await resolveJourneyIdFromInput(_0x3fde14,_0x1a08c0,_0x2ef318),_0x4b6419=await withSpinner(_0x3c3e0d(0x172),()=>_0x2ef318[_0x3c3e0d(0x1bf)][_0x3c3e0d(0x10c)](_0x48f845),{'verbose':_0x1a08c0[_0x3c3e0d(0x1bc)]}),_0x2e3f44=_0x4b6419[_0x3c3e0d(0x14d)];return console['log']('Database:\x20'+_0x2e3f44[_0x3c3e0d(0x174)]),console['log'](_0x3c3e0d(0x188)+_0x2e3f44[_0x3c3e0d(0x1c4)]),await handleSDKOutput(_0x2e3f44['columns'],_0x1a08c0),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x136);['description']=a28_0xdd66dd(0x168);async[a28_0xdd66dd(0x1b1)](_0xbb5d8){const _0x584050=a28_0xdd66dd,{options:_0x28e11b,args:_0x2ca170,tdx:_0x13e801}=_0xbb5d8,_0x4c0865=_0x2ca170[0x0];if(!requireNameOrPath(_0x4c0865))return 0x1;_0x28e11b[_0x584050(0x1bc)]&&console[_0x584050(0x139)]('Input:\x20'+_0x4c0865);const {journeyId:_0x4e33f0}=await resolveJourneyIdFromInput(_0x4c0865,_0x28e11b,_0x13e801),_0x28a6b9=await withSpinner(_0x584050(0x17d),()=>_0x13e801[_0x584050(0x1bf)]['listActivationsFlat'](_0x4e33f0),{'verbose':_0x28e11b[_0x584050(0x1bc)]}),_0x390b32=_0x28a6b9[_0x584050(0x14d)];return console[_0x584050(0x139)](_0x584050(0x171)+_0x390b32[_0x584050(0x1b6)]+_0x584050(0xef)+(_0x390b32[_0x584050(0x1b6)]!==0x1?'s':'')),await handleSDKOutput(_0x390b32,_0x28e11b),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x11a);[a28_0xdd66dd(0x1a4)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a28_0xdd66dd(0x14a)]=new SegmentPushCommand();async[a28_0xdd66dd(0x1b1)](_0x207916){const _0x386057=a28_0xdd66dd,_0x457e6d=_0x207916[_0x386057(0x159)][0x0];let _0x5691bb;if(_0x457e6d){const _0x885b92=await resolveTarget({'arg':_0x457e6d,'contextParent':_0x207916[_0x386057(0x12e)][_0x386057(0xfe)],'cwd':process[_0x386057(0x132)]()});isSuccessfulResolution(_0x885b92)&&_0x885b92[_0x386057(0xf4)]===_0x386057(0x181)&&(_0x5691bb=_0x885b92['filePath']);}const _0x46e8aa={..._0x207916,'options':{..._0x207916[_0x386057(0x12e)],'journeysOnly':!![],..._0x5691bb&&{'singleFilePath':_0x5691bb}}};return this[_0x386057(0x14a)]['execute'](_0x46e8aa);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1d7);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x17f);async[a28_0xdd66dd(0x1b1)](_0x3585ec){const _0x105aee=a28_0xdd66dd,{options:_0x3a287a,args:_0x3d92d1,tdx:_0xc0a5cc}=_0x3585ec,_0x13b5fe=_0x3d92d1[0x0];if(!requireNameOrPath(_0x13b5fe))return 0x1;if(_0x3a287a['verbose'])console['error'](_0x105aee(0x1ce)+_0x13b5fe);const {journeyId:_0x3c4bc4}=await resolveJourneyIdFromInput(_0x13b5fe,_0x3a287a,_0xc0a5cc),_0x661352=await withSpinner('Listing\x20journey\x20versions...',()=>_0xc0a5cc[_0x105aee(0x1bf)][_0x105aee(0xfa)](_0x3c4bc4),{'verbose':_0x3a287a[_0x105aee(0x1bc)]}),{bundleName:_0x441a31,versions:_0xab4e93,latestJourneyId:_0x55bde9}=_0x661352['data'];console[_0x105aee(0x139)](_0x441a31+':\x20'+_0xab4e93[_0x105aee(0x1b6)]+_0x105aee(0x1bb)+(_0xab4e93['length']!==0x1?'s':''));const _0x1d5dee=_0xab4e93[_0x105aee(0x19a)](_0x36ddef=>({'version':_0x36ddef[_0x105aee(0x10f)],'journey_id':_0x36ddef[_0x105aee(0x103)],'name':_0x36ddef[_0x105aee(0x10b)],'state':_0x36ddef[_0x105aee(0x1d6)],'paused':_0x36ddef[_0x105aee(0x127)],'latest':_0x36ddef[_0x105aee(0x103)]===_0x55bde9,'created_at':_0x36ddef['createdAt']}));return await handleSDKOutput(_0x1d5dee,_0x3a287a),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]='journey:version:create';['description']=a28_0xdd66dd(0x1b5);async['execute'](_0x57024a){const _0x815f1e=a28_0xdd66dd,{options:_0x35d942,args:_0x585782,tdx:_0x4ce160}=_0x57024a,_0x39fa07=_0x585782[0x0];if(!requireNameOrPath(_0x39fa07))return 0x1;if(_0x35d942[_0x815f1e(0x1bc)])console[_0x815f1e(0x139)](_0x815f1e(0x1ce)+_0x39fa07);const {journeyId:_0x1d36a2,journeyName:_0x2da028}=await resolveJourneyIdFromInput(_0x39fa07,_0x35d942,_0x4ce160);if(!_0x35d942[_0x815f1e(0x1a1)]){const _0x1d9e36=await confirm(_0x815f1e(0x13a)+_0x2da028+'\x22?');if(!_0x1d9e36)return console[_0x815f1e(0x139)](_0x815f1e(0x187)),0x0;}const _0x2ff36d=await withSpinner(_0x815f1e(0xf9),()=>_0x4ce160[_0x815f1e(0x1bf)]['createVersion'](_0x1d36a2),{'verbose':_0x35d942[_0x815f1e(0x1bc)]}),_0x3f8221=_0x2ff36d[_0x815f1e(0x14d)];return console[_0x815f1e(0x139)](a28_0x1f0e80[_0x815f1e(0x1c0)]('✔')+_0x815f1e(0x1b3)+_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x10f)]+_0x815f1e(0x18b)+_0x3f8221[_0x815f1e(0x158)]['name']+'\x22'),console[_0x815f1e(0x139)](_0x815f1e(0x1d5)+_0x3f8221['id']),await handleSingleObjectOutput({'id':_0x3f8221['id'],'name':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x10b)],'version':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x10f)],'state':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x1d6)],'bundle_id':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x173)],'created_at':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x18d)]},_0x35d942),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1af);['description']='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a28_0xdd66dd(0x1b1)](_0x5cf458){const _0x4dd3f9=a28_0xdd66dd,{options:_0x5d65fb,args:_0x3026fd,tdx:_0x172a97}=_0x5cf458,_0x5dabca=_0x3026fd[0x0];if(!requireNameOrPath(_0x5dabca))return 0x1;const _0x121c19=_0x5d65fb[_0x4dd3f9(0x115)];if(!_0x121c19)return console[_0x4dd3f9(0x139)](_0x4dd3f9(0x15c)),console[_0x4dd3f9(0x139)](_0x4dd3f9(0x129)),0x1;const _0x4727df=parseInt(_0x121c19,0xa);if(isNaN(_0x4727df)||_0x4727df<0x1)return console[_0x4dd3f9(0x139)](_0x4dd3f9(0x1b7)+_0x121c19),0x1;if(_0x5d65fb[_0x4dd3f9(0x1bc)])console['error']('Input:\x20'+_0x5dabca+_0x4dd3f9(0x19c)+_0x4727df);const {journeyId:_0x500aab,parentSegmentId:_0x36ed6c}=await resolveJourneyIdFromInput(_0x5dabca,_0x5d65fb,_0x172a97),_0xbac605=await withSpinner('Resolving\x20version...',()=>_0x172a97[_0x4dd3f9(0x1bf)][_0x4dd3f9(0xfa)](_0x500aab),{'verbose':_0x5d65fb['verbose']}),{versions:_0x3190e0,latestJourneyId:_0x246e32}=_0xbac605['data'],_0x3359ea=_0x3190e0[_0x4dd3f9(0x16b)](_0x21f906=>_0x21f906['versionNumber']===_0x4727df);if(!_0x3359ea){const _0x10bf8b=_0x3190e0['map'](_0x477733=>'v'+_0x477733[_0x4dd3f9(0x10f)])['join'](',\x20');return console['error']('Error:\x20Version\x20'+_0x4727df+_0x4dd3f9(0x1ca)+_0x10bf8b),0x1;}const _0x22ad67=await withSpinner(_0x4dd3f9(0xf5)+_0x4727df+_0x4dd3f9(0x1e3),()=>_0x172a97[_0x4dd3f9(0x1bf)][_0x4dd3f9(0x11d)](_0x3359ea[_0x4dd3f9(0x103)]),{'verbose':_0x5d65fb[_0x4dd3f9(0x1bc)]}),_0x4b85b5=_0x22ad67[_0x4dd3f9(0x14d)],_0x4f3a79=getConsoleNextUrl(_0x5d65fb[_0x4dd3f9(0x1db)],_0x4dd3f9(0x104)+_0x36ed6c+_0x4dd3f9(0x1c3)+_0x3359ea[_0x4dd3f9(0x103)]+_0x4dd3f9(0x1b4));return await handleSingleObjectOutput({'id':_0x4b85b5['id'],'name':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x10b)],'version':_0x4b85b5['attributes'][_0x4dd3f9(0x10f)],'description':_0x4b85b5[_0x4dd3f9(0x158)]['description'],'state':_0x4b85b5['attributes']['state'],'paused':_0x4b85b5['attributes']['paused'],'reentry_mode':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x180)],'stages':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x15b)]?.[_0x4dd3f9(0x1b6)]||0x0,..._0x4b85b5[_0x4dd3f9(0x158)]['goal']&&{'goal':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x179)][_0x4dd3f9(0x10b)]},'latest':_0x3359ea['journeyId']===_0x246e32,'created_at':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x18d)],'updated_at':_0x4b85b5[_0x4dd3f9(0x158)]['updatedAt'],'url':_0x4f3a79},_0x5d65fb),0x0;}}
@@ -1 +1 @@
1
- const a29_0x37ea1c=a29_0x195e;(function(_0x277f98,_0x34d6d7){const _0x5db31c=a29_0x195e,_0x193573=_0x277f98();while(!![]){try{const _0x1bb63b=parseInt(_0x5db31c(0x1ed))/0x1*(parseInt(_0x5db31c(0x1c3))/0x2)+parseInt(_0x5db31c(0x1b9))/0x3+parseInt(_0x5db31c(0x1bf))/0x4*(-parseInt(_0x5db31c(0x1d3))/0x5)+-parseInt(_0x5db31c(0x1bd))/0x6*(parseInt(_0x5db31c(0x1bb))/0x7)+parseInt(_0x5db31c(0x1d6))/0x8+-parseInt(_0x5db31c(0x1ef))/0x9+parseInt(_0x5db31c(0x1eb))/0xa;if(_0x1bb63b===_0x34d6d7)break;else _0x193573['push'](_0x193573['shift']());}catch(_0x1da946){_0x193573['push'](_0x193573['shift']());}}}(a29_0x4795,0x762e5));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0x1bfdcd from'chalk';function a29_0x4795(){const _0x5c5ec4=['name','parentSegment','554355MvAfny','yellow','14AGczLA','validCount','1532298PBXTsa','dim','20gfAQWg','skippedCount','Error:\x20Directory\x20not\x20found:\x20','file','1392wJacTH','endsWith','\x20warning(s)\x20found','message','No\x20journey\x20YAML\x20files\x20found\x20in\x20','description','.yaml','execute','\x20valid','filter','no_parent','invalidCount','Validate\x20journey\x20YAML\x20files','\x20error(s)','verbose','green','650525mKenOi','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','cwd','4097728CqRcNH','log','warningCount','journey:validate','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20segment\x20file(s)\x20skipped','errorCode','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','cyan','Validation\x20failed:\x20','\x20(skipped:\x20','helpText','error','.yml','Error:\x20','errors','relativePath','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','targetDir','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','5119690YPoLQo','reason','864zBsDlz','\x20journey(s)\x20valid','1484586EXHwqY','warnings','type','filePath','red','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'];a29_0x4795=function(){return _0x5c5ec4;};return a29_0x4795();}function a29_0x195e(_0x5426b0,_0x29b3bf){_0x5426b0=_0x5426b0-0x1b4;const _0x47952c=a29_0x4795();let _0x195ef6=_0x47952c[_0x5426b0];return _0x195ef6;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a29_0x37ea1c(0x1b7)]=a29_0x37ea1c(0x1d9);[a29_0x37ea1c(0x1c8)]=a29_0x37ea1c(0x1cf);async[a29_0x37ea1c(0x1ca)](_0x703b4e){const _0x1a929a=a29_0x37ea1c,{options:_0x277c0e,args:_0x12c1f3}=_0x703b4e,_0x41d7aa=_0x277c0e,_0x471e64=await resolveTarget({'arg':_0x12c1f3[0x0],'contextParent':_0x277c0e[_0x1a929a(0x1b8)],'cwd':process[_0x1a929a(0x1d5)]()});if(!isSuccessfulResolution(_0x471e64))return _0x471e64[_0x1a929a(0x1dc)]===_0x1a929a(0x1cd)?(console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1ba)](_0x1a929a(0x1da))),console[_0x1a929a(0x1e2)](_0x1a929a(0x1ea)),console['error'](_0x1a929a(0x1dd)),console[_0x1a929a(0x1e2)](_0x1a929a(0x1d4))):(console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1b5)](_0x1a929a(0x1e4)+_0x471e64[_0x1a929a(0x1c6)]+'\x0a')),_0x471e64[_0x1a929a(0x1e1)]&&console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1de)](_0x471e64[_0x1a929a(0x1e1)]))),0x1;const _0xd29c7a=_0x471e64[_0x1a929a(0x1e9)],_0x4956d8=_0x471e64[_0x1a929a(0x1f1)]===_0x1a929a(0x1c2)?_0x471e64[_0x1a929a(0x1b4)]:undefined;if(!_0x4956d8&&!existsSync(_0xd29c7a))return console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1b5)](_0x1a929a(0x1c1)+_0xd29c7a+'\x0a')),0x1;let _0x4555b1;if(_0x4956d8){if(!_0x4956d8[_0x1a929a(0x1c4)](_0x1a929a(0x1e3))&&!_0x4956d8[_0x1a929a(0x1c4)](_0x1a929a(0x1c9)))return console['error'](a29_0x1bfdcd[_0x1a929a(0x1b5)](_0x1a929a(0x1b6)+_0x4956d8+'\x0a')),0x1;_0x4555b1=[_0x4956d8];}else _0x4555b1=findYamlFiles(_0xd29c7a);if(_0x4555b1[_0x1a929a(0x1e8)]===0x0)return console['error'](a29_0x1bfdcd['red'](_0x1a929a(0x1e7)+_0xd29c7a+'\x0a')),0x1;const _0x4a6053=validateYamlFiles(_0x4555b1,_0xd29c7a,{'filterType':'journey'}),_0x3a23ae=calculateSummary(_0x4a6053),_0x5e4df9=_0x4a6053[_0x1a929a(0x1cc)](isValidationResult);if(_0x5e4df9[_0x1a929a(0x1e8)]===0x0)return console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1ba)](_0x1a929a(0x1c7)+_0xd29c7a+'\x0a')),_0x3a23ae['skippedCount']>0x0&&console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1be)]('('+_0x3a23ae[_0x1a929a(0x1c0)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x158487 of _0x4a6053){if(!isValidationResult(_0x158487)){_0x41d7aa[_0x1a929a(0x1d1)]&&console['log'](a29_0x1bfdcd[_0x1a929a(0x1be)]('-\x20'+_0x158487[_0x1a929a(0x1e6)]+_0x1a929a(0x1e0)+_0x158487[_0x1a929a(0x1ec)]+')'));continue;}const {relativePath:_0x5e643a,source:_0x4f6e73,result:_0x5ea7a5}=_0x158487;if(_0x5ea7a5['valid']&&_0x5ea7a5[_0x1a929a(0x1f0)][_0x1a929a(0x1e8)]===0x0)_0x41d7aa[_0x1a929a(0x1d1)]&&console[_0x1a929a(0x1d7)](a29_0x1bfdcd[_0x1a929a(0x1d2)]('✔\x20'+_0x5e643a));else _0x5ea7a5['valid']?(console['log'](a29_0x1bfdcd['yellow']('⚠\x20'+_0x5e643a+':\x20'+_0x5ea7a5['warnings'][_0x1a929a(0x1e8)]+'\x20warning(s)')),console[_0x1a929a(0x1d7)](formatValidationResult(_0x5ea7a5,_0x4f6e73,_0x5e643a))):(console['log'](a29_0x1bfdcd['red']('✖\x20'+_0x5e643a+':\x20'+_0x5ea7a5[_0x1a929a(0x1e5)][_0x1a929a(0x1e8)]+_0x1a929a(0x1d0))),console[_0x1a929a(0x1d7)](formatValidationResult(_0x5ea7a5,_0x4f6e73,_0x5e643a)));}return console['log'](''),_0x3a23ae['hasErrors']?(console[_0x1a929a(0x1d7)](a29_0x1bfdcd[_0x1a929a(0x1b5)](_0x1a929a(0x1df)+_0x3a23ae[_0x1a929a(0x1ce)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x3a23ae[_0x1a929a(0x1bc)]+_0x1a929a(0x1cb))),_0x3a23ae[_0x1a929a(0x1d8)]>0x0&&console[_0x1a929a(0x1d7)](a29_0x1bfdcd[_0x1a929a(0x1ba)](_0x3a23ae[_0x1a929a(0x1d8)]+'\x20warning(s)\x20found')),_0x3a23ae[_0x1a929a(0x1c0)]>0x0&&console[_0x1a929a(0x1d7)](a29_0x1bfdcd['dim'](_0x3a23ae['skippedCount']+_0x1a929a(0x1db))),0x1):(console[_0x1a929a(0x1d7)](a29_0x1bfdcd[_0x1a929a(0x1d2)]('✔\x20All\x20'+_0x3a23ae[_0x1a929a(0x1bc)]+_0x1a929a(0x1ee))),_0x3a23ae[_0x1a929a(0x1d8)]>0x0&&console[_0x1a929a(0x1d7)](a29_0x1bfdcd['yellow'](_0x3a23ae['warningCount']+_0x1a929a(0x1c5))),_0x3a23ae[_0x1a929a(0x1c0)]>0x0&&console['log'](a29_0x1bfdcd[_0x1a929a(0x1be)](_0x3a23ae[_0x1a929a(0x1c0)]+_0x1a929a(0x1db))),0x0);}}
1
+ const a29_0x20675a=a29_0x38b1;(function(_0x3b5943,_0x583c6a){const _0x2b9e4d=a29_0x38b1,_0x151666=_0x3b5943();while(!![]){try{const _0xa13aa4=-parseInt(_0x2b9e4d(0x1ea))/0x1*(-parseInt(_0x2b9e4d(0x1d0))/0x2)+-parseInt(_0x2b9e4d(0x1cc))/0x3+-parseInt(_0x2b9e4d(0x1b7))/0x4+parseInt(_0x2b9e4d(0x1d5))/0x5*(-parseInt(_0x2b9e4d(0x1c8))/0x6)+parseInt(_0x2b9e4d(0x1c9))/0x7*(-parseInt(_0x2b9e4d(0x1e3))/0x8)+parseInt(_0x2b9e4d(0x1b2))/0x9+parseInt(_0x2b9e4d(0x1e1))/0xa;if(_0xa13aa4===_0x583c6a)break;else _0x151666['push'](_0x151666['shift']());}catch(_0x42f47e){_0x151666['push'](_0x151666['shift']());}}}(a29_0x5207,0x4b171));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0x512f6d from'chalk';function a29_0x38b1(_0x83d1a4,_0x51df41){_0x83d1a4=_0x83d1a4-0x1b1;const _0x5207a6=a29_0x5207();let _0x38b1a4=_0x5207a6[_0x83d1a4];return _0x38b1a4;}function a29_0x5207(){const _0x986fdc=['8011160NDxBFK','\x20journey(s)\x20with\x20errors,\x20','8192EUCUym','✔\x20All\x20','reason','warningCount','red','\x20valid','\x20warning(s)\x20found','3GBCOkB','\x20error(s)','2984850NRLgeM','filePath','verbose','green','helpText','1670392HrIpSB','Error:\x20','invalidCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','error','endsWith','\x20journey(s)\x20valid','relativePath','validCount','warnings','description','yellow','filter','log','parentSegment','\x20warning(s)','\x20segment\x20file(s)\x20skipped','44634sIblHt','3801eawbfo','file','errors','472047XffwgS','message','.yml','cwd','342716GLYlxD','skippedCount','targetDir','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','140TKfYoA','\x20segment\x20file(s)\x20skipped)','Validation\x20failed:\x20','dim','Error:\x20Directory\x20not\x20found:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','valid','No\x20journey\x20YAML\x20files\x20found\x20in\x20','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','journey:validate','.yaml'];a29_0x5207=function(){return _0x986fdc;};return a29_0x5207();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a29_0x20675a(0x1df);[a29_0x20675a(0x1c1)]='Validate\x20journey\x20YAML\x20files';async['execute'](_0x2c8509){const _0x363cb0=a29_0x20675a,{options:_0xdc1849,args:_0x4cff08}=_0x2c8509,_0x1afbee=_0xdc1849,_0x3c3aef=await resolveTarget({'arg':_0x4cff08[0x0],'contextParent':_0xdc1849[_0x363cb0(0x1c5)],'cwd':process[_0x363cb0(0x1cf)]()});if(!isSuccessfulResolution(_0x3c3aef))return _0x3c3aef['errorCode']==='no_parent'?(console[_0x363cb0(0x1bb)](a29_0x512f6d[_0x363cb0(0x1c2)](_0x363cb0(0x1da))),console['error']('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console['error'](_0x363cb0(0x1d4)),console[_0x363cb0(0x1bb)](_0x363cb0(0x1de))):(console[_0x363cb0(0x1bb)](a29_0x512f6d[_0x363cb0(0x1e7)](_0x363cb0(0x1b8)+_0x3c3aef[_0x363cb0(0x1cd)]+'\x0a')),_0x3c3aef[_0x363cb0(0x1b6)]&&console[_0x363cb0(0x1bb)](a29_0x512f6d[_0x363cb0(0x1dd)](_0x3c3aef[_0x363cb0(0x1b6)]))),0x1;const _0x159dc6=_0x3c3aef[_0x363cb0(0x1d2)],_0x16fe76=_0x3c3aef['type']===_0x363cb0(0x1ca)?_0x3c3aef[_0x363cb0(0x1b3)]:undefined;if(!_0x16fe76&&!existsSync(_0x159dc6))return console[_0x363cb0(0x1bb)](a29_0x512f6d['red'](_0x363cb0(0x1d9)+_0x159dc6+'\x0a')),0x1;let _0x1ae597;if(_0x16fe76){if(!_0x16fe76[_0x363cb0(0x1bc)](_0x363cb0(0x1ce))&&!_0x16fe76['endsWith'](_0x363cb0(0x1e0)))return console[_0x363cb0(0x1bb)](a29_0x512f6d[_0x363cb0(0x1e7)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x16fe76+'\x0a')),0x1;_0x1ae597=[_0x16fe76];}else _0x1ae597=findYamlFiles(_0x159dc6);if(_0x1ae597[_0x363cb0(0x1d3)]===0x0)return console['error'](a29_0x512f6d[_0x363cb0(0x1e7)](_0x363cb0(0x1ba)+_0x159dc6+'\x0a')),0x1;const _0x3c9879=validateYamlFiles(_0x1ae597,_0x159dc6,{'filterType':'journey'}),_0x24b982=calculateSummary(_0x3c9879),_0xd6970a=_0x3c9879[_0x363cb0(0x1c3)](isValidationResult);if(_0xd6970a['length']===0x0)return console[_0x363cb0(0x1bb)](a29_0x512f6d['yellow'](_0x363cb0(0x1dc)+_0x159dc6+'\x0a')),_0x24b982[_0x363cb0(0x1d1)]>0x0&&console[_0x363cb0(0x1bb)](a29_0x512f6d[_0x363cb0(0x1d8)]('('+_0x24b982[_0x363cb0(0x1d1)]+_0x363cb0(0x1d6))),0x0;for(const _0x59afb8 of _0x3c9879){if(!isValidationResult(_0x59afb8)){_0x1afbee[_0x363cb0(0x1b4)]&&console[_0x363cb0(0x1c4)](a29_0x512f6d['dim']('-\x20'+_0x59afb8[_0x363cb0(0x1be)]+'\x20(skipped:\x20'+_0x59afb8[_0x363cb0(0x1e5)]+')'));continue;}const {relativePath:_0x2801f9,source:_0x4d4cb1,result:_0x36a227}=_0x59afb8;if(_0x36a227[_0x363cb0(0x1db)]&&_0x36a227[_0x363cb0(0x1c0)][_0x363cb0(0x1d3)]===0x0)_0x1afbee['verbose']&&console[_0x363cb0(0x1c4)](a29_0x512f6d[_0x363cb0(0x1b5)]('✔\x20'+_0x2801f9));else _0x36a227[_0x363cb0(0x1db)]?(console[_0x363cb0(0x1c4)](a29_0x512f6d[_0x363cb0(0x1c2)]('⚠\x20'+_0x2801f9+':\x20'+_0x36a227[_0x363cb0(0x1c0)][_0x363cb0(0x1d3)]+_0x363cb0(0x1c6))),console[_0x363cb0(0x1c4)](formatValidationResult(_0x36a227,_0x4d4cb1,_0x2801f9))):(console[_0x363cb0(0x1c4)](a29_0x512f6d['red']('✖\x20'+_0x2801f9+':\x20'+_0x36a227[_0x363cb0(0x1cb)][_0x363cb0(0x1d3)]+_0x363cb0(0x1b1))),console[_0x363cb0(0x1c4)](formatValidationResult(_0x36a227,_0x4d4cb1,_0x2801f9)));}return console[_0x363cb0(0x1c4)](''),_0x24b982['hasErrors']?(console[_0x363cb0(0x1c4)](a29_0x512f6d[_0x363cb0(0x1e7)](_0x363cb0(0x1d7)+_0x24b982[_0x363cb0(0x1b9)]+_0x363cb0(0x1e2)+_0x24b982[_0x363cb0(0x1bf)]+_0x363cb0(0x1e8))),_0x24b982[_0x363cb0(0x1e6)]>0x0&&console[_0x363cb0(0x1c4)](a29_0x512f6d[_0x363cb0(0x1c2)](_0x24b982[_0x363cb0(0x1e6)]+_0x363cb0(0x1e9))),_0x24b982[_0x363cb0(0x1d1)]>0x0&&console['log'](a29_0x512f6d['dim'](_0x24b982[_0x363cb0(0x1d1)]+_0x363cb0(0x1c7))),0x1):(console[_0x363cb0(0x1c4)](a29_0x512f6d[_0x363cb0(0x1b5)](_0x363cb0(0x1e4)+_0x24b982['validCount']+_0x363cb0(0x1bd))),_0x24b982['warningCount']>0x0&&console[_0x363cb0(0x1c4)](a29_0x512f6d['yellow'](_0x24b982['warningCount']+_0x363cb0(0x1e9))),_0x24b982[_0x363cb0(0x1d1)]>0x0&&console[_0x363cb0(0x1c4)](a29_0x512f6d['dim'](_0x24b982[_0x363cb0(0x1d1)]+_0x363cb0(0x1c7))),0x0);}}