@treasuredata/tdx 2026.4.1 → 2026.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a25_0x15bd0b=a25_0x479a;(function(_0xf090e9,_0x1da1a3){const _0x232a4f=a25_0x479a,_0x541ca7=_0xf090e9();while(!![]){try{const _0x4fdba4=parseInt(_0x232a4f(0x9e))/0x1*(parseInt(_0x232a4f(0x8c))/0x2)+-parseInt(_0x232a4f(0x87))/0x3*(-parseInt(_0x232a4f(0x97))/0x4)+-parseInt(_0x232a4f(0x92))/0x5*(parseInt(_0x232a4f(0x90))/0x6)+-parseInt(_0x232a4f(0xa9))/0x7*(-parseInt(_0x232a4f(0x85))/0x8)+parseInt(_0x232a4f(0x7a))/0x9*(parseInt(_0x232a4f(0x89))/0xa)+-parseInt(_0x232a4f(0x77))/0xb*(parseInt(_0x232a4f(0xa7))/0xc)+-parseInt(_0x232a4f(0x94))/0xd*(parseInt(_0x232a4f(0x7c))/0xe);if(_0x4fdba4===_0x1da1a3)break;else _0x541ca7['push'](_0x541ca7['shift']());}catch(_0x16f1b9){_0x541ca7['push'](_0x541ca7['shift']());}}}(a25_0x35e4,0x1fbd2));function a25_0x35e4(){const _0x1166df=['175734uaiPyC','length','56BuvpBo','valid','validCount','green','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Error:\x20Directory\x20not\x20found:\x20','filter','execute','cwd','3568nZVXCv','\x20error(s)','279504sfcbdh','Validate\x20template\x20YAML\x20files','50euuCcB','reason','template','44jUJMJc','.yaml','Validation\x20failed:\x20','\x20(skipped:\x20','14022GlkbBy','endsWith','245fCvwgJ','name','188006wymlgO','yellow','dirname','8HDYEAQ','\x20non-template\x20file(s)\x20skipped','relativePath','error','hasErrors','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20template(s)\x20with\x20errors,\x20','1571OAPKbK','engage:template:validate','.yml','\x20warning(s)','dim','\x20warning(s)\x20found','verbose','warningCount','✔\x20All\x20','1151988WYSQlP','skippedCount','1253IsvrZY','red','11xyjYGQ','warnings','log'];a25_0x35e4=function(){return _0x1166df;};return a25_0x35e4();}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x348617 from'chalk';function a25_0x479a(_0x15b104,_0x13c788){_0x15b104=_0x15b104-0x77;const _0x35e4c1=a25_0x35e4();let _0x479a4a=_0x35e4c1[_0x15b104];return _0x479a4a;}import a25_0x5bf09e from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x15bd0b(0x93)]=a25_0x15bd0b(0x9f);['description']=a25_0x15bd0b(0x88);async[a25_0x15bd0b(0x83)](_0x146ae){const _0x42c18c=a25_0x15bd0b,{options:_0x2ddfc7,args:_0x1d4162}=_0x146ae,_0x3df754=_0x2ddfc7,_0x24091c=_0x1d4162[0x0],_0x78ea0c=_0x24091c?a25_0x5bf09e['resolve'](_0x24091c):undefined,_0x3f06c3=_0x78ea0c?isYamlFile(_0x78ea0c):![];let _0x4caec7,_0x158764;if(_0x3f06c3&&_0x78ea0c)_0x4caec7=a25_0x5bf09e[_0x42c18c(0x96)](_0x78ea0c),_0x158764=_0x78ea0c;else _0x78ea0c?_0x4caec7=_0x78ea0c:_0x4caec7=process[_0x42c18c(0x84)]();if(!_0x158764&&!existsSync(_0x4caec7))return console['error'](a25_0x348617[_0x42c18c(0xaa)](_0x42c18c(0x81)+_0x4caec7+'\x0a')),0x1;let _0x58c702;if(_0x158764){if(!_0x158764['endsWith'](_0x42c18c(0xa0))&&!_0x158764[_0x42c18c(0x91)](_0x42c18c(0x8d)))return console['error'](a25_0x348617['red'](_0x42c18c(0x80)+_0x158764+'\x0a')),0x1;_0x58c702=[_0x158764];}else _0x58c702=findYamlFiles(_0x4caec7);if(_0x58c702[_0x42c18c(0x7b)]===0x0)return console[_0x42c18c(0x9a)](a25_0x348617[_0x42c18c(0xaa)](_0x42c18c(0x9c)+_0x4caec7+'\x0a')),0x1;const _0x224e3c=validateYamlFiles(_0x58c702,_0x4caec7,{'filterType':_0x42c18c(0x8b)}),_0xd5201c=calculateSummary(_0x224e3c),_0x2d5c6c=_0x224e3c[_0x42c18c(0x82)](isValidationResult);if(_0x2d5c6c[_0x42c18c(0x7b)]===0x0)return console[_0x42c18c(0x9a)](a25_0x348617[_0x42c18c(0x95)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x4caec7+'\x0a')),_0xd5201c[_0x42c18c(0xa8)]>0x0&&console[_0x42c18c(0x9a)](a25_0x348617[_0x42c18c(0xa2)]('('+_0xd5201c[_0x42c18c(0xa8)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x404f02 of _0x224e3c){if(!isValidationResult(_0x404f02)){_0x3df754[_0x42c18c(0xa4)]&&console[_0x42c18c(0x79)](a25_0x348617['dim']('-\x20'+_0x404f02[_0x42c18c(0x99)]+_0x42c18c(0x8f)+_0x404f02[_0x42c18c(0x8a)]+')'));continue;}const {relativePath:_0x13a4a9,source:_0xd48b0e,result:_0x2f5bc5}=_0x404f02;if(_0x2f5bc5[_0x42c18c(0x7d)]&&_0x2f5bc5[_0x42c18c(0x78)][_0x42c18c(0x7b)]===0x0)_0x3df754[_0x42c18c(0xa4)]&&console['log'](a25_0x348617[_0x42c18c(0x7f)]('✔\x20'+_0x13a4a9));else _0x2f5bc5[_0x42c18c(0x7d)]?(console[_0x42c18c(0x79)](a25_0x348617[_0x42c18c(0x95)]('⚠\x20'+_0x13a4a9+':\x20'+_0x2f5bc5[_0x42c18c(0x78)]['length']+_0x42c18c(0xa1))),console[_0x42c18c(0x79)](formatValidationResult(_0x2f5bc5,_0xd48b0e,_0x13a4a9))):(console['log'](a25_0x348617[_0x42c18c(0xaa)]('✖\x20'+_0x13a4a9+':\x20'+_0x2f5bc5['errors'][_0x42c18c(0x7b)]+_0x42c18c(0x86))),console[_0x42c18c(0x79)](formatValidationResult(_0x2f5bc5,_0xd48b0e,_0x13a4a9)));}return console['log'](''),_0xd5201c[_0x42c18c(0x9b)]?(console[_0x42c18c(0x79)](a25_0x348617[_0x42c18c(0xaa)](_0x42c18c(0x8e)+_0xd5201c['invalidCount']+_0x42c18c(0x9d)+_0xd5201c[_0x42c18c(0x7e)]+'\x20valid')),_0xd5201c[_0x42c18c(0xa5)]>0x0&&console['log'](a25_0x348617[_0x42c18c(0x95)](_0xd5201c[_0x42c18c(0xa5)]+'\x20warning(s)\x20found')),_0xd5201c[_0x42c18c(0xa8)]>0x0&&console[_0x42c18c(0x79)](a25_0x348617['dim'](_0xd5201c[_0x42c18c(0xa8)]+_0x42c18c(0x98))),0x1):(console[_0x42c18c(0x79)](a25_0x348617[_0x42c18c(0x7f)](_0x42c18c(0xa6)+_0xd5201c[_0x42c18c(0x7e)]+'\x20template(s)\x20valid')),_0xd5201c['warningCount']>0x0&&console[_0x42c18c(0x79)](a25_0x348617['yellow'](_0xd5201c['warningCount']+_0x42c18c(0xa3))),_0xd5201c[_0x42c18c(0xa8)]>0x0&&console[_0x42c18c(0x79)](a25_0x348617['dim'](_0xd5201c[_0x42c18c(0xa8)]+_0x42c18c(0x98))),0x0);}}
1
+ const a25_0xe56529=a25_0x3eeb;(function(_0x2878a3,_0x16b377){const _0x1f87c1=a25_0x3eeb,_0x19a22c=_0x2878a3();while(!![]){try{const _0x22dc70=parseInt(_0x1f87c1(0xca))/0x1*(parseInt(_0x1f87c1(0xb9))/0x2)+parseInt(_0x1f87c1(0xb1))/0x3+parseInt(_0x1f87c1(0xc2))/0x4*(parseInt(_0x1f87c1(0xd2))/0x5)+-parseInt(_0x1f87c1(0xc7))/0x6+-parseInt(_0x1f87c1(0xd0))/0x7+-parseInt(_0x1f87c1(0xc3))/0x8*(-parseInt(_0x1f87c1(0xb2))/0x9)+-parseInt(_0x1f87c1(0xb7))/0xa;if(_0x22dc70===_0x16b377)break;else _0x19a22c['push'](_0x19a22c['shift']());}catch(_0x472b32){_0x19a22c['push'](_0x19a22c['shift']());}}}(a25_0x5a6e,0xe24f7));import{BaseCommand}from'./command.js';function a25_0x3eeb(_0x8638a4,_0x506dff){_0x8638a4=_0x8638a4-0xa7;const _0x5a6e00=a25_0x5a6e();let _0x3eeb3b=_0x5a6e00[_0x8638a4];return _0x3eeb3b;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x2d7e7b from'chalk';function a25_0x5a6e(){const _0x546974=['Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','filter','\x20error(s)','4693980Mwaoli','verbose','1439178SJcnjv','\x20non-template\x20file(s)\x20skipped','invalidCount','length','resolve','warnings','log','warningCount','error','5970252lweiNl','3742712NegQxJ','\x20(skipped:\x20','\x20valid','dirname','8046786lGLuXp','hasErrors','description','1JtrqbP','\x20non-template\x20file(s)\x20skipped)','relativePath','valid','endsWith','validCount','7217413qMLsZk','engage:template:validate','5iryJaM','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20template(s)\x20valid','red','dim','cwd','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','skippedCount','Error:\x20Directory\x20not\x20found:\x20','template','458658ECyBxz','27DJZBEg','reason'];a25_0x5a6e=function(){return _0x546974;};return a25_0x5a6e();}import a25_0xb6c9f5 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']=a25_0xe56529(0xd1);[a25_0xe56529(0xc9)]='Validate\x20template\x20YAML\x20files';async['execute'](_0x3bf3c8){const _0x959964=a25_0xe56529,{options:_0x559565,args:_0x1e63bc}=_0x3bf3c8,_0x32185=_0x559565,_0x4eab11=_0x1e63bc[0x0],_0x5401b5=_0x4eab11?a25_0xb6c9f5[_0x959964(0xbd)](_0x4eab11):undefined,_0x5322ec=_0x5401b5?isYamlFile(_0x5401b5):![];let _0xb1cc46,_0x3ae516;if(_0x5322ec&&_0x5401b5)_0xb1cc46=a25_0xb6c9f5[_0x959964(0xc6)](_0x5401b5),_0x3ae516=_0x5401b5;else _0x5401b5?_0xb1cc46=_0x5401b5:_0xb1cc46=process[_0x959964(0xab)]();if(!_0x3ae516&&!existsSync(_0xb1cc46))return console[_0x959964(0xc1)](a25_0x2d7e7b[_0x959964(0xa9)](_0x959964(0xaf)+_0xb1cc46+'\x0a')),0x1;let _0x1196c1;if(_0x3ae516){if(!_0x3ae516[_0x959964(0xce)]('.yml')&&!_0x3ae516[_0x959964(0xce)]('.yaml'))return console[_0x959964(0xc1)](a25_0x2d7e7b[_0x959964(0xa9)](_0x959964(0xb4)+_0x3ae516+'\x0a')),0x1;_0x1196c1=[_0x3ae516];}else _0x1196c1=findYamlFiles(_0xb1cc46);if(_0x1196c1[_0x959964(0xbc)]===0x0)return console[_0x959964(0xc1)](a25_0x2d7e7b[_0x959964(0xa9)](_0x959964(0xac)+_0xb1cc46+'\x0a')),0x1;const _0x46b92d=validateYamlFiles(_0x1196c1,_0xb1cc46,{'filterType':_0x959964(0xb0)}),_0xfc8477=calculateSummary(_0x46b92d),_0x233cf1=_0x46b92d[_0x959964(0xb5)](isValidationResult);if(_0x233cf1[_0x959964(0xbc)]===0x0)return console[_0x959964(0xc1)](a25_0x2d7e7b[_0x959964(0xad)](_0x959964(0xa7)+_0xb1cc46+'\x0a')),_0xfc8477['skippedCount']>0x0&&console[_0x959964(0xc1)](a25_0x2d7e7b[_0x959964(0xaa)]('('+_0xfc8477['skippedCount']+_0x959964(0xcb))),0x0;for(const _0x1d5fd5 of _0x46b92d){if(!isValidationResult(_0x1d5fd5)){_0x32185['verbose']&&console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xaa)]('-\x20'+_0x1d5fd5[_0x959964(0xcc)]+_0x959964(0xc4)+_0x1d5fd5[_0x959964(0xb3)]+')'));continue;}const {relativePath:_0x28bce6,source:_0xbfefa5,result:_0x566ee6}=_0x1d5fd5;if(_0x566ee6[_0x959964(0xcd)]&&_0x566ee6['warnings'][_0x959964(0xbc)]===0x0)_0x32185[_0x959964(0xb8)]&&console[_0x959964(0xbf)](a25_0x2d7e7b['green']('✔\x20'+_0x28bce6));else _0x566ee6[_0x959964(0xcd)]?(console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xad)]('⚠\x20'+_0x28bce6+':\x20'+_0x566ee6[_0x959964(0xbe)][_0x959964(0xbc)]+'\x20warning(s)')),console[_0x959964(0xbf)](formatValidationResult(_0x566ee6,_0xbfefa5,_0x28bce6))):(console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xa9)]('✖\x20'+_0x28bce6+':\x20'+_0x566ee6['errors'][_0x959964(0xbc)]+_0x959964(0xb6))),console[_0x959964(0xbf)](formatValidationResult(_0x566ee6,_0xbfefa5,_0x28bce6)));}return console[_0x959964(0xbf)](''),_0xfc8477[_0x959964(0xc8)]?(console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xa9)]('Validation\x20failed:\x20'+_0xfc8477[_0x959964(0xbb)]+'\x20template(s)\x20with\x20errors,\x20'+_0xfc8477[_0x959964(0xcf)]+_0x959964(0xc5))),_0xfc8477[_0x959964(0xc0)]>0x0&&console[_0x959964(0xbf)](a25_0x2d7e7b['yellow'](_0xfc8477[_0x959964(0xc0)]+'\x20warning(s)\x20found')),_0xfc8477['skippedCount']>0x0&&console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xaa)](_0xfc8477['skippedCount']+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x959964(0xbf)](a25_0x2d7e7b['green']('✔\x20All\x20'+_0xfc8477[_0x959964(0xcf)]+_0x959964(0xa8))),_0xfc8477[_0x959964(0xc0)]>0x0&&console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xad)](_0xfc8477[_0x959964(0xc0)]+'\x20warning(s)\x20found')),_0xfc8477[_0x959964(0xae)]>0x0&&console[_0x959964(0xbf)](a25_0x2d7e7b[_0x959964(0xaa)](_0xfc8477['skippedCount']+_0x959964(0xba))),0x0);}}
@@ -1 +1 @@
1
- const a26_0x20d0b1=a26_0x5948;(function(_0x3219a1,_0x54ba76){const _0x288107=a26_0x5948,_0x150300=_0x3219a1();while(!![]){try{const _0x207500=-parseInt(_0x288107(0x136))/0x1+-parseInt(_0x288107(0x122))/0x2*(parseInt(_0x288107(0x152))/0x3)+parseInt(_0x288107(0x156))/0x4*(parseInt(_0x288107(0x109))/0x5)+parseInt(_0x288107(0x11f))/0x6*(-parseInt(_0x288107(0x111))/0x7)+-parseInt(_0x288107(0x12a))/0x8*(parseInt(_0x288107(0x148))/0x9)+parseInt(_0x288107(0x14b))/0xa*(parseInt(_0x288107(0x105))/0xb)+-parseInt(_0x288107(0x128))/0xc*(-parseInt(_0x288107(0x14f))/0xd);if(_0x207500===_0x54ba76)break;else _0x150300['push'](_0x150300['shift']());}catch(_0x2e15d2){_0x150300['push'](_0x150300['shift']());}}}(a26_0x4b95,0x37ec7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a26_0x4b95(){const _0x26ed76=['...','substring','Submit\x20a\x20job','limit','join','No\x20SQL\x20statements\x20found\x20in\x20file','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','✔\x20Job\x20submitted','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','List\x20jobs','information_schema','142343kxtmBm','type','Get\x20job\x20results','jobs','data','map','description','site','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','submit','\x20job','validate','start_at','Status\x20filter:\x20','presto','Database:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','abs','612bRVxIr','name','h\x20ago','3348050bVAqyG','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','round','Kill\x20a\x20job','4498evnGrZ','job:show','d\x20ago','260724oQYaoo','m\x20ago','green','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','228ykmYFL','\x20jobs','success','job_id','verbose','debug','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','red','INVALID_ARGUMENT','created_at','jobType','database','mo\x20ago','Getting\x20job\x20results...','getTime','11waxiXi','\x20row','floor','log','9765hrcQqe','Query:\x20','now','push','error','Show\x20job\x20details','execute','priority','637742DjMVYg','job:kill','status','hive','Limit:\x20','Listing\x20jobs...','args','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','url','query','dim','end_at','file','✔\x20Retrieved\x20','6mSVtnM','Job\x20type:\x20','✔\x20Found\x20','2pEQROb','user_name','trino','\x20\x20Job\x20ID:\x20','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','length','19452PBFmqx','Submitting\x20kill\x20request...','53832upIpfO'];a26_0x4b95=function(){return _0x26ed76;};return a26_0x4b95();}import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x328fb4 from'chalk';function formatDuration(_0x36f871){const _0x4620f4=a26_0x5948;if(_0x36f871<0x3c)return _0x36f871+'s';if(_0x36f871<0xe10)return Math[_0x4620f4(0x107)](_0x36f871/0x3c)+'m\x20'+_0x36f871%0x3c+'s';const _0x22cce4=Math[_0x4620f4(0x107)](_0x36f871/0xe10),_0xbda759=Math[_0x4620f4(0x107)](_0x36f871%0xe10/0x3c);return _0xbda759>0x0?_0x22cce4+'h\x20'+_0xbda759+'m':_0x22cce4+'h';}function formatRelativeTime(_0x21771f){const _0xf6ae4e=a26_0x5948,_0x16cb8d=Date[_0xf6ae4e(0x10b)]()-_0x21771f[_0xf6ae4e(0x104)](),_0x5c818f=Math[_0xf6ae4e(0x107)](Math[_0xf6ae4e(0x147)](_0x16cb8d)/0x3e8);if(_0x5c818f<0x3c)return'just\x20now';const _0x1d105c=Math[_0xf6ae4e(0x107)](_0x5c818f/0x3c);if(_0x1d105c<0x3c)return _0x1d105c+_0xf6ae4e(0x153);const _0x55c9dd=Math['floor'](_0x1d105c/0x3c);if(_0x55c9dd<0x18)return _0x55c9dd+_0xf6ae4e(0x14a);const _0x3cdb42=Math[_0xf6ae4e(0x107)](_0x55c9dd/0x18);if(_0x3cdb42<0x1e)return _0x3cdb42+_0xf6ae4e(0x151);return Math['floor'](_0x3cdb42/0x1e)+_0xf6ae4e(0x102);}function a26_0x5948(_0x4993f3,_0x157a38){_0x4993f3=_0x4993f3-0xfd;const _0x4b95f9=a26_0x4b95();let _0x594882=_0x4b95f9[_0x4993f3];return _0x594882;}export class JobListCommand extends BaseCommand{[a26_0x20d0b1(0x149)]=a26_0x20d0b1(0x139);['description']=a26_0x20d0b1(0x134);async[a26_0x20d0b1(0x10f)](_0x5865e7){const _0x58d0c7=a26_0x20d0b1,{options:_0x1af216,tdx:_0x23b5a3}=_0x5865e7,_0x3a33d0=resolveLimit(_0x1af216[_0x58d0c7(0x12e)],DEFAULT_DISPLAY_LIMIT),_0x3d1cd2=_0x1af216[_0x58d0c7(0x113)];_0x1af216[_0x58d0c7(0x15a)]&&(console[_0x58d0c7(0x10d)](_0x58d0c7(0x115)+_0x3a33d0+_0x58d0c7(0x157)),_0x3d1cd2&&console['error'](_0x58d0c7(0x143)+_0x3d1cd2));const _0x9fe3b5=await withSpinner(_0x58d0c7(0x116),()=>_0x23b5a3[_0x58d0c7(0x139)]['list']({'from':0x0,'to':_0x3a33d0-0x1,'status':_0x3d1cd2}),{'verbose':_0x1af216[_0x58d0c7(0x15a)]}),_0x45186b=_0x9fe3b5['data'];console[_0x58d0c7(0x10d)](_0x58d0c7(0x121)+_0x45186b[_0x58d0c7(0x127)]+_0x58d0c7(0x140)+(_0x45186b['length']!==0x1?'s':''));const _0x91dc6e=_0x1af216[_0x58d0c7(0x13d)];if(isStructuredFormat(_0x1af216)){const _0x4a0620=_0x45186b[_0x58d0c7(0x13b)](_0x3bb192=>{const _0x295f6f=_0x58d0c7;let _0x5ab415;if(_0x3bb192[_0x295f6f(0x142)]&&_0x3bb192[_0x295f6f(0x11c)]){const _0x257b30=new Date(_0x3bb192[_0x295f6f(0x142)])[_0x295f6f(0x104)](),_0x527c76=new Date(_0x3bb192['end_at'])['getTime']();_0x5ab415=Math[_0x295f6f(0x14d)]((_0x527c76-_0x257b30)/0x3e8);}return{'job_id':_0x3bb192[_0x295f6f(0x159)],'type':_0x3bb192[_0x295f6f(0x137)]===_0x295f6f(0x144)?_0x295f6f(0x124):_0x3bb192['type'],'status':_0x3bb192[_0x295f6f(0x113)],'user_name':_0x3bb192[_0x295f6f(0x123)],'duration_sec':_0x5ab415,'created_at':_0x3bb192[_0x295f6f(0xff)],'started_at':_0x3bb192[_0x295f6f(0x142)],'end_at':_0x3bb192[_0x295f6f(0x11c)]};});await handleSDKOutput(_0x4a0620,_0x1af216);}else for(const _0x454f9b of _0x45186b){const _0x2b1024=_0x454f9b[_0x58d0c7(0x113)]===_0x58d0c7(0x158)?a26_0x328fb4[_0x58d0c7(0x154)]:_0x454f9b['status']==='error'?a26_0x328fb4[_0x58d0c7(0xfd)]:a26_0x328fb4['dim'],_0x1da9a8=_0x2b1024(_0x454f9b[_0x58d0c7(0x113)]),_0x35aa13=getJobUrl(_0x91dc6e,_0x454f9b['job_id']),_0x55a974=hyperlink(_0x454f9b[_0x58d0c7(0x159)],_0x35aa13),_0x25c770=a26_0x328fb4[_0x58d0c7(0x11b)](_0x454f9b[_0x58d0c7(0x137)]===_0x58d0c7(0x144)?_0x58d0c7(0x124):_0x454f9b[_0x58d0c7(0x137)]),_0x332c9b=[];if(_0x454f9b[_0x58d0c7(0x142)]&&_0x454f9b['end_at']){const _0x3376ce=Math[_0x58d0c7(0x14d)]((new Date(_0x454f9b['end_at'])[_0x58d0c7(0x104)]()-new Date(_0x454f9b[_0x58d0c7(0x142)])['getTime']())/0x3e8);_0x332c9b[_0x58d0c7(0x10c)](formatDuration(_0x3376ce));}if(_0x454f9b[_0x58d0c7(0x11c)])_0x332c9b[_0x58d0c7(0x10c)](formatRelativeTime(new Date(_0x454f9b['end_at'])));else _0x454f9b[_0x58d0c7(0x142)]&&_0x332c9b[_0x58d0c7(0x10c)](formatRelativeTime(new Date(_0x454f9b[_0x58d0c7(0x142)])));const _0x3a5f4a=_0x332c9b['length']>0x0?a26_0x328fb4[_0x58d0c7(0x11b)]('\x20'+_0x332c9b[_0x58d0c7(0x12f)](',\x20')):'';console[_0x58d0c7(0x108)]('⚡\x20'+_0x55a974+'\x20'+_0x25c770+'\x20'+_0x1da9a8+_0x3a5f4a);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x20d0b1(0x149)]=a26_0x20d0b1(0x150);[a26_0x20d0b1(0x13c)]=a26_0x20d0b1(0x10e);[a26_0x20d0b1(0x141)](_0x37a209){const _0x373efc=a26_0x20d0b1,_0x30e5ad=_0x37a209[_0x373efc(0x117)][0x0];if(!_0x30e5ad)return _0x373efc(0x155);return undefined;}async['execute'](_0x184c44){const _0x515b41=a26_0x20d0b1,{options:_0x3a07f1,args:_0xd285cb,tdx:_0x5a487f}=_0x184c44,_0x27d0ec=_0xd285cb[0x0],_0x50e6b1=await withSpinner('Getting\x20job\x20details...',()=>_0x5a487f[_0x515b41(0x139)]['show'](_0x27d0ec),{'verbose':_0x3a07f1[_0x515b41(0x15a)]}),_0xcc3f09=_0x50e6b1['data'];let _0x85013a;if(_0xcc3f09['start_at']&&_0xcc3f09[_0x515b41(0x11c)]){const _0x412e1f=new Date(_0xcc3f09[_0x515b41(0x142)])[_0x515b41(0x104)](),_0x4576bd=new Date(_0xcc3f09[_0x515b41(0x11c)])['getTime']();_0x85013a=Math[_0x515b41(0x14d)]((_0x4576bd-_0x412e1f)/0x3e8);}const _0x90100d={'job_id':_0xcc3f09[_0x515b41(0x159)],'type':_0xcc3f09[_0x515b41(0x137)],'status':_0xcc3f09[_0x515b41(0x113)],..._0xcc3f09['user_name']&&{'user_name':_0xcc3f09['user_name']},..._0x85013a!==undefined&&{'duration_sec':_0x85013a},..._0xcc3f09['created_at']&&{'created_at':_0xcc3f09[_0x515b41(0xff)]},..._0xcc3f09[_0x515b41(0x142)]&&{'started_at':_0xcc3f09[_0x515b41(0x142)]},..._0xcc3f09[_0x515b41(0x11c)]&&{'end_at':_0xcc3f09['end_at']},..._0xcc3f09[_0x515b41(0x101)]&&{'database':_0xcc3f09[_0x515b41(0x101)]},..._0xcc3f09['priority']!==undefined&&{'priority':_0xcc3f09[_0x515b41(0x110)]},..._0xcc3f09[_0x515b41(0x119)]&&{'url':_0xcc3f09[_0x515b41(0x119)]},..._0xcc3f09[_0x515b41(0x11a)]&&{'query':_0xcc3f09['query']},..._0xcc3f09[_0x515b41(0x15b)]&&{'debug':_0xcc3f09[_0x515b41(0x15b)]}};return await handleSingleObjectOutput(_0x90100d,_0x3a07f1),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x20d0b1(0x112);[a26_0x20d0b1(0x13c)]=a26_0x20d0b1(0x14e);[a26_0x20d0b1(0x141)](_0x577b07){const _0x56a85a=a26_0x20d0b1,_0x4d0adf=_0x577b07[_0x56a85a(0x117)][0x0];if(!_0x4d0adf)return _0x56a85a(0x133);return undefined;}async[a26_0x20d0b1(0x10f)](_0xc5aef8){const _0x32a024=a26_0x20d0b1,{options:_0x5c253c,args:_0x398922,tdx:_0x1402f7}=_0xc5aef8,_0x1ec4ca=_0x398922[0x0];if(!_0x5c253c['yes']){const _0x66189e=await confirm(_0x32a024(0x131)+_0x1ec4ca+'?');if(!_0x66189e)return console[_0x32a024(0x10d)]('Cancelled'),0x0;}return await withSpinner(_0x32a024(0x129),()=>_0x1402f7['jobs']['kill'](_0x1ec4ca),{'verbose':_0x5c253c[_0x32a024(0x15a)]}),console['error'](_0x32a024(0x15c)+_0x1ec4ca),console[_0x32a024(0x10d)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x1ec4ca+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x20d0b1(0x149)]='job:submit';[a26_0x20d0b1(0x13c)]=a26_0x20d0b1(0x12d);async[a26_0x20d0b1(0x10f)](_0x1cfc33){const _0xcaa6d3=a26_0x20d0b1,{options:_0x43ce13,args:_0x21ac8b,tdx:_0x32f1fa}=_0x1cfc33,_0x49a644=_0x43ce13[_0xcaa6d3(0x100)]||_0xcaa6d3(0x124),_0x4d0fd5=_0x43ce13[_0xcaa6d3(0x11d)],_0x6fd7fc=_0x43ce13[_0xcaa6d3(0x101)]||_0xcaa6d3(0x135),_0x42071e=_0x43ce13['result'];if(_0x49a644!=='trino'&&_0x49a644!==_0xcaa6d3(0x114))throw new SDKError(ErrorCode[_0xcaa6d3(0xfe)],_0xcaa6d3(0x14c));let _0x5cb193;if(_0x4d0fd5){if(_0x21ac8b[0x0])throw new SDKError(ErrorCode[_0xcaa6d3(0xfe)],_0xcaa6d3(0x146));const _0x3364e0=readSqlStatementsFromFile(_0x4d0fd5);if(_0x3364e0[_0xcaa6d3(0x127)]===0x0)throw new SDKError(ErrorCode[_0xcaa6d3(0xfe)],_0xcaa6d3(0x130));if(_0x3364e0[_0xcaa6d3(0x127)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xcaa6d3(0x118));_0x5cb193=_0x3364e0[0x0];}else{if(!_0x21ac8b[0x0])throw new SDKError(ErrorCode[_0xcaa6d3(0xfe)],_0xcaa6d3(0x126));_0x5cb193=_0x21ac8b[0x0];}_0x43ce13['verbose']&&(console[_0xcaa6d3(0x10d)](_0xcaa6d3(0x120)+_0x49a644),console[_0xcaa6d3(0x10d)](_0xcaa6d3(0x145)+_0x6fd7fc),console[_0xcaa6d3(0x10d)](_0xcaa6d3(0x10a)+_0x5cb193[_0xcaa6d3(0x12c)](0x0,0x64)+(_0x5cb193[_0xcaa6d3(0x127)]>0x64?_0xcaa6d3(0x12b):'')));const _0x359b26=await withSpinner('Submitting\x20job...',()=>_0x32f1fa['jobs'][_0xcaa6d3(0x13f)](_0x6fd7fc,_0x5cb193,_0x49a644,_0x42071e),{'verbose':_0x43ce13[_0xcaa6d3(0x15a)]}),_0x53aee4=_0x359b26[_0xcaa6d3(0x13a)];return console[_0xcaa6d3(0x10d)](_0xcaa6d3(0x132)),console[_0xcaa6d3(0x10d)](_0xcaa6d3(0x125)+_0x53aee4[_0xcaa6d3(0x159)]),await handleSDKOutput([_0x53aee4],_0x43ce13),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x20d0b1(0x149)]='job:result';[a26_0x20d0b1(0x13c)]=a26_0x20d0b1(0x138);[a26_0x20d0b1(0x141)](_0x18a27e){const _0x54d846=a26_0x20d0b1,_0x105fab=_0x18a27e['args'][0x0];if(!_0x105fab)return _0x54d846(0x13e);return undefined;}async[a26_0x20d0b1(0x10f)](_0x1b9d4d){const _0x40ceea=a26_0x20d0b1,{options:_0x57bb58,args:_0x5686b9,tdx:_0x102e1f}=_0x1b9d4d,_0x524fb2=_0x5686b9[0x0],_0x33ac25=await withSpinner(_0x40ceea(0x103),()=>_0x102e1f[_0x40ceea(0x139)]['result'](_0x524fb2),{'verbose':_0x57bb58[_0x40ceea(0x15a)]}),_0x1817df=_0x33ac25[_0x40ceea(0x13a)];return console['error'](_0x40ceea(0x11e)+_0x1817df[_0x40ceea(0x127)]+_0x40ceea(0x106)+(_0x1817df['length']!==0x1?'s':'')),await handleSDKOutput(_0x1817df,_0x57bb58),0x0;}}
1
+ function a26_0x5cc0(){const _0x305827=['...','595WxrBRQ','8496UgyHav','end_at','green','✔\x20Job\x20submitted','dim','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','floor','\x20jobs','7TLeiWo','5240740UOCPOi','job:submit','status','375322hdkFse','✔\x20Found\x20','trino','job_id','abs','push','\x20row','limit','length','validate','start_at','Cancelled','created_at','d\x20ago','Submitting\x20kill\x20request...','query','86679AMtjTq','INVALID_ARGUMENT','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','success','red','args','kill','Getting\x20job\x20details...','Kill\x20a\x20job','debug','submit','58hwlsPN','site','Query:\x20','hive','✔\x20Retrieved\x20','list','getTime','yes','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','map','Get\x20job\x20results','name','11323017adZYDu','26586naWJMD','result','database','type','join','description','5781212wVOIxx','log','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','user_name','Getting\x20job\x20results...','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','now','just\x20now','\x20job','Limit:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','\x20\x20Job\x20ID:\x20','Database:\x20','data','Submit\x20a\x20job','url','round','List\x20jobs','error','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','jobs','priority','Submitting\x20job...','verbose','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','m\x20ago','presto','information_schema','execute','substring'];a26_0x5cc0=function(){return _0x305827;};return a26_0x5cc0();}const a26_0x1d4acc=a26_0xc74b;(function(_0x507704,_0x46e91c){const _0x17502f=a26_0xc74b,_0x441e08=_0x507704();while(!![]){try{const _0x3a53a3=parseInt(_0x17502f(0x137))/0x1+-parseInt(_0x17502f(0x152))/0x2*(parseInt(_0x17502f(0x147))/0x3)+parseInt(_0x17502f(0x165))/0x4+parseInt(_0x17502f(0x185))/0x5*(parseInt(_0x17502f(0x15f))/0x6)+parseInt(_0x17502f(0x18e))/0x7*(-parseInt(_0x17502f(0x186))/0x8)+-parseInt(_0x17502f(0x15e))/0x9+parseInt(_0x17502f(0x134))/0xa;if(_0x3a53a3===_0x46e91c)break;else _0x441e08['push'](_0x441e08['shift']());}catch(_0x299ddd){_0x441e08['push'](_0x441e08['shift']());}}}(a26_0x5cc0,0xbd304));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a26_0xc74b(_0x7984d7,_0x2f29bb){_0x7984d7=_0x7984d7-0x134;const _0x5cc0d9=a26_0x5cc0();let _0xc74bf1=_0x5cc0d9[_0x7984d7];return _0xc74bf1;}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x196743 from'chalk';function formatDuration(_0x1f67a2){const _0x32dc28=a26_0xc74b;if(_0x1f67a2<0x3c)return _0x1f67a2+'s';if(_0x1f67a2<0xe10)return Math[_0x32dc28(0x18c)](_0x1f67a2/0x3c)+'m\x20'+_0x1f67a2%0x3c+'s';const _0x1d7170=Math[_0x32dc28(0x18c)](_0x1f67a2/0xe10),_0x4a0b1c=Math[_0x32dc28(0x18c)](_0x1f67a2%0xe10/0x3c);return _0x4a0b1c>0x0?_0x1d7170+'h\x20'+_0x4a0b1c+'m':_0x1d7170+'h';}function formatRelativeTime(_0x2cf840){const _0x5ea374=a26_0xc74b,_0x211012=Date[_0x5ea374(0x16c)]()-_0x2cf840[_0x5ea374(0x158)](),_0x3e879c=Math['floor'](Math[_0x5ea374(0x13b)](_0x211012)/0x3e8);if(_0x3e879c<0x3c)return _0x5ea374(0x16d);const _0x7abc6a=Math[_0x5ea374(0x18c)](_0x3e879c/0x3c);if(_0x7abc6a<0x3c)return _0x7abc6a+_0x5ea374(0x17f);const _0x1a491b=Math[_0x5ea374(0x18c)](_0x7abc6a/0x3c);if(_0x1a491b<0x18)return _0x1a491b+'h\x20ago';const _0xe85f88=Math['floor'](_0x1a491b/0x18);if(_0xe85f88<0x1e)return _0xe85f88+_0x5ea374(0x144);return Math[_0x5ea374(0x18c)](_0xe85f88/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x1d4acc(0x15d)]=a26_0x1d4acc(0x17a);[a26_0x1d4acc(0x164)]=a26_0x1d4acc(0x177);async[a26_0x1d4acc(0x182)](_0x5c472b){const _0x54b851=a26_0x1d4acc,{options:_0x5e5103,tdx:_0xb5e3d8}=_0x5c472b,_0x992dec=resolveLimit(_0x5e5103[_0x54b851(0x13e)],DEFAULT_DISPLAY_LIMIT),_0xc958bf=_0x5e5103['status'];_0x5e5103[_0x54b851(0x17d)]&&(console[_0x54b851(0x178)](_0x54b851(0x16f)+_0x992dec+_0x54b851(0x18d)),_0xc958bf&&console[_0x54b851(0x178)]('Status\x20filter:\x20'+_0xc958bf));const _0x1cb1ec=await withSpinner('Listing\x20jobs...',()=>_0xb5e3d8[_0x54b851(0x17a)][_0x54b851(0x157)]({'from':0x0,'to':_0x992dec-0x1,'status':_0xc958bf}),{'verbose':_0x5e5103[_0x54b851(0x17d)]}),_0x5a0fb8=_0x1cb1ec[_0x54b851(0x173)];console[_0x54b851(0x178)](_0x54b851(0x138)+_0x5a0fb8[_0x54b851(0x13f)]+_0x54b851(0x16e)+(_0x5a0fb8[_0x54b851(0x13f)]!==0x1?'s':''));const _0x279660=_0x5e5103[_0x54b851(0x153)];if(isStructuredFormat(_0x5e5103)){const _0x54f6cc=_0x5a0fb8[_0x54b851(0x15b)](_0x54911f=>{const _0x223a82=_0x54b851;let _0x1382f7;if(_0x54911f[_0x223a82(0x141)]&&_0x54911f[_0x223a82(0x187)]){const _0x457314=new Date(_0x54911f[_0x223a82(0x141)])[_0x223a82(0x158)](),_0x5c6d4c=new Date(_0x54911f[_0x223a82(0x187)])['getTime']();_0x1382f7=Math[_0x223a82(0x176)]((_0x5c6d4c-_0x457314)/0x3e8);}return{'job_id':_0x54911f[_0x223a82(0x13a)],'type':_0x54911f[_0x223a82(0x162)]===_0x223a82(0x180)?_0x223a82(0x139):_0x54911f[_0x223a82(0x162)],'status':_0x54911f[_0x223a82(0x136)],'user_name':_0x54911f[_0x223a82(0x169)],'duration_sec':_0x1382f7,'created_at':_0x54911f[_0x223a82(0x143)],'started_at':_0x54911f[_0x223a82(0x141)],'end_at':_0x54911f[_0x223a82(0x187)]};});await handleSDKOutput(_0x54f6cc,_0x5e5103);}else for(const _0x483843 of _0x5a0fb8){const _0x20e825=_0x483843['status']===_0x54b851(0x14a)?a26_0x196743[_0x54b851(0x188)]:_0x483843[_0x54b851(0x136)]===_0x54b851(0x178)?a26_0x196743[_0x54b851(0x14b)]:a26_0x196743['dim'],_0x2e5b31=_0x20e825(_0x483843[_0x54b851(0x136)]),_0x4cc779=getJobUrl(_0x279660,_0x483843['job_id']),_0x5f2d4d=hyperlink(_0x483843['job_id'],_0x4cc779),_0x399c2e=a26_0x196743[_0x54b851(0x18a)](_0x483843[_0x54b851(0x162)]===_0x54b851(0x180)?_0x54b851(0x139):_0x483843[_0x54b851(0x162)]),_0x21da98=[];if(_0x483843['start_at']&&_0x483843[_0x54b851(0x187)]){const _0x24836f=Math[_0x54b851(0x176)]((new Date(_0x483843[_0x54b851(0x187)])[_0x54b851(0x158)]()-new Date(_0x483843['start_at'])['getTime']())/0x3e8);_0x21da98[_0x54b851(0x13c)](formatDuration(_0x24836f));}if(_0x483843[_0x54b851(0x187)])_0x21da98[_0x54b851(0x13c)](formatRelativeTime(new Date(_0x483843['end_at'])));else _0x483843['start_at']&&_0x21da98[_0x54b851(0x13c)](formatRelativeTime(new Date(_0x483843[_0x54b851(0x141)])));const _0x5ebe89=_0x21da98[_0x54b851(0x13f)]>0x0?a26_0x196743['dim']('\x20'+_0x21da98[_0x54b851(0x163)](',\x20')):'';console[_0x54b851(0x166)]('⚡\x20'+_0x5f2d4d+'\x20'+_0x399c2e+'\x20'+_0x2e5b31+_0x5ebe89);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x1d4acc(0x15d)]='job:show';[a26_0x1d4acc(0x164)]='Show\x20job\x20details';[a26_0x1d4acc(0x140)](_0x1d3954){const _0x5f167e=a26_0x1d4acc,_0x277f3d=_0x1d3954['args'][0x0];if(!_0x277f3d)return _0x5f167e(0x167);return undefined;}async[a26_0x1d4acc(0x182)](_0x13f738){const _0x3d0494=a26_0x1d4acc,{options:_0x4b4e39,args:_0x19f642,tdx:_0x19ee30}=_0x13f738,_0x195974=_0x19f642[0x0],_0x2769d5=await withSpinner(_0x3d0494(0x14e),()=>_0x19ee30[_0x3d0494(0x17a)]['show'](_0x195974),{'verbose':_0x4b4e39[_0x3d0494(0x17d)]}),_0x47b5ff=_0x2769d5[_0x3d0494(0x173)];let _0xae7af6;if(_0x47b5ff[_0x3d0494(0x141)]&&_0x47b5ff[_0x3d0494(0x187)]){const _0xd23e1e=new Date(_0x47b5ff[_0x3d0494(0x141)])[_0x3d0494(0x158)](),_0x12451d=new Date(_0x47b5ff[_0x3d0494(0x187)])[_0x3d0494(0x158)]();_0xae7af6=Math[_0x3d0494(0x176)]((_0x12451d-_0xd23e1e)/0x3e8);}const _0x53ec39={'job_id':_0x47b5ff[_0x3d0494(0x13a)],'type':_0x47b5ff[_0x3d0494(0x162)],'status':_0x47b5ff[_0x3d0494(0x136)],..._0x47b5ff[_0x3d0494(0x169)]&&{'user_name':_0x47b5ff[_0x3d0494(0x169)]},..._0xae7af6!==undefined&&{'duration_sec':_0xae7af6},..._0x47b5ff[_0x3d0494(0x143)]&&{'created_at':_0x47b5ff[_0x3d0494(0x143)]},..._0x47b5ff['start_at']&&{'started_at':_0x47b5ff[_0x3d0494(0x141)]},..._0x47b5ff['end_at']&&{'end_at':_0x47b5ff['end_at']},..._0x47b5ff[_0x3d0494(0x161)]&&{'database':_0x47b5ff[_0x3d0494(0x161)]},..._0x47b5ff['priority']!==undefined&&{'priority':_0x47b5ff[_0x3d0494(0x17b)]},..._0x47b5ff[_0x3d0494(0x175)]&&{'url':_0x47b5ff[_0x3d0494(0x175)]},..._0x47b5ff['query']&&{'query':_0x47b5ff[_0x3d0494(0x146)]},..._0x47b5ff[_0x3d0494(0x150)]&&{'debug':_0x47b5ff['debug']}};return await handleSingleObjectOutput(_0x53ec39,_0x4b4e39),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x1d4acc(0x15d)]='job:kill';[a26_0x1d4acc(0x164)]=a26_0x1d4acc(0x14f);[a26_0x1d4acc(0x140)](_0x7301d5){const _0x43baf1=a26_0x1d4acc,_0x1e5345=_0x7301d5['args'][0x0];if(!_0x1e5345)return _0x43baf1(0x17e);return undefined;}async['execute'](_0x41ccbb){const _0x2488c9=a26_0x1d4acc,{options:_0x5b3e34,args:_0x2be1ed,tdx:_0x643143}=_0x41ccbb,_0x489d30=_0x2be1ed[0x0];if(!_0x5b3e34[_0x2488c9(0x159)]){const _0x25f1e2=await confirm(_0x2488c9(0x18b)+_0x489d30+'?');if(!_0x25f1e2)return console[_0x2488c9(0x178)](_0x2488c9(0x142)),0x0;}return await withSpinner(_0x2488c9(0x145),()=>_0x643143[_0x2488c9(0x17a)][_0x2488c9(0x14d)](_0x489d30),{'verbose':_0x5b3e34[_0x2488c9(0x17d)]}),console['error'](_0x2488c9(0x15a)+_0x489d30),console['error']('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x489d30+_0x2488c9(0x170)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x1d4acc(0x15d)]=a26_0x1d4acc(0x135);[a26_0x1d4acc(0x164)]=a26_0x1d4acc(0x174);async[a26_0x1d4acc(0x182)](_0x1d5afc){const _0x2451bd=a26_0x1d4acc,{options:_0x913978,args:_0x558ebc,tdx:_0x5c9c2f}=_0x1d5afc,_0x33c70e=_0x913978['jobType']||_0x2451bd(0x139),_0xb574be=_0x913978['file'],_0x2cb112=_0x913978[_0x2451bd(0x161)]||_0x2451bd(0x181),_0x5afbaa=_0x913978[_0x2451bd(0x160)];if(_0x33c70e!=='trino'&&_0x33c70e!==_0x2451bd(0x155))throw new SDKError(ErrorCode[_0x2451bd(0x148)],_0x2451bd(0x179));let _0x3d2d68;if(_0xb574be){if(_0x558ebc[0x0])throw new SDKError(ErrorCode[_0x2451bd(0x148)],_0x2451bd(0x16b));const _0x3626b9=readSqlStatementsFromFile(_0xb574be);if(_0x3626b9[_0x2451bd(0x13f)]===0x0)throw new SDKError(ErrorCode[_0x2451bd(0x148)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x3626b9[_0x2451bd(0x13f)]>0x1)throw new SDKError(ErrorCode[_0x2451bd(0x148)],_0x2451bd(0x149));_0x3d2d68=_0x3626b9[0x0];}else{if(!_0x558ebc[0x0])throw new SDKError(ErrorCode[_0x2451bd(0x148)],_0x2451bd(0x168));_0x3d2d68=_0x558ebc[0x0];}_0x913978[_0x2451bd(0x17d)]&&(console[_0x2451bd(0x178)]('Job\x20type:\x20'+_0x33c70e),console[_0x2451bd(0x178)](_0x2451bd(0x172)+_0x2cb112),console[_0x2451bd(0x178)](_0x2451bd(0x154)+_0x3d2d68[_0x2451bd(0x183)](0x0,0x64)+(_0x3d2d68[_0x2451bd(0x13f)]>0x64?_0x2451bd(0x184):'')));const _0x4f5489=await withSpinner(_0x2451bd(0x17c),()=>_0x5c9c2f[_0x2451bd(0x17a)][_0x2451bd(0x151)](_0x2cb112,_0x3d2d68,_0x33c70e,_0x5afbaa),{'verbose':_0x913978[_0x2451bd(0x17d)]}),_0x4ddb35=_0x4f5489[_0x2451bd(0x173)];return console['error'](_0x2451bd(0x189)),console[_0x2451bd(0x178)](_0x2451bd(0x171)+_0x4ddb35[_0x2451bd(0x13a)]),await handleSDKOutput([_0x4ddb35],_0x913978),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x1d4acc(0x15d)]='job:result';[a26_0x1d4acc(0x164)]=a26_0x1d4acc(0x15c);[a26_0x1d4acc(0x140)](_0x31b405){const _0x3e535d=a26_0x1d4acc,_0x16ebb1=_0x31b405[_0x3e535d(0x14c)][0x0];if(!_0x16ebb1)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x1d4acc(0x182)](_0x5e2721){const _0x4b409c=a26_0x1d4acc,{options:_0x4abbdc,args:_0x44ef63,tdx:_0x2ca436}=_0x5e2721,_0x162783=_0x44ef63[0x0],_0x6f25e8=await withSpinner(_0x4b409c(0x16a),()=>_0x2ca436[_0x4b409c(0x17a)][_0x4b409c(0x160)](_0x162783),{'verbose':_0x4abbdc[_0x4b409c(0x17d)]}),_0x338e99=_0x6f25e8['data'];return console[_0x4b409c(0x178)](_0x4b409c(0x156)+_0x338e99[_0x4b409c(0x13f)]+_0x4b409c(0x13d)+(_0x338e99[_0x4b409c(0x13f)]!==0x1?'s':'')),await handleSDKOutput(_0x338e99,_0x4abbdc),0x0;}}
@@ -1 +1 @@
1
- const a27_0x2f1e80=a27_0x26ca;(function(_0x5de078,_0x8a172a){const _0x59eb80=a27_0x26ca,_0xaf4d7d=_0x5de078();while(!![]){try{const _0x11be02=parseInt(_0x59eb80(0x14f))/0x1*(parseInt(_0x59eb80(0x19d))/0x2)+parseInt(_0x59eb80(0x1c6))/0x3+parseInt(_0x59eb80(0x18f))/0x4+-parseInt(_0x59eb80(0x181))/0x5+parseInt(_0x59eb80(0x192))/0x6*(parseInt(_0x59eb80(0xd9))/0x7)+-parseInt(_0x59eb80(0x170))/0x8+parseInt(_0x59eb80(0x186))/0x9*(-parseInt(_0x59eb80(0x183))/0xa);if(_0x11be02===_0x8a172a)break;else _0xaf4d7d['push'](_0xaf4d7d['shift']());}catch(_0x2c35f5){_0xaf4d7d['push'](_0xaf4d7d['shift']());}}}(a27_0x17c9,0xc55c2));import a27_0x1b29e0 from'chalk';import a27_0x3c39c9 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';function a27_0x26ca(_0x2e95f0,_0x155138){_0x2e95f0=_0x2e95f0-0xd2;const _0x17c932=a27_0x17c9();let _0x26ca9a=_0x17c932[_0x2e95f0];return _0x26ca9a;}import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x384a22){const _0x2bf945=a27_0x26ca;return!_0x384a22&&(console['error'](_0x2bf945(0x1c8)),console[_0x2bf945(0x164)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x384a22;}function withJsonFormat(_0x52fee9){const _0x31ad3e=a27_0x26ca;if(!_0x52fee9[_0x31ad3e(0x18e)]&&!_0x52fee9[_0x31ad3e(0x141)]&&!_0x52fee9[_0x31ad3e(0x1ba)]&&!_0x52fee9[_0x31ad3e(0x12d)])return{..._0x52fee9,'format':'json','json':!![]};return _0x52fee9;}function formatJourneyState(_0x31f7ea){const _0x474d17=a27_0x26ca;switch(_0x31f7ea){case _0x474d17(0x103):return a27_0x1b29e0[_0x474d17(0x174)](_0x474d17(0x189));case'draft':return a27_0x1b29e0['dim'](_0x474d17(0x13b));case _0x474d17(0xe9):return a27_0x1b29e0[_0x474d17(0xe7)](_0x474d17(0xf7));case _0x474d17(0x118):return a27_0x1b29e0[_0x474d17(0x148)](_0x474d17(0xf3));case _0x474d17(0x17e):return a27_0x1b29e0[_0x474d17(0x10d)](_0x474d17(0x116));default:return'('+_0x31f7ea+')';}}function formatJourneyItem(_0x5c4649,_0x210608='',_0x587e6c){const _0x4812b5=a27_0x26ca,_0x190cd0=formatJourneyState(_0x5c4649[_0x4812b5(0x104)]),_0x547a25=_0x587e6c?hyperlink(_0x5c4649[_0x4812b5(0xe4)],_0x587e6c):_0x5c4649['journeyBundleName'];return _0x210608+_0x4812b5(0x161)+_0x547a25+'\x20'+_0x190cd0;}function escapeRegex(_0x8c185){const _0x421c18=a27_0x26ca;return _0x8c185['replace'](/[.*+?^${}()|[\]\\]/g,_0x421c18(0x153));}function globToRegex(_0x14e549){const _0x1fe947=a27_0x26ca,_0x1d50c6=_0x14e549[_0x1fe947(0x1ca)]('*')[_0x1fe947(0x1d3)](escapeRegex);return new RegExp(_0x1d50c6[_0x1fe947(0x1b9)]('.*'),'i');}function a27_0x17c9(){const _0x3858a2=['Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','nodes','(root)','(draft)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20->\x20','Error:\x20Invalid\x20--type\x20\x22','enteredSize','Error:\x20--version\x20option\x20is\x20required','json','Export\x20journey(s)\x20as\x20YAML\x20files','has','errorCode','values','renderStats','getColumnMapping','blue','from','log','journey:pull','Fetching\x20parent\x20segment...','history','\x20unchanged\x20files','653fylguI','diff','message','tdx.json','\x5c$&','List\x20all\x20versions\x20of\x20a\x20journey','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','set','Listing\x20journey\x20activations...','\x20\x20Statistics\x20not\x20available','yes','toLowerCase','List\x20journeys\x20in\x20current\x20context','verbose','listActivationsFlat','Resuming\x20journey...','entries','journey:pause','🗺️\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Target\x20file:\x20','error','dryRun','createdAt','then','\x20(ID:\x20','setPhase','sort','\x22\x20resumed','content','Error:\x20Version\x20','Table:\x20','Resolved\x20YAML\x20file:\x20','4887888zDnBXz','helpText','journeyName','✔\x20Context\x20set:\x20','green','...','Fetching\x20','args','journey:resume','.yml','/e/','Cancelled','isNew','attributes','archived','site','Show\x20journey\x20details','385725lNKazB','filter','7301960DmFqqk','journeyBundleId','Options:','18PqGGxp','user','\x20(rule\x20match)','(running)','test','links','resolveJourneyId','Listing\x20journeys...','format','3450312lQqAno','journey:activations','segmentName','498PMoKrP','INVALID_ARGUMENT','\x20details...','absolutePath','name','/app/ps/','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Resume\x20a\x20paused\x20journey','/j/da/je','journey:versions','Parent\x20segment:\x20','1058ATtEJp','Pause\x20a\x20running\x20journey','\x20\x20-\x20','root\x20folder','find','\x20\x20Target:\x20','session','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Folder\x20path:\x20','resourceName','Journey\x20name:\x20','\x20versions)','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','no_parent','journey:version:view','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Error:\x20','resolveParentId','\x20journey\x20files\x20to\x20','✔\x20Pulled\x20','journey:list','\x20\x20Folder\x20path:\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','goalSize','exitOrJumpRate',',\x20version:\x20','Database:\x20','Aborted.','join','jsonl','completeMilestoneRate','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','all','Available\x20stages:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Getting\x20journey\x20traffic\x20data...','Listing\x20journey\x20versions...','filePath','red','description','base','1458894SJNzpe','journeyId','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x20(draft)\x20—\x20\x22','split','segment','stringify','Resolving\x20version...','versionNumber','\x20changed\x20files','\x0aPull\x20summary:','activation','✔\x20Journey\x20\x22','map','buildIdToEmailMap','📁\x20','getActivation','conversion','cyan','\x20new\x20files','columns','options','106484TSogLY','push','cwd','kind','buildIdToNameMap','\x20activation','Input:\x20','Error:\x20Invalid\x20version\x20number:\x20','segments','\x20journey','Resolving\x20parent\x20segment...','journeyBundleName','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Error:\x20Stage\x20\x22','yellow','rule','paused','parentSegment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parent_segment','localeCompare','journey','relative','hasChanges','\x20version','includeHistory','(completed)','journeys','folderPath','folderId','(paused)','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','createVersion','journey:version:create','\x20\x20Preserving\x20local\x20segment\x20name:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','get','connection','journey:view','exitOrJumpSize','Warning:\x20Could\x20not\x20resolve\x20activation\x20','launched','state','repeat','/j/da','version','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','getJourney','data','stage','journeyStages','dim','\x27\x20not\x20found\x20in\x20','parentName','add','Getting\x20journey\x20statistics...','reentryMode','\x22\x20not\x20found','listVersions','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','(archived)','getTrafficData','completed','bold','milestoneSize','Found\x20','\x0aError:','\x20journeys','size','connector_config','Show\x20journey\x20table\x20column\x20mapping','length','getParentFull','\x20=\x20','file','includeStats','type','getStatistics','database','Getting\x20version\x20','completionRate','activation_','stages','tsv','hasPeriod','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20Opening\x20','goal','execute','utf-8','updatedAt','Pattern:\x20','listFolders','journey:stats'];a27_0x17c9=function(){return _0x3858a2;};return a27_0x17c9();}function buildRuleToNameMapping(_0x166c68){const _0x4d68a8=a27_0x26ca,_0x4ad25c=new Map();if(_0x166c68[_0x4d68a8(0xe1)])for(const [_0x504b2a,_0x51d0eb]of Object['entries'](_0x166c68['segments'])){if(_0x51d0eb[_0x4d68a8(0xe8)]){const _0x355ab2=serializeRule(_0x51d0eb[_0x4d68a8(0xe8)]),_0x33e9e3=_0x4ad25c['get'](_0x355ab2);_0x33e9e3?_0x33e9e3[_0x4d68a8(0xda)](_0x504b2a):_0x4ad25c['set'](_0x355ab2,[_0x504b2a]);}}return _0x4ad25c;}async function resolveJourneyIdFromInput(_0x3ba86b,_0x245543,_0x2d995a){const _0x5dab9a=a27_0x26ca,_0x5411ad=await resolveJourneyTarget(_0x3ba86b,_0x245543[_0x5dab9a(0xea)],_0x245543[_0x5dab9a(0x15c)]),_0x2ad67c=_0x5411ad[_0x5dab9a(0xea)];if(!_0x2ad67c)throw new SDKError(ErrorCode[_0x5dab9a(0x193)],_0x5dab9a(0x1b3));const _0x3e6a10=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2d995a[_0x5dab9a(0x1cb)]['resolveParentId'](_0x2ad67c),{'verbose':_0x245543['verbose']}),_0x220922=_0x3e6a10['data'],_0x803775=await withSpinner('Resolving\x20journey...',()=>_0x2d995a[_0x5dab9a(0xee)][_0x5dab9a(0x18c)](_0x220922,_0x5411ad[_0x5dab9a(0x172)]),{'verbose':_0x245543[_0x5dab9a(0x15c)]});return{'journeyId':_0x803775[_0x5dab9a(0x10a)],'journeyName':_0x5411ad['journeyName'],'parentSegmentId':_0x220922};}async function resolveJourneyTarget(_0x2cc96d,_0x44e7c2,_0x4997bb){const _0x44a3b0=a27_0x26ca;if(isYamlFilePath(_0x2cc96d))try{const _0x47fb18=await resolveYamlFilePath(_0x2cc96d);return _0x4997bb&&(console[_0x44a3b0(0x164)](_0x44a3b0(0x16f)+_0x2cc96d),console[_0x44a3b0(0x164)]('\x20\x20Parent\x20segment:\x20'+_0x47fb18[_0x44a3b0(0xea)]),console[_0x44a3b0(0x164)]('\x20\x20Name:\x20'+_0x47fb18[_0x44a3b0(0x191)]),console['error'](_0x44a3b0(0x1b2)+(_0x47fb18[_0x44a3b0(0xf5)]||_0x44a3b0(0x13a)))),{'journeyName':_0x47fb18[_0x44a3b0(0x191)],'parentSegment':_0x47fb18['parentSegment'],'resolved':_0x47fb18};}catch(_0x227f6d){throw new SDKError(ErrorCode[_0x44a3b0(0x193)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x227f6d[_0x44a3b0(0x151)]);}if(!_0x44e7c2)throw new SDKError(ErrorCode[_0x44a3b0(0x193)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x2cc96d,'parentSegment':_0x44e7c2};}export class JourneyListCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0x1b1);[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0x15b);async[a27_0x2f1e80(0x132)](_0x2b059d){const _0x19ca20=a27_0x2f1e80,{options:_0x106e35,args:_0x432434,tdx:_0x55d270}=_0x2b059d,_0x4b5fe8=_0x432434[0x0],_0x3e26d8=_0x106e35['parentSegment'];if(!_0x3e26d8)return console[_0x19ca20(0x164)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x19ca20(0x164)](_0x19ca20(0x155)),0x1;const _0x373c66=await withSpinner(_0x19ca20(0xe3),()=>_0x55d270[_0x19ca20(0x1cb)][_0x19ca20(0x1ae)](_0x3e26d8),{'verbose':_0x106e35['verbose']}),_0x195c9b=_0x373c66[_0x19ca20(0x10a)];_0x106e35['verbose']&&(console[_0x19ca20(0x164)](_0x19ca20(0x19c)+_0x3e26d8+_0x19ca20(0x168)+_0x195c9b+')'),_0x4b5fe8&&console['error'](_0x19ca20(0x135)+_0x4b5fe8));const _0x34b156=await withSpinner(_0x19ca20(0x14c),()=>_0x55d270[_0x19ca20(0x1cb)][_0x19ca20(0x122)](_0x195c9b),{'verbose':_0x106e35[_0x19ca20(0x15c)]}),_0x162d12=_0x34b156[_0x19ca20(0x10a)],_0x2b47db=_0x162d12['rootFolderId'],_0x5403a2=await withSpinner(_0x19ca20(0x18d),()=>_0x55d270[_0x19ca20(0xee)]['listJourneysWithFolders'](_0x195c9b,_0x2b47db),{'verbose':_0x106e35[_0x19ca20(0x15c)]});let _0x56966f=_0x5403a2[_0x19ca20(0x10a)][_0x19ca20(0xf4)];const _0x43a562=_0x5403a2[_0x19ca20(0x10a)]['folders'],_0xe8f95=new Map();for(const _0x47d4c3 of _0x43a562){_0xe8f95['set'](_0x47d4c3['id'],_0x47d4c3[_0x19ca20(0x196)]);}if(_0x4b5fe8){const _0x1d1156=globToRegex(_0x4b5fe8);_0x56966f=_0x56966f[_0x19ca20(0x182)](_0x12f719=>_0x1d1156[_0x19ca20(0x18a)](_0x12f719[_0x19ca20(0xe4)]));}console['error']('✔\x20Found\x20'+_0x56966f[_0x19ca20(0x121)]+_0x19ca20(0xe2)+(_0x56966f[_0x19ca20(0x121)]!==0x1?'s':''));const _0x4f3fe1=_0x21281a=>{const _0x3b13a0=_0x19ca20;return getConsoleNextUrl(_0x106e35[_0x3b13a0(0x17f)],_0x3b13a0(0x197)+_0x195c9b+'/e/'+_0x21281a+_0x3b13a0(0x106));};if(_0x106e35['format']==='table')await handleSDKOutput(_0x56966f,_0x106e35);else{if(_0x106e35[_0x19ca20(0x18e)]===_0x19ca20(0x141)){const _0x35d13c=_0x56966f[_0x19ca20(0x1d3)](_0x130b31=>({..._0x130b31,'url':_0x4f3fe1(_0x130b31['id'])}));await handleSDKOutput(_0x35d13c,_0x106e35);}else{console[_0x19ca20(0x14a)]('['+_0x3e26d8+']');const _0x239bd4=new Map(),_0x2c9674=[];for(const _0x25221f of _0x56966f){if(!_0x25221f[_0x19ca20(0xf6)]||_0x25221f[_0x19ca20(0xf6)]===_0x2b47db)_0x2c9674['push'](_0x25221f);else{const _0x416c31=_0x239bd4[_0x19ca20(0xfe)](_0x25221f['folderId'])||[];_0x416c31[_0x19ca20(0xda)](_0x25221f),_0x239bd4[_0x19ca20(0x156)](_0x25221f[_0x19ca20(0xf6)],_0x416c31);}}const _0x45ac76=(_0x489c7a,_0x10b43e)=>_0x489c7a[_0x19ca20(0xe4)][_0x19ca20(0xed)](_0x10b43e[_0x19ca20(0xe4)],undefined,{'sensitivity':_0x19ca20(0x1c5)});_0x2c9674[_0x19ca20(0x16a)](_0x45ac76);for(const _0xce9b37 of _0x2c9674){console['log'](formatJourneyItem(_0xce9b37,'',_0x4f3fe1(_0xce9b37['id'])));}const _0x1c61fd=[..._0x239bd4[_0x19ca20(0x15f)]()][_0x19ca20(0x16a)]((_0x383a3c,_0x27791c)=>{const _0x4fbecc=_0x19ca20,_0x434372=_0xe8f95[_0x4fbecc(0xfe)](_0x383a3c[0x0])||_0x383a3c[0x0],_0x5571bb=_0xe8f95[_0x4fbecc(0xfe)](_0x27791c[0x0])||_0x27791c[0x0];return _0x434372[_0x4fbecc(0xed)](_0x5571bb,undefined,{'sensitivity':_0x4fbecc(0x1c5)});});for(const [_0x46ad79,_0x44145b]of _0x1c61fd){const _0x554b23=_0xe8f95[_0x19ca20(0xfe)](_0x46ad79)||_0x46ad79;console[_0x19ca20(0x14a)](_0x19ca20(0xd2)+_0x554b23),_0x44145b[_0x19ca20(0x16a)](_0x45ac76);for(const _0x88a143 of _0x44145b){console['log'](formatJourneyItem(_0x88a143,'\x20\x20',_0x4f3fe1(_0x88a143['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0x100);['description']=a27_0x2f1e80(0x180);async['execute'](_0x598274){const _0x45eb57=a27_0x2f1e80,{options:_0x5c1fdd,args:_0x117fc4,tdx:_0x2b3288}=_0x598274,_0x3c23d6=_0x117fc4[0x0];if(!_0x3c23d6)return console['error'](_0x45eb57(0x1c8)),console[_0x45eb57(0x164)](_0x45eb57(0x1bc)),console[_0x45eb57(0x164)](_0x45eb57(0x185)),console[_0x45eb57(0x164)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x5c1fdd['verbose']&&console[_0x45eb57(0x164)](_0x45eb57(0xdf)+_0x3c23d6);const {journeyId:_0x5c5b6e,parentSegmentId:_0x5d83f7}=await resolveJourneyIdFromInput(_0x3c23d6,_0x5c1fdd,_0x2b3288);if(_0x5c1fdd['web']){const _0x35c496=getConsoleNextUrl(_0x5c1fdd[_0x45eb57(0x17f)],_0x45eb57(0x197)+_0x5d83f7+_0x45eb57(0x17a)+_0x5c5b6e+'/j/da/je');return console[_0x45eb57(0x164)](a27_0x1b29e0['green']('✔')+_0x45eb57(0x130)+a27_0x1b29e0[_0x45eb57(0xd5)](_0x35c496)),openBrowser(_0x35c496),0x0;}const _0x3da9a7=await withSpinner('Getting\x20journey\x20details...',()=>_0x2b3288['journey'][_0x45eb57(0x109)](_0x5c5b6e),{'verbose':_0x5c1fdd[_0x45eb57(0x15c)]}),_0x214b8e=_0x3da9a7[_0x45eb57(0x10a)],_0x51b651=_0x5c1fdd[_0x45eb57(0x125)];let _0x25513a;if(_0x51b651)try{const _0x7aa8af=await withSpinner(_0x45eb57(0x111),()=>_0x2b3288[_0x45eb57(0xee)][_0x45eb57(0x127)](_0x5c5b6e),{'verbose':_0x5c1fdd[_0x45eb57(0x15c)]});_0x25513a=_0x7aa8af[_0x45eb57(0x10a)];}catch{_0x5c1fdd[_0x45eb57(0x15c)]&&console[_0x45eb57(0x164)](_0x45eb57(0x158));}const _0x43863b=getConsoleNextUrl(_0x5c1fdd[_0x45eb57(0x17f)],'/app/ps/'+_0x5d83f7+_0x45eb57(0x17a)+_0x5c5b6e+'/j/da/je'),_0x237b0f={'id':_0x214b8e['id'],'name':_0x214b8e['attributes'][_0x45eb57(0x196)],'description':_0x214b8e[_0x45eb57(0x17d)][_0x45eb57(0x1c4)],'state':_0x214b8e['attributes'][_0x45eb57(0x104)],'paused':_0x214b8e['attributes'][_0x45eb57(0xe9)],'reentry_mode':_0x214b8e[_0x45eb57(0x17d)][_0x45eb57(0x112)],'stages':_0x214b8e['attributes'][_0x45eb57(0x10c)]?.[_0x45eb57(0x121)]||0x0,..._0x214b8e[_0x45eb57(0x17d)][_0x45eb57(0x131)]&&{'goal':_0x214b8e[_0x45eb57(0x17d)][_0x45eb57(0x131)][_0x45eb57(0x196)]},..._0x25513a&&{'statistics':{'size':_0x25513a[_0x45eb57(0x11e)],'entered':_0x25513a[_0x45eb57(0x13f)],'goal_achieved':_0x25513a[_0x45eb57(0x1b4)],'completion_rate':_0x25513a[_0x45eb57(0x12a)],'exit_or_jump':_0x25513a[_0x45eb57(0x101)],'exit_or_jump_rate':_0x25513a[_0x45eb57(0x1b5)],'stages':_0x25513a[_0x45eb57(0x12c)]}},'url':_0x43863b};return await handleSingleObjectOutput(_0x237b0f,_0x5c1fdd),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0x137);[a27_0x2f1e80(0x1c4)]='Show\x20journey\x20statistics';async[a27_0x2f1e80(0x132)](_0x4e6cfa){const _0x66eb0=a27_0x2f1e80,{options:_0x2d1b8f,args:_0x2f2739,tdx:_0x444b58}=_0x4e6cfa,_0x2cb974=_0x2f2739[0x0];if(!requireNameOrPath(_0x2cb974))return 0x1;_0x2d1b8f['verbose']&&console[_0x66eb0(0x164)]('Input:\x20'+_0x2cb974);const _0x38de8d=_0x2d1b8f,_0x3edb7a=_0x38de8d[_0x66eb0(0x149)],_0x2fef97=_0x38de8d['to'],_0x4c5eef=_0x38de8d['includeHistory'],_0x45bc9c=_0x38de8d[_0x66eb0(0x10b)];_0x4c5eef&&!_0x3edb7a&&!_0x2fef97&&console[_0x66eb0(0x164)](_0x66eb0(0x1ac));const _0x44d0fc=_0x4c5eef?withJsonFormat(_0x2d1b8f):_0x2d1b8f,{journeyId:_0x2c1480,journeyName:_0x27441f}=await resolveJourneyIdFromInput(_0x2cb974,_0x44d0fc,_0x444b58),_0x491a2f=_0x3edb7a||_0x2fef97?{'from':_0x3edb7a,'to':_0x2fef97}:undefined,_0x564bae=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise['all']([_0x444b58['journey'][_0x66eb0(0x109)](_0x2c1480),_0x444b58[_0x66eb0(0xee)][_0x66eb0(0x127)](_0x2c1480,_0x491a2f)]),{'verbose':_0x44d0fc['verbose']}),[_0x42efa3,_0x42322c]=_0x564bae[_0x66eb0(0x10a)];if(!_0x42322c||_0x42322c[_0x66eb0(0x1c7)]===null)return console[_0x66eb0(0x164)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x27441f),console[_0x66eb0(0x164)](_0x66eb0(0xf8)),0x0;const _0xba8222=buildStageNameMap(_0x42efa3),_0x4c6c8a=!!(_0x491a2f&&_0x42322c[_0x66eb0(0x14d)]?.[_0x66eb0(0x121)]),_0x45d0b0={'stageNameMap':_0xba8222,'hasPeriod':_0x4c6c8a,'includeHistory':!!_0x4c5eef};if(_0x45bc9c&&_0x42322c['stages']){const _0x3879a5=_0x42322c['stages']['find'](_0x2e1b3f=>{const _0x490ec1=_0x66eb0,_0x23915a=_0xba8222[_0x490ec1(0xfe)](_0x2e1b3f['id'])??'';return _0x23915a[_0x490ec1(0x15a)]()===_0x45bc9c[_0x490ec1(0x15a)]();});if(_0x3879a5)return await handleSingleObjectOutput(formatStageStats(_0x3879a5,_0x45d0b0),_0x44d0fc),0x0;const _0x5f0256=_0x42322c[_0x66eb0(0x12c)][_0x66eb0(0x1d3)](_0x119994=>_0xba8222[_0x66eb0(0xfe)](_0x119994['id'])??_0x119994['id']);return console[_0x66eb0(0x164)](_0x66eb0(0xe6)+_0x45bc9c+_0x66eb0(0x113)),console[_0x66eb0(0x164)](_0x66eb0(0x1be)+_0x5f0256[_0x66eb0(0x1b9)](',\x20')),0x1;}const _0x269be0=_0x42322c[_0x66eb0(0x12c)]?.[_0x66eb0(0x1d3)](_0x1804fe=>formatStageStats(_0x1804fe,_0x45d0b0)),_0x20f4d4=assembleJourneyStats(_0x42322c,{'from':_0x3edb7a,'to':_0x2fef97,'includeHistory':_0x4c5eef});return await this[_0x66eb0(0x146)](_0x20f4d4,_0x269be0??[],_0x44d0fc),0x0;}async[a27_0x2f1e80(0x146)](_0x5697bc,_0x34bfe4,_0x895f2a){const _0x4cb734=a27_0x2f1e80,_0x106a38=_0x895f2a[_0x4cb734(0x18e)]===_0x4cb734(0x141)||_0x895f2a[_0x4cb734(0x18e)]===_0x4cb734(0x1ba)||_0x895f2a['json']||_0x895f2a[_0x4cb734(0x1ba)];if(_0x106a38){_0x5697bc['stages']=_0x34bfe4,await handleSingleObjectOutput(_0x5697bc,_0x895f2a);return;}await handleSingleObjectOutput(_0x5697bc,_0x895f2a);for(const _0x27c0af of _0x34bfe4){console[_0x4cb734(0x14a)](''),console['log'](String(a27_0x1b29e0[_0x4cb734(0xd5)][_0x4cb734(0x119)]('['+_0x27c0af[_0x4cb734(0x196)]+']'))+a27_0x1b29e0[_0x4cb734(0x10d)]('\x20'+_0x27c0af['id']));const {id:_0x381c3a,name:_0x488ea4,..._0x42b1d6}=_0x27c0af;await handleSingleObjectOutput(_0x42b1d6,_0x895f2a);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x2f1e80(0x196)]='journey:traffic';['description']='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a27_0x2f1e80(0x132)](_0x480ece){const _0x1a8ec0=a27_0x2f1e80,{options:_0x4ba525,args:_0x2bd354,tdx:_0x500b60}=_0x480ece,_0x1d2c2c=_0x2bd354[0x0];if(!requireNameOrPath(_0x1d2c2c))return 0x1;_0x4ba525[_0x1a8ec0(0x15c)]&&console['error'](_0x1a8ec0(0xdf)+_0x1d2c2c);const _0x2e2791=_0x4ba525,_0x455cac=_0x2e2791[_0x1a8ec0(0x126)],_0x5d0aa4=_0x2e2791[_0x1a8ec0(0x149)],_0x1dd8b8=_0x2e2791['to'],_0xe275ec=_0x2e2791['limit'];if(_0x455cac&&_0x455cac!=='conversion'&&_0x455cac!==_0x1a8ec0(0x1d1))return console[_0x1a8ec0(0x164)](_0x1a8ec0(0x13e)+_0x455cac+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x1d4ca3=withJsonFormat(_0x4ba525),{journeyId:_0x16d0ae,journeyName:_0x174187}=await resolveJourneyIdFromInput(_0x1d2c2c,_0x1d4ca3,_0x500b60),_0x13d94c={'type':_0x455cac,'from':_0x5d0aa4,'to':_0x1dd8b8,'limit':_0xe275ec},_0x846f1a=await withSpinner(_0x1a8ec0(0x1c0),()=>_0x500b60[_0x1a8ec0(0xee)][_0x1a8ec0(0x117)](_0x16d0ae,_0x13d94c),{'verbose':_0x1d4ca3[_0x1a8ec0(0x15c)]}),_0x4e7309=_0x846f1a[_0x1a8ec0(0x10a)],_0x52490a=_0x4e7309[_0x1a8ec0(0xd4)]&&(_0x4e7309['conversion'][_0x1a8ec0(0x139)]['length']>0x0||_0x4e7309[_0x1a8ec0(0xd4)][_0x1a8ec0(0x18b)][_0x1a8ec0(0x121)]>0x0),_0x39cd7a=_0x4e7309[_0x1a8ec0(0x1d1)]&&_0x4e7309[_0x1a8ec0(0x1d1)][_0x1a8ec0(0x121)]>0x0;if(!_0x52490a&&!_0x39cd7a)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x174187),console[_0x1a8ec0(0x164)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x5d0aa4&&_0x1dd8b8&&console[_0x1a8ec0(0x164)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x4e7309,_0x1d4ca3),0x0;}}function formatStageStats(_0x36aa4c,_0x19f704){const _0x394a9d=a27_0x2f1e80,_0xaed72a=_0x19f704['hasPeriod']&&_0x36aa4c[_0x394a9d(0x14d)]?.['length']?aggregateStageHistory(_0x36aa4c['history']):{'size':_0x36aa4c[_0x394a9d(0x11e)],'entered':_0x36aa4c[_0x394a9d(0x13f)],'milestone':_0x36aa4c[_0x394a9d(0x11a)],'milestone_rate':_0x36aa4c[_0x394a9d(0x1bb)],'exit_or_jump':_0x36aa4c[_0x394a9d(0x101)],'exit_or_jump_rate':_0x36aa4c['exitOrJumpRate']},_0x56f048={'id':_0x36aa4c['id'],'name':_0x19f704['stageNameMap'][_0x394a9d(0xfe)](_0x36aa4c['id'])??_0x36aa4c['id'],..._0xaed72a};return _0x19f704[_0x394a9d(0x12e)]&&_0x19f704[_0x394a9d(0xf2)]&&_0x36aa4c[_0x394a9d(0x14d)]&&(_0x56f048[_0x394a9d(0x14d)]=_0x36aa4c[_0x394a9d(0x14d)]),_0x56f048;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x2f1e80(0x160);['description']=a27_0x2f1e80(0x19e);async[a27_0x2f1e80(0x132)](_0x4b05d1){const _0x5ba8b9=a27_0x2f1e80,{options:_0x5156e8,args:_0x2ea4a2,tdx:_0x45e672}=_0x4b05d1,_0x485159=_0x2ea4a2[0x0];if(!requireNameOrPath(_0x485159))return 0x1;_0x5156e8['verbose']&&console[_0x5ba8b9(0x164)]('Input:\x20'+_0x485159);const {journeyId:_0x3cc869,journeyName:_0x236a01}=await resolveJourneyIdFromInput(_0x485159,_0x5156e8,_0x45e672);if(!_0x5156e8[_0x5ba8b9(0x159)]){const _0x5d427a=await confirm(_0x5ba8b9(0x162)+_0x236a01+'\x22?');if(!_0x5d427a)return console['error'](_0x5ba8b9(0x17b)),0x0;}const _0x2b84b8=await withSpinner('Pausing\x20journey...',()=>_0x45e672[_0x5ba8b9(0xee)]['pause'](_0x3cc869),{'verbose':_0x5156e8[_0x5ba8b9(0x15c)]}),_0xa32607=_0x2b84b8[_0x5ba8b9(0x10a)];return console['error'](_0x5ba8b9(0x1d2)+_0xa32607[_0x5ba8b9(0x17d)]['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x2f1e80(0x178);['description']=a27_0x2f1e80(0x199);async['execute'](_0x4559b1){const _0x485b54=a27_0x2f1e80,{options:_0x159c19,args:_0x5482f6,tdx:_0xffcb2f}=_0x4559b1,_0x9479aa=_0x5482f6[0x0];if(!requireNameOrPath(_0x9479aa))return 0x1;_0x159c19[_0x485b54(0x15c)]&&console[_0x485b54(0x164)](_0x485b54(0xdf)+_0x9479aa);const {journeyId:_0x113870,journeyName:_0x274de2}=await resolveJourneyIdFromInput(_0x9479aa,_0x159c19,_0xffcb2f);if(!_0x159c19[_0x485b54(0x159)]){const _0x55ff85=await confirm(_0x485b54(0x1bf)+_0x274de2+'\x22?');if(!_0x55ff85)return console[_0x485b54(0x164)]('Cancelled'),0x0;}const _0x2a7195=await withSpinner(_0x485b54(0x15e),()=>_0xffcb2f[_0x485b54(0xee)]['resume'](_0x113870),{'verbose':_0x159c19[_0x485b54(0x15c)]}),_0x7daa4a=_0x2a7195['data'];return console['error'](_0x485b54(0x1d2)+_0x7daa4a[_0x485b54(0x17d)][_0x485b54(0x196)]+_0x485b54(0x16b)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x2f1e80(0x14b);[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0x142);async['execute'](_0x2fb07d){const _0xfa7c4c=a27_0x2f1e80,{options:_0x38dd94,args:_0x81e63c,tdx:_0x122e52}=_0x2fb07d,_0x3287c3=_0x38dd94,_0xe743ab=_0x81e63c[0x0],_0x380de7=_0xe743ab&&isYamlFilePath(_0xe743ab),_0x4e1865=await resolveTarget({'arg':_0x380de7?_0xe743ab:undefined,'contextParent':_0x38dd94['parentSegment'],'cwd':process[_0xfa7c4c(0xdb)]()});if(!isSuccessfulResolution(_0x4e1865))return _0x4e1865[_0xfa7c4c(0x144)]===_0xfa7c4c(0x1aa)?(console[_0xfa7c4c(0x164)](a27_0x1b29e0[_0xfa7c4c(0xe7)](_0xfa7c4c(0xfc))),console[_0xfa7c4c(0x164)]('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[_0xfa7c4c(0x164)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0xfa7c4c(0xe5)),console[_0xfa7c4c(0x164)](_0xfa7c4c(0x13c))):(console['error'](a27_0x1b29e0['red'](_0xfa7c4c(0x1ad)+_0x4e1865[_0xfa7c4c(0x151)]+'\x0a')),_0x4e1865['helpText']&&console['error'](a27_0x1b29e0[_0xfa7c4c(0xd5)](_0x4e1865[_0xfa7c4c(0x171)]))),0x1;let _0x5b2180=_0x380de7?undefined:_0xe743ab,_0x2cb958,_0xb11b9b;_0x4e1865[_0xfa7c4c(0x126)]===_0xfa7c4c(0x124)&&(_0x5b2180=_0x4e1865[_0xfa7c4c(0x1a6)],_0x2cb958=_0x4e1865[_0xfa7c4c(0x1c2)],_0xb11b9b=_0x4e1865[_0xfa7c4c(0xf5)]);const _0x29eda6=_0x4e1865[_0xfa7c4c(0x10f)],_0x3704b4=_0x4e1865['targetDir'];_0x3287c3[_0xfa7c4c(0x15c)]&&(console[_0xfa7c4c(0x164)](_0xfa7c4c(0x19c)+_0x29eda6),console['error']('Target\x20directory:\x20'+_0x3704b4),_0x5b2180&&console[_0xfa7c4c(0x164)](_0xfa7c4c(0x1a7)+_0x5b2180),_0x2cb958&&console['error'](_0xfa7c4c(0x163)+_0x2cb958),_0xb11b9b&&console[_0xfa7c4c(0x164)](_0xfa7c4c(0x1a5)+_0xb11b9b));const _0x1ce0b8=await withSpinner(_0xfa7c4c(0xe3),()=>_0x122e52['segment'][_0xfa7c4c(0x1ae)](_0x29eda6),{'verbose':_0x38dd94['verbose']}),_0x32a982=_0x1ce0b8[_0xfa7c4c(0x10a)],{journeys:_0x3a83c0,folders:_0x44332b}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x773cb5=_0xfa7c4c,[_0x5cf6b8,_0x23905b]=await Promise[_0x773cb5(0x1bd)]([_0x122e52['journey']['listJourneysFromParentSegment'](_0x32a982,undefined,{'includeAllVersions':!![]}),_0x122e52[_0x773cb5(0x1cb)][_0x773cb5(0x136)](_0x32a982)]);return{'journeys':_0x5cf6b8,'folders':_0x23905b};},{'verbose':_0x38dd94['verbose']})[_0xfa7c4c(0x167)](_0x4d5bad=>_0x4d5bad[_0xfa7c4c(0x10a)]);let _0x3be400=_0x3a83c0;const _0x42f16d=buildFolderIdToPathMap(_0x44332b);if(_0x5b2180){const _0x1dbfc3=_0x3be400['filter'](_0x510aff=>_0x510aff[_0xfa7c4c(0xe4)][_0xfa7c4c(0x15a)]()===_0x5b2180[_0xfa7c4c(0x15a)]());if(_0x1dbfc3[_0xfa7c4c(0x121)]===0x0)return console[_0xfa7c4c(0x164)]('Error:\x20Journey\x20not\x20found:\x20'+_0x5b2180),console[_0xfa7c4c(0x164)](_0xfa7c4c(0x1a4)),0x1;_0x3be400=_0x1dbfc3;}if(_0xb11b9b!==undefined){const _0x2fbef2=_0x3be400['filter'](_0x43f496=>{const _0x519f73=_0xfa7c4c,_0x543b62=_0x43f496[_0x519f73(0xf6)]?_0x42f16d[_0x519f73(0xfe)](_0x43f496[_0x519f73(0xf6)])||'':'';return _0x543b62===_0xb11b9b;});if(_0x2fbef2[_0xfa7c4c(0x121)]===0x0&&_0x3be400[_0xfa7c4c(0x121)]>0x0){console[_0xfa7c4c(0x164)]('Error:\x20Journey\x20\x27'+_0x5b2180+_0xfa7c4c(0x10e)+(_0xb11b9b||_0xfa7c4c(0x1a0))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x2f11a3 of _0x3be400){const _0x5554f4=_0x2f11a3[_0xfa7c4c(0xf6)]?_0x42f16d[_0xfa7c4c(0xfe)](_0x2f11a3['folderId'])||'':'';console[_0xfa7c4c(0x164)](_0xfa7c4c(0x19f)+(_0x5554f4||_0xfa7c4c(0x13a))+'/'+_0x2f11a3[_0xfa7c4c(0xe4)]);}return 0x1;}_0x3be400=_0x2fbef2;}if(_0x3be400[_0xfa7c4c(0x121)]===0x0)return console[_0xfa7c4c(0x164)]('No\x20journeys\x20found'),0x0;const _0x532008=new Map();for(const _0x154e72 of _0x3be400){const _0x165ea1=_0x154e72['journeyBundleId'];!_0x532008[_0xfa7c4c(0x143)](_0x165ea1)&&_0x532008[_0xfa7c4c(0x156)](_0x165ea1,[]),_0x532008[_0xfa7c4c(0xfe)](_0x165ea1)['push'](_0x154e72);}for(const _0x4b719e of _0x532008[_0xfa7c4c(0x145)]()){_0x4b719e[_0xfa7c4c(0x16a)]((_0x58cae7,_0x22ae76)=>(_0x58cae7[_0xfa7c4c(0x1ce)]||0x0)-(_0x22ae76['versionNumber']||0x0));}const _0x58d5aa=[],{idToEmailMap:_0x29a3b9,connectionIdToNameMap:_0x51909c}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x2155ea=_0xfa7c4c,[_0x2f32d4,_0x3e520b]=await Promise[_0x2155ea(0x1bd)]([_0x122e52[_0x2155ea(0x187)][_0x2155ea(0x1d4)](),_0x122e52['connection'][_0x2155ea(0xdd)]()]);return{'idToEmailMap':_0x2f32d4,'connectionIdToNameMap':_0x3e520b};},{'verbose':_0x38dd94[_0xfa7c4c(0x15c)]})[_0xfa7c4c(0x167)](_0xdf6699=>_0xdf6699[_0xfa7c4c(0x10a)]);for(const _0x3a1fa5 of _0x532008[_0xfa7c4c(0x145)]()){const _0x16c08d=_0x3a1fa5[0x0][_0xfa7c4c(0xe4)],_0x312e14=_0x3a1fa5[0x0][_0xfa7c4c(0xf6)],_0x58fc58=_0x312e14?_0x42f16d[_0xfa7c4c(0xfe)](_0x312e14)||'':'',_0x3fc829=_0x58fc58?a27_0x3c39c9[_0xfa7c4c(0x1b9)](_0x3704b4,_0x58fc58):_0x3704b4,_0x144481=_0x2cb958||a27_0x3c39c9['join'](_0x3fc829,sanitizeFileName(_0x16c08d)+'.yml');let _0x5962f0,_0x163461;if(existsSync(_0x144481))try{const _0x42409c=readFileSync(_0x144481,_0xfa7c4c(0x133)),_0x16cf5a=parseYamlString(_0x42409c);_0x163461=_0x16cf5a,_0x5962f0=buildRuleToNameMapping(_0x16cf5a),_0x3287c3['verbose']&&_0x5962f0['size']>0x0&&console[_0xfa7c4c(0x164)]('Found\x20'+_0x5962f0[_0xfa7c4c(0x11e)]+_0xfa7c4c(0x108)+_0x16c08d);}catch(_0x6c84e1){_0x3287c3[_0xfa7c4c(0x15c)]&&console[_0xfa7c4c(0x164)](_0xfa7c4c(0x1a9)+_0x6c84e1['message']);}const _0x2caf33=[],_0x2ae4df=new Set(),_0x10cae6=new Map(),_0x562543=new Map(),_0x43582b=new Set(),_0x416e71=new Map(),_0x47e980=new Map(),_0x9c93a8=createJumpTargetCache();await withProgressSpinner(_0xfa7c4c(0x176)+_0x16c08d+_0xfa7c4c(0x175),async _0x918963=>{const _0x2044f9=_0xfa7c4c;for(const _0x43f728 of _0x3a1fa5){const _0x35d4bf=_0x3a1fa5['length']>0x1?_0x43f728[_0x2044f9(0xe4)]+'\x20v'+(_0x43f728[_0x2044f9(0x1ce)]||0x1):_0x43f728[_0x2044f9(0xe4)];_0x918963[_0x2044f9(0x169)](_0x2044f9(0x176)+_0x35d4bf);const _0x30ee70=await _0x122e52[_0x2044f9(0xee)]['getJourney'](_0x43f728['id']),_0x693d3d=_0x30ee70[_0x2044f9(0x17d)]?.['audienceId'],_0xdb47ef={'resolveSegment':async _0x17541a=>{const _0x1b0338=_0x2044f9;if(!_0x693d3d)return{'name':_0x17541a,'isJourneyLocal':![]};const _0x2c24c6=_0x10cae6['get'](_0x17541a);if(_0x2c24c6)return _0x2c24c6;try{const _0x3a38ed=await _0x122e52[_0x1b0338(0x1cb)]['getSegment'](_0x693d3d,_0x17541a),_0x149638=_0x3a38ed[_0x1b0338(0xdc)]===SEGMENT_KIND_JOURNEY;let _0x3a12e2,_0x1519a0=_0x3a38ed['name'];if(_0x149638&&_0x3a38ed[_0x1b0338(0xe8)]){const _0x245db4=await segmentResponseToDef(_0x3a38ed,{'resolveSegmentName':async _0x369320=>{const _0x1de9a1=_0x1b0338,_0xf04a9d=_0x10cae6[_0x1de9a1(0xfe)](_0x369320);if(_0xf04a9d)return _0xf04a9d['name'];const _0x19b696=await _0xdb47ef['resolveSegment'](_0x369320);return _0x19b696[_0x1de9a1(0x196)];}}),_0x563691=_0x245db4['rule'];_0x3a12e2={'description':_0x3a38ed[_0x1b0338(0x1c4)],'rule':_0x563691};const _0x4fa993=serializeRule(_0x563691),_0x2f7c2c=_0x562543[_0x1b0338(0xfe)](_0x4fa993);if(_0x2f7c2c)_0x1519a0=_0x2f7c2c,_0x3a12e2=undefined,_0x3287c3[_0x1b0338(0x15c)]&&console[_0x1b0338(0x164)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x3a38ed[_0x1b0338(0x196)]+_0x1b0338(0x13d)+_0x2f7c2c);else{let _0x356583=![];if(_0x5962f0){const _0x4b96a2=_0x5962f0[_0x1b0338(0xfe)](_0x4fa993);if(_0x4b96a2){const _0x575273=_0x4b96a2[_0x1b0338(0x1a1)](_0xbb68bf=>!_0x2ae4df[_0x1b0338(0x143)](_0xbb68bf));_0x575273&&(_0x1519a0=_0x575273,_0x2ae4df[_0x1b0338(0x110)](_0x575273),_0x562543[_0x1b0338(0x156)](_0x4fa993,_0x575273),_0x356583=!![],_0x3287c3['verbose']&&console['error'](_0x1b0338(0xfb)+_0x575273+_0x1b0338(0x188)));}}if(!_0x356583){const _0x3a749b=generateJourneyLocalName(_0x3a38ed[_0x1b0338(0x196)]);_0x3a749b&&(_0x1519a0=_0x3a749b);let _0x303591=_0x1519a0,_0x4c47d9=0x2;while(_0x2ae4df[_0x1b0338(0x143)](_0x303591)){_0x303591=_0x1519a0+'_'+_0x4c47d9,_0x4c47d9++;}_0x2ae4df['add'](_0x303591),_0x562543[_0x1b0338(0x156)](_0x4fa993,_0x303591),_0x1519a0=_0x303591;}}}const _0x146d46={'name':_0x1519a0,'isJourneyLocal':_0x149638,'definition':_0x3a12e2};return _0x10cae6[_0x1b0338(0x156)](_0x17541a,_0x146d46),_0x146d46;}catch(_0x544ff6){return _0x38dd94['verbose']&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x17541a+':\x20'+_0x544ff6[_0x1b0338(0x151)]),{'name':_0x17541a,'isJourneyLocal':![]};}},'resolveActivation':async _0x30a716=>{const _0x2a5f8c=_0x2044f9,_0x46d205=_0x416e71[_0x2a5f8c(0xfe)](_0x30a716);if(_0x46d205)return _0x46d205;try{const _0x471b72=await _0x122e52[_0x2a5f8c(0xee)][_0x2a5f8c(0xd3)](_0x43f728['id'],_0x30a716),_0x52fc04=journeyActivationStepToYaml(_0x471b72,_0x29a3b9,_0x51909c),_0x578d35=JSON[_0x2a5f8c(0x1cc)]({'name':_0x52fc04[_0x2a5f8c(0x196)],'connection':_0x52fc04[_0x2a5f8c(0xff)],'connector_config':_0x52fc04[_0x2a5f8c(0x11f)]}),_0x3fc802=_0x47e980[_0x2a5f8c(0xfe)](_0x578d35);if(_0x3fc802){const _0x56919a={'name':_0x3fc802,'isJourneyLocal':!![],'definition':_0x52fc04};return _0x416e71[_0x2a5f8c(0x156)](_0x30a716,_0x56919a),_0x56919a;}const _0x4ee6b9=_0x471b72['attributes']['activationParams'][_0x2a5f8c(0x196)]||_0x30a716,_0x39f447=sanitizeYamlKey(_0x4ee6b9)||_0x2a5f8c(0x12b)+_0x30a716;let _0x315f77=_0x39f447,_0x5f2cd9=0x2;while(_0x43582b[_0x2a5f8c(0x143)](_0x315f77)){_0x315f77=_0x39f447+'_'+_0x5f2cd9,_0x5f2cd9++;}_0x43582b[_0x2a5f8c(0x110)](_0x315f77),_0x47e980['set'](_0x578d35,_0x315f77);const _0x195887={'name':_0x315f77,'isJourneyLocal':!![],'definition':_0x52fc04};return _0x416e71['set'](_0x30a716,_0x195887),_0x195887;}catch(_0x6ba9ce){return _0x38dd94['verbose']&&console[_0x2a5f8c(0x164)](_0x2a5f8c(0x102)+_0x30a716+':\x20'+_0x6ba9ce[_0x2a5f8c(0x151)]),{'name':_0x30a716,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x85452c,_0x420051)=>{const _0x31caf5=_0x2044f9;return resolveJumpTarget(_0x85452c,_0x420051,_0x9c93a8,_0x3fc743=>_0x122e52[_0x31caf5(0xee)][_0x31caf5(0x109)](_0x3fc743));}},_0x4cdc20=await journeyResponseToDef(_0x30ee70,_0xdb47ef);_0x2caf33[_0x2044f9(0xda)]({'item':_0x43f728,'yaml':_0x4cdc20});}},{'verbose':_0x38dd94[_0xfa7c4c(0x15c)]});const _0x5ea692=await _0x122e52['journey']['getLatestJourneyId'](_0x3a1fa5[0x0][_0xfa7c4c(0x184)]),_0x4f9e3c=buildMergedJourneyDef(_0x2caf33,_0x5962f0,_0x5ea692),_0x2a7f93=normalizeJourneyDef(_0x4f9e3c,_0x163461),_0x223477=toYamlString(_0x2a7f93),_0x12e968=_0x2cb958||a27_0x3c39c9['join'](_0x3fc829,sanitizeFileName(_0x16c08d)+_0xfa7c4c(0x179));!_0x2cb958&&_0x58fc58&&!existsSync(_0x3fc829)&&mkdirSync(_0x3fc829,{'recursive':!![]});const _0x22c5b8=a27_0x3c39c9[_0xfa7c4c(0xef)](process[_0xfa7c4c(0xdb)](),_0x12e968);if(existsSync(_0x12e968)){const _0x47fd8c=readFileSync(_0x12e968,_0xfa7c4c(0x133)),_0x9ebda2=generateDiff(_0x47fd8c,_0x223477),_0x34ed7e=hasChanges(_0x9ebda2);_0x58d5aa[_0xfa7c4c(0xda)]({'relativePath':_0x22c5b8,'absolutePath':_0x12e968,'content':_0x223477,'isNew':![],'hasChanges':_0x34ed7e,'diff':_0x34ed7e?formatDiffWithColors(_0x9ebda2):undefined});}else _0x58d5aa[_0xfa7c4c(0xda)]({'relativePath':_0x22c5b8,'absolutePath':_0x12e968,'content':_0x223477,'isNew':!![],'hasChanges':![]});}const _0x4a3a81=_0x58d5aa['filter'](_0x268351=>_0x268351[_0xfa7c4c(0x17c)]),_0x3c0ff7=_0x58d5aa['filter'](_0x4ae012=>!_0x4ae012[_0xfa7c4c(0x17c)]&&_0x4ae012[_0xfa7c4c(0xf0)]),_0x5954c2=_0x58d5aa[_0xfa7c4c(0x182)](_0x4f394e=>!_0x4f394e[_0xfa7c4c(0x17c)]&&!_0x4f394e[_0xfa7c4c(0xf0)]),_0x358216=_0x3be400[_0xfa7c4c(0x121)],_0x270e95=_0x532008['size'],_0xa25ad2=_0x358216>_0x270e95?'\x20('+_0x358216+_0xfa7c4c(0x1a8):'';console['error'](_0xfa7c4c(0x1d0)),console[_0xfa7c4c(0x164)]('\x20\x20'+a27_0x1b29e0[_0xfa7c4c(0xd5)](_0x270e95+_0xfa7c4c(0x11d))+a27_0x1b29e0[_0xfa7c4c(0x10d)](_0xa25ad2)),console[_0xfa7c4c(0x164)]('\x20\x20'+a27_0x1b29e0['green']('+\x20'+_0x4a3a81[_0xfa7c4c(0x121)]+_0xfa7c4c(0xd6))),console[_0xfa7c4c(0x164)]('\x20\x20'+a27_0x1b29e0[_0xfa7c4c(0xe7)]('~\x20'+_0x3c0ff7[_0xfa7c4c(0x121)]+_0xfa7c4c(0x1cf))),console[_0xfa7c4c(0x164)]('\x20\x20'+a27_0x1b29e0['dim']('=\x20'+_0x5954c2['length']+_0xfa7c4c(0x14e))),console[_0xfa7c4c(0x164)](_0xfa7c4c(0x1a2)+a27_0x1b29e0['cyan'](_0x3704b4)+'\x0a');if(_0x3c0ff7[_0xfa7c4c(0x121)]>0x0)for(const _0x1a280a of _0x3c0ff7){console['error']('\x0aChanges\x20to\x20\x27'+_0x1a280a['relativePath']+'\x27:'),console[_0xfa7c4c(0x164)]('─'[_0xfa7c4c(0x105)](0x3c)),console[_0xfa7c4c(0x164)](_0x1a280a[_0xfa7c4c(0x150)]),console[_0xfa7c4c(0x164)]('─'[_0xfa7c4c(0x105)](0x3c));}if(_0x3287c3[_0xfa7c4c(0x165)])return console['error'](a27_0x1b29e0[_0xfa7c4c(0xe7)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4a3a81['length']===0x0&&_0x3c0ff7['length']===0x0)return console[_0xfa7c4c(0x164)](a27_0x1b29e0['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x29eda6},_0x3287c3[_0xfa7c4c(0x1a3)]),console[_0xfa7c4c(0x164)](a27_0x1b29e0[_0xfa7c4c(0x174)](_0xfa7c4c(0x173)+a27_0x1b29e0[_0xfa7c4c(0x10d)](_0xfa7c4c(0xec))+_0xfa7c4c(0x123)+a27_0x1b29e0[_0xfa7c4c(0xd5)](_0x29eda6))),0x0;if(!_0x3287c3[_0xfa7c4c(0x159)]&&(_0x4a3a81[_0xfa7c4c(0x121)]>0x0||_0x3c0ff7[_0xfa7c4c(0x121)]>0x0)){if(!isInteractive())return console[_0xfa7c4c(0x164)](a27_0x1b29e0[_0xfa7c4c(0x1c3)](_0xfa7c4c(0x11c)),_0xfa7c4c(0xeb)),console[_0xfa7c4c(0x164)](a27_0x1b29e0[_0xfa7c4c(0x10d)](_0xfa7c4c(0x12f))),0x1;const _0x1016b1=await confirmKey('Write\x20'+(_0x4a3a81[_0xfa7c4c(0x121)]+_0x3c0ff7['length'])+'\x20files?');if(!_0x1016b1)return console[_0xfa7c4c(0x164)](a27_0x1b29e0[_0xfa7c4c(0xe7)](_0xfa7c4c(0x1b8)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x3704b4)&&mkdirSync(_0x3704b4,{'recursive':!![]});const _0x170496=a27_0x3c39c9[_0xfa7c4c(0x1b9)](_0x3704b4,_0xfa7c4c(0x152));writeFileSync(_0x170496,createTdxConfigContent(_0x29eda6),_0xfa7c4c(0x133));for(const _0x5d23e5 of _0x58d5aa){(_0x5d23e5[_0xfa7c4c(0x17c)]||_0x5d23e5['hasChanges'])&&writeFileSync(_0x5d23e5[_0xfa7c4c(0x195)],_0x5d23e5[_0xfa7c4c(0x16c)],'utf-8');}return console[_0xfa7c4c(0x164)](a27_0x1b29e0['green'](_0xfa7c4c(0x1b0)+(_0x4a3a81[_0xfa7c4c(0x121)]+_0x3c0ff7['length'])+_0xfa7c4c(0x1af)+_0x3704b4)),saveSessionContext({'parent_segment':_0x29eda6},_0x3287c3[_0xfa7c4c(0x1a3)]),console['error'](a27_0x1b29e0[_0xfa7c4c(0x174)](_0xfa7c4c(0x173)+a27_0x1b29e0[_0xfa7c4c(0x10d)]('parent_segment')+_0xfa7c4c(0x123)+a27_0x1b29e0[_0xfa7c4c(0xd5)](_0x29eda6))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x2f1e80(0x196)]='journey:columns';[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0x120);async[a27_0x2f1e80(0x132)](_0x4428b4){const _0x1583aa=a27_0x2f1e80,{options:_0x5d2187,args:_0x23a42f,tdx:_0x524dfe}=_0x4428b4,_0x4fa945=_0x23a42f[0x0];if(!requireNameOrPath(_0x4fa945))return 0x1;_0x5d2187[_0x1583aa(0x15c)]&&console[_0x1583aa(0x164)]('Input:\x20'+_0x4fa945);const {journeyId:_0x3f7e36}=await resolveJourneyIdFromInput(_0x4fa945,_0x5d2187,_0x524dfe),_0x1f0bb0=await withSpinner('Getting\x20column\x20mapping...',()=>_0x524dfe[_0x1583aa(0xee)][_0x1583aa(0x147)](_0x3f7e36),{'verbose':_0x5d2187[_0x1583aa(0x15c)]}),_0x2d39ec=_0x1f0bb0[_0x1583aa(0x10a)];return console[_0x1583aa(0x14a)](_0x1583aa(0x1b7)+_0x2d39ec[_0x1583aa(0x128)]),console[_0x1583aa(0x14a)](_0x1583aa(0x16e)+_0x2d39ec['table']),await handleSDKOutput(_0x2d39ec[_0x1583aa(0xd7)],_0x5d2187),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x2f1e80(0x190);[a27_0x2f1e80(0x1c4)]='List\x20activations\x20for\x20a\x20journey';async['execute'](_0x571ee6){const _0x3e2a23=a27_0x2f1e80,{options:_0x41e10e,args:_0x4204af,tdx:_0x269b57}=_0x571ee6,_0x110671=_0x4204af[0x0];if(!requireNameOrPath(_0x110671))return 0x1;_0x41e10e[_0x3e2a23(0x15c)]&&console['error']('Input:\x20'+_0x110671);const {journeyId:_0x210c44}=await resolveJourneyIdFromInput(_0x110671,_0x41e10e,_0x269b57),_0x3e2602=await withSpinner(_0x3e2a23(0x157),()=>_0x269b57['journey'][_0x3e2a23(0x15d)](_0x210c44),{'verbose':_0x41e10e['verbose']}),_0x221875=_0x3e2602[_0x3e2a23(0x10a)];return console[_0x3e2a23(0x164)](_0x3e2a23(0x11b)+_0x221875[_0x3e2a23(0x121)]+_0x3e2a23(0xde)+(_0x221875['length']!==0x1?'s':'')),await handleSDKOutput(_0x221875,_0x41e10e),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x2f1e80(0x196)]='journey:push';[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0xfd);['segmentPushCommand']=new SegmentPushCommand();async[a27_0x2f1e80(0x132)](_0x5ae6af){const _0x138f26=a27_0x2f1e80,_0x38953f=_0x5ae6af[_0x138f26(0x177)][0x0];let _0x580544;if(_0x38953f){const _0x46f37b=await resolveTarget({'arg':_0x38953f,'contextParent':_0x5ae6af['options'][_0x138f26(0xea)],'cwd':process[_0x138f26(0xdb)]()});isSuccessfulResolution(_0x46f37b)&&_0x46f37b['type']==='file'&&(_0x580544=_0x46f37b[_0x138f26(0x1c2)]);}const _0x5bcea2={..._0x5ae6af,'options':{..._0x5ae6af[_0x138f26(0xd8)],'journeysOnly':!![],..._0x580544&&{'singleFilePath':_0x580544}}};return this['segmentPushCommand'][_0x138f26(0x132)](_0x5bcea2);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0x19b);[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0x154);async[a27_0x2f1e80(0x132)](_0x3f78e1){const _0x21aad7=a27_0x2f1e80,{options:_0x357684,args:_0x237cb1,tdx:_0x407818}=_0x3f78e1,_0x5cc36e=_0x237cb1[0x0];if(!requireNameOrPath(_0x5cc36e))return 0x1;if(_0x357684[_0x21aad7(0x15c)])console[_0x21aad7(0x164)](_0x21aad7(0xdf)+_0x5cc36e);const {journeyId:_0x5392de}=await resolveJourneyIdFromInput(_0x5cc36e,_0x357684,_0x407818),_0x364162=await withSpinner(_0x21aad7(0x1c1),()=>_0x407818[_0x21aad7(0xee)][_0x21aad7(0x114)](_0x5392de),{'verbose':_0x357684[_0x21aad7(0x15c)]}),{bundleName:_0x3f7b0d,versions:_0x245135,latestJourneyId:_0x3669ad}=_0x364162[_0x21aad7(0x10a)];console[_0x21aad7(0x164)](_0x3f7b0d+':\x20'+_0x245135[_0x21aad7(0x121)]+_0x21aad7(0xf1)+(_0x245135[_0x21aad7(0x121)]!==0x1?'s':''));const _0x3e9a7c=_0x245135[_0x21aad7(0x1d3)](_0x508da9=>({'version':_0x508da9[_0x21aad7(0x1ce)],'journey_id':_0x508da9['journeyId'],'name':_0x508da9['name'],'state':_0x508da9['state'],'paused':_0x508da9[_0x21aad7(0xe9)],'latest':_0x508da9[_0x21aad7(0x1c7)]===_0x3669ad,'created_at':_0x508da9[_0x21aad7(0x166)]}));return await handleSDKOutput(_0x3e9a7c,_0x357684),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0xfa);[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0x138);async[a27_0x2f1e80(0x132)](_0x2594e5){const _0x17b941=a27_0x2f1e80,{options:_0x5eecc0,args:_0x4d8da7,tdx:_0x51eef4}=_0x2594e5,_0x4186c7=_0x4d8da7[0x0];if(!requireNameOrPath(_0x4186c7))return 0x1;if(_0x5eecc0[_0x17b941(0x15c)])console[_0x17b941(0x164)](_0x17b941(0xdf)+_0x4186c7);const {journeyId:_0x404d73,journeyName:_0x2a4a3e}=await resolveJourneyIdFromInput(_0x4186c7,_0x5eecc0,_0x51eef4);if(!_0x5eecc0['yes']){const _0xd41099=await confirm(_0x17b941(0x115)+_0x2a4a3e+'\x22?');if(!_0xd41099)return console[_0x17b941(0x164)](_0x17b941(0x17b)),0x0;}const _0x2c0e3f=await withSpinner('Creating\x20new\x20version...',()=>_0x51eef4[_0x17b941(0xee)][_0x17b941(0xf9)](_0x404d73),{'verbose':_0x5eecc0['verbose']}),_0x3e0b37=_0x2c0e3f[_0x17b941(0x10a)];return console[_0x17b941(0x164)](a27_0x1b29e0['green']('✔')+'\x20Created\x20v'+_0x3e0b37['attributes'][_0x17b941(0x1ce)]+_0x17b941(0x1c9)+_0x3e0b37[_0x17b941(0x17d)]['name']+'\x22'),console[_0x17b941(0x164)]('\x20\x20Journey\x20ID:\x20'+_0x3e0b37['id']),await handleSingleObjectOutput({'id':_0x3e0b37['id'],'name':_0x3e0b37['attributes'][_0x17b941(0x196)],'version':_0x3e0b37['attributes'][_0x17b941(0x1ce)],'state':_0x3e0b37[_0x17b941(0x17d)]['state'],'bundle_id':_0x3e0b37['attributes'][_0x17b941(0x184)],'created_at':_0x3e0b37['attributes'][_0x17b941(0x166)]},_0x5eecc0),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0x1ab);[a27_0x2f1e80(0x1c4)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x2f1e80(0x132)](_0x19e540){const _0x436352=a27_0x2f1e80,{options:_0xbda917,args:_0x41866e,tdx:_0x4c5340}=_0x19e540,_0x5b33b3=_0x41866e[0x0];if(!requireNameOrPath(_0x5b33b3))return 0x1;const _0x1a62d8=_0xbda917[_0x436352(0x107)];if(!_0x1a62d8)return console['error'](_0x436352(0x140)),console[_0x436352(0x164)](_0x436352(0x198)),0x1;const _0x4ddbda=parseInt(_0x1a62d8,0xa);if(isNaN(_0x4ddbda)||_0x4ddbda<0x1)return console[_0x436352(0x164)](_0x436352(0xe0)+_0x1a62d8),0x1;if(_0xbda917[_0x436352(0x15c)])console[_0x436352(0x164)](_0x436352(0xdf)+_0x5b33b3+_0x436352(0x1b6)+_0x4ddbda);const {journeyId:_0x25ae71,parentSegmentId:_0xc26b4d}=await resolveJourneyIdFromInput(_0x5b33b3,_0xbda917,_0x4c5340),_0x5a9911=await withSpinner(_0x436352(0x1cd),()=>_0x4c5340[_0x436352(0xee)][_0x436352(0x114)](_0x25ae71),{'verbose':_0xbda917[_0x436352(0x15c)]}),{versions:_0x268c65,latestJourneyId:_0x303ae6}=_0x5a9911[_0x436352(0x10a)],_0x2a5963=_0x268c65[_0x436352(0x1a1)](_0x4f6f39=>_0x4f6f39[_0x436352(0x1ce)]===_0x4ddbda);if(!_0x2a5963){const _0x7eed9b=_0x268c65[_0x436352(0x1d3)](_0x3a0ba1=>'v'+_0x3a0ba1[_0x436352(0x1ce)])[_0x436352(0x1b9)](',\x20');return console['error'](_0x436352(0x16d)+_0x4ddbda+'\x20not\x20found.\x20Available:\x20'+_0x7eed9b),0x1;}const _0x170bb6=await withSpinner(_0x436352(0x129)+_0x4ddbda+_0x436352(0x194),()=>_0x4c5340[_0x436352(0xee)][_0x436352(0x109)](_0x2a5963[_0x436352(0x1c7)]),{'verbose':_0xbda917[_0x436352(0x15c)]}),_0x511041=_0x170bb6[_0x436352(0x10a)],_0x47a7a9=getConsoleNextUrl(_0xbda917[_0x436352(0x17f)],'/app/ps/'+_0xc26b4d+'/e/'+_0x2a5963[_0x436352(0x1c7)]+_0x436352(0x19a));return await handleSingleObjectOutput({'id':_0x511041['id'],'name':_0x511041[_0x436352(0x17d)][_0x436352(0x196)],'version':_0x511041[_0x436352(0x17d)]['versionNumber'],'description':_0x511041[_0x436352(0x17d)][_0x436352(0x1c4)],'state':_0x511041[_0x436352(0x17d)][_0x436352(0x104)],'paused':_0x511041['attributes'][_0x436352(0xe9)],'reentry_mode':_0x511041[_0x436352(0x17d)][_0x436352(0x112)],'stages':_0x511041[_0x436352(0x17d)][_0x436352(0x10c)]?.[_0x436352(0x121)]||0x0,..._0x511041[_0x436352(0x17d)][_0x436352(0x131)]&&{'goal':_0x511041[_0x436352(0x17d)]['goal'][_0x436352(0x196)]},'latest':_0x2a5963['journeyId']===_0x303ae6,'created_at':_0x511041[_0x436352(0x17d)][_0x436352(0x166)],'updated_at':_0x511041['attributes'][_0x436352(0x134)],'url':_0x47a7a9},_0xbda917),0x0;}}
1
+ const a27_0x69e9dc=a27_0x26e4;(function(_0x4800a0,_0x6483f5){const _0x157a22=a27_0x26e4,_0x8143e3=_0x4800a0();while(!![]){try{const _0x5bcbe9=-parseInt(_0x157a22(0x12c))/0x1+-parseInt(_0x157a22(0x116))/0x2+parseInt(_0x157a22(0xb9))/0x3*(-parseInt(_0x157a22(0x128))/0x4)+-parseInt(_0x157a22(0x18a))/0x5+parseInt(_0x157a22(0xca))/0x6*(parseInt(_0x157a22(0x181))/0x7)+-parseInt(_0x157a22(0x1a6))/0x8*(-parseInt(_0x157a22(0x100))/0x9)+parseInt(_0x157a22(0x198))/0xa*(parseInt(_0x157a22(0xe5))/0xb);if(_0x5bcbe9===_0x6483f5)break;else _0x8143e3['push'](_0x8143e3['shift']());}catch(_0x4188ab){_0x8143e3['push'](_0x8143e3['shift']());}}}(a27_0x1d10,0xbed16));import a27_0x1d22cc from'chalk';import a27_0x533657 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x9bbcc3){const _0x2063fc=a27_0x26e4;return!_0x9bbcc3&&(console[_0x2063fc(0xfa)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x2063fc(0x1cc))),!!_0x9bbcc3;}function withJsonFormat(_0x5edf44){const _0xec2904=a27_0x26e4;if(!_0x5edf44[_0xec2904(0x16d)]&&!_0x5edf44[_0xec2904(0xd1)]&&!_0x5edf44['jsonl']&&!_0x5edf44[_0xec2904(0x13a)])return{..._0x5edf44,'format':_0xec2904(0xd1),'json':!![]};return _0x5edf44;}function formatJourneyState(_0x2fcc79){const _0x3220e4=a27_0x26e4;switch(_0x2fcc79){case'launched':return a27_0x1d22cc['green'](_0x3220e4(0x1c3));case'draft':return a27_0x1d22cc[_0x3220e4(0x124)](_0x3220e4(0x1a8));case'paused':return a27_0x1d22cc[_0x3220e4(0xea)](_0x3220e4(0xc3));case _0x3220e4(0xe3):return a27_0x1d22cc[_0x3220e4(0x139)](_0x3220e4(0x10f));case _0x3220e4(0x18b):return a27_0x1d22cc[_0x3220e4(0x124)](_0x3220e4(0x11c));default:return'('+_0x2fcc79+')';}}function formatJourneyItem(_0x4d2657,_0x27d035='',_0xe8235d){const _0x1dbaf3=a27_0x26e4,_0x11624b=formatJourneyState(_0x4d2657[_0x1dbaf3(0x104)]),_0x3c3880=_0xe8235d?hyperlink(_0x4d2657[_0x1dbaf3(0x151)],_0xe8235d):_0x4d2657['journeyBundleName'];return _0x27d035+_0x1dbaf3(0x1bd)+_0x3c3880+'\x20'+_0x11624b;}function escapeRegex(_0x560aad){const _0x28be90=a27_0x26e4;return _0x560aad[_0x28be90(0x141)](/[.*+?^${}()|[\]\\]/g,_0x28be90(0x143));}function globToRegex(_0x4be113){const _0x1f199a=a27_0x26e4,_0x48fceb=_0x4be113[_0x1f199a(0x14a)]('*')[_0x1f199a(0x19e)](escapeRegex);return new RegExp(_0x48fceb[_0x1f199a(0x11e)]('.*'),'i');}function buildRuleToNameMapping(_0x5cbe94){const _0x52d224=a27_0x26e4,_0xbe1368=new Map();if(_0x5cbe94[_0x52d224(0xcf)])for(const [_0x1fa861,_0x440dba]of Object[_0x52d224(0x185)](_0x5cbe94[_0x52d224(0xcf)])){if(_0x440dba['rule']){const _0x57004d=serializeRule(_0x440dba['rule']),_0x11ec64=_0xbe1368['get'](_0x57004d);_0x11ec64?_0x11ec64[_0x52d224(0x146)](_0x1fa861):_0xbe1368[_0x52d224(0x152)](_0x57004d,[_0x1fa861]);}}return _0xbe1368;}async function resolveJourneyIdFromInput(_0x42aaca,_0x109e09,_0x1e3fa3){const _0x567f57=a27_0x26e4,_0x3923dd=await resolveJourneyTarget(_0x42aaca,_0x109e09[_0x567f57(0xc6)],_0x109e09[_0x567f57(0xd4)]),_0xa31127=_0x3923dd['parentSegment'];if(!_0xa31127)throw new SDKError(ErrorCode[_0x567f57(0x199)],_0x567f57(0x1ad));const _0x24cf3f=await withSpinner(_0x567f57(0xf9),()=>_0x1e3fa3[_0x567f57(0x102)][_0x567f57(0x158)](_0xa31127),{'verbose':_0x109e09['verbose']}),_0x56c071=_0x24cf3f[_0x567f57(0x131)],_0x2cde2d=await withSpinner(_0x567f57(0xfb),()=>_0x1e3fa3['journey'][_0x567f57(0x19c)](_0x56c071,_0x3923dd[_0x567f57(0x1b2)]),{'verbose':_0x109e09[_0x567f57(0xd4)]});return{'journeyId':_0x2cde2d['data'],'journeyName':_0x3923dd['journeyName'],'parentSegmentId':_0x56c071};}async function resolveJourneyTarget(_0x450712,_0xeb1e74,_0x4443ea){const _0x1e89da=a27_0x26e4;if(isYamlFilePath(_0x450712))try{const _0x7eea90=await resolveYamlFilePath(_0x450712);return _0x4443ea&&(console[_0x1e89da(0xfa)]('Resolved\x20YAML\x20file:\x20'+_0x450712),console['error'](_0x1e89da(0x196)+_0x7eea90[_0x1e89da(0xc6)]),console['error'](_0x1e89da(0x136)+_0x7eea90[_0x1e89da(0x1ac)]),console[_0x1e89da(0xfa)](_0x1e89da(0x150)+(_0x7eea90[_0x1e89da(0x126)]||_0x1e89da(0xcc)))),{'journeyName':_0x7eea90[_0x1e89da(0x1ac)],'parentSegment':_0x7eea90[_0x1e89da(0xc6)],'resolved':_0x7eea90};}catch(_0x765d06){throw new SDKError(ErrorCode[_0x1e89da(0x199)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x765d06[_0x1e89da(0x177)]);}if(!_0xeb1e74)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1e89da(0x180));return{'journeyName':_0x450712,'parentSegment':_0xeb1e74};}export class JourneyListCommand extends BaseCommand{['name']=a27_0x69e9dc(0x138);[a27_0x69e9dc(0xda)]='List\x20journeys\x20in\x20current\x20context';async['execute'](_0x5bbc9c){const _0x1a2ecb=a27_0x69e9dc,{options:_0x54534e,args:_0x2189d5,tdx:_0x16fc69}=_0x5bbc9c,_0x2cb250=_0x2189d5[0x0],_0xf553e1=_0x54534e[_0x1a2ecb(0xc6)];if(!_0xf553e1)return console['error']('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0x1a2ecb(0x13c)),0x1;const _0x4abeee=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x16fc69[_0x1a2ecb(0x102)][_0x1a2ecb(0x158)](_0xf553e1),{'verbose':_0x54534e[_0x1a2ecb(0xd4)]}),_0x3be5ef=_0x4abeee['data'];_0x54534e[_0x1a2ecb(0xd4)]&&(console[_0x1a2ecb(0xfa)](_0x1a2ecb(0x14f)+_0xf553e1+_0x1a2ecb(0xe1)+_0x3be5ef+')'),_0x2cb250&&console[_0x1a2ecb(0xfa)](_0x1a2ecb(0x16f)+_0x2cb250));const _0x541f52=await withSpinner(_0x1a2ecb(0xe9),()=>_0x16fc69[_0x1a2ecb(0x102)][_0x1a2ecb(0x103)](_0x3be5ef),{'verbose':_0x54534e['verbose']}),_0x346536=_0x541f52[_0x1a2ecb(0x131)],_0x272cda=_0x346536[_0x1a2ecb(0x164)],_0x3fa852=await withSpinner(_0x1a2ecb(0x1c4),()=>_0x16fc69[_0x1a2ecb(0x13b)]['listJourneysWithFolders'](_0x3be5ef,_0x272cda),{'verbose':_0x54534e[_0x1a2ecb(0xd4)]});let _0x5e189e=_0x3fa852[_0x1a2ecb(0x131)]['journeys'];const _0x2a8338=_0x3fa852[_0x1a2ecb(0x131)][_0x1a2ecb(0xf0)],_0x201710=new Map();for(const _0x1f8853 of _0x2a8338){_0x201710[_0x1a2ecb(0x152)](_0x1f8853['id'],_0x1f8853[_0x1a2ecb(0x137)]);}if(_0x2cb250){const _0x4038eb=globToRegex(_0x2cb250);_0x5e189e=_0x5e189e['filter'](_0x5ef3bd=>_0x4038eb[_0x1a2ecb(0x174)](_0x5ef3bd[_0x1a2ecb(0x151)]));}console[_0x1a2ecb(0xfa)]('✔\x20Found\x20'+_0x5e189e[_0x1a2ecb(0xed)]+_0x1a2ecb(0x187)+(_0x5e189e['length']!==0x1?'s':''));const _0xc3cbe=_0x56cb4e=>{const _0x9bc288=_0x1a2ecb;return getConsoleNextUrl(_0x54534e['site'],_0x9bc288(0x15a)+_0x3be5ef+_0x9bc288(0x192)+_0x56cb4e+_0x9bc288(0x188));};if(_0x54534e[_0x1a2ecb(0x16d)]===_0x1a2ecb(0xfc))await handleSDKOutput(_0x5e189e,_0x54534e);else{if(_0x54534e[_0x1a2ecb(0x16d)]==='json'){const _0x111435=_0x5e189e[_0x1a2ecb(0x19e)](_0x343601=>({..._0x343601,'url':_0xc3cbe(_0x343601['id'])}));await handleSDKOutput(_0x111435,_0x54534e);}else{console[_0x1a2ecb(0x132)]('['+_0xf553e1+']');const _0x597d73=new Map(),_0x1391a7=[];for(const _0x296c2c of _0x5e189e){if(!_0x296c2c[_0x1a2ecb(0xbf)]||_0x296c2c[_0x1a2ecb(0xbf)]===_0x272cda)_0x1391a7[_0x1a2ecb(0x146)](_0x296c2c);else{const _0x54c50e=_0x597d73[_0x1a2ecb(0xf8)](_0x296c2c[_0x1a2ecb(0xbf)])||[];_0x54c50e[_0x1a2ecb(0x146)](_0x296c2c),_0x597d73[_0x1a2ecb(0x152)](_0x296c2c['folderId'],_0x54c50e);}}const _0x38eb1a=(_0x330e88,_0x187799)=>_0x330e88[_0x1a2ecb(0x151)][_0x1a2ecb(0x157)](_0x187799['journeyBundleName'],undefined,{'sensitivity':_0x1a2ecb(0xd8)});_0x1391a7[_0x1a2ecb(0x162)](_0x38eb1a);for(const _0x3866aa of _0x1391a7){console[_0x1a2ecb(0x132)](formatJourneyItem(_0x3866aa,'',_0xc3cbe(_0x3866aa['id'])));}const _0x27369c=[..._0x597d73[_0x1a2ecb(0x185)]()][_0x1a2ecb(0x162)]((_0x5639ce,_0x46119b)=>{const _0x466e96=_0x1a2ecb,_0xb47fb6=_0x201710[_0x466e96(0xf8)](_0x5639ce[0x0])||_0x5639ce[0x0],_0x488758=_0x201710[_0x466e96(0xf8)](_0x46119b[0x0])||_0x46119b[0x0];return _0xb47fb6[_0x466e96(0x157)](_0x488758,undefined,{'sensitivity':_0x466e96(0xd8)});});for(const [_0x14ca65,_0x5befb2]of _0x27369c){const _0x4ccc4b=_0x201710[_0x1a2ecb(0xf8)](_0x14ca65)||_0x14ca65;console[_0x1a2ecb(0x132)]('📁\x20'+_0x4ccc4b),_0x5befb2[_0x1a2ecb(0x162)](_0x38eb1a);for(const _0xdb900c of _0x5befb2){console[_0x1a2ecb(0x132)](formatJourneyItem(_0xdb900c,'\x20\x20',_0xc3cbe(_0xdb900c['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x10a);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0xee);async[a27_0x69e9dc(0xf2)](_0x4d7b2b){const _0x1a23c4=a27_0x69e9dc,{options:_0x5c49dd,args:_0x268234,tdx:_0x4f7ba5}=_0x4d7b2b,_0x4e9b22=_0x268234[0x0];if(!_0x4e9b22)return console[_0x1a23c4(0xfa)](_0x1a23c4(0x121)),console[_0x1a23c4(0xfa)](_0x1a23c4(0x1a0)),console['error'](_0x1a23c4(0xc8)),console['error'](_0x1a23c4(0xdd)),0x1;_0x5c49dd[_0x1a23c4(0xd4)]&&console[_0x1a23c4(0xfa)]('Input:\x20'+_0x4e9b22);const {journeyId:_0x43291e,parentSegmentId:_0xa8689c}=await resolveJourneyIdFromInput(_0x4e9b22,_0x5c49dd,_0x4f7ba5);if(_0x5c49dd[_0x1a23c4(0xf6)]){const _0x41e11=getConsoleNextUrl(_0x5c49dd['site'],_0x1a23c4(0x15a)+_0xa8689c+_0x1a23c4(0x192)+_0x43291e+_0x1a23c4(0x112));return console[_0x1a23c4(0xfa)](a27_0x1d22cc[_0x1a23c4(0xb5)]('✔')+_0x1a23c4(0x117)+a27_0x1d22cc[_0x1a23c4(0x182)](_0x41e11)),openBrowser(_0x41e11),0x0;}const _0x1516b7=await withSpinner(_0x1a23c4(0xdc),()=>_0x4f7ba5[_0x1a23c4(0x13b)]['getJourney'](_0x43291e),{'verbose':_0x5c49dd[_0x1a23c4(0xd4)]}),_0x1b2578=_0x1516b7[_0x1a23c4(0x131)],_0x48e3be=_0x5c49dd[_0x1a23c4(0xcd)];let _0x284e76;if(_0x48e3be)try{const _0x5b4775=await withSpinner(_0x1a23c4(0x12e),()=>_0x4f7ba5[_0x1a23c4(0x13b)]['getStatistics'](_0x43291e),{'verbose':_0x5c49dd[_0x1a23c4(0xd4)]});_0x284e76=_0x5b4775[_0x1a23c4(0x131)];}catch{_0x5c49dd['verbose']&&console['error'](_0x1a23c4(0xbb));}const _0x162cc9=getConsoleNextUrl(_0x5c49dd[_0x1a23c4(0x171)],_0x1a23c4(0x15a)+_0xa8689c+'/e/'+_0x43291e+_0x1a23c4(0x112)),_0xccf821={'id':_0x1b2578['id'],'name':_0x1b2578['attributes']['name'],'description':_0x1b2578[_0x1a23c4(0xbe)][_0x1a23c4(0xda)],'state':_0x1b2578[_0x1a23c4(0xbe)][_0x1a23c4(0x104)],'paused':_0x1b2578['attributes'][_0x1a23c4(0xf7)],'reentry_mode':_0x1b2578[_0x1a23c4(0xbe)][_0x1a23c4(0x120)],'stages':_0x1b2578[_0x1a23c4(0xbe)][_0x1a23c4(0x189)]?.['length']||0x0,..._0x1b2578['attributes']['goal']&&{'goal':_0x1b2578[_0x1a23c4(0xbe)][_0x1a23c4(0x1c9)][_0x1a23c4(0x137)]},..._0x284e76&&{'statistics':{'size':_0x284e76['size'],'entered':_0x284e76[_0x1a23c4(0x16b)],'goal_achieved':_0x284e76[_0x1a23c4(0x105)],'completion_rate':_0x284e76['completionRate'],'exit_or_jump':_0x284e76[_0x1a23c4(0x1cb)],'exit_or_jump_rate':_0x284e76['exitOrJumpRate'],'stages':_0x284e76[_0x1a23c4(0x176)]}},'url':_0x162cc9};return await handleSingleObjectOutput(_0xccf821,_0x5c49dd),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x1c7);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x1a2);async[a27_0x69e9dc(0xf2)](_0x174cfd){const _0x5f12fc=a27_0x69e9dc,{options:_0x1fe870,args:_0x59d7e2,tdx:_0x52a3c9}=_0x174cfd,_0x455646=_0x59d7e2[0x0];if(!requireNameOrPath(_0x455646))return 0x1;_0x1fe870[_0x5f12fc(0xd4)]&&console['error'](_0x5f12fc(0xc2)+_0x455646);const _0x317f61=_0x1fe870,_0x207e3c=_0x317f61[_0x5f12fc(0x153)],_0x573e7d=_0x317f61['to'],_0xa793fd=_0x317f61['includeHistory'],_0x299fb0=_0x317f61[_0x5f12fc(0x13e)];_0xa793fd&&!_0x207e3c&&!_0x573e7d&&console[_0x5f12fc(0xfa)](_0x5f12fc(0x110));const _0x13a782=_0xa793fd?withJsonFormat(_0x1fe870):_0x1fe870,{journeyId:_0x26c4fd,journeyName:_0x4c7149}=await resolveJourneyIdFromInput(_0x455646,_0x13a782,_0x52a3c9),_0x1292fe=_0x207e3c||_0x573e7d?{'from':_0x207e3c,'to':_0x573e7d}:undefined,_0x5b1a71=await withSpinner(_0x5f12fc(0x12e),()=>Promise['all']([_0x52a3c9[_0x5f12fc(0x13b)][_0x5f12fc(0x17c)](_0x26c4fd),_0x52a3c9[_0x5f12fc(0x13b)][_0x5f12fc(0xfe)](_0x26c4fd,_0x1292fe)]),{'verbose':_0x13a782[_0x5f12fc(0xd4)]}),[_0x8a30f4,_0x5e56bb]=_0x5b1a71[_0x5f12fc(0x131)];if(!_0x5e56bb||_0x5e56bb[_0x5f12fc(0xeb)]===null)return console[_0x5f12fc(0xfa)](_0x5f12fc(0x148)+_0x4c7149),console[_0x5f12fc(0xfa)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x64467e=buildStageNameMap(_0x8a30f4),_0x3bbbb7=!!(_0x1292fe&&_0x5e56bb['history']?.[_0x5f12fc(0xed)]),_0x54e248={'stageNameMap':_0x64467e,'hasPeriod':_0x3bbbb7,'includeHistory':!!_0xa793fd};if(_0x299fb0&&_0x5e56bb[_0x5f12fc(0x176)]){const _0x597e04=_0x5e56bb['stages'][_0x5f12fc(0x119)](_0x17f290=>{const _0x1000e5=_0x5f12fc,_0x5df556=_0x64467e[_0x1000e5(0xf8)](_0x17f290['id'])??'';return _0x5df556['toLowerCase']()===_0x299fb0[_0x1000e5(0xb7)]();});if(_0x597e04)return await handleSingleObjectOutput(formatStageStats(_0x597e04,_0x54e248),_0x13a782),0x0;const _0x1cbe18=_0x5e56bb[_0x5f12fc(0x176)][_0x5f12fc(0x19e)](_0x2028a4=>_0x64467e['get'](_0x2028a4['id'])??_0x2028a4['id']);return console[_0x5f12fc(0xfa)](_0x5f12fc(0xff)+_0x299fb0+_0x5f12fc(0x133)),console[_0x5f12fc(0xfa)](_0x5f12fc(0x15e)+_0x1cbe18[_0x5f12fc(0x11e)](',\x20')),0x1;}const _0x4732c1=_0x5e56bb['stages']?.[_0x5f12fc(0x19e)](_0x5390ec=>formatStageStats(_0x5390ec,_0x54e248)),_0x4fee7a=assembleJourneyStats(_0x5e56bb,{'from':_0x207e3c,'to':_0x573e7d,'includeHistory':_0xa793fd});return await this[_0x5f12fc(0xf3)](_0x4fee7a,_0x4732c1??[],_0x13a782),0x0;}async['renderStats'](_0x32c355,_0x29ad70,_0x12c7e6){const _0x1d57f0=a27_0x69e9dc,_0x2fea3c=_0x12c7e6[_0x1d57f0(0x16d)]===_0x1d57f0(0xd1)||_0x12c7e6[_0x1d57f0(0x16d)]===_0x1d57f0(0xe8)||_0x12c7e6[_0x1d57f0(0xd1)]||_0x12c7e6[_0x1d57f0(0xe8)];if(_0x2fea3c){_0x32c355['stages']=_0x29ad70,await handleSingleObjectOutput(_0x32c355,_0x12c7e6);return;}await handleSingleObjectOutput(_0x32c355,_0x12c7e6);for(const _0x1e451a of _0x29ad70){console['log'](''),console[_0x1d57f0(0x132)](String(a27_0x1d22cc['cyan'][_0x1d57f0(0x1b6)]('['+_0x1e451a[_0x1d57f0(0x137)]+']'))+a27_0x1d22cc['dim']('\x20'+_0x1e451a['id']));const {id:_0x13b97f,name:_0x52973a,..._0x41d91c}=_0x1e451a;await handleSingleObjectOutput(_0x41d91c,_0x12c7e6);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0xb8);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x18e);async[a27_0x69e9dc(0xf2)](_0x4ff5b8){const _0x4dc02f=a27_0x69e9dc,{options:_0x334799,args:_0x49e4dd,tdx:_0x555de3}=_0x4ff5b8,_0x2393e9=_0x49e4dd[0x0];if(!requireNameOrPath(_0x2393e9))return 0x1;_0x334799[_0x4dc02f(0xd4)]&&console[_0x4dc02f(0xfa)](_0x4dc02f(0xc2)+_0x2393e9);const _0x2b4268=_0x334799,_0x595d3e=_0x2b4268[_0x4dc02f(0x172)],_0x4bb2a4=_0x2b4268['from'],_0x4714fc=_0x2b4268['to'],_0x2a3ca8=_0x2b4268[_0x4dc02f(0x130)];if(_0x595d3e&&_0x595d3e!=='conversion'&&_0x595d3e!==_0x4dc02f(0x168))return console[_0x4dc02f(0xfa)](_0x4dc02f(0x140)+_0x595d3e+_0x4dc02f(0x108)),0x1;const _0x211174=withJsonFormat(_0x334799),{journeyId:_0x9f0391,journeyName:_0x3d6a71}=await resolveJourneyIdFromInput(_0x2393e9,_0x211174,_0x555de3),_0x14c2d1={'type':_0x595d3e,'from':_0x4bb2a4,'to':_0x4714fc,'limit':_0x2a3ca8},_0x283fc3=await withSpinner(_0x4dc02f(0x1a9),()=>_0x555de3['journey'][_0x4dc02f(0x190)](_0x9f0391,_0x14c2d1),{'verbose':_0x211174[_0x4dc02f(0xd4)]}),_0x244208=_0x283fc3[_0x4dc02f(0x131)],_0x4c2db7=_0x244208[_0x4dc02f(0xd0)]&&(_0x244208['conversion']['nodes'][_0x4dc02f(0xed)]>0x0||_0x244208[_0x4dc02f(0xd0)]['links'][_0x4dc02f(0xed)]>0x0),_0x149cab=_0x244208['activation']&&_0x244208[_0x4dc02f(0x168)][_0x4dc02f(0xed)]>0x0;if(!_0x4c2db7&&!_0x149cab)return console[_0x4dc02f(0xfa)](_0x4dc02f(0x15f)+_0x3d6a71),console[_0x4dc02f(0xfa)](_0x4dc02f(0x178)),_0x4bb2a4&&_0x4714fc&&console[_0x4dc02f(0xfa)](_0x4dc02f(0x16e)),0x0;return await handleSingleObjectOutput(_0x244208,_0x211174),0x0;}}function formatStageStats(_0x217c8b,_0x2756c9){const _0x45a3fa=a27_0x69e9dc,_0x4ec43d=_0x2756c9['hasPeriod']&&_0x217c8b['history']?.['length']?aggregateStageHistory(_0x217c8b['history']):{'size':_0x217c8b[_0x45a3fa(0x183)],'entered':_0x217c8b['enteredSize'],'milestone':_0x217c8b[_0x45a3fa(0x1a1)],'milestone_rate':_0x217c8b[_0x45a3fa(0x14e)],'exit_or_jump':_0x217c8b[_0x45a3fa(0x1cb)],'exit_or_jump_rate':_0x217c8b[_0x45a3fa(0xc0)]},_0x41df7f={'id':_0x217c8b['id'],'name':_0x2756c9['stageNameMap'][_0x45a3fa(0xf8)](_0x217c8b['id'])??_0x217c8b['id'],..._0x4ec43d};return _0x2756c9['hasPeriod']&&_0x2756c9[_0x45a3fa(0xde)]&&_0x217c8b[_0x45a3fa(0x191)]&&(_0x41df7f['history']=_0x217c8b[_0x45a3fa(0x191)]),_0x41df7f;}export class JourneyPauseCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0xf4);['description']=a27_0x69e9dc(0x111);async['execute'](_0x59fd3b){const _0x3ae492=a27_0x69e9dc,{options:_0x14b18e,args:_0x182a4b,tdx:_0xe302cd}=_0x59fd3b,_0x469724=_0x182a4b[0x0];if(!requireNameOrPath(_0x469724))return 0x1;_0x14b18e[_0x3ae492(0xd4)]&&console[_0x3ae492(0xfa)]('Input:\x20'+_0x469724);const {journeyId:_0x253451,journeyName:_0x380fff}=await resolveJourneyIdFromInput(_0x469724,_0x14b18e,_0xe302cd);if(!_0x14b18e['yes']){const _0x451845=await confirm(_0x3ae492(0x19b)+_0x380fff+'\x22?');if(!_0x451845)return console[_0x3ae492(0xfa)](_0x3ae492(0xe2)),0x0;}const _0x1f9f00=await withSpinner(_0x3ae492(0x17e),()=>_0xe302cd[_0x3ae492(0x13b)][_0x3ae492(0xd2)](_0x253451),{'verbose':_0x14b18e[_0x3ae492(0xd4)]}),_0x16b819=_0x1f9f00[_0x3ae492(0x131)];return console[_0x3ae492(0xfa)](_0x3ae492(0x1a7)+_0x16b819[_0x3ae492(0xbe)][_0x3ae492(0x137)]+_0x3ae492(0x166)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x16c);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x18d);async[a27_0x69e9dc(0xf2)](_0x3bc554){const _0x33752b=a27_0x69e9dc,{options:_0x3ef1e4,args:_0x4d73ba,tdx:_0x170a25}=_0x3bc554,_0x45382f=_0x4d73ba[0x0];if(!requireNameOrPath(_0x45382f))return 0x1;_0x3ef1e4[_0x33752b(0xd4)]&&console[_0x33752b(0xfa)](_0x33752b(0xc2)+_0x45382f);const {journeyId:_0xf88e71,journeyName:_0x106c3f}=await resolveJourneyIdFromInput(_0x45382f,_0x3ef1e4,_0x170a25);if(!_0x3ef1e4[_0x33752b(0x125)]){const _0x5b251b=await confirm(_0x33752b(0x1ba)+_0x106c3f+'\x22?');if(!_0x5b251b)return console[_0x33752b(0xfa)]('Cancelled'),0x0;}const _0x11c88c=await withSpinner(_0x33752b(0x109),()=>_0x170a25[_0x33752b(0x13b)][_0x33752b(0x1b4)](_0xf88e71),{'verbose':_0x3ef1e4[_0x33752b(0xd4)]}),_0x4cc239=_0x11c88c[_0x33752b(0x131)];return console[_0x33752b(0xfa)](_0x33752b(0x1a7)+_0x4cc239[_0x33752b(0xbe)][_0x33752b(0x137)]+'\x22\x20resumed'),0x0;}}function a27_0x26e4(_0x1378b8,_0x167350){_0x1378b8=_0x1378b8-0xb4;const _0x1d10b7=a27_0x1d10();let _0x26e4fe=_0x1d10b7[_0x1378b8];return _0x26e4fe;}export class JourneyPullCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x14b);['description']=a27_0x69e9dc(0x18c);async[a27_0x69e9dc(0xf2)](_0x147011){const _0x235556=a27_0x69e9dc,{options:_0x54b4f9,args:_0x1d7f44,tdx:_0x4ca9b8}=_0x147011,_0x3e6dea=_0x54b4f9,_0x41a588=_0x1d7f44[0x0],_0x1dd172=_0x41a588&&isYamlFilePath(_0x41a588),_0x34c8eb=await resolveTarget({'arg':_0x1dd172?_0x41a588:undefined,'contextParent':_0x54b4f9[_0x235556(0xc6)],'cwd':process[_0x235556(0x1a4)]()});if(!isSuccessfulResolution(_0x34c8eb))return _0x34c8eb['errorCode']===_0x235556(0x19f)?(console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xea)](_0x235556(0xe6))),console['error'](_0x235556(0x114)),console['error'](_0x235556(0x10e)),console[_0x235556(0xfa)](_0x235556(0x186)),console[_0x235556(0xfa)](_0x235556(0xd5))):(console[_0x235556(0xfa)](a27_0x1d22cc['red'](_0x235556(0x122)+_0x34c8eb[_0x235556(0x177)]+'\x0a')),_0x34c8eb['helpText']&&console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0x182)](_0x34c8eb[_0x235556(0x10c)]))),0x1;let _0x69f1cb=_0x1dd172?undefined:_0x41a588,_0x318f1c,_0xb08bad;_0x34c8eb[_0x235556(0x172)]===_0x235556(0x19a)&&(_0x69f1cb=_0x34c8eb['resourceName'],_0x318f1c=_0x34c8eb[_0x235556(0x12d)],_0xb08bad=_0x34c8eb[_0x235556(0x126)]);const _0x201548=_0x34c8eb[_0x235556(0xc4)],_0x8faad3=_0x34c8eb[_0x235556(0xb4)];_0x3e6dea[_0x235556(0xd4)]&&(console[_0x235556(0xfa)](_0x235556(0x14f)+_0x201548),console[_0x235556(0xfa)](_0x235556(0x179)+_0x8faad3),_0x69f1cb&&console['error']('Journey\x20name:\x20'+_0x69f1cb),_0x318f1c&&console[_0x235556(0xfa)](_0x235556(0xdb)+_0x318f1c),_0xb08bad&&console['error'](_0x235556(0x10d)+_0xb08bad));const _0x7c65d9=await withSpinner(_0x235556(0xf9),()=>_0x4ca9b8[_0x235556(0x102)]['resolveParentId'](_0x201548),{'verbose':_0x54b4f9[_0x235556(0xd4)]}),_0x5af1ae=_0x7c65d9['data'],{journeys:_0x42d94b,folders:_0x42d49e}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x8861c6=_0x235556,[_0x179572,_0x1f5ccc]=await Promise[_0x8861c6(0xe0)]([_0x4ca9b8[_0x8861c6(0x13b)][_0x8861c6(0xdf)](_0x5af1ae,undefined,{'includeAllVersions':!![]}),_0x4ca9b8['segment']['listFolders'](_0x5af1ae)]);return{'journeys':_0x179572,'folders':_0x1f5ccc};},{'verbose':_0x54b4f9['verbose']})[_0x235556(0xc5)](_0x133c22=>_0x133c22[_0x235556(0x131)]);let _0x9234d1=_0x42d94b;const _0x34c163=buildFolderIdToPathMap(_0x42d49e);if(_0x69f1cb){const _0x42ac62=_0x9234d1['filter'](_0x36461d=>_0x36461d[_0x235556(0x151)][_0x235556(0xb7)]()===_0x69f1cb[_0x235556(0xb7)]());if(_0x42ac62[_0x235556(0xed)]===0x0)return console['error'](_0x235556(0x1aa)+_0x69f1cb),console[_0x235556(0xfa)](_0x235556(0x1bc)),0x1;_0x9234d1=_0x42ac62;}if(_0xb08bad!==undefined){const _0x23eba9=_0x9234d1[_0x235556(0x12f)](_0x20c574=>{const _0x1e947b=_0x235556,_0x1f54f5=_0x20c574[_0x1e947b(0xbf)]?_0x34c163[_0x1e947b(0xf8)](_0x20c574[_0x1e947b(0xbf)])||'':'';return _0x1f54f5===_0xb08bad;});if(_0x23eba9[_0x235556(0xed)]===0x0&&_0x9234d1[_0x235556(0xed)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x69f1cb+_0x235556(0xc9)+(_0xb08bad||_0x235556(0x11b))),console['error'](_0x235556(0xf1));for(const _0xe50ed4 of _0x9234d1){const _0xee9818=_0xe50ed4[_0x235556(0xbf)]?_0x34c163[_0x235556(0xf8)](_0xe50ed4[_0x235556(0xbf)])||'':'';console[_0x235556(0xfa)](_0x235556(0x161)+(_0xee9818||_0x235556(0xcc))+'/'+_0xe50ed4['journeyBundleName']);}return 0x1;}_0x9234d1=_0x23eba9;}if(_0x9234d1[_0x235556(0xed)]===0x0)return console[_0x235556(0xfa)]('No\x20journeys\x20found'),0x0;const _0x163d6e=new Map();for(const _0x3968c6 of _0x9234d1){const _0x493be5=_0x3968c6['journeyBundleId'];!_0x163d6e['has'](_0x493be5)&&_0x163d6e[_0x235556(0x152)](_0x493be5,[]),_0x163d6e[_0x235556(0xf8)](_0x493be5)[_0x235556(0x146)](_0x3968c6);}for(const _0x47e5fb of _0x163d6e[_0x235556(0xd7)]()){_0x47e5fb[_0x235556(0x162)]((_0xdbe8e0,_0x3aea7a)=>(_0xdbe8e0[_0x235556(0x1b7)]||0x0)-(_0x3aea7a['versionNumber']||0x0));}const _0x70fb66=[],{idToEmailMap:_0x4a7aa9,connectionIdToNameMap:_0x2aa76c}=await withSpinner(_0x235556(0x13f),async()=>{const _0x25c71a=_0x235556,[_0x17b60f,_0x4b5847]=await Promise[_0x25c71a(0xe0)]([_0x4ca9b8[_0x25c71a(0x17d)][_0x25c71a(0x159)](),_0x4ca9b8[_0x25c71a(0xd6)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x17b60f,'connectionIdToNameMap':_0x4b5847};},{'verbose':_0x54b4f9[_0x235556(0xd4)]})[_0x235556(0xc5)](_0x6c42e6=>_0x6c42e6['data']);for(const _0x395ca8 of _0x163d6e[_0x235556(0xd7)]()){const _0x3d439c=_0x395ca8[0x0][_0x235556(0x151)],_0x242f1b=_0x395ca8[0x0]['folderId'],_0x5e82d7=_0x242f1b?_0x34c163[_0x235556(0xf8)](_0x242f1b)||'':'',_0x51b823=_0x5e82d7?a27_0x533657[_0x235556(0x11e)](_0x8faad3,_0x5e82d7):_0x8faad3,_0x25715f=_0x318f1c||a27_0x533657[_0x235556(0x11e)](_0x51b823,sanitizeFileName(_0x3d439c)+_0x235556(0x1c5));let _0x4a51ac,_0x5f1fb3;if(existsSync(_0x25715f))try{const _0x2ebeb4=readFileSync(_0x25715f,_0x235556(0x1c6)),_0x9642e8=parseYamlString(_0x2ebeb4);_0x5f1fb3=_0x9642e8,_0x4a51ac=buildRuleToNameMapping(_0x9642e8),_0x3e6dea[_0x235556(0xd4)]&&_0x4a51ac['size']>0x0&&console[_0x235556(0xfa)](_0x235556(0x170)+_0x4a51ac[_0x235556(0x183)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x3d439c);}catch(_0x2a9168){_0x3e6dea[_0x235556(0xd4)]&&console[_0x235556(0xfa)](_0x235556(0x1af)+_0x2a9168[_0x235556(0x177)]);}const _0x57f2bc=[],_0x431a45=new Set(),_0x5db5fa=new Map(),_0x18d414=new Map(),_0x58093a=new Set(),_0x2f6020=new Map(),_0x51cb7b=new Map(),_0x26dc8a=createJumpTargetCache();await withProgressSpinner(_0x235556(0x14c)+_0x3d439c+_0x235556(0x147),async _0x1c1d73=>{const _0x2552a2=_0x235556;for(const _0x5afec0 of _0x395ca8){const _0x45c388=_0x395ca8[_0x2552a2(0xed)]>0x1?_0x5afec0[_0x2552a2(0x151)]+'\x20v'+(_0x5afec0['versionNumber']||0x1):_0x5afec0['journeyBundleName'];_0x1c1d73[_0x2552a2(0xb6)](_0x2552a2(0x14c)+_0x45c388);const _0x51c36b=await _0x4ca9b8[_0x2552a2(0x13b)][_0x2552a2(0x17c)](_0x5afec0['id']),_0x190823=_0x51c36b['attributes']?.[_0x2552a2(0x145)],_0x2e6e9d={'resolveSegment':async _0x2bb824=>{const _0x1e4951=_0x2552a2;if(!_0x190823)return{'name':_0x2bb824,'isJourneyLocal':![]};const _0x3f37c1=_0x5db5fa['get'](_0x2bb824);if(_0x3f37c1)return _0x3f37c1;try{const _0x51fa22=await _0x4ca9b8[_0x1e4951(0x102)][_0x1e4951(0x1bb)](_0x190823,_0x2bb824),_0x548e93=_0x51fa22['kind']===SEGMENT_KIND_JOURNEY;let _0xa747d8,_0x4232ed=_0x51fa22['name'];if(_0x548e93&&_0x51fa22[_0x1e4951(0x160)]){const _0x3ef7e4=await segmentResponseToDef(_0x51fa22,{'resolveSegmentName':async _0x54d0b4=>{const _0xe68b49=_0x1e4951,_0x13b585=_0x5db5fa['get'](_0x54d0b4);if(_0x13b585)return _0x13b585[_0xe68b49(0x137)];const _0x19f97b=await _0x2e6e9d[_0xe68b49(0x1c0)](_0x54d0b4);return _0x19f97b['name'];}}),_0x5b8a73=_0x3ef7e4[_0x1e4951(0x160)];_0xa747d8={'description':_0x51fa22[_0x1e4951(0xda)],'rule':_0x5b8a73};const _0xf3bf0f=serializeRule(_0x5b8a73),_0x73e46c=_0x18d414[_0x1e4951(0xf8)](_0xf3bf0f);if(_0x73e46c)_0x4232ed=_0x73e46c,_0xa747d8=undefined,_0x3e6dea[_0x1e4951(0xd4)]&&console[_0x1e4951(0xfa)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x51fa22[_0x1e4951(0x137)]+_0x1e4951(0xd3)+_0x73e46c);else{let _0xaf7a23=![];if(_0x4a51ac){const _0x1f48dd=_0x4a51ac['get'](_0xf3bf0f);if(_0x1f48dd){const _0x235df9=_0x1f48dd[_0x1e4951(0x119)](_0x57c1e3=>!_0x431a45[_0x1e4951(0x1c1)](_0x57c1e3));_0x235df9&&(_0x4232ed=_0x235df9,_0x431a45[_0x1e4951(0x15b)](_0x235df9),_0x18d414[_0x1e4951(0x152)](_0xf3bf0f,_0x235df9),_0xaf7a23=!![],_0x3e6dea['verbose']&&console[_0x1e4951(0xfa)](_0x1e4951(0x1b5)+_0x235df9+'\x20(rule\x20match)'));}}if(!_0xaf7a23){const _0x111cfa=generateJourneyLocalName(_0x51fa22[_0x1e4951(0x137)]);_0x111cfa&&(_0x4232ed=_0x111cfa);let _0x90497a=_0x4232ed,_0x52a16a=0x2;while(_0x431a45['has'](_0x90497a)){_0x90497a=_0x4232ed+'_'+_0x52a16a,_0x52a16a++;}_0x431a45[_0x1e4951(0x15b)](_0x90497a),_0x18d414[_0x1e4951(0x152)](_0xf3bf0f,_0x90497a),_0x4232ed=_0x90497a;}}}const _0x1fc7de={'name':_0x4232ed,'isJourneyLocal':_0x548e93,'definition':_0xa747d8};return _0x5db5fa[_0x1e4951(0x152)](_0x2bb824,_0x1fc7de),_0x1fc7de;}catch(_0x365589){return _0x54b4f9[_0x1e4951(0xd4)]&&console[_0x1e4951(0xfa)](_0x1e4951(0x154)+_0x2bb824+':\x20'+_0x365589[_0x1e4951(0x177)]),{'name':_0x2bb824,'isJourneyLocal':![]};}},'resolveActivation':async _0x7f9c9d=>{const _0x3cd4c0=_0x2552a2,_0x4b8240=_0x2f6020[_0x3cd4c0(0xf8)](_0x7f9c9d);if(_0x4b8240)return _0x4b8240;try{const _0x28155a=await _0x4ca9b8[_0x3cd4c0(0x13b)][_0x3cd4c0(0x1b1)](_0x5afec0['id'],_0x7f9c9d),_0x2d0639=journeyActivationStepToYaml(_0x28155a,_0x4a7aa9,_0x2aa76c),_0x38534f=JSON['stringify']({'name':_0x2d0639[_0x3cd4c0(0x137)],'connection':_0x2d0639[_0x3cd4c0(0xd6)],'connector_config':_0x2d0639[_0x3cd4c0(0x12a)]}),_0x598ce0=_0x51cb7b[_0x3cd4c0(0xf8)](_0x38534f);if(_0x598ce0){const _0x200291={'name':_0x598ce0,'isJourneyLocal':!![],'definition':_0x2d0639};return _0x2f6020[_0x3cd4c0(0x152)](_0x7f9c9d,_0x200291),_0x200291;}const _0x202895=_0x28155a[_0x3cd4c0(0xbe)][_0x3cd4c0(0x101)][_0x3cd4c0(0x137)]||_0x7f9c9d,_0x2d9636=sanitizeYamlKey(_0x202895)||_0x3cd4c0(0x193)+_0x7f9c9d;let _0x5af3bb=_0x2d9636,_0x5005b0=0x2;while(_0x58093a[_0x3cd4c0(0x1c1)](_0x5af3bb)){_0x5af3bb=_0x2d9636+'_'+_0x5005b0,_0x5005b0++;}_0x58093a[_0x3cd4c0(0x15b)](_0x5af3bb),_0x51cb7b[_0x3cd4c0(0x152)](_0x38534f,_0x5af3bb);const _0x1d8e9e={'name':_0x5af3bb,'isJourneyLocal':!![],'definition':_0x2d0639};return _0x2f6020[_0x3cd4c0(0x152)](_0x7f9c9d,_0x1d8e9e),_0x1d8e9e;}catch(_0x2a9d5a){return _0x54b4f9['verbose']&&console[_0x3cd4c0(0xfa)](_0x3cd4c0(0x107)+_0x7f9c9d+':\x20'+_0x2a9d5a[_0x3cd4c0(0x177)]),{'name':_0x7f9c9d,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x185a47,_0x149895)=>{const _0x63105e=_0x2552a2;return resolveJumpTarget(_0x185a47,_0x149895,_0x26dc8a,_0x3af7ae=>_0x4ca9b8[_0x63105e(0x13b)]['getJourney'](_0x3af7ae));}},_0x1cd4a1=await journeyResponseToDef(_0x51c36b,_0x2e6e9d);_0x57f2bc[_0x2552a2(0x146)]({'item':_0x5afec0,'yaml':_0x1cd4a1});}},{'verbose':_0x54b4f9[_0x235556(0xd4)]});const _0x49a847=await _0x4ca9b8[_0x235556(0x13b)][_0x235556(0xf5)](_0x395ca8[0x0][_0x235556(0x169)]),_0xab5002=buildMergedJourneyDef(_0x57f2bc,_0x4a51ac,_0x49a847),_0x22364e=normalizeJourneyDef(_0xab5002,_0x5f1fb3),_0x941c3f=toYamlString(_0x22364e),_0x1541a9=_0x318f1c||a27_0x533657[_0x235556(0x11e)](_0x51b823,sanitizeFileName(_0x3d439c)+_0x235556(0x1c5));!_0x318f1c&&_0x5e82d7&&!existsSync(_0x51b823)&&mkdirSync(_0x51b823,{'recursive':!![]});const _0x1124ef=a27_0x533657[_0x235556(0x1c2)](process['cwd'](),_0x1541a9);if(existsSync(_0x1541a9)){const _0x126576=readFileSync(_0x1541a9,_0x235556(0x1c6)),_0x385f7b=generateDiff(_0x126576,_0x941c3f),_0x43202b=hasChanges(_0x385f7b);_0x70fb66['push']({'relativePath':_0x1124ef,'absolutePath':_0x1541a9,'content':_0x941c3f,'isNew':![],'hasChanges':_0x43202b,'diff':_0x43202b?formatDiffWithColors(_0x385f7b):undefined});}else _0x70fb66['push']({'relativePath':_0x1124ef,'absolutePath':_0x1541a9,'content':_0x941c3f,'isNew':!![],'hasChanges':![]});}const _0x5092c2=_0x70fb66[_0x235556(0x12f)](_0x4a3760=>_0x4a3760[_0x235556(0x1bf)]),_0x4d9d93=_0x70fb66[_0x235556(0x12f)](_0x30ddfc=>!_0x30ddfc['isNew']&&_0x30ddfc[_0x235556(0x11a)]),_0x42250a=_0x70fb66['filter'](_0x2f40d4=>!_0x2f40d4[_0x235556(0x1bf)]&&!_0x2f40d4[_0x235556(0x11a)]),_0x314b9e=_0x9234d1[_0x235556(0xed)],_0x20ccb7=_0x163d6e[_0x235556(0x183)],_0x4711c6=_0x314b9e>_0x20ccb7?'\x20('+_0x314b9e+_0x235556(0x16a):'';console[_0x235556(0xfa)](_0x235556(0xfd)),console['error']('\x20\x20'+a27_0x1d22cc[_0x235556(0x182)](_0x20ccb7+_0x235556(0xc1))+a27_0x1d22cc[_0x235556(0x124)](_0x4711c6)),console[_0x235556(0xfa)]('\x20\x20'+a27_0x1d22cc[_0x235556(0xb5)]('+\x20'+_0x5092c2[_0x235556(0xed)]+'\x20new\x20files')),console['error']('\x20\x20'+a27_0x1d22cc[_0x235556(0xea)]('~\x20'+_0x4d9d93[_0x235556(0xed)]+_0x235556(0x1b0))),console[_0x235556(0xfa)]('\x20\x20'+a27_0x1d22cc[_0x235556(0x124)]('=\x20'+_0x42250a[_0x235556(0xed)]+'\x20unchanged\x20files')),console[_0x235556(0xfa)](_0x235556(0xce)+a27_0x1d22cc[_0x235556(0x182)](_0x8faad3)+'\x0a');if(_0x4d9d93['length']>0x0)for(const _0x1d706b of _0x4d9d93){console[_0x235556(0xfa)](_0x235556(0x1ae)+_0x1d706b[_0x235556(0xd9)]+'\x27:'),console[_0x235556(0xfa)]('─'['repeat'](0x3c)),console[_0x235556(0xfa)](_0x1d706b['diff']),console['error']('─'[_0x235556(0xef)](0x3c));}if(_0x3e6dea[_0x235556(0x106)])return console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xea)](_0x235556(0x163))),0x0;if(_0x5092c2[_0x235556(0xed)]===0x0&&_0x4d9d93[_0x235556(0xed)]===0x0)return console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xb5)](_0x235556(0x12b))),saveSessionContext({'parent_segment':_0x201548},_0x3e6dea['session']),console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xb5)](_0x235556(0x115)+a27_0x1d22cc[_0x235556(0x124)](_0x235556(0x15d))+_0x235556(0x18f)+a27_0x1d22cc[_0x235556(0x182)](_0x201548))),0x0;if(!_0x3e6dea[_0x235556(0x125)]&&(_0x5092c2[_0x235556(0xed)]>0x0||_0x4d9d93[_0x235556(0xed)]>0x0)){if(!isInteractive())return console[_0x235556(0xfa)](a27_0x1d22cc['red']('\x0aError:'),_0x235556(0x19d)),console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0x124)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x14d95d=await confirmKey(_0x235556(0x195)+(_0x5092c2['length']+_0x4d9d93[_0x235556(0xed)])+_0x235556(0xbd));if(!_0x14d95d)return console[_0x235556(0xfa)](a27_0x1d22cc['yellow'](_0x235556(0xcb)),_0x235556(0x197)),0x1;}!existsSync(_0x8faad3)&&mkdirSync(_0x8faad3,{'recursive':!![]});const _0x4f47cd=a27_0x533657[_0x235556(0x11e)](_0x8faad3,'tdx.json');writeFileSync(_0x4f47cd,createTdxConfigContent(_0x201548),'utf-8');for(const _0x13366f of _0x70fb66){(_0x13366f['isNew']||_0x13366f['hasChanges'])&&writeFileSync(_0x13366f[_0x235556(0x10b)],_0x13366f['content'],_0x235556(0x1c6));}return console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xb5)]('✔\x20Pulled\x20'+(_0x5092c2[_0x235556(0xed)]+_0x4d9d93[_0x235556(0xed)])+_0x235556(0x1b3)+_0x8faad3)),saveSessionContext({'parent_segment':_0x201548},_0x3e6dea[_0x235556(0x129)]),console[_0x235556(0xfa)](a27_0x1d22cc[_0x235556(0xb5)](_0x235556(0x115)+a27_0x1d22cc['dim'](_0x235556(0x15d))+_0x235556(0x18f)+a27_0x1d22cc['cyan'](_0x201548))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x134);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x142);async['execute'](_0x24f442){const _0x38fea5=a27_0x69e9dc,{options:_0x2a9dc0,args:_0x3d02a3,tdx:_0x495803}=_0x24f442,_0x2d4b2e=_0x3d02a3[0x0];if(!requireNameOrPath(_0x2d4b2e))return 0x1;_0x2a9dc0[_0x38fea5(0xd4)]&&console['error'](_0x38fea5(0xc2)+_0x2d4b2e);const {journeyId:_0x4c94d9}=await resolveJourneyIdFromInput(_0x2d4b2e,_0x2a9dc0,_0x495803),_0x3874b1=await withSpinner(_0x38fea5(0x17b),()=>_0x495803[_0x38fea5(0x13b)][_0x38fea5(0x1ca)](_0x4c94d9),{'verbose':_0x2a9dc0[_0x38fea5(0xd4)]}),_0x45688d=_0x3874b1['data'];return console[_0x38fea5(0x132)](_0x38fea5(0x1b9)+_0x45688d['database']),console['log'](_0x38fea5(0x118)+_0x45688d[_0x38fea5(0xfc)]),await handleSDKOutput(_0x45688d[_0x38fea5(0x123)],_0x2a9dc0),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x69e9dc(0x155);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x17f);async[a27_0x69e9dc(0xf2)](_0x374c44){const _0x50ff5b=a27_0x69e9dc,{options:_0x4f4cac,args:_0x4961d7,tdx:_0xfd8655}=_0x374c44,_0x29ae5a=_0x4961d7[0x0];if(!requireNameOrPath(_0x29ae5a))return 0x1;_0x4f4cac[_0x50ff5b(0xd4)]&&console[_0x50ff5b(0xfa)](_0x50ff5b(0xc2)+_0x29ae5a);const {journeyId:_0x1cd200}=await resolveJourneyIdFromInput(_0x29ae5a,_0x4f4cac,_0xfd8655),_0x188a92=await withSpinner(_0x50ff5b(0x1ab),()=>_0xfd8655[_0x50ff5b(0x13b)][_0x50ff5b(0x167)](_0x1cd200),{'verbose':_0x4f4cac[_0x50ff5b(0xd4)]}),_0x399743=_0x188a92[_0x50ff5b(0x131)];return console['error'](_0x50ff5b(0x170)+_0x399743[_0x50ff5b(0xed)]+_0x50ff5b(0x144)+(_0x399743['length']!==0x1?'s':'')),await handleSDKOutput(_0x399743,_0x4f4cac),0x0;}}function a27_0x1d10(){const _0x53e74b=['journey:columns','updatedAt','\x20\x20Name:\x20','name','journey:list','blue','tsv','journey','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Listing\x20journey\x20versions...','stage','Fetching\x20users\x20and\x20connections...','Error:\x20Invalid\x20--type\x20\x22','replace','Show\x20journey\x20table\x20column\x20mapping','\x5c$&','\x20activation','audienceId','push','...','No\x20statistics\x20available\x20for\x20journey:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','split','journey:pull','Fetching\x20','journey:versions','completeMilestoneRate','Parent\x20segment:\x20','\x20\x20Folder\x20path:\x20','journeyBundleName','set','from','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journey:activations','Getting\x20version\x20','localeCompare','resolveParentId','buildIdToEmailMap','/app/ps/','add','journey:version:view','parent_segment','Available\x20stages:\x20','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','rule','\x20\x20-\x20','sort','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','rootFolderId','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x22\x20paused','listActivationsFlat','activation','journeyBundleId','\x20versions)','enteredSize','journey:resume','format','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Pattern:\x20','Found\x20','site','type','\x20(draft)\x20—\x20\x22','test','createdAt','stages','message','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Target\x20directory:\x20','\x20version','Getting\x20column\x20mapping...','getJourney','user','Pausing\x20journey...','List\x20activations\x20for\x20a\x20journey','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','2274937VABYyW','cyan','size','options','entries','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20journey','/j/da','journeyStages','7064045nXYZAW','archived','Export\x20journey(s)\x20as\x20YAML\x20files','Resume\x20a\x20paused\x20journey','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x20=\x20','getTrafficData','history','/e/','activation_','journey:version:create','Write\x20','\x20\x20Parent\x20segment:\x20','-\x20no\x20files\x20written','34021880qErJpg','INVALID_ARGUMENT','file','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','resolveJourneyId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','map','no_parent','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','milestoneSize','Show\x20journey\x20statistics','Error:\x20Invalid\x20version\x20number:\x20','cwd','\x20details...','9488WoIInt','✔\x20Journey\x20\x22','(draft)','Getting\x20journey\x20traffic\x20data...','Error:\x20Journey\x20not\x20found:\x20','Listing\x20journey\x20activations...','segmentName','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x0aChanges\x20to\x20\x27','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x20changed\x20files','getActivation','journeyName','\x20journey\x20files\x20to\x20','resume','\x20\x20Preserving\x20local\x20segment\x20name:\x20','bold','versionNumber','Creating\x20new\x20version...','Database:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','getSegment','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','🗺️\x20','createVersion','isNew','resolveSegment','has','relative','(running)','Listing\x20journeys...','.yml','utf-8','journey:stats','Resolving\x20version...','goal','getColumnMapping','exitOrJumpSize','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','targetDir','green','setPhase','toLowerCase','journey:traffic','4058805IlbyvG','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20\x20Statistics\x20not\x20available','List\x20all\x20versions\x20of\x20a\x20journey','\x20files?','attributes','folderId','exitOrJumpRate','\x20journeys','Input:\x20','(paused)','parentName','then','parentSegment','listVersions','Options:','\x27\x20not\x20found\x20in\x20','12zJkqNz','Aborted.','(root)','includeStats','\x20\x20Target:\x20','segments','conversion','json','pause','\x20->\x20','verbose','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','connection','values','base','relativePath','description','Target\x20file:\x20','Getting\x20journey\x20details...','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','includeHistory','listJourneysFromParentSegment','all','\x20(ID:\x20','Cancelled','completed','args','11sviDgE','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20Created\x20v','jsonl','Fetching\x20parent\x20segment...','yellow','journeyId','segmentPushCommand','length','Show\x20journey\x20details','repeat','folders','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','execute','renderStats','journey:pause','getLatestJourneyId','web','paused','get','Resolving\x20parent\x20segment...','error','Resolving\x20journey...','table','\x0aPull\x20summary:','getStatistics','Error:\x20Stage\x20\x22','7902xAMGDV','activationParams','segment','getParentFull','state','goalSize','dryRun','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Resuming\x20journey...','journey:view','absolutePath','helpText','Folder\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','(completed)','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Pause\x20a\x20running\x20journey','/j/da/je','journey:push','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','✔\x20Context\x20set:\x20','1072730nAuSSt','\x20Opening\x20','Table:\x20','find','hasChanges','root\x20folder','(archived)','version','join','\x20\x20Journey\x20ID:\x20','reentryMode','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Error:\x20','columns','dim','yes','folderPath','View\x20a\x20specific\x20version\x20of\x20a\x20journey','4aFsUXW','session','connector_config','✔\x20All\x20files\x20are\x20up\x20to\x20date','1009779jomyjJ','filePath','Getting\x20journey\x20statistics...','filter','limit','data','log','\x22\x20not\x20found'];a27_0x1d10=function(){return _0x53e74b;};return a27_0x1d10();}export class JourneyPushCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x113);[a27_0x69e9dc(0xda)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';['segmentPushCommand']=new SegmentPushCommand();async[a27_0x69e9dc(0xf2)](_0xa289da){const _0x2c58c0=a27_0x69e9dc,_0x1cff25=_0xa289da[_0x2c58c0(0xe4)][0x0];let _0x4de020;if(_0x1cff25){const _0x21af82=await resolveTarget({'arg':_0x1cff25,'contextParent':_0xa289da[_0x2c58c0(0x184)][_0x2c58c0(0xc6)],'cwd':process[_0x2c58c0(0x1a4)]()});isSuccessfulResolution(_0x21af82)&&_0x21af82['type']===_0x2c58c0(0x19a)&&(_0x4de020=_0x21af82[_0x2c58c0(0x12d)]);}const _0x48ba5a={..._0xa289da,'options':{..._0xa289da[_0x2c58c0(0x184)],'journeysOnly':!![],..._0x4de020&&{'singleFilePath':_0x4de020}}};return this[_0x2c58c0(0xec)][_0x2c58c0(0xf2)](_0x48ba5a);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x14d);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0xbc);async[a27_0x69e9dc(0xf2)](_0x1f12ea){const _0x2b8e2c=a27_0x69e9dc,{options:_0x2779ff,args:_0x489418,tdx:_0xd5571b}=_0x1f12ea,_0x5bab24=_0x489418[0x0];if(!requireNameOrPath(_0x5bab24))return 0x1;if(_0x2779ff['verbose'])console[_0x2b8e2c(0xfa)]('Input:\x20'+_0x5bab24);const {journeyId:_0x141a45}=await resolveJourneyIdFromInput(_0x5bab24,_0x2779ff,_0xd5571b),_0x2a9658=await withSpinner(_0x2b8e2c(0x13d),()=>_0xd5571b[_0x2b8e2c(0x13b)][_0x2b8e2c(0xc7)](_0x141a45),{'verbose':_0x2779ff[_0x2b8e2c(0xd4)]}),{bundleName:_0x5ac9b1,versions:_0x348556,latestJourneyId:_0x5761dd}=_0x2a9658[_0x2b8e2c(0x131)];console[_0x2b8e2c(0xfa)](_0x5ac9b1+':\x20'+_0x348556[_0x2b8e2c(0xed)]+_0x2b8e2c(0x17a)+(_0x348556[_0x2b8e2c(0xed)]!==0x1?'s':''));const _0x40bea3=_0x348556[_0x2b8e2c(0x19e)](_0x3cb6b8=>({'version':_0x3cb6b8['versionNumber'],'journey_id':_0x3cb6b8[_0x2b8e2c(0xeb)],'name':_0x3cb6b8[_0x2b8e2c(0x137)],'state':_0x3cb6b8[_0x2b8e2c(0x104)],'paused':_0x3cb6b8[_0x2b8e2c(0xf7)],'latest':_0x3cb6b8[_0x2b8e2c(0xeb)]===_0x5761dd,'created_at':_0x3cb6b8['createdAt']}));return await handleSDKOutput(_0x40bea3,_0x2779ff),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x194);[a27_0x69e9dc(0xda)]=a27_0x69e9dc(0x149);async[a27_0x69e9dc(0xf2)](_0x3543cb){const _0x314173=a27_0x69e9dc,{options:_0x38b537,args:_0x532e31,tdx:_0x1067a4}=_0x3543cb,_0x201b2b=_0x532e31[0x0];if(!requireNameOrPath(_0x201b2b))return 0x1;if(_0x38b537[_0x314173(0xd4)])console[_0x314173(0xfa)](_0x314173(0xc2)+_0x201b2b);const {journeyId:_0x5b4e2b,journeyName:_0x1d0ee4}=await resolveJourneyIdFromInput(_0x201b2b,_0x38b537,_0x1067a4);if(!_0x38b537['yes']){const _0x9998b7=await confirm(_0x314173(0xba)+_0x1d0ee4+'\x22?');if(!_0x9998b7)return console[_0x314173(0xfa)]('Cancelled'),0x0;}const _0x12f200=await withSpinner(_0x314173(0x1b8),()=>_0x1067a4['journey'][_0x314173(0x1be)](_0x5b4e2b),{'verbose':_0x38b537[_0x314173(0xd4)]}),_0x59f238=_0x12f200[_0x314173(0x131)];return console[_0x314173(0xfa)](a27_0x1d22cc['green']('✔')+_0x314173(0xe7)+_0x59f238[_0x314173(0xbe)][_0x314173(0x1b7)]+_0x314173(0x173)+_0x59f238[_0x314173(0xbe)]['name']+'\x22'),console['error'](_0x314173(0x11f)+_0x59f238['id']),await handleSingleObjectOutput({'id':_0x59f238['id'],'name':_0x59f238[_0x314173(0xbe)][_0x314173(0x137)],'version':_0x59f238['attributes']['versionNumber'],'state':_0x59f238[_0x314173(0xbe)][_0x314173(0x104)],'bundle_id':_0x59f238[_0x314173(0xbe)][_0x314173(0x169)],'created_at':_0x59f238[_0x314173(0xbe)]['createdAt']},_0x38b537),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x69e9dc(0x137)]=a27_0x69e9dc(0x15c);['description']=a27_0x69e9dc(0x127);async[a27_0x69e9dc(0xf2)](_0x44a034){const _0x50d823=a27_0x69e9dc,{options:_0xb7400e,args:_0x58bdc7,tdx:_0x52f422}=_0x44a034,_0x4d73a2=_0x58bdc7[0x0];if(!requireNameOrPath(_0x4d73a2))return 0x1;const _0x2af1de=_0xb7400e[_0x50d823(0x11d)];if(!_0x2af1de)return console[_0x50d823(0xfa)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x50d823(0xfa)](_0x50d823(0x165)),0x1;const _0x4c7ebd=parseInt(_0x2af1de,0xa);if(isNaN(_0x4c7ebd)||_0x4c7ebd<0x1)return console['error'](_0x50d823(0x1a3)+_0x2af1de),0x1;if(_0xb7400e['verbose'])console[_0x50d823(0xfa)]('Input:\x20'+_0x4d73a2+',\x20version:\x20'+_0x4c7ebd);const {journeyId:_0x40d67f,parentSegmentId:_0xb038c6}=await resolveJourneyIdFromInput(_0x4d73a2,_0xb7400e,_0x52f422),_0x28da61=await withSpinner(_0x50d823(0x1c8),()=>_0x52f422[_0x50d823(0x13b)]['listVersions'](_0x40d67f),{'verbose':_0xb7400e[_0x50d823(0xd4)]}),{versions:_0x4dd0f7,latestJourneyId:_0x2ff2ca}=_0x28da61[_0x50d823(0x131)],_0x25c7a3=_0x4dd0f7[_0x50d823(0x119)](_0x1c7575=>_0x1c7575['versionNumber']===_0x4c7ebd);if(!_0x25c7a3){const _0x3b75de=_0x4dd0f7['map'](_0x1df3c4=>'v'+_0x1df3c4[_0x50d823(0x1b7)])['join'](',\x20');return console[_0x50d823(0xfa)]('Error:\x20Version\x20'+_0x4c7ebd+'\x20not\x20found.\x20Available:\x20'+_0x3b75de),0x1;}const _0x25e0c1=await withSpinner(_0x50d823(0x156)+_0x4c7ebd+_0x50d823(0x1a5),()=>_0x52f422[_0x50d823(0x13b)][_0x50d823(0x17c)](_0x25c7a3['journeyId']),{'verbose':_0xb7400e[_0x50d823(0xd4)]}),_0x47c71b=_0x25e0c1[_0x50d823(0x131)],_0x1596da=getConsoleNextUrl(_0xb7400e[_0x50d823(0x171)],'/app/ps/'+_0xb038c6+'/e/'+_0x25c7a3[_0x50d823(0xeb)]+_0x50d823(0x112));return await handleSingleObjectOutput({'id':_0x47c71b['id'],'name':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x137)],'version':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x1b7)],'description':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0xda)],'state':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x104)],'paused':_0x47c71b['attributes'][_0x50d823(0xf7)],'reentry_mode':_0x47c71b['attributes']['reentryMode'],'stages':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x189)]?.['length']||0x0,..._0x47c71b[_0x50d823(0xbe)][_0x50d823(0x1c9)]&&{'goal':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x1c9)][_0x50d823(0x137)]},'latest':_0x25c7a3[_0x50d823(0xeb)]===_0x2ff2ca,'created_at':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x175)],'updated_at':_0x47c71b[_0x50d823(0xbe)][_0x50d823(0x135)],'url':_0x1596da},_0xb7400e),0x0;}}
@@ -1 +1 @@
1
- const a28_0x3b997d=a28_0x13a3;(function(_0x154248,_0x19bdab){const _0x2a4506=a28_0x13a3,_0x3eb8f7=_0x154248();while(!![]){try{const _0x5307ba=-parseInt(_0x2a4506(0xd9))/0x1+parseInt(_0x2a4506(0x100))/0x2*(parseInt(_0x2a4506(0xf9))/0x3)+parseInt(_0x2a4506(0x10a))/0x4+parseInt(_0x2a4506(0xf0))/0x5*(-parseInt(_0x2a4506(0x10c))/0x6)+-parseInt(_0x2a4506(0xe8))/0x7*(-parseInt(_0x2a4506(0xe1))/0x8)+parseInt(_0x2a4506(0xf7))/0x9*(-parseInt(_0x2a4506(0xfc))/0xa)+parseInt(_0x2a4506(0xe3))/0xb;if(_0x5307ba===_0x19bdab)break;else _0x3eb8f7['push'](_0x3eb8f7['shift']());}catch(_0xbd4841){_0x3eb8f7['push'](_0x3eb8f7['shift']());}}}(a28_0x54f3,0x1f9c2));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a28_0x54f3(){const _0x3c7f27=['315608QIzcgW','file','12198kxLESm','filePath','reason','message','valid','\x20journey(s)\x20valid','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','validCount','\x20warning(s)\x20found','.yml','\x20segment\x20file(s)\x20skipped','execute','126412oQlFSK','warnings','.yaml','\x20journey(s)\x20with\x20errors,\x20','hasErrors','Error:\x20Directory\x20not\x20found:\x20','\x20valid','skippedCount','24kfjFRp','verbose','4803942LHULXk','description','error','helpText','endsWith','7210VabVmw','type','errorCode','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','✔\x20All\x20','invalidCount','yellow','625eLCxWq','\x20segment\x20file(s)\x20skipped)','Validate\x20journey\x20YAML\x20files','parentSegment','cyan','no_parent','journey:validate','48303FFLSVq','No\x20journey\x20YAML\x20files\x20found\x20in\x20','41268WsxBoA','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','170pWOQHw','green','Validation\x20failed:\x20','red','12pJHWNj','\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','targetDir','warningCount','\x20warning(s)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','log','\x20(skipped:\x20','journey','dim'];a28_0x54f3=function(){return _0x3c7f27;};return a28_0x54f3();}import a28_0x525e51 from'chalk';function a28_0x13a3(_0x10643,_0x39f16b){_0x10643=_0x10643-0xd7;const _0x54f31e=a28_0x54f3();let _0x13a347=_0x54f31e[_0x10643];return _0x13a347;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a28_0x3b997d(0xf6);[a28_0x3b997d(0xe4)]=a28_0x3b997d(0xf2);async[a28_0x3b997d(0xd8)](_0x52dc1d){const _0x2065af=a28_0x3b997d,{options:_0x2d6bf3,args:_0x396565}=_0x52dc1d,_0x4ddf4a=_0x2d6bf3,_0x4e9dd6=await resolveTarget({'arg':_0x396565[0x0],'contextParent':_0x2d6bf3[_0x2065af(0xf3)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4e9dd6))return _0x4e9dd6[_0x2065af(0xea)]===_0x2065af(0xf5)?(console[_0x2065af(0xe5)](a28_0x525e51[_0x2065af(0xef)](_0x2065af(0x112))),console[_0x2065af(0xe5)](_0x2065af(0xfb)),console[_0x2065af(0xe5)](_0x2065af(0x101)),console[_0x2065af(0xe5)](_0x2065af(0xfa))):(console[_0x2065af(0xe5)](a28_0x525e51[_0x2065af(0xff)]('Error:\x20'+_0x4e9dd6[_0x2065af(0x10f)]+'\x0a')),_0x4e9dd6['helpText']&&console[_0x2065af(0xe5)](a28_0x525e51[_0x2065af(0xf4)](_0x4e9dd6[_0x2065af(0xe6)]))),0x1;const _0x8ad3bb=_0x4e9dd6[_0x2065af(0x102)],_0x5c1a36=_0x4e9dd6[_0x2065af(0xe9)]===_0x2065af(0x10b)?_0x4e9dd6[_0x2065af(0x10d)]:undefined;if(!_0x5c1a36&&!existsSync(_0x8ad3bb))return console['error'](a28_0x525e51['red'](_0x2065af(0xde)+_0x8ad3bb+'\x0a')),0x1;let _0x3db7b1;if(_0x5c1a36){if(!_0x5c1a36['endsWith'](_0x2065af(0x115))&&!_0x5c1a36[_0x2065af(0xe7)](_0x2065af(0xdb)))return console[_0x2065af(0xe5)](a28_0x525e51[_0x2065af(0xff)](_0x2065af(0x105)+_0x5c1a36+'\x0a')),0x1;_0x3db7b1=[_0x5c1a36];}else _0x3db7b1=findYamlFiles(_0x8ad3bb);if(_0x3db7b1[_0x2065af(0xec)]===0x0)return console['error'](a28_0x525e51['red'](_0x2065af(0xeb)+_0x8ad3bb+'\x0a')),0x1;const _0x495636=validateYamlFiles(_0x3db7b1,_0x8ad3bb,{'filterType':_0x2065af(0x108)}),_0x2345d5=calculateSummary(_0x495636),_0x5d67a2=_0x495636['filter'](isValidationResult);if(_0x5d67a2[_0x2065af(0xec)]===0x0)return console[_0x2065af(0xe5)](a28_0x525e51[_0x2065af(0xef)](_0x2065af(0xf8)+_0x8ad3bb+'\x0a')),_0x2345d5[_0x2065af(0xe0)]>0x0&&console['error'](a28_0x525e51[_0x2065af(0x109)]('('+_0x2345d5[_0x2065af(0xe0)]+_0x2065af(0xf1))),0x0;for(const _0x216ca5 of _0x495636){if(!isValidationResult(_0x216ca5)){_0x4ddf4a[_0x2065af(0xe2)]&&console[_0x2065af(0x106)](a28_0x525e51[_0x2065af(0x109)]('-\x20'+_0x216ca5['relativePath']+_0x2065af(0x107)+_0x216ca5[_0x2065af(0x10e)]+')'));continue;}const {relativePath:_0x4b3f8d,source:_0x1acbd1,result:_0x300cb7}=_0x216ca5;if(_0x300cb7['valid']&&_0x300cb7['warnings']['length']===0x0)_0x4ddf4a[_0x2065af(0xe2)]&&console[_0x2065af(0x106)](a28_0x525e51['green']('✔\x20'+_0x4b3f8d));else _0x300cb7[_0x2065af(0x110)]?(console[_0x2065af(0x106)](a28_0x525e51['yellow']('⚠\x20'+_0x4b3f8d+':\x20'+_0x300cb7[_0x2065af(0xda)]['length']+_0x2065af(0x104))),console['log'](formatValidationResult(_0x300cb7,_0x1acbd1,_0x4b3f8d))):(console[_0x2065af(0x106)](a28_0x525e51['red']('✖\x20'+_0x4b3f8d+':\x20'+_0x300cb7['errors'][_0x2065af(0xec)]+'\x20error(s)')),console[_0x2065af(0x106)](formatValidationResult(_0x300cb7,_0x1acbd1,_0x4b3f8d)));}return console['log'](''),_0x2345d5[_0x2065af(0xdd)]?(console['log'](a28_0x525e51[_0x2065af(0xff)](_0x2065af(0xfe)+_0x2345d5[_0x2065af(0xee)]+_0x2065af(0xdc)+_0x2345d5[_0x2065af(0x113)]+_0x2065af(0xdf))),_0x2345d5['warningCount']>0x0&&console[_0x2065af(0x106)](a28_0x525e51[_0x2065af(0xef)](_0x2345d5['warningCount']+_0x2065af(0x114))),_0x2345d5[_0x2065af(0xe0)]>0x0&&console[_0x2065af(0x106)](a28_0x525e51['dim'](_0x2345d5[_0x2065af(0xe0)]+_0x2065af(0xd7))),0x1):(console[_0x2065af(0x106)](a28_0x525e51[_0x2065af(0xfd)](_0x2065af(0xed)+_0x2345d5[_0x2065af(0x113)]+_0x2065af(0x111))),_0x2345d5[_0x2065af(0x103)]>0x0&&console[_0x2065af(0x106)](a28_0x525e51[_0x2065af(0xef)](_0x2345d5['warningCount']+_0x2065af(0x114))),_0x2345d5['skippedCount']>0x0&&console[_0x2065af(0x106)](a28_0x525e51[_0x2065af(0x109)](_0x2345d5['skippedCount']+_0x2065af(0xd7))),0x0);}}
1
+ const a28_0x1c5f74=a28_0x1b47;(function(_0x29cd95,_0x4872eb){const _0x235978=a28_0x1b47,_0x484ddd=_0x29cd95();while(!![]){try{const _0x1159f0=parseInt(_0x235978(0x16b))/0x1+-parseInt(_0x235978(0x148))/0x2*(parseInt(_0x235978(0x161))/0x3)+parseInt(_0x235978(0x171))/0x4*(-parseInt(_0x235978(0x142))/0x5)+-parseInt(_0x235978(0x153))/0x6+-parseInt(_0x235978(0x173))/0x7+-parseInt(_0x235978(0x13b))/0x8*(parseInt(_0x235978(0x157))/0x9)+parseInt(_0x235978(0x140))/0xa;if(_0x1159f0===_0x4872eb)break;else _0x484ddd['push'](_0x484ddd['shift']());}catch(_0x4400af){_0x484ddd['push'](_0x484ddd['shift']());}}}(a28_0x4144,0xa4262));function a28_0x1b47(_0x59d96d,_0x2d994f){_0x59d96d=_0x59d96d-0x13a;const _0x414428=a28_0x4144();let _0x1b4728=_0x414428[_0x59d96d];return _0x1b4728;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a28_0x4144(){const _0x10967d=['red','1723959fuyMqE','\x20warning(s)\x20found','length','\x20valid','file','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','no_parent','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','filter','1263724QjHxyo','\x20journey(s)\x20valid','\x20segment\x20file(s)\x20skipped','No\x20journey\x20YAML\x20files\x20found\x20in\x20','parentSegment','\x20warning(s)','128eXeYTH','.yml','6486844kxRZuM','message','validCount','warningCount','Error:\x20','log','relativePath','green','name','13864CVWHto','hasErrors','\x20error(s)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','valid','25366540gQVkzD','endsWith','111415VCWptF','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','filePath','yellow','helpText','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','2NTEtEp','✔\x20All\x20','verbose','execute','reason','skippedCount','error','Error:\x20Directory\x20not\x20found:\x20','cyan','warnings','\x20(skipped:\x20','3547710MQzFjv','targetDir','\x20journey(s)\x20with\x20errors,\x20','dim','1674VzBSOL','errorCode','journey:validate','\x20segment\x20file(s)\x20skipped)','invalidCount','Validate\x20journey\x20YAML\x20files','errors','description','.yaml'];a28_0x4144=function(){return _0x10967d;};return a28_0x4144();}import{existsSync}from'fs';import a28_0x4c1b1e from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x1c5f74(0x13a)]=a28_0x1c5f74(0x159);[a28_0x1c5f74(0x15e)]=a28_0x1c5f74(0x15c);async[a28_0x1c5f74(0x14b)](_0x38ee31){const _0x3cfa60=a28_0x1c5f74,{options:_0x507f1a,args:_0x5a9eab}=_0x38ee31,_0x435770=_0x507f1a,_0x1349ce=await resolveTarget({'arg':_0x5a9eab[0x0],'contextParent':_0x507f1a[_0x3cfa60(0x16f)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1349ce))return _0x1349ce[_0x3cfa60(0x158)]===_0x3cfa60(0x167)?(console['error'](a28_0x4c1b1e[_0x3cfa60(0x145)](_0x3cfa60(0x13e))),console[_0x3cfa60(0x14e)](_0x3cfa60(0x166)),console[_0x3cfa60(0x14e)](_0x3cfa60(0x147)),console[_0x3cfa60(0x14e)](_0x3cfa60(0x169))):(console[_0x3cfa60(0x14e)](a28_0x4c1b1e[_0x3cfa60(0x160)](_0x3cfa60(0x177)+_0x1349ce[_0x3cfa60(0x174)]+'\x0a')),_0x1349ce[_0x3cfa60(0x146)]&&console['error'](a28_0x4c1b1e[_0x3cfa60(0x150)](_0x1349ce['helpText']))),0x1;const _0x33b6f4=_0x1349ce[_0x3cfa60(0x154)],_0x60b544=_0x1349ce['type']===_0x3cfa60(0x165)?_0x1349ce[_0x3cfa60(0x144)]:undefined;if(!_0x60b544&&!existsSync(_0x33b6f4))return console['error'](a28_0x4c1b1e[_0x3cfa60(0x160)](_0x3cfa60(0x14f)+_0x33b6f4+'\x0a')),0x1;let _0x72802;if(_0x60b544){if(!_0x60b544[_0x3cfa60(0x141)](_0x3cfa60(0x172))&&!_0x60b544[_0x3cfa60(0x141)](_0x3cfa60(0x15f)))return console[_0x3cfa60(0x14e)](a28_0x4c1b1e['red'](_0x3cfa60(0x168)+_0x60b544+'\x0a')),0x1;_0x72802=[_0x60b544];}else _0x72802=findYamlFiles(_0x33b6f4);if(_0x72802[_0x3cfa60(0x163)]===0x0)return console[_0x3cfa60(0x14e)](a28_0x4c1b1e[_0x3cfa60(0x160)](_0x3cfa60(0x143)+_0x33b6f4+'\x0a')),0x1;const _0x1d5313=validateYamlFiles(_0x72802,_0x33b6f4,{'filterType':'journey'}),_0x481b0d=calculateSummary(_0x1d5313),_0x587224=_0x1d5313[_0x3cfa60(0x16a)](isValidationResult);if(_0x587224['length']===0x0)return console['error'](a28_0x4c1b1e[_0x3cfa60(0x145)](_0x3cfa60(0x16e)+_0x33b6f4+'\x0a')),_0x481b0d[_0x3cfa60(0x14d)]>0x0&&console['error'](a28_0x4c1b1e[_0x3cfa60(0x156)]('('+_0x481b0d[_0x3cfa60(0x14d)]+_0x3cfa60(0x15a))),0x0;for(const _0x430ae2 of _0x1d5313){if(!isValidationResult(_0x430ae2)){_0x435770[_0x3cfa60(0x14a)]&&console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x156)]('-\x20'+_0x430ae2[_0x3cfa60(0x179)]+_0x3cfa60(0x152)+_0x430ae2[_0x3cfa60(0x14c)]+')'));continue;}const {relativePath:_0x12484b,source:_0x3de66f,result:_0xcf647c}=_0x430ae2;if(_0xcf647c['valid']&&_0xcf647c[_0x3cfa60(0x151)][_0x3cfa60(0x163)]===0x0)_0x435770['verbose']&&console['log'](a28_0x4c1b1e[_0x3cfa60(0x17a)]('✔\x20'+_0x12484b));else _0xcf647c[_0x3cfa60(0x13f)]?(console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x145)]('⚠\x20'+_0x12484b+':\x20'+_0xcf647c[_0x3cfa60(0x151)][_0x3cfa60(0x163)]+_0x3cfa60(0x170))),console[_0x3cfa60(0x178)](formatValidationResult(_0xcf647c,_0x3de66f,_0x12484b))):(console[_0x3cfa60(0x178)](a28_0x4c1b1e['red']('✖\x20'+_0x12484b+':\x20'+_0xcf647c[_0x3cfa60(0x15d)][_0x3cfa60(0x163)]+_0x3cfa60(0x13d))),console['log'](formatValidationResult(_0xcf647c,_0x3de66f,_0x12484b)));}return console['log'](''),_0x481b0d[_0x3cfa60(0x13c)]?(console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x160)]('Validation\x20failed:\x20'+_0x481b0d[_0x3cfa60(0x15b)]+_0x3cfa60(0x155)+_0x481b0d[_0x3cfa60(0x175)]+_0x3cfa60(0x164))),_0x481b0d[_0x3cfa60(0x176)]>0x0&&console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x145)](_0x481b0d[_0x3cfa60(0x176)]+'\x20warning(s)\x20found')),_0x481b0d['skippedCount']>0x0&&console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x156)](_0x481b0d[_0x3cfa60(0x14d)]+_0x3cfa60(0x16d))),0x1):(console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x17a)](_0x3cfa60(0x149)+_0x481b0d[_0x3cfa60(0x175)]+_0x3cfa60(0x16c))),_0x481b0d[_0x3cfa60(0x176)]>0x0&&console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x145)](_0x481b0d[_0x3cfa60(0x176)]+_0x3cfa60(0x162))),_0x481b0d[_0x3cfa60(0x14d)]>0x0&&console[_0x3cfa60(0x178)](a28_0x4c1b1e[_0x3cfa60(0x156)](_0x481b0d['skippedCount']+_0x3cfa60(0x16d))),0x0);}}