@treasuredata/tdx 2026.4.9 → 2026.4.10

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 (228) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  96. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  97. package/dist/sdk/cas/index.js +1 -1
  98. package/dist/sdk/cas/pull-workflow.js +1 -1
  99. package/dist/sdk/cas/push-workflow.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.js +1 -1
  105. package/dist/sdk/client/llm-api-client.js +1 -1
  106. package/dist/sdk/client/oauth-refresh.js +1 -1
  107. package/dist/sdk/client/rate-limiter.js +1 -1
  108. package/dist/sdk/client/td-api-client.js +1 -1
  109. package/dist/sdk/client/trino-api-client.js +1 -1
  110. package/dist/sdk/client/workflow-client.js +1 -1
  111. package/dist/sdk/connection-validator.js +1 -1
  112. package/dist/sdk/connection.js +1 -1
  113. package/dist/sdk/delivery.js +1 -1
  114. package/dist/sdk/engage/campaign-pull.js +1 -1
  115. package/dist/sdk/engage/campaign-push.js +1 -1
  116. package/dist/sdk/engage/campaign-validator.js +1 -1
  117. package/dist/sdk/engage/campaign-yaml.js +1 -1
  118. package/dist/sdk/engage/template-pull.js +1 -1
  119. package/dist/sdk/engage/template-push.js +1 -1
  120. package/dist/sdk/engage/template-validator.js +1 -1
  121. package/dist/sdk/engage/template-yaml.js +1 -1
  122. package/dist/sdk/engage/types/campaign-def.js +1 -1
  123. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  124. package/dist/sdk/engage/types/template-schema.js +1 -1
  125. package/dist/sdk/engage.js +1 -1
  126. package/dist/sdk/errors.js +1 -1
  127. package/dist/sdk/index.js +1 -1
  128. package/dist/sdk/io/index.js +1 -1
  129. package/dist/sdk/io/node-filesystem.js +1 -1
  130. package/dist/sdk/job.js +1 -1
  131. package/dist/sdk/journey.js +1 -1
  132. package/dist/sdk/llm/chat-cache.js +1 -1
  133. package/dist/sdk/llm/index.js +1 -1
  134. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  135. package/dist/sdk/llm/model-factors.js +1 -1
  136. package/dist/sdk/personalization.js +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/index.js +1 -1
  139. package/dist/sdk/query/sql-parser.js +1 -1
  140. package/dist/sdk/realtime.js +1 -1
  141. package/dist/sdk/schedule.js +1 -1
  142. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/fields-display.js +1 -1
  144. package/dist/sdk/segment/file-discovery.js +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.js +1 -1
  153. package/dist/sdk/segment/resolution-context.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.js +1 -1
  157. package/dist/sdk/segment/target-resolution.js +1 -1
  158. package/dist/sdk/segment/tdx-config.js +1 -1
  159. package/dist/sdk/segment/types/activation-schema.js +1 -1
  160. package/dist/sdk/segment/types/journey-def.js +1 -1
  161. package/dist/sdk/segment/types/journey-schema.js +1 -1
  162. package/dist/sdk/segment/types/segment-def.js +1 -1
  163. package/dist/sdk/segment/types/segment-schema.js +1 -1
  164. package/dist/sdk/segment/validate-files.js +1 -1
  165. package/dist/sdk/segment/yaml-validator.js +1 -1
  166. package/dist/sdk/segment.js +1 -1
  167. package/dist/sdk/types/index.js +1 -1
  168. package/dist/sdk/types/progress.js +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/access-tracker.js +1 -1
  184. package/dist/sdk/workspace/frontmatter.js +1 -1
  185. package/dist/sdk/workspace/git.d.ts +52 -0
  186. package/dist/sdk/workspace/git.d.ts.map +1 -1
  187. package/dist/sdk/workspace/git.js +1 -1
  188. package/dist/sdk/workspace/git.js.map +1 -1
  189. package/dist/sdk/workspace/index.d.ts +14 -0
  190. package/dist/sdk/workspace/index.d.ts.map +1 -1
  191. package/dist/sdk/workspace/index.js +1 -1
  192. package/dist/sdk/workspace/index.js.map +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +2 -1
@@ -1 +1 @@
1
- const a23_0x1918ba=a23_0x5d85;(function(_0x58f864,_0x2f2902){const _0x58a986=a23_0x5d85,_0x394524=_0x58f864();while(!![]){try{const _0x3baba4=-parseInt(_0x58a986(0x1dc))/0x1*(parseInt(_0x58a986(0x1e6))/0x2)+parseInt(_0x58a986(0x1e9))/0x3+-parseInt(_0x58a986(0x1fa))/0x4+-parseInt(_0x58a986(0x1f5))/0x5+parseInt(_0x58a986(0x1e4))/0x6+parseInt(_0x58a986(0x1ec))/0x7+-parseInt(_0x58a986(0x204))/0x8;if(_0x3baba4===_0x2f2902)break;else _0x394524['push'](_0x394524['shift']());}catch(_0x3290fe){_0x394524['push'](_0x394524['shift']());}}}(a23_0x4cd5,0xb1e62));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 a23_0x362d74 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x2bd8e7 from'path';function a23_0x4cd5(){const _0x3a33ea=['length','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','engage:template:pull','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Aborted.','\x0aPull\x20summary\x20for\x20workspace\x20\x27','engage','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','verbose','\x20=\x20','No\x20templates\x20found\x20in\x20workspace\x20\x27','Pulling\x20templates\x20from\x20\x27','\x27...','description','content','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20Pulled\x20','\x20templates','\x20files\x20to\x20','\x20\x20Target:\x20','counts','repeat','1kNYMPd','absolutePath','filter','engage_workspace','hasChanges','targetDir','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20new\x20files','7260204GzRZiL','workspace','306962uhCAlk','templates','name','3854841Vdhjnh','setPhase','\x0aError:','3957506YnazFK','config','\x0aChanges\x20to\x20\x27','error','yes','dirname','dim','\x20changed\x20files','✔\x20Context\x20set:\x20','1791300SnLhpE','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','yellow','cyan','isNew','2670524ltjXfp','relativePath','Pull\x20templates\x20to\x20YAML\x20files','-\x20no\x20files\x20written','files','green','Workspace\x20is\x20required.','workspaceName','data','\x20unchanged\x20files','9218344TPJByP','\x20files?','red'];a23_0x4cd5=function(){return _0x3a33ea;};return a23_0x4cd5();}import{pullTemplates}from'../sdk/engage/template-pull.js';function a23_0x5d85(_0x3e43a5,_0x58d192){_0x3e43a5=_0x3e43a5-0x1d1;const _0x4cd59c=a23_0x4cd5();let _0x5d85df=_0x4cd59c[_0x3e43a5];return _0x5d85df;}export class EngageTemplatePullCommand extends BaseCommand{[a23_0x1918ba(0x1e8)]=a23_0x1918ba(0x209);[a23_0x1918ba(0x1d3)]=a23_0x1918ba(0x1fc);async[a23_0x1918ba(0x20f)](_0x451d44){const _0x3dbeea=a23_0x1918ba,{options:_0x322a34,args:_0x1fdab5,tdx:_0x3addc0}=_0x451d44,_0x3e19f1=_0x322a34,_0x4fb859=await resolveWorkspaceName(_0x1fdab5[0x0],_0x3e19f1);if(!_0x4fb859)return console['error'](a23_0x362d74[_0x3dbeea(0x1f7)](_0x3dbeea(0x200))),console[_0x3dbeea(0x1ef)](_0x3dbeea(0x20e)),console['error'](_0x3dbeea(0x208)),console[_0x3dbeea(0x1ef)](_0x3dbeea(0x1f6)),0x1;const _0x2c86da=await withProgressSpinner(_0x3dbeea(0x1d1)+_0x4fb859+_0x3dbeea(0x1d2),_0x3571cc=>pullTemplates({'engage':_0x3addc0[_0x3dbeea(0x20d)]},_0x4fb859,{'templateName':_0x3e19f1[_0x3dbeea(0x1e8)],'progress':{'update':_0x36b411=>{const _0x26cced=_0x3dbeea;_0x3571cc[_0x26cced(0x1ea)](_0x36b411);}}}),{'verbose':_0x3e19f1[_0x3dbeea(0x211)]}),_0x133dc6=_0x2c86da[_0x3dbeea(0x202)];if(_0x133dc6['counts'][_0x3dbeea(0x1e7)]===0x0)return console[_0x3dbeea(0x1ef)](a23_0x362d74[_0x3dbeea(0x1f7)](_0x3dbeea(0x213)+_0x133dc6['workspaceName']+'\x27')),0x0;const _0x23730c=_0x133dc6[_0x3dbeea(0x1fe)][_0x3dbeea(0x1de)](_0x4e5c1f=>_0x4e5c1f[_0x3dbeea(0x1f9)]),_0x23aba2=_0x133dc6[_0x3dbeea(0x1fe)][_0x3dbeea(0x1de)](_0x44047b=>!_0x44047b[_0x3dbeea(0x1f9)]&&_0x44047b[_0x3dbeea(0x1e0)]),_0x444d98=_0x133dc6[_0x3dbeea(0x1fe)]['filter'](_0x47c6b5=>!_0x47c6b5[_0x3dbeea(0x1f9)]&&!_0x47c6b5['hasChanges']);console[_0x3dbeea(0x1ef)](_0x3dbeea(0x20c)+_0x133dc6[_0x3dbeea(0x201)]+'\x27:'),console['error']('\x20\x20'+a23_0x362d74[_0x3dbeea(0x1f8)](_0x133dc6[_0x3dbeea(0x1da)]['templates']+_0x3dbeea(0x1d7))),console[_0x3dbeea(0x1ef)]('\x20\x20'+a23_0x362d74[_0x3dbeea(0x1ff)]('+\x20'+_0x23730c['length']+_0x3dbeea(0x1e3))),console['error']('\x20\x20'+a23_0x362d74[_0x3dbeea(0x1f7)]('~\x20'+_0x23aba2[_0x3dbeea(0x207)]+_0x3dbeea(0x1f3))),console[_0x3dbeea(0x1ef)]('\x20\x20'+a23_0x362d74[_0x3dbeea(0x1f2)]('=\x20'+_0x444d98[_0x3dbeea(0x207)]+_0x3dbeea(0x203))),console['error'](_0x3dbeea(0x1d9)+a23_0x362d74[_0x3dbeea(0x1f8)](_0x133dc6[_0x3dbeea(0x1e1)])+'\x0a');if(_0x23aba2[_0x3dbeea(0x207)]>0x0)for(const _0x404312 of _0x23aba2){console[_0x3dbeea(0x1ef)](_0x3dbeea(0x1ee)+_0x404312[_0x3dbeea(0x1fb)]+'\x27:'),console[_0x3dbeea(0x1ef)]('─'[_0x3dbeea(0x1db)](0x3c)),console[_0x3dbeea(0x1ef)](_0x404312['diff']),console['error']('─'[_0x3dbeea(0x1db)](0x3c));}if(_0x3e19f1['dryRun'])return console[_0x3dbeea(0x1ef)](a23_0x362d74[_0x3dbeea(0x1f7)](_0x3dbeea(0x1d5))),0x0;if(_0x23730c['length']===0x0&&_0x23aba2[_0x3dbeea(0x207)]===0x0)return console[_0x3dbeea(0x1ef)](a23_0x362d74[_0x3dbeea(0x1ff)](_0x3dbeea(0x1e2))),saveSessionContext({'engage_workspace':_0x133dc6[_0x3dbeea(0x201)]},_0x3e19f1['session']),0x0;if(!_0x3e19f1[_0x3dbeea(0x1f0)]){if(!isInteractive())return console[_0x3dbeea(0x1ef)](a23_0x362d74[_0x3dbeea(0x206)](_0x3dbeea(0x1eb)),_0x3dbeea(0x210)),console['error'](a23_0x362d74['dim'](_0x3dbeea(0x20a))),0x1;const _0x37774e=await confirmKey('Write\x20'+(_0x23730c[_0x3dbeea(0x207)]+_0x23aba2[_0x3dbeea(0x207)])+_0x3dbeea(0x205));if(!_0x37774e)return console[_0x3dbeea(0x1ef)](a23_0x362d74['yellow'](_0x3dbeea(0x20b)),_0x3dbeea(0x1fd)),0x1;}for(const _0x3b60ff of _0x133dc6[_0x3dbeea(0x1fe)]){if(_0x3b60ff[_0x3dbeea(0x1f9)]||_0x3b60ff[_0x3dbeea(0x1e0)]){const _0x12d61c=a23_0x2bd8e7[_0x3dbeea(0x1f1)](_0x3b60ff[_0x3dbeea(0x1dd)]);!existsSync(_0x12d61c)&&mkdirSync(_0x12d61c,{'recursive':!![]}),writeFileSync(_0x3b60ff['absolutePath'],_0x3b60ff[_0x3dbeea(0x1d4)],'utf-8');}}return console[_0x3dbeea(0x1ef)](a23_0x362d74[_0x3dbeea(0x1ff)](_0x3dbeea(0x1d6)+(_0x23730c['length']+_0x23aba2['length'])+_0x3dbeea(0x1d8)+_0x133dc6[_0x3dbeea(0x1e1)])),saveSessionContext({'engage_workspace':_0x133dc6['workspaceName']},_0x3e19f1['session']),console[_0x3dbeea(0x1ef)](a23_0x362d74[_0x3dbeea(0x1ff)](_0x3dbeea(0x1f4)+a23_0x362d74[_0x3dbeea(0x1f2)](_0x3dbeea(0x1df))+_0x3dbeea(0x212)+a23_0x362d74['cyan'](_0x133dc6[_0x3dbeea(0x201)]))),0x0;}}async function resolveWorkspaceName(_0x1c8495,_0x45dc78){const _0x337c=a23_0x1918ba;if(_0x1c8495)return _0x1c8495;if(_0x45dc78['workspace'])return _0x45dc78[_0x337c(0x1e5)];const _0x155029=tryFindTdxConfig(process['cwd']());if(_0x155029?.[_0x337c(0x1ed)][_0x337c(0x1df)])return _0x155029[_0x337c(0x1ed)]['engage_workspace'];const _0x4ec572=loadSessionContext(_0x45dc78['session']);if(_0x4ec572?.[_0x337c(0x1df)])return _0x4ec572[_0x337c(0x1df)];return undefined;}
1
+ const a23_0x3f5677=a23_0x3089;(function(_0x10beae,_0x1cd684){const _0x212976=a23_0x3089,_0x44733e=_0x10beae();while(!![]){try{const _0x5b179f=-parseInt(_0x212976(0x110))/0x1*(-parseInt(_0x212976(0xea))/0x2)+parseInt(_0x212976(0xf0))/0x3*(parseInt(_0x212976(0x10a))/0x4)+parseInt(_0x212976(0x10e))/0x5+parseInt(_0x212976(0xfb))/0x6*(parseInt(_0x212976(0x100))/0x7)+-parseInt(_0x212976(0xfd))/0x8+-parseInt(_0x212976(0xf3))/0x9+parseInt(_0x212976(0x11e))/0xa;if(_0x5b179f===_0x1cd684)break;else _0x44733e['push'](_0x44733e['shift']());}catch(_0x4909af){_0x44733e['push'](_0x44733e['shift']());}}}(a23_0x52b8,0x2ffc8));function a23_0x52b8(){const _0x3bfd8c=['2871828STwbNc','absolutePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20unchanged\x20files','verbose','Pulling\x20templates\x20from\x20\x27','filter','diff','6eVxIMj','✔\x20All\x20files\x20are\x20up\x20to\x20date','2343952SuKwDX','\x0aError:','✔\x20Pulled\x20','1204119lekHLv','yellow','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','config','yes','content','cyan','dim','-\x20no\x20files\x20written','\x20new\x20files','8wtWwhE','repeat','\x20=\x20','\x20templates','874710aPnzzc','engage_workspace','181585fKNuWS','name','\x0aChanges\x20to\x20\x27','isNew','✔\x20Context\x20set:\x20','session','workspace','Workspace\x20is\x20required.','relativePath','workspaceName','execute','engage:template:pull','dryRun','description','956730Tgxdaw','\x20\x20Target:\x20','length','\x20files?','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','green','templates','\x0aPull\x20summary\x20for\x20workspace\x20\x27','counts','data','4jTtWPQ','No\x20templates\x20found\x20in\x20workspace\x20\x27','hasChanges','red','error','Aborted.','4254zlDksr','files','\x20files\x20to\x20'];a23_0x52b8=function(){return _0x3bfd8c;};return a23_0x52b8();}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';function a23_0x3089(_0x45f1f7,_0x10bf14){_0x45f1f7=_0x45f1f7-0xe9;const _0x52b872=a23_0x52b8();let _0x308953=_0x52b872[_0x45f1f7];return _0x308953;}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a23_0xe52875 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x56c751 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a23_0x3f5677(0x111)]=a23_0x3f5677(0x11b);[a23_0x3f5677(0x11d)]='Pull\x20templates\x20to\x20YAML\x20files';async[a23_0x3f5677(0x11a)](_0x2c437b){const _0x2554b1=a23_0x3f5677,{options:_0x53104d,args:_0x555aa4,tdx:_0xdabfc6}=_0x2c437b,_0x3e072a=_0x53104d,_0xa8cb07=await resolveWorkspaceName(_0x555aa4[0x0],_0x3e072a);if(!_0xa8cb07)return console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x101)](_0x2554b1(0x117))),console[_0x2554b1(0xee)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console['error'](_0x2554b1(0x122)),console[_0x2554b1(0xee)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;const _0x19ee35=await withProgressSpinner(_0x2554b1(0xf8)+_0xa8cb07+'\x27...',_0x653b64=>pullTemplates({'engage':_0xdabfc6['engage']},_0xa8cb07,{'templateName':_0x3e072a['name'],'progress':{'update':_0x3f7b0f=>{_0x653b64['setPhase'](_0x3f7b0f);}}}),{'verbose':_0x3e072a[_0x2554b1(0xf7)]}),_0x5ba044=_0x19ee35[_0x2554b1(0xe9)];if(_0x5ba044['counts'][_0x2554b1(0x125)]===0x0)return console['error'](a23_0xe52875[_0x2554b1(0x101)](_0x2554b1(0xeb)+_0x5ba044[_0x2554b1(0x119)]+'\x27')),0x0;const _0x55ee36=_0x5ba044[_0x2554b1(0xf1)]['filter'](_0x463036=>_0x463036[_0x2554b1(0x113)]),_0x566846=_0x5ba044[_0x2554b1(0xf1)][_0x2554b1(0xf9)](_0x73a65=>!_0x73a65[_0x2554b1(0x113)]&&_0x73a65['hasChanges']),_0x92382a=_0x5ba044[_0x2554b1(0xf1)][_0x2554b1(0xf9)](_0x898a31=>!_0x898a31[_0x2554b1(0x113)]&&!_0x898a31['hasChanges']);console[_0x2554b1(0xee)](_0x2554b1(0x126)+_0x5ba044[_0x2554b1(0x119)]+'\x27:'),console[_0x2554b1(0xee)]('\x20\x20'+a23_0xe52875[_0x2554b1(0x106)](_0x5ba044[_0x2554b1(0x127)][_0x2554b1(0x125)]+_0x2554b1(0x10d))),console[_0x2554b1(0xee)]('\x20\x20'+a23_0xe52875[_0x2554b1(0x124)]('+\x20'+_0x55ee36[_0x2554b1(0x120)]+_0x2554b1(0x109))),console[_0x2554b1(0xee)]('\x20\x20'+a23_0xe52875['yellow']('~\x20'+_0x566846[_0x2554b1(0x120)]+'\x20changed\x20files')),console[_0x2554b1(0xee)]('\x20\x20'+a23_0xe52875[_0x2554b1(0x107)]('=\x20'+_0x92382a[_0x2554b1(0x120)]+_0x2554b1(0xf6))),console[_0x2554b1(0xee)](_0x2554b1(0x11f)+a23_0xe52875[_0x2554b1(0x106)](_0x5ba044['targetDir'])+'\x0a');if(_0x566846['length']>0x0)for(const _0x5c2fa7 of _0x566846){console[_0x2554b1(0xee)](_0x2554b1(0x112)+_0x5c2fa7[_0x2554b1(0x118)]+'\x27:'),console[_0x2554b1(0xee)]('─'[_0x2554b1(0x10b)](0x3c)),console['error'](_0x5c2fa7[_0x2554b1(0xfa)]),console['error']('─'[_0x2554b1(0x10b)](0x3c));}if(_0x3e072a[_0x2554b1(0x11c)])return console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x101)](_0x2554b1(0xf5))),0x0;if(_0x55ee36['length']===0x0&&_0x566846['length']===0x0)return console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x124)](_0x2554b1(0xfc))),saveSessionContext({'engage_workspace':_0x5ba044[_0x2554b1(0x119)]},_0x3e072a['session']),0x0;if(!_0x3e072a[_0x2554b1(0x104)]){if(!isInteractive())return console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0xed)](_0x2554b1(0xfe)),_0x2554b1(0x123)),console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x107)](_0x2554b1(0x102))),0x1;const _0x416f91=await confirmKey('Write\x20'+(_0x55ee36[_0x2554b1(0x120)]+_0x566846[_0x2554b1(0x120)])+_0x2554b1(0x121));if(!_0x416f91)return console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x101)](_0x2554b1(0xef)),_0x2554b1(0x108)),0x1;}for(const _0x14b4d4 of _0x5ba044[_0x2554b1(0xf1)]){if(_0x14b4d4[_0x2554b1(0x113)]||_0x14b4d4[_0x2554b1(0xec)]){const _0x53fae0=a23_0x56c751['dirname'](_0x14b4d4['absolutePath']);!existsSync(_0x53fae0)&&mkdirSync(_0x53fae0,{'recursive':!![]}),writeFileSync(_0x14b4d4[_0x2554b1(0xf4)],_0x14b4d4[_0x2554b1(0x105)],'utf-8');}}return console['error'](a23_0xe52875[_0x2554b1(0x124)](_0x2554b1(0xff)+(_0x55ee36[_0x2554b1(0x120)]+_0x566846[_0x2554b1(0x120)])+_0x2554b1(0xf2)+_0x5ba044['targetDir'])),saveSessionContext({'engage_workspace':_0x5ba044[_0x2554b1(0x119)]},_0x3e072a['session']),console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x124)](_0x2554b1(0x114)+a23_0xe52875[_0x2554b1(0x107)](_0x2554b1(0x10f))+_0x2554b1(0x10c)+a23_0xe52875[_0x2554b1(0x106)](_0x5ba044[_0x2554b1(0x119)]))),0x0;}}async function resolveWorkspaceName(_0x200793,_0x33e45e){const _0x2bea50=a23_0x3f5677;if(_0x200793)return _0x200793;if(_0x33e45e[_0x2bea50(0x116)])return _0x33e45e[_0x2bea50(0x116)];const _0xe6af16=tryFindTdxConfig(process['cwd']());if(_0xe6af16?.[_0x2bea50(0x103)][_0x2bea50(0x10f)])return _0xe6af16['config'][_0x2bea50(0x10f)];const _0x39a89f=loadSessionContext(_0x33e45e[_0x2bea50(0x115)]);if(_0x39a89f?.[_0x2bea50(0x10f)])return _0x39a89f[_0x2bea50(0x10f)];return undefined;}
@@ -1 +1 @@
1
- const a24_0x5b5d34=a24_0x2950;(function(_0x6b801d,_0x2c0abc){const _0x452462=a24_0x2950,_0x290114=_0x6b801d();while(!![]){try{const _0x4e7d81=parseInt(_0x452462(0xf1))/0x1*(parseInt(_0x452462(0xe4))/0x2)+-parseInt(_0x452462(0x10e))/0x3*(parseInt(_0x452462(0x110))/0x4)+-parseInt(_0x452462(0xf7))/0x5*(parseInt(_0x452462(0x104))/0x6)+-parseInt(_0x452462(0x107))/0x7*(-parseInt(_0x452462(0x10a))/0x8)+-parseInt(_0x452462(0xe0))/0x9+parseInt(_0x452462(0xf6))/0xa+-parseInt(_0x452462(0xf8))/0xb*(-parseInt(_0x452462(0xff))/0xc);if(_0x4e7d81===_0x2c0abc)break;else _0x290114['push'](_0x290114['shift']());}catch(_0x2ca28f){_0x290114['push'](_0x290114['shift']());}}}(a24_0xab52,0xe303c));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';function a24_0xab52(){const _0x40c6ae=['dryRun','Preparing\x20push\x20to\x20workspace\x20\x27','12717360ylxiOv','5405gHrhiM','11Cxmfug','yellow','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','engage','\x20templates\x20to\x20update:','resolveWorkspaceId','\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','10510116QSGXJe','Push\x20','cyan','engage:template:push','site','8454YmtEdM','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','updated','14pYUXfI','def','\x20template\x20files','4921960NhrhtS','description','\x20errors:','yes','153tlRJVY','create','115980NiwKws','green','error','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','errors','Aborted.','Resolving\x20references...','action','path','templateId','relativePath','red','update','\x20\x20\x20\x20','name','1\x20template\x20file:\x20','workspace','\x20templates','length','setPhase','valid','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','\x20templates?','created','\x0aPush\x20summary\x20for\x20workspace\x20\x27','\x0aError:','resolve','No\x20template\x20YAML\x20files\x20found\x20in\x20','1575387NhinBG','✔\x20All\x20templates\x20are\x20up\x20to\x20date','engage_workspace','-\x20no\x20changes\x20applied','100UeKSmb','\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)','config','message','dim','warnings','\x20new\x20templates:','Pushing\x20templates...','data','Workspace\x20is\x20required.','session','verbose','\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','14574vdnNlz','filter','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'];a24_0xab52=function(){return _0x40c6ae;};return a24_0xab52();}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x4394bf from'chalk';function a24_0x2950(_0x359c81,_0x43f1b1){_0x359c81=_0x359c81-0xda;const _0xab52d9=a24_0xab52();let _0x295084=_0xab52d9[_0x359c81];return _0x295084;}import a24_0x215725 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{[a24_0x5b5d34(0x11f)]=a24_0x5b5d34(0x102);[a24_0x5b5d34(0x10b)]=a24_0x5b5d34(0x126);async['execute'](_0x561da6){const _0x9b1cac=a24_0x5b5d34,{options:_0x465b57,args:_0x2b936f,tdx:_0xa60b73}=_0x561da6,_0x1fe7c8=_0x465b57,_0x10d4b8=_0x2b936f[0x0],_0x3e3307=_0x10d4b8?a24_0x215725[_0x9b1cac(0xde)](_0x10d4b8):undefined,_0x21369b=_0x3e3307?isYamlFile(_0x3e3307):![];let _0x1956d7;if(_0x21369b&&_0x3e3307)_0x1956d7=a24_0x215725['dirname'](_0x3e3307);else _0x3e3307?_0x1956d7=_0x3e3307:_0x1956d7=process['cwd']();let _0x36fae4;const _0xd3f984=tryFindTdxConfig(_0x1956d7);_0xd3f984?.[_0x9b1cac(0xe6)]['engage_workspace']&&(_0x36fae4=_0xd3f984['config']['engage_workspace'],!_0x21369b&&(_0x1956d7=_0xd3f984['configDir']));_0x1fe7c8[_0x9b1cac(0x121)]&&(_0x36fae4=_0x1fe7c8['workspace']);if(!_0x36fae4){const _0x4eb205=loadSessionContext(_0x1fe7c8[_0x9b1cac(0xee)]);_0x4eb205?.[_0x9b1cac(0xe2)]&&(_0x36fae4=_0x4eb205[_0x9b1cac(0xe2)]);}if(!_0x36fae4)return console[_0x9b1cac(0x112)](a24_0x4394bf[_0x9b1cac(0xf9)](_0x9b1cac(0xed))),console[_0x9b1cac(0x112)](_0x9b1cac(0xf0)),console[_0x9b1cac(0x112)](_0x9b1cac(0xe5)),console[_0x9b1cac(0x112)](_0x9b1cac(0xfe)),console[_0x9b1cac(0x112)](_0x9b1cac(0x114)),0x1;let _0x2cc7ec;_0x21369b&&_0x3e3307?_0x2cc7ec=[parseTemplateFile(_0x3e3307,a24_0x215725['dirname'](_0x3e3307))]:_0x2cc7ec=discoverAndParseTemplateFiles(_0x1956d7);if(_0x2cc7ec[_0x9b1cac(0x123)]===0x0)return console['error'](a24_0x4394bf[_0x9b1cac(0xf9)](_0x9b1cac(0xdf)+_0x1956d7)),console[_0x9b1cac(0x112)](a24_0x4394bf[_0x9b1cac(0xe8)](_0x9b1cac(0x113))),0x1;const _0x34005c=_0x2cc7ec[_0x9b1cac(0x123)]===0x1?_0x9b1cac(0x120)+_0x2cc7ec[0x0][_0x9b1cac(0x108)][_0x9b1cac(0x11f)]:_0x2cc7ec[_0x9b1cac(0x123)]+_0x9b1cac(0x109);console['error']('Found\x20'+a24_0x4394bf[_0x9b1cac(0x101)](_0x34005c));let _0x20bb84=![];for(const _0x5a9b30 of _0x2cc7ec){const _0x4f16ff=validateTemplateDef(_0x5a9b30['def']);if(!_0x4f16ff[_0x9b1cac(0x125)]){_0x20bb84=!![],console[_0x9b1cac(0x112)](a24_0x4394bf[_0x9b1cac(0x11c)]('\x0aValidation\x20errors\x20in\x20'+_0x5a9b30[_0x9b1cac(0x11b)]+':'));for(const _0x47327c of _0x4f16ff['errors']){console['error']('\x20\x20'+a24_0x4394bf[_0x9b1cac(0x11c)]('✗')+'\x20'+_0x47327c[_0x9b1cac(0x119)]+':\x20'+_0x47327c[_0x9b1cac(0xe7)]);}}for(const _0x1603dd of _0x4f16ff[_0x9b1cac(0xe9)]){console[_0x9b1cac(0x112)]('\x20\x20'+a24_0x4394bf['yellow']('⚠')+'\x20'+_0x1603dd[_0x9b1cac(0x119)]+':\x20'+_0x1603dd['message']);}}if(_0x20bb84)return console[_0x9b1cac(0x112)](a24_0x4394bf[_0x9b1cac(0x11c)](_0x9b1cac(0xfa))),0x1;const _0x22ef7e=await _0xa60b73[_0x9b1cac(0xfb)][_0x9b1cac(0xfd)](_0x36fae4),_0x1d35e8=await withProgressSpinner(_0x9b1cac(0xf5)+_0x36fae4+'\x27...',_0x280d66=>preparePush({'engage':_0xa60b73[_0x9b1cac(0xfb)]},_0x2cc7ec,_0x22ef7e,{'progress':{'update':_0x8071c4=>_0x280d66['setPhase'](_0x8071c4)}}),{'verbose':_0x1fe7c8['verbose']}),_0x4673c9=_0x1d35e8[_0x9b1cac(0xec)];await withProgressSpinner(_0x9b1cac(0x117),_0x3e3dfa=>resolveAndBuildInputs({'engage':_0xa60b73['engage']},_0x4673c9,_0x22ef7e,{'progress':{'update':_0x4ff19b=>_0x3e3dfa[_0x9b1cac(0x124)](_0x4ff19b)}}),{'verbose':_0x1fe7c8[_0x9b1cac(0xef)]});const _0x3cf77c=_0x4673c9['filter'](_0x3f7a3e=>_0x3f7a3e[_0x9b1cac(0x118)]===_0x9b1cac(0x10f)),_0x4778f6=_0x4673c9[_0x9b1cac(0xf2)](_0x35e7c8=>_0x35e7c8[_0x9b1cac(0x118)]===_0x9b1cac(0x11d));console[_0x9b1cac(0x112)](_0x9b1cac(0xdc)+_0x36fae4+'\x27:');if(_0x3cf77c[_0x9b1cac(0x123)]>0x0){console[_0x9b1cac(0x112)]('\x20\x20'+a24_0x4394bf[_0x9b1cac(0x111)]('+\x20'+_0x3cf77c[_0x9b1cac(0x123)]+_0x9b1cac(0xea)));for(const _0x218460 of _0x3cf77c){console[_0x9b1cac(0x112)](_0x9b1cac(0x11e)+a24_0x4394bf[_0x9b1cac(0x111)]('+')+'\x20'+_0x218460[_0x9b1cac(0x108)][_0x9b1cac(0x11f)]);}}if(_0x4778f6[_0x9b1cac(0x123)]>0x0){console[_0x9b1cac(0x112)]('\x20\x20'+a24_0x4394bf[_0x9b1cac(0xf9)]('~\x20'+_0x4778f6['length']+_0x9b1cac(0xfc)));for(const _0x4f3be7 of _0x4778f6){console['error'](_0x9b1cac(0x11e)+a24_0x4394bf[_0x9b1cac(0xf9)]('~')+'\x20'+_0x4f3be7['def'][_0x9b1cac(0x11f)]);}}if(_0x3cf77c['length']===0x0&&_0x4778f6[_0x9b1cac(0x123)]===0x0)return console['error'](a24_0x4394bf[_0x9b1cac(0x111)](_0x9b1cac(0xe1))),0x0;if(_0x1fe7c8[_0x9b1cac(0xf4)])return console[_0x9b1cac(0x112)](a24_0x4394bf[_0x9b1cac(0xf9)](_0x9b1cac(0x105))),0x0;if(!_0x1fe7c8[_0x9b1cac(0x10d)]){if(!isInteractive())return console[_0x9b1cac(0x112)](a24_0x4394bf[_0x9b1cac(0x11c)](_0x9b1cac(0xdd)),_0x9b1cac(0xf3)),console[_0x9b1cac(0x112)](a24_0x4394bf['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x49accb=await confirmKey(_0x9b1cac(0x100)+(_0x3cf77c[_0x9b1cac(0x123)]+_0x4778f6[_0x9b1cac(0x123)])+_0x9b1cac(0xda));if(!_0x49accb)return console['error'](a24_0x4394bf[_0x9b1cac(0xf9)](_0x9b1cac(0x116)),_0x9b1cac(0xe3)),0x1;}const _0x1df522=await withProgressSpinner(_0x9b1cac(0xeb),_0x528454=>executePush({'engage':_0xa60b73['engage']},_0x4673c9,{'progress':{'update':_0x45d1cd=>_0x528454['setPhase'](_0x45d1cd)}}),{'verbose':_0x1fe7c8['verbose']}),_0x3a3543=_0x1df522[_0x9b1cac(0xec)];for(const _0x240955 of _0x3a3543['results']){if(_0x240955['templateId']&&(_0x240955[_0x9b1cac(0x118)]===_0x9b1cac(0xdb)||_0x240955[_0x9b1cac(0x118)]===_0x9b1cac(0x106))){const _0x2b5db4=getTemplateUrl(_0x1fe7c8[_0x9b1cac(0x103)],_0x22ef7e,_0x240955[_0x9b1cac(0x11a)]),_0x2d0932=_0x240955['action']===_0x9b1cac(0xdb)?'+':'~',_0x5ac60d=_0x240955['action']===_0x9b1cac(0xdb)?a24_0x4394bf[_0x9b1cac(0x111)](_0x2d0932):a24_0x4394bf[_0x9b1cac(0xf9)](_0x2d0932);console['error']('\x20\x20'+_0x5ac60d+'\x20'+hyperlink(_0x240955[_0x9b1cac(0x11f)],_0x2b5db4)+'\x20'+a24_0x4394bf[_0x9b1cac(0xe8)](_0x2b5db4));}}_0x3a3543[_0x9b1cac(0xdb)]>0x0&&console[_0x9b1cac(0x112)](a24_0x4394bf[_0x9b1cac(0x111)]('✔\x20Created\x20'+_0x3a3543[_0x9b1cac(0xdb)]+_0x9b1cac(0x122)));_0x3a3543[_0x9b1cac(0x106)]>0x0&&console[_0x9b1cac(0x112)](a24_0x4394bf[_0x9b1cac(0x111)]('✔\x20Updated\x20'+_0x3a3543[_0x9b1cac(0x106)]+'\x20templates'));if(_0x3a3543[_0x9b1cac(0x115)][_0x9b1cac(0x123)]>0x0){console['error'](a24_0x4394bf['red']('✘\x20'+_0x3a3543['errors'][_0x9b1cac(0x123)]+_0x9b1cac(0x10c)));for(const _0x1fe4df of _0x3a3543['errors']){console[_0x9b1cac(0x112)]('\x20\x20'+a24_0x4394bf['red'](_0x1fe4df[_0x9b1cac(0x11f)])+':\x20'+_0x1fe4df[_0x9b1cac(0x112)]);}}return saveSessionContext({'engage_workspace':_0x36fae4},_0x1fe7c8[_0x9b1cac(0xee)]),_0x3a3543[_0x9b1cac(0x115)]['length']>0x0?0x1:0x0;}}
1
+ const a24_0x54df44=a24_0x2f19;(function(_0x112fab,_0x1c7dfa){const _0xd66ee5=a24_0x2f19,_0x591355=_0x112fab();while(!![]){try{const _0x332326=parseInt(_0xd66ee5(0x162))/0x1+parseInt(_0xd66ee5(0x14d))/0x2+-parseInt(_0xd66ee5(0x15b))/0x3+-parseInt(_0xd66ee5(0x130))/0x4*(parseInt(_0xd66ee5(0x13c))/0x5)+parseInt(_0xd66ee5(0x12d))/0x6+-parseInt(_0xd66ee5(0x134))/0x7*(parseInt(_0xd66ee5(0x12b))/0x8)+parseInt(_0xd66ee5(0x156))/0x9*(parseInt(_0xd66ee5(0x150))/0xa);if(_0x332326===_0x1c7dfa)break;else _0x591355['push'](_0x591355['shift']());}catch(_0x4c5b41){_0x591355['push'](_0x591355['shift']());}}}(a24_0x7090,0x55d66));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a24_0x2f19(_0x42ae06,_0x429a19){_0x42ae06=_0x42ae06-0x11d;const _0x709012=a24_0x7090();let _0x2f1906=_0x709012[_0x42ae06];return _0x2f1906;}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';function a24_0x7090(){const _0x4300b8=['engage:template:push','results','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\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','\x20templates','filter','No\x20template\x20YAML\x20files\x20found\x20in\x20','Aborted.','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','templateId','def','1\x20template\x20file:\x20','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\x20template\x20files','yes','length','verbose','updated','56gzZdDW','resolve','1950672WKTnQP','action','engage_workspace','1144KMgfIT','description','errors','engage','220339pPjKOm','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20Updated\x20','\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)','dirname','Pushing\x20templates...','execute','name','355QUBKST','red','create','\x20new\x20templates:','dim','✔\x20All\x20templates\x20are\x20up\x20to\x20date','config','dryRun','warnings','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aValidation\x20errors\x20in\x20','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','Found\x20','error','path','Resolving\x20references...','Preparing\x20push\x20to\x20workspace\x20\x27','80974rtUpiV','\x20templates?','session','2785190OsrkRJ','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','workspace','\x20\x20\x20\x20','Workspace\x20is\x20required.','\x27...','9RxCDsw','created','\x20errors:','green','yellow','1993788UTKQDp','cwd','✔\x20Created\x20','site','setPhase','configDir','\x0aPush\x20summary\x20for\x20workspace\x20\x27','612713wCPtSN','data','\x0aError:'];a24_0x7090=function(){return _0x4300b8;};return a24_0x7090();}import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x55c4ca from'chalk';import a24_0x2cd2a9 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{[a24_0x54df44(0x13b)]=a24_0x54df44(0x165);[a24_0x54df44(0x131)]=a24_0x54df44(0x147);async[a24_0x54df44(0x13a)](_0x1fa666){const _0x8cfd28=a24_0x54df44,{options:_0x62dff0,args:_0x14380b,tdx:_0x4890fc}=_0x1fa666,_0x26f912=_0x62dff0,_0x2381f6=_0x14380b[0x0],_0xef54a6=_0x2381f6?a24_0x2cd2a9[_0x8cfd28(0x12c)](_0x2381f6):undefined,_0x4b6115=_0xef54a6?isYamlFile(_0xef54a6):![];let _0x451d0d;if(_0x4b6115&&_0xef54a6)_0x451d0d=a24_0x2cd2a9[_0x8cfd28(0x138)](_0xef54a6);else _0xef54a6?_0x451d0d=_0xef54a6:_0x451d0d=process[_0x8cfd28(0x15c)]();let _0x4176a6;const _0x2f6343=tryFindTdxConfig(_0x451d0d);_0x2f6343?.['config'][_0x8cfd28(0x12f)]&&(_0x4176a6=_0x2f6343[_0x8cfd28(0x142)][_0x8cfd28(0x12f)],!_0x4b6115&&(_0x451d0d=_0x2f6343[_0x8cfd28(0x160)]));_0x26f912['workspace']&&(_0x4176a6=_0x26f912[_0x8cfd28(0x152)]);if(!_0x4176a6){const _0x22cc55=loadSessionContext(_0x26f912['session']);_0x22cc55?.[_0x8cfd28(0x12f)]&&(_0x4176a6=_0x22cc55[_0x8cfd28(0x12f)]);}if(!_0x4176a6)return console['error'](a24_0x55c4ca[_0x8cfd28(0x15a)](_0x8cfd28(0x154))),console[_0x8cfd28(0x149)](_0x8cfd28(0x168)),console[_0x8cfd28(0x149)](_0x8cfd28(0x137)),console[_0x8cfd28(0x149)](_0x8cfd28(0x121)),console['error'](_0x8cfd28(0x145)),0x1;let _0x4efc91;_0x4b6115&&_0xef54a6?_0x4efc91=[parseTemplateFile(_0xef54a6,a24_0x2cd2a9[_0x8cfd28(0x138)](_0xef54a6))]:_0x4efc91=discoverAndParseTemplateFiles(_0x451d0d);if(_0x4efc91[_0x8cfd28(0x128)]===0x0)return console['error'](a24_0x55c4ca[_0x8cfd28(0x15a)](_0x8cfd28(0x11f)+_0x451d0d)),console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x140)](_0x8cfd28(0x125))),0x1;const _0x2cc601=_0x4efc91[_0x8cfd28(0x128)]===0x1?_0x8cfd28(0x124)+_0x4efc91[0x0][_0x8cfd28(0x123)]['name']:_0x4efc91[_0x8cfd28(0x128)]+_0x8cfd28(0x126);console[_0x8cfd28(0x149)](_0x8cfd28(0x148)+a24_0x55c4ca['cyan'](_0x2cc601));let _0x3b5957=![];for(const _0x2d1ed7 of _0x4efc91){const _0x597072=validateTemplateDef(_0x2d1ed7['def']);if(!_0x597072['valid']){_0x3b5957=!![],console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x13d)](_0x8cfd28(0x146)+_0x2d1ed7['relativePath']+':'));for(const _0x317e77 of _0x597072[_0x8cfd28(0x132)]){console['error']('\x20\x20'+a24_0x55c4ca[_0x8cfd28(0x13d)]('✗')+'\x20'+_0x317e77['path']+':\x20'+_0x317e77['message']);}}for(const _0x290644 of _0x597072[_0x8cfd28(0x144)]){console[_0x8cfd28(0x149)]('\x20\x20'+a24_0x55c4ca['yellow']('⚠')+'\x20'+_0x290644[_0x8cfd28(0x14a)]+':\x20'+_0x290644['message']);}}if(_0x3b5957)return console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x13d)](_0x8cfd28(0x151))),0x1;const _0x43c522=await _0x4890fc['engage']['resolveWorkspaceId'](_0x4176a6),_0x3bf7b3=await withProgressSpinner(_0x8cfd28(0x14c)+_0x4176a6+_0x8cfd28(0x155),_0x37d852=>preparePush({'engage':_0x4890fc['engage']},_0x4efc91,_0x43c522,{'progress':{'update':_0x46566b=>_0x37d852[_0x8cfd28(0x15f)](_0x46566b)}}),{'verbose':_0x26f912[_0x8cfd28(0x129)]}),_0x35d660=_0x3bf7b3[_0x8cfd28(0x163)];await withProgressSpinner(_0x8cfd28(0x14b),_0x11437e=>resolveAndBuildInputs({'engage':_0x4890fc[_0x8cfd28(0x133)]},_0x35d660,_0x43c522,{'progress':{'update':_0x426558=>_0x11437e['setPhase'](_0x426558)}}),{'verbose':_0x26f912[_0x8cfd28(0x129)]});const _0x183072=_0x35d660[_0x8cfd28(0x11e)](_0x25813b=>_0x25813b['action']===_0x8cfd28(0x13e)),_0x30766e=_0x35d660[_0x8cfd28(0x11e)](_0x42da86=>_0x42da86['action']==='update');console['error'](_0x8cfd28(0x161)+_0x4176a6+'\x27:');if(_0x183072['length']>0x0){console[_0x8cfd28(0x149)]('\x20\x20'+a24_0x55c4ca['green']('+\x20'+_0x183072[_0x8cfd28(0x128)]+_0x8cfd28(0x13f)));for(const _0x5e4e8b of _0x183072){console[_0x8cfd28(0x149)](_0x8cfd28(0x153)+a24_0x55c4ca[_0x8cfd28(0x159)]('+')+'\x20'+_0x5e4e8b['def'][_0x8cfd28(0x13b)]);}}if(_0x30766e[_0x8cfd28(0x128)]>0x0){console['error']('\x20\x20'+a24_0x55c4ca[_0x8cfd28(0x15a)]('~\x20'+_0x30766e[_0x8cfd28(0x128)]+'\x20templates\x20to\x20update:'));for(const _0x85d86c of _0x30766e){console[_0x8cfd28(0x149)](_0x8cfd28(0x153)+a24_0x55c4ca[_0x8cfd28(0x15a)]('~')+'\x20'+_0x85d86c[_0x8cfd28(0x123)][_0x8cfd28(0x13b)]);}}if(_0x183072[_0x8cfd28(0x128)]===0x0&&_0x30766e[_0x8cfd28(0x128)]===0x0)return console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x159)](_0x8cfd28(0x141))),0x0;if(_0x26f912[_0x8cfd28(0x143)])return console['error'](a24_0x55c4ca[_0x8cfd28(0x15a)](_0x8cfd28(0x167))),0x0;if(!_0x26f912[_0x8cfd28(0x127)]){if(!isInteractive())return console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x13d)](_0x8cfd28(0x164)),_0x8cfd28(0x135)),console['error'](a24_0x55c4ca[_0x8cfd28(0x140)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3fc99a=await confirmKey('Push\x20'+(_0x183072[_0x8cfd28(0x128)]+_0x30766e[_0x8cfd28(0x128)])+_0x8cfd28(0x14e));if(!_0x3fc99a)return console[_0x8cfd28(0x149)](a24_0x55c4ca['yellow'](_0x8cfd28(0x120)),'-\x20no\x20changes\x20applied'),0x1;}const _0x25f0a3=await withProgressSpinner(_0x8cfd28(0x139),_0x3ef8e4=>executePush({'engage':_0x4890fc[_0x8cfd28(0x133)]},_0x35d660,{'progress':{'update':_0x41712e=>_0x3ef8e4[_0x8cfd28(0x15f)](_0x41712e)}}),{'verbose':_0x26f912['verbose']}),_0x344cf8=_0x25f0a3[_0x8cfd28(0x163)];for(const _0xc17d19 of _0x344cf8[_0x8cfd28(0x166)]){if(_0xc17d19[_0x8cfd28(0x122)]&&(_0xc17d19[_0x8cfd28(0x12e)]==='created'||_0xc17d19[_0x8cfd28(0x12e)]===_0x8cfd28(0x12a))){const _0x1f5fb2=getTemplateUrl(_0x26f912[_0x8cfd28(0x15e)],_0x43c522,_0xc17d19[_0x8cfd28(0x122)]),_0x23e239=_0xc17d19[_0x8cfd28(0x12e)]===_0x8cfd28(0x157)?'+':'~',_0x270e24=_0xc17d19['action']===_0x8cfd28(0x157)?a24_0x55c4ca['green'](_0x23e239):a24_0x55c4ca[_0x8cfd28(0x15a)](_0x23e239);console[_0x8cfd28(0x149)]('\x20\x20'+_0x270e24+'\x20'+hyperlink(_0xc17d19['name'],_0x1f5fb2)+'\x20'+a24_0x55c4ca[_0x8cfd28(0x140)](_0x1f5fb2));}}_0x344cf8[_0x8cfd28(0x157)]>0x0&&console[_0x8cfd28(0x149)](a24_0x55c4ca['green'](_0x8cfd28(0x15d)+_0x344cf8['created']+_0x8cfd28(0x11d)));_0x344cf8[_0x8cfd28(0x12a)]>0x0&&console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x159)](_0x8cfd28(0x136)+_0x344cf8[_0x8cfd28(0x12a)]+_0x8cfd28(0x11d)));if(_0x344cf8[_0x8cfd28(0x132)]['length']>0x0){console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x13d)]('✘\x20'+_0x344cf8[_0x8cfd28(0x132)][_0x8cfd28(0x128)]+_0x8cfd28(0x158)));for(const _0xc8380c of _0x344cf8[_0x8cfd28(0x132)]){console['error']('\x20\x20'+a24_0x55c4ca[_0x8cfd28(0x13d)](_0xc8380c[_0x8cfd28(0x13b)])+':\x20'+_0xc8380c['error']);}}return saveSessionContext({'engage_workspace':_0x4176a6},_0x26f912[_0x8cfd28(0x14f)]),_0x344cf8[_0x8cfd28(0x132)][_0x8cfd28(0x128)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a25_0xf34920=a25_0x149e;(function(_0xebdd28,_0x375e07){const _0x4ee1ca=a25_0x149e,_0x3e480f=_0xebdd28();while(!![]){try{const _0x10b2c6=-parseInt(_0x4ee1ca(0x11a))/0x1*(parseInt(_0x4ee1ca(0xec))/0x2)+parseInt(_0x4ee1ca(0x11b))/0x3+-parseInt(_0x4ee1ca(0x100))/0x4+parseInt(_0x4ee1ca(0x10a))/0x5*(-parseInt(_0x4ee1ca(0x101))/0x6)+parseInt(_0x4ee1ca(0x102))/0x7*(parseInt(_0x4ee1ca(0xf6))/0x8)+-parseInt(_0x4ee1ca(0x105))/0x9*(-parseInt(_0x4ee1ca(0x11d))/0xa)+parseInt(_0x4ee1ca(0xfa))/0xb;if(_0x10b2c6===_0x375e07)break;else _0x3e480f['push'](_0x3e480f['shift']());}catch(_0x5d14a1){_0x3e480f['push'](_0x3e480f['shift']());}}}(a25_0x5c6b,0x5bac6));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a25_0x149e(_0x39f731,_0x4454d7){_0x39f731=_0x39f731-0xec;const _0x5c6bdc=a25_0x5c6b();let _0x149ec5=_0x5c6bdc[_0x39f731];return _0x149ec5;}import a25_0x5421ca from'chalk';import a25_0xb5ee2c from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0xf34920(0x103)]=a25_0xf34920(0xf8);[a25_0xf34920(0xed)]=a25_0xf34920(0xf4);async[a25_0xf34920(0x106)](_0x1ac0e3){const _0x4606f2=a25_0xf34920,{options:_0x4bfe23,args:_0x3276e5}=_0x1ac0e3,_0x30b552=_0x4bfe23,_0x2d8e69=_0x3276e5[0x0],_0x2cb6fd=_0x2d8e69?a25_0xb5ee2c[_0x4606f2(0xf1)](_0x2d8e69):undefined,_0x546730=_0x2cb6fd?isYamlFile(_0x2cb6fd):![];let _0x43879d,_0x19e17a;if(_0x546730&&_0x2cb6fd)_0x43879d=a25_0xb5ee2c[_0x4606f2(0x10f)](_0x2cb6fd),_0x19e17a=_0x2cb6fd;else _0x2cb6fd?_0x43879d=_0x2cb6fd:_0x43879d=process[_0x4606f2(0x111)]();if(!_0x19e17a&&!existsSync(_0x43879d))return console['error'](a25_0x5421ca[_0x4606f2(0xfb)](_0x4606f2(0x112)+_0x43879d+'\x0a')),0x1;let _0x2e2a40;if(_0x19e17a){if(!_0x19e17a[_0x4606f2(0xfc)](_0x4606f2(0x10c))&&!_0x19e17a[_0x4606f2(0xfc)](_0x4606f2(0xfd)))return console[_0x4606f2(0x107)](a25_0x5421ca[_0x4606f2(0xfb)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x19e17a+'\x0a')),0x1;_0x2e2a40=[_0x19e17a];}else _0x2e2a40=findYamlFiles(_0x43879d);if(_0x2e2a40[_0x4606f2(0x115)]===0x0)return console['error'](a25_0x5421ca[_0x4606f2(0xfb)](_0x4606f2(0x109)+_0x43879d+'\x0a')),0x1;const _0x344445=validateYamlFiles(_0x2e2a40,_0x43879d,{'filterType':_0x4606f2(0xfe)}),_0x4645bf=calculateSummary(_0x344445),_0x428989=_0x344445['filter'](isValidationResult);if(_0x428989['length']===0x0)return console[_0x4606f2(0x107)](a25_0x5421ca[_0x4606f2(0x11e)](_0x4606f2(0x113)+_0x43879d+'\x0a')),_0x4645bf[_0x4606f2(0x104)]>0x0&&console['error'](a25_0x5421ca['dim']('('+_0x4645bf[_0x4606f2(0x104)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x3054a8 of _0x344445){if(!isValidationResult(_0x3054a8)){_0x30b552[_0x4606f2(0x119)]&&console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0xf3)]('-\x20'+_0x3054a8[_0x4606f2(0xf5)]+_0x4606f2(0x118)+_0x3054a8[_0x4606f2(0xf0)]+')'));continue;}const {relativePath:_0x8209c0,source:_0x1fad0f,result:_0x56621b}=_0x3054a8;if(_0x56621b[_0x4606f2(0x10b)]&&_0x56621b['warnings']['length']===0x0)_0x30b552['verbose']&&console[_0x4606f2(0x117)](a25_0x5421ca['green']('✔\x20'+_0x8209c0));else _0x56621b[_0x4606f2(0x10b)]?(console['log'](a25_0x5421ca[_0x4606f2(0x11e)]('⚠\x20'+_0x8209c0+':\x20'+_0x56621b[_0x4606f2(0x11c)][_0x4606f2(0x115)]+'\x20warning(s)')),console[_0x4606f2(0x117)](formatValidationResult(_0x56621b,_0x1fad0f,_0x8209c0))):(console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0xfb)]('✖\x20'+_0x8209c0+':\x20'+_0x56621b[_0x4606f2(0x10d)][_0x4606f2(0x115)]+_0x4606f2(0x116))),console[_0x4606f2(0x117)](formatValidationResult(_0x56621b,_0x1fad0f,_0x8209c0)));}return console['log'](''),_0x4645bf[_0x4606f2(0xf9)]?(console[_0x4606f2(0x117)](a25_0x5421ca['red'](_0x4606f2(0x11f)+_0x4645bf[_0x4606f2(0x114)]+_0x4606f2(0x108)+_0x4645bf[_0x4606f2(0x10e)]+_0x4606f2(0xef))),_0x4645bf[_0x4606f2(0xee)]>0x0&&console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0x11e)](_0x4645bf[_0x4606f2(0xee)]+_0x4606f2(0xff))),_0x4645bf['skippedCount']>0x0&&console[_0x4606f2(0x117)](a25_0x5421ca['dim'](_0x4645bf[_0x4606f2(0x104)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0xf7)](_0x4606f2(0xf2)+_0x4645bf[_0x4606f2(0x10e)]+'\x20template(s)\x20valid')),_0x4645bf[_0x4606f2(0xee)]>0x0&&console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0x11e)](_0x4645bf[_0x4606f2(0xee)]+'\x20warning(s)\x20found')),_0x4645bf[_0x4606f2(0x104)]>0x0&&console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0xf3)](_0x4645bf[_0x4606f2(0x104)]+_0x4606f2(0x110))),0x0);}}function a25_0x5c6b(){const _0x208666=['.yml','errors','validCount','dirname','\x20non-template\x20file(s)\x20skipped','cwd','Error:\x20Directory\x20not\x20found:\x20','No\x20template\x20YAML\x20files\x20found\x20in\x20','invalidCount','length','\x20error(s)','log','\x20(skipped:\x20','verbose','413QqaXzF','1116846ffJfun','warnings','10iOdBiP','yellow','Validation\x20failed:\x20','278IakXvp','description','warningCount','\x20valid','reason','resolve','✔\x20All\x20','dim','Validate\x20template\x20YAML\x20files','relativePath','8nEoZYh','green','engage:template:validate','hasErrors','4185929QJQeJp','red','endsWith','.yaml','template','\x20warning(s)\x20found','1053456EAhwhl','135870dXCJJW','1010583ZpIHhe','name','skippedCount','433530BWCWjR','execute','error','\x20template(s)\x20with\x20errors,\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','55oOTAZj','valid'];a25_0x5c6b=function(){return _0x208666;};return a25_0x5c6b();}
1
+ const a25_0x3f8d3d=a25_0x3804;(function(_0x55d132,_0x20a935){const _0x361e63=a25_0x3804,_0x249cad=_0x55d132();while(!![]){try{const _0x10bff1=-parseInt(_0x361e63(0x90))/0x1*(-parseInt(_0x361e63(0x9d))/0x2)+-parseInt(_0x361e63(0x93))/0x3+parseInt(_0x361e63(0x7e))/0x4*(parseInt(_0x361e63(0x9f))/0x5)+-parseInt(_0x361e63(0xa2))/0x6*(-parseInt(_0x361e63(0x81))/0x7)+parseInt(_0x361e63(0x8c))/0x8*(parseInt(_0x361e63(0x8e))/0x9)+-parseInt(_0x361e63(0x9c))/0xa+parseInt(_0x361e63(0x96))/0xb;if(_0x10bff1===_0x20a935)break;else _0x249cad['push'](_0x249cad['shift']());}catch(_0xa2a32c){_0x249cad['push'](_0x249cad['shift']());}}}(a25_0x4188,0x70ab9));function a25_0x3804(_0x1e32ef,_0x2bf575){_0x1e32ef=_0x1e32ef-0x79;const _0x418878=a25_0x4188();let _0x38048e=_0x418878[_0x1e32ef];return _0x38048e;}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x468ab7 from'chalk';import a25_0x36dfaf from'path';function a25_0x4188(){const _0x102d2a=['dim','42494sliKnW','Validate\x20template\x20YAML\x20files','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','1201326xLrhPN','yellow','\x20warning(s)\x20found','1012715dxtHOl','Error:\x20Directory\x20not\x20found:\x20','log','dirname','\x20warning(s)','endsWith','6327670vgwsjg','16UjIYmk','skippedCount','29695kYeCZU','\x20non-template\x20file(s)\x20skipped)','\x20(skipped:\x20','47490NIdixl','✔\x20All\x20','red','errors','cwd','green','length','warningCount','\x20template(s)\x20valid','\x20error(s)','124STnzqT','verbose','\x20non-template\x20file(s)\x20skipped','70rjKMxD','template','Validation\x20failed:\x20','reason','error','validCount','\x20valid','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','.yaml','\x20template(s)\x20with\x20errors,\x20','valid','8fTZisn','warnings','7194870KmEnqm'];a25_0x4188=function(){return _0x102d2a;};return a25_0x4188();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']='engage:template:validate';['description']=a25_0x3f8d3d(0x91);async['execute'](_0x5bd11){const _0x3fc294=a25_0x3f8d3d,{options:_0x393b31,args:_0x2c6546}=_0x5bd11,_0x34bb97=_0x393b31,_0x108127=_0x2c6546[0x0],_0x206aad=_0x108127?a25_0x36dfaf['resolve'](_0x108127):undefined,_0x4bccbe=_0x206aad?isYamlFile(_0x206aad):![];let _0x4fe0e2,_0x2f0434;if(_0x4bccbe&&_0x206aad)_0x4fe0e2=a25_0x36dfaf[_0x3fc294(0x99)](_0x206aad),_0x2f0434=_0x206aad;else _0x206aad?_0x4fe0e2=_0x206aad:_0x4fe0e2=process[_0x3fc294(0xa6)]();if(!_0x2f0434&&!existsSync(_0x4fe0e2))return console['error'](a25_0x468ab7[_0x3fc294(0xa4)](_0x3fc294(0x97)+_0x4fe0e2+'\x0a')),0x1;let _0x3fd67e;if(_0x2f0434){if(!_0x2f0434[_0x3fc294(0x9b)]('.yml')&&!_0x2f0434[_0x3fc294(0x9b)](_0x3fc294(0x89)))return console[_0x3fc294(0x85)](a25_0x468ab7[_0x3fc294(0xa4)](_0x3fc294(0x88)+_0x2f0434+'\x0a')),0x1;_0x3fd67e=[_0x2f0434];}else _0x3fd67e=findYamlFiles(_0x4fe0e2);if(_0x3fd67e[_0x3fc294(0x7a)]===0x0)return console['error'](a25_0x468ab7['red'](_0x3fc294(0x92)+_0x4fe0e2+'\x0a')),0x1;const _0x298fa5=validateYamlFiles(_0x3fd67e,_0x4fe0e2,{'filterType':_0x3fc294(0x82)}),_0x22f425=calculateSummary(_0x298fa5),_0x38f3f1=_0x298fa5['filter'](isValidationResult);if(_0x38f3f1['length']===0x0)return console[_0x3fc294(0x85)](a25_0x468ab7[_0x3fc294(0x94)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x4fe0e2+'\x0a')),_0x22f425[_0x3fc294(0x9e)]>0x0&&console[_0x3fc294(0x85)](a25_0x468ab7[_0x3fc294(0x8f)]('('+_0x22f425[_0x3fc294(0x9e)]+_0x3fc294(0xa0))),0x0;for(const _0x262d30 of _0x298fa5){if(!isValidationResult(_0x262d30)){_0x34bb97['verbose']&&console[_0x3fc294(0x98)](a25_0x468ab7['dim']('-\x20'+_0x262d30['relativePath']+_0x3fc294(0xa1)+_0x262d30[_0x3fc294(0x84)]+')'));continue;}const {relativePath:_0x22d092,source:_0x52218a,result:_0x442604}=_0x262d30;if(_0x442604[_0x3fc294(0x8b)]&&_0x442604[_0x3fc294(0x8d)][_0x3fc294(0x7a)]===0x0)_0x34bb97[_0x3fc294(0x7f)]&&console[_0x3fc294(0x98)](a25_0x468ab7[_0x3fc294(0x79)]('✔\x20'+_0x22d092));else _0x442604['valid']?(console[_0x3fc294(0x98)](a25_0x468ab7[_0x3fc294(0x94)]('⚠\x20'+_0x22d092+':\x20'+_0x442604['warnings'][_0x3fc294(0x7a)]+_0x3fc294(0x9a))),console[_0x3fc294(0x98)](formatValidationResult(_0x442604,_0x52218a,_0x22d092))):(console['log'](a25_0x468ab7[_0x3fc294(0xa4)]('✖\x20'+_0x22d092+':\x20'+_0x442604[_0x3fc294(0xa5)][_0x3fc294(0x7a)]+_0x3fc294(0x7d))),console[_0x3fc294(0x98)](formatValidationResult(_0x442604,_0x52218a,_0x22d092)));}return console[_0x3fc294(0x98)](''),_0x22f425['hasErrors']?(console[_0x3fc294(0x98)](a25_0x468ab7['red'](_0x3fc294(0x83)+_0x22f425['invalidCount']+_0x3fc294(0x8a)+_0x22f425[_0x3fc294(0x86)]+_0x3fc294(0x87))),_0x22f425[_0x3fc294(0x7b)]>0x0&&console[_0x3fc294(0x98)](a25_0x468ab7[_0x3fc294(0x94)](_0x22f425[_0x3fc294(0x7b)]+_0x3fc294(0x95))),_0x22f425[_0x3fc294(0x9e)]>0x0&&console[_0x3fc294(0x98)](a25_0x468ab7[_0x3fc294(0x8f)](_0x22f425[_0x3fc294(0x9e)]+_0x3fc294(0x80))),0x1):(console[_0x3fc294(0x98)](a25_0x468ab7[_0x3fc294(0x79)](_0x3fc294(0xa3)+_0x22f425['validCount']+_0x3fc294(0x7c))),_0x22f425['warningCount']>0x0&&console['log'](a25_0x468ab7[_0x3fc294(0x94)](_0x22f425[_0x3fc294(0x7b)]+_0x3fc294(0x95))),_0x22f425[_0x3fc294(0x9e)]>0x0&&console[_0x3fc294(0x98)](a25_0x468ab7['dim'](_0x22f425['skippedCount']+_0x3fc294(0x80))),0x0);}}
@@ -1 +1 @@
1
- const a26_0x3d3515=a26_0x387a;(function(_0x466435,_0x51f6ca){const _0x5f4c00=a26_0x387a,_0x4b4eec=_0x466435();while(!![]){try{const _0x5edf42=parseInt(_0x5f4c00(0x1b7))/0x1*(-parseInt(_0x5f4c00(0x19d))/0x2)+parseInt(_0x5f4c00(0x199))/0x3*(-parseInt(_0x5f4c00(0x1c6))/0x4)+parseInt(_0x5f4c00(0x198))/0x5+parseInt(_0x5f4c00(0x1a6))/0x6*(-parseInt(_0x5f4c00(0x1a8))/0x7)+-parseInt(_0x5f4c00(0x18b))/0x8+-parseInt(_0x5f4c00(0x1d2))/0x9+-parseInt(_0x5f4c00(0x17e))/0xa*(-parseInt(_0x5f4c00(0x1c9))/0xb);if(_0x5edf42===_0x51f6ca)break;else _0x4b4eec['push'](_0x4b4eec['shift']());}catch(_0x5108e4){_0x4b4eec['push'](_0x4b4eec['shift']());}}}(a26_0x3ad3,0xa224d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x51996c from'chalk';function formatDuration(_0x4fe282){const _0x3e9750=a26_0x387a;if(_0x4fe282<0x3c)return _0x4fe282+'s';if(_0x4fe282<0xe10)return Math[_0x3e9750(0x184)](_0x4fe282/0x3c)+'m\x20'+_0x4fe282%0x3c+'s';const _0x46977b=Math[_0x3e9750(0x184)](_0x4fe282/0xe10),_0x4dfaf1=Math[_0x3e9750(0x184)](_0x4fe282%0xe10/0x3c);return _0x4dfaf1>0x0?_0x46977b+'h\x20'+_0x4dfaf1+'m':_0x46977b+'h';}function formatRelativeTime(_0x2e3ea7){const _0x14526b=a26_0x387a,_0x329cb1=Date[_0x14526b(0x195)]()-_0x2e3ea7[_0x14526b(0x188)](),_0x385ac7=Math['floor'](Math['abs'](_0x329cb1)/0x3e8);if(_0x385ac7<0x3c)return _0x14526b(0x1b1);const _0x300f5f=Math[_0x14526b(0x184)](_0x385ac7/0x3c);if(_0x300f5f<0x3c)return _0x300f5f+'m\x20ago';const _0x5051f4=Math[_0x14526b(0x184)](_0x300f5f/0x3c);if(_0x5051f4<0x18)return _0x5051f4+_0x14526b(0x19a);const _0x1c6b86=Math[_0x14526b(0x184)](_0x5051f4/0x18);if(_0x1c6b86<0x1e)return _0x1c6b86+_0x14526b(0x196);return Math['floor'](_0x1c6b86/0x1e)+_0x14526b(0x190);}export class JobListCommand extends BaseCommand{[a26_0x3d3515(0x1b8)]=a26_0x3d3515(0x1d3);[a26_0x3d3515(0x1d0)]=a26_0x3d3515(0x1ba);async[a26_0x3d3515(0x1c5)](_0x44b705){const _0x3ecdf6=a26_0x3d3515,{options:_0x44bd37,tdx:_0xc1aec2}=_0x44b705,_0x2caa0e=resolveLimit(_0x44bd37[_0x3ecdf6(0x1c7)],DEFAULT_DISPLAY_LIMIT),_0x49f201=_0x44bd37[_0x3ecdf6(0x1cf)];_0x44bd37[_0x3ecdf6(0x1ce)]&&(console[_0x3ecdf6(0x197)]('Limit:\x20'+_0x2caa0e+'\x20jobs'),_0x49f201&&console[_0x3ecdf6(0x197)](_0x3ecdf6(0x19f)+_0x49f201));const _0x117e53=await withSpinner('Listing\x20jobs...',()=>_0xc1aec2[_0x3ecdf6(0x1d3)][_0x3ecdf6(0x1a7)]({'from':0x0,'to':_0x2caa0e-0x1,'status':_0x49f201}),{'verbose':_0x44bd37[_0x3ecdf6(0x1ce)]}),_0x1a0e61=_0x117e53[_0x3ecdf6(0x182)];console[_0x3ecdf6(0x197)]('✔\x20Found\x20'+_0x1a0e61[_0x3ecdf6(0x18f)]+'\x20job'+(_0x1a0e61[_0x3ecdf6(0x18f)]!==0x1?'s':''));const _0x1de5e2=_0x44bd37[_0x3ecdf6(0x17f)];if(isStructuredFormat(_0x44bd37)){const _0x559cd6=_0x1a0e61[_0x3ecdf6(0x1b9)](_0x1daf9d=>{const _0x49dce3=_0x3ecdf6;let _0x738406;if(_0x1daf9d[_0x49dce3(0x1d5)]&&_0x1daf9d[_0x49dce3(0x1ae)]){const _0x4a56ff=new Date(_0x1daf9d['start_at'])[_0x49dce3(0x188)](),_0x3478d5=new Date(_0x1daf9d[_0x49dce3(0x1ae)])[_0x49dce3(0x188)]();_0x738406=Math[_0x49dce3(0x1ac)]((_0x3478d5-_0x4a56ff)/0x3e8);}return{'job_id':_0x1daf9d[_0x49dce3(0x1c3)],'type':_0x1daf9d[_0x49dce3(0x1a0)]===_0x49dce3(0x19b)?_0x49dce3(0x183):_0x1daf9d[_0x49dce3(0x1a0)],'status':_0x1daf9d[_0x49dce3(0x1cf)],'user_name':_0x1daf9d['user_name'],'duration_sec':_0x738406,'created_at':_0x1daf9d[_0x49dce3(0x1b3)],'started_at':_0x1daf9d['start_at'],'end_at':_0x1daf9d[_0x49dce3(0x1ae)]};});await handleSDKOutput(_0x559cd6,_0x44bd37);}else for(const _0x2c035e of _0x1a0e61){const _0x5a47f4=_0x2c035e[_0x3ecdf6(0x1cf)]===_0x3ecdf6(0x1b6)?a26_0x51996c[_0x3ecdf6(0x1bd)]:_0x2c035e['status']==='error'?a26_0x51996c[_0x3ecdf6(0x1bc)]:a26_0x51996c[_0x3ecdf6(0x1b4)],_0x3a7d38=_0x5a47f4(_0x2c035e[_0x3ecdf6(0x1cf)]),_0x264faf=getJobUrl(_0x1de5e2,_0x2c035e['job_id']),_0x38c528=hyperlink(_0x2c035e[_0x3ecdf6(0x1c3)],_0x264faf),_0x33ee5b=a26_0x51996c[_0x3ecdf6(0x1b4)](_0x2c035e[_0x3ecdf6(0x1a0)]==='presto'?_0x3ecdf6(0x183):_0x2c035e[_0x3ecdf6(0x1a0)]),_0xaf9d80=[];if(_0x2c035e[_0x3ecdf6(0x1d5)]&&_0x2c035e[_0x3ecdf6(0x1ae)]){const _0x372c72=Math[_0x3ecdf6(0x1ac)]((new Date(_0x2c035e[_0x3ecdf6(0x1ae)])[_0x3ecdf6(0x188)]()-new Date(_0x2c035e['start_at'])[_0x3ecdf6(0x188)]())/0x3e8);_0xaf9d80[_0x3ecdf6(0x19c)](formatDuration(_0x372c72));}if(_0x2c035e[_0x3ecdf6(0x1ae)])_0xaf9d80[_0x3ecdf6(0x19c)](formatRelativeTime(new Date(_0x2c035e[_0x3ecdf6(0x1ae)])));else _0x2c035e[_0x3ecdf6(0x1d5)]&&_0xaf9d80['push'](formatRelativeTime(new Date(_0x2c035e['start_at'])));const _0x7c78c8=_0xaf9d80['length']>0x0?a26_0x51996c[_0x3ecdf6(0x1b4)]('\x20'+_0xaf9d80[_0x3ecdf6(0x1ab)](',\x20')):'';console[_0x3ecdf6(0x180)]('⚡\x20'+_0x38c528+'\x20'+_0x33ee5b+'\x20'+_0x3a7d38+_0x7c78c8);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x3d3515(0x1b8)]=a26_0x3d3515(0x1ad);[a26_0x3d3515(0x1d0)]=a26_0x3d3515(0x18a);['validate'](_0x33cbad){const _0x2a0b85=a26_0x3d3515,_0x443fc6=_0x33cbad[_0x2a0b85(0x18d)][0x0];if(!_0x443fc6)return _0x2a0b85(0x1bb);return undefined;}async[a26_0x3d3515(0x1c5)](_0x4e6ab6){const _0x5cc0fb=a26_0x3d3515,{options:_0x4cce63,args:_0x49ca62,tdx:_0x336344}=_0x4e6ab6,_0x54ebd3=_0x49ca62[0x0],_0x3bde6d=await withSpinner(_0x5cc0fb(0x1be),()=>_0x336344['jobs']['show'](_0x54ebd3),{'verbose':_0x4cce63[_0x5cc0fb(0x1ce)]}),_0x596002=_0x3bde6d[_0x5cc0fb(0x182)];let _0x578801;if(_0x596002[_0x5cc0fb(0x1d5)]&&_0x596002[_0x5cc0fb(0x1ae)]){const _0x5e9b89=new Date(_0x596002[_0x5cc0fb(0x1d5)])[_0x5cc0fb(0x188)](),_0x13b9e3=new Date(_0x596002['end_at'])['getTime']();_0x578801=Math[_0x5cc0fb(0x1ac)]((_0x13b9e3-_0x5e9b89)/0x3e8);}const _0x5abaf0={'job_id':_0x596002[_0x5cc0fb(0x1c3)],'type':_0x596002[_0x5cc0fb(0x1a0)],'status':_0x596002['status'],..._0x596002['user_name']&&{'user_name':_0x596002['user_name']},..._0x578801!==undefined&&{'duration_sec':_0x578801},..._0x596002[_0x5cc0fb(0x1b3)]&&{'created_at':_0x596002[_0x5cc0fb(0x1b3)]},..._0x596002[_0x5cc0fb(0x1d5)]&&{'started_at':_0x596002[_0x5cc0fb(0x1d5)]},..._0x596002[_0x5cc0fb(0x1ae)]&&{'end_at':_0x596002[_0x5cc0fb(0x1ae)]},..._0x596002[_0x5cc0fb(0x191)]&&{'database':_0x596002['database']},..._0x596002[_0x5cc0fb(0x1a4)]!==undefined&&{'priority':_0x596002['priority']},..._0x596002[_0x5cc0fb(0x19e)]&&{'url':_0x596002[_0x5cc0fb(0x19e)]},..._0x596002[_0x5cc0fb(0x192)]&&{'query':_0x596002[_0x5cc0fb(0x192)]},..._0x596002[_0x5cc0fb(0x1b2)]&&{'debug':_0x596002[_0x5cc0fb(0x1b2)]}};return await handleSingleObjectOutput(_0x5abaf0,_0x4cce63),0x0;}}function a26_0x387a(_0xd7b53,_0x3c55db){_0xd7b53=_0xd7b53-0x17d;const _0x3ad35b=a26_0x3ad3();let _0x387abd=_0x3ad35b[_0xd7b53];return _0x387abd;}export class JobKillCommand extends BaseCommand{['name']='job:kill';[a26_0x3d3515(0x1d0)]=a26_0x3d3515(0x194);[a26_0x3d3515(0x1ca)](_0x467346){const _0x4eb3e0=a26_0x3d3515,_0x2ed477=_0x467346['args'][0x0];if(!_0x2ed477)return _0x4eb3e0(0x1bf);return undefined;}async[a26_0x3d3515(0x1c5)](_0x48e06e){const _0x4c8cc4=a26_0x3d3515,{options:_0x219222,args:_0x188b19,tdx:_0x50a884}=_0x48e06e,_0x5b2bfc=_0x188b19[0x0];if(!_0x219222[_0x4c8cc4(0x1a1)]){const _0x4cda4f=await confirm(_0x4c8cc4(0x1a2)+_0x5b2bfc+'?');if(!_0x4cda4f)return console[_0x4c8cc4(0x197)]('Cancelled'),0x0;}return await withSpinner(_0x4c8cc4(0x1d4),()=>_0x50a884[_0x4c8cc4(0x1d3)][_0x4c8cc4(0x181)](_0x5b2bfc),{'verbose':_0x219222[_0x4c8cc4(0x1ce)]}),console['error'](_0x4c8cc4(0x1a3)+_0x5b2bfc),console[_0x4c8cc4(0x197)](_0x4c8cc4(0x18c)+_0x5b2bfc+_0x4c8cc4(0x18e)),0x0;}}function a26_0x3ad3(){const _0x1b39df=['name','map','List\x20jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','red','green','Getting\x20job\x20details...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Get\x20job\x20results','hive','✔\x20Job\x20submitted','job_id','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','execute','4YTIFTu','limit','Submit\x20a\x20job','33337139lJUpyb','validate','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','...','substring','verbose','status','description','submit','10276992kEiXoR','jobs','Submitting\x20kill\x20request...','start_at','job:result','Job\x20type:\x20','10iWHrLJ','site','log','kill','data','trino','floor','Query:\x20','No\x20SQL\x20statements\x20found\x20in\x20file','INVALID_ARGUMENT','getTime','Submitting\x20job...','Show\x20job\x20details','4206176mekzBV','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','args','\x27\x20to\x20verify\x20the\x20job\x20status','length','mo\x20ago','database','query','\x20\x20Job\x20ID:\x20','Kill\x20a\x20job','now','d\x20ago','error','6554050djZhYZ','2049378SqgedT','h\x20ago','presto','push','1125034MCBRti','url','Status\x20filter:\x20','type','yes','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','priority','✔\x20Retrieved\x20','516kreOBK','list','16401LNJMtI','Database:\x20','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','join','round','job:show','end_at','result','\x20row','just\x20now','debug','created_at','dim','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','success','2mNvkXu'];a26_0x3ad3=function(){return _0x1b39df;};return a26_0x3ad3();}export class JobSubmitCommand extends BaseCommand{[a26_0x3d3515(0x1b8)]='job:submit';['description']=a26_0x3d3515(0x1c8);async[a26_0x3d3515(0x1c5)](_0x3c12b2){const _0xe32a42=a26_0x3d3515,{options:_0x4a1269,args:_0xc66b47,tdx:_0xa6534f}=_0x3c12b2,_0x4926f5=_0x4a1269['jobType']||_0xe32a42(0x183),_0x37960b=_0x4a1269['file'],_0x5b7c6f=_0x4a1269[_0xe32a42(0x191)]||'information_schema',_0x55a7be=_0x4a1269[_0xe32a42(0x1af)];if(_0x4926f5!=='trino'&&_0x4926f5!==_0xe32a42(0x1c1))throw new SDKError(ErrorCode[_0xe32a42(0x187)],_0xe32a42(0x1aa));let _0x44eca0;if(_0x37960b){if(_0xc66b47[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x5e7957=readSqlStatementsFromFile(_0x37960b);if(_0x5e7957[_0xe32a42(0x18f)]===0x0)throw new SDKError(ErrorCode[_0xe32a42(0x187)],_0xe32a42(0x186));if(_0x5e7957[_0xe32a42(0x18f)]>0x1)throw new SDKError(ErrorCode[_0xe32a42(0x187)],_0xe32a42(0x1c4));_0x44eca0=_0x5e7957[0x0];}else{if(!_0xc66b47[0x0])throw new SDKError(ErrorCode[_0xe32a42(0x187)],_0xe32a42(0x1b5));_0x44eca0=_0xc66b47[0x0];}_0x4a1269[_0xe32a42(0x1ce)]&&(console[_0xe32a42(0x197)](_0xe32a42(0x17d)+_0x4926f5),console['error'](_0xe32a42(0x1a9)+_0x5b7c6f),console[_0xe32a42(0x197)](_0xe32a42(0x185)+_0x44eca0[_0xe32a42(0x1cd)](0x0,0x64)+(_0x44eca0[_0xe32a42(0x18f)]>0x64?_0xe32a42(0x1cc):'')));const _0xcf72e3=await withSpinner(_0xe32a42(0x189),()=>_0xa6534f[_0xe32a42(0x1d3)][_0xe32a42(0x1d1)](_0x5b7c6f,_0x44eca0,_0x4926f5,_0x55a7be),{'verbose':_0x4a1269[_0xe32a42(0x1ce)]}),_0x46f84d=_0xcf72e3[_0xe32a42(0x182)];return console[_0xe32a42(0x197)](_0xe32a42(0x1c2)),console['error'](_0xe32a42(0x193)+_0x46f84d['job_id']),await handleSDKOutput([_0x46f84d],_0x4a1269),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x3d3515(0x1b8)]=a26_0x3d3515(0x1d6);[a26_0x3d3515(0x1d0)]=a26_0x3d3515(0x1c0);[a26_0x3d3515(0x1ca)](_0x5b778d){const _0x5631c7=a26_0x3d3515,_0x3acf8a=_0x5b778d[_0x5631c7(0x18d)][0x0];if(!_0x3acf8a)return _0x5631c7(0x1cb);return undefined;}async[a26_0x3d3515(0x1c5)](_0x9de80){const _0x5be423=a26_0x3d3515,{options:_0x21c0d3,args:_0x2c59fc,tdx:_0x2f11fd}=_0x9de80,_0x2338f4=_0x2c59fc[0x0],_0x5c221b=await withSpinner('Getting\x20job\x20results...',()=>_0x2f11fd[_0x5be423(0x1d3)][_0x5be423(0x1af)](_0x2338f4),{'verbose':_0x21c0d3[_0x5be423(0x1ce)]}),_0x218eaa=_0x5c221b[_0x5be423(0x182)];return console['error'](_0x5be423(0x1a5)+_0x218eaa[_0x5be423(0x18f)]+_0x5be423(0x1b0)+(_0x218eaa[_0x5be423(0x18f)]!==0x1?'s':'')),await handleSDKOutput(_0x218eaa,_0x21c0d3),0x0;}}
1
+ const a26_0xf159c3=a26_0x19a9;function a26_0x437c(){const _0x4311b7=['job:submit','jobs','type','...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','map','url','query','error','execute','12jCUnkk','dim','join','job:show','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','verbose','1161tRtHev','floor','status','log','just\x20now','file','1404192VKIQNL','Limit:\x20','data','948388JSqoOa','kill','Get\x20job\x20results','Database:\x20','Submitting\x20kill\x20request...','job_id','validate','\x27\x20to\x20verify\x20the\x20job\x20status','yes','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','trino','getTime','2216954AYwrfu','push','3600624RRQYEw','user_name','show','Query:\x20','args','substring','Submitting\x20job...','m\x20ago','Submit\x20a\x20job','d\x20ago','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','length','Getting\x20job\x20details...','Show\x20job\x20details','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','submit','Status\x20filter:\x20','Cancelled','created_at','2900625bUAxAY','debug','h\x20ago','description','success','end_at','round','abs','✔\x20Retrieved\x20','start_at','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','\x20job','name','INVALID_ARGUMENT','Job\x20type:\x20','result','database','1329690yJzRPt','\x20row','red','presto','26328htkzYd','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','\x20jobs','limit','No\x20SQL\x20statements\x20found\x20in\x20file','Listing\x20jobs...','\x20\x20Job\x20ID:\x20','job:kill'];a26_0x437c=function(){return _0x4311b7;};return a26_0x437c();}(function(_0x31fb39,_0x23b195){const _0xd3a93e=a26_0x19a9,_0x4f7cfd=_0x31fb39();while(!![]){try{const _0x41e85c=parseInt(_0xd3a93e(0x1b5))/0x1+-parseInt(_0xd3a93e(0x16d))/0x2+-parseInt(_0xd3a93e(0x1a9))/0x3*(-parseInt(_0xd3a93e(0x1b8))/0x4)+parseInt(_0xd3a93e(0x193))/0x5+-parseInt(_0xd3a93e(0x16f))/0x6+parseInt(_0xd3a93e(0x182))/0x7+-parseInt(_0xd3a93e(0x197))/0x8*(parseInt(_0xd3a93e(0x1af))/0x9);if(_0x41e85c===_0x23b195)break;else _0x4f7cfd['push'](_0x4f7cfd['shift']());}catch(_0x46c833){_0x4f7cfd['push'](_0x4f7cfd['shift']());}}}(a26_0x437c,0xdbabd));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a26_0x19a9(_0xf3d7c8,_0x3634bb){_0xf3d7c8=_0xf3d7c8-0x164;const _0x437c32=a26_0x437c();let _0x19a902=_0x437c32[_0xf3d7c8];return _0x19a902;}import a26_0x3a86ae from'chalk';function formatDuration(_0x58bc4d){const _0x12420d=a26_0x19a9;if(_0x58bc4d<0x3c)return _0x58bc4d+'s';if(_0x58bc4d<0xe10)return Math[_0x12420d(0x1b0)](_0x58bc4d/0x3c)+'m\x20'+_0x58bc4d%0x3c+'s';const _0x3bada1=Math[_0x12420d(0x1b0)](_0x58bc4d/0xe10),_0x5599c2=Math[_0x12420d(0x1b0)](_0x58bc4d%0xe10/0x3c);return _0x5599c2>0x0?_0x3bada1+'h\x20'+_0x5599c2+'m':_0x3bada1+'h';}function formatRelativeTime(_0x54aa2e){const _0x508469=a26_0x19a9,_0x3ddfdd=Date['now']()-_0x54aa2e['getTime'](),_0x2a836c=Math[_0x508469(0x1b0)](Math[_0x508469(0x189)](_0x3ddfdd)/0x3e8);if(_0x2a836c<0x3c)return _0x508469(0x1b3);const _0x54013b=Math[_0x508469(0x1b0)](_0x2a836c/0x3c);if(_0x54013b<0x3c)return _0x54013b+_0x508469(0x176);const _0x32a1ed=Math[_0x508469(0x1b0)](_0x54013b/0x3c);if(_0x32a1ed<0x18)return _0x32a1ed+_0x508469(0x184);const _0x1768d2=Math[_0x508469(0x1b0)](_0x32a1ed/0x18);if(_0x1768d2<0x1e)return _0x1768d2+_0x508469(0x178);return Math[_0x508469(0x1b0)](_0x1768d2/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0xf159c3(0x18e)]=a26_0xf159c3(0x1a0);['description']='List\x20jobs';async['execute'](_0x2814c2){const _0xcd9093=a26_0xf159c3,{options:_0x908c48,tdx:_0x55c2ca}=_0x2814c2,_0x4a9cac=resolveLimit(_0x908c48[_0xcd9093(0x19a)],DEFAULT_DISPLAY_LIMIT),_0x32bad5=_0x908c48[_0xcd9093(0x1b1)];_0x908c48[_0xcd9093(0x1ae)]&&(console['error'](_0xcd9093(0x1b6)+_0x4a9cac+_0xcd9093(0x199)),_0x32bad5&&console[_0xcd9093(0x1a7)](_0xcd9093(0x17f)+_0x32bad5));const _0x18289b=await withSpinner(_0xcd9093(0x19c),()=>_0x55c2ca[_0xcd9093(0x1a0)]['list']({'from':0x0,'to':_0x4a9cac-0x1,'status':_0x32bad5}),{'verbose':_0x908c48[_0xcd9093(0x1ae)]}),_0x32f9b2=_0x18289b[_0xcd9093(0x1b7)];console[_0xcd9093(0x1a7)]('✔\x20Found\x20'+_0x32f9b2[_0xcd9093(0x17a)]+_0xcd9093(0x18d)+(_0x32f9b2[_0xcd9093(0x17a)]!==0x1?'s':''));const _0x184611=_0x908c48['site'];if(isStructuredFormat(_0x908c48)){const _0x411f48=_0x32f9b2[_0xcd9093(0x1a4)](_0x39a6ec=>{const _0x4c3feb=_0xcd9093;let _0x412c19;if(_0x39a6ec[_0x4c3feb(0x18b)]&&_0x39a6ec[_0x4c3feb(0x187)]){const _0x29cba6=new Date(_0x39a6ec['start_at'])[_0x4c3feb(0x16c)](),_0x19c4fd=new Date(_0x39a6ec['end_at'])[_0x4c3feb(0x16c)]();_0x412c19=Math[_0x4c3feb(0x188)]((_0x19c4fd-_0x29cba6)/0x3e8);}return{'job_id':_0x39a6ec[_0x4c3feb(0x166)],'type':_0x39a6ec[_0x4c3feb(0x1a1)]===_0x4c3feb(0x196)?'trino':_0x39a6ec['type'],'status':_0x39a6ec[_0x4c3feb(0x1b1)],'user_name':_0x39a6ec[_0x4c3feb(0x170)],'duration_sec':_0x412c19,'created_at':_0x39a6ec[_0x4c3feb(0x181)],'started_at':_0x39a6ec[_0x4c3feb(0x18b)],'end_at':_0x39a6ec[_0x4c3feb(0x187)]};});await handleSDKOutput(_0x411f48,_0x908c48);}else for(const _0x57915e of _0x32f9b2){const _0x45062a=_0x57915e[_0xcd9093(0x1b1)]===_0xcd9093(0x186)?a26_0x3a86ae['green']:_0x57915e[_0xcd9093(0x1b1)]===_0xcd9093(0x1a7)?a26_0x3a86ae[_0xcd9093(0x195)]:a26_0x3a86ae[_0xcd9093(0x1aa)],_0x1e03fd=_0x45062a(_0x57915e['status']),_0x166ec9=getJobUrl(_0x184611,_0x57915e[_0xcd9093(0x166)]),_0x20ad2d=hyperlink(_0x57915e[_0xcd9093(0x166)],_0x166ec9),_0x1066f1=a26_0x3a86ae[_0xcd9093(0x1aa)](_0x57915e[_0xcd9093(0x1a1)]==='presto'?_0xcd9093(0x16b):_0x57915e[_0xcd9093(0x1a1)]),_0x1958b1=[];if(_0x57915e[_0xcd9093(0x18b)]&&_0x57915e['end_at']){const _0x4d7367=Math['round']((new Date(_0x57915e['end_at'])[_0xcd9093(0x16c)]()-new Date(_0x57915e['start_at'])['getTime']())/0x3e8);_0x1958b1['push'](formatDuration(_0x4d7367));}if(_0x57915e[_0xcd9093(0x187)])_0x1958b1[_0xcd9093(0x16e)](formatRelativeTime(new Date(_0x57915e['end_at'])));else _0x57915e[_0xcd9093(0x18b)]&&_0x1958b1['push'](formatRelativeTime(new Date(_0x57915e[_0xcd9093(0x18b)])));const _0x1fc1ff=_0x1958b1[_0xcd9093(0x17a)]>0x0?a26_0x3a86ae[_0xcd9093(0x1aa)]('\x20'+_0x1958b1[_0xcd9093(0x1ab)](',\x20')):'';console[_0xcd9093(0x1b2)]('⚡\x20'+_0x20ad2d+'\x20'+_0x1066f1+'\x20'+_0x1e03fd+_0x1fc1ff);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0xf159c3(0x1ac);[a26_0xf159c3(0x185)]=a26_0xf159c3(0x17c);[a26_0xf159c3(0x167)](_0x57cc5c){const _0x482346=a26_0xf159c3,_0x495aa4=_0x57cc5c[_0x482346(0x173)][0x0];if(!_0x495aa4)return _0x482346(0x17d);return undefined;}async[a26_0xf159c3(0x1a8)](_0x4ced2c){const _0x5a4e2a=a26_0xf159c3,{options:_0x1bcbc9,args:_0x4e774f,tdx:_0x466e3a}=_0x4ced2c,_0x3318f7=_0x4e774f[0x0],_0x59e1df=await withSpinner(_0x5a4e2a(0x17b),()=>_0x466e3a[_0x5a4e2a(0x1a0)][_0x5a4e2a(0x171)](_0x3318f7),{'verbose':_0x1bcbc9[_0x5a4e2a(0x1ae)]}),_0x4856a5=_0x59e1df[_0x5a4e2a(0x1b7)];let _0x1f1010;if(_0x4856a5[_0x5a4e2a(0x18b)]&&_0x4856a5['end_at']){const _0x46cbe4=new Date(_0x4856a5[_0x5a4e2a(0x18b)])[_0x5a4e2a(0x16c)](),_0x23c74c=new Date(_0x4856a5['end_at'])[_0x5a4e2a(0x16c)]();_0x1f1010=Math[_0x5a4e2a(0x188)]((_0x23c74c-_0x46cbe4)/0x3e8);}const _0xbd129a={'job_id':_0x4856a5[_0x5a4e2a(0x166)],'type':_0x4856a5[_0x5a4e2a(0x1a1)],'status':_0x4856a5[_0x5a4e2a(0x1b1)],..._0x4856a5[_0x5a4e2a(0x170)]&&{'user_name':_0x4856a5[_0x5a4e2a(0x170)]},..._0x1f1010!==undefined&&{'duration_sec':_0x1f1010},..._0x4856a5['created_at']&&{'created_at':_0x4856a5[_0x5a4e2a(0x181)]},..._0x4856a5[_0x5a4e2a(0x18b)]&&{'started_at':_0x4856a5[_0x5a4e2a(0x18b)]},..._0x4856a5[_0x5a4e2a(0x187)]&&{'end_at':_0x4856a5[_0x5a4e2a(0x187)]},..._0x4856a5[_0x5a4e2a(0x192)]&&{'database':_0x4856a5[_0x5a4e2a(0x192)]},..._0x4856a5['priority']!==undefined&&{'priority':_0x4856a5['priority']},..._0x4856a5[_0x5a4e2a(0x1a5)]&&{'url':_0x4856a5['url']},..._0x4856a5[_0x5a4e2a(0x1a6)]&&{'query':_0x4856a5[_0x5a4e2a(0x1a6)]},..._0x4856a5[_0x5a4e2a(0x183)]&&{'debug':_0x4856a5[_0x5a4e2a(0x183)]}};return await handleSingleObjectOutput(_0xbd129a,_0x1bcbc9),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0xf159c3(0x18e)]=a26_0xf159c3(0x19e);[a26_0xf159c3(0x185)]='Kill\x20a\x20job';['validate'](_0xab8441){const _0x513a4c=a26_0xf159c3,_0x4e9248=_0xab8441[_0x513a4c(0x173)][0x0];if(!_0x4e9248)return _0x513a4c(0x16a);return undefined;}async[a26_0xf159c3(0x1a8)](_0x25fced){const _0x2a7069=a26_0xf159c3,{options:_0x57962a,args:_0x2ce2a4,tdx:_0x5f5655}=_0x25fced,_0x5c411a=_0x2ce2a4[0x0];if(!_0x57962a[_0x2a7069(0x169)]){const _0x521ac8=await confirm(_0x2a7069(0x1ad)+_0x5c411a+'?');if(!_0x521ac8)return console['error'](_0x2a7069(0x180)),0x0;}return await withSpinner(_0x2a7069(0x165),()=>_0x5f5655[_0x2a7069(0x1a0)][_0x2a7069(0x1b9)](_0x5c411a),{'verbose':_0x57962a[_0x2a7069(0x1ae)]}),console[_0x2a7069(0x1a7)](_0x2a7069(0x179)+_0x5c411a),console[_0x2a7069(0x1a7)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x5c411a+_0x2a7069(0x168)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0xf159c3(0x18e)]=a26_0xf159c3(0x19f);['description']=a26_0xf159c3(0x177);async[a26_0xf159c3(0x1a8)](_0x18c875){const _0x4bbf48=a26_0xf159c3,{options:_0x3ae2a7,args:_0x2e1e6f,tdx:_0x1302b1}=_0x18c875,_0x59bb30=_0x3ae2a7['jobType']||_0x4bbf48(0x16b),_0x4dc98e=_0x3ae2a7[_0x4bbf48(0x1b4)],_0x3b19c0=_0x3ae2a7['database']||'information_schema',_0x155bcc=_0x3ae2a7[_0x4bbf48(0x191)];if(_0x59bb30!==_0x4bbf48(0x16b)&&_0x59bb30!=='hive')throw new SDKError(ErrorCode[_0x4bbf48(0x18f)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0xf50586;if(_0x4dc98e){if(_0x2e1e6f[0x0])throw new SDKError(ErrorCode[_0x4bbf48(0x18f)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x27a00b=readSqlStatementsFromFile(_0x4dc98e);if(_0x27a00b[_0x4bbf48(0x17a)]===0x0)throw new SDKError(ErrorCode[_0x4bbf48(0x18f)],_0x4bbf48(0x19b));if(_0x27a00b[_0x4bbf48(0x17a)]>0x1)throw new SDKError(ErrorCode[_0x4bbf48(0x18f)],_0x4bbf48(0x18c));_0xf50586=_0x27a00b[0x0];}else{if(!_0x2e1e6f[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4bbf48(0x198));_0xf50586=_0x2e1e6f[0x0];}_0x3ae2a7[_0x4bbf48(0x1ae)]&&(console['error'](_0x4bbf48(0x190)+_0x59bb30),console[_0x4bbf48(0x1a7)](_0x4bbf48(0x164)+_0x3b19c0),console[_0x4bbf48(0x1a7)](_0x4bbf48(0x172)+_0xf50586[_0x4bbf48(0x174)](0x0,0x64)+(_0xf50586['length']>0x64?_0x4bbf48(0x1a2):'')));const _0x52d369=await withSpinner(_0x4bbf48(0x175),()=>_0x1302b1[_0x4bbf48(0x1a0)][_0x4bbf48(0x17e)](_0x3b19c0,_0xf50586,_0x59bb30,_0x155bcc),{'verbose':_0x3ae2a7['verbose']}),_0x211aa6=_0x52d369[_0x4bbf48(0x1b7)];return console[_0x4bbf48(0x1a7)]('✔\x20Job\x20submitted'),console['error'](_0x4bbf48(0x19d)+_0x211aa6[_0x4bbf48(0x166)]),await handleSDKOutput([_0x211aa6],_0x3ae2a7),0x0;}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a26_0xf159c3(0x185)]=a26_0xf159c3(0x1ba);[a26_0xf159c3(0x167)](_0x6a7648){const _0xb7bc07=a26_0xf159c3,_0x2edc2c=_0x6a7648[_0xb7bc07(0x173)][0x0];if(!_0x2edc2c)return _0xb7bc07(0x1a3);return undefined;}async[a26_0xf159c3(0x1a8)](_0x3951c3){const _0x69b21b=a26_0xf159c3,{options:_0x401e05,args:_0x357995,tdx:_0x41c60b}=_0x3951c3,_0x2e83f1=_0x357995[0x0],_0x1025b1=await withSpinner('Getting\x20job\x20results...',()=>_0x41c60b[_0x69b21b(0x1a0)][_0x69b21b(0x191)](_0x2e83f1),{'verbose':_0x401e05[_0x69b21b(0x1ae)]}),_0x4a50c6=_0x1025b1['data'];return console[_0x69b21b(0x1a7)](_0x69b21b(0x18a)+_0x4a50c6['length']+_0x69b21b(0x194)+(_0x4a50c6[_0x69b21b(0x17a)]!==0x1?'s':'')),await handleSDKOutput(_0x4a50c6,_0x401e05),0x0;}}
@@ -1 +1 @@
1
- const a27_0x256e1e=a27_0x4aef;(function(_0x4c68a7,_0x1723ea){const _0x2f6a13=a27_0x4aef,_0x1ff3dd=_0x4c68a7();while(!![]){try{const _0x324cce=parseInt(_0x2f6a13(0xef))/0x1+parseInt(_0x2f6a13(0x1b1))/0x2*(-parseInt(_0x2f6a13(0xf1))/0x3)+-parseInt(_0x2f6a13(0x1d7))/0x4*(parseInt(_0x2f6a13(0x152))/0x5)+-parseInt(_0x2f6a13(0x176))/0x6+-parseInt(_0x2f6a13(0xf3))/0x7*(parseInt(_0x2f6a13(0x10d))/0x8)+-parseInt(_0x2f6a13(0x198))/0x9*(parseInt(_0x2f6a13(0x19c))/0xa)+-parseInt(_0x2f6a13(0x1e0))/0xb*(-parseInt(_0x2f6a13(0x11b))/0xc);if(_0x324cce===_0x1723ea)break;else _0x1ff3dd['push'](_0x1ff3dd['shift']());}catch(_0x45e9b4){_0x1ff3dd['push'](_0x1ff3dd['shift']());}}}(a27_0x589b,0x878d1));import a27_0x13d74a from'chalk';import a27_0x555498 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';function a27_0x4aef(_0x482725,_0xeb1396){_0x482725=_0x482725-0xea;const _0x589bb9=a27_0x589b();let _0x4aef5a=_0x589bb9[_0x482725];return _0x4aef5a;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x465c3c){const _0x1c9d60=a27_0x4aef;return!_0x465c3c&&(console[_0x1c9d60(0x1b3)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x1c9d60(0x1b3)](_0x1c9d60(0x138))),!!_0x465c3c;}function withJsonFormat(_0x581bc9){const _0xaaa127=a27_0x4aef;if(!_0x581bc9[_0xaaa127(0x1c7)]&&!_0x581bc9[_0xaaa127(0x1cc)]&&!_0x581bc9[_0xaaa127(0xf8)]&&!_0x581bc9[_0xaaa127(0x16d)])return{..._0x581bc9,'format':_0xaaa127(0x1cc),'json':!![]};return _0x581bc9;}function formatJourneyState(_0x54f275){const _0x63893b=a27_0x4aef;switch(_0x54f275){case _0x63893b(0x1ae):return a27_0x13d74a[_0x63893b(0x11a)](_0x63893b(0x1a7));case _0x63893b(0x146):return a27_0x13d74a['dim'](_0x63893b(0x1e6));case _0x63893b(0x1c0):return a27_0x13d74a['yellow'](_0x63893b(0x1ee));case'completed':return a27_0x13d74a['blue'](_0x63893b(0x1d3));case _0x63893b(0x10e):return a27_0x13d74a['dim']('(archived)');default:return'('+_0x54f275+')';}}function formatJourneyItem(_0x21304b,_0x316530='',_0x572268){const _0x3e1132=a27_0x4aef,_0x1bf68e=formatJourneyState(_0x21304b[_0x3e1132(0x188)]),_0x2c53aa=_0x572268?hyperlink(_0x21304b[_0x3e1132(0x183)],_0x572268):_0x21304b[_0x3e1132(0x183)];return _0x316530+'🗺️\x20'+_0x2c53aa+'\x20'+_0x1bf68e;}function a27_0x589b(){const _0x1961dd=['Error:\x20--version\x20option\x20is\x20required','tdx.json','enteredSize','hasPeriod','8tqhrpA','archived','\x20Opening\x20','goal','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20Invalid\x20--type\x20\x22','Show\x20journey\x20statistics',',\x20version:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','limit','journey:version:view','yellow','green','12JjeBoY','isNew','cyan','journey:traffic','/e/','Database:\x20','\x22\x20paused','join','journeyId','history','journey:pull','parent_segment','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','type','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','nodes','\x20journey','stages','cwd','verbose','yes','Error:\x20Journey\x20\x27','diff','Pattern:\x20','getSegment','Fetching\x20users\x20and\x20connections...','listFolders','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Fetching\x20','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','resume','getStatistics','journey','/j/da','getColumnMapping','Show\x20journey\x20table\x20column\x20mapping','...','segmentPushCommand','listJourneysFromParentSegment','journey:version:create','activation','audienceId','dim','draft','replace','folderId','getTrafficData','Cancelled','\x20\x20Parent\x20segment:\x20','absolutePath','journey:versions','connection','List\x20all\x20versions\x20of\x20a\x20journey','parentSegment','Creating\x20new\x20version...','5XMuDfm','all','INVALID_ARGUMENT','dryRun','activationParams','log','data','Error:\x20Parent\x20segment\x20context\x20required','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','/app/ps/','journeyBundleId','exitOrJumpSize','renderStats','push','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Resume\x20a\x20paused\x20journey','from','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','getJourney','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Warning:\x20Could\x20not\x20resolve\x20segment\x20','no_parent','Found\x20','goalSize','createdAt','folderPath','Error:\x20','tsv','map','\x20\x20-\x20','filter','\x20(rule\x20match)','\x20=\x20','\x20\x20Statistics\x20not\x20available','\x0aChanges\x20to\x20\x27','\x5c$&','6488130cbDWBD','milestoneSize','parentName','updatedAt','database','add','relativePath','folders','Options:','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','segments','Parent\x20segment:\x20','\x20\x20Target:\x20','journeyBundleName','journey:resume','entries','includeStats','/j/da/je','state','utf-8','Show\x20journey\x20details','pause','execute','options','\x27\x20not\x20found\x20in\x20','connector_config','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Pause\x20a\x20running\x20journey','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','values','hasChanges','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','resolveParentId','Error:\x20Invalid\x20version\x20number:\x20','270xuGYQy','Table:\x20','(root)','📁\x20','258220OiFkMB','Getting\x20journey\x20details...','journey:stats','rule','localeCompare','resolveSegment','\x0aError:','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Folder\x20path:\x20','\x20Created\x20v','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','(running)','\x20not\x20found.\x20Available:\x20','\x20unchanged\x20files','includeHistory','journeyStages','Input:\x20','sort','launched','✔\x20Journey\x20\x22','relative','886gOghwM','Resolving\x20journey...','error','listVersions','Getting\x20column\x20mapping...','\x20\x20Name:\x20','resolveJourneyId','segment','\x20version','Error:\x20Stage\x20\x22','filePath','✔\x20All\x20files\x20are\x20up\x20to\x20date','stageNameMap','\x20new\x20files','Getting\x20journey\x20traffic\x20data...','paused','split','site','\x20->\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','table','Aborted.','format','✔\x20Context\x20set:\x20','List\x20journeys\x20in\x20current\x20context','Resolved\x20YAML\x20file:\x20','buildIdToEmailMap','json','Resolving\x20parent\x20segment...','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)','journeyName','getLatestJourneyId','Listing\x20journey\x20activations...','red','(completed)','exitOrJumpRate','segmentName','repeat','2354180mpGWfq','getParentFull','base','helpText','args','No\x20statistics\x20available\x20for\x20journey:\x20','Resuming\x20journey...','session','test','39984604JWxriD','\x20\x20Folder\x20path:\x20','name','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','-\x20no\x20files\x20written','journey:list','(draft)','columns','.yml','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','journey:push','Resolving\x20version...','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','completionRate','(paused)','Getting\x20version\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','file','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','description','length','errorCode','get','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Write\x20','reentryMode','285838dTjtPp','size','2229NFUOhV','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','4143132jytfTC','\x20changed\x20files','then','find','\x20\x20Journey\x20ID:\x20','jsonl','web','versionNumber','attributes','toLowerCase','listJourneysWithFolders','activation_','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','rootFolderId','user','has','targetDir','set','\x0aPull\x20summary:','listActivationsFlat','conversion'];a27_0x589b=function(){return _0x1961dd;};return a27_0x589b();}function escapeRegex(_0x4d55b4){const _0x37ed31=a27_0x4aef;return _0x4d55b4[_0x37ed31(0x147)](/[.*+?^${}()|[\]\\]/g,_0x37ed31(0x175));}function globToRegex(_0x1f1e73){const _0x5b41d3=a27_0x4aef,_0x13f1a7=_0x1f1e73[_0x5b41d3(0x1c1)]('*')[_0x5b41d3(0x16e)](escapeRegex);return new RegExp(_0x13f1a7['join']('.*'),'i');}function buildRuleToNameMapping(_0x7bab84){const _0x202842=a27_0x4aef,_0x110bd8=new Map();if(_0x7bab84[_0x202842(0x180)])for(const [_0xdca981,_0x50b50a]of Object[_0x202842(0x185)](_0x7bab84['segments'])){if(_0x50b50a['rule']){const _0x49a46d=serializeRule(_0x50b50a[_0x202842(0x19f)]),_0x2b2e7d=_0x110bd8[_0x202842(0x1f8)](_0x49a46d);_0x2b2e7d?_0x2b2e7d[_0x202842(0x15f)](_0xdca981):_0x110bd8[_0x202842(0x105)](_0x49a46d,[_0xdca981]);}}return _0x110bd8;}async function resolveJourneyIdFromInput(_0x1dc860,_0x2f366b,_0x50dd28){const _0x9bf588=a27_0x4aef,_0xc1cbd=await resolveJourneyTarget(_0x1dc860,_0x2f366b[_0x9bf588(0x150)],_0x2f366b[_0x9bf588(0x12e)]),_0x37800e=_0xc1cbd[_0x9bf588(0x150)];if(!_0x37800e)throw new SDKError(ErrorCode[_0x9bf588(0x154)],_0x9bf588(0x1f0));const _0x2b286a=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x50dd28[_0x9bf588(0x1b8)][_0x9bf588(0x196)](_0x37800e),{'verbose':_0x2f366b[_0x9bf588(0x12e)]}),_0x5e2158=_0x2b286a[_0x9bf588(0x158)],_0x38298a=await withSpinner(_0x9bf588(0x1b2),()=>_0x50dd28[_0x9bf588(0x13b)][_0x9bf588(0x1b7)](_0x5e2158,_0xc1cbd[_0x9bf588(0x1cf)]),{'verbose':_0x2f366b[_0x9bf588(0x12e)]});return{'journeyId':_0x38298a['data'],'journeyName':_0xc1cbd[_0x9bf588(0x1cf)],'parentSegmentId':_0x5e2158};}async function resolveJourneyTarget(_0x3004ca,_0x488471,_0x39af02){const _0x5d06f0=a27_0x4aef;if(isYamlFilePath(_0x3004ca))try{const _0x54be56=await resolveYamlFilePath(_0x3004ca);return _0x39af02&&(console[_0x5d06f0(0x1b3)](_0x5d06f0(0x1ca)+_0x3004ca),console[_0x5d06f0(0x1b3)](_0x5d06f0(0x14b)+_0x54be56[_0x5d06f0(0x150)]),console[_0x5d06f0(0x1b3)](_0x5d06f0(0x1b6)+_0x54be56[_0x5d06f0(0x1d5)]),console[_0x5d06f0(0x1b3)](_0x5d06f0(0x1e1)+(_0x54be56[_0x5d06f0(0x16b)]||'(root)'))),{'journeyName':_0x54be56[_0x5d06f0(0x1d5)],'parentSegment':_0x54be56['parentSegment'],'resolved':_0x54be56};}catch(_0x478570){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5d06f0(0x195)+_0x478570[_0x5d06f0(0xff)]);}if(!_0x488471)throw new SDKError(ErrorCode[_0x5d06f0(0x154)],_0x5d06f0(0x1e9));return{'journeyName':_0x3004ca,'parentSegment':_0x488471};}export class JourneyListCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x1e5);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x1c9);async['execute'](_0x2337c0){const _0x397283=a27_0x256e1e,{options:_0x23ac4d,args:_0x2d7135,tdx:_0x43b953}=_0x2337c0,_0x2156a7=_0x2d7135[0x0],_0x4b9af2=_0x23ac4d[_0x397283(0x150)];if(!_0x4b9af2)return console['error'](_0x397283(0x159)),console[_0x397283(0x1b3)](_0x397283(0x160)),0x1;const _0x38abbd=await withSpinner(_0x397283(0x1cd),()=>_0x43b953[_0x397283(0x1b8)][_0x397283(0x196)](_0x4b9af2),{'verbose':_0x23ac4d[_0x397283(0x12e)]}),_0x160804=_0x38abbd['data'];_0x23ac4d['verbose']&&(console[_0x397283(0x1b3)](_0x397283(0x181)+_0x4b9af2+'\x20(ID:\x20'+_0x160804+')'),_0x2156a7&&console[_0x397283(0x1b3)](_0x397283(0x132)+_0x2156a7));const _0x36cbd7=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x43b953[_0x397283(0x1b8)][_0x397283(0x1d8)](_0x160804),{'verbose':_0x23ac4d[_0x397283(0x12e)]}),_0x423686=_0x36cbd7['data'],_0x4512a6=_0x423686[_0x397283(0x101)],_0x44e809=await withSpinner('Listing\x20journeys...',()=>_0x43b953[_0x397283(0x13b)][_0x397283(0xfd)](_0x160804,_0x4512a6),{'verbose':_0x23ac4d[_0x397283(0x12e)]});let _0x3adb02=_0x44e809[_0x397283(0x158)]['journeys'];const _0x46e591=_0x44e809['data'][_0x397283(0x17d)],_0xad5fdb=new Map();for(const _0x43908d of _0x46e591){_0xad5fdb[_0x397283(0x105)](_0x43908d['id'],_0x43908d['name']);}if(_0x2156a7){const _0x1667f2=globToRegex(_0x2156a7);_0x3adb02=_0x3adb02[_0x397283(0x170)](_0x1668ea=>_0x1667f2[_0x397283(0x1df)](_0x1668ea[_0x397283(0x183)]));}console['error']('✔\x20Found\x20'+_0x3adb02[_0x397283(0x1f6)]+_0x397283(0x12b)+(_0x3adb02['length']!==0x1?'s':''));const _0x90035d=_0x22069a=>{const _0x36a37d=_0x397283;return getConsoleNextUrl(_0x23ac4d[_0x36a37d(0x1c2)],_0x36a37d(0x15b)+_0x160804+_0x36a37d(0x11f)+_0x22069a+_0x36a37d(0x13c));};if(_0x23ac4d[_0x397283(0x1c7)]===_0x397283(0x1c5))await handleSDKOutput(_0x3adb02,_0x23ac4d);else{if(_0x23ac4d[_0x397283(0x1c7)]===_0x397283(0x1cc)){const _0x23909a=_0x3adb02[_0x397283(0x16e)](_0x568711=>({..._0x568711,'url':_0x90035d(_0x568711['id'])}));await handleSDKOutput(_0x23909a,_0x23ac4d);}else{console[_0x397283(0x157)]('['+_0x4b9af2+']');const _0x24bb89=new Map(),_0x5aa7a1=[];for(const _0x2505fc of _0x3adb02){if(!_0x2505fc[_0x397283(0x148)]||_0x2505fc[_0x397283(0x148)]===_0x4512a6)_0x5aa7a1[_0x397283(0x15f)](_0x2505fc);else{const _0x4496b1=_0x24bb89[_0x397283(0x1f8)](_0x2505fc[_0x397283(0x148)])||[];_0x4496b1[_0x397283(0x15f)](_0x2505fc),_0x24bb89[_0x397283(0x105)](_0x2505fc['folderId'],_0x4496b1);}}const _0x2faaf1=(_0xcbe65b,_0xea9eab)=>_0xcbe65b[_0x397283(0x183)]['localeCompare'](_0xea9eab['journeyBundleName'],undefined,{'sensitivity':_0x397283(0x1d9)});_0x5aa7a1[_0x397283(0x1ad)](_0x2faaf1);for(const _0x15b3d4 of _0x5aa7a1){console[_0x397283(0x157)](formatJourneyItem(_0x15b3d4,'',_0x90035d(_0x15b3d4['id'])));}const _0x39415a=[..._0x24bb89[_0x397283(0x185)]()]['sort']((_0xe8610d,_0x5c7167)=>{const _0x1cc74c=_0x397283,_0x8aec7b=_0xad5fdb[_0x1cc74c(0x1f8)](_0xe8610d[0x0])||_0xe8610d[0x0],_0x460a23=_0xad5fdb[_0x1cc74c(0x1f8)](_0x5c7167[0x0])||_0x5c7167[0x0];return _0x8aec7b[_0x1cc74c(0x1a0)](_0x460a23,undefined,{'sensitivity':_0x1cc74c(0x1d9)});});for(const [_0x4490e4,_0x564bee]of _0x39415a){const _0x4bc10f=_0xad5fdb[_0x397283(0x1f8)](_0x4490e4)||_0x4490e4;console[_0x397283(0x157)](_0x397283(0x19b)+_0x4bc10f),_0x564bee['sort'](_0x2faaf1);for(const _0xd0cc87 of _0x564bee){console[_0x397283(0x157)](formatJourneyItem(_0xd0cc87,'\x20\x20',_0x90035d(_0xd0cc87['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]='journey:view';[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x18a);async[a27_0x256e1e(0x18c)](_0x5bf5f0){const _0x4a22c1=a27_0x256e1e,{options:_0x424f84,args:_0x4b98c3,tdx:_0x5f0124}=_0x5bf5f0,_0x2ea55d=_0x4b98c3[0x0];if(!_0x2ea55d)return console[_0x4a22c1(0x1b3)](_0x4a22c1(0xf2)),console[_0x4a22c1(0x1b3)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x4a22c1(0x1b3)](_0x4a22c1(0x17e)),console[_0x4a22c1(0x1b3)](_0x4a22c1(0x165)),0x1;_0x424f84[_0x4a22c1(0x12e)]&&console[_0x4a22c1(0x1b3)](_0x4a22c1(0x1ac)+_0x2ea55d);const {journeyId:_0x1b55dd,parentSegmentId:_0x32bdc3}=await resolveJourneyIdFromInput(_0x2ea55d,_0x424f84,_0x5f0124);if(_0x424f84[_0x4a22c1(0xf9)]){const _0x596db9=getConsoleNextUrl(_0x424f84[_0x4a22c1(0x1c2)],'/app/ps/'+_0x32bdc3+_0x4a22c1(0x11f)+_0x1b55dd+_0x4a22c1(0x187));return console[_0x4a22c1(0x1b3)](a27_0x13d74a[_0x4a22c1(0x11a)]('✔')+_0x4a22c1(0x10f)+a27_0x13d74a['cyan'](_0x596db9)),openBrowser(_0x596db9),0x0;}const _0x4fed1b=await withSpinner(_0x4a22c1(0x19d),()=>_0x5f0124['journey']['getJourney'](_0x1b55dd),{'verbose':_0x424f84['verbose']}),_0x2fce78=_0x4fed1b[_0x4a22c1(0x158)],_0x13d047=_0x424f84[_0x4a22c1(0x186)];let _0x6b77d0;if(_0x13d047)try{const _0x2ae02a=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x5f0124['journey'][_0x4a22c1(0x13a)](_0x1b55dd),{'verbose':_0x424f84['verbose']});_0x6b77d0=_0x2ae02a[_0x4a22c1(0x158)];}catch{_0x424f84[_0x4a22c1(0x12e)]&&console['error'](_0x4a22c1(0x173));}const _0x437ae=getConsoleNextUrl(_0x424f84[_0x4a22c1(0x1c2)],_0x4a22c1(0x15b)+_0x32bdc3+_0x4a22c1(0x11f)+_0x1b55dd+_0x4a22c1(0x187)),_0x390654={'id':_0x2fce78['id'],'name':_0x2fce78['attributes'][_0x4a22c1(0x1e2)],'description':_0x2fce78[_0x4a22c1(0xfb)][_0x4a22c1(0x1f5)],'state':_0x2fce78[_0x4a22c1(0xfb)][_0x4a22c1(0x188)],'paused':_0x2fce78[_0x4a22c1(0xfb)][_0x4a22c1(0x1c0)],'reentry_mode':_0x2fce78['attributes'][_0x4a22c1(0xee)],'stages':_0x2fce78['attributes'][_0x4a22c1(0x1ab)]?.[_0x4a22c1(0x1f6)]||0x0,..._0x2fce78['attributes'][_0x4a22c1(0x110)]&&{'goal':_0x2fce78['attributes'][_0x4a22c1(0x110)][_0x4a22c1(0x1e2)]},..._0x6b77d0&&{'statistics':{'size':_0x6b77d0[_0x4a22c1(0xf0)],'entered':_0x6b77d0[_0x4a22c1(0x10b)],'goal_achieved':_0x6b77d0[_0x4a22c1(0x169)],'completion_rate':_0x6b77d0[_0x4a22c1(0x1ed)],'exit_or_jump':_0x6b77d0[_0x4a22c1(0x15d)],'exit_or_jump_rate':_0x6b77d0[_0x4a22c1(0x1d4)],'stages':_0x6b77d0[_0x4a22c1(0x12c)]}},'url':_0x437ae};return await handleSingleObjectOutput(_0x390654,_0x424f84),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x19e);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x114);async['execute'](_0x2e423a){const _0x5ddf02=a27_0x256e1e,{options:_0x2cc0fb,args:_0x1c2af8,tdx:_0x4286e2}=_0x2e423a,_0x3eeff7=_0x1c2af8[0x0];if(!requireNameOrPath(_0x3eeff7))return 0x1;_0x2cc0fb[_0x5ddf02(0x12e)]&&console[_0x5ddf02(0x1b3)](_0x5ddf02(0x1ac)+_0x3eeff7);const _0x1a95d4=_0x2cc0fb,_0x403eb2=_0x1a95d4[_0x5ddf02(0x162)],_0x404d53=_0x1a95d4['to'],_0x15014d=_0x1a95d4['includeHistory'],_0x8cc70e=_0x1a95d4['stage'];_0x15014d&&!_0x403eb2&&!_0x404d53&&console[_0x5ddf02(0x1b3)](_0x5ddf02(0x136));const _0x411056=_0x15014d?withJsonFormat(_0x2cc0fb):_0x2cc0fb,{journeyId:_0x7d460e,journeyName:_0x58bda5}=await resolveJourneyIdFromInput(_0x3eeff7,_0x411056,_0x4286e2),_0x50bc11=_0x403eb2||_0x404d53?{'from':_0x403eb2,'to':_0x404d53}:undefined,_0x153f1e=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x5ddf02(0x153)]([_0x4286e2['journey'][_0x5ddf02(0x164)](_0x7d460e),_0x4286e2[_0x5ddf02(0x13b)]['getStatistics'](_0x7d460e,_0x50bc11)]),{'verbose':_0x411056['verbose']}),[_0x2abbc7,_0x16dd8f]=_0x153f1e[_0x5ddf02(0x158)];if(!_0x16dd8f||_0x16dd8f[_0x5ddf02(0x123)]===null)return console[_0x5ddf02(0x1b3)](_0x5ddf02(0x1dc)+_0x58bda5),console[_0x5ddf02(0x1b3)](_0x5ddf02(0x1a6)),0x0;const _0x31ff62=buildStageNameMap(_0x2abbc7),_0xfc5286=!!(_0x50bc11&&_0x16dd8f[_0x5ddf02(0x124)]?.[_0x5ddf02(0x1f6)]),_0x3f3e3f={'stageNameMap':_0x31ff62,'hasPeriod':_0xfc5286,'includeHistory':!!_0x15014d};if(_0x8cc70e&&_0x16dd8f[_0x5ddf02(0x12c)]){const _0x47b85e=_0x16dd8f[_0x5ddf02(0x12c)][_0x5ddf02(0xf6)](_0x93fa01=>{const _0x32bbbb=_0x5ddf02,_0x1be7ab=_0x31ff62[_0x32bbbb(0x1f8)](_0x93fa01['id'])??'';return _0x1be7ab['toLowerCase']()===_0x8cc70e[_0x32bbbb(0xfc)]();});if(_0x47b85e)return await handleSingleObjectOutput(formatStageStats(_0x47b85e,_0x3f3e3f),_0x411056),0x0;const _0x312bc0=_0x16dd8f[_0x5ddf02(0x12c)][_0x5ddf02(0x16e)](_0x307fbe=>_0x31ff62[_0x5ddf02(0x1f8)](_0x307fbe['id'])??_0x307fbe['id']);return console[_0x5ddf02(0x1b3)](_0x5ddf02(0x1ba)+_0x8cc70e+'\x22\x20not\x20found'),console[_0x5ddf02(0x1b3)]('Available\x20stages:\x20'+_0x312bc0[_0x5ddf02(0x122)](',\x20')),0x1;}const _0x41e3ef=_0x16dd8f[_0x5ddf02(0x12c)]?.['map'](_0x50393a=>formatStageStats(_0x50393a,_0x3f3e3f)),_0x3651c4=assembleJourneyStats(_0x16dd8f,{'from':_0x403eb2,'to':_0x404d53,'includeHistory':_0x15014d});return await this['renderStats'](_0x3651c4,_0x41e3ef??[],_0x411056),0x0;}async[a27_0x256e1e(0x15e)](_0x333cb7,_0x2f3cdc,_0x22a9ad){const _0x2ef83f=a27_0x256e1e,_0x247e39=_0x22a9ad[_0x2ef83f(0x1c7)]===_0x2ef83f(0x1cc)||_0x22a9ad[_0x2ef83f(0x1c7)]==='jsonl'||_0x22a9ad['json']||_0x22a9ad['jsonl'];if(_0x247e39){_0x333cb7[_0x2ef83f(0x12c)]=_0x2f3cdc,await handleSingleObjectOutput(_0x333cb7,_0x22a9ad);return;}await handleSingleObjectOutput(_0x333cb7,_0x22a9ad);for(const _0x4a20cd of _0x2f3cdc){console[_0x2ef83f(0x157)](''),console['log'](String(a27_0x13d74a[_0x2ef83f(0x11d)]['bold']('['+_0x4a20cd['name']+']'))+a27_0x13d74a[_0x2ef83f(0x145)]('\x20'+_0x4a20cd['id']));const {id:_0x442135,name:_0x49b80c,..._0x1ad3ba}=_0x4a20cd;await handleSingleObjectOutput(_0x1ad3ba,_0x22a9ad);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x11e);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x192);async[a27_0x256e1e(0x18c)](_0x185918){const _0x4d1fc8=a27_0x256e1e,{options:_0x551a03,args:_0x275af4,tdx:_0x403b33}=_0x185918,_0x4ce32e=_0x275af4[0x0];if(!requireNameOrPath(_0x4ce32e))return 0x1;_0x551a03['verbose']&&console[_0x4d1fc8(0x1b3)]('Input:\x20'+_0x4ce32e);const _0x260ba7=_0x551a03,_0x50bb4d=_0x260ba7[_0x4d1fc8(0x128)],_0x2abc0f=_0x260ba7[_0x4d1fc8(0x162)],_0x362e87=_0x260ba7['to'],_0x2b5ded=_0x260ba7[_0x4d1fc8(0x117)];if(_0x50bb4d&&_0x50bb4d!==_0x4d1fc8(0x108)&&_0x50bb4d!==_0x4d1fc8(0x143))return console[_0x4d1fc8(0x1b3)](_0x4d1fc8(0x113)+_0x50bb4d+_0x4d1fc8(0x1c4)),0x1;const _0x5e5ff4=withJsonFormat(_0x551a03),{journeyId:_0x356fbb,journeyName:_0x8edc3e}=await resolveJourneyIdFromInput(_0x4ce32e,_0x5e5ff4,_0x403b33),_0x4a5c88={'type':_0x50bb4d,'from':_0x2abc0f,'to':_0x362e87,'limit':_0x2b5ded},_0x498b71=await withSpinner(_0x4d1fc8(0x1bf),()=>_0x403b33[_0x4d1fc8(0x13b)][_0x4d1fc8(0x149)](_0x356fbb,_0x4a5c88),{'verbose':_0x5e5ff4[_0x4d1fc8(0x12e)]}),_0x4bcb38=_0x498b71['data'],_0x19edb7=_0x4bcb38[_0x4d1fc8(0x108)]&&(_0x4bcb38[_0x4d1fc8(0x108)][_0x4d1fc8(0x12a)][_0x4d1fc8(0x1f6)]>0x0||_0x4bcb38[_0x4d1fc8(0x108)]['links'][_0x4d1fc8(0x1f6)]>0x0),_0x2418bf=_0x4bcb38[_0x4d1fc8(0x143)]&&_0x4bcb38[_0x4d1fc8(0x143)][_0x4d1fc8(0x1f6)]>0x0;if(!_0x19edb7&&!_0x2418bf)return console[_0x4d1fc8(0x1b3)](_0x4d1fc8(0x1e3)+_0x8edc3e),console[_0x4d1fc8(0x1b3)](_0x4d1fc8(0x17f)),_0x2abc0f&&_0x362e87&&console['error'](_0x4d1fc8(0x15a)),0x0;return await handleSingleObjectOutput(_0x4bcb38,_0x5e5ff4),0x0;}}function formatStageStats(_0x501a80,_0x58a9e2){const _0x1b5fad=a27_0x256e1e,_0x55ecbf=_0x58a9e2[_0x1b5fad(0x10c)]&&_0x501a80[_0x1b5fad(0x124)]?.[_0x1b5fad(0x1f6)]?aggregateStageHistory(_0x501a80[_0x1b5fad(0x124)]):{'size':_0x501a80[_0x1b5fad(0xf0)],'entered':_0x501a80[_0x1b5fad(0x10b)],'milestone':_0x501a80[_0x1b5fad(0x177)],'milestone_rate':_0x501a80['completeMilestoneRate'],'exit_or_jump':_0x501a80[_0x1b5fad(0x15d)],'exit_or_jump_rate':_0x501a80[_0x1b5fad(0x1d4)]},_0x436ba9={'id':_0x501a80['id'],'name':_0x58a9e2[_0x1b5fad(0x1bd)][_0x1b5fad(0x1f8)](_0x501a80['id'])??_0x501a80['id'],..._0x55ecbf};return _0x58a9e2[_0x1b5fad(0x10c)]&&_0x58a9e2[_0x1b5fad(0x1aa)]&&_0x501a80['history']&&(_0x436ba9[_0x1b5fad(0x124)]=_0x501a80[_0x1b5fad(0x124)]),_0x436ba9;}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x191);async['execute'](_0x553b8e){const _0x11f950=a27_0x256e1e,{options:_0x46734a,args:_0x46b72d,tdx:_0x18aa95}=_0x553b8e,_0x3f2230=_0x46b72d[0x0];if(!requireNameOrPath(_0x3f2230))return 0x1;_0x46734a[_0x11f950(0x12e)]&&console['error']('Input:\x20'+_0x3f2230);const {journeyId:_0x2f422a,journeyName:_0x41d638}=await resolveJourneyIdFromInput(_0x3f2230,_0x46734a,_0x18aa95);if(!_0x46734a[_0x11f950(0x12f)]){const _0x16baf5=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x41d638+'\x22?');if(!_0x16baf5)return console[_0x11f950(0x1b3)](_0x11f950(0x14a)),0x0;}const _0x4ac89a=await withSpinner('Pausing\x20journey...',()=>_0x18aa95[_0x11f950(0x13b)][_0x11f950(0x18b)](_0x2f422a),{'verbose':_0x46734a[_0x11f950(0x12e)]}),_0x1d05c7=_0x4ac89a[_0x11f950(0x158)];return console[_0x11f950(0x1b3)]('✔\x20Journey\x20\x22'+_0x1d05c7['attributes'][_0x11f950(0x1e2)]+_0x11f950(0x121)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x184);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x161);async[a27_0x256e1e(0x18c)](_0x506a86){const _0x1c3bb1=a27_0x256e1e,{options:_0x1127d8,args:_0x586297,tdx:_0x201ebc}=_0x506a86,_0x9886f4=_0x586297[0x0];if(!requireNameOrPath(_0x9886f4))return 0x1;_0x1127d8[_0x1c3bb1(0x12e)]&&console[_0x1c3bb1(0x1b3)]('Input:\x20'+_0x9886f4);const {journeyId:_0x34c7ff,journeyName:_0x3de335}=await resolveJourneyIdFromInput(_0x9886f4,_0x1127d8,_0x201ebc);if(!_0x1127d8[_0x1c3bb1(0x12f)]){const _0x182ab8=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x3de335+'\x22?');if(!_0x182ab8)return console['error'](_0x1c3bb1(0x14a)),0x0;}const _0x1631f8=await withSpinner(_0x1c3bb1(0x1dd),()=>_0x201ebc[_0x1c3bb1(0x13b)][_0x1c3bb1(0x139)](_0x34c7ff),{'verbose':_0x1127d8[_0x1c3bb1(0x12e)]}),_0x3ec6be=_0x1631f8['data'];return console[_0x1c3bb1(0x1b3)](_0x1c3bb1(0x1af)+_0x3ec6be['attributes'][_0x1c3bb1(0x1e2)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x256e1e(0x125);[a27_0x256e1e(0x1f5)]='Export\x20journey(s)\x20as\x20YAML\x20files';async['execute'](_0x2f0b85){const _0x29baf6=a27_0x256e1e,{options:_0xcbff53,args:_0x9a9aa0,tdx:_0x24f114}=_0x2f0b85,_0x4313c3=_0xcbff53,_0xc06bf5=_0x9a9aa0[0x0],_0x5a025a=_0xc06bf5&&isYamlFilePath(_0xc06bf5),_0x25b650=await resolveTarget({'arg':_0x5a025a?_0xc06bf5:undefined,'contextParent':_0xcbff53[_0x29baf6(0x150)],'cwd':process[_0x29baf6(0x12d)]()});if(!isSuccessfulResolution(_0x25b650))return _0x25b650[_0x29baf6(0x1f7)]===_0x29baf6(0x167)?(console['error'](a27_0x13d74a[_0x29baf6(0x119)](_0x29baf6(0x116))),console[_0x29baf6(0x1b3)](_0x29baf6(0x1ce)),console[_0x29baf6(0x1b3)](_0x29baf6(0x111)),console[_0x29baf6(0x1b3)](_0x29baf6(0x100)),console[_0x29baf6(0x1b3)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a27_0x13d74a[_0x29baf6(0x1d2)](_0x29baf6(0x16c)+_0x25b650[_0x29baf6(0xff)]+'\x0a')),_0x25b650[_0x29baf6(0x1da)]&&console[_0x29baf6(0x1b3)](a27_0x13d74a['cyan'](_0x25b650[_0x29baf6(0x1da)]))),0x1;let _0x4f59b5=_0x5a025a?undefined:_0xc06bf5,_0x14c3db,_0x1ab195;_0x25b650[_0x29baf6(0x128)]===_0x29baf6(0x1f3)&&(_0x4f59b5=_0x25b650['resourceName'],_0x14c3db=_0x25b650[_0x29baf6(0x1bb)],_0x1ab195=_0x25b650['folderPath']);const _0x38017a=_0x25b650[_0x29baf6(0x178)],_0x3bff0f=_0x25b650[_0x29baf6(0x104)];_0x4313c3[_0x29baf6(0x12e)]&&(console['error'](_0x29baf6(0x181)+_0x38017a),console[_0x29baf6(0x1b3)]('Target\x20directory:\x20'+_0x3bff0f),_0x4f59b5&&console['error']('Journey\x20name:\x20'+_0x4f59b5),_0x14c3db&&console[_0x29baf6(0x1b3)]('Target\x20file:\x20'+_0x14c3db),_0x1ab195&&console[_0x29baf6(0x1b3)](_0x29baf6(0x1a4)+_0x1ab195));const _0xe005a4=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x24f114[_0x29baf6(0x1b8)][_0x29baf6(0x196)](_0x38017a),{'verbose':_0xcbff53['verbose']}),_0x1d1ffb=_0xe005a4[_0x29baf6(0x158)],{journeys:_0x450cfc,folders:_0x7394fa}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x12555c=_0x29baf6,[_0x19c308,_0x4f71e0]=await Promise[_0x12555c(0x153)]([_0x24f114[_0x12555c(0x13b)][_0x12555c(0x141)](_0x1d1ffb,undefined,{'includeAllVersions':!![]}),_0x24f114['segment'][_0x12555c(0x135)](_0x1d1ffb)]);return{'journeys':_0x19c308,'folders':_0x4f71e0};},{'verbose':_0xcbff53['verbose']})['then'](_0x4a66a7=>_0x4a66a7['data']);let _0x1a8aae=_0x450cfc;const _0x15756c=buildFolderIdToPathMap(_0x7394fa);if(_0x4f59b5){const _0xe13e6c=_0x1a8aae['filter'](_0x185284=>_0x185284[_0x29baf6(0x183)][_0x29baf6(0xfc)]()===_0x4f59b5['toLowerCase']());if(_0xe13e6c[_0x29baf6(0x1f6)]===0x0)return console[_0x29baf6(0x1b3)]('Error:\x20Journey\x20not\x20found:\x20'+_0x4f59b5),console[_0x29baf6(0x1b3)](_0x29baf6(0x163)),0x1;_0x1a8aae=_0xe13e6c;}if(_0x1ab195!==undefined){const _0x42e675=_0x1a8aae[_0x29baf6(0x170)](_0x3f0651=>{const _0x42d955=_0x29baf6,_0x421769=_0x3f0651[_0x42d955(0x148)]?_0x15756c[_0x42d955(0x1f8)](_0x3f0651['folderId'])||'':'';return _0x421769===_0x1ab195;});if(_0x42e675[_0x29baf6(0x1f6)]===0x0&&_0x1a8aae['length']>0x0){console[_0x29baf6(0x1b3)](_0x29baf6(0x130)+_0x4f59b5+_0x29baf6(0x18e)+(_0x1ab195||'root\x20folder')),console[_0x29baf6(0x1b3)](_0x29baf6(0x112));for(const _0x2696c9 of _0x1a8aae){const _0x100788=_0x2696c9[_0x29baf6(0x148)]?_0x15756c['get'](_0x2696c9[_0x29baf6(0x148)])||'':'';console[_0x29baf6(0x1b3)](_0x29baf6(0x16f)+(_0x100788||_0x29baf6(0x19a))+'/'+_0x2696c9[_0x29baf6(0x183)]);}return 0x1;}_0x1a8aae=_0x42e675;}if(_0x1a8aae[_0x29baf6(0x1f6)]===0x0)return console[_0x29baf6(0x1b3)]('No\x20journeys\x20found'),0x0;const _0x2e82a1=new Map();for(const _0x2ab94f of _0x1a8aae){const _0x30f358=_0x2ab94f[_0x29baf6(0x15c)];!_0x2e82a1['has'](_0x30f358)&&_0x2e82a1[_0x29baf6(0x105)](_0x30f358,[]),_0x2e82a1[_0x29baf6(0x1f8)](_0x30f358)[_0x29baf6(0x15f)](_0x2ab94f);}for(const _0x30402d of _0x2e82a1[_0x29baf6(0x193)]()){_0x30402d[_0x29baf6(0x1ad)]((_0x30fba1,_0x2026d1)=>(_0x30fba1['versionNumber']||0x0)-(_0x2026d1[_0x29baf6(0xfa)]||0x0));}const _0x285d05=[],{idToEmailMap:_0x21ee33,connectionIdToNameMap:_0x3adf3a}=await withSpinner(_0x29baf6(0x134),async()=>{const _0x159a54=_0x29baf6,[_0xf45ad7,_0x1dec96]=await Promise['all']([_0x24f114[_0x159a54(0x102)][_0x159a54(0x1cb)](),_0x24f114[_0x159a54(0x14e)]['buildIdToNameMap']()]);return{'idToEmailMap':_0xf45ad7,'connectionIdToNameMap':_0x1dec96};},{'verbose':_0xcbff53[_0x29baf6(0x12e)]})[_0x29baf6(0xf5)](_0x191eca=>_0x191eca[_0x29baf6(0x158)]);for(const _0x1b0827 of _0x2e82a1['values']()){const _0x1bb655=_0x1b0827[0x0][_0x29baf6(0x183)],_0x4ac73d=_0x1b0827[0x0][_0x29baf6(0x148)],_0x2dc094=_0x4ac73d?_0x15756c[_0x29baf6(0x1f8)](_0x4ac73d)||'':'',_0x2e71d7=_0x2dc094?a27_0x555498[_0x29baf6(0x122)](_0x3bff0f,_0x2dc094):_0x3bff0f,_0x554bec=_0x14c3db||a27_0x555498[_0x29baf6(0x122)](_0x2e71d7,sanitizeFileName(_0x1bb655)+_0x29baf6(0x1e8));let _0x63ce0b,_0x58439c;if(existsSync(_0x554bec))try{const _0x230781=readFileSync(_0x554bec,_0x29baf6(0x189)),_0x27f27e=parseYamlString(_0x230781);_0x58439c=_0x27f27e,_0x63ce0b=buildRuleToNameMapping(_0x27f27e),_0x4313c3[_0x29baf6(0x12e)]&&_0x63ce0b[_0x29baf6(0xf0)]>0x0&&console[_0x29baf6(0x1b3)](_0x29baf6(0x168)+_0x63ce0b[_0x29baf6(0xf0)]+_0x29baf6(0x1a3)+_0x1bb655);}catch(_0x4af506){_0x4313c3[_0x29baf6(0x12e)]&&console[_0x29baf6(0x1b3)](_0x29baf6(0x127)+_0x4af506[_0x29baf6(0xff)]);}const _0xedc798=[],_0x3b22e5=new Set(),_0xb7bffb=new Map(),_0x1e4641=new Map(),_0x3775f4=new Set(),_0x59d3e8=new Map(),_0x3baaa6=new Map(),_0x1b19b5=createJumpTargetCache();await withProgressSpinner(_0x29baf6(0x137)+_0x1bb655+_0x29baf6(0x13f),async _0x335406=>{const _0x15abfb=_0x29baf6;for(const _0x3655c5 of _0x1b0827){const _0x1a169b=_0x1b0827[_0x15abfb(0x1f6)]>0x1?_0x3655c5['journeyBundleName']+'\x20v'+(_0x3655c5['versionNumber']||0x1):_0x3655c5[_0x15abfb(0x183)];_0x335406['setPhase'](_0x15abfb(0x137)+_0x1a169b);const _0x22c29f=await _0x24f114[_0x15abfb(0x13b)][_0x15abfb(0x164)](_0x3655c5['id']),_0x58bda1=_0x22c29f[_0x15abfb(0xfb)]?.[_0x15abfb(0x144)],_0x4d78b1={'resolveSegment':async _0x190f6f=>{const _0x359aca=_0x15abfb;if(!_0x58bda1)return{'name':_0x190f6f,'isJourneyLocal':![]};const _0x5113ee=_0xb7bffb[_0x359aca(0x1f8)](_0x190f6f);if(_0x5113ee)return _0x5113ee;try{const _0x57e269=await _0x24f114['segment'][_0x359aca(0x133)](_0x58bda1,_0x190f6f),_0x15b291=_0x57e269['kind']===SEGMENT_KIND_JOURNEY;let _0x513987,_0x504f90=_0x57e269[_0x359aca(0x1e2)];if(_0x15b291&&_0x57e269[_0x359aca(0x19f)]){const _0x4c6f68=await segmentResponseToDef(_0x57e269,{'resolveSegmentName':async _0x3a6ab0=>{const _0x2a2315=_0x359aca,_0x1b045d=_0xb7bffb['get'](_0x3a6ab0);if(_0x1b045d)return _0x1b045d[_0x2a2315(0x1e2)];const _0x20e8d1=await _0x4d78b1[_0x2a2315(0x1a1)](_0x3a6ab0);return _0x20e8d1['name'];}}),_0x4c9791=_0x4c6f68[_0x359aca(0x19f)];_0x513987={'description':_0x57e269[_0x359aca(0x1f5)],'rule':_0x4c9791};const _0x890c3c=serializeRule(_0x4c9791),_0x1dcfd4=_0x1e4641[_0x359aca(0x1f8)](_0x890c3c);if(_0x1dcfd4)_0x504f90=_0x1dcfd4,_0x513987=undefined,_0x4313c3['verbose']&&console[_0x359aca(0x1b3)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x57e269[_0x359aca(0x1e2)]+_0x359aca(0x1c3)+_0x1dcfd4);else{let _0x189c34=![];if(_0x63ce0b){const _0x5341bc=_0x63ce0b[_0x359aca(0x1f8)](_0x890c3c);if(_0x5341bc){const _0x4b816c=_0x5341bc[_0x359aca(0xf6)](_0x1e5556=>!_0x3b22e5[_0x359aca(0x103)](_0x1e5556));_0x4b816c&&(_0x504f90=_0x4b816c,_0x3b22e5[_0x359aca(0x17b)](_0x4b816c),_0x1e4641[_0x359aca(0x105)](_0x890c3c,_0x4b816c),_0x189c34=!![],_0x4313c3[_0x359aca(0x12e)]&&console[_0x359aca(0x1b3)](_0x359aca(0x1f1)+_0x4b816c+_0x359aca(0x171)));}}if(!_0x189c34){const _0xf4661f=generateJourneyLocalName(_0x57e269[_0x359aca(0x1e2)]);_0xf4661f&&(_0x504f90=_0xf4661f);let _0x26f22f=_0x504f90,_0x24000c=0x2;while(_0x3b22e5[_0x359aca(0x103)](_0x26f22f)){_0x26f22f=_0x504f90+'_'+_0x24000c,_0x24000c++;}_0x3b22e5[_0x359aca(0x17b)](_0x26f22f),_0x1e4641[_0x359aca(0x105)](_0x890c3c,_0x26f22f),_0x504f90=_0x26f22f;}}}const _0x571dac={'name':_0x504f90,'isJourneyLocal':_0x15b291,'definition':_0x513987};return _0xb7bffb[_0x359aca(0x105)](_0x190f6f,_0x571dac),_0x571dac;}catch(_0x343346){return _0xcbff53[_0x359aca(0x12e)]&&console['error'](_0x359aca(0x166)+_0x190f6f+':\x20'+_0x343346['message']),{'name':_0x190f6f,'isJourneyLocal':![]};}},'resolveActivation':async _0x31cbbe=>{const _0xcfbe24=_0x15abfb,_0x2ec4b2=_0x59d3e8[_0xcfbe24(0x1f8)](_0x31cbbe);if(_0x2ec4b2)return _0x2ec4b2;try{const _0x4c5668=await _0x24f114[_0xcfbe24(0x13b)]['getActivation'](_0x3655c5['id'],_0x31cbbe),_0x3d9c25=journeyActivationStepToYaml(_0x4c5668,_0x21ee33,_0x3adf3a),_0x3744f7=JSON['stringify']({'name':_0x3d9c25[_0xcfbe24(0x1e2)],'connection':_0x3d9c25['connection'],'connector_config':_0x3d9c25[_0xcfbe24(0x18f)]}),_0xb01039=_0x3baaa6[_0xcfbe24(0x1f8)](_0x3744f7);if(_0xb01039){const _0x3b6ae1={'name':_0xb01039,'isJourneyLocal':!![],'definition':_0x3d9c25};return _0x59d3e8['set'](_0x31cbbe,_0x3b6ae1),_0x3b6ae1;}const _0x4a4b26=_0x4c5668[_0xcfbe24(0xfb)][_0xcfbe24(0x156)]['name']||_0x31cbbe,_0x1f46e1=sanitizeYamlKey(_0x4a4b26)||_0xcfbe24(0xfe)+_0x31cbbe;let _0x2e69fc=_0x1f46e1,_0x84187b=0x2;while(_0x3775f4[_0xcfbe24(0x103)](_0x2e69fc)){_0x2e69fc=_0x1f46e1+'_'+_0x84187b,_0x84187b++;}_0x3775f4[_0xcfbe24(0x17b)](_0x2e69fc),_0x3baaa6[_0xcfbe24(0x105)](_0x3744f7,_0x2e69fc);const _0x42fe9d={'name':_0x2e69fc,'isJourneyLocal':!![],'definition':_0x3d9c25};return _0x59d3e8[_0xcfbe24(0x105)](_0x31cbbe,_0x42fe9d),_0x42fe9d;}catch(_0x228e36){return _0xcbff53['verbose']&&console[_0xcfbe24(0x1b3)](_0xcfbe24(0xeb)+_0x31cbbe+':\x20'+_0x228e36[_0xcfbe24(0xff)]),{'name':_0x31cbbe,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x43119b,_0x415598)=>{const _0x101b07=_0x15abfb;return resolveJumpTarget(_0x43119b,_0x415598,_0x1b19b5,_0x3ec689=>_0x24f114[_0x101b07(0x13b)][_0x101b07(0x164)](_0x3ec689));}},_0x3a1526=await journeyResponseToDef(_0x22c29f,_0x4d78b1);_0xedc798[_0x15abfb(0x15f)]({'item':_0x3655c5,'yaml':_0x3a1526});}},{'verbose':_0xcbff53[_0x29baf6(0x12e)]});const _0x15eeea=await _0x24f114[_0x29baf6(0x13b)][_0x29baf6(0x1d0)](_0x1b0827[0x0][_0x29baf6(0x15c)]),_0x1ef79c=buildMergedJourneyDef(_0xedc798,_0x63ce0b,_0x15eeea),_0x5aed30=normalizeJourneyDef(_0x1ef79c,_0x58439c),_0x437d89=toYamlString(_0x5aed30),_0xbe085f=_0x14c3db||a27_0x555498[_0x29baf6(0x122)](_0x2e71d7,sanitizeFileName(_0x1bb655)+_0x29baf6(0x1e8));!_0x14c3db&&_0x2dc094&&!existsSync(_0x2e71d7)&&mkdirSync(_0x2e71d7,{'recursive':!![]});const _0xb40f9f=a27_0x555498[_0x29baf6(0x1b0)](process[_0x29baf6(0x12d)](),_0xbe085f);if(existsSync(_0xbe085f)){const _0x25cb51=readFileSync(_0xbe085f,_0x29baf6(0x189)),_0x1ace50=generateDiff(_0x25cb51,_0x437d89),_0x3a6e69=hasChanges(_0x1ace50);_0x285d05[_0x29baf6(0x15f)]({'relativePath':_0xb40f9f,'absolutePath':_0xbe085f,'content':_0x437d89,'isNew':![],'hasChanges':_0x3a6e69,'diff':_0x3a6e69?formatDiffWithColors(_0x1ace50):undefined});}else _0x285d05[_0x29baf6(0x15f)]({'relativePath':_0xb40f9f,'absolutePath':_0xbe085f,'content':_0x437d89,'isNew':!![],'hasChanges':![]});}const _0xaa376d=_0x285d05[_0x29baf6(0x170)](_0x14c51b=>_0x14c51b[_0x29baf6(0x11c)]),_0x18a951=_0x285d05[_0x29baf6(0x170)](_0x36a8ec=>!_0x36a8ec['isNew']&&_0x36a8ec[_0x29baf6(0x194)]),_0x221175=_0x285d05[_0x29baf6(0x170)](_0x1cf6e4=>!_0x1cf6e4[_0x29baf6(0x11c)]&&!_0x1cf6e4[_0x29baf6(0x194)]),_0x5b9115=_0x1a8aae['length'],_0x140068=_0x2e82a1['size'],_0x2d1737=_0x5b9115>_0x140068?'\x20('+_0x5b9115+'\x20versions)':'';console[_0x29baf6(0x1b3)](_0x29baf6(0x106)),console['error']('\x20\x20'+a27_0x13d74a[_0x29baf6(0x11d)](_0x140068+'\x20journeys')+a27_0x13d74a[_0x29baf6(0x145)](_0x2d1737)),console['error']('\x20\x20'+a27_0x13d74a[_0x29baf6(0x11a)]('+\x20'+_0xaa376d[_0x29baf6(0x1f6)]+_0x29baf6(0x1be))),console['error']('\x20\x20'+a27_0x13d74a[_0x29baf6(0x119)]('~\x20'+_0x18a951[_0x29baf6(0x1f6)]+_0x29baf6(0xf4))),console[_0x29baf6(0x1b3)]('\x20\x20'+a27_0x13d74a[_0x29baf6(0x145)]('=\x20'+_0x221175[_0x29baf6(0x1f6)]+_0x29baf6(0x1a9))),console[_0x29baf6(0x1b3)](_0x29baf6(0x182)+a27_0x13d74a['cyan'](_0x3bff0f)+'\x0a');if(_0x18a951['length']>0x0)for(const _0x5333ad of _0x18a951){console['error'](_0x29baf6(0x174)+_0x5333ad[_0x29baf6(0x17c)]+'\x27:'),console[_0x29baf6(0x1b3)]('─'['repeat'](0x3c)),console['error'](_0x5333ad[_0x29baf6(0x131)]),console[_0x29baf6(0x1b3)]('─'[_0x29baf6(0x1d6)](0x3c));}if(_0x4313c3[_0x29baf6(0x155)])return console[_0x29baf6(0x1b3)](a27_0x13d74a['yellow'](_0x29baf6(0xea))),0x0;if(_0xaa376d[_0x29baf6(0x1f6)]===0x0&&_0x18a951[_0x29baf6(0x1f6)]===0x0)return console[_0x29baf6(0x1b3)](a27_0x13d74a['green'](_0x29baf6(0x1bc))),saveSessionContext({'parent_segment':_0x38017a},_0x4313c3[_0x29baf6(0x1de)]),console[_0x29baf6(0x1b3)](a27_0x13d74a[_0x29baf6(0x11a)](_0x29baf6(0x1c8)+a27_0x13d74a[_0x29baf6(0x145)](_0x29baf6(0x126))+_0x29baf6(0x172)+a27_0x13d74a[_0x29baf6(0x11d)](_0x38017a))),0x0;if(!_0x4313c3[_0x29baf6(0x12f)]&&(_0xaa376d[_0x29baf6(0x1f6)]>0x0||_0x18a951['length']>0x0)){if(!isInteractive())return console[_0x29baf6(0x1b3)](a27_0x13d74a['red'](_0x29baf6(0x1a2)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x29baf6(0x1b3)](a27_0x13d74a['dim'](_0x29baf6(0x1f2))),0x1;const _0x358d6a=await confirmKey(_0x29baf6(0xed)+(_0xaa376d['length']+_0x18a951[_0x29baf6(0x1f6)])+'\x20files?');if(!_0x358d6a)return console['error'](a27_0x13d74a[_0x29baf6(0x119)](_0x29baf6(0x1c6)),_0x29baf6(0x1e4)),0x1;}!existsSync(_0x3bff0f)&&mkdirSync(_0x3bff0f,{'recursive':!![]});const _0x92a08d=a27_0x555498[_0x29baf6(0x122)](_0x3bff0f,_0x29baf6(0x10a));writeFileSync(_0x92a08d,createTdxConfigContent(_0x38017a),_0x29baf6(0x189));for(const _0x4cadea of _0x285d05){(_0x4cadea['isNew']||_0x4cadea[_0x29baf6(0x194)])&&writeFileSync(_0x4cadea[_0x29baf6(0x14c)],_0x4cadea['content'],_0x29baf6(0x189));}return console[_0x29baf6(0x1b3)](a27_0x13d74a[_0x29baf6(0x11a)]('✔\x20Pulled\x20'+(_0xaa376d[_0x29baf6(0x1f6)]+_0x18a951[_0x29baf6(0x1f6)])+'\x20journey\x20files\x20to\x20'+_0x3bff0f)),saveSessionContext({'parent_segment':_0x38017a},_0x4313c3[_0x29baf6(0x1de)]),console[_0x29baf6(0x1b3)](a27_0x13d74a[_0x29baf6(0x11a)](_0x29baf6(0x1c8)+a27_0x13d74a['dim'](_0x29baf6(0x126))+_0x29baf6(0x172)+a27_0x13d74a[_0x29baf6(0x11d)](_0x38017a))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']='journey:columns';[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x13e);async['execute'](_0x277d85){const _0x67f6d5=a27_0x256e1e,{options:_0x58580c,args:_0x2fe3cf,tdx:_0x4efcba}=_0x277d85,_0x37a9c3=_0x2fe3cf[0x0];if(!requireNameOrPath(_0x37a9c3))return 0x1;_0x58580c[_0x67f6d5(0x12e)]&&console['error'](_0x67f6d5(0x1ac)+_0x37a9c3);const {journeyId:_0x2f7d1f}=await resolveJourneyIdFromInput(_0x37a9c3,_0x58580c,_0x4efcba),_0x34669d=await withSpinner(_0x67f6d5(0x1b5),()=>_0x4efcba['journey'][_0x67f6d5(0x13d)](_0x2f7d1f),{'verbose':_0x58580c[_0x67f6d5(0x12e)]}),_0x3bcfc0=_0x34669d[_0x67f6d5(0x158)];return console[_0x67f6d5(0x157)](_0x67f6d5(0x120)+_0x3bcfc0[_0x67f6d5(0x17a)]),console[_0x67f6d5(0x157)](_0x67f6d5(0x199)+_0x3bcfc0[_0x67f6d5(0x1c5)]),await handleSDKOutput(_0x3bcfc0[_0x67f6d5(0x1e7)],_0x58580c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]='journey:activations';[a27_0x256e1e(0x1f5)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x256e1e(0x18c)](_0x479a6f){const _0x400b2c=a27_0x256e1e,{options:_0x17a890,args:_0x216298,tdx:_0x580abb}=_0x479a6f,_0x79ef2b=_0x216298[0x0];if(!requireNameOrPath(_0x79ef2b))return 0x1;_0x17a890['verbose']&&console[_0x400b2c(0x1b3)](_0x400b2c(0x1ac)+_0x79ef2b);const {journeyId:_0x2fe89f}=await resolveJourneyIdFromInput(_0x79ef2b,_0x17a890,_0x580abb),_0x4266f5=await withSpinner(_0x400b2c(0x1d1),()=>_0x580abb[_0x400b2c(0x13b)][_0x400b2c(0x107)](_0x2fe89f),{'verbose':_0x17a890[_0x400b2c(0x12e)]}),_0xeaed83=_0x4266f5[_0x400b2c(0x158)];return console[_0x400b2c(0x1b3)](_0x400b2c(0x168)+_0xeaed83['length']+'\x20activation'+(_0xeaed83['length']!==0x1?'s':'')),await handleSDKOutput(_0xeaed83,_0x17a890),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x1ea);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x129);[a27_0x256e1e(0x140)]=new SegmentPushCommand();async[a27_0x256e1e(0x18c)](_0x1da25c){const _0x4dc741=a27_0x256e1e,_0x157b40=_0x1da25c[_0x4dc741(0x1db)][0x0];let _0x38d498;if(_0x157b40){const _0xa79de9=await resolveTarget({'arg':_0x157b40,'contextParent':_0x1da25c['options']['parentSegment'],'cwd':process[_0x4dc741(0x12d)]()});isSuccessfulResolution(_0xa79de9)&&_0xa79de9['type']===_0x4dc741(0x1f3)&&(_0x38d498=_0xa79de9[_0x4dc741(0x1bb)]);}const _0x3f2878={..._0x1da25c,'options':{..._0x1da25c[_0x4dc741(0x18d)],'journeysOnly':!![],..._0x38d498&&{'singleFilePath':_0x38d498}}};return this[_0x4dc741(0x140)][_0x4dc741(0x18c)](_0x3f2878);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x14d);['description']=a27_0x256e1e(0x14f);async[a27_0x256e1e(0x18c)](_0x580ea2){const _0x5418b0=a27_0x256e1e,{options:_0x4b3a8b,args:_0x53ef8c,tdx:_0x2730dc}=_0x580ea2,_0x171eb8=_0x53ef8c[0x0];if(!requireNameOrPath(_0x171eb8))return 0x1;if(_0x4b3a8b[_0x5418b0(0x12e)])console[_0x5418b0(0x1b3)](_0x5418b0(0x1ac)+_0x171eb8);const {journeyId:_0xf97d11}=await resolveJourneyIdFromInput(_0x171eb8,_0x4b3a8b,_0x2730dc),_0x49418c=await withSpinner('Listing\x20journey\x20versions...',()=>_0x2730dc[_0x5418b0(0x13b)][_0x5418b0(0x1b4)](_0xf97d11),{'verbose':_0x4b3a8b['verbose']}),{bundleName:_0x18af15,versions:_0x288581,latestJourneyId:_0x51b8c8}=_0x49418c['data'];console[_0x5418b0(0x1b3)](_0x18af15+':\x20'+_0x288581[_0x5418b0(0x1f6)]+_0x5418b0(0x1b9)+(_0x288581['length']!==0x1?'s':''));const _0x4a3cdc=_0x288581[_0x5418b0(0x16e)](_0x4201be=>({'version':_0x4201be['versionNumber'],'journey_id':_0x4201be[_0x5418b0(0x123)],'name':_0x4201be[_0x5418b0(0x1e2)],'state':_0x4201be[_0x5418b0(0x188)],'paused':_0x4201be[_0x5418b0(0x1c0)],'latest':_0x4201be[_0x5418b0(0x123)]===_0x51b8c8,'created_at':_0x4201be[_0x5418b0(0x16a)]}));return await handleSDKOutput(_0x4a3cdc,_0x4b3a8b),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x142);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x1ec);async['execute'](_0x31a132){const _0x9334f0=a27_0x256e1e,{options:_0x3cfd96,args:_0x53d543,tdx:_0x57243}=_0x31a132,_0x1345e6=_0x53d543[0x0];if(!requireNameOrPath(_0x1345e6))return 0x1;if(_0x3cfd96[_0x9334f0(0x12e)])console[_0x9334f0(0x1b3)](_0x9334f0(0x1ac)+_0x1345e6);const {journeyId:_0x205371,journeyName:_0xe4263a}=await resolveJourneyIdFromInput(_0x1345e6,_0x3cfd96,_0x57243);if(!_0x3cfd96['yes']){const _0x319c1f=await confirm(_0x9334f0(0x1f4)+_0xe4263a+'\x22?');if(!_0x319c1f)return console[_0x9334f0(0x1b3)](_0x9334f0(0x14a)),0x0;}const _0x5e0422=await withSpinner(_0x9334f0(0x151),()=>_0x57243[_0x9334f0(0x13b)]['createVersion'](_0x205371),{'verbose':_0x3cfd96['verbose']}),_0x597216=_0x5e0422[_0x9334f0(0x158)];return console['error'](a27_0x13d74a[_0x9334f0(0x11a)]('✔')+_0x9334f0(0x1a5)+_0x597216[_0x9334f0(0xfb)][_0x9334f0(0xfa)]+'\x20(draft)\x20—\x20\x22'+_0x597216['attributes'][_0x9334f0(0x1e2)]+'\x22'),console[_0x9334f0(0x1b3)](_0x9334f0(0xf7)+_0x597216['id']),await handleSingleObjectOutput({'id':_0x597216['id'],'name':_0x597216[_0x9334f0(0xfb)][_0x9334f0(0x1e2)],'version':_0x597216['attributes'][_0x9334f0(0xfa)],'state':_0x597216[_0x9334f0(0xfb)][_0x9334f0(0x188)],'bundle_id':_0x597216['attributes'][_0x9334f0(0x15c)],'created_at':_0x597216[_0x9334f0(0xfb)]['createdAt']},_0x3cfd96),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x118);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x190);async[a27_0x256e1e(0x18c)](_0x330730){const _0x5b31a0=a27_0x256e1e,{options:_0x1f1c10,args:_0x589cea,tdx:_0x56b6b6}=_0x330730,_0x4d6200=_0x589cea[0x0];if(!requireNameOrPath(_0x4d6200))return 0x1;const _0x520a32=_0x1f1c10['version'];if(!_0x520a32)return console['error'](_0x5b31a0(0x109)),console['error'](_0x5b31a0(0xec)),0x1;const _0x31d75c=parseInt(_0x520a32,0xa);if(isNaN(_0x31d75c)||_0x31d75c<0x1)return console[_0x5b31a0(0x1b3)](_0x5b31a0(0x197)+_0x520a32),0x1;if(_0x1f1c10[_0x5b31a0(0x12e)])console['error'](_0x5b31a0(0x1ac)+_0x4d6200+_0x5b31a0(0x115)+_0x31d75c);const {journeyId:_0xb63c72,parentSegmentId:_0x5c846f}=await resolveJourneyIdFromInput(_0x4d6200,_0x1f1c10,_0x56b6b6),_0x2eac85=await withSpinner(_0x5b31a0(0x1eb),()=>_0x56b6b6[_0x5b31a0(0x13b)][_0x5b31a0(0x1b4)](_0xb63c72),{'verbose':_0x1f1c10['verbose']}),{versions:_0x4d6cf0,latestJourneyId:_0x3d4f7a}=_0x2eac85['data'],_0x574667=_0x4d6cf0[_0x5b31a0(0xf6)](_0x3adbe5=>_0x3adbe5[_0x5b31a0(0xfa)]===_0x31d75c);if(!_0x574667){const _0x56cd13=_0x4d6cf0[_0x5b31a0(0x16e)](_0x3edd90=>'v'+_0x3edd90['versionNumber'])[_0x5b31a0(0x122)](',\x20');return console['error']('Error:\x20Version\x20'+_0x31d75c+_0x5b31a0(0x1a8)+_0x56cd13),0x1;}const _0x17b0e6=await withSpinner(_0x5b31a0(0x1ef)+_0x31d75c+'\x20details...',()=>_0x56b6b6['journey'][_0x5b31a0(0x164)](_0x574667[_0x5b31a0(0x123)]),{'verbose':_0x1f1c10['verbose']}),_0x28c22f=_0x17b0e6[_0x5b31a0(0x158)],_0x3d85dd=getConsoleNextUrl(_0x1f1c10[_0x5b31a0(0x1c2)],_0x5b31a0(0x15b)+_0x5c846f+'/e/'+_0x574667[_0x5b31a0(0x123)]+_0x5b31a0(0x187));return await handleSingleObjectOutput({'id':_0x28c22f['id'],'name':_0x28c22f[_0x5b31a0(0xfb)]['name'],'version':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0xfa)],'description':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x1f5)],'state':_0x28c22f['attributes'][_0x5b31a0(0x188)],'paused':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x1c0)],'reentry_mode':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0xee)],'stages':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x1ab)]?.['length']||0x0,..._0x28c22f['attributes'][_0x5b31a0(0x110)]&&{'goal':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x110)][_0x5b31a0(0x1e2)]},'latest':_0x574667[_0x5b31a0(0x123)]===_0x3d4f7a,'created_at':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x16a)],'updated_at':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x179)],'url':_0x3d85dd},_0x1f1c10),0x0;}}
1
+ const a27_0x27b7a2=a27_0x57ec;(function(_0x50a3c1,_0x5ef8e5){const _0x525ae2=a27_0x57ec,_0x448ea2=_0x50a3c1();while(!![]){try{const _0x490ca4=-parseInt(_0x525ae2(0x2d2))/0x1*(parseInt(_0x525ae2(0x2ba))/0x2)+-parseInt(_0x525ae2(0x2a1))/0x3*(-parseInt(_0x525ae2(0x21a))/0x4)+-parseInt(_0x525ae2(0x25f))/0x5+-parseInt(_0x525ae2(0x2b1))/0x6+parseInt(_0x525ae2(0x234))/0x7+-parseInt(_0x525ae2(0x291))/0x8+parseInt(_0x525ae2(0x1e8))/0x9;if(_0x490ca4===_0x5ef8e5)break;else _0x448ea2['push'](_0x448ea2['shift']());}catch(_0x5e2685){_0x448ea2['push'](_0x448ea2['shift']());}}}(a27_0x2afb,0xf0dbd));import a27_0xc564bb from'chalk';import a27_0x22d4ef 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';function a27_0x2afb(){const _0x482613=['\x27\x20not\x20found\x20in\x20','\x20details...','stringify','has','attributes','\x0aPull\x20summary:','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','audienceId','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','red','folderId','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Write\x20','List\x20journeys\x20in\x20current\x20context','hasPeriod','user','sort','Input:\x20','createVersion','Cancelled','root\x20folder','Listing\x20journeys...','journey','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Error:\x20--version\x20option\x20is\x20required','green','Show\x20journey\x20table\x20column\x20mapping','goalSize','Getting\x20journey\x20details...','enteredSize','\x20files?','-\x20no\x20files\x20written','Listing\x20journey\x20versions...','Fetching\x20parent\x20segment...','journey:version:create','conversion','Creating\x20new\x20version...','\x20new\x20files','9060304ArBuMy','test','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','folders','repeat','List\x20activations\x20for\x20a\x20journey','completionRate','utf-8','renderStats','\x20Created\x20v','✔\x20All\x20files\x20are\x20up\x20to\x20date','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','completeMilestoneRate','/app/ps/','message','13758qlTFtm','from','bold','add','Parent\x20segment:\x20','Resolving\x20version...','listJourneysWithFolders','\x20->\x20','journey:pull','execute','state','content','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','\x20Opening\x20','values','3466476gfjWVJ','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','INVALID_ARGUMENT','\x20(ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x20not\x20found.\x20Available:\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','getJourney','Resolving\x20parent\x20segment...','129586CJMXRy','Journey\x20name:\x20','dryRun','\x22\x20resumed','/j/da','journeys','columns','errorCode','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','getStatistics','\x20journey','segmentName','args','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x22\x20not\x20found','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','options','Getting\x20journey\x20statistics...','journeyBundleId','stages','stage','/j/da/je','7ooPdQh','history','parent_segment','find','data','then','relativePath','connector_config','limit','Getting\x20column\x20mapping...','/e/','hasChanges','base','journeyId','site','listJourneysFromParentSegment','\x20changed\x20files','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dim','size','all','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','4624902kKXZda','Error:\x20Parent\x20segment\x20context\x20required','segmentPushCommand','parentName','Fetching\x20journeys\x20and\x20folders...','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','milestoneSize','\x20journey\x20files\x20to\x20','\x20activation','includeStats','\x20(rule\x20match)','verbose','paused','set','parentSegment','📁\x20','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)','Error:\x20Invalid\x20version\x20number:\x20','Available\x20stages:\x20','\x20=\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','toLowerCase','push','nodes','createdAt','isNew','(paused)','pause','absolutePath','error','join','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','\x20journeys','🗺️\x20','\x20versions)','links','(root)','cyan','cwd','segment','Show\x20journey\x20details','List\x20all\x20versions\x20of\x20a\x20journey','Fetching\x20','filePath','\x22\x20paused','activation','json','Warning:\x20Could\x20not\x20resolve\x20activation\x20','activationParams','1220Ohycrq','resolveSegment','web','exitOrJumpSize','filter','Error:\x20Journey\x20not\x20found:\x20','resume','✔\x20Journey\x20\x22','\x20\x20Parent\x20segment:\x20','Resolving\x20journey...','Database:\x20','journeyBundleName','getColumnMapping','journey:push','resolveParentId','localeCompare','yes','goal','name','format','journey:resume','yellow','Found\x20','session','table','\x0aChanges\x20to\x20\x27','10787413rDYndH','resourceName','(running)','map','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','versionNumber','jsonl','kind','\x20\x20Journey\x20ID:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','getSegment','relative','...','replace','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','journey:stats','targetDir','database','buildIdToEmailMap','journey:activations','journey:view','segments','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Getting\x20journey\x20traffic\x20data...','type','includeHistory','no_parent','diff','exitOrJumpRate','Aborted.','journey:version:view','\x20\x20Folder\x20path:\x20','.yml','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Resume\x20a\x20paused\x20journey','\x20version','\x5c$&','journeyName','journey:list','folderPath','(archived)','log','1516375yCiEBl','get','Target\x20file:\x20','getLatestJourneyId','version','journeyStages','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','length','rule','No\x20journeys\x20found','helpText','journey:columns'];a27_0x2afb=function(){return _0x482613;};return a27_0x2afb();}import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x44f8a4){const _0x3de65a=a27_0x57ec;return!_0x44f8a4&&(console['error'](_0x3de65a(0x293)),console[_0x3de65a(0x205)](_0x3de65a(0x29c))),!!_0x44f8a4;}function withJsonFormat(_0x3e430c){const _0x57fe9a=a27_0x57ec;if(!_0x3e430c[_0x57fe9a(0x22d)]&&!_0x3e430c[_0x57fe9a(0x217)]&&!_0x3e430c[_0x57fe9a(0x23a)]&&!_0x3e430c['tsv'])return{..._0x3e430c,'format':_0x57fe9a(0x217),'json':!![]};return _0x3e430c;}function formatJourneyState(_0x279cc2){const _0x442d7a=a27_0x57ec;switch(_0x279cc2){case'launched':return a27_0xc564bb['green'](_0x442d7a(0x236));case'draft':return a27_0xc564bb['dim']('(draft)');case _0x442d7a(0x1f4):return a27_0xc564bb[_0x442d7a(0x22f)](_0x442d7a(0x202));case'completed':return a27_0xc564bb['blue']('(completed)');case'archived':return a27_0xc564bb[_0x442d7a(0x1e4)](_0x442d7a(0x25d));default:return'('+_0x279cc2+')';}}function formatJourneyItem(_0x1cc8c5,_0x4a88e7='',_0x5df2c2){const _0x1ef2e6=a27_0x57ec,_0x3547ca=formatJourneyState(_0x1cc8c5[_0x1ef2e6(0x2ab)]),_0x4096fb=_0x5df2c2?hyperlink(_0x1cc8c5[_0x1ef2e6(0x225)],_0x5df2c2):_0x1cc8c5['journeyBundleName'];return _0x4a88e7+_0x1ef2e6(0x20a)+_0x4096fb+'\x20'+_0x3547ca;}function escapeRegex(_0x5e19f2){const _0x410794=a27_0x57ec;return _0x5e19f2[_0x410794(0x241)](/[.*+?^${}()|[\]\\]/g,_0x410794(0x259));}function globToRegex(_0x11907b){const _0x59ac82=a27_0x57ec,_0xfb4b41=_0x11907b['split']('*')['map'](escapeRegex);return new RegExp(_0xfb4b41[_0x59ac82(0x206)]('.*'),'i');}function buildRuleToNameMapping(_0x1a6373){const _0x44bde1=a27_0x57ec,_0x29a9d7=new Map();if(_0x1a6373[_0x44bde1(0x24a)])for(const [_0x5c2a76,_0x315ecb]of Object['entries'](_0x1a6373[_0x44bde1(0x24a)])){if(_0x315ecb['rule']){const _0x5a9587=serializeRule(_0x315ecb[_0x44bde1(0x267)]),_0x32810b=_0x29a9d7[_0x44bde1(0x260)](_0x5a9587);_0x32810b?_0x32810b[_0x44bde1(0x1fe)](_0x5c2a76):_0x29a9d7['set'](_0x5a9587,[_0x5c2a76]);}}return _0x29a9d7;}async function resolveJourneyIdFromInput(_0x23099a,_0x5c84d1,_0x357094){const _0x5ef775=a27_0x57ec,_0x40c0c2=await resolveJourneyTarget(_0x23099a,_0x5c84d1['parentSegment'],_0x5c84d1[_0x5ef775(0x1f3)]),_0x34ba85=_0x40c0c2[_0x5ef775(0x1f6)];if(!_0x34ba85)throw new SDKError(ErrorCode[_0x5ef775(0x2b3)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x58d716=await withSpinner(_0x5ef775(0x2b9),()=>_0x357094[_0x5ef775(0x210)][_0x5ef775(0x228)](_0x34ba85),{'verbose':_0x5c84d1[_0x5ef775(0x1f3)]}),_0x3e7fb8=_0x58d716[_0x5ef775(0x2d6)],_0x593459=await withSpinner(_0x5ef775(0x223),()=>_0x357094[_0x5ef775(0x281)]['resolveJourneyId'](_0x3e7fb8,_0x40c0c2[_0x5ef775(0x25a)]),{'verbose':_0x5c84d1[_0x5ef775(0x1f3)]});return{'journeyId':_0x593459['data'],'journeyName':_0x40c0c2[_0x5ef775(0x25a)],'parentSegmentId':_0x3e7fb8};}async function resolveJourneyTarget(_0x1e9226,_0x211ad4,_0x5bf01d){const _0x209a8c=a27_0x57ec;if(isYamlFilePath(_0x1e9226))try{const _0x34c518=await resolveYamlFilePath(_0x1e9226);return _0x5bf01d&&(console[_0x209a8c(0x205)]('Resolved\x20YAML\x20file:\x20'+_0x1e9226),console[_0x209a8c(0x205)](_0x209a8c(0x222)+_0x34c518[_0x209a8c(0x1f6)]),console[_0x209a8c(0x205)]('\x20\x20Name:\x20'+_0x34c518[_0x209a8c(0x2c5)]),console[_0x209a8c(0x205)](_0x209a8c(0x254)+(_0x34c518['folderPath']||_0x209a8c(0x20d)))),{'journeyName':_0x34c518[_0x209a8c(0x2c5)],'parentSegment':_0x34c518[_0x209a8c(0x1f6)],'resolved':_0x34c518};}catch(_0x5d0f31){throw new SDKError(ErrorCode[_0x209a8c(0x2b3)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x5d0f31[_0x209a8c(0x2a0)]);}if(!_0x211ad4)throw new SDKError(ErrorCode[_0x209a8c(0x2b3)],_0x209a8c(0x1ed));return{'journeyName':_0x1e9226,'parentSegment':_0x211ad4};}function a27_0x57ec(_0x408a3a,_0x574286){_0x408a3a=_0x408a3a-0x1dc;const _0x2afbc8=a27_0x2afb();let _0x57ec6c=_0x2afbc8[_0x408a3a];return _0x57ec6c;}export class JourneyListCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x25b);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x278);async['execute'](_0x50bbdc){const _0xcc930b=a27_0x27b7a2,{options:_0x3dd532,args:_0x562fc8,tdx:_0xcbc541}=_0x50bbdc,_0x1dcafd=_0x562fc8[0x0],_0x25a1f0=_0x3dd532[_0xcc930b(0x1f6)];if(!_0x25a1f0)return console['error'](_0xcc930b(0x1e9)),console['error'](_0xcc930b(0x265)),0x1;const _0x420d0f=await withSpinner(_0xcc930b(0x2b9),()=>_0xcbc541['segment'][_0xcc930b(0x228)](_0x25a1f0),{'verbose':_0x3dd532[_0xcc930b(0x1f3)]}),_0x57dd80=_0x420d0f[_0xcc930b(0x2d6)];_0x3dd532[_0xcc930b(0x1f3)]&&(console[_0xcc930b(0x205)](_0xcc930b(0x2a5)+_0x25a1f0+_0xcc930b(0x2b4)+_0x57dd80+')'),_0x1dcafd&&console['error']('Pattern:\x20'+_0x1dcafd));const _0x2a9bb5=await withSpinner(_0xcc930b(0x28c),()=>_0xcbc541[_0xcc930b(0x210)]['getParentFull'](_0x57dd80),{'verbose':_0x3dd532['verbose']}),_0x4a5169=_0x2a9bb5['data'],_0xb111b8=_0x4a5169['rootFolderId'],_0x301d0c=await withSpinner(_0xcc930b(0x280),()=>_0xcbc541[_0xcc930b(0x281)][_0xcc930b(0x2a7)](_0x57dd80,_0xb111b8),{'verbose':_0x3dd532[_0xcc930b(0x1f3)]});let _0x1e9472=_0x301d0c[_0xcc930b(0x2d6)][_0xcc930b(0x2bf)];const _0x331d33=_0x301d0c['data'][_0xcc930b(0x294)],_0x21d50b=new Map();for(const _0xd163c3 of _0x331d33){_0x21d50b[_0xcc930b(0x1f5)](_0xd163c3['id'],_0xd163c3[_0xcc930b(0x22c)]);}if(_0x1dcafd){const _0xcd62bb=globToRegex(_0x1dcafd);_0x1e9472=_0x1e9472['filter'](_0xa82034=>_0xcd62bb[_0xcc930b(0x292)](_0xa82034['journeyBundleName']));}console['error']('✔\x20Found\x20'+_0x1e9472[_0xcc930b(0x266)]+_0xcc930b(0x2c4)+(_0x1e9472['length']!==0x1?'s':''));const _0x31da0a=_0x506b71=>{const _0xbe7639=_0xcc930b;return getConsoleNextUrl(_0x3dd532['site'],_0xbe7639(0x29f)+_0x57dd80+_0xbe7639(0x1dc)+_0x506b71+_0xbe7639(0x2be));};if(_0x3dd532[_0xcc930b(0x22d)]===_0xcc930b(0x232))await handleSDKOutput(_0x1e9472,_0x3dd532);else{if(_0x3dd532[_0xcc930b(0x22d)]===_0xcc930b(0x217)){const _0x2a668c=_0x1e9472[_0xcc930b(0x237)](_0x53b06d=>({..._0x53b06d,'url':_0x31da0a(_0x53b06d['id'])}));await handleSDKOutput(_0x2a668c,_0x3dd532);}else{console[_0xcc930b(0x25e)]('['+_0x25a1f0+']');const _0x5498b5=new Map(),_0x1b1d2a=[];for(const _0x114f83 of _0x1e9472){if(!_0x114f83[_0xcc930b(0x275)]||_0x114f83[_0xcc930b(0x275)]===_0xb111b8)_0x1b1d2a[_0xcc930b(0x1fe)](_0x114f83);else{const _0x4f4994=_0x5498b5['get'](_0x114f83[_0xcc930b(0x275)])||[];_0x4f4994[_0xcc930b(0x1fe)](_0x114f83),_0x5498b5[_0xcc930b(0x1f5)](_0x114f83[_0xcc930b(0x275)],_0x4f4994);}}const _0x1465b8=(_0x422eb7,_0x5a577f)=>_0x422eb7[_0xcc930b(0x225)][_0xcc930b(0x229)](_0x5a577f['journeyBundleName'],undefined,{'sensitivity':_0xcc930b(0x1de)});_0x1b1d2a[_0xcc930b(0x27b)](_0x1465b8);for(const _0x538544 of _0x1b1d2a){console[_0xcc930b(0x25e)](formatJourneyItem(_0x538544,'',_0x31da0a(_0x538544['id'])));}const _0x490dbd=[..._0x5498b5['entries']()]['sort']((_0x15b5d8,_0x49924d)=>{const _0x1053d8=_0xcc930b,_0x1e0646=_0x21d50b['get'](_0x15b5d8[0x0])||_0x15b5d8[0x0],_0x4dcb8f=_0x21d50b['get'](_0x49924d[0x0])||_0x49924d[0x0];return _0x1e0646[_0x1053d8(0x229)](_0x4dcb8f,undefined,{'sensitivity':'base'});});for(const [_0x1a2712,_0x5987de]of _0x490dbd){const _0x1d8fa5=_0x21d50b[_0xcc930b(0x260)](_0x1a2712)||_0x1a2712;console['log'](_0xcc930b(0x1f7)+_0x1d8fa5),_0x5987de[_0xcc930b(0x27b)](_0x1465b8);for(const _0x5b52f6 of _0x5987de){console[_0xcc930b(0x25e)](formatJourneyItem(_0x5b52f6,'\x20\x20',_0x31da0a(_0x5b52f6['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x27b7a2(0x249);['description']=a27_0x27b7a2(0x211);async[a27_0x27b7a2(0x2aa)](_0x3d1333){const _0x3ea5df=a27_0x27b7a2,{options:_0x476ac7,args:_0x4e8c88,tdx:_0x768483}=_0x3d1333,_0x5bca7e=_0x4e8c88[0x0];if(!_0x5bca7e)return console[_0x3ea5df(0x205)](_0x3ea5df(0x293)),console['error']('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console['error']('Options:'),console[_0x3ea5df(0x205)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x476ac7[_0x3ea5df(0x1f3)]&&console[_0x3ea5df(0x205)](_0x3ea5df(0x27c)+_0x5bca7e);const {journeyId:_0x2cc1b5,parentSegmentId:_0x1ea8a7}=await resolveJourneyIdFromInput(_0x5bca7e,_0x476ac7,_0x768483);if(_0x476ac7[_0x3ea5df(0x21c)]){const _0x272573=getConsoleNextUrl(_0x476ac7[_0x3ea5df(0x1e0)],_0x3ea5df(0x29f)+_0x1ea8a7+'/e/'+_0x2cc1b5+_0x3ea5df(0x2d1));return console[_0x3ea5df(0x205)](a27_0xc564bb[_0x3ea5df(0x284)]('✔')+_0x3ea5df(0x2af)+a27_0xc564bb[_0x3ea5df(0x20e)](_0x272573)),openBrowser(_0x272573),0x0;}const _0x237791=await withSpinner(_0x3ea5df(0x287),()=>_0x768483[_0x3ea5df(0x281)]['getJourney'](_0x2cc1b5),{'verbose':_0x476ac7[_0x3ea5df(0x1f3)]}),_0x1c1b3f=_0x237791[_0x3ea5df(0x2d6)],_0x26385f=_0x476ac7[_0x3ea5df(0x1f1)];let _0x2e7a4f;if(_0x26385f)try{const _0xb21528=await withSpinner(_0x3ea5df(0x2cd),()=>_0x768483[_0x3ea5df(0x281)][_0x3ea5df(0x2c3)](_0x2cc1b5),{'verbose':_0x476ac7['verbose']});_0x2e7a4f=_0xb21528[_0x3ea5df(0x2d6)];}catch{_0x476ac7[_0x3ea5df(0x1f3)]&&console[_0x3ea5df(0x205)]('\x20\x20Statistics\x20not\x20available');}const _0xff38c7=getConsoleNextUrl(_0x476ac7[_0x3ea5df(0x1e0)],_0x3ea5df(0x29f)+_0x1ea8a7+_0x3ea5df(0x1dc)+_0x2cc1b5+_0x3ea5df(0x2d1)),_0x29bf05={'id':_0x1c1b3f['id'],'name':_0x1c1b3f[_0x3ea5df(0x26f)][_0x3ea5df(0x22c)],'description':_0x1c1b3f[_0x3ea5df(0x26f)]['description'],'state':_0x1c1b3f[_0x3ea5df(0x26f)]['state'],'paused':_0x1c1b3f['attributes'][_0x3ea5df(0x1f4)],'reentry_mode':_0x1c1b3f[_0x3ea5df(0x26f)]['reentryMode'],'stages':_0x1c1b3f[_0x3ea5df(0x26f)][_0x3ea5df(0x264)]?.['length']||0x0,..._0x1c1b3f[_0x3ea5df(0x26f)][_0x3ea5df(0x22b)]&&{'goal':_0x1c1b3f[_0x3ea5df(0x26f)][_0x3ea5df(0x22b)][_0x3ea5df(0x22c)]},..._0x2e7a4f&&{'statistics':{'size':_0x2e7a4f[_0x3ea5df(0x1e5)],'entered':_0x2e7a4f[_0x3ea5df(0x288)],'goal_achieved':_0x2e7a4f[_0x3ea5df(0x286)],'completion_rate':_0x2e7a4f[_0x3ea5df(0x297)],'exit_or_jump':_0x2e7a4f[_0x3ea5df(0x21d)],'exit_or_jump_rate':_0x2e7a4f[_0x3ea5df(0x251)],'stages':_0x2e7a4f['stages']}},'url':_0xff38c7};return await handleSingleObjectOutput(_0x29bf05,_0x476ac7),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x244);[a27_0x27b7a2(0x2ca)]='Show\x20journey\x20statistics';async['execute'](_0x3db119){const _0x27a82f=a27_0x27b7a2,{options:_0x3ba1ff,args:_0x59b61d,tdx:_0x154918}=_0x3db119,_0x5aad53=_0x59b61d[0x0];if(!requireNameOrPath(_0x5aad53))return 0x1;_0x3ba1ff[_0x27a82f(0x1f3)]&&console['error'](_0x27a82f(0x27c)+_0x5aad53);const _0x56d282=_0x3ba1ff,_0x1871c3=_0x56d282[_0x27a82f(0x2a2)],_0xc04a96=_0x56d282['to'],_0x150f36=_0x56d282[_0x27a82f(0x24e)],_0x548983=_0x56d282[_0x27a82f(0x2d0)];_0x150f36&&!_0x1871c3&&!_0xc04a96&&console['error'](_0x27a82f(0x207));const _0x2d1491=_0x150f36?withJsonFormat(_0x3ba1ff):_0x3ba1ff,{journeyId:_0x2caf08,journeyName:_0x3e5a90}=await resolveJourneyIdFromInput(_0x5aad53,_0x2d1491,_0x154918),_0x23e1e1=_0x1871c3||_0xc04a96?{'from':_0x1871c3,'to':_0xc04a96}:undefined,_0x3a9af8=await withSpinner(_0x27a82f(0x2cd),()=>Promise[_0x27a82f(0x1e6)]([_0x154918[_0x27a82f(0x281)]['getJourney'](_0x2caf08),_0x154918[_0x27a82f(0x281)]['getStatistics'](_0x2caf08,_0x23e1e1)]),{'verbose':_0x2d1491[_0x27a82f(0x1f3)]}),[_0x323051,_0x5b57ea]=_0x3a9af8[_0x27a82f(0x2d6)];if(!_0x5b57ea||_0x5b57ea[_0x27a82f(0x1df)]===null)return console[_0x27a82f(0x205)](_0x27a82f(0x242)+_0x3e5a90),console['error'](_0x27a82f(0x2ad)),0x0;const _0x3a50f6=buildStageNameMap(_0x323051),_0x3a0160=!!(_0x23e1e1&&_0x5b57ea['history']?.[_0x27a82f(0x266)]),_0x2e3903={'stageNameMap':_0x3a50f6,'hasPeriod':_0x3a0160,'includeHistory':!!_0x150f36};if(_0x548983&&_0x5b57ea[_0x27a82f(0x2cf)]){const _0x50e3b4=_0x5b57ea['stages'][_0x27a82f(0x2d5)](_0x1f1d01=>{const _0x3e420d=_0x27a82f,_0x232250=_0x3a50f6['get'](_0x1f1d01['id'])??'';return _0x232250[_0x3e420d(0x1fd)]()===_0x548983[_0x3e420d(0x1fd)]();});if(_0x50e3b4)return await handleSingleObjectOutput(formatStageStats(_0x50e3b4,_0x2e3903),_0x2d1491),0x0;const _0x2e3a05=_0x5b57ea[_0x27a82f(0x2cf)][_0x27a82f(0x237)](_0x5a8e5d=>_0x3a50f6['get'](_0x5a8e5d['id'])??_0x5a8e5d['id']);return console[_0x27a82f(0x205)]('Error:\x20Stage\x20\x22'+_0x548983+_0x27a82f(0x2c8)),console[_0x27a82f(0x205)](_0x27a82f(0x1fa)+_0x2e3a05[_0x27a82f(0x206)](',\x20')),0x1;}const _0x1be26d=_0x5b57ea['stages']?.[_0x27a82f(0x237)](_0x1e33cd=>formatStageStats(_0x1e33cd,_0x2e3903)),_0x384358=assembleJourneyStats(_0x5b57ea,{'from':_0x1871c3,'to':_0xc04a96,'includeHistory':_0x150f36});return await this[_0x27a82f(0x299)](_0x384358,_0x1be26d??[],_0x2d1491),0x0;}async[a27_0x27b7a2(0x299)](_0x39e297,_0x1e0cd4,_0x3082f0){const _0x462257=a27_0x27b7a2,_0x6ac363=_0x3082f0[_0x462257(0x22d)]==='json'||_0x3082f0[_0x462257(0x22d)]===_0x462257(0x23a)||_0x3082f0['json']||_0x3082f0[_0x462257(0x23a)];if(_0x6ac363){_0x39e297['stages']=_0x1e0cd4,await handleSingleObjectOutput(_0x39e297,_0x3082f0);return;}await handleSingleObjectOutput(_0x39e297,_0x3082f0);for(const _0x3fff4f of _0x1e0cd4){console[_0x462257(0x25e)](''),console[_0x462257(0x25e)](String(a27_0xc564bb[_0x462257(0x20e)][_0x462257(0x2a3)]('['+_0x3fff4f['name']+']'))+a27_0xc564bb['dim']('\x20'+_0x3fff4f['id']));const {id:_0x359fe8,name:_0x2cbc36,..._0x4fb7e8}=_0x3fff4f;await handleSingleObjectOutput(_0x4fb7e8,_0x3082f0);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]='journey:traffic';[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x2c2);async[a27_0x27b7a2(0x2aa)](_0x220cd3){const _0x4aa39b=a27_0x27b7a2,{options:_0x36f6a0,args:_0x29f379,tdx:_0x4439b8}=_0x220cd3,_0xfd1c52=_0x29f379[0x0];if(!requireNameOrPath(_0xfd1c52))return 0x1;_0x36f6a0[_0x4aa39b(0x1f3)]&&console[_0x4aa39b(0x205)]('Input:\x20'+_0xfd1c52);const _0x26e02a=_0x36f6a0,_0x2356b2=_0x26e02a[_0x4aa39b(0x24d)],_0x404b2d=_0x26e02a[_0x4aa39b(0x2a2)],_0x1f981f=_0x26e02a['to'],_0x561979=_0x26e02a[_0x4aa39b(0x2da)];if(_0x2356b2&&_0x2356b2!==_0x4aa39b(0x28e)&&_0x2356b2!==_0x4aa39b(0x216))return console[_0x4aa39b(0x205)]('Error:\x20Invalid\x20--type\x20\x22'+_0x2356b2+_0x4aa39b(0x24b)),0x1;const _0x215a7b=withJsonFormat(_0x36f6a0),{journeyId:_0x531074,journeyName:_0x2ff9f9}=await resolveJourneyIdFromInput(_0xfd1c52,_0x215a7b,_0x4439b8),_0x206858={'type':_0x2356b2,'from':_0x404b2d,'to':_0x1f981f,'limit':_0x561979},_0x461cc6=await withSpinner(_0x4aa39b(0x24c),()=>_0x4439b8[_0x4aa39b(0x281)]['getTrafficData'](_0x531074,_0x206858),{'verbose':_0x215a7b['verbose']}),_0x1f8896=_0x461cc6[_0x4aa39b(0x2d6)],_0x153239=_0x1f8896['conversion']&&(_0x1f8896[_0x4aa39b(0x28e)][_0x4aa39b(0x1ff)][_0x4aa39b(0x266)]>0x0||_0x1f8896[_0x4aa39b(0x28e)][_0x4aa39b(0x20c)][_0x4aa39b(0x266)]>0x0),_0x546abf=_0x1f8896[_0x4aa39b(0x216)]&&_0x1f8896[_0x4aa39b(0x216)][_0x4aa39b(0x266)]>0x0;if(!_0x153239&&!_0x546abf)return console[_0x4aa39b(0x205)](_0x4aa39b(0x276)+_0x2ff9f9),console['error'](_0x4aa39b(0x271)),_0x404b2d&&_0x1f981f&&console[_0x4aa39b(0x205)](_0x4aa39b(0x208)),0x0;return await handleSingleObjectOutput(_0x1f8896,_0x215a7b),0x0;}}function formatStageStats(_0x3bc0ca,_0x499678){const _0x1298c7=a27_0x27b7a2,_0x1a2956=_0x499678[_0x1298c7(0x279)]&&_0x3bc0ca[_0x1298c7(0x2d3)]?.[_0x1298c7(0x266)]?aggregateStageHistory(_0x3bc0ca[_0x1298c7(0x2d3)]):{'size':_0x3bc0ca[_0x1298c7(0x1e5)],'entered':_0x3bc0ca[_0x1298c7(0x288)],'milestone':_0x3bc0ca[_0x1298c7(0x1ee)],'milestone_rate':_0x3bc0ca[_0x1298c7(0x29e)],'exit_or_jump':_0x3bc0ca[_0x1298c7(0x21d)],'exit_or_jump_rate':_0x3bc0ca[_0x1298c7(0x251)]},_0x1231ee={'id':_0x3bc0ca['id'],'name':_0x499678['stageNameMap'][_0x1298c7(0x260)](_0x3bc0ca['id'])??_0x3bc0ca['id'],..._0x1a2956};return _0x499678[_0x1298c7(0x279)]&&_0x499678[_0x1298c7(0x24e)]&&_0x3bc0ca[_0x1298c7(0x2d3)]&&(_0x1231ee['history']=_0x3bc0ca[_0x1298c7(0x2d3)]),_0x1231ee;}export class JourneyPauseCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]='journey:pause';[a27_0x27b7a2(0x2ca)]='Pause\x20a\x20running\x20journey';async[a27_0x27b7a2(0x2aa)](_0x2fdee6){const _0x11138f=a27_0x27b7a2,{options:_0x71ccba,args:_0x42fff8,tdx:_0x29a0fa}=_0x2fdee6,_0x28fef8=_0x42fff8[0x0];if(!requireNameOrPath(_0x28fef8))return 0x1;_0x71ccba[_0x11138f(0x1f3)]&&console[_0x11138f(0x205)](_0x11138f(0x27c)+_0x28fef8);const {journeyId:_0x880507,journeyName:_0xc1bc09}=await resolveJourneyIdFromInput(_0x28fef8,_0x71ccba,_0x29a0fa);if(!_0x71ccba['yes']){const _0x377f40=await confirm(_0x11138f(0x2b2)+_0xc1bc09+'\x22?');if(!_0x377f40)return console[_0x11138f(0x205)](_0x11138f(0x27e)),0x0;}const _0x2df18c=await withSpinner('Pausing\x20journey...',()=>_0x29a0fa[_0x11138f(0x281)][_0x11138f(0x203)](_0x880507),{'verbose':_0x71ccba[_0x11138f(0x1f3)]}),_0x1bcd30=_0x2df18c[_0x11138f(0x2d6)];return console[_0x11138f(0x205)](_0x11138f(0x221)+_0x1bcd30['attributes'][_0x11138f(0x22c)]+_0x11138f(0x215)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x27b7a2(0x22e);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x257);async[a27_0x27b7a2(0x2aa)](_0x4dc32c){const _0x17e0fc=a27_0x27b7a2,{options:_0x1f8dbb,args:_0xef29ae,tdx:_0x51bc0c}=_0x4dc32c,_0xd6399b=_0xef29ae[0x0];if(!requireNameOrPath(_0xd6399b))return 0x1;_0x1f8dbb[_0x17e0fc(0x1f3)]&&console['error']('Input:\x20'+_0xd6399b);const {journeyId:_0xfae3d9,journeyName:_0x38b9b7}=await resolveJourneyIdFromInput(_0xd6399b,_0x1f8dbb,_0x51bc0c);if(!_0x1f8dbb[_0x17e0fc(0x22a)]){const _0x2deb33=await confirm(_0x17e0fc(0x2b5)+_0x38b9b7+'\x22?');if(!_0x2deb33)return console[_0x17e0fc(0x205)](_0x17e0fc(0x27e)),0x0;}const _0x3d0bd9=await withSpinner('Resuming\x20journey...',()=>_0x51bc0c[_0x17e0fc(0x281)][_0x17e0fc(0x220)](_0xfae3d9),{'verbose':_0x1f8dbb['verbose']}),_0x505e27=_0x3d0bd9['data'];return console[_0x17e0fc(0x205)](_0x17e0fc(0x221)+_0x505e27[_0x17e0fc(0x26f)][_0x17e0fc(0x22c)]+_0x17e0fc(0x2bd)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x2a9);[a27_0x27b7a2(0x2ca)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x27b7a2(0x2aa)](_0x419a76){const _0x5d6374=a27_0x27b7a2,{options:_0x1f0292,args:_0x243672,tdx:_0x4fff45}=_0x419a76,_0x3801fa=_0x1f0292,_0x31a669=_0x243672[0x0],_0x5714a2=_0x31a669&&isYamlFilePath(_0x31a669),_0x453861=await resolveTarget({'arg':_0x5714a2?_0x31a669:undefined,'contextParent':_0x1f0292[_0x5d6374(0x1f6)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x453861))return _0x453861[_0x5d6374(0x2c1)]===_0x5d6374(0x24f)?(console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x22f)](_0x5d6374(0x1fc))),console['error'](_0x5d6374(0x1f8)),console[_0x5d6374(0x205)](_0x5d6374(0x243)),console['error'](_0x5d6374(0x2cb)),console[_0x5d6374(0x205)](_0x5d6374(0x273))):(console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x274)]('Error:\x20'+_0x453861[_0x5d6374(0x2a0)]+'\x0a')),_0x453861[_0x5d6374(0x269)]&&console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x20e)](_0x453861[_0x5d6374(0x269)]))),0x1;let _0x1d14d3=_0x5714a2?undefined:_0x31a669,_0x33b7b2,_0x3ac2cf;_0x453861[_0x5d6374(0x24d)]==='file'&&(_0x1d14d3=_0x453861[_0x5d6374(0x235)],_0x33b7b2=_0x453861[_0x5d6374(0x214)],_0x3ac2cf=_0x453861[_0x5d6374(0x25c)]);const _0x1615f0=_0x453861[_0x5d6374(0x1eb)],_0x59f9d0=_0x453861[_0x5d6374(0x245)];_0x3801fa[_0x5d6374(0x1f3)]&&(console[_0x5d6374(0x205)](_0x5d6374(0x2a5)+_0x1615f0),console[_0x5d6374(0x205)]('Target\x20directory:\x20'+_0x59f9d0),_0x1d14d3&&console[_0x5d6374(0x205)](_0x5d6374(0x2bb)+_0x1d14d3),_0x33b7b2&&console[_0x5d6374(0x205)](_0x5d6374(0x261)+_0x33b7b2),_0x3ac2cf&&console[_0x5d6374(0x205)]('Folder\x20path:\x20'+_0x3ac2cf));const _0x741ef9=await withSpinner(_0x5d6374(0x2b9),()=>_0x4fff45[_0x5d6374(0x210)][_0x5d6374(0x228)](_0x1615f0),{'verbose':_0x1f0292['verbose']}),_0x17b95d=_0x741ef9['data'],{journeys:_0x4ef13c,folders:_0x1f4ec9}=await withSpinner(_0x5d6374(0x1ec),async()=>{const _0x898a20=_0x5d6374,[_0x54290e,_0x3e4bbd]=await Promise[_0x898a20(0x1e6)]([_0x4fff45[_0x898a20(0x281)][_0x898a20(0x1e1)](_0x17b95d,undefined,{'includeAllVersions':!![]}),_0x4fff45[_0x898a20(0x210)]['listFolders'](_0x17b95d)]);return{'journeys':_0x54290e,'folders':_0x3e4bbd};},{'verbose':_0x1f0292[_0x5d6374(0x1f3)]})[_0x5d6374(0x2d7)](_0x13e547=>_0x13e547[_0x5d6374(0x2d6)]);let _0x21283d=_0x4ef13c;const _0x53febc=buildFolderIdToPathMap(_0x1f4ec9);if(_0x1d14d3){const _0x47fbc2=_0x21283d[_0x5d6374(0x21e)](_0x1e8d08=>_0x1e8d08[_0x5d6374(0x225)][_0x5d6374(0x1fd)]()===_0x1d14d3['toLowerCase']());if(_0x47fbc2[_0x5d6374(0x266)]===0x0)return console['error'](_0x5d6374(0x21f)+_0x1d14d3),console[_0x5d6374(0x205)](_0x5d6374(0x2ae)),0x1;_0x21283d=_0x47fbc2;}if(_0x3ac2cf!==undefined){const _0x3d332e=_0x21283d['filter'](_0x24f6cb=>{const _0xc2099a=_0x5d6374,_0x43b0fb=_0x24f6cb['folderId']?_0x53febc[_0xc2099a(0x260)](_0x24f6cb[_0xc2099a(0x275)])||'':'';return _0x43b0fb===_0x3ac2cf;});if(_0x3d332e[_0x5d6374(0x266)]===0x0&&_0x21283d[_0x5d6374(0x266)]>0x0){console[_0x5d6374(0x205)]('Error:\x20Journey\x20\x27'+_0x1d14d3+_0x5d6374(0x26b)+(_0x3ac2cf||_0x5d6374(0x27f))),console[_0x5d6374(0x205)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x53f826 of _0x21283d){const _0x4182d3=_0x53f826[_0x5d6374(0x275)]?_0x53febc[_0x5d6374(0x260)](_0x53f826['folderId'])||'':'';console[_0x5d6374(0x205)]('\x20\x20-\x20'+(_0x4182d3||_0x5d6374(0x20d))+'/'+_0x53f826['journeyBundleName']);}return 0x1;}_0x21283d=_0x3d332e;}if(_0x21283d[_0x5d6374(0x266)]===0x0)return console[_0x5d6374(0x205)](_0x5d6374(0x268)),0x0;const _0x14e68f=new Map();for(const _0x4764f7 of _0x21283d){const _0x4e4bfa=_0x4764f7[_0x5d6374(0x2ce)];!_0x14e68f[_0x5d6374(0x26e)](_0x4e4bfa)&&_0x14e68f[_0x5d6374(0x1f5)](_0x4e4bfa,[]),_0x14e68f[_0x5d6374(0x260)](_0x4e4bfa)[_0x5d6374(0x1fe)](_0x4764f7);}for(const _0x4736bb of _0x14e68f['values']()){_0x4736bb[_0x5d6374(0x27b)]((_0x27630f,_0x2f9136)=>(_0x27630f[_0x5d6374(0x239)]||0x0)-(_0x2f9136['versionNumber']||0x0));}const _0x52a7e7=[],{idToEmailMap:_0x4b7e51,connectionIdToNameMap:_0x400a29}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x144e62=_0x5d6374,[_0x498077,_0x3ea0b4]=await Promise['all']([_0x4fff45[_0x144e62(0x27a)][_0x144e62(0x247)](),_0x4fff45['connection']['buildIdToNameMap']()]);return{'idToEmailMap':_0x498077,'connectionIdToNameMap':_0x3ea0b4};},{'verbose':_0x1f0292[_0x5d6374(0x1f3)]})[_0x5d6374(0x2d7)](_0x2d33c4=>_0x2d33c4[_0x5d6374(0x2d6)]);for(const _0x3fcf18 of _0x14e68f[_0x5d6374(0x2b0)]()){const _0xabefad=_0x3fcf18[0x0]['journeyBundleName'],_0x347af7=_0x3fcf18[0x0][_0x5d6374(0x275)],_0x2ac4cc=_0x347af7?_0x53febc['get'](_0x347af7)||'':'',_0x115fe1=_0x2ac4cc?a27_0x22d4ef[_0x5d6374(0x206)](_0x59f9d0,_0x2ac4cc):_0x59f9d0,_0x4b8901=_0x33b7b2||a27_0x22d4ef['join'](_0x115fe1,sanitizeFileName(_0xabefad)+'.yml');let _0x480281,_0x63617f;if(existsSync(_0x4b8901))try{const _0x713363=readFileSync(_0x4b8901,_0x5d6374(0x298)),_0x101873=parseYamlString(_0x713363);_0x63617f=_0x101873,_0x480281=buildRuleToNameMapping(_0x101873),_0x3801fa[_0x5d6374(0x1f3)]&&_0x480281['size']>0x0&&console[_0x5d6374(0x205)](_0x5d6374(0x230)+_0x480281[_0x5d6374(0x1e5)]+_0x5d6374(0x2c9)+_0xabefad);}catch(_0xa51295){_0x3801fa[_0x5d6374(0x1f3)]&&console[_0x5d6374(0x205)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0xa51295[_0x5d6374(0x2a0)]);}const _0x5855f2=[],_0x3973bf=new Set(),_0x3ef724=new Map(),_0x2d595b=new Map(),_0x4d605a=new Set(),_0x3e462f=new Map(),_0x216435=new Map(),_0xb8aec4=createJumpTargetCache();await withProgressSpinner(_0x5d6374(0x213)+_0xabefad+_0x5d6374(0x240),async _0x129ca4=>{const _0x672b73=_0x5d6374;for(const _0x5d83c8 of _0x3fcf18){const _0x55ece8=_0x3fcf18['length']>0x1?_0x5d83c8[_0x672b73(0x225)]+'\x20v'+(_0x5d83c8['versionNumber']||0x1):_0x5d83c8[_0x672b73(0x225)];_0x129ca4['setPhase'](_0x672b73(0x213)+_0x55ece8);const _0xfa57ab=await _0x4fff45['journey'][_0x672b73(0x2b8)](_0x5d83c8['id']),_0x38e014=_0xfa57ab[_0x672b73(0x26f)]?.[_0x672b73(0x272)],_0x48498b={'resolveSegment':async _0x25aa71=>{const _0x3e1c72=_0x672b73;if(!_0x38e014)return{'name':_0x25aa71,'isJourneyLocal':![]};const _0xd68c30=_0x3ef724['get'](_0x25aa71);if(_0xd68c30)return _0xd68c30;try{const _0x51ed61=await _0x4fff45['segment'][_0x3e1c72(0x23e)](_0x38e014,_0x25aa71),_0x3f2d40=_0x51ed61[_0x3e1c72(0x23b)]===SEGMENT_KIND_JOURNEY;let _0x3d0b95,_0x54b484=_0x51ed61[_0x3e1c72(0x22c)];if(_0x3f2d40&&_0x51ed61[_0x3e1c72(0x267)]){const _0x223091=await segmentResponseToDef(_0x51ed61,{'resolveSegmentName':async _0x1f3f4c=>{const _0x11ad4c=_0x3e1c72,_0x459daf=_0x3ef724['get'](_0x1f3f4c);if(_0x459daf)return _0x459daf[_0x11ad4c(0x22c)];const _0xbb38e6=await _0x48498b[_0x11ad4c(0x21b)](_0x1f3f4c);return _0xbb38e6[_0x11ad4c(0x22c)];}}),_0x52d42b=_0x223091[_0x3e1c72(0x267)];_0x3d0b95={'description':_0x51ed61[_0x3e1c72(0x2ca)],'rule':_0x52d42b};const _0x546536=serializeRule(_0x52d42b),_0x408331=_0x2d595b[_0x3e1c72(0x260)](_0x546536);if(_0x408331)_0x54b484=_0x408331,_0x3d0b95=undefined,_0x3801fa[_0x3e1c72(0x1f3)]&&console['error'](_0x3e1c72(0x2c7)+_0x51ed61[_0x3e1c72(0x22c)]+_0x3e1c72(0x2a8)+_0x408331);else{let _0x407a0a=![];if(_0x480281){const _0x37baea=_0x480281['get'](_0x546536);if(_0x37baea){const _0x37cd8f=_0x37baea[_0x3e1c72(0x2d5)](_0x2ed012=>!_0x3973bf[_0x3e1c72(0x26e)](_0x2ed012));_0x37cd8f&&(_0x54b484=_0x37cd8f,_0x3973bf['add'](_0x37cd8f),_0x2d595b['set'](_0x546536,_0x37cd8f),_0x407a0a=!![],_0x3801fa['verbose']&&console['error'](_0x3e1c72(0x256)+_0x37cd8f+_0x3e1c72(0x1f2)));}}if(!_0x407a0a){const _0x1b90ce=generateJourneyLocalName(_0x51ed61['name']);_0x1b90ce&&(_0x54b484=_0x1b90ce);let _0x293ccc=_0x54b484,_0x1a8235=0x2;while(_0x3973bf[_0x3e1c72(0x26e)](_0x293ccc)){_0x293ccc=_0x54b484+'_'+_0x1a8235,_0x1a8235++;}_0x3973bf[_0x3e1c72(0x2a4)](_0x293ccc),_0x2d595b['set'](_0x546536,_0x293ccc),_0x54b484=_0x293ccc;}}}const _0x32023f={'name':_0x54b484,'isJourneyLocal':_0x3f2d40,'definition':_0x3d0b95};return _0x3ef724[_0x3e1c72(0x1f5)](_0x25aa71,_0x32023f),_0x32023f;}catch(_0x5d1f18){return _0x1f0292[_0x3e1c72(0x1f3)]&&console[_0x3e1c72(0x205)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x25aa71+':\x20'+_0x5d1f18[_0x3e1c72(0x2a0)]),{'name':_0x25aa71,'isJourneyLocal':![]};}},'resolveActivation':async _0xb2655c=>{const _0x3360ad=_0x672b73,_0x3fc0b3=_0x3e462f[_0x3360ad(0x260)](_0xb2655c);if(_0x3fc0b3)return _0x3fc0b3;try{const _0x471208=await _0x4fff45['journey']['getActivation'](_0x5d83c8['id'],_0xb2655c),_0x1a88e2=journeyActivationStepToYaml(_0x471208,_0x4b7e51,_0x400a29),_0x453573=JSON[_0x3360ad(0x26d)]({'name':_0x1a88e2['name'],'connection':_0x1a88e2['connection'],'connector_config':_0x1a88e2[_0x3360ad(0x2d9)]}),_0x1041aa=_0x216435[_0x3360ad(0x260)](_0x453573);if(_0x1041aa){const _0x1d568f={'name':_0x1041aa,'isJourneyLocal':!![],'definition':_0x1a88e2};return _0x3e462f[_0x3360ad(0x1f5)](_0xb2655c,_0x1d568f),_0x1d568f;}const _0x504660=_0x471208['attributes'][_0x3360ad(0x219)][_0x3360ad(0x22c)]||_0xb2655c,_0xdcfac8=sanitizeYamlKey(_0x504660)||'activation_'+_0xb2655c;let _0x3bdcdc=_0xdcfac8,_0x1aec4c=0x2;while(_0x4d605a[_0x3360ad(0x26e)](_0x3bdcdc)){_0x3bdcdc=_0xdcfac8+'_'+_0x1aec4c,_0x1aec4c++;}_0x4d605a[_0x3360ad(0x2a4)](_0x3bdcdc),_0x216435['set'](_0x453573,_0x3bdcdc);const _0x41123e={'name':_0x3bdcdc,'isJourneyLocal':!![],'definition':_0x1a88e2};return _0x3e462f[_0x3360ad(0x1f5)](_0xb2655c,_0x41123e),_0x41123e;}catch(_0x1b4021){return _0x1f0292[_0x3360ad(0x1f3)]&&console['error'](_0x3360ad(0x218)+_0xb2655c+':\x20'+_0x1b4021[_0x3360ad(0x2a0)]),{'name':_0xb2655c,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1d3b47,_0x39b56a)=>{return resolveJumpTarget(_0x1d3b47,_0x39b56a,_0xb8aec4,_0x529797=>_0x4fff45['journey']['getJourney'](_0x529797));}},_0x33e019=await journeyResponseToDef(_0xfa57ab,_0x48498b);_0x5855f2[_0x672b73(0x1fe)]({'item':_0x5d83c8,'yaml':_0x33e019});}},{'verbose':_0x1f0292['verbose']});const _0x56a86e=await _0x4fff45[_0x5d6374(0x281)][_0x5d6374(0x262)](_0x3fcf18[0x0][_0x5d6374(0x2ce)]),_0x19d6f8=buildMergedJourneyDef(_0x5855f2,_0x480281,_0x56a86e),_0x3d521a=normalizeJourneyDef(_0x19d6f8,_0x63617f),_0x19f68f=toYamlString(_0x3d521a),_0x574a7e=_0x33b7b2||a27_0x22d4ef['join'](_0x115fe1,sanitizeFileName(_0xabefad)+_0x5d6374(0x255));!_0x33b7b2&&_0x2ac4cc&&!existsSync(_0x115fe1)&&mkdirSync(_0x115fe1,{'recursive':!![]});const _0x129bb5=a27_0x22d4ef[_0x5d6374(0x23f)](process['cwd'](),_0x574a7e);if(existsSync(_0x574a7e)){const _0x31ddf1=readFileSync(_0x574a7e,_0x5d6374(0x298)),_0x156dcc=generateDiff(_0x31ddf1,_0x19f68f),_0x3c56c8=hasChanges(_0x156dcc);_0x52a7e7['push']({'relativePath':_0x129bb5,'absolutePath':_0x574a7e,'content':_0x19f68f,'isNew':![],'hasChanges':_0x3c56c8,'diff':_0x3c56c8?formatDiffWithColors(_0x156dcc):undefined});}else _0x52a7e7[_0x5d6374(0x1fe)]({'relativePath':_0x129bb5,'absolutePath':_0x574a7e,'content':_0x19f68f,'isNew':!![],'hasChanges':![]});}const _0x534b7c=_0x52a7e7['filter'](_0x19c649=>_0x19c649[_0x5d6374(0x201)]),_0x2e836c=_0x52a7e7['filter'](_0x293546=>!_0x293546[_0x5d6374(0x201)]&&_0x293546[_0x5d6374(0x1dd)]),_0x5bac79=_0x52a7e7[_0x5d6374(0x21e)](_0x2eb91f=>!_0x2eb91f['isNew']&&!_0x2eb91f['hasChanges']),_0x727672=_0x21283d[_0x5d6374(0x266)],_0x45afc9=_0x14e68f[_0x5d6374(0x1e5)],_0x1c22db=_0x727672>_0x45afc9?'\x20('+_0x727672+_0x5d6374(0x20b):'';console[_0x5d6374(0x205)](_0x5d6374(0x270)),console[_0x5d6374(0x205)]('\x20\x20'+a27_0xc564bb[_0x5d6374(0x20e)](_0x45afc9+_0x5d6374(0x209))+a27_0xc564bb[_0x5d6374(0x1e4)](_0x1c22db)),console[_0x5d6374(0x205)]('\x20\x20'+a27_0xc564bb['green']('+\x20'+_0x534b7c[_0x5d6374(0x266)]+_0x5d6374(0x290))),console[_0x5d6374(0x205)]('\x20\x20'+a27_0xc564bb['yellow']('~\x20'+_0x2e836c[_0x5d6374(0x266)]+_0x5d6374(0x1e2))),console[_0x5d6374(0x205)]('\x20\x20'+a27_0xc564bb[_0x5d6374(0x1e4)]('=\x20'+_0x5bac79['length']+'\x20unchanged\x20files')),console[_0x5d6374(0x205)]('\x20\x20Target:\x20'+a27_0xc564bb[_0x5d6374(0x20e)](_0x59f9d0)+'\x0a');if(_0x2e836c[_0x5d6374(0x266)]>0x0)for(const _0x43194b of _0x2e836c){console[_0x5d6374(0x205)](_0x5d6374(0x233)+_0x43194b[_0x5d6374(0x2d8)]+'\x27:'),console[_0x5d6374(0x205)]('─'[_0x5d6374(0x295)](0x3c)),console[_0x5d6374(0x205)](_0x43194b[_0x5d6374(0x250)]),console[_0x5d6374(0x205)]('─'[_0x5d6374(0x295)](0x3c));}if(_0x3801fa[_0x5d6374(0x2bc)])return console['error'](a27_0xc564bb['yellow'](_0x5d6374(0x1e3))),0x0;if(_0x534b7c[_0x5d6374(0x266)]===0x0&&_0x2e836c[_0x5d6374(0x266)]===0x0)return console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x284)](_0x5d6374(0x29b))),saveSessionContext({'parent_segment':_0x1615f0},_0x3801fa[_0x5d6374(0x231)]),console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x284)]('✔\x20Context\x20set:\x20'+a27_0xc564bb[_0x5d6374(0x1e4)](_0x5d6374(0x2d4))+_0x5d6374(0x1fb)+a27_0xc564bb['cyan'](_0x1615f0))),0x0;if(!_0x3801fa[_0x5d6374(0x22a)]&&(_0x534b7c[_0x5d6374(0x266)]>0x0||_0x2e836c[_0x5d6374(0x266)]>0x0)){if(!isInteractive())return console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x274)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5d6374(0x205)](a27_0xc564bb['dim'](_0x5d6374(0x29d))),0x1;const _0xd5a58c=await confirmKey(_0x5d6374(0x277)+(_0x534b7c[_0x5d6374(0x266)]+_0x2e836c[_0x5d6374(0x266)])+_0x5d6374(0x289));if(!_0xd5a58c)return console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x22f)](_0x5d6374(0x252)),_0x5d6374(0x28a)),0x1;}!existsSync(_0x59f9d0)&&mkdirSync(_0x59f9d0,{'recursive':!![]});const _0x4678a6=a27_0x22d4ef[_0x5d6374(0x206)](_0x59f9d0,'tdx.json');writeFileSync(_0x4678a6,createTdxConfigContent(_0x1615f0),_0x5d6374(0x298));for(const _0x3a621d of _0x52a7e7){(_0x3a621d[_0x5d6374(0x201)]||_0x3a621d[_0x5d6374(0x1dd)])&&writeFileSync(_0x3a621d[_0x5d6374(0x204)],_0x3a621d[_0x5d6374(0x2ac)],_0x5d6374(0x298));}return console[_0x5d6374(0x205)](a27_0xc564bb['green']('✔\x20Pulled\x20'+(_0x534b7c[_0x5d6374(0x266)]+_0x2e836c[_0x5d6374(0x266)])+_0x5d6374(0x1ef)+_0x59f9d0)),saveSessionContext({'parent_segment':_0x1615f0},_0x3801fa[_0x5d6374(0x231)]),console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x284)]('✔\x20Context\x20set:\x20'+a27_0xc564bb[_0x5d6374(0x1e4)]('parent_segment')+'\x20=\x20'+a27_0xc564bb[_0x5d6374(0x20e)](_0x1615f0))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x26a);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x285);async[a27_0x27b7a2(0x2aa)](_0x349dd3){const _0x720293=a27_0x27b7a2,{options:_0x82f2ef,args:_0x1c8fd2,tdx:_0x3f6ea9}=_0x349dd3,_0xbb5a2e=_0x1c8fd2[0x0];if(!requireNameOrPath(_0xbb5a2e))return 0x1;_0x82f2ef[_0x720293(0x1f3)]&&console[_0x720293(0x205)](_0x720293(0x27c)+_0xbb5a2e);const {journeyId:_0x5e5b5c}=await resolveJourneyIdFromInput(_0xbb5a2e,_0x82f2ef,_0x3f6ea9),_0x249225=await withSpinner(_0x720293(0x2db),()=>_0x3f6ea9[_0x720293(0x281)][_0x720293(0x226)](_0x5e5b5c),{'verbose':_0x82f2ef[_0x720293(0x1f3)]}),_0x2217e2=_0x249225[_0x720293(0x2d6)];return console[_0x720293(0x25e)](_0x720293(0x224)+_0x2217e2[_0x720293(0x246)]),console[_0x720293(0x25e)]('Table:\x20'+_0x2217e2[_0x720293(0x232)]),await handleSDKOutput(_0x2217e2[_0x720293(0x2c0)],_0x82f2ef),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x27b7a2(0x248);['description']=a27_0x27b7a2(0x296);async['execute'](_0x2847b){const _0x4d6afa=a27_0x27b7a2,{options:_0x4c9059,args:_0x1e89e7,tdx:_0x368dc2}=_0x2847b,_0x25c463=_0x1e89e7[0x0];if(!requireNameOrPath(_0x25c463))return 0x1;_0x4c9059['verbose']&&console['error']('Input:\x20'+_0x25c463);const {journeyId:_0x11bf33}=await resolveJourneyIdFromInput(_0x25c463,_0x4c9059,_0x368dc2),_0x3cc06b=await withSpinner('Listing\x20journey\x20activations...',()=>_0x368dc2[_0x4d6afa(0x281)]['listActivationsFlat'](_0x11bf33),{'verbose':_0x4c9059[_0x4d6afa(0x1f3)]}),_0x155908=_0x3cc06b[_0x4d6afa(0x2d6)];return console[_0x4d6afa(0x205)](_0x4d6afa(0x230)+_0x155908[_0x4d6afa(0x266)]+_0x4d6afa(0x1f0)+(_0x155908[_0x4d6afa(0x266)]!==0x1?'s':'')),await handleSDKOutput(_0x155908,_0x4c9059),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x227);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x238);[a27_0x27b7a2(0x1ea)]=new SegmentPushCommand();async[a27_0x27b7a2(0x2aa)](_0x245d14){const _0x4ffea0=a27_0x27b7a2,_0xb01bf5=_0x245d14[_0x4ffea0(0x2c6)][0x0];let _0x359c40;if(_0xb01bf5){const _0x4918e2=await resolveTarget({'arg':_0xb01bf5,'contextParent':_0x245d14[_0x4ffea0(0x2cc)][_0x4ffea0(0x1f6)],'cwd':process[_0x4ffea0(0x20f)]()});isSuccessfulResolution(_0x4918e2)&&_0x4918e2[_0x4ffea0(0x24d)]==='file'&&(_0x359c40=_0x4918e2[_0x4ffea0(0x214)]);}const _0x54d00e={..._0x245d14,'options':{..._0x245d14[_0x4ffea0(0x2cc)],'journeysOnly':!![],..._0x359c40&&{'singleFilePath':_0x359c40}}};return this[_0x4ffea0(0x1ea)][_0x4ffea0(0x2aa)](_0x54d00e);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]='journey:versions';['description']=a27_0x27b7a2(0x212);async[a27_0x27b7a2(0x2aa)](_0x43de71){const _0x1857ac=a27_0x27b7a2,{options:_0x3fb245,args:_0x4cc24f,tdx:_0x10b2ec}=_0x43de71,_0x41c763=_0x4cc24f[0x0];if(!requireNameOrPath(_0x41c763))return 0x1;if(_0x3fb245['verbose'])console['error']('Input:\x20'+_0x41c763);const {journeyId:_0x53a85b}=await resolveJourneyIdFromInput(_0x41c763,_0x3fb245,_0x10b2ec),_0x595be3=await withSpinner(_0x1857ac(0x28b),()=>_0x10b2ec[_0x1857ac(0x281)]['listVersions'](_0x53a85b),{'verbose':_0x3fb245[_0x1857ac(0x1f3)]}),{bundleName:_0x279e4b,versions:_0x2184ec,latestJourneyId:_0xfdb536}=_0x595be3[_0x1857ac(0x2d6)];console[_0x1857ac(0x205)](_0x279e4b+':\x20'+_0x2184ec[_0x1857ac(0x266)]+_0x1857ac(0x258)+(_0x2184ec[_0x1857ac(0x266)]!==0x1?'s':''));const _0x4e5ee2=_0x2184ec[_0x1857ac(0x237)](_0x18dd02=>({'version':_0x18dd02[_0x1857ac(0x239)],'journey_id':_0x18dd02['journeyId'],'name':_0x18dd02['name'],'state':_0x18dd02[_0x1857ac(0x2ab)],'paused':_0x18dd02[_0x1857ac(0x1f4)],'latest':_0x18dd02[_0x1857ac(0x1df)]===_0xfdb536,'created_at':_0x18dd02[_0x1857ac(0x200)]}));return await handleSDKOutput(_0x4e5ee2,_0x3fb245),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x28d);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x1e7);async['execute'](_0x7e243e){const _0xbc6ab4=a27_0x27b7a2,{options:_0x480571,args:_0x9cf0,tdx:_0x37f9ac}=_0x7e243e,_0x46ed3f=_0x9cf0[0x0];if(!requireNameOrPath(_0x46ed3f))return 0x1;if(_0x480571[_0xbc6ab4(0x1f3)])console[_0xbc6ab4(0x205)](_0xbc6ab4(0x27c)+_0x46ed3f);const {journeyId:_0x5492bf,journeyName:_0x1b24d5}=await resolveJourneyIdFromInput(_0x46ed3f,_0x480571,_0x37f9ac);if(!_0x480571['yes']){const _0x4faf1c=await confirm(_0xbc6ab4(0x23d)+_0x1b24d5+'\x22?');if(!_0x4faf1c)return console[_0xbc6ab4(0x205)](_0xbc6ab4(0x27e)),0x0;}const _0x440445=await withSpinner(_0xbc6ab4(0x28f),()=>_0x37f9ac[_0xbc6ab4(0x281)][_0xbc6ab4(0x27d)](_0x5492bf),{'verbose':_0x480571[_0xbc6ab4(0x1f3)]}),_0x125083=_0x440445['data'];return console['error'](a27_0xc564bb['green']('✔')+_0xbc6ab4(0x29a)+_0x125083['attributes']['versionNumber']+'\x20(draft)\x20—\x20\x22'+_0x125083[_0xbc6ab4(0x26f)]['name']+'\x22'),console[_0xbc6ab4(0x205)](_0xbc6ab4(0x23c)+_0x125083['id']),await handleSingleObjectOutput({'id':_0x125083['id'],'name':_0x125083[_0xbc6ab4(0x26f)][_0xbc6ab4(0x22c)],'version':_0x125083[_0xbc6ab4(0x26f)][_0xbc6ab4(0x239)],'state':_0x125083[_0xbc6ab4(0x26f)]['state'],'bundle_id':_0x125083['attributes'][_0xbc6ab4(0x2ce)],'created_at':_0x125083['attributes'][_0xbc6ab4(0x200)]},_0x480571),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x253);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x282);async[a27_0x27b7a2(0x2aa)](_0x11a847){const _0x207256=a27_0x27b7a2,{options:_0x2b8b08,args:_0x1bd400,tdx:_0x3da997}=_0x11a847,_0x535c4b=_0x1bd400[0x0];if(!requireNameOrPath(_0x535c4b))return 0x1;const _0x37a555=_0x2b8b08[_0x207256(0x263)];if(!_0x37a555)return console[_0x207256(0x205)](_0x207256(0x283)),console['error'](_0x207256(0x2b7)),0x1;const _0x1acf71=parseInt(_0x37a555,0xa);if(isNaN(_0x1acf71)||_0x1acf71<0x1)return console[_0x207256(0x205)](_0x207256(0x1f9)+_0x37a555),0x1;if(_0x2b8b08[_0x207256(0x1f3)])console[_0x207256(0x205)](_0x207256(0x27c)+_0x535c4b+',\x20version:\x20'+_0x1acf71);const {journeyId:_0x58122a,parentSegmentId:_0x5821a4}=await resolveJourneyIdFromInput(_0x535c4b,_0x2b8b08,_0x3da997),_0x189056=await withSpinner(_0x207256(0x2a6),()=>_0x3da997[_0x207256(0x281)]['listVersions'](_0x58122a),{'verbose':_0x2b8b08[_0x207256(0x1f3)]}),{versions:_0x342d9c,latestJourneyId:_0x46f2d9}=_0x189056[_0x207256(0x2d6)],_0x553dfe=_0x342d9c[_0x207256(0x2d5)](_0x1d1225=>_0x1d1225[_0x207256(0x239)]===_0x1acf71);if(!_0x553dfe){const _0xf41aca=_0x342d9c[_0x207256(0x237)](_0x3c3fa1=>'v'+_0x3c3fa1[_0x207256(0x239)])[_0x207256(0x206)](',\x20');return console[_0x207256(0x205)]('Error:\x20Version\x20'+_0x1acf71+_0x207256(0x2b6)+_0xf41aca),0x1;}const _0x1ef712=await withSpinner('Getting\x20version\x20'+_0x1acf71+_0x207256(0x26c),()=>_0x3da997[_0x207256(0x281)]['getJourney'](_0x553dfe[_0x207256(0x1df)]),{'verbose':_0x2b8b08[_0x207256(0x1f3)]}),_0x1cd3d8=_0x1ef712['data'],_0x14a649=getConsoleNextUrl(_0x2b8b08[_0x207256(0x1e0)],_0x207256(0x29f)+_0x5821a4+_0x207256(0x1dc)+_0x553dfe[_0x207256(0x1df)]+_0x207256(0x2d1));return await handleSingleObjectOutput({'id':_0x1cd3d8['id'],'name':_0x1cd3d8[_0x207256(0x26f)][_0x207256(0x22c)],'version':_0x1cd3d8[_0x207256(0x26f)]['versionNumber'],'description':_0x1cd3d8[_0x207256(0x26f)][_0x207256(0x2ca)],'state':_0x1cd3d8['attributes'][_0x207256(0x2ab)],'paused':_0x1cd3d8[_0x207256(0x26f)]['paused'],'reentry_mode':_0x1cd3d8[_0x207256(0x26f)]['reentryMode'],'stages':_0x1cd3d8[_0x207256(0x26f)]['journeyStages']?.['length']||0x0,..._0x1cd3d8[_0x207256(0x26f)]['goal']&&{'goal':_0x1cd3d8[_0x207256(0x26f)][_0x207256(0x22b)][_0x207256(0x22c)]},'latest':_0x553dfe['journeyId']===_0x46f2d9,'created_at':_0x1cd3d8[_0x207256(0x26f)][_0x207256(0x200)],'updated_at':_0x1cd3d8[_0x207256(0x26f)]['updatedAt'],'url':_0x14a649},_0x2b8b08),0x0;}}
@@ -1 +1 @@
1
- const a28_0x572800=a28_0x14c7;(function(_0x94ea37,_0x3105e9){const _0x5690cd=a28_0x14c7,_0x41ec2=_0x94ea37();while(!![]){try{const _0x16927e=-parseInt(_0x5690cd(0x172))/0x1*(-parseInt(_0x5690cd(0x168))/0x2)+parseInt(_0x5690cd(0x142))/0x3+parseInt(_0x5690cd(0x15c))/0x4+parseInt(_0x5690cd(0x169))/0x5*(parseInt(_0x5690cd(0x14e))/0x6)+-parseInt(_0x5690cd(0x141))/0x7+-parseInt(_0x5690cd(0x173))/0x8*(parseInt(_0x5690cd(0x14b))/0x9)+-parseInt(_0x5690cd(0x156))/0xa*(parseInt(_0x5690cd(0x14f))/0xb);if(_0x16927e===_0x3105e9)break;else _0x41ec2['push'](_0x41ec2['shift']());}catch(_0x3f0dea){_0x41ec2['push'](_0x41ec2['shift']());}}}(a28_0x3db0,0xecb13));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a28_0x3db0(){const _0x32afdd=['reason','errorCode','5920530cyIYeR','1497618wsxIZV','validCount','Error:\x20','parentSegment','\x20journey(s)\x20with\x20errors,\x20','verbose','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20segment\x20file(s)\x20skipped','yellow','5985cKkJiK','helpText','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','57234btnLUB','393635UVERhk','.yaml','no_parent','errors','\x20valid','invalidCount','execute','380BEPpSM','valid','dim','cyan','description','\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','3778140UXgeNT','Validation\x20failed:\x20','skippedCount','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','endsWith','.yml','name','length','log','warningCount','relativePath','message','194162PCkPkk','70YeUiOu','\x20segment\x20file(s)\x20skipped)','journey:validate','green','\x20warning(s)\x20found','red','\x20warning(s)','\x20(skipped:\x20','\x20journey(s)\x20valid','19RoGGHZ','2968BRAOAx','Validate\x20journey\x20YAML\x20files','error','hasErrors'];a28_0x3db0=function(){return _0x32afdd;};return a28_0x3db0();}function a28_0x14c7(_0x4552d4,_0x224f25){_0x4552d4=_0x4552d4-0x140;const _0x3db0aa=a28_0x3db0();let _0x14c70c=_0x3db0aa[_0x4552d4];return _0x14c70c;}import a28_0x5d46ac from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x572800(0x162)]=a28_0x572800(0x16b);[a28_0x572800(0x15a)]=a28_0x572800(0x174);async[a28_0x572800(0x155)](_0x281705){const _0x42d217=a28_0x572800,{options:_0x38488d,args:_0x17d7ad}=_0x281705,_0x2fe754=_0x38488d,_0x57041f=await resolveTarget({'arg':_0x17d7ad[0x0],'contextParent':_0x38488d[_0x42d217(0x145)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x57041f))return _0x57041f[_0x42d217(0x140)]===_0x42d217(0x151)?(console[_0x42d217(0x175)](a28_0x5d46ac[_0x42d217(0x14a)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x42d217(0x175)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console['error'](_0x42d217(0x15b)),console[_0x42d217(0x175)](_0x42d217(0x148))):(console[_0x42d217(0x175)](a28_0x5d46ac[_0x42d217(0x16e)](_0x42d217(0x144)+_0x57041f[_0x42d217(0x167)]+'\x0a')),_0x57041f[_0x42d217(0x14c)]&&console[_0x42d217(0x175)](a28_0x5d46ac[_0x42d217(0x159)](_0x57041f[_0x42d217(0x14c)]))),0x1;const _0x1af4a8=_0x57041f['targetDir'],_0xf12747=_0x57041f['type']==='file'?_0x57041f['filePath']:undefined;if(!_0xf12747&&!existsSync(_0x1af4a8))return console['error'](a28_0x5d46ac[_0x42d217(0x16e)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1af4a8+'\x0a')),0x1;let _0x5d8f85;if(_0xf12747){if(!_0xf12747[_0x42d217(0x160)](_0x42d217(0x161))&&!_0xf12747[_0x42d217(0x160)](_0x42d217(0x150)))return console[_0x42d217(0x175)](a28_0x5d46ac[_0x42d217(0x16e)](_0x42d217(0x15f)+_0xf12747+'\x0a')),0x1;_0x5d8f85=[_0xf12747];}else _0x5d8f85=findYamlFiles(_0x1af4a8);if(_0x5d8f85[_0x42d217(0x163)]===0x0)return console[_0x42d217(0x175)](a28_0x5d46ac['red'](_0x42d217(0x14d)+_0x1af4a8+'\x0a')),0x1;const _0x43475d=validateYamlFiles(_0x5d8f85,_0x1af4a8,{'filterType':'journey'}),_0x1ced2b=calculateSummary(_0x43475d),_0x3b603f=_0x43475d['filter'](isValidationResult);if(_0x3b603f[_0x42d217(0x163)]===0x0)return console['error'](a28_0x5d46ac['yellow']('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x1af4a8+'\x0a')),_0x1ced2b[_0x42d217(0x15e)]>0x0&&console[_0x42d217(0x175)](a28_0x5d46ac[_0x42d217(0x158)]('('+_0x1ced2b[_0x42d217(0x15e)]+_0x42d217(0x16a))),0x0;for(const _0x3b78e3 of _0x43475d){if(!isValidationResult(_0x3b78e3)){_0x2fe754['verbose']&&console[_0x42d217(0x164)](a28_0x5d46ac['dim']('-\x20'+_0x3b78e3[_0x42d217(0x166)]+_0x42d217(0x170)+_0x3b78e3[_0x42d217(0x177)]+')'));continue;}const {relativePath:_0x589e05,source:_0xf3ca9a,result:_0x4da0ac}=_0x3b78e3;if(_0x4da0ac[_0x42d217(0x157)]&&_0x4da0ac['warnings'][_0x42d217(0x163)]===0x0)_0x2fe754[_0x42d217(0x147)]&&console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x16c)]('✔\x20'+_0x589e05));else _0x4da0ac['valid']?(console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x14a)]('⚠\x20'+_0x589e05+':\x20'+_0x4da0ac['warnings'][_0x42d217(0x163)]+_0x42d217(0x16f))),console[_0x42d217(0x164)](formatValidationResult(_0x4da0ac,_0xf3ca9a,_0x589e05))):(console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x16e)]('✖\x20'+_0x589e05+':\x20'+_0x4da0ac[_0x42d217(0x152)][_0x42d217(0x163)]+'\x20error(s)')),console['log'](formatValidationResult(_0x4da0ac,_0xf3ca9a,_0x589e05)));}return console['log'](''),_0x1ced2b[_0x42d217(0x176)]?(console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x16e)](_0x42d217(0x15d)+_0x1ced2b[_0x42d217(0x154)]+_0x42d217(0x146)+_0x1ced2b[_0x42d217(0x143)]+_0x42d217(0x153))),_0x1ced2b[_0x42d217(0x165)]>0x0&&console['log'](a28_0x5d46ac[_0x42d217(0x14a)](_0x1ced2b[_0x42d217(0x165)]+_0x42d217(0x16d))),_0x1ced2b[_0x42d217(0x15e)]>0x0&&console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x158)](_0x1ced2b['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x1):(console['log'](a28_0x5d46ac[_0x42d217(0x16c)]('✔\x20All\x20'+_0x1ced2b['validCount']+_0x42d217(0x171))),_0x1ced2b[_0x42d217(0x165)]>0x0&&console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x14a)](_0x1ced2b[_0x42d217(0x165)]+_0x42d217(0x16d))),_0x1ced2b[_0x42d217(0x15e)]>0x0&&console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x158)](_0x1ced2b[_0x42d217(0x15e)]+_0x42d217(0x149))),0x0);}}
1
+ const a28_0x503261=a28_0x1f1e;(function(_0x1f526f,_0x22c04c){const _0x16455c=a28_0x1f1e,_0x326c77=_0x1f526f();while(!![]){try{const _0x509654=parseInt(_0x16455c(0xd1))/0x1+-parseInt(_0x16455c(0xbc))/0x2+parseInt(_0x16455c(0xaa))/0x3+parseInt(_0x16455c(0xb1))/0x4+parseInt(_0x16455c(0xad))/0x5+-parseInt(_0x16455c(0xaf))/0x6+-parseInt(_0x16455c(0xa7))/0x7;if(_0x509654===_0x22c04c)break;else _0x326c77['push'](_0x326c77['shift']());}catch(_0x1d0e69){_0x326c77['push'](_0x326c77['shift']());}}}(a28_0x440d,0xc25c6));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x5321e7 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a28_0x1f1e(_0x5a0cf1,_0x121e74){_0x5a0cf1=_0x5a0cf1-0xa3;const _0x440d7b=a28_0x440d();let _0x1f1e93=_0x440d7b[_0x5a0cf1];return _0x1f1e93;}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0x440d(){const _0x787ccc=['journey','length','79204hlWFxg','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','message','warnings','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','targetDir','error','validCount','dim','\x20journey(s)\x20valid','yellow','cyan','143913nrDuIt','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20segment\x20file(s)\x20skipped','2854506PwPsak','reason','helpText','7347990oLkqRs','.yml','8052138npJGuk','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','794564BxyTix','filePath','hasErrors','\x20error(s)','✔\x20All\x20','\x20valid','verbose','log','green','skippedCount','warningCount','1080522aPlFck','Validate\x20journey\x20YAML\x20files','red','invalidCount','Error:\x20Directory\x20not\x20found:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20(skipped:\x20','\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','execute','\x20warning(s)\x20found','errors','Validation\x20failed:\x20','valid','description','\x20segment\x20file(s)\x20skipped)','relativePath','name','type','.yaml'];a28_0x440d=function(){return _0x787ccc;};return a28_0x440d();}export class JourneyValidateCommand extends BaseCommand{[a28_0x503261(0xcc)]='journey:validate';[a28_0x503261(0xc9)]=a28_0x503261(0xbd);async[a28_0x503261(0xc4)](_0xc524aa){const _0x51e6d0=a28_0x503261,{options:_0x28bd16,args:_0x3399dd}=_0xc524aa,_0x43b55e=_0x28bd16,_0x5725e4=await resolveTarget({'arg':_0x3399dd[0x0],'contextParent':_0x28bd16['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5725e4))return _0x5725e4['errorCode']==='no_parent'?(console['error'](a28_0x5321e7['yellow'](_0x51e6d0(0xc1))),console[_0x51e6d0(0xd7)](_0x51e6d0(0xd2)),console[_0x51e6d0(0xd7)](_0x51e6d0(0xc3)),console['error'](_0x51e6d0(0xa8))):(console[_0x51e6d0(0xd7)](a28_0x5321e7['red']('Error:\x20'+_0x5725e4[_0x51e6d0(0xd3)]+'\x0a')),_0x5725e4['helpText']&&console[_0x51e6d0(0xd7)](a28_0x5321e7[_0x51e6d0(0xa6)](_0x5725e4[_0x51e6d0(0xac)]))),0x1;const _0x1e0c26=_0x5725e4[_0x51e6d0(0xd6)],_0x32e019=_0x5725e4[_0x51e6d0(0xcd)]==='file'?_0x5725e4[_0x51e6d0(0xb2)]:undefined;if(!_0x32e019&&!existsSync(_0x1e0c26))return console['error'](a28_0x5321e7[_0x51e6d0(0xbe)](_0x51e6d0(0xc0)+_0x1e0c26+'\x0a')),0x1;let _0x3b7da8;if(_0x32e019){if(!_0x32e019['endsWith'](_0x51e6d0(0xae))&&!_0x32e019['endsWith'](_0x51e6d0(0xce)))return console['error'](a28_0x5321e7[_0x51e6d0(0xbe)](_0x51e6d0(0xd5)+_0x32e019+'\x0a')),0x1;_0x3b7da8=[_0x32e019];}else _0x3b7da8=findYamlFiles(_0x1e0c26);if(_0x3b7da8[_0x51e6d0(0xd0)]===0x0)return console['error'](a28_0x5321e7[_0x51e6d0(0xbe)](_0x51e6d0(0xb0)+_0x1e0c26+'\x0a')),0x1;const _0x552edf=validateYamlFiles(_0x3b7da8,_0x1e0c26,{'filterType':_0x51e6d0(0xcf)}),_0x4f47bd=calculateSummary(_0x552edf),_0x30bb32=_0x552edf['filter'](isValidationResult);if(_0x30bb32[_0x51e6d0(0xd0)]===0x0)return console[_0x51e6d0(0xd7)](a28_0x5321e7[_0x51e6d0(0xa5)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x1e0c26+'\x0a')),_0x4f47bd[_0x51e6d0(0xba)]>0x0&&console[_0x51e6d0(0xd7)](a28_0x5321e7['dim']('('+_0x4f47bd[_0x51e6d0(0xba)]+_0x51e6d0(0xca))),0x0;for(const _0x324a9c of _0x552edf){if(!isValidationResult(_0x324a9c)){_0x43b55e['verbose']&&console['log'](a28_0x5321e7['dim']('-\x20'+_0x324a9c[_0x51e6d0(0xcb)]+_0x51e6d0(0xc2)+_0x324a9c[_0x51e6d0(0xab)]+')'));continue;}const {relativePath:_0x5cb62e,source:_0xc08466,result:_0x4ea6a1}=_0x324a9c;if(_0x4ea6a1[_0x51e6d0(0xc8)]&&_0x4ea6a1[_0x51e6d0(0xd4)][_0x51e6d0(0xd0)]===0x0)_0x43b55e[_0x51e6d0(0xb7)]&&console[_0x51e6d0(0xb8)](a28_0x5321e7[_0x51e6d0(0xb9)]('✔\x20'+_0x5cb62e));else _0x4ea6a1['valid']?(console[_0x51e6d0(0xb8)](a28_0x5321e7[_0x51e6d0(0xa5)]('⚠\x20'+_0x5cb62e+':\x20'+_0x4ea6a1[_0x51e6d0(0xd4)][_0x51e6d0(0xd0)]+'\x20warning(s)')),console[_0x51e6d0(0xb8)](formatValidationResult(_0x4ea6a1,_0xc08466,_0x5cb62e))):(console[_0x51e6d0(0xb8)](a28_0x5321e7[_0x51e6d0(0xbe)]('✖\x20'+_0x5cb62e+':\x20'+_0x4ea6a1[_0x51e6d0(0xc6)][_0x51e6d0(0xd0)]+_0x51e6d0(0xb4))),console[_0x51e6d0(0xb8)](formatValidationResult(_0x4ea6a1,_0xc08466,_0x5cb62e)));}return console[_0x51e6d0(0xb8)](''),_0x4f47bd[_0x51e6d0(0xb3)]?(console[_0x51e6d0(0xb8)](a28_0x5321e7[_0x51e6d0(0xbe)](_0x51e6d0(0xc7)+_0x4f47bd[_0x51e6d0(0xbf)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x4f47bd[_0x51e6d0(0xd8)]+_0x51e6d0(0xb6))),_0x4f47bd[_0x51e6d0(0xbb)]>0x0&&console[_0x51e6d0(0xb8)](a28_0x5321e7[_0x51e6d0(0xa5)](_0x4f47bd[_0x51e6d0(0xbb)]+_0x51e6d0(0xc5))),_0x4f47bd[_0x51e6d0(0xba)]>0x0&&console['log'](a28_0x5321e7[_0x51e6d0(0xa3)](_0x4f47bd[_0x51e6d0(0xba)]+_0x51e6d0(0xa9))),0x1):(console[_0x51e6d0(0xb8)](a28_0x5321e7[_0x51e6d0(0xb9)](_0x51e6d0(0xb5)+_0x4f47bd[_0x51e6d0(0xd8)]+_0x51e6d0(0xa4))),_0x4f47bd[_0x51e6d0(0xbb)]>0x0&&console[_0x51e6d0(0xb8)](a28_0x5321e7[_0x51e6d0(0xa5)](_0x4f47bd['warningCount']+_0x51e6d0(0xc5))),_0x4f47bd[_0x51e6d0(0xba)]>0x0&&console['log'](a28_0x5321e7[_0x51e6d0(0xa3)](_0x4f47bd['skippedCount']+_0x51e6d0(0xa9))),0x0);}}