@treasuredata/tdx 2026.8.5 → 2026.8.7

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 (311) hide show
  1. package/README.md +1 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.d.ts +1 -1
  5. package/dist/cli-categories.js +1 -1
  6. package/dist/cli-categories.js.map +1 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/activations.js +1 -1
  11. package/dist/commands/agent-command.js +1 -1
  12. package/dist/commands/agent-test-command.js +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/auth-command.js +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.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/codex-command.d.ts +52 -0
  22. package/dist/commands/codex-command.d.ts.map +1 -0
  23. package/dist/commands/codex-command.js +1 -0
  24. package/dist/commands/codex-command.js.map +1 -0
  25. package/dist/commands/command.js +1 -1
  26. package/dist/commands/connection-command.js +1 -1
  27. package/dist/commands/databases.js +1 -1
  28. package/dist/commands/delivery-command.js +1 -1
  29. package/dist/commands/describe.js +1 -1
  30. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  31. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  32. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  33. package/dist/commands/engage-campaign-pull-command.js +1 -1
  34. package/dist/commands/engage-campaign-push-command.js +1 -1
  35. package/dist/commands/engage-campaign-validate-command.js +1 -1
  36. package/dist/commands/engage-command.d.ts.map +1 -1
  37. package/dist/commands/engage-command.js +1 -1
  38. package/dist/commands/engage-command.js.map +1 -1
  39. package/dist/commands/engage-template-pull-command.js +1 -1
  40. package/dist/commands/engage-template-push-command.js +1 -1
  41. package/dist/commands/engage-template-validate-command.js +1 -1
  42. package/dist/commands/job-command.js +1 -1
  43. package/dist/commands/journey-command.js +1 -1
  44. package/dist/commands/journey-validate-command.js +1 -1
  45. package/dist/commands/llm-command.js +1 -1
  46. package/dist/commands/mcp-command.js +1 -1
  47. package/dist/commands/p13n-command.d.ts +16 -1
  48. package/dist/commands/p13n-command.d.ts.map +1 -1
  49. package/dist/commands/p13n-command.js +1 -1
  50. package/dist/commands/p13n-command.js.map +1 -1
  51. package/dist/commands/parent-segment-command.js +1 -1
  52. package/dist/commands/policy-command.js +1 -1
  53. package/dist/commands/profile-command.js +1 -1
  54. package/dist/commands/profiles-command.js +1 -1
  55. package/dist/commands/query-command.js +1 -1
  56. package/dist/commands/schedule-command.js +1 -1
  57. package/dist/commands/segment-command.js +1 -1
  58. package/dist/commands/segment-create-command.js +1 -1
  59. package/dist/commands/segment-fields-command.js +1 -1
  60. package/dist/commands/segment-move-command.js +1 -1
  61. package/dist/commands/segment-pull-command.js +1 -1
  62. package/dist/commands/segment-push-command.js +1 -1
  63. package/dist/commands/segment-update-command.js +1 -1
  64. package/dist/commands/segment-use-command.js +1 -1
  65. package/dist/commands/segment-validate-command.js +1 -1
  66. package/dist/commands/segments.js +1 -1
  67. package/dist/commands/show.js +1 -1
  68. package/dist/commands/status-command.js +1 -1
  69. package/dist/commands/table-deleted.js +1 -1
  70. package/dist/commands/tables.js +1 -1
  71. package/dist/commands/unset-command.d.ts +1 -0
  72. package/dist/commands/unset-command.d.ts.map +1 -1
  73. package/dist/commands/unset-command.js +1 -1
  74. package/dist/commands/unset-command.js.map +1 -1
  75. package/dist/commands/upgrade-command.js +1 -1
  76. package/dist/commands/use-command.d.ts +1 -0
  77. package/dist/commands/use-command.d.ts.map +1 -1
  78. package/dist/commands/use-command.js +1 -1
  79. package/dist/commands/use-command.js.map +1 -1
  80. package/dist/commands/user-command.js +1 -1
  81. package/dist/commands/work-command.js +1 -1
  82. package/dist/commands/workflow-command.js +1 -1
  83. package/dist/core/auth.js +1 -1
  84. package/dist/core/command-output.js +1 -1
  85. package/dist/core/config.js +1 -1
  86. package/dist/core/connection-cache.js +1 -1
  87. package/dist/core/constants.js +1 -1
  88. package/dist/core/credential-cache.js +1 -1
  89. package/dist/core/global-context.d.ts +1 -0
  90. package/dist/core/global-context.d.ts.map +1 -1
  91. package/dist/core/global-context.js +1 -1
  92. package/dist/core/global-context.js.map +1 -1
  93. package/dist/core/keychain.js +1 -1
  94. package/dist/core/oauth-keychain.js +1 -1
  95. package/dist/core/oauth.js +1 -1
  96. package/dist/core/profile.js +1 -1
  97. package/dist/core/project-config.js +1 -1
  98. package/dist/core/session.d.ts +2 -1
  99. package/dist/core/session.d.ts.map +1 -1
  100. package/dist/core/session.js +1 -1
  101. package/dist/core/session.js.map +1 -1
  102. package/dist/core/site-mismatch.js +1 -1
  103. package/dist/core/user-cache.js +1 -1
  104. package/dist/core/version.d.ts +3 -3
  105. package/dist/core/version.d.ts.map +1 -1
  106. package/dist/core/version.js +1 -1
  107. package/dist/core/version.js.map +1 -1
  108. package/dist/index.js +1 -1
  109. package/dist/mcp/server.js +1 -1
  110. package/dist/mcp/tools/index.js +1 -1
  111. package/dist/mcp/tools/tdx-run.js +1 -1
  112. package/dist/mcp/tools/tdx-search.js +1 -1
  113. package/dist/mcp/tools/work-create-item.js +1 -1
  114. package/dist/mcp/utils.js +1 -1
  115. package/dist/proxy/claude-usage-tracker.js +1 -1
  116. package/dist/proxy/passthrough-server.js +1 -1
  117. package/dist/proxy/sse-usage-parser.js +1 -1
  118. package/dist/sdk/agent/agent-config.js +1 -1
  119. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  120. package/dist/sdk/agent/agent-yaml.js +1 -1
  121. package/dist/sdk/agent/test/evaluator.js +1 -1
  122. package/dist/sdk/agent/test/executor.js +1 -1
  123. package/dist/sdk/agent/test/index.js +1 -1
  124. package/dist/sdk/agent/test/output.js +1 -1
  125. package/dist/sdk/agent/test/parser.js +1 -1
  126. package/dist/sdk/agent/tool-target-registry.js +1 -1
  127. package/dist/sdk/api.js +1 -1
  128. package/dist/sdk/auth-token.js +1 -1
  129. package/dist/sdk/cas/cas-api-client.js +1 -1
  130. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  131. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  132. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  133. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  134. package/dist/sdk/cas/cas-segment-validator.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 +10 -2
  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/p13n-studio-api-client.d.ts +65 -1
  151. package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -1
  152. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  153. package/dist/sdk/client/p13n-studio-api-client.js.map +1 -1
  154. package/dist/sdk/client/rate-limiter.js +1 -1
  155. package/dist/sdk/client/td-api-client.js +1 -1
  156. package/dist/sdk/client/trino-api-client.js +1 -1
  157. package/dist/sdk/client/workflow-client.js +1 -1
  158. package/dist/sdk/connection-validator.js +1 -1
  159. package/dist/sdk/connection.js +1 -1
  160. package/dist/sdk/delivery.js +1 -1
  161. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  162. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  163. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  164. package/dist/sdk/engage/always-on-campaign-yaml.d.ts.map +1 -1
  165. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  166. package/dist/sdk/engage/always-on-campaign-yaml.js.map +1 -1
  167. package/dist/sdk/engage/campaign-pull.js +1 -1
  168. package/dist/sdk/engage/campaign-push.js +1 -1
  169. package/dist/sdk/engage/campaign-validator.js +1 -1
  170. package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
  171. package/dist/sdk/engage/campaign-yaml.js +1 -1
  172. package/dist/sdk/engage/campaign-yaml.js.map +1 -1
  173. package/dist/sdk/engage/template-pull.js +1 -1
  174. package/dist/sdk/engage/template-push.js +1 -1
  175. package/dist/sdk/engage/template-validator.js +1 -1
  176. package/dist/sdk/engage/template-yaml.d.ts.map +1 -1
  177. package/dist/sdk/engage/template-yaml.js +1 -1
  178. package/dist/sdk/engage/template-yaml.js.map +1 -1
  179. package/dist/sdk/engage/types/always-on-campaign-schema.d.ts +1 -0
  180. package/dist/sdk/engage/types/always-on-campaign-schema.d.ts.map +1 -1
  181. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  182. package/dist/sdk/engage/types/campaign-def.js +1 -1
  183. package/dist/sdk/engage/types/campaign-schema.d.ts +2 -0
  184. package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
  185. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  186. package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
  187. package/dist/sdk/engage/types/template-schema.d.ts +1 -0
  188. package/dist/sdk/engage/types/template-schema.d.ts.map +1 -1
  189. package/dist/sdk/engage/types/template-schema.js +1 -1
  190. package/dist/sdk/engage/types/template-schema.js.map +1 -1
  191. package/dist/sdk/engage.d.ts +7 -2
  192. package/dist/sdk/engage.d.ts.map +1 -1
  193. package/dist/sdk/engage.js +1 -1
  194. package/dist/sdk/engage.js.map +1 -1
  195. package/dist/sdk/errors.js +1 -1
  196. package/dist/sdk/index.d.ts +5 -1
  197. package/dist/sdk/index.d.ts.map +1 -1
  198. package/dist/sdk/index.js +1 -1
  199. package/dist/sdk/index.js.map +1 -1
  200. package/dist/sdk/io/index.js +1 -1
  201. package/dist/sdk/io/node-filesystem.js +1 -1
  202. package/dist/sdk/job.js +1 -1
  203. package/dist/sdk/journey.js +1 -1
  204. package/dist/sdk/llm/chat-cache.js +1 -1
  205. package/dist/sdk/llm/index.js +1 -1
  206. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  207. package/dist/sdk/llm/model-factors.js +1 -1
  208. package/dist/sdk/llm/user-settings.js +1 -1
  209. package/dist/sdk/p13n-studio.d.ts +148 -1
  210. package/dist/sdk/p13n-studio.d.ts.map +1 -1
  211. package/dist/sdk/p13n-studio.js +1 -1
  212. package/dist/sdk/p13n-studio.js.map +1 -1
  213. package/dist/sdk/personalization.js +1 -1
  214. package/dist/sdk/policy.js +1 -1
  215. package/dist/sdk/query/deleted-table-validation.js +1 -1
  216. package/dist/sdk/query/index.js +1 -1
  217. package/dist/sdk/query/sql-parser.js +1 -1
  218. package/dist/sdk/realtime.js +1 -1
  219. package/dist/sdk/schedule.js +1 -1
  220. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  221. package/dist/sdk/segment/fields-display.js +1 -1
  222. package/dist/sdk/segment/file-discovery.js +1 -1
  223. package/dist/sdk/segment/journey-utils.js +1 -1
  224. package/dist/sdk/segment/journey-validator.js +1 -1
  225. package/dist/sdk/segment/journey-yaml.js +1 -1
  226. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  227. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  228. package/dist/sdk/segment/pull-workflow.js +1 -1
  229. package/dist/sdk/segment/push-recovery.js +1 -1
  230. package/dist/sdk/segment/push-workflow.js +1 -1
  231. package/dist/sdk/segment/resolution-context.js +1 -1
  232. package/dist/sdk/segment/segment-path-parser.js +1 -1
  233. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  234. package/dist/sdk/segment/segment-validator.js +1 -1
  235. package/dist/sdk/segment/target-resolution.js +1 -1
  236. package/dist/sdk/segment/tdx-config.js +1 -1
  237. package/dist/sdk/segment/types/activation-schema.js +1 -1
  238. package/dist/sdk/segment/types/journey-def.js +1 -1
  239. package/dist/sdk/segment/types/journey-schema.js +1 -1
  240. package/dist/sdk/segment/types/segment-def.js +1 -1
  241. package/dist/sdk/segment/types/segment-schema.js +1 -1
  242. package/dist/sdk/segment/validate-files.js +1 -1
  243. package/dist/sdk/segment/yaml-validator.js +1 -1
  244. package/dist/sdk/segment.js +1 -1
  245. package/dist/sdk/types/engage.d.ts +49 -0
  246. package/dist/sdk/types/engage.d.ts.map +1 -1
  247. package/dist/sdk/types/index.d.ts +3 -2
  248. package/dist/sdk/types/index.d.ts.map +1 -1
  249. package/dist/sdk/types/index.js +1 -1
  250. package/dist/sdk/types/index.js.map +1 -1
  251. package/dist/sdk/types/p13n-studio.d.ts +73 -0
  252. package/dist/sdk/types/p13n-studio.d.ts.map +1 -1
  253. package/dist/sdk/types/progress.js +1 -1
  254. package/dist/sdk/types/workspace.js +1 -1
  255. package/dist/sdk/user.js +1 -1
  256. package/dist/sdk/util/format-detector.js +1 -1
  257. package/dist/sdk/util/formatters.js +1 -1
  258. package/dist/sdk/util/index.js +1 -1
  259. package/dist/sdk/util/paginate.js +1 -1
  260. package/dist/sdk/util/tree-formatter.js +1 -1
  261. package/dist/sdk/util/tree-search.js +1 -1
  262. package/dist/sdk/workflow/archive-validation.js +1 -1
  263. package/dist/sdk/workflow/clone-workflow.js +1 -1
  264. package/dist/sdk/workflow/index.js +1 -1
  265. package/dist/sdk/workflow/pull-workflow.js +1 -1
  266. package/dist/sdk/workflow/push-workflow.js +1 -1
  267. package/dist/sdk/workflow/task-graph.js +1 -1
  268. package/dist/sdk/workflow/tdx-config.js +1 -1
  269. package/dist/sdk/workflow/workflow-utils.js +1 -1
  270. package/dist/sdk/workspace/access-tracker.js +1 -1
  271. package/dist/sdk/workspace/frontmatter.js +1 -1
  272. package/dist/sdk/workspace/git.js +1 -1
  273. package/dist/sdk/workspace/index.js +1 -1
  274. package/dist/sdk/workspace/templates.js +1 -1
  275. package/dist/sdk/workspace/weekly.js +1 -1
  276. package/dist/sdk/workspace/wikilinks.js +1 -1
  277. package/dist/test-utils/command-runner.js +1 -1
  278. package/dist/test-utils/factories.js +1 -1
  279. package/dist/test-utils/fixtures.js +1 -1
  280. package/dist/test-utils/http-mock.js +1 -1
  281. package/dist/test-utils/index.js +1 -1
  282. package/dist/utils/async.js +1 -1
  283. package/dist/utils/claude-code-state.js +1 -1
  284. package/dist/utils/colors.js +1 -1
  285. package/dist/utils/diff.js +1 -1
  286. package/dist/utils/file-permissions.js +1 -1
  287. package/dist/utils/file-reader.js +1 -1
  288. package/dist/utils/github-releases.js +1 -1
  289. package/dist/utils/global-cache.js +1 -1
  290. package/dist/utils/json-loader.js +1 -1
  291. package/dist/utils/local-cache.js +1 -1
  292. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  293. package/dist/utils/logger/formatters/index.js +1 -1
  294. package/dist/utils/logger/handlers/console-handler.js +1 -1
  295. package/dist/utils/logger/handlers/file-handler.js +1 -1
  296. package/dist/utils/logger/handlers/index.js +1 -1
  297. package/dist/utils/logger/handlers/null-handler.js +1 -1
  298. package/dist/utils/logger/index.js +1 -1
  299. package/dist/utils/logger/logger.js +1 -1
  300. package/dist/utils/logger/types.js +1 -1
  301. package/dist/utils/option-validation.js +1 -1
  302. package/dist/utils/process.js +1 -1
  303. package/dist/utils/prompt.js +1 -1
  304. package/dist/utils/proxy-fetch.js +1 -1
  305. package/dist/utils/spinner.js +1 -1
  306. package/dist/utils/sse-parser.js +1 -1
  307. package/dist/utils/string-utils.js +1 -1
  308. package/dist/utils/table-ref-parser.js +1 -1
  309. package/dist/utils/tdx-logger.js +1 -1
  310. package/dist/utils/version-check.js +1 -1
  311. package/package.json +2 -47
@@ -1 +1 @@
1
- const a27_0x297702=a27_0x4775;(function(_0x537c16,_0x380808){const _0x3429e1=a27_0x4775,_0xe5a41d=_0x537c16();while(!![]){try{const _0x3ac541=parseInt(_0x3429e1(0x198))/0x1+-parseInt(_0x3429e1(0x199))/0x2+parseInt(_0x3429e1(0x19b))/0x3+parseInt(_0x3429e1(0x19c))/0x4+parseInt(_0x3429e1(0x15f))/0x5+parseInt(_0x3429e1(0x184))/0x6+parseInt(_0x3429e1(0x16a))/0x7*(-parseInt(_0x3429e1(0x169))/0x8);if(_0x3ac541===_0x380808)break;else _0xe5a41d['push'](_0xe5a41d['shift']());}catch(_0x398dea){_0xe5a41d['push'](_0xe5a41d['shift']());}}}(a27_0x3fa9,0x68046));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{isYamlFile}from'../sdk/segment/file-discovery.js';import a27_0x2b4765 from'chalk';import a27_0x12705b 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';function a27_0x4775(_0x54c8ce,_0x19abe4){_0x54c8ce=_0x54c8ce-0x15f;const _0x3fa96d=a27_0x3fa9();let _0x47753f=_0x3fa96d[_0x54c8ce];return _0x47753f;}import{hyperlink}from'../sdk/util/formatters.js';function a27_0x3fa9(){const _0x4ef020=['590231CPgaJg','880340AdXtrJ','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','2238012XTUbBk','1836748wbjuTV','\x20template\x20files','update','Resolving\x20references...','\x20templates?','Found\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','1741285brVIgm','dim','workspace','length','\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','yellow','execute','Workspace\x20is\x20required.','resolve','red','88GqxloX','1262933ukaeOH','results','message','errors','\x20\x20\x20\x20','green','\x20templates','verbose','engage','setPhase','relativePath','dirname','valid','site','templateId','warnings','\x27...','\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)','updated','\x0aError:','Pushing\x20templates...','create','cyan','action','def','filter','4242924sLBNWk','✔\x20Updated\x20','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20templates\x20to\x20update:','error','\x20new\x20templates:','1\x20template\x20file:\x20','Preparing\x20push\x20to\x20workspace\x20\x27','name','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','dryRun','path','configDir','created','-\x20no\x20changes\x20applied','✔\x20Created\x20','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','cwd','data','engage_workspace'];a27_0x3fa9=function(){return _0x4ef020;};return a27_0x3fa9();}export class EngageTemplatePushCommand extends BaseCommand{[a27_0x297702(0x18c)]='engage:template:push';['description']=a27_0x297702(0x19a);async[a27_0x297702(0x165)](_0x4758ca){const _0x29b8bd=a27_0x297702,{options:_0x27c4b9,args:_0x51cb62,tdx:_0x5c673c}=_0x4758ca,_0x5a1037=_0x27c4b9,_0x36b648=_0x51cb62[0x0],_0xb12e20=_0x36b648?a27_0x12705b[_0x29b8bd(0x167)](_0x36b648):undefined,_0x1a5d56=_0xb12e20?isYamlFile(_0xb12e20):![];let _0x13a641;if(_0x1a5d56&&_0xb12e20)_0x13a641=a27_0x12705b[_0x29b8bd(0x175)](_0xb12e20);else _0xb12e20?_0x13a641=_0xb12e20:_0x13a641=process[_0x29b8bd(0x195)]();let _0xb2ede3;const _0x199fc4=tryFindTdxConfig(_0x13a641);_0x199fc4?.['config'][_0x29b8bd(0x197)]&&(_0xb2ede3=_0x199fc4['config']['engage_workspace'],!_0x1a5d56&&(_0x13a641=_0x199fc4[_0x29b8bd(0x190)]));_0x5a1037[_0x29b8bd(0x161)]&&(_0xb2ede3=_0x5a1037[_0x29b8bd(0x161)]);if(!_0xb2ede3){const _0x2092c9=loadSessionContext(_0x5a1037['session']);_0x2092c9?.[_0x29b8bd(0x197)]&&(_0xb2ede3=_0x2092c9[_0x29b8bd(0x197)]);}if(!_0xb2ede3)return console[_0x29b8bd(0x188)](a27_0x2b4765['yellow'](_0x29b8bd(0x166))),console[_0x29b8bd(0x188)](_0x29b8bd(0x163)),console[_0x29b8bd(0x188)](_0x29b8bd(0x17b)),console['error'](_0x29b8bd(0x1a2)),console['error']('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x5a6994;_0x1a5d56&&_0xb12e20?_0x5a6994=[parseTemplateFile(_0xb12e20,a27_0x12705b[_0x29b8bd(0x175)](_0xb12e20))]:_0x5a6994=discoverAndParseTemplateFiles(_0x13a641);if(_0x5a6994[_0x29b8bd(0x162)]===0x0)return console['error'](a27_0x2b4765[_0x29b8bd(0x164)](_0x29b8bd(0x186)+_0x13a641)),console['error'](a27_0x2b4765[_0x29b8bd(0x160)](_0x29b8bd(0x194))),0x1;const _0x57dd26=_0x5a6994['length']===0x1?_0x29b8bd(0x18a)+_0x5a6994[0x0][_0x29b8bd(0x182)][_0x29b8bd(0x18c)]:_0x5a6994[_0x29b8bd(0x162)]+_0x29b8bd(0x19d);console[_0x29b8bd(0x188)](_0x29b8bd(0x1a1)+a27_0x2b4765[_0x29b8bd(0x180)](_0x57dd26));let _0x1abccc=![];for(const _0xd37aed of _0x5a6994){const _0xdfca33=validateTemplateDef(_0xd37aed[_0x29b8bd(0x182)]);if(!_0xdfca33[_0x29b8bd(0x176)]){_0x1abccc=!![],console[_0x29b8bd(0x188)](a27_0x2b4765[_0x29b8bd(0x168)]('\x0aValidation\x20errors\x20in\x20'+_0xd37aed[_0x29b8bd(0x174)]+':'));for(const _0x38819d of _0xdfca33[_0x29b8bd(0x16d)]){console['error']('\x20\x20'+a27_0x2b4765['red']('✗')+'\x20'+_0x38819d[_0x29b8bd(0x18f)]+':\x20'+_0x38819d['message']);}}for(const _0x303dea of _0xdfca33[_0x29b8bd(0x179)]){console[_0x29b8bd(0x188)]('\x20\x20'+a27_0x2b4765[_0x29b8bd(0x164)]('⚠')+'\x20'+_0x303dea[_0x29b8bd(0x18f)]+':\x20'+_0x303dea[_0x29b8bd(0x16c)]);}}if(_0x1abccc)return console[_0x29b8bd(0x188)](a27_0x2b4765[_0x29b8bd(0x168)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x27849c=await _0x5c673c['engage']['resolveWorkspaceId'](_0xb2ede3),_0x414ca7=await withProgressSpinner(_0x29b8bd(0x18b)+_0xb2ede3+_0x29b8bd(0x17a),_0x413721=>preparePush({'engage':_0x5c673c[_0x29b8bd(0x172)]},_0x5a6994,_0x27849c,{'progress':{'update':_0x2d79fd=>_0x413721['setPhase'](_0x2d79fd)}}),{'verbose':_0x5a1037[_0x29b8bd(0x171)]}),_0xcbac01=_0x414ca7[_0x29b8bd(0x196)];await withProgressSpinner(_0x29b8bd(0x19f),_0x8ce3e9=>resolveAndBuildInputs({'engage':_0x5c673c['engage']},_0xcbac01,_0x27849c,{'progress':{'update':_0x5a7f44=>_0x8ce3e9[_0x29b8bd(0x173)](_0x5a7f44)}}),{'verbose':_0x5a1037[_0x29b8bd(0x171)]});const _0x508c1d=_0xcbac01[_0x29b8bd(0x183)](_0x79da37=>_0x79da37[_0x29b8bd(0x181)]===_0x29b8bd(0x17f)),_0x30f676=_0xcbac01[_0x29b8bd(0x183)](_0x1c3be9=>_0x1c3be9[_0x29b8bd(0x181)]===_0x29b8bd(0x19e));console[_0x29b8bd(0x188)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0xb2ede3+'\x27:');if(_0x508c1d['length']>0x0){console['error']('\x20\x20'+a27_0x2b4765[_0x29b8bd(0x16f)]('+\x20'+_0x508c1d['length']+_0x29b8bd(0x189)));for(const _0x195bd5 of _0x508c1d){console[_0x29b8bd(0x188)](_0x29b8bd(0x16e)+a27_0x2b4765[_0x29b8bd(0x16f)]('+')+'\x20'+_0x195bd5[_0x29b8bd(0x182)][_0x29b8bd(0x18c)]);}}if(_0x30f676['length']>0x0){console[_0x29b8bd(0x188)]('\x20\x20'+a27_0x2b4765['yellow']('~\x20'+_0x30f676[_0x29b8bd(0x162)]+_0x29b8bd(0x187)));for(const _0x42ac8f of _0x30f676){console[_0x29b8bd(0x188)](_0x29b8bd(0x16e)+a27_0x2b4765['yellow']('~')+'\x20'+_0x42ac8f['def']['name']);}}if(_0x508c1d[_0x29b8bd(0x162)]===0x0&&_0x30f676[_0x29b8bd(0x162)]===0x0)return console[_0x29b8bd(0x188)](a27_0x2b4765[_0x29b8bd(0x16f)]('\u2714\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x5a1037[_0x29b8bd(0x18e)])return console[_0x29b8bd(0x188)](a27_0x2b4765[_0x29b8bd(0x164)](_0x29b8bd(0x18d))),0x0;if(!_0x5a1037['yes']){if(!isInteractive())return console[_0x29b8bd(0x188)](a27_0x2b4765[_0x29b8bd(0x168)](_0x29b8bd(0x17d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x29b8bd(0x188)](a27_0x2b4765[_0x29b8bd(0x160)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x568864=await confirmKey('Push\x20'+(_0x508c1d[_0x29b8bd(0x162)]+_0x30f676[_0x29b8bd(0x162)])+_0x29b8bd(0x1a0));if(!_0x568864)return console['error'](a27_0x2b4765[_0x29b8bd(0x164)]('Aborted.'),_0x29b8bd(0x192)),0x1;}const _0x5c6e5e=await withProgressSpinner(_0x29b8bd(0x17e),_0x568532=>executePush({'engage':_0x5c673c[_0x29b8bd(0x172)]},_0xcbac01,{'progress':{'update':_0x144c13=>_0x568532[_0x29b8bd(0x173)](_0x144c13)}}),{'verbose':_0x5a1037[_0x29b8bd(0x171)]}),_0xc8498b=_0x5c6e5e[_0x29b8bd(0x196)];for(const _0x19e07d of _0xc8498b[_0x29b8bd(0x16b)]){if(_0x19e07d[_0x29b8bd(0x178)]&&(_0x19e07d['action']===_0x29b8bd(0x191)||_0x19e07d[_0x29b8bd(0x181)]===_0x29b8bd(0x17c))){const _0x31988f=getTemplateUrl(_0x5a1037[_0x29b8bd(0x177)],_0x27849c,_0x19e07d['templateId']),_0x8f8ad3=_0x19e07d[_0x29b8bd(0x181)]===_0x29b8bd(0x191)?'+':'~',_0x1a4ca0=_0x19e07d[_0x29b8bd(0x181)]===_0x29b8bd(0x191)?a27_0x2b4765['green'](_0x8f8ad3):a27_0x2b4765['yellow'](_0x8f8ad3);console[_0x29b8bd(0x188)]('\x20\x20'+_0x1a4ca0+'\x20'+hyperlink(_0x19e07d[_0x29b8bd(0x18c)],_0x31988f)+'\x20'+a27_0x2b4765[_0x29b8bd(0x160)](_0x31988f));}}_0xc8498b[_0x29b8bd(0x191)]>0x0&&console[_0x29b8bd(0x188)](a27_0x2b4765[_0x29b8bd(0x16f)](_0x29b8bd(0x193)+_0xc8498b[_0x29b8bd(0x191)]+_0x29b8bd(0x170)));_0xc8498b[_0x29b8bd(0x17c)]>0x0&&console[_0x29b8bd(0x188)](a27_0x2b4765[_0x29b8bd(0x16f)](_0x29b8bd(0x185)+_0xc8498b['updated']+_0x29b8bd(0x170)));if(_0xc8498b[_0x29b8bd(0x16d)][_0x29b8bd(0x162)]>0x0){console['error'](a27_0x2b4765[_0x29b8bd(0x168)]('✘\x20'+_0xc8498b[_0x29b8bd(0x16d)][_0x29b8bd(0x162)]+'\x20errors:'));for(const _0x4bb0ac of _0xc8498b['errors']){console[_0x29b8bd(0x188)]('\x20\x20'+a27_0x2b4765[_0x29b8bd(0x168)](_0x4bb0ac[_0x29b8bd(0x18c)])+':\x20'+_0x4bb0ac['error']);}}return saveSessionContext({'engage_workspace':_0xb2ede3},_0x5a1037['session']),_0xc8498b[_0x29b8bd(0x16d)][_0x29b8bd(0x162)]>0x0?0x1:0x0;}}
1
+ const a28_0x57f926=a28_0x2d46;(function(_0x3f874e,_0x5b741c){const _0x14b5d9=a28_0x2d46,_0x408cc2=_0x3f874e();while(!![]){try{const _0x3aeb9a=parseInt(_0x14b5d9(0x1a3))/0x1*(parseInt(_0x14b5d9(0x184))/0x2)+parseInt(_0x14b5d9(0x195))/0x3+-parseInt(_0x14b5d9(0x17e))/0x4*(parseInt(_0x14b5d9(0x18c))/0x5)+parseInt(_0x14b5d9(0x171))/0x6*(parseInt(_0x14b5d9(0x16a))/0x7)+-parseInt(_0x14b5d9(0x16d))/0x8*(parseInt(_0x14b5d9(0x1a1))/0x9)+parseInt(_0x14b5d9(0x17a))/0xa*(-parseInt(_0x14b5d9(0x167))/0xb)+-parseInt(_0x14b5d9(0x16f))/0xc;if(_0x3aeb9a===_0x5b741c)break;else _0x408cc2['push'](_0x408cc2['shift']());}catch(_0x3bc1c9){_0x408cc2['push'](_0x408cc2['shift']());}}}(a28_0x46e0,0xa7c31));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';function a28_0x2d46(_0x21b4c8,_0x29ff2e){_0x21b4c8=_0x21b4c8-0x15f;const _0x46e036=a28_0x46e0();let _0x2d460b=_0x46e036[_0x21b4c8];return _0x2d460b;}function a28_0x46e0(){const _0x558621=['Found\x20','errors','def','Pushing\x20templates...','4IVQGmj','workspace','path','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','resolveWorkspaceId','Push\x20','\x20\x20\x20\x20','yellow','120115AYKvFf','yes','created','\x27...','\x0aValidation\x20errors\x20in\x20','\x20templates?','configDir','\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','action','1119222EehTxS','verbose','templateId','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)','resolve','engage_workspace','\x0aError:','cyan','create','message','data','54864YdrpmM','engage','583826thjRLA','relativePath','config','filter','\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','Workspace\x20is\x20required.','length','\x0aPush\x20summary\x20for\x20workspace\x20\x27','description','red','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','error','green','cwd','165lceyJs','1\x20template\x20file:\x20','setPhase','210cgIwRA','session','name','960lKLscl','Resolving\x20references...','3584772tZmwMv','\x20templates','233262kOhPBA','results','✔\x20All\x20templates\x20are\x20up\x20to\x20date','dryRun','-\x20no\x20changes\x20applied','Preparing\x20push\x20to\x20workspace\x20\x27','No\x20template\x20YAML\x20files\x20found\x20in\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20new\x20templates:','195310fCNPHP','execute','dirname','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','116jmplHi','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.'];a28_0x46e0=function(){return _0x558621;};return a28_0x46e0();}import{isYamlFile}from'../sdk/segment/file-discovery.js';import a28_0x25467c from'chalk';import a28_0x3b6207 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{[a28_0x57f926(0x16c)]='engage:template:push';[a28_0x57f926(0x161)]=a28_0x57f926(0x163);async[a28_0x57f926(0x17b)](_0x152887){const _0x3e29c9=a28_0x57f926,{options:_0x2006a6,args:_0x1986d2,tdx:_0x43c4d6}=_0x152887,_0x48ef82=_0x2006a6,_0x1ee4fa=_0x1986d2[0x0],_0x271517=_0x1ee4fa?a28_0x3b6207[_0x3e29c9(0x19a)](_0x1ee4fa):undefined,_0x433d39=_0x271517?isYamlFile(_0x271517):![];let _0x38919e;if(_0x433d39&&_0x271517)_0x38919e=a28_0x3b6207[_0x3e29c9(0x17c)](_0x271517);else _0x271517?_0x38919e=_0x271517:_0x38919e=process[_0x3e29c9(0x166)]();let _0x3e4c5d;const _0x4d438e=tryFindTdxConfig(_0x38919e);_0x4d438e?.[_0x3e29c9(0x1a5)][_0x3e29c9(0x19b)]&&(_0x3e4c5d=_0x4d438e[_0x3e29c9(0x1a5)][_0x3e29c9(0x19b)],!_0x433d39&&(_0x38919e=_0x4d438e[_0x3e29c9(0x192)]));_0x48ef82[_0x3e29c9(0x185)]&&(_0x3e4c5d=_0x48ef82[_0x3e29c9(0x185)]);if(!_0x3e4c5d){const _0x26b79f=loadSessionContext(_0x48ef82[_0x3e29c9(0x16b)]);_0x26b79f?.[_0x3e29c9(0x19b)]&&(_0x3e4c5d=_0x26b79f[_0x3e29c9(0x19b)]);}if(!_0x3e4c5d)return console[_0x3e29c9(0x164)](a28_0x25467c[_0x3e29c9(0x18b)](_0x3e29c9(0x1a8))),console[_0x3e29c9(0x164)](_0x3e29c9(0x1a7)),console[_0x3e29c9(0x164)](_0x3e29c9(0x199)),console[_0x3e29c9(0x164)](_0x3e29c9(0x193)),console[_0x3e29c9(0x164)](_0x3e29c9(0x17d)),0x1;let _0xf9da1;_0x433d39&&_0x271517?_0xf9da1=[parseTemplateFile(_0x271517,a28_0x3b6207[_0x3e29c9(0x17c)](_0x271517))]:_0xf9da1=discoverAndParseTemplateFiles(_0x38919e);if(_0xf9da1[_0x3e29c9(0x15f)]===0x0)return console['error'](a28_0x25467c[_0x3e29c9(0x18b)](_0x3e29c9(0x177)+_0x38919e)),console['error'](a28_0x25467c['dim']('Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.')),0x1;const _0x2ab6b8=_0xf9da1[_0x3e29c9(0x15f)]===0x1?_0x3e29c9(0x168)+_0xf9da1[0x0][_0x3e29c9(0x182)][_0x3e29c9(0x16c)]:_0xf9da1[_0x3e29c9(0x15f)]+'\x20template\x20files';console['error'](_0x3e29c9(0x180)+a28_0x25467c[_0x3e29c9(0x19d)](_0x2ab6b8));let _0x4a053c=![];for(const _0x258aab of _0xf9da1){const _0x46743b=validateTemplateDef(_0x258aab[_0x3e29c9(0x182)]);if(!_0x46743b['valid']){_0x4a053c=!![],console['error'](a28_0x25467c[_0x3e29c9(0x162)](_0x3e29c9(0x190)+_0x258aab[_0x3e29c9(0x1a4)]+':'));for(const _0x307f92 of _0x46743b[_0x3e29c9(0x181)]){console[_0x3e29c9(0x164)]('\x20\x20'+a28_0x25467c[_0x3e29c9(0x162)]('✗')+'\x20'+_0x307f92[_0x3e29c9(0x186)]+':\x20'+_0x307f92[_0x3e29c9(0x19f)]);}}for(const _0x3c7a5e of _0x46743b['warnings']){console['error']('\x20\x20'+a28_0x25467c[_0x3e29c9(0x18b)]('⚠')+'\x20'+_0x3c7a5e[_0x3e29c9(0x186)]+':\x20'+_0x3c7a5e[_0x3e29c9(0x19f)]);}}if(_0x4a053c)return console[_0x3e29c9(0x164)](a28_0x25467c[_0x3e29c9(0x162)](_0x3e29c9(0x17f))),0x1;const _0x3fbead=await _0x43c4d6[_0x3e29c9(0x1a2)][_0x3e29c9(0x188)](_0x3e4c5d),_0x181f2f=await withProgressSpinner(_0x3e29c9(0x176)+_0x3e4c5d+_0x3e29c9(0x18f),_0x56405a=>preparePush({'engage':_0x43c4d6['engage']},_0xf9da1,_0x3fbead,{'progress':{'update':_0x2ed072=>_0x56405a['setPhase'](_0x2ed072)}}),{'verbose':_0x48ef82[_0x3e29c9(0x196)]}),_0xb95077=_0x181f2f[_0x3e29c9(0x1a0)];await withProgressSpinner(_0x3e29c9(0x16e),_0x5252af=>resolveAndBuildInputs({'engage':_0x43c4d6[_0x3e29c9(0x1a2)]},_0xb95077,_0x3fbead,{'progress':{'update':_0x4b592f=>_0x5252af[_0x3e29c9(0x169)](_0x4b592f)}}),{'verbose':_0x48ef82[_0x3e29c9(0x196)]});const _0x354062=_0xb95077[_0x3e29c9(0x1a6)](_0x1d3151=>_0x1d3151[_0x3e29c9(0x194)]===_0x3e29c9(0x19e)),_0x2e6364=_0xb95077[_0x3e29c9(0x1a6)](_0x43e0ca=>_0x43e0ca[_0x3e29c9(0x194)]==='update');console['error'](_0x3e29c9(0x160)+_0x3e4c5d+'\x27:');if(_0x354062[_0x3e29c9(0x15f)]>0x0){console[_0x3e29c9(0x164)]('\x20\x20'+a28_0x25467c[_0x3e29c9(0x165)]('+\x20'+_0x354062[_0x3e29c9(0x15f)]+_0x3e29c9(0x179)));for(const _0x49ed1a of _0x354062){console[_0x3e29c9(0x164)](_0x3e29c9(0x18a)+a28_0x25467c[_0x3e29c9(0x165)]('+')+'\x20'+_0x49ed1a['def']['name']);}}if(_0x2e6364['length']>0x0){console['error']('\x20\x20'+a28_0x25467c[_0x3e29c9(0x18b)]('~\x20'+_0x2e6364[_0x3e29c9(0x15f)]+'\x20templates\x20to\x20update:'));for(const _0x39a492 of _0x2e6364){console[_0x3e29c9(0x164)](_0x3e29c9(0x18a)+a28_0x25467c['yellow']('~')+'\x20'+_0x39a492['def'][_0x3e29c9(0x16c)]);}}if(_0x354062[_0x3e29c9(0x15f)]===0x0&&_0x2e6364[_0x3e29c9(0x15f)]===0x0)return console['error'](a28_0x25467c['green'](_0x3e29c9(0x173))),0x0;if(_0x48ef82[_0x3e29c9(0x174)])return console[_0x3e29c9(0x164)](a28_0x25467c['yellow'](_0x3e29c9(0x187))),0x0;if(!_0x48ef82[_0x3e29c9(0x18d)]){if(!isInteractive())return console[_0x3e29c9(0x164)](a28_0x25467c[_0x3e29c9(0x162)](_0x3e29c9(0x19c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3e29c9(0x164)](a28_0x25467c[_0x3e29c9(0x198)](_0x3e29c9(0x178))),0x1;const _0x1a92b3=await confirmKey(_0x3e29c9(0x189)+(_0x354062[_0x3e29c9(0x15f)]+_0x2e6364[_0x3e29c9(0x15f)])+_0x3e29c9(0x191));if(!_0x1a92b3)return console[_0x3e29c9(0x164)](a28_0x25467c[_0x3e29c9(0x18b)]('Aborted.'),_0x3e29c9(0x175)),0x1;}const _0x4e79b4=await withProgressSpinner(_0x3e29c9(0x183),_0x481df3=>executePush({'engage':_0x43c4d6[_0x3e29c9(0x1a2)]},_0xb95077,{'progress':{'update':_0x9881e7=>_0x481df3[_0x3e29c9(0x169)](_0x9881e7)}}),{'verbose':_0x48ef82[_0x3e29c9(0x196)]}),_0x42e0ab=_0x4e79b4[_0x3e29c9(0x1a0)];for(const _0x22b74d of _0x42e0ab[_0x3e29c9(0x172)]){if(_0x22b74d['templateId']&&(_0x22b74d[_0x3e29c9(0x194)]===_0x3e29c9(0x18e)||_0x22b74d[_0x3e29c9(0x194)]==='updated')){const _0x1b2e92=getTemplateUrl(_0x48ef82['site'],_0x3fbead,_0x22b74d[_0x3e29c9(0x197)]),_0x4beab5=_0x22b74d[_0x3e29c9(0x194)]===_0x3e29c9(0x18e)?'+':'~',_0x5b7e79=_0x22b74d[_0x3e29c9(0x194)]===_0x3e29c9(0x18e)?a28_0x25467c[_0x3e29c9(0x165)](_0x4beab5):a28_0x25467c['yellow'](_0x4beab5);console[_0x3e29c9(0x164)]('\x20\x20'+_0x5b7e79+'\x20'+hyperlink(_0x22b74d['name'],_0x1b2e92)+'\x20'+a28_0x25467c[_0x3e29c9(0x198)](_0x1b2e92));}}_0x42e0ab[_0x3e29c9(0x18e)]>0x0&&console['error'](a28_0x25467c[_0x3e29c9(0x165)]('✔\x20Created\x20'+_0x42e0ab[_0x3e29c9(0x18e)]+_0x3e29c9(0x170)));_0x42e0ab['updated']>0x0&&console['error'](a28_0x25467c[_0x3e29c9(0x165)]('✔\x20Updated\x20'+_0x42e0ab['updated']+_0x3e29c9(0x170)));if(_0x42e0ab[_0x3e29c9(0x181)][_0x3e29c9(0x15f)]>0x0){console[_0x3e29c9(0x164)](a28_0x25467c[_0x3e29c9(0x162)]('✘\x20'+_0x42e0ab['errors'][_0x3e29c9(0x15f)]+'\x20errors:'));for(const _0x344427 of _0x42e0ab[_0x3e29c9(0x181)]){console[_0x3e29c9(0x164)]('\x20\x20'+a28_0x25467c[_0x3e29c9(0x162)](_0x344427[_0x3e29c9(0x16c)])+':\x20'+_0x344427['error']);}}return saveSessionContext({'engage_workspace':_0x3e4c5d},_0x48ef82[_0x3e29c9(0x16b)]),_0x42e0ab['errors'][_0x3e29c9(0x15f)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- function a28_0x8592(){const _0x545ed9=['.yaml','name','4874322ogMmIA','18MlQGhe','green','18773ZtfzMZ','execute','211350tfZPpu','\x20valid','skippedCount','yellow','10943772oUvVSM','.yml','warnings','\x20warning(s)\x20found','10695592zKDexI','\x20(skipped:\x20','dirname','\x20error(s)','length','log','red','relativePath','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','dim','valid','✔\x20All\x20','Validate\x20template\x20YAML\x20files','filter','305668OfDsbN','\x20warning(s)','template','hasErrors','1330cWOanw','warningCount','error','89595xZyxuD','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','resolve','verbose','54ZxvfuX','\x20non-template\x20file(s)\x20skipped','reason','\x20template(s)\x20valid','\x20template(s)\x20with\x20errors,\x20'];a28_0x8592=function(){return _0x545ed9;};return a28_0x8592();}function a28_0x211c(_0x3a854d,_0xf565b4){_0x3a854d=_0x3a854d-0x83;const _0x859217=a28_0x8592();let _0x211c79=_0x859217[_0x3a854d];return _0x211c79;}const a28_0x42bfdf=a28_0x211c;(function(_0x5434d6,_0x4854f6){const _0x46f131=a28_0x211c,_0x2a76ed=_0x5434d6();while(!![]){try{const _0x11fded=-parseInt(_0x46f131(0xad))/0x1*(-parseInt(_0x46f131(0xab))/0x2)+parseInt(_0x46f131(0xa3))/0x3*(parseInt(_0x46f131(0x98))/0x4)+parseInt(_0x46f131(0xaf))/0x5+parseInt(_0x46f131(0xaa))/0x6+-parseInt(_0x46f131(0x86))/0x7+-parseInt(_0x46f131(0x8a))/0x8+-parseInt(_0x46f131(0x9f))/0x9*(-parseInt(_0x46f131(0x9c))/0xa);if(_0x11fded===_0x4854f6)break;else _0x2a76ed['push'](_0x2a76ed['shift']());}catch(_0x56db80){_0x2a76ed['push'](_0x2a76ed['shift']());}}}(a28_0x8592,0xc8e06));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x2cd4ea from'chalk';import a28_0x5c9385 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_0x42bfdf(0xa9)]='engage:template:validate';['description']=a28_0x42bfdf(0x96);async[a28_0x42bfdf(0xae)](_0x1c95a5){const _0x5c306c=a28_0x42bfdf,{options:_0x3d57fd,args:_0x378a80}=_0x1c95a5,_0x39023b=_0x3d57fd,_0x3d6bf4=_0x378a80[0x0],_0x1247ed=_0x3d6bf4?a28_0x5c9385[_0x5c306c(0xa1)](_0x3d6bf4):undefined,_0x4469ac=_0x1247ed?isYamlFile(_0x1247ed):![];let _0x350bce,_0x30aed7;if(_0x4469ac&&_0x1247ed)_0x350bce=a28_0x5c9385[_0x5c306c(0x8c)](_0x1247ed),_0x30aed7=_0x1247ed;else _0x1247ed?_0x350bce=_0x1247ed:_0x350bce=process['cwd']();if(!_0x30aed7&&!existsSync(_0x350bce))return console['error'](a28_0x2cd4ea[_0x5c306c(0x90)]('Error:\x20Directory\x20not\x20found:\x20'+_0x350bce+'\x0a')),0x1;let _0x1dce1c;if(_0x30aed7){if(!_0x30aed7['endsWith'](_0x5c306c(0x87))&&!_0x30aed7['endsWith'](_0x5c306c(0xa8)))return console[_0x5c306c(0x9e)](a28_0x2cd4ea['red'](_0x5c306c(0x92)+_0x30aed7+'\x0a')),0x1;_0x1dce1c=[_0x30aed7];}else _0x1dce1c=findYamlFiles(_0x350bce);if(_0x1dce1c[_0x5c306c(0x8e)]===0x0)return console[_0x5c306c(0x9e)](a28_0x2cd4ea[_0x5c306c(0x90)](_0x5c306c(0xa0)+_0x350bce+'\x0a')),0x1;const _0x549615=validateYamlFiles(_0x1dce1c,_0x350bce,{'filterType':_0x5c306c(0x9a)}),_0x56ca2c=calculateSummary(_0x549615),_0x1075f5=_0x549615[_0x5c306c(0x97)](isValidationResult);if(_0x1075f5[_0x5c306c(0x8e)]===0x0)return console['error'](a28_0x2cd4ea[_0x5c306c(0x85)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x350bce+'\x0a')),_0x56ca2c[_0x5c306c(0x84)]>0x0&&console[_0x5c306c(0x9e)](a28_0x2cd4ea[_0x5c306c(0x93)]('('+_0x56ca2c[_0x5c306c(0x84)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x3a798e of _0x549615){if(!isValidationResult(_0x3a798e)){_0x39023b[_0x5c306c(0xa2)]&&console[_0x5c306c(0x8f)](a28_0x2cd4ea[_0x5c306c(0x93)]('-\x20'+_0x3a798e[_0x5c306c(0x91)]+_0x5c306c(0x8b)+_0x3a798e[_0x5c306c(0xa5)]+')'));continue;}const {relativePath:_0x4e9c60,source:_0x317961,result:_0x58bff6}=_0x3a798e;if(_0x58bff6[_0x5c306c(0x94)]&&_0x58bff6[_0x5c306c(0x88)][_0x5c306c(0x8e)]===0x0)_0x39023b[_0x5c306c(0xa2)]&&console[_0x5c306c(0x8f)](a28_0x2cd4ea[_0x5c306c(0xac)]('✔\x20'+_0x4e9c60));else _0x58bff6[_0x5c306c(0x94)]?(console[_0x5c306c(0x8f)](a28_0x2cd4ea[_0x5c306c(0x85)]('⚠\x20'+_0x4e9c60+':\x20'+_0x58bff6[_0x5c306c(0x88)]['length']+_0x5c306c(0x99))),console['log'](formatValidationResult(_0x58bff6,_0x317961,_0x4e9c60))):(console[_0x5c306c(0x8f)](a28_0x2cd4ea[_0x5c306c(0x90)]('✖\x20'+_0x4e9c60+':\x20'+_0x58bff6['errors']['length']+_0x5c306c(0x8d))),console[_0x5c306c(0x8f)](formatValidationResult(_0x58bff6,_0x317961,_0x4e9c60)));}return console[_0x5c306c(0x8f)](''),_0x56ca2c[_0x5c306c(0x9b)]?(console[_0x5c306c(0x8f)](a28_0x2cd4ea[_0x5c306c(0x90)]('Validation\x20failed:\x20'+_0x56ca2c['invalidCount']+_0x5c306c(0xa7)+_0x56ca2c['validCount']+_0x5c306c(0x83))),_0x56ca2c['warningCount']>0x0&&console[_0x5c306c(0x8f)](a28_0x2cd4ea['yellow'](_0x56ca2c['warningCount']+_0x5c306c(0x89))),_0x56ca2c[_0x5c306c(0x84)]>0x0&&console[_0x5c306c(0x8f)](a28_0x2cd4ea[_0x5c306c(0x93)](_0x56ca2c['skippedCount']+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x5c306c(0x8f)](a28_0x2cd4ea[_0x5c306c(0xac)](_0x5c306c(0x95)+_0x56ca2c['validCount']+_0x5c306c(0xa6))),_0x56ca2c[_0x5c306c(0x9d)]>0x0&&console['log'](a28_0x2cd4ea[_0x5c306c(0x85)](_0x56ca2c[_0x5c306c(0x9d)]+_0x5c306c(0x89))),_0x56ca2c[_0x5c306c(0x84)]>0x0&&console[_0x5c306c(0x8f)](a28_0x2cd4ea[_0x5c306c(0x93)](_0x56ca2c[_0x5c306c(0x84)]+_0x5c306c(0xa4))),0x0);}}
1
+ function a29_0x2efe(_0x4ce803,_0x2d9c6b){_0x4ce803=_0x4ce803-0x7f;const _0x25ae66=a29_0x25ae();let _0x2efe26=_0x25ae66[_0x4ce803];return _0x2efe26;}const a29_0x4f6d1c=a29_0x2efe;(function(_0xc0776f,_0x312bf7){const _0xd20a2a=a29_0x2efe,_0x18f9f6=_0xc0776f();while(!![]){try{const _0x4d9de2=-parseInt(_0xd20a2a(0x9b))/0x1*(-parseInt(_0xd20a2a(0x85))/0x2)+parseInt(_0xd20a2a(0xa1))/0x3+parseInt(_0xd20a2a(0x97))/0x4+-parseInt(_0xd20a2a(0x89))/0x5*(parseInt(_0xd20a2a(0xa5))/0x6)+parseInt(_0xd20a2a(0x91))/0x7*(parseInt(_0xd20a2a(0x8f))/0x8)+-parseInt(_0xd20a2a(0x9a))/0x9+-parseInt(_0xd20a2a(0x7f))/0xa;if(_0x4d9de2===_0x312bf7)break;else _0x18f9f6['push'](_0x18f9f6['shift']());}catch(_0xf3dc4){_0x18f9f6['push'](_0x18f9f6['shift']());}}}(a29_0x25ae,0xace8d));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a29_0x25ae(){const _0x553f1a=['95ccYRcT','\x20template(s)\x20valid','.yml','endsWith','description','✔\x20All\x20','1096dRiULh','dirname','32228TlUNRl','log','template','Validate\x20template\x20YAML\x20files','verbose','validCount','2695904FRoyqA','\x20template(s)\x20with\x20errors,\x20','engage:template:validate','4552929gyfMor','23RHLijr','dim','red','warningCount','yellow','error','1716591VdnQmP','\x20valid','.yaml','\x20(skipped:\x20','103782mwQnbB','\x20error(s)','valid','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20warning(s)','invalidCount','execute','Error:\x20Directory\x20not\x20found:\x20','filter','13938390rszttf','resolve','skippedCount','\x20non-template\x20file(s)\x20skipped','green','length','92146rbOkjX','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','reason','errors'];a29_0x25ae=function(){return _0x553f1a;};return a29_0x25ae();}import{existsSync}from'fs';import a29_0x4d9df6 from'chalk';import a29_0x4b1ad5 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{['name']=a29_0x4f6d1c(0x99);[a29_0x4f6d1c(0x8d)]=a29_0x4f6d1c(0x94);async[a29_0x4f6d1c(0xab)](_0x156862){const _0x71e01e=a29_0x4f6d1c,{options:_0x442a6c,args:_0x1f59ac}=_0x156862,_0x46f41b=_0x442a6c,_0x360a06=_0x1f59ac[0x0],_0x345815=_0x360a06?a29_0x4b1ad5[_0x71e01e(0x80)](_0x360a06):undefined,_0xfc5420=_0x345815?isYamlFile(_0x345815):![];let _0x15ebad,_0x5ac431;if(_0xfc5420&&_0x345815)_0x15ebad=a29_0x4b1ad5[_0x71e01e(0x90)](_0x345815),_0x5ac431=_0x345815;else _0x345815?_0x15ebad=_0x345815:_0x15ebad=process['cwd']();if(!_0x5ac431&&!existsSync(_0x15ebad))return console[_0x71e01e(0xa0)](a29_0x4d9df6[_0x71e01e(0x9d)](_0x71e01e(0xac)+_0x15ebad+'\x0a')),0x1;let _0x59e575;if(_0x5ac431){if(!_0x5ac431['endsWith'](_0x71e01e(0x8b))&&!_0x5ac431[_0x71e01e(0x8c)](_0x71e01e(0xa3)))return console[_0x71e01e(0xa0)](a29_0x4d9df6[_0x71e01e(0x9d)](_0x71e01e(0xa8)+_0x5ac431+'\x0a')),0x1;_0x59e575=[_0x5ac431];}else _0x59e575=findYamlFiles(_0x15ebad);if(_0x59e575[_0x71e01e(0x84)]===0x0)return console[_0x71e01e(0xa0)](a29_0x4d9df6[_0x71e01e(0x9d)](_0x71e01e(0x86)+_0x15ebad+'\x0a')),0x1;const _0x3f2b12=validateYamlFiles(_0x59e575,_0x15ebad,{'filterType':_0x71e01e(0x93)}),_0x5587fc=calculateSummary(_0x3f2b12),_0x3135eb=_0x3f2b12[_0x71e01e(0xad)](isValidationResult);if(_0x3135eb['length']===0x0)return console[_0x71e01e(0xa0)](a29_0x4d9df6['yellow']('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x15ebad+'\x0a')),_0x5587fc['skippedCount']>0x0&&console[_0x71e01e(0xa0)](a29_0x4d9df6[_0x71e01e(0x9c)]('('+_0x5587fc[_0x71e01e(0x81)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x395675 of _0x3f2b12){if(!isValidationResult(_0x395675)){_0x46f41b[_0x71e01e(0x95)]&&console[_0x71e01e(0x92)](a29_0x4d9df6[_0x71e01e(0x9c)]('-\x20'+_0x395675['relativePath']+_0x71e01e(0xa4)+_0x395675[_0x71e01e(0x87)]+')'));continue;}const {relativePath:_0x356751,source:_0xe8a9f7,result:_0xe76aa1}=_0x395675;if(_0xe76aa1[_0x71e01e(0xa7)]&&_0xe76aa1['warnings']['length']===0x0)_0x46f41b[_0x71e01e(0x95)]&&console[_0x71e01e(0x92)](a29_0x4d9df6['green']('✔\x20'+_0x356751));else _0xe76aa1['valid']?(console[_0x71e01e(0x92)](a29_0x4d9df6[_0x71e01e(0x9f)]('⚠\x20'+_0x356751+':\x20'+_0xe76aa1['warnings'][_0x71e01e(0x84)]+_0x71e01e(0xa9))),console[_0x71e01e(0x92)](formatValidationResult(_0xe76aa1,_0xe8a9f7,_0x356751))):(console[_0x71e01e(0x92)](a29_0x4d9df6['red']('✖\x20'+_0x356751+':\x20'+_0xe76aa1[_0x71e01e(0x88)][_0x71e01e(0x84)]+_0x71e01e(0xa6))),console[_0x71e01e(0x92)](formatValidationResult(_0xe76aa1,_0xe8a9f7,_0x356751)));}return console['log'](''),_0x5587fc['hasErrors']?(console[_0x71e01e(0x92)](a29_0x4d9df6[_0x71e01e(0x9d)]('Validation\x20failed:\x20'+_0x5587fc[_0x71e01e(0xaa)]+_0x71e01e(0x98)+_0x5587fc[_0x71e01e(0x96)]+_0x71e01e(0xa2))),_0x5587fc[_0x71e01e(0x9e)]>0x0&&console[_0x71e01e(0x92)](a29_0x4d9df6[_0x71e01e(0x9f)](_0x5587fc[_0x71e01e(0x9e)]+'\x20warning(s)\x20found')),_0x5587fc[_0x71e01e(0x81)]>0x0&&console[_0x71e01e(0x92)](a29_0x4d9df6[_0x71e01e(0x9c)](_0x5587fc[_0x71e01e(0x81)]+_0x71e01e(0x82))),0x1):(console[_0x71e01e(0x92)](a29_0x4d9df6[_0x71e01e(0x83)](_0x71e01e(0x8e)+_0x5587fc['validCount']+_0x71e01e(0x8a))),_0x5587fc['warningCount']>0x0&&console[_0x71e01e(0x92)](a29_0x4d9df6[_0x71e01e(0x9f)](_0x5587fc['warningCount']+'\x20warning(s)\x20found')),_0x5587fc[_0x71e01e(0x81)]>0x0&&console[_0x71e01e(0x92)](a29_0x4d9df6[_0x71e01e(0x9c)](_0x5587fc[_0x71e01e(0x81)]+_0x71e01e(0x82))),0x0);}}
@@ -1 +1 @@
1
- const a29_0x2ec4d7=a29_0x2edb;(function(_0x256bf7,_0x307823){const _0x44b9e9=a29_0x2edb,_0x581d66=_0x256bf7();while(!![]){try{const _0x34f5dc=-parseInt(_0x44b9e9(0xe7))/0x1+parseInt(_0x44b9e9(0x125))/0x2*(-parseInt(_0x44b9e9(0xff))/0x3)+-parseInt(_0x44b9e9(0xf7))/0x4+-parseInt(_0x44b9e9(0x109))/0x5*(parseInt(_0x44b9e9(0x10c))/0x6)+parseInt(_0x44b9e9(0xfa))/0x7+parseInt(_0x44b9e9(0x11c))/0x8+parseInt(_0x44b9e9(0xfd))/0x9;if(_0x34f5dc===_0x307823)break;else _0x581d66['push'](_0x581d66['shift']());}catch(_0x3eb0a8){_0x581d66['push'](_0x581d66['shift']());}}}(a29_0xa2eb,0x9ef31));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 a29_0xa2eb(){const _0x1feb8b=['getTime','Cancelled','description','error','Limit:\x20','Submit\x20a\x20job','now','end_at','No\x20SQL\x20statements\x20found\x20in\x20file','Job\x20type:\x20','file','map','validate','args','verbose','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','952563hrEZgj','information_schema','url','success','submit','\x20job','user_name','data','job:show','yes','✔\x20Retrieved\x20','List\x20jobs','push','site','Getting\x20job\x20results...','round','2837524FKQcCz','d\x20ago','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','7400428cUNNBs','status','start_at','16539318oJNOlQ','debug','722949ncBJcH','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','hive','Query:\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','list','Submitting\x20kill\x20request...','Getting\x20job\x20details...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','presto','3980575mfjMat','abs','job_id','6MtWIgr','job:result','created_at','length','query','\x20jobs','join','dim','Kill\x20a\x20job','log','...','trino','kill','floor','just\x20now','jobs','3641544FOVmkm','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','result','database','name','execute','type','job:submit','2ckqrsV','\x20\x20Job\x20ID:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>'];a29_0xa2eb=function(){return _0x1feb8b;};return a29_0xa2eb();}import{hyperlink}from'../sdk/util/formatters.js';import a29_0x2506af from'chalk';function formatDuration(_0xff520a){const _0x24ba55=a29_0x2edb;if(_0xff520a<0x3c)return _0xff520a+'s';if(_0xff520a<0xe10)return Math['floor'](_0xff520a/0x3c)+'m\x20'+_0xff520a%0x3c+'s';const _0x189ca6=Math[_0x24ba55(0x119)](_0xff520a/0xe10),_0x55dcbe=Math[_0x24ba55(0x119)](_0xff520a%0xe10/0x3c);return _0x55dcbe>0x0?_0x189ca6+'h\x20'+_0x55dcbe+'m':_0x189ca6+'h';}function formatRelativeTime(_0x1507db){const _0x4d995f=a29_0x2edb,_0x3b57bf=Date[_0x4d995f(0x130)]()-_0x1507db['getTime'](),_0x11baf6=Math[_0x4d995f(0x119)](Math[_0x4d995f(0x10a)](_0x3b57bf)/0x3e8);if(_0x11baf6<0x3c)return _0x4d995f(0x11a);const _0x60924=Math[_0x4d995f(0x119)](_0x11baf6/0x3c);if(_0x60924<0x3c)return _0x60924+'m\x20ago';const _0x512094=Math['floor'](_0x60924/0x3c);if(_0x512094<0x18)return _0x512094+'h\x20ago';const _0x209dc2=Math[_0x4d995f(0x119)](_0x512094/0x18);if(_0x209dc2<0x1e)return _0x209dc2+_0x4d995f(0xf8);return Math[_0x4d995f(0x119)](_0x209dc2/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a29_0x2ec4d7(0x121)]=a29_0x2ec4d7(0x11b);[a29_0x2ec4d7(0x12c)]=a29_0x2ec4d7(0xf2);async[a29_0x2ec4d7(0x122)](_0x2167f5){const _0xee8178=a29_0x2ec4d7,{options:_0x454748,tdx:_0x4cb288}=_0x2167f5,_0x516fef=resolveLimit(_0x454748['limit'],DEFAULT_DISPLAY_LIMIT),_0x57d657=_0x454748['status'];_0x454748[_0xee8178(0xe5)]&&(console[_0xee8178(0x12d)](_0xee8178(0x12e)+_0x516fef+_0xee8178(0x111)),_0x57d657&&console[_0xee8178(0x12d)]('Status\x20filter:\x20'+_0x57d657));const _0x594820=await withSpinner('Listing\x20jobs...',()=>_0x4cb288[_0xee8178(0x11b)][_0xee8178(0x104)]({'from':0x0,'to':_0x516fef-0x1,'status':_0x57d657}),{'verbose':_0x454748[_0xee8178(0xe5)]}),_0x431311=_0x594820[_0xee8178(0xee)];console[_0xee8178(0x12d)]('✔\x20Found\x20'+_0x431311['length']+_0xee8178(0xec)+(_0x431311[_0xee8178(0x10f)]!==0x1?'s':''));const _0x4c807f=_0x454748[_0xee8178(0xf4)];if(isStructuredFormat(_0x454748)){const _0x52841c=_0x431311[_0xee8178(0x135)](_0x15b7a7=>{const _0x1bcc2e=_0xee8178;let _0x3e495e;if(_0x15b7a7[_0x1bcc2e(0xfc)]&&_0x15b7a7[_0x1bcc2e(0x131)]){const _0x1ed27e=new Date(_0x15b7a7['start_at'])[_0x1bcc2e(0x12a)](),_0x468c1e=new Date(_0x15b7a7['end_at'])[_0x1bcc2e(0x12a)]();_0x3e495e=Math[_0x1bcc2e(0xf6)]((_0x468c1e-_0x1ed27e)/0x3e8);}return{'job_id':_0x15b7a7[_0x1bcc2e(0x10b)],'type':_0x15b7a7[_0x1bcc2e(0x123)]===_0x1bcc2e(0x108)?'trino':_0x15b7a7[_0x1bcc2e(0x123)],'status':_0x15b7a7['status'],'user_name':_0x15b7a7['user_name'],'duration_sec':_0x3e495e,'created_at':_0x15b7a7['created_at'],'started_at':_0x15b7a7['start_at'],'end_at':_0x15b7a7['end_at']};});await handleSDKOutput(_0x52841c,_0x454748);}else for(const _0x5b2ae0 of _0x431311){const _0x998b40=_0x5b2ae0['status']===_0xee8178(0xea)?a29_0x2506af['green']:_0x5b2ae0[_0xee8178(0xfb)]===_0xee8178(0x12d)?a29_0x2506af['red']:a29_0x2506af[_0xee8178(0x113)],_0x461add=_0x998b40(_0x5b2ae0['status']),_0x187f23=getJobUrl(_0x4c807f,_0x5b2ae0['job_id']),_0xd98d0c=hyperlink(_0x5b2ae0['job_id'],_0x187f23),_0x5015d5=a29_0x2506af[_0xee8178(0x113)](_0x5b2ae0[_0xee8178(0x123)]===_0xee8178(0x108)?_0xee8178(0x117):_0x5b2ae0[_0xee8178(0x123)]),_0xba2a51=[];if(_0x5b2ae0[_0xee8178(0xfc)]&&_0x5b2ae0['end_at']){const _0x433528=Math[_0xee8178(0xf6)]((new Date(_0x5b2ae0['end_at'])[_0xee8178(0x12a)]()-new Date(_0x5b2ae0[_0xee8178(0xfc)])[_0xee8178(0x12a)]())/0x3e8);_0xba2a51[_0xee8178(0xf3)](formatDuration(_0x433528));}if(_0x5b2ae0[_0xee8178(0x131)])_0xba2a51[_0xee8178(0xf3)](formatRelativeTime(new Date(_0x5b2ae0[_0xee8178(0x131)])));else _0x5b2ae0[_0xee8178(0xfc)]&&_0xba2a51[_0xee8178(0xf3)](formatRelativeTime(new Date(_0x5b2ae0['start_at'])));const _0x43b2cb=_0xba2a51[_0xee8178(0x10f)]>0x0?a29_0x2506af['dim']('\x20'+_0xba2a51[_0xee8178(0x112)](',\x20')):'';console[_0xee8178(0x115)]('⚡\x20'+_0xd98d0c+'\x20'+_0x5015d5+'\x20'+_0x461add+_0x43b2cb);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a29_0x2ec4d7(0x121)]=a29_0x2ec4d7(0xef);['description']='Show\x20job\x20details';['validate'](_0x527a6){const _0x418140=a29_0x2ec4d7,_0x86c97c=_0x527a6[_0x418140(0xe4)][0x0];if(!_0x86c97c)return _0x418140(0x100);return undefined;}async[a29_0x2ec4d7(0x122)](_0x431c24){const _0x21ad13=a29_0x2ec4d7,{options:_0x53f4ea,args:_0x3e2c06,tdx:_0x54accb}=_0x431c24,_0x196408=_0x3e2c06[0x0],_0x3f0614=await withSpinner(_0x21ad13(0x106),()=>_0x54accb[_0x21ad13(0x11b)]['show'](_0x196408),{'verbose':_0x53f4ea['verbose']}),_0x28f4a2=_0x3f0614[_0x21ad13(0xee)];let _0x208516;if(_0x28f4a2[_0x21ad13(0xfc)]&&_0x28f4a2['end_at']){const _0x73ec29=new Date(_0x28f4a2[_0x21ad13(0xfc)])['getTime'](),_0x3471bc=new Date(_0x28f4a2[_0x21ad13(0x131)])[_0x21ad13(0x12a)]();_0x208516=Math['round']((_0x3471bc-_0x73ec29)/0x3e8);}const _0x597c6d={'job_id':_0x28f4a2['job_id'],'type':_0x28f4a2[_0x21ad13(0x123)],'status':_0x28f4a2[_0x21ad13(0xfb)],..._0x28f4a2[_0x21ad13(0xed)]&&{'user_name':_0x28f4a2[_0x21ad13(0xed)]},..._0x208516!==undefined&&{'duration_sec':_0x208516},..._0x28f4a2[_0x21ad13(0x10e)]&&{'created_at':_0x28f4a2[_0x21ad13(0x10e)]},..._0x28f4a2[_0x21ad13(0xfc)]&&{'started_at':_0x28f4a2['start_at']},..._0x28f4a2[_0x21ad13(0x131)]&&{'end_at':_0x28f4a2[_0x21ad13(0x131)]},..._0x28f4a2['database']&&{'database':_0x28f4a2[_0x21ad13(0x120)]},..._0x28f4a2['priority']!==undefined&&{'priority':_0x28f4a2['priority']},..._0x28f4a2['url']&&{'url':_0x28f4a2[_0x21ad13(0xe9)]},..._0x28f4a2[_0x21ad13(0x110)]&&{'query':_0x28f4a2['query']},..._0x28f4a2[_0x21ad13(0xfe)]&&{'debug':_0x28f4a2[_0x21ad13(0xfe)]}};return await handleSingleObjectOutput(_0x597c6d,_0x53f4ea),0x0;}}function a29_0x2edb(_0xd6f486,_0x3ffd35){_0xd6f486=_0xd6f486-0xe3;const _0xa2ebbc=a29_0xa2eb();let _0x2edb5b=_0xa2ebbc[_0xd6f486];return _0x2edb5b;}export class JobKillCommand extends BaseCommand{[a29_0x2ec4d7(0x121)]='job:kill';[a29_0x2ec4d7(0x12c)]=a29_0x2ec4d7(0x114);[a29_0x2ec4d7(0xe3)](_0x1b8524){const _0x7890eb=a29_0x2ec4d7,_0x1845c2=_0x1b8524[_0x7890eb(0xe4)][0x0];if(!_0x1845c2)return _0x7890eb(0x107);return undefined;}async[a29_0x2ec4d7(0x122)](_0xe636c0){const _0x5c464a=a29_0x2ec4d7,{options:_0x3ec289,args:_0x522b7e,tdx:_0x436396}=_0xe636c0,_0x5512de=_0x522b7e[0x0];if(!_0x3ec289[_0x5c464a(0xf0)]){const _0x3da320=await confirm(_0x5c464a(0x11d)+_0x5512de+'?');if(!_0x3da320)return console[_0x5c464a(0x12d)](_0x5c464a(0x12b)),0x0;}return await withSpinner(_0x5c464a(0x105),()=>_0x436396[_0x5c464a(0x11b)][_0x5c464a(0x118)](_0x5512de),{'verbose':_0x3ec289[_0x5c464a(0xe5)]}),console[_0x5c464a(0x12d)](_0x5c464a(0x11e)+_0x5512de),console[_0x5c464a(0x12d)](_0x5c464a(0x103)+_0x5512de+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a29_0x2ec4d7(0x121)]=a29_0x2ec4d7(0x124);[a29_0x2ec4d7(0x12c)]=a29_0x2ec4d7(0x12f);async[a29_0x2ec4d7(0x122)](_0x1f6f49){const _0x407a3f=a29_0x2ec4d7,{options:_0x4c2fc3,args:_0x53c26e,tdx:_0x44d6ca}=_0x1f6f49,_0x2a657c=_0x4c2fc3['jobType']||_0x407a3f(0x117),_0x1b022f=_0x4c2fc3[_0x407a3f(0x134)],_0x21d456=_0x4c2fc3['database']||_0x407a3f(0xe8),_0x3839de=_0x4c2fc3[_0x407a3f(0x11f)];if(_0x2a657c!==_0x407a3f(0x117)&&_0x2a657c!==_0x407a3f(0x101))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x407a3f(0xe6));let _0x3c320a;if(_0x1b022f){if(_0x53c26e[0x0])throw new SDKError(ErrorCode[_0x407a3f(0x128)],_0x407a3f(0x127));const _0x335c1d=readSqlStatementsFromFile(_0x1b022f);if(_0x335c1d['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x407a3f(0x132));if(_0x335c1d[_0x407a3f(0x10f)]>0x1)throw new SDKError(ErrorCode[_0x407a3f(0x128)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x3c320a=_0x335c1d[0x0];}else{if(!_0x53c26e[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x407a3f(0xf9));_0x3c320a=_0x53c26e[0x0];}_0x4c2fc3[_0x407a3f(0xe5)]&&(console['error'](_0x407a3f(0x133)+_0x2a657c),console[_0x407a3f(0x12d)]('Database:\x20'+_0x21d456),console[_0x407a3f(0x12d)](_0x407a3f(0x102)+_0x3c320a['substring'](0x0,0x64)+(_0x3c320a[_0x407a3f(0x10f)]>0x64?_0x407a3f(0x116):'')));const _0x36a3d5=await withSpinner('Submitting\x20job...',()=>_0x44d6ca[_0x407a3f(0x11b)][_0x407a3f(0xeb)](_0x21d456,_0x3c320a,_0x2a657c,_0x3839de),{'verbose':_0x4c2fc3[_0x407a3f(0xe5)]}),_0x1f6301=_0x36a3d5[_0x407a3f(0xee)];return console['error']('✔\x20Job\x20submitted'),console['error'](_0x407a3f(0x126)+_0x1f6301[_0x407a3f(0x10b)]),await handleSDKOutput([_0x1f6301],_0x4c2fc3),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a29_0x2ec4d7(0x10d);[a29_0x2ec4d7(0x12c)]='Get\x20job\x20results';['validate'](_0x14d124){const _0x26b703=a29_0x2ec4d7,_0x15b957=_0x14d124[_0x26b703(0xe4)][0x0];if(!_0x15b957)return _0x26b703(0x129);return undefined;}async[a29_0x2ec4d7(0x122)](_0x5b455d){const _0x1f019c=a29_0x2ec4d7,{options:_0x56ea3e,args:_0x299f28,tdx:_0x26a168}=_0x5b455d,_0x4acab8=_0x299f28[0x0],_0x4bda84=await withSpinner(_0x1f019c(0xf5),()=>_0x26a168[_0x1f019c(0x11b)]['result'](_0x4acab8),{'verbose':_0x56ea3e['verbose']}),_0x197df2=_0x4bda84[_0x1f019c(0xee)];return console[_0x1f019c(0x12d)](_0x1f019c(0xf1)+_0x197df2[_0x1f019c(0x10f)]+'\x20row'+(_0x197df2[_0x1f019c(0x10f)]!==0x1?'s':'')),await handleSDKOutput(_0x197df2,_0x56ea3e),0x0;}}
1
+ const a30_0x82e7d7=a30_0x1802;(function(_0x474bab,_0x17d78a){const _0x1200b5=a30_0x1802,_0x221769=_0x474bab();while(!![]){try{const _0x69d757=-parseInt(_0x1200b5(0xda))/0x1+parseInt(_0x1200b5(0xfc))/0x2+parseInt(_0x1200b5(0xf2))/0x3+parseInt(_0x1200b5(0x10f))/0x4*(parseInt(_0x1200b5(0xed))/0x5)+-parseInt(_0x1200b5(0xea))/0x6+parseInt(_0x1200b5(0x107))/0x7*(-parseInt(_0x1200b5(0x115))/0x8)+parseInt(_0x1200b5(0xcb))/0x9*(parseInt(_0x1200b5(0xd3))/0xa);if(_0x69d757===_0x17d78a)break;else _0x221769['push'](_0x221769['shift']());}catch(_0xa3ab8f){_0x221769['push'](_0x221769['shift']());}}}(a30_0x454f,0x9706c));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';function a30_0x1802(_0x4b665e,_0xbea13c){_0x4b665e=_0x4b665e-0xc0;const _0x454fe8=a30_0x454f();let _0x18027f=_0x454fe8[_0x4b665e];return _0x18027f;}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 a30_0x51a2d1 from'chalk';function formatDuration(_0x54f2a7){const _0x3325a7=a30_0x1802;if(_0x54f2a7<0x3c)return _0x54f2a7+'s';if(_0x54f2a7<0xe10)return Math[_0x3325a7(0xe2)](_0x54f2a7/0x3c)+'m\x20'+_0x54f2a7%0x3c+'s';const _0x8349dd=Math['floor'](_0x54f2a7/0xe10),_0x27feb3=Math['floor'](_0x54f2a7%0xe10/0x3c);return _0x27feb3>0x0?_0x8349dd+'h\x20'+_0x27feb3+'m':_0x8349dd+'h';}function formatRelativeTime(_0x45a1ad){const _0x242951=a30_0x1802,_0x38b059=Date['now']()-_0x45a1ad[_0x242951(0x110)](),_0x418142=Math['floor'](Math['abs'](_0x38b059)/0x3e8);if(_0x418142<0x3c)return _0x242951(0xe0);const _0xc0b9dc=Math[_0x242951(0xe2)](_0x418142/0x3c);if(_0xc0b9dc<0x3c)return _0xc0b9dc+'m\x20ago';const _0x563e8e=Math[_0x242951(0xe2)](_0xc0b9dc/0x3c);if(_0x563e8e<0x18)return _0x563e8e+_0x242951(0xc6);const _0x56f1f1=Math['floor'](_0x563e8e/0x18);if(_0x56f1f1<0x1e)return _0x56f1f1+_0x242951(0x117);return Math[_0x242951(0xe2)](_0x56f1f1/0x1e)+_0x242951(0xca);}export class JobListCommand extends BaseCommand{[a30_0x82e7d7(0xc9)]=a30_0x82e7d7(0xd7);['description']=a30_0x82e7d7(0xdb);async['execute'](_0x362ba2){const _0x2951f0=a30_0x82e7d7,{options:_0x3059f8,tdx:_0xef8a4a}=_0x362ba2,_0x13a16a=resolveLimit(_0x3059f8[_0x2951f0(0xd6)],DEFAULT_DISPLAY_LIMIT),_0x446b80=_0x3059f8[_0x2951f0(0xec)];_0x3059f8['verbose']&&(console[_0x2951f0(0xe1)](_0x2951f0(0xe9)+_0x13a16a+_0x2951f0(0xee)),_0x446b80&&console[_0x2951f0(0xe1)](_0x2951f0(0xf3)+_0x446b80));const _0x479ed4=await withSpinner(_0x2951f0(0x108),()=>_0xef8a4a[_0x2951f0(0xd7)][_0x2951f0(0xe6)]({'from':0x0,'to':_0x13a16a-0x1,'status':_0x446b80}),{'verbose':_0x3059f8['verbose']}),_0x50500e=_0x479ed4['data'];console[_0x2951f0(0xe1)](_0x2951f0(0xc4)+_0x50500e[_0x2951f0(0xe4)]+_0x2951f0(0xcc)+(_0x50500e['length']!==0x1?'s':''));const _0x4dfc05=_0x3059f8['site'];if(isStructuredFormat(_0x3059f8)){const _0x57428b=_0x50500e[_0x2951f0(0x10b)](_0x407384=>{const _0x347c2f=_0x2951f0;let _0x2653f4;if(_0x407384[_0x347c2f(0x116)]&&_0x407384[_0x347c2f(0x118)]){const _0xf898ec=new Date(_0x407384['start_at'])[_0x347c2f(0x110)](),_0xc02d4=new Date(_0x407384[_0x347c2f(0x118)])[_0x347c2f(0x110)]();_0x2653f4=Math[_0x347c2f(0xc0)]((_0xc02d4-_0xf898ec)/0x3e8);}return{'job_id':_0x407384[_0x347c2f(0x10e)],'type':_0x407384[_0x347c2f(0xd8)]===_0x347c2f(0x10a)?_0x347c2f(0x104):_0x407384[_0x347c2f(0xd8)],'status':_0x407384['status'],'user_name':_0x407384[_0x347c2f(0xf5)],'duration_sec':_0x2653f4,'created_at':_0x407384[_0x347c2f(0xd4)],'started_at':_0x407384[_0x347c2f(0x116)],'end_at':_0x407384[_0x347c2f(0x118)]};});await handleSDKOutput(_0x57428b,_0x3059f8);}else for(const _0x301290 of _0x50500e){const _0x5e242f=_0x301290[_0x2951f0(0xec)]===_0x2951f0(0xe7)?a30_0x51a2d1[_0x2951f0(0x112)]:_0x301290[_0x2951f0(0xec)]==='error'?a30_0x51a2d1[_0x2951f0(0xe8)]:a30_0x51a2d1['dim'],_0x1136d5=_0x5e242f(_0x301290[_0x2951f0(0xec)]),_0x878455=getJobUrl(_0x4dfc05,_0x301290['job_id']),_0x277978=hyperlink(_0x301290[_0x2951f0(0x10e)],_0x878455),_0x45b443=a30_0x51a2d1['dim'](_0x301290['type']===_0x2951f0(0x10a)?_0x2951f0(0x104):_0x301290['type']),_0x5d00f0=[];if(_0x301290[_0x2951f0(0x116)]&&_0x301290['end_at']){const _0xff219a=Math[_0x2951f0(0xc0)]((new Date(_0x301290[_0x2951f0(0x118)])[_0x2951f0(0x110)]()-new Date(_0x301290['start_at'])[_0x2951f0(0x110)]())/0x3e8);_0x5d00f0[_0x2951f0(0x111)](formatDuration(_0xff219a));}if(_0x301290['end_at'])_0x5d00f0[_0x2951f0(0x111)](formatRelativeTime(new Date(_0x301290[_0x2951f0(0x118)])));else _0x301290[_0x2951f0(0x116)]&&_0x5d00f0['push'](formatRelativeTime(new Date(_0x301290[_0x2951f0(0x116)])));const _0x34c53c=_0x5d00f0[_0x2951f0(0xe4)]>0x0?a30_0x51a2d1[_0x2951f0(0xf8)]('\x20'+_0x5d00f0['join'](',\x20')):'';console[_0x2951f0(0x10c)]('⚡\x20'+_0x277978+'\x20'+_0x45b443+'\x20'+_0x1136d5+_0x34c53c);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a30_0x82e7d7(0xc9)]=a30_0x82e7d7(0x106);[a30_0x82e7d7(0x109)]=a30_0x82e7d7(0x113);[a30_0x82e7d7(0xc2)](_0x307854){const _0x4d4c47=a30_0x82e7d7,_0x5cdb69=_0x307854[_0x4d4c47(0x105)][0x0];if(!_0x5cdb69)return _0x4d4c47(0xc5);return undefined;}async[a30_0x82e7d7(0xef)](_0x403d11){const _0x48fd65=a30_0x82e7d7,{options:_0x4d0eb6,args:_0x59f8c1,tdx:_0x10eb64}=_0x403d11,_0x39bed5=_0x59f8c1[0x0],_0x373660=await withSpinner(_0x48fd65(0xff),()=>_0x10eb64[_0x48fd65(0xd7)][_0x48fd65(0xc8)](_0x39bed5),{'verbose':_0x4d0eb6[_0x48fd65(0xcf)]}),_0x435ab2=_0x373660['data'];let _0x3fb58a;if(_0x435ab2[_0x48fd65(0x116)]&&_0x435ab2['end_at']){const _0x2c2a29=new Date(_0x435ab2[_0x48fd65(0x116)])[_0x48fd65(0x110)](),_0x4a1b77=new Date(_0x435ab2[_0x48fd65(0x118)])[_0x48fd65(0x110)]();_0x3fb58a=Math[_0x48fd65(0xc0)]((_0x4a1b77-_0x2c2a29)/0x3e8);}const _0x5b39a8={'job_id':_0x435ab2[_0x48fd65(0x10e)],'type':_0x435ab2['type'],'status':_0x435ab2[_0x48fd65(0xec)],..._0x435ab2[_0x48fd65(0xf5)]&&{'user_name':_0x435ab2[_0x48fd65(0xf5)]},..._0x3fb58a!==undefined&&{'duration_sec':_0x3fb58a},..._0x435ab2['created_at']&&{'created_at':_0x435ab2[_0x48fd65(0xd4)]},..._0x435ab2[_0x48fd65(0x116)]&&{'started_at':_0x435ab2[_0x48fd65(0x116)]},..._0x435ab2[_0x48fd65(0x118)]&&{'end_at':_0x435ab2['end_at']},..._0x435ab2[_0x48fd65(0x100)]&&{'database':_0x435ab2[_0x48fd65(0x100)]},..._0x435ab2['priority']!==undefined&&{'priority':_0x435ab2['priority']},..._0x435ab2[_0x48fd65(0xf4)]&&{'url':_0x435ab2[_0x48fd65(0xf4)]},..._0x435ab2[_0x48fd65(0xe5)]&&{'query':_0x435ab2[_0x48fd65(0xe5)]},..._0x435ab2['debug']&&{'debug':_0x435ab2['debug']}};return await handleSingleObjectOutput(_0x5b39a8,_0x4d0eb6),0x0;}}export class JobKillCommand extends BaseCommand{[a30_0x82e7d7(0xc9)]='job:kill';[a30_0x82e7d7(0x109)]=a30_0x82e7d7(0xf1);[a30_0x82e7d7(0xc2)](_0x24008a){const _0xf2fc32=a30_0x82e7d7,_0x1caf80=_0x24008a[_0xf2fc32(0x105)][0x0];if(!_0x1caf80)return _0xf2fc32(0xeb);return undefined;}async[a30_0x82e7d7(0xef)](_0x2442b6){const _0x58d67c=a30_0x82e7d7,{options:_0x59e52b,args:_0x3314fe,tdx:_0x5256a6}=_0x2442b6,_0x2da7ec=_0x3314fe[0x0];if(!_0x59e52b[_0x58d67c(0xd5)]){const _0x21fbd4=await confirm(_0x58d67c(0xf9)+_0x2da7ec+'?');if(!_0x21fbd4)return console[_0x58d67c(0xe1)](_0x58d67c(0xe3)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x5256a6[_0x58d67c(0xd7)][_0x58d67c(0xc1)](_0x2da7ec),{'verbose':_0x59e52b[_0x58d67c(0xcf)]}),console[_0x58d67c(0xe1)](_0x58d67c(0xf6)+_0x2da7ec),console[_0x58d67c(0xe1)](_0x58d67c(0xf0)+_0x2da7ec+_0x58d67c(0x102)),0x0;}}function a30_0x454f(){const _0xe5fef7=['information_schema','10dygQpD','created_at','yes','limit','jobs','type','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','894719kCMfVC','List\x20jobs','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job:submit','Job\x20type:\x20','file','just\x20now','error','floor','Cancelled','length','query','list','success','red','Limit:\x20','529350AsKMiA','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','status','5GeTntF','\x20jobs','execute','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Kill\x20a\x20job','431409LQUgaY','Status\x20filter:\x20','url','user_name','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Query:\x20','dim','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Database:\x20','...','1070780uUnaSC','Getting\x20job\x20results...','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Getting\x20job\x20details...','database','✔\x20Retrieved\x20','\x27\x20to\x20verify\x20the\x20job\x20status','✔\x20Job\x20submitted','trino','args','job:show','9667jtwFOe','Listing\x20jobs...','description','presto','map','log','Submitting\x20job...','job_id','2031404amloXf','getTime','push','green','Show\x20job\x20details','Get\x20job\x20results','4552gJCqkb','start_at','d\x20ago','end_at','round','kill','validate','INVALID_ARGUMENT','✔\x20Found\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','h\x20ago','Submit\x20a\x20job','show','name','mo\x20ago','10802637sVLgCG','\x20job','\x20\x20Job\x20ID:\x20','data','verbose','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','result'];a30_0x454f=function(){return _0xe5fef7;};return a30_0x454f();}export class JobSubmitCommand extends BaseCommand{['name']=a30_0x82e7d7(0xdd);['description']=a30_0x82e7d7(0xc7);async[a30_0x82e7d7(0xef)](_0x5e7492){const _0x59fe8d=a30_0x82e7d7,{options:_0x258d87,args:_0x1edf26,tdx:_0x353246}=_0x5e7492,_0x93ccb2=_0x258d87['jobType']||_0x59fe8d(0x104),_0x369bf6=_0x258d87[_0x59fe8d(0xdf)],_0xd8e241=_0x258d87[_0x59fe8d(0x100)]||_0x59fe8d(0xd2),_0x39b84e=_0x258d87[_0x59fe8d(0xd1)];if(_0x93ccb2!==_0x59fe8d(0x104)&&_0x93ccb2!=='hive')throw new SDKError(ErrorCode[_0x59fe8d(0xc3)],_0x59fe8d(0xd0));let _0x5d5ef5;if(_0x369bf6){if(_0x1edf26[0x0])throw new SDKError(ErrorCode[_0x59fe8d(0xc3)],_0x59fe8d(0xfe));const _0x8184aa=readSqlStatementsFromFile(_0x369bf6);if(_0x8184aa[_0x59fe8d(0xe4)]===0x0)throw new SDKError(ErrorCode[_0x59fe8d(0xc3)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x8184aa['length']>0x1)throw new SDKError(ErrorCode[_0x59fe8d(0xc3)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x5d5ef5=_0x8184aa[0x0];}else{if(!_0x1edf26[0x0])throw new SDKError(ErrorCode[_0x59fe8d(0xc3)],_0x59fe8d(0xdc));_0x5d5ef5=_0x1edf26[0x0];}_0x258d87[_0x59fe8d(0xcf)]&&(console['error'](_0x59fe8d(0xde)+_0x93ccb2),console[_0x59fe8d(0xe1)](_0x59fe8d(0xfa)+_0xd8e241),console[_0x59fe8d(0xe1)](_0x59fe8d(0xf7)+_0x5d5ef5['substring'](0x0,0x64)+(_0x5d5ef5[_0x59fe8d(0xe4)]>0x64?_0x59fe8d(0xfb):'')));const _0x109f15=await withSpinner(_0x59fe8d(0x10d),()=>_0x353246[_0x59fe8d(0xd7)]['submit'](_0xd8e241,_0x5d5ef5,_0x93ccb2,_0x39b84e),{'verbose':_0x258d87[_0x59fe8d(0xcf)]}),_0x4b7f35=_0x109f15[_0x59fe8d(0xce)];return console['error'](_0x59fe8d(0x103)),console[_0x59fe8d(0xe1)](_0x59fe8d(0xcd)+_0x4b7f35[_0x59fe8d(0x10e)]),await handleSDKOutput([_0x4b7f35],_0x258d87),0x0;}}export class JobResultCommand extends BaseCommand{[a30_0x82e7d7(0xc9)]='job:result';[a30_0x82e7d7(0x109)]=a30_0x82e7d7(0x114);[a30_0x82e7d7(0xc2)](_0x2cc83b){const _0x128956=a30_0x82e7d7,_0x24ff35=_0x2cc83b[_0x128956(0x105)][0x0];if(!_0x24ff35)return _0x128956(0xd9);return undefined;}async[a30_0x82e7d7(0xef)](_0x1583f6){const _0x91bd4f=a30_0x82e7d7,{options:_0x430606,args:_0x50d728,tdx:_0x1a7f14}=_0x1583f6,_0x541360=_0x50d728[0x0],_0x51aa39=await withSpinner(_0x91bd4f(0xfd),()=>_0x1a7f14[_0x91bd4f(0xd7)]['result'](_0x541360),{'verbose':_0x430606[_0x91bd4f(0xcf)]}),_0x330fd2=_0x51aa39[_0x91bd4f(0xce)];return console['error'](_0x91bd4f(0x101)+_0x330fd2['length']+'\x20row'+(_0x330fd2[_0x91bd4f(0xe4)]!==0x1?'s':'')),await handleSDKOutput(_0x330fd2,_0x430606),0x0;}}
@@ -1 +1 @@
1
- const a30_0x1c81ec=a30_0x434a;(function(_0x28c272,_0x2e6628){const _0x50572d=a30_0x434a,_0x86b649=_0x28c272();while(!![]){try{const _0x27de87=parseInt(_0x50572d(0x132))/0x1+-parseInt(_0x50572d(0x97))/0x2+parseInt(_0x50572d(0x15f))/0x3+-parseInt(_0x50572d(0xb3))/0x4+parseInt(_0x50572d(0x137))/0x5+parseInt(_0x50572d(0x113))/0x6*(-parseInt(_0x50572d(0x126))/0x7)+-parseInt(_0x50572d(0x18a))/0x8*(-parseInt(_0x50572d(0x10b))/0x9);if(_0x27de87===_0x2e6628)break;else _0x86b649['push'](_0x86b649['shift']());}catch(_0x4f25d2){_0x86b649['push'](_0x86b649['shift']());}}}(a30_0x4b58,0x40a2d));import a30_0x1270ff from'chalk';function a30_0x4b58(){const _0x287c71=['Triggering\x20journey\x20workflow...','options','journey:version:create','✔\x20Pulled\x20','⚠️\x20','activation_','yellow','Resolving\x20journey...','no_parent','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x0aChanges\x20to\x20\x27','dryRun','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','journey:pull','Resolved\x20YAML\x20file:\x20','\x20=\x20','getJourney','resolveJourneyId','repeat','add','activationParams','conversion','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','verbose','session','45UsTXBv','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','all','parentSegment','Pause\x20a\x20running\x20journey','versionNumber','Show\x20journey\x20table\x20column\x20mapping','Error:\x20Parent\x20segment\x20context\x20required','261336PDFeRu','Fetching\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','red','journey:pause','\x20\x20←\x20','parent_segment','length','goalSize','\x20journeys','Pausing\x20journey...','rootFolderId','goal','paused','Resuming\x20journey...','journey',',\x20version:\x20','journey:versions','exitOrJumpRate','7HLOIOm','folders','(draft)','\x22\x20paused','createdAt','\x20(rule\x20match)','.journey.yml','executeDryRun','\x20\x20Target:\x20','has','connection\x20','cyan','150985BxPENX','journey:run','Creating\x20new\x20version...','\x20->\x20','\x20[runs\x20on\x20refresh]','259070EHNaZP','Paused:','green','stringify','none','connection','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','Journey\x20name:\x20','listActivationsFlat','\x20\x20Name:\x20','scheduleType','state','relativePath','map','Resolving\x20parent\x20segment...','includeStats','format','localeCompare','web','filePath','links','\x20versions)','tsv','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','(running)','renderStats','test','args','rule','\x22\x20resumed','json','\x20Journey\x20workflow\x20started','journey:columns','getSegment','/app/ps/','(completed)','Warning:\x20Could\x20not\x20resolve\x20activation\x20','segments','error','793536lwwkhY','\x20\x20-\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','columns','listVersions','diff','message','Parent\x20segment:\x20','Show\x20journey\x20statistics','resolveSegment','journey:resume','segment','✔\x20Journey\x20\x22','\x20(ID:\x20','No\x20statistics\x20available\x20for\x20journey:\x20','launched','resolveParentId','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journeyName','user','limit','buildIdToEmailMap','✔\x20Context\x20set:\x20','\x20files?','connectionId','stages','log','Folder\x20path:\x20','journey:list','site','Target\x20file:\x20','absolutePath','getStatistics','from','yes','Error:\x20Invalid\x20version\x20number:\x20','table','Error:\x20Journey\x20not\x20found:\x20','folderId','segmentPushCommand','Fetching\x20journey\x20','exitOrJumpSize','find','1018312TLotzT','toLowerCase','data','Getting\x20journey\x20details...','pause','View\x20a\x20specific\x20version\x20of\x20a\x20journey','ID:','updatedAt','List\x20activations\x20for\x20a\x20journey','\x20unchanged\x20files','Table:\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Session:','base','State:','sort','split','INVALID_ARGUMENT','Getting\x20column\x20mapping...','resume','journeyBundleId','Stages:','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','filter','description','size','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyStages','\x20Created\x20v','values','listJourneysWithFolders','milestoneSize','type','parentName','kind','segmentName','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','connector_config','✔\x20All\x20files\x20are\x20up\x20to\x20date','📁\x20','Fetching\x20parent\x20segment...','no\x20connection','name','Fetching\x20journeys\x20and\x20folders...','journey:activations','includeHistory','helpText','isNew','...','\x5c$&','(paused)','history','Trigger\x20on-demand\x20journey\x20workflow\x20execution','stageNameMap','977750YBeKri','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','push','get','join','Cancelled','cwd','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x20(draft)\x20—\x20\x22','(none)','attributes','draft','nodes','runAt','getParentFull','getColumnMapping','bold','(root)','tdx.json','\x20version','journeyBundleName','Error:\x20','\x20Opening\x20','entries','hasPeriod','\x0aError:','1226304kMyHDV','then','Target\x20directory:\x20','runAfterJourneyRefresh','replace','createVersion','(unnamed)','completionRate','audienceId','Getting\x20journey\x20statistics...','Journey:','utf-8','Database:\x20','Listing\x20journeys...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20version...','blue','status','\x20\x20Preserving\x20local\x20segment\x20name:\x20','/e/','enteredSize','(archived)','\x0aPull\x20summary:','\x20journey\x20files\x20to\x20','hasChanges','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20\x20Statistics\x20not\x20available','✔\x20Found\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','database','archived','Input:\x20','/j/da','setPhase','Export\x20journey(s)\x20as\x20YAML\x20files','/j/da/je','\x20\x20Consolidating\x20duplicate\x20segment:\x20','pausedAt','journeyId','\x20\x20Folder\x20path:\x20','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','Available\x20stages:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20--version\x20option\x20is\x20required','\x27\x20not\x20found\x20in\x20','jsonl','Activations:','dim','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','List\x20all\x20versions\x20of\x20a\x20journey','Found\x20','journey:view','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','relative','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Fetching\x20users\x20and\x20connections...','set','Parent\x20segment\x20ID:','version','execute','Pattern:\x20'];a30_0x4b58=function(){return _0x287c71;};return a30_0x4b58();}import a30_0x211b33 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(_0x313c7c){const _0x1a7fd1=a30_0x434a;return!_0x313c7c&&(console[_0x1a7fd1(0x15e)](_0x1a7fd1(0xfe)),console['error']('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x313c7c;}function withJsonFormat(_0x481681){const _0x56c5d3=a30_0x434a;if(!_0x481681[_0x56c5d3(0x147)]&&!_0x481681[_0x56c5d3(0x156)]&&!_0x481681['jsonl']&&!_0x481681[_0x56c5d3(0x14d)])return{..._0x481681,'format':_0x56c5d3(0x156),'json':!![]};return _0x481681;}function formatJourneyState(_0x315573){const _0x3ade4f=a30_0x434a;switch(_0x315573){case _0x3ade4f(0x16e):return a30_0x1270ff['green'](_0x3ade4f(0x150));case _0x3ade4f(0xa4):return a30_0x1270ff['dim'](_0x3ade4f(0x128));case _0x3ade4f(0x120):return a30_0x1270ff[_0x3ade4f(0xf8)](_0x3ade4f(0x93));case'completed':return a30_0x1270ff[_0x3ade4f(0xc3)](_0x3ade4f(0x15b));case _0x3ade4f(0xd3):return a30_0x1270ff[_0x3ade4f(0xe4)](_0x3ade4f(0xc8));default:return'('+_0x315573+')';}}function formatJourneyItem(_0x2a5967,_0x47fe3b='',_0x451e53){const _0x510980=a30_0x434a,_0x499d47=formatJourneyState(_0x2a5967[_0x510980(0x142)]),_0xfbf3c2=_0x451e53?hyperlink(_0x2a5967[_0x510980(0xad)],_0x451e53):_0x2a5967['journeyBundleName'];return _0x47fe3b+'🗺️\x20'+_0xfbf3c2+'\x20'+_0x499d47;}function escapeRegex(_0x5d4c1f){const _0xe1c0e6=a30_0x434a;return _0x5d4c1f[_0xe1c0e6(0xb7)](/[.*+?^${}()|[\]\\]/g,_0xe1c0e6(0x92));}function globToRegex(_0x5e768e){const _0x2b109a=a30_0x434a,_0x4f5467=_0x5e768e[_0x2b109a(0x19a)]('*')[_0x2b109a(0x144)](escapeRegex);return new RegExp(_0x4f5467[_0x2b109a(0x9d)]('.*'),'i');}function buildRuleToNameMapping(_0x1f5dfe){const _0x35e3a4=a30_0x434a,_0x46f94f=new Map();if(_0x1f5dfe[_0x35e3a4(0x15d)])for(const [_0x364480,_0x4df9e9]of Object['entries'](_0x1f5dfe[_0x35e3a4(0x15d)])){if(_0x4df9e9[_0x35e3a4(0x154)]){const _0x3a85fb=serializeRule(_0x4df9e9[_0x35e3a4(0x154)]),_0x1a5471=_0x46f94f[_0x35e3a4(0x9c)](_0x3a85fb);_0x1a5471?_0x1a5471[_0x35e3a4(0x9b)](_0x364480):_0x46f94f[_0x35e3a4(0xed)](_0x3a85fb,[_0x364480]);}}return _0x46f94f;}async function resolveJourneyIdFromInput(_0x41b4d1,_0x22285a,_0x47c65f){const _0x5d0702=a30_0x434a,_0x25a852=await resolveJourneyTarget(_0x41b4d1,_0x22285a[_0x5d0702(0x10e)],_0x22285a[_0x5d0702(0x109)]),_0x20ca54=_0x25a852[_0x5d0702(0x10e)];if(!_0x20ca54)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5d0702(0xc1));const _0x5c01b1=await withSpinner(_0x5d0702(0x145),()=>_0x47c65f[_0x5d0702(0x16a)][_0x5d0702(0x16f)](_0x20ca54),{'verbose':_0x22285a[_0x5d0702(0x109)]}),_0x2ce45b=_0x5c01b1[_0x5d0702(0x18c)],_0x590c5a=await withSpinner(_0x5d0702(0xf9),()=>_0x47c65f['journey'][_0x5d0702(0x103)](_0x2ce45b,_0x25a852[_0x5d0702(0x171)]),{'verbose':_0x22285a['verbose']});return{'journeyId':_0x590c5a['data'],'journeyName':_0x25a852[_0x5d0702(0x171)],'parentSegmentId':_0x2ce45b};}async function resolveJourneyTarget(_0x7d25d2,_0x5ebcb8,_0x2dea31){const _0x3af3f6=a30_0x434a;if(isYamlFilePath(_0x7d25d2))try{const _0x446032=await resolveYamlFilePath(_0x7d25d2);return _0x2dea31&&(console[_0x3af3f6(0x15e)](_0x3af3f6(0x100)+_0x7d25d2),console[_0x3af3f6(0x15e)]('\x20\x20Parent\x20segment:\x20'+_0x446032[_0x3af3f6(0x10e)]),console[_0x3af3f6(0x15e)](_0x3af3f6(0x140)+_0x446032['segmentName']),console[_0x3af3f6(0x15e)](_0x3af3f6(0xdc)+(_0x446032['folderPath']||_0x3af3f6(0xaa)))),{'journeyName':_0x446032[_0x3af3f6(0x84)],'parentSegment':_0x446032[_0x3af3f6(0x10e)],'resolved':_0x446032};}catch(_0x176178){throw new SDKError(ErrorCode[_0x3af3f6(0x19b)],_0x3af3f6(0x14f)+_0x176178[_0x3af3f6(0x165)]);}if(!_0x5ebcb8)throw new SDKError(ErrorCode[_0x3af3f6(0x19b)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x7d25d2,'parentSegment':_0x5ebcb8};}export class JourneyListCommand extends BaseCommand{[a30_0x1c81ec(0x8b)]=a30_0x1c81ec(0x17b);[a30_0x1c81ec(0x1a2)]='List\x20journeys\x20in\x20current\x20context';async[a30_0x1c81ec(0xf0)](_0x3b9079){const _0x49c132=a30_0x1c81ec,{options:_0x23b150,args:_0x1de4ff,tdx:_0x3452f8}=_0x3b9079,_0x18cc53=_0x1de4ff[0x0],_0x225293=_0x23b150[_0x49c132(0x10e)];if(!_0x225293)return console[_0x49c132(0x15e)](_0x49c132(0x112)),console[_0x49c132(0x15e)](_0x49c132(0x14e)),0x1;const _0x306c98=await withSpinner(_0x49c132(0x145),()=>_0x3452f8[_0x49c132(0x16a)][_0x49c132(0x16f)](_0x225293),{'verbose':_0x23b150[_0x49c132(0x109)]}),_0x9f468e=_0x306c98[_0x49c132(0x18c)];_0x23b150[_0x49c132(0x109)]&&(console['error'](_0x49c132(0x166)+_0x225293+_0x49c132(0x16c)+_0x9f468e+')'),_0x18cc53&&console[_0x49c132(0x15e)](_0x49c132(0xf1)+_0x18cc53));const _0x57fd1d=await withSpinner(_0x49c132(0x89),()=>_0x3452f8[_0x49c132(0x16a)][_0x49c132(0xa7)](_0x9f468e),{'verbose':_0x23b150[_0x49c132(0x109)]}),_0x33a37d=_0x57fd1d[_0x49c132(0x18c)],_0x42464a=_0x33a37d[_0x49c132(0x11e)],_0x657ef6=await withSpinner(_0x49c132(0xc0),()=>_0x3452f8[_0x49c132(0x122)][_0x49c132(0x7f)](_0x9f468e,_0x42464a),{'verbose':_0x23b150[_0x49c132(0x109)]});let _0x190967=_0x657ef6[_0x49c132(0x18c)]['journeys'];const _0x1b454d=_0x657ef6[_0x49c132(0x18c)][_0x49c132(0x127)],_0x301fa2=new Map();for(const _0x2d9598 of _0x1b454d){_0x301fa2[_0x49c132(0xed)](_0x2d9598['id'],_0x2d9598[_0x49c132(0x8b)]);}if(_0x18cc53){const _0x8d4179=globToRegex(_0x18cc53);_0x190967=_0x190967['filter'](_0x141206=>_0x8d4179[_0x49c132(0x152)](_0x141206[_0x49c132(0xad)]));}console[_0x49c132(0x15e)](_0x49c132(0xcf)+_0x190967['length']+'\x20journey'+(_0x190967['length']!==0x1?'s':''));const _0x24206f=_0x34074c=>{const _0x48b59a=_0x49c132;return getConsoleNextUrl(_0x23b150[_0x48b59a(0x17c)],_0x48b59a(0x15a)+_0x9f468e+_0x48b59a(0xc6)+_0x34074c+_0x48b59a(0xd5));};if(_0x23b150['format']===_0x49c132(0x183))await handleSDKOutput(_0x190967,_0x23b150);else{if(_0x23b150[_0x49c132(0x147)]===_0x49c132(0x156)){const _0x2c38c6=_0x190967[_0x49c132(0x144)](_0x4261ef=>({..._0x4261ef,'url':_0x24206f(_0x4261ef['id'])}));await handleSDKOutput(_0x2c38c6,_0x23b150);}else{console[_0x49c132(0x179)]('['+_0x225293+']');const _0x44d8f1=new Map(),_0x3442cb=[];for(const _0x3f8a1d of _0x190967){if(!_0x3f8a1d[_0x49c132(0x185)]||_0x3f8a1d[_0x49c132(0x185)]===_0x42464a)_0x3442cb[_0x49c132(0x9b)](_0x3f8a1d);else{const _0x21d06d=_0x44d8f1[_0x49c132(0x9c)](_0x3f8a1d['folderId'])||[];_0x21d06d[_0x49c132(0x9b)](_0x3f8a1d),_0x44d8f1[_0x49c132(0xed)](_0x3f8a1d[_0x49c132(0x185)],_0x21d06d);}}const _0x4a57ed=(_0x23c369,_0x4d46eb)=>_0x23c369[_0x49c132(0xad)][_0x49c132(0x148)](_0x4d46eb[_0x49c132(0xad)],undefined,{'sensitivity':'base'});_0x3442cb[_0x49c132(0x199)](_0x4a57ed);for(const _0x15f9a2 of _0x3442cb){console[_0x49c132(0x179)](formatJourneyItem(_0x15f9a2,'',_0x24206f(_0x15f9a2['id'])));}const _0x1d5143=[..._0x44d8f1[_0x49c132(0xb0)]()][_0x49c132(0x199)]((_0x343230,_0xea952c)=>{const _0x3f3c33=_0x49c132,_0x49e73d=_0x301fa2[_0x3f3c33(0x9c)](_0x343230[0x0])||_0x343230[0x0],_0x1de858=_0x301fa2[_0x3f3c33(0x9c)](_0xea952c[0x0])||_0xea952c[0x0];return _0x49e73d[_0x3f3c33(0x148)](_0x1de858,undefined,{'sensitivity':_0x3f3c33(0x197)});});for(const [_0x2f1193,_0x1e6ad8]of _0x1d5143){const _0x57aeae=_0x301fa2['get'](_0x2f1193)||_0x2f1193;console['log'](_0x49c132(0x88)+_0x57aeae),_0x1e6ad8[_0x49c132(0x199)](_0x4a57ed);for(const _0x11620e of _0x1e6ad8){console[_0x49c132(0x179)](formatJourneyItem(_0x11620e,'\x20\x20',_0x24206f(_0x11620e['id'])));}}}}return 0x0;}}function a30_0x434a(_0x3906da,_0x39bcc4){_0x3906da=_0x3906da-0x7d;const _0x4b5867=a30_0x4b58();let _0x434a9f=_0x4b5867[_0x3906da];return _0x434a9f;}export class JourneyViewCommand extends BaseCommand{[a30_0x1c81ec(0x8b)]=a30_0x1c81ec(0xe8);[a30_0x1c81ec(0x1a2)]='Show\x20journey\x20details';async[a30_0x1c81ec(0xf0)](_0x40347c){const _0x2ed7d8=a30_0x1c81ec,{options:_0x4bba42,args:_0x4a02b5,tdx:_0x231b00}=_0x40347c,_0x3f6029=_0x4a02b5[0x0];if(!_0x3f6029)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x2ed7d8(0x15e)](_0x2ed7d8(0x195)),console[_0x2ed7d8(0x15e)]('Options:'),console[_0x2ed7d8(0x15e)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x4bba42[_0x2ed7d8(0x109)]&&console[_0x2ed7d8(0x15e)](_0x2ed7d8(0xd4)+_0x3f6029);const {journeyId:_0x4deaad,parentSegmentId:_0x5c4c8a}=await resolveJourneyIdFromInput(_0x3f6029,_0x4bba42,_0x231b00);if(_0x4bba42[_0x2ed7d8(0x149)]){const _0x881e61=getConsoleNextUrl(_0x4bba42['site'],_0x2ed7d8(0x15a)+_0x5c4c8a+_0x2ed7d8(0xc6)+_0x4deaad+'/j/da/je');return console['error'](a30_0x1270ff[_0x2ed7d8(0x139)]('✔')+_0x2ed7d8(0xaf)+a30_0x1270ff['cyan'](_0x881e61)),openBrowser(_0x881e61),0x0;}const _0x55294e=await withSpinner(_0x2ed7d8(0x18d),()=>_0x231b00[_0x2ed7d8(0x122)]['getJourney'](_0x4deaad),{'verbose':_0x4bba42['verbose']}),_0x1c0cb3=_0x55294e[_0x2ed7d8(0x18c)],_0x101c2e=_0x4bba42[_0x2ed7d8(0x146)];let _0x5b8246;if(_0x101c2e)try{const _0x384dae=await withSpinner(_0x2ed7d8(0xbc),()=>_0x231b00[_0x2ed7d8(0x122)]['getStatistics'](_0x4deaad),{'verbose':_0x4bba42[_0x2ed7d8(0x109)]});_0x5b8246=_0x384dae[_0x2ed7d8(0x18c)];}catch{_0x4bba42['verbose']&&console[_0x2ed7d8(0x15e)](_0x2ed7d8(0xce));}const _0x145315=getConsoleNextUrl(_0x4bba42[_0x2ed7d8(0x17c)],_0x2ed7d8(0x15a)+_0x5c4c8a+_0x2ed7d8(0xc6)+_0x4deaad+_0x2ed7d8(0xd8)),_0x587818={'id':_0x1c0cb3['id'],'name':_0x1c0cb3[_0x2ed7d8(0xa3)][_0x2ed7d8(0x8b)],'description':_0x1c0cb3[_0x2ed7d8(0xa3)][_0x2ed7d8(0x1a2)],'state':_0x1c0cb3[_0x2ed7d8(0xa3)][_0x2ed7d8(0x142)],'paused':_0x1c0cb3['attributes'][_0x2ed7d8(0x120)],'reentry_mode':_0x1c0cb3[_0x2ed7d8(0xa3)]['reentryMode'],'stages':_0x1c0cb3['attributes'][_0x2ed7d8(0x1a5)]?.[_0x2ed7d8(0x11a)]||0x0,..._0x1c0cb3[_0x2ed7d8(0xa3)][_0x2ed7d8(0x11f)]&&{'goal':_0x1c0cb3[_0x2ed7d8(0xa3)]['goal']['name']},..._0x5b8246&&{'statistics':{'size':_0x5b8246[_0x2ed7d8(0x1a3)],'entered':_0x5b8246[_0x2ed7d8(0xc7)],'goal_achieved':_0x5b8246[_0x2ed7d8(0x11b)],'completion_rate':_0x5b8246[_0x2ed7d8(0xba)],'exit_or_jump':_0x5b8246[_0x2ed7d8(0x188)],'exit_or_jump_rate':_0x5b8246[_0x2ed7d8(0x125)],'stages':_0x5b8246[_0x2ed7d8(0x178)]}},'url':_0x145315};return await handleSingleObjectOutput(_0x587818,_0x4bba42),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a30_0x1c81ec(0x8b)]='journey:stats';[a30_0x1c81ec(0x1a2)]=a30_0x1c81ec(0x167);async[a30_0x1c81ec(0xf0)](_0x229c5a){const _0x259a64=a30_0x1c81ec,{options:_0x24013d,args:_0x142e34,tdx:_0x5e5927}=_0x229c5a,_0x887694=_0x142e34[0x0];if(!requireNameOrPath(_0x887694))return 0x1;_0x24013d[_0x259a64(0x109)]&&console['error']('Input:\x20'+_0x887694);const _0x1220d8=_0x24013d,_0x4ee9cd=_0x1220d8[_0x259a64(0x180)],_0x65880a=_0x1220d8['to'],_0x23dfff=_0x1220d8[_0x259a64(0x8e)],_0x2c4bea=_0x1220d8['stage'];_0x23dfff&&!_0x4ee9cd&&!_0x65880a&&console['error'](_0x259a64(0xcd));const _0x534e2d=_0x23dfff?withJsonFormat(_0x24013d):_0x24013d,{journeyId:_0x336d1c,journeyName:_0x5d1d01}=await resolveJourneyIdFromInput(_0x887694,_0x534e2d,_0x5e5927),_0x4a52ef=_0x4ee9cd||_0x65880a?{'from':_0x4ee9cd,'to':_0x65880a}:undefined,_0x44c102=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x259a64(0x10d)]([_0x5e5927[_0x259a64(0x122)][_0x259a64(0x102)](_0x336d1c),_0x5e5927[_0x259a64(0x122)][_0x259a64(0x17f)](_0x336d1c,_0x4a52ef)]),{'verbose':_0x534e2d[_0x259a64(0x109)]}),[_0x55f73f,_0x50471c]=_0x44c102[_0x259a64(0x18c)];if(!_0x50471c||_0x50471c[_0x259a64(0xdb)]===null)return console['error'](_0x259a64(0x16d)+_0x5d1d01),console[_0x259a64(0x15e)](_0x259a64(0x108)),0x0;const _0x5adc3b=buildStageNameMap(_0x55f73f),_0x51e738=!!(_0x4a52ef&&_0x50471c[_0x259a64(0x94)]?.[_0x259a64(0x11a)]),_0x3232d9={'stageNameMap':_0x5adc3b,'hasPeriod':_0x51e738,'includeHistory':!!_0x23dfff};if(_0x2c4bea&&_0x50471c[_0x259a64(0x178)]){const _0x16518e=_0x50471c['stages']['find'](_0x304ad1=>{const _0x45e186=_0x259a64,_0x1f6460=_0x5adc3b[_0x45e186(0x9c)](_0x304ad1['id'])??'';return _0x1f6460[_0x45e186(0x18b)]()===_0x2c4bea[_0x45e186(0x18b)]();});if(_0x16518e)return await handleSingleObjectOutput(formatStageStats(_0x16518e,_0x3232d9),_0x534e2d),0x0;const _0x4d17df=_0x50471c[_0x259a64(0x178)][_0x259a64(0x144)](_0x5c265b=>_0x5adc3b[_0x259a64(0x9c)](_0x5c265b['id'])??_0x5c265b['id']);return console[_0x259a64(0x15e)]('Error:\x20Stage\x20\x22'+_0x2c4bea+'\x22\x20not\x20found'),console[_0x259a64(0x15e)](_0x259a64(0xde)+_0x4d17df[_0x259a64(0x9d)](',\x20')),0x1;}const _0x47fb09=_0x50471c[_0x259a64(0x178)]?.[_0x259a64(0x144)](_0x48b9ae=>formatStageStats(_0x48b9ae,_0x3232d9)),_0x98e6d1=assembleJourneyStats(_0x50471c,{'from':_0x4ee9cd,'to':_0x65880a,'includeHistory':_0x23dfff});return await this[_0x259a64(0x151)](_0x98e6d1,_0x47fb09??[],_0x534e2d),0x0;}async[a30_0x1c81ec(0x151)](_0x2d7eaa,_0x191d10,_0x2c9d1f){const _0x3869f2=a30_0x1c81ec,_0x15de6f=_0x2c9d1f[_0x3869f2(0x147)]==='json'||_0x2c9d1f[_0x3869f2(0x147)]===_0x3869f2(0xe2)||_0x2c9d1f[_0x3869f2(0x156)]||_0x2c9d1f[_0x3869f2(0xe2)];if(_0x15de6f){_0x2d7eaa[_0x3869f2(0x178)]=_0x191d10,await handleSingleObjectOutput(_0x2d7eaa,_0x2c9d1f);return;}await handleSingleObjectOutput(_0x2d7eaa,_0x2c9d1f);for(const _0x3ecad5 of _0x191d10){console[_0x3869f2(0x179)](''),console[_0x3869f2(0x179)](String(a30_0x1270ff['cyan'][_0x3869f2(0xa9)]('['+_0x3ecad5[_0x3869f2(0x8b)]+']'))+a30_0x1270ff[_0x3869f2(0xe4)]('\x20'+_0x3ecad5['id']));const {id:_0x34a1bf,name:_0x51691e,..._0x5f3038}=_0x3ecad5;await handleSingleObjectOutput(_0x5f3038,_0x2c9d1f);}}}export class JourneyTrafficCommand extends BaseCommand{[a30_0x1c81ec(0x8b)]='journey:traffic';['description']=a30_0x1c81ec(0x115);async['execute'](_0x14c1c4){const _0x5b07a6=a30_0x1c81ec,{options:_0x25061e,args:_0x2a2fee,tdx:_0x201ef9}=_0x14c1c4,_0x52fcb7=_0x2a2fee[0x0];if(!requireNameOrPath(_0x52fcb7))return 0x1;_0x25061e[_0x5b07a6(0x109)]&&console['error'](_0x5b07a6(0xd4)+_0x52fcb7);const _0xa75ea5=_0x25061e,_0x4f06a9=_0xa75ea5[_0x5b07a6(0x81)],_0x5a7bf1=_0xa75ea5['from'],_0x30aae0=_0xa75ea5['to'],_0x2a6adb=_0xa75ea5[_0x5b07a6(0x173)];if(_0x4f06a9&&_0x4f06a9!==_0x5b07a6(0x107)&&_0x4f06a9!=='activation')return console[_0x5b07a6(0x15e)]('Error:\x20Invalid\x20--type\x20\x22'+_0x4f06a9+_0x5b07a6(0x10c)),0x1;const _0x4d31a0=withJsonFormat(_0x25061e),{journeyId:_0x533de9,journeyName:_0x111b8d}=await resolveJourneyIdFromInput(_0x52fcb7,_0x4d31a0,_0x201ef9),_0x4067c9={'type':_0x4f06a9,'from':_0x5a7bf1,'to':_0x30aae0,'limit':_0x2a6adb},_0x5e97a1=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x201ef9[_0x5b07a6(0x122)]['getTrafficData'](_0x533de9,_0x4067c9),{'verbose':_0x4d31a0[_0x5b07a6(0x109)]}),_0x291ad6=_0x5e97a1[_0x5b07a6(0x18c)],_0x304b1c=_0x291ad6[_0x5b07a6(0x107)]&&(_0x291ad6['conversion'][_0x5b07a6(0xa5)][_0x5b07a6(0x11a)]>0x0||_0x291ad6[_0x5b07a6(0x107)][_0x5b07a6(0x14b)][_0x5b07a6(0x11a)]>0x0),_0x592faf=_0x291ad6['activation']&&_0x291ad6['activation'][_0x5b07a6(0x11a)]>0x0;if(!_0x304b1c&&!_0x592faf)return console['error'](_0x5b07a6(0x85)+_0x111b8d),console[_0x5b07a6(0x15e)](_0x5b07a6(0x1a4)),_0x5a7bf1&&_0x30aae0&&console[_0x5b07a6(0x15e)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x291ad6,_0x4d31a0),0x0;}}function formatStageStats(_0x372849,_0x3e8f61){const _0x4b471a=a30_0x1c81ec,_0x29cb70=_0x3e8f61[_0x4b471a(0xb1)]&&_0x372849['history']?.[_0x4b471a(0x11a)]?aggregateStageHistory(_0x372849[_0x4b471a(0x94)]):{'size':_0x372849[_0x4b471a(0x1a3)],'entered':_0x372849[_0x4b471a(0xc7)],'milestone':_0x372849[_0x4b471a(0x80)],'milestone_rate':_0x372849['completeMilestoneRate'],'exit_or_jump':_0x372849[_0x4b471a(0x188)],'exit_or_jump_rate':_0x372849[_0x4b471a(0x125)]},_0x482ffe={'id':_0x372849['id'],'name':_0x3e8f61[_0x4b471a(0x96)][_0x4b471a(0x9c)](_0x372849['id'])??_0x372849['id'],..._0x29cb70};return _0x3e8f61[_0x4b471a(0xb1)]&&_0x3e8f61['includeHistory']&&_0x372849[_0x4b471a(0x94)]&&(_0x482ffe[_0x4b471a(0x94)]=_0x372849[_0x4b471a(0x94)]),_0x482ffe;}export class JourneyPauseCommand extends BaseCommand{['name']=a30_0x1c81ec(0x117);[a30_0x1c81ec(0x1a2)]=a30_0x1c81ec(0x10f);async[a30_0x1c81ec(0xf0)](_0x192b8c){const _0x22a676=a30_0x1c81ec,{options:_0x58cfa2,args:_0x4bb5a1,tdx:_0x5ba01e}=_0x192b8c,_0x29df99=_0x4bb5a1[0x0];if(!requireNameOrPath(_0x29df99))return 0x1;_0x58cfa2[_0x22a676(0x109)]&&console[_0x22a676(0x15e)](_0x22a676(0xd4)+_0x29df99);const {journeyId:_0x1d4ad6,journeyName:_0x1384e4}=await resolveJourneyIdFromInput(_0x29df99,_0x58cfa2,_0x5ba01e);if(!_0x58cfa2['yes']){const _0x193397=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x1384e4+'\x22?');if(!_0x193397)return console[_0x22a676(0x15e)]('Cancelled'),0x0;}const _0xbec97=await withSpinner(_0x22a676(0x11d),()=>_0x5ba01e[_0x22a676(0x122)][_0x22a676(0x18e)](_0x1d4ad6),{'verbose':_0x58cfa2['verbose']}),_0x54fef3=_0xbec97[_0x22a676(0x18c)];return console['error']('✔\x20Journey\x20\x22'+_0x54fef3[_0x22a676(0xa3)][_0x22a676(0x8b)]+_0x22a676(0x129)),0x0;}}export class JourneyRunCommand extends BaseCommand{['name']=a30_0x1c81ec(0x133);[a30_0x1c81ec(0x1a2)]=a30_0x1c81ec(0x95);async['execute'](_0x18b14a){const _0x2047cd=a30_0x1c81ec,{options:_0xaa3d62,args:_0x8f52f,tdx:_0x4c89f9}=_0x18b14a,_0x1f621c=_0x8f52f[0x0];if(!requireNameOrPath(_0x1f621c))return 0x1;_0xaa3d62['verbose']&&console[_0x2047cd(0x15e)](_0x2047cd(0xd4)+_0x1f621c);const {journeyId:_0x491cc0,journeyName:_0xc70eac}=await resolveJourneyIdFromInput(_0x1f621c,_0xaa3d62,_0x4c89f9);if(_0xaa3d62[_0x2047cd(0xfd)])return await this[_0x2047cd(0x12d)](_0x18b14a,_0x491cc0,_0xc70eac);if(!_0xaa3d62[_0x2047cd(0x181)]){const _0x53c7d0=await confirm('Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22'+_0xc70eac+'\x22?');if(!_0x53c7d0)return console[_0x2047cd(0x15e)]('Cancelled'),0x0;}const _0x5c02af=await withSpinner(_0x2047cd(0xf2),()=>_0x4c89f9[_0x2047cd(0x122)]['run'](_0x491cc0),{'verbose':_0xaa3d62[_0x2047cd(0x109)]}),_0x1460ed=_0x5c02af[_0x2047cd(0x18c)],_0x227103=getWorkflowSessionUrl(_0xaa3d62[_0x2047cd(0x17c)],_0x1460ed['workflowId'],_0x1460ed['workflowSessionId']);return console[_0x2047cd(0x15e)]('\x0a'+a30_0x1270ff[_0x2047cd(0x139)]('✔')+_0x2047cd(0x157)),console[_0x2047cd(0x15e)]('\x20\x20'+a30_0x1270ff[_0x2047cd(0xe4)](_0x2047cd(0xbd))+'\x20'+_0xc70eac),console[_0x2047cd(0x15e)]('\x20\x20'+a30_0x1270ff[_0x2047cd(0xe4)]('Status:')+'\x20'+_0x1460ed[_0x2047cd(0xc4)]),console[_0x2047cd(0x15e)]('\x20\x20'+a30_0x1270ff[_0x2047cd(0xe4)](_0x2047cd(0x196))+'\x20'+_0x1460ed['workflowSessionId']),console[_0x2047cd(0x15e)]('\x20\x20'+_0x227103),0x0;}async[a30_0x1c81ec(0x12d)](_0x117009,_0x25426c,_0x2b9b4b){const _0x49da46=a30_0x1c81ec,{options:_0x5d3f0a,tdx:_0x37bd3f}=_0x117009,_0x13373e=await withSpinner('Fetching\x20journey\x20'+_0x2b9b4b+_0x49da46(0x91),()=>Promise[_0x49da46(0x10d)]([_0x37bd3f['journey'][_0x49da46(0x102)](_0x25426c),_0x37bd3f[_0x49da46(0x122)]['listActivationsFlat'](_0x25426c)]),{'verbose':_0x5d3f0a[_0x49da46(0x109)]}),[_0x426e48,_0x5dd745]=_0x13373e[_0x49da46(0x18c)],_0xf72c6b=_0x426e48[_0x49da46(0xa3)],_0xab3567=_0xf72c6b['journeyStages'];console[_0x49da46(0x179)](a30_0x1270ff['bold']('Journey:'),_0xf72c6b[_0x49da46(0x8b)]),console['log'](a30_0x1270ff[_0x49da46(0xa9)](_0x49da46(0x190)),_0x426e48['id']),console[_0x49da46(0x179)](a30_0x1270ff[_0x49da46(0xa9)](_0x49da46(0x198)),_0xf72c6b['state']),console[_0x49da46(0x179)](a30_0x1270ff['bold'](_0x49da46(0x138)),_0xf72c6b['paused']?a30_0x1270ff['yellow']('yes'):a30_0x1270ff[_0x49da46(0x139)]('no')),console[_0x49da46(0x179)](a30_0x1270ff[_0x49da46(0xa9)](_0x49da46(0xee)),_0xf72c6b[_0x49da46(0xbb)]);const _0x297f60=_0xab3567[_0x49da46(0x11a)]>0x0?'\x20('+_0xab3567[_0x49da46(0x144)](_0x538e94=>_0x538e94[_0x49da46(0x8b)])[_0x49da46(0x9d)](',\x20')+')':'';console[_0x49da46(0x179)](a30_0x1270ff[_0x49da46(0xa9)](_0x49da46(0x19f)),''+_0xab3567[_0x49da46(0x11a)]+_0x297f60),console[_0x49da46(0x179)]('');if(_0x5dd745[_0x49da46(0x11a)]===0x0)console[_0x49da46(0x179)](a30_0x1270ff[_0x49da46(0xa9)]('Activations:'),a30_0x1270ff[_0x49da46(0xe4)](_0x49da46(0xa2)));else{console[_0x49da46(0x179)](a30_0x1270ff[_0x49da46(0xa9)]('Activations:'));for(const _0x54c384 of _0x5dd745){const _0x25ec9b=_0x54c384[_0x49da46(0x8b)]??_0x49da46(0xb9),_0x367453=_0x54c384[_0x49da46(0x177)]!=null?'connection\x20'+_0x54c384[_0x49da46(0x177)]:_0x49da46(0x8a),_0x21ab8b=_0x54c384[_0x49da46(0x141)]?''+_0x54c384[_0x49da46(0x141)]+(_0x54c384[_0x49da46(0xa6)]?'\x20@\x20'+_0x54c384['runAt']:''):'none',_0x1a680e=_0x54c384[_0x49da46(0xb6)]?_0x49da46(0x136):'';console[_0x49da46(0x179)]('\x20\x20'+a30_0x1270ff[_0x49da46(0xf8)]('⚠️\x20')+'\x20'+_0x25ec9b+_0x49da46(0x118)+_0x367453+',\x20schedule:\x20'+_0x21ab8b+_0x1a680e);}}return console['log'](a30_0x1270ff['yellow'](_0x49da46(0xdd))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a30_0x1c81ec(0x8b)]=a30_0x1c81ec(0x169);[a30_0x1c81ec(0x1a2)]='Resume\x20a\x20paused\x20journey';async[a30_0x1c81ec(0xf0)](_0x2b2a20){const _0x1fe343=a30_0x1c81ec,{options:_0x4f017d,args:_0x190e9,tdx:_0xa0a03}=_0x2b2a20,_0x21f314=_0x190e9[0x0];if(!requireNameOrPath(_0x21f314))return 0x1;_0x4f017d[_0x1fe343(0x109)]&&console[_0x1fe343(0x15e)](_0x1fe343(0xd4)+_0x21f314);const {journeyId:_0x37bfca,journeyName:_0x2c59b4}=await resolveJourneyIdFromInput(_0x21f314,_0x4f017d,_0xa0a03);if(_0x4f017d[_0x1fe343(0xfd)])return await this[_0x1fe343(0x12d)](_0x2b2a20,_0x37bfca,_0x2c59b4);if(!_0x4f017d[_0x1fe343(0x181)]){const _0x22fd77=await confirm(_0x1fe343(0x99)+_0x2c59b4+'\x22?');if(!_0x22fd77)return console[_0x1fe343(0x15e)](_0x1fe343(0x9e)),0x0;}const _0x494fb7=await withSpinner(_0x1fe343(0x121),()=>_0xa0a03['journey'][_0x1fe343(0x19d)](_0x37bfca),{'verbose':_0x4f017d[_0x1fe343(0x109)]}),_0x2793eb=_0x494fb7['data'];return console[_0x1fe343(0x15e)](_0x1fe343(0x16b)+_0x2793eb[_0x1fe343(0xa3)][_0x1fe343(0x8b)]+_0x1fe343(0x155)),0x0;}async[a30_0x1c81ec(0x12d)](_0x2f1adb,_0x5e7e76,_0x58206e){const _0x5d54bd=a30_0x1c81ec,{options:_0x54a5f5,tdx:_0x3e84db}=_0x2f1adb,_0x5143d0=await withSpinner(_0x5d54bd(0x187)+_0x58206e+'...',()=>Promise[_0x5d54bd(0x10d)]([_0x3e84db[_0x5d54bd(0x122)][_0x5d54bd(0x102)](_0x5e7e76),_0x3e84db[_0x5d54bd(0x122)][_0x5d54bd(0x13f)](_0x5e7e76)]),{'verbose':_0x54a5f5[_0x5d54bd(0x109)]}),[_0x14d3d7,_0xf4a49b]=_0x5143d0[_0x5d54bd(0x18c)],_0x3d78f0=_0x14d3d7[_0x5d54bd(0xa3)],_0x4d2a4e=_0x3d78f0['journeyStages'];console['log'](a30_0x1270ff[_0x5d54bd(0xa9)]('Journey:'),_0x3d78f0[_0x5d54bd(0x8b)]),console[_0x5d54bd(0x179)](a30_0x1270ff[_0x5d54bd(0xa9)](_0x5d54bd(0x190)),_0x14d3d7['id']),console['log'](a30_0x1270ff[_0x5d54bd(0xa9)](_0x5d54bd(0x198)),_0x3d78f0[_0x5d54bd(0x142)]),console[_0x5d54bd(0x179)](a30_0x1270ff[_0x5d54bd(0xa9)](_0x5d54bd(0x138)),_0x3d78f0[_0x5d54bd(0x120)]?a30_0x1270ff[_0x5d54bd(0xf8)](_0x5d54bd(0x181)):a30_0x1270ff[_0x5d54bd(0x139)]('no'));_0x3d78f0['pausedAt']&&console[_0x5d54bd(0x179)](a30_0x1270ff[_0x5d54bd(0xa9)]('Paused\x20at:'),_0x3d78f0[_0x5d54bd(0xda)]);console[_0x5d54bd(0x179)](a30_0x1270ff[_0x5d54bd(0xa9)](_0x5d54bd(0xee)),_0x3d78f0[_0x5d54bd(0xbb)]);const _0x20a876=_0x4d2a4e[_0x5d54bd(0x11a)]>0x0?'\x20('+_0x4d2a4e['map'](_0x7a4ae=>_0x7a4ae[_0x5d54bd(0x8b)])[_0x5d54bd(0x9d)](',\x20')+')':'';console['log'](a30_0x1270ff[_0x5d54bd(0xa9)]('Stages:'),''+_0x4d2a4e[_0x5d54bd(0x11a)]+_0x20a876),console[_0x5d54bd(0x179)]('');if(_0xf4a49b[_0x5d54bd(0x11a)]===0x0)console['log'](a30_0x1270ff[_0x5d54bd(0xa9)](_0x5d54bd(0xe3)),a30_0x1270ff[_0x5d54bd(0xe4)](_0x5d54bd(0xa2)));else{console[_0x5d54bd(0x179)](a30_0x1270ff[_0x5d54bd(0xa9)](_0x5d54bd(0xe3)));for(const _0x3764d5 of _0xf4a49b){const _0x307efd=_0x3764d5['name']??_0x5d54bd(0xb9),_0x517ad9=_0x3764d5[_0x5d54bd(0x177)]!=null?_0x5d54bd(0x130)+_0x3764d5[_0x5d54bd(0x177)]:_0x5d54bd(0x8a),_0xdc4779=_0x3764d5['scheduleType']?''+_0x3764d5[_0x5d54bd(0x141)]+(_0x3764d5[_0x5d54bd(0xa6)]?'\x20@\x20'+_0x3764d5[_0x5d54bd(0xa6)]:''):_0x5d54bd(0x13b),_0x5c62da=_0x3764d5[_0x5d54bd(0xb6)]?'\x20[runs\x20on\x20refresh]':'';console[_0x5d54bd(0x179)]('\x20\x20'+a30_0x1270ff[_0x5d54bd(0xf8)](_0x5d54bd(0xf6))+'\x20'+_0x307efd+'\x20\x20←\x20'+_0x517ad9+',\x20schedule:\x20'+_0xdc4779+_0x5c62da);}}return console['log'](a30_0x1270ff[_0x5d54bd(0xf8)](_0x5d54bd(0x13d))),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a30_0x1c81ec(0xff);[a30_0x1c81ec(0x1a2)]=a30_0x1c81ec(0xd7);async[a30_0x1c81ec(0xf0)](_0x3d00be){const _0x35d8d7=a30_0x1c81ec,{options:_0x2f1d37,args:_0x4de348,tdx:_0x27abc7}=_0x3d00be,_0x441581=_0x2f1d37,_0x53592c=_0x4de348[0x0],_0x1e36bb=_0x53592c&&isYamlFilePath(_0x53592c),_0x509c6c=await resolveTarget({'arg':_0x1e36bb?_0x53592c:undefined,'contextParent':_0x2f1d37[_0x35d8d7(0x10e)],'cwd':process[_0x35d8d7(0x9f)]()});if(!isSuccessfulResolution(_0x509c6c))return _0x509c6c['errorCode']===_0x35d8d7(0xfa)?(console['error'](a30_0x1270ff[_0x35d8d7(0xf8)](_0x35d8d7(0xe9))),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[_0x35d8d7(0x15e)](_0x35d8d7(0xd1)),console[_0x35d8d7(0x15e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x35d8d7(0x15e)](_0x35d8d7(0xdf))):(console[_0x35d8d7(0x15e)](a30_0x1270ff[_0x35d8d7(0x116)](_0x35d8d7(0xae)+_0x509c6c[_0x35d8d7(0x165)]+'\x0a')),_0x509c6c[_0x35d8d7(0x8f)]&&console['error'](a30_0x1270ff[_0x35d8d7(0x131)](_0x509c6c['helpText']))),0x1;let _0x12480b=_0x1e36bb?undefined:_0x53592c,_0x30c763,_0x45ffe0;_0x509c6c['type']==='file'&&(_0x12480b=_0x509c6c['resourceName'],_0x30c763=_0x509c6c[_0x35d8d7(0x14a)],_0x45ffe0=_0x509c6c['folderPath']);const _0x2cbc23=_0x509c6c[_0x35d8d7(0x82)],_0x18f02b=_0x509c6c['targetDir'];_0x441581[_0x35d8d7(0x109)]&&(console[_0x35d8d7(0x15e)](_0x35d8d7(0x166)+_0x2cbc23),console[_0x35d8d7(0x15e)](_0x35d8d7(0xb5)+_0x18f02b),_0x12480b&&console['error'](_0x35d8d7(0x13e)+_0x12480b),_0x30c763&&console[_0x35d8d7(0x15e)](_0x35d8d7(0x17d)+_0x30c763),_0x45ffe0&&console[_0x35d8d7(0x15e)](_0x35d8d7(0x17a)+_0x45ffe0));const _0x6baa0b=await withSpinner(_0x35d8d7(0x145),()=>_0x27abc7[_0x35d8d7(0x16a)]['resolveParentId'](_0x2cbc23),{'verbose':_0x2f1d37['verbose']}),_0x2f9bfe=_0x6baa0b[_0x35d8d7(0x18c)],{journeys:_0x103f29,folders:_0x33ab15}=await withSpinner(_0x35d8d7(0x8c),async()=>{const _0xe5caab=_0x35d8d7,[_0x577e0a,_0x31d975]=await Promise[_0xe5caab(0x10d)]([_0x27abc7[_0xe5caab(0x122)]['listJourneysFromParentSegment'](_0x2f9bfe,undefined,{'includeAllVersions':!![]}),_0x27abc7[_0xe5caab(0x16a)]['listFolders'](_0x2f9bfe)]);return{'journeys':_0x577e0a,'folders':_0x31d975};},{'verbose':_0x2f1d37['verbose']})[_0x35d8d7(0xb4)](_0x266e26=>_0x266e26[_0x35d8d7(0x18c)]);let _0x4e556d=_0x103f29;const _0x2140b6=buildFolderIdToPathMap(_0x33ab15);if(_0x12480b){const _0x49dcef=_0x4e556d['filter'](_0x4887dd=>_0x4887dd['journeyBundleName']['toLowerCase']()===_0x12480b[_0x35d8d7(0x18b)]());if(_0x49dcef[_0x35d8d7(0x11a)]===0x0)return console[_0x35d8d7(0x15e)](_0x35d8d7(0x184)+_0x12480b),console[_0x35d8d7(0x15e)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x4e556d=_0x49dcef;}if(_0x45ffe0!==undefined){const _0x3947d2=_0x4e556d[_0x35d8d7(0x1a1)](_0x5d95df=>{const _0x358da0=_0x35d8d7,_0x5bc986=_0x5d95df[_0x358da0(0x185)]?_0x2140b6[_0x358da0(0x9c)](_0x5d95df['folderId'])||'':'';return _0x5bc986===_0x45ffe0;});if(_0x3947d2[_0x35d8d7(0x11a)]===0x0&&_0x4e556d[_0x35d8d7(0x11a)]>0x0){console[_0x35d8d7(0x15e)]('Error:\x20Journey\x20\x27'+_0x12480b+_0x35d8d7(0xe1)+(_0x45ffe0||'root\x20folder')),console[_0x35d8d7(0x15e)](_0x35d8d7(0xe5));for(const _0x38f676 of _0x4e556d){const _0x7a5cd7=_0x38f676[_0x35d8d7(0x185)]?_0x2140b6['get'](_0x38f676[_0x35d8d7(0x185)])||'':'';console[_0x35d8d7(0x15e)](_0x35d8d7(0x160)+(_0x7a5cd7||'(root)')+'/'+_0x38f676[_0x35d8d7(0xad)]);}return 0x1;}_0x4e556d=_0x3947d2;}if(_0x4e556d[_0x35d8d7(0x11a)]===0x0)return console[_0x35d8d7(0x15e)]('No\x20journeys\x20found'),0x0;const _0x47d818=new Map();for(const _0x446904 of _0x4e556d){const _0x268e69=_0x446904[_0x35d8d7(0x19e)];!_0x47d818['has'](_0x268e69)&&_0x47d818[_0x35d8d7(0xed)](_0x268e69,[]),_0x47d818[_0x35d8d7(0x9c)](_0x268e69)[_0x35d8d7(0x9b)](_0x446904);}for(const _0x12353f of _0x47d818[_0x35d8d7(0x7e)]()){_0x12353f['sort']((_0xfe51a7,_0x262b9d)=>(_0xfe51a7[_0x35d8d7(0x110)]||0x0)-(_0x262b9d[_0x35d8d7(0x110)]||0x0));}const _0x51d0ce=[],{idToEmailMap:_0x33e019,connectionIdToNameMap:_0x5b3a53}=await withSpinner(_0x35d8d7(0xec),async()=>{const _0x495bf2=_0x35d8d7,[_0x1aba16,_0xd0b905]=await Promise[_0x495bf2(0x10d)]([_0x27abc7[_0x495bf2(0x172)][_0x495bf2(0x174)](),_0x27abc7[_0x495bf2(0x13c)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x1aba16,'connectionIdToNameMap':_0xd0b905};},{'verbose':_0x2f1d37[_0x35d8d7(0x109)]})[_0x35d8d7(0xb4)](_0x51efbf=>_0x51efbf[_0x35d8d7(0x18c)]);for(const _0xc3dd11 of _0x47d818[_0x35d8d7(0x7e)]()){const _0x38f0e0=_0xc3dd11[0x0][_0x35d8d7(0xad)],_0x1c7907=_0xc3dd11[0x0][_0x35d8d7(0x185)],_0x400ad2=_0x1c7907?_0x2140b6[_0x35d8d7(0x9c)](_0x1c7907)||'':'',_0x25cf6c=_0x400ad2?a30_0x211b33[_0x35d8d7(0x9d)](_0x18f02b,_0x400ad2):_0x18f02b,_0x4e8bf2=_0x30c763||a30_0x211b33[_0x35d8d7(0x9d)](_0x25cf6c,sanitizeFileName(_0x38f0e0)+_0x35d8d7(0x12c));let _0x2d9039,_0x2501d6;if(existsSync(_0x4e8bf2))try{const _0x4d58d6=readFileSync(_0x4e8bf2,_0x35d8d7(0xbe)),_0x366b07=parseYamlString(_0x4d58d6);_0x2501d6=_0x366b07,_0x2d9039=buildRuleToNameMapping(_0x366b07),_0x441581[_0x35d8d7(0x109)]&&_0x2d9039[_0x35d8d7(0x1a3)]>0x0&&console[_0x35d8d7(0x15e)]('Found\x20'+_0x2d9039['size']+_0x35d8d7(0xcc)+_0x38f0e0);}catch(_0x5ac5a4){_0x441581[_0x35d8d7(0x109)]&&console[_0x35d8d7(0x15e)](_0x35d8d7(0xa0)+_0x5ac5a4['message']);}const _0x5f1c13=[],_0x4e5c2c=new Set(),_0x329eec=new Map(),_0x4c17a1=new Map(),_0x51e519=new Set(),_0x164a33=new Map(),_0x55cd11=new Map(),_0x2eaaa1=createJumpTargetCache();await withProgressSpinner(_0x35d8d7(0x114)+_0x38f0e0+_0x35d8d7(0x91),async _0x561ab8=>{const _0x57a260=_0x35d8d7;for(const _0x4ff144 of _0xc3dd11){const _0x21f134=_0xc3dd11[_0x57a260(0x11a)]>0x1?_0x4ff144[_0x57a260(0xad)]+'\x20v'+(_0x4ff144[_0x57a260(0x110)]||0x1):_0x4ff144['journeyBundleName'];_0x561ab8[_0x57a260(0xd6)](_0x57a260(0x114)+_0x21f134);const _0x247086=await _0x27abc7[_0x57a260(0x122)][_0x57a260(0x102)](_0x4ff144['id']),_0x3cee5f=_0x247086[_0x57a260(0xa3)]?.[_0x57a260(0xbb)],_0xd1169e={'resolveSegment':async _0x993550=>{const _0x343a83=_0x57a260;if(!_0x3cee5f)return{'name':_0x993550,'isJourneyLocal':![]};const _0x41059f=_0x329eec[_0x343a83(0x9c)](_0x993550);if(_0x41059f)return _0x41059f;try{const _0x4c9bcb=await _0x27abc7['segment'][_0x343a83(0x159)](_0x3cee5f,_0x993550),_0x20dc40=_0x4c9bcb[_0x343a83(0x83)]===SEGMENT_KIND_JOURNEY;let _0x303370,_0x4b6a18=_0x4c9bcb[_0x343a83(0x8b)];if(_0x20dc40&&_0x4c9bcb[_0x343a83(0x154)]){const _0x4745cf=await segmentResponseToDef(_0x4c9bcb,{'resolveSegmentName':async _0x149dc6=>{const _0x550a8a=_0x343a83,_0x1cd6e6=_0x329eec['get'](_0x149dc6);if(_0x1cd6e6)return _0x1cd6e6[_0x550a8a(0x8b)];const _0x240834=await _0xd1169e[_0x550a8a(0x168)](_0x149dc6);return _0x240834[_0x550a8a(0x8b)];}}),_0x55be06=_0x4745cf[_0x343a83(0x154)];_0x303370={'description':_0x4c9bcb[_0x343a83(0x1a2)],'rule':_0x55be06};const _0x24983e=serializeRule(_0x55be06),_0x437960=_0x4c17a1[_0x343a83(0x9c)](_0x24983e);if(_0x437960)_0x4b6a18=_0x437960,_0x303370=undefined,_0x441581[_0x343a83(0x109)]&&console[_0x343a83(0x15e)](_0x343a83(0xd9)+_0x4c9bcb[_0x343a83(0x8b)]+_0x343a83(0x135)+_0x437960);else{let _0x1a7e55=![];if(_0x2d9039){const _0x4018c0=_0x2d9039[_0x343a83(0x9c)](_0x24983e);if(_0x4018c0){const _0x14c234=_0x4018c0[_0x343a83(0x189)](_0x32e394=>!_0x4e5c2c[_0x343a83(0x12f)](_0x32e394));_0x14c234&&(_0x4b6a18=_0x14c234,_0x4e5c2c[_0x343a83(0x105)](_0x14c234),_0x4c17a1[_0x343a83(0xed)](_0x24983e,_0x14c234),_0x1a7e55=!![],_0x441581[_0x343a83(0x109)]&&console[_0x343a83(0x15e)](_0x343a83(0xc5)+_0x14c234+_0x343a83(0x12b)));}}if(!_0x1a7e55){const _0x3015c3=generateJourneyLocalName(_0x4c9bcb[_0x343a83(0x8b)]);_0x3015c3&&(_0x4b6a18=_0x3015c3);let _0x585d3b=_0x4b6a18,_0x175e5e=0x2;while(_0x4e5c2c[_0x343a83(0x12f)](_0x585d3b)){_0x585d3b=_0x4b6a18+'_'+_0x175e5e,_0x175e5e++;}_0x4e5c2c[_0x343a83(0x105)](_0x585d3b),_0x4c17a1[_0x343a83(0xed)](_0x24983e,_0x585d3b),_0x4b6a18=_0x585d3b;}}}const _0xb5c907={'name':_0x4b6a18,'isJourneyLocal':_0x20dc40,'definition':_0x303370};return _0x329eec[_0x343a83(0xed)](_0x993550,_0xb5c907),_0xb5c907;}catch(_0x14e8da){return _0x2f1d37[_0x343a83(0x109)]&&console[_0x343a83(0x15e)](_0x343a83(0x98)+_0x993550+':\x20'+_0x14e8da[_0x343a83(0x165)]),{'name':_0x993550,'isJourneyLocal':![]};}},'resolveActivation':async _0x3c0b98=>{const _0x3384e1=_0x57a260,_0x3960ac=_0x164a33[_0x3384e1(0x9c)](_0x3c0b98);if(_0x3960ac)return _0x3960ac;try{const _0x37d249=await _0x27abc7[_0x3384e1(0x122)]['getActivation'](_0x4ff144['id'],_0x3c0b98),_0x4617f0=journeyActivationStepToYaml(_0x37d249,_0x33e019,_0x5b3a53),_0x38911a=JSON[_0x3384e1(0x13a)]({'name':_0x4617f0['name'],'connection':_0x4617f0[_0x3384e1(0x13c)],'connector_config':_0x4617f0[_0x3384e1(0x86)]}),_0x2da5ab=_0x55cd11[_0x3384e1(0x9c)](_0x38911a);if(_0x2da5ab){const _0x416ae6={'name':_0x2da5ab,'isJourneyLocal':!![],'definition':_0x4617f0};return _0x164a33['set'](_0x3c0b98,_0x416ae6),_0x416ae6;}const _0x25202e=_0x37d249['attributes'][_0x3384e1(0x106)]['name']||_0x3c0b98,_0x414f37=sanitizeYamlKey(_0x25202e)||_0x3384e1(0xf7)+_0x3c0b98;let _0x29f256=_0x414f37,_0x2e5568=0x2;while(_0x51e519[_0x3384e1(0x12f)](_0x29f256)){_0x29f256=_0x414f37+'_'+_0x2e5568,_0x2e5568++;}_0x51e519['add'](_0x29f256),_0x55cd11[_0x3384e1(0xed)](_0x38911a,_0x29f256);const _0x395b5b={'name':_0x29f256,'isJourneyLocal':!![],'definition':_0x4617f0};return _0x164a33['set'](_0x3c0b98,_0x395b5b),_0x395b5b;}catch(_0x1ce251){return _0x2f1d37['verbose']&&console['error'](_0x3384e1(0x15c)+_0x3c0b98+':\x20'+_0x1ce251[_0x3384e1(0x165)]),{'name':_0x3c0b98,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x376a6d,_0x35db10)=>{const _0x58f9ce=_0x57a260;return resolveJumpTarget(_0x376a6d,_0x35db10,_0x2eaaa1,_0x200dd4=>_0x27abc7[_0x58f9ce(0x122)][_0x58f9ce(0x102)](_0x200dd4));}},_0x452482=await journeyResponseToDef(_0x247086,_0xd1169e);_0x5f1c13['push']({'item':_0x4ff144,'yaml':_0x452482});}},{'verbose':_0x2f1d37[_0x35d8d7(0x109)]});const _0x1f1717=await _0x27abc7[_0x35d8d7(0x122)]['getLatestJourneyId'](_0xc3dd11[0x0][_0x35d8d7(0x19e)]),_0x321cc4=buildMergedJourneyDef(_0x5f1c13,_0x2d9039,_0x1f1717),_0x46b65a=normalizeJourneyDef(_0x321cc4,_0x2501d6),_0x1f6d7a=toYamlString(_0x46b65a),_0x2034a4=_0x30c763||a30_0x211b33['join'](_0x25cf6c,sanitizeFileName(_0x38f0e0)+_0x35d8d7(0x12c));!_0x30c763&&_0x400ad2&&!existsSync(_0x25cf6c)&&mkdirSync(_0x25cf6c,{'recursive':!![]});const _0x189936=a30_0x211b33[_0x35d8d7(0xea)](process[_0x35d8d7(0x9f)](),_0x2034a4);if(existsSync(_0x2034a4)){const _0x4d9fd3=readFileSync(_0x2034a4,_0x35d8d7(0xbe)),_0x5e0950=generateDiff(_0x4d9fd3,_0x1f6d7a),_0x207e1d=hasChanges(_0x5e0950);_0x51d0ce[_0x35d8d7(0x9b)]({'relativePath':_0x189936,'absolutePath':_0x2034a4,'content':_0x1f6d7a,'isNew':![],'hasChanges':_0x207e1d,'diff':_0x207e1d?formatDiffWithColors(_0x5e0950):undefined});}else _0x51d0ce[_0x35d8d7(0x9b)]({'relativePath':_0x189936,'absolutePath':_0x2034a4,'content':_0x1f6d7a,'isNew':!![],'hasChanges':![]});}const _0x3024c9=_0x51d0ce['filter'](_0x44fd72=>_0x44fd72[_0x35d8d7(0x90)]),_0x2d8792=_0x51d0ce['filter'](_0x1931ea=>!_0x1931ea[_0x35d8d7(0x90)]&&_0x1931ea[_0x35d8d7(0xcb)]),_0x415360=_0x51d0ce[_0x35d8d7(0x1a1)](_0x2fdf0e=>!_0x2fdf0e[_0x35d8d7(0x90)]&&!_0x2fdf0e['hasChanges']),_0x570d8e=_0x4e556d['length'],_0x270f67=_0x47d818[_0x35d8d7(0x1a3)],_0x4fc493=_0x570d8e>_0x270f67?'\x20('+_0x570d8e+_0x35d8d7(0x14c):'';console[_0x35d8d7(0x15e)](_0x35d8d7(0xc9)),console['error']('\x20\x20'+a30_0x1270ff[_0x35d8d7(0x131)](_0x270f67+_0x35d8d7(0x11c))+a30_0x1270ff['dim'](_0x4fc493)),console[_0x35d8d7(0x15e)]('\x20\x20'+a30_0x1270ff[_0x35d8d7(0x139)]('+\x20'+_0x3024c9['length']+'\x20new\x20files')),console[_0x35d8d7(0x15e)]('\x20\x20'+a30_0x1270ff[_0x35d8d7(0xf8)]('~\x20'+_0x2d8792[_0x35d8d7(0x11a)]+'\x20changed\x20files')),console[_0x35d8d7(0x15e)]('\x20\x20'+a30_0x1270ff['dim']('=\x20'+_0x415360[_0x35d8d7(0x11a)]+_0x35d8d7(0x193))),console[_0x35d8d7(0x15e)](_0x35d8d7(0x12e)+a30_0x1270ff[_0x35d8d7(0x131)](_0x18f02b)+'\x0a');if(_0x2d8792['length']>0x0)for(const _0x1b8a4f of _0x2d8792){console[_0x35d8d7(0x15e)](_0x35d8d7(0xfc)+_0x1b8a4f[_0x35d8d7(0x143)]+'\x27:'),console[_0x35d8d7(0x15e)]('─'[_0x35d8d7(0x104)](0x3c)),console[_0x35d8d7(0x15e)](_0x1b8a4f[_0x35d8d7(0x164)]),console[_0x35d8d7(0x15e)]('─'[_0x35d8d7(0x104)](0x3c));}if(_0x441581[_0x35d8d7(0xfd)])return console[_0x35d8d7(0x15e)](a30_0x1270ff[_0x35d8d7(0xf8)](_0x35d8d7(0xd0))),0x0;if(_0x3024c9[_0x35d8d7(0x11a)]===0x0&&_0x2d8792[_0x35d8d7(0x11a)]===0x0)return console[_0x35d8d7(0x15e)](a30_0x1270ff[_0x35d8d7(0x139)](_0x35d8d7(0x87))),saveSessionContext({'parent_segment':_0x2cbc23},_0x441581[_0x35d8d7(0x10a)]),console[_0x35d8d7(0x15e)](a30_0x1270ff[_0x35d8d7(0x139)](_0x35d8d7(0x175)+a30_0x1270ff[_0x35d8d7(0xe4)]('parent_segment')+_0x35d8d7(0x101)+a30_0x1270ff[_0x35d8d7(0x131)](_0x2cbc23))),0x0;if(!_0x441581[_0x35d8d7(0x181)]&&(_0x3024c9['length']>0x0||_0x2d8792['length']>0x0)){if(!isInteractive())return console[_0x35d8d7(0x15e)](a30_0x1270ff['red'](_0x35d8d7(0xb2)),_0x35d8d7(0x161)),console[_0x35d8d7(0x15e)](a30_0x1270ff[_0x35d8d7(0xe4)](_0x35d8d7(0xeb))),0x1;const _0x4f1e8d=await confirmKey('Write\x20'+(_0x3024c9[_0x35d8d7(0x11a)]+_0x2d8792['length'])+_0x35d8d7(0x176));if(!_0x4f1e8d)return console[_0x35d8d7(0x15e)](a30_0x1270ff[_0x35d8d7(0xf8)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x18f02b)&&mkdirSync(_0x18f02b,{'recursive':!![]});const _0x33a354=a30_0x211b33[_0x35d8d7(0x9d)](_0x18f02b,_0x35d8d7(0xab));writeFileSync(_0x33a354,createTdxConfigContent(_0x2cbc23),'utf-8');for(const _0x15f4ef of _0x51d0ce){(_0x15f4ef['isNew']||_0x15f4ef['hasChanges'])&&writeFileSync(_0x15f4ef[_0x35d8d7(0x17e)],_0x15f4ef['content'],_0x35d8d7(0xbe));}return console[_0x35d8d7(0x15e)](a30_0x1270ff[_0x35d8d7(0x139)](_0x35d8d7(0xf5)+(_0x3024c9[_0x35d8d7(0x11a)]+_0x2d8792[_0x35d8d7(0x11a)])+_0x35d8d7(0xca)+_0x18f02b)),saveSessionContext({'parent_segment':_0x2cbc23},_0x441581['session']),console[_0x35d8d7(0x15e)](a30_0x1270ff[_0x35d8d7(0x139)](_0x35d8d7(0x175)+a30_0x1270ff[_0x35d8d7(0xe4)](_0x35d8d7(0x119))+'\x20=\x20'+a30_0x1270ff[_0x35d8d7(0x131)](_0x2cbc23))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a30_0x1c81ec(0x8b)]=a30_0x1c81ec(0x158);['description']=a30_0x1c81ec(0x111);async[a30_0x1c81ec(0xf0)](_0x40cdf0){const _0x157998=a30_0x1c81ec,{options:_0x294510,args:_0x4c49cb,tdx:_0x1c9bf7}=_0x40cdf0,_0x3386d4=_0x4c49cb[0x0];if(!requireNameOrPath(_0x3386d4))return 0x1;_0x294510[_0x157998(0x109)]&&console['error'](_0x157998(0xd4)+_0x3386d4);const {journeyId:_0x2b6836}=await resolveJourneyIdFromInput(_0x3386d4,_0x294510,_0x1c9bf7),_0x1790fa=await withSpinner(_0x157998(0x19c),()=>_0x1c9bf7[_0x157998(0x122)][_0x157998(0xa8)](_0x2b6836),{'verbose':_0x294510[_0x157998(0x109)]}),_0x563e67=_0x1790fa[_0x157998(0x18c)];return console[_0x157998(0x179)](_0x157998(0xbf)+_0x563e67[_0x157998(0xd2)]),console[_0x157998(0x179)](_0x157998(0x194)+_0x563e67['table']),await handleSDKOutput(_0x563e67[_0x157998(0x162)],_0x294510),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a30_0x1c81ec(0x8d);[a30_0x1c81ec(0x1a2)]=a30_0x1c81ec(0x192);async[a30_0x1c81ec(0xf0)](_0x3d552a){const _0x35cebf=a30_0x1c81ec,{options:_0x3f86d4,args:_0x14c365,tdx:_0x2eec97}=_0x3d552a,_0x3dc1df=_0x14c365[0x0];if(!requireNameOrPath(_0x3dc1df))return 0x1;_0x3f86d4[_0x35cebf(0x109)]&&console[_0x35cebf(0x15e)](_0x35cebf(0xd4)+_0x3dc1df);const {journeyId:_0x3b6e29}=await resolveJourneyIdFromInput(_0x3dc1df,_0x3f86d4,_0x2eec97),_0x14fbd9=await withSpinner('Listing\x20journey\x20activations...',()=>_0x2eec97['journey'][_0x35cebf(0x13f)](_0x3b6e29),{'verbose':_0x3f86d4['verbose']}),_0x53fea7=_0x14fbd9[_0x35cebf(0x18c)];return console[_0x35cebf(0x15e)](_0x35cebf(0xe7)+_0x53fea7['length']+'\x20activation'+(_0x53fea7['length']!==0x1?'s':'')),await handleSDKOutput(_0x53fea7,_0x3f86d4),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']='journey:push';['description']=a30_0x1c81ec(0x9a);[a30_0x1c81ec(0x186)]=new SegmentPushCommand();async[a30_0x1c81ec(0xf0)](_0x3a6fb4){const _0xb75d08=a30_0x1c81ec,_0x8e739=_0x3a6fb4[_0xb75d08(0x153)][0x0];let _0x2dfae1;if(_0x8e739){const _0x29658f=await resolveTarget({'arg':_0x8e739,'contextParent':_0x3a6fb4['options']['parentSegment'],'cwd':process['cwd']()});isSuccessfulResolution(_0x29658f)&&_0x29658f[_0xb75d08(0x81)]==='file'&&(_0x2dfae1=_0x29658f[_0xb75d08(0x14a)]);}const _0x4caf80={..._0x3a6fb4,'options':{..._0x3a6fb4[_0xb75d08(0xf3)],'journeysOnly':!![],..._0x2dfae1&&{'singleFilePath':_0x2dfae1}}};return this[_0xb75d08(0x186)][_0xb75d08(0xf0)](_0x4caf80);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a30_0x1c81ec(0x124);[a30_0x1c81ec(0x1a2)]=a30_0x1c81ec(0xe6);async[a30_0x1c81ec(0xf0)](_0x50234c){const _0x414ec1=a30_0x1c81ec,{options:_0xc58058,args:_0x555f2d,tdx:_0x221339}=_0x50234c,_0x227db8=_0x555f2d[0x0];if(!requireNameOrPath(_0x227db8))return 0x1;if(_0xc58058['verbose'])console['error']('Input:\x20'+_0x227db8);const {journeyId:_0x485e7b}=await resolveJourneyIdFromInput(_0x227db8,_0xc58058,_0x221339),_0x5646f0=await withSpinner('Listing\x20journey\x20versions...',()=>_0x221339[_0x414ec1(0x122)][_0x414ec1(0x163)](_0x485e7b),{'verbose':_0xc58058['verbose']}),{bundleName:_0x39dadf,versions:_0x150c54,latestJourneyId:_0x258888}=_0x5646f0[_0x414ec1(0x18c)];console[_0x414ec1(0x15e)](_0x39dadf+':\x20'+_0x150c54[_0x414ec1(0x11a)]+_0x414ec1(0xac)+(_0x150c54[_0x414ec1(0x11a)]!==0x1?'s':''));const _0x214ef5=_0x150c54['map'](_0x44e7d2=>({'version':_0x44e7d2['versionNumber'],'journey_id':_0x44e7d2['journeyId'],'name':_0x44e7d2['name'],'state':_0x44e7d2['state'],'paused':_0x44e7d2[_0x414ec1(0x120)],'latest':_0x44e7d2[_0x414ec1(0xdb)]===_0x258888,'created_at':_0x44e7d2[_0x414ec1(0x12a)]}));return await handleSDKOutput(_0x214ef5,_0xc58058),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a30_0x1c81ec(0xf4);[a30_0x1c81ec(0x1a2)]=a30_0x1c81ec(0x1a0);async['execute'](_0x59682e){const _0x344f15=a30_0x1c81ec,{options:_0x3edc03,args:_0x33e1bb,tdx:_0xf8e199}=_0x59682e,_0xc6e905=_0x33e1bb[0x0];if(!requireNameOrPath(_0xc6e905))return 0x1;if(_0x3edc03[_0x344f15(0x109)])console['error'](_0x344f15(0xd4)+_0xc6e905);const {journeyId:_0x2ad0fb,journeyName:_0x10f92d}=await resolveJourneyIdFromInput(_0xc6e905,_0x3edc03,_0xf8e199);if(!_0x3edc03[_0x344f15(0x181)]){const _0x20d644=await confirm(_0x344f15(0xfb)+_0x10f92d+'\x22?');if(!_0x20d644)return console[_0x344f15(0x15e)](_0x344f15(0x9e)),0x0;}const _0x5a221d=await withSpinner(_0x344f15(0x134),()=>_0xf8e199[_0x344f15(0x122)][_0x344f15(0xb8)](_0x2ad0fb),{'verbose':_0x3edc03[_0x344f15(0x109)]}),_0x5f2cfe=_0x5a221d['data'];return console['error'](a30_0x1270ff[_0x344f15(0x139)]('\u2714')+_0x344f15(0x7d)+_0x5f2cfe[_0x344f15(0xa3)][_0x344f15(0x110)]+_0x344f15(0xa1)+_0x5f2cfe[_0x344f15(0xa3)]['name']+'\x22'),console[_0x344f15(0x15e)]('\x20\x20Journey\x20ID:\x20'+_0x5f2cfe['id']),await handleSingleObjectOutput({'id':_0x5f2cfe['id'],'name':_0x5f2cfe['attributes'][_0x344f15(0x8b)],'version':_0x5f2cfe[_0x344f15(0xa3)]['versionNumber'],'state':_0x5f2cfe['attributes'][_0x344f15(0x142)],'bundle_id':_0x5f2cfe[_0x344f15(0xa3)]['journeyBundleId'],'created_at':_0x5f2cfe[_0x344f15(0xa3)][_0x344f15(0x12a)]},_0x3edc03),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a30_0x1c81ec(0x8b)]='journey:version:view';['description']=a30_0x1c81ec(0x18f);async[a30_0x1c81ec(0xf0)](_0x46ce8d){const _0x531bc1=a30_0x1c81ec,{options:_0x133286,args:_0x14bf70,tdx:_0x1355fb}=_0x46ce8d,_0x187ebc=_0x14bf70[0x0];if(!requireNameOrPath(_0x187ebc))return 0x1;const _0x4cdfaa=_0x133286[_0x531bc1(0xef)];if(!_0x4cdfaa)return console[_0x531bc1(0x15e)](_0x531bc1(0xe0)),console['error'](_0x531bc1(0x170)),0x1;const _0x1b83f8=parseInt(_0x4cdfaa,0xa);if(isNaN(_0x1b83f8)||_0x1b83f8<0x1)return console['error'](_0x531bc1(0x182)+_0x4cdfaa),0x1;if(_0x133286[_0x531bc1(0x109)])console[_0x531bc1(0x15e)]('Input:\x20'+_0x187ebc+_0x531bc1(0x123)+_0x1b83f8);const {journeyId:_0xb6ba4c,parentSegmentId:_0xdce58b}=await resolveJourneyIdFromInput(_0x187ebc,_0x133286,_0x1355fb),_0x46bee0=await withSpinner(_0x531bc1(0xc2),()=>_0x1355fb[_0x531bc1(0x122)]['listVersions'](_0xb6ba4c),{'verbose':_0x133286['verbose']}),{versions:_0x48b5fe,latestJourneyId:_0x2ead88}=_0x46bee0[_0x531bc1(0x18c)],_0x8555d8=_0x48b5fe['find'](_0x5a8c83=>_0x5a8c83[_0x531bc1(0x110)]===_0x1b83f8);if(!_0x8555d8){const _0x38a028=_0x48b5fe[_0x531bc1(0x144)](_0x498ec2=>'v'+_0x498ec2[_0x531bc1(0x110)])['join'](',\x20');return console['error']('Error:\x20Version\x20'+_0x1b83f8+'\x20not\x20found.\x20Available:\x20'+_0x38a028),0x1;}const _0x30bd9b=await withSpinner('Getting\x20version\x20'+_0x1b83f8+'\x20details...',()=>_0x1355fb['journey'][_0x531bc1(0x102)](_0x8555d8[_0x531bc1(0xdb)]),{'verbose':_0x133286[_0x531bc1(0x109)]}),_0x18e586=_0x30bd9b[_0x531bc1(0x18c)],_0x309983=getConsoleNextUrl(_0x133286[_0x531bc1(0x17c)],_0x531bc1(0x15a)+_0xdce58b+_0x531bc1(0xc6)+_0x8555d8[_0x531bc1(0xdb)]+_0x531bc1(0xd8));return await handleSingleObjectOutput({'id':_0x18e586['id'],'name':_0x18e586['attributes'][_0x531bc1(0x8b)],'version':_0x18e586[_0x531bc1(0xa3)][_0x531bc1(0x110)],'description':_0x18e586[_0x531bc1(0xa3)][_0x531bc1(0x1a2)],'state':_0x18e586['attributes'][_0x531bc1(0x142)],'paused':_0x18e586[_0x531bc1(0xa3)][_0x531bc1(0x120)],'reentry_mode':_0x18e586['attributes']['reentryMode'],'stages':_0x18e586[_0x531bc1(0xa3)][_0x531bc1(0x1a5)]?.[_0x531bc1(0x11a)]||0x0,..._0x18e586[_0x531bc1(0xa3)]['goal']&&{'goal':_0x18e586[_0x531bc1(0xa3)][_0x531bc1(0x11f)][_0x531bc1(0x8b)]},'latest':_0x8555d8[_0x531bc1(0xdb)]===_0x2ead88,'created_at':_0x18e586[_0x531bc1(0xa3)][_0x531bc1(0x12a)],'updated_at':_0x18e586[_0x531bc1(0xa3)][_0x531bc1(0x191)],'url':_0x309983},_0x133286),0x0;}}
1
+ const a31_0x2594d4=a31_0x4301;function a31_0x3016(){const _0x25f540=['\x20(rule\x20match)','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','🗺️\x20','Listing\x20journey\x20activations...','/e/','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','completionRate','completed','Journey\x20name:\x20','journey','\x27\x20not\x20found\x20in\x20','resolveSegment','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x0aPull\x20summary:','Error:\x20Invalid\x20version\x20number:\x20','folderPath','📁\x20','\x0aError:','Fetching\x20','root\x20folder','resolveParentId','segments','INVALID_ARGUMENT','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','find','absolutePath','description','Available\x20stages:\x20','\x20details...','execute','setPhase','then','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','workflowId','options','Resolving\x20parent\x20segment...','getParentFull','workflowSessionId','Export\x20journey(s)\x20as\x20YAML\x20files','\x20Opening\x20','user','Warning:\x20Could\x20not\x20resolve\x20segment\x20','cyan','name','exitOrJumpSize','blue','\x20activation','journey:list','columns','\x20version','Show\x20journey\x20statistics','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Pause\x20a\x20running\x20journey','Found\x20','segmentPushCommand','goalSize','status','(paused)','\x5c$&','journey:pause','journey:traffic','draft','\x20@\x20','utf-8','⚠️\x20','conversion','no\x20connection','exitOrJumpRate','journeyStages','\x20files?','state','5014614bWfNUy','buildIdToNameMap','milestoneSize','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','args','List\x20all\x20versions\x20of\x20a\x20journey','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x22\x20paused','segmentName','Listing\x20journeys...','\x20\x20-\x20','journeyBundleName','getTrafficData','versionNumber','map','goal','getLatestJourneyId','resourceName','size','red','renderStats','Resolved\x20YAML\x20file:\x20','connection','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20','Target\x20directory:\x20','458989YEaSci','has','launched','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Input:\x20','(unnamed)','9DbyfcU','Target\x20file:\x20','Fetching\x20journey\x20','runAt','error','message','filter','run','Table:\x20','scheduleType','journeyName','/app/ps/','.journey.yml','\x20\x20Folder\x20path:\x20','audienceId','relativePath','limit','\x20journey','Parent\x20segment:\x20','✔\x20Context\x20set:\x20','dim','(running)','test','paused','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x20=\x20','green','listVersions','✔\x20Found\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','session','Folder\x20path:\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','rule','16088570izoCkr','activation_','toLowerCase','getJourney','/j/da/je','4knxNPO','folderId','Listing\x20journey\x20versions...','pausedAt','Getting\x20journey\x20statistics...','listJourneysFromParentSegment','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Error:\x20Version\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Show\x20journey\x20details','11309160PtRGmY','add','diff','Error:\x20Stage\x20\x22','Triggering\x20journey\x20workflow...','Write\x20','\x22\x20resumed','journey:push','2cYifRU','journey:pull','journey:columns','site','join','Fetching\x20journeys\x20and\x20folders...','createdAt','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Resolving\x20journey...','segment','Journey:','log','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','-\x20no\x20files\x20written','enteredSize','journey:versions','sort','stage','Aborted.','(draft)','attributes','tdx.json','set','verbose','Error:\x20Parent\x20segment\x20context\x20required','updatedAt','resume','Stages:','/j/da','file','yes','connectionId','get','Show\x20journey\x20table\x20column\x20mapping','format','ID:','6848004pzywPU','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','dryRun','\x20\x20Preserving\x20local\x20segment\x20name:\x20','yellow','executeDryRun','getColumnMapping','connection\x20','content','Paused:','reentryMode','rootFolderId',',\x20schedule:\x20','cwd','(none)','\x20\x20Name:\x20','Getting\x20journey\x20traffic\x20data...','✔\x20Journey\x20\x22','entries','stages','getSegment','buildIdToEmailMap','\x20\x20←\x20','Fetching\x20users\x20and\x20connections...','kind','helpText','no_parent','Error:\x20Journey\x20not\x20found:\x20','push','\x20journeys','List\x20journeys\x20in\x20current\x20context','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','json','listJourneysWithFolders','parentName','hasChanges','includeHistory','data','stringify','Resume\x20a\x20paused\x20journey','version','folders','activation','journey:resume','all','\x20\x20Parent\x20segment:\x20','journey:stats','Resuming\x20journey...','\x20changed\x20files','length','base',',\x20version:\x20','parent_segment','Pausing\x20journey...','isNew','jsonl','journeyId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','localeCompare','Options:','links','journeyBundleId','State:','hasPeriod','parentSegment','Getting\x20journey\x20details...','type','\x20not\x20found.\x20Available:\x20','\x20versions)','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)','filePath','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','history','\x20\x20Journey\x20ID:\x20','\x0aChanges\x20to\x20\x27','2435120EdXvkP','createVersion','(root)','11lOeDva','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','(completed)','...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','listActivationsFlat','474eCzOXZ','\x20Created\x20v','pause','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','runAfterJourneyRefresh','\x20journey\x20files\x20to\x20','Error:\x20Journey\x20\x27','completeMilestoneRate','No\x20journeys\x20found','Activations:','database','✔\x20All\x20files\x20are\x20up\x20to\x20date','connector_config','none','journey:activations','\x20unchanged\x20files','Error:\x20--version\x20option\x20is\x20required','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','getStatistics','archived','table','bold','Cancelled','nodes','75929mpMOcg','values','split','from','repeat'];a31_0x3016=function(){return _0x25f540;};return a31_0x3016();}(function(_0x27cbdf,_0x365ffb){const _0x49c6f1=a31_0x4301,_0x1a2be2=_0x27cbdf();while(!![]){try{const _0x10fe4f=parseInt(_0x49c6f1(0x2bd))/0x1*(parseInt(_0x49c6f1(0x2fd))/0x2)+-parseInt(_0x49c6f1(0x2a3))/0x3*(parseInt(_0x49c6f1(0x2ea))/0x4)+parseInt(_0x49c6f1(0x236))/0x5+-parseInt(_0x49c6f1(0x23f))/0x6*(-parseInt(_0x49c6f1(0x257))/0x7)+parseInt(_0x49c6f1(0x2f5))/0x8*(-parseInt(_0x49c6f1(0x2c3))/0x9)+parseInt(_0x49c6f1(0x2e5))/0xa+parseInt(_0x49c6f1(0x239))/0xb*(parseInt(_0x49c6f1(0x1eb))/0xc);if(_0x10fe4f===_0x365ffb)break;else _0x1a2be2['push'](_0x1a2be2['shift']());}catch(_0x5c1ed9){_0x1a2be2['push'](_0x1a2be2['shift']());}}}(a31_0x3016,0xdb0f3));import a31_0xbf56a2 from'chalk';import a31_0x28469a 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 a31_0x4301(_0x4b3ea5,_0x229006){_0x4b3ea5=_0x4b3ea5-0x1d8;const _0x30161e=a31_0x3016();let _0x4301aa=_0x30161e[_0x4b3ea5];return _0x4301aa;}function requireNameOrPath(_0x2a37a0){const _0x128598=a31_0x4301;return!_0x2a37a0&&(console[_0x128598(0x2c7)](_0x128598(0x2db)),console['error']('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x2a37a0;}function withJsonFormat(_0x198d55){const _0xcac120=a31_0x4301;if(!_0x198d55[_0xcac120(0x1e9)]&&!_0x198d55['json']&&!_0x198d55[_0xcac120(0x222)]&&!_0x198d55['tsv'])return{..._0x198d55,'format':'json','json':!![]};return _0x198d55;}function formatJourneyState(_0x58e88b){const _0x1643d6=a31_0x4301;switch(_0x58e88b){case _0x1643d6(0x2bf):return a31_0xbf56a2[_0x1643d6(0x2dd)](_0x1643d6(0x2d8));case _0x1643d6(0x299):return a31_0xbf56a2[_0x1643d6(0x2d7)](_0x1643d6(0x1da));case'paused':return a31_0xbf56a2['yellow'](_0x1643d6(0x295));case _0x1643d6(0x263):return a31_0xbf56a2[_0x1643d6(0x289)](_0x1643d6(0x23b));case _0x1643d6(0x252):return a31_0xbf56a2[_0x1643d6(0x2d7)]('(archived)');default:return'('+_0x58e88b+')';}}function formatJourneyItem(_0x195779,_0x4c5936='',_0x2066d7){const _0x4e3091=a31_0x4301,_0x185fdf=formatJourneyState(_0x195779['state']),_0x6260d5=_0x2066d7?hyperlink(_0x195779['journeyBundleName'],_0x2066d7):_0x195779[_0x4e3091(0x2ae)];return _0x4c5936+_0x4e3091(0x25e)+_0x6260d5+'\x20'+_0x185fdf;}function escapeRegex(_0x48575e){const _0x15b59e=a31_0x4301;return _0x48575e['replace'](/[.*+?^${}()|[\]\\]/g,_0x15b59e(0x296));}function globToRegex(_0x397f3d){const _0x4184c0=a31_0x4301,_0x5b204b=_0x397f3d[_0x4184c0(0x259)]('*')[_0x4184c0(0x2b1)](escapeRegex);return new RegExp(_0x5b204b[_0x4184c0(0x301)]('.*'),'i');}function buildRuleToNameMapping(_0x4cb5ec){const _0x1d8a1c=a31_0x4301,_0x496478=new Map();if(_0x4cb5ec[_0x1d8a1c(0x271)])for(const [_0xd87c8,_0x5eb9fb]of Object[_0x1d8a1c(0x1fd)](_0x4cb5ec['segments'])){if(_0x5eb9fb[_0x1d8a1c(0x2e4)]){const _0x3e757c=serializeRule(_0x5eb9fb[_0x1d8a1c(0x2e4)]),_0x3f437b=_0x496478[_0x1d8a1c(0x1e7)](_0x3e757c);_0x3f437b?_0x3f437b[_0x1d8a1c(0x207)](_0xd87c8):_0x496478[_0x1d8a1c(0x1dd)](_0x3e757c,[_0xd87c8]);}}return _0x496478;}async function resolveJourneyIdFromInput(_0x33bf31,_0x230bb9,_0x351c29){const _0x2c3861=a31_0x4301,_0x481b1c=await resolveJourneyTarget(_0x33bf31,_0x230bb9['parentSegment'],_0x230bb9[_0x2c3861(0x1de)]),_0x317a97=_0x481b1c[_0x2c3861(0x22b)];if(!_0x317a97)throw new SDKError(ErrorCode[_0x2c3861(0x272)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x55d745=await withSpinner(_0x2c3861(0x27f),()=>_0x351c29['segment'][_0x2c3861(0x270)](_0x317a97),{'verbose':_0x230bb9[_0x2c3861(0x1de)]}),_0x5c546f=_0x55d745[_0x2c3861(0x210)],_0x185062=await withSpinner(_0x2c3861(0x305),()=>_0x351c29[_0x2c3861(0x265)]['resolveJourneyId'](_0x5c546f,_0x481b1c[_0x2c3861(0x2cd)]),{'verbose':_0x230bb9[_0x2c3861(0x1de)]});return{'journeyId':_0x185062[_0x2c3861(0x210)],'journeyName':_0x481b1c[_0x2c3861(0x2cd)],'parentSegmentId':_0x5c546f};}async function resolveJourneyTarget(_0x16e833,_0x21748e,_0x1a2e7b){const _0x212386=a31_0x4301;if(isYamlFilePath(_0x16e833))try{const _0x39383c=await resolveYamlFilePath(_0x16e833);return _0x1a2e7b&&(console[_0x212386(0x2c7)](_0x212386(0x2b8)+_0x16e833),console['error'](_0x212386(0x218)+_0x39383c['parentSegment']),console[_0x212386(0x2c7)](_0x212386(0x1fa)+_0x39383c[_0x212386(0x2ab)]),console[_0x212386(0x2c7)](_0x212386(0x2d0)+(_0x39383c[_0x212386(0x26b)]||_0x212386(0x238)))),{'journeyName':_0x39383c[_0x212386(0x2ab)],'parentSegment':_0x39383c[_0x212386(0x22b)],'resolved':_0x39383c};}catch(_0x5ed9a3){throw new SDKError(ErrorCode[_0x212386(0x272)],_0x212386(0x27c)+_0x5ed9a3[_0x212386(0x2c8)]);}if(!_0x21748e)throw new SDKError(ErrorCode[_0x212386(0x272)],_0x212386(0x2c0));return{'journeyName':_0x16e833,'parentSegment':_0x21748e};}export class JourneyListCommand extends BaseCommand{['name']=a31_0x2594d4(0x28b);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x209);async[a31_0x2594d4(0x279)](_0x12a9e6){const _0x449138=a31_0x2594d4,{options:_0x24afa2,args:_0x435c1b,tdx:_0x3b2afa}=_0x12a9e6,_0x7ffe3e=_0x435c1b[0x0],_0xd5a9b4=_0x24afa2[_0x449138(0x22b)];if(!_0xd5a9b4)return console[_0x449138(0x2c7)](_0x449138(0x1df)),console[_0x449138(0x2c7)](_0x449138(0x250)),0x1;const _0x1d03a3=await withSpinner(_0x449138(0x27f),()=>_0x3b2afa[_0x449138(0x306)][_0x449138(0x270)](_0xd5a9b4),{'verbose':_0x24afa2[_0x449138(0x1de)]}),_0x4a3739=_0x1d03a3['data'];_0x24afa2['verbose']&&(console[_0x449138(0x2c7)](_0x449138(0x2d5)+_0xd5a9b4+'\x20(ID:\x20'+_0x4a3739+')'),_0x7ffe3e&&console[_0x449138(0x2c7)]('Pattern:\x20'+_0x7ffe3e));const _0x4a81d3=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x3b2afa['segment'][_0x449138(0x280)](_0x4a3739),{'verbose':_0x24afa2['verbose']}),_0x287b03=_0x4a81d3[_0x449138(0x210)],_0x194308=_0x287b03[_0x449138(0x1f6)],_0x3bcbca=await withSpinner(_0x449138(0x2ac),()=>_0x3b2afa['journey'][_0x449138(0x20c)](_0x4a3739,_0x194308),{'verbose':_0x24afa2[_0x449138(0x1de)]});let _0x1de31c=_0x3bcbca['data']['journeys'];const _0x470793=_0x3bcbca['data'][_0x449138(0x214)],_0x3c9dd0=new Map();for(const _0x49b097 of _0x470793){_0x3c9dd0['set'](_0x49b097['id'],_0x49b097[_0x449138(0x287)]);}if(_0x7ffe3e){const _0x3010b6=globToRegex(_0x7ffe3e);_0x1de31c=_0x1de31c[_0x449138(0x2c9)](_0xdde874=>_0x3010b6[_0x449138(0x2d9)](_0xdde874[_0x449138(0x2ae)]));}console[_0x449138(0x2c7)](_0x449138(0x2df)+_0x1de31c[_0x449138(0x21c)]+_0x449138(0x2d4)+(_0x1de31c[_0x449138(0x21c)]!==0x1?'s':''));const _0x2f5baf=_0x4e415e=>{const _0x19dd09=_0x449138;return getConsoleNextUrl(_0x24afa2[_0x19dd09(0x300)],'/app/ps/'+_0x4a3739+'/e/'+_0x4e415e+_0x19dd09(0x1e3));};if(_0x24afa2['format']===_0x449138(0x253))await handleSDKOutput(_0x1de31c,_0x24afa2);else{if(_0x24afa2[_0x449138(0x1e9)]==='json'){const _0x5d942f=_0x1de31c['map'](_0x132eda=>({..._0x132eda,'url':_0x2f5baf(_0x132eda['id'])}));await handleSDKOutput(_0x5d942f,_0x24afa2);}else{console['log']('['+_0xd5a9b4+']');const _0x3b04ba=new Map(),_0x459cbc=[];for(const _0x140702 of _0x1de31c){if(!_0x140702[_0x449138(0x2eb)]||_0x140702[_0x449138(0x2eb)]===_0x194308)_0x459cbc['push'](_0x140702);else{const _0x1fbfa7=_0x3b04ba[_0x449138(0x1e7)](_0x140702[_0x449138(0x2eb)])||[];_0x1fbfa7[_0x449138(0x207)](_0x140702),_0x3b04ba[_0x449138(0x1dd)](_0x140702[_0x449138(0x2eb)],_0x1fbfa7);}}const _0xe6f00a=(_0x3799a4,_0x5039a2)=>_0x3799a4['journeyBundleName'][_0x449138(0x225)](_0x5039a2[_0x449138(0x2ae)],undefined,{'sensitivity':'base'});_0x459cbc[_0x449138(0x30d)](_0xe6f00a);for(const _0x1eff76 of _0x459cbc){console['log'](formatJourneyItem(_0x1eff76,'',_0x2f5baf(_0x1eff76['id'])));}const _0x15d3e2=[..._0x3b04ba['entries']()][_0x449138(0x30d)]((_0x23d6a4,_0x57bfc1)=>{const _0x126f58=_0x449138,_0x54ba12=_0x3c9dd0[_0x126f58(0x1e7)](_0x23d6a4[0x0])||_0x23d6a4[0x0],_0x486752=_0x3c9dd0['get'](_0x57bfc1[0x0])||_0x57bfc1[0x0];return _0x54ba12['localeCompare'](_0x486752,undefined,{'sensitivity':_0x126f58(0x21d)});});for(const [_0x53a941,_0x4178dd]of _0x15d3e2){const _0x4ad47e=_0x3c9dd0['get'](_0x53a941)||_0x53a941;console['log'](_0x449138(0x26c)+_0x4ad47e),_0x4178dd[_0x449138(0x30d)](_0xe6f00a);for(const _0x3ad692 of _0x4178dd){console[_0x449138(0x308)](formatJourneyItem(_0x3ad692,'\x20\x20',_0x2f5baf(_0x3ad692['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a31_0x2594d4(0x276)]=a31_0x2594d4(0x2f4);async[a31_0x2594d4(0x279)](_0x251069){const _0x198b27=a31_0x2594d4,{options:_0x28de68,args:_0x6375bb,tdx:_0x26f7dc}=_0x251069,_0x25061d=_0x6375bb[0x0];if(!_0x25061d)return console[_0x198b27(0x2c7)](_0x198b27(0x2db)),console['error']('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x198b27(0x2c7)](_0x198b27(0x226)),console['error'](_0x198b27(0x20a)),0x1;_0x28de68[_0x198b27(0x1de)]&&console[_0x198b27(0x2c7)](_0x198b27(0x2c1)+_0x25061d);const {journeyId:_0x2b7f79,parentSegmentId:_0x360f9a}=await resolveJourneyIdFromInput(_0x25061d,_0x28de68,_0x26f7dc);if(_0x28de68['web']){const _0x3235a2=getConsoleNextUrl(_0x28de68[_0x198b27(0x300)],_0x198b27(0x2ce)+_0x360f9a+'/e/'+_0x2b7f79+_0x198b27(0x2e9));return console['error'](a31_0xbf56a2['green']('✔')+_0x198b27(0x283)+a31_0xbf56a2[_0x198b27(0x286)](_0x3235a2)),openBrowser(_0x3235a2),0x0;}const _0x2b9ebc=await withSpinner(_0x198b27(0x22c),()=>_0x26f7dc[_0x198b27(0x265)]['getJourney'](_0x2b7f79),{'verbose':_0x28de68[_0x198b27(0x1de)]}),_0xf45ce3=_0x2b9ebc['data'],_0xffc753=_0x28de68['includeStats'];let _0x3fc6bd;if(_0xffc753)try{const _0x2a5aee=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x26f7dc[_0x198b27(0x265)]['getStatistics'](_0x2b7f79),{'verbose':_0x28de68['verbose']});_0x3fc6bd=_0x2a5aee[_0x198b27(0x210)];}catch{_0x28de68[_0x198b27(0x1de)]&&console[_0x198b27(0x2c7)]('\x20\x20Statistics\x20not\x20available');}const _0x2b23de=getConsoleNextUrl(_0x28de68[_0x198b27(0x300)],_0x198b27(0x2ce)+_0x360f9a+_0x198b27(0x260)+_0x2b7f79+_0x198b27(0x2e9)),_0x5ce28d={'id':_0xf45ce3['id'],'name':_0xf45ce3['attributes'][_0x198b27(0x287)],'description':_0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x276)],'state':_0xf45ce3['attributes']['state'],'paused':_0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x2da)],'reentry_mode':_0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x1f5)],'stages':_0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x2a0)]?.[_0x198b27(0x21c)]||0x0,..._0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x2b2)]&&{'goal':_0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x2b2)]['name']},..._0x3fc6bd&&{'statistics':{'size':_0x3fc6bd['size'],'entered':_0x3fc6bd['enteredSize'],'goal_achieved':_0x3fc6bd[_0x198b27(0x293)],'completion_rate':_0x3fc6bd[_0x198b27(0x262)],'exit_or_jump':_0x3fc6bd[_0x198b27(0x288)],'exit_or_jump_rate':_0x3fc6bd[_0x198b27(0x29f)],'stages':_0x3fc6bd[_0x198b27(0x1fe)]}},'url':_0x2b23de};return await handleSingleObjectOutput(_0x5ce28d,_0x28de68),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x219);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x28e);async['execute'](_0x3c3279){const _0x102b9a=a31_0x2594d4,{options:_0x3c3080,args:_0x4c4ece,tdx:_0xd73c89}=_0x3c3279,_0x174c48=_0x4c4ece[0x0];if(!requireNameOrPath(_0x174c48))return 0x1;_0x3c3080[_0x102b9a(0x1de)]&&console['error']('Input:\x20'+_0x174c48);const _0x3c201e=_0x3c3080,_0x4115ec=_0x3c201e['from'],_0x19266b=_0x3c201e['to'],_0x1f0544=_0x3c201e[_0x102b9a(0x20f)],_0x3bec03=_0x3c201e[_0x102b9a(0x1d8)];_0x1f0544&&!_0x4115ec&&!_0x19266b&&console[_0x102b9a(0x2c7)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x3d5a92=_0x1f0544?withJsonFormat(_0x3c3080):_0x3c3080,{journeyId:_0x3a269e,journeyName:_0x15ca3c}=await resolveJourneyIdFromInput(_0x174c48,_0x3d5a92,_0xd73c89),_0x43962f=_0x4115ec||_0x19266b?{'from':_0x4115ec,'to':_0x19266b}:undefined,_0x5dcf5a=await withSpinner(_0x102b9a(0x2ee),()=>Promise[_0x102b9a(0x217)]([_0xd73c89[_0x102b9a(0x265)]['getJourney'](_0x3a269e),_0xd73c89['journey'][_0x102b9a(0x251)](_0x3a269e,_0x43962f)]),{'verbose':_0x3d5a92['verbose']}),[_0x5e83a4,_0x1018c4]=_0x5dcf5a[_0x102b9a(0x210)];if(!_0x1018c4||_0x1018c4['journeyId']===null)return console[_0x102b9a(0x2c7)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x15ca3c),console[_0x102b9a(0x2c7)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x5b7c0d=buildStageNameMap(_0x5e83a4),_0xc8ae7b=!!(_0x43962f&&_0x1018c4['history']?.[_0x102b9a(0x21c)]),_0x593dbd={'stageNameMap':_0x5b7c0d,'hasPeriod':_0xc8ae7b,'includeHistory':!!_0x1f0544};if(_0x3bec03&&_0x1018c4[_0x102b9a(0x1fe)]){const _0x4fefc5=_0x1018c4[_0x102b9a(0x1fe)][_0x102b9a(0x274)](_0x2e3495=>{const _0x112af6=_0x5b7c0d['get'](_0x2e3495['id'])??'';return _0x112af6['toLowerCase']()===_0x3bec03['toLowerCase']();});if(_0x4fefc5)return await handleSingleObjectOutput(formatStageStats(_0x4fefc5,_0x593dbd),_0x3d5a92),0x0;const _0xfbca7b=_0x1018c4[_0x102b9a(0x1fe)][_0x102b9a(0x2b1)](_0x382d94=>_0x5b7c0d[_0x102b9a(0x1e7)](_0x382d94['id'])??_0x382d94['id']);return console[_0x102b9a(0x2c7)](_0x102b9a(0x2f8)+_0x3bec03+'\x22\x20not\x20found'),console[_0x102b9a(0x2c7)](_0x102b9a(0x277)+_0xfbca7b[_0x102b9a(0x301)](',\x20')),0x1;}const _0x55d051=_0x1018c4[_0x102b9a(0x1fe)]?.[_0x102b9a(0x2b1)](_0x36eb90=>formatStageStats(_0x36eb90,_0x593dbd)),_0x4e826d=assembleJourneyStats(_0x1018c4,{'from':_0x4115ec,'to':_0x19266b,'includeHistory':_0x1f0544});return await this[_0x102b9a(0x2b7)](_0x4e826d,_0x55d051??[],_0x3d5a92),0x0;}async['renderStats'](_0x46d715,_0xabe0dc,_0x7de9c8){const _0x5ddab9=a31_0x2594d4,_0x1f3281=_0x7de9c8[_0x5ddab9(0x1e9)]===_0x5ddab9(0x20b)||_0x7de9c8[_0x5ddab9(0x1e9)]==='jsonl'||_0x7de9c8[_0x5ddab9(0x20b)]||_0x7de9c8[_0x5ddab9(0x222)];if(_0x1f3281){_0x46d715['stages']=_0xabe0dc,await handleSingleObjectOutput(_0x46d715,_0x7de9c8);return;}await handleSingleObjectOutput(_0x46d715,_0x7de9c8);for(const _0x48f3c4 of _0xabe0dc){console['log'](''),console[_0x5ddab9(0x308)](String(a31_0xbf56a2[_0x5ddab9(0x286)]['bold']('['+_0x48f3c4['name']+']'))+a31_0xbf56a2[_0x5ddab9(0x2d7)]('\x20'+_0x48f3c4['id']));const {id:_0x4404f1,name:_0x3111cd,..._0x6c8625}=_0x48f3c4;await handleSingleObjectOutput(_0x6c8625,_0x7de9c8);}}}export class JourneyTrafficCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x298);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x273);async[a31_0x2594d4(0x279)](_0x5d67f1){const _0x41bd4f=a31_0x2594d4,{options:_0x111d20,args:_0x2ca0a1,tdx:_0x33c29c}=_0x5d67f1,_0x1905b3=_0x2ca0a1[0x0];if(!requireNameOrPath(_0x1905b3))return 0x1;_0x111d20['verbose']&&console['error'](_0x41bd4f(0x2c1)+_0x1905b3);const _0x546d24=_0x111d20,_0x18253d=_0x546d24[_0x41bd4f(0x22d)],_0x5d0fcb=_0x546d24[_0x41bd4f(0x25a)],_0x472a59=_0x546d24['to'],_0x33746d=_0x546d24[_0x41bd4f(0x2d3)];if(_0x18253d&&_0x18253d!==_0x41bd4f(0x29d)&&_0x18253d!==_0x41bd4f(0x215))return console[_0x41bd4f(0x2c7)]('Error:\x20Invalid\x20--type\x20\x22'+_0x18253d+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x21d313=withJsonFormat(_0x111d20),{journeyId:_0x4d73cb,journeyName:_0x3f2268}=await resolveJourneyIdFromInput(_0x1905b3,_0x21d313,_0x33c29c),_0x9e779b={'type':_0x18253d,'from':_0x5d0fcb,'to':_0x472a59,'limit':_0x33746d},_0x11ce8a=await withSpinner(_0x41bd4f(0x1fb),()=>_0x33c29c[_0x41bd4f(0x265)][_0x41bd4f(0x2af)](_0x4d73cb,_0x9e779b),{'verbose':_0x21d313[_0x41bd4f(0x1de)]}),_0x4d73f8=_0x11ce8a[_0x41bd4f(0x210)],_0x555eb2=_0x4d73f8[_0x41bd4f(0x29d)]&&(_0x4d73f8[_0x41bd4f(0x29d)][_0x41bd4f(0x256)][_0x41bd4f(0x21c)]>0x0||_0x4d73f8[_0x41bd4f(0x29d)][_0x41bd4f(0x227)][_0x41bd4f(0x21c)]>0x0),_0x4e8666=_0x4d73f8['activation']&&_0x4d73f8['activation'][_0x41bd4f(0x21c)]>0x0;if(!_0x555eb2&&!_0x4e8666)return console[_0x41bd4f(0x2c7)](_0x41bd4f(0x261)+_0x3f2268),console[_0x41bd4f(0x2c7)](_0x41bd4f(0x23a)),_0x5d0fcb&&_0x472a59&&console[_0x41bd4f(0x2c7)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x4d73f8,_0x21d313),0x0;}}function formatStageStats(_0x4c62b3,_0x3db407){const _0x1b0f2a=a31_0x2594d4,_0x2a255c=_0x3db407[_0x1b0f2a(0x22a)]&&_0x4c62b3[_0x1b0f2a(0x233)]?.[_0x1b0f2a(0x21c)]?aggregateStageHistory(_0x4c62b3[_0x1b0f2a(0x233)]):{'size':_0x4c62b3[_0x1b0f2a(0x2b5)],'entered':_0x4c62b3[_0x1b0f2a(0x30b)],'milestone':_0x4c62b3[_0x1b0f2a(0x2a5)],'milestone_rate':_0x4c62b3[_0x1b0f2a(0x246)],'exit_or_jump':_0x4c62b3['exitOrJumpSize'],'exit_or_jump_rate':_0x4c62b3[_0x1b0f2a(0x29f)]},_0x21e674={'id':_0x4c62b3['id'],'name':_0x3db407['stageNameMap'][_0x1b0f2a(0x1e7)](_0x4c62b3['id'])??_0x4c62b3['id'],..._0x2a255c};return _0x3db407[_0x1b0f2a(0x22a)]&&_0x3db407['includeHistory']&&_0x4c62b3['history']&&(_0x21e674[_0x1b0f2a(0x233)]=_0x4c62b3['history']),_0x21e674;}export class JourneyPauseCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x297);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x290);async[a31_0x2594d4(0x279)](_0x1ae706){const _0x1054cb=a31_0x2594d4,{options:_0x18e3b1,args:_0x50dbf1,tdx:_0x4145c3}=_0x1ae706,_0x52cdcf=_0x50dbf1[0x0];if(!requireNameOrPath(_0x52cdcf))return 0x1;_0x18e3b1[_0x1054cb(0x1de)]&&console[_0x1054cb(0x2c7)](_0x1054cb(0x2c1)+_0x52cdcf);const {journeyId:_0xe05ba9,journeyName:_0x453a2a}=await resolveJourneyIdFromInput(_0x52cdcf,_0x18e3b1,_0x4145c3);if(!_0x18e3b1[_0x1054cb(0x1e5)]){const _0x40eeec=await confirm(_0x1054cb(0x2f1)+_0x453a2a+'\x22?');if(!_0x40eeec)return console['error']('Cancelled'),0x0;}const _0x5a1e54=await withSpinner(_0x1054cb(0x220),()=>_0x4145c3[_0x1054cb(0x265)][_0x1054cb(0x241)](_0xe05ba9),{'verbose':_0x18e3b1[_0x1054cb(0x1de)]}),_0x371fb6=_0x5a1e54[_0x1054cb(0x210)];return console[_0x1054cb(0x2c7)]('✔\x20Journey\x20\x22'+_0x371fb6[_0x1054cb(0x1db)]['name']+_0x1054cb(0x2aa)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a31_0x2594d4(0x287)]='journey:run';['description']='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a31_0x2594d4(0x279)](_0x59d950){const _0x5cb6ee=a31_0x2594d4,{options:_0x8e7183,args:_0x1dd963,tdx:_0xe6a8b4}=_0x59d950,_0x2bcb7a=_0x1dd963[0x0];if(!requireNameOrPath(_0x2bcb7a))return 0x1;_0x8e7183['verbose']&&console[_0x5cb6ee(0x2c7)](_0x5cb6ee(0x2c1)+_0x2bcb7a);const {journeyId:_0x4d6791,journeyName:_0x514d8e}=await resolveJourneyIdFromInput(_0x2bcb7a,_0x8e7183,_0xe6a8b4);if(_0x8e7183['dryRun'])return await this[_0x5cb6ee(0x1f0)](_0x59d950,_0x4d6791,_0x514d8e);if(!_0x8e7183['yes']){const _0x2c0c03=await confirm(_0x5cb6ee(0x25d)+_0x514d8e+'\x22?');if(!_0x2c0c03)return console[_0x5cb6ee(0x2c7)](_0x5cb6ee(0x255)),0x0;}const _0x204775=await withSpinner(_0x5cb6ee(0x2f9),()=>_0xe6a8b4[_0x5cb6ee(0x265)][_0x5cb6ee(0x2ca)](_0x4d6791),{'verbose':_0x8e7183[_0x5cb6ee(0x1de)]}),_0x2a5407=_0x204775[_0x5cb6ee(0x210)],_0x37f41d=getWorkflowSessionUrl(_0x8e7183[_0x5cb6ee(0x300)],_0x2a5407[_0x5cb6ee(0x27d)],_0x2a5407[_0x5cb6ee(0x281)]);return console[_0x5cb6ee(0x2c7)]('\x0a'+a31_0xbf56a2[_0x5cb6ee(0x2dd)]('✔')+'\x20Journey\x20workflow\x20started'),console[_0x5cb6ee(0x2c7)]('\x20\x20'+a31_0xbf56a2[_0x5cb6ee(0x2d7)](_0x5cb6ee(0x307))+'\x20'+_0x514d8e),console['error']('\x20\x20'+a31_0xbf56a2[_0x5cb6ee(0x2d7)]('Status:')+'\x20'+_0x2a5407[_0x5cb6ee(0x294)]),console[_0x5cb6ee(0x2c7)]('\x20\x20'+a31_0xbf56a2[_0x5cb6ee(0x2d7)]('Session:')+'\x20'+_0x2a5407[_0x5cb6ee(0x281)]),console[_0x5cb6ee(0x2c7)]('\x20\x20'+_0x37f41d),0x0;}async['executeDryRun'](_0x440a74,_0x196445,_0x4bf367){const _0x28a5f6=a31_0x2594d4,{options:_0x111c63,tdx:_0x38ccca}=_0x440a74,_0x2fbb22=await withSpinner(_0x28a5f6(0x2c5)+_0x4bf367+_0x28a5f6(0x23c),()=>Promise[_0x28a5f6(0x217)]([_0x38ccca['journey'][_0x28a5f6(0x2e8)](_0x196445),_0x38ccca[_0x28a5f6(0x265)][_0x28a5f6(0x23e)](_0x196445)]),{'verbose':_0x111c63['verbose']}),[_0x3eddd9,_0x352df1]=_0x2fbb22[_0x28a5f6(0x210)],_0x5403e9=_0x3eddd9[_0x28a5f6(0x1db)],_0x2d4836=_0x5403e9[_0x28a5f6(0x2a0)];console['log'](a31_0xbf56a2[_0x28a5f6(0x254)]('Journey:'),_0x5403e9[_0x28a5f6(0x287)]),console[_0x28a5f6(0x308)](a31_0xbf56a2[_0x28a5f6(0x254)](_0x28a5f6(0x1ea)),_0x3eddd9['id']),console[_0x28a5f6(0x308)](a31_0xbf56a2[_0x28a5f6(0x254)](_0x28a5f6(0x229)),_0x5403e9['state']),console[_0x28a5f6(0x308)](a31_0xbf56a2['bold'](_0x28a5f6(0x1f4)),_0x5403e9[_0x28a5f6(0x2da)]?a31_0xbf56a2[_0x28a5f6(0x1ef)]('yes'):a31_0xbf56a2[_0x28a5f6(0x2dd)]('no')),console[_0x28a5f6(0x308)](a31_0xbf56a2['bold']('Parent\x20segment\x20ID:'),_0x5403e9[_0x28a5f6(0x2d1)]);const _0x588e9c=_0x2d4836[_0x28a5f6(0x21c)]>0x0?'\x20('+_0x2d4836[_0x28a5f6(0x2b1)](_0x506c28=>_0x506c28[_0x28a5f6(0x287)])[_0x28a5f6(0x301)](',\x20')+')':'';console[_0x28a5f6(0x308)](a31_0xbf56a2[_0x28a5f6(0x254)]('Stages:'),''+_0x2d4836[_0x28a5f6(0x21c)]+_0x588e9c),console[_0x28a5f6(0x308)]('');if(_0x352df1[_0x28a5f6(0x21c)]===0x0)console[_0x28a5f6(0x308)](a31_0xbf56a2[_0x28a5f6(0x254)](_0x28a5f6(0x248)),a31_0xbf56a2[_0x28a5f6(0x2d7)](_0x28a5f6(0x1f9)));else{console['log'](a31_0xbf56a2[_0x28a5f6(0x254)]('Activations:'));for(const _0x2a6a5d of _0x352df1){const _0x5e6b11=_0x2a6a5d[_0x28a5f6(0x287)]??'(unnamed)',_0x4909d0=_0x2a6a5d['connectionId']!=null?'connection\x20'+_0x2a6a5d['connectionId']:_0x28a5f6(0x29e),_0x3cd51b=_0x2a6a5d[_0x28a5f6(0x2cc)]?''+_0x2a6a5d[_0x28a5f6(0x2cc)]+(_0x2a6a5d[_0x28a5f6(0x2c6)]?_0x28a5f6(0x29a)+_0x2a6a5d[_0x28a5f6(0x2c6)]:''):'none',_0x5bb212=_0x2a6a5d[_0x28a5f6(0x243)]?'\x20[runs\x20on\x20refresh]':'';console[_0x28a5f6(0x308)]('\x20\x20'+a31_0xbf56a2[_0x28a5f6(0x1ef)](_0x28a5f6(0x29c))+'\x20'+_0x5e6b11+_0x28a5f6(0x201)+_0x4909d0+_0x28a5f6(0x1f7)+_0x3cd51b+_0x5bb212);}}return console['log'](a31_0xbf56a2[_0x28a5f6(0x1ef)](_0x28a5f6(0x1ec))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x216);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x212);async['execute'](_0x494365){const _0x4827e9=a31_0x2594d4,{options:_0x4f1ecb,args:_0x22dfe9,tdx:_0x32eb22}=_0x494365,_0x58575d=_0x22dfe9[0x0];if(!requireNameOrPath(_0x58575d))return 0x1;_0x4f1ecb[_0x4827e9(0x1de)]&&console['error'](_0x4827e9(0x2c1)+_0x58575d);const {journeyId:_0x53001d,journeyName:_0x24b654}=await resolveJourneyIdFromInput(_0x58575d,_0x4f1ecb,_0x32eb22);if(_0x4f1ecb[_0x4827e9(0x1ed)])return await this[_0x4827e9(0x1f0)](_0x494365,_0x53001d,_0x24b654);if(!_0x4f1ecb[_0x4827e9(0x1e5)]){const _0x3bf777=await confirm(_0x4827e9(0x28f)+_0x24b654+'\x22?');if(!_0x3bf777)return console[_0x4827e9(0x2c7)](_0x4827e9(0x255)),0x0;}const _0x462060=await withSpinner(_0x4827e9(0x21a),()=>_0x32eb22['journey'][_0x4827e9(0x1e1)](_0x53001d),{'verbose':_0x4f1ecb[_0x4827e9(0x1de)]}),_0x9f8a4e=_0x462060[_0x4827e9(0x210)];return console[_0x4827e9(0x2c7)](_0x4827e9(0x1fc)+_0x9f8a4e[_0x4827e9(0x1db)]['name']+_0x4827e9(0x2fb)),0x0;}async[a31_0x2594d4(0x1f0)](_0x4c5a90,_0x3b835e,_0x16a63f){const _0x21194e=a31_0x2594d4,{options:_0xb037b1,tdx:_0x520a3f}=_0x4c5a90,_0x36559d=await withSpinner(_0x21194e(0x2c5)+_0x16a63f+_0x21194e(0x23c),()=>Promise['all']([_0x520a3f['journey'][_0x21194e(0x2e8)](_0x3b835e),_0x520a3f[_0x21194e(0x265)][_0x21194e(0x23e)](_0x3b835e)]),{'verbose':_0xb037b1[_0x21194e(0x1de)]}),[_0x204285,_0x2bb4f3]=_0x36559d[_0x21194e(0x210)],_0x45318c=_0x204285[_0x21194e(0x1db)],_0x263348=_0x45318c[_0x21194e(0x2a0)];console['log'](a31_0xbf56a2[_0x21194e(0x254)]('Journey:'),_0x45318c['name']),console[_0x21194e(0x308)](a31_0xbf56a2[_0x21194e(0x254)](_0x21194e(0x1ea)),_0x204285['id']),console[_0x21194e(0x308)](a31_0xbf56a2[_0x21194e(0x254)](_0x21194e(0x229)),_0x45318c[_0x21194e(0x2a2)]),console[_0x21194e(0x308)](a31_0xbf56a2[_0x21194e(0x254)](_0x21194e(0x1f4)),_0x45318c[_0x21194e(0x2da)]?a31_0xbf56a2['yellow'](_0x21194e(0x1e5)):a31_0xbf56a2[_0x21194e(0x2dd)]('no'));_0x45318c['pausedAt']&&console[_0x21194e(0x308)](a31_0xbf56a2[_0x21194e(0x254)]('Paused\x20at:'),_0x45318c[_0x21194e(0x2ed)]);console[_0x21194e(0x308)](a31_0xbf56a2['bold']('Parent\x20segment\x20ID:'),_0x45318c['audienceId']);const _0x3cabe4=_0x263348[_0x21194e(0x21c)]>0x0?'\x20('+_0x263348[_0x21194e(0x2b1)](_0x508ae7=>_0x508ae7[_0x21194e(0x287)])[_0x21194e(0x301)](',\x20')+')':'';console[_0x21194e(0x308)](a31_0xbf56a2[_0x21194e(0x254)](_0x21194e(0x1e2)),''+_0x263348[_0x21194e(0x21c)]+_0x3cabe4),console[_0x21194e(0x308)]('');if(_0x2bb4f3[_0x21194e(0x21c)]===0x0)console['log'](a31_0xbf56a2[_0x21194e(0x254)](_0x21194e(0x248)),a31_0xbf56a2[_0x21194e(0x2d7)](_0x21194e(0x1f9)));else{console['log'](a31_0xbf56a2['bold'](_0x21194e(0x248)));for(const _0x53d1c8 of _0x2bb4f3){const _0x2ec58c=_0x53d1c8[_0x21194e(0x287)]??_0x21194e(0x2c2),_0x41094b=_0x53d1c8['connectionId']!=null?_0x21194e(0x1f2)+_0x53d1c8[_0x21194e(0x1e6)]:_0x21194e(0x29e),_0x5b1801=_0x53d1c8[_0x21194e(0x2cc)]?''+_0x53d1c8[_0x21194e(0x2cc)]+(_0x53d1c8[_0x21194e(0x2c6)]?'\x20@\x20'+_0x53d1c8[_0x21194e(0x2c6)]:''):_0x21194e(0x24c),_0x3a707b=_0x53d1c8[_0x21194e(0x243)]?'\x20[runs\x20on\x20refresh]':'';console['log']('\x20\x20'+a31_0xbf56a2[_0x21194e(0x1ef)](_0x21194e(0x29c))+'\x20'+_0x2ec58c+_0x21194e(0x201)+_0x41094b+_0x21194e(0x1f7)+_0x5b1801+_0x3a707b);}}return console['log'](a31_0xbf56a2['yellow'](_0x21194e(0x309))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x2fe);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x282);async['execute'](_0xd6abba){const _0x5b28f4=a31_0x2594d4,{options:_0x3fd0ab,args:_0x50bc5d,tdx:_0x29c9c5}=_0xd6abba,_0x290ed8=_0x3fd0ab,_0xa5c89f=_0x50bc5d[0x0],_0x4f3326=_0xa5c89f&&isYamlFilePath(_0xa5c89f),_0x437235=await resolveTarget({'arg':_0x4f3326?_0xa5c89f:undefined,'contextParent':_0x3fd0ab[_0x5b28f4(0x22b)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x437235))return _0x437235['errorCode']===_0x5b28f4(0x205)?(console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x1ef)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x5b28f4(0x2c7)](_0x5b28f4(0x230)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2e3)),console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2a9))):(console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x2b6)](_0x5b28f4(0x2bb)+_0x437235[_0x5b28f4(0x2c8)]+'\x0a')),_0x437235[_0x5b28f4(0x204)]&&console['error'](a31_0xbf56a2['cyan'](_0x437235[_0x5b28f4(0x204)]))),0x1;let _0x4006c9=_0x4f3326?undefined:_0xa5c89f,_0xcc55,_0x242ade;_0x437235[_0x5b28f4(0x22d)]===_0x5b28f4(0x1e4)&&(_0x4006c9=_0x437235[_0x5b28f4(0x2b4)],_0xcc55=_0x437235['filePath'],_0x242ade=_0x437235['folderPath']);const _0x22d50e=_0x437235[_0x5b28f4(0x20d)],_0x371604=_0x437235['targetDir'];_0x290ed8[_0x5b28f4(0x1de)]&&(console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2d5)+_0x22d50e),console['error'](_0x5b28f4(0x2bc)+_0x371604),_0x4006c9&&console[_0x5b28f4(0x2c7)](_0x5b28f4(0x264)+_0x4006c9),_0xcc55&&console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2c4)+_0xcc55),_0x242ade&&console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2e2)+_0x242ade));const _0x1ebd67=await withSpinner(_0x5b28f4(0x27f),()=>_0x29c9c5[_0x5b28f4(0x306)]['resolveParentId'](_0x22d50e),{'verbose':_0x3fd0ab[_0x5b28f4(0x1de)]}),_0x293e14=_0x1ebd67['data'],{journeys:_0x38869b,folders:_0x488a5a}=await withSpinner(_0x5b28f4(0x302),async()=>{const _0x437f4c=_0x5b28f4,[_0x36469e,_0x455a97]=await Promise['all']([_0x29c9c5[_0x437f4c(0x265)][_0x437f4c(0x2ef)](_0x293e14,undefined,{'includeAllVersions':!![]}),_0x29c9c5[_0x437f4c(0x306)]['listFolders'](_0x293e14)]);return{'journeys':_0x36469e,'folders':_0x455a97};},{'verbose':_0x3fd0ab['verbose']})[_0x5b28f4(0x27b)](_0x3da2e8=>_0x3da2e8[_0x5b28f4(0x210)]);let _0x47435c=_0x38869b;const _0x4606c9=buildFolderIdToPathMap(_0x488a5a);if(_0x4006c9){const _0x632334=_0x47435c[_0x5b28f4(0x2c9)](_0x17da97=>_0x17da97['journeyBundleName'][_0x5b28f4(0x2e7)]()===_0x4006c9['toLowerCase']());if(_0x632334['length']===0x0)return console[_0x5b28f4(0x2c7)](_0x5b28f4(0x206)+_0x4006c9),console['error'](_0x5b28f4(0x242)),0x1;_0x47435c=_0x632334;}if(_0x242ade!==undefined){const _0x2f8298=_0x47435c['filter'](_0x5dfea9=>{const _0x4dd6e4=_0x5b28f4,_0x4dba2d=_0x5dfea9[_0x4dd6e4(0x2eb)]?_0x4606c9[_0x4dd6e4(0x1e7)](_0x5dfea9['folderId'])||'':'';return _0x4dba2d===_0x242ade;});if(_0x2f8298[_0x5b28f4(0x21c)]===0x0&&_0x47435c['length']>0x0){console['error'](_0x5b28f4(0x245)+_0x4006c9+_0x5b28f4(0x266)+(_0x242ade||_0x5b28f4(0x26f))),console['error'](_0x5b28f4(0x2ba));for(const _0x1e3cf7 of _0x47435c){const _0xf62a60=_0x1e3cf7[_0x5b28f4(0x2eb)]?_0x4606c9[_0x5b28f4(0x1e7)](_0x1e3cf7[_0x5b28f4(0x2eb)])||'':'';console['error'](_0x5b28f4(0x2ad)+(_0xf62a60||_0x5b28f4(0x238))+'/'+_0x1e3cf7[_0x5b28f4(0x2ae)]);}return 0x1;}_0x47435c=_0x2f8298;}if(_0x47435c[_0x5b28f4(0x21c)]===0x0)return console[_0x5b28f4(0x2c7)](_0x5b28f4(0x247)),0x0;const _0x49021a=new Map();for(const _0x28a789 of _0x47435c){const _0x1e88b9=_0x28a789[_0x5b28f4(0x228)];!_0x49021a[_0x5b28f4(0x2be)](_0x1e88b9)&&_0x49021a['set'](_0x1e88b9,[]),_0x49021a[_0x5b28f4(0x1e7)](_0x1e88b9)[_0x5b28f4(0x207)](_0x28a789);}for(const _0x4a5c7f of _0x49021a[_0x5b28f4(0x258)]()){_0x4a5c7f['sort']((_0x6d3bfc,_0x101171)=>(_0x6d3bfc[_0x5b28f4(0x2b0)]||0x0)-(_0x101171[_0x5b28f4(0x2b0)]||0x0));}const _0x5a53a2=[],{idToEmailMap:_0x19430e,connectionIdToNameMap:_0x10a2f4}=await withSpinner(_0x5b28f4(0x202),async()=>{const _0x550ea0=_0x5b28f4,[_0x260051,_0x365376]=await Promise[_0x550ea0(0x217)]([_0x29c9c5[_0x550ea0(0x284)][_0x550ea0(0x200)](),_0x29c9c5[_0x550ea0(0x2b9)][_0x550ea0(0x2a4)]()]);return{'idToEmailMap':_0x260051,'connectionIdToNameMap':_0x365376};},{'verbose':_0x3fd0ab[_0x5b28f4(0x1de)]})['then'](_0x11c9c8=>_0x11c9c8[_0x5b28f4(0x210)]);for(const _0x4d8890 of _0x49021a[_0x5b28f4(0x258)]()){const _0x137a50=_0x4d8890[0x0][_0x5b28f4(0x2ae)],_0x32c3f8=_0x4d8890[0x0][_0x5b28f4(0x2eb)],_0x424893=_0x32c3f8?_0x4606c9[_0x5b28f4(0x1e7)](_0x32c3f8)||'':'',_0x3f7ff2=_0x424893?a31_0x28469a[_0x5b28f4(0x301)](_0x371604,_0x424893):_0x371604,_0x370522=_0xcc55||a31_0x28469a[_0x5b28f4(0x301)](_0x3f7ff2,sanitizeFileName(_0x137a50)+_0x5b28f4(0x2cf));let _0x50b669,_0x4cd1a5;if(existsSync(_0x370522))try{const _0x2c1a97=readFileSync(_0x370522,'utf-8'),_0x517f91=parseYamlString(_0x2c1a97);_0x4cd1a5=_0x517f91,_0x50b669=buildRuleToNameMapping(_0x517f91),_0x290ed8[_0x5b28f4(0x1de)]&&_0x50b669[_0x5b28f4(0x2b5)]>0x0&&console[_0x5b28f4(0x2c7)](_0x5b28f4(0x291)+_0x50b669[_0x5b28f4(0x2b5)]+_0x5b28f4(0x304)+_0x137a50);}catch(_0x171287){_0x290ed8[_0x5b28f4(0x1de)]&&console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2e0)+_0x171287[_0x5b28f4(0x2c8)]);}const _0x2cb1d2=[],_0x724d95=new Set(),_0x54a949=new Map(),_0xf5f866=new Map(),_0x37a115=new Set(),_0x5ac801=new Map(),_0x497ed7=new Map(),_0x33ccee=createJumpTargetCache();await withProgressSpinner(_0x5b28f4(0x26e)+_0x137a50+_0x5b28f4(0x23c),async _0x1212d4=>{const _0x4c9caa=_0x5b28f4;for(const _0x2705e5 of _0x4d8890){const _0x2669b9=_0x4d8890[_0x4c9caa(0x21c)]>0x1?_0x2705e5[_0x4c9caa(0x2ae)]+'\x20v'+(_0x2705e5[_0x4c9caa(0x2b0)]||0x1):_0x2705e5[_0x4c9caa(0x2ae)];_0x1212d4[_0x4c9caa(0x27a)]('Fetching\x20'+_0x2669b9);const _0x5ad205=await _0x29c9c5[_0x4c9caa(0x265)][_0x4c9caa(0x2e8)](_0x2705e5['id']),_0x3eaf8e=_0x5ad205['attributes']?.['audienceId'],_0x4c95e6={'resolveSegment':async _0x510c73=>{const _0x3b2e47=_0x4c9caa;if(!_0x3eaf8e)return{'name':_0x510c73,'isJourneyLocal':![]};const _0x473e94=_0x54a949['get'](_0x510c73);if(_0x473e94)return _0x473e94;try{const _0x392621=await _0x29c9c5[_0x3b2e47(0x306)][_0x3b2e47(0x1ff)](_0x3eaf8e,_0x510c73),_0x5e41d0=_0x392621[_0x3b2e47(0x203)]===SEGMENT_KIND_JOURNEY;let _0x1d6a87,_0x48c054=_0x392621[_0x3b2e47(0x287)];if(_0x5e41d0&&_0x392621[_0x3b2e47(0x2e4)]){const _0x11ab6d=await segmentResponseToDef(_0x392621,{'resolveSegmentName':async _0x4cc391=>{const _0x14fe66=_0x3b2e47,_0xc80c7a=_0x54a949[_0x14fe66(0x1e7)](_0x4cc391);if(_0xc80c7a)return _0xc80c7a[_0x14fe66(0x287)];const _0xce2845=await _0x4c95e6[_0x14fe66(0x267)](_0x4cc391);return _0xce2845[_0x14fe66(0x287)];}}),_0x2b1c47=_0x11ab6d['rule'];_0x1d6a87={'description':_0x392621['description'],'rule':_0x2b1c47};const _0x54206b=serializeRule(_0x2b1c47),_0x2926d6=_0xf5f866['get'](_0x54206b);if(_0x2926d6)_0x48c054=_0x2926d6,_0x1d6a87=undefined,_0x290ed8[_0x3b2e47(0x1de)]&&console['error'](_0x3b2e47(0x268)+_0x392621[_0x3b2e47(0x287)]+'\x20->\x20'+_0x2926d6);else{let _0x4a7705=![];if(_0x50b669){const _0x4c7e30=_0x50b669[_0x3b2e47(0x1e7)](_0x54206b);if(_0x4c7e30){const _0x505f71=_0x4c7e30[_0x3b2e47(0x274)](_0x39ce2e=>!_0x724d95[_0x3b2e47(0x2be)](_0x39ce2e));_0x505f71&&(_0x48c054=_0x505f71,_0x724d95[_0x3b2e47(0x2f6)](_0x505f71),_0xf5f866[_0x3b2e47(0x1dd)](_0x54206b,_0x505f71),_0x4a7705=!![],_0x290ed8[_0x3b2e47(0x1de)]&&console[_0x3b2e47(0x2c7)](_0x3b2e47(0x1ee)+_0x505f71+_0x3b2e47(0x25c)));}}if(!_0x4a7705){const _0x3b03f9=generateJourneyLocalName(_0x392621[_0x3b2e47(0x287)]);_0x3b03f9&&(_0x48c054=_0x3b03f9);let _0x2a20d8=_0x48c054,_0x3e1b2b=0x2;while(_0x724d95['has'](_0x2a20d8)){_0x2a20d8=_0x48c054+'_'+_0x3e1b2b,_0x3e1b2b++;}_0x724d95[_0x3b2e47(0x2f6)](_0x2a20d8),_0xf5f866['set'](_0x54206b,_0x2a20d8),_0x48c054=_0x2a20d8;}}}const _0x20e961={'name':_0x48c054,'isJourneyLocal':_0x5e41d0,'definition':_0x1d6a87};return _0x54a949[_0x3b2e47(0x1dd)](_0x510c73,_0x20e961),_0x20e961;}catch(_0x578016){return _0x3fd0ab[_0x3b2e47(0x1de)]&&console[_0x3b2e47(0x2c7)](_0x3b2e47(0x285)+_0x510c73+':\x20'+_0x578016[_0x3b2e47(0x2c8)]),{'name':_0x510c73,'isJourneyLocal':![]};}},'resolveActivation':async _0x12aeba=>{const _0x3fed52=_0x4c9caa,_0x1e4c67=_0x5ac801[_0x3fed52(0x1e7)](_0x12aeba);if(_0x1e4c67)return _0x1e4c67;try{const _0x10a0f6=await _0x29c9c5['journey']['getActivation'](_0x2705e5['id'],_0x12aeba),_0xf14e90=journeyActivationStepToYaml(_0x10a0f6,_0x19430e,_0x10a2f4),_0x207fed=JSON[_0x3fed52(0x211)]({'name':_0xf14e90[_0x3fed52(0x287)],'connection':_0xf14e90[_0x3fed52(0x2b9)],'connector_config':_0xf14e90[_0x3fed52(0x24b)]}),_0x35cf9d=_0x497ed7[_0x3fed52(0x1e7)](_0x207fed);if(_0x35cf9d){const _0x464bb5={'name':_0x35cf9d,'isJourneyLocal':!![],'definition':_0xf14e90};return _0x5ac801['set'](_0x12aeba,_0x464bb5),_0x464bb5;}const _0x364b59=_0x10a0f6[_0x3fed52(0x1db)]['activationParams'][_0x3fed52(0x287)]||_0x12aeba,_0x308511=sanitizeYamlKey(_0x364b59)||_0x3fed52(0x2e6)+_0x12aeba;let _0x15759f=_0x308511,_0x576a47=0x2;while(_0x37a115[_0x3fed52(0x2be)](_0x15759f)){_0x15759f=_0x308511+'_'+_0x576a47,_0x576a47++;}_0x37a115[_0x3fed52(0x2f6)](_0x15759f),_0x497ed7['set'](_0x207fed,_0x15759f);const _0x1dd664={'name':_0x15759f,'isJourneyLocal':!![],'definition':_0xf14e90};return _0x5ac801[_0x3fed52(0x1dd)](_0x12aeba,_0x1dd664),_0x1dd664;}catch(_0xc9ba3f){return _0x3fd0ab[_0x3fed52(0x1de)]&&console[_0x3fed52(0x2c7)](_0x3fed52(0x2f3)+_0x12aeba+':\x20'+_0xc9ba3f[_0x3fed52(0x2c8)]),{'name':_0x12aeba,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x52cde3,_0x5c7a8b)=>{const _0x4d1207=_0x4c9caa;return resolveJumpTarget(_0x52cde3,_0x5c7a8b,_0x33ccee,_0x1fe278=>_0x29c9c5[_0x4d1207(0x265)][_0x4d1207(0x2e8)](_0x1fe278));}},_0x13981f=await journeyResponseToDef(_0x5ad205,_0x4c95e6);_0x2cb1d2[_0x4c9caa(0x207)]({'item':_0x2705e5,'yaml':_0x13981f});}},{'verbose':_0x3fd0ab[_0x5b28f4(0x1de)]});const _0x1744c3=await _0x29c9c5['journey'][_0x5b28f4(0x2b3)](_0x4d8890[0x0]['journeyBundleId']),_0x350bf5=buildMergedJourneyDef(_0x2cb1d2,_0x50b669,_0x1744c3),_0x12b766=normalizeJourneyDef(_0x350bf5,_0x4cd1a5),_0x4a02df=toYamlString(_0x12b766),_0x39d006=_0xcc55||a31_0x28469a[_0x5b28f4(0x301)](_0x3f7ff2,sanitizeFileName(_0x137a50)+'.journey.yml');!_0xcc55&&_0x424893&&!existsSync(_0x3f7ff2)&&mkdirSync(_0x3f7ff2,{'recursive':!![]});const _0x337844=a31_0x28469a['relative'](process['cwd'](),_0x39d006);if(existsSync(_0x39d006)){const _0x18d704=readFileSync(_0x39d006,_0x5b28f4(0x29b)),_0x3314cd=generateDiff(_0x18d704,_0x4a02df),_0x13413a=hasChanges(_0x3314cd);_0x5a53a2[_0x5b28f4(0x207)]({'relativePath':_0x337844,'absolutePath':_0x39d006,'content':_0x4a02df,'isNew':![],'hasChanges':_0x13413a,'diff':_0x13413a?formatDiffWithColors(_0x3314cd):undefined});}else _0x5a53a2[_0x5b28f4(0x207)]({'relativePath':_0x337844,'absolutePath':_0x39d006,'content':_0x4a02df,'isNew':!![],'hasChanges':![]});}const _0xb82cdd=_0x5a53a2[_0x5b28f4(0x2c9)](_0x4b8fcc=>_0x4b8fcc['isNew']),_0x4dc8b9=_0x5a53a2[_0x5b28f4(0x2c9)](_0x121b43=>!_0x121b43['isNew']&&_0x121b43[_0x5b28f4(0x20e)]),_0x54e023=_0x5a53a2[_0x5b28f4(0x2c9)](_0x5b99f2=>!_0x5b99f2[_0x5b28f4(0x221)]&&!_0x5b99f2['hasChanges']),_0x5ac01a=_0x47435c[_0x5b28f4(0x21c)],_0x57b92b=_0x49021a[_0x5b28f4(0x2b5)],_0x223345=_0x5ac01a>_0x57b92b?'\x20('+_0x5ac01a+_0x5b28f4(0x22f):'';console[_0x5b28f4(0x2c7)](_0x5b28f4(0x269)),console['error']('\x20\x20'+a31_0xbf56a2['cyan'](_0x57b92b+_0x5b28f4(0x208))+a31_0xbf56a2['dim'](_0x223345)),console[_0x5b28f4(0x2c7)]('\x20\x20'+a31_0xbf56a2['green']('+\x20'+_0xb82cdd[_0x5b28f4(0x21c)]+'\x20new\x20files')),console[_0x5b28f4(0x2c7)]('\x20\x20'+a31_0xbf56a2['yellow']('~\x20'+_0x4dc8b9[_0x5b28f4(0x21c)]+_0x5b28f4(0x21b))),console[_0x5b28f4(0x2c7)]('\x20\x20'+a31_0xbf56a2['dim']('=\x20'+_0x54e023[_0x5b28f4(0x21c)]+_0x5b28f4(0x24e))),console[_0x5b28f4(0x2c7)]('\x20\x20Target:\x20'+a31_0xbf56a2[_0x5b28f4(0x286)](_0x371604)+'\x0a');if(_0x4dc8b9['length']>0x0)for(const _0x234adc of _0x4dc8b9){console['error'](_0x5b28f4(0x235)+_0x234adc[_0x5b28f4(0x2d2)]+'\x27:'),console[_0x5b28f4(0x2c7)]('─'[_0x5b28f4(0x25b)](0x3c)),console[_0x5b28f4(0x2c7)](_0x234adc[_0x5b28f4(0x2f7)]),console['error']('─'['repeat'](0x3c));}if(_0x290ed8[_0x5b28f4(0x1ed)])return console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x1ef)](_0x5b28f4(0x23d))),0x0;if(_0xb82cdd[_0x5b28f4(0x21c)]===0x0&&_0x4dc8b9[_0x5b28f4(0x21c)]===0x0)return console['error'](a31_0xbf56a2[_0x5b28f4(0x2dd)](_0x5b28f4(0x24a))),saveSessionContext({'parent_segment':_0x22d50e},_0x290ed8[_0x5b28f4(0x2e1)]),console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x2dd)](_0x5b28f4(0x2d6)+a31_0xbf56a2[_0x5b28f4(0x2d7)]('parent_segment')+'\x20=\x20'+a31_0xbf56a2['cyan'](_0x22d50e))),0x0;if(!_0x290ed8[_0x5b28f4(0x1e5)]&&(_0xb82cdd[_0x5b28f4(0x21c)]>0x0||_0x4dc8b9[_0x5b28f4(0x21c)]>0x0)){if(!isInteractive())return console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x2b6)](_0x5b28f4(0x26d)),_0x5b28f4(0x224)),console['error'](a31_0xbf56a2['dim'](_0x5b28f4(0x232))),0x1;const _0x3a77c7=await confirmKey(_0x5b28f4(0x2fa)+(_0xb82cdd[_0x5b28f4(0x21c)]+_0x4dc8b9[_0x5b28f4(0x21c)])+_0x5b28f4(0x2a1));if(!_0x3a77c7)return console['error'](a31_0xbf56a2[_0x5b28f4(0x1ef)](_0x5b28f4(0x1d9)),_0x5b28f4(0x30a)),0x1;}!existsSync(_0x371604)&&mkdirSync(_0x371604,{'recursive':!![]});const _0x32a920=a31_0x28469a['join'](_0x371604,_0x5b28f4(0x1dc));writeFileSync(_0x32a920,createTdxConfigContent(_0x22d50e),_0x5b28f4(0x29b));for(const _0xd8283e of _0x5a53a2){(_0xd8283e['isNew']||_0xd8283e[_0x5b28f4(0x20e)])&&writeFileSync(_0xd8283e[_0x5b28f4(0x275)],_0xd8283e[_0x5b28f4(0x1f3)],'utf-8');}return console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x2dd)]('✔\x20Pulled\x20'+(_0xb82cdd[_0x5b28f4(0x21c)]+_0x4dc8b9[_0x5b28f4(0x21c)])+_0x5b28f4(0x244)+_0x371604)),saveSessionContext({'parent_segment':_0x22d50e},_0x290ed8['session']),console[_0x5b28f4(0x2c7)](a31_0xbf56a2['green'](_0x5b28f4(0x2d6)+a31_0xbf56a2['dim'](_0x5b28f4(0x21f))+_0x5b28f4(0x2dc)+a31_0xbf56a2[_0x5b28f4(0x286)](_0x22d50e))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x2ff);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x1e8);async[a31_0x2594d4(0x279)](_0x404b83){const _0x480387=a31_0x2594d4,{options:_0x1641bb,args:_0x503c54,tdx:_0x3ea352}=_0x404b83,_0xb9699f=_0x503c54[0x0];if(!requireNameOrPath(_0xb9699f))return 0x1;_0x1641bb['verbose']&&console[_0x480387(0x2c7)]('Input:\x20'+_0xb9699f);const {journeyId:_0x7a98f7}=await resolveJourneyIdFromInput(_0xb9699f,_0x1641bb,_0x3ea352),_0x200002=await withSpinner('Getting\x20column\x20mapping...',()=>_0x3ea352['journey'][_0x480387(0x1f1)](_0x7a98f7),{'verbose':_0x1641bb[_0x480387(0x1de)]}),_0x2a36ef=_0x200002['data'];return console[_0x480387(0x308)]('Database:\x20'+_0x2a36ef[_0x480387(0x249)]),console['log'](_0x480387(0x2cb)+_0x2a36ef[_0x480387(0x253)]),await handleSDKOutput(_0x2a36ef[_0x480387(0x28c)],_0x1641bb),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x24d);[a31_0x2594d4(0x276)]='List\x20activations\x20for\x20a\x20journey';async['execute'](_0x3648bb){const _0x12656f=a31_0x2594d4,{options:_0x573f3d,args:_0x48461e,tdx:_0x49203c}=_0x3648bb,_0x17f2aa=_0x48461e[0x0];if(!requireNameOrPath(_0x17f2aa))return 0x1;_0x573f3d[_0x12656f(0x1de)]&&console[_0x12656f(0x2c7)]('Input:\x20'+_0x17f2aa);const {journeyId:_0x7aa8e1}=await resolveJourneyIdFromInput(_0x17f2aa,_0x573f3d,_0x49203c),_0x257b7e=await withSpinner(_0x12656f(0x25f),()=>_0x49203c[_0x12656f(0x265)][_0x12656f(0x23e)](_0x7aa8e1),{'verbose':_0x573f3d[_0x12656f(0x1de)]}),_0x162bed=_0x257b7e[_0x12656f(0x210)];return console[_0x12656f(0x2c7)](_0x12656f(0x291)+_0x162bed[_0x12656f(0x21c)]+_0x12656f(0x28a)+(_0x162bed[_0x12656f(0x21c)]!==0x1?'s':'')),await handleSDKOutput(_0x162bed,_0x573f3d),0x0;}}export class JourneyPushCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x2fc);['description']='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI';[a31_0x2594d4(0x292)]=new SegmentPushCommand();async[a31_0x2594d4(0x279)](_0x24a644){const _0x1126e6=a31_0x2594d4,_0x8e2cb8=_0x24a644[_0x1126e6(0x2a7)][0x0];let _0x2d97ed;if(_0x8e2cb8){const _0x48379c=await resolveTarget({'arg':_0x8e2cb8,'contextParent':_0x24a644[_0x1126e6(0x27e)]['parentSegment'],'cwd':process[_0x1126e6(0x1f8)]()});isSuccessfulResolution(_0x48379c)&&_0x48379c[_0x1126e6(0x22d)]===_0x1126e6(0x1e4)&&(_0x2d97ed=_0x48379c[_0x1126e6(0x231)]);}const _0x305d38={..._0x24a644,'options':{..._0x24a644[_0x1126e6(0x27e)],'journeysOnly':!![],..._0x2d97ed&&{'singleFilePath':_0x2d97ed}}};return this[_0x1126e6(0x292)][_0x1126e6(0x279)](_0x305d38);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a31_0x2594d4(0x30c);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x2a8);async[a31_0x2594d4(0x279)](_0x121431){const _0x3f34c8=a31_0x2594d4,{options:_0x3592e6,args:_0x553d9f,tdx:_0x1d0b06}=_0x121431,_0x4e4953=_0x553d9f[0x0];if(!requireNameOrPath(_0x4e4953))return 0x1;if(_0x3592e6[_0x3f34c8(0x1de)])console[_0x3f34c8(0x2c7)](_0x3f34c8(0x2c1)+_0x4e4953);const {journeyId:_0x1b5116}=await resolveJourneyIdFromInput(_0x4e4953,_0x3592e6,_0x1d0b06),_0x40b510=await withSpinner(_0x3f34c8(0x2ec),()=>_0x1d0b06[_0x3f34c8(0x265)][_0x3f34c8(0x2de)](_0x1b5116),{'verbose':_0x3592e6['verbose']}),{bundleName:_0x1c944a,versions:_0x2b484f,latestJourneyId:_0x714506}=_0x40b510[_0x3f34c8(0x210)];console['error'](_0x1c944a+':\x20'+_0x2b484f[_0x3f34c8(0x21c)]+_0x3f34c8(0x28d)+(_0x2b484f[_0x3f34c8(0x21c)]!==0x1?'s':''));const _0xb15e8d=_0x2b484f[_0x3f34c8(0x2b1)](_0x2ede7a=>({'version':_0x2ede7a[_0x3f34c8(0x2b0)],'journey_id':_0x2ede7a[_0x3f34c8(0x223)],'name':_0x2ede7a[_0x3f34c8(0x287)],'state':_0x2ede7a[_0x3f34c8(0x2a2)],'paused':_0x2ede7a[_0x3f34c8(0x2da)],'latest':_0x2ede7a['journeyId']===_0x714506,'created_at':_0x2ede7a[_0x3f34c8(0x303)]}));return await handleSDKOutput(_0xb15e8d,_0x3592e6),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';['description']=a31_0x2594d4(0x2a6);async['execute'](_0x5ca9bc){const _0x10eb6c=a31_0x2594d4,{options:_0x495c25,args:_0x278cd1,tdx:_0x48b770}=_0x5ca9bc,_0xcdf91=_0x278cd1[0x0];if(!requireNameOrPath(_0xcdf91))return 0x1;if(_0x495c25['verbose'])console[_0x10eb6c(0x2c7)](_0x10eb6c(0x2c1)+_0xcdf91);const {journeyId:_0x41fce3,journeyName:_0x3fb7be}=await resolveJourneyIdFromInput(_0xcdf91,_0x495c25,_0x48b770);if(!_0x495c25['yes']){const _0x52b9b1=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x3fb7be+'\x22?');if(!_0x52b9b1)return console[_0x10eb6c(0x2c7)]('Cancelled'),0x0;}const _0x162b3c=await withSpinner('Creating\x20new\x20version...',()=>_0x48b770[_0x10eb6c(0x265)][_0x10eb6c(0x237)](_0x41fce3),{'verbose':_0x495c25[_0x10eb6c(0x1de)]}),_0x1ec196=_0x162b3c[_0x10eb6c(0x210)];return console[_0x10eb6c(0x2c7)](a31_0xbf56a2[_0x10eb6c(0x2dd)]('\u2714')+_0x10eb6c(0x240)+_0x1ec196[_0x10eb6c(0x1db)][_0x10eb6c(0x2b0)]+'\x20(draft)\x20—\x20\x22'+_0x1ec196[_0x10eb6c(0x1db)][_0x10eb6c(0x287)]+'\x22'),console[_0x10eb6c(0x2c7)](_0x10eb6c(0x234)+_0x1ec196['id']),await handleSingleObjectOutput({'id':_0x1ec196['id'],'name':_0x1ec196[_0x10eb6c(0x1db)][_0x10eb6c(0x287)],'version':_0x1ec196[_0x10eb6c(0x1db)]['versionNumber'],'state':_0x1ec196[_0x10eb6c(0x1db)]['state'],'bundle_id':_0x1ec196['attributes'][_0x10eb6c(0x228)],'created_at':_0x1ec196['attributes'][_0x10eb6c(0x303)]},_0x495c25),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a31_0x2594d4(0x287)]='journey:version:view';['description']=a31_0x2594d4(0x2f0);async[a31_0x2594d4(0x279)](_0x552952){const _0x2f38e2=a31_0x2594d4,{options:_0x1922ae,args:_0x4d3d51,tdx:_0x4587c1}=_0x552952,_0x577dc6=_0x4d3d51[0x0];if(!requireNameOrPath(_0x577dc6))return 0x1;const _0x152e56=_0x1922ae[_0x2f38e2(0x213)];if(!_0x152e56)return console[_0x2f38e2(0x2c7)](_0x2f38e2(0x24f)),console[_0x2f38e2(0x2c7)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x3d8b8a=parseInt(_0x152e56,0xa);if(isNaN(_0x3d8b8a)||_0x3d8b8a<0x1)return console[_0x2f38e2(0x2c7)](_0x2f38e2(0x26a)+_0x152e56),0x1;if(_0x1922ae[_0x2f38e2(0x1de)])console[_0x2f38e2(0x2c7)]('Input:\x20'+_0x577dc6+_0x2f38e2(0x21e)+_0x3d8b8a);const {journeyId:_0x27c787,parentSegmentId:_0x1be853}=await resolveJourneyIdFromInput(_0x577dc6,_0x1922ae,_0x4587c1),_0x4ba2fe=await withSpinner('Resolving\x20version...',()=>_0x4587c1['journey']['listVersions'](_0x27c787),{'verbose':_0x1922ae[_0x2f38e2(0x1de)]}),{versions:_0x2a3257,latestJourneyId:_0x56027b}=_0x4ba2fe['data'],_0x43c960=_0x2a3257[_0x2f38e2(0x274)](_0x506b1e=>_0x506b1e[_0x2f38e2(0x2b0)]===_0x3d8b8a);if(!_0x43c960){const _0x1f7585=_0x2a3257[_0x2f38e2(0x2b1)](_0x5edd55=>'v'+_0x5edd55[_0x2f38e2(0x2b0)])['join'](',\x20');return console[_0x2f38e2(0x2c7)](_0x2f38e2(0x2f2)+_0x3d8b8a+_0x2f38e2(0x22e)+_0x1f7585),0x1;}const _0x5375d7=await withSpinner('Getting\x20version\x20'+_0x3d8b8a+_0x2f38e2(0x278),()=>_0x4587c1[_0x2f38e2(0x265)][_0x2f38e2(0x2e8)](_0x43c960['journeyId']),{'verbose':_0x1922ae[_0x2f38e2(0x1de)]}),_0x382483=_0x5375d7[_0x2f38e2(0x210)],_0x39630=getConsoleNextUrl(_0x1922ae[_0x2f38e2(0x300)],_0x2f38e2(0x2ce)+_0x1be853+'/e/'+_0x43c960[_0x2f38e2(0x223)]+_0x2f38e2(0x2e9));return await handleSingleObjectOutput({'id':_0x382483['id'],'name':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x287)],'version':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x2b0)],'description':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x276)],'state':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x2a2)],'paused':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x2da)],'reentry_mode':_0x382483['attributes'][_0x2f38e2(0x1f5)],'stages':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x2a0)]?.[_0x2f38e2(0x21c)]||0x0,..._0x382483['attributes'][_0x2f38e2(0x2b2)]&&{'goal':_0x382483['attributes'][_0x2f38e2(0x2b2)][_0x2f38e2(0x287)]},'latest':_0x43c960[_0x2f38e2(0x223)]===_0x56027b,'created_at':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x303)],'updated_at':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x1e0)],'url':_0x39630},_0x1922ae),0x0;}}
@@ -1 +1 @@
1
- const a31_0x5595ca=a31_0x4e73;(function(_0x2e262d,_0x2f1271){const _0x543da4=a31_0x4e73,_0x211142=_0x2e262d();while(!![]){try{const _0xe1bf0b=-parseInt(_0x543da4(0x199))/0x1+parseInt(_0x543da4(0x1b5))/0x2+-parseInt(_0x543da4(0x196))/0x3*(-parseInt(_0x543da4(0x1a8))/0x4)+parseInt(_0x543da4(0x19a))/0x5*(parseInt(_0x543da4(0x1a4))/0x6)+-parseInt(_0x543da4(0x186))/0x7*(parseInt(_0x543da4(0x1b1))/0x8)+-parseInt(_0x543da4(0x18d))/0x9*(parseInt(_0x543da4(0x1a5))/0xa)+-parseInt(_0x543da4(0x182))/0xb*(parseInt(_0x543da4(0x1ac))/0xc);if(_0xe1bf0b===_0x2f1271)break;else _0x211142['push'](_0x211142['shift']());}catch(_0x23fc70){_0x211142['push'](_0x211142['shift']());}}}(a31_0x60c7,0x4c169));import{BaseCommand}from'./command.js';function a31_0x60c7(){const _0x151b27=['\x20segment\x20file(s)\x20skipped)','\x20error(s)','red','helpText','cwd','47457DXQgmD','green','validCount','41353wvCelc','360cCBKvl','length','file','\x20journey(s)\x20valid','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','parentSegment','.yml','errorCode','relativePath','\x20journey(s)\x20with\x20errors,\x20','46956pFZYjK','780mHmhXM','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','warnings','24zKTgIs','cyan','journey:validate','no_parent','120ZMkTkf','dim','filter','\x20warning(s)\x20found','endsWith','592daVbwf','type','Error:\x20','skippedCount','1245228JjuGGK','hasErrors','✔\x20All\x20','warningCount','targetDir','errors','\x20segment\x20file(s)\x20skipped','valid','360404lBEICC','No\x20journey\x20YAML\x20files\x20found\x20in\x20','error','message','54628mafQcc','Error:\x20Directory\x20not\x20found:\x20','.yaml','yellow','log','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','verbose','2637KDziao','description','execute','\x20valid'];a31_0x60c7=function(){return _0x151b27;};return a31_0x60c7();}function a31_0x4e73(_0x57d889,_0x4ed845){_0x57d889=_0x57d889-0x182;const _0x60c70b=a31_0x60c7();let _0x4e7348=_0x60c70b[_0x57d889];return _0x4e7348;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a31_0xa9d7d9 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a31_0x5595ca(0x1aa);[a31_0x5595ca(0x18e)]='Validate\x20journey\x20YAML\x20files';async[a31_0x5595ca(0x18f)](_0x2361e7){const _0x5cd676=a31_0x5595ca,{options:_0x2c7911,args:_0x40f6bb}=_0x2361e7,_0x2bd494=_0x2c7911,_0x28599e=await resolveTarget({'arg':_0x40f6bb[0x0],'contextParent':_0x2c7911[_0x5cd676(0x19f)],'cwd':process[_0x5cd676(0x195)]()});if(!isSuccessfulResolution(_0x28599e))return _0x28599e[_0x5cd676(0x1a1)]===_0x5cd676(0x1ab)?(console[_0x5cd676(0x184)](a31_0xa9d7d9['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x5cd676(0x184)](_0x5cd676(0x19e)),console['error'](_0x5cd676(0x1a6)),console[_0x5cd676(0x184)](_0x5cd676(0x18b))):(console[_0x5cd676(0x184)](a31_0xa9d7d9['red'](_0x5cd676(0x1b3)+_0x28599e[_0x5cd676(0x185)]+'\x0a')),_0x28599e[_0x5cd676(0x194)]&&console['error'](a31_0xa9d7d9[_0x5cd676(0x1a9)](_0x28599e[_0x5cd676(0x194)]))),0x1;const _0x4acc7b=_0x28599e[_0x5cd676(0x1b9)],_0x1dd687=_0x28599e[_0x5cd676(0x1b2)]===_0x5cd676(0x19c)?_0x28599e['filePath']:undefined;if(!_0x1dd687&&!existsSync(_0x4acc7b))return console[_0x5cd676(0x184)](a31_0xa9d7d9[_0x5cd676(0x193)](_0x5cd676(0x187)+_0x4acc7b+'\x0a')),0x1;let _0x28cf70;if(_0x1dd687){if(!_0x1dd687[_0x5cd676(0x1b0)](_0x5cd676(0x1a0))&&!_0x1dd687[_0x5cd676(0x1b0)](_0x5cd676(0x188)))return console[_0x5cd676(0x184)](a31_0xa9d7d9[_0x5cd676(0x193)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1dd687+'\x0a')),0x1;_0x28cf70=[_0x1dd687];}else _0x28cf70=findYamlFiles(_0x4acc7b);if(_0x28cf70[_0x5cd676(0x19b)]===0x0)return console[_0x5cd676(0x184)](a31_0xa9d7d9[_0x5cd676(0x193)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4acc7b+'\x0a')),0x1;const _0x575b52=validateYamlFiles(_0x28cf70,_0x4acc7b,{'filterType':'journey'}),_0x248aa5=calculateSummary(_0x575b52),_0x228780=_0x575b52[_0x5cd676(0x1ae)](isValidationResult);if(_0x228780[_0x5cd676(0x19b)]===0x0)return console['error'](a31_0xa9d7d9[_0x5cd676(0x189)](_0x5cd676(0x183)+_0x4acc7b+'\x0a')),_0x248aa5['skippedCount']>0x0&&console[_0x5cd676(0x184)](a31_0xa9d7d9[_0x5cd676(0x1ad)]('('+_0x248aa5[_0x5cd676(0x1b4)]+_0x5cd676(0x191))),0x0;for(const _0x218f0f of _0x575b52){if(!isValidationResult(_0x218f0f)){_0x2bd494[_0x5cd676(0x18c)]&&console[_0x5cd676(0x18a)](a31_0xa9d7d9['dim']('-\x20'+_0x218f0f[_0x5cd676(0x1a2)]+'\x20(skipped:\x20'+_0x218f0f['reason']+')'));continue;}const {relativePath:_0x467fcd,source:_0x1f3f6f,result:_0x3bbd57}=_0x218f0f;if(_0x3bbd57['valid']&&_0x3bbd57[_0x5cd676(0x1a7)]['length']===0x0)_0x2bd494[_0x5cd676(0x18c)]&&console[_0x5cd676(0x18a)](a31_0xa9d7d9[_0x5cd676(0x197)]('✔\x20'+_0x467fcd));else _0x3bbd57[_0x5cd676(0x1bc)]?(console[_0x5cd676(0x18a)](a31_0xa9d7d9[_0x5cd676(0x189)]('⚠\x20'+_0x467fcd+':\x20'+_0x3bbd57[_0x5cd676(0x1a7)][_0x5cd676(0x19b)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x3bbd57,_0x1f3f6f,_0x467fcd))):(console[_0x5cd676(0x18a)](a31_0xa9d7d9[_0x5cd676(0x193)]('✖\x20'+_0x467fcd+':\x20'+_0x3bbd57[_0x5cd676(0x1ba)][_0x5cd676(0x19b)]+_0x5cd676(0x192))),console[_0x5cd676(0x18a)](formatValidationResult(_0x3bbd57,_0x1f3f6f,_0x467fcd)));}return console[_0x5cd676(0x18a)](''),_0x248aa5[_0x5cd676(0x1b6)]?(console[_0x5cd676(0x18a)](a31_0xa9d7d9[_0x5cd676(0x193)]('Validation\x20failed:\x20'+_0x248aa5['invalidCount']+_0x5cd676(0x1a3)+_0x248aa5[_0x5cd676(0x198)]+_0x5cd676(0x190))),_0x248aa5['warningCount']>0x0&&console[_0x5cd676(0x18a)](a31_0xa9d7d9[_0x5cd676(0x189)](_0x248aa5[_0x5cd676(0x1b8)]+'\x20warning(s)\x20found')),_0x248aa5[_0x5cd676(0x1b4)]>0x0&&console[_0x5cd676(0x18a)](a31_0xa9d7d9['dim'](_0x248aa5['skippedCount']+_0x5cd676(0x1bb))),0x1):(console[_0x5cd676(0x18a)](a31_0xa9d7d9[_0x5cd676(0x197)](_0x5cd676(0x1b7)+_0x248aa5['validCount']+_0x5cd676(0x19d))),_0x248aa5['warningCount']>0x0&&console[_0x5cd676(0x18a)](a31_0xa9d7d9[_0x5cd676(0x189)](_0x248aa5[_0x5cd676(0x1b8)]+_0x5cd676(0x1af))),_0x248aa5[_0x5cd676(0x1b4)]>0x0&&console[_0x5cd676(0x18a)](a31_0xa9d7d9[_0x5cd676(0x1ad)](_0x248aa5[_0x5cd676(0x1b4)]+_0x5cd676(0x1bb))),0x0);}}
1
+ const a32_0x5d8783=a32_0x2777;(function(_0x5591f1,_0x17712e){const _0x555fb0=a32_0x2777,_0xab1eff=_0x5591f1();while(!![]){try{const _0x3119e7=-parseInt(_0x555fb0(0x101))/0x1+-parseInt(_0x555fb0(0xef))/0x2*(-parseInt(_0x555fb0(0xd5))/0x3)+-parseInt(_0x555fb0(0x10b))/0x4*(parseInt(_0x555fb0(0x104))/0x5)+parseInt(_0x555fb0(0xf0))/0x6*(-parseInt(_0x555fb0(0xe5))/0x7)+-parseInt(_0x555fb0(0x107))/0x8+-parseInt(_0x555fb0(0xdf))/0x9*(-parseInt(_0x555fb0(0xd3))/0xa)+-parseInt(_0x555fb0(0xe0))/0xb*(-parseInt(_0x555fb0(0x108))/0xc);if(_0x3119e7===_0x17712e)break;else _0xab1eff['push'](_0xab1eff['shift']());}catch(_0x4a5c0e){_0xab1eff['push'](_0xab1eff['shift']());}}}(a32_0x41d7,0x7fb71));import{BaseCommand}from'./command.js';function a32_0x2777(_0x51386c,_0xdb5790){_0x51386c=_0x51386c-0xd3;const _0x41d7fd=a32_0x41d7();let _0x277718=_0x41d7fd[_0x51386c];return _0x277718;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a32_0x21bdd2 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a32_0x41d7(){const _0x256758=['1530279RDlVmp','.yaml','verbose','\x20(skipped:\x20','warnings','warningCount','filter','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','log','endsWith','20997owOFSd','15529074ekNTZh','✔\x20All\x20','\x20warning(s)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','cwd','7fIbOWe','Error:\x20Directory\x20not\x20found:\x20','message','journey:validate','helpText','filePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20segment\x20file(s)\x20skipped)','relativePath','parentSegment','4HCzVsT','3077346nGKtEW','validCount','targetDir','no_parent','dim','green','.yml','\x20segment\x20file(s)\x20skipped','\x20error(s)','yellow','invalidCount','cyan','red','\x20valid','skippedCount','Error:\x20','error','980831RQJyqc','name','errors','10nqxrYv','length','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','3623520IWNLWY','12IjQHSI','valid','\x20warning(s)\x20found','3596rqYOpp','170taIwhJ','execute'];a32_0x41d7=function(){return _0x256758;};return a32_0x41d7();}export class JourneyValidateCommand extends BaseCommand{[a32_0x5d8783(0x102)]=a32_0x5d8783(0xe8);['description']='Validate\x20journey\x20YAML\x20files';async[a32_0x5d8783(0xd4)](_0x13db49){const _0x4e9a16=a32_0x5d8783,{options:_0x3a55c3,args:_0x5b0a32}=_0x13db49,_0x533ebf=_0x3a55c3,_0x212145=await resolveTarget({'arg':_0x5b0a32[0x0],'contextParent':_0x3a55c3[_0x4e9a16(0xee)],'cwd':process[_0x4e9a16(0xe4)]()});if(!isSuccessfulResolution(_0x212145))return _0x212145['errorCode']===_0x4e9a16(0xf3)?(console[_0x4e9a16(0x100)](a32_0x21bdd2[_0x4e9a16(0xf9)](_0x4e9a16(0xeb))),console[_0x4e9a16(0x100)](_0x4e9a16(0x106)),console[_0x4e9a16(0x100)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x4e9a16(0x100)](_0x4e9a16(0xdc))):(console['error'](a32_0x21bdd2[_0x4e9a16(0xfc)](_0x4e9a16(0xff)+_0x212145[_0x4e9a16(0xe7)]+'\x0a')),_0x212145[_0x4e9a16(0xe9)]&&console[_0x4e9a16(0x100)](a32_0x21bdd2[_0x4e9a16(0xfb)](_0x212145[_0x4e9a16(0xe9)]))),0x1;const _0x22f793=_0x212145[_0x4e9a16(0xf2)],_0x5259f3=_0x212145['type']==='file'?_0x212145[_0x4e9a16(0xea)]:undefined;if(!_0x5259f3&&!existsSync(_0x22f793))return console[_0x4e9a16(0x100)](a32_0x21bdd2[_0x4e9a16(0xfc)](_0x4e9a16(0xe6)+_0x22f793+'\x0a')),0x1;let _0x2ffa20;if(_0x5259f3){if(!_0x5259f3[_0x4e9a16(0xde)](_0x4e9a16(0xf6))&&!_0x5259f3[_0x4e9a16(0xde)](_0x4e9a16(0xd6)))return console['error'](a32_0x21bdd2['red'](_0x4e9a16(0xe3)+_0x5259f3+'\x0a')),0x1;_0x2ffa20=[_0x5259f3];}else _0x2ffa20=findYamlFiles(_0x22f793);if(_0x2ffa20[_0x4e9a16(0x105)]===0x0)return console[_0x4e9a16(0x100)](a32_0x21bdd2[_0x4e9a16(0xfc)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x22f793+'\x0a')),0x1;const _0x5442ec=validateYamlFiles(_0x2ffa20,_0x22f793,{'filterType':'journey'}),_0x4f5160=calculateSummary(_0x5442ec),_0x12d0ba=_0x5442ec[_0x4e9a16(0xdb)](isValidationResult);if(_0x12d0ba[_0x4e9a16(0x105)]===0x0)return console[_0x4e9a16(0x100)](a32_0x21bdd2['yellow']('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x22f793+'\x0a')),_0x4f5160[_0x4e9a16(0xfe)]>0x0&&console['error'](a32_0x21bdd2[_0x4e9a16(0xf4)]('('+_0x4f5160['skippedCount']+_0x4e9a16(0xec))),0x0;for(const _0x46f0bb of _0x5442ec){if(!isValidationResult(_0x46f0bb)){_0x533ebf[_0x4e9a16(0xd7)]&&console[_0x4e9a16(0xdd)](a32_0x21bdd2['dim']('-\x20'+_0x46f0bb[_0x4e9a16(0xed)]+_0x4e9a16(0xd8)+_0x46f0bb['reason']+')'));continue;}const {relativePath:_0x3fc44c,source:_0xae4010,result:_0xfa4dea}=_0x46f0bb;if(_0xfa4dea['valid']&&_0xfa4dea[_0x4e9a16(0xd9)][_0x4e9a16(0x105)]===0x0)_0x533ebf[_0x4e9a16(0xd7)]&&console[_0x4e9a16(0xdd)](a32_0x21bdd2[_0x4e9a16(0xf5)]('✔\x20'+_0x3fc44c));else _0xfa4dea[_0x4e9a16(0x109)]?(console[_0x4e9a16(0xdd)](a32_0x21bdd2['yellow']('⚠\x20'+_0x3fc44c+':\x20'+_0xfa4dea[_0x4e9a16(0xd9)][_0x4e9a16(0x105)]+_0x4e9a16(0xe2))),console['log'](formatValidationResult(_0xfa4dea,_0xae4010,_0x3fc44c))):(console[_0x4e9a16(0xdd)](a32_0x21bdd2['red']('✖\x20'+_0x3fc44c+':\x20'+_0xfa4dea[_0x4e9a16(0x103)][_0x4e9a16(0x105)]+_0x4e9a16(0xf8))),console['log'](formatValidationResult(_0xfa4dea,_0xae4010,_0x3fc44c)));}return console[_0x4e9a16(0xdd)](''),_0x4f5160['hasErrors']?(console[_0x4e9a16(0xdd)](a32_0x21bdd2[_0x4e9a16(0xfc)]('Validation\x20failed:\x20'+_0x4f5160[_0x4e9a16(0xfa)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x4f5160[_0x4e9a16(0xf1)]+_0x4e9a16(0xfd))),_0x4f5160[_0x4e9a16(0xda)]>0x0&&console[_0x4e9a16(0xdd)](a32_0x21bdd2[_0x4e9a16(0xf9)](_0x4f5160[_0x4e9a16(0xda)]+_0x4e9a16(0x10a))),_0x4f5160[_0x4e9a16(0xfe)]>0x0&&console['log'](a32_0x21bdd2[_0x4e9a16(0xf4)](_0x4f5160[_0x4e9a16(0xfe)]+_0x4e9a16(0xf7))),0x1):(console[_0x4e9a16(0xdd)](a32_0x21bdd2['green'](_0x4e9a16(0xe1)+_0x4f5160['validCount']+'\x20journey(s)\x20valid')),_0x4f5160[_0x4e9a16(0xda)]>0x0&&console[_0x4e9a16(0xdd)](a32_0x21bdd2[_0x4e9a16(0xf9)](_0x4f5160['warningCount']+_0x4e9a16(0x10a))),_0x4f5160['skippedCount']>0x0&&console[_0x4e9a16(0xdd)](a32_0x21bdd2['dim'](_0x4f5160['skippedCount']+_0x4e9a16(0xf7))),0x0);}}