@treasuredata/tdx 2026.3.8 → 2026.3.9

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 (208) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.d.ts +2 -2
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/profile.js.map +1 -1
  67. package/dist/core/project-config.js +1 -1
  68. package/dist/core/session.js +1 -1
  69. package/dist/core/user-cache.js +1 -1
  70. package/dist/core/version.js +1 -1
  71. package/dist/index.js +1 -1
  72. package/dist/mcp/server.js +1 -1
  73. package/dist/mcp/tools/index.js +1 -1
  74. package/dist/mcp/tools/tdx-run.js +1 -1
  75. package/dist/mcp/tools/tdx-search.js +1 -1
  76. package/dist/mcp/utils.js +1 -1
  77. package/dist/proxy/claude-usage-tracker.js +1 -1
  78. package/dist/proxy/passthrough-server.js +1 -1
  79. package/dist/proxy/sse-usage-parser.js +1 -1
  80. package/dist/sdk/agent/agent-config.js +1 -1
  81. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  82. package/dist/sdk/agent/agent-yaml.js +1 -1
  83. package/dist/sdk/agent/test/evaluator.js +1 -1
  84. package/dist/sdk/agent/test/executor.js +1 -1
  85. package/dist/sdk/agent/test/index.js +1 -1
  86. package/dist/sdk/agent/test/output.js +1 -1
  87. package/dist/sdk/agent/test/parser.js +1 -1
  88. package/dist/sdk/agent/tool-target-registry.js +1 -1
  89. package/dist/sdk/api.js +1 -1
  90. package/dist/sdk/client/cdp-api-client.js +1 -1
  91. package/dist/sdk/client/delivery-api-client.js +1 -1
  92. package/dist/sdk/client/endpoints.js +1 -1
  93. package/dist/sdk/client/endpoints.js.map +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/oauth-refresh.d.ts +1 -1
  98. package/dist/sdk/client/oauth-refresh.js +1 -1
  99. package/dist/sdk/client/rate-limiter.js +1 -1
  100. package/dist/sdk/client/td-api-client.js +1 -1
  101. package/dist/sdk/client/trino-api-client.js +1 -1
  102. package/dist/sdk/client/workflow-client.js +1 -1
  103. package/dist/sdk/connection-validator.js +1 -1
  104. package/dist/sdk/connection.js +1 -1
  105. package/dist/sdk/delivery.js +1 -1
  106. package/dist/sdk/engage/campaign-pull.js +1 -1
  107. package/dist/sdk/engage/campaign-push.js +1 -1
  108. package/dist/sdk/engage/campaign-validator.js +1 -1
  109. package/dist/sdk/engage/campaign-yaml.js +1 -1
  110. package/dist/sdk/engage/template-pull.js +1 -1
  111. package/dist/sdk/engage/template-push.js +1 -1
  112. package/dist/sdk/engage/template-validator.js +1 -1
  113. package/dist/sdk/engage/template-yaml.js +1 -1
  114. package/dist/sdk/engage/types/campaign-def.js +1 -1
  115. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  116. package/dist/sdk/engage/types/template-schema.js +1 -1
  117. package/dist/sdk/engage.js +1 -1
  118. package/dist/sdk/errors.js +1 -1
  119. package/dist/sdk/index.js +1 -1
  120. package/dist/sdk/io/index.js +1 -1
  121. package/dist/sdk/io/node-filesystem.js +1 -1
  122. package/dist/sdk/job.js +1 -1
  123. package/dist/sdk/journey.js +1 -1
  124. package/dist/sdk/llm/chat-cache.js +1 -1
  125. package/dist/sdk/llm/index.js +1 -1
  126. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  127. package/dist/sdk/llm/model-factors.js +1 -1
  128. package/dist/sdk/personalization.js +1 -1
  129. package/dist/sdk/query/index.js +1 -1
  130. package/dist/sdk/query/sql-parser.js +1 -1
  131. package/dist/sdk/realtime.js +1 -1
  132. package/dist/sdk/schedule.js +1 -1
  133. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/fields-display.js +1 -1
  135. package/dist/sdk/segment/file-discovery.js +1 -1
  136. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  137. package/dist/sdk/segment/journey-utils.js +1 -1
  138. package/dist/sdk/segment/journey-utils.js.map +1 -1
  139. package/dist/sdk/segment/journey-validator.js +1 -1
  140. package/dist/sdk/segment/journey-yaml.js +1 -1
  141. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  142. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  143. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  144. package/dist/sdk/segment/pull-workflow.js +1 -1
  145. package/dist/sdk/segment/push-recovery.js +1 -1
  146. package/dist/sdk/segment/push-workflow.js +1 -1
  147. package/dist/sdk/segment/resolution-context.js +1 -1
  148. package/dist/sdk/segment/segment-path-parser.js +1 -1
  149. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  150. package/dist/sdk/segment/segment-validator.js +1 -1
  151. package/dist/sdk/segment/target-resolution.js +1 -1
  152. package/dist/sdk/segment/tdx-config.js +1 -1
  153. package/dist/sdk/segment/types/activation-schema.js +1 -1
  154. package/dist/sdk/segment/types/journey-def.js +1 -1
  155. package/dist/sdk/segment/types/journey-schema.js +1 -1
  156. package/dist/sdk/segment/types/segment-def.js +1 -1
  157. package/dist/sdk/segment/types/segment-schema.js +1 -1
  158. package/dist/sdk/segment/validate-files.js +1 -1
  159. package/dist/sdk/segment/yaml-validator.js +1 -1
  160. package/dist/sdk/segment.js +1 -1
  161. package/dist/sdk/types/index.js +1 -1
  162. package/dist/sdk/types/progress.js +1 -1
  163. package/dist/sdk/user.js +1 -1
  164. package/dist/sdk/util/format-detector.js +1 -1
  165. package/dist/sdk/util/formatters.js +1 -1
  166. package/dist/sdk/util/index.js +1 -1
  167. package/dist/sdk/util/paginate.js +1 -1
  168. package/dist/sdk/util/tree-formatter.js +1 -1
  169. package/dist/sdk/workflow/archive-validation.js +1 -1
  170. package/dist/sdk/workflow/clone-workflow.js +1 -1
  171. package/dist/sdk/workflow/index.js +1 -1
  172. package/dist/sdk/workflow/pull-workflow.js +1 -1
  173. package/dist/sdk/workflow/push-workflow.js +1 -1
  174. package/dist/sdk/workflow/tdx-config.js +1 -1
  175. package/dist/sdk/workflow/workflow-utils.js +1 -1
  176. package/dist/test-utils/command-runner.js +1 -1
  177. package/dist/test-utils/factories.js +1 -1
  178. package/dist/test-utils/fixtures.js +1 -1
  179. package/dist/test-utils/http-mock.js +1 -1
  180. package/dist/test-utils/index.js +1 -1
  181. package/dist/utils/async.js +1 -1
  182. package/dist/utils/colors.js +1 -1
  183. package/dist/utils/diff.js +1 -1
  184. package/dist/utils/file-permissions.js +1 -1
  185. package/dist/utils/file-reader.js +1 -1
  186. package/dist/utils/github-releases.js +1 -1
  187. package/dist/utils/global-cache.js +1 -1
  188. package/dist/utils/json-loader.js +1 -1
  189. package/dist/utils/local-cache.js +1 -1
  190. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  191. package/dist/utils/logger/formatters/index.js +1 -1
  192. package/dist/utils/logger/handlers/console-handler.js +1 -1
  193. package/dist/utils/logger/handlers/file-handler.js +1 -1
  194. package/dist/utils/logger/handlers/index.js +1 -1
  195. package/dist/utils/logger/handlers/null-handler.js +1 -1
  196. package/dist/utils/logger/index.js +1 -1
  197. package/dist/utils/logger/logger.js +1 -1
  198. package/dist/utils/logger/types.js +1 -1
  199. package/dist/utils/option-validation.js +1 -1
  200. package/dist/utils/process.js +1 -1
  201. package/dist/utils/prompt.js +1 -1
  202. package/dist/utils/spinner.js +1 -1
  203. package/dist/utils/sse-parser.js +1 -1
  204. package/dist/utils/string-utils.js +1 -1
  205. package/dist/utils/table-ref-parser.js +1 -1
  206. package/dist/utils/tdx-logger.js +1 -1
  207. package/dist/utils/version-check.js +1 -1
  208. package/package.json +1 -1
@@ -1 +1 @@
1
- const a25_0x51f3e5=a25_0x33a9;(function(_0x1339e7,_0x339d49){const _0x525b43=a25_0x33a9,_0x38bf73=_0x1339e7();while(!![]){try{const _0x56580e=-parseInt(_0x525b43(0x15d))/0x1+-parseInt(_0x525b43(0x193))/0x2+parseInt(_0x525b43(0x16f))/0x3+parseInt(_0x525b43(0x172))/0x4*(parseInt(_0x525b43(0x194))/0x5)+-parseInt(_0x525b43(0x1a3))/0x6+-parseInt(_0x525b43(0x160))/0x7*(parseInt(_0x525b43(0x183))/0x8)+parseInt(_0x525b43(0x155))/0x9;if(_0x56580e===_0x339d49)break;else _0x38bf73['push'](_0x38bf73['shift']());}catch(_0x1ca123){_0x38bf73['push'](_0x38bf73['shift']());}}}(a25_0x4dbf,0x4c8b8));import{BaseCommand}from'./command.js';function a25_0x33a9(_0x2df598,_0x5f5b62){_0x2df598=_0x2df598-0x14e;const _0x4dbf04=a25_0x4dbf();let _0x33a902=_0x4dbf04[_0x2df598];return _0x33a902;}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 a25_0x167475 from'chalk';function formatDuration(_0x5b2017){const _0x4ba5dc=a25_0x33a9;if(_0x5b2017<0x3c)return _0x5b2017+'s';if(_0x5b2017<0xe10)return Math[_0x4ba5dc(0x18c)](_0x5b2017/0x3c)+'m\x20'+_0x5b2017%0x3c+'s';const _0x56c7e7=Math[_0x4ba5dc(0x18c)](_0x5b2017/0xe10),_0x40307a=Math[_0x4ba5dc(0x18c)](_0x5b2017%0xe10/0x3c);return _0x40307a>0x0?_0x56c7e7+'h\x20'+_0x40307a+'m':_0x56c7e7+'h';}function formatRelativeTime(_0xf00b5e){const _0x401069=a25_0x33a9,_0x9b7301=Date[_0x401069(0x167)]()-_0xf00b5e[_0x401069(0x166)](),_0x5823b6=Math[_0x401069(0x18c)](Math[_0x401069(0x17f)](_0x9b7301)/0x3e8);if(_0x5823b6<0x3c)return _0x401069(0x164);const _0x130352=Math[_0x401069(0x18c)](_0x5823b6/0x3c);if(_0x130352<0x3c)return _0x130352+_0x401069(0x18e);const _0x182305=Math[_0x401069(0x18c)](_0x130352/0x3c);if(_0x182305<0x18)return _0x182305+_0x401069(0x150);const _0xcb0e3d=Math[_0x401069(0x18c)](_0x182305/0x18);if(_0xcb0e3d<0x1e)return _0xcb0e3d+_0x401069(0x157);return Math[_0x401069(0x18c)](_0xcb0e3d/0x1e)+_0x401069(0x1a6);}export class JobListCommand extends BaseCommand{[a25_0x51f3e5(0x19b)]=a25_0x51f3e5(0x15a);[a25_0x51f3e5(0x186)]=a25_0x51f3e5(0x14f);async[a25_0x51f3e5(0x179)](_0x13003f){const _0x25c9fd=a25_0x51f3e5,{options:_0x3d238f,tdx:_0x2fe8d1}=_0x13003f,_0x189fb1=resolveLimit(_0x3d238f[_0x25c9fd(0x181)],DEFAULT_DISPLAY_LIMIT),_0x259772=_0x3d238f[_0x25c9fd(0x19f)];_0x3d238f['verbose']&&(console[_0x25c9fd(0x173)](_0x25c9fd(0x1a7)+_0x189fb1+_0x25c9fd(0x16e)),_0x259772&&console['error'](_0x25c9fd(0x19a)+_0x259772));const _0x5c119e=await withSpinner(_0x25c9fd(0x1a0),()=>_0x2fe8d1[_0x25c9fd(0x15a)][_0x25c9fd(0x19c)]({'from':0x0,'to':_0x189fb1-0x1,'status':_0x259772}),{'verbose':_0x3d238f['verbose']}),_0x4337a6=_0x5c119e[_0x25c9fd(0x19d)];console['error']('✔\x20Found\x20'+_0x4337a6[_0x25c9fd(0x15c)]+_0x25c9fd(0x168)+(_0x4337a6[_0x25c9fd(0x15c)]!==0x1?'s':''));const _0x33361f=_0x3d238f[_0x25c9fd(0x17a)];if(isStructuredFormat(_0x3d238f)){const _0x4842ac=_0x4337a6[_0x25c9fd(0x16b)](_0x2250b0=>{const _0x2dc924=_0x25c9fd;let _0x14d1f3;if(_0x2250b0[_0x2dc924(0x15e)]&&_0x2250b0[_0x2dc924(0x180)]){const _0x5319b6=new Date(_0x2250b0[_0x2dc924(0x15e)])[_0x2dc924(0x166)](),_0x52a94e=new Date(_0x2250b0['end_at'])[_0x2dc924(0x166)]();_0x14d1f3=Math[_0x2dc924(0x161)]((_0x52a94e-_0x5319b6)/0x3e8);}return{'job_id':_0x2250b0['job_id'],'type':_0x2250b0[_0x2dc924(0x1a2)]===_0x2dc924(0x169)?_0x2dc924(0x16d):_0x2250b0['type'],'status':_0x2250b0[_0x2dc924(0x19f)],'user_name':_0x2250b0['user_name'],'duration_sec':_0x14d1f3,'created_at':_0x2250b0[_0x2dc924(0x17e)],'started_at':_0x2250b0[_0x2dc924(0x15e)],'end_at':_0x2250b0[_0x2dc924(0x180)]};});await handleSDKOutput(_0x4842ac,_0x3d238f);}else for(const _0x3f6f10 of _0x4337a6){const _0x4c8411=_0x3f6f10[_0x25c9fd(0x19f)]==='success'?a25_0x167475[_0x25c9fd(0x196)]:_0x3f6f10['status']==='error'?a25_0x167475['red']:a25_0x167475['dim'],_0xb78830=_0x4c8411(_0x3f6f10[_0x25c9fd(0x19f)]),_0x56bb86=getJobUrl(_0x33361f,_0x3f6f10[_0x25c9fd(0x16a)]),_0x2ee65a=hyperlink(_0x3f6f10[_0x25c9fd(0x16a)],_0x56bb86),_0xa25ce6=a25_0x167475[_0x25c9fd(0x18a)](_0x3f6f10[_0x25c9fd(0x1a2)]===_0x25c9fd(0x169)?_0x25c9fd(0x16d):_0x3f6f10[_0x25c9fd(0x1a2)]),_0x3c4417=[];if(_0x3f6f10[_0x25c9fd(0x15e)]&&_0x3f6f10[_0x25c9fd(0x180)]){const _0x2799ce=Math[_0x25c9fd(0x161)]((new Date(_0x3f6f10[_0x25c9fd(0x180)])[_0x25c9fd(0x166)]()-new Date(_0x3f6f10[_0x25c9fd(0x15e)])[_0x25c9fd(0x166)]())/0x3e8);_0x3c4417[_0x25c9fd(0x171)](formatDuration(_0x2799ce));}if(_0x3f6f10[_0x25c9fd(0x180)])_0x3c4417[_0x25c9fd(0x171)](formatRelativeTime(new Date(_0x3f6f10[_0x25c9fd(0x180)])));else _0x3f6f10['start_at']&&_0x3c4417[_0x25c9fd(0x171)](formatRelativeTime(new Date(_0x3f6f10[_0x25c9fd(0x15e)])));const _0x3275ac=_0x3c4417[_0x25c9fd(0x15c)]>0x0?a25_0x167475[_0x25c9fd(0x18a)]('\x20'+_0x3c4417[_0x25c9fd(0x174)](',\x20')):'';console[_0x25c9fd(0x17d)]('⚡\x20'+_0x2ee65a+'\x20'+_0xa25ce6+'\x20'+_0xb78830+_0x3275ac);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a25_0x51f3e5(0x191);[a25_0x51f3e5(0x186)]='Show\x20job\x20details';[a25_0x51f3e5(0x178)](_0x689102){const _0x49c4fb=a25_0x51f3e5,_0x436a0c=_0x689102[_0x49c4fb(0x153)][0x0];if(!_0x436a0c)return _0x49c4fb(0x1a5);return undefined;}async[a25_0x51f3e5(0x179)](_0x96e13e){const _0x23c54a=a25_0x51f3e5,{options:_0x2ef999,args:_0x39dcd8,tdx:_0x1377de}=_0x96e13e,_0x3cfe38=_0x39dcd8[0x0],_0x25c22d=await withSpinner(_0x23c54a(0x185),()=>_0x1377de[_0x23c54a(0x15a)]['show'](_0x3cfe38),{'verbose':_0x2ef999['verbose']}),_0x11f05=_0x25c22d['data'];let _0x400cc3;if(_0x11f05['start_at']&&_0x11f05[_0x23c54a(0x180)]){const _0xbf1982=new Date(_0x11f05[_0x23c54a(0x15e)])[_0x23c54a(0x166)](),_0x55dc78=new Date(_0x11f05['end_at'])[_0x23c54a(0x166)]();_0x400cc3=Math[_0x23c54a(0x161)]((_0x55dc78-_0xbf1982)/0x3e8);}const _0x1ca84e={'job_id':_0x11f05[_0x23c54a(0x16a)],'type':_0x11f05[_0x23c54a(0x1a2)],'status':_0x11f05[_0x23c54a(0x19f)],..._0x11f05[_0x23c54a(0x162)]&&{'user_name':_0x11f05[_0x23c54a(0x162)]},..._0x400cc3!==undefined&&{'duration_sec':_0x400cc3},..._0x11f05[_0x23c54a(0x17e)]&&{'created_at':_0x11f05['created_at']},..._0x11f05[_0x23c54a(0x15e)]&&{'started_at':_0x11f05['start_at']},..._0x11f05[_0x23c54a(0x180)]&&{'end_at':_0x11f05[_0x23c54a(0x180)]},..._0x11f05[_0x23c54a(0x158)]&&{'database':_0x11f05[_0x23c54a(0x158)]},..._0x11f05['priority']!==undefined&&{'priority':_0x11f05[_0x23c54a(0x195)]},..._0x11f05[_0x23c54a(0x159)]&&{'url':_0x11f05[_0x23c54a(0x159)]},..._0x11f05['query']&&{'query':_0x11f05[_0x23c54a(0x18f)]},..._0x11f05['debug']&&{'debug':_0x11f05[_0x23c54a(0x190)]}};return await handleSingleObjectOutput(_0x1ca84e,_0x2ef999),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0x51f3e5(0x19b)]='job:kill';[a25_0x51f3e5(0x186)]=a25_0x51f3e5(0x170);[a25_0x51f3e5(0x178)](_0x2baa6f){const _0x2ca47b=a25_0x51f3e5,_0x1a3d3a=_0x2baa6f['args'][0x0];if(!_0x1a3d3a)return _0x2ca47b(0x18d);return undefined;}async[a25_0x51f3e5(0x179)](_0xca811d){const _0x1a0772=a25_0x51f3e5,{options:_0x524005,args:_0x207329,tdx:_0x2b58d1}=_0xca811d,_0x4b98d3=_0x207329[0x0];if(!_0x524005[_0x1a0772(0x151)]){const _0x4288e7=await confirm(_0x1a0772(0x177)+_0x4b98d3+'?');if(!_0x4288e7)return console['error'](_0x1a0772(0x184)),0x0;}return await withSpinner(_0x1a0772(0x17c),()=>_0x2b58d1[_0x1a0772(0x15a)][_0x1a0772(0x176)](_0x4b98d3),{'verbose':_0x524005[_0x1a0772(0x152)]}),console[_0x1a0772(0x173)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x4b98d3),console[_0x1a0772(0x173)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x4b98d3+_0x1a0772(0x17b)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a25_0x51f3e5(0x186)]='Submit\x20a\x20job';async[a25_0x51f3e5(0x179)](_0x112c20){const _0x29d1f0=a25_0x51f3e5,{options:_0x5f2be1,args:_0x27431d,tdx:_0x5ed8b0}=_0x112c20,_0x567157=_0x5f2be1[_0x29d1f0(0x15b)]||_0x29d1f0(0x16d),_0x3d2d76=_0x5f2be1['file'],_0x59d8ef=_0x5f2be1['database']||_0x29d1f0(0x1a4),_0x4660a9=_0x5f2be1['result'];if(_0x567157!==_0x29d1f0(0x16d)&&_0x567157!==_0x29d1f0(0x199))throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],_0x29d1f0(0x16c));let _0x12ce12;if(_0x3d2d76){if(_0x27431d[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x29d1f0(0x156));const _0x1e6e22=readSqlStatementsFromFile(_0x3d2d76);if(_0x1e6e22[_0x29d1f0(0x15c)]===0x0)throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],_0x29d1f0(0x192));if(_0x1e6e22[_0x29d1f0(0x15c)]>0x1)throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x12ce12=_0x1e6e22[0x0];}else{if(!_0x27431d[0x0])throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],_0x29d1f0(0x187));_0x12ce12=_0x27431d[0x0];}_0x5f2be1[_0x29d1f0(0x152)]&&(console[_0x29d1f0(0x173)](_0x29d1f0(0x1a1)+_0x567157),console[_0x29d1f0(0x173)](_0x29d1f0(0x15f)+_0x59d8ef),console['error'](_0x29d1f0(0x175)+_0x12ce12[_0x29d1f0(0x165)](0x0,0x64)+(_0x12ce12[_0x29d1f0(0x15c)]>0x64?'...':'')));const _0x3ed056=await withSpinner('Submitting\x20job...',()=>_0x5ed8b0['jobs'][_0x29d1f0(0x198)](_0x59d8ef,_0x12ce12,_0x567157,_0x4660a9),{'verbose':_0x5f2be1[_0x29d1f0(0x152)]}),_0x435f20=_0x3ed056[_0x29d1f0(0x19d)];return console[_0x29d1f0(0x173)](_0x29d1f0(0x197)),console[_0x29d1f0(0x173)](_0x29d1f0(0x163)+_0x435f20[_0x29d1f0(0x16a)]),await handleSDKOutput([_0x435f20],_0x5f2be1),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x51f3e5(0x19b)]=a25_0x51f3e5(0x182);[a25_0x51f3e5(0x186)]=a25_0x51f3e5(0x189);['validate'](_0x28042a){const _0x34c0ed=a25_0x51f3e5,_0x5ed053=_0x28042a['args'][0x0];if(!_0x5ed053)return _0x34c0ed(0x188);return undefined;}async['execute'](_0x27a57a){const _0x1efd24=a25_0x51f3e5,{options:_0x422fe3,args:_0x5d8cd1,tdx:_0x3ab41b}=_0x27a57a,_0x4678a2=_0x5d8cd1[0x0],_0x1b15d8=await withSpinner('Getting\x20job\x20results...',()=>_0x3ab41b[_0x1efd24(0x15a)][_0x1efd24(0x19e)](_0x4678a2),{'verbose':_0x422fe3[_0x1efd24(0x152)]}),_0x599b1a=_0x1b15d8[_0x1efd24(0x19d)];return console['error'](_0x1efd24(0x154)+_0x599b1a['length']+_0x1efd24(0x18b)+(_0x599b1a[_0x1efd24(0x15c)]!==0x1?'s':'')),await handleSDKOutput(_0x599b1a,_0x422fe3),0x0;}}function a25_0x4dbf(){const _0x18b077=['presto','job_id','map','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','trino','\x20jobs','1804131mChaIM','Kill\x20a\x20job','push','344OIClYL','error','join','Query:\x20','kill','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','validate','execute','site','\x27\x20to\x20verify\x20the\x20job\x20status','Submitting\x20kill\x20request...','log','created_at','abs','end_at','limit','job:result','2904npjMgt','Cancelled','Getting\x20job\x20details...','description','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Get\x20job\x20results','dim','\x20row','floor','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','m\x20ago','query','debug','job:show','No\x20SQL\x20statements\x20found\x20in\x20file','919178rkVWNG','9810NkJZhj','priority','green','✔\x20Job\x20submitted','submit','hive','Status\x20filter:\x20','name','list','data','result','status','Listing\x20jobs...','Job\x20type:\x20','type','2816340slVGWY','information_schema','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','mo\x20ago','Limit:\x20','INVALID_ARGUMENT','List\x20jobs','h\x20ago','yes','verbose','args','✔\x20Retrieved\x20','7006806HUsUif','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','d\x20ago','database','url','jobs','jobType','length','169285bYIzeb','start_at','Database:\x20','2639GYaKwI','round','user_name','\x20\x20Job\x20ID:\x20','just\x20now','substring','getTime','now','\x20job'];a25_0x4dbf=function(){return _0x18b077;};return a25_0x4dbf();}
1
+ const a25_0x33445c=a25_0x401e;(function(_0x34872c,_0xad22fe){const _0x373817=a25_0x401e,_0x256fc9=_0x34872c();while(!![]){try{const _0x2dd890=parseInt(_0x373817(0x1d0))/0x1*(parseInt(_0x373817(0x20d))/0x2)+parseInt(_0x373817(0x1de))/0x3*(-parseInt(_0x373817(0x1e5))/0x4)+-parseInt(_0x373817(0x21f))/0x5+-parseInt(_0x373817(0x1d9))/0x6+parseInt(_0x373817(0x21b))/0x7*(-parseInt(_0x373817(0x203))/0x8)+-parseInt(_0x373817(0x200))/0x9+-parseInt(_0x373817(0x217))/0xa*(-parseInt(_0x373817(0x1f7))/0xb);if(_0x2dd890===_0xad22fe)break;else _0x256fc9['push'](_0x256fc9['shift']());}catch(_0x3b5a67){_0x256fc9['push'](_0x256fc9['shift']());}}}(a25_0x1b7d,0x3d9d1));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';function a25_0x401e(_0x3be3f3,_0x25ec1e){_0x3be3f3=_0x3be3f3-0x1cf;const _0x1b7de2=a25_0x1b7d();let _0x401e49=_0x1b7de2[_0x3be3f3];return _0x401e49;}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a25_0x80d93f from'chalk';function a25_0x1b7d(){const _0x2933df=['324320ZFqCOQ','name','error','success','24318xJxSof','presto','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','length','1653250ksDwaT','file','\x20job','data','Show\x20job\x20details','kill','Submitting\x20kill\x20request...','3slkMBX','h\x20ago','verbose','Get\x20job\x20results','status','hive','List\x20jobs','job_id','\x20row','628698CXtHej','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','job:show','substring','information_schema','5361bDmrLJ','site','d\x20ago','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','getTime','mo\x20ago','push','1068IxcSUo','m\x20ago','Cancelled','round','query','red','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','end_at','jobType','floor','now','created_at','jobs','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','debug','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','yes','INVALID_ARGUMENT','484JweEwS','job:submit','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Query:\x20','show','database','type','job:kill','submit','1518696LJHsfO','url','description','1080jfivtQ','result','Listing\x20jobs...','start_at','Getting\x20job\x20details...','args','user_name','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Getting\x20job\x20results...','dim','250438jNJYSj','list','...','No\x20SQL\x20statements\x20found\x20in\x20file','validate','Submit\x20a\x20job','trino','Status\x20filter:\x20','execute','priority'];a25_0x1b7d=function(){return _0x2933df;};return a25_0x1b7d();}function formatDuration(_0xb0d11b){const _0x29b6e7=a25_0x401e;if(_0xb0d11b<0x3c)return _0xb0d11b+'s';if(_0xb0d11b<0xe10)return Math[_0x29b6e7(0x1ee)](_0xb0d11b/0x3c)+'m\x20'+_0xb0d11b%0x3c+'s';const _0x5f1b36=Math[_0x29b6e7(0x1ee)](_0xb0d11b/0xe10),_0x2a1aee=Math['floor'](_0xb0d11b%0xe10/0x3c);return _0x2a1aee>0x0?_0x5f1b36+'h\x20'+_0x2a1aee+'m':_0x5f1b36+'h';}function formatRelativeTime(_0x2bd727){const _0x27a91a=a25_0x401e,_0x549583=Date[_0x27a91a(0x1ef)]()-_0x2bd727[_0x27a91a(0x1e2)](),_0x59a963=Math['floor'](Math['abs'](_0x549583)/0x3e8);if(_0x59a963<0x3c)return'just\x20now';const _0x436676=Math[_0x27a91a(0x1ee)](_0x59a963/0x3c);if(_0x436676<0x3c)return _0x436676+_0x27a91a(0x1e6);const _0x219fad=Math['floor'](_0x436676/0x3c);if(_0x219fad<0x18)return _0x219fad+_0x27a91a(0x1d1);const _0x1a2d55=Math[_0x27a91a(0x1ee)](_0x219fad/0x18);if(_0x1a2d55<0x1e)return _0x1a2d55+_0x27a91a(0x1e0);return Math['floor'](_0x1a2d55/0x1e)+_0x27a91a(0x1e3);}export class JobListCommand extends BaseCommand{[a25_0x33445c(0x218)]=a25_0x33445c(0x1f1);[a25_0x33445c(0x202)]=a25_0x33445c(0x1d6);async['execute'](_0x598480){const _0xfeb5f3=a25_0x33445c,{options:_0x224163,tdx:_0x41df2a}=_0x598480,_0x16c276=resolveLimit(_0x224163['limit'],DEFAULT_DISPLAY_LIMIT),_0x22c2ba=_0x224163[_0xfeb5f3(0x1d4)];_0x224163[_0xfeb5f3(0x1d2)]&&(console['error']('Limit:\x20'+_0x16c276+'\x20jobs'),_0x22c2ba&&console[_0xfeb5f3(0x219)](_0xfeb5f3(0x214)+_0x22c2ba));const _0x31bf17=await withSpinner(_0xfeb5f3(0x205),()=>_0x41df2a['jobs'][_0xfeb5f3(0x20e)]({'from':0x0,'to':_0x16c276-0x1,'status':_0x22c2ba}),{'verbose':_0x224163[_0xfeb5f3(0x1d2)]}),_0x480846=_0x31bf17[_0xfeb5f3(0x222)];console[_0xfeb5f3(0x219)]('✔\x20Found\x20'+_0x480846['length']+_0xfeb5f3(0x221)+(_0x480846[_0xfeb5f3(0x21e)]!==0x1?'s':''));const _0xc25006=_0x224163[_0xfeb5f3(0x1df)];if(isStructuredFormat(_0x224163)){const _0x582259=_0x480846['map'](_0x1c687c=>{const _0x167bbc=_0xfeb5f3;let _0x5a9956;if(_0x1c687c[_0x167bbc(0x206)]&&_0x1c687c[_0x167bbc(0x1ec)]){const _0xba0b58=new Date(_0x1c687c['start_at'])[_0x167bbc(0x1e2)](),_0x30b457=new Date(_0x1c687c[_0x167bbc(0x1ec)])[_0x167bbc(0x1e2)]();_0x5a9956=Math[_0x167bbc(0x1e8)]((_0x30b457-_0xba0b58)/0x3e8);}return{'job_id':_0x1c687c[_0x167bbc(0x1d7)],'type':_0x1c687c[_0x167bbc(0x1fd)]===_0x167bbc(0x21c)?_0x167bbc(0x213):_0x1c687c[_0x167bbc(0x1fd)],'status':_0x1c687c[_0x167bbc(0x1d4)],'user_name':_0x1c687c[_0x167bbc(0x209)],'duration_sec':_0x5a9956,'created_at':_0x1c687c[_0x167bbc(0x1f0)],'started_at':_0x1c687c[_0x167bbc(0x206)],'end_at':_0x1c687c['end_at']};});await handleSDKOutput(_0x582259,_0x224163);}else for(const _0x66f4c0 of _0x480846){const _0x344aed=_0x66f4c0[_0xfeb5f3(0x1d4)]===_0xfeb5f3(0x21a)?a25_0x80d93f['green']:_0x66f4c0[_0xfeb5f3(0x1d4)]===_0xfeb5f3(0x219)?a25_0x80d93f[_0xfeb5f3(0x1ea)]:a25_0x80d93f[_0xfeb5f3(0x20c)],_0x2e2f67=_0x344aed(_0x66f4c0[_0xfeb5f3(0x1d4)]),_0x982cd9=getJobUrl(_0xc25006,_0x66f4c0[_0xfeb5f3(0x1d7)]),_0x4b0732=hyperlink(_0x66f4c0['job_id'],_0x982cd9),_0x567fbb=a25_0x80d93f[_0xfeb5f3(0x20c)](_0x66f4c0[_0xfeb5f3(0x1fd)]===_0xfeb5f3(0x21c)?_0xfeb5f3(0x213):_0x66f4c0[_0xfeb5f3(0x1fd)]),_0x19ffc7=[];if(_0x66f4c0[_0xfeb5f3(0x206)]&&_0x66f4c0['end_at']){const _0x441f49=Math[_0xfeb5f3(0x1e8)]((new Date(_0x66f4c0['end_at'])[_0xfeb5f3(0x1e2)]()-new Date(_0x66f4c0[_0xfeb5f3(0x206)])[_0xfeb5f3(0x1e2)]())/0x3e8);_0x19ffc7[_0xfeb5f3(0x1e4)](formatDuration(_0x441f49));}if(_0x66f4c0['end_at'])_0x19ffc7[_0xfeb5f3(0x1e4)](formatRelativeTime(new Date(_0x66f4c0['end_at'])));else _0x66f4c0['start_at']&&_0x19ffc7[_0xfeb5f3(0x1e4)](formatRelativeTime(new Date(_0x66f4c0[_0xfeb5f3(0x206)])));const _0x564655=_0x19ffc7['length']>0x0?a25_0x80d93f[_0xfeb5f3(0x20c)]('\x20'+_0x19ffc7['join'](',\x20')):'';console['log']('⚡\x20'+_0x4b0732+'\x20'+_0x567fbb+'\x20'+_0x2e2f67+_0x564655);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a25_0x33445c(0x218)]=a25_0x33445c(0x1db);[a25_0x33445c(0x202)]=a25_0x33445c(0x223);[a25_0x33445c(0x211)](_0x58a66e){const _0x4f9d9e=a25_0x33445c,_0x8e5650=_0x58a66e[_0x4f9d9e(0x208)][0x0];if(!_0x8e5650)return _0x4f9d9e(0x1da);return undefined;}async[a25_0x33445c(0x215)](_0x26898d){const _0x54c595=a25_0x33445c,{options:_0x525594,args:_0x48676d,tdx:_0x27333b}=_0x26898d,_0x5b79ac=_0x48676d[0x0],_0x147e1f=await withSpinner(_0x54c595(0x207),()=>_0x27333b['jobs'][_0x54c595(0x1fb)](_0x5b79ac),{'verbose':_0x525594['verbose']}),_0x1d083d=_0x147e1f[_0x54c595(0x222)];let _0x59a5aa;if(_0x1d083d[_0x54c595(0x206)]&&_0x1d083d[_0x54c595(0x1ec)]){const _0x5e0377=new Date(_0x1d083d[_0x54c595(0x206)])['getTime'](),_0x49ba6c=new Date(_0x1d083d[_0x54c595(0x1ec)])[_0x54c595(0x1e2)]();_0x59a5aa=Math[_0x54c595(0x1e8)]((_0x49ba6c-_0x5e0377)/0x3e8);}const _0x535229={'job_id':_0x1d083d[_0x54c595(0x1d7)],'type':_0x1d083d[_0x54c595(0x1fd)],'status':_0x1d083d[_0x54c595(0x1d4)],..._0x1d083d[_0x54c595(0x209)]&&{'user_name':_0x1d083d[_0x54c595(0x209)]},..._0x59a5aa!==undefined&&{'duration_sec':_0x59a5aa},..._0x1d083d[_0x54c595(0x1f0)]&&{'created_at':_0x1d083d[_0x54c595(0x1f0)]},..._0x1d083d[_0x54c595(0x206)]&&{'started_at':_0x1d083d[_0x54c595(0x206)]},..._0x1d083d['end_at']&&{'end_at':_0x1d083d[_0x54c595(0x1ec)]},..._0x1d083d[_0x54c595(0x1fc)]&&{'database':_0x1d083d[_0x54c595(0x1fc)]},..._0x1d083d[_0x54c595(0x216)]!==undefined&&{'priority':_0x1d083d['priority']},..._0x1d083d[_0x54c595(0x201)]&&{'url':_0x1d083d[_0x54c595(0x201)]},..._0x1d083d[_0x54c595(0x1e9)]&&{'query':_0x1d083d[_0x54c595(0x1e9)]},..._0x1d083d['debug']&&{'debug':_0x1d083d[_0x54c595(0x1f3)]}};return await handleSingleObjectOutput(_0x535229,_0x525594),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0x33445c(0x218)]=a25_0x33445c(0x1fe);[a25_0x33445c(0x202)]='Kill\x20a\x20job';['validate'](_0x3b9cb3){const _0x57c968=a25_0x33445c,_0x189317=_0x3b9cb3[_0x57c968(0x208)][0x0];if(!_0x189317)return _0x57c968(0x20a);return undefined;}async['execute'](_0x4dde35){const _0x651319=a25_0x33445c,{options:_0x3c9494,args:_0x17601d,tdx:_0x218e7d}=_0x4dde35,_0x3fb743=_0x17601d[0x0];if(!_0x3c9494[_0x651319(0x1f5)]){const _0x1c81c6=await confirm(_0x651319(0x1f4)+_0x3fb743+'?');if(!_0x1c81c6)return console['error'](_0x651319(0x1e7)),0x0;}return await withSpinner(_0x651319(0x1cf),()=>_0x218e7d['jobs'][_0x651319(0x224)](_0x3fb743),{'verbose':_0x3c9494[_0x651319(0x1d2)]}),console[_0x651319(0x219)](_0x651319(0x1eb)+_0x3fb743),console[_0x651319(0x219)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x3fb743+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a25_0x33445c(0x218)]=a25_0x33445c(0x1f8);['description']=a25_0x33445c(0x212);async[a25_0x33445c(0x215)](_0x211355){const _0x58fa4a=a25_0x33445c,{options:_0x1ff8ed,args:_0x93cf37,tdx:_0x34b772}=_0x211355,_0x5b7623=_0x1ff8ed[_0x58fa4a(0x1ed)]||_0x58fa4a(0x213),_0xbba0cd=_0x1ff8ed[_0x58fa4a(0x220)],_0x5710ff=_0x1ff8ed[_0x58fa4a(0x1fc)]||_0x58fa4a(0x1dd),_0x215b73=_0x1ff8ed['result'];if(_0x5b7623!=='trino'&&_0x5b7623!==_0x58fa4a(0x1d5))throw new SDKError(ErrorCode[_0x58fa4a(0x1f6)],_0x58fa4a(0x1e1));let _0x1609d3;if(_0xbba0cd){if(_0x93cf37[0x0])throw new SDKError(ErrorCode[_0x58fa4a(0x1f6)],_0x58fa4a(0x1f9));const _0x31781e=readSqlStatementsFromFile(_0xbba0cd);if(_0x31781e[_0x58fa4a(0x21e)]===0x0)throw new SDKError(ErrorCode[_0x58fa4a(0x1f6)],_0x58fa4a(0x210));if(_0x31781e['length']>0x1)throw new SDKError(ErrorCode[_0x58fa4a(0x1f6)],_0x58fa4a(0x21d));_0x1609d3=_0x31781e[0x0];}else{if(!_0x93cf37[0x0])throw new SDKError(ErrorCode[_0x58fa4a(0x1f6)],_0x58fa4a(0x1f2));_0x1609d3=_0x93cf37[0x0];}_0x1ff8ed[_0x58fa4a(0x1d2)]&&(console[_0x58fa4a(0x219)]('Job\x20type:\x20'+_0x5b7623),console[_0x58fa4a(0x219)]('Database:\x20'+_0x5710ff),console[_0x58fa4a(0x219)](_0x58fa4a(0x1fa)+_0x1609d3[_0x58fa4a(0x1dc)](0x0,0x64)+(_0x1609d3[_0x58fa4a(0x21e)]>0x64?_0x58fa4a(0x20f):'')));const _0x1da362=await withSpinner('Submitting\x20job...',()=>_0x34b772[_0x58fa4a(0x1f1)][_0x58fa4a(0x1ff)](_0x5710ff,_0x1609d3,_0x5b7623,_0x215b73),{'verbose':_0x1ff8ed[_0x58fa4a(0x1d2)]}),_0x48a5f9=_0x1da362[_0x58fa4a(0x222)];return console['error']('✔\x20Job\x20submitted'),console[_0x58fa4a(0x219)]('\x20\x20Job\x20ID:\x20'+_0x48a5f9[_0x58fa4a(0x1d7)]),await handleSDKOutput([_0x48a5f9],_0x1ff8ed),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x33445c(0x218)]='job:result';[a25_0x33445c(0x202)]=a25_0x33445c(0x1d3);[a25_0x33445c(0x211)](_0x3dbb1f){const _0x214582=a25_0x33445c,_0x31b568=_0x3dbb1f[_0x214582(0x208)][0x0];if(!_0x31b568)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async['execute'](_0x475f40){const _0xbd3273=a25_0x33445c,{options:_0x5ec739,args:_0x43286d,tdx:_0x1b0204}=_0x475f40,_0x1dce8c=_0x43286d[0x0],_0x255e65=await withSpinner(_0xbd3273(0x20b),()=>_0x1b0204['jobs'][_0xbd3273(0x204)](_0x1dce8c),{'verbose':_0x5ec739[_0xbd3273(0x1d2)]}),_0x1f51e2=_0x255e65['data'];return console[_0xbd3273(0x219)]('✔\x20Retrieved\x20'+_0x1f51e2[_0xbd3273(0x21e)]+_0xbd3273(0x1d8)+(_0x1f51e2[_0xbd3273(0x21e)]!==0x1?'s':'')),await handleSDKOutput(_0x1f51e2,_0x5ec739),0x0;}}
@@ -1 +1 @@
1
- const a26_0xa84a1d=a26_0x250c;(function(_0x5af22c,_0x417e8e){const _0x4f4631=a26_0x250c,_0x2cb1a7=_0x5af22c();while(!![]){try{const _0x36f958=-parseInt(_0x4f4631(0x1c6))/0x1+parseInt(_0x4f4631(0x200))/0x2+-parseInt(_0x4f4631(0x231))/0x3*(-parseInt(_0x4f4631(0x1f6))/0x4)+-parseInt(_0x4f4631(0x212))/0x5+parseInt(_0x4f4631(0x1a6))/0x6+-parseInt(_0x4f4631(0x1c4))/0x7+parseInt(_0x4f4631(0x1d0))/0x8*(-parseInt(_0x4f4631(0x27c))/0x9);if(_0x36f958===_0x417e8e)break;else _0x2cb1a7['push'](_0x2cb1a7['shift']());}catch(_0x6b1caa){_0x2cb1a7['push'](_0x2cb1a7['shift']());}}}(a26_0x2e36,0x670d2));import a26_0xce81a1 from'chalk';import a26_0x5a6c84 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a26_0x250c(_0x2b937d,_0x532a1a){_0x2b937d=_0x2b937d-0x180;const _0x2e3668=a26_0x2e36();let _0x250c94=_0x2e3668[_0x2b937d];return _0x250c94;}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';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(_0x535178){const _0x19d41a=a26_0x250c;return!_0x535178&&(console[_0x19d41a(0x21f)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x19d41a(0x1e8))),!!_0x535178;}function withJsonFormat(_0x205dfd){const _0x1ecb0a=a26_0x250c;if(!_0x205dfd[_0x1ecb0a(0x249)]&&!_0x205dfd['json']&&!_0x205dfd[_0x1ecb0a(0x24c)]&&!_0x205dfd[_0x1ecb0a(0x1c5)])return{..._0x205dfd,'format':'json','json':!![]};return _0x205dfd;}function formatJourneyState(_0x506f05){const _0x361206=a26_0x250c;switch(_0x506f05){case _0x361206(0x284):return a26_0xce81a1[_0x361206(0x1e4)]('(running)');case _0x361206(0x1f1):return a26_0xce81a1[_0x361206(0x1c8)]('(draft)');case _0x361206(0x1c0):return a26_0xce81a1['yellow'](_0x361206(0x26e));case'completed':return a26_0xce81a1[_0x361206(0x269)](_0x361206(0x20c));case _0x361206(0x1d9):return a26_0xce81a1[_0x361206(0x1c8)]('(archived)');default:return'('+_0x506f05+')';}}function formatJourneyItem(_0x5e6eb1,_0x7d4157='',_0x25210b){const _0xdb898e=a26_0x250c,_0x9970c1=formatJourneyState(_0x5e6eb1[_0xdb898e(0x22f)]),_0x309b15=_0x25210b?hyperlink(_0x5e6eb1[_0xdb898e(0x216)],_0x25210b):_0x5e6eb1[_0xdb898e(0x216)];return _0x7d4157+'🗺️\x20'+_0x309b15+'\x20'+_0x9970c1;}function escapeRegex(_0x149cda){const _0x45ba7b=a26_0x250c;return _0x149cda[_0x45ba7b(0x218)](/[.*+?^${}()|[\]\\]/g,_0x45ba7b(0x1f8));}function globToRegex(_0x1f29eb){const _0xa40eeb=a26_0x250c,_0x5d5414=_0x1f29eb[_0xa40eeb(0x180)]('*')[_0xa40eeb(0x211)](escapeRegex);return new RegExp(_0x5d5414[_0xa40eeb(0x25e)]('.*'),'i');}function buildRuleToNameMapping(_0x528e57){const _0x1cdf20=a26_0x250c,_0x2fa102=new Map();if(_0x528e57[_0x1cdf20(0x250)])for(const [_0x2c5e39,_0x31990e]of Object['entries'](_0x528e57[_0x1cdf20(0x250)])){if(_0x31990e[_0x1cdf20(0x1d6)]){const _0x4da1a6=serializeRule(_0x31990e['rule']),_0x3e7617=_0x2fa102[_0x1cdf20(0x213)](_0x4da1a6);_0x3e7617?_0x3e7617[_0x1cdf20(0x1da)](_0x2c5e39):_0x2fa102[_0x1cdf20(0x196)](_0x4da1a6,[_0x2c5e39]);}}return _0x2fa102;}async function resolveJourneyIdFromInput(_0x5312a0,_0x25d5b8,_0x44baf9){const _0x3260c4=a26_0x250c,_0x1a9d07=await resolveJourneyTarget(_0x5312a0,_0x25d5b8[_0x3260c4(0x220)],_0x25d5b8[_0x3260c4(0x20f)]),_0x17e977=_0x1a9d07[_0x3260c4(0x220)];if(!_0x17e977)throw new SDKError(ErrorCode[_0x3260c4(0x233)],_0x3260c4(0x271));const _0x5d9fb7=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x44baf9[_0x3260c4(0x1ae)][_0x3260c4(0x24d)](_0x17e977),{'verbose':_0x25d5b8['verbose']}),_0x370b3a=_0x5d9fb7[_0x3260c4(0x226)],_0x149aa9=await withSpinner(_0x3260c4(0x1ba),()=>_0x44baf9[_0x3260c4(0x1d1)][_0x3260c4(0x219)](_0x370b3a,_0x1a9d07[_0x3260c4(0x1c3)]),{'verbose':_0x25d5b8[_0x3260c4(0x20f)]});return{'journeyId':_0x149aa9[_0x3260c4(0x226)],'journeyName':_0x1a9d07[_0x3260c4(0x1c3)],'parentSegmentId':_0x370b3a};}async function resolveJourneyTarget(_0x4e6423,_0x48603a,_0x4c875c){const _0x5a3d44=a26_0x250c;if(isYamlFilePath(_0x4e6423))try{const _0x32a925=await resolveYamlFilePath(_0x4e6423);return _0x4c875c&&(console[_0x5a3d44(0x21f)]('Resolved\x20YAML\x20file:\x20'+_0x4e6423),console['error'](_0x5a3d44(0x1b4)+_0x32a925['parentSegment']),console['error'](_0x5a3d44(0x276)+_0x32a925[_0x5a3d44(0x27f)]),console[_0x5a3d44(0x21f)](_0x5a3d44(0x280)+(_0x32a925[_0x5a3d44(0x1bc)]||_0x5a3d44(0x241)))),{'journeyName':_0x32a925[_0x5a3d44(0x27f)],'parentSegment':_0x32a925['parentSegment'],'resolved':_0x32a925};}catch(_0x5b9488){throw new SDKError(ErrorCode[_0x5a3d44(0x233)],_0x5a3d44(0x24b)+_0x5b9488[_0x5a3d44(0x27a)]);}if(!_0x48603a)throw new SDKError(ErrorCode[_0x5a3d44(0x233)],_0x5a3d44(0x1fc));return{'journeyName':_0x4e6423,'parentSegment':_0x48603a};}export class JourneyListCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x26f);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x209);async[a26_0xa84a1d(0x288)](_0x499b72){const _0x259bdd=a26_0xa84a1d,{options:_0x55afd7,args:_0x53ef12,tdx:_0x25a234}=_0x499b72,_0x5b2280=_0x53ef12[0x0],_0x396928=_0x55afd7[_0x259bdd(0x220)];if(!_0x396928)return console[_0x259bdd(0x21f)](_0x259bdd(0x26a)),console[_0x259bdd(0x21f)](_0x259bdd(0x237)),0x1;const _0x27a236=await withSpinner(_0x259bdd(0x26b),()=>_0x25a234['segment'][_0x259bdd(0x24d)](_0x396928),{'verbose':_0x55afd7[_0x259bdd(0x20f)]}),_0x234973=_0x27a236['data'];_0x55afd7[_0x259bdd(0x20f)]&&(console[_0x259bdd(0x21f)](_0x259bdd(0x23f)+_0x396928+_0x259bdd(0x1cd)+_0x234973+')'),_0x5b2280&&console[_0x259bdd(0x21f)](_0x259bdd(0x270)+_0x5b2280));const _0x2bf87f=await withSpinner(_0x259bdd(0x1a2),()=>_0x25a234[_0x259bdd(0x1ae)][_0x259bdd(0x229)](_0x234973),{'verbose':_0x55afd7[_0x259bdd(0x20f)]}),_0x2176d3=_0x2bf87f['data'],_0x4047a8=_0x2176d3[_0x259bdd(0x23c)],_0x52f6c6=await withSpinner(_0x259bdd(0x206),()=>_0x25a234[_0x259bdd(0x1d1)][_0x259bdd(0x258)](_0x234973,_0x4047a8),{'verbose':_0x55afd7['verbose']});let _0x47f62e=_0x52f6c6[_0x259bdd(0x226)]['journeys'];const _0x171cdf=_0x52f6c6[_0x259bdd(0x226)][_0x259bdd(0x1ad)],_0x59ae34=new Map();for(const _0x42a659 of _0x171cdf){_0x59ae34[_0x259bdd(0x196)](_0x42a659['id'],_0x42a659[_0x259bdd(0x1f9)]);}if(_0x5b2280){const _0x88030b=globToRegex(_0x5b2280);_0x47f62e=_0x47f62e[_0x259bdd(0x247)](_0x3fdfaf=>_0x88030b[_0x259bdd(0x1ef)](_0x3fdfaf['journeyBundleName']));}console[_0x259bdd(0x21f)](_0x259bdd(0x1d5)+_0x47f62e['length']+'\x20journey'+(_0x47f62e[_0x259bdd(0x1a7)]!==0x1?'s':''));const _0x33c1a2=_0x4c6f10=>{const _0x2bfe8b=_0x259bdd;return getConsoleNextUrl(_0x55afd7['site'],'/app/ps/'+_0x234973+_0x2bfe8b(0x1bf)+_0x4c6f10+'/j/da');};if(_0x55afd7[_0x259bdd(0x249)]==='table')await handleSDKOutput(_0x47f62e,_0x55afd7);else{if(_0x55afd7['format']===_0x259bdd(0x257)){const _0x4c5da7=_0x47f62e[_0x259bdd(0x211)](_0x20fcbe=>({..._0x20fcbe,'url':_0x33c1a2(_0x20fcbe['id'])}));await handleSDKOutput(_0x4c5da7,_0x55afd7);}else{console['log']('['+_0x396928+']');const _0x2be052=new Map(),_0x3da8cb=[];for(const _0x1ed05c of _0x47f62e){if(!_0x1ed05c[_0x259bdd(0x28b)]||_0x1ed05c[_0x259bdd(0x28b)]===_0x4047a8)_0x3da8cb['push'](_0x1ed05c);else{const _0x4d0548=_0x2be052[_0x259bdd(0x213)](_0x1ed05c['folderId'])||[];_0x4d0548[_0x259bdd(0x1da)](_0x1ed05c),_0x2be052['set'](_0x1ed05c[_0x259bdd(0x28b)],_0x4d0548);}}const _0x50b78b=(_0x2f557c,_0x349d83)=>_0x2f557c[_0x259bdd(0x216)][_0x259bdd(0x26d)](_0x349d83[_0x259bdd(0x216)],undefined,{'sensitivity':_0x259bdd(0x25f)});_0x3da8cb[_0x259bdd(0x234)](_0x50b78b);for(const _0x57cfe4 of _0x3da8cb){console[_0x259bdd(0x185)](formatJourneyItem(_0x57cfe4,'',_0x33c1a2(_0x57cfe4['id'])));}const _0x276873=[..._0x2be052['entries']()][_0x259bdd(0x234)]((_0x35835a,_0x20d4a8)=>{const _0x33c386=_0x259bdd,_0x5e9f73=_0x59ae34[_0x33c386(0x213)](_0x35835a[0x0])||_0x35835a[0x0],_0xf77f77=_0x59ae34['get'](_0x20d4a8[0x0])||_0x20d4a8[0x0];return _0x5e9f73['localeCompare'](_0xf77f77,undefined,{'sensitivity':_0x33c386(0x25f)});});for(const [_0x2186ff,_0x1a14db]of _0x276873){const _0x49257c=_0x59ae34[_0x259bdd(0x213)](_0x2186ff)||_0x2186ff;console['log'](_0x259bdd(0x18e)+_0x49257c),_0x1a14db[_0x259bdd(0x234)](_0x50b78b);for(const _0xbfa862 of _0x1a14db){console[_0x259bdd(0x185)](formatJourneyItem(_0xbfa862,'\x20\x20',_0x33c1a2(_0xbfa862['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1a4);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x264);async[a26_0xa84a1d(0x288)](_0x299fd3){const _0x571392=a26_0xa84a1d,{options:_0x3153ef,args:_0x299028,tdx:_0x25597e}=_0x299fd3,_0x5449e6=_0x299028[0x0];if(!_0x5449e6)return console[_0x571392(0x21f)](_0x571392(0x1ee)),console[_0x571392(0x21f)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x571392(0x21f)](_0x571392(0x193)),console['error'](_0x571392(0x201)),0x1;_0x3153ef[_0x571392(0x20f)]&&console[_0x571392(0x21f)](_0x571392(0x240)+_0x5449e6);const {journeyId:_0x1bd727,parentSegmentId:_0x172fc6}=await resolveJourneyIdFromInput(_0x5449e6,_0x3153ef,_0x25597e);if(_0x3153ef[_0x571392(0x205)]){const _0x4ded38=getConsoleNextUrl(_0x3153ef[_0x571392(0x236)],_0x571392(0x21a)+_0x172fc6+'/e/'+_0x1bd727+'/j/da/je');return console[_0x571392(0x21f)](a26_0xce81a1[_0x571392(0x1e4)]('✔')+_0x571392(0x1b0)+a26_0xce81a1[_0x571392(0x223)](_0x4ded38)),openBrowser(_0x4ded38),0x0;}const _0x4c7bb1=await withSpinner(_0x571392(0x20a),()=>_0x25597e['journey'][_0x571392(0x1eb)](_0x1bd727),{'verbose':_0x3153ef[_0x571392(0x20f)]}),_0x1b2da4=_0x4c7bb1[_0x571392(0x226)],_0x5ed23d=_0x3153ef[_0x571392(0x244)];let _0x5c4040;if(_0x5ed23d)try{const _0x1f7580=await withSpinner(_0x571392(0x273),()=>_0x25597e[_0x571392(0x1d1)][_0x571392(0x18d)](_0x1bd727),{'verbose':_0x3153ef[_0x571392(0x20f)]});_0x5c4040=_0x1f7580[_0x571392(0x226)];}catch{_0x3153ef[_0x571392(0x20f)]&&console[_0x571392(0x21f)](_0x571392(0x238));}const _0x20f306=getConsoleNextUrl(_0x3153ef['site'],'/app/ps/'+_0x172fc6+'/e/'+_0x1bd727+_0x571392(0x1c7)),_0x50debb={'id':_0x1b2da4['id'],'name':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x1f9)],'description':_0x1b2da4['attributes'][_0x571392(0x1cc)],'state':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x22f)],'paused':_0x1b2da4['attributes'][_0x571392(0x1c0)],'reentry_mode':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x228)],'stages':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x227)]?.[_0x571392(0x1a7)]||0x0,..._0x1b2da4[_0x571392(0x1b8)][_0x571392(0x26c)]&&{'goal':_0x1b2da4['attributes'][_0x571392(0x26c)][_0x571392(0x1f9)]},..._0x5c4040&&{'statistics':{'size':_0x5c4040[_0x571392(0x1fa)],'entered':_0x5c4040[_0x571392(0x1f2)],'goal_achieved':_0x5c4040[_0x571392(0x225)],'completion_rate':_0x5c4040[_0x571392(0x198)],'exit_or_jump':_0x5c4040['exitOrJumpSize'],'exit_or_jump_rate':_0x5c4040['exitOrJumpRate'],'stages':_0x5c4040['stages']}},'url':_0x20f306};return await handleSingleObjectOutput(_0x50debb,_0x3153ef),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x243);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x22c);async['execute'](_0x212411){const _0x172f9b=a26_0xa84a1d,{options:_0x40ead7,args:_0x5acfe1,tdx:_0x2bedc3}=_0x212411,_0x2eb440=_0x5acfe1[0x0];if(!requireNameOrPath(_0x2eb440))return 0x1;_0x40ead7['verbose']&&console[_0x172f9b(0x21f)]('Input:\x20'+_0x2eb440);const _0x43828e=_0x40ead7,_0x3f690c=_0x43828e[_0x172f9b(0x282)],_0x3b0d51=_0x43828e['to'],_0x584634=_0x43828e[_0x172f9b(0x1e5)],_0x4b38ad=_0x43828e['stage'];_0x584634&&!_0x3f690c&&!_0x3b0d51&&console['error']('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x2438c3=_0x584634?withJsonFormat(_0x40ead7):_0x40ead7,{journeyId:_0x282dc1,journeyName:_0x3d4050}=await resolveJourneyIdFromInput(_0x2eb440,_0x2438c3,_0x2bedc3),_0x2e8281=_0x3f690c||_0x3b0d51?{'from':_0x3f690c,'to':_0x3b0d51}:undefined,_0xc66f3=await withSpinner(_0x172f9b(0x273),()=>Promise[_0x172f9b(0x28c)]([_0x2bedc3['journey'][_0x172f9b(0x1eb)](_0x282dc1),_0x2bedc3[_0x172f9b(0x1d1)][_0x172f9b(0x18d)](_0x282dc1,_0x2e8281)]),{'verbose':_0x2438c3[_0x172f9b(0x20f)]}),[_0x20f7cd,_0x54341e]=_0xc66f3[_0x172f9b(0x226)];if(!_0x54341e||_0x54341e[_0x172f9b(0x1fb)]===null)return console[_0x172f9b(0x21f)](_0x172f9b(0x1a0)+_0x3d4050),console['error'](_0x172f9b(0x268)),0x0;const _0x51feab=buildStageNameMap(_0x20f7cd),_0x2d8761=!!(_0x2e8281&&_0x54341e['history']?.[_0x172f9b(0x1a7)]),_0x584a4a={'stageNameMap':_0x51feab,'hasPeriod':_0x2d8761,'includeHistory':!!_0x584634};if(_0x4b38ad&&_0x54341e['stages']){const _0x522094=_0x54341e[_0x172f9b(0x1e9)][_0x172f9b(0x286)](_0x18edf3=>{const _0x4ff8b1=_0x172f9b,_0xa6a3c5=_0x51feab[_0x4ff8b1(0x213)](_0x18edf3['id'])??'';return _0xa6a3c5[_0x4ff8b1(0x1ce)]()===_0x4b38ad['toLowerCase']();});if(_0x522094)return await handleSingleObjectOutput(formatStageStats(_0x522094,_0x584a4a),_0x2438c3),0x0;const _0x4eb3e9=_0x54341e['stages'][_0x172f9b(0x211)](_0x1ca316=>_0x51feab[_0x172f9b(0x213)](_0x1ca316['id'])??_0x1ca316['id']);return console[_0x172f9b(0x21f)](_0x172f9b(0x24a)+_0x4b38ad+_0x172f9b(0x279)),console[_0x172f9b(0x21f)](_0x172f9b(0x1a1)+_0x4eb3e9[_0x172f9b(0x25e)](',\x20')),0x1;}const _0x42deb6=_0x54341e['stages']?.[_0x172f9b(0x211)](_0x4e0342=>formatStageStats(_0x4e0342,_0x584a4a)),_0x32fda3=assembleJourneyStats(_0x54341e,{'from':_0x3f690c,'to':_0x3b0d51,'includeHistory':_0x584634});return await this[_0x172f9b(0x1dc)](_0x32fda3,_0x42deb6??[],_0x2438c3),0x0;}async['renderStats'](_0x4b2939,_0x5327af,_0x5c13ec){const _0x2d6d29=a26_0xa84a1d,_0x4c3b8e=_0x5c13ec[_0x2d6d29(0x249)]===_0x2d6d29(0x257)||_0x5c13ec[_0x2d6d29(0x249)]==='jsonl'||_0x5c13ec[_0x2d6d29(0x257)]||_0x5c13ec[_0x2d6d29(0x24c)];if(_0x4c3b8e){_0x4b2939['stages']=_0x5327af,await handleSingleObjectOutput(_0x4b2939,_0x5c13ec);return;}await handleSingleObjectOutput(_0x4b2939,_0x5c13ec);for(const _0x2180a1 of _0x5327af){console[_0x2d6d29(0x185)](''),console['log'](String(a26_0xce81a1[_0x2d6d29(0x223)][_0x2d6d29(0x210)]('['+_0x2180a1[_0x2d6d29(0x1f9)]+']'))+a26_0xce81a1[_0x2d6d29(0x1c8)]('\x20'+_0x2180a1['id']));const {id:_0x2a1961,name:_0x24d97a,..._0x38d69a}=_0x2180a1;await handleSingleObjectOutput(_0x38d69a,_0x5c13ec);}}}function a26_0x2e36(){const _0x464567=['\x20journeys','folders','segment','Fetching\x20journeys\x20and\x20folders...','\x20Opening\x20','cwd','version','getColumnMapping','\x20\x20Parent\x20segment:\x20','\x20version','add','Error:\x20Journey\x20\x27','attributes','Target\x20directory:\x20','Resolving\x20journey...','\x20files?','folderPath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parent_segment','/e/','paused','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','hasPeriod','journeyName','2641009YcsCQx','tsv','109062gZBhVj','/j/da/je','dim','\x20\x20-\x20','Error:\x20','listVersions','description','\x20(ID:\x20','toLowerCase','✔\x20Journey\x20\x22','8NJPzlC','journey','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Aborted.','journey:version:create','✔\x20Found\x20','rule','\x20=\x20','journey:traffic','archived','push','Table:\x20','renderStats','yes','setPhase','connection','journey:activations','relative','journey:columns','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','green','includeHistory','Getting\x20version\x20','limit','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','stages','Folder\x20path:\x20','getJourney','\x0aError:','history','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','test','✔\x20Context\x20set:\x20','draft','enteredSize','journey:versions','Error:\x20Version\x20','\x20activation','8HFuxkI','\x20details...','\x5c$&','name','size','journeyId','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','isNew','\x22\x20paused','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','1261220OZmXrf','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Found\x20','journey:resume','Resuming\x20journey...','web','Listing\x20journeys...','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20changed\x20files','List\x20journeys\x20in\x20current\x20context','Getting\x20journey\x20details...','View\x20a\x20specific\x20version\x20of\x20a\x20journey','(completed)','-\x20no\x20files\x20written','Getting\x20journey\x20traffic\x20data...','verbose','bold','map','619975oLkmPu','get','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','.yml','journeyBundleName','pause','replace','resolveJourneyId','/app/ps/','Write\x20','Getting\x20column\x20mapping...','repeat','\x22\x20resumed','error','parentSegment','\x20not\x20found.\x20Available:\x20','Fetching\x20users\x20and\x20connections...','cyan','journeyBundleId','goalSize','data','journeyStages','reentryMode','getParentFull','Cancelled','absolutePath','Show\x20journey\x20statistics','\x20(rule\x20match)','getSegment','state','listActivationsFlat','104568vQcDJR','utf-8','INVALID_ARGUMENT','sort','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','site','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20\x20Statistics\x20not\x20available','Pause\x20a\x20running\x20journey','user','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','rootFolderId','Listing\x20journey\x20activations...','stringify','Parent\x20segment:\x20','Input:\x20','(root)','getActivation','journey:stats','includeStats','resume','...','filter','Warning:\x20Could\x20not\x20resolve\x20activation\x20','format','Error:\x20Stage\x20\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','jsonl','resolveParentId','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','List\x20activations\x20for\x20a\x20journey','segments','conversion','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','journey:pause','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','values','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','json','listJourneysWithFolders','file','milestoneSize','completeMilestoneRate','listJourneysFromParentSegment','\x20->\x20','join','base','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','relativePath','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','has','Show\x20journey\x20details','links','Error:\x20Invalid\x20version\x20number:\x20','session','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','blue','Error:\x20Parent\x20segment\x20context\x20required','Resolving\x20parent\x20segment...','goal','localeCompare','(paused)','journey:list','Pattern:\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','audienceId','Getting\x20journey\x20statistics...','✔\x20Pulled\x20','\x20\x20Journey\x20ID:\x20','\x20\x20Name:\x20','Resume\x20a\x20paused\x20journey','tdx.json','\x22\x20not\x20found','message','\x0aChanges\x20to\x20\x27','2872431bnBnKe','helpText','connector_config','segmentName','\x20\x20Folder\x20path:\x20','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','from','Fetching\x20','launched','resourceName','find','buildIdToEmailMap','execute','then','updatedAt','folderId','all','split','Database:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','root\x20folder','versionNumber','log','yellow','activationParams','segmentPushCommand','columns','diff','Error:\x20Invalid\x20--type\x20\x22','dryRun','getStatistics','📁\x20','exitOrJumpSize','type','Journey\x20name:\x20','\x0aPull\x20summary:','Options:','No\x20journeys\x20found','args','set','Error:\x20Journey\x20not\x20found:\x20','completionRate','hasChanges','options','Listing\x20journey\x20versions...','activation','createdAt','Error:\x20--version\x20option\x20is\x20required','Show\x20journey\x20table\x20column\x20mapping','No\x20statistics\x20available\x20for\x20journey:\x20','Available\x20stages:\x20','Fetching\x20parent\x20segment...','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)','journey:view','filePath','3907674nWBUbL','length','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','red'];a26_0x2e36=function(){return _0x464567;};return a26_0x2e36();}export class JourneyTrafficCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1d8);['description']=a26_0xa84a1d(0x252);async[a26_0xa84a1d(0x288)](_0x9d4bfe){const _0x21f811=a26_0xa84a1d,{options:_0x329a97,args:_0x45266e,tdx:_0x1123e9}=_0x9d4bfe,_0x5375ec=_0x45266e[0x0];if(!requireNameOrPath(_0x5375ec))return 0x1;_0x329a97[_0x21f811(0x20f)]&&console['error'](_0x21f811(0x240)+_0x5375ec);const _0x2559ec=_0x329a97,_0x3fa8e8=_0x2559ec['type'],_0x3b575d=_0x2559ec['from'],_0x5879c5=_0x2559ec['to'],_0x3e0877=_0x2559ec[_0x21f811(0x1e7)];if(_0x3fa8e8&&_0x3fa8e8!==_0x21f811(0x251)&&_0x3fa8e8!==_0x21f811(0x19c))return console[_0x21f811(0x21f)](_0x21f811(0x18b)+_0x3fa8e8+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x5bb337=withJsonFormat(_0x329a97),{journeyId:_0x48fad7,journeyName:_0x5009ac}=await resolveJourneyIdFromInput(_0x5375ec,_0x5bb337,_0x1123e9),_0x440f1c={'type':_0x3fa8e8,'from':_0x3b575d,'to':_0x5879c5,'limit':_0x3e0877},_0x154edc=await withSpinner(_0x21f811(0x20e),()=>_0x1123e9[_0x21f811(0x1d1)]['getTrafficData'](_0x48fad7,_0x440f1c),{'verbose':_0x5bb337[_0x21f811(0x20f)]}),_0x502360=_0x154edc[_0x21f811(0x226)],_0x1a5cb7=_0x502360['conversion']&&(_0x502360[_0x21f811(0x251)]['nodes'][_0x21f811(0x1a7)]>0x0||_0x502360[_0x21f811(0x251)][_0x21f811(0x265)][_0x21f811(0x1a7)]>0x0),_0x62c92f=_0x502360[_0x21f811(0x19c)]&&_0x502360[_0x21f811(0x19c)]['length']>0x0;if(!_0x1a5cb7&&!_0x62c92f)return console['error'](_0x21f811(0x281)+_0x5009ac),console[_0x21f811(0x21f)](_0x21f811(0x214)),_0x3b575d&&_0x5879c5&&console[_0x21f811(0x21f)](_0x21f811(0x1e3)),0x0;return await handleSingleObjectOutput(_0x502360,_0x5bb337),0x0;}}function formatStageStats(_0x17ea29,_0x10d21b){const _0x3c4120=a26_0xa84a1d,_0xd85232=_0x10d21b[_0x3c4120(0x1c2)]&&_0x17ea29[_0x3c4120(0x1ed)]?.[_0x3c4120(0x1a7)]?aggregateStageHistory(_0x17ea29[_0x3c4120(0x1ed)]):{'size':_0x17ea29['size'],'entered':_0x17ea29[_0x3c4120(0x1f2)],'milestone':_0x17ea29[_0x3c4120(0x25a)],'milestone_rate':_0x17ea29[_0x3c4120(0x25b)],'exit_or_jump':_0x17ea29[_0x3c4120(0x18f)],'exit_or_jump_rate':_0x17ea29['exitOrJumpRate']},_0x5687bb={'id':_0x17ea29['id'],'name':_0x10d21b['stageNameMap'][_0x3c4120(0x213)](_0x17ea29['id'])??_0x17ea29['id'],..._0xd85232};return _0x10d21b[_0x3c4120(0x1c2)]&&_0x10d21b[_0x3c4120(0x1e5)]&&_0x17ea29[_0x3c4120(0x1ed)]&&(_0x5687bb[_0x3c4120(0x1ed)]=_0x17ea29['history']),_0x5687bb;}export class JourneyPauseCommand extends BaseCommand{['name']=a26_0xa84a1d(0x253);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x239);async[a26_0xa84a1d(0x288)](_0x308415){const _0x5346e0=a26_0xa84a1d,{options:_0x2b99b5,args:_0x3c5f27,tdx:_0x37f3d1}=_0x308415,_0x581ad2=_0x3c5f27[0x0];if(!requireNameOrPath(_0x581ad2))return 0x1;_0x2b99b5[_0x5346e0(0x20f)]&&console[_0x5346e0(0x21f)]('Input:\x20'+_0x581ad2);const {journeyId:_0x3bca2c,journeyName:_0x6e03af}=await resolveJourneyIdFromInput(_0x581ad2,_0x2b99b5,_0x37f3d1);if(!_0x2b99b5[_0x5346e0(0x1dd)]){const _0x5269f7=await confirm(_0x5346e0(0x262)+_0x6e03af+'\x22?');if(!_0x5269f7)return console[_0x5346e0(0x21f)]('Cancelled'),0x0;}const _0x485422=await withSpinner('Pausing\x20journey...',()=>_0x37f3d1[_0x5346e0(0x1d1)][_0x5346e0(0x217)](_0x3bca2c),{'verbose':_0x2b99b5[_0x5346e0(0x20f)]}),_0x2e3bc9=_0x485422[_0x5346e0(0x226)];return console[_0x5346e0(0x21f)](_0x5346e0(0x1cf)+_0x2e3bc9['attributes'][_0x5346e0(0x1f9)]+_0x5346e0(0x1fe)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x203);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x277);async[a26_0xa84a1d(0x288)](_0x36c288){const _0x1cea92=a26_0xa84a1d,{options:_0x2af1b2,args:_0x109afe,tdx:_0x13836e}=_0x36c288,_0x1bc176=_0x109afe[0x0];if(!requireNameOrPath(_0x1bc176))return 0x1;_0x2af1b2[_0x1cea92(0x20f)]&&console[_0x1cea92(0x21f)](_0x1cea92(0x240)+_0x1bc176);const {journeyId:_0x122b06,journeyName:_0x3cc7c4}=await resolveJourneyIdFromInput(_0x1bc176,_0x2af1b2,_0x13836e);if(!_0x2af1b2[_0x1cea92(0x1dd)]){const _0x427fcc=await confirm(_0x1cea92(0x256)+_0x3cc7c4+'\x22?');if(!_0x427fcc)return console[_0x1cea92(0x21f)](_0x1cea92(0x22a)),0x0;}const _0x4cb2f9=await withSpinner(_0x1cea92(0x204),()=>_0x13836e[_0x1cea92(0x1d1)][_0x1cea92(0x245)](_0x122b06),{'verbose':_0x2af1b2[_0x1cea92(0x20f)]}),_0x4b7505=_0x4cb2f9[_0x1cea92(0x226)];return console[_0x1cea92(0x21f)](_0x1cea92(0x1cf)+_0x4b7505[_0x1cea92(0x1b8)][_0x1cea92(0x1f9)]+_0x1cea92(0x21e)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]='journey:pull';[a26_0xa84a1d(0x1cc)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a26_0xa84a1d(0x288)](_0x22003b){const _0x1e0f31=a26_0xa84a1d,{options:_0x140f4f,args:_0xb6634f,tdx:_0x47c9f1}=_0x22003b,_0x4ed7d7=_0x140f4f,_0x481cdc=_0xb6634f[0x0],_0x379e57=_0x481cdc&&isYamlFilePath(_0x481cdc),_0x386221=await resolveTarget({'arg':_0x379e57?_0x481cdc:undefined,'contextParent':_0x140f4f[_0x1e0f31(0x220)],'cwd':process[_0x1e0f31(0x1b1)]()});if(!isSuccessfulResolution(_0x386221))return _0x386221['errorCode']==='no_parent'?(console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x186)](_0x1e0f31(0x182))),console['error'](_0x1e0f31(0x1a3)),console[_0x1e0f31(0x21f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x1e0f31(0x21f)](_0x1e0f31(0x254)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1ab)](_0x1e0f31(0x1ca)+_0x386221[_0x1e0f31(0x27a)]+'\x0a')),_0x386221[_0x1e0f31(0x27d)]&&console['error'](a26_0xce81a1[_0x1e0f31(0x223)](_0x386221[_0x1e0f31(0x27d)]))),0x1;let _0x8250b0=_0x379e57?undefined:_0x481cdc,_0x94f9b6,_0x50d355;_0x386221[_0x1e0f31(0x190)]===_0x1e0f31(0x259)&&(_0x8250b0=_0x386221[_0x1e0f31(0x285)],_0x94f9b6=_0x386221[_0x1e0f31(0x1a5)],_0x50d355=_0x386221[_0x1e0f31(0x1bc)]);const _0x51d5b5=_0x386221['parentName'],_0x569b60=_0x386221['targetDir'];_0x4ed7d7[_0x1e0f31(0x20f)]&&(console[_0x1e0f31(0x21f)](_0x1e0f31(0x23f)+_0x51d5b5),console[_0x1e0f31(0x21f)](_0x1e0f31(0x1b9)+_0x569b60),_0x8250b0&&console[_0x1e0f31(0x21f)](_0x1e0f31(0x191)+_0x8250b0),_0x94f9b6&&console[_0x1e0f31(0x21f)]('Target\x20file:\x20'+_0x94f9b6),_0x50d355&&console[_0x1e0f31(0x21f)](_0x1e0f31(0x1ea)+_0x50d355));const _0x6debbd=await withSpinner(_0x1e0f31(0x26b),()=>_0x47c9f1[_0x1e0f31(0x1ae)][_0x1e0f31(0x24d)](_0x51d5b5),{'verbose':_0x140f4f[_0x1e0f31(0x20f)]}),_0x5ad056=_0x6debbd[_0x1e0f31(0x226)],{journeys:_0x53eb1d,folders:_0x48702b}=await withSpinner(_0x1e0f31(0x1af),async()=>{const _0x57cf8b=_0x1e0f31,[_0x455aa0,_0x354ecf]=await Promise[_0x57cf8b(0x28c)]([_0x47c9f1[_0x57cf8b(0x1d1)][_0x57cf8b(0x25c)](_0x5ad056,undefined,{'includeAllVersions':!![]}),_0x47c9f1[_0x57cf8b(0x1ae)]['listFolders'](_0x5ad056)]);return{'journeys':_0x455aa0,'folders':_0x354ecf};},{'verbose':_0x140f4f[_0x1e0f31(0x20f)]})[_0x1e0f31(0x289)](_0x53bed9=>_0x53bed9['data']);let _0x2ab84e=_0x53eb1d;const _0x3ff81b=buildFolderIdToPathMap(_0x48702b);if(_0x8250b0){const _0x40c911=_0x2ab84e[_0x1e0f31(0x247)](_0xc829c6=>_0xc829c6[_0x1e0f31(0x216)][_0x1e0f31(0x1ce)]()===_0x8250b0['toLowerCase']());if(_0x40c911[_0x1e0f31(0x1a7)]===0x0)return console[_0x1e0f31(0x21f)](_0x1e0f31(0x197)+_0x8250b0),console[_0x1e0f31(0x21f)](_0x1e0f31(0x1aa)),0x1;_0x2ab84e=_0x40c911;}if(_0x50d355!==undefined){const _0x1bc809=_0x2ab84e[_0x1e0f31(0x247)](_0x256b13=>{const _0x1efe77=_0x1e0f31,_0x4c5de5=_0x256b13[_0x1efe77(0x28b)]?_0x3ff81b[_0x1efe77(0x213)](_0x256b13[_0x1efe77(0x28b)])||'':'';return _0x4c5de5===_0x50d355;});if(_0x1bc809[_0x1e0f31(0x1a7)]===0x0&&_0x2ab84e[_0x1e0f31(0x1a7)]>0x0){console[_0x1e0f31(0x21f)](_0x1e0f31(0x1b7)+_0x8250b0+'\x27\x20not\x20found\x20in\x20'+(_0x50d355||_0x1e0f31(0x183))),console['error'](_0x1e0f31(0x24e));for(const _0x2ef661 of _0x2ab84e){const _0x2f362c=_0x2ef661['folderId']?_0x3ff81b[_0x1e0f31(0x213)](_0x2ef661[_0x1e0f31(0x28b)])||'':'';console['error'](_0x1e0f31(0x1c9)+(_0x2f362c||_0x1e0f31(0x241))+'/'+_0x2ef661[_0x1e0f31(0x216)]);}return 0x1;}_0x2ab84e=_0x1bc809;}if(_0x2ab84e[_0x1e0f31(0x1a7)]===0x0)return console['error'](_0x1e0f31(0x194)),0x0;const _0x3cdabd=new Map();for(const _0x10fd5b of _0x2ab84e){const _0x467e6c=_0x10fd5b[_0x1e0f31(0x224)];!_0x3cdabd[_0x1e0f31(0x263)](_0x467e6c)&&_0x3cdabd[_0x1e0f31(0x196)](_0x467e6c,[]),_0x3cdabd[_0x1e0f31(0x213)](_0x467e6c)[_0x1e0f31(0x1da)](_0x10fd5b);}for(const _0x28b232 of _0x3cdabd[_0x1e0f31(0x255)]()){_0x28b232[_0x1e0f31(0x234)]((_0x36500b,_0x2745f6)=>(_0x36500b[_0x1e0f31(0x184)]||0x0)-(_0x2745f6[_0x1e0f31(0x184)]||0x0));}const _0x53afa4=[],{idToEmailMap:_0xa207e3,connectionIdToNameMap:_0x2d8741}=await withSpinner(_0x1e0f31(0x222),async()=>{const _0x2fe982=_0x1e0f31,[_0x4078fc,_0x322cd7]=await Promise[_0x2fe982(0x28c)]([_0x47c9f1[_0x2fe982(0x23a)][_0x2fe982(0x287)](),_0x47c9f1[_0x2fe982(0x1df)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x4078fc,'connectionIdToNameMap':_0x322cd7};},{'verbose':_0x140f4f[_0x1e0f31(0x20f)]})[_0x1e0f31(0x289)](_0x5c8758=>_0x5c8758[_0x1e0f31(0x226)]);for(const _0x5b5462 of _0x3cdabd[_0x1e0f31(0x255)]()){const _0x26970d=_0x5b5462[0x0][_0x1e0f31(0x216)],_0x1d2849=_0x5b5462[0x0][_0x1e0f31(0x28b)],_0x1b8945=_0x1d2849?_0x3ff81b[_0x1e0f31(0x213)](_0x1d2849)||'':'',_0x225373=_0x1b8945?a26_0x5a6c84['join'](_0x569b60,_0x1b8945):_0x569b60,_0x3be61a=_0x94f9b6||a26_0x5a6c84['join'](_0x225373,sanitizeFileName(_0x26970d)+_0x1e0f31(0x215));let _0x60ac15,_0x2e4ad0;if(existsSync(_0x3be61a))try{const _0x419403=readFileSync(_0x3be61a,'utf-8'),_0xb69342=parseYamlString(_0x419403);_0x2e4ad0=_0xb69342,_0x60ac15=buildRuleToNameMapping(_0xb69342),_0x4ed7d7[_0x1e0f31(0x20f)]&&_0x60ac15[_0x1e0f31(0x1fa)]>0x0&&console['error'](_0x1e0f31(0x202)+_0x60ac15[_0x1e0f31(0x1fa)]+_0x1e0f31(0x23b)+_0x26970d);}catch(_0x2e9093){_0x4ed7d7['verbose']&&console['error'](_0x1e0f31(0x1ff)+_0x2e9093[_0x1e0f31(0x27a)]);}const _0x939e55=[],_0x31dfa5=new Set(),_0x3053ff=new Map(),_0x4d7aea=new Map(),_0x511135=new Set(),_0x42d7bf=new Map(),_0x29abc2=new Map(),_0x1f2b93=createJumpTargetCache();await withProgressSpinner(_0x1e0f31(0x283)+_0x26970d+_0x1e0f31(0x246),async _0x3961c0=>{const _0x194e9e=_0x1e0f31;for(const _0x59ac60 of _0x5b5462){const _0x512388=_0x5b5462[_0x194e9e(0x1a7)]>0x1?_0x59ac60['journeyBundleName']+'\x20v'+(_0x59ac60[_0x194e9e(0x184)]||0x1):_0x59ac60[_0x194e9e(0x216)];_0x3961c0[_0x194e9e(0x1de)](_0x194e9e(0x283)+_0x512388);const _0x34f540=await _0x47c9f1[_0x194e9e(0x1d1)]['getJourney'](_0x59ac60['id']),_0x3871e4=_0x34f540['attributes']?.[_0x194e9e(0x272)],_0x1ffd5e={'resolveSegment':async _0x2a4a21=>{const _0x372faf=_0x194e9e;if(!_0x3871e4)return{'name':_0x2a4a21,'isJourneyLocal':![]};const _0xe2f3d0=_0x3053ff[_0x372faf(0x213)](_0x2a4a21);if(_0xe2f3d0)return _0xe2f3d0;try{const _0x57f14d=await _0x47c9f1[_0x372faf(0x1ae)][_0x372faf(0x22e)](_0x3871e4,_0x2a4a21),_0x9613a7=_0x57f14d['kind']===SEGMENT_KIND_JOURNEY;let _0x12f870,_0x2196a4=_0x57f14d['name'];if(_0x9613a7&&_0x57f14d['rule']){const _0x5c551c=await segmentResponseToDef(_0x57f14d,{'resolveSegmentName':async _0x3b788b=>{const _0x375e59=_0x372faf,_0x5bbfa0=_0x3053ff[_0x375e59(0x213)](_0x3b788b);if(_0x5bbfa0)return _0x5bbfa0[_0x375e59(0x1f9)];const _0x3f090b=await _0x1ffd5e['resolveSegment'](_0x3b788b);return _0x3f090b[_0x375e59(0x1f9)];}}),_0x495088=_0x5c551c[_0x372faf(0x1d6)];_0x12f870={'description':_0x57f14d[_0x372faf(0x1cc)],'rule':_0x495088};const _0x1bdad3=serializeRule(_0x495088),_0x2ae5a7=_0x4d7aea[_0x372faf(0x213)](_0x1bdad3);if(_0x2ae5a7)_0x2196a4=_0x2ae5a7,_0x12f870=undefined,_0x4ed7d7[_0x372faf(0x20f)]&&console['error'](_0x372faf(0x1d2)+_0x57f14d[_0x372faf(0x1f9)]+_0x372faf(0x25d)+_0x2ae5a7);else{let _0xadb2c5=![];if(_0x60ac15){const _0x1dff54=_0x60ac15[_0x372faf(0x213)](_0x1bdad3);if(_0x1dff54){const _0x5cd164=_0x1dff54['find'](_0x404387=>!_0x31dfa5[_0x372faf(0x263)](_0x404387));_0x5cd164&&(_0x2196a4=_0x5cd164,_0x31dfa5[_0x372faf(0x1b6)](_0x5cd164),_0x4d7aea[_0x372faf(0x196)](_0x1bdad3,_0x5cd164),_0xadb2c5=!![],_0x4ed7d7[_0x372faf(0x20f)]&&console[_0x372faf(0x21f)](_0x372faf(0x1a8)+_0x5cd164+_0x372faf(0x22d)));}}if(!_0xadb2c5){const _0x15f8c0=generateJourneyLocalName(_0x57f14d['name']);_0x15f8c0&&(_0x2196a4=_0x15f8c0);let _0x5116f9=_0x2196a4,_0x483536=0x2;while(_0x31dfa5[_0x372faf(0x263)](_0x5116f9)){_0x5116f9=_0x2196a4+'_'+_0x483536,_0x483536++;}_0x31dfa5[_0x372faf(0x1b6)](_0x5116f9),_0x4d7aea[_0x372faf(0x196)](_0x1bdad3,_0x5116f9),_0x2196a4=_0x5116f9;}}}const _0x5a51f1={'name':_0x2196a4,'isJourneyLocal':_0x9613a7,'definition':_0x12f870};return _0x3053ff['set'](_0x2a4a21,_0x5a51f1),_0x5a51f1;}catch(_0x53f879){return _0x140f4f[_0x372faf(0x20f)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x2a4a21+':\x20'+_0x53f879[_0x372faf(0x27a)]),{'name':_0x2a4a21,'isJourneyLocal':![]};}},'resolveActivation':async _0x2ff2ce=>{const _0x41c951=_0x194e9e,_0x155b43=_0x42d7bf[_0x41c951(0x213)](_0x2ff2ce);if(_0x155b43)return _0x155b43;try{const _0x135ff7=await _0x47c9f1[_0x41c951(0x1d1)][_0x41c951(0x242)](_0x59ac60['id'],_0x2ff2ce),_0x259412=journeyActivationStepToYaml(_0x135ff7,_0xa207e3,_0x2d8741),_0x51cd54=JSON[_0x41c951(0x23e)]({'name':_0x259412[_0x41c951(0x1f9)],'connection':_0x259412[_0x41c951(0x1df)],'connector_config':_0x259412[_0x41c951(0x27e)]}),_0x416f2f=_0x29abc2[_0x41c951(0x213)](_0x51cd54);if(_0x416f2f){const _0x47c1c2={'name':_0x416f2f,'isJourneyLocal':!![],'definition':_0x259412};return _0x42d7bf['set'](_0x2ff2ce,_0x47c1c2),_0x47c1c2;}const _0x26bcca=_0x135ff7['attributes'][_0x41c951(0x187)]['name']||_0x2ff2ce,_0xe9e66e=sanitizeYamlKey(_0x26bcca)||'activation_'+_0x2ff2ce;let _0x3721e5=_0xe9e66e,_0x224e15=0x2;while(_0x511135[_0x41c951(0x263)](_0x3721e5)){_0x3721e5=_0xe9e66e+'_'+_0x224e15,_0x224e15++;}_0x511135['add'](_0x3721e5),_0x29abc2[_0x41c951(0x196)](_0x51cd54,_0x3721e5);const _0xc88533={'name':_0x3721e5,'isJourneyLocal':!![],'definition':_0x259412};return _0x42d7bf[_0x41c951(0x196)](_0x2ff2ce,_0xc88533),_0xc88533;}catch(_0xf3769f){return _0x140f4f['verbose']&&console['error'](_0x41c951(0x248)+_0x2ff2ce+':\x20'+_0xf3769f['message']),{'name':_0x2ff2ce,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0xb073a2,_0x2aa10b)=>{const _0x2959eb=_0x194e9e;return resolveJumpTarget(_0xb073a2,_0x2aa10b,_0x1f2b93,_0x3e01bf=>_0x47c9f1['journey'][_0x2959eb(0x1eb)](_0x3e01bf));}},_0x394a01=await journeyResponseToDef(_0x34f540,_0x1ffd5e);_0x939e55['push']({'item':_0x59ac60,'yaml':_0x394a01});}},{'verbose':_0x140f4f[_0x1e0f31(0x20f)]});const _0x327eec=await _0x47c9f1[_0x1e0f31(0x1d1)]['getLatestJourneyId'](_0x5b5462[0x0]['journeyBundleId']),_0x40de19=buildMergedJourneyDef(_0x939e55,_0x60ac15,_0x327eec),_0x47ba40=normalizeJourneyDef(_0x40de19,_0x2e4ad0),_0x2741b2=toYamlString(_0x47ba40),_0x2cc86b=_0x94f9b6||a26_0x5a6c84[_0x1e0f31(0x25e)](_0x225373,sanitizeFileName(_0x26970d)+_0x1e0f31(0x215));!_0x94f9b6&&_0x1b8945&&!existsSync(_0x225373)&&mkdirSync(_0x225373,{'recursive':!![]});const _0x497d5b=a26_0x5a6c84[_0x1e0f31(0x1e1)](process['cwd'](),_0x2cc86b);if(existsSync(_0x2cc86b)){const _0x51910e=readFileSync(_0x2cc86b,_0x1e0f31(0x232)),_0x2e4581=generateDiff(_0x51910e,_0x2741b2),_0x106768=hasChanges(_0x2e4581);_0x53afa4[_0x1e0f31(0x1da)]({'relativePath':_0x497d5b,'absolutePath':_0x2cc86b,'content':_0x2741b2,'isNew':![],'hasChanges':_0x106768,'diff':_0x106768?formatDiffWithColors(_0x2e4581):undefined});}else _0x53afa4[_0x1e0f31(0x1da)]({'relativePath':_0x497d5b,'absolutePath':_0x2cc86b,'content':_0x2741b2,'isNew':!![],'hasChanges':![]});}const _0x1444c8=_0x53afa4['filter'](_0x1f4a1e=>_0x1f4a1e[_0x1e0f31(0x1fd)]),_0x22cb34=_0x53afa4[_0x1e0f31(0x247)](_0x5d84f1=>!_0x5d84f1[_0x1e0f31(0x1fd)]&&_0x5d84f1['hasChanges']),_0x8a5e6a=_0x53afa4['filter'](_0x58c337=>!_0x58c337['isNew']&&!_0x58c337[_0x1e0f31(0x199)]),_0x3f4672=_0x2ab84e[_0x1e0f31(0x1a7)],_0x5997d8=_0x3cdabd[_0x1e0f31(0x1fa)],_0xe1856f=_0x3f4672>_0x5997d8?'\x20('+_0x3f4672+'\x20versions)':'';console[_0x1e0f31(0x21f)](_0x1e0f31(0x192)),console[_0x1e0f31(0x21f)]('\x20\x20'+a26_0xce81a1[_0x1e0f31(0x223)](_0x5997d8+_0x1e0f31(0x1ac))+a26_0xce81a1[_0x1e0f31(0x1c8)](_0xe1856f)),console[_0x1e0f31(0x21f)]('\x20\x20'+a26_0xce81a1['green']('+\x20'+_0x1444c8[_0x1e0f31(0x1a7)]+'\x20new\x20files')),console['error']('\x20\x20'+a26_0xce81a1[_0x1e0f31(0x186)]('~\x20'+_0x22cb34[_0x1e0f31(0x1a7)]+_0x1e0f31(0x208))),console[_0x1e0f31(0x21f)]('\x20\x20'+a26_0xce81a1[_0x1e0f31(0x1c8)]('=\x20'+_0x8a5e6a[_0x1e0f31(0x1a7)]+'\x20unchanged\x20files')),console['error']('\x20\x20Target:\x20'+a26_0xce81a1['cyan'](_0x569b60)+'\x0a');if(_0x22cb34['length']>0x0)for(const _0x4cb9d6 of _0x22cb34){console[_0x1e0f31(0x21f)](_0x1e0f31(0x27b)+_0x4cb9d6[_0x1e0f31(0x261)]+'\x27:'),console[_0x1e0f31(0x21f)]('─'[_0x1e0f31(0x21d)](0x3c)),console[_0x1e0f31(0x21f)](_0x4cb9d6[_0x1e0f31(0x18a)]),console[_0x1e0f31(0x21f)]('─'[_0x1e0f31(0x21d)](0x3c));}if(_0x4ed7d7[_0x1e0f31(0x18c)])return console[_0x1e0f31(0x21f)](a26_0xce81a1['yellow'](_0x1e0f31(0x1a9))),0x0;if(_0x1444c8[_0x1e0f31(0x1a7)]===0x0&&_0x22cb34[_0x1e0f31(0x1a7)]===0x0)return console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1e4)](_0x1e0f31(0x207))),saveSessionContext({'parent_segment':_0x51d5b5},_0x4ed7d7[_0x1e0f31(0x267)]),console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1e4)]('✔\x20Context\x20set:\x20'+a26_0xce81a1['dim'](_0x1e0f31(0x1be))+_0x1e0f31(0x1d7)+a26_0xce81a1[_0x1e0f31(0x223)](_0x51d5b5))),0x0;if(!_0x4ed7d7[_0x1e0f31(0x1dd)]&&(_0x1444c8[_0x1e0f31(0x1a7)]>0x0||_0x22cb34[_0x1e0f31(0x1a7)]>0x0)){if(!isInteractive())return console['error'](a26_0xce81a1[_0x1e0f31(0x1ab)](_0x1e0f31(0x1ec)),_0x1e0f31(0x1bd)),console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1c8)](_0x1e0f31(0x1c1))),0x1;const _0x2a7d3f=await confirmKey(_0x1e0f31(0x21b)+(_0x1444c8[_0x1e0f31(0x1a7)]+_0x22cb34[_0x1e0f31(0x1a7)])+_0x1e0f31(0x1bb));if(!_0x2a7d3f)return console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x186)](_0x1e0f31(0x1d3)),_0x1e0f31(0x20d)),0x1;}!existsSync(_0x569b60)&&mkdirSync(_0x569b60,{'recursive':!![]});const _0xc75b0f=a26_0x5a6c84[_0x1e0f31(0x25e)](_0x569b60,_0x1e0f31(0x278));writeFileSync(_0xc75b0f,createTdxConfigContent(_0x51d5b5),_0x1e0f31(0x232));for(const _0x5dea54 of _0x53afa4){(_0x5dea54['isNew']||_0x5dea54['hasChanges'])&&writeFileSync(_0x5dea54[_0x1e0f31(0x22b)],_0x5dea54['content'],_0x1e0f31(0x232));}return console['error'](a26_0xce81a1[_0x1e0f31(0x1e4)](_0x1e0f31(0x274)+(_0x1444c8[_0x1e0f31(0x1a7)]+_0x22cb34[_0x1e0f31(0x1a7)])+'\x20journey\x20files\x20to\x20'+_0x569b60)),saveSessionContext({'parent_segment':_0x51d5b5},_0x4ed7d7[_0x1e0f31(0x267)]),console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1e4)](_0x1e0f31(0x1f0)+a26_0xce81a1[_0x1e0f31(0x1c8)]('parent_segment')+_0x1e0f31(0x1d7)+a26_0xce81a1[_0x1e0f31(0x223)](_0x51d5b5))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1e2);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x19f);async[a26_0xa84a1d(0x288)](_0x389a91){const _0x3cc3ee=a26_0xa84a1d,{options:_0x5bc9ba,args:_0x25a67f,tdx:_0x30041a}=_0x389a91,_0x50d452=_0x25a67f[0x0];if(!requireNameOrPath(_0x50d452))return 0x1;_0x5bc9ba[_0x3cc3ee(0x20f)]&&console[_0x3cc3ee(0x21f)](_0x3cc3ee(0x240)+_0x50d452);const {journeyId:_0x2fefb2}=await resolveJourneyIdFromInput(_0x50d452,_0x5bc9ba,_0x30041a),_0x387048=await withSpinner(_0x3cc3ee(0x21c),()=>_0x30041a[_0x3cc3ee(0x1d1)][_0x3cc3ee(0x1b3)](_0x2fefb2),{'verbose':_0x5bc9ba[_0x3cc3ee(0x20f)]}),_0x4ad2b0=_0x387048[_0x3cc3ee(0x226)];return console[_0x3cc3ee(0x185)](_0x3cc3ee(0x181)+_0x4ad2b0['database']),console[_0x3cc3ee(0x185)](_0x3cc3ee(0x1db)+_0x4ad2b0['table']),await handleSDKOutput(_0x4ad2b0[_0x3cc3ee(0x189)],_0x5bc9ba),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a26_0xa84a1d(0x1e0);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x24f);async[a26_0xa84a1d(0x288)](_0x344693){const _0x476a73=a26_0xa84a1d,{options:_0x19509e,args:_0x40d920,tdx:_0xfb7daa}=_0x344693,_0x2db718=_0x40d920[0x0];if(!requireNameOrPath(_0x2db718))return 0x1;_0x19509e[_0x476a73(0x20f)]&&console[_0x476a73(0x21f)](_0x476a73(0x240)+_0x2db718);const {journeyId:_0x340159}=await resolveJourneyIdFromInput(_0x2db718,_0x19509e,_0xfb7daa),_0x4b767e=await withSpinner(_0x476a73(0x23d),()=>_0xfb7daa[_0x476a73(0x1d1)][_0x476a73(0x230)](_0x340159),{'verbose':_0x19509e[_0x476a73(0x20f)]}),_0x528dea=_0x4b767e[_0x476a73(0x226)];return console[_0x476a73(0x21f)](_0x476a73(0x202)+_0x528dea[_0x476a73(0x1a7)]+_0x476a73(0x1f5)+(_0x528dea[_0x476a73(0x1a7)]!==0x1?'s':'')),await handleSDKOutput(_0x528dea,_0x19509e),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]='journey:push';[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x260);[a26_0xa84a1d(0x188)]=new SegmentPushCommand();async['execute'](_0x1e9b72){const _0x15dea3=a26_0xa84a1d,_0x133703=_0x1e9b72[_0x15dea3(0x195)][0x0];let _0x22d9ac;if(_0x133703){const _0xe1d75e=await resolveTarget({'arg':_0x133703,'contextParent':_0x1e9b72[_0x15dea3(0x19a)]['parentSegment'],'cwd':process[_0x15dea3(0x1b1)]()});isSuccessfulResolution(_0xe1d75e)&&_0xe1d75e[_0x15dea3(0x190)]===_0x15dea3(0x259)&&(_0x22d9ac=_0xe1d75e[_0x15dea3(0x1a5)]);}const _0x3e685a={..._0x1e9b72,'options':{..._0x1e9b72[_0x15dea3(0x19a)],'journeysOnly':!![],..._0x22d9ac&&{'singleFilePath':_0x22d9ac}}};return this[_0x15dea3(0x188)][_0x15dea3(0x288)](_0x3e685a);}}export class JourneyVersionsCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1f3);[a26_0xa84a1d(0x1cc)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a26_0xa84a1d(0x288)](_0x288063){const _0x161ffc=a26_0xa84a1d,{options:_0x4a57e2,args:_0x152c4f,tdx:_0x218811}=_0x288063,_0x611e9=_0x152c4f[0x0];if(!requireNameOrPath(_0x611e9))return 0x1;if(_0x4a57e2[_0x161ffc(0x20f)])console['error'](_0x161ffc(0x240)+_0x611e9);const {journeyId:_0x55986e}=await resolveJourneyIdFromInput(_0x611e9,_0x4a57e2,_0x218811),_0x2f9763=await withSpinner(_0x161ffc(0x19b),()=>_0x218811['journey'][_0x161ffc(0x1cb)](_0x55986e),{'verbose':_0x4a57e2[_0x161ffc(0x20f)]}),{bundleName:_0x5553b2,versions:_0x2f6d73,latestJourneyId:_0x399fc7}=_0x2f9763['data'];console['error'](_0x5553b2+':\x20'+_0x2f6d73[_0x161ffc(0x1a7)]+_0x161ffc(0x1b5)+(_0x2f6d73[_0x161ffc(0x1a7)]!==0x1?'s':''));const _0x1e9911=_0x2f6d73[_0x161ffc(0x211)](_0x7e993b=>({'version':_0x7e993b[_0x161ffc(0x184)],'journey_id':_0x7e993b[_0x161ffc(0x1fb)],'name':_0x7e993b[_0x161ffc(0x1f9)],'state':_0x7e993b[_0x161ffc(0x22f)],'paused':_0x7e993b[_0x161ffc(0x1c0)],'latest':_0x7e993b['journeyId']===_0x399fc7,'created_at':_0x7e993b[_0x161ffc(0x19d)]}));return await handleSDKOutput(_0x1e9911,_0x4a57e2),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a26_0xa84a1d(0x1d4);[a26_0xa84a1d(0x1cc)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a26_0xa84a1d(0x288)](_0x4430a1){const _0x41d2f8=a26_0xa84a1d,{options:_0x2b5c62,args:_0x48d844,tdx:_0x3e04f9}=_0x4430a1,_0x86c59e=_0x48d844[0x0];if(!requireNameOrPath(_0x86c59e))return 0x1;if(_0x2b5c62['verbose'])console[_0x41d2f8(0x21f)]('Input:\x20'+_0x86c59e);const {journeyId:_0x5e5aba,journeyName:_0x41477c}=await resolveJourneyIdFromInput(_0x86c59e,_0x2b5c62,_0x3e04f9);if(!_0x2b5c62[_0x41d2f8(0x1dd)]){const _0x1b688f=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x41477c+'\x22?');if(!_0x1b688f)return console[_0x41d2f8(0x21f)](_0x41d2f8(0x22a)),0x0;}const _0x124f12=await withSpinner('Creating\x20new\x20version...',()=>_0x3e04f9[_0x41d2f8(0x1d1)]['createVersion'](_0x5e5aba),{'verbose':_0x2b5c62[_0x41d2f8(0x20f)]}),_0xc17b96=_0x124f12['data'];return console[_0x41d2f8(0x21f)](a26_0xce81a1[_0x41d2f8(0x1e4)]('✔')+'\x20Created\x20v'+_0xc17b96[_0x41d2f8(0x1b8)]['versionNumber']+'\x20(draft)\x20—\x20\x22'+_0xc17b96['attributes'][_0x41d2f8(0x1f9)]+'\x22'),console[_0x41d2f8(0x21f)](_0x41d2f8(0x275)+_0xc17b96['id']),await handleSingleObjectOutput({'id':_0xc17b96['id'],'name':_0xc17b96['attributes'][_0x41d2f8(0x1f9)],'version':_0xc17b96['attributes'][_0x41d2f8(0x184)],'state':_0xc17b96[_0x41d2f8(0x1b8)][_0x41d2f8(0x22f)],'bundle_id':_0xc17b96['attributes']['journeyBundleId'],'created_at':_0xc17b96[_0x41d2f8(0x1b8)][_0x41d2f8(0x19d)]},_0x2b5c62),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]='journey:version:view';['description']=a26_0xa84a1d(0x20b);async[a26_0xa84a1d(0x288)](_0x5b7afd){const _0x4a8f51=a26_0xa84a1d,{options:_0x324c27,args:_0x2d15b5,tdx:_0x3f3ee3}=_0x5b7afd,_0x3fe651=_0x2d15b5[0x0];if(!requireNameOrPath(_0x3fe651))return 0x1;const _0x51c844=_0x324c27[_0x4a8f51(0x1b2)];if(!_0x51c844)return console[_0x4a8f51(0x21f)](_0x4a8f51(0x19e)),console[_0x4a8f51(0x21f)](_0x4a8f51(0x235)),0x1;const _0x84892c=parseInt(_0x51c844,0xa);if(isNaN(_0x84892c)||_0x84892c<0x1)return console['error'](_0x4a8f51(0x266)+_0x51c844),0x1;if(_0x324c27[_0x4a8f51(0x20f)])console[_0x4a8f51(0x21f)](_0x4a8f51(0x240)+_0x3fe651+',\x20version:\x20'+_0x84892c);const {journeyId:_0x43fef7,parentSegmentId:_0x74aed5}=await resolveJourneyIdFromInput(_0x3fe651,_0x324c27,_0x3f3ee3),_0x19b448=await withSpinner('Resolving\x20version...',()=>_0x3f3ee3['journey']['listVersions'](_0x43fef7),{'verbose':_0x324c27['verbose']}),{versions:_0x26ccfe,latestJourneyId:_0x288501}=_0x19b448['data'],_0x339eda=_0x26ccfe[_0x4a8f51(0x286)](_0x58cf42=>_0x58cf42[_0x4a8f51(0x184)]===_0x84892c);if(!_0x339eda){const _0x359001=_0x26ccfe[_0x4a8f51(0x211)](_0x29ee52=>'v'+_0x29ee52[_0x4a8f51(0x184)])['join'](',\x20');return console[_0x4a8f51(0x21f)](_0x4a8f51(0x1f4)+_0x84892c+_0x4a8f51(0x221)+_0x359001),0x1;}const _0x3110e2=await withSpinner(_0x4a8f51(0x1e6)+_0x84892c+_0x4a8f51(0x1f7),()=>_0x3f3ee3[_0x4a8f51(0x1d1)][_0x4a8f51(0x1eb)](_0x339eda[_0x4a8f51(0x1fb)]),{'verbose':_0x324c27[_0x4a8f51(0x20f)]}),_0x4090af=_0x3110e2[_0x4a8f51(0x226)],_0x21a06f=getConsoleNextUrl(_0x324c27[_0x4a8f51(0x236)],_0x4a8f51(0x21a)+_0x74aed5+_0x4a8f51(0x1bf)+_0x339eda['journeyId']+_0x4a8f51(0x1c7));return await handleSingleObjectOutput({'id':_0x4090af['id'],'name':_0x4090af['attributes'][_0x4a8f51(0x1f9)],'version':_0x4090af['attributes']['versionNumber'],'description':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x1cc)],'state':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x22f)],'paused':_0x4090af['attributes'][_0x4a8f51(0x1c0)],'reentry_mode':_0x4090af[_0x4a8f51(0x1b8)]['reentryMode'],'stages':_0x4090af[_0x4a8f51(0x1b8)]['journeyStages']?.[_0x4a8f51(0x1a7)]||0x0,..._0x4090af[_0x4a8f51(0x1b8)]['goal']&&{'goal':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x26c)][_0x4a8f51(0x1f9)]},'latest':_0x339eda[_0x4a8f51(0x1fb)]===_0x288501,'created_at':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x19d)],'updated_at':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x28a)],'url':_0x21a06f},_0x324c27),0x0;}}
1
+ const a26_0x5ab450=a26_0x22f3;(function(_0x7f79d7,_0x43cb45){const _0x68fde4=a26_0x22f3,_0x17fec3=_0x7f79d7();while(!![]){try{const _0x1fed4b=parseInt(_0x68fde4(0x198))/0x1*(-parseInt(_0x68fde4(0x253))/0x2)+-parseInt(_0x68fde4(0x261))/0x3*(-parseInt(_0x68fde4(0x1e7))/0x4)+parseInt(_0x68fde4(0x25a))/0x5+parseInt(_0x68fde4(0x1af))/0x6+-parseInt(_0x68fde4(0x24b))/0x7+-parseInt(_0x68fde4(0x207))/0x8*(parseInt(_0x68fde4(0x214))/0x9)+parseInt(_0x68fde4(0x237))/0xa*(parseInt(_0x68fde4(0x1e1))/0xb);if(_0x1fed4b===_0x43cb45)break;else _0x17fec3['push'](_0x17fec3['shift']());}catch(_0x193cd1){_0x17fec3['push'](_0x17fec3['shift']());}}}(a26_0x1a87,0x7c7fd));import a26_0x372e0a from'chalk';import a26_0x14fa23 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';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';function a26_0x22f3(_0x50d6ed,_0x10d766){_0x50d6ed=_0x50d6ed-0x18e;const _0x1a8783=a26_0x1a87();let _0x22f36c=_0x1a8783[_0x50d6ed];return _0x22f36c;}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x49b051){const _0x329e7a=a26_0x22f3;return!_0x49b051&&(console[_0x329e7a(0x280)](_0x329e7a(0x1e8)),console[_0x329e7a(0x280)](_0x329e7a(0x208))),!!_0x49b051;}function withJsonFormat(_0x11993b){const _0x4de820=a26_0x22f3;if(!_0x11993b[_0x4de820(0x20d)]&&!_0x11993b['json']&&!_0x11993b[_0x4de820(0x243)]&&!_0x11993b[_0x4de820(0x1f9)])return{..._0x11993b,'format':_0x4de820(0x25d),'json':!![]};return _0x11993b;}function formatJourneyState(_0x4d0dfb){const _0xfa63e4=a26_0x22f3;switch(_0x4d0dfb){case _0xfa63e4(0x259):return a26_0x372e0a[_0xfa63e4(0x269)](_0xfa63e4(0x1c1));case'draft':return a26_0x372e0a['dim'](_0xfa63e4(0x1c2));case _0xfa63e4(0x272):return a26_0x372e0a[_0xfa63e4(0x1ed)](_0xfa63e4(0x19e));case _0xfa63e4(0x231):return a26_0x372e0a['blue']('(completed)');case _0xfa63e4(0x290):return a26_0x372e0a[_0xfa63e4(0x29b)]('(archived)');default:return'('+_0x4d0dfb+')';}}function formatJourneyItem(_0x34bc64,_0x278769='',_0x464769){const _0x45c64f=a26_0x22f3,_0x4bed42=formatJourneyState(_0x34bc64[_0x45c64f(0x299)]),_0xdfae7a=_0x464769?hyperlink(_0x34bc64['journeyBundleName'],_0x464769):_0x34bc64[_0x45c64f(0x233)];return _0x278769+_0x45c64f(0x1e0)+_0xdfae7a+'\x20'+_0x4bed42;}function escapeRegex(_0x39a233){return _0x39a233['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x3f2917){const _0x2e2d96=a26_0x22f3,_0x4e4f7e=_0x3f2917['split']('*')[_0x2e2d96(0x1db)](escapeRegex);return new RegExp(_0x4e4f7e[_0x2e2d96(0x1da)]('.*'),'i');}function buildRuleToNameMapping(_0x1cd81b){const _0x1a3ddd=a26_0x22f3,_0x3c9dc2=new Map();if(_0x1cd81b[_0x1a3ddd(0x1ea)])for(const [_0x3dd8ad,_0x25b045]of Object[_0x1a3ddd(0x244)](_0x1cd81b['segments'])){if(_0x25b045['rule']){const _0x28c422=serializeRule(_0x25b045[_0x1a3ddd(0x1a2)]),_0x2eb42a=_0x3c9dc2[_0x1a3ddd(0x27f)](_0x28c422);_0x2eb42a?_0x2eb42a[_0x1a3ddd(0x23a)](_0x3dd8ad):_0x3c9dc2['set'](_0x28c422,[_0x3dd8ad]);}}return _0x3c9dc2;}async function resolveJourneyIdFromInput(_0x28f6b1,_0x3989b0,_0x3d94f6){const _0x2ab751=a26_0x22f3,_0x15e518=await resolveJourneyTarget(_0x28f6b1,_0x3989b0[_0x2ab751(0x273)],_0x3989b0['verbose']),_0x2f182d=_0x15e518[_0x2ab751(0x273)];if(!_0x2f182d)throw new SDKError(ErrorCode[_0x2ab751(0x21d)],_0x2ab751(0x1a5));const _0x45db2a=await withSpinner(_0x2ab751(0x1f7),()=>_0x3d94f6[_0x2ab751(0x197)][_0x2ab751(0x1e9)](_0x2f182d),{'verbose':_0x3989b0[_0x2ab751(0x1c5)]}),_0x1e34f6=_0x45db2a[_0x2ab751(0x20c)],_0x2753c8=await withSpinner(_0x2ab751(0x201),()=>_0x3d94f6[_0x2ab751(0x232)][_0x2ab751(0x219)](_0x1e34f6,_0x15e518['journeyName']),{'verbose':_0x3989b0[_0x2ab751(0x1c5)]});return{'journeyId':_0x2753c8[_0x2ab751(0x20c)],'journeyName':_0x15e518['journeyName'],'parentSegmentId':_0x1e34f6};}async function resolveJourneyTarget(_0x4131f9,_0x147d99,_0x362b37){const _0x392051=a26_0x22f3;if(isYamlFilePath(_0x4131f9))try{const _0x3546f2=await resolveYamlFilePath(_0x4131f9);return _0x362b37&&(console['error'](_0x392051(0x278)+_0x4131f9),console['error'](_0x392051(0x1c7)+_0x3546f2['parentSegment']),console['error'](_0x392051(0x27b)+_0x3546f2['segmentName']),console['error'](_0x392051(0x28a)+(_0x3546f2[_0x392051(0x26f)]||_0x392051(0x1d9)))),{'journeyName':_0x3546f2[_0x392051(0x1d5)],'parentSegment':_0x3546f2[_0x392051(0x273)],'resolved':_0x3546f2};}catch(_0x524a4e){throw new SDKError(ErrorCode[_0x392051(0x21d)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x524a4e[_0x392051(0x230)]);}if(!_0x147d99)throw new SDKError(ErrorCode[_0x392051(0x21d)],_0x392051(0x29f));return{'journeyName':_0x4131f9,'parentSegment':_0x147d99};}export class JourneyListCommand extends BaseCommand{[a26_0x5ab450(0x1b3)]=a26_0x5ab450(0x1ca);[a26_0x5ab450(0x26c)]=a26_0x5ab450(0x1f3);async[a26_0x5ab450(0x276)](_0x3666cf){const _0x2411e6=a26_0x5ab450,{options:_0x4cd7f5,args:_0x15fecf,tdx:_0x1204eb}=_0x3666cf,_0x294842=_0x15fecf[0x0],_0x1d3a11=_0x4cd7f5[_0x2411e6(0x273)];if(!_0x1d3a11)return console[_0x2411e6(0x280)](_0x2411e6(0x190)),console[_0x2411e6(0x280)](_0x2411e6(0x194)),0x1;const _0x1c3889=await withSpinner(_0x2411e6(0x1f7),()=>_0x1204eb[_0x2411e6(0x197)][_0x2411e6(0x1e9)](_0x1d3a11),{'verbose':_0x4cd7f5[_0x2411e6(0x1c5)]}),_0x5cf6f1=_0x1c3889[_0x2411e6(0x20c)];_0x4cd7f5[_0x2411e6(0x1c5)]&&(console['error'](_0x2411e6(0x24c)+_0x1d3a11+_0x2411e6(0x257)+_0x5cf6f1+')'),_0x294842&&console[_0x2411e6(0x280)](_0x2411e6(0x1a3)+_0x294842));const _0x71ae86=await withSpinner(_0x2411e6(0x274),()=>_0x1204eb[_0x2411e6(0x197)]['getParentFull'](_0x5cf6f1),{'verbose':_0x4cd7f5[_0x2411e6(0x1c5)]}),_0x56d56f=_0x71ae86['data'],_0x1d9ff1=_0x56d56f[_0x2411e6(0x1a4)],_0x3187c7=await withSpinner(_0x2411e6(0x1fe),()=>_0x1204eb[_0x2411e6(0x232)][_0x2411e6(0x283)](_0x5cf6f1,_0x1d9ff1),{'verbose':_0x4cd7f5[_0x2411e6(0x1c5)]});let _0x2a1909=_0x3187c7[_0x2411e6(0x20c)][_0x2411e6(0x28e)];const _0x14b14c=_0x3187c7[_0x2411e6(0x20c)][_0x2411e6(0x1dd)],_0x3f114b=new Map();for(const _0x33a0a4 of _0x14b14c){_0x3f114b[_0x2411e6(0x2a2)](_0x33a0a4['id'],_0x33a0a4[_0x2411e6(0x1b3)]);}if(_0x294842){const _0x315ea1=globToRegex(_0x294842);_0x2a1909=_0x2a1909['filter'](_0x1d6f44=>_0x315ea1['test'](_0x1d6f44['journeyBundleName']));}console[_0x2411e6(0x280)](_0x2411e6(0x1a0)+_0x2a1909[_0x2411e6(0x289)]+_0x2411e6(0x29e)+(_0x2a1909[_0x2411e6(0x289)]!==0x1?'s':''));const _0x9dca6c=_0x8d58d5=>{const _0x233903=_0x2411e6;return getConsoleNextUrl(_0x4cd7f5[_0x233903(0x1bb)],_0x233903(0x291)+_0x5cf6f1+_0x233903(0x195)+_0x8d58d5+_0x233903(0x268));};if(_0x4cd7f5['format']==='table')await handleSDKOutput(_0x2a1909,_0x4cd7f5);else{if(_0x4cd7f5['format']===_0x2411e6(0x25d)){const _0x31968=_0x2a1909['map'](_0x2e339b=>({..._0x2e339b,'url':_0x9dca6c(_0x2e339b['id'])}));await handleSDKOutput(_0x31968,_0x4cd7f5);}else{console[_0x2411e6(0x267)]('['+_0x1d3a11+']');const _0x295299=new Map(),_0x14f997=[];for(const _0x5904d0 of _0x2a1909){if(!_0x5904d0[_0x2411e6(0x286)]||_0x5904d0[_0x2411e6(0x286)]===_0x1d9ff1)_0x14f997['push'](_0x5904d0);else{const _0x510167=_0x295299['get'](_0x5904d0[_0x2411e6(0x286)])||[];_0x510167[_0x2411e6(0x23a)](_0x5904d0),_0x295299['set'](_0x5904d0[_0x2411e6(0x286)],_0x510167);}}const _0x586aee=(_0x3e11c9,_0x4b8575)=>_0x3e11c9['journeyBundleName'][_0x2411e6(0x1d1)](_0x4b8575[_0x2411e6(0x233)],undefined,{'sensitivity':_0x2411e6(0x18e)});_0x14f997[_0x2411e6(0x1ad)](_0x586aee);for(const _0x5669d2 of _0x14f997){console[_0x2411e6(0x267)](formatJourneyItem(_0x5669d2,'',_0x9dca6c(_0x5669d2['id'])));}const _0x50701a=[..._0x295299['entries']()][_0x2411e6(0x1ad)]((_0x3d4630,_0xc372a7)=>{const _0x5c7e50=_0x2411e6,_0x74783=_0x3f114b[_0x5c7e50(0x27f)](_0x3d4630[0x0])||_0x3d4630[0x0],_0x2f5497=_0x3f114b['get'](_0xc372a7[0x0])||_0xc372a7[0x0];return _0x74783[_0x5c7e50(0x1d1)](_0x2f5497,undefined,{'sensitivity':_0x5c7e50(0x18e)});});for(const [_0x4bdd06,_0x1f4219]of _0x50701a){const _0x3bf432=_0x3f114b[_0x2411e6(0x27f)](_0x4bdd06)||_0x4bdd06;console[_0x2411e6(0x267)](_0x2411e6(0x222)+_0x3bf432),_0x1f4219[_0x2411e6(0x1ad)](_0x586aee);for(const _0x4ccca2 of _0x1f4219){console[_0x2411e6(0x267)](formatJourneyItem(_0x4ccca2,'\x20\x20',_0x9dca6c(_0x4ccca2['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a26_0x5ab450(0x1b3)]=a26_0x5ab450(0x258);[a26_0x5ab450(0x26c)]=a26_0x5ab450(0x23b);async[a26_0x5ab450(0x276)](_0x2e691a){const _0x321629=a26_0x5ab450,{options:_0x5af7f6,args:_0x2cba7f,tdx:_0x102960}=_0x2e691a,_0x42345f=_0x2cba7f[0x0];if(!_0x42345f)return console[_0x321629(0x280)](_0x321629(0x1e8)),console['error']('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x321629(0x280)](_0x321629(0x215)),console[_0x321629(0x280)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x5af7f6[_0x321629(0x1c5)]&&console[_0x321629(0x280)](_0x321629(0x22f)+_0x42345f);const {journeyId:_0x201e76,parentSegmentId:_0x362cd4}=await resolveJourneyIdFromInput(_0x42345f,_0x5af7f6,_0x102960);if(_0x5af7f6[_0x321629(0x266)]){const _0x32401c=getConsoleNextUrl(_0x5af7f6[_0x321629(0x1bb)],'/app/ps/'+_0x362cd4+_0x321629(0x195)+_0x201e76+_0x321629(0x23d));return console[_0x321629(0x280)](a26_0x372e0a[_0x321629(0x269)]('✔')+_0x321629(0x234)+a26_0x372e0a[_0x321629(0x24e)](_0x32401c)),openBrowser(_0x32401c),0x0;}const _0x9e83d8=await withSpinner(_0x321629(0x1f2),()=>_0x102960[_0x321629(0x232)]['getJourney'](_0x201e76),{'verbose':_0x5af7f6[_0x321629(0x1c5)]}),_0x5376b4=_0x9e83d8[_0x321629(0x20c)],_0xd96202=_0x5af7f6[_0x321629(0x287)];let _0x3bbc89;if(_0xd96202)try{const _0x39ef40=await withSpinner(_0x321629(0x1f0),()=>_0x102960[_0x321629(0x232)][_0x321629(0x284)](_0x201e76),{'verbose':_0x5af7f6[_0x321629(0x1c5)]});_0x3bbc89=_0x39ef40[_0x321629(0x20c)];}catch{_0x5af7f6[_0x321629(0x1c5)]&&console[_0x321629(0x280)](_0x321629(0x1b6));}const _0x1553f1=getConsoleNextUrl(_0x5af7f6[_0x321629(0x1bb)],_0x321629(0x291)+_0x362cd4+'/e/'+_0x201e76+_0x321629(0x23d)),_0x4a642d={'id':_0x5376b4['id'],'name':_0x5376b4[_0x321629(0x1ba)][_0x321629(0x1b3)],'description':_0x5376b4[_0x321629(0x1ba)]['description'],'state':_0x5376b4[_0x321629(0x1ba)]['state'],'paused':_0x5376b4[_0x321629(0x1ba)][_0x321629(0x272)],'reentry_mode':_0x5376b4[_0x321629(0x1ba)]['reentryMode'],'stages':_0x5376b4[_0x321629(0x1ba)][_0x321629(0x1fb)]?.[_0x321629(0x289)]||0x0,..._0x5376b4[_0x321629(0x1ba)][_0x321629(0x19b)]&&{'goal':_0x5376b4[_0x321629(0x1ba)]['goal'][_0x321629(0x1b3)]},..._0x3bbc89&&{'statistics':{'size':_0x3bbc89[_0x321629(0x2a1)],'entered':_0x3bbc89[_0x321629(0x249)],'goal_achieved':_0x3bbc89[_0x321629(0x23c)],'completion_rate':_0x3bbc89[_0x321629(0x292)],'exit_or_jump':_0x3bbc89['exitOrJumpSize'],'exit_or_jump_rate':_0x3bbc89[_0x321629(0x1a6)],'stages':_0x3bbc89[_0x321629(0x297)]}},'url':_0x1553f1};return await handleSingleObjectOutput(_0x4a642d,_0x5af7f6),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0x5ab450(0x1b3)]=a26_0x5ab450(0x270);[a26_0x5ab450(0x26c)]=a26_0x5ab450(0x281);async[a26_0x5ab450(0x276)](_0x19a657){const _0x576991=a26_0x5ab450,{options:_0x31455c,args:_0x12c0cf,tdx:_0x252fc8}=_0x19a657,_0x64ac99=_0x12c0cf[0x0];if(!requireNameOrPath(_0x64ac99))return 0x1;_0x31455c[_0x576991(0x1c5)]&&console[_0x576991(0x280)](_0x576991(0x22f)+_0x64ac99);const _0x56b08e=_0x31455c,_0x59ce59=_0x56b08e['from'],_0x2901aa=_0x56b08e['to'],_0x2d5b1e=_0x56b08e[_0x576991(0x22a)],_0x3f5179=_0x56b08e[_0x576991(0x217)];_0x2d5b1e&&!_0x59ce59&&!_0x2901aa&&console[_0x576991(0x280)](_0x576991(0x1a1));const _0x3816ae=_0x2d5b1e?withJsonFormat(_0x31455c):_0x31455c,{journeyId:_0x149651,journeyName:_0x186617}=await resolveJourneyIdFromInput(_0x64ac99,_0x3816ae,_0x252fc8),_0xeeea4=_0x59ce59||_0x2901aa?{'from':_0x59ce59,'to':_0x2901aa}:undefined,_0x43c29b=await withSpinner(_0x576991(0x1f0),()=>Promise['all']([_0x252fc8[_0x576991(0x232)][_0x576991(0x285)](_0x149651),_0x252fc8['journey'][_0x576991(0x284)](_0x149651,_0xeeea4)]),{'verbose':_0x3816ae[_0x576991(0x1c5)]}),[_0x13a84e,_0x4a196f]=_0x43c29b[_0x576991(0x20c)];if(!_0x4a196f||_0x4a196f[_0x576991(0x1d0)]===null)return console[_0x576991(0x280)](_0x576991(0x229)+_0x186617),console[_0x576991(0x280)](_0x576991(0x19c)),0x0;const _0x79f7cd=buildStageNameMap(_0x13a84e),_0x3d67cb=!!(_0xeeea4&&_0x4a196f[_0x576991(0x192)]?.[_0x576991(0x289)]),_0x474041={'stageNameMap':_0x79f7cd,'hasPeriod':_0x3d67cb,'includeHistory':!!_0x2d5b1e};if(_0x3f5179&&_0x4a196f[_0x576991(0x297)]){const _0x46838d=_0x4a196f[_0x576991(0x297)][_0x576991(0x220)](_0x4b9a37=>{const _0x31db88=_0x576991,_0x306011=_0x79f7cd['get'](_0x4b9a37['id'])??'';return _0x306011['toLowerCase']()===_0x3f5179[_0x31db88(0x1d3)]();});if(_0x46838d)return await handleSingleObjectOutput(formatStageStats(_0x46838d,_0x474041),_0x3816ae),0x0;const _0x236915=_0x4a196f[_0x576991(0x297)][_0x576991(0x1db)](_0x37cdd1=>_0x79f7cd[_0x576991(0x27f)](_0x37cdd1['id'])??_0x37cdd1['id']);return console[_0x576991(0x280)](_0x576991(0x254)+_0x3f5179+_0x576991(0x1e3)),console[_0x576991(0x280)](_0x576991(0x277)+_0x236915[_0x576991(0x1da)](',\x20')),0x1;}const _0x2c02ed=_0x4a196f['stages']?.[_0x576991(0x1db)](_0x2e0b23=>formatStageStats(_0x2e0b23,_0x474041)),_0x57e52e=assembleJourneyStats(_0x4a196f,{'from':_0x59ce59,'to':_0x2901aa,'includeHistory':_0x2d5b1e});return await this['renderStats'](_0x57e52e,_0x2c02ed??[],_0x3816ae),0x0;}async[a26_0x5ab450(0x1aa)](_0x4b1216,_0x1244bf,_0x4b2163){const _0x979436=a26_0x5ab450,_0x2daa35=_0x4b2163[_0x979436(0x20d)]===_0x979436(0x25d)||_0x4b2163[_0x979436(0x20d)]===_0x979436(0x243)||_0x4b2163[_0x979436(0x25d)]||_0x4b2163[_0x979436(0x243)];if(_0x2daa35){_0x4b1216[_0x979436(0x297)]=_0x1244bf,await handleSingleObjectOutput(_0x4b1216,_0x4b2163);return;}await handleSingleObjectOutput(_0x4b1216,_0x4b2163);for(const _0x51d306 of _0x1244bf){console[_0x979436(0x267)](''),console[_0x979436(0x267)](String(a26_0x372e0a['cyan'][_0x979436(0x21c)]('['+_0x51d306[_0x979436(0x1b3)]+']'))+a26_0x372e0a['dim']('\x20'+_0x51d306['id']));const {id:_0x2ed398,name:_0x198ab8,..._0x26d7d5}=_0x51d306;await handleSingleObjectOutput(_0x26d7d5,_0x4b2163);}}}function a26_0x1a87(){const _0x266da4=['utf-8','filePath','Resolving\x20parent\x20segment...','Error:\x20--version\x20option\x20is\x20required','tsv','Database:\x20','journeyStages','options','repeat','Listing\x20journeys...','add','limit','Resolving\x20journey...','getTrafficData','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journey:version:view','\x20\x20Target:\x20','resolveSegment','3784aNNKzv','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20unchanged\x20files','targetDir','segmentPushCommand','data','format','Listing\x20journey\x20activations...','\x0aError:','session','content','✔\x20Journey\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','13383ueBemb','Options:','Warning:\x20Could\x20not\x20resolve\x20activation\x20','stage','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','resolveJourneyId','Getting\x20journey\x20traffic\x20data...','cwd','bold','INVALID_ARGUMENT','resourceName','\x20journey\x20files\x20to\x20','find','helpText','📁\x20','getColumnMapping','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','\x20details...','listVersions','Error:\x20Invalid\x20version\x20number:\x20','Table:\x20','No\x20statistics\x20available\x20for\x20journey:\x20','includeHistory','Fetching\x20journeys\x20and\x20folders...','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parentName','Input:\x20','message','completed','journey','journeyBundleName','\x20Opening\x20','Fetching\x20users\x20and\x20connections...','versionNumber','606150WPCyUP','has','Creating\x20new\x20version...','push','Show\x20journey\x20details','goalSize','/j/da/je','diff','createdAt','connection','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','\x20Created\x20v','jsonl','entries','journey:traffic','getSegment','activationParams','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','enteredSize','Listing\x20journey\x20versions...','5680913yKLOgk','Parent\x20segment:\x20',',\x20version:\x20','cyan','links','\x20\x20-\x20','\x20\x20Preserving\x20local\x20segment\x20name:\x20','List\x20all\x20versions\x20of\x20a\x20journey','12luSvUm','Error:\x20Stage\x20\x22','completeMilestoneRate','No\x20journeys\x20found','\x20(ID:\x20','journey:view','launched','2357390GVJpyu','listActivationsFlat','nodes','json','all','\x20journeys','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','1076217kRdyjc','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20files?','Pause\x20a\x20running\x20journey','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','web','log','/j/da','green','buildIdToEmailMap','setPhase','description','red','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','folderPath','journey:stats','getActivation','paused','parentSegment','Fetching\x20parent\x20segment...','\x20not\x20found.\x20Available:\x20','execute','Available\x20stages:\x20','Resolved\x20YAML\x20file:\x20','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','relativePath','\x20\x20Name:\x20','...','\x27\x20not\x20found\x20in\x20','audienceId','get','error','Show\x20journey\x20statistics','hasChanges','listJourneysWithFolders','getStatistics','getJourney','folderId','includeStats','Journey\x20name:\x20','length','\x20\x20Folder\x20path:\x20','filter','✔\x20Context\x20set:\x20','Cancelled','journeys','updatedAt','archived','/app/ps/','completionRate','relative','.yml','Resuming\x20journey...','user','stages','Fetching\x20','state','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','dim','\x20(rule\x20match)','args','\x20journey','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','activation_','size','set','journeyBundleId','type','no_parent','root\x20folder','base','-\x20no\x20files\x20written','Error:\x20Parent\x20segment\x20context\x20required','Target\x20file:\x20','history','errorCode','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','/e/','journey:pause','segment','4387oUtkmf','listJourneysFromParentSegment','table','goal','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','absolutePath','(paused)','resume','✔\x20Found\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','rule','Pattern:\x20','rootFolderId','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','exitOrJumpRate','✔\x20Pulled\x20','\x20changed\x20files','Found\x20','renderStats','milestoneSize','stageNameMap','sort','conversion','3325194BEiSqT','\x20=\x20','Write\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','name','Error:\x20','journey:columns','\x20\x20Statistics\x20not\x20available','hasPeriod','Getting\x20column\x20mapping...','Aborted.','attributes','site','parent_segment','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Folder\x20path:\x20','journey:activations','journey:pull','(running)','(draft)','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)','yes','verbose','values','\x20\x20Parent\x20segment:\x20','tdx.json','then','journey:list','Pausing\x20journey...','activation','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20new\x20files','\x0aPull\x20summary:','journeyId','localeCompare','Warning:\x20Could\x20not\x20resolve\x20segment\x20','toLowerCase','\x20version','segmentName','Error:\x20Journey\x20not\x20found:\x20','database','file','(root)','join','map','pause','folders','columns','buildIdToNameMap','🗺️\x20','121PuHIZz','version','\x22\x20not\x20found','stringify','getLatestJourneyId','\x22\x20resumed','4OcPsRi','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','resolveParentId','segments','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','reentryMode','yellow','List\x20activations\x20for\x20a\x20journey','journey:resume','Getting\x20journey\x20statistics...','isNew','Getting\x20journey\x20details...','List\x20journeys\x20in\x20current\x20context','from'];a26_0x1a87=function(){return _0x266da4;};return a26_0x1a87();}export class JourneyTrafficCommand extends BaseCommand{[a26_0x5ab450(0x1b3)]=a26_0x5ab450(0x245);[a26_0x5ab450(0x26c)]=a26_0x5ab450(0x1eb);async['execute'](_0x59c686){const _0x67d9fa=a26_0x5ab450,{options:_0x132e97,args:_0x5e7ded,tdx:_0x1548c7}=_0x59c686,_0x2b741e=_0x5e7ded[0x0];if(!requireNameOrPath(_0x2b741e))return 0x1;_0x132e97[_0x67d9fa(0x1c5)]&&console[_0x67d9fa(0x280)](_0x67d9fa(0x22f)+_0x2b741e);const _0x178e60=_0x132e97,_0x53ea81=_0x178e60[_0x67d9fa(0x2a4)],_0x4c4858=_0x178e60[_0x67d9fa(0x1f4)],_0x181e65=_0x178e60['to'],_0xff75d0=_0x178e60[_0x67d9fa(0x200)];if(_0x53ea81&&_0x53ea81!==_0x67d9fa(0x1ae)&&_0x53ea81!==_0x67d9fa(0x1cc))return console[_0x67d9fa(0x280)]('Error:\x20Invalid\x20--type\x20\x22'+_0x53ea81+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x4ec65f=withJsonFormat(_0x132e97),{journeyId:_0x265fed,journeyName:_0x2aae5a}=await resolveJourneyIdFromInput(_0x2b741e,_0x4ec65f,_0x1548c7),_0x262a8a={'type':_0x53ea81,'from':_0x4c4858,'to':_0x181e65,'limit':_0xff75d0},_0x57572b=await withSpinner(_0x67d9fa(0x21a),()=>_0x1548c7[_0x67d9fa(0x232)][_0x67d9fa(0x202)](_0x265fed,_0x262a8a),{'verbose':_0x4ec65f[_0x67d9fa(0x1c5)]}),_0x557e64=_0x57572b['data'],_0x360fb2=_0x557e64[_0x67d9fa(0x1ae)]&&(_0x557e64[_0x67d9fa(0x1ae)][_0x67d9fa(0x25c)][_0x67d9fa(0x289)]>0x0||_0x557e64[_0x67d9fa(0x1ae)][_0x67d9fa(0x24f)]['length']>0x0),_0x17222a=_0x557e64['activation']&&_0x557e64[_0x67d9fa(0x1cc)][_0x67d9fa(0x289)]>0x0;if(!_0x360fb2&&!_0x17222a)return console[_0x67d9fa(0x280)](_0x67d9fa(0x279)+_0x2aae5a),console['error'](_0x67d9fa(0x22c)),_0x4c4858&&_0x181e65&&console[_0x67d9fa(0x280)]('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(_0x557e64,_0x4ec65f),0x0;}}function formatStageStats(_0x46adb5,_0x477bde){const _0x46878c=a26_0x5ab450,_0x9b06bd=_0x477bde[_0x46878c(0x1b7)]&&_0x46adb5[_0x46878c(0x192)]?.[_0x46878c(0x289)]?aggregateStageHistory(_0x46adb5[_0x46878c(0x192)]):{'size':_0x46adb5['size'],'entered':_0x46adb5[_0x46878c(0x249)],'milestone':_0x46adb5[_0x46878c(0x1ab)],'milestone_rate':_0x46adb5[_0x46878c(0x255)],'exit_or_jump':_0x46adb5['exitOrJumpSize'],'exit_or_jump_rate':_0x46adb5[_0x46878c(0x1a6)]},_0x10587e={'id':_0x46adb5['id'],'name':_0x477bde[_0x46878c(0x1ac)][_0x46878c(0x27f)](_0x46adb5['id'])??_0x46adb5['id'],..._0x9b06bd};return _0x477bde[_0x46878c(0x1b7)]&&_0x477bde[_0x46878c(0x22a)]&&_0x46adb5[_0x46878c(0x192)]&&(_0x10587e[_0x46878c(0x192)]=_0x46adb5['history']),_0x10587e;}export class JourneyPauseCommand extends BaseCommand{['name']=a26_0x5ab450(0x196);[a26_0x5ab450(0x26c)]=a26_0x5ab450(0x264);async['execute'](_0x57de4d){const _0x114b07=a26_0x5ab450,{options:_0x46b57c,args:_0x2ee97f,tdx:_0x9f6ba}=_0x57de4d,_0x15882f=_0x2ee97f[0x0];if(!requireNameOrPath(_0x15882f))return 0x1;_0x46b57c[_0x114b07(0x1c5)]&&console[_0x114b07(0x280)](_0x114b07(0x22f)+_0x15882f);const {journeyId:_0x3cc235,journeyName:_0x5b1165}=await resolveJourneyIdFromInput(_0x15882f,_0x46b57c,_0x9f6ba);if(!_0x46b57c[_0x114b07(0x1c4)]){const _0x4f72c8=await confirm(_0x114b07(0x224)+_0x5b1165+'\x22?');if(!_0x4f72c8)return console[_0x114b07(0x280)](_0x114b07(0x28d)),0x0;}const _0x22a2d1=await withSpinner(_0x114b07(0x1cb),()=>_0x9f6ba['journey'][_0x114b07(0x1dc)](_0x3cc235),{'verbose':_0x46b57c[_0x114b07(0x1c5)]}),_0x826100=_0x22a2d1[_0x114b07(0x20c)];return console[_0x114b07(0x280)](_0x114b07(0x212)+_0x826100[_0x114b07(0x1ba)][_0x114b07(0x1b3)]+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0x5ab450(0x1b3)]=a26_0x5ab450(0x1ef);['description']='Resume\x20a\x20paused\x20journey';async[a26_0x5ab450(0x276)](_0x41ce5c){const _0x1b527f=a26_0x5ab450,{options:_0x2a4fa7,args:_0x1ebd7a,tdx:_0x501312}=_0x41ce5c,_0x55e45a=_0x1ebd7a[0x0];if(!requireNameOrPath(_0x55e45a))return 0x1;_0x2a4fa7['verbose']&&console['error'](_0x1b527f(0x22f)+_0x55e45a);const {journeyId:_0x4da282,journeyName:_0x40be8d}=await resolveJourneyIdFromInput(_0x55e45a,_0x2a4fa7,_0x501312);if(!_0x2a4fa7[_0x1b527f(0x1c4)]){const _0x130c43=await confirm(_0x1b527f(0x26e)+_0x40be8d+'\x22?');if(!_0x130c43)return console[_0x1b527f(0x280)](_0x1b527f(0x28d)),0x0;}const _0xc40f4e=await withSpinner(_0x1b527f(0x295),()=>_0x501312[_0x1b527f(0x232)][_0x1b527f(0x19f)](_0x4da282),{'verbose':_0x2a4fa7[_0x1b527f(0x1c5)]}),_0x2ed708=_0xc40f4e[_0x1b527f(0x20c)];return console['error'](_0x1b527f(0x212)+_0x2ed708[_0x1b527f(0x1ba)][_0x1b527f(0x1b3)]+_0x1b527f(0x1e6)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a26_0x5ab450(0x1c0);[a26_0x5ab450(0x26c)]='Export\x20journey(s)\x20as\x20YAML\x20files';async['execute'](_0x4d1a79){const _0x546043=a26_0x5ab450,{options:_0x163e87,args:_0x4649c0,tdx:_0x4b7467}=_0x4d1a79,_0x276f1a=_0x163e87,_0x4c7db5=_0x4649c0[0x0],_0x291845=_0x4c7db5&&isYamlFilePath(_0x4c7db5),_0x4653ef=await resolveTarget({'arg':_0x291845?_0x4c7db5:undefined,'contextParent':_0x163e87['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4653ef))return _0x4653ef[_0x546043(0x193)]===_0x546043(0x2a5)?(console['error'](a26_0x372e0a[_0x546043(0x1ed)](_0x546043(0x248))),console[_0x546043(0x280)](_0x546043(0x1c3)),console[_0x546043(0x280)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x546043(0x280)](_0x546043(0x213)),console[_0x546043(0x280)](_0x546043(0x203))):(console[_0x546043(0x280)](a26_0x372e0a[_0x546043(0x26d)](_0x546043(0x1b4)+_0x4653ef['message']+'\x0a')),_0x4653ef['helpText']&&console[_0x546043(0x280)](a26_0x372e0a[_0x546043(0x24e)](_0x4653ef[_0x546043(0x221)]))),0x1;let _0x4d053c=_0x291845?undefined:_0x4c7db5,_0x28acc0,_0x5db50b;_0x4653ef[_0x546043(0x2a4)]===_0x546043(0x1d8)&&(_0x4d053c=_0x4653ef[_0x546043(0x21e)],_0x28acc0=_0x4653ef['filePath'],_0x5db50b=_0x4653ef[_0x546043(0x26f)]);const _0x35a368=_0x4653ef[_0x546043(0x22e)],_0x17fb44=_0x4653ef[_0x546043(0x20a)];_0x276f1a['verbose']&&(console['error'](_0x546043(0x24c)+_0x35a368),console['error']('Target\x20directory:\x20'+_0x17fb44),_0x4d053c&&console[_0x546043(0x280)](_0x546043(0x288)+_0x4d053c),_0x28acc0&&console[_0x546043(0x280)](_0x546043(0x191)+_0x28acc0),_0x5db50b&&console[_0x546043(0x280)](_0x546043(0x1be)+_0x5db50b));const _0x9ef842=await withSpinner(_0x546043(0x1f7),()=>_0x4b7467[_0x546043(0x197)]['resolveParentId'](_0x35a368),{'verbose':_0x163e87[_0x546043(0x1c5)]}),_0x90043=_0x9ef842[_0x546043(0x20c)],{journeys:_0x1e878c,folders:_0x11a7e5}=await withSpinner(_0x546043(0x22b),async()=>{const _0x2e4218=_0x546043,[_0x3e52c2,_0x8c40f2]=await Promise[_0x2e4218(0x25e)]([_0x4b7467[_0x2e4218(0x232)][_0x2e4218(0x199)](_0x90043,undefined,{'includeAllVersions':!![]}),_0x4b7467[_0x2e4218(0x197)]['listFolders'](_0x90043)]);return{'journeys':_0x3e52c2,'folders':_0x8c40f2};},{'verbose':_0x163e87['verbose']})[_0x546043(0x1c9)](_0x10d671=>_0x10d671[_0x546043(0x20c)]);let _0x38376b=_0x1e878c;const _0x40f522=buildFolderIdToPathMap(_0x11a7e5);if(_0x4d053c){const _0x4c768e=_0x38376b[_0x546043(0x28b)](_0xd99a6e=>_0xd99a6e['journeyBundleName'][_0x546043(0x1d3)]()===_0x4d053c[_0x546043(0x1d3)]());if(_0x4c768e[_0x546043(0x289)]===0x0)return console[_0x546043(0x280)](_0x546043(0x1d6)+_0x4d053c),console[_0x546043(0x280)](_0x546043(0x29a)),0x1;_0x38376b=_0x4c768e;}if(_0x5db50b!==undefined){const _0x412b86=_0x38376b['filter'](_0x47c58d=>{const _0x2fb059=_0x546043,_0x5c1c79=_0x47c58d[_0x2fb059(0x286)]?_0x40f522[_0x2fb059(0x27f)](_0x47c58d[_0x2fb059(0x286)])||'':'';return _0x5c1c79===_0x5db50b;});if(_0x412b86['length']===0x0&&_0x38376b[_0x546043(0x289)]>0x0){console[_0x546043(0x280)]('Error:\x20Journey\x20\x27'+_0x4d053c+_0x546043(0x27d)+(_0x5db50b||_0x546043(0x2a6))),console[_0x546043(0x280)](_0x546043(0x265));for(const _0x4f82e9 of _0x38376b){const _0x3240ca=_0x4f82e9[_0x546043(0x286)]?_0x40f522[_0x546043(0x27f)](_0x4f82e9[_0x546043(0x286)])||'':'';console[_0x546043(0x280)](_0x546043(0x250)+(_0x3240ca||_0x546043(0x1d9))+'/'+_0x4f82e9[_0x546043(0x233)]);}return 0x1;}_0x38376b=_0x412b86;}if(_0x38376b['length']===0x0)return console[_0x546043(0x280)](_0x546043(0x256)),0x0;const _0x39709e=new Map();for(const _0x165745 of _0x38376b){const _0x2066dc=_0x165745[_0x546043(0x2a3)];!_0x39709e[_0x546043(0x238)](_0x2066dc)&&_0x39709e[_0x546043(0x2a2)](_0x2066dc,[]),_0x39709e['get'](_0x2066dc)[_0x546043(0x23a)](_0x165745);}for(const _0x5c383a of _0x39709e[_0x546043(0x1c6)]()){_0x5c383a[_0x546043(0x1ad)]((_0x54a6aa,_0x21cf17)=>(_0x54a6aa[_0x546043(0x236)]||0x0)-(_0x21cf17['versionNumber']||0x0));}const _0x3ab787=[],{idToEmailMap:_0xef1fd2,connectionIdToNameMap:_0x11549e}=await withSpinner(_0x546043(0x235),async()=>{const _0x26e5a8=_0x546043,[_0x5c6d4b,_0x244490]=await Promise['all']([_0x4b7467[_0x26e5a8(0x296)][_0x26e5a8(0x26a)](),_0x4b7467[_0x26e5a8(0x240)][_0x26e5a8(0x1df)]()]);return{'idToEmailMap':_0x5c6d4b,'connectionIdToNameMap':_0x244490};},{'verbose':_0x163e87[_0x546043(0x1c5)]})['then'](_0x363bea=>_0x363bea['data']);for(const _0x53d518 of _0x39709e['values']()){const _0x4d9050=_0x53d518[0x0][_0x546043(0x233)],_0x35c1f8=_0x53d518[0x0]['folderId'],_0x1db76f=_0x35c1f8?_0x40f522[_0x546043(0x27f)](_0x35c1f8)||'':'',_0x379305=_0x1db76f?a26_0x14fa23['join'](_0x17fb44,_0x1db76f):_0x17fb44,_0x480f66=_0x28acc0||a26_0x14fa23['join'](_0x379305,sanitizeFileName(_0x4d9050)+_0x546043(0x294));let _0x355e33,_0x237ea7;if(existsSync(_0x480f66))try{const _0x1c616e=readFileSync(_0x480f66,_0x546043(0x1f5)),_0x587c5b=parseYamlString(_0x1c616e);_0x237ea7=_0x587c5b,_0x355e33=buildRuleToNameMapping(_0x587c5b),_0x276f1a[_0x546043(0x1c5)]&&_0x355e33[_0x546043(0x2a1)]>0x0&&console[_0x546043(0x280)](_0x546043(0x1a9)+_0x355e33[_0x546043(0x2a1)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x4d9050);}catch(_0x4f8f54){_0x276f1a[_0x546043(0x1c5)]&&console[_0x546043(0x280)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x4f8f54['message']);}const _0x44b079=[],_0x1ee5d7=new Set(),_0x1079e0=new Map(),_0x587a00=new Map(),_0x2dedf1=new Set(),_0x2a8199=new Map(),_0x514eb7=new Map(),_0x542c9a=createJumpTargetCache();await withProgressSpinner(_0x546043(0x298)+_0x4d9050+_0x546043(0x27c),async _0xdcd626=>{const _0x1f7b97=_0x546043;for(const _0x51592f of _0x53d518){const _0x4e3c75=_0x53d518[_0x1f7b97(0x289)]>0x1?_0x51592f[_0x1f7b97(0x233)]+'\x20v'+(_0x51592f[_0x1f7b97(0x236)]||0x1):_0x51592f['journeyBundleName'];_0xdcd626[_0x1f7b97(0x26b)](_0x1f7b97(0x298)+_0x4e3c75);const _0x30d4c3=await _0x4b7467['journey'][_0x1f7b97(0x285)](_0x51592f['id']),_0x4a0664=_0x30d4c3[_0x1f7b97(0x1ba)]?.[_0x1f7b97(0x27e)],_0x21dbb5={'resolveSegment':async _0x2971b2=>{const _0x47ac81=_0x1f7b97;if(!_0x4a0664)return{'name':_0x2971b2,'isJourneyLocal':![]};const _0x56cd10=_0x1079e0[_0x47ac81(0x27f)](_0x2971b2);if(_0x56cd10)return _0x56cd10;try{const _0x4c90dc=await _0x4b7467[_0x47ac81(0x197)][_0x47ac81(0x246)](_0x4a0664,_0x2971b2),_0x1ec056=_0x4c90dc['kind']===SEGMENT_KIND_JOURNEY;let _0x569954,_0x362e5d=_0x4c90dc[_0x47ac81(0x1b3)];if(_0x1ec056&&_0x4c90dc[_0x47ac81(0x1a2)]){const _0x20f0cb=await segmentResponseToDef(_0x4c90dc,{'resolveSegmentName':async _0x3f2219=>{const _0x552a0d=_0x47ac81,_0x30e065=_0x1079e0[_0x552a0d(0x27f)](_0x3f2219);if(_0x30e065)return _0x30e065[_0x552a0d(0x1b3)];const _0x392e27=await _0x21dbb5[_0x552a0d(0x206)](_0x3f2219);return _0x392e27[_0x552a0d(0x1b3)];}}),_0x4fa833=_0x20f0cb['rule'];_0x569954={'description':_0x4c90dc['description'],'rule':_0x4fa833};const _0x4893b3=serializeRule(_0x4fa833),_0x1da910=_0x587a00['get'](_0x4893b3);if(_0x1da910)_0x362e5d=_0x1da910,_0x569954=undefined,_0x276f1a[_0x47ac81(0x1c5)]&&console[_0x47ac81(0x280)](_0x47ac81(0x1b2)+_0x4c90dc['name']+'\x20->\x20'+_0x1da910);else{let _0x316cea=![];if(_0x355e33){const _0x46d385=_0x355e33[_0x47ac81(0x27f)](_0x4893b3);if(_0x46d385){const _0xbe3a5a=_0x46d385['find'](_0x586fc4=>!_0x1ee5d7[_0x47ac81(0x238)](_0x586fc4));_0xbe3a5a&&(_0x362e5d=_0xbe3a5a,_0x1ee5d7[_0x47ac81(0x1ff)](_0xbe3a5a),_0x587a00[_0x47ac81(0x2a2)](_0x4893b3,_0xbe3a5a),_0x316cea=!![],_0x276f1a[_0x47ac81(0x1c5)]&&console[_0x47ac81(0x280)](_0x47ac81(0x251)+_0xbe3a5a+_0x47ac81(0x29c)));}}if(!_0x316cea){const _0x1c9bb5=generateJourneyLocalName(_0x4c90dc[_0x47ac81(0x1b3)]);_0x1c9bb5&&(_0x362e5d=_0x1c9bb5);let _0x43886e=_0x362e5d,_0x5e1521=0x2;while(_0x1ee5d7[_0x47ac81(0x238)](_0x43886e)){_0x43886e=_0x362e5d+'_'+_0x5e1521,_0x5e1521++;}_0x1ee5d7[_0x47ac81(0x1ff)](_0x43886e),_0x587a00['set'](_0x4893b3,_0x43886e),_0x362e5d=_0x43886e;}}}const _0x2a630c={'name':_0x362e5d,'isJourneyLocal':_0x1ec056,'definition':_0x569954};return _0x1079e0[_0x47ac81(0x2a2)](_0x2971b2,_0x2a630c),_0x2a630c;}catch(_0x401d44){return _0x163e87['verbose']&&console[_0x47ac81(0x280)](_0x47ac81(0x1d2)+_0x2971b2+':\x20'+_0x401d44['message']),{'name':_0x2971b2,'isJourneyLocal':![]};}},'resolveActivation':async _0x20724c=>{const _0x4c592b=_0x1f7b97,_0x633ec2=_0x2a8199[_0x4c592b(0x27f)](_0x20724c);if(_0x633ec2)return _0x633ec2;try{const _0x479b6a=await _0x4b7467[_0x4c592b(0x232)][_0x4c592b(0x271)](_0x51592f['id'],_0x20724c),_0x2fbe8e=journeyActivationStepToYaml(_0x479b6a,_0xef1fd2,_0x11549e),_0x298fcd=JSON[_0x4c592b(0x1e4)]({'name':_0x2fbe8e['name'],'connection':_0x2fbe8e[_0x4c592b(0x240)],'connector_config':_0x2fbe8e['connector_config']}),_0x120b56=_0x514eb7[_0x4c592b(0x27f)](_0x298fcd);if(_0x120b56){const _0x3f095c={'name':_0x120b56,'isJourneyLocal':!![],'definition':_0x2fbe8e};return _0x2a8199['set'](_0x20724c,_0x3f095c),_0x3f095c;}const _0x40b2b4=_0x479b6a['attributes'][_0x4c592b(0x247)][_0x4c592b(0x1b3)]||_0x20724c,_0x197005=sanitizeYamlKey(_0x40b2b4)||_0x4c592b(0x2a0)+_0x20724c;let _0x58bfa3=_0x197005,_0x2a78b8=0x2;while(_0x2dedf1['has'](_0x58bfa3)){_0x58bfa3=_0x197005+'_'+_0x2a78b8,_0x2a78b8++;}_0x2dedf1[_0x4c592b(0x1ff)](_0x58bfa3),_0x514eb7[_0x4c592b(0x2a2)](_0x298fcd,_0x58bfa3);const _0x1075cd={'name':_0x58bfa3,'isJourneyLocal':!![],'definition':_0x2fbe8e};return _0x2a8199[_0x4c592b(0x2a2)](_0x20724c,_0x1075cd),_0x1075cd;}catch(_0x2d6362){return _0x163e87[_0x4c592b(0x1c5)]&&console['error'](_0x4c592b(0x216)+_0x20724c+':\x20'+_0x2d6362[_0x4c592b(0x230)]),{'name':_0x20724c,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5aff74,_0x7a2078)=>{const _0x3b6e43=_0x1f7b97;return resolveJumpTarget(_0x5aff74,_0x7a2078,_0x542c9a,_0x3d0b5d=>_0x4b7467[_0x3b6e43(0x232)]['getJourney'](_0x3d0b5d));}},_0x223fa4=await journeyResponseToDef(_0x30d4c3,_0x21dbb5);_0x44b079['push']({'item':_0x51592f,'yaml':_0x223fa4});}},{'verbose':_0x163e87['verbose']});const _0x2db479=await _0x4b7467[_0x546043(0x232)][_0x546043(0x1e5)](_0x53d518[0x0][_0x546043(0x2a3)]),_0x30b5bd=buildMergedJourneyDef(_0x44b079,_0x355e33,_0x2db479),_0x43d061=normalizeJourneyDef(_0x30b5bd,_0x237ea7),_0xebb958=toYamlString(_0x43d061),_0xe63686=_0x28acc0||a26_0x14fa23[_0x546043(0x1da)](_0x379305,sanitizeFileName(_0x4d9050)+_0x546043(0x294));!_0x28acc0&&_0x1db76f&&!existsSync(_0x379305)&&mkdirSync(_0x379305,{'recursive':!![]});const _0x479ba8=a26_0x14fa23[_0x546043(0x293)](process['cwd'](),_0xe63686);if(existsSync(_0xe63686)){const _0x56c531=readFileSync(_0xe63686,_0x546043(0x1f5)),_0x3d9e72=generateDiff(_0x56c531,_0xebb958),_0x6826a4=hasChanges(_0x3d9e72);_0x3ab787[_0x546043(0x23a)]({'relativePath':_0x479ba8,'absolutePath':_0xe63686,'content':_0xebb958,'isNew':![],'hasChanges':_0x6826a4,'diff':_0x6826a4?formatDiffWithColors(_0x3d9e72):undefined});}else _0x3ab787[_0x546043(0x23a)]({'relativePath':_0x479ba8,'absolutePath':_0xe63686,'content':_0xebb958,'isNew':!![],'hasChanges':![]});}const _0x2dde7d=_0x3ab787[_0x546043(0x28b)](_0x1dc2e4=>_0x1dc2e4[_0x546043(0x1f1)]),_0x171fe6=_0x3ab787[_0x546043(0x28b)](_0x274b46=>!_0x274b46[_0x546043(0x1f1)]&&_0x274b46['hasChanges']),_0x31d86e=_0x3ab787[_0x546043(0x28b)](_0x47001e=>!_0x47001e[_0x546043(0x1f1)]&&!_0x47001e['hasChanges']),_0x3721b5=_0x38376b[_0x546043(0x289)],_0x312299=_0x39709e[_0x546043(0x2a1)],_0x523fbb=_0x3721b5>_0x312299?'\x20('+_0x3721b5+'\x20versions)':'';console['error'](_0x546043(0x1cf)),console[_0x546043(0x280)]('\x20\x20'+a26_0x372e0a[_0x546043(0x24e)](_0x312299+_0x546043(0x25f))+a26_0x372e0a['dim'](_0x523fbb)),console[_0x546043(0x280)]('\x20\x20'+a26_0x372e0a[_0x546043(0x269)]('+\x20'+_0x2dde7d[_0x546043(0x289)]+_0x546043(0x1ce))),console[_0x546043(0x280)]('\x20\x20'+a26_0x372e0a[_0x546043(0x1ed)]('~\x20'+_0x171fe6['length']+_0x546043(0x1a8))),console[_0x546043(0x280)]('\x20\x20'+a26_0x372e0a[_0x546043(0x29b)]('=\x20'+_0x31d86e[_0x546043(0x289)]+_0x546043(0x209))),console[_0x546043(0x280)](_0x546043(0x205)+a26_0x372e0a[_0x546043(0x24e)](_0x17fb44)+'\x0a');if(_0x171fe6['length']>0x0)for(const _0x51df97 of _0x171fe6){console[_0x546043(0x280)]('\x0aChanges\x20to\x20\x27'+_0x51df97[_0x546043(0x27a)]+'\x27:'),console['error']('─'[_0x546043(0x1fd)](0x3c)),console[_0x546043(0x280)](_0x51df97[_0x546043(0x23e)]),console['error']('─'[_0x546043(0x1fd)](0x3c));}if(_0x276f1a['dryRun'])return console[_0x546043(0x280)](a26_0x372e0a[_0x546043(0x1ed)](_0x546043(0x260))),0x0;if(_0x2dde7d[_0x546043(0x289)]===0x0&&_0x171fe6[_0x546043(0x289)]===0x0)return console[_0x546043(0x280)](a26_0x372e0a[_0x546043(0x269)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x35a368},_0x276f1a[_0x546043(0x210)]),console['error'](a26_0x372e0a['green']('✔\x20Context\x20set:\x20'+a26_0x372e0a[_0x546043(0x29b)](_0x546043(0x1bc))+_0x546043(0x1b0)+a26_0x372e0a['cyan'](_0x35a368))),0x0;if(!_0x276f1a[_0x546043(0x1c4)]&&(_0x2dde7d[_0x546043(0x289)]>0x0||_0x171fe6[_0x546043(0x289)]>0x0)){if(!isInteractive())return console['error'](a26_0x372e0a[_0x546043(0x26d)](_0x546043(0x20f)),_0x546043(0x262)),console['error'](a26_0x372e0a[_0x546043(0x29b)](_0x546043(0x22d))),0x1;const _0x441569=await confirmKey(_0x546043(0x1b1)+(_0x2dde7d['length']+_0x171fe6['length'])+_0x546043(0x263));if(!_0x441569)return console[_0x546043(0x280)](a26_0x372e0a[_0x546043(0x1ed)](_0x546043(0x1b9)),_0x546043(0x18f)),0x1;}!existsSync(_0x17fb44)&&mkdirSync(_0x17fb44,{'recursive':!![]});const _0x3e0dba=a26_0x14fa23['join'](_0x17fb44,_0x546043(0x1c8));writeFileSync(_0x3e0dba,createTdxConfigContent(_0x35a368),_0x546043(0x1f5));for(const _0x5a3294 of _0x3ab787){(_0x5a3294[_0x546043(0x1f1)]||_0x5a3294[_0x546043(0x282)])&&writeFileSync(_0x5a3294[_0x546043(0x19d)],_0x5a3294[_0x546043(0x211)],_0x546043(0x1f5));}return console[_0x546043(0x280)](a26_0x372e0a['green'](_0x546043(0x1a7)+(_0x2dde7d['length']+_0x171fe6[_0x546043(0x289)])+_0x546043(0x21f)+_0x17fb44)),saveSessionContext({'parent_segment':_0x35a368},_0x276f1a[_0x546043(0x210)]),console[_0x546043(0x280)](a26_0x372e0a[_0x546043(0x269)](_0x546043(0x28c)+a26_0x372e0a[_0x546043(0x29b)](_0x546043(0x1bc))+_0x546043(0x1b0)+a26_0x372e0a[_0x546043(0x24e)](_0x35a368))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0x5ab450(0x1b3)]=a26_0x5ab450(0x1b5);[a26_0x5ab450(0x26c)]='Show\x20journey\x20table\x20column\x20mapping';async[a26_0x5ab450(0x276)](_0xa06b01){const _0x2798f5=a26_0x5ab450,{options:_0x36e31b,args:_0x8b3541,tdx:_0x3d7053}=_0xa06b01,_0x23e122=_0x8b3541[0x0];if(!requireNameOrPath(_0x23e122))return 0x1;_0x36e31b[_0x2798f5(0x1c5)]&&console[_0x2798f5(0x280)](_0x2798f5(0x22f)+_0x23e122);const {journeyId:_0x146146}=await resolveJourneyIdFromInput(_0x23e122,_0x36e31b,_0x3d7053),_0x134e0e=await withSpinner(_0x2798f5(0x1b8),()=>_0x3d7053[_0x2798f5(0x232)][_0x2798f5(0x223)](_0x146146),{'verbose':_0x36e31b[_0x2798f5(0x1c5)]}),_0x3e9afb=_0x134e0e[_0x2798f5(0x20c)];return console[_0x2798f5(0x267)](_0x2798f5(0x1fa)+_0x3e9afb[_0x2798f5(0x1d7)]),console[_0x2798f5(0x267)](_0x2798f5(0x228)+_0x3e9afb[_0x2798f5(0x19a)]),await handleSDKOutput(_0x3e9afb[_0x2798f5(0x1de)],_0x36e31b),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a26_0x5ab450(0x1b3)]=a26_0x5ab450(0x1bf);['description']=a26_0x5ab450(0x1ee);async[a26_0x5ab450(0x276)](_0x5bb973){const _0x331464=a26_0x5ab450,{options:_0x3981b0,args:_0x720c0,tdx:_0x353deb}=_0x5bb973,_0x1c642c=_0x720c0[0x0];if(!requireNameOrPath(_0x1c642c))return 0x1;_0x3981b0[_0x331464(0x1c5)]&&console[_0x331464(0x280)](_0x331464(0x22f)+_0x1c642c);const {journeyId:_0x68c857}=await resolveJourneyIdFromInput(_0x1c642c,_0x3981b0,_0x353deb),_0x5ac880=await withSpinner(_0x331464(0x20e),()=>_0x353deb[_0x331464(0x232)][_0x331464(0x25b)](_0x68c857),{'verbose':_0x3981b0[_0x331464(0x1c5)]}),_0x5abf6b=_0x5ac880[_0x331464(0x20c)];return console[_0x331464(0x280)](_0x331464(0x1a9)+_0x5abf6b['length']+'\x20activation'+(_0x5abf6b['length']!==0x1?'s':'')),await handleSDKOutput(_0x5abf6b,_0x3981b0),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0x5ab450(0x1b3)]='journey:push';[a26_0x5ab450(0x26c)]=a26_0x5ab450(0x241);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x15bebb){const _0x30ba8a=a26_0x5ab450,_0x19d429=_0x15bebb[_0x30ba8a(0x29d)][0x0];let _0x3ebc4a;if(_0x19d429){const _0x4c40ac=await resolveTarget({'arg':_0x19d429,'contextParent':_0x15bebb[_0x30ba8a(0x1fc)][_0x30ba8a(0x273)],'cwd':process[_0x30ba8a(0x21b)]()});isSuccessfulResolution(_0x4c40ac)&&_0x4c40ac[_0x30ba8a(0x2a4)]==='file'&&(_0x3ebc4a=_0x4c40ac[_0x30ba8a(0x1f6)]);}const _0x1779a8={..._0x15bebb,'options':{..._0x15bebb['options'],'journeysOnly':!![],..._0x3ebc4a&&{'singleFilePath':_0x3ebc4a}}};return this[_0x30ba8a(0x20b)][_0x30ba8a(0x276)](_0x1779a8);}}export class JourneyVersionsCommand extends BaseCommand{[a26_0x5ab450(0x1b3)]='journey:versions';[a26_0x5ab450(0x26c)]=a26_0x5ab450(0x252);async['execute'](_0x1c1a42){const _0x198070=a26_0x5ab450,{options:_0x53e28e,args:_0x13afa5,tdx:_0x47c204}=_0x1c1a42,_0x2902f3=_0x13afa5[0x0];if(!requireNameOrPath(_0x2902f3))return 0x1;if(_0x53e28e['verbose'])console[_0x198070(0x280)](_0x198070(0x22f)+_0x2902f3);const {journeyId:_0x66da04}=await resolveJourneyIdFromInput(_0x2902f3,_0x53e28e,_0x47c204),_0x18de2a=await withSpinner(_0x198070(0x24a),()=>_0x47c204[_0x198070(0x232)][_0x198070(0x226)](_0x66da04),{'verbose':_0x53e28e[_0x198070(0x1c5)]}),{bundleName:_0x5a6ea3,versions:_0x201269,latestJourneyId:_0x49f225}=_0x18de2a[_0x198070(0x20c)];console[_0x198070(0x280)](_0x5a6ea3+':\x20'+_0x201269[_0x198070(0x289)]+_0x198070(0x1d4)+(_0x201269[_0x198070(0x289)]!==0x1?'s':''));const _0x2f73c5=_0x201269[_0x198070(0x1db)](_0x192093=>({'version':_0x192093[_0x198070(0x236)],'journey_id':_0x192093[_0x198070(0x1d0)],'name':_0x192093[_0x198070(0x1b3)],'state':_0x192093[_0x198070(0x299)],'paused':_0x192093['paused'],'latest':_0x192093[_0x198070(0x1d0)]===_0x49f225,'created_at':_0x192093[_0x198070(0x23f)]}));return await handleSDKOutput(_0x2f73c5,_0x53e28e),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';['description']=a26_0x5ab450(0x1cd);async[a26_0x5ab450(0x276)](_0x376b25){const _0x5ea7c2=a26_0x5ab450,{options:_0x2d99c8,args:_0x2aef30,tdx:_0x3602df}=_0x376b25,_0x126e7d=_0x2aef30[0x0];if(!requireNameOrPath(_0x126e7d))return 0x1;if(_0x2d99c8['verbose'])console['error'](_0x5ea7c2(0x22f)+_0x126e7d);const {journeyId:_0x34e1ce,journeyName:_0x77d340}=await resolveJourneyIdFromInput(_0x126e7d,_0x2d99c8,_0x3602df);if(!_0x2d99c8[_0x5ea7c2(0x1c4)]){const _0x2d89eb=await confirm(_0x5ea7c2(0x218)+_0x77d340+'\x22?');if(!_0x2d89eb)return console[_0x5ea7c2(0x280)](_0x5ea7c2(0x28d)),0x0;}const _0x7c6449=await withSpinner(_0x5ea7c2(0x239),()=>_0x3602df[_0x5ea7c2(0x232)]['createVersion'](_0x34e1ce),{'verbose':_0x2d99c8['verbose']}),_0x3eaf4d=_0x7c6449[_0x5ea7c2(0x20c)];return console['error'](a26_0x372e0a[_0x5ea7c2(0x269)]('✔')+_0x5ea7c2(0x242)+_0x3eaf4d[_0x5ea7c2(0x1ba)][_0x5ea7c2(0x236)]+'\x20(draft)\x20—\x20\x22'+_0x3eaf4d[_0x5ea7c2(0x1ba)]['name']+'\x22'),console[_0x5ea7c2(0x280)]('\x20\x20Journey\x20ID:\x20'+_0x3eaf4d['id']),await handleSingleObjectOutput({'id':_0x3eaf4d['id'],'name':_0x3eaf4d[_0x5ea7c2(0x1ba)]['name'],'version':_0x3eaf4d['attributes'][_0x5ea7c2(0x236)],'state':_0x3eaf4d[_0x5ea7c2(0x1ba)][_0x5ea7c2(0x299)],'bundle_id':_0x3eaf4d[_0x5ea7c2(0x1ba)][_0x5ea7c2(0x2a3)],'created_at':_0x3eaf4d[_0x5ea7c2(0x1ba)][_0x5ea7c2(0x23f)]},_0x2d99c8),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0x5ab450(0x1b3)]=a26_0x5ab450(0x204);[a26_0x5ab450(0x26c)]=a26_0x5ab450(0x1bd);async[a26_0x5ab450(0x276)](_0x3d2e86){const _0x55b429=a26_0x5ab450,{options:_0x340913,args:_0x5854f0,tdx:_0x210629}=_0x3d2e86,_0x3e3133=_0x5854f0[0x0];if(!requireNameOrPath(_0x3e3133))return 0x1;const _0x3812e1=_0x340913[_0x55b429(0x1e2)];if(!_0x3812e1)return console[_0x55b429(0x280)](_0x55b429(0x1f8)),console[_0x55b429(0x280)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x58a5bb=parseInt(_0x3812e1,0xa);if(isNaN(_0x58a5bb)||_0x58a5bb<0x1)return console[_0x55b429(0x280)](_0x55b429(0x227)+_0x3812e1),0x1;if(_0x340913[_0x55b429(0x1c5)])console['error']('Input:\x20'+_0x3e3133+_0x55b429(0x24d)+_0x58a5bb);const {journeyId:_0x3bd931,parentSegmentId:_0x261912}=await resolveJourneyIdFromInput(_0x3e3133,_0x340913,_0x210629),_0xc5b272=await withSpinner('Resolving\x20version...',()=>_0x210629[_0x55b429(0x232)][_0x55b429(0x226)](_0x3bd931),{'verbose':_0x340913['verbose']}),{versions:_0x2247fc,latestJourneyId:_0x5f0b7d}=_0xc5b272['data'],_0x725447=_0x2247fc[_0x55b429(0x220)](_0x27acb2=>_0x27acb2[_0x55b429(0x236)]===_0x58a5bb);if(!_0x725447){const _0x5c1f0a=_0x2247fc[_0x55b429(0x1db)](_0x3e5bf0=>'v'+_0x3e5bf0[_0x55b429(0x236)])['join'](',\x20');return console[_0x55b429(0x280)]('Error:\x20Version\x20'+_0x58a5bb+_0x55b429(0x275)+_0x5c1f0a),0x1;}const _0x1861db=await withSpinner('Getting\x20version\x20'+_0x58a5bb+_0x55b429(0x225),()=>_0x210629['journey'][_0x55b429(0x285)](_0x725447[_0x55b429(0x1d0)]),{'verbose':_0x340913[_0x55b429(0x1c5)]}),_0x2811a5=_0x1861db[_0x55b429(0x20c)],_0x13808e=getConsoleNextUrl(_0x340913[_0x55b429(0x1bb)],'/app/ps/'+_0x261912+'/e/'+_0x725447[_0x55b429(0x1d0)]+_0x55b429(0x23d));return await handleSingleObjectOutput({'id':_0x2811a5['id'],'name':_0x2811a5[_0x55b429(0x1ba)][_0x55b429(0x1b3)],'version':_0x2811a5[_0x55b429(0x1ba)]['versionNumber'],'description':_0x2811a5[_0x55b429(0x1ba)][_0x55b429(0x26c)],'state':_0x2811a5['attributes'][_0x55b429(0x299)],'paused':_0x2811a5['attributes'][_0x55b429(0x272)],'reentry_mode':_0x2811a5[_0x55b429(0x1ba)][_0x55b429(0x1ec)],'stages':_0x2811a5[_0x55b429(0x1ba)][_0x55b429(0x1fb)]?.['length']||0x0,..._0x2811a5[_0x55b429(0x1ba)][_0x55b429(0x19b)]&&{'goal':_0x2811a5[_0x55b429(0x1ba)][_0x55b429(0x19b)]['name']},'latest':_0x725447[_0x55b429(0x1d0)]===_0x5f0b7d,'created_at':_0x2811a5[_0x55b429(0x1ba)][_0x55b429(0x23f)],'updated_at':_0x2811a5[_0x55b429(0x1ba)][_0x55b429(0x28f)],'url':_0x13808e},_0x340913),0x0;}}
@@ -1 +1 @@
1
- const a27_0xdb7100=a27_0x3cc2;(function(_0x2e6204,_0x1b3a0d){const _0x58dba8=a27_0x3cc2,_0x3e20d4=_0x2e6204();while(!![]){try{const _0x285c2a=-parseInt(_0x58dba8(0xdd))/0x1+parseInt(_0x58dba8(0xc0))/0x2+-parseInt(_0x58dba8(0xc7))/0x3*(-parseInt(_0x58dba8(0xb9))/0x4)+parseInt(_0x58dba8(0xe5))/0x5*(-parseInt(_0x58dba8(0xcb))/0x6)+parseInt(_0x58dba8(0xd1))/0x7*(-parseInt(_0x58dba8(0xe3))/0x8)+parseInt(_0x58dba8(0xe2))/0x9+parseInt(_0x58dba8(0xb1))/0xa*(-parseInt(_0x58dba8(0xe4))/0xb);if(_0x285c2a===_0x1b3a0d)break;else _0x3e20d4['push'](_0x3e20d4['shift']());}catch(_0x41cb7c){_0x3e20d4['push'](_0x3e20d4['shift']());}}}(a27_0x419f,0x5751c));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';function a27_0x3cc2(_0x42d2e7,_0x281ddc){_0x42d2e7=_0x42d2e7-0xb1;const _0x419fb4=a27_0x419f();let _0x3cc2b0=_0x419fb4[_0x42d2e7];return _0x3cc2b0;}import a27_0x14d748 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a27_0x419f(){const _0x44aafc=['yellow','cwd','24XgiPfD','Validation\x20failed:\x20','\x20journey(s)\x20valid','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','Error:\x20','log','13370AJztDW','\x20journey(s)\x20with\x20errors,\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','reason','message','Validate\x20journey\x20YAML\x20files','green','dim','type','validCount','description','\x20warning(s)','89581UKwYII','error','Error:\x20Directory\x20not\x20found:\x20','No\x20journey\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found','2113893FQkTDX','80tFgAyy','55YAEble','58385UlgYMM','\x20error(s)','file','892270tdqjor','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20segment\x20file(s)\x20skipped','warningCount','filePath','\x20(skipped:\x20','red','30460Omushg','no_parent','endsWith','invalidCount','execute','verbose','valid','1372464Uewsrc','journey:validate','relativePath','skippedCount','warnings','length','errors','15mTdCqe','targetDir'];a27_0x419f=function(){return _0x44aafc;};return a27_0x419f();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a27_0xdb7100(0xb2)]=a27_0xdb7100(0xc1);[a27_0xdb7100(0xdb)]=a27_0xdb7100(0xd6);async[a27_0xdb7100(0xbd)](_0x4c5613){const _0x2bff1f=a27_0xdb7100,{options:_0x10b153,args:_0x21fb20}=_0x4c5613,_0x317440=_0x10b153,_0x157dc4=await resolveTarget({'arg':_0x21fb20[0x0],'contextParent':_0x10b153['parentSegment'],'cwd':process[_0x2bff1f(0xca)]()});if(!isSuccessfulResolution(_0x157dc4))return _0x157dc4['errorCode']===_0x2bff1f(0xba)?(console['error'](a27_0x14d748[_0x2bff1f(0xc9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x2bff1f(0xce)),console['error']('\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'),console[_0x2bff1f(0xde)](_0x2bff1f(0xb3))):(console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xb8)](_0x2bff1f(0xcf)+_0x157dc4[_0x2bff1f(0xd5)]+'\x0a')),_0x157dc4['helpText']&&console[_0x2bff1f(0xde)](a27_0x14d748['cyan'](_0x157dc4['helpText']))),0x1;const _0x170e69=_0x157dc4[_0x2bff1f(0xc8)],_0x694d6e=_0x157dc4[_0x2bff1f(0xd9)]===_0x2bff1f(0xe7)?_0x157dc4[_0x2bff1f(0xb6)]:undefined;if(!_0x694d6e&&!existsSync(_0x170e69))return console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xb8)](_0x2bff1f(0xdf)+_0x170e69+'\x0a')),0x1;let _0x5a5765;if(_0x694d6e){if(!_0x694d6e[_0x2bff1f(0xbb)]('.yml')&&!_0x694d6e[_0x2bff1f(0xbb)]('.yaml'))return console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xb8)](_0x2bff1f(0xd3)+_0x694d6e+'\x0a')),0x1;_0x5a5765=[_0x694d6e];}else _0x5a5765=findYamlFiles(_0x170e69);if(_0x5a5765[_0x2bff1f(0xc5)]===0x0)return console[_0x2bff1f(0xde)](a27_0x14d748['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x170e69+'\x0a')),0x1;const _0x541aa4=validateYamlFiles(_0x5a5765,_0x170e69,{'filterType':'journey'}),_0xd0fe6d=calculateSummary(_0x541aa4),_0x3131e6=_0x541aa4['filter'](isValidationResult);if(_0x3131e6[_0x2bff1f(0xc5)]===0x0)return console['error'](a27_0x14d748['yellow'](_0x2bff1f(0xe0)+_0x170e69+'\x0a')),_0xd0fe6d[_0x2bff1f(0xc3)]>0x0&&console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xd8)]('('+_0xd0fe6d[_0x2bff1f(0xc3)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x287aa5 of _0x541aa4){if(!isValidationResult(_0x287aa5)){_0x317440[_0x2bff1f(0xbe)]&&console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xd8)]('-\x20'+_0x287aa5[_0x2bff1f(0xc2)]+_0x2bff1f(0xb7)+_0x287aa5[_0x2bff1f(0xd4)]+')'));continue;}const {relativePath:_0x2316b8,source:_0x247b8d,result:_0x11233a}=_0x287aa5;if(_0x11233a[_0x2bff1f(0xbf)]&&_0x11233a[_0x2bff1f(0xc4)][_0x2bff1f(0xc5)]===0x0)_0x317440[_0x2bff1f(0xbe)]&&console[_0x2bff1f(0xd0)](a27_0x14d748['green']('✔\x20'+_0x2316b8));else _0x11233a['valid']?(console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xc9)]('⚠\x20'+_0x2316b8+':\x20'+_0x11233a['warnings']['length']+_0x2bff1f(0xdc))),console[_0x2bff1f(0xd0)](formatValidationResult(_0x11233a,_0x247b8d,_0x2316b8))):(console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xb8)]('✖\x20'+_0x2316b8+':\x20'+_0x11233a[_0x2bff1f(0xc6)]['length']+_0x2bff1f(0xe6))),console[_0x2bff1f(0xd0)](formatValidationResult(_0x11233a,_0x247b8d,_0x2316b8)));}return console[_0x2bff1f(0xd0)](''),_0xd0fe6d['hasErrors']?(console[_0x2bff1f(0xd0)](a27_0x14d748['red'](_0x2bff1f(0xcc)+_0xd0fe6d[_0x2bff1f(0xbc)]+_0x2bff1f(0xd2)+_0xd0fe6d['validCount']+'\x20valid')),_0xd0fe6d[_0x2bff1f(0xb5)]>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748['yellow'](_0xd0fe6d['warningCount']+_0x2bff1f(0xe1))),_0xd0fe6d[_0x2bff1f(0xc3)]>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748['dim'](_0xd0fe6d[_0x2bff1f(0xc3)]+_0x2bff1f(0xb4))),0x1):(console['log'](a27_0x14d748[_0x2bff1f(0xd7)]('✔\x20All\x20'+_0xd0fe6d[_0x2bff1f(0xda)]+_0x2bff1f(0xcd))),_0xd0fe6d[_0x2bff1f(0xb5)]>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xc9)](_0xd0fe6d[_0x2bff1f(0xb5)]+'\x20warning(s)\x20found')),_0xd0fe6d['skippedCount']>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xd8)](_0xd0fe6d[_0x2bff1f(0xc3)]+_0x2bff1f(0xb4))),0x0);}}
1
+ const a27_0x2ffa5d=a27_0x374d;(function(_0x70ee33,_0x28f60c){const _0xae181e=a27_0x374d,_0x442e17=_0x70ee33();while(!![]){try{const _0x292878=parseInt(_0xae181e(0xca))/0x1*(parseInt(_0xae181e(0xf9))/0x2)+-parseInt(_0xae181e(0xcc))/0x3+parseInt(_0xae181e(0x104))/0x4+-parseInt(_0xae181e(0x102))/0x5*(parseInt(_0xae181e(0xcd))/0x6)+parseInt(_0xae181e(0xd6))/0x7*(parseInt(_0xae181e(0xd9))/0x8)+-parseInt(_0xae181e(0xfd))/0x9*(-parseInt(_0xae181e(0xf0))/0xa)+-parseInt(_0xae181e(0x100))/0xb;if(_0x292878===_0x28f60c)break;else _0x442e17['push'](_0x442e17['shift']());}catch(_0x3f61a3){_0x442e17['push'](_0x442e17['shift']());}}}(a27_0x65da,0x83752));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 a27_0x34c708 from'chalk';function a27_0x374d(_0x15da2a,_0x369c58){_0x15da2a=_0x15da2a-0xca;const _0x65dac0=a27_0x65da();let _0x374d24=_0x65dac0[_0x15da2a];return _0x374d24;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a27_0x65da(){const _0x2fabab=['filePath','yellow','dim','green','validCount','\x20(skipped:\x20','157171uRUUYb','helpText','length','104lnjfXf','cyan','\x20segment\x20file(s)\x20skipped)','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20','parentSegment','errorCode','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','warnings','description','No\x20journey\x20YAML\x20files\x20found\x20in\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20error(s)','name','error','errors','file','targetDir','hasErrors','red','type','journey:validate','valid','525380wrgxGX','no_parent','\x20journey(s)\x20with\x20errors,\x20','execute','\x20segment\x20file(s)\x20skipped','verbose','log','.yaml','\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','101778NvDwTa','\x20valid','.yml','warningCount','117HZcWgV','cwd','journey','2016784qwAMXp','skippedCount','5ysIIpo','\x20warning(s)\x20found','2140480DOTJSH','3wpfXpf','\x20warning(s)','1580589kUDbeJ','2484078BnGnud','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','filter'];a27_0x65da=function(){return _0x2fabab;};return a27_0x65da();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a27_0x2ffa5d(0xe6)]=a27_0x2ffa5d(0xee);[a27_0x2ffa5d(0xe2)]='Validate\x20journey\x20YAML\x20files';async[a27_0x2ffa5d(0xf3)](_0x3d06a0){const _0x278807=a27_0x2ffa5d,{options:_0x429503,args:_0x9a0169}=_0x3d06a0,_0x4925ea=_0x429503,_0x22d5ac=await resolveTarget({'arg':_0x9a0169[0x0],'contextParent':_0x429503[_0x278807(0xde)],'cwd':process[_0x278807(0xfe)]()});if(!isSuccessfulResolution(_0x22d5ac))return _0x22d5ac[_0x278807(0xdf)]===_0x278807(0xf1)?(console[_0x278807(0xe7)](a27_0x34c708[_0x278807(0xd1)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x278807(0xe0)),console[_0x278807(0xe7)](_0x278807(0xf8)),console[_0x278807(0xe7)](_0x278807(0xce))):(console[_0x278807(0xe7)](a27_0x34c708[_0x278807(0xec)](_0x278807(0xdd)+_0x22d5ac['message']+'\x0a')),_0x22d5ac[_0x278807(0xd7)]&&console[_0x278807(0xe7)](a27_0x34c708[_0x278807(0xda)](_0x22d5ac['helpText']))),0x1;const _0x4d3c15=_0x22d5ac[_0x278807(0xea)],_0x1e0432=_0x22d5ac[_0x278807(0xed)]===_0x278807(0xe9)?_0x22d5ac[_0x278807(0xd0)]:undefined;if(!_0x1e0432&&!existsSync(_0x4d3c15))return console[_0x278807(0xe7)](a27_0x34c708['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x4d3c15+'\x0a')),0x1;let _0x543c9f;if(_0x1e0432){if(!_0x1e0432['endsWith'](_0x278807(0xfb))&&!_0x1e0432['endsWith'](_0x278807(0xf7)))return console[_0x278807(0xe7)](a27_0x34c708[_0x278807(0xec)](_0x278807(0xe4)+_0x1e0432+'\x0a')),0x1;_0x543c9f=[_0x1e0432];}else _0x543c9f=findYamlFiles(_0x4d3c15);if(_0x543c9f[_0x278807(0xd8)]===0x0)return console['error'](a27_0x34c708[_0x278807(0xec)](_0x278807(0xdc)+_0x4d3c15+'\x0a')),0x1;const _0x5d20d4=validateYamlFiles(_0x543c9f,_0x4d3c15,{'filterType':_0x278807(0xff)}),_0x4bc15a=calculateSummary(_0x5d20d4),_0x49249b=_0x5d20d4[_0x278807(0xcf)](isValidationResult);if(_0x49249b[_0x278807(0xd8)]===0x0)return console[_0x278807(0xe7)](a27_0x34c708[_0x278807(0xd1)](_0x278807(0xe3)+_0x4d3c15+'\x0a')),_0x4bc15a[_0x278807(0x101)]>0x0&&console[_0x278807(0xe7)](a27_0x34c708[_0x278807(0xd2)]('('+_0x4bc15a[_0x278807(0x101)]+_0x278807(0xdb))),0x0;for(const _0x1c4019 of _0x5d20d4){if(!isValidationResult(_0x1c4019)){_0x4925ea[_0x278807(0xf5)]&&console[_0x278807(0xf6)](a27_0x34c708[_0x278807(0xd2)]('-\x20'+_0x1c4019['relativePath']+_0x278807(0xd5)+_0x1c4019['reason']+')'));continue;}const {relativePath:_0x1bd1fb,source:_0x993832,result:_0x584053}=_0x1c4019;if(_0x584053['valid']&&_0x584053[_0x278807(0xe1)][_0x278807(0xd8)]===0x0)_0x4925ea[_0x278807(0xf5)]&&console[_0x278807(0xf6)](a27_0x34c708[_0x278807(0xd3)]('✔\x20'+_0x1bd1fb));else _0x584053[_0x278807(0xef)]?(console['log'](a27_0x34c708[_0x278807(0xd1)]('⚠\x20'+_0x1bd1fb+':\x20'+_0x584053['warnings'][_0x278807(0xd8)]+_0x278807(0xcb))),console[_0x278807(0xf6)](formatValidationResult(_0x584053,_0x993832,_0x1bd1fb))):(console[_0x278807(0xf6)](a27_0x34c708[_0x278807(0xec)]('✖\x20'+_0x1bd1fb+':\x20'+_0x584053[_0x278807(0xe8)][_0x278807(0xd8)]+_0x278807(0xe5))),console[_0x278807(0xf6)](formatValidationResult(_0x584053,_0x993832,_0x1bd1fb)));}return console[_0x278807(0xf6)](''),_0x4bc15a[_0x278807(0xeb)]?(console['log'](a27_0x34c708[_0x278807(0xec)]('Validation\x20failed:\x20'+_0x4bc15a['invalidCount']+_0x278807(0xf2)+_0x4bc15a[_0x278807(0xd4)]+_0x278807(0xfa))),_0x4bc15a[_0x278807(0xfc)]>0x0&&console[_0x278807(0xf6)](a27_0x34c708['yellow'](_0x4bc15a[_0x278807(0xfc)]+_0x278807(0x103))),_0x4bc15a[_0x278807(0x101)]>0x0&&console['log'](a27_0x34c708[_0x278807(0xd2)](_0x4bc15a[_0x278807(0x101)]+_0x278807(0xf4))),0x1):(console['log'](a27_0x34c708['green']('✔\x20All\x20'+_0x4bc15a[_0x278807(0xd4)]+'\x20journey(s)\x20valid')),_0x4bc15a[_0x278807(0xfc)]>0x0&&console[_0x278807(0xf6)](a27_0x34c708['yellow'](_0x4bc15a[_0x278807(0xfc)]+_0x278807(0x103))),_0x4bc15a[_0x278807(0x101)]>0x0&&console[_0x278807(0xf6)](a27_0x34c708['dim'](_0x4bc15a[_0x278807(0x101)]+_0x278807(0xf4))),0x0);}}