@treasuredata/tdx 2026.3.7 → 2026.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-command.js.map +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.d.ts.map +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/profiles-command.js.map +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.d.ts.map +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/user-command.js.map +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.d.ts.map +1 -1
  69. package/dist/core/oauth.js +1 -1
  70. package/dist/core/oauth.js.map +1 -1
  71. package/dist/core/profile.js +1 -1
  72. package/dist/core/project-config.js +1 -1
  73. package/dist/core/session.js +1 -1
  74. package/dist/core/user-cache.js +1 -1
  75. package/dist/core/version.js +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/mcp/server.js +1 -1
  78. package/dist/mcp/tools/index.js +1 -1
  79. package/dist/mcp/tools/tdx-run.js +1 -1
  80. package/dist/mcp/tools/tdx-search.js +1 -1
  81. package/dist/mcp/utils.js +1 -1
  82. package/dist/proxy/claude-usage-tracker.js +1 -1
  83. package/dist/proxy/passthrough-server.js +1 -1
  84. package/dist/proxy/sse-usage-parser.js +1 -1
  85. package/dist/sdk/agent/agent-config.js +1 -1
  86. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  87. package/dist/sdk/agent/agent-yaml.js +1 -1
  88. package/dist/sdk/agent/test/evaluator.js +1 -1
  89. package/dist/sdk/agent/test/executor.js +1 -1
  90. package/dist/sdk/agent/test/index.js +1 -1
  91. package/dist/sdk/agent/test/output.js +1 -1
  92. package/dist/sdk/agent/test/parser.js +1 -1
  93. package/dist/sdk/agent/tool-target-registry.js +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/client/cdp-api-client.js +1 -1
  96. package/dist/sdk/client/delivery-api-client.js +1 -1
  97. package/dist/sdk/client/endpoints.js +1 -1
  98. package/dist/sdk/client/engage-api-client.js +1 -1
  99. package/dist/sdk/client/http-client.js +1 -1
  100. package/dist/sdk/client/llm-api-client.js +1 -1
  101. package/dist/sdk/client/oauth-refresh.js +1 -1
  102. package/dist/sdk/client/rate-limiter.js +1 -1
  103. package/dist/sdk/client/td-api-client.js +1 -1
  104. package/dist/sdk/client/trino-api-client.js +1 -1
  105. package/dist/sdk/client/workflow-client.js +1 -1
  106. package/dist/sdk/connection-validator.js +1 -1
  107. package/dist/sdk/connection.js +1 -1
  108. package/dist/sdk/delivery.js +1 -1
  109. package/dist/sdk/engage/campaign-pull.js +1 -1
  110. package/dist/sdk/engage/campaign-push.js +1 -1
  111. package/dist/sdk/engage/campaign-validator.js +1 -1
  112. package/dist/sdk/engage/campaign-yaml.js +1 -1
  113. package/dist/sdk/engage/template-pull.js +1 -1
  114. package/dist/sdk/engage/template-push.js +1 -1
  115. package/dist/sdk/engage/template-validator.js +1 -1
  116. package/dist/sdk/engage/template-yaml.js +1 -1
  117. package/dist/sdk/engage/types/campaign-def.js +1 -1
  118. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  119. package/dist/sdk/engage/types/template-schema.js +1 -1
  120. package/dist/sdk/engage.js +1 -1
  121. package/dist/sdk/errors.js +1 -1
  122. package/dist/sdk/index.js +1 -1
  123. package/dist/sdk/io/index.js +1 -1
  124. package/dist/sdk/io/node-filesystem.js +1 -1
  125. package/dist/sdk/job.js +1 -1
  126. package/dist/sdk/journey.js +1 -1
  127. package/dist/sdk/llm/chat-cache.js +1 -1
  128. package/dist/sdk/llm/index.js +1 -1
  129. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  130. package/dist/sdk/llm/model-factors.js +1 -1
  131. package/dist/sdk/personalization.js +1 -1
  132. package/dist/sdk/query/index.js +1 -1
  133. package/dist/sdk/query/sql-parser.js +1 -1
  134. package/dist/sdk/realtime.js +1 -1
  135. package/dist/sdk/schedule.js +1 -1
  136. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/fields-display.js +1 -1
  138. package/dist/sdk/segment/file-discovery.js +1 -1
  139. package/dist/sdk/segment/journey-utils.js +1 -1
  140. package/dist/sdk/segment/journey-validator.js +1 -1
  141. package/dist/sdk/segment/journey-yaml.js +1 -1
  142. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  143. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  144. package/dist/sdk/segment/pull-workflow.js +1 -1
  145. package/dist/sdk/segment/push-recovery.js +1 -1
  146. package/dist/sdk/segment/push-workflow.js +1 -1
  147. package/dist/sdk/segment/resolution-context.js +1 -1
  148. package/dist/sdk/segment/segment-path-parser.js +1 -1
  149. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  150. package/dist/sdk/segment/segment-validator.js +1 -1
  151. package/dist/sdk/segment/target-resolution.js +1 -1
  152. package/dist/sdk/segment/tdx-config.js +1 -1
  153. package/dist/sdk/segment/types/activation-schema.js +1 -1
  154. package/dist/sdk/segment/types/journey-def.js +1 -1
  155. package/dist/sdk/segment/types/journey-schema.js +1 -1
  156. package/dist/sdk/segment/types/segment-def.js +1 -1
  157. package/dist/sdk/segment/types/segment-schema.js +1 -1
  158. package/dist/sdk/segment/validate-files.js +1 -1
  159. package/dist/sdk/segment/yaml-validator.js +1 -1
  160. package/dist/sdk/segment.js +1 -1
  161. package/dist/sdk/types/index.js +1 -1
  162. package/dist/sdk/types/progress.js +1 -1
  163. package/dist/sdk/user.js +1 -1
  164. package/dist/sdk/util/format-detector.js +1 -1
  165. package/dist/sdk/util/formatters.js +1 -1
  166. package/dist/sdk/util/index.js +1 -1
  167. package/dist/sdk/util/paginate.js +1 -1
  168. package/dist/sdk/util/tree-formatter.js +1 -1
  169. package/dist/sdk/workflow/archive-validation.js +1 -1
  170. package/dist/sdk/workflow/clone-workflow.js +1 -1
  171. package/dist/sdk/workflow/index.js +1 -1
  172. package/dist/sdk/workflow/pull-workflow.js +1 -1
  173. package/dist/sdk/workflow/push-workflow.js +1 -1
  174. package/dist/sdk/workflow/tdx-config.js +1 -1
  175. package/dist/sdk/workflow/workflow-utils.js +1 -1
  176. package/dist/test-utils/command-runner.js +1 -1
  177. package/dist/test-utils/factories.js +1 -1
  178. package/dist/test-utils/fixtures.js +1 -1
  179. package/dist/test-utils/http-mock.js +1 -1
  180. package/dist/test-utils/index.js +1 -1
  181. package/dist/utils/async.js +1 -1
  182. package/dist/utils/colors.js +1 -1
  183. package/dist/utils/diff.js +1 -1
  184. package/dist/utils/file-permissions.js +1 -1
  185. package/dist/utils/file-reader.js +1 -1
  186. package/dist/utils/github-releases.js +1 -1
  187. package/dist/utils/global-cache.js +1 -1
  188. package/dist/utils/json-loader.js +1 -1
  189. package/dist/utils/local-cache.js +1 -1
  190. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  191. package/dist/utils/logger/formatters/index.js +1 -1
  192. package/dist/utils/logger/handlers/console-handler.js +1 -1
  193. package/dist/utils/logger/handlers/file-handler.js +1 -1
  194. package/dist/utils/logger/handlers/index.js +1 -1
  195. package/dist/utils/logger/handlers/null-handler.js +1 -1
  196. package/dist/utils/logger/index.js +1 -1
  197. package/dist/utils/logger/logger.js +1 -1
  198. package/dist/utils/logger/types.js +1 -1
  199. package/dist/utils/option-validation.js +1 -1
  200. package/dist/utils/process.js +1 -1
  201. package/dist/utils/prompt.js +1 -1
  202. package/dist/utils/spinner.js +1 -1
  203. package/dist/utils/sse-parser.js +1 -1
  204. package/dist/utils/string-utils.js +1 -1
  205. package/dist/utils/table-ref-parser.js +1 -1
  206. package/dist/utils/tdx-logger.js +1 -1
  207. package/dist/utils/version-check.js +1 -1
  208. package/package.json +1 -1
@@ -1 +1 @@
1
- const a25_0x110192=a25_0x4b68;(function(_0x3fbcfa,_0x5ab321){const _0xbdfa32=a25_0x4b68,_0x56eb79=_0x3fbcfa();while(!![]){try{const _0x40fe92=parseInt(_0xbdfa32(0x83))/0x1+parseInt(_0xbdfa32(0xc0))/0x2+parseInt(_0xbdfa32(0xb4))/0x3*(-parseInt(_0xbdfa32(0x78))/0x4)+-parseInt(_0xbdfa32(0xc5))/0x5*(parseInt(_0xbdfa32(0x93))/0x6)+-parseInt(_0xbdfa32(0xb8))/0x7+-parseInt(_0xbdfa32(0x82))/0x8+-parseInt(_0xbdfa32(0xaa))/0x9*(-parseInt(_0xbdfa32(0x98))/0xa);if(_0x40fe92===_0x5ab321)break;else _0x56eb79['push'](_0x56eb79['shift']());}catch(_0x416d85){_0x56eb79['push'](_0x56eb79['shift']());}}}(a25_0x3452,0xf3f86));function a25_0x3452(){const _0x51b083=['getTime','11752112MGHfXl','380874IqIqqL','Cancelled','error','abs','Status\x20filter:\x20','d\x20ago','file','args','job:result','length','Submitting\x20kill\x20request...','user_name','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','hive','list','m\x20ago','4068zbRnZM','Getting\x20job\x20details...','name','trino','submit','54810nOohlx','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','type','Getting\x20job\x20results...','INVALID_ARGUMENT','\x27\x20to\x20verify\x20the\x20job\x20status','now','kill','round','List\x20jobs','job:submit','presto','status','h\x20ago','...','✔\x20Retrieved\x20','url','No\x20SQL\x20statements\x20found\x20in\x20file','2367jkbtpT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','floor','execute','Kill\x20a\x20job','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','red','join','job:kill','database','237lCesJc','\x20row','jobs','limit','4231598LTIexV','Query:\x20','created_at','end_at','description','success','result','information_schema','3331236OBNKWV','query','jobType','dim','data','2355TDZjXr','Show\x20job\x20details','just\x20now','push','start_at','4852hpaMBn','site','✔\x20Job\x20submitted','Submit\x20a\x20job','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','\x20\x20Job\x20ID:\x20','verbose','Get\x20job\x20results','job_id'];a25_0x3452=function(){return _0x51b083;};return a25_0x3452();}function a25_0x4b68(_0x1c26ec,_0x4f31c0){_0x1c26ec=_0x1c26ec-0x76;const _0x345299=a25_0x3452();let _0x4b6807=_0x345299[_0x1c26ec];return _0x4b6807;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a25_0x1081a8 from'chalk';function formatDuration(_0x49d3e3){const _0x42a432=a25_0x4b68;if(_0x49d3e3<0x3c)return _0x49d3e3+'s';if(_0x49d3e3<0xe10)return Math[_0x42a432(0xac)](_0x49d3e3/0x3c)+'m\x20'+_0x49d3e3%0x3c+'s';const _0x25c9c7=Math[_0x42a432(0xac)](_0x49d3e3/0xe10),_0x42ddc2=Math['floor'](_0x49d3e3%0xe10/0x3c);return _0x42ddc2>0x0?_0x25c9c7+'h\x20'+_0x42ddc2+'m':_0x25c9c7+'h';}function formatRelativeTime(_0x2267ca){const _0x13623a=a25_0x4b68,_0x2f4f4a=Date[_0x13623a(0x9e)]()-_0x2267ca[_0x13623a(0x81)](),_0x392164=Math[_0x13623a(0xac)](Math[_0x13623a(0x86)](_0x2f4f4a)/0x3e8);if(_0x392164<0x3c)return _0x13623a(0xc7);const _0x2187a5=Math[_0x13623a(0xac)](_0x392164/0x3c);if(_0x2187a5<0x3c)return _0x2187a5+_0x13623a(0x92);const _0x3ed7ed=Math[_0x13623a(0xac)](_0x2187a5/0x3c);if(_0x3ed7ed<0x18)return _0x3ed7ed+_0x13623a(0xa5);const _0x131d4e=Math[_0x13623a(0xac)](_0x3ed7ed/0x18);if(_0x131d4e<0x1e)return _0x131d4e+_0x13623a(0x88);return Math['floor'](_0x131d4e/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a25_0x110192(0x95)]=a25_0x110192(0xb6);[a25_0x110192(0xbc)]=a25_0x110192(0xa1);async[a25_0x110192(0xad)](_0x31cd72){const _0x5659cd=a25_0x110192,{options:_0xa97de9,tdx:_0x333e7d}=_0x31cd72,_0x16af97=resolveLimit(_0xa97de9[_0x5659cd(0xb7)],DEFAULT_DISPLAY_LIMIT),_0x4b43a7=_0xa97de9['status'];_0xa97de9['verbose']&&(console[_0x5659cd(0x85)]('Limit:\x20'+_0x16af97+'\x20jobs'),_0x4b43a7&&console[_0x5659cd(0x85)](_0x5659cd(0x87)+_0x4b43a7));const _0x373e5b=await withSpinner('Listing\x20jobs...',()=>_0x333e7d['jobs'][_0x5659cd(0x91)]({'from':0x0,'to':_0x16af97-0x1,'status':_0x4b43a7}),{'verbose':_0xa97de9[_0x5659cd(0x7e)]}),_0x1d82e8=_0x373e5b[_0x5659cd(0xc4)];console['error']('✔\x20Found\x20'+_0x1d82e8['length']+'\x20job'+(_0x1d82e8['length']!==0x1?'s':''));const _0x3bf0de=_0xa97de9[_0x5659cd(0x79)];if(isStructuredFormat(_0xa97de9)){const _0x2cca94=_0x1d82e8['map'](_0x56c83e=>{const _0x285a77=_0x5659cd;let _0x1cdb1d;if(_0x56c83e['start_at']&&_0x56c83e['end_at']){const _0x6e3707=new Date(_0x56c83e[_0x285a77(0x77)])['getTime'](),_0x4c3b43=new Date(_0x56c83e[_0x285a77(0xbb)])['getTime']();_0x1cdb1d=Math[_0x285a77(0xa0)]((_0x4c3b43-_0x6e3707)/0x3e8);}return{'job_id':_0x56c83e[_0x285a77(0x80)],'type':_0x56c83e[_0x285a77(0x9a)]===_0x285a77(0xa3)?_0x285a77(0x96):_0x56c83e[_0x285a77(0x9a)],'status':_0x56c83e['status'],'user_name':_0x56c83e['user_name'],'duration_sec':_0x1cdb1d,'created_at':_0x56c83e[_0x285a77(0xba)],'started_at':_0x56c83e['start_at'],'end_at':_0x56c83e[_0x285a77(0xbb)]};});await handleSDKOutput(_0x2cca94,_0xa97de9);}else for(const _0x30e473 of _0x1d82e8){const _0x2ab949=_0x30e473[_0x5659cd(0xa4)]===_0x5659cd(0xbd)?a25_0x1081a8['green']:_0x30e473['status']===_0x5659cd(0x85)?a25_0x1081a8[_0x5659cd(0xb0)]:a25_0x1081a8[_0x5659cd(0xc3)],_0x365382=_0x2ab949(_0x30e473[_0x5659cd(0xa4)]),_0x3699c2=getJobUrl(_0x3bf0de,_0x30e473[_0x5659cd(0x80)]),_0x15648a=hyperlink(_0x30e473['job_id'],_0x3699c2),_0x37132c=a25_0x1081a8[_0x5659cd(0xc3)](_0x30e473['type']==='presto'?_0x5659cd(0x96):_0x30e473[_0x5659cd(0x9a)]),_0xc8871b=[];if(_0x30e473[_0x5659cd(0x77)]&&_0x30e473['end_at']){const _0x49e369=Math['round']((new Date(_0x30e473['end_at'])[_0x5659cd(0x81)]()-new Date(_0x30e473[_0x5659cd(0x77)])[_0x5659cd(0x81)]())/0x3e8);_0xc8871b['push'](formatDuration(_0x49e369));}if(_0x30e473[_0x5659cd(0xbb)])_0xc8871b[_0x5659cd(0x76)](formatRelativeTime(new Date(_0x30e473['end_at'])));else _0x30e473['start_at']&&_0xc8871b[_0x5659cd(0x76)](formatRelativeTime(new Date(_0x30e473[_0x5659cd(0x77)])));const _0x20478f=_0xc8871b[_0x5659cd(0x8c)]>0x0?a25_0x1081a8[_0x5659cd(0xc3)]('\x20'+_0xc8871b[_0x5659cd(0xb1)](',\x20')):'';console['log']('⚡\x20'+_0x15648a+'\x20'+_0x37132c+'\x20'+_0x365382+_0x20478f);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a25_0x110192(0x95)]='job:show';['description']=a25_0x110192(0xc6);['validate'](_0x43e3aa){const _0x580a1a=_0x43e3aa['args'][0x0];if(!_0x580a1a)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async['execute'](_0x223cf0){const _0x39cbee=a25_0x110192,{options:_0x356bb8,args:_0xbaa1ce,tdx:_0x3e4706}=_0x223cf0,_0x1f667e=_0xbaa1ce[0x0],_0x398896=await withSpinner(_0x39cbee(0x94),()=>_0x3e4706[_0x39cbee(0xb6)]['show'](_0x1f667e),{'verbose':_0x356bb8['verbose']}),_0x29f9ea=_0x398896[_0x39cbee(0xc4)];let _0x3bfb20;if(_0x29f9ea['start_at']&&_0x29f9ea[_0x39cbee(0xbb)]){const _0x2577f6=new Date(_0x29f9ea['start_at'])[_0x39cbee(0x81)](),_0x160a74=new Date(_0x29f9ea[_0x39cbee(0xbb)])[_0x39cbee(0x81)]();_0x3bfb20=Math['round']((_0x160a74-_0x2577f6)/0x3e8);}const _0x4c0761={'job_id':_0x29f9ea[_0x39cbee(0x80)],'type':_0x29f9ea[_0x39cbee(0x9a)],'status':_0x29f9ea[_0x39cbee(0xa4)],..._0x29f9ea[_0x39cbee(0x8e)]&&{'user_name':_0x29f9ea[_0x39cbee(0x8e)]},..._0x3bfb20!==undefined&&{'duration_sec':_0x3bfb20},..._0x29f9ea[_0x39cbee(0xba)]&&{'created_at':_0x29f9ea[_0x39cbee(0xba)]},..._0x29f9ea[_0x39cbee(0x77)]&&{'started_at':_0x29f9ea['start_at']},..._0x29f9ea[_0x39cbee(0xbb)]&&{'end_at':_0x29f9ea[_0x39cbee(0xbb)]},..._0x29f9ea[_0x39cbee(0xb3)]&&{'database':_0x29f9ea[_0x39cbee(0xb3)]},..._0x29f9ea['priority']!==undefined&&{'priority':_0x29f9ea['priority']},..._0x29f9ea[_0x39cbee(0xa8)]&&{'url':_0x29f9ea['url']},..._0x29f9ea[_0x39cbee(0xc1)]&&{'query':_0x29f9ea[_0x39cbee(0xc1)]},..._0x29f9ea['debug']&&{'debug':_0x29f9ea['debug']}};return await handleSingleObjectOutput(_0x4c0761,_0x356bb8),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0x110192(0x95)]=a25_0x110192(0xb2);['description']=a25_0x110192(0xae);['validate'](_0x210575){const _0x6ac45c=a25_0x110192,_0x453ea5=_0x210575[_0x6ac45c(0x8a)][0x0];if(!_0x453ea5)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a25_0x110192(0xad)](_0x450db7){const _0x206f42=a25_0x110192,{options:_0x5da2af,args:_0x131c44,tdx:_0x58eccf}=_0x450db7,_0x594a45=_0x131c44[0x0];if(!_0x5da2af['yes']){const _0x1bd9e8=await confirm(_0x206f42(0x8f)+_0x594a45+'?');if(!_0x1bd9e8)return console[_0x206f42(0x85)](_0x206f42(0x84)),0x0;}return await withSpinner(_0x206f42(0x8d),()=>_0x58eccf[_0x206f42(0xb6)][_0x206f42(0x9f)](_0x594a45),{'verbose':_0x5da2af['verbose']}),console[_0x206f42(0x85)](_0x206f42(0x99)+_0x594a45),console['error'](_0x206f42(0xaf)+_0x594a45+_0x206f42(0x9d)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a25_0x110192(0xa2);[a25_0x110192(0xbc)]=a25_0x110192(0x7b);async[a25_0x110192(0xad)](_0x547ed1){const _0x53ef8a=a25_0x110192,{options:_0x130dc1,args:_0x572830,tdx:_0x392e29}=_0x547ed1,_0x3c0322=_0x130dc1[_0x53ef8a(0xc2)]||_0x53ef8a(0x96),_0x153576=_0x130dc1[_0x53ef8a(0x89)],_0x5c3041=_0x130dc1[_0x53ef8a(0xb3)]||_0x53ef8a(0xbf),_0x4d8b40=_0x130dc1[_0x53ef8a(0xbe)];if(_0x3c0322!=='trino'&&_0x3c0322!==_0x53ef8a(0x90))throw new SDKError(ErrorCode[_0x53ef8a(0x9c)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x377483;if(_0x153576){if(_0x572830[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x53ef8a(0x7c));const _0xfd07fd=readSqlStatementsFromFile(_0x153576);if(_0xfd07fd['length']===0x0)throw new SDKError(ErrorCode[_0x53ef8a(0x9c)],_0x53ef8a(0xa9));if(_0xfd07fd[_0x53ef8a(0x8c)]>0x1)throw new SDKError(ErrorCode[_0x53ef8a(0x9c)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x377483=_0xfd07fd[0x0];}else{if(!_0x572830[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x377483=_0x572830[0x0];}_0x130dc1[_0x53ef8a(0x7e)]&&(console['error']('Job\x20type:\x20'+_0x3c0322),console['error']('Database:\x20'+_0x5c3041),console[_0x53ef8a(0x85)](_0x53ef8a(0xb9)+_0x377483['substring'](0x0,0x64)+(_0x377483['length']>0x64?_0x53ef8a(0xa6):'')));const _0x298b9b=await withSpinner('Submitting\x20job...',()=>_0x392e29[_0x53ef8a(0xb6)][_0x53ef8a(0x97)](_0x5c3041,_0x377483,_0x3c0322,_0x4d8b40),{'verbose':_0x130dc1['verbose']}),_0x2f2f75=_0x298b9b[_0x53ef8a(0xc4)];return console['error'](_0x53ef8a(0x7a)),console['error'](_0x53ef8a(0x7d)+_0x2f2f75[_0x53ef8a(0x80)]),await handleSDKOutput([_0x2f2f75],_0x130dc1),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x110192(0x95)]=a25_0x110192(0x8b);[a25_0x110192(0xbc)]=a25_0x110192(0x7f);['validate'](_0x57411b){const _0x81f99e=a25_0x110192,_0x515c29=_0x57411b[_0x81f99e(0x8a)][0x0];if(!_0x515c29)return _0x81f99e(0xab);return undefined;}async[a25_0x110192(0xad)](_0x5a1e27){const _0x52801b=a25_0x110192,{options:_0x3dd75a,args:_0x206536,tdx:_0x29fbe3}=_0x5a1e27,_0x19521f=_0x206536[0x0],_0x4d4535=await withSpinner(_0x52801b(0x9b),()=>_0x29fbe3[_0x52801b(0xb6)]['result'](_0x19521f),{'verbose':_0x3dd75a[_0x52801b(0x7e)]}),_0xabb5ea=_0x4d4535['data'];return console['error'](_0x52801b(0xa7)+_0xabb5ea[_0x52801b(0x8c)]+_0x52801b(0xb5)+(_0xabb5ea['length']!==0x1?'s':'')),await handleSDKOutput(_0xabb5ea,_0x3dd75a),0x0;}}
1
+ const a25_0x51f3e5=a25_0x33a9;(function(_0x1339e7,_0x339d49){const _0x525b43=a25_0x33a9,_0x38bf73=_0x1339e7();while(!![]){try{const _0x56580e=-parseInt(_0x525b43(0x15d))/0x1+-parseInt(_0x525b43(0x193))/0x2+parseInt(_0x525b43(0x16f))/0x3+parseInt(_0x525b43(0x172))/0x4*(parseInt(_0x525b43(0x194))/0x5)+-parseInt(_0x525b43(0x1a3))/0x6+-parseInt(_0x525b43(0x160))/0x7*(parseInt(_0x525b43(0x183))/0x8)+parseInt(_0x525b43(0x155))/0x9;if(_0x56580e===_0x339d49)break;else _0x38bf73['push'](_0x38bf73['shift']());}catch(_0x1ca123){_0x38bf73['push'](_0x38bf73['shift']());}}}(a25_0x4dbf,0x4c8b8));import{BaseCommand}from'./command.js';function a25_0x33a9(_0x2df598,_0x5f5b62){_0x2df598=_0x2df598-0x14e;const _0x4dbf04=a25_0x4dbf();let _0x33a902=_0x4dbf04[_0x2df598];return _0x33a902;}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a25_0x167475 from'chalk';function formatDuration(_0x5b2017){const _0x4ba5dc=a25_0x33a9;if(_0x5b2017<0x3c)return _0x5b2017+'s';if(_0x5b2017<0xe10)return Math[_0x4ba5dc(0x18c)](_0x5b2017/0x3c)+'m\x20'+_0x5b2017%0x3c+'s';const _0x56c7e7=Math[_0x4ba5dc(0x18c)](_0x5b2017/0xe10),_0x40307a=Math[_0x4ba5dc(0x18c)](_0x5b2017%0xe10/0x3c);return _0x40307a>0x0?_0x56c7e7+'h\x20'+_0x40307a+'m':_0x56c7e7+'h';}function formatRelativeTime(_0xf00b5e){const _0x401069=a25_0x33a9,_0x9b7301=Date[_0x401069(0x167)]()-_0xf00b5e[_0x401069(0x166)](),_0x5823b6=Math[_0x401069(0x18c)](Math[_0x401069(0x17f)](_0x9b7301)/0x3e8);if(_0x5823b6<0x3c)return _0x401069(0x164);const _0x130352=Math[_0x401069(0x18c)](_0x5823b6/0x3c);if(_0x130352<0x3c)return _0x130352+_0x401069(0x18e);const _0x182305=Math[_0x401069(0x18c)](_0x130352/0x3c);if(_0x182305<0x18)return _0x182305+_0x401069(0x150);const _0xcb0e3d=Math[_0x401069(0x18c)](_0x182305/0x18);if(_0xcb0e3d<0x1e)return _0xcb0e3d+_0x401069(0x157);return Math[_0x401069(0x18c)](_0xcb0e3d/0x1e)+_0x401069(0x1a6);}export class JobListCommand extends BaseCommand{[a25_0x51f3e5(0x19b)]=a25_0x51f3e5(0x15a);[a25_0x51f3e5(0x186)]=a25_0x51f3e5(0x14f);async[a25_0x51f3e5(0x179)](_0x13003f){const _0x25c9fd=a25_0x51f3e5,{options:_0x3d238f,tdx:_0x2fe8d1}=_0x13003f,_0x189fb1=resolveLimit(_0x3d238f[_0x25c9fd(0x181)],DEFAULT_DISPLAY_LIMIT),_0x259772=_0x3d238f[_0x25c9fd(0x19f)];_0x3d238f['verbose']&&(console[_0x25c9fd(0x173)](_0x25c9fd(0x1a7)+_0x189fb1+_0x25c9fd(0x16e)),_0x259772&&console['error'](_0x25c9fd(0x19a)+_0x259772));const _0x5c119e=await withSpinner(_0x25c9fd(0x1a0),()=>_0x2fe8d1[_0x25c9fd(0x15a)][_0x25c9fd(0x19c)]({'from':0x0,'to':_0x189fb1-0x1,'status':_0x259772}),{'verbose':_0x3d238f['verbose']}),_0x4337a6=_0x5c119e[_0x25c9fd(0x19d)];console['error']('✔\x20Found\x20'+_0x4337a6[_0x25c9fd(0x15c)]+_0x25c9fd(0x168)+(_0x4337a6[_0x25c9fd(0x15c)]!==0x1?'s':''));const _0x33361f=_0x3d238f[_0x25c9fd(0x17a)];if(isStructuredFormat(_0x3d238f)){const _0x4842ac=_0x4337a6[_0x25c9fd(0x16b)](_0x2250b0=>{const _0x2dc924=_0x25c9fd;let _0x14d1f3;if(_0x2250b0[_0x2dc924(0x15e)]&&_0x2250b0[_0x2dc924(0x180)]){const _0x5319b6=new Date(_0x2250b0[_0x2dc924(0x15e)])[_0x2dc924(0x166)](),_0x52a94e=new Date(_0x2250b0['end_at'])[_0x2dc924(0x166)]();_0x14d1f3=Math[_0x2dc924(0x161)]((_0x52a94e-_0x5319b6)/0x3e8);}return{'job_id':_0x2250b0['job_id'],'type':_0x2250b0[_0x2dc924(0x1a2)]===_0x2dc924(0x169)?_0x2dc924(0x16d):_0x2250b0['type'],'status':_0x2250b0[_0x2dc924(0x19f)],'user_name':_0x2250b0['user_name'],'duration_sec':_0x14d1f3,'created_at':_0x2250b0[_0x2dc924(0x17e)],'started_at':_0x2250b0[_0x2dc924(0x15e)],'end_at':_0x2250b0[_0x2dc924(0x180)]};});await handleSDKOutput(_0x4842ac,_0x3d238f);}else for(const _0x3f6f10 of _0x4337a6){const _0x4c8411=_0x3f6f10[_0x25c9fd(0x19f)]==='success'?a25_0x167475[_0x25c9fd(0x196)]:_0x3f6f10['status']==='error'?a25_0x167475['red']:a25_0x167475['dim'],_0xb78830=_0x4c8411(_0x3f6f10[_0x25c9fd(0x19f)]),_0x56bb86=getJobUrl(_0x33361f,_0x3f6f10[_0x25c9fd(0x16a)]),_0x2ee65a=hyperlink(_0x3f6f10[_0x25c9fd(0x16a)],_0x56bb86),_0xa25ce6=a25_0x167475[_0x25c9fd(0x18a)](_0x3f6f10[_0x25c9fd(0x1a2)]===_0x25c9fd(0x169)?_0x25c9fd(0x16d):_0x3f6f10[_0x25c9fd(0x1a2)]),_0x3c4417=[];if(_0x3f6f10[_0x25c9fd(0x15e)]&&_0x3f6f10[_0x25c9fd(0x180)]){const _0x2799ce=Math[_0x25c9fd(0x161)]((new Date(_0x3f6f10[_0x25c9fd(0x180)])[_0x25c9fd(0x166)]()-new Date(_0x3f6f10[_0x25c9fd(0x15e)])[_0x25c9fd(0x166)]())/0x3e8);_0x3c4417[_0x25c9fd(0x171)](formatDuration(_0x2799ce));}if(_0x3f6f10[_0x25c9fd(0x180)])_0x3c4417[_0x25c9fd(0x171)](formatRelativeTime(new Date(_0x3f6f10[_0x25c9fd(0x180)])));else _0x3f6f10['start_at']&&_0x3c4417[_0x25c9fd(0x171)](formatRelativeTime(new Date(_0x3f6f10[_0x25c9fd(0x15e)])));const _0x3275ac=_0x3c4417[_0x25c9fd(0x15c)]>0x0?a25_0x167475[_0x25c9fd(0x18a)]('\x20'+_0x3c4417[_0x25c9fd(0x174)](',\x20')):'';console[_0x25c9fd(0x17d)]('⚡\x20'+_0x2ee65a+'\x20'+_0xa25ce6+'\x20'+_0xb78830+_0x3275ac);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a25_0x51f3e5(0x191);[a25_0x51f3e5(0x186)]='Show\x20job\x20details';[a25_0x51f3e5(0x178)](_0x689102){const _0x49c4fb=a25_0x51f3e5,_0x436a0c=_0x689102[_0x49c4fb(0x153)][0x0];if(!_0x436a0c)return _0x49c4fb(0x1a5);return undefined;}async[a25_0x51f3e5(0x179)](_0x96e13e){const _0x23c54a=a25_0x51f3e5,{options:_0x2ef999,args:_0x39dcd8,tdx:_0x1377de}=_0x96e13e,_0x3cfe38=_0x39dcd8[0x0],_0x25c22d=await withSpinner(_0x23c54a(0x185),()=>_0x1377de[_0x23c54a(0x15a)]['show'](_0x3cfe38),{'verbose':_0x2ef999['verbose']}),_0x11f05=_0x25c22d['data'];let _0x400cc3;if(_0x11f05['start_at']&&_0x11f05[_0x23c54a(0x180)]){const _0xbf1982=new Date(_0x11f05[_0x23c54a(0x15e)])[_0x23c54a(0x166)](),_0x55dc78=new Date(_0x11f05['end_at'])[_0x23c54a(0x166)]();_0x400cc3=Math[_0x23c54a(0x161)]((_0x55dc78-_0xbf1982)/0x3e8);}const _0x1ca84e={'job_id':_0x11f05[_0x23c54a(0x16a)],'type':_0x11f05[_0x23c54a(0x1a2)],'status':_0x11f05[_0x23c54a(0x19f)],..._0x11f05[_0x23c54a(0x162)]&&{'user_name':_0x11f05[_0x23c54a(0x162)]},..._0x400cc3!==undefined&&{'duration_sec':_0x400cc3},..._0x11f05[_0x23c54a(0x17e)]&&{'created_at':_0x11f05['created_at']},..._0x11f05[_0x23c54a(0x15e)]&&{'started_at':_0x11f05['start_at']},..._0x11f05[_0x23c54a(0x180)]&&{'end_at':_0x11f05[_0x23c54a(0x180)]},..._0x11f05[_0x23c54a(0x158)]&&{'database':_0x11f05[_0x23c54a(0x158)]},..._0x11f05['priority']!==undefined&&{'priority':_0x11f05[_0x23c54a(0x195)]},..._0x11f05[_0x23c54a(0x159)]&&{'url':_0x11f05[_0x23c54a(0x159)]},..._0x11f05['query']&&{'query':_0x11f05[_0x23c54a(0x18f)]},..._0x11f05['debug']&&{'debug':_0x11f05[_0x23c54a(0x190)]}};return await handleSingleObjectOutput(_0x1ca84e,_0x2ef999),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0x51f3e5(0x19b)]='job:kill';[a25_0x51f3e5(0x186)]=a25_0x51f3e5(0x170);[a25_0x51f3e5(0x178)](_0x2baa6f){const _0x2ca47b=a25_0x51f3e5,_0x1a3d3a=_0x2baa6f['args'][0x0];if(!_0x1a3d3a)return _0x2ca47b(0x18d);return undefined;}async[a25_0x51f3e5(0x179)](_0xca811d){const _0x1a0772=a25_0x51f3e5,{options:_0x524005,args:_0x207329,tdx:_0x2b58d1}=_0xca811d,_0x4b98d3=_0x207329[0x0];if(!_0x524005[_0x1a0772(0x151)]){const _0x4288e7=await confirm(_0x1a0772(0x177)+_0x4b98d3+'?');if(!_0x4288e7)return console['error'](_0x1a0772(0x184)),0x0;}return await withSpinner(_0x1a0772(0x17c),()=>_0x2b58d1[_0x1a0772(0x15a)][_0x1a0772(0x176)](_0x4b98d3),{'verbose':_0x524005[_0x1a0772(0x152)]}),console[_0x1a0772(0x173)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x4b98d3),console[_0x1a0772(0x173)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x4b98d3+_0x1a0772(0x17b)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a25_0x51f3e5(0x186)]='Submit\x20a\x20job';async[a25_0x51f3e5(0x179)](_0x112c20){const _0x29d1f0=a25_0x51f3e5,{options:_0x5f2be1,args:_0x27431d,tdx:_0x5ed8b0}=_0x112c20,_0x567157=_0x5f2be1[_0x29d1f0(0x15b)]||_0x29d1f0(0x16d),_0x3d2d76=_0x5f2be1['file'],_0x59d8ef=_0x5f2be1['database']||_0x29d1f0(0x1a4),_0x4660a9=_0x5f2be1['result'];if(_0x567157!==_0x29d1f0(0x16d)&&_0x567157!==_0x29d1f0(0x199))throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],_0x29d1f0(0x16c));let _0x12ce12;if(_0x3d2d76){if(_0x27431d[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x29d1f0(0x156));const _0x1e6e22=readSqlStatementsFromFile(_0x3d2d76);if(_0x1e6e22[_0x29d1f0(0x15c)]===0x0)throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],_0x29d1f0(0x192));if(_0x1e6e22[_0x29d1f0(0x15c)]>0x1)throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x12ce12=_0x1e6e22[0x0];}else{if(!_0x27431d[0x0])throw new SDKError(ErrorCode[_0x29d1f0(0x14e)],_0x29d1f0(0x187));_0x12ce12=_0x27431d[0x0];}_0x5f2be1[_0x29d1f0(0x152)]&&(console[_0x29d1f0(0x173)](_0x29d1f0(0x1a1)+_0x567157),console[_0x29d1f0(0x173)](_0x29d1f0(0x15f)+_0x59d8ef),console['error'](_0x29d1f0(0x175)+_0x12ce12[_0x29d1f0(0x165)](0x0,0x64)+(_0x12ce12[_0x29d1f0(0x15c)]>0x64?'...':'')));const _0x3ed056=await withSpinner('Submitting\x20job...',()=>_0x5ed8b0['jobs'][_0x29d1f0(0x198)](_0x59d8ef,_0x12ce12,_0x567157,_0x4660a9),{'verbose':_0x5f2be1[_0x29d1f0(0x152)]}),_0x435f20=_0x3ed056[_0x29d1f0(0x19d)];return console[_0x29d1f0(0x173)](_0x29d1f0(0x197)),console[_0x29d1f0(0x173)](_0x29d1f0(0x163)+_0x435f20[_0x29d1f0(0x16a)]),await handleSDKOutput([_0x435f20],_0x5f2be1),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x51f3e5(0x19b)]=a25_0x51f3e5(0x182);[a25_0x51f3e5(0x186)]=a25_0x51f3e5(0x189);['validate'](_0x28042a){const _0x34c0ed=a25_0x51f3e5,_0x5ed053=_0x28042a['args'][0x0];if(!_0x5ed053)return _0x34c0ed(0x188);return undefined;}async['execute'](_0x27a57a){const _0x1efd24=a25_0x51f3e5,{options:_0x422fe3,args:_0x5d8cd1,tdx:_0x3ab41b}=_0x27a57a,_0x4678a2=_0x5d8cd1[0x0],_0x1b15d8=await withSpinner('Getting\x20job\x20results...',()=>_0x3ab41b[_0x1efd24(0x15a)][_0x1efd24(0x19e)](_0x4678a2),{'verbose':_0x422fe3[_0x1efd24(0x152)]}),_0x599b1a=_0x1b15d8[_0x1efd24(0x19d)];return console['error'](_0x1efd24(0x154)+_0x599b1a['length']+_0x1efd24(0x18b)+(_0x599b1a[_0x1efd24(0x15c)]!==0x1?'s':'')),await handleSDKOutput(_0x599b1a,_0x422fe3),0x0;}}function a25_0x4dbf(){const _0x18b077=['presto','job_id','map','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','trino','\x20jobs','1804131mChaIM','Kill\x20a\x20job','push','344OIClYL','error','join','Query:\x20','kill','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','validate','execute','site','\x27\x20to\x20verify\x20the\x20job\x20status','Submitting\x20kill\x20request...','log','created_at','abs','end_at','limit','job:result','2904npjMgt','Cancelled','Getting\x20job\x20details...','description','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Get\x20job\x20results','dim','\x20row','floor','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','m\x20ago','query','debug','job:show','No\x20SQL\x20statements\x20found\x20in\x20file','919178rkVWNG','9810NkJZhj','priority','green','✔\x20Job\x20submitted','submit','hive','Status\x20filter:\x20','name','list','data','result','status','Listing\x20jobs...','Job\x20type:\x20','type','2816340slVGWY','information_schema','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','mo\x20ago','Limit:\x20','INVALID_ARGUMENT','List\x20jobs','h\x20ago','yes','verbose','args','✔\x20Retrieved\x20','7006806HUsUif','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','d\x20ago','database','url','jobs','jobType','length','169285bYIzeb','start_at','Database:\x20','2639GYaKwI','round','user_name','\x20\x20Job\x20ID:\x20','just\x20now','substring','getTime','now','\x20job'];a25_0x4dbf=function(){return _0x18b077;};return a25_0x4dbf();}
@@ -1 +1 @@
1
- const a26_0x40e223=a26_0x2132;(function(_0x42b1ba,_0x14513e){const _0x94b29e=a26_0x2132,_0x4a860a=_0x42b1ba();while(!![]){try{const _0x3d848b=-parseInt(_0x94b29e(0x1b4))/0x1*(-parseInt(_0x94b29e(0x1d4))/0x2)+-parseInt(_0x94b29e(0x1dc))/0x3+parseInt(_0x94b29e(0x23d))/0x4*(parseInt(_0x94b29e(0x18b))/0x5)+parseInt(_0x94b29e(0x223))/0x6*(-parseInt(_0x94b29e(0x157))/0x7)+-parseInt(_0x94b29e(0x24f))/0x8*(parseInt(_0x94b29e(0x225))/0x9)+-parseInt(_0x94b29e(0x252))/0xa*(-parseInt(_0x94b29e(0x21c))/0xb)+-parseInt(_0x94b29e(0x227))/0xc*(-parseInt(_0x94b29e(0x21e))/0xd);if(_0x3d848b===_0x14513e)break;else _0x4a860a['push'](_0x4a860a['shift']());}catch(_0x2239ca){_0x4a860a['push'](_0x4a860a['shift']());}}}(a26_0x4376,0x63101));import a26_0x1e1b3b from'chalk';import a26_0x2b0df9 from'path';function a26_0x4376(){const _0x27d4ac=['Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','verbose','Resolving\x20parent\x20segment...','journey:columns','activation','\x20\x20Journey\x20ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Listing\x20journey\x20versions...','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Getting\x20journey\x20statistics...','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','localeCompare','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Folder\x20path:\x20','Resolved\x20YAML\x20file:\x20','Resuming\x20journey...','map','filePath','✔\x20Pulled\x20','segmentPushCommand','listVersions','Journey\x20name:\x20','parent_segment','Target\x20file:\x20','List\x20activations\x20for\x20a\x20journey','red','(draft)','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','version','error','archived','Fetching\x20users\x20and\x20connections...','setPhase','rootFolderId','getParentFull','getTrafficData','\x0aPull\x20summary:','\x0aError:','\x20new\x20files','Pattern:\x20','listJourneysWithFolders','size','values','paused','Found\x20','state','\x20\x20Target:\x20','all','Fetching\x20','\x20Created\x20v','listActivationsFlat','toLowerCase','stages','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Show\x20journey\x20details','Parent\x20segment:\x20','web','buildIdToNameMap','11ZuNlsN','journeyBundleId','21853cXJabO','\x20=\x20','session','\x20\x20Folder\x20path:\x20','\x20journey','560238iDBPrw','hasPeriod','18hqAzmQ','stage','1476ojIEMT','\x20\x20Parent\x20segment:\x20','Cancelled','getJourney','audienceId','/app/ps/','database','Getting\x20version\x20','(archived)','get','add','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','journey:pause','Listing\x20journeys...','\x20->\x20','journey:resume','Show\x20journey\x20table\x20column\x20mapping','includeStats','\x22\x20resumed','(root)','type','Error:\x20Invalid\x20--type\x20\x22','60VcbfGl','\x20journey\x20files\x20to\x20','journey:push','\x20details...','cyan','.yml','data','log','\x20(rule\x20match)','yes','exitOrJumpSize','Input:\x20','renderStats','journey','has','json','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','activationParams','1210032zIwpef','split','List\x20all\x20versions\x20of\x20a\x20journey','2442320qRujJF','attributes','tdx.json','nodes','/j/da/je','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','execute','yellow','getColumnMapping','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','set','Error:\x20--version\x20option\x20is\x20required','reentryMode','journey:traffic','helpText','Write\x20','\x20\x20Name:\x20','journey:version:create','utf-8','35seXqgS','View\x20a\x20specific\x20version\x20of\x20a\x20journey','kind','folderPath','List\x20journeys\x20in\x20current\x20context','journey:version:view','launched','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Show\x20journey\x20statistics','join','(running)','journey:pull','columns','Warning:\x20Could\x20not\x20resolve\x20segment\x20','sort','filter','segment','completeMilestoneRate','\x20files?','replace','includeHistory','parentName','Resolving\x20journey...','Error:\x20Invalid\x20version\x20number:\x20','args','dryRun','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Pause\x20a\x20running\x20journey','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','listFolders','Creating\x20new\x20version...','rule','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Error:\x20Journey\x20\x27','cwd','goal','\x27\x20not\x20found\x20in\x20','versionNumber','(paused)','\x20journeys','description','push','\x20Opening\x20','conversion','Fetching\x20journeys\x20and\x20folders...','journeyBundleName','journeyStages','Error:\x20Version\x20','261270pDqeza','Pausing\x20journey...','length','journeyName','\x20activation','enteredSize','connector_config','updatedAt','/e/','(completed)','Database:\x20','blue','listJourneysFromParentSegment','then','dim','resolveParentId','Getting\x20column\x20mapping...','site','folderId','table','getStatistics','base','test','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','root\x20folder','jsonl','\x20not\x20found.\x20Available:\x20','options','hasChanges','message','INVALID_ARGUMENT','segmentName',',\x20version:\x20','journey:view','completed','getSegment','\x22\x20paused','\x20\x20-\x20','No\x20journeys\x20found','✔\x20Context\x20set:\x20','completionRate','141359eWpAHd','tsv','activation_','createdAt','\x20(ID:\x20','green','exitOrJumpRate','resourceName','targetDir','Target\x20directory:\x20','history','pause','bold','repeat','file','/j/da','links','connection','format','entries','resolveJourneyId','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Export\x20journey(s)\x20as\x20YAML\x20files','milestoneSize','isNew','\x5c$&','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parentSegment','\x20version','diff','folders','Fetching\x20parent\x20segment...','2qiGoBF','journeys','Error:\x20','journeyId','createVersion','No\x20statistics\x20available\x20for\x20journey:\x20','find','✔\x20Journey\x20\x22','603090DxpLlt','Options:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'];a26_0x4376=function(){return _0x27d4ac;};return a26_0x4376();}function a26_0x2132(_0x10d3d3,_0x33fc33){_0x10d3d3=_0x10d3d3-0x146;const _0x4376cd=a26_0x4376();let _0x213297=_0x4376cd[_0x10d3d3];return _0x213297;}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(_0x244843){const _0x90e109=a26_0x2132;return!_0x244843&&(console[_0x90e109(0x1fe)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x90e109(0x1fe)](_0x90e109(0x1a2))),!!_0x244843;}function withJsonFormat(_0x523807){const _0x17cc93=a26_0x2132;if(!_0x523807[_0x17cc93(0x1c6)]&&!_0x523807[_0x17cc93(0x24c)]&&!_0x523807['jsonl']&&!_0x523807[_0x17cc93(0x1b5)])return{..._0x523807,'format':'json','json':!![]};return _0x523807;}function formatJourneyState(_0x4c7dc2){const _0x2c11b0=a26_0x2132;switch(_0x4c7dc2){case _0x2c11b0(0x15d):return a26_0x1e1b3b[_0x2c11b0(0x1b9)](_0x2c11b0(0x163));case'draft':return a26_0x1e1b3b[_0x2c11b0(0x199)](_0x2c11b0(0x1fb));case _0x2c11b0(0x20c):return a26_0x1e1b3b[_0x2c11b0(0x14b)](_0x2c11b0(0x181));case _0x2c11b0(0x1ad):return a26_0x1e1b3b[_0x2c11b0(0x196)](_0x2c11b0(0x194));case _0x2c11b0(0x1ff):return a26_0x1e1b3b[_0x2c11b0(0x199)](_0x2c11b0(0x22f));default:return'('+_0x4c7dc2+')';}}function formatJourneyItem(_0x5ee1b5,_0x48e408='',_0x47b2d6){const _0x428801=a26_0x2132,_0x555625=formatJourneyState(_0x5ee1b5[_0x428801(0x20e)]),_0x226139=_0x47b2d6?hyperlink(_0x5ee1b5['journeyBundleName'],_0x47b2d6):_0x5ee1b5[_0x428801(0x188)];return _0x48e408+'🗺️\x20'+_0x226139+'\x20'+_0x555625;}function escapeRegex(_0x59ac24){const _0x279f7e=a26_0x2132;return _0x59ac24[_0x279f7e(0x16c)](/[.*+?^${}()|[\]\\]/g,_0x279f7e(0x1cd));}function globToRegex(_0x47e511){const _0x3b7b76=a26_0x2132,_0xb80b55=_0x47e511[_0x3b7b76(0x250)]('*')[_0x3b7b76(0x1f1)](escapeRegex);return new RegExp(_0xb80b55['join']('.*'),'i');}function buildRuleToNameMapping(_0x2e72be){const _0x11ba9e=a26_0x2132,_0x28b773=new Map();if(_0x2e72be['segments'])for(const [_0x5b6255,_0x1a6e71]of Object['entries'](_0x2e72be['segments'])){if(_0x1a6e71[_0x11ba9e(0x178)]){const _0x457612=serializeRule(_0x1a6e71['rule']),_0x5f3794=_0x28b773[_0x11ba9e(0x230)](_0x457612);_0x5f3794?_0x5f3794[_0x11ba9e(0x184)](_0x5b6255):_0x28b773[_0x11ba9e(0x14e)](_0x457612,[_0x5b6255]);}}return _0x28b773;}async function resolveJourneyIdFromInput(_0x2cffd6,_0xf4f2f3,_0x40ae24){const _0x20693e=a26_0x2132,_0x358a89=await resolveJourneyTarget(_0x2cffd6,_0xf4f2f3[_0x20693e(0x1cf)],_0xf4f2f3['verbose']),_0x3eec34=_0x358a89[_0x20693e(0x1cf)];if(!_0x3eec34)throw new SDKError(ErrorCode[_0x20693e(0x1a9)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x384171=await withSpinner(_0x20693e(0x1e2),()=>_0x40ae24[_0x20693e(0x169)][_0x20693e(0x19a)](_0x3eec34),{'verbose':_0xf4f2f3[_0x20693e(0x1e1)]}),_0x59d05b=_0x384171[_0x20693e(0x243)],_0x1e0089=await withSpinner(_0x20693e(0x16f),()=>_0x40ae24[_0x20693e(0x24a)][_0x20693e(0x1c8)](_0x59d05b,_0x358a89[_0x20693e(0x18e)]),{'verbose':_0xf4f2f3[_0x20693e(0x1e1)]});return{'journeyId':_0x1e0089['data'],'journeyName':_0x358a89[_0x20693e(0x18e)],'parentSegmentId':_0x59d05b};}async function resolveJourneyTarget(_0x217eac,_0x2cfdbf,_0x208c48){const _0xfd6ff6=a26_0x2132;if(isYamlFilePath(_0x217eac))try{const _0x23e2d4=await resolveYamlFilePath(_0x217eac);return _0x208c48&&(console[_0xfd6ff6(0x1fe)](_0xfd6ff6(0x1ef)+_0x217eac),console['error'](_0xfd6ff6(0x228)+_0x23e2d4[_0xfd6ff6(0x1cf)]),console[_0xfd6ff6(0x1fe)](_0xfd6ff6(0x154)+_0x23e2d4['segmentName']),console[_0xfd6ff6(0x1fe)](_0xfd6ff6(0x221)+(_0x23e2d4[_0xfd6ff6(0x15a)]||'(root)'))),{'journeyName':_0x23e2d4[_0xfd6ff6(0x1aa)],'parentSegment':_0x23e2d4[_0xfd6ff6(0x1cf)],'resolved':_0x23e2d4};}catch(_0x486a30){throw new SDKError(ErrorCode[_0xfd6ff6(0x1a9)],_0xfd6ff6(0x1fc)+_0x486a30[_0xfd6ff6(0x1a8)]);}if(!_0x2cfdbf)throw new SDKError(ErrorCode[_0xfd6ff6(0x1a9)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x217eac,'parentSegment':_0x2cfdbf};}export class JourneyListCommand extends BaseCommand{[a26_0x40e223(0x179)]='journey:list';[a26_0x40e223(0x183)]=a26_0x40e223(0x15b);async[a26_0x40e223(0x14a)](_0x35bf70){const _0x4c67df=a26_0x40e223,{options:_0x49e32e,args:_0x27bb71,tdx:_0x59ce9f}=_0x35bf70,_0x445d1f=_0x27bb71[0x0],_0x113923=_0x49e32e[_0x4c67df(0x1cf)];if(!_0x113923)return console['error']('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x4c67df(0x1fe)](_0x4c67df(0x173)),0x1;const _0xdd34de=await withSpinner(_0x4c67df(0x1e2),()=>_0x59ce9f[_0x4c67df(0x169)][_0x4c67df(0x19a)](_0x113923),{'verbose':_0x49e32e[_0x4c67df(0x1e1)]}),_0xdc3fa4=_0xdd34de[_0x4c67df(0x243)];_0x49e32e[_0x4c67df(0x1e1)]&&(console[_0x4c67df(0x1fe)]('Parent\x20segment:\x20'+_0x113923+_0x4c67df(0x1b8)+_0xdc3fa4+')'),_0x445d1f&&console[_0x4c67df(0x1fe)](_0x4c67df(0x208)+_0x445d1f));const _0x52a283=await withSpinner(_0x4c67df(0x1d3),()=>_0x59ce9f[_0x4c67df(0x169)][_0x4c67df(0x203)](_0xdc3fa4),{'verbose':_0x49e32e['verbose']}),_0x55f81a=_0x52a283[_0x4c67df(0x243)],_0x38948f=_0x55f81a[_0x4c67df(0x202)],_0x17e7e6=await withSpinner(_0x4c67df(0x234),()=>_0x59ce9f['journey'][_0x4c67df(0x209)](_0xdc3fa4,_0x38948f),{'verbose':_0x49e32e['verbose']});let _0x1ff29e=_0x17e7e6[_0x4c67df(0x243)][_0x4c67df(0x1d5)];const _0xccd0b6=_0x17e7e6[_0x4c67df(0x243)][_0x4c67df(0x1d2)],_0x173749=new Map();for(const _0x342f1e of _0xccd0b6){_0x173749[_0x4c67df(0x14e)](_0x342f1e['id'],_0x342f1e[_0x4c67df(0x179)]);}if(_0x445d1f){const _0x1a3786=globToRegex(_0x445d1f);_0x1ff29e=_0x1ff29e['filter'](_0x245ba6=>_0x1a3786[_0x4c67df(0x1a1)](_0x245ba6[_0x4c67df(0x188)]));}console[_0x4c67df(0x1fe)]('✔\x20Found\x20'+_0x1ff29e[_0x4c67df(0x18d)]+_0x4c67df(0x222)+(_0x1ff29e[_0x4c67df(0x18d)]!==0x1?'s':''));const _0x5ed898=_0x5c5aa7=>{const _0x4c6510=_0x4c67df;return getConsoleNextUrl(_0x49e32e['site'],_0x4c6510(0x22c)+_0xdc3fa4+_0x4c6510(0x193)+_0x5c5aa7+_0x4c6510(0x1c3));};if(_0x49e32e[_0x4c67df(0x1c6)]==='table')await handleSDKOutput(_0x1ff29e,_0x49e32e);else{if(_0x49e32e[_0x4c67df(0x1c6)]===_0x4c67df(0x24c)){const _0x267919=_0x1ff29e[_0x4c67df(0x1f1)](_0x3bc263=>({..._0x3bc263,'url':_0x5ed898(_0x3bc263['id'])}));await handleSDKOutput(_0x267919,_0x49e32e);}else{console[_0x4c67df(0x244)]('['+_0x113923+']');const _0x2f5b6d=new Map(),_0x445d3b=[];for(const _0x3eb338 of _0x1ff29e){if(!_0x3eb338[_0x4c67df(0x19d)]||_0x3eb338['folderId']===_0x38948f)_0x445d3b[_0x4c67df(0x184)](_0x3eb338);else{const _0x230a46=_0x2f5b6d[_0x4c67df(0x230)](_0x3eb338[_0x4c67df(0x19d)])||[];_0x230a46[_0x4c67df(0x184)](_0x3eb338),_0x2f5b6d[_0x4c67df(0x14e)](_0x3eb338[_0x4c67df(0x19d)],_0x230a46);}}const _0x599edc=(_0x1388fd,_0x40a499)=>_0x1388fd['journeyBundleName'][_0x4c67df(0x1ec)](_0x40a499['journeyBundleName'],undefined,{'sensitivity':_0x4c67df(0x1a0)});_0x445d3b[_0x4c67df(0x167)](_0x599edc);for(const _0x12b9d3 of _0x445d3b){console['log'](formatJourneyItem(_0x12b9d3,'',_0x5ed898(_0x12b9d3['id'])));}const _0x219776=[..._0x2f5b6d[_0x4c67df(0x1c7)]()][_0x4c67df(0x167)]((_0x3c5111,_0x27b85f)=>{const _0xeb98d6=_0x4c67df,_0x3e4325=_0x173749[_0xeb98d6(0x230)](_0x3c5111[0x0])||_0x3c5111[0x0],_0x34b083=_0x173749[_0xeb98d6(0x230)](_0x27b85f[0x0])||_0x27b85f[0x0];return _0x3e4325['localeCompare'](_0x34b083,undefined,{'sensitivity':_0xeb98d6(0x1a0)});});for(const [_0x420cbc,_0x3821da]of _0x219776){const _0x4052cd=_0x173749[_0x4c67df(0x230)](_0x420cbc)||_0x420cbc;console['log']('📁\x20'+_0x4052cd),_0x3821da[_0x4c67df(0x167)](_0x599edc);for(const _0x55ef90 of _0x3821da){console[_0x4c67df(0x244)](formatJourneyItem(_0x55ef90,'\x20\x20',_0x5ed898(_0x55ef90['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a26_0x40e223(0x179)]=a26_0x40e223(0x1ac);[a26_0x40e223(0x183)]=a26_0x40e223(0x218);async['execute'](_0x410175){const _0x31639a=a26_0x40e223,{options:_0x18ec01,args:_0x5c9bdf,tdx:_0x59e8a0}=_0x410175,_0x544138=_0x5c9bdf[0x0];if(!_0x544138)return console[_0x31639a(0x1fe)](_0x31639a(0x1df)),console[_0x31639a(0x1fe)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console['error'](_0x31639a(0x1dd)),console[_0x31639a(0x1fe)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x18ec01[_0x31639a(0x1e1)]&&console[_0x31639a(0x1fe)](_0x31639a(0x248)+_0x544138);const {journeyId:_0x18ef75,parentSegmentId:_0x1d893c}=await resolveJourneyIdFromInput(_0x544138,_0x18ec01,_0x59e8a0);if(_0x18ec01[_0x31639a(0x21a)]){const _0x2bb65f=getConsoleNextUrl(_0x18ec01[_0x31639a(0x19c)],'/app/ps/'+_0x1d893c+_0x31639a(0x193)+_0x18ef75+'/j/da/je');return console['error'](a26_0x1e1b3b[_0x31639a(0x1b9)]('✔')+_0x31639a(0x185)+a26_0x1e1b3b[_0x31639a(0x241)](_0x2bb65f)),openBrowser(_0x2bb65f),0x0;}const _0x394d2b=await withSpinner('Getting\x20journey\x20details...',()=>_0x59e8a0[_0x31639a(0x24a)]['getJourney'](_0x18ef75),{'verbose':_0x18ec01[_0x31639a(0x1e1)]}),_0x585d39=_0x394d2b['data'],_0x3c8b29=_0x18ec01[_0x31639a(0x238)];let _0x361c66;if(_0x3c8b29)try{const _0x556b7b=await withSpinner(_0x31639a(0x1ea),()=>_0x59e8a0['journey']['getStatistics'](_0x18ef75),{'verbose':_0x18ec01['verbose']});_0x361c66=_0x556b7b[_0x31639a(0x243)];}catch{_0x18ec01['verbose']&&console['error']('\x20\x20Statistics\x20not\x20available');}const _0x33b439=getConsoleNextUrl(_0x18ec01[_0x31639a(0x19c)],'/app/ps/'+_0x1d893c+_0x31639a(0x193)+_0x18ef75+'/j/da/je'),_0x21215f={'id':_0x585d39['id'],'name':_0x585d39[_0x31639a(0x253)]['name'],'description':_0x585d39[_0x31639a(0x253)][_0x31639a(0x183)],'state':_0x585d39[_0x31639a(0x253)][_0x31639a(0x20e)],'paused':_0x585d39[_0x31639a(0x253)][_0x31639a(0x20c)],'reentry_mode':_0x585d39[_0x31639a(0x253)]['reentryMode'],'stages':_0x585d39[_0x31639a(0x253)][_0x31639a(0x189)]?.[_0x31639a(0x18d)]||0x0,..._0x585d39['attributes'][_0x31639a(0x17e)]&&{'goal':_0x585d39['attributes']['goal']['name']},..._0x361c66&&{'statistics':{'size':_0x361c66[_0x31639a(0x20a)],'entered':_0x361c66['enteredSize'],'goal_achieved':_0x361c66['goalSize'],'completion_rate':_0x361c66[_0x31639a(0x1b3)],'exit_or_jump':_0x361c66[_0x31639a(0x247)],'exit_or_jump_rate':_0x361c66['exitOrJumpRate'],'stages':_0x361c66[_0x31639a(0x215)]}},'url':_0x33b439};return await handleSingleObjectOutput(_0x21215f,_0x18ec01),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0x40e223(0x179)]='journey:stats';[a26_0x40e223(0x183)]=a26_0x40e223(0x161);async[a26_0x40e223(0x14a)](_0x4e1627){const _0xcfbed2=a26_0x40e223,{options:_0x1a3958,args:_0x350461,tdx:_0x24ddd0}=_0x4e1627,_0x444ca9=_0x350461[0x0];if(!requireNameOrPath(_0x444ca9))return 0x1;_0x1a3958[_0xcfbed2(0x1e1)]&&console[_0xcfbed2(0x1fe)](_0xcfbed2(0x248)+_0x444ca9);const _0x4e1e4f=_0x1a3958,_0xf38d72=_0x4e1e4f['from'],_0x37a3b0=_0x4e1e4f['to'],_0x3feee7=_0x4e1e4f['includeHistory'],_0x378244=_0x4e1e4f[_0xcfbed2(0x226)];_0x3feee7&&!_0xf38d72&&!_0x37a3b0&&console[_0xcfbed2(0x1fe)](_0xcfbed2(0x1e7));const _0x5ce05b=_0x3feee7?withJsonFormat(_0x1a3958):_0x1a3958,{journeyId:_0x4c9ef3,journeyName:_0x22ba90}=await resolveJourneyIdFromInput(_0x444ca9,_0x5ce05b,_0x24ddd0),_0x44661f=_0xf38d72||_0x37a3b0?{'from':_0xf38d72,'to':_0x37a3b0}:undefined,_0x2a9d13=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0xcfbed2(0x210)]([_0x24ddd0[_0xcfbed2(0x24a)][_0xcfbed2(0x22a)](_0x4c9ef3),_0x24ddd0[_0xcfbed2(0x24a)][_0xcfbed2(0x19f)](_0x4c9ef3,_0x44661f)]),{'verbose':_0x5ce05b[_0xcfbed2(0x1e1)]}),[_0x128566,_0x1693c0]=_0x2a9d13['data'];if(!_0x1693c0||_0x1693c0[_0xcfbed2(0x1d7)]===null)return console['error'](_0xcfbed2(0x1d9)+_0x22ba90),console[_0xcfbed2(0x1fe)](_0xcfbed2(0x14d)),0x0;const _0x34ac7b=buildStageNameMap(_0x128566),_0x4faf4c=!!(_0x44661f&&_0x1693c0[_0xcfbed2(0x1be)]?.[_0xcfbed2(0x18d)]),_0x5ecec4={'stageNameMap':_0x34ac7b,'hasPeriod':_0x4faf4c,'includeHistory':!!_0x3feee7};if(_0x378244&&_0x1693c0[_0xcfbed2(0x215)]){const _0x5b5f1f=_0x1693c0['stages'][_0xcfbed2(0x1da)](_0x487845=>{const _0x1c5dfb=_0xcfbed2,_0x3e7992=_0x34ac7b[_0x1c5dfb(0x230)](_0x487845['id'])??'';return _0x3e7992[_0x1c5dfb(0x214)]()===_0x378244['toLowerCase']();});if(_0x5b5f1f)return await handleSingleObjectOutput(formatStageStats(_0x5b5f1f,_0x5ecec4),_0x5ce05b),0x0;const _0x45a341=_0x1693c0['stages']['map'](_0x8710ed=>_0x34ac7b[_0xcfbed2(0x230)](_0x8710ed['id'])??_0x8710ed['id']);return console['error']('Error:\x20Stage\x20\x22'+_0x378244+'\x22\x20not\x20found'),console[_0xcfbed2(0x1fe)]('Available\x20stages:\x20'+_0x45a341[_0xcfbed2(0x162)](',\x20')),0x1;}const _0x43eeaa=_0x1693c0[_0xcfbed2(0x215)]?.[_0xcfbed2(0x1f1)](_0x141cf4=>formatStageStats(_0x141cf4,_0x5ecec4)),_0x2de287=assembleJourneyStats(_0x1693c0,{'from':_0xf38d72,'to':_0x37a3b0,'includeHistory':_0x3feee7});return await this[_0xcfbed2(0x249)](_0x2de287,_0x43eeaa??[],_0x5ce05b),0x0;}async['renderStats'](_0x2e4815,_0x17a796,_0x51409c){const _0x35a4e9=a26_0x40e223,_0xfc2ff8=_0x51409c[_0x35a4e9(0x1c6)]===_0x35a4e9(0x24c)||_0x51409c['format']===_0x35a4e9(0x1a4)||_0x51409c[_0x35a4e9(0x24c)]||_0x51409c[_0x35a4e9(0x1a4)];if(_0xfc2ff8){_0x2e4815[_0x35a4e9(0x215)]=_0x17a796,await handleSingleObjectOutput(_0x2e4815,_0x51409c);return;}await handleSingleObjectOutput(_0x2e4815,_0x51409c);for(const _0x5d0cc6 of _0x17a796){console['log'](''),console[_0x35a4e9(0x244)](String(a26_0x1e1b3b[_0x35a4e9(0x241)][_0x35a4e9(0x1c0)]('['+_0x5d0cc6[_0x35a4e9(0x179)]+']'))+a26_0x1e1b3b['dim']('\x20'+_0x5d0cc6['id']));const {id:_0x4e8e5b,name:_0x4c4e21,..._0x7238e0}=_0x5d0cc6;await handleSingleObjectOutput(_0x7238e0,_0x51409c);}}}export class JourneyTrafficCommand extends BaseCommand{[a26_0x40e223(0x179)]=a26_0x40e223(0x151);[a26_0x40e223(0x183)]=a26_0x40e223(0x1e0);async[a26_0x40e223(0x14a)](_0x1b3dec){const _0x16817b=a26_0x40e223,{options:_0x505327,args:_0x36f919,tdx:_0x10ed85}=_0x1b3dec,_0x41c3e8=_0x36f919[0x0];if(!requireNameOrPath(_0x41c3e8))return 0x1;_0x505327[_0x16817b(0x1e1)]&&console[_0x16817b(0x1fe)](_0x16817b(0x248)+_0x41c3e8);const _0x348cf2=_0x505327,_0xb4e937=_0x348cf2[_0x16817b(0x23b)],_0x209a75=_0x348cf2['from'],_0x50a1fa=_0x348cf2['to'],_0x2f341b=_0x348cf2['limit'];if(_0xb4e937&&_0xb4e937!==_0x16817b(0x186)&&_0xb4e937!==_0x16817b(0x1e4))return console[_0x16817b(0x1fe)](_0x16817b(0x23c)+_0xb4e937+_0x16817b(0x24d)),0x1;const _0x2337fc=withJsonFormat(_0x505327),{journeyId:_0x408836,journeyName:_0x45ec89}=await resolveJourneyIdFromInput(_0x41c3e8,_0x2337fc,_0x10ed85),_0x1907b8={'type':_0xb4e937,'from':_0x209a75,'to':_0x50a1fa,'limit':_0x2f341b},_0xed8014=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x10ed85['journey'][_0x16817b(0x204)](_0x408836,_0x1907b8),{'verbose':_0x2337fc['verbose']}),_0x501608=_0xed8014[_0x16817b(0x243)],_0x1e2666=_0x501608[_0x16817b(0x186)]&&(_0x501608['conversion'][_0x16817b(0x147)][_0x16817b(0x18d)]>0x0||_0x501608['conversion'][_0x16817b(0x1c4)][_0x16817b(0x18d)]>0x0),_0x2694fd=_0x501608['activation']&&_0x501608[_0x16817b(0x1e4)]['length']>0x0;if(!_0x1e2666&&!_0x2694fd)return console[_0x16817b(0x1fe)](_0x16817b(0x232)+_0x45ec89),console['error']('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x209a75&&_0x50a1fa&&console[_0x16817b(0x1fe)](_0x16817b(0x149)),0x0;return await handleSingleObjectOutput(_0x501608,_0x2337fc),0x0;}}function formatStageStats(_0x2fb38f,_0x56cb83){const _0x4a9a7c=a26_0x40e223,_0x3fb7a7=_0x56cb83[_0x4a9a7c(0x224)]&&_0x2fb38f[_0x4a9a7c(0x1be)]?.['length']?aggregateStageHistory(_0x2fb38f[_0x4a9a7c(0x1be)]):{'size':_0x2fb38f[_0x4a9a7c(0x20a)],'entered':_0x2fb38f[_0x4a9a7c(0x190)],'milestone':_0x2fb38f[_0x4a9a7c(0x1cb)],'milestone_rate':_0x2fb38f[_0x4a9a7c(0x16a)],'exit_or_jump':_0x2fb38f['exitOrJumpSize'],'exit_or_jump_rate':_0x2fb38f[_0x4a9a7c(0x1ba)]},_0x251478={'id':_0x2fb38f['id'],'name':_0x56cb83['stageNameMap'][_0x4a9a7c(0x230)](_0x2fb38f['id'])??_0x2fb38f['id'],..._0x3fb7a7};return _0x56cb83[_0x4a9a7c(0x224)]&&_0x56cb83[_0x4a9a7c(0x16d)]&&_0x2fb38f[_0x4a9a7c(0x1be)]&&(_0x251478[_0x4a9a7c(0x1be)]=_0x2fb38f[_0x4a9a7c(0x1be)]),_0x251478;}export class JourneyPauseCommand extends BaseCommand{['name']=a26_0x40e223(0x233);[a26_0x40e223(0x183)]=a26_0x40e223(0x174);async[a26_0x40e223(0x14a)](_0x19403e){const _0x419fa4=a26_0x40e223,{options:_0x60a813,args:_0x4f77b6,tdx:_0x5677bb}=_0x19403e,_0x592cd1=_0x4f77b6[0x0];if(!requireNameOrPath(_0x592cd1))return 0x1;_0x60a813[_0x419fa4(0x1e1)]&&console[_0x419fa4(0x1fe)]('Input:\x20'+_0x592cd1);const {journeyId:_0x1a80dd,journeyName:_0x38365}=await resolveJourneyIdFromInput(_0x592cd1,_0x60a813,_0x5677bb);if(!_0x60a813[_0x419fa4(0x246)]){const _0x5777ec=await confirm(_0x419fa4(0x1e6)+_0x38365+'\x22?');if(!_0x5777ec)return console[_0x419fa4(0x1fe)](_0x419fa4(0x229)),0x0;}const _0x8e70f4=await withSpinner(_0x419fa4(0x18c),()=>_0x5677bb[_0x419fa4(0x24a)][_0x419fa4(0x1bf)](_0x1a80dd),{'verbose':_0x60a813['verbose']}),_0x284035=_0x8e70f4[_0x419fa4(0x243)];return console['error']('✔\x20Journey\x20\x22'+_0x284035[_0x419fa4(0x253)][_0x419fa4(0x179)]+_0x419fa4(0x1af)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0x40e223(0x179)]=a26_0x40e223(0x236);[a26_0x40e223(0x183)]='Resume\x20a\x20paused\x20journey';async[a26_0x40e223(0x14a)](_0x43f2d2){const _0x437158=a26_0x40e223,{options:_0x10ba04,args:_0x151f56,tdx:_0x513aa7}=_0x43f2d2,_0x1405fa=_0x151f56[0x0];if(!requireNameOrPath(_0x1405fa))return 0x1;_0x10ba04[_0x437158(0x1e1)]&&console['error']('Input:\x20'+_0x1405fa);const {journeyId:_0x102001,journeyName:_0x396a90}=await resolveJourneyIdFromInput(_0x1405fa,_0x10ba04,_0x513aa7);if(!_0x10ba04[_0x437158(0x246)]){const _0x226d3b=await confirm(_0x437158(0x1c9)+_0x396a90+'\x22?');if(!_0x226d3b)return console[_0x437158(0x1fe)]('Cancelled'),0x0;}const _0x1973bd=await withSpinner(_0x437158(0x1f0),()=>_0x513aa7['journey']['resume'](_0x102001),{'verbose':_0x10ba04[_0x437158(0x1e1)]}),_0x52f485=_0x1973bd[_0x437158(0x243)];return console[_0x437158(0x1fe)](_0x437158(0x1db)+_0x52f485[_0x437158(0x253)][_0x437158(0x179)]+_0x437158(0x239)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a26_0x40e223(0x179)]=a26_0x40e223(0x164);[a26_0x40e223(0x183)]=a26_0x40e223(0x1ca);async[a26_0x40e223(0x14a)](_0x90c2d4){const _0x3a0196=a26_0x40e223,{options:_0x136073,args:_0x3911f0,tdx:_0x516b94}=_0x90c2d4,_0x2d929a=_0x136073,_0x1a3295=_0x3911f0[0x0],_0xfb4c87=_0x1a3295&&isYamlFilePath(_0x1a3295),_0x113f95=await resolveTarget({'arg':_0xfb4c87?_0x1a3295:undefined,'contextParent':_0x136073[_0x3a0196(0x1cf)],'cwd':process[_0x3a0196(0x17d)]()});if(!isSuccessfulResolution(_0x113f95))return _0x113f95['errorCode']==='no_parent'?(console['error'](a26_0x1e1b3b['yellow'](_0x3a0196(0x1ce))),console[_0x3a0196(0x1fe)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x3a0196(0x1fe)](_0x3a0196(0x17a)),console[_0x3a0196(0x1fe)](_0x3a0196(0x217))):(console[_0x3a0196(0x1fe)](a26_0x1e1b3b[_0x3a0196(0x1fa)](_0x3a0196(0x1d6)+_0x113f95[_0x3a0196(0x1a8)]+'\x0a')),_0x113f95['helpText']&&console[_0x3a0196(0x1fe)](a26_0x1e1b3b[_0x3a0196(0x241)](_0x113f95[_0x3a0196(0x152)]))),0x1;let _0x3f522d=_0xfb4c87?undefined:_0x1a3295,_0x202408,_0x4a05fc;_0x113f95[_0x3a0196(0x23b)]===_0x3a0196(0x1c2)&&(_0x3f522d=_0x113f95[_0x3a0196(0x1bb)],_0x202408=_0x113f95['filePath'],_0x4a05fc=_0x113f95[_0x3a0196(0x15a)]);const _0x5cece4=_0x113f95[_0x3a0196(0x16e)],_0x55ec56=_0x113f95[_0x3a0196(0x1bc)];_0x2d929a[_0x3a0196(0x1e1)]&&(console[_0x3a0196(0x1fe)](_0x3a0196(0x219)+_0x5cece4),console[_0x3a0196(0x1fe)](_0x3a0196(0x1bd)+_0x55ec56),_0x3f522d&&console['error'](_0x3a0196(0x1f6)+_0x3f522d),_0x202408&&console[_0x3a0196(0x1fe)](_0x3a0196(0x1f8)+_0x202408),_0x4a05fc&&console['error'](_0x3a0196(0x1ee)+_0x4a05fc));const _0x328f66=await withSpinner(_0x3a0196(0x1e2),()=>_0x516b94['segment'][_0x3a0196(0x19a)](_0x5cece4),{'verbose':_0x136073[_0x3a0196(0x1e1)]}),_0x2c08fa=_0x328f66[_0x3a0196(0x243)],{journeys:_0x555f40,folders:_0x3d1b25}=await withSpinner(_0x3a0196(0x187),async()=>{const _0x555fea=_0x3a0196,[_0x26d139,_0x65f7b7]=await Promise[_0x555fea(0x210)]([_0x516b94[_0x555fea(0x24a)][_0x555fea(0x197)](_0x2c08fa,undefined,{'includeAllVersions':!![]}),_0x516b94[_0x555fea(0x169)][_0x555fea(0x176)](_0x2c08fa)]);return{'journeys':_0x26d139,'folders':_0x65f7b7};},{'verbose':_0x136073['verbose']})['then'](_0x1cd252=>_0x1cd252[_0x3a0196(0x243)]);let _0x2f9820=_0x555f40;const _0x235cd9=buildFolderIdToPathMap(_0x3d1b25);if(_0x3f522d){const _0x425a69=_0x2f9820[_0x3a0196(0x168)](_0x232c78=>_0x232c78[_0x3a0196(0x188)]['toLowerCase']()===_0x3f522d[_0x3a0196(0x214)]());if(_0x425a69['length']===0x0)return console[_0x3a0196(0x1fe)]('Error:\x20Journey\x20not\x20found:\x20'+_0x3f522d),console[_0x3a0196(0x1fe)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x2f9820=_0x425a69;}if(_0x4a05fc!==undefined){const _0x25339a=_0x2f9820[_0x3a0196(0x168)](_0x18cd27=>{const _0x4b2d47=_0x3a0196,_0x45d2cd=_0x18cd27[_0x4b2d47(0x19d)]?_0x235cd9[_0x4b2d47(0x230)](_0x18cd27[_0x4b2d47(0x19d)])||'':'';return _0x45d2cd===_0x4a05fc;});if(_0x25339a[_0x3a0196(0x18d)]===0x0&&_0x2f9820['length']>0x0){console[_0x3a0196(0x1fe)](_0x3a0196(0x17c)+_0x3f522d+_0x3a0196(0x17f)+(_0x4a05fc||_0x3a0196(0x1a3))),console[_0x3a0196(0x1fe)](_0x3a0196(0x15f));for(const _0x55276e of _0x2f9820){const _0x203fd1=_0x55276e['folderId']?_0x235cd9[_0x3a0196(0x230)](_0x55276e[_0x3a0196(0x19d)])||'':'';console['error'](_0x3a0196(0x1b0)+(_0x203fd1||_0x3a0196(0x23a))+'/'+_0x55276e['journeyBundleName']);}return 0x1;}_0x2f9820=_0x25339a;}if(_0x2f9820[_0x3a0196(0x18d)]===0x0)return console[_0x3a0196(0x1fe)](_0x3a0196(0x1b1)),0x0;const _0x3ec3cd=new Map();for(const _0x3b87bc of _0x2f9820){const _0x46b7d5=_0x3b87bc[_0x3a0196(0x21d)];!_0x3ec3cd['has'](_0x46b7d5)&&_0x3ec3cd[_0x3a0196(0x14e)](_0x46b7d5,[]),_0x3ec3cd[_0x3a0196(0x230)](_0x46b7d5)[_0x3a0196(0x184)](_0x3b87bc);}for(const _0x447a34 of _0x3ec3cd[_0x3a0196(0x20b)]()){_0x447a34[_0x3a0196(0x167)]((_0x4d9cb8,_0x11852b)=>(_0x4d9cb8[_0x3a0196(0x180)]||0x0)-(_0x11852b[_0x3a0196(0x180)]||0x0));}const _0x3b44d0=[],{idToEmailMap:_0x1eb49e,connectionIdToNameMap:_0x8cdb0b}=await withSpinner(_0x3a0196(0x200),async()=>{const _0x212106=_0x3a0196,[_0x31ec3b,_0x1786c5]=await Promise[_0x212106(0x210)]([_0x516b94['user']['buildIdToEmailMap'](),_0x516b94[_0x212106(0x1c5)][_0x212106(0x21b)]()]);return{'idToEmailMap':_0x31ec3b,'connectionIdToNameMap':_0x1786c5};},{'verbose':_0x136073[_0x3a0196(0x1e1)]})[_0x3a0196(0x198)](_0xc45fd5=>_0xc45fd5[_0x3a0196(0x243)]);for(const _0x40f706 of _0x3ec3cd['values']()){const _0x1d8355=_0x40f706[0x0][_0x3a0196(0x188)],_0x3a5da2=_0x40f706[0x0][_0x3a0196(0x19d)],_0x1ed513=_0x3a5da2?_0x235cd9[_0x3a0196(0x230)](_0x3a5da2)||'':'',_0x4ca12f=_0x1ed513?a26_0x2b0df9['join'](_0x55ec56,_0x1ed513):_0x55ec56,_0xd74211=_0x202408||a26_0x2b0df9[_0x3a0196(0x162)](_0x4ca12f,sanitizeFileName(_0x1d8355)+_0x3a0196(0x242));let _0xd93054,_0x18b6fd;if(existsSync(_0xd74211))try{const _0x39d9c1=readFileSync(_0xd74211,_0x3a0196(0x156)),_0x249e68=parseYamlString(_0x39d9c1);_0x18b6fd=_0x249e68,_0xd93054=buildRuleToNameMapping(_0x249e68),_0x2d929a[_0x3a0196(0x1e1)]&&_0xd93054['size']>0x0&&console[_0x3a0196(0x1fe)](_0x3a0196(0x20d)+_0xd93054['size']+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x1d8355);}catch(_0x513842){_0x2d929a['verbose']&&console[_0x3a0196(0x1fe)](_0x3a0196(0x160)+_0x513842[_0x3a0196(0x1a8)]);}const _0x2a6844=[],_0x1bcfc2=new Set(),_0xfb78a0=new Map(),_0x29435a=new Map(),_0x7b021b=new Set(),_0x1004d3=new Map(),_0x316023=new Map(),_0x415e6b=createJumpTargetCache();await withProgressSpinner(_0x3a0196(0x211)+_0x1d8355+'...',async _0x54bada=>{const _0x72620f=_0x3a0196;for(const _0x5e7de6 of _0x40f706){const _0x331520=_0x40f706[_0x72620f(0x18d)]>0x1?_0x5e7de6[_0x72620f(0x188)]+'\x20v'+(_0x5e7de6['versionNumber']||0x1):_0x5e7de6['journeyBundleName'];_0x54bada[_0x72620f(0x201)]('Fetching\x20'+_0x331520);const _0x533d0c=await _0x516b94['journey']['getJourney'](_0x5e7de6['id']),_0x11fcaf=_0x533d0c[_0x72620f(0x253)]?.[_0x72620f(0x22b)],_0xc9d75f={'resolveSegment':async _0x38d0cc=>{const _0x5640f9=_0x72620f;if(!_0x11fcaf)return{'name':_0x38d0cc,'isJourneyLocal':![]};const _0xa18b63=_0xfb78a0[_0x5640f9(0x230)](_0x38d0cc);if(_0xa18b63)return _0xa18b63;try{const _0x1f082c=await _0x516b94[_0x5640f9(0x169)][_0x5640f9(0x1ae)](_0x11fcaf,_0x38d0cc),_0x57bba8=_0x1f082c[_0x5640f9(0x159)]===SEGMENT_KIND_JOURNEY;let _0x83a4ea,_0x393c8d=_0x1f082c[_0x5640f9(0x179)];if(_0x57bba8&&_0x1f082c[_0x5640f9(0x178)]){const _0x134603=await segmentResponseToDef(_0x1f082c,{'resolveSegmentName':async _0x11471d=>{const _0x2a4ebc=_0x5640f9,_0x4e17bd=_0xfb78a0[_0x2a4ebc(0x230)](_0x11471d);if(_0x4e17bd)return _0x4e17bd[_0x2a4ebc(0x179)];const _0x354b0c=await _0xc9d75f['resolveSegment'](_0x11471d);return _0x354b0c['name'];}}),_0x30ea45=_0x134603['rule'];_0x83a4ea={'description':_0x1f082c[_0x5640f9(0x183)],'rule':_0x30ea45};const _0x528012=serializeRule(_0x30ea45),_0xc09ef8=_0x29435a[_0x5640f9(0x230)](_0x528012);if(_0xc09ef8)_0x393c8d=_0xc09ef8,_0x83a4ea=undefined,_0x2d929a[_0x5640f9(0x1e1)]&&console[_0x5640f9(0x1fe)](_0x5640f9(0x17b)+_0x1f082c[_0x5640f9(0x179)]+_0x5640f9(0x235)+_0xc09ef8);else{let _0x530b47=![];if(_0xd93054){const _0x216d23=_0xd93054['get'](_0x528012);if(_0x216d23){const _0x385f94=_0x216d23[_0x5640f9(0x1da)](_0x22ea36=>!_0x1bcfc2[_0x5640f9(0x24b)](_0x22ea36));_0x385f94&&(_0x393c8d=_0x385f94,_0x1bcfc2['add'](_0x385f94),_0x29435a[_0x5640f9(0x14e)](_0x528012,_0x385f94),_0x530b47=!![],_0x2d929a['verbose']&&console[_0x5640f9(0x1fe)](_0x5640f9(0x216)+_0x385f94+_0x5640f9(0x245)));}}if(!_0x530b47){const _0x39672e=generateJourneyLocalName(_0x1f082c['name']);_0x39672e&&(_0x393c8d=_0x39672e);let _0x1d44c3=_0x393c8d,_0x56e960=0x2;while(_0x1bcfc2[_0x5640f9(0x24b)](_0x1d44c3)){_0x1d44c3=_0x393c8d+'_'+_0x56e960,_0x56e960++;}_0x1bcfc2['add'](_0x1d44c3),_0x29435a[_0x5640f9(0x14e)](_0x528012,_0x1d44c3),_0x393c8d=_0x1d44c3;}}}const _0x55a124={'name':_0x393c8d,'isJourneyLocal':_0x57bba8,'definition':_0x83a4ea};return _0xfb78a0[_0x5640f9(0x14e)](_0x38d0cc,_0x55a124),_0x55a124;}catch(_0x5c620a){return _0x136073[_0x5640f9(0x1e1)]&&console[_0x5640f9(0x1fe)](_0x5640f9(0x166)+_0x38d0cc+':\x20'+_0x5c620a[_0x5640f9(0x1a8)]),{'name':_0x38d0cc,'isJourneyLocal':![]};}},'resolveActivation':async _0x1af315=>{const _0x17b494=_0x72620f,_0x4231bc=_0x1004d3['get'](_0x1af315);if(_0x4231bc)return _0x4231bc;try{const _0x17df09=await _0x516b94[_0x17b494(0x24a)]['getActivation'](_0x5e7de6['id'],_0x1af315),_0x6931ca=journeyActivationStepToYaml(_0x17df09,_0x1eb49e,_0x8cdb0b),_0x3a0f25=JSON['stringify']({'name':_0x6931ca[_0x17b494(0x179)],'connection':_0x6931ca['connection'],'connector_config':_0x6931ca[_0x17b494(0x191)]}),_0x14c125=_0x316023[_0x17b494(0x230)](_0x3a0f25);if(_0x14c125){const _0x4f6f80={'name':_0x14c125,'isJourneyLocal':!![],'definition':_0x6931ca};return _0x1004d3[_0x17b494(0x14e)](_0x1af315,_0x4f6f80),_0x4f6f80;}const _0x53db41=_0x17df09[_0x17b494(0x253)][_0x17b494(0x24e)][_0x17b494(0x179)]||_0x1af315,_0xfd598b=sanitizeYamlKey(_0x53db41)||_0x17b494(0x1b6)+_0x1af315;let _0xd64062=_0xfd598b,_0x3e08e1=0x2;while(_0x7b021b[_0x17b494(0x24b)](_0xd64062)){_0xd64062=_0xfd598b+'_'+_0x3e08e1,_0x3e08e1++;}_0x7b021b[_0x17b494(0x231)](_0xd64062),_0x316023['set'](_0x3a0f25,_0xd64062);const _0x433720={'name':_0xd64062,'isJourneyLocal':!![],'definition':_0x6931ca};return _0x1004d3[_0x17b494(0x14e)](_0x1af315,_0x433720),_0x433720;}catch(_0x37c694){return _0x136073[_0x17b494(0x1e1)]&&console[_0x17b494(0x1fe)](_0x17b494(0x15e)+_0x1af315+':\x20'+_0x37c694[_0x17b494(0x1a8)]),{'name':_0x1af315,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x15d040,_0xd63dbf)=>{const _0xab76d0=_0x72620f;return resolveJumpTarget(_0x15d040,_0xd63dbf,_0x415e6b,_0xefc718=>_0x516b94[_0xab76d0(0x24a)][_0xab76d0(0x22a)](_0xefc718));}},_0x51faa9=await journeyResponseToDef(_0x533d0c,_0xc9d75f);_0x2a6844['push']({'item':_0x5e7de6,'yaml':_0x51faa9});}},{'verbose':_0x136073['verbose']});const _0x427e93=await _0x516b94['journey']['getLatestJourneyId'](_0x40f706[0x0]['journeyBundleId']),_0x5cd63a=buildMergedJourneyDef(_0x2a6844,_0xd93054,_0x427e93),_0x4026c1=normalizeJourneyDef(_0x5cd63a,_0x18b6fd),_0xd8f7f4=toYamlString(_0x4026c1),_0x2d2d72=_0x202408||a26_0x2b0df9[_0x3a0196(0x162)](_0x4ca12f,sanitizeFileName(_0x1d8355)+_0x3a0196(0x242));!_0x202408&&_0x1ed513&&!existsSync(_0x4ca12f)&&mkdirSync(_0x4ca12f,{'recursive':!![]});const _0x19fd81=a26_0x2b0df9['relative'](process[_0x3a0196(0x17d)](),_0x2d2d72);if(existsSync(_0x2d2d72)){const _0x3ca9dd=readFileSync(_0x2d2d72,'utf-8'),_0x25b4a0=generateDiff(_0x3ca9dd,_0xd8f7f4),_0x3de00a=hasChanges(_0x25b4a0);_0x3b44d0[_0x3a0196(0x184)]({'relativePath':_0x19fd81,'absolutePath':_0x2d2d72,'content':_0xd8f7f4,'isNew':![],'hasChanges':_0x3de00a,'diff':_0x3de00a?formatDiffWithColors(_0x25b4a0):undefined});}else _0x3b44d0[_0x3a0196(0x184)]({'relativePath':_0x19fd81,'absolutePath':_0x2d2d72,'content':_0xd8f7f4,'isNew':!![],'hasChanges':![]});}const _0x578b00=_0x3b44d0[_0x3a0196(0x168)](_0x2fd8c6=>_0x2fd8c6[_0x3a0196(0x1cc)]),_0x255a2e=_0x3b44d0[_0x3a0196(0x168)](_0x1725b7=>!_0x1725b7[_0x3a0196(0x1cc)]&&_0x1725b7[_0x3a0196(0x1a7)]),_0x1a1c5c=_0x3b44d0[_0x3a0196(0x168)](_0x243886=>!_0x243886[_0x3a0196(0x1cc)]&&!_0x243886[_0x3a0196(0x1a7)]),_0x33b3d4=_0x2f9820[_0x3a0196(0x18d)],_0x2d3cb9=_0x3ec3cd['size'],_0x20506b=_0x33b3d4>_0x2d3cb9?'\x20('+_0x33b3d4+'\x20versions)':'';console[_0x3a0196(0x1fe)](_0x3a0196(0x205)),console[_0x3a0196(0x1fe)]('\x20\x20'+a26_0x1e1b3b['cyan'](_0x2d3cb9+_0x3a0196(0x182))+a26_0x1e1b3b[_0x3a0196(0x199)](_0x20506b)),console[_0x3a0196(0x1fe)]('\x20\x20'+a26_0x1e1b3b[_0x3a0196(0x1b9)]('+\x20'+_0x578b00[_0x3a0196(0x18d)]+_0x3a0196(0x207))),console[_0x3a0196(0x1fe)]('\x20\x20'+a26_0x1e1b3b[_0x3a0196(0x14b)]('~\x20'+_0x255a2e[_0x3a0196(0x18d)]+'\x20changed\x20files')),console['error']('\x20\x20'+a26_0x1e1b3b[_0x3a0196(0x199)]('=\x20'+_0x1a1c5c[_0x3a0196(0x18d)]+'\x20unchanged\x20files')),console[_0x3a0196(0x1fe)](_0x3a0196(0x20f)+a26_0x1e1b3b[_0x3a0196(0x241)](_0x55ec56)+'\x0a');if(_0x255a2e['length']>0x0)for(const _0x35865d of _0x255a2e){console['error']('\x0aChanges\x20to\x20\x27'+_0x35865d['relativePath']+'\x27:'),console['error']('─'[_0x3a0196(0x1c1)](0x3c)),console[_0x3a0196(0x1fe)](_0x35865d[_0x3a0196(0x1d1)]),console[_0x3a0196(0x1fe)]('─'[_0x3a0196(0x1c1)](0x3c));}if(_0x2d929a[_0x3a0196(0x172)])return console[_0x3a0196(0x1fe)](a26_0x1e1b3b[_0x3a0196(0x14b)](_0x3a0196(0x1ed))),0x0;if(_0x578b00['length']===0x0&&_0x255a2e[_0x3a0196(0x18d)]===0x0)return console[_0x3a0196(0x1fe)](a26_0x1e1b3b[_0x3a0196(0x1b9)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x5cece4},_0x2d929a[_0x3a0196(0x220)]),console[_0x3a0196(0x1fe)](a26_0x1e1b3b[_0x3a0196(0x1b9)](_0x3a0196(0x1b2)+a26_0x1e1b3b[_0x3a0196(0x199)](_0x3a0196(0x1f7))+'\x20=\x20'+a26_0x1e1b3b['cyan'](_0x5cece4))),0x0;if(!_0x2d929a[_0x3a0196(0x246)]&&(_0x578b00[_0x3a0196(0x18d)]>0x0||_0x255a2e['length']>0x0)){if(!isInteractive())return console[_0x3a0196(0x1fe)](a26_0x1e1b3b['red'](_0x3a0196(0x206)),_0x3a0196(0x175)),console[_0x3a0196(0x1fe)](a26_0x1e1b3b[_0x3a0196(0x199)](_0x3a0196(0x1de))),0x1;const _0x57b603=await confirmKey(_0x3a0196(0x153)+(_0x578b00[_0x3a0196(0x18d)]+_0x255a2e[_0x3a0196(0x18d)])+_0x3a0196(0x16b));if(!_0x57b603)return console[_0x3a0196(0x1fe)](a26_0x1e1b3b[_0x3a0196(0x14b)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x55ec56)&&mkdirSync(_0x55ec56,{'recursive':!![]});const _0x2ea812=a26_0x2b0df9[_0x3a0196(0x162)](_0x55ec56,_0x3a0196(0x146));writeFileSync(_0x2ea812,createTdxConfigContent(_0x5cece4),_0x3a0196(0x156));for(const _0x4f8af7 of _0x3b44d0){(_0x4f8af7[_0x3a0196(0x1cc)]||_0x4f8af7[_0x3a0196(0x1a7)])&&writeFileSync(_0x4f8af7['absolutePath'],_0x4f8af7['content'],_0x3a0196(0x156));}return console[_0x3a0196(0x1fe)](a26_0x1e1b3b[_0x3a0196(0x1b9)](_0x3a0196(0x1f3)+(_0x578b00[_0x3a0196(0x18d)]+_0x255a2e['length'])+_0x3a0196(0x23e)+_0x55ec56)),saveSessionContext({'parent_segment':_0x5cece4},_0x2d929a[_0x3a0196(0x220)]),console[_0x3a0196(0x1fe)](a26_0x1e1b3b[_0x3a0196(0x1b9)]('✔\x20Context\x20set:\x20'+a26_0x1e1b3b['dim'](_0x3a0196(0x1f7))+_0x3a0196(0x21f)+a26_0x1e1b3b[_0x3a0196(0x241)](_0x5cece4))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a26_0x40e223(0x1e3);[a26_0x40e223(0x183)]=a26_0x40e223(0x237);async[a26_0x40e223(0x14a)](_0x476d7d){const _0x3e0803=a26_0x40e223,{options:_0x333b20,args:_0x5a433b,tdx:_0x2418b6}=_0x476d7d,_0xf833f0=_0x5a433b[0x0];if(!requireNameOrPath(_0xf833f0))return 0x1;_0x333b20['verbose']&&console[_0x3e0803(0x1fe)](_0x3e0803(0x248)+_0xf833f0);const {journeyId:_0x541027}=await resolveJourneyIdFromInput(_0xf833f0,_0x333b20,_0x2418b6),_0x2dee1f=await withSpinner(_0x3e0803(0x19b),()=>_0x2418b6[_0x3e0803(0x24a)][_0x3e0803(0x14c)](_0x541027),{'verbose':_0x333b20[_0x3e0803(0x1e1)]}),_0x3b7c84=_0x2dee1f[_0x3e0803(0x243)];return console['log'](_0x3e0803(0x195)+_0x3b7c84[_0x3e0803(0x22d)]),console[_0x3e0803(0x244)]('Table:\x20'+_0x3b7c84[_0x3e0803(0x19e)]),await handleSDKOutput(_0x3b7c84[_0x3e0803(0x165)],_0x333b20),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a26_0x40e223(0x179)]='journey:activations';['description']=a26_0x40e223(0x1f9);async[a26_0x40e223(0x14a)](_0x2b5f61){const _0x31b359=a26_0x40e223,{options:_0x432452,args:_0x3a3c07,tdx:_0x5afc01}=_0x2b5f61,_0x3f5ef1=_0x3a3c07[0x0];if(!requireNameOrPath(_0x3f5ef1))return 0x1;_0x432452['verbose']&&console[_0x31b359(0x1fe)](_0x31b359(0x248)+_0x3f5ef1);const {journeyId:_0x3ce6a2}=await resolveJourneyIdFromInput(_0x3f5ef1,_0x432452,_0x5afc01),_0x448360=await withSpinner('Listing\x20journey\x20activations...',()=>_0x5afc01[_0x31b359(0x24a)][_0x31b359(0x213)](_0x3ce6a2),{'verbose':_0x432452[_0x31b359(0x1e1)]}),_0x319689=_0x448360[_0x31b359(0x243)];return console[_0x31b359(0x1fe)](_0x31b359(0x20d)+_0x319689[_0x31b359(0x18d)]+_0x31b359(0x18f)+(_0x319689[_0x31b359(0x18d)]!==0x1?'s':'')),await handleSDKOutput(_0x319689,_0x432452),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0x40e223(0x179)]=a26_0x40e223(0x23f);[a26_0x40e223(0x183)]=a26_0x40e223(0x1eb);[a26_0x40e223(0x1f4)]=new SegmentPushCommand();async[a26_0x40e223(0x14a)](_0x3bc946){const _0x550c14=a26_0x40e223,_0x4b929c=_0x3bc946[_0x550c14(0x171)][0x0];let _0x56c602;if(_0x4b929c){const _0x3c0499=await resolveTarget({'arg':_0x4b929c,'contextParent':_0x3bc946[_0x550c14(0x1a6)][_0x550c14(0x1cf)],'cwd':process[_0x550c14(0x17d)]()});isSuccessfulResolution(_0x3c0499)&&_0x3c0499[_0x550c14(0x23b)]===_0x550c14(0x1c2)&&(_0x56c602=_0x3c0499[_0x550c14(0x1f2)]);}const _0x1ca06c={..._0x3bc946,'options':{..._0x3bc946['options'],'journeysOnly':!![],..._0x56c602&&{'singleFilePath':_0x56c602}}};return this['segmentPushCommand'][_0x550c14(0x14a)](_0x1ca06c);}}export class JourneyVersionsCommand extends BaseCommand{[a26_0x40e223(0x179)]='journey:versions';[a26_0x40e223(0x183)]=a26_0x40e223(0x251);async[a26_0x40e223(0x14a)](_0x4c66a7){const _0x1e71da=a26_0x40e223,{options:_0x36dc46,args:_0x7c7c64,tdx:_0x557c4a}=_0x4c66a7,_0x43f061=_0x7c7c64[0x0];if(!requireNameOrPath(_0x43f061))return 0x1;if(_0x36dc46[_0x1e71da(0x1e1)])console[_0x1e71da(0x1fe)]('Input:\x20'+_0x43f061);const {journeyId:_0x582885}=await resolveJourneyIdFromInput(_0x43f061,_0x36dc46,_0x557c4a),_0x1b8a66=await withSpinner(_0x1e71da(0x1e8),()=>_0x557c4a['journey'][_0x1e71da(0x1f5)](_0x582885),{'verbose':_0x36dc46[_0x1e71da(0x1e1)]}),{bundleName:_0x14b854,versions:_0x5c14f1,latestJourneyId:_0x233495}=_0x1b8a66['data'];console['error'](_0x14b854+':\x20'+_0x5c14f1['length']+_0x1e71da(0x1d0)+(_0x5c14f1[_0x1e71da(0x18d)]!==0x1?'s':''));const _0x4543a3=_0x5c14f1[_0x1e71da(0x1f1)](_0x4b8bb9=>({'version':_0x4b8bb9['versionNumber'],'journey_id':_0x4b8bb9[_0x1e71da(0x1d7)],'name':_0x4b8bb9[_0x1e71da(0x179)],'state':_0x4b8bb9[_0x1e71da(0x20e)],'paused':_0x4b8bb9[_0x1e71da(0x20c)],'latest':_0x4b8bb9[_0x1e71da(0x1d7)]===_0x233495,'created_at':_0x4b8bb9[_0x1e71da(0x1b7)]}));return await handleSDKOutput(_0x4543a3,_0x36dc46),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a26_0x40e223(0x179)]=a26_0x40e223(0x155);[a26_0x40e223(0x183)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async['execute'](_0x25e84a){const _0x4abdc0=a26_0x40e223,{options:_0x1bf6a7,args:_0x5c2f8b,tdx:_0x63e7c8}=_0x25e84a,_0x23129b=_0x5c2f8b[0x0];if(!requireNameOrPath(_0x23129b))return 0x1;if(_0x1bf6a7['verbose'])console[_0x4abdc0(0x1fe)](_0x4abdc0(0x248)+_0x23129b);const {journeyId:_0x5f30a9,journeyName:_0x580731}=await resolveJourneyIdFromInput(_0x23129b,_0x1bf6a7,_0x63e7c8);if(!_0x1bf6a7[_0x4abdc0(0x246)]){const _0x636159=await confirm(_0x4abdc0(0x1e9)+_0x580731+'\x22?');if(!_0x636159)return console[_0x4abdc0(0x1fe)](_0x4abdc0(0x229)),0x0;}const _0x972cbc=await withSpinner(_0x4abdc0(0x177),()=>_0x63e7c8[_0x4abdc0(0x24a)][_0x4abdc0(0x1d8)](_0x5f30a9),{'verbose':_0x1bf6a7[_0x4abdc0(0x1e1)]}),_0x51fef7=_0x972cbc[_0x4abdc0(0x243)];return console[_0x4abdc0(0x1fe)](a26_0x1e1b3b['green']('✔')+_0x4abdc0(0x212)+_0x51fef7['attributes'][_0x4abdc0(0x180)]+'\x20(draft)\x20—\x20\x22'+_0x51fef7['attributes'][_0x4abdc0(0x179)]+'\x22'),console['error'](_0x4abdc0(0x1e5)+_0x51fef7['id']),await handleSingleObjectOutput({'id':_0x51fef7['id'],'name':_0x51fef7[_0x4abdc0(0x253)]['name'],'version':_0x51fef7['attributes'][_0x4abdc0(0x180)],'state':_0x51fef7[_0x4abdc0(0x253)]['state'],'bundle_id':_0x51fef7[_0x4abdc0(0x253)]['journeyBundleId'],'created_at':_0x51fef7['attributes']['createdAt']},_0x1bf6a7),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a26_0x40e223(0x15c);[a26_0x40e223(0x183)]=a26_0x40e223(0x158);async['execute'](_0x219051){const _0x2ffc27=a26_0x40e223,{options:_0x382c89,args:_0x23fbde,tdx:_0x339405}=_0x219051,_0x308a24=_0x23fbde[0x0];if(!requireNameOrPath(_0x308a24))return 0x1;const _0x1a3b4c=_0x382c89[_0x2ffc27(0x1fd)];if(!_0x1a3b4c)return console[_0x2ffc27(0x1fe)](_0x2ffc27(0x14f)),console[_0x2ffc27(0x1fe)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x1d7347=parseInt(_0x1a3b4c,0xa);if(isNaN(_0x1d7347)||_0x1d7347<0x1)return console[_0x2ffc27(0x1fe)](_0x2ffc27(0x170)+_0x1a3b4c),0x1;if(_0x382c89[_0x2ffc27(0x1e1)])console[_0x2ffc27(0x1fe)](_0x2ffc27(0x248)+_0x308a24+_0x2ffc27(0x1ab)+_0x1d7347);const {journeyId:_0x1e8cca,parentSegmentId:_0x2a6457}=await resolveJourneyIdFromInput(_0x308a24,_0x382c89,_0x339405),_0x53d1ba=await withSpinner('Resolving\x20version...',()=>_0x339405['journey'][_0x2ffc27(0x1f5)](_0x1e8cca),{'verbose':_0x382c89[_0x2ffc27(0x1e1)]}),{versions:_0x10bf71,latestJourneyId:_0x18c307}=_0x53d1ba[_0x2ffc27(0x243)],_0x3ec7a6=_0x10bf71[_0x2ffc27(0x1da)](_0x11805e=>_0x11805e[_0x2ffc27(0x180)]===_0x1d7347);if(!_0x3ec7a6){const _0x23f937=_0x10bf71['map'](_0x3e0ecb=>'v'+_0x3e0ecb[_0x2ffc27(0x180)])[_0x2ffc27(0x162)](',\x20');return console['error'](_0x2ffc27(0x18a)+_0x1d7347+_0x2ffc27(0x1a5)+_0x23f937),0x1;}const _0x5a9f57=await withSpinner(_0x2ffc27(0x22e)+_0x1d7347+_0x2ffc27(0x240),()=>_0x339405[_0x2ffc27(0x24a)][_0x2ffc27(0x22a)](_0x3ec7a6[_0x2ffc27(0x1d7)]),{'verbose':_0x382c89[_0x2ffc27(0x1e1)]}),_0x457d6a=_0x5a9f57[_0x2ffc27(0x243)],_0x20ce3a=getConsoleNextUrl(_0x382c89['site'],_0x2ffc27(0x22c)+_0x2a6457+_0x2ffc27(0x193)+_0x3ec7a6[_0x2ffc27(0x1d7)]+_0x2ffc27(0x148));return await handleSingleObjectOutput({'id':_0x457d6a['id'],'name':_0x457d6a[_0x2ffc27(0x253)][_0x2ffc27(0x179)],'version':_0x457d6a[_0x2ffc27(0x253)][_0x2ffc27(0x180)],'description':_0x457d6a['attributes'][_0x2ffc27(0x183)],'state':_0x457d6a['attributes']['state'],'paused':_0x457d6a[_0x2ffc27(0x253)][_0x2ffc27(0x20c)],'reentry_mode':_0x457d6a[_0x2ffc27(0x253)][_0x2ffc27(0x150)],'stages':_0x457d6a[_0x2ffc27(0x253)][_0x2ffc27(0x189)]?.['length']||0x0,..._0x457d6a[_0x2ffc27(0x253)][_0x2ffc27(0x17e)]&&{'goal':_0x457d6a[_0x2ffc27(0x253)][_0x2ffc27(0x17e)]['name']},'latest':_0x3ec7a6['journeyId']===_0x18c307,'created_at':_0x457d6a[_0x2ffc27(0x253)]['createdAt'],'updated_at':_0x457d6a[_0x2ffc27(0x253)][_0x2ffc27(0x192)],'url':_0x20ce3a},_0x382c89),0x0;}}
1
+ const a26_0xa84a1d=a26_0x250c;(function(_0x5af22c,_0x417e8e){const _0x4f4631=a26_0x250c,_0x2cb1a7=_0x5af22c();while(!![]){try{const _0x36f958=-parseInt(_0x4f4631(0x1c6))/0x1+parseInt(_0x4f4631(0x200))/0x2+-parseInt(_0x4f4631(0x231))/0x3*(-parseInt(_0x4f4631(0x1f6))/0x4)+-parseInt(_0x4f4631(0x212))/0x5+parseInt(_0x4f4631(0x1a6))/0x6+-parseInt(_0x4f4631(0x1c4))/0x7+parseInt(_0x4f4631(0x1d0))/0x8*(-parseInt(_0x4f4631(0x27c))/0x9);if(_0x36f958===_0x417e8e)break;else _0x2cb1a7['push'](_0x2cb1a7['shift']());}catch(_0x6b1caa){_0x2cb1a7['push'](_0x2cb1a7['shift']());}}}(a26_0x2e36,0x670d2));import a26_0xce81a1 from'chalk';import a26_0x5a6c84 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a26_0x250c(_0x2b937d,_0x532a1a){_0x2b937d=_0x2b937d-0x180;const _0x2e3668=a26_0x2e36();let _0x250c94=_0x2e3668[_0x2b937d];return _0x250c94;}import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x535178){const _0x19d41a=a26_0x250c;return!_0x535178&&(console[_0x19d41a(0x21f)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x19d41a(0x1e8))),!!_0x535178;}function withJsonFormat(_0x205dfd){const _0x1ecb0a=a26_0x250c;if(!_0x205dfd[_0x1ecb0a(0x249)]&&!_0x205dfd['json']&&!_0x205dfd[_0x1ecb0a(0x24c)]&&!_0x205dfd[_0x1ecb0a(0x1c5)])return{..._0x205dfd,'format':'json','json':!![]};return _0x205dfd;}function formatJourneyState(_0x506f05){const _0x361206=a26_0x250c;switch(_0x506f05){case _0x361206(0x284):return a26_0xce81a1[_0x361206(0x1e4)]('(running)');case _0x361206(0x1f1):return a26_0xce81a1[_0x361206(0x1c8)]('(draft)');case _0x361206(0x1c0):return a26_0xce81a1['yellow'](_0x361206(0x26e));case'completed':return a26_0xce81a1[_0x361206(0x269)](_0x361206(0x20c));case _0x361206(0x1d9):return a26_0xce81a1[_0x361206(0x1c8)]('(archived)');default:return'('+_0x506f05+')';}}function formatJourneyItem(_0x5e6eb1,_0x7d4157='',_0x25210b){const _0xdb898e=a26_0x250c,_0x9970c1=formatJourneyState(_0x5e6eb1[_0xdb898e(0x22f)]),_0x309b15=_0x25210b?hyperlink(_0x5e6eb1[_0xdb898e(0x216)],_0x25210b):_0x5e6eb1[_0xdb898e(0x216)];return _0x7d4157+'🗺️\x20'+_0x309b15+'\x20'+_0x9970c1;}function escapeRegex(_0x149cda){const _0x45ba7b=a26_0x250c;return _0x149cda[_0x45ba7b(0x218)](/[.*+?^${}()|[\]\\]/g,_0x45ba7b(0x1f8));}function globToRegex(_0x1f29eb){const _0xa40eeb=a26_0x250c,_0x5d5414=_0x1f29eb[_0xa40eeb(0x180)]('*')[_0xa40eeb(0x211)](escapeRegex);return new RegExp(_0x5d5414[_0xa40eeb(0x25e)]('.*'),'i');}function buildRuleToNameMapping(_0x528e57){const _0x1cdf20=a26_0x250c,_0x2fa102=new Map();if(_0x528e57[_0x1cdf20(0x250)])for(const [_0x2c5e39,_0x31990e]of Object['entries'](_0x528e57[_0x1cdf20(0x250)])){if(_0x31990e[_0x1cdf20(0x1d6)]){const _0x4da1a6=serializeRule(_0x31990e['rule']),_0x3e7617=_0x2fa102[_0x1cdf20(0x213)](_0x4da1a6);_0x3e7617?_0x3e7617[_0x1cdf20(0x1da)](_0x2c5e39):_0x2fa102[_0x1cdf20(0x196)](_0x4da1a6,[_0x2c5e39]);}}return _0x2fa102;}async function resolveJourneyIdFromInput(_0x5312a0,_0x25d5b8,_0x44baf9){const _0x3260c4=a26_0x250c,_0x1a9d07=await resolveJourneyTarget(_0x5312a0,_0x25d5b8[_0x3260c4(0x220)],_0x25d5b8[_0x3260c4(0x20f)]),_0x17e977=_0x1a9d07[_0x3260c4(0x220)];if(!_0x17e977)throw new SDKError(ErrorCode[_0x3260c4(0x233)],_0x3260c4(0x271));const _0x5d9fb7=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x44baf9[_0x3260c4(0x1ae)][_0x3260c4(0x24d)](_0x17e977),{'verbose':_0x25d5b8['verbose']}),_0x370b3a=_0x5d9fb7[_0x3260c4(0x226)],_0x149aa9=await withSpinner(_0x3260c4(0x1ba),()=>_0x44baf9[_0x3260c4(0x1d1)][_0x3260c4(0x219)](_0x370b3a,_0x1a9d07[_0x3260c4(0x1c3)]),{'verbose':_0x25d5b8[_0x3260c4(0x20f)]});return{'journeyId':_0x149aa9[_0x3260c4(0x226)],'journeyName':_0x1a9d07[_0x3260c4(0x1c3)],'parentSegmentId':_0x370b3a};}async function resolveJourneyTarget(_0x4e6423,_0x48603a,_0x4c875c){const _0x5a3d44=a26_0x250c;if(isYamlFilePath(_0x4e6423))try{const _0x32a925=await resolveYamlFilePath(_0x4e6423);return _0x4c875c&&(console[_0x5a3d44(0x21f)]('Resolved\x20YAML\x20file:\x20'+_0x4e6423),console['error'](_0x5a3d44(0x1b4)+_0x32a925['parentSegment']),console['error'](_0x5a3d44(0x276)+_0x32a925[_0x5a3d44(0x27f)]),console[_0x5a3d44(0x21f)](_0x5a3d44(0x280)+(_0x32a925[_0x5a3d44(0x1bc)]||_0x5a3d44(0x241)))),{'journeyName':_0x32a925[_0x5a3d44(0x27f)],'parentSegment':_0x32a925['parentSegment'],'resolved':_0x32a925};}catch(_0x5b9488){throw new SDKError(ErrorCode[_0x5a3d44(0x233)],_0x5a3d44(0x24b)+_0x5b9488[_0x5a3d44(0x27a)]);}if(!_0x48603a)throw new SDKError(ErrorCode[_0x5a3d44(0x233)],_0x5a3d44(0x1fc));return{'journeyName':_0x4e6423,'parentSegment':_0x48603a};}export class JourneyListCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x26f);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x209);async[a26_0xa84a1d(0x288)](_0x499b72){const _0x259bdd=a26_0xa84a1d,{options:_0x55afd7,args:_0x53ef12,tdx:_0x25a234}=_0x499b72,_0x5b2280=_0x53ef12[0x0],_0x396928=_0x55afd7[_0x259bdd(0x220)];if(!_0x396928)return console[_0x259bdd(0x21f)](_0x259bdd(0x26a)),console[_0x259bdd(0x21f)](_0x259bdd(0x237)),0x1;const _0x27a236=await withSpinner(_0x259bdd(0x26b),()=>_0x25a234['segment'][_0x259bdd(0x24d)](_0x396928),{'verbose':_0x55afd7[_0x259bdd(0x20f)]}),_0x234973=_0x27a236['data'];_0x55afd7[_0x259bdd(0x20f)]&&(console[_0x259bdd(0x21f)](_0x259bdd(0x23f)+_0x396928+_0x259bdd(0x1cd)+_0x234973+')'),_0x5b2280&&console[_0x259bdd(0x21f)](_0x259bdd(0x270)+_0x5b2280));const _0x2bf87f=await withSpinner(_0x259bdd(0x1a2),()=>_0x25a234[_0x259bdd(0x1ae)][_0x259bdd(0x229)](_0x234973),{'verbose':_0x55afd7[_0x259bdd(0x20f)]}),_0x2176d3=_0x2bf87f['data'],_0x4047a8=_0x2176d3[_0x259bdd(0x23c)],_0x52f6c6=await withSpinner(_0x259bdd(0x206),()=>_0x25a234[_0x259bdd(0x1d1)][_0x259bdd(0x258)](_0x234973,_0x4047a8),{'verbose':_0x55afd7['verbose']});let _0x47f62e=_0x52f6c6[_0x259bdd(0x226)]['journeys'];const _0x171cdf=_0x52f6c6[_0x259bdd(0x226)][_0x259bdd(0x1ad)],_0x59ae34=new Map();for(const _0x42a659 of _0x171cdf){_0x59ae34[_0x259bdd(0x196)](_0x42a659['id'],_0x42a659[_0x259bdd(0x1f9)]);}if(_0x5b2280){const _0x88030b=globToRegex(_0x5b2280);_0x47f62e=_0x47f62e[_0x259bdd(0x247)](_0x3fdfaf=>_0x88030b[_0x259bdd(0x1ef)](_0x3fdfaf['journeyBundleName']));}console[_0x259bdd(0x21f)](_0x259bdd(0x1d5)+_0x47f62e['length']+'\x20journey'+(_0x47f62e[_0x259bdd(0x1a7)]!==0x1?'s':''));const _0x33c1a2=_0x4c6f10=>{const _0x2bfe8b=_0x259bdd;return getConsoleNextUrl(_0x55afd7['site'],'/app/ps/'+_0x234973+_0x2bfe8b(0x1bf)+_0x4c6f10+'/j/da');};if(_0x55afd7[_0x259bdd(0x249)]==='table')await handleSDKOutput(_0x47f62e,_0x55afd7);else{if(_0x55afd7['format']===_0x259bdd(0x257)){const _0x4c5da7=_0x47f62e[_0x259bdd(0x211)](_0x20fcbe=>({..._0x20fcbe,'url':_0x33c1a2(_0x20fcbe['id'])}));await handleSDKOutput(_0x4c5da7,_0x55afd7);}else{console['log']('['+_0x396928+']');const _0x2be052=new Map(),_0x3da8cb=[];for(const _0x1ed05c of _0x47f62e){if(!_0x1ed05c[_0x259bdd(0x28b)]||_0x1ed05c[_0x259bdd(0x28b)]===_0x4047a8)_0x3da8cb['push'](_0x1ed05c);else{const _0x4d0548=_0x2be052[_0x259bdd(0x213)](_0x1ed05c['folderId'])||[];_0x4d0548[_0x259bdd(0x1da)](_0x1ed05c),_0x2be052['set'](_0x1ed05c[_0x259bdd(0x28b)],_0x4d0548);}}const _0x50b78b=(_0x2f557c,_0x349d83)=>_0x2f557c[_0x259bdd(0x216)][_0x259bdd(0x26d)](_0x349d83[_0x259bdd(0x216)],undefined,{'sensitivity':_0x259bdd(0x25f)});_0x3da8cb[_0x259bdd(0x234)](_0x50b78b);for(const _0x57cfe4 of _0x3da8cb){console[_0x259bdd(0x185)](formatJourneyItem(_0x57cfe4,'',_0x33c1a2(_0x57cfe4['id'])));}const _0x276873=[..._0x2be052['entries']()][_0x259bdd(0x234)]((_0x35835a,_0x20d4a8)=>{const _0x33c386=_0x259bdd,_0x5e9f73=_0x59ae34[_0x33c386(0x213)](_0x35835a[0x0])||_0x35835a[0x0],_0xf77f77=_0x59ae34['get'](_0x20d4a8[0x0])||_0x20d4a8[0x0];return _0x5e9f73['localeCompare'](_0xf77f77,undefined,{'sensitivity':_0x33c386(0x25f)});});for(const [_0x2186ff,_0x1a14db]of _0x276873){const _0x49257c=_0x59ae34[_0x259bdd(0x213)](_0x2186ff)||_0x2186ff;console['log'](_0x259bdd(0x18e)+_0x49257c),_0x1a14db[_0x259bdd(0x234)](_0x50b78b);for(const _0xbfa862 of _0x1a14db){console[_0x259bdd(0x185)](formatJourneyItem(_0xbfa862,'\x20\x20',_0x33c1a2(_0xbfa862['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1a4);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x264);async[a26_0xa84a1d(0x288)](_0x299fd3){const _0x571392=a26_0xa84a1d,{options:_0x3153ef,args:_0x299028,tdx:_0x25597e}=_0x299fd3,_0x5449e6=_0x299028[0x0];if(!_0x5449e6)return console[_0x571392(0x21f)](_0x571392(0x1ee)),console[_0x571392(0x21f)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x571392(0x21f)](_0x571392(0x193)),console['error'](_0x571392(0x201)),0x1;_0x3153ef[_0x571392(0x20f)]&&console[_0x571392(0x21f)](_0x571392(0x240)+_0x5449e6);const {journeyId:_0x1bd727,parentSegmentId:_0x172fc6}=await resolveJourneyIdFromInput(_0x5449e6,_0x3153ef,_0x25597e);if(_0x3153ef[_0x571392(0x205)]){const _0x4ded38=getConsoleNextUrl(_0x3153ef[_0x571392(0x236)],_0x571392(0x21a)+_0x172fc6+'/e/'+_0x1bd727+'/j/da/je');return console[_0x571392(0x21f)](a26_0xce81a1[_0x571392(0x1e4)]('✔')+_0x571392(0x1b0)+a26_0xce81a1[_0x571392(0x223)](_0x4ded38)),openBrowser(_0x4ded38),0x0;}const _0x4c7bb1=await withSpinner(_0x571392(0x20a),()=>_0x25597e['journey'][_0x571392(0x1eb)](_0x1bd727),{'verbose':_0x3153ef[_0x571392(0x20f)]}),_0x1b2da4=_0x4c7bb1[_0x571392(0x226)],_0x5ed23d=_0x3153ef[_0x571392(0x244)];let _0x5c4040;if(_0x5ed23d)try{const _0x1f7580=await withSpinner(_0x571392(0x273),()=>_0x25597e[_0x571392(0x1d1)][_0x571392(0x18d)](_0x1bd727),{'verbose':_0x3153ef[_0x571392(0x20f)]});_0x5c4040=_0x1f7580[_0x571392(0x226)];}catch{_0x3153ef[_0x571392(0x20f)]&&console[_0x571392(0x21f)](_0x571392(0x238));}const _0x20f306=getConsoleNextUrl(_0x3153ef['site'],'/app/ps/'+_0x172fc6+'/e/'+_0x1bd727+_0x571392(0x1c7)),_0x50debb={'id':_0x1b2da4['id'],'name':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x1f9)],'description':_0x1b2da4['attributes'][_0x571392(0x1cc)],'state':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x22f)],'paused':_0x1b2da4['attributes'][_0x571392(0x1c0)],'reentry_mode':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x228)],'stages':_0x1b2da4[_0x571392(0x1b8)][_0x571392(0x227)]?.[_0x571392(0x1a7)]||0x0,..._0x1b2da4[_0x571392(0x1b8)][_0x571392(0x26c)]&&{'goal':_0x1b2da4['attributes'][_0x571392(0x26c)][_0x571392(0x1f9)]},..._0x5c4040&&{'statistics':{'size':_0x5c4040[_0x571392(0x1fa)],'entered':_0x5c4040[_0x571392(0x1f2)],'goal_achieved':_0x5c4040[_0x571392(0x225)],'completion_rate':_0x5c4040[_0x571392(0x198)],'exit_or_jump':_0x5c4040['exitOrJumpSize'],'exit_or_jump_rate':_0x5c4040['exitOrJumpRate'],'stages':_0x5c4040['stages']}},'url':_0x20f306};return await handleSingleObjectOutput(_0x50debb,_0x3153ef),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x243);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x22c);async['execute'](_0x212411){const _0x172f9b=a26_0xa84a1d,{options:_0x40ead7,args:_0x5acfe1,tdx:_0x2bedc3}=_0x212411,_0x2eb440=_0x5acfe1[0x0];if(!requireNameOrPath(_0x2eb440))return 0x1;_0x40ead7['verbose']&&console[_0x172f9b(0x21f)]('Input:\x20'+_0x2eb440);const _0x43828e=_0x40ead7,_0x3f690c=_0x43828e[_0x172f9b(0x282)],_0x3b0d51=_0x43828e['to'],_0x584634=_0x43828e[_0x172f9b(0x1e5)],_0x4b38ad=_0x43828e['stage'];_0x584634&&!_0x3f690c&&!_0x3b0d51&&console['error']('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x2438c3=_0x584634?withJsonFormat(_0x40ead7):_0x40ead7,{journeyId:_0x282dc1,journeyName:_0x3d4050}=await resolveJourneyIdFromInput(_0x2eb440,_0x2438c3,_0x2bedc3),_0x2e8281=_0x3f690c||_0x3b0d51?{'from':_0x3f690c,'to':_0x3b0d51}:undefined,_0xc66f3=await withSpinner(_0x172f9b(0x273),()=>Promise[_0x172f9b(0x28c)]([_0x2bedc3['journey'][_0x172f9b(0x1eb)](_0x282dc1),_0x2bedc3[_0x172f9b(0x1d1)][_0x172f9b(0x18d)](_0x282dc1,_0x2e8281)]),{'verbose':_0x2438c3[_0x172f9b(0x20f)]}),[_0x20f7cd,_0x54341e]=_0xc66f3[_0x172f9b(0x226)];if(!_0x54341e||_0x54341e[_0x172f9b(0x1fb)]===null)return console[_0x172f9b(0x21f)](_0x172f9b(0x1a0)+_0x3d4050),console['error'](_0x172f9b(0x268)),0x0;const _0x51feab=buildStageNameMap(_0x20f7cd),_0x2d8761=!!(_0x2e8281&&_0x54341e['history']?.[_0x172f9b(0x1a7)]),_0x584a4a={'stageNameMap':_0x51feab,'hasPeriod':_0x2d8761,'includeHistory':!!_0x584634};if(_0x4b38ad&&_0x54341e['stages']){const _0x522094=_0x54341e[_0x172f9b(0x1e9)][_0x172f9b(0x286)](_0x18edf3=>{const _0x4ff8b1=_0x172f9b,_0xa6a3c5=_0x51feab[_0x4ff8b1(0x213)](_0x18edf3['id'])??'';return _0xa6a3c5[_0x4ff8b1(0x1ce)]()===_0x4b38ad['toLowerCase']();});if(_0x522094)return await handleSingleObjectOutput(formatStageStats(_0x522094,_0x584a4a),_0x2438c3),0x0;const _0x4eb3e9=_0x54341e['stages'][_0x172f9b(0x211)](_0x1ca316=>_0x51feab[_0x172f9b(0x213)](_0x1ca316['id'])??_0x1ca316['id']);return console[_0x172f9b(0x21f)](_0x172f9b(0x24a)+_0x4b38ad+_0x172f9b(0x279)),console[_0x172f9b(0x21f)](_0x172f9b(0x1a1)+_0x4eb3e9[_0x172f9b(0x25e)](',\x20')),0x1;}const _0x42deb6=_0x54341e['stages']?.[_0x172f9b(0x211)](_0x4e0342=>formatStageStats(_0x4e0342,_0x584a4a)),_0x32fda3=assembleJourneyStats(_0x54341e,{'from':_0x3f690c,'to':_0x3b0d51,'includeHistory':_0x584634});return await this[_0x172f9b(0x1dc)](_0x32fda3,_0x42deb6??[],_0x2438c3),0x0;}async['renderStats'](_0x4b2939,_0x5327af,_0x5c13ec){const _0x2d6d29=a26_0xa84a1d,_0x4c3b8e=_0x5c13ec[_0x2d6d29(0x249)]===_0x2d6d29(0x257)||_0x5c13ec[_0x2d6d29(0x249)]==='jsonl'||_0x5c13ec[_0x2d6d29(0x257)]||_0x5c13ec[_0x2d6d29(0x24c)];if(_0x4c3b8e){_0x4b2939['stages']=_0x5327af,await handleSingleObjectOutput(_0x4b2939,_0x5c13ec);return;}await handleSingleObjectOutput(_0x4b2939,_0x5c13ec);for(const _0x2180a1 of _0x5327af){console[_0x2d6d29(0x185)](''),console['log'](String(a26_0xce81a1[_0x2d6d29(0x223)][_0x2d6d29(0x210)]('['+_0x2180a1[_0x2d6d29(0x1f9)]+']'))+a26_0xce81a1[_0x2d6d29(0x1c8)]('\x20'+_0x2180a1['id']));const {id:_0x2a1961,name:_0x24d97a,..._0x38d69a}=_0x2180a1;await handleSingleObjectOutput(_0x38d69a,_0x5c13ec);}}}function a26_0x2e36(){const _0x464567=['\x20journeys','folders','segment','Fetching\x20journeys\x20and\x20folders...','\x20Opening\x20','cwd','version','getColumnMapping','\x20\x20Parent\x20segment:\x20','\x20version','add','Error:\x20Journey\x20\x27','attributes','Target\x20directory:\x20','Resolving\x20journey...','\x20files?','folderPath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parent_segment','/e/','paused','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','hasPeriod','journeyName','2641009YcsCQx','tsv','109062gZBhVj','/j/da/je','dim','\x20\x20-\x20','Error:\x20','listVersions','description','\x20(ID:\x20','toLowerCase','✔\x20Journey\x20\x22','8NJPzlC','journey','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Aborted.','journey:version:create','✔\x20Found\x20','rule','\x20=\x20','journey:traffic','archived','push','Table:\x20','renderStats','yes','setPhase','connection','journey:activations','relative','journey:columns','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','green','includeHistory','Getting\x20version\x20','limit','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','stages','Folder\x20path:\x20','getJourney','\x0aError:','history','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','test','✔\x20Context\x20set:\x20','draft','enteredSize','journey:versions','Error:\x20Version\x20','\x20activation','8HFuxkI','\x20details...','\x5c$&','name','size','journeyId','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','isNew','\x22\x20paused','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','1261220OZmXrf','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Found\x20','journey:resume','Resuming\x20journey...','web','Listing\x20journeys...','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20changed\x20files','List\x20journeys\x20in\x20current\x20context','Getting\x20journey\x20details...','View\x20a\x20specific\x20version\x20of\x20a\x20journey','(completed)','-\x20no\x20files\x20written','Getting\x20journey\x20traffic\x20data...','verbose','bold','map','619975oLkmPu','get','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','.yml','journeyBundleName','pause','replace','resolveJourneyId','/app/ps/','Write\x20','Getting\x20column\x20mapping...','repeat','\x22\x20resumed','error','parentSegment','\x20not\x20found.\x20Available:\x20','Fetching\x20users\x20and\x20connections...','cyan','journeyBundleId','goalSize','data','journeyStages','reentryMode','getParentFull','Cancelled','absolutePath','Show\x20journey\x20statistics','\x20(rule\x20match)','getSegment','state','listActivationsFlat','104568vQcDJR','utf-8','INVALID_ARGUMENT','sort','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','site','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20\x20Statistics\x20not\x20available','Pause\x20a\x20running\x20journey','user','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','rootFolderId','Listing\x20journey\x20activations...','stringify','Parent\x20segment:\x20','Input:\x20','(root)','getActivation','journey:stats','includeStats','resume','...','filter','Warning:\x20Could\x20not\x20resolve\x20activation\x20','format','Error:\x20Stage\x20\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','jsonl','resolveParentId','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','List\x20activations\x20for\x20a\x20journey','segments','conversion','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','journey:pause','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','values','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','json','listJourneysWithFolders','file','milestoneSize','completeMilestoneRate','listJourneysFromParentSegment','\x20->\x20','join','base','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','relativePath','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','has','Show\x20journey\x20details','links','Error:\x20Invalid\x20version\x20number:\x20','session','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','blue','Error:\x20Parent\x20segment\x20context\x20required','Resolving\x20parent\x20segment...','goal','localeCompare','(paused)','journey:list','Pattern:\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','audienceId','Getting\x20journey\x20statistics...','✔\x20Pulled\x20','\x20\x20Journey\x20ID:\x20','\x20\x20Name:\x20','Resume\x20a\x20paused\x20journey','tdx.json','\x22\x20not\x20found','message','\x0aChanges\x20to\x20\x27','2872431bnBnKe','helpText','connector_config','segmentName','\x20\x20Folder\x20path:\x20','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','from','Fetching\x20','launched','resourceName','find','buildIdToEmailMap','execute','then','updatedAt','folderId','all','split','Database:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','root\x20folder','versionNumber','log','yellow','activationParams','segmentPushCommand','columns','diff','Error:\x20Invalid\x20--type\x20\x22','dryRun','getStatistics','📁\x20','exitOrJumpSize','type','Journey\x20name:\x20','\x0aPull\x20summary:','Options:','No\x20journeys\x20found','args','set','Error:\x20Journey\x20not\x20found:\x20','completionRate','hasChanges','options','Listing\x20journey\x20versions...','activation','createdAt','Error:\x20--version\x20option\x20is\x20required','Show\x20journey\x20table\x20column\x20mapping','No\x20statistics\x20available\x20for\x20journey:\x20','Available\x20stages:\x20','Fetching\x20parent\x20segment...','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','journey:view','filePath','3907674nWBUbL','length','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','red'];a26_0x2e36=function(){return _0x464567;};return a26_0x2e36();}export class JourneyTrafficCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1d8);['description']=a26_0xa84a1d(0x252);async[a26_0xa84a1d(0x288)](_0x9d4bfe){const _0x21f811=a26_0xa84a1d,{options:_0x329a97,args:_0x45266e,tdx:_0x1123e9}=_0x9d4bfe,_0x5375ec=_0x45266e[0x0];if(!requireNameOrPath(_0x5375ec))return 0x1;_0x329a97[_0x21f811(0x20f)]&&console['error'](_0x21f811(0x240)+_0x5375ec);const _0x2559ec=_0x329a97,_0x3fa8e8=_0x2559ec['type'],_0x3b575d=_0x2559ec['from'],_0x5879c5=_0x2559ec['to'],_0x3e0877=_0x2559ec[_0x21f811(0x1e7)];if(_0x3fa8e8&&_0x3fa8e8!==_0x21f811(0x251)&&_0x3fa8e8!==_0x21f811(0x19c))return console[_0x21f811(0x21f)](_0x21f811(0x18b)+_0x3fa8e8+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x5bb337=withJsonFormat(_0x329a97),{journeyId:_0x48fad7,journeyName:_0x5009ac}=await resolveJourneyIdFromInput(_0x5375ec,_0x5bb337,_0x1123e9),_0x440f1c={'type':_0x3fa8e8,'from':_0x3b575d,'to':_0x5879c5,'limit':_0x3e0877},_0x154edc=await withSpinner(_0x21f811(0x20e),()=>_0x1123e9[_0x21f811(0x1d1)]['getTrafficData'](_0x48fad7,_0x440f1c),{'verbose':_0x5bb337[_0x21f811(0x20f)]}),_0x502360=_0x154edc[_0x21f811(0x226)],_0x1a5cb7=_0x502360['conversion']&&(_0x502360[_0x21f811(0x251)]['nodes'][_0x21f811(0x1a7)]>0x0||_0x502360[_0x21f811(0x251)][_0x21f811(0x265)][_0x21f811(0x1a7)]>0x0),_0x62c92f=_0x502360[_0x21f811(0x19c)]&&_0x502360[_0x21f811(0x19c)]['length']>0x0;if(!_0x1a5cb7&&!_0x62c92f)return console['error'](_0x21f811(0x281)+_0x5009ac),console[_0x21f811(0x21f)](_0x21f811(0x214)),_0x3b575d&&_0x5879c5&&console[_0x21f811(0x21f)](_0x21f811(0x1e3)),0x0;return await handleSingleObjectOutput(_0x502360,_0x5bb337),0x0;}}function formatStageStats(_0x17ea29,_0x10d21b){const _0x3c4120=a26_0xa84a1d,_0xd85232=_0x10d21b[_0x3c4120(0x1c2)]&&_0x17ea29[_0x3c4120(0x1ed)]?.[_0x3c4120(0x1a7)]?aggregateStageHistory(_0x17ea29[_0x3c4120(0x1ed)]):{'size':_0x17ea29['size'],'entered':_0x17ea29[_0x3c4120(0x1f2)],'milestone':_0x17ea29[_0x3c4120(0x25a)],'milestone_rate':_0x17ea29[_0x3c4120(0x25b)],'exit_or_jump':_0x17ea29[_0x3c4120(0x18f)],'exit_or_jump_rate':_0x17ea29['exitOrJumpRate']},_0x5687bb={'id':_0x17ea29['id'],'name':_0x10d21b['stageNameMap'][_0x3c4120(0x213)](_0x17ea29['id'])??_0x17ea29['id'],..._0xd85232};return _0x10d21b[_0x3c4120(0x1c2)]&&_0x10d21b[_0x3c4120(0x1e5)]&&_0x17ea29[_0x3c4120(0x1ed)]&&(_0x5687bb[_0x3c4120(0x1ed)]=_0x17ea29['history']),_0x5687bb;}export class JourneyPauseCommand extends BaseCommand{['name']=a26_0xa84a1d(0x253);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x239);async[a26_0xa84a1d(0x288)](_0x308415){const _0x5346e0=a26_0xa84a1d,{options:_0x2b99b5,args:_0x3c5f27,tdx:_0x37f3d1}=_0x308415,_0x581ad2=_0x3c5f27[0x0];if(!requireNameOrPath(_0x581ad2))return 0x1;_0x2b99b5[_0x5346e0(0x20f)]&&console[_0x5346e0(0x21f)]('Input:\x20'+_0x581ad2);const {journeyId:_0x3bca2c,journeyName:_0x6e03af}=await resolveJourneyIdFromInput(_0x581ad2,_0x2b99b5,_0x37f3d1);if(!_0x2b99b5[_0x5346e0(0x1dd)]){const _0x5269f7=await confirm(_0x5346e0(0x262)+_0x6e03af+'\x22?');if(!_0x5269f7)return console[_0x5346e0(0x21f)]('Cancelled'),0x0;}const _0x485422=await withSpinner('Pausing\x20journey...',()=>_0x37f3d1[_0x5346e0(0x1d1)][_0x5346e0(0x217)](_0x3bca2c),{'verbose':_0x2b99b5[_0x5346e0(0x20f)]}),_0x2e3bc9=_0x485422[_0x5346e0(0x226)];return console[_0x5346e0(0x21f)](_0x5346e0(0x1cf)+_0x2e3bc9['attributes'][_0x5346e0(0x1f9)]+_0x5346e0(0x1fe)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x203);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x277);async[a26_0xa84a1d(0x288)](_0x36c288){const _0x1cea92=a26_0xa84a1d,{options:_0x2af1b2,args:_0x109afe,tdx:_0x13836e}=_0x36c288,_0x1bc176=_0x109afe[0x0];if(!requireNameOrPath(_0x1bc176))return 0x1;_0x2af1b2[_0x1cea92(0x20f)]&&console[_0x1cea92(0x21f)](_0x1cea92(0x240)+_0x1bc176);const {journeyId:_0x122b06,journeyName:_0x3cc7c4}=await resolveJourneyIdFromInput(_0x1bc176,_0x2af1b2,_0x13836e);if(!_0x2af1b2[_0x1cea92(0x1dd)]){const _0x427fcc=await confirm(_0x1cea92(0x256)+_0x3cc7c4+'\x22?');if(!_0x427fcc)return console[_0x1cea92(0x21f)](_0x1cea92(0x22a)),0x0;}const _0x4cb2f9=await withSpinner(_0x1cea92(0x204),()=>_0x13836e[_0x1cea92(0x1d1)][_0x1cea92(0x245)](_0x122b06),{'verbose':_0x2af1b2[_0x1cea92(0x20f)]}),_0x4b7505=_0x4cb2f9[_0x1cea92(0x226)];return console[_0x1cea92(0x21f)](_0x1cea92(0x1cf)+_0x4b7505[_0x1cea92(0x1b8)][_0x1cea92(0x1f9)]+_0x1cea92(0x21e)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]='journey:pull';[a26_0xa84a1d(0x1cc)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a26_0xa84a1d(0x288)](_0x22003b){const _0x1e0f31=a26_0xa84a1d,{options:_0x140f4f,args:_0xb6634f,tdx:_0x47c9f1}=_0x22003b,_0x4ed7d7=_0x140f4f,_0x481cdc=_0xb6634f[0x0],_0x379e57=_0x481cdc&&isYamlFilePath(_0x481cdc),_0x386221=await resolveTarget({'arg':_0x379e57?_0x481cdc:undefined,'contextParent':_0x140f4f[_0x1e0f31(0x220)],'cwd':process[_0x1e0f31(0x1b1)]()});if(!isSuccessfulResolution(_0x386221))return _0x386221['errorCode']==='no_parent'?(console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x186)](_0x1e0f31(0x182))),console['error'](_0x1e0f31(0x1a3)),console[_0x1e0f31(0x21f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x1e0f31(0x21f)](_0x1e0f31(0x254)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1ab)](_0x1e0f31(0x1ca)+_0x386221[_0x1e0f31(0x27a)]+'\x0a')),_0x386221[_0x1e0f31(0x27d)]&&console['error'](a26_0xce81a1[_0x1e0f31(0x223)](_0x386221[_0x1e0f31(0x27d)]))),0x1;let _0x8250b0=_0x379e57?undefined:_0x481cdc,_0x94f9b6,_0x50d355;_0x386221[_0x1e0f31(0x190)]===_0x1e0f31(0x259)&&(_0x8250b0=_0x386221[_0x1e0f31(0x285)],_0x94f9b6=_0x386221[_0x1e0f31(0x1a5)],_0x50d355=_0x386221[_0x1e0f31(0x1bc)]);const _0x51d5b5=_0x386221['parentName'],_0x569b60=_0x386221['targetDir'];_0x4ed7d7[_0x1e0f31(0x20f)]&&(console[_0x1e0f31(0x21f)](_0x1e0f31(0x23f)+_0x51d5b5),console[_0x1e0f31(0x21f)](_0x1e0f31(0x1b9)+_0x569b60),_0x8250b0&&console[_0x1e0f31(0x21f)](_0x1e0f31(0x191)+_0x8250b0),_0x94f9b6&&console[_0x1e0f31(0x21f)]('Target\x20file:\x20'+_0x94f9b6),_0x50d355&&console[_0x1e0f31(0x21f)](_0x1e0f31(0x1ea)+_0x50d355));const _0x6debbd=await withSpinner(_0x1e0f31(0x26b),()=>_0x47c9f1[_0x1e0f31(0x1ae)][_0x1e0f31(0x24d)](_0x51d5b5),{'verbose':_0x140f4f[_0x1e0f31(0x20f)]}),_0x5ad056=_0x6debbd[_0x1e0f31(0x226)],{journeys:_0x53eb1d,folders:_0x48702b}=await withSpinner(_0x1e0f31(0x1af),async()=>{const _0x57cf8b=_0x1e0f31,[_0x455aa0,_0x354ecf]=await Promise[_0x57cf8b(0x28c)]([_0x47c9f1[_0x57cf8b(0x1d1)][_0x57cf8b(0x25c)](_0x5ad056,undefined,{'includeAllVersions':!![]}),_0x47c9f1[_0x57cf8b(0x1ae)]['listFolders'](_0x5ad056)]);return{'journeys':_0x455aa0,'folders':_0x354ecf};},{'verbose':_0x140f4f[_0x1e0f31(0x20f)]})[_0x1e0f31(0x289)](_0x53bed9=>_0x53bed9['data']);let _0x2ab84e=_0x53eb1d;const _0x3ff81b=buildFolderIdToPathMap(_0x48702b);if(_0x8250b0){const _0x40c911=_0x2ab84e[_0x1e0f31(0x247)](_0xc829c6=>_0xc829c6[_0x1e0f31(0x216)][_0x1e0f31(0x1ce)]()===_0x8250b0['toLowerCase']());if(_0x40c911[_0x1e0f31(0x1a7)]===0x0)return console[_0x1e0f31(0x21f)](_0x1e0f31(0x197)+_0x8250b0),console[_0x1e0f31(0x21f)](_0x1e0f31(0x1aa)),0x1;_0x2ab84e=_0x40c911;}if(_0x50d355!==undefined){const _0x1bc809=_0x2ab84e[_0x1e0f31(0x247)](_0x256b13=>{const _0x1efe77=_0x1e0f31,_0x4c5de5=_0x256b13[_0x1efe77(0x28b)]?_0x3ff81b[_0x1efe77(0x213)](_0x256b13[_0x1efe77(0x28b)])||'':'';return _0x4c5de5===_0x50d355;});if(_0x1bc809[_0x1e0f31(0x1a7)]===0x0&&_0x2ab84e[_0x1e0f31(0x1a7)]>0x0){console[_0x1e0f31(0x21f)](_0x1e0f31(0x1b7)+_0x8250b0+'\x27\x20not\x20found\x20in\x20'+(_0x50d355||_0x1e0f31(0x183))),console['error'](_0x1e0f31(0x24e));for(const _0x2ef661 of _0x2ab84e){const _0x2f362c=_0x2ef661['folderId']?_0x3ff81b[_0x1e0f31(0x213)](_0x2ef661[_0x1e0f31(0x28b)])||'':'';console['error'](_0x1e0f31(0x1c9)+(_0x2f362c||_0x1e0f31(0x241))+'/'+_0x2ef661[_0x1e0f31(0x216)]);}return 0x1;}_0x2ab84e=_0x1bc809;}if(_0x2ab84e[_0x1e0f31(0x1a7)]===0x0)return console['error'](_0x1e0f31(0x194)),0x0;const _0x3cdabd=new Map();for(const _0x10fd5b of _0x2ab84e){const _0x467e6c=_0x10fd5b[_0x1e0f31(0x224)];!_0x3cdabd[_0x1e0f31(0x263)](_0x467e6c)&&_0x3cdabd[_0x1e0f31(0x196)](_0x467e6c,[]),_0x3cdabd[_0x1e0f31(0x213)](_0x467e6c)[_0x1e0f31(0x1da)](_0x10fd5b);}for(const _0x28b232 of _0x3cdabd[_0x1e0f31(0x255)]()){_0x28b232[_0x1e0f31(0x234)]((_0x36500b,_0x2745f6)=>(_0x36500b[_0x1e0f31(0x184)]||0x0)-(_0x2745f6[_0x1e0f31(0x184)]||0x0));}const _0x53afa4=[],{idToEmailMap:_0xa207e3,connectionIdToNameMap:_0x2d8741}=await withSpinner(_0x1e0f31(0x222),async()=>{const _0x2fe982=_0x1e0f31,[_0x4078fc,_0x322cd7]=await Promise[_0x2fe982(0x28c)]([_0x47c9f1[_0x2fe982(0x23a)][_0x2fe982(0x287)](),_0x47c9f1[_0x2fe982(0x1df)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x4078fc,'connectionIdToNameMap':_0x322cd7};},{'verbose':_0x140f4f[_0x1e0f31(0x20f)]})[_0x1e0f31(0x289)](_0x5c8758=>_0x5c8758[_0x1e0f31(0x226)]);for(const _0x5b5462 of _0x3cdabd[_0x1e0f31(0x255)]()){const _0x26970d=_0x5b5462[0x0][_0x1e0f31(0x216)],_0x1d2849=_0x5b5462[0x0][_0x1e0f31(0x28b)],_0x1b8945=_0x1d2849?_0x3ff81b[_0x1e0f31(0x213)](_0x1d2849)||'':'',_0x225373=_0x1b8945?a26_0x5a6c84['join'](_0x569b60,_0x1b8945):_0x569b60,_0x3be61a=_0x94f9b6||a26_0x5a6c84['join'](_0x225373,sanitizeFileName(_0x26970d)+_0x1e0f31(0x215));let _0x60ac15,_0x2e4ad0;if(existsSync(_0x3be61a))try{const _0x419403=readFileSync(_0x3be61a,'utf-8'),_0xb69342=parseYamlString(_0x419403);_0x2e4ad0=_0xb69342,_0x60ac15=buildRuleToNameMapping(_0xb69342),_0x4ed7d7[_0x1e0f31(0x20f)]&&_0x60ac15[_0x1e0f31(0x1fa)]>0x0&&console['error'](_0x1e0f31(0x202)+_0x60ac15[_0x1e0f31(0x1fa)]+_0x1e0f31(0x23b)+_0x26970d);}catch(_0x2e9093){_0x4ed7d7['verbose']&&console['error'](_0x1e0f31(0x1ff)+_0x2e9093[_0x1e0f31(0x27a)]);}const _0x939e55=[],_0x31dfa5=new Set(),_0x3053ff=new Map(),_0x4d7aea=new Map(),_0x511135=new Set(),_0x42d7bf=new Map(),_0x29abc2=new Map(),_0x1f2b93=createJumpTargetCache();await withProgressSpinner(_0x1e0f31(0x283)+_0x26970d+_0x1e0f31(0x246),async _0x3961c0=>{const _0x194e9e=_0x1e0f31;for(const _0x59ac60 of _0x5b5462){const _0x512388=_0x5b5462[_0x194e9e(0x1a7)]>0x1?_0x59ac60['journeyBundleName']+'\x20v'+(_0x59ac60[_0x194e9e(0x184)]||0x1):_0x59ac60[_0x194e9e(0x216)];_0x3961c0[_0x194e9e(0x1de)](_0x194e9e(0x283)+_0x512388);const _0x34f540=await _0x47c9f1[_0x194e9e(0x1d1)]['getJourney'](_0x59ac60['id']),_0x3871e4=_0x34f540['attributes']?.[_0x194e9e(0x272)],_0x1ffd5e={'resolveSegment':async _0x2a4a21=>{const _0x372faf=_0x194e9e;if(!_0x3871e4)return{'name':_0x2a4a21,'isJourneyLocal':![]};const _0xe2f3d0=_0x3053ff[_0x372faf(0x213)](_0x2a4a21);if(_0xe2f3d0)return _0xe2f3d0;try{const _0x57f14d=await _0x47c9f1[_0x372faf(0x1ae)][_0x372faf(0x22e)](_0x3871e4,_0x2a4a21),_0x9613a7=_0x57f14d['kind']===SEGMENT_KIND_JOURNEY;let _0x12f870,_0x2196a4=_0x57f14d['name'];if(_0x9613a7&&_0x57f14d['rule']){const _0x5c551c=await segmentResponseToDef(_0x57f14d,{'resolveSegmentName':async _0x3b788b=>{const _0x375e59=_0x372faf,_0x5bbfa0=_0x3053ff[_0x375e59(0x213)](_0x3b788b);if(_0x5bbfa0)return _0x5bbfa0[_0x375e59(0x1f9)];const _0x3f090b=await _0x1ffd5e['resolveSegment'](_0x3b788b);return _0x3f090b[_0x375e59(0x1f9)];}}),_0x495088=_0x5c551c[_0x372faf(0x1d6)];_0x12f870={'description':_0x57f14d[_0x372faf(0x1cc)],'rule':_0x495088};const _0x1bdad3=serializeRule(_0x495088),_0x2ae5a7=_0x4d7aea[_0x372faf(0x213)](_0x1bdad3);if(_0x2ae5a7)_0x2196a4=_0x2ae5a7,_0x12f870=undefined,_0x4ed7d7[_0x372faf(0x20f)]&&console['error'](_0x372faf(0x1d2)+_0x57f14d[_0x372faf(0x1f9)]+_0x372faf(0x25d)+_0x2ae5a7);else{let _0xadb2c5=![];if(_0x60ac15){const _0x1dff54=_0x60ac15[_0x372faf(0x213)](_0x1bdad3);if(_0x1dff54){const _0x5cd164=_0x1dff54['find'](_0x404387=>!_0x31dfa5[_0x372faf(0x263)](_0x404387));_0x5cd164&&(_0x2196a4=_0x5cd164,_0x31dfa5[_0x372faf(0x1b6)](_0x5cd164),_0x4d7aea[_0x372faf(0x196)](_0x1bdad3,_0x5cd164),_0xadb2c5=!![],_0x4ed7d7[_0x372faf(0x20f)]&&console[_0x372faf(0x21f)](_0x372faf(0x1a8)+_0x5cd164+_0x372faf(0x22d)));}}if(!_0xadb2c5){const _0x15f8c0=generateJourneyLocalName(_0x57f14d['name']);_0x15f8c0&&(_0x2196a4=_0x15f8c0);let _0x5116f9=_0x2196a4,_0x483536=0x2;while(_0x31dfa5[_0x372faf(0x263)](_0x5116f9)){_0x5116f9=_0x2196a4+'_'+_0x483536,_0x483536++;}_0x31dfa5[_0x372faf(0x1b6)](_0x5116f9),_0x4d7aea[_0x372faf(0x196)](_0x1bdad3,_0x5116f9),_0x2196a4=_0x5116f9;}}}const _0x5a51f1={'name':_0x2196a4,'isJourneyLocal':_0x9613a7,'definition':_0x12f870};return _0x3053ff['set'](_0x2a4a21,_0x5a51f1),_0x5a51f1;}catch(_0x53f879){return _0x140f4f[_0x372faf(0x20f)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x2a4a21+':\x20'+_0x53f879[_0x372faf(0x27a)]),{'name':_0x2a4a21,'isJourneyLocal':![]};}},'resolveActivation':async _0x2ff2ce=>{const _0x41c951=_0x194e9e,_0x155b43=_0x42d7bf[_0x41c951(0x213)](_0x2ff2ce);if(_0x155b43)return _0x155b43;try{const _0x135ff7=await _0x47c9f1[_0x41c951(0x1d1)][_0x41c951(0x242)](_0x59ac60['id'],_0x2ff2ce),_0x259412=journeyActivationStepToYaml(_0x135ff7,_0xa207e3,_0x2d8741),_0x51cd54=JSON[_0x41c951(0x23e)]({'name':_0x259412[_0x41c951(0x1f9)],'connection':_0x259412[_0x41c951(0x1df)],'connector_config':_0x259412[_0x41c951(0x27e)]}),_0x416f2f=_0x29abc2[_0x41c951(0x213)](_0x51cd54);if(_0x416f2f){const _0x47c1c2={'name':_0x416f2f,'isJourneyLocal':!![],'definition':_0x259412};return _0x42d7bf['set'](_0x2ff2ce,_0x47c1c2),_0x47c1c2;}const _0x26bcca=_0x135ff7['attributes'][_0x41c951(0x187)]['name']||_0x2ff2ce,_0xe9e66e=sanitizeYamlKey(_0x26bcca)||'activation_'+_0x2ff2ce;let _0x3721e5=_0xe9e66e,_0x224e15=0x2;while(_0x511135[_0x41c951(0x263)](_0x3721e5)){_0x3721e5=_0xe9e66e+'_'+_0x224e15,_0x224e15++;}_0x511135['add'](_0x3721e5),_0x29abc2[_0x41c951(0x196)](_0x51cd54,_0x3721e5);const _0xc88533={'name':_0x3721e5,'isJourneyLocal':!![],'definition':_0x259412};return _0x42d7bf[_0x41c951(0x196)](_0x2ff2ce,_0xc88533),_0xc88533;}catch(_0xf3769f){return _0x140f4f['verbose']&&console['error'](_0x41c951(0x248)+_0x2ff2ce+':\x20'+_0xf3769f['message']),{'name':_0x2ff2ce,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0xb073a2,_0x2aa10b)=>{const _0x2959eb=_0x194e9e;return resolveJumpTarget(_0xb073a2,_0x2aa10b,_0x1f2b93,_0x3e01bf=>_0x47c9f1['journey'][_0x2959eb(0x1eb)](_0x3e01bf));}},_0x394a01=await journeyResponseToDef(_0x34f540,_0x1ffd5e);_0x939e55['push']({'item':_0x59ac60,'yaml':_0x394a01});}},{'verbose':_0x140f4f[_0x1e0f31(0x20f)]});const _0x327eec=await _0x47c9f1[_0x1e0f31(0x1d1)]['getLatestJourneyId'](_0x5b5462[0x0]['journeyBundleId']),_0x40de19=buildMergedJourneyDef(_0x939e55,_0x60ac15,_0x327eec),_0x47ba40=normalizeJourneyDef(_0x40de19,_0x2e4ad0),_0x2741b2=toYamlString(_0x47ba40),_0x2cc86b=_0x94f9b6||a26_0x5a6c84[_0x1e0f31(0x25e)](_0x225373,sanitizeFileName(_0x26970d)+_0x1e0f31(0x215));!_0x94f9b6&&_0x1b8945&&!existsSync(_0x225373)&&mkdirSync(_0x225373,{'recursive':!![]});const _0x497d5b=a26_0x5a6c84[_0x1e0f31(0x1e1)](process['cwd'](),_0x2cc86b);if(existsSync(_0x2cc86b)){const _0x51910e=readFileSync(_0x2cc86b,_0x1e0f31(0x232)),_0x2e4581=generateDiff(_0x51910e,_0x2741b2),_0x106768=hasChanges(_0x2e4581);_0x53afa4[_0x1e0f31(0x1da)]({'relativePath':_0x497d5b,'absolutePath':_0x2cc86b,'content':_0x2741b2,'isNew':![],'hasChanges':_0x106768,'diff':_0x106768?formatDiffWithColors(_0x2e4581):undefined});}else _0x53afa4[_0x1e0f31(0x1da)]({'relativePath':_0x497d5b,'absolutePath':_0x2cc86b,'content':_0x2741b2,'isNew':!![],'hasChanges':![]});}const _0x1444c8=_0x53afa4['filter'](_0x1f4a1e=>_0x1f4a1e[_0x1e0f31(0x1fd)]),_0x22cb34=_0x53afa4[_0x1e0f31(0x247)](_0x5d84f1=>!_0x5d84f1[_0x1e0f31(0x1fd)]&&_0x5d84f1['hasChanges']),_0x8a5e6a=_0x53afa4['filter'](_0x58c337=>!_0x58c337['isNew']&&!_0x58c337[_0x1e0f31(0x199)]),_0x3f4672=_0x2ab84e[_0x1e0f31(0x1a7)],_0x5997d8=_0x3cdabd[_0x1e0f31(0x1fa)],_0xe1856f=_0x3f4672>_0x5997d8?'\x20('+_0x3f4672+'\x20versions)':'';console[_0x1e0f31(0x21f)](_0x1e0f31(0x192)),console[_0x1e0f31(0x21f)]('\x20\x20'+a26_0xce81a1[_0x1e0f31(0x223)](_0x5997d8+_0x1e0f31(0x1ac))+a26_0xce81a1[_0x1e0f31(0x1c8)](_0xe1856f)),console[_0x1e0f31(0x21f)]('\x20\x20'+a26_0xce81a1['green']('+\x20'+_0x1444c8[_0x1e0f31(0x1a7)]+'\x20new\x20files')),console['error']('\x20\x20'+a26_0xce81a1[_0x1e0f31(0x186)]('~\x20'+_0x22cb34[_0x1e0f31(0x1a7)]+_0x1e0f31(0x208))),console[_0x1e0f31(0x21f)]('\x20\x20'+a26_0xce81a1[_0x1e0f31(0x1c8)]('=\x20'+_0x8a5e6a[_0x1e0f31(0x1a7)]+'\x20unchanged\x20files')),console['error']('\x20\x20Target:\x20'+a26_0xce81a1['cyan'](_0x569b60)+'\x0a');if(_0x22cb34['length']>0x0)for(const _0x4cb9d6 of _0x22cb34){console[_0x1e0f31(0x21f)](_0x1e0f31(0x27b)+_0x4cb9d6[_0x1e0f31(0x261)]+'\x27:'),console[_0x1e0f31(0x21f)]('─'[_0x1e0f31(0x21d)](0x3c)),console[_0x1e0f31(0x21f)](_0x4cb9d6[_0x1e0f31(0x18a)]),console[_0x1e0f31(0x21f)]('─'[_0x1e0f31(0x21d)](0x3c));}if(_0x4ed7d7[_0x1e0f31(0x18c)])return console[_0x1e0f31(0x21f)](a26_0xce81a1['yellow'](_0x1e0f31(0x1a9))),0x0;if(_0x1444c8[_0x1e0f31(0x1a7)]===0x0&&_0x22cb34[_0x1e0f31(0x1a7)]===0x0)return console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1e4)](_0x1e0f31(0x207))),saveSessionContext({'parent_segment':_0x51d5b5},_0x4ed7d7[_0x1e0f31(0x267)]),console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1e4)]('✔\x20Context\x20set:\x20'+a26_0xce81a1['dim'](_0x1e0f31(0x1be))+_0x1e0f31(0x1d7)+a26_0xce81a1[_0x1e0f31(0x223)](_0x51d5b5))),0x0;if(!_0x4ed7d7[_0x1e0f31(0x1dd)]&&(_0x1444c8[_0x1e0f31(0x1a7)]>0x0||_0x22cb34[_0x1e0f31(0x1a7)]>0x0)){if(!isInteractive())return console['error'](a26_0xce81a1[_0x1e0f31(0x1ab)](_0x1e0f31(0x1ec)),_0x1e0f31(0x1bd)),console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1c8)](_0x1e0f31(0x1c1))),0x1;const _0x2a7d3f=await confirmKey(_0x1e0f31(0x21b)+(_0x1444c8[_0x1e0f31(0x1a7)]+_0x22cb34[_0x1e0f31(0x1a7)])+_0x1e0f31(0x1bb));if(!_0x2a7d3f)return console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x186)](_0x1e0f31(0x1d3)),_0x1e0f31(0x20d)),0x1;}!existsSync(_0x569b60)&&mkdirSync(_0x569b60,{'recursive':!![]});const _0xc75b0f=a26_0x5a6c84[_0x1e0f31(0x25e)](_0x569b60,_0x1e0f31(0x278));writeFileSync(_0xc75b0f,createTdxConfigContent(_0x51d5b5),_0x1e0f31(0x232));for(const _0x5dea54 of _0x53afa4){(_0x5dea54['isNew']||_0x5dea54['hasChanges'])&&writeFileSync(_0x5dea54[_0x1e0f31(0x22b)],_0x5dea54['content'],_0x1e0f31(0x232));}return console['error'](a26_0xce81a1[_0x1e0f31(0x1e4)](_0x1e0f31(0x274)+(_0x1444c8[_0x1e0f31(0x1a7)]+_0x22cb34[_0x1e0f31(0x1a7)])+'\x20journey\x20files\x20to\x20'+_0x569b60)),saveSessionContext({'parent_segment':_0x51d5b5},_0x4ed7d7[_0x1e0f31(0x267)]),console[_0x1e0f31(0x21f)](a26_0xce81a1[_0x1e0f31(0x1e4)](_0x1e0f31(0x1f0)+a26_0xce81a1[_0x1e0f31(0x1c8)]('parent_segment')+_0x1e0f31(0x1d7)+a26_0xce81a1[_0x1e0f31(0x223)](_0x51d5b5))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1e2);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x19f);async[a26_0xa84a1d(0x288)](_0x389a91){const _0x3cc3ee=a26_0xa84a1d,{options:_0x5bc9ba,args:_0x25a67f,tdx:_0x30041a}=_0x389a91,_0x50d452=_0x25a67f[0x0];if(!requireNameOrPath(_0x50d452))return 0x1;_0x5bc9ba[_0x3cc3ee(0x20f)]&&console[_0x3cc3ee(0x21f)](_0x3cc3ee(0x240)+_0x50d452);const {journeyId:_0x2fefb2}=await resolveJourneyIdFromInput(_0x50d452,_0x5bc9ba,_0x30041a),_0x387048=await withSpinner(_0x3cc3ee(0x21c),()=>_0x30041a[_0x3cc3ee(0x1d1)][_0x3cc3ee(0x1b3)](_0x2fefb2),{'verbose':_0x5bc9ba[_0x3cc3ee(0x20f)]}),_0x4ad2b0=_0x387048[_0x3cc3ee(0x226)];return console[_0x3cc3ee(0x185)](_0x3cc3ee(0x181)+_0x4ad2b0['database']),console[_0x3cc3ee(0x185)](_0x3cc3ee(0x1db)+_0x4ad2b0['table']),await handleSDKOutput(_0x4ad2b0[_0x3cc3ee(0x189)],_0x5bc9ba),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a26_0xa84a1d(0x1e0);[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x24f);async[a26_0xa84a1d(0x288)](_0x344693){const _0x476a73=a26_0xa84a1d,{options:_0x19509e,args:_0x40d920,tdx:_0xfb7daa}=_0x344693,_0x2db718=_0x40d920[0x0];if(!requireNameOrPath(_0x2db718))return 0x1;_0x19509e[_0x476a73(0x20f)]&&console[_0x476a73(0x21f)](_0x476a73(0x240)+_0x2db718);const {journeyId:_0x340159}=await resolveJourneyIdFromInput(_0x2db718,_0x19509e,_0xfb7daa),_0x4b767e=await withSpinner(_0x476a73(0x23d),()=>_0xfb7daa[_0x476a73(0x1d1)][_0x476a73(0x230)](_0x340159),{'verbose':_0x19509e[_0x476a73(0x20f)]}),_0x528dea=_0x4b767e[_0x476a73(0x226)];return console[_0x476a73(0x21f)](_0x476a73(0x202)+_0x528dea[_0x476a73(0x1a7)]+_0x476a73(0x1f5)+(_0x528dea[_0x476a73(0x1a7)]!==0x1?'s':'')),await handleSDKOutput(_0x528dea,_0x19509e),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]='journey:push';[a26_0xa84a1d(0x1cc)]=a26_0xa84a1d(0x260);[a26_0xa84a1d(0x188)]=new SegmentPushCommand();async['execute'](_0x1e9b72){const _0x15dea3=a26_0xa84a1d,_0x133703=_0x1e9b72[_0x15dea3(0x195)][0x0];let _0x22d9ac;if(_0x133703){const _0xe1d75e=await resolveTarget({'arg':_0x133703,'contextParent':_0x1e9b72[_0x15dea3(0x19a)]['parentSegment'],'cwd':process[_0x15dea3(0x1b1)]()});isSuccessfulResolution(_0xe1d75e)&&_0xe1d75e[_0x15dea3(0x190)]===_0x15dea3(0x259)&&(_0x22d9ac=_0xe1d75e[_0x15dea3(0x1a5)]);}const _0x3e685a={..._0x1e9b72,'options':{..._0x1e9b72[_0x15dea3(0x19a)],'journeysOnly':!![],..._0x22d9ac&&{'singleFilePath':_0x22d9ac}}};return this[_0x15dea3(0x188)][_0x15dea3(0x288)](_0x3e685a);}}export class JourneyVersionsCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]=a26_0xa84a1d(0x1f3);[a26_0xa84a1d(0x1cc)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a26_0xa84a1d(0x288)](_0x288063){const _0x161ffc=a26_0xa84a1d,{options:_0x4a57e2,args:_0x152c4f,tdx:_0x218811}=_0x288063,_0x611e9=_0x152c4f[0x0];if(!requireNameOrPath(_0x611e9))return 0x1;if(_0x4a57e2[_0x161ffc(0x20f)])console['error'](_0x161ffc(0x240)+_0x611e9);const {journeyId:_0x55986e}=await resolveJourneyIdFromInput(_0x611e9,_0x4a57e2,_0x218811),_0x2f9763=await withSpinner(_0x161ffc(0x19b),()=>_0x218811['journey'][_0x161ffc(0x1cb)](_0x55986e),{'verbose':_0x4a57e2[_0x161ffc(0x20f)]}),{bundleName:_0x5553b2,versions:_0x2f6d73,latestJourneyId:_0x399fc7}=_0x2f9763['data'];console['error'](_0x5553b2+':\x20'+_0x2f6d73[_0x161ffc(0x1a7)]+_0x161ffc(0x1b5)+(_0x2f6d73[_0x161ffc(0x1a7)]!==0x1?'s':''));const _0x1e9911=_0x2f6d73[_0x161ffc(0x211)](_0x7e993b=>({'version':_0x7e993b[_0x161ffc(0x184)],'journey_id':_0x7e993b[_0x161ffc(0x1fb)],'name':_0x7e993b[_0x161ffc(0x1f9)],'state':_0x7e993b[_0x161ffc(0x22f)],'paused':_0x7e993b[_0x161ffc(0x1c0)],'latest':_0x7e993b['journeyId']===_0x399fc7,'created_at':_0x7e993b[_0x161ffc(0x19d)]}));return await handleSDKOutput(_0x1e9911,_0x4a57e2),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a26_0xa84a1d(0x1d4);[a26_0xa84a1d(0x1cc)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a26_0xa84a1d(0x288)](_0x4430a1){const _0x41d2f8=a26_0xa84a1d,{options:_0x2b5c62,args:_0x48d844,tdx:_0x3e04f9}=_0x4430a1,_0x86c59e=_0x48d844[0x0];if(!requireNameOrPath(_0x86c59e))return 0x1;if(_0x2b5c62['verbose'])console[_0x41d2f8(0x21f)]('Input:\x20'+_0x86c59e);const {journeyId:_0x5e5aba,journeyName:_0x41477c}=await resolveJourneyIdFromInput(_0x86c59e,_0x2b5c62,_0x3e04f9);if(!_0x2b5c62[_0x41d2f8(0x1dd)]){const _0x1b688f=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x41477c+'\x22?');if(!_0x1b688f)return console[_0x41d2f8(0x21f)](_0x41d2f8(0x22a)),0x0;}const _0x124f12=await withSpinner('Creating\x20new\x20version...',()=>_0x3e04f9[_0x41d2f8(0x1d1)]['createVersion'](_0x5e5aba),{'verbose':_0x2b5c62[_0x41d2f8(0x20f)]}),_0xc17b96=_0x124f12['data'];return console[_0x41d2f8(0x21f)](a26_0xce81a1[_0x41d2f8(0x1e4)]('✔')+'\x20Created\x20v'+_0xc17b96[_0x41d2f8(0x1b8)]['versionNumber']+'\x20(draft)\x20—\x20\x22'+_0xc17b96['attributes'][_0x41d2f8(0x1f9)]+'\x22'),console[_0x41d2f8(0x21f)](_0x41d2f8(0x275)+_0xc17b96['id']),await handleSingleObjectOutput({'id':_0xc17b96['id'],'name':_0xc17b96['attributes'][_0x41d2f8(0x1f9)],'version':_0xc17b96['attributes'][_0x41d2f8(0x184)],'state':_0xc17b96[_0x41d2f8(0x1b8)][_0x41d2f8(0x22f)],'bundle_id':_0xc17b96['attributes']['journeyBundleId'],'created_at':_0xc17b96[_0x41d2f8(0x1b8)][_0x41d2f8(0x19d)]},_0x2b5c62),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0xa84a1d(0x1f9)]='journey:version:view';['description']=a26_0xa84a1d(0x20b);async[a26_0xa84a1d(0x288)](_0x5b7afd){const _0x4a8f51=a26_0xa84a1d,{options:_0x324c27,args:_0x2d15b5,tdx:_0x3f3ee3}=_0x5b7afd,_0x3fe651=_0x2d15b5[0x0];if(!requireNameOrPath(_0x3fe651))return 0x1;const _0x51c844=_0x324c27[_0x4a8f51(0x1b2)];if(!_0x51c844)return console[_0x4a8f51(0x21f)](_0x4a8f51(0x19e)),console[_0x4a8f51(0x21f)](_0x4a8f51(0x235)),0x1;const _0x84892c=parseInt(_0x51c844,0xa);if(isNaN(_0x84892c)||_0x84892c<0x1)return console['error'](_0x4a8f51(0x266)+_0x51c844),0x1;if(_0x324c27[_0x4a8f51(0x20f)])console[_0x4a8f51(0x21f)](_0x4a8f51(0x240)+_0x3fe651+',\x20version:\x20'+_0x84892c);const {journeyId:_0x43fef7,parentSegmentId:_0x74aed5}=await resolveJourneyIdFromInput(_0x3fe651,_0x324c27,_0x3f3ee3),_0x19b448=await withSpinner('Resolving\x20version...',()=>_0x3f3ee3['journey']['listVersions'](_0x43fef7),{'verbose':_0x324c27['verbose']}),{versions:_0x26ccfe,latestJourneyId:_0x288501}=_0x19b448['data'],_0x339eda=_0x26ccfe[_0x4a8f51(0x286)](_0x58cf42=>_0x58cf42[_0x4a8f51(0x184)]===_0x84892c);if(!_0x339eda){const _0x359001=_0x26ccfe[_0x4a8f51(0x211)](_0x29ee52=>'v'+_0x29ee52[_0x4a8f51(0x184)])['join'](',\x20');return console[_0x4a8f51(0x21f)](_0x4a8f51(0x1f4)+_0x84892c+_0x4a8f51(0x221)+_0x359001),0x1;}const _0x3110e2=await withSpinner(_0x4a8f51(0x1e6)+_0x84892c+_0x4a8f51(0x1f7),()=>_0x3f3ee3[_0x4a8f51(0x1d1)][_0x4a8f51(0x1eb)](_0x339eda[_0x4a8f51(0x1fb)]),{'verbose':_0x324c27[_0x4a8f51(0x20f)]}),_0x4090af=_0x3110e2[_0x4a8f51(0x226)],_0x21a06f=getConsoleNextUrl(_0x324c27[_0x4a8f51(0x236)],_0x4a8f51(0x21a)+_0x74aed5+_0x4a8f51(0x1bf)+_0x339eda['journeyId']+_0x4a8f51(0x1c7));return await handleSingleObjectOutput({'id':_0x4090af['id'],'name':_0x4090af['attributes'][_0x4a8f51(0x1f9)],'version':_0x4090af['attributes']['versionNumber'],'description':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x1cc)],'state':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x22f)],'paused':_0x4090af['attributes'][_0x4a8f51(0x1c0)],'reentry_mode':_0x4090af[_0x4a8f51(0x1b8)]['reentryMode'],'stages':_0x4090af[_0x4a8f51(0x1b8)]['journeyStages']?.[_0x4a8f51(0x1a7)]||0x0,..._0x4090af[_0x4a8f51(0x1b8)]['goal']&&{'goal':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x26c)][_0x4a8f51(0x1f9)]},'latest':_0x339eda[_0x4a8f51(0x1fb)]===_0x288501,'created_at':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x19d)],'updated_at':_0x4090af[_0x4a8f51(0x1b8)][_0x4a8f51(0x28a)],'url':_0x21a06f},_0x324c27),0x0;}}
@@ -1 +1 @@
1
- const a27_0x557573=a27_0x1264;(function(_0x4356c0,_0x19c8bc){const _0x2454cd=a27_0x1264,_0x11cf27=_0x4356c0();while(!![]){try{const _0x2e0843=-parseInt(_0x2454cd(0xd6))/0x1+-parseInt(_0x2454cd(0xe0))/0x2+parseInt(_0x2454cd(0xe6))/0x3+-parseInt(_0x2454cd(0xed))/0x4*(-parseInt(_0x2454cd(0xf0))/0x5)+-parseInt(_0x2454cd(0xf1))/0x6+-parseInt(_0x2454cd(0xde))/0x7+parseInt(_0x2454cd(0xcf))/0x8;if(_0x2e0843===_0x19c8bc)break;else _0x11cf27['push'](_0x11cf27['shift']());}catch(_0x99b2f0){_0x11cf27['push'](_0x11cf27['shift']());}}}(a27_0xe506,0xe7b91));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a27_0xe506(){const _0x1dc0cd=['678485ipAnAs','relativePath','Validate\x20journey\x20YAML\x20files','error','validCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','cwd','filePath','6057737gaUREE','parentSegment','2103360hCVmXs','errors','name','verbose','endsWith','\x20journey(s)\x20with\x20errors,\x20','2167632sUaiyj','targetDir','description','reason','Error:\x20','yellow','✔\x20All\x20','268628NpXfbR','cyan','hasErrors','35vJiRlj','6375840iIqvAD','warningCount','\x20error(s)','helpText','warnings','\x20journey(s)\x20valid','\x20warning(s)\x20found','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','invalidCount','filter','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','journey:validate','.yml','red','log','\x20segment\x20file(s)\x20skipped)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','green','journey','skippedCount','27317520LhxIXe','Error:\x20Directory\x20not\x20found:\x20','\x20warning(s)','valid','\x20segment\x20file(s)\x20skipped','dim','length'];a27_0xe506=function(){return _0x1dc0cd;};return a27_0xe506();}import{existsSync}from'fs';import a27_0x3621dc from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a27_0x1264(_0x4d88d2,_0x5c0690){_0x4d88d2=_0x4d88d2-0xcb;const _0xe5063a=a27_0xe506();let _0x1264be=_0xe5063a[_0x4d88d2];return _0x1264be;}export class JourneyValidateCommand extends BaseCommand{[a27_0x557573(0xe2)]=a27_0x557573(0xfc);[a27_0x557573(0xe8)]=a27_0x557573(0xd8);async['execute'](_0x455a81){const _0x210673=a27_0x557573,{options:_0x188acb,args:_0x4b0205}=_0x455a81,_0x4408a1=_0x188acb,_0x2ad9af=await resolveTarget({'arg':_0x4b0205[0x0],'contextParent':_0x188acb[_0x210673(0xdf)],'cwd':process[_0x210673(0xdc)]()});if(!isSuccessfulResolution(_0x2ad9af))return _0x2ad9af['errorCode']==='no_parent'?(console['error'](a27_0x3621dc[_0x210673(0xeb)](_0x210673(0xcb))),console[_0x210673(0xd9)](_0x210673(0xf8)),console[_0x210673(0xd9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x210673(0xd9)](_0x210673(0xfb))):(console[_0x210673(0xd9)](a27_0x3621dc[_0x210673(0xfe)](_0x210673(0xea)+_0x2ad9af['message']+'\x0a')),_0x2ad9af['helpText']&&console[_0x210673(0xd9)](a27_0x3621dc[_0x210673(0xee)](_0x2ad9af[_0x210673(0xf4)]))),0x1;const _0x4323d5=_0x2ad9af[_0x210673(0xe7)],_0x5e361=_0x2ad9af['type']==='file'?_0x2ad9af[_0x210673(0xdd)]:undefined;if(!_0x5e361&&!existsSync(_0x4323d5))return console['error'](a27_0x3621dc[_0x210673(0xfe)](_0x210673(0xd0)+_0x4323d5+'\x0a')),0x1;let _0x22ee39;if(_0x5e361){if(!_0x5e361[_0x210673(0xe4)](_0x210673(0xfd))&&!_0x5e361[_0x210673(0xe4)]('.yaml'))return console[_0x210673(0xd9)](a27_0x3621dc[_0x210673(0xfe)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x5e361+'\x0a')),0x1;_0x22ee39=[_0x5e361];}else _0x22ee39=findYamlFiles(_0x4323d5);if(_0x22ee39[_0x210673(0xd5)]===0x0)return console[_0x210673(0xd9)](a27_0x3621dc[_0x210673(0xfe)](_0x210673(0xdb)+_0x4323d5+'\x0a')),0x1;const _0x19d89a=validateYamlFiles(_0x22ee39,_0x4323d5,{'filterType':_0x210673(0xcd)}),_0x2a67de=calculateSummary(_0x19d89a),_0x4114b3=_0x19d89a[_0x210673(0xfa)](isValidationResult);if(_0x4114b3['length']===0x0)return console[_0x210673(0xd9)](a27_0x3621dc['yellow']('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x4323d5+'\x0a')),_0x2a67de['skippedCount']>0x0&&console[_0x210673(0xd9)](a27_0x3621dc[_0x210673(0xd4)]('('+_0x2a67de[_0x210673(0xce)]+_0x210673(0x100))),0x0;for(const _0x5e7426 of _0x19d89a){if(!isValidationResult(_0x5e7426)){_0x4408a1[_0x210673(0xe3)]&&console[_0x210673(0xff)](a27_0x3621dc[_0x210673(0xd4)]('-\x20'+_0x5e7426[_0x210673(0xd7)]+'\x20(skipped:\x20'+_0x5e7426[_0x210673(0xe9)]+')'));continue;}const {relativePath:_0x1fc5b0,source:_0x371147,result:_0x4db8db}=_0x5e7426;if(_0x4db8db[_0x210673(0xd2)]&&_0x4db8db[_0x210673(0xf5)]['length']===0x0)_0x4408a1[_0x210673(0xe3)]&&console['log'](a27_0x3621dc[_0x210673(0xcc)]('✔\x20'+_0x1fc5b0));else _0x4db8db[_0x210673(0xd2)]?(console[_0x210673(0xff)](a27_0x3621dc[_0x210673(0xeb)]('⚠\x20'+_0x1fc5b0+':\x20'+_0x4db8db[_0x210673(0xf5)][_0x210673(0xd5)]+_0x210673(0xd1))),console[_0x210673(0xff)](formatValidationResult(_0x4db8db,_0x371147,_0x1fc5b0))):(console[_0x210673(0xff)](a27_0x3621dc[_0x210673(0xfe)]('✖\x20'+_0x1fc5b0+':\x20'+_0x4db8db[_0x210673(0xe1)]['length']+_0x210673(0xf3))),console[_0x210673(0xff)](formatValidationResult(_0x4db8db,_0x371147,_0x1fc5b0)));}return console[_0x210673(0xff)](''),_0x2a67de[_0x210673(0xef)]?(console[_0x210673(0xff)](a27_0x3621dc[_0x210673(0xfe)]('Validation\x20failed:\x20'+_0x2a67de[_0x210673(0xf9)]+_0x210673(0xe5)+_0x2a67de[_0x210673(0xda)]+'\x20valid')),_0x2a67de[_0x210673(0xf2)]>0x0&&console[_0x210673(0xff)](a27_0x3621dc[_0x210673(0xeb)](_0x2a67de[_0x210673(0xf2)]+_0x210673(0xf7))),_0x2a67de[_0x210673(0xce)]>0x0&&console[_0x210673(0xff)](a27_0x3621dc[_0x210673(0xd4)](_0x2a67de[_0x210673(0xce)]+_0x210673(0xd3))),0x1):(console[_0x210673(0xff)](a27_0x3621dc[_0x210673(0xcc)](_0x210673(0xec)+_0x2a67de['validCount']+_0x210673(0xf6))),_0x2a67de[_0x210673(0xf2)]>0x0&&console[_0x210673(0xff)](a27_0x3621dc['yellow'](_0x2a67de[_0x210673(0xf2)]+_0x210673(0xf7))),_0x2a67de[_0x210673(0xce)]>0x0&&console[_0x210673(0xff)](a27_0x3621dc[_0x210673(0xd4)](_0x2a67de[_0x210673(0xce)]+_0x210673(0xd3))),0x0);}}
1
+ const a27_0xdb7100=a27_0x3cc2;(function(_0x2e6204,_0x1b3a0d){const _0x58dba8=a27_0x3cc2,_0x3e20d4=_0x2e6204();while(!![]){try{const _0x285c2a=-parseInt(_0x58dba8(0xdd))/0x1+parseInt(_0x58dba8(0xc0))/0x2+-parseInt(_0x58dba8(0xc7))/0x3*(-parseInt(_0x58dba8(0xb9))/0x4)+parseInt(_0x58dba8(0xe5))/0x5*(-parseInt(_0x58dba8(0xcb))/0x6)+parseInt(_0x58dba8(0xd1))/0x7*(-parseInt(_0x58dba8(0xe3))/0x8)+parseInt(_0x58dba8(0xe2))/0x9+parseInt(_0x58dba8(0xb1))/0xa*(-parseInt(_0x58dba8(0xe4))/0xb);if(_0x285c2a===_0x1b3a0d)break;else _0x3e20d4['push'](_0x3e20d4['shift']());}catch(_0x41cb7c){_0x3e20d4['push'](_0x3e20d4['shift']());}}}(a27_0x419f,0x5751c));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a27_0x3cc2(_0x42d2e7,_0x281ddc){_0x42d2e7=_0x42d2e7-0xb1;const _0x419fb4=a27_0x419f();let _0x3cc2b0=_0x419fb4[_0x42d2e7];return _0x3cc2b0;}import a27_0x14d748 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a27_0x419f(){const _0x44aafc=['yellow','cwd','24XgiPfD','Validation\x20failed:\x20','\x20journey(s)\x20valid','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','Error:\x20','log','13370AJztDW','\x20journey(s)\x20with\x20errors,\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','reason','message','Validate\x20journey\x20YAML\x20files','green','dim','type','validCount','description','\x20warning(s)','89581UKwYII','error','Error:\x20Directory\x20not\x20found:\x20','No\x20journey\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found','2113893FQkTDX','80tFgAyy','55YAEble','58385UlgYMM','\x20error(s)','file','892270tdqjor','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20segment\x20file(s)\x20skipped','warningCount','filePath','\x20(skipped:\x20','red','30460Omushg','no_parent','endsWith','invalidCount','execute','verbose','valid','1372464Uewsrc','journey:validate','relativePath','skippedCount','warnings','length','errors','15mTdCqe','targetDir'];a27_0x419f=function(){return _0x44aafc;};return a27_0x419f();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a27_0xdb7100(0xb2)]=a27_0xdb7100(0xc1);[a27_0xdb7100(0xdb)]=a27_0xdb7100(0xd6);async[a27_0xdb7100(0xbd)](_0x4c5613){const _0x2bff1f=a27_0xdb7100,{options:_0x10b153,args:_0x21fb20}=_0x4c5613,_0x317440=_0x10b153,_0x157dc4=await resolveTarget({'arg':_0x21fb20[0x0],'contextParent':_0x10b153['parentSegment'],'cwd':process[_0x2bff1f(0xca)]()});if(!isSuccessfulResolution(_0x157dc4))return _0x157dc4['errorCode']===_0x2bff1f(0xba)?(console['error'](a27_0x14d748[_0x2bff1f(0xc9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x2bff1f(0xce)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x2bff1f(0xde)](_0x2bff1f(0xb3))):(console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xb8)](_0x2bff1f(0xcf)+_0x157dc4[_0x2bff1f(0xd5)]+'\x0a')),_0x157dc4['helpText']&&console[_0x2bff1f(0xde)](a27_0x14d748['cyan'](_0x157dc4['helpText']))),0x1;const _0x170e69=_0x157dc4[_0x2bff1f(0xc8)],_0x694d6e=_0x157dc4[_0x2bff1f(0xd9)]===_0x2bff1f(0xe7)?_0x157dc4[_0x2bff1f(0xb6)]:undefined;if(!_0x694d6e&&!existsSync(_0x170e69))return console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xb8)](_0x2bff1f(0xdf)+_0x170e69+'\x0a')),0x1;let _0x5a5765;if(_0x694d6e){if(!_0x694d6e[_0x2bff1f(0xbb)]('.yml')&&!_0x694d6e[_0x2bff1f(0xbb)]('.yaml'))return console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xb8)](_0x2bff1f(0xd3)+_0x694d6e+'\x0a')),0x1;_0x5a5765=[_0x694d6e];}else _0x5a5765=findYamlFiles(_0x170e69);if(_0x5a5765[_0x2bff1f(0xc5)]===0x0)return console[_0x2bff1f(0xde)](a27_0x14d748['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x170e69+'\x0a')),0x1;const _0x541aa4=validateYamlFiles(_0x5a5765,_0x170e69,{'filterType':'journey'}),_0xd0fe6d=calculateSummary(_0x541aa4),_0x3131e6=_0x541aa4['filter'](isValidationResult);if(_0x3131e6[_0x2bff1f(0xc5)]===0x0)return console['error'](a27_0x14d748['yellow'](_0x2bff1f(0xe0)+_0x170e69+'\x0a')),_0xd0fe6d[_0x2bff1f(0xc3)]>0x0&&console[_0x2bff1f(0xde)](a27_0x14d748[_0x2bff1f(0xd8)]('('+_0xd0fe6d[_0x2bff1f(0xc3)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x287aa5 of _0x541aa4){if(!isValidationResult(_0x287aa5)){_0x317440[_0x2bff1f(0xbe)]&&console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xd8)]('-\x20'+_0x287aa5[_0x2bff1f(0xc2)]+_0x2bff1f(0xb7)+_0x287aa5[_0x2bff1f(0xd4)]+')'));continue;}const {relativePath:_0x2316b8,source:_0x247b8d,result:_0x11233a}=_0x287aa5;if(_0x11233a[_0x2bff1f(0xbf)]&&_0x11233a[_0x2bff1f(0xc4)][_0x2bff1f(0xc5)]===0x0)_0x317440[_0x2bff1f(0xbe)]&&console[_0x2bff1f(0xd0)](a27_0x14d748['green']('✔\x20'+_0x2316b8));else _0x11233a['valid']?(console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xc9)]('⚠\x20'+_0x2316b8+':\x20'+_0x11233a['warnings']['length']+_0x2bff1f(0xdc))),console[_0x2bff1f(0xd0)](formatValidationResult(_0x11233a,_0x247b8d,_0x2316b8))):(console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xb8)]('✖\x20'+_0x2316b8+':\x20'+_0x11233a[_0x2bff1f(0xc6)]['length']+_0x2bff1f(0xe6))),console[_0x2bff1f(0xd0)](formatValidationResult(_0x11233a,_0x247b8d,_0x2316b8)));}return console[_0x2bff1f(0xd0)](''),_0xd0fe6d['hasErrors']?(console[_0x2bff1f(0xd0)](a27_0x14d748['red'](_0x2bff1f(0xcc)+_0xd0fe6d[_0x2bff1f(0xbc)]+_0x2bff1f(0xd2)+_0xd0fe6d['validCount']+'\x20valid')),_0xd0fe6d[_0x2bff1f(0xb5)]>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748['yellow'](_0xd0fe6d['warningCount']+_0x2bff1f(0xe1))),_0xd0fe6d[_0x2bff1f(0xc3)]>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748['dim'](_0xd0fe6d[_0x2bff1f(0xc3)]+_0x2bff1f(0xb4))),0x1):(console['log'](a27_0x14d748[_0x2bff1f(0xd7)]('✔\x20All\x20'+_0xd0fe6d[_0x2bff1f(0xda)]+_0x2bff1f(0xcd))),_0xd0fe6d[_0x2bff1f(0xb5)]>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xc9)](_0xd0fe6d[_0x2bff1f(0xb5)]+'\x20warning(s)\x20found')),_0xd0fe6d['skippedCount']>0x0&&console[_0x2bff1f(0xd0)](a27_0x14d748[_0x2bff1f(0xd8)](_0xd0fe6d[_0x2bff1f(0xc3)]+_0x2bff1f(0xb4))),0x0);}}