@treasuredata/tdx 2026.3.21 → 2026.3.22

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 (203) 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/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a25_0xb7ba01=a25_0x5aa4;(function(_0x4a7df9,_0x5b5cd8){const _0xac4a48=a25_0x5aa4,_0x450106=_0x4a7df9();while(!![]){try{const _0x4c0be3=-parseInt(_0xac4a48(0x115))/0x1*(parseInt(_0xac4a48(0x121))/0x2)+parseInt(_0xac4a48(0x143))/0x3+-parseInt(_0xac4a48(0x151))/0x4*(-parseInt(_0xac4a48(0x117))/0x5)+-parseInt(_0xac4a48(0x148))/0x6*(-parseInt(_0xac4a48(0x127))/0x7)+parseInt(_0xac4a48(0x157))/0x8*(parseInt(_0xac4a48(0x135))/0x9)+-parseInt(_0xac4a48(0x149))/0xa+parseInt(_0xac4a48(0x12e))/0xb;if(_0x4c0be3===_0x5b5cd8)break;else _0x450106['push'](_0x450106['shift']());}catch(_0x37f182){_0x450106['push'](_0x450106['shift']());}}}(a25_0x415a,0xbf68c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';function a25_0x5aa4(_0x36bac5,_0x1751dc){_0x36bac5=_0x36bac5-0x111;const _0x415a42=a25_0x415a();let _0x5aa405=_0x415a42[_0x36bac5];return _0x5aa405;}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_0x594fb5 from'chalk';function formatDuration(_0x3d5ada){const _0x23ace0=a25_0x5aa4;if(_0x3d5ada<0x3c)return _0x3d5ada+'s';if(_0x3d5ada<0xe10)return Math[_0x23ace0(0x113)](_0x3d5ada/0x3c)+'m\x20'+_0x3d5ada%0x3c+'s';const _0x2e7d0f=Math[_0x23ace0(0x113)](_0x3d5ada/0xe10),_0x1bdab3=Math[_0x23ace0(0x113)](_0x3d5ada%0xe10/0x3c);return _0x1bdab3>0x0?_0x2e7d0f+'h\x20'+_0x1bdab3+'m':_0x2e7d0f+'h';}function formatRelativeTime(_0x2b7d27){const _0x2acac1=a25_0x5aa4,_0x843997=Date['now']()-_0x2b7d27[_0x2acac1(0x12f)](),_0x50a424=Math[_0x2acac1(0x113)](Math['abs'](_0x843997)/0x3e8);if(_0x50a424<0x3c)return _0x2acac1(0x139);const _0x456bbf=Math[_0x2acac1(0x113)](_0x50a424/0x3c);if(_0x456bbf<0x3c)return _0x456bbf+_0x2acac1(0x167);const _0x5dc308=Math[_0x2acac1(0x113)](_0x456bbf/0x3c);if(_0x5dc308<0x18)return _0x5dc308+_0x2acac1(0x11a);const _0x5c4450=Math['floor'](_0x5dc308/0x18);if(_0x5c4450<0x1e)return _0x5c4450+_0x2acac1(0x14f);return Math[_0x2acac1(0x113)](_0x5c4450/0x1e)+_0x2acac1(0x13c);}export class JobListCommand extends BaseCommand{['name']='jobs';[a25_0xb7ba01(0x154)]=a25_0xb7ba01(0x132);async[a25_0xb7ba01(0x15b)](_0x22da18){const _0x13f7f=a25_0xb7ba01,{options:_0x268472,tdx:_0x306ab9}=_0x22da18,_0x5cf93a=resolveLimit(_0x268472['limit'],DEFAULT_DISPLAY_LIMIT),_0x113681=_0x268472['status'];_0x268472[_0x13f7f(0x131)]&&(console[_0x13f7f(0x12b)]('Limit:\x20'+_0x5cf93a+_0x13f7f(0x11c)),_0x113681&&console['error'](_0x13f7f(0x114)+_0x113681));const _0x466921=await withSpinner(_0x13f7f(0x165),()=>_0x306ab9[_0x13f7f(0x142)][_0x13f7f(0x152)]({'from':0x0,'to':_0x5cf93a-0x1,'status':_0x113681}),{'verbose':_0x268472[_0x13f7f(0x131)]}),_0x4cdf80=_0x466921['data'];console[_0x13f7f(0x12b)](_0x13f7f(0x11f)+_0x4cdf80[_0x13f7f(0x147)]+_0x13f7f(0x156)+(_0x4cdf80[_0x13f7f(0x147)]!==0x1?'s':''));const _0x353536=_0x268472[_0x13f7f(0x15a)];if(isStructuredFormat(_0x268472)){const _0x24b2e9=_0x4cdf80[_0x13f7f(0x166)](_0x1cd990=>{const _0x248628=_0x13f7f;let _0x3e9553;if(_0x1cd990[_0x248628(0x16a)]&&_0x1cd990[_0x248628(0x15d)]){const _0x372242=new Date(_0x1cd990['start_at'])['getTime'](),_0x4396ad=new Date(_0x1cd990['end_at'])['getTime']();_0x3e9553=Math[_0x248628(0x138)]((_0x4396ad-_0x372242)/0x3e8);}return{'job_id':_0x1cd990[_0x248628(0x123)],'type':_0x1cd990[_0x248628(0x118)]===_0x248628(0x15f)?'trino':_0x1cd990[_0x248628(0x118)],'status':_0x1cd990[_0x248628(0x126)],'user_name':_0x1cd990['user_name'],'duration_sec':_0x3e9553,'created_at':_0x1cd990['created_at'],'started_at':_0x1cd990['start_at'],'end_at':_0x1cd990[_0x248628(0x15d)]};});await handleSDKOutput(_0x24b2e9,_0x268472);}else for(const _0x58a2bf of _0x4cdf80){const _0x3f81a8=_0x58a2bf[_0x13f7f(0x126)]===_0x13f7f(0x11b)?a25_0x594fb5[_0x13f7f(0x13a)]:_0x58a2bf[_0x13f7f(0x126)]===_0x13f7f(0x12b)?a25_0x594fb5[_0x13f7f(0x112)]:a25_0x594fb5[_0x13f7f(0x128)],_0x2aaca5=_0x3f81a8(_0x58a2bf[_0x13f7f(0x126)]),_0x49f493=getJobUrl(_0x353536,_0x58a2bf[_0x13f7f(0x123)]),_0x2ee0ac=hyperlink(_0x58a2bf[_0x13f7f(0x123)],_0x49f493),_0x2c1f71=a25_0x594fb5['dim'](_0x58a2bf[_0x13f7f(0x118)]===_0x13f7f(0x15f)?_0x13f7f(0x161):_0x58a2bf[_0x13f7f(0x118)]),_0x409957=[];if(_0x58a2bf[_0x13f7f(0x16a)]&&_0x58a2bf['end_at']){const _0x34d083=Math[_0x13f7f(0x138)]((new Date(_0x58a2bf[_0x13f7f(0x15d)])[_0x13f7f(0x12f)]()-new Date(_0x58a2bf['start_at'])[_0x13f7f(0x12f)]())/0x3e8);_0x409957[_0x13f7f(0x13b)](formatDuration(_0x34d083));}if(_0x58a2bf[_0x13f7f(0x15d)])_0x409957[_0x13f7f(0x13b)](formatRelativeTime(new Date(_0x58a2bf[_0x13f7f(0x15d)])));else _0x58a2bf[_0x13f7f(0x16a)]&&_0x409957[_0x13f7f(0x13b)](formatRelativeTime(new Date(_0x58a2bf[_0x13f7f(0x16a)])));const _0x433774=_0x409957['length']>0x0?a25_0x594fb5['dim']('\x20'+_0x409957['join'](',\x20')):'';console[_0x13f7f(0x162)]('⚡\x20'+_0x2ee0ac+'\x20'+_0x2c1f71+'\x20'+_0x2aaca5+_0x433774);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a25_0xb7ba01(0x134)]='job:show';[a25_0xb7ba01(0x154)]=a25_0xb7ba01(0x11e);['validate'](_0x5035f9){const _0xcc11d3=a25_0xb7ba01,_0x52bf10=_0x5035f9[_0xcc11d3(0x129)][0x0];if(!_0x52bf10)return _0xcc11d3(0x141);return undefined;}async[a25_0xb7ba01(0x15b)](_0xfe7cd9){const _0x4b241a=a25_0xb7ba01,{options:_0x2ee3ca,args:_0x3ed57c,tdx:_0x5e3162}=_0xfe7cd9,_0x32b7ba=_0x3ed57c[0x0],_0x48666d=await withSpinner(_0x4b241a(0x160),()=>_0x5e3162[_0x4b241a(0x142)][_0x4b241a(0x168)](_0x32b7ba),{'verbose':_0x2ee3ca[_0x4b241a(0x131)]}),_0x394019=_0x48666d[_0x4b241a(0x120)];let _0x4a0722;if(_0x394019['start_at']&&_0x394019['end_at']){const _0x45e9b8=new Date(_0x394019[_0x4b241a(0x16a)])['getTime'](),_0x1959e4=new Date(_0x394019[_0x4b241a(0x15d)])[_0x4b241a(0x12f)]();_0x4a0722=Math[_0x4b241a(0x138)]((_0x1959e4-_0x45e9b8)/0x3e8);}const _0x57a9ff={'job_id':_0x394019['job_id'],'type':_0x394019[_0x4b241a(0x118)],'status':_0x394019['status'],..._0x394019['user_name']&&{'user_name':_0x394019[_0x4b241a(0x122)]},..._0x4a0722!==undefined&&{'duration_sec':_0x4a0722},..._0x394019['created_at']&&{'created_at':_0x394019['created_at']},..._0x394019['start_at']&&{'started_at':_0x394019[_0x4b241a(0x16a)]},..._0x394019['end_at']&&{'end_at':_0x394019['end_at']},..._0x394019['database']&&{'database':_0x394019[_0x4b241a(0x124)]},..._0x394019[_0x4b241a(0x146)]!==undefined&&{'priority':_0x394019[_0x4b241a(0x146)]},..._0x394019[_0x4b241a(0x12c)]&&{'url':_0x394019[_0x4b241a(0x12c)]},..._0x394019[_0x4b241a(0x155)]&&{'query':_0x394019[_0x4b241a(0x155)]},..._0x394019[_0x4b241a(0x169)]&&{'debug':_0x394019[_0x4b241a(0x169)]}};return await handleSingleObjectOutput(_0x57a9ff,_0x2ee3ca),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0xb7ba01(0x134)]='job:kill';[a25_0xb7ba01(0x154)]=a25_0xb7ba01(0x13e);[a25_0xb7ba01(0x14d)](_0x44241b){const _0x46b3dd=a25_0xb7ba01,_0x3945bc=_0x44241b[_0x46b3dd(0x129)][0x0];if(!_0x3945bc)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a25_0xb7ba01(0x15b)](_0x51374d){const _0x137e06=a25_0xb7ba01,{options:_0x3ffeb9,args:_0x26b6ac,tdx:_0x171f5e}=_0x51374d,_0x5d28e5=_0x26b6ac[0x0];if(!_0x3ffeb9[_0x137e06(0x163)]){const _0xcb8b61=await confirm(_0x137e06(0x13f)+_0x5d28e5+'?');if(!_0xcb8b61)return console[_0x137e06(0x12b)]('Cancelled'),0x0;}return await withSpinner(_0x137e06(0x150),()=>_0x171f5e[_0x137e06(0x142)][_0x137e06(0x144)](_0x5d28e5),{'verbose':_0x3ffeb9[_0x137e06(0x131)]}),console[_0x137e06(0x12b)](_0x137e06(0x11d)+_0x5d28e5),console[_0x137e06(0x12b)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x5d28e5+_0x137e06(0x137)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a25_0xb7ba01(0x134)]=a25_0xb7ba01(0x133);[a25_0xb7ba01(0x154)]=a25_0xb7ba01(0x12d);async[a25_0xb7ba01(0x15b)](_0x26bb88){const _0x2f787d=a25_0xb7ba01,{options:_0x43a1d5,args:_0xb76fb5,tdx:_0x532091}=_0x26bb88,_0x28283f=_0x43a1d5[_0x2f787d(0x15e)]||_0x2f787d(0x161),_0x5e788d=_0x43a1d5['file'],_0x3131c0=_0x43a1d5['database']||_0x2f787d(0x130),_0x4274a4=_0x43a1d5[_0x2f787d(0x140)];if(_0x28283f!==_0x2f787d(0x161)&&_0x28283f!==_0x2f787d(0x15c))throw new SDKError(ErrorCode[_0x2f787d(0x158)],_0x2f787d(0x119));let _0x4d6d69;if(_0x5e788d){if(_0xb76fb5[0x0])throw new SDKError(ErrorCode[_0x2f787d(0x158)],_0x2f787d(0x116));const _0x41f882=readSqlStatementsFromFile(_0x5e788d);if(_0x41f882[_0x2f787d(0x147)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2f787d(0x14e));if(_0x41f882['length']>0x1)throw new SDKError(ErrorCode[_0x2f787d(0x158)],_0x2f787d(0x14a));_0x4d6d69=_0x41f882[0x0];}else{if(!_0xb76fb5[0x0])throw new SDKError(ErrorCode[_0x2f787d(0x158)],_0x2f787d(0x136));_0x4d6d69=_0xb76fb5[0x0];}_0x43a1d5[_0x2f787d(0x131)]&&(console[_0x2f787d(0x12b)]('Job\x20type:\x20'+_0x28283f),console[_0x2f787d(0x12b)](_0x2f787d(0x125)+_0x3131c0),console[_0x2f787d(0x12b)](_0x2f787d(0x164)+_0x4d6d69['substring'](0x0,0x64)+(_0x4d6d69[_0x2f787d(0x147)]>0x64?_0x2f787d(0x159):'')));const _0x24f691=await withSpinner(_0x2f787d(0x13d),()=>_0x532091[_0x2f787d(0x142)]['submit'](_0x3131c0,_0x4d6d69,_0x28283f,_0x4274a4),{'verbose':_0x43a1d5[_0x2f787d(0x131)]}),_0x535ab3=_0x24f691['data'];return console[_0x2f787d(0x12b)]('✔\x20Job\x20submitted'),console[_0x2f787d(0x12b)](_0x2f787d(0x153)+_0x535ab3[_0x2f787d(0x123)]),await handleSDKOutput([_0x535ab3],_0x43a1d5),0x0;}}function a25_0x415a(){const _0xca9443=['args','job:result','error','url','Submit\x20a\x20job','2943644drVqzE','getTime','information_schema','verbose','List\x20jobs','job:submit','name','1078074qrZBSw','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','\x27\x20to\x20verify\x20the\x20job\x20status','round','just\x20now','green','push','mo\x20ago','Submitting\x20job...','Kill\x20a\x20job','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','result','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','jobs','4147305XSihMY','kill','\x20row','priority','length','1878EhsqJs','15597140XqsPPb','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','✔\x20Retrieved\x20','Getting\x20job\x20results...','validate','No\x20SQL\x20statements\x20found\x20in\x20file','d\x20ago','Submitting\x20kill\x20request...','72724ciWKcy','list','\x20\x20Job\x20ID:\x20','description','query','\x20job','40aYdhow','INVALID_ARGUMENT','...','site','execute','hive','end_at','jobType','presto','Getting\x20job\x20details...','trino','log','yes','Query:\x20','Listing\x20jobs...','map','m\x20ago','show','debug','start_at','Get\x20job\x20results','red','floor','Status\x20filter:\x20','154933TDbZvW','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','100jDfejI','type','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','h\x20ago','success','\x20jobs','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Show\x20job\x20details','✔\x20Found\x20','data','4hleyTC','user_name','job_id','database','Database:\x20','status','917rrklzZ','dim'];a25_0x415a=function(){return _0xca9443;};return a25_0x415a();}export class JobResultCommand extends BaseCommand{[a25_0xb7ba01(0x134)]=a25_0xb7ba01(0x12a);[a25_0xb7ba01(0x154)]=a25_0xb7ba01(0x111);[a25_0xb7ba01(0x14d)](_0x5e8ec5){const _0x55b211=a25_0xb7ba01,_0x47fa17=_0x5e8ec5[_0x55b211(0x129)][0x0];if(!_0x47fa17)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a25_0xb7ba01(0x15b)](_0x5d8ab2){const _0x17e822=a25_0xb7ba01,{options:_0xd1691d,args:_0x408e49,tdx:_0x3eb5a7}=_0x5d8ab2,_0xd85aa7=_0x408e49[0x0],_0x1acb9f=await withSpinner(_0x17e822(0x14c),()=>_0x3eb5a7[_0x17e822(0x142)]['result'](_0xd85aa7),{'verbose':_0xd1691d[_0x17e822(0x131)]}),_0xc695be=_0x1acb9f[_0x17e822(0x120)];return console[_0x17e822(0x12b)](_0x17e822(0x14b)+_0xc695be[_0x17e822(0x147)]+_0x17e822(0x145)+(_0xc695be[_0x17e822(0x147)]!==0x1?'s':'')),await handleSDKOutput(_0xc695be,_0xd1691d),0x0;}}
1
+ const a25_0x44b774=a25_0x1f00;(function(_0x302c60,_0x41e102){const _0xf2e489=a25_0x1f00,_0x22752c=_0x302c60();while(!![]){try{const _0x27d35a=-parseInt(_0xf2e489(0x1cb))/0x1*(-parseInt(_0xf2e489(0x1c1))/0x2)+-parseInt(_0xf2e489(0x1a7))/0x3+-parseInt(_0xf2e489(0x1b2))/0x4+-parseInt(_0xf2e489(0x19b))/0x5*(-parseInt(_0xf2e489(0x1d0))/0x6)+parseInt(_0xf2e489(0x18d))/0x7*(-parseInt(_0xf2e489(0x1bd))/0x8)+-parseInt(_0xf2e489(0x1a1))/0x9*(-parseInt(_0xf2e489(0x1b1))/0xa)+parseInt(_0xf2e489(0x1b5))/0xb*(parseInt(_0xf2e489(0x1d7))/0xc);if(_0x27d35a===_0x41e102)break;else _0x22752c['push'](_0x22752c['shift']());}catch(_0x6a4e36){_0x22752c['push'](_0x22752c['shift']());}}}(a25_0x4f15,0x4941a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';function a25_0x4f15(){const _0x4feebd=['status','✔\x20Found\x20','1jCxNoA','Submitting\x20kill\x20request...','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','\x20\x20Job\x20ID:\x20','h\x20ago','108978bgLfJf','user_name','dim','Listing\x20jobs...','substring','presto','Cancelled','1323048TPTOpb','trino','job:kill','join','created_at','Getting\x20job\x20results...','just\x20now','abs','round','3329753DlVJyS','data','Limit:\x20','jobs','floor','name','args','getTime','database','submit','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','...','job_id','155ciSazB','d\x20ago','execute','description','yes','Job\x20type:\x20','9VhQsCw','mo\x20ago','verbose','Getting\x20job\x20details...','INVALID_ARGUMENT','push','787788uqirmq','Query:\x20','hive','green','Get\x20job\x20results','show','type','query','error','\x20row','2278350WRkfjC','1071512QGxFNT','file','map','33YidUQr','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','\x20jobs','url','Show\x20job\x20details','✔\x20Retrieved\x20','end_at','validate','8oDZxwL','No\x20SQL\x20statements\x20found\x20in\x20file','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Submit\x20a\x20job','369122DClVYJ','debug','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Status\x20filter:\x20','length','site','\x20job','start_at'];a25_0x4f15=function(){return _0x4feebd;};return a25_0x4f15();}import{hyperlink}from'../sdk/util/formatters.js';import a25_0x3f313b from'chalk';function formatDuration(_0xe29d05){const _0x45c4b0=a25_0x1f00;if(_0xe29d05<0x3c)return _0xe29d05+'s';if(_0xe29d05<0xe10)return Math['floor'](_0xe29d05/0x3c)+'m\x20'+_0xe29d05%0x3c+'s';const _0x668fd=Math[_0x45c4b0(0x191)](_0xe29d05/0xe10),_0x38a037=Math['floor'](_0xe29d05%0xe10/0x3c);return _0x38a037>0x0?_0x668fd+'h\x20'+_0x38a037+'m':_0x668fd+'h';}function formatRelativeTime(_0x461253){const _0x3567ad=a25_0x1f00,_0x4e9020=Date['now']()-_0x461253[_0x3567ad(0x194)](),_0xd634ea=Math[_0x3567ad(0x191)](Math[_0x3567ad(0x1de)](_0x4e9020)/0x3e8);if(_0xd634ea<0x3c)return _0x3567ad(0x1dd);const _0x521e3f=Math[_0x3567ad(0x191)](_0xd634ea/0x3c);if(_0x521e3f<0x3c)return _0x521e3f+'m\x20ago';const _0x3d375f=Math[_0x3567ad(0x191)](_0x521e3f/0x3c);if(_0x3d375f<0x18)return _0x3d375f+_0x3567ad(0x1cf);const _0x4cf107=Math[_0x3567ad(0x191)](_0x3d375f/0x18);if(_0x4cf107<0x1e)return _0x4cf107+_0x3567ad(0x19c);return Math[_0x3567ad(0x191)](_0x4cf107/0x1e)+_0x3567ad(0x1a2);}export class JobListCommand extends BaseCommand{[a25_0x44b774(0x192)]=a25_0x44b774(0x190);[a25_0x44b774(0x19e)]='List\x20jobs';async['execute'](_0x5bb3b5){const _0x473c4f=a25_0x44b774,{options:_0x457036,tdx:_0x160f4e}=_0x5bb3b5,_0x1b16ca=resolveLimit(_0x457036['limit'],DEFAULT_DISPLAY_LIMIT),_0x5ca217=_0x457036[_0x473c4f(0x1c9)];_0x457036[_0x473c4f(0x1a3)]&&(console['error'](_0x473c4f(0x18f)+_0x1b16ca+_0x473c4f(0x1b7)),_0x5ca217&&console[_0x473c4f(0x1af)](_0x473c4f(0x1c4)+_0x5ca217));const _0x23d9f8=await withSpinner(_0x473c4f(0x1d3),()=>_0x160f4e[_0x473c4f(0x190)]['list']({'from':0x0,'to':_0x1b16ca-0x1,'status':_0x5ca217}),{'verbose':_0x457036['verbose']}),_0x38dc5a=_0x23d9f8[_0x473c4f(0x18e)];console[_0x473c4f(0x1af)](_0x473c4f(0x1ca)+_0x38dc5a[_0x473c4f(0x1c5)]+_0x473c4f(0x1c7)+(_0x38dc5a[_0x473c4f(0x1c5)]!==0x1?'s':''));const _0x5ade90=_0x457036[_0x473c4f(0x1c6)];if(isStructuredFormat(_0x457036)){const _0x589c50=_0x38dc5a[_0x473c4f(0x1b4)](_0x3aa05e=>{const _0x11a088=_0x473c4f;let _0x2aade9;if(_0x3aa05e[_0x11a088(0x1c8)]&&_0x3aa05e[_0x11a088(0x1bb)]){const _0xd1e791=new Date(_0x3aa05e[_0x11a088(0x1c8)])[_0x11a088(0x194)](),_0x36710f=new Date(_0x3aa05e[_0x11a088(0x1bb)])['getTime']();_0x2aade9=Math[_0x11a088(0x1df)]((_0x36710f-_0xd1e791)/0x3e8);}return{'job_id':_0x3aa05e[_0x11a088(0x19a)],'type':_0x3aa05e[_0x11a088(0x1ad)]===_0x11a088(0x1d5)?_0x11a088(0x1d8):_0x3aa05e[_0x11a088(0x1ad)],'status':_0x3aa05e['status'],'user_name':_0x3aa05e['user_name'],'duration_sec':_0x2aade9,'created_at':_0x3aa05e[_0x11a088(0x1db)],'started_at':_0x3aa05e[_0x11a088(0x1c8)],'end_at':_0x3aa05e[_0x11a088(0x1bb)]};});await handleSDKOutput(_0x589c50,_0x457036);}else for(const _0x4e85d7 of _0x38dc5a){const _0x5597de=_0x4e85d7[_0x473c4f(0x1c9)]==='success'?a25_0x3f313b[_0x473c4f(0x1aa)]:_0x4e85d7[_0x473c4f(0x1c9)]===_0x473c4f(0x1af)?a25_0x3f313b['red']:a25_0x3f313b[_0x473c4f(0x1d2)],_0x4d73ce=_0x5597de(_0x4e85d7['status']),_0x20b022=getJobUrl(_0x5ade90,_0x4e85d7[_0x473c4f(0x19a)]),_0x46878f=hyperlink(_0x4e85d7[_0x473c4f(0x19a)],_0x20b022),_0x4b2241=a25_0x3f313b[_0x473c4f(0x1d2)](_0x4e85d7[_0x473c4f(0x1ad)]==='presto'?_0x473c4f(0x1d8):_0x4e85d7[_0x473c4f(0x1ad)]),_0x555e7a=[];if(_0x4e85d7[_0x473c4f(0x1c8)]&&_0x4e85d7[_0x473c4f(0x1bb)]){const _0x4671ee=Math[_0x473c4f(0x1df)]((new Date(_0x4e85d7[_0x473c4f(0x1bb)])[_0x473c4f(0x194)]()-new Date(_0x4e85d7[_0x473c4f(0x1c8)])[_0x473c4f(0x194)]())/0x3e8);_0x555e7a[_0x473c4f(0x1a6)](formatDuration(_0x4671ee));}if(_0x4e85d7[_0x473c4f(0x1bb)])_0x555e7a['push'](formatRelativeTime(new Date(_0x4e85d7['end_at'])));else _0x4e85d7[_0x473c4f(0x1c8)]&&_0x555e7a[_0x473c4f(0x1a6)](formatRelativeTime(new Date(_0x4e85d7[_0x473c4f(0x1c8)])));const _0x5a38e2=_0x555e7a[_0x473c4f(0x1c5)]>0x0?a25_0x3f313b[_0x473c4f(0x1d2)]('\x20'+_0x555e7a[_0x473c4f(0x1da)](',\x20')):'';console['log']('⚡\x20'+_0x46878f+'\x20'+_0x4b2241+'\x20'+_0x4d73ce+_0x5a38e2);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a25_0x44b774(0x192)]='job:show';[a25_0x44b774(0x19e)]=a25_0x44b774(0x1b9);[a25_0x44b774(0x1bc)](_0x57d789){const _0x34cdb0=a25_0x44b774,_0xb2c774=_0x57d789[_0x34cdb0(0x193)][0x0];if(!_0xb2c774)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a25_0x44b774(0x19d)](_0x1b6b43){const _0x3b13fd=a25_0x44b774,{options:_0xbabe11,args:_0x3f4ff9,tdx:_0x497398}=_0x1b6b43,_0x19aee3=_0x3f4ff9[0x0],_0x3a71fe=await withSpinner(_0x3b13fd(0x1a4),()=>_0x497398[_0x3b13fd(0x190)][_0x3b13fd(0x1ac)](_0x19aee3),{'verbose':_0xbabe11[_0x3b13fd(0x1a3)]}),_0x265d87=_0x3a71fe[_0x3b13fd(0x18e)];let _0x511731;if(_0x265d87[_0x3b13fd(0x1c8)]&&_0x265d87['end_at']){const _0x497fc5=new Date(_0x265d87[_0x3b13fd(0x1c8)])[_0x3b13fd(0x194)](),_0x3fe734=new Date(_0x265d87['end_at'])[_0x3b13fd(0x194)]();_0x511731=Math[_0x3b13fd(0x1df)]((_0x3fe734-_0x497fc5)/0x3e8);}const _0x4c0b84={'job_id':_0x265d87[_0x3b13fd(0x19a)],'type':_0x265d87['type'],'status':_0x265d87[_0x3b13fd(0x1c9)],..._0x265d87[_0x3b13fd(0x1d1)]&&{'user_name':_0x265d87[_0x3b13fd(0x1d1)]},..._0x511731!==undefined&&{'duration_sec':_0x511731},..._0x265d87[_0x3b13fd(0x1db)]&&{'created_at':_0x265d87[_0x3b13fd(0x1db)]},..._0x265d87[_0x3b13fd(0x1c8)]&&{'started_at':_0x265d87[_0x3b13fd(0x1c8)]},..._0x265d87['end_at']&&{'end_at':_0x265d87[_0x3b13fd(0x1bb)]},..._0x265d87[_0x3b13fd(0x195)]&&{'database':_0x265d87[_0x3b13fd(0x195)]},..._0x265d87['priority']!==undefined&&{'priority':_0x265d87['priority']},..._0x265d87[_0x3b13fd(0x1b8)]&&{'url':_0x265d87[_0x3b13fd(0x1b8)]},..._0x265d87['query']&&{'query':_0x265d87[_0x3b13fd(0x1ae)]},..._0x265d87[_0x3b13fd(0x1c2)]&&{'debug':_0x265d87[_0x3b13fd(0x1c2)]}};return await handleSingleObjectOutput(_0x4c0b84,_0xbabe11),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0x44b774(0x192)]=a25_0x44b774(0x1d9);[a25_0x44b774(0x19e)]='Kill\x20a\x20job';[a25_0x44b774(0x1bc)](_0x5dadaa){const _0x24e0be=a25_0x44b774,_0x427f4d=_0x5dadaa[_0x24e0be(0x193)][0x0];if(!_0x427f4d)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a25_0x44b774(0x19d)](_0x2a0d47){const _0x16ea48=a25_0x44b774,{options:_0x55f396,args:_0x340dfb,tdx:_0x425d85}=_0x2a0d47,_0x4317b3=_0x340dfb[0x0];if(!_0x55f396[_0x16ea48(0x19f)]){const _0x2dbe1d=await confirm(_0x16ea48(0x1c3)+_0x4317b3+'?');if(!_0x2dbe1d)return console[_0x16ea48(0x1af)](_0x16ea48(0x1d6)),0x0;}return await withSpinner(_0x16ea48(0x1cc),()=>_0x425d85[_0x16ea48(0x190)]['kill'](_0x4317b3),{'verbose':_0x55f396[_0x16ea48(0x1a3)]}),console[_0x16ea48(0x1af)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x4317b3),console[_0x16ea48(0x1af)](_0x16ea48(0x1b6)+_0x4317b3+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}function a25_0x1f00(_0x254f0c,_0x3c6536){_0x254f0c=_0x254f0c-0x18d;const _0x4f1529=a25_0x4f15();let _0x1f00a0=_0x4f1529[_0x254f0c];return _0x1f00a0;}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';['description']=a25_0x44b774(0x1c0);async[a25_0x44b774(0x19d)](_0x17d241){const _0x4b8bc5=a25_0x44b774,{options:_0x20e8a1,args:_0xddc274,tdx:_0x269fe8}=_0x17d241,_0x5bd287=_0x20e8a1['jobType']||'trino',_0x2f4786=_0x20e8a1[_0x4b8bc5(0x1b3)],_0x29366b=_0x20e8a1[_0x4b8bc5(0x195)]||'information_schema',_0x1a0b4c=_0x20e8a1['result'];if(_0x5bd287!=='trino'&&_0x5bd287!==_0x4b8bc5(0x1a9))throw new SDKError(ErrorCode[_0x4b8bc5(0x1a5)],_0x4b8bc5(0x1cd));let _0x23ad24;if(_0x2f4786){if(_0xddc274[0x0])throw new SDKError(ErrorCode[_0x4b8bc5(0x1a5)],_0x4b8bc5(0x197));const _0x38595b=readSqlStatementsFromFile(_0x2f4786);if(_0x38595b[_0x4b8bc5(0x1c5)]===0x0)throw new SDKError(ErrorCode[_0x4b8bc5(0x1a5)],_0x4b8bc5(0x1be));if(_0x38595b[_0x4b8bc5(0x1c5)]>0x1)throw new SDKError(ErrorCode[_0x4b8bc5(0x1a5)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x23ad24=_0x38595b[0x0];}else{if(!_0xddc274[0x0])throw new SDKError(ErrorCode[_0x4b8bc5(0x1a5)],_0x4b8bc5(0x1bf));_0x23ad24=_0xddc274[0x0];}_0x20e8a1['verbose']&&(console[_0x4b8bc5(0x1af)](_0x4b8bc5(0x1a0)+_0x5bd287),console[_0x4b8bc5(0x1af)]('Database:\x20'+_0x29366b),console[_0x4b8bc5(0x1af)](_0x4b8bc5(0x1a8)+_0x23ad24[_0x4b8bc5(0x1d4)](0x0,0x64)+(_0x23ad24[_0x4b8bc5(0x1c5)]>0x64?_0x4b8bc5(0x199):'')));const _0x3d6868=await withSpinner('Submitting\x20job...',()=>_0x269fe8['jobs'][_0x4b8bc5(0x196)](_0x29366b,_0x23ad24,_0x5bd287,_0x1a0b4c),{'verbose':_0x20e8a1[_0x4b8bc5(0x1a3)]}),_0x4e5ce5=_0x3d6868['data'];return console[_0x4b8bc5(0x1af)]('✔\x20Job\x20submitted'),console[_0x4b8bc5(0x1af)](_0x4b8bc5(0x1ce)+_0x4e5ce5[_0x4b8bc5(0x19a)]),await handleSDKOutput([_0x4e5ce5],_0x20e8a1),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x44b774(0x192)]='job:result';['description']=a25_0x44b774(0x1ab);[a25_0x44b774(0x1bc)](_0x1da4b2){const _0x4a0637=a25_0x44b774,_0x1071d4=_0x1da4b2[_0x4a0637(0x193)][0x0];if(!_0x1071d4)return _0x4a0637(0x198);return undefined;}async[a25_0x44b774(0x19d)](_0x41f3ed){const _0x3eb10f=a25_0x44b774,{options:_0x1c0d47,args:_0x41501f,tdx:_0x1013cc}=_0x41f3ed,_0x3d8d33=_0x41501f[0x0],_0x4ca79d=await withSpinner(_0x3eb10f(0x1dc),()=>_0x1013cc['jobs']['result'](_0x3d8d33),{'verbose':_0x1c0d47['verbose']}),_0x206b4f=_0x4ca79d[_0x3eb10f(0x18e)];return console[_0x3eb10f(0x1af)](_0x3eb10f(0x1ba)+_0x206b4f[_0x3eb10f(0x1c5)]+_0x3eb10f(0x1b0)+(_0x206b4f['length']!==0x1?'s':'')),await handleSDKOutput(_0x206b4f,_0x1c0d47),0x0;}}
@@ -1 +1 @@
1
- function a26_0x4f3c(_0x1fdf53,_0x2463d5){_0x1fdf53=_0x1fdf53-0x9f;const _0x2a44d0=a26_0x2a44();let _0x4f3ce4=_0x2a44d0[_0x1fdf53];return _0x4f3ce4;}const a26_0x24da06=a26_0x4f3c;(function(_0x46e42c,_0x4ea54b){const _0x3b6b27=a26_0x4f3c,_0x1778b4=_0x46e42c();while(!![]){try{const _0x3d492d=parseInt(_0x3b6b27(0x109))/0x1*(-parseInt(_0x3b6b27(0x16a))/0x2)+-parseInt(_0x3b6b27(0x187))/0x3*(parseInt(_0x3b6b27(0xdc))/0x4)+parseInt(_0x3b6b27(0x165))/0x5+-parseInt(_0x3b6b27(0x17d))/0x6+-parseInt(_0x3b6b27(0x111))/0x7+parseInt(_0x3b6b27(0xbd))/0x8+parseInt(_0x3b6b27(0x179))/0x9*(parseInt(_0x3b6b27(0x148))/0xa);if(_0x3d492d===_0x4ea54b)break;else _0x1778b4['push'](_0x1778b4['shift']());}catch(_0x7adafc){_0x1778b4['push'](_0x1778b4['shift']());}}}(a26_0x2a44,0x5ed3a));import a26_0x3d1c9f from'chalk';import a26_0x5ab93a 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';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x4e915a){const _0x34e9a5=a26_0x4f3c;return!_0x4e915a&&(console[_0x34e9a5(0x161)](_0x34e9a5(0x13c)),console[_0x34e9a5(0x161)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x4e915a;}function withJsonFormat(_0x1dadef){const _0x380ee4=a26_0x4f3c;if(!_0x1dadef[_0x380ee4(0xff)]&&!_0x1dadef['json']&&!_0x1dadef[_0x380ee4(0xcd)]&&!_0x1dadef[_0x380ee4(0x131)])return{..._0x1dadef,'format':'json','json':!![]};return _0x1dadef;}function formatJourneyState(_0x3d6c3b){const _0x17e071=a26_0x4f3c;switch(_0x3d6c3b){case'launched':return a26_0x3d1c9f['green']('(running)');case'draft':return a26_0x3d1c9f[_0x17e071(0x142)](_0x17e071(0xf8));case _0x17e071(0xa1):return a26_0x3d1c9f[_0x17e071(0x12d)](_0x17e071(0xac));case _0x17e071(0x160):return a26_0x3d1c9f[_0x17e071(0xf0)](_0x17e071(0x14f));case _0x17e071(0xc8):return a26_0x3d1c9f[_0x17e071(0x142)](_0x17e071(0xd5));default:return'('+_0x3d6c3b+')';}}function formatJourneyItem(_0x588c2f,_0x42efb6='',_0x37709f){const _0x330b2a=a26_0x4f3c,_0x2c5a6f=formatJourneyState(_0x588c2f[_0x330b2a(0x127)]),_0x178f9c=_0x37709f?hyperlink(_0x588c2f['journeyBundleName'],_0x37709f):_0x588c2f['journeyBundleName'];return _0x42efb6+'🗺️\x20'+_0x178f9c+'\x20'+_0x2c5a6f;}function escapeRegex(_0x4f74c2){const _0x58fcb5=a26_0x4f3c;return _0x4f74c2[_0x58fcb5(0x149)](/[.*+?^${}()|[\]\\]/g,_0x58fcb5(0xe4));}function globToRegex(_0x17b9c8){const _0x358d8f=a26_0x4f3c,_0x3a7132=_0x17b9c8[_0x358d8f(0xe7)]('*')['map'](escapeRegex);return new RegExp(_0x3a7132['join']('.*'),'i');}function buildRuleToNameMapping(_0x413dcc){const _0xa4e916=a26_0x4f3c,_0x9e3ba2=new Map();if(_0x413dcc[_0xa4e916(0xfe)])for(const [_0xdd104f,_0x7c1e59]of Object['entries'](_0x413dcc[_0xa4e916(0xfe)])){if(_0x7c1e59[_0xa4e916(0x155)]){const _0x224dba=serializeRule(_0x7c1e59[_0xa4e916(0x155)]),_0x391bf5=_0x9e3ba2['get'](_0x224dba);_0x391bf5?_0x391bf5[_0xa4e916(0x193)](_0xdd104f):_0x9e3ba2[_0xa4e916(0x15b)](_0x224dba,[_0xdd104f]);}}return _0x9e3ba2;}async function resolveJourneyIdFromInput(_0x255f1c,_0x1e1c91,_0x431287){const _0x24dc89=a26_0x4f3c,_0x77ed46=await resolveJourneyTarget(_0x255f1c,_0x1e1c91[_0x24dc89(0xf2)],_0x1e1c91[_0x24dc89(0xed)]),_0x53861e=_0x77ed46[_0x24dc89(0xf2)];if(!_0x53861e)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x24dc89(0x13d));const _0x4d30d7=await withSpinner(_0x24dc89(0x182),()=>_0x431287['segment']['resolveParentId'](_0x53861e),{'verbose':_0x1e1c91['verbose']}),_0xf8acc3=_0x4d30d7[_0x24dc89(0x16b)],_0x49d4e9=await withSpinner(_0x24dc89(0x105),()=>_0x431287[_0x24dc89(0xe3)][_0x24dc89(0xc2)](_0xf8acc3,_0x77ed46[_0x24dc89(0x163)]),{'verbose':_0x1e1c91['verbose']});return{'journeyId':_0x49d4e9[_0x24dc89(0x16b)],'journeyName':_0x77ed46[_0x24dc89(0x163)],'parentSegmentId':_0xf8acc3};}async function resolveJourneyTarget(_0x265c3f,_0x348513,_0x18f777){const _0x22bf20=a26_0x4f3c;if(isYamlFilePath(_0x265c3f))try{const _0x581ece=await resolveYamlFilePath(_0x265c3f);return _0x18f777&&(console['error'](_0x22bf20(0x10f)+_0x265c3f),console[_0x22bf20(0x161)](_0x22bf20(0x116)+_0x581ece[_0x22bf20(0xf2)]),console['error'](_0x22bf20(0xd8)+_0x581ece[_0x22bf20(0x171)]),console[_0x22bf20(0x161)](_0x22bf20(0x17c)+(_0x581ece['folderPath']||_0x22bf20(0xef)))),{'journeyName':_0x581ece[_0x22bf20(0x171)],'parentSegment':_0x581ece[_0x22bf20(0xf2)],'resolved':_0x581ece};}catch(_0x31d1fd){throw new SDKError(ErrorCode[_0x22bf20(0xd9)],_0x22bf20(0x15c)+_0x31d1fd[_0x22bf20(0x156)]);}if(!_0x348513)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x22bf20(0x13b));return{'journeyName':_0x265c3f,'parentSegment':_0x348513};}export class JourneyListCommand extends BaseCommand{[a26_0x24da06(0x122)]=a26_0x24da06(0x138);[a26_0x24da06(0xf3)]=a26_0x24da06(0xf7);async['execute'](_0x2acc60){const _0x1f65d3=a26_0x24da06,{options:_0x5d277b,args:_0x56cdcb,tdx:_0x51dccc}=_0x2acc60,_0x22797a=_0x56cdcb[0x0],_0x2ba6ff=_0x5d277b[_0x1f65d3(0xf2)];if(!_0x2ba6ff)return console['error']('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x1f65d3(0x161)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x24423d=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x51dccc['segment'][_0x1f65d3(0xf5)](_0x2ba6ff),{'verbose':_0x5d277b[_0x1f65d3(0xed)]}),_0x24624b=_0x24423d[_0x1f65d3(0x16b)];_0x5d277b[_0x1f65d3(0xed)]&&(console[_0x1f65d3(0x161)]('Parent\x20segment:\x20'+_0x2ba6ff+_0x1f65d3(0x19d)+_0x24624b+')'),_0x22797a&&console[_0x1f65d3(0x161)](_0x1f65d3(0x170)+_0x22797a));const _0x2ff4a3=await withSpinner(_0x1f65d3(0xbb),()=>_0x51dccc[_0x1f65d3(0x175)][_0x1f65d3(0xa4)](_0x24624b),{'verbose':_0x5d277b[_0x1f65d3(0xed)]}),_0x427353=_0x2ff4a3[_0x1f65d3(0x16b)],_0x27b26c=_0x427353[_0x1f65d3(0x15f)],_0x564c88=await withSpinner(_0x1f65d3(0x186),()=>_0x51dccc['journey'][_0x1f65d3(0xf4)](_0x24624b,_0x27b26c),{'verbose':_0x5d277b[_0x1f65d3(0xed)]});let _0x2d567a=_0x564c88['data']['journeys'];const _0x327cc2=_0x564c88[_0x1f65d3(0x16b)][_0x1f65d3(0xd1)],_0x239dfc=new Map();for(const _0x4d0960 of _0x327cc2){_0x239dfc['set'](_0x4d0960['id'],_0x4d0960[_0x1f65d3(0x122)]);}if(_0x22797a){const _0x58e3d9=globToRegex(_0x22797a);_0x2d567a=_0x2d567a[_0x1f65d3(0xda)](_0x1bd9a0=>_0x58e3d9[_0x1f65d3(0x114)](_0x1bd9a0[_0x1f65d3(0x100)]));}console['error'](_0x1f65d3(0x197)+_0x2d567a[_0x1f65d3(0x190)]+_0x1f65d3(0x153)+(_0x2d567a[_0x1f65d3(0x190)]!==0x1?'s':''));const _0x5b21ff=_0x2bf1c6=>{const _0x588481=_0x1f65d3;return getConsoleNextUrl(_0x5d277b[_0x588481(0xd0)],_0x588481(0xd2)+_0x24624b+_0x588481(0x12a)+_0x2bf1c6+_0x588481(0xf1));};if(_0x5d277b[_0x1f65d3(0xff)]==='table')await handleSDKOutput(_0x2d567a,_0x5d277b);else{if(_0x5d277b[_0x1f65d3(0xff)]===_0x1f65d3(0x167)){const _0x530f47=_0x2d567a[_0x1f65d3(0x121)](_0x7340d3=>({..._0x7340d3,'url':_0x5b21ff(_0x7340d3['id'])}));await handleSDKOutput(_0x530f47,_0x5d277b);}else{console[_0x1f65d3(0xba)]('['+_0x2ba6ff+']');const _0x2009b6=new Map(),_0x53e562=[];for(const _0x373924 of _0x2d567a){if(!_0x373924[_0x1f65d3(0x16e)]||_0x373924[_0x1f65d3(0x16e)]===_0x27b26c)_0x53e562[_0x1f65d3(0x193)](_0x373924);else{const _0x2c7837=_0x2009b6[_0x1f65d3(0x123)](_0x373924[_0x1f65d3(0x16e)])||[];_0x2c7837['push'](_0x373924),_0x2009b6[_0x1f65d3(0x15b)](_0x373924[_0x1f65d3(0x16e)],_0x2c7837);}}const _0x51381d=(_0x33ba11,_0xf83802)=>_0x33ba11[_0x1f65d3(0x100)][_0x1f65d3(0xb5)](_0xf83802[_0x1f65d3(0x100)],undefined,{'sensitivity':_0x1f65d3(0x12e)});_0x53e562[_0x1f65d3(0x14d)](_0x51381d);for(const _0x5898db of _0x53e562){console[_0x1f65d3(0xba)](formatJourneyItem(_0x5898db,'',_0x5b21ff(_0x5898db['id'])));}const _0x31d27c=[..._0x2009b6[_0x1f65d3(0xcc)]()]['sort']((_0x336099,_0x3fd732)=>{const _0x13fb81=_0x1f65d3,_0x5d4285=_0x239dfc[_0x13fb81(0x123)](_0x336099[0x0])||_0x336099[0x0],_0x1ee7d7=_0x239dfc['get'](_0x3fd732[0x0])||_0x3fd732[0x0];return _0x5d4285[_0x13fb81(0xb5)](_0x1ee7d7,undefined,{'sensitivity':_0x13fb81(0x12e)});});for(const [_0x35f94c,_0x3b2101]of _0x31d27c){const _0x194e23=_0x239dfc[_0x1f65d3(0x123)](_0x35f94c)||_0x35f94c;console[_0x1f65d3(0xba)](_0x1f65d3(0xb4)+_0x194e23),_0x3b2101[_0x1f65d3(0x14d)](_0x51381d);for(const _0x232739 of _0x3b2101){console[_0x1f65d3(0xba)](formatJourneyItem(_0x232739,'\x20\x20',_0x5b21ff(_0x232739['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a26_0x24da06(0x122)]='journey:view';[a26_0x24da06(0xf3)]='Show\x20journey\x20details';async[a26_0x24da06(0x117)](_0x1ecf75){const _0x457250=a26_0x24da06,{options:_0x550b72,args:_0x2a5ad6,tdx:_0x53f3a3}=_0x1ecf75,_0x481439=_0x2a5ad6[0x0];if(!_0x481439)return console[_0x457250(0x161)](_0x457250(0x13c)),console[_0x457250(0x161)](_0x457250(0xc1)),console[_0x457250(0x161)](_0x457250(0x136)),console[_0x457250(0x161)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x550b72[_0x457250(0xed)]&&console[_0x457250(0x161)](_0x457250(0xbf)+_0x481439);const {journeyId:_0x41cf75,parentSegmentId:_0x170c8f}=await resolveJourneyIdFromInput(_0x481439,_0x550b72,_0x53f3a3);if(_0x550b72['web']){const _0x2afc7e=getConsoleNextUrl(_0x550b72[_0x457250(0xd0)],_0x457250(0xd2)+_0x170c8f+_0x457250(0x12a)+_0x41cf75+_0x457250(0x17e));return console[_0x457250(0x161)](a26_0x3d1c9f[_0x457250(0x1a0)]('✔')+'\x20Opening\x20'+a26_0x3d1c9f[_0x457250(0x11b)](_0x2afc7e)),openBrowser(_0x2afc7e),0x0;}const _0x5cf499=await withSpinner(_0x457250(0xae),()=>_0x53f3a3[_0x457250(0xe3)][_0x457250(0x192)](_0x41cf75),{'verbose':_0x550b72[_0x457250(0xed)]}),_0xe18b1f=_0x5cf499[_0x457250(0x16b)],_0x444020=_0x550b72['includeStats'];let _0x53fbac;if(_0x444020)try{const _0x119d66=await withSpinner(_0x457250(0x19e),()=>_0x53f3a3['journey'][_0x457250(0xbc)](_0x41cf75),{'verbose':_0x550b72[_0x457250(0xed)]});_0x53fbac=_0x119d66[_0x457250(0x16b)];}catch{_0x550b72[_0x457250(0xed)]&&console[_0x457250(0x161)](_0x457250(0x118));}const _0x27c243=getConsoleNextUrl(_0x550b72['site'],'/app/ps/'+_0x170c8f+_0x457250(0x12a)+_0x41cf75+'/j/da/je'),_0x4e4485={'id':_0xe18b1f['id'],'name':_0xe18b1f[_0x457250(0x19c)][_0x457250(0x122)],'description':_0xe18b1f[_0x457250(0x19c)]['description'],'state':_0xe18b1f[_0x457250(0x19c)][_0x457250(0x127)],'paused':_0xe18b1f[_0x457250(0x19c)][_0x457250(0xa1)],'reentry_mode':_0xe18b1f[_0x457250(0x19c)][_0x457250(0x1a2)],'stages':_0xe18b1f[_0x457250(0x19c)]['journeyStages']?.['length']||0x0,..._0xe18b1f[_0x457250(0x19c)][_0x457250(0x113)]&&{'goal':_0xe18b1f[_0x457250(0x19c)][_0x457250(0x113)][_0x457250(0x122)]},..._0x53fbac&&{'statistics':{'size':_0x53fbac['size'],'entered':_0x53fbac[_0x457250(0x159)],'goal_achieved':_0x53fbac['goalSize'],'completion_rate':_0x53fbac[_0x457250(0x173)],'exit_or_jump':_0x53fbac['exitOrJumpSize'],'exit_or_jump_rate':_0x53fbac[_0x457250(0x11c)],'stages':_0x53fbac[_0x457250(0xfc)]}},'url':_0x27c243};return await handleSingleObjectOutput(_0x4e4485,_0x550b72),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0x24da06(0x122)]=a26_0x24da06(0x16f);[a26_0x24da06(0xf3)]='Show\x20journey\x20statistics';async[a26_0x24da06(0x117)](_0x15870f){const _0xc1c85a=a26_0x24da06,{options:_0x249c31,args:_0x1f2564,tdx:_0x4f1ab9}=_0x15870f,_0x2903d2=_0x1f2564[0x0];if(!requireNameOrPath(_0x2903d2))return 0x1;_0x249c31[_0xc1c85a(0xed)]&&console[_0xc1c85a(0x161)](_0xc1c85a(0xbf)+_0x2903d2);const _0x35a086=_0x249c31,_0x502a3a=_0x35a086[_0xc1c85a(0x16d)],_0x1d8338=_0x35a086['to'],_0x41eac1=_0x35a086[_0xc1c85a(0xab)],_0x31ef14=_0x35a086[_0xc1c85a(0x17f)];_0x41eac1&&!_0x502a3a&&!_0x1d8338&&console[_0xc1c85a(0x161)](_0xc1c85a(0xb2));const _0x21ed10=_0x41eac1?withJsonFormat(_0x249c31):_0x249c31,{journeyId:_0x412236,journeyName:_0x2facd0}=await resolveJourneyIdFromInput(_0x2903d2,_0x21ed10,_0x4f1ab9),_0xe9cf76=_0x502a3a||_0x1d8338?{'from':_0x502a3a,'to':_0x1d8338}:undefined,_0x52e9d6=await withSpinner(_0xc1c85a(0x19e),()=>Promise[_0xc1c85a(0x146)]([_0x4f1ab9[_0xc1c85a(0xe3)]['getJourney'](_0x412236),_0x4f1ab9['journey'][_0xc1c85a(0xbc)](_0x412236,_0xe9cf76)]),{'verbose':_0x21ed10[_0xc1c85a(0xed)]}),[_0x13c0f6,_0x2f77de]=_0x52e9d6[_0xc1c85a(0x16b)];if(!_0x2f77de||_0x2f77de[_0xc1c85a(0xc9)]===null)return console[_0xc1c85a(0x161)](_0xc1c85a(0xcb)+_0x2facd0),console[_0xc1c85a(0x161)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x5e097d=buildStageNameMap(_0x13c0f6),_0x403ffd=!!(_0xe9cf76&&_0x2f77de['history']?.[_0xc1c85a(0x190)]),_0x21bcfd={'stageNameMap':_0x5e097d,'hasPeriod':_0x403ffd,'includeHistory':!!_0x41eac1};if(_0x31ef14&&_0x2f77de[_0xc1c85a(0xfc)]){const _0x4b165b=_0x2f77de[_0xc1c85a(0xfc)]['find'](_0x2d750d=>{const _0xc70b5c=_0xc1c85a,_0x415084=_0x5e097d['get'](_0x2d750d['id'])??'';return _0x415084[_0xc70b5c(0x1a3)]()===_0x31ef14['toLowerCase']();});if(_0x4b165b)return await handleSingleObjectOutput(formatStageStats(_0x4b165b,_0x21bcfd),_0x21ed10),0x0;const _0x12b619=_0x2f77de[_0xc1c85a(0xfc)]['map'](_0x116e26=>_0x5e097d['get'](_0x116e26['id'])??_0x116e26['id']);return console[_0xc1c85a(0x161)](_0xc1c85a(0x198)+_0x31ef14+_0xc1c85a(0xb7)),console[_0xc1c85a(0x161)](_0xc1c85a(0xdb)+_0x12b619[_0xc1c85a(0xe1)](',\x20')),0x1;}const _0x300720=_0x2f77de[_0xc1c85a(0xfc)]?.['map'](_0x5a9ea7=>formatStageStats(_0x5a9ea7,_0x21bcfd)),_0x47726f=assembleJourneyStats(_0x2f77de,{'from':_0x502a3a,'to':_0x1d8338,'includeHistory':_0x41eac1});return await this[_0xc1c85a(0x139)](_0x47726f,_0x300720??[],_0x21ed10),0x0;}async[a26_0x24da06(0x139)](_0x3c2a55,_0x549f35,_0xe544a0){const _0x3cff11=a26_0x24da06,_0x91f2e9=_0xe544a0[_0x3cff11(0xff)]==='json'||_0xe544a0[_0x3cff11(0xff)]===_0x3cff11(0xcd)||_0xe544a0[_0x3cff11(0x167)]||_0xe544a0[_0x3cff11(0xcd)];if(_0x91f2e9){_0x3c2a55[_0x3cff11(0xfc)]=_0x549f35,await handleSingleObjectOutput(_0x3c2a55,_0xe544a0);return;}await handleSingleObjectOutput(_0x3c2a55,_0xe544a0);for(const _0x361e4e of _0x549f35){console['log'](''),console['log'](String(a26_0x3d1c9f[_0x3cff11(0x11b)][_0x3cff11(0x108)]('['+_0x361e4e['name']+']'))+a26_0x3d1c9f[_0x3cff11(0x142)]('\x20'+_0x361e4e['id']));const {id:_0x52a2a9,name:_0xeacd0f,..._0x9a2d52}=_0x361e4e;await handleSingleObjectOutput(_0x9a2d52,_0xe544a0);}}}export class JourneyTrafficCommand extends BaseCommand{[a26_0x24da06(0x122)]='journey:traffic';['description']=a26_0x24da06(0xfd);async[a26_0x24da06(0x117)](_0x11c770){const _0x3252b8=a26_0x24da06,{options:_0x3f4224,args:_0x1d759b,tdx:_0x37ea0e}=_0x11c770,_0xc040cc=_0x1d759b[0x0];if(!requireNameOrPath(_0xc040cc))return 0x1;_0x3f4224['verbose']&&console['error'](_0x3252b8(0xbf)+_0xc040cc);const _0x663f25=_0x3f4224,_0x261c06=_0x663f25[_0x3252b8(0xca)],_0x46765e=_0x663f25[_0x3252b8(0x16d)],_0x5de6d1=_0x663f25['to'],_0x220b70=_0x663f25['limit'];if(_0x261c06&&_0x261c06!==_0x3252b8(0xa0)&&_0x261c06!==_0x3252b8(0x166))return console[_0x3252b8(0x161)](_0x3252b8(0x12f)+_0x261c06+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0xe39d42=withJsonFormat(_0x3f4224),{journeyId:_0xd3fe36,journeyName:_0x90a89c}=await resolveJourneyIdFromInput(_0xc040cc,_0xe39d42,_0x37ea0e),_0x314b5a={'type':_0x261c06,'from':_0x46765e,'to':_0x5de6d1,'limit':_0x220b70},_0x4b3fb6=await withSpinner(_0x3252b8(0xc5),()=>_0x37ea0e[_0x3252b8(0xe3)][_0x3252b8(0x185)](_0xd3fe36,_0x314b5a),{'verbose':_0xe39d42[_0x3252b8(0xed)]}),_0x2e9796=_0x4b3fb6[_0x3252b8(0x16b)],_0x38006b=_0x2e9796[_0x3252b8(0xa0)]&&(_0x2e9796[_0x3252b8(0xa0)]['nodes'][_0x3252b8(0x190)]>0x0||_0x2e9796[_0x3252b8(0xa0)][_0x3252b8(0xc7)]['length']>0x0),_0x54be1f=_0x2e9796['activation']&&_0x2e9796[_0x3252b8(0x166)][_0x3252b8(0x190)]>0x0;if(!_0x38006b&&!_0x54be1f)return console[_0x3252b8(0x161)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x90a89c),console[_0x3252b8(0x161)](_0x3252b8(0x13f)),_0x46765e&&_0x5de6d1&&console['error']('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(_0x2e9796,_0xe39d42),0x0;}}function formatStageStats(_0x4a6ef2,_0x386fd2){const _0x2d3ea0=a26_0x24da06,_0x22ec39=_0x386fd2[_0x2d3ea0(0xe9)]&&_0x4a6ef2[_0x2d3ea0(0x133)]?.[_0x2d3ea0(0x190)]?aggregateStageHistory(_0x4a6ef2[_0x2d3ea0(0x133)]):{'size':_0x4a6ef2['size'],'entered':_0x4a6ef2['enteredSize'],'milestone':_0x4a6ef2[_0x2d3ea0(0x15d)],'milestone_rate':_0x4a6ef2['completeMilestoneRate'],'exit_or_jump':_0x4a6ef2[_0x2d3ea0(0x119)],'exit_or_jump_rate':_0x4a6ef2['exitOrJumpRate']},_0x45a6bb={'id':_0x4a6ef2['id'],'name':_0x386fd2[_0x2d3ea0(0x14a)]['get'](_0x4a6ef2['id'])??_0x4a6ef2['id'],..._0x22ec39};return _0x386fd2[_0x2d3ea0(0xe9)]&&_0x386fd2['includeHistory']&&_0x4a6ef2[_0x2d3ea0(0x133)]&&(_0x45a6bb[_0x2d3ea0(0x133)]=_0x4a6ef2[_0x2d3ea0(0x133)]),_0x45a6bb;}export class JourneyPauseCommand extends BaseCommand{[a26_0x24da06(0x122)]='journey:pause';[a26_0x24da06(0xf3)]=a26_0x24da06(0xc3);async[a26_0x24da06(0x117)](_0x47a63a){const _0x18c34d=a26_0x24da06,{options:_0x4242b2,args:_0x4b307f,tdx:_0x324729}=_0x47a63a,_0x1970a9=_0x4b307f[0x0];if(!requireNameOrPath(_0x1970a9))return 0x1;_0x4242b2[_0x18c34d(0xed)]&&console['error'](_0x18c34d(0xbf)+_0x1970a9);const {journeyId:_0x4d4966,journeyName:_0x5ea44f}=await resolveJourneyIdFromInput(_0x1970a9,_0x4242b2,_0x324729);if(!_0x4242b2[_0x18c34d(0x140)]){const _0x218221=await confirm(_0x18c34d(0x188)+_0x5ea44f+'\x22?');if(!_0x218221)return console[_0x18c34d(0x161)](_0x18c34d(0xad)),0x0;}const _0x33773b=await withSpinner(_0x18c34d(0x152),()=>_0x324729[_0x18c34d(0xe3)][_0x18c34d(0x143)](_0x4d4966),{'verbose':_0x4242b2[_0x18c34d(0xed)]}),_0x2e5aa6=_0x33773b[_0x18c34d(0x16b)];return console[_0x18c34d(0x161)]('✔\x20Journey\x20\x22'+_0x2e5aa6[_0x18c34d(0x19c)][_0x18c34d(0x122)]+_0x18c34d(0xf9)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0x24da06(0x122)]=a26_0x24da06(0x132);[a26_0x24da06(0xf3)]='Resume\x20a\x20paused\x20journey';async['execute'](_0x4ce61f){const _0x4e4133=a26_0x24da06,{options:_0x48efc5,args:_0x44c007,tdx:_0x4f962e}=_0x4ce61f,_0x38c2d6=_0x44c007[0x0];if(!requireNameOrPath(_0x38c2d6))return 0x1;_0x48efc5['verbose']&&console['error'](_0x4e4133(0xbf)+_0x38c2d6);const {journeyId:_0x21d5a2,journeyName:_0x14697e}=await resolveJourneyIdFromInput(_0x38c2d6,_0x48efc5,_0x4f962e);if(!_0x48efc5[_0x4e4133(0x140)]){const _0x197f1f=await confirm(_0x4e4133(0xdf)+_0x14697e+'\x22?');if(!_0x197f1f)return console[_0x4e4133(0x161)](_0x4e4133(0xad)),0x0;}const _0x33c83f=await withSpinner(_0x4e4133(0x1a4),()=>_0x4f962e[_0x4e4133(0xe3)][_0x4e4133(0xb0)](_0x21d5a2),{'verbose':_0x48efc5[_0x4e4133(0xed)]}),_0x5109d7=_0x33c83f[_0x4e4133(0x16b)];return console['error'](_0x4e4133(0x115)+_0x5109d7['attributes'][_0x4e4133(0x122)]+_0x4e4133(0x199)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a26_0x24da06(0x18a);[a26_0x24da06(0xf3)]=a26_0x24da06(0x183);async[a26_0x24da06(0x117)](_0x5c3950){const _0x53eb45=a26_0x24da06,{options:_0x56d73e,args:_0x4511e0,tdx:_0x37fa6b}=_0x5c3950,_0x1a4536=_0x56d73e,_0x5edcb1=_0x4511e0[0x0],_0x47174d=_0x5edcb1&&isYamlFilePath(_0x5edcb1),_0x1ff1ba=await resolveTarget({'arg':_0x47174d?_0x5edcb1:undefined,'contextParent':_0x56d73e[_0x53eb45(0xf2)],'cwd':process[_0x53eb45(0x174)]()});if(!isSuccessfulResolution(_0x1ff1ba))return _0x1ff1ba[_0x53eb45(0x14e)]===_0x53eb45(0x164)?(console['error'](a26_0x3d1c9f[_0x53eb45(0x12d)](_0x53eb45(0x154))),console[_0x53eb45(0x161)](_0x53eb45(0x151)),console['error'](_0x53eb45(0xde)),console[_0x53eb45(0x161)](_0x53eb45(0x177)),console[_0x53eb45(0x161)](_0x53eb45(0xa7))):(console[_0x53eb45(0x161)](a26_0x3d1c9f[_0x53eb45(0x19f)](_0x53eb45(0xe0)+_0x1ff1ba[_0x53eb45(0x156)]+'\x0a')),_0x1ff1ba[_0x53eb45(0x13a)]&&console[_0x53eb45(0x161)](a26_0x3d1c9f[_0x53eb45(0x11b)](_0x1ff1ba[_0x53eb45(0x13a)]))),0x1;let _0x26b3a2=_0x47174d?undefined:_0x5edcb1,_0x199a0d,_0x339053;_0x1ff1ba[_0x53eb45(0xca)]===_0x53eb45(0xb3)&&(_0x26b3a2=_0x1ff1ba[_0x53eb45(0x147)],_0x199a0d=_0x1ff1ba[_0x53eb45(0xa6)],_0x339053=_0x1ff1ba[_0x53eb45(0x130)]);const _0xf7d602=_0x1ff1ba['parentName'],_0x8298b1=_0x1ff1ba['targetDir'];_0x1a4536[_0x53eb45(0xed)]&&(console[_0x53eb45(0x161)](_0x53eb45(0x103)+_0xf7d602),console[_0x53eb45(0x161)]('Target\x20directory:\x20'+_0x8298b1),_0x26b3a2&&console['error']('Journey\x20name:\x20'+_0x26b3a2),_0x199a0d&&console[_0x53eb45(0x161)](_0x53eb45(0x126)+_0x199a0d),_0x339053&&console[_0x53eb45(0x161)](_0x53eb45(0x12b)+_0x339053));const _0x2c185f=await withSpinner(_0x53eb45(0x182),()=>_0x37fa6b[_0x53eb45(0x175)]['resolveParentId'](_0xf7d602),{'verbose':_0x56d73e['verbose']}),_0x4af52d=_0x2c185f[_0x53eb45(0x16b)],{journeys:_0x291e39,folders:_0x54eac4}=await withSpinner(_0x53eb45(0xa3),async()=>{const _0x529635=_0x53eb45,[_0x2709ca,_0x26fe63]=await Promise[_0x529635(0x146)]([_0x37fa6b[_0x529635(0xe3)]['listJourneysFromParentSegment'](_0x4af52d,undefined,{'includeAllVersions':!![]}),_0x37fa6b[_0x529635(0x175)]['listFolders'](_0x4af52d)]);return{'journeys':_0x2709ca,'folders':_0x26fe63};},{'verbose':_0x56d73e[_0x53eb45(0xed)]})[_0x53eb45(0x180)](_0x2172b9=>_0x2172b9[_0x53eb45(0x16b)]);let _0x4ab712=_0x291e39;const _0x12f1a5=buildFolderIdToPathMap(_0x54eac4);if(_0x26b3a2){const _0x5f4ca0=_0x4ab712[_0x53eb45(0xda)](_0x545b30=>_0x545b30['journeyBundleName']['toLowerCase']()===_0x26b3a2[_0x53eb45(0x1a3)]());if(_0x5f4ca0[_0x53eb45(0x190)]===0x0)return console[_0x53eb45(0x161)](_0x53eb45(0x124)+_0x26b3a2),console[_0x53eb45(0x161)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x4ab712=_0x5f4ca0;}if(_0x339053!==undefined){const _0x2134b5=_0x4ab712[_0x53eb45(0xda)](_0x2fc970=>{const _0x3bf01e=_0x53eb45,_0x27a351=_0x2fc970['folderId']?_0x12f1a5[_0x3bf01e(0x123)](_0x2fc970[_0x3bf01e(0x16e)])||'':'';return _0x27a351===_0x339053;});if(_0x2134b5[_0x53eb45(0x190)]===0x0&&_0x4ab712['length']>0x0){console[_0x53eb45(0x161)](_0x53eb45(0x178)+_0x26b3a2+_0x53eb45(0xce)+(_0x339053||_0x53eb45(0x128))),console['error'](_0x53eb45(0x18b));for(const _0x8580bd of _0x4ab712){const _0x58be3e=_0x8580bd[_0x53eb45(0x16e)]?_0x12f1a5[_0x53eb45(0x123)](_0x8580bd[_0x53eb45(0x16e)])||'':'';console[_0x53eb45(0x161)]('\x20\x20-\x20'+(_0x58be3e||_0x53eb45(0xef))+'/'+_0x8580bd[_0x53eb45(0x100)]);}return 0x1;}_0x4ab712=_0x2134b5;}if(_0x4ab712[_0x53eb45(0x190)]===0x0)return console['error']('No\x20journeys\x20found'),0x0;const _0x5cbb1c=new Map();for(const _0x15ebeb of _0x4ab712){const _0x3fc50b=_0x15ebeb['journeyBundleId'];!_0x5cbb1c[_0x53eb45(0xa9)](_0x3fc50b)&&_0x5cbb1c[_0x53eb45(0x15b)](_0x3fc50b,[]),_0x5cbb1c[_0x53eb45(0x123)](_0x3fc50b)[_0x53eb45(0x193)](_0x15ebeb);}for(const _0x1d221a of _0x5cbb1c[_0x53eb45(0x144)]()){_0x1d221a['sort']((_0x273f85,_0x3d6bae)=>(_0x273f85[_0x53eb45(0x181)]||0x0)-(_0x3d6bae[_0x53eb45(0x181)]||0x0));}const _0x56e5db=[],{idToEmailMap:_0x45612a,connectionIdToNameMap:_0x4cda11}=await withSpinner(_0x53eb45(0x19a),async()=>{const [_0x46acb1,_0x115ff8]=await Promise['all']([_0x37fa6b['user']['buildIdToEmailMap'](),_0x37fa6b['connection']['buildIdToNameMap']()]);return{'idToEmailMap':_0x46acb1,'connectionIdToNameMap':_0x115ff8};},{'verbose':_0x56d73e['verbose']})['then'](_0x528bb0=>_0x528bb0[_0x53eb45(0x16b)]);for(const _0x2384ac of _0x5cbb1c[_0x53eb45(0x144)]()){const _0x264491=_0x2384ac[0x0][_0x53eb45(0x100)],_0x3c3c80=_0x2384ac[0x0][_0x53eb45(0x16e)],_0x18a5fc=_0x3c3c80?_0x12f1a5[_0x53eb45(0x123)](_0x3c3c80)||'':'',_0x49fb55=_0x18a5fc?a26_0x5ab93a[_0x53eb45(0xe1)](_0x8298b1,_0x18a5fc):_0x8298b1,_0x299ade=_0x199a0d||a26_0x5ab93a['join'](_0x49fb55,sanitizeFileName(_0x264491)+_0x53eb45(0xd6));let _0x565449,_0x53aec3;if(existsSync(_0x299ade))try{const _0x20102b=readFileSync(_0x299ade,_0x53eb45(0xd4)),_0x5bae16=parseYamlString(_0x20102b);_0x53aec3=_0x5bae16,_0x565449=buildRuleToNameMapping(_0x5bae16),_0x1a4536[_0x53eb45(0xed)]&&_0x565449['size']>0x0&&console[_0x53eb45(0x161)](_0x53eb45(0x18c)+_0x565449[_0x53eb45(0x120)]+_0x53eb45(0x18f)+_0x264491);}catch(_0x3c4c1d){_0x1a4536[_0x53eb45(0xed)]&&console[_0x53eb45(0x161)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x3c4c1d[_0x53eb45(0x156)]);}const _0xc10a7=[],_0xd2de1a=new Set(),_0x20a745=new Map(),_0x5d8929=new Map(),_0x2c924c=new Set(),_0x313c31=new Map(),_0x1ffcbb=new Map(),_0x50cc14=createJumpTargetCache();await withProgressSpinner(_0x53eb45(0xdd)+_0x264491+'...',async _0x3dd98b=>{const _0x34cb17=_0x53eb45;for(const _0x462482 of _0x2384ac){const _0x401aaf=_0x2384ac[_0x34cb17(0x190)]>0x1?_0x462482[_0x34cb17(0x100)]+'\x20v'+(_0x462482[_0x34cb17(0x181)]||0x1):_0x462482[_0x34cb17(0x100)];_0x3dd98b[_0x34cb17(0x11d)](_0x34cb17(0xdd)+_0x401aaf);const _0x31a6cd=await _0x37fa6b[_0x34cb17(0xe3)][_0x34cb17(0x192)](_0x462482['id']),_0x6ad50b=_0x31a6cd[_0x34cb17(0x19c)]?.[_0x34cb17(0xb6)],_0x10ecaf={'resolveSegment':async _0x58476f=>{const _0x584c7a=_0x34cb17;if(!_0x6ad50b)return{'name':_0x58476f,'isJourneyLocal':![]};const _0x2493e0=_0x20a745[_0x584c7a(0x123)](_0x58476f);if(_0x2493e0)return _0x2493e0;try{const _0xb0ab2c=await _0x37fa6b['segment'][_0x584c7a(0x158)](_0x6ad50b,_0x58476f),_0x3fbf37=_0xb0ab2c[_0x584c7a(0x107)]===SEGMENT_KIND_JOURNEY;let _0x498eb1,_0x3d502c=_0xb0ab2c[_0x584c7a(0x122)];if(_0x3fbf37&&_0xb0ab2c['rule']){const _0x461c44=await segmentResponseToDef(_0xb0ab2c,{'resolveSegmentName':async _0x214389=>{const _0x809af2=_0x584c7a,_0x389b6d=_0x20a745[_0x809af2(0x123)](_0x214389);if(_0x389b6d)return _0x389b6d[_0x809af2(0x122)];const _0x3e78c0=await _0x10ecaf[_0x809af2(0x18e)](_0x214389);return _0x3e78c0['name'];}}),_0x48ffd8=_0x461c44[_0x584c7a(0x155)];_0x498eb1={'description':_0xb0ab2c[_0x584c7a(0xf3)],'rule':_0x48ffd8};const _0x540eeb=serializeRule(_0x48ffd8),_0x51d879=_0x5d8929[_0x584c7a(0x123)](_0x540eeb);if(_0x51d879)_0x3d502c=_0x51d879,_0x498eb1=undefined,_0x1a4536[_0x584c7a(0xed)]&&console[_0x584c7a(0x161)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0xb0ab2c['name']+'\x20->\x20'+_0x51d879);else{let _0x57e9e7=![];if(_0x565449){const _0x3a41b2=_0x565449[_0x584c7a(0x123)](_0x540eeb);if(_0x3a41b2){const _0x111726=_0x3a41b2['find'](_0x45f037=>!_0xd2de1a[_0x584c7a(0xa9)](_0x45f037));_0x111726&&(_0x3d502c=_0x111726,_0xd2de1a[_0x584c7a(0x137)](_0x111726),_0x5d8929[_0x584c7a(0x15b)](_0x540eeb,_0x111726),_0x57e9e7=!![],_0x1a4536[_0x584c7a(0xed)]&&console['error'](_0x584c7a(0xf6)+_0x111726+_0x584c7a(0xe6)));}}if(!_0x57e9e7){const _0x479c61=generateJourneyLocalName(_0xb0ab2c[_0x584c7a(0x122)]);_0x479c61&&(_0x3d502c=_0x479c61);let _0x2a0b19=_0x3d502c,_0x467c3c=0x2;while(_0xd2de1a['has'](_0x2a0b19)){_0x2a0b19=_0x3d502c+'_'+_0x467c3c,_0x467c3c++;}_0xd2de1a['add'](_0x2a0b19),_0x5d8929[_0x584c7a(0x15b)](_0x540eeb,_0x2a0b19),_0x3d502c=_0x2a0b19;}}}const _0x39ca13={'name':_0x3d502c,'isJourneyLocal':_0x3fbf37,'definition':_0x498eb1};return _0x20a745[_0x584c7a(0x15b)](_0x58476f,_0x39ca13),_0x39ca13;}catch(_0xbf10ce){return _0x56d73e[_0x584c7a(0xed)]&&console[_0x584c7a(0x161)](_0x584c7a(0x157)+_0x58476f+':\x20'+_0xbf10ce[_0x584c7a(0x156)]),{'name':_0x58476f,'isJourneyLocal':![]};}},'resolveActivation':async _0x4e3ea7=>{const _0x4a55ac=_0x34cb17,_0x306a78=_0x313c31[_0x4a55ac(0x123)](_0x4e3ea7);if(_0x306a78)return _0x306a78;try{const _0x25a9db=await _0x37fa6b['journey'][_0x4a55ac(0xbe)](_0x462482['id'],_0x4e3ea7),_0x5d6e48=journeyActivationStepToYaml(_0x25a9db,_0x45612a,_0x4cda11),_0x2f93be=JSON[_0x4a55ac(0x196)]({'name':_0x5d6e48['name'],'connection':_0x5d6e48['connection'],'connector_config':_0x5d6e48[_0x4a55ac(0xd3)]}),_0x1f54f0=_0x1ffcbb['get'](_0x2f93be);if(_0x1f54f0){const _0x108909={'name':_0x1f54f0,'isJourneyLocal':!![],'definition':_0x5d6e48};return _0x313c31[_0x4a55ac(0x15b)](_0x4e3ea7,_0x108909),_0x108909;}const _0x1571f3=_0x25a9db['attributes'][_0x4a55ac(0x150)][_0x4a55ac(0x122)]||_0x4e3ea7,_0x1e3429=sanitizeYamlKey(_0x1571f3)||_0x4a55ac(0xc4)+_0x4e3ea7;let _0x4f1b1b=_0x1e3429,_0x40360e=0x2;while(_0x2c924c['has'](_0x4f1b1b)){_0x4f1b1b=_0x1e3429+'_'+_0x40360e,_0x40360e++;}_0x2c924c[_0x4a55ac(0x137)](_0x4f1b1b),_0x1ffcbb[_0x4a55ac(0x15b)](_0x2f93be,_0x4f1b1b);const _0xa885b6={'name':_0x4f1b1b,'isJourneyLocal':!![],'definition':_0x5d6e48};return _0x313c31[_0x4a55ac(0x15b)](_0x4e3ea7,_0xa885b6),_0xa885b6;}catch(_0x5393ec){return _0x56d73e[_0x4a55ac(0xed)]&&console[_0x4a55ac(0x161)](_0x4a55ac(0xea)+_0x4e3ea7+':\x20'+_0x5393ec[_0x4a55ac(0x156)]),{'name':_0x4e3ea7,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x45c330,_0x341468)=>{const _0x371cbd=_0x34cb17;return resolveJumpTarget(_0x45c330,_0x341468,_0x50cc14,_0x48629d=>_0x37fa6b[_0x371cbd(0xe3)][_0x371cbd(0x192)](_0x48629d));}},_0x1b74bf=await journeyResponseToDef(_0x31a6cd,_0x10ecaf);_0xc10a7['push']({'item':_0x462482,'yaml':_0x1b74bf});}},{'verbose':_0x56d73e[_0x53eb45(0xed)]});const _0x508b1a=await _0x37fa6b[_0x53eb45(0xe3)]['getLatestJourneyId'](_0x2384ac[0x0]['journeyBundleId']),_0x541952=buildMergedJourneyDef(_0xc10a7,_0x565449,_0x508b1a),_0xbe8981=normalizeJourneyDef(_0x541952,_0x53aec3),_0x233d9b=toYamlString(_0xbe8981),_0x4c417b=_0x199a0d||a26_0x5ab93a[_0x53eb45(0xe1)](_0x49fb55,sanitizeFileName(_0x264491)+_0x53eb45(0xd6));!_0x199a0d&&_0x18a5fc&&!existsSync(_0x49fb55)&&mkdirSync(_0x49fb55,{'recursive':!![]});const _0x4c9a7a=a26_0x5ab93a['relative'](process['cwd'](),_0x4c417b);if(existsSync(_0x4c417b)){const _0x374ca4=readFileSync(_0x4c417b,_0x53eb45(0xd4)),_0x353c95=generateDiff(_0x374ca4,_0x233d9b),_0x22992e=hasChanges(_0x353c95);_0x56e5db[_0x53eb45(0x193)]({'relativePath':_0x4c9a7a,'absolutePath':_0x4c417b,'content':_0x233d9b,'isNew':![],'hasChanges':_0x22992e,'diff':_0x22992e?formatDiffWithColors(_0x353c95):undefined});}else _0x56e5db['push']({'relativePath':_0x4c9a7a,'absolutePath':_0x4c417b,'content':_0x233d9b,'isNew':!![],'hasChanges':![]});}const _0x4a0b1c=_0x56e5db[_0x53eb45(0xda)](_0x2e5a77=>_0x2e5a77[_0x53eb45(0xb8)]),_0x1e6a10=_0x56e5db[_0x53eb45(0xda)](_0x79b9d9=>!_0x79b9d9[_0x53eb45(0xb8)]&&_0x79b9d9[_0x53eb45(0x189)]),_0x401fc8=_0x56e5db[_0x53eb45(0xda)](_0x38d011=>!_0x38d011[_0x53eb45(0xb8)]&&!_0x38d011['hasChanges']),_0x49bd1e=_0x4ab712[_0x53eb45(0x190)],_0x317412=_0x5cbb1c[_0x53eb45(0x120)],_0x3ae920=_0x49bd1e>_0x317412?'\x20('+_0x49bd1e+_0x53eb45(0xa8):'';console[_0x53eb45(0x161)](_0x53eb45(0x129)),console['error']('\x20\x20'+a26_0x3d1c9f[_0x53eb45(0x11b)](_0x317412+_0x53eb45(0x110))+a26_0x3d1c9f[_0x53eb45(0x142)](_0x3ae920)),console[_0x53eb45(0x161)]('\x20\x20'+a26_0x3d1c9f['green']('+\x20'+_0x4a0b1c[_0x53eb45(0x190)]+_0x53eb45(0x104))),console[_0x53eb45(0x161)]('\x20\x20'+a26_0x3d1c9f[_0x53eb45(0x12d)]('~\x20'+_0x1e6a10['length']+_0x53eb45(0x101))),console[_0x53eb45(0x161)]('\x20\x20'+a26_0x3d1c9f['dim']('=\x20'+_0x401fc8['length']+_0x53eb45(0x9f))),console[_0x53eb45(0x161)]('\x20\x20Target:\x20'+a26_0x3d1c9f[_0x53eb45(0x11b)](_0x8298b1)+'\x0a');if(_0x1e6a10['length']>0x0)for(const _0x4b0d57 of _0x1e6a10){console[_0x53eb45(0x161)]('\x0aChanges\x20to\x20\x27'+_0x4b0d57[_0x53eb45(0xee)]+'\x27:'),console[_0x53eb45(0x161)]('─'[_0x53eb45(0x17a)](0x3c)),console[_0x53eb45(0x161)](_0x4b0d57['diff']),console[_0x53eb45(0x161)]('─'['repeat'](0x3c));}if(_0x1a4536[_0x53eb45(0xaf)])return console['error'](a26_0x3d1c9f[_0x53eb45(0x12d)](_0x53eb45(0x184))),0x0;if(_0x4a0b1c[_0x53eb45(0x190)]===0x0&&_0x1e6a10[_0x53eb45(0x190)]===0x0)return console[_0x53eb45(0x161)](a26_0x3d1c9f['green'](_0x53eb45(0x17b))),saveSessionContext({'parent_segment':_0xf7d602},_0x1a4536[_0x53eb45(0x14b)]),console[_0x53eb45(0x161)](a26_0x3d1c9f[_0x53eb45(0x1a0)]('✔\x20Context\x20set:\x20'+a26_0x3d1c9f['dim'](_0x53eb45(0x19b))+_0x53eb45(0x10b)+a26_0x3d1c9f[_0x53eb45(0x11b)](_0xf7d602))),0x0;if(!_0x1a4536[_0x53eb45(0x140)]&&(_0x4a0b1c[_0x53eb45(0x190)]>0x0||_0x1e6a10[_0x53eb45(0x190)]>0x0)){if(!isInteractive())return console[_0x53eb45(0x161)](a26_0x3d1c9f[_0x53eb45(0x19f)](_0x53eb45(0xe2)),_0x53eb45(0x176)),console[_0x53eb45(0x161)](a26_0x3d1c9f[_0x53eb45(0x142)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4f1405=await confirmKey('Write\x20'+(_0x4a0b1c['length']+_0x1e6a10[_0x53eb45(0x190)])+_0x53eb45(0x12c));if(!_0x4f1405)return console[_0x53eb45(0x161)](a26_0x3d1c9f[_0x53eb45(0x12d)](_0x53eb45(0x141)),_0x53eb45(0xc0)),0x1;}!existsSync(_0x8298b1)&&mkdirSync(_0x8298b1,{'recursive':!![]});const _0x1b3b8a=a26_0x5ab93a['join'](_0x8298b1,_0x53eb45(0xa2));writeFileSync(_0x1b3b8a,createTdxConfigContent(_0xf7d602),_0x53eb45(0xd4));for(const _0x4687b8 of _0x56e5db){(_0x4687b8[_0x53eb45(0xb8)]||_0x4687b8['hasChanges'])&&writeFileSync(_0x4687b8[_0x53eb45(0x195)],_0x4687b8['content'],_0x53eb45(0xd4));}return console['error'](a26_0x3d1c9f[_0x53eb45(0x1a0)](_0x53eb45(0xd7)+(_0x4a0b1c[_0x53eb45(0x190)]+_0x1e6a10['length'])+_0x53eb45(0x15e)+_0x8298b1)),saveSessionContext({'parent_segment':_0xf7d602},_0x1a4536['session']),console[_0x53eb45(0x161)](a26_0x3d1c9f[_0x53eb45(0x1a0)](_0x53eb45(0xe8)+a26_0x3d1c9f['dim'](_0x53eb45(0x19b))+_0x53eb45(0x10b)+a26_0x3d1c9f[_0x53eb45(0x11b)](_0xf7d602))),0x0;}}function a26_0x2a44(){const _0x13b75f=['Error:\x20Invalid\x20version\x20number:\x20','segmentPushCommand','25812CUpQZB','data','\x20details...','from','folderId','journey:stats','Pattern:\x20','segmentName','listActivationsFlat','completionRate','cwd','segment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Error:\x20Journey\x20\x27','18eSVepQ','repeat','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Folder\x20path:\x20','4659510UkdWyq','/j/da/je','stage','then','versionNumber','Resolving\x20parent\x20segment...','Export\x20journey(s)\x20as\x20YAML\x20files','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','getTrafficData','Listing\x20journeys...','531HsmxHF','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','hasChanges','journey:pull','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Found\x20','journey:version:view','resolveSegment','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','length',',\x20version:\x20','getJourney','push','table','absolutePath','stringify','✔\x20Found\x20','Error:\x20Stage\x20\x22','\x22\x20resumed','Fetching\x20users\x20and\x20connections...','parent_segment','attributes','\x20(ID:\x20','Getting\x20journey\x20statistics...','red','green','Table:\x20','reentryMode','toLowerCase','Resuming\x20journey...','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x20unchanged\x20files','conversion','paused','tdx.json','Fetching\x20journeys\x20and\x20folders...','getParentFull','options','filePath','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20versions)','has','Show\x20journey\x20table\x20column\x20mapping','includeHistory','(paused)','Cancelled','Getting\x20journey\x20details...','dryRun','resume','createVersion','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','file','📁\x20','localeCompare','audienceId','\x22\x20not\x20found','isNew','\x20\x20Journey\x20ID:\x20','log','Fetching\x20parent\x20segment...','getStatistics','1133352cVUNLs','getActivation','Input:\x20','-\x20no\x20files\x20written','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','resolveJourneyId','Pause\x20a\x20running\x20journey','activation_','Getting\x20journey\x20traffic\x20data...','\x20not\x20found.\x20Available:\x20','links','archived','journeyId','type','No\x20statistics\x20available\x20for\x20journey:\x20','entries','jsonl','\x27\x20not\x20found\x20in\x20','journey:activations','site','folders','/app/ps/','connector_config','utf-8','(archived)','.yml','✔\x20Pulled\x20','\x20\x20Name:\x20','INVALID_ARGUMENT','filter','Available\x20stages:\x20','5812TiaHKj','Fetching\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Error:\x20','join','\x0aError:','journey','\x5c$&','List\x20activations\x20for\x20a\x20journey','\x20(rule\x20match)','split','✔\x20Context\x20set:\x20','hasPeriod','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Listing\x20journey\x20versions...','Creating\x20new\x20version...','verbose','relativePath','(root)','blue','/j/da','parentSegment','description','listJourneysWithFolders','resolveParentId','\x20\x20Preserving\x20local\x20segment\x20name:\x20','List\x20journeys\x20in\x20current\x20context','(draft)','\x22\x20paused','List\x20all\x20versions\x20of\x20a\x20journey','version','stages','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','segments','format','journeyBundleName','\x20changed\x20files','journeyBundleId','Parent\x20segment:\x20','\x20new\x20files','Resolving\x20journey...','getColumnMapping','kind','bold','52zEjLqf','\x20Created\x20v','\x20=\x20','journey:push','journey:versions','find','Resolved\x20YAML\x20file:\x20','\x20journeys','1157198moZBVO','\x20(draft)\x20—\x20\x22','goal','test','✔\x20Journey\x20\x22','\x20\x20Parent\x20segment:\x20','execute','\x20\x20Statistics\x20not\x20available','exitOrJumpSize','listVersions','cyan','exitOrJumpRate','setPhase','Resolving\x20version...','columns','size','map','name','get','Error:\x20Journey\x20not\x20found:\x20','database','Target\x20file:\x20','state','root\x20folder','\x0aPull\x20summary:','/e/','Folder\x20path:\x20','\x20files?','yellow','base','Error:\x20Invalid\x20--type\x20\x22','folderPath','tsv','journey:resume','history','createdAt','updatedAt','Options:','add','journey:list','renderStats','helpText','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','journey:columns','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','yes','Aborted.','dim','pause','values','journey:version:create','all','resourceName','10137060GPOMjn','replace','stageNameMap','session','\x20version','sort','errorCode','(completed)','activationParams','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)','Pausing\x20journey...','\x20journey','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','rule','message','Warning:\x20Could\x20not\x20resolve\x20segment\x20','getSegment','enteredSize','Getting\x20version\x20','set','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','milestoneSize','\x20journey\x20files\x20to\x20','rootFolderId','completed','error','Error:\x20Version\x20','journeyName','no_parent','447605xkRGsa','activation','json'];a26_0x2a44=function(){return _0x13b75f;};return a26_0x2a44();}export class JourneyColumnsCommand extends BaseCommand{[a26_0x24da06(0x122)]=a26_0x24da06(0x13e);['description']=a26_0x24da06(0xaa);async['execute'](_0x4a32b7){const _0x17dacc=a26_0x24da06,{options:_0xf5e437,args:_0x1d209d,tdx:_0x113515}=_0x4a32b7,_0x5539f6=_0x1d209d[0x0];if(!requireNameOrPath(_0x5539f6))return 0x1;_0xf5e437[_0x17dacc(0xed)]&&console['error']('Input:\x20'+_0x5539f6);const {journeyId:_0x5941a3}=await resolveJourneyIdFromInput(_0x5539f6,_0xf5e437,_0x113515),_0x593b7c=await withSpinner('Getting\x20column\x20mapping...',()=>_0x113515[_0x17dacc(0xe3)][_0x17dacc(0x106)](_0x5941a3),{'verbose':_0xf5e437['verbose']}),_0x119d43=_0x593b7c[_0x17dacc(0x16b)];return console[_0x17dacc(0xba)]('Database:\x20'+_0x119d43[_0x17dacc(0x125)]),console[_0x17dacc(0xba)](_0x17dacc(0x1a1)+_0x119d43[_0x17dacc(0x194)]),await handleSDKOutput(_0x119d43[_0x17dacc(0x11f)],_0xf5e437),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a26_0x24da06(0x122)]=a26_0x24da06(0xcf);[a26_0x24da06(0xf3)]=a26_0x24da06(0xe5);async[a26_0x24da06(0x117)](_0x18ba07){const _0x3f4d5a=a26_0x24da06,{options:_0x1927fd,args:_0x450bb3,tdx:_0x11b6e5}=_0x18ba07,_0x57d17d=_0x450bb3[0x0];if(!requireNameOrPath(_0x57d17d))return 0x1;_0x1927fd['verbose']&&console[_0x3f4d5a(0x161)](_0x3f4d5a(0xbf)+_0x57d17d);const {journeyId:_0x46b253}=await resolveJourneyIdFromInput(_0x57d17d,_0x1927fd,_0x11b6e5),_0x3d3c8c=await withSpinner('Listing\x20journey\x20activations...',()=>_0x11b6e5[_0x3f4d5a(0xe3)][_0x3f4d5a(0x172)](_0x46b253),{'verbose':_0x1927fd[_0x3f4d5a(0xed)]}),_0x3f124e=_0x3d3c8c[_0x3f4d5a(0x16b)];return console['error'](_0x3f4d5a(0x18c)+_0x3f124e[_0x3f4d5a(0x190)]+'\x20activation'+(_0x3f124e[_0x3f4d5a(0x190)]!==0x1?'s':'')),await handleSDKOutput(_0x3f124e,_0x1927fd),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0x24da06(0x122)]=a26_0x24da06(0x10c);[a26_0x24da06(0xf3)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';['segmentPushCommand']=new SegmentPushCommand();async[a26_0x24da06(0x117)](_0x1a7f9b){const _0x4b682d=a26_0x24da06,_0x3a792b=_0x1a7f9b['args'][0x0];let _0xabb85a;if(_0x3a792b){const _0x4b03ad=await resolveTarget({'arg':_0x3a792b,'contextParent':_0x1a7f9b[_0x4b682d(0xa5)]['parentSegment'],'cwd':process[_0x4b682d(0x174)]()});isSuccessfulResolution(_0x4b03ad)&&_0x4b03ad['type']==='file'&&(_0xabb85a=_0x4b03ad['filePath']);}const _0x1c7cf1={..._0x1a7f9b,'options':{..._0x1a7f9b['options'],'journeysOnly':!![],..._0xabb85a&&{'singleFilePath':_0xabb85a}}};return this[_0x4b682d(0x169)][_0x4b682d(0x117)](_0x1c7cf1);}}export class JourneyVersionsCommand extends BaseCommand{[a26_0x24da06(0x122)]=a26_0x24da06(0x10d);[a26_0x24da06(0xf3)]=a26_0x24da06(0xfa);async[a26_0x24da06(0x117)](_0x52d5b0){const _0x2ce350=a26_0x24da06,{options:_0x3b5d4e,args:_0x1d6e03,tdx:_0x14c2aa}=_0x52d5b0,_0x342382=_0x1d6e03[0x0];if(!requireNameOrPath(_0x342382))return 0x1;if(_0x3b5d4e[_0x2ce350(0xed)])console['error']('Input:\x20'+_0x342382);const {journeyId:_0x1d0a11}=await resolveJourneyIdFromInput(_0x342382,_0x3b5d4e,_0x14c2aa),_0x3fd4b7=await withSpinner(_0x2ce350(0xeb),()=>_0x14c2aa[_0x2ce350(0xe3)][_0x2ce350(0x11a)](_0x1d0a11),{'verbose':_0x3b5d4e[_0x2ce350(0xed)]}),{bundleName:_0x4cf053,versions:_0x3629c6,latestJourneyId:_0x42a4e8}=_0x3fd4b7[_0x2ce350(0x16b)];console[_0x2ce350(0x161)](_0x4cf053+':\x20'+_0x3629c6[_0x2ce350(0x190)]+_0x2ce350(0x14c)+(_0x3629c6['length']!==0x1?'s':''));const _0x210790=_0x3629c6[_0x2ce350(0x121)](_0x424226=>({'version':_0x424226[_0x2ce350(0x181)],'journey_id':_0x424226[_0x2ce350(0xc9)],'name':_0x424226[_0x2ce350(0x122)],'state':_0x424226[_0x2ce350(0x127)],'paused':_0x424226['paused'],'latest':_0x424226[_0x2ce350(0xc9)]===_0x42a4e8,'created_at':_0x424226[_0x2ce350(0x134)]}));return await handleSDKOutput(_0x210790,_0x3b5d4e),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a26_0x24da06(0x122)]=a26_0x24da06(0x145);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a26_0x24da06(0x117)](_0x2157cf){const _0x12d1ae=a26_0x24da06,{options:_0x43871f,args:_0x16297b,tdx:_0xcb3a61}=_0x2157cf,_0x325d7c=_0x16297b[0x0];if(!requireNameOrPath(_0x325d7c))return 0x1;if(_0x43871f[_0x12d1ae(0xed)])console[_0x12d1ae(0x161)](_0x12d1ae(0xbf)+_0x325d7c);const {journeyId:_0x176a18,journeyName:_0x307297}=await resolveJourneyIdFromInput(_0x325d7c,_0x43871f,_0xcb3a61);if(!_0x43871f['yes']){const _0x3d09e2=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x307297+'\x22?');if(!_0x3d09e2)return console['error'](_0x12d1ae(0xad)),0x0;}const _0x3da10b=await withSpinner(_0x12d1ae(0xec),()=>_0xcb3a61['journey'][_0x12d1ae(0xb1)](_0x176a18),{'verbose':_0x43871f[_0x12d1ae(0xed)]}),_0x4a48ad=_0x3da10b[_0x12d1ae(0x16b)];return console[_0x12d1ae(0x161)](a26_0x3d1c9f[_0x12d1ae(0x1a0)]('✔')+_0x12d1ae(0x10a)+_0x4a48ad[_0x12d1ae(0x19c)]['versionNumber']+_0x12d1ae(0x112)+_0x4a48ad[_0x12d1ae(0x19c)][_0x12d1ae(0x122)]+'\x22'),console['error'](_0x12d1ae(0xb9)+_0x4a48ad['id']),await handleSingleObjectOutput({'id':_0x4a48ad['id'],'name':_0x4a48ad[_0x12d1ae(0x19c)]['name'],'version':_0x4a48ad[_0x12d1ae(0x19c)]['versionNumber'],'state':_0x4a48ad[_0x12d1ae(0x19c)][_0x12d1ae(0x127)],'bundle_id':_0x4a48ad[_0x12d1ae(0x19c)][_0x12d1ae(0x102)],'created_at':_0x4a48ad[_0x12d1ae(0x19c)][_0x12d1ae(0x134)]},_0x43871f),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0x24da06(0x122)]=a26_0x24da06(0x18d);[a26_0x24da06(0xf3)]=a26_0x24da06(0x1a5);async[a26_0x24da06(0x117)](_0x3fa113){const _0x41765b=a26_0x24da06,{options:_0x5a60e2,args:_0x8e1517,tdx:_0x547696}=_0x3fa113,_0x34a05d=_0x8e1517[0x0];if(!requireNameOrPath(_0x34a05d))return 0x1;const _0xca99d2=_0x5a60e2[_0x41765b(0xfb)];if(!_0xca99d2)return console[_0x41765b(0x161)]('Error:\x20--version\x20option\x20is\x20required'),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x300377=parseInt(_0xca99d2,0xa);if(isNaN(_0x300377)||_0x300377<0x1)return console[_0x41765b(0x161)](_0x41765b(0x168)+_0xca99d2),0x1;if(_0x5a60e2[_0x41765b(0xed)])console[_0x41765b(0x161)](_0x41765b(0xbf)+_0x34a05d+_0x41765b(0x191)+_0x300377);const {journeyId:_0x3ef27b,parentSegmentId:_0x297aa6}=await resolveJourneyIdFromInput(_0x34a05d,_0x5a60e2,_0x547696),_0x554bda=await withSpinner(_0x41765b(0x11e),()=>_0x547696[_0x41765b(0xe3)][_0x41765b(0x11a)](_0x3ef27b),{'verbose':_0x5a60e2['verbose']}),{versions:_0x1b1e8e,latestJourneyId:_0x3ffdf8}=_0x554bda[_0x41765b(0x16b)],_0x2e388c=_0x1b1e8e[_0x41765b(0x10e)](_0x12cea8=>_0x12cea8[_0x41765b(0x181)]===_0x300377);if(!_0x2e388c){const _0x597ed1=_0x1b1e8e['map'](_0x36d077=>'v'+_0x36d077[_0x41765b(0x181)])[_0x41765b(0xe1)](',\x20');return console[_0x41765b(0x161)](_0x41765b(0x162)+_0x300377+_0x41765b(0xc6)+_0x597ed1),0x1;}const _0x145959=await withSpinner(_0x41765b(0x15a)+_0x300377+_0x41765b(0x16c),()=>_0x547696['journey'][_0x41765b(0x192)](_0x2e388c[_0x41765b(0xc9)]),{'verbose':_0x5a60e2['verbose']}),_0x16892a=_0x145959[_0x41765b(0x16b)],_0xa41dc0=getConsoleNextUrl(_0x5a60e2[_0x41765b(0xd0)],_0x41765b(0xd2)+_0x297aa6+_0x41765b(0x12a)+_0x2e388c[_0x41765b(0xc9)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x16892a['id'],'name':_0x16892a[_0x41765b(0x19c)][_0x41765b(0x122)],'version':_0x16892a[_0x41765b(0x19c)]['versionNumber'],'description':_0x16892a[_0x41765b(0x19c)]['description'],'state':_0x16892a[_0x41765b(0x19c)][_0x41765b(0x127)],'paused':_0x16892a[_0x41765b(0x19c)]['paused'],'reentry_mode':_0x16892a['attributes'][_0x41765b(0x1a2)],'stages':_0x16892a[_0x41765b(0x19c)]['journeyStages']?.['length']||0x0,..._0x16892a[_0x41765b(0x19c)][_0x41765b(0x113)]&&{'goal':_0x16892a[_0x41765b(0x19c)][_0x41765b(0x113)][_0x41765b(0x122)]},'latest':_0x2e388c[_0x41765b(0xc9)]===_0x3ffdf8,'created_at':_0x16892a[_0x41765b(0x19c)][_0x41765b(0x134)],'updated_at':_0x16892a[_0x41765b(0x19c)][_0x41765b(0x135)],'url':_0xa41dc0},_0x5a60e2),0x0;}}
1
+ const a26_0x1de697=a26_0x57ff;(function(_0x1f9e8b,_0x4bf55b){const _0x308fd9=a26_0x57ff,_0x33918b=_0x1f9e8b();while(!![]){try{const _0x401395=-parseInt(_0x308fd9(0xc8))/0x1*(parseInt(_0x308fd9(0x172))/0x2)+-parseInt(_0x308fd9(0xdd))/0x3*(-parseInt(_0x308fd9(0x187))/0x4)+parseInt(_0x308fd9(0x14b))/0x5*(parseInt(_0x308fd9(0x1cc))/0x6)+-parseInt(_0x308fd9(0x1b4))/0x7*(-parseInt(_0x308fd9(0xec))/0x8)+-parseInt(_0x308fd9(0x196))/0x9*(-parseInt(_0x308fd9(0x158))/0xa)+-parseInt(_0x308fd9(0xcf))/0xb*(parseInt(_0x308fd9(0xe7))/0xc)+-parseInt(_0x308fd9(0x140))/0xd;if(_0x401395===_0x4bf55b)break;else _0x33918b['push'](_0x33918b['shift']());}catch(_0x1f4a0e){_0x33918b['push'](_0x33918b['shift']());}}}(a26_0xcc0e,0x7dbdc));import a26_0x2eb633 from'chalk';import a26_0x49e48c 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_0xcc0e(){const _0x42b1fa=['reentryMode','site','resolveJourneyId','\x20\x20Name:\x20','sort','Fetching\x20journeys\x20and\x20folders...','\x20\x20Parent\x20segment:\x20','journeyBundleId','error','type','stageNameMap','Listing\x20journey\x20activations...','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','activation','✔\x20Context\x20set:\x20','\x20(ID:\x20','Show\x20journey\x20table\x20column\x20mapping','Creating\x20new\x20version...','launched','stages','\x20(draft)\x20—\x20\x22','file','Error:\x20Invalid\x20--type\x20\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','connector_config','map','filter','folderPath','description','absolutePath','data','\x20journey\x20files\x20to\x20','(running)','set','\x20\x20Journey\x20ID:\x20','join','tdx.json','(archived)','folderId','Fetching\x20','journey:list','journeyBundleName','milestoneSize','\x20unchanged\x20files','\x22\x20resumed','Options:','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','getTrafficData','activationParams','format','/e/','Error:\x20Parent\x20segment\x20context\x20required','Show\x20journey\x20details','Aborted.','size','(paused)','Resolving\x20version...','connection','entries','listVersions','errorCode','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','columns','listFolders','createVersion','Fetching\x20users\x20and\x20connections...','\x20files?','helpText','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Error:\x20Journey\x20\x27','7811284OyXkWo','jsonl','listJourneysWithFolders','\x20Opening\x20','List\x20all\x20versions\x20of\x20a\x20journey','getSegment','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','database','includeHistory','hasChanges','Resolving\x20journey...','595AqjeyG','yes','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','journeyName','/j/da','parent_segment','...','Error:\x20Stage\x20\x22','\x0aChanges\x20to\x20\x27','utf-8','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','name','journey','1414150nViPhE','Found\x20','verbose','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','links','Fetching\x20parent\x20segment...','List\x20journeys\x20in\x20current\x20context','Pausing\x20journey...','getActivation','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','isNew','dim','Resolving\x20parent\x20segment...','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','split','options','Error:\x20--version\x20option\x20is\x20required','Error:\x20','yellow','journeyStages','execute','kind','filePath','buildIdToEmailMap','journey:columns','Available\x20stages:\x20','246934KXXWWu','hasPeriod','json','\x20version','rule','\x20\x20Consolidating\x20duplicate\x20segment:\x20','/j/da/je','Target\x20file:\x20','createdAt','content','listActivationsFlat','getStatistics','activation_','Export\x20journey(s)\x20as\x20YAML\x20files','\x20new\x20files','-\x20no\x20files\x20written','bold','get','segmentName','\x20\x20-\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','449968XfZlxA','.yml','message','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)','getParentFull','Error:\x20Journey\x20not\x20found:\x20','(completed)','Resuming\x20journey...','repeat','red','toLowerCase','\x20Created\x20v','\x20\x20Target:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x0aError:','27hAiwWf','\x5c$&','args','\x0aPull\x20summary:','relativePath','exitOrJumpSize','(draft)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','replace','journey:view','add','cyan','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','segments','✔\x20Journey\x20\x22','rootFolderId','\x20->\x20','versionNumber','segmentPushCommand','goalSize','Getting\x20journey\x20statistics...','Write\x20','\x20\x20Preserving\x20local\x20segment\x20name:\x20','table','Error:\x20Invalid\x20version\x20number:\x20','enteredSize','renderStats','/app/ps/','session','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','7coiMfs','(root)','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','journey:push','Target\x20directory:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journey:traffic','INVALID_ARGUMENT','Cancelled','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Input:\x20','\x20details...','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Getting\x20column\x20mapping...','localeCompare','values','No\x20statistics\x20available\x20for\x20journey:\x20','No\x20journeys\x20found','green','find','\x20=\x20','15594SqLTrO','journeyId','resolveParentId','\x20not\x20found.\x20Available:\x20','goal','Resolved\x20YAML\x20file:\x20','has','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20activation','resolveSegment','targetDir','base','List\x20activations\x20for\x20a\x20journey','log','5LxhcKV','conversion','user','\x27\x20not\x20found\x20in\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Getting\x20version\x20','Pattern:\x20','22kGljqw','journeys','length','web','\x20changed\x20files','all','nodes','parentSegment','from','then','journey:version:view','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','folders','getJourney','12CEvchh','Getting\x20journey\x20details...','dryRun','Show\x20journey\x20statistics','push','journey:stats','history','exitOrJumpRate','parentName','cwd','1165812eaaGJd','Parent\x20segment:\x20','journey:versions','\x22\x20not\x20found','completionRate','5952376HxhXlV','Getting\x20journey\x20traffic\x20data...','archived','attributes','Pause\x20a\x20running\x20journey','🗺️\x20','state','resourceName','paused','segment','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Error:\x20Version\x20','limit'];a26_0xcc0e=function(){return _0x42b1fa;};return a26_0xcc0e();}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x345386){const _0x371caa=a26_0x57ff;return!_0x345386&&(console[_0x371caa(0x102)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x371caa(0xda))),!!_0x345386;}function withJsonFormat(_0xfa6a78){const _0x362f5e=a26_0x57ff;if(!_0xfa6a78['format']&&!_0xfa6a78[_0x362f5e(0x174)]&&!_0xfa6a78[_0x362f5e(0x141)]&&!_0xfa6a78['tsv'])return{..._0xfa6a78,'format':_0x362f5e(0x174),'json':!![]};return _0xfa6a78;}function formatJourneyState(_0x22fd20){const _0xf127bf=a26_0x57ff;switch(_0x22fd20){case _0xf127bf(0x10c):return a26_0x2eb633[_0xf127bf(0x1c9)](_0xf127bf(0x11a));case'draft':return a26_0x2eb633[_0xf127bf(0x163)](_0xf127bf(0x19c));case _0xf127bf(0xf4):return a26_0x2eb633[_0xf127bf(0x16a)](_0xf127bf(0x131));case'completed':return a26_0x2eb633['blue'](_0xf127bf(0x18d));case _0xf127bf(0xee):return a26_0x2eb633[_0xf127bf(0x163)](_0xf127bf(0x11f));default:return'('+_0x22fd20+')';}}function formatJourneyItem(_0x4043d7,_0x3d078d='',_0x1b7014){const _0x543e05=a26_0x57ff,_0x45758d=formatJourneyState(_0x4043d7[_0x543e05(0xf2)]),_0x2d023e=_0x1b7014?hyperlink(_0x4043d7[_0x543e05(0x123)],_0x1b7014):_0x4043d7[_0x543e05(0x123)];return _0x3d078d+_0x543e05(0xf1)+_0x2d023e+'\x20'+_0x45758d;}function escapeRegex(_0x469132){const _0x4f0daa=a26_0x57ff;return _0x469132[_0x4f0daa(0x19e)](/[.*+?^${}()|[\]\\]/g,_0x4f0daa(0x197));}function globToRegex(_0x4f39fa){const _0x49af7b=a26_0x57ff,_0x263d4c=_0x4f39fa[_0x49af7b(0x166)]('*')[_0x49af7b(0x113)](escapeRegex);return new RegExp(_0x263d4c[_0x49af7b(0x11d)]('.*'),'i');}function buildRuleToNameMapping(_0x15c719){const _0x4bf93a=a26_0x57ff,_0x3d4f92=new Map();if(_0x15c719[_0x4bf93a(0x1a3)])for(const [_0x4a78b5,_0x131315]of Object['entries'](_0x15c719['segments'])){if(_0x131315['rule']){const _0x1d1b7b=serializeRule(_0x131315[_0x4bf93a(0x176)]),_0xfae67a=_0x3d4f92[_0x4bf93a(0x183)](_0x1d1b7b);_0xfae67a?_0xfae67a[_0x4bf93a(0xe1)](_0x4a78b5):_0x3d4f92[_0x4bf93a(0x11b)](_0x1d1b7b,[_0x4a78b5]);}}return _0x3d4f92;}async function resolveJourneyIdFromInput(_0x4b2f99,_0x138184,_0x2c7450){const _0x3df9b8=a26_0x57ff,_0x258282=await resolveJourneyTarget(_0x4b2f99,_0x138184[_0x3df9b8(0xd6)],_0x138184['verbose']),_0x1838db=_0x258282[_0x3df9b8(0xd6)];if(!_0x1838db)throw new SDKError(ErrorCode[_0x3df9b8(0x1bd)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x26b927=await withSpinner(_0x3df9b8(0x164),()=>_0x2c7450[_0x3df9b8(0xf5)][_0x3df9b8(0x1ce)](_0x1838db),{'verbose':_0x138184[_0x3df9b8(0x15a)]}),_0x3adaf9=_0x26b927[_0x3df9b8(0x118)],_0x3a5070=await withSpinner(_0x3df9b8(0x14a),()=>_0x2c7450['journey'][_0x3df9b8(0xfc)](_0x3adaf9,_0x258282[_0x3df9b8(0x14e)]),{'verbose':_0x138184[_0x3df9b8(0x15a)]});return{'journeyId':_0x3a5070[_0x3df9b8(0x118)],'journeyName':_0x258282[_0x3df9b8(0x14e)],'parentSegmentId':_0x3adaf9};}async function resolveJourneyTarget(_0x1f5a1f,_0x395427,_0x2ec6d8){const _0x5a11c3=a26_0x57ff;if(isYamlFilePath(_0x1f5a1f))try{const _0x5cefa9=await resolveYamlFilePath(_0x1f5a1f);return _0x2ec6d8&&(console[_0x5a11c3(0x102)](_0x5a11c3(0xbf)+_0x1f5a1f),console[_0x5a11c3(0x102)](_0x5a11c3(0x100)+_0x5cefa9[_0x5a11c3(0xd6)]),console[_0x5a11c3(0x102)](_0x5a11c3(0xfd)+_0x5cefa9[_0x5a11c3(0x184)]),console[_0x5a11c3(0x102)]('\x20\x20Folder\x20path:\x20'+(_0x5cefa9[_0x5a11c3(0x115)]||_0x5a11c3(0x1b5)))),{'journeyName':_0x5cefa9[_0x5a11c3(0x184)],'parentSegment':_0x5cefa9['parentSegment'],'resolved':_0x5cefa9};}catch(_0x522826){throw new SDKError(ErrorCode[_0x5a11c3(0x1bd)],_0x5a11c3(0x111)+_0x522826[_0x5a11c3(0x189)]);}if(!_0x395427)throw new SDKError(ErrorCode[_0x5a11c3(0x1bd)],_0x5a11c3(0x15b));return{'journeyName':_0x1f5a1f,'parentSegment':_0x395427};}export class JourneyListCommand extends BaseCommand{[a26_0x1de697(0x156)]=a26_0x1de697(0x122);[a26_0x1de697(0x116)]=a26_0x1de697(0x15e);async[a26_0x1de697(0x16c)](_0x5c8aed){const _0x280f38=a26_0x1de697,{options:_0x313a0f,args:_0x31c4a8,tdx:_0x45f598}=_0x5c8aed,_0x24f6d5=_0x31c4a8[0x0],_0x30e291=_0x313a0f[_0x280f38(0xd6)];if(!_0x30e291)return console[_0x280f38(0x102)](_0x280f38(0x12d)),console[_0x280f38(0x102)](_0x280f38(0x1b6)),0x1;const _0x29919d=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x45f598['segment'][_0x280f38(0x1ce)](_0x30e291),{'verbose':_0x313a0f[_0x280f38(0x15a)]}),_0x128930=_0x29919d[_0x280f38(0x118)];_0x313a0f[_0x280f38(0x15a)]&&(console['error'](_0x280f38(0xe8)+_0x30e291+_0x280f38(0x109)+_0x128930+')'),_0x24f6d5&&console[_0x280f38(0x102)](_0x280f38(0xce)+_0x24f6d5));const _0x4e1a02=await withSpinner(_0x280f38(0x15d),()=>_0x45f598[_0x280f38(0xf5)][_0x280f38(0x18b)](_0x128930),{'verbose':_0x313a0f['verbose']}),_0x275b60=_0x4e1a02[_0x280f38(0x118)],_0x26976b=_0x275b60[_0x280f38(0x1a5)],_0x21bf52=await withSpinner('Listing\x20journeys...',()=>_0x45f598[_0x280f38(0x157)][_0x280f38(0x142)](_0x128930,_0x26976b),{'verbose':_0x313a0f[_0x280f38(0x15a)]});let _0x5224e7=_0x21bf52[_0x280f38(0x118)][_0x280f38(0xd0)];const _0x4abd7c=_0x21bf52['data'][_0x280f38(0xdb)],_0x54bee7=new Map();for(const _0x5ae366 of _0x4abd7c){_0x54bee7[_0x280f38(0x11b)](_0x5ae366['id'],_0x5ae366[_0x280f38(0x156)]);}if(_0x24f6d5){const _0x350245=globToRegex(_0x24f6d5);_0x5224e7=_0x5224e7[_0x280f38(0x114)](_0x5648a4=>_0x350245['test'](_0x5648a4['journeyBundleName']));}console[_0x280f38(0x102)]('✔\x20Found\x20'+_0x5224e7[_0x280f38(0xd1)]+'\x20journey'+(_0x5224e7[_0x280f38(0xd1)]!==0x1?'s':''));const _0x4b837a=_0x8e85dc=>{const _0x4a8894=_0x280f38;return getConsoleNextUrl(_0x313a0f[_0x4a8894(0xfb)],_0x4a8894(0x1b1)+_0x128930+'/e/'+_0x8e85dc+_0x4a8894(0x14f));};if(_0x313a0f[_0x280f38(0x12b)]===_0x280f38(0x1ad))await handleSDKOutput(_0x5224e7,_0x313a0f);else{if(_0x313a0f['format']==='json'){const _0x3fc686=_0x5224e7[_0x280f38(0x113)](_0x212bf2=>({..._0x212bf2,'url':_0x4b837a(_0x212bf2['id'])}));await handleSDKOutput(_0x3fc686,_0x313a0f);}else{console[_0x280f38(0xc7)]('['+_0x30e291+']');const _0xec75b8=new Map(),_0x333765=[];for(const _0x1a583a of _0x5224e7){if(!_0x1a583a[_0x280f38(0x120)]||_0x1a583a[_0x280f38(0x120)]===_0x26976b)_0x333765[_0x280f38(0xe1)](_0x1a583a);else{const _0x5ca899=_0xec75b8[_0x280f38(0x183)](_0x1a583a[_0x280f38(0x120)])||[];_0x5ca899[_0x280f38(0xe1)](_0x1a583a),_0xec75b8[_0x280f38(0x11b)](_0x1a583a[_0x280f38(0x120)],_0x5ca899);}}const _0x39312a=(_0x1493a6,_0x552987)=>_0x1493a6[_0x280f38(0x123)][_0x280f38(0x1c5)](_0x552987[_0x280f38(0x123)],undefined,{'sensitivity':_0x280f38(0xc5)});_0x333765['sort'](_0x39312a);for(const _0x300cdf of _0x333765){console['log'](formatJourneyItem(_0x300cdf,'',_0x4b837a(_0x300cdf['id'])));}const _0x1642b9=[..._0xec75b8[_0x280f38(0x134)]()][_0x280f38(0xfe)]((_0xb41258,_0x58bc2e)=>{const _0x9241ea=_0x280f38,_0x42ca39=_0x54bee7[_0x9241ea(0x183)](_0xb41258[0x0])||_0xb41258[0x0],_0x5efc65=_0x54bee7[_0x9241ea(0x183)](_0x58bc2e[0x0])||_0x58bc2e[0x0];return _0x42ca39[_0x9241ea(0x1c5)](_0x5efc65,undefined,{'sensitivity':_0x9241ea(0xc5)});});for(const [_0x6ecb4a,_0x41de57]of _0x1642b9){const _0x5cd722=_0x54bee7[_0x280f38(0x183)](_0x6ecb4a)||_0x6ecb4a;console['log']('📁\x20'+_0x5cd722),_0x41de57['sort'](_0x39312a);for(const _0x36bc30 of _0x41de57){console[_0x280f38(0xc7)](formatJourneyItem(_0x36bc30,'\x20\x20',_0x4b837a(_0x36bc30['id'])));}}}}return 0x0;}}function a26_0x57ff(_0x45fb06,_0x432e45){_0x45fb06=_0x45fb06-0xbe;const _0xcc0ec7=a26_0xcc0e();let _0x57ff37=_0xcc0ec7[_0x45fb06];return _0x57ff37;}export class JourneyViewCommand extends BaseCommand{[a26_0x1de697(0x156)]=a26_0x1de697(0x19f);[a26_0x1de697(0x116)]=a26_0x1de697(0x12e);async[a26_0x1de697(0x16c)](_0x4e6e4e){const _0x593b00=a26_0x1de697,{options:_0x4b9129,args:_0x1325f4,tdx:_0xccec}=_0x4e6e4e,_0x352aff=_0x1325f4[0x0];if(!_0x352aff)return console[_0x593b00(0x102)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x593b00(0x102)](_0x593b00(0x161)),console['error'](_0x593b00(0x127)),console[_0x593b00(0x102)](_0x593b00(0xf6)),0x1;_0x4b9129[_0x593b00(0x15a)]&&console[_0x593b00(0x102)](_0x593b00(0x1c0)+_0x352aff);const {journeyId:_0x13fb9f,parentSegmentId:_0x1ee279}=await resolveJourneyIdFromInput(_0x352aff,_0x4b9129,_0xccec);if(_0x4b9129[_0x593b00(0xd2)]){const _0x14d266=getConsoleNextUrl(_0x4b9129[_0x593b00(0xfb)],_0x593b00(0x1b1)+_0x1ee279+'/e/'+_0x13fb9f+'/j/da/je');return console[_0x593b00(0x102)](a26_0x2eb633[_0x593b00(0x1c9)]('✔')+_0x593b00(0x143)+a26_0x2eb633[_0x593b00(0x1a1)](_0x14d266)),openBrowser(_0x14d266),0x0;}const _0x25c3cf=await withSpinner(_0x593b00(0xde),()=>_0xccec[_0x593b00(0x157)][_0x593b00(0xdc)](_0x13fb9f),{'verbose':_0x4b9129[_0x593b00(0x15a)]}),_0x452a3e=_0x25c3cf[_0x593b00(0x118)],_0x29cdff=_0x4b9129['includeStats'];let _0x24236d;if(_0x29cdff)try{const _0x35911d=await withSpinner('Getting\x20journey\x20statistics...',()=>_0xccec[_0x593b00(0x157)]['getStatistics'](_0x13fb9f),{'verbose':_0x4b9129[_0x593b00(0x15a)]});_0x24236d=_0x35911d[_0x593b00(0x118)];}catch{_0x4b9129[_0x593b00(0x15a)]&&console['error']('\x20\x20Statistics\x20not\x20available');}const _0x376ddb=getConsoleNextUrl(_0x4b9129[_0x593b00(0xfb)],_0x593b00(0x1b1)+_0x1ee279+_0x593b00(0x12c)+_0x13fb9f+_0x593b00(0x178)),_0x470a08={'id':_0x452a3e['id'],'name':_0x452a3e[_0x593b00(0xef)][_0x593b00(0x156)],'description':_0x452a3e[_0x593b00(0xef)]['description'],'state':_0x452a3e[_0x593b00(0xef)]['state'],'paused':_0x452a3e[_0x593b00(0xef)]['paused'],'reentry_mode':_0x452a3e['attributes'][_0x593b00(0xfa)],'stages':_0x452a3e['attributes'][_0x593b00(0x16b)]?.[_0x593b00(0xd1)]||0x0,..._0x452a3e['attributes'][_0x593b00(0xbe)]&&{'goal':_0x452a3e['attributes'][_0x593b00(0xbe)]['name']},..._0x24236d&&{'statistics':{'size':_0x24236d['size'],'entered':_0x24236d[_0x593b00(0x1af)],'goal_achieved':_0x24236d[_0x593b00(0x1a9)],'completion_rate':_0x24236d[_0x593b00(0xeb)],'exit_or_jump':_0x24236d[_0x593b00(0x19b)],'exit_or_jump_rate':_0x24236d[_0x593b00(0xe4)],'stages':_0x24236d[_0x593b00(0x10d)]}},'url':_0x376ddb};return await handleSingleObjectOutput(_0x470a08,_0x4b9129),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0x1de697(0x156)]=a26_0x1de697(0xe2);['description']=a26_0x1de697(0xe0);async[a26_0x1de697(0x16c)](_0x2a5102){const _0x19475b=a26_0x1de697,{options:_0x33f03e,args:_0x41020b,tdx:_0x1b7cab}=_0x2a5102,_0xeef9b9=_0x41020b[0x0];if(!requireNameOrPath(_0xeef9b9))return 0x1;_0x33f03e[_0x19475b(0x15a)]&&console[_0x19475b(0x102)](_0x19475b(0x1c0)+_0xeef9b9);const _0xa9df39=_0x33f03e,_0x4b88d4=_0xa9df39[_0x19475b(0xd7)],_0x222f4d=_0xa9df39['to'],_0x14d69e=_0xa9df39[_0x19475b(0x148)],_0x1330ae=_0xa9df39['stage'];_0x14d69e&&!_0x4b88d4&&!_0x222f4d&&console[_0x19475b(0x102)](_0x19475b(0x1a2));const _0x7a5f23=_0x14d69e?withJsonFormat(_0x33f03e):_0x33f03e,{journeyId:_0x28f7ef,journeyName:_0x1d2565}=await resolveJourneyIdFromInput(_0xeef9b9,_0x7a5f23,_0x1b7cab),_0x58fd44=_0x4b88d4||_0x222f4d?{'from':_0x4b88d4,'to':_0x222f4d}:undefined,_0x4be858=await withSpinner(_0x19475b(0x1aa),()=>Promise[_0x19475b(0xd4)]([_0x1b7cab[_0x19475b(0x157)][_0x19475b(0xdc)](_0x28f7ef),_0x1b7cab['journey'][_0x19475b(0x17d)](_0x28f7ef,_0x58fd44)]),{'verbose':_0x7a5f23[_0x19475b(0x15a)]}),[_0x4fedbe,_0x5ba827]=_0x4be858[_0x19475b(0x118)];if(!_0x5ba827||_0x5ba827[_0x19475b(0x1cd)]===null)return console[_0x19475b(0x102)](_0x19475b(0x1c7)+_0x1d2565),console[_0x19475b(0x102)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x49707e=buildStageNameMap(_0x4fedbe),_0x5c0ae6=!!(_0x58fd44&&_0x5ba827['history']?.['length']),_0xf0a83b={'stageNameMap':_0x49707e,'hasPeriod':_0x5c0ae6,'includeHistory':!!_0x14d69e};if(_0x1330ae&&_0x5ba827[_0x19475b(0x10d)]){const _0x2cffb4=_0x5ba827[_0x19475b(0x10d)][_0x19475b(0x1ca)](_0x379375=>{const _0x3435c7=_0x19475b,_0x47172e=_0x49707e[_0x3435c7(0x183)](_0x379375['id'])??'';return _0x47172e[_0x3435c7(0x191)]()===_0x1330ae[_0x3435c7(0x191)]();});if(_0x2cffb4)return await handleSingleObjectOutput(formatStageStats(_0x2cffb4,_0xf0a83b),_0x7a5f23),0x0;const _0x5b6cba=_0x5ba827[_0x19475b(0x10d)][_0x19475b(0x113)](_0x48e0ec=>_0x49707e['get'](_0x48e0ec['id'])??_0x48e0ec['id']);return console[_0x19475b(0x102)](_0x19475b(0x152)+_0x1330ae+_0x19475b(0xea)),console[_0x19475b(0x102)](_0x19475b(0x171)+_0x5b6cba[_0x19475b(0x11d)](',\x20')),0x1;}const _0x28c0bc=_0x5ba827['stages']?.[_0x19475b(0x113)](_0x6537f4=>formatStageStats(_0x6537f4,_0xf0a83b)),_0x51c443=assembleJourneyStats(_0x5ba827,{'from':_0x4b88d4,'to':_0x222f4d,'includeHistory':_0x14d69e});return await this[_0x19475b(0x1b0)](_0x51c443,_0x28c0bc??[],_0x7a5f23),0x0;}async[a26_0x1de697(0x1b0)](_0x119275,_0x3cf124,_0x536341){const _0x5193bc=a26_0x1de697,_0x1518b6=_0x536341[_0x5193bc(0x12b)]==='json'||_0x536341[_0x5193bc(0x12b)]===_0x5193bc(0x141)||_0x536341[_0x5193bc(0x174)]||_0x536341[_0x5193bc(0x141)];if(_0x1518b6){_0x119275[_0x5193bc(0x10d)]=_0x3cf124,await handleSingleObjectOutput(_0x119275,_0x536341);return;}await handleSingleObjectOutput(_0x119275,_0x536341);for(const _0xab944 of _0x3cf124){console[_0x5193bc(0xc7)](''),console[_0x5193bc(0xc7)](String(a26_0x2eb633[_0x5193bc(0x1a1)][_0x5193bc(0x182)]('['+_0xab944['name']+']'))+a26_0x2eb633['dim']('\x20'+_0xab944['id']));const {id:_0xfbaafb,name:_0x2a7aa3,..._0x11b324}=_0xab944;await handleSingleObjectOutput(_0x11b324,_0x536341);}}}export class JourneyTrafficCommand extends BaseCommand{[a26_0x1de697(0x156)]=a26_0x1de697(0x1bc);['description']=a26_0x1de697(0x155);async[a26_0x1de697(0x16c)](_0x959857){const _0x122b71=a26_0x1de697,{options:_0x2987fe,args:_0x5e22aa,tdx:_0x26f727}=_0x959857,_0x46c328=_0x5e22aa[0x0];if(!requireNameOrPath(_0x46c328))return 0x1;_0x2987fe['verbose']&&console[_0x122b71(0x102)](_0x122b71(0x1c0)+_0x46c328);const _0x40a1a4=_0x2987fe,_0x2e5207=_0x40a1a4['type'],_0x5dce9c=_0x40a1a4['from'],_0x2fe498=_0x40a1a4['to'],_0x136e2a=_0x40a1a4[_0x122b71(0xf9)];if(_0x2e5207&&_0x2e5207!=='conversion'&&_0x2e5207!==_0x122b71(0x107))return console[_0x122b71(0x102)](_0x122b71(0x110)+_0x2e5207+_0x122b71(0x128)),0x1;const _0x314874=withJsonFormat(_0x2987fe),{journeyId:_0x22d9b1,journeyName:_0x5b775d}=await resolveJourneyIdFromInput(_0x46c328,_0x314874,_0x26f727),_0x20e2eb={'type':_0x2e5207,'from':_0x5dce9c,'to':_0x2fe498,'limit':_0x136e2a},_0x1fc3bc=await withSpinner(_0x122b71(0xed),()=>_0x26f727[_0x122b71(0x157)][_0x122b71(0x129)](_0x22d9b1,_0x20e2eb),{'verbose':_0x314874['verbose']}),_0x48213c=_0x1fc3bc[_0x122b71(0x118)],_0x109e06=_0x48213c['conversion']&&(_0x48213c[_0x122b71(0xc9)][_0x122b71(0xd5)][_0x122b71(0xd1)]>0x0||_0x48213c[_0x122b71(0xc9)][_0x122b71(0x15c)][_0x122b71(0xd1)]>0x0),_0x7db9b5=_0x48213c['activation']&&_0x48213c[_0x122b71(0x107)][_0x122b71(0xd1)]>0x0;if(!_0x109e06&&!_0x7db9b5)return console[_0x122b71(0x102)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x5b775d),console[_0x122b71(0x102)](_0x122b71(0x1b3)),_0x5dce9c&&_0x2fe498&&console['error'](_0x122b71(0x1c3)),0x0;return await handleSingleObjectOutput(_0x48213c,_0x314874),0x0;}}function formatStageStats(_0x339e97,_0x5884a5){const _0x5c74d1=a26_0x1de697,_0xdb53a7=_0x5884a5[_0x5c74d1(0x173)]&&_0x339e97['history']?.[_0x5c74d1(0xd1)]?aggregateStageHistory(_0x339e97[_0x5c74d1(0xe3)]):{'size':_0x339e97['size'],'entered':_0x339e97[_0x5c74d1(0x1af)],'milestone':_0x339e97[_0x5c74d1(0x124)],'milestone_rate':_0x339e97['completeMilestoneRate'],'exit_or_jump':_0x339e97[_0x5c74d1(0x19b)],'exit_or_jump_rate':_0x339e97[_0x5c74d1(0xe4)]},_0xfd074f={'id':_0x339e97['id'],'name':_0x5884a5[_0x5c74d1(0x104)]['get'](_0x339e97['id'])??_0x339e97['id'],..._0xdb53a7};return _0x5884a5[_0x5c74d1(0x173)]&&_0x5884a5['includeHistory']&&_0x339e97[_0x5c74d1(0xe3)]&&(_0xfd074f['history']=_0x339e97['history']),_0xfd074f;}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a26_0x1de697(0x116)]=a26_0x1de697(0xf0);async[a26_0x1de697(0x16c)](_0x3d9074){const _0xfb3098=a26_0x1de697,{options:_0x46d8c0,args:_0x4fab2c,tdx:_0x3d8ecf}=_0x3d9074,_0x379ea7=_0x4fab2c[0x0];if(!requireNameOrPath(_0x379ea7))return 0x1;_0x46d8c0[_0xfb3098(0x15a)]&&console['error'](_0xfb3098(0x1c0)+_0x379ea7);const {journeyId:_0x481c62,journeyName:_0x298fb1}=await resolveJourneyIdFromInput(_0x379ea7,_0x46d8c0,_0x3d8ecf);if(!_0x46d8c0[_0xfb3098(0x14c)]){const _0x58fe60=await confirm(_0xfb3098(0x1c2)+_0x298fb1+'\x22?');if(!_0x58fe60)return console['error'](_0xfb3098(0x1be)),0x0;}const _0x1419d1=await withSpinner(_0xfb3098(0x15f),()=>_0x3d8ecf[_0xfb3098(0x157)]['pause'](_0x481c62),{'verbose':_0x46d8c0[_0xfb3098(0x15a)]}),_0x20c9d4=_0x1419d1['data'];return console[_0xfb3098(0x102)](_0xfb3098(0x1a4)+_0x20c9d4[_0xfb3098(0xef)]['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0x1de697(0x156)]='journey:resume';[a26_0x1de697(0x116)]='Resume\x20a\x20paused\x20journey';async[a26_0x1de697(0x16c)](_0x4365dc){const _0x11586b=a26_0x1de697,{options:_0x536201,args:_0x56f44f,tdx:_0x28a3f2}=_0x4365dc,_0xbd4aea=_0x56f44f[0x0];if(!requireNameOrPath(_0xbd4aea))return 0x1;_0x536201[_0x11586b(0x15a)]&&console[_0x11586b(0x102)](_0x11586b(0x1c0)+_0xbd4aea);const {journeyId:_0x3f6c61,journeyName:_0x56b01a}=await resolveJourneyIdFromInput(_0xbd4aea,_0x536201,_0x28a3f2);if(!_0x536201['yes']){const _0x4ad189=await confirm(_0x11586b(0x194)+_0x56b01a+'\x22?');if(!_0x4ad189)return console['error'](_0x11586b(0x1be)),0x0;}const _0x1c9b1f=await withSpinner(_0x11586b(0x18e),()=>_0x28a3f2['journey']['resume'](_0x3f6c61),{'verbose':_0x536201[_0x11586b(0x15a)]}),_0x50064d=_0x1c9b1f['data'];return console[_0x11586b(0x102)](_0x11586b(0x1a4)+_0x50064d[_0x11586b(0xef)][_0x11586b(0x156)]+_0x11586b(0x126)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a26_0x1de697(0x156)]='journey:pull';[a26_0x1de697(0x116)]=a26_0x1de697(0x17f);async[a26_0x1de697(0x16c)](_0x2754d4){const _0x15f51a=a26_0x1de697,{options:_0x1b1ac2,args:_0x3c6806,tdx:_0x49c5ad}=_0x2754d4,_0x87f658=_0x1b1ac2,_0x7d66aa=_0x3c6806[0x0],_0x124088=_0x7d66aa&&isYamlFilePath(_0x7d66aa),_0x55805e=await resolveTarget({'arg':_0x124088?_0x7d66aa:undefined,'contextParent':_0x1b1ac2[_0x15f51a(0xd6)],'cwd':process[_0x15f51a(0xe6)]()});if(!isSuccessfulResolution(_0x55805e))return _0x55805e[_0x15f51a(0x136)]==='no_parent'?(console[_0x15f51a(0x102)](a26_0x2eb633[_0x15f51a(0x16a)](_0x15f51a(0x106))),console[_0x15f51a(0x102)](_0x15f51a(0x18a)),console[_0x15f51a(0x102)](_0x15f51a(0x186)),console[_0x15f51a(0x102)](_0x15f51a(0x137)),console['error'](_0x15f51a(0x19d))):(console[_0x15f51a(0x102)](a26_0x2eb633[_0x15f51a(0x190)](_0x15f51a(0x169)+_0x55805e[_0x15f51a(0x189)]+'\x0a')),_0x55805e[_0x15f51a(0x13d)]&&console[_0x15f51a(0x102)](a26_0x2eb633[_0x15f51a(0x1a1)](_0x55805e[_0x15f51a(0x13d)]))),0x1;let _0x214383=_0x124088?undefined:_0x7d66aa,_0x260264,_0x5916a1;_0x55805e[_0x15f51a(0x103)]===_0x15f51a(0x10f)&&(_0x214383=_0x55805e[_0x15f51a(0xf3)],_0x260264=_0x55805e[_0x15f51a(0x16e)],_0x5916a1=_0x55805e[_0x15f51a(0x115)]);const _0x2fe7f7=_0x55805e[_0x15f51a(0xe5)],_0x123d00=_0x55805e[_0x15f51a(0xc4)];_0x87f658[_0x15f51a(0x15a)]&&(console[_0x15f51a(0x102)](_0x15f51a(0xe8)+_0x2fe7f7),console[_0x15f51a(0x102)](_0x15f51a(0x1b8)+_0x123d00),_0x214383&&console[_0x15f51a(0x102)]('Journey\x20name:\x20'+_0x214383),_0x260264&&console[_0x15f51a(0x102)](_0x15f51a(0x179)+_0x260264),_0x5916a1&&console['error']('Folder\x20path:\x20'+_0x5916a1));const _0x3d71bb=await withSpinner(_0x15f51a(0x164),()=>_0x49c5ad[_0x15f51a(0xf5)][_0x15f51a(0x1ce)](_0x2fe7f7),{'verbose':_0x1b1ac2[_0x15f51a(0x15a)]}),_0x4e4d1e=_0x3d71bb[_0x15f51a(0x118)],{journeys:_0x34afbd,folders:_0x86cbe7}=await withSpinner(_0x15f51a(0xff),async()=>{const _0x26cd9a=_0x15f51a,[_0x5c63cd,_0xdde24]=await Promise[_0x26cd9a(0xd4)]([_0x49c5ad[_0x26cd9a(0x157)]['listJourneysFromParentSegment'](_0x4e4d1e,undefined,{'includeAllVersions':!![]}),_0x49c5ad[_0x26cd9a(0xf5)][_0x26cd9a(0x139)](_0x4e4d1e)]);return{'journeys':_0x5c63cd,'folders':_0xdde24};},{'verbose':_0x1b1ac2[_0x15f51a(0x15a)]})[_0x15f51a(0xd8)](_0x2d10e5=>_0x2d10e5[_0x15f51a(0x118)]);let _0x14186a=_0x34afbd;const _0x5444ca=buildFolderIdToPathMap(_0x86cbe7);if(_0x214383){const _0x5d4f29=_0x14186a[_0x15f51a(0x114)](_0x2c1539=>_0x2c1539[_0x15f51a(0x123)]['toLowerCase']()===_0x214383[_0x15f51a(0x191)]());if(_0x5d4f29[_0x15f51a(0xd1)]===0x0)return console[_0x15f51a(0x102)](_0x15f51a(0x18c)+_0x214383),console[_0x15f51a(0x102)](_0x15f51a(0xf7)),0x1;_0x14186a=_0x5d4f29;}if(_0x5916a1!==undefined){const _0x1025aa=_0x14186a['filter'](_0x12ad44=>{const _0x5eb7fe=_0x15f51a,_0x5782cd=_0x12ad44['folderId']?_0x5444ca[_0x5eb7fe(0x183)](_0x12ad44[_0x5eb7fe(0x120)])||'':'';return _0x5782cd===_0x5916a1;});if(_0x1025aa[_0x15f51a(0xd1)]===0x0&&_0x14186a[_0x15f51a(0xd1)]>0x0){console[_0x15f51a(0x102)](_0x15f51a(0x13f)+_0x214383+_0x15f51a(0xcb)+(_0x5916a1||'root\x20folder')),console['error'](_0x15f51a(0x146));for(const _0x126aee of _0x14186a){const _0x501847=_0x126aee['folderId']?_0x5444ca['get'](_0x126aee['folderId'])||'':'';console[_0x15f51a(0x102)](_0x15f51a(0x185)+(_0x501847||'(root)')+'/'+_0x126aee[_0x15f51a(0x123)]);}return 0x1;}_0x14186a=_0x1025aa;}if(_0x14186a[_0x15f51a(0xd1)]===0x0)return console[_0x15f51a(0x102)](_0x15f51a(0x1c8)),0x0;const _0xdc076e=new Map();for(const _0x178000 of _0x14186a){const _0x42369f=_0x178000['journeyBundleId'];!_0xdc076e['has'](_0x42369f)&&_0xdc076e[_0x15f51a(0x11b)](_0x42369f,[]),_0xdc076e[_0x15f51a(0x183)](_0x42369f)[_0x15f51a(0xe1)](_0x178000);}for(const _0x1ca4af of _0xdc076e[_0x15f51a(0x1c6)]()){_0x1ca4af[_0x15f51a(0xfe)]((_0x17b989,_0x93e261)=>(_0x17b989[_0x15f51a(0x1a7)]||0x0)-(_0x93e261[_0x15f51a(0x1a7)]||0x0));}const _0x19ba14=[],{idToEmailMap:_0x1f0032,connectionIdToNameMap:_0x2e9479}=await withSpinner(_0x15f51a(0x13b),async()=>{const _0x4241bf=_0x15f51a,[_0x133f81,_0x314e32]=await Promise[_0x4241bf(0xd4)]([_0x49c5ad[_0x4241bf(0xca)][_0x4241bf(0x16f)](),_0x49c5ad[_0x4241bf(0x133)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x133f81,'connectionIdToNameMap':_0x314e32};},{'verbose':_0x1b1ac2[_0x15f51a(0x15a)]})[_0x15f51a(0xd8)](_0x204a16=>_0x204a16[_0x15f51a(0x118)]);for(const _0x2cfbfd of _0xdc076e['values']()){const _0x216b54=_0x2cfbfd[0x0][_0x15f51a(0x123)],_0x280e76=_0x2cfbfd[0x0]['folderId'],_0x5f20ae=_0x280e76?_0x5444ca['get'](_0x280e76)||'':'',_0x6159a1=_0x5f20ae?a26_0x49e48c['join'](_0x123d00,_0x5f20ae):_0x123d00,_0x2267c6=_0x260264||a26_0x49e48c['join'](_0x6159a1,sanitizeFileName(_0x216b54)+_0x15f51a(0x188));let _0x4accce,_0x39e2f3;if(existsSync(_0x2267c6))try{const _0x51eb54=readFileSync(_0x2267c6,_0x15f51a(0x154)),_0x4f32ed=parseYamlString(_0x51eb54);_0x39e2f3=_0x4f32ed,_0x4accce=buildRuleToNameMapping(_0x4f32ed),_0x87f658[_0x15f51a(0x15a)]&&_0x4accce[_0x15f51a(0x130)]>0x0&&console[_0x15f51a(0x102)](_0x15f51a(0x159)+_0x4accce[_0x15f51a(0x130)]+_0x15f51a(0xc1)+_0x216b54);}catch(_0xcf5e46){_0x87f658[_0x15f51a(0x15a)]&&console[_0x15f51a(0x102)](_0x15f51a(0x13e)+_0xcf5e46[_0x15f51a(0x189)]);}const _0x14f00a=[],_0x164cc8=new Set(),_0x2bad45=new Map(),_0x305484=new Map(),_0x438184=new Set(),_0x2ec844=new Map(),_0x3f907e=new Map(),_0x5f3d87=createJumpTargetCache();await withProgressSpinner(_0x15f51a(0x121)+_0x216b54+_0x15f51a(0x151),async _0x22c6fb=>{const _0x3d60cb=_0x15f51a;for(const _0x2b54c3 of _0x2cfbfd){const _0x9489bb=_0x2cfbfd[_0x3d60cb(0xd1)]>0x1?_0x2b54c3[_0x3d60cb(0x123)]+'\x20v'+(_0x2b54c3[_0x3d60cb(0x1a7)]||0x1):_0x2b54c3['journeyBundleName'];_0x22c6fb['setPhase']('Fetching\x20'+_0x9489bb);const _0x1940df=await _0x49c5ad['journey'][_0x3d60cb(0xdc)](_0x2b54c3['id']),_0x145807=_0x1940df[_0x3d60cb(0xef)]?.['audienceId'],_0x432c68={'resolveSegment':async _0x549aef=>{const _0x5b91d2=_0x3d60cb;if(!_0x145807)return{'name':_0x549aef,'isJourneyLocal':![]};const _0x1f04c0=_0x2bad45[_0x5b91d2(0x183)](_0x549aef);if(_0x1f04c0)return _0x1f04c0;try{const _0x43dd5f=await _0x49c5ad[_0x5b91d2(0xf5)][_0x5b91d2(0x145)](_0x145807,_0x549aef),_0xf1bc1b=_0x43dd5f[_0x5b91d2(0x16d)]===SEGMENT_KIND_JOURNEY;let _0xef7c22,_0x5817a3=_0x43dd5f[_0x5b91d2(0x156)];if(_0xf1bc1b&&_0x43dd5f['rule']){const _0xc204b7=await segmentResponseToDef(_0x43dd5f,{'resolveSegmentName':async _0x4aa481=>{const _0x44c305=_0x5b91d2,_0x46e396=_0x2bad45[_0x44c305(0x183)](_0x4aa481);if(_0x46e396)return _0x46e396['name'];const _0x8ed662=await _0x432c68[_0x44c305(0xc3)](_0x4aa481);return _0x8ed662[_0x44c305(0x156)];}}),_0x215207=_0xc204b7[_0x5b91d2(0x176)];_0xef7c22={'description':_0x43dd5f[_0x5b91d2(0x116)],'rule':_0x215207};const _0x3406e7=serializeRule(_0x215207),_0xf8ce14=_0x305484[_0x5b91d2(0x183)](_0x3406e7);if(_0xf8ce14)_0x5817a3=_0xf8ce14,_0xef7c22=undefined,_0x87f658[_0x5b91d2(0x15a)]&&console[_0x5b91d2(0x102)](_0x5b91d2(0x177)+_0x43dd5f['name']+_0x5b91d2(0x1a6)+_0xf8ce14);else{let _0x548326=![];if(_0x4accce){const _0x2f9de0=_0x4accce['get'](_0x3406e7);if(_0x2f9de0){const _0x5c864f=_0x2f9de0[_0x5b91d2(0x1ca)](_0x5d3b98=>!_0x164cc8[_0x5b91d2(0xc0)](_0x5d3b98));_0x5c864f&&(_0x5817a3=_0x5c864f,_0x164cc8[_0x5b91d2(0x1a0)](_0x5c864f),_0x305484[_0x5b91d2(0x11b)](_0x3406e7,_0x5c864f),_0x548326=!![],_0x87f658[_0x5b91d2(0x15a)]&&console['error'](_0x5b91d2(0x1ac)+_0x5c864f+'\x20(rule\x20match)'));}}if(!_0x548326){const _0x515be6=generateJourneyLocalName(_0x43dd5f[_0x5b91d2(0x156)]);_0x515be6&&(_0x5817a3=_0x515be6);let _0x3bb052=_0x5817a3,_0x25167e=0x2;while(_0x164cc8['has'](_0x3bb052)){_0x3bb052=_0x5817a3+'_'+_0x25167e,_0x25167e++;}_0x164cc8[_0x5b91d2(0x1a0)](_0x3bb052),_0x305484[_0x5b91d2(0x11b)](_0x3406e7,_0x3bb052),_0x5817a3=_0x3bb052;}}}const _0x127fc5={'name':_0x5817a3,'isJourneyLocal':_0xf1bc1b,'definition':_0xef7c22};return _0x2bad45[_0x5b91d2(0x11b)](_0x549aef,_0x127fc5),_0x127fc5;}catch(_0x3629d5){return _0x1b1ac2[_0x5b91d2(0x15a)]&&console[_0x5b91d2(0x102)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x549aef+':\x20'+_0x3629d5[_0x5b91d2(0x189)]),{'name':_0x549aef,'isJourneyLocal':![]};}},'resolveActivation':async _0x221a1d=>{const _0x568177=_0x3d60cb,_0x1059c9=_0x2ec844[_0x568177(0x183)](_0x221a1d);if(_0x1059c9)return _0x1059c9;try{const _0x2d0081=await _0x49c5ad['journey'][_0x568177(0x160)](_0x2b54c3['id'],_0x221a1d),_0xf9dc0b=journeyActivationStepToYaml(_0x2d0081,_0x1f0032,_0x2e9479),_0x383fc1=JSON['stringify']({'name':_0xf9dc0b[_0x568177(0x156)],'connection':_0xf9dc0b['connection'],'connector_config':_0xf9dc0b[_0x568177(0x112)]}),_0x45ff62=_0x3f907e[_0x568177(0x183)](_0x383fc1);if(_0x45ff62){const _0x2def05={'name':_0x45ff62,'isJourneyLocal':!![],'definition':_0xf9dc0b};return _0x2ec844[_0x568177(0x11b)](_0x221a1d,_0x2def05),_0x2def05;}const _0xf591dc=_0x2d0081[_0x568177(0xef)][_0x568177(0x12a)][_0x568177(0x156)]||_0x221a1d,_0x551260=sanitizeYamlKey(_0xf591dc)||_0x568177(0x17e)+_0x221a1d;let _0x300b80=_0x551260,_0x29c8d6=0x2;while(_0x438184['has'](_0x300b80)){_0x300b80=_0x551260+'_'+_0x29c8d6,_0x29c8d6++;}_0x438184['add'](_0x300b80),_0x3f907e[_0x568177(0x11b)](_0x383fc1,_0x300b80);const _0x3f2f5d={'name':_0x300b80,'isJourneyLocal':!![],'definition':_0xf9dc0b};return _0x2ec844['set'](_0x221a1d,_0x3f2f5d),_0x3f2f5d;}catch(_0x558409){return _0x1b1ac2[_0x568177(0x15a)]&&console[_0x568177(0x102)](_0x568177(0xcc)+_0x221a1d+':\x20'+_0x558409['message']),{'name':_0x221a1d,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x47ed59,_0x10ed82)=>{const _0xee9e4d=_0x3d60cb;return resolveJumpTarget(_0x47ed59,_0x10ed82,_0x5f3d87,_0x107434=>_0x49c5ad[_0xee9e4d(0x157)][_0xee9e4d(0xdc)](_0x107434));}},_0x80f555=await journeyResponseToDef(_0x1940df,_0x432c68);_0x14f00a['push']({'item':_0x2b54c3,'yaml':_0x80f555});}},{'verbose':_0x1b1ac2[_0x15f51a(0x15a)]});const _0x5dedbb=await _0x49c5ad[_0x15f51a(0x157)]['getLatestJourneyId'](_0x2cfbfd[0x0][_0x15f51a(0x101)]),_0x2e5f29=buildMergedJourneyDef(_0x14f00a,_0x4accce,_0x5dedbb),_0x37346b=normalizeJourneyDef(_0x2e5f29,_0x39e2f3),_0x5eeb82=toYamlString(_0x37346b),_0x580da3=_0x260264||a26_0x49e48c[_0x15f51a(0x11d)](_0x6159a1,sanitizeFileName(_0x216b54)+_0x15f51a(0x188));!_0x260264&&_0x5f20ae&&!existsSync(_0x6159a1)&&mkdirSync(_0x6159a1,{'recursive':!![]});const _0x88f96f=a26_0x49e48c['relative'](process['cwd'](),_0x580da3);if(existsSync(_0x580da3)){const _0x1aca15=readFileSync(_0x580da3,'utf-8'),_0x52c38d=generateDiff(_0x1aca15,_0x5eeb82),_0x2ff898=hasChanges(_0x52c38d);_0x19ba14[_0x15f51a(0xe1)]({'relativePath':_0x88f96f,'absolutePath':_0x580da3,'content':_0x5eeb82,'isNew':![],'hasChanges':_0x2ff898,'diff':_0x2ff898?formatDiffWithColors(_0x52c38d):undefined});}else _0x19ba14[_0x15f51a(0xe1)]({'relativePath':_0x88f96f,'absolutePath':_0x580da3,'content':_0x5eeb82,'isNew':!![],'hasChanges':![]});}const _0x20e634=_0x19ba14[_0x15f51a(0x114)](_0x16429f=>_0x16429f[_0x15f51a(0x162)]),_0x5db9a0=_0x19ba14[_0x15f51a(0x114)](_0xd6abe0=>!_0xd6abe0['isNew']&&_0xd6abe0[_0x15f51a(0x149)]),_0x21124f=_0x19ba14[_0x15f51a(0x114)](_0x1ed0af=>!_0x1ed0af[_0x15f51a(0x162)]&&!_0x1ed0af['hasChanges']),_0xac523c=_0x14186a[_0x15f51a(0xd1)],_0x10a875=_0xdc076e[_0x15f51a(0x130)],_0x1a40aa=_0xac523c>_0x10a875?'\x20('+_0xac523c+'\x20versions)':'';console['error'](_0x15f51a(0x199)),console[_0x15f51a(0x102)]('\x20\x20'+a26_0x2eb633[_0x15f51a(0x1a1)](_0x10a875+_0x15f51a(0x1ba))+a26_0x2eb633[_0x15f51a(0x163)](_0x1a40aa)),console[_0x15f51a(0x102)]('\x20\x20'+a26_0x2eb633[_0x15f51a(0x1c9)]('+\x20'+_0x20e634['length']+_0x15f51a(0x180))),console[_0x15f51a(0x102)]('\x20\x20'+a26_0x2eb633[_0x15f51a(0x16a)]('~\x20'+_0x5db9a0['length']+_0x15f51a(0xd3))),console[_0x15f51a(0x102)]('\x20\x20'+a26_0x2eb633['dim']('=\x20'+_0x21124f[_0x15f51a(0xd1)]+_0x15f51a(0x125))),console['error'](_0x15f51a(0x193)+a26_0x2eb633['cyan'](_0x123d00)+'\x0a');if(_0x5db9a0[_0x15f51a(0xd1)]>0x0)for(const _0x27c6cd of _0x5db9a0){console[_0x15f51a(0x102)](_0x15f51a(0x153)+_0x27c6cd[_0x15f51a(0x19a)]+'\x27:'),console[_0x15f51a(0x102)]('─'[_0x15f51a(0x18f)](0x3c)),console['error'](_0x27c6cd['diff']),console[_0x15f51a(0x102)]('─'['repeat'](0x3c));}if(_0x87f658[_0x15f51a(0xdf)])return console[_0x15f51a(0x102)](a26_0x2eb633['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x20e634[_0x15f51a(0xd1)]===0x0&&_0x5db9a0[_0x15f51a(0xd1)]===0x0)return console[_0x15f51a(0x102)](a26_0x2eb633[_0x15f51a(0x1c9)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2fe7f7},_0x87f658[_0x15f51a(0x1b2)]),console['error'](a26_0x2eb633[_0x15f51a(0x1c9)](_0x15f51a(0x108)+a26_0x2eb633['dim'](_0x15f51a(0x150))+_0x15f51a(0x1cb)+a26_0x2eb633[_0x15f51a(0x1a1)](_0x2fe7f7))),0x0;if(!_0x87f658[_0x15f51a(0x14c)]&&(_0x20e634[_0x15f51a(0xd1)]>0x0||_0x5db9a0['length']>0x0)){if(!isInteractive())return console[_0x15f51a(0x102)](a26_0x2eb633[_0x15f51a(0x190)](_0x15f51a(0x195)),_0x15f51a(0x1bb)),console['error'](a26_0x2eb633['dim'](_0x15f51a(0x1b9))),0x1;const _0x237020=await confirmKey(_0x15f51a(0x1ab)+(_0x20e634[_0x15f51a(0xd1)]+_0x5db9a0[_0x15f51a(0xd1)])+_0x15f51a(0x13c));if(!_0x237020)return console[_0x15f51a(0x102)](a26_0x2eb633[_0x15f51a(0x16a)](_0x15f51a(0x12f)),_0x15f51a(0x181)),0x1;}!existsSync(_0x123d00)&&mkdirSync(_0x123d00,{'recursive':!![]});const _0x207cf1=a26_0x49e48c['join'](_0x123d00,_0x15f51a(0x11e));writeFileSync(_0x207cf1,createTdxConfigContent(_0x2fe7f7),_0x15f51a(0x154));for(const _0x2d4d5f of _0x19ba14){(_0x2d4d5f['isNew']||_0x2d4d5f[_0x15f51a(0x149)])&&writeFileSync(_0x2d4d5f[_0x15f51a(0x117)],_0x2d4d5f[_0x15f51a(0x17b)],_0x15f51a(0x154));}return console['error'](a26_0x2eb633[_0x15f51a(0x1c9)]('✔\x20Pulled\x20'+(_0x20e634['length']+_0x5db9a0['length'])+_0x15f51a(0x119)+_0x123d00)),saveSessionContext({'parent_segment':_0x2fe7f7},_0x87f658[_0x15f51a(0x1b2)]),console[_0x15f51a(0x102)](a26_0x2eb633[_0x15f51a(0x1c9)](_0x15f51a(0x108)+a26_0x2eb633[_0x15f51a(0x163)](_0x15f51a(0x150))+_0x15f51a(0x1cb)+a26_0x2eb633[_0x15f51a(0x1a1)](_0x2fe7f7))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0x1de697(0x156)]=a26_0x1de697(0x170);[a26_0x1de697(0x116)]=a26_0x1de697(0x10a);async[a26_0x1de697(0x16c)](_0x410bb6){const _0xc9e32e=a26_0x1de697,{options:_0xd47144,args:_0x256735,tdx:_0x20fb05}=_0x410bb6,_0x51a5a4=_0x256735[0x0];if(!requireNameOrPath(_0x51a5a4))return 0x1;_0xd47144[_0xc9e32e(0x15a)]&&console[_0xc9e32e(0x102)](_0xc9e32e(0x1c0)+_0x51a5a4);const {journeyId:_0x5ac666}=await resolveJourneyIdFromInput(_0x51a5a4,_0xd47144,_0x20fb05),_0x4357e8=await withSpinner(_0xc9e32e(0x1c4),()=>_0x20fb05[_0xc9e32e(0x157)]['getColumnMapping'](_0x5ac666),{'verbose':_0xd47144[_0xc9e32e(0x15a)]}),_0x304791=_0x4357e8[_0xc9e32e(0x118)];return console[_0xc9e32e(0xc7)]('Database:\x20'+_0x304791[_0xc9e32e(0x147)]),console[_0xc9e32e(0xc7)]('Table:\x20'+_0x304791['table']),await handleSDKOutput(_0x304791[_0xc9e32e(0x138)],_0xd47144),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a26_0x1de697(0x156)]='journey:activations';[a26_0x1de697(0x116)]=a26_0x1de697(0xc6);async[a26_0x1de697(0x16c)](_0x498fa2){const _0x5e3eb5=a26_0x1de697,{options:_0x529c64,args:_0x1f6c28,tdx:_0x371d58}=_0x498fa2,_0x19db79=_0x1f6c28[0x0];if(!requireNameOrPath(_0x19db79))return 0x1;_0x529c64['verbose']&&console[_0x5e3eb5(0x102)]('Input:\x20'+_0x19db79);const {journeyId:_0x5ef2fb}=await resolveJourneyIdFromInput(_0x19db79,_0x529c64,_0x371d58),_0x1e8af3=await withSpinner(_0x5e3eb5(0x105),()=>_0x371d58[_0x5e3eb5(0x157)][_0x5e3eb5(0x17c)](_0x5ef2fb),{'verbose':_0x529c64[_0x5e3eb5(0x15a)]}),_0x1b9ee2=_0x1e8af3[_0x5e3eb5(0x118)];return console[_0x5e3eb5(0x102)](_0x5e3eb5(0x159)+_0x1b9ee2['length']+_0x5e3eb5(0xc2)+(_0x1b9ee2[_0x5e3eb5(0xd1)]!==0x1?'s':'')),await handleSDKOutput(_0x1b9ee2,_0x529c64),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0x1de697(0x156)]=a26_0x1de697(0x1b7);[a26_0x1de697(0x116)]=a26_0x1de697(0x165);[a26_0x1de697(0x1a8)]=new SegmentPushCommand();async[a26_0x1de697(0x16c)](_0x88ef13){const _0x5dcd29=a26_0x1de697,_0x5a432f=_0x88ef13[_0x5dcd29(0x198)][0x0];let _0x277d96;if(_0x5a432f){const _0x2615a0=await resolveTarget({'arg':_0x5a432f,'contextParent':_0x88ef13[_0x5dcd29(0x167)]['parentSegment'],'cwd':process[_0x5dcd29(0xe6)]()});isSuccessfulResolution(_0x2615a0)&&_0x2615a0[_0x5dcd29(0x103)]==='file'&&(_0x277d96=_0x2615a0[_0x5dcd29(0x16e)]);}const _0x1c9ac3={..._0x88ef13,'options':{..._0x88ef13[_0x5dcd29(0x167)],'journeysOnly':!![],..._0x277d96&&{'singleFilePath':_0x277d96}}};return this[_0x5dcd29(0x1a8)][_0x5dcd29(0x16c)](_0x1c9ac3);}}export class JourneyVersionsCommand extends BaseCommand{[a26_0x1de697(0x156)]=a26_0x1de697(0xe9);[a26_0x1de697(0x116)]=a26_0x1de697(0x144);async[a26_0x1de697(0x16c)](_0x2d333a){const _0x40a53f=a26_0x1de697,{options:_0x8f86c9,args:_0x4019b3,tdx:_0x1cc856}=_0x2d333a,_0x33acfc=_0x4019b3[0x0];if(!requireNameOrPath(_0x33acfc))return 0x1;if(_0x8f86c9[_0x40a53f(0x15a)])console[_0x40a53f(0x102)](_0x40a53f(0x1c0)+_0x33acfc);const {journeyId:_0x4463e0}=await resolveJourneyIdFromInput(_0x33acfc,_0x8f86c9,_0x1cc856),_0x288020=await withSpinner('Listing\x20journey\x20versions...',()=>_0x1cc856['journey'][_0x40a53f(0x135)](_0x4463e0),{'verbose':_0x8f86c9[_0x40a53f(0x15a)]}),{bundleName:_0x19c220,versions:_0x4ab86b,latestJourneyId:_0xcf4c00}=_0x288020[_0x40a53f(0x118)];console['error'](_0x19c220+':\x20'+_0x4ab86b[_0x40a53f(0xd1)]+_0x40a53f(0x175)+(_0x4ab86b['length']!==0x1?'s':''));const _0x44048d=_0x4ab86b[_0x40a53f(0x113)](_0x434c89=>({'version':_0x434c89[_0x40a53f(0x1a7)],'journey_id':_0x434c89[_0x40a53f(0x1cd)],'name':_0x434c89[_0x40a53f(0x156)],'state':_0x434c89[_0x40a53f(0xf2)],'paused':_0x434c89['paused'],'latest':_0x434c89['journeyId']===_0xcf4c00,'created_at':_0x434c89[_0x40a53f(0x17a)]}));return await handleSDKOutput(_0x44048d,_0x8f86c9),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';[a26_0x1de697(0x116)]=a26_0x1de697(0x14d);async[a26_0x1de697(0x16c)](_0x4bd558){const _0x825b2c=a26_0x1de697,{options:_0x3e8c4e,args:_0x1b59b0,tdx:_0x5f053c}=_0x4bd558,_0x315cc7=_0x1b59b0[0x0];if(!requireNameOrPath(_0x315cc7))return 0x1;if(_0x3e8c4e['verbose'])console[_0x825b2c(0x102)](_0x825b2c(0x1c0)+_0x315cc7);const {journeyId:_0x3ed341,journeyName:_0x16c0ba}=await resolveJourneyIdFromInput(_0x315cc7,_0x3e8c4e,_0x5f053c);if(!_0x3e8c4e[_0x825b2c(0x14c)]){const _0x221f0a=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x16c0ba+'\x22?');if(!_0x221f0a)return console[_0x825b2c(0x102)](_0x825b2c(0x1be)),0x0;}const _0x4c003e=await withSpinner(_0x825b2c(0x10b),()=>_0x5f053c[_0x825b2c(0x157)][_0x825b2c(0x13a)](_0x3ed341),{'verbose':_0x3e8c4e[_0x825b2c(0x15a)]}),_0x48ab7f=_0x4c003e['data'];return console[_0x825b2c(0x102)](a26_0x2eb633[_0x825b2c(0x1c9)]('✔')+_0x825b2c(0x192)+_0x48ab7f[_0x825b2c(0xef)]['versionNumber']+_0x825b2c(0x10e)+_0x48ab7f[_0x825b2c(0xef)][_0x825b2c(0x156)]+'\x22'),console['error'](_0x825b2c(0x11c)+_0x48ab7f['id']),await handleSingleObjectOutput({'id':_0x48ab7f['id'],'name':_0x48ab7f['attributes'][_0x825b2c(0x156)],'version':_0x48ab7f[_0x825b2c(0xef)][_0x825b2c(0x1a7)],'state':_0x48ab7f[_0x825b2c(0xef)][_0x825b2c(0xf2)],'bundle_id':_0x48ab7f[_0x825b2c(0xef)]['journeyBundleId'],'created_at':_0x48ab7f['attributes'][_0x825b2c(0x17a)]},_0x3e8c4e),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a26_0x1de697(0xd9);['description']=a26_0x1de697(0x1bf);async['execute'](_0x1a6d4e){const _0x29373b=a26_0x1de697,{options:_0x16851d,args:_0x3764e4,tdx:_0xfca1ea}=_0x1a6d4e,_0x578ea8=_0x3764e4[0x0];if(!requireNameOrPath(_0x578ea8))return 0x1;const _0x3b6757=_0x16851d['version'];if(!_0x3b6757)return console[_0x29373b(0x102)](_0x29373b(0x168)),console[_0x29373b(0x102)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x2def90=parseInt(_0x3b6757,0xa);if(isNaN(_0x2def90)||_0x2def90<0x1)return console[_0x29373b(0x102)](_0x29373b(0x1ae)+_0x3b6757),0x1;if(_0x16851d['verbose'])console['error']('Input:\x20'+_0x578ea8+',\x20version:\x20'+_0x2def90);const {journeyId:_0x49fda9,parentSegmentId:_0x2f3d6c}=await resolveJourneyIdFromInput(_0x578ea8,_0x16851d,_0xfca1ea),_0x26d3cd=await withSpinner(_0x29373b(0x132),()=>_0xfca1ea[_0x29373b(0x157)][_0x29373b(0x135)](_0x49fda9),{'verbose':_0x16851d[_0x29373b(0x15a)]}),{versions:_0x3c1073,latestJourneyId:_0x59c276}=_0x26d3cd['data'],_0x37b830=_0x3c1073[_0x29373b(0x1ca)](_0x298de0=>_0x298de0['versionNumber']===_0x2def90);if(!_0x37b830){const _0x1affbf=_0x3c1073['map'](_0x27db4c=>'v'+_0x27db4c['versionNumber'])[_0x29373b(0x11d)](',\x20');return console['error'](_0x29373b(0xf8)+_0x2def90+_0x29373b(0x1cf)+_0x1affbf),0x1;}const _0x28cd7a=await withSpinner(_0x29373b(0xcd)+_0x2def90+_0x29373b(0x1c1),()=>_0xfca1ea['journey'][_0x29373b(0xdc)](_0x37b830[_0x29373b(0x1cd)]),{'verbose':_0x16851d[_0x29373b(0x15a)]}),_0x42ff5d=_0x28cd7a[_0x29373b(0x118)],_0x29f223=getConsoleNextUrl(_0x16851d['site'],_0x29373b(0x1b1)+_0x2f3d6c+_0x29373b(0x12c)+_0x37b830[_0x29373b(0x1cd)]+_0x29373b(0x178));return await handleSingleObjectOutput({'id':_0x42ff5d['id'],'name':_0x42ff5d[_0x29373b(0xef)][_0x29373b(0x156)],'version':_0x42ff5d[_0x29373b(0xef)][_0x29373b(0x1a7)],'description':_0x42ff5d[_0x29373b(0xef)][_0x29373b(0x116)],'state':_0x42ff5d[_0x29373b(0xef)][_0x29373b(0xf2)],'paused':_0x42ff5d[_0x29373b(0xef)][_0x29373b(0xf4)],'reentry_mode':_0x42ff5d[_0x29373b(0xef)][_0x29373b(0xfa)],'stages':_0x42ff5d[_0x29373b(0xef)]['journeyStages']?.[_0x29373b(0xd1)]||0x0,..._0x42ff5d[_0x29373b(0xef)][_0x29373b(0xbe)]&&{'goal':_0x42ff5d[_0x29373b(0xef)][_0x29373b(0xbe)][_0x29373b(0x156)]},'latest':_0x37b830[_0x29373b(0x1cd)]===_0x59c276,'created_at':_0x42ff5d[_0x29373b(0xef)]['createdAt'],'updated_at':_0x42ff5d[_0x29373b(0xef)]['updatedAt'],'url':_0x29f223},_0x16851d),0x0;}}
@@ -1 +1 @@
1
- const a27_0x54bdb2=a27_0x2638;(function(_0x5559fa,_0x556b2d){const _0x43901e=a27_0x2638,_0x3a76ba=_0x5559fa();while(!![]){try{const _0x19af5b=-parseInt(_0x43901e(0x108))/0x1+parseInt(_0x43901e(0x11b))/0x2*(parseInt(_0x43901e(0x113))/0x3)+-parseInt(_0x43901e(0x102))/0x4+parseInt(_0x43901e(0x115))/0x5*(-parseInt(_0x43901e(0x103))/0x6)+parseInt(_0x43901e(0x138))/0x7*(-parseInt(_0x43901e(0x139))/0x8)+parseInt(_0x43901e(0x10c))/0x9*(-parseInt(_0x43901e(0x13e))/0xa)+-parseInt(_0x43901e(0x117))/0xb*(-parseInt(_0x43901e(0x12d))/0xc);if(_0x19af5b===_0x556b2d)break;else _0x3a76ba['push'](_0x3a76ba['shift']());}catch(_0x2636ba){_0x3a76ba['push'](_0x3a76ba['shift']());}}}(a27_0x29d1,0x5516d));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a27_0x29d1(){const _0x419ead=['2qKWsXC','\x20valid','warningCount','file','type','skippedCount','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','.yml','\x20warning(s)\x20found','green','validCount','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','no_parent','hasErrors','\x20segment\x20file(s)\x20skipped)','Validate\x20journey\x20YAML\x20files','targetDir','error','5172LZeXzT','\x20journey(s)\x20valid','filter','red','description','\x20journey(s)\x20with\x20errors,\x20','endsWith','valid','helpText','Error:\x20Directory\x20not\x20found:\x20','errorCode','25501DfnThP','1352bwbFHe','\x20warning(s)','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20segment\x20file(s)\x20skipped','filePath','30OWCSuD','✔\x20All\x20','length','2099712ushfnt','17058SohTfe','Validation\x20failed:\x20','dim','log','parentSegment','599436tzPyOp','journey','\x20(skipped:\x20','No\x20journey\x20YAML\x20files\x20found\x20in\x20','1405449sgPPTw','name','\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','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','relativePath','message','cwd','1382961gaQIyZ','yellow','40urMyGs','invalidCount','54076DZTmrM','verbose','warnings','execute'];a27_0x29d1=function(){return _0x419ead;};return a27_0x29d1();}import{existsSync}from'fs';function a27_0x2638(_0x291c40,_0x562783){_0x291c40=_0x291c40-0x100;const _0x29d193=a27_0x29d1();let _0x263898=_0x29d193[_0x291c40];return _0x263898;}import a27_0x458634 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a27_0x54bdb2(0x10d)]='journey:validate';[a27_0x54bdb2(0x131)]=a27_0x54bdb2(0x12a);async[a27_0x54bdb2(0x11a)](_0x52df41){const _0x1e36b1=a27_0x54bdb2,{options:_0x58ca6e,args:_0x4c5800}=_0x52df41,_0x2ef0cc=_0x58ca6e,_0x516ac5=await resolveTarget({'arg':_0x4c5800[0x0],'contextParent':_0x58ca6e[_0x1e36b1(0x107)],'cwd':process[_0x1e36b1(0x112)]()});if(!isSuccessfulResolution(_0x516ac5))return _0x516ac5[_0x1e36b1(0x137)]===_0x1e36b1(0x127)?(console[_0x1e36b1(0x12c)](a27_0x458634[_0x1e36b1(0x114)](_0x1e36b1(0x121))),console[_0x1e36b1(0x12c)](_0x1e36b1(0x13b)),console[_0x1e36b1(0x12c)](_0x1e36b1(0x10e)),console[_0x1e36b1(0x12c)](_0x1e36b1(0x10f))):(console['error'](a27_0x458634[_0x1e36b1(0x130)]('Error:\x20'+_0x516ac5[_0x1e36b1(0x111)]+'\x0a')),_0x516ac5[_0x1e36b1(0x135)]&&console['error'](a27_0x458634['cyan'](_0x516ac5[_0x1e36b1(0x135)]))),0x1;const _0x3a19a2=_0x516ac5[_0x1e36b1(0x12b)],_0x4cc2cf=_0x516ac5[_0x1e36b1(0x11f)]===_0x1e36b1(0x11e)?_0x516ac5[_0x1e36b1(0x13d)]:undefined;if(!_0x4cc2cf&&!existsSync(_0x3a19a2))return console[_0x1e36b1(0x12c)](a27_0x458634[_0x1e36b1(0x130)](_0x1e36b1(0x136)+_0x3a19a2+'\x0a')),0x1;let _0x567251;if(_0x4cc2cf){if(!_0x4cc2cf[_0x1e36b1(0x133)](_0x1e36b1(0x122))&&!_0x4cc2cf[_0x1e36b1(0x133)]('.yaml'))return console['error'](a27_0x458634[_0x1e36b1(0x130)](_0x1e36b1(0x126)+_0x4cc2cf+'\x0a')),0x1;_0x567251=[_0x4cc2cf];}else _0x567251=findYamlFiles(_0x3a19a2);if(_0x567251['length']===0x0)return console[_0x1e36b1(0x12c)](a27_0x458634['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x3a19a2+'\x0a')),0x1;const _0x4281be=validateYamlFiles(_0x567251,_0x3a19a2,{'filterType':_0x1e36b1(0x109)}),_0x4c1d96=calculateSummary(_0x4281be),_0x36155d=_0x4281be[_0x1e36b1(0x12f)](isValidationResult);if(_0x36155d['length']===0x0)return console[_0x1e36b1(0x12c)](a27_0x458634[_0x1e36b1(0x114)](_0x1e36b1(0x10b)+_0x3a19a2+'\x0a')),_0x4c1d96[_0x1e36b1(0x120)]>0x0&&console[_0x1e36b1(0x12c)](a27_0x458634[_0x1e36b1(0x105)]('('+_0x4c1d96[_0x1e36b1(0x120)]+_0x1e36b1(0x129))),0x0;for(const _0x1997fa of _0x4281be){if(!isValidationResult(_0x1997fa)){_0x2ef0cc[_0x1e36b1(0x118)]&&console['log'](a27_0x458634[_0x1e36b1(0x105)]('-\x20'+_0x1997fa[_0x1e36b1(0x110)]+_0x1e36b1(0x10a)+_0x1997fa['reason']+')'));continue;}const {relativePath:_0x228f52,source:_0x11b68e,result:_0x123a7f}=_0x1997fa;if(_0x123a7f[_0x1e36b1(0x134)]&&_0x123a7f['warnings'][_0x1e36b1(0x101)]===0x0)_0x2ef0cc[_0x1e36b1(0x118)]&&console[_0x1e36b1(0x106)](a27_0x458634['green']('✔\x20'+_0x228f52));else _0x123a7f[_0x1e36b1(0x134)]?(console[_0x1e36b1(0x106)](a27_0x458634[_0x1e36b1(0x114)]('⚠\x20'+_0x228f52+':\x20'+_0x123a7f[_0x1e36b1(0x119)][_0x1e36b1(0x101)]+_0x1e36b1(0x13a))),console[_0x1e36b1(0x106)](formatValidationResult(_0x123a7f,_0x11b68e,_0x228f52))):(console['log'](a27_0x458634[_0x1e36b1(0x130)]('✖\x20'+_0x228f52+':\x20'+_0x123a7f['errors'][_0x1e36b1(0x101)]+'\x20error(s)')),console['log'](formatValidationResult(_0x123a7f,_0x11b68e,_0x228f52)));}return console[_0x1e36b1(0x106)](''),_0x4c1d96[_0x1e36b1(0x128)]?(console[_0x1e36b1(0x106)](a27_0x458634[_0x1e36b1(0x130)](_0x1e36b1(0x104)+_0x4c1d96[_0x1e36b1(0x116)]+_0x1e36b1(0x132)+_0x4c1d96[_0x1e36b1(0x125)]+_0x1e36b1(0x11c))),_0x4c1d96[_0x1e36b1(0x11d)]>0x0&&console[_0x1e36b1(0x106)](a27_0x458634['yellow'](_0x4c1d96[_0x1e36b1(0x11d)]+_0x1e36b1(0x123))),_0x4c1d96[_0x1e36b1(0x120)]>0x0&&console[_0x1e36b1(0x106)](a27_0x458634[_0x1e36b1(0x105)](_0x4c1d96['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0x1e36b1(0x106)](a27_0x458634[_0x1e36b1(0x124)](_0x1e36b1(0x100)+_0x4c1d96['validCount']+_0x1e36b1(0x12e))),_0x4c1d96[_0x1e36b1(0x11d)]>0x0&&console[_0x1e36b1(0x106)](a27_0x458634[_0x1e36b1(0x114)](_0x4c1d96['warningCount']+_0x1e36b1(0x123))),_0x4c1d96[_0x1e36b1(0x120)]>0x0&&console[_0x1e36b1(0x106)](a27_0x458634[_0x1e36b1(0x105)](_0x4c1d96[_0x1e36b1(0x120)]+_0x1e36b1(0x13c))),0x0);}}
1
+ const a27_0x23ecc9=a27_0x4195;function a27_0x4195(_0x5a8104,_0x120ad6){_0x5a8104=_0x5a8104-0x132;const _0x5bbd26=a27_0x5bbd();let _0x41952d=_0x5bbd26[_0x5a8104];return _0x41952d;}(function(_0x3a841c,_0x15837e){const _0x156871=a27_0x4195,_0xd0bc6a=_0x3a841c();while(!![]){try{const _0xcd6ad7=parseInt(_0x156871(0x146))/0x1+parseInt(_0x156871(0x165))/0x2+-parseInt(_0x156871(0x15c))/0x3*(-parseInt(_0x156871(0x13c))/0x4)+parseInt(_0x156871(0x169))/0x5*(-parseInt(_0x156871(0x13e))/0x6)+parseInt(_0x156871(0x14b))/0x7+parseInt(_0x156871(0x159))/0x8+parseInt(_0x156871(0x142))/0x9*(-parseInt(_0x156871(0x16c))/0xa);if(_0xcd6ad7===_0x15837e)break;else _0xd0bc6a['push'](_0xd0bc6a['shift']());}catch(_0x58fb6b){_0xd0bc6a['push'](_0xd0bc6a['shift']());}}}(a27_0x5bbd,0x6a5e1));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_0x546b12 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a27_0x5bbd(){const _0x8dccb9=['execute','Validation\x20failed:\x20','warningCount','Error:\x20Directory\x20not\x20found:\x20','file','skippedCount','108fQDQDv','\x20(skipped:\x20','8442MtUlcl','verbose','✔\x20All\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','8969571TUbqqZ','no_parent','description','message','29045zzjEfN','dim','\x20segment\x20file(s)\x20skipped)','\x20error(s)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','4621274ZclctP','length','parentSegment','.yaml','.yml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','green','\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','yellow','Error:\x20','log','cwd','type','errorCode','1715320VuwWNp','journey','filter','53727kakHCb','\x20warning(s)\x20found','valid','hasErrors','name','relativePath','warnings','filePath','red','571424POlett','validCount','\x20valid','reason','855XLDxKJ','cyan','invalidCount','10PGJPGh','error','\x20warning(s)','errors','targetDir'];a27_0x5bbd=function(){return _0x8dccb9;};return a27_0x5bbd();}export class JourneyValidateCommand extends BaseCommand{[a27_0x23ecc9(0x160)]='journey:validate';[a27_0x23ecc9(0x144)]='Validate\x20journey\x20YAML\x20files';async[a27_0x23ecc9(0x136)](_0x5e1d5e){const _0xaaad17=a27_0x23ecc9,{options:_0x5c3c68,args:_0x25279a}=_0x5e1d5e,_0x523302=_0x5c3c68,_0x2e9974=await resolveTarget({'arg':_0x25279a[0x0],'contextParent':_0x5c3c68[_0xaaad17(0x14d)],'cwd':process[_0xaaad17(0x156)]()});if(!isSuccessfulResolution(_0x2e9974))return _0x2e9974[_0xaaad17(0x158)]===_0xaaad17(0x143)?(console[_0xaaad17(0x132)](a27_0x546b12[_0xaaad17(0x153)](_0xaaad17(0x14a))),console[_0xaaad17(0x132)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0xaaad17(0x132)](_0xaaad17(0x152)),console[_0xaaad17(0x132)](_0xaaad17(0x141))):(console['error'](a27_0x546b12[_0xaaad17(0x164)](_0xaaad17(0x154)+_0x2e9974[_0xaaad17(0x145)]+'\x0a')),_0x2e9974['helpText']&&console[_0xaaad17(0x132)](a27_0x546b12[_0xaaad17(0x16a)](_0x2e9974['helpText']))),0x1;const _0x39cb7d=_0x2e9974[_0xaaad17(0x135)],_0x328340=_0x2e9974[_0xaaad17(0x157)]===_0xaaad17(0x13a)?_0x2e9974[_0xaaad17(0x163)]:undefined;if(!_0x328340&&!existsSync(_0x39cb7d))return console['error'](a27_0x546b12[_0xaaad17(0x164)](_0xaaad17(0x139)+_0x39cb7d+'\x0a')),0x1;let _0x26849f;if(_0x328340){if(!_0x328340['endsWith'](_0xaaad17(0x14f))&&!_0x328340['endsWith'](_0xaaad17(0x14e)))return console[_0xaaad17(0x132)](a27_0x546b12['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x328340+'\x0a')),0x1;_0x26849f=[_0x328340];}else _0x26849f=findYamlFiles(_0x39cb7d);if(_0x26849f[_0xaaad17(0x14c)]===0x0)return console[_0xaaad17(0x132)](a27_0x546b12['red'](_0xaaad17(0x150)+_0x39cb7d+'\x0a')),0x1;const _0x23b027=validateYamlFiles(_0x26849f,_0x39cb7d,{'filterType':_0xaaad17(0x15a)}),_0x58338b=calculateSummary(_0x23b027),_0x422dd5=_0x23b027[_0xaaad17(0x15b)](isValidationResult);if(_0x422dd5[_0xaaad17(0x14c)]===0x0)return console[_0xaaad17(0x132)](a27_0x546b12[_0xaaad17(0x153)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x39cb7d+'\x0a')),_0x58338b[_0xaaad17(0x13b)]>0x0&&console['error'](a27_0x546b12[_0xaaad17(0x147)]('('+_0x58338b[_0xaaad17(0x13b)]+_0xaaad17(0x148))),0x0;for(const _0x5ae2ae of _0x23b027){if(!isValidationResult(_0x5ae2ae)){_0x523302[_0xaaad17(0x13f)]&&console['log'](a27_0x546b12[_0xaaad17(0x147)]('-\x20'+_0x5ae2ae[_0xaaad17(0x161)]+_0xaaad17(0x13d)+_0x5ae2ae[_0xaaad17(0x168)]+')'));continue;}const {relativePath:_0x6bce06,source:_0x3c7589,result:_0x2b4fab}=_0x5ae2ae;if(_0x2b4fab[_0xaaad17(0x15e)]&&_0x2b4fab[_0xaaad17(0x162)][_0xaaad17(0x14c)]===0x0)_0x523302[_0xaaad17(0x13f)]&&console[_0xaaad17(0x155)](a27_0x546b12[_0xaaad17(0x151)]('✔\x20'+_0x6bce06));else _0x2b4fab[_0xaaad17(0x15e)]?(console[_0xaaad17(0x155)](a27_0x546b12[_0xaaad17(0x153)]('⚠\x20'+_0x6bce06+':\x20'+_0x2b4fab['warnings'][_0xaaad17(0x14c)]+_0xaaad17(0x133))),console[_0xaaad17(0x155)](formatValidationResult(_0x2b4fab,_0x3c7589,_0x6bce06))):(console[_0xaaad17(0x155)](a27_0x546b12[_0xaaad17(0x164)]('✖\x20'+_0x6bce06+':\x20'+_0x2b4fab[_0xaaad17(0x134)][_0xaaad17(0x14c)]+_0xaaad17(0x149))),console[_0xaaad17(0x155)](formatValidationResult(_0x2b4fab,_0x3c7589,_0x6bce06)));}return console['log'](''),_0x58338b[_0xaaad17(0x15f)]?(console[_0xaaad17(0x155)](a27_0x546b12['red'](_0xaaad17(0x137)+_0x58338b[_0xaaad17(0x16b)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x58338b[_0xaaad17(0x166)]+_0xaaad17(0x167))),_0x58338b[_0xaaad17(0x138)]>0x0&&console['log'](a27_0x546b12[_0xaaad17(0x153)](_0x58338b[_0xaaad17(0x138)]+_0xaaad17(0x15d))),_0x58338b[_0xaaad17(0x13b)]>0x0&&console[_0xaaad17(0x155)](a27_0x546b12[_0xaaad17(0x147)](_0x58338b['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0xaaad17(0x155)](a27_0x546b12[_0xaaad17(0x151)](_0xaaad17(0x140)+_0x58338b[_0xaaad17(0x166)]+'\x20journey(s)\x20valid')),_0x58338b[_0xaaad17(0x138)]>0x0&&console[_0xaaad17(0x155)](a27_0x546b12[_0xaaad17(0x153)](_0x58338b[_0xaaad17(0x138)]+_0xaaad17(0x15d))),_0x58338b[_0xaaad17(0x13b)]>0x0&&console[_0xaaad17(0x155)](a27_0x546b12[_0xaaad17(0x147)](_0x58338b[_0xaaad17(0x13b)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}