@treasuredata/tdx 2026.3.36 → 2026.3.37

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 (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.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/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x6493bb=a26_0x5503;(function(_0xfde547,_0x10392f){const _0x2aac39=a26_0x5503,_0x45120b=_0xfde547();while(!![]){try{const _0x18fec7=parseInt(_0x2aac39(0x212))/0x1+-parseInt(_0x2aac39(0x1ed))/0x2*(-parseInt(_0x2aac39(0x1fd))/0x3)+parseInt(_0x2aac39(0x1e5))/0x4*(-parseInt(_0x2aac39(0x20e))/0x5)+parseInt(_0x2aac39(0x1f2))/0x6*(-parseInt(_0x2aac39(0x1f9))/0x7)+parseInt(_0x2aac39(0x1ff))/0x8+-parseInt(_0x2aac39(0x206))/0x9+parseInt(_0x2aac39(0x20c))/0xa;if(_0x18fec7===_0x10392f)break;else _0x45120b['push'](_0x45120b['shift']());}catch(_0x31a41a){_0x45120b['push'](_0x45120b['shift']());}}}(a26_0x3c17,0x99e92));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x3cca94 from'chalk';function a26_0x5503(_0x279ab9,_0x355fb0){_0x279ab9=_0x279ab9-0x1e3;const _0x3c1792=a26_0x3c17();let _0x5503ba=_0x3c1792[_0x279ab9];return _0x5503ba;}import a26_0xcffe4f from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a26_0x3c17(){const _0x3fce76=['\x20valid','✔\x20All\x20','cwd','4iSSLMc','\x20non-template\x20file(s)\x20skipped)','.yml','Error:\x20Directory\x20not\x20found:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','skippedCount','green','invalidCount','4NxzILJ','\x20warning(s)\x20found','engage:template:validate','\x20(skipped:\x20','length','6DycnKf','description','red','dim','\x20template(s)\x20valid','resolve','yellow','1493282DmolJh','reason','relativePath','\x20non-template\x20file(s)\x20skipped','1061745wRcxKa','execute','1570304xhBzCN','error','dirname','\x20warning(s)','warnings','endsWith','\x20template(s)\x20with\x20errors,\x20','9143064mXbJsF','\x20error(s)','template','log','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','verbose','9204120QfTXVz','validCount','2690735udYrKy','errors','valid','.yaml','573257JZzBdG','filter'];a26_0x3c17=function(){return _0x3fce76;};return a26_0x3c17();}export class EngageTemplateValidateCommand extends BaseCommand{['name']=a26_0x6493bb(0x1ef);[a26_0x6493bb(0x1f3)]='Validate\x20template\x20YAML\x20files';async[a26_0x6493bb(0x1fe)](_0x4d3377){const _0xc056d5=a26_0x6493bb,{options:_0x57fa4d,args:_0x64518a}=_0x4d3377,_0x7f2e4d=_0x57fa4d,_0x58cf49=_0x64518a[0x0],_0xa71402=_0x58cf49?a26_0xcffe4f[_0xc056d5(0x1f7)](_0x58cf49):undefined,_0x1b71d4=_0xa71402?isYamlFile(_0xa71402):![];let _0xf82a37,_0x1eaecc;if(_0x1b71d4&&_0xa71402)_0xf82a37=a26_0xcffe4f[_0xc056d5(0x201)](_0xa71402),_0x1eaecc=_0xa71402;else _0xa71402?_0xf82a37=_0xa71402:_0xf82a37=process[_0xc056d5(0x1e4)]();if(!_0x1eaecc&&!existsSync(_0xf82a37))return console[_0xc056d5(0x200)](a26_0x3cca94[_0xc056d5(0x1f4)](_0xc056d5(0x1e8)+_0xf82a37+'\x0a')),0x1;let _0x324662;if(_0x1eaecc){if(!_0x1eaecc['endsWith'](_0xc056d5(0x1e7))&&!_0x1eaecc[_0xc056d5(0x204)](_0xc056d5(0x211)))return console[_0xc056d5(0x200)](a26_0x3cca94[_0xc056d5(0x1f4)](_0xc056d5(0x1e9)+_0x1eaecc+'\x0a')),0x1;_0x324662=[_0x1eaecc];}else _0x324662=findYamlFiles(_0xf82a37);if(_0x324662['length']===0x0)return console[_0xc056d5(0x200)](a26_0x3cca94['red'](_0xc056d5(0x20a)+_0xf82a37+'\x0a')),0x1;const _0x411ac2=validateYamlFiles(_0x324662,_0xf82a37,{'filterType':_0xc056d5(0x208)}),_0xda445f=calculateSummary(_0x411ac2),_0x3cda7f=_0x411ac2[_0xc056d5(0x213)](isValidationResult);if(_0x3cda7f['length']===0x0)return console[_0xc056d5(0x200)](a26_0x3cca94[_0xc056d5(0x1f8)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0xf82a37+'\x0a')),_0xda445f[_0xc056d5(0x1ea)]>0x0&&console[_0xc056d5(0x200)](a26_0x3cca94[_0xc056d5(0x1f5)]('('+_0xda445f[_0xc056d5(0x1ea)]+_0xc056d5(0x1e6))),0x0;for(const _0x3be4a4 of _0x411ac2){if(!isValidationResult(_0x3be4a4)){_0x7f2e4d[_0xc056d5(0x20b)]&&console[_0xc056d5(0x209)](a26_0x3cca94[_0xc056d5(0x1f5)]('-\x20'+_0x3be4a4[_0xc056d5(0x1fb)]+_0xc056d5(0x1f0)+_0x3be4a4[_0xc056d5(0x1fa)]+')'));continue;}const {relativePath:_0x4a6800,source:_0x3772af,result:_0x3faab3}=_0x3be4a4;if(_0x3faab3[_0xc056d5(0x210)]&&_0x3faab3[_0xc056d5(0x203)][_0xc056d5(0x1f1)]===0x0)_0x7f2e4d[_0xc056d5(0x20b)]&&console['log'](a26_0x3cca94['green']('✔\x20'+_0x4a6800));else _0x3faab3['valid']?(console[_0xc056d5(0x209)](a26_0x3cca94[_0xc056d5(0x1f8)]('⚠\x20'+_0x4a6800+':\x20'+_0x3faab3['warnings'][_0xc056d5(0x1f1)]+_0xc056d5(0x202))),console[_0xc056d5(0x209)](formatValidationResult(_0x3faab3,_0x3772af,_0x4a6800))):(console[_0xc056d5(0x209)](a26_0x3cca94['red']('✖\x20'+_0x4a6800+':\x20'+_0x3faab3[_0xc056d5(0x20f)][_0xc056d5(0x1f1)]+_0xc056d5(0x207))),console[_0xc056d5(0x209)](formatValidationResult(_0x3faab3,_0x3772af,_0x4a6800)));}return console[_0xc056d5(0x209)](''),_0xda445f['hasErrors']?(console[_0xc056d5(0x209)](a26_0x3cca94['red']('Validation\x20failed:\x20'+_0xda445f[_0xc056d5(0x1ec)]+_0xc056d5(0x205)+_0xda445f['validCount']+_0xc056d5(0x214))),_0xda445f['warningCount']>0x0&&console[_0xc056d5(0x209)](a26_0x3cca94[_0xc056d5(0x1f8)](_0xda445f['warningCount']+_0xc056d5(0x1ee))),_0xda445f['skippedCount']>0x0&&console[_0xc056d5(0x209)](a26_0x3cca94[_0xc056d5(0x1f5)](_0xda445f[_0xc056d5(0x1ea)]+_0xc056d5(0x1fc))),0x1):(console['log'](a26_0x3cca94[_0xc056d5(0x1eb)](_0xc056d5(0x1e3)+_0xda445f[_0xc056d5(0x20d)]+_0xc056d5(0x1f6))),_0xda445f['warningCount']>0x0&&console[_0xc056d5(0x209)](a26_0x3cca94[_0xc056d5(0x1f8)](_0xda445f['warningCount']+_0xc056d5(0x1ee))),_0xda445f['skippedCount']>0x0&&console['log'](a26_0x3cca94['dim'](_0xda445f[_0xc056d5(0x1ea)]+_0xc056d5(0x1fc))),0x0);}}
1
+ const a26_0xb660cc=a26_0x24eb;(function(_0x399c9e,_0x2336d3){const _0xf552ed=a26_0x24eb,_0xc5bae4=_0x399c9e();while(!![]){try{const _0x1d768b=-parseInt(_0xf552ed(0xac))/0x1+parseInt(_0xf552ed(0xab))/0x2+parseInt(_0xf552ed(0x9a))/0x3*(-parseInt(_0xf552ed(0xc2))/0x4)+parseInt(_0xf552ed(0xad))/0x5*(parseInt(_0xf552ed(0x97))/0x6)+parseInt(_0xf552ed(0xaf))/0x7+parseInt(_0xf552ed(0x99))/0x8*(-parseInt(_0xf552ed(0xa6))/0x9)+parseInt(_0xf552ed(0x94))/0xa;if(_0x1d768b===_0x2336d3)break;else _0xc5bae4['push'](_0xc5bae4['shift']());}catch(_0x3e7cde){_0xc5bae4['push'](_0xc5bae4['shift']());}}}(a26_0x2abe,0xbd4a7));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x561c85 from'chalk';function a26_0x24eb(_0x1a7ea1,_0x1a75c8){_0x1a7ea1=_0x1a7ea1-0x93;const _0x2abee9=a26_0x2abe();let _0x24ebf6=_0x2abee9[_0x1a7ea1];return _0x24ebf6;}import a26_0x6c3a01 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a26_0x2abe(){const _0x46e792=['1056YXeROg','warnings','green','\x20template(s)\x20with\x20errors,\x20','2878450fSLBKj','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found','129174gCtGWt','\x20error(s)','8sMXrQe','4149lKfblg','dim','resolve','validCount','\x20non-template\x20file(s)\x20skipped)','error','red','Error:\x20Directory\x20not\x20found:\x20','length','\x20template(s)\x20valid','Validate\x20template\x20YAML\x20files','.yml','6024933IwbsVk','\x20non-template\x20file(s)\x20skipped','\x20valid','hasErrors','log','1735878BVXTUY','103174MiMFBG','105JwqzYJ','.yaml','2136155wyYIXz','reason','dirname','valid','Validation\x20failed:\x20','✔\x20All\x20','skippedCount','name','verbose','template','description','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','warningCount','yellow','endsWith','\x20warning(s)','execute','errors','filter'];a26_0x2abe=function(){return _0x46e792;};return a26_0x2abe();}export class EngageTemplateValidateCommand extends BaseCommand{[a26_0xb660cc(0xb6)]='engage:template:validate';[a26_0xb660cc(0xb9)]=a26_0xb660cc(0xa4);async[a26_0xb660cc(0xbf)](_0xf29f71){const _0x388404=a26_0xb660cc,{options:_0x23a2dc,args:_0x570d11}=_0xf29f71,_0x479442=_0x23a2dc,_0x81aae2=_0x570d11[0x0],_0x229593=_0x81aae2?a26_0x6c3a01[_0x388404(0x9c)](_0x81aae2):undefined,_0x242cfc=_0x229593?isYamlFile(_0x229593):![];let _0x38fcea,_0x3f0c07;if(_0x242cfc&&_0x229593)_0x38fcea=a26_0x6c3a01[_0x388404(0xb1)](_0x229593),_0x3f0c07=_0x229593;else _0x229593?_0x38fcea=_0x229593:_0x38fcea=process['cwd']();if(!_0x3f0c07&&!existsSync(_0x38fcea))return console[_0x388404(0x9f)](a26_0x561c85[_0x388404(0xa0)](_0x388404(0xa1)+_0x38fcea+'\x0a')),0x1;let _0x2c4f59;if(_0x3f0c07){if(!_0x3f0c07[_0x388404(0xbd)](_0x388404(0xa5))&&!_0x3f0c07['endsWith'](_0x388404(0xae)))return console[_0x388404(0x9f)](a26_0x561c85[_0x388404(0xa0)](_0x388404(0xba)+_0x3f0c07+'\x0a')),0x1;_0x2c4f59=[_0x3f0c07];}else _0x2c4f59=findYamlFiles(_0x38fcea);if(_0x2c4f59[_0x388404(0xa2)]===0x0)return console[_0x388404(0x9f)](a26_0x561c85[_0x388404(0xa0)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x38fcea+'\x0a')),0x1;const _0x28d9fa=validateYamlFiles(_0x2c4f59,_0x38fcea,{'filterType':_0x388404(0xb8)}),_0x4f97c0=calculateSummary(_0x28d9fa),_0x5d888f=_0x28d9fa[_0x388404(0xc1)](isValidationResult);if(_0x5d888f[_0x388404(0xa2)]===0x0)return console[_0x388404(0x9f)](a26_0x561c85['yellow'](_0x388404(0x95)+_0x38fcea+'\x0a')),_0x4f97c0[_0x388404(0xb5)]>0x0&&console[_0x388404(0x9f)](a26_0x561c85[_0x388404(0x9b)]('('+_0x4f97c0[_0x388404(0xb5)]+_0x388404(0x9e))),0x0;for(const _0x168f85 of _0x28d9fa){if(!isValidationResult(_0x168f85)){_0x479442[_0x388404(0xb7)]&&console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0x9b)]('-\x20'+_0x168f85['relativePath']+'\x20(skipped:\x20'+_0x168f85[_0x388404(0xb0)]+')'));continue;}const {relativePath:_0x361aaf,source:_0xaea91a,result:_0x343be9}=_0x168f85;if(_0x343be9[_0x388404(0xb2)]&&_0x343be9[_0x388404(0xc3)][_0x388404(0xa2)]===0x0)_0x479442[_0x388404(0xb7)]&&console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xc4)]('✔\x20'+_0x361aaf));else _0x343be9['valid']?(console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xbc)]('⚠\x20'+_0x361aaf+':\x20'+_0x343be9[_0x388404(0xc3)][_0x388404(0xa2)]+_0x388404(0xbe))),console[_0x388404(0xaa)](formatValidationResult(_0x343be9,_0xaea91a,_0x361aaf))):(console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xa0)]('✖\x20'+_0x361aaf+':\x20'+_0x343be9[_0x388404(0xc0)][_0x388404(0xa2)]+_0x388404(0x98))),console[_0x388404(0xaa)](formatValidationResult(_0x343be9,_0xaea91a,_0x361aaf)));}return console['log'](''),_0x4f97c0[_0x388404(0xa9)]?(console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xa0)](_0x388404(0xb3)+_0x4f97c0['invalidCount']+_0x388404(0x93)+_0x4f97c0[_0x388404(0x9d)]+_0x388404(0xa8))),_0x4f97c0[_0x388404(0xbb)]>0x0&&console['log'](a26_0x561c85['yellow'](_0x4f97c0[_0x388404(0xbb)]+_0x388404(0x96))),_0x4f97c0['skippedCount']>0x0&&console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0x9b)](_0x4f97c0[_0x388404(0xb5)]+_0x388404(0xa7))),0x1):(console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xc4)](_0x388404(0xb4)+_0x4f97c0[_0x388404(0x9d)]+_0x388404(0xa3))),_0x4f97c0['warningCount']>0x0&&console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xbc)](_0x4f97c0[_0x388404(0xbb)]+_0x388404(0x96))),_0x4f97c0[_0x388404(0xb5)]>0x0&&console['log'](a26_0x561c85[_0x388404(0x9b)](_0x4f97c0[_0x388404(0xb5)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
@@ -1 +1 @@
1
- const a27_0x151d54=a27_0x968c;(function(_0xb29082,_0x27ddff){const _0x56a1b2=a27_0x968c,_0x4e372f=_0xb29082();while(!![]){try{const _0xf3b694=parseInt(_0x56a1b2(0x1b6))/0x1+-parseInt(_0x56a1b2(0x19f))/0x2+parseInt(_0x56a1b2(0x1ae))/0x3+-parseInt(_0x56a1b2(0x1b3))/0x4*(-parseInt(_0x56a1b2(0x1ac))/0x5)+parseInt(_0x56a1b2(0x19d))/0x6*(-parseInt(_0x56a1b2(0x180))/0x7)+parseInt(_0x56a1b2(0x196))/0x8+parseInt(_0x56a1b2(0x1aa))/0x9;if(_0xf3b694===_0x27ddff)break;else _0x4e372f['push'](_0x4e372f['shift']());}catch(_0x26c310){_0x4e372f['push'](_0x4e372f['shift']());}}}(a27_0x2299,0x3cdeb));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';function a27_0x968c(_0x21c7d4,_0x1abe3b){_0x21c7d4=_0x21c7d4-0x17d;const _0x229982=a27_0x2299();let _0x968cde=_0x229982[_0x21c7d4];return _0x968cde;}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x3f4e30 from'chalk';function formatDuration(_0x35d470){const _0x41b39a=a27_0x968c;if(_0x35d470<0x3c)return _0x35d470+'s';if(_0x35d470<0xe10)return Math[_0x41b39a(0x1c1)](_0x35d470/0x3c)+'m\x20'+_0x35d470%0x3c+'s';const _0x220423=Math[_0x41b39a(0x1c1)](_0x35d470/0xe10),_0x4e5be0=Math['floor'](_0x35d470%0xe10/0x3c);return _0x4e5be0>0x0?_0x220423+'h\x20'+_0x4e5be0+'m':_0x220423+'h';}function a27_0x2299(){const _0x4c6323=['kill','yes','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','h\x20ago','green','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','1793673zBSHRL','dim','35hnYzMM','d\x20ago','902985Eyxqag','\x20jobs','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','jobs','\x20\x20Job\x20ID:\x20','41020NGwIcN','join','query','201543zCghMb','job:submit','Get\x20job\x20results','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','presto','success','status','Job\x20type:\x20','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','jobType','floor','verbose','execute','Limit:\x20','database','✔\x20Job\x20submitted','Database:\x20','error','Cancelled','List\x20jobs','\x20row','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','job:kill','list','job_id','job:result','log','Show\x20job\x20details','validate','Query:\x20','file','283269aODBrg','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','map','hive','Getting\x20job\x20details...','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','end_at','red','name','round','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','start_at','push','url','Submit\x20a\x20job','Kill\x20a\x20job','information_schema','length','user_name','data','type','Listing\x20jobs...','1221064tnTrSk','\x20job','just\x20now','result','getTime','args','trino','42gTnxQW','limit','787322psXSZV','abs','created_at','...','description'];a27_0x2299=function(){return _0x4c6323;};return a27_0x2299();}function formatRelativeTime(_0x10c6e3){const _0x34abce=a27_0x968c,_0x56646d=Date['now']()-_0x10c6e3[_0x34abce(0x19a)](),_0x2194a6=Math['floor'](Math[_0x34abce(0x1a0)](_0x56646d)/0x3e8);if(_0x2194a6<0x3c)return _0x34abce(0x198);const _0xea6458=Math[_0x34abce(0x1c1)](_0x2194a6/0x3c);if(_0xea6458<0x3c)return _0xea6458+'m\x20ago';const _0x3ce51a=Math['floor'](_0xea6458/0x3c);if(_0x3ce51a<0x18)return _0x3ce51a+_0x34abce(0x1a7);const _0xab07d7=Math[_0x34abce(0x1c1)](_0x3ce51a/0x18);if(_0xab07d7<0x1e)return _0xab07d7+_0x34abce(0x1ad);return Math[_0x34abce(0x1c1)](_0xab07d7/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{['name']='jobs';[a27_0x151d54(0x1a3)]=a27_0x151d54(0x1ca);async[a27_0x151d54(0x1c3)](_0x3b2f37){const _0x58f2a5=a27_0x151d54,{options:_0x2d103d,tdx:_0x3426b7}=_0x3b2f37,_0x383f17=resolveLimit(_0x2d103d[_0x58f2a5(0x19e)],DEFAULT_DISPLAY_LIMIT),_0x2677a5=_0x2d103d[_0x58f2a5(0x1bd)];_0x2d103d[_0x58f2a5(0x1c2)]&&(console['error'](_0x58f2a5(0x1c4)+_0x383f17+_0x58f2a5(0x1af)),_0x2677a5&&console[_0x58f2a5(0x1c8)]('Status\x20filter:\x20'+_0x2677a5));const _0x13013b=await withSpinner(_0x58f2a5(0x195),()=>_0x3426b7[_0x58f2a5(0x1b1)][_0x58f2a5(0x1ce)]({'from':0x0,'to':_0x383f17-0x1,'status':_0x2677a5}),{'verbose':_0x2d103d[_0x58f2a5(0x1c2)]}),_0x1caf72=_0x13013b[_0x58f2a5(0x193)];console[_0x58f2a5(0x1c8)]('✔\x20Found\x20'+_0x1caf72[_0x58f2a5(0x191)]+_0x58f2a5(0x197)+(_0x1caf72['length']!==0x1?'s':''));const _0x30840b=_0x2d103d['site'];if(isStructuredFormat(_0x2d103d)){const _0x421bd2=_0x1caf72[_0x58f2a5(0x182)](_0x341134=>{const _0x42f6d3=_0x58f2a5;let _0x5d6818;if(_0x341134[_0x42f6d3(0x18b)]&&_0x341134['end_at']){const _0x5a2c9c=new Date(_0x341134['start_at'])[_0x42f6d3(0x19a)](),_0x2ac9e2=new Date(_0x341134[_0x42f6d3(0x186)])['getTime']();_0x5d6818=Math['round']((_0x2ac9e2-_0x5a2c9c)/0x3e8);}return{'job_id':_0x341134[_0x42f6d3(0x1cf)],'type':_0x341134[_0x42f6d3(0x194)]===_0x42f6d3(0x1bb)?_0x42f6d3(0x19c):_0x341134[_0x42f6d3(0x194)],'status':_0x341134[_0x42f6d3(0x1bd)],'user_name':_0x341134[_0x42f6d3(0x192)],'duration_sec':_0x5d6818,'created_at':_0x341134[_0x42f6d3(0x1a1)],'started_at':_0x341134[_0x42f6d3(0x18b)],'end_at':_0x341134[_0x42f6d3(0x186)]};});await handleSDKOutput(_0x421bd2,_0x2d103d);}else for(const _0x4066b3 of _0x1caf72){const _0x21972a=_0x4066b3['status']===_0x58f2a5(0x1bc)?a27_0x3f4e30[_0x58f2a5(0x1a8)]:_0x4066b3[_0x58f2a5(0x1bd)]===_0x58f2a5(0x1c8)?a27_0x3f4e30[_0x58f2a5(0x187)]:a27_0x3f4e30[_0x58f2a5(0x1ab)],_0x3d25ed=_0x21972a(_0x4066b3['status']),_0x3a5f4f=getJobUrl(_0x30840b,_0x4066b3['job_id']),_0x2ad8a5=hyperlink(_0x4066b3['job_id'],_0x3a5f4f),_0x5de49d=a27_0x3f4e30['dim'](_0x4066b3[_0x58f2a5(0x194)]===_0x58f2a5(0x1bb)?_0x58f2a5(0x19c):_0x4066b3['type']),_0x1d4e00=[];if(_0x4066b3[_0x58f2a5(0x18b)]&&_0x4066b3[_0x58f2a5(0x186)]){const _0x2bc2ac=Math[_0x58f2a5(0x189)]((new Date(_0x4066b3[_0x58f2a5(0x186)])[_0x58f2a5(0x19a)]()-new Date(_0x4066b3[_0x58f2a5(0x18b)])[_0x58f2a5(0x19a)]())/0x3e8);_0x1d4e00[_0x58f2a5(0x18c)](formatDuration(_0x2bc2ac));}if(_0x4066b3['end_at'])_0x1d4e00[_0x58f2a5(0x18c)](formatRelativeTime(new Date(_0x4066b3['end_at'])));else _0x4066b3[_0x58f2a5(0x18b)]&&_0x1d4e00[_0x58f2a5(0x18c)](formatRelativeTime(new Date(_0x4066b3[_0x58f2a5(0x18b)])));const _0x196919=_0x1d4e00['length']>0x0?a27_0x3f4e30[_0x58f2a5(0x1ab)]('\x20'+_0x1d4e00[_0x58f2a5(0x1b4)](',\x20')):'';console[_0x58f2a5(0x1d1)]('⚡\x20'+_0x2ad8a5+'\x20'+_0x5de49d+'\x20'+_0x3d25ed+_0x196919);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']='job:show';[a27_0x151d54(0x1a3)]=a27_0x151d54(0x1d2);[a27_0x151d54(0x17d)](_0x2b4909){const _0x31f319=a27_0x151d54,_0x2af354=_0x2b4909[_0x31f319(0x19b)][0x0];if(!_0x2af354)return _0x31f319(0x18a);return undefined;}async[a27_0x151d54(0x1c3)](_0x54b842){const _0x1bd36=a27_0x151d54,{options:_0x10b968,args:_0x37d8ee,tdx:_0x38a42f}=_0x54b842,_0x385fcb=_0x37d8ee[0x0],_0x3994a8=await withSpinner(_0x1bd36(0x184),()=>_0x38a42f['jobs']['show'](_0x385fcb),{'verbose':_0x10b968[_0x1bd36(0x1c2)]}),_0x326408=_0x3994a8[_0x1bd36(0x193)];let _0x416107;if(_0x326408[_0x1bd36(0x18b)]&&_0x326408[_0x1bd36(0x186)]){const _0xadece9=new Date(_0x326408['start_at'])[_0x1bd36(0x19a)](),_0x3e6b86=new Date(_0x326408[_0x1bd36(0x186)])[_0x1bd36(0x19a)]();_0x416107=Math['round']((_0x3e6b86-_0xadece9)/0x3e8);}const _0x5c6d45={'job_id':_0x326408[_0x1bd36(0x1cf)],'type':_0x326408[_0x1bd36(0x194)],'status':_0x326408[_0x1bd36(0x1bd)],..._0x326408['user_name']&&{'user_name':_0x326408[_0x1bd36(0x192)]},..._0x416107!==undefined&&{'duration_sec':_0x416107},..._0x326408[_0x1bd36(0x1a1)]&&{'created_at':_0x326408[_0x1bd36(0x1a1)]},..._0x326408['start_at']&&{'started_at':_0x326408[_0x1bd36(0x18b)]},..._0x326408[_0x1bd36(0x186)]&&{'end_at':_0x326408[_0x1bd36(0x186)]},..._0x326408[_0x1bd36(0x1c5)]&&{'database':_0x326408[_0x1bd36(0x1c5)]},..._0x326408['priority']!==undefined&&{'priority':_0x326408['priority']},..._0x326408[_0x1bd36(0x18d)]&&{'url':_0x326408[_0x1bd36(0x18d)]},..._0x326408[_0x1bd36(0x1b5)]&&{'query':_0x326408['query']},..._0x326408['debug']&&{'debug':_0x326408['debug']}};return await handleSingleObjectOutput(_0x5c6d45,_0x10b968),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x151d54(0x188)]=a27_0x151d54(0x1cd);[a27_0x151d54(0x1a3)]=a27_0x151d54(0x18f);[a27_0x151d54(0x17d)](_0xa102b0){const _0x4cee40=a27_0x151d54,_0xc87970=_0xa102b0[_0x4cee40(0x19b)][0x0];if(!_0xc87970)return _0x4cee40(0x1ba);return undefined;}async[a27_0x151d54(0x1c3)](_0x574f45){const _0x377000=a27_0x151d54,{options:_0x2183aa,args:_0xcc20f0,tdx:_0x50c0e7}=_0x574f45,_0x4aebc4=_0xcc20f0[0x0];if(!_0x2183aa[_0x377000(0x1a5)]){const _0x528702=await confirm(_0x377000(0x181)+_0x4aebc4+'?');if(!_0x528702)return console[_0x377000(0x1c8)](_0x377000(0x1c9)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x50c0e7[_0x377000(0x1b1)][_0x377000(0x1a4)](_0x4aebc4),{'verbose':_0x2183aa['verbose']}),console[_0x377000(0x1c8)](_0x377000(0x1bf)+_0x4aebc4),console[_0x377000(0x1c8)](_0x377000(0x1cc)+_0x4aebc4+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a27_0x151d54(0x1b7);[a27_0x151d54(0x1a3)]=a27_0x151d54(0x18e);async[a27_0x151d54(0x1c3)](_0x9b460){const _0x418757=a27_0x151d54,{options:_0x3f25dc,args:_0x3da80a,tdx:_0x4c6054}=_0x9b460,_0x542b33=_0x3f25dc[_0x418757(0x1c0)]||_0x418757(0x19c),_0x2d5c6f=_0x3f25dc[_0x418757(0x17f)],_0x3ddac9=_0x3f25dc['database']||_0x418757(0x190),_0x462183=_0x3f25dc[_0x418757(0x199)];if(_0x542b33!==_0x418757(0x19c)&&_0x542b33!==_0x418757(0x183))throw new SDKError(ErrorCode[_0x418757(0x1b9)],_0x418757(0x1b0));let _0x38f5;if(_0x2d5c6f){if(_0x3da80a[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x418757(0x1a6));const _0x46e904=readSqlStatementsFromFile(_0x2d5c6f);if(_0x46e904[_0x418757(0x191)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x46e904[_0x418757(0x191)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x38f5=_0x46e904[0x0];}else{if(!_0x3da80a[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x418757(0x185));_0x38f5=_0x3da80a[0x0];}_0x3f25dc[_0x418757(0x1c2)]&&(console[_0x418757(0x1c8)](_0x418757(0x1be)+_0x542b33),console[_0x418757(0x1c8)](_0x418757(0x1c7)+_0x3ddac9),console[_0x418757(0x1c8)](_0x418757(0x17e)+_0x38f5['substring'](0x0,0x64)+(_0x38f5[_0x418757(0x191)]>0x64?_0x418757(0x1a2):'')));const _0x7f9a07=await withSpinner('Submitting\x20job...',()=>_0x4c6054['jobs']['submit'](_0x3ddac9,_0x38f5,_0x542b33,_0x462183),{'verbose':_0x3f25dc[_0x418757(0x1c2)]}),_0x3f3353=_0x7f9a07['data'];return console[_0x418757(0x1c8)](_0x418757(0x1c6)),console['error'](_0x418757(0x1b2)+_0x3f3353['job_id']),await handleSDKOutput([_0x3f3353],_0x3f25dc),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a27_0x151d54(0x1d0);['description']=a27_0x151d54(0x1b8);['validate'](_0x47b536){const _0x4e2ad8=a27_0x151d54,_0x1b328d=_0x47b536[_0x4e2ad8(0x19b)][0x0];if(!_0x1b328d)return _0x4e2ad8(0x1a9);return undefined;}async[a27_0x151d54(0x1c3)](_0x5a8511){const _0xbbc1d2=a27_0x151d54,{options:_0x5c147c,args:_0x5bf70c,tdx:_0x31e85d}=_0x5a8511,_0x361460=_0x5bf70c[0x0],_0x24ae9d=await withSpinner('Getting\x20job\x20results...',()=>_0x31e85d[_0xbbc1d2(0x1b1)][_0xbbc1d2(0x199)](_0x361460),{'verbose':_0x5c147c['verbose']}),_0x10efe3=_0x24ae9d[_0xbbc1d2(0x193)];return console[_0xbbc1d2(0x1c8)]('✔\x20Retrieved\x20'+_0x10efe3[_0xbbc1d2(0x191)]+_0xbbc1d2(0x1cb)+(_0x10efe3[_0xbbc1d2(0x191)]!==0x1?'s':'')),await handleSDKOutput(_0x10efe3,_0x5c147c),0x0;}}
1
+ const a27_0x39ba4c=a27_0x497c;(function(_0x42c8f3,_0x577c84){const _0x2635f1=a27_0x497c,_0x54adf4=_0x42c8f3();while(!![]){try{const _0x12a23d=-parseInt(_0x2635f1(0x13c))/0x1+parseInt(_0x2635f1(0x11b))/0x2+-parseInt(_0x2635f1(0x130))/0x3+-parseInt(_0x2635f1(0xec))/0x4+-parseInt(_0x2635f1(0xf9))/0x5+parseInt(_0x2635f1(0x13d))/0x6+-parseInt(_0x2635f1(0xf7))/0x7*(-parseInt(_0x2635f1(0xf4))/0x8);if(_0x12a23d===_0x577c84)break;else _0x54adf4['push'](_0x54adf4['shift']());}catch(_0x15fcd1){_0x54adf4['push'](_0x54adf4['shift']());}}}(a27_0x49e7,0x9217b));function a27_0x497c(_0x144fff,_0x4f18b4){_0x144fff=_0x144fff-0xe6;const _0x49e794=a27_0x49e7();let _0x497c59=_0x49e794[_0x144fff];return _0x497c59;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0xe4d50b from'chalk';function formatDuration(_0x456331){const _0x46f810=a27_0x497c;if(_0x456331<0x3c)return _0x456331+'s';if(_0x456331<0xe10)return Math['floor'](_0x456331/0x3c)+'m\x20'+_0x456331%0x3c+'s';const _0x50a4cc=Math['floor'](_0x456331/0xe10),_0x4997b8=Math[_0x46f810(0xed)](_0x456331%0xe10/0x3c);return _0x4997b8>0x0?_0x50a4cc+'h\x20'+_0x4997b8+'m':_0x50a4cc+'h';}function formatRelativeTime(_0xbb6fce){const _0x965938=a27_0x497c,_0x5a7301=Date['now']()-_0xbb6fce[_0x965938(0x116)](),_0x25584d=Math[_0x965938(0xed)](Math[_0x965938(0x12d)](_0x5a7301)/0x3e8);if(_0x25584d<0x3c)return _0x965938(0x10d);const _0x43b062=Math[_0x965938(0xed)](_0x25584d/0x3c);if(_0x43b062<0x3c)return _0x43b062+_0x965938(0x119);const _0x2ffa30=Math[_0x965938(0xed)](_0x43b062/0x3c);if(_0x2ffa30<0x18)return _0x2ffa30+_0x965938(0x115);const _0x5516e7=Math[_0x965938(0xed)](_0x2ffa30/0x18);if(_0x5516e7<0x1e)return _0x5516e7+_0x965938(0x137);return Math[_0x965938(0xed)](_0x5516e7/0x1e)+_0x965938(0x10a);}export class JobListCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]='jobs';['description']=a27_0x39ba4c(0xfa);async[a27_0x39ba4c(0xe6)](_0x3ad46c){const _0x2c00e6=a27_0x39ba4c,{options:_0x197c04,tdx:_0x44195a}=_0x3ad46c,_0x52636b=resolveLimit(_0x197c04[_0x2c00e6(0xfe)],DEFAULT_DISPLAY_LIMIT),_0x3e6921=_0x197c04[_0x2c00e6(0x122)];_0x197c04[_0x2c00e6(0x108)]&&(console[_0x2c00e6(0x141)](_0x2c00e6(0x110)+_0x52636b+_0x2c00e6(0x11d)),_0x3e6921&&console[_0x2c00e6(0x141)](_0x2c00e6(0x12c)+_0x3e6921));const _0x28d0b2=await withSpinner(_0x2c00e6(0x128),()=>_0x44195a['jobs']['list']({'from':0x0,'to':_0x52636b-0x1,'status':_0x3e6921}),{'verbose':_0x197c04[_0x2c00e6(0x108)]}),_0x412da3=_0x28d0b2[_0x2c00e6(0xf8)];console[_0x2c00e6(0x141)](_0x2c00e6(0x129)+_0x412da3[_0x2c00e6(0x135)]+_0x2c00e6(0x138)+(_0x412da3[_0x2c00e6(0x135)]!==0x1?'s':''));const _0x295a87=_0x197c04[_0x2c00e6(0x101)];if(isStructuredFormat(_0x197c04)){const _0x285446=_0x412da3[_0x2c00e6(0x134)](_0x11c526=>{const _0x14a343=_0x2c00e6;let _0xd60726;if(_0x11c526[_0x14a343(0x123)]&&_0x11c526[_0x14a343(0xe9)]){const _0x32779e=new Date(_0x11c526['start_at'])[_0x14a343(0x116)](),_0x2f48e7=new Date(_0x11c526['end_at'])[_0x14a343(0x116)]();_0xd60726=Math['round']((_0x2f48e7-_0x32779e)/0x3e8);}return{'job_id':_0x11c526[_0x14a343(0x12e)],'type':_0x11c526[_0x14a343(0xeb)]===_0x14a343(0x121)?_0x14a343(0x104):_0x11c526[_0x14a343(0xeb)],'status':_0x11c526[_0x14a343(0x122)],'user_name':_0x11c526[_0x14a343(0x113)],'duration_sec':_0xd60726,'created_at':_0x11c526[_0x14a343(0x125)],'started_at':_0x11c526[_0x14a343(0x123)],'end_at':_0x11c526['end_at']};});await handleSDKOutput(_0x285446,_0x197c04);}else for(const _0x338f05 of _0x412da3){const _0x515058=_0x338f05['status']===_0x2c00e6(0xf2)?a27_0xe4d50b[_0x2c00e6(0x11e)]:_0x338f05[_0x2c00e6(0x122)]===_0x2c00e6(0x141)?a27_0xe4d50b[_0x2c00e6(0x11a)]:a27_0xe4d50b[_0x2c00e6(0xef)],_0x414c78=_0x515058(_0x338f05[_0x2c00e6(0x122)]),_0x1ecd4b=getJobUrl(_0x295a87,_0x338f05['job_id']),_0x466a91=hyperlink(_0x338f05['job_id'],_0x1ecd4b),_0x5d5d51=a27_0xe4d50b['dim'](_0x338f05['type']===_0x2c00e6(0x121)?'trino':_0x338f05[_0x2c00e6(0xeb)]),_0x164323=[];if(_0x338f05[_0x2c00e6(0x123)]&&_0x338f05[_0x2c00e6(0xe9)]){const _0x3a55f5=Math['round']((new Date(_0x338f05['end_at'])['getTime']()-new Date(_0x338f05[_0x2c00e6(0x123)])[_0x2c00e6(0x116)]())/0x3e8);_0x164323[_0x2c00e6(0x112)](formatDuration(_0x3a55f5));}if(_0x338f05[_0x2c00e6(0xe9)])_0x164323[_0x2c00e6(0x112)](formatRelativeTime(new Date(_0x338f05[_0x2c00e6(0xe9)])));else _0x338f05['start_at']&&_0x164323[_0x2c00e6(0x112)](formatRelativeTime(new Date(_0x338f05[_0x2c00e6(0x123)])));const _0xc4b985=_0x164323[_0x2c00e6(0x135)]>0x0?a27_0xe4d50b[_0x2c00e6(0xef)]('\x20'+_0x164323[_0x2c00e6(0x10c)](',\x20')):'';console[_0x2c00e6(0x11c)]('⚡\x20'+_0x466a91+'\x20'+_0x5d5d51+'\x20'+_0x414c78+_0xc4b985);}return 0x0;}}function a27_0x49e7(){const _0x4426da=['job:kill','site','submit','args','trino','\x27\x20to\x20verify\x20the\x20job\x20status','job:result','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','verbose','Show\x20job\x20details','mo\x20ago','✔\x20Job\x20submitted','join','just\x20now','Job\x20type:\x20','Kill\x20a\x20job','Limit:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','push','user_name','Submitting\x20kill\x20request...','h\x20ago','getTime','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','debug','m\x20ago','red','2268842IyeVrm','log','\x20jobs','green','result','job:show','presto','status','start_at','jobType','created_at','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Query:\x20','Listing\x20jobs...','✔\x20Found\x20','INVALID_ARGUMENT','\x20row','Status\x20filter:\x20','abs','job_id','Cancelled','601965xzCuKe','database','yes','Submit\x20a\x20job','map','length','✔\x20Retrieved\x20','d\x20ago','\x20job','...','description','priority','924066vxrMJe','742518kVBLfY','kill','validate','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','error','execute','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','No\x20SQL\x20statements\x20found\x20in\x20file','end_at','Getting\x20job\x20results...','type','4756472EvwWpk','floor','Getting\x20job\x20details...','dim','Get\x20job\x20results','Database:\x20','success','jobs','163928QDjwpW','hive','file','959IXnWyt','data','5766035zCEsNN','List\x20jobs','name','query','information_schema','limit','Submitting\x20job...'];a27_0x49e7=function(){return _0x4426da;};return a27_0x49e7();}export class JobShowCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]=a27_0x39ba4c(0x120);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0x109);[a27_0x39ba4c(0x13f)](_0xf4184a){const _0x2e4828=a27_0x39ba4c,_0x4cf2ff=_0xf4184a[_0x2e4828(0x103)][0x0];if(!_0x4cf2ff)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a27_0x39ba4c(0xe6)](_0x34094d){const _0x2c0f41=a27_0x39ba4c,{options:_0x421db4,args:_0x10ac9e,tdx:_0x3735ad}=_0x34094d,_0x598bd3=_0x10ac9e[0x0],_0x4a7044=await withSpinner(_0x2c0f41(0xee),()=>_0x3735ad[_0x2c0f41(0xf3)]['show'](_0x598bd3),{'verbose':_0x421db4[_0x2c0f41(0x108)]}),_0x3d49e5=_0x4a7044[_0x2c0f41(0xf8)];let _0x55df22;if(_0x3d49e5['start_at']&&_0x3d49e5[_0x2c0f41(0xe9)]){const _0x336101=new Date(_0x3d49e5[_0x2c0f41(0x123)])[_0x2c0f41(0x116)](),_0x349b1c=new Date(_0x3d49e5[_0x2c0f41(0xe9)])[_0x2c0f41(0x116)]();_0x55df22=Math['round']((_0x349b1c-_0x336101)/0x3e8);}const _0x2c1cc8={'job_id':_0x3d49e5[_0x2c0f41(0x12e)],'type':_0x3d49e5[_0x2c0f41(0xeb)],'status':_0x3d49e5['status'],..._0x3d49e5['user_name']&&{'user_name':_0x3d49e5[_0x2c0f41(0x113)]},..._0x55df22!==undefined&&{'duration_sec':_0x55df22},..._0x3d49e5[_0x2c0f41(0x125)]&&{'created_at':_0x3d49e5['created_at']},..._0x3d49e5[_0x2c0f41(0x123)]&&{'started_at':_0x3d49e5[_0x2c0f41(0x123)]},..._0x3d49e5[_0x2c0f41(0xe9)]&&{'end_at':_0x3d49e5[_0x2c0f41(0xe9)]},..._0x3d49e5[_0x2c0f41(0x131)]&&{'database':_0x3d49e5[_0x2c0f41(0x131)]},..._0x3d49e5[_0x2c0f41(0x13b)]!==undefined&&{'priority':_0x3d49e5['priority']},..._0x3d49e5['url']&&{'url':_0x3d49e5['url']},..._0x3d49e5[_0x2c0f41(0xfc)]&&{'query':_0x3d49e5[_0x2c0f41(0xfc)]},..._0x3d49e5[_0x2c0f41(0x118)]&&{'debug':_0x3d49e5['debug']}};return await handleSingleObjectOutput(_0x2c1cc8,_0x421db4),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]=a27_0x39ba4c(0x100);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0x10f);[a27_0x39ba4c(0x13f)](_0x6cd483){const _0x35e359=a27_0x39ba4c,_0x2293d2=_0x6cd483[_0x35e359(0x103)][0x0];if(!_0x2293d2)return _0x35e359(0x140);return undefined;}async[a27_0x39ba4c(0xe6)](_0x11e8c6){const _0x23aee3=a27_0x39ba4c,{options:_0x533f5f,args:_0x242dd7,tdx:_0x178d9d}=_0x11e8c6,_0x3717f6=_0x242dd7[0x0];if(!_0x533f5f[_0x23aee3(0x132)]){const _0x5980a0=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x3717f6+'?');if(!_0x5980a0)return console[_0x23aee3(0x141)](_0x23aee3(0x12f)),0x0;}return await withSpinner(_0x23aee3(0x114),()=>_0x178d9d[_0x23aee3(0xf3)][_0x23aee3(0x13e)](_0x3717f6),{'verbose':_0x533f5f[_0x23aee3(0x108)]}),console[_0x23aee3(0x141)](_0x23aee3(0x107)+_0x3717f6),console['error'](_0x23aee3(0xe7)+_0x3717f6+_0x23aee3(0x105)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]='job:submit';['description']=a27_0x39ba4c(0x133);async[a27_0x39ba4c(0xe6)](_0x3688df){const _0xbb8281=a27_0x39ba4c,{options:_0x5307e8,args:_0x19705e,tdx:_0x60befc}=_0x3688df,_0x3c0824=_0x5307e8[_0xbb8281(0x124)]||_0xbb8281(0x104),_0x190bed=_0x5307e8[_0xbb8281(0xf6)],_0x46195b=_0x5307e8[_0xbb8281(0x131)]||_0xbb8281(0xfd),_0x4126c2=_0x5307e8[_0xbb8281(0x11f)];if(_0x3c0824!==_0xbb8281(0x104)&&_0x3c0824!==_0xbb8281(0xf5))throw new SDKError(ErrorCode[_0xbb8281(0x12a)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x155916;if(_0x190bed){if(_0x19705e[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xbb8281(0x111));const _0x491365=readSqlStatementsFromFile(_0x190bed);if(_0x491365[_0xbb8281(0x135)]===0x0)throw new SDKError(ErrorCode[_0xbb8281(0x12a)],_0xbb8281(0xe8));if(_0x491365[_0xbb8281(0x135)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x155916=_0x491365[0x0];}else{if(!_0x19705e[0x0])throw new SDKError(ErrorCode[_0xbb8281(0x12a)],_0xbb8281(0x126));_0x155916=_0x19705e[0x0];}_0x5307e8[_0xbb8281(0x108)]&&(console['error'](_0xbb8281(0x10e)+_0x3c0824),console[_0xbb8281(0x141)](_0xbb8281(0xf1)+_0x46195b),console[_0xbb8281(0x141)](_0xbb8281(0x127)+_0x155916['substring'](0x0,0x64)+(_0x155916[_0xbb8281(0x135)]>0x64?_0xbb8281(0x139):'')));const _0x18019d=await withSpinner(_0xbb8281(0xff),()=>_0x60befc['jobs'][_0xbb8281(0x102)](_0x46195b,_0x155916,_0x3c0824,_0x4126c2),{'verbose':_0x5307e8[_0xbb8281(0x108)]}),_0x17416b=_0x18019d['data'];return console['error'](_0xbb8281(0x10b)),console[_0xbb8281(0x141)]('\x20\x20Job\x20ID:\x20'+_0x17416b['job_id']),await handleSDKOutput([_0x17416b],_0x5307e8),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a27_0x39ba4c(0x106);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0xf0);[a27_0x39ba4c(0x13f)](_0x51065e){const _0x3cb235=a27_0x39ba4c,_0x373a60=_0x51065e[_0x3cb235(0x103)][0x0];if(!_0x373a60)return _0x3cb235(0x117);return undefined;}async[a27_0x39ba4c(0xe6)](_0xbb925c){const _0x3f4665=a27_0x39ba4c,{options:_0x1528a5,args:_0x16ad5d,tdx:_0x1ef085}=_0xbb925c,_0x5f3022=_0x16ad5d[0x0],_0x1dd3eb=await withSpinner(_0x3f4665(0xea),()=>_0x1ef085[_0x3f4665(0xf3)][_0x3f4665(0x11f)](_0x5f3022),{'verbose':_0x1528a5[_0x3f4665(0x108)]}),_0x3300df=_0x1dd3eb['data'];return console[_0x3f4665(0x141)](_0x3f4665(0x136)+_0x3300df[_0x3f4665(0x135)]+_0x3f4665(0x12b)+(_0x3300df[_0x3f4665(0x135)]!==0x1?'s':'')),await handleSDKOutput(_0x3300df,_0x1528a5),0x0;}}
@@ -1 +1 @@
1
- const a28_0x28f764=a28_0x1082;(function(_0x5f5d3b,_0x484126){const _0x4b81ef=a28_0x1082,_0x29f6fc=_0x5f5d3b();while(!![]){try{const _0x5c9fd7=parseInt(_0x4b81ef(0x299))/0x1*(-parseInt(_0x4b81ef(0x244))/0x2)+parseInt(_0x4b81ef(0x227))/0x3+-parseInt(_0x4b81ef(0x289))/0x4*(parseInt(_0x4b81ef(0x261))/0x5)+parseInt(_0x4b81ef(0x237))/0x6+parseInt(_0x4b81ef(0x24b))/0x7+-parseInt(_0x4b81ef(0x224))/0x8*(parseInt(_0x4b81ef(0x2b4))/0x9)+-parseInt(_0x4b81ef(0x253))/0xa*(-parseInt(_0x4b81ef(0x26c))/0xb);if(_0x5c9fd7===_0x484126)break;else _0x29f6fc['push'](_0x29f6fc['shift']());}catch(_0x2c76a6){_0x29f6fc['push'](_0x29f6fc['shift']());}}}(a28_0x1bed,0x95669));import a28_0x49ddf2 from'chalk';import a28_0x40243d from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x1f33cb){const _0x1c8bc3=a28_0x1082;return!_0x1f33cb&&(console['error'](_0x1c8bc3(0x223)),console[_0x1c8bc3(0x290)](_0x1c8bc3(0x1e8))),!!_0x1f33cb;}function withJsonFormat(_0x4deec6){const _0x45bbd=a28_0x1082;if(!_0x4deec6[_0x45bbd(0x23a)]&&!_0x4deec6[_0x45bbd(0x243)]&&!_0x4deec6[_0x45bbd(0x2a8)]&&!_0x4deec6[_0x45bbd(0x2ac)])return{..._0x4deec6,'format':_0x45bbd(0x243),'json':!![]};return _0x4deec6;}function formatJourneyState(_0x5aaf55){const _0x370e07=a28_0x1082;switch(_0x5aaf55){case _0x370e07(0x2ce):return a28_0x49ddf2[_0x370e07(0x2bd)](_0x370e07(0x2df));case _0x370e07(0x29a):return a28_0x49ddf2[_0x370e07(0x228)](_0x370e07(0x28e));case _0x370e07(0x240):return a28_0x49ddf2['yellow'](_0x370e07(0x2cf));case _0x370e07(0x2c1):return a28_0x49ddf2[_0x370e07(0x1f2)](_0x370e07(0x200));case _0x370e07(0x217):return a28_0x49ddf2[_0x370e07(0x228)](_0x370e07(0x24f));default:return'('+_0x5aaf55+')';}}function formatJourneyItem(_0x408599,_0x817500='',_0x74cf5f){const _0x4639a9=a28_0x1082,_0x2f0adc=formatJourneyState(_0x408599[_0x4639a9(0x2de)]),_0x302b4a=_0x74cf5f?hyperlink(_0x408599[_0x4639a9(0x2b1)],_0x74cf5f):_0x408599['journeyBundleName'];return _0x817500+_0x4639a9(0x230)+_0x302b4a+'\x20'+_0x2f0adc;}function escapeRegex(_0x4bced7){const _0x2a8277=a28_0x1082;return _0x4bced7[_0x2a8277(0x213)](/[.*+?^${}()|[\]\\]/g,_0x2a8277(0x2d8));}function globToRegex(_0x454b4e){const _0x520a32=a28_0x1082,_0x5376fa=_0x454b4e[_0x520a32(0x2a0)]('*')[_0x520a32(0x202)](escapeRegex);return new RegExp(_0x5376fa[_0x520a32(0x2c9)]('.*'),'i');}function buildRuleToNameMapping(_0xde6dee){const _0x3848c5=a28_0x1082,_0x27b31a=new Map();if(_0xde6dee[_0x3848c5(0x1ec)])for(const [_0x265b13,_0x47f732]of Object[_0x3848c5(0x2ab)](_0xde6dee[_0x3848c5(0x1ec)])){if(_0x47f732[_0x3848c5(0x24d)]){const _0x2f4402=serializeRule(_0x47f732[_0x3848c5(0x24d)]),_0xa429c=_0x27b31a['get'](_0x2f4402);_0xa429c?_0xa429c[_0x3848c5(0x20e)](_0x265b13):_0x27b31a[_0x3848c5(0x272)](_0x2f4402,[_0x265b13]);}}return _0x27b31a;}async function resolveJourneyIdFromInput(_0x286823,_0x251586,_0x3139bf){const _0x5ae3c0=a28_0x1082,_0x566dbf=await resolveJourneyTarget(_0x286823,_0x251586[_0x5ae3c0(0x205)],_0x251586[_0x5ae3c0(0x23e)]),_0x24b269=_0x566dbf['parentSegment'];if(!_0x24b269)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x161881=await withSpinner(_0x5ae3c0(0x220),()=>_0x3139bf[_0x5ae3c0(0x28f)][_0x5ae3c0(0x26d)](_0x24b269),{'verbose':_0x251586['verbose']}),_0x18c338=_0x161881[_0x5ae3c0(0x268)],_0x3b8821=await withSpinner('Resolving\x20journey...',()=>_0x3139bf['journey'][_0x5ae3c0(0x288)](_0x18c338,_0x566dbf[_0x5ae3c0(0x298)]),{'verbose':_0x251586[_0x5ae3c0(0x23e)]});return{'journeyId':_0x3b8821[_0x5ae3c0(0x268)],'journeyName':_0x566dbf[_0x5ae3c0(0x298)],'parentSegmentId':_0x18c338};}async function resolveJourneyTarget(_0x4fdecc,_0xf89739,_0x3fb386){const _0x1d298b=a28_0x1082;if(isYamlFilePath(_0x4fdecc))try{const _0x42ad90=await resolveYamlFilePath(_0x4fdecc);return _0x3fb386&&(console['error'](_0x1d298b(0x2c7)+_0x4fdecc),console[_0x1d298b(0x290)]('\x20\x20Parent\x20segment:\x20'+_0x42ad90[_0x1d298b(0x205)]),console[_0x1d298b(0x290)](_0x1d298b(0x2ba)+_0x42ad90[_0x1d298b(0x22a)]),console[_0x1d298b(0x290)]('\x20\x20Folder\x20path:\x20'+(_0x42ad90['folderPath']||_0x1d298b(0x2a5)))),{'journeyName':_0x42ad90[_0x1d298b(0x22a)],'parentSegment':_0x42ad90[_0x1d298b(0x205)],'resolved':_0x42ad90};}catch(_0x71c8d7){throw new SDKError(ErrorCode[_0x1d298b(0x233)],_0x1d298b(0x249)+_0x71c8d7[_0x1d298b(0x291)]);}if(!_0xf89739)throw new SDKError(ErrorCode[_0x1d298b(0x233)],_0x1d298b(0x24a));return{'journeyName':_0x4fdecc,'parentSegment':_0xf89739};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a28_0x28f764(0x2e1)]=a28_0x28f764(0x225);async[a28_0x28f764(0x231)](_0x57c420){const _0x5edccc=a28_0x28f764,{options:_0x5ef3fa,args:_0x5528aa,tdx:_0x2153b8}=_0x57c420,_0x235efa=_0x5528aa[0x0],_0x1000b4=_0x5ef3fa[_0x5edccc(0x205)];if(!_0x1000b4)return console[_0x5edccc(0x290)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x5edccc(0x290)](_0x5edccc(0x25d)),0x1;const _0x5cc985=await withSpinner(_0x5edccc(0x220),()=>_0x2153b8[_0x5edccc(0x28f)][_0x5edccc(0x26d)](_0x1000b4),{'verbose':_0x5ef3fa[_0x5edccc(0x23e)]}),_0x58dc7d=_0x5cc985['data'];_0x5ef3fa[_0x5edccc(0x23e)]&&(console['error']('Parent\x20segment:\x20'+_0x1000b4+_0x5edccc(0x27d)+_0x58dc7d+')'),_0x235efa&&console[_0x5edccc(0x290)](_0x5edccc(0x2dc)+_0x235efa));const _0x1d8649=await withSpinner(_0x5edccc(0x2b6),()=>_0x2153b8[_0x5edccc(0x28f)]['getParentFull'](_0x58dc7d),{'verbose':_0x5ef3fa[_0x5edccc(0x23e)]}),_0x3dad3f=_0x1d8649[_0x5edccc(0x268)],_0x917af7=_0x3dad3f['rootFolderId'],_0x269ba7=await withSpinner(_0x5edccc(0x219),()=>_0x2153b8[_0x5edccc(0x259)][_0x5edccc(0x1fb)](_0x58dc7d,_0x917af7),{'verbose':_0x5ef3fa['verbose']});let _0x13e933=_0x269ba7['data'][_0x5edccc(0x276)];const _0x1fcaba=_0x269ba7['data'][_0x5edccc(0x283)],_0x2f5475=new Map();for(const _0x118bca of _0x1fcaba){_0x2f5475[_0x5edccc(0x272)](_0x118bca['id'],_0x118bca[_0x5edccc(0x2b0)]);}if(_0x235efa){const _0x102263=globToRegex(_0x235efa);_0x13e933=_0x13e933['filter'](_0x60293c=>_0x102263[_0x5edccc(0x25e)](_0x60293c[_0x5edccc(0x2b1)]));}console[_0x5edccc(0x290)](_0x5edccc(0x22b)+_0x13e933[_0x5edccc(0x26f)]+_0x5edccc(0x23d)+(_0x13e933[_0x5edccc(0x26f)]!==0x1?'s':''));const _0x1cc9bd=_0x3b0355=>{const _0x18f061=_0x5edccc;return getConsoleNextUrl(_0x5ef3fa[_0x18f061(0x215)],_0x18f061(0x246)+_0x58dc7d+_0x18f061(0x209)+_0x3b0355+'/j/da');};if(_0x5ef3fa[_0x5edccc(0x23a)]===_0x5edccc(0x1e9))await handleSDKOutput(_0x13e933,_0x5ef3fa);else{if(_0x5ef3fa[_0x5edccc(0x23a)]==='json'){const _0xed3bd9=_0x13e933[_0x5edccc(0x202)](_0x289afd=>({..._0x289afd,'url':_0x1cc9bd(_0x289afd['id'])}));await handleSDKOutput(_0xed3bd9,_0x5ef3fa);}else{console[_0x5edccc(0x1e7)]('['+_0x1000b4+']');const _0x508da7=new Map(),_0xcb186c=[];for(const _0x5bb8e5 of _0x13e933){if(!_0x5bb8e5[_0x5edccc(0x22d)]||_0x5bb8e5[_0x5edccc(0x22d)]===_0x917af7)_0xcb186c[_0x5edccc(0x20e)](_0x5bb8e5);else{const _0x3801ab=_0x508da7[_0x5edccc(0x269)](_0x5bb8e5[_0x5edccc(0x22d)])||[];_0x3801ab[_0x5edccc(0x20e)](_0x5bb8e5),_0x508da7[_0x5edccc(0x272)](_0x5bb8e5[_0x5edccc(0x22d)],_0x3801ab);}}const _0x317802=(_0x26d224,_0x2515a6)=>_0x26d224['journeyBundleName'][_0x5edccc(0x1e4)](_0x2515a6[_0x5edccc(0x2b1)],undefined,{'sensitivity':'base'});_0xcb186c['sort'](_0x317802);for(const _0x30a206 of _0xcb186c){console[_0x5edccc(0x1e7)](formatJourneyItem(_0x30a206,'',_0x1cc9bd(_0x30a206['id'])));}const _0x57325e=[..._0x508da7[_0x5edccc(0x2ab)]()][_0x5edccc(0x1f8)]((_0x5b4cd9,_0x2eec38)=>{const _0x119b5f=_0x5edccc,_0xc8bb4f=_0x2f5475[_0x119b5f(0x269)](_0x5b4cd9[0x0])||_0x5b4cd9[0x0],_0x5c5ccf=_0x2f5475[_0x119b5f(0x269)](_0x2eec38[0x0])||_0x2eec38[0x0];return _0xc8bb4f[_0x119b5f(0x1e4)](_0x5c5ccf,undefined,{'sensitivity':_0x119b5f(0x26e)});});for(const [_0x267a0f,_0x2ce7a7]of _0x57325e){const _0x26d77f=_0x2f5475[_0x5edccc(0x269)](_0x267a0f)||_0x267a0f;console[_0x5edccc(0x1e7)](_0x5edccc(0x229)+_0x26d77f),_0x2ce7a7['sort'](_0x317802);for(const _0xbf6d60 of _0x2ce7a7){console[_0x5edccc(0x1e7)](formatJourneyItem(_0xbf6d60,'\x20\x20',_0x1cc9bd(_0xbf6d60['id'])));}}}}return 0x0;}}function a28_0x1bed(){const _0x44c1a8=['\x20versions)','versionNumber','🗺️\x20','execute','dryRun','INVALID_ARGUMENT','Target\x20directory:\x20','renderStats','listVersions','1934868EGzbua','Input:\x20','Error:\x20--version\x20option\x20is\x20required','format','Available\x20stages:\x20','Write\x20','\x20journey','verbose','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','paused','getLatestJourneyId','journeyBundleId','json','2JAiRjl','\x22\x20not\x20found','/app/ps/','List\x20activations\x20for\x20a\x20journey','then','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','6229678OwDIzx','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','rule','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','(archived)','\x20=\x20','buildIdToEmailMap','\x20->\x20','750plLZjc','red','resume','\x20new\x20files','List\x20all\x20versions\x20of\x20a\x20journey','Creating\x20new\x20version...','journey','journey:versions','cyan','filter','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','test','Getting\x20column\x20mapping...','Getting\x20journey\x20traffic\x20data...','5OMqwSu','file','listFolders','\x20not\x20found.\x20Available:\x20','add','exitOrJumpRate','createVersion','data','get','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)','utf-8','107998bFmmHt','resolveParentId','base','length','user','Resolving\x20version...','set','Listing\x20journey\x20activations...','bold','getStatistics','journeys','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','No\x20journeys\x20found','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','connector_config','\x20\x20-\x20','content','\x20(ID:\x20','hasPeriod','\x20Created\x20v','Error:\x20Version\x20','options','\x20changed\x20files','folders','database','parent_segment','Getting\x20version\x20','find','resolveJourneyId','2055644qHSTQz','no_parent','No\x20statistics\x20available\x20for\x20journey:\x20','goal','from','(draft)','segment','error','message','stage','createdAt','type','...','Error:\x20','errorCode','journeyName','940553iBGsuy','draft','stageNameMap','Found\x20','enteredSize','version','\x20Opening\x20','split','attributes','getJourney','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Database:\x20','(root)','getColumnMapping','Fetching\x20users\x20and\x20connections...','jsonl','journey:version:view','links','entries','tsv','journey:activations','Target\x20file:\x20',',\x20version:\x20','name','journeyBundleName','Resume\x20a\x20paused\x20journey','hasChanges','134982dqTjPE','Folder\x20path:\x20','Fetching\x20parent\x20segment...','journey:pull','tdx.json','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20\x20Name:\x20','journey:push','\x27\x20not\x20found\x20in\x20','green','✔\x20All\x20files\x20are\x20up\x20to\x20date','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','completed','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','history','repeat','goalSize','folderPath','Resolved\x20YAML\x20file:\x20','Error:\x20Stage\x20\x22','join','yellow','✔\x20Context\x20set:\x20','\x20files?','Options:','launched','(paused)','Listing\x20journey\x20versions...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','root\x20folder','exitOrJumpSize','journeyStages','journey:resume','updatedAt','limit','\x5c$&','web','Getting\x20journey\x20details...','isNew','Pattern:\x20','includeHistory','state','(running)','getSegment','description','size','buildIdToNameMap','setPhase','toLowerCase','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Parent\x20segment:\x20','journeyId','targetDir','localeCompare','absolutePath','segmentPushCommand','log','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','table','cwd','helpText','segments','journey:stats','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Error:\x20Journey\x20\x27','Show\x20journey\x20statistics','/j/da/je','blue','journey:version:create','Show\x20journey\x20details','stringify','\x0aError:','reentryMode','sort','\x22\x20paused','Pause\x20a\x20running\x20journey','listJourneysWithFolders','\x22\x20resumed','Fetching\x20','relative','\x20unchanged\x20files','(completed)','relativePath','map','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parentName','parentSegment','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','/e/','values','journey:columns','conversion','\x20\x20Statistics\x20not\x20available','push','includeStats','all','milestoneSize','\x20version','replace','\x20(rule\x20match)','site','\x20\x20Target:\x20','archived','activation','Listing\x20journeys...','Error:\x20Invalid\x20version\x20number:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','stages','connection','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Cancelled','Resolving\x20parent\x20segment...','yes','has','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','8UPbNHR','List\x20journeys\x20in\x20current\x20context','session','397875uYNuTP','dim','📁\x20','segmentName','✔\x20Found\x20','Getting\x20journey\x20statistics...','folderId'];a28_0x1bed=function(){return _0x44c1a8;};return a28_0x1bed();}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a28_0x28f764(0x2e1)]=a28_0x28f764(0x1f4);async['execute'](_0x4e967a){const _0x48db43=a28_0x28f764,{options:_0x373cdf,args:_0x208e85,tdx:_0x40dec5}=_0x4e967a,_0x42aa40=_0x208e85[0x0];if(!_0x42aa40)return console[_0x48db43(0x290)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x48db43(0x290)](_0x48db43(0x1ee)),console[_0x48db43(0x290)](_0x48db43(0x2cd)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x373cdf[_0x48db43(0x23e)]&&console[_0x48db43(0x290)]('Input:\x20'+_0x42aa40);const {journeyId:_0x5ddbff,parentSegmentId:_0x4b27a9}=await resolveJourneyIdFromInput(_0x42aa40,_0x373cdf,_0x40dec5);if(_0x373cdf[_0x48db43(0x2d9)]){const _0x1ec6b2=getConsoleNextUrl(_0x373cdf[_0x48db43(0x215)],'/app/ps/'+_0x4b27a9+'/e/'+_0x5ddbff+_0x48db43(0x1f1));return console[_0x48db43(0x290)](a28_0x49ddf2[_0x48db43(0x2bd)]('✔')+_0x48db43(0x29f)+a28_0x49ddf2[_0x48db43(0x25b)](_0x1ec6b2)),openBrowser(_0x1ec6b2),0x0;}const _0x14a9fe=await withSpinner(_0x48db43(0x2da),()=>_0x40dec5[_0x48db43(0x259)][_0x48db43(0x2a2)](_0x5ddbff),{'verbose':_0x373cdf[_0x48db43(0x23e)]}),_0x5e3b03=_0x14a9fe[_0x48db43(0x268)],_0x588c17=_0x373cdf[_0x48db43(0x20f)];let _0x45c145;if(_0x588c17)try{const _0x39069d=await withSpinner(_0x48db43(0x22c),()=>_0x40dec5[_0x48db43(0x259)][_0x48db43(0x275)](_0x5ddbff),{'verbose':_0x373cdf[_0x48db43(0x23e)]});_0x45c145=_0x39069d['data'];}catch{_0x373cdf['verbose']&&console[_0x48db43(0x290)](_0x48db43(0x20d));}const _0x15cb9a=getConsoleNextUrl(_0x373cdf['site'],_0x48db43(0x246)+_0x4b27a9+_0x48db43(0x209)+_0x5ddbff+_0x48db43(0x1f1)),_0x8fa32b={'id':_0x5e3b03['id'],'name':_0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x2b0)],'description':_0x5e3b03['attributes'][_0x48db43(0x2e1)],'state':_0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x2de)],'paused':_0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x240)],'reentry_mode':_0x5e3b03['attributes']['reentryMode'],'stages':_0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x2d4)]?.[_0x48db43(0x26f)]||0x0,..._0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x28c)]&&{'goal':_0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x28c)][_0x48db43(0x2b0)]},..._0x45c145&&{'statistics':{'size':_0x45c145['size'],'entered':_0x45c145['enteredSize'],'goal_achieved':_0x45c145[_0x48db43(0x2c5)],'completion_rate':_0x45c145['completionRate'],'exit_or_jump':_0x45c145[_0x48db43(0x2d3)],'exit_or_jump_rate':_0x45c145['exitOrJumpRate'],'stages':_0x45c145['stages']}},'url':_0x15cb9a};return await handleSingleObjectOutput(_0x8fa32b,_0x373cdf),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x1ed);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x1f0);async[a28_0x28f764(0x231)](_0x5316ff){const _0xa81da=a28_0x28f764,{options:_0x190d48,args:_0x3e7bcd,tdx:_0x576aec}=_0x5316ff,_0x68192c=_0x3e7bcd[0x0];if(!requireNameOrPath(_0x68192c))return 0x1;_0x190d48['verbose']&&console[_0xa81da(0x290)](_0xa81da(0x238)+_0x68192c);const _0x4ab815=_0x190d48,_0x49ab11=_0x4ab815['from'],_0x529af7=_0x4ab815['to'],_0x282787=_0x4ab815['includeHistory'],_0x5594c9=_0x4ab815[_0xa81da(0x292)];_0x282787&&!_0x49ab11&&!_0x529af7&&console['error'](_0xa81da(0x2bf));const _0x25f0f9=_0x282787?withJsonFormat(_0x190d48):_0x190d48,{journeyId:_0x51ed13,journeyName:_0x137d0c}=await resolveJourneyIdFromInput(_0x68192c,_0x25f0f9,_0x576aec),_0xdc15e9=_0x49ab11||_0x529af7?{'from':_0x49ab11,'to':_0x529af7}:undefined,_0x70ffb3=await withSpinner(_0xa81da(0x22c),()=>Promise['all']([_0x576aec[_0xa81da(0x259)][_0xa81da(0x2a2)](_0x51ed13),_0x576aec[_0xa81da(0x259)][_0xa81da(0x275)](_0x51ed13,_0xdc15e9)]),{'verbose':_0x25f0f9[_0xa81da(0x23e)]}),[_0x2e1947,_0x42dc4e]=_0x70ffb3[_0xa81da(0x268)];if(!_0x42dc4e||_0x42dc4e[_0xa81da(0x2e8)]===null)return console[_0xa81da(0x290)](_0xa81da(0x28b)+_0x137d0c),console[_0xa81da(0x290)](_0xa81da(0x2b9)),0x0;const _0x48a405=buildStageNameMap(_0x2e1947),_0x8caca8=!!(_0xdc15e9&&_0x42dc4e[_0xa81da(0x2c3)]?.[_0xa81da(0x26f)]),_0xe2d6e3={'stageNameMap':_0x48a405,'hasPeriod':_0x8caca8,'includeHistory':!!_0x282787};if(_0x5594c9&&_0x42dc4e[_0xa81da(0x21c)]){const _0x4850c1=_0x42dc4e[_0xa81da(0x21c)][_0xa81da(0x287)](_0x5f1306=>{const _0x3c78ce=_0xa81da,_0x482242=_0x48a405[_0x3c78ce(0x269)](_0x5f1306['id'])??'';return _0x482242['toLowerCase']()===_0x5594c9[_0x3c78ce(0x2e5)]();});if(_0x4850c1)return await handleSingleObjectOutput(formatStageStats(_0x4850c1,_0xe2d6e3),_0x25f0f9),0x0;const _0x470b03=_0x42dc4e[_0xa81da(0x21c)]['map'](_0x97df54=>_0x48a405[_0xa81da(0x269)](_0x97df54['id'])??_0x97df54['id']);return console[_0xa81da(0x290)](_0xa81da(0x2c8)+_0x5594c9+_0xa81da(0x245)),console[_0xa81da(0x290)](_0xa81da(0x23b)+_0x470b03[_0xa81da(0x2c9)](',\x20')),0x1;}const _0x2e7857=_0x42dc4e[_0xa81da(0x21c)]?.['map'](_0x4146ec=>formatStageStats(_0x4146ec,_0xe2d6e3)),_0x2f3ffa=assembleJourneyStats(_0x42dc4e,{'from':_0x49ab11,'to':_0x529af7,'includeHistory':_0x282787});return await this[_0xa81da(0x235)](_0x2f3ffa,_0x2e7857??[],_0x25f0f9),0x0;}async[a28_0x28f764(0x235)](_0x474400,_0x1d3172,_0x8fac79){const _0x17e296=a28_0x28f764,_0x24d793=_0x8fac79[_0x17e296(0x23a)]===_0x17e296(0x243)||_0x8fac79[_0x17e296(0x23a)]===_0x17e296(0x2a8)||_0x8fac79[_0x17e296(0x243)]||_0x8fac79[_0x17e296(0x2a8)];if(_0x24d793){_0x474400[_0x17e296(0x21c)]=_0x1d3172,await handleSingleObjectOutput(_0x474400,_0x8fac79);return;}await handleSingleObjectOutput(_0x474400,_0x8fac79);for(const _0x4ddaaa of _0x1d3172){console[_0x17e296(0x1e7)](''),console[_0x17e296(0x1e7)](String(a28_0x49ddf2['cyan'][_0x17e296(0x274)]('['+_0x4ddaaa['name']+']'))+a28_0x49ddf2['dim']('\x20'+_0x4ddaaa['id']));const {id:_0x5ab506,name:_0x3cfc67,..._0x559f17}=_0x4ddaaa;await handleSingleObjectOutput(_0x559f17,_0x8fac79);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x28f764(0x2b0)]='journey:traffic';['description']='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x28f764(0x231)](_0x416e7e){const _0x4b039d=a28_0x28f764,{options:_0x46ec95,args:_0x3e1517,tdx:_0x502a55}=_0x416e7e,_0x335bc2=_0x3e1517[0x0];if(!requireNameOrPath(_0x335bc2))return 0x1;_0x46ec95['verbose']&&console['error']('Input:\x20'+_0x335bc2);const _0x59e4cd=_0x46ec95,_0x7a855a=_0x59e4cd[_0x4b039d(0x294)],_0x7bcf1d=_0x59e4cd[_0x4b039d(0x28d)],_0x50e0f6=_0x59e4cd['to'],_0x381c0b=_0x59e4cd[_0x4b039d(0x2d7)];if(_0x7a855a&&_0x7a855a!==_0x4b039d(0x20c)&&_0x7a855a!=='activation')return console[_0x4b039d(0x290)]('Error:\x20Invalid\x20--type\x20\x22'+_0x7a855a+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x5d46b9=withJsonFormat(_0x46ec95),{journeyId:_0x3c3fee,journeyName:_0x48b1a1}=await resolveJourneyIdFromInput(_0x335bc2,_0x5d46b9,_0x502a55),_0x220256={'type':_0x7a855a,'from':_0x7bcf1d,'to':_0x50e0f6,'limit':_0x381c0b},_0x1dac48=await withSpinner(_0x4b039d(0x260),()=>_0x502a55[_0x4b039d(0x259)]['getTrafficData'](_0x3c3fee,_0x220256),{'verbose':_0x5d46b9[_0x4b039d(0x23e)]}),_0x26e8f9=_0x1dac48[_0x4b039d(0x268)],_0x4b635c=_0x26e8f9['conversion']&&(_0x26e8f9[_0x4b039d(0x20c)]['nodes'][_0x4b039d(0x26f)]>0x0||_0x26e8f9['conversion'][_0x4b039d(0x2aa)][_0x4b039d(0x26f)]>0x0),_0x2d0ce3=_0x26e8f9['activation']&&_0x26e8f9[_0x4b039d(0x218)][_0x4b039d(0x26f)]>0x0;if(!_0x4b635c&&!_0x2d0ce3)return console[_0x4b039d(0x290)](_0x4b039d(0x24e)+_0x48b1a1),console[_0x4b039d(0x290)](_0x4b039d(0x277)),_0x7bcf1d&&_0x50e0f6&&console[_0x4b039d(0x290)](_0x4b039d(0x2d1)),0x0;return await handleSingleObjectOutput(_0x26e8f9,_0x5d46b9),0x0;}}function a28_0x1082(_0x1dbea2,_0xc25df8){_0x1dbea2=_0x1dbea2-0x1e3;const _0x1bed24=a28_0x1bed();let _0x108233=_0x1bed24[_0x1dbea2];return _0x108233;}function formatStageStats(_0x323465,_0x43666e){const _0x280ff9=a28_0x28f764,_0x29d8f0=_0x43666e[_0x280ff9(0x27e)]&&_0x323465['history']?.[_0x280ff9(0x26f)]?aggregateStageHistory(_0x323465['history']):{'size':_0x323465[_0x280ff9(0x2e2)],'entered':_0x323465[_0x280ff9(0x29d)],'milestone':_0x323465[_0x280ff9(0x211)],'milestone_rate':_0x323465['completeMilestoneRate'],'exit_or_jump':_0x323465[_0x280ff9(0x2d3)],'exit_or_jump_rate':_0x323465[_0x280ff9(0x266)]},_0x2ccaf4={'id':_0x323465['id'],'name':_0x43666e[_0x280ff9(0x29b)][_0x280ff9(0x269)](_0x323465['id'])??_0x323465['id'],..._0x29d8f0};return _0x43666e[_0x280ff9(0x27e)]&&_0x43666e[_0x280ff9(0x2dd)]&&_0x323465[_0x280ff9(0x2c3)]&&(_0x2ccaf4[_0x280ff9(0x2c3)]=_0x323465[_0x280ff9(0x2c3)]),_0x2ccaf4;}export class JourneyPauseCommand extends BaseCommand{[a28_0x28f764(0x2b0)]='journey:pause';[a28_0x28f764(0x2e1)]=a28_0x28f764(0x1fa);async[a28_0x28f764(0x231)](_0x36b4a5){const _0x4038a4=a28_0x28f764,{options:_0x318f49,args:_0x530c8c,tdx:_0x45a3ad}=_0x36b4a5,_0x59634d=_0x530c8c[0x0];if(!requireNameOrPath(_0x59634d))return 0x1;_0x318f49['verbose']&&console[_0x4038a4(0x290)](_0x4038a4(0x238)+_0x59634d);const {journeyId:_0xaebde2,journeyName:_0x31cb84}=await resolveJourneyIdFromInput(_0x59634d,_0x318f49,_0x45a3ad);if(!_0x318f49[_0x4038a4(0x221)]){const _0x4b56cd=await confirm(_0x4038a4(0x207)+_0x31cb84+'\x22?');if(!_0x4b56cd)return console[_0x4038a4(0x290)](_0x4038a4(0x21f)),0x0;}const _0xfe97e8=await withSpinner('Pausing\x20journey...',()=>_0x45a3ad[_0x4038a4(0x259)]['pause'](_0xaebde2),{'verbose':_0x318f49[_0x4038a4(0x23e)]}),_0x4a5ff9=_0xfe97e8['data'];return console[_0x4038a4(0x290)]('✔\x20Journey\x20\x22'+_0x4a5ff9[_0x4038a4(0x2a1)][_0x4038a4(0x2b0)]+_0x4038a4(0x1f9)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x2d5);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x2b2);async[a28_0x28f764(0x231)](_0x23dee5){const _0x51eda4=a28_0x28f764,{options:_0x4f8078,args:_0x24e826,tdx:_0xbd618d}=_0x23dee5,_0x57c946=_0x24e826[0x0];if(!requireNameOrPath(_0x57c946))return 0x1;_0x4f8078[_0x51eda4(0x23e)]&&console['error']('Input:\x20'+_0x57c946);const {journeyId:_0x567715,journeyName:_0x42a500}=await resolveJourneyIdFromInput(_0x57c946,_0x4f8078,_0xbd618d);if(!_0x4f8078[_0x51eda4(0x221)]){const _0x307e38=await confirm(_0x51eda4(0x21b)+_0x42a500+'\x22?');if(!_0x307e38)return console[_0x51eda4(0x290)](_0x51eda4(0x21f)),0x0;}const _0x2ef2e1=await withSpinner('Resuming\x20journey...',()=>_0xbd618d[_0x51eda4(0x259)][_0x51eda4(0x255)](_0x567715),{'verbose':_0x4f8078[_0x51eda4(0x23e)]}),_0x12c0db=_0x2ef2e1[_0x51eda4(0x268)];return console['error']('✔\x20Journey\x20\x22'+_0x12c0db[_0x51eda4(0x2a1)]['name']+_0x51eda4(0x1fc)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x2b7);['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async[a28_0x28f764(0x231)](_0x870f00){const _0x2b4585=a28_0x28f764,{options:_0x4f3d60,args:_0x9ac7d6,tdx:_0x3ddd0e}=_0x870f00,_0x4d2464=_0x4f3d60,_0x2c85e9=_0x9ac7d6[0x0],_0x369ef4=_0x2c85e9&&isYamlFilePath(_0x2c85e9),_0x5d11b4=await resolveTarget({'arg':_0x369ef4?_0x2c85e9:undefined,'contextParent':_0x4f3d60[_0x2b4585(0x205)],'cwd':process[_0x2b4585(0x1ea)]()});if(!isSuccessfulResolution(_0x5d11b4))return _0x5d11b4[_0x2b4585(0x297)]===_0x2b4585(0x28a)?(console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x2ca)](_0x2b4585(0x2a3))),console[_0x2b4585(0x290)](_0x2b4585(0x26a)),console[_0x2b4585(0x290)](_0x2b4585(0x21e)),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[_0x2b4585(0x290)](_0x2b4585(0x279))):(console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x254)](_0x2b4585(0x296)+_0x5d11b4[_0x2b4585(0x291)]+'\x0a')),_0x5d11b4[_0x2b4585(0x1eb)]&&console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x25b)](_0x5d11b4[_0x2b4585(0x1eb)]))),0x1;let _0xd0b8b0=_0x369ef4?undefined:_0x2c85e9,_0x5f2170,_0x1d906d;_0x5d11b4[_0x2b4585(0x294)]===_0x2b4585(0x262)&&(_0xd0b8b0=_0x5d11b4['resourceName'],_0x5f2170=_0x5d11b4['filePath'],_0x1d906d=_0x5d11b4[_0x2b4585(0x2c6)]);const _0x40ef46=_0x5d11b4[_0x2b4585(0x204)],_0x43b3cc=_0x5d11b4[_0x2b4585(0x1e3)];_0x4d2464[_0x2b4585(0x23e)]&&(console['error'](_0x2b4585(0x2e7)+_0x40ef46),console[_0x2b4585(0x290)](_0x2b4585(0x234)+_0x43b3cc),_0xd0b8b0&&console['error']('Journey\x20name:\x20'+_0xd0b8b0),_0x5f2170&&console[_0x2b4585(0x290)](_0x2b4585(0x2ae)+_0x5f2170),_0x1d906d&&console['error'](_0x2b4585(0x2b5)+_0x1d906d));const _0x4070c9=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3ddd0e[_0x2b4585(0x28f)][_0x2b4585(0x26d)](_0x40ef46),{'verbose':_0x4f3d60[_0x2b4585(0x23e)]}),_0x195bc7=_0x4070c9[_0x2b4585(0x268)],{journeys:_0x33bf08,folders:_0x139d0b}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x3ba13f=_0x2b4585,[_0x13bbb2,_0x1b40db]=await Promise['all']([_0x3ddd0e['journey']['listJourneysFromParentSegment'](_0x195bc7,undefined,{'includeAllVersions':!![]}),_0x3ddd0e[_0x3ba13f(0x28f)][_0x3ba13f(0x263)](_0x195bc7)]);return{'journeys':_0x13bbb2,'folders':_0x1b40db};},{'verbose':_0x4f3d60[_0x2b4585(0x23e)]})[_0x2b4585(0x248)](_0x58a825=>_0x58a825[_0x2b4585(0x268)]);let _0x38dd7e=_0x33bf08;const _0x323fec=buildFolderIdToPathMap(_0x139d0b);if(_0xd0b8b0){const _0x136c7d=_0x38dd7e[_0x2b4585(0x25c)](_0x567c0e=>_0x567c0e[_0x2b4585(0x2b1)]['toLowerCase']()===_0xd0b8b0[_0x2b4585(0x2e5)]());if(_0x136c7d[_0x2b4585(0x26f)]===0x0)return console[_0x2b4585(0x290)]('Error:\x20Journey\x20not\x20found:\x20'+_0xd0b8b0),console[_0x2b4585(0x290)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x38dd7e=_0x136c7d;}if(_0x1d906d!==undefined){const _0x482e04=_0x38dd7e[_0x2b4585(0x25c)](_0x4095e0=>{const _0x4fc679=_0x2b4585,_0x3324b7=_0x4095e0[_0x4fc679(0x22d)]?_0x323fec[_0x4fc679(0x269)](_0x4095e0[_0x4fc679(0x22d)])||'':'';return _0x3324b7===_0x1d906d;});if(_0x482e04['length']===0x0&&_0x38dd7e[_0x2b4585(0x26f)]>0x0){console['error'](_0x2b4585(0x1ef)+_0xd0b8b0+_0x2b4585(0x2bc)+(_0x1d906d||_0x2b4585(0x2d2))),console['error'](_0x2b4585(0x23f));for(const _0x32ec49 of _0x38dd7e){const _0x4db3a9=_0x32ec49[_0x2b4585(0x22d)]?_0x323fec[_0x2b4585(0x269)](_0x32ec49[_0x2b4585(0x22d)])||'':'';console[_0x2b4585(0x290)](_0x2b4585(0x27b)+(_0x4db3a9||_0x2b4585(0x2a5))+'/'+_0x32ec49[_0x2b4585(0x2b1)]);}return 0x1;}_0x38dd7e=_0x482e04;}if(_0x38dd7e[_0x2b4585(0x26f)]===0x0)return console[_0x2b4585(0x290)](_0x2b4585(0x278)),0x0;const _0xde5772=new Map();for(const _0x519747 of _0x38dd7e){const _0x1c0eb6=_0x519747[_0x2b4585(0x242)];!_0xde5772['has'](_0x1c0eb6)&&_0xde5772[_0x2b4585(0x272)](_0x1c0eb6,[]),_0xde5772['get'](_0x1c0eb6)['push'](_0x519747);}for(const _0x3c98d0 of _0xde5772[_0x2b4585(0x20a)]()){_0x3c98d0[_0x2b4585(0x1f8)]((_0x324335,_0x52acaf)=>(_0x324335[_0x2b4585(0x22f)]||0x0)-(_0x52acaf[_0x2b4585(0x22f)]||0x0));}const _0x4cd1cf=[],{idToEmailMap:_0x532bf9,connectionIdToNameMap:_0x22e066}=await withSpinner(_0x2b4585(0x2a7),async()=>{const _0x52967b=_0x2b4585,[_0x3ccc04,_0x56d3c9]=await Promise[_0x52967b(0x210)]([_0x3ddd0e[_0x52967b(0x270)][_0x52967b(0x251)](),_0x3ddd0e['connection'][_0x52967b(0x2e3)]()]);return{'idToEmailMap':_0x3ccc04,'connectionIdToNameMap':_0x56d3c9};},{'verbose':_0x4f3d60['verbose']})[_0x2b4585(0x248)](_0x73a7fa=>_0x73a7fa[_0x2b4585(0x268)]);for(const _0x7bc0e9 of _0xde5772[_0x2b4585(0x20a)]()){const _0x171802=_0x7bc0e9[0x0][_0x2b4585(0x2b1)],_0x4244dc=_0x7bc0e9[0x0][_0x2b4585(0x22d)],_0xa22d1=_0x4244dc?_0x323fec[_0x2b4585(0x269)](_0x4244dc)||'':'',_0x6d7ef3=_0xa22d1?a28_0x40243d[_0x2b4585(0x2c9)](_0x43b3cc,_0xa22d1):_0x43b3cc,_0x48ed3f=_0x5f2170||a28_0x40243d[_0x2b4585(0x2c9)](_0x6d7ef3,sanitizeFileName(_0x171802)+'.yml');let _0x433062,_0x37dd05;if(existsSync(_0x48ed3f))try{const _0x8898c5=readFileSync(_0x48ed3f,_0x2b4585(0x26b)),_0x1a9d2f=parseYamlString(_0x8898c5);_0x37dd05=_0x1a9d2f,_0x433062=buildRuleToNameMapping(_0x1a9d2f),_0x4d2464[_0x2b4585(0x23e)]&&_0x433062['size']>0x0&&console[_0x2b4585(0x290)](_0x2b4585(0x29c)+_0x433062[_0x2b4585(0x2e2)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x171802);}catch(_0xae8c27){_0x4d2464[_0x2b4585(0x23e)]&&console[_0x2b4585(0x290)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0xae8c27[_0x2b4585(0x291)]);}const _0x13f3ab=[],_0x2697a5=new Set(),_0x5efb8f=new Map(),_0x5c7143=new Map(),_0x3c9e07=new Set(),_0x4c077a=new Map(),_0x5a3878=new Map(),_0x398cdd=createJumpTargetCache();await withProgressSpinner(_0x2b4585(0x1fd)+_0x171802+_0x2b4585(0x295),async _0x41315c=>{const _0x5033b4=_0x2b4585;for(const _0x5e8f8d of _0x7bc0e9){const _0xe4aa22=_0x7bc0e9['length']>0x1?_0x5e8f8d[_0x5033b4(0x2b1)]+'\x20v'+(_0x5e8f8d[_0x5033b4(0x22f)]||0x1):_0x5e8f8d[_0x5033b4(0x2b1)];_0x41315c[_0x5033b4(0x2e4)](_0x5033b4(0x1fd)+_0xe4aa22);const _0x3b8cfa=await _0x3ddd0e['journey'][_0x5033b4(0x2a2)](_0x5e8f8d['id']),_0x272003=_0x3b8cfa['attributes']?.['audienceId'],_0x62285={'resolveSegment':async _0xec029f=>{const _0xe455e7=_0x5033b4;if(!_0x272003)return{'name':_0xec029f,'isJourneyLocal':![]};const _0x246fa9=_0x5efb8f[_0xe455e7(0x269)](_0xec029f);if(_0x246fa9)return _0x246fa9;try{const _0x2986b=await _0x3ddd0e[_0xe455e7(0x28f)][_0xe455e7(0x2e0)](_0x272003,_0xec029f),_0x26de81=_0x2986b['kind']===SEGMENT_KIND_JOURNEY;let _0x217eca,_0x1288c8=_0x2986b[_0xe455e7(0x2b0)];if(_0x26de81&&_0x2986b[_0xe455e7(0x24d)]){const _0x1c6ec5=await segmentResponseToDef(_0x2986b,{'resolveSegmentName':async _0x54294a=>{const _0x486fac=_0xe455e7,_0x3f71a4=_0x5efb8f[_0x486fac(0x269)](_0x54294a);if(_0x3f71a4)return _0x3f71a4[_0x486fac(0x2b0)];const _0x4d9da9=await _0x62285['resolveSegment'](_0x54294a);return _0x4d9da9[_0x486fac(0x2b0)];}}),_0x3ec7a9=_0x1c6ec5[_0xe455e7(0x24d)];_0x217eca={'description':_0x2986b[_0xe455e7(0x2e1)],'rule':_0x3ec7a9};const _0x3dc1c8=serializeRule(_0x3ec7a9),_0x5b3e3a=_0x5c7143[_0xe455e7(0x269)](_0x3dc1c8);if(_0x5b3e3a)_0x1288c8=_0x5b3e3a,_0x217eca=undefined,_0x4d2464[_0xe455e7(0x23e)]&&console[_0xe455e7(0x290)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x2986b[_0xe455e7(0x2b0)]+_0xe455e7(0x252)+_0x5b3e3a);else{let _0x3b97c7=![];if(_0x433062){const _0x1a16c8=_0x433062['get'](_0x3dc1c8);if(_0x1a16c8){const _0x3d0911=_0x1a16c8[_0xe455e7(0x287)](_0x385d86=>!_0x2697a5[_0xe455e7(0x222)](_0x385d86));_0x3d0911&&(_0x1288c8=_0x3d0911,_0x2697a5[_0xe455e7(0x265)](_0x3d0911),_0x5c7143[_0xe455e7(0x272)](_0x3dc1c8,_0x3d0911),_0x3b97c7=!![],_0x4d2464[_0xe455e7(0x23e)]&&console['error'](_0xe455e7(0x208)+_0x3d0911+_0xe455e7(0x214)));}}if(!_0x3b97c7){const _0x3b748d=generateJourneyLocalName(_0x2986b[_0xe455e7(0x2b0)]);_0x3b748d&&(_0x1288c8=_0x3b748d);let _0x465e9a=_0x1288c8,_0x1ae6ed=0x2;while(_0x2697a5['has'](_0x465e9a)){_0x465e9a=_0x1288c8+'_'+_0x1ae6ed,_0x1ae6ed++;}_0x2697a5[_0xe455e7(0x265)](_0x465e9a),_0x5c7143[_0xe455e7(0x272)](_0x3dc1c8,_0x465e9a),_0x1288c8=_0x465e9a;}}}const _0x450b78={'name':_0x1288c8,'isJourneyLocal':_0x26de81,'definition':_0x217eca};return _0x5efb8f[_0xe455e7(0x272)](_0xec029f,_0x450b78),_0x450b78;}catch(_0x5212fb){return _0x4f3d60[_0xe455e7(0x23e)]&&console[_0xe455e7(0x290)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0xec029f+':\x20'+_0x5212fb[_0xe455e7(0x291)]),{'name':_0xec029f,'isJourneyLocal':![]};}},'resolveActivation':async _0x5d70cd=>{const _0x25c324=_0x5033b4,_0x302a66=_0x4c077a[_0x25c324(0x269)](_0x5d70cd);if(_0x302a66)return _0x302a66;try{const _0x4edcb9=await _0x3ddd0e['journey']['getActivation'](_0x5e8f8d['id'],_0x5d70cd),_0x317aab=journeyActivationStepToYaml(_0x4edcb9,_0x532bf9,_0x22e066),_0x2e95ba=JSON[_0x25c324(0x1f5)]({'name':_0x317aab['name'],'connection':_0x317aab[_0x25c324(0x21d)],'connector_config':_0x317aab[_0x25c324(0x27a)]}),_0x242186=_0x5a3878[_0x25c324(0x269)](_0x2e95ba);if(_0x242186){const _0x4d7169={'name':_0x242186,'isJourneyLocal':!![],'definition':_0x317aab};return _0x4c077a['set'](_0x5d70cd,_0x4d7169),_0x4d7169;}const _0x57a167=_0x4edcb9[_0x25c324(0x2a1)]['activationParams'][_0x25c324(0x2b0)]||_0x5d70cd,_0x5718d1=sanitizeYamlKey(_0x57a167)||'activation_'+_0x5d70cd;let _0xfa0eca=_0x5718d1,_0x470fb9=0x2;while(_0x3c9e07['has'](_0xfa0eca)){_0xfa0eca=_0x5718d1+'_'+_0x470fb9,_0x470fb9++;}_0x3c9e07['add'](_0xfa0eca),_0x5a3878[_0x25c324(0x272)](_0x2e95ba,_0xfa0eca);const _0x371eaa={'name':_0xfa0eca,'isJourneyLocal':!![],'definition':_0x317aab};return _0x4c077a[_0x25c324(0x272)](_0x5d70cd,_0x371eaa),_0x371eaa;}catch(_0x55d718){return _0x4f3d60[_0x25c324(0x23e)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x5d70cd+':\x20'+_0x55d718[_0x25c324(0x291)]),{'name':_0x5d70cd,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x225a72,_0x3357a9)=>{const _0x1012b8=_0x5033b4;return resolveJumpTarget(_0x225a72,_0x3357a9,_0x398cdd,_0x406ad0=>_0x3ddd0e['journey'][_0x1012b8(0x2a2)](_0x406ad0));}},_0x1a390f=await journeyResponseToDef(_0x3b8cfa,_0x62285);_0x13f3ab['push']({'item':_0x5e8f8d,'yaml':_0x1a390f});}},{'verbose':_0x4f3d60[_0x2b4585(0x23e)]});const _0x3f0ea3=await _0x3ddd0e[_0x2b4585(0x259)][_0x2b4585(0x241)](_0x7bc0e9[0x0][_0x2b4585(0x242)]),_0x56cfcb=buildMergedJourneyDef(_0x13f3ab,_0x433062,_0x3f0ea3),_0x562706=normalizeJourneyDef(_0x56cfcb,_0x37dd05),_0x2d10c8=toYamlString(_0x562706),_0x17520e=_0x5f2170||a28_0x40243d[_0x2b4585(0x2c9)](_0x6d7ef3,sanitizeFileName(_0x171802)+'.yml');!_0x5f2170&&_0xa22d1&&!existsSync(_0x6d7ef3)&&mkdirSync(_0x6d7ef3,{'recursive':!![]});const _0x27de6d=a28_0x40243d[_0x2b4585(0x1fe)](process[_0x2b4585(0x1ea)](),_0x17520e);if(existsSync(_0x17520e)){const _0x11c483=readFileSync(_0x17520e,_0x2b4585(0x26b)),_0x145e0d=generateDiff(_0x11c483,_0x2d10c8),_0x16c5ef=hasChanges(_0x145e0d);_0x4cd1cf[_0x2b4585(0x20e)]({'relativePath':_0x27de6d,'absolutePath':_0x17520e,'content':_0x2d10c8,'isNew':![],'hasChanges':_0x16c5ef,'diff':_0x16c5ef?formatDiffWithColors(_0x145e0d):undefined});}else _0x4cd1cf[_0x2b4585(0x20e)]({'relativePath':_0x27de6d,'absolutePath':_0x17520e,'content':_0x2d10c8,'isNew':!![],'hasChanges':![]});}const _0x5df0a8=_0x4cd1cf[_0x2b4585(0x25c)](_0x589b89=>_0x589b89[_0x2b4585(0x2db)]),_0x2fa6b1=_0x4cd1cf['filter'](_0x546020=>!_0x546020[_0x2b4585(0x2db)]&&_0x546020[_0x2b4585(0x2b3)]),_0x265bf5=_0x4cd1cf['filter'](_0x37976f=>!_0x37976f[_0x2b4585(0x2db)]&&!_0x37976f[_0x2b4585(0x2b3)]),_0xf623c5=_0x38dd7e[_0x2b4585(0x26f)],_0xab81d5=_0xde5772[_0x2b4585(0x2e2)],_0x435b75=_0xf623c5>_0xab81d5?'\x20('+_0xf623c5+_0x2b4585(0x22e):'';console[_0x2b4585(0x290)]('\x0aPull\x20summary:'),console[_0x2b4585(0x290)]('\x20\x20'+a28_0x49ddf2[_0x2b4585(0x25b)](_0xab81d5+'\x20journeys')+a28_0x49ddf2[_0x2b4585(0x228)](_0x435b75)),console['error']('\x20\x20'+a28_0x49ddf2['green']('+\x20'+_0x5df0a8['length']+_0x2b4585(0x256))),console[_0x2b4585(0x290)]('\x20\x20'+a28_0x49ddf2[_0x2b4585(0x2ca)]('~\x20'+_0x2fa6b1[_0x2b4585(0x26f)]+_0x2b4585(0x282))),console[_0x2b4585(0x290)]('\x20\x20'+a28_0x49ddf2[_0x2b4585(0x228)]('=\x20'+_0x265bf5[_0x2b4585(0x26f)]+_0x2b4585(0x1ff))),console[_0x2b4585(0x290)](_0x2b4585(0x216)+a28_0x49ddf2['cyan'](_0x43b3cc)+'\x0a');if(_0x2fa6b1[_0x2b4585(0x26f)]>0x0)for(const _0x389bb6 of _0x2fa6b1){console[_0x2b4585(0x290)]('\x0aChanges\x20to\x20\x27'+_0x389bb6[_0x2b4585(0x201)]+'\x27:'),console[_0x2b4585(0x290)]('─'[_0x2b4585(0x2c4)](0x3c)),console[_0x2b4585(0x290)](_0x389bb6['diff']),console['error']('─'[_0x2b4585(0x2c4)](0x3c));}if(_0x4d2464[_0x2b4585(0x232)])return console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x2ca)](_0x2b4585(0x2c0))),0x0;if(_0x5df0a8[_0x2b4585(0x26f)]===0x0&&_0x2fa6b1[_0x2b4585(0x26f)]===0x0)return console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x2bd)](_0x2b4585(0x2be))),saveSessionContext({'parent_segment':_0x40ef46},_0x4d2464[_0x2b4585(0x226)]),console[_0x2b4585(0x290)](a28_0x49ddf2['green'](_0x2b4585(0x2cb)+a28_0x49ddf2['dim'](_0x2b4585(0x285))+_0x2b4585(0x250)+a28_0x49ddf2[_0x2b4585(0x25b)](_0x40ef46))),0x0;if(!_0x4d2464[_0x2b4585(0x221)]&&(_0x5df0a8[_0x2b4585(0x26f)]>0x0||_0x2fa6b1['length']>0x0)){if(!isInteractive())return console['error'](a28_0x49ddf2[_0x2b4585(0x254)](_0x2b4585(0x1f6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a28_0x49ddf2['dim'](_0x2b4585(0x203))),0x1;const _0x187aa8=await confirmKey(_0x2b4585(0x23c)+(_0x5df0a8[_0x2b4585(0x26f)]+_0x2fa6b1[_0x2b4585(0x26f)])+_0x2b4585(0x2cc));if(!_0x187aa8)return console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x2ca)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x43b3cc)&&mkdirSync(_0x43b3cc,{'recursive':!![]});const _0x4fbf58=a28_0x40243d[_0x2b4585(0x2c9)](_0x43b3cc,_0x2b4585(0x2b8));writeFileSync(_0x4fbf58,createTdxConfigContent(_0x40ef46),'utf-8');for(const _0x1d21ef of _0x4cd1cf){(_0x1d21ef[_0x2b4585(0x2db)]||_0x1d21ef[_0x2b4585(0x2b3)])&&writeFileSync(_0x1d21ef[_0x2b4585(0x1e5)],_0x1d21ef[_0x2b4585(0x27c)],'utf-8');}return console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x2bd)]('✔\x20Pulled\x20'+(_0x5df0a8['length']+_0x2fa6b1[_0x2b4585(0x26f)])+'\x20journey\x20files\x20to\x20'+_0x43b3cc)),saveSessionContext({'parent_segment':_0x40ef46},_0x4d2464[_0x2b4585(0x226)]),console['error'](a28_0x49ddf2['green']('✔\x20Context\x20set:\x20'+a28_0x49ddf2[_0x2b4585(0x228)](_0x2b4585(0x285))+_0x2b4585(0x250)+a28_0x49ddf2[_0x2b4585(0x25b)](_0x40ef46))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x20b);['description']='Show\x20journey\x20table\x20column\x20mapping';async[a28_0x28f764(0x231)](_0x1f2e69){const _0x42444a=a28_0x28f764,{options:_0xe43e5f,args:_0x4ed14a,tdx:_0x2d124f}=_0x1f2e69,_0xa15e45=_0x4ed14a[0x0];if(!requireNameOrPath(_0xa15e45))return 0x1;_0xe43e5f[_0x42444a(0x23e)]&&console[_0x42444a(0x290)]('Input:\x20'+_0xa15e45);const {journeyId:_0x5e63e8}=await resolveJourneyIdFromInput(_0xa15e45,_0xe43e5f,_0x2d124f),_0x353128=await withSpinner(_0x42444a(0x25f),()=>_0x2d124f['journey'][_0x42444a(0x2a6)](_0x5e63e8),{'verbose':_0xe43e5f['verbose']}),_0x37a7cb=_0x353128[_0x42444a(0x268)];return console[_0x42444a(0x1e7)](_0x42444a(0x2a4)+_0x37a7cb[_0x42444a(0x284)]),console[_0x42444a(0x1e7)]('Table:\x20'+_0x37a7cb[_0x42444a(0x1e9)]),await handleSDKOutput(_0x37a7cb['columns'],_0xe43e5f),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x2ad);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x247);async[a28_0x28f764(0x231)](_0x1eb08f){const _0x36a4c0=a28_0x28f764,{options:_0x1a6e1f,args:_0x56328d,tdx:_0x19872b}=_0x1eb08f,_0x3e160e=_0x56328d[0x0];if(!requireNameOrPath(_0x3e160e))return 0x1;_0x1a6e1f[_0x36a4c0(0x23e)]&&console[_0x36a4c0(0x290)](_0x36a4c0(0x238)+_0x3e160e);const {journeyId:_0x3cf968}=await resolveJourneyIdFromInput(_0x3e160e,_0x1a6e1f,_0x19872b),_0x50952d=await withSpinner(_0x36a4c0(0x273),()=>_0x19872b[_0x36a4c0(0x259)]['listActivationsFlat'](_0x3cf968),{'verbose':_0x1a6e1f[_0x36a4c0(0x23e)]}),_0x29dec1=_0x50952d[_0x36a4c0(0x268)];return console[_0x36a4c0(0x290)](_0x36a4c0(0x29c)+_0x29dec1['length']+'\x20activation'+(_0x29dec1['length']!==0x1?'s':'')),await handleSDKOutput(_0x29dec1,_0x1a6e1f),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x2bb);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x24c);[a28_0x28f764(0x1e6)]=new SegmentPushCommand();async[a28_0x28f764(0x231)](_0x5d71fd){const _0x41d868=a28_0x28f764,_0x2636d0=_0x5d71fd['args'][0x0];let _0x9da228;if(_0x2636d0){const _0x1ab1ec=await resolveTarget({'arg':_0x2636d0,'contextParent':_0x5d71fd[_0x41d868(0x281)][_0x41d868(0x205)],'cwd':process[_0x41d868(0x1ea)]()});isSuccessfulResolution(_0x1ab1ec)&&_0x1ab1ec[_0x41d868(0x294)]===_0x41d868(0x262)&&(_0x9da228=_0x1ab1ec['filePath']);}const _0x452a42={..._0x5d71fd,'options':{..._0x5d71fd[_0x41d868(0x281)],'journeysOnly':!![],..._0x9da228&&{'singleFilePath':_0x9da228}}};return this[_0x41d868(0x1e6)]['execute'](_0x452a42);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x25a);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x257);async[a28_0x28f764(0x231)](_0x348814){const _0x123ec1=a28_0x28f764,{options:_0x4eb815,args:_0x2af5bf,tdx:_0x3ef98d}=_0x348814,_0xc166fe=_0x2af5bf[0x0];if(!requireNameOrPath(_0xc166fe))return 0x1;if(_0x4eb815[_0x123ec1(0x23e)])console[_0x123ec1(0x290)]('Input:\x20'+_0xc166fe);const {journeyId:_0x1b9536}=await resolveJourneyIdFromInput(_0xc166fe,_0x4eb815,_0x3ef98d),_0x584dba=await withSpinner(_0x123ec1(0x2d0),()=>_0x3ef98d[_0x123ec1(0x259)][_0x123ec1(0x236)](_0x1b9536),{'verbose':_0x4eb815[_0x123ec1(0x23e)]}),{bundleName:_0x23241e,versions:_0x5e9846,latestJourneyId:_0x386c90}=_0x584dba[_0x123ec1(0x268)];console[_0x123ec1(0x290)](_0x23241e+':\x20'+_0x5e9846[_0x123ec1(0x26f)]+_0x123ec1(0x212)+(_0x5e9846[_0x123ec1(0x26f)]!==0x1?'s':''));const _0x2a198c=_0x5e9846[_0x123ec1(0x202)](_0x353849=>({'version':_0x353849[_0x123ec1(0x22f)],'journey_id':_0x353849['journeyId'],'name':_0x353849['name'],'state':_0x353849[_0x123ec1(0x2de)],'paused':_0x353849[_0x123ec1(0x240)],'latest':_0x353849[_0x123ec1(0x2e8)]===_0x386c90,'created_at':_0x353849[_0x123ec1(0x293)]}));return await handleSDKOutput(_0x2a198c,_0x4eb815),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x1f3);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a28_0x28f764(0x231)](_0x8b71d4){const _0x5c506c=a28_0x28f764,{options:_0x58a4e2,args:_0x2c1bb1,tdx:_0x41d212}=_0x8b71d4,_0xcc1928=_0x2c1bb1[0x0];if(!requireNameOrPath(_0xcc1928))return 0x1;if(_0x58a4e2['verbose'])console[_0x5c506c(0x290)](_0x5c506c(0x238)+_0xcc1928);const {journeyId:_0x47210b,journeyName:_0x1a824d}=await resolveJourneyIdFromInput(_0xcc1928,_0x58a4e2,_0x41d212);if(!_0x58a4e2[_0x5c506c(0x221)]){const _0x52dcef=await confirm(_0x5c506c(0x2c2)+_0x1a824d+'\x22?');if(!_0x52dcef)return console[_0x5c506c(0x290)](_0x5c506c(0x21f)),0x0;}const _0xd579e2=await withSpinner(_0x5c506c(0x258),()=>_0x41d212[_0x5c506c(0x259)][_0x5c506c(0x267)](_0x47210b),{'verbose':_0x58a4e2[_0x5c506c(0x23e)]}),_0xd220ff=_0xd579e2[_0x5c506c(0x268)];return console[_0x5c506c(0x290)](a28_0x49ddf2['green']('✔')+_0x5c506c(0x27f)+_0xd220ff[_0x5c506c(0x2a1)][_0x5c506c(0x22f)]+'\x20(draft)\x20—\x20\x22'+_0xd220ff[_0x5c506c(0x2a1)][_0x5c506c(0x2b0)]+'\x22'),console[_0x5c506c(0x290)]('\x20\x20Journey\x20ID:\x20'+_0xd220ff['id']),await handleSingleObjectOutput({'id':_0xd220ff['id'],'name':_0xd220ff[_0x5c506c(0x2a1)][_0x5c506c(0x2b0)],'version':_0xd220ff['attributes'][_0x5c506c(0x22f)],'state':_0xd220ff[_0x5c506c(0x2a1)][_0x5c506c(0x2de)],'bundle_id':_0xd220ff['attributes'][_0x5c506c(0x242)],'created_at':_0xd220ff[_0x5c506c(0x2a1)][_0x5c506c(0x293)]},_0x58a4e2),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x2a9);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x2e6);async[a28_0x28f764(0x231)](_0x22f8b7){const _0x4f96a2=a28_0x28f764,{options:_0x30c248,args:_0x534406,tdx:_0x14e525}=_0x22f8b7,_0x54066c=_0x534406[0x0];if(!requireNameOrPath(_0x54066c))return 0x1;const _0x13e059=_0x30c248[_0x4f96a2(0x29e)];if(!_0x13e059)return console[_0x4f96a2(0x290)](_0x4f96a2(0x239)),console['error'](_0x4f96a2(0x206)),0x1;const _0x44c93d=parseInt(_0x13e059,0xa);if(isNaN(_0x44c93d)||_0x44c93d<0x1)return console[_0x4f96a2(0x290)](_0x4f96a2(0x21a)+_0x13e059),0x1;if(_0x30c248[_0x4f96a2(0x23e)])console[_0x4f96a2(0x290)](_0x4f96a2(0x238)+_0x54066c+_0x4f96a2(0x2af)+_0x44c93d);const {journeyId:_0x42886d,parentSegmentId:_0x123dbb}=await resolveJourneyIdFromInput(_0x54066c,_0x30c248,_0x14e525),_0x1cc7a6=await withSpinner(_0x4f96a2(0x271),()=>_0x14e525[_0x4f96a2(0x259)][_0x4f96a2(0x236)](_0x42886d),{'verbose':_0x30c248[_0x4f96a2(0x23e)]}),{versions:_0x360303,latestJourneyId:_0xab52ee}=_0x1cc7a6[_0x4f96a2(0x268)],_0x1c983b=_0x360303[_0x4f96a2(0x287)](_0x125e92=>_0x125e92[_0x4f96a2(0x22f)]===_0x44c93d);if(!_0x1c983b){const _0x7340fa=_0x360303[_0x4f96a2(0x202)](_0x371810=>'v'+_0x371810[_0x4f96a2(0x22f)])['join'](',\x20');return console[_0x4f96a2(0x290)](_0x4f96a2(0x280)+_0x44c93d+_0x4f96a2(0x264)+_0x7340fa),0x1;}const _0x38b8d0=await withSpinner(_0x4f96a2(0x286)+_0x44c93d+'\x20details...',()=>_0x14e525['journey'][_0x4f96a2(0x2a2)](_0x1c983b[_0x4f96a2(0x2e8)]),{'verbose':_0x30c248[_0x4f96a2(0x23e)]}),_0x5010f4=_0x38b8d0['data'],_0x5e1956=getConsoleNextUrl(_0x30c248['site'],_0x4f96a2(0x246)+_0x123dbb+'/e/'+_0x1c983b[_0x4f96a2(0x2e8)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x5010f4['id'],'name':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x2b0)],'version':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x22f)],'description':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x2e1)],'state':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x2de)],'paused':_0x5010f4[_0x4f96a2(0x2a1)]['paused'],'reentry_mode':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x1f7)],'stages':_0x5010f4[_0x4f96a2(0x2a1)]['journeyStages']?.[_0x4f96a2(0x26f)]||0x0,..._0x5010f4['attributes']['goal']&&{'goal':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x28c)][_0x4f96a2(0x2b0)]},'latest':_0x1c983b['journeyId']===_0xab52ee,'created_at':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x293)],'updated_at':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x2d6)],'url':_0x5e1956},_0x30c248),0x0;}}
1
+ const a28_0x41d493=a28_0x3602;(function(_0x530381,_0x49cf0d){const _0x3abcb2=a28_0x3602,_0x3f15e9=_0x530381();while(!![]){try{const _0x30b307=-parseInt(_0x3abcb2(0x13f))/0x1+parseInt(_0x3abcb2(0x15d))/0x2+-parseInt(_0x3abcb2(0x175))/0x3+parseInt(_0x3abcb2(0x170))/0x4*(parseInt(_0x3abcb2(0x152))/0x5)+parseInt(_0x3abcb2(0x147))/0x6+parseInt(_0x3abcb2(0x125))/0x7*(parseInt(_0x3abcb2(0x185))/0x8)+-parseInt(_0x3abcb2(0x14d))/0x9;if(_0x30b307===_0x49cf0d)break;else _0x3f15e9['push'](_0x3f15e9['shift']());}catch(_0x21b21c){_0x3f15e9['push'](_0x3f15e9['shift']());}}}(a28_0x19be,0x4a984));import a28_0x458e20 from'chalk';import a28_0x3d093a from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';function a28_0x3602(_0x4daaac,_0x591cf7){_0x4daaac=_0x4daaac-0xbd;const _0x19be5c=a28_0x19be();let _0x36024a=_0x19be5c[_0x4daaac];return _0x36024a;}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(_0x2bbd45){const _0x5afb22=a28_0x3602;return!_0x2bbd45&&(console[_0x5afb22(0x16c)](_0x5afb22(0x1c3)),console[_0x5afb22(0x16c)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x2bbd45;}function withJsonFormat(_0x2e0631){const _0x4e5317=a28_0x3602;if(!_0x2e0631[_0x4e5317(0x10f)]&&!_0x2e0631['json']&&!_0x2e0631[_0x4e5317(0x1c6)]&&!_0x2e0631[_0x4e5317(0x14c)])return{..._0x2e0631,'format':'json','json':!![]};return _0x2e0631;}function formatJourneyState(_0x45ab39){const _0x506019=a28_0x3602;switch(_0x45ab39){case _0x506019(0xe6):return a28_0x458e20[_0x506019(0x1ac)]('(running)');case'draft':return a28_0x458e20[_0x506019(0x1c4)](_0x506019(0xeb));case _0x506019(0xe2):return a28_0x458e20[_0x506019(0xf0)](_0x506019(0x186));case _0x506019(0x1c2):return a28_0x458e20[_0x506019(0x119)]('(completed)');case _0x506019(0x153):return a28_0x458e20[_0x506019(0x1c4)](_0x506019(0x183));default:return'('+_0x45ab39+')';}}function formatJourneyItem(_0x3f3567,_0x4d6756='',_0xa054){const _0x35edb5=a28_0x3602,_0x13c8ca=formatJourneyState(_0x3f3567[_0x35edb5(0x133)]),_0x4a0c8e=_0xa054?hyperlink(_0x3f3567[_0x35edb5(0x197)],_0xa054):_0x3f3567[_0x35edb5(0x197)];return _0x4d6756+_0x35edb5(0x13d)+_0x4a0c8e+'\x20'+_0x13c8ca;}function escapeRegex(_0x20f17d){const _0x5687de=a28_0x3602;return _0x20f17d[_0x5687de(0xda)](/[.*+?^${}()|[\]\\]/g,_0x5687de(0x17b));}function globToRegex(_0x2c6a54){const _0x4ace8f=a28_0x3602,_0x59c00a=_0x2c6a54[_0x4ace8f(0x10a)]('*')[_0x4ace8f(0x143)](escapeRegex);return new RegExp(_0x59c00a[_0x4ace8f(0x1a8)]('.*'),'i');}function buildRuleToNameMapping(_0x5c40b3){const _0x82ede=a28_0x3602,_0x1dd2f9=new Map();if(_0x5c40b3[_0x82ede(0x150)])for(const [_0x396902,_0x3dbc26]of Object['entries'](_0x5c40b3[_0x82ede(0x150)])){if(_0x3dbc26[_0x82ede(0x1ba)]){const _0x1e6b74=serializeRule(_0x3dbc26[_0x82ede(0x1ba)]),_0x1a868e=_0x1dd2f9[_0x82ede(0x174)](_0x1e6b74);_0x1a868e?_0x1a868e[_0x82ede(0xde)](_0x396902):_0x1dd2f9['set'](_0x1e6b74,[_0x396902]);}}return _0x1dd2f9;}async function resolveJourneyIdFromInput(_0x2c36e5,_0x5e6367,_0x368fc4){const _0x40614e=a28_0x3602,_0x3b9ddc=await resolveJourneyTarget(_0x2c36e5,_0x5e6367[_0x40614e(0x182)],_0x5e6367[_0x40614e(0x181)]),_0x5db834=_0x3b9ddc[_0x40614e(0x182)];if(!_0x5db834)throw new SDKError(ErrorCode[_0x40614e(0x16f)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x1d45ef=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x368fc4[_0x40614e(0x18d)][_0x40614e(0x178)](_0x5db834),{'verbose':_0x5e6367[_0x40614e(0x181)]}),_0x162313=_0x1d45ef[_0x40614e(0x11f)],_0x1d29c8=await withSpinner('Resolving\x20journey...',()=>_0x368fc4[_0x40614e(0x14b)]['resolveJourneyId'](_0x162313,_0x3b9ddc[_0x40614e(0x140)]),{'verbose':_0x5e6367['verbose']});return{'journeyId':_0x1d29c8[_0x40614e(0x11f)],'journeyName':_0x3b9ddc[_0x40614e(0x140)],'parentSegmentId':_0x162313};}function a28_0x19be(){const _0x75cf5a=['journey:push','split','options','entries','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Parent\x20segment:\x20','format','args','folderPath','Fetching\x20','cwd','conversion','Getting\x20journey\x20traffic\x20data...','parentName','Database:\x20','\x22\x20paused','blue','\x20not\x20found.\x20Available:\x20','Show\x20journey\x20table\x20column\x20mapping','folderId','Resolved\x20YAML\x20file:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','data','✔\x20Found\x20','Export\x20journey(s)\x20as\x20YAML\x20files','\x20(rule\x20match)','log','helpText','1061767BLdfbK','repeat','yes','dryRun','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','includeStats','getParentFull','Error:\x20Stage\x20\x22','createdAt','✔\x20Pulled\x20','Error:\x20Journey\x20not\x20found:\x20','Getting\x20journey\x20statistics...','-\x20no\x20files\x20written','pause','state','listJourneysWithFolders','Write\x20','Listing\x20journey\x20versions...','hasChanges','\x20unchanged\x20files','journeyId','Resume\x20a\x20paused\x20journey','\x20->\x20','stage','🗺️\x20','attributes','528918YVArOa','journeyName','name','content','map','test','renderStats','exitOrJumpSize','3066762cVqRXg','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Getting\x20journey\x20details...','\x20(draft)\x20—\x20\x22','journey','tsv','6213033nRFSgw','\x20details...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','segments','no_parent','499145hsaPsZ','archived','/e/','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Folder\x20path:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','getJourney','\x20=\x20','toLowerCase','connector_config','Pause\x20a\x20running\x20journey','454806nhgJXR','add','exitOrJumpRate','journey:traffic','/j/da/je','\x20journeys','segmentName','cyan','columns','\x22\x20resumed','goalSize','getLatestJourneyId','getStatistics','Getting\x20version\x20','database','error','diff','journey:resume','INVALID_ARGUMENT','20DlFEXa','Options:','activation','Error:\x20Invalid\x20--type\x20\x22','get','958812eJiQLh','set','relative','resolveParentId','journeyBundleId','\x0aChanges\x20to\x20\x27','\x5c$&','Fetching\x20users\x20and\x20connections...','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','folders','audienceId','✔\x20Context\x20set:\x20','verbose','parentSegment','(archived)','web','32KPhvLx','(paused)','\x20Opening\x20','Folder\x20path:\x20','\x20\x20-\x20','user','journey:list','connection','segment','includeHistory','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','red','List\x20journeys\x20in\x20current\x20context','json','has','errorCode','Show\x20journey\x20details','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyBundleName','/app/ps/','getTrafficData','history','filter','journeys','isNew','\x20versions)','parent_segment','from','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','.yml','Table:\x20','journeyStages','targetDir','List\x20all\x20versions\x20of\x20a\x20journey','Error:\x20Version\x20','join','journey:activations','table','resolveSegment','green','segmentPushCommand','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Cancelled','sort','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Pattern:\x20','rootFolderId','stages','milestoneSize','buildIdToEmailMap','rule','Journey\x20name:\x20','Input:\x20','✔\x20Journey\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','List\x20activations\x20for\x20a\x20journey','find','getActivation','completed','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','dim','Resolving\x20version...','jsonl','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','versionNumber','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','site','reentryMode','\x0aPull\x20summary:','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','file','utf-8','getSegment','journey:pause','Fetching\x20journeys\x20and\x20folders...','Parent\x20segment:\x20','\x20\x20Journey\x20ID:\x20','activationParams','all','\x20activation','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','session','/j/da','Aborted.','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','completeMilestoneRate','description','completionRate','\x20journey\x20files\x20to\x20','stringify','size','replace','Listing\x20journey\x20activations...','buildIdToNameMap','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','push','listVersions','Resolving\x20parent\x20segment...','\x27\x20not\x20found\x20in\x20','paused','Resuming\x20journey...','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','localeCompare','launched','(root)','stageNameMap','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x20\x20Name:\x20','(draft)','Target\x20directory:\x20','message','Show\x20journey\x20statistics','Found\x20','yellow','\x20\x20Statistics\x20not\x20available','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journey:pull','length','execute','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Creating\x20new\x20version...','then','updatedAt','\x20files?','filePath','Getting\x20column\x20mapping...','limit','\x20(ID:\x20','journey:view','listFolders','base','type','goal','resourceName','journey:versions','resume',',\x20version:\x20','Available\x20stages:\x20'];a28_0x19be=function(){return _0x75cf5a;};return a28_0x19be();}async function resolveJourneyTarget(_0x4722c1,_0x4370e1,_0x13efef){const _0x38392e=a28_0x3602;if(isYamlFilePath(_0x4722c1))try{const _0x2beea0=await resolveYamlFilePath(_0x4722c1);return _0x13efef&&(console[_0x38392e(0x16c)](_0x38392e(0x11d)+_0x4722c1),console[_0x38392e(0x16c)](_0x38392e(0x10e)+_0x2beea0[_0x38392e(0x182)]),console[_0x38392e(0x16c)](_0x38392e(0xea)+_0x2beea0['segmentName']),console[_0x38392e(0x16c)](_0x38392e(0x156)+(_0x2beea0[_0x38392e(0x111)]||_0x38392e(0xe7)))),{'journeyName':_0x2beea0[_0x38392e(0x163)],'parentSegment':_0x2beea0[_0x38392e(0x182)],'resolved':_0x2beea0};}catch(_0x299707){throw new SDKError(ErrorCode[_0x38392e(0x16f)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x299707[_0x38392e(0xed)]);}if(!_0x4370e1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x38392e(0x10d));return{'journeyName':_0x4722c1,'parentSegment':_0x4370e1};}export class JourneyListCommand extends BaseCommand{['name']=a28_0x41d493(0x18b);[a28_0x41d493(0xd5)]=a28_0x41d493(0x191);async[a28_0x41d493(0xf5)](_0x379983){const _0xaa3a2c=a28_0x41d493,{options:_0x5e92e1,args:_0x1afd77,tdx:_0x955a12}=_0x379983,_0x2ecf99=_0x1afd77[0x0],_0x16e87a=_0x5e92e1[_0xaa3a2c(0x182)];if(!_0x16e87a)return console[_0xaa3a2c(0x16c)]('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0xaa3a2c(0x1b0)),0x1;const _0xab2517=await withSpinner(_0xaa3a2c(0xe0),()=>_0x955a12['segment']['resolveParentId'](_0x16e87a),{'verbose':_0x5e92e1['verbose']}),_0x38508b=_0xab2517['data'];_0x5e92e1[_0xaa3a2c(0x181)]&&(console[_0xaa3a2c(0x16c)](_0xaa3a2c(0xca)+_0x16e87a+_0xaa3a2c(0xfe)+_0x38508b+')'),_0x2ecf99&&console[_0xaa3a2c(0x16c)](_0xaa3a2c(0x1b5)+_0x2ecf99));const _0x25cdff=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x955a12['segment'][_0xaa3a2c(0x12b)](_0x38508b),{'verbose':_0x5e92e1[_0xaa3a2c(0x181)]}),_0x2b460c=_0x25cdff[_0xaa3a2c(0x11f)],_0x28b4ae=_0x2b460c[_0xaa3a2c(0x1b6)],_0x1172bc=await withSpinner('Listing\x20journeys...',()=>_0x955a12[_0xaa3a2c(0x14b)][_0xaa3a2c(0x134)](_0x38508b,_0x28b4ae),{'verbose':_0x5e92e1['verbose']});let _0x1eb2eb=_0x1172bc['data'][_0xaa3a2c(0x19c)];const _0x4e8b8b=_0x1172bc[_0xaa3a2c(0x11f)][_0xaa3a2c(0x17e)],_0x464544=new Map();for(const _0x5b765c of _0x4e8b8b){_0x464544[_0xaa3a2c(0x176)](_0x5b765c['id'],_0x5b765c[_0xaa3a2c(0x141)]);}if(_0x2ecf99){const _0xc42e09=globToRegex(_0x2ecf99);_0x1eb2eb=_0x1eb2eb[_0xaa3a2c(0x19b)](_0x51a549=>_0xc42e09[_0xaa3a2c(0x144)](_0x51a549['journeyBundleName']));}console[_0xaa3a2c(0x16c)](_0xaa3a2c(0x120)+_0x1eb2eb[_0xaa3a2c(0xf4)]+'\x20journey'+(_0x1eb2eb['length']!==0x1?'s':''));const _0x2df40a=_0x51cb24=>{const _0x574dc6=_0xaa3a2c;return getConsoleNextUrl(_0x5e92e1[_0x574dc6(0xc0)],_0x574dc6(0x198)+_0x38508b+_0x574dc6(0x154)+_0x51cb24+_0x574dc6(0xd1));};if(_0x5e92e1[_0xaa3a2c(0x10f)]===_0xaa3a2c(0x1aa))await handleSDKOutput(_0x1eb2eb,_0x5e92e1);else{if(_0x5e92e1[_0xaa3a2c(0x10f)]===_0xaa3a2c(0x192)){const _0x438c2b=_0x1eb2eb[_0xaa3a2c(0x143)](_0xb59d45=>({..._0xb59d45,'url':_0x2df40a(_0xb59d45['id'])}));await handleSDKOutput(_0x438c2b,_0x5e92e1);}else{console['log']('['+_0x16e87a+']');const _0x4060e8=new Map(),_0x57c603=[];for(const _0x5546e6 of _0x1eb2eb){if(!_0x5546e6[_0xaa3a2c(0x11c)]||_0x5546e6[_0xaa3a2c(0x11c)]===_0x28b4ae)_0x57c603['push'](_0x5546e6);else{const _0x5f15db=_0x4060e8[_0xaa3a2c(0x174)](_0x5546e6[_0xaa3a2c(0x11c)])||[];_0x5f15db[_0xaa3a2c(0xde)](_0x5546e6),_0x4060e8[_0xaa3a2c(0x176)](_0x5546e6[_0xaa3a2c(0x11c)],_0x5f15db);}}const _0x56d13a=(_0x34e55f,_0x3aa8a1)=>_0x34e55f['journeyBundleName'][_0xaa3a2c(0xe5)](_0x3aa8a1['journeyBundleName'],undefined,{'sensitivity':'base'});_0x57c603[_0xaa3a2c(0x1b2)](_0x56d13a);for(const _0x14e93f of _0x57c603){console['log'](formatJourneyItem(_0x14e93f,'',_0x2df40a(_0x14e93f['id'])));}const _0x168816=[..._0x4060e8[_0xaa3a2c(0x10c)]()][_0xaa3a2c(0x1b2)]((_0x5e046f,_0x45643c)=>{const _0x4374f6=_0xaa3a2c,_0x24f13e=_0x464544[_0x4374f6(0x174)](_0x5e046f[0x0])||_0x5e046f[0x0],_0x258ee3=_0x464544[_0x4374f6(0x174)](_0x45643c[0x0])||_0x45643c[0x0];return _0x24f13e[_0x4374f6(0xe5)](_0x258ee3,undefined,{'sensitivity':_0x4374f6(0x101)});});for(const [_0x102acd,_0x1b78b4]of _0x168816){const _0x53127c=_0x464544[_0xaa3a2c(0x174)](_0x102acd)||_0x102acd;console[_0xaa3a2c(0x123)]('📁\x20'+_0x53127c),_0x1b78b4[_0xaa3a2c(0x1b2)](_0x56d13a);for(const _0x4ae567 of _0x1b78b4){console[_0xaa3a2c(0x123)](formatJourneyItem(_0x4ae567,'\x20\x20',_0x2df40a(_0x4ae567['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a28_0x41d493(0xff);[a28_0x41d493(0xd5)]=a28_0x41d493(0x195);async[a28_0x41d493(0xf5)](_0x154cd5){const _0x58f0a6=a28_0x41d493,{options:_0x4802ef,args:_0x397af4,tdx:_0x4cc4ca}=_0x154cd5,_0x34533a=_0x397af4[0x0];if(!_0x34533a)return console[_0x58f0a6(0x16c)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x58f0a6(0x16c)](_0x58f0a6(0x17d)),console[_0x58f0a6(0x16c)](_0x58f0a6(0x171)),console[_0x58f0a6(0x16c)](_0x58f0a6(0xc4)),0x1;_0x4802ef[_0x58f0a6(0x181)]&&console['error'](_0x58f0a6(0x1bc)+_0x34533a);const {journeyId:_0x506ad2,parentSegmentId:_0x391b55}=await resolveJourneyIdFromInput(_0x34533a,_0x4802ef,_0x4cc4ca);if(_0x4802ef[_0x58f0a6(0x184)]){const _0x4fdc7d=getConsoleNextUrl(_0x4802ef[_0x58f0a6(0xc0)],_0x58f0a6(0x198)+_0x391b55+'/e/'+_0x506ad2+'/j/da/je');return console[_0x58f0a6(0x16c)](a28_0x458e20[_0x58f0a6(0x1ac)]('✔')+_0x58f0a6(0x187)+a28_0x458e20[_0x58f0a6(0x164)](_0x4fdc7d)),openBrowser(_0x4fdc7d),0x0;}const _0x1094ed=await withSpinner(_0x58f0a6(0x149),()=>_0x4cc4ca[_0x58f0a6(0x14b)]['getJourney'](_0x506ad2),{'verbose':_0x4802ef['verbose']}),_0x1869ca=_0x1094ed['data'],_0x50cfd1=_0x4802ef[_0x58f0a6(0x12a)];let _0x59b6fb;if(_0x50cfd1)try{const _0x2bad7a=await withSpinner(_0x58f0a6(0x130),()=>_0x4cc4ca[_0x58f0a6(0x14b)][_0x58f0a6(0x169)](_0x506ad2),{'verbose':_0x4802ef['verbose']});_0x59b6fb=_0x2bad7a[_0x58f0a6(0x11f)];}catch{_0x4802ef[_0x58f0a6(0x181)]&&console[_0x58f0a6(0x16c)](_0x58f0a6(0xf1));}const _0x38f678=getConsoleNextUrl(_0x4802ef[_0x58f0a6(0xc0)],_0x58f0a6(0x198)+_0x391b55+_0x58f0a6(0x154)+_0x506ad2+'/j/da/je'),_0x462193={'id':_0x1869ca['id'],'name':_0x1869ca['attributes'][_0x58f0a6(0x141)],'description':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0xd5)],'state':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x133)],'paused':_0x1869ca[_0x58f0a6(0x13e)]['paused'],'reentry_mode':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0xc1)],'stages':_0x1869ca[_0x58f0a6(0x13e)]['journeyStages']?.[_0x58f0a6(0xf4)]||0x0,..._0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x103)]&&{'goal':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x103)]['name']},..._0x59b6fb&&{'statistics':{'size':_0x59b6fb[_0x58f0a6(0xd9)],'entered':_0x59b6fb['enteredSize'],'goal_achieved':_0x59b6fb[_0x58f0a6(0x167)],'completion_rate':_0x59b6fb[_0x58f0a6(0xd6)],'exit_or_jump':_0x59b6fb[_0x58f0a6(0x146)],'exit_or_jump_rate':_0x59b6fb[_0x58f0a6(0x15f)],'stages':_0x59b6fb[_0x58f0a6(0x1b7)]}},'url':_0x38f678};return await handleSingleObjectOutput(_0x462193,_0x4802ef),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:stats';['description']=a28_0x41d493(0xee);async['execute'](_0x2bcad1){const _0x24fcee=a28_0x41d493,{options:_0x141ae2,args:_0x39dc09,tdx:_0x445b74}=_0x2bcad1,_0x20d026=_0x39dc09[0x0];if(!requireNameOrPath(_0x20d026))return 0x1;_0x141ae2[_0x24fcee(0x181)]&&console[_0x24fcee(0x16c)](_0x24fcee(0x1bc)+_0x20d026);const _0x46ccff=_0x141ae2,_0x2df45b=_0x46ccff[_0x24fcee(0x1a0)],_0x22dd50=_0x46ccff['to'],_0x31b735=_0x46ccff[_0x24fcee(0x18e)],_0x140ffb=_0x46ccff[_0x24fcee(0x13c)];_0x31b735&&!_0x2df45b&&!_0x22dd50&&console['error'](_0x24fcee(0x1b4));const _0x5a9f30=_0x31b735?withJsonFormat(_0x141ae2):_0x141ae2,{journeyId:_0x3153eb,journeyName:_0x17bcf9}=await resolveJourneyIdFromInput(_0x20d026,_0x5a9f30,_0x445b74),_0x4d208d=_0x2df45b||_0x22dd50?{'from':_0x2df45b,'to':_0x22dd50}:undefined,_0x57b9e3=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x24fcee(0xcd)]([_0x445b74[_0x24fcee(0x14b)][_0x24fcee(0x158)](_0x3153eb),_0x445b74['journey']['getStatistics'](_0x3153eb,_0x4d208d)]),{'verbose':_0x5a9f30[_0x24fcee(0x181)]}),[_0x1d7bb2,_0x58541a]=_0x57b9e3[_0x24fcee(0x11f)];if(!_0x58541a||_0x58541a[_0x24fcee(0x139)]===null)return console[_0x24fcee(0x16c)](_0x24fcee(0xc3)+_0x17bcf9),console[_0x24fcee(0x16c)](_0x24fcee(0x196)),0x0;const _0x543472=buildStageNameMap(_0x1d7bb2),_0x5041e1=!!(_0x4d208d&&_0x58541a[_0x24fcee(0x19a)]?.[_0x24fcee(0xf4)]),_0x2ebc47={'stageNameMap':_0x543472,'hasPeriod':_0x5041e1,'includeHistory':!!_0x31b735};if(_0x140ffb&&_0x58541a[_0x24fcee(0x1b7)]){const _0x167cb6=_0x58541a[_0x24fcee(0x1b7)][_0x24fcee(0x1c0)](_0xbc47e1=>{const _0x5b9ba1=_0x24fcee,_0x44ed7f=_0x543472[_0x5b9ba1(0x174)](_0xbc47e1['id'])??'';return _0x44ed7f['toLowerCase']()===_0x140ffb[_0x5b9ba1(0x15a)]();});if(_0x167cb6)return await handleSingleObjectOutput(formatStageStats(_0x167cb6,_0x2ebc47),_0x5a9f30),0x0;const _0x2c3d9c=_0x58541a[_0x24fcee(0x1b7)][_0x24fcee(0x143)](_0x542783=>_0x543472['get'](_0x542783['id'])??_0x542783['id']);return console[_0x24fcee(0x16c)](_0x24fcee(0x12c)+_0x140ffb+'\x22\x20not\x20found'),console[_0x24fcee(0x16c)](_0x24fcee(0x108)+_0x2c3d9c[_0x24fcee(0x1a8)](',\x20')),0x1;}const _0x40056a=_0x58541a[_0x24fcee(0x1b7)]?.[_0x24fcee(0x143)](_0x2fdb67=>formatStageStats(_0x2fdb67,_0x2ebc47)),_0x2b4d2e=assembleJourneyStats(_0x58541a,{'from':_0x2df45b,'to':_0x22dd50,'includeHistory':_0x31b735});return await this[_0x24fcee(0x145)](_0x2b4d2e,_0x40056a??[],_0x5a9f30),0x0;}async[a28_0x41d493(0x145)](_0x2562e2,_0xa3b678,_0x125940){const _0x49f757=a28_0x41d493,_0x1eec51=_0x125940[_0x49f757(0x10f)]===_0x49f757(0x192)||_0x125940['format']===_0x49f757(0x1c6)||_0x125940[_0x49f757(0x192)]||_0x125940[_0x49f757(0x1c6)];if(_0x1eec51){_0x2562e2[_0x49f757(0x1b7)]=_0xa3b678,await handleSingleObjectOutput(_0x2562e2,_0x125940);return;}await handleSingleObjectOutput(_0x2562e2,_0x125940);for(const _0x497f91 of _0xa3b678){console[_0x49f757(0x123)](''),console[_0x49f757(0x123)](String(a28_0x458e20['cyan']['bold']('['+_0x497f91[_0x49f757(0x141)]+']'))+a28_0x458e20[_0x49f757(0x1c4)]('\x20'+_0x497f91['id']));const {id:_0x47b584,name:_0x443909,..._0xeb5be}=_0x497f91;await handleSingleObjectOutput(_0xeb5be,_0x125940);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a28_0x41d493(0x160);[a28_0x41d493(0xd5)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x41d493(0xf5)](_0x377338){const _0x45756b=a28_0x41d493,{options:_0x47a022,args:_0x2c146b,tdx:_0x568e42}=_0x377338,_0x56059e=_0x2c146b[0x0];if(!requireNameOrPath(_0x56059e))return 0x1;_0x47a022['verbose']&&console['error'](_0x45756b(0x1bc)+_0x56059e);const _0x4e6791=_0x47a022,_0x168939=_0x4e6791[_0x45756b(0x102)],_0x941469=_0x4e6791['from'],_0x450cab=_0x4e6791['to'],_0x407027=_0x4e6791[_0x45756b(0xfd)];if(_0x168939&&_0x168939!==_0x45756b(0x114)&&_0x168939!==_0x45756b(0x172))return console[_0x45756b(0x16c)](_0x45756b(0x173)+_0x168939+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x4c5410=withJsonFormat(_0x47a022),{journeyId:_0x456010,journeyName:_0x1a0ed7}=await resolveJourneyIdFromInput(_0x56059e,_0x4c5410,_0x568e42),_0x35b9e1={'type':_0x168939,'from':_0x941469,'to':_0x450cab,'limit':_0x407027},_0x4bd97a=await withSpinner(_0x45756b(0x115),()=>_0x568e42['journey'][_0x45756b(0x199)](_0x456010,_0x35b9e1),{'verbose':_0x4c5410[_0x45756b(0x181)]}),_0x58458d=_0x4bd97a[_0x45756b(0x11f)],_0x1265ce=_0x58458d['conversion']&&(_0x58458d['conversion']['nodes'][_0x45756b(0xf4)]>0x0||_0x58458d[_0x45756b(0x114)]['links'][_0x45756b(0xf4)]>0x0),_0x3160ab=_0x58458d['activation']&&_0x58458d[_0x45756b(0x172)]['length']>0x0;if(!_0x1265ce&&!_0x3160ab)return console[_0x45756b(0x16c)](_0x45756b(0x1a1)+_0x1a0ed7),console[_0x45756b(0x16c)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x941469&&_0x450cab&&console[_0x45756b(0x16c)](_0x45756b(0x14f)),0x0;return await handleSingleObjectOutput(_0x58458d,_0x4c5410),0x0;}}function formatStageStats(_0x5854f8,_0x278e40){const _0x14819c=a28_0x41d493,_0x5c8ecb=_0x278e40['hasPeriod']&&_0x5854f8[_0x14819c(0x19a)]?.[_0x14819c(0xf4)]?aggregateStageHistory(_0x5854f8[_0x14819c(0x19a)]):{'size':_0x5854f8[_0x14819c(0xd9)],'entered':_0x5854f8['enteredSize'],'milestone':_0x5854f8[_0x14819c(0x1b8)],'milestone_rate':_0x5854f8[_0x14819c(0xd4)],'exit_or_jump':_0x5854f8[_0x14819c(0x146)],'exit_or_jump_rate':_0x5854f8[_0x14819c(0x15f)]},_0x5f48c1={'id':_0x5854f8['id'],'name':_0x278e40[_0x14819c(0xe8)]['get'](_0x5854f8['id'])??_0x5854f8['id'],..._0x5c8ecb};return _0x278e40['hasPeriod']&&_0x278e40[_0x14819c(0x18e)]&&_0x5854f8[_0x14819c(0x19a)]&&(_0x5f48c1[_0x14819c(0x19a)]=_0x5854f8['history']),_0x5f48c1;}export class JourneyPauseCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0xc8);[a28_0x41d493(0xd5)]=a28_0x41d493(0x15c);async[a28_0x41d493(0xf5)](_0x237674){const _0x251c4b=a28_0x41d493,{options:_0x3269e6,args:_0x422701,tdx:_0x336185}=_0x237674,_0x4c0c2c=_0x422701[0x0];if(!requireNameOrPath(_0x4c0c2c))return 0x1;_0x3269e6[_0x251c4b(0x181)]&&console[_0x251c4b(0x16c)](_0x251c4b(0x1bc)+_0x4c0c2c);const {journeyId:_0x1fc28e,journeyName:_0x3ef8f9}=await resolveJourneyIdFromInput(_0x4c0c2c,_0x3269e6,_0x336185);if(!_0x3269e6[_0x251c4b(0x127)]){const _0x1fe633=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x3ef8f9+'\x22?');if(!_0x1fe633)return console[_0x251c4b(0x16c)](_0x251c4b(0x1b1)),0x0;}const _0x36d544=await withSpinner('Pausing\x20journey...',()=>_0x336185[_0x251c4b(0x14b)][_0x251c4b(0x132)](_0x1fc28e),{'verbose':_0x3269e6[_0x251c4b(0x181)]}),_0x171e44=_0x36d544[_0x251c4b(0x11f)];return console[_0x251c4b(0x16c)](_0x251c4b(0x1bd)+_0x171e44[_0x251c4b(0x13e)][_0x251c4b(0x141)]+_0x251c4b(0x118)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0x16e);[a28_0x41d493(0xd5)]=a28_0x41d493(0x13a);async[a28_0x41d493(0xf5)](_0x3fed8f){const _0x2c3670=a28_0x41d493,{options:_0x3011bb,args:_0x2c27d1,tdx:_0x1f6242}=_0x3fed8f,_0x2ecbea=_0x2c27d1[0x0];if(!requireNameOrPath(_0x2ecbea))return 0x1;_0x3011bb[_0x2c3670(0x181)]&&console[_0x2c3670(0x16c)](_0x2c3670(0x1bc)+_0x2ecbea);const {journeyId:_0x2761ee,journeyName:_0x2f42de}=await resolveJourneyIdFromInput(_0x2ecbea,_0x3011bb,_0x1f6242);if(!_0x3011bb[_0x2c3670(0x127)]){const _0x7c8a98=await confirm(_0x2c3670(0xd3)+_0x2f42de+'\x22?');if(!_0x7c8a98)return console[_0x2c3670(0x16c)](_0x2c3670(0x1b1)),0x0;}const _0x16515b=await withSpinner(_0x2c3670(0xe3),()=>_0x1f6242[_0x2c3670(0x14b)][_0x2c3670(0x106)](_0x2761ee),{'verbose':_0x3011bb[_0x2c3670(0x181)]}),_0x44fb6e=_0x16515b[_0x2c3670(0x11f)];return console['error']('✔\x20Journey\x20\x22'+_0x44fb6e[_0x2c3670(0x13e)][_0x2c3670(0x141)]+_0x2c3670(0x166)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0xf3);[a28_0x41d493(0xd5)]=a28_0x41d493(0x121);async['execute'](_0x3e7f50){const _0x52778c=a28_0x41d493,{options:_0x48dbf6,args:_0x273310,tdx:_0x504e82}=_0x3e7f50,_0x16b26e=_0x48dbf6,_0x40c7ce=_0x273310[0x0],_0xc68356=_0x40c7ce&&isYamlFilePath(_0x40c7ce),_0x2fc671=await resolveTarget({'arg':_0xc68356?_0x40c7ce:undefined,'contextParent':_0x48dbf6['parentSegment'],'cwd':process[_0x52778c(0x113)]()});if(!isSuccessfulResolution(_0x2fc671))return _0x2fc671[_0x52778c(0x194)]===_0x52778c(0x151)?(console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0x157))),console[_0x52778c(0x16c)]('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[_0x52778c(0x16c)](_0x52778c(0xcf)),console[_0x52778c(0x16c)](_0x52778c(0xdd)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a28_0x458e20[_0x52778c(0x190)](_0x52778c(0x1af)+_0x2fc671[_0x52778c(0xed)]+'\x0a')),_0x2fc671[_0x52778c(0x124)]&&console['error'](a28_0x458e20['cyan'](_0x2fc671[_0x52778c(0x124)]))),0x1;let _0x3292c8=_0xc68356?undefined:_0x40c7ce,_0x50f6f1,_0x10c46b;_0x2fc671[_0x52778c(0x102)]==='file'&&(_0x3292c8=_0x2fc671[_0x52778c(0x104)],_0x50f6f1=_0x2fc671['filePath'],_0x10c46b=_0x2fc671[_0x52778c(0x111)]);const _0xe3459=_0x2fc671[_0x52778c(0x116)],_0x58db88=_0x2fc671[_0x52778c(0x1a5)];_0x16b26e[_0x52778c(0x181)]&&(console[_0x52778c(0x16c)](_0x52778c(0xca)+_0xe3459),console[_0x52778c(0x16c)](_0x52778c(0xec)+_0x58db88),_0x3292c8&&console['error'](_0x52778c(0x1bb)+_0x3292c8),_0x50f6f1&&console[_0x52778c(0x16c)]('Target\x20file:\x20'+_0x50f6f1),_0x10c46b&&console[_0x52778c(0x16c)](_0x52778c(0x188)+_0x10c46b));const _0x522d95=await withSpinner(_0x52778c(0xe0),()=>_0x504e82['segment'][_0x52778c(0x178)](_0xe3459),{'verbose':_0x48dbf6[_0x52778c(0x181)]}),_0x593326=_0x522d95[_0x52778c(0x11f)],{journeys:_0x92004f,folders:_0x29a180}=await withSpinner(_0x52778c(0xc9),async()=>{const _0x2389bf=_0x52778c,[_0x59db14,_0x4df834]=await Promise[_0x2389bf(0xcd)]([_0x504e82[_0x2389bf(0x14b)]['listJourneysFromParentSegment'](_0x593326,undefined,{'includeAllVersions':!![]}),_0x504e82[_0x2389bf(0x18d)][_0x2389bf(0x100)](_0x593326)]);return{'journeys':_0x59db14,'folders':_0x4df834};},{'verbose':_0x48dbf6[_0x52778c(0x181)]})[_0x52778c(0xf8)](_0x4250c7=>_0x4250c7[_0x52778c(0x11f)]);let _0x24282c=_0x92004f;const _0x1fadc0=buildFolderIdToPathMap(_0x29a180);if(_0x3292c8){const _0x3be666=_0x24282c[_0x52778c(0x19b)](_0x488aa1=>_0x488aa1['journeyBundleName'][_0x52778c(0x15a)]()===_0x3292c8[_0x52778c(0x15a)]());if(_0x3be666['length']===0x0)return console[_0x52778c(0x16c)](_0x52778c(0x12f)+_0x3292c8),console[_0x52778c(0x16c)](_0x52778c(0x129)),0x1;_0x24282c=_0x3be666;}if(_0x10c46b!==undefined){const _0x2a1d53=_0x24282c['filter'](_0xd38921=>{const _0x378105=_0x52778c,_0x499b41=_0xd38921[_0x378105(0x11c)]?_0x1fadc0[_0x378105(0x174)](_0xd38921[_0x378105(0x11c)])||'':'';return _0x499b41===_0x10c46b;});if(_0x2a1d53[_0x52778c(0xf4)]===0x0&&_0x24282c[_0x52778c(0xf4)]>0x0){console[_0x52778c(0x16c)]('Error:\x20Journey\x20\x27'+_0x3292c8+_0x52778c(0xe1)+(_0x10c46b||'root\x20folder')),console[_0x52778c(0x16c)](_0x52778c(0x1ae));for(const _0x396739 of _0x24282c){const _0x3de52b=_0x396739['folderId']?_0x1fadc0['get'](_0x396739['folderId'])||'':'';console['error'](_0x52778c(0x189)+(_0x3de52b||_0x52778c(0xe7))+'/'+_0x396739['journeyBundleName']);}return 0x1;}_0x24282c=_0x2a1d53;}if(_0x24282c[_0x52778c(0xf4)]===0x0)return console[_0x52778c(0x16c)]('No\x20journeys\x20found'),0x0;const _0x5c3fd7=new Map();for(const _0x988115 of _0x24282c){const _0x202d28=_0x988115['journeyBundleId'];!_0x5c3fd7[_0x52778c(0x193)](_0x202d28)&&_0x5c3fd7[_0x52778c(0x176)](_0x202d28,[]),_0x5c3fd7[_0x52778c(0x174)](_0x202d28)[_0x52778c(0xde)](_0x988115);}for(const _0x455dba of _0x5c3fd7['values']()){_0x455dba[_0x52778c(0x1b2)]((_0x3fb0bb,_0x377307)=>(_0x3fb0bb['versionNumber']||0x0)-(_0x377307[_0x52778c(0xbe)]||0x0));}const _0xe5b61a=[],{idToEmailMap:_0x46b132,connectionIdToNameMap:_0x51092e}=await withSpinner(_0x52778c(0x17c),async()=>{const _0x4b4a56=_0x52778c,[_0xa02adc,_0x53e905]=await Promise['all']([_0x504e82[_0x4b4a56(0x18a)][_0x4b4a56(0x1b9)](),_0x504e82[_0x4b4a56(0x18c)][_0x4b4a56(0xdc)]()]);return{'idToEmailMap':_0xa02adc,'connectionIdToNameMap':_0x53e905};},{'verbose':_0x48dbf6['verbose']})[_0x52778c(0xf8)](_0x45c0b2=>_0x45c0b2[_0x52778c(0x11f)]);for(const _0x293828 of _0x5c3fd7['values']()){const _0x400de8=_0x293828[0x0][_0x52778c(0x197)],_0x5a039a=_0x293828[0x0][_0x52778c(0x11c)],_0x45fcc=_0x5a039a?_0x1fadc0[_0x52778c(0x174)](_0x5a039a)||'':'',_0x55c832=_0x45fcc?a28_0x3d093a[_0x52778c(0x1a8)](_0x58db88,_0x45fcc):_0x58db88,_0x5cde52=_0x50f6f1||a28_0x3d093a['join'](_0x55c832,sanitizeFileName(_0x400de8)+_0x52778c(0x1a2));let _0x3bd894,_0x279e63;if(existsSync(_0x5cde52))try{const _0x14196d=readFileSync(_0x5cde52,_0x52778c(0xc6)),_0x1ca8de=parseYamlString(_0x14196d);_0x279e63=_0x1ca8de,_0x3bd894=buildRuleToNameMapping(_0x1ca8de),_0x16b26e[_0x52778c(0x181)]&&_0x3bd894['size']>0x0&&console[_0x52778c(0x16c)](_0x52778c(0xef)+_0x3bd894[_0x52778c(0xd9)]+_0x52778c(0x11e)+_0x400de8);}catch(_0xbf48e5){_0x16b26e[_0x52778c(0x181)]&&console[_0x52778c(0x16c)](_0x52778c(0xbd)+_0xbf48e5[_0x52778c(0xed)]);}const _0x3b0266=[],_0x4c4637=new Set(),_0x1275b2=new Map(),_0x24f78a=new Map(),_0x29d5e5=new Set(),_0x1495c7=new Map(),_0xd9df35=new Map(),_0x4fdadd=createJumpTargetCache();await withProgressSpinner(_0x52778c(0x112)+_0x400de8+'...',async _0xd5356f=>{const _0x5043c6=_0x52778c;for(const _0x300048 of _0x293828){const _0x3b0ca1=_0x293828[_0x5043c6(0xf4)]>0x1?_0x300048[_0x5043c6(0x197)]+'\x20v'+(_0x300048[_0x5043c6(0xbe)]||0x1):_0x300048[_0x5043c6(0x197)];_0xd5356f['setPhase'](_0x5043c6(0x112)+_0x3b0ca1);const _0x59448a=await _0x504e82[_0x5043c6(0x14b)][_0x5043c6(0x158)](_0x300048['id']),_0x5a047b=_0x59448a[_0x5043c6(0x13e)]?.[_0x5043c6(0x17f)],_0x5efb33={'resolveSegment':async _0x4e7c06=>{const _0x263c40=_0x5043c6;if(!_0x5a047b)return{'name':_0x4e7c06,'isJourneyLocal':![]};const _0x316b65=_0x1275b2[_0x263c40(0x174)](_0x4e7c06);if(_0x316b65)return _0x316b65;try{const _0xcc9389=await _0x504e82[_0x263c40(0x18d)][_0x263c40(0xc7)](_0x5a047b,_0x4e7c06),_0x31977e=_0xcc9389['kind']===SEGMENT_KIND_JOURNEY;let _0x2c08ba,_0x56704b=_0xcc9389[_0x263c40(0x141)];if(_0x31977e&&_0xcc9389['rule']){const _0x6fb1ed=await segmentResponseToDef(_0xcc9389,{'resolveSegmentName':async _0x2b4f81=>{const _0xf5aebc=_0x263c40,_0x39097b=_0x1275b2[_0xf5aebc(0x174)](_0x2b4f81);if(_0x39097b)return _0x39097b[_0xf5aebc(0x141)];const _0x2c4235=await _0x5efb33[_0xf5aebc(0x1ab)](_0x2b4f81);return _0x2c4235[_0xf5aebc(0x141)];}}),_0x1c2f25=_0x6fb1ed[_0x263c40(0x1ba)];_0x2c08ba={'description':_0xcc9389[_0x263c40(0xd5)],'rule':_0x1c2f25};const _0x231bfc=serializeRule(_0x1c2f25),_0x5b1700=_0x24f78a[_0x263c40(0x174)](_0x231bfc);if(_0x5b1700)_0x56704b=_0x5b1700,_0x2c08ba=undefined,_0x16b26e[_0x263c40(0x181)]&&console['error'](_0x263c40(0x1b3)+_0xcc9389[_0x263c40(0x141)]+_0x263c40(0x13b)+_0x5b1700);else{let _0x37c401=![];if(_0x3bd894){const _0x2a9971=_0x3bd894['get'](_0x231bfc);if(_0x2a9971){const _0x45d3e8=_0x2a9971[_0x263c40(0x1c0)](_0x26731c=>!_0x4c4637['has'](_0x26731c));_0x45d3e8&&(_0x56704b=_0x45d3e8,_0x4c4637['add'](_0x45d3e8),_0x24f78a[_0x263c40(0x176)](_0x231bfc,_0x45d3e8),_0x37c401=!![],_0x16b26e[_0x263c40(0x181)]&&console[_0x263c40(0x16c)](_0x263c40(0x1be)+_0x45d3e8+_0x263c40(0x122)));}}if(!_0x37c401){const _0x59dee6=generateJourneyLocalName(_0xcc9389[_0x263c40(0x141)]);_0x59dee6&&(_0x56704b=_0x59dee6);let _0x4c0f2b=_0x56704b,_0x48ff59=0x2;while(_0x4c4637['has'](_0x4c0f2b)){_0x4c0f2b=_0x56704b+'_'+_0x48ff59,_0x48ff59++;}_0x4c4637[_0x263c40(0x15e)](_0x4c0f2b),_0x24f78a[_0x263c40(0x176)](_0x231bfc,_0x4c0f2b),_0x56704b=_0x4c0f2b;}}}const _0x379638={'name':_0x56704b,'isJourneyLocal':_0x31977e,'definition':_0x2c08ba};return _0x1275b2[_0x263c40(0x176)](_0x4e7c06,_0x379638),_0x379638;}catch(_0x1f8885){return _0x48dbf6['verbose']&&console[_0x263c40(0x16c)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x4e7c06+':\x20'+_0x1f8885[_0x263c40(0xed)]),{'name':_0x4e7c06,'isJourneyLocal':![]};}},'resolveActivation':async _0x4516d3=>{const _0x3ec3ba=_0x5043c6,_0x510ae5=_0x1495c7[_0x3ec3ba(0x174)](_0x4516d3);if(_0x510ae5)return _0x510ae5;try{const _0xfef99d=await _0x504e82['journey'][_0x3ec3ba(0x1c1)](_0x300048['id'],_0x4516d3),_0x5e3b81=journeyActivationStepToYaml(_0xfef99d,_0x46b132,_0x51092e),_0x15bd95=JSON[_0x3ec3ba(0xd8)]({'name':_0x5e3b81[_0x3ec3ba(0x141)],'connection':_0x5e3b81[_0x3ec3ba(0x18c)],'connector_config':_0x5e3b81[_0x3ec3ba(0x15b)]}),_0x4795c9=_0xd9df35['get'](_0x15bd95);if(_0x4795c9){const _0xc7d6ad={'name':_0x4795c9,'isJourneyLocal':!![],'definition':_0x5e3b81};return _0x1495c7[_0x3ec3ba(0x176)](_0x4516d3,_0xc7d6ad),_0xc7d6ad;}const _0x40e835=_0xfef99d['attributes'][_0x3ec3ba(0xcc)][_0x3ec3ba(0x141)]||_0x4516d3,_0x46dd77=sanitizeYamlKey(_0x40e835)||'activation_'+_0x4516d3;let _0x2f09ab=_0x46dd77,_0x4dbc3d=0x2;while(_0x29d5e5[_0x3ec3ba(0x193)](_0x2f09ab)){_0x2f09ab=_0x46dd77+'_'+_0x4dbc3d,_0x4dbc3d++;}_0x29d5e5[_0x3ec3ba(0x15e)](_0x2f09ab),_0xd9df35[_0x3ec3ba(0x176)](_0x15bd95,_0x2f09ab);const _0x580757={'name':_0x2f09ab,'isJourneyLocal':!![],'definition':_0x5e3b81};return _0x1495c7[_0x3ec3ba(0x176)](_0x4516d3,_0x580757),_0x580757;}catch(_0x494b3b){return _0x48dbf6[_0x3ec3ba(0x181)]&&console['error'](_0x3ec3ba(0xf6)+_0x4516d3+':\x20'+_0x494b3b['message']),{'name':_0x4516d3,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x41c9c2,_0x214edb)=>{const _0x492e8f=_0x5043c6;return resolveJumpTarget(_0x41c9c2,_0x214edb,_0x4fdadd,_0x1efcc1=>_0x504e82[_0x492e8f(0x14b)]['getJourney'](_0x1efcc1));}},_0x8245f1=await journeyResponseToDef(_0x59448a,_0x5efb33);_0x3b0266[_0x5043c6(0xde)]({'item':_0x300048,'yaml':_0x8245f1});}},{'verbose':_0x48dbf6[_0x52778c(0x181)]});const _0x24a70a=await _0x504e82[_0x52778c(0x14b)][_0x52778c(0x168)](_0x293828[0x0][_0x52778c(0x179)]),_0x3867e8=buildMergedJourneyDef(_0x3b0266,_0x3bd894,_0x24a70a),_0x447c21=normalizeJourneyDef(_0x3867e8,_0x279e63),_0x4f2605=toYamlString(_0x447c21),_0x33c23e=_0x50f6f1||a28_0x3d093a['join'](_0x55c832,sanitizeFileName(_0x400de8)+_0x52778c(0x1a2));!_0x50f6f1&&_0x45fcc&&!existsSync(_0x55c832)&&mkdirSync(_0x55c832,{'recursive':!![]});const _0x170c44=a28_0x3d093a[_0x52778c(0x177)](process[_0x52778c(0x113)](),_0x33c23e);if(existsSync(_0x33c23e)){const _0x55472f=readFileSync(_0x33c23e,_0x52778c(0xc6)),_0x32b1e0=generateDiff(_0x55472f,_0x4f2605),_0x5e5831=hasChanges(_0x32b1e0);_0xe5b61a[_0x52778c(0xde)]({'relativePath':_0x170c44,'absolutePath':_0x33c23e,'content':_0x4f2605,'isNew':![],'hasChanges':_0x5e5831,'diff':_0x5e5831?formatDiffWithColors(_0x32b1e0):undefined});}else _0xe5b61a[_0x52778c(0xde)]({'relativePath':_0x170c44,'absolutePath':_0x33c23e,'content':_0x4f2605,'isNew':!![],'hasChanges':![]});}const _0x417711=_0xe5b61a[_0x52778c(0x19b)](_0x1456ac=>_0x1456ac[_0x52778c(0x19d)]),_0x2eed22=_0xe5b61a['filter'](_0xb0c560=>!_0xb0c560['isNew']&&_0xb0c560[_0x52778c(0x137)]),_0x917acc=_0xe5b61a['filter'](_0x1b0adf=>!_0x1b0adf[_0x52778c(0x19d)]&&!_0x1b0adf[_0x52778c(0x137)]),_0x33f2f2=_0x24282c['length'],_0x572a3d=_0x5c3fd7['size'],_0x5b1aa8=_0x33f2f2>_0x572a3d?'\x20('+_0x33f2f2+_0x52778c(0x19e):'';console[_0x52778c(0x16c)](_0x52778c(0xc2)),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0x164)](_0x572a3d+_0x52778c(0x162))+a28_0x458e20['dim'](_0x5b1aa8)),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20['green']('+\x20'+_0x417711['length']+'\x20new\x20files')),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0xf0)]('~\x20'+_0x2eed22[_0x52778c(0xf4)]+'\x20changed\x20files')),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0x1c4)]('=\x20'+_0x917acc[_0x52778c(0xf4)]+_0x52778c(0x138))),console['error']('\x20\x20Target:\x20'+a28_0x458e20['cyan'](_0x58db88)+'\x0a');if(_0x2eed22[_0x52778c(0xf4)]>0x0)for(const _0x358736 of _0x2eed22){console[_0x52778c(0x16c)](_0x52778c(0x17a)+_0x358736['relativePath']+'\x27:'),console[_0x52778c(0x16c)]('─'[_0x52778c(0x126)](0x3c)),console['error'](_0x358736[_0x52778c(0x16d)]),console[_0x52778c(0x16c)]('─'[_0x52778c(0x126)](0x3c));}if(_0x16b26e[_0x52778c(0x128)])return console['error'](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0x18f))),0x0;if(_0x417711[_0x52778c(0xf4)]===0x0&&_0x2eed22[_0x52778c(0xf4)]===0x0)return console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0x1ac)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0xe3459},_0x16b26e[_0x52778c(0xd0)]),console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0x1ac)](_0x52778c(0x180)+a28_0x458e20['dim']('parent_segment')+'\x20=\x20'+a28_0x458e20[_0x52778c(0x164)](_0xe3459))),0x0;if(!_0x16b26e['yes']&&(_0x417711[_0x52778c(0xf4)]>0x0||_0x2eed22[_0x52778c(0xf4)]>0x0)){if(!isInteractive())return console['error'](a28_0x458e20[_0x52778c(0x190)]('\x0aError:'),_0x52778c(0x155)),console['error'](a28_0x458e20[_0x52778c(0x1c4)](_0x52778c(0xf2))),0x1;const _0x44c7ff=await confirmKey(_0x52778c(0x135)+(_0x417711[_0x52778c(0xf4)]+_0x2eed22['length'])+_0x52778c(0xfa));if(!_0x44c7ff)return console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0xd2)),_0x52778c(0x131)),0x1;}!existsSync(_0x58db88)&&mkdirSync(_0x58db88,{'recursive':!![]});const _0x168ba7=a28_0x3d093a[_0x52778c(0x1a8)](_0x58db88,'tdx.json');writeFileSync(_0x168ba7,createTdxConfigContent(_0xe3459),'utf-8');for(const _0x2c78b1 of _0xe5b61a){(_0x2c78b1[_0x52778c(0x19d)]||_0x2c78b1[_0x52778c(0x137)])&&writeFileSync(_0x2c78b1['absolutePath'],_0x2c78b1[_0x52778c(0x142)],_0x52778c(0xc6));}return console[_0x52778c(0x16c)](a28_0x458e20['green'](_0x52778c(0x12e)+(_0x417711['length']+_0x2eed22[_0x52778c(0xf4)])+_0x52778c(0xd7)+_0x58db88)),saveSessionContext({'parent_segment':_0xe3459},_0x16b26e[_0x52778c(0xd0)]),console[_0x52778c(0x16c)](a28_0x458e20['green']('✔\x20Context\x20set:\x20'+a28_0x458e20[_0x52778c(0x1c4)](_0x52778c(0x19f))+_0x52778c(0x159)+a28_0x458e20['cyan'](_0xe3459))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:columns';['description']=a28_0x41d493(0x11b);async['execute'](_0x51e475){const _0x3a2591=a28_0x41d493,{options:_0x39632c,args:_0x2e7850,tdx:_0x229da6}=_0x51e475,_0x1676b1=_0x2e7850[0x0];if(!requireNameOrPath(_0x1676b1))return 0x1;_0x39632c['verbose']&&console[_0x3a2591(0x16c)](_0x3a2591(0x1bc)+_0x1676b1);const {journeyId:_0xe00a54}=await resolveJourneyIdFromInput(_0x1676b1,_0x39632c,_0x229da6),_0x49ca95=await withSpinner(_0x3a2591(0xfc),()=>_0x229da6[_0x3a2591(0x14b)]['getColumnMapping'](_0xe00a54),{'verbose':_0x39632c[_0x3a2591(0x181)]}),_0x1ca1e0=_0x49ca95['data'];return console[_0x3a2591(0x123)](_0x3a2591(0x117)+_0x1ca1e0[_0x3a2591(0x16b)]),console['log'](_0x3a2591(0x1a3)+_0x1ca1e0['table']),await handleSDKOutput(_0x1ca1e0[_0x3a2591(0x165)],_0x39632c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a28_0x41d493(0x1a9);[a28_0x41d493(0xd5)]=a28_0x41d493(0x1bf);async['execute'](_0x2a64f2){const _0x2e8031=a28_0x41d493,{options:_0x13ef87,args:_0x26aaf7,tdx:_0x41609f}=_0x2a64f2,_0x2b05af=_0x26aaf7[0x0];if(!requireNameOrPath(_0x2b05af))return 0x1;_0x13ef87[_0x2e8031(0x181)]&&console['error']('Input:\x20'+_0x2b05af);const {journeyId:_0xecb324}=await resolveJourneyIdFromInput(_0x2b05af,_0x13ef87,_0x41609f),_0x430b7e=await withSpinner(_0x2e8031(0xdb),()=>_0x41609f[_0x2e8031(0x14b)]['listActivationsFlat'](_0xecb324),{'verbose':_0x13ef87[_0x2e8031(0x181)]}),_0x15c723=_0x430b7e[_0x2e8031(0x11f)];return console[_0x2e8031(0x16c)]('Found\x20'+_0x15c723[_0x2e8031(0xf4)]+_0x2e8031(0xce)+(_0x15c723[_0x2e8031(0xf4)]!==0x1?'s':'')),await handleSDKOutput(_0x15c723,_0x13ef87),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0x109);[a28_0x41d493(0xd5)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a28_0x41d493(0x1ad)]=new SegmentPushCommand();async[a28_0x41d493(0xf5)](_0x1870d7){const _0x527bc5=a28_0x41d493,_0x4d1ab1=_0x1870d7[_0x527bc5(0x110)][0x0];let _0x13111d;if(_0x4d1ab1){const _0x413500=await resolveTarget({'arg':_0x4d1ab1,'contextParent':_0x1870d7[_0x527bc5(0x10b)][_0x527bc5(0x182)],'cwd':process[_0x527bc5(0x113)]()});isSuccessfulResolution(_0x413500)&&_0x413500[_0x527bc5(0x102)]===_0x527bc5(0xc5)&&(_0x13111d=_0x413500[_0x527bc5(0xfb)]);}const _0x2984b7={..._0x1870d7,'options':{..._0x1870d7['options'],'journeysOnly':!![],..._0x13111d&&{'singleFilePath':_0x13111d}}};return this[_0x527bc5(0x1ad)][_0x527bc5(0xf5)](_0x2984b7);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a28_0x41d493(0x105);['description']=a28_0x41d493(0x1a6);async[a28_0x41d493(0xf5)](_0x2be745){const _0x111bd5=a28_0x41d493,{options:_0xc9f447,args:_0x172eba,tdx:_0x3ff23f}=_0x2be745,_0x51ca20=_0x172eba[0x0];if(!requireNameOrPath(_0x51ca20))return 0x1;if(_0xc9f447[_0x111bd5(0x181)])console[_0x111bd5(0x16c)](_0x111bd5(0x1bc)+_0x51ca20);const {journeyId:_0x2e8242}=await resolveJourneyIdFromInput(_0x51ca20,_0xc9f447,_0x3ff23f),_0x5b4ae1=await withSpinner(_0x111bd5(0x136),()=>_0x3ff23f['journey'][_0x111bd5(0xdf)](_0x2e8242),{'verbose':_0xc9f447[_0x111bd5(0x181)]}),{bundleName:_0x427d8a,versions:_0x54743a,latestJourneyId:_0x14aa21}=_0x5b4ae1[_0x111bd5(0x11f)];console['error'](_0x427d8a+':\x20'+_0x54743a[_0x111bd5(0xf4)]+'\x20version'+(_0x54743a[_0x111bd5(0xf4)]!==0x1?'s':''));const _0x45ec7f=_0x54743a[_0x111bd5(0x143)](_0x5b5aff=>({'version':_0x5b5aff[_0x111bd5(0xbe)],'journey_id':_0x5b5aff[_0x111bd5(0x139)],'name':_0x5b5aff[_0x111bd5(0x141)],'state':_0x5b5aff[_0x111bd5(0x133)],'paused':_0x5b5aff[_0x111bd5(0xe2)],'latest':_0x5b5aff[_0x111bd5(0x139)]===_0x14aa21,'created_at':_0x5b5aff[_0x111bd5(0x12d)]}));return await handleSDKOutput(_0x45ec7f,_0xc9f447),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:version:create';[a28_0x41d493(0xd5)]=a28_0x41d493(0xe4);async[a28_0x41d493(0xf5)](_0x570e68){const _0xfce973=a28_0x41d493,{options:_0x307704,args:_0xdb26e2,tdx:_0x3ad5b9}=_0x570e68,_0x2e3160=_0xdb26e2[0x0];if(!requireNameOrPath(_0x2e3160))return 0x1;if(_0x307704[_0xfce973(0x181)])console['error'](_0xfce973(0x1bc)+_0x2e3160);const {journeyId:_0x3ba0ff,journeyName:_0x3479f7}=await resolveJourneyIdFromInput(_0x2e3160,_0x307704,_0x3ad5b9);if(!_0x307704['yes']){const _0xab9335=await confirm(_0xfce973(0x148)+_0x3479f7+'\x22?');if(!_0xab9335)return console['error'](_0xfce973(0x1b1)),0x0;}const _0x53d6a9=await withSpinner(_0xfce973(0xf7),()=>_0x3ad5b9[_0xfce973(0x14b)]['createVersion'](_0x3ba0ff),{'verbose':_0x307704[_0xfce973(0x181)]}),_0x186af1=_0x53d6a9[_0xfce973(0x11f)];return console[_0xfce973(0x16c)](a28_0x458e20[_0xfce973(0x1ac)]('✔')+'\x20Created\x20v'+_0x186af1[_0xfce973(0x13e)][_0xfce973(0xbe)]+_0xfce973(0x14a)+_0x186af1['attributes'][_0xfce973(0x141)]+'\x22'),console[_0xfce973(0x16c)](_0xfce973(0xcb)+_0x186af1['id']),await handleSingleObjectOutput({'id':_0x186af1['id'],'name':_0x186af1['attributes'][_0xfce973(0x141)],'version':_0x186af1[_0xfce973(0x13e)][_0xfce973(0xbe)],'state':_0x186af1['attributes'][_0xfce973(0x133)],'bundle_id':_0x186af1[_0xfce973(0x13e)][_0xfce973(0x179)],'created_at':_0x186af1[_0xfce973(0x13e)][_0xfce973(0x12d)]},_0x307704),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';[a28_0x41d493(0xd5)]=a28_0x41d493(0xe9);async[a28_0x41d493(0xf5)](_0x2b4a18){const _0x5b0b7d=a28_0x41d493,{options:_0x4b771f,args:_0x3347fd,tdx:_0x467429}=_0x2b4a18,_0x12bfeb=_0x3347fd[0x0];if(!requireNameOrPath(_0x12bfeb))return 0x1;const _0x270fe9=_0x4b771f['version'];if(!_0x270fe9)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x5b0b7d(0x16c)](_0x5b0b7d(0xbf)),0x1;const _0x3979d8=parseInt(_0x270fe9,0xa);if(isNaN(_0x3979d8)||_0x3979d8<0x1)return console[_0x5b0b7d(0x16c)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x270fe9),0x1;if(_0x4b771f['verbose'])console[_0x5b0b7d(0x16c)]('Input:\x20'+_0x12bfeb+_0x5b0b7d(0x107)+_0x3979d8);const {journeyId:_0x3e4fba,parentSegmentId:_0x554c48}=await resolveJourneyIdFromInput(_0x12bfeb,_0x4b771f,_0x467429),_0xd4ecee=await withSpinner(_0x5b0b7d(0x1c5),()=>_0x467429['journey'][_0x5b0b7d(0xdf)](_0x3e4fba),{'verbose':_0x4b771f['verbose']}),{versions:_0x48bdd6,latestJourneyId:_0xa94afd}=_0xd4ecee['data'],_0xed5654=_0x48bdd6[_0x5b0b7d(0x1c0)](_0x4c39cb=>_0x4c39cb[_0x5b0b7d(0xbe)]===_0x3979d8);if(!_0xed5654){const _0x2038c0=_0x48bdd6['map'](_0x5b2e6e=>'v'+_0x5b2e6e[_0x5b0b7d(0xbe)])[_0x5b0b7d(0x1a8)](',\x20');return console[_0x5b0b7d(0x16c)](_0x5b0b7d(0x1a7)+_0x3979d8+_0x5b0b7d(0x11a)+_0x2038c0),0x1;}const _0x14ed28=await withSpinner(_0x5b0b7d(0x16a)+_0x3979d8+_0x5b0b7d(0x14e),()=>_0x467429[_0x5b0b7d(0x14b)][_0x5b0b7d(0x158)](_0xed5654[_0x5b0b7d(0x139)]),{'verbose':_0x4b771f[_0x5b0b7d(0x181)]}),_0x3eba42=_0x14ed28[_0x5b0b7d(0x11f)],_0x3b2e3e=getConsoleNextUrl(_0x4b771f['site'],_0x5b0b7d(0x198)+_0x554c48+_0x5b0b7d(0x154)+_0xed5654['journeyId']+_0x5b0b7d(0x161));return await handleSingleObjectOutput({'id':_0x3eba42['id'],'name':_0x3eba42[_0x5b0b7d(0x13e)]['name'],'version':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xbe)],'description':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xd5)],'state':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x133)],'paused':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xe2)],'reentry_mode':_0x3eba42['attributes'][_0x5b0b7d(0xc1)],'stages':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x1a4)]?.[_0x5b0b7d(0xf4)]||0x0,..._0x3eba42['attributes'][_0x5b0b7d(0x103)]&&{'goal':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x103)][_0x5b0b7d(0x141)]},'latest':_0xed5654[_0x5b0b7d(0x139)]===_0xa94afd,'created_at':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x12d)],'updated_at':_0x3eba42['attributes'][_0x5b0b7d(0xf9)],'url':_0x3b2e3e},_0x4b771f),0x0;}}
@@ -1 +1 @@
1
- const a29_0x4e7fc1=a29_0x2419;(function(_0x5c0b5d,_0x3366d9){const _0x12bdeb=a29_0x2419,_0x2b93bf=_0x5c0b5d();while(!![]){try{const _0x5314c9=parseInt(_0x12bdeb(0x183))/0x1*(-parseInt(_0x12bdeb(0x199))/0x2)+parseInt(_0x12bdeb(0x1a6))/0x3+-parseInt(_0x12bdeb(0x18e))/0x4*(parseInt(_0x12bdeb(0x193))/0x5)+-parseInt(_0x12bdeb(0x197))/0x6+parseInt(_0x12bdeb(0x1a0))/0x7*(parseInt(_0x12bdeb(0x196))/0x8)+parseInt(_0x12bdeb(0x1a8))/0x9+-parseInt(_0x12bdeb(0x182))/0xa*(-parseInt(_0x12bdeb(0x19c))/0xb);if(_0x5314c9===_0x3366d9)break;else _0x2b93bf['push'](_0x2b93bf['shift']());}catch(_0x53ff47){_0x2b93bf['push'](_0x2b93bf['shift']());}}}(a29_0x14ee,0x5f17c));function a29_0x2419(_0x2e8896,_0x1dba12){_0x2e8896=_0x2e8896-0x177;const _0x14eea7=a29_0x14ee();let _0x24191f=_0x14eea7[_0x2e8896];return _0x24191f;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a29_0x14ee(){const _0x5d3c17=['parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','log','green','10096gHhypj','\x20segment\x20file(s)\x20skipped)','parentSegment','name','verbose','205JDVfob','yellow','errorCode','117192zhwIGb','3267654jXCUQV','\x20segment\x20file(s)\x20skipped','44UcHhDn','endsWith','message','209NuOLOB','.yaml','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','dim','161EbjGtF','errors','\x20journey(s)\x20valid','\x20(skipped:\x20','helpText','journey','154281QJhByW','reason','4887216rsOPBk','length','validCount','error','\x20journey(s)\x20with\x20errors,\x20','cyan','warnings','skippedCount','\x20warning(s)\x20found','type','invalidCount','filePath','red','valid','journey:validate','targetDir','Validate\x20journey\x20YAML\x20files','Validation\x20failed:\x20','59770YHxjGR','334NolonO','no_parent','warningCount','\x20error(s)','✔\x20All\x20','execute','filter','file'];a29_0x14ee=function(){return _0x5d3c17;};return a29_0x14ee();}import{existsSync}from'fs';import a29_0x2ff5ff 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{[a29_0x4e7fc1(0x191)]=a29_0x4e7fc1(0x17e);['description']=a29_0x4e7fc1(0x180);async[a29_0x4e7fc1(0x188)](_0x50ee12){const _0x16216e=a29_0x4e7fc1,{options:_0x43b41b,args:_0xef5461}=_0x50ee12,_0x2c4dad=_0x43b41b,_0x21b9e2=await resolveTarget({'arg':_0xef5461[0x0],'contextParent':_0x43b41b[_0x16216e(0x190)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x21b9e2))return _0x21b9e2[_0x16216e(0x195)]===_0x16216e(0x184)?(console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x194)](_0x16216e(0x18b))),console[_0x16216e(0x1ab)](_0x16216e(0x19e)),console[_0x16216e(0x1ab)]('\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[_0x16216e(0x1ab)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x17c)]('Error:\x20'+_0x21b9e2[_0x16216e(0x19b)]+'\x0a')),_0x21b9e2['helpText']&&console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x1ad)](_0x21b9e2[_0x16216e(0x1a4)]))),0x1;const _0x55bf1b=_0x21b9e2[_0x16216e(0x17f)],_0x42fb48=_0x21b9e2[_0x16216e(0x179)]===_0x16216e(0x18a)?_0x21b9e2[_0x16216e(0x17b)]:undefined;if(!_0x42fb48&&!existsSync(_0x55bf1b))return console['error'](a29_0x2ff5ff['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x55bf1b+'\x0a')),0x1;let _0x4ad84c;if(_0x42fb48){if(!_0x42fb48[_0x16216e(0x19a)]('.yml')&&!_0x42fb48[_0x16216e(0x19a)](_0x16216e(0x19d)))return console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x17c)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x42fb48+'\x0a')),0x1;_0x4ad84c=[_0x42fb48];}else _0x4ad84c=findYamlFiles(_0x55bf1b);if(_0x4ad84c[_0x16216e(0x1a9)]===0x0)return console[_0x16216e(0x1ab)](a29_0x2ff5ff['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x55bf1b+'\x0a')),0x1;const _0x23d204=validateYamlFiles(_0x4ad84c,_0x55bf1b,{'filterType':_0x16216e(0x1a5)}),_0x2f77e0=calculateSummary(_0x23d204),_0x3eec97=_0x23d204[_0x16216e(0x189)](isValidationResult);if(_0x3eec97[_0x16216e(0x1a9)]===0x0)return console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x194)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x55bf1b+'\x0a')),_0x2f77e0[_0x16216e(0x177)]>0x0&&console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x19f)]('('+_0x2f77e0[_0x16216e(0x177)]+_0x16216e(0x18f))),0x0;for(const _0x5967d4 of _0x23d204){if(!isValidationResult(_0x5967d4)){_0x2c4dad[_0x16216e(0x192)]&&console['log'](a29_0x2ff5ff[_0x16216e(0x19f)]('-\x20'+_0x5967d4['relativePath']+_0x16216e(0x1a3)+_0x5967d4[_0x16216e(0x1a7)]+')'));continue;}const {relativePath:_0x4bdbfb,source:_0x3cb5cd,result:_0x2ca99d}=_0x5967d4;if(_0x2ca99d[_0x16216e(0x17d)]&&_0x2ca99d[_0x16216e(0x1ae)]['length']===0x0)_0x2c4dad[_0x16216e(0x192)]&&console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x18d)]('✔\x20'+_0x4bdbfb));else _0x2ca99d['valid']?(console[_0x16216e(0x18c)](a29_0x2ff5ff['yellow']('⚠\x20'+_0x4bdbfb+':\x20'+_0x2ca99d['warnings'][_0x16216e(0x1a9)]+'\x20warning(s)')),console[_0x16216e(0x18c)](formatValidationResult(_0x2ca99d,_0x3cb5cd,_0x4bdbfb))):(console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x17c)]('✖\x20'+_0x4bdbfb+':\x20'+_0x2ca99d[_0x16216e(0x1a1)][_0x16216e(0x1a9)]+_0x16216e(0x186))),console['log'](formatValidationResult(_0x2ca99d,_0x3cb5cd,_0x4bdbfb)));}return console['log'](''),_0x2f77e0['hasErrors']?(console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x17c)](_0x16216e(0x181)+_0x2f77e0[_0x16216e(0x17a)]+_0x16216e(0x1ac)+_0x2f77e0[_0x16216e(0x1aa)]+'\x20valid')),_0x2f77e0[_0x16216e(0x185)]>0x0&&console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x194)](_0x2f77e0[_0x16216e(0x185)]+_0x16216e(0x178))),_0x2f77e0['skippedCount']>0x0&&console['log'](a29_0x2ff5ff[_0x16216e(0x19f)](_0x2f77e0['skippedCount']+_0x16216e(0x198))),0x1):(console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x18d)](_0x16216e(0x187)+_0x2f77e0[_0x16216e(0x1aa)]+_0x16216e(0x1a2))),_0x2f77e0[_0x16216e(0x185)]>0x0&&console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x194)](_0x2f77e0['warningCount']+_0x16216e(0x178))),_0x2f77e0['skippedCount']>0x0&&console['log'](a29_0x2ff5ff[_0x16216e(0x19f)](_0x2f77e0[_0x16216e(0x177)]+_0x16216e(0x198))),0x0);}}
1
+ const a29_0x23112d=a29_0x3f2e;(function(_0x4f5ced,_0x523ea1){const _0x522338=a29_0x3f2e,_0x3131d4=_0x4f5ced();while(!![]){try{const _0x24d01c=parseInt(_0x522338(0xbc))/0x1*(-parseInt(_0x522338(0xb6))/0x2)+parseInt(_0x522338(0xab))/0x3+parseInt(_0x522338(0x9f))/0x4*(parseInt(_0x522338(0xb7))/0x5)+parseInt(_0x522338(0x83))/0x6*(-parseInt(_0x522338(0x8c))/0x7)+-parseInt(_0x522338(0x8a))/0x8+-parseInt(_0x522338(0x8f))/0x9*(-parseInt(_0x522338(0x96))/0xa)+-parseInt(_0x522338(0xb9))/0xb*(-parseInt(_0x522338(0x87))/0xc);if(_0x24d01c===_0x523ea1)break;else _0x3131d4['push'](_0x3131d4['shift']());}catch(_0x3b9886){_0x3131d4['push'](_0x3131d4['shift']());}}}(a29_0x4615,0xce84d));import{BaseCommand}from'./command.js';function a29_0x3f2e(_0x330ff0,_0x2dbff7){_0x330ff0=_0x330ff0-0x82;const _0x46155d=a29_0x4615();let _0x3f2e37=_0x46155d[_0x330ff0];return _0x3f2e37;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0x1292ef from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a29_0x4615(){const _0x1dd43b=['88uXLHFc','\x20segment\x20file(s)\x20skipped','\x20journey(s)\x20with\x20errors,\x20','3016WtdbtV','cwd','4843038ZMsnXJ','file','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','validCount','595836JdjZAi','\x20(skipped:\x20','warningCount','7049264JMRQsR','.yml','7azKDGY','Validation\x20failed:\x20','errorCode','643662HLhYXf','.yaml','✔\x20All\x20','Validate\x20journey\x20YAML\x20files','no_parent','log','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','190PxyXKc','description','\x20warning(s)\x20found','message','Error:\x20Directory\x20not\x20found:\x20','execute','\x20valid','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','red','3295864XaRaCo','\x20segment\x20file(s)\x20skipped)','journey','endsWith','hasErrors','verbose','parentSegment','invalidCount','cyan','filter','\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','skippedCount','1427904Bhsgrp','error','reason','warnings','green','relativePath','yellow','length','dim','valid','\x20journey(s)\x20valid','346RFangE','5bsWfHV','targetDir'];a29_0x4615=function(){return _0x1dd43b;};return a29_0x4615();}export class JourneyValidateCommand extends BaseCommand{['name']='journey:validate';[a29_0x23112d(0x97)]=a29_0x23112d(0x92);async[a29_0x23112d(0x9b)](_0x3e6878){const _0x593e7e=a29_0x23112d,{options:_0x5e6680,args:_0x48f654}=_0x3e6878,_0x5169f9=_0x5e6680,_0x137c8a=await resolveTarget({'arg':_0x48f654[0x0],'contextParent':_0x5e6680[_0x593e7e(0xa5)],'cwd':process[_0x593e7e(0x82)]()});if(!isSuccessfulResolution(_0x137c8a))return _0x137c8a[_0x593e7e(0x8e)]===_0x593e7e(0x93)?(console[_0x593e7e(0xac)](a29_0x1292ef[_0x593e7e(0xb1)](_0x593e7e(0x85))),console[_0x593e7e(0xac)](_0x593e7e(0x9d)),console[_0x593e7e(0xac)](_0x593e7e(0xa9)),console[_0x593e7e(0xac)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x593e7e(0xac)](a29_0x1292ef['red']('Error:\x20'+_0x137c8a[_0x593e7e(0x99)]+'\x0a')),_0x137c8a['helpText']&&console[_0x593e7e(0xac)](a29_0x1292ef[_0x593e7e(0xa7)](_0x137c8a['helpText']))),0x1;const _0x8b83f1=_0x137c8a[_0x593e7e(0xb8)],_0x548626=_0x137c8a['type']===_0x593e7e(0x84)?_0x137c8a['filePath']:undefined;if(!_0x548626&&!existsSync(_0x8b83f1))return console[_0x593e7e(0xac)](a29_0x1292ef['red'](_0x593e7e(0x9a)+_0x8b83f1+'\x0a')),0x1;let _0x22e6a2;if(_0x548626){if(!_0x548626[_0x593e7e(0xa2)](_0x593e7e(0x8b))&&!_0x548626['endsWith'](_0x593e7e(0x90)))return console[_0x593e7e(0xac)](a29_0x1292ef[_0x593e7e(0x9e)](_0x593e7e(0x95)+_0x548626+'\x0a')),0x1;_0x22e6a2=[_0x548626];}else _0x22e6a2=findYamlFiles(_0x8b83f1);if(_0x22e6a2[_0x593e7e(0xb2)]===0x0)return console[_0x593e7e(0xac)](a29_0x1292ef[_0x593e7e(0x9e)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x8b83f1+'\x0a')),0x1;const _0x515407=validateYamlFiles(_0x22e6a2,_0x8b83f1,{'filterType':_0x593e7e(0xa1)}),_0x43af9b=calculateSummary(_0x515407),_0xde9ad=_0x515407[_0x593e7e(0xa8)](isValidationResult);if(_0xde9ad[_0x593e7e(0xb2)]===0x0)return console['error'](a29_0x1292ef[_0x593e7e(0xb1)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x8b83f1+'\x0a')),_0x43af9b[_0x593e7e(0xaa)]>0x0&&console['error'](a29_0x1292ef[_0x593e7e(0xb3)]('('+_0x43af9b[_0x593e7e(0xaa)]+_0x593e7e(0xa0))),0x0;for(const _0x179720 of _0x515407){if(!isValidationResult(_0x179720)){_0x5169f9[_0x593e7e(0xa4)]&&console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xb3)]('-\x20'+_0x179720[_0x593e7e(0xb0)]+_0x593e7e(0x88)+_0x179720[_0x593e7e(0xad)]+')'));continue;}const {relativePath:_0x448328,source:_0x4850ab,result:_0x3541f2}=_0x179720;if(_0x3541f2[_0x593e7e(0xb4)]&&_0x3541f2[_0x593e7e(0xae)]['length']===0x0)_0x5169f9['verbose']&&console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xaf)]('✔\x20'+_0x448328));else _0x3541f2[_0x593e7e(0xb4)]?(console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xb1)]('⚠\x20'+_0x448328+':\x20'+_0x3541f2[_0x593e7e(0xae)][_0x593e7e(0xb2)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x3541f2,_0x4850ab,_0x448328))):(console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0x9e)]('✖\x20'+_0x448328+':\x20'+_0x3541f2['errors'][_0x593e7e(0xb2)]+'\x20error(s)')),console[_0x593e7e(0x94)](formatValidationResult(_0x3541f2,_0x4850ab,_0x448328)));}return console[_0x593e7e(0x94)](''),_0x43af9b[_0x593e7e(0xa3)]?(console[_0x593e7e(0x94)](a29_0x1292ef['red'](_0x593e7e(0x8d)+_0x43af9b[_0x593e7e(0xa6)]+_0x593e7e(0xbb)+_0x43af9b['validCount']+_0x593e7e(0x9c))),_0x43af9b[_0x593e7e(0x89)]>0x0&&console['log'](a29_0x1292ef[_0x593e7e(0xb1)](_0x43af9b[_0x593e7e(0x89)]+_0x593e7e(0x98))),_0x43af9b[_0x593e7e(0xaa)]>0x0&&console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xb3)](_0x43af9b[_0x593e7e(0xaa)]+_0x593e7e(0xba))),0x1):(console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xaf)](_0x593e7e(0x91)+_0x43af9b[_0x593e7e(0x86)]+_0x593e7e(0xb5))),_0x43af9b[_0x593e7e(0x89)]>0x0&&console[_0x593e7e(0x94)](a29_0x1292ef['yellow'](_0x43af9b[_0x593e7e(0x89)]+_0x593e7e(0x98))),_0x43af9b[_0x593e7e(0xaa)]>0x0&&console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xb3)](_0x43af9b[_0x593e7e(0xaa)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}