@treasuredata/tdx 2026.4.0 → 2026.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/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.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a25_0x188d41=a25_0x2e09;(function(_0x46c7ea,_0x212b44){const _0x959938=a25_0x2e09,_0x6b42f5=_0x46c7ea();while(!![]){try{const _0xb35b97=-parseInt(_0x959938(0x8f))/0x1*(-parseInt(_0x959938(0x97))/0x2)+-parseInt(_0x959938(0xae))/0x3+parseInt(_0x959938(0x9f))/0x4*(parseInt(_0x959938(0xaa))/0x5)+parseInt(_0x959938(0xac))/0x6+parseInt(_0x959938(0x9b))/0x7+-parseInt(_0x959938(0x90))/0x8*(parseInt(_0x959938(0x9d))/0x9)+parseInt(_0x959938(0xa3))/0xa*(-parseInt(_0x959938(0x8b))/0xb);if(_0xb35b97===_0x212b44)break;else _0x6b42f5['push'](_0x6b42f5['shift']());}catch(_0x2782ef){_0x6b42f5['push'](_0x6b42f5['shift']());}}}(a25_0x4743,0x4d548));function a25_0x2e09(_0x3bb599,_0xa9b58d){_0x3bb599=_0x3bb599-0x87;const _0x4743d2=a25_0x4743();let _0x2e09df=_0x4743d2[_0x3bb599];return _0x2e09df;}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x2989ef from'chalk';import a25_0x55b1cc 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_0x188d41(0x88)]=a25_0x188d41(0x8c);['description']=a25_0x188d41(0x87);async[a25_0x188d41(0xa6)](_0x40dcec){const _0x3b08bf=a25_0x188d41,{options:_0x43d360,args:_0x5844d3}=_0x40dcec,_0x4327c2=_0x43d360,_0x2cac4c=_0x5844d3[0x0],_0x17471b=_0x2cac4c?a25_0x55b1cc[_0x3b08bf(0xa4)](_0x2cac4c):undefined,_0x3678fe=_0x17471b?isYamlFile(_0x17471b):![];let _0x23d3a8,_0xfacb57;if(_0x3678fe&&_0x17471b)_0x23d3a8=a25_0x55b1cc[_0x3b08bf(0xaf)](_0x17471b),_0xfacb57=_0x17471b;else _0x17471b?_0x23d3a8=_0x17471b:_0x23d3a8=process[_0x3b08bf(0x8e)]();if(!_0xfacb57&&!existsSync(_0x23d3a8))return console[_0x3b08bf(0xad)](a25_0x2989ef[_0x3b08bf(0x99)]('Error:\x20Directory\x20not\x20found:\x20'+_0x23d3a8+'\x0a')),0x1;let _0x5b24e4;if(_0xfacb57){if(!_0xfacb57[_0x3b08bf(0x98)]('.yml')&&!_0xfacb57[_0x3b08bf(0x98)](_0x3b08bf(0x92)))return console['error'](a25_0x2989ef['red'](_0x3b08bf(0xa8)+_0xfacb57+'\x0a')),0x1;_0x5b24e4=[_0xfacb57];}else _0x5b24e4=findYamlFiles(_0x23d3a8);if(_0x5b24e4[_0x3b08bf(0xab)]===0x0)return console['error'](a25_0x2989ef['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x23d3a8+'\x0a')),0x1;const _0x8a6381=validateYamlFiles(_0x5b24e4,_0x23d3a8,{'filterType':_0x3b08bf(0x9e)}),_0xa0f271=calculateSummary(_0x8a6381),_0x5a55cc=_0x8a6381[_0x3b08bf(0x94)](isValidationResult);if(_0x5a55cc[_0x3b08bf(0xab)]===0x0)return console['error'](a25_0x2989ef[_0x3b08bf(0xa5)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x23d3a8+'\x0a')),_0xa0f271[_0x3b08bf(0xa1)]>0x0&&console[_0x3b08bf(0xad)](a25_0x2989ef[_0x3b08bf(0xb0)]('('+_0xa0f271['skippedCount']+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x366429 of _0x8a6381){if(!isValidationResult(_0x366429)){_0x4327c2[_0x3b08bf(0x9a)]&&console['log'](a25_0x2989ef[_0x3b08bf(0xb0)]('-\x20'+_0x366429['relativePath']+_0x3b08bf(0xb3)+_0x366429[_0x3b08bf(0x96)]+')'));continue;}const {relativePath:_0x53a97c,source:_0xa6b932,result:_0x3c7314}=_0x366429;if(_0x3c7314[_0x3b08bf(0xb1)]&&_0x3c7314['warnings'][_0x3b08bf(0xab)]===0x0)_0x4327c2[_0x3b08bf(0x9a)]&&console['log'](a25_0x2989ef[_0x3b08bf(0xb5)]('✔\x20'+_0x53a97c));else _0x3c7314['valid']?(console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0xa5)]('⚠\x20'+_0x53a97c+':\x20'+_0x3c7314['warnings'][_0x3b08bf(0xab)]+_0x3b08bf(0x93))),console[_0x3b08bf(0x95)](formatValidationResult(_0x3c7314,_0xa6b932,_0x53a97c))):(console[_0x3b08bf(0x95)](a25_0x2989ef['red']('✖\x20'+_0x53a97c+':\x20'+_0x3c7314['errors']['length']+'\x20error(s)')),console[_0x3b08bf(0x95)](formatValidationResult(_0x3c7314,_0xa6b932,_0x53a97c)));}return console[_0x3b08bf(0x95)](''),_0xa0f271[_0x3b08bf(0xb4)]?(console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0x99)](_0x3b08bf(0xa0)+_0xa0f271[_0x3b08bf(0x8d)]+_0x3b08bf(0xa9)+_0xa0f271[_0x3b08bf(0xa2)]+_0x3b08bf(0x89))),_0xa0f271[_0x3b08bf(0x91)]>0x0&&console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0xa5)](_0xa0f271[_0x3b08bf(0x91)]+_0x3b08bf(0x8a))),_0xa0f271[_0x3b08bf(0xa1)]>0x0&&console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0xb0)](_0xa0f271[_0x3b08bf(0xa1)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0xb5)](_0x3b08bf(0xb2)+_0xa0f271[_0x3b08bf(0xa2)]+_0x3b08bf(0x9c))),_0xa0f271[_0x3b08bf(0x91)]>0x0&&console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0xa5)](_0xa0f271['warningCount']+_0x3b08bf(0x8a))),_0xa0f271[_0x3b08bf(0xa1)]>0x0&&console['log'](a25_0x2989ef[_0x3b08bf(0xb0)](_0xa0f271['skippedCount']+_0x3b08bf(0xa7))),0x0);}}function a25_0x4743(){const _0x120064=['error','728403tvxdSP','dirname','dim','valid','✔\x20All\x20','\x20(skipped:\x20','hasErrors','green','Validate\x20template\x20YAML\x20files','name','\x20valid','\x20warning(s)\x20found','2849tfgBVr','engage:template:validate','invalidCount','cwd','6985edDodx','264ZybRwa','warningCount','.yaml','\x20warning(s)','filter','log','reason','158hruUjT','endsWith','red','verbose','2319170foXNMR','\x20template(s)\x20valid','171531cYkqWO','template','108gTtAPz','Validation\x20failed:\x20','skippedCount','validCount','14340XGRqBC','resolve','yellow','execute','\x20non-template\x20file(s)\x20skipped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20template(s)\x20with\x20errors,\x20','74195RDWtJb','length','1656720deLSIP'];a25_0x4743=function(){return _0x120064;};return a25_0x4743();}
1
+ const a25_0xe56529=a25_0x3eeb;(function(_0x2878a3,_0x16b377){const _0x1f87c1=a25_0x3eeb,_0x19a22c=_0x2878a3();while(!![]){try{const _0x22dc70=parseInt(_0x1f87c1(0xca))/0x1*(parseInt(_0x1f87c1(0xb9))/0x2)+parseInt(_0x1f87c1(0xb1))/0x3+parseInt(_0x1f87c1(0xc2))/0x4*(parseInt(_0x1f87c1(0xd2))/0x5)+-parseInt(_0x1f87c1(0xc7))/0x6+-parseInt(_0x1f87c1(0xd0))/0x7+-parseInt(_0x1f87c1(0xc3))/0x8*(-parseInt(_0x1f87c1(0xb2))/0x9)+-parseInt(_0x1f87c1(0xb7))/0xa;if(_0x22dc70===_0x16b377)break;else _0x19a22c['push'](_0x19a22c['shift']());}catch(_0x472b32){_0x19a22c['push'](_0x19a22c['shift']());}}}(a25_0x5a6e,0xe24f7));import{BaseCommand}from'./command.js';function a25_0x3eeb(_0x8638a4,_0x506dff){_0x8638a4=_0x8638a4-0xa7;const _0x5a6e00=a25_0x5a6e();let _0x3eeb3b=_0x5a6e00[_0x8638a4];return _0x3eeb3b;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x2d7e7b from'chalk';function a25_0x5a6e(){const _0x546974=['Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','filter','\x20error(s)','4693980Mwaoli','verbose','1439178SJcnjv','\x20non-template\x20file(s)\x20skipped','invalidCount','length','resolve','warnings','log','warningCount','error','5970252lweiNl','3742712NegQxJ','\x20(skipped:\x20','\x20valid','dirname','8046786lGLuXp','hasErrors','description','1JtrqbP','\x20non-template\x20file(s)\x20skipped)','relativePath','valid','endsWith','validCount','7217413qMLsZk','engage:template:validate','5iryJaM','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20template(s)\x20valid','red','dim','cwd','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','skippedCount','Error:\x20Directory\x20not\x20found:\x20','template','458658ECyBxz','27DJZBEg','reason'];a25_0x5a6e=function(){return _0x546974;};return a25_0x5a6e();}import a25_0xb6c9f5 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']=a25_0xe56529(0xd1);[a25_0xe56529(0xc9)]='Validate\x20template\x20YAML\x20files';async['execute'](_0x3bf3c8){const _0x959964=a25_0xe56529,{options:_0x559565,args:_0x1e63bc}=_0x3bf3c8,_0x32185=_0x559565,_0x4eab11=_0x1e63bc[0x0],_0x5401b5=_0x4eab11?a25_0xb6c9f5[_0x959964(0xbd)](_0x4eab11):undefined,_0x5322ec=_0x5401b5?isYamlFile(_0x5401b5):![];let _0xb1cc46,_0x3ae516;if(_0x5322ec&&_0x5401b5)_0xb1cc46=a25_0xb6c9f5[_0x959964(0xc6)](_0x5401b5),_0x3ae516=_0x5401b5;else _0x5401b5?_0xb1cc46=_0x5401b5:_0xb1cc46=process[_0x959964(0xab)]();if(!_0x3ae516&&!existsSync(_0xb1cc46))return console[_0x959964(0xc1)](a25_0x2d7e7b[_0x959964(0xa9)](_0x959964(0xaf)+_0xb1cc46+'\x0a')),0x1;let _0x1196c1;if(_0x3ae516){if(!_0x3ae516[_0x959964(0xce)]('.yml')&&!_0x3ae516[_0x959964(0xce)]('.yaml'))return console[_0x959964(0xc1)](a25_0x2d7e7b[_0x959964(0xa9)](_0x959964(0xb4)+_0x3ae516+'\x0a')),0x1;_0x1196c1=[_0x3ae516];}else _0x1196c1=findYamlFiles(_0xb1cc46);if(_0x1196c1[_0x959964(0xbc)]===0x0)return console[_0x959964(0xc1)](a25_0x2d7e7b[_0x959964(0xa9)](_0x959964(0xac)+_0xb1cc46+'\x0a')),0x1;const _0x46b92d=validateYamlFiles(_0x1196c1,_0xb1cc46,{'filterType':_0x959964(0xb0)}),_0xfc8477=calculateSummary(_0x46b92d),_0x233cf1=_0x46b92d[_0x959964(0xb5)](isValidationResult);if(_0x233cf1[_0x959964(0xbc)]===0x0)return console[_0x959964(0xc1)](a25_0x2d7e7b[_0x959964(0xad)](_0x959964(0xa7)+_0xb1cc46+'\x0a')),_0xfc8477['skippedCount']>0x0&&console[_0x959964(0xc1)](a25_0x2d7e7b[_0x959964(0xaa)]('('+_0xfc8477['skippedCount']+_0x959964(0xcb))),0x0;for(const _0x1d5fd5 of _0x46b92d){if(!isValidationResult(_0x1d5fd5)){_0x32185['verbose']&&console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xaa)]('-\x20'+_0x1d5fd5[_0x959964(0xcc)]+_0x959964(0xc4)+_0x1d5fd5[_0x959964(0xb3)]+')'));continue;}const {relativePath:_0x28bce6,source:_0xbfefa5,result:_0x566ee6}=_0x1d5fd5;if(_0x566ee6[_0x959964(0xcd)]&&_0x566ee6['warnings'][_0x959964(0xbc)]===0x0)_0x32185[_0x959964(0xb8)]&&console[_0x959964(0xbf)](a25_0x2d7e7b['green']('✔\x20'+_0x28bce6));else _0x566ee6[_0x959964(0xcd)]?(console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xad)]('⚠\x20'+_0x28bce6+':\x20'+_0x566ee6[_0x959964(0xbe)][_0x959964(0xbc)]+'\x20warning(s)')),console[_0x959964(0xbf)](formatValidationResult(_0x566ee6,_0xbfefa5,_0x28bce6))):(console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xa9)]('✖\x20'+_0x28bce6+':\x20'+_0x566ee6['errors'][_0x959964(0xbc)]+_0x959964(0xb6))),console[_0x959964(0xbf)](formatValidationResult(_0x566ee6,_0xbfefa5,_0x28bce6)));}return console[_0x959964(0xbf)](''),_0xfc8477[_0x959964(0xc8)]?(console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xa9)]('Validation\x20failed:\x20'+_0xfc8477[_0x959964(0xbb)]+'\x20template(s)\x20with\x20errors,\x20'+_0xfc8477[_0x959964(0xcf)]+_0x959964(0xc5))),_0xfc8477[_0x959964(0xc0)]>0x0&&console[_0x959964(0xbf)](a25_0x2d7e7b['yellow'](_0xfc8477[_0x959964(0xc0)]+'\x20warning(s)\x20found')),_0xfc8477['skippedCount']>0x0&&console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xaa)](_0xfc8477['skippedCount']+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x959964(0xbf)](a25_0x2d7e7b['green']('✔\x20All\x20'+_0xfc8477[_0x959964(0xcf)]+_0x959964(0xa8))),_0xfc8477[_0x959964(0xc0)]>0x0&&console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xad)](_0xfc8477[_0x959964(0xc0)]+'\x20warning(s)\x20found')),_0xfc8477[_0x959964(0xae)]>0x0&&console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xaa)](_0xfc8477['skippedCount']+_0x959964(0xba))),0x0);}}
@@ -1 +1 @@
1
- const a26_0x2e5cc9=a26_0x42b9;function a26_0x42b9(_0x594c94,_0x904da){_0x594c94=_0x594c94-0x153;const _0x460002=a26_0x4600();let _0x42b9a0=_0x460002[_0x594c94];return _0x42b9a0;}(function(_0x417099,_0x2763a7){const _0x1e68a5=a26_0x42b9,_0x529cc9=_0x417099();while(!![]){try{const _0x439222=-parseInt(_0x1e68a5(0x17c))/0x1*(-parseInt(_0x1e68a5(0x176))/0x2)+parseInt(_0x1e68a5(0x18a))/0x3+parseInt(_0x1e68a5(0x18b))/0x4*(parseInt(_0x1e68a5(0x188))/0x5)+parseInt(_0x1e68a5(0x192))/0x6*(parseInt(_0x1e68a5(0x168))/0x7)+parseInt(_0x1e68a5(0x155))/0x8+parseInt(_0x1e68a5(0x165))/0x9+parseInt(_0x1e68a5(0x189))/0xa*(-parseInt(_0x1e68a5(0x17d))/0xb);if(_0x439222===_0x2763a7)break;else _0x529cc9['push'](_0x529cc9['shift']());}catch(_0x2d9f27){_0x529cc9['push'](_0x529cc9['shift']());}}}(a26_0x4600,0x2ada2));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';function a26_0x4600(){const _0xb91505=['dim','presto','6875LBtgbs','1640140DmGsSH','532581AdWPxc','460wbOMxz','job:kill','database','INVALID_ARGUMENT','...','✔\x20Retrieved\x20','verbose','6zcXOwe','list','substring','d\x20ago','log','Database:\x20','type','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','green','show','validate','mo\x20ago','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','kill','success','Get\x20job\x20results','trino','args','result','Getting\x20job\x20details...','job:result','abs','status','job:submit','name','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','1494896EdbnbA','getTime','limit','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','map','Submitting\x20job...','Getting\x20job\x20results...','url','m\x20ago','✔\x20Found\x20','Listing\x20jobs...','execute','description','push','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','No\x20SQL\x20statements\x20found\x20in\x20file','415971EMGkHD','Kill\x20a\x20job','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','363587FxbQgH','error','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','priority','submit','Submitting\x20kill\x20request...','start_at','Limit:\x20','query','job_id','length','Submit\x20a\x20job','end_at','debug','60OLfdaY','user_name','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','\x20row','yes','jobType','1563DJqNhs','33TAadpn','data','Show\x20job\x20details','List\x20jobs','created_at','floor','jobs','✔\x20Job\x20submitted','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'];a26_0x4600=function(){return _0xb91505;};return a26_0x4600();}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x1dc756 from'chalk';function formatDuration(_0xa70931){const _0x2dcac9=a26_0x42b9;if(_0xa70931<0x3c)return _0xa70931+'s';if(_0xa70931<0xe10)return Math['floor'](_0xa70931/0x3c)+'m\x20'+_0xa70931%0x3c+'s';const _0x32c156=Math['floor'](_0xa70931/0xe10),_0x32804a=Math[_0x2dcac9(0x182)](_0xa70931%0xe10/0x3c);return _0x32804a>0x0?_0x32c156+'h\x20'+_0x32804a+'m':_0x32c156+'h';}function formatRelativeTime(_0xb563a2){const _0x508204=a26_0x42b9,_0x553346=Date['now']()-_0xb563a2[_0x508204(0x156)](),_0x33abb5=Math[_0x508204(0x182)](Math[_0x508204(0x1a7)](_0x553346)/0x3e8);if(_0x33abb5<0x3c)return'just\x20now';const _0x5891d9=Math[_0x508204(0x182)](_0x33abb5/0x3c);if(_0x5891d9<0x3c)return _0x5891d9+_0x508204(0x15d);const _0x19d35f=Math[_0x508204(0x182)](_0x5891d9/0x3c);if(_0x19d35f<0x18)return _0x19d35f+'h\x20ago';const _0x4100db=Math[_0x508204(0x182)](_0x19d35f/0x18);if(_0x4100db<0x1e)return _0x4100db+_0x508204(0x195);return Math[_0x508204(0x182)](_0x4100db/0x1e)+_0x508204(0x19d);}export class JobListCommand extends BaseCommand{[a26_0x2e5cc9(0x153)]=a26_0x2e5cc9(0x183);[a26_0x2e5cc9(0x161)]=a26_0x2e5cc9(0x180);async[a26_0x2e5cc9(0x160)](_0x3d0b4e){const _0x5f5c9b=a26_0x2e5cc9,{options:_0x5e9071,tdx:_0x362a5d}=_0x3d0b4e,_0x2bd87f=resolveLimit(_0x5e9071[_0x5f5c9b(0x157)],DEFAULT_DISPLAY_LIMIT),_0x25ce4d=_0x5e9071[_0x5f5c9b(0x1a8)];_0x5e9071[_0x5f5c9b(0x191)]&&(console[_0x5f5c9b(0x169)](_0x5f5c9b(0x16f)+_0x2bd87f+'\x20jobs'),_0x25ce4d&&console[_0x5f5c9b(0x169)]('Status\x20filter:\x20'+_0x25ce4d));const _0x5bdca4=await withSpinner(_0x5f5c9b(0x15f),()=>_0x362a5d[_0x5f5c9b(0x183)][_0x5f5c9b(0x193)]({'from':0x0,'to':_0x2bd87f-0x1,'status':_0x25ce4d}),{'verbose':_0x5e9071[_0x5f5c9b(0x191)]}),_0x150768=_0x5bdca4[_0x5f5c9b(0x17e)];console[_0x5f5c9b(0x169)](_0x5f5c9b(0x15e)+_0x150768[_0x5f5c9b(0x172)]+'\x20job'+(_0x150768[_0x5f5c9b(0x172)]!==0x1?'s':''));const _0x4ebf72=_0x5e9071['site'];if(isStructuredFormat(_0x5e9071)){const _0x155f86=_0x150768[_0x5f5c9b(0x159)](_0x394d76=>{const _0x2c4861=_0x5f5c9b;let _0x492284;if(_0x394d76[_0x2c4861(0x16e)]&&_0x394d76['end_at']){const _0x2e7430=new Date(_0x394d76[_0x2c4861(0x16e)])[_0x2c4861(0x156)](),_0x28fe24=new Date(_0x394d76[_0x2c4861(0x174)])['getTime']();_0x492284=Math['round']((_0x28fe24-_0x2e7430)/0x3e8);}return{'job_id':_0x394d76['job_id'],'type':_0x394d76[_0x2c4861(0x198)]===_0x2c4861(0x187)?_0x2c4861(0x1a2):_0x394d76[_0x2c4861(0x198)],'status':_0x394d76[_0x2c4861(0x1a8)],'user_name':_0x394d76[_0x2c4861(0x177)],'duration_sec':_0x492284,'created_at':_0x394d76[_0x2c4861(0x181)],'started_at':_0x394d76['start_at'],'end_at':_0x394d76[_0x2c4861(0x174)]};});await handleSDKOutput(_0x155f86,_0x5e9071);}else for(const _0x481501 of _0x150768){const _0x2bcd50=_0x481501[_0x5f5c9b(0x1a8)]===_0x5f5c9b(0x1a0)?a26_0x1dc756[_0x5f5c9b(0x19a)]:_0x481501[_0x5f5c9b(0x1a8)]===_0x5f5c9b(0x169)?a26_0x1dc756['red']:a26_0x1dc756[_0x5f5c9b(0x186)],_0x335588=_0x2bcd50(_0x481501[_0x5f5c9b(0x1a8)]),_0x57036d=getJobUrl(_0x4ebf72,_0x481501[_0x5f5c9b(0x171)]),_0x55bf24=hyperlink(_0x481501[_0x5f5c9b(0x171)],_0x57036d),_0x2ae34a=a26_0x1dc756['dim'](_0x481501[_0x5f5c9b(0x198)]===_0x5f5c9b(0x187)?_0x5f5c9b(0x1a2):_0x481501[_0x5f5c9b(0x198)]),_0xd7e3c6=[];if(_0x481501[_0x5f5c9b(0x16e)]&&_0x481501[_0x5f5c9b(0x174)]){const _0x36838d=Math['round']((new Date(_0x481501[_0x5f5c9b(0x174)])['getTime']()-new Date(_0x481501['start_at'])[_0x5f5c9b(0x156)]())/0x3e8);_0xd7e3c6[_0x5f5c9b(0x162)](formatDuration(_0x36838d));}if(_0x481501['end_at'])_0xd7e3c6[_0x5f5c9b(0x162)](formatRelativeTime(new Date(_0x481501['end_at'])));else _0x481501[_0x5f5c9b(0x16e)]&&_0xd7e3c6[_0x5f5c9b(0x162)](formatRelativeTime(new Date(_0x481501[_0x5f5c9b(0x16e)])));const _0x3f02df=_0xd7e3c6['length']>0x0?a26_0x1dc756[_0x5f5c9b(0x186)]('\x20'+_0xd7e3c6['join'](',\x20')):'';console[_0x5f5c9b(0x196)]('⚡\x20'+_0x55bf24+'\x20'+_0x2ae34a+'\x20'+_0x335588+_0x3f02df);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']='job:show';[a26_0x2e5cc9(0x161)]=a26_0x2e5cc9(0x17f);[a26_0x2e5cc9(0x19c)](_0x44f9b9){const _0x590cd1=a26_0x2e5cc9,_0x3b37ed=_0x44f9b9[_0x590cd1(0x1a3)][0x0];if(!_0x3b37ed)return _0x590cd1(0x178);return undefined;}async['execute'](_0x251d76){const _0x25223e=a26_0x2e5cc9,{options:_0x5dd776,args:_0x257a57,tdx:_0x59d781}=_0x251d76,_0x20e9f4=_0x257a57[0x0],_0x25c7d6=await withSpinner(_0x25223e(0x1a5),()=>_0x59d781[_0x25223e(0x183)][_0x25223e(0x19b)](_0x20e9f4),{'verbose':_0x5dd776[_0x25223e(0x191)]}),_0x49fbb8=_0x25c7d6[_0x25223e(0x17e)];let _0x3a9219;if(_0x49fbb8[_0x25223e(0x16e)]&&_0x49fbb8[_0x25223e(0x174)]){const _0x270a68=new Date(_0x49fbb8[_0x25223e(0x16e)])[_0x25223e(0x156)](),_0x1a9d1b=new Date(_0x49fbb8[_0x25223e(0x174)])[_0x25223e(0x156)]();_0x3a9219=Math['round']((_0x1a9d1b-_0x270a68)/0x3e8);}const _0x918a07={'job_id':_0x49fbb8['job_id'],'type':_0x49fbb8[_0x25223e(0x198)],'status':_0x49fbb8[_0x25223e(0x1a8)],..._0x49fbb8[_0x25223e(0x177)]&&{'user_name':_0x49fbb8[_0x25223e(0x177)]},..._0x3a9219!==undefined&&{'duration_sec':_0x3a9219},..._0x49fbb8[_0x25223e(0x181)]&&{'created_at':_0x49fbb8['created_at']},..._0x49fbb8[_0x25223e(0x16e)]&&{'started_at':_0x49fbb8['start_at']},..._0x49fbb8[_0x25223e(0x174)]&&{'end_at':_0x49fbb8[_0x25223e(0x174)]},..._0x49fbb8['database']&&{'database':_0x49fbb8[_0x25223e(0x18d)]},..._0x49fbb8['priority']!==undefined&&{'priority':_0x49fbb8[_0x25223e(0x16b)]},..._0x49fbb8[_0x25223e(0x15c)]&&{'url':_0x49fbb8['url']},..._0x49fbb8['query']&&{'query':_0x49fbb8[_0x25223e(0x170)]},..._0x49fbb8[_0x25223e(0x175)]&&{'debug':_0x49fbb8[_0x25223e(0x175)]}};return await handleSingleObjectOutput(_0x918a07,_0x5dd776),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x2e5cc9(0x153)]=a26_0x2e5cc9(0x18c);['description']=a26_0x2e5cc9(0x166);['validate'](_0x40b8d2){const _0x575548=a26_0x2e5cc9,_0x1465d6=_0x40b8d2[_0x575548(0x1a3)][0x0];if(!_0x1465d6)return _0x575548(0x163);return undefined;}async[a26_0x2e5cc9(0x160)](_0x3c51b7){const _0x3267e0=a26_0x2e5cc9,{options:_0x4c2e8e,args:_0x4af19d,tdx:_0x6e2583}=_0x3c51b7,_0x36b1aa=_0x4af19d[0x0];if(!_0x4c2e8e[_0x3267e0(0x17a)]){const _0x325467=await confirm(_0x3267e0(0x19e)+_0x36b1aa+'?');if(!_0x325467)return console['error']('Cancelled'),0x0;}return await withSpinner(_0x3267e0(0x16d),()=>_0x6e2583['jobs'][_0x3267e0(0x19f)](_0x36b1aa),{'verbose':_0x4c2e8e['verbose']}),console[_0x3267e0(0x169)](_0x3267e0(0x154)+_0x36b1aa),console['error'](_0x3267e0(0x167)+_0x36b1aa+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x2e5cc9(0x153)]=a26_0x2e5cc9(0x1a9);['description']=a26_0x2e5cc9(0x173);async[a26_0x2e5cc9(0x160)](_0x3b8394){const _0x157188=a26_0x2e5cc9,{options:_0x9a984,args:_0x21616e,tdx:_0x173f8f}=_0x3b8394,_0x425b7c=_0x9a984[_0x157188(0x17b)]||_0x157188(0x1a2),_0x26eb14=_0x9a984['file'],_0x2f9729=_0x9a984['database']||'information_schema',_0x4487dc=_0x9a984['result'];if(_0x425b7c!==_0x157188(0x1a2)&&_0x425b7c!=='hive')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x157188(0x16a));let _0x1b705f;if(_0x26eb14){if(_0x21616e[0x0])throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x158));const _0x25d03a=readSqlStatementsFromFile(_0x26eb14);if(_0x25d03a[_0x157188(0x172)]===0x0)throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x164));if(_0x25d03a[_0x157188(0x172)]>0x1)throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x185));_0x1b705f=_0x25d03a[0x0];}else{if(!_0x21616e[0x0])throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x199));_0x1b705f=_0x21616e[0x0];}_0x9a984[_0x157188(0x191)]&&(console[_0x157188(0x169)]('Job\x20type:\x20'+_0x425b7c),console['error'](_0x157188(0x197)+_0x2f9729),console['error']('Query:\x20'+_0x1b705f[_0x157188(0x194)](0x0,0x64)+(_0x1b705f[_0x157188(0x172)]>0x64?_0x157188(0x18f):'')));const _0x44f162=await withSpinner(_0x157188(0x15a),()=>_0x173f8f[_0x157188(0x183)][_0x157188(0x16c)](_0x2f9729,_0x1b705f,_0x425b7c,_0x4487dc),{'verbose':_0x9a984[_0x157188(0x191)]}),_0x25fec7=_0x44f162[_0x157188(0x17e)];return console[_0x157188(0x169)](_0x157188(0x184)),console[_0x157188(0x169)]('\x20\x20Job\x20ID:\x20'+_0x25fec7[_0x157188(0x171)]),await handleSDKOutput([_0x25fec7],_0x9a984),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a26_0x2e5cc9(0x1a6);[a26_0x2e5cc9(0x161)]=a26_0x2e5cc9(0x1a1);[a26_0x2e5cc9(0x19c)](_0x8e2ef1){const _0x4c216a=a26_0x2e5cc9,_0xc95241=_0x8e2ef1[_0x4c216a(0x1a3)][0x0];if(!_0xc95241)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x2e5cc9(0x160)](_0x539c26){const _0x59575b=a26_0x2e5cc9,{options:_0x3872a9,args:_0x48305c,tdx:_0xba2d6d}=_0x539c26,_0x5b0607=_0x48305c[0x0],_0x23ed90=await withSpinner(_0x59575b(0x15b),()=>_0xba2d6d[_0x59575b(0x183)][_0x59575b(0x1a4)](_0x5b0607),{'verbose':_0x3872a9['verbose']}),_0x5659d8=_0x23ed90[_0x59575b(0x17e)];return console[_0x59575b(0x169)](_0x59575b(0x190)+_0x5659d8[_0x59575b(0x172)]+_0x59575b(0x179)+(_0x5659d8[_0x59575b(0x172)]!==0x1?'s':'')),await handleSDKOutput(_0x5659d8,_0x3872a9),0x0;}}
1
+ function a26_0x5cc0(){const _0x305827=['...','595WxrBRQ','8496UgyHav','end_at','green','✔\x20Job\x20submitted','dim','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','floor','\x20jobs','7TLeiWo','5240740UOCPOi','job:submit','status','375322hdkFse','✔\x20Found\x20','trino','job_id','abs','push','\x20row','limit','length','validate','start_at','Cancelled','created_at','d\x20ago','Submitting\x20kill\x20request...','query','86679AMtjTq','INVALID_ARGUMENT','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','success','red','args','kill','Getting\x20job\x20details...','Kill\x20a\x20job','debug','submit','58hwlsPN','site','Query:\x20','hive','✔\x20Retrieved\x20','list','getTime','yes','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','map','Get\x20job\x20results','name','11323017adZYDu','26586naWJMD','result','database','type','join','description','5781212wVOIxx','log','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','user_name','Getting\x20job\x20results...','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','now','just\x20now','\x20job','Limit:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','\x20\x20Job\x20ID:\x20','Database:\x20','data','Submit\x20a\x20job','url','round','List\x20jobs','error','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','jobs','priority','Submitting\x20job...','verbose','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','m\x20ago','presto','information_schema','execute','substring'];a26_0x5cc0=function(){return _0x305827;};return a26_0x5cc0();}const a26_0x1d4acc=a26_0xc74b;(function(_0x507704,_0x46e91c){const _0x17502f=a26_0xc74b,_0x441e08=_0x507704();while(!![]){try{const _0x3a53a3=parseInt(_0x17502f(0x137))/0x1+-parseInt(_0x17502f(0x152))/0x2*(parseInt(_0x17502f(0x147))/0x3)+parseInt(_0x17502f(0x165))/0x4+parseInt(_0x17502f(0x185))/0x5*(parseInt(_0x17502f(0x15f))/0x6)+parseInt(_0x17502f(0x18e))/0x7*(-parseInt(_0x17502f(0x186))/0x8)+-parseInt(_0x17502f(0x15e))/0x9+parseInt(_0x17502f(0x134))/0xa;if(_0x3a53a3===_0x46e91c)break;else _0x441e08['push'](_0x441e08['shift']());}catch(_0x299ddd){_0x441e08['push'](_0x441e08['shift']());}}}(a26_0x5cc0,0xbd304));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a26_0xc74b(_0x7984d7,_0x2f29bb){_0x7984d7=_0x7984d7-0x134;const _0x5cc0d9=a26_0x5cc0();let _0xc74bf1=_0x5cc0d9[_0x7984d7];return _0xc74bf1;}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_0x196743 from'chalk';function formatDuration(_0x1f67a2){const _0x32dc28=a26_0xc74b;if(_0x1f67a2<0x3c)return _0x1f67a2+'s';if(_0x1f67a2<0xe10)return Math[_0x32dc28(0x18c)](_0x1f67a2/0x3c)+'m\x20'+_0x1f67a2%0x3c+'s';const _0x1d7170=Math[_0x32dc28(0x18c)](_0x1f67a2/0xe10),_0x4a0b1c=Math[_0x32dc28(0x18c)](_0x1f67a2%0xe10/0x3c);return _0x4a0b1c>0x0?_0x1d7170+'h\x20'+_0x4a0b1c+'m':_0x1d7170+'h';}function formatRelativeTime(_0x2cf840){const _0x5ea374=a26_0xc74b,_0x211012=Date[_0x5ea374(0x16c)]()-_0x2cf840[_0x5ea374(0x158)](),_0x3e879c=Math['floor'](Math[_0x5ea374(0x13b)](_0x211012)/0x3e8);if(_0x3e879c<0x3c)return _0x5ea374(0x16d);const _0x7abc6a=Math[_0x5ea374(0x18c)](_0x3e879c/0x3c);if(_0x7abc6a<0x3c)return _0x7abc6a+_0x5ea374(0x17f);const _0x1a491b=Math[_0x5ea374(0x18c)](_0x7abc6a/0x3c);if(_0x1a491b<0x18)return _0x1a491b+'h\x20ago';const _0xe85f88=Math['floor'](_0x1a491b/0x18);if(_0xe85f88<0x1e)return _0xe85f88+_0x5ea374(0x144);return Math[_0x5ea374(0x18c)](_0xe85f88/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x1d4acc(0x15d)]=a26_0x1d4acc(0x17a);[a26_0x1d4acc(0x164)]=a26_0x1d4acc(0x177);async[a26_0x1d4acc(0x182)](_0x5c472b){const _0x54b851=a26_0x1d4acc,{options:_0x5e5103,tdx:_0xb5e3d8}=_0x5c472b,_0x992dec=resolveLimit(_0x5e5103[_0x54b851(0x13e)],DEFAULT_DISPLAY_LIMIT),_0xc958bf=_0x5e5103['status'];_0x5e5103[_0x54b851(0x17d)]&&(console[_0x54b851(0x178)](_0x54b851(0x16f)+_0x992dec+_0x54b851(0x18d)),_0xc958bf&&console[_0x54b851(0x178)]('Status\x20filter:\x20'+_0xc958bf));const _0x1cb1ec=await withSpinner('Listing\x20jobs...',()=>_0xb5e3d8[_0x54b851(0x17a)][_0x54b851(0x157)]({'from':0x0,'to':_0x992dec-0x1,'status':_0xc958bf}),{'verbose':_0x5e5103[_0x54b851(0x17d)]}),_0x5a0fb8=_0x1cb1ec[_0x54b851(0x173)];console[_0x54b851(0x178)](_0x54b851(0x138)+_0x5a0fb8[_0x54b851(0x13f)]+_0x54b851(0x16e)+(_0x5a0fb8[_0x54b851(0x13f)]!==0x1?'s':''));const _0x279660=_0x5e5103[_0x54b851(0x153)];if(isStructuredFormat(_0x5e5103)){const _0x54f6cc=_0x5a0fb8[_0x54b851(0x15b)](_0x54911f=>{const _0x223a82=_0x54b851;let _0x1382f7;if(_0x54911f[_0x223a82(0x141)]&&_0x54911f[_0x223a82(0x187)]){const _0x457314=new Date(_0x54911f[_0x223a82(0x141)])[_0x223a82(0x158)](),_0x5c6d4c=new Date(_0x54911f[_0x223a82(0x187)])['getTime']();_0x1382f7=Math[_0x223a82(0x176)]((_0x5c6d4c-_0x457314)/0x3e8);}return{'job_id':_0x54911f[_0x223a82(0x13a)],'type':_0x54911f[_0x223a82(0x162)]===_0x223a82(0x180)?_0x223a82(0x139):_0x54911f[_0x223a82(0x162)],'status':_0x54911f[_0x223a82(0x136)],'user_name':_0x54911f[_0x223a82(0x169)],'duration_sec':_0x1382f7,'created_at':_0x54911f[_0x223a82(0x143)],'started_at':_0x54911f[_0x223a82(0x141)],'end_at':_0x54911f[_0x223a82(0x187)]};});await handleSDKOutput(_0x54f6cc,_0x5e5103);}else for(const _0x483843 of _0x5a0fb8){const _0x20e825=_0x483843['status']===_0x54b851(0x14a)?a26_0x196743[_0x54b851(0x188)]:_0x483843[_0x54b851(0x136)]===_0x54b851(0x178)?a26_0x196743[_0x54b851(0x14b)]:a26_0x196743['dim'],_0x2e5b31=_0x20e825(_0x483843[_0x54b851(0x136)]),_0x4cc779=getJobUrl(_0x279660,_0x483843['job_id']),_0x5f2d4d=hyperlink(_0x483843['job_id'],_0x4cc779),_0x399c2e=a26_0x196743[_0x54b851(0x18a)](_0x483843[_0x54b851(0x162)]===_0x54b851(0x180)?_0x54b851(0x139):_0x483843[_0x54b851(0x162)]),_0x21da98=[];if(_0x483843['start_at']&&_0x483843[_0x54b851(0x187)]){const _0x24836f=Math[_0x54b851(0x176)]((new Date(_0x483843[_0x54b851(0x187)])[_0x54b851(0x158)]()-new Date(_0x483843['start_at'])['getTime']())/0x3e8);_0x21da98[_0x54b851(0x13c)](formatDuration(_0x24836f));}if(_0x483843[_0x54b851(0x187)])_0x21da98[_0x54b851(0x13c)](formatRelativeTime(new Date(_0x483843['end_at'])));else _0x483843['start_at']&&_0x21da98[_0x54b851(0x13c)](formatRelativeTime(new Date(_0x483843[_0x54b851(0x141)])));const _0x5ebe89=_0x21da98[_0x54b851(0x13f)]>0x0?a26_0x196743['dim']('\x20'+_0x21da98[_0x54b851(0x163)](',\x20')):'';console[_0x54b851(0x166)]('⚡\x20'+_0x5f2d4d+'\x20'+_0x399c2e+'\x20'+_0x2e5b31+_0x5ebe89);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x1d4acc(0x15d)]='job:show';[a26_0x1d4acc(0x164)]='Show\x20job\x20details';[a26_0x1d4acc(0x140)](_0x1d3954){const _0x5f167e=a26_0x1d4acc,_0x277f3d=_0x1d3954['args'][0x0];if(!_0x277f3d)return _0x5f167e(0x167);return undefined;}async[a26_0x1d4acc(0x182)](_0x13f738){const _0x3d0494=a26_0x1d4acc,{options:_0x4b4e39,args:_0x19f642,tdx:_0x19ee30}=_0x13f738,_0x195974=_0x19f642[0x0],_0x2769d5=await withSpinner(_0x3d0494(0x14e),()=>_0x19ee30[_0x3d0494(0x17a)]['show'](_0x195974),{'verbose':_0x4b4e39[_0x3d0494(0x17d)]}),_0x47b5ff=_0x2769d5[_0x3d0494(0x173)];let _0xae7af6;if(_0x47b5ff[_0x3d0494(0x141)]&&_0x47b5ff[_0x3d0494(0x187)]){const _0xd23e1e=new Date(_0x47b5ff[_0x3d0494(0x141)])[_0x3d0494(0x158)](),_0x12451d=new Date(_0x47b5ff[_0x3d0494(0x187)])[_0x3d0494(0x158)]();_0xae7af6=Math[_0x3d0494(0x176)]((_0x12451d-_0xd23e1e)/0x3e8);}const _0x53ec39={'job_id':_0x47b5ff[_0x3d0494(0x13a)],'type':_0x47b5ff[_0x3d0494(0x162)],'status':_0x47b5ff[_0x3d0494(0x136)],..._0x47b5ff[_0x3d0494(0x169)]&&{'user_name':_0x47b5ff[_0x3d0494(0x169)]},..._0xae7af6!==undefined&&{'duration_sec':_0xae7af6},..._0x47b5ff[_0x3d0494(0x143)]&&{'created_at':_0x47b5ff[_0x3d0494(0x143)]},..._0x47b5ff['start_at']&&{'started_at':_0x47b5ff[_0x3d0494(0x141)]},..._0x47b5ff['end_at']&&{'end_at':_0x47b5ff['end_at']},..._0x47b5ff[_0x3d0494(0x161)]&&{'database':_0x47b5ff[_0x3d0494(0x161)]},..._0x47b5ff['priority']!==undefined&&{'priority':_0x47b5ff[_0x3d0494(0x17b)]},..._0x47b5ff[_0x3d0494(0x175)]&&{'url':_0x47b5ff[_0x3d0494(0x175)]},..._0x47b5ff['query']&&{'query':_0x47b5ff[_0x3d0494(0x146)]},..._0x47b5ff[_0x3d0494(0x150)]&&{'debug':_0x47b5ff['debug']}};return await handleSingleObjectOutput(_0x53ec39,_0x4b4e39),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x1d4acc(0x15d)]='job:kill';[a26_0x1d4acc(0x164)]=a26_0x1d4acc(0x14f);[a26_0x1d4acc(0x140)](_0x7301d5){const _0x43baf1=a26_0x1d4acc,_0x1e5345=_0x7301d5['args'][0x0];if(!_0x1e5345)return _0x43baf1(0x17e);return undefined;}async['execute'](_0x41ccbb){const _0x2488c9=a26_0x1d4acc,{options:_0x5b3e34,args:_0x2be1ed,tdx:_0x643143}=_0x41ccbb,_0x489d30=_0x2be1ed[0x0];if(!_0x5b3e34[_0x2488c9(0x159)]){const _0x25f1e2=await confirm(_0x2488c9(0x18b)+_0x489d30+'?');if(!_0x25f1e2)return console[_0x2488c9(0x178)](_0x2488c9(0x142)),0x0;}return await withSpinner(_0x2488c9(0x145),()=>_0x643143[_0x2488c9(0x17a)][_0x2488c9(0x14d)](_0x489d30),{'verbose':_0x5b3e34[_0x2488c9(0x17d)]}),console['error'](_0x2488c9(0x15a)+_0x489d30),console['error']('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x489d30+_0x2488c9(0x170)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x1d4acc(0x15d)]=a26_0x1d4acc(0x135);[a26_0x1d4acc(0x164)]=a26_0x1d4acc(0x174);async[a26_0x1d4acc(0x182)](_0x1d5afc){const _0x2451bd=a26_0x1d4acc,{options:_0x913978,args:_0x558ebc,tdx:_0x5c9c2f}=_0x1d5afc,_0x33c70e=_0x913978['jobType']||_0x2451bd(0x139),_0xb574be=_0x913978['file'],_0x2cb112=_0x913978[_0x2451bd(0x161)]||_0x2451bd(0x181),_0x5afbaa=_0x913978[_0x2451bd(0x160)];if(_0x33c70e!=='trino'&&_0x33c70e!==_0x2451bd(0x155))throw new SDKError(ErrorCode[_0x2451bd(0x148)],_0x2451bd(0x179));let _0x3d2d68;if(_0xb574be){if(_0x558ebc[0x0])throw new SDKError(ErrorCode[_0x2451bd(0x148)],_0x2451bd(0x16b));const _0x3626b9=readSqlStatementsFromFile(_0xb574be);if(_0x3626b9[_0x2451bd(0x13f)]===0x0)throw new SDKError(ErrorCode[_0x2451bd(0x148)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x3626b9[_0x2451bd(0x13f)]>0x1)throw new SDKError(ErrorCode[_0x2451bd(0x148)],_0x2451bd(0x149));_0x3d2d68=_0x3626b9[0x0];}else{if(!_0x558ebc[0x0])throw new SDKError(ErrorCode[_0x2451bd(0x148)],_0x2451bd(0x168));_0x3d2d68=_0x558ebc[0x0];}_0x913978[_0x2451bd(0x17d)]&&(console[_0x2451bd(0x178)]('Job\x20type:\x20'+_0x33c70e),console[_0x2451bd(0x178)](_0x2451bd(0x172)+_0x2cb112),console[_0x2451bd(0x178)](_0x2451bd(0x154)+_0x3d2d68[_0x2451bd(0x183)](0x0,0x64)+(_0x3d2d68[_0x2451bd(0x13f)]>0x64?_0x2451bd(0x184):'')));const _0x4f5489=await withSpinner(_0x2451bd(0x17c),()=>_0x5c9c2f[_0x2451bd(0x17a)][_0x2451bd(0x151)](_0x2cb112,_0x3d2d68,_0x33c70e,_0x5afbaa),{'verbose':_0x913978[_0x2451bd(0x17d)]}),_0x4ddb35=_0x4f5489[_0x2451bd(0x173)];return console['error'](_0x2451bd(0x189)),console[_0x2451bd(0x178)](_0x2451bd(0x171)+_0x4ddb35[_0x2451bd(0x13a)]),await handleSDKOutput([_0x4ddb35],_0x913978),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x1d4acc(0x15d)]='job:result';[a26_0x1d4acc(0x164)]=a26_0x1d4acc(0x15c);[a26_0x1d4acc(0x140)](_0x31b405){const _0x3e535d=a26_0x1d4acc,_0x16ebb1=_0x31b405[_0x3e535d(0x14c)][0x0];if(!_0x16ebb1)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x1d4acc(0x182)](_0x5e2721){const _0x4b409c=a26_0x1d4acc,{options:_0x4abbdc,args:_0x44ef63,tdx:_0x2ca436}=_0x5e2721,_0x162783=_0x44ef63[0x0],_0x6f25e8=await withSpinner(_0x4b409c(0x16a),()=>_0x2ca436[_0x4b409c(0x17a)][_0x4b409c(0x160)](_0x162783),{'verbose':_0x4abbdc[_0x4b409c(0x17d)]}),_0x338e99=_0x6f25e8['data'];return console[_0x4b409c(0x178)](_0x4b409c(0x156)+_0x338e99[_0x4b409c(0x13f)]+_0x4b409c(0x13d)+(_0x338e99[_0x4b409c(0x13f)]!==0x1?'s':'')),await handleSDKOutput(_0x338e99,_0x4abbdc),0x0;}}
@@ -1 +1 @@
1
- const a27_0x272d82=a27_0x45e0;(function(_0x5e1019,_0x1288f7){const _0x133a5c=a27_0x45e0,_0x379224=_0x5e1019();while(!![]){try{const _0xf98c05=-parseInt(_0x133a5c(0x1d2))/0x1*(-parseInt(_0x133a5c(0x1fc))/0x2)+parseInt(_0x133a5c(0x1a2))/0x3+parseInt(_0x133a5c(0x278))/0x4+parseInt(_0x133a5c(0x27d))/0x5*(-parseInt(_0x133a5c(0x203))/0x6)+parseInt(_0x133a5c(0x249))/0x7+-parseInt(_0x133a5c(0x227))/0x8+-parseInt(_0x133a5c(0x232))/0x9*(parseInt(_0x133a5c(0x191))/0xa);if(_0xf98c05===_0x1288f7)break;else _0x379224['push'](_0x379224['shift']());}catch(_0x4f4107){_0x379224['push'](_0x379224['shift']());}}}(a27_0x2486,0xe60f6));import a27_0x58417c from'chalk';import a27_0x4af32d from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x1bc6cf){const _0x584977=a27_0x45e0;return!_0x1bc6cf&&(console[_0x584977(0x1f1)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x584977(0x1f1)](_0x584977(0x1fd))),!!_0x1bc6cf;}function withJsonFormat(_0x143382){const _0x4cdc48=a27_0x45e0;if(!_0x143382[_0x4cdc48(0x267)]&&!_0x143382[_0x4cdc48(0x1c0)]&&!_0x143382[_0x4cdc48(0x226)]&&!_0x143382[_0x4cdc48(0x23e)])return{..._0x143382,'format':'json','json':!![]};return _0x143382;}function formatJourneyState(_0x701511){const _0x434d33=a27_0x45e0;switch(_0x701511){case _0x434d33(0x233):return a27_0x58417c[_0x434d33(0x237)]('(running)');case _0x434d33(0x1bd):return a27_0x58417c[_0x434d33(0x256)]('(draft)');case _0x434d33(0x20c):return a27_0x58417c[_0x434d33(0x1d6)]('(paused)');case'completed':return a27_0x58417c[_0x434d33(0x201)](_0x434d33(0x21d));case _0x434d33(0x239):return a27_0x58417c[_0x434d33(0x256)](_0x434d33(0x286));default:return'('+_0x701511+')';}}function formatJourneyItem(_0x499296,_0x2e1d6c='',_0x15e8d3){const _0x2cc7db=a27_0x45e0,_0x25ff2d=formatJourneyState(_0x499296[_0x2cc7db(0x1b2)]),_0x3f0e4e=_0x15e8d3?hyperlink(_0x499296[_0x2cc7db(0x1a9)],_0x15e8d3):_0x499296[_0x2cc7db(0x1a9)];return _0x2e1d6c+_0x2cc7db(0x1aa)+_0x3f0e4e+'\x20'+_0x25ff2d;}function escapeRegex(_0x1cec87){const _0x19d1ac=a27_0x45e0;return _0x1cec87[_0x19d1ac(0x1b9)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x395820){const _0x32dcb7=a27_0x45e0,_0x4426a4=_0x395820[_0x32dcb7(0x19b)]('*')['map'](escapeRegex);return new RegExp(_0x4426a4[_0x32dcb7(0x1c1)]('.*'),'i');}function buildRuleToNameMapping(_0x288b3b){const _0x3c6c7a=a27_0x45e0,_0x246dbf=new Map();if(_0x288b3b[_0x3c6c7a(0x228)])for(const [_0x45e545,_0x4f6fec]of Object[_0x3c6c7a(0x243)](_0x288b3b['segments'])){if(_0x4f6fec['rule']){const _0x7d20d1=serializeRule(_0x4f6fec[_0x3c6c7a(0x1dd)]),_0x24b518=_0x246dbf[_0x3c6c7a(0x1a6)](_0x7d20d1);_0x24b518?_0x24b518[_0x3c6c7a(0x202)](_0x45e545):_0x246dbf[_0x3c6c7a(0x1e4)](_0x7d20d1,[_0x45e545]);}}return _0x246dbf;}async function resolveJourneyIdFromInput(_0x5ac580,_0xedca34,_0x2a00bb){const _0x30c706=a27_0x45e0,_0x1030db=await resolveJourneyTarget(_0x5ac580,_0xedca34['parentSegment'],_0xedca34[_0x30c706(0x1f4)]),_0x1d4ca4=_0x1030db[_0x30c706(0x26f)];if(!_0x1d4ca4)throw new SDKError(ErrorCode[_0x30c706(0x289)],_0x30c706(0x252));const _0x12bd97=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2a00bb[_0x30c706(0x24a)][_0x30c706(0x231)](_0x1d4ca4),{'verbose':_0xedca34[_0x30c706(0x1f4)]}),_0x10388d=_0x12bd97[_0x30c706(0x28a)],_0x2c7e8b=await withSpinner('Resolving\x20journey...',()=>_0x2a00bb['journey']['resolveJourneyId'](_0x10388d,_0x1030db['journeyName']),{'verbose':_0xedca34['verbose']});return{'journeyId':_0x2c7e8b[_0x30c706(0x28a)],'journeyName':_0x1030db['journeyName'],'parentSegmentId':_0x10388d};}function a27_0x45e0(_0x2064d4,_0x6d85bc){_0x2064d4=_0x2064d4-0x191;const _0x248607=a27_0x2486();let _0x45e0a4=_0x248607[_0x2064d4];return _0x45e0a4;}async function resolveJourneyTarget(_0x196ea8,_0x115056,_0x394aa7){const _0x3a6cda=a27_0x45e0;if(isYamlFilePath(_0x196ea8))try{const _0x1e6453=await resolveYamlFilePath(_0x196ea8);return _0x394aa7&&(console['error'](_0x3a6cda(0x236)+_0x196ea8),console[_0x3a6cda(0x1f1)](_0x3a6cda(0x215)+_0x1e6453[_0x3a6cda(0x26f)]),console['error'](_0x3a6cda(0x234)+_0x1e6453[_0x3a6cda(0x1a5)]),console[_0x3a6cda(0x1f1)](_0x3a6cda(0x248)+(_0x1e6453[_0x3a6cda(0x1ce)]||_0x3a6cda(0x285)))),{'journeyName':_0x1e6453['segmentName'],'parentSegment':_0x1e6453[_0x3a6cda(0x26f)],'resolved':_0x1e6453};}catch(_0x264a36){throw new SDKError(ErrorCode[_0x3a6cda(0x289)],_0x3a6cda(0x1db)+_0x264a36[_0x3a6cda(0x290)]);}if(!_0x115056)throw new SDKError(ErrorCode[_0x3a6cda(0x289)],_0x3a6cda(0x274));return{'journeyName':_0x196ea8,'parentSegment':_0x115056};}function a27_0x2486(){const _0x40aa55=['hasPeriod','parentSegment','\x20changed\x20files','\x20activation','\x20=\x20','from','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20parent\x20segment...','buildIdToEmailMap','setPhase','343004RwtBAq','Found\x20','Show\x20journey\x20statistics','web','Error:\x20Stage\x20\x22','25AFODsq','\x22\x20paused','journey:columns','✔\x20Pulled\x20','localeCompare','journey:push','resolveSegment','journey:resume','(root)','(archived)','includeHistory','Input:\x20','INVALID_ARGUMENT','data','add','stageNameMap','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','all','\x20not\x20found.\x20Available:\x20','message','table','enteredSize','journey:version:create','-\x20no\x20files\x20written','11890oyqOLm','\x20new\x20files','audienceId','user','\x20journeys','Getting\x20version\x20','map','utf-8','Pattern:\x20','\x20Opening\x20','split','listActivationsFlat','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','✔\x20Journey\x20\x22','\x20\x20-\x20','getActivation','journey:stats','1337190RvXBUk','\x20(draft)\x20—\x20\x22','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','segmentName','get','Creating\x20new\x20version...','No\x20statistics\x20available\x20for\x20journey:\x20','journeyBundleName','🗺️\x20','Export\x20journey(s)\x20as\x20YAML\x20files','Pause\x20a\x20running\x20journey','hasChanges','List\x20all\x20versions\x20of\x20a\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','values','state','log','getSegment','Getting\x20journey\x20details...','nodes','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Show\x20journey\x20table\x20column\x20mapping','replace','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x20(ID:\x20','No\x20journeys\x20found','draft','pause','Cancelled','json','join','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','goalSize','has','size','journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20journey\x20files\x20to\x20','✔\x20Found\x20','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','\x20files?','cwd','connection','folderPath','site','Aborted.','absolutePath','11106OzSuRt','journey','isNew','relative','yellow','goal','buildIdToNameMap','journey:view','.yml','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20Invalid\x20--type\x20\x22','rule','Options:','options','activationParams','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20Invalid\x20version\x20number:\x20','diff','set','Database:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','createVersion','/app/ps/','listVersions','journeyId','\x20unchanged\x20files','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','execute','stages','attributes','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','error','\x20\x20Target:\x20','conversion','verbose','Warning:\x20Could\x20not\x20resolve\x20activation\x20','segmentPushCommand','Resuming\x20journey...','resume','repeat','...','/e/','222NfhxNu','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Parent\x20segment:\x20','find','content','blue','push','1478238AWxBOi','reentryMode','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','stringify','base','Fetching\x20users\x20and\x20connections...','updatedAt','description','journey:pause','paused','Target\x20directory:\x20','Getting\x20journey\x20traffic\x20data...','getColumnMapping','journey:activations','yes','Error:\x20Journey\x20not\x20found:\x20','Fetching\x20journeys\x20and\x20folders...','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','\x20\x20Parent\x20segment:\x20','file','getJourney','versionNumber','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','completeMilestoneRate','history','(completed)','toLowerCase','renderStats','root\x20folder','tdx.json','\x20versions)','Available\x20stages:\x20','no_parent','Error:\x20','jsonl','280984dpqMfL','segments','dryRun','filePath','listJourneysFromParentSegment','📁\x20','Resolving\x20version...','/j/da/je','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Listing\x20journey\x20activations...','resolveParentId','2619GEYCXg','launched','\x20\x20Name:\x20','\x20\x20Journey\x20ID:\x20','Resolved\x20YAML\x20file:\x20','green','relativePath','archived','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journeyStages','test','journeyBundleId','tsv','\x0aChanges\x20to\x20\x27','\x20\x20Preserving\x20local\x20segment\x20name:\x20','session','journey:list','entries','getStatistics','Show\x20journey\x20details','sort','listJourneysWithFolders','\x20\x20Folder\x20path:\x20','5537462TUbWBq','segment','Fetching\x20','rootFolderId','targetDir','cyan','columns','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Pausing\x20journey...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20version','\x22\x20resumed','then','dim','folderId','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20Created\x20v','name','helpText','Resume\x20a\x20paused\x20journey','✔\x20Context\x20set:\x20','\x20\x20Statistics\x20not\x20available','createdAt','activation','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','includeStats','red','limit','Getting\x20journey\x20statistics...','exitOrJumpRate','format','type','filter','\x20details...','\x20journey','parent_segment','/j/da'];a27_0x2486=function(){return _0x40aa55;};return a27_0x2486();}export class JourneyListCommand extends BaseCommand{['name']=a27_0x272d82(0x242);[a27_0x272d82(0x20a)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x272d82(0x1ed)](_0x1fd0a7){const _0x541475=a27_0x272d82,{options:_0x2dcb14,args:_0x416582,tdx:_0x5d4371}=_0x1fd0a7,_0x8b4af9=_0x416582[0x0],_0x409bb8=_0x2dcb14[_0x541475(0x26f)];if(!_0x409bb8)return console[_0x541475(0x1f1)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x541475(0x1f1)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x12dda1=await withSpinner(_0x541475(0x275),()=>_0x5d4371[_0x541475(0x24a)][_0x541475(0x231)](_0x409bb8),{'verbose':_0x2dcb14[_0x541475(0x1f4)]}),_0x493100=_0x12dda1['data'];_0x2dcb14[_0x541475(0x1f4)]&&(console[_0x541475(0x1f1)](_0x541475(0x1fe)+_0x409bb8+_0x541475(0x1bb)+_0x493100+')'),_0x8b4af9&&console[_0x541475(0x1f1)](_0x541475(0x199)+_0x8b4af9));const _0x1fe36d=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x5d4371[_0x541475(0x24a)]['getParentFull'](_0x493100),{'verbose':_0x2dcb14['verbose']}),_0x4511c0=_0x1fe36d[_0x541475(0x28a)],_0x28f0f0=_0x4511c0[_0x541475(0x24c)],_0x1f6b66=await withSpinner('Listing\x20journeys...',()=>_0x5d4371[_0x541475(0x1d3)][_0x541475(0x247)](_0x493100,_0x28f0f0),{'verbose':_0x2dcb14[_0x541475(0x1f4)]});let _0x45a7ec=_0x1f6b66[_0x541475(0x28a)][_0x541475(0x1c6)];const _0x2db8cc=_0x1f6b66[_0x541475(0x28a)]['folders'],_0x41e350=new Map();for(const _0x5923a2 of _0x2db8cc){_0x41e350['set'](_0x5923a2['id'],_0x5923a2[_0x541475(0x25a)]);}if(_0x8b4af9){const _0x5bc7f4=globToRegex(_0x8b4af9);_0x45a7ec=_0x45a7ec[_0x541475(0x269)](_0x39e81e=>_0x5bc7f4[_0x541475(0x23c)](_0x39e81e[_0x541475(0x1a9)]));}console['error'](_0x541475(0x1c9)+_0x45a7ec[_0x541475(0x219)]+_0x541475(0x26b)+(_0x45a7ec[_0x541475(0x219)]!==0x1?'s':''));const _0x5a0e27=_0x28bdc0=>{const _0x4cfe73=_0x541475;return getConsoleNextUrl(_0x2dcb14[_0x4cfe73(0x1cf)],'/app/ps/'+_0x493100+'/e/'+_0x28bdc0+_0x4cfe73(0x26d));};if(_0x2dcb14[_0x541475(0x267)]==='table')await handleSDKOutput(_0x45a7ec,_0x2dcb14);else{if(_0x2dcb14[_0x541475(0x267)]===_0x541475(0x1c0)){const _0x41e367=_0x45a7ec[_0x541475(0x197)](_0x1f240f=>({..._0x1f240f,'url':_0x5a0e27(_0x1f240f['id'])}));await handleSDKOutput(_0x41e367,_0x2dcb14);}else{console[_0x541475(0x1b3)]('['+_0x409bb8+']');const _0x313172=new Map(),_0x4a42e3=[];for(const _0x50b13c of _0x45a7ec){if(!_0x50b13c[_0x541475(0x257)]||_0x50b13c[_0x541475(0x257)]===_0x28f0f0)_0x4a42e3[_0x541475(0x202)](_0x50b13c);else{const _0x3030b9=_0x313172[_0x541475(0x1a6)](_0x50b13c['folderId'])||[];_0x3030b9['push'](_0x50b13c),_0x313172[_0x541475(0x1e4)](_0x50b13c[_0x541475(0x257)],_0x3030b9);}}const _0x203ddc=(_0x38ca12,_0x41acec)=>_0x38ca12[_0x541475(0x1a9)][_0x541475(0x281)](_0x41acec[_0x541475(0x1a9)],undefined,{'sensitivity':'base'});_0x4a42e3[_0x541475(0x246)](_0x203ddc);for(const _0xfbadc5 of _0x4a42e3){console['log'](formatJourneyItem(_0xfbadc5,'',_0x5a0e27(_0xfbadc5['id'])));}const _0x301cbb=[..._0x313172[_0x541475(0x243)]()][_0x541475(0x246)]((_0x553a51,_0x160e4f)=>{const _0x3a170a=_0x541475,_0x2cd47e=_0x41e350[_0x3a170a(0x1a6)](_0x553a51[0x0])||_0x553a51[0x0],_0x2283e6=_0x41e350[_0x3a170a(0x1a6)](_0x160e4f[0x0])||_0x160e4f[0x0];return _0x2cd47e[_0x3a170a(0x281)](_0x2283e6,undefined,{'sensitivity':_0x3a170a(0x207)});});for(const [_0x33d3e0,_0x338ffd]of _0x301cbb){const _0x2ad850=_0x41e350[_0x541475(0x1a6)](_0x33d3e0)||_0x33d3e0;console[_0x541475(0x1b3)](_0x541475(0x22c)+_0x2ad850),_0x338ffd[_0x541475(0x246)](_0x203ddc);for(const _0x35f6ef of _0x338ffd){console[_0x541475(0x1b3)](formatJourneyItem(_0x35f6ef,'\x20\x20',_0x5a0e27(_0x35f6ef['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x272d82(0x1d9);[a27_0x272d82(0x20a)]=a27_0x272d82(0x245);async['execute'](_0x276720){const _0x5d50a3=a27_0x272d82,{options:_0x4de081,args:_0x40fd7a,tdx:_0x1fbd12}=_0x276720,_0x1563b1=_0x40fd7a[0x0];if(!_0x1563b1)return console[_0x5d50a3(0x1f1)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5d50a3(0x1f1)](_0x5d50a3(0x1b7)),console[_0x5d50a3(0x1f1)](_0x5d50a3(0x1de)),console['error'](_0x5d50a3(0x19d)),0x1;_0x4de081['verbose']&&console['error'](_0x5d50a3(0x288)+_0x1563b1);const {journeyId:_0x3a7709,parentSegmentId:_0x8464e0}=await resolveJourneyIdFromInput(_0x1563b1,_0x4de081,_0x1fbd12);if(_0x4de081[_0x5d50a3(0x27b)]){const _0x422cda=getConsoleNextUrl(_0x4de081['site'],'/app/ps/'+_0x8464e0+_0x5d50a3(0x1fb)+_0x3a7709+_0x5d50a3(0x22e));return console[_0x5d50a3(0x1f1)](a27_0x58417c[_0x5d50a3(0x237)]('✔')+_0x5d50a3(0x19a)+a27_0x58417c[_0x5d50a3(0x24e)](_0x422cda)),openBrowser(_0x422cda),0x0;}const _0x2f6ee5=await withSpinner(_0x5d50a3(0x1b5),()=>_0x1fbd12[_0x5d50a3(0x1d3)][_0x5d50a3(0x217)](_0x3a7709),{'verbose':_0x4de081[_0x5d50a3(0x1f4)]}),_0x1b33ae=_0x2f6ee5[_0x5d50a3(0x28a)],_0x403577=_0x4de081[_0x5d50a3(0x262)];let _0x5d313d;if(_0x403577)try{const _0x5cf31c=await withSpinner(_0x5d50a3(0x265),()=>_0x1fbd12[_0x5d50a3(0x1d3)][_0x5d50a3(0x244)](_0x3a7709),{'verbose':_0x4de081['verbose']});_0x5d313d=_0x5cf31c[_0x5d50a3(0x28a)];}catch{_0x4de081['verbose']&&console[_0x5d50a3(0x1f1)](_0x5d50a3(0x25e));}const _0x17c06b=getConsoleNextUrl(_0x4de081[_0x5d50a3(0x1cf)],_0x5d50a3(0x1e8)+_0x8464e0+_0x5d50a3(0x1fb)+_0x3a7709+_0x5d50a3(0x22e)),_0x4c9843={'id':_0x1b33ae['id'],'name':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x25a)],'description':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x20a)],'state':_0x1b33ae['attributes'][_0x5d50a3(0x1b2)],'paused':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x20c)],'reentry_mode':_0x1b33ae[_0x5d50a3(0x1ef)]['reentryMode'],'stages':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x23b)]?.['length']||0x0,..._0x1b33ae['attributes'][_0x5d50a3(0x1d7)]&&{'goal':_0x1b33ae['attributes']['goal'][_0x5d50a3(0x25a)]},..._0x5d313d&&{'statistics':{'size':_0x5d313d[_0x5d50a3(0x1c5)],'entered':_0x5d313d[_0x5d50a3(0x292)],'goal_achieved':_0x5d313d[_0x5d50a3(0x1c3)],'completion_rate':_0x5d313d['completionRate'],'exit_or_jump':_0x5d313d['exitOrJumpSize'],'exit_or_jump_rate':_0x5d313d[_0x5d50a3(0x266)],'stages':_0x5d313d[_0x5d50a3(0x1ee)]}},'url':_0x17c06b};return await handleSingleObjectOutput(_0x4c9843,_0x4de081),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x272d82(0x1a1);[a27_0x272d82(0x20a)]=a27_0x272d82(0x27a);async[a27_0x272d82(0x1ed)](_0x5d8b3d){const _0x5b60fe=a27_0x272d82,{options:_0x4ec8dd,args:_0x407784,tdx:_0x358c82}=_0x5d8b3d,_0x35943a=_0x407784[0x0];if(!requireNameOrPath(_0x35943a))return 0x1;_0x4ec8dd['verbose']&&console[_0x5b60fe(0x1f1)](_0x5b60fe(0x288)+_0x35943a);const _0x50cccb=_0x4ec8dd,_0x47bfdb=_0x50cccb[_0x5b60fe(0x273)],_0x569e6e=_0x50cccb['to'],_0x1f66e5=_0x50cccb[_0x5b60fe(0x287)],_0x4c107b=_0x50cccb['stage'];_0x1f66e5&&!_0x47bfdb&&!_0x569e6e&&console[_0x5b60fe(0x1f1)](_0x5b60fe(0x258));const _0x361080=_0x1f66e5?withJsonFormat(_0x4ec8dd):_0x4ec8dd,{journeyId:_0x359ec9,journeyName:_0x5e4690}=await resolveJourneyIdFromInput(_0x35943a,_0x361080,_0x358c82),_0x438a01=_0x47bfdb||_0x569e6e?{'from':_0x47bfdb,'to':_0x569e6e}:undefined,_0x118cac=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x5b60fe(0x28e)]([_0x358c82[_0x5b60fe(0x1d3)]['getJourney'](_0x359ec9),_0x358c82[_0x5b60fe(0x1d3)][_0x5b60fe(0x244)](_0x359ec9,_0x438a01)]),{'verbose':_0x361080[_0x5b60fe(0x1f4)]}),[_0x57b464,_0x4d57f0]=_0x118cac[_0x5b60fe(0x28a)];if(!_0x4d57f0||_0x4d57f0[_0x5b60fe(0x1ea)]===null)return console['error'](_0x5b60fe(0x1a8)+_0x5e4690),console[_0x5b60fe(0x1f1)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x547063=buildStageNameMap(_0x57b464),_0x5dec4f=!!(_0x438a01&&_0x4d57f0[_0x5b60fe(0x21c)]?.[_0x5b60fe(0x219)]),_0x5b1072={'stageNameMap':_0x547063,'hasPeriod':_0x5dec4f,'includeHistory':!!_0x1f66e5};if(_0x4c107b&&_0x4d57f0[_0x5b60fe(0x1ee)]){const _0x5129e7=_0x4d57f0['stages'][_0x5b60fe(0x1ff)](_0x21c890=>{const _0x2fad07=_0x5b60fe,_0x2b1260=_0x547063[_0x2fad07(0x1a6)](_0x21c890['id'])??'';return _0x2b1260[_0x2fad07(0x21e)]()===_0x4c107b['toLowerCase']();});if(_0x5129e7)return await handleSingleObjectOutput(formatStageStats(_0x5129e7,_0x5b1072),_0x361080),0x0;const _0x2ac798=_0x4d57f0['stages'][_0x5b60fe(0x197)](_0x5d35f3=>_0x547063['get'](_0x5d35f3['id'])??_0x5d35f3['id']);return console['error'](_0x5b60fe(0x27c)+_0x4c107b+'\x22\x20not\x20found'),console[_0x5b60fe(0x1f1)](_0x5b60fe(0x223)+_0x2ac798['join'](',\x20')),0x1;}const _0x54d2f1=_0x4d57f0['stages']?.[_0x5b60fe(0x197)](_0x1ae4ce=>formatStageStats(_0x1ae4ce,_0x5b1072)),_0x4c42fa=assembleJourneyStats(_0x4d57f0,{'from':_0x47bfdb,'to':_0x569e6e,'includeHistory':_0x1f66e5});return await this['renderStats'](_0x4c42fa,_0x54d2f1??[],_0x361080),0x0;}async[a27_0x272d82(0x21f)](_0xdd509d,_0x33f02f,_0x3b9bdb){const _0x457005=a27_0x272d82,_0x2262bb=_0x3b9bdb[_0x457005(0x267)]==='json'||_0x3b9bdb[_0x457005(0x267)]==='jsonl'||_0x3b9bdb[_0x457005(0x1c0)]||_0x3b9bdb[_0x457005(0x226)];if(_0x2262bb){_0xdd509d['stages']=_0x33f02f,await handleSingleObjectOutput(_0xdd509d,_0x3b9bdb);return;}await handleSingleObjectOutput(_0xdd509d,_0x3b9bdb);for(const _0x1ad0c0 of _0x33f02f){console[_0x457005(0x1b3)](''),console[_0x457005(0x1b3)](String(a27_0x58417c[_0x457005(0x24e)]['bold']('['+_0x1ad0c0['name']+']'))+a27_0x58417c['dim']('\x20'+_0x1ad0c0['id']));const {id:_0x59944f,name:_0x486544,..._0x3abe73}=_0x1ad0c0;await handleSingleObjectOutput(_0x3abe73,_0x3b9bdb);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x272d82(0x25a)]='journey:traffic';[a27_0x272d82(0x20a)]=a27_0x272d82(0x1b0);async[a27_0x272d82(0x1ed)](_0x30a572){const _0x272aa1=a27_0x272d82,{options:_0x3a3338,args:_0xb70696,tdx:_0xecb553}=_0x30a572,_0x45f50b=_0xb70696[0x0];if(!requireNameOrPath(_0x45f50b))return 0x1;_0x3a3338[_0x272aa1(0x1f4)]&&console[_0x272aa1(0x1f1)]('Input:\x20'+_0x45f50b);const _0x2faff9=_0x3a3338,_0x1be2db=_0x2faff9[_0x272aa1(0x268)],_0x1e7418=_0x2faff9[_0x272aa1(0x273)],_0x3e6e5b=_0x2faff9['to'],_0x59a4a6=_0x2faff9[_0x272aa1(0x264)];if(_0x1be2db&&_0x1be2db!=='conversion'&&_0x1be2db!==_0x272aa1(0x260))return console[_0x272aa1(0x1f1)](_0x272aa1(0x1dc)+_0x1be2db+_0x272aa1(0x214)),0x1;const _0x4beb90=withJsonFormat(_0x3a3338),{journeyId:_0x4fd337,journeyName:_0x256b05}=await resolveJourneyIdFromInput(_0x45f50b,_0x4beb90,_0xecb553),_0x2338b9={'type':_0x1be2db,'from':_0x1e7418,'to':_0x3e6e5b,'limit':_0x59a4a6},_0x6c9e76=await withSpinner(_0x272aa1(0x20e),()=>_0xecb553[_0x272aa1(0x1d3)]['getTrafficData'](_0x4fd337,_0x2338b9),{'verbose':_0x4beb90[_0x272aa1(0x1f4)]}),_0x706e2f=_0x6c9e76[_0x272aa1(0x28a)],_0x4ac09e=_0x706e2f[_0x272aa1(0x1f3)]&&(_0x706e2f[_0x272aa1(0x1f3)][_0x272aa1(0x1b6)][_0x272aa1(0x219)]>0x0||_0x706e2f[_0x272aa1(0x1f3)]['links'][_0x272aa1(0x219)]>0x0),_0x182f2c=_0x706e2f[_0x272aa1(0x260)]&&_0x706e2f['activation'][_0x272aa1(0x219)]>0x0;if(!_0x4ac09e&&!_0x182f2c)return console[_0x272aa1(0x1f1)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x256b05),console[_0x272aa1(0x1f1)](_0x272aa1(0x205)),_0x1e7418&&_0x3e6e5b&&console['error'](_0x272aa1(0x1ec)),0x0;return await handleSingleObjectOutput(_0x706e2f,_0x4beb90),0x0;}}function formatStageStats(_0xc0c88a,_0x2f1314){const _0x573149=a27_0x272d82,_0x11f4ef=_0x2f1314[_0x573149(0x26e)]&&_0xc0c88a[_0x573149(0x21c)]?.[_0x573149(0x219)]?aggregateStageHistory(_0xc0c88a[_0x573149(0x21c)]):{'size':_0xc0c88a['size'],'entered':_0xc0c88a[_0x573149(0x292)],'milestone':_0xc0c88a['milestoneSize'],'milestone_rate':_0xc0c88a[_0x573149(0x21b)],'exit_or_jump':_0xc0c88a['exitOrJumpSize'],'exit_or_jump_rate':_0xc0c88a[_0x573149(0x266)]},_0xed360e={'id':_0xc0c88a['id'],'name':_0x2f1314[_0x573149(0x28c)][_0x573149(0x1a6)](_0xc0c88a['id'])??_0xc0c88a['id'],..._0x11f4ef};return _0x2f1314['hasPeriod']&&_0x2f1314[_0x573149(0x287)]&&_0xc0c88a[_0x573149(0x21c)]&&(_0xed360e[_0x573149(0x21c)]=_0xc0c88a[_0x573149(0x21c)]),_0xed360e;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x272d82(0x20b);[a27_0x272d82(0x20a)]=a27_0x272d82(0x1ac);async[a27_0x272d82(0x1ed)](_0x3148bb){const _0x34cc1b=a27_0x272d82,{options:_0x43b613,args:_0x15d738,tdx:_0x41cfe6}=_0x3148bb,_0x206b90=_0x15d738[0x0];if(!requireNameOrPath(_0x206b90))return 0x1;_0x43b613[_0x34cc1b(0x1f4)]&&console[_0x34cc1b(0x1f1)](_0x34cc1b(0x288)+_0x206b90);const {journeyId:_0x591fcf,journeyName:_0x257a83}=await resolveJourneyIdFromInput(_0x206b90,_0x43b613,_0x41cfe6);if(!_0x43b613[_0x34cc1b(0x211)]){const _0x28f680=await confirm(_0x34cc1b(0x1af)+_0x257a83+'\x22?');if(!_0x28f680)return console[_0x34cc1b(0x1f1)]('Cancelled'),0x0;}const _0x1cc95c=await withSpinner(_0x34cc1b(0x251),()=>_0x41cfe6['journey'][_0x34cc1b(0x1be)](_0x591fcf),{'verbose':_0x43b613[_0x34cc1b(0x1f4)]}),_0x4901c3=_0x1cc95c['data'];return console['error']('✔\x20Journey\x20\x22'+_0x4901c3['attributes']['name']+_0x34cc1b(0x27e)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x272d82(0x25a)]=a27_0x272d82(0x284);[a27_0x272d82(0x20a)]=a27_0x272d82(0x25c);async[a27_0x272d82(0x1ed)](_0x15953f){const _0x375734=a27_0x272d82,{options:_0x25b749,args:_0x5be57e,tdx:_0x5d7c36}=_0x15953f,_0x401896=_0x5be57e[0x0];if(!requireNameOrPath(_0x401896))return 0x1;_0x25b749['verbose']&&console[_0x375734(0x1f1)](_0x375734(0x288)+_0x401896);const {journeyId:_0x7faf69,journeyName:_0x14f3f1}=await resolveJourneyIdFromInput(_0x401896,_0x25b749,_0x5d7c36);if(!_0x25b749[_0x375734(0x211)]){const _0x87f38d=await confirm(_0x375734(0x1e6)+_0x14f3f1+'\x22?');if(!_0x87f38d)return console['error'](_0x375734(0x1bf)),0x0;}const _0x566135=await withSpinner(_0x375734(0x1f7),()=>_0x5d7c36[_0x375734(0x1d3)][_0x375734(0x1f8)](_0x7faf69),{'verbose':_0x25b749[_0x375734(0x1f4)]}),_0x3842a5=_0x566135[_0x375734(0x28a)];return console[_0x375734(0x1f1)](_0x375734(0x19e)+_0x3842a5[_0x375734(0x1ef)]['name']+_0x375734(0x254)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x272d82(0x25a)]='journey:pull';[a27_0x272d82(0x20a)]=a27_0x272d82(0x1ab);async['execute'](_0xa7a3f4){const _0x3260e3=a27_0x272d82,{options:_0x412d2b,args:_0x8a1022,tdx:_0x358727}=_0xa7a3f4,_0x158192=_0x412d2b,_0x40390b=_0x8a1022[0x0],_0x26d578=_0x40390b&&isYamlFilePath(_0x40390b),_0x3262e3=await resolveTarget({'arg':_0x26d578?_0x40390b:undefined,'contextParent':_0x412d2b[_0x3260e3(0x26f)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3262e3))return _0x3262e3['errorCode']===_0x3260e3(0x224)?(console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x1d6)](_0x3260e3(0x1e1))),console[_0x3260e3(0x1f1)](_0x3260e3(0x1ca)),console[_0x3260e3(0x1f1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x3260e3(0x21a)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a27_0x58417c[_0x3260e3(0x263)](_0x3260e3(0x225)+_0x3262e3[_0x3260e3(0x290)]+'\x0a')),_0x3262e3[_0x3260e3(0x25b)]&&console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x24e)](_0x3262e3[_0x3260e3(0x25b)]))),0x1;let _0x149721=_0x26d578?undefined:_0x40390b,_0x1a8aae,_0x2592fd;_0x3262e3[_0x3260e3(0x268)]===_0x3260e3(0x216)&&(_0x149721=_0x3262e3['resourceName'],_0x1a8aae=_0x3262e3['filePath'],_0x2592fd=_0x3262e3[_0x3260e3(0x1ce)]);const _0x24e462=_0x3262e3['parentName'],_0x3d490c=_0x3262e3[_0x3260e3(0x24d)];_0x158192['verbose']&&(console[_0x3260e3(0x1f1)](_0x3260e3(0x1fe)+_0x24e462),console['error'](_0x3260e3(0x20d)+_0x3d490c),_0x149721&&console[_0x3260e3(0x1f1)]('Journey\x20name:\x20'+_0x149721),_0x1a8aae&&console['error']('Target\x20file:\x20'+_0x1a8aae),_0x2592fd&&console[_0x3260e3(0x1f1)]('Folder\x20path:\x20'+_0x2592fd));const _0x116c6d=await withSpinner(_0x3260e3(0x275),()=>_0x358727[_0x3260e3(0x24a)][_0x3260e3(0x231)](_0x24e462),{'verbose':_0x412d2b[_0x3260e3(0x1f4)]}),_0x45b8c4=_0x116c6d['data'],{journeys:_0x35475e,folders:_0x22aff8}=await withSpinner(_0x3260e3(0x213),async()=>{const _0x41d39c=_0x3260e3,[_0x43a93a,_0x2dce06]=await Promise[_0x41d39c(0x28e)]([_0x358727[_0x41d39c(0x1d3)][_0x41d39c(0x22b)](_0x45b8c4,undefined,{'includeAllVersions':!![]}),_0x358727[_0x41d39c(0x24a)]['listFolders'](_0x45b8c4)]);return{'journeys':_0x43a93a,'folders':_0x2dce06};},{'verbose':_0x412d2b['verbose']})[_0x3260e3(0x255)](_0x1728b2=>_0x1728b2[_0x3260e3(0x28a)]);let _0x1c8b5f=_0x35475e;const _0x4e77d7=buildFolderIdToPathMap(_0x22aff8);if(_0x149721){const _0x5d0500=_0x1c8b5f['filter'](_0x3251aa=>_0x3251aa[_0x3260e3(0x1a9)][_0x3260e3(0x21e)]()===_0x149721[_0x3260e3(0x21e)]());if(_0x5d0500[_0x3260e3(0x219)]===0x0)return console[_0x3260e3(0x1f1)](_0x3260e3(0x212)+_0x149721),console[_0x3260e3(0x1f1)](_0x3260e3(0x261)),0x1;_0x1c8b5f=_0x5d0500;}if(_0x2592fd!==undefined){const _0xeaaf64=_0x1c8b5f[_0x3260e3(0x269)](_0x2d52df=>{const _0x14c153=_0x3260e3,_0x38d076=_0x2d52df[_0x14c153(0x257)]?_0x4e77d7['get'](_0x2d52df[_0x14c153(0x257)])||'':'';return _0x38d076===_0x2592fd;});if(_0xeaaf64[_0x3260e3(0x219)]===0x0&&_0x1c8b5f[_0x3260e3(0x219)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x149721+'\x27\x20not\x20found\x20in\x20'+(_0x2592fd||_0x3260e3(0x220))),console[_0x3260e3(0x1f1)](_0x3260e3(0x1c2));for(const _0x536d84 of _0x1c8b5f){const _0x21d427=_0x536d84[_0x3260e3(0x257)]?_0x4e77d7[_0x3260e3(0x1a6)](_0x536d84['folderId'])||'':'';console[_0x3260e3(0x1f1)](_0x3260e3(0x19f)+(_0x21d427||_0x3260e3(0x285))+'/'+_0x536d84['journeyBundleName']);}return 0x1;}_0x1c8b5f=_0xeaaf64;}if(_0x1c8b5f[_0x3260e3(0x219)]===0x0)return console[_0x3260e3(0x1f1)](_0x3260e3(0x1bc)),0x0;const _0x211981=new Map();for(const _0x4dafc4 of _0x1c8b5f){const _0x1ea7ac=_0x4dafc4[_0x3260e3(0x23d)];!_0x211981['has'](_0x1ea7ac)&&_0x211981[_0x3260e3(0x1e4)](_0x1ea7ac,[]),_0x211981[_0x3260e3(0x1a6)](_0x1ea7ac)['push'](_0x4dafc4);}for(const _0x3dffd0 of _0x211981['values']()){_0x3dffd0[_0x3260e3(0x246)]((_0x6ee40e,_0x3a1ddf)=>(_0x6ee40e[_0x3260e3(0x218)]||0x0)-(_0x3a1ddf[_0x3260e3(0x218)]||0x0));}const _0xef995c=[],{idToEmailMap:_0x4d81c9,connectionIdToNameMap:_0x2f2124}=await withSpinner(_0x3260e3(0x208),async()=>{const _0x270117=_0x3260e3,[_0x31d953,_0x38b86a]=await Promise[_0x270117(0x28e)]([_0x358727[_0x270117(0x194)][_0x270117(0x276)](),_0x358727[_0x270117(0x1cd)][_0x270117(0x1d8)]()]);return{'idToEmailMap':_0x31d953,'connectionIdToNameMap':_0x38b86a};},{'verbose':_0x412d2b[_0x3260e3(0x1f4)]})[_0x3260e3(0x255)](_0x3d0c37=>_0x3d0c37[_0x3260e3(0x28a)]);for(const _0x3dddb8 of _0x211981[_0x3260e3(0x1b1)]()){const _0x15cfe1=_0x3dddb8[0x0][_0x3260e3(0x1a9)],_0x4dd49b=_0x3dddb8[0x0][_0x3260e3(0x257)],_0x12d010=_0x4dd49b?_0x4e77d7[_0x3260e3(0x1a6)](_0x4dd49b)||'':'',_0x4fc022=_0x12d010?a27_0x4af32d[_0x3260e3(0x1c1)](_0x3d490c,_0x12d010):_0x3d490c,_0x3b0518=_0x1a8aae||a27_0x4af32d[_0x3260e3(0x1c1)](_0x4fc022,sanitizeFileName(_0x15cfe1)+_0x3260e3(0x1da));let _0x353eb1,_0x29e250;if(existsSync(_0x3b0518))try{const _0x5587de=readFileSync(_0x3b0518,_0x3260e3(0x198)),_0x2517c1=parseYamlString(_0x5587de);_0x29e250=_0x2517c1,_0x353eb1=buildRuleToNameMapping(_0x2517c1),_0x158192[_0x3260e3(0x1f4)]&&_0x353eb1['size']>0x0&&console[_0x3260e3(0x1f1)](_0x3260e3(0x279)+_0x353eb1[_0x3260e3(0x1c5)]+_0x3260e3(0x1a4)+_0x15cfe1);}catch(_0x7d44c6){_0x158192[_0x3260e3(0x1f4)]&&console[_0x3260e3(0x1f1)](_0x3260e3(0x1ba)+_0x7d44c6[_0x3260e3(0x290)]);}const _0x38d5ea=[],_0x475b7e=new Set(),_0x5b9ffb=new Map(),_0x515b8b=new Map(),_0x5908f9=new Set(),_0x3c8807=new Map(),_0x3b3a96=new Map(),_0x2f7590=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x15cfe1+_0x3260e3(0x1fa),async _0x286792=>{const _0x521631=_0x3260e3;for(const _0x123aa9 of _0x3dddb8){const _0xa20b=_0x3dddb8[_0x521631(0x219)]>0x1?_0x123aa9[_0x521631(0x1a9)]+'\x20v'+(_0x123aa9[_0x521631(0x218)]||0x1):_0x123aa9['journeyBundleName'];_0x286792[_0x521631(0x277)](_0x521631(0x24b)+_0xa20b);const _0x2dc859=await _0x358727['journey'][_0x521631(0x217)](_0x123aa9['id']),_0x480e9b=_0x2dc859[_0x521631(0x1ef)]?.[_0x521631(0x193)],_0x1e1e03={'resolveSegment':async _0x33d4da=>{const _0x503d96=_0x521631;if(!_0x480e9b)return{'name':_0x33d4da,'isJourneyLocal':![]};const _0x8f1ea0=_0x5b9ffb['get'](_0x33d4da);if(_0x8f1ea0)return _0x8f1ea0;try{const _0x45953e=await _0x358727[_0x503d96(0x24a)][_0x503d96(0x1b4)](_0x480e9b,_0x33d4da),_0x2be7f9=_0x45953e['kind']===SEGMENT_KIND_JOURNEY;let _0x30de1f,_0x5b6ecd=_0x45953e[_0x503d96(0x25a)];if(_0x2be7f9&&_0x45953e[_0x503d96(0x1dd)]){const _0x451d1c=await segmentResponseToDef(_0x45953e,{'resolveSegmentName':async _0x598a4=>{const _0x2256d8=_0x503d96,_0x2fa909=_0x5b9ffb[_0x2256d8(0x1a6)](_0x598a4);if(_0x2fa909)return _0x2fa909[_0x2256d8(0x25a)];const _0x1016bf=await _0x1e1e03[_0x2256d8(0x283)](_0x598a4);return _0x1016bf[_0x2256d8(0x25a)];}}),_0x1dc3a5=_0x451d1c[_0x503d96(0x1dd)];_0x30de1f={'description':_0x45953e[_0x503d96(0x20a)],'rule':_0x1dc3a5};const _0xcf7d8a=serializeRule(_0x1dc3a5),_0x40c5bf=_0x515b8b[_0x503d96(0x1a6)](_0xcf7d8a);if(_0x40c5bf)_0x5b6ecd=_0x40c5bf,_0x30de1f=undefined,_0x158192['verbose']&&console[_0x503d96(0x1f1)](_0x503d96(0x250)+_0x45953e[_0x503d96(0x25a)]+'\x20->\x20'+_0x40c5bf);else{let _0x2e687d=![];if(_0x353eb1){const _0x4f7b08=_0x353eb1[_0x503d96(0x1a6)](_0xcf7d8a);if(_0x4f7b08){const _0xd8a8f3=_0x4f7b08['find'](_0x3c7a02=>!_0x475b7e[_0x503d96(0x1c4)](_0x3c7a02));_0xd8a8f3&&(_0x5b6ecd=_0xd8a8f3,_0x475b7e[_0x503d96(0x28b)](_0xd8a8f3),_0x515b8b[_0x503d96(0x1e4)](_0xcf7d8a,_0xd8a8f3),_0x2e687d=!![],_0x158192[_0x503d96(0x1f4)]&&console['error'](_0x503d96(0x240)+_0xd8a8f3+'\x20(rule\x20match)'));}}if(!_0x2e687d){const _0x37c663=generateJourneyLocalName(_0x45953e['name']);_0x37c663&&(_0x5b6ecd=_0x37c663);let _0x32e528=_0x5b6ecd,_0x3e590a=0x2;while(_0x475b7e[_0x503d96(0x1c4)](_0x32e528)){_0x32e528=_0x5b6ecd+'_'+_0x3e590a,_0x3e590a++;}_0x475b7e[_0x503d96(0x28b)](_0x32e528),_0x515b8b['set'](_0xcf7d8a,_0x32e528),_0x5b6ecd=_0x32e528;}}}const _0x30a90f={'name':_0x5b6ecd,'isJourneyLocal':_0x2be7f9,'definition':_0x30de1f};return _0x5b9ffb[_0x503d96(0x1e4)](_0x33d4da,_0x30a90f),_0x30a90f;}catch(_0x16761a){return _0x412d2b[_0x503d96(0x1f4)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x33d4da+':\x20'+_0x16761a[_0x503d96(0x290)]),{'name':_0x33d4da,'isJourneyLocal':![]};}},'resolveActivation':async _0x34754f=>{const _0x4472f7=_0x521631,_0x1c47b4=_0x3c8807[_0x4472f7(0x1a6)](_0x34754f);if(_0x1c47b4)return _0x1c47b4;try{const _0x13c81c=await _0x358727[_0x4472f7(0x1d3)][_0x4472f7(0x1a0)](_0x123aa9['id'],_0x34754f),_0x2cb28c=journeyActivationStepToYaml(_0x13c81c,_0x4d81c9,_0x2f2124),_0x3c9d78=JSON[_0x4472f7(0x206)]({'name':_0x2cb28c[_0x4472f7(0x25a)],'connection':_0x2cb28c['connection'],'connector_config':_0x2cb28c['connector_config']}),_0x7e20e7=_0x3b3a96[_0x4472f7(0x1a6)](_0x3c9d78);if(_0x7e20e7){const _0x55a786={'name':_0x7e20e7,'isJourneyLocal':!![],'definition':_0x2cb28c};return _0x3c8807[_0x4472f7(0x1e4)](_0x34754f,_0x55a786),_0x55a786;}const _0x26a238=_0x13c81c[_0x4472f7(0x1ef)][_0x4472f7(0x1e0)][_0x4472f7(0x25a)]||_0x34754f,_0x463b27=sanitizeYamlKey(_0x26a238)||'activation_'+_0x34754f;let _0xdd4744=_0x463b27,_0x5bbe2e=0x2;while(_0x5908f9['has'](_0xdd4744)){_0xdd4744=_0x463b27+'_'+_0x5bbe2e,_0x5bbe2e++;}_0x5908f9[_0x4472f7(0x28b)](_0xdd4744),_0x3b3a96[_0x4472f7(0x1e4)](_0x3c9d78,_0xdd4744);const _0x1e1761={'name':_0xdd4744,'isJourneyLocal':!![],'definition':_0x2cb28c};return _0x3c8807['set'](_0x34754f,_0x1e1761),_0x1e1761;}catch(_0xa3ff3b){return _0x412d2b[_0x4472f7(0x1f4)]&&console[_0x4472f7(0x1f1)](_0x4472f7(0x1f5)+_0x34754f+':\x20'+_0xa3ff3b['message']),{'name':_0x34754f,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x329bb7,_0x278579)=>{const _0x43ff76=_0x521631;return resolveJumpTarget(_0x329bb7,_0x278579,_0x2f7590,_0x452dba=>_0x358727[_0x43ff76(0x1d3)][_0x43ff76(0x217)](_0x452dba));}},_0x38fd4b=await journeyResponseToDef(_0x2dc859,_0x1e1e03);_0x38d5ea[_0x521631(0x202)]({'item':_0x123aa9,'yaml':_0x38fd4b});}},{'verbose':_0x412d2b[_0x3260e3(0x1f4)]});const _0x2fee0f=await _0x358727['journey']['getLatestJourneyId'](_0x3dddb8[0x0][_0x3260e3(0x23d)]),_0x1075fc=buildMergedJourneyDef(_0x38d5ea,_0x353eb1,_0x2fee0f),_0x1f2c7d=normalizeJourneyDef(_0x1075fc,_0x29e250),_0x2aee62=toYamlString(_0x1f2c7d),_0x1c8ab8=_0x1a8aae||a27_0x4af32d[_0x3260e3(0x1c1)](_0x4fc022,sanitizeFileName(_0x15cfe1)+_0x3260e3(0x1da));!_0x1a8aae&&_0x12d010&&!existsSync(_0x4fc022)&&mkdirSync(_0x4fc022,{'recursive':!![]});const _0x4f8267=a27_0x4af32d[_0x3260e3(0x1d5)](process['cwd'](),_0x1c8ab8);if(existsSync(_0x1c8ab8)){const _0x55a288=readFileSync(_0x1c8ab8,_0x3260e3(0x198)),_0x26bf52=generateDiff(_0x55a288,_0x2aee62),_0x57e802=hasChanges(_0x26bf52);_0xef995c['push']({'relativePath':_0x4f8267,'absolutePath':_0x1c8ab8,'content':_0x2aee62,'isNew':![],'hasChanges':_0x57e802,'diff':_0x57e802?formatDiffWithColors(_0x26bf52):undefined});}else _0xef995c[_0x3260e3(0x202)]({'relativePath':_0x4f8267,'absolutePath':_0x1c8ab8,'content':_0x2aee62,'isNew':!![],'hasChanges':![]});}const _0x41cb9b=_0xef995c['filter'](_0x46853a=>_0x46853a[_0x3260e3(0x1d4)]),_0x207776=_0xef995c['filter'](_0x18db8d=>!_0x18db8d['isNew']&&_0x18db8d[_0x3260e3(0x1ad)]),_0x402a25=_0xef995c[_0x3260e3(0x269)](_0xba71e8=>!_0xba71e8[_0x3260e3(0x1d4)]&&!_0xba71e8[_0x3260e3(0x1ad)]),_0x29b2e1=_0x1c8b5f[_0x3260e3(0x219)],_0xfb2b40=_0x211981['size'],_0xf5307d=_0x29b2e1>_0xfb2b40?'\x20('+_0x29b2e1+_0x3260e3(0x222):'';console[_0x3260e3(0x1f1)]('\x0aPull\x20summary:'),console[_0x3260e3(0x1f1)]('\x20\x20'+a27_0x58417c[_0x3260e3(0x24e)](_0xfb2b40+_0x3260e3(0x195))+a27_0x58417c['dim'](_0xf5307d)),console[_0x3260e3(0x1f1)]('\x20\x20'+a27_0x58417c[_0x3260e3(0x237)]('+\x20'+_0x41cb9b['length']+_0x3260e3(0x192))),console[_0x3260e3(0x1f1)]('\x20\x20'+a27_0x58417c[_0x3260e3(0x1d6)]('~\x20'+_0x207776[_0x3260e3(0x219)]+_0x3260e3(0x270))),console['error']('\x20\x20'+a27_0x58417c['dim']('=\x20'+_0x402a25['length']+_0x3260e3(0x1eb))),console[_0x3260e3(0x1f1)](_0x3260e3(0x1f2)+a27_0x58417c[_0x3260e3(0x24e)](_0x3d490c)+'\x0a');if(_0x207776[_0x3260e3(0x219)]>0x0)for(const _0x141e4b of _0x207776){console[_0x3260e3(0x1f1)](_0x3260e3(0x23f)+_0x141e4b[_0x3260e3(0x238)]+'\x27:'),console[_0x3260e3(0x1f1)]('─'[_0x3260e3(0x1f9)](0x3c)),console[_0x3260e3(0x1f1)](_0x141e4b[_0x3260e3(0x1e3)]),console['error']('─'[_0x3260e3(0x1f9)](0x3c));}if(_0x158192[_0x3260e3(0x229)])return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x1d6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x41cb9b[_0x3260e3(0x219)]===0x0&&_0x207776[_0x3260e3(0x219)]===0x0)return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x237)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x24e462},_0x158192[_0x3260e3(0x241)]),console['error'](a27_0x58417c['green'](_0x3260e3(0x25d)+a27_0x58417c[_0x3260e3(0x256)](_0x3260e3(0x26c))+'\x20=\x20'+a27_0x58417c['cyan'](_0x24e462))),0x0;if(!_0x158192[_0x3260e3(0x211)]&&(_0x41cb9b[_0x3260e3(0x219)]>0x0||_0x207776[_0x3260e3(0x219)]>0x0)){if(!isInteractive())return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x263)]('\x0aError:'),_0x3260e3(0x1c7)),console['error'](a27_0x58417c[_0x3260e3(0x256)](_0x3260e3(0x1f0))),0x1;const _0x3f45c6=await confirmKey('Write\x20'+(_0x41cb9b[_0x3260e3(0x219)]+_0x207776[_0x3260e3(0x219)])+_0x3260e3(0x1cb));if(!_0x3f45c6)return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x1d6)](_0x3260e3(0x1d0)),_0x3260e3(0x294)),0x1;}!existsSync(_0x3d490c)&&mkdirSync(_0x3d490c,{'recursive':!![]});const _0x5e9247=a27_0x4af32d[_0x3260e3(0x1c1)](_0x3d490c,_0x3260e3(0x221));writeFileSync(_0x5e9247,createTdxConfigContent(_0x24e462),_0x3260e3(0x198));for(const _0xec8149 of _0xef995c){(_0xec8149['isNew']||_0xec8149[_0x3260e3(0x1ad)])&&writeFileSync(_0xec8149[_0x3260e3(0x1d1)],_0xec8149[_0x3260e3(0x200)],_0x3260e3(0x198));}return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x237)](_0x3260e3(0x280)+(_0x41cb9b[_0x3260e3(0x219)]+_0x207776[_0x3260e3(0x219)])+_0x3260e3(0x1c8)+_0x3d490c)),saveSessionContext({'parent_segment':_0x24e462},_0x158192['session']),console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x237)](_0x3260e3(0x25d)+a27_0x58417c[_0x3260e3(0x256)](_0x3260e3(0x26c))+_0x3260e3(0x272)+a27_0x58417c[_0x3260e3(0x24e)](_0x24e462))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x272d82(0x27f);['description']=a27_0x272d82(0x1b8);async['execute'](_0x39e35d){const _0x53222b=a27_0x272d82,{options:_0x19986e,args:_0x2d876b,tdx:_0x3c349f}=_0x39e35d,_0x3a884b=_0x2d876b[0x0];if(!requireNameOrPath(_0x3a884b))return 0x1;_0x19986e[_0x53222b(0x1f4)]&&console[_0x53222b(0x1f1)](_0x53222b(0x288)+_0x3a884b);const {journeyId:_0x6fe0f2}=await resolveJourneyIdFromInput(_0x3a884b,_0x19986e,_0x3c349f),_0x5b3fff=await withSpinner('Getting\x20column\x20mapping...',()=>_0x3c349f[_0x53222b(0x1d3)][_0x53222b(0x20f)](_0x6fe0f2),{'verbose':_0x19986e[_0x53222b(0x1f4)]}),_0x3ecbc1=_0x5b3fff['data'];return console['log'](_0x53222b(0x1e5)+_0x3ecbc1['database']),console[_0x53222b(0x1b3)]('Table:\x20'+_0x3ecbc1[_0x53222b(0x291)]),await handleSDKOutput(_0x3ecbc1[_0x53222b(0x24f)],_0x19986e),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x272d82(0x25a)]=a27_0x272d82(0x210);[a27_0x272d82(0x20a)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x272d82(0x1ed)](_0x16c70e){const _0x9182ba=a27_0x272d82,{options:_0x28abc2,args:_0x1c1045,tdx:_0x38f328}=_0x16c70e,_0x430ea6=_0x1c1045[0x0];if(!requireNameOrPath(_0x430ea6))return 0x1;_0x28abc2['verbose']&&console[_0x9182ba(0x1f1)](_0x9182ba(0x288)+_0x430ea6);const {journeyId:_0x130058}=await resolveJourneyIdFromInput(_0x430ea6,_0x28abc2,_0x38f328),_0x343df6=await withSpinner(_0x9182ba(0x230),()=>_0x38f328[_0x9182ba(0x1d3)][_0x9182ba(0x19c)](_0x130058),{'verbose':_0x28abc2['verbose']}),_0x36f9b9=_0x343df6[_0x9182ba(0x28a)];return console[_0x9182ba(0x1f1)](_0x9182ba(0x279)+_0x36f9b9[_0x9182ba(0x219)]+_0x9182ba(0x271)+(_0x36f9b9[_0x9182ba(0x219)]!==0x1?'s':'')),await handleSDKOutput(_0x36f9b9,_0x28abc2),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x272d82(0x282);[a27_0x272d82(0x20a)]=a27_0x272d82(0x28d);[a27_0x272d82(0x1f6)]=new SegmentPushCommand();async[a27_0x272d82(0x1ed)](_0x45071f){const _0xa8b3ad=a27_0x272d82,_0x141f93=_0x45071f['args'][0x0];let _0x5b56b6;if(_0x141f93){const _0x460483=await resolveTarget({'arg':_0x141f93,'contextParent':_0x45071f[_0xa8b3ad(0x1df)][_0xa8b3ad(0x26f)],'cwd':process[_0xa8b3ad(0x1cc)]()});isSuccessfulResolution(_0x460483)&&_0x460483[_0xa8b3ad(0x268)]===_0xa8b3ad(0x216)&&(_0x5b56b6=_0x460483[_0xa8b3ad(0x22a)]);}const _0x20bdc5={..._0x45071f,'options':{..._0x45071f[_0xa8b3ad(0x1df)],'journeysOnly':!![],..._0x5b56b6&&{'singleFilePath':_0x5b56b6}}};return this['segmentPushCommand'][_0xa8b3ad(0x1ed)](_0x20bdc5);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x272d82(0x25a)]='journey:versions';[a27_0x272d82(0x20a)]=a27_0x272d82(0x1ae);async['execute'](_0x2ac52a){const _0x150c25=a27_0x272d82,{options:_0x4fccad,args:_0x1cc0c5,tdx:_0x3de626}=_0x2ac52a,_0xfdcc65=_0x1cc0c5[0x0];if(!requireNameOrPath(_0xfdcc65))return 0x1;if(_0x4fccad[_0x150c25(0x1f4)])console[_0x150c25(0x1f1)]('Input:\x20'+_0xfdcc65);const {journeyId:_0x51e138}=await resolveJourneyIdFromInput(_0xfdcc65,_0x4fccad,_0x3de626),_0x420992=await withSpinner('Listing\x20journey\x20versions...',()=>_0x3de626[_0x150c25(0x1d3)][_0x150c25(0x1e9)](_0x51e138),{'verbose':_0x4fccad[_0x150c25(0x1f4)]}),{bundleName:_0x443bd4,versions:_0x1434d4,latestJourneyId:_0x5c5988}=_0x420992['data'];console[_0x150c25(0x1f1)](_0x443bd4+':\x20'+_0x1434d4[_0x150c25(0x219)]+_0x150c25(0x253)+(_0x1434d4[_0x150c25(0x219)]!==0x1?'s':''));const _0x5197ef=_0x1434d4[_0x150c25(0x197)](_0x1d8b20=>({'version':_0x1d8b20[_0x150c25(0x218)],'journey_id':_0x1d8b20[_0x150c25(0x1ea)],'name':_0x1d8b20[_0x150c25(0x25a)],'state':_0x1d8b20[_0x150c25(0x1b2)],'paused':_0x1d8b20['paused'],'latest':_0x1d8b20['journeyId']===_0x5c5988,'created_at':_0x1d8b20[_0x150c25(0x25f)]}));return await handleSDKOutput(_0x5197ef,_0x4fccad),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x272d82(0x25a)]=a27_0x272d82(0x293);[a27_0x272d82(0x20a)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x272d82(0x1ed)](_0x2249b9){const _0x116fb9=a27_0x272d82,{options:_0x4a9fb9,args:_0x380a0a,tdx:_0x2e41a7}=_0x2249b9,_0x16abb5=_0x380a0a[0x0];if(!requireNameOrPath(_0x16abb5))return 0x1;if(_0x4a9fb9[_0x116fb9(0x1f4)])console[_0x116fb9(0x1f1)](_0x116fb9(0x288)+_0x16abb5);const {journeyId:_0x3762c,journeyName:_0x1ab763}=await resolveJourneyIdFromInput(_0x16abb5,_0x4a9fb9,_0x2e41a7);if(!_0x4a9fb9[_0x116fb9(0x211)]){const _0x4f3ff0=await confirm(_0x116fb9(0x22f)+_0x1ab763+'\x22?');if(!_0x4f3ff0)return console[_0x116fb9(0x1f1)](_0x116fb9(0x1bf)),0x0;}const _0x4b2dd1=await withSpinner(_0x116fb9(0x1a7),()=>_0x2e41a7[_0x116fb9(0x1d3)][_0x116fb9(0x1e7)](_0x3762c),{'verbose':_0x4a9fb9['verbose']}),_0x473fbd=_0x4b2dd1['data'];return console[_0x116fb9(0x1f1)](a27_0x58417c['green']('✔')+_0x116fb9(0x259)+_0x473fbd[_0x116fb9(0x1ef)]['versionNumber']+_0x116fb9(0x1a3)+_0x473fbd['attributes'][_0x116fb9(0x25a)]+'\x22'),console[_0x116fb9(0x1f1)](_0x116fb9(0x235)+_0x473fbd['id']),await handleSingleObjectOutput({'id':_0x473fbd['id'],'name':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x25a)],'version':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x218)],'state':_0x473fbd['attributes'][_0x116fb9(0x1b2)],'bundle_id':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x23d)],'created_at':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x25f)]},_0x4a9fb9),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';['description']=a27_0x272d82(0x23a);async[a27_0x272d82(0x1ed)](_0x4175f5){const _0x208b8d=a27_0x272d82,{options:_0x41b396,args:_0x4677bc,tdx:_0x45e2de}=_0x4175f5,_0x557b1c=_0x4677bc[0x0];if(!requireNameOrPath(_0x557b1c))return 0x1;const _0x2882d1=_0x41b396['version'];if(!_0x2882d1)return console[_0x208b8d(0x1f1)]('Error:\x20--version\x20option\x20is\x20required'),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x4e0238=parseInt(_0x2882d1,0xa);if(isNaN(_0x4e0238)||_0x4e0238<0x1)return console['error'](_0x208b8d(0x1e2)+_0x2882d1),0x1;if(_0x41b396['verbose'])console[_0x208b8d(0x1f1)](_0x208b8d(0x288)+_0x557b1c+',\x20version:\x20'+_0x4e0238);const {journeyId:_0x485899,parentSegmentId:_0x247082}=await resolveJourneyIdFromInput(_0x557b1c,_0x41b396,_0x45e2de),_0x4b6117=await withSpinner(_0x208b8d(0x22d),()=>_0x45e2de[_0x208b8d(0x1d3)][_0x208b8d(0x1e9)](_0x485899),{'verbose':_0x41b396['verbose']}),{versions:_0x4ebeda,latestJourneyId:_0x24c20d}=_0x4b6117[_0x208b8d(0x28a)],_0x446396=_0x4ebeda[_0x208b8d(0x1ff)](_0x2551e8=>_0x2551e8[_0x208b8d(0x218)]===_0x4e0238);if(!_0x446396){const _0x3ceb71=_0x4ebeda[_0x208b8d(0x197)](_0x534795=>'v'+_0x534795['versionNumber'])[_0x208b8d(0x1c1)](',\x20');return console['error']('Error:\x20Version\x20'+_0x4e0238+_0x208b8d(0x28f)+_0x3ceb71),0x1;}const _0x56f275=await withSpinner(_0x208b8d(0x196)+_0x4e0238+_0x208b8d(0x26a),()=>_0x45e2de[_0x208b8d(0x1d3)][_0x208b8d(0x217)](_0x446396[_0x208b8d(0x1ea)]),{'verbose':_0x41b396[_0x208b8d(0x1f4)]}),_0x55be3d=_0x56f275[_0x208b8d(0x28a)],_0x44e2f0=getConsoleNextUrl(_0x41b396[_0x208b8d(0x1cf)],_0x208b8d(0x1e8)+_0x247082+_0x208b8d(0x1fb)+_0x446396[_0x208b8d(0x1ea)]+_0x208b8d(0x22e));return await handleSingleObjectOutput({'id':_0x55be3d['id'],'name':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x25a)],'version':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x218)],'description':_0x55be3d['attributes'][_0x208b8d(0x20a)],'state':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x1b2)],'paused':_0x55be3d[_0x208b8d(0x1ef)]['paused'],'reentry_mode':_0x55be3d['attributes'][_0x208b8d(0x204)],'stages':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x23b)]?.[_0x208b8d(0x219)]||0x0,..._0x55be3d['attributes'][_0x208b8d(0x1d7)]&&{'goal':_0x55be3d['attributes']['goal'][_0x208b8d(0x25a)]},'latest':_0x446396[_0x208b8d(0x1ea)]===_0x24c20d,'created_at':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x25f)],'updated_at':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x209)],'url':_0x44e2f0},_0x41b396),0x0;}}
1
+ const a27_0x69e9dc=a27_0x26e4;(function(_0x4800a0,_0x6483f5){const _0x157a22=a27_0x26e4,_0x8143e3=_0x4800a0();while(!![]){try{const _0x5bcbe9=-parseInt(_0x157a22(0x12c))/0x1+-parseInt(_0x157a22(0x116))/0x2+parseInt(_0x157a22(0xb9))/0x3*(-parseInt(_0x157a22(0x128))/0x4)+-parseInt(_0x157a22(0x18a))/0x5+parseInt(_0x157a22(0xca))/0x6*(parseInt(_0x157a22(0x181))/0x7)+-parseInt(_0x157a22(0x1a6))/0x8*(-parseInt(_0x157a22(0x100))/0x9)+parseInt(_0x157a22(0x198))/0xa*(parseInt(_0x157a22(0xe5))/0xb);if(_0x5bcbe9===_0x6483f5)break;else _0x8143e3['push'](_0x8143e3['shift']());}catch(_0x4188ab){_0x8143e3['push'](_0x8143e3['shift']());}}}(a27_0x1d10,0xbed16));import a27_0x1d22cc from'chalk';import a27_0x533657 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x9bbcc3){const _0x2063fc=a27_0x26e4;return!_0x9bbcc3&&(console[_0x2063fc(0xfa)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x2063fc(0x1cc))),!!_0x9bbcc3;}function withJsonFormat(_0x5edf44){const _0xec2904=a27_0x26e4;if(!_0x5edf44[_0xec2904(0x16d)]&&!_0x5edf44[_0xec2904(0xd1)]&&!_0x5edf44['jsonl']&&!_0x5edf44[_0xec2904(0x13a)])return{..._0x5edf44,'format':_0xec2904(0xd1),'json':!![]};return _0x5edf44;}function formatJourneyState(_0x2fcc79){const _0x3220e4=a27_0x26e4;switch(_0x2fcc79){case'launched':return a27_0x1d22cc['green'](_0x3220e4(0x1c3));case'draft':return a27_0x1d22cc[_0x3220e4(0x124)](_0x3220e4(0x1a8));case'paused':return a27_0x1d22cc[_0x3220e4(0xea)](_0x3220e4(0xc3));case _0x3220e4(0xe3):return a27_0x1d22cc[_0x3220e4(0x139)](_0x3220e4(0x10f));case _0x3220e4(0x18b):return a27_0x1d22cc[_0x3220e4(0x124)](_0x3220e4(0x11c));default:return'('+_0x2fcc79+')';}}function formatJourneyItem(_0x4d2657,_0x27d035='',_0xe8235d){const _0x1dbaf3=a27_0x26e4,_0x11624b=formatJourneyState(_0x4d2657[_0x1dbaf3(0x104)]),_0x3c3880=_0xe8235d?hyperlink(_0x4d2657[_0x1dbaf3(0x151)],_0xe8235d):_0x4d2657['journeyBundleName'];return _0x27d035+_0x1dbaf3(0x1bd)+_0x3c3880+'\x20'+_0x11624b;}function escapeRegex(_0x560aad){const _0x28be90=a27_0x26e4;return _0x560aad[_0x28be90(0x141)](/[.*+?^${}()|[\]\\]/g,_0x28be90(0x143));}function globToRegex(_0x4be113){const _0x1f199a=a27_0x26e4,_0x48fceb=_0x4be113[_0x1f199a(0x14a)]('*')[_0x1f199a(0x19e)](escapeRegex);return new RegExp(_0x48fceb[_0x1f199a(0x11e)]('.*'),'i');}function buildRuleToNameMapping(_0x5cbe94){const _0x52d224=a27_0x26e4,_0xbe1368=new Map();if(_0x5cbe94[_0x52d224(0xcf)])for(const [_0x1fa861,_0x440dba]of Object[_0x52d224(0x185)](_0x5cbe94[_0x52d224(0xcf)])){if(_0x440dba['rule']){const _0x57004d=serializeRule(_0x440dba['rule']),_0x11ec64=_0xbe1368['get'](_0x57004d);_0x11ec64?_0x11ec64[_0x52d224(0x146)](_0x1fa861):_0xbe1368[_0x52d224(0x152)](_0x57004d,[_0x1fa861]);}}return _0xbe1368;}async function resolveJourneyIdFromInput(_0x42aaca,_0x109e09,_0x1e3fa3){const _0x567f57=a27_0x26e4,_0x3923dd=await resolveJourneyTarget(_0x42aaca,_0x109e09[_0x567f57(0xc6)],_0x109e09[_0x567f57(0xd4)]),_0xa31127=_0x3923dd['parentSegment'];if(!_0xa31127)throw new SDKError(ErrorCode[_0x567f57(0x199)],_0x567f57(0x1ad));const _0x24cf3f=await withSpinner(_0x567f57(0xf9),()=>_0x1e3fa3[_0x567f57(0x102)][_0x567f57(0x158)](_0xa31127),{'verbose':_0x109e09['verbose']}),_0x56c071=_0x24cf3f[_0x567f57(0x131)],_0x2cde2d=await withSpinner(_0x567f57(0xfb),()=>_0x1e3fa3['journey'][_0x567f57(0x19c)](_0x56c071,_0x3923dd[_0x567f57(0x1b2)]),{'verbose':_0x109e09[_0x567f57(0xd4)]});return{'journeyId':_0x2cde2d['data'],'journeyName':_0x3923dd['journeyName'],'parentSegmentId':_0x56c071};}async function resolveJourneyTarget(_0x450712,_0xeb1e74,_0x4443ea){const _0x1e89da=a27_0x26e4;if(isYamlFilePath(_0x450712))try{const _0x7eea90=await resolveYamlFilePath(_0x450712);return _0x4443ea&&(console[_0x1e89da(0xfa)]('Resolved\x20YAML\x20file:\x20'+_0x450712),console['error'](_0x1e89da(0x196)+_0x7eea90[_0x1e89da(0xc6)]),console['error'](_0x1e89da(0x136)+_0x7eea90[_0x1e89da(0x1ac)]),console[_0x1e89da(0xfa)](_0x1e89da(0x150)+(_0x7eea90[_0x1e89da(0x126)]||_0x1e89da(0xcc)))),{'journeyName':_0x7eea90[_0x1e89da(0x1ac)],'parentSegment':_0x7eea90[_0x1e89da(0xc6)],'resolved':_0x7eea90};}catch(_0x765d06){throw new SDKError(ErrorCode[_0x1e89da(0x199)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x765d06[_0x1e89da(0x177)]);}if(!_0xeb1e74)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1e89da(0x180));return{'journeyName':_0x450712,'parentSegment':_0xeb1e74};}export class JourneyListCommand extends BaseCommand{['name']=a27_0x69e9dc(0x138);[a27_0x69e9dc(0xda)]='List\x20journeys\x20in\x20current\x20context';async['execute'](_0x5bbc9c){const _0x1a2ecb=a27_0x69e9dc,{options:_0x54534e,args:_0x2189d5,tdx:_0x16fc69}=_0x5bbc9c,_0x2cb250=_0x2189d5[0x0],_0xf553e1=_0x54534e[_0x1a2ecb(0xc6)];if(!_0xf553e1)return console['error']('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0x1a2ecb(0x13c)),0x1;const _0x4abeee=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x16fc69[_0x1a2ecb(0x102)][_0x1a2ecb(0x158)](_0xf553e1),{'verbose':_0x54534e[_0x1a2ecb(0xd4)]}),_0x3be5ef=_0x4abeee['data'];_0x54534e[_0x1a2ecb(0xd4)]&&(console[_0x1a2ecb(0xfa)](_0x1a2ecb(0x14f)+_0xf553e1+_0x1a2ecb(0xe1)+_0x3be5ef+')'),_0x2cb250&&console[_0x1a2ecb(0xfa)](_0x1a2ecb(0x16f)+_0x2cb250));const _0x541f52=await withSpinner(_0x1a2ecb(0xe9),()=>_0x16fc69[_0x1a2ecb(0x102)][_0x1a2ecb(0x103)](_0x3be5ef),{'verbose':_0x54534e['verbose']}),_0x346536=_0x541f52[_0x1a2ecb(0x131)],_0x272cda=_0x346536[_0x1a2ecb(0x164)],_0x3fa852=await withSpinner(_0x1a2ecb(0x1c4),()=>_0x16fc69[_0x1a2ecb(0x13b)]['listJourneysWithFolders'](_0x3be5ef,_0x272cda),{'verbose':_0x54534e[_0x1a2ecb(0xd4)]});let _0x5e189e=_0x3fa852[_0x1a2ecb(0x131)]['journeys'];const _0x2a8338=_0x3fa852[_0x1a2ecb(0x131)][_0x1a2ecb(0xf0)],_0x201710=new Map();for(const _0x1f8853 of _0x2a8338){_0x201710[_0x1a2ecb(0x152)](_0x1f8853['id'],_0x1f8853[_0x1a2ecb(0x137)]);}if(_0x2cb250){const _0x4038eb=globToRegex(_0x2cb250);_0x5e189e=_0x5e189e['filter'](_0x5ef3bd=>_0x4038eb[_0x1a2ecb(0x174)](_0x5ef3bd[_0x1a2ecb(0x151)]));}console[_0x1a2ecb(0xfa)]('✔\x20Found\x20'+_0x5e189e[_0x1a2ecb(0xed)]+_0x1a2ecb(0x187)+(_0x5e189e['length']!==0x1?'s':''));const _0xc3cbe=_0x56cb4e=>{const _0x9bc288=_0x1a2ecb;return getConsoleNextUrl(_0x54534e['site'],_0x9bc288(0x15a)+_0x3be5ef+_0x9bc288(0x192)+_0x56cb4e+_0x9bc288(0x188));};if(_0x54534e[_0x1a2ecb(0x16d)]===_0x1a2ecb(0xfc))await handleSDKOutput(_0x5e189e,_0x54534e);else{if(_0x54534e[_0x1a2ecb(0x16d)]==='json'){const _0x111435=_0x5e189e[_0x1a2ecb(0x19e)](_0x343601=>({..._0x343601,'url':_0xc3cbe(_0x343601['id'])}));await handleSDKOutput(_0x111435,_0x54534e);}else{console[_0x1a2ecb(0x132)]('['+_0xf553e1+']');const _0x597d73=new Map(),_0x1391a7=[];for(const _0x296c2c of _0x5e189e){if(!_0x296c2c[_0x1a2ecb(0xbf)]||_0x296c2c[_0x1a2ecb(0xbf)]===_0x272cda)_0x1391a7[_0x1a2ecb(0x146)](_0x296c2c);else{const _0x54c50e=_0x597d73[_0x1a2ecb(0xf8)](_0x296c2c[_0x1a2ecb(0xbf)])||[];_0x54c50e[_0x1a2ecb(0x146)](_0x296c2c),_0x597d73[_0x1a2ecb(0x152)](_0x296c2c['folderId'],_0x54c50e);}}const _0x38eb1a=(_0x330e88,_0x187799)=>_0x330e88[_0x1a2ecb(0x151)][_0x1a2ecb(0x157)](_0x187799['journeyBundleName'],undefined,{'sensitivity':_0x1a2ecb(0xd8)});_0x1391a7[_0x1a2ecb(0x162)](_0x38eb1a);for(const _0x3866aa of _0x1391a7){console[_0x1a2ecb(0x132)](formatJourneyItem(_0x3866aa,'',_0xc3cbe(_0x3866aa['id'])));}const _0x27369c=[..._0x597d73[_0x1a2ecb(0x185)]()][_0x1a2ecb(0x162)]((_0x5639ce,_0x46119b)=>{const _0x466e96=_0x1a2ecb,_0xb47fb6=_0x201710[_0x466e96(0xf8)](_0x5639ce[0x0])||_0x5639ce[0x0],_0x488758=_0x201710[_0x466e96(0xf8)](_0x46119b[0x0])||_0x46119b[0x0];return _0xb47fb6[_0x466e96(0x157)](_0x488758,undefined,{'sensitivity':_0x466e96(0xd8)});});for(const [_0x14ca65,_0x5befb2]of _0x27369c){const _0x4ccc4b=_0x201710[_0x1a2ecb(0xf8)](_0x14ca65)||_0x14ca65;console[_0x1a2ecb(0x132)]('📁\x20'+_0x4ccc4b),_0x5befb2[_0x1a2ecb(0x162)](_0x38eb1a);for(const _0xdb900c of _0x5befb2){console[_0x1a2ecb(0x132)](formatJourneyItem(_0xdb900c,'\x20\x20',_0xc3cbe(_0xdb900c['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x10a);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0xee);async[a27_0x69e9dc(0xf2)](_0x4d7b2b){const _0x1a23c4=a27_0x69e9dc,{options:_0x5c49dd,args:_0x268234,tdx:_0x4f7ba5}=_0x4d7b2b,_0x4e9b22=_0x268234[0x0];if(!_0x4e9b22)return console[_0x1a23c4(0xfa)](_0x1a23c4(0x121)),console[_0x1a23c4(0xfa)](_0x1a23c4(0x1a0)),console['error'](_0x1a23c4(0xc8)),console['error'](_0x1a23c4(0xdd)),0x1;_0x5c49dd[_0x1a23c4(0xd4)]&&console[_0x1a23c4(0xfa)]('Input:\x20'+_0x4e9b22);const {journeyId:_0x43291e,parentSegmentId:_0xa8689c}=await resolveJourneyIdFromInput(_0x4e9b22,_0x5c49dd,_0x4f7ba5);if(_0x5c49dd[_0x1a23c4(0xf6)]){const _0x41e11=getConsoleNextUrl(_0x5c49dd['site'],_0x1a23c4(0x15a)+_0xa8689c+_0x1a23c4(0x192)+_0x43291e+_0x1a23c4(0x112));return console[_0x1a23c4(0xfa)](a27_0x1d22cc[_0x1a23c4(0xb5)]('✔')+_0x1a23c4(0x117)+a27_0x1d22cc[_0x1a23c4(0x182)](_0x41e11)),openBrowser(_0x41e11),0x0;}const _0x1516b7=await withSpinner(_0x1a23c4(0xdc),()=>_0x4f7ba5[_0x1a23c4(0x13b)]['getJourney'](_0x43291e),{'verbose':_0x5c49dd[_0x1a23c4(0xd4)]}),_0x1b2578=_0x1516b7[_0x1a23c4(0x131)],_0x48e3be=_0x5c49dd[_0x1a23c4(0xcd)];let _0x284e76;if(_0x48e3be)try{const _0x5b4775=await withSpinner(_0x1a23c4(0x12e),()=>_0x4f7ba5[_0x1a23c4(0x13b)]['getStatistics'](_0x43291e),{'verbose':_0x5c49dd[_0x1a23c4(0xd4)]});_0x284e76=_0x5b4775[_0x1a23c4(0x131)];}catch{_0x5c49dd['verbose']&&console['error'](_0x1a23c4(0xbb));}const _0x162cc9=getConsoleNextUrl(_0x5c49dd[_0x1a23c4(0x171)],_0x1a23c4(0x15a)+_0xa8689c+'/e/'+_0x43291e+_0x1a23c4(0x112)),_0xccf821={'id':_0x1b2578['id'],'name':_0x1b2578['attributes']['name'],'description':_0x1b2578[_0x1a23c4(0xbe)][_0x1a23c4(0xda)],'state':_0x1b2578[_0x1a23c4(0xbe)][_0x1a23c4(0x104)],'paused':_0x1b2578['attributes'][_0x1a23c4(0xf7)],'reentry_mode':_0x1b2578[_0x1a23c4(0xbe)][_0x1a23c4(0x120)],'stages':_0x1b2578[_0x1a23c4(0xbe)][_0x1a23c4(0x189)]?.['length']||0x0,..._0x1b2578['attributes']['goal']&&{'goal':_0x1b2578[_0x1a23c4(0xbe)][_0x1a23c4(0x1c9)][_0x1a23c4(0x137)]},..._0x284e76&&{'statistics':{'size':_0x284e76['size'],'entered':_0x284e76[_0x1a23c4(0x16b)],'goal_achieved':_0x284e76[_0x1a23c4(0x105)],'completion_rate':_0x284e76['completionRate'],'exit_or_jump':_0x284e76[_0x1a23c4(0x1cb)],'exit_or_jump_rate':_0x284e76['exitOrJumpRate'],'stages':_0x284e76[_0x1a23c4(0x176)]}},'url':_0x162cc9};return await handleSingleObjectOutput(_0xccf821,_0x5c49dd),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x1c7);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x1a2);async[a27_0x69e9dc(0xf2)](_0x174cfd){const _0x5f12fc=a27_0x69e9dc,{options:_0x1fe870,args:_0x59d7e2,tdx:_0x52a3c9}=_0x174cfd,_0x455646=_0x59d7e2[0x0];if(!requireNameOrPath(_0x455646))return 0x1;_0x1fe870[_0x5f12fc(0xd4)]&&console['error'](_0x5f12fc(0xc2)+_0x455646);const _0x317f61=_0x1fe870,_0x207e3c=_0x317f61[_0x5f12fc(0x153)],_0x573e7d=_0x317f61['to'],_0xa793fd=_0x317f61['includeHistory'],_0x299fb0=_0x317f61[_0x5f12fc(0x13e)];_0xa793fd&&!_0x207e3c&&!_0x573e7d&&console[_0x5f12fc(0xfa)](_0x5f12fc(0x110));const _0x13a782=_0xa793fd?withJsonFormat(_0x1fe870):_0x1fe870,{journeyId:_0x26c4fd,journeyName:_0x4c7149}=await resolveJourneyIdFromInput(_0x455646,_0x13a782,_0x52a3c9),_0x1292fe=_0x207e3c||_0x573e7d?{'from':_0x207e3c,'to':_0x573e7d}:undefined,_0x5b1a71=await withSpinner(_0x5f12fc(0x12e),()=>Promise['all']([_0x52a3c9[_0x5f12fc(0x13b)][_0x5f12fc(0x17c)](_0x26c4fd),_0x52a3c9[_0x5f12fc(0x13b)][_0x5f12fc(0xfe)](_0x26c4fd,_0x1292fe)]),{'verbose':_0x13a782[_0x5f12fc(0xd4)]}),[_0x8a30f4,_0x5e56bb]=_0x5b1a71[_0x5f12fc(0x131)];if(!_0x5e56bb||_0x5e56bb[_0x5f12fc(0xeb)]===null)return console[_0x5f12fc(0xfa)](_0x5f12fc(0x148)+_0x4c7149),console[_0x5f12fc(0xfa)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x64467e=buildStageNameMap(_0x8a30f4),_0x3bbbb7=!!(_0x1292fe&&_0x5e56bb['history']?.[_0x5f12fc(0xed)]),_0x54e248={'stageNameMap':_0x64467e,'hasPeriod':_0x3bbbb7,'includeHistory':!!_0xa793fd};if(_0x299fb0&&_0x5e56bb[_0x5f12fc(0x176)]){const _0x597e04=_0x5e56bb['stages'][_0x5f12fc(0x119)](_0x17f290=>{const _0x1000e5=_0x5f12fc,_0x5df556=_0x64467e[_0x1000e5(0xf8)](_0x17f290['id'])??'';return _0x5df556['toLowerCase']()===_0x299fb0[_0x1000e5(0xb7)]();});if(_0x597e04)return await handleSingleObjectOutput(formatStageStats(_0x597e04,_0x54e248),_0x13a782),0x0;const _0x1cbe18=_0x5e56bb[_0x5f12fc(0x176)][_0x5f12fc(0x19e)](_0x2028a4=>_0x64467e['get'](_0x2028a4['id'])??_0x2028a4['id']);return console[_0x5f12fc(0xfa)](_0x5f12fc(0xff)+_0x299fb0+_0x5f12fc(0x133)),console[_0x5f12fc(0xfa)](_0x5f12fc(0x15e)+_0x1cbe18[_0x5f12fc(0x11e)](',\x20')),0x1;}const _0x4732c1=_0x5e56bb['stages']?.[_0x5f12fc(0x19e)](_0x5390ec=>formatStageStats(_0x5390ec,_0x54e248)),_0x4fee7a=assembleJourneyStats(_0x5e56bb,{'from':_0x207e3c,'to':_0x573e7d,'includeHistory':_0xa793fd});return await this[_0x5f12fc(0xf3)](_0x4fee7a,_0x4732c1??[],_0x13a782),0x0;}async['renderStats'](_0x32c355,_0x29ad70,_0x12c7e6){const _0x1d57f0=a27_0x69e9dc,_0x2fea3c=_0x12c7e6[_0x1d57f0(0x16d)]===_0x1d57f0(0xd1)||_0x12c7e6[_0x1d57f0(0x16d)]===_0x1d57f0(0xe8)||_0x12c7e6[_0x1d57f0(0xd1)]||_0x12c7e6[_0x1d57f0(0xe8)];if(_0x2fea3c){_0x32c355['stages']=_0x29ad70,await handleSingleObjectOutput(_0x32c355,_0x12c7e6);return;}await handleSingleObjectOutput(_0x32c355,_0x12c7e6);for(const _0x1e451a of _0x29ad70){console['log'](''),console[_0x1d57f0(0x132)](String(a27_0x1d22cc['cyan'][_0x1d57f0(0x1b6)]('['+_0x1e451a[_0x1d57f0(0x137)]+']'))+a27_0x1d22cc['dim']('\x20'+_0x1e451a['id']));const {id:_0x13b97f,name:_0x52973a,..._0x41d91c}=_0x1e451a;await handleSingleObjectOutput(_0x41d91c,_0x12c7e6);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0xb8);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x18e);async[a27_0x69e9dc(0xf2)](_0x4ff5b8){const _0x4dc02f=a27_0x69e9dc,{options:_0x334799,args:_0x49e4dd,tdx:_0x555de3}=_0x4ff5b8,_0x2393e9=_0x49e4dd[0x0];if(!requireNameOrPath(_0x2393e9))return 0x1;_0x334799[_0x4dc02f(0xd4)]&&console[_0x4dc02f(0xfa)](_0x4dc02f(0xc2)+_0x2393e9);const _0x2b4268=_0x334799,_0x595d3e=_0x2b4268[_0x4dc02f(0x172)],_0x4bb2a4=_0x2b4268['from'],_0x4714fc=_0x2b4268['to'],_0x2a3ca8=_0x2b4268[_0x4dc02f(0x130)];if(_0x595d3e&&_0x595d3e!=='conversion'&&_0x595d3e!==_0x4dc02f(0x168))return console[_0x4dc02f(0xfa)](_0x4dc02f(0x140)+_0x595d3e+_0x4dc02f(0x108)),0x1;const _0x211174=withJsonFormat(_0x334799),{journeyId:_0x9f0391,journeyName:_0x3d6a71}=await resolveJourneyIdFromInput(_0x2393e9,_0x211174,_0x555de3),_0x14c2d1={'type':_0x595d3e,'from':_0x4bb2a4,'to':_0x4714fc,'limit':_0x2a3ca8},_0x283fc3=await withSpinner(_0x4dc02f(0x1a9),()=>_0x555de3['journey'][_0x4dc02f(0x190)](_0x9f0391,_0x14c2d1),{'verbose':_0x211174[_0x4dc02f(0xd4)]}),_0x244208=_0x283fc3[_0x4dc02f(0x131)],_0x4c2db7=_0x244208[_0x4dc02f(0xd0)]&&(_0x244208['conversion']['nodes'][_0x4dc02f(0xed)]>0x0||_0x244208[_0x4dc02f(0xd0)]['links'][_0x4dc02f(0xed)]>0x0),_0x149cab=_0x244208['activation']&&_0x244208[_0x4dc02f(0x168)][_0x4dc02f(0xed)]>0x0;if(!_0x4c2db7&&!_0x149cab)return console[_0x4dc02f(0xfa)](_0x4dc02f(0x15f)+_0x3d6a71),console[_0x4dc02f(0xfa)](_0x4dc02f(0x178)),_0x4bb2a4&&_0x4714fc&&console[_0x4dc02f(0xfa)](_0x4dc02f(0x16e)),0x0;return await handleSingleObjectOutput(_0x244208,_0x211174),0x0;}}function formatStageStats(_0x217c8b,_0x2756c9){const _0x45a3fa=a27_0x69e9dc,_0x4ec43d=_0x2756c9['hasPeriod']&&_0x217c8b['history']?.['length']?aggregateStageHistory(_0x217c8b['history']):{'size':_0x217c8b[_0x45a3fa(0x183)],'entered':_0x217c8b['enteredSize'],'milestone':_0x217c8b[_0x45a3fa(0x1a1)],'milestone_rate':_0x217c8b[_0x45a3fa(0x14e)],'exit_or_jump':_0x217c8b[_0x45a3fa(0x1cb)],'exit_or_jump_rate':_0x217c8b[_0x45a3fa(0xc0)]},_0x41df7f={'id':_0x217c8b['id'],'name':_0x2756c9['stageNameMap'][_0x45a3fa(0xf8)](_0x217c8b['id'])??_0x217c8b['id'],..._0x4ec43d};return _0x2756c9['hasPeriod']&&_0x2756c9[_0x45a3fa(0xde)]&&_0x217c8b[_0x45a3fa(0x191)]&&(_0x41df7f['history']=_0x217c8b[_0x45a3fa(0x191)]),_0x41df7f;}export class JourneyPauseCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0xf4);['description']=a27_0x69e9dc(0x111);async['execute'](_0x59fd3b){const _0x3ae492=a27_0x69e9dc,{options:_0x14b18e,args:_0x182a4b,tdx:_0xe302cd}=_0x59fd3b,_0x469724=_0x182a4b[0x0];if(!requireNameOrPath(_0x469724))return 0x1;_0x14b18e[_0x3ae492(0xd4)]&&console[_0x3ae492(0xfa)]('Input:\x20'+_0x469724);const {journeyId:_0x253451,journeyName:_0x380fff}=await resolveJourneyIdFromInput(_0x469724,_0x14b18e,_0xe302cd);if(!_0x14b18e['yes']){const _0x451845=await confirm(_0x3ae492(0x19b)+_0x380fff+'\x22?');if(!_0x451845)return console[_0x3ae492(0xfa)](_0x3ae492(0xe2)),0x0;}const _0x1f9f00=await withSpinner(_0x3ae492(0x17e),()=>_0xe302cd[_0x3ae492(0x13b)][_0x3ae492(0xd2)](_0x253451),{'verbose':_0x14b18e[_0x3ae492(0xd4)]}),_0x16b819=_0x1f9f00[_0x3ae492(0x131)];return console[_0x3ae492(0xfa)](_0x3ae492(0x1a7)+_0x16b819[_0x3ae492(0xbe)][_0x3ae492(0x137)]+_0x3ae492(0x166)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x16c);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x18d);async[a27_0x69e9dc(0xf2)](_0x3bc554){const _0x33752b=a27_0x69e9dc,{options:_0x3ef1e4,args:_0x4d73ba,tdx:_0x170a25}=_0x3bc554,_0x45382f=_0x4d73ba[0x0];if(!requireNameOrPath(_0x45382f))return 0x1;_0x3ef1e4[_0x33752b(0xd4)]&&console[_0x33752b(0xfa)](_0x33752b(0xc2)+_0x45382f);const {journeyId:_0xf88e71,journeyName:_0x106c3f}=await resolveJourneyIdFromInput(_0x45382f,_0x3ef1e4,_0x170a25);if(!_0x3ef1e4[_0x33752b(0x125)]){const _0x5b251b=await confirm(_0x33752b(0x1ba)+_0x106c3f+'\x22?');if(!_0x5b251b)return console[_0x33752b(0xfa)]('Cancelled'),0x0;}const _0x11c88c=await withSpinner(_0x33752b(0x109),()=>_0x170a25[_0x33752b(0x13b)][_0x33752b(0x1b4)](_0xf88e71),{'verbose':_0x3ef1e4[_0x33752b(0xd4)]}),_0x4cc239=_0x11c88c[_0x33752b(0x131)];return console[_0x33752b(0xfa)](_0x33752b(0x1a7)+_0x4cc239[_0x33752b(0xbe)][_0x33752b(0x137)]+'\x22\x20resumed'),0x0;}}function a27_0x26e4(_0x1378b8,_0x167350){_0x1378b8=_0x1378b8-0xb4;const _0x1d10b7=a27_0x1d10();let _0x26e4fe=_0x1d10b7[_0x1378b8];return _0x26e4fe;}export class JourneyPullCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x14b);['description']=a27_0x69e9dc(0x18c);async[a27_0x69e9dc(0xf2)](_0x147011){const _0x235556=a27_0x69e9dc,{options:_0x54b4f9,args:_0x1d7f44,tdx:_0x4ca9b8}=_0x147011,_0x3e6dea=_0x54b4f9,_0x41a588=_0x1d7f44[0x0],_0x1dd172=_0x41a588&&isYamlFilePath(_0x41a588),_0x34c8eb=await resolveTarget({'arg':_0x1dd172?_0x41a588:undefined,'contextParent':_0x54b4f9[_0x235556(0xc6)],'cwd':process[_0x235556(0x1a4)]()});if(!isSuccessfulResolution(_0x34c8eb))return _0x34c8eb['errorCode']===_0x235556(0x19f)?(console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xea)](_0x235556(0xe6))),console['error'](_0x235556(0x114)),console['error'](_0x235556(0x10e)),console[_0x235556(0xfa)](_0x235556(0x186)),console[_0x235556(0xfa)](_0x235556(0xd5))):(console[_0x235556(0xfa)](a27_0x1d22cc['red'](_0x235556(0x122)+_0x34c8eb[_0x235556(0x177)]+'\x0a')),_0x34c8eb['helpText']&&console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0x182)](_0x34c8eb[_0x235556(0x10c)]))),0x1;let _0x69f1cb=_0x1dd172?undefined:_0x41a588,_0x318f1c,_0xb08bad;_0x34c8eb[_0x235556(0x172)]===_0x235556(0x19a)&&(_0x69f1cb=_0x34c8eb['resourceName'],_0x318f1c=_0x34c8eb[_0x235556(0x12d)],_0xb08bad=_0x34c8eb[_0x235556(0x126)]);const _0x201548=_0x34c8eb[_0x235556(0xc4)],_0x8faad3=_0x34c8eb[_0x235556(0xb4)];_0x3e6dea[_0x235556(0xd4)]&&(console[_0x235556(0xfa)](_0x235556(0x14f)+_0x201548),console[_0x235556(0xfa)](_0x235556(0x179)+_0x8faad3),_0x69f1cb&&console['error']('Journey\x20name:\x20'+_0x69f1cb),_0x318f1c&&console[_0x235556(0xfa)](_0x235556(0xdb)+_0x318f1c),_0xb08bad&&console['error'](_0x235556(0x10d)+_0xb08bad));const _0x7c65d9=await withSpinner(_0x235556(0xf9),()=>_0x4ca9b8[_0x235556(0x102)]['resolveParentId'](_0x201548),{'verbose':_0x54b4f9[_0x235556(0xd4)]}),_0x5af1ae=_0x7c65d9['data'],{journeys:_0x42d94b,folders:_0x42d49e}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x8861c6=_0x235556,[_0x179572,_0x1f5ccc]=await Promise[_0x8861c6(0xe0)]([_0x4ca9b8[_0x8861c6(0x13b)][_0x8861c6(0xdf)](_0x5af1ae,undefined,{'includeAllVersions':!![]}),_0x4ca9b8['segment']['listFolders'](_0x5af1ae)]);return{'journeys':_0x179572,'folders':_0x1f5ccc};},{'verbose':_0x54b4f9['verbose']})[_0x235556(0xc5)](_0x133c22=>_0x133c22[_0x235556(0x131)]);let _0x9234d1=_0x42d94b;const _0x34c163=buildFolderIdToPathMap(_0x42d49e);if(_0x69f1cb){const _0x42ac62=_0x9234d1['filter'](_0x36461d=>_0x36461d[_0x235556(0x151)][_0x235556(0xb7)]()===_0x69f1cb[_0x235556(0xb7)]());if(_0x42ac62[_0x235556(0xed)]===0x0)return console['error'](_0x235556(0x1aa)+_0x69f1cb),console[_0x235556(0xfa)](_0x235556(0x1bc)),0x1;_0x9234d1=_0x42ac62;}if(_0xb08bad!==undefined){const _0x23eba9=_0x9234d1[_0x235556(0x12f)](_0x20c574=>{const _0x1e947b=_0x235556,_0x1f54f5=_0x20c574[_0x1e947b(0xbf)]?_0x34c163[_0x1e947b(0xf8)](_0x20c574[_0x1e947b(0xbf)])||'':'';return _0x1f54f5===_0xb08bad;});if(_0x23eba9[_0x235556(0xed)]===0x0&&_0x9234d1[_0x235556(0xed)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x69f1cb+_0x235556(0xc9)+(_0xb08bad||_0x235556(0x11b))),console['error'](_0x235556(0xf1));for(const _0xe50ed4 of _0x9234d1){const _0xee9818=_0xe50ed4[_0x235556(0xbf)]?_0x34c163[_0x235556(0xf8)](_0xe50ed4[_0x235556(0xbf)])||'':'';console[_0x235556(0xfa)](_0x235556(0x161)+(_0xee9818||_0x235556(0xcc))+'/'+_0xe50ed4['journeyBundleName']);}return 0x1;}_0x9234d1=_0x23eba9;}if(_0x9234d1[_0x235556(0xed)]===0x0)return console[_0x235556(0xfa)]('No\x20journeys\x20found'),0x0;const _0x163d6e=new Map();for(const _0x3968c6 of _0x9234d1){const _0x493be5=_0x3968c6['journeyBundleId'];!_0x163d6e['has'](_0x493be5)&&_0x163d6e[_0x235556(0x152)](_0x493be5,[]),_0x163d6e[_0x235556(0xf8)](_0x493be5)[_0x235556(0x146)](_0x3968c6);}for(const _0x47e5fb of _0x163d6e[_0x235556(0xd7)]()){_0x47e5fb[_0x235556(0x162)]((_0xdbe8e0,_0x3aea7a)=>(_0xdbe8e0[_0x235556(0x1b7)]||0x0)-(_0x3aea7a['versionNumber']||0x0));}const _0x70fb66=[],{idToEmailMap:_0x4a7aa9,connectionIdToNameMap:_0x2aa76c}=await withSpinner(_0x235556(0x13f),async()=>{const _0x25c71a=_0x235556,[_0x17b60f,_0x4b5847]=await Promise[_0x25c71a(0xe0)]([_0x4ca9b8[_0x25c71a(0x17d)][_0x25c71a(0x159)](),_0x4ca9b8[_0x25c71a(0xd6)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x17b60f,'connectionIdToNameMap':_0x4b5847};},{'verbose':_0x54b4f9[_0x235556(0xd4)]})[_0x235556(0xc5)](_0x6c42e6=>_0x6c42e6['data']);for(const _0x395ca8 of _0x163d6e[_0x235556(0xd7)]()){const _0x3d439c=_0x395ca8[0x0][_0x235556(0x151)],_0x242f1b=_0x395ca8[0x0]['folderId'],_0x5e82d7=_0x242f1b?_0x34c163[_0x235556(0xf8)](_0x242f1b)||'':'',_0x51b823=_0x5e82d7?a27_0x533657[_0x235556(0x11e)](_0x8faad3,_0x5e82d7):_0x8faad3,_0x25715f=_0x318f1c||a27_0x533657[_0x235556(0x11e)](_0x51b823,sanitizeFileName(_0x3d439c)+_0x235556(0x1c5));let _0x4a51ac,_0x5f1fb3;if(existsSync(_0x25715f))try{const _0x2ebeb4=readFileSync(_0x25715f,_0x235556(0x1c6)),_0x9642e8=parseYamlString(_0x2ebeb4);_0x5f1fb3=_0x9642e8,_0x4a51ac=buildRuleToNameMapping(_0x9642e8),_0x3e6dea[_0x235556(0xd4)]&&_0x4a51ac['size']>0x0&&console[_0x235556(0xfa)](_0x235556(0x170)+_0x4a51ac[_0x235556(0x183)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x3d439c);}catch(_0x2a9168){_0x3e6dea[_0x235556(0xd4)]&&console[_0x235556(0xfa)](_0x235556(0x1af)+_0x2a9168[_0x235556(0x177)]);}const _0x57f2bc=[],_0x431a45=new Set(),_0x5db5fa=new Map(),_0x18d414=new Map(),_0x58093a=new Set(),_0x2f6020=new Map(),_0x51cb7b=new Map(),_0x26dc8a=createJumpTargetCache();await withProgressSpinner(_0x235556(0x14c)+_0x3d439c+_0x235556(0x147),async _0x1c1d73=>{const _0x2552a2=_0x235556;for(const _0x5afec0 of _0x395ca8){const _0x45c388=_0x395ca8[_0x2552a2(0xed)]>0x1?_0x5afec0[_0x2552a2(0x151)]+'\x20v'+(_0x5afec0['versionNumber']||0x1):_0x5afec0['journeyBundleName'];_0x1c1d73[_0x2552a2(0xb6)](_0x2552a2(0x14c)+_0x45c388);const _0x51c36b=await _0x4ca9b8[_0x2552a2(0x13b)][_0x2552a2(0x17c)](_0x5afec0['id']),_0x190823=_0x51c36b['attributes']?.[_0x2552a2(0x145)],_0x2e6e9d={'resolveSegment':async _0x2bb824=>{const _0x1e4951=_0x2552a2;if(!_0x190823)return{'name':_0x2bb824,'isJourneyLocal':![]};const _0x3f37c1=_0x5db5fa['get'](_0x2bb824);if(_0x3f37c1)return _0x3f37c1;try{const _0x51fa22=await _0x4ca9b8[_0x1e4951(0x102)][_0x1e4951(0x1bb)](_0x190823,_0x2bb824),_0x548e93=_0x51fa22['kind']===SEGMENT_KIND_JOURNEY;let _0xa747d8,_0x4232ed=_0x51fa22['name'];if(_0x548e93&&_0x51fa22[_0x1e4951(0x160)]){const _0x3ef7e4=await segmentResponseToDef(_0x51fa22,{'resolveSegmentName':async _0x54d0b4=>{const _0xe68b49=_0x1e4951,_0x13b585=_0x5db5fa['get'](_0x54d0b4);if(_0x13b585)return _0x13b585[_0xe68b49(0x137)];const _0x19f97b=await _0x2e6e9d[_0xe68b49(0x1c0)](_0x54d0b4);return _0x19f97b['name'];}}),_0x5b8a73=_0x3ef7e4[_0x1e4951(0x160)];_0xa747d8={'description':_0x51fa22[_0x1e4951(0xda)],'rule':_0x5b8a73};const _0xf3bf0f=serializeRule(_0x5b8a73),_0x73e46c=_0x18d414[_0x1e4951(0xf8)](_0xf3bf0f);if(_0x73e46c)_0x4232ed=_0x73e46c,_0xa747d8=undefined,_0x3e6dea[_0x1e4951(0xd4)]&&console[_0x1e4951(0xfa)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x51fa22[_0x1e4951(0x137)]+_0x1e4951(0xd3)+_0x73e46c);else{let _0xaf7a23=![];if(_0x4a51ac){const _0x1f48dd=_0x4a51ac['get'](_0xf3bf0f);if(_0x1f48dd){const _0x235df9=_0x1f48dd[_0x1e4951(0x119)](_0x57c1e3=>!_0x431a45[_0x1e4951(0x1c1)](_0x57c1e3));_0x235df9&&(_0x4232ed=_0x235df9,_0x431a45[_0x1e4951(0x15b)](_0x235df9),_0x18d414[_0x1e4951(0x152)](_0xf3bf0f,_0x235df9),_0xaf7a23=!![],_0x3e6dea['verbose']&&console[_0x1e4951(0xfa)](_0x1e4951(0x1b5)+_0x235df9+'\x20(rule\x20match)'));}}if(!_0xaf7a23){const _0x111cfa=generateJourneyLocalName(_0x51fa22[_0x1e4951(0x137)]);_0x111cfa&&(_0x4232ed=_0x111cfa);let _0x90497a=_0x4232ed,_0x52a16a=0x2;while(_0x431a45['has'](_0x90497a)){_0x90497a=_0x4232ed+'_'+_0x52a16a,_0x52a16a++;}_0x431a45[_0x1e4951(0x15b)](_0x90497a),_0x18d414[_0x1e4951(0x152)](_0xf3bf0f,_0x90497a),_0x4232ed=_0x90497a;}}}const _0x1fc7de={'name':_0x4232ed,'isJourneyLocal':_0x548e93,'definition':_0xa747d8};return _0x5db5fa[_0x1e4951(0x152)](_0x2bb824,_0x1fc7de),_0x1fc7de;}catch(_0x365589){return _0x54b4f9[_0x1e4951(0xd4)]&&console[_0x1e4951(0xfa)](_0x1e4951(0x154)+_0x2bb824+':\x20'+_0x365589[_0x1e4951(0x177)]),{'name':_0x2bb824,'isJourneyLocal':![]};}},'resolveActivation':async _0x7f9c9d=>{const _0x3cd4c0=_0x2552a2,_0x4b8240=_0x2f6020[_0x3cd4c0(0xf8)](_0x7f9c9d);if(_0x4b8240)return _0x4b8240;try{const _0x28155a=await _0x4ca9b8[_0x3cd4c0(0x13b)][_0x3cd4c0(0x1b1)](_0x5afec0['id'],_0x7f9c9d),_0x2d0639=journeyActivationStepToYaml(_0x28155a,_0x4a7aa9,_0x2aa76c),_0x38534f=JSON['stringify']({'name':_0x2d0639[_0x3cd4c0(0x137)],'connection':_0x2d0639[_0x3cd4c0(0xd6)],'connector_config':_0x2d0639[_0x3cd4c0(0x12a)]}),_0x598ce0=_0x51cb7b[_0x3cd4c0(0xf8)](_0x38534f);if(_0x598ce0){const _0x200291={'name':_0x598ce0,'isJourneyLocal':!![],'definition':_0x2d0639};return _0x2f6020[_0x3cd4c0(0x152)](_0x7f9c9d,_0x200291),_0x200291;}const _0x202895=_0x28155a[_0x3cd4c0(0xbe)][_0x3cd4c0(0x101)][_0x3cd4c0(0x137)]||_0x7f9c9d,_0x2d9636=sanitizeYamlKey(_0x202895)||_0x3cd4c0(0x193)+_0x7f9c9d;let _0x5af3bb=_0x2d9636,_0x5005b0=0x2;while(_0x58093a[_0x3cd4c0(0x1c1)](_0x5af3bb)){_0x5af3bb=_0x2d9636+'_'+_0x5005b0,_0x5005b0++;}_0x58093a[_0x3cd4c0(0x15b)](_0x5af3bb),_0x51cb7b[_0x3cd4c0(0x152)](_0x38534f,_0x5af3bb);const _0x1d8e9e={'name':_0x5af3bb,'isJourneyLocal':!![],'definition':_0x2d0639};return _0x2f6020[_0x3cd4c0(0x152)](_0x7f9c9d,_0x1d8e9e),_0x1d8e9e;}catch(_0x2a9d5a){return _0x54b4f9['verbose']&&console[_0x3cd4c0(0xfa)](_0x3cd4c0(0x107)+_0x7f9c9d+':\x20'+_0x2a9d5a[_0x3cd4c0(0x177)]),{'name':_0x7f9c9d,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x185a47,_0x149895)=>{const _0x63105e=_0x2552a2;return resolveJumpTarget(_0x185a47,_0x149895,_0x26dc8a,_0x3af7ae=>_0x4ca9b8[_0x63105e(0x13b)]['getJourney'](_0x3af7ae));}},_0x1cd4a1=await journeyResponseToDef(_0x51c36b,_0x2e6e9d);_0x57f2bc[_0x2552a2(0x146)]({'item':_0x5afec0,'yaml':_0x1cd4a1});}},{'verbose':_0x54b4f9[_0x235556(0xd4)]});const _0x49a847=await _0x4ca9b8[_0x235556(0x13b)][_0x235556(0xf5)](_0x395ca8[0x0][_0x235556(0x169)]),_0xab5002=buildMergedJourneyDef(_0x57f2bc,_0x4a51ac,_0x49a847),_0x22364e=normalizeJourneyDef(_0xab5002,_0x5f1fb3),_0x941c3f=toYamlString(_0x22364e),_0x1541a9=_0x318f1c||a27_0x533657[_0x235556(0x11e)](_0x51b823,sanitizeFileName(_0x3d439c)+_0x235556(0x1c5));!_0x318f1c&&_0x5e82d7&&!existsSync(_0x51b823)&&mkdirSync(_0x51b823,{'recursive':!![]});const _0x1124ef=a27_0x533657[_0x235556(0x1c2)](process['cwd'](),_0x1541a9);if(existsSync(_0x1541a9)){const _0x126576=readFileSync(_0x1541a9,_0x235556(0x1c6)),_0x385f7b=generateDiff(_0x126576,_0x941c3f),_0x43202b=hasChanges(_0x385f7b);_0x70fb66['push']({'relativePath':_0x1124ef,'absolutePath':_0x1541a9,'content':_0x941c3f,'isNew':![],'hasChanges':_0x43202b,'diff':_0x43202b?formatDiffWithColors(_0x385f7b):undefined});}else _0x70fb66['push']({'relativePath':_0x1124ef,'absolutePath':_0x1541a9,'content':_0x941c3f,'isNew':!![],'hasChanges':![]});}const _0x5092c2=_0x70fb66[_0x235556(0x12f)](_0x4a3760=>_0x4a3760[_0x235556(0x1bf)]),_0x4d9d93=_0x70fb66[_0x235556(0x12f)](_0x30ddfc=>!_0x30ddfc['isNew']&&_0x30ddfc[_0x235556(0x11a)]),_0x42250a=_0x70fb66['filter'](_0x2f40d4=>!_0x2f40d4[_0x235556(0x1bf)]&&!_0x2f40d4[_0x235556(0x11a)]),_0x314b9e=_0x9234d1[_0x235556(0xed)],_0x20ccb7=_0x163d6e[_0x235556(0x183)],_0x4711c6=_0x314b9e>_0x20ccb7?'\x20('+_0x314b9e+_0x235556(0x16a):'';console[_0x235556(0xfa)](_0x235556(0xfd)),console['error']('\x20\x20'+a27_0x1d22cc[_0x235556(0x182)](_0x20ccb7+_0x235556(0xc1))+a27_0x1d22cc[_0x235556(0x124)](_0x4711c6)),console[_0x235556(0xfa)]('\x20\x20'+a27_0x1d22cc[_0x235556(0xb5)]('+\x20'+_0x5092c2[_0x235556(0xed)]+'\x20new\x20files')),console['error']('\x20\x20'+a27_0x1d22cc[_0x235556(0xea)]('~\x20'+_0x4d9d93[_0x235556(0xed)]+_0x235556(0x1b0))),console[_0x235556(0xfa)]('\x20\x20'+a27_0x1d22cc[_0x235556(0x124)]('=\x20'+_0x42250a[_0x235556(0xed)]+'\x20unchanged\x20files')),console[_0x235556(0xfa)](_0x235556(0xce)+a27_0x1d22cc[_0x235556(0x182)](_0x8faad3)+'\x0a');if(_0x4d9d93['length']>0x0)for(const _0x1d706b of _0x4d9d93){console[_0x235556(0xfa)](_0x235556(0x1ae)+_0x1d706b[_0x235556(0xd9)]+'\x27:'),console[_0x235556(0xfa)]('─'['repeat'](0x3c)),console[_0x235556(0xfa)](_0x1d706b['diff']),console['error']('─'[_0x235556(0xef)](0x3c));}if(_0x3e6dea[_0x235556(0x106)])return console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xea)](_0x235556(0x163))),0x0;if(_0x5092c2[_0x235556(0xed)]===0x0&&_0x4d9d93[_0x235556(0xed)]===0x0)return console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xb5)](_0x235556(0x12b))),saveSessionContext({'parent_segment':_0x201548},_0x3e6dea['session']),console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xb5)](_0x235556(0x115)+a27_0x1d22cc[_0x235556(0x124)](_0x235556(0x15d))+_0x235556(0x18f)+a27_0x1d22cc[_0x235556(0x182)](_0x201548))),0x0;if(!_0x3e6dea[_0x235556(0x125)]&&(_0x5092c2[_0x235556(0xed)]>0x0||_0x4d9d93[_0x235556(0xed)]>0x0)){if(!isInteractive())return console[_0x235556(0xfa)](a27_0x1d22cc['red']('\x0aError:'),_0x235556(0x19d)),console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0x124)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x14d95d=await confirmKey(_0x235556(0x195)+(_0x5092c2['length']+_0x4d9d93[_0x235556(0xed)])+_0x235556(0xbd));if(!_0x14d95d)return console[_0x235556(0xfa)](a27_0x1d22cc['yellow'](_0x235556(0xcb)),_0x235556(0x197)),0x1;}!existsSync(_0x8faad3)&&mkdirSync(_0x8faad3,{'recursive':!![]});const _0x4f47cd=a27_0x533657[_0x235556(0x11e)](_0x8faad3,'tdx.json');writeFileSync(_0x4f47cd,createTdxConfigContent(_0x201548),'utf-8');for(const _0x13366f of _0x70fb66){(_0x13366f['isNew']||_0x13366f['hasChanges'])&&writeFileSync(_0x13366f[_0x235556(0x10b)],_0x13366f['content'],_0x235556(0x1c6));}return console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xb5)]('✔\x20Pulled\x20'+(_0x5092c2[_0x235556(0xed)]+_0x4d9d93[_0x235556(0xed)])+_0x235556(0x1b3)+_0x8faad3)),saveSessionContext({'parent_segment':_0x201548},_0x3e6dea[_0x235556(0x129)]),console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xb5)](_0x235556(0x115)+a27_0x1d22cc['dim'](_0x235556(0x15d))+_0x235556(0x18f)+a27_0x1d22cc['cyan'](_0x201548))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x134);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x142);async['execute'](_0x24f442){const _0x38fea5=a27_0x69e9dc,{options:_0x2a9dc0,args:_0x3d02a3,tdx:_0x495803}=_0x24f442,_0x2d4b2e=_0x3d02a3[0x0];if(!requireNameOrPath(_0x2d4b2e))return 0x1;_0x2a9dc0[_0x38fea5(0xd4)]&&console['error'](_0x38fea5(0xc2)+_0x2d4b2e);const {journeyId:_0x4c94d9}=await resolveJourneyIdFromInput(_0x2d4b2e,_0x2a9dc0,_0x495803),_0x3874b1=await withSpinner(_0x38fea5(0x17b),()=>_0x495803[_0x38fea5(0x13b)][_0x38fea5(0x1ca)](_0x4c94d9),{'verbose':_0x2a9dc0[_0x38fea5(0xd4)]}),_0x45688d=_0x3874b1['data'];return console[_0x38fea5(0x132)](_0x38fea5(0x1b9)+_0x45688d['database']),console['log'](_0x38fea5(0x118)+_0x45688d[_0x38fea5(0xfc)]),await handleSDKOutput(_0x45688d[_0x38fea5(0x123)],_0x2a9dc0),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x69e9dc(0x155);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x17f);async[a27_0x69e9dc(0xf2)](_0x374c44){const _0x50ff5b=a27_0x69e9dc,{options:_0x4f4cac,args:_0x4961d7,tdx:_0xfd8655}=_0x374c44,_0x29ae5a=_0x4961d7[0x0];if(!requireNameOrPath(_0x29ae5a))return 0x1;_0x4f4cac[_0x50ff5b(0xd4)]&&console[_0x50ff5b(0xfa)](_0x50ff5b(0xc2)+_0x29ae5a);const {journeyId:_0x1cd200}=await resolveJourneyIdFromInput(_0x29ae5a,_0x4f4cac,_0xfd8655),_0x188a92=await withSpinner(_0x50ff5b(0x1ab),()=>_0xfd8655[_0x50ff5b(0x13b)][_0x50ff5b(0x167)](_0x1cd200),{'verbose':_0x4f4cac[_0x50ff5b(0xd4)]}),_0x399743=_0x188a92[_0x50ff5b(0x131)];return console['error'](_0x50ff5b(0x170)+_0x399743[_0x50ff5b(0xed)]+_0x50ff5b(0x144)+(_0x399743['length']!==0x1?'s':'')),await handleSDKOutput(_0x399743,_0x4f4cac),0x0;}}function a27_0x1d10(){const _0x53e74b=['journey:columns','updatedAt','\x20\x20Name:\x20','name','journey:list','blue','tsv','journey','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Listing\x20journey\x20versions...','stage','Fetching\x20users\x20and\x20connections...','Error:\x20Invalid\x20--type\x20\x22','replace','Show\x20journey\x20table\x20column\x20mapping','\x5c$&','\x20activation','audienceId','push','...','No\x20statistics\x20available\x20for\x20journey:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','split','journey:pull','Fetching\x20','journey:versions','completeMilestoneRate','Parent\x20segment:\x20','\x20\x20Folder\x20path:\x20','journeyBundleName','set','from','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journey:activations','Getting\x20version\x20','localeCompare','resolveParentId','buildIdToEmailMap','/app/ps/','add','journey:version:view','parent_segment','Available\x20stages:\x20','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','rule','\x20\x20-\x20','sort','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','rootFolderId','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x22\x20paused','listActivationsFlat','activation','journeyBundleId','\x20versions)','enteredSize','journey:resume','format','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Pattern:\x20','Found\x20','site','type','\x20(draft)\x20—\x20\x22','test','createdAt','stages','message','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Target\x20directory:\x20','\x20version','Getting\x20column\x20mapping...','getJourney','user','Pausing\x20journey...','List\x20activations\x20for\x20a\x20journey','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','2274937VABYyW','cyan','size','options','entries','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20journey','/j/da','journeyStages','7064045nXYZAW','archived','Export\x20journey(s)\x20as\x20YAML\x20files','Resume\x20a\x20paused\x20journey','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x20=\x20','getTrafficData','history','/e/','activation_','journey:version:create','Write\x20','\x20\x20Parent\x20segment:\x20','-\x20no\x20files\x20written','34021880qErJpg','INVALID_ARGUMENT','file','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','resolveJourneyId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','map','no_parent','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','milestoneSize','Show\x20journey\x20statistics','Error:\x20Invalid\x20version\x20number:\x20','cwd','\x20details...','9488WoIInt','✔\x20Journey\x20\x22','(draft)','Getting\x20journey\x20traffic\x20data...','Error:\x20Journey\x20not\x20found:\x20','Listing\x20journey\x20activations...','segmentName','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x0aChanges\x20to\x20\x27','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x20changed\x20files','getActivation','journeyName','\x20journey\x20files\x20to\x20','resume','\x20\x20Preserving\x20local\x20segment\x20name:\x20','bold','versionNumber','Creating\x20new\x20version...','Database:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','getSegment','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','🗺️\x20','createVersion','isNew','resolveSegment','has','relative','(running)','Listing\x20journeys...','.yml','utf-8','journey:stats','Resolving\x20version...','goal','getColumnMapping','exitOrJumpSize','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','targetDir','green','setPhase','toLowerCase','journey:traffic','4058805IlbyvG','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20\x20Statistics\x20not\x20available','List\x20all\x20versions\x20of\x20a\x20journey','\x20files?','attributes','folderId','exitOrJumpRate','\x20journeys','Input:\x20','(paused)','parentName','then','parentSegment','listVersions','Options:','\x27\x20not\x20found\x20in\x20','12zJkqNz','Aborted.','(root)','includeStats','\x20\x20Target:\x20','segments','conversion','json','pause','\x20->\x20','verbose','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','connection','values','base','relativePath','description','Target\x20file:\x20','Getting\x20journey\x20details...','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','includeHistory','listJourneysFromParentSegment','all','\x20(ID:\x20','Cancelled','completed','args','11sviDgE','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20Created\x20v','jsonl','Fetching\x20parent\x20segment...','yellow','journeyId','segmentPushCommand','length','Show\x20journey\x20details','repeat','folders','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','execute','renderStats','journey:pause','getLatestJourneyId','web','paused','get','Resolving\x20parent\x20segment...','error','Resolving\x20journey...','table','\x0aPull\x20summary:','getStatistics','Error:\x20Stage\x20\x22','7902xAMGDV','activationParams','segment','getParentFull','state','goalSize','dryRun','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Resuming\x20journey...','journey:view','absolutePath','helpText','Folder\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','(completed)','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Pause\x20a\x20running\x20journey','/j/da/je','journey:push','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)','✔\x20Context\x20set:\x20','1072730nAuSSt','\x20Opening\x20','Table:\x20','find','hasChanges','root\x20folder','(archived)','version','join','\x20\x20Journey\x20ID:\x20','reentryMode','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Error:\x20','columns','dim','yes','folderPath','View\x20a\x20specific\x20version\x20of\x20a\x20journey','4aFsUXW','session','connector_config','✔\x20All\x20files\x20are\x20up\x20to\x20date','1009779jomyjJ','filePath','Getting\x20journey\x20statistics...','filter','limit','data','log','\x22\x20not\x20found'];a27_0x1d10=function(){return _0x53e74b;};return a27_0x1d10();}export class JourneyPushCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x113);[a27_0x69e9dc(0xda)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';['segmentPushCommand']=new SegmentPushCommand();async[a27_0x69e9dc(0xf2)](_0xa289da){const _0x2c58c0=a27_0x69e9dc,_0x1cff25=_0xa289da[_0x2c58c0(0xe4)][0x0];let _0x4de020;if(_0x1cff25){const _0x21af82=await resolveTarget({'arg':_0x1cff25,'contextParent':_0xa289da[_0x2c58c0(0x184)][_0x2c58c0(0xc6)],'cwd':process[_0x2c58c0(0x1a4)]()});isSuccessfulResolution(_0x21af82)&&_0x21af82['type']===_0x2c58c0(0x19a)&&(_0x4de020=_0x21af82[_0x2c58c0(0x12d)]);}const _0x48ba5a={..._0xa289da,'options':{..._0xa289da[_0x2c58c0(0x184)],'journeysOnly':!![],..._0x4de020&&{'singleFilePath':_0x4de020}}};return this[_0x2c58c0(0xec)][_0x2c58c0(0xf2)](_0x48ba5a);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x14d);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0xbc);async[a27_0x69e9dc(0xf2)](_0x1f12ea){const _0x2b8e2c=a27_0x69e9dc,{options:_0x2779ff,args:_0x489418,tdx:_0xd5571b}=_0x1f12ea,_0x5bab24=_0x489418[0x0];if(!requireNameOrPath(_0x5bab24))return 0x1;if(_0x2779ff['verbose'])console[_0x2b8e2c(0xfa)]('Input:\x20'+_0x5bab24);const {journeyId:_0x141a45}=await resolveJourneyIdFromInput(_0x5bab24,_0x2779ff,_0xd5571b),_0x2a9658=await withSpinner(_0x2b8e2c(0x13d),()=>_0xd5571b[_0x2b8e2c(0x13b)][_0x2b8e2c(0xc7)](_0x141a45),{'verbose':_0x2779ff[_0x2b8e2c(0xd4)]}),{bundleName:_0x5ac9b1,versions:_0x348556,latestJourneyId:_0x5761dd}=_0x2a9658[_0x2b8e2c(0x131)];console[_0x2b8e2c(0xfa)](_0x5ac9b1+':\x20'+_0x348556[_0x2b8e2c(0xed)]+_0x2b8e2c(0x17a)+(_0x348556[_0x2b8e2c(0xed)]!==0x1?'s':''));const _0x40bea3=_0x348556[_0x2b8e2c(0x19e)](_0x3cb6b8=>({'version':_0x3cb6b8['versionNumber'],'journey_id':_0x3cb6b8[_0x2b8e2c(0xeb)],'name':_0x3cb6b8[_0x2b8e2c(0x137)],'state':_0x3cb6b8[_0x2b8e2c(0x104)],'paused':_0x3cb6b8[_0x2b8e2c(0xf7)],'latest':_0x3cb6b8[_0x2b8e2c(0xeb)]===_0x5761dd,'created_at':_0x3cb6b8['createdAt']}));return await handleSDKOutput(_0x40bea3,_0x2779ff),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x194);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x149);async[a27_0x69e9dc(0xf2)](_0x3543cb){const _0x314173=a27_0x69e9dc,{options:_0x38b537,args:_0x532e31,tdx:_0x1067a4}=_0x3543cb,_0x201b2b=_0x532e31[0x0];if(!requireNameOrPath(_0x201b2b))return 0x1;if(_0x38b537[_0x314173(0xd4)])console[_0x314173(0xfa)](_0x314173(0xc2)+_0x201b2b);const {journeyId:_0x5b4e2b,journeyName:_0x1d0ee4}=await resolveJourneyIdFromInput(_0x201b2b,_0x38b537,_0x1067a4);if(!_0x38b537['yes']){const _0x9998b7=await confirm(_0x314173(0xba)+_0x1d0ee4+'\x22?');if(!_0x9998b7)return console[_0x314173(0xfa)]('Cancelled'),0x0;}const _0x12f200=await withSpinner(_0x314173(0x1b8),()=>_0x1067a4['journey'][_0x314173(0x1be)](_0x5b4e2b),{'verbose':_0x38b537[_0x314173(0xd4)]}),_0x59f238=_0x12f200[_0x314173(0x131)];return console[_0x314173(0xfa)](a27_0x1d22cc['green']('✔')+_0x314173(0xe7)+_0x59f238[_0x314173(0xbe)][_0x314173(0x1b7)]+_0x314173(0x173)+_0x59f238[_0x314173(0xbe)]['name']+'\x22'),console['error'](_0x314173(0x11f)+_0x59f238['id']),await handleSingleObjectOutput({'id':_0x59f238['id'],'name':_0x59f238[_0x314173(0xbe)][_0x314173(0x137)],'version':_0x59f238['attributes']['versionNumber'],'state':_0x59f238[_0x314173(0xbe)][_0x314173(0x104)],'bundle_id':_0x59f238[_0x314173(0xbe)][_0x314173(0x169)],'created_at':_0x59f238[_0x314173(0xbe)]['createdAt']},_0x38b537),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x15c);['description']=a27_0x69e9dc(0x127);async[a27_0x69e9dc(0xf2)](_0x44a034){const _0x50d823=a27_0x69e9dc,{options:_0xb7400e,args:_0x58bdc7,tdx:_0x52f422}=_0x44a034,_0x4d73a2=_0x58bdc7[0x0];if(!requireNameOrPath(_0x4d73a2))return 0x1;const _0x2af1de=_0xb7400e[_0x50d823(0x11d)];if(!_0x2af1de)return console[_0x50d823(0xfa)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x50d823(0xfa)](_0x50d823(0x165)),0x1;const _0x4c7ebd=parseInt(_0x2af1de,0xa);if(isNaN(_0x4c7ebd)||_0x4c7ebd<0x1)return console['error'](_0x50d823(0x1a3)+_0x2af1de),0x1;if(_0xb7400e['verbose'])console[_0x50d823(0xfa)]('Input:\x20'+_0x4d73a2+',\x20version:\x20'+_0x4c7ebd);const {journeyId:_0x40d67f,parentSegmentId:_0xb038c6}=await resolveJourneyIdFromInput(_0x4d73a2,_0xb7400e,_0x52f422),_0x28da61=await withSpinner(_0x50d823(0x1c8),()=>_0x52f422[_0x50d823(0x13b)]['listVersions'](_0x40d67f),{'verbose':_0xb7400e[_0x50d823(0xd4)]}),{versions:_0x4dd0f7,latestJourneyId:_0x2ff2ca}=_0x28da61[_0x50d823(0x131)],_0x25c7a3=_0x4dd0f7[_0x50d823(0x119)](_0x1c7575=>_0x1c7575['versionNumber']===_0x4c7ebd);if(!_0x25c7a3){const _0x3b75de=_0x4dd0f7['map'](_0x1df3c4=>'v'+_0x1df3c4[_0x50d823(0x1b7)])['join'](',\x20');return console[_0x50d823(0xfa)]('Error:\x20Version\x20'+_0x4c7ebd+'\x20not\x20found.\x20Available:\x20'+_0x3b75de),0x1;}const _0x25e0c1=await withSpinner(_0x50d823(0x156)+_0x4c7ebd+_0x50d823(0x1a5),()=>_0x52f422[_0x50d823(0x13b)][_0x50d823(0x17c)](_0x25c7a3['journeyId']),{'verbose':_0xb7400e[_0x50d823(0xd4)]}),_0x47c71b=_0x25e0c1[_0x50d823(0x131)],_0x1596da=getConsoleNextUrl(_0xb7400e[_0x50d823(0x171)],'/app/ps/'+_0xb038c6+'/e/'+_0x25c7a3[_0x50d823(0xeb)]+_0x50d823(0x112));return await handleSingleObjectOutput({'id':_0x47c71b['id'],'name':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x137)],'version':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x1b7)],'description':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0xda)],'state':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x104)],'paused':_0x47c71b['attributes'][_0x50d823(0xf7)],'reentry_mode':_0x47c71b['attributes']['reentryMode'],'stages':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x189)]?.['length']||0x0,..._0x47c71b[_0x50d823(0xbe)][_0x50d823(0x1c9)]&&{'goal':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x1c9)][_0x50d823(0x137)]},'latest':_0x25c7a3[_0x50d823(0xeb)]===_0x2ff2ca,'created_at':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x175)],'updated_at':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x135)],'url':_0x1596da},_0xb7400e),0x0;}}
@@ -1 +1 @@
1
- function a28_0x4440(_0x321fcb,_0x376a5b){_0x321fcb=_0x321fcb-0xe3;const _0x5d8302=a28_0x5d83();let _0x44405e=_0x5d8302[_0x321fcb];return _0x44405e;}const a28_0x2373a5=a28_0x4440;(function(_0x471912,_0x5a1581){const _0x582c86=a28_0x4440,_0x5ef7a5=_0x471912();while(!![]){try{const _0x13516e=-parseInt(_0x582c86(0x101))/0x1+parseInt(_0x582c86(0x116))/0x2*(-parseInt(_0x582c86(0xf4))/0x3)+-parseInt(_0x582c86(0x11b))/0x4+-parseInt(_0x582c86(0x117))/0x5+-parseInt(_0x582c86(0xe7))/0x6*(parseInt(_0x582c86(0xe6))/0x7)+-parseInt(_0x582c86(0xf6))/0x8*(-parseInt(_0x582c86(0x118))/0x9)+parseInt(_0x582c86(0x109))/0xa*(parseInt(_0x582c86(0x112))/0xb);if(_0x13516e===_0x5a1581)break;else _0x5ef7a5['push'](_0x5ef7a5['shift']());}catch(_0x596374){_0x5ef7a5['push'](_0x5ef7a5['shift']());}}}(a28_0x5d83,0x3e855));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x2c5c20 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a28_0x5d83(){const _0x547f8d=['relativePath','99724vrUsFN','log','valid','parentSegment','735OgAimd','10002uXvXuX','error','invalidCount','length','warningCount','cyan','cwd','endsWith','\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','name','warnings','red','journey','75OILRFp','\x20warning(s)\x20found','8rSCmML','.yml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','green','Error:\x20','message','helpText','Validate\x20journey\x20YAML\x20files','\x20warning(s)','\x20segment\x20file(s)\x20skipped','✔\x20All\x20','99850VjbHZv','.yaml','dim','\x20segment\x20file(s)\x20skipped)','\x20journey(s)\x20with\x20errors,\x20','filter','hasErrors','skippedCount','7849860lhyoNg','filePath','verbose','validCount','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','errorCode','\x20(skipped:\x20','\x20valid','11gHSzMC','description','no_parent','file','7112ttjOgA','1574090injLuF','1571697PgSXxX','yellow'];a28_0x5d83=function(){return _0x547f8d;};return a28_0x5d83();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x2373a5(0xf0)]='journey:validate';[a28_0x2373a5(0x113)]=a28_0x2373a5(0xfd);async['execute'](_0x33e598){const _0x43c6f1=a28_0x2373a5,{options:_0x55a2ea,args:_0x402405}=_0x33e598,_0x1c12e9=_0x55a2ea,_0x3c1c78=await resolveTarget({'arg':_0x402405[0x0],'contextParent':_0x55a2ea[_0x43c6f1(0xe5)],'cwd':process[_0x43c6f1(0xed)]()});if(!isSuccessfulResolution(_0x3c1c78))return _0x3c1c78[_0x43c6f1(0x10f)]===_0x43c6f1(0x114)?(console['error'](a28_0x2c5c20[_0x43c6f1(0x119)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x43c6f1(0xe8)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x43c6f1(0xe8)](_0x43c6f1(0xef)),console[_0x43c6f1(0xe8)](_0x43c6f1(0x10e))):(console[_0x43c6f1(0xe8)](a28_0x2c5c20[_0x43c6f1(0xf2)](_0x43c6f1(0xfa)+_0x3c1c78[_0x43c6f1(0xfb)]+'\x0a')),_0x3c1c78[_0x43c6f1(0xfc)]&&console['error'](a28_0x2c5c20[_0x43c6f1(0xec)](_0x3c1c78[_0x43c6f1(0xfc)]))),0x1;const _0x4c37c4=_0x3c1c78['targetDir'],_0x1e7283=_0x3c1c78['type']===_0x43c6f1(0x115)?_0x3c1c78[_0x43c6f1(0x10a)]:undefined;if(!_0x1e7283&&!existsSync(_0x4c37c4))return console[_0x43c6f1(0xe8)](a28_0x2c5c20[_0x43c6f1(0xf2)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4c37c4+'\x0a')),0x1;let _0x4810c2;if(_0x1e7283){if(!_0x1e7283[_0x43c6f1(0xee)](_0x43c6f1(0xf7))&&!_0x1e7283[_0x43c6f1(0xee)](_0x43c6f1(0x102)))return console[_0x43c6f1(0xe8)](a28_0x2c5c20[_0x43c6f1(0xf2)](_0x43c6f1(0x10d)+_0x1e7283+'\x0a')),0x1;_0x4810c2=[_0x1e7283];}else _0x4810c2=findYamlFiles(_0x4c37c4);if(_0x4810c2[_0x43c6f1(0xea)]===0x0)return console[_0x43c6f1(0xe8)](a28_0x2c5c20['red'](_0x43c6f1(0xf8)+_0x4c37c4+'\x0a')),0x1;const _0x489da5=validateYamlFiles(_0x4810c2,_0x4c37c4,{'filterType':_0x43c6f1(0xf3)}),_0x334a15=calculateSummary(_0x489da5),_0x56d853=_0x489da5[_0x43c6f1(0x106)](isValidationResult);if(_0x56d853[_0x43c6f1(0xea)]===0x0)return console[_0x43c6f1(0xe8)](a28_0x2c5c20['yellow']('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x4c37c4+'\x0a')),_0x334a15[_0x43c6f1(0x108)]>0x0&&console[_0x43c6f1(0xe8)](a28_0x2c5c20['dim']('('+_0x334a15[_0x43c6f1(0x108)]+_0x43c6f1(0x104))),0x0;for(const _0x4fd732 of _0x489da5){if(!isValidationResult(_0x4fd732)){_0x1c12e9[_0x43c6f1(0x10b)]&&console['log'](a28_0x2c5c20[_0x43c6f1(0x103)]('-\x20'+_0x4fd732[_0x43c6f1(0x11a)]+_0x43c6f1(0x110)+_0x4fd732['reason']+')'));continue;}const {relativePath:_0x4dd0bf,source:_0x17ea16,result:_0x16568e}=_0x4fd732;if(_0x16568e[_0x43c6f1(0xe4)]&&_0x16568e[_0x43c6f1(0xf1)][_0x43c6f1(0xea)]===0x0)_0x1c12e9[_0x43c6f1(0x10b)]&&console[_0x43c6f1(0xe3)](a28_0x2c5c20[_0x43c6f1(0xf9)]('✔\x20'+_0x4dd0bf));else _0x16568e[_0x43c6f1(0xe4)]?(console[_0x43c6f1(0xe3)](a28_0x2c5c20[_0x43c6f1(0x119)]('⚠\x20'+_0x4dd0bf+':\x20'+_0x16568e[_0x43c6f1(0xf1)][_0x43c6f1(0xea)]+_0x43c6f1(0xfe))),console[_0x43c6f1(0xe3)](formatValidationResult(_0x16568e,_0x17ea16,_0x4dd0bf))):(console[_0x43c6f1(0xe3)](a28_0x2c5c20['red']('✖\x20'+_0x4dd0bf+':\x20'+_0x16568e['errors'][_0x43c6f1(0xea)]+'\x20error(s)')),console[_0x43c6f1(0xe3)](formatValidationResult(_0x16568e,_0x17ea16,_0x4dd0bf)));}return console[_0x43c6f1(0xe3)](''),_0x334a15[_0x43c6f1(0x107)]?(console[_0x43c6f1(0xe3)](a28_0x2c5c20[_0x43c6f1(0xf2)]('Validation\x20failed:\x20'+_0x334a15[_0x43c6f1(0xe9)]+_0x43c6f1(0x105)+_0x334a15['validCount']+_0x43c6f1(0x111))),_0x334a15[_0x43c6f1(0xeb)]>0x0&&console[_0x43c6f1(0xe3)](a28_0x2c5c20[_0x43c6f1(0x119)](_0x334a15[_0x43c6f1(0xeb)]+_0x43c6f1(0xf5))),_0x334a15[_0x43c6f1(0x108)]>0x0&&console['log'](a28_0x2c5c20[_0x43c6f1(0x103)](_0x334a15[_0x43c6f1(0x108)]+_0x43c6f1(0xff))),0x1):(console[_0x43c6f1(0xe3)](a28_0x2c5c20['green'](_0x43c6f1(0x100)+_0x334a15[_0x43c6f1(0x10c)]+'\x20journey(s)\x20valid')),_0x334a15[_0x43c6f1(0xeb)]>0x0&&console[_0x43c6f1(0xe3)](a28_0x2c5c20[_0x43c6f1(0x119)](_0x334a15[_0x43c6f1(0xeb)]+_0x43c6f1(0xf5))),_0x334a15['skippedCount']>0x0&&console['log'](a28_0x2c5c20[_0x43c6f1(0x103)](_0x334a15[_0x43c6f1(0x108)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}
1
+ const a28_0x1c5f74=a28_0x1b47;(function(_0x29cd95,_0x4872eb){const _0x235978=a28_0x1b47,_0x484ddd=_0x29cd95();while(!![]){try{const _0x1159f0=parseInt(_0x235978(0x16b))/0x1+-parseInt(_0x235978(0x148))/0x2*(parseInt(_0x235978(0x161))/0x3)+parseInt(_0x235978(0x171))/0x4*(-parseInt(_0x235978(0x142))/0x5)+-parseInt(_0x235978(0x153))/0x6+-parseInt(_0x235978(0x173))/0x7+-parseInt(_0x235978(0x13b))/0x8*(parseInt(_0x235978(0x157))/0x9)+parseInt(_0x235978(0x140))/0xa;if(_0x1159f0===_0x4872eb)break;else _0x484ddd['push'](_0x484ddd['shift']());}catch(_0x4400af){_0x484ddd['push'](_0x484ddd['shift']());}}}(a28_0x4144,0xa4262));function a28_0x1b47(_0x59d96d,_0x2d994f){_0x59d96d=_0x59d96d-0x13a;const _0x414428=a28_0x4144();let _0x1b4728=_0x414428[_0x59d96d];return _0x1b4728;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a28_0x4144(){const _0x10967d=['red','1723959fuyMqE','\x20warning(s)\x20found','length','\x20valid','file','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','no_parent','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','filter','1263724QjHxyo','\x20journey(s)\x20valid','\x20segment\x20file(s)\x20skipped','No\x20journey\x20YAML\x20files\x20found\x20in\x20','parentSegment','\x20warning(s)','128eXeYTH','.yml','6486844kxRZuM','message','validCount','warningCount','Error:\x20','log','relativePath','green','name','13864CVWHto','hasErrors','\x20error(s)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','valid','25366540gQVkzD','endsWith','111415VCWptF','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','filePath','yellow','helpText','\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','2NTEtEp','✔\x20All\x20','verbose','execute','reason','skippedCount','error','Error:\x20Directory\x20not\x20found:\x20','cyan','warnings','\x20(skipped:\x20','3547710MQzFjv','targetDir','\x20journey(s)\x20with\x20errors,\x20','dim','1674VzBSOL','errorCode','journey:validate','\x20segment\x20file(s)\x20skipped)','invalidCount','Validate\x20journey\x20YAML\x20files','errors','description','.yaml'];a28_0x4144=function(){return _0x10967d;};return a28_0x4144();}import{existsSync}from'fs';import a28_0x4c1b1e 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_0x1c5f74(0x13a)]=a28_0x1c5f74(0x159);[a28_0x1c5f74(0x15e)]=a28_0x1c5f74(0x15c);async[a28_0x1c5f74(0x14b)](_0x38ee31){const _0x3cfa60=a28_0x1c5f74,{options:_0x507f1a,args:_0x5a9eab}=_0x38ee31,_0x435770=_0x507f1a,_0x1349ce=await resolveTarget({'arg':_0x5a9eab[0x0],'contextParent':_0x507f1a[_0x3cfa60(0x16f)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1349ce))return _0x1349ce[_0x3cfa60(0x158)]===_0x3cfa60(0x167)?(console['error'](a28_0x4c1b1e[_0x3cfa60(0x145)](_0x3cfa60(0x13e))),console[_0x3cfa60(0x14e)](_0x3cfa60(0x166)),console[_0x3cfa60(0x14e)](_0x3cfa60(0x147)),console[_0x3cfa60(0x14e)](_0x3cfa60(0x169))):(console[_0x3cfa60(0x14e)](a28_0x4c1b1e[_0x3cfa60(0x160)](_0x3cfa60(0x177)+_0x1349ce[_0x3cfa60(0x174)]+'\x0a')),_0x1349ce[_0x3cfa60(0x146)]&&console['error'](a28_0x4c1b1e[_0x3cfa60(0x150)](_0x1349ce['helpText']))),0x1;const _0x33b6f4=_0x1349ce[_0x3cfa60(0x154)],_0x60b544=_0x1349ce['type']===_0x3cfa60(0x165)?_0x1349ce[_0x3cfa60(0x144)]:undefined;if(!_0x60b544&&!existsSync(_0x33b6f4))return console['error'](a28_0x4c1b1e[_0x3cfa60(0x160)](_0x3cfa60(0x14f)+_0x33b6f4+'\x0a')),0x1;let _0x72802;if(_0x60b544){if(!_0x60b544[_0x3cfa60(0x141)](_0x3cfa60(0x172))&&!_0x60b544[_0x3cfa60(0x141)](_0x3cfa60(0x15f)))return console[_0x3cfa60(0x14e)](a28_0x4c1b1e['red'](_0x3cfa60(0x168)+_0x60b544+'\x0a')),0x1;_0x72802=[_0x60b544];}else _0x72802=findYamlFiles(_0x33b6f4);if(_0x72802[_0x3cfa60(0x163)]===0x0)return console[_0x3cfa60(0x14e)](a28_0x4c1b1e[_0x3cfa60(0x160)](_0x3cfa60(0x143)+_0x33b6f4+'\x0a')),0x1;const _0x1d5313=validateYamlFiles(_0x72802,_0x33b6f4,{'filterType':'journey'}),_0x481b0d=calculateSummary(_0x1d5313),_0x587224=_0x1d5313[_0x3cfa60(0x16a)](isValidationResult);if(_0x587224['length']===0x0)return console['error'](a28_0x4c1b1e[_0x3cfa60(0x145)](_0x3cfa60(0x16e)+_0x33b6f4+'\x0a')),_0x481b0d[_0x3cfa60(0x14d)]>0x0&&console['error'](a28_0x4c1b1e[_0x3cfa60(0x156)]('('+_0x481b0d[_0x3cfa60(0x14d)]+_0x3cfa60(0x15a))),0x0;for(const _0x430ae2 of _0x1d5313){if(!isValidationResult(_0x430ae2)){_0x435770[_0x3cfa60(0x14a)]&&console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x156)]('-\x20'+_0x430ae2[_0x3cfa60(0x179)]+_0x3cfa60(0x152)+_0x430ae2[_0x3cfa60(0x14c)]+')'));continue;}const {relativePath:_0x12484b,source:_0x3de66f,result:_0xcf647c}=_0x430ae2;if(_0xcf647c['valid']&&_0xcf647c[_0x3cfa60(0x151)][_0x3cfa60(0x163)]===0x0)_0x435770['verbose']&&console['log'](a28_0x4c1b1e[_0x3cfa60(0x17a)]('✔\x20'+_0x12484b));else _0xcf647c[_0x3cfa60(0x13f)]?(console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x145)]('⚠\x20'+_0x12484b+':\x20'+_0xcf647c[_0x3cfa60(0x151)][_0x3cfa60(0x163)]+_0x3cfa60(0x170))),console[_0x3cfa60(0x178)](formatValidationResult(_0xcf647c,_0x3de66f,_0x12484b))):(console[_0x3cfa60(0x178)](a28_0x4c1b1e['red']('✖\x20'+_0x12484b+':\x20'+_0xcf647c[_0x3cfa60(0x15d)][_0x3cfa60(0x163)]+_0x3cfa60(0x13d))),console['log'](formatValidationResult(_0xcf647c,_0x3de66f,_0x12484b)));}return console['log'](''),_0x481b0d[_0x3cfa60(0x13c)]?(console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x160)]('Validation\x20failed:\x20'+_0x481b0d[_0x3cfa60(0x15b)]+_0x3cfa60(0x155)+_0x481b0d[_0x3cfa60(0x175)]+_0x3cfa60(0x164))),_0x481b0d[_0x3cfa60(0x176)]>0x0&&console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x145)](_0x481b0d[_0x3cfa60(0x176)]+'\x20warning(s)\x20found')),_0x481b0d['skippedCount']>0x0&&console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x156)](_0x481b0d[_0x3cfa60(0x14d)]+_0x3cfa60(0x16d))),0x1):(console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x17a)](_0x3cfa60(0x149)+_0x481b0d[_0x3cfa60(0x175)]+_0x3cfa60(0x16c))),_0x481b0d[_0x3cfa60(0x176)]>0x0&&console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x145)](_0x481b0d[_0x3cfa60(0x176)]+_0x3cfa60(0x162))),_0x481b0d[_0x3cfa60(0x14d)]>0x0&&console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x156)](_0x481b0d['skippedCount']+_0x3cfa60(0x16d))),0x0);}}