@treasuredata/tdx 0.28.3 → 0.28.4

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 (184) 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/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-validator.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js.map +1 -1
  124. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  125. package/dist/sdk/segment/journey-yaml.js +1 -1
  126. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  127. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/push-recovery.js +1 -1
  131. package/dist/sdk/segment/push-workflow.js +1 -1
  132. package/dist/sdk/segment/resolution-context.js +1 -1
  133. package/dist/sdk/segment/segment-path-parser.js +1 -1
  134. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  135. package/dist/sdk/segment/target-resolution.js +1 -1
  136. package/dist/sdk/segment/tdx-config.js +1 -1
  137. package/dist/sdk/segment/validate-files.js +1 -1
  138. package/dist/sdk/segment/yaml-validator.js +1 -1
  139. package/dist/sdk/segment.js +1 -1
  140. package/dist/sdk/types/index.js +1 -1
  141. package/dist/sdk/types/progress.js +1 -1
  142. package/dist/sdk/user.js +1 -1
  143. package/dist/sdk/util/format-detector.js +1 -1
  144. package/dist/sdk/util/formatters.js +1 -1
  145. package/dist/sdk/util/index.js +1 -1
  146. package/dist/sdk/util/tree-formatter.js +1 -1
  147. package/dist/sdk/workflow/archive-validation.js +1 -1
  148. package/dist/sdk/workflow/clone-workflow.js +1 -1
  149. package/dist/sdk/workflow/index.js +1 -1
  150. package/dist/sdk/workflow/pull-workflow.js +1 -1
  151. package/dist/sdk/workflow/push-workflow.js +1 -1
  152. package/dist/sdk/workflow/tdx-config.js +1 -1
  153. package/dist/sdk/workflow/workflow-utils.js +1 -1
  154. package/dist/test-utils/command-runner.js +1 -1
  155. package/dist/test-utils/factories.js +1 -1
  156. package/dist/test-utils/fixtures.js +1 -1
  157. package/dist/test-utils/http-mock.js +1 -1
  158. package/dist/test-utils/index.js +1 -1
  159. package/dist/utils/async.js +1 -1
  160. package/dist/utils/colors.js +1 -1
  161. package/dist/utils/diff.js +1 -1
  162. package/dist/utils/file-permissions.js +1 -1
  163. package/dist/utils/global-cache.js +1 -1
  164. package/dist/utils/json-loader.js +1 -1
  165. package/dist/utils/local-cache.js +1 -1
  166. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  167. package/dist/utils/logger/formatters/index.js +1 -1
  168. package/dist/utils/logger/handlers/console-handler.js +1 -1
  169. package/dist/utils/logger/handlers/file-handler.js +1 -1
  170. package/dist/utils/logger/handlers/index.js +1 -1
  171. package/dist/utils/logger/handlers/null-handler.js +1 -1
  172. package/dist/utils/logger/index.js +1 -1
  173. package/dist/utils/logger/logger.js +1 -1
  174. package/dist/utils/logger/types.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/process.js +1 -1
  177. package/dist/utils/prompt.js +1 -1
  178. package/dist/utils/spinner.js +1 -1
  179. package/dist/utils/sse-parser.js +1 -1
  180. package/dist/utils/string-utils.js +1 -1
  181. package/dist/utils/table-ref-parser.js +1 -1
  182. package/dist/utils/tdx-logger.js +1 -1
  183. package/dist/utils/version-check.js +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
1
- const a19_0x20b9f5=a19_0x13a0;(function(_0x346e32,_0x25943e){const _0x1f13fb=a19_0x13a0,_0x3b3dc3=_0x346e32();while(!![]){try{const _0x171e75=-parseInt(_0x1f13fb(0x120))/0x1+parseInt(_0x1f13fb(0x121))/0x2*(parseInt(_0x1f13fb(0x137))/0x3)+parseInt(_0x1f13fb(0x133))/0x4*(parseInt(_0x1f13fb(0x11a))/0x5)+-parseInt(_0x1f13fb(0x13f))/0x6+-parseInt(_0x1f13fb(0x149))/0x7*(-parseInt(_0x1f13fb(0x136))/0x8)+-parseInt(_0x1f13fb(0x125))/0x9*(parseInt(_0x1f13fb(0x143))/0xa)+-parseInt(_0x1f13fb(0x13b))/0xb;if(_0x171e75===_0x25943e)break;else _0x3b3dc3['push'](_0x3b3dc3['shift']());}catch(_0x2562d0){_0x3b3dc3['push'](_0x3b3dc3['shift']());}}}(a19_0x136f,0x5cb64));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a19_0x13a0(_0x45e33c,_0x54103d){_0x45e33c=_0x45e33c-0x117;const _0x136f5d=a19_0x136f();let _0x13a009=_0x136f5d[_0x45e33c];return _0x13a009;}import a19_0x5acf6b from'chalk';function a19_0x136f(){const _0x3557f9=['errors','resolve','5915415ohTOOf','validCount','\x20non-campaign\x20file(s)\x20skipped)','Validation\x20failed:\x20','219786crlqGc','\x20non-campaign\x20file(s)\x20skipped','Validate\x20campaign\x20YAML\x20files','valid','1070ibuKLi','\x20error(s)','red','yellow','\x20warning(s)\x20found','filter','14VLJAQQ','cwd','.yml','dim','196340pOjOxK','dirname','execute','warningCount','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','campaign','489817YKNrqc','8fRNzMw','log','relativePath','\x20campaign(s)\x20with\x20errors,\x20','32985fpAUQi','\x20(skipped:\x20','reason','description','invalidCount','✔\x20All\x20','.yaml','engage:campaign:validate','error','hasErrors','skippedCount','green','\x20valid','warnings','52fLDBuI','endsWith','length','2904544onxyrw','449622kMiPSy','verbose'];a19_0x136f=function(){return _0x3557f9;};return a19_0x136f();}import a19_0xd49eed from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{['name']=a19_0x20b9f5(0x12c);[a19_0x20b9f5(0x128)]=a19_0x20b9f5(0x141);async[a19_0x20b9f5(0x11c)](_0x225c9a){const _0x4fe46f=a19_0x20b9f5,{options:_0xc59756,args:_0x3826f8}=_0x225c9a,_0x1d625c=_0xc59756,_0x1f9e80=_0x3826f8[0x0],_0x336eb2=_0x1f9e80?a19_0xd49eed[_0x4fe46f(0x13a)](_0x1f9e80):undefined,_0x3eac59=_0x336eb2?isYamlFile(_0x336eb2):![];let _0x203c53,_0x39e6b2;if(_0x3eac59&&_0x336eb2)_0x203c53=a19_0xd49eed[_0x4fe46f(0x11b)](_0x336eb2),_0x39e6b2=_0x336eb2;else _0x336eb2?_0x203c53=_0x336eb2:_0x203c53=process[_0x4fe46f(0x117)]();if(!_0x39e6b2&&!existsSync(_0x203c53))return console[_0x4fe46f(0x12d)](a19_0x5acf6b[_0x4fe46f(0x145)]('Error:\x20Directory\x20not\x20found:\x20'+_0x203c53+'\x0a')),0x1;let _0x50056c;if(_0x39e6b2){if(!_0x39e6b2[_0x4fe46f(0x134)](_0x4fe46f(0x118))&&!_0x39e6b2['endsWith'](_0x4fe46f(0x12b)))return console[_0x4fe46f(0x12d)](a19_0x5acf6b['red'](_0x4fe46f(0x11e)+_0x39e6b2+'\x0a')),0x1;_0x50056c=[_0x39e6b2];}else _0x50056c=findYamlFiles(_0x203c53);if(_0x50056c[_0x4fe46f(0x135)]===0x0)return console[_0x4fe46f(0x12d)](a19_0x5acf6b[_0x4fe46f(0x145)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x203c53+'\x0a')),0x1;const _0x43174c=validateYamlFiles(_0x50056c,_0x203c53,{'filterType':_0x4fe46f(0x11f)}),_0x2abdad=calculateSummary(_0x43174c),_0xc7ed37=_0x43174c[_0x4fe46f(0x148)](isValidationResult);if(_0xc7ed37[_0x4fe46f(0x135)]===0x0)return console['error'](a19_0x5acf6b['yellow']('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x203c53+'\x0a')),_0x2abdad[_0x4fe46f(0x12f)]>0x0&&console['error'](a19_0x5acf6b[_0x4fe46f(0x119)]('('+_0x2abdad[_0x4fe46f(0x12f)]+_0x4fe46f(0x13d))),0x0;for(const _0x2742b2 of _0x43174c){if(!isValidationResult(_0x2742b2)){_0x1d625c[_0x4fe46f(0x138)]&&console['log'](a19_0x5acf6b[_0x4fe46f(0x119)]('-\x20'+_0x2742b2[_0x4fe46f(0x123)]+_0x4fe46f(0x126)+_0x2742b2[_0x4fe46f(0x127)]+')'));continue;}const {relativePath:_0x5f056e,source:_0x45d7a0,result:_0x56c2c1}=_0x2742b2;if(_0x56c2c1[_0x4fe46f(0x142)]&&_0x56c2c1['warnings'][_0x4fe46f(0x135)]===0x0)_0x1d625c[_0x4fe46f(0x138)]&&console[_0x4fe46f(0x122)](a19_0x5acf6b[_0x4fe46f(0x130)]('✔\x20'+_0x5f056e));else _0x56c2c1[_0x4fe46f(0x142)]?(console['log'](a19_0x5acf6b[_0x4fe46f(0x146)]('⚠\x20'+_0x5f056e+':\x20'+_0x56c2c1[_0x4fe46f(0x132)][_0x4fe46f(0x135)]+'\x20warning(s)')),console[_0x4fe46f(0x122)](formatValidationResult(_0x56c2c1,_0x45d7a0,_0x5f056e))):(console[_0x4fe46f(0x122)](a19_0x5acf6b[_0x4fe46f(0x145)]('✖\x20'+_0x5f056e+':\x20'+_0x56c2c1[_0x4fe46f(0x139)][_0x4fe46f(0x135)]+_0x4fe46f(0x144))),console[_0x4fe46f(0x122)](formatValidationResult(_0x56c2c1,_0x45d7a0,_0x5f056e)));}return console[_0x4fe46f(0x122)](''),_0x2abdad[_0x4fe46f(0x12e)]?(console['log'](a19_0x5acf6b[_0x4fe46f(0x145)](_0x4fe46f(0x13e)+_0x2abdad[_0x4fe46f(0x129)]+_0x4fe46f(0x124)+_0x2abdad[_0x4fe46f(0x13c)]+_0x4fe46f(0x131))),_0x2abdad[_0x4fe46f(0x11d)]>0x0&&console[_0x4fe46f(0x122)](a19_0x5acf6b[_0x4fe46f(0x146)](_0x2abdad['warningCount']+_0x4fe46f(0x147))),_0x2abdad['skippedCount']>0x0&&console['log'](a19_0x5acf6b[_0x4fe46f(0x119)](_0x2abdad[_0x4fe46f(0x12f)]+_0x4fe46f(0x140))),0x1):(console[_0x4fe46f(0x122)](a19_0x5acf6b[_0x4fe46f(0x130)](_0x4fe46f(0x12a)+_0x2abdad[_0x4fe46f(0x13c)]+'\x20campaign(s)\x20valid')),_0x2abdad['warningCount']>0x0&&console['log'](a19_0x5acf6b[_0x4fe46f(0x146)](_0x2abdad['warningCount']+'\x20warning(s)\x20found')),_0x2abdad['skippedCount']>0x0&&console[_0x4fe46f(0x122)](a19_0x5acf6b['dim'](_0x2abdad[_0x4fe46f(0x12f)]+_0x4fe46f(0x140))),0x0);}}
1
+ const a19_0x33202b=a19_0x5a7a;(function(_0x1ec585,_0x1c923b){const _0x265ea2=a19_0x5a7a,_0xcdcdeb=_0x1ec585();while(!![]){try{const _0x5567e0=-parseInt(_0x265ea2(0x1a6))/0x1*(parseInt(_0x265ea2(0x19b))/0x2)+-parseInt(_0x265ea2(0x1b7))/0x3*(-parseInt(_0x265ea2(0x191))/0x4)+parseInt(_0x265ea2(0x1b1))/0x5+parseInt(_0x265ea2(0x19d))/0x6*(parseInt(_0x265ea2(0x1ab))/0x7)+-parseInt(_0x265ea2(0x1b3))/0x8+parseInt(_0x265ea2(0x198))/0x9*(parseInt(_0x265ea2(0x1b6))/0xa)+-parseInt(_0x265ea2(0x1b8))/0xb;if(_0x5567e0===_0x1c923b)break;else _0xcdcdeb['push'](_0xcdcdeb['shift']());}catch(_0x5998fa){_0xcdcdeb['push'](_0xcdcdeb['shift']());}}}(a19_0x29e7,0x8ea8a));import{BaseCommand}from'./command.js';function a19_0x5a7a(_0x27d20c,_0x7a8527){_0x27d20c=_0x27d20c-0x190;const _0x29e7b8=a19_0x29e7();let _0x5a7a15=_0x29e7b8[_0x27d20c];return _0x5a7a15;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a19_0x21271c from'chalk';import a19_0x401f46 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a19_0x33202b(0x1bd)]=a19_0x33202b(0x19c);[a19_0x33202b(0x193)]=a19_0x33202b(0x196);async[a19_0x33202b(0x1c0)](_0x1a9806){const _0x4f431f=a19_0x33202b,{options:_0x4e5580,args:_0x1e8178}=_0x1a9806,_0x454859=_0x4e5580,_0x19fe3d=_0x1e8178[0x0],_0x23624e=_0x19fe3d?a19_0x401f46[_0x4f431f(0x195)](_0x19fe3d):undefined,_0x4a70a5=_0x23624e?isYamlFile(_0x23624e):![];let _0x4b1042,_0x41554b;if(_0x4a70a5&&_0x23624e)_0x4b1042=a19_0x401f46[_0x4f431f(0x1a2)](_0x23624e),_0x41554b=_0x23624e;else _0x23624e?_0x4b1042=_0x23624e:_0x4b1042=process[_0x4f431f(0x1ae)]();if(!_0x41554b&&!existsSync(_0x4b1042))return console[_0x4f431f(0x1a1)](a19_0x21271c['red'](_0x4f431f(0x1ba)+_0x4b1042+'\x0a')),0x1;let _0x21e6c2;if(_0x41554b){if(!_0x41554b[_0x4f431f(0x1a0)]('.yml')&&!_0x41554b[_0x4f431f(0x1a0)](_0x4f431f(0x1c2)))return console['error'](a19_0x21271c['red'](_0x4f431f(0x1b9)+_0x41554b+'\x0a')),0x1;_0x21e6c2=[_0x41554b];}else _0x21e6c2=findYamlFiles(_0x4b1042);if(_0x21e6c2['length']===0x0)return console[_0x4f431f(0x1a1)](a19_0x21271c['red'](_0x4f431f(0x1c1)+_0x4b1042+'\x0a')),0x1;const _0x19e151=validateYamlFiles(_0x21e6c2,_0x4b1042,{'filterType':'campaign'}),_0x4655ea=calculateSummary(_0x19e151),_0x487f8a=_0x19e151['filter'](isValidationResult);if(_0x487f8a['length']===0x0)return console[_0x4f431f(0x1a1)](a19_0x21271c[_0x4f431f(0x1ad)](_0x4f431f(0x19e)+_0x4b1042+'\x0a')),_0x4655ea[_0x4f431f(0x1aa)]>0x0&&console['error'](a19_0x21271c[_0x4f431f(0x1a3)]('('+_0x4655ea['skippedCount']+_0x4f431f(0x1be))),0x0;for(const _0x111a0c of _0x19e151){if(!isValidationResult(_0x111a0c)){_0x454859[_0x4f431f(0x1a8)]&&console[_0x4f431f(0x1a9)](a19_0x21271c['dim']('-\x20'+_0x111a0c[_0x4f431f(0x1bc)]+_0x4f431f(0x197)+_0x111a0c['reason']+')'));continue;}const {relativePath:_0x56d727,source:_0x3d9fe8,result:_0xd9ae9b}=_0x111a0c;if(_0xd9ae9b[_0x4f431f(0x19a)]&&_0xd9ae9b[_0x4f431f(0x1bf)]['length']===0x0)_0x454859[_0x4f431f(0x1a8)]&&console[_0x4f431f(0x1a9)](a19_0x21271c[_0x4f431f(0x1af)]('✔\x20'+_0x56d727));else _0xd9ae9b[_0x4f431f(0x19a)]?(console[_0x4f431f(0x1a9)](a19_0x21271c[_0x4f431f(0x1ad)]('⚠\x20'+_0x56d727+':\x20'+_0xd9ae9b[_0x4f431f(0x1bf)][_0x4f431f(0x1a5)]+_0x4f431f(0x1a7))),console[_0x4f431f(0x1a9)](formatValidationResult(_0xd9ae9b,_0x3d9fe8,_0x56d727))):(console[_0x4f431f(0x1a9)](a19_0x21271c[_0x4f431f(0x1b5)]('✖\x20'+_0x56d727+':\x20'+_0xd9ae9b[_0x4f431f(0x1ac)]['length']+_0x4f431f(0x199))),console[_0x4f431f(0x1a9)](formatValidationResult(_0xd9ae9b,_0x3d9fe8,_0x56d727)));}return console[_0x4f431f(0x1a9)](''),_0x4655ea[_0x4f431f(0x1b0)]?(console['log'](a19_0x21271c[_0x4f431f(0x1b5)]('Validation\x20failed:\x20'+_0x4655ea[_0x4f431f(0x1a4)]+_0x4f431f(0x1bb)+_0x4655ea[_0x4f431f(0x1b2)]+_0x4f431f(0x1b4))),_0x4655ea[_0x4f431f(0x19f)]>0x0&&console[_0x4f431f(0x1a9)](a19_0x21271c[_0x4f431f(0x1ad)](_0x4655ea['warningCount']+_0x4f431f(0x194))),_0x4655ea[_0x4f431f(0x1aa)]>0x0&&console[_0x4f431f(0x1a9)](a19_0x21271c[_0x4f431f(0x1a3)](_0x4655ea[_0x4f431f(0x1aa)]+_0x4f431f(0x1c3))),0x1):(console['log'](a19_0x21271c[_0x4f431f(0x1af)](_0x4f431f(0x190)+_0x4655ea[_0x4f431f(0x1b2)]+_0x4f431f(0x192))),_0x4655ea[_0x4f431f(0x19f)]>0x0&&console['log'](a19_0x21271c[_0x4f431f(0x1ad)](_0x4655ea[_0x4f431f(0x19f)]+'\x20warning(s)\x20found')),_0x4655ea['skippedCount']>0x0&&console[_0x4f431f(0x1a9)](a19_0x21271c['dim'](_0x4655ea[_0x4f431f(0x1aa)]+_0x4f431f(0x1c3))),0x0);}}function a19_0x29e7(){const _0x1d6b86=['\x20campaign(s)\x20with\x20errors,\x20','relativePath','name','\x20non-campaign\x20file(s)\x20skipped)','warnings','execute','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yaml','\x20non-campaign\x20file(s)\x20skipped','✔\x20All\x20','1660tNimIp','\x20campaign(s)\x20valid','description','\x20warning(s)\x20found','resolve','Validate\x20campaign\x20YAML\x20files','\x20(skipped:\x20','27EfShZH','\x20error(s)','valid','137548kjDECV','engage:campaign:validate','5182350xOtoHz','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','warningCount','endsWith','error','dirname','dim','invalidCount','length','16LknSnv','\x20warning(s)','verbose','log','skippedCount','7thvGdE','errors','yellow','cwd','green','hasErrors','5266495pftQuS','validCount','5587216owukub','\x20valid','red','2478290NAmrcK','1122STcUrx','4758655ZnVlIO','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Error:\x20Directory\x20not\x20found:\x20'];a19_0x29e7=function(){return _0x1d6b86;};return a19_0x29e7();}
@@ -1 +1 @@
1
- const a20_0x368bbe=a20_0x2b99;(function(_0xe6d9e5,_0x133546){const _0x250b42=a20_0x2b99,_0x12c440=_0xe6d9e5();while(!![]){try{const _0x2fb363=-parseInt(_0x250b42(0x14d))/0x1*(parseInt(_0x250b42(0x130))/0x2)+parseInt(_0x250b42(0xff))/0x3+parseInt(_0x250b42(0xe2))/0x4+-parseInt(_0x250b42(0x101))/0x5*(parseInt(_0x250b42(0xde))/0x6)+parseInt(_0x250b42(0xe1))/0x7+-parseInt(_0x250b42(0xf7))/0x8+parseInt(_0x250b42(0xd3))/0x9*(-parseInt(_0x250b42(0x150))/0xa);if(_0x2fb363===_0x133546)break;else _0x12c440['push'](_0x12c440['shift']());}catch(_0x56e44a){_0x12c440['push'](_0x12c440['shift']());}}}(a20_0x4e6c,0xcf1a1));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';export async function resolveWorkspaceIdFromOptions(_0xebdd7f,_0x208b5d,_0x4dd15e=![]){const _0x2eb719=a20_0x2b99;if(_0xebdd7f[_0x2eb719(0x13b)])return await _0x208b5d[_0x2eb719(0x124)][_0x2eb719(0xf1)](_0xebdd7f['workspace']);const _0x1cfe47=loadSessionContext(_0xebdd7f['session']);if(_0x1cfe47?.[_0x2eb719(0x146)])return await _0x208b5d['engage'][_0x2eb719(0xf1)](_0x1cfe47['engage_workspace']);if(_0x4dd15e)throw new SDKError(ErrorCode[_0x2eb719(0xe9)],_0x2eb719(0x126),undefined,{'helpText':_0x2eb719(0x128)});return undefined;}async function resolveSegmentFromOptions(_0x50ea79,_0x3563e0){const _0xbaff83=a20_0x2b99;if(!_0x50ea79[_0xbaff83(0xd0)])return{};const _0x5f21a2=_0x50ea79[_0xbaff83(0xd0)],_0x4605b2=await _0x3563e0[_0xbaff83(0xd0)][_0xbaff83(0xef)](_0x5f21a2);return{'audienceId':_0x4605b2[_0xbaff83(0xe8)],'audienceName':_0x4605b2[_0xbaff83(0xfb)],..._0x4605b2[_0xbaff83(0xf5)]&&{'segmentId':_0x4605b2[_0xbaff83(0xf5)],'segmentName':_0x4605b2['segmentName']}};}function buildConnectorConfig(_0x5d7cf2){const _0x42e61a=a20_0x2b99,_0xdcb708=_0x5d7cf2[_0x42e61a(0xeb)],_0x37b4cf=_0x5d7cf2[_0x42e61a(0x149)];if(!_0xdcb708&&!_0x37b4cf)return undefined;return{..._0xdcb708&&{'emailSenderId':_0xdcb708},..._0x37b4cf&&{'jsonColumns':_0x37b4cf}};}export class EngageCampaignsCommand extends BaseCommand{[a20_0x368bbe(0xc5)]=a20_0x368bbe(0xc8);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0x147);async['execute'](_0xc2b8a5){const _0x25a590=a20_0x368bbe,{options:_0x567831,args:_0x15e26c,tdx:_0x3eb7db}=_0xc2b8a5,_0x462831=_0x15e26c[0x0],_0x207452=resolveLimit(_0x567831[_0x25a590(0x11d)],DEFAULT_LLM_LIMIT),_0x2f5420=_0x567831,_0x11331b=_0x2f5420[_0x25a590(0x14e)],_0x5102a9=_0x2f5420[_0x25a590(0x13e)],_0x3f12b5=await resolveWorkspaceIdFromOptions(_0x2f5420,_0x3eb7db),_0x23fde5=await withSpinner(_0x25a590(0x152),()=>_0x3eb7db['engage']['listCampaigns']({'type':_0x11331b,'status':_0x5102a9,'workspaceId':_0x3f12b5,'limit':_0x207452}),{'verbose':_0x567831['verbose']});let _0x5f0c4e=_0x23fde5[_0x25a590(0xc6)];_0x462831&&(_0x5f0c4e=_0x23fde5[_0x25a590(0xc6)][_0x25a590(0x10a)](_0x49d092=>matchGlobPattern(_0x49d092[_0x25a590(0xc5)],_0x462831)));const _0x31d076=_0x567831[_0x25a590(0x10b)];if(_0x567831[_0x25a590(0x11c)]===_0x25a590(0x155)||_0x567831[_0x25a590(0x11c)]===_0x25a590(0xc9)){const _0x1624cc=_0x5f0c4e['map'](_0x3cffeb=>({..._0x3cffeb,'url':_0x3cffeb[_0x25a590(0xe6)]?getCampaignUrl(_0x31d076,_0x3cffeb['workspaceId'],_0x3cffeb['id']):undefined}));await handleSDKOutput(_0x1624cc,_0x567831);}else await handleSDKOutput(_0x5f0c4e,_0x567831);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a20_0x368bbe(0xc5)]=a20_0x368bbe(0xcf);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0x12f);async['execute'](_0x4a986f){const _0x52d67f=a20_0x368bbe,{options:_0x1b12e2,args:_0x3412a0,tdx:_0xe12227}=_0x4a986f;if(_0x3412a0['length']===0x0)return console[_0x52d67f(0xd8)](_0x52d67f(0x113)),console[_0x52d67f(0xd8)](_0x52d67f(0x119)),0x1;const _0x11080b=_0x3412a0[0x0],_0x4df106=_0x1b12e2,_0x49fd4d=await resolveWorkspaceIdFromOptions(_0x4df106,_0xe12227),_0x4e2287=_0x4df106[_0x52d67f(0x131)],_0x497715=_0x1b12e2[_0x52d67f(0x10b)];if(_0x4e2287){const _0x160259=await withSpinner(_0x52d67f(0xe0)+_0x11080b+_0x52d67f(0xf4),()=>_0xe12227[_0x52d67f(0x124)][_0x52d67f(0xca)](_0x11080b,_0x49fd4d),{'verbose':_0x1b12e2['verbose']}),_0xf2ff9a=_0x160259[_0x52d67f(0xc6)],_0x2eb6ef=_0xf2ff9a[_0x52d67f(0xd2)][_0x52d67f(0xe6)]?getCampaignUrl(_0x497715,_0xf2ff9a[_0x52d67f(0xd2)][_0x52d67f(0xe6)],_0xf2ff9a['id']):undefined;await handleSDKOutput([{..._0xf2ff9a,..._0x2eb6ef&&{'url':_0x2eb6ef}}],_0x1b12e2);}else{const _0x164358=await withSpinner('Fetching\x20campaign\x20\x27'+_0x11080b+_0x52d67f(0xf4),()=>_0xe12227['engage']['getCampaign'](_0x11080b,_0x49fd4d),{'verbose':_0x1b12e2[_0x52d67f(0x127)]}),_0x437c93=_0x164358[_0x52d67f(0xc6)],_0x466197=_0x437c93[_0x52d67f(0xe6)]?getCampaignUrl(_0x497715,_0x437c93[_0x52d67f(0xe6)],_0x437c93['id']):undefined;await handleSingleObjectOutput({..._0x437c93,..._0x466197&&{'url':_0x466197}},_0x1b12e2);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a20_0x368bbe(0x106);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0xbf);async[a20_0x368bbe(0xce)](_0x1408e0){const _0x7a7a79=a20_0x368bbe,{options:_0x17241c,tdx:_0x107776}=_0x1408e0,_0x357069=_0x17241c,_0xd84a06=_0x357069[_0x7a7a79(0xc5)],_0x53552a=_0x357069[_0x7a7a79(0x14e)];if(!_0xd84a06)return console[_0x7a7a79(0xd8)]('Error:\x20--name\x20is\x20required'),console[_0x7a7a79(0xd8)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x53552a)return console['error'](_0x7a7a79(0xec)),console[_0x7a7a79(0xd8)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x1ce423=await resolveWorkspaceIdFromOptions(_0x357069,_0x107776,!![]),_0x34186a=await resolveSegmentFromOptions(_0x357069,_0x107776),_0x4f6439=buildConnectorConfig(_0x357069),_0x31e6fa={'name':_0xd84a06,'campaignType':_0x53552a,'workspaceId':_0x1ce423,'description':_0x357069[_0x7a7a79(0x10c)],..._0x34186a,'connectorConfig':_0x4f6439,'startAt':_0x357069[_0x7a7a79(0x125)],'timezone':_0x357069[_0x7a7a79(0xfe)]},_0x45ac3b=await withSpinner(_0x7a7a79(0x10f)+_0xd84a06+_0x7a7a79(0xf4),()=>_0x107776[_0x7a7a79(0x124)][_0x7a7a79(0xdf)](_0x31e6fa));return await handleSDKOutput([_0x45ac3b[_0x7a7a79(0xc6)]],_0x17241c),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a20_0x368bbe(0x151);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0x12c);async[a20_0x368bbe(0xce)](_0x406f03){const _0x25b4a7=a20_0x368bbe,{options:_0x157e42,args:_0x34b1f9,tdx:_0x318668}=_0x406f03;if(_0x34b1f9['length']===0x0)return console[_0x25b4a7(0xd8)](_0x25b4a7(0x113)),console[_0x25b4a7(0xd8)](_0x25b4a7(0x132)),0x1;const _0x2661ae=_0x34b1f9[0x0],_0x3e60df=_0x157e42,_0x50147c=await resolveWorkspaceIdFromOptions(_0x3e60df,_0x318668),_0x493aae=await resolveSegmentFromOptions(_0x3e60df,_0x318668),_0x389f19=buildConnectorConfig(_0x3e60df),_0x406031={'name':_0x3e60df[_0x25b4a7(0xc5)],'description':_0x3e60df['description'],..._0x493aae,'connectorConfig':_0x389f19,'startAt':_0x3e60df['startAt'],'timezone':_0x3e60df[_0x25b4a7(0xfe)]},_0xfb6fc8=Object[_0x25b4a7(0x148)](Object[_0x25b4a7(0x140)](_0x406031)[_0x25b4a7(0x10a)](([,_0x213f96])=>_0x213f96!==undefined));if(Object[_0x25b4a7(0xfa)](_0xfb6fc8)['length']===0x0)return console[_0x25b4a7(0xd8)](_0x25b4a7(0x12d)),console[_0x25b4a7(0xd8)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x598f7c=await withSpinner(_0x25b4a7(0xf9)+_0x2661ae+_0x25b4a7(0xf4),()=>_0x318668['engage'][_0x25b4a7(0x120)](_0x2661ae,_0xfb6fc8,_0x50147c),{'verbose':_0x157e42[_0x25b4a7(0x127)]});return await handleSDKOutput([_0x598f7c[_0x25b4a7(0xc6)]],_0x157e42),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a20_0x368bbe(0x11f);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0x156);async[a20_0x368bbe(0xce)](_0x560eb7){const _0x44ff6d=a20_0x368bbe,{options:_0x4c2bb3,args:_0x2a2682,tdx:_0x36c966}=_0x560eb7;if(_0x2a2682[_0x44ff6d(0x12b)]===0x0)return console['error'](_0x44ff6d(0x113)),console[_0x44ff6d(0xd8)](_0x44ff6d(0x138)),0x1;const _0x2394c8=_0x2a2682[0x0],_0x48fd06=_0x4c2bb3,_0x42fe5d=await resolveWorkspaceIdFromOptions(_0x48fd06,_0x36c966);if(!_0x4c2bb3[_0x44ff6d(0x116)]){const _0x2fd027=await confirm(_0x44ff6d(0x118)+_0x2394c8+_0x44ff6d(0x123));if(!_0x2fd027)return console[_0x44ff6d(0xe5)](_0x44ff6d(0xda)),0x0;}return await withSpinner('Deleting\x20campaign\x20\x27'+_0x2394c8+_0x44ff6d(0xf4),()=>_0x36c966[_0x44ff6d(0x124)][_0x44ff6d(0xf6)](_0x2394c8,_0x42fe5d),{'verbose':_0x4c2bb3['verbose']}),console[_0x44ff6d(0xe5)](_0x44ff6d(0x12e)+_0x2394c8+_0x44ff6d(0x110)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a20_0x368bbe(0xc5)]=a20_0x368bbe(0x115);['description']=a20_0x368bbe(0x153);async['execute'](_0x547f65){const _0x255e86=a20_0x368bbe,{options:_0xa0fcae,args:_0x449b39,tdx:_0x26b00f}=_0x547f65;if(_0x449b39['length']===0x0)return console[_0x255e86(0xd8)](_0x255e86(0x113)),console[_0x255e86(0xd8)](_0x255e86(0x109)),0x1;const _0x2b965f=_0x449b39[0x0],_0x31d1f4=_0xa0fcae,_0xfa079=await resolveWorkspaceIdFromOptions(_0x31d1f4,_0x26b00f);return await withSpinner('Launching\x20campaign\x20\x27'+_0x2b965f+_0x255e86(0xf4),()=>_0x26b00f['engage'][_0x255e86(0xf3)](_0x2b965f,_0xfa079),{'verbose':_0xa0fcae['verbose']}),console[_0x255e86(0xe5)](_0x255e86(0x12e)+_0x2b965f+_0x255e86(0x13a)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a20_0x368bbe(0xe4);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0xc1);async[a20_0x368bbe(0xce)](_0x55d38d){const _0x93b732=a20_0x368bbe,{options:_0x52f2b6,args:_0x5e213a,tdx:_0x1594b3}=_0x55d38d;if(_0x5e213a[_0x93b732(0x12b)]===0x0)return console[_0x93b732(0xd8)](_0x93b732(0x113)),console['error'](_0x93b732(0x104)),0x1;const _0x1bf408=_0x5e213a[0x0],_0x1318cd=_0x52f2b6,_0xf3fc21=await resolveWorkspaceIdFromOptions(_0x1318cd,_0x1594b3);return await withSpinner(_0x93b732(0xd4)+_0x1bf408+'\x27...',()=>_0x1594b3[_0x93b732(0x124)]['pauseCampaign'](_0x1bf408,_0xf3fc21),{'verbose':_0x52f2b6[_0x93b732(0x127)]}),console[_0x93b732(0xe5)](_0x93b732(0x12e)+_0x1bf408+_0x93b732(0xd1)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a20_0x368bbe(0x14c);['description']=a20_0x368bbe(0x14b);async['execute'](_0x41725e){const _0x59aec0=a20_0x368bbe,{options:_0x32cdfa,args:_0xba9773,tdx:_0x2ae967}=_0x41725e;if(_0xba9773[_0x59aec0(0x12b)]===0x0)return console[_0x59aec0(0xd8)](_0x59aec0(0x113)),console[_0x59aec0(0xd8)](_0x59aec0(0x114)),0x1;const _0x3a315e=_0xba9773[0x0],_0x497ad3=_0x32cdfa,_0x3b106c=await resolveWorkspaceIdFromOptions(_0x497ad3,_0x2ae967);return await withSpinner(_0x59aec0(0x103)+_0x3a315e+_0x59aec0(0xf4),()=>_0x2ae967['engage'][_0x59aec0(0x133)](_0x3a315e,_0x3b106c),{'verbose':_0x32cdfa['verbose']}),console[_0x59aec0(0xe5)]('Campaign\x20\x27'+_0x3a315e+_0x59aec0(0xd7)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x368bbe(0xc5)]=a20_0x368bbe(0x14a);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0x154);async[a20_0x368bbe(0xce)](_0x49c8ad){const _0x299281=a20_0x368bbe,{options:_0x133d1c,args:_0x3c721d,tdx:_0x100176}=_0x49c8ad;if(_0x3c721d[_0x299281(0x12b)]===0x0)return console['error'](_0x299281(0x113)),console[_0x299281(0xd8)](_0x299281(0xf0)),0x1;const _0x35842b=_0x3c721d[0x0],_0x3c271f=_0x133d1c,_0x5e83f5=await resolveWorkspaceIdFromOptions(_0x3c271f,_0x100176),_0x29b962=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x35842b+'\x27...',()=>_0x100176[_0x299281(0x124)][_0x299281(0x102)](_0x35842b,_0x5e83f5),{'verbose':_0x133d1c[_0x299281(0x127)]});return await handleSDKOutput([_0x29b962['data']],_0x133d1c),0x0;}}function a20_0x2b99(_0x1be0ff,_0x30fb9c){_0x1be0ff=_0x1be0ff-0xbf;const _0x4e6ca7=a20_0x4e6c();let _0x2b99cd=_0x4e6ca7[_0x1be0ff];return _0x2b99cd;}export class EngageTemplatesCommand extends BaseCommand{[a20_0x368bbe(0xc5)]=a20_0x368bbe(0xd6);['description']=a20_0x368bbe(0xf8);async[a20_0x368bbe(0xce)](_0x5e1fce){const _0x48e4ae=a20_0x368bbe,{options:_0x3a216d,args:_0x24eb90,tdx:_0x2e77d5}=_0x5e1fce,_0x1ac1fc=_0x24eb90[0x0],_0x42dbbc=resolveLimit(_0x3a216d['limit'],DEFAULT_LLM_LIMIT),_0x3c40a9=_0x3a216d,_0x3c37f7=await resolveWorkspaceIdFromOptions(_0x3c40a9,_0x2e77d5),_0x4fbe2f=await withSpinner(_0x48e4ae(0x107),()=>_0x2e77d5[_0x48e4ae(0x124)][_0x48e4ae(0xdb)]({'workspaceId':_0x3c37f7,'limit':_0x42dbbc}),{'verbose':_0x3a216d[_0x48e4ae(0x127)]});let _0x6648bb=_0x4fbe2f[_0x48e4ae(0xc6)];return _0x1ac1fc&&(_0x6648bb=_0x4fbe2f[_0x48e4ae(0xc6)]['filter'](_0x961386=>matchGlobPattern(_0x961386[_0x48e4ae(0xc5)],_0x1ac1fc))),await handleSDKOutput(_0x6648bb,_0x3a216d),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a20_0x368bbe(0xc5)]=a20_0x368bbe(0x129);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0x105);async[a20_0x368bbe(0xce)](_0x5ba885){const _0x4180ab=a20_0x368bbe,{options:_0x5ec23e,args:_0x4f6347,tdx:_0x4a0da3}=_0x5ba885;if(_0x4f6347[_0x4180ab(0x12b)]===0x0)return console['error'](_0x4180ab(0xc3)),console[_0x4180ab(0xd8)](_0x4180ab(0x13d)),0x1;const _0x49c9d4=_0x4f6347[0x0],_0x14eadf=_0x5ec23e,_0x329e89=await resolveWorkspaceIdFromOptions(_0x14eadf,_0x4a0da3),_0xedb74=_0x14eadf['full'];if(_0xedb74){const _0x3a9047=await withSpinner('Fetching\x20template\x20\x27'+_0x49c9d4+_0x4180ab(0xf4),()=>_0x4a0da3[_0x4180ab(0x124)]['getTemplateFull'](_0x49c9d4,_0x329e89),{'verbose':_0x5ec23e['verbose']});await handleSDKOutput([_0x3a9047],_0x5ec23e);}else{const _0x456e91=await withSpinner(_0x4180ab(0xea)+_0x49c9d4+'\x27...',()=>_0x4a0da3[_0x4180ab(0x124)][_0x4180ab(0x144)](_0x49c9d4,_0x329e89),{'verbose':_0x5ec23e[_0x4180ab(0x127)]});await handleSDKOutput([_0x456e91],_0x5ec23e);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']=a20_0x368bbe(0x111);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0x117);async[a20_0x368bbe(0xce)](_0x4237a5){const _0x48deb5=a20_0x368bbe,{options:_0x561540,tdx:_0x283c07}=_0x4237a5,_0x231a98=_0x561540,_0x4ebeb7=_0x231a98[_0x48deb5(0xc5)],_0x553af5=_0x231a98[_0x48deb5(0x10d)],_0x5ae26f=_0x231a98[_0x48deb5(0x135)];if(!_0x4ebeb7)return console[_0x48deb5(0xd8)]('Error:\x20--name\x20is\x20required'),console[_0x48deb5(0xd8)](_0x48deb5(0xed)),0x1;if(!_0x553af5)return console[_0x48deb5(0xd8)](_0x48deb5(0x12a)),0x1;if(!_0x5ae26f)return console['error'](_0x48deb5(0xcd)),0x1;const _0x4304c5=await resolveWorkspaceIdFromOptions(_0x231a98,_0x283c07,!![]),_0x2b72e0={'name':_0x4ebeb7,'subjectTemplate':_0x553af5,'htmlTemplate':_0x5ae26f,'workspaceId':_0x4304c5,'plaintextTemplate':_0x231a98[_0x48deb5(0xc0)],'editorType':_0x231a98[_0x48deb5(0x10e)]},_0x50075e=await withSpinner(_0x48deb5(0x112)+_0x4ebeb7+_0x48deb5(0xf4),()=>_0x283c07[_0x48deb5(0x124)]['createTemplate'](_0x2b72e0));return await handleSDKOutput([_0x50075e[_0x48deb5(0xc6)]],_0x561540),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a20_0x368bbe(0xc5)]=a20_0x368bbe(0x145);[a20_0x368bbe(0x10c)]='Update\x20an\x20email\x20template';async[a20_0x368bbe(0xce)](_0x5df20c){const _0x509a4d=a20_0x368bbe,{options:_0x2e0476,args:_0x10e124,tdx:_0xa2dbe7}=_0x5df20c;if(_0x10e124[_0x509a4d(0x12b)]===0x0)return console[_0x509a4d(0xd8)](_0x509a4d(0xc3)),console['error'](_0x509a4d(0xc4)),0x1;const _0x48ab4c=_0x10e124[0x0],_0xeaf8db=_0x2e0476,_0x21f93c=await resolveWorkspaceIdFromOptions(_0xeaf8db,_0xa2dbe7),_0xf81394={'name':_0xeaf8db['name'],'subjectTemplate':_0xeaf8db[_0x509a4d(0x10d)],'htmlTemplate':_0xeaf8db['html'],'plaintextTemplate':_0xeaf8db[_0x509a4d(0xc0)]},_0x3e7f2a=Object[_0x509a4d(0x148)](Object['entries'](_0xf81394)['filter'](([,_0x2a5687])=>_0x2a5687!==undefined));if(Object[_0x509a4d(0xfa)](_0x3e7f2a)['length']===0x0)return console[_0x509a4d(0xd8)](_0x509a4d(0x12d)),console[_0x509a4d(0xd8)]('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x1f5c9b=await withSpinner('Updating\x20template\x20\x27'+_0x48ab4c+_0x509a4d(0xf4),()=>_0xa2dbe7[_0x509a4d(0x124)][_0x509a4d(0x108)](_0x48ab4c,_0x3e7f2a,_0x21f93c),{'verbose':_0x2e0476[_0x509a4d(0x127)]});return await handleSDKOutput([_0x1f5c9b[_0x509a4d(0xc6)]],_0x2e0476),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a20_0x368bbe(0xc5)]='engage:template:delete';[a20_0x368bbe(0x10c)]=a20_0x368bbe(0xcc);async[a20_0x368bbe(0xce)](_0x2ad697){const _0x43455=a20_0x368bbe,{options:_0x21c831,args:_0x46cb88,tdx:_0x4ddb6b}=_0x2ad697;if(_0x46cb88[_0x43455(0x12b)]===0x0)return console[_0x43455(0xd8)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x43455(0xd8)](_0x43455(0x139)),0x1;const _0x15c7bf=_0x46cb88[0x0],_0x376ec0=_0x21c831,_0x398c4e=await resolveWorkspaceIdFromOptions(_0x376ec0,_0x4ddb6b);if(!_0x21c831[_0x43455(0x116)]){const _0x39f1eb=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x15c7bf+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x39f1eb)return console[_0x43455(0xe5)](_0x43455(0xda)),0x0;}return await withSpinner(_0x43455(0x122)+_0x15c7bf+_0x43455(0xf4),()=>_0x4ddb6b[_0x43455(0x124)]['deleteTemplate'](_0x15c7bf,_0x398c4e),{'verbose':_0x21c831[_0x43455(0x127)]}),console['log'](_0x43455(0xe7)+_0x15c7bf+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']='engage:workspaces';[a20_0x368bbe(0x10c)]='List\x20workspaces';async[a20_0x368bbe(0xce)](_0x394dec){const _0x3a98eb=a20_0x368bbe,{options:_0x4deffb,args:_0x2f2e4e,tdx:_0x2baee5}=_0x394dec,_0xd4bc6d=_0x2f2e4e[0x0],_0x4db144=resolveLimit(_0x4deffb['limit'],DEFAULT_LLM_LIMIT),_0x222baf=await withSpinner('Fetching\x20workspaces...',()=>_0x2baee5[_0x3a98eb(0x124)]['listWorkspaces']({'limit':_0x4db144}),{'verbose':_0x4deffb[_0x3a98eb(0x127)]});let _0x4d1789=_0x222baf[_0x3a98eb(0xc6)];return _0xd4bc6d&&(_0x4d1789=_0x222baf[_0x3a98eb(0xc6)][_0x3a98eb(0x10a)](_0xc9befa=>matchGlobPattern(_0xc9befa[_0x3a98eb(0xc5)],_0xd4bc6d))),await handleSDKOutput(_0x4d1789,_0x4deffb),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']=a20_0x368bbe(0x141);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0xfd);async[a20_0x368bbe(0xce)](_0x528d76){const _0x5054f1=a20_0x368bbe,{options:_0x2756a2,args:_0x5928b7,tdx:_0x25e365}=_0x528d76;if(_0x5928b7['length']===0x0)return console[_0x5054f1(0xd8)](_0x5054f1(0xd9)),console[_0x5054f1(0xd8)](_0x5054f1(0x143)),0x1;const _0x31b5a6=_0x5928b7[0x0],_0x408b42=_0x2756a2,_0x2f54d6=_0x408b42[_0x5054f1(0x131)];if(_0x2f54d6){const _0x25f69a=await withSpinner(_0x5054f1(0xf2)+_0x31b5a6+_0x5054f1(0xf4),()=>_0x25e365[_0x5054f1(0x124)]['getWorkspaceFull'](_0x31b5a6),{'verbose':_0x2756a2[_0x5054f1(0x127)]});await handleSDKOutput([_0x25f69a],_0x2756a2);}else{const _0x39971=await withSpinner('Fetching\x20workspace\x20\x27'+_0x31b5a6+_0x5054f1(0xf4),()=>_0x25e365[_0x5054f1(0x124)]['getWorkspace'](_0x31b5a6),{'verbose':_0x2756a2['verbose']});await handleSDKOutput([_0x39971],_0x2756a2);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a20_0x368bbe(0xd5);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0x13c);async['execute'](_0x5f3a2a){const _0x4c01af=a20_0x368bbe,{options:_0x501e0c,tdx:_0x4e1505}=_0x5f3a2a,_0x17cd6f=_0x501e0c,_0x3c2ee3=_0x17cd6f[_0x4c01af(0xc5)];if(!_0x3c2ee3)return console['error'](_0x4c01af(0x11a)),console['error'](_0x4c01af(0x142)),0x1;const _0x4630ea={'name':_0x3c2ee3,'description':_0x17cd6f[_0x4c01af(0x10c)]},_0x228f5c=await withSpinner(_0x4c01af(0xdd)+_0x3c2ee3+_0x4c01af(0xf4),()=>_0x4e1505['engage'][_0x4c01af(0x136)](_0x4630ea));return await handleSDKOutput([_0x228f5c[_0x4c01af(0xc6)]],_0x501e0c),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a20_0x368bbe(0xc5)]=a20_0x368bbe(0x13f);['description']=a20_0x368bbe(0x11b);async[a20_0x368bbe(0xce)](_0x501dc9){const _0x56382d=a20_0x368bbe,{options:_0x8b0937,args:_0x2daead,tdx:_0x23c95f}=_0x501dc9;if(_0x2daead[_0x56382d(0x12b)]===0x0)return console['error'](_0x56382d(0xd9)),console[_0x56382d(0xd8)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x33a0be=_0x2daead[0x0],_0xfb562f=_0x8b0937,_0x4ab80d={'name':_0xfb562f[_0x56382d(0xc5)],'description':_0xfb562f[_0x56382d(0x10c)]},_0x337236=Object[_0x56382d(0x148)](Object['entries'](_0x4ab80d)[_0x56382d(0x10a)](([,_0x32ef22])=>_0x32ef22!==undefined));if(Object['keys'](_0x337236)[_0x56382d(0x12b)]===0x0)return console[_0x56382d(0xd8)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x56382d(0xd8)](_0x56382d(0x11e)),0x1;const _0x380f4c=await withSpinner(_0x56382d(0x100)+_0x33a0be+_0x56382d(0xf4),()=>_0x23c95f['engage'][_0x56382d(0xc7)](_0x33a0be,_0x337236),{'verbose':_0x8b0937['verbose']});return await handleSDKOutput([_0x380f4c[_0x56382d(0xc6)]],_0x8b0937),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x368bbe(0xc5)]=a20_0x368bbe(0xc2);[a20_0x368bbe(0x10c)]=a20_0x368bbe(0x14f);async[a20_0x368bbe(0xce)](_0x2e2012){const _0x46d847=a20_0x368bbe,{options:_0x54ff0e,args:_0x847d7f,tdx:_0x5a44b9}=_0x2e2012;if(_0x847d7f['length']===0x0)return console[_0x46d847(0xd8)](_0x46d847(0xd9)),console[_0x46d847(0xd8)](_0x46d847(0x121)),0x1;const _0x5df6b4=_0x847d7f[0x0];if(!_0x54ff0e['yes']){const _0x4a168b=await confirm(_0x46d847(0xfc)+_0x5df6b4+_0x46d847(0x123));if(!_0x4a168b)return console[_0x46d847(0xe5)](_0x46d847(0xda)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x5df6b4+_0x46d847(0xf4),()=>_0x5a44b9[_0x46d847(0x124)][_0x46d847(0xcb)](_0x5df6b4),{'verbose':_0x54ff0e[_0x46d847(0x127)]}),console[_0x46d847(0xe5)]('Workspace\x20\x27'+_0x5df6b4+_0x46d847(0x110)),0x0;}}function a20_0x4e6c(){const _0x221a2b=['\x27\x20launched\x20successfully','workspace','Create\x20a\x20workspace','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','status','engage:workspace:update','entries','engage:workspace:show','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','getTemplate','engage:template:update','engage_workspace','List\x20campaigns','fromEntries','jsonColumns','engage:campaign:duplicate','Resume\x20a\x20paused\x20campaign','engage:campaign:resume','1uHWcig','type','Delete\x20a\x20workspace','2272180hrLBCx','engage:campaign:update','Fetching\x20campaigns...','Launch\x20a\x20campaign','Duplicate\x20a\x20campaign','json','Delete\x20a\x20campaign','Create\x20a\x20new\x20campaign','plaintext','Pause\x20a\x20campaign','engage:workspace:delete','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','name','data','updateWorkspace','engage:campaigns','jsonl','getCampaignFull','deleteWorkspace','Delete\x20an\x20email\x20template','Error:\x20--html\x20is\x20required','execute','engage:campaign:show','segment','\x27\x20paused\x20successfully','attributes','27WsxOeB','Pausing\x20campaign\x20\x27','engage:workspace:create','engage:templates','\x27\x20resumed\x20successfully','error','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Operation\x20cancelled','listTemplates','session','Creating\x20workspace\x20\x27','4006842rWJUIK','createCampaign','Fetching\x20campaign\x20\x27','7516523GorTWm','4769752NWjllF','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','engage:campaign:pause','log','workspaceId','Template\x20\x27','parentId','MISSING_ARGUMENT','Fetching\x20template\x20\x27','emailSenderId','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Verifying\x20workspace\x20\x27','resolvePathToResource','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','resolveWorkspaceId','Fetching\x20workspace\x20\x27','launchCampaign','\x27...','segmentId','deleteCampaign','8697656yoxonw','List\x20email\x20templates','Updating\x20campaign\x20\x27','keys','parentName','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Show\x20workspace\x20details','timezone','4167999SeHRxM','Updating\x20workspace\x20\x27','5EjJqJd','duplicateCampaign','Resuming\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Show\x20email\x20template\x20details','engage:campaign:create','Fetching\x20templates...','updateTemplate','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','filter','site','description','subject','editorType','Creating\x20campaign\x20\x27','\x27\x20deleted\x20successfully','engage:template:create','Creating\x20template\x20\x27','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','engage:campaign:launch','yes','Create\x20an\x20email\x20template','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Error:\x20--name\x20is\x20required','Update\x20a\x20workspace','format','limit','Options:\x20--name,\x20--description','engage:campaign:delete','updateCampaign','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Deleting\x20template\x20\x27','\x27?\x20This\x20cannot\x20be\x20undone.','engage','startAt','Workspace\x20is\x20required\x20for\x20this\x20operation','verbose','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','engage:template:show','Error:\x20--subject\x20is\x20required','length','Update\x20a\x20campaign','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Campaign\x20\x27','Show\x20campaign\x20details','741206gHkeBX','full','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','resumeCampaign','Engage\x20workspace\x20set\x20to:\x20','html','createWorkspace','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'];a20_0x4e6c=function(){return _0x221a2b;};return a20_0x4e6c();}export class EngageWorkspaceUseCommand extends BaseCommand{[a20_0x368bbe(0xc5)]='engage:workspace:use';['description']=a20_0x368bbe(0x137);async[a20_0x368bbe(0xce)](_0x35415b){const _0x326afe=a20_0x368bbe,{options:_0x3a1674,args:_0x4a1939,tdx:_0x3997e4}=_0x35415b;if(_0x4a1939[_0x326afe(0x12b)]===0x0)return console['error']('Error:\x20Workspace\x20name\x20is\x20required'),console[_0x326afe(0xd8)]('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x2b190e=_0x4a1939[0x0];await withSpinner(_0x326afe(0xee)+_0x2b190e+_0x326afe(0xf4),()=>_0x3997e4[_0x326afe(0x124)][_0x326afe(0xf1)](_0x2b190e));const _0x104894=_0x3a1674[_0x326afe(0xdc)]||undefined;return saveSessionContext({'engage_workspace':_0x2b190e},_0x104894),console[_0x326afe(0xe5)](_0x326afe(0x134)+_0x2b190e),console[_0x326afe(0xe5)](_0x326afe(0xe3)),0x0;}}
1
+ const a20_0x4ffd04=a20_0x3407;(function(_0x4c6853,_0x105e46){const _0x47c762=a20_0x3407,_0x2e85a4=_0x4c6853();while(!![]){try{const _0x25c3b2=-parseInt(_0x47c762(0x16b))/0x1+-parseInt(_0x47c762(0x154))/0x2+parseInt(_0x47c762(0x10a))/0x3*(-parseInt(_0x47c762(0xef))/0x4)+parseInt(_0x47c762(0x12a))/0x5+-parseInt(_0x47c762(0x11a))/0x6*(parseInt(_0x47c762(0x105))/0x7)+parseInt(_0x47c762(0x13a))/0x8*(parseInt(_0x47c762(0x108))/0x9)+parseInt(_0x47c762(0x14d))/0xa;if(_0x25c3b2===_0x105e46)break;else _0x2e85a4['push'](_0x2e85a4['shift']());}catch(_0x2eff94){_0x2e85a4['push'](_0x2e85a4['shift']());}}}(a20_0x27cf,0xefb0b));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';export async function resolveWorkspaceIdFromOptions(_0x2d003c,_0x423957,_0x504f09=![]){const _0x34f5ca=a20_0x3407;if(_0x2d003c[_0x34f5ca(0x165)])return await _0x423957[_0x34f5ca(0x184)][_0x34f5ca(0xf6)](_0x2d003c[_0x34f5ca(0x165)]);const _0x8363f8=loadSessionContext(_0x2d003c[_0x34f5ca(0x17f)]);if(_0x8363f8?.[_0x34f5ca(0x160)])return await _0x423957[_0x34f5ca(0x184)][_0x34f5ca(0xf6)](_0x8363f8['engage_workspace']);if(_0x504f09)throw new SDKError(ErrorCode[_0x34f5ca(0x145)],_0x34f5ca(0x10b),undefined,{'helpText':_0x34f5ca(0x113)});return undefined;}async function resolveSegmentFromOptions(_0x2be12b,_0x49279e){const _0x3d5438=a20_0x3407;if(!_0x2be12b[_0x3d5438(0x180)])return{};const _0x3894cc=_0x2be12b['segment'],_0x3ae2f4=await _0x49279e[_0x3d5438(0x180)][_0x3d5438(0x15e)](_0x3894cc);return{'audienceId':_0x3ae2f4[_0x3d5438(0x142)],'audienceName':_0x3ae2f4[_0x3d5438(0x123)],..._0x3ae2f4[_0x3d5438(0x13f)]&&{'segmentId':_0x3ae2f4['segmentId'],'segmentName':_0x3ae2f4[_0x3d5438(0x12d)]}};}function buildConnectorConfig(_0x436137){const _0x14e1d2=a20_0x3407,_0x46c75f=_0x436137[_0x14e1d2(0x134)],_0x5efd17=_0x436137[_0x14e1d2(0x107)];if(!_0x46c75f&&!_0x5efd17)return undefined;return{..._0x46c75f&&{'emailSenderId':_0x46c75f},..._0x5efd17&&{'jsonColumns':_0x5efd17}};}export class EngageCampaignsCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x163);['description']=a20_0x4ffd04(0x17d);async[a20_0x4ffd04(0xf7)](_0x45283b){const _0x2277cb=a20_0x4ffd04,{options:_0x56a07,args:_0x5a89d5,tdx:_0x5d3718}=_0x45283b,_0x5a26ed=_0x5a89d5[0x0],_0x591fbb=resolveLimit(_0x56a07[_0x2277cb(0x12b)],DEFAULT_LLM_LIMIT),_0x242b22=_0x56a07,_0x3831e0=_0x242b22['type'],_0x27f011=_0x242b22[_0x2277cb(0x126)],_0x595c63=await resolveWorkspaceIdFromOptions(_0x242b22,_0x5d3718),_0x43702b=await withSpinner(_0x2277cb(0x11b),()=>_0x5d3718[_0x2277cb(0x184)][_0x2277cb(0xf0)]({'type':_0x3831e0,'status':_0x27f011,'workspaceId':_0x595c63,'limit':_0x591fbb}),{'verbose':_0x56a07['verbose']});let _0x512af2=_0x43702b['data'];_0x5a26ed&&(_0x512af2=_0x43702b['data'][_0x2277cb(0xfb)](_0x5d17e2=>matchGlobPattern(_0x5d17e2['name'],_0x5a26ed)));const _0x1a79ec=_0x56a07[_0x2277cb(0xff)];if(_0x56a07[_0x2277cb(0x119)]===_0x2277cb(0x12e)||_0x56a07['format']===_0x2277cb(0xf2)){const _0x2d1330=_0x512af2[_0x2277cb(0x14e)](_0x579c33=>({..._0x579c33,'url':_0x579c33[_0x2277cb(0x124)]?getCampaignUrl(_0x1a79ec,_0x579c33['workspaceId'],_0x579c33['id']):undefined}));await handleSDKOutput(_0x2d1330,_0x56a07);}else await handleSDKOutput(_0x512af2,_0x56a07);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x166);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x148);async[a20_0x4ffd04(0xf7)](_0x20013f){const _0xb16500=a20_0x4ffd04,{options:_0x185d46,args:_0x7a9ece,tdx:_0x249868}=_0x20013f;if(_0x7a9ece['length']===0x0)return console[_0xb16500(0x155)](_0xb16500(0x13b)),console[_0xb16500(0x155)](_0xb16500(0x13c)),0x1;const _0x168016=_0x7a9ece[0x0],_0x3c57b5=_0x185d46,_0x286909=await resolveWorkspaceIdFromOptions(_0x3c57b5,_0x249868),_0x2a6cfd=_0x3c57b5['full'],_0x5baf81=_0x185d46['site'];if(_0x2a6cfd){const _0x45fb49=await withSpinner(_0xb16500(0x11e)+_0x168016+_0xb16500(0x183),()=>_0x249868[_0xb16500(0x184)][_0xb16500(0x15b)](_0x168016,_0x286909),{'verbose':_0x185d46['verbose']}),_0x282051=_0x45fb49[_0xb16500(0x151)],_0x3c4b5f=_0x282051[_0xb16500(0x156)][_0xb16500(0x124)]?getCampaignUrl(_0x5baf81,_0x282051[_0xb16500(0x156)][_0xb16500(0x124)],_0x282051['id']):undefined;await handleSDKOutput([{..._0x282051,..._0x3c4b5f&&{'url':_0x3c4b5f}}],_0x185d46);}else{const _0xb7d72=await withSpinner('Fetching\x20campaign\x20\x27'+_0x168016+_0xb16500(0x183),()=>_0x249868[_0xb16500(0x184)]['getCampaign'](_0x168016,_0x286909),{'verbose':_0x185d46['verbose']}),_0xb92e7c=_0xb7d72[_0xb16500(0x151)],_0x1fe8e2=_0xb92e7c[_0xb16500(0x124)]?getCampaignUrl(_0x5baf81,_0xb92e7c[_0xb16500(0x124)],_0xb92e7c['id']):undefined;await handleSingleObjectOutput({..._0xb92e7c,..._0x1fe8e2&&{'url':_0x1fe8e2}},_0x185d46);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a20_0x4ffd04(0x16d);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x172);async[a20_0x4ffd04(0xf7)](_0x550440){const _0x192a54=a20_0x4ffd04,{options:_0x26e163,tdx:_0x56aaa9}=_0x550440,_0x3f2090=_0x26e163,_0x3169d1=_0x3f2090[_0x192a54(0x170)],_0x367200=_0x3f2090[_0x192a54(0x117)];if(!_0x3169d1)return console[_0x192a54(0x155)](_0x192a54(0x181)),console[_0x192a54(0x155)](_0x192a54(0x100)),0x1;if(!_0x367200)return console[_0x192a54(0x155)](_0x192a54(0x182)),console['error'](_0x192a54(0x100)),0x1;const _0x2033a0=await resolveWorkspaceIdFromOptions(_0x3f2090,_0x56aaa9,!![]),_0x4125f6=await resolveSegmentFromOptions(_0x3f2090,_0x56aaa9),_0x146c70=buildConnectorConfig(_0x3f2090),_0x1233a7={'name':_0x3169d1,'campaignType':_0x367200,'workspaceId':_0x2033a0,'description':_0x3f2090[_0x192a54(0x102)],..._0x4125f6,'connectorConfig':_0x146c70,'startAt':_0x3f2090[_0x192a54(0x167)],'timezone':_0x3f2090[_0x192a54(0x143)]},_0x11e247=await withSpinner('Creating\x20campaign\x20\x27'+_0x3169d1+_0x192a54(0x183),()=>_0x56aaa9[_0x192a54(0x184)]['createCampaign'](_0x1233a7));return await handleSDKOutput([_0x11e247[_0x192a54(0x151)]],_0x26e163),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a20_0x4ffd04(0x109);['description']='Update\x20a\x20campaign';async['execute'](_0x828ffc){const _0x831464=a20_0x4ffd04,{options:_0xe440ae,args:_0x405c1e,tdx:_0x463675}=_0x828ffc;if(_0x405c1e[_0x831464(0x135)]===0x0)return console[_0x831464(0x155)](_0x831464(0x13b)),console[_0x831464(0x155)](_0x831464(0x16c)),0x1;const _0xf9ecad=_0x405c1e[0x0],_0x2fcb0d=_0xe440ae,_0x3e0e6d=await resolveWorkspaceIdFromOptions(_0x2fcb0d,_0x463675),_0xbf57c=await resolveSegmentFromOptions(_0x2fcb0d,_0x463675),_0x240372=buildConnectorConfig(_0x2fcb0d),_0x4afd5f={'name':_0x2fcb0d[_0x831464(0x170)],'description':_0x2fcb0d['description'],..._0xbf57c,'connectorConfig':_0x240372,'startAt':_0x2fcb0d['startAt'],'timezone':_0x2fcb0d[_0x831464(0x143)]},_0x2480a4=Object[_0x831464(0x187)](Object[_0x831464(0x140)](_0x4afd5f)[_0x831464(0xfb)](([,_0x222ae2])=>_0x222ae2!==undefined));if(Object['keys'](_0x2480a4)[_0x831464(0x135)]===0x0)return console[_0x831464(0x155)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x831464(0x137)),0x1;const _0x189bf9=await withSpinner(_0x831464(0x144)+_0xf9ecad+_0x831464(0x183),()=>_0x463675[_0x831464(0x184)][_0x831464(0x14c)](_0xf9ecad,_0x2480a4,_0x3e0e6d),{'verbose':_0xe440ae[_0x831464(0x16f)]});return await handleSDKOutput([_0x189bf9['data']],_0xe440ae),0x0;}}function a20_0x3407(_0x4df060,_0x4ccbd7){_0x4df060=_0x4df060-0xee;const _0x27cfb2=a20_0x27cf();let _0x340704=_0x27cfb2[_0x4df060];return _0x340704;}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a20_0x4ffd04(0x186);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x10d);async[a20_0x4ffd04(0xf7)](_0x2d5fe5){const _0x20a833=a20_0x4ffd04,{options:_0x27eea3,args:_0x2e2c55,tdx:_0x24093d}=_0x2d5fe5;if(_0x2e2c55['length']===0x0)return console[_0x20a833(0x155)](_0x20a833(0x13b)),console[_0x20a833(0x155)](_0x20a833(0x104)),0x1;const _0x41c6eb=_0x2e2c55[0x0],_0x3c40bc=_0x27eea3,_0x44dca1=await resolveWorkspaceIdFromOptions(_0x3c40bc,_0x24093d);if(!_0x27eea3['yes']){const _0x3dbec7=await confirm(_0x20a833(0xf1)+_0x41c6eb+_0x20a833(0x133));if(!_0x3dbec7)return console[_0x20a833(0xfc)](_0x20a833(0x15c)),0x0;}return await withSpinner(_0x20a833(0x17a)+_0x41c6eb+_0x20a833(0x183),()=>_0x24093d[_0x20a833(0x184)][_0x20a833(0x101)](_0x41c6eb,_0x44dca1),{'verbose':_0x27eea3['verbose']}),console[_0x20a833(0xfc)](_0x20a833(0x146)+_0x41c6eb+_0x20a833(0x139)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x179);['description']=a20_0x4ffd04(0x12c);async[a20_0x4ffd04(0xf7)](_0x3e2b78){const _0x39c09d=a20_0x4ffd04,{options:_0x582b82,args:_0x3cbe70,tdx:_0xda68c8}=_0x3e2b78;if(_0x3cbe70[_0x39c09d(0x135)]===0x0)return console['error'](_0x39c09d(0x13b)),console[_0x39c09d(0x155)](_0x39c09d(0x174)),0x1;const _0x5b74bb=_0x3cbe70[0x0],_0x177082=_0x582b82,_0x41b8b5=await resolveWorkspaceIdFromOptions(_0x177082,_0xda68c8);return await withSpinner(_0x39c09d(0x159)+_0x5b74bb+_0x39c09d(0x183),()=>_0xda68c8[_0x39c09d(0x184)][_0x39c09d(0x16a)](_0x5b74bb,_0x41b8b5),{'verbose':_0x582b82['verbose']}),console[_0x39c09d(0xfc)](_0x39c09d(0x146)+_0x5b74bb+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a20_0x4ffd04(0x130);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0xfa);async['execute'](_0x257539){const _0xad3f7=a20_0x4ffd04,{options:_0xbbdb16,args:_0x398358,tdx:_0x39ef07}=_0x257539;if(_0x398358[_0xad3f7(0x135)]===0x0)return console[_0xad3f7(0x155)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0xad3f7(0x178)),0x1;const _0x4d9503=_0x398358[0x0],_0x4ab296=_0xbbdb16,_0x5bd829=await resolveWorkspaceIdFromOptions(_0x4ab296,_0x39ef07);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x4d9503+_0xad3f7(0x183),()=>_0x39ef07['engage'][_0xad3f7(0x129)](_0x4d9503,_0x5bd829),{'verbose':_0xbbdb16['verbose']}),console[_0xad3f7(0xfc)](_0xad3f7(0x146)+_0x4d9503+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x120);[a20_0x4ffd04(0x102)]='Resume\x20a\x20paused\x20campaign';async[a20_0x4ffd04(0xf7)](_0x5ccb6a){const _0x286226=a20_0x4ffd04,{options:_0x44ecdb,args:_0x64c35c,tdx:_0x448113}=_0x5ccb6a;if(_0x64c35c[_0x286226(0x135)]===0x0)return console[_0x286226(0x155)](_0x286226(0x13b)),console[_0x286226(0x155)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x4d3d8a=_0x64c35c[0x0],_0x5bced1=_0x44ecdb,_0x268d9e=await resolveWorkspaceIdFromOptions(_0x5bced1,_0x448113);return await withSpinner('Resuming\x20campaign\x20\x27'+_0x4d3d8a+_0x286226(0x183),()=>_0x448113['engage'][_0x286226(0x118)](_0x4d3d8a,_0x268d9e),{'verbose':_0x44ecdb['verbose']}),console[_0x286226(0xfc)](_0x286226(0x146)+_0x4d3d8a+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x11d);['description']=a20_0x4ffd04(0x12f);async[a20_0x4ffd04(0xf7)](_0x5b18e1){const _0x1fe7bd=a20_0x4ffd04,{options:_0x264129,args:_0x262db5,tdx:_0x3293aa}=_0x5b18e1;if(_0x262db5[_0x1fe7bd(0x135)]===0x0)return console['error'](_0x1fe7bd(0x13b)),console[_0x1fe7bd(0x155)](_0x1fe7bd(0x112)),0x1;const _0x1b871d=_0x262db5[0x0],_0x95b8ee=_0x264129,_0x25306a=await resolveWorkspaceIdFromOptions(_0x95b8ee,_0x3293aa),_0x18d0c0=await withSpinner(_0x1fe7bd(0x14b)+_0x1b871d+_0x1fe7bd(0x183),()=>_0x3293aa[_0x1fe7bd(0x184)][_0x1fe7bd(0x11f)](_0x1b871d,_0x25306a),{'verbose':_0x264129[_0x1fe7bd(0x16f)]});return await handleSDKOutput([_0x18d0c0[_0x1fe7bd(0x151)]],_0x264129),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x153);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x171);async['execute'](_0x36cd50){const _0x28ae61=a20_0x4ffd04,{options:_0x1cc9b7,args:_0x2dfeda,tdx:_0x4996d0}=_0x36cd50,_0x14f254=_0x2dfeda[0x0],_0x166005=resolveLimit(_0x1cc9b7[_0x28ae61(0x12b)],DEFAULT_LLM_LIMIT),_0x219253=_0x1cc9b7,_0x2000d0=await resolveWorkspaceIdFromOptions(_0x219253,_0x4996d0),_0x2235c1=await withSpinner(_0x28ae61(0xee),()=>_0x4996d0[_0x28ae61(0x184)][_0x28ae61(0xf5)]({'workspaceId':_0x2000d0,'limit':_0x166005}),{'verbose':_0x1cc9b7['verbose']});let _0x2622cf=_0x2235c1[_0x28ae61(0x151)];return _0x14f254&&(_0x2622cf=_0x2235c1['data'][_0x28ae61(0xfb)](_0x3c3ec9=>matchGlobPattern(_0x3c3ec9[_0x28ae61(0x170)],_0x14f254))),await handleSDKOutput(_0x2622cf,_0x1cc9b7),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']=a20_0x4ffd04(0x147);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0xf4);async[a20_0x4ffd04(0xf7)](_0x2e861c){const _0x36134e=a20_0x4ffd04,{options:_0x272dc7,args:_0x2ccab2,tdx:_0x3a1f9b}=_0x2e861c;if(_0x2ccab2[_0x36134e(0x135)]===0x0)return console[_0x36134e(0x155)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x36134e(0x155)](_0x36134e(0x17c)),0x1;const _0x732e3c=_0x2ccab2[0x0],_0x5e3c67=_0x272dc7,_0xa223b0=await resolveWorkspaceIdFromOptions(_0x5e3c67,_0x3a1f9b),_0x9e6a57=_0x5e3c67['full'];if(_0x9e6a57){const _0x33b3f9=await withSpinner(_0x36134e(0x115)+_0x732e3c+'\x27...',()=>_0x3a1f9b['engage'][_0x36134e(0x111)](_0x732e3c,_0xa223b0),{'verbose':_0x272dc7[_0x36134e(0x16f)]});await handleSDKOutput([_0x33b3f9],_0x272dc7);}else{const _0x35e8b1=await withSpinner('Fetching\x20template\x20\x27'+_0x732e3c+_0x36134e(0x183),()=>_0x3a1f9b['engage'][_0x36134e(0x125)](_0x732e3c,_0xa223b0),{'verbose':_0x272dc7['verbose']});await handleSDKOutput([_0x35e8b1],_0x272dc7);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a20_0x4ffd04(0x170)]='engage:template:create';[a20_0x4ffd04(0x102)]='Create\x20an\x20email\x20template';async[a20_0x4ffd04(0xf7)](_0x159aef){const _0x547f1c=a20_0x4ffd04,{options:_0x1bd77b,tdx:_0x499437}=_0x159aef,_0xde517d=_0x1bd77b,_0x94c1aa=_0xde517d[_0x547f1c(0x170)],_0xb1d4f6=_0xde517d[_0x547f1c(0x169)],_0x483470=_0xde517d[_0x547f1c(0x13e)];if(!_0x94c1aa)return console[_0x547f1c(0x155)](_0x547f1c(0x181)),console[_0x547f1c(0x155)](_0x547f1c(0x141)),0x1;if(!_0xb1d4f6)return console['error'](_0x547f1c(0x164)),0x1;if(!_0x483470)return console['error'](_0x547f1c(0x122)),0x1;const _0x288302=await resolveWorkspaceIdFromOptions(_0xde517d,_0x499437,!![]),_0x2466a3={'name':_0x94c1aa,'subjectTemplate':_0xb1d4f6,'htmlTemplate':_0x483470,'workspaceId':_0x288302,'plaintextTemplate':_0xde517d[_0x547f1c(0x149)],'editorType':_0xde517d[_0x547f1c(0x110)]},_0x1903cf=await withSpinner(_0x547f1c(0x15f)+_0x94c1aa+_0x547f1c(0x183),()=>_0x499437['engage'][_0x547f1c(0x136)](_0x2466a3));return await handleSDKOutput([_0x1903cf['data']],_0x1bd77b),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x158);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x177);async[a20_0x4ffd04(0xf7)](_0x5dca75){const _0x423fbb=a20_0x4ffd04,{options:_0x43a8a7,args:_0x26f651,tdx:_0x4c9b1d}=_0x5dca75;if(_0x26f651[_0x423fbb(0x135)]===0x0)return console[_0x423fbb(0x155)](_0x423fbb(0x16e)),console[_0x423fbb(0x155)]('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x29dda2=_0x26f651[0x0],_0x1d3888=_0x43a8a7,_0x2300dc=await resolveWorkspaceIdFromOptions(_0x1d3888,_0x4c9b1d),_0x54f09e={'name':_0x1d3888['name'],'subjectTemplate':_0x1d3888[_0x423fbb(0x169)],'htmlTemplate':_0x1d3888[_0x423fbb(0x13e)],'plaintextTemplate':_0x1d3888[_0x423fbb(0x149)]},_0x542627=Object[_0x423fbb(0x187)](Object['entries'](_0x54f09e)[_0x423fbb(0xfb)](([,_0x222abb])=>_0x222abb!==undefined));if(Object[_0x423fbb(0x152)](_0x542627)['length']===0x0)return console[_0x423fbb(0x155)](_0x423fbb(0x10e)),console[_0x423fbb(0x155)]('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x182041=await withSpinner(_0x423fbb(0x173)+_0x29dda2+'\x27...',()=>_0x4c9b1d[_0x423fbb(0x184)][_0x423fbb(0x168)](_0x29dda2,_0x542627,_0x2300dc),{'verbose':_0x43a8a7[_0x423fbb(0x16f)]});return await handleSDKOutput([_0x182041[_0x423fbb(0x151)]],_0x43a8a7),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']='engage:template:delete';['description']=a20_0x4ffd04(0x157);async['execute'](_0x358891){const _0x73ed87=a20_0x4ffd04,{options:_0x4105b9,args:_0x5879e0,tdx:_0x4f257c}=_0x358891;if(_0x5879e0['length']===0x0)return console['error'](_0x73ed87(0x16e)),console[_0x73ed87(0x155)](_0x73ed87(0x114)),0x1;const _0x1174a6=_0x5879e0[0x0],_0x5b1e18=_0x4105b9,_0x50c549=await resolveWorkspaceIdFromOptions(_0x5b1e18,_0x4f257c);if(!_0x4105b9['yes']){const _0x4e3dab=await confirm(_0x73ed87(0x14a)+_0x1174a6+_0x73ed87(0x133));if(!_0x4e3dab)return console[_0x73ed87(0xfc)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x73ed87(0x128)+_0x1174a6+_0x73ed87(0x183),()=>_0x4f257c[_0x73ed87(0x184)]['deleteTemplate'](_0x1174a6,_0x50c549),{'verbose':_0x4105b9[_0x73ed87(0x16f)]}),console['log'](_0x73ed87(0x175)+_0x1174a6+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x15d);[a20_0x4ffd04(0x102)]='List\x20workspaces';async[a20_0x4ffd04(0xf7)](_0x5bd2ae){const _0x231aee=a20_0x4ffd04,{options:_0x28c1f3,args:_0x5b366e,tdx:_0x4c4b10}=_0x5bd2ae,_0x278ef1=_0x5b366e[0x0],_0xdc179=resolveLimit(_0x28c1f3[_0x231aee(0x12b)],DEFAULT_LLM_LIMIT),_0x4ff9e3=await withSpinner(_0x231aee(0x161),()=>_0x4c4b10[_0x231aee(0x184)][_0x231aee(0x10c)]({'limit':_0xdc179}),{'verbose':_0x28c1f3[_0x231aee(0x16f)]});let _0x559a74=_0x4ff9e3['data'];return _0x278ef1&&(_0x559a74=_0x4ff9e3[_0x231aee(0x151)][_0x231aee(0xfb)](_0x3f5fc8=>matchGlobPattern(_0x3f5fc8[_0x231aee(0x170)],_0x278ef1))),await handleSDKOutput(_0x559a74,_0x28c1f3),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']='engage:workspace:show';[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x13d);async[a20_0x4ffd04(0xf7)](_0xf94da1){const _0x301b7a=a20_0x4ffd04,{options:_0x35833b,args:_0x1468ff,tdx:_0x3a5e45}=_0xf94da1;if(_0x1468ff[_0x301b7a(0x135)]===0x0)return console[_0x301b7a(0x155)](_0x301b7a(0x17e)),console[_0x301b7a(0x155)](_0x301b7a(0x150)),0x1;const _0x2e52fb=_0x1468ff[0x0],_0x311fe8=_0x35833b,_0x252274=_0x311fe8['full'];if(_0x252274){const _0x11d597=await withSpinner('Fetching\x20workspace\x20\x27'+_0x2e52fb+_0x301b7a(0x183),()=>_0x3a5e45[_0x301b7a(0x184)][_0x301b7a(0xfe)](_0x2e52fb),{'verbose':_0x35833b[_0x301b7a(0x16f)]});await handleSDKOutput([_0x11d597],_0x35833b);}else{const _0x100735=await withSpinner(_0x301b7a(0x121)+_0x2e52fb+_0x301b7a(0x183),()=>_0x3a5e45[_0x301b7a(0x184)]['getWorkspace'](_0x2e52fb),{'verbose':_0x35833b[_0x301b7a(0x16f)]});await handleSDKOutput([_0x100735],_0x35833b);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a20_0x4ffd04(0x170)]='engage:workspace:create';[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x11c);async[a20_0x4ffd04(0xf7)](_0x1c90f4){const _0x26e0f6=a20_0x4ffd04,{options:_0x11e0d6,tdx:_0x473283}=_0x1c90f4,_0x4fd246=_0x11e0d6,_0x5510a4=_0x4fd246['name'];if(!_0x5510a4)return console[_0x26e0f6(0x155)](_0x26e0f6(0x181)),console[_0x26e0f6(0x155)](_0x26e0f6(0x162)),0x1;const _0x4549c2={'name':_0x5510a4,'description':_0x4fd246[_0x26e0f6(0x102)]},_0x2563b4=await withSpinner('Creating\x20workspace\x20\x27'+_0x5510a4+_0x26e0f6(0x183),()=>_0x473283['engage'][_0x26e0f6(0x103)](_0x4549c2));return await handleSDKOutput([_0x2563b4[_0x26e0f6(0x151)]],_0x11e0d6),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x131);[a20_0x4ffd04(0x102)]='Update\x20a\x20workspace';async[a20_0x4ffd04(0xf7)](_0x1211aa){const _0xe13a34=a20_0x4ffd04,{options:_0x58249c,args:_0x1dd6e,tdx:_0x2b4e4f}=_0x1211aa;if(_0x1dd6e[_0xe13a34(0x135)]===0x0)return console['error'](_0xe13a34(0x17e)),console[_0xe13a34(0x155)](_0xe13a34(0x15a)),0x1;const _0x88c30f=_0x1dd6e[0x0],_0x2d2e9a=_0x58249c,_0x2eb378={'name':_0x2d2e9a['name'],'description':_0x2d2e9a[_0xe13a34(0x102)]},_0x470bf0=Object['fromEntries'](Object[_0xe13a34(0x140)](_0x2eb378)[_0xe13a34(0xfb)](([,_0x535f9a])=>_0x535f9a!==undefined));if(Object[_0xe13a34(0x152)](_0x470bf0)['length']===0x0)return console[_0xe13a34(0x155)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0xe13a34(0x155)]('Options:\x20--name,\x20--description'),0x1;const _0x464052=await withSpinner(_0xe13a34(0x17b)+_0x88c30f+_0xe13a34(0x183),()=>_0x2b4e4f['engage'][_0xe13a34(0x116)](_0x88c30f,_0x470bf0),{'verbose':_0x58249c[_0xe13a34(0x16f)]});return await handleSDKOutput([_0x464052[_0xe13a34(0x151)]],_0x58249c),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x127);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0x185);async['execute'](_0x2ce902){const _0x5a7077=a20_0x4ffd04,{options:_0x2d4b36,args:_0x11a795,tdx:_0x42f47a}=_0x2ce902;if(_0x11a795[_0x5a7077(0x135)]===0x0)return console[_0x5a7077(0x155)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x5a7077(0x155)](_0x5a7077(0xf8)),0x1;const _0x391e20=_0x11a795[0x0];if(!_0x2d4b36[_0x5a7077(0x138)]){const _0x55144d=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x391e20+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x55144d)return console[_0x5a7077(0xfc)]('Operation\x20cancelled'),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x391e20+_0x5a7077(0x183),()=>_0x42f47a['engage'][_0x5a7077(0x132)](_0x391e20),{'verbose':_0x2d4b36[_0x5a7077(0x16f)]}),console[_0x5a7077(0xfc)](_0x5a7077(0x176)+_0x391e20+_0x5a7077(0x139)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a20_0x4ffd04(0x170)]=a20_0x4ffd04(0x10f);[a20_0x4ffd04(0x102)]=a20_0x4ffd04(0xf3);async[a20_0x4ffd04(0xf7)](_0x3105d3){const _0x306eec=a20_0x4ffd04,{options:_0x547677,args:_0x23f08d,tdx:_0x76e79}=_0x3105d3;if(_0x23f08d[_0x306eec(0x135)]===0x0)return console[_0x306eec(0x155)](_0x306eec(0xfd)),console['error'](_0x306eec(0x106)),0x1;const _0x13d3b5=_0x23f08d[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x13d3b5+_0x306eec(0x183),()=>_0x76e79[_0x306eec(0x184)][_0x306eec(0xf6)](_0x13d3b5));const _0x2ea2d5=_0x547677[_0x306eec(0x17f)]||undefined;return saveSessionContext({'engage_workspace':_0x13d3b5},_0x2ea2d5),console[_0x306eec(0xfc)](_0x306eec(0x14f)+_0x13d3b5),console[_0x306eec(0xfc)](_0x306eec(0xf9)),0x0;}}function a20_0x27cf(){const _0x187c07=['Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Template\x20\x27','Workspace\x20\x27','Update\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','engage:campaign:launch','Deleting\x20campaign\x20\x27','Updating\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','List\x20campaigns','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','session','segment','Error:\x20--name\x20is\x20required','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','\x27...','engage','Delete\x20a\x20workspace','engage:campaign:delete','fromEntries','Fetching\x20templates...','348100BmbOyS','listCampaigns','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','jsonl','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Show\x20email\x20template\x20details','listTemplates','resolveWorkspaceId','execute','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Pause\x20a\x20campaign','filter','log','Error:\x20Workspace\x20name\x20is\x20required','getWorkspaceFull','site','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','deleteCampaign','description','createWorkspace','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','1239dyFlzD','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','jsonColumns','1046295lUIihN','engage:campaign:update','9QLswKy','Workspace\x20is\x20required\x20for\x20this\x20operation','listWorkspaces','Delete\x20a\x20campaign','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','engage:workspace:use','editorType','getTemplateFull','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Fetching\x20template\x20\x27','updateWorkspace','type','resumeCampaign','format','5766XOBmJC','Fetching\x20campaigns...','Create\x20a\x20workspace','engage:campaign:duplicate','Fetching\x20campaign\x20\x27','duplicateCampaign','engage:campaign:resume','Fetching\x20workspace\x20\x27','Error:\x20--html\x20is\x20required','parentName','workspaceId','getTemplate','status','engage:workspace:delete','Deleting\x20template\x20\x27','pauseCampaign','2121195WIGXTz','limit','Launch\x20a\x20campaign','segmentName','json','Duplicate\x20a\x20campaign','engage:campaign:pause','engage:workspace:update','deleteWorkspace','\x27?\x20This\x20cannot\x20be\x20undone.','emailSenderId','length','createTemplate','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','yes','\x27\x20deleted\x20successfully','112GMznWx','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Show\x20workspace\x20details','html','segmentId','entries','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','parentId','timezone','Updating\x20campaign\x20\x27','MISSING_ARGUMENT','Campaign\x20\x27','engage:template:show','Show\x20campaign\x20details','plaintext','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Duplicating\x20campaign\x20\x27','updateCampaign','2897180QnWpkq','map','Engage\x20workspace\x20set\x20to:\x20','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','data','keys','engage:templates','886782uRGGcL','error','attributes','Delete\x20an\x20email\x20template','engage:template:update','Launching\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','getCampaignFull','Operation\x20cancelled','engage:workspaces','resolvePathToResource','Creating\x20template\x20\x27','engage_workspace','Fetching\x20workspaces...','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','engage:campaigns','Error:\x20--subject\x20is\x20required','workspace','engage:campaign:show','startAt','updateTemplate','subject','launchCampaign','485193fEnnjv','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage:campaign:create','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','verbose','name','List\x20email\x20templates','Create\x20a\x20new\x20campaign','Updating\x20template\x20\x27'];a20_0x27cf=function(){return _0x187c07;};return a20_0x27cf();}
@@ -1 +1 @@
1
- const a21_0x48426d=a21_0x7148;(function(_0x3c17c6,_0x34a0ac){const _0x5a1b37=a21_0x7148,_0x461606=_0x3c17c6();while(!![]){try{const _0x14d758=-parseInt(_0x5a1b37(0x8f))/0x1*(-parseInt(_0x5a1b37(0x8d))/0x2)+parseInt(_0x5a1b37(0x81))/0x3*(-parseInt(_0x5a1b37(0x7a))/0x4)+parseInt(_0x5a1b37(0x97))/0x5+-parseInt(_0x5a1b37(0xa1))/0x6*(parseInt(_0x5a1b37(0xaf))/0x7)+-parseInt(_0x5a1b37(0x82))/0x8*(parseInt(_0x5a1b37(0x9a))/0x9)+-parseInt(_0x5a1b37(0x95))/0xa+parseInt(_0x5a1b37(0x72))/0xb*(parseInt(_0x5a1b37(0xa8))/0xc);if(_0x14d758===_0x34a0ac)break;else _0x461606['push'](_0x461606['shift']());}catch(_0x2c7b71){_0x461606['push'](_0x461606['shift']());}}}(a21_0x4c20,0xb5a82));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a21_0x7148(_0x470a2c,_0x1d30a6){_0x470a2c=_0x470a2c-0x6f;const _0x4c204a=a21_0x4c20();let _0x714880=_0x4c204a[_0x470a2c];return _0x714880;}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{[a21_0x48426d(0x91)]='jobs';['description']='List\x20jobs';async[a21_0x48426d(0x8c)](_0x479eb4){const _0x559f1e=a21_0x48426d,{options:_0x167d69,tdx:_0x14a696}=_0x479eb4,_0xec1f84=resolveLimit(_0x167d69[_0x559f1e(0x7e)],DEFAULT_DISPLAY_LIMIT),_0x143f6c=_0x167d69[_0x559f1e(0x80)];_0x167d69[_0x559f1e(0x98)]&&(console[_0x559f1e(0xa0)](_0x559f1e(0x74)+_0xec1f84+_0x559f1e(0x87)),_0x143f6c&&console[_0x559f1e(0xa0)](_0x559f1e(0x7f)+_0x143f6c));const _0x5aea47=await withSpinner(_0x559f1e(0x9f),()=>_0x14a696[_0x559f1e(0xad)][_0x559f1e(0x9b)]({'from':0x0,'to':_0xec1f84-0x1,'status':_0x143f6c}),{'verbose':_0x167d69[_0x559f1e(0x98)]}),_0x1da400=_0x5aea47['data'];console[_0x559f1e(0xa0)]('✔\x20Found\x20'+_0x1da400[_0x559f1e(0x7b)]+'\x20job'+(_0x1da400[_0x559f1e(0x7b)]!==0x1?'s':''));const _0x23e140=_0x1da400['map'](_0x554f54=>{const _0x293271=_0x559f1e;let _0x319f04;if(_0x554f54[_0x293271(0xa9)]&&_0x554f54['end_at']){const _0xcafff2=new Date(_0x554f54['start_at'])[_0x293271(0x7d)](),_0x39044d=new Date(_0x554f54[_0x293271(0x78)])[_0x293271(0x7d)]();_0x319f04=Math[_0x293271(0xb2)]((_0x39044d-_0xcafff2)/0x3e8);}return{'job_id':_0x554f54['job_id'],'type':_0x554f54[_0x293271(0x92)],'status':_0x554f54[_0x293271(0x80)],'user_name':_0x554f54['user_name'],'duration_sec':_0x319f04,'created_at':_0x554f54['created_at'],'started_at':_0x554f54[_0x293271(0xa9)],'end_at':_0x554f54[_0x293271(0x78)]};});return await handleSDKOutput(_0x23e140,_0x167d69),0x0;}}export class JobShowCommand extends BaseCommand{[a21_0x48426d(0x91)]='job:show';[a21_0x48426d(0xa2)]=a21_0x48426d(0x9e);[a21_0x48426d(0x77)](_0x5355c4){const _0x4b8ad9=a21_0x48426d,_0x3547fd=_0x5355c4[_0x4b8ad9(0x85)][0x0];if(!_0x3547fd)return _0x4b8ad9(0x89);return undefined;}async[a21_0x48426d(0x8c)](_0x55b0da){const _0xd48a32=a21_0x48426d,{options:_0x14d6b,args:_0xf6458a,tdx:_0x329045}=_0x55b0da,_0x274359=_0xf6458a[0x0],_0xe818ac=await withSpinner(_0xd48a32(0x70),()=>_0x329045[_0xd48a32(0xad)]['show'](_0x274359),{'verbose':_0x14d6b[_0xd48a32(0x98)]}),_0x3899fb=_0xe818ac[_0xd48a32(0xb3)];let _0x5839e9;if(_0x3899fb[_0xd48a32(0xa9)]&&_0x3899fb[_0xd48a32(0x78)]){const _0x210bc1=new Date(_0x3899fb[_0xd48a32(0xa9)])['getTime'](),_0x3b694c=new Date(_0x3899fb[_0xd48a32(0x78)])[_0xd48a32(0x7d)]();_0x5839e9=Math['round']((_0x3b694c-_0x210bc1)/0x3e8);}const _0x309e51={'job_id':_0x3899fb[_0xd48a32(0xaa)],'type':_0x3899fb[_0xd48a32(0x92)],'status':_0x3899fb['status'],..._0x3899fb[_0xd48a32(0x6f)]&&{'user_name':_0x3899fb[_0xd48a32(0x6f)]},..._0x5839e9!==undefined&&{'duration_sec':_0x5839e9},..._0x3899fb['created_at']&&{'created_at':_0x3899fb[_0xd48a32(0x79)]},..._0x3899fb[_0xd48a32(0xa9)]&&{'started_at':_0x3899fb['start_at']},..._0x3899fb[_0xd48a32(0x78)]&&{'end_at':_0x3899fb['end_at']},..._0x3899fb['database']&&{'database':_0x3899fb[_0xd48a32(0x84)]},..._0x3899fb[_0xd48a32(0x73)]!==undefined&&{'priority':_0x3899fb[_0xd48a32(0x73)]},..._0x3899fb[_0xd48a32(0xa7)]&&{'url':_0x3899fb[_0xd48a32(0xa7)]},..._0x3899fb[_0xd48a32(0xa3)]&&{'query':_0x3899fb[_0xd48a32(0xa3)]},..._0x3899fb['debug']&&{'debug':_0x3899fb['debug']}};return await handleSingleObjectOutput(_0x309e51,_0x14d6b),0x0;}}function a21_0x4c20(){const _0x179c71=['job_id','yes','job:result','jobs','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','1918ZsTZww','...','Kill\x20a\x20job','round','data','user_name','Getting\x20job\x20details...','jobType','1697014BGJqBl','priority','Limit:\x20','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','validate','end_at','created_at','3096292LDlPOl','length','result','getTime','limit','Status\x20filter:\x20','status','3hrcoHc','72UoyQPk','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','database','args','file','\x20jobs','trino','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','\x20\x20Job\x20ID:\x20','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','execute','644646vwMHdZ','substring','1QzPiuc','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','name','type','submit','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','7293240DcDCYL','INVALID_ARGUMENT','5289995KRvCxT','verbose','Submitting\x20kill\x20request...','773739allSjQ','list','job:submit','No\x20SQL\x20statements\x20found\x20in\x20file','Show\x20job\x20details','Listing\x20jobs...','error','11364KbzGMZ','description','query','Database:\x20','Get\x20job\x20results','\x27\x20to\x20verify\x20the\x20job\x20status','url','168SONofv','start_at'];a21_0x4c20=function(){return _0x179c71;};return a21_0x4c20();}export class JobKillCommand extends BaseCommand{[a21_0x48426d(0x91)]='job:kill';[a21_0x48426d(0xa2)]=a21_0x48426d(0xb1);[a21_0x48426d(0x77)](_0x4fe81a){const _0x3e9787=a21_0x48426d,_0x5ca623=_0x4fe81a[_0x3e9787(0x85)][0x0];if(!_0x5ca623)return _0x3e9787(0x76);return undefined;}async[a21_0x48426d(0x8c)](_0x21b498){const _0x18de6d=a21_0x48426d,{options:_0xe49613,args:_0x1f031a,tdx:_0x5de78c}=_0x21b498,_0x3b08c3=_0x1f031a[0x0];if(!_0xe49613[_0x18de6d(0xab)]){const _0x3f8878=await confirm(_0x18de6d(0x83)+_0x3b08c3+'?');if(!_0x3f8878)return console[_0x18de6d(0xa0)]('Cancelled'),0x0;}return await withSpinner(_0x18de6d(0x99),()=>_0x5de78c[_0x18de6d(0xad)]['kill'](_0x3b08c3),{'verbose':_0xe49613[_0x18de6d(0x98)]}),console[_0x18de6d(0xa0)](_0x18de6d(0x75)+_0x3b08c3),console[_0x18de6d(0xa0)](_0x18de6d(0x90)+_0x3b08c3+_0x18de6d(0xa6)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a21_0x48426d(0x9c);[a21_0x48426d(0xa2)]='Submit\x20a\x20job';async['execute'](_0x1d50b0){const _0x3a86be=a21_0x48426d,{options:_0x396c40,args:_0x3b1c19,tdx:_0x3d6034}=_0x1d50b0,_0x365789=_0x396c40[_0x3a86be(0x71)]||_0x3a86be(0x88),_0x7671e8=_0x396c40[_0x3a86be(0x86)],_0x1d0c73=_0x396c40[_0x3a86be(0x84)]||'information_schema',_0x2678cb=_0x396c40['result'];if(_0x365789!==_0x3a86be(0x88)&&_0x365789!=='hive')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3a86be(0x94));let _0x3928a3;if(_0x7671e8){if(_0x3b1c19[0x0])throw new SDKError(ErrorCode[_0x3a86be(0x96)],_0x3a86be(0xae));const _0x58d461=readSqlStatementsFromFile(_0x7671e8);if(_0x58d461[_0x3a86be(0x7b)]===0x0)throw new SDKError(ErrorCode[_0x3a86be(0x96)],_0x3a86be(0x9d));if(_0x58d461[_0x3a86be(0x7b)]>0x1)throw new SDKError(ErrorCode[_0x3a86be(0x96)],_0x3a86be(0x8b));_0x3928a3=_0x58d461[0x0];}else{if(!_0x3b1c19[0x0])throw new SDKError(ErrorCode[_0x3a86be(0x96)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x3928a3=_0x3b1c19[0x0];}_0x396c40[_0x3a86be(0x98)]&&(console[_0x3a86be(0xa0)]('Job\x20type:\x20'+_0x365789),console[_0x3a86be(0xa0)](_0x3a86be(0xa4)+_0x1d0c73),console[_0x3a86be(0xa0)]('Query:\x20'+_0x3928a3[_0x3a86be(0x8e)](0x0,0x64)+(_0x3928a3[_0x3a86be(0x7b)]>0x64?_0x3a86be(0xb0):'')));const _0x4c886b=await withSpinner('Submitting\x20job...',()=>_0x3d6034[_0x3a86be(0xad)][_0x3a86be(0x93)](_0x1d0c73,_0x3928a3,_0x365789,_0x2678cb),{'verbose':_0x396c40['verbose']}),_0x26caba=_0x4c886b[_0x3a86be(0xb3)];return console['error']('✔\x20Job\x20submitted'),console[_0x3a86be(0xa0)](_0x3a86be(0x8a)+_0x26caba[_0x3a86be(0xaa)]),await handleSDKOutput([_0x26caba],_0x396c40),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a21_0x48426d(0xac);['description']=a21_0x48426d(0xa5);[a21_0x48426d(0x77)](_0x1165a9){const _0x2b487c=a21_0x48426d,_0x2b8496=_0x1165a9[_0x2b487c(0x85)][0x0];if(!_0x2b8496)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async['execute'](_0x512460){const _0x6713f2=a21_0x48426d,{options:_0x3eabdc,args:_0x320880,tdx:_0x222b80}=_0x512460,_0x5ba64e=_0x320880[0x0],_0xfee81c=await withSpinner('Getting\x20job\x20results...',()=>_0x222b80[_0x6713f2(0xad)][_0x6713f2(0x7c)](_0x5ba64e),{'verbose':_0x3eabdc[_0x6713f2(0x98)]}),_0x37a2af=_0xfee81c['data'];return console[_0x6713f2(0xa0)]('✔\x20Retrieved\x20'+_0x37a2af[_0x6713f2(0x7b)]+'\x20row'+(_0x37a2af[_0x6713f2(0x7b)]!==0x1?'s':'')),await handleSDKOutput(_0x37a2af,_0x3eabdc),0x0;}}
1
+ const a21_0xb5e50b=a21_0x4e36;(function(_0x4ccdbf,_0x2048d1){const _0x1d1b15=a21_0x4e36,_0x275fa1=_0x4ccdbf();while(!![]){try{const _0x51f465=parseInt(_0x1d1b15(0x1dc))/0x1+-parseInt(_0x1d1b15(0x1fb))/0x2*(parseInt(_0x1d1b15(0x1f5))/0x3)+parseInt(_0x1d1b15(0x213))/0x4*(parseInt(_0x1d1b15(0x1d2))/0x5)+parseInt(_0x1d1b15(0x20a))/0x6+parseInt(_0x1d1b15(0x20c))/0x7*(-parseInt(_0x1d1b15(0x20e))/0x8)+parseInt(_0x1d1b15(0x1f3))/0x9*(-parseInt(_0x1d1b15(0x204))/0xa)+-parseInt(_0x1d1b15(0x211))/0xb*(-parseInt(_0x1d1b15(0x1d5))/0xc);if(_0x51f465===_0x2048d1)break;else _0x275fa1['push'](_0x275fa1['shift']());}catch(_0x5a875c){_0x275fa1['push'](_0x275fa1['shift']());}}}(a21_0x1a7b,0xbbaa9));function a21_0x1a7b(){const _0x214236=['Get\x20job\x20results','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','1426584RoetRS','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Getting\x20job\x20results...','Submitting\x20kill\x20request...','length','status','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','job:kill','description','10EmxaNz','verbose','\x20jobs','\x20job','job:submit','jobs','6385044rbQVTh','args','91VjxCyo','getTime','123352JQZPMP','type','map','209chiDvQ','url','1115664CepsEl','substring','Show\x20job\x20details','Cancelled','list','data','start_at','INVALID_ARGUMENT','information_schema','5UoKKws','query','job_id','1006536ifPwCZ','✔\x20Found\x20','priority','end_at','validate','database','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','470947KMRXxz','user_name','limit','trino','✔\x20Retrieved\x20','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','name','Submit\x20a\x20job','Getting\x20job\x20details...','execute','Job\x20type:\x20','hive','\x27\x20to\x20verify\x20the\x20job\x20status','yes','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','submit','error','kill','created_at','Submitting\x20job...','job:show','result','9108063AsgVJB','List\x20jobs','6FeBYUH','Limit:\x20','Kill\x20a\x20job','show'];a21_0x1a7b=function(){return _0x214236;};return a21_0x1a7b();}function a21_0x4e36(_0x2f14f5,_0x488c6d){_0x2f14f5=_0x2f14f5-0x1ce;const _0x1a7bd1=a21_0x1a7b();let _0x4e36cd=_0x1a7bd1[_0x2f14f5];return _0x4e36cd;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}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';export class JobListCommand extends BaseCommand{['name']=a21_0xb5e50b(0x209);['description']=a21_0xb5e50b(0x1f4);async[a21_0xb5e50b(0x1e5)](_0x40d922){const _0x1c57a1=a21_0xb5e50b,{options:_0x1e133d,tdx:_0x2f3c3a}=_0x40d922,_0x59e8a3=resolveLimit(_0x1e133d[_0x1c57a1(0x1de)],DEFAULT_DISPLAY_LIMIT),_0x18e875=_0x1e133d[_0x1c57a1(0x200)];_0x1e133d['verbose']&&(console['error'](_0x1c57a1(0x1f6)+_0x59e8a3+_0x1c57a1(0x206)),_0x18e875&&console[_0x1c57a1(0x1ed)]('Status\x20filter:\x20'+_0x18e875));const _0x32bb96=await withSpinner('Listing\x20jobs...',()=>_0x2f3c3a[_0x1c57a1(0x209)][_0x1c57a1(0x217)]({'from':0x0,'to':_0x59e8a3-0x1,'status':_0x18e875}),{'verbose':_0x1e133d[_0x1c57a1(0x205)]}),_0x27d38e=_0x32bb96[_0x1c57a1(0x1ce)];console[_0x1c57a1(0x1ed)](_0x1c57a1(0x1d6)+_0x27d38e[_0x1c57a1(0x1ff)]+_0x1c57a1(0x207)+(_0x27d38e[_0x1c57a1(0x1ff)]!==0x1?'s':''));const _0x4e6d26=_0x27d38e[_0x1c57a1(0x210)](_0x27b125=>{const _0x43fd90=_0x1c57a1;let _0x3fc801;if(_0x27b125[_0x43fd90(0x1cf)]&&_0x27b125[_0x43fd90(0x1d8)]){const _0x6e3587=new Date(_0x27b125[_0x43fd90(0x1cf)])[_0x43fd90(0x20d)](),_0x4131e8=new Date(_0x27b125[_0x43fd90(0x1d8)])[_0x43fd90(0x20d)]();_0x3fc801=Math['round']((_0x4131e8-_0x6e3587)/0x3e8);}return{'job_id':_0x27b125[_0x43fd90(0x1d4)],'type':_0x27b125[_0x43fd90(0x20f)],'status':_0x27b125['status'],'user_name':_0x27b125[_0x43fd90(0x1dd)],'duration_sec':_0x3fc801,'created_at':_0x27b125['created_at'],'started_at':_0x27b125[_0x43fd90(0x1cf)],'end_at':_0x27b125[_0x43fd90(0x1d8)]};});return await handleSDKOutput(_0x4e6d26,_0x1e133d),0x0;}}export class JobShowCommand extends BaseCommand{[a21_0xb5e50b(0x1e2)]=a21_0xb5e50b(0x1f1);['description']=a21_0xb5e50b(0x215);[a21_0xb5e50b(0x1d9)](_0x2b3ac7){const _0x2c5ed5=a21_0xb5e50b,_0xcd7ae6=_0x2b3ac7[_0x2c5ed5(0x20b)][0x0];if(!_0xcd7ae6)return _0x2c5ed5(0x1ea);return undefined;}async[a21_0xb5e50b(0x1e5)](_0x283661){const _0x34fcbf=a21_0xb5e50b,{options:_0x18c6b0,args:_0x2ab86f,tdx:_0x1ed5af}=_0x283661,_0x18cedc=_0x2ab86f[0x0],_0x5eb904=await withSpinner(_0x34fcbf(0x1e4),()=>_0x1ed5af[_0x34fcbf(0x209)][_0x34fcbf(0x1f8)](_0x18cedc),{'verbose':_0x18c6b0[_0x34fcbf(0x205)]}),_0x755f7f=_0x5eb904['data'];let _0x57b291;if(_0x755f7f[_0x34fcbf(0x1cf)]&&_0x755f7f[_0x34fcbf(0x1d8)]){const _0x1136d4=new Date(_0x755f7f[_0x34fcbf(0x1cf)])['getTime'](),_0x18d783=new Date(_0x755f7f['end_at'])[_0x34fcbf(0x20d)]();_0x57b291=Math['round']((_0x18d783-_0x1136d4)/0x3e8);}const _0xd24538={'job_id':_0x755f7f[_0x34fcbf(0x1d4)],'type':_0x755f7f[_0x34fcbf(0x20f)],'status':_0x755f7f[_0x34fcbf(0x200)],..._0x755f7f['user_name']&&{'user_name':_0x755f7f[_0x34fcbf(0x1dd)]},..._0x57b291!==undefined&&{'duration_sec':_0x57b291},..._0x755f7f[_0x34fcbf(0x1ef)]&&{'created_at':_0x755f7f[_0x34fcbf(0x1ef)]},..._0x755f7f[_0x34fcbf(0x1cf)]&&{'started_at':_0x755f7f[_0x34fcbf(0x1cf)]},..._0x755f7f['end_at']&&{'end_at':_0x755f7f['end_at']},..._0x755f7f['database']&&{'database':_0x755f7f[_0x34fcbf(0x1da)]},..._0x755f7f[_0x34fcbf(0x1d7)]!==undefined&&{'priority':_0x755f7f[_0x34fcbf(0x1d7)]},..._0x755f7f[_0x34fcbf(0x212)]&&{'url':_0x755f7f[_0x34fcbf(0x212)]},..._0x755f7f[_0x34fcbf(0x1d3)]&&{'query':_0x755f7f[_0x34fcbf(0x1d3)]},..._0x755f7f['debug']&&{'debug':_0x755f7f['debug']}};return await handleSingleObjectOutput(_0xd24538,_0x18c6b0),0x0;}}export class JobKillCommand extends BaseCommand{[a21_0xb5e50b(0x1e2)]=a21_0xb5e50b(0x202);[a21_0xb5e50b(0x203)]=a21_0xb5e50b(0x1f7);[a21_0xb5e50b(0x1d9)](_0x307e5f){const _0x42b15c=a21_0xb5e50b,_0x3f1b22=_0x307e5f[_0x42b15c(0x20b)][0x0];if(!_0x3f1b22)return _0x42b15c(0x201);return undefined;}async[a21_0xb5e50b(0x1e5)](_0x17536a){const _0x49c6f6=a21_0xb5e50b,{options:_0x1f7dd0,args:_0x381634,tdx:_0x405b29}=_0x17536a,_0x156865=_0x381634[0x0];if(!_0x1f7dd0[_0x49c6f6(0x1e9)]){const _0x5bed28=await confirm(_0x49c6f6(0x1eb)+_0x156865+'?');if(!_0x5bed28)return console['error'](_0x49c6f6(0x216)),0x0;}return await withSpinner(_0x49c6f6(0x1fe),()=>_0x405b29[_0x49c6f6(0x209)][_0x49c6f6(0x1ee)](_0x156865),{'verbose':_0x1f7dd0['verbose']}),console[_0x49c6f6(0x1ed)](_0x49c6f6(0x1fc)+_0x156865),console['error'](_0x49c6f6(0x1fa)+_0x156865+_0x49c6f6(0x1e8)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a21_0xb5e50b(0x1e2)]=a21_0xb5e50b(0x208);[a21_0xb5e50b(0x203)]=a21_0xb5e50b(0x1e3);async[a21_0xb5e50b(0x1e5)](_0x1ea5f0){const _0x8fc451=a21_0xb5e50b,{options:_0x137a7a,args:_0x1ca22a,tdx:_0x3a9781}=_0x1ea5f0,_0x1769c1=_0x137a7a['jobType']||_0x8fc451(0x1df),_0xb3558b=_0x137a7a['file'],_0x529cee=_0x137a7a[_0x8fc451(0x1da)]||_0x8fc451(0x1d1),_0x26a54c=_0x137a7a[_0x8fc451(0x1f2)];if(_0x1769c1!==_0x8fc451(0x1df)&&_0x1769c1!==_0x8fc451(0x1e7))throw new SDKError(ErrorCode[_0x8fc451(0x1d0)],_0x8fc451(0x1e1));let _0x4bb81c;if(_0xb3558b){if(_0x1ca22a[0x0])throw new SDKError(ErrorCode[_0x8fc451(0x1d0)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x120416=readSqlStatementsFromFile(_0xb3558b);if(_0x120416[_0x8fc451(0x1ff)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x120416[_0x8fc451(0x1ff)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x4bb81c=_0x120416[0x0];}else{if(!_0x1ca22a[0x0])throw new SDKError(ErrorCode[_0x8fc451(0x1d0)],_0x8fc451(0x1db));_0x4bb81c=_0x1ca22a[0x0];}_0x137a7a[_0x8fc451(0x205)]&&(console['error'](_0x8fc451(0x1e6)+_0x1769c1),console[_0x8fc451(0x1ed)]('Database:\x20'+_0x529cee),console[_0x8fc451(0x1ed)]('Query:\x20'+_0x4bb81c[_0x8fc451(0x214)](0x0,0x64)+(_0x4bb81c[_0x8fc451(0x1ff)]>0x64?'...':'')));const _0x2559cd=await withSpinner(_0x8fc451(0x1f0),()=>_0x3a9781[_0x8fc451(0x209)][_0x8fc451(0x1ec)](_0x529cee,_0x4bb81c,_0x1769c1,_0x26a54c),{'verbose':_0x137a7a[_0x8fc451(0x205)]}),_0x628a9e=_0x2559cd[_0x8fc451(0x1ce)];return console[_0x8fc451(0x1ed)]('✔\x20Job\x20submitted'),console[_0x8fc451(0x1ed)]('\x20\x20Job\x20ID:\x20'+_0x628a9e[_0x8fc451(0x1d4)]),await handleSDKOutput([_0x628a9e],_0x137a7a),0x0;}}export class JobResultCommand extends BaseCommand{[a21_0xb5e50b(0x1e2)]='job:result';[a21_0xb5e50b(0x203)]=a21_0xb5e50b(0x1f9);['validate'](_0x4be938){const _0x2d6580=a21_0xb5e50b,_0x4d685b=_0x4be938[_0x2d6580(0x20b)][0x0];if(!_0x4d685b)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async['execute'](_0x4e6fe2){const _0x32581e=a21_0xb5e50b,{options:_0x23149d,args:_0x5751b4,tdx:_0x3c4963}=_0x4e6fe2,_0x3a7121=_0x5751b4[0x0],_0x2ab536=await withSpinner(_0x32581e(0x1fd),()=>_0x3c4963[_0x32581e(0x209)]['result'](_0x3a7121),{'verbose':_0x23149d['verbose']}),_0x32afc9=_0x2ab536[_0x32581e(0x1ce)];return console[_0x32581e(0x1ed)](_0x32581e(0x1e0)+_0x32afc9[_0x32581e(0x1ff)]+'\x20row'+(_0x32afc9[_0x32581e(0x1ff)]!==0x1?'s':'')),await handleSDKOutput(_0x32afc9,_0x23149d),0x0;}}
@@ -1 +1 @@
1
- const a22_0x9ba4d0=a22_0x8643;(function(_0x27cc67,_0x17dba3){const _0x288539=a22_0x8643,_0x55526e=_0x27cc67();while(!![]){try{const _0x49af8c=parseInt(_0x288539(0x12b))/0x1+parseInt(_0x288539(0x1a7))/0x2+parseInt(_0x288539(0x1be))/0x3+parseInt(_0x288539(0x108))/0x4+parseInt(_0x288539(0x16b))/0x5+parseInt(_0x288539(0xf2))/0x6*(-parseInt(_0x288539(0x109))/0x7)+parseInt(_0x288539(0x1c2))/0x8*(-parseInt(_0x288539(0x144))/0x9);if(_0x49af8c===_0x17dba3)break;else _0x55526e['push'](_0x55526e['shift']());}catch(_0x692404){_0x55526e['push'](_0x55526e['shift']());}}}(a22_0x1bc7,0xcfe43));function a22_0x8643(_0x4725cc,_0x4bcbdc){_0x4725cc=_0x4725cc-0xc2;const _0x1bc764=a22_0x1bc7();let _0x8643ee=_0x1bc764[_0x4725cc];return _0x8643ee;}import a22_0x4d1c63 from'chalk';import a22_0x4530a1 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';function a22_0x1bc7(){const _0x224295=['type','tdx.json','attributes','37050606khOqkx','version','\x20=\x20','journey:stats','Fetching\x20parent\x20segment...','listJourneysWithFolders','folderId','\x20version','Getting\x20column\x20mapping...','✔\x20Journey\x20\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','getParentFull','Error:\x20Parent\x20segment\x20context\x20required','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','dryRun','.yml','Error:\x20Invalid\x20--type\x20\x22','Resolved\x20YAML\x20file:\x20','/e/','hasChanges','Getting\x20journey\x20statistics...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','error','Error:\x20Stage\x20\x22','Folder\x20path:\x20','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','rootFolderId','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyBundleName','Input:\x20','session','activation','cyan','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)','\x20->\x20','isNew','stageNameMap','diff','5931015fmjrzm','📁\x20','\x0aPull\x20summary:','includeStats','journey:versions','jsonl','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','journey','dim','json','length','completed','getTrafficData','\x20\x20Statistics\x20not\x20available','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20journey...','createdAt','then','journey:traffic','values','size','execute','user','List\x20activations\x20for\x20a\x20journey','join','connector_config','utf-8','journey:columns','(running)','green','Resolving\x20version...','✔\x20Context\x20set:\x20','stage','goal','content','\x20\x20Name:\x20','tsv','Creating\x20new\x20version...','journey:version:view','\x20journey\x20files\x20to\x20','journey:list','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Write\x20','listJourneysFromParentSegment','Listing\x20journey\x20activations...','Parent\x20segment:\x20','Resume\x20a\x20paused\x20journey','push','getColumnMapping','renderStats','verbose','\x20changed\x20files','journey:activations','absolutePath','relative','List\x20journeys\x20in\x20current\x20context','...','map','targetDir','No\x20journeys\x20found','3236610KSDlVy','Target\x20file:\x20','format','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20\x20Target:\x20','\x0aChanges\x20to\x20\x27','hasPeriod','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x20journeys','site','message','web','exitOrJumpSize','goalSize','nodes','resolveParentId','parentSegment','filePath','/j/da/je','\x20journey','segment','limit','(paused)','2596218YSURPh','history','Warning:\x20Could\x20not\x20resolve\x20segment\x20','resourceName','8UMOyLu','pause','base','entries','resolveJourneyId','Show\x20journey\x20table\x20column\x20mapping','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','journey:push','journey:resume','\x20(draft)\x20—\x20\x22','resolveSegment','draft','journey:pull','journeyBundleId','exitOrJumpRate','all','listActivationsFlat','Warning:\x20Could\x20not\x20resolve\x20activation\x20','sort','Error:\x20Version\x20','\x20\x20Journey\x20ID:\x20','helpText','getStatistics','from','set','Found\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','listFolders','state','split','\x20versions)','segmentName','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','get','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','repeat','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x27\x20not\x20found\x20in\x20','versionNumber','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','yellow','createVersion','\x22\x20not\x20found','List\x20all\x20versions\x20of\x20a\x20journey','name','conversion','Cancelled','table','yes','segmentPushCommand','connection','\x20(rule\x20match)','journey:pause','red','-\x20no\x20files\x20written','journey:version:create','rule','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Resolving\x20parent\x20segment...','listVersions','\x20\x20-\x20','Error:\x20','834gfSAOc','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Show\x20journey\x20details','reentryMode','\x20unchanged\x20files','Options:','parent_segment','Error:\x20Invalid\x20version\x20number:\x20','log','kind','✔\x20Found\x20','localeCompare','buildIdToEmailMap','(archived)','completionRate','\x20Created\x20v','INVALID_ARGUMENT','has','journeyName','Getting\x20journey\x20details...','toLowerCase','journeyStages','5070076oBoNFa','71267FwLzyM','Fetching\x20users\x20and\x20connections...','/app/ps/','\x20new\x20files','No\x20statistics\x20available\x20for\x20journey:\x20','stages','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','includeHistory','launched','folderPath','add','activationParams','Pattern:\x20','archived','blue','description','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','paused','Available\x20stages:\x20','enteredSize','journeys','Show\x20journey\x20statistics','getJourney','no_parent','Table:\x20','Aborted.','Error:\x20Journey\x20not\x20found:\x20','\x22\x20resumed','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','activation_','completeMilestoneRate','errorCode','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x20\x20Parent\x20segment:\x20','1445983lxTbgX','file','\x20activation','args','cwd','updatedAt','Fetching\x20',',\x20version:\x20','filter','\x22\x20paused','\x20details...','journeyId','Target\x20directory:\x20','\x20Opening\x20','\x20\x20Folder\x20path:\x20','\x20files?','parentName','(root)','folders','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','segments','find'];a22_0x1bc7=function(){return _0x224295;};return a22_0x1bc7();}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(_0xb2f116){const _0x123fc9=a22_0x8643;return!_0xb2f116&&(console[_0x123fc9(0x15b)](_0x123fc9(0xd3)),console[_0x123fc9(0x15b)](_0x123fc9(0x1aa))),!!_0xb2f116;}function withJsonFormat(_0x140677){const _0x5adf9f=a22_0x8643;if(!_0x140677['format']&&!_0x140677[_0x5adf9f(0x174)]&&!_0x140677['jsonl']&&!_0x140677[_0x5adf9f(0x18f)])return{..._0x140677,'format':_0x5adf9f(0x174),'json':!![]};return _0x140677;}function formatJourneyState(_0x5b6a63){const _0x5f5552=a22_0x8643;switch(_0x5b6a63){case _0x5f5552(0x111):return a22_0x4d1c63[_0x5f5552(0x188)](_0x5f5552(0x187));case _0x5f5552(0x1ce):return a22_0x4d1c63[_0x5f5552(0x173)]('(draft)');case _0x5f5552(0x11a):return a22_0x4d1c63[_0x5f5552(0xdc)](_0x5f5552(0x1bd));case _0x5f5552(0x176):return a22_0x4d1c63[_0x5f5552(0x117)]('(completed)');case _0x5f5552(0x116):return a22_0x4d1c63[_0x5f5552(0x173)](_0x5f5552(0xff));default:return'('+_0x5b6a63+')';}}function formatJourneyItem(_0x19ab6a,_0x59dd2e='',_0xa776d6){const _0x554c2f=a22_0x8643,_0x7640bf=formatJourneyState(_0x19ab6a[_0x554c2f(0xcf)]),_0x23878d=_0xa776d6?hyperlink(_0x19ab6a[_0x554c2f(0x161)],_0xa776d6):_0x19ab6a[_0x554c2f(0x161)];return _0x59dd2e+'🗺️\x20'+_0x23878d+'\x20'+_0x7640bf;}function escapeRegex(_0x399947){return _0x399947['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x49d9cb){const _0x283b41=a22_0x8643,_0xa87ea9=_0x49d9cb[_0x283b41(0xd0)]('*')[_0x283b41(0x1a4)](escapeRegex);return new RegExp(_0xa87ea9[_0x283b41(0x183)]('.*'),'i');}function buildRuleToNameMapping(_0x5abe1a){const _0x299450=a22_0x8643,_0x12a1a9=new Map();if(_0x5abe1a[_0x299450(0x13f)])for(const [_0x38a15f,_0x2412ba]of Object[_0x299450(0x1c5)](_0x5abe1a[_0x299450(0x13f)])){if(_0x2412ba['rule']){const _0x1cb753=serializeRule(_0x2412ba[_0x299450(0xec)]),_0x57a146=_0x12a1a9['get'](_0x1cb753);_0x57a146?_0x57a146[_0x299450(0x19a)](_0x38a15f):_0x12a1a9[_0x299450(0xcb)](_0x1cb753,[_0x38a15f]);}}return _0x12a1a9;}async function resolveJourneyIdFromInput(_0x1c1513,_0x3ac6c8,_0x10d0d7){const _0x3f4782=a22_0x8643,_0xb13ba0=await resolveJourneyTarget(_0x1c1513,_0x3ac6c8[_0x3f4782(0x1b7)],_0x3ac6c8[_0x3f4782(0x19d)]),_0x227a7e=_0xb13ba0[_0x3f4782(0x1b7)];if(!_0x227a7e)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3f4782(0x171));const _0x3c7d5a=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x10d0d7[_0x3f4782(0x1bb)][_0x3f4782(0x1b6)](_0x227a7e),{'verbose':_0x3ac6c8[_0x3f4782(0x19d)]}),_0x4d5a49=_0x3c7d5a[_0x3f4782(0xd7)],_0x4841e4=await withSpinner(_0x3f4782(0x17a),()=>_0x10d0d7[_0x3f4782(0x172)][_0x3f4782(0x1c6)](_0x4d5a49,_0xb13ba0[_0x3f4782(0x104)]),{'verbose':_0x3ac6c8[_0x3f4782(0x19d)]});return{'journeyId':_0x4841e4[_0x3f4782(0xd7)],'journeyName':_0xb13ba0[_0x3f4782(0x104)],'parentSegmentId':_0x4d5a49};}async function resolveJourneyTarget(_0x57b076,_0xa986c6,_0x58e740){const _0x519020=a22_0x8643;if(isYamlFilePath(_0x57b076))try{const _0x162aee=await resolveYamlFilePath(_0x57b076);return _0x58e740&&(console['error'](_0x519020(0x156)+_0x57b076),console[_0x519020(0x15b)](_0x519020(0x12a)+_0x162aee[_0x519020(0x1b7)]),console[_0x519020(0x15b)](_0x519020(0x18e)+_0x162aee[_0x519020(0xd2)]),console[_0x519020(0x15b)](_0x519020(0x139)+(_0x162aee[_0x519020(0x112)]||_0x519020(0x13c)))),{'journeyName':_0x162aee[_0x519020(0xd2)],'parentSegment':_0x162aee[_0x519020(0x1b7)],'resolved':_0x162aee};}catch(_0x1a89dc){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x519020(0x1c8)+_0x1a89dc[_0x519020(0x1b1)]);}if(!_0xa986c6)throw new SDKError(ErrorCode[_0x519020(0x102)],_0x519020(0x179));return{'journeyName':_0x57b076,'parentSegment':_0xa986c6};}export class JourneyListCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]=a22_0x9ba4d0(0x193);['description']=a22_0x9ba4d0(0x1a2);async[a22_0x9ba4d0(0x180)](_0x42eb41){const _0x1c2026=a22_0x9ba4d0,{options:_0x8b22df,args:_0x4ae475,tdx:_0x37ca12}=_0x42eb41,_0x52059b=_0x4ae475[0x0],_0x5890b7=_0x8b22df[_0x1c2026(0x1b7)];if(!_0x5890b7)return console[_0x1c2026(0x15b)](_0x1c2026(0x151)),console['error'](_0x1c2026(0x152)),0x1;const _0x364523=await withSpinner(_0x1c2026(0xee),()=>_0x37ca12[_0x1c2026(0x1bb)][_0x1c2026(0x1b6)](_0x5890b7),{'verbose':_0x8b22df['verbose']}),_0x1857d0=_0x364523[_0x1c2026(0xd7)];_0x8b22df[_0x1c2026(0x19d)]&&(console['error'](_0x1c2026(0x198)+_0x5890b7+'\x20(ID:\x20'+_0x1857d0+')'),_0x52059b&&console['error'](_0x1c2026(0x115)+_0x52059b));const _0x4a8f38=await withSpinner(_0x1c2026(0x148),()=>_0x37ca12['segment'][_0x1c2026(0x150)](_0x1857d0),{'verbose':_0x8b22df[_0x1c2026(0x19d)]}),_0x18cfc2=_0x4a8f38[_0x1c2026(0xd7)],_0x590389=_0x18cfc2[_0x1c2026(0x15f)],_0x32e34f=await withSpinner('Listing\x20journeys...',()=>_0x37ca12[_0x1c2026(0x172)][_0x1c2026(0x149)](_0x1857d0,_0x590389),{'verbose':_0x8b22df[_0x1c2026(0x19d)]});let _0x2ba9aa=_0x32e34f[_0x1c2026(0xd7)][_0x1c2026(0x11d)];const _0x292fe1=_0x32e34f[_0x1c2026(0xd7)][_0x1c2026(0x13d)],_0x5251e5=new Map();for(const _0x144b72 of _0x292fe1){_0x5251e5[_0x1c2026(0xcb)](_0x144b72['id'],_0x144b72[_0x1c2026(0xe0)]);}if(_0x52059b){const _0x49c5d5=globToRegex(_0x52059b);_0x2ba9aa=_0x2ba9aa[_0x1c2026(0x133)](_0x31c3e8=>_0x49c5d5['test'](_0x31c3e8[_0x1c2026(0x161)]));}console[_0x1c2026(0x15b)](_0x1c2026(0xfc)+_0x2ba9aa[_0x1c2026(0x175)]+_0x1c2026(0x1ba)+(_0x2ba9aa[_0x1c2026(0x175)]!==0x1?'s':''));const _0xc429ae=_0x2ceb7f=>{const _0x47fb83=_0x1c2026;return getConsoleNextUrl(_0x8b22df['site'],'/app/ps/'+_0x1857d0+_0x47fb83(0x157)+_0x2ceb7f+'/j/da');};if(_0x8b22df['format']===_0x1c2026(0xe3))await handleSDKOutput(_0x2ba9aa,_0x8b22df);else{if(_0x8b22df[_0x1c2026(0x1a9)]==='json'){const _0x2e5adc=_0x2ba9aa['map'](_0x27d6f5=>({..._0x27d6f5,'url':_0xc429ae(_0x27d6f5['id'])}));await handleSDKOutput(_0x2e5adc,_0x8b22df);}else{console[_0x1c2026(0xfa)]('['+_0x5890b7+']');const _0x1cdc7b=new Map(),_0x2f0b9e=[];for(const _0xdb48ab of _0x2ba9aa){if(!_0xdb48ab[_0x1c2026(0x14a)]||_0xdb48ab[_0x1c2026(0x14a)]===_0x590389)_0x2f0b9e['push'](_0xdb48ab);else{const _0x3b750b=_0x1cdc7b['get'](_0xdb48ab[_0x1c2026(0x14a)])||[];_0x3b750b['push'](_0xdb48ab),_0x1cdc7b[_0x1c2026(0xcb)](_0xdb48ab[_0x1c2026(0x14a)],_0x3b750b);}}const _0x253834=(_0x479268,_0x1d1112)=>_0x479268[_0x1c2026(0x161)][_0x1c2026(0xfd)](_0x1d1112[_0x1c2026(0x161)],undefined,{'sensitivity':'base'});_0x2f0b9e['sort'](_0x253834);for(const _0x2881d6 of _0x2f0b9e){console[_0x1c2026(0xfa)](formatJourneyItem(_0x2881d6,'',_0xc429ae(_0x2881d6['id'])));}const _0x1ce78b=[..._0x1cdc7b[_0x1c2026(0x1c5)]()][_0x1c2026(0xc5)]((_0xba490e,_0x55416c)=>{const _0x28942e=_0x1c2026,_0x471980=_0x5251e5[_0x28942e(0xd4)](_0xba490e[0x0])||_0xba490e[0x0],_0x1c9803=_0x5251e5['get'](_0x55416c[0x0])||_0x55416c[0x0];return _0x471980['localeCompare'](_0x1c9803,undefined,{'sensitivity':_0x28942e(0x1c4)});});for(const [_0x1e1fe4,_0x2d3ad4]of _0x1ce78b){const _0x1e2e5f=_0x5251e5['get'](_0x1e1fe4)||_0x1e1fe4;console[_0x1c2026(0xfa)](_0x1c2026(0x16c)+_0x1e2e5f),_0x2d3ad4[_0x1c2026(0xc5)](_0x253834);for(const _0x228673 of _0x2d3ad4){console[_0x1c2026(0xfa)](formatJourneyItem(_0x228673,'\x20\x20',_0xc429ae(_0x228673['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]='journey:view';[a22_0x9ba4d0(0x118)]=a22_0x9ba4d0(0xf4);async[a22_0x9ba4d0(0x180)](_0x43baef){const _0xe4ec01=a22_0x9ba4d0,{options:_0x1fcc30,args:_0x16857e,tdx:_0x200c62}=_0x43baef,_0x53bb0d=_0x16857e[0x0];if(!_0x53bb0d)return console[_0xe4ec01(0x15b)](_0xe4ec01(0xd3)),console[_0xe4ec01(0x15b)](_0xe4ec01(0x14f)),console[_0xe4ec01(0x15b)](_0xe4ec01(0xf7)),console[_0xe4ec01(0x15b)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x1fcc30[_0xe4ec01(0x19d)]&&console[_0xe4ec01(0x15b)](_0xe4ec01(0x162)+_0x53bb0d);const {journeyId:_0x4a5d82,parentSegmentId:_0x31cc71}=await resolveJourneyIdFromInput(_0x53bb0d,_0x1fcc30,_0x200c62);if(_0x1fcc30[_0xe4ec01(0x1b2)]){const _0x1b5203=getConsoleNextUrl(_0x1fcc30[_0xe4ec01(0x1b0)],'/app/ps/'+_0x31cc71+'/e/'+_0x4a5d82+_0xe4ec01(0x1b9));return console[_0xe4ec01(0x15b)](a22_0x4d1c63['green']('✔')+_0xe4ec01(0x138)+a22_0x4d1c63['cyan'](_0x1b5203)),openBrowser(_0x1b5203),0x0;}const _0x2c7b90=await withSpinner(_0xe4ec01(0x105),()=>_0x200c62[_0xe4ec01(0x172)]['getJourney'](_0x4a5d82),{'verbose':_0x1fcc30['verbose']}),_0x3db243=_0x2c7b90['data'],_0x50b406=_0x1fcc30[_0xe4ec01(0x16e)];let _0x4cc947;if(_0x50b406)try{const _0x27a36c=await withSpinner(_0xe4ec01(0x159),()=>_0x200c62[_0xe4ec01(0x172)][_0xe4ec01(0xc9)](_0x4a5d82),{'verbose':_0x1fcc30[_0xe4ec01(0x19d)]});_0x4cc947=_0x27a36c[_0xe4ec01(0xd7)];}catch{_0x1fcc30[_0xe4ec01(0x19d)]&&console[_0xe4ec01(0x15b)](_0xe4ec01(0x178));}const _0x4a976a=getConsoleNextUrl(_0x1fcc30[_0xe4ec01(0x1b0)],_0xe4ec01(0x10b)+_0x31cc71+_0xe4ec01(0x157)+_0x4a5d82+'/j/da/je'),_0x37f5f9={'id':_0x3db243['id'],'name':_0x3db243['attributes'][_0xe4ec01(0xe0)],'description':_0x3db243[_0xe4ec01(0x143)][_0xe4ec01(0x118)],'state':_0x3db243[_0xe4ec01(0x143)][_0xe4ec01(0xcf)],'paused':_0x3db243['attributes']['paused'],'reentry_mode':_0x3db243['attributes'][_0xe4ec01(0xf5)],'stages':_0x3db243[_0xe4ec01(0x143)]['journeyStages']?.[_0xe4ec01(0x175)]||0x0,..._0x3db243[_0xe4ec01(0x143)][_0xe4ec01(0x18c)]&&{'goal':_0x3db243[_0xe4ec01(0x143)][_0xe4ec01(0x18c)]['name']},..._0x4cc947&&{'statistics':{'size':_0x4cc947[_0xe4ec01(0x17f)],'entered':_0x4cc947[_0xe4ec01(0x11c)],'goal_achieved':_0x4cc947[_0xe4ec01(0x1b4)],'completion_rate':_0x4cc947[_0xe4ec01(0x100)],'exit_or_jump':_0x4cc947[_0xe4ec01(0x1b3)],'exit_or_jump_rate':_0x4cc947['exitOrJumpRate'],'stages':_0x4cc947[_0xe4ec01(0x10e)]}},'url':_0x4a976a};return await handleSingleObjectOutput(_0x37f5f9,_0x1fcc30),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]=a22_0x9ba4d0(0x147);[a22_0x9ba4d0(0x118)]=a22_0x9ba4d0(0x11e);async['execute'](_0x2d5d0b){const _0x4a1fd9=a22_0x9ba4d0,{options:_0x5881c5,args:_0x23a5d6,tdx:_0x26be78}=_0x2d5d0b,_0x1b37e4=_0x23a5d6[0x0];if(!requireNameOrPath(_0x1b37e4))return 0x1;_0x5881c5['verbose']&&console['error']('Input:\x20'+_0x1b37e4);const _0x2d21cf=_0x5881c5,_0x324681=_0x2d21cf[_0x4a1fd9(0xca)],_0x48b296=_0x2d21cf['to'],_0x18b9b1=_0x2d21cf['includeHistory'],_0xe41d6d=_0x2d21cf[_0x4a1fd9(0x18b)];_0x18b9b1&&!_0x324681&&!_0x48b296&&console[_0x4a1fd9(0x15b)](_0x4a1fd9(0xcd));const _0xd4b92c=_0x18b9b1?withJsonFormat(_0x5881c5):_0x5881c5,{journeyId:_0x542aac,journeyName:_0x486a3f}=await resolveJourneyIdFromInput(_0x1b37e4,_0xd4b92c,_0x26be78),_0x4709f3=_0x324681||_0x48b296?{'from':_0x324681,'to':_0x48b296}:undefined,_0x37e40c=await withSpinner(_0x4a1fd9(0x159),()=>Promise[_0x4a1fd9(0xc2)]([_0x26be78['journey'][_0x4a1fd9(0x11f)](_0x542aac),_0x26be78[_0x4a1fd9(0x172)]['getStatistics'](_0x542aac,_0x4709f3)]),{'verbose':_0xd4b92c[_0x4a1fd9(0x19d)]}),[_0x137f0c,_0x2772de]=_0x37e40c[_0x4a1fd9(0xd7)];if(!_0x2772de||_0x2772de['journeyId']===null)return console[_0x4a1fd9(0x15b)](_0x4a1fd9(0x10d)+_0x486a3f),console[_0x4a1fd9(0x15b)](_0x4a1fd9(0x160)),0x0;const _0x589af9=buildStageNameMap(_0x137f0c),_0x4b7e7d=!!(_0x4709f3&&_0x2772de[_0x4a1fd9(0x1bf)]?.['length']),_0x181ced={'stageNameMap':_0x589af9,'hasPeriod':_0x4b7e7d,'includeHistory':!!_0x18b9b1};if(_0xe41d6d&&_0x2772de[_0x4a1fd9(0x10e)]){const _0x4467b1=_0x2772de[_0x4a1fd9(0x10e)][_0x4a1fd9(0x140)](_0x1a0542=>{const _0xfa266a=_0x4a1fd9,_0x44ecce=_0x589af9[_0xfa266a(0xd4)](_0x1a0542['id'])??'';return _0x44ecce[_0xfa266a(0x106)]()===_0xe41d6d['toLowerCase']();});if(_0x4467b1)return await handleSingleObjectOutput(formatStageStats(_0x4467b1,_0x181ced),_0xd4b92c),0x0;const _0x1181fa=_0x2772de[_0x4a1fd9(0x10e)][_0x4a1fd9(0x1a4)](_0x4d2580=>_0x589af9[_0x4a1fd9(0xd4)](_0x4d2580['id'])??_0x4d2580['id']);return console[_0x4a1fd9(0x15b)](_0x4a1fd9(0x15c)+_0xe41d6d+_0x4a1fd9(0xde)),console[_0x4a1fd9(0x15b)](_0x4a1fd9(0x11b)+_0x1181fa[_0x4a1fd9(0x183)](',\x20')),0x1;}const _0x8ad64a=_0x2772de['stages']?.[_0x4a1fd9(0x1a4)](_0x1b61e9=>formatStageStats(_0x1b61e9,_0x181ced)),_0x530b04=assembleJourneyStats(_0x2772de,{'from':_0x324681,'to':_0x48b296,'includeHistory':_0x18b9b1});return await this[_0x4a1fd9(0x19c)](_0x530b04,_0x8ad64a??[],_0xd4b92c),0x0;}async[a22_0x9ba4d0(0x19c)](_0x440501,_0x58fb76,_0x26b018){const _0x43390b=a22_0x9ba4d0,_0x1c583e=_0x26b018['format']==='json'||_0x26b018[_0x43390b(0x1a9)]===_0x43390b(0x170)||_0x26b018[_0x43390b(0x174)]||_0x26b018[_0x43390b(0x170)];if(_0x1c583e){_0x440501[_0x43390b(0x10e)]=_0x58fb76,await handleSingleObjectOutput(_0x440501,_0x26b018);return;}await handleSingleObjectOutput(_0x440501,_0x26b018);for(const _0x13c3e1 of _0x58fb76){console[_0x43390b(0xfa)](''),console['log'](String(a22_0x4d1c63[_0x43390b(0x165)]['bold']('['+_0x13c3e1['name']+']'))+a22_0x4d1c63['dim']('\x20'+_0x13c3e1['id']));const {id:_0x24e108,name:_0x2eacbf,..._0x1736d0}=_0x13c3e1;await handleSingleObjectOutput(_0x1736d0,_0x26b018);}}}export class JourneyTrafficCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]=a22_0x9ba4d0(0x17d);[a22_0x9ba4d0(0x118)]=a22_0x9ba4d0(0x1c9);async[a22_0x9ba4d0(0x180)](_0x307d70){const _0x3c796e=a22_0x9ba4d0,{options:_0x1d0b75,args:_0xf16852,tdx:_0x491a06}=_0x307d70,_0x2d312f=_0xf16852[0x0];if(!requireNameOrPath(_0x2d312f))return 0x1;_0x1d0b75[_0x3c796e(0x19d)]&&console[_0x3c796e(0x15b)](_0x3c796e(0x162)+_0x2d312f);const _0xe392aa=_0x1d0b75,_0x128ece=_0xe392aa[_0x3c796e(0x141)],_0xd87992=_0xe392aa[_0x3c796e(0xca)],_0x20732f=_0xe392aa['to'],_0x29de9c=_0xe392aa[_0x3c796e(0x1bc)];if(_0x128ece&&_0x128ece!=='conversion'&&_0x128ece!==_0x3c796e(0x164))return console[_0x3c796e(0x15b)](_0x3c796e(0x155)+_0x128ece+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x29aecf=withJsonFormat(_0x1d0b75),{journeyId:_0x2fcd66,journeyName:_0x91e4fe}=await resolveJourneyIdFromInput(_0x2d312f,_0x29aecf,_0x491a06),_0x4cae0f={'type':_0x128ece,'from':_0xd87992,'to':_0x20732f,'limit':_0x29de9c},_0x50300c=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x491a06[_0x3c796e(0x172)][_0x3c796e(0x177)](_0x2fcd66,_0x4cae0f),{'verbose':_0x29aecf['verbose']}),_0xc0ee82=_0x50300c[_0x3c796e(0xd7)],_0xc9280c=_0xc0ee82[_0x3c796e(0xe1)]&&(_0xc0ee82[_0x3c796e(0xe1)][_0x3c796e(0x1b5)]['length']>0x0||_0xc0ee82[_0x3c796e(0xe1)]['links'][_0x3c796e(0x175)]>0x0),_0x390e4c=_0xc0ee82['activation']&&_0xc0ee82[_0x3c796e(0x164)][_0x3c796e(0x175)]>0x0;if(!_0xc9280c&&!_0x390e4c)return console[_0x3c796e(0x15b)](_0x3c796e(0x194)+_0x91e4fe),console[_0x3c796e(0x15b)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0xd87992&&_0x20732f&&console[_0x3c796e(0x15b)](_0x3c796e(0x15e)),0x0;return await handleSingleObjectOutput(_0xc0ee82,_0x29aecf),0x0;}}function formatStageStats(_0x400d74,_0x14db56){const _0x1dc341=a22_0x9ba4d0,_0x162d40=_0x14db56[_0x1dc341(0x1ad)]&&_0x400d74[_0x1dc341(0x1bf)]?.['length']?aggregateStageHistory(_0x400d74['history']):{'size':_0x400d74[_0x1dc341(0x17f)],'entered':_0x400d74[_0x1dc341(0x11c)],'milestone':_0x400d74['milestoneSize'],'milestone_rate':_0x400d74[_0x1dc341(0x127)],'exit_or_jump':_0x400d74[_0x1dc341(0x1b3)],'exit_or_jump_rate':_0x400d74[_0x1dc341(0x1d1)]},_0x599572={'id':_0x400d74['id'],'name':_0x14db56[_0x1dc341(0x169)]['get'](_0x400d74['id'])??_0x400d74['id'],..._0x162d40};return _0x14db56['hasPeriod']&&_0x14db56[_0x1dc341(0x110)]&&_0x400d74['history']&&(_0x599572[_0x1dc341(0x1bf)]=_0x400d74[_0x1dc341(0x1bf)]),_0x599572;}export class JourneyPauseCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]=a22_0x9ba4d0(0xe8);[a22_0x9ba4d0(0x118)]='Pause\x20a\x20running\x20journey';async[a22_0x9ba4d0(0x180)](_0x3225e5){const _0x141f4f=a22_0x9ba4d0,{options:_0x3c11c1,args:_0x2d5c5b,tdx:_0x3faca0}=_0x3225e5,_0x4fdaa0=_0x2d5c5b[0x0];if(!requireNameOrPath(_0x4fdaa0))return 0x1;_0x3c11c1[_0x141f4f(0x19d)]&&console[_0x141f4f(0x15b)](_0x141f4f(0x162)+_0x4fdaa0);const {journeyId:_0x285df1,journeyName:_0xb3dd4e}=await resolveJourneyIdFromInput(_0x4fdaa0,_0x3c11c1,_0x3faca0);if(!_0x3c11c1[_0x141f4f(0xe4)]){const _0x2413e2=await confirm(_0x141f4f(0x14e)+_0xb3dd4e+'\x22?');if(!_0x2413e2)return console[_0x141f4f(0x15b)]('Cancelled'),0x0;}const _0x315488=await withSpinner('Pausing\x20journey...',()=>_0x3faca0[_0x141f4f(0x172)][_0x141f4f(0x1c3)](_0x285df1),{'verbose':_0x3c11c1[_0x141f4f(0x19d)]}),_0x59b380=_0x315488[_0x141f4f(0xd7)];return console['error'](_0x141f4f(0x14d)+_0x59b380[_0x141f4f(0x143)][_0x141f4f(0xe0)]+_0x141f4f(0x134)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]=a22_0x9ba4d0(0x1cb);[a22_0x9ba4d0(0x118)]=a22_0x9ba4d0(0x199);async[a22_0x9ba4d0(0x180)](_0x410693){const _0x2c75dc=a22_0x9ba4d0,{options:_0x5e3dcb,args:_0x38eb24,tdx:_0x453dd4}=_0x410693,_0x6d82e8=_0x38eb24[0x0];if(!requireNameOrPath(_0x6d82e8))return 0x1;_0x5e3dcb['verbose']&&console[_0x2c75dc(0x15b)]('Input:\x20'+_0x6d82e8);const {journeyId:_0x20e140,journeyName:_0x360992}=await resolveJourneyIdFromInput(_0x6d82e8,_0x5e3dcb,_0x453dd4);if(!_0x5e3dcb[_0x2c75dc(0xe4)]){const _0x31daaf=await confirm(_0x2c75dc(0xed)+_0x360992+'\x22?');if(!_0x31daaf)return console['error'](_0x2c75dc(0xe2)),0x0;}const _0x36b795=await withSpinner('Resuming\x20journey...',()=>_0x453dd4[_0x2c75dc(0x172)]['resume'](_0x20e140),{'verbose':_0x5e3dcb['verbose']}),_0x2c5681=_0x36b795[_0x2c75dc(0xd7)];return console['error'](_0x2c75dc(0x14d)+_0x2c5681['attributes'][_0x2c75dc(0xe0)]+_0x2c75dc(0x124)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]=a22_0x9ba4d0(0x1cf);['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async[a22_0x9ba4d0(0x180)](_0x5269b0){const _0x107913=a22_0x9ba4d0,{options:_0x1d1fbe,args:_0x1b2366,tdx:_0x4404ea}=_0x5269b0,_0x1be407=_0x1d1fbe,_0x16c4c2=_0x1b2366[0x0],_0x2dca09=_0x16c4c2&&isYamlFilePath(_0x16c4c2),_0x2fa945=await resolveTarget({'arg':_0x2dca09?_0x16c4c2:undefined,'contextParent':_0x1d1fbe[_0x107913(0x1b7)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2fa945))return _0x2fa945[_0x107913(0x128)]===_0x107913(0x120)?(console[_0x107913(0x15b)](a22_0x4d1c63[_0x107913(0xdc)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x107913(0x15b)](_0x107913(0x166)),console[_0x107913(0x15b)](_0x107913(0x15a)),console[_0x107913(0x15b)](_0x107913(0xd8)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x107913(0x15b)](a22_0x4d1c63[_0x107913(0xe9)](_0x107913(0xf1)+_0x2fa945[_0x107913(0x1b1)]+'\x0a')),_0x2fa945[_0x107913(0xc8)]&&console['error'](a22_0x4d1c63[_0x107913(0x165)](_0x2fa945[_0x107913(0xc8)]))),0x1;let _0x378197=_0x2dca09?undefined:_0x16c4c2,_0x5d5c15,_0x368248;_0x2fa945[_0x107913(0x141)]===_0x107913(0x12c)&&(_0x378197=_0x2fa945[_0x107913(0x1c1)],_0x5d5c15=_0x2fa945[_0x107913(0x1b8)],_0x368248=_0x2fa945[_0x107913(0x112)]);const _0x3e8adb=_0x2fa945[_0x107913(0x13b)],_0x3a4fd3=_0x2fa945[_0x107913(0x1a5)];_0x1be407[_0x107913(0x19d)]&&(console['error'](_0x107913(0x198)+_0x3e8adb),console[_0x107913(0x15b)](_0x107913(0x137)+_0x3a4fd3),_0x378197&&console[_0x107913(0x15b)]('Journey\x20name:\x20'+_0x378197),_0x5d5c15&&console[_0x107913(0x15b)](_0x107913(0x1a8)+_0x5d5c15),_0x368248&&console[_0x107913(0x15b)](_0x107913(0x15d)+_0x368248));const _0x3f144c=await withSpinner(_0x107913(0xee),()=>_0x4404ea['segment'][_0x107913(0x1b6)](_0x3e8adb),{'verbose':_0x1d1fbe[_0x107913(0x19d)]}),_0x111812=_0x3f144c[_0x107913(0xd7)],{journeys:_0x5c5c72,folders:_0x4e25a2}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0xecd14a=_0x107913,[_0x484896,_0x389e23]=await Promise[_0xecd14a(0xc2)]([_0x4404ea['journey'][_0xecd14a(0x196)](_0x111812,undefined,{'includeAllVersions':!![]}),_0x4404ea[_0xecd14a(0x1bb)][_0xecd14a(0xce)](_0x111812)]);return{'journeys':_0x484896,'folders':_0x389e23};},{'verbose':_0x1d1fbe['verbose']})[_0x107913(0x17c)](_0x4a5276=>_0x4a5276[_0x107913(0xd7)]);let _0x684862=_0x5c5c72;const _0x47d455=buildFolderIdToPathMap(_0x4e25a2);if(_0x378197){const _0x5274bd=_0x684862['filter'](_0x1c214f=>_0x1c214f[_0x107913(0x161)][_0x107913(0x106)]()===_0x378197[_0x107913(0x106)]());if(_0x5274bd[_0x107913(0x175)]===0x0)return console[_0x107913(0x15b)](_0x107913(0x123)+_0x378197),console[_0x107913(0x15b)](_0x107913(0x13e)),0x1;_0x684862=_0x5274bd;}if(_0x368248!==undefined){const _0x215ad6=_0x684862[_0x107913(0x133)](_0xfae33f=>{const _0xaed4a6=_0x107913,_0xece2d9=_0xfae33f['folderId']?_0x47d455[_0xaed4a6(0xd4)](_0xfae33f[_0xaed4a6(0x14a)])||'':'';return _0xece2d9===_0x368248;});if(_0x215ad6[_0x107913(0x175)]===0x0&&_0x684862[_0x107913(0x175)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x378197+_0x107913(0xd9)+(_0x368248||'root\x20folder')),console[_0x107913(0x15b)](_0x107913(0x10f));for(const _0x53d356 of _0x684862){const _0x8a1338=_0x53d356[_0x107913(0x14a)]?_0x47d455[_0x107913(0xd4)](_0x53d356['folderId'])||'':'';console[_0x107913(0x15b)](_0x107913(0xf0)+(_0x8a1338||_0x107913(0x13c))+'/'+_0x53d356['journeyBundleName']);}return 0x1;}_0x684862=_0x215ad6;}if(_0x684862[_0x107913(0x175)]===0x0)return console['error'](_0x107913(0x1a6)),0x0;const _0xf0438e=new Map();for(const _0x3705f6 of _0x684862){const _0x13fcda=_0x3705f6[_0x107913(0x1d0)];!_0xf0438e[_0x107913(0x103)](_0x13fcda)&&_0xf0438e[_0x107913(0xcb)](_0x13fcda,[]),_0xf0438e['get'](_0x13fcda)['push'](_0x3705f6);}for(const _0x583b0a of _0xf0438e[_0x107913(0x17e)]()){_0x583b0a[_0x107913(0xc5)]((_0x112602,_0x196192)=>(_0x112602[_0x107913(0xda)]||0x0)-(_0x196192['versionNumber']||0x0));}const _0x50b2c1=[],{idToEmailMap:_0x501ebf,connectionIdToNameMap:_0x5c03a9}=await withSpinner(_0x107913(0x10a),async()=>{const _0x10789b=_0x107913,[_0x50c0c9,_0x2dc866]=await Promise[_0x10789b(0xc2)]([_0x4404ea[_0x10789b(0x181)][_0x10789b(0xfe)](),_0x4404ea[_0x10789b(0xe6)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x50c0c9,'connectionIdToNameMap':_0x2dc866};},{'verbose':_0x1d1fbe[_0x107913(0x19d)]})[_0x107913(0x17c)](_0x48357f=>_0x48357f[_0x107913(0xd7)]);for(const _0x2ace4a of _0xf0438e['values']()){const _0x57b09e=_0x2ace4a[0x0][_0x107913(0x161)],_0x4ab967=_0x2ace4a[0x0][_0x107913(0x14a)],_0x10dc70=_0x4ab967?_0x47d455[_0x107913(0xd4)](_0x4ab967)||'':'',_0x59fe2e=_0x10dc70?a22_0x4530a1[_0x107913(0x183)](_0x3a4fd3,_0x10dc70):_0x3a4fd3,_0x3edeec=_0x5d5c15||a22_0x4530a1['join'](_0x59fe2e,sanitizeFileName(_0x57b09e)+_0x107913(0x154));let _0x51eff5,_0x215366;if(existsSync(_0x3edeec))try{const _0x43cd01=readFileSync(_0x3edeec,_0x107913(0x185)),_0x2a0145=parseYamlString(_0x43cd01);_0x215366=_0x2a0145,_0x51eff5=buildRuleToNameMapping(_0x2a0145),_0x1be407[_0x107913(0x19d)]&&_0x51eff5[_0x107913(0x17f)]>0x0&&console['error'](_0x107913(0xcc)+_0x51eff5[_0x107913(0x17f)]+_0x107913(0xd5)+_0x57b09e);}catch(_0x284ab0){_0x1be407[_0x107913(0x19d)]&&console[_0x107913(0x15b)](_0x107913(0x119)+_0x284ab0[_0x107913(0x1b1)]);}const _0xbb107b=[],_0x537539=new Set(),_0x3b5299=new Map(),_0x5c1104=new Map(),_0x374d7b=new Set(),_0x327979=new Map(),_0x39aba9=new Map(),_0x2b3eb9=createJumpTargetCache();await withProgressSpinner(_0x107913(0x131)+_0x57b09e+_0x107913(0x1a3),async _0x43b47f=>{const _0xd9eb1b=_0x107913;for(const _0x4a35f6 of _0x2ace4a){const _0x41c342=_0x2ace4a['length']>0x1?_0x4a35f6[_0xd9eb1b(0x161)]+'\x20v'+(_0x4a35f6[_0xd9eb1b(0xda)]||0x1):_0x4a35f6[_0xd9eb1b(0x161)];_0x43b47f['setPhase']('Fetching\x20'+_0x41c342);const _0x36b6a5=await _0x4404ea[_0xd9eb1b(0x172)][_0xd9eb1b(0x11f)](_0x4a35f6['id']),_0x40f6c6=_0x36b6a5['attributes']?.['audienceId'],_0x4c8358={'resolveSegment':async _0x271a2e=>{const _0x2a0815=_0xd9eb1b;if(!_0x40f6c6)return{'name':_0x271a2e,'isJourneyLocal':![]};const _0x3f6667=_0x3b5299['get'](_0x271a2e);if(_0x3f6667)return _0x3f6667;try{const _0xeaa315=await _0x4404ea[_0x2a0815(0x1bb)]['getSegment'](_0x40f6c6,_0x271a2e),_0x5efd0a=_0xeaa315[_0x2a0815(0xfb)]===SEGMENT_KIND_JOURNEY;let _0x11b034,_0x29134b=_0xeaa315[_0x2a0815(0xe0)];if(_0x5efd0a&&_0xeaa315[_0x2a0815(0xec)]){const _0xf7c075=await segmentResponseToDef(_0xeaa315,{'resolveSegmentName':async _0x28ad45=>{const _0x32c241=_0x2a0815,_0x5905ed=_0x3b5299['get'](_0x28ad45);if(_0x5905ed)return _0x5905ed[_0x32c241(0xe0)];const _0x18af30=await _0x4c8358[_0x32c241(0x1cd)](_0x28ad45);return _0x18af30[_0x32c241(0xe0)];}}),_0x5413fa=_0xf7c075['rule'];_0x11b034={'description':_0xeaa315[_0x2a0815(0x118)],'rule':_0x5413fa};const _0x52edc0=serializeRule(_0x5413fa),_0x5d5d1a=_0x5c1104[_0x2a0815(0xd4)](_0x52edc0);if(_0x5d5d1a)_0x29134b=_0x5d5d1a,_0x11b034=undefined,_0x1be407['verbose']&&console[_0x2a0815(0x15b)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0xeaa315[_0x2a0815(0xe0)]+_0x2a0815(0x167)+_0x5d5d1a);else{let _0x410f49=![];if(_0x51eff5){const _0x3f9dd8=_0x51eff5[_0x2a0815(0xd4)](_0x52edc0);if(_0x3f9dd8){const _0x1cce7b=_0x3f9dd8['find'](_0x238b19=>!_0x537539['has'](_0x238b19));_0x1cce7b&&(_0x29134b=_0x1cce7b,_0x537539['add'](_0x1cce7b),_0x5c1104[_0x2a0815(0xcb)](_0x52edc0,_0x1cce7b),_0x410f49=!![],_0x1be407[_0x2a0815(0x19d)]&&console[_0x2a0815(0x15b)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x1cce7b+_0x2a0815(0xe7)));}}if(!_0x410f49){const _0x76b9d0=generateJourneyLocalName(_0xeaa315[_0x2a0815(0xe0)]);_0x76b9d0&&(_0x29134b=_0x76b9d0);let _0x1553ad=_0x29134b,_0x33f90c=0x2;while(_0x537539[_0x2a0815(0x103)](_0x1553ad)){_0x1553ad=_0x29134b+'_'+_0x33f90c,_0x33f90c++;}_0x537539[_0x2a0815(0x113)](_0x1553ad),_0x5c1104['set'](_0x52edc0,_0x1553ad),_0x29134b=_0x1553ad;}}}const _0x4cc39d={'name':_0x29134b,'isJourneyLocal':_0x5efd0a,'definition':_0x11b034};return _0x3b5299[_0x2a0815(0xcb)](_0x271a2e,_0x4cc39d),_0x4cc39d;}catch(_0x3b19d1){return _0x1d1fbe[_0x2a0815(0x19d)]&&console[_0x2a0815(0x15b)](_0x2a0815(0x1c0)+_0x271a2e+':\x20'+_0x3b19d1[_0x2a0815(0x1b1)]),{'name':_0x271a2e,'isJourneyLocal':![]};}},'resolveActivation':async _0xbb2da3=>{const _0x114698=_0xd9eb1b,_0x3872a3=_0x327979[_0x114698(0xd4)](_0xbb2da3);if(_0x3872a3)return _0x3872a3;try{const _0x2e372e=await _0x4404ea[_0x114698(0x172)]['getActivation'](_0x4a35f6['id'],_0xbb2da3),_0x1df800=journeyActivationStepToYaml(_0x2e372e,_0x501ebf,_0x5c03a9),_0x47114a=JSON['stringify']({'name':_0x1df800[_0x114698(0xe0)],'connection':_0x1df800[_0x114698(0xe6)],'connector_config':_0x1df800[_0x114698(0x184)]}),_0x4b2ae8=_0x39aba9[_0x114698(0xd4)](_0x47114a);if(_0x4b2ae8){const _0x49c4e5={'name':_0x4b2ae8,'isJourneyLocal':!![],'definition':_0x1df800};return _0x327979[_0x114698(0xcb)](_0xbb2da3,_0x49c4e5),_0x49c4e5;}const _0x308ad3=_0x2e372e['attributes'][_0x114698(0x114)][_0x114698(0xe0)]||_0xbb2da3,_0x11cfc1=sanitizeYamlKey(_0x308ad3)||_0x114698(0x126)+_0xbb2da3;let _0x1a258b=_0x11cfc1,_0xfd6ded=0x2;while(_0x374d7b['has'](_0x1a258b)){_0x1a258b=_0x11cfc1+'_'+_0xfd6ded,_0xfd6ded++;}_0x374d7b[_0x114698(0x113)](_0x1a258b),_0x39aba9[_0x114698(0xcb)](_0x47114a,_0x1a258b);const _0x39ae83={'name':_0x1a258b,'isJourneyLocal':!![],'definition':_0x1df800};return _0x327979[_0x114698(0xcb)](_0xbb2da3,_0x39ae83),_0x39ae83;}catch(_0x521a5d){return _0x1d1fbe[_0x114698(0x19d)]&&console[_0x114698(0x15b)](_0x114698(0xc4)+_0xbb2da3+':\x20'+_0x521a5d[_0x114698(0x1b1)]),{'name':_0xbb2da3,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x4b1667,_0x54d481)=>{const _0x3788ed=_0xd9eb1b;return resolveJumpTarget(_0x4b1667,_0x54d481,_0x2b3eb9,_0x218265=>_0x4404ea[_0x3788ed(0x172)][_0x3788ed(0x11f)](_0x218265));}},_0x2933f2=await journeyResponseToDef(_0x36b6a5,_0x4c8358);_0xbb107b[_0xd9eb1b(0x19a)]({'item':_0x4a35f6,'yaml':_0x2933f2});}},{'verbose':_0x1d1fbe[_0x107913(0x19d)]});const _0x1065fb=buildMergedJourneyDef(_0xbb107b,_0x51eff5),_0xfe172d=normalizeJourneyDef(_0x1065fb,_0x215366),_0x2b39b7=toYamlString(_0xfe172d),_0x4f30d1=_0x5d5c15||a22_0x4530a1[_0x107913(0x183)](_0x59fe2e,sanitizeFileName(_0x57b09e)+'.yml');!_0x5d5c15&&_0x10dc70&&!existsSync(_0x59fe2e)&&mkdirSync(_0x59fe2e,{'recursive':!![]});const _0x503cf8=a22_0x4530a1[_0x107913(0x1a1)](process['cwd'](),_0x4f30d1);if(existsSync(_0x4f30d1)){const _0x1a903c=readFileSync(_0x4f30d1,_0x107913(0x185)),_0x1ea152=generateDiff(_0x1a903c,_0x2b39b7),_0x1a7751=hasChanges(_0x1ea152);_0x50b2c1[_0x107913(0x19a)]({'relativePath':_0x503cf8,'absolutePath':_0x4f30d1,'content':_0x2b39b7,'isNew':![],'hasChanges':_0x1a7751,'diff':_0x1a7751?formatDiffWithColors(_0x1ea152):undefined});}else _0x50b2c1[_0x107913(0x19a)]({'relativePath':_0x503cf8,'absolutePath':_0x4f30d1,'content':_0x2b39b7,'isNew':!![],'hasChanges':![]});}const _0x1669a6=_0x50b2c1['filter'](_0xeecc2b=>_0xeecc2b[_0x107913(0x168)]),_0x2dbec6=_0x50b2c1['filter'](_0x124570=>!_0x124570[_0x107913(0x168)]&&_0x124570[_0x107913(0x158)]),_0x18d985=_0x50b2c1[_0x107913(0x133)](_0x5c88e2=>!_0x5c88e2['isNew']&&!_0x5c88e2[_0x107913(0x158)]),_0xab0415=_0x684862['length'],_0x520d04=_0xf0438e[_0x107913(0x17f)],_0x1443f7=_0xab0415>_0x520d04?'\x20('+_0xab0415+_0x107913(0xd1):'';console[_0x107913(0x15b)](_0x107913(0x16d)),console['error']('\x20\x20'+a22_0x4d1c63[_0x107913(0x165)](_0x520d04+_0x107913(0x1af))+a22_0x4d1c63[_0x107913(0x173)](_0x1443f7)),console['error']('\x20\x20'+a22_0x4d1c63[_0x107913(0x188)]('+\x20'+_0x1669a6['length']+_0x107913(0x10c))),console[_0x107913(0x15b)]('\x20\x20'+a22_0x4d1c63['yellow']('~\x20'+_0x2dbec6[_0x107913(0x175)]+_0x107913(0x19e))),console[_0x107913(0x15b)]('\x20\x20'+a22_0x4d1c63['dim']('=\x20'+_0x18d985[_0x107913(0x175)]+_0x107913(0xf6))),console[_0x107913(0x15b)](_0x107913(0x1ab)+a22_0x4d1c63[_0x107913(0x165)](_0x3a4fd3)+'\x0a');if(_0x2dbec6['length']>0x0)for(const _0x4e86f2 of _0x2dbec6){console[_0x107913(0x15b)](_0x107913(0x1ac)+_0x4e86f2['relativePath']+'\x27:'),console[_0x107913(0x15b)]('─'[_0x107913(0xd6)](0x3c)),console[_0x107913(0x15b)](_0x4e86f2[_0x107913(0x16a)]),console[_0x107913(0x15b)]('─'['repeat'](0x3c));}if(_0x1be407[_0x107913(0x153)])return console[_0x107913(0x15b)](a22_0x4d1c63[_0x107913(0xdc)](_0x107913(0xdb))),0x0;if(_0x1669a6['length']===0x0&&_0x2dbec6[_0x107913(0x175)]===0x0)return console['error'](a22_0x4d1c63['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x3e8adb},_0x1be407[_0x107913(0x163)]),console[_0x107913(0x15b)](a22_0x4d1c63[_0x107913(0x188)](_0x107913(0x18a)+a22_0x4d1c63[_0x107913(0x173)]('parent_segment')+_0x107913(0x146)+a22_0x4d1c63['cyan'](_0x3e8adb))),0x0;if(!_0x1be407[_0x107913(0xe4)]&&(_0x1669a6[_0x107913(0x175)]>0x0||_0x2dbec6['length']>0x0)){if(!isInteractive())return console[_0x107913(0x15b)](a22_0x4d1c63[_0x107913(0xe9)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a22_0x4d1c63[_0x107913(0x173)](_0x107913(0x125))),0x1;const _0x17a6c3=await confirmKey(_0x107913(0x195)+(_0x1669a6['length']+_0x2dbec6[_0x107913(0x175)])+_0x107913(0x13a));if(!_0x17a6c3)return console[_0x107913(0x15b)](a22_0x4d1c63[_0x107913(0xdc)](_0x107913(0x122)),_0x107913(0xea)),0x1;}!existsSync(_0x3a4fd3)&&mkdirSync(_0x3a4fd3,{'recursive':!![]});const _0x500095=a22_0x4530a1['join'](_0x3a4fd3,_0x107913(0x142));writeFileSync(_0x500095,createTdxConfigContent(_0x3e8adb),_0x107913(0x185));for(const _0x249261 of _0x50b2c1){(_0x249261['isNew']||_0x249261['hasChanges'])&&writeFileSync(_0x249261[_0x107913(0x1a0)],_0x249261[_0x107913(0x18d)],_0x107913(0x185));}return console[_0x107913(0x15b)](a22_0x4d1c63[_0x107913(0x188)]('✔\x20Pulled\x20'+(_0x1669a6[_0x107913(0x175)]+_0x2dbec6[_0x107913(0x175)])+_0x107913(0x192)+_0x3a4fd3)),saveSessionContext({'parent_segment':_0x3e8adb},_0x1be407['session']),console[_0x107913(0x15b)](a22_0x4d1c63[_0x107913(0x188)]('✔\x20Context\x20set:\x20'+a22_0x4d1c63[_0x107913(0x173)](_0x107913(0xf8))+'\x20=\x20'+a22_0x4d1c63[_0x107913(0x165)](_0x3e8adb))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]=a22_0x9ba4d0(0x186);[a22_0x9ba4d0(0x118)]=a22_0x9ba4d0(0x1c7);async['execute'](_0x2a1c7b){const _0x356fdb=a22_0x9ba4d0,{options:_0x32b0d7,args:_0x215ed7,tdx:_0x3c4bc2}=_0x2a1c7b,_0xfa242e=_0x215ed7[0x0];if(!requireNameOrPath(_0xfa242e))return 0x1;_0x32b0d7['verbose']&&console['error'](_0x356fdb(0x162)+_0xfa242e);const {journeyId:_0x4cb9ff}=await resolveJourneyIdFromInput(_0xfa242e,_0x32b0d7,_0x3c4bc2),_0x14e90b=await withSpinner(_0x356fdb(0x14c),()=>_0x3c4bc2[_0x356fdb(0x172)][_0x356fdb(0x19b)](_0x4cb9ff),{'verbose':_0x32b0d7['verbose']}),_0x356284=_0x14e90b[_0x356fdb(0xd7)];return console['log']('Database:\x20'+_0x356284['database']),console[_0x356fdb(0xfa)](_0x356fdb(0x121)+_0x356284[_0x356fdb(0xe3)]),await handleSDKOutput(_0x356284['columns'],_0x32b0d7),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a22_0x9ba4d0(0x19f);[a22_0x9ba4d0(0x118)]=a22_0x9ba4d0(0x182);async[a22_0x9ba4d0(0x180)](_0x19c1d8){const _0x5c2c1d=a22_0x9ba4d0,{options:_0x22a056,args:_0x114623,tdx:_0x38056a}=_0x19c1d8,_0x482d0b=_0x114623[0x0];if(!requireNameOrPath(_0x482d0b))return 0x1;_0x22a056[_0x5c2c1d(0x19d)]&&console[_0x5c2c1d(0x15b)](_0x5c2c1d(0x162)+_0x482d0b);const {journeyId:_0x37b024}=await resolveJourneyIdFromInput(_0x482d0b,_0x22a056,_0x38056a),_0x1c5a2b=await withSpinner(_0x5c2c1d(0x197),()=>_0x38056a[_0x5c2c1d(0x172)][_0x5c2c1d(0xc3)](_0x37b024),{'verbose':_0x22a056['verbose']}),_0x1cf1d0=_0x1c5a2b['data'];return console[_0x5c2c1d(0x15b)](_0x5c2c1d(0xcc)+_0x1cf1d0['length']+_0x5c2c1d(0x12d)+(_0x1cf1d0[_0x5c2c1d(0x175)]!==0x1?'s':'')),await handleSDKOutput(_0x1cf1d0,_0x22a056),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a22_0x9ba4d0(0x1ca);[a22_0x9ba4d0(0x118)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a22_0x9ba4d0(0xe5)]=new SegmentPushCommand();async['execute'](_0x5721a3){const _0x32e0cb=a22_0x9ba4d0,_0x79ab70=_0x5721a3[_0x32e0cb(0x12e)][0x0];let _0x357d9d;if(_0x79ab70){const _0x1b08a2=await resolveTarget({'arg':_0x79ab70,'contextParent':_0x5721a3['options'][_0x32e0cb(0x1b7)],'cwd':process[_0x32e0cb(0x12f)]()});isSuccessfulResolution(_0x1b08a2)&&_0x1b08a2[_0x32e0cb(0x141)]===_0x32e0cb(0x12c)&&(_0x357d9d=_0x1b08a2[_0x32e0cb(0x1b8)]);}const _0x94f7db={..._0x5721a3,'options':{..._0x5721a3['options'],'journeysOnly':!![],..._0x357d9d&&{'singleFilePath':_0x357d9d}}};return this[_0x32e0cb(0xe5)]['execute'](_0x94f7db);}}export class JourneyVersionsCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]=a22_0x9ba4d0(0x16f);['description']=a22_0x9ba4d0(0xdf);async[a22_0x9ba4d0(0x180)](_0x249fe2){const _0x34ce1b=a22_0x9ba4d0,{options:_0x21fb90,args:_0x4526b0,tdx:_0x278a7e}=_0x249fe2,_0x21fa04=_0x4526b0[0x0];if(!requireNameOrPath(_0x21fa04))return 0x1;if(_0x21fb90[_0x34ce1b(0x19d)])console[_0x34ce1b(0x15b)](_0x34ce1b(0x162)+_0x21fa04);const {journeyId:_0x1ef7d7}=await resolveJourneyIdFromInput(_0x21fa04,_0x21fb90,_0x278a7e),_0x274195=await withSpinner('Listing\x20journey\x20versions...',()=>_0x278a7e[_0x34ce1b(0x172)][_0x34ce1b(0xef)](_0x1ef7d7),{'verbose':_0x21fb90[_0x34ce1b(0x19d)]}),{bundleName:_0x2e2710,versions:_0x54c2cb,latestJourneyId:_0x17a628}=_0x274195[_0x34ce1b(0xd7)];console[_0x34ce1b(0x15b)](_0x2e2710+':\x20'+_0x54c2cb[_0x34ce1b(0x175)]+_0x34ce1b(0x14b)+(_0x54c2cb['length']!==0x1?'s':''));const _0x18a28c=_0x54c2cb[_0x34ce1b(0x1a4)](_0x2dc9a9=>({'version':_0x2dc9a9['versionNumber'],'journey_id':_0x2dc9a9[_0x34ce1b(0x136)],'name':_0x2dc9a9[_0x34ce1b(0xe0)],'state':_0x2dc9a9['state'],'paused':_0x2dc9a9[_0x34ce1b(0x11a)],'latest':_0x2dc9a9['journeyId']===_0x17a628,'created_at':_0x2dc9a9[_0x34ce1b(0x17b)]}));return await handleSDKOutput(_0x18a28c,_0x21fb90),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]=a22_0x9ba4d0(0xeb);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a22_0x9ba4d0(0x180)](_0x53b280){const _0xe3fd37=a22_0x9ba4d0,{options:_0x20eb22,args:_0x308184,tdx:_0x25fdaa}=_0x53b280,_0x419cf7=_0x308184[0x0];if(!requireNameOrPath(_0x419cf7))return 0x1;if(_0x20eb22[_0xe3fd37(0x19d)])console['error'](_0xe3fd37(0x162)+_0x419cf7);const {journeyId:_0x35d93f,journeyName:_0x3a52d6}=await resolveJourneyIdFromInput(_0x419cf7,_0x20eb22,_0x25fdaa);if(!_0x20eb22['yes']){const _0x2fd1ca=await confirm(_0xe3fd37(0xf3)+_0x3a52d6+'\x22?');if(!_0x2fd1ca)return console[_0xe3fd37(0x15b)](_0xe3fd37(0xe2)),0x0;}const _0x28852a=await withSpinner(_0xe3fd37(0x190),()=>_0x25fdaa['journey'][_0xe3fd37(0xdd)](_0x35d93f),{'verbose':_0x20eb22[_0xe3fd37(0x19d)]}),_0x3cc6da=_0x28852a[_0xe3fd37(0xd7)];return console[_0xe3fd37(0x15b)](a22_0x4d1c63['green']('✔')+_0xe3fd37(0x101)+_0x3cc6da[_0xe3fd37(0x143)][_0xe3fd37(0xda)]+_0xe3fd37(0x1cc)+_0x3cc6da[_0xe3fd37(0x143)]['name']+'\x22'),console['error'](_0xe3fd37(0xc7)+_0x3cc6da['id']),await handleSingleObjectOutput({'id':_0x3cc6da['id'],'name':_0x3cc6da[_0xe3fd37(0x143)][_0xe3fd37(0xe0)],'version':_0x3cc6da[_0xe3fd37(0x143)][_0xe3fd37(0xda)],'state':_0x3cc6da[_0xe3fd37(0x143)][_0xe3fd37(0xcf)],'bundle_id':_0x3cc6da[_0xe3fd37(0x143)][_0xe3fd37(0x1d0)],'created_at':_0x3cc6da[_0xe3fd37(0x143)][_0xe3fd37(0x17b)]},_0x20eb22),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a22_0x9ba4d0(0xe0)]=a22_0x9ba4d0(0x191);[a22_0x9ba4d0(0x118)]=a22_0x9ba4d0(0x1ae);async[a22_0x9ba4d0(0x180)](_0x249801){const _0x276559=a22_0x9ba4d0,{options:_0x3c9cde,args:_0x150f44,tdx:_0x1748e0}=_0x249801,_0x1ffc59=_0x150f44[0x0];if(!requireNameOrPath(_0x1ffc59))return 0x1;const _0x4ed2b=_0x3c9cde[_0x276559(0x145)];if(!_0x4ed2b)return console[_0x276559(0x15b)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x276559(0x15b)](_0x276559(0x129)),0x1;const _0x251f43=parseInt(_0x4ed2b,0xa);if(isNaN(_0x251f43)||_0x251f43<0x1)return console[_0x276559(0x15b)](_0x276559(0xf9)+_0x4ed2b),0x1;if(_0x3c9cde[_0x276559(0x19d)])console[_0x276559(0x15b)](_0x276559(0x162)+_0x1ffc59+_0x276559(0x132)+_0x251f43);const {journeyId:_0x4f43b2,parentSegmentId:_0x3b19fe}=await resolveJourneyIdFromInput(_0x1ffc59,_0x3c9cde,_0x1748e0),_0x536c41=await withSpinner(_0x276559(0x189),()=>_0x1748e0[_0x276559(0x172)]['listVersions'](_0x4f43b2),{'verbose':_0x3c9cde['verbose']}),{versions:_0xa99021,latestJourneyId:_0x257c0b}=_0x536c41[_0x276559(0xd7)],_0x150a33=_0xa99021[_0x276559(0x140)](_0x2c2dd2=>_0x2c2dd2['versionNumber']===_0x251f43);if(!_0x150a33){const _0x1e6c5d=_0xa99021['map'](_0x1637f8=>'v'+_0x1637f8[_0x276559(0xda)])[_0x276559(0x183)](',\x20');return console[_0x276559(0x15b)](_0x276559(0xc6)+_0x251f43+'\x20not\x20found.\x20Available:\x20'+_0x1e6c5d),0x1;}const _0x154838=await withSpinner('Getting\x20version\x20'+_0x251f43+_0x276559(0x135),()=>_0x1748e0[_0x276559(0x172)][_0x276559(0x11f)](_0x150a33[_0x276559(0x136)]),{'verbose':_0x3c9cde[_0x276559(0x19d)]}),_0x5a4d14=_0x154838[_0x276559(0xd7)],_0x14dba3=getConsoleNextUrl(_0x3c9cde[_0x276559(0x1b0)],_0x276559(0x10b)+_0x3b19fe+_0x276559(0x157)+_0x150a33['journeyId']+_0x276559(0x1b9));return await handleSingleObjectOutput({'id':_0x5a4d14['id'],'name':_0x5a4d14[_0x276559(0x143)][_0x276559(0xe0)],'version':_0x5a4d14[_0x276559(0x143)][_0x276559(0xda)],'description':_0x5a4d14['attributes'][_0x276559(0x118)],'state':_0x5a4d14[_0x276559(0x143)][_0x276559(0xcf)],'paused':_0x5a4d14[_0x276559(0x143)][_0x276559(0x11a)],'reentry_mode':_0x5a4d14[_0x276559(0x143)][_0x276559(0xf5)],'stages':_0x5a4d14[_0x276559(0x143)][_0x276559(0x107)]?.[_0x276559(0x175)]||0x0,..._0x5a4d14[_0x276559(0x143)][_0x276559(0x18c)]&&{'goal':_0x5a4d14[_0x276559(0x143)][_0x276559(0x18c)][_0x276559(0xe0)]},'latest':_0x150a33[_0x276559(0x136)]===_0x257c0b,'created_at':_0x5a4d14[_0x276559(0x143)]['createdAt'],'updated_at':_0x5a4d14[_0x276559(0x143)][_0x276559(0x130)],'url':_0x14dba3},_0x3c9cde),0x0;}}
1
+ const a22_0x4786ae=a22_0x8975;(function(_0x8b81d6,_0x3a9a64){const _0x2e9183=a22_0x8975,_0xc7e9eb=_0x8b81d6();while(!![]){try{const _0x3516dc=parseInt(_0x2e9183(0xff))/0x1*(parseInt(_0x2e9183(0x11f))/0x2)+parseInt(_0x2e9183(0x11b))/0x3+parseInt(_0x2e9183(0xa6))/0x4+parseInt(_0x2e9183(0xb5))/0x5+-parseInt(_0x2e9183(0x185))/0x6*(-parseInt(_0x2e9183(0x122))/0x7)+-parseInt(_0x2e9183(0x167))/0x8+-parseInt(_0x2e9183(0xbf))/0x9*(parseInt(_0x2e9183(0xfd))/0xa);if(_0x3516dc===_0x3a9a64)break;else _0xc7e9eb['push'](_0xc7e9eb['shift']());}catch(_0x270044){_0xc7e9eb['push'](_0xc7e9eb['shift']());}}}(a22_0x2c33,0x903ca));import a22_0x20b6d8 from'chalk';import a22_0x3e42a2 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';function a22_0x8975(_0x4959e2,_0x3a29b4){_0x4959e2=_0x4959e2-0x9a;const _0x2c3354=a22_0x2c33();let _0x897586=_0x2c3354[_0x4959e2];return _0x897586;}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(_0x3b2b02){const _0x1b7a9b=a22_0x8975;return!_0x3b2b02&&(console['error'](_0x1b7a9b(0xd2)),console[_0x1b7a9b(0xc5)](_0x1b7a9b(0x152))),!!_0x3b2b02;}function withJsonFormat(_0x202f6c){const _0x4ca7c2=a22_0x8975;if(!_0x202f6c['format']&&!_0x202f6c['json']&&!_0x202f6c[_0x4ca7c2(0x10e)]&&!_0x202f6c[_0x4ca7c2(0x140)])return{..._0x202f6c,'format':_0x4ca7c2(0x118),'json':!![]};return _0x202f6c;}function formatJourneyState(_0x1a7c31){const _0xd8e759=a22_0x8975;switch(_0x1a7c31){case _0xd8e759(0xe7):return a22_0x20b6d8['green'](_0xd8e759(0x188));case'draft':return a22_0x20b6d8[_0xd8e759(0xbe)](_0xd8e759(0x171));case _0xd8e759(0x153):return a22_0x20b6d8[_0xd8e759(0xe6)](_0xd8e759(0xe5));case _0xd8e759(0xd6):return a22_0x20b6d8['blue'](_0xd8e759(0xa5));case _0xd8e759(0x110):return a22_0x20b6d8[_0xd8e759(0xbe)](_0xd8e759(0x135));default:return'('+_0x1a7c31+')';}}function formatJourneyItem(_0x8ddc3,_0x5a52a2='',_0x3d49dc){const _0x4b75a7=a22_0x8975,_0x5ce7ed=formatJourneyState(_0x8ddc3[_0x4b75a7(0x149)]),_0x2c81d7=_0x3d49dc?hyperlink(_0x8ddc3[_0x4b75a7(0x1a3)],_0x3d49dc):_0x8ddc3[_0x4b75a7(0x1a3)];return _0x5a52a2+_0x4b75a7(0x15a)+_0x2c81d7+'\x20'+_0x5ce7ed;}function escapeRegex(_0x411290){const _0x2a9587=a22_0x8975;return _0x411290[_0x2a9587(0x17f)](/[.*+?^${}()|[\]\\]/g,_0x2a9587(0x189));}function globToRegex(_0x475d1e){const _0x4f7166=a22_0x8975,_0x15ea0b=_0x475d1e['split']('*')[_0x4f7166(0xe4)](escapeRegex);return new RegExp(_0x15ea0b[_0x4f7166(0x125)]('.*'),'i');}function buildRuleToNameMapping(_0x851ad5){const _0x4dd2b6=a22_0x8975,_0x25ac61=new Map();if(_0x851ad5[_0x4dd2b6(0x17c)])for(const [_0xa87a5e,_0x503527]of Object[_0x4dd2b6(0xbd)](_0x851ad5[_0x4dd2b6(0x17c)])){if(_0x503527[_0x4dd2b6(0x10c)]){const _0x25d0fe=serializeRule(_0x503527['rule']),_0x2fb339=_0x25ac61[_0x4dd2b6(0x126)](_0x25d0fe);_0x2fb339?_0x2fb339[_0x4dd2b6(0x151)](_0xa87a5e):_0x25ac61[_0x4dd2b6(0x130)](_0x25d0fe,[_0xa87a5e]);}}return _0x25ac61;}async function resolveJourneyIdFromInput(_0x2a63d4,_0x5395ee,_0x438615){const _0xc7bb0e=a22_0x8975,_0xfbe6f3=await resolveJourneyTarget(_0x2a63d4,_0x5395ee[_0xc7bb0e(0x144)],_0x5395ee['verbose']),_0x2cb864=_0xfbe6f3['parentSegment'];if(!_0x2cb864)throw new SDKError(ErrorCode[_0xc7bb0e(0xc9)],_0xc7bb0e(0xcc));const _0x489be7=await withSpinner(_0xc7bb0e(0xcf),()=>_0x438615['segment']['resolveParentId'](_0x2cb864),{'verbose':_0x5395ee[_0xc7bb0e(0x18f)]}),_0x206c73=_0x489be7['data'],_0x2675c3=await withSpinner(_0xc7bb0e(0xe9),()=>_0x438615[_0xc7bb0e(0x155)][_0xc7bb0e(0x14c)](_0x206c73,_0xfbe6f3[_0xc7bb0e(0xb4)]),{'verbose':_0x5395ee[_0xc7bb0e(0x18f)]});return{'journeyId':_0x2675c3[_0xc7bb0e(0xc6)],'journeyName':_0xfbe6f3[_0xc7bb0e(0xb4)],'parentSegmentId':_0x206c73};}async function resolveJourneyTarget(_0x42bdaf,_0x3dd11f,_0x5a6bdf){const _0x3978f3=a22_0x8975;if(isYamlFilePath(_0x42bdaf))try{const _0x395a10=await resolveYamlFilePath(_0x42bdaf);return _0x5a6bdf&&(console[_0x3978f3(0xc5)]('Resolved\x20YAML\x20file:\x20'+_0x42bdaf),console[_0x3978f3(0xc5)](_0x3978f3(0x169)+_0x395a10[_0x3978f3(0x144)]),console[_0x3978f3(0xc5)](_0x3978f3(0xb7)+_0x395a10['segmentName']),console[_0x3978f3(0xc5)]('\x20\x20Folder\x20path:\x20'+(_0x395a10[_0x3978f3(0xa8)]||_0x3978f3(0x18e)))),{'journeyName':_0x395a10['segmentName'],'parentSegment':_0x395a10['parentSegment'],'resolved':_0x395a10};}catch(_0x20655c){throw new SDKError(ErrorCode[_0x3978f3(0xc9)],_0x3978f3(0x1a0)+_0x20655c['message']);}if(!_0x3dd11f)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3978f3(0x15c));return{'journeyName':_0x42bdaf,'parentSegment':_0x3dd11f};}export class JourneyListCommand extends BaseCommand{['name']=a22_0x4786ae(0xbb);[a22_0x4786ae(0x160)]=a22_0x4786ae(0x12c);async[a22_0x4786ae(0xde)](_0x1152bc){const _0x36c250=a22_0x4786ae,{options:_0x3b55d3,args:_0x361cd8,tdx:_0x4b5444}=_0x1152bc,_0x37602a=_0x361cd8[0x0],_0x2a4c8e=_0x3b55d3[_0x36c250(0x144)];if(!_0x2a4c8e)return console[_0x36c250(0xc5)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x36c250(0xc5)](_0x36c250(0x16e)),0x1;const _0x5680ec=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x4b5444[_0x36c250(0x19a)]['resolveParentId'](_0x2a4c8e),{'verbose':_0x3b55d3['verbose']}),_0x26a68b=_0x5680ec[_0x36c250(0xc6)];_0x3b55d3[_0x36c250(0x18f)]&&(console['error'](_0x36c250(0x134)+_0x2a4c8e+_0x36c250(0xf7)+_0x26a68b+')'),_0x37602a&&console[_0x36c250(0xc5)](_0x36c250(0xda)+_0x37602a));const _0x28a11b=await withSpinner(_0x36c250(0x10d),()=>_0x4b5444[_0x36c250(0x19a)]['getParentFull'](_0x26a68b),{'verbose':_0x3b55d3[_0x36c250(0x18f)]}),_0x3d8578=_0x28a11b['data'],_0x25e836=_0x3d8578[_0x36c250(0x19d)],_0x45dc8b=await withSpinner('Listing\x20journeys...',()=>_0x4b5444[_0x36c250(0x155)]['listJourneysWithFolders'](_0x26a68b,_0x25e836),{'verbose':_0x3b55d3['verbose']});let _0x408304=_0x45dc8b[_0x36c250(0xc6)][_0x36c250(0x109)];const _0x3137bc=_0x45dc8b[_0x36c250(0xc6)][_0x36c250(0x181)],_0xbe9b1a=new Map();for(const _0x274014 of _0x3137bc){_0xbe9b1a['set'](_0x274014['id'],_0x274014[_0x36c250(0xba)]);}if(_0x37602a){const _0x1af4c4=globToRegex(_0x37602a);_0x408304=_0x408304['filter'](_0x3ec29d=>_0x1af4c4['test'](_0x3ec29d['journeyBundleName']));}console['error'](_0x36c250(0xd1)+_0x408304['length']+_0x36c250(0x120)+(_0x408304[_0x36c250(0x199)]!==0x1?'s':''));const _0x5a5258=_0x4172c7=>{const _0x45b61d=_0x36c250;return getConsoleNextUrl(_0x3b55d3[_0x45b61d(0xfa)],'/app/ps/'+_0x26a68b+_0x45b61d(0xea)+_0x4172c7+'/j/da');};if(_0x3b55d3[_0x36c250(0xef)]==='table')await handleSDKOutput(_0x408304,_0x3b55d3);else{if(_0x3b55d3[_0x36c250(0xef)]===_0x36c250(0x118)){const _0x437dc5=_0x408304[_0x36c250(0xe4)](_0x3c71a4=>({..._0x3c71a4,'url':_0x5a5258(_0x3c71a4['id'])}));await handleSDKOutput(_0x437dc5,_0x3b55d3);}else{console[_0x36c250(0x179)]('['+_0x2a4c8e+']');const _0x574650=new Map(),_0x2f2b38=[];for(const _0x5793d4 of _0x408304){if(!_0x5793d4[_0x36c250(0x19f)]||_0x5793d4[_0x36c250(0x19f)]===_0x25e836)_0x2f2b38[_0x36c250(0x151)](_0x5793d4);else{const _0x32ae72=_0x574650[_0x36c250(0x126)](_0x5793d4[_0x36c250(0x19f)])||[];_0x32ae72[_0x36c250(0x151)](_0x5793d4),_0x574650[_0x36c250(0x130)](_0x5793d4[_0x36c250(0x19f)],_0x32ae72);}}const _0x6160b1=(_0x24fdbd,_0x467a90)=>_0x24fdbd['journeyBundleName'][_0x36c250(0xb0)](_0x467a90['journeyBundleName'],undefined,{'sensitivity':'base'});_0x2f2b38[_0x36c250(0x108)](_0x6160b1);for(const _0x4618bb of _0x2f2b38){console[_0x36c250(0x179)](formatJourneyItem(_0x4618bb,'',_0x5a5258(_0x4618bb['id'])));}const _0x4e6d9d=[..._0x574650[_0x36c250(0xbd)]()][_0x36c250(0x108)]((_0x5dc89a,_0x457891)=>{const _0x41d0b6=_0x36c250,_0x4f57e0=_0xbe9b1a['get'](_0x5dc89a[0x0])||_0x5dc89a[0x0],_0x3263e6=_0xbe9b1a[_0x41d0b6(0x126)](_0x457891[0x0])||_0x457891[0x0];return _0x4f57e0['localeCompare'](_0x3263e6,undefined,{'sensitivity':_0x41d0b6(0x13c)});});for(const [_0x1f69b7,_0x766f85]of _0x4e6d9d){const _0x5d31a1=_0xbe9b1a[_0x36c250(0x126)](_0x1f69b7)||_0x1f69b7;console[_0x36c250(0x179)](_0x36c250(0x9c)+_0x5d31a1),_0x766f85['sort'](_0x6160b1);for(const _0x4eaf49 of _0x766f85){console[_0x36c250(0x179)](formatJourneyItem(_0x4eaf49,'\x20\x20',_0x5a5258(_0x4eaf49['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a22_0x4786ae(0x116);[a22_0x4786ae(0x160)]=a22_0x4786ae(0xb1);async['execute'](_0x1ace3d){const _0x227dee=a22_0x4786ae,{options:_0x563879,args:_0x12e4ba,tdx:_0x526fe9}=_0x1ace3d,_0x666258=_0x12e4ba[0x0];if(!_0x666258)return console[_0x227dee(0xc5)](_0x227dee(0xd2)),console[_0x227dee(0xc5)](_0x227dee(0x106)),console[_0x227dee(0xc5)]('Options:'),console[_0x227dee(0xc5)](_0x227dee(0x137)),0x1;_0x563879[_0x227dee(0x18f)]&&console['error'](_0x227dee(0x18d)+_0x666258);const {journeyId:_0x3d2db0,parentSegmentId:_0x5ae199}=await resolveJourneyIdFromInput(_0x666258,_0x563879,_0x526fe9);if(_0x563879[_0x227dee(0xcd)]){const _0x5e4e01=getConsoleNextUrl(_0x563879[_0x227dee(0xfa)],_0x227dee(0x175)+_0x5ae199+_0x227dee(0xea)+_0x3d2db0+_0x227dee(0x113));return console[_0x227dee(0xc5)](a22_0x20b6d8[_0x227dee(0xf8)]('✔')+_0x227dee(0x17b)+a22_0x20b6d8[_0x227dee(0xed)](_0x5e4e01)),openBrowser(_0x5e4e01),0x0;}const _0x1c426a=await withSpinner(_0x227dee(0x159),()=>_0x526fe9['journey'][_0x227dee(0x14e)](_0x3d2db0),{'verbose':_0x563879[_0x227dee(0x18f)]}),_0x52674a=_0x1c426a['data'],_0xc6d694=_0x563879[_0x227dee(0x197)];let _0x1ac0a0;if(_0xc6d694)try{const _0x1a8f65=await withSpinner(_0x227dee(0xcb),()=>_0x526fe9[_0x227dee(0x155)][_0x227dee(0x17a)](_0x3d2db0),{'verbose':_0x563879[_0x227dee(0x18f)]});_0x1ac0a0=_0x1a8f65[_0x227dee(0xc6)];}catch{_0x563879[_0x227dee(0x18f)]&&console['error'](_0x227dee(0x136));}const _0x54ea28=getConsoleNextUrl(_0x563879['site'],_0x227dee(0x175)+_0x5ae199+'/e/'+_0x3d2db0+'/j/da/je'),_0x312a30={'id':_0x52674a['id'],'name':_0x52674a[_0x227dee(0xfb)]['name'],'description':_0x52674a[_0x227dee(0xfb)][_0x227dee(0x160)],'state':_0x52674a[_0x227dee(0xfb)]['state'],'paused':_0x52674a[_0x227dee(0xfb)]['paused'],'reentry_mode':_0x52674a[_0x227dee(0xfb)][_0x227dee(0x10b)],'stages':_0x52674a[_0x227dee(0xfb)]['journeyStages']?.[_0x227dee(0x199)]||0x0,..._0x52674a[_0x227dee(0xfb)][_0x227dee(0x13e)]&&{'goal':_0x52674a[_0x227dee(0xfb)][_0x227dee(0x13e)][_0x227dee(0xba)]},..._0x1ac0a0&&{'statistics':{'size':_0x1ac0a0[_0x227dee(0x17d)],'entered':_0x1ac0a0[_0x227dee(0x187)],'goal_achieved':_0x1ac0a0[_0x227dee(0x191)],'completion_rate':_0x1ac0a0[_0x227dee(0xc3)],'exit_or_jump':_0x1ac0a0['exitOrJumpSize'],'exit_or_jump_rate':_0x1ac0a0[_0x227dee(0xd8)],'stages':_0x1ac0a0['stages']}},'url':_0x54ea28};return await handleSingleObjectOutput(_0x312a30,_0x563879),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xd0);[a22_0x4786ae(0x160)]=a22_0x4786ae(0x15b);async['execute'](_0x1c165d){const _0x1127d0=a22_0x4786ae,{options:_0x4eeb4a,args:_0x33066e,tdx:_0x4e0757}=_0x1c165d,_0xb8e7a6=_0x33066e[0x0];if(!requireNameOrPath(_0xb8e7a6))return 0x1;_0x4eeb4a[_0x1127d0(0x18f)]&&console['error'](_0x1127d0(0x18d)+_0xb8e7a6);const _0x15694c=_0x4eeb4a,_0x1c5206=_0x15694c['from'],_0x3b0716=_0x15694c['to'],_0x5da8ab=_0x15694c[_0x1127d0(0x19e)],_0x571aa3=_0x15694c['stage'];_0x5da8ab&&!_0x1c5206&&!_0x3b0716&&console[_0x1127d0(0xc5)](_0x1127d0(0x102));const _0x5a1f7a=_0x5da8ab?withJsonFormat(_0x4eeb4a):_0x4eeb4a,{journeyId:_0x3196a1,journeyName:_0x386f38}=await resolveJourneyIdFromInput(_0xb8e7a6,_0x5a1f7a,_0x4e0757),_0x5b9c49=_0x1c5206||_0x3b0716?{'from':_0x1c5206,'to':_0x3b0716}:undefined,_0x11c7a6=await withSpinner(_0x1127d0(0xcb),()=>Promise['all']([_0x4e0757['journey'][_0x1127d0(0x14e)](_0x3196a1),_0x4e0757['journey'][_0x1127d0(0x17a)](_0x3196a1,_0x5b9c49)]),{'verbose':_0x5a1f7a[_0x1127d0(0x18f)]}),[_0xafaaec,_0x48853c]=_0x11c7a6[_0x1127d0(0xc6)];if(!_0x48853c||_0x48853c[_0x1127d0(0xeb)]===null)return console[_0x1127d0(0xc5)](_0x1127d0(0x18c)+_0x386f38),console[_0x1127d0(0xc5)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x3b3718=buildStageNameMap(_0xafaaec),_0xf8bf1c=!!(_0x5b9c49&&_0x48853c[_0x1127d0(0x190)]?.[_0x1127d0(0x199)]),_0x5b8186={'stageNameMap':_0x3b3718,'hasPeriod':_0xf8bf1c,'includeHistory':!!_0x5da8ab};if(_0x571aa3&&_0x48853c[_0x1127d0(0x194)]){const _0x153534=_0x48853c[_0x1127d0(0x194)][_0x1127d0(0xdd)](_0x3d2664=>{const _0x3e2a87=_0x1127d0,_0x27cd62=_0x3b3718[_0x3e2a87(0x126)](_0x3d2664['id'])??'';return _0x27cd62[_0x3e2a87(0xa7)]()===_0x571aa3[_0x3e2a87(0xa7)]();});if(_0x153534)return await handleSingleObjectOutput(formatStageStats(_0x153534,_0x5b8186),_0x5a1f7a),0x0;const _0xb22c17=_0x48853c[_0x1127d0(0x194)][_0x1127d0(0xe4)](_0x42944e=>_0x3b3718[_0x1127d0(0x126)](_0x42944e['id'])??_0x42944e['id']);return console[_0x1127d0(0xc5)]('Error:\x20Stage\x20\x22'+_0x571aa3+_0x1127d0(0xc1)),console[_0x1127d0(0xc5)](_0x1127d0(0xf5)+_0xb22c17['join'](',\x20')),0x1;}const _0x1e2041=_0x48853c[_0x1127d0(0x194)]?.[_0x1127d0(0xe4)](_0x4415ea=>formatStageStats(_0x4415ea,_0x5b8186)),_0x5e4098=assembleJourneyStats(_0x48853c,{'from':_0x1c5206,'to':_0x3b0716,'includeHistory':_0x5da8ab});return await this[_0x1127d0(0xd7)](_0x5e4098,_0x1e2041??[],_0x5a1f7a),0x0;}async[a22_0x4786ae(0xd7)](_0x1399d6,_0x3c6eb6,_0x5acd1b){const _0x366b6a=a22_0x4786ae,_0x3f7af2=_0x5acd1b[_0x366b6a(0xef)]===_0x366b6a(0x118)||_0x5acd1b[_0x366b6a(0xef)]===_0x366b6a(0x10e)||_0x5acd1b['json']||_0x5acd1b[_0x366b6a(0x10e)];if(_0x3f7af2){_0x1399d6[_0x366b6a(0x194)]=_0x3c6eb6,await handleSingleObjectOutput(_0x1399d6,_0x5acd1b);return;}await handleSingleObjectOutput(_0x1399d6,_0x5acd1b);for(const _0x4de83f of _0x3c6eb6){console[_0x366b6a(0x179)](''),console['log'](String(a22_0x20b6d8[_0x366b6a(0xed)][_0x366b6a(0x121)]('['+_0x4de83f[_0x366b6a(0xba)]+']'))+a22_0x20b6d8[_0x366b6a(0xbe)]('\x20'+_0x4de83f['id']));const {id:_0x4150ca,name:_0x7d0c26,..._0x3e7d45}=_0x4de83f;await handleSingleObjectOutput(_0x3e7d45,_0x5acd1b);}}}export class JourneyTrafficCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xe3);['description']=a22_0x4786ae(0x178);async[a22_0x4786ae(0xde)](_0x594187){const _0x30bd12=a22_0x4786ae,{options:_0x5c4c2c,args:_0xcde669,tdx:_0x5cfcc0}=_0x594187,_0x49316d=_0xcde669[0x0];if(!requireNameOrPath(_0x49316d))return 0x1;_0x5c4c2c['verbose']&&console[_0x30bd12(0xc5)]('Input:\x20'+_0x49316d);const _0xbbcac0=_0x5c4c2c,_0x36ee74=_0xbbcac0[_0x30bd12(0xd9)],_0x5e3e07=_0xbbcac0[_0x30bd12(0x170)],_0x4b9465=_0xbbcac0['to'],_0x2d22bd=_0xbbcac0[_0x30bd12(0x119)];if(_0x36ee74&&_0x36ee74!==_0x30bd12(0x19b)&&_0x36ee74!=='activation')return console[_0x30bd12(0xc5)]('Error:\x20Invalid\x20--type\x20\x22'+_0x36ee74+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x5c10d5=withJsonFormat(_0x5c4c2c),{journeyId:_0x2d4785,journeyName:_0x2ea279}=await resolveJourneyIdFromInput(_0x49316d,_0x5c10d5,_0x5cfcc0),_0x295ea0={'type':_0x36ee74,'from':_0x5e3e07,'to':_0x4b9465,'limit':_0x2d22bd},_0x1d0e6c=await withSpinner(_0x30bd12(0xb3),()=>_0x5cfcc0[_0x30bd12(0x155)]['getTrafficData'](_0x2d4785,_0x295ea0),{'verbose':_0x5c10d5[_0x30bd12(0x18f)]}),_0x26a1ed=_0x1d0e6c[_0x30bd12(0xc6)],_0xdf58a5=_0x26a1ed[_0x30bd12(0x19b)]&&(_0x26a1ed[_0x30bd12(0x19b)][_0x30bd12(0x1a4)][_0x30bd12(0x199)]>0x0||_0x26a1ed[_0x30bd12(0x19b)]['links'][_0x30bd12(0x199)]>0x0),_0x1a4588=_0x26a1ed[_0x30bd12(0xe8)]&&_0x26a1ed['activation'][_0x30bd12(0x199)]>0x0;if(!_0xdf58a5&&!_0x1a4588)return console['error'](_0x30bd12(0x164)+_0x2ea279),console[_0x30bd12(0xc5)](_0x30bd12(0x1a1)),_0x5e3e07&&_0x4b9465&&console[_0x30bd12(0xc5)](_0x30bd12(0xec)),0x0;return await handleSingleObjectOutput(_0x26a1ed,_0x5c10d5),0x0;}}function formatStageStats(_0x2bc4b2,_0x4ac5d8){const _0x5c3cc4=a22_0x4786ae,_0x3fde78=_0x4ac5d8[_0x5c3cc4(0x146)]&&_0x2bc4b2[_0x5c3cc4(0x190)]?.[_0x5c3cc4(0x199)]?aggregateStageHistory(_0x2bc4b2['history']):{'size':_0x2bc4b2['size'],'entered':_0x2bc4b2[_0x5c3cc4(0x187)],'milestone':_0x2bc4b2[_0x5c3cc4(0xd3)],'milestone_rate':_0x2bc4b2[_0x5c3cc4(0x141)],'exit_or_jump':_0x2bc4b2['exitOrJumpSize'],'exit_or_jump_rate':_0x2bc4b2[_0x5c3cc4(0xd8)]},_0x3b60fc={'id':_0x2bc4b2['id'],'name':_0x4ac5d8[_0x5c3cc4(0x16c)]['get'](_0x2bc4b2['id'])??_0x2bc4b2['id'],..._0x3fde78};return _0x4ac5d8[_0x5c3cc4(0x146)]&&_0x4ac5d8[_0x5c3cc4(0x19e)]&&_0x2bc4b2['history']&&(_0x3b60fc[_0x5c3cc4(0x190)]=_0x2bc4b2[_0x5c3cc4(0x190)]),_0x3b60fc;}export class JourneyPauseCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xa2);[a22_0x4786ae(0x160)]='Pause\x20a\x20running\x20journey';async[a22_0x4786ae(0xde)](_0x4e0834){const _0x3c4f5b=a22_0x4786ae,{options:_0x42df77,args:_0x562544,tdx:_0x58b51c}=_0x4e0834,_0x8bc6e=_0x562544[0x0];if(!requireNameOrPath(_0x8bc6e))return 0x1;_0x42df77[_0x3c4f5b(0x18f)]&&console[_0x3c4f5b(0xc5)](_0x3c4f5b(0x18d)+_0x8bc6e);const {journeyId:_0x52be9f,journeyName:_0x204ca9}=await resolveJourneyIdFromInput(_0x8bc6e,_0x42df77,_0x58b51c);if(!_0x42df77[_0x3c4f5b(0x15f)]){const _0xf8f570=await confirm(_0x3c4f5b(0x158)+_0x204ca9+'\x22?');if(!_0xf8f570)return console[_0x3c4f5b(0xc5)](_0x3c4f5b(0x1a7)),0x0;}const _0x1a64ce=await withSpinner(_0x3c4f5b(0x14b),()=>_0x58b51c[_0x3c4f5b(0x155)][_0x3c4f5b(0xf2)](_0x52be9f),{'verbose':_0x42df77['verbose']}),_0x120408=_0x1a64ce[_0x3c4f5b(0xc6)];return console[_0x3c4f5b(0xc5)](_0x3c4f5b(0x16d)+_0x120408['attributes']['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xfe);['description']='Resume\x20a\x20paused\x20journey';async['execute'](_0x2726c4){const _0x49c8e7=a22_0x4786ae,{options:_0xfd4d18,args:_0x297739,tdx:_0x4b7015}=_0x2726c4,_0x8eb5f5=_0x297739[0x0];if(!requireNameOrPath(_0x8eb5f5))return 0x1;_0xfd4d18[_0x49c8e7(0x18f)]&&console[_0x49c8e7(0xc5)](_0x49c8e7(0x18d)+_0x8eb5f5);const {journeyId:_0x5a4e4a,journeyName:_0x5836d3}=await resolveJourneyIdFromInput(_0x8eb5f5,_0xfd4d18,_0x4b7015);if(!_0xfd4d18[_0x49c8e7(0x15f)]){const _0x27c36c=await confirm(_0x49c8e7(0x147)+_0x5836d3+'\x22?');if(!_0x27c36c)return console['error'](_0x49c8e7(0x1a7)),0x0;}const _0x2d1c9e=await withSpinner(_0x49c8e7(0xd4),()=>_0x4b7015[_0x49c8e7(0x155)][_0x49c8e7(0x145)](_0x5a4e4a),{'verbose':_0xfd4d18['verbose']}),_0x1bb2aa=_0x2d1c9e[_0x49c8e7(0xc6)];return console[_0x49c8e7(0xc5)](_0x49c8e7(0x16d)+_0x1bb2aa[_0x49c8e7(0xfb)][_0x49c8e7(0xba)]+_0x49c8e7(0x142)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xdb);[a22_0x4786ae(0x160)]=a22_0x4786ae(0x107);async[a22_0x4786ae(0xde)](_0x4a25fa){const _0x1389e1=a22_0x4786ae,{options:_0x5da746,args:_0x5e1468,tdx:_0xaadfd}=_0x4a25fa,_0x3c8a43=_0x5da746,_0x524387=_0x5e1468[0x0],_0x3cdfe5=_0x524387&&isYamlFilePath(_0x524387),_0xebae26=await resolveTarget({'arg':_0x3cdfe5?_0x524387:undefined,'contextParent':_0x5da746[_0x1389e1(0x144)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xebae26))return _0xebae26[_0x1389e1(0x11a)]===_0x1389e1(0x174)?(console['error'](a22_0x20b6d8['yellow'](_0x1389e1(0x186))),console[_0x1389e1(0xc5)](_0x1389e1(0xad)),console[_0x1389e1(0xc5)](_0x1389e1(0x10f)),console[_0x1389e1(0xc5)](_0x1389e1(0x192)),console[_0x1389e1(0xc5)](_0x1389e1(0x105))):(console['error'](a22_0x20b6d8[_0x1389e1(0x14f)](_0x1389e1(0x16f)+_0xebae26[_0x1389e1(0x16b)]+'\x0a')),_0xebae26[_0x1389e1(0x13f)]&&console['error'](a22_0x20b6d8[_0x1389e1(0xed)](_0xebae26[_0x1389e1(0x13f)]))),0x1;let _0x406dd5=_0x3cdfe5?undefined:_0x524387,_0x15f6e6,_0x4a485e;_0xebae26['type']===_0x1389e1(0xb9)&&(_0x406dd5=_0xebae26['resourceName'],_0x15f6e6=_0xebae26[_0x1389e1(0x172)],_0x4a485e=_0xebae26[_0x1389e1(0xa8)]);const _0x51ac70=_0xebae26[_0x1389e1(0xdf)],_0xb172e2=_0xebae26[_0x1389e1(0x123)];_0x3c8a43[_0x1389e1(0x18f)]&&(console['error'](_0x1389e1(0x134)+_0x51ac70),console[_0x1389e1(0xc5)](_0x1389e1(0x13b)+_0xb172e2),_0x406dd5&&console[_0x1389e1(0xc5)](_0x1389e1(0x133)+_0x406dd5),_0x15f6e6&&console[_0x1389e1(0xc5)]('Target\x20file:\x20'+_0x15f6e6),_0x4a485e&&console[_0x1389e1(0xc5)](_0x1389e1(0xae)+_0x4a485e));const _0x4818e7=await withSpinner(_0x1389e1(0xcf),()=>_0xaadfd[_0x1389e1(0x19a)][_0x1389e1(0x124)](_0x51ac70),{'verbose':_0x5da746[_0x1389e1(0x18f)]}),_0x554f2a=_0x4818e7['data'],{journeys:_0x4db046,folders:_0x388b09}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x1cf84a=_0x1389e1,[_0x101131,_0x492077]=await Promise[_0x1cf84a(0xce)]([_0xaadfd['journey'][_0x1cf84a(0x1a6)](_0x554f2a,undefined,{'includeAllVersions':!![]}),_0xaadfd['segment'][_0x1cf84a(0x19c)](_0x554f2a)]);return{'journeys':_0x101131,'folders':_0x492077};},{'verbose':_0x5da746[_0x1389e1(0x18f)]})[_0x1389e1(0x16a)](_0xd82ebc=>_0xd82ebc[_0x1389e1(0xc6)]);let _0x20c4a7=_0x4db046;const _0xfcd9a7=buildFolderIdToPathMap(_0x388b09);if(_0x406dd5){const _0x6d8224=_0x20c4a7['filter'](_0x37d93e=>_0x37d93e[_0x1389e1(0x1a3)]['toLowerCase']()===_0x406dd5[_0x1389e1(0xa7)]());if(_0x6d8224[_0x1389e1(0x199)]===0x0)return console[_0x1389e1(0xc5)]('Error:\x20Journey\x20not\x20found:\x20'+_0x406dd5),console[_0x1389e1(0xc5)](_0x1389e1(0x196)),0x1;_0x20c4a7=_0x6d8224;}if(_0x4a485e!==undefined){const _0x3ef025=_0x20c4a7[_0x1389e1(0x127)](_0x150f5a=>{const _0x23a2aa=_0x1389e1,_0x29c5ad=_0x150f5a[_0x23a2aa(0x19f)]?_0xfcd9a7['get'](_0x150f5a['folderId'])||'':'';return _0x29c5ad===_0x4a485e;});if(_0x3ef025[_0x1389e1(0x199)]===0x0&&_0x20c4a7[_0x1389e1(0x199)]>0x0){console[_0x1389e1(0xc5)](_0x1389e1(0x132)+_0x406dd5+_0x1389e1(0xdc)+(_0x4a485e||'root\x20folder')),console['error'](_0x1389e1(0xb6));for(const _0x48d8e3 of _0x20c4a7){const _0x289fbe=_0x48d8e3[_0x1389e1(0x19f)]?_0xfcd9a7[_0x1389e1(0x126)](_0x48d8e3[_0x1389e1(0x19f)])||'':'';console[_0x1389e1(0xc5)](_0x1389e1(0x129)+(_0x289fbe||'(root)')+'/'+_0x48d8e3[_0x1389e1(0x1a3)]);}return 0x1;}_0x20c4a7=_0x3ef025;}if(_0x20c4a7[_0x1389e1(0x199)]===0x0)return console[_0x1389e1(0xc5)](_0x1389e1(0xbc)),0x0;const _0x264b2a=new Map();for(const _0x3ee755 of _0x20c4a7){const _0x159538=_0x3ee755['journeyBundleId'];!_0x264b2a['has'](_0x159538)&&_0x264b2a['set'](_0x159538,[]),_0x264b2a['get'](_0x159538)['push'](_0x3ee755);}for(const _0x3391e6 of _0x264b2a['values']()){_0x3391e6[_0x1389e1(0x108)]((_0x2100a2,_0x3f75f3)=>(_0x2100a2[_0x1389e1(0xf0)]||0x0)-(_0x3f75f3[_0x1389e1(0xf0)]||0x0));}const _0x540430=[],{idToEmailMap:_0x347004,connectionIdToNameMap:_0x54bbfa}=await withSpinner(_0x1389e1(0xe1),async()=>{const _0x55dda4=_0x1389e1,[_0x30a3c2,_0x33c930]=await Promise[_0x55dda4(0xce)]([_0xaadfd['user'][_0x55dda4(0x161)](),_0xaadfd['connection'][_0x55dda4(0x1a5)]()]);return{'idToEmailMap':_0x30a3c2,'connectionIdToNameMap':_0x33c930};},{'verbose':_0x5da746['verbose']})[_0x1389e1(0x16a)](_0x4abced=>_0x4abced['data']);for(const _0x487b0f of _0x264b2a[_0x1389e1(0x12f)]()){const _0x38978b=_0x487b0f[0x0]['journeyBundleName'],_0xdaa243=_0x487b0f[0x0][_0x1389e1(0x19f)],_0x222643=_0xdaa243?_0xfcd9a7[_0x1389e1(0x126)](_0xdaa243)||'':'',_0x4e4361=_0x222643?a22_0x3e42a2[_0x1389e1(0x125)](_0xb172e2,_0x222643):_0xb172e2,_0x26cbdc=_0x15f6e6||a22_0x3e42a2['join'](_0x4e4361,sanitizeFileName(_0x38978b)+_0x1389e1(0x176));let _0x1a204d,_0x15a673;if(existsSync(_0x26cbdc))try{const _0x5db7ee=readFileSync(_0x26cbdc,'utf-8'),_0x318278=parseYamlString(_0x5db7ee);_0x15a673=_0x318278,_0x1a204d=buildRuleToNameMapping(_0x318278),_0x3c8a43[_0x1389e1(0x18f)]&&_0x1a204d[_0x1389e1(0x17d)]>0x0&&console[_0x1389e1(0xc5)](_0x1389e1(0x117)+_0x1a204d[_0x1389e1(0x17d)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x38978b);}catch(_0x424e89){_0x3c8a43[_0x1389e1(0x18f)]&&console[_0x1389e1(0xc5)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x424e89[_0x1389e1(0x16b)]);}const _0x2042ac=[],_0xa3dd18=new Set(),_0x4111f6=new Map(),_0x1dc771=new Map(),_0x347137=new Set(),_0x42c865=new Map(),_0xa0a4=new Map(),_0x3a1bc4=createJumpTargetCache();await withProgressSpinner(_0x1389e1(0x13a)+_0x38978b+'...',async _0x716a43=>{const _0x2b2edb=_0x1389e1;for(const _0x3db2f1 of _0x487b0f){const _0x542568=_0x487b0f[_0x2b2edb(0x199)]>0x1?_0x3db2f1['journeyBundleName']+'\x20v'+(_0x3db2f1[_0x2b2edb(0xf0)]||0x1):_0x3db2f1[_0x2b2edb(0x1a3)];_0x716a43[_0x2b2edb(0x12d)](_0x2b2edb(0x13a)+_0x542568);const _0x2450d5=await _0xaadfd['journey']['getJourney'](_0x3db2f1['id']),_0x5a7142=_0x2450d5['attributes']?.[_0x2b2edb(0xf3)],_0x595080={'resolveSegment':async _0x33bd32=>{const _0x1de857=_0x2b2edb;if(!_0x5a7142)return{'name':_0x33bd32,'isJourneyLocal':![]};const _0x2382e0=_0x4111f6['get'](_0x33bd32);if(_0x2382e0)return _0x2382e0;try{const _0x29b089=await _0xaadfd[_0x1de857(0x19a)]['getSegment'](_0x5a7142,_0x33bd32),_0x2ffad4=_0x29b089['kind']===SEGMENT_KIND_JOURNEY;let _0x56bdb5,_0x4be0ad=_0x29b089[_0x1de857(0xba)];if(_0x2ffad4&&_0x29b089[_0x1de857(0x10c)]){const _0x1ef1ff=await segmentResponseToDef(_0x29b089,{'resolveSegmentName':async _0x513909=>{const _0x71d45f=_0x1de857,_0x2f76a1=_0x4111f6[_0x71d45f(0x126)](_0x513909);if(_0x2f76a1)return _0x2f76a1[_0x71d45f(0xba)];const _0x2e07ff=await _0x595080[_0x71d45f(0x9e)](_0x513909);return _0x2e07ff[_0x71d45f(0xba)];}}),_0x1cae20=_0x1ef1ff[_0x1de857(0x10c)];_0x56bdb5={'description':_0x29b089[_0x1de857(0x160)],'rule':_0x1cae20};const _0x5f402a=serializeRule(_0x1cae20),_0x2c8832=_0x1dc771['get'](_0x5f402a);if(_0x2c8832)_0x4be0ad=_0x2c8832,_0x56bdb5=undefined,_0x3c8a43[_0x1de857(0x18f)]&&console[_0x1de857(0xc5)](_0x1de857(0x11c)+_0x29b089['name']+_0x1de857(0x14d)+_0x2c8832);else{let _0x5105c9=![];if(_0x1a204d){const _0x132074=_0x1a204d[_0x1de857(0x126)](_0x5f402a);if(_0x132074){const _0x5bffb8=_0x132074[_0x1de857(0xdd)](_0x50f6bb=>!_0xa3dd18[_0x1de857(0x9d)](_0x50f6bb));_0x5bffb8&&(_0x4be0ad=_0x5bffb8,_0xa3dd18[_0x1de857(0x12a)](_0x5bffb8),_0x1dc771[_0x1de857(0x130)](_0x5f402a,_0x5bffb8),_0x5105c9=!![],_0x3c8a43[_0x1de857(0x18f)]&&console['error'](_0x1de857(0xab)+_0x5bffb8+_0x1de857(0xf6)));}}if(!_0x5105c9){const _0x31cccc=generateJourneyLocalName(_0x29b089[_0x1de857(0xba)]);_0x31cccc&&(_0x4be0ad=_0x31cccc);let _0x325cd4=_0x4be0ad,_0x480ab7=0x2;while(_0xa3dd18['has'](_0x325cd4)){_0x325cd4=_0x4be0ad+'_'+_0x480ab7,_0x480ab7++;}_0xa3dd18[_0x1de857(0x12a)](_0x325cd4),_0x1dc771[_0x1de857(0x130)](_0x5f402a,_0x325cd4),_0x4be0ad=_0x325cd4;}}}const _0x384112={'name':_0x4be0ad,'isJourneyLocal':_0x2ffad4,'definition':_0x56bdb5};return _0x4111f6[_0x1de857(0x130)](_0x33bd32,_0x384112),_0x384112;}catch(_0x4e123f){return _0x5da746[_0x1de857(0x18f)]&&console[_0x1de857(0xc5)](_0x1de857(0xb8)+_0x33bd32+':\x20'+_0x4e123f[_0x1de857(0x16b)]),{'name':_0x33bd32,'isJourneyLocal':![]};}},'resolveActivation':async _0x15807e=>{const _0x31654e=_0x2b2edb,_0x111792=_0x42c865[_0x31654e(0x126)](_0x15807e);if(_0x111792)return _0x111792;try{const _0x32920a=await _0xaadfd[_0x31654e(0x155)][_0x31654e(0x18b)](_0x3db2f1['id'],_0x15807e),_0x5ef4f3=journeyActivationStepToYaml(_0x32920a,_0x347004,_0x54bbfa),_0xbc2597=JSON['stringify']({'name':_0x5ef4f3[_0x31654e(0xba)],'connection':_0x5ef4f3[_0x31654e(0x157)],'connector_config':_0x5ef4f3[_0x31654e(0x177)]}),_0x1227d7=_0xa0a4['get'](_0xbc2597);if(_0x1227d7){const _0x1c50ce={'name':_0x1227d7,'isJourneyLocal':!![],'definition':_0x5ef4f3};return _0x42c865[_0x31654e(0x130)](_0x15807e,_0x1c50ce),_0x1c50ce;}const _0x105b25=_0x32920a['attributes'][_0x31654e(0x114)][_0x31654e(0xba)]||_0x15807e,_0x40d9ca=sanitizeYamlKey(_0x105b25)||'activation_'+_0x15807e;let _0x2ceeda=_0x40d9ca,_0xb18091=0x2;while(_0x347137[_0x31654e(0x9d)](_0x2ceeda)){_0x2ceeda=_0x40d9ca+'_'+_0xb18091,_0xb18091++;}_0x347137['add'](_0x2ceeda),_0xa0a4[_0x31654e(0x130)](_0xbc2597,_0x2ceeda);const _0x4eca8b={'name':_0x2ceeda,'isJourneyLocal':!![],'definition':_0x5ef4f3};return _0x42c865['set'](_0x15807e,_0x4eca8b),_0x4eca8b;}catch(_0x13fe0d){return _0x5da746[_0x31654e(0x18f)]&&console[_0x31654e(0xc5)](_0x31654e(0x162)+_0x15807e+':\x20'+_0x13fe0d[_0x31654e(0x16b)]),{'name':_0x15807e,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x55fc99,_0x1d6132)=>{const _0x1c9e68=_0x2b2edb;return resolveJumpTarget(_0x55fc99,_0x1d6132,_0x3a1bc4,_0xd797d=>_0xaadfd[_0x1c9e68(0x155)]['getJourney'](_0xd797d));}},_0x1b0a8d=await journeyResponseToDef(_0x2450d5,_0x595080);_0x2042ac[_0x2b2edb(0x151)]({'item':_0x3db2f1,'yaml':_0x1b0a8d});}},{'verbose':_0x5da746[_0x1389e1(0x18f)]});const _0x325258=buildMergedJourneyDef(_0x2042ac,_0x1a204d),_0x38de36=normalizeJourneyDef(_0x325258,_0x15a673),_0x45f210=toYamlString(_0x38de36),_0x11309c=_0x15f6e6||a22_0x3e42a2[_0x1389e1(0x125)](_0x4e4361,sanitizeFileName(_0x38978b)+_0x1389e1(0x176));!_0x15f6e6&&_0x222643&&!existsSync(_0x4e4361)&&mkdirSync(_0x4e4361,{'recursive':!![]});const _0x19cdfb=a22_0x3e42a2[_0x1389e1(0x9a)](process[_0x1389e1(0x173)](),_0x11309c);if(existsSync(_0x11309c)){const _0x3e81ef=readFileSync(_0x11309c,_0x1389e1(0x139)),_0x2647b6=generateDiff(_0x3e81ef,_0x45f210),_0x3a746d=hasChanges(_0x2647b6);_0x540430[_0x1389e1(0x151)]({'relativePath':_0x19cdfb,'absolutePath':_0x11309c,'content':_0x45f210,'isNew':![],'hasChanges':_0x3a746d,'diff':_0x3a746d?formatDiffWithColors(_0x2647b6):undefined});}else _0x540430[_0x1389e1(0x151)]({'relativePath':_0x19cdfb,'absolutePath':_0x11309c,'content':_0x45f210,'isNew':!![],'hasChanges':![]});}const _0x82a672=_0x540430[_0x1389e1(0x127)](_0x1de043=>_0x1de043[_0x1389e1(0x128)]),_0x1e5902=_0x540430[_0x1389e1(0x127)](_0x402808=>!_0x402808['isNew']&&_0x402808[_0x1389e1(0xe2)]),_0x2263ec=_0x540430[_0x1389e1(0x127)](_0x3bed51=>!_0x3bed51[_0x1389e1(0x128)]&&!_0x3bed51[_0x1389e1(0xe2)]),_0x5a83b8=_0x20c4a7[_0x1389e1(0x199)],_0x51384e=_0x264b2a[_0x1389e1(0x17d)],_0x3deacd=_0x5a83b8>_0x51384e?'\x20('+_0x5a83b8+_0x1389e1(0xc0):'';console[_0x1389e1(0xc5)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a22_0x20b6d8[_0x1389e1(0xed)](_0x51384e+_0x1389e1(0x9f))+a22_0x20b6d8[_0x1389e1(0xbe)](_0x3deacd)),console[_0x1389e1(0xc5)]('\x20\x20'+a22_0x20b6d8[_0x1389e1(0xf8)]('+\x20'+_0x82a672[_0x1389e1(0x199)]+_0x1389e1(0xe0))),console[_0x1389e1(0xc5)]('\x20\x20'+a22_0x20b6d8[_0x1389e1(0xe6)]('~\x20'+_0x1e5902['length']+_0x1389e1(0xf4))),console[_0x1389e1(0xc5)]('\x20\x20'+a22_0x20b6d8[_0x1389e1(0xbe)]('=\x20'+_0x2263ec[_0x1389e1(0x199)]+_0x1389e1(0x168))),console[_0x1389e1(0xc5)](_0x1389e1(0x100)+a22_0x20b6d8[_0x1389e1(0xed)](_0xb172e2)+'\x0a');if(_0x1e5902[_0x1389e1(0x199)]>0x0)for(const _0x3af099 of _0x1e5902){console[_0x1389e1(0xc5)]('\x0aChanges\x20to\x20\x27'+_0x3af099[_0x1389e1(0xb2)]+'\x27:'),console[_0x1389e1(0xc5)]('─'[_0x1389e1(0xc7)](0x3c)),console[_0x1389e1(0xc5)](_0x3af099[_0x1389e1(0x195)]),console[_0x1389e1(0xc5)]('─'[_0x1389e1(0xc7)](0x3c));}if(_0x3c8a43[_0x1389e1(0xca)])return console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0xe6)](_0x1389e1(0x165))),0x0;if(_0x82a672[_0x1389e1(0x199)]===0x0&&_0x1e5902[_0x1389e1(0x199)]===0x0)return console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0xf8)](_0x1389e1(0xa0))),saveSessionContext({'parent_segment':_0x51ac70},_0x3c8a43[_0x1389e1(0xc4)]),console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0xf8)](_0x1389e1(0x183)+a22_0x20b6d8[_0x1389e1(0xbe)](_0x1389e1(0x166))+'\x20=\x20'+a22_0x20b6d8[_0x1389e1(0xed)](_0x51ac70))),0x0;if(!_0x3c8a43[_0x1389e1(0x15f)]&&(_0x82a672[_0x1389e1(0x199)]>0x0||_0x1e5902[_0x1389e1(0x199)]>0x0)){if(!isInteractive())return console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0x14f)](_0x1389e1(0x156)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1389e1(0xc5)](a22_0x20b6d8['dim'](_0x1389e1(0x103))),0x1;const _0x2b3b86=await confirmKey(_0x1389e1(0x17e)+(_0x82a672[_0x1389e1(0x199)]+_0x1e5902['length'])+'\x20files?');if(!_0x2b3b86)return console[_0x1389e1(0xc5)](a22_0x20b6d8['yellow']('Aborted.'),_0x1389e1(0x13d)),0x1;}!existsSync(_0xb172e2)&&mkdirSync(_0xb172e2,{'recursive':!![]});const _0x263123=a22_0x3e42a2[_0x1389e1(0x125)](_0xb172e2,_0x1389e1(0x18a));writeFileSync(_0x263123,createTdxConfigContent(_0x51ac70),_0x1389e1(0x139));for(const _0x470ebe of _0x540430){(_0x470ebe[_0x1389e1(0x128)]||_0x470ebe['hasChanges'])&&writeFileSync(_0x470ebe[_0x1389e1(0x143)],_0x470ebe[_0x1389e1(0x193)],_0x1389e1(0x139));}return console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0xf8)]('✔\x20Pulled\x20'+(_0x82a672[_0x1389e1(0x199)]+_0x1e5902[_0x1389e1(0x199)])+_0x1389e1(0x11e)+_0xb172e2)),saveSessionContext({'parent_segment':_0x51ac70},_0x3c8a43[_0x1389e1(0xc4)]),console[_0x1389e1(0xc5)](a22_0x20b6d8[_0x1389e1(0xf8)]('✔\x20Context\x20set:\x20'+a22_0x20b6d8['dim'](_0x1389e1(0x166))+_0x1389e1(0xa4)+a22_0x20b6d8[_0x1389e1(0xed)](_0x51ac70))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a22_0x4786ae(0xba)]='journey:columns';[a22_0x4786ae(0x160)]=a22_0x4786ae(0x115);async[a22_0x4786ae(0xde)](_0x16713e){const _0xedaec2=a22_0x4786ae,{options:_0x106c7c,args:_0x379988,tdx:_0x14a06a}=_0x16713e,_0x46c469=_0x379988[0x0];if(!requireNameOrPath(_0x46c469))return 0x1;_0x106c7c[_0xedaec2(0x18f)]&&console[_0xedaec2(0xc5)]('Input:\x20'+_0x46c469);const {journeyId:_0x59fb44}=await resolveJourneyIdFromInput(_0x46c469,_0x106c7c,_0x14a06a),_0x40d19a=await withSpinner(_0xedaec2(0x1a2),()=>_0x14a06a[_0xedaec2(0x155)][_0xedaec2(0x15e)](_0x59fb44),{'verbose':_0x106c7c[_0xedaec2(0x18f)]}),_0x3bf0e3=_0x40d19a[_0xedaec2(0xc6)];return console['log']('Database:\x20'+_0x3bf0e3[_0xedaec2(0x184)]),console[_0xedaec2(0x179)](_0xedaec2(0x104)+_0x3bf0e3[_0xedaec2(0xf9)]),await handleSDKOutput(_0x3bf0e3[_0xedaec2(0xaf)],_0x106c7c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xc8);[a22_0x4786ae(0x160)]=a22_0x4786ae(0xfc);async[a22_0x4786ae(0xde)](_0x487d43){const _0x5be2fa=a22_0x4786ae,{options:_0x17d05f,args:_0x25ceed,tdx:_0x25b2c}=_0x487d43,_0x1d0da9=_0x25ceed[0x0];if(!requireNameOrPath(_0x1d0da9))return 0x1;_0x17d05f[_0x5be2fa(0x18f)]&&console[_0x5be2fa(0xc5)](_0x5be2fa(0x18d)+_0x1d0da9);const {journeyId:_0xa72496}=await resolveJourneyIdFromInput(_0x1d0da9,_0x17d05f,_0x25b2c),_0x37c749=await withSpinner(_0x5be2fa(0x180),()=>_0x25b2c[_0x5be2fa(0x155)][_0x5be2fa(0x163)](_0xa72496),{'verbose':_0x17d05f[_0x5be2fa(0x18f)]}),_0x1c9f41=_0x37c749['data'];return console[_0x5be2fa(0xc5)]('Found\x20'+_0x1c9f41[_0x5be2fa(0x199)]+_0x5be2fa(0xa1)+(_0x1c9f41[_0x5be2fa(0x199)]!==0x1?'s':'')),await handleSDKOutput(_0x1c9f41,_0x17d05f),0x0;}}export class JourneyPushCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0x138);['description']=a22_0x4786ae(0x101);[a22_0x4786ae(0x111)]=new SegmentPushCommand();async[a22_0x4786ae(0xde)](_0x3970dc){const _0x5347e0=a22_0x4786ae,_0x279ba3=_0x3970dc['args'][0x0];let _0x122109;if(_0x279ba3){const _0xd26f1b=await resolveTarget({'arg':_0x279ba3,'contextParent':_0x3970dc[_0x5347e0(0x198)][_0x5347e0(0x144)],'cwd':process[_0x5347e0(0x173)]()});isSuccessfulResolution(_0xd26f1b)&&_0xd26f1b[_0x5347e0(0xd9)]==='file'&&(_0x122109=_0xd26f1b[_0x5347e0(0x172)]);}const _0x23882b={..._0x3970dc,'options':{..._0x3970dc[_0x5347e0(0x198)],'journeysOnly':!![],..._0x122109&&{'singleFilePath':_0x122109}}};return this[_0x5347e0(0x111)][_0x5347e0(0xde)](_0x23882b);}}export class JourneyVersionsCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0x9b);[a22_0x4786ae(0x160)]='List\x20all\x20versions\x20of\x20a\x20journey';async['execute'](_0x2b1aed){const _0x5b5adf=a22_0x4786ae,{options:_0x90e239,args:_0x33edc0,tdx:_0x52d098}=_0x2b1aed,_0xc882c7=_0x33edc0[0x0];if(!requireNameOrPath(_0xc882c7))return 0x1;if(_0x90e239[_0x5b5adf(0x18f)])console[_0x5b5adf(0xc5)](_0x5b5adf(0x18d)+_0xc882c7);const {journeyId:_0x761dce}=await resolveJourneyIdFromInput(_0xc882c7,_0x90e239,_0x52d098),_0x3c982d=await withSpinner(_0x5b5adf(0xee),()=>_0x52d098[_0x5b5adf(0x155)][_0x5b5adf(0x14a)](_0x761dce),{'verbose':_0x90e239[_0x5b5adf(0x18f)]}),{bundleName:_0x5465ff,versions:_0x1b86fd,latestJourneyId:_0x3189f3}=_0x3c982d[_0x5b5adf(0xc6)];console[_0x5b5adf(0xc5)](_0x5465ff+':\x20'+_0x1b86fd[_0x5b5adf(0x199)]+'\x20version'+(_0x1b86fd[_0x5b5adf(0x199)]!==0x1?'s':''));const _0x36cf6e=_0x1b86fd[_0x5b5adf(0xe4)](_0x10be6f=>({'version':_0x10be6f[_0x5b5adf(0xf0)],'journey_id':_0x10be6f[_0x5b5adf(0xeb)],'name':_0x10be6f[_0x5b5adf(0xba)],'state':_0x10be6f[_0x5b5adf(0x149)],'paused':_0x10be6f[_0x5b5adf(0x153)],'latest':_0x10be6f['journeyId']===_0x3189f3,'created_at':_0x10be6f[_0x5b5adf(0x182)]}));return await handleSDKOutput(_0x36cf6e,_0x90e239),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a22_0x4786ae(0xba)]=a22_0x4786ae(0xc2);[a22_0x4786ae(0x160)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a22_0x4786ae(0xde)](_0x4fd621){const _0x117959=a22_0x4786ae,{options:_0x3b4e8b,args:_0x15cef7,tdx:_0x310eaf}=_0x4fd621,_0x4b643a=_0x15cef7[0x0];if(!requireNameOrPath(_0x4b643a))return 0x1;if(_0x3b4e8b['verbose'])console[_0x117959(0xc5)](_0x117959(0x18d)+_0x4b643a);const {journeyId:_0x4be139,journeyName:_0x1942f4}=await resolveJourneyIdFromInput(_0x4b643a,_0x3b4e8b,_0x310eaf);if(!_0x3b4e8b['yes']){const _0x25cce8=await confirm(_0x117959(0xa9)+_0x1942f4+'\x22?');if(!_0x25cce8)return console['error']('Cancelled'),0x0;}const _0x35924b=await withSpinner('Creating\x20new\x20version...',()=>_0x310eaf[_0x117959(0x155)][_0x117959(0x11d)](_0x4be139),{'verbose':_0x3b4e8b[_0x117959(0x18f)]}),_0x5d114b=_0x35924b['data'];return console[_0x117959(0xc5)](a22_0x20b6d8[_0x117959(0xf8)]('✔')+_0x117959(0xa3)+_0x5d114b[_0x117959(0xfb)][_0x117959(0xf0)]+_0x117959(0x154)+_0x5d114b[_0x117959(0xfb)]['name']+'\x22'),console[_0x117959(0xc5)](_0x117959(0xac)+_0x5d114b['id']),await handleSingleObjectOutput({'id':_0x5d114b['id'],'name':_0x5d114b[_0x117959(0xfb)][_0x117959(0xba)],'version':_0x5d114b[_0x117959(0xfb)][_0x117959(0xf0)],'state':_0x5d114b['attributes'][_0x117959(0x149)],'bundle_id':_0x5d114b[_0x117959(0xfb)][_0x117959(0x15d)],'created_at':_0x5d114b['attributes'][_0x117959(0x182)]},_0x3b4e8b),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a22_0x4786ae(0x112);[a22_0x4786ae(0x160)]=a22_0x4786ae(0x150);async['execute'](_0x2c016a){const _0x14b471=a22_0x4786ae,{options:_0x1cc884,args:_0xa7c57b,tdx:_0x26b224}=_0x2c016a,_0x1d1f40=_0xa7c57b[0x0];if(!requireNameOrPath(_0x1d1f40))return 0x1;const _0x1fb923=_0x1cc884[_0x14b471(0x148)];if(!_0x1fb923)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x14b471(0xc5)](_0x14b471(0xf1)),0x1;const _0x5efe1a=parseInt(_0x1fb923,0xa);if(isNaN(_0x5efe1a)||_0x5efe1a<0x1)return console[_0x14b471(0xc5)](_0x14b471(0x12e)+_0x1fb923),0x1;if(_0x1cc884[_0x14b471(0x18f)])console['error'](_0x14b471(0x18d)+_0x1d1f40+_0x14b471(0xaa)+_0x5efe1a);const {journeyId:_0x14adce,parentSegmentId:_0x282db5}=await resolveJourneyIdFromInput(_0x1d1f40,_0x1cc884,_0x26b224),_0xccb8e1=await withSpinner(_0x14b471(0x131),()=>_0x26b224['journey']['listVersions'](_0x14adce),{'verbose':_0x1cc884['verbose']}),{versions:_0x121c79,latestJourneyId:_0x194ed2}=_0xccb8e1[_0x14b471(0xc6)],_0x293246=_0x121c79[_0x14b471(0xdd)](_0x4ea8fa=>_0x4ea8fa[_0x14b471(0xf0)]===_0x5efe1a);if(!_0x293246){const _0x2ae51f=_0x121c79[_0x14b471(0xe4)](_0xb6582c=>'v'+_0xb6582c[_0x14b471(0xf0)])[_0x14b471(0x125)](',\x20');return console[_0x14b471(0xc5)](_0x14b471(0x10a)+_0x5efe1a+'\x20not\x20found.\x20Available:\x20'+_0x2ae51f),0x1;}const _0x25753f=await withSpinner('Getting\x20version\x20'+_0x5efe1a+_0x14b471(0xd5),()=>_0x26b224[_0x14b471(0x155)][_0x14b471(0x14e)](_0x293246['journeyId']),{'verbose':_0x1cc884[_0x14b471(0x18f)]}),_0x335d00=_0x25753f[_0x14b471(0xc6)],_0x3a7858=getConsoleNextUrl(_0x1cc884[_0x14b471(0xfa)],_0x14b471(0x175)+_0x282db5+_0x14b471(0xea)+_0x293246[_0x14b471(0xeb)]+_0x14b471(0x113));return await handleSingleObjectOutput({'id':_0x335d00['id'],'name':_0x335d00[_0x14b471(0xfb)]['name'],'version':_0x335d00[_0x14b471(0xfb)][_0x14b471(0xf0)],'description':_0x335d00['attributes'][_0x14b471(0x160)],'state':_0x335d00[_0x14b471(0xfb)][_0x14b471(0x149)],'paused':_0x335d00[_0x14b471(0xfb)][_0x14b471(0x153)],'reentry_mode':_0x335d00[_0x14b471(0xfb)][_0x14b471(0x10b)],'stages':_0x335d00['attributes'][_0x14b471(0x12b)]?.[_0x14b471(0x199)]||0x0,..._0x335d00[_0x14b471(0xfb)][_0x14b471(0x13e)]&&{'goal':_0x335d00[_0x14b471(0xfb)]['goal'][_0x14b471(0xba)]},'latest':_0x293246[_0x14b471(0xeb)]===_0x194ed2,'created_at':_0x335d00[_0x14b471(0xfb)][_0x14b471(0x182)],'updated_at':_0x335d00[_0x14b471(0xfb)]['updatedAt'],'url':_0x3a7858},_0x1cc884),0x0;}}function a22_0x2c33(){const _0x13c100=['execute','parentName','\x20new\x20files','Fetching\x20users\x20and\x20connections...','hasChanges','journey:traffic','map','(paused)','yellow','launched','activation','Resolving\x20journey...','/e/','journeyId','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','cyan','Listing\x20journey\x20versions...','format','versionNumber','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','pause','audienceId','\x20changed\x20files','Available\x20stages:\x20','\x20(rule\x20match)','\x20(ID:\x20','green','table','site','attributes','List\x20activations\x20for\x20a\x20journey','615590KxMbxG','journey:resume','18RRKKXs','\x20\x20Target:\x20','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Table:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Export\x20journey(s)\x20as\x20YAML\x20files','sort','journeys','Error:\x20Version\x20','reentryMode','rule','Fetching\x20parent\x20segment...','jsonl','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','archived','segmentPushCommand','journey:version:view','/j/da/je','activationParams','Show\x20journey\x20table\x20column\x20mapping','journey:view','Found\x20','json','limit','errorCode','2304387herkCN','\x20\x20Consolidating\x20duplicate\x20segment:\x20','createVersion','\x20journey\x20files\x20to\x20','73212QnzZQk','\x20journey','bold','175PeoZKZ','targetDir','resolveParentId','join','get','filter','isNew','\x20\x20-\x20','add','journeyStages','List\x20journeys\x20in\x20current\x20context','setPhase','Error:\x20Invalid\x20version\x20number:\x20','values','set','Resolving\x20version...','Error:\x20Journey\x20\x27','Journey\x20name:\x20','Parent\x20segment:\x20','(archived)','\x20\x20Statistics\x20not\x20available','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','journey:push','utf-8','Fetching\x20','Target\x20directory:\x20','base','-\x20no\x20files\x20written','goal','helpText','tsv','completeMilestoneRate','\x22\x20resumed','absolutePath','parentSegment','resume','hasPeriod','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','version','state','listVersions','Pausing\x20journey...','resolveJourneyId','\x20->\x20','getJourney','red','View\x20a\x20specific\x20version\x20of\x20a\x20journey','push','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','paused','\x20(draft)\x20—\x20\x22','journey','\x0aError:','connection','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Getting\x20journey\x20details...','🗺️\x20','Show\x20journey\x20statistics','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','journeyBundleId','getColumnMapping','yes','description','buildIdToEmailMap','Warning:\x20Could\x20not\x20resolve\x20activation\x20','listActivationsFlat','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parent_segment','3814488nQIRNo','\x20unchanged\x20files','\x20\x20Parent\x20segment:\x20','then','message','stageNameMap','✔\x20Journey\x20\x22','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Error:\x20','from','(draft)','filePath','cwd','no_parent','/app/ps/','.yml','connector_config','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','log','getStatistics','\x20Opening\x20','segments','size','Write\x20','replace','Listing\x20journey\x20activations...','folders','createdAt','✔\x20Context\x20set:\x20','database','270180LqnyZP','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','enteredSize','(running)','\x5c$&','tdx.json','getActivation','No\x20statistics\x20available\x20for\x20journey:\x20','Input:\x20','(root)','verbose','history','goalSize','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','content','stages','diff','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','includeStats','options','length','segment','conversion','listFolders','rootFolderId','includeHistory','folderId','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Getting\x20column\x20mapping...','journeyBundleName','nodes','buildIdToNameMap','listJourneysFromParentSegment','Cancelled','relative','journey:versions','📁\x20','has','resolveSegment','\x20journeys','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20activation','journey:pause','\x20Created\x20v','\x20=\x20','(completed)','2469780VqkrxG','toLowerCase','folderPath','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22',',\x20version:\x20','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x20\x20Journey\x20ID:\x20','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','Folder\x20path:\x20','columns','localeCompare','Show\x20journey\x20details','relativePath','Getting\x20journey\x20traffic\x20data...','journeyName','2722050tKWEkw','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','\x20\x20Name:\x20','Warning:\x20Could\x20not\x20resolve\x20segment\x20','file','name','journey:list','No\x20journeys\x20found','entries','dim','387AjUQyG','\x20versions)','\x22\x20not\x20found','journey:version:create','completionRate','session','error','data','repeat','journey:activations','INVALID_ARGUMENT','dryRun','Getting\x20journey\x20statistics...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','web','all','Resolving\x20parent\x20segment...','journey:stats','✔\x20Found\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','milestoneSize','Resuming\x20journey...','\x20details...','completed','renderStats','exitOrJumpRate','type','Pattern:\x20','journey:pull','\x27\x20not\x20found\x20in\x20','find'];a22_0x2c33=function(){return _0x13c100;};return a22_0x2c33();}