@treasuredata/tdx 2026.3.35 → 2026.3.37

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/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.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 a26_0x462633=a26_0x1037;(function(_0x13787f,_0x4e3406){const _0x42e8a4=a26_0x1037,_0x5f3266=_0x13787f();while(!![]){try{const _0x4d5b23=parseInt(_0x42e8a4(0x101))/0x1*(-parseInt(_0x42e8a4(0xfb))/0x2)+parseInt(_0x42e8a4(0x11a))/0x3+parseInt(_0x42e8a4(0x102))/0x4+parseInt(_0x42e8a4(0x106))/0x5*(parseInt(_0x42e8a4(0x112))/0x6)+-parseInt(_0x42e8a4(0x110))/0x7+-parseInt(_0x42e8a4(0xfa))/0x8*(parseInt(_0x42e8a4(0xfe))/0x9)+parseInt(_0x42e8a4(0x128))/0xa;if(_0x4d5b23===_0x4e3406)break;else _0x5f3266['push'](_0x5f3266['shift']());}catch(_0xccd5a5){_0x5f3266['push'](_0x5f3266['shift']());}}}(a26_0x5d82,0xba140));import{BaseCommand}from'./command.js';function a26_0x5d82(){const _0x39d3ef=['error','Validation\x20failed:\x20','980775jUrFUO','engage:template:validate','dirname','validCount','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','Validate\x20template\x20YAML\x20files','errors','\x20non-template\x20file(s)\x20skipped','8761795dqipCf','valid','36ZacegL','filter','execute','cwd','Error:\x20Directory\x20not\x20found:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20valid','yellow','2662035qsAbjB','\x20template(s)\x20valid','warningCount','\x20warning(s)\x20found','\x20template(s)\x20with\x20errors,\x20','verbose','template','\x20(skipped:\x20','\x20non-template\x20file(s)\x20skipped)','.yml','warnings','length','hasErrors','name','15693790UGFBzm','.yaml','dim','resolve','log','1247504uGdXIG','2ddSfJN','\x20error(s)','endsWith','72qQUUki','✔\x20All\x20','skippedCount','1428782rGLpnq','4225972MtcNIp','reason'];a26_0x5d82=function(){return _0x39d3ef;};return a26_0x5d82();}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a26_0x1037(_0x5cbfb2,_0xa6fd6c){_0x5cbfb2=_0x5cbfb2-0xf9;const _0x5d8277=a26_0x5d82();let _0x10375d=_0x5d8277[_0x5cbfb2];return _0x10375d;}import{existsSync}from'fs';import a26_0x22ed22 from'chalk';import a26_0x392d84 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{[a26_0x462633(0x127)]=a26_0x462633(0x107);[a26_0x462633(0x10a)]=a26_0x462633(0x10d);async[a26_0x462633(0x114)](_0x32b6a9){const _0x57d925=a26_0x462633,{options:_0x50531d,args:_0x2734c6}=_0x32b6a9,_0x32ca77=_0x50531d,_0x5a9f3a=_0x2734c6[0x0],_0x1cecf5=_0x5a9f3a?a26_0x392d84[_0x57d925(0x12b)](_0x5a9f3a):undefined,_0x5369f6=_0x1cecf5?isYamlFile(_0x1cecf5):![];let _0x2a6529,_0x55ae2e;if(_0x5369f6&&_0x1cecf5)_0x2a6529=a26_0x392d84[_0x57d925(0x108)](_0x1cecf5),_0x55ae2e=_0x1cecf5;else _0x1cecf5?_0x2a6529=_0x1cecf5:_0x2a6529=process[_0x57d925(0x115)]();if(!_0x55ae2e&&!existsSync(_0x2a6529))return console[_0x57d925(0x104)](a26_0x22ed22[_0x57d925(0x10c)](_0x57d925(0x116)+_0x2a6529+'\x0a')),0x1;let _0x229778;if(_0x55ae2e){if(!_0x55ae2e[_0x57d925(0xfd)](_0x57d925(0x123))&&!_0x55ae2e['endsWith'](_0x57d925(0x129)))return console[_0x57d925(0x104)](a26_0x22ed22['red'](_0x57d925(0x117)+_0x55ae2e+'\x0a')),0x1;_0x229778=[_0x55ae2e];}else _0x229778=findYamlFiles(_0x2a6529);if(_0x229778[_0x57d925(0x125)]===0x0)return console[_0x57d925(0x104)](a26_0x22ed22[_0x57d925(0x10c)](_0x57d925(0x10b)+_0x2a6529+'\x0a')),0x1;const _0x5a49f0=validateYamlFiles(_0x229778,_0x2a6529,{'filterType':_0x57d925(0x120)}),_0x4eac21=calculateSummary(_0x5a49f0),_0x3043f6=_0x5a49f0[_0x57d925(0x113)](isValidationResult);if(_0x3043f6['length']===0x0)return console['error'](a26_0x22ed22[_0x57d925(0x119)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x2a6529+'\x0a')),_0x4eac21[_0x57d925(0x100)]>0x0&&console[_0x57d925(0x104)](a26_0x22ed22['dim']('('+_0x4eac21[_0x57d925(0x100)]+_0x57d925(0x122))),0x0;for(const _0x11ba26 of _0x5a49f0){if(!isValidationResult(_0x11ba26)){_0x32ca77[_0x57d925(0x11f)]&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x12a)]('-\x20'+_0x11ba26['relativePath']+_0x57d925(0x121)+_0x11ba26[_0x57d925(0x103)]+')'));continue;}const {relativePath:_0x1ad33d,source:_0x13a42b,result:_0x44d229}=_0x11ba26;if(_0x44d229[_0x57d925(0x111)]&&_0x44d229[_0x57d925(0x124)]['length']===0x0)_0x32ca77[_0x57d925(0x11f)]&&console['log'](a26_0x22ed22['green']('✔\x20'+_0x1ad33d));else _0x44d229['valid']?(console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x119)]('⚠\x20'+_0x1ad33d+':\x20'+_0x44d229[_0x57d925(0x124)][_0x57d925(0x125)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x44d229,_0x13a42b,_0x1ad33d))):(console[_0x57d925(0xf9)](a26_0x22ed22['red']('✖\x20'+_0x1ad33d+':\x20'+_0x44d229[_0x57d925(0x10e)][_0x57d925(0x125)]+_0x57d925(0xfc))),console['log'](formatValidationResult(_0x44d229,_0x13a42b,_0x1ad33d)));}return console[_0x57d925(0xf9)](''),_0x4eac21[_0x57d925(0x126)]?(console[_0x57d925(0xf9)](a26_0x22ed22['red'](_0x57d925(0x105)+_0x4eac21['invalidCount']+_0x57d925(0x11e)+_0x4eac21['validCount']+_0x57d925(0x118))),_0x4eac21[_0x57d925(0x11c)]>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22['yellow'](_0x4eac21[_0x57d925(0x11c)]+_0x57d925(0x11d))),_0x4eac21['skippedCount']>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x12a)](_0x4eac21[_0x57d925(0x100)]+_0x57d925(0x10f))),0x1):(console[_0x57d925(0xf9)](a26_0x22ed22['green'](_0x57d925(0xff)+_0x4eac21[_0x57d925(0x109)]+_0x57d925(0x11b))),_0x4eac21[_0x57d925(0x11c)]>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x119)](_0x4eac21['warningCount']+_0x57d925(0x11d))),_0x4eac21['skippedCount']>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x12a)](_0x4eac21[_0x57d925(0x100)]+_0x57d925(0x10f))),0x0);}}
1
+ const a26_0xb660cc=a26_0x24eb;(function(_0x399c9e,_0x2336d3){const _0xf552ed=a26_0x24eb,_0xc5bae4=_0x399c9e();while(!![]){try{const _0x1d768b=-parseInt(_0xf552ed(0xac))/0x1+parseInt(_0xf552ed(0xab))/0x2+parseInt(_0xf552ed(0x9a))/0x3*(-parseInt(_0xf552ed(0xc2))/0x4)+parseInt(_0xf552ed(0xad))/0x5*(parseInt(_0xf552ed(0x97))/0x6)+parseInt(_0xf552ed(0xaf))/0x7+parseInt(_0xf552ed(0x99))/0x8*(-parseInt(_0xf552ed(0xa6))/0x9)+parseInt(_0xf552ed(0x94))/0xa;if(_0x1d768b===_0x2336d3)break;else _0xc5bae4['push'](_0xc5bae4['shift']());}catch(_0x3e7cde){_0xc5bae4['push'](_0xc5bae4['shift']());}}}(a26_0x2abe,0xbd4a7));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x561c85 from'chalk';function a26_0x24eb(_0x1a7ea1,_0x1a75c8){_0x1a7ea1=_0x1a7ea1-0x93;const _0x2abee9=a26_0x2abe();let _0x24ebf6=_0x2abee9[_0x1a7ea1];return _0x24ebf6;}import a26_0x6c3a01 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a26_0x2abe(){const _0x46e792=['1056YXeROg','warnings','green','\x20template(s)\x20with\x20errors,\x20','2878450fSLBKj','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found','129174gCtGWt','\x20error(s)','8sMXrQe','4149lKfblg','dim','resolve','validCount','\x20non-template\x20file(s)\x20skipped)','error','red','Error:\x20Directory\x20not\x20found:\x20','length','\x20template(s)\x20valid','Validate\x20template\x20YAML\x20files','.yml','6024933IwbsVk','\x20non-template\x20file(s)\x20skipped','\x20valid','hasErrors','log','1735878BVXTUY','103174MiMFBG','105JwqzYJ','.yaml','2136155wyYIXz','reason','dirname','valid','Validation\x20failed:\x20','✔\x20All\x20','skippedCount','name','verbose','template','description','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','warningCount','yellow','endsWith','\x20warning(s)','execute','errors','filter'];a26_0x2abe=function(){return _0x46e792;};return a26_0x2abe();}export class EngageTemplateValidateCommand extends BaseCommand{[a26_0xb660cc(0xb6)]='engage:template:validate';[a26_0xb660cc(0xb9)]=a26_0xb660cc(0xa4);async[a26_0xb660cc(0xbf)](_0xf29f71){const _0x388404=a26_0xb660cc,{options:_0x23a2dc,args:_0x570d11}=_0xf29f71,_0x479442=_0x23a2dc,_0x81aae2=_0x570d11[0x0],_0x229593=_0x81aae2?a26_0x6c3a01[_0x388404(0x9c)](_0x81aae2):undefined,_0x242cfc=_0x229593?isYamlFile(_0x229593):![];let _0x38fcea,_0x3f0c07;if(_0x242cfc&&_0x229593)_0x38fcea=a26_0x6c3a01[_0x388404(0xb1)](_0x229593),_0x3f0c07=_0x229593;else _0x229593?_0x38fcea=_0x229593:_0x38fcea=process['cwd']();if(!_0x3f0c07&&!existsSync(_0x38fcea))return console[_0x388404(0x9f)](a26_0x561c85[_0x388404(0xa0)](_0x388404(0xa1)+_0x38fcea+'\x0a')),0x1;let _0x2c4f59;if(_0x3f0c07){if(!_0x3f0c07[_0x388404(0xbd)](_0x388404(0xa5))&&!_0x3f0c07['endsWith'](_0x388404(0xae)))return console[_0x388404(0x9f)](a26_0x561c85[_0x388404(0xa0)](_0x388404(0xba)+_0x3f0c07+'\x0a')),0x1;_0x2c4f59=[_0x3f0c07];}else _0x2c4f59=findYamlFiles(_0x38fcea);if(_0x2c4f59[_0x388404(0xa2)]===0x0)return console[_0x388404(0x9f)](a26_0x561c85[_0x388404(0xa0)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x38fcea+'\x0a')),0x1;const _0x28d9fa=validateYamlFiles(_0x2c4f59,_0x38fcea,{'filterType':_0x388404(0xb8)}),_0x4f97c0=calculateSummary(_0x28d9fa),_0x5d888f=_0x28d9fa[_0x388404(0xc1)](isValidationResult);if(_0x5d888f[_0x388404(0xa2)]===0x0)return console[_0x388404(0x9f)](a26_0x561c85['yellow'](_0x388404(0x95)+_0x38fcea+'\x0a')),_0x4f97c0[_0x388404(0xb5)]>0x0&&console[_0x388404(0x9f)](a26_0x561c85[_0x388404(0x9b)]('('+_0x4f97c0[_0x388404(0xb5)]+_0x388404(0x9e))),0x0;for(const _0x168f85 of _0x28d9fa){if(!isValidationResult(_0x168f85)){_0x479442[_0x388404(0xb7)]&&console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0x9b)]('-\x20'+_0x168f85['relativePath']+'\x20(skipped:\x20'+_0x168f85[_0x388404(0xb0)]+')'));continue;}const {relativePath:_0x361aaf,source:_0xaea91a,result:_0x343be9}=_0x168f85;if(_0x343be9[_0x388404(0xb2)]&&_0x343be9[_0x388404(0xc3)][_0x388404(0xa2)]===0x0)_0x479442[_0x388404(0xb7)]&&console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xc4)]('✔\x20'+_0x361aaf));else _0x343be9['valid']?(console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xbc)]('⚠\x20'+_0x361aaf+':\x20'+_0x343be9[_0x388404(0xc3)][_0x388404(0xa2)]+_0x388404(0xbe))),console[_0x388404(0xaa)](formatValidationResult(_0x343be9,_0xaea91a,_0x361aaf))):(console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xa0)]('✖\x20'+_0x361aaf+':\x20'+_0x343be9[_0x388404(0xc0)][_0x388404(0xa2)]+_0x388404(0x98))),console[_0x388404(0xaa)](formatValidationResult(_0x343be9,_0xaea91a,_0x361aaf)));}return console['log'](''),_0x4f97c0[_0x388404(0xa9)]?(console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xa0)](_0x388404(0xb3)+_0x4f97c0['invalidCount']+_0x388404(0x93)+_0x4f97c0[_0x388404(0x9d)]+_0x388404(0xa8))),_0x4f97c0[_0x388404(0xbb)]>0x0&&console['log'](a26_0x561c85['yellow'](_0x4f97c0[_0x388404(0xbb)]+_0x388404(0x96))),_0x4f97c0['skippedCount']>0x0&&console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0x9b)](_0x4f97c0[_0x388404(0xb5)]+_0x388404(0xa7))),0x1):(console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xc4)](_0x388404(0xb4)+_0x4f97c0[_0x388404(0x9d)]+_0x388404(0xa3))),_0x4f97c0['warningCount']>0x0&&console[_0x388404(0xaa)](a26_0x561c85[_0x388404(0xbc)](_0x4f97c0[_0x388404(0xbb)]+_0x388404(0x96))),_0x4f97c0[_0x388404(0xb5)]>0x0&&console['log'](a26_0x561c85[_0x388404(0x9b)](_0x4f97c0[_0x388404(0xb5)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
@@ -1 +1 @@
1
- const a27_0x42d217=a27_0x2376;(function(_0x2e036f,_0x5794d7){const _0x4b3176=a27_0x2376,_0x382eca=_0x2e036f();while(!![]){try{const _0x2a8ca7=-parseInt(_0x4b3176(0x19d))/0x1*(parseInt(_0x4b3176(0x161))/0x2)+parseInt(_0x4b3176(0x1b7))/0x3*(parseInt(_0x4b3176(0x164))/0x4)+-parseInt(_0x4b3176(0x19e))/0x5*(-parseInt(_0x4b3176(0x165))/0x6)+-parseInt(_0x4b3176(0x189))/0x7*(-parseInt(_0x4b3176(0x1b4))/0x8)+parseInt(_0x4b3176(0x160))/0x9*(-parseInt(_0x4b3176(0x1a8))/0xa)+-parseInt(_0x4b3176(0x167))/0xb+parseInt(_0x4b3176(0x1a0))/0xc*(-parseInt(_0x4b3176(0x1a2))/0xd);if(_0x2a8ca7===_0x5794d7)break;else _0x382eca['push'](_0x382eca['shift']());}catch(_0x4e0835){_0x382eca['push'](_0x382eca['shift']());}}}(a27_0x48be,0x602f6));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';function a27_0x2376(_0x302ef2,_0x442fec){_0x302ef2=_0x302ef2-0x15e;const _0x48beca=a27_0x48be();let _0x237625=_0x48beca[_0x302ef2];return _0x237625;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x523ee9 from'chalk';function formatDuration(_0x36762f){const _0x3ac6bd=a27_0x2376;if(_0x36762f<0x3c)return _0x36762f+'s';if(_0x36762f<0xe10)return Math[_0x3ac6bd(0x18a)](_0x36762f/0x3c)+'m\x20'+_0x36762f%0x3c+'s';const _0x488b89=Math[_0x3ac6bd(0x18a)](_0x36762f/0xe10),_0x151bc2=Math[_0x3ac6bd(0x18a)](_0x36762f%0xe10/0x3c);return _0x151bc2>0x0?_0x488b89+'h\x20'+_0x151bc2+'m':_0x488b89+'h';}function formatRelativeTime(_0x68b7fe){const _0x28b5ad=a27_0x2376,_0x4a55fc=Date[_0x28b5ad(0x17c)]()-_0x68b7fe[_0x28b5ad(0x1a7)](),_0x239db6=Math['floor'](Math[_0x28b5ad(0x16b)](_0x4a55fc)/0x3e8);if(_0x239db6<0x3c)return'just\x20now';const _0x149873=Math[_0x28b5ad(0x18a)](_0x239db6/0x3c);if(_0x149873<0x3c)return _0x149873+_0x28b5ad(0x1bb);const _0x421b4d=Math[_0x28b5ad(0x18a)](_0x149873/0x3c);if(_0x421b4d<0x18)return _0x421b4d+'h\x20ago';const _0xb020fd=Math[_0x28b5ad(0x18a)](_0x421b4d/0x18);if(_0xb020fd<0x1e)return _0xb020fd+_0x28b5ad(0x18e);return Math['floor'](_0xb020fd/0x1e)+_0x28b5ad(0x180);}export class JobListCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x1a5);['description']='List\x20jobs';async[a27_0x42d217(0x1bc)](_0x2d3142){const _0x3ce7bd=a27_0x42d217,{options:_0x1cb0e2,tdx:_0x50d448}=_0x2d3142,_0x3f8998=resolveLimit(_0x1cb0e2['limit'],DEFAULT_DISPLAY_LIMIT),_0x34e4ee=_0x1cb0e2['status'];_0x1cb0e2[_0x3ce7bd(0x193)]&&(console[_0x3ce7bd(0x18d)](_0x3ce7bd(0x16c)+_0x3f8998+_0x3ce7bd(0x195)),_0x34e4ee&&console['error'](_0x3ce7bd(0x197)+_0x34e4ee));const _0x1edadf=await withSpinner(_0x3ce7bd(0x1b6),()=>_0x50d448['jobs'][_0x3ce7bd(0x198)]({'from':0x0,'to':_0x3f8998-0x1,'status':_0x34e4ee}),{'verbose':_0x1cb0e2[_0x3ce7bd(0x193)]}),_0x140c3f=_0x1edadf[_0x3ce7bd(0x192)];console[_0x3ce7bd(0x18d)](_0x3ce7bd(0x1ae)+_0x140c3f[_0x3ce7bd(0x190)]+_0x3ce7bd(0x1a6)+(_0x140c3f[_0x3ce7bd(0x190)]!==0x1?'s':''));const _0x1e4949=_0x1cb0e2['site'];if(isStructuredFormat(_0x1cb0e2)){const _0x400bfe=_0x140c3f['map'](_0x346873=>{const _0x33f066=_0x3ce7bd;let _0x1c984a;if(_0x346873['start_at']&&_0x346873[_0x33f066(0x178)]){const _0x111cab=new Date(_0x346873[_0x33f066(0x15e)])[_0x33f066(0x1a7)](),_0x38b4c9=new Date(_0x346873[_0x33f066(0x178)])[_0x33f066(0x1a7)]();_0x1c984a=Math[_0x33f066(0x174)]((_0x38b4c9-_0x111cab)/0x3e8);}return{'job_id':_0x346873[_0x33f066(0x17e)],'type':_0x346873[_0x33f066(0x18c)]===_0x33f066(0x191)?_0x33f066(0x1a3):_0x346873[_0x33f066(0x18c)],'status':_0x346873[_0x33f066(0x1b5)],'user_name':_0x346873[_0x33f066(0x1b8)],'duration_sec':_0x1c984a,'created_at':_0x346873[_0x33f066(0x173)],'started_at':_0x346873[_0x33f066(0x15e)],'end_at':_0x346873['end_at']};});await handleSDKOutput(_0x400bfe,_0x1cb0e2);}else for(const _0x211afa of _0x140c3f){const _0x13279b=_0x211afa[_0x3ce7bd(0x1b5)]===_0x3ce7bd(0x163)?a27_0x523ee9[_0x3ce7bd(0x1a1)]:_0x211afa[_0x3ce7bd(0x1b5)]==='error'?a27_0x523ee9[_0x3ce7bd(0x162)]:a27_0x523ee9[_0x3ce7bd(0x187)],_0x2b1cd1=_0x13279b(_0x211afa['status']),_0x644b79=getJobUrl(_0x1e4949,_0x211afa[_0x3ce7bd(0x17e)]),_0x32e9d9=hyperlink(_0x211afa['job_id'],_0x644b79),_0x2c0266=a27_0x523ee9[_0x3ce7bd(0x187)](_0x211afa[_0x3ce7bd(0x18c)]==='presto'?'trino':_0x211afa['type']),_0x185b8d=[];if(_0x211afa[_0x3ce7bd(0x15e)]&&_0x211afa[_0x3ce7bd(0x178)]){const _0x183d1e=Math['round']((new Date(_0x211afa[_0x3ce7bd(0x178)])[_0x3ce7bd(0x1a7)]()-new Date(_0x211afa[_0x3ce7bd(0x15e)])[_0x3ce7bd(0x1a7)]())/0x3e8);_0x185b8d[_0x3ce7bd(0x1b2)](formatDuration(_0x183d1e));}if(_0x211afa[_0x3ce7bd(0x178)])_0x185b8d['push'](formatRelativeTime(new Date(_0x211afa[_0x3ce7bd(0x178)])));else _0x211afa[_0x3ce7bd(0x15e)]&&_0x185b8d[_0x3ce7bd(0x1b2)](formatRelativeTime(new Date(_0x211afa['start_at'])));const _0x51bfc6=_0x185b8d[_0x3ce7bd(0x190)]>0x0?a27_0x523ee9[_0x3ce7bd(0x187)]('\x20'+_0x185b8d[_0x3ce7bd(0x1b9)](',\x20')):'';console[_0x3ce7bd(0x1ba)]('⚡\x20'+_0x32e9d9+'\x20'+_0x2c0266+'\x20'+_0x2b1cd1+_0x51bfc6);}return 0x0;}}function a27_0x48be(){const _0x412d87=['job:kill','type','error','d\x20ago','submit','length','presto','data','verbose','args','\x20jobs','priority','Status\x20filter:\x20','list','query','Get\x20job\x20results','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','\x27\x20to\x20verify\x20the\x20job\x20status','1368AEQhpI','5dylAnA','✔\x20Job\x20submitted','3618396CbTkve','green','13fOpYaA','trino','Cancelled','jobs','\x20job','getTime','10OKoqsG','hive','\x20\x20Job\x20ID:\x20','result','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','yes','✔\x20Found\x20','show','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>','push','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','1911872xxmraT','status','Listing\x20jobs...','1282221jABzvE','user_name','join','log','m\x20ago','execute','Getting\x20job\x20details...','Submitting\x20kill\x20request...','start_at','debug','3871323DVthRc','178SiBtir','red','success','4uFkgFg','2423874IKqUEJ','job:submit','681428UNYfHw','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','file','\x20row','abs','Limit:\x20','Kill\x20a\x20job','database','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','url','created_at','round','Getting\x20job\x20results...','validate','Submit\x20a\x20job','end_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','INVALID_ARGUMENT','job:show','now','job:result','job_id','kill','mo\x20ago','Submitting\x20job...','jobType','name','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','No\x20SQL\x20statements\x20found\x20in\x20file','description','dim','substring','14XZIaTa','floor'];a27_0x48be=function(){return _0x412d87;};return a27_0x48be();}export class JobShowCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x17b);[a27_0x42d217(0x186)]='Show\x20job\x20details';[a27_0x42d217(0x176)](_0x9cda29){const _0x4acb83=a27_0x42d217,_0xbfa604=_0x9cda29[_0x4acb83(0x194)][0x0];if(!_0xbfa604)return _0x4acb83(0x1b0);return undefined;}async[a27_0x42d217(0x1bc)](_0x400292){const _0x2ec3c7=a27_0x42d217,{options:_0x2355c0,args:_0x48741d,tdx:_0x482d8a}=_0x400292,_0x45750b=_0x48741d[0x0],_0x5ab690=await withSpinner(_0x2ec3c7(0x1bd),()=>_0x482d8a[_0x2ec3c7(0x1a5)][_0x2ec3c7(0x1af)](_0x45750b),{'verbose':_0x2355c0['verbose']}),_0x140885=_0x5ab690[_0x2ec3c7(0x192)];let _0x15853b;if(_0x140885[_0x2ec3c7(0x15e)]&&_0x140885['end_at']){const _0x34666c=new Date(_0x140885[_0x2ec3c7(0x15e)])['getTime'](),_0xd90d9b=new Date(_0x140885[_0x2ec3c7(0x178)])[_0x2ec3c7(0x1a7)]();_0x15853b=Math[_0x2ec3c7(0x174)]((_0xd90d9b-_0x34666c)/0x3e8);}const _0x2440e5={'job_id':_0x140885[_0x2ec3c7(0x17e)],'type':_0x140885[_0x2ec3c7(0x18c)],'status':_0x140885['status'],..._0x140885[_0x2ec3c7(0x1b8)]&&{'user_name':_0x140885[_0x2ec3c7(0x1b8)]},..._0x15853b!==undefined&&{'duration_sec':_0x15853b},..._0x140885['created_at']&&{'created_at':_0x140885[_0x2ec3c7(0x173)]},..._0x140885[_0x2ec3c7(0x15e)]&&{'started_at':_0x140885[_0x2ec3c7(0x15e)]},..._0x140885[_0x2ec3c7(0x178)]&&{'end_at':_0x140885[_0x2ec3c7(0x178)]},..._0x140885[_0x2ec3c7(0x16e)]&&{'database':_0x140885[_0x2ec3c7(0x16e)]},..._0x140885[_0x2ec3c7(0x196)]!==undefined&&{'priority':_0x140885[_0x2ec3c7(0x196)]},..._0x140885[_0x2ec3c7(0x172)]&&{'url':_0x140885[_0x2ec3c7(0x172)]},..._0x140885[_0x2ec3c7(0x199)]&&{'query':_0x140885[_0x2ec3c7(0x199)]},..._0x140885['debug']&&{'debug':_0x140885[_0x2ec3c7(0x15f)]}};return await handleSingleObjectOutput(_0x2440e5,_0x2355c0),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x18b);[a27_0x42d217(0x186)]=a27_0x42d217(0x16d);[a27_0x42d217(0x176)](_0x1a16ce){const _0x4194c8=a27_0x42d217,_0x229216=_0x1a16ce['args'][0x0];if(!_0x229216)return _0x4194c8(0x179);return undefined;}async[a27_0x42d217(0x1bc)](_0x51274e){const _0x147f97=a27_0x42d217,{options:_0x2440f8,args:_0x37861a,tdx:_0x3cfbdc}=_0x51274e,_0x92f940=_0x37861a[0x0];if(!_0x2440f8[_0x147f97(0x1ad)]){const _0x2bf66b=await confirm(_0x147f97(0x171)+_0x92f940+'?');if(!_0x2bf66b)return console['error'](_0x147f97(0x1a4)),0x0;}return await withSpinner(_0x147f97(0x1be),()=>_0x3cfbdc[_0x147f97(0x1a5)][_0x147f97(0x17f)](_0x92f940),{'verbose':_0x2440f8[_0x147f97(0x193)]}),console['error'](_0x147f97(0x168)+_0x92f940),console['error'](_0x147f97(0x16f)+_0x92f940+_0x147f97(0x19c)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x166);[a27_0x42d217(0x186)]=a27_0x42d217(0x177);async[a27_0x42d217(0x1bc)](_0x14cbae){const _0x5096f8=a27_0x42d217,{options:_0x2a5fcd,args:_0x5ee89f,tdx:_0x1df2fc}=_0x14cbae,_0xdfa449=_0x2a5fcd[_0x5096f8(0x182)]||_0x5096f8(0x1a3),_0x1f7487=_0x2a5fcd[_0x5096f8(0x169)],_0x5b37c8=_0x2a5fcd[_0x5096f8(0x16e)]||'information_schema',_0xb98e55=_0x2a5fcd[_0x5096f8(0x1ab)];if(_0xdfa449!==_0x5096f8(0x1a3)&&_0xdfa449!==_0x5096f8(0x1a9))throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x184));let _0x5c7ef5;if(_0x1f7487){if(_0x5ee89f[0x0])throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x19b));const _0x17caf5=readSqlStatementsFromFile(_0x1f7487);if(_0x17caf5['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5096f8(0x185));if(_0x17caf5[_0x5096f8(0x190)]>0x1)throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x1b3));_0x5c7ef5=_0x17caf5[0x0];}else{if(!_0x5ee89f[0x0])throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x1b1));_0x5c7ef5=_0x5ee89f[0x0];}_0x2a5fcd[_0x5096f8(0x193)]&&(console[_0x5096f8(0x18d)]('Job\x20type:\x20'+_0xdfa449),console[_0x5096f8(0x18d)]('Database:\x20'+_0x5b37c8),console[_0x5096f8(0x18d)]('Query:\x20'+_0x5c7ef5[_0x5096f8(0x188)](0x0,0x64)+(_0x5c7ef5[_0x5096f8(0x190)]>0x64?_0x5096f8(0x170):'')));const _0x4c9edf=await withSpinner(_0x5096f8(0x181),()=>_0x1df2fc[_0x5096f8(0x1a5)][_0x5096f8(0x18f)](_0x5b37c8,_0x5c7ef5,_0xdfa449,_0xb98e55),{'verbose':_0x2a5fcd['verbose']}),_0x1f40dd=_0x4c9edf[_0x5096f8(0x192)];return console[_0x5096f8(0x18d)](_0x5096f8(0x19f)),console['error'](_0x5096f8(0x1aa)+_0x1f40dd[_0x5096f8(0x17e)]),await handleSDKOutput([_0x1f40dd],_0x2a5fcd),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x17d);[a27_0x42d217(0x186)]=a27_0x42d217(0x19a);['validate'](_0x4cf67d){const _0xc62aba=a27_0x42d217,_0x3d23d0=_0x4cf67d[_0xc62aba(0x194)][0x0];if(!_0x3d23d0)return _0xc62aba(0x1ac);return undefined;}async[a27_0x42d217(0x1bc)](_0x521547){const _0x2a9b4a=a27_0x42d217,{options:_0x9fc269,args:_0x199697,tdx:_0x317921}=_0x521547,_0x307fe2=_0x199697[0x0],_0x4ff00f=await withSpinner(_0x2a9b4a(0x175),()=>_0x317921['jobs'][_0x2a9b4a(0x1ab)](_0x307fe2),{'verbose':_0x9fc269[_0x2a9b4a(0x193)]}),_0x2fd2a4=_0x4ff00f[_0x2a9b4a(0x192)];return console[_0x2a9b4a(0x18d)]('✔\x20Retrieved\x20'+_0x2fd2a4['length']+_0x2a9b4a(0x16a)+(_0x2fd2a4[_0x2a9b4a(0x190)]!==0x1?'s':'')),await handleSDKOutput(_0x2fd2a4,_0x9fc269),0x0;}}
1
+ const a27_0x39ba4c=a27_0x497c;(function(_0x42c8f3,_0x577c84){const _0x2635f1=a27_0x497c,_0x54adf4=_0x42c8f3();while(!![]){try{const _0x12a23d=-parseInt(_0x2635f1(0x13c))/0x1+parseInt(_0x2635f1(0x11b))/0x2+-parseInt(_0x2635f1(0x130))/0x3+-parseInt(_0x2635f1(0xec))/0x4+-parseInt(_0x2635f1(0xf9))/0x5+parseInt(_0x2635f1(0x13d))/0x6+-parseInt(_0x2635f1(0xf7))/0x7*(-parseInt(_0x2635f1(0xf4))/0x8);if(_0x12a23d===_0x577c84)break;else _0x54adf4['push'](_0x54adf4['shift']());}catch(_0x15fcd1){_0x54adf4['push'](_0x54adf4['shift']());}}}(a27_0x49e7,0x9217b));function a27_0x497c(_0x144fff,_0x4f18b4){_0x144fff=_0x144fff-0xe6;const _0x49e794=a27_0x49e7();let _0x497c59=_0x49e794[_0x144fff];return _0x497c59;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0xe4d50b from'chalk';function formatDuration(_0x456331){const _0x46f810=a27_0x497c;if(_0x456331<0x3c)return _0x456331+'s';if(_0x456331<0xe10)return Math['floor'](_0x456331/0x3c)+'m\x20'+_0x456331%0x3c+'s';const _0x50a4cc=Math['floor'](_0x456331/0xe10),_0x4997b8=Math[_0x46f810(0xed)](_0x456331%0xe10/0x3c);return _0x4997b8>0x0?_0x50a4cc+'h\x20'+_0x4997b8+'m':_0x50a4cc+'h';}function formatRelativeTime(_0xbb6fce){const _0x965938=a27_0x497c,_0x5a7301=Date['now']()-_0xbb6fce[_0x965938(0x116)](),_0x25584d=Math[_0x965938(0xed)](Math[_0x965938(0x12d)](_0x5a7301)/0x3e8);if(_0x25584d<0x3c)return _0x965938(0x10d);const _0x43b062=Math[_0x965938(0xed)](_0x25584d/0x3c);if(_0x43b062<0x3c)return _0x43b062+_0x965938(0x119);const _0x2ffa30=Math[_0x965938(0xed)](_0x43b062/0x3c);if(_0x2ffa30<0x18)return _0x2ffa30+_0x965938(0x115);const _0x5516e7=Math[_0x965938(0xed)](_0x2ffa30/0x18);if(_0x5516e7<0x1e)return _0x5516e7+_0x965938(0x137);return Math[_0x965938(0xed)](_0x5516e7/0x1e)+_0x965938(0x10a);}export class JobListCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]='jobs';['description']=a27_0x39ba4c(0xfa);async[a27_0x39ba4c(0xe6)](_0x3ad46c){const _0x2c00e6=a27_0x39ba4c,{options:_0x197c04,tdx:_0x44195a}=_0x3ad46c,_0x52636b=resolveLimit(_0x197c04[_0x2c00e6(0xfe)],DEFAULT_DISPLAY_LIMIT),_0x3e6921=_0x197c04[_0x2c00e6(0x122)];_0x197c04[_0x2c00e6(0x108)]&&(console[_0x2c00e6(0x141)](_0x2c00e6(0x110)+_0x52636b+_0x2c00e6(0x11d)),_0x3e6921&&console[_0x2c00e6(0x141)](_0x2c00e6(0x12c)+_0x3e6921));const _0x28d0b2=await withSpinner(_0x2c00e6(0x128),()=>_0x44195a['jobs']['list']({'from':0x0,'to':_0x52636b-0x1,'status':_0x3e6921}),{'verbose':_0x197c04[_0x2c00e6(0x108)]}),_0x412da3=_0x28d0b2[_0x2c00e6(0xf8)];console[_0x2c00e6(0x141)](_0x2c00e6(0x129)+_0x412da3[_0x2c00e6(0x135)]+_0x2c00e6(0x138)+(_0x412da3[_0x2c00e6(0x135)]!==0x1?'s':''));const _0x295a87=_0x197c04[_0x2c00e6(0x101)];if(isStructuredFormat(_0x197c04)){const _0x285446=_0x412da3[_0x2c00e6(0x134)](_0x11c526=>{const _0x14a343=_0x2c00e6;let _0xd60726;if(_0x11c526[_0x14a343(0x123)]&&_0x11c526[_0x14a343(0xe9)]){const _0x32779e=new Date(_0x11c526['start_at'])[_0x14a343(0x116)](),_0x2f48e7=new Date(_0x11c526['end_at'])[_0x14a343(0x116)]();_0xd60726=Math['round']((_0x2f48e7-_0x32779e)/0x3e8);}return{'job_id':_0x11c526[_0x14a343(0x12e)],'type':_0x11c526[_0x14a343(0xeb)]===_0x14a343(0x121)?_0x14a343(0x104):_0x11c526[_0x14a343(0xeb)],'status':_0x11c526[_0x14a343(0x122)],'user_name':_0x11c526[_0x14a343(0x113)],'duration_sec':_0xd60726,'created_at':_0x11c526[_0x14a343(0x125)],'started_at':_0x11c526[_0x14a343(0x123)],'end_at':_0x11c526['end_at']};});await handleSDKOutput(_0x285446,_0x197c04);}else for(const _0x338f05 of _0x412da3){const _0x515058=_0x338f05['status']===_0x2c00e6(0xf2)?a27_0xe4d50b[_0x2c00e6(0x11e)]:_0x338f05[_0x2c00e6(0x122)]===_0x2c00e6(0x141)?a27_0xe4d50b[_0x2c00e6(0x11a)]:a27_0xe4d50b[_0x2c00e6(0xef)],_0x414c78=_0x515058(_0x338f05[_0x2c00e6(0x122)]),_0x1ecd4b=getJobUrl(_0x295a87,_0x338f05['job_id']),_0x466a91=hyperlink(_0x338f05['job_id'],_0x1ecd4b),_0x5d5d51=a27_0xe4d50b['dim'](_0x338f05['type']===_0x2c00e6(0x121)?'trino':_0x338f05[_0x2c00e6(0xeb)]),_0x164323=[];if(_0x338f05[_0x2c00e6(0x123)]&&_0x338f05[_0x2c00e6(0xe9)]){const _0x3a55f5=Math['round']((new Date(_0x338f05['end_at'])['getTime']()-new Date(_0x338f05[_0x2c00e6(0x123)])[_0x2c00e6(0x116)]())/0x3e8);_0x164323[_0x2c00e6(0x112)](formatDuration(_0x3a55f5));}if(_0x338f05[_0x2c00e6(0xe9)])_0x164323[_0x2c00e6(0x112)](formatRelativeTime(new Date(_0x338f05[_0x2c00e6(0xe9)])));else _0x338f05['start_at']&&_0x164323[_0x2c00e6(0x112)](formatRelativeTime(new Date(_0x338f05[_0x2c00e6(0x123)])));const _0xc4b985=_0x164323[_0x2c00e6(0x135)]>0x0?a27_0xe4d50b[_0x2c00e6(0xef)]('\x20'+_0x164323[_0x2c00e6(0x10c)](',\x20')):'';console[_0x2c00e6(0x11c)]('⚡\x20'+_0x466a91+'\x20'+_0x5d5d51+'\x20'+_0x414c78+_0xc4b985);}return 0x0;}}function a27_0x49e7(){const _0x4426da=['job:kill','site','submit','args','trino','\x27\x20to\x20verify\x20the\x20job\x20status','job:result','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','verbose','Show\x20job\x20details','mo\x20ago','✔\x20Job\x20submitted','join','just\x20now','Job\x20type:\x20','Kill\x20a\x20job','Limit:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','push','user_name','Submitting\x20kill\x20request...','h\x20ago','getTime','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','debug','m\x20ago','red','2268842IyeVrm','log','\x20jobs','green','result','job:show','presto','status','start_at','jobType','created_at','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Query:\x20','Listing\x20jobs...','✔\x20Found\x20','INVALID_ARGUMENT','\x20row','Status\x20filter:\x20','abs','job_id','Cancelled','601965xzCuKe','database','yes','Submit\x20a\x20job','map','length','✔\x20Retrieved\x20','d\x20ago','\x20job','...','description','priority','924066vxrMJe','742518kVBLfY','kill','validate','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','error','execute','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','No\x20SQL\x20statements\x20found\x20in\x20file','end_at','Getting\x20job\x20results...','type','4756472EvwWpk','floor','Getting\x20job\x20details...','dim','Get\x20job\x20results','Database:\x20','success','jobs','163928QDjwpW','hive','file','959IXnWyt','data','5766035zCEsNN','List\x20jobs','name','query','information_schema','limit','Submitting\x20job...'];a27_0x49e7=function(){return _0x4426da;};return a27_0x49e7();}export class JobShowCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]=a27_0x39ba4c(0x120);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0x109);[a27_0x39ba4c(0x13f)](_0xf4184a){const _0x2e4828=a27_0x39ba4c,_0x4cf2ff=_0xf4184a[_0x2e4828(0x103)][0x0];if(!_0x4cf2ff)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a27_0x39ba4c(0xe6)](_0x34094d){const _0x2c0f41=a27_0x39ba4c,{options:_0x421db4,args:_0x10ac9e,tdx:_0x3735ad}=_0x34094d,_0x598bd3=_0x10ac9e[0x0],_0x4a7044=await withSpinner(_0x2c0f41(0xee),()=>_0x3735ad[_0x2c0f41(0xf3)]['show'](_0x598bd3),{'verbose':_0x421db4[_0x2c0f41(0x108)]}),_0x3d49e5=_0x4a7044[_0x2c0f41(0xf8)];let _0x55df22;if(_0x3d49e5['start_at']&&_0x3d49e5[_0x2c0f41(0xe9)]){const _0x336101=new Date(_0x3d49e5[_0x2c0f41(0x123)])[_0x2c0f41(0x116)](),_0x349b1c=new Date(_0x3d49e5[_0x2c0f41(0xe9)])[_0x2c0f41(0x116)]();_0x55df22=Math['round']((_0x349b1c-_0x336101)/0x3e8);}const _0x2c1cc8={'job_id':_0x3d49e5[_0x2c0f41(0x12e)],'type':_0x3d49e5[_0x2c0f41(0xeb)],'status':_0x3d49e5['status'],..._0x3d49e5['user_name']&&{'user_name':_0x3d49e5[_0x2c0f41(0x113)]},..._0x55df22!==undefined&&{'duration_sec':_0x55df22},..._0x3d49e5[_0x2c0f41(0x125)]&&{'created_at':_0x3d49e5['created_at']},..._0x3d49e5[_0x2c0f41(0x123)]&&{'started_at':_0x3d49e5[_0x2c0f41(0x123)]},..._0x3d49e5[_0x2c0f41(0xe9)]&&{'end_at':_0x3d49e5[_0x2c0f41(0xe9)]},..._0x3d49e5[_0x2c0f41(0x131)]&&{'database':_0x3d49e5[_0x2c0f41(0x131)]},..._0x3d49e5[_0x2c0f41(0x13b)]!==undefined&&{'priority':_0x3d49e5['priority']},..._0x3d49e5['url']&&{'url':_0x3d49e5['url']},..._0x3d49e5[_0x2c0f41(0xfc)]&&{'query':_0x3d49e5[_0x2c0f41(0xfc)]},..._0x3d49e5[_0x2c0f41(0x118)]&&{'debug':_0x3d49e5['debug']}};return await handleSingleObjectOutput(_0x2c1cc8,_0x421db4),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]=a27_0x39ba4c(0x100);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0x10f);[a27_0x39ba4c(0x13f)](_0x6cd483){const _0x35e359=a27_0x39ba4c,_0x2293d2=_0x6cd483[_0x35e359(0x103)][0x0];if(!_0x2293d2)return _0x35e359(0x140);return undefined;}async[a27_0x39ba4c(0xe6)](_0x11e8c6){const _0x23aee3=a27_0x39ba4c,{options:_0x533f5f,args:_0x242dd7,tdx:_0x178d9d}=_0x11e8c6,_0x3717f6=_0x242dd7[0x0];if(!_0x533f5f[_0x23aee3(0x132)]){const _0x5980a0=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x3717f6+'?');if(!_0x5980a0)return console[_0x23aee3(0x141)](_0x23aee3(0x12f)),0x0;}return await withSpinner(_0x23aee3(0x114),()=>_0x178d9d[_0x23aee3(0xf3)][_0x23aee3(0x13e)](_0x3717f6),{'verbose':_0x533f5f[_0x23aee3(0x108)]}),console[_0x23aee3(0x141)](_0x23aee3(0x107)+_0x3717f6),console['error'](_0x23aee3(0xe7)+_0x3717f6+_0x23aee3(0x105)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]='job:submit';['description']=a27_0x39ba4c(0x133);async[a27_0x39ba4c(0xe6)](_0x3688df){const _0xbb8281=a27_0x39ba4c,{options:_0x5307e8,args:_0x19705e,tdx:_0x60befc}=_0x3688df,_0x3c0824=_0x5307e8[_0xbb8281(0x124)]||_0xbb8281(0x104),_0x190bed=_0x5307e8[_0xbb8281(0xf6)],_0x46195b=_0x5307e8[_0xbb8281(0x131)]||_0xbb8281(0xfd),_0x4126c2=_0x5307e8[_0xbb8281(0x11f)];if(_0x3c0824!==_0xbb8281(0x104)&&_0x3c0824!==_0xbb8281(0xf5))throw new SDKError(ErrorCode[_0xbb8281(0x12a)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x155916;if(_0x190bed){if(_0x19705e[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xbb8281(0x111));const _0x491365=readSqlStatementsFromFile(_0x190bed);if(_0x491365[_0xbb8281(0x135)]===0x0)throw new SDKError(ErrorCode[_0xbb8281(0x12a)],_0xbb8281(0xe8));if(_0x491365[_0xbb8281(0x135)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x155916=_0x491365[0x0];}else{if(!_0x19705e[0x0])throw new SDKError(ErrorCode[_0xbb8281(0x12a)],_0xbb8281(0x126));_0x155916=_0x19705e[0x0];}_0x5307e8[_0xbb8281(0x108)]&&(console['error'](_0xbb8281(0x10e)+_0x3c0824),console[_0xbb8281(0x141)](_0xbb8281(0xf1)+_0x46195b),console[_0xbb8281(0x141)](_0xbb8281(0x127)+_0x155916['substring'](0x0,0x64)+(_0x155916[_0xbb8281(0x135)]>0x64?_0xbb8281(0x139):'')));const _0x18019d=await withSpinner(_0xbb8281(0xff),()=>_0x60befc['jobs'][_0xbb8281(0x102)](_0x46195b,_0x155916,_0x3c0824,_0x4126c2),{'verbose':_0x5307e8[_0xbb8281(0x108)]}),_0x17416b=_0x18019d['data'];return console['error'](_0xbb8281(0x10b)),console[_0xbb8281(0x141)]('\x20\x20Job\x20ID:\x20'+_0x17416b['job_id']),await handleSDKOutput([_0x17416b],_0x5307e8),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a27_0x39ba4c(0x106);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0xf0);[a27_0x39ba4c(0x13f)](_0x51065e){const _0x3cb235=a27_0x39ba4c,_0x373a60=_0x51065e[_0x3cb235(0x103)][0x0];if(!_0x373a60)return _0x3cb235(0x117);return undefined;}async[a27_0x39ba4c(0xe6)](_0xbb925c){const _0x3f4665=a27_0x39ba4c,{options:_0x1528a5,args:_0x16ad5d,tdx:_0x1ef085}=_0xbb925c,_0x5f3022=_0x16ad5d[0x0],_0x1dd3eb=await withSpinner(_0x3f4665(0xea),()=>_0x1ef085[_0x3f4665(0xf3)][_0x3f4665(0x11f)](_0x5f3022),{'verbose':_0x1528a5[_0x3f4665(0x108)]}),_0x3300df=_0x1dd3eb['data'];return console[_0x3f4665(0x141)](_0x3f4665(0x136)+_0x3300df[_0x3f4665(0x135)]+_0x3f4665(0x12b)+(_0x3300df[_0x3f4665(0x135)]!==0x1?'s':'')),await handleSDKOutput(_0x3300df,_0x1528a5),0x0;}}
@@ -1 +1 @@
1
- const a28_0x35a506=a28_0x5c6b;(function(_0x10fa3b,_0x15dad7){const _0x3b5a7a=a28_0x5c6b,_0x43d651=_0x10fa3b();while(!![]){try{const _0x5ba9c1=parseInt(_0x3b5a7a(0x16e))/0x1*(parseInt(_0x3b5a7a(0x20f))/0x2)+-parseInt(_0x3b5a7a(0x1f9))/0x3*(-parseInt(_0x3b5a7a(0x1a9))/0x4)+-parseInt(_0x3b5a7a(0x1df))/0x5*(parseInt(_0x3b5a7a(0x252))/0x6)+-parseInt(_0x3b5a7a(0x240))/0x7*(-parseInt(_0x3b5a7a(0x16b))/0x8)+-parseInt(_0x3b5a7a(0x20a))/0x9*(-parseInt(_0x3b5a7a(0x248))/0xa)+parseInt(_0x3b5a7a(0x153))/0xb*(parseInt(_0x3b5a7a(0x1ae))/0xc)+-parseInt(_0x3b5a7a(0x23c))/0xd*(parseInt(_0x3b5a7a(0x20e))/0xe);if(_0x5ba9c1===_0x15dad7)break;else _0x43d651['push'](_0x43d651['shift']());}catch(_0xffd775){_0x43d651['push'](_0x43d651['shift']());}}}(a28_0x592c,0xd6d0a));import a28_0x35ee26 from'chalk';import a28_0x3ba9f6 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';function a28_0x5c6b(_0x1728b7,_0x2bebe9){_0x1728b7=_0x1728b7-0x14f;const _0x592c35=a28_0x592c();let _0x5c6b8c=_0x592c35[_0x1728b7];return _0x5c6b8c;}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(_0x2d6238){const _0x1833b2=a28_0x5c6b;return!_0x2d6238&&(console[_0x1833b2(0x15a)](_0x1833b2(0x15f)),console[_0x1833b2(0x15a)](_0x1833b2(0x1ab))),!!_0x2d6238;}function withJsonFormat(_0x3bc8b3){const _0x140db0=a28_0x5c6b;if(!_0x3bc8b3[_0x140db0(0x241)]&&!_0x3bc8b3[_0x140db0(0x236)]&&!_0x3bc8b3[_0x140db0(0x1e8)]&&!_0x3bc8b3[_0x140db0(0x224)])return{..._0x3bc8b3,'format':_0x140db0(0x236),'json':!![]};return _0x3bc8b3;}function formatJourneyState(_0x5d1e26){const _0x504a8f=a28_0x5c6b;switch(_0x5d1e26){case _0x504a8f(0x1b5):return a28_0x35ee26[_0x504a8f(0x169)]('(running)');case _0x504a8f(0x150):return a28_0x35ee26[_0x504a8f(0x258)](_0x504a8f(0x198));case'paused':return a28_0x35ee26[_0x504a8f(0x187)]('(paused)');case _0x504a8f(0x185):return a28_0x35ee26[_0x504a8f(0x1f4)](_0x504a8f(0x175));case _0x504a8f(0x1f1):return a28_0x35ee26[_0x504a8f(0x258)](_0x504a8f(0x209));default:return'('+_0x5d1e26+')';}}function formatJourneyItem(_0x267eb4,_0x23c260='',_0x4b3c0a){const _0x4b9c72=a28_0x5c6b,_0x4594ee=formatJourneyState(_0x267eb4[_0x4b9c72(0x22f)]),_0x1c717e=_0x4b3c0a?hyperlink(_0x267eb4['journeyBundleName'],_0x4b3c0a):_0x267eb4[_0x4b9c72(0x158)];return _0x23c260+'🗺️\x20'+_0x1c717e+'\x20'+_0x4594ee;}function escapeRegex(_0x9858d7){const _0x2f9634=a28_0x5c6b;return _0x9858d7[_0x2f9634(0x21a)](/[.*+?^${}()|[\]\\]/g,_0x2f9634(0x179));}function globToRegex(_0x40edd2){const _0x4bbc66=a28_0x5c6b,_0x4ada25=_0x40edd2[_0x4bbc66(0x257)]('*')[_0x4bbc66(0x253)](escapeRegex);return new RegExp(_0x4ada25['join']('.*'),'i');}function buildRuleToNameMapping(_0x59a5e8){const _0x27b368=a28_0x5c6b,_0x507293=new Map();if(_0x59a5e8[_0x27b368(0x15c)])for(const [_0xc5659d,_0x7bc669]of Object['entries'](_0x59a5e8[_0x27b368(0x15c)])){if(_0x7bc669[_0x27b368(0x15d)]){const _0x3a7e88=serializeRule(_0x7bc669[_0x27b368(0x15d)]),_0x539352=_0x507293[_0x27b368(0x199)](_0x3a7e88);_0x539352?_0x539352['push'](_0xc5659d):_0x507293['set'](_0x3a7e88,[_0xc5659d]);}}return _0x507293;}async function resolveJourneyIdFromInput(_0x42c74d,_0x54a9d1,_0x3c752c){const _0x321939=a28_0x5c6b,_0x5594ed=await resolveJourneyTarget(_0x42c74d,_0x54a9d1['parentSegment'],_0x54a9d1[_0x321939(0x19e)]),_0x386787=_0x5594ed[_0x321939(0x25a)];if(!_0x386787)throw new SDKError(ErrorCode[_0x321939(0x184)],_0x321939(0x1f6));const _0x549eb5=await withSpinner(_0x321939(0x1d8),()=>_0x3c752c['segment'][_0x321939(0x22c)](_0x386787),{'verbose':_0x54a9d1[_0x321939(0x19e)]}),_0x6710e4=_0x549eb5[_0x321939(0x1ca)],_0x104004=await withSpinner(_0x321939(0x196),()=>_0x3c752c[_0x321939(0x1f3)][_0x321939(0x251)](_0x6710e4,_0x5594ed['journeyName']),{'verbose':_0x54a9d1[_0x321939(0x19e)]});return{'journeyId':_0x104004['data'],'journeyName':_0x5594ed[_0x321939(0x1d4)],'parentSegmentId':_0x6710e4};}async function resolveJourneyTarget(_0x529a37,_0x59fc2d,_0xfb485b){const _0x27fef4=a28_0x5c6b;if(isYamlFilePath(_0x529a37))try{const _0x2363ab=await resolveYamlFilePath(_0x529a37);return _0xfb485b&&(console[_0x27fef4(0x15a)]('Resolved\x20YAML\x20file:\x20'+_0x529a37),console[_0x27fef4(0x15a)](_0x27fef4(0x1d3)+_0x2363ab['parentSegment']),console['error'](_0x27fef4(0x1d7)+_0x2363ab[_0x27fef4(0x1b6)]),console[_0x27fef4(0x15a)](_0x27fef4(0x1c2)+(_0x2363ab[_0x27fef4(0x1c5)]||_0x27fef4(0x214)))),{'journeyName':_0x2363ab[_0x27fef4(0x1b6)],'parentSegment':_0x2363ab[_0x27fef4(0x25a)],'resolved':_0x2363ab};}catch(_0x25e575){throw new SDKError(ErrorCode[_0x27fef4(0x184)],_0x27fef4(0x152)+_0x25e575['message']);}if(!_0x59fc2d)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x529a37,'parentSegment':_0x59fc2d};}function a28_0x592c(){const _0x52c824=['✔\x20Pulled\x20','name','journey:push','user','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journey:pull','activationParams','/app/ps/','Resolving\x20journey...','isNew','(draft)','get','Aborted.','listJourneysWithFolders','localeCompare','options','verbose','\x20unchanged\x20files',',\x20version:\x20','parentName','has','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','description','\x20=\x20','journey:pause','Show\x20journey\x20statistics','Found\x20','4xcbnBa','Pausing\x20journey...','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','journey:versions','132FnmEdj','Show\x20journey\x20details','segment','Fetching\x20users\x20and\x20connections...','Error:\x20Invalid\x20--type\x20\x22','getActivation','journey:list','launched','segmentName','completionRate','dryRun','length','goal','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','goalSize','\x22\x20paused','\x20\x20-\x20','Getting\x20version\x20','List\x20activations\x20for\x20a\x20journey','absolutePath','\x20\x20Folder\x20path:\x20','Resolving\x20version...','table','folderPath','parent_segment','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','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)','data','web','Getting\x20journey\x20statistics...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','size','Warning:\x20Could\x20not\x20resolve\x20activation\x20','type','message','diff','\x20\x20Parent\x20segment:\x20','journeyName','createdAt','\x20files?','\x20\x20Name:\x20','Resolving\x20parent\x20segment...','Creating\x20new\x20version...','conversion','Options:','activation_','Error:\x20Journey\x20\x27','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','35CXpUNg','cwd','\x0aChanges\x20to\x20\x27','exitOrJumpSize','completeMilestoneRate','Fetching\x20parent\x20segment...','List\x20all\x20versions\x20of\x20a\x20journey','values','\x20version','jsonl','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','stageNameMap','join','Error:\x20Parent\x20segment\x20context\x20required','yes','milestoneSize','journey:version:create','Error:\x20Version\x20','archived','journey:activations','journey','blue','relative','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','hasPeriod','tdx.json','2486742dLxUNn','base','\x0aPull\x20summary:','then','resolveSegment','getTrafficData','find','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Error:\x20Stage\x20\x22','journeys','set','.yml','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','\x20\x20Statistics\x20not\x20available','Pattern:\x20','enteredSize','(archived)','55449skgFVD','toLowerCase','Cancelled','attributes','1498JlsnvQ','6rKFxcX','red','\x20\x20Journey\x20ID:\x20','\x0aError:','✔\x20Context\x20set:\x20','(root)','getLatestJourneyId','site','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','updatedAt','Available\x20stages:\x20','replace','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','repeat','history','getColumnMapping','Error:\x20Invalid\x20version\x20number:\x20','\x20->\x20','journey:version:view','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Getting\x20journey\x20traffic\x20data...','tsv','content','journeyBundleId','connector_config','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Pause\x20a\x20running\x20journey','execute','Target\x20file:\x20','resolveParentId','log','stages','state','add','reentryMode','push','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','test','json','filter','listVersions','✔\x20Journey\x20\x22','Fetching\x20journeys\x20and\x20folders...','Table:\x20','245349VSTLvP','no_parent','utf-8','\x20\x20Target:\x20','17780lmyGrF','format','Fetching\x20','filePath','buildIdToEmailMap','\x20versions)','No\x20journeys\x20found','\x20journey\x20files\x20to\x20','2120QHWDYe','\x22\x20resumed','Input:\x20','Target\x20directory:\x20','hasChanges','cyan','from','✔\x20Found\x20','exitOrJumpRate','resolveJourneyId','1427352vuoxxF','map','Parent\x20segment:\x20','Listing\x20journeys...','\x20not\x20found.\x20Available:\x20','split','dim','folders','parentSegment','renderStats','Listing\x20journey\x20activations...','file','listFolders','Journey\x20name:\x20','journeyStages','\x20activation','/j/da','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','draft','stage','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','229977TLgaZq','args','all','getJourney','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','journeyBundleName','📁\x20','error','pause','segments','rule','Error:\x20Journey\x20not\x20found:\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x20\x20Consolidating\x20duplicate\x20segment:\x20','/j/da/je','...','Resuming\x20journey...','buildIdToNameMap','root\x20folder','sort','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/e/','green','-\x20no\x20files\x20written','2752ezahFE','\x20(draft)\x20—\x20\x22','getStatistics','441918NWLtxd','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Folder\x20path:\x20','Getting\x20journey\x20details...','Database:\x20','versionNumber','Show\x20journey\x20table\x20column\x20mapping','(completed)','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journeyId','\x20(rule\x20match)','\x5c$&','targetDir','segmentPushCommand','resume','connection','folderId','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','limit','Write\x20','\x20(ID:\x20','\x22\x20not\x20found','INVALID_ARGUMENT','completed','includeHistory','yellow','session','getSegment','\x20Created\x20v','Error:\x20--version\x20option\x20is\x20required','paused','getParentFull'];a28_0x592c=function(){return _0x52c824;};return a28_0x592c();}export class JourneyListCommand extends BaseCommand{['name']=a28_0x35a506(0x1b4);[a28_0x35a506(0x1a4)]='List\x20journeys\x20in\x20current\x20context';async[a28_0x35a506(0x22a)](_0x2c60a8){const _0x56090e=a28_0x35a506,{options:_0x5c2612,args:_0x26b707,tdx:_0x1d6157}=_0x2c60a8,_0x1051ec=_0x26b707[0x0],_0x1c2dbf=_0x5c2612['parentSegment'];if(!_0x1c2dbf)return console[_0x56090e(0x15a)](_0x56090e(0x1ec)),console[_0x56090e(0x15a)](_0x56090e(0x222)),0x1;const _0x123819=await withSpinner(_0x56090e(0x1d8),()=>_0x1d6157['segment'][_0x56090e(0x22c)](_0x1c2dbf),{'verbose':_0x5c2612[_0x56090e(0x19e)]}),_0x3ffa80=_0x123819[_0x56090e(0x1ca)];_0x5c2612['verbose']&&(console[_0x56090e(0x15a)](_0x56090e(0x254)+_0x1c2dbf+_0x56090e(0x182)+_0x3ffa80+')'),_0x1051ec&&console[_0x56090e(0x15a)](_0x56090e(0x207)+_0x1051ec));const _0x49ee66=await withSpinner(_0x56090e(0x1e4),()=>_0x1d6157[_0x56090e(0x1b0)][_0x56090e(0x18d)](_0x3ffa80),{'verbose':_0x5c2612[_0x56090e(0x19e)]}),_0x1ce32d=_0x49ee66[_0x56090e(0x1ca)],_0x5cd72e=_0x1ce32d['rootFolderId'],_0x5292b1=await withSpinner(_0x56090e(0x255),()=>_0x1d6157[_0x56090e(0x1f3)][_0x56090e(0x19b)](_0x3ffa80,_0x5cd72e),{'verbose':_0x5c2612[_0x56090e(0x19e)]});let _0xb45402=_0x5292b1[_0x56090e(0x1ca)][_0x56090e(0x202)];const _0x4583a7=_0x5292b1[_0x56090e(0x1ca)][_0x56090e(0x259)],_0x5b21cd=new Map();for(const _0x9575df of _0x4583a7){_0x5b21cd[_0x56090e(0x203)](_0x9575df['id'],_0x9575df[_0x56090e(0x18f)]);}if(_0x1051ec){const _0x4ffe8a=globToRegex(_0x1051ec);_0xb45402=_0xb45402[_0x56090e(0x237)](_0x165393=>_0x4ffe8a[_0x56090e(0x235)](_0x165393['journeyBundleName']));}console['error'](_0x56090e(0x24f)+_0xb45402[_0x56090e(0x1b9)]+'\x20journey'+(_0xb45402[_0x56090e(0x1b9)]!==0x1?'s':''));const _0x1345d1=_0x3ab3dc=>{const _0x2956f0=_0x56090e;return getConsoleNextUrl(_0x5c2612[_0x2956f0(0x216)],_0x2956f0(0x195)+_0x3ffa80+_0x2956f0(0x168)+_0x3ab3dc+_0x2956f0(0x262));};if(_0x5c2612[_0x56090e(0x241)]==='table')await handleSDKOutput(_0xb45402,_0x5c2612);else{if(_0x5c2612[_0x56090e(0x241)]===_0x56090e(0x236)){const _0x1864f6=_0xb45402[_0x56090e(0x253)](_0x18bcb3=>({..._0x18bcb3,'url':_0x1345d1(_0x18bcb3['id'])}));await handleSDKOutput(_0x1864f6,_0x5c2612);}else{console['log']('['+_0x1c2dbf+']');const _0x3d7d88=new Map(),_0x283348=[];for(const _0x2bdc4a of _0xb45402){if(!_0x2bdc4a[_0x56090e(0x17e)]||_0x2bdc4a[_0x56090e(0x17e)]===_0x5cd72e)_0x283348[_0x56090e(0x232)](_0x2bdc4a);else{const _0x5e307e=_0x3d7d88[_0x56090e(0x199)](_0x2bdc4a[_0x56090e(0x17e)])||[];_0x5e307e[_0x56090e(0x232)](_0x2bdc4a),_0x3d7d88[_0x56090e(0x203)](_0x2bdc4a[_0x56090e(0x17e)],_0x5e307e);}}const _0xea8bf5=(_0x42a033,_0x12b7ca)=>_0x42a033[_0x56090e(0x158)][_0x56090e(0x19c)](_0x12b7ca[_0x56090e(0x158)],undefined,{'sensitivity':_0x56090e(0x1fa)});_0x283348[_0x56090e(0x166)](_0xea8bf5);for(const _0x3d1099 of _0x283348){console[_0x56090e(0x22d)](formatJourneyItem(_0x3d1099,'',_0x1345d1(_0x3d1099['id'])));}const _0x2e1afa=[..._0x3d7d88['entries']()][_0x56090e(0x166)]((_0x1e382e,_0x20dd55)=>{const _0x3a8d2d=_0x56090e,_0x39c62c=_0x5b21cd[_0x3a8d2d(0x199)](_0x1e382e[0x0])||_0x1e382e[0x0],_0x3eef97=_0x5b21cd['get'](_0x20dd55[0x0])||_0x20dd55[0x0];return _0x39c62c[_0x3a8d2d(0x19c)](_0x3eef97,undefined,{'sensitivity':'base'});});for(const [_0x149bbc,_0x4488a2]of _0x2e1afa){const _0x5632d2=_0x5b21cd[_0x56090e(0x199)](_0x149bbc)||_0x149bbc;console[_0x56090e(0x22d)](_0x56090e(0x159)+_0x5632d2),_0x4488a2[_0x56090e(0x166)](_0xea8bf5);for(const _0x2b594b of _0x4488a2){console['log'](formatJourneyItem(_0x2b594b,'\x20\x20',_0x1345d1(_0x2b594b['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:view';['description']=a28_0x35a506(0x1af);async['execute'](_0x497128){const _0x36d5ed=a28_0x35a506,{options:_0x522c4d,args:_0x283925,tdx:_0xedaf2e}=_0x497128,_0x20cf29=_0x283925[0x0];if(!_0x20cf29)return console[_0x36d5ed(0x15a)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x36d5ed(0x15a)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x36d5ed(0x15a)](_0x36d5ed(0x1db)),console['error'](_0x36d5ed(0x1ac)),0x1;_0x522c4d[_0x36d5ed(0x19e)]&&console['error'](_0x36d5ed(0x24a)+_0x20cf29);const {journeyId:_0x33ec35,parentSegmentId:_0x2041a6}=await resolveJourneyIdFromInput(_0x20cf29,_0x522c4d,_0xedaf2e);if(_0x522c4d[_0x36d5ed(0x1cb)]){const _0x4b5c63=getConsoleNextUrl(_0x522c4d['site'],_0x36d5ed(0x195)+_0x2041a6+_0x36d5ed(0x168)+_0x33ec35+'/j/da/je');return console['error'](a28_0x35ee26[_0x36d5ed(0x169)]('✔')+'\x20Opening\x20'+a28_0x35ee26['cyan'](_0x4b5c63)),openBrowser(_0x4b5c63),0x0;}const _0x477906=await withSpinner(_0x36d5ed(0x171),()=>_0xedaf2e['journey']['getJourney'](_0x33ec35),{'verbose':_0x522c4d[_0x36d5ed(0x19e)]}),_0x26c5af=_0x477906[_0x36d5ed(0x1ca)],_0x15fb92=_0x522c4d['includeStats'];let _0x59e0e2;if(_0x15fb92)try{const _0x12dc89=await withSpinner(_0x36d5ed(0x1cc),()=>_0xedaf2e[_0x36d5ed(0x1f3)]['getStatistics'](_0x33ec35),{'verbose':_0x522c4d[_0x36d5ed(0x19e)]});_0x59e0e2=_0x12dc89['data'];}catch{_0x522c4d[_0x36d5ed(0x19e)]&&console[_0x36d5ed(0x15a)](_0x36d5ed(0x206));}const _0x28fb5e=getConsoleNextUrl(_0x522c4d[_0x36d5ed(0x216)],_0x36d5ed(0x195)+_0x2041a6+'/e/'+_0x33ec35+'/j/da/je'),_0x579143={'id':_0x26c5af['id'],'name':_0x26c5af['attributes'][_0x36d5ed(0x18f)],'description':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x1a4)],'state':_0x26c5af[_0x36d5ed(0x20d)]['state'],'paused':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x18c)],'reentry_mode':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x231)],'stages':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x260)]?.[_0x36d5ed(0x1b9)]||0x0,..._0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x1ba)]&&{'goal':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x1ba)][_0x36d5ed(0x18f)]},..._0x59e0e2&&{'statistics':{'size':_0x59e0e2[_0x36d5ed(0x1ce)],'entered':_0x59e0e2[_0x36d5ed(0x208)],'goal_achieved':_0x59e0e2[_0x36d5ed(0x1bc)],'completion_rate':_0x59e0e2[_0x36d5ed(0x1b7)],'exit_or_jump':_0x59e0e2[_0x36d5ed(0x1e2)],'exit_or_jump_rate':_0x59e0e2[_0x36d5ed(0x250)],'stages':_0x59e0e2[_0x36d5ed(0x22e)]}},'url':_0x28fb5e};return await handleSingleObjectOutput(_0x579143,_0x522c4d),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:stats';['description']=a28_0x35a506(0x1a7);async['execute'](_0x51e726){const _0x3f3e14=a28_0x35a506,{options:_0x4c7dfa,args:_0x359f72,tdx:_0x273fc6}=_0x51e726,_0xdd61b1=_0x359f72[0x0];if(!requireNameOrPath(_0xdd61b1))return 0x1;_0x4c7dfa[_0x3f3e14(0x19e)]&&console[_0x3f3e14(0x15a)](_0x3f3e14(0x24a)+_0xdd61b1);const _0x458fb6=_0x4c7dfa,_0x3b6df9=_0x458fb6[_0x3f3e14(0x24e)],_0x37b093=_0x458fb6['to'],_0x5d0b37=_0x458fb6[_0x3f3e14(0x186)],_0x59d578=_0x458fb6[_0x3f3e14(0x151)];_0x5d0b37&&!_0x3b6df9&&!_0x37b093&&console[_0x3f3e14(0x15a)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x5111c7=_0x5d0b37?withJsonFormat(_0x4c7dfa):_0x4c7dfa,{journeyId:_0x44cf92,journeyName:_0x4fb6f3}=await resolveJourneyIdFromInput(_0xdd61b1,_0x5111c7,_0x273fc6),_0x38fdeb=_0x3b6df9||_0x37b093?{'from':_0x3b6df9,'to':_0x37b093}:undefined,_0x3ceaec=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise['all']([_0x273fc6[_0x3f3e14(0x1f3)][_0x3f3e14(0x156)](_0x44cf92),_0x273fc6[_0x3f3e14(0x1f3)][_0x3f3e14(0x16d)](_0x44cf92,_0x38fdeb)]),{'verbose':_0x5111c7['verbose']}),[_0x3cbd99,_0x2731b5]=_0x3ceaec[_0x3f3e14(0x1ca)];if(!_0x2731b5||_0x2731b5[_0x3f3e14(0x177)]===null)return console[_0x3f3e14(0x15a)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x4fb6f3),console[_0x3f3e14(0x15a)](_0x3f3e14(0x21b)),0x0;const _0xf4286e=buildStageNameMap(_0x3cbd99),_0x27d2a4=!!(_0x38fdeb&&_0x2731b5[_0x3f3e14(0x21d)]?.[_0x3f3e14(0x1b9)]),_0x316446={'stageNameMap':_0xf4286e,'hasPeriod':_0x27d2a4,'includeHistory':!!_0x5d0b37};if(_0x59d578&&_0x2731b5[_0x3f3e14(0x22e)]){const _0x1fd950=_0x2731b5[_0x3f3e14(0x22e)][_0x3f3e14(0x1ff)](_0x4a15f4=>{const _0x5eb1b4=_0x3f3e14,_0x40b8f1=_0xf4286e[_0x5eb1b4(0x199)](_0x4a15f4['id'])??'';return _0x40b8f1[_0x5eb1b4(0x20b)]()===_0x59d578[_0x5eb1b4(0x20b)]();});if(_0x1fd950)return await handleSingleObjectOutput(formatStageStats(_0x1fd950,_0x316446),_0x5111c7),0x0;const _0x1e9721=_0x2731b5[_0x3f3e14(0x22e)]['map'](_0x2ee43c=>_0xf4286e[_0x3f3e14(0x199)](_0x2ee43c['id'])??_0x2ee43c['id']);return console['error'](_0x3f3e14(0x201)+_0x59d578+_0x3f3e14(0x183)),console[_0x3f3e14(0x15a)](_0x3f3e14(0x219)+_0x1e9721[_0x3f3e14(0x1eb)](',\x20')),0x1;}const _0x391163=_0x2731b5[_0x3f3e14(0x22e)]?.[_0x3f3e14(0x253)](_0x2b0877=>formatStageStats(_0x2b0877,_0x316446)),_0x476af8=assembleJourneyStats(_0x2731b5,{'from':_0x3b6df9,'to':_0x37b093,'includeHistory':_0x5d0b37});return await this[_0x3f3e14(0x25b)](_0x476af8,_0x391163??[],_0x5111c7),0x0;}async['renderStats'](_0x3c93e8,_0x281b74,_0x4031a0){const _0x1f0912=a28_0x35a506,_0x494e43=_0x4031a0[_0x1f0912(0x241)]===_0x1f0912(0x236)||_0x4031a0[_0x1f0912(0x241)]===_0x1f0912(0x1e8)||_0x4031a0[_0x1f0912(0x236)]||_0x4031a0[_0x1f0912(0x1e8)];if(_0x494e43){_0x3c93e8[_0x1f0912(0x22e)]=_0x281b74,await handleSingleObjectOutput(_0x3c93e8,_0x4031a0);return;}await handleSingleObjectOutput(_0x3c93e8,_0x4031a0);for(const _0x24dd67 of _0x281b74){console[_0x1f0912(0x22d)](''),console[_0x1f0912(0x22d)](String(a28_0x35ee26[_0x1f0912(0x24d)]['bold']('['+_0x24dd67['name']+']'))+a28_0x35ee26[_0x1f0912(0x258)]('\x20'+_0x24dd67['id']));const {id:_0x1f89ae,name:_0x2e36a8,..._0x19551d}=_0x24dd67;await handleSingleObjectOutput(_0x19551d,_0x4031a0);}}}export class JourneyTrafficCommand extends BaseCommand{['name']='journey:traffic';[a28_0x35a506(0x1a4)]=a28_0x35a506(0x1c7);async[a28_0x35a506(0x22a)](_0x593025){const _0x3fc6e5=a28_0x35a506,{options:_0x2b83a9,args:_0x26f5d2,tdx:_0x5a5225}=_0x593025,_0x11d421=_0x26f5d2[0x0];if(!requireNameOrPath(_0x11d421))return 0x1;_0x2b83a9[_0x3fc6e5(0x19e)]&&console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x24a)+_0x11d421);const _0x19af03=_0x2b83a9,_0x41eb13=_0x19af03[_0x3fc6e5(0x1d0)],_0x8afb52=_0x19af03[_0x3fc6e5(0x24e)],_0x105103=_0x19af03['to'],_0x418948=_0x19af03[_0x3fc6e5(0x180)];if(_0x41eb13&&_0x41eb13!==_0x3fc6e5(0x1da)&&_0x41eb13!=='activation')return console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x1b2)+_0x41eb13+_0x3fc6e5(0x217)),0x1;const _0x42c232=withJsonFormat(_0x2b83a9),{journeyId:_0x3a5b72,journeyName:_0xb47949}=await resolveJourneyIdFromInput(_0x11d421,_0x42c232,_0x5a5225),_0x2e2f1b={'type':_0x41eb13,'from':_0x8afb52,'to':_0x105103,'limit':_0x418948},_0x41988b=await withSpinner(_0x3fc6e5(0x223),()=>_0x5a5225[_0x3fc6e5(0x1f3)][_0x3fc6e5(0x1fe)](_0x3a5b72,_0x2e2f1b),{'verbose':_0x42c232['verbose']}),_0x856f99=_0x41988b[_0x3fc6e5(0x1ca)],_0x231ad0=_0x856f99['conversion']&&(_0x856f99[_0x3fc6e5(0x1da)]['nodes']['length']>0x0||_0x856f99[_0x3fc6e5(0x1da)]['links']['length']>0x0),_0x16e3b0=_0x856f99['activation']&&_0x856f99['activation'][_0x3fc6e5(0x1b9)]>0x0;if(!_0x231ad0&&!_0x16e3b0)return console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x1e9)+_0xb47949),console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x17f)),_0x8afb52&&_0x105103&&console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x1cd)),0x0;return await handleSingleObjectOutput(_0x856f99,_0x42c232),0x0;}}function formatStageStats(_0x5b363c,_0x28caa9){const _0x2f7d34=a28_0x35a506,_0x296126=_0x28caa9[_0x2f7d34(0x1f7)]&&_0x5b363c[_0x2f7d34(0x21d)]?.['length']?aggregateStageHistory(_0x5b363c[_0x2f7d34(0x21d)]):{'size':_0x5b363c['size'],'entered':_0x5b363c[_0x2f7d34(0x208)],'milestone':_0x5b363c[_0x2f7d34(0x1ee)],'milestone_rate':_0x5b363c[_0x2f7d34(0x1e3)],'exit_or_jump':_0x5b363c[_0x2f7d34(0x1e2)],'exit_or_jump_rate':_0x5b363c[_0x2f7d34(0x250)]},_0x326fff={'id':_0x5b363c['id'],'name':_0x28caa9[_0x2f7d34(0x1ea)][_0x2f7d34(0x199)](_0x5b363c['id'])??_0x5b363c['id'],..._0x296126};return _0x28caa9[_0x2f7d34(0x1f7)]&&_0x28caa9['includeHistory']&&_0x5b363c[_0x2f7d34(0x21d)]&&(_0x326fff[_0x2f7d34(0x21d)]=_0x5b363c[_0x2f7d34(0x21d)]),_0x326fff;}export class JourneyPauseCommand extends BaseCommand{['name']=a28_0x35a506(0x1a6);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x229);async[a28_0x35a506(0x22a)](_0x561ee3){const _0x590eb5=a28_0x35a506,{options:_0x1a2826,args:_0x31e0df,tdx:_0x47d9a1}=_0x561ee3,_0x18c2f5=_0x31e0df[0x0];if(!requireNameOrPath(_0x18c2f5))return 0x1;_0x1a2826[_0x590eb5(0x19e)]&&console[_0x590eb5(0x15a)](_0x590eb5(0x24a)+_0x18c2f5);const {journeyId:_0x286c44,journeyName:_0x35ce60}=await resolveJourneyIdFromInput(_0x18c2f5,_0x1a2826,_0x47d9a1);if(!_0x1a2826[_0x590eb5(0x1ed)]){const _0x5c1d1e=await confirm(_0x590eb5(0x200)+_0x35ce60+'\x22?');if(!_0x5c1d1e)return console['error'](_0x590eb5(0x20c)),0x0;}const _0x54dbc9=await withSpinner(_0x590eb5(0x1aa),()=>_0x47d9a1[_0x590eb5(0x1f3)][_0x590eb5(0x15b)](_0x286c44),{'verbose':_0x1a2826[_0x590eb5(0x19e)]}),_0x4fa5be=_0x54dbc9[_0x590eb5(0x1ca)];return console[_0x590eb5(0x15a)](_0x590eb5(0x239)+_0x4fa5be[_0x590eb5(0x20d)][_0x590eb5(0x18f)]+_0x590eb5(0x1bd)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:resume';[a28_0x35a506(0x1a4)]='Resume\x20a\x20paused\x20journey';async[a28_0x35a506(0x22a)](_0x1ed973){const _0x2ac3c4=a28_0x35a506,{options:_0x1a61ca,args:_0x8fecaf,tdx:_0x329db6}=_0x1ed973,_0x406e86=_0x8fecaf[0x0];if(!requireNameOrPath(_0x406e86))return 0x1;_0x1a61ca[_0x2ac3c4(0x19e)]&&console['error']('Input:\x20'+_0x406e86);const {journeyId:_0x251f4d,journeyName:_0x48ae5f}=await resolveJourneyIdFromInput(_0x406e86,_0x1a61ca,_0x329db6);if(!_0x1a61ca[_0x2ac3c4(0x1ed)]){const _0x467af6=await confirm(_0x2ac3c4(0x1c8)+_0x48ae5f+'\x22?');if(!_0x467af6)return console[_0x2ac3c4(0x15a)]('Cancelled'),0x0;}const _0x5de4db=await withSpinner(_0x2ac3c4(0x163),()=>_0x329db6[_0x2ac3c4(0x1f3)][_0x2ac3c4(0x17c)](_0x251f4d),{'verbose':_0x1a61ca[_0x2ac3c4(0x19e)]}),_0x1d7ca3=_0x5de4db[_0x2ac3c4(0x1ca)];return console[_0x2ac3c4(0x15a)](_0x2ac3c4(0x239)+_0x1d7ca3[_0x2ac3c4(0x20d)]['name']+_0x2ac3c4(0x249)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x193);[a28_0x35a506(0x1a4)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a28_0x35a506(0x22a)](_0x4c1b06){const _0x3bd2c9=a28_0x35a506,{options:_0x4c1b9a,args:_0xee4706,tdx:_0x45e3d4}=_0x4c1b06,_0x41bf22=_0x4c1b9a,_0x4a461e=_0xee4706[0x0],_0x48f325=_0x4a461e&&isYamlFilePath(_0x4a461e),_0x2525fe=await resolveTarget({'arg':_0x48f325?_0x4a461e:undefined,'contextParent':_0x4c1b9a['parentSegment'],'cwd':process[_0x3bd2c9(0x1e0)]()});if(!isSuccessfulResolution(_0x2525fe))return _0x2525fe['errorCode']===_0x3bd2c9(0x23d)?(console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x187)](_0x3bd2c9(0x14f))),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1c9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1a3))):(console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x210)]('Error:\x20'+_0x2525fe['message']+'\x0a')),_0x2525fe['helpText']&&console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x24d)](_0x2525fe['helpText']))),0x1;let _0x38b518=_0x48f325?undefined:_0x4a461e,_0x3f1d3e,_0x656254;_0x2525fe[_0x3bd2c9(0x1d0)]===_0x3bd2c9(0x25d)&&(_0x38b518=_0x2525fe['resourceName'],_0x3f1d3e=_0x2525fe[_0x3bd2c9(0x243)],_0x656254=_0x2525fe[_0x3bd2c9(0x1c5)]);const _0x2cc5be=_0x2525fe[_0x3bd2c9(0x1a1)],_0x1d8755=_0x2525fe[_0x3bd2c9(0x17a)];_0x41bf22['verbose']&&(console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x254)+_0x2cc5be),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x24b)+_0x1d8755),_0x38b518&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x25f)+_0x38b518),_0x3f1d3e&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x22b)+_0x3f1d3e),_0x656254&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x170)+_0x656254));const _0x237894=await withSpinner(_0x3bd2c9(0x1d8),()=>_0x45e3d4[_0x3bd2c9(0x1b0)][_0x3bd2c9(0x22c)](_0x2cc5be),{'verbose':_0x4c1b9a[_0x3bd2c9(0x19e)]}),_0x5b5901=_0x237894[_0x3bd2c9(0x1ca)],{journeys:_0xe9f18b,folders:_0x4e709b}=await withSpinner(_0x3bd2c9(0x23a),async()=>{const _0x4a2961=_0x3bd2c9,[_0x2b9b1a,_0x2f9bf0]=await Promise['all']([_0x45e3d4['journey']['listJourneysFromParentSegment'](_0x5b5901,undefined,{'includeAllVersions':!![]}),_0x45e3d4['segment'][_0x4a2961(0x25e)](_0x5b5901)]);return{'journeys':_0x2b9b1a,'folders':_0x2f9bf0};},{'verbose':_0x4c1b9a['verbose']})['then'](_0x94abc5=>_0x94abc5[_0x3bd2c9(0x1ca)]);let _0x2c7ea5=_0xe9f18b;const _0xb483c1=buildFolderIdToPathMap(_0x4e709b);if(_0x38b518){const _0x3fd0a2=_0x2c7ea5[_0x3bd2c9(0x237)](_0x338014=>_0x338014[_0x3bd2c9(0x158)]['toLowerCase']()===_0x38b518[_0x3bd2c9(0x20b)]());if(_0x3fd0a2[_0x3bd2c9(0x1b9)]===0x0)return console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x15e)+_0x38b518),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1bb)),0x1;_0x2c7ea5=_0x3fd0a2;}if(_0x656254!==undefined){const _0x408014=_0x2c7ea5[_0x3bd2c9(0x237)](_0x4be564=>{const _0x5694d0=_0x3bd2c9,_0x11fec1=_0x4be564[_0x5694d0(0x17e)]?_0xb483c1['get'](_0x4be564[_0x5694d0(0x17e)])||'':'';return _0x11fec1===_0x656254;});if(_0x408014[_0x3bd2c9(0x1b9)]===0x0&&_0x2c7ea5['length']>0x0){console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1dd)+_0x38b518+'\x27\x20not\x20found\x20in\x20'+(_0x656254||_0x3bd2c9(0x165))),console['error'](_0x3bd2c9(0x1de));for(const _0x68d68f of _0x2c7ea5){const _0x384fa2=_0x68d68f[_0x3bd2c9(0x17e)]?_0xb483c1[_0x3bd2c9(0x199)](_0x68d68f[_0x3bd2c9(0x17e)])||'':'';console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1be)+(_0x384fa2||_0x3bd2c9(0x214))+'/'+_0x68d68f[_0x3bd2c9(0x158)]);}return 0x1;}_0x2c7ea5=_0x408014;}if(_0x2c7ea5[_0x3bd2c9(0x1b9)]===0x0)return console['error'](_0x3bd2c9(0x246)),0x0;const _0x526a9d=new Map();for(const _0x1e52de of _0x2c7ea5){const _0x3f1dd5=_0x1e52de['journeyBundleId'];!_0x526a9d[_0x3bd2c9(0x1a2)](_0x3f1dd5)&&_0x526a9d['set'](_0x3f1dd5,[]),_0x526a9d[_0x3bd2c9(0x199)](_0x3f1dd5)[_0x3bd2c9(0x232)](_0x1e52de);}for(const _0x18c1ad of _0x526a9d['values']()){_0x18c1ad[_0x3bd2c9(0x166)]((_0x3a6c02,_0x1a289b)=>(_0x3a6c02[_0x3bd2c9(0x173)]||0x0)-(_0x1a289b[_0x3bd2c9(0x173)]||0x0));}const _0x241dcb=[],{idToEmailMap:_0x4beea1,connectionIdToNameMap:_0x278361}=await withSpinner(_0x3bd2c9(0x1b1),async()=>{const _0x3c1985=_0x3bd2c9,[_0x593e98,_0x3109f5]=await Promise[_0x3c1985(0x155)]([_0x45e3d4[_0x3c1985(0x191)][_0x3c1985(0x244)](),_0x45e3d4[_0x3c1985(0x17d)][_0x3c1985(0x164)]()]);return{'idToEmailMap':_0x593e98,'connectionIdToNameMap':_0x3109f5};},{'verbose':_0x4c1b9a[_0x3bd2c9(0x19e)]})[_0x3bd2c9(0x1fc)](_0x50cb8a=>_0x50cb8a[_0x3bd2c9(0x1ca)]);for(const _0x5e6e27 of _0x526a9d[_0x3bd2c9(0x1e6)]()){const _0x4052c6=_0x5e6e27[0x0][_0x3bd2c9(0x158)],_0x41e57f=_0x5e6e27[0x0]['folderId'],_0x3e0136=_0x41e57f?_0xb483c1[_0x3bd2c9(0x199)](_0x41e57f)||'':'',_0x257725=_0x3e0136?a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x1d8755,_0x3e0136):_0x1d8755,_0x497f55=_0x3f1d3e||a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x257725,sanitizeFileName(_0x4052c6)+_0x3bd2c9(0x204));let _0x3349dc,_0x4f6272;if(existsSync(_0x497f55))try{const _0x54d753=readFileSync(_0x497f55,_0x3bd2c9(0x23e)),_0x4a2f08=parseYamlString(_0x54d753);_0x4f6272=_0x4a2f08,_0x3349dc=buildRuleToNameMapping(_0x4a2f08),_0x41bf22['verbose']&&_0x3349dc[_0x3bd2c9(0x1ce)]>0x0&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1a8)+_0x3349dc[_0x3bd2c9(0x1ce)]+_0x3bd2c9(0x233)+_0x4052c6);}catch(_0x3b290d){_0x41bf22[_0x3bd2c9(0x19e)]&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x192)+_0x3b290d[_0x3bd2c9(0x1d1)]);}const _0x2890f4=[],_0x35c190=new Set(),_0x2b1fc6=new Map(),_0x30b7ec=new Map(),_0x3f8bf6=new Set(),_0x126044=new Map(),_0x50ecf3=new Map(),_0x1ce9d3=createJumpTargetCache();await withProgressSpinner(_0x3bd2c9(0x242)+_0x4052c6+_0x3bd2c9(0x162),async _0x29071b=>{const _0xd7d193=_0x3bd2c9;for(const _0x2fb4d7 of _0x5e6e27){const _0x518b93=_0x5e6e27[_0xd7d193(0x1b9)]>0x1?_0x2fb4d7[_0xd7d193(0x158)]+'\x20v'+(_0x2fb4d7['versionNumber']||0x1):_0x2fb4d7[_0xd7d193(0x158)];_0x29071b['setPhase'](_0xd7d193(0x242)+_0x518b93);const _0x10a684=await _0x45e3d4['journey'][_0xd7d193(0x156)](_0x2fb4d7['id']),_0x14304d=_0x10a684[_0xd7d193(0x20d)]?.['audienceId'],_0x2244f1={'resolveSegment':async _0x49f8a3=>{const _0x38de4d=_0xd7d193;if(!_0x14304d)return{'name':_0x49f8a3,'isJourneyLocal':![]};const _0x1aa50c=_0x2b1fc6['get'](_0x49f8a3);if(_0x1aa50c)return _0x1aa50c;try{const _0x9cfb7a=await _0x45e3d4[_0x38de4d(0x1b0)][_0x38de4d(0x189)](_0x14304d,_0x49f8a3),_0x3c19a4=_0x9cfb7a['kind']===SEGMENT_KIND_JOURNEY;let _0x193e95,_0x38cc53=_0x9cfb7a['name'];if(_0x3c19a4&&_0x9cfb7a[_0x38de4d(0x15d)]){const _0x4afe57=await segmentResponseToDef(_0x9cfb7a,{'resolveSegmentName':async _0x487bfc=>{const _0x5d803e=_0x38de4d,_0x3e68de=_0x2b1fc6[_0x5d803e(0x199)](_0x487bfc);if(_0x3e68de)return _0x3e68de[_0x5d803e(0x18f)];const _0x708af7=await _0x2244f1[_0x5d803e(0x1fd)](_0x487bfc);return _0x708af7['name'];}}),_0x2b536f=_0x4afe57[_0x38de4d(0x15d)];_0x193e95={'description':_0x9cfb7a['description'],'rule':_0x2b536f};const _0x5f3098=serializeRule(_0x2b536f),_0x17507b=_0x30b7ec['get'](_0x5f3098);if(_0x17507b)_0x38cc53=_0x17507b,_0x193e95=undefined,_0x41bf22[_0x38de4d(0x19e)]&&console['error'](_0x38de4d(0x160)+_0x9cfb7a[_0x38de4d(0x18f)]+_0x38de4d(0x220)+_0x17507b);else{let _0x446fa7=![];if(_0x3349dc){const _0x60cf39=_0x3349dc['get'](_0x5f3098);if(_0x60cf39){const _0x546c53=_0x60cf39[_0x38de4d(0x1ff)](_0x51624a=>!_0x35c190[_0x38de4d(0x1a2)](_0x51624a));_0x546c53&&(_0x38cc53=_0x546c53,_0x35c190[_0x38de4d(0x230)](_0x546c53),_0x30b7ec[_0x38de4d(0x203)](_0x5f3098,_0x546c53),_0x446fa7=!![],_0x41bf22[_0x38de4d(0x19e)]&&console[_0x38de4d(0x15a)](_0x38de4d(0x16f)+_0x546c53+_0x38de4d(0x178)));}}if(!_0x446fa7){const _0x27151a=generateJourneyLocalName(_0x9cfb7a[_0x38de4d(0x18f)]);_0x27151a&&(_0x38cc53=_0x27151a);let _0x3ca508=_0x38cc53,_0x35e1d6=0x2;while(_0x35c190[_0x38de4d(0x1a2)](_0x3ca508)){_0x3ca508=_0x38cc53+'_'+_0x35e1d6,_0x35e1d6++;}_0x35c190[_0x38de4d(0x230)](_0x3ca508),_0x30b7ec[_0x38de4d(0x203)](_0x5f3098,_0x3ca508),_0x38cc53=_0x3ca508;}}}const _0x4a8782={'name':_0x38cc53,'isJourneyLocal':_0x3c19a4,'definition':_0x193e95};return _0x2b1fc6[_0x38de4d(0x203)](_0x49f8a3,_0x4a8782),_0x4a8782;}catch(_0x4438d5){return _0x4c1b9a['verbose']&&console[_0x38de4d(0x15a)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x49f8a3+':\x20'+_0x4438d5['message']),{'name':_0x49f8a3,'isJourneyLocal':![]};}},'resolveActivation':async _0x6a3bf6=>{const _0x5f3087=_0xd7d193,_0x1c3126=_0x126044[_0x5f3087(0x199)](_0x6a3bf6);if(_0x1c3126)return _0x1c3126;try{const _0x50989a=await _0x45e3d4[_0x5f3087(0x1f3)][_0x5f3087(0x1b3)](_0x2fb4d7['id'],_0x6a3bf6),_0x12d774=journeyActivationStepToYaml(_0x50989a,_0x4beea1,_0x278361),_0x830751=JSON['stringify']({'name':_0x12d774['name'],'connection':_0x12d774[_0x5f3087(0x17d)],'connector_config':_0x12d774[_0x5f3087(0x227)]}),_0x420fd3=_0x50ecf3[_0x5f3087(0x199)](_0x830751);if(_0x420fd3){const _0x33301e={'name':_0x420fd3,'isJourneyLocal':!![],'definition':_0x12d774};return _0x126044[_0x5f3087(0x203)](_0x6a3bf6,_0x33301e),_0x33301e;}const _0x1a97db=_0x50989a[_0x5f3087(0x20d)][_0x5f3087(0x194)]['name']||_0x6a3bf6,_0x527f21=sanitizeYamlKey(_0x1a97db)||_0x5f3087(0x1dc)+_0x6a3bf6;let _0x394cd0=_0x527f21,_0x2f4c7f=0x2;while(_0x3f8bf6[_0x5f3087(0x1a2)](_0x394cd0)){_0x394cd0=_0x527f21+'_'+_0x2f4c7f,_0x2f4c7f++;}_0x3f8bf6[_0x5f3087(0x230)](_0x394cd0),_0x50ecf3[_0x5f3087(0x203)](_0x830751,_0x394cd0);const _0x6d071c={'name':_0x394cd0,'isJourneyLocal':!![],'definition':_0x12d774};return _0x126044[_0x5f3087(0x203)](_0x6a3bf6,_0x6d071c),_0x6d071c;}catch(_0x8d9233){return _0x4c1b9a[_0x5f3087(0x19e)]&&console[_0x5f3087(0x15a)](_0x5f3087(0x1cf)+_0x6a3bf6+':\x20'+_0x8d9233[_0x5f3087(0x1d1)]),{'name':_0x6a3bf6,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x258751,_0x1bf204)=>{const _0x2df604=_0xd7d193;return resolveJumpTarget(_0x258751,_0x1bf204,_0x1ce9d3,_0x59cdb3=>_0x45e3d4[_0x2df604(0x1f3)][_0x2df604(0x156)](_0x59cdb3));}},_0x3e66a0=await journeyResponseToDef(_0x10a684,_0x2244f1);_0x2890f4[_0xd7d193(0x232)]({'item':_0x2fb4d7,'yaml':_0x3e66a0});}},{'verbose':_0x4c1b9a[_0x3bd2c9(0x19e)]});const _0x2d0928=await _0x45e3d4[_0x3bd2c9(0x1f3)][_0x3bd2c9(0x215)](_0x5e6e27[0x0]['journeyBundleId']),_0x135f2e=buildMergedJourneyDef(_0x2890f4,_0x3349dc,_0x2d0928),_0x316c6c=normalizeJourneyDef(_0x135f2e,_0x4f6272),_0x4545b3=toYamlString(_0x316c6c),_0x3a4ded=_0x3f1d3e||a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x257725,sanitizeFileName(_0x4052c6)+_0x3bd2c9(0x204));!_0x3f1d3e&&_0x3e0136&&!existsSync(_0x257725)&&mkdirSync(_0x257725,{'recursive':!![]});const _0x312379=a28_0x3ba9f6[_0x3bd2c9(0x1f5)](process[_0x3bd2c9(0x1e0)](),_0x3a4ded);if(existsSync(_0x3a4ded)){const _0x212da1=readFileSync(_0x3a4ded,_0x3bd2c9(0x23e)),_0xd9b575=generateDiff(_0x212da1,_0x4545b3),_0x4cad6c=hasChanges(_0xd9b575);_0x241dcb[_0x3bd2c9(0x232)]({'relativePath':_0x312379,'absolutePath':_0x3a4ded,'content':_0x4545b3,'isNew':![],'hasChanges':_0x4cad6c,'diff':_0x4cad6c?formatDiffWithColors(_0xd9b575):undefined});}else _0x241dcb[_0x3bd2c9(0x232)]({'relativePath':_0x312379,'absolutePath':_0x3a4ded,'content':_0x4545b3,'isNew':!![],'hasChanges':![]});}const _0x10b1ca=_0x241dcb[_0x3bd2c9(0x237)](_0x174e58=>_0x174e58[_0x3bd2c9(0x197)]),_0xeaa7c2=_0x241dcb['filter'](_0x3fbce7=>!_0x3fbce7[_0x3bd2c9(0x197)]&&_0x3fbce7[_0x3bd2c9(0x24c)]),_0x5d0201=_0x241dcb['filter'](_0x46e1e5=>!_0x46e1e5[_0x3bd2c9(0x197)]&&!_0x46e1e5[_0x3bd2c9(0x24c)]),_0x598a88=_0x2c7ea5[_0x3bd2c9(0x1b9)],_0x5ef3a4=_0x526a9d['size'],_0x4d53b5=_0x598a88>_0x5ef3a4?'\x20('+_0x598a88+_0x3bd2c9(0x245):'';console['error'](_0x3bd2c9(0x1fb)),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x5ef3a4+'\x20journeys')+a28_0x35ee26['dim'](_0x4d53b5)),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26['green']('+\x20'+_0x10b1ca[_0x3bd2c9(0x1b9)]+'\x20new\x20files')),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26['yellow']('~\x20'+_0xeaa7c2[_0x3bd2c9(0x1b9)]+'\x20changed\x20files')),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26[_0x3bd2c9(0x258)]('=\x20'+_0x5d0201[_0x3bd2c9(0x1b9)]+_0x3bd2c9(0x19f))),console['error'](_0x3bd2c9(0x23f)+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x1d8755)+'\x0a');if(_0xeaa7c2[_0x3bd2c9(0x1b9)]>0x0)for(const _0x16143b of _0xeaa7c2){console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1e1)+_0x16143b['relativePath']+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x3bd2c9(0x15a)](_0x16143b[_0x3bd2c9(0x1d2)]),console[_0x3bd2c9(0x15a)]('─'[_0x3bd2c9(0x21c)](0x3c));}if(_0x41bf22[_0x3bd2c9(0x1b8)])return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x187)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x10b1ca['length']===0x0&&_0xeaa7c2[_0x3bd2c9(0x1b9)]===0x0)return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x169)](_0x3bd2c9(0x234))),saveSessionContext({'parent_segment':_0x2cc5be},_0x41bf22[_0x3bd2c9(0x188)]),console[_0x3bd2c9(0x15a)](a28_0x35ee26['green'](_0x3bd2c9(0x213)+a28_0x35ee26[_0x3bd2c9(0x258)](_0x3bd2c9(0x1c6))+'\x20=\x20'+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x2cc5be))),0x0;if(!_0x41bf22[_0x3bd2c9(0x1ed)]&&(_0x10b1ca[_0x3bd2c9(0x1b9)]>0x0||_0xeaa7c2[_0x3bd2c9(0x1b9)]>0x0)){if(!isInteractive())return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x210)](_0x3bd2c9(0x212)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x258)](_0x3bd2c9(0x167))),0x1;const _0x35a9c1=await confirmKey(_0x3bd2c9(0x181)+(_0x10b1ca[_0x3bd2c9(0x1b9)]+_0xeaa7c2['length'])+_0x3bd2c9(0x1d6));if(!_0x35a9c1)return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x187)](_0x3bd2c9(0x19a)),_0x3bd2c9(0x16a)),0x1;}!existsSync(_0x1d8755)&&mkdirSync(_0x1d8755,{'recursive':!![]});const _0x285b80=a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x1d8755,_0x3bd2c9(0x1f8));writeFileSync(_0x285b80,createTdxConfigContent(_0x2cc5be),_0x3bd2c9(0x23e));for(const _0x564a72 of _0x241dcb){(_0x564a72[_0x3bd2c9(0x197)]||_0x564a72[_0x3bd2c9(0x24c)])&&writeFileSync(_0x564a72[_0x3bd2c9(0x1c1)],_0x564a72[_0x3bd2c9(0x225)],'utf-8');}return console[_0x3bd2c9(0x15a)](a28_0x35ee26['green'](_0x3bd2c9(0x18e)+(_0x10b1ca['length']+_0xeaa7c2['length'])+_0x3bd2c9(0x247)+_0x1d8755)),saveSessionContext({'parent_segment':_0x2cc5be},_0x41bf22['session']),console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x169)]('✔\x20Context\x20set:\x20'+a28_0x35ee26[_0x3bd2c9(0x258)](_0x3bd2c9(0x1c6))+_0x3bd2c9(0x1a5)+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x2cc5be))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:columns';['description']=a28_0x35a506(0x174);async[a28_0x35a506(0x22a)](_0x3cfd6b){const _0x424f31=a28_0x35a506,{options:_0x408df7,args:_0xbb0513,tdx:_0x5b4bce}=_0x3cfd6b,_0x397849=_0xbb0513[0x0];if(!requireNameOrPath(_0x397849))return 0x1;_0x408df7[_0x424f31(0x19e)]&&console[_0x424f31(0x15a)](_0x424f31(0x24a)+_0x397849);const {journeyId:_0x2f9c4d}=await resolveJourneyIdFromInput(_0x397849,_0x408df7,_0x5b4bce),_0x61d48f=await withSpinner('Getting\x20column\x20mapping...',()=>_0x5b4bce['journey'][_0x424f31(0x21e)](_0x2f9c4d),{'verbose':_0x408df7[_0x424f31(0x19e)]}),_0x3bdc9b=_0x61d48f[_0x424f31(0x1ca)];return console[_0x424f31(0x22d)](_0x424f31(0x172)+_0x3bdc9b['database']),console[_0x424f31(0x22d)](_0x424f31(0x23b)+_0x3bdc9b[_0x424f31(0x1c4)]),await handleSDKOutput(_0x3bdc9b['columns'],_0x408df7),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x1f2);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x1c0);async[a28_0x35a506(0x22a)](_0x579893){const _0x4581a1=a28_0x35a506,{options:_0x3f1d39,args:_0x56a9cf,tdx:_0x491499}=_0x579893,_0x54e4cd=_0x56a9cf[0x0];if(!requireNameOrPath(_0x54e4cd))return 0x1;_0x3f1d39[_0x4581a1(0x19e)]&&console['error'](_0x4581a1(0x24a)+_0x54e4cd);const {journeyId:_0x4089ed}=await resolveJourneyIdFromInput(_0x54e4cd,_0x3f1d39,_0x491499),_0x235e1e=await withSpinner(_0x4581a1(0x25c),()=>_0x491499['journey']['listActivationsFlat'](_0x4089ed),{'verbose':_0x3f1d39[_0x4581a1(0x19e)]}),_0x36a21b=_0x235e1e[_0x4581a1(0x1ca)];return console[_0x4581a1(0x15a)]('Found\x20'+_0x36a21b[_0x4581a1(0x1b9)]+_0x4581a1(0x261)+(_0x36a21b[_0x4581a1(0x1b9)]!==0x1?'s':'')),await handleSDKOutput(_0x36a21b,_0x3f1d39),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x190);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x205);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x24e040){const _0x41f1ba=a28_0x35a506,_0x1ba4af=_0x24e040[_0x41f1ba(0x154)][0x0];let _0x190513;if(_0x1ba4af){const _0x3bed3a=await resolveTarget({'arg':_0x1ba4af,'contextParent':_0x24e040[_0x41f1ba(0x19d)][_0x41f1ba(0x25a)],'cwd':process[_0x41f1ba(0x1e0)]()});isSuccessfulResolution(_0x3bed3a)&&_0x3bed3a[_0x41f1ba(0x1d0)]===_0x41f1ba(0x25d)&&(_0x190513=_0x3bed3a['filePath']);}const _0x387fc9={..._0x24e040,'options':{..._0x24e040[_0x41f1ba(0x19d)],'journeysOnly':!![],..._0x190513&&{'singleFilePath':_0x190513}}};return this[_0x41f1ba(0x17b)]['execute'](_0x387fc9);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x1ad);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x1e5);async['execute'](_0x343fb3){const _0x25e3ce=a28_0x35a506,{options:_0x38f912,args:_0x17af6e,tdx:_0x272103}=_0x343fb3,_0x42413a=_0x17af6e[0x0];if(!requireNameOrPath(_0x42413a))return 0x1;if(_0x38f912[_0x25e3ce(0x19e)])console[_0x25e3ce(0x15a)](_0x25e3ce(0x24a)+_0x42413a);const {journeyId:_0x1890d0}=await resolveJourneyIdFromInput(_0x42413a,_0x38f912,_0x272103),_0x16db31=await withSpinner('Listing\x20journey\x20versions...',()=>_0x272103[_0x25e3ce(0x1f3)]['listVersions'](_0x1890d0),{'verbose':_0x38f912[_0x25e3ce(0x19e)]}),{bundleName:_0x551207,versions:_0x147168,latestJourneyId:_0x53558d}=_0x16db31[_0x25e3ce(0x1ca)];console[_0x25e3ce(0x15a)](_0x551207+':\x20'+_0x147168[_0x25e3ce(0x1b9)]+_0x25e3ce(0x1e7)+(_0x147168[_0x25e3ce(0x1b9)]!==0x1?'s':''));const _0x458794=_0x147168['map'](_0x4d5704=>({'version':_0x4d5704[_0x25e3ce(0x173)],'journey_id':_0x4d5704[_0x25e3ce(0x177)],'name':_0x4d5704['name'],'state':_0x4d5704[_0x25e3ce(0x22f)],'paused':_0x4d5704[_0x25e3ce(0x18c)],'latest':_0x4d5704[_0x25e3ce(0x177)]===_0x53558d,'created_at':_0x4d5704['createdAt']}));return await handleSDKOutput(_0x458794,_0x38f912),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x1ef);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a28_0x35a506(0x22a)](_0x4cdbb8){const _0x39209e=a28_0x35a506,{options:_0x436d74,args:_0x2374a0,tdx:_0x123bec}=_0x4cdbb8,_0x220d76=_0x2374a0[0x0];if(!requireNameOrPath(_0x220d76))return 0x1;if(_0x436d74['verbose'])console['error']('Input:\x20'+_0x220d76);const {journeyId:_0x5ea91b,journeyName:_0x897b22}=await resolveJourneyIdFromInput(_0x220d76,_0x436d74,_0x123bec);if(!_0x436d74[_0x39209e(0x1ed)]){const _0x24c7eb=await confirm(_0x39209e(0x157)+_0x897b22+'\x22?');if(!_0x24c7eb)return console[_0x39209e(0x15a)](_0x39209e(0x20c)),0x0;}const _0x368a2d=await withSpinner(_0x39209e(0x1d9),()=>_0x123bec[_0x39209e(0x1f3)]['createVersion'](_0x5ea91b),{'verbose':_0x436d74['verbose']}),_0x1dd375=_0x368a2d[_0x39209e(0x1ca)];return console[_0x39209e(0x15a)](a28_0x35ee26[_0x39209e(0x169)]('✔')+_0x39209e(0x18a)+_0x1dd375['attributes'][_0x39209e(0x173)]+_0x39209e(0x16c)+_0x1dd375[_0x39209e(0x20d)][_0x39209e(0x18f)]+'\x22'),console[_0x39209e(0x15a)](_0x39209e(0x211)+_0x1dd375['id']),await handleSingleObjectOutput({'id':_0x1dd375['id'],'name':_0x1dd375[_0x39209e(0x20d)]['name'],'version':_0x1dd375[_0x39209e(0x20d)][_0x39209e(0x173)],'state':_0x1dd375[_0x39209e(0x20d)][_0x39209e(0x22f)],'bundle_id':_0x1dd375['attributes'][_0x39209e(0x226)],'created_at':_0x1dd375[_0x39209e(0x20d)]['createdAt']},_0x436d74),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x221);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x176);async[a28_0x35a506(0x22a)](_0x1ccd7f){const _0x42868a=a28_0x35a506,{options:_0x16695a,args:_0x187444,tdx:_0x1e0bf7}=_0x1ccd7f,_0x274554=_0x187444[0x0];if(!requireNameOrPath(_0x274554))return 0x1;const _0x3d0183=_0x16695a['version'];if(!_0x3d0183)return console[_0x42868a(0x15a)](_0x42868a(0x18b)),console[_0x42868a(0x15a)](_0x42868a(0x228)),0x1;const _0x1e0283=parseInt(_0x3d0183,0xa);if(isNaN(_0x1e0283)||_0x1e0283<0x1)return console[_0x42868a(0x15a)](_0x42868a(0x21f)+_0x3d0183),0x1;if(_0x16695a['verbose'])console[_0x42868a(0x15a)](_0x42868a(0x24a)+_0x274554+_0x42868a(0x1a0)+_0x1e0283);const {journeyId:_0x29bd77,parentSegmentId:_0x3198f2}=await resolveJourneyIdFromInput(_0x274554,_0x16695a,_0x1e0bf7),_0x508eec=await withSpinner(_0x42868a(0x1c3),()=>_0x1e0bf7['journey'][_0x42868a(0x238)](_0x29bd77),{'verbose':_0x16695a[_0x42868a(0x19e)]}),{versions:_0x38cede,latestJourneyId:_0xb276e1}=_0x508eec[_0x42868a(0x1ca)],_0x53b6d9=_0x38cede[_0x42868a(0x1ff)](_0x675b14=>_0x675b14[_0x42868a(0x173)]===_0x1e0283);if(!_0x53b6d9){const _0x19c59e=_0x38cede[_0x42868a(0x253)](_0x586b1b=>'v'+_0x586b1b['versionNumber'])[_0x42868a(0x1eb)](',\x20');return console[_0x42868a(0x15a)](_0x42868a(0x1f0)+_0x1e0283+_0x42868a(0x256)+_0x19c59e),0x1;}const _0x1814c6=await withSpinner(_0x42868a(0x1bf)+_0x1e0283+'\x20details...',()=>_0x1e0bf7[_0x42868a(0x1f3)]['getJourney'](_0x53b6d9[_0x42868a(0x177)]),{'verbose':_0x16695a[_0x42868a(0x19e)]}),_0x31c203=_0x1814c6[_0x42868a(0x1ca)],_0xff3a6d=getConsoleNextUrl(_0x16695a[_0x42868a(0x216)],_0x42868a(0x195)+_0x3198f2+_0x42868a(0x168)+_0x53b6d9[_0x42868a(0x177)]+_0x42868a(0x161));return await handleSingleObjectOutput({'id':_0x31c203['id'],'name':_0x31c203[_0x42868a(0x20d)]['name'],'version':_0x31c203[_0x42868a(0x20d)]['versionNumber'],'description':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x1a4)],'state':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x22f)],'paused':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x18c)],'reentry_mode':_0x31c203['attributes'][_0x42868a(0x231)],'stages':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x260)]?.['length']||0x0,..._0x31c203[_0x42868a(0x20d)][_0x42868a(0x1ba)]&&{'goal':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x1ba)][_0x42868a(0x18f)]},'latest':_0x53b6d9[_0x42868a(0x177)]===_0xb276e1,'created_at':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x1d5)],'updated_at':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x218)],'url':_0xff3a6d},_0x16695a),0x0;}}
1
+ const a28_0x41d493=a28_0x3602;(function(_0x530381,_0x49cf0d){const _0x3abcb2=a28_0x3602,_0x3f15e9=_0x530381();while(!![]){try{const _0x30b307=-parseInt(_0x3abcb2(0x13f))/0x1+parseInt(_0x3abcb2(0x15d))/0x2+-parseInt(_0x3abcb2(0x175))/0x3+parseInt(_0x3abcb2(0x170))/0x4*(parseInt(_0x3abcb2(0x152))/0x5)+parseInt(_0x3abcb2(0x147))/0x6+parseInt(_0x3abcb2(0x125))/0x7*(parseInt(_0x3abcb2(0x185))/0x8)+-parseInt(_0x3abcb2(0x14d))/0x9;if(_0x30b307===_0x49cf0d)break;else _0x3f15e9['push'](_0x3f15e9['shift']());}catch(_0x21b21c){_0x3f15e9['push'](_0x3f15e9['shift']());}}}(a28_0x19be,0x4a984));import a28_0x458e20 from'chalk';import a28_0x3d093a 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';function a28_0x3602(_0x4daaac,_0x591cf7){_0x4daaac=_0x4daaac-0xbd;const _0x19be5c=a28_0x19be();let _0x36024a=_0x19be5c[_0x4daaac];return _0x36024a;}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(_0x2bbd45){const _0x5afb22=a28_0x3602;return!_0x2bbd45&&(console[_0x5afb22(0x16c)](_0x5afb22(0x1c3)),console[_0x5afb22(0x16c)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x2bbd45;}function withJsonFormat(_0x2e0631){const _0x4e5317=a28_0x3602;if(!_0x2e0631[_0x4e5317(0x10f)]&&!_0x2e0631['json']&&!_0x2e0631[_0x4e5317(0x1c6)]&&!_0x2e0631[_0x4e5317(0x14c)])return{..._0x2e0631,'format':'json','json':!![]};return _0x2e0631;}function formatJourneyState(_0x45ab39){const _0x506019=a28_0x3602;switch(_0x45ab39){case _0x506019(0xe6):return a28_0x458e20[_0x506019(0x1ac)]('(running)');case'draft':return a28_0x458e20[_0x506019(0x1c4)](_0x506019(0xeb));case _0x506019(0xe2):return a28_0x458e20[_0x506019(0xf0)](_0x506019(0x186));case _0x506019(0x1c2):return a28_0x458e20[_0x506019(0x119)]('(completed)');case _0x506019(0x153):return a28_0x458e20[_0x506019(0x1c4)](_0x506019(0x183));default:return'('+_0x45ab39+')';}}function formatJourneyItem(_0x3f3567,_0x4d6756='',_0xa054){const _0x35edb5=a28_0x3602,_0x13c8ca=formatJourneyState(_0x3f3567[_0x35edb5(0x133)]),_0x4a0c8e=_0xa054?hyperlink(_0x3f3567[_0x35edb5(0x197)],_0xa054):_0x3f3567[_0x35edb5(0x197)];return _0x4d6756+_0x35edb5(0x13d)+_0x4a0c8e+'\x20'+_0x13c8ca;}function escapeRegex(_0x20f17d){const _0x5687de=a28_0x3602;return _0x20f17d[_0x5687de(0xda)](/[.*+?^${}()|[\]\\]/g,_0x5687de(0x17b));}function globToRegex(_0x2c6a54){const _0x4ace8f=a28_0x3602,_0x59c00a=_0x2c6a54[_0x4ace8f(0x10a)]('*')[_0x4ace8f(0x143)](escapeRegex);return new RegExp(_0x59c00a[_0x4ace8f(0x1a8)]('.*'),'i');}function buildRuleToNameMapping(_0x5c40b3){const _0x82ede=a28_0x3602,_0x1dd2f9=new Map();if(_0x5c40b3[_0x82ede(0x150)])for(const [_0x396902,_0x3dbc26]of Object['entries'](_0x5c40b3[_0x82ede(0x150)])){if(_0x3dbc26[_0x82ede(0x1ba)]){const _0x1e6b74=serializeRule(_0x3dbc26[_0x82ede(0x1ba)]),_0x1a868e=_0x1dd2f9[_0x82ede(0x174)](_0x1e6b74);_0x1a868e?_0x1a868e[_0x82ede(0xde)](_0x396902):_0x1dd2f9['set'](_0x1e6b74,[_0x396902]);}}return _0x1dd2f9;}async function resolveJourneyIdFromInput(_0x2c36e5,_0x5e6367,_0x368fc4){const _0x40614e=a28_0x3602,_0x3b9ddc=await resolveJourneyTarget(_0x2c36e5,_0x5e6367[_0x40614e(0x182)],_0x5e6367[_0x40614e(0x181)]),_0x5db834=_0x3b9ddc[_0x40614e(0x182)];if(!_0x5db834)throw new SDKError(ErrorCode[_0x40614e(0x16f)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x1d45ef=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x368fc4[_0x40614e(0x18d)][_0x40614e(0x178)](_0x5db834),{'verbose':_0x5e6367[_0x40614e(0x181)]}),_0x162313=_0x1d45ef[_0x40614e(0x11f)],_0x1d29c8=await withSpinner('Resolving\x20journey...',()=>_0x368fc4[_0x40614e(0x14b)]['resolveJourneyId'](_0x162313,_0x3b9ddc[_0x40614e(0x140)]),{'verbose':_0x5e6367['verbose']});return{'journeyId':_0x1d29c8[_0x40614e(0x11f)],'journeyName':_0x3b9ddc[_0x40614e(0x140)],'parentSegmentId':_0x162313};}function a28_0x19be(){const _0x75cf5a=['journey:push','split','options','entries','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Parent\x20segment:\x20','format','args','folderPath','Fetching\x20','cwd','conversion','Getting\x20journey\x20traffic\x20data...','parentName','Database:\x20','\x22\x20paused','blue','\x20not\x20found.\x20Available:\x20','Show\x20journey\x20table\x20column\x20mapping','folderId','Resolved\x20YAML\x20file:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','data','✔\x20Found\x20','Export\x20journey(s)\x20as\x20YAML\x20files','\x20(rule\x20match)','log','helpText','1061767BLdfbK','repeat','yes','dryRun','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','includeStats','getParentFull','Error:\x20Stage\x20\x22','createdAt','✔\x20Pulled\x20','Error:\x20Journey\x20not\x20found:\x20','Getting\x20journey\x20statistics...','-\x20no\x20files\x20written','pause','state','listJourneysWithFolders','Write\x20','Listing\x20journey\x20versions...','hasChanges','\x20unchanged\x20files','journeyId','Resume\x20a\x20paused\x20journey','\x20->\x20','stage','🗺️\x20','attributes','528918YVArOa','journeyName','name','content','map','test','renderStats','exitOrJumpSize','3066762cVqRXg','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Getting\x20journey\x20details...','\x20(draft)\x20—\x20\x22','journey','tsv','6213033nRFSgw','\x20details...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','segments','no_parent','499145hsaPsZ','archived','/e/','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Folder\x20path:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','getJourney','\x20=\x20','toLowerCase','connector_config','Pause\x20a\x20running\x20journey','454806nhgJXR','add','exitOrJumpRate','journey:traffic','/j/da/je','\x20journeys','segmentName','cyan','columns','\x22\x20resumed','goalSize','getLatestJourneyId','getStatistics','Getting\x20version\x20','database','error','diff','journey:resume','INVALID_ARGUMENT','20DlFEXa','Options:','activation','Error:\x20Invalid\x20--type\x20\x22','get','958812eJiQLh','set','relative','resolveParentId','journeyBundleId','\x0aChanges\x20to\x20\x27','\x5c$&','Fetching\x20users\x20and\x20connections...','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','folders','audienceId','✔\x20Context\x20set:\x20','verbose','parentSegment','(archived)','web','32KPhvLx','(paused)','\x20Opening\x20','Folder\x20path:\x20','\x20\x20-\x20','user','journey:list','connection','segment','includeHistory','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','red','List\x20journeys\x20in\x20current\x20context','json','has','errorCode','Show\x20journey\x20details','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyBundleName','/app/ps/','getTrafficData','history','filter','journeys','isNew','\x20versions)','parent_segment','from','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','.yml','Table:\x20','journeyStages','targetDir','List\x20all\x20versions\x20of\x20a\x20journey','Error:\x20Version\x20','join','journey:activations','table','resolveSegment','green','segmentPushCommand','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Cancelled','sort','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Pattern:\x20','rootFolderId','stages','milestoneSize','buildIdToEmailMap','rule','Journey\x20name:\x20','Input:\x20','✔\x20Journey\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','List\x20activations\x20for\x20a\x20journey','find','getActivation','completed','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','dim','Resolving\x20version...','jsonl','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','versionNumber','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','site','reentryMode','\x0aPull\x20summary:','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','file','utf-8','getSegment','journey:pause','Fetching\x20journeys\x20and\x20folders...','Parent\x20segment:\x20','\x20\x20Journey\x20ID:\x20','activationParams','all','\x20activation','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','session','/j/da','Aborted.','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','completeMilestoneRate','description','completionRate','\x20journey\x20files\x20to\x20','stringify','size','replace','Listing\x20journey\x20activations...','buildIdToNameMap','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','push','listVersions','Resolving\x20parent\x20segment...','\x27\x20not\x20found\x20in\x20','paused','Resuming\x20journey...','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','localeCompare','launched','(root)','stageNameMap','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x20\x20Name:\x20','(draft)','Target\x20directory:\x20','message','Show\x20journey\x20statistics','Found\x20','yellow','\x20\x20Statistics\x20not\x20available','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journey:pull','length','execute','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Creating\x20new\x20version...','then','updatedAt','\x20files?','filePath','Getting\x20column\x20mapping...','limit','\x20(ID:\x20','journey:view','listFolders','base','type','goal','resourceName','journey:versions','resume',',\x20version:\x20','Available\x20stages:\x20'];a28_0x19be=function(){return _0x75cf5a;};return a28_0x19be();}async function resolveJourneyTarget(_0x4722c1,_0x4370e1,_0x13efef){const _0x38392e=a28_0x3602;if(isYamlFilePath(_0x4722c1))try{const _0x2beea0=await resolveYamlFilePath(_0x4722c1);return _0x13efef&&(console[_0x38392e(0x16c)](_0x38392e(0x11d)+_0x4722c1),console[_0x38392e(0x16c)](_0x38392e(0x10e)+_0x2beea0[_0x38392e(0x182)]),console[_0x38392e(0x16c)](_0x38392e(0xea)+_0x2beea0['segmentName']),console[_0x38392e(0x16c)](_0x38392e(0x156)+(_0x2beea0[_0x38392e(0x111)]||_0x38392e(0xe7)))),{'journeyName':_0x2beea0[_0x38392e(0x163)],'parentSegment':_0x2beea0[_0x38392e(0x182)],'resolved':_0x2beea0};}catch(_0x299707){throw new SDKError(ErrorCode[_0x38392e(0x16f)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x299707[_0x38392e(0xed)]);}if(!_0x4370e1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x38392e(0x10d));return{'journeyName':_0x4722c1,'parentSegment':_0x4370e1};}export class JourneyListCommand extends BaseCommand{['name']=a28_0x41d493(0x18b);[a28_0x41d493(0xd5)]=a28_0x41d493(0x191);async[a28_0x41d493(0xf5)](_0x379983){const _0xaa3a2c=a28_0x41d493,{options:_0x5e92e1,args:_0x1afd77,tdx:_0x955a12}=_0x379983,_0x2ecf99=_0x1afd77[0x0],_0x16e87a=_0x5e92e1[_0xaa3a2c(0x182)];if(!_0x16e87a)return console[_0xaa3a2c(0x16c)]('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0xaa3a2c(0x1b0)),0x1;const _0xab2517=await withSpinner(_0xaa3a2c(0xe0),()=>_0x955a12['segment']['resolveParentId'](_0x16e87a),{'verbose':_0x5e92e1['verbose']}),_0x38508b=_0xab2517['data'];_0x5e92e1[_0xaa3a2c(0x181)]&&(console[_0xaa3a2c(0x16c)](_0xaa3a2c(0xca)+_0x16e87a+_0xaa3a2c(0xfe)+_0x38508b+')'),_0x2ecf99&&console[_0xaa3a2c(0x16c)](_0xaa3a2c(0x1b5)+_0x2ecf99));const _0x25cdff=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x955a12['segment'][_0xaa3a2c(0x12b)](_0x38508b),{'verbose':_0x5e92e1[_0xaa3a2c(0x181)]}),_0x2b460c=_0x25cdff[_0xaa3a2c(0x11f)],_0x28b4ae=_0x2b460c[_0xaa3a2c(0x1b6)],_0x1172bc=await withSpinner('Listing\x20journeys...',()=>_0x955a12[_0xaa3a2c(0x14b)][_0xaa3a2c(0x134)](_0x38508b,_0x28b4ae),{'verbose':_0x5e92e1['verbose']});let _0x1eb2eb=_0x1172bc['data'][_0xaa3a2c(0x19c)];const _0x4e8b8b=_0x1172bc[_0xaa3a2c(0x11f)][_0xaa3a2c(0x17e)],_0x464544=new Map();for(const _0x5b765c of _0x4e8b8b){_0x464544[_0xaa3a2c(0x176)](_0x5b765c['id'],_0x5b765c[_0xaa3a2c(0x141)]);}if(_0x2ecf99){const _0xc42e09=globToRegex(_0x2ecf99);_0x1eb2eb=_0x1eb2eb[_0xaa3a2c(0x19b)](_0x51a549=>_0xc42e09[_0xaa3a2c(0x144)](_0x51a549['journeyBundleName']));}console[_0xaa3a2c(0x16c)](_0xaa3a2c(0x120)+_0x1eb2eb[_0xaa3a2c(0xf4)]+'\x20journey'+(_0x1eb2eb['length']!==0x1?'s':''));const _0x2df40a=_0x51cb24=>{const _0x574dc6=_0xaa3a2c;return getConsoleNextUrl(_0x5e92e1[_0x574dc6(0xc0)],_0x574dc6(0x198)+_0x38508b+_0x574dc6(0x154)+_0x51cb24+_0x574dc6(0xd1));};if(_0x5e92e1[_0xaa3a2c(0x10f)]===_0xaa3a2c(0x1aa))await handleSDKOutput(_0x1eb2eb,_0x5e92e1);else{if(_0x5e92e1[_0xaa3a2c(0x10f)]===_0xaa3a2c(0x192)){const _0x438c2b=_0x1eb2eb[_0xaa3a2c(0x143)](_0xb59d45=>({..._0xb59d45,'url':_0x2df40a(_0xb59d45['id'])}));await handleSDKOutput(_0x438c2b,_0x5e92e1);}else{console['log']('['+_0x16e87a+']');const _0x4060e8=new Map(),_0x57c603=[];for(const _0x5546e6 of _0x1eb2eb){if(!_0x5546e6[_0xaa3a2c(0x11c)]||_0x5546e6[_0xaa3a2c(0x11c)]===_0x28b4ae)_0x57c603['push'](_0x5546e6);else{const _0x5f15db=_0x4060e8[_0xaa3a2c(0x174)](_0x5546e6[_0xaa3a2c(0x11c)])||[];_0x5f15db[_0xaa3a2c(0xde)](_0x5546e6),_0x4060e8[_0xaa3a2c(0x176)](_0x5546e6[_0xaa3a2c(0x11c)],_0x5f15db);}}const _0x56d13a=(_0x34e55f,_0x3aa8a1)=>_0x34e55f['journeyBundleName'][_0xaa3a2c(0xe5)](_0x3aa8a1['journeyBundleName'],undefined,{'sensitivity':'base'});_0x57c603[_0xaa3a2c(0x1b2)](_0x56d13a);for(const _0x14e93f of _0x57c603){console['log'](formatJourneyItem(_0x14e93f,'',_0x2df40a(_0x14e93f['id'])));}const _0x168816=[..._0x4060e8[_0xaa3a2c(0x10c)]()][_0xaa3a2c(0x1b2)]((_0x5e046f,_0x45643c)=>{const _0x4374f6=_0xaa3a2c,_0x24f13e=_0x464544[_0x4374f6(0x174)](_0x5e046f[0x0])||_0x5e046f[0x0],_0x258ee3=_0x464544[_0x4374f6(0x174)](_0x45643c[0x0])||_0x45643c[0x0];return _0x24f13e[_0x4374f6(0xe5)](_0x258ee3,undefined,{'sensitivity':_0x4374f6(0x101)});});for(const [_0x102acd,_0x1b78b4]of _0x168816){const _0x53127c=_0x464544[_0xaa3a2c(0x174)](_0x102acd)||_0x102acd;console[_0xaa3a2c(0x123)]('📁\x20'+_0x53127c),_0x1b78b4[_0xaa3a2c(0x1b2)](_0x56d13a);for(const _0x4ae567 of _0x1b78b4){console[_0xaa3a2c(0x123)](formatJourneyItem(_0x4ae567,'\x20\x20',_0x2df40a(_0x4ae567['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a28_0x41d493(0xff);[a28_0x41d493(0xd5)]=a28_0x41d493(0x195);async[a28_0x41d493(0xf5)](_0x154cd5){const _0x58f0a6=a28_0x41d493,{options:_0x4802ef,args:_0x397af4,tdx:_0x4cc4ca}=_0x154cd5,_0x34533a=_0x397af4[0x0];if(!_0x34533a)return console[_0x58f0a6(0x16c)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x58f0a6(0x16c)](_0x58f0a6(0x17d)),console[_0x58f0a6(0x16c)](_0x58f0a6(0x171)),console[_0x58f0a6(0x16c)](_0x58f0a6(0xc4)),0x1;_0x4802ef[_0x58f0a6(0x181)]&&console['error'](_0x58f0a6(0x1bc)+_0x34533a);const {journeyId:_0x506ad2,parentSegmentId:_0x391b55}=await resolveJourneyIdFromInput(_0x34533a,_0x4802ef,_0x4cc4ca);if(_0x4802ef[_0x58f0a6(0x184)]){const _0x4fdc7d=getConsoleNextUrl(_0x4802ef[_0x58f0a6(0xc0)],_0x58f0a6(0x198)+_0x391b55+'/e/'+_0x506ad2+'/j/da/je');return console[_0x58f0a6(0x16c)](a28_0x458e20[_0x58f0a6(0x1ac)]('✔')+_0x58f0a6(0x187)+a28_0x458e20[_0x58f0a6(0x164)](_0x4fdc7d)),openBrowser(_0x4fdc7d),0x0;}const _0x1094ed=await withSpinner(_0x58f0a6(0x149),()=>_0x4cc4ca[_0x58f0a6(0x14b)]['getJourney'](_0x506ad2),{'verbose':_0x4802ef['verbose']}),_0x1869ca=_0x1094ed['data'],_0x50cfd1=_0x4802ef[_0x58f0a6(0x12a)];let _0x59b6fb;if(_0x50cfd1)try{const _0x2bad7a=await withSpinner(_0x58f0a6(0x130),()=>_0x4cc4ca[_0x58f0a6(0x14b)][_0x58f0a6(0x169)](_0x506ad2),{'verbose':_0x4802ef['verbose']});_0x59b6fb=_0x2bad7a[_0x58f0a6(0x11f)];}catch{_0x4802ef[_0x58f0a6(0x181)]&&console[_0x58f0a6(0x16c)](_0x58f0a6(0xf1));}const _0x38f678=getConsoleNextUrl(_0x4802ef[_0x58f0a6(0xc0)],_0x58f0a6(0x198)+_0x391b55+_0x58f0a6(0x154)+_0x506ad2+'/j/da/je'),_0x462193={'id':_0x1869ca['id'],'name':_0x1869ca['attributes'][_0x58f0a6(0x141)],'description':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0xd5)],'state':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x133)],'paused':_0x1869ca[_0x58f0a6(0x13e)]['paused'],'reentry_mode':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0xc1)],'stages':_0x1869ca[_0x58f0a6(0x13e)]['journeyStages']?.[_0x58f0a6(0xf4)]||0x0,..._0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x103)]&&{'goal':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x103)]['name']},..._0x59b6fb&&{'statistics':{'size':_0x59b6fb[_0x58f0a6(0xd9)],'entered':_0x59b6fb['enteredSize'],'goal_achieved':_0x59b6fb[_0x58f0a6(0x167)],'completion_rate':_0x59b6fb[_0x58f0a6(0xd6)],'exit_or_jump':_0x59b6fb[_0x58f0a6(0x146)],'exit_or_jump_rate':_0x59b6fb[_0x58f0a6(0x15f)],'stages':_0x59b6fb[_0x58f0a6(0x1b7)]}},'url':_0x38f678};return await handleSingleObjectOutput(_0x462193,_0x4802ef),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:stats';['description']=a28_0x41d493(0xee);async['execute'](_0x2bcad1){const _0x24fcee=a28_0x41d493,{options:_0x141ae2,args:_0x39dc09,tdx:_0x445b74}=_0x2bcad1,_0x20d026=_0x39dc09[0x0];if(!requireNameOrPath(_0x20d026))return 0x1;_0x141ae2[_0x24fcee(0x181)]&&console[_0x24fcee(0x16c)](_0x24fcee(0x1bc)+_0x20d026);const _0x46ccff=_0x141ae2,_0x2df45b=_0x46ccff[_0x24fcee(0x1a0)],_0x22dd50=_0x46ccff['to'],_0x31b735=_0x46ccff[_0x24fcee(0x18e)],_0x140ffb=_0x46ccff[_0x24fcee(0x13c)];_0x31b735&&!_0x2df45b&&!_0x22dd50&&console['error'](_0x24fcee(0x1b4));const _0x5a9f30=_0x31b735?withJsonFormat(_0x141ae2):_0x141ae2,{journeyId:_0x3153eb,journeyName:_0x17bcf9}=await resolveJourneyIdFromInput(_0x20d026,_0x5a9f30,_0x445b74),_0x4d208d=_0x2df45b||_0x22dd50?{'from':_0x2df45b,'to':_0x22dd50}:undefined,_0x57b9e3=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x24fcee(0xcd)]([_0x445b74[_0x24fcee(0x14b)][_0x24fcee(0x158)](_0x3153eb),_0x445b74['journey']['getStatistics'](_0x3153eb,_0x4d208d)]),{'verbose':_0x5a9f30[_0x24fcee(0x181)]}),[_0x1d7bb2,_0x58541a]=_0x57b9e3[_0x24fcee(0x11f)];if(!_0x58541a||_0x58541a[_0x24fcee(0x139)]===null)return console[_0x24fcee(0x16c)](_0x24fcee(0xc3)+_0x17bcf9),console[_0x24fcee(0x16c)](_0x24fcee(0x196)),0x0;const _0x543472=buildStageNameMap(_0x1d7bb2),_0x5041e1=!!(_0x4d208d&&_0x58541a[_0x24fcee(0x19a)]?.[_0x24fcee(0xf4)]),_0x2ebc47={'stageNameMap':_0x543472,'hasPeriod':_0x5041e1,'includeHistory':!!_0x31b735};if(_0x140ffb&&_0x58541a[_0x24fcee(0x1b7)]){const _0x167cb6=_0x58541a[_0x24fcee(0x1b7)][_0x24fcee(0x1c0)](_0xbc47e1=>{const _0x5b9ba1=_0x24fcee,_0x44ed7f=_0x543472[_0x5b9ba1(0x174)](_0xbc47e1['id'])??'';return _0x44ed7f['toLowerCase']()===_0x140ffb[_0x5b9ba1(0x15a)]();});if(_0x167cb6)return await handleSingleObjectOutput(formatStageStats(_0x167cb6,_0x2ebc47),_0x5a9f30),0x0;const _0x2c3d9c=_0x58541a[_0x24fcee(0x1b7)][_0x24fcee(0x143)](_0x542783=>_0x543472['get'](_0x542783['id'])??_0x542783['id']);return console[_0x24fcee(0x16c)](_0x24fcee(0x12c)+_0x140ffb+'\x22\x20not\x20found'),console[_0x24fcee(0x16c)](_0x24fcee(0x108)+_0x2c3d9c[_0x24fcee(0x1a8)](',\x20')),0x1;}const _0x40056a=_0x58541a[_0x24fcee(0x1b7)]?.[_0x24fcee(0x143)](_0x2fdb67=>formatStageStats(_0x2fdb67,_0x2ebc47)),_0x2b4d2e=assembleJourneyStats(_0x58541a,{'from':_0x2df45b,'to':_0x22dd50,'includeHistory':_0x31b735});return await this[_0x24fcee(0x145)](_0x2b4d2e,_0x40056a??[],_0x5a9f30),0x0;}async[a28_0x41d493(0x145)](_0x2562e2,_0xa3b678,_0x125940){const _0x49f757=a28_0x41d493,_0x1eec51=_0x125940[_0x49f757(0x10f)]===_0x49f757(0x192)||_0x125940['format']===_0x49f757(0x1c6)||_0x125940[_0x49f757(0x192)]||_0x125940[_0x49f757(0x1c6)];if(_0x1eec51){_0x2562e2[_0x49f757(0x1b7)]=_0xa3b678,await handleSingleObjectOutput(_0x2562e2,_0x125940);return;}await handleSingleObjectOutput(_0x2562e2,_0x125940);for(const _0x497f91 of _0xa3b678){console[_0x49f757(0x123)](''),console[_0x49f757(0x123)](String(a28_0x458e20['cyan']['bold']('['+_0x497f91[_0x49f757(0x141)]+']'))+a28_0x458e20[_0x49f757(0x1c4)]('\x20'+_0x497f91['id']));const {id:_0x47b584,name:_0x443909,..._0xeb5be}=_0x497f91;await handleSingleObjectOutput(_0xeb5be,_0x125940);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a28_0x41d493(0x160);[a28_0x41d493(0xd5)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x41d493(0xf5)](_0x377338){const _0x45756b=a28_0x41d493,{options:_0x47a022,args:_0x2c146b,tdx:_0x568e42}=_0x377338,_0x56059e=_0x2c146b[0x0];if(!requireNameOrPath(_0x56059e))return 0x1;_0x47a022['verbose']&&console['error'](_0x45756b(0x1bc)+_0x56059e);const _0x4e6791=_0x47a022,_0x168939=_0x4e6791[_0x45756b(0x102)],_0x941469=_0x4e6791['from'],_0x450cab=_0x4e6791['to'],_0x407027=_0x4e6791[_0x45756b(0xfd)];if(_0x168939&&_0x168939!==_0x45756b(0x114)&&_0x168939!==_0x45756b(0x172))return console[_0x45756b(0x16c)](_0x45756b(0x173)+_0x168939+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x4c5410=withJsonFormat(_0x47a022),{journeyId:_0x456010,journeyName:_0x1a0ed7}=await resolveJourneyIdFromInput(_0x56059e,_0x4c5410,_0x568e42),_0x35b9e1={'type':_0x168939,'from':_0x941469,'to':_0x450cab,'limit':_0x407027},_0x4bd97a=await withSpinner(_0x45756b(0x115),()=>_0x568e42['journey'][_0x45756b(0x199)](_0x456010,_0x35b9e1),{'verbose':_0x4c5410[_0x45756b(0x181)]}),_0x58458d=_0x4bd97a[_0x45756b(0x11f)],_0x1265ce=_0x58458d['conversion']&&(_0x58458d['conversion']['nodes'][_0x45756b(0xf4)]>0x0||_0x58458d[_0x45756b(0x114)]['links'][_0x45756b(0xf4)]>0x0),_0x3160ab=_0x58458d['activation']&&_0x58458d[_0x45756b(0x172)]['length']>0x0;if(!_0x1265ce&&!_0x3160ab)return console[_0x45756b(0x16c)](_0x45756b(0x1a1)+_0x1a0ed7),console[_0x45756b(0x16c)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x941469&&_0x450cab&&console[_0x45756b(0x16c)](_0x45756b(0x14f)),0x0;return await handleSingleObjectOutput(_0x58458d,_0x4c5410),0x0;}}function formatStageStats(_0x5854f8,_0x278e40){const _0x14819c=a28_0x41d493,_0x5c8ecb=_0x278e40['hasPeriod']&&_0x5854f8[_0x14819c(0x19a)]?.[_0x14819c(0xf4)]?aggregateStageHistory(_0x5854f8[_0x14819c(0x19a)]):{'size':_0x5854f8[_0x14819c(0xd9)],'entered':_0x5854f8['enteredSize'],'milestone':_0x5854f8[_0x14819c(0x1b8)],'milestone_rate':_0x5854f8[_0x14819c(0xd4)],'exit_or_jump':_0x5854f8[_0x14819c(0x146)],'exit_or_jump_rate':_0x5854f8[_0x14819c(0x15f)]},_0x5f48c1={'id':_0x5854f8['id'],'name':_0x278e40[_0x14819c(0xe8)]['get'](_0x5854f8['id'])??_0x5854f8['id'],..._0x5c8ecb};return _0x278e40['hasPeriod']&&_0x278e40[_0x14819c(0x18e)]&&_0x5854f8[_0x14819c(0x19a)]&&(_0x5f48c1[_0x14819c(0x19a)]=_0x5854f8['history']),_0x5f48c1;}export class JourneyPauseCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0xc8);[a28_0x41d493(0xd5)]=a28_0x41d493(0x15c);async[a28_0x41d493(0xf5)](_0x237674){const _0x251c4b=a28_0x41d493,{options:_0x3269e6,args:_0x422701,tdx:_0x336185}=_0x237674,_0x4c0c2c=_0x422701[0x0];if(!requireNameOrPath(_0x4c0c2c))return 0x1;_0x3269e6[_0x251c4b(0x181)]&&console[_0x251c4b(0x16c)](_0x251c4b(0x1bc)+_0x4c0c2c);const {journeyId:_0x1fc28e,journeyName:_0x3ef8f9}=await resolveJourneyIdFromInput(_0x4c0c2c,_0x3269e6,_0x336185);if(!_0x3269e6[_0x251c4b(0x127)]){const _0x1fe633=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x3ef8f9+'\x22?');if(!_0x1fe633)return console[_0x251c4b(0x16c)](_0x251c4b(0x1b1)),0x0;}const _0x36d544=await withSpinner('Pausing\x20journey...',()=>_0x336185[_0x251c4b(0x14b)][_0x251c4b(0x132)](_0x1fc28e),{'verbose':_0x3269e6[_0x251c4b(0x181)]}),_0x171e44=_0x36d544[_0x251c4b(0x11f)];return console[_0x251c4b(0x16c)](_0x251c4b(0x1bd)+_0x171e44[_0x251c4b(0x13e)][_0x251c4b(0x141)]+_0x251c4b(0x118)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0x16e);[a28_0x41d493(0xd5)]=a28_0x41d493(0x13a);async[a28_0x41d493(0xf5)](_0x3fed8f){const _0x2c3670=a28_0x41d493,{options:_0x3011bb,args:_0x2c27d1,tdx:_0x1f6242}=_0x3fed8f,_0x2ecbea=_0x2c27d1[0x0];if(!requireNameOrPath(_0x2ecbea))return 0x1;_0x3011bb[_0x2c3670(0x181)]&&console[_0x2c3670(0x16c)](_0x2c3670(0x1bc)+_0x2ecbea);const {journeyId:_0x2761ee,journeyName:_0x2f42de}=await resolveJourneyIdFromInput(_0x2ecbea,_0x3011bb,_0x1f6242);if(!_0x3011bb[_0x2c3670(0x127)]){const _0x7c8a98=await confirm(_0x2c3670(0xd3)+_0x2f42de+'\x22?');if(!_0x7c8a98)return console[_0x2c3670(0x16c)](_0x2c3670(0x1b1)),0x0;}const _0x16515b=await withSpinner(_0x2c3670(0xe3),()=>_0x1f6242[_0x2c3670(0x14b)][_0x2c3670(0x106)](_0x2761ee),{'verbose':_0x3011bb[_0x2c3670(0x181)]}),_0x44fb6e=_0x16515b[_0x2c3670(0x11f)];return console['error']('✔\x20Journey\x20\x22'+_0x44fb6e[_0x2c3670(0x13e)][_0x2c3670(0x141)]+_0x2c3670(0x166)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0xf3);[a28_0x41d493(0xd5)]=a28_0x41d493(0x121);async['execute'](_0x3e7f50){const _0x52778c=a28_0x41d493,{options:_0x48dbf6,args:_0x273310,tdx:_0x504e82}=_0x3e7f50,_0x16b26e=_0x48dbf6,_0x40c7ce=_0x273310[0x0],_0xc68356=_0x40c7ce&&isYamlFilePath(_0x40c7ce),_0x2fc671=await resolveTarget({'arg':_0xc68356?_0x40c7ce:undefined,'contextParent':_0x48dbf6['parentSegment'],'cwd':process[_0x52778c(0x113)]()});if(!isSuccessfulResolution(_0x2fc671))return _0x2fc671[_0x52778c(0x194)]===_0x52778c(0x151)?(console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0x157))),console[_0x52778c(0x16c)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x52778c(0x16c)](_0x52778c(0xcf)),console[_0x52778c(0x16c)](_0x52778c(0xdd)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a28_0x458e20[_0x52778c(0x190)](_0x52778c(0x1af)+_0x2fc671[_0x52778c(0xed)]+'\x0a')),_0x2fc671[_0x52778c(0x124)]&&console['error'](a28_0x458e20['cyan'](_0x2fc671[_0x52778c(0x124)]))),0x1;let _0x3292c8=_0xc68356?undefined:_0x40c7ce,_0x50f6f1,_0x10c46b;_0x2fc671[_0x52778c(0x102)]==='file'&&(_0x3292c8=_0x2fc671[_0x52778c(0x104)],_0x50f6f1=_0x2fc671['filePath'],_0x10c46b=_0x2fc671[_0x52778c(0x111)]);const _0xe3459=_0x2fc671[_0x52778c(0x116)],_0x58db88=_0x2fc671[_0x52778c(0x1a5)];_0x16b26e[_0x52778c(0x181)]&&(console[_0x52778c(0x16c)](_0x52778c(0xca)+_0xe3459),console[_0x52778c(0x16c)](_0x52778c(0xec)+_0x58db88),_0x3292c8&&console['error'](_0x52778c(0x1bb)+_0x3292c8),_0x50f6f1&&console[_0x52778c(0x16c)]('Target\x20file:\x20'+_0x50f6f1),_0x10c46b&&console[_0x52778c(0x16c)](_0x52778c(0x188)+_0x10c46b));const _0x522d95=await withSpinner(_0x52778c(0xe0),()=>_0x504e82['segment'][_0x52778c(0x178)](_0xe3459),{'verbose':_0x48dbf6[_0x52778c(0x181)]}),_0x593326=_0x522d95[_0x52778c(0x11f)],{journeys:_0x92004f,folders:_0x29a180}=await withSpinner(_0x52778c(0xc9),async()=>{const _0x2389bf=_0x52778c,[_0x59db14,_0x4df834]=await Promise[_0x2389bf(0xcd)]([_0x504e82[_0x2389bf(0x14b)]['listJourneysFromParentSegment'](_0x593326,undefined,{'includeAllVersions':!![]}),_0x504e82[_0x2389bf(0x18d)][_0x2389bf(0x100)](_0x593326)]);return{'journeys':_0x59db14,'folders':_0x4df834};},{'verbose':_0x48dbf6[_0x52778c(0x181)]})[_0x52778c(0xf8)](_0x4250c7=>_0x4250c7[_0x52778c(0x11f)]);let _0x24282c=_0x92004f;const _0x1fadc0=buildFolderIdToPathMap(_0x29a180);if(_0x3292c8){const _0x3be666=_0x24282c[_0x52778c(0x19b)](_0x488aa1=>_0x488aa1['journeyBundleName'][_0x52778c(0x15a)]()===_0x3292c8[_0x52778c(0x15a)]());if(_0x3be666['length']===0x0)return console[_0x52778c(0x16c)](_0x52778c(0x12f)+_0x3292c8),console[_0x52778c(0x16c)](_0x52778c(0x129)),0x1;_0x24282c=_0x3be666;}if(_0x10c46b!==undefined){const _0x2a1d53=_0x24282c['filter'](_0xd38921=>{const _0x378105=_0x52778c,_0x499b41=_0xd38921[_0x378105(0x11c)]?_0x1fadc0[_0x378105(0x174)](_0xd38921[_0x378105(0x11c)])||'':'';return _0x499b41===_0x10c46b;});if(_0x2a1d53[_0x52778c(0xf4)]===0x0&&_0x24282c[_0x52778c(0xf4)]>0x0){console[_0x52778c(0x16c)]('Error:\x20Journey\x20\x27'+_0x3292c8+_0x52778c(0xe1)+(_0x10c46b||'root\x20folder')),console[_0x52778c(0x16c)](_0x52778c(0x1ae));for(const _0x396739 of _0x24282c){const _0x3de52b=_0x396739['folderId']?_0x1fadc0['get'](_0x396739['folderId'])||'':'';console['error'](_0x52778c(0x189)+(_0x3de52b||_0x52778c(0xe7))+'/'+_0x396739['journeyBundleName']);}return 0x1;}_0x24282c=_0x2a1d53;}if(_0x24282c[_0x52778c(0xf4)]===0x0)return console[_0x52778c(0x16c)]('No\x20journeys\x20found'),0x0;const _0x5c3fd7=new Map();for(const _0x988115 of _0x24282c){const _0x202d28=_0x988115['journeyBundleId'];!_0x5c3fd7[_0x52778c(0x193)](_0x202d28)&&_0x5c3fd7[_0x52778c(0x176)](_0x202d28,[]),_0x5c3fd7[_0x52778c(0x174)](_0x202d28)[_0x52778c(0xde)](_0x988115);}for(const _0x455dba of _0x5c3fd7['values']()){_0x455dba[_0x52778c(0x1b2)]((_0x3fb0bb,_0x377307)=>(_0x3fb0bb['versionNumber']||0x0)-(_0x377307[_0x52778c(0xbe)]||0x0));}const _0xe5b61a=[],{idToEmailMap:_0x46b132,connectionIdToNameMap:_0x51092e}=await withSpinner(_0x52778c(0x17c),async()=>{const _0x4b4a56=_0x52778c,[_0xa02adc,_0x53e905]=await Promise['all']([_0x504e82[_0x4b4a56(0x18a)][_0x4b4a56(0x1b9)](),_0x504e82[_0x4b4a56(0x18c)][_0x4b4a56(0xdc)]()]);return{'idToEmailMap':_0xa02adc,'connectionIdToNameMap':_0x53e905};},{'verbose':_0x48dbf6['verbose']})[_0x52778c(0xf8)](_0x45c0b2=>_0x45c0b2[_0x52778c(0x11f)]);for(const _0x293828 of _0x5c3fd7['values']()){const _0x400de8=_0x293828[0x0][_0x52778c(0x197)],_0x5a039a=_0x293828[0x0][_0x52778c(0x11c)],_0x45fcc=_0x5a039a?_0x1fadc0[_0x52778c(0x174)](_0x5a039a)||'':'',_0x55c832=_0x45fcc?a28_0x3d093a[_0x52778c(0x1a8)](_0x58db88,_0x45fcc):_0x58db88,_0x5cde52=_0x50f6f1||a28_0x3d093a['join'](_0x55c832,sanitizeFileName(_0x400de8)+_0x52778c(0x1a2));let _0x3bd894,_0x279e63;if(existsSync(_0x5cde52))try{const _0x14196d=readFileSync(_0x5cde52,_0x52778c(0xc6)),_0x1ca8de=parseYamlString(_0x14196d);_0x279e63=_0x1ca8de,_0x3bd894=buildRuleToNameMapping(_0x1ca8de),_0x16b26e[_0x52778c(0x181)]&&_0x3bd894['size']>0x0&&console[_0x52778c(0x16c)](_0x52778c(0xef)+_0x3bd894[_0x52778c(0xd9)]+_0x52778c(0x11e)+_0x400de8);}catch(_0xbf48e5){_0x16b26e[_0x52778c(0x181)]&&console[_0x52778c(0x16c)](_0x52778c(0xbd)+_0xbf48e5[_0x52778c(0xed)]);}const _0x3b0266=[],_0x4c4637=new Set(),_0x1275b2=new Map(),_0x24f78a=new Map(),_0x29d5e5=new Set(),_0x1495c7=new Map(),_0xd9df35=new Map(),_0x4fdadd=createJumpTargetCache();await withProgressSpinner(_0x52778c(0x112)+_0x400de8+'...',async _0xd5356f=>{const _0x5043c6=_0x52778c;for(const _0x300048 of _0x293828){const _0x3b0ca1=_0x293828[_0x5043c6(0xf4)]>0x1?_0x300048[_0x5043c6(0x197)]+'\x20v'+(_0x300048[_0x5043c6(0xbe)]||0x1):_0x300048[_0x5043c6(0x197)];_0xd5356f['setPhase'](_0x5043c6(0x112)+_0x3b0ca1);const _0x59448a=await _0x504e82[_0x5043c6(0x14b)][_0x5043c6(0x158)](_0x300048['id']),_0x5a047b=_0x59448a[_0x5043c6(0x13e)]?.[_0x5043c6(0x17f)],_0x5efb33={'resolveSegment':async _0x4e7c06=>{const _0x263c40=_0x5043c6;if(!_0x5a047b)return{'name':_0x4e7c06,'isJourneyLocal':![]};const _0x316b65=_0x1275b2[_0x263c40(0x174)](_0x4e7c06);if(_0x316b65)return _0x316b65;try{const _0xcc9389=await _0x504e82[_0x263c40(0x18d)][_0x263c40(0xc7)](_0x5a047b,_0x4e7c06),_0x31977e=_0xcc9389['kind']===SEGMENT_KIND_JOURNEY;let _0x2c08ba,_0x56704b=_0xcc9389[_0x263c40(0x141)];if(_0x31977e&&_0xcc9389['rule']){const _0x6fb1ed=await segmentResponseToDef(_0xcc9389,{'resolveSegmentName':async _0x2b4f81=>{const _0xf5aebc=_0x263c40,_0x39097b=_0x1275b2[_0xf5aebc(0x174)](_0x2b4f81);if(_0x39097b)return _0x39097b[_0xf5aebc(0x141)];const _0x2c4235=await _0x5efb33[_0xf5aebc(0x1ab)](_0x2b4f81);return _0x2c4235[_0xf5aebc(0x141)];}}),_0x1c2f25=_0x6fb1ed[_0x263c40(0x1ba)];_0x2c08ba={'description':_0xcc9389[_0x263c40(0xd5)],'rule':_0x1c2f25};const _0x231bfc=serializeRule(_0x1c2f25),_0x5b1700=_0x24f78a[_0x263c40(0x174)](_0x231bfc);if(_0x5b1700)_0x56704b=_0x5b1700,_0x2c08ba=undefined,_0x16b26e[_0x263c40(0x181)]&&console['error'](_0x263c40(0x1b3)+_0xcc9389[_0x263c40(0x141)]+_0x263c40(0x13b)+_0x5b1700);else{let _0x37c401=![];if(_0x3bd894){const _0x2a9971=_0x3bd894['get'](_0x231bfc);if(_0x2a9971){const _0x45d3e8=_0x2a9971[_0x263c40(0x1c0)](_0x26731c=>!_0x4c4637['has'](_0x26731c));_0x45d3e8&&(_0x56704b=_0x45d3e8,_0x4c4637['add'](_0x45d3e8),_0x24f78a[_0x263c40(0x176)](_0x231bfc,_0x45d3e8),_0x37c401=!![],_0x16b26e[_0x263c40(0x181)]&&console[_0x263c40(0x16c)](_0x263c40(0x1be)+_0x45d3e8+_0x263c40(0x122)));}}if(!_0x37c401){const _0x59dee6=generateJourneyLocalName(_0xcc9389[_0x263c40(0x141)]);_0x59dee6&&(_0x56704b=_0x59dee6);let _0x4c0f2b=_0x56704b,_0x48ff59=0x2;while(_0x4c4637['has'](_0x4c0f2b)){_0x4c0f2b=_0x56704b+'_'+_0x48ff59,_0x48ff59++;}_0x4c4637[_0x263c40(0x15e)](_0x4c0f2b),_0x24f78a[_0x263c40(0x176)](_0x231bfc,_0x4c0f2b),_0x56704b=_0x4c0f2b;}}}const _0x379638={'name':_0x56704b,'isJourneyLocal':_0x31977e,'definition':_0x2c08ba};return _0x1275b2[_0x263c40(0x176)](_0x4e7c06,_0x379638),_0x379638;}catch(_0x1f8885){return _0x48dbf6['verbose']&&console[_0x263c40(0x16c)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x4e7c06+':\x20'+_0x1f8885[_0x263c40(0xed)]),{'name':_0x4e7c06,'isJourneyLocal':![]};}},'resolveActivation':async _0x4516d3=>{const _0x3ec3ba=_0x5043c6,_0x510ae5=_0x1495c7[_0x3ec3ba(0x174)](_0x4516d3);if(_0x510ae5)return _0x510ae5;try{const _0xfef99d=await _0x504e82['journey'][_0x3ec3ba(0x1c1)](_0x300048['id'],_0x4516d3),_0x5e3b81=journeyActivationStepToYaml(_0xfef99d,_0x46b132,_0x51092e),_0x15bd95=JSON[_0x3ec3ba(0xd8)]({'name':_0x5e3b81[_0x3ec3ba(0x141)],'connection':_0x5e3b81[_0x3ec3ba(0x18c)],'connector_config':_0x5e3b81[_0x3ec3ba(0x15b)]}),_0x4795c9=_0xd9df35['get'](_0x15bd95);if(_0x4795c9){const _0xc7d6ad={'name':_0x4795c9,'isJourneyLocal':!![],'definition':_0x5e3b81};return _0x1495c7[_0x3ec3ba(0x176)](_0x4516d3,_0xc7d6ad),_0xc7d6ad;}const _0x40e835=_0xfef99d['attributes'][_0x3ec3ba(0xcc)][_0x3ec3ba(0x141)]||_0x4516d3,_0x46dd77=sanitizeYamlKey(_0x40e835)||'activation_'+_0x4516d3;let _0x2f09ab=_0x46dd77,_0x4dbc3d=0x2;while(_0x29d5e5[_0x3ec3ba(0x193)](_0x2f09ab)){_0x2f09ab=_0x46dd77+'_'+_0x4dbc3d,_0x4dbc3d++;}_0x29d5e5[_0x3ec3ba(0x15e)](_0x2f09ab),_0xd9df35[_0x3ec3ba(0x176)](_0x15bd95,_0x2f09ab);const _0x580757={'name':_0x2f09ab,'isJourneyLocal':!![],'definition':_0x5e3b81};return _0x1495c7[_0x3ec3ba(0x176)](_0x4516d3,_0x580757),_0x580757;}catch(_0x494b3b){return _0x48dbf6[_0x3ec3ba(0x181)]&&console['error'](_0x3ec3ba(0xf6)+_0x4516d3+':\x20'+_0x494b3b['message']),{'name':_0x4516d3,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x41c9c2,_0x214edb)=>{const _0x492e8f=_0x5043c6;return resolveJumpTarget(_0x41c9c2,_0x214edb,_0x4fdadd,_0x1efcc1=>_0x504e82[_0x492e8f(0x14b)]['getJourney'](_0x1efcc1));}},_0x8245f1=await journeyResponseToDef(_0x59448a,_0x5efb33);_0x3b0266[_0x5043c6(0xde)]({'item':_0x300048,'yaml':_0x8245f1});}},{'verbose':_0x48dbf6[_0x52778c(0x181)]});const _0x24a70a=await _0x504e82[_0x52778c(0x14b)][_0x52778c(0x168)](_0x293828[0x0][_0x52778c(0x179)]),_0x3867e8=buildMergedJourneyDef(_0x3b0266,_0x3bd894,_0x24a70a),_0x447c21=normalizeJourneyDef(_0x3867e8,_0x279e63),_0x4f2605=toYamlString(_0x447c21),_0x33c23e=_0x50f6f1||a28_0x3d093a['join'](_0x55c832,sanitizeFileName(_0x400de8)+_0x52778c(0x1a2));!_0x50f6f1&&_0x45fcc&&!existsSync(_0x55c832)&&mkdirSync(_0x55c832,{'recursive':!![]});const _0x170c44=a28_0x3d093a[_0x52778c(0x177)](process[_0x52778c(0x113)](),_0x33c23e);if(existsSync(_0x33c23e)){const _0x55472f=readFileSync(_0x33c23e,_0x52778c(0xc6)),_0x32b1e0=generateDiff(_0x55472f,_0x4f2605),_0x5e5831=hasChanges(_0x32b1e0);_0xe5b61a[_0x52778c(0xde)]({'relativePath':_0x170c44,'absolutePath':_0x33c23e,'content':_0x4f2605,'isNew':![],'hasChanges':_0x5e5831,'diff':_0x5e5831?formatDiffWithColors(_0x32b1e0):undefined});}else _0xe5b61a[_0x52778c(0xde)]({'relativePath':_0x170c44,'absolutePath':_0x33c23e,'content':_0x4f2605,'isNew':!![],'hasChanges':![]});}const _0x417711=_0xe5b61a[_0x52778c(0x19b)](_0x1456ac=>_0x1456ac[_0x52778c(0x19d)]),_0x2eed22=_0xe5b61a['filter'](_0xb0c560=>!_0xb0c560['isNew']&&_0xb0c560[_0x52778c(0x137)]),_0x917acc=_0xe5b61a['filter'](_0x1b0adf=>!_0x1b0adf[_0x52778c(0x19d)]&&!_0x1b0adf[_0x52778c(0x137)]),_0x33f2f2=_0x24282c['length'],_0x572a3d=_0x5c3fd7['size'],_0x5b1aa8=_0x33f2f2>_0x572a3d?'\x20('+_0x33f2f2+_0x52778c(0x19e):'';console[_0x52778c(0x16c)](_0x52778c(0xc2)),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0x164)](_0x572a3d+_0x52778c(0x162))+a28_0x458e20['dim'](_0x5b1aa8)),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20['green']('+\x20'+_0x417711['length']+'\x20new\x20files')),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0xf0)]('~\x20'+_0x2eed22[_0x52778c(0xf4)]+'\x20changed\x20files')),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0x1c4)]('=\x20'+_0x917acc[_0x52778c(0xf4)]+_0x52778c(0x138))),console['error']('\x20\x20Target:\x20'+a28_0x458e20['cyan'](_0x58db88)+'\x0a');if(_0x2eed22[_0x52778c(0xf4)]>0x0)for(const _0x358736 of _0x2eed22){console[_0x52778c(0x16c)](_0x52778c(0x17a)+_0x358736['relativePath']+'\x27:'),console[_0x52778c(0x16c)]('─'[_0x52778c(0x126)](0x3c)),console['error'](_0x358736[_0x52778c(0x16d)]),console[_0x52778c(0x16c)]('─'[_0x52778c(0x126)](0x3c));}if(_0x16b26e[_0x52778c(0x128)])return console['error'](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0x18f))),0x0;if(_0x417711[_0x52778c(0xf4)]===0x0&&_0x2eed22[_0x52778c(0xf4)]===0x0)return console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0x1ac)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0xe3459},_0x16b26e[_0x52778c(0xd0)]),console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0x1ac)](_0x52778c(0x180)+a28_0x458e20['dim']('parent_segment')+'\x20=\x20'+a28_0x458e20[_0x52778c(0x164)](_0xe3459))),0x0;if(!_0x16b26e['yes']&&(_0x417711[_0x52778c(0xf4)]>0x0||_0x2eed22[_0x52778c(0xf4)]>0x0)){if(!isInteractive())return console['error'](a28_0x458e20[_0x52778c(0x190)]('\x0aError:'),_0x52778c(0x155)),console['error'](a28_0x458e20[_0x52778c(0x1c4)](_0x52778c(0xf2))),0x1;const _0x44c7ff=await confirmKey(_0x52778c(0x135)+(_0x417711[_0x52778c(0xf4)]+_0x2eed22['length'])+_0x52778c(0xfa));if(!_0x44c7ff)return console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0xd2)),_0x52778c(0x131)),0x1;}!existsSync(_0x58db88)&&mkdirSync(_0x58db88,{'recursive':!![]});const _0x168ba7=a28_0x3d093a[_0x52778c(0x1a8)](_0x58db88,'tdx.json');writeFileSync(_0x168ba7,createTdxConfigContent(_0xe3459),'utf-8');for(const _0x2c78b1 of _0xe5b61a){(_0x2c78b1[_0x52778c(0x19d)]||_0x2c78b1[_0x52778c(0x137)])&&writeFileSync(_0x2c78b1['absolutePath'],_0x2c78b1[_0x52778c(0x142)],_0x52778c(0xc6));}return console[_0x52778c(0x16c)](a28_0x458e20['green'](_0x52778c(0x12e)+(_0x417711['length']+_0x2eed22[_0x52778c(0xf4)])+_0x52778c(0xd7)+_0x58db88)),saveSessionContext({'parent_segment':_0xe3459},_0x16b26e[_0x52778c(0xd0)]),console[_0x52778c(0x16c)](a28_0x458e20['green']('✔\x20Context\x20set:\x20'+a28_0x458e20[_0x52778c(0x1c4)](_0x52778c(0x19f))+_0x52778c(0x159)+a28_0x458e20['cyan'](_0xe3459))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:columns';['description']=a28_0x41d493(0x11b);async['execute'](_0x51e475){const _0x3a2591=a28_0x41d493,{options:_0x39632c,args:_0x2e7850,tdx:_0x229da6}=_0x51e475,_0x1676b1=_0x2e7850[0x0];if(!requireNameOrPath(_0x1676b1))return 0x1;_0x39632c['verbose']&&console[_0x3a2591(0x16c)](_0x3a2591(0x1bc)+_0x1676b1);const {journeyId:_0xe00a54}=await resolveJourneyIdFromInput(_0x1676b1,_0x39632c,_0x229da6),_0x49ca95=await withSpinner(_0x3a2591(0xfc),()=>_0x229da6[_0x3a2591(0x14b)]['getColumnMapping'](_0xe00a54),{'verbose':_0x39632c[_0x3a2591(0x181)]}),_0x1ca1e0=_0x49ca95['data'];return console[_0x3a2591(0x123)](_0x3a2591(0x117)+_0x1ca1e0[_0x3a2591(0x16b)]),console['log'](_0x3a2591(0x1a3)+_0x1ca1e0['table']),await handleSDKOutput(_0x1ca1e0[_0x3a2591(0x165)],_0x39632c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a28_0x41d493(0x1a9);[a28_0x41d493(0xd5)]=a28_0x41d493(0x1bf);async['execute'](_0x2a64f2){const _0x2e8031=a28_0x41d493,{options:_0x13ef87,args:_0x26aaf7,tdx:_0x41609f}=_0x2a64f2,_0x2b05af=_0x26aaf7[0x0];if(!requireNameOrPath(_0x2b05af))return 0x1;_0x13ef87[_0x2e8031(0x181)]&&console['error']('Input:\x20'+_0x2b05af);const {journeyId:_0xecb324}=await resolveJourneyIdFromInput(_0x2b05af,_0x13ef87,_0x41609f),_0x430b7e=await withSpinner(_0x2e8031(0xdb),()=>_0x41609f[_0x2e8031(0x14b)]['listActivationsFlat'](_0xecb324),{'verbose':_0x13ef87[_0x2e8031(0x181)]}),_0x15c723=_0x430b7e[_0x2e8031(0x11f)];return console[_0x2e8031(0x16c)]('Found\x20'+_0x15c723[_0x2e8031(0xf4)]+_0x2e8031(0xce)+(_0x15c723[_0x2e8031(0xf4)]!==0x1?'s':'')),await handleSDKOutput(_0x15c723,_0x13ef87),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0x109);[a28_0x41d493(0xd5)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a28_0x41d493(0x1ad)]=new SegmentPushCommand();async[a28_0x41d493(0xf5)](_0x1870d7){const _0x527bc5=a28_0x41d493,_0x4d1ab1=_0x1870d7[_0x527bc5(0x110)][0x0];let _0x13111d;if(_0x4d1ab1){const _0x413500=await resolveTarget({'arg':_0x4d1ab1,'contextParent':_0x1870d7[_0x527bc5(0x10b)][_0x527bc5(0x182)],'cwd':process[_0x527bc5(0x113)]()});isSuccessfulResolution(_0x413500)&&_0x413500[_0x527bc5(0x102)]===_0x527bc5(0xc5)&&(_0x13111d=_0x413500[_0x527bc5(0xfb)]);}const _0x2984b7={..._0x1870d7,'options':{..._0x1870d7['options'],'journeysOnly':!![],..._0x13111d&&{'singleFilePath':_0x13111d}}};return this[_0x527bc5(0x1ad)][_0x527bc5(0xf5)](_0x2984b7);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a28_0x41d493(0x105);['description']=a28_0x41d493(0x1a6);async[a28_0x41d493(0xf5)](_0x2be745){const _0x111bd5=a28_0x41d493,{options:_0xc9f447,args:_0x172eba,tdx:_0x3ff23f}=_0x2be745,_0x51ca20=_0x172eba[0x0];if(!requireNameOrPath(_0x51ca20))return 0x1;if(_0xc9f447[_0x111bd5(0x181)])console[_0x111bd5(0x16c)](_0x111bd5(0x1bc)+_0x51ca20);const {journeyId:_0x2e8242}=await resolveJourneyIdFromInput(_0x51ca20,_0xc9f447,_0x3ff23f),_0x5b4ae1=await withSpinner(_0x111bd5(0x136),()=>_0x3ff23f['journey'][_0x111bd5(0xdf)](_0x2e8242),{'verbose':_0xc9f447[_0x111bd5(0x181)]}),{bundleName:_0x427d8a,versions:_0x54743a,latestJourneyId:_0x14aa21}=_0x5b4ae1[_0x111bd5(0x11f)];console['error'](_0x427d8a+':\x20'+_0x54743a[_0x111bd5(0xf4)]+'\x20version'+(_0x54743a[_0x111bd5(0xf4)]!==0x1?'s':''));const _0x45ec7f=_0x54743a[_0x111bd5(0x143)](_0x5b5aff=>({'version':_0x5b5aff[_0x111bd5(0xbe)],'journey_id':_0x5b5aff[_0x111bd5(0x139)],'name':_0x5b5aff[_0x111bd5(0x141)],'state':_0x5b5aff[_0x111bd5(0x133)],'paused':_0x5b5aff[_0x111bd5(0xe2)],'latest':_0x5b5aff[_0x111bd5(0x139)]===_0x14aa21,'created_at':_0x5b5aff[_0x111bd5(0x12d)]}));return await handleSDKOutput(_0x45ec7f,_0xc9f447),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:version:create';[a28_0x41d493(0xd5)]=a28_0x41d493(0xe4);async[a28_0x41d493(0xf5)](_0x570e68){const _0xfce973=a28_0x41d493,{options:_0x307704,args:_0xdb26e2,tdx:_0x3ad5b9}=_0x570e68,_0x2e3160=_0xdb26e2[0x0];if(!requireNameOrPath(_0x2e3160))return 0x1;if(_0x307704[_0xfce973(0x181)])console['error'](_0xfce973(0x1bc)+_0x2e3160);const {journeyId:_0x3ba0ff,journeyName:_0x3479f7}=await resolveJourneyIdFromInput(_0x2e3160,_0x307704,_0x3ad5b9);if(!_0x307704['yes']){const _0xab9335=await confirm(_0xfce973(0x148)+_0x3479f7+'\x22?');if(!_0xab9335)return console['error'](_0xfce973(0x1b1)),0x0;}const _0x53d6a9=await withSpinner(_0xfce973(0xf7),()=>_0x3ad5b9[_0xfce973(0x14b)]['createVersion'](_0x3ba0ff),{'verbose':_0x307704[_0xfce973(0x181)]}),_0x186af1=_0x53d6a9[_0xfce973(0x11f)];return console[_0xfce973(0x16c)](a28_0x458e20[_0xfce973(0x1ac)]('✔')+'\x20Created\x20v'+_0x186af1[_0xfce973(0x13e)][_0xfce973(0xbe)]+_0xfce973(0x14a)+_0x186af1['attributes'][_0xfce973(0x141)]+'\x22'),console[_0xfce973(0x16c)](_0xfce973(0xcb)+_0x186af1['id']),await handleSingleObjectOutput({'id':_0x186af1['id'],'name':_0x186af1['attributes'][_0xfce973(0x141)],'version':_0x186af1[_0xfce973(0x13e)][_0xfce973(0xbe)],'state':_0x186af1['attributes'][_0xfce973(0x133)],'bundle_id':_0x186af1[_0xfce973(0x13e)][_0xfce973(0x179)],'created_at':_0x186af1[_0xfce973(0x13e)][_0xfce973(0x12d)]},_0x307704),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';[a28_0x41d493(0xd5)]=a28_0x41d493(0xe9);async[a28_0x41d493(0xf5)](_0x2b4a18){const _0x5b0b7d=a28_0x41d493,{options:_0x4b771f,args:_0x3347fd,tdx:_0x467429}=_0x2b4a18,_0x12bfeb=_0x3347fd[0x0];if(!requireNameOrPath(_0x12bfeb))return 0x1;const _0x270fe9=_0x4b771f['version'];if(!_0x270fe9)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x5b0b7d(0x16c)](_0x5b0b7d(0xbf)),0x1;const _0x3979d8=parseInt(_0x270fe9,0xa);if(isNaN(_0x3979d8)||_0x3979d8<0x1)return console[_0x5b0b7d(0x16c)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x270fe9),0x1;if(_0x4b771f['verbose'])console[_0x5b0b7d(0x16c)]('Input:\x20'+_0x12bfeb+_0x5b0b7d(0x107)+_0x3979d8);const {journeyId:_0x3e4fba,parentSegmentId:_0x554c48}=await resolveJourneyIdFromInput(_0x12bfeb,_0x4b771f,_0x467429),_0xd4ecee=await withSpinner(_0x5b0b7d(0x1c5),()=>_0x467429['journey'][_0x5b0b7d(0xdf)](_0x3e4fba),{'verbose':_0x4b771f['verbose']}),{versions:_0x48bdd6,latestJourneyId:_0xa94afd}=_0xd4ecee['data'],_0xed5654=_0x48bdd6[_0x5b0b7d(0x1c0)](_0x4c39cb=>_0x4c39cb[_0x5b0b7d(0xbe)]===_0x3979d8);if(!_0xed5654){const _0x2038c0=_0x48bdd6['map'](_0x5b2e6e=>'v'+_0x5b2e6e[_0x5b0b7d(0xbe)])[_0x5b0b7d(0x1a8)](',\x20');return console[_0x5b0b7d(0x16c)](_0x5b0b7d(0x1a7)+_0x3979d8+_0x5b0b7d(0x11a)+_0x2038c0),0x1;}const _0x14ed28=await withSpinner(_0x5b0b7d(0x16a)+_0x3979d8+_0x5b0b7d(0x14e),()=>_0x467429[_0x5b0b7d(0x14b)][_0x5b0b7d(0x158)](_0xed5654[_0x5b0b7d(0x139)]),{'verbose':_0x4b771f[_0x5b0b7d(0x181)]}),_0x3eba42=_0x14ed28[_0x5b0b7d(0x11f)],_0x3b2e3e=getConsoleNextUrl(_0x4b771f['site'],_0x5b0b7d(0x198)+_0x554c48+_0x5b0b7d(0x154)+_0xed5654['journeyId']+_0x5b0b7d(0x161));return await handleSingleObjectOutput({'id':_0x3eba42['id'],'name':_0x3eba42[_0x5b0b7d(0x13e)]['name'],'version':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xbe)],'description':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xd5)],'state':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x133)],'paused':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xe2)],'reentry_mode':_0x3eba42['attributes'][_0x5b0b7d(0xc1)],'stages':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x1a4)]?.[_0x5b0b7d(0xf4)]||0x0,..._0x3eba42['attributes'][_0x5b0b7d(0x103)]&&{'goal':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x103)][_0x5b0b7d(0x141)]},'latest':_0xed5654[_0x5b0b7d(0x139)]===_0xa94afd,'created_at':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x12d)],'updated_at':_0x3eba42['attributes'][_0x5b0b7d(0xf9)],'url':_0x3b2e3e},_0x4b771f),0x0;}}
@@ -1 +1 @@
1
- const a29_0x22ec99=a29_0x35e1;(function(_0x24b7fd,_0xacd395){const _0x2418c2=a29_0x35e1,_0x5bb9ff=_0x24b7fd();while(!![]){try{const _0x5f25b7=-parseInt(_0x2418c2(0x1da))/0x1+parseInt(_0x2418c2(0x1df))/0x2+parseInt(_0x2418c2(0x1fd))/0x3+-parseInt(_0x2418c2(0x1e9))/0x4*(parseInt(_0x2418c2(0x1e5))/0x5)+parseInt(_0x2418c2(0x20d))/0x6*(-parseInt(_0x2418c2(0x1d6))/0x7)+parseInt(_0x2418c2(0x1ec))/0x8*(-parseInt(_0x2418c2(0x203))/0x9)+-parseInt(_0x2418c2(0x1f1))/0xa*(-parseInt(_0x2418c2(0x202))/0xb);if(_0x5f25b7===_0xacd395)break;else _0x5bb9ff['push'](_0x5bb9ff['shift']());}catch(_0x48f73e){_0x5bb9ff['push'](_0x5bb9ff['shift']());}}}(a29_0x4093,0xe44de));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a29_0x4093(){const _0x33d3b2=['22TYTdsi','5360778AWHEGm','reason','.yml','warnings','relativePath','Error:\x20','skippedCount','\x20warning(s)','filter','type','456yIqUSe','validCount','31339qWtvUn','filePath','targetDir','log','1735906hlxsVP','error','name','file','Validation\x20failed:\x20','2302728mPMiPs','yellow','\x20segment\x20file(s)\x20skipped','execute','journey:validate','helpText','20645nimPmY','endsWith','No\x20journey\x20YAML\x20files\x20found\x20in\x20','invalidCount','1124BeHKFO','verbose','cwd','24beSaIs','green','length','Error:\x20Directory\x20not\x20found:\x20','\x20error(s)','20076730GrdSvR','no_parent','hasErrors','\x20warning(s)\x20found','red','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20valid','parentSegment','\x20(skipped:\x20','Validate\x20journey\x20YAML\x20files','valid','2375271DUvmGi','errors','warningCount','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','dim'];a29_0x4093=function(){return _0x33d3b2;};return a29_0x4093();}import a29_0x38579b from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a29_0x35e1(_0x13343d,_0x21b978){_0x13343d=_0x13343d-0x1d6;const _0x409306=a29_0x4093();let _0x35e131=_0x409306[_0x13343d];return _0x35e131;}export class JourneyValidateCommand extends BaseCommand{[a29_0x22ec99(0x1dc)]=a29_0x22ec99(0x1e3);['description']=a29_0x22ec99(0x1fb);async[a29_0x22ec99(0x1e2)](_0x226528){const _0x1c0a2c=a29_0x22ec99,{options:_0x511b75,args:_0x2d0b3d}=_0x226528,_0x2433ce=_0x511b75,_0x269805=await resolveTarget({'arg':_0x2d0b3d[0x0],'contextParent':_0x511b75[_0x1c0a2c(0x1f9)],'cwd':process[_0x1c0a2c(0x1eb)]()});if(!isSuccessfulResolution(_0x269805))return _0x269805['errorCode']===_0x1c0a2c(0x1f2)?(console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1e0)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1c0a2c(0x1db)](_0x1c0a2c(0x200)),console[_0x1c0a2c(0x1db)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x1c0a2c(0x1db)](_0x1c0a2c(0x1f7))):(console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1f5)](_0x1c0a2c(0x208)+_0x269805['message']+'\x0a')),_0x269805[_0x1c0a2c(0x1e4)]&&console['error'](a29_0x38579b['cyan'](_0x269805[_0x1c0a2c(0x1e4)]))),0x1;const _0x55bd2d=_0x269805[_0x1c0a2c(0x1d8)],_0xe4eeae=_0x269805[_0x1c0a2c(0x20c)]===_0x1c0a2c(0x1dd)?_0x269805[_0x1c0a2c(0x1d7)]:undefined;if(!_0xe4eeae&&!existsSync(_0x55bd2d))return console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1f5)](_0x1c0a2c(0x1ef)+_0x55bd2d+'\x0a')),0x1;let _0x3efab7;if(_0xe4eeae){if(!_0xe4eeae[_0x1c0a2c(0x1e6)](_0x1c0a2c(0x205))&&!_0xe4eeae[_0x1c0a2c(0x1e6)]('.yaml'))return console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1f5)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xe4eeae+'\x0a')),0x1;_0x3efab7=[_0xe4eeae];}else _0x3efab7=findYamlFiles(_0x55bd2d);if(_0x3efab7[_0x1c0a2c(0x1ee)]===0x0)return console[_0x1c0a2c(0x1db)](a29_0x38579b['red'](_0x1c0a2c(0x1f6)+_0x55bd2d+'\x0a')),0x1;const _0xdcdf97=validateYamlFiles(_0x3efab7,_0x55bd2d,{'filterType':'journey'}),_0xeac104=calculateSummary(_0xdcdf97),_0x56f6c0=_0xdcdf97[_0x1c0a2c(0x20b)](isValidationResult);if(_0x56f6c0[_0x1c0a2c(0x1ee)]===0x0)return console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1e0)](_0x1c0a2c(0x1e7)+_0x55bd2d+'\x0a')),_0xeac104[_0x1c0a2c(0x209)]>0x0&&console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x201)]('('+_0xeac104[_0x1c0a2c(0x209)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x1aaa1e of _0xdcdf97){if(!isValidationResult(_0x1aaa1e)){_0x2433ce[_0x1c0a2c(0x1ea)]&&console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x201)]('-\x20'+_0x1aaa1e[_0x1c0a2c(0x207)]+_0x1c0a2c(0x1fa)+_0x1aaa1e[_0x1c0a2c(0x204)]+')'));continue;}const {relativePath:_0xa2bbfa,source:_0x3912fa,result:_0x5912aa}=_0x1aaa1e;if(_0x5912aa['valid']&&_0x5912aa['warnings'][_0x1c0a2c(0x1ee)]===0x0)_0x2433ce[_0x1c0a2c(0x1ea)]&&console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1ed)]('✔\x20'+_0xa2bbfa));else _0x5912aa[_0x1c0a2c(0x1fc)]?(console['log'](a29_0x38579b['yellow']('⚠\x20'+_0xa2bbfa+':\x20'+_0x5912aa[_0x1c0a2c(0x206)][_0x1c0a2c(0x1ee)]+_0x1c0a2c(0x20a))),console['log'](formatValidationResult(_0x5912aa,_0x3912fa,_0xa2bbfa))):(console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1f5)]('✖\x20'+_0xa2bbfa+':\x20'+_0x5912aa[_0x1c0a2c(0x1fe)][_0x1c0a2c(0x1ee)]+_0x1c0a2c(0x1f0))),console[_0x1c0a2c(0x1d9)](formatValidationResult(_0x5912aa,_0x3912fa,_0xa2bbfa)));}return console['log'](''),_0xeac104[_0x1c0a2c(0x1f3)]?(console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1f5)](_0x1c0a2c(0x1de)+_0xeac104[_0x1c0a2c(0x1e8)]+'\x20journey(s)\x20with\x20errors,\x20'+_0xeac104[_0x1c0a2c(0x20e)]+_0x1c0a2c(0x1f8))),_0xeac104[_0x1c0a2c(0x1ff)]>0x0&&console['log'](a29_0x38579b[_0x1c0a2c(0x1e0)](_0xeac104[_0x1c0a2c(0x1ff)]+_0x1c0a2c(0x1f4))),_0xeac104[_0x1c0a2c(0x209)]>0x0&&console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x201)](_0xeac104[_0x1c0a2c(0x209)]+_0x1c0a2c(0x1e1))),0x1):(console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1ed)]('✔\x20All\x20'+_0xeac104['validCount']+'\x20journey(s)\x20valid')),_0xeac104[_0x1c0a2c(0x1ff)]>0x0&&console['log'](a29_0x38579b['yellow'](_0xeac104[_0x1c0a2c(0x1ff)]+_0x1c0a2c(0x1f4))),_0xeac104[_0x1c0a2c(0x209)]>0x0&&console[_0x1c0a2c(0x1d9)](a29_0x38579b['dim'](_0xeac104[_0x1c0a2c(0x209)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}
1
+ const a29_0x23112d=a29_0x3f2e;(function(_0x4f5ced,_0x523ea1){const _0x522338=a29_0x3f2e,_0x3131d4=_0x4f5ced();while(!![]){try{const _0x24d01c=parseInt(_0x522338(0xbc))/0x1*(-parseInt(_0x522338(0xb6))/0x2)+parseInt(_0x522338(0xab))/0x3+parseInt(_0x522338(0x9f))/0x4*(parseInt(_0x522338(0xb7))/0x5)+parseInt(_0x522338(0x83))/0x6*(-parseInt(_0x522338(0x8c))/0x7)+-parseInt(_0x522338(0x8a))/0x8+-parseInt(_0x522338(0x8f))/0x9*(-parseInt(_0x522338(0x96))/0xa)+-parseInt(_0x522338(0xb9))/0xb*(-parseInt(_0x522338(0x87))/0xc);if(_0x24d01c===_0x523ea1)break;else _0x3131d4['push'](_0x3131d4['shift']());}catch(_0x3b9886){_0x3131d4['push'](_0x3131d4['shift']());}}}(a29_0x4615,0xce84d));import{BaseCommand}from'./command.js';function a29_0x3f2e(_0x330ff0,_0x2dbff7){_0x330ff0=_0x330ff0-0x82;const _0x46155d=a29_0x4615();let _0x3f2e37=_0x46155d[_0x330ff0];return _0x3f2e37;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0x1292ef from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a29_0x4615(){const _0x1dd43b=['88uXLHFc','\x20segment\x20file(s)\x20skipped','\x20journey(s)\x20with\x20errors,\x20','3016WtdbtV','cwd','4843038ZMsnXJ','file','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','validCount','595836JdjZAi','\x20(skipped:\x20','warningCount','7049264JMRQsR','.yml','7azKDGY','Validation\x20failed:\x20','errorCode','643662HLhYXf','.yaml','✔\x20All\x20','Validate\x20journey\x20YAML\x20files','no_parent','log','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','190PxyXKc','description','\x20warning(s)\x20found','message','Error:\x20Directory\x20not\x20found:\x20','execute','\x20valid','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','red','3295864XaRaCo','\x20segment\x20file(s)\x20skipped)','journey','endsWith','hasErrors','verbose','parentSegment','invalidCount','cyan','filter','\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','skippedCount','1427904Bhsgrp','error','reason','warnings','green','relativePath','yellow','length','dim','valid','\x20journey(s)\x20valid','346RFangE','5bsWfHV','targetDir'];a29_0x4615=function(){return _0x1dd43b;};return a29_0x4615();}export class JourneyValidateCommand extends BaseCommand{['name']='journey:validate';[a29_0x23112d(0x97)]=a29_0x23112d(0x92);async[a29_0x23112d(0x9b)](_0x3e6878){const _0x593e7e=a29_0x23112d,{options:_0x5e6680,args:_0x48f654}=_0x3e6878,_0x5169f9=_0x5e6680,_0x137c8a=await resolveTarget({'arg':_0x48f654[0x0],'contextParent':_0x5e6680[_0x593e7e(0xa5)],'cwd':process[_0x593e7e(0x82)]()});if(!isSuccessfulResolution(_0x137c8a))return _0x137c8a[_0x593e7e(0x8e)]===_0x593e7e(0x93)?(console[_0x593e7e(0xac)](a29_0x1292ef[_0x593e7e(0xb1)](_0x593e7e(0x85))),console[_0x593e7e(0xac)](_0x593e7e(0x9d)),console[_0x593e7e(0xac)](_0x593e7e(0xa9)),console[_0x593e7e(0xac)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x593e7e(0xac)](a29_0x1292ef['red']('Error:\x20'+_0x137c8a[_0x593e7e(0x99)]+'\x0a')),_0x137c8a['helpText']&&console[_0x593e7e(0xac)](a29_0x1292ef[_0x593e7e(0xa7)](_0x137c8a['helpText']))),0x1;const _0x8b83f1=_0x137c8a[_0x593e7e(0xb8)],_0x548626=_0x137c8a['type']===_0x593e7e(0x84)?_0x137c8a['filePath']:undefined;if(!_0x548626&&!existsSync(_0x8b83f1))return console[_0x593e7e(0xac)](a29_0x1292ef['red'](_0x593e7e(0x9a)+_0x8b83f1+'\x0a')),0x1;let _0x22e6a2;if(_0x548626){if(!_0x548626[_0x593e7e(0xa2)](_0x593e7e(0x8b))&&!_0x548626['endsWith'](_0x593e7e(0x90)))return console[_0x593e7e(0xac)](a29_0x1292ef[_0x593e7e(0x9e)](_0x593e7e(0x95)+_0x548626+'\x0a')),0x1;_0x22e6a2=[_0x548626];}else _0x22e6a2=findYamlFiles(_0x8b83f1);if(_0x22e6a2[_0x593e7e(0xb2)]===0x0)return console[_0x593e7e(0xac)](a29_0x1292ef[_0x593e7e(0x9e)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x8b83f1+'\x0a')),0x1;const _0x515407=validateYamlFiles(_0x22e6a2,_0x8b83f1,{'filterType':_0x593e7e(0xa1)}),_0x43af9b=calculateSummary(_0x515407),_0xde9ad=_0x515407[_0x593e7e(0xa8)](isValidationResult);if(_0xde9ad[_0x593e7e(0xb2)]===0x0)return console['error'](a29_0x1292ef[_0x593e7e(0xb1)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x8b83f1+'\x0a')),_0x43af9b[_0x593e7e(0xaa)]>0x0&&console['error'](a29_0x1292ef[_0x593e7e(0xb3)]('('+_0x43af9b[_0x593e7e(0xaa)]+_0x593e7e(0xa0))),0x0;for(const _0x179720 of _0x515407){if(!isValidationResult(_0x179720)){_0x5169f9[_0x593e7e(0xa4)]&&console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xb3)]('-\x20'+_0x179720[_0x593e7e(0xb0)]+_0x593e7e(0x88)+_0x179720[_0x593e7e(0xad)]+')'));continue;}const {relativePath:_0x448328,source:_0x4850ab,result:_0x3541f2}=_0x179720;if(_0x3541f2[_0x593e7e(0xb4)]&&_0x3541f2[_0x593e7e(0xae)]['length']===0x0)_0x5169f9['verbose']&&console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xaf)]('✔\x20'+_0x448328));else _0x3541f2[_0x593e7e(0xb4)]?(console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xb1)]('⚠\x20'+_0x448328+':\x20'+_0x3541f2[_0x593e7e(0xae)][_0x593e7e(0xb2)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x3541f2,_0x4850ab,_0x448328))):(console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0x9e)]('✖\x20'+_0x448328+':\x20'+_0x3541f2['errors'][_0x593e7e(0xb2)]+'\x20error(s)')),console[_0x593e7e(0x94)](formatValidationResult(_0x3541f2,_0x4850ab,_0x448328)));}return console[_0x593e7e(0x94)](''),_0x43af9b[_0x593e7e(0xa3)]?(console[_0x593e7e(0x94)](a29_0x1292ef['red'](_0x593e7e(0x8d)+_0x43af9b[_0x593e7e(0xa6)]+_0x593e7e(0xbb)+_0x43af9b['validCount']+_0x593e7e(0x9c))),_0x43af9b[_0x593e7e(0x89)]>0x0&&console['log'](a29_0x1292ef[_0x593e7e(0xb1)](_0x43af9b[_0x593e7e(0x89)]+_0x593e7e(0x98))),_0x43af9b[_0x593e7e(0xaa)]>0x0&&console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xb3)](_0x43af9b[_0x593e7e(0xaa)]+_0x593e7e(0xba))),0x1):(console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xaf)](_0x593e7e(0x91)+_0x43af9b[_0x593e7e(0x86)]+_0x593e7e(0xb5))),_0x43af9b[_0x593e7e(0x89)]>0x0&&console[_0x593e7e(0x94)](a29_0x1292ef['yellow'](_0x43af9b[_0x593e7e(0x89)]+_0x593e7e(0x98))),_0x43af9b[_0x593e7e(0xaa)]>0x0&&console[_0x593e7e(0x94)](a29_0x1292ef[_0x593e7e(0xb3)](_0x43af9b[_0x593e7e(0xaa)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}