@treasuredata/tdx 2026.4.13 → 2026.4.14

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 (220) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-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/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +1 -1
@@ -1 +1 @@
1
- const a25_0x4a4d66=a25_0xfd22;(function(_0x496a74,_0x5786e6){const _0x3f5a23=a25_0xfd22,_0x568651=_0x496a74();while(!![]){try{const _0x293353=parseInt(_0x3f5a23(0xa2))/0x1*(parseInt(_0x3f5a23(0x91))/0x2)+-parseInt(_0x3f5a23(0x84))/0x3*(-parseInt(_0x3f5a23(0x80))/0x4)+-parseInt(_0x3f5a23(0x95))/0x5*(-parseInt(_0x3f5a23(0x99))/0x6)+parseInt(_0x3f5a23(0x85))/0x7*(-parseInt(_0x3f5a23(0x8e))/0x8)+-parseInt(_0x3f5a23(0x88))/0x9*(parseInt(_0x3f5a23(0x98))/0xa)+-parseInt(_0x3f5a23(0x96))/0xb+-parseInt(_0x3f5a23(0x75))/0xc*(-parseInt(_0x3f5a23(0x86))/0xd);if(_0x293353===_0x5786e6)break;else _0x568651['push'](_0x568651['shift']());}catch(_0x31304f){_0x568651['push'](_0x568651['shift']());}}}(a25_0x22d7,0x99c9a));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x1a2f67 from'chalk';import a25_0x49e305 from'path';function a25_0xfd22(_0x49527c,_0x6cfba2){_0x49527c=_0x49527c-0x72;const _0x22d756=a25_0x22d7();let _0xfd2245=_0x22d756[_0x49527c];return _0xfd2245;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x4a4d66(0x7e)]='engage:template:validate';[a25_0x4a4d66(0x7f)]=a25_0x4a4d66(0x7a);async['execute'](_0x48830f){const _0x375691=a25_0x4a4d66,{options:_0x1627e0,args:_0x5c72e1}=_0x48830f,_0x4c76a1=_0x1627e0,_0x5874aa=_0x5c72e1[0x0],_0x2cc7da=_0x5874aa?a25_0x49e305[_0x375691(0x76)](_0x5874aa):undefined,_0x5ee82f=_0x2cc7da?isYamlFile(_0x2cc7da):![];let _0x38297e,_0x2d643a;if(_0x5ee82f&&_0x2cc7da)_0x38297e=a25_0x49e305[_0x375691(0x94)](_0x2cc7da),_0x2d643a=_0x2cc7da;else _0x2cc7da?_0x38297e=_0x2cc7da:_0x38297e=process['cwd']();if(!_0x2d643a&&!existsSync(_0x38297e))return console[_0x375691(0xa3)](a25_0x1a2f67['red'](_0x375691(0x9e)+_0x38297e+'\x0a')),0x1;let _0x2a7199;if(_0x2d643a){if(!_0x2d643a[_0x375691(0x8f)]('.yml')&&!_0x2d643a[_0x375691(0x8f)](_0x375691(0x90)))return console[_0x375691(0xa3)](a25_0x1a2f67[_0x375691(0x79)](_0x375691(0x92)+_0x2d643a+'\x0a')),0x1;_0x2a7199=[_0x2d643a];}else _0x2a7199=findYamlFiles(_0x38297e);if(_0x2a7199[_0x375691(0x9a)]===0x0)return console[_0x375691(0xa3)](a25_0x1a2f67[_0x375691(0x79)](_0x375691(0x78)+_0x38297e+'\x0a')),0x1;const _0x3189de=validateYamlFiles(_0x2a7199,_0x38297e,{'filterType':_0x375691(0x7b)}),_0x2344df=calculateSummary(_0x3189de),_0x46ef69=_0x3189de[_0x375691(0x7d)](isValidationResult);if(_0x46ef69['length']===0x0)return console[_0x375691(0xa3)](a25_0x1a2f67['yellow'](_0x375691(0x9b)+_0x38297e+'\x0a')),_0x2344df[_0x375691(0x82)]>0x0&&console['error'](a25_0x1a2f67[_0x375691(0xa1)]('('+_0x2344df[_0x375691(0x82)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x335d67 of _0x3189de){if(!isValidationResult(_0x335d67)){_0x4c76a1['verbose']&&console['log'](a25_0x1a2f67[_0x375691(0xa1)]('-\x20'+_0x335d67['relativePath']+_0x375691(0x73)+_0x335d67[_0x375691(0x83)]+')'));continue;}const {relativePath:_0x4421ce,source:_0x460cd8,result:_0x3fa568}=_0x335d67;if(_0x3fa568['valid']&&_0x3fa568[_0x375691(0x8b)]['length']===0x0)_0x4c76a1[_0x375691(0x9c)]&&console['log'](a25_0x1a2f67['green']('✔\x20'+_0x4421ce));else _0x3fa568[_0x375691(0xa0)]?(console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x8d)]('⚠\x20'+_0x4421ce+':\x20'+_0x3fa568[_0x375691(0x8b)]['length']+_0x375691(0x74))),console[_0x375691(0x89)](formatValidationResult(_0x3fa568,_0x460cd8,_0x4421ce))):(console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x79)]('✖\x20'+_0x4421ce+':\x20'+_0x3fa568['errors']['length']+_0x375691(0x81))),console[_0x375691(0x89)](formatValidationResult(_0x3fa568,_0x460cd8,_0x4421ce)));}return console['log'](''),_0x2344df[_0x375691(0x97)]?(console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x79)]('Validation\x20failed:\x20'+_0x2344df[_0x375691(0x9d)]+_0x375691(0x9f)+_0x2344df[_0x375691(0x77)]+'\x20valid')),_0x2344df[_0x375691(0x8a)]>0x0&&console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x8d)](_0x2344df[_0x375691(0x8a)]+_0x375691(0x7c))),_0x2344df['skippedCount']>0x0&&console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0xa1)](_0x2344df['skippedCount']+_0x375691(0x8c))),0x1):(console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x72)](_0x375691(0x93)+_0x2344df[_0x375691(0x77)]+_0x375691(0x87))),_0x2344df[_0x375691(0x8a)]>0x0&&console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x8d)](_0x2344df[_0x375691(0x8a)]+_0x375691(0x7c))),_0x2344df[_0x375691(0x82)]>0x0&&console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0xa1)](_0x2344df[_0x375691(0x82)]+_0x375691(0x8c))),0x0);}}function a25_0x22d7(){const _0x5df251=['verbose','invalidCount','Error:\x20Directory\x20not\x20found:\x20','\x20template(s)\x20with\x20errors,\x20','valid','dim','453221SUwKmA','error','green','\x20(skipped:\x20','\x20warning(s)','144kgohJg','resolve','validCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','Validate\x20template\x20YAML\x20files','template','\x20warning(s)\x20found','filter','name','description','182524WxsueP','\x20error(s)','skippedCount','reason','24LkIvhi','14iWLTJl','978289oJUWiv','\x20template(s)\x20valid','4851prAgJr','log','warningCount','warnings','\x20non-template\x20file(s)\x20skipped','yellow','921328LzrPZp','endsWith','.yaml','2WOLMaF','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','✔\x20All\x20','dirname','1282165rdowYg','10273670ctWsjW','hasErrors','12920kHPvtE','18JIBVtl','length','No\x20template\x20YAML\x20files\x20found\x20in\x20'];a25_0x22d7=function(){return _0x5df251;};return a25_0x22d7();}
1
+ function a25_0x15e6(){const _0x7460b9=['warnings','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','\x20valid','\x20(skipped:\x20','\x20non-template\x20file(s)\x20skipped','execute','7960644jUkexQ','\x20template(s)\x20valid','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','✔\x20All\x20','5788mDhHvU','endsWith','valid','2190FmjsZd','hasErrors','reason','5476968lbZyGT','\x20error(s)','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)','error','4831140CsHFoO','skippedCount','\x20template(s)\x20with\x20errors,\x20','resolve','log','dirname','validCount','green','template','6jVXFqC','\x20non-template\x20file(s)\x20skipped)','relativePath','545450NsBDYT','filter','yellow','dim','.yaml','490966HGTgyT','\x20warning(s)\x20found','errors','cwd','Validate\x20template\x20YAML\x20files','1494008lbGbkz','description','136SFwXFa','.yml','Error:\x20Directory\x20not\x20found:\x20','invalidCount','verbose','name','warningCount','red'];a25_0x15e6=function(){return _0x7460b9;};return a25_0x15e6();}const a25_0x51aaba=a25_0x329e;(function(_0x3dc17e,_0x12e737){const _0x5d38d3=a25_0x329e,_0x5b50c5=_0x3dc17e();while(!![]){try{const _0x5b6ed3=parseInt(_0x5d38d3(0x1d2))/0x1+-parseInt(_0x5d38d3(0x1c8))/0x2*(-parseInt(_0x5d38d3(0x1c5))/0x3)+parseInt(_0x5d38d3(0x1e7))/0x4*(parseInt(_0x5d38d3(0x1ea))/0x5)+-parseInt(_0x5d38d3(0x1ed))/0x6+parseInt(_0x5d38d3(0x1cd))/0x7*(-parseInt(_0x5d38d3(0x1d4))/0x8)+parseInt(_0x5d38d3(0x1e3))/0x9+-parseInt(_0x5d38d3(0x1f2))/0xa;if(_0x5b6ed3===_0x12e737)break;else _0x5b50c5['push'](_0x5b50c5['shift']());}catch(_0x3866f3){_0x5b50c5['push'](_0x5b50c5['shift']());}}}(a25_0x15e6,0xecb00));import{BaseCommand}from'./command.js';function a25_0x329e(_0x20d01c,_0x38dc2a){_0x20d01c=_0x20d01c-0x1c2;const _0x15e604=a25_0x15e6();let _0x329e04=_0x15e604[_0x20d01c];return _0x329e04;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x7cc156 from'chalk';import a25_0x2176af from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x51aaba(0x1d9)]='engage:template:validate';[a25_0x51aaba(0x1d3)]=a25_0x51aaba(0x1d1);async[a25_0x51aaba(0x1e2)](_0x210a9a){const _0x4be7f9=a25_0x51aaba,{options:_0x38c530,args:_0x109b7b}=_0x210a9a,_0x49eeb4=_0x38c530,_0x362128=_0x109b7b[0x0],_0x378794=_0x362128?a25_0x2176af[_0x4be7f9(0x1f5)](_0x362128):undefined,_0x34845a=_0x378794?isYamlFile(_0x378794):![];let _0x31e9a1,_0x42c377;if(_0x34845a&&_0x378794)_0x31e9a1=a25_0x2176af[_0x4be7f9(0x1f7)](_0x378794),_0x42c377=_0x378794;else _0x378794?_0x31e9a1=_0x378794:_0x31e9a1=process[_0x4be7f9(0x1d0)]();if(!_0x42c377&&!existsSync(_0x31e9a1))return console[_0x4be7f9(0x1f1)](a25_0x7cc156[_0x4be7f9(0x1db)](_0x4be7f9(0x1d6)+_0x31e9a1+'\x0a')),0x1;let _0xb1aee6;if(_0x42c377){if(!_0x42c377[_0x4be7f9(0x1e8)](_0x4be7f9(0x1d5))&&!_0x42c377['endsWith'](_0x4be7f9(0x1cc)))return console[_0x4be7f9(0x1f1)](a25_0x7cc156[_0x4be7f9(0x1db)](_0x4be7f9(0x1e5)+_0x42c377+'\x0a')),0x1;_0xb1aee6=[_0x42c377];}else _0xb1aee6=findYamlFiles(_0x31e9a1);if(_0xb1aee6[_0x4be7f9(0x1de)]===0x0)return console[_0x4be7f9(0x1f1)](a25_0x7cc156[_0x4be7f9(0x1db)](_0x4be7f9(0x1dd)+_0x31e9a1+'\x0a')),0x1;const _0x36a4c7=validateYamlFiles(_0xb1aee6,_0x31e9a1,{'filterType':_0x4be7f9(0x1c4)}),_0x491faf=calculateSummary(_0x36a4c7),_0x4e1a99=_0x36a4c7[_0x4be7f9(0x1c9)](isValidationResult);if(_0x4e1a99['length']===0x0)return console[_0x4be7f9(0x1f1)](a25_0x7cc156['yellow'](_0x4be7f9(0x1ef)+_0x31e9a1+'\x0a')),_0x491faf[_0x4be7f9(0x1f3)]>0x0&&console['error'](a25_0x7cc156[_0x4be7f9(0x1cb)]('('+_0x491faf[_0x4be7f9(0x1f3)]+_0x4be7f9(0x1c6))),0x0;for(const _0x5a744c of _0x36a4c7){if(!isValidationResult(_0x5a744c)){_0x49eeb4[_0x4be7f9(0x1d8)]&&console['log'](a25_0x7cc156[_0x4be7f9(0x1cb)]('-\x20'+_0x5a744c[_0x4be7f9(0x1c7)]+_0x4be7f9(0x1e0)+_0x5a744c[_0x4be7f9(0x1ec)]+')'));continue;}const {relativePath:_0x46ed35,source:_0x3b3bcf,result:_0x386dbe}=_0x5a744c;if(_0x386dbe['valid']&&_0x386dbe[_0x4be7f9(0x1dc)]['length']===0x0)_0x49eeb4[_0x4be7f9(0x1d8)]&&console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1c3)]('✔\x20'+_0x46ed35));else _0x386dbe[_0x4be7f9(0x1e9)]?(console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1ca)]('⚠\x20'+_0x46ed35+':\x20'+_0x386dbe[_0x4be7f9(0x1dc)][_0x4be7f9(0x1de)]+_0x4be7f9(0x1f0))),console[_0x4be7f9(0x1f6)](formatValidationResult(_0x386dbe,_0x3b3bcf,_0x46ed35))):(console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1db)]('✖\x20'+_0x46ed35+':\x20'+_0x386dbe[_0x4be7f9(0x1cf)][_0x4be7f9(0x1de)]+_0x4be7f9(0x1ee))),console['log'](formatValidationResult(_0x386dbe,_0x3b3bcf,_0x46ed35)));}return console[_0x4be7f9(0x1f6)](''),_0x491faf[_0x4be7f9(0x1eb)]?(console[_0x4be7f9(0x1f6)](a25_0x7cc156['red']('Validation\x20failed:\x20'+_0x491faf[_0x4be7f9(0x1d7)]+_0x4be7f9(0x1f4)+_0x491faf[_0x4be7f9(0x1c2)]+_0x4be7f9(0x1df))),_0x491faf[_0x4be7f9(0x1da)]>0x0&&console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1ca)](_0x491faf[_0x4be7f9(0x1da)]+_0x4be7f9(0x1ce))),_0x491faf[_0x4be7f9(0x1f3)]>0x0&&console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1cb)](_0x491faf[_0x4be7f9(0x1f3)]+_0x4be7f9(0x1e1))),0x1):(console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1c3)](_0x4be7f9(0x1e6)+_0x491faf[_0x4be7f9(0x1c2)]+_0x4be7f9(0x1e4))),_0x491faf[_0x4be7f9(0x1da)]>0x0&&console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1ca)](_0x491faf['warningCount']+_0x4be7f9(0x1ce))),_0x491faf[_0x4be7f9(0x1f3)]>0x0&&console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1cb)](_0x491faf[_0x4be7f9(0x1f3)]+_0x4be7f9(0x1e1))),0x0);}}
@@ -1 +1 @@
1
- const a26_0x4a4b11=a26_0xc52b;(function(_0x38f3b5,_0x450a98){const _0x582976=a26_0xc52b,_0x1e76f1=_0x38f3b5();while(!![]){try{const _0x55c57c=-parseInt(_0x582976(0xdf))/0x1*(-parseInt(_0x582976(0xe3))/0x2)+parseInt(_0x582976(0xc6))/0x3*(-parseInt(_0x582976(0xe7))/0x4)+-parseInt(_0x582976(0xf5))/0x5+-parseInt(_0x582976(0xc3))/0x6*(-parseInt(_0x582976(0xd6))/0x7)+-parseInt(_0x582976(0xf4))/0x8+-parseInt(_0x582976(0xdd))/0x9+parseInt(_0x582976(0x10e))/0xa*(parseInt(_0x582976(0x104))/0xb);if(_0x55c57c===_0x450a98)break;else _0x1e76f1['push'](_0x1e76f1['shift']());}catch(_0x513ff5){_0x1e76f1['push'](_0x1e76f1['shift']());}}}(a26_0x1c1f,0xb518c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';function a26_0xc52b(_0x173897,_0x292d4d){_0x173897=_0x173897-0xc1;const _0x1c1f1a=a26_0x1c1f();let _0xc52b1=_0x1c1f1a[_0x173897];return _0xc52b1;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x2ccbcc from'chalk';function formatDuration(_0x4377bf){const _0x2664f3=a26_0xc52b;if(_0x4377bf<0x3c)return _0x4377bf+'s';if(_0x4377bf<0xe10)return Math['floor'](_0x4377bf/0x3c)+'m\x20'+_0x4377bf%0x3c+'s';const _0xb39ad6=Math[_0x2664f3(0xee)](_0x4377bf/0xe10),_0x4388e8=Math['floor'](_0x4377bf%0xe10/0x3c);return _0x4388e8>0x0?_0xb39ad6+'h\x20'+_0x4388e8+'m':_0xb39ad6+'h';}function formatRelativeTime(_0x43cdcf){const _0x109bc4=a26_0xc52b,_0x25e783=Date[_0x109bc4(0xcb)]()-_0x43cdcf[_0x109bc4(0x100)](),_0x45898e=Math['floor'](Math[_0x109bc4(0xfc)](_0x25e783)/0x3e8);if(_0x45898e<0x3c)return'just\x20now';const _0x405694=Math[_0x109bc4(0xee)](_0x45898e/0x3c);if(_0x405694<0x3c)return _0x405694+_0x109bc4(0xe6);const _0x38dfa1=Math['floor'](_0x405694/0x3c);if(_0x38dfa1<0x18)return _0x38dfa1+_0x109bc4(0xf8);const _0x5712b3=Math[_0x109bc4(0xee)](_0x38dfa1/0x18);if(_0x5712b3<0x1e)return _0x5712b3+_0x109bc4(0x109);return Math[_0x109bc4(0xee)](_0x5712b3/0x1e)+_0x109bc4(0x103);}export class JobListCommand extends BaseCommand{[a26_0x4a4b11(0xfa)]=a26_0x4a4b11(0xd9);[a26_0x4a4b11(0x112)]=a26_0x4a4b11(0x117);async['execute'](_0x8680fb){const _0x5a38e3=a26_0x4a4b11,{options:_0x4c714c,tdx:_0x3d1d83}=_0x8680fb,_0x52b31c=resolveLimit(_0x4c714c[_0x5a38e3(0x101)],DEFAULT_DISPLAY_LIMIT),_0x2d166b=_0x4c714c[_0x5a38e3(0xfe)];_0x4c714c[_0x5a38e3(0xd3)]&&(console[_0x5a38e3(0xf1)](_0x5a38e3(0xe5)+_0x52b31c+_0x5a38e3(0xc9)),_0x2d166b&&console['error'](_0x5a38e3(0xd8)+_0x2d166b));const _0x536969=await withSpinner(_0x5a38e3(0xf7),()=>_0x3d1d83['jobs'][_0x5a38e3(0xe1)]({'from':0x0,'to':_0x52b31c-0x1,'status':_0x2d166b}),{'verbose':_0x4c714c[_0x5a38e3(0xd3)]}),_0x20f0ce=_0x536969['data'];console[_0x5a38e3(0xf1)]('✔\x20Found\x20'+_0x20f0ce[_0x5a38e3(0x10a)]+_0x5a38e3(0x110)+(_0x20f0ce[_0x5a38e3(0x10a)]!==0x1?'s':''));const _0x396f1f=_0x4c714c[_0x5a38e3(0x106)];if(isStructuredFormat(_0x4c714c)){const _0x33a390=_0x20f0ce[_0x5a38e3(0x10c)](_0x2daf8c=>{const _0x22bc39=_0x5a38e3;let _0x437119;if(_0x2daf8c['start_at']&&_0x2daf8c['end_at']){const _0xdcdbb=new Date(_0x2daf8c[_0x22bc39(0x119)])['getTime'](),_0x5ba4fe=new Date(_0x2daf8c['end_at'])[_0x22bc39(0x100)]();_0x437119=Math[_0x22bc39(0xec)]((_0x5ba4fe-_0xdcdbb)/0x3e8);}return{'job_id':_0x2daf8c[_0x22bc39(0xf3)],'type':_0x2daf8c[_0x22bc39(0xe9)]===_0x22bc39(0xde)?_0x22bc39(0x115):_0x2daf8c[_0x22bc39(0xe9)],'status':_0x2daf8c[_0x22bc39(0xfe)],'user_name':_0x2daf8c[_0x22bc39(0x10d)],'duration_sec':_0x437119,'created_at':_0x2daf8c[_0x22bc39(0xd5)],'started_at':_0x2daf8c[_0x22bc39(0x119)],'end_at':_0x2daf8c[_0x22bc39(0x105)]};});await handleSDKOutput(_0x33a390,_0x4c714c);}else for(const _0x3aa177 of _0x20f0ce){const _0x3a7469=_0x3aa177['status']===_0x5a38e3(0xf2)?a26_0x2ccbcc[_0x5a38e3(0x118)]:_0x3aa177[_0x5a38e3(0xfe)]===_0x5a38e3(0xf1)?a26_0x2ccbcc['red']:a26_0x2ccbcc['dim'],_0x431080=_0x3a7469(_0x3aa177[_0x5a38e3(0xfe)]),_0x302052=getJobUrl(_0x396f1f,_0x3aa177[_0x5a38e3(0xf3)]),_0x2004ab=hyperlink(_0x3aa177[_0x5a38e3(0xf3)],_0x302052),_0x4273da=a26_0x2ccbcc['dim'](_0x3aa177[_0x5a38e3(0xe9)]===_0x5a38e3(0xde)?'trino':_0x3aa177[_0x5a38e3(0xe9)]),_0x3fe392=[];if(_0x3aa177[_0x5a38e3(0x119)]&&_0x3aa177['end_at']){const _0x53dc2f=Math[_0x5a38e3(0xec)]((new Date(_0x3aa177[_0x5a38e3(0x105)])[_0x5a38e3(0x100)]()-new Date(_0x3aa177[_0x5a38e3(0x119)])['getTime']())/0x3e8);_0x3fe392[_0x5a38e3(0xc7)](formatDuration(_0x53dc2f));}if(_0x3aa177[_0x5a38e3(0x105)])_0x3fe392[_0x5a38e3(0xc7)](formatRelativeTime(new Date(_0x3aa177[_0x5a38e3(0x105)])));else _0x3aa177[_0x5a38e3(0x119)]&&_0x3fe392['push'](formatRelativeTime(new Date(_0x3aa177[_0x5a38e3(0x119)])));const _0xa86211=_0x3fe392['length']>0x0?a26_0x2ccbcc['dim']('\x20'+_0x3fe392[_0x5a38e3(0xf0)](',\x20')):'';console['log']('⚡\x20'+_0x2004ab+'\x20'+_0x4273da+'\x20'+_0x431080+_0xa86211);}return 0x0;}}function a26_0x1c1f(){const _0x4c77cb=['Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Listing\x20jobs...','h\x20ago','✔\x20Job\x20submitted','name','submit','abs','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','status','debug','getTime','limit','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','mo\x20ago','11iKBfTr','end_at','site','kill','substring','d\x20ago','length','INVALID_ARGUMENT','map','user_name','25249330SxDBiZ','priority','\x20job','\x27\x20to\x20verify\x20the\x20job\x20status','description','validate','args','trino','Submitting\x20kill\x20request...','List\x20jobs','green','start_at','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Getting\x20job\x20results...','\x20\x20Job\x20ID:\x20','2224608sfdIaS','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','job:kill','19785iMbbAB','push','Cancelled','\x20jobs','data','now','url','query','\x20row','information_schema','Submitting\x20job...','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','No\x20SQL\x20statements\x20found\x20in\x20file','verbose','job:submit','created_at','14mTKwFw','Getting\x20job\x20details...','Status\x20filter:\x20','jobs','result','database','Submit\x20a\x20job','9687096dJfQqU','presto','1msBuEg','yes','list','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','1089078ADtQnz','job:show','Limit:\x20','m\x20ago','148IuvoPQ','Kill\x20a\x20job','type','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','jobType','round','execute','floor','Database:\x20','join','error','success','job_id','8693344YscjZa','3311045OurBQW'];a26_0x1c1f=function(){return _0x4c77cb;};return a26_0x1c1f();}export class JobShowCommand extends BaseCommand{[a26_0x4a4b11(0xfa)]=a26_0x4a4b11(0xe4);['description']='Show\x20job\x20details';[a26_0x4a4b11(0x113)](_0xa17042){const _0x4aa310=a26_0x4a4b11,_0xf46b64=_0xa17042[_0x4aa310(0x114)][0x0];if(!_0xf46b64)return _0x4aa310(0xf6);return undefined;}async['execute'](_0x1642bf){const _0x43444a=a26_0x4a4b11,{options:_0x1a4bda,args:_0x1d6de3,tdx:_0x318402}=_0x1642bf,_0x5954ac=_0x1d6de3[0x0],_0x51e862=await withSpinner(_0x43444a(0xd7),()=>_0x318402['jobs']['show'](_0x5954ac),{'verbose':_0x1a4bda[_0x43444a(0xd3)]}),_0x5b429c=_0x51e862[_0x43444a(0xca)];let _0x389e45;if(_0x5b429c['start_at']&&_0x5b429c[_0x43444a(0x105)]){const _0x5cff4d=new Date(_0x5b429c[_0x43444a(0x119)])[_0x43444a(0x100)](),_0x5b808a=new Date(_0x5b429c[_0x43444a(0x105)])[_0x43444a(0x100)]();_0x389e45=Math[_0x43444a(0xec)]((_0x5b808a-_0x5cff4d)/0x3e8);}const _0x343221={'job_id':_0x5b429c[_0x43444a(0xf3)],'type':_0x5b429c[_0x43444a(0xe9)],'status':_0x5b429c[_0x43444a(0xfe)],..._0x5b429c[_0x43444a(0x10d)]&&{'user_name':_0x5b429c[_0x43444a(0x10d)]},..._0x389e45!==undefined&&{'duration_sec':_0x389e45},..._0x5b429c[_0x43444a(0xd5)]&&{'created_at':_0x5b429c['created_at']},..._0x5b429c[_0x43444a(0x119)]&&{'started_at':_0x5b429c[_0x43444a(0x119)]},..._0x5b429c[_0x43444a(0x105)]&&{'end_at':_0x5b429c['end_at']},..._0x5b429c[_0x43444a(0xdb)]&&{'database':_0x5b429c[_0x43444a(0xdb)]},..._0x5b429c[_0x43444a(0x10f)]!==undefined&&{'priority':_0x5b429c[_0x43444a(0x10f)]},..._0x5b429c[_0x43444a(0xcc)]&&{'url':_0x5b429c[_0x43444a(0xcc)]},..._0x5b429c[_0x43444a(0xcd)]&&{'query':_0x5b429c[_0x43444a(0xcd)]},..._0x5b429c[_0x43444a(0xff)]&&{'debug':_0x5b429c[_0x43444a(0xff)]}};return await handleSingleObjectOutput(_0x343221,_0x1a4bda),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x4a4b11(0xc5);[a26_0x4a4b11(0x112)]=a26_0x4a4b11(0xe8);[a26_0x4a4b11(0x113)](_0x417864){const _0x26a624=a26_0x4a4b11,_0x45af19=_0x417864['args'][0x0];if(!_0x45af19)return _0x26a624(0x102);return undefined;}async['execute'](_0x232310){const _0x429cb6=a26_0x4a4b11,{options:_0x21b3ec,args:_0x4b1be1,tdx:_0x47d761}=_0x232310,_0x5599cc=_0x4b1be1[0x0];if(!_0x21b3ec[_0x429cb6(0xe0)]){const _0xb5c902=await confirm(_0x429cb6(0xea)+_0x5599cc+'?');if(!_0xb5c902)return console['error'](_0x429cb6(0xc8)),0x0;}return await withSpinner(_0x429cb6(0x116),()=>_0x47d761[_0x429cb6(0xd9)][_0x429cb6(0x107)](_0x5599cc),{'verbose':_0x21b3ec[_0x429cb6(0xd3)]}),console[_0x429cb6(0xf1)](_0x429cb6(0x11a)+_0x5599cc),console[_0x429cb6(0xf1)](_0x429cb6(0xe2)+_0x5599cc+_0x429cb6(0x111)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x4a4b11(0xfa)]=a26_0x4a4b11(0xd4);[a26_0x4a4b11(0x112)]=a26_0x4a4b11(0xdc);async[a26_0x4a4b11(0xed)](_0x50c363){const _0x446f78=a26_0x4a4b11,{options:_0x1ea501,args:_0x555e37,tdx:_0x12eb19}=_0x50c363,_0x2c9664=_0x1ea501[_0x446f78(0xeb)]||_0x446f78(0x115),_0x179c31=_0x1ea501['file'],_0x4027e6=_0x1ea501[_0x446f78(0xdb)]||_0x446f78(0xcf),_0x267606=_0x1ea501[_0x446f78(0xda)];if(_0x2c9664!==_0x446f78(0x115)&&_0x2c9664!=='hive')throw new SDKError(ErrorCode[_0x446f78(0x10b)],_0x446f78(0xfd));let _0x404e03;if(_0x179c31){if(_0x555e37[0x0])throw new SDKError(ErrorCode[_0x446f78(0x10b)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x40a118=readSqlStatementsFromFile(_0x179c31);if(_0x40a118[_0x446f78(0x10a)]===0x0)throw new SDKError(ErrorCode[_0x446f78(0x10b)],_0x446f78(0xd2));if(_0x40a118['length']>0x1)throw new SDKError(ErrorCode[_0x446f78(0x10b)],_0x446f78(0xc4));_0x404e03=_0x40a118[0x0];}else{if(!_0x555e37[0x0])throw new SDKError(ErrorCode[_0x446f78(0x10b)],_0x446f78(0xd1));_0x404e03=_0x555e37[0x0];}_0x1ea501[_0x446f78(0xd3)]&&(console[_0x446f78(0xf1)]('Job\x20type:\x20'+_0x2c9664),console[_0x446f78(0xf1)](_0x446f78(0xef)+_0x4027e6),console[_0x446f78(0xf1)]('Query:\x20'+_0x404e03[_0x446f78(0x108)](0x0,0x64)+(_0x404e03[_0x446f78(0x10a)]>0x64?'...':'')));const _0x2532e4=await withSpinner(_0x446f78(0xd0),()=>_0x12eb19['jobs'][_0x446f78(0xfb)](_0x4027e6,_0x404e03,_0x2c9664,_0x267606),{'verbose':_0x1ea501[_0x446f78(0xd3)]}),_0x5a2da6=_0x2532e4[_0x446f78(0xca)];return console['error'](_0x446f78(0xf9)),console['error'](_0x446f78(0xc2)+_0x5a2da6[_0x446f78(0xf3)]),await handleSDKOutput([_0x5a2da6],_0x1ea501),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x4a4b11(0xfa)]='job:result';[a26_0x4a4b11(0x112)]='Get\x20job\x20results';[a26_0x4a4b11(0x113)](_0x1dfa9c){const _0x345493=_0x1dfa9c['args'][0x0];if(!_0x345493)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x4a4b11(0xed)](_0x5aa265){const _0x21521b=a26_0x4a4b11,{options:_0x1586cf,args:_0x4cc82f,tdx:_0x202828}=_0x5aa265,_0x4bc2ce=_0x4cc82f[0x0],_0x462d3d=await withSpinner(_0x21521b(0xc1),()=>_0x202828[_0x21521b(0xd9)][_0x21521b(0xda)](_0x4bc2ce),{'verbose':_0x1586cf[_0x21521b(0xd3)]}),_0x36d3c5=_0x462d3d[_0x21521b(0xca)];return console[_0x21521b(0xf1)]('✔\x20Retrieved\x20'+_0x36d3c5['length']+_0x21521b(0xce)+(_0x36d3c5[_0x21521b(0x10a)]!==0x1?'s':'')),await handleSDKOutput(_0x36d3c5,_0x1586cf),0x0;}}
1
+ const a26_0x3d6011=a26_0x451f;(function(_0x1e99e8,_0x337984){const _0x37b6e3=a26_0x451f,_0x1d5e6b=_0x1e99e8();while(!![]){try{const _0x996d4=-parseInt(_0x37b6e3(0x1d0))/0x1*(-parseInt(_0x37b6e3(0x1a2))/0x2)+-parseInt(_0x37b6e3(0x1dc))/0x3*(parseInt(_0x37b6e3(0x1d3))/0x4)+parseInt(_0x37b6e3(0x1bb))/0x5*(-parseInt(_0x37b6e3(0x199))/0x6)+parseInt(_0x37b6e3(0x1e1))/0x7*(parseInt(_0x37b6e3(0x19f))/0x8)+parseInt(_0x37b6e3(0x1d9))/0x9+parseInt(_0x37b6e3(0x18b))/0xa*(parseInt(_0x37b6e3(0x1b6))/0xb)+-parseInt(_0x37b6e3(0x1cf))/0xc;if(_0x996d4===_0x337984)break;else _0x1d5e6b['push'](_0x1d5e6b['shift']());}catch(_0x24b188){_0x1d5e6b['push'](_0x1d5e6b['shift']());}}}(a26_0x28d9,0xaf13d));function a26_0x28d9(){const _0x553ae8=['\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','12846987NnNsWE','job:submit','file','38715PmkDER','Submitting\x20job...','hive','result','description','6814094pylnEg','✔\x20Job\x20submitted','Get\x20job\x20results','yes','Submitting\x20kill\x20request...','20eJLryq','database','red','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','dim','trino','error','presto','d\x20ago','Cancelled','round','execute','Status\x20filter:\x20','...','1558074LSZQJk','validate','Getting\x20job\x20results...','green','✔\x20Retrieved\x20','join','8uMxvFR','floor','\x20jobs','1075034jpxDJN','limit','created_at','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Database:\x20','length','status','push','log','Getting\x20job\x20details...','debug','Listing\x20jobs...','type','job:result','map','kill','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','user_name','verbose','success','3827351uiZtNw','No\x20SQL\x20statements\x20found\x20in\x20file','show','\x20job','now','15okEAHP','url','list','name','site','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','query','Job\x20type:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','INVALID_ARGUMENT','args','start_at','getTime','Submit\x20a\x20job','jobs','end_at','Limit:\x20','Kill\x20a\x20job','abs','data','8777820YvLfjH','1YCBFOx','job_id','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','436WjtibU','priority','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','submit','Query:\x20'];a26_0x28d9=function(){return _0x553ae8;};return a26_0x28d9();}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 a26_0x3d985a from'chalk';function formatDuration(_0xe20bbd){const _0x3dcaa8=a26_0x451f;if(_0xe20bbd<0x3c)return _0xe20bbd+'s';if(_0xe20bbd<0xe10)return Math[_0x3dcaa8(0x1a0)](_0xe20bbd/0x3c)+'m\x20'+_0xe20bbd%0x3c+'s';const _0x4babde=Math[_0x3dcaa8(0x1a0)](_0xe20bbd/0xe10),_0x27d816=Math[_0x3dcaa8(0x1a0)](_0xe20bbd%0xe10/0x3c);return _0x27d816>0x0?_0x4babde+'h\x20'+_0x27d816+'m':_0x4babde+'h';}function formatRelativeTime(_0x482962){const _0x5e833a=a26_0x451f,_0x55de50=Date[_0x5e833a(0x1ba)]()-_0x482962[_0x5e833a(0x1c7)](),_0xc0d3d8=Math['floor'](Math[_0x5e833a(0x1cd)](_0x55de50)/0x3e8);if(_0xc0d3d8<0x3c)return'just\x20now';const _0x2087bc=Math[_0x5e833a(0x1a0)](_0xc0d3d8/0x3c);if(_0x2087bc<0x3c)return _0x2087bc+'m\x20ago';const _0x3e2cbe=Math['floor'](_0x2087bc/0x3c);if(_0x3e2cbe<0x18)return _0x3e2cbe+'h\x20ago';const _0x181116=Math[_0x5e833a(0x1a0)](_0x3e2cbe/0x18);if(_0x181116<0x1e)return _0x181116+_0x5e833a(0x193);return Math[_0x5e833a(0x1a0)](_0x181116/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x3d6011(0x1be)]=a26_0x3d6011(0x1c9);[a26_0x3d6011(0x1e0)]='List\x20jobs';async[a26_0x3d6011(0x196)](_0x352ea7){const _0x1c91b1=a26_0x3d6011,{options:_0xe51d0a,tdx:_0x147b48}=_0x352ea7,_0x1c8313=resolveLimit(_0xe51d0a[_0x1c91b1(0x1a3)],DEFAULT_DISPLAY_LIMIT),_0x2db7f3=_0xe51d0a[_0x1c91b1(0x1a8)];_0xe51d0a[_0x1c91b1(0x1b4)]&&(console[_0x1c91b1(0x191)](_0x1c91b1(0x1cb)+_0x1c8313+_0x1c91b1(0x1a1)),_0x2db7f3&&console['error'](_0x1c91b1(0x197)+_0x2db7f3));const _0x5aabf7=await withSpinner(_0x1c91b1(0x1ad),()=>_0x147b48['jobs'][_0x1c91b1(0x1bd)]({'from':0x0,'to':_0x1c8313-0x1,'status':_0x2db7f3}),{'verbose':_0xe51d0a[_0x1c91b1(0x1b4)]}),_0x40fe7e=_0x5aabf7[_0x1c91b1(0x1ce)];console[_0x1c91b1(0x191)]('✔\x20Found\x20'+_0x40fe7e[_0x1c91b1(0x1a7)]+_0x1c91b1(0x1b9)+(_0x40fe7e[_0x1c91b1(0x1a7)]!==0x1?'s':''));const _0x384106=_0xe51d0a[_0x1c91b1(0x1bf)];if(isStructuredFormat(_0xe51d0a)){const _0x30c730=_0x40fe7e[_0x1c91b1(0x1b0)](_0x5d10b0=>{const _0x3fe2b1=_0x1c91b1;let _0x24c151;if(_0x5d10b0[_0x3fe2b1(0x1c6)]&&_0x5d10b0[_0x3fe2b1(0x1ca)]){const _0x2bf440=new Date(_0x5d10b0[_0x3fe2b1(0x1c6)])[_0x3fe2b1(0x1c7)](),_0x5603b0=new Date(_0x5d10b0[_0x3fe2b1(0x1ca)])['getTime']();_0x24c151=Math[_0x3fe2b1(0x195)]((_0x5603b0-_0x2bf440)/0x3e8);}return{'job_id':_0x5d10b0[_0x3fe2b1(0x1d1)],'type':_0x5d10b0[_0x3fe2b1(0x1ae)]===_0x3fe2b1(0x192)?_0x3fe2b1(0x190):_0x5d10b0[_0x3fe2b1(0x1ae)],'status':_0x5d10b0['status'],'user_name':_0x5d10b0[_0x3fe2b1(0x1b3)],'duration_sec':_0x24c151,'created_at':_0x5d10b0[_0x3fe2b1(0x1a4)],'started_at':_0x5d10b0['start_at'],'end_at':_0x5d10b0[_0x3fe2b1(0x1ca)]};});await handleSDKOutput(_0x30c730,_0xe51d0a);}else for(const _0x405045 of _0x40fe7e){const _0x5e5026=_0x405045[_0x1c91b1(0x1a8)]===_0x1c91b1(0x1b5)?a26_0x3d985a[_0x1c91b1(0x19c)]:_0x405045[_0x1c91b1(0x1a8)]===_0x1c91b1(0x191)?a26_0x3d985a[_0x1c91b1(0x18d)]:a26_0x3d985a[_0x1c91b1(0x18f)],_0x4cb222=_0x5e5026(_0x405045['status']),_0x14dd93=getJobUrl(_0x384106,_0x405045[_0x1c91b1(0x1d1)]),_0x48e0b6=hyperlink(_0x405045[_0x1c91b1(0x1d1)],_0x14dd93),_0x5d91b3=a26_0x3d985a[_0x1c91b1(0x18f)](_0x405045[_0x1c91b1(0x1ae)]===_0x1c91b1(0x192)?'trino':_0x405045[_0x1c91b1(0x1ae)]),_0x45d680=[];if(_0x405045[_0x1c91b1(0x1c6)]&&_0x405045[_0x1c91b1(0x1ca)]){const _0xee6f33=Math[_0x1c91b1(0x195)]((new Date(_0x405045[_0x1c91b1(0x1ca)])['getTime']()-new Date(_0x405045[_0x1c91b1(0x1c6)])['getTime']())/0x3e8);_0x45d680['push'](formatDuration(_0xee6f33));}if(_0x405045[_0x1c91b1(0x1ca)])_0x45d680['push'](formatRelativeTime(new Date(_0x405045[_0x1c91b1(0x1ca)])));else _0x405045[_0x1c91b1(0x1c6)]&&_0x45d680[_0x1c91b1(0x1a9)](formatRelativeTime(new Date(_0x405045[_0x1c91b1(0x1c6)])));const _0x9aa916=_0x45d680[_0x1c91b1(0x1a7)]>0x0?a26_0x3d985a[_0x1c91b1(0x18f)]('\x20'+_0x45d680[_0x1c91b1(0x19e)](',\x20')):'';console[_0x1c91b1(0x1aa)]('⚡\x20'+_0x48e0b6+'\x20'+_0x5d91b3+'\x20'+_0x4cb222+_0x9aa916);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x3d6011(0x1be)]='job:show';[a26_0x3d6011(0x1e0)]='Show\x20job\x20details';[a26_0x3d6011(0x19a)](_0x3e4a96){const _0x3b96e6=a26_0x3d6011,_0x423502=_0x3e4a96[_0x3b96e6(0x1c5)][0x0];if(!_0x423502)return _0x3b96e6(0x1b2);return undefined;}async[a26_0x3d6011(0x196)](_0x39bb43){const _0x58b661=a26_0x3d6011,{options:_0x5860a4,args:_0x3c77c8,tdx:_0x3bf2f3}=_0x39bb43,_0x376dc7=_0x3c77c8[0x0],_0xc8a9cf=await withSpinner(_0x58b661(0x1ab),()=>_0x3bf2f3[_0x58b661(0x1c9)][_0x58b661(0x1b8)](_0x376dc7),{'verbose':_0x5860a4[_0x58b661(0x1b4)]}),_0x581076=_0xc8a9cf['data'];let _0x29fc16;if(_0x581076[_0x58b661(0x1c6)]&&_0x581076['end_at']){const _0x4b190d=new Date(_0x581076[_0x58b661(0x1c6)])[_0x58b661(0x1c7)](),_0x4bd7c6=new Date(_0x581076[_0x58b661(0x1ca)])['getTime']();_0x29fc16=Math[_0x58b661(0x195)]((_0x4bd7c6-_0x4b190d)/0x3e8);}const _0x48bca0={'job_id':_0x581076['job_id'],'type':_0x581076['type'],'status':_0x581076[_0x58b661(0x1a8)],..._0x581076[_0x58b661(0x1b3)]&&{'user_name':_0x581076[_0x58b661(0x1b3)]},..._0x29fc16!==undefined&&{'duration_sec':_0x29fc16},..._0x581076[_0x58b661(0x1a4)]&&{'created_at':_0x581076['created_at']},..._0x581076[_0x58b661(0x1c6)]&&{'started_at':_0x581076['start_at']},..._0x581076['end_at']&&{'end_at':_0x581076[_0x58b661(0x1ca)]},..._0x581076[_0x58b661(0x18c)]&&{'database':_0x581076[_0x58b661(0x18c)]},..._0x581076[_0x58b661(0x1d4)]!==undefined&&{'priority':_0x581076[_0x58b661(0x1d4)]},..._0x581076[_0x58b661(0x1bc)]&&{'url':_0x581076[_0x58b661(0x1bc)]},..._0x581076['query']&&{'query':_0x581076[_0x58b661(0x1c1)]},..._0x581076[_0x58b661(0x1ac)]&&{'debug':_0x581076[_0x58b661(0x1ac)]}};return await handleSingleObjectOutput(_0x48bca0,_0x5860a4),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x3d6011(0x1be)]='job:kill';[a26_0x3d6011(0x1e0)]=a26_0x3d6011(0x1cc);[a26_0x3d6011(0x19a)](_0x4ee3ba){const _0x17193c=a26_0x3d6011,_0x21fc8c=_0x4ee3ba[_0x17193c(0x1c5)][0x0];if(!_0x21fc8c)return _0x17193c(0x1c0);return undefined;}async[a26_0x3d6011(0x196)](_0x12ea32){const _0x421bb9=a26_0x3d6011,{options:_0x1dcf6d,args:_0x4e32da,tdx:_0x4bf95d}=_0x12ea32,_0x41aa50=_0x4e32da[0x0];if(!_0x1dcf6d[_0x421bb9(0x1e4)]){const _0x1acbd0=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x41aa50+'?');if(!_0x1acbd0)return console[_0x421bb9(0x191)](_0x421bb9(0x194)),0x0;}return await withSpinner(_0x421bb9(0x1e5),()=>_0x4bf95d[_0x421bb9(0x1c9)][_0x421bb9(0x1b1)](_0x41aa50),{'verbose':_0x1dcf6d['verbose']}),console[_0x421bb9(0x191)](_0x421bb9(0x1a5)+_0x41aa50),console[_0x421bb9(0x191)](_0x421bb9(0x1d8)+_0x41aa50+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}function a26_0x451f(_0x53e3a3,_0x39f9c1){_0x53e3a3=_0x53e3a3-0x18b;const _0x28d943=a26_0x28d9();let _0x451fae=_0x28d943[_0x53e3a3];return _0x451fae;}export class JobSubmitCommand extends BaseCommand{['name']=a26_0x3d6011(0x1da);[a26_0x3d6011(0x1e0)]=a26_0x3d6011(0x1c8);async[a26_0x3d6011(0x196)](_0x367e95){const _0x111a5e=a26_0x3d6011,{options:_0x5ce5f2,args:_0xe92ca6,tdx:_0x5296f6}=_0x367e95,_0x1ce1ec=_0x5ce5f2['jobType']||_0x111a5e(0x190),_0x289eee=_0x5ce5f2[_0x111a5e(0x1db)],_0x158bdb=_0x5ce5f2[_0x111a5e(0x18c)]||'information_schema',_0x1fd693=_0x5ce5f2[_0x111a5e(0x1df)];if(_0x1ce1ec!==_0x111a5e(0x190)&&_0x1ce1ec!==_0x111a5e(0x1de))throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x44744f;if(_0x289eee){if(_0xe92ca6[0x0])throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],_0x111a5e(0x1c3));const _0xfcdbcc=readSqlStatementsFromFile(_0x289eee);if(_0xfcdbcc['length']===0x0)throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],_0x111a5e(0x1b7));if(_0xfcdbcc[_0x111a5e(0x1a7)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x111a5e(0x1d5));_0x44744f=_0xfcdbcc[0x0];}else{if(!_0xe92ca6[0x0])throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],_0x111a5e(0x1d2));_0x44744f=_0xe92ca6[0x0];}_0x5ce5f2[_0x111a5e(0x1b4)]&&(console[_0x111a5e(0x191)](_0x111a5e(0x1c2)+_0x1ce1ec),console['error'](_0x111a5e(0x1a6)+_0x158bdb),console[_0x111a5e(0x191)](_0x111a5e(0x1d7)+_0x44744f['substring'](0x0,0x64)+(_0x44744f[_0x111a5e(0x1a7)]>0x64?_0x111a5e(0x198):'')));const _0x576d6f=await withSpinner(_0x111a5e(0x1dd),()=>_0x5296f6[_0x111a5e(0x1c9)][_0x111a5e(0x1d6)](_0x158bdb,_0x44744f,_0x1ce1ec,_0x1fd693),{'verbose':_0x5ce5f2[_0x111a5e(0x1b4)]}),_0x43cfe5=_0x576d6f[_0x111a5e(0x1ce)];return console['error'](_0x111a5e(0x1e2)),console[_0x111a5e(0x191)]('\x20\x20Job\x20ID:\x20'+_0x43cfe5[_0x111a5e(0x1d1)]),await handleSDKOutput([_0x43cfe5],_0x5ce5f2),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x3d6011(0x1be)]=a26_0x3d6011(0x1af);[a26_0x3d6011(0x1e0)]=a26_0x3d6011(0x1e3);[a26_0x3d6011(0x19a)](_0x29339e){const _0xe2b3be=a26_0x3d6011,_0x4dfb8d=_0x29339e[_0xe2b3be(0x1c5)][0x0];if(!_0x4dfb8d)return _0xe2b3be(0x18e);return undefined;}async[a26_0x3d6011(0x196)](_0x5c1c0a){const _0x20cdf7=a26_0x3d6011,{options:_0x5d2507,args:_0x3a6a84,tdx:_0x1ed9a2}=_0x5c1c0a,_0x74f128=_0x3a6a84[0x0],_0x4788db=await withSpinner(_0x20cdf7(0x19b),()=>_0x1ed9a2[_0x20cdf7(0x1c9)][_0x20cdf7(0x1df)](_0x74f128),{'verbose':_0x5d2507['verbose']}),_0x426167=_0x4788db['data'];return console[_0x20cdf7(0x191)](_0x20cdf7(0x19d)+_0x426167[_0x20cdf7(0x1a7)]+'\x20row'+(_0x426167[_0x20cdf7(0x1a7)]!==0x1?'s':'')),await handleSDKOutput(_0x426167,_0x5d2507),0x0;}}
@@ -1 +1 @@
1
- const a27_0x36855a=a27_0x8afc;(function(_0x47c143,_0x3a8765){const _0x5b8dcd=a27_0x8afc,_0x1fd050=_0x47c143();while(!![]){try{const _0x1f8535=parseInt(_0x5b8dcd(0x1ed))/0x1+-parseInt(_0x5b8dcd(0x2ad))/0x2+-parseInt(_0x5b8dcd(0x28a))/0x3*(-parseInt(_0x5b8dcd(0x1f0))/0x4)+parseInt(_0x5b8dcd(0x207))/0x5*(-parseInt(_0x5b8dcd(0x1f2))/0x6)+parseInt(_0x5b8dcd(0x281))/0x7*(-parseInt(_0x5b8dcd(0x288))/0x8)+parseInt(_0x5b8dcd(0x24e))/0x9*(-parseInt(_0x5b8dcd(0x275))/0xa)+parseInt(_0x5b8dcd(0x2b0))/0xb;if(_0x1f8535===_0x3a8765)break;else _0x1fd050['push'](_0x1fd050['shift']());}catch(_0x5ea8a4){_0x1fd050['push'](_0x1fd050['shift']());}}}(a27_0xe32a,0x23544));import a27_0x1988d7 from'chalk';import a27_0x17c755 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';function a27_0x8afc(_0x7517eb,_0x13bc83){_0x7517eb=_0x7517eb-0x1b7;const _0xe32a05=a27_0xe32a();let _0x8afc1a=_0xe32a05[_0x7517eb];return _0x8afc1a;}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(_0x3d6752){const _0x1782d3=a27_0x8afc;return!_0x3d6752&&(console[_0x1782d3(0x1df)](_0x1782d3(0x26a)),console[_0x1782d3(0x1df)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x3d6752;}function withJsonFormat(_0x107d31){const _0x377d99=a27_0x8afc;if(!_0x107d31[_0x377d99(0x250)]&&!_0x107d31['json']&&!_0x107d31[_0x377d99(0x21d)]&&!_0x107d31[_0x377d99(0x1d0)])return{..._0x107d31,'format':_0x377d99(0x1f7),'json':!![]};return _0x107d31;}function formatJourneyState(_0x2e8773){const _0x3c4be0=a27_0x8afc;switch(_0x2e8773){case _0x3c4be0(0x1ee):return a27_0x1988d7['green'](_0x3c4be0(0x296));case'draft':return a27_0x1988d7[_0x3c4be0(0x249)]('(draft)');case _0x3c4be0(0x231):return a27_0x1988d7['yellow'](_0x3c4be0(0x1c3));case _0x3c4be0(0x211):return a27_0x1988d7[_0x3c4be0(0x20b)](_0x3c4be0(0x241));case _0x3c4be0(0x1d8):return a27_0x1988d7[_0x3c4be0(0x249)](_0x3c4be0(0x204));default:return'('+_0x2e8773+')';}}function formatJourneyItem(_0x5c7782,_0x91ec7b='',_0x1a14ca){const _0x221383=a27_0x8afc,_0x3c8dc0=formatJourneyState(_0x5c7782[_0x221383(0x233)]),_0x1afe60=_0x1a14ca?hyperlink(_0x5c7782['journeyBundleName'],_0x1a14ca):_0x5c7782[_0x221383(0x1cf)];return _0x91ec7b+_0x221383(0x1e1)+_0x1afe60+'\x20'+_0x3c8dc0;}function escapeRegex(_0x13bd1c){const _0x5aef97=a27_0x8afc;return _0x13bd1c[_0x5aef97(0x26b)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function a27_0xe32a(){const _0x1cd488=['buildIdToEmailMap','Getting\x20column\x20mapping...','journey','find','\x20\x20Statistics\x20not\x20available','journeyStages','(completed)','resolveJourneyId','getSegment','getTrafficData','verbose','Warning:\x20Could\x20not\x20resolve\x20segment\x20','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','journey:pause','dim','tdx.json','description','\x0aError:','map','1251aQSflm','activation','format','entries','Aborted.','Resolving\x20version...','folderId','\x20activation','\x22\x20resumed','stages','execute','journeys','parentName','get','\x20(rule\x20match)','journey:view','journey:list','kind','List\x20journeys\x20in\x20current\x20context','INVALID_ARGUMENT','No\x20statistics\x20available\x20for\x20journey:\x20','renderStats','yes','has','set','Input:\x20','no_parent','goal','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','replace','\x22\x20paused','hasPeriod','Error:\x20--version\x20option\x20is\x20required','Resuming\x20journey...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','List\x20activations\x20for\x20a\x20journey','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20Parent\x20segment\x20context\x20required','List\x20all\x20versions\x20of\x20a\x20journey','5690QggeYw','exitOrJumpSize','from','attributes','resolveParentId','\x20journey\x20files\x20to\x20','\x20not\x20found.\x20Available:\x20','milestoneSize','\x20version','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','connection','repeat','1675303TkSorX','listJourneysFromParentSegment','Fetching\x20','links','journey:stats','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','user','8PRAdFq','isNew','44496JlKTbL','Parent\x20segment:\x20','segments','nodes',',\x20version:\x20','audienceId','activationParams','createVersion','Folder\x20path:\x20','web','\x20\x20Parent\x20segment:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','(running)','Creating\x20new\x20version...','message','segment','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journey:version:view','resolveSegment','-\x20no\x20files\x20written','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','/e/','getColumnMapping','Resolving\x20journey...','\x20Opening\x20','goalSize','values','getActivation','Target\x20file:\x20','setPhase','journeyName','\x0aChanges\x20to\x20\x27','Fetching\x20parent\x20segment...','segmentPushCommand','550228hRwpFR','getJourney','journey:columns','7057919yBnBRx','✔\x20Found\x20','Getting\x20journey\x20details...','conversion','journey:activations','green','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','sort','relativePath','getStatistics','site','Show\x20journey\x20table\x20column\x20mapping','options','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','rule','versionNumber','journeyBundleId','✔\x20Context\x20set:\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','buildIdToNameMap','data','journey:pull','.yml','(paused)','utf-8','name','Fetching\x20users\x20and\x20connections...','type','\x20files?','Resolved\x20YAML\x20file:\x20','✔\x20Journey\x20\x22','cwd','\x20->\x20','log','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','journeyBundleName','tsv','updatedAt','all','Error:\x20Version\x20','filter','relative','localeCompare','stringify','archived','Error:\x20Invalid\x20version\x20number:\x20','listFolders','Resume\x20a\x20paused\x20journey','hasChanges','📁\x20','add','error','Table:\x20','🗺️\x20','/j/da/je','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','createdAt','folders','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Pattern:\x20','Database:\x20','Pausing\x20journey...','args','getParentFull','resume','229101hTwfAX','launched','stage','40oqWXnO','red','24syNuad','journeyId','helpText','absolutePath','No\x20journeys\x20found','json','join','parentSegment','View\x20a\x20specific\x20version\x20of\x20a\x20journey','toLowerCase','database','yellow','Pause\x20a\x20running\x20journey','Show\x20journey\x20statistics','version','Resolving\x20parent\x20segment...','Show\x20journey\x20details','file','(archived)','parent_segment','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','351010IAUEoL','Available\x20stages:\x20','Write\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','blue','/j/da','\x20changed\x20files','Error:\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','dryRun','completed','(root)','Error:\x20Stage\x20\x22','\x20Created\x20v','journey:versions','includeHistory','getLatestJourneyId','length','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','cyan','listActivationsFlat','push','jsonl','segmentName','journey:push','Found\x20','enteredSize','\x20\x20Target:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','bold','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Cancelled','\x20versions)','filePath','history','Getting\x20version\x20','base','...','size','rootFolderId','\x20\x20Folder\x20path:\x20','\x20\x20-\x20','paused','\x22\x20not\x20found','state','\x20new\x20files','root\x20folder','pause','\x20details...','exitOrJumpRate','includeStats','/app/ps/'];a27_0xe32a=function(){return _0x1cd488;};return a27_0xe32a();}function globToRegex(_0x21c1a9){const _0x2c6782=a27_0x8afc,_0x3b4be8=_0x21c1a9['split']('*')[_0x2c6782(0x24d)](escapeRegex);return new RegExp(_0x3b4be8[_0x2c6782(0x1f8)]('.*'),'i');}function buildRuleToNameMapping(_0x1c92ba){const _0x1a2cda=a27_0x8afc,_0x26ad53=new Map();if(_0x1c92ba[_0x1a2cda(0x28c)])for(const [_0x4d2271,_0x42a8dc]of Object[_0x1a2cda(0x251)](_0x1c92ba['segments'])){if(_0x42a8dc[_0x1a2cda(0x1ba)]){const _0x1973aa=serializeRule(_0x42a8dc[_0x1a2cda(0x1ba)]),_0x509647=_0x26ad53[_0x1a2cda(0x25b)](_0x1973aa);_0x509647?_0x509647['push'](_0x4d2271):_0x26ad53['set'](_0x1973aa,[_0x4d2271]);}}return _0x26ad53;}async function resolveJourneyIdFromInput(_0x8b3bd5,_0x28617d,_0x533597){const _0x3d2fcc=a27_0x8afc,_0x3f2acd=await resolveJourneyTarget(_0x8b3bd5,_0x28617d[_0x3d2fcc(0x1f9)],_0x28617d[_0x3d2fcc(0x245)]),_0x5486e1=_0x3f2acd[_0x3d2fcc(0x1f9)];if(!_0x5486e1)throw new SDKError(ErrorCode[_0x3d2fcc(0x261)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x46e583=await withSpinner(_0x3d2fcc(0x201),()=>_0x533597[_0x3d2fcc(0x299)][_0x3d2fcc(0x279)](_0x5486e1),{'verbose':_0x28617d['verbose']}),_0x2c6644=_0x46e583[_0x3d2fcc(0x1c0)],_0x57d414=await withSpinner(_0x3d2fcc(0x2a2),()=>_0x533597[_0x3d2fcc(0x23d)][_0x3d2fcc(0x242)](_0x2c6644,_0x3f2acd['journeyName']),{'verbose':_0x28617d['verbose']});return{'journeyId':_0x57d414['data'],'journeyName':_0x3f2acd[_0x3d2fcc(0x2a9)],'parentSegmentId':_0x2c6644};}async function resolveJourneyTarget(_0x53ce79,_0x6d360,_0x156298){const _0x4d41a8=a27_0x8afc;if(isYamlFilePath(_0x53ce79))try{const _0xf04d4a=await resolveYamlFilePath(_0x53ce79);return _0x156298&&(console[_0x4d41a8(0x1df)](_0x4d41a8(0x1c9)+_0x53ce79),console[_0x4d41a8(0x1df)](_0x4d41a8(0x294)+_0xf04d4a[_0x4d41a8(0x1f9)]),console[_0x4d41a8(0x1df)]('\x20\x20Name:\x20'+_0xf04d4a[_0x4d41a8(0x21e)]),console[_0x4d41a8(0x1df)](_0x4d41a8(0x22f)+(_0xf04d4a['folderPath']||_0x4d41a8(0x212)))),{'journeyName':_0xf04d4a[_0x4d41a8(0x21e)],'parentSegment':_0xf04d4a['parentSegment'],'resolved':_0xf04d4a};}catch(_0x5d42f0){throw new SDKError(ErrorCode[_0x4d41a8(0x261)],_0x4d41a8(0x219)+_0x5d42f0[_0x4d41a8(0x298)]);}if(!_0x6d360)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4d41a8(0x1e6));return{'journeyName':_0x53ce79,'parentSegment':_0x6d360};}export class JourneyListCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x25e);['description']=a27_0x36855a(0x260);async['execute'](_0x278b24){const _0x6c53ab=a27_0x36855a,{options:_0x2f40e3,args:_0x1ab208,tdx:_0x4bf984}=_0x278b24,_0x4a6f62=_0x1ab208[0x0],_0x521001=_0x2f40e3[_0x6c53ab(0x1f9)];if(!_0x521001)return console['error'](_0x6c53ab(0x273)),console['error'](_0x6c53ab(0x270)),0x1;const _0x3bab00=await withSpinner(_0x6c53ab(0x201),()=>_0x4bf984[_0x6c53ab(0x299)][_0x6c53ab(0x279)](_0x521001),{'verbose':_0x2f40e3['verbose']}),_0x20692d=_0x3bab00['data'];_0x2f40e3[_0x6c53ab(0x245)]&&(console[_0x6c53ab(0x1df)]('Parent\x20segment:\x20'+_0x521001+'\x20(ID:\x20'+_0x20692d+')'),_0x4a6f62&&console[_0x6c53ab(0x1df)](_0x6c53ab(0x1e7)+_0x4a6f62));const _0x312f42=await withSpinner(_0x6c53ab(0x2ab),()=>_0x4bf984[_0x6c53ab(0x299)][_0x6c53ab(0x1eb)](_0x20692d),{'verbose':_0x2f40e3['verbose']}),_0x378393=_0x312f42['data'],_0x38f756=_0x378393[_0x6c53ab(0x22e)],_0x7e7efa=await withSpinner('Listing\x20journeys...',()=>_0x4bf984[_0x6c53ab(0x23d)]['listJourneysWithFolders'](_0x20692d,_0x38f756),{'verbose':_0x2f40e3[_0x6c53ab(0x245)]});let _0x381222=_0x7e7efa['data'][_0x6c53ab(0x259)];const _0x14e613=_0x7e7efa[_0x6c53ab(0x1c0)][_0x6c53ab(0x1e5)],_0x3bf9f4=new Map();for(const _0x1f1c6b of _0x14e613){_0x3bf9f4[_0x6c53ab(0x266)](_0x1f1c6b['id'],_0x1f1c6b[_0x6c53ab(0x1c5)]);}if(_0x4a6f62){const _0x4d948f=globToRegex(_0x4a6f62);_0x381222=_0x381222['filter'](_0x3221f7=>_0x4d948f['test'](_0x3221f7[_0x6c53ab(0x1cf)]));}console[_0x6c53ab(0x1df)](_0x6c53ab(0x2b1)+_0x381222['length']+'\x20journey'+(_0x381222[_0x6c53ab(0x218)]!==0x1?'s':''));const _0x1291a4=_0xb909d6=>{const _0x48d77b=_0x6c53ab;return getConsoleNextUrl(_0x2f40e3[_0x48d77b(0x2ba)],_0x48d77b(0x23a)+_0x20692d+_0x48d77b(0x2a0)+_0xb909d6+_0x48d77b(0x20c));};if(_0x2f40e3[_0x6c53ab(0x250)]==='table')await handleSDKOutput(_0x381222,_0x2f40e3);else{if(_0x2f40e3['format']===_0x6c53ab(0x1f7)){const _0x5c7741=_0x381222[_0x6c53ab(0x24d)](_0xdf497c=>({..._0xdf497c,'url':_0x1291a4(_0xdf497c['id'])}));await handleSDKOutput(_0x5c7741,_0x2f40e3);}else{console[_0x6c53ab(0x1cd)]('['+_0x521001+']');const _0x1f0b84=new Map(),_0x1972d6=[];for(const _0x5018d7 of _0x381222){if(!_0x5018d7[_0x6c53ab(0x254)]||_0x5018d7['folderId']===_0x38f756)_0x1972d6[_0x6c53ab(0x21c)](_0x5018d7);else{const _0x1a04b2=_0x1f0b84[_0x6c53ab(0x25b)](_0x5018d7[_0x6c53ab(0x254)])||[];_0x1a04b2[_0x6c53ab(0x21c)](_0x5018d7),_0x1f0b84[_0x6c53ab(0x266)](_0x5018d7[_0x6c53ab(0x254)],_0x1a04b2);}}const _0x322094=(_0xcdbf80,_0x17ff7e)=>_0xcdbf80[_0x6c53ab(0x1cf)][_0x6c53ab(0x1d6)](_0x17ff7e['journeyBundleName'],undefined,{'sensitivity':_0x6c53ab(0x22b)});_0x1972d6[_0x6c53ab(0x2b7)](_0x322094);for(const _0x133626 of _0x1972d6){console[_0x6c53ab(0x1cd)](formatJourneyItem(_0x133626,'',_0x1291a4(_0x133626['id'])));}const _0x2ef66f=[..._0x1f0b84[_0x6c53ab(0x251)]()][_0x6c53ab(0x2b7)]((_0x35e29e,_0x385e74)=>{const _0x4af872=_0x6c53ab,_0xc962d3=_0x3bf9f4[_0x4af872(0x25b)](_0x35e29e[0x0])||_0x35e29e[0x0],_0x29a422=_0x3bf9f4[_0x4af872(0x25b)](_0x385e74[0x0])||_0x385e74[0x0];return _0xc962d3[_0x4af872(0x1d6)](_0x29a422,undefined,{'sensitivity':_0x4af872(0x22b)});});for(const [_0x545ac1,_0x16678b]of _0x2ef66f){const _0x52698d=_0x3bf9f4[_0x6c53ab(0x25b)](_0x545ac1)||_0x545ac1;console[_0x6c53ab(0x1cd)](_0x6c53ab(0x1dd)+_0x52698d),_0x16678b[_0x6c53ab(0x2b7)](_0x322094);for(const _0x21b14e of _0x16678b){console[_0x6c53ab(0x1cd)](formatJourneyItem(_0x21b14e,'\x20\x20',_0x1291a4(_0x21b14e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x25d);[a27_0x36855a(0x24b)]=a27_0x36855a(0x202);async['execute'](_0x2897aa){const _0x2e15e5=a27_0x36855a,{options:_0x1ed0e7,args:_0x5a6b56,tdx:_0x3a6be2}=_0x2897aa,_0x208ba4=_0x5a6b56[0x0];if(!_0x208ba4)return console[_0x2e15e5(0x1df)](_0x2e15e5(0x26a)),console[_0x2e15e5(0x1df)](_0x2e15e5(0x29f)),console[_0x2e15e5(0x1df)]('Options:'),console[_0x2e15e5(0x1df)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x1ed0e7[_0x2e15e5(0x245)]&&console[_0x2e15e5(0x1df)](_0x2e15e5(0x267)+_0x208ba4);const {journeyId:_0x1d6436,parentSegmentId:_0x443574}=await resolveJourneyIdFromInput(_0x208ba4,_0x1ed0e7,_0x3a6be2);if(_0x1ed0e7[_0x2e15e5(0x293)]){const _0x4ab1df=getConsoleNextUrl(_0x1ed0e7[_0x2e15e5(0x2ba)],'/app/ps/'+_0x443574+_0x2e15e5(0x2a0)+_0x1d6436+_0x2e15e5(0x1e2));return console[_0x2e15e5(0x1df)](a27_0x1988d7[_0x2e15e5(0x2b5)]('✔')+_0x2e15e5(0x2a3)+a27_0x1988d7['cyan'](_0x4ab1df)),openBrowser(_0x4ab1df),0x0;}const _0x291d33=await withSpinner(_0x2e15e5(0x2b2),()=>_0x3a6be2[_0x2e15e5(0x23d)][_0x2e15e5(0x2ae)](_0x1d6436),{'verbose':_0x1ed0e7[_0x2e15e5(0x245)]}),_0x31b899=_0x291d33[_0x2e15e5(0x1c0)],_0x2ccfe8=_0x1ed0e7[_0x2e15e5(0x239)];let _0xebfccb;if(_0x2ccfe8)try{const _0x210009=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x3a6be2['journey']['getStatistics'](_0x1d6436),{'verbose':_0x1ed0e7[_0x2e15e5(0x245)]});_0xebfccb=_0x210009[_0x2e15e5(0x1c0)];}catch{_0x1ed0e7[_0x2e15e5(0x245)]&&console[_0x2e15e5(0x1df)](_0x2e15e5(0x23f));}const _0x36d6a5=getConsoleNextUrl(_0x1ed0e7[_0x2e15e5(0x2ba)],_0x2e15e5(0x23a)+_0x443574+_0x2e15e5(0x2a0)+_0x1d6436+'/j/da/je'),_0x25489f={'id':_0x31b899['id'],'name':_0x31b899['attributes'][_0x2e15e5(0x1c5)],'description':_0x31b899[_0x2e15e5(0x278)][_0x2e15e5(0x24b)],'state':_0x31b899[_0x2e15e5(0x278)][_0x2e15e5(0x233)],'paused':_0x31b899[_0x2e15e5(0x278)][_0x2e15e5(0x231)],'reentry_mode':_0x31b899[_0x2e15e5(0x278)]['reentryMode'],'stages':_0x31b899['attributes']['journeyStages']?.['length']||0x0,..._0x31b899[_0x2e15e5(0x278)][_0x2e15e5(0x269)]&&{'goal':_0x31b899[_0x2e15e5(0x278)][_0x2e15e5(0x269)][_0x2e15e5(0x1c5)]},..._0xebfccb&&{'statistics':{'size':_0xebfccb['size'],'entered':_0xebfccb[_0x2e15e5(0x221)],'goal_achieved':_0xebfccb[_0x2e15e5(0x2a4)],'completion_rate':_0xebfccb['completionRate'],'exit_or_jump':_0xebfccb['exitOrJumpSize'],'exit_or_jump_rate':_0xebfccb[_0x2e15e5(0x238)],'stages':_0xebfccb[_0x2e15e5(0x257)]}},'url':_0x36d6a5};return await handleSingleObjectOutput(_0x25489f,_0x1ed0e7),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x36855a(0x285);['description']=a27_0x36855a(0x1ff);async[a27_0x36855a(0x258)](_0x37d889){const _0x4f4510=a27_0x36855a,{options:_0x411bc8,args:_0xb55df,tdx:_0x5b533b}=_0x37d889,_0x58e772=_0xb55df[0x0];if(!requireNameOrPath(_0x58e772))return 0x1;_0x411bc8['verbose']&&console[_0x4f4510(0x1df)](_0x4f4510(0x267)+_0x58e772);const _0x18b902=_0x411bc8,_0x28bca8=_0x18b902[_0x4f4510(0x277)],_0x1563f9=_0x18b902['to'],_0x2bef90=_0x18b902[_0x4f4510(0x216)],_0x22b716=_0x18b902[_0x4f4510(0x1ef)];_0x2bef90&&!_0x28bca8&&!_0x1563f9&&console['error'](_0x4f4510(0x2b6));const _0xe1625b=_0x2bef90?withJsonFormat(_0x411bc8):_0x411bc8,{journeyId:_0x59afeb,journeyName:_0x573da6}=await resolveJourneyIdFromInput(_0x58e772,_0xe1625b,_0x5b533b),_0x3a3bbc=_0x28bca8||_0x1563f9?{'from':_0x28bca8,'to':_0x1563f9}:undefined,_0x16c5f9=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x4f4510(0x1d2)]([_0x5b533b[_0x4f4510(0x23d)][_0x4f4510(0x2ae)](_0x59afeb),_0x5b533b['journey'][_0x4f4510(0x2b9)](_0x59afeb,_0x3a3bbc)]),{'verbose':_0xe1625b['verbose']}),[_0x3451d0,_0x1f14d5]=_0x16c5f9[_0x4f4510(0x1c0)];if(!_0x1f14d5||_0x1f14d5[_0x4f4510(0x1f3)]===null)return console[_0x4f4510(0x1df)](_0x4f4510(0x262)+_0x573da6),console[_0x4f4510(0x1df)](_0x4f4510(0x27e)),0x0;const _0x4f1e29=buildStageNameMap(_0x3451d0),_0x12973d=!!(_0x3a3bbc&&_0x1f14d5[_0x4f4510(0x229)]?.['length']),_0x5a93ba={'stageNameMap':_0x4f1e29,'hasPeriod':_0x12973d,'includeHistory':!!_0x2bef90};if(_0x22b716&&_0x1f14d5[_0x4f4510(0x257)]){const _0x3253b8=_0x1f14d5[_0x4f4510(0x257)][_0x4f4510(0x23e)](_0x102d59=>{const _0x42bc54=_0x4f4510,_0x239275=_0x4f1e29[_0x42bc54(0x25b)](_0x102d59['id'])??'';return _0x239275[_0x42bc54(0x1fb)]()===_0x22b716[_0x42bc54(0x1fb)]();});if(_0x3253b8)return await handleSingleObjectOutput(formatStageStats(_0x3253b8,_0x5a93ba),_0xe1625b),0x0;const _0x373786=_0x1f14d5['stages'][_0x4f4510(0x24d)](_0x5a6454=>_0x4f1e29[_0x4f4510(0x25b)](_0x5a6454['id'])??_0x5a6454['id']);return console[_0x4f4510(0x1df)](_0x4f4510(0x213)+_0x22b716+_0x4f4510(0x232)),console[_0x4f4510(0x1df)](_0x4f4510(0x208)+_0x373786[_0x4f4510(0x1f8)](',\x20')),0x1;}const _0x3be3be=_0x1f14d5[_0x4f4510(0x257)]?.[_0x4f4510(0x24d)](_0x4ed41d=>formatStageStats(_0x4ed41d,_0x5a93ba)),_0x36d4b0=assembleJourneyStats(_0x1f14d5,{'from':_0x28bca8,'to':_0x1563f9,'includeHistory':_0x2bef90});return await this[_0x4f4510(0x263)](_0x36d4b0,_0x3be3be??[],_0xe1625b),0x0;}async[a27_0x36855a(0x263)](_0x465566,_0x3c2814,_0x346832){const _0x325caa=a27_0x36855a,_0x102e37=_0x346832['format']==='json'||_0x346832[_0x325caa(0x250)]===_0x325caa(0x21d)||_0x346832[_0x325caa(0x1f7)]||_0x346832[_0x325caa(0x21d)];if(_0x102e37){_0x465566[_0x325caa(0x257)]=_0x3c2814,await handleSingleObjectOutput(_0x465566,_0x346832);return;}await handleSingleObjectOutput(_0x465566,_0x346832);for(const _0x5e55a8 of _0x3c2814){console[_0x325caa(0x1cd)](''),console['log'](String(a27_0x1988d7[_0x325caa(0x21a)][_0x325caa(0x224)]('['+_0x5e55a8[_0x325caa(0x1c5)]+']'))+a27_0x1988d7[_0x325caa(0x249)]('\x20'+_0x5e55a8['id']));const {id:_0x564f92,name:_0x596b13,..._0x468a64}=_0x5e55a8;await handleSingleObjectOutput(_0x468a64,_0x346832);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x36855a(0x1c5)]='journey:traffic';[a27_0x36855a(0x24b)]=a27_0x36855a(0x1b9);async[a27_0x36855a(0x258)](_0x4dbf9d){const _0x28eb6e=a27_0x36855a,{options:_0x2a52e6,args:_0x182b40,tdx:_0x18aee5}=_0x4dbf9d,_0x11aff0=_0x182b40[0x0];if(!requireNameOrPath(_0x11aff0))return 0x1;_0x2a52e6[_0x28eb6e(0x245)]&&console['error'](_0x28eb6e(0x267)+_0x11aff0);const _0x57b753=_0x2a52e6,_0x1d3162=_0x57b753['type'],_0x4d631a=_0x57b753[_0x28eb6e(0x277)],_0x295e1f=_0x57b753['to'],_0xcf83e7=_0x57b753['limit'];if(_0x1d3162&&_0x1d3162!==_0x28eb6e(0x2b3)&&_0x1d3162!=='activation')return console['error']('Error:\x20Invalid\x20--type\x20\x22'+_0x1d3162+_0x28eb6e(0x1b8)),0x1;const _0xcf1d69=withJsonFormat(_0x2a52e6),{journeyId:_0x437dc9,journeyName:_0x4e7b2e}=await resolveJourneyIdFromInput(_0x11aff0,_0xcf1d69,_0x18aee5),_0x2119b8={'type':_0x1d3162,'from':_0x4d631a,'to':_0x295e1f,'limit':_0xcf83e7},_0x40e1fe=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x18aee5[_0x28eb6e(0x23d)][_0x28eb6e(0x244)](_0x437dc9,_0x2119b8),{'verbose':_0xcf1d69[_0x28eb6e(0x245)]}),_0x46d63c=_0x40e1fe[_0x28eb6e(0x1c0)],_0x153998=_0x46d63c[_0x28eb6e(0x2b3)]&&(_0x46d63c[_0x28eb6e(0x2b3)][_0x28eb6e(0x28d)]['length']>0x0||_0x46d63c['conversion'][_0x28eb6e(0x284)][_0x28eb6e(0x218)]>0x0),_0x522a86=_0x46d63c[_0x28eb6e(0x24f)]&&_0x46d63c[_0x28eb6e(0x24f)][_0x28eb6e(0x218)]>0x0;if(!_0x153998&&!_0x522a86)return console[_0x28eb6e(0x1df)](_0x28eb6e(0x247)+_0x4e7b2e),console['error'](_0x28eb6e(0x20f)),_0x4d631a&&_0x295e1f&&console[_0x28eb6e(0x1df)](_0x28eb6e(0x206)),0x0;return await handleSingleObjectOutput(_0x46d63c,_0xcf1d69),0x0;}}function formatStageStats(_0x2435d2,_0xbe71cf){const _0x2bfae4=a27_0x36855a,_0x25bd80=_0xbe71cf[_0x2bfae4(0x26d)]&&_0x2435d2[_0x2bfae4(0x229)]?.['length']?aggregateStageHistory(_0x2435d2[_0x2bfae4(0x229)]):{'size':_0x2435d2[_0x2bfae4(0x22d)],'entered':_0x2435d2[_0x2bfae4(0x221)],'milestone':_0x2435d2[_0x2bfae4(0x27c)],'milestone_rate':_0x2435d2['completeMilestoneRate'],'exit_or_jump':_0x2435d2[_0x2bfae4(0x276)],'exit_or_jump_rate':_0x2435d2[_0x2bfae4(0x238)]},_0x13a059={'id':_0x2435d2['id'],'name':_0xbe71cf['stageNameMap'][_0x2bfae4(0x25b)](_0x2435d2['id'])??_0x2435d2['id'],..._0x25bd80};return _0xbe71cf[_0x2bfae4(0x26d)]&&_0xbe71cf[_0x2bfae4(0x216)]&&_0x2435d2[_0x2bfae4(0x229)]&&(_0x13a059[_0x2bfae4(0x229)]=_0x2435d2[_0x2bfae4(0x229)]),_0x13a059;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x36855a(0x248);[a27_0x36855a(0x24b)]=a27_0x36855a(0x1fe);async[a27_0x36855a(0x258)](_0x5d0b27){const _0xf6268f=a27_0x36855a,{options:_0x351b07,args:_0x4e1880,tdx:_0x18d329}=_0x5d0b27,_0x5cf2b1=_0x4e1880[0x0];if(!requireNameOrPath(_0x5cf2b1))return 0x1;_0x351b07[_0xf6268f(0x245)]&&console[_0xf6268f(0x1df)](_0xf6268f(0x267)+_0x5cf2b1);const {journeyId:_0x9ac15,journeyName:_0x514705}=await resolveJourneyIdFromInput(_0x5cf2b1,_0x351b07,_0x18d329);if(!_0x351b07[_0xf6268f(0x264)]){const _0x4747dc=await confirm(_0xf6268f(0x286)+_0x514705+'\x22?');if(!_0x4747dc)return console[_0xf6268f(0x1df)](_0xf6268f(0x226)),0x0;}const _0xdf815e=await withSpinner(_0xf6268f(0x1e9),()=>_0x18d329['journey'][_0xf6268f(0x236)](_0x9ac15),{'verbose':_0x351b07['verbose']}),_0x37008d=_0xdf815e[_0xf6268f(0x1c0)];return console[_0xf6268f(0x1df)](_0xf6268f(0x1ca)+_0x37008d['attributes'][_0xf6268f(0x1c5)]+_0xf6268f(0x26c)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x36855a(0x1c5)]='journey:resume';[a27_0x36855a(0x24b)]=a27_0x36855a(0x1db);async['execute'](_0x2e2e02){const _0x14a3b4=a27_0x36855a,{options:_0x45a29e,args:_0x8b42ea,tdx:_0x31393e}=_0x2e2e02,_0x324a23=_0x8b42ea[0x0];if(!requireNameOrPath(_0x324a23))return 0x1;_0x45a29e[_0x14a3b4(0x245)]&&console[_0x14a3b4(0x1df)](_0x14a3b4(0x267)+_0x324a23);const {journeyId:_0x327343,journeyName:_0x70feec}=await resolveJourneyIdFromInput(_0x324a23,_0x45a29e,_0x31393e);if(!_0x45a29e[_0x14a3b4(0x264)]){const _0x1ebbe1=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x70feec+'\x22?');if(!_0x1ebbe1)return console['error']('Cancelled'),0x0;}const _0x11799d=await withSpinner(_0x14a3b4(0x26f),()=>_0x31393e[_0x14a3b4(0x23d)][_0x14a3b4(0x1ec)](_0x327343),{'verbose':_0x45a29e['verbose']}),_0x4c5d4f=_0x11799d['data'];return console[_0x14a3b4(0x1df)](_0x14a3b4(0x1ca)+_0x4c5d4f[_0x14a3b4(0x278)][_0x14a3b4(0x1c5)]+_0x14a3b4(0x256)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x1c1);[a27_0x36855a(0x24b)]=a27_0x36855a(0x295);async['execute'](_0x3efb6b){const _0x2a1edd=a27_0x36855a,{options:_0x19086a,args:_0x376694,tdx:_0x5acc01}=_0x3efb6b,_0x38e7b0=_0x19086a,_0x2fc548=_0x376694[0x0],_0x5a357=_0x2fc548&&isYamlFilePath(_0x2fc548),_0x570006=await resolveTarget({'arg':_0x5a357?_0x2fc548:undefined,'contextParent':_0x19086a[_0x2a1edd(0x1f9)],'cwd':process[_0x2a1edd(0x1cb)]()});if(!isSuccessfulResolution(_0x570006))return _0x570006['errorCode']===_0x2a1edd(0x268)?(console[_0x2a1edd(0x1df)](a27_0x1988d7[_0x2a1edd(0x1fd)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2a1edd(0x1df)]('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[_0x2a1edd(0x1df)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x2a1edd(0x1df)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x2a1edd(0x1df)](_0x2a1edd(0x29a))):(console['error'](a27_0x1988d7[_0x2a1edd(0x1f1)](_0x2a1edd(0x20e)+_0x570006['message']+'\x0a')),_0x570006[_0x2a1edd(0x1f4)]&&console['error'](a27_0x1988d7[_0x2a1edd(0x21a)](_0x570006[_0x2a1edd(0x1f4)]))),0x1;let _0x1fc4ed=_0x5a357?undefined:_0x2fc548,_0x3a6cb5,_0x5ecad5;_0x570006['type']===_0x2a1edd(0x203)&&(_0x1fc4ed=_0x570006['resourceName'],_0x3a6cb5=_0x570006[_0x2a1edd(0x228)],_0x5ecad5=_0x570006['folderPath']);const _0x37e519=_0x570006[_0x2a1edd(0x25a)],_0x10515f=_0x570006['targetDir'];_0x38e7b0[_0x2a1edd(0x245)]&&(console['error'](_0x2a1edd(0x28b)+_0x37e519),console['error']('Target\x20directory:\x20'+_0x10515f),_0x1fc4ed&&console[_0x2a1edd(0x1df)]('Journey\x20name:\x20'+_0x1fc4ed),_0x3a6cb5&&console[_0x2a1edd(0x1df)](_0x2a1edd(0x2a7)+_0x3a6cb5),_0x5ecad5&&console['error'](_0x2a1edd(0x292)+_0x5ecad5));const _0x329e41=await withSpinner(_0x2a1edd(0x201),()=>_0x5acc01[_0x2a1edd(0x299)][_0x2a1edd(0x279)](_0x37e519),{'verbose':_0x19086a[_0x2a1edd(0x245)]}),_0x780f8=_0x329e41[_0x2a1edd(0x1c0)],{journeys:_0x32d1e1,folders:_0x179c87}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x191881=_0x2a1edd,[_0x345385,_0x3696fe]=await Promise[_0x191881(0x1d2)]([_0x5acc01['journey'][_0x191881(0x282)](_0x780f8,undefined,{'includeAllVersions':!![]}),_0x5acc01[_0x191881(0x299)][_0x191881(0x1da)](_0x780f8)]);return{'journeys':_0x345385,'folders':_0x3696fe};},{'verbose':_0x19086a[_0x2a1edd(0x245)]})['then'](_0x247794=>_0x247794[_0x2a1edd(0x1c0)]);let _0x1b5b22=_0x32d1e1;const _0x27c04d=buildFolderIdToPathMap(_0x179c87);if(_0x1fc4ed){const _0x9cec4a=_0x1b5b22[_0x2a1edd(0x1d4)](_0x5bc1e0=>_0x5bc1e0['journeyBundleName']['toLowerCase']()===_0x1fc4ed[_0x2a1edd(0x1fb)]());if(_0x9cec4a[_0x2a1edd(0x218)]===0x0)return console[_0x2a1edd(0x1df)]('Error:\x20Journey\x20not\x20found:\x20'+_0x1fc4ed),console[_0x2a1edd(0x1df)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x1b5b22=_0x9cec4a;}if(_0x5ecad5!==undefined){const _0x3d5e2d=_0x1b5b22[_0x2a1edd(0x1d4)](_0x5a7aca=>{const _0x45febc=_0x2a1edd,_0x1a5a5d=_0x5a7aca[_0x45febc(0x254)]?_0x27c04d['get'](_0x5a7aca['folderId'])||'':'';return _0x1a5a5d===_0x5ecad5;});if(_0x3d5e2d[_0x2a1edd(0x218)]===0x0&&_0x1b5b22['length']>0x0){console[_0x2a1edd(0x1df)]('Error:\x20Journey\x20\x27'+_0x1fc4ed+'\x27\x20not\x20found\x20in\x20'+(_0x5ecad5||_0x2a1edd(0x235))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x1c6f41 of _0x1b5b22){const _0x3dadc3=_0x1c6f41[_0x2a1edd(0x254)]?_0x27c04d['get'](_0x1c6f41['folderId'])||'':'';console['error'](_0x2a1edd(0x230)+(_0x3dadc3||_0x2a1edd(0x212))+'/'+_0x1c6f41['journeyBundleName']);}return 0x1;}_0x1b5b22=_0x3d5e2d;}if(_0x1b5b22[_0x2a1edd(0x218)]===0x0)return console[_0x2a1edd(0x1df)](_0x2a1edd(0x1f6)),0x0;const _0x4261a7=new Map();for(const _0x3bbf74 of _0x1b5b22){const _0x4db4a3=_0x3bbf74[_0x2a1edd(0x1bc)];!_0x4261a7[_0x2a1edd(0x265)](_0x4db4a3)&&_0x4261a7[_0x2a1edd(0x266)](_0x4db4a3,[]),_0x4261a7['get'](_0x4db4a3)[_0x2a1edd(0x21c)](_0x3bbf74);}for(const _0x4181b0 of _0x4261a7[_0x2a1edd(0x2a5)]()){_0x4181b0[_0x2a1edd(0x2b7)]((_0x25d57e,_0x1a6d3e)=>(_0x25d57e[_0x2a1edd(0x1bb)]||0x0)-(_0x1a6d3e[_0x2a1edd(0x1bb)]||0x0));}const _0x506c47=[],{idToEmailMap:_0x4be529,connectionIdToNameMap:_0x201f25}=await withSpinner(_0x2a1edd(0x1c6),async()=>{const _0x20be18=_0x2a1edd,[_0x3462f5,_0x54e5ad]=await Promise[_0x20be18(0x1d2)]([_0x5acc01[_0x20be18(0x287)][_0x20be18(0x23b)](),_0x5acc01[_0x20be18(0x27f)][_0x20be18(0x1bf)]()]);return{'idToEmailMap':_0x3462f5,'connectionIdToNameMap':_0x54e5ad};},{'verbose':_0x19086a[_0x2a1edd(0x245)]})['then'](_0x3aba73=>_0x3aba73[_0x2a1edd(0x1c0)]);for(const _0x3a572b of _0x4261a7['values']()){const _0xce2631=_0x3a572b[0x0][_0x2a1edd(0x1cf)],_0x3c1d76=_0x3a572b[0x0]['folderId'],_0x2578e8=_0x3c1d76?_0x27c04d['get'](_0x3c1d76)||'':'',_0x4d4634=_0x2578e8?a27_0x17c755[_0x2a1edd(0x1f8)](_0x10515f,_0x2578e8):_0x10515f,_0x1b55e2=_0x3a6cb5||a27_0x17c755[_0x2a1edd(0x1f8)](_0x4d4634,sanitizeFileName(_0xce2631)+_0x2a1edd(0x1c2));let _0x52e4b1,_0x26f89d;if(existsSync(_0x1b55e2))try{const _0x472bf9=readFileSync(_0x1b55e2,_0x2a1edd(0x1c4)),_0x179e93=parseYamlString(_0x472bf9);_0x26f89d=_0x179e93,_0x52e4b1=buildRuleToNameMapping(_0x179e93),_0x38e7b0[_0x2a1edd(0x245)]&&_0x52e4b1[_0x2a1edd(0x22d)]>0x0&&console[_0x2a1edd(0x1df)](_0x2a1edd(0x220)+_0x52e4b1['size']+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0xce2631);}catch(_0xb1c482){_0x38e7b0[_0x2a1edd(0x245)]&&console[_0x2a1edd(0x1df)](_0x2a1edd(0x1be)+_0xb1c482[_0x2a1edd(0x298)]);}const _0x4ee353=[],_0x395d58=new Set(),_0x2fa0fb=new Map(),_0x1fe30e=new Map(),_0x4324c8=new Set(),_0x1e474c=new Map(),_0x2e1883=new Map(),_0xbab6ab=createJumpTargetCache();await withProgressSpinner(_0x2a1edd(0x283)+_0xce2631+_0x2a1edd(0x22c),async _0x127b81=>{const _0x369d48=_0x2a1edd;for(const _0x5138c3 of _0x3a572b){const _0x3575a2=_0x3a572b[_0x369d48(0x218)]>0x1?_0x5138c3[_0x369d48(0x1cf)]+'\x20v'+(_0x5138c3[_0x369d48(0x1bb)]||0x1):_0x5138c3['journeyBundleName'];_0x127b81[_0x369d48(0x2a8)]('Fetching\x20'+_0x3575a2);const _0x2f7002=await _0x5acc01[_0x369d48(0x23d)][_0x369d48(0x2ae)](_0x5138c3['id']),_0x13a1bb=_0x2f7002[_0x369d48(0x278)]?.[_0x369d48(0x28f)],_0x5cfe95={'resolveSegment':async _0x3d899f=>{const _0x24a193=_0x369d48;if(!_0x13a1bb)return{'name':_0x3d899f,'isJourneyLocal':![]};const _0x3cd8d3=_0x2fa0fb[_0x24a193(0x25b)](_0x3d899f);if(_0x3cd8d3)return _0x3cd8d3;try{const _0x590183=await _0x5acc01['segment'][_0x24a193(0x243)](_0x13a1bb,_0x3d899f),_0x2ef338=_0x590183[_0x24a193(0x25f)]===SEGMENT_KIND_JOURNEY;let _0x57b210,_0x252e0e=_0x590183[_0x24a193(0x1c5)];if(_0x2ef338&&_0x590183['rule']){const _0x103a62=await segmentResponseToDef(_0x590183,{'resolveSegmentName':async _0x1fb22b=>{const _0x11a0c7=_0x24a193,_0x11030a=_0x2fa0fb[_0x11a0c7(0x25b)](_0x1fb22b);if(_0x11030a)return _0x11030a[_0x11a0c7(0x1c5)];const _0x29c0df=await _0x5cfe95[_0x11a0c7(0x29c)](_0x1fb22b);return _0x29c0df[_0x11a0c7(0x1c5)];}}),_0x55fced=_0x103a62['rule'];_0x57b210={'description':_0x590183[_0x24a193(0x24b)],'rule':_0x55fced};const _0xc58f9=serializeRule(_0x55fced),_0x55f2af=_0x1fe30e[_0x24a193(0x25b)](_0xc58f9);if(_0x55f2af)_0x252e0e=_0x55f2af,_0x57b210=undefined,_0x38e7b0['verbose']&&console[_0x24a193(0x1df)](_0x24a193(0x225)+_0x590183['name']+_0x24a193(0x1cc)+_0x55f2af);else{let _0x2d519f=![];if(_0x52e4b1){const _0x4c214d=_0x52e4b1[_0x24a193(0x25b)](_0xc58f9);if(_0x4c214d){const _0xb323d5=_0x4c214d[_0x24a193(0x23e)](_0x2edb61=>!_0x395d58[_0x24a193(0x265)](_0x2edb61));_0xb323d5&&(_0x252e0e=_0xb323d5,_0x395d58[_0x24a193(0x1de)](_0xb323d5),_0x1fe30e['set'](_0xc58f9,_0xb323d5),_0x2d519f=!![],_0x38e7b0[_0x24a193(0x245)]&&console[_0x24a193(0x1df)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0xb323d5+_0x24a193(0x25c)));}}if(!_0x2d519f){const _0x16f012=generateJourneyLocalName(_0x590183[_0x24a193(0x1c5)]);_0x16f012&&(_0x252e0e=_0x16f012);let _0x3f91c0=_0x252e0e,_0x535c6d=0x2;while(_0x395d58['has'](_0x3f91c0)){_0x3f91c0=_0x252e0e+'_'+_0x535c6d,_0x535c6d++;}_0x395d58[_0x24a193(0x1de)](_0x3f91c0),_0x1fe30e[_0x24a193(0x266)](_0xc58f9,_0x3f91c0),_0x252e0e=_0x3f91c0;}}}const _0x5320f7={'name':_0x252e0e,'isJourneyLocal':_0x2ef338,'definition':_0x57b210};return _0x2fa0fb[_0x24a193(0x266)](_0x3d899f,_0x5320f7),_0x5320f7;}catch(_0x31e068){return _0x19086a[_0x24a193(0x245)]&&console['error'](_0x24a193(0x246)+_0x3d899f+':\x20'+_0x31e068[_0x24a193(0x298)]),{'name':_0x3d899f,'isJourneyLocal':![]};}},'resolveActivation':async _0x321179=>{const _0xb68904=_0x369d48,_0x10f851=_0x1e474c[_0xb68904(0x25b)](_0x321179);if(_0x10f851)return _0x10f851;try{const _0x2d1885=await _0x5acc01[_0xb68904(0x23d)][_0xb68904(0x2a6)](_0x5138c3['id'],_0x321179),_0x54cd5d=journeyActivationStepToYaml(_0x2d1885,_0x4be529,_0x201f25),_0xd99f6d=JSON[_0xb68904(0x1d7)]({'name':_0x54cd5d['name'],'connection':_0x54cd5d[_0xb68904(0x27f)],'connector_config':_0x54cd5d['connector_config']}),_0x9fb796=_0x2e1883[_0xb68904(0x25b)](_0xd99f6d);if(_0x9fb796){const _0x55ff45={'name':_0x9fb796,'isJourneyLocal':!![],'definition':_0x54cd5d};return _0x1e474c[_0xb68904(0x266)](_0x321179,_0x55ff45),_0x55ff45;}const _0x2dda48=_0x2d1885['attributes'][_0xb68904(0x290)][_0xb68904(0x1c5)]||_0x321179,_0x55dad3=sanitizeYamlKey(_0x2dda48)||'activation_'+_0x321179;let _0x3295cd=_0x55dad3,_0x3139f1=0x2;while(_0x4324c8[_0xb68904(0x265)](_0x3295cd)){_0x3295cd=_0x55dad3+'_'+_0x3139f1,_0x3139f1++;}_0x4324c8[_0xb68904(0x1de)](_0x3295cd),_0x2e1883[_0xb68904(0x266)](_0xd99f6d,_0x3295cd);const _0x1f0fd0={'name':_0x3295cd,'isJourneyLocal':!![],'definition':_0x54cd5d};return _0x1e474c[_0xb68904(0x266)](_0x321179,_0x1f0fd0),_0x1f0fd0;}catch(_0x3fca07){return _0x19086a[_0xb68904(0x245)]&&console[_0xb68904(0x1df)](_0xb68904(0x20a)+_0x321179+':\x20'+_0x3fca07[_0xb68904(0x298)]),{'name':_0x321179,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x4568b5,_0x5c9c52)=>{const _0x1e379d=_0x369d48;return resolveJumpTarget(_0x4568b5,_0x5c9c52,_0xbab6ab,_0x56f8fa=>_0x5acc01[_0x1e379d(0x23d)]['getJourney'](_0x56f8fa));}},_0x38124b=await journeyResponseToDef(_0x2f7002,_0x5cfe95);_0x4ee353[_0x369d48(0x21c)]({'item':_0x5138c3,'yaml':_0x38124b});}},{'verbose':_0x19086a[_0x2a1edd(0x245)]});const _0xec1eae=await _0x5acc01[_0x2a1edd(0x23d)][_0x2a1edd(0x217)](_0x3a572b[0x0]['journeyBundleId']),_0x35e68b=buildMergedJourneyDef(_0x4ee353,_0x52e4b1,_0xec1eae),_0x3c2b62=normalizeJourneyDef(_0x35e68b,_0x26f89d),_0x33d32d=toYamlString(_0x3c2b62),_0x105e75=_0x3a6cb5||a27_0x17c755['join'](_0x4d4634,sanitizeFileName(_0xce2631)+_0x2a1edd(0x1c2));!_0x3a6cb5&&_0x2578e8&&!existsSync(_0x4d4634)&&mkdirSync(_0x4d4634,{'recursive':!![]});const _0x49dcb7=a27_0x17c755[_0x2a1edd(0x1d5)](process[_0x2a1edd(0x1cb)](),_0x105e75);if(existsSync(_0x105e75)){const _0x5898ba=readFileSync(_0x105e75,'utf-8'),_0x1eb172=generateDiff(_0x5898ba,_0x33d32d),_0x162940=hasChanges(_0x1eb172);_0x506c47[_0x2a1edd(0x21c)]({'relativePath':_0x49dcb7,'absolutePath':_0x105e75,'content':_0x33d32d,'isNew':![],'hasChanges':_0x162940,'diff':_0x162940?formatDiffWithColors(_0x1eb172):undefined});}else _0x506c47[_0x2a1edd(0x21c)]({'relativePath':_0x49dcb7,'absolutePath':_0x105e75,'content':_0x33d32d,'isNew':!![],'hasChanges':![]});}const _0x5e5ad1=_0x506c47[_0x2a1edd(0x1d4)](_0x4cecbc=>_0x4cecbc[_0x2a1edd(0x289)]),_0x2639a1=_0x506c47[_0x2a1edd(0x1d4)](_0x1726a1=>!_0x1726a1[_0x2a1edd(0x289)]&&_0x1726a1[_0x2a1edd(0x1dc)]),_0x217302=_0x506c47[_0x2a1edd(0x1d4)](_0x3286e0=>!_0x3286e0[_0x2a1edd(0x289)]&&!_0x3286e0[_0x2a1edd(0x1dc)]),_0x1776be=_0x1b5b22['length'],_0x2911ac=_0x4261a7[_0x2a1edd(0x22d)],_0x140786=_0x1776be>_0x2911ac?'\x20('+_0x1776be+_0x2a1edd(0x227):'';console[_0x2a1edd(0x1df)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a27_0x1988d7[_0x2a1edd(0x21a)](_0x2911ac+'\x20journeys')+a27_0x1988d7[_0x2a1edd(0x249)](_0x140786)),console['error']('\x20\x20'+a27_0x1988d7[_0x2a1edd(0x2b5)]('+\x20'+_0x5e5ad1[_0x2a1edd(0x218)]+_0x2a1edd(0x234))),console['error']('\x20\x20'+a27_0x1988d7[_0x2a1edd(0x1fd)]('~\x20'+_0x2639a1[_0x2a1edd(0x218)]+_0x2a1edd(0x20d))),console[_0x2a1edd(0x1df)]('\x20\x20'+a27_0x1988d7[_0x2a1edd(0x249)]('=\x20'+_0x217302[_0x2a1edd(0x218)]+'\x20unchanged\x20files')),console[_0x2a1edd(0x1df)](_0x2a1edd(0x222)+a27_0x1988d7['cyan'](_0x10515f)+'\x0a');if(_0x2639a1['length']>0x0)for(const _0x3c9f2c of _0x2639a1){console[_0x2a1edd(0x1df)](_0x2a1edd(0x2aa)+_0x3c9f2c[_0x2a1edd(0x2b8)]+'\x27:'),console['error']('─'[_0x2a1edd(0x280)](0x3c)),console['error'](_0x3c9f2c['diff']),console[_0x2a1edd(0x1df)]('─'[_0x2a1edd(0x280)](0x3c));}if(_0x38e7b0[_0x2a1edd(0x210)])return console[_0x2a1edd(0x1df)](a27_0x1988d7['yellow'](_0x2a1edd(0x29e))),0x0;if(_0x5e5ad1['length']===0x0&&_0x2639a1['length']===0x0)return console[_0x2a1edd(0x1df)](a27_0x1988d7['green'](_0x2a1edd(0x223))),saveSessionContext({'parent_segment':_0x37e519},_0x38e7b0['session']),console[_0x2a1edd(0x1df)](a27_0x1988d7[_0x2a1edd(0x2b5)](_0x2a1edd(0x1bd)+a27_0x1988d7[_0x2a1edd(0x249)](_0x2a1edd(0x205))+'\x20=\x20'+a27_0x1988d7['cyan'](_0x37e519))),0x0;if(!_0x38e7b0[_0x2a1edd(0x264)]&&(_0x5e5ad1['length']>0x0||_0x2639a1['length']>0x0)){if(!isInteractive())return console[_0x2a1edd(0x1df)](a27_0x1988d7[_0x2a1edd(0x1f1)](_0x2a1edd(0x24c)),_0x2a1edd(0x1e3)),console[_0x2a1edd(0x1df)](a27_0x1988d7['dim'](_0x2a1edd(0x272))),0x1;const _0x1296c5=await confirmKey(_0x2a1edd(0x209)+(_0x5e5ad1[_0x2a1edd(0x218)]+_0x2639a1[_0x2a1edd(0x218)])+_0x2a1edd(0x1c8));if(!_0x1296c5)return console[_0x2a1edd(0x1df)](a27_0x1988d7['yellow'](_0x2a1edd(0x252)),_0x2a1edd(0x29d)),0x1;}!existsSync(_0x10515f)&&mkdirSync(_0x10515f,{'recursive':!![]});const _0x2e0ee9=a27_0x17c755[_0x2a1edd(0x1f8)](_0x10515f,_0x2a1edd(0x24a));writeFileSync(_0x2e0ee9,createTdxConfigContent(_0x37e519),_0x2a1edd(0x1c4));for(const _0xee4639 of _0x506c47){(_0xee4639[_0x2a1edd(0x289)]||_0xee4639[_0x2a1edd(0x1dc)])&&writeFileSync(_0xee4639[_0x2a1edd(0x1f5)],_0xee4639['content'],_0x2a1edd(0x1c4));}return console[_0x2a1edd(0x1df)](a27_0x1988d7[_0x2a1edd(0x2b5)]('✔\x20Pulled\x20'+(_0x5e5ad1['length']+_0x2639a1['length'])+_0x2a1edd(0x27a)+_0x10515f)),saveSessionContext({'parent_segment':_0x37e519},_0x38e7b0['session']),console[_0x2a1edd(0x1df)](a27_0x1988d7[_0x2a1edd(0x2b5)](_0x2a1edd(0x1bd)+a27_0x1988d7[_0x2a1edd(0x249)](_0x2a1edd(0x205))+'\x20=\x20'+a27_0x1988d7[_0x2a1edd(0x21a)](_0x37e519))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x2af);[a27_0x36855a(0x24b)]=a27_0x36855a(0x2bb);async[a27_0x36855a(0x258)](_0x4813d7){const _0x56879b=a27_0x36855a,{options:_0x2fa121,args:_0xbe4d43,tdx:_0x55c9a8}=_0x4813d7,_0x2fd919=_0xbe4d43[0x0];if(!requireNameOrPath(_0x2fd919))return 0x1;_0x2fa121[_0x56879b(0x245)]&&console[_0x56879b(0x1df)](_0x56879b(0x267)+_0x2fd919);const {journeyId:_0x3625a1}=await resolveJourneyIdFromInput(_0x2fd919,_0x2fa121,_0x55c9a8),_0xe12267=await withSpinner(_0x56879b(0x23c),()=>_0x55c9a8[_0x56879b(0x23d)][_0x56879b(0x2a1)](_0x3625a1),{'verbose':_0x2fa121[_0x56879b(0x245)]}),_0x572410=_0xe12267['data'];return console[_0x56879b(0x1cd)](_0x56879b(0x1e8)+_0x572410[_0x56879b(0x1fc)]),console['log'](_0x56879b(0x1e0)+_0x572410['table']),await handleSDKOutput(_0x572410['columns'],_0x2fa121),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x2b4);[a27_0x36855a(0x24b)]=a27_0x36855a(0x271);async[a27_0x36855a(0x258)](_0xbe13ca){const _0x3f500a=a27_0x36855a,{options:_0x132aa,args:_0x45a689,tdx:_0x5bd147}=_0xbe13ca,_0x1ccaf0=_0x45a689[0x0];if(!requireNameOrPath(_0x1ccaf0))return 0x1;_0x132aa[_0x3f500a(0x245)]&&console[_0x3f500a(0x1df)](_0x3f500a(0x267)+_0x1ccaf0);const {journeyId:_0x55e870}=await resolveJourneyIdFromInput(_0x1ccaf0,_0x132aa,_0x5bd147),_0x11fa77=await withSpinner('Listing\x20journey\x20activations...',()=>_0x5bd147['journey'][_0x3f500a(0x21b)](_0x55e870),{'verbose':_0x132aa[_0x3f500a(0x245)]}),_0x36f536=_0x11fa77['data'];return console[_0x3f500a(0x1df)](_0x3f500a(0x220)+_0x36f536['length']+_0x3f500a(0x255)+(_0x36f536[_0x3f500a(0x218)]!==0x1?'s':'')),await handleSDKOutput(_0x36f536,_0x132aa),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x21f);[a27_0x36855a(0x24b)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';['segmentPushCommand']=new SegmentPushCommand();async[a27_0x36855a(0x258)](_0x46495e){const _0x2fd857=a27_0x36855a,_0x59fff7=_0x46495e[_0x2fd857(0x1ea)][0x0];let _0x5b2395;if(_0x59fff7){const _0x2d9d66=await resolveTarget({'arg':_0x59fff7,'contextParent':_0x46495e['options']['parentSegment'],'cwd':process[_0x2fd857(0x1cb)]()});isSuccessfulResolution(_0x2d9d66)&&_0x2d9d66[_0x2fd857(0x1c7)]==='file'&&(_0x5b2395=_0x2d9d66[_0x2fd857(0x228)]);}const _0x2a4782={..._0x46495e,'options':{..._0x46495e[_0x2fd857(0x1b7)],'journeysOnly':!![],..._0x5b2395&&{'singleFilePath':_0x5b2395}}};return this[_0x2fd857(0x2ac)][_0x2fd857(0x258)](_0x2a4782);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x215);[a27_0x36855a(0x24b)]=a27_0x36855a(0x274);async[a27_0x36855a(0x258)](_0x2364f5){const _0x16c802=a27_0x36855a,{options:_0x334338,args:_0x7a83f7,tdx:_0x4750c0}=_0x2364f5,_0x3ed4df=_0x7a83f7[0x0];if(!requireNameOrPath(_0x3ed4df))return 0x1;if(_0x334338['verbose'])console['error'](_0x16c802(0x267)+_0x3ed4df);const {journeyId:_0x79c669}=await resolveJourneyIdFromInput(_0x3ed4df,_0x334338,_0x4750c0),_0x188cac=await withSpinner('Listing\x20journey\x20versions...',()=>_0x4750c0[_0x16c802(0x23d)]['listVersions'](_0x79c669),{'verbose':_0x334338[_0x16c802(0x245)]}),{bundleName:_0x4fb0b7,versions:_0x47a3ca,latestJourneyId:_0x4eed50}=_0x188cac[_0x16c802(0x1c0)];console[_0x16c802(0x1df)](_0x4fb0b7+':\x20'+_0x47a3ca[_0x16c802(0x218)]+_0x16c802(0x27d)+(_0x47a3ca[_0x16c802(0x218)]!==0x1?'s':''));const _0x2c5d2b=_0x47a3ca['map'](_0x523538=>({'version':_0x523538[_0x16c802(0x1bb)],'journey_id':_0x523538[_0x16c802(0x1f3)],'name':_0x523538['name'],'state':_0x523538['state'],'paused':_0x523538[_0x16c802(0x231)],'latest':_0x523538[_0x16c802(0x1f3)]===_0x4eed50,'created_at':_0x523538[_0x16c802(0x1e4)]}));return await handleSDKOutput(_0x2c5d2b,_0x334338),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x36855a(0x1c5)]='journey:version:create';['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async['execute'](_0x1b9ecc){const _0x186013=a27_0x36855a,{options:_0x90c2da,args:_0x5b5f0a,tdx:_0xd7cc1f}=_0x1b9ecc,_0x5886cd=_0x5b5f0a[0x0];if(!requireNameOrPath(_0x5886cd))return 0x1;if(_0x90c2da['verbose'])console[_0x186013(0x1df)](_0x186013(0x267)+_0x5886cd);const {journeyId:_0x310ec8,journeyName:_0x3f2701}=await resolveJourneyIdFromInput(_0x5886cd,_0x90c2da,_0xd7cc1f);if(!_0x90c2da['yes']){const _0x541ebe=await confirm(_0x186013(0x1ce)+_0x3f2701+'\x22?');if(!_0x541ebe)return console[_0x186013(0x1df)]('Cancelled'),0x0;}const _0x2b69e5=await withSpinner(_0x186013(0x297),()=>_0xd7cc1f['journey'][_0x186013(0x291)](_0x310ec8),{'verbose':_0x90c2da[_0x186013(0x245)]}),_0x27c102=_0x2b69e5[_0x186013(0x1c0)];return console[_0x186013(0x1df)](a27_0x1988d7[_0x186013(0x2b5)]('✔')+_0x186013(0x214)+_0x27c102['attributes'][_0x186013(0x1bb)]+'\x20(draft)\x20—\x20\x22'+_0x27c102[_0x186013(0x278)][_0x186013(0x1c5)]+'\x22'),console[_0x186013(0x1df)]('\x20\x20Journey\x20ID:\x20'+_0x27c102['id']),await handleSingleObjectOutput({'id':_0x27c102['id'],'name':_0x27c102['attributes'][_0x186013(0x1c5)],'version':_0x27c102[_0x186013(0x278)][_0x186013(0x1bb)],'state':_0x27c102[_0x186013(0x278)][_0x186013(0x233)],'bundle_id':_0x27c102[_0x186013(0x278)][_0x186013(0x1bc)],'created_at':_0x27c102[_0x186013(0x278)][_0x186013(0x1e4)]},_0x90c2da),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x29b);[a27_0x36855a(0x24b)]=a27_0x36855a(0x1fa);async['execute'](_0x1de5d1){const _0x3a1f2d=a27_0x36855a,{options:_0x290d33,args:_0x38b4d3,tdx:_0x5625ce}=_0x1de5d1,_0x1e69e5=_0x38b4d3[0x0];if(!requireNameOrPath(_0x1e69e5))return 0x1;const _0x19c64c=_0x290d33[_0x3a1f2d(0x200)];if(!_0x19c64c)return console[_0x3a1f2d(0x1df)](_0x3a1f2d(0x26e)),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x4c0bc6=parseInt(_0x19c64c,0xa);if(isNaN(_0x4c0bc6)||_0x4c0bc6<0x1)return console[_0x3a1f2d(0x1df)](_0x3a1f2d(0x1d9)+_0x19c64c),0x1;if(_0x290d33['verbose'])console['error'](_0x3a1f2d(0x267)+_0x1e69e5+_0x3a1f2d(0x28e)+_0x4c0bc6);const {journeyId:_0x4adc81,parentSegmentId:_0x17b249}=await resolveJourneyIdFromInput(_0x1e69e5,_0x290d33,_0x5625ce),_0x583216=await withSpinner(_0x3a1f2d(0x253),()=>_0x5625ce[_0x3a1f2d(0x23d)]['listVersions'](_0x4adc81),{'verbose':_0x290d33['verbose']}),{versions:_0x16d47f,latestJourneyId:_0x57057a}=_0x583216[_0x3a1f2d(0x1c0)],_0x3c67d0=_0x16d47f[_0x3a1f2d(0x23e)](_0x80e750=>_0x80e750['versionNumber']===_0x4c0bc6);if(!_0x3c67d0){const _0x8048e4=_0x16d47f[_0x3a1f2d(0x24d)](_0x354718=>'v'+_0x354718['versionNumber'])[_0x3a1f2d(0x1f8)](',\x20');return console['error'](_0x3a1f2d(0x1d3)+_0x4c0bc6+_0x3a1f2d(0x27b)+_0x8048e4),0x1;}const _0x7c841=await withSpinner(_0x3a1f2d(0x22a)+_0x4c0bc6+_0x3a1f2d(0x237),()=>_0x5625ce[_0x3a1f2d(0x23d)][_0x3a1f2d(0x2ae)](_0x3c67d0[_0x3a1f2d(0x1f3)]),{'verbose':_0x290d33[_0x3a1f2d(0x245)]}),_0x1add2f=_0x7c841['data'],_0x1d89ec=getConsoleNextUrl(_0x290d33[_0x3a1f2d(0x2ba)],'/app/ps/'+_0x17b249+_0x3a1f2d(0x2a0)+_0x3c67d0['journeyId']+_0x3a1f2d(0x1e2));return await handleSingleObjectOutput({'id':_0x1add2f['id'],'name':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x1c5)],'version':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x1bb)],'description':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x24b)],'state':_0x1add2f['attributes'][_0x3a1f2d(0x233)],'paused':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x231)],'reentry_mode':_0x1add2f['attributes']['reentryMode'],'stages':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x240)]?.[_0x3a1f2d(0x218)]||0x0,..._0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x269)]&&{'goal':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x269)][_0x3a1f2d(0x1c5)]},'latest':_0x3c67d0[_0x3a1f2d(0x1f3)]===_0x57057a,'created_at':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x1e4)],'updated_at':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x1d1)],'url':_0x1d89ec},_0x290d33),0x0;}}
1
+ const a27_0x2ff97d=a27_0x50cd;(function(_0x5a619b,_0xec379d){const _0x505315=a27_0x50cd,_0x230d70=_0x5a619b();while(!![]){try{const _0x5d92eb=-parseInt(_0x505315(0x17d))/0x1+-parseInt(_0x505315(0x1b7))/0x2+parseInt(_0x505315(0x1c6))/0x3+-parseInt(_0x505315(0x16b))/0x4*(parseInt(_0x505315(0x1dc))/0x5)+-parseInt(_0x505315(0x1c9))/0x6*(-parseInt(_0x505315(0x1ba))/0x7)+parseInt(_0x505315(0x204))/0x8*(-parseInt(_0x505315(0x267))/0x9)+-parseInt(_0x505315(0x255))/0xa*(-parseInt(_0x505315(0x1bf))/0xb);if(_0x5d92eb===_0xec379d)break;else _0x230d70['push'](_0x230d70['shift']());}catch(_0x531654){_0x230d70['push'](_0x230d70['shift']());}}}(a27_0x2f42,0x75089));import a27_0x128894 from'chalk';import a27_0x4955f1 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';function a27_0x50cd(_0x141541,_0x558fcf){_0x141541=_0x141541-0x165;const _0x2f4233=a27_0x2f42();let _0x50cdfd=_0x2f4233[_0x141541];return _0x50cdfd;}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(_0x1555a3){const _0x5a439f=a27_0x50cd;return!_0x1555a3&&(console['error'](_0x5a439f(0x219)),console[_0x5a439f(0x23f)](_0x5a439f(0x262))),!!_0x1555a3;}function withJsonFormat(_0x25f22d){const _0x5c787b=a27_0x50cd;if(!_0x25f22d['format']&&!_0x25f22d[_0x5c787b(0x1e7)]&&!_0x25f22d[_0x5c787b(0x1d3)]&&!_0x25f22d[_0x5c787b(0x24a)])return{..._0x25f22d,'format':'json','json':!![]};return _0x25f22d;}function formatJourneyState(_0x5da3c8){const _0x163553=a27_0x50cd;switch(_0x5da3c8){case _0x163553(0x199):return a27_0x128894[_0x163553(0x233)]('(running)');case'draft':return a27_0x128894[_0x163553(0x173)](_0x163553(0x21f));case'paused':return a27_0x128894[_0x163553(0x1a3)](_0x163553(0x1ff));case'completed':return a27_0x128894[_0x163553(0x25b)]('(completed)');case'archived':return a27_0x128894[_0x163553(0x173)]('(archived)');default:return'('+_0x5da3c8+')';}}function formatJourneyItem(_0x2a8c73,_0x4001c3='',_0x36d383){const _0xb5d76f=a27_0x50cd,_0x34ca6b=formatJourneyState(_0x2a8c73['state']),_0x113adf=_0x36d383?hyperlink(_0x2a8c73[_0xb5d76f(0x1b8)],_0x36d383):_0x2a8c73['journeyBundleName'];return _0x4001c3+_0xb5d76f(0x180)+_0x113adf+'\x20'+_0x34ca6b;}function escapeRegex(_0x3ab8d6){const _0x134639=a27_0x50cd;return _0x3ab8d6['replace'](/[.*+?^${}()|[\]\\]/g,_0x134639(0x1ef));}function globToRegex(_0x3ed598){const _0x481b5d=a27_0x50cd,_0x17f402=_0x3ed598['split']('*')['map'](escapeRegex);return new RegExp(_0x17f402[_0x481b5d(0x19b)]('.*'),'i');}function buildRuleToNameMapping(_0x11fe1e){const _0x5ae3b2=a27_0x50cd,_0x1e1cb0=new Map();if(_0x11fe1e[_0x5ae3b2(0x18b)])for(const [_0x38bd63,_0x4fe00c]of Object[_0x5ae3b2(0x266)](_0x11fe1e[_0x5ae3b2(0x18b)])){if(_0x4fe00c[_0x5ae3b2(0x1f2)]){const _0x1217a1=serializeRule(_0x4fe00c[_0x5ae3b2(0x1f2)]),_0x5e2cc6=_0x1e1cb0[_0x5ae3b2(0x191)](_0x1217a1);_0x5e2cc6?_0x5e2cc6[_0x5ae3b2(0x16a)](_0x38bd63):_0x1e1cb0[_0x5ae3b2(0x222)](_0x1217a1,[_0x38bd63]);}}return _0x1e1cb0;}async function resolveJourneyIdFromInput(_0x1ba021,_0x5c64ca,_0x820038){const _0x3d8f20=a27_0x50cd,_0x458076=await resolveJourneyTarget(_0x1ba021,_0x5c64ca[_0x3d8f20(0x1f8)],_0x5c64ca[_0x3d8f20(0x237)]),_0x736fdb=_0x458076['parentSegment'];if(!_0x736fdb)throw new SDKError(ErrorCode[_0x3d8f20(0x21a)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x118b3c=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x820038['segment'][_0x3d8f20(0x1ca)](_0x736fdb),{'verbose':_0x5c64ca[_0x3d8f20(0x237)]}),_0x1a3292=_0x118b3c['data'],_0x26f067=await withSpinner('Resolving\x20journey...',()=>_0x820038[_0x3d8f20(0x1d7)]['resolveJourneyId'](_0x1a3292,_0x458076[_0x3d8f20(0x216)]),{'verbose':_0x5c64ca[_0x3d8f20(0x237)]});return{'journeyId':_0x26f067['data'],'journeyName':_0x458076[_0x3d8f20(0x216)],'parentSegmentId':_0x1a3292};}async function resolveJourneyTarget(_0x12a4dc,_0x920a78,_0x46ca57){const _0x4480e6=a27_0x50cd;if(isYamlFilePath(_0x12a4dc))try{const _0x2b30e9=await resolveYamlFilePath(_0x12a4dc);return _0x46ca57&&(console[_0x4480e6(0x23f)]('Resolved\x20YAML\x20file:\x20'+_0x12a4dc),console[_0x4480e6(0x23f)](_0x4480e6(0x195)+_0x2b30e9[_0x4480e6(0x1f8)]),console['error']('\x20\x20Name:\x20'+_0x2b30e9[_0x4480e6(0x24e)]),console[_0x4480e6(0x23f)](_0x4480e6(0x1f5)+(_0x2b30e9[_0x4480e6(0x1da)]||_0x4480e6(0x1fe)))),{'journeyName':_0x2b30e9['segmentName'],'parentSegment':_0x2b30e9['parentSegment'],'resolved':_0x2b30e9};}catch(_0xb74c47){throw new SDKError(ErrorCode[_0x4480e6(0x21a)],_0x4480e6(0x25f)+_0xb74c47[_0x4480e6(0x212)]);}if(!_0x920a78)throw new SDKError(ErrorCode[_0x4480e6(0x21a)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x12a4dc,'parentSegment':_0x920a78};}export class JourneyListCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x189);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x23d);async['execute'](_0x5115c6){const _0x285163=a27_0x2ff97d,{options:_0x10a208,args:_0x3bb6bc,tdx:_0x41552c}=_0x5115c6,_0x2b8fa4=_0x3bb6bc[0x0],_0x4de2b5=_0x10a208['parentSegment'];if(!_0x4de2b5)return console[_0x285163(0x23f)](_0x285163(0x170)),console[_0x285163(0x23f)](_0x285163(0x181)),0x1;const _0x40470d=await withSpinner(_0x285163(0x1c5),()=>_0x41552c['segment']['resolveParentId'](_0x4de2b5),{'verbose':_0x10a208['verbose']}),_0x1ead40=_0x40470d[_0x285163(0x1ed)];_0x10a208[_0x285163(0x237)]&&(console['error'](_0x285163(0x254)+_0x4de2b5+_0x285163(0x24d)+_0x1ead40+')'),_0x2b8fa4&&console[_0x285163(0x23f)](_0x285163(0x198)+_0x2b8fa4));const _0x1e3f53=await withSpinner(_0x285163(0x214),()=>_0x41552c[_0x285163(0x258)][_0x285163(0x25d)](_0x1ead40),{'verbose':_0x10a208[_0x285163(0x237)]}),_0x1550be=_0x1e3f53[_0x285163(0x1ed)],_0x20a11b=_0x1550be['rootFolderId'],_0x11d0ab=await withSpinner(_0x285163(0x1aa),()=>_0x41552c[_0x285163(0x1d7)][_0x285163(0x241)](_0x1ead40,_0x20a11b),{'verbose':_0x10a208[_0x285163(0x237)]});let _0xbe3165=_0x11d0ab[_0x285163(0x1ed)][_0x285163(0x22d)];const _0x1266eb=_0x11d0ab[_0x285163(0x1ed)]['folders'],_0x348b9c=new Map();for(const _0x31bdab of _0x1266eb){_0x348b9c[_0x285163(0x222)](_0x31bdab['id'],_0x31bdab[_0x285163(0x1e0)]);}if(_0x2b8fa4){const _0x2a72fd=globToRegex(_0x2b8fa4);_0xbe3165=_0xbe3165[_0x285163(0x168)](_0x181d23=>_0x2a72fd[_0x285163(0x1c3)](_0x181d23[_0x285163(0x1b8)]));}console[_0x285163(0x23f)](_0x285163(0x1fd)+_0xbe3165['length']+_0x285163(0x1e8)+(_0xbe3165[_0x285163(0x16c)]!==0x1?'s':''));const _0x352751=_0x29bbd9=>{const _0xec3182=_0x285163;return getConsoleNextUrl(_0x10a208[_0xec3182(0x16e)],_0xec3182(0x176)+_0x1ead40+'/e/'+_0x29bbd9+_0xec3182(0x1a5));};if(_0x10a208['format']===_0x285163(0x184))await handleSDKOutput(_0xbe3165,_0x10a208);else{if(_0x10a208[_0x285163(0x185)]===_0x285163(0x1e7)){const _0x24c126=_0xbe3165[_0x285163(0x256)](_0x983e3f=>({..._0x983e3f,'url':_0x352751(_0x983e3f['id'])}));await handleSDKOutput(_0x24c126,_0x10a208);}else{console['log']('['+_0x4de2b5+']');const _0x14d736=new Map(),_0x437566=[];for(const _0x3f228a of _0xbe3165){if(!_0x3f228a[_0x285163(0x1a6)]||_0x3f228a['folderId']===_0x20a11b)_0x437566['push'](_0x3f228a);else{const _0x141923=_0x14d736[_0x285163(0x191)](_0x3f228a[_0x285163(0x1a6)])||[];_0x141923[_0x285163(0x16a)](_0x3f228a),_0x14d736[_0x285163(0x222)](_0x3f228a[_0x285163(0x1a6)],_0x141923);}}const _0xf6d262=(_0x4bc3d7,_0x4109d3)=>_0x4bc3d7[_0x285163(0x1b8)][_0x285163(0x19f)](_0x4109d3['journeyBundleName'],undefined,{'sensitivity':_0x285163(0x172)});_0x437566[_0x285163(0x240)](_0xf6d262);for(const _0x31f9db of _0x437566){console['log'](formatJourneyItem(_0x31f9db,'',_0x352751(_0x31f9db['id'])));}const _0x1131de=[..._0x14d736['entries']()][_0x285163(0x240)]((_0x2b2de8,_0x5cee02)=>{const _0x1f5299=_0x285163,_0x1d9dd6=_0x348b9c['get'](_0x2b2de8[0x0])||_0x2b2de8[0x0],_0xa016b2=_0x348b9c['get'](_0x5cee02[0x0])||_0x5cee02[0x0];return _0x1d9dd6[_0x1f5299(0x19f)](_0xa016b2,undefined,{'sensitivity':_0x1f5299(0x172)});});for(const [_0xa501ae,_0x3999d8]of _0x1131de){const _0x56709d=_0x348b9c[_0x285163(0x191)](_0xa501ae)||_0xa501ae;console[_0x285163(0x223)](_0x285163(0x1d5)+_0x56709d),_0x3999d8[_0x285163(0x240)](_0xf6d262);for(const _0x1a9368 of _0x3999d8){console[_0x285163(0x223)](formatJourneyItem(_0x1a9368,'\x20\x20',_0x352751(_0x1a9368['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x251);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x1c4);async['execute'](_0x2fc80d){const _0x2a5297=a27_0x2ff97d,{options:_0x520115,args:_0x13c196,tdx:_0x115633}=_0x2fc80d,_0x1bf9b3=_0x13c196[0x0];if(!_0x1bf9b3)return console[_0x2a5297(0x23f)](_0x2a5297(0x219)),console[_0x2a5297(0x23f)](_0x2a5297(0x220)),console[_0x2a5297(0x23f)](_0x2a5297(0x217)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x520115['verbose']&&console[_0x2a5297(0x23f)](_0x2a5297(0x23c)+_0x1bf9b3);const {journeyId:_0x4bcec6,parentSegmentId:_0x5beb21}=await resolveJourneyIdFromInput(_0x1bf9b3,_0x520115,_0x115633);if(_0x520115['web']){const _0x4d0d24=getConsoleNextUrl(_0x520115['site'],'/app/ps/'+_0x5beb21+_0x2a5297(0x23b)+_0x4bcec6+_0x2a5297(0x1b4));return console[_0x2a5297(0x23f)](a27_0x128894[_0x2a5297(0x233)]('✔')+_0x2a5297(0x20a)+a27_0x128894['cyan'](_0x4d0d24)),openBrowser(_0x4d0d24),0x0;}const _0x2f8b5c=await withSpinner(_0x2a5297(0x179),()=>_0x115633[_0x2a5297(0x1d7)][_0x2a5297(0x186)](_0x4bcec6),{'verbose':_0x520115[_0x2a5297(0x237)]}),_0x4379ac=_0x2f8b5c[_0x2a5297(0x1ed)],_0x396643=_0x520115[_0x2a5297(0x201)];let _0x2e2b5f;if(_0x396643)try{const _0x36f81c=await withSpinner(_0x2a5297(0x1ea),()=>_0x115633[_0x2a5297(0x1d7)][_0x2a5297(0x245)](_0x4bcec6),{'verbose':_0x520115[_0x2a5297(0x237)]});_0x2e2b5f=_0x36f81c[_0x2a5297(0x1ed)];}catch{_0x520115['verbose']&&console[_0x2a5297(0x23f)]('\x20\x20Statistics\x20not\x20available');}const _0x41aa2a=getConsoleNextUrl(_0x520115[_0x2a5297(0x16e)],'/app/ps/'+_0x5beb21+_0x2a5297(0x23b)+_0x4bcec6+'/j/da/je'),_0x3838a0={'id':_0x4379ac['id'],'name':_0x4379ac[_0x2a5297(0x238)][_0x2a5297(0x1e0)],'description':_0x4379ac['attributes'][_0x2a5297(0x1c7)],'state':_0x4379ac[_0x2a5297(0x238)][_0x2a5297(0x22f)],'paused':_0x4379ac['attributes']['paused'],'reentry_mode':_0x4379ac[_0x2a5297(0x238)]['reentryMode'],'stages':_0x4379ac[_0x2a5297(0x238)][_0x2a5297(0x213)]?.[_0x2a5297(0x16c)]||0x0,..._0x4379ac[_0x2a5297(0x238)]['goal']&&{'goal':_0x4379ac['attributes']['goal'][_0x2a5297(0x1e0)]},..._0x2e2b5f&&{'statistics':{'size':_0x2e2b5f[_0x2a5297(0x196)],'entered':_0x2e2b5f[_0x2a5297(0x177)],'goal_achieved':_0x2e2b5f[_0x2a5297(0x1a0)],'completion_rate':_0x2e2b5f[_0x2a5297(0x175)],'exit_or_jump':_0x2e2b5f[_0x2a5297(0x261)],'exit_or_jump_rate':_0x2e2b5f[_0x2a5297(0x187)],'stages':_0x2e2b5f['stages']}},'url':_0x41aa2a};return await handleSingleObjectOutput(_0x3838a0,_0x520115),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x2ff97d(0x1e4);['description']=a27_0x2ff97d(0x21b);async[a27_0x2ff97d(0x183)](_0x233997){const _0x3142ec=a27_0x2ff97d,{options:_0x41140f,args:_0x4d0818,tdx:_0x34acd6}=_0x233997,_0x43b907=_0x4d0818[0x0];if(!requireNameOrPath(_0x43b907))return 0x1;_0x41140f[_0x3142ec(0x237)]&&console[_0x3142ec(0x23f)](_0x3142ec(0x23c)+_0x43b907);const _0x7eae86=_0x41140f,_0x1398ac=_0x7eae86[_0x3142ec(0x24f)],_0xde4524=_0x7eae86['to'],_0x2ddf28=_0x7eae86[_0x3142ec(0x1d6)],_0x5f0a36=_0x7eae86[_0x3142ec(0x208)];_0x2ddf28&&!_0x1398ac&&!_0xde4524&&console[_0x3142ec(0x23f)](_0x3142ec(0x1ec));const _0x156de1=_0x2ddf28?withJsonFormat(_0x41140f):_0x41140f,{journeyId:_0xd9c77e,journeyName:_0x6f1d3c}=await resolveJourneyIdFromInput(_0x43b907,_0x156de1,_0x34acd6),_0x581ea0=_0x1398ac||_0xde4524?{'from':_0x1398ac,'to':_0xde4524}:undefined,_0x13a117=await withSpinner(_0x3142ec(0x1ea),()=>Promise[_0x3142ec(0x234)]([_0x34acd6[_0x3142ec(0x1d7)][_0x3142ec(0x186)](_0xd9c77e),_0x34acd6[_0x3142ec(0x1d7)]['getStatistics'](_0xd9c77e,_0x581ea0)]),{'verbose':_0x156de1[_0x3142ec(0x237)]}),[_0x3ddb60,_0x3bb7e6]=_0x13a117[_0x3142ec(0x1ed)];if(!_0x3bb7e6||_0x3bb7e6['journeyId']===null)return console[_0x3142ec(0x23f)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x6f1d3c),console[_0x3142ec(0x23f)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x3e7101=buildStageNameMap(_0x3ddb60),_0x504300=!!(_0x581ea0&&_0x3bb7e6[_0x3142ec(0x1f6)]?.[_0x3142ec(0x16c)]),_0x54b60c={'stageNameMap':_0x3e7101,'hasPeriod':_0x504300,'includeHistory':!!_0x2ddf28};if(_0x5f0a36&&_0x3bb7e6[_0x3142ec(0x1e5)]){const _0x3bac93=_0x3bb7e6[_0x3142ec(0x1e5)]['find'](_0x470630=>{const _0x161d2a=_0x3142ec,_0x486f91=_0x3e7101[_0x161d2a(0x191)](_0x470630['id'])??'';return _0x486f91[_0x161d2a(0x1be)]()===_0x5f0a36[_0x161d2a(0x1be)]();});if(_0x3bac93)return await handleSingleObjectOutput(formatStageStats(_0x3bac93,_0x54b60c),_0x156de1),0x0;const _0x19457d=_0x3bb7e6[_0x3142ec(0x1e5)][_0x3142ec(0x256)](_0x434764=>_0x3e7101[_0x3142ec(0x191)](_0x434764['id'])??_0x434764['id']);return console[_0x3142ec(0x23f)](_0x3142ec(0x1a9)+_0x5f0a36+_0x3142ec(0x227)),console[_0x3142ec(0x23f)]('Available\x20stages:\x20'+_0x19457d[_0x3142ec(0x19b)](',\x20')),0x1;}const _0xf1b966=_0x3bb7e6['stages']?.[_0x3142ec(0x256)](_0x5bdb5d=>formatStageStats(_0x5bdb5d,_0x54b60c)),_0x564563=assembleJourneyStats(_0x3bb7e6,{'from':_0x1398ac,'to':_0xde4524,'includeHistory':_0x2ddf28});return await this[_0x3142ec(0x19e)](_0x564563,_0xf1b966??[],_0x156de1),0x0;}async[a27_0x2ff97d(0x19e)](_0x30d327,_0x60bb06,_0x344366){const _0x55b144=a27_0x2ff97d,_0x1459e1=_0x344366[_0x55b144(0x185)]===_0x55b144(0x1e7)||_0x344366[_0x55b144(0x185)]===_0x55b144(0x1d3)||_0x344366[_0x55b144(0x1e7)]||_0x344366['jsonl'];if(_0x1459e1){_0x30d327[_0x55b144(0x1e5)]=_0x60bb06,await handleSingleObjectOutput(_0x30d327,_0x344366);return;}await handleSingleObjectOutput(_0x30d327,_0x344366);for(const _0x52418a of _0x60bb06){console[_0x55b144(0x223)](''),console[_0x55b144(0x223)](String(a27_0x128894[_0x55b144(0x226)][_0x55b144(0x174)]('['+_0x52418a[_0x55b144(0x1e0)]+']'))+a27_0x128894[_0x55b144(0x173)]('\x20'+_0x52418a['id']));const {id:_0x8b73bf,name:_0x1b7a9b,..._0x20a9ed}=_0x52418a;await handleSingleObjectOutput(_0x20a9ed,_0x344366);}}}export class JourneyTrafficCommand extends BaseCommand{['name']='journey:traffic';[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x1d4);async[a27_0x2ff97d(0x183)](_0x329a5d){const _0x2ebc52=a27_0x2ff97d,{options:_0x4ff0fc,args:_0x2597e2,tdx:_0x52d7f8}=_0x329a5d,_0x1e4105=_0x2597e2[0x0];if(!requireNameOrPath(_0x1e4105))return 0x1;_0x4ff0fc[_0x2ebc52(0x237)]&&console[_0x2ebc52(0x23f)](_0x2ebc52(0x23c)+_0x1e4105);const _0x3237f8=_0x4ff0fc,_0xde32f3=_0x3237f8[_0x2ebc52(0x218)],_0x598283=_0x3237f8[_0x2ebc52(0x24f)],_0x19f7bc=_0x3237f8['to'],_0x5a029=_0x3237f8['limit'];if(_0xde32f3&&_0xde32f3!==_0x2ebc52(0x19c)&&_0xde32f3!==_0x2ebc52(0x20d))return console[_0x2ebc52(0x23f)](_0x2ebc52(0x25e)+_0xde32f3+_0x2ebc52(0x18a)),0x1;const _0x4a5269=withJsonFormat(_0x4ff0fc),{journeyId:_0x3687a1,journeyName:_0x1f51c6}=await resolveJourneyIdFromInput(_0x1e4105,_0x4a5269,_0x52d7f8),_0x1624fa={'type':_0xde32f3,'from':_0x598283,'to':_0x19f7bc,'limit':_0x5a029},_0xa93689=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x52d7f8[_0x2ebc52(0x1d7)][_0x2ebc52(0x263)](_0x3687a1,_0x1624fa),{'verbose':_0x4a5269[_0x2ebc52(0x237)]}),_0x2b4cbf=_0xa93689[_0x2ebc52(0x1ed)],_0x536a23=_0x2b4cbf[_0x2ebc52(0x19c)]&&(_0x2b4cbf['conversion'][_0x2ebc52(0x1b0)][_0x2ebc52(0x16c)]>0x0||_0x2b4cbf['conversion'][_0x2ebc52(0x19d)][_0x2ebc52(0x16c)]>0x0),_0x3af562=_0x2b4cbf[_0x2ebc52(0x20d)]&&_0x2b4cbf[_0x2ebc52(0x20d)]['length']>0x0;if(!_0x536a23&&!_0x3af562)return console[_0x2ebc52(0x23f)](_0x2ebc52(0x1ce)+_0x1f51c6),console[_0x2ebc52(0x23f)](_0x2ebc52(0x21d)),_0x598283&&_0x19f7bc&&console[_0x2ebc52(0x23f)](_0x2ebc52(0x207)),0x0;return await handleSingleObjectOutput(_0x2b4cbf,_0x4a5269),0x0;}}function formatStageStats(_0x331888,_0x17cf0e){const _0x4d51ac=a27_0x2ff97d,_0x651496=_0x17cf0e[_0x4d51ac(0x1b2)]&&_0x331888[_0x4d51ac(0x1f6)]?.['length']?aggregateStageHistory(_0x331888[_0x4d51ac(0x1f6)]):{'size':_0x331888[_0x4d51ac(0x196)],'entered':_0x331888[_0x4d51ac(0x177)],'milestone':_0x331888['milestoneSize'],'milestone_rate':_0x331888['completeMilestoneRate'],'exit_or_jump':_0x331888[_0x4d51ac(0x261)],'exit_or_jump_rate':_0x331888[_0x4d51ac(0x187)]},_0x5140c7={'id':_0x331888['id'],'name':_0x17cf0e[_0x4d51ac(0x1ee)][_0x4d51ac(0x191)](_0x331888['id'])??_0x331888['id'],..._0x651496};return _0x17cf0e['hasPeriod']&&_0x17cf0e[_0x4d51ac(0x1d6)]&&_0x331888[_0x4d51ac(0x1f6)]&&(_0x5140c7['history']=_0x331888['history']),_0x5140c7;}export class JourneyPauseCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x197);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x1af);async[a27_0x2ff97d(0x183)](_0x3c6f86){const _0x162397=a27_0x2ff97d,{options:_0x993c91,args:_0x51272c,tdx:_0x366098}=_0x3c6f86,_0x37af60=_0x51272c[0x0];if(!requireNameOrPath(_0x37af60))return 0x1;_0x993c91[_0x162397(0x237)]&&console['error']('Input:\x20'+_0x37af60);const {journeyId:_0x4c0dc3,journeyName:_0x5694ac}=await resolveJourneyIdFromInput(_0x37af60,_0x993c91,_0x366098);if(!_0x993c91[_0x162397(0x1e2)]){const _0x34198c=await confirm(_0x162397(0x1db)+_0x5694ac+'\x22?');if(!_0x34198c)return console[_0x162397(0x23f)](_0x162397(0x236)),0x0;}const _0x553eba=await withSpinner(_0x162397(0x1e3),()=>_0x366098[_0x162397(0x1d7)][_0x162397(0x1f9)](_0x4c0dc3),{'verbose':_0x993c91[_0x162397(0x237)]}),_0x1fae85=_0x553eba[_0x162397(0x1ed)];return console[_0x162397(0x23f)](_0x162397(0x1cc)+_0x1fae85[_0x162397(0x238)][_0x162397(0x1e0)]+_0x162397(0x230)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x1bc);[a27_0x2ff97d(0x1c7)]='Resume\x20a\x20paused\x20journey';async[a27_0x2ff97d(0x183)](_0x5f51b8){const _0x228c89=a27_0x2ff97d,{options:_0x3fd457,args:_0x20417a,tdx:_0x31ff11}=_0x5f51b8,_0x3b0047=_0x20417a[0x0];if(!requireNameOrPath(_0x3b0047))return 0x1;_0x3fd457[_0x228c89(0x237)]&&console['error'](_0x228c89(0x23c)+_0x3b0047);const {journeyId:_0x3e21ed,journeyName:_0x33ac3b}=await resolveJourneyIdFromInput(_0x3b0047,_0x3fd457,_0x31ff11);if(!_0x3fd457[_0x228c89(0x1e2)]){const _0x2afd65=await confirm(_0x228c89(0x1e9)+_0x33ac3b+'\x22?');if(!_0x2afd65)return console[_0x228c89(0x23f)](_0x228c89(0x236)),0x0;}const _0x676d6a=await withSpinner(_0x228c89(0x1df),()=>_0x31ff11[_0x228c89(0x1d7)][_0x228c89(0x225)](_0x3e21ed),{'verbose':_0x3fd457[_0x228c89(0x237)]}),_0xc40a92=_0x676d6a[_0x228c89(0x1ed)];return console['error'](_0x228c89(0x1cc)+_0xc40a92[_0x228c89(0x238)][_0x228c89(0x1e0)]+_0x228c89(0x17e)),0x0;}}function a27_0x2f42(){const _0x51bfe5=['getActivation','\x20files?','\x20(ID:\x20','segmentName','from','Journey\x20name:\x20','journey:view','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','journey:version:view','Parent\x20segment:\x20','1205690cHPTDR','map','Folder\x20path:\x20','segment','journeyBundleId','createdAt','blue','repeat','getParentFull','Error:\x20Invalid\x20--type\x20\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','exitOrJumpSize','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','getTrafficData','List\x20activations\x20for\x20a\x20journey','utf-8','entries','153vuWKnJ','listActivationsFlat','✔\x20Pulled\x20','cwd','filter','Warning:\x20Could\x20not\x20resolve\x20segment\x20','push','324008lJOzqj','length','List\x20all\x20versions\x20of\x20a\x20journey','site','hasChanges','Error:\x20Parent\x20segment\x20context\x20required','stringify','base','dim','bold','completionRate','/app/ps/','enteredSize','-\x20no\x20files\x20written','Getting\x20journey\x20details...','activationParams','Getting\x20version\x20','\x20(draft)\x20—\x20\x22','842401wJlEjS','\x22\x20resumed','resourceName','🗺️\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20journey\x20files\x20to\x20','execute','table','format','getJourney','exitOrJumpRate','Target\x20file:\x20','journey:list','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','segments','Write\x20','audienceId','Table:\x20','relativePath','buildIdToNameMap','get','Error:\x20Journey\x20\x27','segmentPushCommand','\x20\x20Target:\x20','\x20\x20Parent\x20segment:\x20','size','journey:pause','Pattern:\x20','launched','content','join','conversion','links','renderStats','localeCompare','goalSize','errorCode','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','yellow','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','/j/da','folderId','✔\x20All\x20files\x20are\x20up\x20to\x20date','parent_segment','Error:\x20Stage\x20\x22','Listing\x20journeys...','\x0aChanges\x20to\x20\x27','✔\x20Context\x20set:\x20','listVersions','\x20versions)','Pause\x20a\x20running\x20journey','nodes','find','hasPeriod','session','/j/da/je','relative','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','703802cfrGWr','journeyBundleName','options','3916143BgAEWv','\x20=\x20','journey:resume','versionNumber','toLowerCase','121oqNzzy','connection','Fetching\x20users\x20and\x20connections...','red','test','Show\x20journey\x20details','Resolving\x20parent\x20segment...','1747719KVJoTP','description','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','6HOxUAi','resolveParentId','listJourneysFromParentSegment','✔\x20Journey\x20\x22','activation_','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','diff','\x20unchanged\x20files','reentryMode','user','jsonl','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','📁\x20','includeHistory','journey','args','journeyId','folderPath','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','35deFqhb','filePath','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Resuming\x20journey...','name','file','yes','Pausing\x20journey...','journey:stats','stages','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','json','\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Getting\x20journey\x20statistics...','helpText','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','data','stageNameMap','\x5c$&','connector_config','listFolders','rule','then','Creating\x20new\x20version...','\x20\x20Folder\x20path:\x20','history','\x20\x20-\x20','parentSegment','pause','\x20journeys','isNew','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','✔\x20Found\x20','(root)','(paused)','Fetching\x20','includeStats','\x20version','goal','107104KWuBGC','has','\x20->\x20','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','stage','columns','\x20Opening\x20','journey:versions','\x20\x20Journey\x20ID:\x20','activation','\x20changed\x20files','Fetching\x20journeys\x20and\x20folders...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','targetDir','message','journeyStages','Fetching\x20parent\x20segment...','\x20(rule\x20match)','journeyName','Options:','type','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','INVALID_ARGUMENT','Show\x20journey\x20statistics','journey:pull','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Error:\x20--version\x20option\x20is\x20required','(draft)','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Getting\x20column\x20mapping...','set','log','\x20\x20Consolidating\x20duplicate\x20segment:\x20','resume','cyan','\x22\x20not\x20found','No\x20journeys\x20found','Found\x20','dryRun','tdx.json','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journeys','resolveSegment','state','\x22\x20paused','.yml','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','green','all','journey:activations','Cancelled','verbose','attributes','Aborted.','Database:\x20','/e/','Input:\x20','List\x20journeys\x20in\x20current\x20context','journey:push','error','sort','listJourneysWithFolders','updatedAt','paused','database','getStatistics','kind','values','add','getSegment','tsv'];a27_0x2f42=function(){return _0x51bfe5;};return a27_0x2f42();}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x2ff97d(0x21c);['description']=a27_0x2ff97d(0x260);async[a27_0x2ff97d(0x183)](_0x1e61a8){const _0x3b574a=a27_0x2ff97d,{options:_0x103ab3,args:_0x7470fa,tdx:_0x39ea32}=_0x1e61a8,_0x201317=_0x103ab3,_0x167c11=_0x7470fa[0x0],_0x3a8b30=_0x167c11&&isYamlFilePath(_0x167c11),_0x148cd7=await resolveTarget({'arg':_0x3a8b30?_0x167c11:undefined,'contextParent':_0x103ab3[_0x3b574a(0x1f8)],'cwd':process[_0x3b574a(0x167)]()});if(!isSuccessfulResolution(_0x148cd7))return _0x148cd7[_0x3b574a(0x1a1)]==='no_parent'?(console['error'](a27_0x128894[_0x3b574a(0x1a3)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3b574a(0x23f)]('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'](_0x3b574a(0x210)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x3b574a(0x23f)](_0x3b574a(0x1b6))):(console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x1c2)]('Error:\x20'+_0x148cd7['message']+'\x0a')),_0x148cd7[_0x3b574a(0x1eb)]&&console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x226)](_0x148cd7['helpText']))),0x1;let _0x158875=_0x3a8b30?undefined:_0x167c11,_0x4d4be0,_0x3b757b;_0x148cd7[_0x3b574a(0x218)]===_0x3b574a(0x1e1)&&(_0x158875=_0x148cd7[_0x3b574a(0x17f)],_0x4d4be0=_0x148cd7[_0x3b574a(0x1dd)],_0x3b757b=_0x148cd7[_0x3b574a(0x1da)]);const _0x2ea014=_0x148cd7['parentName'],_0x55b9fc=_0x148cd7[_0x3b574a(0x211)];_0x201317[_0x3b574a(0x237)]&&(console[_0x3b574a(0x23f)](_0x3b574a(0x254)+_0x2ea014),console[_0x3b574a(0x23f)]('Target\x20directory:\x20'+_0x55b9fc),_0x158875&&console[_0x3b574a(0x23f)](_0x3b574a(0x250)+_0x158875),_0x4d4be0&&console[_0x3b574a(0x23f)](_0x3b574a(0x188)+_0x4d4be0),_0x3b757b&&console[_0x3b574a(0x23f)](_0x3b574a(0x257)+_0x3b757b));const _0xba89a3=await withSpinner(_0x3b574a(0x1c5),()=>_0x39ea32['segment'][_0x3b574a(0x1ca)](_0x2ea014),{'verbose':_0x103ab3['verbose']}),_0x52ea67=_0xba89a3[_0x3b574a(0x1ed)],{journeys:_0x3c5e83,folders:_0x2cdafe}=await withSpinner(_0x3b574a(0x20f),async()=>{const _0xa34258=_0x3b574a,[_0x2d3d84,_0x7f2071]=await Promise['all']([_0x39ea32[_0xa34258(0x1d7)][_0xa34258(0x1cb)](_0x52ea67,undefined,{'includeAllVersions':!![]}),_0x39ea32[_0xa34258(0x258)][_0xa34258(0x1f1)](_0x52ea67)]);return{'journeys':_0x2d3d84,'folders':_0x7f2071};},{'verbose':_0x103ab3[_0x3b574a(0x237)]})[_0x3b574a(0x1f3)](_0x1fb0a0=>_0x1fb0a0[_0x3b574a(0x1ed)]);let _0x2a5d73=_0x3c5e83;const _0x2b1119=buildFolderIdToPathMap(_0x2cdafe);if(_0x158875){const _0x1e71d9=_0x2a5d73['filter'](_0x55babf=>_0x55babf[_0x3b574a(0x1b8)][_0x3b574a(0x1be)]()===_0x158875['toLowerCase']());if(_0x1e71d9[_0x3b574a(0x16c)]===0x0)return console[_0x3b574a(0x23f)]('Error:\x20Journey\x20not\x20found:\x20'+_0x158875),console['error'](_0x3b574a(0x1fc)),0x1;_0x2a5d73=_0x1e71d9;}if(_0x3b757b!==undefined){const _0x2e5a98=_0x2a5d73[_0x3b574a(0x168)](_0x2ec28a=>{const _0x3b2859=_0x3b574a,_0x3bd30e=_0x2ec28a[_0x3b2859(0x1a6)]?_0x2b1119['get'](_0x2ec28a['folderId'])||'':'';return _0x3bd30e===_0x3b757b;});if(_0x2e5a98['length']===0x0&&_0x2a5d73['length']>0x0){console['error'](_0x3b574a(0x192)+_0x158875+'\x27\x20not\x20found\x20in\x20'+(_0x3b757b||'root\x20folder')),console[_0x3b574a(0x23f)](_0x3b574a(0x1a2));for(const _0xdab3e1 of _0x2a5d73){const _0x42d75f=_0xdab3e1[_0x3b574a(0x1a6)]?_0x2b1119[_0x3b574a(0x191)](_0xdab3e1[_0x3b574a(0x1a6)])||'':'';console[_0x3b574a(0x23f)](_0x3b574a(0x1f7)+(_0x42d75f||_0x3b574a(0x1fe))+'/'+_0xdab3e1[_0x3b574a(0x1b8)]);}return 0x1;}_0x2a5d73=_0x2e5a98;}if(_0x2a5d73[_0x3b574a(0x16c)]===0x0)return console['error'](_0x3b574a(0x228)),0x0;const _0x425597=new Map();for(const _0x58a1e0 of _0x2a5d73){const _0x493aae=_0x58a1e0[_0x3b574a(0x259)];!_0x425597[_0x3b574a(0x205)](_0x493aae)&&_0x425597['set'](_0x493aae,[]),_0x425597[_0x3b574a(0x191)](_0x493aae)[_0x3b574a(0x16a)](_0x58a1e0);}for(const _0xa458fe of _0x425597[_0x3b574a(0x247)]()){_0xa458fe[_0x3b574a(0x240)]((_0x5a6163,_0x1b2e50)=>(_0x5a6163[_0x3b574a(0x1bd)]||0x0)-(_0x1b2e50[_0x3b574a(0x1bd)]||0x0));}const _0x35a0c2=[],{idToEmailMap:_0x31b14d,connectionIdToNameMap:_0x52bf46}=await withSpinner(_0x3b574a(0x1c1),async()=>{const _0x125656=_0x3b574a,[_0x493cc7,_0x477e39]=await Promise[_0x125656(0x234)]([_0x39ea32[_0x125656(0x1d2)]['buildIdToEmailMap'](),_0x39ea32[_0x125656(0x1c0)][_0x125656(0x190)]()]);return{'idToEmailMap':_0x493cc7,'connectionIdToNameMap':_0x477e39};},{'verbose':_0x103ab3[_0x3b574a(0x237)]})[_0x3b574a(0x1f3)](_0xa737ff=>_0xa737ff[_0x3b574a(0x1ed)]);for(const _0x20dd4e of _0x425597['values']()){const _0x3cac6e=_0x20dd4e[0x0][_0x3b574a(0x1b8)],_0x5cc789=_0x20dd4e[0x0][_0x3b574a(0x1a6)],_0xfadc2a=_0x5cc789?_0x2b1119['get'](_0x5cc789)||'':'',_0x5b382b=_0xfadc2a?a27_0x4955f1[_0x3b574a(0x19b)](_0x55b9fc,_0xfadc2a):_0x55b9fc,_0x5bafdd=_0x4d4be0||a27_0x4955f1['join'](_0x5b382b,sanitizeFileName(_0x3cac6e)+'.yml');let _0x336c05,_0x343ace;if(existsSync(_0x5bafdd))try{const _0x5429e1=readFileSync(_0x5bafdd,_0x3b574a(0x265)),_0x5bd12e=parseYamlString(_0x5429e1);_0x343ace=_0x5bd12e,_0x336c05=buildRuleToNameMapping(_0x5bd12e),_0x201317['verbose']&&_0x336c05[_0x3b574a(0x196)]>0x0&&console[_0x3b574a(0x23f)](_0x3b574a(0x229)+_0x336c05[_0x3b574a(0x196)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x3cac6e);}catch(_0x58da49){_0x201317['verbose']&&console[_0x3b574a(0x23f)](_0x3b574a(0x22c)+_0x58da49['message']);}const _0x1a1ef9=[],_0x3d8937=new Set(),_0x55d234=new Map(),_0x3a8eb0=new Map(),_0x15e001=new Set(),_0x1a61e6=new Map(),_0x33e0a5=new Map(),_0x597b6a=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x3cac6e+'...',async _0x3fb3f0=>{const _0x45e403=_0x3b574a;for(const _0xadcacc of _0x20dd4e){const _0x2db678=_0x20dd4e['length']>0x1?_0xadcacc[_0x45e403(0x1b8)]+'\x20v'+(_0xadcacc[_0x45e403(0x1bd)]||0x1):_0xadcacc[_0x45e403(0x1b8)];_0x3fb3f0['setPhase'](_0x45e403(0x200)+_0x2db678);const _0x36506d=await _0x39ea32[_0x45e403(0x1d7)][_0x45e403(0x186)](_0xadcacc['id']),_0x507782=_0x36506d['attributes']?.[_0x45e403(0x18d)],_0x1b39e0={'resolveSegment':async _0x1482b9=>{const _0x51456d=_0x45e403;if(!_0x507782)return{'name':_0x1482b9,'isJourneyLocal':![]};const _0x505244=_0x55d234[_0x51456d(0x191)](_0x1482b9);if(_0x505244)return _0x505244;try{const _0xaf4ef4=await _0x39ea32[_0x51456d(0x258)][_0x51456d(0x249)](_0x507782,_0x1482b9),_0x5b7821=_0xaf4ef4[_0x51456d(0x246)]===SEGMENT_KIND_JOURNEY;let _0x3148ce,_0x5e9160=_0xaf4ef4[_0x51456d(0x1e0)];if(_0x5b7821&&_0xaf4ef4[_0x51456d(0x1f2)]){const _0x524192=await segmentResponseToDef(_0xaf4ef4,{'resolveSegmentName':async _0x2c230a=>{const _0x227b1a=_0x51456d,_0x2c2542=_0x55d234[_0x227b1a(0x191)](_0x2c230a);if(_0x2c2542)return _0x2c2542['name'];const _0x292151=await _0x1b39e0[_0x227b1a(0x22e)](_0x2c230a);return _0x292151[_0x227b1a(0x1e0)];}}),_0xae106c=_0x524192['rule'];_0x3148ce={'description':_0xaf4ef4[_0x51456d(0x1c7)],'rule':_0xae106c};const _0x1b1b8a=serializeRule(_0xae106c),_0xdd6814=_0x3a8eb0[_0x51456d(0x191)](_0x1b1b8a);if(_0xdd6814)_0x5e9160=_0xdd6814,_0x3148ce=undefined,_0x201317['verbose']&&console[_0x51456d(0x23f)](_0x51456d(0x224)+_0xaf4ef4[_0x51456d(0x1e0)]+_0x51456d(0x206)+_0xdd6814);else{let _0x40f913=![];if(_0x336c05){const _0x3695f0=_0x336c05[_0x51456d(0x191)](_0x1b1b8a);if(_0x3695f0){const _0x257108=_0x3695f0[_0x51456d(0x1b1)](_0x38f6de=>!_0x3d8937[_0x51456d(0x205)](_0x38f6de));_0x257108&&(_0x5e9160=_0x257108,_0x3d8937[_0x51456d(0x248)](_0x257108),_0x3a8eb0['set'](_0x1b1b8a,_0x257108),_0x40f913=!![],_0x201317[_0x51456d(0x237)]&&console['error'](_0x51456d(0x1de)+_0x257108+_0x51456d(0x215)));}}if(!_0x40f913){const _0x5ac7b6=generateJourneyLocalName(_0xaf4ef4[_0x51456d(0x1e0)]);_0x5ac7b6&&(_0x5e9160=_0x5ac7b6);let _0x2f2457=_0x5e9160,_0x231012=0x2;while(_0x3d8937[_0x51456d(0x205)](_0x2f2457)){_0x2f2457=_0x5e9160+'_'+_0x231012,_0x231012++;}_0x3d8937[_0x51456d(0x248)](_0x2f2457),_0x3a8eb0[_0x51456d(0x222)](_0x1b1b8a,_0x2f2457),_0x5e9160=_0x2f2457;}}}const _0x403757={'name':_0x5e9160,'isJourneyLocal':_0x5b7821,'definition':_0x3148ce};return _0x55d234[_0x51456d(0x222)](_0x1482b9,_0x403757),_0x403757;}catch(_0x14dd09){return _0x103ab3['verbose']&&console[_0x51456d(0x23f)](_0x51456d(0x169)+_0x1482b9+':\x20'+_0x14dd09[_0x51456d(0x212)]),{'name':_0x1482b9,'isJourneyLocal':![]};}},'resolveActivation':async _0x214454=>{const _0x146ae2=_0x45e403,_0x4fb4f9=_0x1a61e6[_0x146ae2(0x191)](_0x214454);if(_0x4fb4f9)return _0x4fb4f9;try{const _0x4695d3=await _0x39ea32[_0x146ae2(0x1d7)][_0x146ae2(0x24b)](_0xadcacc['id'],_0x214454),_0x59594d=journeyActivationStepToYaml(_0x4695d3,_0x31b14d,_0x52bf46),_0x143257=JSON[_0x146ae2(0x171)]({'name':_0x59594d['name'],'connection':_0x59594d['connection'],'connector_config':_0x59594d[_0x146ae2(0x1f0)]}),_0x270f80=_0x33e0a5[_0x146ae2(0x191)](_0x143257);if(_0x270f80){const _0x5f59c9={'name':_0x270f80,'isJourneyLocal':!![],'definition':_0x59594d};return _0x1a61e6[_0x146ae2(0x222)](_0x214454,_0x5f59c9),_0x5f59c9;}const _0x23755b=_0x4695d3['attributes'][_0x146ae2(0x17a)][_0x146ae2(0x1e0)]||_0x214454,_0x1d5259=sanitizeYamlKey(_0x23755b)||_0x146ae2(0x1cd)+_0x214454;let _0x4da57a=_0x1d5259,_0x3c5a0d=0x2;while(_0x15e001[_0x146ae2(0x205)](_0x4da57a)){_0x4da57a=_0x1d5259+'_'+_0x3c5a0d,_0x3c5a0d++;}_0x15e001[_0x146ae2(0x248)](_0x4da57a),_0x33e0a5[_0x146ae2(0x222)](_0x143257,_0x4da57a);const _0x228c22={'name':_0x4da57a,'isJourneyLocal':!![],'definition':_0x59594d};return _0x1a61e6[_0x146ae2(0x222)](_0x214454,_0x228c22),_0x228c22;}catch(_0xd6be2d){return _0x103ab3[_0x146ae2(0x237)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x214454+':\x20'+_0xd6be2d['message']),{'name':_0x214454,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x4b404,_0x13ba94)=>{const _0x5896b5=_0x45e403;return resolveJumpTarget(_0x4b404,_0x13ba94,_0x597b6a,_0x10fa8a=>_0x39ea32[_0x5896b5(0x1d7)]['getJourney'](_0x10fa8a));}},_0x46efe0=await journeyResponseToDef(_0x36506d,_0x1b39e0);_0x1a1ef9[_0x45e403(0x16a)]({'item':_0xadcacc,'yaml':_0x46efe0});}},{'verbose':_0x103ab3[_0x3b574a(0x237)]});const _0x4b1ae5=await _0x39ea32['journey']['getLatestJourneyId'](_0x20dd4e[0x0][_0x3b574a(0x259)]),_0x2771d8=buildMergedJourneyDef(_0x1a1ef9,_0x336c05,_0x4b1ae5),_0x3d7ba2=normalizeJourneyDef(_0x2771d8,_0x343ace),_0x20e532=toYamlString(_0x3d7ba2),_0x24ad1b=_0x4d4be0||a27_0x4955f1[_0x3b574a(0x19b)](_0x5b382b,sanitizeFileName(_0x3cac6e)+_0x3b574a(0x231));!_0x4d4be0&&_0xfadc2a&&!existsSync(_0x5b382b)&&mkdirSync(_0x5b382b,{'recursive':!![]});const _0x1b653e=a27_0x4955f1[_0x3b574a(0x1b5)](process[_0x3b574a(0x167)](),_0x24ad1b);if(existsSync(_0x24ad1b)){const _0x552afe=readFileSync(_0x24ad1b,_0x3b574a(0x265)),_0x108cf8=generateDiff(_0x552afe,_0x20e532),_0x41d2b6=hasChanges(_0x108cf8);_0x35a0c2[_0x3b574a(0x16a)]({'relativePath':_0x1b653e,'absolutePath':_0x24ad1b,'content':_0x20e532,'isNew':![],'hasChanges':_0x41d2b6,'diff':_0x41d2b6?formatDiffWithColors(_0x108cf8):undefined});}else _0x35a0c2[_0x3b574a(0x16a)]({'relativePath':_0x1b653e,'absolutePath':_0x24ad1b,'content':_0x20e532,'isNew':!![],'hasChanges':![]});}const _0x548e3a=_0x35a0c2[_0x3b574a(0x168)](_0x218677=>_0x218677[_0x3b574a(0x1fb)]),_0x558dfd=_0x35a0c2['filter'](_0x4b5d3c=>!_0x4b5d3c[_0x3b574a(0x1fb)]&&_0x4b5d3c[_0x3b574a(0x16f)]),_0x504ce0=_0x35a0c2['filter'](_0x3e6975=>!_0x3e6975['isNew']&&!_0x3e6975[_0x3b574a(0x16f)]),_0x1c8efe=_0x2a5d73['length'],_0x4252b1=_0x425597[_0x3b574a(0x196)],_0x6d36e=_0x1c8efe>_0x4252b1?'\x20('+_0x1c8efe+_0x3b574a(0x1ae):'';console[_0x3b574a(0x23f)]('\x0aPull\x20summary:'),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894[_0x3b574a(0x226)](_0x4252b1+_0x3b574a(0x1fa))+a27_0x128894['dim'](_0x6d36e)),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894[_0x3b574a(0x233)]('+\x20'+_0x548e3a['length']+'\x20new\x20files')),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894['yellow']('~\x20'+_0x558dfd[_0x3b574a(0x16c)]+_0x3b574a(0x20e))),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894['dim']('=\x20'+_0x504ce0[_0x3b574a(0x16c)]+_0x3b574a(0x1d0))),console[_0x3b574a(0x23f)](_0x3b574a(0x194)+a27_0x128894[_0x3b574a(0x226)](_0x55b9fc)+'\x0a');if(_0x558dfd['length']>0x0)for(const _0x49bddd of _0x558dfd){console[_0x3b574a(0x23f)](_0x3b574a(0x1ab)+_0x49bddd[_0x3b574a(0x18f)]+'\x27:'),console[_0x3b574a(0x23f)]('─'['repeat'](0x3c)),console[_0x3b574a(0x23f)](_0x49bddd[_0x3b574a(0x1cf)]),console[_0x3b574a(0x23f)]('─'[_0x3b574a(0x25c)](0x3c));}if(_0x201317[_0x3b574a(0x22a)])return console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x1a3)](_0x3b574a(0x232))),0x0;if(_0x548e3a[_0x3b574a(0x16c)]===0x0&&_0x558dfd[_0x3b574a(0x16c)]===0x0)return console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x233)](_0x3b574a(0x1a7))),saveSessionContext({'parent_segment':_0x2ea014},_0x201317[_0x3b574a(0x1b3)]),console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x233)](_0x3b574a(0x1ac)+a27_0x128894['dim']('parent_segment')+'\x20=\x20'+a27_0x128894[_0x3b574a(0x226)](_0x2ea014))),0x0;if(!_0x201317['yes']&&(_0x548e3a[_0x3b574a(0x16c)]>0x0||_0x558dfd['length']>0x0)){if(!isInteractive())return console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x1c2)]('\x0aError:'),_0x3b574a(0x1e6)),console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x173)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x90da7c=await confirmKey(_0x3b574a(0x18c)+(_0x548e3a[_0x3b574a(0x16c)]+_0x558dfd[_0x3b574a(0x16c)])+_0x3b574a(0x24c));if(!_0x90da7c)return console['error'](a27_0x128894[_0x3b574a(0x1a3)](_0x3b574a(0x239)),_0x3b574a(0x178)),0x1;}!existsSync(_0x55b9fc)&&mkdirSync(_0x55b9fc,{'recursive':!![]});const _0x2c82cd=a27_0x4955f1[_0x3b574a(0x19b)](_0x55b9fc,_0x3b574a(0x22b));writeFileSync(_0x2c82cd,createTdxConfigContent(_0x2ea014),_0x3b574a(0x265));for(const _0x34a731 of _0x35a0c2){(_0x34a731[_0x3b574a(0x1fb)]||_0x34a731['hasChanges'])&&writeFileSync(_0x34a731['absolutePath'],_0x34a731[_0x3b574a(0x19a)],_0x3b574a(0x265));}return console[_0x3b574a(0x23f)](a27_0x128894['green'](_0x3b574a(0x166)+(_0x548e3a[_0x3b574a(0x16c)]+_0x558dfd[_0x3b574a(0x16c)])+_0x3b574a(0x182)+_0x55b9fc)),saveSessionContext({'parent_segment':_0x2ea014},_0x201317[_0x3b574a(0x1b3)]),console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x233)](_0x3b574a(0x1ac)+a27_0x128894['dim'](_0x3b574a(0x1a8))+_0x3b574a(0x1bb)+a27_0x128894['cyan'](_0x2ea014))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]='journey:columns';[a27_0x2ff97d(0x1c7)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x2ff97d(0x183)](_0x84862c){const _0x1b7fbb=a27_0x2ff97d,{options:_0x564d23,args:_0x41752d,tdx:_0x3849cb}=_0x84862c,_0x1a76d4=_0x41752d[0x0];if(!requireNameOrPath(_0x1a76d4))return 0x1;_0x564d23[_0x1b7fbb(0x237)]&&console[_0x1b7fbb(0x23f)](_0x1b7fbb(0x23c)+_0x1a76d4);const {journeyId:_0x5289db}=await resolveJourneyIdFromInput(_0x1a76d4,_0x564d23,_0x3849cb),_0x94218c=await withSpinner(_0x1b7fbb(0x221),()=>_0x3849cb[_0x1b7fbb(0x1d7)]['getColumnMapping'](_0x5289db),{'verbose':_0x564d23[_0x1b7fbb(0x237)]}),_0x4688aa=_0x94218c[_0x1b7fbb(0x1ed)];return console[_0x1b7fbb(0x223)](_0x1b7fbb(0x23a)+_0x4688aa[_0x1b7fbb(0x244)]),console[_0x1b7fbb(0x223)](_0x1b7fbb(0x18e)+_0x4688aa[_0x1b7fbb(0x184)]),await handleSDKOutput(_0x4688aa[_0x1b7fbb(0x209)],_0x564d23),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x235);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x264);async[a27_0x2ff97d(0x183)](_0x1b254f){const _0x3e67fe=a27_0x2ff97d,{options:_0x1ea7a8,args:_0x17c6d7,tdx:_0x6f959f}=_0x1b254f,_0xa8e0a=_0x17c6d7[0x0];if(!requireNameOrPath(_0xa8e0a))return 0x1;_0x1ea7a8[_0x3e67fe(0x237)]&&console['error']('Input:\x20'+_0xa8e0a);const {journeyId:_0x4be0db}=await resolveJourneyIdFromInput(_0xa8e0a,_0x1ea7a8,_0x6f959f),_0x4adc61=await withSpinner('Listing\x20journey\x20activations...',()=>_0x6f959f[_0x3e67fe(0x1d7)][_0x3e67fe(0x165)](_0x4be0db),{'verbose':_0x1ea7a8[_0x3e67fe(0x237)]}),_0x27cb70=_0x4adc61['data'];return console[_0x3e67fe(0x23f)]('Found\x20'+_0x27cb70[_0x3e67fe(0x16c)]+'\x20activation'+(_0x27cb70[_0x3e67fe(0x16c)]!==0x1?'s':'')),await handleSDKOutput(_0x27cb70,_0x1ea7a8),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x23e);['description']=a27_0x2ff97d(0x1a4);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0xea7217){const _0x17bbc9=a27_0x2ff97d,_0xf52eee=_0xea7217[_0x17bbc9(0x1d8)][0x0];let _0x212a9d;if(_0xf52eee){const _0x568684=await resolveTarget({'arg':_0xf52eee,'contextParent':_0xea7217[_0x17bbc9(0x1b9)][_0x17bbc9(0x1f8)],'cwd':process[_0x17bbc9(0x167)]()});isSuccessfulResolution(_0x568684)&&_0x568684[_0x17bbc9(0x218)]==='file'&&(_0x212a9d=_0x568684['filePath']);}const _0x239f7c={..._0xea7217,'options':{..._0xea7217['options'],'journeysOnly':!![],..._0x212a9d&&{'singleFilePath':_0x212a9d}}};return this[_0x17bbc9(0x193)][_0x17bbc9(0x183)](_0x239f7c);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x20b);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x16d);async[a27_0x2ff97d(0x183)](_0x34aaa2){const _0xbb1a3c=a27_0x2ff97d,{options:_0x1b1701,args:_0x66c221,tdx:_0x171819}=_0x34aaa2,_0x3d2095=_0x66c221[0x0];if(!requireNameOrPath(_0x3d2095))return 0x1;if(_0x1b1701[_0xbb1a3c(0x237)])console[_0xbb1a3c(0x23f)]('Input:\x20'+_0x3d2095);const {journeyId:_0x9348f9}=await resolveJourneyIdFromInput(_0x3d2095,_0x1b1701,_0x171819),_0x4deba2=await withSpinner('Listing\x20journey\x20versions...',()=>_0x171819[_0xbb1a3c(0x1d7)][_0xbb1a3c(0x1ad)](_0x9348f9),{'verbose':_0x1b1701[_0xbb1a3c(0x237)]}),{bundleName:_0xdb9179,versions:_0x44260f,latestJourneyId:_0x1b083b}=_0x4deba2[_0xbb1a3c(0x1ed)];console[_0xbb1a3c(0x23f)](_0xdb9179+':\x20'+_0x44260f[_0xbb1a3c(0x16c)]+_0xbb1a3c(0x202)+(_0x44260f[_0xbb1a3c(0x16c)]!==0x1?'s':''));const _0x25cf82=_0x44260f['map'](_0x4d8931=>({'version':_0x4d8931[_0xbb1a3c(0x1bd)],'journey_id':_0x4d8931[_0xbb1a3c(0x1d9)],'name':_0x4d8931[_0xbb1a3c(0x1e0)],'state':_0x4d8931[_0xbb1a3c(0x22f)],'paused':_0x4d8931[_0xbb1a3c(0x243)],'latest':_0x4d8931[_0xbb1a3c(0x1d9)]===_0x1b083b,'created_at':_0x4d8931[_0xbb1a3c(0x25a)]}));return await handleSDKOutput(_0x25cf82,_0x1b1701),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]='journey:version:create';['description']=a27_0x2ff97d(0x1c8);async[a27_0x2ff97d(0x183)](_0x102e59){const _0x11e246=a27_0x2ff97d,{options:_0x37da5a,args:_0x34b852,tdx:_0x2fbfd3}=_0x102e59,_0x62ae68=_0x34b852[0x0];if(!requireNameOrPath(_0x62ae68))return 0x1;if(_0x37da5a[_0x11e246(0x237)])console[_0x11e246(0x23f)](_0x11e246(0x23c)+_0x62ae68);const {journeyId:_0x80b503,journeyName:_0x1e2777}=await resolveJourneyIdFromInput(_0x62ae68,_0x37da5a,_0x2fbfd3);if(!_0x37da5a[_0x11e246(0x1e2)]){const _0x394bc7=await confirm(_0x11e246(0x252)+_0x1e2777+'\x22?');if(!_0x394bc7)return console[_0x11e246(0x23f)]('Cancelled'),0x0;}const _0x1dcf17=await withSpinner(_0x11e246(0x1f4),()=>_0x2fbfd3['journey']['createVersion'](_0x80b503),{'verbose':_0x37da5a['verbose']}),_0x3477e0=_0x1dcf17[_0x11e246(0x1ed)];return console[_0x11e246(0x23f)](a27_0x128894[_0x11e246(0x233)]('✔')+'\x20Created\x20v'+_0x3477e0[_0x11e246(0x238)][_0x11e246(0x1bd)]+_0x11e246(0x17c)+_0x3477e0[_0x11e246(0x238)]['name']+'\x22'),console[_0x11e246(0x23f)](_0x11e246(0x20c)+_0x3477e0['id']),await handleSingleObjectOutput({'id':_0x3477e0['id'],'name':_0x3477e0[_0x11e246(0x238)][_0x11e246(0x1e0)],'version':_0x3477e0['attributes'][_0x11e246(0x1bd)],'state':_0x3477e0['attributes'][_0x11e246(0x22f)],'bundle_id':_0x3477e0[_0x11e246(0x238)][_0x11e246(0x259)],'created_at':_0x3477e0[_0x11e246(0x238)][_0x11e246(0x25a)]},_0x37da5a),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x253);[a27_0x2ff97d(0x1c7)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x2ff97d(0x183)](_0x342d52){const _0x24d6cc=a27_0x2ff97d,{options:_0x2eef61,args:_0x52433b,tdx:_0x520cad}=_0x342d52,_0x1dbee7=_0x52433b[0x0];if(!requireNameOrPath(_0x1dbee7))return 0x1;const _0x1470f3=_0x2eef61['version'];if(!_0x1470f3)return console['error'](_0x24d6cc(0x21e)),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x5dbb0b=parseInt(_0x1470f3,0xa);if(isNaN(_0x5dbb0b)||_0x5dbb0b<0x1)return console[_0x24d6cc(0x23f)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x1470f3),0x1;if(_0x2eef61[_0x24d6cc(0x237)])console[_0x24d6cc(0x23f)](_0x24d6cc(0x23c)+_0x1dbee7+',\x20version:\x20'+_0x5dbb0b);const {journeyId:_0x4d8573,parentSegmentId:_0xfd7dea}=await resolveJourneyIdFromInput(_0x1dbee7,_0x2eef61,_0x520cad),_0x3b7aed=await withSpinner('Resolving\x20version...',()=>_0x520cad[_0x24d6cc(0x1d7)][_0x24d6cc(0x1ad)](_0x4d8573),{'verbose':_0x2eef61['verbose']}),{versions:_0x583b40,latestJourneyId:_0xead98f}=_0x3b7aed['data'],_0x39b22f=_0x583b40[_0x24d6cc(0x1b1)](_0x2e5099=>_0x2e5099[_0x24d6cc(0x1bd)]===_0x5dbb0b);if(!_0x39b22f){const _0x4e68f4=_0x583b40['map'](_0x204ef7=>'v'+_0x204ef7[_0x24d6cc(0x1bd)])[_0x24d6cc(0x19b)](',\x20');return console['error']('Error:\x20Version\x20'+_0x5dbb0b+'\x20not\x20found.\x20Available:\x20'+_0x4e68f4),0x1;}const _0x201960=await withSpinner(_0x24d6cc(0x17b)+_0x5dbb0b+'\x20details...',()=>_0x520cad[_0x24d6cc(0x1d7)][_0x24d6cc(0x186)](_0x39b22f['journeyId']),{'verbose':_0x2eef61['verbose']}),_0x570e50=_0x201960[_0x24d6cc(0x1ed)],_0x5caffe=getConsoleNextUrl(_0x2eef61[_0x24d6cc(0x16e)],_0x24d6cc(0x176)+_0xfd7dea+_0x24d6cc(0x23b)+_0x39b22f['journeyId']+_0x24d6cc(0x1b4));return await handleSingleObjectOutput({'id':_0x570e50['id'],'name':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x1e0)],'version':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x1bd)],'description':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x1c7)],'state':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x22f)],'paused':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x243)],'reentry_mode':_0x570e50['attributes'][_0x24d6cc(0x1d1)],'stages':_0x570e50[_0x24d6cc(0x238)]['journeyStages']?.[_0x24d6cc(0x16c)]||0x0,..._0x570e50[_0x24d6cc(0x238)]['goal']&&{'goal':_0x570e50['attributes'][_0x24d6cc(0x203)]['name']},'latest':_0x39b22f[_0x24d6cc(0x1d9)]===_0xead98f,'created_at':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x25a)],'updated_at':_0x570e50['attributes'][_0x24d6cc(0x242)],'url':_0x5caffe},_0x2eef61),0x0;}}
@@ -1 +1 @@
1
- const a28_0x53cd68=a28_0x24a3;(function(_0x425395,_0x3377be){const _0x1104b0=a28_0x24a3,_0x555322=_0x425395();while(!![]){try{const _0x5643d5=-parseInt(_0x1104b0(0x13e))/0x1+-parseInt(_0x1104b0(0x116))/0x2*(-parseInt(_0x1104b0(0x122))/0x3)+-parseInt(_0x1104b0(0x110))/0x4+parseInt(_0x1104b0(0x136))/0x5+-parseInt(_0x1104b0(0x141))/0x6*(parseInt(_0x1104b0(0x148))/0x7)+parseInt(_0x1104b0(0x13b))/0x8*(-parseInt(_0x1104b0(0x133))/0x9)+-parseInt(_0x1104b0(0x134))/0xa*(-parseInt(_0x1104b0(0x119))/0xb);if(_0x5643d5===_0x3377be)break;else _0x555322['push'](_0x555322['shift']());}catch(_0x2f4538){_0x555322['push'](_0x555322['shift']());}}}(a28_0x48c6,0x64eee));import{BaseCommand}from'./command.js';function a28_0x48c6(){const _0x2b8abe=['40344taVwKv','Validation\x20failed:\x20','execute','636227lECvyW','Validate\x20journey\x20YAML\x20files','error','6JhVzST','filePath','red','✔\x20All\x20','verbose','parentSegment','dim','5316745ZdOioG','1120152VVhale','.yaml','validCount','skippedCount','journey:validate','\x20journey(s)\x20valid','8GozShg','\x20valid','journey','214027BCDPoR','relativePath','type','\x20warning(s)','\x20journey(s)\x20with\x20errors,\x20','green','warnings','\x20segment\x20file(s)\x20skipped)','helpText','419961rcJXkU','reason','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','log','warningCount','name','\x20warning(s)\x20found','yellow','\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','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','hasErrors','endsWith','No\x20journey\x20YAML\x20files\x20found\x20in\x20','valid','length','.yml','\x20error(s)','1341sPXJyt','1160tvTAsS','message','118345yVDDtn','\x20segment\x20file(s)\x20skipped','errors','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','filter'];a28_0x48c6=function(){return _0x2b8abe;};return a28_0x48c6();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a28_0x24a3(_0x344d98,_0x12410c){_0x344d98=_0x344d98-0x110;const _0x48c6e5=a28_0x48c6();let _0x24a39d=_0x48c6e5[_0x344d98];return _0x24a39d;}import a28_0x1732ed from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x53cd68(0x127)]=a28_0x53cd68(0x114);['description']=a28_0x53cd68(0x13f);async[a28_0x53cd68(0x13d)](_0x23ac62){const _0x52c5b0=a28_0x53cd68,{options:_0x56c98e,args:_0x55c1ab}=_0x23ac62,_0x2a4c4b=_0x56c98e,_0x1522a4=await resolveTarget({'arg':_0x55c1ab[0x0],'contextParent':_0x56c98e[_0x52c5b0(0x146)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1522a4))return _0x1522a4['errorCode']==='no_parent'?(console[_0x52c5b0(0x140)](a28_0x1732ed[_0x52c5b0(0x129)](_0x52c5b0(0x124))),console['error'](_0x52c5b0(0x139)),console[_0x52c5b0(0x140)](_0x52c5b0(0x12a)),console[_0x52c5b0(0x140)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x52c5b0(0x140)](a28_0x1732ed['red']('Error:\x20'+_0x1522a4[_0x52c5b0(0x135)]+'\x0a')),_0x1522a4[_0x52c5b0(0x121)]&&console[_0x52c5b0(0x140)](a28_0x1732ed['cyan'](_0x1522a4[_0x52c5b0(0x121)]))),0x1;const _0x309788=_0x1522a4['targetDir'],_0x2a7bb8=_0x1522a4[_0x52c5b0(0x11b)]==='file'?_0x1522a4[_0x52c5b0(0x142)]:undefined;if(!_0x2a7bb8&&!existsSync(_0x309788))return console[_0x52c5b0(0x140)](a28_0x1732ed['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x309788+'\x0a')),0x1;let _0x1a2d51;if(_0x2a7bb8){if(!_0x2a7bb8['endsWith'](_0x52c5b0(0x131))&&!_0x2a7bb8[_0x52c5b0(0x12d)](_0x52c5b0(0x111)))return console[_0x52c5b0(0x140)](a28_0x1732ed['red'](_0x52c5b0(0x12b)+_0x2a7bb8+'\x0a')),0x1;_0x1a2d51=[_0x2a7bb8];}else _0x1a2d51=findYamlFiles(_0x309788);if(_0x1a2d51[_0x52c5b0(0x130)]===0x0)return console['error'](a28_0x1732ed[_0x52c5b0(0x143)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x309788+'\x0a')),0x1;const _0x225686=validateYamlFiles(_0x1a2d51,_0x309788,{'filterType':_0x52c5b0(0x118)}),_0x31de65=calculateSummary(_0x225686),_0x4367e9=_0x225686[_0x52c5b0(0x13a)](isValidationResult);if(_0x4367e9[_0x52c5b0(0x130)]===0x0)return console[_0x52c5b0(0x140)](a28_0x1732ed[_0x52c5b0(0x129)](_0x52c5b0(0x12e)+_0x309788+'\x0a')),_0x31de65['skippedCount']>0x0&&console[_0x52c5b0(0x140)](a28_0x1732ed[_0x52c5b0(0x147)]('('+_0x31de65[_0x52c5b0(0x113)]+_0x52c5b0(0x120))),0x0;for(const _0x2c10c4 of _0x225686){if(!isValidationResult(_0x2c10c4)){_0x2a4c4b[_0x52c5b0(0x145)]&&console[_0x52c5b0(0x125)](a28_0x1732ed[_0x52c5b0(0x147)]('-\x20'+_0x2c10c4[_0x52c5b0(0x11a)]+'\x20(skipped:\x20'+_0x2c10c4[_0x52c5b0(0x123)]+')'));continue;}const {relativePath:_0x497a69,source:_0x3d9aa6,result:_0x2a061c}=_0x2c10c4;if(_0x2a061c[_0x52c5b0(0x12f)]&&_0x2a061c[_0x52c5b0(0x11f)]['length']===0x0)_0x2a4c4b['verbose']&&console['log'](a28_0x1732ed[_0x52c5b0(0x11e)]('✔\x20'+_0x497a69));else _0x2a061c['valid']?(console[_0x52c5b0(0x125)](a28_0x1732ed[_0x52c5b0(0x129)]('⚠\x20'+_0x497a69+':\x20'+_0x2a061c[_0x52c5b0(0x11f)]['length']+_0x52c5b0(0x11c))),console['log'](formatValidationResult(_0x2a061c,_0x3d9aa6,_0x497a69))):(console[_0x52c5b0(0x125)](a28_0x1732ed['red']('✖\x20'+_0x497a69+':\x20'+_0x2a061c[_0x52c5b0(0x138)]['length']+_0x52c5b0(0x132))),console['log'](formatValidationResult(_0x2a061c,_0x3d9aa6,_0x497a69)));}return console[_0x52c5b0(0x125)](''),_0x31de65[_0x52c5b0(0x12c)]?(console['log'](a28_0x1732ed['red'](_0x52c5b0(0x13c)+_0x31de65['invalidCount']+_0x52c5b0(0x11d)+_0x31de65[_0x52c5b0(0x112)]+_0x52c5b0(0x117))),_0x31de65[_0x52c5b0(0x126)]>0x0&&console['log'](a28_0x1732ed[_0x52c5b0(0x129)](_0x31de65[_0x52c5b0(0x126)]+_0x52c5b0(0x128))),_0x31de65[_0x52c5b0(0x113)]>0x0&&console['log'](a28_0x1732ed[_0x52c5b0(0x147)](_0x31de65[_0x52c5b0(0x113)]+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0x52c5b0(0x125)](a28_0x1732ed[_0x52c5b0(0x11e)](_0x52c5b0(0x144)+_0x31de65[_0x52c5b0(0x112)]+_0x52c5b0(0x115))),_0x31de65[_0x52c5b0(0x126)]>0x0&&console[_0x52c5b0(0x125)](a28_0x1732ed[_0x52c5b0(0x129)](_0x31de65[_0x52c5b0(0x126)]+_0x52c5b0(0x128))),_0x31de65[_0x52c5b0(0x113)]>0x0&&console[_0x52c5b0(0x125)](a28_0x1732ed[_0x52c5b0(0x147)](_0x31de65[_0x52c5b0(0x113)]+_0x52c5b0(0x137))),0x0);}}
1
+ const a28_0x3e3d27=a28_0x443a;(function(_0x205f5,_0x33a171){const _0x4a8ae5=a28_0x443a,_0x578e1a=_0x205f5();while(!![]){try{const _0x5a6645=-parseInt(_0x4a8ae5(0xd8))/0x1+parseInt(_0x4a8ae5(0xb9))/0x2+-parseInt(_0x4a8ae5(0xd4))/0x3*(parseInt(_0x4a8ae5(0xb3))/0x4)+-parseInt(_0x4a8ae5(0xc4))/0x5+-parseInt(_0x4a8ae5(0xd6))/0x6+-parseInt(_0x4a8ae5(0xbd))/0x7+parseInt(_0x4a8ae5(0xba))/0x8*(parseInt(_0x4a8ae5(0xb4))/0x9);if(_0x5a6645===_0x33a171)break;else _0x578e1a['push'](_0x578e1a['shift']());}catch(_0x592b92){_0x578e1a['push'](_0x578e1a['shift']());}}}(a28_0x2080,0xc46c5));import{BaseCommand}from'./command.js';function a28_0x443a(_0x118c3b,_0x5de6ca){_0x118c3b=_0x118c3b-0xae;const _0x208007=a28_0x2080();let _0x443a88=_0x208007[_0x118c3b];return _0x443a88;}function a28_0x2080(){const _0x23a99c=['6221256qODCvd','helpText','571438KVANeZ','\x20valid','execute','log','warnings','Validate\x20journey\x20YAML\x20files','valid','yellow','targetDir','red','\x20warning(s)','message','validCount','13324dkIrSP','33257574mxfgut','errorCode','endsWith','description','warningCount','1372664vPGtPW','8VmaXsw','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','hasErrors','5476849SFrvdh','reason','.yml','journey:validate','\x20(skipped:\x20','dim','\x20error(s)','5115645VMqfDN','verbose','Error:\x20','error','length','errors','skippedCount','\x20segment\x20file(s)\x20skipped)','green','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20segment\x20file(s)\x20skipped','\x20warning(s)\x20found','filePath','file','parentSegment','147IhURFc','relativePath'];a28_0x2080=function(){return _0x23a99c;};return a28_0x2080();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x677d2a from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a28_0x3e3d27(0xc0);[a28_0x3e3d27(0xb7)]=a28_0x3e3d27(0xdd);async[a28_0x3e3d27(0xda)](_0x4c6628){const _0x173d91=a28_0x3e3d27,{options:_0x2c92f6,args:_0x11da4f}=_0x4c6628,_0xe874d4=_0x2c92f6,_0x4207dc=await resolveTarget({'arg':_0x11da4f[0x0],'contextParent':_0x2c92f6[_0x173d91(0xd3)],'cwd':process[_0x173d91(0xcd)]()});if(!isSuccessfulResolution(_0x4207dc))return _0x4207dc[_0x173d91(0xb5)]==='no_parent'?(console[_0x173d91(0xc7)](a28_0x677d2a[_0x173d91(0xdf)](_0x173d91(0xbb))),console[_0x173d91(0xc7)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x173d91(0xc7)]('\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['error'](_0x173d91(0xce))):(console[_0x173d91(0xc7)](a28_0x677d2a[_0x173d91(0xaf)](_0x173d91(0xc6)+_0x4207dc[_0x173d91(0xb1)]+'\x0a')),_0x4207dc[_0x173d91(0xd7)]&&console[_0x173d91(0xc7)](a28_0x677d2a['cyan'](_0x4207dc[_0x173d91(0xd7)]))),0x1;const _0x44acfc=_0x4207dc[_0x173d91(0xae)],_0x415ed3=_0x4207dc['type']===_0x173d91(0xd2)?_0x4207dc[_0x173d91(0xd1)]:undefined;if(!_0x415ed3&&!existsSync(_0x44acfc))return console[_0x173d91(0xc7)](a28_0x677d2a['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x44acfc+'\x0a')),0x1;let _0x2b00a7;if(_0x415ed3){if(!_0x415ed3[_0x173d91(0xb6)](_0x173d91(0xbf))&&!_0x415ed3[_0x173d91(0xb6)]('.yaml'))return console[_0x173d91(0xc7)](a28_0x677d2a['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x415ed3+'\x0a')),0x1;_0x2b00a7=[_0x415ed3];}else _0x2b00a7=findYamlFiles(_0x44acfc);if(_0x2b00a7[_0x173d91(0xc8)]===0x0)return console[_0x173d91(0xc7)](a28_0x677d2a['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x44acfc+'\x0a')),0x1;const _0x5b6579=validateYamlFiles(_0x2b00a7,_0x44acfc,{'filterType':'journey'}),_0x194672=calculateSummary(_0x5b6579),_0x5e42be=_0x5b6579['filter'](isValidationResult);if(_0x5e42be[_0x173d91(0xc8)]===0x0)return console[_0x173d91(0xc7)](a28_0x677d2a[_0x173d91(0xdf)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x44acfc+'\x0a')),_0x194672[_0x173d91(0xca)]>0x0&&console[_0x173d91(0xc7)](a28_0x677d2a['dim']('('+_0x194672[_0x173d91(0xca)]+_0x173d91(0xcb))),0x0;for(const _0x10c0f0 of _0x5b6579){if(!isValidationResult(_0x10c0f0)){_0xe874d4[_0x173d91(0xc5)]&&console[_0x173d91(0xdb)](a28_0x677d2a[_0x173d91(0xc2)]('-\x20'+_0x10c0f0[_0x173d91(0xd5)]+_0x173d91(0xc1)+_0x10c0f0[_0x173d91(0xbe)]+')'));continue;}const {relativePath:_0x2cbbe5,source:_0x1b68fb,result:_0x239274}=_0x10c0f0;if(_0x239274[_0x173d91(0xde)]&&_0x239274[_0x173d91(0xdc)][_0x173d91(0xc8)]===0x0)_0xe874d4[_0x173d91(0xc5)]&&console[_0x173d91(0xdb)](a28_0x677d2a[_0x173d91(0xcc)]('✔\x20'+_0x2cbbe5));else _0x239274[_0x173d91(0xde)]?(console[_0x173d91(0xdb)](a28_0x677d2a['yellow']('⚠\x20'+_0x2cbbe5+':\x20'+_0x239274[_0x173d91(0xdc)][_0x173d91(0xc8)]+_0x173d91(0xb0))),console[_0x173d91(0xdb)](formatValidationResult(_0x239274,_0x1b68fb,_0x2cbbe5))):(console[_0x173d91(0xdb)](a28_0x677d2a['red']('✖\x20'+_0x2cbbe5+':\x20'+_0x239274[_0x173d91(0xc9)][_0x173d91(0xc8)]+_0x173d91(0xc3))),console[_0x173d91(0xdb)](formatValidationResult(_0x239274,_0x1b68fb,_0x2cbbe5)));}return console[_0x173d91(0xdb)](''),_0x194672[_0x173d91(0xbc)]?(console[_0x173d91(0xdb)](a28_0x677d2a[_0x173d91(0xaf)]('Validation\x20failed:\x20'+_0x194672['invalidCount']+'\x20journey(s)\x20with\x20errors,\x20'+_0x194672[_0x173d91(0xb2)]+_0x173d91(0xd9))),_0x194672['warningCount']>0x0&&console['log'](a28_0x677d2a[_0x173d91(0xdf)](_0x194672['warningCount']+_0x173d91(0xd0))),_0x194672[_0x173d91(0xca)]>0x0&&console['log'](a28_0x677d2a['dim'](_0x194672[_0x173d91(0xca)]+_0x173d91(0xcf))),0x1):(console[_0x173d91(0xdb)](a28_0x677d2a[_0x173d91(0xcc)]('✔\x20All\x20'+_0x194672['validCount']+'\x20journey(s)\x20valid')),_0x194672['warningCount']>0x0&&console[_0x173d91(0xdb)](a28_0x677d2a['yellow'](_0x194672[_0x173d91(0xb8)]+'\x20warning(s)\x20found')),_0x194672[_0x173d91(0xca)]>0x0&&console[_0x173d91(0xdb)](a28_0x677d2a[_0x173d91(0xc2)](_0x194672[_0x173d91(0xca)]+_0x173d91(0xcf))),0x0);}}