@treasuredata/tdx 2026.4.9 → 2026.4.11

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_0x1aa8ac=a23_0x5332;function a23_0x5332(_0x4c0736,_0x438aec){_0x4c0736=_0x4c0736-0x7f;const _0x7cfa82=a23_0x7cfa();let _0x533277=_0x7cfa82[_0x4c0736];return _0x533277;}(function(_0x2ef960,_0x5a8175){const _0x4ae61e=a23_0x5332,_0x2796ca=_0x2ef960();while(!![]){try{const _0x572e27=-parseInt(_0x4ae61e(0x90))/0x1*(parseInt(_0x4ae61e(0x8a))/0x2)+parseInt(_0x4ae61e(0x92))/0x3*(parseInt(_0x4ae61e(0x98))/0x4)+parseInt(_0x4ae61e(0x9d))/0x5*(-parseInt(_0x4ae61e(0xaf))/0x6)+parseInt(_0x4ae61e(0x91))/0x7+-parseInt(_0x4ae61e(0xbd))/0x8+parseInt(_0x4ae61e(0xbf))/0x9*(parseInt(_0x4ae61e(0xb9))/0xa)+-parseInt(_0x4ae61e(0xa9))/0xb;if(_0x572e27===_0x5a8175)break;else _0x2796ca['push'](_0x2796ca['shift']());}catch(_0x28a6c5){_0x2796ca['push'](_0x2796ca['shift']());}}}(a23_0x7cfa,0x6557e));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_0x545f4d from'chalk';function a23_0x7cfa(){const _0x30a39e=['dryRun','config','absolutePath','✔\x20All\x20files\x20are\x20up\x20to\x20date','232yxlQgk','cwd','description','\x20=\x20','\x20changed\x20files','405aCSdVQ','yes','diff','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','workspace','relativePath','isNew','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','-\x20no\x20files\x20written','error','targetDir','content','3839605kbtAmf','session','cyan','yellow','length','execute','33168aUBKMF','\x20files?','\x0aPull\x20summary\x20for\x20workspace\x20\x27','filter','hasChanges','templates','\x27...','repeat','Aborted.','\x20\x20Target:\x20','8294570ethIFK','engage_workspace','workspaceName','dirname','2405520eWCWCj','\x20templates','9TgZDbK','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','red','\x0aChanges\x20to\x20\x27','data','green','name','files','Pull\x20templates\x20to\x20YAML\x20files','✔\x20Pulled\x20','\x20unchanged\x20files','Pulling\x20templates\x20from\x20\x27','dim','33786mxGCZb','engage','\x20files\x20to\x20','Write\x20','counts','\x20new\x20files','33GPWphi','4589067saBete','30261buwkVr','✔\x20Context\x20set:\x20'];a23_0x7cfa=function(){return _0x30a39e;};return a23_0x7cfa();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x4a118b from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a23_0x1aa8ac(0x83)]='engage:template:pull';[a23_0x1aa8ac(0x9a)]=a23_0x1aa8ac(0x85);async[a23_0x1aa8ac(0xae)](_0x154909){const _0x18971e=a23_0x1aa8ac,{options:_0x4af943,args:_0x16f817,tdx:_0x2c230f}=_0x154909,_0x5ce33a=_0x4af943,_0xcd0b0a=await resolveWorkspaceName(_0x16f817[0x0],_0x5ce33a);if(!_0xcd0b0a)return console['error'](a23_0x545f4d[_0x18971e(0xac)]('Workspace\x20is\x20required.')),console[_0x18971e(0xa6)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console['error'](_0x18971e(0xc0)),console[_0x18971e(0xa6)](_0x18971e(0xa0)),0x1;const _0x1095ef=await withProgressSpinner(_0x18971e(0x88)+_0xcd0b0a+_0x18971e(0xb5),_0x329fd0=>pullTemplates({'engage':_0x2c230f[_0x18971e(0x8b)]},_0xcd0b0a,{'templateName':_0x5ce33a[_0x18971e(0x83)],'progress':{'update':_0x1afdab=>{_0x329fd0['setPhase'](_0x1afdab);}}}),{'verbose':_0x5ce33a['verbose']}),_0x27f422=_0x1095ef[_0x18971e(0x81)];if(_0x27f422[_0x18971e(0x8e)]['templates']===0x0)return console['error'](a23_0x545f4d[_0x18971e(0xac)]('No\x20templates\x20found\x20in\x20workspace\x20\x27'+_0x27f422[_0x18971e(0xbb)]+'\x27')),0x0;const _0x55e394=_0x27f422[_0x18971e(0x84)][_0x18971e(0xb2)](_0x2b8744=>_0x2b8744[_0x18971e(0xa3)]),_0x56568f=_0x27f422['files']['filter'](_0x4c3e60=>!_0x4c3e60[_0x18971e(0xa3)]&&_0x4c3e60[_0x18971e(0xb3)]),_0x2aa071=_0x27f422[_0x18971e(0x84)][_0x18971e(0xb2)](_0x1929d6=>!_0x1929d6[_0x18971e(0xa3)]&&!_0x1929d6[_0x18971e(0xb3)]);console['error'](_0x18971e(0xb1)+_0x27f422['workspaceName']+'\x27:'),console[_0x18971e(0xa6)]('\x20\x20'+a23_0x545f4d['cyan'](_0x27f422[_0x18971e(0x8e)][_0x18971e(0xb4)]+_0x18971e(0xbe))),console[_0x18971e(0xa6)]('\x20\x20'+a23_0x545f4d[_0x18971e(0x82)]('+\x20'+_0x55e394[_0x18971e(0xad)]+_0x18971e(0x8f))),console['error']('\x20\x20'+a23_0x545f4d[_0x18971e(0xac)]('~\x20'+_0x56568f[_0x18971e(0xad)]+_0x18971e(0x9c))),console[_0x18971e(0xa6)]('\x20\x20'+a23_0x545f4d[_0x18971e(0x89)]('=\x20'+_0x2aa071[_0x18971e(0xad)]+_0x18971e(0x87))),console[_0x18971e(0xa6)](_0x18971e(0xb8)+a23_0x545f4d[_0x18971e(0xab)](_0x27f422[_0x18971e(0xa7)])+'\x0a');if(_0x56568f[_0x18971e(0xad)]>0x0)for(const _0x126cd5 of _0x56568f){console[_0x18971e(0xa6)](_0x18971e(0x80)+_0x126cd5[_0x18971e(0xa2)]+'\x27:'),console[_0x18971e(0xa6)]('─'[_0x18971e(0xb6)](0x3c)),console[_0x18971e(0xa6)](_0x126cd5[_0x18971e(0x9f)]),console[_0x18971e(0xa6)]('─'['repeat'](0x3c));}if(_0x5ce33a[_0x18971e(0x94)])return console[_0x18971e(0xa6)](a23_0x545f4d[_0x18971e(0xac)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x55e394[_0x18971e(0xad)]===0x0&&_0x56568f['length']===0x0)return console[_0x18971e(0xa6)](a23_0x545f4d[_0x18971e(0x82)](_0x18971e(0x97))),saveSessionContext({'engage_workspace':_0x27f422[_0x18971e(0xbb)]},_0x5ce33a[_0x18971e(0xaa)]),0x0;if(!_0x5ce33a[_0x18971e(0x9e)]){if(!isInteractive())return console[_0x18971e(0xa6)](a23_0x545f4d[_0x18971e(0x7f)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x18971e(0xa6)](a23_0x545f4d['dim'](_0x18971e(0xa4))),0x1;const _0x506e47=await confirmKey(_0x18971e(0x8d)+(_0x55e394[_0x18971e(0xad)]+_0x56568f[_0x18971e(0xad)])+_0x18971e(0xb0));if(!_0x506e47)return console[_0x18971e(0xa6)](a23_0x545f4d[_0x18971e(0xac)](_0x18971e(0xb7)),_0x18971e(0xa5)),0x1;}for(const _0x1b555b of _0x27f422['files']){if(_0x1b555b[_0x18971e(0xa3)]||_0x1b555b[_0x18971e(0xb3)]){const _0x36cd0a=a23_0x4a118b[_0x18971e(0xbc)](_0x1b555b[_0x18971e(0x96)]);!existsSync(_0x36cd0a)&&mkdirSync(_0x36cd0a,{'recursive':!![]}),writeFileSync(_0x1b555b[_0x18971e(0x96)],_0x1b555b[_0x18971e(0xa8)],'utf-8');}}return console['error'](a23_0x545f4d[_0x18971e(0x82)](_0x18971e(0x86)+(_0x55e394[_0x18971e(0xad)]+_0x56568f[_0x18971e(0xad)])+_0x18971e(0x8c)+_0x27f422[_0x18971e(0xa7)])),saveSessionContext({'engage_workspace':_0x27f422['workspaceName']},_0x5ce33a[_0x18971e(0xaa)]),console['error'](a23_0x545f4d[_0x18971e(0x82)](_0x18971e(0x93)+a23_0x545f4d[_0x18971e(0x89)](_0x18971e(0xba))+_0x18971e(0x9b)+a23_0x545f4d[_0x18971e(0xab)](_0x27f422[_0x18971e(0xbb)]))),0x0;}}async function resolveWorkspaceName(_0x221722,_0x13d605){const _0x12119e=a23_0x1aa8ac;if(_0x221722)return _0x221722;if(_0x13d605[_0x12119e(0xa1)])return _0x13d605[_0x12119e(0xa1)];const _0x5e1b2d=tryFindTdxConfig(process[_0x12119e(0x99)]());if(_0x5e1b2d?.[_0x12119e(0x95)][_0x12119e(0xba)])return _0x5e1b2d[_0x12119e(0x95)][_0x12119e(0xba)];const _0x423129=loadSessionContext(_0x13d605[_0x12119e(0xaa)]);if(_0x423129?.[_0x12119e(0xba)])return _0x423129[_0x12119e(0xba)];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_0x5f50c7=a24_0x56a2;function a24_0x4793(){const _0x2a1989=['red','configDir','path','Workspace\x20is\x20required.','33512940JZzead','7109176QeoHyO','error','458072OfyhRj','\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','Pushing\x20templates...','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','resolveWorkspaceId','action','filter','message','length','\x0aPush\x20summary\x20for\x20workspace\x20\x27','create','session','workspace','yellow','dirname','\x20\x20\x20\x20','✔\x20All\x20templates\x20are\x20up\x20to\x20date','50508skimgd','\x0aError:','engage_workspace','-\x20no\x20changes\x20applied','green','def','Preparing\x20push\x20to\x20workspace\x20\x27','setPhase','\x27...','No\x20template\x20YAML\x20files\x20found\x20in\x20','warnings','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','7998192mhSwMk','config','\x20templates?','1752530YtwNzu','name','\x20template\x20files','14LzumeT','description','created','7smoYls','errors','engage','resolve','dryRun','updated','dim','\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','4600206BjvJjc','cyan','data','Found\x20','1\x20template\x20file:\x20','Resolving\x20references...','\x20templates\x20to\x20update:','\x20templates','engage:template:push','64GgNXez','valid','execute','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aValidation\x20errors\x20in\x20','\x20new\x20templates:'];a24_0x4793=function(){return _0x2a1989;};return a24_0x4793();}(function(_0x9286ee,_0x1f4616){const _0xec2e85=a24_0x56a2,_0x97d95=_0x9286ee();while(!![]){try{const _0x4ff3ba=-parseInt(_0xec2e85(0x1ad))/0x1*(parseInt(_0xec2e85(0x1cb))/0x2)+parseInt(_0xec2e85(0x1dc))/0x3*(-parseInt(_0xec2e85(0x1be))/0x4)+-parseInt(_0xec2e85(0x1eb))/0x5+-parseInt(_0xec2e85(0x1b5))/0x6*(-parseInt(_0xec2e85(0x1ee))/0x7)+-parseInt(_0xec2e85(0x1c9))/0x8+-parseInt(_0xec2e85(0x1e8))/0x9+parseInt(_0xec2e85(0x1c8))/0xa;if(_0x4ff3ba===_0x1f4616)break;else _0x97d95['push'](_0x97d95['shift']());}catch(_0x165089){_0x97d95['push'](_0x97d95['shift']());}}}(a24_0x4793,0xd7e03));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';function a24_0x56a2(_0x527d0c,_0x329499){_0x527d0c=_0x527d0c-0x1ad;const _0x479360=a24_0x4793();let _0x56a228=_0x479360[_0x527d0c];return _0x56a228;}import a24_0x2a6e19 from'chalk';import a24_0x58ffae 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_0x5f50c7(0x1ec)]=a24_0x5f50c7(0x1bd);[a24_0x5f50c7(0x1ef)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a24_0x5f50c7(0x1c0)](_0x3de497){const _0x5d9b7b=a24_0x5f50c7,{options:_0x53dc1f,args:_0x4abd1a,tdx:_0x21eaf2}=_0x3de497,_0x4cb843=_0x53dc1f,_0x1a8b9f=_0x4abd1a[0x0],_0x56a1ec=_0x1a8b9f?a24_0x58ffae[_0x5d9b7b(0x1b0)](_0x1a8b9f):undefined,_0x4fbadf=_0x56a1ec?isYamlFile(_0x56a1ec):![];let _0xb13313;if(_0x4fbadf&&_0x56a1ec)_0xb13313=a24_0x58ffae[_0x5d9b7b(0x1d9)](_0x56a1ec);else _0x56a1ec?_0xb13313=_0x56a1ec:_0xb13313=process['cwd']();let _0x3fde1e;const _0x20e82b=tryFindTdxConfig(_0xb13313);_0x20e82b?.[_0x5d9b7b(0x1e9)]['engage_workspace']&&(_0x3fde1e=_0x20e82b['config'][_0x5d9b7b(0x1de)],!_0x4fbadf&&(_0xb13313=_0x20e82b[_0x5d9b7b(0x1c5)]));_0x4cb843[_0x5d9b7b(0x1d7)]&&(_0x3fde1e=_0x4cb843[_0x5d9b7b(0x1d7)]);if(!_0x3fde1e){const _0x1e8a04=loadSessionContext(_0x4cb843[_0x5d9b7b(0x1d6)]);_0x1e8a04?.[_0x5d9b7b(0x1de)]&&(_0x3fde1e=_0x1e8a04['engage_workspace']);}if(!_0x3fde1e)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow'](_0x5d9b7b(0x1c7))),console['error'](_0x5d9b7b(0x1cc)),console[_0x5d9b7b(0x1ca)]('\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)'),console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1b4)),console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1c1)),0x1;let _0x4bad18;_0x4fbadf&&_0x56a1ec?_0x4bad18=[parseTemplateFile(_0x56a1ec,a24_0x58ffae[_0x5d9b7b(0x1d9)](_0x56a1ec))]:_0x4bad18=discoverAndParseTemplateFiles(_0xb13313);if(_0x4bad18[_0x5d9b7b(0x1d3)]===0x0)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow'](_0x5d9b7b(0x1e5)+_0xb13313)),console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1b3)](_0x5d9b7b(0x1ce))),0x1;const _0x470f16=_0x4bad18[_0x5d9b7b(0x1d3)]===0x1?_0x5d9b7b(0x1b9)+_0x4bad18[0x0][_0x5d9b7b(0x1e1)][_0x5d9b7b(0x1ec)]:_0x4bad18[_0x5d9b7b(0x1d3)]+_0x5d9b7b(0x1ed);console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1b8)+a24_0x2a6e19[_0x5d9b7b(0x1b6)](_0x470f16));let _0x48cf57=![];for(const _0xc1a588 of _0x4bad18){const _0x25b032=validateTemplateDef(_0xc1a588['def']);if(!_0x25b032[_0x5d9b7b(0x1bf)]){_0x48cf57=!![],console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)](_0x5d9b7b(0x1c2)+_0xc1a588['relativePath']+':'));for(const _0x5035f0 of _0x25b032[_0x5d9b7b(0x1ae)]){console['error']('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1c4)]('✗')+'\x20'+_0x5035f0['path']+':\x20'+_0x5035f0[_0x5d9b7b(0x1d2)]);}}for(const _0x1ef662 of _0x25b032[_0x5d9b7b(0x1e6)]){console['error']('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1d8)]('⚠')+'\x20'+_0x1ef662[_0x5d9b7b(0x1c6)]+':\x20'+_0x1ef662[_0x5d9b7b(0x1d2)]);}}if(_0x48cf57)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x435a61=await _0x21eaf2['engage'][_0x5d9b7b(0x1cf)](_0x3fde1e),_0x5e9ce5=await withProgressSpinner(_0x5d9b7b(0x1e2)+_0x3fde1e+_0x5d9b7b(0x1e4),_0x2f8fd1=>preparePush({'engage':_0x21eaf2[_0x5d9b7b(0x1af)]},_0x4bad18,_0x435a61,{'progress':{'update':_0x4786ed=>_0x2f8fd1[_0x5d9b7b(0x1e3)](_0x4786ed)}}),{'verbose':_0x4cb843['verbose']}),_0x1ac2c7=_0x5e9ce5[_0x5d9b7b(0x1b7)];await withProgressSpinner(_0x5d9b7b(0x1ba),_0x1a9e9e=>resolveAndBuildInputs({'engage':_0x21eaf2['engage']},_0x1ac2c7,_0x435a61,{'progress':{'update':_0x27461e=>_0x1a9e9e[_0x5d9b7b(0x1e3)](_0x27461e)}}),{'verbose':_0x4cb843['verbose']});const _0x4b6a86=_0x1ac2c7[_0x5d9b7b(0x1d1)](_0x405efb=>_0x405efb['action']===_0x5d9b7b(0x1d5)),_0x476dc5=_0x1ac2c7[_0x5d9b7b(0x1d1)](_0x2c85cb=>_0x2c85cb[_0x5d9b7b(0x1d0)]==='update');console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1d4)+_0x3fde1e+'\x27:');if(_0x4b6a86[_0x5d9b7b(0x1d3)]>0x0){console[_0x5d9b7b(0x1ca)]('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1e0)]('+\x20'+_0x4b6a86[_0x5d9b7b(0x1d3)]+_0x5d9b7b(0x1c3)));for(const _0x10af7d of _0x4b6a86){console['error']('\x20\x20\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1e0)]('+')+'\x20'+_0x10af7d[_0x5d9b7b(0x1e1)][_0x5d9b7b(0x1ec)]);}}if(_0x476dc5['length']>0x0){console[_0x5d9b7b(0x1ca)]('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1d8)]('~\x20'+_0x476dc5[_0x5d9b7b(0x1d3)]+_0x5d9b7b(0x1bb)));for(const _0x55e41a of _0x476dc5){console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1da)+a24_0x2a6e19[_0x5d9b7b(0x1d8)]('~')+'\x20'+_0x55e41a[_0x5d9b7b(0x1e1)][_0x5d9b7b(0x1ec)]);}}if(_0x4b6a86[_0x5d9b7b(0x1d3)]===0x0&&_0x476dc5[_0x5d9b7b(0x1d3)]===0x0)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1e0)](_0x5d9b7b(0x1db))),0x0;if(_0x4cb843[_0x5d9b7b(0x1b1)])return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow'](_0x5d9b7b(0x1e7))),0x0;if(!_0x4cb843['yes']){if(!isInteractive())return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)](_0x5d9b7b(0x1dd)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a24_0x2a6e19[_0x5d9b7b(0x1b3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5387a7=await confirmKey('Push\x20'+(_0x4b6a86['length']+_0x476dc5['length'])+_0x5d9b7b(0x1ea));if(!_0x5387a7)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow']('Aborted.'),_0x5d9b7b(0x1df)),0x1;}const _0x1f2326=await withProgressSpinner(_0x5d9b7b(0x1cd),_0x194485=>executePush({'engage':_0x21eaf2[_0x5d9b7b(0x1af)]},_0x1ac2c7,{'progress':{'update':_0x49296f=>_0x194485['setPhase'](_0x49296f)}}),{'verbose':_0x4cb843['verbose']}),_0x170359=_0x1f2326[_0x5d9b7b(0x1b7)];for(const _0x4a9bcf of _0x170359['results']){if(_0x4a9bcf['templateId']&&(_0x4a9bcf['action']===_0x5d9b7b(0x1f0)||_0x4a9bcf[_0x5d9b7b(0x1d0)]===_0x5d9b7b(0x1b2))){const _0x1d1f9=getTemplateUrl(_0x4cb843['site'],_0x435a61,_0x4a9bcf['templateId']),_0x5cbbbb=_0x4a9bcf[_0x5d9b7b(0x1d0)]===_0x5d9b7b(0x1f0)?'+':'~',_0x4552ff=_0x4a9bcf[_0x5d9b7b(0x1d0)]===_0x5d9b7b(0x1f0)?a24_0x2a6e19[_0x5d9b7b(0x1e0)](_0x5cbbbb):a24_0x2a6e19[_0x5d9b7b(0x1d8)](_0x5cbbbb);console[_0x5d9b7b(0x1ca)]('\x20\x20'+_0x4552ff+'\x20'+hyperlink(_0x4a9bcf[_0x5d9b7b(0x1ec)],_0x1d1f9)+'\x20'+a24_0x2a6e19[_0x5d9b7b(0x1b3)](_0x1d1f9));}}_0x170359[_0x5d9b7b(0x1f0)]>0x0&&console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1e0)]('✔\x20Created\x20'+_0x170359[_0x5d9b7b(0x1f0)]+_0x5d9b7b(0x1bc)));_0x170359[_0x5d9b7b(0x1b2)]>0x0&&console['error'](a24_0x2a6e19[_0x5d9b7b(0x1e0)]('✔\x20Updated\x20'+_0x170359['updated']+_0x5d9b7b(0x1bc)));if(_0x170359[_0x5d9b7b(0x1ae)][_0x5d9b7b(0x1d3)]>0x0){console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)]('✘\x20'+_0x170359[_0x5d9b7b(0x1ae)]['length']+'\x20errors:'));for(const _0x541832 of _0x170359[_0x5d9b7b(0x1ae)]){console[_0x5d9b7b(0x1ca)]('\x20\x20'+a24_0x2a6e19['red'](_0x541832['name'])+':\x20'+_0x541832['error']);}}return saveSessionContext({'engage_workspace':_0x3fde1e},_0x4cb843[_0x5d9b7b(0x1d6)]),_0x170359[_0x5d9b7b(0x1ae)][_0x5d9b7b(0x1d3)]>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_0x4ee4a0=a25_0x11b5;(function(_0x17dd36,_0x25202c){const _0x35b7e8=a25_0x11b5,_0x37516f=_0x17dd36();while(!![]){try{const _0x429fb8=-parseInt(_0x35b7e8(0xd2))/0x1+parseInt(_0x35b7e8(0xda))/0x2+parseInt(_0x35b7e8(0xe2))/0x3+parseInt(_0x35b7e8(0xd5))/0x4*(parseInt(_0x35b7e8(0xc0))/0x5)+parseInt(_0x35b7e8(0xc3))/0x6*(-parseInt(_0x35b7e8(0xd9))/0x7)+-parseInt(_0x35b7e8(0xbd))/0x8*(-parseInt(_0x35b7e8(0xdf))/0x9)+-parseInt(_0x35b7e8(0xe0))/0xa;if(_0x429fb8===_0x25202c)break;else _0x37516f['push'](_0x37516f['shift']());}catch(_0x149fb4){_0x37516f['push'](_0x37516f['shift']());}}}(a25_0x4447,0xcb9b3));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0x11b5(_0x354aa7,_0x2e5f51){_0x354aa7=_0x354aa7-0xbb;const _0x4447b5=a25_0x4447();let _0x11b529=_0x4447b5[_0x354aa7];return _0x11b529;}import{existsSync}from'fs';import a25_0x38b626 from'chalk';import a25_0x5ba1a7 from'path';function a25_0x4447(){const _0x3601aa=['error','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20template(s)\x20with\x20errors,\x20','resolve','\x20error(s)','689413xrKcTz','log','length','2251484WGnHzN','endsWith','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','filter','1576687shDfIp','1968662HBNxKe','\x20non-template\x20file(s)\x20skipped','warningCount','\x20non-template\x20file(s)\x20skipped)','verbose','167130utmgri','5875840HSfRGt','valid','2255601iiPHqS','.yaml','template','red','execute','reason','errors','Validation\x20failed:\x20','\x20warning(s)','warnings','green','16yAdzUT','yellow','No\x20template\x20YAML\x20files\x20found\x20in\x20','5cqsGlU','skippedCount','engage:template:validate','6YWTPWR','validCount','description','Validate\x20template\x20YAML\x20files','\x20template(s)\x20valid','\x20warning(s)\x20found','\x20valid','dim','hasErrors','Error:\x20Directory\x20not\x20found:\x20'];a25_0x4447=function(){return _0x3601aa;};return a25_0x4447();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']=a25_0x4ee4a0(0xc2);[a25_0x4ee4a0(0xc5)]=a25_0x4ee4a0(0xc6);async[a25_0x4ee4a0(0xe6)](_0x37013a){const _0x6a67f=a25_0x4ee4a0,{options:_0x690c4f,args:_0x595c87}=_0x37013a,_0x4a0d66=_0x690c4f,_0x516c26=_0x595c87[0x0],_0x448252=_0x516c26?a25_0x5ba1a7[_0x6a67f(0xd0)](_0x516c26):undefined,_0x226146=_0x448252?isYamlFile(_0x448252):![];let _0x528684,_0x339b7d;if(_0x226146&&_0x448252)_0x528684=a25_0x5ba1a7['dirname'](_0x448252),_0x339b7d=_0x448252;else _0x448252?_0x528684=_0x448252:_0x528684=process['cwd']();if(!_0x339b7d&&!existsSync(_0x528684))return console['error'](a25_0x38b626['red'](_0x6a67f(0xcc)+_0x528684+'\x0a')),0x1;let _0x49c055;if(_0x339b7d){if(!_0x339b7d[_0x6a67f(0xd6)]('.yml')&&!_0x339b7d['endsWith'](_0x6a67f(0xe3)))return console[_0x6a67f(0xcd)](a25_0x38b626['red'](_0x6a67f(0xce)+_0x339b7d+'\x0a')),0x1;_0x49c055=[_0x339b7d];}else _0x49c055=findYamlFiles(_0x528684);if(_0x49c055[_0x6a67f(0xd4)]===0x0)return console['error'](a25_0x38b626[_0x6a67f(0xe5)](_0x6a67f(0xd7)+_0x528684+'\x0a')),0x1;const _0x197ea8=validateYamlFiles(_0x49c055,_0x528684,{'filterType':_0x6a67f(0xe4)}),_0x281e15=calculateSummary(_0x197ea8),_0x30bae1=_0x197ea8[_0x6a67f(0xd8)](isValidationResult);if(_0x30bae1[_0x6a67f(0xd4)]===0x0)return console[_0x6a67f(0xcd)](a25_0x38b626['yellow'](_0x6a67f(0xbf)+_0x528684+'\x0a')),_0x281e15[_0x6a67f(0xc1)]>0x0&&console[_0x6a67f(0xcd)](a25_0x38b626['dim']('('+_0x281e15[_0x6a67f(0xc1)]+_0x6a67f(0xdd))),0x0;for(const _0x1c1cd7 of _0x197ea8){if(!isValidationResult(_0x1c1cd7)){_0x4a0d66[_0x6a67f(0xde)]&&console[_0x6a67f(0xd3)](a25_0x38b626['dim']('-\x20'+_0x1c1cd7['relativePath']+'\x20(skipped:\x20'+_0x1c1cd7[_0x6a67f(0xe7)]+')'));continue;}const {relativePath:_0x11614b,source:_0x25b0ef,result:_0x513eba}=_0x1c1cd7;if(_0x513eba[_0x6a67f(0xe1)]&&_0x513eba[_0x6a67f(0xbb)][_0x6a67f(0xd4)]===0x0)_0x4a0d66[_0x6a67f(0xde)]&&console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xbc)]('✔\x20'+_0x11614b));else _0x513eba[_0x6a67f(0xe1)]?(console['log'](a25_0x38b626[_0x6a67f(0xbe)]('⚠\x20'+_0x11614b+':\x20'+_0x513eba['warnings']['length']+_0x6a67f(0xea))),console['log'](formatValidationResult(_0x513eba,_0x25b0ef,_0x11614b))):(console[_0x6a67f(0xd3)](a25_0x38b626['red']('✖\x20'+_0x11614b+':\x20'+_0x513eba[_0x6a67f(0xe8)][_0x6a67f(0xd4)]+_0x6a67f(0xd1))),console['log'](formatValidationResult(_0x513eba,_0x25b0ef,_0x11614b)));}return console[_0x6a67f(0xd3)](''),_0x281e15[_0x6a67f(0xcb)]?(console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xe5)](_0x6a67f(0xe9)+_0x281e15['invalidCount']+_0x6a67f(0xcf)+_0x281e15[_0x6a67f(0xc4)]+_0x6a67f(0xc9))),_0x281e15['warningCount']>0x0&&console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xbe)](_0x281e15[_0x6a67f(0xdc)]+'\x20warning(s)\x20found')),_0x281e15[_0x6a67f(0xc1)]>0x0&&console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xca)](_0x281e15[_0x6a67f(0xc1)]+_0x6a67f(0xdb))),0x1):(console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xbc)]('✔\x20All\x20'+_0x281e15['validCount']+_0x6a67f(0xc7))),_0x281e15[_0x6a67f(0xdc)]>0x0&&console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xbe)](_0x281e15['warningCount']+_0x6a67f(0xc8))),_0x281e15[_0x6a67f(0xc1)]>0x0&&console['log'](a25_0x38b626[_0x6a67f(0xca)](_0x281e15[_0x6a67f(0xc1)]+_0x6a67f(0xdb))),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_0x5c5c6f=a26_0x1c2e;(function(_0x12b101,_0x2327f4){const _0x123cc7=a26_0x1c2e,_0x826453=_0x12b101();while(!![]){try{const _0x8b78b0=-parseInt(_0x123cc7(0x1ed))/0x1+-parseInt(_0x123cc7(0x1d9))/0x2+-parseInt(_0x123cc7(0x1d0))/0x3+-parseInt(_0x123cc7(0x1ef))/0x4*(-parseInt(_0x123cc7(0x1e2))/0x5)+parseInt(_0x123cc7(0x20a))/0x6*(-parseInt(_0x123cc7(0x21f))/0x7)+parseInt(_0x123cc7(0x20f))/0x8+parseInt(_0x123cc7(0x1e7))/0x9;if(_0x8b78b0===_0x2327f4)break;else _0x826453['push'](_0x826453['shift']());}catch(_0x260e2b){_0x826453['push'](_0x826453['shift']());}}}(a26_0x264d,0xecbaa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a26_0x264d(){const _0x31d83f=['created_at','Getting\x20job\x20details...','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Getting\x20job\x20results...','show','11374452slkBLY','\x20row','abs','jobs','job:submit','5187560ATGeWD','Submitting\x20job...','limit','args','job:show','Show\x20job\x20details','verbose','end_at','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','red','h\x20ago','type','Cancelled','dim','list','validate','7yPwWTO','Database:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','success','error','✔\x20Job\x20submitted','url','5198496BzNMmQ','job_id','file','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','now','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','just\x20now','Query:\x20','status','3530642aVuPVC','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','map','Submit\x20a\x20job','query','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','d\x20ago','✔\x20Retrieved\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','391385rijDND','substring','floor','result','No\x20SQL\x20statements\x20found\x20in\x20file','40386933SOTYJl','\x20job','Status\x20filter:\x20','database','m\x20ago','trino','572716nQCuiZ','priority','92Jwkzgu','presto','data','log','\x20jobs','\x20\x20Job\x20ID:\x20','push','Kill\x20a\x20job','mo\x20ago','Listing\x20jobs...','name','start_at','Submitting\x20kill\x20request...','user_name','round','INVALID_ARGUMENT','description','execute','length','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','List\x20jobs','getTime'];a26_0x264d=function(){return _0x31d83f;};return a26_0x264d();}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';function a26_0x1c2e(_0x2270e8,_0x7a350c){_0x2270e8=_0x2270e8-0x1cb;const _0x264d47=a26_0x264d();let _0x1c2e81=_0x264d47[_0x2270e8];return _0x1c2e81;}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_0x38e5f7 from'chalk';function formatDuration(_0x17a112){const _0x327667=a26_0x1c2e;if(_0x17a112<0x3c)return _0x17a112+'s';if(_0x17a112<0xe10)return Math['floor'](_0x17a112/0x3c)+'m\x20'+_0x17a112%0x3c+'s';const _0x4287bb=Math[_0x327667(0x1e4)](_0x17a112/0xe10),_0x4af459=Math[_0x327667(0x1e4)](_0x17a112%0xe10/0x3c);return _0x4af459>0x0?_0x4287bb+'h\x20'+_0x4af459+'m':_0x4287bb+'h';}function formatRelativeTime(_0xdebd9d){const _0x5262df=a26_0x1c2e,_0x48d8b4=Date[_0x5262df(0x1d4)]()-_0xdebd9d[_0x5262df(0x204)](),_0x407afb=Math[_0x5262df(0x1e4)](Math[_0x5262df(0x20c)](_0x48d8b4)/0x3e8);if(_0x407afb<0x3c)return _0x5262df(0x1d6);const _0x311d06=Math[_0x5262df(0x1e4)](_0x407afb/0x3c);if(_0x311d06<0x3c)return _0x311d06+_0x5262df(0x1eb);const _0x599e51=Math[_0x5262df(0x1e4)](_0x311d06/0x3c);if(_0x599e51<0x18)return _0x599e51+_0x5262df(0x219);const _0x23f66f=Math[_0x5262df(0x1e4)](_0x599e51/0x18);if(_0x23f66f<0x1e)return _0x23f66f+_0x5262df(0x1df);return Math[_0x5262df(0x1e4)](_0x23f66f/0x1e)+_0x5262df(0x1f7);}export class JobListCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]='jobs';[a26_0x5c5c6f(0x1ff)]=a26_0x5c5c6f(0x203);async['execute'](_0x200190){const _0x495ac7=a26_0x5c5c6f,{options:_0x459fdd,tdx:_0x31129f}=_0x200190,_0x1425a8=resolveLimit(_0x459fdd[_0x495ac7(0x211)],DEFAULT_DISPLAY_LIMIT),_0x41b436=_0x459fdd['status'];_0x459fdd[_0x495ac7(0x215)]&&(console[_0x495ac7(0x1cd)]('Limit:\x20'+_0x1425a8+_0x495ac7(0x1f3)),_0x41b436&&console[_0x495ac7(0x1cd)](_0x495ac7(0x1e9)+_0x41b436));const _0x5c8f2b=await withSpinner(_0x495ac7(0x1f8),()=>_0x31129f[_0x495ac7(0x20d)][_0x495ac7(0x21d)]({'from':0x0,'to':_0x1425a8-0x1,'status':_0x41b436}),{'verbose':_0x459fdd[_0x495ac7(0x215)]}),_0x5a7d79=_0x5c8f2b['data'];console[_0x495ac7(0x1cd)]('✔\x20Found\x20'+_0x5a7d79[_0x495ac7(0x201)]+_0x495ac7(0x1e8)+(_0x5a7d79[_0x495ac7(0x201)]!==0x1?'s':''));const _0x15003b=_0x459fdd['site'];if(isStructuredFormat(_0x459fdd)){const _0x5cd8ca=_0x5a7d79[_0x495ac7(0x1db)](_0xa54de=>{const _0x21f158=_0x495ac7;let _0x3084b7;if(_0xa54de[_0x21f158(0x1fa)]&&_0xa54de[_0x21f158(0x216)]){const _0x36f586=new Date(_0xa54de['start_at'])[_0x21f158(0x204)](),_0xdb139d=new Date(_0xa54de[_0x21f158(0x216)])[_0x21f158(0x204)]();_0x3084b7=Math[_0x21f158(0x1fd)]((_0xdb139d-_0x36f586)/0x3e8);}return{'job_id':_0xa54de[_0x21f158(0x1d1)],'type':_0xa54de[_0x21f158(0x21a)]===_0x21f158(0x1f0)?_0x21f158(0x1ec):_0xa54de[_0x21f158(0x21a)],'status':_0xa54de['status'],'user_name':_0xa54de[_0x21f158(0x1fc)],'duration_sec':_0x3084b7,'created_at':_0xa54de[_0x21f158(0x205)],'started_at':_0xa54de[_0x21f158(0x1fa)],'end_at':_0xa54de[_0x21f158(0x216)]};});await handleSDKOutput(_0x5cd8ca,_0x459fdd);}else for(const _0xe78b0e of _0x5a7d79){const _0x1dd4b7=_0xe78b0e['status']===_0x495ac7(0x1cc)?a26_0x38e5f7['green']:_0xe78b0e[_0x495ac7(0x1d8)]==='error'?a26_0x38e5f7[_0x495ac7(0x218)]:a26_0x38e5f7['dim'],_0x17ee94=_0x1dd4b7(_0xe78b0e[_0x495ac7(0x1d8)]),_0x130b09=getJobUrl(_0x15003b,_0xe78b0e['job_id']),_0x14cb6f=hyperlink(_0xe78b0e[_0x495ac7(0x1d1)],_0x130b09),_0x278c7d=a26_0x38e5f7['dim'](_0xe78b0e[_0x495ac7(0x21a)]==='presto'?_0x495ac7(0x1ec):_0xe78b0e['type']),_0x23fedd=[];if(_0xe78b0e['start_at']&&_0xe78b0e[_0x495ac7(0x216)]){const _0x2b98f1=Math[_0x495ac7(0x1fd)]((new Date(_0xe78b0e['end_at'])[_0x495ac7(0x204)]()-new Date(_0xe78b0e[_0x495ac7(0x1fa)])[_0x495ac7(0x204)]())/0x3e8);_0x23fedd['push'](formatDuration(_0x2b98f1));}if(_0xe78b0e[_0x495ac7(0x216)])_0x23fedd[_0x495ac7(0x1f5)](formatRelativeTime(new Date(_0xe78b0e[_0x495ac7(0x216)])));else _0xe78b0e[_0x495ac7(0x1fa)]&&_0x23fedd[_0x495ac7(0x1f5)](formatRelativeTime(new Date(_0xe78b0e[_0x495ac7(0x1fa)])));const _0x60223e=_0x23fedd[_0x495ac7(0x201)]>0x0?a26_0x38e5f7[_0x495ac7(0x21c)]('\x20'+_0x23fedd['join'](',\x20')):'';console[_0x495ac7(0x1f2)]('⚡\x20'+_0x14cb6f+'\x20'+_0x278c7d+'\x20'+_0x17ee94+_0x60223e);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]=a26_0x5c5c6f(0x213);['description']=a26_0x5c5c6f(0x214);[a26_0x5c5c6f(0x21e)](_0x4d71f8){const _0x5b38c7=a26_0x5c5c6f,_0x21e143=_0x4d71f8[_0x5b38c7(0x212)][0x0];if(!_0x21e143)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x5c5c6f(0x200)](_0x11dcb3){const _0x5cef74=a26_0x5c5c6f,{options:_0x4f88e6,args:_0x1aee4e,tdx:_0x495996}=_0x11dcb3,_0x421290=_0x1aee4e[0x0],_0x3d8ed7=await withSpinner(_0x5cef74(0x206),()=>_0x495996['jobs'][_0x5cef74(0x209)](_0x421290),{'verbose':_0x4f88e6[_0x5cef74(0x215)]}),_0x2b105f=_0x3d8ed7[_0x5cef74(0x1f1)];let _0x5bda2d;if(_0x2b105f[_0x5cef74(0x1fa)]&&_0x2b105f[_0x5cef74(0x216)]){const _0x114b3a=new Date(_0x2b105f[_0x5cef74(0x1fa)])['getTime'](),_0x41a770=new Date(_0x2b105f[_0x5cef74(0x216)])[_0x5cef74(0x204)]();_0x5bda2d=Math[_0x5cef74(0x1fd)]((_0x41a770-_0x114b3a)/0x3e8);}const _0x533f2b={'job_id':_0x2b105f[_0x5cef74(0x1d1)],'type':_0x2b105f['type'],'status':_0x2b105f[_0x5cef74(0x1d8)],..._0x2b105f['user_name']&&{'user_name':_0x2b105f[_0x5cef74(0x1fc)]},..._0x5bda2d!==undefined&&{'duration_sec':_0x5bda2d},..._0x2b105f['created_at']&&{'created_at':_0x2b105f['created_at']},..._0x2b105f[_0x5cef74(0x1fa)]&&{'started_at':_0x2b105f[_0x5cef74(0x1fa)]},..._0x2b105f[_0x5cef74(0x216)]&&{'end_at':_0x2b105f[_0x5cef74(0x216)]},..._0x2b105f[_0x5cef74(0x1ea)]&&{'database':_0x2b105f['database']},..._0x2b105f['priority']!==undefined&&{'priority':_0x2b105f[_0x5cef74(0x1ee)]},..._0x2b105f[_0x5cef74(0x1cf)]&&{'url':_0x2b105f[_0x5cef74(0x1cf)]},..._0x2b105f[_0x5cef74(0x1dd)]&&{'query':_0x2b105f[_0x5cef74(0x1dd)]},..._0x2b105f['debug']&&{'debug':_0x2b105f['debug']}};return await handleSingleObjectOutput(_0x533f2b,_0x4f88e6),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]='job:kill';[a26_0x5c5c6f(0x1ff)]=a26_0x5c5c6f(0x1f6);[a26_0x5c5c6f(0x21e)](_0x252081){const _0x39d2ef=a26_0x5c5c6f,_0x1b2375=_0x252081[_0x39d2ef(0x212)][0x0];if(!_0x1b2375)return _0x39d2ef(0x1e1);return undefined;}async['execute'](_0x53371b){const _0x439f56=a26_0x5c5c6f,{options:_0x44d1e1,args:_0x333a20,tdx:_0x43d060}=_0x53371b,_0x30486f=_0x333a20[0x0];if(!_0x44d1e1['yes']){const _0x2ce7cf=await confirm(_0x439f56(0x1d5)+_0x30486f+'?');if(!_0x2ce7cf)return console[_0x439f56(0x1cd)](_0x439f56(0x21b)),0x0;}return await withSpinner(_0x439f56(0x1fb),()=>_0x43d060['jobs']['kill'](_0x30486f),{'verbose':_0x44d1e1[_0x439f56(0x215)]}),console[_0x439f56(0x1cd)](_0x439f56(0x202)+_0x30486f),console[_0x439f56(0x1cd)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x30486f+_0x439f56(0x1cb)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]=a26_0x5c5c6f(0x20e);[a26_0x5c5c6f(0x1ff)]=a26_0x5c5c6f(0x1dc);async[a26_0x5c5c6f(0x200)](_0x1a447a){const _0xa89e1a=a26_0x5c5c6f,{options:_0x5ba98f,args:_0x106407,tdx:_0x5b94aa}=_0x1a447a,_0x24c89b=_0x5ba98f['jobType']||'trino',_0x48c130=_0x5ba98f[_0xa89e1a(0x1d2)],_0x5a4d4b=_0x5ba98f[_0xa89e1a(0x1ea)]||'information_schema',_0x59b144=_0x5ba98f[_0xa89e1a(0x1e5)];if(_0x24c89b!==_0xa89e1a(0x1ec)&&_0x24c89b!=='hive')throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x217));let _0xb5e2;if(_0x48c130){if(_0x106407[0x0])throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x1de));const _0x58a707=readSqlStatementsFromFile(_0x48c130);if(_0x58a707[_0xa89e1a(0x201)]===0x0)throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x1e6));if(_0x58a707[_0xa89e1a(0x201)]>0x1)throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x207));_0xb5e2=_0x58a707[0x0];}else{if(!_0x106407[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xa89e1a(0x1da));_0xb5e2=_0x106407[0x0];}_0x5ba98f[_0xa89e1a(0x215)]&&(console[_0xa89e1a(0x1cd)]('Job\x20type:\x20'+_0x24c89b),console[_0xa89e1a(0x1cd)](_0xa89e1a(0x220)+_0x5a4d4b),console[_0xa89e1a(0x1cd)](_0xa89e1a(0x1d7)+_0xb5e2[_0xa89e1a(0x1e3)](0x0,0x64)+(_0xb5e2[_0xa89e1a(0x201)]>0x64?'...':'')));const _0x2ebcc8=await withSpinner(_0xa89e1a(0x210),()=>_0x5b94aa[_0xa89e1a(0x20d)]['submit'](_0x5a4d4b,_0xb5e2,_0x24c89b,_0x59b144),{'verbose':_0x5ba98f[_0xa89e1a(0x215)]}),_0x2def73=_0x2ebcc8[_0xa89e1a(0x1f1)];return console['error'](_0xa89e1a(0x1ce)),console[_0xa89e1a(0x1cd)](_0xa89e1a(0x1f4)+_0x2def73[_0xa89e1a(0x1d1)]),await handleSDKOutput([_0x2def73],_0x5ba98f),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]='job:result';['description']='Get\x20job\x20results';[a26_0x5c5c6f(0x21e)](_0x19c577){const _0x46bd59=a26_0x5c5c6f,_0x34f444=_0x19c577[_0x46bd59(0x212)][0x0];if(!_0x34f444)return _0x46bd59(0x1d3);return undefined;}async['execute'](_0x1ced31){const _0x1fab5b=a26_0x5c5c6f,{options:_0xce332,args:_0x4f04f7,tdx:_0x44a963}=_0x1ced31,_0x542ce3=_0x4f04f7[0x0],_0xe76915=await withSpinner(_0x1fab5b(0x208),()=>_0x44a963[_0x1fab5b(0x20d)]['result'](_0x542ce3),{'verbose':_0xce332[_0x1fab5b(0x215)]}),_0x822eeb=_0xe76915[_0x1fab5b(0x1f1)];return console['error'](_0x1fab5b(0x1e0)+_0x822eeb['length']+_0x1fab5b(0x20b)+(_0x822eeb[_0x1fab5b(0x201)]!==0x1?'s':'')),await handleSDKOutput(_0x822eeb,_0xce332),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_0x5627fc=a27_0x43a0;(function(_0x52149c,_0x1b2ebc){const _0x3f357a=a27_0x43a0,_0x127300=_0x52149c();while(!![]){try{const _0x54f7e2=-parseInt(_0x3f357a(0xcd))/0x1*(parseInt(_0x3f357a(0x106))/0x2)+-parseInt(_0x3f357a(0x145))/0x3*(-parseInt(_0x3f357a(0x162))/0x4)+parseInt(_0x3f357a(0xd2))/0x5+parseInt(_0x3f357a(0x17b))/0x6+-parseInt(_0x3f357a(0x197))/0x7+-parseInt(_0x3f357a(0x13e))/0x8*(-parseInt(_0x3f357a(0x125))/0x9)+-parseInt(_0x3f357a(0xab))/0xa;if(_0x54f7e2===_0x1b2ebc)break;else _0x127300['push'](_0x127300['shift']());}catch(_0x567bbd){_0x127300['push'](_0x127300['shift']());}}}(a27_0xdeb3,0x9dab4));import a27_0x442aed from'chalk';import a27_0x26af62 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a27_0x43a0(_0x7338de,_0xae8de8){_0x7338de=_0x7338de-0x94;const _0xdeb320=a27_0xdeb3();let _0x43a0e1=_0xdeb320[_0x7338de];return _0x43a0e1;}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x5d51a9){const _0x2992e8=a27_0x43a0;return!_0x5d51a9&&(console[_0x2992e8(0x14e)](_0x2992e8(0x9a)),console[_0x2992e8(0x14e)](_0x2992e8(0xae))),!!_0x5d51a9;}function withJsonFormat(_0x1d2726){const _0x3cfe25=a27_0x43a0;if(!_0x1d2726[_0x3cfe25(0xc3)]&&!_0x1d2726['json']&&!_0x1d2726[_0x3cfe25(0x140)]&&!_0x1d2726[_0x3cfe25(0x151)])return{..._0x1d2726,'format':_0x3cfe25(0x164),'json':!![]};return _0x1d2726;}function formatJourneyState(_0x2bd2c6){const _0x2a7b24=a27_0x43a0;switch(_0x2bd2c6){case _0x2a7b24(0xf1):return a27_0x442aed[_0x2a7b24(0x175)](_0x2a7b24(0x160));case _0x2a7b24(0x154):return a27_0x442aed[_0x2a7b24(0xbd)]('(draft)');case _0x2a7b24(0x156):return a27_0x442aed[_0x2a7b24(0x144)](_0x2a7b24(0x174));case _0x2a7b24(0xb8):return a27_0x442aed[_0x2a7b24(0x19e)](_0x2a7b24(0xcf));case _0x2a7b24(0xd4):return a27_0x442aed[_0x2a7b24(0xbd)]('(archived)');default:return'('+_0x2bd2c6+')';}}function a27_0xdeb3(){const _0x529f93=['exitOrJumpSize','format','state','Show\x20journey\x20statistics','Error:\x20--version\x20option\x20is\x20required','journey:version:view','nodes','\x0aError:','get','push','file','9XBsPRV',',\x20version:\x20','(completed)','📁\x20','description','4420315QBudAh','milestoneSize','archived','has','links','Cancelled','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','createdAt','Listing\x20journeys...','values','Parent\x20segment:\x20','Options:','base','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','getLatestJourneyId','journeys','Fetching\x20','🗺️\x20','/j/da','rule','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','/app/ps/','filePath','listActivationsFlat','setPhase','session','Resolving\x20parent\x20segment...','segment','red','audienceId','enteredSize','launched','cyan','Getting\x20journey\x20details...','helpText','Folder\x20path:\x20','test','journey','Show\x20journey\x20details','find','Available\x20stages:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','user','✔\x20All\x20files\x20are\x20up\x20to\x20date','reentryMode','journeyBundleName','journeyBundleId','limit','listJourneysWithFolders','absolutePath','Resolved\x20YAML\x20file:\x20','Resolving\x20version...','91106aRucGl','targetDir','Show\x20journey\x20table\x20column\x20mapping','no_parent','journeyName','data','activation','\x20journey','/j/da/je','\x20(draft)\x20—\x20\x22','relative','journey:list','Table:\x20','\x5c$&','getSegment','length','log','Error:\x20Parent\x20segment\x20context\x20required','sort','\x20journeys','execute','getTrafficData','localeCompare','\x20files?','Error:\x20Invalid\x20--type\x20\x22','getStatistics','Fetching\x20journeys\x20and\x20folders...','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Listing\x20journey\x20activations...','Export\x20journey(s)\x20as\x20YAML\x20files','3852KKSQZn','stage','parentName','version','journey:stats','segmentName','Journey\x20name:\x20','List\x20activations\x20for\x20a\x20journey','\x20versions)','\x20\x20-\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','\x22\x20not\x20found','journey:pause','then','List\x20all\x20versions\x20of\x20a\x20journey','verbose','parent_segment','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','List\x20journeys\x20in\x20current\x20context','table','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)','relativePath','content','journeyId','hasChanges','20168zyDjtW','getColumnMapping','jsonl','...','type','root\x20folder','yellow','3qgjNqk','toLowerCase','Pattern:\x20','includeStats','map','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','entries','Found\x20','listVersions','error','bold','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','tsv','\x20\x20Consolidating\x20duplicate\x20segment:\x20','all','draft','resume','paused','errorCode','Pause\x20a\x20running\x20journey','\x20changed\x20files','attributes','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','utf-8','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','folderId','resolveParentId','(running)','journey:traffic','3557188QlyPMu','completionRate','json','Error:\x20Invalid\x20version\x20number:\x20','stringify','rootFolderId','Target\x20directory:\x20','journey:pull','listFolders','.yml','\x0aPull\x20summary:','\x20Opening\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','message','diff','\x20\x20Parent\x20segment:\x20','getParentFull','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','(paused)','green','✔\x20Context\x20set:\x20','buildIdToNameMap','yes','goal','name','2301792nVStaY','segments','Aborted.','\x22\x20paused','split','journey:push','Listing\x20journey\x20versions...','\x20not\x20found.\x20Available:\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journey:version:create','\x20version','\x20\x20Name:\x20','exitOrJumpRate','goalSize','View\x20a\x20specific\x20version\x20of\x20a\x20journey','/e/','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','replace','history','stages','join','\x20Created\x20v','Error:\x20Journey\x20not\x20found:\x20','isNew','activationParams','from','Fetching\x20users\x20and\x20connections...','201677Nrtlcu','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Creating\x20new\x20version...','resolveJourneyId','size','site','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','blue','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Input:\x20','connector_config','parentSegment','add','Target\x20file:\x20','set','getJourney','✔\x20Found\x20','updatedAt','listJourneysFromParentSegment','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20','filter','Getting\x20column\x20mapping...','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','journey:columns','resolveSegment','journeyStages','includeHistory','\x20new\x20files','Resolving\x20journey...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Write\x20','\x20details...','\x20\x20Target:\x20','versionNumber','folderPath','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20\x20Statistics\x20not\x20available','21513800XhjlsL','conversion','cwd','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','journey:resume','-\x20no\x20files\x20written','connection','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20=\x20','\x20\x20Journey\x20ID:\x20','hasPeriod','Getting\x20journey\x20statistics...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','completed','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','repeat','stageNameMap','resourceName','dim','✔\x20Journey\x20\x22','INVALID_ARGUMENT','tdx.json','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'];a27_0xdeb3=function(){return _0x529f93;};return a27_0xdeb3();}function formatJourneyItem(_0x32173e,_0x24500f='',_0x442257){const _0xe964d8=a27_0x43a0,_0x4895a1=formatJourneyState(_0x32173e[_0xe964d8(0xc4)]),_0x15121d=_0x442257?hyperlink(_0x32173e[_0xe964d8(0xff)],_0x442257):_0x32173e[_0xe964d8(0xff)];return _0x24500f+_0xe964d8(0xe3)+_0x15121d+'\x20'+_0x4895a1;}function escapeRegex(_0x27871c){const _0x2fc561=a27_0x43a0;return _0x27871c[_0x2fc561(0x18d)](/[.*+?^${}()|[\]\\]/g,_0x2fc561(0x113));}function globToRegex(_0x46924d){const _0x3935cd=a27_0x43a0,_0x2af9b5=_0x46924d[_0x3935cd(0x17f)]('*')[_0x3935cd(0x149)](escapeRegex);return new RegExp(_0x2af9b5[_0x3935cd(0x190)]('.*'),'i');}function buildRuleToNameMapping(_0x2d8f97){const _0x5c4dde=a27_0x43a0,_0x352b23=new Map();if(_0x2d8f97[_0x5c4dde(0x17c)])for(const [_0x3eccf3,_0x875692]of Object[_0x5c4dde(0x14b)](_0x2d8f97[_0x5c4dde(0x17c)])){if(_0x875692['rule']){const _0x481e15=serializeRule(_0x875692[_0x5c4dde(0xe5)]),_0x41e7c7=_0x352b23['get'](_0x481e15);_0x41e7c7?_0x41e7c7[_0x5c4dde(0xcb)](_0x3eccf3):_0x352b23[_0x5c4dde(0x1a5)](_0x481e15,[_0x3eccf3]);}}return _0x352b23;}async function resolveJourneyIdFromInput(_0x3f7f83,_0x3d738c,_0xdfd4fc){const _0x1bb6c5=a27_0x43a0,_0x3fde9f=await resolveJourneyTarget(_0x3f7f83,_0x3d738c['parentSegment'],_0x3d738c[_0x1bb6c5(0x134)]),_0x3aba88=_0x3fde9f[_0x1bb6c5(0x1a2)];if(!_0x3aba88)throw new SDKError(ErrorCode[_0x1bb6c5(0xbf)],_0x1bb6c5(0xa2));const _0x1fa23f=await withSpinner(_0x1bb6c5(0xec),()=>_0xdfd4fc['segment'][_0x1bb6c5(0x15f)](_0x3aba88),{'verbose':_0x3d738c[_0x1bb6c5(0x134)]}),_0x31da95=_0x1fa23f[_0x1bb6c5(0x10b)],_0xb05354=await withSpinner(_0x1bb6c5(0xa1),()=>_0xdfd4fc[_0x1bb6c5(0xf7)][_0x1bb6c5(0x19a)](_0x31da95,_0x3fde9f[_0x1bb6c5(0x10a)]),{'verbose':_0x3d738c[_0x1bb6c5(0x134)]});return{'journeyId':_0xb05354[_0x1bb6c5(0x10b)],'journeyName':_0x3fde9f[_0x1bb6c5(0x10a)],'parentSegmentId':_0x31da95};}async function resolveJourneyTarget(_0xed1084,_0x2d63b9,_0x37cffc){const _0x519f16=a27_0x43a0;if(isYamlFilePath(_0xed1084))try{const _0x2e68b4=await resolveYamlFilePath(_0xed1084);return _0x37cffc&&(console[_0x519f16(0x14e)](_0x519f16(0x104)+_0xed1084),console['error'](_0x519f16(0x171)+_0x2e68b4[_0x519f16(0x1a2)]),console['error'](_0x519f16(0x186)+_0x2e68b4[_0x519f16(0x12a)]),console[_0x519f16(0x14e)]('\x20\x20Folder\x20path:\x20'+(_0x2e68b4[_0x519f16(0xa8)]||'(root)'))),{'journeyName':_0x2e68b4[_0x519f16(0x12a)],'parentSegment':_0x2e68b4[_0x519f16(0x1a2)],'resolved':_0x2e68b4};}catch(_0x2e10ca){throw new SDKError(ErrorCode[_0x519f16(0xbf)],_0x519f16(0xc1)+_0x2e10ca[_0x519f16(0x16f)]);}if(!_0x2d63b9)throw new SDKError(ErrorCode[_0x519f16(0xbf)],_0x519f16(0x96));return{'journeyName':_0xed1084,'parentSegment':_0x2d63b9};}export class JourneyListCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x111);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x137);async['execute'](_0x1a87cd){const _0x23e7f9=a27_0x5627fc,{options:_0x23c1be,args:_0x4228a4,tdx:_0x27e7a5}=_0x1a87cd,_0x4a764c=_0x4228a4[0x0],_0x284307=_0x23c1be['parentSegment'];if(!_0x284307)return console[_0x23e7f9(0x14e)](_0x23e7f9(0x117)),console[_0x23e7f9(0x14e)](_0x23e7f9(0xb7)),0x1;const _0x2f63cd=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x27e7a5[_0x23e7f9(0xed)][_0x23e7f9(0x15f)](_0x284307),{'verbose':_0x23c1be[_0x23e7f9(0x134)]}),_0x9db5ca=_0x2f63cd[_0x23e7f9(0x10b)];_0x23c1be[_0x23e7f9(0x134)]&&(console[_0x23e7f9(0x14e)](_0x23e7f9(0xdc)+_0x284307+'\x20(ID:\x20'+_0x9db5ca+')'),_0x4a764c&&console[_0x23e7f9(0x14e)](_0x23e7f9(0x147)+_0x4a764c));const _0x366b46=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x27e7a5[_0x23e7f9(0xed)][_0x23e7f9(0x172)](_0x9db5ca),{'verbose':_0x23c1be[_0x23e7f9(0x134)]}),_0x4e2dc3=_0x366b46['data'],_0x1ce778=_0x4e2dc3[_0x23e7f9(0x167)],_0x3eb3d3=await withSpinner(_0x23e7f9(0xda),()=>_0x27e7a5[_0x23e7f9(0xf7)][_0x23e7f9(0x102)](_0x9db5ca,_0x1ce778),{'verbose':_0x23c1be[_0x23e7f9(0x134)]});let _0x375a99=_0x3eb3d3['data'][_0x23e7f9(0xe1)];const _0x4e12be=_0x3eb3d3['data']['folders'],_0x4b755c=new Map();for(const _0x1c0365 of _0x4e12be){_0x4b755c[_0x23e7f9(0x1a5)](_0x1c0365['id'],_0x1c0365[_0x23e7f9(0x17a)]);}if(_0x4a764c){const _0x29f5c7=globToRegex(_0x4a764c);_0x375a99=_0x375a99[_0x23e7f9(0x98)](_0x269606=>_0x29f5c7[_0x23e7f9(0xf6)](_0x269606[_0x23e7f9(0xff)]));}console['error'](_0x23e7f9(0x1a7)+_0x375a99['length']+_0x23e7f9(0x10d)+(_0x375a99[_0x23e7f9(0x115)]!==0x1?'s':''));const _0x383aa7=_0x37b9e7=>{const _0x3339ac=_0x23e7f9;return getConsoleNextUrl(_0x23c1be[_0x3339ac(0x19c)],_0x3339ac(0xe7)+_0x9db5ca+_0x3339ac(0x18a)+_0x37b9e7+_0x3339ac(0xe4));};if(_0x23c1be['format']===_0x23e7f9(0x138))await handleSDKOutput(_0x375a99,_0x23c1be);else{if(_0x23c1be['format']===_0x23e7f9(0x164)){const _0x553334=_0x375a99[_0x23e7f9(0x149)](_0x3ec652=>({..._0x3ec652,'url':_0x383aa7(_0x3ec652['id'])}));await handleSDKOutput(_0x553334,_0x23c1be);}else{console[_0x23e7f9(0x116)]('['+_0x284307+']');const _0x5f5afa=new Map(),_0x2b47b0=[];for(const _0x5ad893 of _0x375a99){if(!_0x5ad893[_0x23e7f9(0x15e)]||_0x5ad893[_0x23e7f9(0x15e)]===_0x1ce778)_0x2b47b0[_0x23e7f9(0xcb)](_0x5ad893);else{const _0x535a54=_0x5f5afa[_0x23e7f9(0xca)](_0x5ad893[_0x23e7f9(0x15e)])||[];_0x535a54[_0x23e7f9(0xcb)](_0x5ad893),_0x5f5afa['set'](_0x5ad893['folderId'],_0x535a54);}}const _0x293c11=(_0x2335de,_0x481b2a)=>_0x2335de[_0x23e7f9(0xff)][_0x23e7f9(0x11c)](_0x481b2a[_0x23e7f9(0xff)],undefined,{'sensitivity':_0x23e7f9(0xde)});_0x2b47b0['sort'](_0x293c11);for(const _0x5224d2 of _0x2b47b0){console[_0x23e7f9(0x116)](formatJourneyItem(_0x5224d2,'',_0x383aa7(_0x5224d2['id'])));}const _0x362a4d=[..._0x5f5afa['entries']()]['sort']((_0x5a6135,_0xd8b3f7)=>{const _0x7f2f73=_0x23e7f9,_0x344519=_0x4b755c[_0x7f2f73(0xca)](_0x5a6135[0x0])||_0x5a6135[0x0],_0x47df8c=_0x4b755c['get'](_0xd8b3f7[0x0])||_0xd8b3f7[0x0];return _0x344519[_0x7f2f73(0x11c)](_0x47df8c,undefined,{'sensitivity':'base'});});for(const [_0x7e27f6,_0x58907d]of _0x362a4d){const _0x15e535=_0x4b755c[_0x23e7f9(0xca)](_0x7e27f6)||_0x7e27f6;console['log'](_0x23e7f9(0xd0)+_0x15e535),_0x58907d[_0x23e7f9(0x118)](_0x293c11);for(const _0x2cb356 of _0x58907d){console[_0x23e7f9(0x116)](formatJourneyItem(_0x2cb356,'\x20\x20',_0x383aa7(_0x2cb356['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x5627fc(0x17a)]='journey:view';[a27_0x5627fc(0xd1)]=a27_0x5627fc(0xf8);async[a27_0x5627fc(0x11a)](_0x40362a){const _0x5b5ba0=a27_0x5627fc,{options:_0x54a855,args:_0x57388d,tdx:_0x5c14d4}=_0x40362a,_0x5b6dc2=_0x57388d[0x0];if(!_0x5b6dc2)return console[_0x5b5ba0(0x14e)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5b5ba0(0x14e)](_0x5b5ba0(0x136)),console['error'](_0x5b5ba0(0xdd)),console[_0x5b5ba0(0x14e)](_0x5b5ba0(0x173)),0x1;_0x54a855[_0x5b5ba0(0x134)]&&console['error'](_0x5b5ba0(0x1a0)+_0x5b6dc2);const {journeyId:_0x153d8f,parentSegmentId:_0x1dd807}=await resolveJourneyIdFromInput(_0x5b6dc2,_0x54a855,_0x5c14d4);if(_0x54a855['web']){const _0x3ad213=getConsoleNextUrl(_0x54a855[_0x5b5ba0(0x19c)],_0x5b5ba0(0xe7)+_0x1dd807+_0x5b5ba0(0x18a)+_0x153d8f+'/j/da/je');return console[_0x5b5ba0(0x14e)](a27_0x442aed[_0x5b5ba0(0x175)]('✔')+_0x5b5ba0(0x16d)+a27_0x442aed[_0x5b5ba0(0xf2)](_0x3ad213)),openBrowser(_0x3ad213),0x0;}const _0x39362a=await withSpinner(_0x5b5ba0(0xf3),()=>_0x5c14d4['journey']['getJourney'](_0x153d8f),{'verbose':_0x54a855[_0x5b5ba0(0x134)]}),_0x16a52c=_0x39362a[_0x5b5ba0(0x10b)],_0x2d2937=_0x54a855[_0x5b5ba0(0x148)];let _0x164bef;if(_0x2d2937)try{const _0x294313=await withSpinner(_0x5b5ba0(0xb6),()=>_0x5c14d4['journey'][_0x5b5ba0(0x11f)](_0x153d8f),{'verbose':_0x54a855[_0x5b5ba0(0x134)]});_0x164bef=_0x294313[_0x5b5ba0(0x10b)];}catch{_0x54a855[_0x5b5ba0(0x134)]&&console[_0x5b5ba0(0x14e)](_0x5b5ba0(0xaa));}const _0x57d3d7=getConsoleNextUrl(_0x54a855[_0x5b5ba0(0x19c)],'/app/ps/'+_0x1dd807+_0x5b5ba0(0x18a)+_0x153d8f+_0x5b5ba0(0x10e)),_0x41ebb8={'id':_0x16a52c['id'],'name':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0x17a)],'description':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0xd1)],'state':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0xc4)],'paused':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0x156)],'reentry_mode':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0xfe)],'stages':_0x16a52c[_0x5b5ba0(0x15a)]['journeyStages']?.[_0x5b5ba0(0x115)]||0x0,..._0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0x179)]&&{'goal':_0x16a52c[_0x5b5ba0(0x15a)]['goal']['name']},..._0x164bef&&{'statistics':{'size':_0x164bef[_0x5b5ba0(0x19b)],'entered':_0x164bef[_0x5b5ba0(0xf0)],'goal_achieved':_0x164bef[_0x5b5ba0(0x188)],'completion_rate':_0x164bef[_0x5b5ba0(0x163)],'exit_or_jump':_0x164bef[_0x5b5ba0(0xc2)],'exit_or_jump_rate':_0x164bef[_0x5b5ba0(0x187)],'stages':_0x164bef['stages']}},'url':_0x57d3d7};return await handleSingleObjectOutput(_0x41ebb8,_0x54a855),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x129);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0xc5);async['execute'](_0x4a4159){const _0x373a1c=a27_0x5627fc,{options:_0x389b2a,args:_0x4df103,tdx:_0x5da45b}=_0x4a4159,_0x17cb7f=_0x4df103[0x0];if(!requireNameOrPath(_0x17cb7f))return 0x1;_0x389b2a[_0x373a1c(0x134)]&&console[_0x373a1c(0x14e)](_0x373a1c(0x1a0)+_0x17cb7f);const _0x2b44f6=_0x389b2a,_0x2a10d7=_0x2b44f6[_0x373a1c(0x195)],_0x18e93c=_0x2b44f6['to'],_0x4b7b52=_0x2b44f6[_0x373a1c(0x9f)],_0x498b41=_0x2b44f6[_0x373a1c(0x126)];_0x4b7b52&&!_0x2a10d7&&!_0x18e93c&&console['error'](_0x373a1c(0x121));const _0x4baa8f=_0x4b7b52?withJsonFormat(_0x389b2a):_0x389b2a,{journeyId:_0x3d9782,journeyName:_0x121c20}=await resolveJourneyIdFromInput(_0x17cb7f,_0x4baa8f,_0x5da45b),_0x5ca777=_0x2a10d7||_0x18e93c?{'from':_0x2a10d7,'to':_0x18e93c}:undefined,_0x48ee78=await withSpinner(_0x373a1c(0xb6),()=>Promise[_0x373a1c(0x153)]([_0x5da45b[_0x373a1c(0xf7)][_0x373a1c(0x1a6)](_0x3d9782),_0x5da45b[_0x373a1c(0xf7)][_0x373a1c(0x11f)](_0x3d9782,_0x5ca777)]),{'verbose':_0x4baa8f['verbose']}),[_0x130b78,_0x1da74b]=_0x48ee78[_0x373a1c(0x10b)];if(!_0x1da74b||_0x1da74b[_0x373a1c(0x13c)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x121c20),console[_0x373a1c(0x14e)](_0x373a1c(0xdf)),0x0;const _0x18b72b=buildStageNameMap(_0x130b78),_0x5a1094=!!(_0x5ca777&&_0x1da74b[_0x373a1c(0x18e)]?.['length']),_0x37dbaa={'stageNameMap':_0x18b72b,'hasPeriod':_0x5a1094,'includeHistory':!!_0x4b7b52};if(_0x498b41&&_0x1da74b[_0x373a1c(0x18f)]){const _0x10044f=_0x1da74b[_0x373a1c(0x18f)][_0x373a1c(0xf9)](_0x19276e=>{const _0x2ecdc3=_0x373a1c,_0x23bfab=_0x18b72b['get'](_0x19276e['id'])??'';return _0x23bfab[_0x2ecdc3(0x146)]()===_0x498b41[_0x2ecdc3(0x146)]();});if(_0x10044f)return await handleSingleObjectOutput(formatStageStats(_0x10044f,_0x37dbaa),_0x4baa8f),0x0;const _0x146734=_0x1da74b['stages']['map'](_0x4011ca=>_0x18b72b[_0x373a1c(0xca)](_0x4011ca['id'])??_0x4011ca['id']);return console[_0x373a1c(0x14e)]('Error:\x20Stage\x20\x22'+_0x498b41+_0x373a1c(0x130)),console[_0x373a1c(0x14e)](_0x373a1c(0xfa)+_0x146734[_0x373a1c(0x190)](',\x20')),0x1;}const _0x3f2761=_0x1da74b['stages']?.[_0x373a1c(0x149)](_0x2339da=>formatStageStats(_0x2339da,_0x37dbaa)),_0x5ee15e=assembleJourneyStats(_0x1da74b,{'from':_0x2a10d7,'to':_0x18e93c,'includeHistory':_0x4b7b52});return await this['renderStats'](_0x5ee15e,_0x3f2761??[],_0x4baa8f),0x0;}async['renderStats'](_0x310413,_0x391da5,_0x474066){const _0x354225=a27_0x5627fc,_0x1c92ea=_0x474066[_0x354225(0xc3)]==='json'||_0x474066[_0x354225(0xc3)]==='jsonl'||_0x474066['json']||_0x474066[_0x354225(0x140)];if(_0x1c92ea){_0x310413[_0x354225(0x18f)]=_0x391da5,await handleSingleObjectOutput(_0x310413,_0x474066);return;}await handleSingleObjectOutput(_0x310413,_0x474066);for(const _0x15727b of _0x391da5){console[_0x354225(0x116)](''),console[_0x354225(0x116)](String(a27_0x442aed[_0x354225(0xf2)][_0x354225(0x14f)]('['+_0x15727b[_0x354225(0x17a)]+']'))+a27_0x442aed[_0x354225(0xbd)]('\x20'+_0x15727b['id']));const {id:_0xd8f077,name:_0x51d5b4,..._0x441d13}=_0x15727b;await handleSingleObjectOutput(_0x441d13,_0x474066);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x161);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x15b);async['execute'](_0x30b6fe){const _0x38e2fe=a27_0x5627fc,{options:_0x14bed1,args:_0x54a264,tdx:_0x466e23}=_0x30b6fe,_0x3d2d7a=_0x54a264[0x0];if(!requireNameOrPath(_0x3d2d7a))return 0x1;_0x14bed1[_0x38e2fe(0x134)]&&console['error'](_0x38e2fe(0x1a0)+_0x3d2d7a);const _0x1ff9b7=_0x14bed1,_0x12df21=_0x1ff9b7[_0x38e2fe(0x142)],_0x416196=_0x1ff9b7['from'],_0x5cd6c7=_0x1ff9b7['to'],_0x184b96=_0x1ff9b7[_0x38e2fe(0x101)];if(_0x12df21&&_0x12df21!==_0x38e2fe(0xac)&&_0x12df21!==_0x38e2fe(0x10c))return console[_0x38e2fe(0x14e)](_0x38e2fe(0x11e)+_0x12df21+_0x38e2fe(0x18b)),0x1;const _0x243032=withJsonFormat(_0x14bed1),{journeyId:_0x18843b,journeyName:_0x1c37ad}=await resolveJourneyIdFromInput(_0x3d2d7a,_0x243032,_0x466e23),_0x35f9b3={'type':_0x12df21,'from':_0x416196,'to':_0x5cd6c7,'limit':_0x184b96},_0x3e31f9=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x466e23[_0x38e2fe(0xf7)][_0x38e2fe(0x11b)](_0x18843b,_0x35f9b3),{'verbose':_0x243032['verbose']}),_0x14ba06=_0x3e31f9[_0x38e2fe(0x10b)],_0x163598=_0x14ba06[_0x38e2fe(0xac)]&&(_0x14ba06[_0x38e2fe(0xac)][_0x38e2fe(0xc8)]['length']>0x0||_0x14ba06[_0x38e2fe(0xac)][_0x38e2fe(0xd6)][_0x38e2fe(0x115)]>0x0),_0x48e3d4=_0x14ba06[_0x38e2fe(0x10c)]&&_0x14ba06[_0x38e2fe(0x10c)][_0x38e2fe(0x115)]>0x0;if(!_0x163598&&!_0x48e3d4)return console[_0x38e2fe(0x14e)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x1c37ad),console[_0x38e2fe(0x14e)](_0x38e2fe(0x19f)),_0x416196&&_0x5cd6c7&&console['error'](_0x38e2fe(0xe6)),0x0;return await handleSingleObjectOutput(_0x14ba06,_0x243032),0x0;}}function formatStageStats(_0x4b0ae7,_0xfc60b){const _0x30f579=a27_0x5627fc,_0x277dbd=_0xfc60b['hasPeriod']&&_0x4b0ae7[_0x30f579(0x18e)]?.[_0x30f579(0x115)]?aggregateStageHistory(_0x4b0ae7[_0x30f579(0x18e)]):{'size':_0x4b0ae7[_0x30f579(0x19b)],'entered':_0x4b0ae7['enteredSize'],'milestone':_0x4b0ae7[_0x30f579(0xd3)],'milestone_rate':_0x4b0ae7['completeMilestoneRate'],'exit_or_jump':_0x4b0ae7['exitOrJumpSize'],'exit_or_jump_rate':_0x4b0ae7['exitOrJumpRate']},_0xd007df={'id':_0x4b0ae7['id'],'name':_0xfc60b[_0x30f579(0xbb)][_0x30f579(0xca)](_0x4b0ae7['id'])??_0x4b0ae7['id'],..._0x277dbd};return _0xfc60b[_0x30f579(0xb5)]&&_0xfc60b[_0x30f579(0x9f)]&&_0x4b0ae7['history']&&(_0xd007df[_0x30f579(0x18e)]=_0x4b0ae7['history']),_0xd007df;}export class JourneyPauseCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x131);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x158);async[a27_0x5627fc(0x11a)](_0x47c3da){const _0x186e38=a27_0x5627fc,{options:_0x3822e1,args:_0x1733d8,tdx:_0x18e35c}=_0x47c3da,_0x29a9f2=_0x1733d8[0x0];if(!requireNameOrPath(_0x29a9f2))return 0x1;_0x3822e1['verbose']&&console['error']('Input:\x20'+_0x29a9f2);const {journeyId:_0x4ce76b,journeyName:_0x147357}=await resolveJourneyIdFromInput(_0x29a9f2,_0x3822e1,_0x18e35c);if(!_0x3822e1[_0x186e38(0x178)]){const _0x52e4b4=await confirm(_0x186e38(0x18c)+_0x147357+'\x22?');if(!_0x52e4b4)return console[_0x186e38(0x14e)](_0x186e38(0xd7)),0x0;}const _0x8ba66b=await withSpinner('Pausing\x20journey...',()=>_0x18e35c[_0x186e38(0xf7)]['pause'](_0x4ce76b),{'verbose':_0x3822e1[_0x186e38(0x134)]}),_0x215b66=_0x8ba66b[_0x186e38(0x10b)];return console[_0x186e38(0x14e)]('✔\x20Journey\x20\x22'+_0x215b66[_0x186e38(0x15a)][_0x186e38(0x17a)]+_0x186e38(0x17e)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x5627fc(0xaf);[a27_0x5627fc(0xd1)]='Resume\x20a\x20paused\x20journey';async[a27_0x5627fc(0x11a)](_0x1f5f73){const _0x8fa0e1=a27_0x5627fc,{options:_0x4c7daf,args:_0x736758,tdx:_0x33ccc0}=_0x1f5f73,_0x36923d=_0x736758[0x0];if(!requireNameOrPath(_0x36923d))return 0x1;_0x4c7daf[_0x8fa0e1(0x134)]&&console[_0x8fa0e1(0x14e)](_0x8fa0e1(0x1a0)+_0x36923d);const {journeyId:_0x85affd,journeyName:_0x1bbead}=await resolveJourneyIdFromInput(_0x36923d,_0x4c7daf,_0x33ccc0);if(!_0x4c7daf[_0x8fa0e1(0x178)]){const _0x410041=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x1bbead+'\x22?');if(!_0x410041)return console[_0x8fa0e1(0x14e)](_0x8fa0e1(0xd7)),0x0;}const _0xf12157=await withSpinner('Resuming\x20journey...',()=>_0x33ccc0[_0x8fa0e1(0xf7)][_0x8fa0e1(0x155)](_0x85affd),{'verbose':_0x4c7daf[_0x8fa0e1(0x134)]}),_0x23d535=_0xf12157[_0x8fa0e1(0x10b)];return console[_0x8fa0e1(0x14e)](_0x8fa0e1(0xbe)+_0x23d535['attributes'][_0x8fa0e1(0x17a)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x169);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x124);async[a27_0x5627fc(0x11a)](_0x1f3898){const _0x2b134d=a27_0x5627fc,{options:_0x2474ea,args:_0x5add57,tdx:_0xd533ec}=_0x1f3898,_0x22c7fd=_0x2474ea,_0x3efbb7=_0x5add57[0x0],_0x41d986=_0x3efbb7&&isYamlFilePath(_0x3efbb7),_0x1109b7=await resolveTarget({'arg':_0x41d986?_0x3efbb7:undefined,'contextParent':_0x2474ea[_0x2b134d(0x1a2)],'cwd':process[_0x2b134d(0xad)]()});if(!isSuccessfulResolution(_0x1109b7))return _0x1109b7[_0x2b134d(0x157)]===_0x2b134d(0x109)?(console['error'](a27_0x442aed[_0x2b134d(0x144)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x2b134d(0x139)),console[_0x2b134d(0x14e)](_0x2b134d(0x12f)),console[_0x2b134d(0x14e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console['error'](_0x2b134d(0x19d))):(console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0xee)](_0x2b134d(0x97)+_0x1109b7[_0x2b134d(0x16f)]+'\x0a')),_0x1109b7[_0x2b134d(0xf4)]&&console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0xf2)](_0x1109b7['helpText']))),0x1;let _0x5a5dd0=_0x41d986?undefined:_0x3efbb7,_0x577286,_0x1effdf;_0x1109b7['type']===_0x2b134d(0xcc)&&(_0x5a5dd0=_0x1109b7[_0x2b134d(0xbc)],_0x577286=_0x1109b7[_0x2b134d(0xe8)],_0x1effdf=_0x1109b7['folderPath']);const _0x36585b=_0x1109b7[_0x2b134d(0x127)],_0x36dc93=_0x1109b7[_0x2b134d(0x107)];_0x22c7fd[_0x2b134d(0x134)]&&(console[_0x2b134d(0x14e)]('Parent\x20segment:\x20'+_0x36585b),console[_0x2b134d(0x14e)](_0x2b134d(0x168)+_0x36dc93),_0x5a5dd0&&console[_0x2b134d(0x14e)](_0x2b134d(0x12b)+_0x5a5dd0),_0x577286&&console[_0x2b134d(0x14e)](_0x2b134d(0x1a4)+_0x577286),_0x1effdf&&console['error'](_0x2b134d(0xf5)+_0x1effdf));const _0xcb396d=await withSpinner(_0x2b134d(0xec),()=>_0xd533ec['segment'][_0x2b134d(0x15f)](_0x36585b),{'verbose':_0x2474ea[_0x2b134d(0x134)]}),_0x30fdcb=_0xcb396d[_0x2b134d(0x10b)],{journeys:_0x443f92,folders:_0x5ebf1d}=await withSpinner(_0x2b134d(0x120),async()=>{const _0x273e79=_0x2b134d,[_0x4d8d15,_0x1b675f]=await Promise[_0x273e79(0x153)]([_0xd533ec[_0x273e79(0xf7)][_0x273e79(0x95)](_0x30fdcb,undefined,{'includeAllVersions':!![]}),_0xd533ec[_0x273e79(0xed)][_0x273e79(0x16a)](_0x30fdcb)]);return{'journeys':_0x4d8d15,'folders':_0x1b675f};},{'verbose':_0x2474ea['verbose']})[_0x2b134d(0x132)](_0x3134cd=>_0x3134cd['data']);let _0x2ac801=_0x443f92;const _0x5671ac=buildFolderIdToPathMap(_0x5ebf1d);if(_0x5a5dd0){const _0x22cdc0=_0x2ac801[_0x2b134d(0x98)](_0x1ae8fc=>_0x1ae8fc['journeyBundleName'][_0x2b134d(0x146)]()===_0x5a5dd0[_0x2b134d(0x146)]());if(_0x22cdc0[_0x2b134d(0x115)]===0x0)return console[_0x2b134d(0x14e)](_0x2b134d(0x192)+_0x5a5dd0),console['error'](_0x2b134d(0x9b)),0x1;_0x2ac801=_0x22cdc0;}if(_0x1effdf!==undefined){const _0x41bd14=_0x2ac801[_0x2b134d(0x98)](_0x2f4976=>{const _0x56543e=_0x2b134d,_0x2c6c76=_0x2f4976[_0x56543e(0x15e)]?_0x5671ac['get'](_0x2f4976[_0x56543e(0x15e)])||'':'';return _0x2c6c76===_0x1effdf;});if(_0x41bd14[_0x2b134d(0x115)]===0x0&&_0x2ac801['length']>0x0){console[_0x2b134d(0x14e)]('Error:\x20Journey\x20\x27'+_0x5a5dd0+'\x27\x20not\x20found\x20in\x20'+(_0x1effdf||_0x2b134d(0x143))),console[_0x2b134d(0x14e)](_0x2b134d(0x16e));for(const _0x514c72 of _0x2ac801){const _0xeaac40=_0x514c72[_0x2b134d(0x15e)]?_0x5671ac[_0x2b134d(0xca)](_0x514c72[_0x2b134d(0x15e)])||'':'';console[_0x2b134d(0x14e)](_0x2b134d(0x12e)+(_0xeaac40||'(root)')+'/'+_0x514c72[_0x2b134d(0xff)]);}return 0x1;}_0x2ac801=_0x41bd14;}if(_0x2ac801[_0x2b134d(0x115)]===0x0)return console[_0x2b134d(0x14e)]('No\x20journeys\x20found'),0x0;const _0x57f78a=new Map();for(const _0x1db39d of _0x2ac801){const _0x11b13f=_0x1db39d[_0x2b134d(0x100)];!_0x57f78a[_0x2b134d(0xd5)](_0x11b13f)&&_0x57f78a[_0x2b134d(0x1a5)](_0x11b13f,[]),_0x57f78a[_0x2b134d(0xca)](_0x11b13f)[_0x2b134d(0xcb)](_0x1db39d);}for(const _0x1cd84c of _0x57f78a[_0x2b134d(0xdb)]()){_0x1cd84c[_0x2b134d(0x118)]((_0x19c54b,_0x2888c0)=>(_0x19c54b[_0x2b134d(0xa7)]||0x0)-(_0x2888c0['versionNumber']||0x0));}const _0x21a371=[],{idToEmailMap:_0x219abe,connectionIdToNameMap:_0x53b4f5}=await withSpinner(_0x2b134d(0x196),async()=>{const _0x369aa0=_0x2b134d,[_0x28138b,_0x44184a]=await Promise[_0x369aa0(0x153)]([_0xd533ec[_0x369aa0(0xfc)]['buildIdToEmailMap'](),_0xd533ec[_0x369aa0(0xb1)][_0x369aa0(0x177)]()]);return{'idToEmailMap':_0x28138b,'connectionIdToNameMap':_0x44184a};},{'verbose':_0x2474ea[_0x2b134d(0x134)]})[_0x2b134d(0x132)](_0x48fb75=>_0x48fb75[_0x2b134d(0x10b)]);for(const _0x4a2125 of _0x57f78a['values']()){const _0x47cdc8=_0x4a2125[0x0][_0x2b134d(0xff)],_0x1c5998=_0x4a2125[0x0][_0x2b134d(0x15e)],_0x22fb95=_0x1c5998?_0x5671ac[_0x2b134d(0xca)](_0x1c5998)||'':'',_0x286516=_0x22fb95?a27_0x26af62[_0x2b134d(0x190)](_0x36dc93,_0x22fb95):_0x36dc93,_0x3a9ebd=_0x577286||a27_0x26af62[_0x2b134d(0x190)](_0x286516,sanitizeFileName(_0x47cdc8)+'.yml');let _0x390385,_0xfecf52;if(existsSync(_0x3a9ebd))try{const _0x1eff73=readFileSync(_0x3a9ebd,'utf-8'),_0x455955=parseYamlString(_0x1eff73);_0xfecf52=_0x455955,_0x390385=buildRuleToNameMapping(_0x455955),_0x22c7fd[_0x2b134d(0x134)]&&_0x390385[_0x2b134d(0x19b)]>0x0&&console[_0x2b134d(0x14e)](_0x2b134d(0x14c)+_0x390385['size']+_0x2b134d(0xb2)+_0x47cdc8);}catch(_0x5cb9ac){_0x22c7fd[_0x2b134d(0x134)]&&console[_0x2b134d(0x14e)](_0x2b134d(0x183)+_0x5cb9ac['message']);}const _0x161709=[],_0xc3cb9e=new Set(),_0x2e5279=new Map(),_0x280405=new Map(),_0xb09e83=new Set(),_0x539f9d=new Map(),_0x30e872=new Map(),_0x581ded=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x47cdc8+_0x2b134d(0x141),async _0x163581=>{const _0x56e6ef=_0x2b134d;for(const _0x26203b of _0x4a2125){const _0x41bd7b=_0x4a2125[_0x56e6ef(0x115)]>0x1?_0x26203b[_0x56e6ef(0xff)]+'\x20v'+(_0x26203b[_0x56e6ef(0xa7)]||0x1):_0x26203b[_0x56e6ef(0xff)];_0x163581[_0x56e6ef(0xea)](_0x56e6ef(0xe2)+_0x41bd7b);const _0x1a6152=await _0xd533ec[_0x56e6ef(0xf7)][_0x56e6ef(0x1a6)](_0x26203b['id']),_0x150119=_0x1a6152[_0x56e6ef(0x15a)]?.[_0x56e6ef(0xef)],_0x443345={'resolveSegment':async _0x58497a=>{const _0x10372a=_0x56e6ef;if(!_0x150119)return{'name':_0x58497a,'isJourneyLocal':![]};const _0x24774c=_0x2e5279['get'](_0x58497a);if(_0x24774c)return _0x24774c;try{const _0xa7e7b6=await _0xd533ec['segment'][_0x10372a(0x114)](_0x150119,_0x58497a),_0x48b813=_0xa7e7b6['kind']===SEGMENT_KIND_JOURNEY;let _0x15efdf,_0x4d5adc=_0xa7e7b6[_0x10372a(0x17a)];if(_0x48b813&&_0xa7e7b6['rule']){const _0xa2b11e=await segmentResponseToDef(_0xa7e7b6,{'resolveSegmentName':async _0x13e0e9=>{const _0x36d292=_0x10372a,_0xa88c8c=_0x2e5279[_0x36d292(0xca)](_0x13e0e9);if(_0xa88c8c)return _0xa88c8c[_0x36d292(0x17a)];const _0x5d9079=await _0x443345[_0x36d292(0x9d)](_0x13e0e9);return _0x5d9079['name'];}}),_0x16e49b=_0xa2b11e[_0x10372a(0xe5)];_0x15efdf={'description':_0xa7e7b6['description'],'rule':_0x16e49b};const _0x5b7cd1=serializeRule(_0x16e49b),_0xe61848=_0x280405[_0x10372a(0xca)](_0x5b7cd1);if(_0xe61848)_0x4d5adc=_0xe61848,_0x15efdf=undefined,_0x22c7fd[_0x10372a(0x134)]&&console['error'](_0x10372a(0x152)+_0xa7e7b6[_0x10372a(0x17a)]+'\x20->\x20'+_0xe61848);else{let _0x4af7a0=![];if(_0x390385){const _0x15f7f3=_0x390385['get'](_0x5b7cd1);if(_0x15f7f3){const _0x1e245f=_0x15f7f3[_0x10372a(0xf9)](_0xf127bf=>!_0xc3cb9e[_0x10372a(0xd5)](_0xf127bf));_0x1e245f&&(_0x4d5adc=_0x1e245f,_0xc3cb9e[_0x10372a(0x1a3)](_0x1e245f),_0x280405['set'](_0x5b7cd1,_0x1e245f),_0x4af7a0=!![],_0x22c7fd[_0x10372a(0x134)]&&console[_0x10372a(0x14e)](_0x10372a(0x122)+_0x1e245f+'\x20(rule\x20match)'));}}if(!_0x4af7a0){const _0x2d2bc2=generateJourneyLocalName(_0xa7e7b6['name']);_0x2d2bc2&&(_0x4d5adc=_0x2d2bc2);let _0x22d2c3=_0x4d5adc,_0x5d0a73=0x2;while(_0xc3cb9e[_0x10372a(0xd5)](_0x22d2c3)){_0x22d2c3=_0x4d5adc+'_'+_0x5d0a73,_0x5d0a73++;}_0xc3cb9e['add'](_0x22d2c3),_0x280405['set'](_0x5b7cd1,_0x22d2c3),_0x4d5adc=_0x22d2c3;}}}const _0x56df4a={'name':_0x4d5adc,'isJourneyLocal':_0x48b813,'definition':_0x15efdf};return _0x2e5279[_0x10372a(0x1a5)](_0x58497a,_0x56df4a),_0x56df4a;}catch(_0x4ff56c){return _0x2474ea[_0x10372a(0x134)]&&console[_0x10372a(0x14e)](_0x10372a(0x198)+_0x58497a+':\x20'+_0x4ff56c[_0x10372a(0x16f)]),{'name':_0x58497a,'isJourneyLocal':![]};}},'resolveActivation':async _0x414a01=>{const _0x1861ce=_0x56e6ef,_0x2b54ea=_0x539f9d[_0x1861ce(0xca)](_0x414a01);if(_0x2b54ea)return _0x2b54ea;try{const _0x49df00=await _0xd533ec[_0x1861ce(0xf7)]['getActivation'](_0x26203b['id'],_0x414a01),_0x1d7839=journeyActivationStepToYaml(_0x49df00,_0x219abe,_0x53b4f5),_0x2c8a34=JSON[_0x1861ce(0x166)]({'name':_0x1d7839['name'],'connection':_0x1d7839[_0x1861ce(0xb1)],'connector_config':_0x1d7839[_0x1861ce(0x1a1)]}),_0x269117=_0x30e872['get'](_0x2c8a34);if(_0x269117){const _0x487b83={'name':_0x269117,'isJourneyLocal':!![],'definition':_0x1d7839};return _0x539f9d[_0x1861ce(0x1a5)](_0x414a01,_0x487b83),_0x487b83;}const _0x2f7b79=_0x49df00['attributes'][_0x1861ce(0x194)][_0x1861ce(0x17a)]||_0x414a01,_0x5ef22b=sanitizeYamlKey(_0x2f7b79)||'activation_'+_0x414a01;let _0x5741f5=_0x5ef22b,_0x5882a6=0x2;while(_0xb09e83['has'](_0x5741f5)){_0x5741f5=_0x5ef22b+'_'+_0x5882a6,_0x5882a6++;}_0xb09e83[_0x1861ce(0x1a3)](_0x5741f5),_0x30e872[_0x1861ce(0x1a5)](_0x2c8a34,_0x5741f5);const _0x46c10f={'name':_0x5741f5,'isJourneyLocal':!![],'definition':_0x1d7839};return _0x539f9d[_0x1861ce(0x1a5)](_0x414a01,_0x46c10f),_0x46c10f;}catch(_0x27ff0e){return _0x2474ea[_0x1861ce(0x134)]&&console[_0x1861ce(0x14e)](_0x1861ce(0xfb)+_0x414a01+':\x20'+_0x27ff0e['message']),{'name':_0x414a01,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x57c0c7,_0x52df0)=>{const _0x3ad821=_0x56e6ef;return resolveJumpTarget(_0x57c0c7,_0x52df0,_0x581ded,_0x2f2ac2=>_0xd533ec[_0x3ad821(0xf7)][_0x3ad821(0x1a6)](_0x2f2ac2));}},_0x4375f6=await journeyResponseToDef(_0x1a6152,_0x443345);_0x161709['push']({'item':_0x26203b,'yaml':_0x4375f6});}},{'verbose':_0x2474ea[_0x2b134d(0x134)]});const _0xbc94e9=await _0xd533ec[_0x2b134d(0xf7)][_0x2b134d(0xe0)](_0x4a2125[0x0]['journeyBundleId']),_0x1d3775=buildMergedJourneyDef(_0x161709,_0x390385,_0xbc94e9),_0x40091b=normalizeJourneyDef(_0x1d3775,_0xfecf52),_0x32c317=toYamlString(_0x40091b),_0x44fe90=_0x577286||a27_0x26af62[_0x2b134d(0x190)](_0x286516,sanitizeFileName(_0x47cdc8)+_0x2b134d(0x16b));!_0x577286&&_0x22fb95&&!existsSync(_0x286516)&&mkdirSync(_0x286516,{'recursive':!![]});const _0x10786d=a27_0x26af62[_0x2b134d(0x110)](process[_0x2b134d(0xad)](),_0x44fe90);if(existsSync(_0x44fe90)){const _0x194518=readFileSync(_0x44fe90,_0x2b134d(0x15c)),_0x4f15a6=generateDiff(_0x194518,_0x32c317),_0x5f8094=hasChanges(_0x4f15a6);_0x21a371['push']({'relativePath':_0x10786d,'absolutePath':_0x44fe90,'content':_0x32c317,'isNew':![],'hasChanges':_0x5f8094,'diff':_0x5f8094?formatDiffWithColors(_0x4f15a6):undefined});}else _0x21a371[_0x2b134d(0xcb)]({'relativePath':_0x10786d,'absolutePath':_0x44fe90,'content':_0x32c317,'isNew':!![],'hasChanges':![]});}const _0xaa075c=_0x21a371[_0x2b134d(0x98)](_0xb9af36=>_0xb9af36[_0x2b134d(0x193)]),_0x45c9ca=_0x21a371['filter'](_0x36eaba=>!_0x36eaba[_0x2b134d(0x193)]&&_0x36eaba[_0x2b134d(0x13d)]),_0x10c78f=_0x21a371[_0x2b134d(0x98)](_0xc461a5=>!_0xc461a5[_0x2b134d(0x193)]&&!_0xc461a5[_0x2b134d(0x13d)]),_0x3a655c=_0x2ac801[_0x2b134d(0x115)],_0x313f58=_0x57f78a[_0x2b134d(0x19b)],_0x458f24=_0x3a655c>_0x313f58?'\x20('+_0x3a655c+_0x2b134d(0x12d):'';console[_0x2b134d(0x14e)](_0x2b134d(0x16c)),console['error']('\x20\x20'+a27_0x442aed[_0x2b134d(0xf2)](_0x313f58+_0x2b134d(0x119))+a27_0x442aed[_0x2b134d(0xbd)](_0x458f24)),console[_0x2b134d(0x14e)]('\x20\x20'+a27_0x442aed[_0x2b134d(0x175)]('+\x20'+_0xaa075c['length']+_0x2b134d(0xa0))),console[_0x2b134d(0x14e)]('\x20\x20'+a27_0x442aed[_0x2b134d(0x144)]('~\x20'+_0x45c9ca[_0x2b134d(0x115)]+_0x2b134d(0x159))),console[_0x2b134d(0x14e)]('\x20\x20'+a27_0x442aed[_0x2b134d(0xbd)]('=\x20'+_0x10c78f[_0x2b134d(0x115)]+'\x20unchanged\x20files')),console[_0x2b134d(0x14e)](_0x2b134d(0xa6)+a27_0x442aed[_0x2b134d(0xf2)](_0x36dc93)+'\x0a');if(_0x45c9ca[_0x2b134d(0x115)]>0x0)for(const _0x4b4ef9 of _0x45c9ca){console['error']('\x0aChanges\x20to\x20\x27'+_0x4b4ef9[_0x2b134d(0x13a)]+'\x27:'),console['error']('─'[_0x2b134d(0xba)](0x3c)),console['error'](_0x4b4ef9[_0x2b134d(0x170)]),console[_0x2b134d(0x14e)]('─'[_0x2b134d(0xba)](0x3c));}if(_0x22c7fd['dryRun'])return console[_0x2b134d(0x14e)](a27_0x442aed['yellow'](_0x2b134d(0xa3))),0x0;if(_0xaa075c[_0x2b134d(0x115)]===0x0&&_0x45c9ca[_0x2b134d(0x115)]===0x0)return console['error'](a27_0x442aed['green'](_0x2b134d(0xfd))),saveSessionContext({'parent_segment':_0x36585b},_0x22c7fd[_0x2b134d(0xeb)]),console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0x175)](_0x2b134d(0x176)+a27_0x442aed[_0x2b134d(0xbd)](_0x2b134d(0x135))+_0x2b134d(0xb3)+a27_0x442aed[_0x2b134d(0xf2)](_0x36585b))),0x0;if(!_0x22c7fd['yes']&&(_0xaa075c[_0x2b134d(0x115)]>0x0||_0x45c9ca[_0x2b134d(0x115)]>0x0)){if(!isInteractive())return console['error'](a27_0x442aed['red'](_0x2b134d(0xc9)),_0x2b134d(0x14a)),console['error'](a27_0x442aed['dim'](_0x2b134d(0x150))),0x1;const _0x1a574e=await confirmKey(_0x2b134d(0xa4)+(_0xaa075c[_0x2b134d(0x115)]+_0x45c9ca[_0x2b134d(0x115)])+_0x2b134d(0x11d));if(!_0x1a574e)return console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0x144)](_0x2b134d(0x17d)),_0x2b134d(0xb0)),0x1;}!existsSync(_0x36dc93)&&mkdirSync(_0x36dc93,{'recursive':!![]});const _0x936b84=a27_0x26af62['join'](_0x36dc93,_0x2b134d(0xc0));writeFileSync(_0x936b84,createTdxConfigContent(_0x36585b),_0x2b134d(0x15c));for(const _0x22b2f5 of _0x21a371){(_0x22b2f5[_0x2b134d(0x193)]||_0x22b2f5['hasChanges'])&&writeFileSync(_0x22b2f5[_0x2b134d(0x103)],_0x22b2f5[_0x2b134d(0x13b)],'utf-8');}return console['error'](a27_0x442aed[_0x2b134d(0x175)]('✔\x20Pulled\x20'+(_0xaa075c[_0x2b134d(0x115)]+_0x45c9ca[_0x2b134d(0x115)])+'\x20journey\x20files\x20to\x20'+_0x36dc93)),saveSessionContext({'parent_segment':_0x36585b},_0x22c7fd['session']),console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0x175)](_0x2b134d(0x176)+a27_0x442aed[_0x2b134d(0xbd)]('parent_segment')+_0x2b134d(0xb3)+a27_0x442aed[_0x2b134d(0xf2)](_0x36585b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x5627fc(0x9c);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x108);async[a27_0x5627fc(0x11a)](_0x30e19c){const _0x160019=a27_0x5627fc,{options:_0x103588,args:_0x351841,tdx:_0x2aefbe}=_0x30e19c,_0x4bab86=_0x351841[0x0];if(!requireNameOrPath(_0x4bab86))return 0x1;_0x103588[_0x160019(0x134)]&&console[_0x160019(0x14e)](_0x160019(0x1a0)+_0x4bab86);const {journeyId:_0xad9751}=await resolveJourneyIdFromInput(_0x4bab86,_0x103588,_0x2aefbe),_0x5f4717=await withSpinner(_0x160019(0x99),()=>_0x2aefbe[_0x160019(0xf7)][_0x160019(0x13f)](_0xad9751),{'verbose':_0x103588['verbose']}),_0x2c3cff=_0x5f4717[_0x160019(0x10b)];return console[_0x160019(0x116)]('Database:\x20'+_0x2c3cff['database']),console[_0x160019(0x116)](_0x160019(0x112)+_0x2c3cff[_0x160019(0x138)]),await handleSDKOutput(_0x2c3cff['columns'],_0x103588),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x5627fc(0x17a)]='journey:activations';[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x12c);async[a27_0x5627fc(0x11a)](_0x2b10c4){const _0x4061bd=a27_0x5627fc,{options:_0x11e13b,args:_0x1b2fe4,tdx:_0x546946}=_0x2b10c4,_0x4f2950=_0x1b2fe4[0x0];if(!requireNameOrPath(_0x4f2950))return 0x1;_0x11e13b[_0x4061bd(0x134)]&&console['error']('Input:\x20'+_0x4f2950);const {journeyId:_0x16eef5}=await resolveJourneyIdFromInput(_0x4f2950,_0x11e13b,_0x546946),_0x217856=await withSpinner(_0x4061bd(0x123),()=>_0x546946[_0x4061bd(0xf7)][_0x4061bd(0xe9)](_0x16eef5),{'verbose':_0x11e13b[_0x4061bd(0x134)]}),_0x6ca65f=_0x217856[_0x4061bd(0x10b)];return console['error'](_0x4061bd(0x14c)+_0x6ca65f[_0x4061bd(0x115)]+'\x20activation'+(_0x6ca65f[_0x4061bd(0x115)]!==0x1?'s':'')),await handleSDKOutput(_0x6ca65f,_0x11e13b),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x5627fc(0x180);['description']=a27_0x5627fc(0xd8);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x5d16a5){const _0x2a095e=a27_0x5627fc,_0x37dae8=_0x5d16a5['args'][0x0];let _0x1a082c;if(_0x37dae8){const _0x4cd9b1=await resolveTarget({'arg':_0x37dae8,'contextParent':_0x5d16a5['options']['parentSegment'],'cwd':process[_0x2a095e(0xad)]()});isSuccessfulResolution(_0x4cd9b1)&&_0x4cd9b1[_0x2a095e(0x142)]===_0x2a095e(0xcc)&&(_0x1a082c=_0x4cd9b1[_0x2a095e(0xe8)]);}const _0x397a39={..._0x5d16a5,'options':{..._0x5d16a5['options'],'journeysOnly':!![],..._0x1a082c&&{'singleFilePath':_0x1a082c}}};return this['segmentPushCommand']['execute'](_0x397a39);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x5627fc(0x17a)]='journey:versions';[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x133);async[a27_0x5627fc(0x11a)](_0x37d826){const _0x40575e=a27_0x5627fc,{options:_0x44d72d,args:_0x4bd4c9,tdx:_0x2be5b1}=_0x37d826,_0x59d23b=_0x4bd4c9[0x0];if(!requireNameOrPath(_0x59d23b))return 0x1;if(_0x44d72d['verbose'])console[_0x40575e(0x14e)](_0x40575e(0x1a0)+_0x59d23b);const {journeyId:_0x18da28}=await resolveJourneyIdFromInput(_0x59d23b,_0x44d72d,_0x2be5b1),_0x332806=await withSpinner(_0x40575e(0x181),()=>_0x2be5b1['journey'][_0x40575e(0x14d)](_0x18da28),{'verbose':_0x44d72d['verbose']}),{bundleName:_0x5db35d,versions:_0x2bf11b,latestJourneyId:_0x29caa2}=_0x332806[_0x40575e(0x10b)];console[_0x40575e(0x14e)](_0x5db35d+':\x20'+_0x2bf11b[_0x40575e(0x115)]+_0x40575e(0x185)+(_0x2bf11b[_0x40575e(0x115)]!==0x1?'s':''));const _0x20a023=_0x2bf11b['map'](_0x250b88=>({'version':_0x250b88[_0x40575e(0xa7)],'journey_id':_0x250b88[_0x40575e(0x13c)],'name':_0x250b88['name'],'state':_0x250b88[_0x40575e(0xc4)],'paused':_0x250b88[_0x40575e(0x156)],'latest':_0x250b88[_0x40575e(0x13c)]===_0x29caa2,'created_at':_0x250b88[_0x40575e(0xd9)]}));return await handleSDKOutput(_0x20a023,_0x44d72d),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x184);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0xa9);async[a27_0x5627fc(0x11a)](_0x5dbb2a){const _0x457ecf=a27_0x5627fc,{options:_0x24d9d9,args:_0x510991,tdx:_0x57b45f}=_0x5dbb2a,_0x2787cb=_0x510991[0x0];if(!requireNameOrPath(_0x2787cb))return 0x1;if(_0x24d9d9[_0x457ecf(0x134)])console['error'](_0x457ecf(0x1a0)+_0x2787cb);const {journeyId:_0x1db675,journeyName:_0x2fb6b5}=await resolveJourneyIdFromInput(_0x2787cb,_0x24d9d9,_0x57b45f);if(!_0x24d9d9[_0x457ecf(0x178)]){const _0x4e266b=await confirm(_0x457ecf(0x15d)+_0x2fb6b5+'\x22?');if(!_0x4e266b)return console[_0x457ecf(0x14e)]('Cancelled'),0x0;}const _0x12bef6=await withSpinner(_0x457ecf(0x199),()=>_0x57b45f[_0x457ecf(0xf7)]['createVersion'](_0x1db675),{'verbose':_0x24d9d9[_0x457ecf(0x134)]}),_0x31ca14=_0x12bef6[_0x457ecf(0x10b)];return console[_0x457ecf(0x14e)](a27_0x442aed['green']('✔')+_0x457ecf(0x191)+_0x31ca14['attributes'][_0x457ecf(0xa7)]+_0x457ecf(0x10f)+_0x31ca14['attributes'][_0x457ecf(0x17a)]+'\x22'),console[_0x457ecf(0x14e)](_0x457ecf(0xb4)+_0x31ca14['id']),await handleSingleObjectOutput({'id':_0x31ca14['id'],'name':_0x31ca14[_0x457ecf(0x15a)][_0x457ecf(0x17a)],'version':_0x31ca14[_0x457ecf(0x15a)][_0x457ecf(0xa7)],'state':_0x31ca14[_0x457ecf(0x15a)][_0x457ecf(0xc4)],'bundle_id':_0x31ca14['attributes'][_0x457ecf(0x100)],'created_at':_0x31ca14['attributes'][_0x457ecf(0xd9)]},_0x24d9d9),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a27_0x5627fc(0xc7);['description']=a27_0x5627fc(0x189);async[a27_0x5627fc(0x11a)](_0x29ec97){const _0x234c7a=a27_0x5627fc,{options:_0x3498d2,args:_0x325ed6,tdx:_0x159f19}=_0x29ec97,_0x591a78=_0x325ed6[0x0];if(!requireNameOrPath(_0x591a78))return 0x1;const _0x54ee1f=_0x3498d2[_0x234c7a(0x128)];if(!_0x54ee1f)return console[_0x234c7a(0x14e)](_0x234c7a(0xc6)),console[_0x234c7a(0x14e)](_0x234c7a(0xb9)),0x1;const _0x113d09=parseInt(_0x54ee1f,0xa);if(isNaN(_0x113d09)||_0x113d09<0x1)return console[_0x234c7a(0x14e)](_0x234c7a(0x165)+_0x54ee1f),0x1;if(_0x3498d2[_0x234c7a(0x134)])console[_0x234c7a(0x14e)](_0x234c7a(0x1a0)+_0x591a78+_0x234c7a(0xce)+_0x113d09);const {journeyId:_0xb0ddcc,parentSegmentId:_0x3247b4}=await resolveJourneyIdFromInput(_0x591a78,_0x3498d2,_0x159f19),_0x3c6de9=await withSpinner(_0x234c7a(0x105),()=>_0x159f19[_0x234c7a(0xf7)][_0x234c7a(0x14d)](_0xb0ddcc),{'verbose':_0x3498d2['verbose']}),{versions:_0x299d97,latestJourneyId:_0x1880ae}=_0x3c6de9[_0x234c7a(0x10b)],_0x539b20=_0x299d97[_0x234c7a(0xf9)](_0x4437d0=>_0x4437d0[_0x234c7a(0xa7)]===_0x113d09);if(!_0x539b20){const _0x26de53=_0x299d97['map'](_0x439334=>'v'+_0x439334[_0x234c7a(0xa7)])['join'](',\x20');return console[_0x234c7a(0x14e)]('Error:\x20Version\x20'+_0x113d09+_0x234c7a(0x182)+_0x26de53),0x1;}const _0x5ca6a7=await withSpinner('Getting\x20version\x20'+_0x113d09+_0x234c7a(0xa5),()=>_0x159f19[_0x234c7a(0xf7)][_0x234c7a(0x1a6)](_0x539b20[_0x234c7a(0x13c)]),{'verbose':_0x3498d2[_0x234c7a(0x134)]}),_0x456e5f=_0x5ca6a7[_0x234c7a(0x10b)],_0x59bb8d=getConsoleNextUrl(_0x3498d2[_0x234c7a(0x19c)],'/app/ps/'+_0x3247b4+'/e/'+_0x539b20['journeyId']+_0x234c7a(0x10e));return await handleSingleObjectOutput({'id':_0x456e5f['id'],'name':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0x17a)],'version':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xa7)],'description':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xd1)],'state':_0x456e5f[_0x234c7a(0x15a)]['state'],'paused':_0x456e5f[_0x234c7a(0x15a)]['paused'],'reentry_mode':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xfe)],'stages':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0x9e)]?.[_0x234c7a(0x115)]||0x0,..._0x456e5f['attributes'][_0x234c7a(0x179)]&&{'goal':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0x179)][_0x234c7a(0x17a)]},'latest':_0x539b20['journeyId']===_0x1880ae,'created_at':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xd9)],'updated_at':_0x456e5f['attributes'][_0x234c7a(0x94)],'url':_0x59bb8d},_0x3498d2),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_0x4363f7=a28_0x1de3;(function(_0x17cd84,_0x483b7a){const _0x242186=a28_0x1de3,_0x2455d1=_0x17cd84();while(!![]){try{const _0x209431=parseInt(_0x242186(0xb9))/0x1*(-parseInt(_0x242186(0xbe))/0x2)+-parseInt(_0x242186(0xb0))/0x3+parseInt(_0x242186(0xc0))/0x4+-parseInt(_0x242186(0xd1))/0x5*(-parseInt(_0x242186(0xea))/0x6)+-parseInt(_0x242186(0xce))/0x7*(parseInt(_0x242186(0xc7))/0x8)+parseInt(_0x242186(0xde))/0x9*(-parseInt(_0x242186(0xe0))/0xa)+parseInt(_0x242186(0xd4))/0xb;if(_0x209431===_0x483b7a)break;else _0x2455d1['push'](_0x2455d1['shift']());}catch(_0x2e735b){_0x2455d1['push'](_0x2455d1['shift']());}}}(a28_0x4fe7,0xd5902));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x1de3(_0x279564,_0x1f16c7){_0x279564=_0x279564-0xaf;const _0x4fe7cf=a28_0x4fe7();let _0x1de3d1=_0x4fe7cf[_0x279564];return _0x1de3d1;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x119a36 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a28_0x4fe7(){const _0x1c81d5=['\x20warning(s)\x20found','4EhJLZY','description','2014828ptCCcs','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20Directory\x20not\x20found:\x20','skippedCount','name','no_parent','672wwqpAT','\x20valid','warningCount','cwd','green','.yml','length','70609IksGYE','endsWith','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','3625uGbCgw','No\x20journey\x20YAML\x20files\x20found\x20in\x20','yellow','44510246tISPLm','relativePath','message','errorCode','✔\x20All\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','reason','\x20(skipped:\x20','validCount','.yaml','9HpnQxq','execute','13871870Hcvdvi','log','journey:validate','helpText','Error:\x20','filter','dim','\x20error(s)','\x20journey(s)\x20valid','journey','2400jnQjjn','errors','filePath','valid','49830dXEcvh','error','verbose','hasErrors','\x20warning(s)','type','invalidCount','warnings','targetDir','857117jfmrSL','\x20segment\x20file(s)\x20skipped','red','parentSegment'];a28_0x4fe7=function(){return _0x1c81d5;};return a28_0x4fe7();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x4363f7(0xc5)]=a28_0x4363f7(0xe2);[a28_0x4363f7(0xbf)]='Validate\x20journey\x20YAML\x20files';async[a28_0x4363f7(0xdf)](_0x5f202f){const _0x3b148c=a28_0x4363f7,{options:_0x1880f8,args:_0x35ab01}=_0x5f202f,_0x3e8d74=_0x1880f8,_0x20dafd=await resolveTarget({'arg':_0x35ab01[0x0],'contextParent':_0x1880f8[_0x3b148c(0xbc)],'cwd':process[_0x3b148c(0xca)]()});if(!isSuccessfulResolution(_0x20dafd))return _0x20dafd[_0x3b148c(0xd7)]===_0x3b148c(0xc6)?(console[_0x3b148c(0xb1)](a28_0x119a36[_0x3b148c(0xd3)](_0x3b148c(0xd9))),console[_0x3b148c(0xb1)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x3b148c(0xb1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console['error'](_0x3b148c(0xc1))):(console['error'](a28_0x119a36[_0x3b148c(0xbb)](_0x3b148c(0xe4)+_0x20dafd[_0x3b148c(0xd6)]+'\x0a')),_0x20dafd[_0x3b148c(0xe3)]&&console['error'](a28_0x119a36['cyan'](_0x20dafd[_0x3b148c(0xe3)]))),0x1;const _0x4542ef=_0x20dafd[_0x3b148c(0xb8)],_0xfdddac=_0x20dafd[_0x3b148c(0xb5)]==='file'?_0x20dafd[_0x3b148c(0xec)]:undefined;if(!_0xfdddac&&!existsSync(_0x4542ef))return console['error'](a28_0x119a36['red'](_0x3b148c(0xc3)+_0x4542ef+'\x0a')),0x1;let _0x30baf3;if(_0xfdddac){if(!_0xfdddac['endsWith'](_0x3b148c(0xcc))&&!_0xfdddac[_0x3b148c(0xcf)](_0x3b148c(0xdd)))return console[_0x3b148c(0xb1)](a28_0x119a36[_0x3b148c(0xbb)](_0x3b148c(0xd0)+_0xfdddac+'\x0a')),0x1;_0x30baf3=[_0xfdddac];}else _0x30baf3=findYamlFiles(_0x4542ef);if(_0x30baf3['length']===0x0)return console[_0x3b148c(0xb1)](a28_0x119a36[_0x3b148c(0xbb)](_0x3b148c(0xc2)+_0x4542ef+'\x0a')),0x1;const _0xa854ab=validateYamlFiles(_0x30baf3,_0x4542ef,{'filterType':_0x3b148c(0xe9)}),_0x11220f=calculateSummary(_0xa854ab),_0x277dbb=_0xa854ab[_0x3b148c(0xe5)](isValidationResult);if(_0x277dbb['length']===0x0)return console[_0x3b148c(0xb1)](a28_0x119a36[_0x3b148c(0xd3)](_0x3b148c(0xd2)+_0x4542ef+'\x0a')),_0x11220f['skippedCount']>0x0&&console[_0x3b148c(0xb1)](a28_0x119a36[_0x3b148c(0xe6)]('('+_0x11220f['skippedCount']+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x44c375 of _0xa854ab){if(!isValidationResult(_0x44c375)){_0x3e8d74['verbose']&&console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xe6)]('-\x20'+_0x44c375[_0x3b148c(0xd5)]+_0x3b148c(0xdb)+_0x44c375[_0x3b148c(0xda)]+')'));continue;}const {relativePath:_0x26d72c,source:_0x20bb8d,result:_0x599c14}=_0x44c375;if(_0x599c14[_0x3b148c(0xaf)]&&_0x599c14[_0x3b148c(0xb7)][_0x3b148c(0xcd)]===0x0)_0x3e8d74[_0x3b148c(0xb2)]&&console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xcb)]('✔\x20'+_0x26d72c));else _0x599c14[_0x3b148c(0xaf)]?(console[_0x3b148c(0xe1)](a28_0x119a36['yellow']('⚠\x20'+_0x26d72c+':\x20'+_0x599c14[_0x3b148c(0xb7)]['length']+_0x3b148c(0xb4))),console[_0x3b148c(0xe1)](formatValidationResult(_0x599c14,_0x20bb8d,_0x26d72c))):(console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xbb)]('✖\x20'+_0x26d72c+':\x20'+_0x599c14[_0x3b148c(0xeb)][_0x3b148c(0xcd)]+_0x3b148c(0xe7))),console[_0x3b148c(0xe1)](formatValidationResult(_0x599c14,_0x20bb8d,_0x26d72c)));}return console[_0x3b148c(0xe1)](''),_0x11220f[_0x3b148c(0xb3)]?(console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xbb)]('Validation\x20failed:\x20'+_0x11220f[_0x3b148c(0xb6)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x11220f[_0x3b148c(0xdc)]+_0x3b148c(0xc8))),_0x11220f['warningCount']>0x0&&console['log'](a28_0x119a36[_0x3b148c(0xd3)](_0x11220f[_0x3b148c(0xc9)]+_0x3b148c(0xbd))),_0x11220f['skippedCount']>0x0&&console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xe6)](_0x11220f[_0x3b148c(0xc4)]+_0x3b148c(0xba))),0x1):(console['log'](a28_0x119a36[_0x3b148c(0xcb)](_0x3b148c(0xd8)+_0x11220f['validCount']+_0x3b148c(0xe8))),_0x11220f['warningCount']>0x0&&console['log'](a28_0x119a36['yellow'](_0x11220f[_0x3b148c(0xc9)]+_0x3b148c(0xbd))),_0x11220f[_0x3b148c(0xc4)]>0x0&&console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xe6)](_0x11220f[_0x3b148c(0xc4)]+_0x3b148c(0xba))),0x0);}}