@treasuredata/tdx 2026.3.35 → 2026.3.36

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_0x462633=a26_0x1037;(function(_0x13787f,_0x4e3406){const _0x42e8a4=a26_0x1037,_0x5f3266=_0x13787f();while(!![]){try{const _0x4d5b23=parseInt(_0x42e8a4(0x101))/0x1*(-parseInt(_0x42e8a4(0xfb))/0x2)+parseInt(_0x42e8a4(0x11a))/0x3+parseInt(_0x42e8a4(0x102))/0x4+parseInt(_0x42e8a4(0x106))/0x5*(parseInt(_0x42e8a4(0x112))/0x6)+-parseInt(_0x42e8a4(0x110))/0x7+-parseInt(_0x42e8a4(0xfa))/0x8*(parseInt(_0x42e8a4(0xfe))/0x9)+parseInt(_0x42e8a4(0x128))/0xa;if(_0x4d5b23===_0x4e3406)break;else _0x5f3266['push'](_0x5f3266['shift']());}catch(_0xccd5a5){_0x5f3266['push'](_0x5f3266['shift']());}}}(a26_0x5d82,0xba140));import{BaseCommand}from'./command.js';function a26_0x5d82(){const _0x39d3ef=['error','Validation\x20failed:\x20','980775jUrFUO','engage:template:validate','dirname','validCount','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','Validate\x20template\x20YAML\x20files','errors','\x20non-template\x20file(s)\x20skipped','8761795dqipCf','valid','36ZacegL','filter','execute','cwd','Error:\x20Directory\x20not\x20found:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20valid','yellow','2662035qsAbjB','\x20template(s)\x20valid','warningCount','\x20warning(s)\x20found','\x20template(s)\x20with\x20errors,\x20','verbose','template','\x20(skipped:\x20','\x20non-template\x20file(s)\x20skipped)','.yml','warnings','length','hasErrors','name','15693790UGFBzm','.yaml','dim','resolve','log','1247504uGdXIG','2ddSfJN','\x20error(s)','endsWith','72qQUUki','✔\x20All\x20','skippedCount','1428782rGLpnq','4225972MtcNIp','reason'];a26_0x5d82=function(){return _0x39d3ef;};return a26_0x5d82();}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a26_0x1037(_0x5cbfb2,_0xa6fd6c){_0x5cbfb2=_0x5cbfb2-0xf9;const _0x5d8277=a26_0x5d82();let _0x10375d=_0x5d8277[_0x5cbfb2];return _0x10375d;}import{existsSync}from'fs';import a26_0x22ed22 from'chalk';import a26_0x392d84 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a26_0x462633(0x127)]=a26_0x462633(0x107);[a26_0x462633(0x10a)]=a26_0x462633(0x10d);async[a26_0x462633(0x114)](_0x32b6a9){const _0x57d925=a26_0x462633,{options:_0x50531d,args:_0x2734c6}=_0x32b6a9,_0x32ca77=_0x50531d,_0x5a9f3a=_0x2734c6[0x0],_0x1cecf5=_0x5a9f3a?a26_0x392d84[_0x57d925(0x12b)](_0x5a9f3a):undefined,_0x5369f6=_0x1cecf5?isYamlFile(_0x1cecf5):![];let _0x2a6529,_0x55ae2e;if(_0x5369f6&&_0x1cecf5)_0x2a6529=a26_0x392d84[_0x57d925(0x108)](_0x1cecf5),_0x55ae2e=_0x1cecf5;else _0x1cecf5?_0x2a6529=_0x1cecf5:_0x2a6529=process[_0x57d925(0x115)]();if(!_0x55ae2e&&!existsSync(_0x2a6529))return console[_0x57d925(0x104)](a26_0x22ed22[_0x57d925(0x10c)](_0x57d925(0x116)+_0x2a6529+'\x0a')),0x1;let _0x229778;if(_0x55ae2e){if(!_0x55ae2e[_0x57d925(0xfd)](_0x57d925(0x123))&&!_0x55ae2e['endsWith'](_0x57d925(0x129)))return console[_0x57d925(0x104)](a26_0x22ed22['red'](_0x57d925(0x117)+_0x55ae2e+'\x0a')),0x1;_0x229778=[_0x55ae2e];}else _0x229778=findYamlFiles(_0x2a6529);if(_0x229778[_0x57d925(0x125)]===0x0)return console[_0x57d925(0x104)](a26_0x22ed22[_0x57d925(0x10c)](_0x57d925(0x10b)+_0x2a6529+'\x0a')),0x1;const _0x5a49f0=validateYamlFiles(_0x229778,_0x2a6529,{'filterType':_0x57d925(0x120)}),_0x4eac21=calculateSummary(_0x5a49f0),_0x3043f6=_0x5a49f0[_0x57d925(0x113)](isValidationResult);if(_0x3043f6['length']===0x0)return console['error'](a26_0x22ed22[_0x57d925(0x119)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x2a6529+'\x0a')),_0x4eac21[_0x57d925(0x100)]>0x0&&console[_0x57d925(0x104)](a26_0x22ed22['dim']('('+_0x4eac21[_0x57d925(0x100)]+_0x57d925(0x122))),0x0;for(const _0x11ba26 of _0x5a49f0){if(!isValidationResult(_0x11ba26)){_0x32ca77[_0x57d925(0x11f)]&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x12a)]('-\x20'+_0x11ba26['relativePath']+_0x57d925(0x121)+_0x11ba26[_0x57d925(0x103)]+')'));continue;}const {relativePath:_0x1ad33d,source:_0x13a42b,result:_0x44d229}=_0x11ba26;if(_0x44d229[_0x57d925(0x111)]&&_0x44d229[_0x57d925(0x124)]['length']===0x0)_0x32ca77[_0x57d925(0x11f)]&&console['log'](a26_0x22ed22['green']('✔\x20'+_0x1ad33d));else _0x44d229['valid']?(console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x119)]('⚠\x20'+_0x1ad33d+':\x20'+_0x44d229[_0x57d925(0x124)][_0x57d925(0x125)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x44d229,_0x13a42b,_0x1ad33d))):(console[_0x57d925(0xf9)](a26_0x22ed22['red']('✖\x20'+_0x1ad33d+':\x20'+_0x44d229[_0x57d925(0x10e)][_0x57d925(0x125)]+_0x57d925(0xfc))),console['log'](formatValidationResult(_0x44d229,_0x13a42b,_0x1ad33d)));}return console[_0x57d925(0xf9)](''),_0x4eac21[_0x57d925(0x126)]?(console[_0x57d925(0xf9)](a26_0x22ed22['red'](_0x57d925(0x105)+_0x4eac21['invalidCount']+_0x57d925(0x11e)+_0x4eac21['validCount']+_0x57d925(0x118))),_0x4eac21[_0x57d925(0x11c)]>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22['yellow'](_0x4eac21[_0x57d925(0x11c)]+_0x57d925(0x11d))),_0x4eac21['skippedCount']>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x12a)](_0x4eac21[_0x57d925(0x100)]+_0x57d925(0x10f))),0x1):(console[_0x57d925(0xf9)](a26_0x22ed22['green'](_0x57d925(0xff)+_0x4eac21[_0x57d925(0x109)]+_0x57d925(0x11b))),_0x4eac21[_0x57d925(0x11c)]>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x119)](_0x4eac21['warningCount']+_0x57d925(0x11d))),_0x4eac21['skippedCount']>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x12a)](_0x4eac21[_0x57d925(0x100)]+_0x57d925(0x10f))),0x0);}}
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 +1 @@
1
- const a27_0x42d217=a27_0x2376;(function(_0x2e036f,_0x5794d7){const _0x4b3176=a27_0x2376,_0x382eca=_0x2e036f();while(!![]){try{const _0x2a8ca7=-parseInt(_0x4b3176(0x19d))/0x1*(parseInt(_0x4b3176(0x161))/0x2)+parseInt(_0x4b3176(0x1b7))/0x3*(parseInt(_0x4b3176(0x164))/0x4)+-parseInt(_0x4b3176(0x19e))/0x5*(-parseInt(_0x4b3176(0x165))/0x6)+-parseInt(_0x4b3176(0x189))/0x7*(-parseInt(_0x4b3176(0x1b4))/0x8)+parseInt(_0x4b3176(0x160))/0x9*(-parseInt(_0x4b3176(0x1a8))/0xa)+-parseInt(_0x4b3176(0x167))/0xb+parseInt(_0x4b3176(0x1a0))/0xc*(-parseInt(_0x4b3176(0x1a2))/0xd);if(_0x2a8ca7===_0x5794d7)break;else _0x382eca['push'](_0x382eca['shift']());}catch(_0x4e0835){_0x382eca['push'](_0x382eca['shift']());}}}(a27_0x48be,0x602f6));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';function a27_0x2376(_0x302ef2,_0x442fec){_0x302ef2=_0x302ef2-0x15e;const _0x48beca=a27_0x48be();let _0x237625=_0x48beca[_0x302ef2];return _0x237625;}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_0x523ee9 from'chalk';function formatDuration(_0x36762f){const _0x3ac6bd=a27_0x2376;if(_0x36762f<0x3c)return _0x36762f+'s';if(_0x36762f<0xe10)return Math[_0x3ac6bd(0x18a)](_0x36762f/0x3c)+'m\x20'+_0x36762f%0x3c+'s';const _0x488b89=Math[_0x3ac6bd(0x18a)](_0x36762f/0xe10),_0x151bc2=Math[_0x3ac6bd(0x18a)](_0x36762f%0xe10/0x3c);return _0x151bc2>0x0?_0x488b89+'h\x20'+_0x151bc2+'m':_0x488b89+'h';}function formatRelativeTime(_0x68b7fe){const _0x28b5ad=a27_0x2376,_0x4a55fc=Date[_0x28b5ad(0x17c)]()-_0x68b7fe[_0x28b5ad(0x1a7)](),_0x239db6=Math['floor'](Math[_0x28b5ad(0x16b)](_0x4a55fc)/0x3e8);if(_0x239db6<0x3c)return'just\x20now';const _0x149873=Math[_0x28b5ad(0x18a)](_0x239db6/0x3c);if(_0x149873<0x3c)return _0x149873+_0x28b5ad(0x1bb);const _0x421b4d=Math[_0x28b5ad(0x18a)](_0x149873/0x3c);if(_0x421b4d<0x18)return _0x421b4d+'h\x20ago';const _0xb020fd=Math[_0x28b5ad(0x18a)](_0x421b4d/0x18);if(_0xb020fd<0x1e)return _0xb020fd+_0x28b5ad(0x18e);return Math['floor'](_0xb020fd/0x1e)+_0x28b5ad(0x180);}export class JobListCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x1a5);['description']='List\x20jobs';async[a27_0x42d217(0x1bc)](_0x2d3142){const _0x3ce7bd=a27_0x42d217,{options:_0x1cb0e2,tdx:_0x50d448}=_0x2d3142,_0x3f8998=resolveLimit(_0x1cb0e2['limit'],DEFAULT_DISPLAY_LIMIT),_0x34e4ee=_0x1cb0e2['status'];_0x1cb0e2[_0x3ce7bd(0x193)]&&(console[_0x3ce7bd(0x18d)](_0x3ce7bd(0x16c)+_0x3f8998+_0x3ce7bd(0x195)),_0x34e4ee&&console['error'](_0x3ce7bd(0x197)+_0x34e4ee));const _0x1edadf=await withSpinner(_0x3ce7bd(0x1b6),()=>_0x50d448['jobs'][_0x3ce7bd(0x198)]({'from':0x0,'to':_0x3f8998-0x1,'status':_0x34e4ee}),{'verbose':_0x1cb0e2[_0x3ce7bd(0x193)]}),_0x140c3f=_0x1edadf[_0x3ce7bd(0x192)];console[_0x3ce7bd(0x18d)](_0x3ce7bd(0x1ae)+_0x140c3f[_0x3ce7bd(0x190)]+_0x3ce7bd(0x1a6)+(_0x140c3f[_0x3ce7bd(0x190)]!==0x1?'s':''));const _0x1e4949=_0x1cb0e2['site'];if(isStructuredFormat(_0x1cb0e2)){const _0x400bfe=_0x140c3f['map'](_0x346873=>{const _0x33f066=_0x3ce7bd;let _0x1c984a;if(_0x346873['start_at']&&_0x346873[_0x33f066(0x178)]){const _0x111cab=new Date(_0x346873[_0x33f066(0x15e)])[_0x33f066(0x1a7)](),_0x38b4c9=new Date(_0x346873[_0x33f066(0x178)])[_0x33f066(0x1a7)]();_0x1c984a=Math[_0x33f066(0x174)]((_0x38b4c9-_0x111cab)/0x3e8);}return{'job_id':_0x346873[_0x33f066(0x17e)],'type':_0x346873[_0x33f066(0x18c)]===_0x33f066(0x191)?_0x33f066(0x1a3):_0x346873[_0x33f066(0x18c)],'status':_0x346873[_0x33f066(0x1b5)],'user_name':_0x346873[_0x33f066(0x1b8)],'duration_sec':_0x1c984a,'created_at':_0x346873[_0x33f066(0x173)],'started_at':_0x346873[_0x33f066(0x15e)],'end_at':_0x346873['end_at']};});await handleSDKOutput(_0x400bfe,_0x1cb0e2);}else for(const _0x211afa of _0x140c3f){const _0x13279b=_0x211afa[_0x3ce7bd(0x1b5)]===_0x3ce7bd(0x163)?a27_0x523ee9[_0x3ce7bd(0x1a1)]:_0x211afa[_0x3ce7bd(0x1b5)]==='error'?a27_0x523ee9[_0x3ce7bd(0x162)]:a27_0x523ee9[_0x3ce7bd(0x187)],_0x2b1cd1=_0x13279b(_0x211afa['status']),_0x644b79=getJobUrl(_0x1e4949,_0x211afa[_0x3ce7bd(0x17e)]),_0x32e9d9=hyperlink(_0x211afa['job_id'],_0x644b79),_0x2c0266=a27_0x523ee9[_0x3ce7bd(0x187)](_0x211afa[_0x3ce7bd(0x18c)]==='presto'?'trino':_0x211afa['type']),_0x185b8d=[];if(_0x211afa[_0x3ce7bd(0x15e)]&&_0x211afa[_0x3ce7bd(0x178)]){const _0x183d1e=Math['round']((new Date(_0x211afa[_0x3ce7bd(0x178)])[_0x3ce7bd(0x1a7)]()-new Date(_0x211afa[_0x3ce7bd(0x15e)])[_0x3ce7bd(0x1a7)]())/0x3e8);_0x185b8d[_0x3ce7bd(0x1b2)](formatDuration(_0x183d1e));}if(_0x211afa[_0x3ce7bd(0x178)])_0x185b8d['push'](formatRelativeTime(new Date(_0x211afa[_0x3ce7bd(0x178)])));else _0x211afa[_0x3ce7bd(0x15e)]&&_0x185b8d[_0x3ce7bd(0x1b2)](formatRelativeTime(new Date(_0x211afa['start_at'])));const _0x51bfc6=_0x185b8d[_0x3ce7bd(0x190)]>0x0?a27_0x523ee9[_0x3ce7bd(0x187)]('\x20'+_0x185b8d[_0x3ce7bd(0x1b9)](',\x20')):'';console[_0x3ce7bd(0x1ba)]('⚡\x20'+_0x32e9d9+'\x20'+_0x2c0266+'\x20'+_0x2b1cd1+_0x51bfc6);}return 0x0;}}function a27_0x48be(){const _0x412d87=['job:kill','type','error','d\x20ago','submit','length','presto','data','verbose','args','\x20jobs','priority','Status\x20filter:\x20','list','query','Get\x20job\x20results','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','\x27\x20to\x20verify\x20the\x20job\x20status','1368AEQhpI','5dylAnA','✔\x20Job\x20submitted','3618396CbTkve','green','13fOpYaA','trino','Cancelled','jobs','\x20job','getTime','10OKoqsG','hive','\x20\x20Job\x20ID:\x20','result','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','yes','✔\x20Found\x20','show','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','push','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','1911872xxmraT','status','Listing\x20jobs...','1282221jABzvE','user_name','join','log','m\x20ago','execute','Getting\x20job\x20details...','Submitting\x20kill\x20request...','start_at','debug','3871323DVthRc','178SiBtir','red','success','4uFkgFg','2423874IKqUEJ','job:submit','681428UNYfHw','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','file','\x20row','abs','Limit:\x20','Kill\x20a\x20job','database','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','url','created_at','round','Getting\x20job\x20results...','validate','Submit\x20a\x20job','end_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','INVALID_ARGUMENT','job:show','now','job:result','job_id','kill','mo\x20ago','Submitting\x20job...','jobType','name','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','No\x20SQL\x20statements\x20found\x20in\x20file','description','dim','substring','14XZIaTa','floor'];a27_0x48be=function(){return _0x412d87;};return a27_0x48be();}export class JobShowCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x17b);[a27_0x42d217(0x186)]='Show\x20job\x20details';[a27_0x42d217(0x176)](_0x9cda29){const _0x4acb83=a27_0x42d217,_0xbfa604=_0x9cda29[_0x4acb83(0x194)][0x0];if(!_0xbfa604)return _0x4acb83(0x1b0);return undefined;}async[a27_0x42d217(0x1bc)](_0x400292){const _0x2ec3c7=a27_0x42d217,{options:_0x2355c0,args:_0x48741d,tdx:_0x482d8a}=_0x400292,_0x45750b=_0x48741d[0x0],_0x5ab690=await withSpinner(_0x2ec3c7(0x1bd),()=>_0x482d8a[_0x2ec3c7(0x1a5)][_0x2ec3c7(0x1af)](_0x45750b),{'verbose':_0x2355c0['verbose']}),_0x140885=_0x5ab690[_0x2ec3c7(0x192)];let _0x15853b;if(_0x140885[_0x2ec3c7(0x15e)]&&_0x140885['end_at']){const _0x34666c=new Date(_0x140885[_0x2ec3c7(0x15e)])['getTime'](),_0xd90d9b=new Date(_0x140885[_0x2ec3c7(0x178)])[_0x2ec3c7(0x1a7)]();_0x15853b=Math[_0x2ec3c7(0x174)]((_0xd90d9b-_0x34666c)/0x3e8);}const _0x2440e5={'job_id':_0x140885[_0x2ec3c7(0x17e)],'type':_0x140885[_0x2ec3c7(0x18c)],'status':_0x140885['status'],..._0x140885[_0x2ec3c7(0x1b8)]&&{'user_name':_0x140885[_0x2ec3c7(0x1b8)]},..._0x15853b!==undefined&&{'duration_sec':_0x15853b},..._0x140885['created_at']&&{'created_at':_0x140885[_0x2ec3c7(0x173)]},..._0x140885[_0x2ec3c7(0x15e)]&&{'started_at':_0x140885[_0x2ec3c7(0x15e)]},..._0x140885[_0x2ec3c7(0x178)]&&{'end_at':_0x140885[_0x2ec3c7(0x178)]},..._0x140885[_0x2ec3c7(0x16e)]&&{'database':_0x140885[_0x2ec3c7(0x16e)]},..._0x140885[_0x2ec3c7(0x196)]!==undefined&&{'priority':_0x140885[_0x2ec3c7(0x196)]},..._0x140885[_0x2ec3c7(0x172)]&&{'url':_0x140885[_0x2ec3c7(0x172)]},..._0x140885[_0x2ec3c7(0x199)]&&{'query':_0x140885[_0x2ec3c7(0x199)]},..._0x140885['debug']&&{'debug':_0x140885[_0x2ec3c7(0x15f)]}};return await handleSingleObjectOutput(_0x2440e5,_0x2355c0),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x18b);[a27_0x42d217(0x186)]=a27_0x42d217(0x16d);[a27_0x42d217(0x176)](_0x1a16ce){const _0x4194c8=a27_0x42d217,_0x229216=_0x1a16ce['args'][0x0];if(!_0x229216)return _0x4194c8(0x179);return undefined;}async[a27_0x42d217(0x1bc)](_0x51274e){const _0x147f97=a27_0x42d217,{options:_0x2440f8,args:_0x37861a,tdx:_0x3cfbdc}=_0x51274e,_0x92f940=_0x37861a[0x0];if(!_0x2440f8[_0x147f97(0x1ad)]){const _0x2bf66b=await confirm(_0x147f97(0x171)+_0x92f940+'?');if(!_0x2bf66b)return console['error'](_0x147f97(0x1a4)),0x0;}return await withSpinner(_0x147f97(0x1be),()=>_0x3cfbdc[_0x147f97(0x1a5)][_0x147f97(0x17f)](_0x92f940),{'verbose':_0x2440f8[_0x147f97(0x193)]}),console['error'](_0x147f97(0x168)+_0x92f940),console['error'](_0x147f97(0x16f)+_0x92f940+_0x147f97(0x19c)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x166);[a27_0x42d217(0x186)]=a27_0x42d217(0x177);async[a27_0x42d217(0x1bc)](_0x14cbae){const _0x5096f8=a27_0x42d217,{options:_0x2a5fcd,args:_0x5ee89f,tdx:_0x1df2fc}=_0x14cbae,_0xdfa449=_0x2a5fcd[_0x5096f8(0x182)]||_0x5096f8(0x1a3),_0x1f7487=_0x2a5fcd[_0x5096f8(0x169)],_0x5b37c8=_0x2a5fcd[_0x5096f8(0x16e)]||'information_schema',_0xb98e55=_0x2a5fcd[_0x5096f8(0x1ab)];if(_0xdfa449!==_0x5096f8(0x1a3)&&_0xdfa449!==_0x5096f8(0x1a9))throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x184));let _0x5c7ef5;if(_0x1f7487){if(_0x5ee89f[0x0])throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x19b));const _0x17caf5=readSqlStatementsFromFile(_0x1f7487);if(_0x17caf5['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5096f8(0x185));if(_0x17caf5[_0x5096f8(0x190)]>0x1)throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x1b3));_0x5c7ef5=_0x17caf5[0x0];}else{if(!_0x5ee89f[0x0])throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x1b1));_0x5c7ef5=_0x5ee89f[0x0];}_0x2a5fcd[_0x5096f8(0x193)]&&(console[_0x5096f8(0x18d)]('Job\x20type:\x20'+_0xdfa449),console[_0x5096f8(0x18d)]('Database:\x20'+_0x5b37c8),console[_0x5096f8(0x18d)]('Query:\x20'+_0x5c7ef5[_0x5096f8(0x188)](0x0,0x64)+(_0x5c7ef5[_0x5096f8(0x190)]>0x64?_0x5096f8(0x170):'')));const _0x4c9edf=await withSpinner(_0x5096f8(0x181),()=>_0x1df2fc[_0x5096f8(0x1a5)][_0x5096f8(0x18f)](_0x5b37c8,_0x5c7ef5,_0xdfa449,_0xb98e55),{'verbose':_0x2a5fcd['verbose']}),_0x1f40dd=_0x4c9edf[_0x5096f8(0x192)];return console[_0x5096f8(0x18d)](_0x5096f8(0x19f)),console['error'](_0x5096f8(0x1aa)+_0x1f40dd[_0x5096f8(0x17e)]),await handleSDKOutput([_0x1f40dd],_0x2a5fcd),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x17d);[a27_0x42d217(0x186)]=a27_0x42d217(0x19a);['validate'](_0x4cf67d){const _0xc62aba=a27_0x42d217,_0x3d23d0=_0x4cf67d[_0xc62aba(0x194)][0x0];if(!_0x3d23d0)return _0xc62aba(0x1ac);return undefined;}async[a27_0x42d217(0x1bc)](_0x521547){const _0x2a9b4a=a27_0x42d217,{options:_0x9fc269,args:_0x199697,tdx:_0x317921}=_0x521547,_0x307fe2=_0x199697[0x0],_0x4ff00f=await withSpinner(_0x2a9b4a(0x175),()=>_0x317921['jobs'][_0x2a9b4a(0x1ab)](_0x307fe2),{'verbose':_0x9fc269[_0x2a9b4a(0x193)]}),_0x2fd2a4=_0x4ff00f[_0x2a9b4a(0x192)];return console[_0x2a9b4a(0x18d)]('✔\x20Retrieved\x20'+_0x2fd2a4['length']+_0x2a9b4a(0x16a)+(_0x2fd2a4[_0x2a9b4a(0x190)]!==0x1?'s':'')),await handleSDKOutput(_0x2fd2a4,_0x9fc269),0x0;}}
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 +1 @@
1
- const a28_0x35a506=a28_0x5c6b;(function(_0x10fa3b,_0x15dad7){const _0x3b5a7a=a28_0x5c6b,_0x43d651=_0x10fa3b();while(!![]){try{const _0x5ba9c1=parseInt(_0x3b5a7a(0x16e))/0x1*(parseInt(_0x3b5a7a(0x20f))/0x2)+-parseInt(_0x3b5a7a(0x1f9))/0x3*(-parseInt(_0x3b5a7a(0x1a9))/0x4)+-parseInt(_0x3b5a7a(0x1df))/0x5*(parseInt(_0x3b5a7a(0x252))/0x6)+-parseInt(_0x3b5a7a(0x240))/0x7*(-parseInt(_0x3b5a7a(0x16b))/0x8)+-parseInt(_0x3b5a7a(0x20a))/0x9*(-parseInt(_0x3b5a7a(0x248))/0xa)+parseInt(_0x3b5a7a(0x153))/0xb*(parseInt(_0x3b5a7a(0x1ae))/0xc)+-parseInt(_0x3b5a7a(0x23c))/0xd*(parseInt(_0x3b5a7a(0x20e))/0xe);if(_0x5ba9c1===_0x15dad7)break;else _0x43d651['push'](_0x43d651['shift']());}catch(_0xffd775){_0x43d651['push'](_0x43d651['shift']());}}}(a28_0x592c,0xd6d0a));import a28_0x35ee26 from'chalk';import a28_0x3ba9f6 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';function a28_0x5c6b(_0x1728b7,_0x2bebe9){_0x1728b7=_0x1728b7-0x14f;const _0x592c35=a28_0x592c();let _0x5c6b8c=_0x592c35[_0x1728b7];return _0x5c6b8c;}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(_0x2d6238){const _0x1833b2=a28_0x5c6b;return!_0x2d6238&&(console[_0x1833b2(0x15a)](_0x1833b2(0x15f)),console[_0x1833b2(0x15a)](_0x1833b2(0x1ab))),!!_0x2d6238;}function withJsonFormat(_0x3bc8b3){const _0x140db0=a28_0x5c6b;if(!_0x3bc8b3[_0x140db0(0x241)]&&!_0x3bc8b3[_0x140db0(0x236)]&&!_0x3bc8b3[_0x140db0(0x1e8)]&&!_0x3bc8b3[_0x140db0(0x224)])return{..._0x3bc8b3,'format':_0x140db0(0x236),'json':!![]};return _0x3bc8b3;}function formatJourneyState(_0x5d1e26){const _0x504a8f=a28_0x5c6b;switch(_0x5d1e26){case _0x504a8f(0x1b5):return a28_0x35ee26[_0x504a8f(0x169)]('(running)');case _0x504a8f(0x150):return a28_0x35ee26[_0x504a8f(0x258)](_0x504a8f(0x198));case'paused':return a28_0x35ee26[_0x504a8f(0x187)]('(paused)');case _0x504a8f(0x185):return a28_0x35ee26[_0x504a8f(0x1f4)](_0x504a8f(0x175));case _0x504a8f(0x1f1):return a28_0x35ee26[_0x504a8f(0x258)](_0x504a8f(0x209));default:return'('+_0x5d1e26+')';}}function formatJourneyItem(_0x267eb4,_0x23c260='',_0x4b3c0a){const _0x4b9c72=a28_0x5c6b,_0x4594ee=formatJourneyState(_0x267eb4[_0x4b9c72(0x22f)]),_0x1c717e=_0x4b3c0a?hyperlink(_0x267eb4['journeyBundleName'],_0x4b3c0a):_0x267eb4[_0x4b9c72(0x158)];return _0x23c260+'🗺️\x20'+_0x1c717e+'\x20'+_0x4594ee;}function escapeRegex(_0x9858d7){const _0x2f9634=a28_0x5c6b;return _0x9858d7[_0x2f9634(0x21a)](/[.*+?^${}()|[\]\\]/g,_0x2f9634(0x179));}function globToRegex(_0x40edd2){const _0x4bbc66=a28_0x5c6b,_0x4ada25=_0x40edd2[_0x4bbc66(0x257)]('*')[_0x4bbc66(0x253)](escapeRegex);return new RegExp(_0x4ada25['join']('.*'),'i');}function buildRuleToNameMapping(_0x59a5e8){const _0x27b368=a28_0x5c6b,_0x507293=new Map();if(_0x59a5e8[_0x27b368(0x15c)])for(const [_0xc5659d,_0x7bc669]of Object['entries'](_0x59a5e8[_0x27b368(0x15c)])){if(_0x7bc669[_0x27b368(0x15d)]){const _0x3a7e88=serializeRule(_0x7bc669[_0x27b368(0x15d)]),_0x539352=_0x507293[_0x27b368(0x199)](_0x3a7e88);_0x539352?_0x539352['push'](_0xc5659d):_0x507293['set'](_0x3a7e88,[_0xc5659d]);}}return _0x507293;}async function resolveJourneyIdFromInput(_0x42c74d,_0x54a9d1,_0x3c752c){const _0x321939=a28_0x5c6b,_0x5594ed=await resolveJourneyTarget(_0x42c74d,_0x54a9d1['parentSegment'],_0x54a9d1[_0x321939(0x19e)]),_0x386787=_0x5594ed[_0x321939(0x25a)];if(!_0x386787)throw new SDKError(ErrorCode[_0x321939(0x184)],_0x321939(0x1f6));const _0x549eb5=await withSpinner(_0x321939(0x1d8),()=>_0x3c752c['segment'][_0x321939(0x22c)](_0x386787),{'verbose':_0x54a9d1[_0x321939(0x19e)]}),_0x6710e4=_0x549eb5[_0x321939(0x1ca)],_0x104004=await withSpinner(_0x321939(0x196),()=>_0x3c752c[_0x321939(0x1f3)][_0x321939(0x251)](_0x6710e4,_0x5594ed['journeyName']),{'verbose':_0x54a9d1[_0x321939(0x19e)]});return{'journeyId':_0x104004['data'],'journeyName':_0x5594ed[_0x321939(0x1d4)],'parentSegmentId':_0x6710e4};}async function resolveJourneyTarget(_0x529a37,_0x59fc2d,_0xfb485b){const _0x27fef4=a28_0x5c6b;if(isYamlFilePath(_0x529a37))try{const _0x2363ab=await resolveYamlFilePath(_0x529a37);return _0xfb485b&&(console[_0x27fef4(0x15a)]('Resolved\x20YAML\x20file:\x20'+_0x529a37),console[_0x27fef4(0x15a)](_0x27fef4(0x1d3)+_0x2363ab['parentSegment']),console['error'](_0x27fef4(0x1d7)+_0x2363ab[_0x27fef4(0x1b6)]),console[_0x27fef4(0x15a)](_0x27fef4(0x1c2)+(_0x2363ab[_0x27fef4(0x1c5)]||_0x27fef4(0x214)))),{'journeyName':_0x2363ab[_0x27fef4(0x1b6)],'parentSegment':_0x2363ab[_0x27fef4(0x25a)],'resolved':_0x2363ab};}catch(_0x25e575){throw new SDKError(ErrorCode[_0x27fef4(0x184)],_0x27fef4(0x152)+_0x25e575['message']);}if(!_0x59fc2d)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x529a37,'parentSegment':_0x59fc2d};}function a28_0x592c(){const _0x52c824=['✔\x20Pulled\x20','name','journey:push','user','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journey:pull','activationParams','/app/ps/','Resolving\x20journey...','isNew','(draft)','get','Aborted.','listJourneysWithFolders','localeCompare','options','verbose','\x20unchanged\x20files',',\x20version:\x20','parentName','has','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','description','\x20=\x20','journey:pause','Show\x20journey\x20statistics','Found\x20','4xcbnBa','Pausing\x20journey...','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','journey:versions','132FnmEdj','Show\x20journey\x20details','segment','Fetching\x20users\x20and\x20connections...','Error:\x20Invalid\x20--type\x20\x22','getActivation','journey:list','launched','segmentName','completionRate','dryRun','length','goal','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','goalSize','\x22\x20paused','\x20\x20-\x20','Getting\x20version\x20','List\x20activations\x20for\x20a\x20journey','absolutePath','\x20\x20Folder\x20path:\x20','Resolving\x20version...','table','folderPath','parent_segment','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','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)','data','web','Getting\x20journey\x20statistics...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','size','Warning:\x20Could\x20not\x20resolve\x20activation\x20','type','message','diff','\x20\x20Parent\x20segment:\x20','journeyName','createdAt','\x20files?','\x20\x20Name:\x20','Resolving\x20parent\x20segment...','Creating\x20new\x20version...','conversion','Options:','activation_','Error:\x20Journey\x20\x27','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','35CXpUNg','cwd','\x0aChanges\x20to\x20\x27','exitOrJumpSize','completeMilestoneRate','Fetching\x20parent\x20segment...','List\x20all\x20versions\x20of\x20a\x20journey','values','\x20version','jsonl','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','stageNameMap','join','Error:\x20Parent\x20segment\x20context\x20required','yes','milestoneSize','journey:version:create','Error:\x20Version\x20','archived','journey:activations','journey','blue','relative','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','hasPeriod','tdx.json','2486742dLxUNn','base','\x0aPull\x20summary:','then','resolveSegment','getTrafficData','find','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Error:\x20Stage\x20\x22','journeys','set','.yml','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','\x20\x20Statistics\x20not\x20available','Pattern:\x20','enteredSize','(archived)','55449skgFVD','toLowerCase','Cancelled','attributes','1498JlsnvQ','6rKFxcX','red','\x20\x20Journey\x20ID:\x20','\x0aError:','✔\x20Context\x20set:\x20','(root)','getLatestJourneyId','site','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','updatedAt','Available\x20stages:\x20','replace','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','repeat','history','getColumnMapping','Error:\x20Invalid\x20version\x20number:\x20','\x20->\x20','journey:version:view','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Getting\x20journey\x20traffic\x20data...','tsv','content','journeyBundleId','connector_config','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Pause\x20a\x20running\x20journey','execute','Target\x20file:\x20','resolveParentId','log','stages','state','add','reentryMode','push','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','test','json','filter','listVersions','✔\x20Journey\x20\x22','Fetching\x20journeys\x20and\x20folders...','Table:\x20','245349VSTLvP','no_parent','utf-8','\x20\x20Target:\x20','17780lmyGrF','format','Fetching\x20','filePath','buildIdToEmailMap','\x20versions)','No\x20journeys\x20found','\x20journey\x20files\x20to\x20','2120QHWDYe','\x22\x20resumed','Input:\x20','Target\x20directory:\x20','hasChanges','cyan','from','✔\x20Found\x20','exitOrJumpRate','resolveJourneyId','1427352vuoxxF','map','Parent\x20segment:\x20','Listing\x20journeys...','\x20not\x20found.\x20Available:\x20','split','dim','folders','parentSegment','renderStats','Listing\x20journey\x20activations...','file','listFolders','Journey\x20name:\x20','journeyStages','\x20activation','/j/da','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','draft','stage','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','229977TLgaZq','args','all','getJourney','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','journeyBundleName','📁\x20','error','pause','segments','rule','Error:\x20Journey\x20not\x20found:\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x20\x20Consolidating\x20duplicate\x20segment:\x20','/j/da/je','...','Resuming\x20journey...','buildIdToNameMap','root\x20folder','sort','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/e/','green','-\x20no\x20files\x20written','2752ezahFE','\x20(draft)\x20—\x20\x22','getStatistics','441918NWLtxd','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Folder\x20path:\x20','Getting\x20journey\x20details...','Database:\x20','versionNumber','Show\x20journey\x20table\x20column\x20mapping','(completed)','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journeyId','\x20(rule\x20match)','\x5c$&','targetDir','segmentPushCommand','resume','connection','folderId','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','limit','Write\x20','\x20(ID:\x20','\x22\x20not\x20found','INVALID_ARGUMENT','completed','includeHistory','yellow','session','getSegment','\x20Created\x20v','Error:\x20--version\x20option\x20is\x20required','paused','getParentFull'];a28_0x592c=function(){return _0x52c824;};return a28_0x592c();}export class JourneyListCommand extends BaseCommand{['name']=a28_0x35a506(0x1b4);[a28_0x35a506(0x1a4)]='List\x20journeys\x20in\x20current\x20context';async[a28_0x35a506(0x22a)](_0x2c60a8){const _0x56090e=a28_0x35a506,{options:_0x5c2612,args:_0x26b707,tdx:_0x1d6157}=_0x2c60a8,_0x1051ec=_0x26b707[0x0],_0x1c2dbf=_0x5c2612['parentSegment'];if(!_0x1c2dbf)return console[_0x56090e(0x15a)](_0x56090e(0x1ec)),console[_0x56090e(0x15a)](_0x56090e(0x222)),0x1;const _0x123819=await withSpinner(_0x56090e(0x1d8),()=>_0x1d6157['segment'][_0x56090e(0x22c)](_0x1c2dbf),{'verbose':_0x5c2612[_0x56090e(0x19e)]}),_0x3ffa80=_0x123819[_0x56090e(0x1ca)];_0x5c2612['verbose']&&(console[_0x56090e(0x15a)](_0x56090e(0x254)+_0x1c2dbf+_0x56090e(0x182)+_0x3ffa80+')'),_0x1051ec&&console[_0x56090e(0x15a)](_0x56090e(0x207)+_0x1051ec));const _0x49ee66=await withSpinner(_0x56090e(0x1e4),()=>_0x1d6157[_0x56090e(0x1b0)][_0x56090e(0x18d)](_0x3ffa80),{'verbose':_0x5c2612[_0x56090e(0x19e)]}),_0x1ce32d=_0x49ee66[_0x56090e(0x1ca)],_0x5cd72e=_0x1ce32d['rootFolderId'],_0x5292b1=await withSpinner(_0x56090e(0x255),()=>_0x1d6157[_0x56090e(0x1f3)][_0x56090e(0x19b)](_0x3ffa80,_0x5cd72e),{'verbose':_0x5c2612[_0x56090e(0x19e)]});let _0xb45402=_0x5292b1[_0x56090e(0x1ca)][_0x56090e(0x202)];const _0x4583a7=_0x5292b1[_0x56090e(0x1ca)][_0x56090e(0x259)],_0x5b21cd=new Map();for(const _0x9575df of _0x4583a7){_0x5b21cd[_0x56090e(0x203)](_0x9575df['id'],_0x9575df[_0x56090e(0x18f)]);}if(_0x1051ec){const _0x4ffe8a=globToRegex(_0x1051ec);_0xb45402=_0xb45402[_0x56090e(0x237)](_0x165393=>_0x4ffe8a[_0x56090e(0x235)](_0x165393['journeyBundleName']));}console['error'](_0x56090e(0x24f)+_0xb45402[_0x56090e(0x1b9)]+'\x20journey'+(_0xb45402[_0x56090e(0x1b9)]!==0x1?'s':''));const _0x1345d1=_0x3ab3dc=>{const _0x2956f0=_0x56090e;return getConsoleNextUrl(_0x5c2612[_0x2956f0(0x216)],_0x2956f0(0x195)+_0x3ffa80+_0x2956f0(0x168)+_0x3ab3dc+_0x2956f0(0x262));};if(_0x5c2612[_0x56090e(0x241)]==='table')await handleSDKOutput(_0xb45402,_0x5c2612);else{if(_0x5c2612[_0x56090e(0x241)]===_0x56090e(0x236)){const _0x1864f6=_0xb45402[_0x56090e(0x253)](_0x18bcb3=>({..._0x18bcb3,'url':_0x1345d1(_0x18bcb3['id'])}));await handleSDKOutput(_0x1864f6,_0x5c2612);}else{console['log']('['+_0x1c2dbf+']');const _0x3d7d88=new Map(),_0x283348=[];for(const _0x2bdc4a of _0xb45402){if(!_0x2bdc4a[_0x56090e(0x17e)]||_0x2bdc4a[_0x56090e(0x17e)]===_0x5cd72e)_0x283348[_0x56090e(0x232)](_0x2bdc4a);else{const _0x5e307e=_0x3d7d88[_0x56090e(0x199)](_0x2bdc4a[_0x56090e(0x17e)])||[];_0x5e307e[_0x56090e(0x232)](_0x2bdc4a),_0x3d7d88[_0x56090e(0x203)](_0x2bdc4a[_0x56090e(0x17e)],_0x5e307e);}}const _0xea8bf5=(_0x42a033,_0x12b7ca)=>_0x42a033[_0x56090e(0x158)][_0x56090e(0x19c)](_0x12b7ca[_0x56090e(0x158)],undefined,{'sensitivity':_0x56090e(0x1fa)});_0x283348[_0x56090e(0x166)](_0xea8bf5);for(const _0x3d1099 of _0x283348){console[_0x56090e(0x22d)](formatJourneyItem(_0x3d1099,'',_0x1345d1(_0x3d1099['id'])));}const _0x2e1afa=[..._0x3d7d88['entries']()][_0x56090e(0x166)]((_0x1e382e,_0x20dd55)=>{const _0x3a8d2d=_0x56090e,_0x39c62c=_0x5b21cd[_0x3a8d2d(0x199)](_0x1e382e[0x0])||_0x1e382e[0x0],_0x3eef97=_0x5b21cd['get'](_0x20dd55[0x0])||_0x20dd55[0x0];return _0x39c62c[_0x3a8d2d(0x19c)](_0x3eef97,undefined,{'sensitivity':'base'});});for(const [_0x149bbc,_0x4488a2]of _0x2e1afa){const _0x5632d2=_0x5b21cd[_0x56090e(0x199)](_0x149bbc)||_0x149bbc;console[_0x56090e(0x22d)](_0x56090e(0x159)+_0x5632d2),_0x4488a2[_0x56090e(0x166)](_0xea8bf5);for(const _0x2b594b of _0x4488a2){console['log'](formatJourneyItem(_0x2b594b,'\x20\x20',_0x1345d1(_0x2b594b['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:view';['description']=a28_0x35a506(0x1af);async['execute'](_0x497128){const _0x36d5ed=a28_0x35a506,{options:_0x522c4d,args:_0x283925,tdx:_0xedaf2e}=_0x497128,_0x20cf29=_0x283925[0x0];if(!_0x20cf29)return console[_0x36d5ed(0x15a)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x36d5ed(0x15a)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x36d5ed(0x15a)](_0x36d5ed(0x1db)),console['error'](_0x36d5ed(0x1ac)),0x1;_0x522c4d[_0x36d5ed(0x19e)]&&console['error'](_0x36d5ed(0x24a)+_0x20cf29);const {journeyId:_0x33ec35,parentSegmentId:_0x2041a6}=await resolveJourneyIdFromInput(_0x20cf29,_0x522c4d,_0xedaf2e);if(_0x522c4d[_0x36d5ed(0x1cb)]){const _0x4b5c63=getConsoleNextUrl(_0x522c4d['site'],_0x36d5ed(0x195)+_0x2041a6+_0x36d5ed(0x168)+_0x33ec35+'/j/da/je');return console['error'](a28_0x35ee26[_0x36d5ed(0x169)]('✔')+'\x20Opening\x20'+a28_0x35ee26['cyan'](_0x4b5c63)),openBrowser(_0x4b5c63),0x0;}const _0x477906=await withSpinner(_0x36d5ed(0x171),()=>_0xedaf2e['journey']['getJourney'](_0x33ec35),{'verbose':_0x522c4d[_0x36d5ed(0x19e)]}),_0x26c5af=_0x477906[_0x36d5ed(0x1ca)],_0x15fb92=_0x522c4d['includeStats'];let _0x59e0e2;if(_0x15fb92)try{const _0x12dc89=await withSpinner(_0x36d5ed(0x1cc),()=>_0xedaf2e[_0x36d5ed(0x1f3)]['getStatistics'](_0x33ec35),{'verbose':_0x522c4d[_0x36d5ed(0x19e)]});_0x59e0e2=_0x12dc89['data'];}catch{_0x522c4d[_0x36d5ed(0x19e)]&&console[_0x36d5ed(0x15a)](_0x36d5ed(0x206));}const _0x28fb5e=getConsoleNextUrl(_0x522c4d[_0x36d5ed(0x216)],_0x36d5ed(0x195)+_0x2041a6+'/e/'+_0x33ec35+'/j/da/je'),_0x579143={'id':_0x26c5af['id'],'name':_0x26c5af['attributes'][_0x36d5ed(0x18f)],'description':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x1a4)],'state':_0x26c5af[_0x36d5ed(0x20d)]['state'],'paused':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x18c)],'reentry_mode':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x231)],'stages':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x260)]?.[_0x36d5ed(0x1b9)]||0x0,..._0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x1ba)]&&{'goal':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x1ba)][_0x36d5ed(0x18f)]},..._0x59e0e2&&{'statistics':{'size':_0x59e0e2[_0x36d5ed(0x1ce)],'entered':_0x59e0e2[_0x36d5ed(0x208)],'goal_achieved':_0x59e0e2[_0x36d5ed(0x1bc)],'completion_rate':_0x59e0e2[_0x36d5ed(0x1b7)],'exit_or_jump':_0x59e0e2[_0x36d5ed(0x1e2)],'exit_or_jump_rate':_0x59e0e2[_0x36d5ed(0x250)],'stages':_0x59e0e2[_0x36d5ed(0x22e)]}},'url':_0x28fb5e};return await handleSingleObjectOutput(_0x579143,_0x522c4d),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:stats';['description']=a28_0x35a506(0x1a7);async['execute'](_0x51e726){const _0x3f3e14=a28_0x35a506,{options:_0x4c7dfa,args:_0x359f72,tdx:_0x273fc6}=_0x51e726,_0xdd61b1=_0x359f72[0x0];if(!requireNameOrPath(_0xdd61b1))return 0x1;_0x4c7dfa[_0x3f3e14(0x19e)]&&console[_0x3f3e14(0x15a)](_0x3f3e14(0x24a)+_0xdd61b1);const _0x458fb6=_0x4c7dfa,_0x3b6df9=_0x458fb6[_0x3f3e14(0x24e)],_0x37b093=_0x458fb6['to'],_0x5d0b37=_0x458fb6[_0x3f3e14(0x186)],_0x59d578=_0x458fb6[_0x3f3e14(0x151)];_0x5d0b37&&!_0x3b6df9&&!_0x37b093&&console[_0x3f3e14(0x15a)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x5111c7=_0x5d0b37?withJsonFormat(_0x4c7dfa):_0x4c7dfa,{journeyId:_0x44cf92,journeyName:_0x4fb6f3}=await resolveJourneyIdFromInput(_0xdd61b1,_0x5111c7,_0x273fc6),_0x38fdeb=_0x3b6df9||_0x37b093?{'from':_0x3b6df9,'to':_0x37b093}:undefined,_0x3ceaec=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise['all']([_0x273fc6[_0x3f3e14(0x1f3)][_0x3f3e14(0x156)](_0x44cf92),_0x273fc6[_0x3f3e14(0x1f3)][_0x3f3e14(0x16d)](_0x44cf92,_0x38fdeb)]),{'verbose':_0x5111c7['verbose']}),[_0x3cbd99,_0x2731b5]=_0x3ceaec[_0x3f3e14(0x1ca)];if(!_0x2731b5||_0x2731b5[_0x3f3e14(0x177)]===null)return console[_0x3f3e14(0x15a)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x4fb6f3),console[_0x3f3e14(0x15a)](_0x3f3e14(0x21b)),0x0;const _0xf4286e=buildStageNameMap(_0x3cbd99),_0x27d2a4=!!(_0x38fdeb&&_0x2731b5[_0x3f3e14(0x21d)]?.[_0x3f3e14(0x1b9)]),_0x316446={'stageNameMap':_0xf4286e,'hasPeriod':_0x27d2a4,'includeHistory':!!_0x5d0b37};if(_0x59d578&&_0x2731b5[_0x3f3e14(0x22e)]){const _0x1fd950=_0x2731b5[_0x3f3e14(0x22e)][_0x3f3e14(0x1ff)](_0x4a15f4=>{const _0x5eb1b4=_0x3f3e14,_0x40b8f1=_0xf4286e[_0x5eb1b4(0x199)](_0x4a15f4['id'])??'';return _0x40b8f1[_0x5eb1b4(0x20b)]()===_0x59d578[_0x5eb1b4(0x20b)]();});if(_0x1fd950)return await handleSingleObjectOutput(formatStageStats(_0x1fd950,_0x316446),_0x5111c7),0x0;const _0x1e9721=_0x2731b5[_0x3f3e14(0x22e)]['map'](_0x2ee43c=>_0xf4286e[_0x3f3e14(0x199)](_0x2ee43c['id'])??_0x2ee43c['id']);return console['error'](_0x3f3e14(0x201)+_0x59d578+_0x3f3e14(0x183)),console[_0x3f3e14(0x15a)](_0x3f3e14(0x219)+_0x1e9721[_0x3f3e14(0x1eb)](',\x20')),0x1;}const _0x391163=_0x2731b5[_0x3f3e14(0x22e)]?.[_0x3f3e14(0x253)](_0x2b0877=>formatStageStats(_0x2b0877,_0x316446)),_0x476af8=assembleJourneyStats(_0x2731b5,{'from':_0x3b6df9,'to':_0x37b093,'includeHistory':_0x5d0b37});return await this[_0x3f3e14(0x25b)](_0x476af8,_0x391163??[],_0x5111c7),0x0;}async['renderStats'](_0x3c93e8,_0x281b74,_0x4031a0){const _0x1f0912=a28_0x35a506,_0x494e43=_0x4031a0[_0x1f0912(0x241)]===_0x1f0912(0x236)||_0x4031a0[_0x1f0912(0x241)]===_0x1f0912(0x1e8)||_0x4031a0[_0x1f0912(0x236)]||_0x4031a0[_0x1f0912(0x1e8)];if(_0x494e43){_0x3c93e8[_0x1f0912(0x22e)]=_0x281b74,await handleSingleObjectOutput(_0x3c93e8,_0x4031a0);return;}await handleSingleObjectOutput(_0x3c93e8,_0x4031a0);for(const _0x24dd67 of _0x281b74){console[_0x1f0912(0x22d)](''),console[_0x1f0912(0x22d)](String(a28_0x35ee26[_0x1f0912(0x24d)]['bold']('['+_0x24dd67['name']+']'))+a28_0x35ee26[_0x1f0912(0x258)]('\x20'+_0x24dd67['id']));const {id:_0x1f89ae,name:_0x2e36a8,..._0x19551d}=_0x24dd67;await handleSingleObjectOutput(_0x19551d,_0x4031a0);}}}export class JourneyTrafficCommand extends BaseCommand{['name']='journey:traffic';[a28_0x35a506(0x1a4)]=a28_0x35a506(0x1c7);async[a28_0x35a506(0x22a)](_0x593025){const _0x3fc6e5=a28_0x35a506,{options:_0x2b83a9,args:_0x26f5d2,tdx:_0x5a5225}=_0x593025,_0x11d421=_0x26f5d2[0x0];if(!requireNameOrPath(_0x11d421))return 0x1;_0x2b83a9[_0x3fc6e5(0x19e)]&&console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x24a)+_0x11d421);const _0x19af03=_0x2b83a9,_0x41eb13=_0x19af03[_0x3fc6e5(0x1d0)],_0x8afb52=_0x19af03[_0x3fc6e5(0x24e)],_0x105103=_0x19af03['to'],_0x418948=_0x19af03[_0x3fc6e5(0x180)];if(_0x41eb13&&_0x41eb13!==_0x3fc6e5(0x1da)&&_0x41eb13!=='activation')return console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x1b2)+_0x41eb13+_0x3fc6e5(0x217)),0x1;const _0x42c232=withJsonFormat(_0x2b83a9),{journeyId:_0x3a5b72,journeyName:_0xb47949}=await resolveJourneyIdFromInput(_0x11d421,_0x42c232,_0x5a5225),_0x2e2f1b={'type':_0x41eb13,'from':_0x8afb52,'to':_0x105103,'limit':_0x418948},_0x41988b=await withSpinner(_0x3fc6e5(0x223),()=>_0x5a5225[_0x3fc6e5(0x1f3)][_0x3fc6e5(0x1fe)](_0x3a5b72,_0x2e2f1b),{'verbose':_0x42c232['verbose']}),_0x856f99=_0x41988b[_0x3fc6e5(0x1ca)],_0x231ad0=_0x856f99['conversion']&&(_0x856f99[_0x3fc6e5(0x1da)]['nodes']['length']>0x0||_0x856f99[_0x3fc6e5(0x1da)]['links']['length']>0x0),_0x16e3b0=_0x856f99['activation']&&_0x856f99['activation'][_0x3fc6e5(0x1b9)]>0x0;if(!_0x231ad0&&!_0x16e3b0)return console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x1e9)+_0xb47949),console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x17f)),_0x8afb52&&_0x105103&&console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x1cd)),0x0;return await handleSingleObjectOutput(_0x856f99,_0x42c232),0x0;}}function formatStageStats(_0x5b363c,_0x28caa9){const _0x2f7d34=a28_0x35a506,_0x296126=_0x28caa9[_0x2f7d34(0x1f7)]&&_0x5b363c[_0x2f7d34(0x21d)]?.['length']?aggregateStageHistory(_0x5b363c[_0x2f7d34(0x21d)]):{'size':_0x5b363c['size'],'entered':_0x5b363c[_0x2f7d34(0x208)],'milestone':_0x5b363c[_0x2f7d34(0x1ee)],'milestone_rate':_0x5b363c[_0x2f7d34(0x1e3)],'exit_or_jump':_0x5b363c[_0x2f7d34(0x1e2)],'exit_or_jump_rate':_0x5b363c[_0x2f7d34(0x250)]},_0x326fff={'id':_0x5b363c['id'],'name':_0x28caa9[_0x2f7d34(0x1ea)][_0x2f7d34(0x199)](_0x5b363c['id'])??_0x5b363c['id'],..._0x296126};return _0x28caa9[_0x2f7d34(0x1f7)]&&_0x28caa9['includeHistory']&&_0x5b363c[_0x2f7d34(0x21d)]&&(_0x326fff[_0x2f7d34(0x21d)]=_0x5b363c[_0x2f7d34(0x21d)]),_0x326fff;}export class JourneyPauseCommand extends BaseCommand{['name']=a28_0x35a506(0x1a6);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x229);async[a28_0x35a506(0x22a)](_0x561ee3){const _0x590eb5=a28_0x35a506,{options:_0x1a2826,args:_0x31e0df,tdx:_0x47d9a1}=_0x561ee3,_0x18c2f5=_0x31e0df[0x0];if(!requireNameOrPath(_0x18c2f5))return 0x1;_0x1a2826[_0x590eb5(0x19e)]&&console[_0x590eb5(0x15a)](_0x590eb5(0x24a)+_0x18c2f5);const {journeyId:_0x286c44,journeyName:_0x35ce60}=await resolveJourneyIdFromInput(_0x18c2f5,_0x1a2826,_0x47d9a1);if(!_0x1a2826[_0x590eb5(0x1ed)]){const _0x5c1d1e=await confirm(_0x590eb5(0x200)+_0x35ce60+'\x22?');if(!_0x5c1d1e)return console['error'](_0x590eb5(0x20c)),0x0;}const _0x54dbc9=await withSpinner(_0x590eb5(0x1aa),()=>_0x47d9a1[_0x590eb5(0x1f3)][_0x590eb5(0x15b)](_0x286c44),{'verbose':_0x1a2826[_0x590eb5(0x19e)]}),_0x4fa5be=_0x54dbc9[_0x590eb5(0x1ca)];return console[_0x590eb5(0x15a)](_0x590eb5(0x239)+_0x4fa5be[_0x590eb5(0x20d)][_0x590eb5(0x18f)]+_0x590eb5(0x1bd)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:resume';[a28_0x35a506(0x1a4)]='Resume\x20a\x20paused\x20journey';async[a28_0x35a506(0x22a)](_0x1ed973){const _0x2ac3c4=a28_0x35a506,{options:_0x1a61ca,args:_0x8fecaf,tdx:_0x329db6}=_0x1ed973,_0x406e86=_0x8fecaf[0x0];if(!requireNameOrPath(_0x406e86))return 0x1;_0x1a61ca[_0x2ac3c4(0x19e)]&&console['error']('Input:\x20'+_0x406e86);const {journeyId:_0x251f4d,journeyName:_0x48ae5f}=await resolveJourneyIdFromInput(_0x406e86,_0x1a61ca,_0x329db6);if(!_0x1a61ca[_0x2ac3c4(0x1ed)]){const _0x467af6=await confirm(_0x2ac3c4(0x1c8)+_0x48ae5f+'\x22?');if(!_0x467af6)return console[_0x2ac3c4(0x15a)]('Cancelled'),0x0;}const _0x5de4db=await withSpinner(_0x2ac3c4(0x163),()=>_0x329db6[_0x2ac3c4(0x1f3)][_0x2ac3c4(0x17c)](_0x251f4d),{'verbose':_0x1a61ca[_0x2ac3c4(0x19e)]}),_0x1d7ca3=_0x5de4db[_0x2ac3c4(0x1ca)];return console[_0x2ac3c4(0x15a)](_0x2ac3c4(0x239)+_0x1d7ca3[_0x2ac3c4(0x20d)]['name']+_0x2ac3c4(0x249)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x193);[a28_0x35a506(0x1a4)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a28_0x35a506(0x22a)](_0x4c1b06){const _0x3bd2c9=a28_0x35a506,{options:_0x4c1b9a,args:_0xee4706,tdx:_0x45e3d4}=_0x4c1b06,_0x41bf22=_0x4c1b9a,_0x4a461e=_0xee4706[0x0],_0x48f325=_0x4a461e&&isYamlFilePath(_0x4a461e),_0x2525fe=await resolveTarget({'arg':_0x48f325?_0x4a461e:undefined,'contextParent':_0x4c1b9a['parentSegment'],'cwd':process[_0x3bd2c9(0x1e0)]()});if(!isSuccessfulResolution(_0x2525fe))return _0x2525fe['errorCode']===_0x3bd2c9(0x23d)?(console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x187)](_0x3bd2c9(0x14f))),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1c9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),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[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1a3))):(console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x210)]('Error:\x20'+_0x2525fe['message']+'\x0a')),_0x2525fe['helpText']&&console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x24d)](_0x2525fe['helpText']))),0x1;let _0x38b518=_0x48f325?undefined:_0x4a461e,_0x3f1d3e,_0x656254;_0x2525fe[_0x3bd2c9(0x1d0)]===_0x3bd2c9(0x25d)&&(_0x38b518=_0x2525fe['resourceName'],_0x3f1d3e=_0x2525fe[_0x3bd2c9(0x243)],_0x656254=_0x2525fe[_0x3bd2c9(0x1c5)]);const _0x2cc5be=_0x2525fe[_0x3bd2c9(0x1a1)],_0x1d8755=_0x2525fe[_0x3bd2c9(0x17a)];_0x41bf22['verbose']&&(console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x254)+_0x2cc5be),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x24b)+_0x1d8755),_0x38b518&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x25f)+_0x38b518),_0x3f1d3e&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x22b)+_0x3f1d3e),_0x656254&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x170)+_0x656254));const _0x237894=await withSpinner(_0x3bd2c9(0x1d8),()=>_0x45e3d4[_0x3bd2c9(0x1b0)][_0x3bd2c9(0x22c)](_0x2cc5be),{'verbose':_0x4c1b9a[_0x3bd2c9(0x19e)]}),_0x5b5901=_0x237894[_0x3bd2c9(0x1ca)],{journeys:_0xe9f18b,folders:_0x4e709b}=await withSpinner(_0x3bd2c9(0x23a),async()=>{const _0x4a2961=_0x3bd2c9,[_0x2b9b1a,_0x2f9bf0]=await Promise['all']([_0x45e3d4['journey']['listJourneysFromParentSegment'](_0x5b5901,undefined,{'includeAllVersions':!![]}),_0x45e3d4['segment'][_0x4a2961(0x25e)](_0x5b5901)]);return{'journeys':_0x2b9b1a,'folders':_0x2f9bf0};},{'verbose':_0x4c1b9a['verbose']})['then'](_0x94abc5=>_0x94abc5[_0x3bd2c9(0x1ca)]);let _0x2c7ea5=_0xe9f18b;const _0xb483c1=buildFolderIdToPathMap(_0x4e709b);if(_0x38b518){const _0x3fd0a2=_0x2c7ea5[_0x3bd2c9(0x237)](_0x338014=>_0x338014[_0x3bd2c9(0x158)]['toLowerCase']()===_0x38b518[_0x3bd2c9(0x20b)]());if(_0x3fd0a2[_0x3bd2c9(0x1b9)]===0x0)return console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x15e)+_0x38b518),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1bb)),0x1;_0x2c7ea5=_0x3fd0a2;}if(_0x656254!==undefined){const _0x408014=_0x2c7ea5[_0x3bd2c9(0x237)](_0x4be564=>{const _0x5694d0=_0x3bd2c9,_0x11fec1=_0x4be564[_0x5694d0(0x17e)]?_0xb483c1['get'](_0x4be564[_0x5694d0(0x17e)])||'':'';return _0x11fec1===_0x656254;});if(_0x408014[_0x3bd2c9(0x1b9)]===0x0&&_0x2c7ea5['length']>0x0){console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1dd)+_0x38b518+'\x27\x20not\x20found\x20in\x20'+(_0x656254||_0x3bd2c9(0x165))),console['error'](_0x3bd2c9(0x1de));for(const _0x68d68f of _0x2c7ea5){const _0x384fa2=_0x68d68f[_0x3bd2c9(0x17e)]?_0xb483c1[_0x3bd2c9(0x199)](_0x68d68f[_0x3bd2c9(0x17e)])||'':'';console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1be)+(_0x384fa2||_0x3bd2c9(0x214))+'/'+_0x68d68f[_0x3bd2c9(0x158)]);}return 0x1;}_0x2c7ea5=_0x408014;}if(_0x2c7ea5[_0x3bd2c9(0x1b9)]===0x0)return console['error'](_0x3bd2c9(0x246)),0x0;const _0x526a9d=new Map();for(const _0x1e52de of _0x2c7ea5){const _0x3f1dd5=_0x1e52de['journeyBundleId'];!_0x526a9d[_0x3bd2c9(0x1a2)](_0x3f1dd5)&&_0x526a9d['set'](_0x3f1dd5,[]),_0x526a9d[_0x3bd2c9(0x199)](_0x3f1dd5)[_0x3bd2c9(0x232)](_0x1e52de);}for(const _0x18c1ad of _0x526a9d['values']()){_0x18c1ad[_0x3bd2c9(0x166)]((_0x3a6c02,_0x1a289b)=>(_0x3a6c02[_0x3bd2c9(0x173)]||0x0)-(_0x1a289b[_0x3bd2c9(0x173)]||0x0));}const _0x241dcb=[],{idToEmailMap:_0x4beea1,connectionIdToNameMap:_0x278361}=await withSpinner(_0x3bd2c9(0x1b1),async()=>{const _0x3c1985=_0x3bd2c9,[_0x593e98,_0x3109f5]=await Promise[_0x3c1985(0x155)]([_0x45e3d4[_0x3c1985(0x191)][_0x3c1985(0x244)](),_0x45e3d4[_0x3c1985(0x17d)][_0x3c1985(0x164)]()]);return{'idToEmailMap':_0x593e98,'connectionIdToNameMap':_0x3109f5};},{'verbose':_0x4c1b9a[_0x3bd2c9(0x19e)]})[_0x3bd2c9(0x1fc)](_0x50cb8a=>_0x50cb8a[_0x3bd2c9(0x1ca)]);for(const _0x5e6e27 of _0x526a9d[_0x3bd2c9(0x1e6)]()){const _0x4052c6=_0x5e6e27[0x0][_0x3bd2c9(0x158)],_0x41e57f=_0x5e6e27[0x0]['folderId'],_0x3e0136=_0x41e57f?_0xb483c1[_0x3bd2c9(0x199)](_0x41e57f)||'':'',_0x257725=_0x3e0136?a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x1d8755,_0x3e0136):_0x1d8755,_0x497f55=_0x3f1d3e||a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x257725,sanitizeFileName(_0x4052c6)+_0x3bd2c9(0x204));let _0x3349dc,_0x4f6272;if(existsSync(_0x497f55))try{const _0x54d753=readFileSync(_0x497f55,_0x3bd2c9(0x23e)),_0x4a2f08=parseYamlString(_0x54d753);_0x4f6272=_0x4a2f08,_0x3349dc=buildRuleToNameMapping(_0x4a2f08),_0x41bf22['verbose']&&_0x3349dc[_0x3bd2c9(0x1ce)]>0x0&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1a8)+_0x3349dc[_0x3bd2c9(0x1ce)]+_0x3bd2c9(0x233)+_0x4052c6);}catch(_0x3b290d){_0x41bf22[_0x3bd2c9(0x19e)]&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x192)+_0x3b290d[_0x3bd2c9(0x1d1)]);}const _0x2890f4=[],_0x35c190=new Set(),_0x2b1fc6=new Map(),_0x30b7ec=new Map(),_0x3f8bf6=new Set(),_0x126044=new Map(),_0x50ecf3=new Map(),_0x1ce9d3=createJumpTargetCache();await withProgressSpinner(_0x3bd2c9(0x242)+_0x4052c6+_0x3bd2c9(0x162),async _0x29071b=>{const _0xd7d193=_0x3bd2c9;for(const _0x2fb4d7 of _0x5e6e27){const _0x518b93=_0x5e6e27[_0xd7d193(0x1b9)]>0x1?_0x2fb4d7[_0xd7d193(0x158)]+'\x20v'+(_0x2fb4d7['versionNumber']||0x1):_0x2fb4d7[_0xd7d193(0x158)];_0x29071b['setPhase'](_0xd7d193(0x242)+_0x518b93);const _0x10a684=await _0x45e3d4['journey'][_0xd7d193(0x156)](_0x2fb4d7['id']),_0x14304d=_0x10a684[_0xd7d193(0x20d)]?.['audienceId'],_0x2244f1={'resolveSegment':async _0x49f8a3=>{const _0x38de4d=_0xd7d193;if(!_0x14304d)return{'name':_0x49f8a3,'isJourneyLocal':![]};const _0x1aa50c=_0x2b1fc6['get'](_0x49f8a3);if(_0x1aa50c)return _0x1aa50c;try{const _0x9cfb7a=await _0x45e3d4[_0x38de4d(0x1b0)][_0x38de4d(0x189)](_0x14304d,_0x49f8a3),_0x3c19a4=_0x9cfb7a['kind']===SEGMENT_KIND_JOURNEY;let _0x193e95,_0x38cc53=_0x9cfb7a['name'];if(_0x3c19a4&&_0x9cfb7a[_0x38de4d(0x15d)]){const _0x4afe57=await segmentResponseToDef(_0x9cfb7a,{'resolveSegmentName':async _0x487bfc=>{const _0x5d803e=_0x38de4d,_0x3e68de=_0x2b1fc6[_0x5d803e(0x199)](_0x487bfc);if(_0x3e68de)return _0x3e68de[_0x5d803e(0x18f)];const _0x708af7=await _0x2244f1[_0x5d803e(0x1fd)](_0x487bfc);return _0x708af7['name'];}}),_0x2b536f=_0x4afe57[_0x38de4d(0x15d)];_0x193e95={'description':_0x9cfb7a['description'],'rule':_0x2b536f};const _0x5f3098=serializeRule(_0x2b536f),_0x17507b=_0x30b7ec['get'](_0x5f3098);if(_0x17507b)_0x38cc53=_0x17507b,_0x193e95=undefined,_0x41bf22[_0x38de4d(0x19e)]&&console['error'](_0x38de4d(0x160)+_0x9cfb7a[_0x38de4d(0x18f)]+_0x38de4d(0x220)+_0x17507b);else{let _0x446fa7=![];if(_0x3349dc){const _0x60cf39=_0x3349dc['get'](_0x5f3098);if(_0x60cf39){const _0x546c53=_0x60cf39[_0x38de4d(0x1ff)](_0x51624a=>!_0x35c190[_0x38de4d(0x1a2)](_0x51624a));_0x546c53&&(_0x38cc53=_0x546c53,_0x35c190[_0x38de4d(0x230)](_0x546c53),_0x30b7ec[_0x38de4d(0x203)](_0x5f3098,_0x546c53),_0x446fa7=!![],_0x41bf22[_0x38de4d(0x19e)]&&console[_0x38de4d(0x15a)](_0x38de4d(0x16f)+_0x546c53+_0x38de4d(0x178)));}}if(!_0x446fa7){const _0x27151a=generateJourneyLocalName(_0x9cfb7a[_0x38de4d(0x18f)]);_0x27151a&&(_0x38cc53=_0x27151a);let _0x3ca508=_0x38cc53,_0x35e1d6=0x2;while(_0x35c190[_0x38de4d(0x1a2)](_0x3ca508)){_0x3ca508=_0x38cc53+'_'+_0x35e1d6,_0x35e1d6++;}_0x35c190[_0x38de4d(0x230)](_0x3ca508),_0x30b7ec[_0x38de4d(0x203)](_0x5f3098,_0x3ca508),_0x38cc53=_0x3ca508;}}}const _0x4a8782={'name':_0x38cc53,'isJourneyLocal':_0x3c19a4,'definition':_0x193e95};return _0x2b1fc6[_0x38de4d(0x203)](_0x49f8a3,_0x4a8782),_0x4a8782;}catch(_0x4438d5){return _0x4c1b9a['verbose']&&console[_0x38de4d(0x15a)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x49f8a3+':\x20'+_0x4438d5['message']),{'name':_0x49f8a3,'isJourneyLocal':![]};}},'resolveActivation':async _0x6a3bf6=>{const _0x5f3087=_0xd7d193,_0x1c3126=_0x126044[_0x5f3087(0x199)](_0x6a3bf6);if(_0x1c3126)return _0x1c3126;try{const _0x50989a=await _0x45e3d4[_0x5f3087(0x1f3)][_0x5f3087(0x1b3)](_0x2fb4d7['id'],_0x6a3bf6),_0x12d774=journeyActivationStepToYaml(_0x50989a,_0x4beea1,_0x278361),_0x830751=JSON['stringify']({'name':_0x12d774['name'],'connection':_0x12d774[_0x5f3087(0x17d)],'connector_config':_0x12d774[_0x5f3087(0x227)]}),_0x420fd3=_0x50ecf3[_0x5f3087(0x199)](_0x830751);if(_0x420fd3){const _0x33301e={'name':_0x420fd3,'isJourneyLocal':!![],'definition':_0x12d774};return _0x126044[_0x5f3087(0x203)](_0x6a3bf6,_0x33301e),_0x33301e;}const _0x1a97db=_0x50989a[_0x5f3087(0x20d)][_0x5f3087(0x194)]['name']||_0x6a3bf6,_0x527f21=sanitizeYamlKey(_0x1a97db)||_0x5f3087(0x1dc)+_0x6a3bf6;let _0x394cd0=_0x527f21,_0x2f4c7f=0x2;while(_0x3f8bf6[_0x5f3087(0x1a2)](_0x394cd0)){_0x394cd0=_0x527f21+'_'+_0x2f4c7f,_0x2f4c7f++;}_0x3f8bf6[_0x5f3087(0x230)](_0x394cd0),_0x50ecf3[_0x5f3087(0x203)](_0x830751,_0x394cd0);const _0x6d071c={'name':_0x394cd0,'isJourneyLocal':!![],'definition':_0x12d774};return _0x126044[_0x5f3087(0x203)](_0x6a3bf6,_0x6d071c),_0x6d071c;}catch(_0x8d9233){return _0x4c1b9a[_0x5f3087(0x19e)]&&console[_0x5f3087(0x15a)](_0x5f3087(0x1cf)+_0x6a3bf6+':\x20'+_0x8d9233[_0x5f3087(0x1d1)]),{'name':_0x6a3bf6,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x258751,_0x1bf204)=>{const _0x2df604=_0xd7d193;return resolveJumpTarget(_0x258751,_0x1bf204,_0x1ce9d3,_0x59cdb3=>_0x45e3d4[_0x2df604(0x1f3)][_0x2df604(0x156)](_0x59cdb3));}},_0x3e66a0=await journeyResponseToDef(_0x10a684,_0x2244f1);_0x2890f4[_0xd7d193(0x232)]({'item':_0x2fb4d7,'yaml':_0x3e66a0});}},{'verbose':_0x4c1b9a[_0x3bd2c9(0x19e)]});const _0x2d0928=await _0x45e3d4[_0x3bd2c9(0x1f3)][_0x3bd2c9(0x215)](_0x5e6e27[0x0]['journeyBundleId']),_0x135f2e=buildMergedJourneyDef(_0x2890f4,_0x3349dc,_0x2d0928),_0x316c6c=normalizeJourneyDef(_0x135f2e,_0x4f6272),_0x4545b3=toYamlString(_0x316c6c),_0x3a4ded=_0x3f1d3e||a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x257725,sanitizeFileName(_0x4052c6)+_0x3bd2c9(0x204));!_0x3f1d3e&&_0x3e0136&&!existsSync(_0x257725)&&mkdirSync(_0x257725,{'recursive':!![]});const _0x312379=a28_0x3ba9f6[_0x3bd2c9(0x1f5)](process[_0x3bd2c9(0x1e0)](),_0x3a4ded);if(existsSync(_0x3a4ded)){const _0x212da1=readFileSync(_0x3a4ded,_0x3bd2c9(0x23e)),_0xd9b575=generateDiff(_0x212da1,_0x4545b3),_0x4cad6c=hasChanges(_0xd9b575);_0x241dcb[_0x3bd2c9(0x232)]({'relativePath':_0x312379,'absolutePath':_0x3a4ded,'content':_0x4545b3,'isNew':![],'hasChanges':_0x4cad6c,'diff':_0x4cad6c?formatDiffWithColors(_0xd9b575):undefined});}else _0x241dcb[_0x3bd2c9(0x232)]({'relativePath':_0x312379,'absolutePath':_0x3a4ded,'content':_0x4545b3,'isNew':!![],'hasChanges':![]});}const _0x10b1ca=_0x241dcb[_0x3bd2c9(0x237)](_0x174e58=>_0x174e58[_0x3bd2c9(0x197)]),_0xeaa7c2=_0x241dcb['filter'](_0x3fbce7=>!_0x3fbce7[_0x3bd2c9(0x197)]&&_0x3fbce7[_0x3bd2c9(0x24c)]),_0x5d0201=_0x241dcb['filter'](_0x46e1e5=>!_0x46e1e5[_0x3bd2c9(0x197)]&&!_0x46e1e5[_0x3bd2c9(0x24c)]),_0x598a88=_0x2c7ea5[_0x3bd2c9(0x1b9)],_0x5ef3a4=_0x526a9d['size'],_0x4d53b5=_0x598a88>_0x5ef3a4?'\x20('+_0x598a88+_0x3bd2c9(0x245):'';console['error'](_0x3bd2c9(0x1fb)),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x5ef3a4+'\x20journeys')+a28_0x35ee26['dim'](_0x4d53b5)),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26['green']('+\x20'+_0x10b1ca[_0x3bd2c9(0x1b9)]+'\x20new\x20files')),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26['yellow']('~\x20'+_0xeaa7c2[_0x3bd2c9(0x1b9)]+'\x20changed\x20files')),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26[_0x3bd2c9(0x258)]('=\x20'+_0x5d0201[_0x3bd2c9(0x1b9)]+_0x3bd2c9(0x19f))),console['error'](_0x3bd2c9(0x23f)+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x1d8755)+'\x0a');if(_0xeaa7c2[_0x3bd2c9(0x1b9)]>0x0)for(const _0x16143b of _0xeaa7c2){console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1e1)+_0x16143b['relativePath']+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x3bd2c9(0x15a)](_0x16143b[_0x3bd2c9(0x1d2)]),console[_0x3bd2c9(0x15a)]('─'[_0x3bd2c9(0x21c)](0x3c));}if(_0x41bf22[_0x3bd2c9(0x1b8)])return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x187)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x10b1ca['length']===0x0&&_0xeaa7c2[_0x3bd2c9(0x1b9)]===0x0)return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x169)](_0x3bd2c9(0x234))),saveSessionContext({'parent_segment':_0x2cc5be},_0x41bf22[_0x3bd2c9(0x188)]),console[_0x3bd2c9(0x15a)](a28_0x35ee26['green'](_0x3bd2c9(0x213)+a28_0x35ee26[_0x3bd2c9(0x258)](_0x3bd2c9(0x1c6))+'\x20=\x20'+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x2cc5be))),0x0;if(!_0x41bf22[_0x3bd2c9(0x1ed)]&&(_0x10b1ca[_0x3bd2c9(0x1b9)]>0x0||_0xeaa7c2[_0x3bd2c9(0x1b9)]>0x0)){if(!isInteractive())return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x210)](_0x3bd2c9(0x212)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x258)](_0x3bd2c9(0x167))),0x1;const _0x35a9c1=await confirmKey(_0x3bd2c9(0x181)+(_0x10b1ca[_0x3bd2c9(0x1b9)]+_0xeaa7c2['length'])+_0x3bd2c9(0x1d6));if(!_0x35a9c1)return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x187)](_0x3bd2c9(0x19a)),_0x3bd2c9(0x16a)),0x1;}!existsSync(_0x1d8755)&&mkdirSync(_0x1d8755,{'recursive':!![]});const _0x285b80=a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x1d8755,_0x3bd2c9(0x1f8));writeFileSync(_0x285b80,createTdxConfigContent(_0x2cc5be),_0x3bd2c9(0x23e));for(const _0x564a72 of _0x241dcb){(_0x564a72[_0x3bd2c9(0x197)]||_0x564a72[_0x3bd2c9(0x24c)])&&writeFileSync(_0x564a72[_0x3bd2c9(0x1c1)],_0x564a72[_0x3bd2c9(0x225)],'utf-8');}return console[_0x3bd2c9(0x15a)](a28_0x35ee26['green'](_0x3bd2c9(0x18e)+(_0x10b1ca['length']+_0xeaa7c2['length'])+_0x3bd2c9(0x247)+_0x1d8755)),saveSessionContext({'parent_segment':_0x2cc5be},_0x41bf22['session']),console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x169)]('✔\x20Context\x20set:\x20'+a28_0x35ee26[_0x3bd2c9(0x258)](_0x3bd2c9(0x1c6))+_0x3bd2c9(0x1a5)+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x2cc5be))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:columns';['description']=a28_0x35a506(0x174);async[a28_0x35a506(0x22a)](_0x3cfd6b){const _0x424f31=a28_0x35a506,{options:_0x408df7,args:_0xbb0513,tdx:_0x5b4bce}=_0x3cfd6b,_0x397849=_0xbb0513[0x0];if(!requireNameOrPath(_0x397849))return 0x1;_0x408df7[_0x424f31(0x19e)]&&console[_0x424f31(0x15a)](_0x424f31(0x24a)+_0x397849);const {journeyId:_0x2f9c4d}=await resolveJourneyIdFromInput(_0x397849,_0x408df7,_0x5b4bce),_0x61d48f=await withSpinner('Getting\x20column\x20mapping...',()=>_0x5b4bce['journey'][_0x424f31(0x21e)](_0x2f9c4d),{'verbose':_0x408df7[_0x424f31(0x19e)]}),_0x3bdc9b=_0x61d48f[_0x424f31(0x1ca)];return console[_0x424f31(0x22d)](_0x424f31(0x172)+_0x3bdc9b['database']),console[_0x424f31(0x22d)](_0x424f31(0x23b)+_0x3bdc9b[_0x424f31(0x1c4)]),await handleSDKOutput(_0x3bdc9b['columns'],_0x408df7),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x1f2);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x1c0);async[a28_0x35a506(0x22a)](_0x579893){const _0x4581a1=a28_0x35a506,{options:_0x3f1d39,args:_0x56a9cf,tdx:_0x491499}=_0x579893,_0x54e4cd=_0x56a9cf[0x0];if(!requireNameOrPath(_0x54e4cd))return 0x1;_0x3f1d39[_0x4581a1(0x19e)]&&console['error'](_0x4581a1(0x24a)+_0x54e4cd);const {journeyId:_0x4089ed}=await resolveJourneyIdFromInput(_0x54e4cd,_0x3f1d39,_0x491499),_0x235e1e=await withSpinner(_0x4581a1(0x25c),()=>_0x491499['journey']['listActivationsFlat'](_0x4089ed),{'verbose':_0x3f1d39[_0x4581a1(0x19e)]}),_0x36a21b=_0x235e1e[_0x4581a1(0x1ca)];return console[_0x4581a1(0x15a)]('Found\x20'+_0x36a21b[_0x4581a1(0x1b9)]+_0x4581a1(0x261)+(_0x36a21b[_0x4581a1(0x1b9)]!==0x1?'s':'')),await handleSDKOutput(_0x36a21b,_0x3f1d39),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x190);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x205);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x24e040){const _0x41f1ba=a28_0x35a506,_0x1ba4af=_0x24e040[_0x41f1ba(0x154)][0x0];let _0x190513;if(_0x1ba4af){const _0x3bed3a=await resolveTarget({'arg':_0x1ba4af,'contextParent':_0x24e040[_0x41f1ba(0x19d)][_0x41f1ba(0x25a)],'cwd':process[_0x41f1ba(0x1e0)]()});isSuccessfulResolution(_0x3bed3a)&&_0x3bed3a[_0x41f1ba(0x1d0)]===_0x41f1ba(0x25d)&&(_0x190513=_0x3bed3a['filePath']);}const _0x387fc9={..._0x24e040,'options':{..._0x24e040[_0x41f1ba(0x19d)],'journeysOnly':!![],..._0x190513&&{'singleFilePath':_0x190513}}};return this[_0x41f1ba(0x17b)]['execute'](_0x387fc9);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x1ad);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x1e5);async['execute'](_0x343fb3){const _0x25e3ce=a28_0x35a506,{options:_0x38f912,args:_0x17af6e,tdx:_0x272103}=_0x343fb3,_0x42413a=_0x17af6e[0x0];if(!requireNameOrPath(_0x42413a))return 0x1;if(_0x38f912[_0x25e3ce(0x19e)])console[_0x25e3ce(0x15a)](_0x25e3ce(0x24a)+_0x42413a);const {journeyId:_0x1890d0}=await resolveJourneyIdFromInput(_0x42413a,_0x38f912,_0x272103),_0x16db31=await withSpinner('Listing\x20journey\x20versions...',()=>_0x272103[_0x25e3ce(0x1f3)]['listVersions'](_0x1890d0),{'verbose':_0x38f912[_0x25e3ce(0x19e)]}),{bundleName:_0x551207,versions:_0x147168,latestJourneyId:_0x53558d}=_0x16db31[_0x25e3ce(0x1ca)];console[_0x25e3ce(0x15a)](_0x551207+':\x20'+_0x147168[_0x25e3ce(0x1b9)]+_0x25e3ce(0x1e7)+(_0x147168[_0x25e3ce(0x1b9)]!==0x1?'s':''));const _0x458794=_0x147168['map'](_0x4d5704=>({'version':_0x4d5704[_0x25e3ce(0x173)],'journey_id':_0x4d5704[_0x25e3ce(0x177)],'name':_0x4d5704['name'],'state':_0x4d5704[_0x25e3ce(0x22f)],'paused':_0x4d5704[_0x25e3ce(0x18c)],'latest':_0x4d5704[_0x25e3ce(0x177)]===_0x53558d,'created_at':_0x4d5704['createdAt']}));return await handleSDKOutput(_0x458794,_0x38f912),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x1ef);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a28_0x35a506(0x22a)](_0x4cdbb8){const _0x39209e=a28_0x35a506,{options:_0x436d74,args:_0x2374a0,tdx:_0x123bec}=_0x4cdbb8,_0x220d76=_0x2374a0[0x0];if(!requireNameOrPath(_0x220d76))return 0x1;if(_0x436d74['verbose'])console['error']('Input:\x20'+_0x220d76);const {journeyId:_0x5ea91b,journeyName:_0x897b22}=await resolveJourneyIdFromInput(_0x220d76,_0x436d74,_0x123bec);if(!_0x436d74[_0x39209e(0x1ed)]){const _0x24c7eb=await confirm(_0x39209e(0x157)+_0x897b22+'\x22?');if(!_0x24c7eb)return console[_0x39209e(0x15a)](_0x39209e(0x20c)),0x0;}const _0x368a2d=await withSpinner(_0x39209e(0x1d9),()=>_0x123bec[_0x39209e(0x1f3)]['createVersion'](_0x5ea91b),{'verbose':_0x436d74['verbose']}),_0x1dd375=_0x368a2d[_0x39209e(0x1ca)];return console[_0x39209e(0x15a)](a28_0x35ee26[_0x39209e(0x169)]('✔')+_0x39209e(0x18a)+_0x1dd375['attributes'][_0x39209e(0x173)]+_0x39209e(0x16c)+_0x1dd375[_0x39209e(0x20d)][_0x39209e(0x18f)]+'\x22'),console[_0x39209e(0x15a)](_0x39209e(0x211)+_0x1dd375['id']),await handleSingleObjectOutput({'id':_0x1dd375['id'],'name':_0x1dd375[_0x39209e(0x20d)]['name'],'version':_0x1dd375[_0x39209e(0x20d)][_0x39209e(0x173)],'state':_0x1dd375[_0x39209e(0x20d)][_0x39209e(0x22f)],'bundle_id':_0x1dd375['attributes'][_0x39209e(0x226)],'created_at':_0x1dd375[_0x39209e(0x20d)]['createdAt']},_0x436d74),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x221);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x176);async[a28_0x35a506(0x22a)](_0x1ccd7f){const _0x42868a=a28_0x35a506,{options:_0x16695a,args:_0x187444,tdx:_0x1e0bf7}=_0x1ccd7f,_0x274554=_0x187444[0x0];if(!requireNameOrPath(_0x274554))return 0x1;const _0x3d0183=_0x16695a['version'];if(!_0x3d0183)return console[_0x42868a(0x15a)](_0x42868a(0x18b)),console[_0x42868a(0x15a)](_0x42868a(0x228)),0x1;const _0x1e0283=parseInt(_0x3d0183,0xa);if(isNaN(_0x1e0283)||_0x1e0283<0x1)return console[_0x42868a(0x15a)](_0x42868a(0x21f)+_0x3d0183),0x1;if(_0x16695a['verbose'])console[_0x42868a(0x15a)](_0x42868a(0x24a)+_0x274554+_0x42868a(0x1a0)+_0x1e0283);const {journeyId:_0x29bd77,parentSegmentId:_0x3198f2}=await resolveJourneyIdFromInput(_0x274554,_0x16695a,_0x1e0bf7),_0x508eec=await withSpinner(_0x42868a(0x1c3),()=>_0x1e0bf7['journey'][_0x42868a(0x238)](_0x29bd77),{'verbose':_0x16695a[_0x42868a(0x19e)]}),{versions:_0x38cede,latestJourneyId:_0xb276e1}=_0x508eec[_0x42868a(0x1ca)],_0x53b6d9=_0x38cede[_0x42868a(0x1ff)](_0x675b14=>_0x675b14[_0x42868a(0x173)]===_0x1e0283);if(!_0x53b6d9){const _0x19c59e=_0x38cede[_0x42868a(0x253)](_0x586b1b=>'v'+_0x586b1b['versionNumber'])[_0x42868a(0x1eb)](',\x20');return console[_0x42868a(0x15a)](_0x42868a(0x1f0)+_0x1e0283+_0x42868a(0x256)+_0x19c59e),0x1;}const _0x1814c6=await withSpinner(_0x42868a(0x1bf)+_0x1e0283+'\x20details...',()=>_0x1e0bf7[_0x42868a(0x1f3)]['getJourney'](_0x53b6d9[_0x42868a(0x177)]),{'verbose':_0x16695a[_0x42868a(0x19e)]}),_0x31c203=_0x1814c6[_0x42868a(0x1ca)],_0xff3a6d=getConsoleNextUrl(_0x16695a[_0x42868a(0x216)],_0x42868a(0x195)+_0x3198f2+_0x42868a(0x168)+_0x53b6d9[_0x42868a(0x177)]+_0x42868a(0x161));return await handleSingleObjectOutput({'id':_0x31c203['id'],'name':_0x31c203[_0x42868a(0x20d)]['name'],'version':_0x31c203[_0x42868a(0x20d)]['versionNumber'],'description':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x1a4)],'state':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x22f)],'paused':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x18c)],'reentry_mode':_0x31c203['attributes'][_0x42868a(0x231)],'stages':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x260)]?.['length']||0x0,..._0x31c203[_0x42868a(0x20d)][_0x42868a(0x1ba)]&&{'goal':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x1ba)][_0x42868a(0x18f)]},'latest':_0x53b6d9[_0x42868a(0x177)]===_0xb276e1,'created_at':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x1d5)],'updated_at':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x218)],'url':_0xff3a6d},_0x16695a),0x0;}}
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 +1 @@
1
- const a29_0x22ec99=a29_0x35e1;(function(_0x24b7fd,_0xacd395){const _0x2418c2=a29_0x35e1,_0x5bb9ff=_0x24b7fd();while(!![]){try{const _0x5f25b7=-parseInt(_0x2418c2(0x1da))/0x1+parseInt(_0x2418c2(0x1df))/0x2+parseInt(_0x2418c2(0x1fd))/0x3+-parseInt(_0x2418c2(0x1e9))/0x4*(parseInt(_0x2418c2(0x1e5))/0x5)+parseInt(_0x2418c2(0x20d))/0x6*(-parseInt(_0x2418c2(0x1d6))/0x7)+parseInt(_0x2418c2(0x1ec))/0x8*(-parseInt(_0x2418c2(0x203))/0x9)+-parseInt(_0x2418c2(0x1f1))/0xa*(-parseInt(_0x2418c2(0x202))/0xb);if(_0x5f25b7===_0xacd395)break;else _0x5bb9ff['push'](_0x5bb9ff['shift']());}catch(_0x48f73e){_0x5bb9ff['push'](_0x5bb9ff['shift']());}}}(a29_0x4093,0xe44de));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a29_0x4093(){const _0x33d3b2=['22TYTdsi','5360778AWHEGm','reason','.yml','warnings','relativePath','Error:\x20','skippedCount','\x20warning(s)','filter','type','456yIqUSe','validCount','31339qWtvUn','filePath','targetDir','log','1735906hlxsVP','error','name','file','Validation\x20failed:\x20','2302728mPMiPs','yellow','\x20segment\x20file(s)\x20skipped','execute','journey:validate','helpText','20645nimPmY','endsWith','No\x20journey\x20YAML\x20files\x20found\x20in\x20','invalidCount','1124BeHKFO','verbose','cwd','24beSaIs','green','length','Error:\x20Directory\x20not\x20found:\x20','\x20error(s)','20076730GrdSvR','no_parent','hasErrors','\x20warning(s)\x20found','red','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20valid','parentSegment','\x20(skipped:\x20','Validate\x20journey\x20YAML\x20files','valid','2375271DUvmGi','errors','warningCount','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','dim'];a29_0x4093=function(){return _0x33d3b2;};return a29_0x4093();}import a29_0x38579b from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a29_0x35e1(_0x13343d,_0x21b978){_0x13343d=_0x13343d-0x1d6;const _0x409306=a29_0x4093();let _0x35e131=_0x409306[_0x13343d];return _0x35e131;}export class JourneyValidateCommand extends BaseCommand{[a29_0x22ec99(0x1dc)]=a29_0x22ec99(0x1e3);['description']=a29_0x22ec99(0x1fb);async[a29_0x22ec99(0x1e2)](_0x226528){const _0x1c0a2c=a29_0x22ec99,{options:_0x511b75,args:_0x2d0b3d}=_0x226528,_0x2433ce=_0x511b75,_0x269805=await resolveTarget({'arg':_0x2d0b3d[0x0],'contextParent':_0x511b75[_0x1c0a2c(0x1f9)],'cwd':process[_0x1c0a2c(0x1eb)]()});if(!isSuccessfulResolution(_0x269805))return _0x269805['errorCode']===_0x1c0a2c(0x1f2)?(console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1e0)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1c0a2c(0x1db)](_0x1c0a2c(0x200)),console[_0x1c0a2c(0x1db)]('\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[_0x1c0a2c(0x1db)](_0x1c0a2c(0x1f7))):(console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1f5)](_0x1c0a2c(0x208)+_0x269805['message']+'\x0a')),_0x269805[_0x1c0a2c(0x1e4)]&&console['error'](a29_0x38579b['cyan'](_0x269805[_0x1c0a2c(0x1e4)]))),0x1;const _0x55bd2d=_0x269805[_0x1c0a2c(0x1d8)],_0xe4eeae=_0x269805[_0x1c0a2c(0x20c)]===_0x1c0a2c(0x1dd)?_0x269805[_0x1c0a2c(0x1d7)]:undefined;if(!_0xe4eeae&&!existsSync(_0x55bd2d))return console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1f5)](_0x1c0a2c(0x1ef)+_0x55bd2d+'\x0a')),0x1;let _0x3efab7;if(_0xe4eeae){if(!_0xe4eeae[_0x1c0a2c(0x1e6)](_0x1c0a2c(0x205))&&!_0xe4eeae[_0x1c0a2c(0x1e6)]('.yaml'))return console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1f5)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xe4eeae+'\x0a')),0x1;_0x3efab7=[_0xe4eeae];}else _0x3efab7=findYamlFiles(_0x55bd2d);if(_0x3efab7[_0x1c0a2c(0x1ee)]===0x0)return console[_0x1c0a2c(0x1db)](a29_0x38579b['red'](_0x1c0a2c(0x1f6)+_0x55bd2d+'\x0a')),0x1;const _0xdcdf97=validateYamlFiles(_0x3efab7,_0x55bd2d,{'filterType':'journey'}),_0xeac104=calculateSummary(_0xdcdf97),_0x56f6c0=_0xdcdf97[_0x1c0a2c(0x20b)](isValidationResult);if(_0x56f6c0[_0x1c0a2c(0x1ee)]===0x0)return console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1e0)](_0x1c0a2c(0x1e7)+_0x55bd2d+'\x0a')),_0xeac104[_0x1c0a2c(0x209)]>0x0&&console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x201)]('('+_0xeac104[_0x1c0a2c(0x209)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x1aaa1e of _0xdcdf97){if(!isValidationResult(_0x1aaa1e)){_0x2433ce[_0x1c0a2c(0x1ea)]&&console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x201)]('-\x20'+_0x1aaa1e[_0x1c0a2c(0x207)]+_0x1c0a2c(0x1fa)+_0x1aaa1e[_0x1c0a2c(0x204)]+')'));continue;}const {relativePath:_0xa2bbfa,source:_0x3912fa,result:_0x5912aa}=_0x1aaa1e;if(_0x5912aa['valid']&&_0x5912aa['warnings'][_0x1c0a2c(0x1ee)]===0x0)_0x2433ce[_0x1c0a2c(0x1ea)]&&console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1ed)]('✔\x20'+_0xa2bbfa));else _0x5912aa[_0x1c0a2c(0x1fc)]?(console['log'](a29_0x38579b['yellow']('⚠\x20'+_0xa2bbfa+':\x20'+_0x5912aa[_0x1c0a2c(0x206)][_0x1c0a2c(0x1ee)]+_0x1c0a2c(0x20a))),console['log'](formatValidationResult(_0x5912aa,_0x3912fa,_0xa2bbfa))):(console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1f5)]('✖\x20'+_0xa2bbfa+':\x20'+_0x5912aa[_0x1c0a2c(0x1fe)][_0x1c0a2c(0x1ee)]+_0x1c0a2c(0x1f0))),console[_0x1c0a2c(0x1d9)](formatValidationResult(_0x5912aa,_0x3912fa,_0xa2bbfa)));}return console['log'](''),_0xeac104[_0x1c0a2c(0x1f3)]?(console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1f5)](_0x1c0a2c(0x1de)+_0xeac104[_0x1c0a2c(0x1e8)]+'\x20journey(s)\x20with\x20errors,\x20'+_0xeac104[_0x1c0a2c(0x20e)]+_0x1c0a2c(0x1f8))),_0xeac104[_0x1c0a2c(0x1ff)]>0x0&&console['log'](a29_0x38579b[_0x1c0a2c(0x1e0)](_0xeac104[_0x1c0a2c(0x1ff)]+_0x1c0a2c(0x1f4))),_0xeac104[_0x1c0a2c(0x209)]>0x0&&console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x201)](_0xeac104[_0x1c0a2c(0x209)]+_0x1c0a2c(0x1e1))),0x1):(console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1ed)]('✔\x20All\x20'+_0xeac104['validCount']+'\x20journey(s)\x20valid')),_0xeac104[_0x1c0a2c(0x1ff)]>0x0&&console['log'](a29_0x38579b['yellow'](_0xeac104[_0x1c0a2c(0x1ff)]+_0x1c0a2c(0x1f4))),_0xeac104[_0x1c0a2c(0x209)]>0x0&&console[_0x1c0a2c(0x1d9)](a29_0x38579b['dim'](_0xeac104[_0x1c0a2c(0x209)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}
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);}}