@treasuredata/tdx 2026.7.6 → 2026.8.0

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 (325) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.d.ts.map +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/api-command.js.map +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-command.js.map +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.d.ts.map +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-command.js.map +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.d.ts +8 -0
  24. package/dist/commands/command.d.ts.map +1 -1
  25. package/dist/commands/command.js +1 -1
  26. package/dist/commands/command.js.map +1 -1
  27. package/dist/commands/connection-command.js +1 -1
  28. package/dist/commands/databases.js +1 -1
  29. package/dist/commands/delivery-command.js +1 -1
  30. package/dist/commands/describe.js +1 -1
  31. package/dist/commands/engage-always-on-campaign-pull-command.d.ts +16 -0
  32. package/dist/commands/engage-always-on-campaign-pull-command.d.ts.map +1 -0
  33. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -0
  34. package/dist/commands/engage-always-on-campaign-pull-command.js.map +1 -0
  35. package/dist/commands/engage-always-on-campaign-push-command.d.ts +16 -0
  36. package/dist/commands/engage-always-on-campaign-push-command.d.ts.map +1 -0
  37. package/dist/commands/engage-always-on-campaign-push-command.js +1 -0
  38. package/dist/commands/engage-always-on-campaign-push-command.js.map +1 -0
  39. package/dist/commands/engage-always-on-campaign-validate-command.d.ts +16 -0
  40. package/dist/commands/engage-always-on-campaign-validate-command.d.ts.map +1 -0
  41. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -0
  42. package/dist/commands/engage-always-on-campaign-validate-command.js.map +1 -0
  43. package/dist/commands/engage-campaign-pull-command.js +1 -1
  44. package/dist/commands/engage-campaign-push-command.js +1 -1
  45. package/dist/commands/engage-campaign-validate-command.js +1 -1
  46. package/dist/commands/engage-command.d.ts +1 -1
  47. package/dist/commands/engage-command.js +1 -1
  48. package/dist/commands/engage-template-pull-command.js +1 -1
  49. package/dist/commands/engage-template-push-command.js +1 -1
  50. package/dist/commands/engage-template-validate-command.js +1 -1
  51. package/dist/commands/job-command.js +1 -1
  52. package/dist/commands/journey-command.js +1 -1
  53. package/dist/commands/journey-validate-command.js +1 -1
  54. package/dist/commands/llm-command.js +1 -1
  55. package/dist/commands/mcp-command.js +1 -1
  56. package/dist/commands/parent-segment-command.js +1 -1
  57. package/dist/commands/policy-command.js +1 -1
  58. package/dist/commands/profile-command.js +1 -1
  59. package/dist/commands/profile-command.js.map +1 -1
  60. package/dist/commands/profiles-command.js +1 -1
  61. package/dist/commands/query-command.js +1 -1
  62. package/dist/commands/schedule-command.js +1 -1
  63. package/dist/commands/segment-command.js +1 -1
  64. package/dist/commands/segment-create-command.js +1 -1
  65. package/dist/commands/segment-fields-command.js +1 -1
  66. package/dist/commands/segment-move-command.js +1 -1
  67. package/dist/commands/segment-pull-command.js +1 -1
  68. package/dist/commands/segment-push-command.d.ts.map +1 -1
  69. package/dist/commands/segment-push-command.js +1 -1
  70. package/dist/commands/segment-push-command.js.map +1 -1
  71. package/dist/commands/segment-update-command.js +1 -1
  72. package/dist/commands/segment-use-command.js +1 -1
  73. package/dist/commands/segment-validate-command.js +1 -1
  74. package/dist/commands/segments.js +1 -1
  75. package/dist/commands/show.js +1 -1
  76. package/dist/commands/status-command.d.ts.map +1 -1
  77. package/dist/commands/status-command.js +1 -1
  78. package/dist/commands/status-command.js.map +1 -1
  79. package/dist/commands/table-deleted.js +1 -1
  80. package/dist/commands/tables.js +1 -1
  81. package/dist/commands/unset-command.js +1 -1
  82. package/dist/commands/upgrade-command.js +1 -1
  83. package/dist/commands/use-command.d.ts.map +1 -1
  84. package/dist/commands/use-command.js +1 -1
  85. package/dist/commands/use-command.js.map +1 -1
  86. package/dist/commands/user-command.js +1 -1
  87. package/dist/commands/work-command.js +1 -1
  88. package/dist/commands/workflow-command.js +1 -1
  89. package/dist/core/auth.js +1 -1
  90. package/dist/core/command-output.js +1 -1
  91. package/dist/core/config.js +1 -1
  92. package/dist/core/connection-cache.js +1 -1
  93. package/dist/core/constants.js +1 -1
  94. package/dist/core/credential-cache.js +1 -1
  95. package/dist/core/global-context.d.ts +35 -1
  96. package/dist/core/global-context.d.ts.map +1 -1
  97. package/dist/core/global-context.js +1 -1
  98. package/dist/core/global-context.js.map +1 -1
  99. package/dist/core/keychain.js +1 -1
  100. package/dist/core/oauth-keychain.js +1 -1
  101. package/dist/core/oauth.js +1 -1
  102. package/dist/core/profile.js +1 -1
  103. package/dist/core/project-config.js +1 -1
  104. package/dist/core/session.js +1 -1
  105. package/dist/core/site-mismatch.d.ts +68 -0
  106. package/dist/core/site-mismatch.d.ts.map +1 -0
  107. package/dist/core/site-mismatch.js +1 -0
  108. package/dist/core/site-mismatch.js.map +1 -0
  109. package/dist/core/user-cache.js +1 -1
  110. package/dist/core/version.js +1 -1
  111. package/dist/index.js +1 -1
  112. package/dist/mcp/server.js +1 -1
  113. package/dist/mcp/tools/index.js +1 -1
  114. package/dist/mcp/tools/tdx-run.js +1 -1
  115. package/dist/mcp/tools/tdx-search.js +1 -1
  116. package/dist/mcp/tools/work-create-item.js +1 -1
  117. package/dist/mcp/utils.js +1 -1
  118. package/dist/proxy/claude-usage-tracker.js +1 -1
  119. package/dist/proxy/passthrough-server.js +1 -1
  120. package/dist/proxy/sse-usage-parser.js +1 -1
  121. package/dist/sdk/agent/agent-config.js +1 -1
  122. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  123. package/dist/sdk/agent/agent-yaml.js +1 -1
  124. package/dist/sdk/agent/test/evaluator.js +1 -1
  125. package/dist/sdk/agent/test/executor.js +1 -1
  126. package/dist/sdk/agent/test/index.js +1 -1
  127. package/dist/sdk/agent/test/output.js +1 -1
  128. package/dist/sdk/agent/test/parser.js +1 -1
  129. package/dist/sdk/agent/tool-target-registry.js +1 -1
  130. package/dist/sdk/api.js +1 -1
  131. package/dist/sdk/cas/cas-api-client.js +1 -1
  132. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  133. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  134. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  135. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  136. package/dist/sdk/cas/index.js +1 -1
  137. package/dist/sdk/cas/pull-workflow.js +1 -1
  138. package/dist/sdk/cas/push-workflow.js +1 -1
  139. package/dist/sdk/cas/validate-files.js +1 -1
  140. package/dist/sdk/client/cdp-api-client.js +1 -1
  141. package/dist/sdk/client/delivery-api-client.js +1 -1
  142. package/dist/sdk/client/endpoints.js +1 -1
  143. package/dist/sdk/client/engage-api-client.d.ts +1 -1
  144. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  145. package/dist/sdk/client/engage-api-client.js +1 -1
  146. package/dist/sdk/client/engage-api-client.js.map +1 -1
  147. package/dist/sdk/client/http-client.js +1 -1
  148. package/dist/sdk/client/llm-api-client.js +1 -1
  149. package/dist/sdk/client/oauth-refresh.js +1 -1
  150. package/dist/sdk/client/rate-limiter.js +1 -1
  151. package/dist/sdk/client/td-api-client.js +1 -1
  152. package/dist/sdk/client/trino-api-client.js +1 -1
  153. package/dist/sdk/client/workflow-client.js +1 -1
  154. package/dist/sdk/connection-validator.d.ts +7 -4
  155. package/dist/sdk/connection-validator.d.ts.map +1 -1
  156. package/dist/sdk/connection-validator.js +1 -1
  157. package/dist/sdk/connection-validator.js.map +1 -1
  158. package/dist/sdk/connection.d.ts +15 -0
  159. package/dist/sdk/connection.d.ts.map +1 -1
  160. package/dist/sdk/connection.js +1 -1
  161. package/dist/sdk/connection.js.map +1 -1
  162. package/dist/sdk/delivery.js +1 -1
  163. package/dist/sdk/engage/always-on-campaign-pull.d.ts +66 -0
  164. package/dist/sdk/engage/always-on-campaign-pull.d.ts.map +1 -0
  165. package/dist/sdk/engage/always-on-campaign-pull.js +1 -0
  166. package/dist/sdk/engage/always-on-campaign-pull.js.map +1 -0
  167. package/dist/sdk/engage/always-on-campaign-push.d.ts +93 -0
  168. package/dist/sdk/engage/always-on-campaign-push.d.ts.map +1 -0
  169. package/dist/sdk/engage/always-on-campaign-push.js +1 -0
  170. package/dist/sdk/engage/always-on-campaign-push.js.map +1 -0
  171. package/dist/sdk/engage/always-on-campaign-validator.d.ts +18 -0
  172. package/dist/sdk/engage/always-on-campaign-validator.d.ts.map +1 -0
  173. package/dist/sdk/engage/always-on-campaign-validator.js +1 -0
  174. package/dist/sdk/engage/always-on-campaign-validator.js.map +1 -0
  175. package/dist/sdk/engage/always-on-campaign-yaml.d.ts +62 -0
  176. package/dist/sdk/engage/always-on-campaign-yaml.d.ts.map +1 -0
  177. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -0
  178. package/dist/sdk/engage/always-on-campaign-yaml.js.map +1 -0
  179. package/dist/sdk/engage/campaign-pull.js +1 -1
  180. package/dist/sdk/engage/campaign-push.js +1 -1
  181. package/dist/sdk/engage/campaign-validator.js +1 -1
  182. package/dist/sdk/engage/campaign-yaml.js +1 -1
  183. package/dist/sdk/engage/campaign-yaml.js.map +1 -1
  184. package/dist/sdk/engage/template-pull.js +1 -1
  185. package/dist/sdk/engage/template-push.js +1 -1
  186. package/dist/sdk/engage/template-validator.js +1 -1
  187. package/dist/sdk/engage/template-yaml.js +1 -1
  188. package/dist/sdk/engage/types/always-on-campaign-schema.d.ts +125 -0
  189. package/dist/sdk/engage/types/always-on-campaign-schema.d.ts.map +1 -0
  190. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -0
  191. package/dist/sdk/engage/types/always-on-campaign-schema.js.map +1 -0
  192. package/dist/sdk/engage/types/campaign-def.js +1 -1
  193. package/dist/sdk/engage/types/campaign-schema.d.ts +8 -8
  194. package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
  195. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  196. package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
  197. package/dist/sdk/engage/types/template-schema.js +1 -1
  198. package/dist/sdk/engage.d.ts +20 -0
  199. package/dist/sdk/engage.d.ts.map +1 -1
  200. package/dist/sdk/engage.js +1 -1
  201. package/dist/sdk/engage.js.map +1 -1
  202. package/dist/sdk/errors.d.ts +13 -2
  203. package/dist/sdk/errors.d.ts.map +1 -1
  204. package/dist/sdk/errors.js +1 -1
  205. package/dist/sdk/errors.js.map +1 -1
  206. package/dist/sdk/index.js +1 -1
  207. package/dist/sdk/io/index.js +1 -1
  208. package/dist/sdk/io/node-filesystem.js +1 -1
  209. package/dist/sdk/job.js +1 -1
  210. package/dist/sdk/journey.js +1 -1
  211. package/dist/sdk/llm/chat-cache.js +1 -1
  212. package/dist/sdk/llm/index.js +1 -1
  213. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  214. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  215. package/dist/sdk/llm/model-factors.js +1 -1
  216. package/dist/sdk/llm/model-factors.js.map +1 -1
  217. package/dist/sdk/llm/user-settings.js +1 -1
  218. package/dist/sdk/personalization.js +1 -1
  219. package/dist/sdk/policy.js +1 -1
  220. package/dist/sdk/query/deleted-table-validation.js +1 -1
  221. package/dist/sdk/query/index.js +1 -1
  222. package/dist/sdk/query/sql-parser.js +1 -1
  223. package/dist/sdk/realtime.js +1 -1
  224. package/dist/sdk/schedule.js +1 -1
  225. package/dist/sdk/segment/child-segment-yaml.d.ts +12 -2
  226. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  227. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  228. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  229. package/dist/sdk/segment/fields-display.js +1 -1
  230. package/dist/sdk/segment/file-discovery.js +1 -1
  231. package/dist/sdk/segment/journey-utils.js +1 -1
  232. package/dist/sdk/segment/journey-validator.js +1 -1
  233. package/dist/sdk/segment/journey-yaml.js +1 -1
  234. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  235. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  236. package/dist/sdk/segment/pull-workflow.js +1 -1
  237. package/dist/sdk/segment/push-recovery.js +1 -1
  238. package/dist/sdk/segment/push-workflow.js +1 -1
  239. package/dist/sdk/segment/resolution-context.js +1 -1
  240. package/dist/sdk/segment/segment-path-parser.js +1 -1
  241. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  242. package/dist/sdk/segment/segment-validator.js +1 -1
  243. package/dist/sdk/segment/target-resolution.js +1 -1
  244. package/dist/sdk/segment/tdx-config.js +1 -1
  245. package/dist/sdk/segment/types/activation-schema.js +1 -1
  246. package/dist/sdk/segment/types/journey-def.js +1 -1
  247. package/dist/sdk/segment/types/journey-schema.js +1 -1
  248. package/dist/sdk/segment/types/segment-def.js +1 -1
  249. package/dist/sdk/segment/types/segment-schema.js +1 -1
  250. package/dist/sdk/segment/validate-files.d.ts +6 -1
  251. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  252. package/dist/sdk/segment/validate-files.js +1 -1
  253. package/dist/sdk/segment/validate-files.js.map +1 -1
  254. package/dist/sdk/segment/yaml-validator.js +1 -1
  255. package/dist/sdk/segment.js +1 -1
  256. package/dist/sdk/types/engage.d.ts +31 -5
  257. package/dist/sdk/types/engage.d.ts.map +1 -1
  258. package/dist/sdk/types/index.d.ts +1 -1
  259. package/dist/sdk/types/index.d.ts.map +1 -1
  260. package/dist/sdk/types/index.js +1 -1
  261. package/dist/sdk/types/progress.js +1 -1
  262. package/dist/sdk/types/workspace.js +1 -1
  263. package/dist/sdk/user.js +1 -1
  264. package/dist/sdk/util/format-detector.js +1 -1
  265. package/dist/sdk/util/formatters.js +1 -1
  266. package/dist/sdk/util/index.js +1 -1
  267. package/dist/sdk/util/paginate.js +1 -1
  268. package/dist/sdk/util/tree-formatter.js +1 -1
  269. package/dist/sdk/util/tree-search.js +1 -1
  270. package/dist/sdk/workflow/archive-validation.js +1 -1
  271. package/dist/sdk/workflow/clone-workflow.js +1 -1
  272. package/dist/sdk/workflow/index.js +1 -1
  273. package/dist/sdk/workflow/pull-workflow.js +1 -1
  274. package/dist/sdk/workflow/push-workflow.js +1 -1
  275. package/dist/sdk/workflow/task-graph.js +1 -1
  276. package/dist/sdk/workflow/tdx-config.js +1 -1
  277. package/dist/sdk/workflow/workflow-utils.js +1 -1
  278. package/dist/sdk/workspace/access-tracker.js +1 -1
  279. package/dist/sdk/workspace/frontmatter.js +1 -1
  280. package/dist/sdk/workspace/git.js +1 -1
  281. package/dist/sdk/workspace/index.js +1 -1
  282. package/dist/sdk/workspace/templates.js +1 -1
  283. package/dist/sdk/workspace/weekly.js +1 -1
  284. package/dist/sdk/workspace/wikilinks.js +1 -1
  285. package/dist/test-utils/command-runner.js +1 -1
  286. package/dist/test-utils/factories.d.ts +6 -0
  287. package/dist/test-utils/factories.d.ts.map +1 -1
  288. package/dist/test-utils/factories.js +1 -1
  289. package/dist/test-utils/factories.js.map +1 -1
  290. package/dist/test-utils/fixtures.js +1 -1
  291. package/dist/test-utils/http-mock.js +1 -1
  292. package/dist/test-utils/index.d.ts +1 -1
  293. package/dist/test-utils/index.d.ts.map +1 -1
  294. package/dist/test-utils/index.js +1 -1
  295. package/dist/test-utils/index.js.map +1 -1
  296. package/dist/utils/async.js +1 -1
  297. package/dist/utils/claude-code-state.js +1 -1
  298. package/dist/utils/colors.js +1 -1
  299. package/dist/utils/diff.js +1 -1
  300. package/dist/utils/file-permissions.js +1 -1
  301. package/dist/utils/file-reader.js +1 -1
  302. package/dist/utils/github-releases.js +1 -1
  303. package/dist/utils/global-cache.js +1 -1
  304. package/dist/utils/json-loader.js +1 -1
  305. package/dist/utils/local-cache.js +1 -1
  306. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  307. package/dist/utils/logger/formatters/index.js +1 -1
  308. package/dist/utils/logger/handlers/console-handler.js +1 -1
  309. package/dist/utils/logger/handlers/file-handler.js +1 -1
  310. package/dist/utils/logger/handlers/index.js +1 -1
  311. package/dist/utils/logger/handlers/null-handler.js +1 -1
  312. package/dist/utils/logger/index.js +1 -1
  313. package/dist/utils/logger/logger.js +1 -1
  314. package/dist/utils/logger/types.js +1 -1
  315. package/dist/utils/option-validation.js +1 -1
  316. package/dist/utils/process.js +1 -1
  317. package/dist/utils/prompt.js +1 -1
  318. package/dist/utils/proxy-fetch.js +1 -1
  319. package/dist/utils/spinner.js +1 -1
  320. package/dist/utils/sse-parser.js +1 -1
  321. package/dist/utils/string-utils.js +1 -1
  322. package/dist/utils/table-ref-parser.js +1 -1
  323. package/dist/utils/tdx-logger.js +1 -1
  324. package/dist/utils/version-check.js +1 -1
  325. package/package.json +1 -1
@@ -1 +1 @@
1
- const a23_0xd15462=a23_0x35e9;(function(_0x24cb26,_0x255b66){const _0x329e98=a23_0x35e9,_0x1cd938=_0x24cb26();while(!![]){try{const _0x1aba38=parseInt(_0x329e98(0xbf))/0x1*(-parseInt(_0x329e98(0xb6))/0x2)+parseInt(_0x329e98(0xd8))/0x3*(parseInt(_0x329e98(0xad))/0x4)+parseInt(_0x329e98(0xbc))/0x5*(-parseInt(_0x329e98(0xb0))/0x6)+-parseInt(_0x329e98(0xdf))/0x7+-parseInt(_0x329e98(0xb1))/0x8*(parseInt(_0x329e98(0xbb))/0x9)+-parseInt(_0x329e98(0xdc))/0xa*(-parseInt(_0x329e98(0xd9))/0xb)+parseInt(_0x329e98(0xd4))/0xc;if(_0x1aba38===_0x255b66)break;else _0x1cd938['push'](_0x1cd938['shift']());}catch(_0x20d256){_0x1cd938['push'](_0x1cd938['shift']());}}}(a23_0x1c0c,0x78a68));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a23_0x35e9(_0x313f1e,_0x38b79d){_0x313f1e=_0x313f1e-0xaa;const _0x1c0c60=a23_0x1c0c();let _0x35e9d9=_0x1c0c60[_0x313f1e];return _0x35e9d9;}function a23_0x1c0c(){const _0x492602=['session','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','counts','cyan','\x20new\x20files','\x0aError:','utf-8','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','Workspace\x20is\x20required.','verbose','Pull\x20templates\x20to\x20YAML\x20files','Write\x20','engage_workspace','workspaceName','528lKydlY','\x20changed\x20files','yellow','2033838WhNgmK','9672AJMFMf','yes','data','\x20unchanged\x20files','content','569542zMyAcz','execute','dim','\x20=\x20','absolutePath','1566DNNgVc','5CAXJkD','red','engage','1KVftiK','hasChanges','isNew','name','workspace','✔\x20Context\x20set:\x20','Pulling\x20templates\x20from\x20\x27','\x20files?','relativePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','repeat','diff','-\x20no\x20files\x20written','length','No\x20templates\x20found\x20in\x20workspace\x20\x27','green','cwd','\x20\x20Target:\x20','templates','\x0aChanges\x20to\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','11915640nHUrRp','✔\x20Pulled\x20','config','description','6783yvnGee','22VrSFJx','\x20files\x20to\x20','error','3855090Grodig','filter','files','5139022iQZgLr','dirname','targetDir'];a23_0x1c0c=function(){return _0x492602;};return a23_0x1c0c();}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a23_0x5b63d0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x30149f from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{['name']='engage:template:pull';[a23_0xd15462(0xd7)]=a23_0xd15462(0xed);async[a23_0xd15462(0xb7)](_0x2e6a51){const _0x309c26=a23_0xd15462,{options:_0x58a248,args:_0x29cc68,tdx:_0x3c8b7c}=_0x2e6a51,_0x3769ae=_0x58a248,_0x235408=await resolveWorkspaceName(_0x29cc68[0x0],_0x3769ae);if(!_0x235408)return console['error'](a23_0x5b63d0[_0x309c26(0xaf)](_0x309c26(0xeb))),console[_0x309c26(0xdb)](_0x309c26(0xe9)),console[_0x309c26(0xdb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>'),console[_0x309c26(0xdb)](_0x309c26(0xea)),0x1;const _0x367c87=await withProgressSpinner(_0x309c26(0xc5)+_0x235408+'\x27...',_0x374751=>pullTemplates({'engage':_0x3c8b7c[_0x309c26(0xbe)]},_0x235408,{'templateName':_0x3769ae[_0x309c26(0xc2)],'progress':{'update':_0x198dd0=>{_0x374751['setPhase'](_0x198dd0);}}}),{'verbose':_0x3769ae[_0x309c26(0xec)]}),_0x56ed30=_0x367c87[_0x309c26(0xb3)];if(_0x56ed30['counts'][_0x309c26(0xd1)]===0x0)return console[_0x309c26(0xdb)](a23_0x5b63d0[_0x309c26(0xaf)](_0x309c26(0xcd)+_0x56ed30[_0x309c26(0xac)]+'\x27')),0x0;const _0x1ec239=_0x56ed30[_0x309c26(0xde)]['filter'](_0x4b926c=>_0x4b926c[_0x309c26(0xc1)]),_0x57db49=_0x56ed30[_0x309c26(0xde)][_0x309c26(0xdd)](_0x33b885=>!_0x33b885[_0x309c26(0xc1)]&&_0x33b885[_0x309c26(0xc0)]),_0x313028=_0x56ed30['files'][_0x309c26(0xdd)](_0x41b5df=>!_0x41b5df['isNew']&&!_0x41b5df[_0x309c26(0xc0)]);console[_0x309c26(0xdb)]('\x0aPull\x20summary\x20for\x20workspace\x20\x27'+_0x56ed30['workspaceName']+'\x27:'),console[_0x309c26(0xdb)]('\x20\x20'+a23_0x5b63d0[_0x309c26(0xe5)](_0x56ed30[_0x309c26(0xe4)]['templates']+'\x20templates')),console[_0x309c26(0xdb)]('\x20\x20'+a23_0x5b63d0[_0x309c26(0xce)]('+\x20'+_0x1ec239[_0x309c26(0xcc)]+_0x309c26(0xe6))),console[_0x309c26(0xdb)]('\x20\x20'+a23_0x5b63d0['yellow']('~\x20'+_0x57db49[_0x309c26(0xcc)]+_0x309c26(0xae))),console[_0x309c26(0xdb)]('\x20\x20'+a23_0x5b63d0[_0x309c26(0xb8)]('=\x20'+_0x313028[_0x309c26(0xcc)]+_0x309c26(0xb4))),console[_0x309c26(0xdb)](_0x309c26(0xd0)+a23_0x5b63d0['cyan'](_0x56ed30[_0x309c26(0xe1)])+'\x0a');if(_0x57db49[_0x309c26(0xcc)]>0x0)for(const _0x38ef6a of _0x57db49){console['error'](_0x309c26(0xd2)+_0x38ef6a[_0x309c26(0xc7)]+'\x27:'),console[_0x309c26(0xdb)]('\u2500'[_0x309c26(0xc9)](0x3c)),console[_0x309c26(0xdb)](_0x38ef6a[_0x309c26(0xca)]),console[_0x309c26(0xdb)]('\u2500'[_0x309c26(0xc9)](0x3c));}if(_0x3769ae['dryRun'])return console[_0x309c26(0xdb)](a23_0x5b63d0[_0x309c26(0xaf)](_0x309c26(0xc8))),0x0;if(_0x1ec239[_0x309c26(0xcc)]===0x0&&_0x57db49[_0x309c26(0xcc)]===0x0)return console[_0x309c26(0xdb)](a23_0x5b63d0[_0x309c26(0xce)]('\u2714\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'engage_workspace':_0x56ed30['workspaceName']},_0x3769ae[_0x309c26(0xe2)]),0x0;if(!_0x3769ae[_0x309c26(0xb2)]){if(!isInteractive())return console[_0x309c26(0xdb)](a23_0x5b63d0[_0x309c26(0xbd)](_0x309c26(0xe7)),_0x309c26(0xd3)),console['error'](a23_0x5b63d0[_0x309c26(0xb8)](_0x309c26(0xe3))),0x1;const _0x22127f=await confirmKey(_0x309c26(0xaa)+(_0x1ec239['length']+_0x57db49[_0x309c26(0xcc)])+_0x309c26(0xc6));if(!_0x22127f)return console[_0x309c26(0xdb)](a23_0x5b63d0[_0x309c26(0xaf)]('Aborted.'),_0x309c26(0xcb)),0x1;}for(const _0x11a13f of _0x56ed30[_0x309c26(0xde)]){if(_0x11a13f[_0x309c26(0xc1)]||_0x11a13f[_0x309c26(0xc0)]){const _0x159e76=a23_0x30149f[_0x309c26(0xe0)](_0x11a13f[_0x309c26(0xba)]);!existsSync(_0x159e76)&&mkdirSync(_0x159e76,{'recursive':!![]}),writeFileSync(_0x11a13f[_0x309c26(0xba)],_0x11a13f[_0x309c26(0xb5)],_0x309c26(0xe8));}}return console[_0x309c26(0xdb)](a23_0x5b63d0[_0x309c26(0xce)](_0x309c26(0xd5)+(_0x1ec239[_0x309c26(0xcc)]+_0x57db49[_0x309c26(0xcc)])+_0x309c26(0xda)+_0x56ed30[_0x309c26(0xe1)])),saveSessionContext({'engage_workspace':_0x56ed30[_0x309c26(0xac)]},_0x3769ae[_0x309c26(0xe2)]),console['error'](a23_0x5b63d0[_0x309c26(0xce)](_0x309c26(0xc4)+a23_0x5b63d0[_0x309c26(0xb8)]('engage_workspace')+_0x309c26(0xb9)+a23_0x5b63d0[_0x309c26(0xe5)](_0x56ed30['workspaceName']))),0x0;}}async function resolveWorkspaceName(_0x4efb73,_0x41172b){const _0x3cb017=a23_0xd15462;if(_0x4efb73)return _0x4efb73;if(_0x41172b[_0x3cb017(0xc3)])return _0x41172b[_0x3cb017(0xc3)];const _0x5be6c2=tryFindTdxConfig(process[_0x3cb017(0xcf)]());if(_0x5be6c2?.[_0x3cb017(0xd6)][_0x3cb017(0xab)])return _0x5be6c2[_0x3cb017(0xd6)][_0x3cb017(0xab)];const _0x27132f=loadSessionContext(_0x41172b[_0x3cb017(0xe2)]);if(_0x27132f?.['engage_workspace'])return _0x27132f[_0x3cb017(0xab)];return undefined;}
1
+ function a26_0x7f9b(_0x5424e8,_0x499b93){_0x5424e8=_0x5424e8-0x1a1;const _0x3099d1=a26_0x3099();let _0x7f9b03=_0x3099d1[_0x5424e8];return _0x7f9b03;}function a26_0x3099(){const _0x2d8eea=['3711953JLbDry','relativePath','workspaceName','Aborted.','error','absolutePath','targetDir','engage:template:pull','\x20new\x20files','\x20files\x20to\x20','templates','content','length','setPhase','execute','Pulling\x20templates\x20from\x20\x27','engage_workspace','name','561963XwNuDx','✔\x20Pulled\x20','yellow','\x20=\x20','description','1249710sJhPub','1303592dsvEXD','\x0aPull\x20summary\x20for\x20workspace\x20\x27','cyan','hasChanges','yes','data','dirname','\x20unchanged\x20files','148518aOEsBD','Workspace\x20is\x20required.','3486060nudEuE','config','counts','repeat','filter','session','isNew','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','engage','red','\x0aError:','utf-8','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','\x27...','Pull\x20templates\x20to\x20YAML\x20files','workspace','✔\x20All\x20files\x20are\x20up\x20to\x20date','dim','No\x20templates\x20found\x20in\x20workspace\x20\x27','\x0aChanges\x20to\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','green','Write\x20','\x20templates','files','364480AIFUjz','\x20\x20Target:\x20'];a26_0x3099=function(){return _0x2d8eea;};return a26_0x3099();}const a26_0x5e7e0c=a26_0x7f9b;(function(_0xf8c659,_0x141a5a){const _0x3075b0=a26_0x7f9b,_0x47988e=_0xf8c659();while(!![]){try{const _0x36a2b9=-parseInt(_0x3075b0(0x1d9))/0x1+parseInt(_0x3075b0(0x1de))/0x2+-parseInt(_0x3075b0(0x1a8))/0x3+parseInt(_0x3075b0(0x1df))/0x4+-parseInt(_0x3075b0(0x1c5))/0x5+parseInt(_0x3075b0(0x1aa))/0x6+-parseInt(_0x3075b0(0x1c7))/0x7;if(_0x36a2b9===_0x141a5a)break;else _0x47988e['push'](_0x47988e['shift']());}catch(_0x287a0b){_0x47988e['push'](_0x47988e['shift']());}}}(a26_0x3099,0x4d6bf));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a26_0x8cdf9 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a26_0x289bfe from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{['name']=a26_0x5e7e0c(0x1ce);[a26_0x5e7e0c(0x1dd)]=a26_0x5e7e0c(0x1ba);async[a26_0x5e7e0c(0x1d5)](_0x59f07d){const _0x14aa06=a26_0x5e7e0c,{options:_0x24dd5e,args:_0x492ad0,tdx:_0x4b6e35}=_0x59f07d,_0x123582=_0x24dd5e,_0x4e1bc4=await resolveWorkspaceName(_0x492ad0[0x0],_0x123582);if(!_0x4e1bc4)return console[_0x14aa06(0x1cb)](a26_0x8cdf9['yellow'](_0x14aa06(0x1a9))),console[_0x14aa06(0x1cb)](_0x14aa06(0x1b1)),console[_0x14aa06(0x1cb)](_0x14aa06(0x1b8)),console[_0x14aa06(0x1cb)](_0x14aa06(0x1b2)),0x1;const _0x4d4d3b=await withProgressSpinner(_0x14aa06(0x1d6)+_0x4e1bc4+_0x14aa06(0x1b9),_0x160f76=>pullTemplates({'engage':_0x4b6e35[_0x14aa06(0x1b3)]},_0x4e1bc4,{'templateName':_0x123582[_0x14aa06(0x1d8)],'progress':{'update':_0x476b2a=>{const _0x2194ce=_0x14aa06;_0x160f76[_0x2194ce(0x1d4)](_0x476b2a);}}}),{'verbose':_0x123582['verbose']}),_0x5ed678=_0x4d4d3b[_0x14aa06(0x1a5)];if(_0x5ed678[_0x14aa06(0x1ac)][_0x14aa06(0x1d1)]===0x0)return console[_0x14aa06(0x1cb)](a26_0x8cdf9[_0x14aa06(0x1db)](_0x14aa06(0x1be)+_0x5ed678[_0x14aa06(0x1c9)]+'\x27')),0x0;const _0xe02336=_0x5ed678['files'][_0x14aa06(0x1ae)](_0x3c22fd=>_0x3c22fd['isNew']),_0x2366ad=_0x5ed678[_0x14aa06(0x1c4)]['filter'](_0x25f348=>!_0x25f348[_0x14aa06(0x1b0)]&&_0x25f348[_0x14aa06(0x1a3)]),_0x4607eb=_0x5ed678['files'][_0x14aa06(0x1ae)](_0x2618fb=>!_0x2618fb[_0x14aa06(0x1b0)]&&!_0x2618fb[_0x14aa06(0x1a3)]);console[_0x14aa06(0x1cb)](_0x14aa06(0x1a1)+_0x5ed678[_0x14aa06(0x1c9)]+'\x27:'),console[_0x14aa06(0x1cb)]('\x20\x20'+a26_0x8cdf9['cyan'](_0x5ed678[_0x14aa06(0x1ac)]['templates']+_0x14aa06(0x1c3))),console['error']('\x20\x20'+a26_0x8cdf9['green']('+\x20'+_0xe02336['length']+_0x14aa06(0x1cf))),console[_0x14aa06(0x1cb)]('\x20\x20'+a26_0x8cdf9[_0x14aa06(0x1db)]('~\x20'+_0x2366ad[_0x14aa06(0x1d3)]+'\x20changed\x20files')),console[_0x14aa06(0x1cb)]('\x20\x20'+a26_0x8cdf9[_0x14aa06(0x1bd)]('=\x20'+_0x4607eb[_0x14aa06(0x1d3)]+_0x14aa06(0x1a7))),console[_0x14aa06(0x1cb)](_0x14aa06(0x1c6)+a26_0x8cdf9[_0x14aa06(0x1a2)](_0x5ed678[_0x14aa06(0x1cd)])+'\x0a');if(_0x2366ad[_0x14aa06(0x1d3)]>0x0)for(const _0x264661 of _0x2366ad){console['error'](_0x14aa06(0x1bf)+_0x264661[_0x14aa06(0x1c8)]+'\x27:'),console[_0x14aa06(0x1cb)]('\u2500'[_0x14aa06(0x1ad)](0x3c)),console[_0x14aa06(0x1cb)](_0x264661['diff']),console[_0x14aa06(0x1cb)]('\u2500'[_0x14aa06(0x1ad)](0x3c));}if(_0x123582['dryRun'])return console[_0x14aa06(0x1cb)](a26_0x8cdf9[_0x14aa06(0x1db)](_0x14aa06(0x1c0))),0x0;if(_0xe02336[_0x14aa06(0x1d3)]===0x0&&_0x2366ad[_0x14aa06(0x1d3)]===0x0)return console[_0x14aa06(0x1cb)](a26_0x8cdf9[_0x14aa06(0x1c1)](_0x14aa06(0x1bc))),saveSessionContext({'engage_workspace':_0x5ed678[_0x14aa06(0x1c9)]},_0x123582[_0x14aa06(0x1af)]),0x0;if(!_0x123582[_0x14aa06(0x1a4)]){if(!isInteractive())return console['error'](a26_0x8cdf9[_0x14aa06(0x1b4)](_0x14aa06(0x1b5)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a26_0x8cdf9[_0x14aa06(0x1bd)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x128ae8=await confirmKey(_0x14aa06(0x1c2)+(_0xe02336[_0x14aa06(0x1d3)]+_0x2366ad[_0x14aa06(0x1d3)])+'\x20files?');if(!_0x128ae8)return console[_0x14aa06(0x1cb)](a26_0x8cdf9['yellow'](_0x14aa06(0x1ca)),'-\x20no\x20files\x20written'),0x1;}for(const _0x255d13 of _0x5ed678[_0x14aa06(0x1c4)]){if(_0x255d13[_0x14aa06(0x1b0)]||_0x255d13[_0x14aa06(0x1a3)]){const _0x2942a8=a26_0x289bfe[_0x14aa06(0x1a6)](_0x255d13[_0x14aa06(0x1cc)]);!existsSync(_0x2942a8)&&mkdirSync(_0x2942a8,{'recursive':!![]}),writeFileSync(_0x255d13[_0x14aa06(0x1cc)],_0x255d13[_0x14aa06(0x1d2)],_0x14aa06(0x1b6));}}return console['error'](a26_0x8cdf9[_0x14aa06(0x1c1)](_0x14aa06(0x1da)+(_0xe02336[_0x14aa06(0x1d3)]+_0x2366ad['length'])+_0x14aa06(0x1d0)+_0x5ed678[_0x14aa06(0x1cd)])),saveSessionContext({'engage_workspace':_0x5ed678['workspaceName']},_0x123582[_0x14aa06(0x1af)]),console['error'](a26_0x8cdf9[_0x14aa06(0x1c1)]('✔\x20Context\x20set:\x20'+a26_0x8cdf9['dim'](_0x14aa06(0x1d7))+_0x14aa06(0x1dc)+a26_0x8cdf9[_0x14aa06(0x1a2)](_0x5ed678[_0x14aa06(0x1c9)]))),0x0;}}async function resolveWorkspaceName(_0x34fdac,_0x4d69bd){const _0x5bb72c=a26_0x5e7e0c;if(_0x34fdac)return _0x34fdac;if(_0x4d69bd[_0x5bb72c(0x1bb)])return _0x4d69bd[_0x5bb72c(0x1bb)];const _0xfb7ac9=tryFindTdxConfig(process[_0x5bb72c(0x1b7)]());if(_0xfb7ac9?.['config'][_0x5bb72c(0x1d7)])return _0xfb7ac9[_0x5bb72c(0x1ab)]['engage_workspace'];const _0x120281=loadSessionContext(_0x4d69bd[_0x5bb72c(0x1af)]);if(_0x120281?.[_0x5bb72c(0x1d7)])return _0x120281[_0x5bb72c(0x1d7)];return undefined;}
@@ -1 +1 @@
1
- const a24_0x3aa2cf=a24_0x3fc4;(function(_0x158bc8,_0x23a2d3){const _0x246e41=a24_0x3fc4,_0x296348=_0x158bc8();while(!![]){try{const _0x448dbe=parseInt(_0x246e41(0x20d))/0x1+-parseInt(_0x246e41(0x203))/0x2+parseInt(_0x246e41(0x21b))/0x3*(-parseInt(_0x246e41(0x213))/0x4)+-parseInt(_0x246e41(0x20b))/0x5+parseInt(_0x246e41(0x20c))/0x6*(-parseInt(_0x246e41(0x202))/0x7)+-parseInt(_0x246e41(0x1f7))/0x8+-parseInt(_0x246e41(0x20a))/0x9*(-parseInt(_0x246e41(0x205))/0xa);if(_0x448dbe===_0x23a2d3)break;else _0x296348['push'](_0x296348['shift']());}catch(_0x1d2352){_0x296348['push'](_0x296348['shift']());}}}(a24_0x28e6,0x6ced3));import{BaseCommand}from'./command.js';function a24_0x3fc4(_0x12c48c,_0x556015){_0x12c48c=_0x12c48c-0x1e6;const _0x28e66e=a24_0x28e6();let _0x3fc426=_0x28e66e[_0x12c48c];return _0x3fc426;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a24_0x28e6(){const _0x3cf864=['448556qPXkrU','filter','valid','red','\x20new\x20templates:','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','dryRun','name','3DQBIts','session','\x20templates','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','verbose','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','error','setPhase','created','Preparing\x20push\x20to\x20workspace\x20\x27','cwd','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','green','engage_workspace','\x20\x20\x20\x20','errors','dim','cyan','\x0aError:','\x0aValidation\x20errors\x20in\x20','results','config','\x20errors:','Push\x20','path','message','def','resolveWorkspaceId','yellow','✔\x20Updated\x20','dirname','action','resolve','2403968nlDrWo','Resolving\x20references...','warnings','Aborted.','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','engage','Workspace\x20is\x20required.','\x20templates?','\x20templates\x20to\x20update:','updated','No\x20template\x20YAML\x20files\x20found\x20in\x20','3108YRSffc','735676GCyILV','execute','4663210wfsuZS','\x0aPush\x20summary\x20for\x20workspace\x20\x27','configDir','workspace','data','27rWLzEn','1259255SnFlBX','3624YNjciM','347700GnRxAz','✔\x20All\x20templates\x20are\x20up\x20to\x20date','site','relativePath','Pushing\x20templates...','update'];a24_0x28e6=function(){return _0x3cf864;};return a24_0x28e6();}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x653739 from'chalk';import a24_0x376ed8 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{['name']='engage:template:push';['description']=a24_0x3aa2cf(0x226);async[a24_0x3aa2cf(0x204)](_0x31d0e4){const _0x5f0de7=a24_0x3aa2cf,{options:_0x78723e,args:_0x3f1c62,tdx:_0x2b8dde}=_0x31d0e4,_0x1ed584=_0x78723e,_0x3bd3df=_0x3f1c62[0x0],_0x4f2180=_0x3bd3df?a24_0x376ed8[_0x5f0de7(0x1f6)](_0x3bd3df):undefined,_0x5a5928=_0x4f2180?isYamlFile(_0x4f2180):![];let _0x2a3444;if(_0x5a5928&&_0x4f2180)_0x2a3444=a24_0x376ed8['dirname'](_0x4f2180);else _0x4f2180?_0x2a3444=_0x4f2180:_0x2a3444=process[_0x5f0de7(0x225)]();let _0x41392f;const _0x20577a=tryFindTdxConfig(_0x2a3444);_0x20577a?.[_0x5f0de7(0x1eb)][_0x5f0de7(0x22b)]&&(_0x41392f=_0x20577a['config'][_0x5f0de7(0x22b)],!_0x5a5928&&(_0x2a3444=_0x20577a[_0x5f0de7(0x207)]));_0x1ed584[_0x5f0de7(0x208)]&&(_0x41392f=_0x1ed584[_0x5f0de7(0x208)]);if(!_0x41392f){const _0x3662c1=loadSessionContext(_0x1ed584['session']);_0x3662c1?.[_0x5f0de7(0x22b)]&&(_0x41392f=_0x3662c1[_0x5f0de7(0x22b)]);}if(!_0x41392f)return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x1f2)](_0x5f0de7(0x1fd))),console[_0x5f0de7(0x221)]('\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file'),console[_0x5f0de7(0x221)](_0x5f0de7(0x218)),console['error'](_0x5f0de7(0x1fb)),console[_0x5f0de7(0x221)](_0x5f0de7(0x229)),0x1;let _0x3b0d6d;_0x5a5928&&_0x4f2180?_0x3b0d6d=[parseTemplateFile(_0x4f2180,a24_0x376ed8[_0x5f0de7(0x1f4)](_0x4f2180))]:_0x3b0d6d=discoverAndParseTemplateFiles(_0x2a3444);if(_0x3b0d6d['length']===0x0)return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x1f2)](_0x5f0de7(0x201)+_0x2a3444)),console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x1e6)](_0x5f0de7(0x21e))),0x1;const _0x47d026=_0x3b0d6d[_0x5f0de7(0x228)]===0x1?'1\x20template\x20file:\x20'+_0x3b0d6d[0x0][_0x5f0de7(0x1f0)][_0x5f0de7(0x21a)]:_0x3b0d6d[_0x5f0de7(0x228)]+'\x20template\x20files';console[_0x5f0de7(0x221)]('Found\x20'+a24_0x653739[_0x5f0de7(0x1e7)](_0x47d026));let _0x315044=![];for(const _0x15e174 of _0x3b0d6d){const _0x5c6b50=validateTemplateDef(_0x15e174[_0x5f0de7(0x1f0)]);if(!_0x5c6b50[_0x5f0de7(0x215)]){_0x315044=!![],console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x216)](_0x5f0de7(0x1e9)+_0x15e174[_0x5f0de7(0x210)]+':'));for(const _0x43e60b of _0x5c6b50[_0x5f0de7(0x22d)]){console['error']('\x20\x20'+a24_0x653739[_0x5f0de7(0x216)]('✗')+'\x20'+_0x43e60b[_0x5f0de7(0x1ee)]+':\x20'+_0x43e60b['message']);}}for(const _0xd500ce of _0x5c6b50[_0x5f0de7(0x1f9)]){console[_0x5f0de7(0x221)]('\x20\x20'+a24_0x653739['yellow']('⚠')+'\x20'+_0xd500ce[_0x5f0de7(0x1ee)]+':\x20'+_0xd500ce[_0x5f0de7(0x1ef)]);}}if(_0x315044)return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x216)](_0x5f0de7(0x220))),0x1;const _0x567577=await _0x2b8dde[_0x5f0de7(0x1fc)][_0x5f0de7(0x1f1)](_0x41392f),_0x4450ce=await withProgressSpinner(_0x5f0de7(0x224)+_0x41392f+'\x27...',_0x18a84a=>preparePush({'engage':_0x2b8dde[_0x5f0de7(0x1fc)]},_0x3b0d6d,_0x567577,{'progress':{'update':_0x504a5f=>_0x18a84a[_0x5f0de7(0x222)](_0x504a5f)}}),{'verbose':_0x1ed584['verbose']}),_0x15aa5c=_0x4450ce[_0x5f0de7(0x209)];await withProgressSpinner(_0x5f0de7(0x1f8),_0x182f8f=>resolveAndBuildInputs({'engage':_0x2b8dde[_0x5f0de7(0x1fc)]},_0x15aa5c,_0x567577,{'progress':{'update':_0x3ea196=>_0x182f8f[_0x5f0de7(0x222)](_0x3ea196)}}),{'verbose':_0x1ed584[_0x5f0de7(0x21f)]});const _0x278225=_0x15aa5c['filter'](_0x53323d=>_0x53323d['action']==='create'),_0x2d1b9b=_0x15aa5c[_0x5f0de7(0x214)](_0x2608cc=>_0x2608cc[_0x5f0de7(0x1f5)]===_0x5f0de7(0x212));console[_0x5f0de7(0x221)](_0x5f0de7(0x206)+_0x41392f+'\x27:');if(_0x278225[_0x5f0de7(0x228)]>0x0){console[_0x5f0de7(0x221)]('\x20\x20'+a24_0x653739[_0x5f0de7(0x22a)]('+\x20'+_0x278225['length']+_0x5f0de7(0x217)));for(const _0x413c18 of _0x278225){console[_0x5f0de7(0x221)]('\x20\x20\x20\x20'+a24_0x653739[_0x5f0de7(0x22a)]('+')+'\x20'+_0x413c18[_0x5f0de7(0x1f0)][_0x5f0de7(0x21a)]);}}if(_0x2d1b9b[_0x5f0de7(0x228)]>0x0){console['error']('\x20\x20'+a24_0x653739[_0x5f0de7(0x1f2)]('~\x20'+_0x2d1b9b[_0x5f0de7(0x228)]+_0x5f0de7(0x1ff)));for(const _0xd9ddd of _0x2d1b9b){console['error'](_0x5f0de7(0x22c)+a24_0x653739[_0x5f0de7(0x1f2)]('~')+'\x20'+_0xd9ddd[_0x5f0de7(0x1f0)][_0x5f0de7(0x21a)]);}}if(_0x278225[_0x5f0de7(0x228)]===0x0&&_0x2d1b9b[_0x5f0de7(0x228)]===0x0)return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x22a)](_0x5f0de7(0x20e))),0x0;if(_0x1ed584[_0x5f0de7(0x219)])return console[_0x5f0de7(0x221)](a24_0x653739['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x1ed584['yes']){if(!isInteractive())return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x216)](_0x5f0de7(0x1e8)),_0x5f0de7(0x227)),console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x1e6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x20e256=await confirmKey(_0x5f0de7(0x1ed)+(_0x278225['length']+_0x2d1b9b['length'])+_0x5f0de7(0x1fe));if(!_0x20e256)return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x1f2)](_0x5f0de7(0x1fa)),'-\x20no\x20changes\x20applied'),0x1;}const _0x4f4717=await withProgressSpinner(_0x5f0de7(0x211),_0xe360b0=>executePush({'engage':_0x2b8dde[_0x5f0de7(0x1fc)]},_0x15aa5c,{'progress':{'update':_0xdae3d=>_0xe360b0[_0x5f0de7(0x222)](_0xdae3d)}}),{'verbose':_0x1ed584[_0x5f0de7(0x21f)]}),_0x4fc2d7=_0x4f4717[_0x5f0de7(0x209)];for(const _0x16d335 of _0x4fc2d7[_0x5f0de7(0x1ea)]){if(_0x16d335['templateId']&&(_0x16d335[_0x5f0de7(0x1f5)]==='created'||_0x16d335[_0x5f0de7(0x1f5)]===_0x5f0de7(0x200))){const _0x24f217=getTemplateUrl(_0x1ed584[_0x5f0de7(0x20f)],_0x567577,_0x16d335['templateId']),_0x438f23=_0x16d335[_0x5f0de7(0x1f5)]===_0x5f0de7(0x223)?'+':'~',_0x1ef8f4=_0x16d335[_0x5f0de7(0x1f5)]==='created'?a24_0x653739[_0x5f0de7(0x22a)](_0x438f23):a24_0x653739['yellow'](_0x438f23);console['error']('\x20\x20'+_0x1ef8f4+'\x20'+hyperlink(_0x16d335[_0x5f0de7(0x21a)],_0x24f217)+'\x20'+a24_0x653739[_0x5f0de7(0x1e6)](_0x24f217));}}_0x4fc2d7[_0x5f0de7(0x223)]>0x0&&console[_0x5f0de7(0x221)](a24_0x653739['green']('✔\x20Created\x20'+_0x4fc2d7[_0x5f0de7(0x223)]+'\x20templates'));_0x4fc2d7[_0x5f0de7(0x200)]>0x0&&console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x22a)](_0x5f0de7(0x1f3)+_0x4fc2d7[_0x5f0de7(0x200)]+_0x5f0de7(0x21d)));if(_0x4fc2d7[_0x5f0de7(0x22d)][_0x5f0de7(0x228)]>0x0){console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x216)]('✘\x20'+_0x4fc2d7[_0x5f0de7(0x22d)][_0x5f0de7(0x228)]+_0x5f0de7(0x1ec)));for(const _0x569d20 of _0x4fc2d7['errors']){console[_0x5f0de7(0x221)]('\x20\x20'+a24_0x653739[_0x5f0de7(0x216)](_0x569d20[_0x5f0de7(0x21a)])+':\x20'+_0x569d20[_0x5f0de7(0x221)]);}}return saveSessionContext({'engage_workspace':_0x41392f},_0x1ed584[_0x5f0de7(0x21c)]),_0x4fc2d7[_0x5f0de7(0x22d)]['length']>0x0?0x1:0x0;}}
1
+ const a27_0x183692=a27_0x5690;(function(_0x70be9,_0x176897){const _0x4f8b39=a27_0x5690,_0x4af8f1=_0x70be9();while(!![]){try{const _0x14362=-parseInt(_0x4f8b39(0xc5))/0x1*(-parseInt(_0x4f8b39(0xd0))/0x2)+parseInt(_0x4f8b39(0xeb))/0x3+-parseInt(_0x4f8b39(0xef))/0x4*(-parseInt(_0x4f8b39(0xcb))/0x5)+parseInt(_0x4f8b39(0xf5))/0x6+-parseInt(_0x4f8b39(0xcc))/0x7+-parseInt(_0x4f8b39(0x103))/0x8*(parseInt(_0x4f8b39(0xe8))/0x9)+-parseInt(_0x4f8b39(0x110))/0xa;if(_0x14362===_0x176897)break;else _0x4af8f1['push'](_0x4af8f1['shift']());}catch(_0x2984a5){_0x4af8f1['push'](_0x4af8f1['shift']());}}}(a27_0xd63f,0xd9fb1));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a27_0xd63f(){const _0x24a9ad=['engage_workspace','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','relativePath','\x20templates','Preparing\x20push\x20to\x20workspace\x20\x27','\x20\x20\x20\x20','site','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','templateId','\x20templates\x20to\x20update:','green','No\x20template\x20YAML\x20files\x20found\x20in\x20','9VjQVgf','✔\x20Updated\x20','cwd','5114388hOUCZp','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','created','43108UoswyW','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','workspace','Push\x20','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','configDir','4662528odtFFf','results','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x20errors:','session','\x0aError:','Pushing\x20templates...','engage:template:push','\x20new\x20templates:','Aborted.','dryRun','create','verbose','red','7228392zhTukw','errors','action','cyan','yes','path','updated','Found\x20','\x20templates?','warnings','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','valid','engage','16895080vzXeYw','dirname','def','1xsUOpF','Resolving\x20references...','error','config','resolveWorkspaceId','message','485SUqsDy','4644689RqlRZI','yellow','filter','data','1244360wIIrXo','Workspace\x20is\x20required.','name','description','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','execute','-\x20no\x20changes\x20applied','1\x20template\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','length','setPhase','✔\x20Created\x20'];a27_0xd63f=function(){return _0x24a9ad;};return a27_0xd63f();}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a27_0x207327 from'chalk';import a27_0x55f492 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a27_0x5690(_0x4839f8,_0x1b61b5){_0x4839f8=_0x4839f8-0xc5;const _0xd63f2b=a27_0xd63f();let _0x5690ee=_0xd63f2b[_0x4839f8];return _0x5690ee;}export class EngageTemplatePushCommand extends BaseCommand{[a27_0x183692(0xd2)]=a27_0x183692(0xfc);[a27_0x183692(0xd3)]=a27_0x183692(0xf3);async[a27_0x183692(0xd5)](_0x5e10d2){const _0x19485f=a27_0x183692,{options:_0x30dfb4,args:_0x424d5d,tdx:_0x1bd277}=_0x5e10d2,_0x4161be=_0x30dfb4,_0x277dee=_0x424d5d[0x0],_0x19c7d1=_0x277dee?a27_0x55f492['resolve'](_0x277dee):undefined,_0x2a621=_0x19c7d1?isYamlFile(_0x19c7d1):![];let _0x45f460;if(_0x2a621&&_0x19c7d1)_0x45f460=a27_0x55f492[_0x19485f(0x111)](_0x19c7d1);else _0x19c7d1?_0x45f460=_0x19c7d1:_0x45f460=process[_0x19485f(0xea)]();let _0x365f2c;const _0x298c8f=tryFindTdxConfig(_0x45f460);_0x298c8f?.[_0x19485f(0xc8)][_0x19485f(0xdc)]&&(_0x365f2c=_0x298c8f[_0x19485f(0xc8)][_0x19485f(0xdc)],!_0x2a621&&(_0x45f460=_0x298c8f[_0x19485f(0xf4)]));_0x4161be['workspace']&&(_0x365f2c=_0x4161be[_0x19485f(0xf1)]);if(!_0x365f2c){const _0x2d903c=loadSessionContext(_0x4161be[_0x19485f(0xf9)]);_0x2d903c?.[_0x19485f(0xdc)]&&(_0x365f2c=_0x2d903c['engage_workspace']);}if(!_0x365f2c)return console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xcd)](_0x19485f(0xd1))),console[_0x19485f(0xc7)](_0x19485f(0xd4)),console['error'](_0x19485f(0xed)),console[_0x19485f(0xc7)](_0x19485f(0xd8)),console[_0x19485f(0xc7)](_0x19485f(0xf7)),0x1;let _0xacc215;_0x2a621&&_0x19c7d1?_0xacc215=[parseTemplateFile(_0x19c7d1,a27_0x55f492[_0x19485f(0x111)](_0x19c7d1))]:_0xacc215=discoverAndParseTemplateFiles(_0x45f460);if(_0xacc215[_0x19485f(0xd9)]===0x0)return console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xcd)](_0x19485f(0xe7)+_0x45f460)),console[_0x19485f(0xc7)](a27_0x207327['dim'](_0x19485f(0xf0))),0x1;const _0x1d43c5=_0xacc215[_0x19485f(0xd9)]===0x1?_0x19485f(0xd7)+_0xacc215[0x0][_0x19485f(0x112)][_0x19485f(0xd2)]:_0xacc215['length']+'\x20template\x20files';console[_0x19485f(0xc7)](_0x19485f(0x10a)+a27_0x207327[_0x19485f(0x106)](_0x1d43c5));let _0xd536be=![];for(const _0xb74296 of _0xacc215){const _0x2c2490=validateTemplateDef(_0xb74296[_0x19485f(0x112)]);if(!_0x2c2490[_0x19485f(0x10e)]){_0xd536be=!![],console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0x102)]('\x0aValidation\x20errors\x20in\x20'+_0xb74296[_0x19485f(0xde)]+':'));for(const _0x5ce005 of _0x2c2490[_0x19485f(0x104)]){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327['red']('✗')+'\x20'+_0x5ce005[_0x19485f(0x108)]+':\x20'+_0x5ce005[_0x19485f(0xca)]);}}for(const _0x110699 of _0x2c2490[_0x19485f(0x10c)]){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327[_0x19485f(0xcd)]('⚠')+'\x20'+_0x110699[_0x19485f(0x108)]+':\x20'+_0x110699[_0x19485f(0xca)]);}}if(_0xd536be)return console['error'](a27_0x207327[_0x19485f(0x102)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x334a3b=await _0x1bd277[_0x19485f(0x10f)][_0x19485f(0xc9)](_0x365f2c),_0x2e82ee=await withProgressSpinner(_0x19485f(0xe0)+_0x365f2c+'\x27...',_0x524da6=>preparePush({'engage':_0x1bd277['engage']},_0xacc215,_0x334a3b,{'progress':{'update':_0x1fbed4=>_0x524da6['setPhase'](_0x1fbed4)}}),{'verbose':_0x4161be[_0x19485f(0x101)]}),_0x1912e3=_0x2e82ee[_0x19485f(0xcf)];await withProgressSpinner(_0x19485f(0xc6),_0x319a05=>resolveAndBuildInputs({'engage':_0x1bd277[_0x19485f(0x10f)]},_0x1912e3,_0x334a3b,{'progress':{'update':_0x2d6d4a=>_0x319a05['setPhase'](_0x2d6d4a)}}),{'verbose':_0x4161be['verbose']});const _0x11e57a=_0x1912e3[_0x19485f(0xce)](_0x251d5c=>_0x251d5c[_0x19485f(0x105)]===_0x19485f(0x100)),_0x2757e1=_0x1912e3[_0x19485f(0xce)](_0x40e688=>_0x40e688[_0x19485f(0x105)]==='update');console[_0x19485f(0xc7)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x365f2c+'\x27:');if(_0x11e57a['length']>0x0){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327[_0x19485f(0xe6)]('+\x20'+_0x11e57a[_0x19485f(0xd9)]+_0x19485f(0xfd)));for(const _0x3bd483 of _0x11e57a){console[_0x19485f(0xc7)](_0x19485f(0xe1)+a27_0x207327[_0x19485f(0xe6)]('+')+'\x20'+_0x3bd483[_0x19485f(0x112)][_0x19485f(0xd2)]);}}if(_0x2757e1[_0x19485f(0xd9)]>0x0){console['error']('\x20\x20'+a27_0x207327[_0x19485f(0xcd)]('~\x20'+_0x2757e1[_0x19485f(0xd9)]+_0x19485f(0xe5)));for(const _0x489bb6 of _0x2757e1){console[_0x19485f(0xc7)](_0x19485f(0xe1)+a27_0x207327[_0x19485f(0xcd)]('~')+'\x20'+_0x489bb6[_0x19485f(0x112)][_0x19485f(0xd2)]);}}if(_0x11e57a[_0x19485f(0xd9)]===0x0&&_0x2757e1[_0x19485f(0xd9)]===0x0)return console['error'](a27_0x207327[_0x19485f(0xe6)]('\u2714\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x4161be[_0x19485f(0xff)])return console[_0x19485f(0xc7)](a27_0x207327['yellow'](_0x19485f(0xdd))),0x0;if(!_0x4161be[_0x19485f(0x107)]){if(!isInteractive())return console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0x102)](_0x19485f(0xfa)),_0x19485f(0x10d)),console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xec)](_0x19485f(0xe3))),0x1;const _0x3f4f6f=await confirmKey(_0x19485f(0xf2)+(_0x11e57a[_0x19485f(0xd9)]+_0x2757e1[_0x19485f(0xd9)])+_0x19485f(0x10b));if(!_0x3f4f6f)return console['error'](a27_0x207327[_0x19485f(0xcd)](_0x19485f(0xfe)),_0x19485f(0xd6)),0x1;}const _0xcc02c7=await withProgressSpinner(_0x19485f(0xfb),_0x1e7bd5=>executePush({'engage':_0x1bd277[_0x19485f(0x10f)]},_0x1912e3,{'progress':{'update':_0x146fcb=>_0x1e7bd5[_0x19485f(0xda)](_0x146fcb)}}),{'verbose':_0x4161be[_0x19485f(0x101)]}),_0x2b04ae=_0xcc02c7[_0x19485f(0xcf)];for(const _0x3aca7c of _0x2b04ae[_0x19485f(0xf6)]){if(_0x3aca7c['templateId']&&(_0x3aca7c['action']===_0x19485f(0xee)||_0x3aca7c[_0x19485f(0x105)]===_0x19485f(0x109))){const _0x53b2eb=getTemplateUrl(_0x4161be[_0x19485f(0xe2)],_0x334a3b,_0x3aca7c[_0x19485f(0xe4)]),_0x3b9293=_0x3aca7c[_0x19485f(0x105)]===_0x19485f(0xee)?'+':'~',_0xb64474=_0x3aca7c[_0x19485f(0x105)]===_0x19485f(0xee)?a27_0x207327[_0x19485f(0xe6)](_0x3b9293):a27_0x207327[_0x19485f(0xcd)](_0x3b9293);console[_0x19485f(0xc7)]('\x20\x20'+_0xb64474+'\x20'+hyperlink(_0x3aca7c['name'],_0x53b2eb)+'\x20'+a27_0x207327[_0x19485f(0xec)](_0x53b2eb));}}_0x2b04ae[_0x19485f(0xee)]>0x0&&console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xe6)](_0x19485f(0xdb)+_0x2b04ae[_0x19485f(0xee)]+_0x19485f(0xdf)));_0x2b04ae[_0x19485f(0x109)]>0x0&&console['error'](a27_0x207327[_0x19485f(0xe6)](_0x19485f(0xe9)+_0x2b04ae['updated']+'\x20templates'));if(_0x2b04ae[_0x19485f(0x104)]['length']>0x0){console[_0x19485f(0xc7)](a27_0x207327['red']('✘\x20'+_0x2b04ae['errors']['length']+_0x19485f(0xf8)));for(const _0x4041d2 of _0x2b04ae['errors']){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327[_0x19485f(0x102)](_0x4041d2[_0x19485f(0xd2)])+':\x20'+_0x4041d2[_0x19485f(0xc7)]);}}return saveSessionContext({'engage_workspace':_0x365f2c},_0x4161be[_0x19485f(0xf9)]),_0x2b04ae[_0x19485f(0x104)][_0x19485f(0xd9)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a25_0x26100e=a25_0x35a8;function a25_0x35a8(_0x4f3fb6,_0x3ba494){_0x4f3fb6=_0x4f3fb6-0x16f;const _0x3cc216=a25_0x3cc2();let _0x35a8e4=_0x3cc216[_0x4f3fb6];return _0x35a8e4;}(function(_0x179bbb,_0x3a82bf){const _0x1e6fd1=a25_0x35a8,_0x252e99=_0x179bbb();while(!![]){try{const _0x18b5ae=-parseInt(_0x1e6fd1(0x19c))/0x1+-parseInt(_0x1e6fd1(0x172))/0x2*(parseInt(_0x1e6fd1(0x19d))/0x3)+parseInt(_0x1e6fd1(0x192))/0x4*(-parseInt(_0x1e6fd1(0x170))/0x5)+-parseInt(_0x1e6fd1(0x19f))/0x6*(parseInt(_0x1e6fd1(0x189))/0x7)+parseInt(_0x1e6fd1(0x194))/0x8+-parseInt(_0x1e6fd1(0x199))/0x9+parseInt(_0x1e6fd1(0x19e))/0xa;if(_0x18b5ae===_0x3a82bf)break;else _0x252e99['push'](_0x252e99['shift']());}catch(_0x2c26a9){_0x252e99['push'](_0x252e99['shift']());}}}(a25_0x3cc2,0xd1aeb));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0x3cc2(){const _0x1d1054=['length','\x20non-template\x20file(s)\x20skipped)','relativePath','hasErrors','\x20warning(s)','red','\x20non-template\x20file(s)\x20skipped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','errors','dim','.yaml','green','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','error','reason','dirname','1645BKdcWb','endsWith','.yml','warningCount','name','✔\x20All\x20','yellow','No\x20template\x20YAML\x20files\x20found\x20in\x20','verbose','229528IIayqo','log','12672096iVWgRP','invalidCount','Validate\x20template\x20YAML\x20files','\x20template(s)\x20with\x20errors,\x20','Error:\x20Directory\x20not\x20found:\x20','8901900brHfEj','\x20warning(s)\x20found','template','46618uvlIYk','3LdgaDA','45999680ZBfNOh','38616pynDKH','skippedCount','\x20(skipped:\x20','105qdUWkT','engage:template:validate','3143842sLmCYo','validCount','valid','\x20valid','\x20template(s)\x20valid','execute','warnings'];a25_0x3cc2=function(){return _0x1d1054;};return a25_0x3cc2();}import{existsSync}from'fs';import a25_0x1288ed from'chalk';import a25_0x20eb3e from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x26100e(0x18d)]=a25_0x26100e(0x171);['description']=a25_0x26100e(0x196);async[a25_0x26100e(0x177)](_0x51ce1e){const _0x5d43cb=a25_0x26100e,{options:_0x3aa9be,args:_0x3963a3}=_0x51ce1e,_0x4889ab=_0x3aa9be,_0x2ff46d=_0x3963a3[0x0],_0x184194=_0x2ff46d?a25_0x20eb3e['resolve'](_0x2ff46d):undefined,_0x411e7c=_0x184194?isYamlFile(_0x184194):![];let _0x1c4345,_0x5a08f5;if(_0x411e7c&&_0x184194)_0x1c4345=a25_0x20eb3e[_0x5d43cb(0x188)](_0x184194),_0x5a08f5=_0x184194;else _0x184194?_0x1c4345=_0x184194:_0x1c4345=process['cwd']();if(!_0x5a08f5&&!existsSync(_0x1c4345))return console[_0x5d43cb(0x186)](a25_0x1288ed['red'](_0x5d43cb(0x198)+_0x1c4345+'\x0a')),0x1;let _0x45871b;if(_0x5a08f5){if(!_0x5a08f5[_0x5d43cb(0x18a)](_0x5d43cb(0x18b))&&!_0x5a08f5[_0x5d43cb(0x18a)](_0x5d43cb(0x183)))return console['error'](a25_0x1288ed[_0x5d43cb(0x17e)](_0x5d43cb(0x180)+_0x5a08f5+'\x0a')),0x1;_0x45871b=[_0x5a08f5];}else _0x45871b=findYamlFiles(_0x1c4345);if(_0x45871b[_0x5d43cb(0x179)]===0x0)return console['error'](a25_0x1288ed[_0x5d43cb(0x17e)](_0x5d43cb(0x185)+_0x1c4345+'\x0a')),0x1;const _0x41b030=validateYamlFiles(_0x45871b,_0x1c4345,{'filterType':_0x5d43cb(0x19b)}),_0x1a3a40=calculateSummary(_0x41b030),_0x1bbc0d=_0x41b030['filter'](isValidationResult);if(_0x1bbc0d[_0x5d43cb(0x179)]===0x0)return console['error'](a25_0x1288ed[_0x5d43cb(0x18f)](_0x5d43cb(0x190)+_0x1c4345+'\x0a')),_0x1a3a40[_0x5d43cb(0x1a0)]>0x0&&console[_0x5d43cb(0x186)](a25_0x1288ed[_0x5d43cb(0x182)]('('+_0x1a3a40['skippedCount']+_0x5d43cb(0x17a))),0x0;for(const _0x42748e of _0x41b030){if(!isValidationResult(_0x42748e)){_0x4889ab[_0x5d43cb(0x191)]&&console[_0x5d43cb(0x193)](a25_0x1288ed[_0x5d43cb(0x182)]('-\x20'+_0x42748e[_0x5d43cb(0x17b)]+_0x5d43cb(0x16f)+_0x42748e[_0x5d43cb(0x187)]+')'));continue;}const {relativePath:_0x296995,source:_0xd1ee50,result:_0x5bd830}=_0x42748e;if(_0x5bd830['valid']&&_0x5bd830[_0x5d43cb(0x178)][_0x5d43cb(0x179)]===0x0)_0x4889ab[_0x5d43cb(0x191)]&&console[_0x5d43cb(0x193)](a25_0x1288ed[_0x5d43cb(0x184)]('✔\x20'+_0x296995));else _0x5bd830[_0x5d43cb(0x174)]?(console['log'](a25_0x1288ed[_0x5d43cb(0x18f)]('⚠\x20'+_0x296995+':\x20'+_0x5bd830['warnings']['length']+_0x5d43cb(0x17d))),console[_0x5d43cb(0x193)](formatValidationResult(_0x5bd830,_0xd1ee50,_0x296995))):(console['log'](a25_0x1288ed['red']('✖\x20'+_0x296995+':\x20'+_0x5bd830[_0x5d43cb(0x181)][_0x5d43cb(0x179)]+'\x20error(s)')),console[_0x5d43cb(0x193)](formatValidationResult(_0x5bd830,_0xd1ee50,_0x296995)));}return console[_0x5d43cb(0x193)](''),_0x1a3a40[_0x5d43cb(0x17c)]?(console[_0x5d43cb(0x193)](a25_0x1288ed[_0x5d43cb(0x17e)]('Validation\x20failed:\x20'+_0x1a3a40[_0x5d43cb(0x195)]+_0x5d43cb(0x197)+_0x1a3a40[_0x5d43cb(0x173)]+_0x5d43cb(0x175))),_0x1a3a40[_0x5d43cb(0x18c)]>0x0&&console[_0x5d43cb(0x193)](a25_0x1288ed[_0x5d43cb(0x18f)](_0x1a3a40[_0x5d43cb(0x18c)]+_0x5d43cb(0x19a))),_0x1a3a40[_0x5d43cb(0x1a0)]>0x0&&console[_0x5d43cb(0x193)](a25_0x1288ed[_0x5d43cb(0x182)](_0x1a3a40['skippedCount']+_0x5d43cb(0x17f))),0x1):(console[_0x5d43cb(0x193)](a25_0x1288ed['green'](_0x5d43cb(0x18e)+_0x1a3a40[_0x5d43cb(0x173)]+_0x5d43cb(0x176))),_0x1a3a40['warningCount']>0x0&&console[_0x5d43cb(0x193)](a25_0x1288ed[_0x5d43cb(0x18f)](_0x1a3a40['warningCount']+_0x5d43cb(0x19a))),_0x1a3a40[_0x5d43cb(0x1a0)]>0x0&&console[_0x5d43cb(0x193)](a25_0x1288ed['dim'](_0x1a3a40['skippedCount']+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
1
+ const a28_0x5d0b1e=a28_0x5786;(function(_0x35c9a5,_0x52af31){const _0xf441dc=a28_0x5786,_0x2de351=_0x35c9a5();while(!![]){try{const _0x18b5a9=-parseInt(_0xf441dc(0x1c9))/0x1+-parseInt(_0xf441dc(0x1ca))/0x2*(-parseInt(_0xf441dc(0x1dd))/0x3)+parseInt(_0xf441dc(0x1c3))/0x4+parseInt(_0xf441dc(0x1d1))/0x5+-parseInt(_0xf441dc(0x1de))/0x6*(parseInt(_0xf441dc(0x1dc))/0x7)+parseInt(_0xf441dc(0x1c1))/0x8+-parseInt(_0xf441dc(0x1ce))/0x9;if(_0x18b5a9===_0x52af31)break;else _0x2de351['push'](_0x2de351['shift']());}catch(_0x32219a){_0x2de351['push'](_0x2de351['shift']());}}}(a28_0x63ec,0xa63ca));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a28_0x63ec(){const _0x527b71=['5847nWeqID','1515408OXvkjy','dim','name','valid','relativePath','reason','filter','✔\x20All\x20','red','Error:\x20Directory\x20not\x20found:\x20','endsWith','\x20warning(s)\x20found','resolve','length','yellow','\x20template(s)\x20valid','template','\x20(skipped:\x20','8605616KOYKfA','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','285932SDiMmv','.yaml','\x20valid','log','\x20template(s)\x20with\x20errors,\x20','invalidCount','1020438cbXVEY','1202Fxhmmm','skippedCount','Validate\x20template\x20YAML\x20files','execute','6397353SLPqkx','green','\x20non-template\x20file(s)\x20skipped)','1730975zumadC','warningCount','validCount','.yml','dirname','error','engage:template:validate','warnings','\x20non-template\x20file(s)\x20skipped','verbose','description','7fJOLyE'];a28_0x63ec=function(){return _0x527b71;};return a28_0x63ec();}function a28_0x5786(_0x266cf6,_0x285557){_0x266cf6=_0x266cf6-0x1b8;const _0x63ecf=a28_0x63ec();let _0x5786c1=_0x63ecf[_0x266cf6];return _0x5786c1;}import a28_0x55d76b from'chalk';import a28_0x3be570 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{[a28_0x5d0b1e(0x1e0)]=a28_0x5d0b1e(0x1d7);[a28_0x5d0b1e(0x1db)]=a28_0x5d0b1e(0x1cc);async[a28_0x5d0b1e(0x1cd)](_0x294db1){const _0x3b6f75=a28_0x5d0b1e,{options:_0x56a622,args:_0x2b2541}=_0x294db1,_0x256033=_0x56a622,_0x3b0250=_0x2b2541[0x0],_0x3767b7=_0x3b0250?a28_0x3be570[_0x3b6f75(0x1bb)](_0x3b0250):undefined,_0x477276=_0x3767b7?isYamlFile(_0x3767b7):![];let _0x273926,_0xd97bfb;if(_0x477276&&_0x3767b7)_0x273926=a28_0x3be570[_0x3b6f75(0x1d5)](_0x3767b7),_0xd97bfb=_0x3767b7;else _0x3767b7?_0x273926=_0x3767b7:_0x273926=process['cwd']();if(!_0xd97bfb&&!existsSync(_0x273926))return console['error'](a28_0x55d76b[_0x3b6f75(0x1e6)](_0x3b6f75(0x1b8)+_0x273926+'\x0a')),0x1;let _0x5e75f5;if(_0xd97bfb){if(!_0xd97bfb[_0x3b6f75(0x1b9)](_0x3b6f75(0x1d4))&&!_0xd97bfb[_0x3b6f75(0x1b9)](_0x3b6f75(0x1c4)))return console['error'](a28_0x55d76b[_0x3b6f75(0x1e6)](_0x3b6f75(0x1c2)+_0xd97bfb+'\x0a')),0x1;_0x5e75f5=[_0xd97bfb];}else _0x5e75f5=findYamlFiles(_0x273926);if(_0x5e75f5[_0x3b6f75(0x1bc)]===0x0)return console[_0x3b6f75(0x1d6)](a28_0x55d76b[_0x3b6f75(0x1e6)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x273926+'\x0a')),0x1;const _0x55812f=validateYamlFiles(_0x5e75f5,_0x273926,{'filterType':_0x3b6f75(0x1bf)}),_0xdea9f9=calculateSummary(_0x55812f),_0x9d3113=_0x55812f[_0x3b6f75(0x1e4)](isValidationResult);if(_0x9d3113[_0x3b6f75(0x1bc)]===0x0)return console['error'](a28_0x55d76b[_0x3b6f75(0x1bd)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x273926+'\x0a')),_0xdea9f9['skippedCount']>0x0&&console[_0x3b6f75(0x1d6)](a28_0x55d76b['dim']('('+_0xdea9f9[_0x3b6f75(0x1cb)]+_0x3b6f75(0x1d0))),0x0;for(const _0x18bc5f of _0x55812f){if(!isValidationResult(_0x18bc5f)){_0x256033[_0x3b6f75(0x1da)]&&console['log'](a28_0x55d76b[_0x3b6f75(0x1df)]('-\x20'+_0x18bc5f[_0x3b6f75(0x1e2)]+_0x3b6f75(0x1c0)+_0x18bc5f[_0x3b6f75(0x1e3)]+')'));continue;}const {relativePath:_0x16b7f3,source:_0x26b4fd,result:_0x2c9900}=_0x18bc5f;if(_0x2c9900[_0x3b6f75(0x1e1)]&&_0x2c9900[_0x3b6f75(0x1d8)][_0x3b6f75(0x1bc)]===0x0)_0x256033['verbose']&&console[_0x3b6f75(0x1c6)](a28_0x55d76b[_0x3b6f75(0x1cf)]('✔\x20'+_0x16b7f3));else _0x2c9900[_0x3b6f75(0x1e1)]?(console[_0x3b6f75(0x1c6)](a28_0x55d76b['yellow']('⚠\x20'+_0x16b7f3+':\x20'+_0x2c9900[_0x3b6f75(0x1d8)][_0x3b6f75(0x1bc)]+'\x20warning(s)')),console[_0x3b6f75(0x1c6)](formatValidationResult(_0x2c9900,_0x26b4fd,_0x16b7f3))):(console['log'](a28_0x55d76b[_0x3b6f75(0x1e6)]('✖\x20'+_0x16b7f3+':\x20'+_0x2c9900['errors'][_0x3b6f75(0x1bc)]+'\x20error(s)')),console[_0x3b6f75(0x1c6)](formatValidationResult(_0x2c9900,_0x26b4fd,_0x16b7f3)));}return console[_0x3b6f75(0x1c6)](''),_0xdea9f9['hasErrors']?(console[_0x3b6f75(0x1c6)](a28_0x55d76b[_0x3b6f75(0x1e6)]('Validation\x20failed:\x20'+_0xdea9f9[_0x3b6f75(0x1c8)]+_0x3b6f75(0x1c7)+_0xdea9f9[_0x3b6f75(0x1d3)]+_0x3b6f75(0x1c5))),_0xdea9f9[_0x3b6f75(0x1d2)]>0x0&&console[_0x3b6f75(0x1c6)](a28_0x55d76b['yellow'](_0xdea9f9[_0x3b6f75(0x1d2)]+_0x3b6f75(0x1ba))),_0xdea9f9[_0x3b6f75(0x1cb)]>0x0&&console[_0x3b6f75(0x1c6)](a28_0x55d76b[_0x3b6f75(0x1df)](_0xdea9f9['skippedCount']+_0x3b6f75(0x1d9))),0x1):(console[_0x3b6f75(0x1c6)](a28_0x55d76b['green'](_0x3b6f75(0x1e5)+_0xdea9f9[_0x3b6f75(0x1d3)]+_0x3b6f75(0x1be))),_0xdea9f9[_0x3b6f75(0x1d2)]>0x0&&console[_0x3b6f75(0x1c6)](a28_0x55d76b[_0x3b6f75(0x1bd)](_0xdea9f9[_0x3b6f75(0x1d2)]+_0x3b6f75(0x1ba))),_0xdea9f9[_0x3b6f75(0x1cb)]>0x0&&console['log'](a28_0x55d76b[_0x3b6f75(0x1df)](_0xdea9f9[_0x3b6f75(0x1cb)]+_0x3b6f75(0x1d9))),0x0);}}
@@ -1 +1 @@
1
- const a26_0x2f10fb=a26_0x3001;(function(_0x3c2298,_0x37ba1c){const _0x2f4428=a26_0x3001,_0x16fcbc=_0x3c2298();while(!![]){try{const _0x2f6030=parseInt(_0x2f4428(0xd7))/0x1*(-parseInt(_0x2f4428(0xc2))/0x2)+-parseInt(_0x2f4428(0xe7))/0x3+parseInt(_0x2f4428(0x9c))/0x4+parseInt(_0x2f4428(0xc8))/0x5*(parseInt(_0x2f4428(0xee))/0x6)+-parseInt(_0x2f4428(0xab))/0x7+parseInt(_0x2f4428(0xbc))/0x8+-parseInt(_0x2f4428(0xb3))/0x9*(parseInt(_0x2f4428(0xd1))/0xa);if(_0x2f6030===_0x37ba1c)break;else _0x16fcbc['push'](_0x16fcbc['shift']());}catch(_0x5ca76a){_0x16fcbc['push'](_0x16fcbc['shift']());}}}(a26_0x4bc8,0xb803c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';function a26_0x4bc8(){const _0x316bc6=['map','Cancelled','Get\x20job\x20results','60mOJOBE','verbose','show','type','job_id','submit','2165sGPUFJ','job:kill','Query:\x20','result','hive','description','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Listing\x20jobs...','d\x20ago','status','end_at','query','validate','m\x20ago','List\x20jobs','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','2052480zeYqHw','Submitting\x20job...','args','data','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','created_at','getTime','8152590VrCksY','name','substring','job:result','priority','yes','Kill\x20a\x20job','length','Submitting\x20kill\x20request...','\x20job','5525336wmzXou','push','kill','\x20jobs','✔\x20Job\x20submitted','Show\x20job\x20details','url','h\x20ago','just\x20now','✔\x20Found\x20','\x20row','Getting\x20job\x20details...','\x20\x20Job\x20ID:\x20','trino','floor','1581762zoEYUr','dim','now','execute','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','start_at','user_name','Database:\x20','2881863urMczc','✔\x20Retrieved\x20','Job\x20type:\x20','...','No\x20SQL\x20statements\x20found\x20in\x20file','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','file','round','\x27\x20to\x20verify\x20the\x20job\x20status','9894864DVTjjd','success','presto','jobs','INVALID_ARGUMENT','Getting\x20job\x20results...','362FxOdFl','abs','error','debug','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','job:show','5NOxSIj','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','database','information_schema','Submit\x20a\x20job','log'];a26_0x4bc8=function(){return _0x316bc6;};return a26_0x4bc8();}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x3a0e38 from'chalk';function formatDuration(_0x3c0eb1){const _0x1f06b1=a26_0x3001;if(_0x3c0eb1<0x3c)return _0x3c0eb1+'s';if(_0x3c0eb1<0xe10)return Math[_0x1f06b1(0xaa)](_0x3c0eb1/0x3c)+'m\x20'+_0x3c0eb1%0x3c+'s';const _0x565fbd=Math[_0x1f06b1(0xaa)](_0x3c0eb1/0xe10),_0x38f050=Math['floor'](_0x3c0eb1%0xe10/0x3c);return _0x38f050>0x0?_0x565fbd+'h\x20'+_0x38f050+'m':_0x565fbd+'h';}function formatRelativeTime(_0x58450e){const _0x2b641c=a26_0x3001,_0x30e7c7=Date[_0x2b641c(0xad)]()-_0x58450e[_0x2b641c(0xed)](),_0xa5d5c5=Math[_0x2b641c(0xaa)](Math[_0x2b641c(0xc3)](_0x30e7c7)/0x3e8);if(_0xa5d5c5<0x3c)return _0x2b641c(0xa4);const _0x4a5203=Math[_0x2b641c(0xaa)](_0xa5d5c5/0x3c);if(_0x4a5203<0x3c)return _0x4a5203+_0x2b641c(0xe4);const _0x376038=Math[_0x2b641c(0xaa)](_0x4a5203/0x3c);if(_0x376038<0x18)return _0x376038+_0x2b641c(0xa3);const _0x15fd52=Math[_0x2b641c(0xaa)](_0x376038/0x18);if(_0x15fd52<0x1e)return _0x15fd52+_0x2b641c(0xdf);return Math[_0x2b641c(0xaa)](_0x15fd52/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x2f10fb(0xef)]=a26_0x2f10fb(0xbf);[a26_0x2f10fb(0xdc)]=a26_0x2f10fb(0xe5);async[a26_0x2f10fb(0xae)](_0x24e9f5){const _0xb8b07d=a26_0x2f10fb,{options:_0x36985d,tdx:_0x3373cb}=_0x24e9f5,_0x544a69=resolveLimit(_0x36985d['limit'],DEFAULT_DISPLAY_LIMIT),_0x4a6416=_0x36985d[_0xb8b07d(0xe0)];_0x36985d[_0xb8b07d(0xd2)]&&(console['error']('Limit:\x20'+_0x544a69+_0xb8b07d(0x9f)),_0x4a6416&&console['error']('Status\x20filter:\x20'+_0x4a6416));const _0x19b40b=await withSpinner(_0xb8b07d(0xde),()=>_0x3373cb[_0xb8b07d(0xbf)]['list']({'from':0x0,'to':_0x544a69-0x1,'status':_0x4a6416}),{'verbose':_0x36985d['verbose']}),_0x2545d2=_0x19b40b['data'];console[_0xb8b07d(0xc4)](_0xb8b07d(0xa5)+_0x2545d2[_0xb8b07d(0x99)]+_0xb8b07d(0x9b)+(_0x2545d2[_0xb8b07d(0x99)]!==0x1?'s':''));const _0x1f9a36=_0x36985d['site'];if(isStructuredFormat(_0x36985d)){const _0x114f7d=_0x2545d2[_0xb8b07d(0xce)](_0x3181b4=>{const _0x4d1400=_0xb8b07d;let _0x24c309;if(_0x3181b4['start_at']&&_0x3181b4[_0x4d1400(0xe1)]){const _0x165c56=new Date(_0x3181b4[_0x4d1400(0xb0)])['getTime'](),_0x1d1acb=new Date(_0x3181b4[_0x4d1400(0xe1)])[_0x4d1400(0xed)]();_0x24c309=Math['round']((_0x1d1acb-_0x165c56)/0x3e8);}return{'job_id':_0x3181b4['job_id'],'type':_0x3181b4[_0x4d1400(0xd4)]===_0x4d1400(0xbe)?'trino':_0x3181b4['type'],'status':_0x3181b4[_0x4d1400(0xe0)],'user_name':_0x3181b4[_0x4d1400(0xb1)],'duration_sec':_0x24c309,'created_at':_0x3181b4['created_at'],'started_at':_0x3181b4[_0x4d1400(0xb0)],'end_at':_0x3181b4[_0x4d1400(0xe1)]};});await handleSDKOutput(_0x114f7d,_0x36985d);}else for(const _0x17d595 of _0x2545d2){const _0x24dce0=_0x17d595[_0xb8b07d(0xe0)]===_0xb8b07d(0xbd)?a26_0x3a0e38['green']:_0x17d595[_0xb8b07d(0xe0)]===_0xb8b07d(0xc4)?a26_0x3a0e38['red']:a26_0x3a0e38[_0xb8b07d(0xac)],_0xf7400e=_0x24dce0(_0x17d595[_0xb8b07d(0xe0)]),_0x2477f0=getJobUrl(_0x1f9a36,_0x17d595[_0xb8b07d(0xd5)]),_0x7ed2f2=hyperlink(_0x17d595[_0xb8b07d(0xd5)],_0x2477f0),_0x19f970=a26_0x3a0e38[_0xb8b07d(0xac)](_0x17d595[_0xb8b07d(0xd4)]===_0xb8b07d(0xbe)?_0xb8b07d(0xa9):_0x17d595[_0xb8b07d(0xd4)]),_0x2ac7e=[];if(_0x17d595['start_at']&&_0x17d595[_0xb8b07d(0xe1)]){const _0x2c907f=Math['round']((new Date(_0x17d595[_0xb8b07d(0xe1)])[_0xb8b07d(0xed)]()-new Date(_0x17d595[_0xb8b07d(0xb0)])[_0xb8b07d(0xed)]())/0x3e8);_0x2ac7e[_0xb8b07d(0x9d)](formatDuration(_0x2c907f));}if(_0x17d595[_0xb8b07d(0xe1)])_0x2ac7e[_0xb8b07d(0x9d)](formatRelativeTime(new Date(_0x17d595[_0xb8b07d(0xe1)])));else _0x17d595['start_at']&&_0x2ac7e[_0xb8b07d(0x9d)](formatRelativeTime(new Date(_0x17d595[_0xb8b07d(0xb0)])));const _0x39b6bb=_0x2ac7e[_0xb8b07d(0x99)]>0x0?a26_0x3a0e38[_0xb8b07d(0xac)]('\x20'+_0x2ac7e['join'](',\x20')):'';console[_0xb8b07d(0xcd)]('⚡\x20'+_0x7ed2f2+'\x20'+_0x19f970+'\x20'+_0xf7400e+_0x39b6bb);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x2f10fb(0xef)]=a26_0x2f10fb(0xc7);[a26_0x2f10fb(0xdc)]=a26_0x2f10fb(0xa1);[a26_0x2f10fb(0xe3)](_0x3306bb){const _0xb5a041=a26_0x2f10fb,_0x8018ad=_0x3306bb[_0xb5a041(0xe9)][0x0];if(!_0x8018ad)return _0xb5a041(0xc9);return undefined;}async['execute'](_0x4019a3){const _0x208af1=a26_0x2f10fb,{options:_0x1103cb,args:_0x5e623f,tdx:_0x27eb8b}=_0x4019a3,_0xabb6d9=_0x5e623f[0x0],_0x16709e=await withSpinner(_0x208af1(0xa7),()=>_0x27eb8b[_0x208af1(0xbf)][_0x208af1(0xd3)](_0xabb6d9),{'verbose':_0x1103cb[_0x208af1(0xd2)]}),_0x1e7919=_0x16709e[_0x208af1(0xea)];let _0x3f079b;if(_0x1e7919[_0x208af1(0xb0)]&&_0x1e7919[_0x208af1(0xe1)]){const _0x4faca2=new Date(_0x1e7919[_0x208af1(0xb0)])[_0x208af1(0xed)](),_0x18c27e=new Date(_0x1e7919['end_at'])['getTime']();_0x3f079b=Math[_0x208af1(0xba)]((_0x18c27e-_0x4faca2)/0x3e8);}const _0x419070={'job_id':_0x1e7919[_0x208af1(0xd5)],'type':_0x1e7919[_0x208af1(0xd4)],'status':_0x1e7919[_0x208af1(0xe0)],..._0x1e7919[_0x208af1(0xb1)]&&{'user_name':_0x1e7919[_0x208af1(0xb1)]},..._0x3f079b!==undefined&&{'duration_sec':_0x3f079b},..._0x1e7919[_0x208af1(0xec)]&&{'created_at':_0x1e7919[_0x208af1(0xec)]},..._0x1e7919['start_at']&&{'started_at':_0x1e7919[_0x208af1(0xb0)]},..._0x1e7919[_0x208af1(0xe1)]&&{'end_at':_0x1e7919[_0x208af1(0xe1)]},..._0x1e7919[_0x208af1(0xca)]&&{'database':_0x1e7919[_0x208af1(0xca)]},..._0x1e7919[_0x208af1(0xf2)]!==undefined&&{'priority':_0x1e7919['priority']},..._0x1e7919[_0x208af1(0xa2)]&&{'url':_0x1e7919['url']},..._0x1e7919[_0x208af1(0xe2)]&&{'query':_0x1e7919[_0x208af1(0xe2)]},..._0x1e7919[_0x208af1(0xc5)]&&{'debug':_0x1e7919[_0x208af1(0xc5)]}};return await handleSingleObjectOutput(_0x419070,_0x1103cb),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x2f10fb(0xd8);[a26_0x2f10fb(0xdc)]=a26_0x2f10fb(0x98);[a26_0x2f10fb(0xe3)](_0x5a85c5){const _0x25925a=a26_0x2f10fb,_0x24089c=_0x5a85c5[_0x25925a(0xe9)][0x0];if(!_0x24089c)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a26_0x2f10fb(0xae)](_0x58a604){const _0xc909a6=a26_0x2f10fb,{options:_0x33f442,args:_0x23872d,tdx:_0x2954c9}=_0x58a604,_0x5c7d61=_0x23872d[0x0];if(!_0x33f442[_0xc909a6(0x97)]){const _0x171240=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x5c7d61+'?');if(!_0x171240)return console[_0xc909a6(0xc4)](_0xc909a6(0xcf)),0x0;}return await withSpinner(_0xc909a6(0x9a),()=>_0x2954c9['jobs'][_0xc909a6(0x9e)](_0x5c7d61),{'verbose':_0x33f442[_0xc909a6(0xd2)]}),console[_0xc909a6(0xc4)](_0xc909a6(0xe6)+_0x5c7d61),console['error'](_0xc909a6(0xdd)+_0x5c7d61+_0xc909a6(0xbb)),0x0;}}function a26_0x3001(_0x1b23bf,_0x51052e){_0x1b23bf=_0x1b23bf-0x97;const _0x4bc824=a26_0x4bc8();let _0x300102=_0x4bc824[_0x1b23bf];return _0x300102;}export class JobSubmitCommand extends BaseCommand{[a26_0x2f10fb(0xef)]='job:submit';[a26_0x2f10fb(0xdc)]=a26_0x2f10fb(0xcc);async[a26_0x2f10fb(0xae)](_0xf909af){const _0x5b16db=a26_0x2f10fb,{options:_0x422e50,args:_0x224f10,tdx:_0x28067e}=_0xf909af,_0xc4e375=_0x422e50['jobType']||_0x5b16db(0xa9),_0x280131=_0x422e50[_0x5b16db(0xb9)],_0x351296=_0x422e50[_0x5b16db(0xca)]||_0x5b16db(0xcb),_0x463a31=_0x422e50['result'];if(_0xc4e375!=='trino'&&_0xc4e375!==_0x5b16db(0xdb))throw new SDKError(ErrorCode[_0x5b16db(0xc0)],_0x5b16db(0xeb));let _0xd44d1;if(_0x280131){if(_0x224f10[0x0])throw new SDKError(ErrorCode[_0x5b16db(0xc0)],_0x5b16db(0xc6));const _0x8ab396=readSqlStatementsFromFile(_0x280131);if(_0x8ab396[_0x5b16db(0x99)]===0x0)throw new SDKError(ErrorCode[_0x5b16db(0xc0)],_0x5b16db(0xb7));if(_0x8ab396[_0x5b16db(0x99)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5b16db(0xb8));_0xd44d1=_0x8ab396[0x0];}else{if(!_0x224f10[0x0])throw new SDKError(ErrorCode[_0x5b16db(0xc0)],_0x5b16db(0xaf));_0xd44d1=_0x224f10[0x0];}_0x422e50['verbose']&&(console[_0x5b16db(0xc4)](_0x5b16db(0xb5)+_0xc4e375),console['error'](_0x5b16db(0xb2)+_0x351296),console[_0x5b16db(0xc4)](_0x5b16db(0xd9)+_0xd44d1[_0x5b16db(0xf0)](0x0,0x64)+(_0xd44d1[_0x5b16db(0x99)]>0x64?_0x5b16db(0xb6):'')));const _0x27f449=await withSpinner(_0x5b16db(0xe8),()=>_0x28067e[_0x5b16db(0xbf)][_0x5b16db(0xd6)](_0x351296,_0xd44d1,_0xc4e375,_0x463a31),{'verbose':_0x422e50[_0x5b16db(0xd2)]}),_0x3f58ab=_0x27f449['data'];return console[_0x5b16db(0xc4)](_0x5b16db(0xa0)),console['error'](_0x5b16db(0xa8)+_0x3f58ab[_0x5b16db(0xd5)]),await handleSDKOutput([_0x3f58ab],_0x422e50),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x2f10fb(0xef)]=a26_0x2f10fb(0xf1);[a26_0x2f10fb(0xdc)]=a26_0x2f10fb(0xd0);['validate'](_0x529e1b){const _0x21b63a=a26_0x2f10fb,_0x1f3ea0=_0x529e1b[_0x21b63a(0xe9)][0x0];if(!_0x1f3ea0)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x2f10fb(0xae)](_0x10768f){const _0x3fd7a0=a26_0x2f10fb,{options:_0x44ad3d,args:_0x5597c5,tdx:_0x253cec}=_0x10768f,_0x4ad3c4=_0x5597c5[0x0],_0x489315=await withSpinner(_0x3fd7a0(0xc1),()=>_0x253cec[_0x3fd7a0(0xbf)][_0x3fd7a0(0xda)](_0x4ad3c4),{'verbose':_0x44ad3d[_0x3fd7a0(0xd2)]}),_0x49540c=_0x489315[_0x3fd7a0(0xea)];return console[_0x3fd7a0(0xc4)](_0x3fd7a0(0xb4)+_0x49540c[_0x3fd7a0(0x99)]+_0x3fd7a0(0xa6)+(_0x49540c['length']!==0x1?'s':'')),await handleSDKOutput(_0x49540c,_0x44ad3d),0x0;}}
1
+ const a29_0x3a2ccf=a29_0x343c;(function(_0x53330a,_0x2dd3cc){const _0x3e49d2=a29_0x343c,_0x5a13ba=_0x53330a();while(!![]){try{const _0x1c5119=parseInt(_0x3e49d2(0x1be))/0x1+parseInt(_0x3e49d2(0x1a7))/0x2+-parseInt(_0x3e49d2(0x1ef))/0x3+parseInt(_0x3e49d2(0x1ee))/0x4+parseInt(_0x3e49d2(0x1d5))/0x5+-parseInt(_0x3e49d2(0x1bf))/0x6*(-parseInt(_0x3e49d2(0x198))/0x7)+-parseInt(_0x3e49d2(0x1e9))/0x8;if(_0x1c5119===_0x2dd3cc)break;else _0x5a13ba['push'](_0x5a13ba['shift']());}catch(_0x1b094a){_0x5a13ba['push'](_0x5a13ba['shift']());}}}(a29_0x3c8e,0xa197d));import{BaseCommand}from'./command.js';function a29_0x343c(_0x49134c,_0x5c92a6){_0x49134c=_0x49134c-0x196;const _0x3c8e4c=a29_0x3c8e();let _0x343cc3=_0x3c8e4c[_0x49134c];return _0x343cc3;}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a29_0x316307 from'chalk';function formatDuration(_0x1ad8c8){const _0x5b1035=a29_0x343c;if(_0x1ad8c8<0x3c)return _0x1ad8c8+'s';if(_0x1ad8c8<0xe10)return Math[_0x5b1035(0x1ea)](_0x1ad8c8/0x3c)+'m\x20'+_0x1ad8c8%0x3c+'s';const _0x47f6b6=Math['floor'](_0x1ad8c8/0xe10),_0x3df80b=Math['floor'](_0x1ad8c8%0xe10/0x3c);return _0x3df80b>0x0?_0x47f6b6+'h\x20'+_0x3df80b+'m':_0x47f6b6+'h';}function a29_0x3c8e(){const _0x4aca0b=['file','name','description','Submit\x20a\x20job','jobs','\x20\x20Job\x20ID:\x20','Submitting\x20kill\x20request...','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','execute','mo\x20ago','presto','\x20row','5314220mNPcwj','Cancelled','Getting\x20job\x20results...','just\x20now','query','Getting\x20job\x20details...','status','show','substring','result','\x20jobs','✔\x20Found\x20','job_id','h\x20ago','debug','Limit:\x20','now','Database:\x20','verbose','submit','14030008TGJeEI','floor','...','priority','error','2866032zWeYbZ','3637968HJzmWS','join','✔\x20Job\x20submitted','2744CHiMMW','list','getTime','List\x20jobs','site','end_at','INVALID_ARGUMENT','job:result','map','user_name','length','hive','kill','created_at','validate','537470zdLsaf','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','job:kill','data','dim','success','Kill\x20a\x20job','Query:\x20','push','information_schema','Get\x20job\x20results','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','start_at','trino','limit','args','Job\x20type:\x20','No\x20SQL\x20statements\x20found\x20in\x20file','job:submit','type','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','jobType','672333kgQerj','13896Mltwxi','round','red','✔\x20Retrieved\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','database','url','\x27\x20to\x20verify\x20the\x20job\x20status','Status\x20filter:\x20','log'];a29_0x3c8e=function(){return _0x4aca0b;};return a29_0x3c8e();}function formatRelativeTime(_0x320142){const _0x5b4d97=a29_0x343c,_0x494408=Date[_0x5b4d97(0x1e5)]()-_0x320142[_0x5b4d97(0x19a)](),_0xf14f6d=Math[_0x5b4d97(0x1ea)](Math['abs'](_0x494408)/0x3e8);if(_0xf14f6d<0x3c)return _0x5b4d97(0x1d8);const _0x286750=Math[_0x5b4d97(0x1ea)](_0xf14f6d/0x3c);if(_0x286750<0x3c)return _0x286750+'m\x20ago';const _0x2e65f6=Math[_0x5b4d97(0x1ea)](_0x286750/0x3c);if(_0x2e65f6<0x18)return _0x2e65f6+_0x5b4d97(0x1e2);const _0x58553a=Math[_0x5b4d97(0x1ea)](_0x2e65f6/0x18);if(_0x58553a<0x1e)return _0x58553a+'d\x20ago';return Math[_0x5b4d97(0x1ea)](_0x58553a/0x1e)+_0x5b4d97(0x1d2);}export class JobListCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x1cd);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x19b);async['execute'](_0x8d1a7c){const _0x14d478=a29_0x3a2ccf,{options:_0x385f70,tdx:_0x4c4808}=_0x8d1a7c,_0x1ecedb=resolveLimit(_0x385f70[_0x14d478(0x1b6)],DEFAULT_DISPLAY_LIMIT),_0x1718cb=_0x385f70['status'];_0x385f70[_0x14d478(0x1e7)]&&(console['error'](_0x14d478(0x1e4)+_0x1ecedb+_0x14d478(0x1df)),_0x1718cb&&console['error'](_0x14d478(0x1c7)+_0x1718cb));const _0x5ade98=await withSpinner('Listing\x20jobs...',()=>_0x4c4808['jobs'][_0x14d478(0x199)]({'from':0x0,'to':_0x1ecedb-0x1,'status':_0x1718cb}),{'verbose':_0x385f70[_0x14d478(0x1e7)]}),_0x14af25=_0x5ade98['data'];console[_0x14d478(0x1ed)](_0x14d478(0x1e0)+_0x14af25[_0x14d478(0x1a2)]+'\x20job'+(_0x14af25[_0x14d478(0x1a2)]!==0x1?'s':''));const _0x5174a9=_0x385f70[_0x14d478(0x19c)];if(isStructuredFormat(_0x385f70)){const _0x1a1835=_0x14af25[_0x14d478(0x1a0)](_0x76d9da=>{const _0x5c6423=_0x14d478;let _0x5bf23e;if(_0x76d9da[_0x5c6423(0x1b4)]&&_0x76d9da[_0x5c6423(0x19d)]){const _0x47fc17=new Date(_0x76d9da[_0x5c6423(0x1b4)])[_0x5c6423(0x19a)](),_0x1e509e=new Date(_0x76d9da[_0x5c6423(0x19d)])['getTime']();_0x5bf23e=Math['round']((_0x1e509e-_0x47fc17)/0x3e8);}return{'job_id':_0x76d9da['job_id'],'type':_0x76d9da[_0x5c6423(0x1bb)]===_0x5c6423(0x1d3)?_0x5c6423(0x1b5):_0x76d9da[_0x5c6423(0x1bb)],'status':_0x76d9da['status'],'user_name':_0x76d9da['user_name'],'duration_sec':_0x5bf23e,'created_at':_0x76d9da[_0x5c6423(0x1a5)],'started_at':_0x76d9da[_0x5c6423(0x1b4)],'end_at':_0x76d9da[_0x5c6423(0x19d)]};});await handleSDKOutput(_0x1a1835,_0x385f70);}else for(const _0x48497e of _0x14af25){const _0x1d8151=_0x48497e[_0x14d478(0x1db)]===_0x14d478(0x1ad)?a29_0x316307['green']:_0x48497e[_0x14d478(0x1db)]==='error'?a29_0x316307[_0x14d478(0x1c1)]:a29_0x316307['dim'],_0x23046b=_0x1d8151(_0x48497e[_0x14d478(0x1db)]),_0x1bf4f8=getJobUrl(_0x5174a9,_0x48497e['job_id']),_0x4e3840=hyperlink(_0x48497e[_0x14d478(0x1e1)],_0x1bf4f8),_0x3603d8=a29_0x316307[_0x14d478(0x1ac)](_0x48497e[_0x14d478(0x1bb)]===_0x14d478(0x1d3)?'trino':_0x48497e[_0x14d478(0x1bb)]),_0xca5d68=[];if(_0x48497e[_0x14d478(0x1b4)]&&_0x48497e[_0x14d478(0x19d)]){const _0x481f95=Math[_0x14d478(0x1c0)]((new Date(_0x48497e[_0x14d478(0x19d)])['getTime']()-new Date(_0x48497e[_0x14d478(0x1b4)])[_0x14d478(0x19a)]())/0x3e8);_0xca5d68['push'](formatDuration(_0x481f95));}if(_0x48497e[_0x14d478(0x19d)])_0xca5d68['push'](formatRelativeTime(new Date(_0x48497e[_0x14d478(0x19d)])));else _0x48497e['start_at']&&_0xca5d68[_0x14d478(0x1b0)](formatRelativeTime(new Date(_0x48497e['start_at'])));const _0x2f0db3=_0xca5d68['length']>0x0?a29_0x316307[_0x14d478(0x1ac)]('\x20'+_0xca5d68[_0x14d478(0x196)](',\x20')):'';console[_0x14d478(0x1c8)]('⚡\x20'+_0x4e3840+'\x20'+_0x3603d8+'\x20'+_0x23046b+_0x2f0db3);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']='job:show';['description']='Show\x20job\x20details';['validate'](_0x568cac){const _0x5f2caf=a29_0x3a2ccf,_0x110c5b=_0x568cac[_0x5f2caf(0x1b7)][0x0];if(!_0x110c5b)return _0x5f2caf(0x1a9);return undefined;}async[a29_0x3a2ccf(0x1d1)](_0x4db17e){const _0x17f4f8=a29_0x3a2ccf,{options:_0xf319a8,args:_0x42edc6,tdx:_0x35e18f}=_0x4db17e,_0x41ee62=_0x42edc6[0x0],_0x498f24=await withSpinner(_0x17f4f8(0x1da),()=>_0x35e18f['jobs'][_0x17f4f8(0x1dc)](_0x41ee62),{'verbose':_0xf319a8['verbose']}),_0x5d2c28=_0x498f24['data'];let _0x232d9b;if(_0x5d2c28[_0x17f4f8(0x1b4)]&&_0x5d2c28[_0x17f4f8(0x19d)]){const _0x23eccd=new Date(_0x5d2c28[_0x17f4f8(0x1b4)])[_0x17f4f8(0x19a)](),_0x558caa=new Date(_0x5d2c28[_0x17f4f8(0x19d)])[_0x17f4f8(0x19a)]();_0x232d9b=Math['round']((_0x558caa-_0x23eccd)/0x3e8);}const _0x3eeba0={'job_id':_0x5d2c28['job_id'],'type':_0x5d2c28[_0x17f4f8(0x1bb)],'status':_0x5d2c28[_0x17f4f8(0x1db)],..._0x5d2c28['user_name']&&{'user_name':_0x5d2c28[_0x17f4f8(0x1a1)]},..._0x232d9b!==undefined&&{'duration_sec':_0x232d9b},..._0x5d2c28[_0x17f4f8(0x1a5)]&&{'created_at':_0x5d2c28[_0x17f4f8(0x1a5)]},..._0x5d2c28[_0x17f4f8(0x1b4)]&&{'started_at':_0x5d2c28[_0x17f4f8(0x1b4)]},..._0x5d2c28[_0x17f4f8(0x19d)]&&{'end_at':_0x5d2c28[_0x17f4f8(0x19d)]},..._0x5d2c28[_0x17f4f8(0x1c4)]&&{'database':_0x5d2c28[_0x17f4f8(0x1c4)]},..._0x5d2c28[_0x17f4f8(0x1ec)]!==undefined&&{'priority':_0x5d2c28['priority']},..._0x5d2c28['url']&&{'url':_0x5d2c28[_0x17f4f8(0x1c5)]},..._0x5d2c28['query']&&{'query':_0x5d2c28[_0x17f4f8(0x1d9)]},..._0x5d2c28[_0x17f4f8(0x1e3)]&&{'debug':_0x5d2c28[_0x17f4f8(0x1e3)]}};return await handleSingleObjectOutput(_0x3eeba0,_0xf319a8),0x0;}}export class JobKillCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x1aa);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x1ae);['validate'](_0xe351e5){const _0x43529d=a29_0x3a2ccf,_0x45ab81=_0xe351e5['args'][0x0];if(!_0x45ab81)return _0x43529d(0x1a8);return undefined;}async[a29_0x3a2ccf(0x1d1)](_0x4cdc03){const _0x25b238=a29_0x3a2ccf,{options:_0x2dffca,args:_0x284e03,tdx:_0x2417c9}=_0x4cdc03,_0x228140=_0x284e03[0x0];if(!_0x2dffca['yes']){const _0x2ae362=await confirm(_0x25b238(0x1b3)+_0x228140+'?');if(!_0x2ae362)return console[_0x25b238(0x1ed)](_0x25b238(0x1d6)),0x0;}return await withSpinner(_0x25b238(0x1cf),()=>_0x2417c9[_0x25b238(0x1cd)][_0x25b238(0x1a4)](_0x228140),{'verbose':_0x2dffca[_0x25b238(0x1e7)]}),console[_0x25b238(0x1ed)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x228140),console[_0x25b238(0x1ed)](_0x25b238(0x1c3)+_0x228140+_0x25b238(0x1c6)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x1ba);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x1cc);async[a29_0x3a2ccf(0x1d1)](_0x3976ab){const _0x5db9c1=a29_0x3a2ccf,{options:_0x4b815b,args:_0x17c9f3,tdx:_0x4eab63}=_0x3976ab,_0x55794c=_0x4b815b[_0x5db9c1(0x1bd)]||_0x5db9c1(0x1b5),_0x1db0b9=_0x4b815b[_0x5db9c1(0x1c9)],_0x309345=_0x4b815b['database']||_0x5db9c1(0x1b1),_0x57b04b=_0x4b815b['result'];if(_0x55794c!==_0x5db9c1(0x1b5)&&_0x55794c!==_0x5db9c1(0x1a3))throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],_0x5db9c1(0x1bc));let _0x35d940;if(_0x1db0b9){if(_0x17c9f3[0x0])throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],_0x5db9c1(0x1d0));const _0x91e00f=readSqlStatementsFromFile(_0x1db0b9);if(_0x91e00f[_0x5db9c1(0x1a2)]===0x0)throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],_0x5db9c1(0x1b9));if(_0x91e00f['length']>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x35d940=_0x91e00f[0x0];}else{if(!_0x17c9f3[0x0])throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x35d940=_0x17c9f3[0x0];}_0x4b815b[_0x5db9c1(0x1e7)]&&(console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1b8)+_0x55794c),console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1e6)+_0x309345),console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1af)+_0x35d940[_0x5db9c1(0x1dd)](0x0,0x64)+(_0x35d940[_0x5db9c1(0x1a2)]>0x64?_0x5db9c1(0x1eb):'')));const _0xad66ec=await withSpinner('Submitting\x20job...',()=>_0x4eab63[_0x5db9c1(0x1cd)][_0x5db9c1(0x1e8)](_0x309345,_0x35d940,_0x55794c,_0x57b04b),{'verbose':_0x4b815b[_0x5db9c1(0x1e7)]}),_0x307742=_0xad66ec[_0x5db9c1(0x1ab)];return console[_0x5db9c1(0x1ed)](_0x5db9c1(0x197)),console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1ce)+_0x307742[_0x5db9c1(0x1e1)]),await handleSDKOutput([_0x307742],_0x4b815b),0x0;}}export class JobResultCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x19f);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x1b2);[a29_0x3a2ccf(0x1a6)](_0xe17f98){const _0x3c9e69=a29_0x3a2ccf,_0x24dfad=_0xe17f98[_0x3c9e69(0x1b7)][0x0];if(!_0x24dfad)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a29_0x3a2ccf(0x1d1)](_0x451722){const _0x6c7dbb=a29_0x3a2ccf,{options:_0x30f8e5,args:_0x32ad4a,tdx:_0x1f9364}=_0x451722,_0x13dd75=_0x32ad4a[0x0],_0x5f1935=await withSpinner(_0x6c7dbb(0x1d7),()=>_0x1f9364['jobs'][_0x6c7dbb(0x1de)](_0x13dd75),{'verbose':_0x30f8e5['verbose']}),_0x5991f8=_0x5f1935[_0x6c7dbb(0x1ab)];return console[_0x6c7dbb(0x1ed)](_0x6c7dbb(0x1c2)+_0x5991f8['length']+_0x6c7dbb(0x1d4)+(_0x5991f8['length']!==0x1?'s':'')),await handleSDKOutput(_0x5991f8,_0x30f8e5),0x0;}}
@@ -1 +1 @@
1
- const a27_0x11bc0d=a27_0x39d5;(function(_0x60c9af,_0x3d4492){const _0x5a47ea=a27_0x39d5,_0x139784=_0x60c9af();while(!![]){try{const _0x55d8bb=-parseInt(_0x5a47ea(0x1ac))/0x1*(-parseInt(_0x5a47ea(0x1f2))/0x2)+-parseInt(_0x5a47ea(0x233))/0x3+parseInt(_0x5a47ea(0x1f1))/0x4*(parseInt(_0x5a47ea(0x1be))/0x5)+-parseInt(_0x5a47ea(0x29b))/0x6*(-parseInt(_0x5a47ea(0x25e))/0x7)+-parseInt(_0x5a47ea(0x26a))/0x8*(-parseInt(_0x5a47ea(0x275))/0x9)+parseInt(_0x5a47ea(0x24c))/0xa+-parseInt(_0x5a47ea(0x206))/0xb;if(_0x55d8bb===_0x3d4492)break;else _0x139784['push'](_0x139784['shift']());}catch(_0x541ba3){_0x139784['push'](_0x139784['shift']());}}}(a27_0x4ef5,0x20fac));import a27_0x503b10 from'chalk';import a27_0x5a60d6 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,getWorkflowSessionUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x43df00){const _0x3de01a=a27_0x39d5;return!_0x43df00&&(console['error'](_0x3de01a(0x235)),console['error'](_0x3de01a(0x18e))),!!_0x43df00;}function withJsonFormat(_0x3fec20){const _0x20098c=a27_0x39d5;if(!_0x3fec20[_0x20098c(0x1b6)]&&!_0x3fec20[_0x20098c(0x172)]&&!_0x3fec20[_0x20098c(0x223)]&&!_0x3fec20[_0x20098c(0x193)])return{..._0x3fec20,'format':'json','json':!![]};return _0x3fec20;}function formatJourneyState(_0x76f7bc){const _0x37b77a=a27_0x39d5;switch(_0x76f7bc){case'launched':return a27_0x503b10['green'](_0x37b77a(0x260));case _0x37b77a(0x216):return a27_0x503b10[_0x37b77a(0x257)](_0x37b77a(0x1f6));case'paused':return a27_0x503b10[_0x37b77a(0x243)](_0x37b77a(0x242));case _0x37b77a(0x1cc):return a27_0x503b10[_0x37b77a(0x291)](_0x37b77a(0x20c));case _0x37b77a(0x189):return a27_0x503b10[_0x37b77a(0x257)](_0x37b77a(0x1a4));default:return'('+_0x76f7bc+')';}}function formatJourneyItem(_0x5b484f,_0x54ef37='',_0x2020a2){const _0x1bd692=a27_0x39d5,_0x3419f5=formatJourneyState(_0x5b484f[_0x1bd692(0x17f)]),_0x40b8c4=_0x2020a2?hyperlink(_0x5b484f[_0x1bd692(0x27f)],_0x2020a2):_0x5b484f[_0x1bd692(0x27f)];return _0x54ef37+_0x1bd692(0x202)+_0x40b8c4+'\x20'+_0x3419f5;}function escapeRegex(_0x420572){const _0x29509c=a27_0x39d5;return _0x420572[_0x29509c(0x1fd)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x7fdaa5){const _0x2d6a=a27_0x39d5,_0x30e12b=_0x7fdaa5['split']('*')[_0x2d6a(0x184)](escapeRegex);return new RegExp(_0x30e12b[_0x2d6a(0x1cf)]('.*'),'i');}function a27_0x39d5(_0x41f031,_0x2982ae){_0x41f031=_0x41f031-0x16f;const _0x4ef5f4=a27_0x4ef5();let _0x39d578=_0x4ef5f4[_0x41f031];return _0x39d578;}function buildRuleToNameMapping(_0x473418){const _0x21223e=a27_0x39d5,_0x4f9632=new Map();if(_0x473418[_0x21223e(0x187)])for(const [_0x275cba,_0x10ecea]of Object[_0x21223e(0x296)](_0x473418[_0x21223e(0x187)])){if(_0x10ecea['rule']){const _0x6a7825=serializeRule(_0x10ecea['rule']),_0x3430dd=_0x4f9632[_0x21223e(0x237)](_0x6a7825);_0x3430dd?_0x3430dd[_0x21223e(0x213)](_0x275cba):_0x4f9632[_0x21223e(0x1fb)](_0x6a7825,[_0x275cba]);}}return _0x4f9632;}function a27_0x4ef5(){const _0x5ea418=['relative','run','journey:resume','set','version','replace','Error:\x20--version\x20option\x20is\x20required','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','red','rootFolderId','🗺️\x20','verbose','isNew','\x20\x20Target:\x20','2344639dtihrc','from','getSegment','\x20\x20Journey\x20ID:\x20','getLatestJourneyId','Pause\x20a\x20running\x20journey','(completed)','journeyId','journey:versions','runAt','all','history','resolveSegment','push','Pausing\x20journey...','listJourneysFromParentSegment','draft','exitOrJumpRate','conversion','exitOrJumpSize','Error:\x20Journey\x20\x27','\x20versions)','targetDir','stageNameMap','\x20files?','\x20\x20Parent\x20segment:\x20','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','journeyStages','\x20\x20-\x20','jsonl','Resolving\x20version...','name','\x20[runs\x20on\x20refresh]','paused','segmentPushCommand','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','(unnamed)','connection\x20','activationParams','getJourney','Getting\x20journey\x20statistics...','Activations:','\x20(rule\x20match)','journey:run','\x22\x20paused','601581SfgjKO','Resolving\x20journey...','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','⚠️\x20','get','Journey:','\x20\x20Statistics\x20not\x20available','resolveParentId','📁\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','-\x20no\x20files\x20written','...','dryRun','table','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','(paused)','yellow','yes','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','log','tdx.json','completeMilestoneRate','options','journeyBundleId','getActivation','2317170sVGOuv','✔\x20Pulled\x20','Journey\x20name:\x20','setPhase','Aborted.','columns','Folder\x20path:\x20','listVersions','Fetching\x20journeys\x20and\x20folders...','Warning:\x20Could\x20not\x20resolve\x20activation\x20','buildIdToEmailMap','dim','helpText','journey:push','journeyName','size','segment','Show\x20journey\x20details','94479ypDenS','Getting\x20journey\x20details...','(running)','List\x20activations\x20for\x20a\x20journey','stages','journey:columns','utf-8','milestoneSize','.journey.yml','Fetching\x20users\x20and\x20connections...',',\x20schedule:\x20','View\x20a\x20specific\x20version\x20of\x20a\x20journey','87432eJSwyq','folders','kind','limit','✔\x20Found\x20','listFolders','No\x20statistics\x20available\x20for\x20journey:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','filePath','9ASBZsx','List\x20all\x20versions\x20of\x20a\x20journey','Available\x20stages:\x20','\x20journeys','message','base','Export\x20journey(s)\x20as\x20YAML\x20files','✔\x20Context\x20set:\x20','executeDryRun','errorCode','journeyBundleName','Error:\x20Invalid\x20version\x20number:\x20','description','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journey:traffic','completionRate','/j/da/je','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','green','filter','sort','\x20@\x20','Paused\x20at:','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Fetching\x20journey\x20','Resume\x20a\x20paused\x20journey','createdAt','error','blue','INVALID_ARGUMENT','\x20journey\x20files\x20to\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','workflowSessionId','entries','/e/','has','Parent\x20segment:\x20','getColumnMapping','6ZWHMPB','\x20details...','connection','No\x20journeys\x20found','ID:','createVersion','journey:pull','listActivationsFlat','no\x20connection','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','values','hasChanges','site','folderId','Trigger\x20on-demand\x20journey\x20workflow\x20execution','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journey:view','audienceId','toLowerCase','relativePath','json','length','includeHistory','enteredSize','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','execute','segmentName','Paused:','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','user','file','Triggering\x20journey\x20workflow...','state','Resolving\x20parent\x20segment...','hasPeriod','links','\x0aError:','map','connectionId','stage','segments','absolutePath','archived','parent_segment','session','versionNumber','(root)','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20\x20←\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','pause','\x20->\x20','tsv','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','Cancelled','journey:pause','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','cwd','getStatistics','Target\x20directory:\x20','cyan','goalSize','\x20\x20Consolidating\x20duplicate\x20segment:\x20','add','Creating\x20new\x20version...','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journey','bold','type','(archived)','Write\x20','Error:\x20','Listing\x20journeys...','Options:','test','Error:\x20Version\x20','\x20not\x20found.\x20Available:\x20','26291SgBLTI','Getting\x20column\x20mapping...','pausedAt','Show\x20journey\x20table\x20column\x20mapping','folderPath','\x20Created\x20v','rule','activation','Fetching\x20','Pattern:\x20','format','\x20Opening\x20','resume','\x20=\x20','\x20Journey\x20workflow\x20started','Resuming\x20journey...','Session:','listJourneysWithFolders','2435svBmzF','renderStats','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','Database:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20activation','Status:','Table:\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','data','goal','localeCompare','nodes','Error:\x20Stage\x20\x22','completed','stringify','parentSegment','join','State:','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','/app/ps/','\x20journey','runAfterJourneyRefresh','repeat','(none)','scheduleType','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','attributes','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','web','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','workflowId','\x22\x20resumed','connector_config','Listing\x20journey\x20versions...','journey:activations','journey:version:create','Error:\x20Invalid\x20--type\x20\x22','Stages:','Found\x20','database','getParentFull','Input:\x20','journey:version:view','find','✔\x20Journey\x20\x22','buildIdToNameMap','updatedAt','status','includeStats','\x20\x20Name:\x20','244LnqmHL','20SpDROu','Parent\x20segment\x20ID:','journeys','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','(draft)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure'];a27_0x4ef5=function(){return _0x5ea418;};return a27_0x4ef5();}async function resolveJourneyIdFromInput(_0x5cc642,_0x960da2,_0x3f639e){const _0x8c391e=a27_0x39d5,_0xe5bb5e=await resolveJourneyTarget(_0x5cc642,_0x960da2[_0x8c391e(0x1ce)],_0x960da2['verbose']),_0x230bb9=_0xe5bb5e['parentSegment'];if(!_0x230bb9)throw new SDKError(ErrorCode[_0x8c391e(0x292)],_0x8c391e(0x229));const _0x2059d9=await withSpinner(_0x8c391e(0x180),()=>_0x3f639e[_0x8c391e(0x25c)][_0x8c391e(0x23a)](_0x230bb9),{'verbose':_0x960da2[_0x8c391e(0x203)]}),_0x26ff22=_0x2059d9['data'],_0x2bbd67=await withSpinner(_0x8c391e(0x234),()=>_0x3f639e[_0x8c391e(0x1a1)]['resolveJourneyId'](_0x26ff22,_0xe5bb5e['journeyName']),{'verbose':_0x960da2['verbose']});return{'journeyId':_0x2bbd67['data'],'journeyName':_0xe5bb5e[_0x8c391e(0x25a)],'parentSegmentId':_0x26ff22};}async function resolveJourneyTarget(_0x598586,_0x3e85b3,_0x4724f9){const _0x3dbe6b=a27_0x39d5;if(isYamlFilePath(_0x598586))try{const _0x5c0bd6=await resolveYamlFilePath(_0x598586);return _0x4724f9&&(console[_0x3dbe6b(0x290)]('Resolved\x20YAML\x20file:\x20'+_0x598586),console[_0x3dbe6b(0x290)](_0x3dbe6b(0x21f)+_0x5c0bd6[_0x3dbe6b(0x1ce)]),console[_0x3dbe6b(0x290)](_0x3dbe6b(0x1f0)+_0x5c0bd6['segmentName']),console[_0x3dbe6b(0x290)]('\x20\x20Folder\x20path:\x20'+(_0x5c0bd6['folderPath']||_0x3dbe6b(0x18d)))),{'journeyName':_0x5c0bd6[_0x3dbe6b(0x178)],'parentSegment':_0x5c0bd6[_0x3dbe6b(0x1ce)],'resolved':_0x5c0bd6};}catch(_0x2b7e34){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3dbe6b(0x241)+_0x2b7e34['message']);}if(!_0x3e85b3)throw new SDKError(ErrorCode[_0x3dbe6b(0x292)],_0x3dbe6b(0x190));return{'journeyName':_0x598586,'parentSegment':_0x3e85b3};}export class JourneyListCommand extends BaseCommand{[a27_0x11bc0d(0x225)]='journey:list';[a27_0x11bc0d(0x281)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x11bc0d(0x177)](_0x3b3c26){const _0x383604=a27_0x11bc0d,{options:_0x202aa9,args:_0x1f29da,tdx:_0x1ed258}=_0x3b3c26,_0x1e75de=_0x1f29da[0x0],_0x16a219=_0x202aa9[_0x383604(0x1ce)];if(!_0x16a219)return console[_0x383604(0x290)]('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0x383604(0x1d8)),0x1;const _0x560e88=await withSpinner(_0x383604(0x180),()=>_0x1ed258['segment'][_0x383604(0x23a)](_0x16a219),{'verbose':_0x202aa9[_0x383604(0x203)]}),_0x2b6b3b=_0x560e88[_0x383604(0x1c7)];_0x202aa9[_0x383604(0x203)]&&(console[_0x383604(0x290)](_0x383604(0x299)+_0x16a219+'\x20(ID:\x20'+_0x2b6b3b+')'),_0x1e75de&&console[_0x383604(0x290)](_0x383604(0x1b5)+_0x1e75de));const _0x548918=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x1ed258[_0x383604(0x25c)][_0x383604(0x1e7)](_0x2b6b3b),{'verbose':_0x202aa9[_0x383604(0x203)]}),_0x32ec2e=_0x548918[_0x383604(0x1c7)],_0x36f9ef=_0x32ec2e[_0x383604(0x201)],_0x373a80=await withSpinner(_0x383604(0x1a7),()=>_0x1ed258[_0x383604(0x1a1)][_0x383604(0x1bd)](_0x2b6b3b,_0x36f9ef),{'verbose':_0x202aa9[_0x383604(0x203)]});let _0x379dcd=_0x373a80['data'][_0x383604(0x1f4)];const _0x237c2d=_0x373a80[_0x383604(0x1c7)][_0x383604(0x26b)],_0x26a28f=new Map();for(const _0x41e0b1 of _0x237c2d){_0x26a28f['set'](_0x41e0b1['id'],_0x41e0b1[_0x383604(0x225)]);}if(_0x1e75de){const _0x3541d6=globToRegex(_0x1e75de);_0x379dcd=_0x379dcd[_0x383604(0x288)](_0x53850d=>_0x3541d6[_0x383604(0x1a9)](_0x53850d[_0x383604(0x27f)]));}console['error'](_0x383604(0x26e)+_0x379dcd[_0x383604(0x173)]+_0x383604(0x1d3)+(_0x379dcd[_0x383604(0x173)]!==0x1?'s':''));const _0x58b789=_0x10b511=>{const _0x2fb9c7=_0x383604;return getConsoleNextUrl(_0x202aa9[_0x2fb9c7(0x2a7)],_0x2fb9c7(0x1d2)+_0x2b6b3b+_0x2fb9c7(0x297)+_0x10b511+'/j/da');};if(_0x202aa9[_0x383604(0x1b6)]===_0x383604(0x240))await handleSDKOutput(_0x379dcd,_0x202aa9);else{if(_0x202aa9['format']===_0x383604(0x172)){const _0x2e546d=_0x379dcd[_0x383604(0x184)](_0x2f9242=>({..._0x2f9242,'url':_0x58b789(_0x2f9242['id'])}));await handleSDKOutput(_0x2e546d,_0x202aa9);}else{console['log']('['+_0x16a219+']');const _0x45a6c8=new Map(),_0x1312ce=[];for(const _0x439f1a of _0x379dcd){if(!_0x439f1a[_0x383604(0x2a8)]||_0x439f1a['folderId']===_0x36f9ef)_0x1312ce[_0x383604(0x213)](_0x439f1a);else{const _0x4311a4=_0x45a6c8[_0x383604(0x237)](_0x439f1a[_0x383604(0x2a8)])||[];_0x4311a4['push'](_0x439f1a),_0x45a6c8[_0x383604(0x1fb)](_0x439f1a['folderId'],_0x4311a4);}}const _0x394999=(_0x21a0b5,_0x458db0)=>_0x21a0b5[_0x383604(0x27f)][_0x383604(0x1c9)](_0x458db0[_0x383604(0x27f)],undefined,{'sensitivity':_0x383604(0x27a)});_0x1312ce[_0x383604(0x289)](_0x394999);for(const _0x4e737f of _0x1312ce){console[_0x383604(0x246)](formatJourneyItem(_0x4e737f,'',_0x58b789(_0x4e737f['id'])));}const _0x5f2c13=[..._0x45a6c8[_0x383604(0x296)]()][_0x383604(0x289)]((_0x40f977,_0x14a590)=>{const _0x1e9bf2=_0x383604,_0x3c56e8=_0x26a28f[_0x1e9bf2(0x237)](_0x40f977[0x0])||_0x40f977[0x0],_0xc8dd6e=_0x26a28f[_0x1e9bf2(0x237)](_0x14a590[0x0])||_0x14a590[0x0];return _0x3c56e8[_0x1e9bf2(0x1c9)](_0xc8dd6e,undefined,{'sensitivity':_0x1e9bf2(0x27a)});});for(const [_0x209f5f,_0x5f1205]of _0x5f2c13){const _0x85cab0=_0x26a28f[_0x383604(0x237)](_0x209f5f)||_0x209f5f;console[_0x383604(0x246)](_0x383604(0x23b)+_0x85cab0),_0x5f1205[_0x383604(0x289)](_0x394999);for(const _0x1c1c2e of _0x5f1205){console[_0x383604(0x246)](formatJourneyItem(_0x1c1c2e,'\x20\x20',_0x58b789(_0x1c1c2e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x2ab);['description']=a27_0x11bc0d(0x25d);async[a27_0x11bc0d(0x177)](_0x13835a){const _0x2b5c41=a27_0x11bc0d,{options:_0xd1bde1,args:_0x3f7831,tdx:_0x36555e}=_0x13835a,_0x523fc5=_0x3f7831[0x0];if(!_0x523fc5)return console[_0x2b5c41(0x290)](_0x2b5c41(0x235)),console['error']('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x2b5c41(0x290)](_0x2b5c41(0x1a8)),console[_0x2b5c41(0x290)](_0x2b5c41(0x286)),0x1;_0xd1bde1[_0x2b5c41(0x203)]&&console[_0x2b5c41(0x290)](_0x2b5c41(0x1e8)+_0x523fc5);const {journeyId:_0x35479c,parentSegmentId:_0x400768}=await resolveJourneyIdFromInput(_0x523fc5,_0xd1bde1,_0x36555e);if(_0xd1bde1[_0x2b5c41(0x1db)]){const _0x3d3275=getConsoleNextUrl(_0xd1bde1['site'],_0x2b5c41(0x1d2)+_0x400768+_0x2b5c41(0x297)+_0x35479c+_0x2b5c41(0x285));return console[_0x2b5c41(0x290)](a27_0x503b10[_0x2b5c41(0x287)]('✔')+_0x2b5c41(0x1b7)+a27_0x503b10[_0x2b5c41(0x19b)](_0x3d3275)),openBrowser(_0x3d3275),0x0;}const _0x17b18d=await withSpinner(_0x2b5c41(0x25f),()=>_0x36555e[_0x2b5c41(0x1a1)][_0x2b5c41(0x22d)](_0x35479c),{'verbose':_0xd1bde1['verbose']}),_0x1f2446=_0x17b18d['data'],_0x423ca6=_0xd1bde1[_0x2b5c41(0x1ef)];let _0xaa01ca;if(_0x423ca6)try{const _0x28ed00=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x36555e[_0x2b5c41(0x1a1)][_0x2b5c41(0x199)](_0x35479c),{'verbose':_0xd1bde1['verbose']});_0xaa01ca=_0x28ed00[_0x2b5c41(0x1c7)];}catch{_0xd1bde1[_0x2b5c41(0x203)]&&console['error'](_0x2b5c41(0x239));}const _0x452206=getConsoleNextUrl(_0xd1bde1[_0x2b5c41(0x2a7)],_0x2b5c41(0x1d2)+_0x400768+_0x2b5c41(0x297)+_0x35479c+_0x2b5c41(0x285)),_0x4701ad={'id':_0x1f2446['id'],'name':_0x1f2446[_0x2b5c41(0x1d9)]['name'],'description':_0x1f2446[_0x2b5c41(0x1d9)][_0x2b5c41(0x281)],'state':_0x1f2446[_0x2b5c41(0x1d9)][_0x2b5c41(0x17f)],'paused':_0x1f2446[_0x2b5c41(0x1d9)][_0x2b5c41(0x227)],'reentry_mode':_0x1f2446[_0x2b5c41(0x1d9)]['reentryMode'],'stages':_0x1f2446['attributes'][_0x2b5c41(0x221)]?.[_0x2b5c41(0x173)]||0x0,..._0x1f2446[_0x2b5c41(0x1d9)][_0x2b5c41(0x1c8)]&&{'goal':_0x1f2446[_0x2b5c41(0x1d9)][_0x2b5c41(0x1c8)][_0x2b5c41(0x225)]},..._0xaa01ca&&{'statistics':{'size':_0xaa01ca['size'],'entered':_0xaa01ca[_0x2b5c41(0x175)],'goal_achieved':_0xaa01ca[_0x2b5c41(0x19c)],'completion_rate':_0xaa01ca[_0x2b5c41(0x284)],'exit_or_jump':_0xaa01ca[_0x2b5c41(0x219)],'exit_or_jump_rate':_0xaa01ca[_0x2b5c41(0x217)],'stages':_0xaa01ca[_0x2b5c41(0x262)]}},'url':_0x452206};return await handleSingleObjectOutput(_0x4701ad,_0xd1bde1),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x11bc0d(0x225)]='journey:stats';[a27_0x11bc0d(0x281)]='Show\x20journey\x20statistics';async[a27_0x11bc0d(0x177)](_0x3ab7b3){const _0x274627=a27_0x11bc0d,{options:_0x47c06c,args:_0x58c78c,tdx:_0x2db683}=_0x3ab7b3,_0x5cf7ec=_0x58c78c[0x0];if(!requireNameOrPath(_0x5cf7ec))return 0x1;_0x47c06c[_0x274627(0x203)]&&console[_0x274627(0x290)](_0x274627(0x1e8)+_0x5cf7ec);const _0x5c8d38=_0x47c06c,_0x2200e5=_0x5c8d38[_0x274627(0x207)],_0x12d320=_0x5c8d38['to'],_0xaa4f6f=_0x5c8d38[_0x274627(0x174)],_0x1bd727=_0x5c8d38[_0x274627(0x186)];_0xaa4f6f&&!_0x2200e5&&!_0x12d320&&console[_0x274627(0x290)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x5ccc1f=_0xaa4f6f?withJsonFormat(_0x47c06c):_0x47c06c,{journeyId:_0x334306,journeyName:_0xee44d6}=await resolveJourneyIdFromInput(_0x5cf7ec,_0x5ccc1f,_0x2db683),_0x429daa=_0x2200e5||_0x12d320?{'from':_0x2200e5,'to':_0x12d320}:undefined,_0x525813=await withSpinner(_0x274627(0x22e),()=>Promise[_0x274627(0x210)]([_0x2db683['journey'][_0x274627(0x22d)](_0x334306),_0x2db683[_0x274627(0x1a1)][_0x274627(0x199)](_0x334306,_0x429daa)]),{'verbose':_0x5ccc1f[_0x274627(0x203)]}),[_0x1f1ef6,_0x4301c0]=_0x525813[_0x274627(0x1c7)];if(!_0x4301c0||_0x4301c0['journeyId']===null)return console['error'](_0x274627(0x270)+_0xee44d6),console[_0x274627(0x290)](_0x274627(0x2a4)),0x0;const _0x11d45f=buildStageNameMap(_0x1f1ef6),_0x248e56=!!(_0x429daa&&_0x4301c0[_0x274627(0x211)]?.['length']),_0x3d46d6={'stageNameMap':_0x11d45f,'hasPeriod':_0x248e56,'includeHistory':!!_0xaa4f6f};if(_0x1bd727&&_0x4301c0[_0x274627(0x262)]){const _0x1b46e7=_0x4301c0[_0x274627(0x262)][_0x274627(0x1ea)](_0x586652=>{const _0x99bf38=_0x274627,_0x1d0b00=_0x11d45f[_0x99bf38(0x237)](_0x586652['id'])??'';return _0x1d0b00['toLowerCase']()===_0x1bd727[_0x99bf38(0x170)]();});if(_0x1b46e7)return await handleSingleObjectOutput(formatStageStats(_0x1b46e7,_0x3d46d6),_0x5ccc1f),0x0;const _0x3c2ecb=_0x4301c0[_0x274627(0x262)]['map'](_0x1be1fd=>_0x11d45f['get'](_0x1be1fd['id'])??_0x1be1fd['id']);return console[_0x274627(0x290)](_0x274627(0x1cb)+_0x1bd727+'\x22\x20not\x20found'),console[_0x274627(0x290)](_0x274627(0x277)+_0x3c2ecb[_0x274627(0x1cf)](',\x20')),0x1;}const _0x561e1c=_0x4301c0['stages']?.[_0x274627(0x184)](_0xf79499=>formatStageStats(_0xf79499,_0x3d46d6)),_0x12a98a=assembleJourneyStats(_0x4301c0,{'from':_0x2200e5,'to':_0x12d320,'includeHistory':_0xaa4f6f});return await this['renderStats'](_0x12a98a,_0x561e1c??[],_0x5ccc1f),0x0;}async[a27_0x11bc0d(0x1bf)](_0x4ea4b3,_0x34df5,_0x3c60e8){const _0x19fe08=a27_0x11bc0d,_0x10cd6b=_0x3c60e8[_0x19fe08(0x1b6)]==='json'||_0x3c60e8[_0x19fe08(0x1b6)]===_0x19fe08(0x223)||_0x3c60e8[_0x19fe08(0x172)]||_0x3c60e8[_0x19fe08(0x223)];if(_0x10cd6b){_0x4ea4b3[_0x19fe08(0x262)]=_0x34df5,await handleSingleObjectOutput(_0x4ea4b3,_0x3c60e8);return;}await handleSingleObjectOutput(_0x4ea4b3,_0x3c60e8);for(const _0x2414a2 of _0x34df5){console[_0x19fe08(0x246)](''),console[_0x19fe08(0x246)](String(a27_0x503b10['cyan'][_0x19fe08(0x1a2)]('['+_0x2414a2[_0x19fe08(0x225)]+']'))+a27_0x503b10['dim']('\x20'+_0x2414a2['id']));const {id:_0x27bf55,name:_0xe8e5fe,..._0x21c199}=_0x2414a2;await handleSingleObjectOutput(_0x21c199,_0x3c60e8);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x283);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x17a);async['execute'](_0x531fb8){const _0x1bbc6e=a27_0x11bc0d,{options:_0x3b1175,args:_0x127c32,tdx:_0x1ddf5a}=_0x531fb8,_0x121d47=_0x127c32[0x0];if(!requireNameOrPath(_0x121d47))return 0x1;_0x3b1175[_0x1bbc6e(0x203)]&&console[_0x1bbc6e(0x290)](_0x1bbc6e(0x1e8)+_0x121d47);const _0x4f16ca=_0x3b1175,_0x128f2c=_0x4f16ca['type'],_0x5675cd=_0x4f16ca[_0x1bbc6e(0x207)],_0x3ea959=_0x4f16ca['to'],_0x41ba2c=_0x4f16ca[_0x1bbc6e(0x26d)];if(_0x128f2c&&_0x128f2c!==_0x1bbc6e(0x218)&&_0x128f2c!==_0x1bbc6e(0x1b3))return console[_0x1bbc6e(0x290)](_0x1bbc6e(0x1e3)+_0x128f2c+_0x1bbc6e(0x1c6)),0x1;const _0x2dc23a=withJsonFormat(_0x3b1175),{journeyId:_0x48264a,journeyName:_0x292bc2}=await resolveJourneyIdFromInput(_0x121d47,_0x2dc23a,_0x1ddf5a),_0x1490bf={'type':_0x128f2c,'from':_0x5675cd,'to':_0x3ea959,'limit':_0x41ba2c},_0x48f355=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x1ddf5a[_0x1bbc6e(0x1a1)]['getTrafficData'](_0x48264a,_0x1490bf),{'verbose':_0x2dc23a['verbose']}),_0x1e30bf=_0x48f355[_0x1bbc6e(0x1c7)],_0x54067b=_0x1e30bf[_0x1bbc6e(0x218)]&&(_0x1e30bf[_0x1bbc6e(0x218)][_0x1bbc6e(0x1ca)][_0x1bbc6e(0x173)]>0x0||_0x1e30bf[_0x1bbc6e(0x218)][_0x1bbc6e(0x182)][_0x1bbc6e(0x173)]>0x0),_0x41f9bd=_0x1e30bf['activation']&&_0x1e30bf['activation'][_0x1bbc6e(0x173)]>0x0;if(!_0x54067b&&!_0x41f9bd)return console['error'](_0x1bbc6e(0x1d1)+_0x292bc2),console[_0x1bbc6e(0x290)](_0x1bbc6e(0x245)),_0x5675cd&&_0x3ea959&&console[_0x1bbc6e(0x290)](_0x1bbc6e(0x1f5)),0x0;return await handleSingleObjectOutput(_0x1e30bf,_0x2dc23a),0x0;}}function formatStageStats(_0x3dfe0b,_0x127a14){const _0x3f6f66=a27_0x11bc0d,_0x475023=_0x127a14['hasPeriod']&&_0x3dfe0b[_0x3f6f66(0x211)]?.['length']?aggregateStageHistory(_0x3dfe0b['history']):{'size':_0x3dfe0b[_0x3f6f66(0x25b)],'entered':_0x3dfe0b[_0x3f6f66(0x175)],'milestone':_0x3dfe0b[_0x3f6f66(0x265)],'milestone_rate':_0x3dfe0b[_0x3f6f66(0x248)],'exit_or_jump':_0x3dfe0b['exitOrJumpSize'],'exit_or_jump_rate':_0x3dfe0b[_0x3f6f66(0x217)]},_0x4702ed={'id':_0x3dfe0b['id'],'name':_0x127a14[_0x3f6f66(0x21d)]['get'](_0x3dfe0b['id'])??_0x3dfe0b['id'],..._0x475023};return _0x127a14[_0x3f6f66(0x181)]&&_0x127a14[_0x3f6f66(0x174)]&&_0x3dfe0b[_0x3f6f66(0x211)]&&(_0x4702ed[_0x3f6f66(0x211)]=_0x3dfe0b[_0x3f6f66(0x211)]),_0x4702ed;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x11bc0d(0x196);['description']=a27_0x11bc0d(0x20b);async['execute'](_0x5a7226){const _0x4b5775=a27_0x11bc0d,{options:_0x31aa4b,args:_0x26d187,tdx:_0xb8bbf}=_0x5a7226,_0x18d2ac=_0x26d187[0x0];if(!requireNameOrPath(_0x18d2ac))return 0x1;_0x31aa4b[_0x4b5775(0x203)]&&console[_0x4b5775(0x290)]('Input:\x20'+_0x18d2ac);const {journeyId:_0x2abf96,journeyName:_0x1fb53c}=await resolveJourneyIdFromInput(_0x18d2ac,_0x31aa4b,_0xb8bbf);if(!_0x31aa4b[_0x4b5775(0x244)]){const _0x16097f=await confirm(_0x4b5775(0x1dc)+_0x1fb53c+'\x22?');if(!_0x16097f)return console[_0x4b5775(0x290)](_0x4b5775(0x195)),0x0;}const _0x4b73e5=await withSpinner(_0x4b5775(0x214),()=>_0xb8bbf[_0x4b5775(0x1a1)][_0x4b5775(0x191)](_0x2abf96),{'verbose':_0x31aa4b[_0x4b5775(0x203)]}),_0x530c36=_0x4b73e5[_0x4b5775(0x1c7)];return console[_0x4b5775(0x290)]('✔\x20Journey\x20\x22'+_0x530c36[_0x4b5775(0x1d9)]['name']+_0x4b5775(0x232)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x231);['description']=a27_0x11bc0d(0x2a9);async[a27_0x11bc0d(0x177)](_0x388a1b){const _0x241493=a27_0x11bc0d,{options:_0x11acb9,args:_0x14dcd2,tdx:_0x583c12}=_0x388a1b,_0x1527c7=_0x14dcd2[0x0];if(!requireNameOrPath(_0x1527c7))return 0x1;_0x11acb9[_0x241493(0x203)]&&console['error'](_0x241493(0x1e8)+_0x1527c7);const {journeyId:_0x138050,journeyName:_0x3ccb57}=await resolveJourneyIdFromInput(_0x1527c7,_0x11acb9,_0x583c12);if(_0x11acb9[_0x241493(0x23f)])return await this[_0x241493(0x27d)](_0x388a1b,_0x138050,_0x3ccb57);if(!_0x11acb9[_0x241493(0x244)]){const _0x2363e9=await confirm(_0x241493(0x273)+_0x3ccb57+'\x22?');if(!_0x2363e9)return console[_0x241493(0x290)]('Cancelled'),0x0;}const _0x3691fc=await withSpinner(_0x241493(0x17e),()=>_0x583c12[_0x241493(0x1a1)][_0x241493(0x1f9)](_0x138050),{'verbose':_0x11acb9[_0x241493(0x203)]}),_0x59efec=_0x3691fc[_0x241493(0x1c7)],_0x2cec2c=getWorkflowSessionUrl(_0x11acb9['site'],_0x59efec[_0x241493(0x1dd)],_0x59efec['workflowSessionId']);return console['error']('\x0a'+a27_0x503b10[_0x241493(0x287)]('✔')+_0x241493(0x1ba)),console['error']('\x20\x20'+a27_0x503b10[_0x241493(0x257)](_0x241493(0x238))+'\x20'+_0x3ccb57),console[_0x241493(0x290)]('\x20\x20'+a27_0x503b10[_0x241493(0x257)](_0x241493(0x1c4))+'\x20'+_0x59efec[_0x241493(0x1ee)]),console[_0x241493(0x290)]('\x20\x20'+a27_0x503b10[_0x241493(0x257)](_0x241493(0x1bc))+'\x20'+_0x59efec[_0x241493(0x295)]),console[_0x241493(0x290)]('\x20\x20'+_0x2cec2c),0x0;}async[a27_0x11bc0d(0x27d)](_0x4400cc,_0x405117,_0x2c0ee0){const _0x2b2782=a27_0x11bc0d,{options:_0x2e3104,tdx:_0x1966a6}=_0x4400cc,_0x1fd631=await withSpinner(_0x2b2782(0x28d)+_0x2c0ee0+_0x2b2782(0x23e),()=>Promise['all']([_0x1966a6[_0x2b2782(0x1a1)]['getJourney'](_0x405117),_0x1966a6[_0x2b2782(0x1a1)][_0x2b2782(0x2a2)](_0x405117)]),{'verbose':_0x2e3104[_0x2b2782(0x203)]}),[_0x5af203,_0x3fb741]=_0x1fd631[_0x2b2782(0x1c7)],_0x5b4a50=_0x5af203['attributes'],_0x494158=_0x5b4a50['journeyStages'];console[_0x2b2782(0x246)](a27_0x503b10[_0x2b2782(0x1a2)](_0x2b2782(0x238)),_0x5b4a50['name']),console[_0x2b2782(0x246)](a27_0x503b10['bold'](_0x2b2782(0x29f)),_0x5af203['id']),console['log'](a27_0x503b10['bold'](_0x2b2782(0x1d0)),_0x5b4a50['state']),console[_0x2b2782(0x246)](a27_0x503b10[_0x2b2782(0x1a2)](_0x2b2782(0x179)),_0x5b4a50['paused']?a27_0x503b10[_0x2b2782(0x243)](_0x2b2782(0x244)):a27_0x503b10['green']('no')),console['log'](a27_0x503b10['bold'](_0x2b2782(0x1f3)),_0x5b4a50['audienceId']);const _0x210e57=_0x494158[_0x2b2782(0x173)]>0x0?'\x20('+_0x494158[_0x2b2782(0x184)](_0x219399=>_0x219399[_0x2b2782(0x225)])[_0x2b2782(0x1cf)](',\x20')+')':'';console[_0x2b2782(0x246)](a27_0x503b10['bold'](_0x2b2782(0x1e4)),''+_0x494158[_0x2b2782(0x173)]+_0x210e57),console['log']('');if(_0x3fb741['length']===0x0)console[_0x2b2782(0x246)](a27_0x503b10[_0x2b2782(0x1a2)](_0x2b2782(0x22f)),a27_0x503b10[_0x2b2782(0x257)](_0x2b2782(0x1d6)));else{console[_0x2b2782(0x246)](a27_0x503b10[_0x2b2782(0x1a2)](_0x2b2782(0x22f)));for(const _0x488107 of _0x3fb741){const _0x53abba=_0x488107[_0x2b2782(0x225)]??_0x2b2782(0x22a),_0x237b25=_0x488107[_0x2b2782(0x185)]!=null?'connection\x20'+_0x488107[_0x2b2782(0x185)]:_0x2b2782(0x2a3),_0x129a0b=_0x488107[_0x2b2782(0x1d7)]?''+_0x488107[_0x2b2782(0x1d7)]+(_0x488107[_0x2b2782(0x20f)]?_0x2b2782(0x28a)+_0x488107[_0x2b2782(0x20f)]:''):'none',_0x306841=_0x488107[_0x2b2782(0x1d4)]?_0x2b2782(0x226):'';console[_0x2b2782(0x246)]('\x20\x20'+a27_0x503b10[_0x2b2782(0x243)]('⚠️\x20')+'\x20'+_0x53abba+_0x2b2782(0x18f)+_0x237b25+_0x2b2782(0x268)+_0x129a0b+_0x306841);}}return console[_0x2b2782(0x246)](a27_0x503b10['yellow']('\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.')),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x1fa);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x28e);async['execute'](_0x30c241){const _0x410171=a27_0x11bc0d,{options:_0x32360b,args:_0x120efb,tdx:_0x2c06af}=_0x30c241,_0x18ebf1=_0x120efb[0x0];if(!requireNameOrPath(_0x18ebf1))return 0x1;_0x32360b[_0x410171(0x203)]&&console['error']('Input:\x20'+_0x18ebf1);const {journeyId:_0x147a33,journeyName:_0xcf3a40}=await resolveJourneyIdFromInput(_0x18ebf1,_0x32360b,_0x2c06af);if(_0x32360b[_0x410171(0x23f)])return await this[_0x410171(0x27d)](_0x30c241,_0x147a33,_0xcf3a40);if(!_0x32360b[_0x410171(0x244)]){const _0x2a90fd=await confirm(_0x410171(0x1da)+_0xcf3a40+'\x22?');if(!_0x2a90fd)return console['error'](_0x410171(0x195)),0x0;}const _0xacf303=await withSpinner(_0x410171(0x1bb),()=>_0x2c06af[_0x410171(0x1a1)][_0x410171(0x1b8)](_0x147a33),{'verbose':_0x32360b[_0x410171(0x203)]}),_0x2e7909=_0xacf303[_0x410171(0x1c7)];return console[_0x410171(0x290)](_0x410171(0x1eb)+_0x2e7909['attributes'][_0x410171(0x225)]+_0x410171(0x1de)),0x0;}async[a27_0x11bc0d(0x27d)](_0x26d2e0,_0x57a6f,_0x140a85){const _0x1e3c33=a27_0x11bc0d,{options:_0x56fe18,tdx:_0x1b3062}=_0x26d2e0,_0x4a81ef=await withSpinner(_0x1e3c33(0x28d)+_0x140a85+_0x1e3c33(0x23e),()=>Promise[_0x1e3c33(0x210)]([_0x1b3062[_0x1e3c33(0x1a1)][_0x1e3c33(0x22d)](_0x57a6f),_0x1b3062['journey']['listActivationsFlat'](_0x57a6f)]),{'verbose':_0x56fe18['verbose']}),[_0x42f9da,_0x3e07e0]=_0x4a81ef[_0x1e3c33(0x1c7)],_0x13bc53=_0x42f9da[_0x1e3c33(0x1d9)],_0x389f4e=_0x13bc53[_0x1e3c33(0x221)];console[_0x1e3c33(0x246)](a27_0x503b10[_0x1e3c33(0x1a2)](_0x1e3c33(0x238)),_0x13bc53[_0x1e3c33(0x225)]),console[_0x1e3c33(0x246)](a27_0x503b10['bold'](_0x1e3c33(0x29f)),_0x42f9da['id']),console[_0x1e3c33(0x246)](a27_0x503b10[_0x1e3c33(0x1a2)](_0x1e3c33(0x1d0)),_0x13bc53[_0x1e3c33(0x17f)]),console[_0x1e3c33(0x246)](a27_0x503b10[_0x1e3c33(0x1a2)](_0x1e3c33(0x179)),_0x13bc53[_0x1e3c33(0x227)]?a27_0x503b10['yellow'](_0x1e3c33(0x244)):a27_0x503b10[_0x1e3c33(0x287)]('no'));_0x13bc53[_0x1e3c33(0x1ae)]&&console[_0x1e3c33(0x246)](a27_0x503b10[_0x1e3c33(0x1a2)](_0x1e3c33(0x28b)),_0x13bc53[_0x1e3c33(0x1ae)]);console['log'](a27_0x503b10['bold']('Parent\x20segment\x20ID:'),_0x13bc53[_0x1e3c33(0x16f)]);const _0x3d958a=_0x389f4e[_0x1e3c33(0x173)]>0x0?'\x20('+_0x389f4e[_0x1e3c33(0x184)](_0x9833d6=>_0x9833d6[_0x1e3c33(0x225)])['join'](',\x20')+')':'';console['log'](a27_0x503b10[_0x1e3c33(0x1a2)](_0x1e3c33(0x1e4)),''+_0x389f4e[_0x1e3c33(0x173)]+_0x3d958a),console[_0x1e3c33(0x246)]('');if(_0x3e07e0[_0x1e3c33(0x173)]===0x0)console[_0x1e3c33(0x246)](a27_0x503b10['bold'](_0x1e3c33(0x22f)),a27_0x503b10[_0x1e3c33(0x257)](_0x1e3c33(0x1d6)));else{console['log'](a27_0x503b10['bold'](_0x1e3c33(0x22f)));for(const _0x267f77 of _0x3e07e0){const _0x244738=_0x267f77[_0x1e3c33(0x225)]??_0x1e3c33(0x22a),_0x5702b9=_0x267f77['connectionId']!=null?_0x1e3c33(0x22b)+_0x267f77[_0x1e3c33(0x185)]:_0x1e3c33(0x2a3),_0x53ce2f=_0x267f77[_0x1e3c33(0x1d7)]?''+_0x267f77[_0x1e3c33(0x1d7)]+(_0x267f77[_0x1e3c33(0x20f)]?_0x1e3c33(0x28a)+_0x267f77[_0x1e3c33(0x20f)]:''):'none',_0x17abb6=_0x267f77[_0x1e3c33(0x1d4)]?_0x1e3c33(0x226):'';console['log']('\x20\x20'+a27_0x503b10[_0x1e3c33(0x243)](_0x1e3c33(0x236))+'\x20'+_0x244738+_0x1e3c33(0x18f)+_0x5702b9+',\x20schedule:\x20'+_0x53ce2f+_0x17abb6);}}return console[_0x1e3c33(0x246)](a27_0x503b10['yellow'](_0x1e3c33(0x220))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x2a1);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x27b);async[a27_0x11bc0d(0x177)](_0x1c0089){const _0x14a0a0=a27_0x11bc0d,{options:_0x282fd4,args:_0x5adf05,tdx:_0x20fa90}=_0x1c0089,_0x542d27=_0x282fd4,_0x21d79e=_0x5adf05[0x0],_0x23bea6=_0x21d79e&&isYamlFilePath(_0x21d79e),_0x1017f0=await resolveTarget({'arg':_0x23bea6?_0x21d79e:undefined,'contextParent':_0x282fd4[_0x14a0a0(0x1ce)],'cwd':process[_0x14a0a0(0x198)]()});if(!isSuccessfulResolution(_0x1017f0))return _0x1017f0[_0x14a0a0(0x27e)]==='no_parent'?(console['error'](a27_0x503b10[_0x14a0a0(0x243)](_0x14a0a0(0x271))),console[_0x14a0a0(0x290)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x14a0a0(0x290)](_0x14a0a0(0x17b)),console[_0x14a0a0(0x290)](_0x14a0a0(0x197)),console[_0x14a0a0(0x290)](_0x14a0a0(0x1f7))):(console['error'](a27_0x503b10[_0x14a0a0(0x200)](_0x14a0a0(0x1a6)+_0x1017f0['message']+'\x0a')),_0x1017f0[_0x14a0a0(0x258)]&&console['error'](a27_0x503b10['cyan'](_0x1017f0['helpText']))),0x1;let _0x559f2c=_0x23bea6?undefined:_0x21d79e,_0x312eaf,_0x1d44d7;_0x1017f0[_0x14a0a0(0x1a3)]===_0x14a0a0(0x17d)&&(_0x559f2c=_0x1017f0['resourceName'],_0x312eaf=_0x1017f0[_0x14a0a0(0x274)],_0x1d44d7=_0x1017f0[_0x14a0a0(0x1b0)]);const _0x1ae544=_0x1017f0['parentName'],_0x2b17b9=_0x1017f0[_0x14a0a0(0x21c)];_0x542d27['verbose']&&(console['error'](_0x14a0a0(0x299)+_0x1ae544),console[_0x14a0a0(0x290)](_0x14a0a0(0x19a)+_0x2b17b9),_0x559f2c&&console[_0x14a0a0(0x290)](_0x14a0a0(0x24e)+_0x559f2c),_0x312eaf&&console['error']('Target\x20file:\x20'+_0x312eaf),_0x1d44d7&&console[_0x14a0a0(0x290)](_0x14a0a0(0x252)+_0x1d44d7));const _0x327a91=await withSpinner(_0x14a0a0(0x180),()=>_0x20fa90[_0x14a0a0(0x25c)][_0x14a0a0(0x23a)](_0x1ae544),{'verbose':_0x282fd4[_0x14a0a0(0x203)]}),_0x56dd13=_0x327a91[_0x14a0a0(0x1c7)],{journeys:_0x45dffb,folders:_0x3991f2}=await withSpinner(_0x14a0a0(0x254),async()=>{const _0x3d09a3=_0x14a0a0,[_0x1745df,_0x47b630]=await Promise[_0x3d09a3(0x210)]([_0x20fa90[_0x3d09a3(0x1a1)][_0x3d09a3(0x215)](_0x56dd13,undefined,{'includeAllVersions':!![]}),_0x20fa90['segment'][_0x3d09a3(0x26f)](_0x56dd13)]);return{'journeys':_0x1745df,'folders':_0x47b630};},{'verbose':_0x282fd4[_0x14a0a0(0x203)]})['then'](_0xb8cba3=>_0xb8cba3['data']);let _0x1c82f5=_0x45dffb;const _0x43f6fa=buildFolderIdToPathMap(_0x3991f2);if(_0x559f2c){const _0x2b277b=_0x1c82f5[_0x14a0a0(0x288)](_0x29c808=>_0x29c808[_0x14a0a0(0x27f)][_0x14a0a0(0x170)]()===_0x559f2c[_0x14a0a0(0x170)]());if(_0x2b277b[_0x14a0a0(0x173)]===0x0)return console[_0x14a0a0(0x290)]('Error:\x20Journey\x20not\x20found:\x20'+_0x559f2c),console[_0x14a0a0(0x290)](_0x14a0a0(0x23c)),0x1;_0x1c82f5=_0x2b277b;}if(_0x1d44d7!==undefined){const _0x44ac44=_0x1c82f5[_0x14a0a0(0x288)](_0x2521f0=>{const _0x46b991=_0x14a0a0,_0x1564d6=_0x2521f0[_0x46b991(0x2a8)]?_0x43f6fa[_0x46b991(0x237)](_0x2521f0['folderId'])||'':'';return _0x1564d6===_0x1d44d7;});if(_0x44ac44[_0x14a0a0(0x173)]===0x0&&_0x1c82f5[_0x14a0a0(0x173)]>0x0){console['error'](_0x14a0a0(0x21a)+_0x559f2c+'\x27\x20not\x20found\x20in\x20'+(_0x1d44d7||'root\x20folder')),console[_0x14a0a0(0x290)](_0x14a0a0(0x1ff));for(const _0x551c48 of _0x1c82f5){const _0x14b813=_0x551c48[_0x14a0a0(0x2a8)]?_0x43f6fa[_0x14a0a0(0x237)](_0x551c48[_0x14a0a0(0x2a8)])||'':'';console[_0x14a0a0(0x290)](_0x14a0a0(0x222)+(_0x14b813||'(root)')+'/'+_0x551c48[_0x14a0a0(0x27f)]);}return 0x1;}_0x1c82f5=_0x44ac44;}if(_0x1c82f5[_0x14a0a0(0x173)]===0x0)return console[_0x14a0a0(0x290)](_0x14a0a0(0x29e)),0x0;const _0x342dc2=new Map();for(const _0x44f8ba of _0x1c82f5){const _0x3365f8=_0x44f8ba[_0x14a0a0(0x24a)];!_0x342dc2['has'](_0x3365f8)&&_0x342dc2[_0x14a0a0(0x1fb)](_0x3365f8,[]),_0x342dc2[_0x14a0a0(0x237)](_0x3365f8)[_0x14a0a0(0x213)](_0x44f8ba);}for(const _0x270680 of _0x342dc2[_0x14a0a0(0x2a5)]()){_0x270680['sort']((_0x38d3cc,_0x3f1565)=>(_0x38d3cc[_0x14a0a0(0x18c)]||0x0)-(_0x3f1565['versionNumber']||0x0));}const _0x22597f=[],{idToEmailMap:_0x3c86f7,connectionIdToNameMap:_0x40bdc3}=await withSpinner(_0x14a0a0(0x267),async()=>{const _0x5ae548=_0x14a0a0,[_0x5be4b6,_0x839902]=await Promise[_0x5ae548(0x210)]([_0x20fa90[_0x5ae548(0x17c)][_0x5ae548(0x256)](),_0x20fa90[_0x5ae548(0x29d)][_0x5ae548(0x1ec)]()]);return{'idToEmailMap':_0x5be4b6,'connectionIdToNameMap':_0x839902};},{'verbose':_0x282fd4[_0x14a0a0(0x203)]})['then'](_0x4fb839=>_0x4fb839[_0x14a0a0(0x1c7)]);for(const _0x2d85cd of _0x342dc2[_0x14a0a0(0x2a5)]()){const _0xe2d06d=_0x2d85cd[0x0][_0x14a0a0(0x27f)],_0x153bb9=_0x2d85cd[0x0][_0x14a0a0(0x2a8)],_0x580e8c=_0x153bb9?_0x43f6fa[_0x14a0a0(0x237)](_0x153bb9)||'':'',_0x1c6f8c=_0x580e8c?a27_0x5a60d6['join'](_0x2b17b9,_0x580e8c):_0x2b17b9,_0x4e4d93=_0x312eaf||a27_0x5a60d6[_0x14a0a0(0x1cf)](_0x1c6f8c,sanitizeFileName(_0xe2d06d)+'.journey.yml');let _0x148a64,_0xa5d84d;if(existsSync(_0x4e4d93))try{const _0x446d8a=readFileSync(_0x4e4d93,_0x14a0a0(0x264)),_0x167944=parseYamlString(_0x446d8a);_0xa5d84d=_0x167944,_0x148a64=buildRuleToNameMapping(_0x167944),_0x542d27[_0x14a0a0(0x203)]&&_0x148a64['size']>0x0&&console[_0x14a0a0(0x290)](_0x14a0a0(0x1e5)+_0x148a64[_0x14a0a0(0x25b)]+_0x14a0a0(0x28c)+_0xe2d06d);}catch(_0x4be6ca){_0x542d27['verbose']&&console[_0x14a0a0(0x290)](_0x14a0a0(0x2aa)+_0x4be6ca[_0x14a0a0(0x279)]);}const _0x5e6ed5=[],_0x2a855a=new Set(),_0x2b2c83=new Map(),_0x5ee314=new Map(),_0x4d6522=new Set(),_0x53234e=new Map(),_0x5296ab=new Map(),_0x430c8a=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0xe2d06d+'...',async _0x5b4731=>{const _0x3bbe32=_0x14a0a0;for(const _0x33b423 of _0x2d85cd){const _0x447585=_0x2d85cd[_0x3bbe32(0x173)]>0x1?_0x33b423[_0x3bbe32(0x27f)]+'\x20v'+(_0x33b423['versionNumber']||0x1):_0x33b423[_0x3bbe32(0x27f)];_0x5b4731[_0x3bbe32(0x24f)](_0x3bbe32(0x1b4)+_0x447585);const _0x3ccdb3=await _0x20fa90[_0x3bbe32(0x1a1)]['getJourney'](_0x33b423['id']),_0xc2f0b3=_0x3ccdb3[_0x3bbe32(0x1d9)]?.[_0x3bbe32(0x16f)],_0x2d8aa4={'resolveSegment':async _0x45a50b=>{const _0x240d76=_0x3bbe32;if(!_0xc2f0b3)return{'name':_0x45a50b,'isJourneyLocal':![]};const _0x3cf85b=_0x2b2c83['get'](_0x45a50b);if(_0x3cf85b)return _0x3cf85b;try{const _0x5ecff6=await _0x20fa90[_0x240d76(0x25c)][_0x240d76(0x208)](_0xc2f0b3,_0x45a50b),_0x2f6d1c=_0x5ecff6[_0x240d76(0x26c)]===SEGMENT_KIND_JOURNEY;let _0x312405,_0x4a2087=_0x5ecff6[_0x240d76(0x225)];if(_0x2f6d1c&&_0x5ecff6[_0x240d76(0x1b2)]){const _0x8aad59=await segmentResponseToDef(_0x5ecff6,{'resolveSegmentName':async _0x379f3a=>{const _0x3e8702=_0x240d76,_0x5cad5a=_0x2b2c83[_0x3e8702(0x237)](_0x379f3a);if(_0x5cad5a)return _0x5cad5a[_0x3e8702(0x225)];const _0x1be819=await _0x2d8aa4[_0x3e8702(0x212)](_0x379f3a);return _0x1be819[_0x3e8702(0x225)];}}),_0x33851e=_0x8aad59[_0x240d76(0x1b2)];_0x312405={'description':_0x5ecff6[_0x240d76(0x281)],'rule':_0x33851e};const _0x261462=serializeRule(_0x33851e),_0x1ec75e=_0x5ee314[_0x240d76(0x237)](_0x261462);if(_0x1ec75e)_0x4a2087=_0x1ec75e,_0x312405=undefined,_0x542d27[_0x240d76(0x203)]&&console[_0x240d76(0x290)](_0x240d76(0x19d)+_0x5ecff6[_0x240d76(0x225)]+_0x240d76(0x192)+_0x1ec75e);else{let _0x3a8d63=![];if(_0x148a64){const _0x90f8f3=_0x148a64[_0x240d76(0x237)](_0x261462);if(_0x90f8f3){const _0x2ad943=_0x90f8f3['find'](_0x27f53f=>!_0x2a855a[_0x240d76(0x298)](_0x27f53f));_0x2ad943&&(_0x4a2087=_0x2ad943,_0x2a855a[_0x240d76(0x19e)](_0x2ad943),_0x5ee314[_0x240d76(0x1fb)](_0x261462,_0x2ad943),_0x3a8d63=!![],_0x542d27[_0x240d76(0x203)]&&console[_0x240d76(0x290)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x2ad943+_0x240d76(0x230)));}}if(!_0x3a8d63){const _0x1998b8=generateJourneyLocalName(_0x5ecff6['name']);_0x1998b8&&(_0x4a2087=_0x1998b8);let _0x3f00ac=_0x4a2087,_0x2522ba=0x2;while(_0x2a855a['has'](_0x3f00ac)){_0x3f00ac=_0x4a2087+'_'+_0x2522ba,_0x2522ba++;}_0x2a855a[_0x240d76(0x19e)](_0x3f00ac),_0x5ee314[_0x240d76(0x1fb)](_0x261462,_0x3f00ac),_0x4a2087=_0x3f00ac;}}}const _0x50827e={'name':_0x4a2087,'isJourneyLocal':_0x2f6d1c,'definition':_0x312405};return _0x2b2c83[_0x240d76(0x1fb)](_0x45a50b,_0x50827e),_0x50827e;}catch(_0x3da23c){return _0x282fd4['verbose']&&console['error'](_0x240d76(0x282)+_0x45a50b+':\x20'+_0x3da23c[_0x240d76(0x279)]),{'name':_0x45a50b,'isJourneyLocal':![]};}},'resolveActivation':async _0xd85931=>{const _0x121adc=_0x3bbe32,_0x4d3c2c=_0x53234e[_0x121adc(0x237)](_0xd85931);if(_0x4d3c2c)return _0x4d3c2c;try{const _0x2efcc2=await _0x20fa90[_0x121adc(0x1a1)][_0x121adc(0x24b)](_0x33b423['id'],_0xd85931),_0x342eeb=journeyActivationStepToYaml(_0x2efcc2,_0x3c86f7,_0x40bdc3),_0x1d766a=JSON[_0x121adc(0x1cd)]({'name':_0x342eeb['name'],'connection':_0x342eeb['connection'],'connector_config':_0x342eeb[_0x121adc(0x1df)]}),_0x303ed8=_0x5296ab['get'](_0x1d766a);if(_0x303ed8){const _0x297522={'name':_0x303ed8,'isJourneyLocal':!![],'definition':_0x342eeb};return _0x53234e[_0x121adc(0x1fb)](_0xd85931,_0x297522),_0x297522;}const _0x36b27d=_0x2efcc2[_0x121adc(0x1d9)][_0x121adc(0x22c)][_0x121adc(0x225)]||_0xd85931,_0xac9993=sanitizeYamlKey(_0x36b27d)||'activation_'+_0xd85931;let _0xcc738d=_0xac9993,_0x345de6=0x2;while(_0x4d6522[_0x121adc(0x298)](_0xcc738d)){_0xcc738d=_0xac9993+'_'+_0x345de6,_0x345de6++;}_0x4d6522['add'](_0xcc738d),_0x5296ab[_0x121adc(0x1fb)](_0x1d766a,_0xcc738d);const _0x1283f2={'name':_0xcc738d,'isJourneyLocal':!![],'definition':_0x342eeb};return _0x53234e[_0x121adc(0x1fb)](_0xd85931,_0x1283f2),_0x1283f2;}catch(_0xbc8668){return _0x282fd4[_0x121adc(0x203)]&&console[_0x121adc(0x290)](_0x121adc(0x255)+_0xd85931+':\x20'+_0xbc8668[_0x121adc(0x279)]),{'name':_0xd85931,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1d85c5,_0x307e3c)=>{const _0x114c7e=_0x3bbe32;return resolveJumpTarget(_0x1d85c5,_0x307e3c,_0x430c8a,_0x1d6ae2=>_0x20fa90[_0x114c7e(0x1a1)]['getJourney'](_0x1d6ae2));}},_0x5b41d0=await journeyResponseToDef(_0x3ccdb3,_0x2d8aa4);_0x5e6ed5[_0x3bbe32(0x213)]({'item':_0x33b423,'yaml':_0x5b41d0});}},{'verbose':_0x282fd4[_0x14a0a0(0x203)]});const _0x4e2e8f=await _0x20fa90[_0x14a0a0(0x1a1)][_0x14a0a0(0x20a)](_0x2d85cd[0x0]['journeyBundleId']),_0x371d66=buildMergedJourneyDef(_0x5e6ed5,_0x148a64,_0x4e2e8f),_0x58c6d3=normalizeJourneyDef(_0x371d66,_0xa5d84d),_0x16030a=toYamlString(_0x58c6d3),_0x10e945=_0x312eaf||a27_0x5a60d6[_0x14a0a0(0x1cf)](_0x1c6f8c,sanitizeFileName(_0xe2d06d)+_0x14a0a0(0x266));!_0x312eaf&&_0x580e8c&&!existsSync(_0x1c6f8c)&&mkdirSync(_0x1c6f8c,{'recursive':!![]});const _0xea47c5=a27_0x5a60d6[_0x14a0a0(0x1f8)](process[_0x14a0a0(0x198)](),_0x10e945);if(existsSync(_0x10e945)){const _0x2365a0=readFileSync(_0x10e945,'utf-8'),_0x1fac9d=generateDiff(_0x2365a0,_0x16030a),_0x560cec=hasChanges(_0x1fac9d);_0x22597f[_0x14a0a0(0x213)]({'relativePath':_0xea47c5,'absolutePath':_0x10e945,'content':_0x16030a,'isNew':![],'hasChanges':_0x560cec,'diff':_0x560cec?formatDiffWithColors(_0x1fac9d):undefined});}else _0x22597f['push']({'relativePath':_0xea47c5,'absolutePath':_0x10e945,'content':_0x16030a,'isNew':!![],'hasChanges':![]});}const _0x481892=_0x22597f[_0x14a0a0(0x288)](_0x58c79b=>_0x58c79b[_0x14a0a0(0x204)]),_0x5c4770=_0x22597f[_0x14a0a0(0x288)](_0x2b13d7=>!_0x2b13d7[_0x14a0a0(0x204)]&&_0x2b13d7['hasChanges']),_0x2f43e3=_0x22597f['filter'](_0x3f47cd=>!_0x3f47cd[_0x14a0a0(0x204)]&&!_0x3f47cd['hasChanges']),_0x42f84c=_0x1c82f5[_0x14a0a0(0x173)],_0x118045=_0x342dc2[_0x14a0a0(0x25b)],_0x255fcf=_0x42f84c>_0x118045?'\x20('+_0x42f84c+_0x14a0a0(0x21b):'';console[_0x14a0a0(0x290)]('\x0aPull\x20summary:'),console[_0x14a0a0(0x290)]('\x20\x20'+a27_0x503b10[_0x14a0a0(0x19b)](_0x118045+_0x14a0a0(0x278))+a27_0x503b10[_0x14a0a0(0x257)](_0x255fcf)),console[_0x14a0a0(0x290)]('\x20\x20'+a27_0x503b10[_0x14a0a0(0x287)]('+\x20'+_0x481892[_0x14a0a0(0x173)]+'\x20new\x20files')),console['error']('\x20\x20'+a27_0x503b10[_0x14a0a0(0x243)]('~\x20'+_0x5c4770[_0x14a0a0(0x173)]+'\x20changed\x20files')),console[_0x14a0a0(0x290)]('\x20\x20'+a27_0x503b10['dim']('=\x20'+_0x2f43e3[_0x14a0a0(0x173)]+'\x20unchanged\x20files')),console[_0x14a0a0(0x290)](_0x14a0a0(0x205)+a27_0x503b10[_0x14a0a0(0x19b)](_0x2b17b9)+'\x0a');if(_0x5c4770[_0x14a0a0(0x173)]>0x0)for(const _0x242fe4 of _0x5c4770){console[_0x14a0a0(0x290)]('\x0aChanges\x20to\x20\x27'+_0x242fe4[_0x14a0a0(0x171)]+'\x27:'),console[_0x14a0a0(0x290)]('─'[_0x14a0a0(0x1d5)](0x3c)),console[_0x14a0a0(0x290)](_0x242fe4['diff']),console[_0x14a0a0(0x290)]('─'[_0x14a0a0(0x1d5)](0x3c));}if(_0x542d27[_0x14a0a0(0x23f)])return console[_0x14a0a0(0x290)](a27_0x503b10['yellow'](_0x14a0a0(0x176))),0x0;if(_0x481892[_0x14a0a0(0x173)]===0x0&&_0x5c4770['length']===0x0)return console[_0x14a0a0(0x290)](a27_0x503b10['green'](_0x14a0a0(0x1c2))),saveSessionContext({'parent_segment':_0x1ae544},_0x542d27[_0x14a0a0(0x18b)]),console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x287)](_0x14a0a0(0x27c)+a27_0x503b10[_0x14a0a0(0x257)](_0x14a0a0(0x18a))+_0x14a0a0(0x1b9)+a27_0x503b10[_0x14a0a0(0x19b)](_0x1ae544))),0x0;if(!_0x542d27[_0x14a0a0(0x244)]&&(_0x481892['length']>0x0||_0x5c4770['length']>0x0)){if(!isInteractive())return console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x200)](_0x14a0a0(0x183)),_0x14a0a0(0x272)),console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x257)](_0x14a0a0(0x294))),0x1;const _0x526d75=await confirmKey(_0x14a0a0(0x1a5)+(_0x481892[_0x14a0a0(0x173)]+_0x5c4770[_0x14a0a0(0x173)])+_0x14a0a0(0x21e));if(!_0x526d75)return console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x243)](_0x14a0a0(0x250)),_0x14a0a0(0x23d)),0x1;}!existsSync(_0x2b17b9)&&mkdirSync(_0x2b17b9,{'recursive':!![]});const _0xff4863=a27_0x5a60d6[_0x14a0a0(0x1cf)](_0x2b17b9,_0x14a0a0(0x247));writeFileSync(_0xff4863,createTdxConfigContent(_0x1ae544),_0x14a0a0(0x264));for(const _0x87b160 of _0x22597f){(_0x87b160['isNew']||_0x87b160[_0x14a0a0(0x2a6)])&&writeFileSync(_0x87b160[_0x14a0a0(0x188)],_0x87b160['content'],_0x14a0a0(0x264));}return console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x287)](_0x14a0a0(0x24d)+(_0x481892[_0x14a0a0(0x173)]+_0x5c4770[_0x14a0a0(0x173)])+_0x14a0a0(0x293)+_0x2b17b9)),saveSessionContext({'parent_segment':_0x1ae544},_0x542d27[_0x14a0a0(0x18b)]),console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x287)]('✔\x20Context\x20set:\x20'+a27_0x503b10['dim']('parent_segment')+'\x20=\x20'+a27_0x503b10[_0x14a0a0(0x19b)](_0x1ae544))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x263);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x1af);async[a27_0x11bc0d(0x177)](_0x2105ca){const _0x16f2c9=a27_0x11bc0d,{options:_0x1ac62f,args:_0x16f42e,tdx:_0x28a985}=_0x2105ca,_0x26427e=_0x16f42e[0x0];if(!requireNameOrPath(_0x26427e))return 0x1;_0x1ac62f[_0x16f2c9(0x203)]&&console[_0x16f2c9(0x290)]('Input:\x20'+_0x26427e);const {journeyId:_0x5507a0}=await resolveJourneyIdFromInput(_0x26427e,_0x1ac62f,_0x28a985),_0x547a2a=await withSpinner(_0x16f2c9(0x1ad),()=>_0x28a985[_0x16f2c9(0x1a1)][_0x16f2c9(0x29a)](_0x5507a0),{'verbose':_0x1ac62f['verbose']}),_0x5a84e7=_0x547a2a['data'];return console[_0x16f2c9(0x246)](_0x16f2c9(0x1c1)+_0x5a84e7[_0x16f2c9(0x1e6)]),console[_0x16f2c9(0x246)](_0x16f2c9(0x1c5)+_0x5a84e7[_0x16f2c9(0x240)]),await handleSDKOutput(_0x5a84e7[_0x16f2c9(0x251)],_0x1ac62f),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x11bc0d(0x1e1);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x261);async[a27_0x11bc0d(0x177)](_0x1df5e8){const _0x1fd6e5=a27_0x11bc0d,{options:_0x4d653d,args:_0xb086bc,tdx:_0x3b52f6}=_0x1df5e8,_0x8df2eb=_0xb086bc[0x0];if(!requireNameOrPath(_0x8df2eb))return 0x1;_0x4d653d[_0x1fd6e5(0x203)]&&console['error']('Input:\x20'+_0x8df2eb);const {journeyId:_0x69b01a}=await resolveJourneyIdFromInput(_0x8df2eb,_0x4d653d,_0x3b52f6),_0x4b78b1=await withSpinner('Listing\x20journey\x20activations...',()=>_0x3b52f6[_0x1fd6e5(0x1a1)]['listActivationsFlat'](_0x69b01a),{'verbose':_0x4d653d[_0x1fd6e5(0x203)]}),_0xe57db4=_0x4b78b1['data'];return console[_0x1fd6e5(0x290)]('Found\x20'+_0xe57db4[_0x1fd6e5(0x173)]+_0x1fd6e5(0x1c3)+(_0xe57db4[_0x1fd6e5(0x173)]!==0x1?'s':'')),await handleSDKOutput(_0xe57db4,_0x4d653d),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x259);['description']=a27_0x11bc0d(0x194);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x51ea7a){const _0x4ce213=a27_0x11bc0d,_0x1b8a94=_0x51ea7a['args'][0x0];let _0x399f94;if(_0x1b8a94){const _0x238f92=await resolveTarget({'arg':_0x1b8a94,'contextParent':_0x51ea7a[_0x4ce213(0x249)][_0x4ce213(0x1ce)],'cwd':process['cwd']()});isSuccessfulResolution(_0x238f92)&&_0x238f92[_0x4ce213(0x1a3)]===_0x4ce213(0x17d)&&(_0x399f94=_0x238f92[_0x4ce213(0x274)]);}const _0x569ad9={..._0x51ea7a,'options':{..._0x51ea7a[_0x4ce213(0x249)],'journeysOnly':!![],..._0x399f94&&{'singleFilePath':_0x399f94}}};return this[_0x4ce213(0x228)][_0x4ce213(0x177)](_0x569ad9);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x20e);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x276);async[a27_0x11bc0d(0x177)](_0x2bca27){const _0x2f7f71=a27_0x11bc0d,{options:_0x5d6a2b,args:_0x176404,tdx:_0x1b8282}=_0x2bca27,_0x111113=_0x176404[0x0];if(!requireNameOrPath(_0x111113))return 0x1;if(_0x5d6a2b[_0x2f7f71(0x203)])console[_0x2f7f71(0x290)](_0x2f7f71(0x1e8)+_0x111113);const {journeyId:_0x2bd957}=await resolveJourneyIdFromInput(_0x111113,_0x5d6a2b,_0x1b8282),_0x2dffa8=await withSpinner(_0x2f7f71(0x1e0),()=>_0x1b8282[_0x2f7f71(0x1a1)][_0x2f7f71(0x253)](_0x2bd957),{'verbose':_0x5d6a2b[_0x2f7f71(0x203)]}),{bundleName:_0x3a287f,versions:_0x51d5c9,latestJourneyId:_0x2c99fe}=_0x2dffa8[_0x2f7f71(0x1c7)];console[_0x2f7f71(0x290)](_0x3a287f+':\x20'+_0x51d5c9[_0x2f7f71(0x173)]+'\x20version'+(_0x51d5c9['length']!==0x1?'s':''));const _0x59e34d=_0x51d5c9[_0x2f7f71(0x184)](_0x4396e7=>({'version':_0x4396e7['versionNumber'],'journey_id':_0x4396e7['journeyId'],'name':_0x4396e7[_0x2f7f71(0x225)],'state':_0x4396e7[_0x2f7f71(0x17f)],'paused':_0x4396e7[_0x2f7f71(0x227)],'latest':_0x4396e7[_0x2f7f71(0x20d)]===_0x2c99fe,'created_at':_0x4396e7[_0x2f7f71(0x28f)]}));return await handleSDKOutput(_0x59e34d,_0x5d6a2b),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x1e2);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x1c0);async['execute'](_0x514e13){const _0x2b28de=a27_0x11bc0d,{options:_0x193d84,args:_0x449e6d,tdx:_0x4ad2bf}=_0x514e13,_0x5396f3=_0x449e6d[0x0];if(!requireNameOrPath(_0x5396f3))return 0x1;if(_0x193d84[_0x2b28de(0x203)])console[_0x2b28de(0x290)]('Input:\x20'+_0x5396f3);const {journeyId:_0x14c868,journeyName:_0x32c455}=await resolveJourneyIdFromInput(_0x5396f3,_0x193d84,_0x4ad2bf);if(!_0x193d84[_0x2b28de(0x244)]){const _0x1cff60=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x32c455+'\x22?');if(!_0x1cff60)return console[_0x2b28de(0x290)](_0x2b28de(0x195)),0x0;}const _0xdcedab=await withSpinner(_0x2b28de(0x19f),()=>_0x4ad2bf[_0x2b28de(0x1a1)][_0x2b28de(0x2a0)](_0x14c868),{'verbose':_0x193d84[_0x2b28de(0x203)]}),_0x405d5b=_0xdcedab[_0x2b28de(0x1c7)];return console[_0x2b28de(0x290)](a27_0x503b10[_0x2b28de(0x287)]('\u2714')+_0x2b28de(0x1b1)+_0x405d5b[_0x2b28de(0x1d9)][_0x2b28de(0x18c)]+'\x20(draft)\x20—\x20\x22'+_0x405d5b['attributes'][_0x2b28de(0x225)]+'\x22'),console[_0x2b28de(0x290)](_0x2b28de(0x209)+_0x405d5b['id']),await handleSingleObjectOutput({'id':_0x405d5b['id'],'name':_0x405d5b[_0x2b28de(0x1d9)][_0x2b28de(0x225)],'version':_0x405d5b[_0x2b28de(0x1d9)][_0x2b28de(0x18c)],'state':_0x405d5b[_0x2b28de(0x1d9)]['state'],'bundle_id':_0x405d5b[_0x2b28de(0x1d9)][_0x2b28de(0x24a)],'created_at':_0x405d5b[_0x2b28de(0x1d9)][_0x2b28de(0x28f)]},_0x193d84),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x1e9);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x269);async['execute'](_0x16223a){const _0x413453=a27_0x11bc0d,{options:_0x4b7d05,args:_0x31f15e,tdx:_0x3359bc}=_0x16223a,_0x5033d0=_0x31f15e[0x0];if(!requireNameOrPath(_0x5033d0))return 0x1;const _0x1a542c=_0x4b7d05[_0x413453(0x1fc)];if(!_0x1a542c)return console[_0x413453(0x290)](_0x413453(0x1fe)),console[_0x413453(0x290)](_0x413453(0x1a0)),0x1;const _0x372c30=parseInt(_0x1a542c,0xa);if(isNaN(_0x372c30)||_0x372c30<0x1)return console[_0x413453(0x290)](_0x413453(0x280)+_0x1a542c),0x1;if(_0x4b7d05[_0x413453(0x203)])console[_0x413453(0x290)]('Input:\x20'+_0x5033d0+',\x20version:\x20'+_0x372c30);const {journeyId:_0xf0acc9,parentSegmentId:_0x33a316}=await resolveJourneyIdFromInput(_0x5033d0,_0x4b7d05,_0x3359bc),_0x2a3b78=await withSpinner(_0x413453(0x224),()=>_0x3359bc[_0x413453(0x1a1)][_0x413453(0x253)](_0xf0acc9),{'verbose':_0x4b7d05[_0x413453(0x203)]}),{versions:_0x87f7e4,latestJourneyId:_0x38f0a8}=_0x2a3b78[_0x413453(0x1c7)],_0x257897=_0x87f7e4['find'](_0x517a78=>_0x517a78[_0x413453(0x18c)]===_0x372c30);if(!_0x257897){const _0x10f6a1=_0x87f7e4[_0x413453(0x184)](_0x1ebd63=>'v'+_0x1ebd63[_0x413453(0x18c)])[_0x413453(0x1cf)](',\x20');return console['error'](_0x413453(0x1aa)+_0x372c30+_0x413453(0x1ab)+_0x10f6a1),0x1;}const _0x4faf56=await withSpinner('Getting\x20version\x20'+_0x372c30+_0x413453(0x29c),()=>_0x3359bc[_0x413453(0x1a1)][_0x413453(0x22d)](_0x257897[_0x413453(0x20d)]),{'verbose':_0x4b7d05['verbose']}),_0x1d5b1e=_0x4faf56[_0x413453(0x1c7)],_0x40545b=getConsoleNextUrl(_0x4b7d05[_0x413453(0x2a7)],_0x413453(0x1d2)+_0x33a316+_0x413453(0x297)+_0x257897[_0x413453(0x20d)]+_0x413453(0x285));return await handleSingleObjectOutput({'id':_0x1d5b1e['id'],'name':_0x1d5b1e['attributes']['name'],'version':_0x1d5b1e['attributes']['versionNumber'],'description':_0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x281)],'state':_0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x17f)],'paused':_0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x227)],'reentry_mode':_0x1d5b1e[_0x413453(0x1d9)]['reentryMode'],'stages':_0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x221)]?.[_0x413453(0x173)]||0x0,..._0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x1c8)]&&{'goal':_0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x1c8)][_0x413453(0x225)]},'latest':_0x257897[_0x413453(0x20d)]===_0x38f0a8,'created_at':_0x1d5b1e['attributes'][_0x413453(0x28f)],'updated_at':_0x1d5b1e['attributes'][_0x413453(0x1ed)],'url':_0x40545b},_0x4b7d05),0x0;}}
1
+ const a30_0x242395=a30_0x5b1b;(function(_0x2a74d4,_0x763d39){const _0x23dab1=a30_0x5b1b,_0x3b1b9b=_0x2a74d4();while(!![]){try{const _0xae7c58=parseInt(_0x23dab1(0x1f0))/0x1*(parseInt(_0x23dab1(0x1fe))/0x2)+-parseInt(_0x23dab1(0x13c))/0x3*(parseInt(_0x23dab1(0x203))/0x4)+parseInt(_0x23dab1(0x1c3))/0x5+-parseInt(_0x23dab1(0x1c1))/0x6+parseInt(_0x23dab1(0x202))/0x7*(-parseInt(_0x23dab1(0x155))/0x8)+parseInt(_0x23dab1(0x1cf))/0x9+parseInt(_0x23dab1(0x1bf))/0xa;if(_0xae7c58===_0x763d39)break;else _0x3b1b9b['push'](_0x3b1b9b['shift']());}catch(_0x30f705){_0x3b1b9b['push'](_0x3b1b9b['shift']());}}}(a30_0x1f27,0x3dfe5));import a30_0x247543 from'chalk';function a30_0x1f27(){const _0x4d8456=['resourceName','database','Database:\x20','Write\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Listing\x20journey\x20versions...','2690990TeHKDD','repeat','1821396dePSne','targetDir','2178545cPVtpC','Aborted.','updatedAt','parentSegment','dryRun','\x20\x20Parent\x20segment:\x20','journeyStages','parentName','stage','Journey:','Error:\x20Invalid\x20version\x20number:\x20','Error:\x20--version\x20option\x20is\x20required','1458837hsOqzF','audienceId','activation','\x20@\x20','nodes','journey:version:create','red','ID:','(unnamed)','\x20\x20Consolidating\x20duplicate\x20segment:\x20','getParentFull','journey:columns','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','Warning:\x20Could\x20not\x20resolve\x20segment\x20','description','Parent\x20segment:\x20','\x20(ID:\x20','from','jsonl','Fetching\x20parent\x20segment...','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','data','\x22\x20resumed','\x20(draft)\x20—\x20\x22','scheduleType','Status:','resolveParentId','journey:pull','has','history','isNew','utf-8','segment','1YViRtn','\x22\x20not\x20found','pausedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Available\x20stages:\x20','listActivationsFlat','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Getting\x20journey\x20details...','listVersions','tdx.json','state','localeCompare','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','sort','767246qUIaav','runAt','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','pause','3004085WEVuYA','8AdbUXS','yellow','journeyName','length','cyan','type','.journey.yml','limit','Error:\x20Journey\x20not\x20found:\x20','\x20changed\x20files','\x20\x20-\x20','dim','renderStats','map','listJourneysFromParentSegment','goal','Target\x20file:\x20','resolveJourneyId','journey:version:view','Resolving\x20parent\x20segment...','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','launched','web','test','values','✔\x20All\x20files\x20are\x20up\x20to\x20date','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','session','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','connection','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','draft','journey:view','stageNameMap','push','No\x20statistics\x20available\x20for\x20journey:\x20','(none)','green','journeyId','yes','find','toLowerCase','List\x20all\x20versions\x20of\x20a\x20journey','segmentName','Listing\x20journeys...','\x20journey\x20files\x20to\x20','Error:\x20','hasChanges','json','Fetching\x20journey\x20','exitOrJumpRate','Pattern:\x20','Activations:','journey:run','\x22\x20paused','journey:resume','getActivation','filePath','connection\x20','columns','✔\x20Found\x20','parent_segment','segmentPushCommand','error','Journey\x20name:\x20','(draft)','\x20\x20Target:\x20','Getting\x20column\x20mapping...','getJourney','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x20Opening\x20','Show\x20journey\x20table\x20column\x20mapping','site','log','none','file','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20Parent\x20segment\x20context\x20required','then','Found\x20','Export\x20journey(s)\x20as\x20YAML\x20files','Input:\x20','table','conversion','Folder\x20path:\x20','Paused\x20at:','cwd','Getting\x20journey\x20statistics...','\x20not\x20found.\x20Available:\x20','execute','\x20version','\x20new\x20files','395817Smwlqn','goalSize','hasPeriod','versionNumber','root\x20folder','all','add','\x20Journey\x20workflow\x20started','executeDryRun','includeHistory','paused','📁\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','journey','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Error:\x20Invalid\x20--type\x20\x22','kind','Error:\x20Stage\x20\x22','/j/da/je','Parent\x20segment\x20ID:','\x27\x20not\x20found\x20in\x20','get','Resolving\x20journey...','State:','\x20=\x20','8MyPDFH','\x0aError:','Session:','blue','\x20details...','setPhase','enteredSize','getSegment','activation_','journeyBundleId','name','folderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','(archived)','user','no\x20connection','reentryMode','\x20files?','segments','\x5c$&','bold','resolveSegment','connectionId','milestoneSize','✔\x20Context\x20set:\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','set','journey:activations','connector_config','absolutePath','content','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Table:\x20','version','journeyBundleName','INVALID_ARGUMENT','🗺️\x20','folders','includeStats','buildIdToNameMap','diff','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','size','\x0aPull\x20summary:','journey:list','attributes','rootFolderId','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','journey:versions','Pausing\x20journey...','Show\x20journey\x20statistics','Resume\x20a\x20paused\x20journey','workflowSessionId','journey:traffic','\x20\x20Folder\x20path:\x20','buildIdToEmailMap','Paused:','rule','...','relative','createdAt','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20Journey\x20\x22','Cancelled','Resolving\x20version...','stages','\x20journey','getStatistics','\x20\x20←\x20','No\x20journeys\x20found','Triggering\x20journey\x20workflow...','runAfterJourneyRefresh','workflowId','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','activationParams',',\x20schedule:\x20','Listing\x20journey\x20activations...','Stages:','⚠️\x20','journey:stats','message','folderPath','Error:\x20Journey\x20\x27','relativePath','filter','split','join','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','/app/ps/','\x20versions)','run','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','format','(root)','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','/e/','Target\x20directory:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','verbose','Trigger\x20on-demand\x20journey\x20workflow\x20execution'];a30_0x1f27=function(){return _0x4d8456;};return a30_0x1f27();}import a30_0x326e95 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,getWorkflowSessionUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x107bab){const _0x461b7d=a30_0x5b1b;return!_0x107bab&&(console[_0x461b7d(0x11f)](_0x461b7d(0x1e3)),console[_0x461b7d(0x11f)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x107bab;}function withJsonFormat(_0x53ea4c){const _0x585773=a30_0x5b1b;if(!_0x53ea4c[_0x585773(0x1b1)]&&!_0x53ea4c['json']&&!_0x53ea4c[_0x585773(0x1e1)]&&!_0x53ea4c['tsv'])return{..._0x53ea4c,'format':_0x585773(0x233),'json':!![]};return _0x53ea4c;}function formatJourneyState(_0x2f3333){const _0x29830d=a30_0x5b1b;switch(_0x2f3333){case _0x29830d(0x218):return a30_0x247543[_0x29830d(0x228)]('(running)');case _0x29830d(0x222):return a30_0x247543['dim'](_0x29830d(0x121));case _0x29830d(0x146):return a30_0x247543[_0x29830d(0x204)]('(paused)');case'completed':return a30_0x247543[_0x29830d(0x158)]('(completed)');case'archived':return a30_0x247543[_0x29830d(0x20e)](_0x29830d(0x162));default:return'('+_0x2f3333+')';}}function a30_0x5b1b(_0xab05a2,_0x3ae91c){_0xab05a2=_0xab05a2-0x111;const _0x1f2719=a30_0x1f27();let _0x5b1b95=_0x1f2719[_0xab05a2];return _0x5b1b95;}function formatJourneyItem(_0x3f6524,_0x593db7='',_0x3fb256){const _0x37878c=a30_0x5b1b,_0x489b79=formatJourneyState(_0x3f6524['state']),_0x464dbe=_0x3fb256?hyperlink(_0x3f6524[_0x37878c(0x177)],_0x3fb256):_0x3f6524[_0x37878c(0x177)];return _0x593db7+_0x37878c(0x179)+_0x464dbe+'\x20'+_0x489b79;}function escapeRegex(_0x30b05c){const _0x2102c4=a30_0x5b1b;return _0x30b05c['replace'](/[.*+?^${}()|[\]\\]/g,_0x2102c4(0x168));}function globToRegex(_0x545520){const _0x588dbf=a30_0x5b1b,_0x4bb3f7=_0x545520[_0x588dbf(0x1aa)]('*')[_0x588dbf(0x210)](escapeRegex);return new RegExp(_0x4bb3f7[_0x588dbf(0x1ab)]('.*'),'i');}function buildRuleToNameMapping(_0x535d52){const _0x536a22=a30_0x5b1b,_0x564b5b=new Map();if(_0x535d52[_0x536a22(0x167)])for(const [_0xeb7f4c,_0x558c93]of Object['entries'](_0x535d52['segments'])){if(_0x558c93[_0x536a22(0x18e)]){const _0xa6102d=serializeRule(_0x558c93['rule']),_0x58793f=_0x564b5b['get'](_0xa6102d);_0x58793f?_0x58793f['push'](_0xeb7f4c):_0x564b5b[_0x536a22(0x16f)](_0xa6102d,[_0xeb7f4c]);}}return _0x564b5b;}async function resolveJourneyIdFromInput(_0x4a56d8,_0x4969aa,_0x253dfe){const _0x150c74=a30_0x5b1b,_0x301480=await resolveJourneyTarget(_0x4a56d8,_0x4969aa[_0x150c74(0x1c6)],_0x4969aa['verbose']),_0x385de7=_0x301480[_0x150c74(0x1c6)];if(!_0x385de7)throw new SDKError(ErrorCode[_0x150c74(0x178)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0xc48321=await withSpinner(_0x150c74(0x216),()=>_0x253dfe['segment']['resolveParentId'](_0x385de7),{'verbose':_0x4969aa[_0x150c74(0x1b7)]}),_0x42493d=_0xc48321[_0x150c74(0x1e4)],_0x31d147=await withSpinner(_0x150c74(0x152),()=>_0x253dfe[_0x150c74(0x149)][_0x150c74(0x214)](_0x42493d,_0x301480[_0x150c74(0x205)]),{'verbose':_0x4969aa[_0x150c74(0x1b7)]});return{'journeyId':_0x31d147['data'],'journeyName':_0x301480[_0x150c74(0x205)],'parentSegmentId':_0x42493d};}async function resolveJourneyTarget(_0x1a5885,_0x48ebce,_0x3f4a5b){const _0x5c3f0e=a30_0x5b1b;if(isYamlFilePath(_0x1a5885))try{const _0x3f369e=await resolveYamlFilePath(_0x1a5885);return _0x3f4a5b&&(console[_0x5c3f0e(0x11f)]('Resolved\x20YAML\x20file:\x20'+_0x1a5885),console[_0x5c3f0e(0x11f)](_0x5c3f0e(0x1c8)+_0x3f369e[_0x5c3f0e(0x1c6)]),console[_0x5c3f0e(0x11f)]('\x20\x20Name:\x20'+_0x3f369e[_0x5c3f0e(0x22e)]),console[_0x5c3f0e(0x11f)](_0x5c3f0e(0x18b)+(_0x3f369e[_0x5c3f0e(0x1a6)]||_0x5c3f0e(0x1b2)))),{'journeyName':_0x3f369e['segmentName'],'parentSegment':_0x3f369e['parentSegment'],'resolved':_0x3f369e};}catch(_0x1a5d7d){throw new SDKError(ErrorCode[_0x5c3f0e(0x178)],_0x5c3f0e(0x1bd)+_0x1a5d7d[_0x5c3f0e(0x1a5)]);}if(!_0x48ebce)throw new SDKError(ErrorCode[_0x5c3f0e(0x178)],_0x5c3f0e(0x174));return{'journeyName':_0x1a5885,'parentSegment':_0x48ebce};}export class JourneyListCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x181);['description']='List\x20journeys\x20in\x20current\x20context';async['execute'](_0x198efd){const _0x16ef6e=a30_0x242395,{options:_0x4e979b,args:_0x1a921f,tdx:_0x42f25b}=_0x198efd,_0x3e81fe=_0x1a921f[0x0],_0x4eca6d=_0x4e979b[_0x16ef6e(0x1c6)];if(!_0x4eca6d)return console[_0x16ef6e(0x11f)](_0x16ef6e(0x12d)),console[_0x16ef6e(0x11f)](_0x16ef6e(0x16e)),0x1;const _0x1873a6=await withSpinner(_0x16ef6e(0x216),()=>_0x42f25b[_0x16ef6e(0x1ef)]['resolveParentId'](_0x4eca6d),{'verbose':_0x4e979b[_0x16ef6e(0x1b7)]}),_0x16c4b6=_0x1873a6[_0x16ef6e(0x1e4)];_0x4e979b[_0x16ef6e(0x1b7)]&&(console['error']('Parent\x20segment:\x20'+_0x4eca6d+_0x16ef6e(0x1df)+_0x16c4b6+')'),_0x3e81fe&&console[_0x16ef6e(0x11f)](_0x16ef6e(0x113)+_0x3e81fe));const _0x456d6d=await withSpinner(_0x16ef6e(0x1e2),()=>_0x42f25b[_0x16ef6e(0x1ef)][_0x16ef6e(0x1d9)](_0x16c4b6),{'verbose':_0x4e979b['verbose']}),_0x4f0677=_0x456d6d[_0x16ef6e(0x1e4)],_0x4eb520=_0x4f0677[_0x16ef6e(0x183)],_0x5d839e=await withSpinner(_0x16ef6e(0x22f),()=>_0x42f25b['journey']['listJourneysWithFolders'](_0x16c4b6,_0x4eb520),{'verbose':_0x4e979b[_0x16ef6e(0x1b7)]});let _0x460289=_0x5d839e[_0x16ef6e(0x1e4)]['journeys'];const _0x1a8cc4=_0x5d839e[_0x16ef6e(0x1e4)][_0x16ef6e(0x17a)],_0x2e1025=new Map();for(const _0x3d1085 of _0x1a8cc4){_0x2e1025[_0x16ef6e(0x16f)](_0x3d1085['id'],_0x3d1085[_0x16ef6e(0x15f)]);}if(_0x3e81fe){const _0x47ee45=globToRegex(_0x3e81fe);_0x460289=_0x460289[_0x16ef6e(0x1a9)](_0x4ab1e0=>_0x47ee45[_0x16ef6e(0x21a)](_0x4ab1e0['journeyBundleName']));}console[_0x16ef6e(0x11f)](_0x16ef6e(0x11c)+_0x460289[_0x16ef6e(0x206)]+_0x16ef6e(0x197)+(_0x460289[_0x16ef6e(0x206)]!==0x1?'s':''));const _0x266631=_0x25092a=>{const _0x515373=_0x16ef6e;return getConsoleNextUrl(_0x4e979b[_0x515373(0x128)],_0x515373(0x1ad)+_0x16c4b6+'/e/'+_0x25092a+'/j/da');};if(_0x4e979b[_0x16ef6e(0x1b1)]===_0x16ef6e(0x132))await handleSDKOutput(_0x460289,_0x4e979b);else{if(_0x4e979b[_0x16ef6e(0x1b1)]==='json'){const _0x4cb109=_0x460289[_0x16ef6e(0x210)](_0x3d9298=>({..._0x3d9298,'url':_0x266631(_0x3d9298['id'])}));await handleSDKOutput(_0x4cb109,_0x4e979b);}else{console[_0x16ef6e(0x129)]('['+_0x4eca6d+']');const _0x4ad449=new Map(),_0x566e7d=[];for(const _0x3a5b9a of _0x460289){if(!_0x3a5b9a[_0x16ef6e(0x160)]||_0x3a5b9a[_0x16ef6e(0x160)]===_0x4eb520)_0x566e7d[_0x16ef6e(0x225)](_0x3a5b9a);else{const _0x2d372c=_0x4ad449[_0x16ef6e(0x151)](_0x3a5b9a[_0x16ef6e(0x160)])||[];_0x2d372c[_0x16ef6e(0x225)](_0x3a5b9a),_0x4ad449[_0x16ef6e(0x16f)](_0x3a5b9a['folderId'],_0x2d372c);}}const _0x33ae00=(_0x28ae83,_0x5ee218)=>_0x28ae83[_0x16ef6e(0x177)][_0x16ef6e(0x1fb)](_0x5ee218[_0x16ef6e(0x177)],undefined,{'sensitivity':'base'});_0x566e7d[_0x16ef6e(0x1fd)](_0x33ae00);for(const _0x3e530a of _0x566e7d){console[_0x16ef6e(0x129)](formatJourneyItem(_0x3e530a,'',_0x266631(_0x3e530a['id'])));}const _0x375976=[..._0x4ad449['entries']()][_0x16ef6e(0x1fd)]((_0x174056,_0x24ec84)=>{const _0x146f1f=_0x16ef6e,_0x620b04=_0x2e1025['get'](_0x174056[0x0])||_0x174056[0x0],_0x53db4d=_0x2e1025[_0x146f1f(0x151)](_0x24ec84[0x0])||_0x24ec84[0x0];return _0x620b04['localeCompare'](_0x53db4d,undefined,{'sensitivity':'base'});});for(const [_0x875c8a,_0x3549a8]of _0x375976){const _0x150265=_0x2e1025['get'](_0x875c8a)||_0x875c8a;console[_0x16ef6e(0x129)](_0x16ef6e(0x147)+_0x150265),_0x3549a8['sort'](_0x33ae00);for(const _0x16f313 of _0x3549a8){console[_0x16ef6e(0x129)](formatJourneyItem(_0x16f313,'\x20\x20',_0x266631(_0x16f313['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x223);['description']='Show\x20journey\x20details';async['execute'](_0x3b5715){const _0x59311c=a30_0x242395,{options:_0x1c92cc,args:_0x4ee79b,tdx:_0x982dbb}=_0x3b5715,_0x15db16=_0x4ee79b[0x0];if(!_0x15db16)return console[_0x59311c(0x11f)](_0x59311c(0x1e3)),console[_0x59311c(0x11f)](_0x59311c(0x1f6)),console[_0x59311c(0x11f)]('Options:'),console[_0x59311c(0x11f)](_0x59311c(0x1b3)),0x1;_0x1c92cc[_0x59311c(0x1b7)]&&console['error']('Input:\x20'+_0x15db16);const {journeyId:_0x5e7466,parentSegmentId:_0x35625a}=await resolveJourneyIdFromInput(_0x15db16,_0x1c92cc,_0x982dbb);if(_0x1c92cc[_0x59311c(0x219)]){const _0x5c5c4f=getConsoleNextUrl(_0x1c92cc[_0x59311c(0x128)],'/app/ps/'+_0x35625a+'/e/'+_0x5e7466+'/j/da/je');return console['error'](a30_0x247543[_0x59311c(0x228)]('✔')+_0x59311c(0x126)+a30_0x247543[_0x59311c(0x207)](_0x5c5c4f)),openBrowser(_0x5c5c4f),0x0;}const _0x19cf90=await withSpinner(_0x59311c(0x1f7),()=>_0x982dbb[_0x59311c(0x149)][_0x59311c(0x124)](_0x5e7466),{'verbose':_0x1c92cc[_0x59311c(0x1b7)]}),_0x52eb18=_0x19cf90[_0x59311c(0x1e4)],_0x33d392=_0x1c92cc[_0x59311c(0x17b)];let _0x4cdde7;if(_0x33d392)try{const _0x2dd32c=await withSpinner(_0x59311c(0x137),()=>_0x982dbb[_0x59311c(0x149)][_0x59311c(0x198)](_0x5e7466),{'verbose':_0x1c92cc[_0x59311c(0x1b7)]});_0x4cdde7=_0x2dd32c[_0x59311c(0x1e4)];}catch{_0x1c92cc[_0x59311c(0x1b7)]&&console['error']('\x20\x20Statistics\x20not\x20available');}const _0x2885d5=getConsoleNextUrl(_0x1c92cc[_0x59311c(0x128)],_0x59311c(0x1ad)+_0x35625a+_0x59311c(0x1b4)+_0x5e7466+_0x59311c(0x14e)),_0x1e096e={'id':_0x52eb18['id'],'name':_0x52eb18[_0x59311c(0x182)][_0x59311c(0x15f)],'description':_0x52eb18[_0x59311c(0x182)]['description'],'state':_0x52eb18[_0x59311c(0x182)][_0x59311c(0x1fa)],'paused':_0x52eb18['attributes'][_0x59311c(0x146)],'reentry_mode':_0x52eb18[_0x59311c(0x182)][_0x59311c(0x165)],'stages':_0x52eb18['attributes'][_0x59311c(0x1c9)]?.[_0x59311c(0x206)]||0x0,..._0x52eb18[_0x59311c(0x182)]['goal']&&{'goal':_0x52eb18['attributes'][_0x59311c(0x212)]['name']},..._0x4cdde7&&{'statistics':{'size':_0x4cdde7['size'],'entered':_0x4cdde7[_0x59311c(0x15b)],'goal_achieved':_0x4cdde7[_0x59311c(0x13d)],'completion_rate':_0x4cdde7['completionRate'],'exit_or_jump':_0x4cdde7['exitOrJumpSize'],'exit_or_jump_rate':_0x4cdde7[_0x59311c(0x112)],'stages':_0x4cdde7[_0x59311c(0x196)]}},'url':_0x2885d5};return await handleSingleObjectOutput(_0x1e096e,_0x1c92cc),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x1a4);[a30_0x242395(0x1dd)]=a30_0x242395(0x187);async[a30_0x242395(0x139)](_0x62ff1f){const _0xf829f6=a30_0x242395,{options:_0x318391,args:_0x3a888e,tdx:_0x45b717}=_0x62ff1f,_0x2211e6=_0x3a888e[0x0];if(!requireNameOrPath(_0x2211e6))return 0x1;_0x318391[_0xf829f6(0x1b7)]&&console[_0xf829f6(0x11f)](_0xf829f6(0x131)+_0x2211e6);const _0x3e53f3=_0x318391,_0xa253e7=_0x3e53f3[_0xf829f6(0x1e0)],_0x2a1cbc=_0x3e53f3['to'],_0x5d5668=_0x3e53f3[_0xf829f6(0x145)],_0x375cf5=_0x3e53f3[_0xf829f6(0x1cb)];_0x5d5668&&!_0xa253e7&&!_0x2a1cbc&&console['error'](_0xf829f6(0x1b0));const _0x226012=_0x5d5668?withJsonFormat(_0x318391):_0x318391,{journeyId:_0x3b63a0,journeyName:_0x12c234}=await resolveJourneyIdFromInput(_0x2211e6,_0x226012,_0x45b717),_0x17a196=_0xa253e7||_0x2a1cbc?{'from':_0xa253e7,'to':_0x2a1cbc}:undefined,_0x1795ac=await withSpinner(_0xf829f6(0x137),()=>Promise[_0xf829f6(0x141)]([_0x45b717[_0xf829f6(0x149)][_0xf829f6(0x124)](_0x3b63a0),_0x45b717[_0xf829f6(0x149)]['getStatistics'](_0x3b63a0,_0x17a196)]),{'verbose':_0x226012[_0xf829f6(0x1b7)]}),[_0x353093,_0x4206c3]=_0x1795ac['data'];if(!_0x4206c3||_0x4206c3[_0xf829f6(0x229)]===null)return console[_0xf829f6(0x11f)](_0xf829f6(0x226)+_0x12c234),console[_0xf829f6(0x11f)](_0xf829f6(0x200)),0x0;const _0x18fe2c=buildStageNameMap(_0x353093),_0x40196a=!!(_0x17a196&&_0x4206c3['history']?.[_0xf829f6(0x206)]),_0x257c8b={'stageNameMap':_0x18fe2c,'hasPeriod':_0x40196a,'includeHistory':!!_0x5d5668};if(_0x375cf5&&_0x4206c3[_0xf829f6(0x196)]){const _0x2067bf=_0x4206c3[_0xf829f6(0x196)][_0xf829f6(0x22b)](_0x3aff99=>{const _0x3d2cf6=_0xf829f6,_0x30edbc=_0x18fe2c['get'](_0x3aff99['id'])??'';return _0x30edbc[_0x3d2cf6(0x22c)]()===_0x375cf5[_0x3d2cf6(0x22c)]();});if(_0x2067bf)return await handleSingleObjectOutput(formatStageStats(_0x2067bf,_0x257c8b),_0x226012),0x0;const _0x2af79b=_0x4206c3[_0xf829f6(0x196)]['map'](_0x63443d=>_0x18fe2c[_0xf829f6(0x151)](_0x63443d['id'])??_0x63443d['id']);return console[_0xf829f6(0x11f)](_0xf829f6(0x14d)+_0x375cf5+_0xf829f6(0x1f1)),console[_0xf829f6(0x11f)](_0xf829f6(0x1f4)+_0x2af79b['join'](',\x20')),0x1;}const _0x479009=_0x4206c3[_0xf829f6(0x196)]?.[_0xf829f6(0x210)](_0x3a8f51=>formatStageStats(_0x3a8f51,_0x257c8b)),_0x3fb99d=assembleJourneyStats(_0x4206c3,{'from':_0xa253e7,'to':_0x2a1cbc,'includeHistory':_0x5d5668});return await this[_0xf829f6(0x20f)](_0x3fb99d,_0x479009??[],_0x226012),0x0;}async[a30_0x242395(0x20f)](_0x58f43b,_0x12be18,_0x510db0){const _0x2b5d4f=a30_0x242395,_0x1096b0=_0x510db0[_0x2b5d4f(0x1b1)]==='json'||_0x510db0[_0x2b5d4f(0x1b1)]===_0x2b5d4f(0x1e1)||_0x510db0['json']||_0x510db0[_0x2b5d4f(0x1e1)];if(_0x1096b0){_0x58f43b['stages']=_0x12be18,await handleSingleObjectOutput(_0x58f43b,_0x510db0);return;}await handleSingleObjectOutput(_0x58f43b,_0x510db0);for(const _0x43b635 of _0x12be18){console['log'](''),console['log'](String(a30_0x247543['cyan']['bold']('['+_0x43b635[_0x2b5d4f(0x15f)]+']'))+a30_0x247543['dim']('\x20'+_0x43b635['id']));const {id:_0x12d6c8,name:_0x486622,..._0x5872d9}=_0x43b635;await handleSingleObjectOutput(_0x5872d9,_0x510db0);}}}export class JourneyTrafficCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x18a);['description']=a30_0x242395(0x221);async[a30_0x242395(0x139)](_0x380a21){const _0x320650=a30_0x242395,{options:_0x378985,args:_0x1d722,tdx:_0x584f21}=_0x380a21,_0x2c2286=_0x1d722[0x0];if(!requireNameOrPath(_0x2c2286))return 0x1;_0x378985[_0x320650(0x1b7)]&&console[_0x320650(0x11f)]('Input:\x20'+_0x2c2286);const _0x154f56=_0x378985,_0xbe0ecf=_0x154f56['type'],_0x2fc01d=_0x154f56[_0x320650(0x1e0)],_0x23d230=_0x154f56['to'],_0x5aff24=_0x154f56[_0x320650(0x20a)];if(_0xbe0ecf&&_0xbe0ecf!==_0x320650(0x133)&&_0xbe0ecf!==_0x320650(0x1d1))return console[_0x320650(0x11f)](_0x320650(0x14b)+_0xbe0ecf+_0x320650(0x148)),0x1;const _0x4c836d=withJsonFormat(_0x378985),{journeyId:_0x16d048,journeyName:_0x85ab77}=await resolveJourneyIdFromInput(_0x2c2286,_0x4c836d,_0x584f21),_0x5604f4={'type':_0xbe0ecf,'from':_0x2fc01d,'to':_0x23d230,'limit':_0x5aff24},_0x5267d0=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x584f21[_0x320650(0x149)]['getTrafficData'](_0x16d048,_0x5604f4),{'verbose':_0x4c836d['verbose']}),_0x11c0eb=_0x5267d0['data'],_0x345440=_0x11c0eb['conversion']&&(_0x11c0eb['conversion'][_0x320650(0x1d3)]['length']>0x0||_0x11c0eb['conversion']['links'][_0x320650(0x206)]>0x0),_0x3e0ca2=_0x11c0eb[_0x320650(0x1d1)]&&_0x11c0eb[_0x320650(0x1d1)][_0x320650(0x206)]>0x0;if(!_0x345440&&!_0x3e0ca2)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x85ab77),console['error'](_0x320650(0x17e)),_0x2fc01d&&_0x23d230&&console[_0x320650(0x11f)](_0x320650(0x19e)),0x0;return await handleSingleObjectOutput(_0x11c0eb,_0x4c836d),0x0;}}function formatStageStats(_0x1356fb,_0x328ca4){const _0x78da3f=a30_0x242395,_0x405624=_0x328ca4['hasPeriod']&&_0x1356fb[_0x78da3f(0x1ec)]?.['length']?aggregateStageHistory(_0x1356fb[_0x78da3f(0x1ec)]):{'size':_0x1356fb[_0x78da3f(0x17f)],'entered':_0x1356fb[_0x78da3f(0x15b)],'milestone':_0x1356fb[_0x78da3f(0x16c)],'milestone_rate':_0x1356fb['completeMilestoneRate'],'exit_or_jump':_0x1356fb['exitOrJumpSize'],'exit_or_jump_rate':_0x1356fb[_0x78da3f(0x112)]},_0x41450a={'id':_0x1356fb['id'],'name':_0x328ca4[_0x78da3f(0x224)][_0x78da3f(0x151)](_0x1356fb['id'])??_0x1356fb['id'],..._0x405624};return _0x328ca4[_0x78da3f(0x13e)]&&_0x328ca4['includeHistory']&&_0x1356fb[_0x78da3f(0x1ec)]&&(_0x41450a['history']=_0x1356fb['history']),_0x41450a;}export class JourneyPauseCommand extends BaseCommand{[a30_0x242395(0x15f)]='journey:pause';[a30_0x242395(0x1dd)]='Pause\x20a\x20running\x20journey';async['execute'](_0x2c010c){const _0x651185=a30_0x242395,{options:_0x76018c,args:_0x10e3b0,tdx:_0x4dbb5c}=_0x2c010c,_0x3b01fe=_0x10e3b0[0x0];if(!requireNameOrPath(_0x3b01fe))return 0x1;_0x76018c[_0x651185(0x1b7)]&&console[_0x651185(0x11f)]('Input:\x20'+_0x3b01fe);const {journeyId:_0x4679af,journeyName:_0xab0547}=await resolveJourneyIdFromInput(_0x3b01fe,_0x76018c,_0x4dbb5c);if(!_0x76018c[_0x651185(0x22a)]){const _0x15044d=await confirm(_0x651185(0x217)+_0xab0547+'\x22?');if(!_0x15044d)return console['error'](_0x651185(0x194)),0x0;}const _0x702e59=await withSpinner(_0x651185(0x186),()=>_0x4dbb5c['journey'][_0x651185(0x201)](_0x4679af),{'verbose':_0x76018c[_0x651185(0x1b7)]}),_0x11b082=_0x702e59[_0x651185(0x1e4)];return console[_0x651185(0x11f)](_0x651185(0x193)+_0x11b082[_0x651185(0x182)][_0x651185(0x15f)]+_0x651185(0x116)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x115);[a30_0x242395(0x1dd)]=a30_0x242395(0x1b8);async['execute'](_0x48c1c8){const _0x432587=a30_0x242395,{options:_0x172b91,args:_0x3e39bf,tdx:_0x194e64}=_0x48c1c8,_0x4e3e36=_0x3e39bf[0x0];if(!requireNameOrPath(_0x4e3e36))return 0x1;_0x172b91[_0x432587(0x1b7)]&&console[_0x432587(0x11f)]('Input:\x20'+_0x4e3e36);const {journeyId:_0x84e5a2,journeyName:_0x30d2b6}=await resolveJourneyIdFromInput(_0x4e3e36,_0x172b91,_0x194e64);if(_0x172b91[_0x432587(0x1c7)])return await this[_0x432587(0x144)](_0x48c1c8,_0x84e5a2,_0x30d2b6);if(!_0x172b91['yes']){const _0x2e79bf=await confirm(_0x432587(0x184)+_0x30d2b6+'\x22?');if(!_0x2e79bf)return console[_0x432587(0x11f)](_0x432587(0x194)),0x0;}const _0x4102e0=await withSpinner(_0x432587(0x19b),()=>_0x194e64[_0x432587(0x149)][_0x432587(0x1af)](_0x84e5a2),{'verbose':_0x172b91[_0x432587(0x1b7)]}),_0x411348=_0x4102e0[_0x432587(0x1e4)],_0x357523=getWorkflowSessionUrl(_0x172b91[_0x432587(0x128)],_0x411348[_0x432587(0x19d)],_0x411348['workflowSessionId']);return console[_0x432587(0x11f)]('\x0a'+a30_0x247543[_0x432587(0x228)]('✔')+_0x432587(0x143)),console[_0x432587(0x11f)]('\x20\x20'+a30_0x247543[_0x432587(0x20e)](_0x432587(0x1cc))+'\x20'+_0x30d2b6),console['error']('\x20\x20'+a30_0x247543['dim'](_0x432587(0x1e8))+'\x20'+_0x411348['status']),console['error']('\x20\x20'+a30_0x247543[_0x432587(0x20e)](_0x432587(0x157))+'\x20'+_0x411348[_0x432587(0x189)]),console[_0x432587(0x11f)]('\x20\x20'+_0x357523),0x0;}async[a30_0x242395(0x144)](_0x5604a2,_0x40a2ee,_0x263704){const _0x46027d=a30_0x242395,{options:_0x26cd83,tdx:_0x17a1db}=_0x5604a2,_0x20fa1f=await withSpinner(_0x46027d(0x111)+_0x263704+_0x46027d(0x18f),()=>Promise[_0x46027d(0x141)]([_0x17a1db['journey'][_0x46027d(0x124)](_0x40a2ee),_0x17a1db[_0x46027d(0x149)][_0x46027d(0x1f5)](_0x40a2ee)]),{'verbose':_0x26cd83[_0x46027d(0x1b7)]}),[_0x572dc0,_0xd80b8e]=_0x20fa1f['data'],_0x337d5b=_0x572dc0[_0x46027d(0x182)],_0x6d2980=_0x337d5b[_0x46027d(0x1c9)];console[_0x46027d(0x129)](a30_0x247543['bold']('Journey:'),_0x337d5b[_0x46027d(0x15f)]),console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x1d6)),_0x572dc0['id']),console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x153)),_0x337d5b[_0x46027d(0x1fa)]),console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x18d)),_0x337d5b[_0x46027d(0x146)]?a30_0x247543['yellow'](_0x46027d(0x22a)):a30_0x247543[_0x46027d(0x228)]('no')),console[_0x46027d(0x129)](a30_0x247543['bold'](_0x46027d(0x14f)),_0x337d5b[_0x46027d(0x1d0)]);const _0x3076c2=_0x6d2980['length']>0x0?'\x20('+_0x6d2980[_0x46027d(0x210)](_0x49a650=>_0x49a650[_0x46027d(0x15f)])[_0x46027d(0x1ab)](',\x20')+')':'';console[_0x46027d(0x129)](a30_0x247543['bold']('Stages:'),''+_0x6d2980['length']+_0x3076c2),console[_0x46027d(0x129)]('');if(_0xd80b8e[_0x46027d(0x206)]===0x0)console['log'](a30_0x247543[_0x46027d(0x169)]('Activations:'),a30_0x247543[_0x46027d(0x20e)]('(none)'));else{console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x114)));for(const _0x58647c of _0xd80b8e){const _0x18c38c=_0x58647c[_0x46027d(0x15f)]??_0x46027d(0x1d7),_0xd604da=_0x58647c['connectionId']!=null?'connection\x20'+_0x58647c[_0x46027d(0x16b)]:_0x46027d(0x164),_0x30117d=_0x58647c[_0x46027d(0x1e7)]?''+_0x58647c[_0x46027d(0x1e7)]+(_0x58647c['runAt']?_0x46027d(0x1d2)+_0x58647c[_0x46027d(0x1ff)]:''):_0x46027d(0x12a),_0x5f2457=_0x58647c[_0x46027d(0x19c)]?'\x20[runs\x20on\x20refresh]':'';console[_0x46027d(0x129)]('\x20\x20'+a30_0x247543[_0x46027d(0x204)](_0x46027d(0x1a3))+'\x20'+_0x18c38c+_0x46027d(0x199)+_0xd604da+_0x46027d(0x1a0)+_0x30117d+_0x5f2457);}}return console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x204)](_0x46027d(0x1db))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x117);[a30_0x242395(0x1dd)]=a30_0x242395(0x188);async['execute'](_0x33dd85){const _0x402e69=a30_0x242395,{options:_0x5405bc,args:_0xcb0ef3,tdx:_0x5b27ac}=_0x33dd85,_0x19c49f=_0xcb0ef3[0x0];if(!requireNameOrPath(_0x19c49f))return 0x1;_0x5405bc[_0x402e69(0x1b7)]&&console[_0x402e69(0x11f)](_0x402e69(0x131)+_0x19c49f);const {journeyId:_0x418a3b,journeyName:_0x38a210}=await resolveJourneyIdFromInput(_0x19c49f,_0x5405bc,_0x5b27ac);if(_0x5405bc['dryRun'])return await this['executeDryRun'](_0x33dd85,_0x418a3b,_0x38a210);if(!_0x5405bc[_0x402e69(0x22a)]){const _0x54a7be=await confirm(_0x402e69(0x1f3)+_0x38a210+'\x22?');if(!_0x54a7be)return console[_0x402e69(0x11f)](_0x402e69(0x194)),0x0;}const _0x336852=await withSpinner('Resuming\x20journey...',()=>_0x5b27ac['journey']['resume'](_0x418a3b),{'verbose':_0x5405bc['verbose']}),_0x106385=_0x336852[_0x402e69(0x1e4)];return console[_0x402e69(0x11f)](_0x402e69(0x193)+_0x106385[_0x402e69(0x182)][_0x402e69(0x15f)]+_0x402e69(0x1e5)),0x0;}async[a30_0x242395(0x144)](_0x586c6b,_0x3363f5,_0x11a451){const _0x16285b=a30_0x242395,{options:_0x1066b8,tdx:_0xb3018a}=_0x586c6b,_0x18972b=await withSpinner(_0x16285b(0x111)+_0x11a451+_0x16285b(0x18f),()=>Promise[_0x16285b(0x141)]([_0xb3018a[_0x16285b(0x149)][_0x16285b(0x124)](_0x3363f5),_0xb3018a[_0x16285b(0x149)][_0x16285b(0x1f5)](_0x3363f5)]),{'verbose':_0x1066b8[_0x16285b(0x1b7)]}),[_0xf528ec,_0x576273]=_0x18972b[_0x16285b(0x1e4)],_0x143246=_0xf528ec['attributes'],_0x5873e4=_0x143246[_0x16285b(0x1c9)];console['log'](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x1cc)),_0x143246[_0x16285b(0x15f)]),console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x1d6)),_0xf528ec['id']),console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)]('State:'),_0x143246['state']),console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x18d)),_0x143246[_0x16285b(0x146)]?a30_0x247543[_0x16285b(0x204)](_0x16285b(0x22a)):a30_0x247543[_0x16285b(0x228)]('no'));_0x143246[_0x16285b(0x1f2)]&&console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x135)),_0x143246[_0x16285b(0x1f2)]);console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)]('Parent\x20segment\x20ID:'),_0x143246['audienceId']);const _0x2952d0=_0x5873e4[_0x16285b(0x206)]>0x0?'\x20('+_0x5873e4[_0x16285b(0x210)](_0x4ddce1=>_0x4ddce1[_0x16285b(0x15f)])[_0x16285b(0x1ab)](',\x20')+')':'';console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x1a2)),''+_0x5873e4[_0x16285b(0x206)]+_0x2952d0),console[_0x16285b(0x129)]('');if(_0x576273[_0x16285b(0x206)]===0x0)console['log'](a30_0x247543['bold']('Activations:'),a30_0x247543[_0x16285b(0x20e)](_0x16285b(0x227)));else{console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x114)));for(const _0x27642b of _0x576273){const _0x1e2af4=_0x27642b['name']??_0x16285b(0x1d7),_0x30f57f=_0x27642b[_0x16285b(0x16b)]!=null?_0x16285b(0x11a)+_0x27642b[_0x16285b(0x16b)]:_0x16285b(0x164),_0x559e87=_0x27642b[_0x16285b(0x1e7)]?''+_0x27642b[_0x16285b(0x1e7)]+(_0x27642b[_0x16285b(0x1ff)]?_0x16285b(0x1d2)+_0x27642b['runAt']:''):_0x16285b(0x12a),_0x2a9215=_0x27642b[_0x16285b(0x19c)]?'\x20[runs\x20on\x20refresh]':'';console[_0x16285b(0x129)]('\x20\x20'+a30_0x247543[_0x16285b(0x204)]('⚠️\x20')+'\x20'+_0x1e2af4+_0x16285b(0x199)+_0x30f57f+_0x16285b(0x1a0)+_0x559e87+_0x2a9215);}}return console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x204)]('\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.')),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a30_0x242395(0x1ea);[a30_0x242395(0x1dd)]=a30_0x242395(0x130);async[a30_0x242395(0x139)](_0x566d4f){const _0x296f44=a30_0x242395,{options:_0x4f27c4,args:_0x11ddc2,tdx:_0x252690}=_0x566d4f,_0x2a82c8=_0x4f27c4,_0x3ebbcc=_0x11ddc2[0x0],_0x12d0a2=_0x3ebbcc&&isYamlFilePath(_0x3ebbcc),_0x1dd5e3=await resolveTarget({'arg':_0x12d0a2?_0x3ebbcc:undefined,'contextParent':_0x4f27c4[_0x296f44(0x1c6)],'cwd':process[_0x296f44(0x136)]()});if(!isSuccessfulResolution(_0x1dd5e3))return _0x1dd5e3['errorCode']==='no_parent'?(console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x204)](_0x296f44(0x12c))),console['error']('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console['error'](_0x296f44(0x161)),console[_0x296f44(0x11f)](_0x296f44(0x1b6)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a30_0x247543[_0x296f44(0x1d5)](_0x296f44(0x231)+_0x1dd5e3[_0x296f44(0x1a5)]+'\x0a')),_0x1dd5e3['helpText']&&console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x207)](_0x1dd5e3['helpText']))),0x1;let _0x16a0df=_0x12d0a2?undefined:_0x3ebbcc,_0x5a7a77,_0x4acf81;_0x1dd5e3[_0x296f44(0x208)]===_0x296f44(0x12b)&&(_0x16a0df=_0x1dd5e3[_0x296f44(0x1b9)],_0x5a7a77=_0x1dd5e3['filePath'],_0x4acf81=_0x1dd5e3[_0x296f44(0x1a6)]);const _0x5ba65b=_0x1dd5e3[_0x296f44(0x1ca)],_0x498ac7=_0x1dd5e3[_0x296f44(0x1c2)];_0x2a82c8[_0x296f44(0x1b7)]&&(console[_0x296f44(0x11f)](_0x296f44(0x1de)+_0x5ba65b),console[_0x296f44(0x11f)](_0x296f44(0x1b5)+_0x498ac7),_0x16a0df&&console['error'](_0x296f44(0x120)+_0x16a0df),_0x5a7a77&&console[_0x296f44(0x11f)](_0x296f44(0x213)+_0x5a7a77),_0x4acf81&&console[_0x296f44(0x11f)](_0x296f44(0x134)+_0x4acf81));const _0x255f4f=await withSpinner(_0x296f44(0x216),()=>_0x252690[_0x296f44(0x1ef)][_0x296f44(0x1e9)](_0x5ba65b),{'verbose':_0x4f27c4['verbose']}),_0x55c876=_0x255f4f['data'],{journeys:_0x39f31,folders:_0x316849}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x4bd0d3=_0x296f44,[_0x4afa34,_0x692e7f]=await Promise[_0x4bd0d3(0x141)]([_0x252690['journey'][_0x4bd0d3(0x211)](_0x55c876,undefined,{'includeAllVersions':!![]}),_0x252690[_0x4bd0d3(0x1ef)]['listFolders'](_0x55c876)]);return{'journeys':_0x4afa34,'folders':_0x692e7f};},{'verbose':_0x4f27c4[_0x296f44(0x1b7)]})[_0x296f44(0x12e)](_0x2f44e4=>_0x2f44e4[_0x296f44(0x1e4)]);let _0xdd5270=_0x39f31;const _0x543ef7=buildFolderIdToPathMap(_0x316849);if(_0x16a0df){const _0x3e8f64=_0xdd5270[_0x296f44(0x1a9)](_0x433653=>_0x433653[_0x296f44(0x177)]['toLowerCase']()===_0x16a0df[_0x296f44(0x22c)]());if(_0x3e8f64[_0x296f44(0x206)]===0x0)return console[_0x296f44(0x11f)](_0x296f44(0x20b)+_0x16a0df),console[_0x296f44(0x11f)](_0x296f44(0x1ac)),0x1;_0xdd5270=_0x3e8f64;}if(_0x4acf81!==undefined){const _0x525d9a=_0xdd5270[_0x296f44(0x1a9)](_0x505ea6=>{const _0x17d037=_0x296f44,_0x4a4b23=_0x505ea6[_0x17d037(0x160)]?_0x543ef7['get'](_0x505ea6['folderId'])||'':'';return _0x4a4b23===_0x4acf81;});if(_0x525d9a[_0x296f44(0x206)]===0x0&&_0xdd5270[_0x296f44(0x206)]>0x0){console[_0x296f44(0x11f)](_0x296f44(0x1a7)+_0x16a0df+_0x296f44(0x150)+(_0x4acf81||_0x296f44(0x140))),console[_0x296f44(0x11f)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x433f39 of _0xdd5270){const _0x2922be=_0x433f39[_0x296f44(0x160)]?_0x543ef7['get'](_0x433f39['folderId'])||'':'';console[_0x296f44(0x11f)](_0x296f44(0x20d)+(_0x2922be||_0x296f44(0x1b2))+'/'+_0x433f39[_0x296f44(0x177)]);}return 0x1;}_0xdd5270=_0x525d9a;}if(_0xdd5270['length']===0x0)return console[_0x296f44(0x11f)](_0x296f44(0x19a)),0x0;const _0x445779=new Map();for(const _0x25d50f of _0xdd5270){const _0x172e5b=_0x25d50f[_0x296f44(0x15e)];!_0x445779[_0x296f44(0x1eb)](_0x172e5b)&&_0x445779[_0x296f44(0x16f)](_0x172e5b,[]),_0x445779[_0x296f44(0x151)](_0x172e5b)[_0x296f44(0x225)](_0x25d50f);}for(const _0x421de2 of _0x445779[_0x296f44(0x21b)]()){_0x421de2[_0x296f44(0x1fd)]((_0x590c3b,_0x217474)=>(_0x590c3b['versionNumber']||0x0)-(_0x217474[_0x296f44(0x13f)]||0x0));}const _0x1f2674=[],{idToEmailMap:_0x22682f,connectionIdToNameMap:_0x2a9b6}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x5efb58=_0x296f44,[_0x5c0a81,_0x24dc15]=await Promise[_0x5efb58(0x141)]([_0x252690[_0x5efb58(0x163)][_0x5efb58(0x18c)](),_0x252690[_0x5efb58(0x220)][_0x5efb58(0x17c)]()]);return{'idToEmailMap':_0x5c0a81,'connectionIdToNameMap':_0x24dc15};},{'verbose':_0x4f27c4[_0x296f44(0x1b7)]})[_0x296f44(0x12e)](_0x5ae3ac=>_0x5ae3ac[_0x296f44(0x1e4)]);for(const _0x36703b of _0x445779[_0x296f44(0x21b)]()){const _0x2e5db8=_0x36703b[0x0][_0x296f44(0x177)],_0x1afd88=_0x36703b[0x0][_0x296f44(0x160)],_0x1f560f=_0x1afd88?_0x543ef7[_0x296f44(0x151)](_0x1afd88)||'':'',_0x4b541d=_0x1f560f?a30_0x326e95[_0x296f44(0x1ab)](_0x498ac7,_0x1f560f):_0x498ac7,_0x3aae6e=_0x5a7a77||a30_0x326e95[_0x296f44(0x1ab)](_0x4b541d,sanitizeFileName(_0x2e5db8)+_0x296f44(0x209));let _0x38ac90,_0x2e72f9;if(existsSync(_0x3aae6e))try{const _0x2c6387=readFileSync(_0x3aae6e,_0x296f44(0x1ee)),_0x507641=parseYamlString(_0x2c6387);_0x2e72f9=_0x507641,_0x38ac90=buildRuleToNameMapping(_0x507641),_0x2a82c8[_0x296f44(0x1b7)]&&_0x38ac90['size']>0x0&&console[_0x296f44(0x11f)](_0x296f44(0x12f)+_0x38ac90[_0x296f44(0x17f)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x2e5db8);}catch(_0x8d479d){_0x2a82c8[_0x296f44(0x1b7)]&&console[_0x296f44(0x11f)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x8d479d[_0x296f44(0x1a5)]);}const _0x4f20ce=[],_0x306c89=new Set(),_0x4babad=new Map(),_0x3f737b=new Map(),_0x52db2e=new Set(),_0x20b996=new Map(),_0x51415c=new Map(),_0x5e3625=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x2e5db8+_0x296f44(0x18f),async _0x4cde79=>{const _0x1bffc1=_0x296f44;for(const _0x20fe9c of _0x36703b){const _0x51b65b=_0x36703b[_0x1bffc1(0x206)]>0x1?_0x20fe9c['journeyBundleName']+'\x20v'+(_0x20fe9c[_0x1bffc1(0x13f)]||0x1):_0x20fe9c[_0x1bffc1(0x177)];_0x4cde79[_0x1bffc1(0x15a)]('Fetching\x20'+_0x51b65b);const _0x148ec9=await _0x252690[_0x1bffc1(0x149)][_0x1bffc1(0x124)](_0x20fe9c['id']),_0x5915f4=_0x148ec9[_0x1bffc1(0x182)]?.[_0x1bffc1(0x1d0)],_0x59b4bd={'resolveSegment':async _0x567f1e=>{const _0x2443f8=_0x1bffc1;if(!_0x5915f4)return{'name':_0x567f1e,'isJourneyLocal':![]};const _0x8ea0d8=_0x4babad[_0x2443f8(0x151)](_0x567f1e);if(_0x8ea0d8)return _0x8ea0d8;try{const _0x31688e=await _0x252690[_0x2443f8(0x1ef)][_0x2443f8(0x15c)](_0x5915f4,_0x567f1e),_0x2e4822=_0x31688e[_0x2443f8(0x14c)]===SEGMENT_KIND_JOURNEY;let _0x5b7836,_0x17eee0=_0x31688e[_0x2443f8(0x15f)];if(_0x2e4822&&_0x31688e[_0x2443f8(0x18e)]){const _0x242c3f=await segmentResponseToDef(_0x31688e,{'resolveSegmentName':async _0x9b76b5=>{const _0x228720=_0x2443f8,_0x323029=_0x4babad[_0x228720(0x151)](_0x9b76b5);if(_0x323029)return _0x323029[_0x228720(0x15f)];const _0x995b20=await _0x59b4bd[_0x228720(0x16a)](_0x9b76b5);return _0x995b20['name'];}}),_0x4e0534=_0x242c3f[_0x2443f8(0x18e)];_0x5b7836={'description':_0x31688e[_0x2443f8(0x1dd)],'rule':_0x4e0534};const _0x5c8ce8=serializeRule(_0x4e0534),_0x5d731b=_0x3f737b[_0x2443f8(0x151)](_0x5c8ce8);if(_0x5d731b)_0x17eee0=_0x5d731b,_0x5b7836=undefined,_0x2a82c8[_0x2443f8(0x1b7)]&&console[_0x2443f8(0x11f)](_0x2443f8(0x1d8)+_0x31688e[_0x2443f8(0x15f)]+'\x20->\x20'+_0x5d731b);else{let _0x2455d9=![];if(_0x38ac90){const _0xb39b51=_0x38ac90[_0x2443f8(0x151)](_0x5c8ce8);if(_0xb39b51){const _0x22cd1e=_0xb39b51[_0x2443f8(0x22b)](_0x5a8e9a=>!_0x306c89['has'](_0x5a8e9a));_0x22cd1e&&(_0x17eee0=_0x22cd1e,_0x306c89[_0x2443f8(0x142)](_0x22cd1e),_0x3f737b[_0x2443f8(0x16f)](_0x5c8ce8,_0x22cd1e),_0x2455d9=!![],_0x2a82c8['verbose']&&console[_0x2443f8(0x11f)](_0x2443f8(0x125)+_0x22cd1e+'\x20(rule\x20match)'));}}if(!_0x2455d9){const _0x68f4de=generateJourneyLocalName(_0x31688e[_0x2443f8(0x15f)]);_0x68f4de&&(_0x17eee0=_0x68f4de);let _0x5d58b8=_0x17eee0,_0x40c1ea=0x2;while(_0x306c89[_0x2443f8(0x1eb)](_0x5d58b8)){_0x5d58b8=_0x17eee0+'_'+_0x40c1ea,_0x40c1ea++;}_0x306c89[_0x2443f8(0x142)](_0x5d58b8),_0x3f737b['set'](_0x5c8ce8,_0x5d58b8),_0x17eee0=_0x5d58b8;}}}const _0x1aaf2f={'name':_0x17eee0,'isJourneyLocal':_0x2e4822,'definition':_0x5b7836};return _0x4babad[_0x2443f8(0x16f)](_0x567f1e,_0x1aaf2f),_0x1aaf2f;}catch(_0x325b3a){return _0x4f27c4['verbose']&&console[_0x2443f8(0x11f)](_0x2443f8(0x1dc)+_0x567f1e+':\x20'+_0x325b3a['message']),{'name':_0x567f1e,'isJourneyLocal':![]};}},'resolveActivation':async _0x53f4b0=>{const _0x334c33=_0x1bffc1,_0x4aef5a=_0x20b996['get'](_0x53f4b0);if(_0x4aef5a)return _0x4aef5a;try{const _0xe09e35=await _0x252690[_0x334c33(0x149)][_0x334c33(0x118)](_0x20fe9c['id'],_0x53f4b0),_0x77a5e1=journeyActivationStepToYaml(_0xe09e35,_0x22682f,_0x2a9b6),_0x3555d8=JSON['stringify']({'name':_0x77a5e1['name'],'connection':_0x77a5e1[_0x334c33(0x220)],'connector_config':_0x77a5e1[_0x334c33(0x171)]}),_0xd38ad5=_0x51415c['get'](_0x3555d8);if(_0xd38ad5){const _0x21f63f={'name':_0xd38ad5,'isJourneyLocal':!![],'definition':_0x77a5e1};return _0x20b996[_0x334c33(0x16f)](_0x53f4b0,_0x21f63f),_0x21f63f;}const _0x2f9c08=_0xe09e35[_0x334c33(0x182)][_0x334c33(0x19f)][_0x334c33(0x15f)]||_0x53f4b0,_0x4a26da=sanitizeYamlKey(_0x2f9c08)||_0x334c33(0x15d)+_0x53f4b0;let _0x227441=_0x4a26da,_0x1f0c7a=0x2;while(_0x52db2e[_0x334c33(0x1eb)](_0x227441)){_0x227441=_0x4a26da+'_'+_0x1f0c7a,_0x1f0c7a++;}_0x52db2e['add'](_0x227441),_0x51415c[_0x334c33(0x16f)](_0x3555d8,_0x227441);const _0x1569d9={'name':_0x227441,'isJourneyLocal':!![],'definition':_0x77a5e1};return _0x20b996[_0x334c33(0x16f)](_0x53f4b0,_0x1569d9),_0x1569d9;}catch(_0x21aea4){return _0x4f27c4[_0x334c33(0x1b7)]&&console[_0x334c33(0x11f)](_0x334c33(0x14a)+_0x53f4b0+':\x20'+_0x21aea4[_0x334c33(0x1a5)]),{'name':_0x53f4b0,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x35af3f,_0x1f3123)=>{const _0x1d498f=_0x1bffc1;return resolveJumpTarget(_0x35af3f,_0x1f3123,_0x5e3625,_0x12d3a4=>_0x252690[_0x1d498f(0x149)][_0x1d498f(0x124)](_0x12d3a4));}},_0x2c6232=await journeyResponseToDef(_0x148ec9,_0x59b4bd);_0x4f20ce[_0x1bffc1(0x225)]({'item':_0x20fe9c,'yaml':_0x2c6232});}},{'verbose':_0x4f27c4[_0x296f44(0x1b7)]});const _0x3608fb=await _0x252690[_0x296f44(0x149)]['getLatestJourneyId'](_0x36703b[0x0][_0x296f44(0x15e)]),_0x53f179=buildMergedJourneyDef(_0x4f20ce,_0x38ac90,_0x3608fb),_0x21f934=normalizeJourneyDef(_0x53f179,_0x2e72f9),_0x46cdee=toYamlString(_0x21f934),_0x4d4aa9=_0x5a7a77||a30_0x326e95[_0x296f44(0x1ab)](_0x4b541d,sanitizeFileName(_0x2e5db8)+'.journey.yml');!_0x5a7a77&&_0x1f560f&&!existsSync(_0x4b541d)&&mkdirSync(_0x4b541d,{'recursive':!![]});const _0x112b5d=a30_0x326e95[_0x296f44(0x190)](process[_0x296f44(0x136)](),_0x4d4aa9);if(existsSync(_0x4d4aa9)){const _0x5f0fb9=readFileSync(_0x4d4aa9,'utf-8'),_0x494894=generateDiff(_0x5f0fb9,_0x46cdee),_0x5b04e7=hasChanges(_0x494894);_0x1f2674[_0x296f44(0x225)]({'relativePath':_0x112b5d,'absolutePath':_0x4d4aa9,'content':_0x46cdee,'isNew':![],'hasChanges':_0x5b04e7,'diff':_0x5b04e7?formatDiffWithColors(_0x494894):undefined});}else _0x1f2674[_0x296f44(0x225)]({'relativePath':_0x112b5d,'absolutePath':_0x4d4aa9,'content':_0x46cdee,'isNew':!![],'hasChanges':![]});}const _0x4bc1cb=_0x1f2674[_0x296f44(0x1a9)](_0x5a8d04=>_0x5a8d04['isNew']),_0x42f045=_0x1f2674['filter'](_0x3679d4=>!_0x3679d4['isNew']&&_0x3679d4['hasChanges']),_0x36d61b=_0x1f2674[_0x296f44(0x1a9)](_0x3766e4=>!_0x3766e4[_0x296f44(0x1ed)]&&!_0x3766e4[_0x296f44(0x232)]),_0x297db0=_0xdd5270['length'],_0x5efce8=_0x445779['size'],_0x379d4f=_0x297db0>_0x5efce8?'\x20('+_0x297db0+_0x296f44(0x1ae):'';console[_0x296f44(0x11f)](_0x296f44(0x180)),console['error']('\x20\x20'+a30_0x247543[_0x296f44(0x207)](_0x5efce8+'\x20journeys')+a30_0x247543[_0x296f44(0x20e)](_0x379d4f)),console[_0x296f44(0x11f)]('\x20\x20'+a30_0x247543['green']('+\x20'+_0x4bc1cb['length']+_0x296f44(0x13b))),console['error']('\x20\x20'+a30_0x247543[_0x296f44(0x204)]('~\x20'+_0x42f045['length']+_0x296f44(0x20c))),console[_0x296f44(0x11f)]('\x20\x20'+a30_0x247543[_0x296f44(0x20e)]('=\x20'+_0x36d61b[_0x296f44(0x206)]+'\x20unchanged\x20files')),console[_0x296f44(0x11f)](_0x296f44(0x122)+a30_0x247543['cyan'](_0x498ac7)+'\x0a');if(_0x42f045[_0x296f44(0x206)]>0x0)for(const _0x15ec7c of _0x42f045){console[_0x296f44(0x11f)]('\x0aChanges\x20to\x20\x27'+_0x15ec7c[_0x296f44(0x1a8)]+'\x27:'),console[_0x296f44(0x11f)]('─'[_0x296f44(0x1c0)](0x3c)),console['error'](_0x15ec7c[_0x296f44(0x17d)]),console[_0x296f44(0x11f)]('─'[_0x296f44(0x1c0)](0x3c));}if(_0x2a82c8['dryRun'])return console['error'](a30_0x247543['yellow'](_0x296f44(0x192))),0x0;if(_0x4bc1cb[_0x296f44(0x206)]===0x0&&_0x42f045[_0x296f44(0x206)]===0x0)return console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)](_0x296f44(0x21c))),saveSessionContext({'parent_segment':_0x5ba65b},_0x2a82c8['session']),console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)](_0x296f44(0x16d)+a30_0x247543[_0x296f44(0x20e)](_0x296f44(0x11d))+_0x296f44(0x154)+a30_0x247543[_0x296f44(0x207)](_0x5ba65b))),0x0;if(!_0x2a82c8[_0x296f44(0x22a)]&&(_0x4bc1cb[_0x296f44(0x206)]>0x0||_0x42f045[_0x296f44(0x206)]>0x0)){if(!isInteractive())return console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x1d5)](_0x296f44(0x156)),_0x296f44(0x1fc)),console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x20e)](_0x296f44(0x21f))),0x1;const _0x5b8689=await confirmKey(_0x296f44(0x1bc)+(_0x4bc1cb[_0x296f44(0x206)]+_0x42f045[_0x296f44(0x206)])+_0x296f44(0x166));if(!_0x5b8689)return console['error'](a30_0x247543['yellow'](_0x296f44(0x1c4)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x498ac7)&&mkdirSync(_0x498ac7,{'recursive':!![]});const _0x471f01=a30_0x326e95[_0x296f44(0x1ab)](_0x498ac7,_0x296f44(0x1f9));writeFileSync(_0x471f01,createTdxConfigContent(_0x5ba65b),_0x296f44(0x1ee));for(const _0x110952 of _0x1f2674){(_0x110952[_0x296f44(0x1ed)]||_0x110952[_0x296f44(0x232)])&&writeFileSync(_0x110952[_0x296f44(0x172)],_0x110952[_0x296f44(0x173)],_0x296f44(0x1ee));}return console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)]('✔\x20Pulled\x20'+(_0x4bc1cb['length']+_0x42f045[_0x296f44(0x206)])+_0x296f44(0x230)+_0x498ac7)),saveSessionContext({'parent_segment':_0x5ba65b},_0x2a82c8[_0x296f44(0x21e)]),console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)](_0x296f44(0x16d)+a30_0x247543[_0x296f44(0x20e)](_0x296f44(0x11d))+_0x296f44(0x154)+a30_0x247543['cyan'](_0x5ba65b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x1da);[a30_0x242395(0x1dd)]=a30_0x242395(0x127);async[a30_0x242395(0x139)](_0x4934c7){const _0xccda4a=a30_0x242395,{options:_0x281868,args:_0x3d54e7,tdx:_0x19d69d}=_0x4934c7,_0x5747fd=_0x3d54e7[0x0];if(!requireNameOrPath(_0x5747fd))return 0x1;_0x281868[_0xccda4a(0x1b7)]&&console[_0xccda4a(0x11f)]('Input:\x20'+_0x5747fd);const {journeyId:_0x6691f8}=await resolveJourneyIdFromInput(_0x5747fd,_0x281868,_0x19d69d),_0x5b096e=await withSpinner(_0xccda4a(0x123),()=>_0x19d69d[_0xccda4a(0x149)]['getColumnMapping'](_0x6691f8),{'verbose':_0x281868[_0xccda4a(0x1b7)]}),_0x431a33=_0x5b096e[_0xccda4a(0x1e4)];return console[_0xccda4a(0x129)](_0xccda4a(0x1bb)+_0x431a33[_0xccda4a(0x1ba)]),console['log'](_0xccda4a(0x175)+_0x431a33[_0xccda4a(0x132)]),await handleSDKOutput(_0x431a33[_0xccda4a(0x11b)],_0x281868),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x170);['description']='List\x20activations\x20for\x20a\x20journey';async[a30_0x242395(0x139)](_0x438b93){const _0x48541f=a30_0x242395,{options:_0x5cb539,args:_0x501ecb,tdx:_0x4e5c58}=_0x438b93,_0x4ce543=_0x501ecb[0x0];if(!requireNameOrPath(_0x4ce543))return 0x1;_0x5cb539[_0x48541f(0x1b7)]&&console[_0x48541f(0x11f)](_0x48541f(0x131)+_0x4ce543);const {journeyId:_0x5a9e02}=await resolveJourneyIdFromInput(_0x4ce543,_0x5cb539,_0x4e5c58),_0x4fba4d=await withSpinner(_0x48541f(0x1a1),()=>_0x4e5c58[_0x48541f(0x149)][_0x48541f(0x1f5)](_0x5a9e02),{'verbose':_0x5cb539[_0x48541f(0x1b7)]}),_0x35cb3d=_0x4fba4d[_0x48541f(0x1e4)];return console[_0x48541f(0x11f)]('Found\x20'+_0x35cb3d[_0x48541f(0x206)]+'\x20activation'+(_0x35cb3d[_0x48541f(0x206)]!==0x1?'s':'')),await handleSDKOutput(_0x35cb3d,_0x5cb539),0x0;}}export class JourneyPushCommand extends BaseCommand{[a30_0x242395(0x15f)]='journey:push';['description']=a30_0x242395(0x21d);[a30_0x242395(0x11e)]=new SegmentPushCommand();async['execute'](_0x125e68){const _0x210a29=a30_0x242395,_0x7acc73=_0x125e68['args'][0x0];let _0x375bc4;if(_0x7acc73){const _0x2084ae=await resolveTarget({'arg':_0x7acc73,'contextParent':_0x125e68['options'][_0x210a29(0x1c6)],'cwd':process['cwd']()});isSuccessfulResolution(_0x2084ae)&&_0x2084ae[_0x210a29(0x208)]===_0x210a29(0x12b)&&(_0x375bc4=_0x2084ae[_0x210a29(0x119)]);}const _0x218290={..._0x125e68,'options':{..._0x125e68['options'],'journeysOnly':!![],..._0x375bc4&&{'singleFilePath':_0x375bc4}}};return this['segmentPushCommand']['execute'](_0x218290);}}export class JourneyVersionsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x185);[a30_0x242395(0x1dd)]=a30_0x242395(0x22d);async[a30_0x242395(0x139)](_0x149551){const _0x23fbd0=a30_0x242395,{options:_0x2ea128,args:_0x30b25b,tdx:_0x1eedda}=_0x149551,_0x35e7c6=_0x30b25b[0x0];if(!requireNameOrPath(_0x35e7c6))return 0x1;if(_0x2ea128['verbose'])console[_0x23fbd0(0x11f)](_0x23fbd0(0x131)+_0x35e7c6);const {journeyId:_0x511d43}=await resolveJourneyIdFromInput(_0x35e7c6,_0x2ea128,_0x1eedda),_0x1230fd=await withSpinner(_0x23fbd0(0x1be),()=>_0x1eedda[_0x23fbd0(0x149)]['listVersions'](_0x511d43),{'verbose':_0x2ea128[_0x23fbd0(0x1b7)]}),{bundleName:_0x2bcc3a,versions:_0x4833be,latestJourneyId:_0x162361}=_0x1230fd['data'];console['error'](_0x2bcc3a+':\x20'+_0x4833be[_0x23fbd0(0x206)]+_0x23fbd0(0x13a)+(_0x4833be[_0x23fbd0(0x206)]!==0x1?'s':''));const _0x1be073=_0x4833be[_0x23fbd0(0x210)](_0x57409d=>({'version':_0x57409d[_0x23fbd0(0x13f)],'journey_id':_0x57409d[_0x23fbd0(0x229)],'name':_0x57409d['name'],'state':_0x57409d['state'],'paused':_0x57409d[_0x23fbd0(0x146)],'latest':_0x57409d['journeyId']===_0x162361,'created_at':_0x57409d[_0x23fbd0(0x191)]}));return await handleSDKOutput(_0x1be073,_0x2ea128),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x1d4);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a30_0x242395(0x139)](_0x2478b6){const _0x462110=a30_0x242395,{options:_0x406056,args:_0x47ba17,tdx:_0x47eadb}=_0x2478b6,_0x4d9dad=_0x47ba17[0x0];if(!requireNameOrPath(_0x4d9dad))return 0x1;if(_0x406056[_0x462110(0x1b7)])console['error']('Input:\x20'+_0x4d9dad);const {journeyId:_0x1977e3,journeyName:_0x53adb2}=await resolveJourneyIdFromInput(_0x4d9dad,_0x406056,_0x47eadb);if(!_0x406056[_0x462110(0x22a)]){const _0x2cf70d=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x53adb2+'\x22?');if(!_0x2cf70d)return console[_0x462110(0x11f)]('Cancelled'),0x0;}const _0x26e8c1=await withSpinner('Creating\x20new\x20version...',()=>_0x47eadb['journey']['createVersion'](_0x1977e3),{'verbose':_0x406056[_0x462110(0x1b7)]}),_0x3ecf46=_0x26e8c1[_0x462110(0x1e4)];return console['error'](a30_0x247543[_0x462110(0x228)]('\u2714')+'\x20Created\x20v'+_0x3ecf46[_0x462110(0x182)][_0x462110(0x13f)]+_0x462110(0x1e6)+_0x3ecf46[_0x462110(0x182)][_0x462110(0x15f)]+'\x22'),console['error']('\x20\x20Journey\x20ID:\x20'+_0x3ecf46['id']),await handleSingleObjectOutput({'id':_0x3ecf46['id'],'name':_0x3ecf46['attributes'][_0x462110(0x15f)],'version':_0x3ecf46[_0x462110(0x182)][_0x462110(0x13f)],'state':_0x3ecf46[_0x462110(0x182)][_0x462110(0x1fa)],'bundle_id':_0x3ecf46[_0x462110(0x182)][_0x462110(0x15e)],'created_at':_0x3ecf46['attributes'][_0x462110(0x191)]},_0x406056),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x215);['description']='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async['execute'](_0x588c05){const _0x1f0169=a30_0x242395,{options:_0x84a606,args:_0xaaf78b,tdx:_0x53d5b0}=_0x588c05,_0x12fa7d=_0xaaf78b[0x0];if(!requireNameOrPath(_0x12fa7d))return 0x1;const _0x33f5c6=_0x84a606[_0x1f0169(0x176)];if(!_0x33f5c6)return console[_0x1f0169(0x11f)](_0x1f0169(0x1ce)),console[_0x1f0169(0x11f)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x43cfaa=parseInt(_0x33f5c6,0xa);if(isNaN(_0x43cfaa)||_0x43cfaa<0x1)return console[_0x1f0169(0x11f)](_0x1f0169(0x1cd)+_0x33f5c6),0x1;if(_0x84a606['verbose'])console[_0x1f0169(0x11f)](_0x1f0169(0x131)+_0x12fa7d+',\x20version:\x20'+_0x43cfaa);const {journeyId:_0x554e84,parentSegmentId:_0x28d766}=await resolveJourneyIdFromInput(_0x12fa7d,_0x84a606,_0x53d5b0),_0x4ae5d2=await withSpinner(_0x1f0169(0x195),()=>_0x53d5b0[_0x1f0169(0x149)][_0x1f0169(0x1f8)](_0x554e84),{'verbose':_0x84a606['verbose']}),{versions:_0x53bc8c,latestJourneyId:_0x28b381}=_0x4ae5d2[_0x1f0169(0x1e4)],_0x4a2a04=_0x53bc8c[_0x1f0169(0x22b)](_0x228c2e=>_0x228c2e[_0x1f0169(0x13f)]===_0x43cfaa);if(!_0x4a2a04){const _0x328891=_0x53bc8c['map'](_0x2dd069=>'v'+_0x2dd069[_0x1f0169(0x13f)])[_0x1f0169(0x1ab)](',\x20');return console['error']('Error:\x20Version\x20'+_0x43cfaa+_0x1f0169(0x138)+_0x328891),0x1;}const _0x36e5c1=await withSpinner('Getting\x20version\x20'+_0x43cfaa+_0x1f0169(0x159),()=>_0x53d5b0[_0x1f0169(0x149)][_0x1f0169(0x124)](_0x4a2a04[_0x1f0169(0x229)]),{'verbose':_0x84a606[_0x1f0169(0x1b7)]}),_0x70cec9=_0x36e5c1[_0x1f0169(0x1e4)],_0x264427=getConsoleNextUrl(_0x84a606[_0x1f0169(0x128)],_0x1f0169(0x1ad)+_0x28d766+_0x1f0169(0x1b4)+_0x4a2a04[_0x1f0169(0x229)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x70cec9['id'],'name':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x15f)],'version':_0x70cec9[_0x1f0169(0x182)]['versionNumber'],'description':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1dd)],'state':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1fa)],'paused':_0x70cec9['attributes'][_0x1f0169(0x146)],'reentry_mode':_0x70cec9[_0x1f0169(0x182)]['reentryMode'],'stages':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1c9)]?.['length']||0x0,..._0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x212)]&&{'goal':_0x70cec9[_0x1f0169(0x182)]['goal'][_0x1f0169(0x15f)]},'latest':_0x4a2a04['journeyId']===_0x28b381,'created_at':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x191)],'updated_at':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1c5)],'url':_0x264427},_0x84a606),0x0;}}