@treasuredata/tdx 2026.8.7 → 2026.9.0

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 (312) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/codex-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-command.d.ts +48 -0
  31. package/dist/commands/engage-command.d.ts.map +1 -1
  32. package/dist/commands/engage-command.js +1 -1
  33. package/dist/commands/engage-command.js.map +1 -1
  34. package/dist/commands/engage-landing-page-command.d.ts +48 -0
  35. package/dist/commands/engage-landing-page-command.d.ts.map +1 -0
  36. package/dist/commands/engage-landing-page-command.js +1 -0
  37. package/dist/commands/engage-landing-page-command.js.map +1 -0
  38. package/dist/commands/engage-template-pull-command.js +1 -1
  39. package/dist/commands/engage-template-push-command.js +1 -1
  40. package/dist/commands/engage-template-validate-command.js +1 -1
  41. package/dist/commands/job-command.js +1 -1
  42. package/dist/commands/journey-command.js +1 -1
  43. package/dist/commands/journey-validate-command.js +1 -1
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/mcp-command.js +1 -1
  46. package/dist/commands/p13n-command.js +1 -1
  47. package/dist/commands/parent-segment-command.js +1 -1
  48. package/dist/commands/policy-command.js +1 -1
  49. package/dist/commands/profile-command.js +1 -1
  50. package/dist/commands/profiles-command.js +1 -1
  51. package/dist/commands/query-command.js +1 -1
  52. package/dist/commands/schedule-command.js +1 -1
  53. package/dist/commands/segment-command.js +1 -1
  54. package/dist/commands/segment-create-command.js +1 -1
  55. package/dist/commands/segment-fields-command.js +1 -1
  56. package/dist/commands/segment-move-command.js +1 -1
  57. package/dist/commands/segment-pull-command.js +1 -1
  58. package/dist/commands/segment-push-command.js +1 -1
  59. package/dist/commands/segment-update-command.js +1 -1
  60. package/dist/commands/segment-use-command.js +1 -1
  61. package/dist/commands/segment-validate-command.js +1 -1
  62. package/dist/commands/segments.js +1 -1
  63. package/dist/commands/show.js +1 -1
  64. package/dist/commands/status-command.js +1 -1
  65. package/dist/commands/table-deleted.js +1 -1
  66. package/dist/commands/tables.js +1 -1
  67. package/dist/commands/unset-command.js +1 -1
  68. package/dist/commands/upgrade-command.js +1 -1
  69. package/dist/commands/use-command.js +1 -1
  70. package/dist/commands/user-command.js +1 -1
  71. package/dist/commands/work-command.js +1 -1
  72. package/dist/commands/workflow-command.js +1 -1
  73. package/dist/core/auth.js +1 -1
  74. package/dist/core/command-output.js +1 -1
  75. package/dist/core/config.js +1 -1
  76. package/dist/core/connection-cache.js +1 -1
  77. package/dist/core/constants.js +1 -1
  78. package/dist/core/credential-cache.js +1 -1
  79. package/dist/core/global-context.js +1 -1
  80. package/dist/core/keychain.js +1 -1
  81. package/dist/core/oauth-keychain.js +1 -1
  82. package/dist/core/oauth.js +1 -1
  83. package/dist/core/profile.js +1 -1
  84. package/dist/core/project-config.js +1 -1
  85. package/dist/core/session.js +1 -1
  86. package/dist/core/site-mismatch.js +1 -1
  87. package/dist/core/user-cache.js +1 -1
  88. package/dist/core/version.js +1 -1
  89. package/dist/index.js +1 -1
  90. package/dist/mcp/server.js +1 -1
  91. package/dist/mcp/tools/index.js +1 -1
  92. package/dist/mcp/tools/tdx-run.d.ts +28 -0
  93. package/dist/mcp/tools/tdx-run.d.ts.map +1 -1
  94. package/dist/mcp/tools/tdx-run.js +1 -1
  95. package/dist/mcp/tools/tdx-run.js.map +1 -1
  96. package/dist/mcp/tools/tdx-search.js +1 -1
  97. package/dist/mcp/tools/work-create-item.js +1 -1
  98. package/dist/mcp/utils.js +1 -1
  99. package/dist/proxy/claude-usage-tracker.js +1 -1
  100. package/dist/proxy/passthrough-server.js +1 -1
  101. package/dist/proxy/sse-usage-parser.js +1 -1
  102. package/dist/sdk/agent/agent-config.js +1 -1
  103. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  104. package/dist/sdk/agent/agent-yaml.js +1 -1
  105. package/dist/sdk/agent/test/evaluator.js +1 -1
  106. package/dist/sdk/agent/test/executor.js +1 -1
  107. package/dist/sdk/agent/test/index.js +1 -1
  108. package/dist/sdk/agent/test/output.js +1 -1
  109. package/dist/sdk/agent/test/parser.js +1 -1
  110. package/dist/sdk/agent/tool-target-registry.js +1 -1
  111. package/dist/sdk/api.js +1 -1
  112. package/dist/sdk/auth-token.js +1 -1
  113. package/dist/sdk/cas/cas-api-client.js +1 -1
  114. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  115. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  116. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  117. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  118. package/dist/sdk/cas/cas-segment-validator.js +1 -1
  119. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  120. package/dist/sdk/cas/index.js +1 -1
  121. package/dist/sdk/cas/pull-workflow.js +1 -1
  122. package/dist/sdk/cas/push-workflow.js +1 -1
  123. package/dist/sdk/cas/validate-files.js +1 -1
  124. package/dist/sdk/client/cdp-api-client.js +1 -1
  125. package/dist/sdk/client/delivery-api-client.js +1 -1
  126. package/dist/sdk/client/endpoints.js +1 -1
  127. package/dist/sdk/client/engage-api-client.d.ts +58 -1
  128. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  129. package/dist/sdk/client/engage-api-client.js +1 -1
  130. package/dist/sdk/client/engage-api-client.js.map +1 -1
  131. package/dist/sdk/client/http-client.js +1 -1
  132. package/dist/sdk/client/llm-api-client.js +1 -1
  133. package/dist/sdk/client/oauth-refresh.js +1 -1
  134. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  135. package/dist/sdk/client/rate-limiter.js +1 -1
  136. package/dist/sdk/client/td-api-client.js +1 -1
  137. package/dist/sdk/client/trino-api-client.js +1 -1
  138. package/dist/sdk/client/workflow-client.js +1 -1
  139. package/dist/sdk/connection-validator.js +1 -1
  140. package/dist/sdk/connection.js +1 -1
  141. package/dist/sdk/delivery.js +1 -1
  142. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  143. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  144. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  145. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  146. package/dist/sdk/engage/campaign-pull.js +1 -1
  147. package/dist/sdk/engage/campaign-push.js +1 -1
  148. package/dist/sdk/engage/campaign-validator.js +1 -1
  149. package/dist/sdk/engage/campaign-yaml.js +1 -1
  150. package/dist/sdk/engage/landing-page-init.d.ts +15 -0
  151. package/dist/sdk/engage/landing-page-init.d.ts.map +1 -0
  152. package/dist/sdk/engage/landing-page-init.js +1 -0
  153. package/dist/sdk/engage/landing-page-init.js.map +1 -0
  154. package/dist/sdk/engage/landing-page-public-asset.d.ts +16 -0
  155. package/dist/sdk/engage/landing-page-public-asset.d.ts.map +1 -0
  156. package/dist/sdk/engage/landing-page-public-asset.js +1 -0
  157. package/dist/sdk/engage/landing-page-public-asset.js.map +1 -0
  158. package/dist/sdk/engage/landing-page-pull.d.ts +42 -0
  159. package/dist/sdk/engage/landing-page-pull.d.ts.map +1 -0
  160. package/dist/sdk/engage/landing-page-pull.js +1 -0
  161. package/dist/sdk/engage/landing-page-pull.js.map +1 -0
  162. package/dist/sdk/engage/landing-page-push.d.ts +44 -0
  163. package/dist/sdk/engage/landing-page-push.d.ts.map +1 -0
  164. package/dist/sdk/engage/landing-page-push.js +1 -0
  165. package/dist/sdk/engage/landing-page-push.js.map +1 -0
  166. package/dist/sdk/engage/landing-page-static-site.d.ts +37 -0
  167. package/dist/sdk/engage/landing-page-static-site.d.ts.map +1 -0
  168. package/dist/sdk/engage/landing-page-static-site.js +1 -0
  169. package/dist/sdk/engage/landing-page-static-site.js.map +1 -0
  170. package/dist/sdk/engage/landing-page-validator.d.ts +17 -0
  171. package/dist/sdk/engage/landing-page-validator.d.ts.map +1 -0
  172. package/dist/sdk/engage/landing-page-validator.js +1 -0
  173. package/dist/sdk/engage/landing-page-validator.js.map +1 -0
  174. package/dist/sdk/engage/landing-page-workspace.d.ts +10 -0
  175. package/dist/sdk/engage/landing-page-workspace.d.ts.map +1 -0
  176. package/dist/sdk/engage/landing-page-workspace.js +1 -0
  177. package/dist/sdk/engage/landing-page-workspace.js.map +1 -0
  178. package/dist/sdk/engage/landing-page-yaml.d.ts +20 -0
  179. package/dist/sdk/engage/landing-page-yaml.d.ts.map +1 -0
  180. package/dist/sdk/engage/landing-page-yaml.js +1 -0
  181. package/dist/sdk/engage/landing-page-yaml.js.map +1 -0
  182. package/dist/sdk/engage/template-pull.js +1 -1
  183. package/dist/sdk/engage/template-push.js +1 -1
  184. package/dist/sdk/engage/template-validator.js +1 -1
  185. package/dist/sdk/engage/template-yaml.js +1 -1
  186. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  187. package/dist/sdk/engage/types/campaign-def.js +1 -1
  188. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  189. package/dist/sdk/engage/types/landing-page-schema.d.ts +21 -0
  190. package/dist/sdk/engage/types/landing-page-schema.d.ts.map +1 -0
  191. package/dist/sdk/engage/types/landing-page-schema.js +1 -0
  192. package/dist/sdk/engage/types/landing-page-schema.js.map +1 -0
  193. package/dist/sdk/engage/types/template-schema.js +1 -1
  194. package/dist/sdk/engage.d.ts +91 -1
  195. package/dist/sdk/engage.d.ts.map +1 -1
  196. package/dist/sdk/engage.js +1 -1
  197. package/dist/sdk/engage.js.map +1 -1
  198. package/dist/sdk/errors.js +1 -1
  199. package/dist/sdk/index.d.ts +1 -1
  200. package/dist/sdk/index.d.ts.map +1 -1
  201. package/dist/sdk/index.js +1 -1
  202. package/dist/sdk/index.js.map +1 -1
  203. package/dist/sdk/io/index.js +1 -1
  204. package/dist/sdk/io/node-filesystem.js +1 -1
  205. package/dist/sdk/job.js +1 -1
  206. package/dist/sdk/journey.js +1 -1
  207. package/dist/sdk/llm/chat-cache.js +1 -1
  208. package/dist/sdk/llm/index.js +1 -1
  209. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  210. package/dist/sdk/llm/model-factors.js +1 -1
  211. package/dist/sdk/llm/user-settings.js +1 -1
  212. package/dist/sdk/p13n-studio.js +1 -1
  213. package/dist/sdk/personalization.js +1 -1
  214. package/dist/sdk/policy.js +1 -1
  215. package/dist/sdk/query/deleted-table-validation.js +1 -1
  216. package/dist/sdk/query/index.js +1 -1
  217. package/dist/sdk/query/sql-parser.js +1 -1
  218. package/dist/sdk/realtime.js +1 -1
  219. package/dist/sdk/schedule.js +1 -1
  220. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  221. package/dist/sdk/segment/fields-display.js +1 -1
  222. package/dist/sdk/segment/file-discovery.js +1 -1
  223. package/dist/sdk/segment/journey-utils.js +1 -1
  224. package/dist/sdk/segment/journey-validator.js +1 -1
  225. package/dist/sdk/segment/journey-yaml.js +1 -1
  226. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  227. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  228. package/dist/sdk/segment/pull-workflow.js +1 -1
  229. package/dist/sdk/segment/push-recovery.js +1 -1
  230. package/dist/sdk/segment/push-workflow.js +1 -1
  231. package/dist/sdk/segment/resolution-context.js +1 -1
  232. package/dist/sdk/segment/segment-path-parser.js +1 -1
  233. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  234. package/dist/sdk/segment/segment-validator.js +1 -1
  235. package/dist/sdk/segment/target-resolution.js +1 -1
  236. package/dist/sdk/segment/tdx-config.js +1 -1
  237. package/dist/sdk/segment/types/activation-schema.js +1 -1
  238. package/dist/sdk/segment/types/journey-def.js +1 -1
  239. package/dist/sdk/segment/types/journey-schema.js +1 -1
  240. package/dist/sdk/segment/types/segment-def.js +1 -1
  241. package/dist/sdk/segment/types/segment-schema.js +1 -1
  242. package/dist/sdk/segment/validate-files.js +1 -1
  243. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  244. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  245. package/dist/sdk/segment/yaml-validator.js +1 -1
  246. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  247. package/dist/sdk/segment.js +1 -1
  248. package/dist/sdk/types/engage.d.ts +182 -0
  249. package/dist/sdk/types/engage.d.ts.map +1 -1
  250. package/dist/sdk/types/index.d.ts +1 -1
  251. package/dist/sdk/types/index.d.ts.map +1 -1
  252. package/dist/sdk/types/index.js +1 -1
  253. package/dist/sdk/types/index.js.map +1 -1
  254. package/dist/sdk/types/progress.js +1 -1
  255. package/dist/sdk/types/workspace.js +1 -1
  256. package/dist/sdk/user.js +1 -1
  257. package/dist/sdk/util/format-detector.js +1 -1
  258. package/dist/sdk/util/formatters.js +1 -1
  259. package/dist/sdk/util/index.js +1 -1
  260. package/dist/sdk/util/paginate.js +1 -1
  261. package/dist/sdk/util/tree-formatter.js +1 -1
  262. package/dist/sdk/util/tree-search.js +1 -1
  263. package/dist/sdk/workflow/archive-validation.js +1 -1
  264. package/dist/sdk/workflow/clone-workflow.js +1 -1
  265. package/dist/sdk/workflow/index.js +1 -1
  266. package/dist/sdk/workflow/pull-workflow.js +1 -1
  267. package/dist/sdk/workflow/push-workflow.js +1 -1
  268. package/dist/sdk/workflow/task-graph.js +1 -1
  269. package/dist/sdk/workflow/tdx-config.js +1 -1
  270. package/dist/sdk/workflow/workflow-utils.js +1 -1
  271. package/dist/sdk/workspace/access-tracker.js +1 -1
  272. package/dist/sdk/workspace/frontmatter.js +1 -1
  273. package/dist/sdk/workspace/git.js +1 -1
  274. package/dist/sdk/workspace/index.js +1 -1
  275. package/dist/sdk/workspace/templates.js +1 -1
  276. package/dist/sdk/workspace/weekly.js +1 -1
  277. package/dist/sdk/workspace/wikilinks.js +1 -1
  278. package/dist/test-utils/command-runner.js +1 -1
  279. package/dist/test-utils/factories.js +1 -1
  280. package/dist/test-utils/fixtures.js +1 -1
  281. package/dist/test-utils/http-mock.js +1 -1
  282. package/dist/test-utils/index.js +1 -1
  283. package/dist/utils/async.js +1 -1
  284. package/dist/utils/claude-code-state.js +1 -1
  285. package/dist/utils/colors.js +1 -1
  286. package/dist/utils/diff.js +1 -1
  287. package/dist/utils/file-permissions.js +1 -1
  288. package/dist/utils/file-reader.js +1 -1
  289. package/dist/utils/github-releases.js +1 -1
  290. package/dist/utils/global-cache.js +1 -1
  291. package/dist/utils/json-loader.js +1 -1
  292. package/dist/utils/local-cache.js +1 -1
  293. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  294. package/dist/utils/logger/formatters/index.js +1 -1
  295. package/dist/utils/logger/handlers/console-handler.js +1 -1
  296. package/dist/utils/logger/handlers/file-handler.js +1 -1
  297. package/dist/utils/logger/handlers/index.js +1 -1
  298. package/dist/utils/logger/handlers/null-handler.js +1 -1
  299. package/dist/utils/logger/index.js +1 -1
  300. package/dist/utils/logger/logger.js +1 -1
  301. package/dist/utils/logger/types.js +1 -1
  302. package/dist/utils/option-validation.js +1 -1
  303. package/dist/utils/process.js +1 -1
  304. package/dist/utils/prompt.js +1 -1
  305. package/dist/utils/proxy-fetch.js +1 -1
  306. package/dist/utils/spinner.js +1 -1
  307. package/dist/utils/sse-parser.js +1 -1
  308. package/dist/utils/string-utils.js +1 -1
  309. package/dist/utils/table-ref-parser.js +1 -1
  310. package/dist/utils/tdx-logger.js +1 -1
  311. package/dist/utils/version-check.js +1 -1
  312. package/package.json +1 -1
@@ -1 +1 @@
1
- function a44_0x5b46(_0x2c129b,_0x3ae2c7){_0x2c129b=_0x2c129b-0x198;const _0x3a2b16=a44_0x3a2b();let _0x5b46de=_0x3a2b16[_0x2c129b];return _0x5b46de;}const a44_0x52aaec=a44_0x5b46;(function(_0x212a37,_0x43e99b){const _0x5ab0aa=a44_0x5b46,_0x54ee8f=_0x212a37();while(!![]){try{const _0x4aa42a=-parseInt(_0x5ab0aa(0x1ab))/0x1*(-parseInt(_0x5ab0aa(0x1ac))/0x2)+parseInt(_0x5ab0aa(0x1b0))/0x3+-parseInt(_0x5ab0aa(0x1ad))/0x4*(parseInt(_0x5ab0aa(0x1a3))/0x5)+parseInt(_0x5ab0aa(0x19e))/0x6+-parseInt(_0x5ab0aa(0x1ae))/0x7*(parseInt(_0x5ab0aa(0x19d))/0x8)+parseInt(_0x5ab0aa(0x1af))/0x9+-parseInt(_0x5ab0aa(0x19f))/0xa;if(_0x4aa42a===_0x43e99b)break;else _0x54ee8f['push'](_0x54ee8f['shift']());}catch(_0x1e0366){_0x54ee8f['push'](_0x54ee8f['shift']());}}}(a44_0x3a2b,0x3f588));import{BaseCommand}from'./command.js';function a44_0x3a2b(){const _0x364f11=['341244SGahfW','1526273HvfRoM','2961864IiGcqg','1286592XABERk','segment','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20field','Listing\x20fields\x20for\x20\x27','description','error','verbose','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','List\x20available\x20fields\x20for\x20segmentation','segment:fields','8syywWx','1275552ukSnXK','3654140vTnMtB','length','json','execute','15HCnDuU','site','data','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27...','Parent\x20segment:\x20','listFields','✔\x20Found\x20','6VZUtSZ','42766qEtlzn'];a44_0x3a2b=function(){return _0x364f11;};return a44_0x3a2b();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a44_0x52aaec(0x19c);[a44_0x52aaec(0x1b5)]=a44_0x52aaec(0x19b);async[a44_0x52aaec(0x1a2)](_0x1c8819){const _0x199ff5=a44_0x52aaec,{options:_0x4767ed,args:_0x3fccf0,tdx:_0x45f636}=_0x1c8819,_0xb58bde=_0x3fccf0[0x0]||_0x4767ed['parentSegment'];if(!_0xb58bde)return console[_0x199ff5(0x198)](_0x199ff5(0x1a6)),console[_0x199ff5(0x198)](_0x199ff5(0x1b2)),console[_0x199ff5(0x198)](_0x199ff5(0x19a)),0x1;_0x4767ed['verbose']&&(console[_0x199ff5(0x198)]('Site:\x20'+_0x4767ed[_0x199ff5(0x1a4)]),console['error'](_0x199ff5(0x1a8)+_0xb58bde));const _0x160f99=await withSpinner(_0x199ff5(0x1b4)+_0xb58bde+_0x199ff5(0x1a7),()=>_0x45f636[_0x199ff5(0x1b1)][_0x199ff5(0x1a9)](_0xb58bde),{'verbose':_0x4767ed[_0x199ff5(0x199)]}),_0x43be3e=_0x160f99[_0x199ff5(0x1a5)];console['error'](_0x199ff5(0x1aa)+_0x43be3e[_0x199ff5(0x1a0)]+_0x199ff5(0x1b3)+(_0x43be3e[_0x199ff5(0x1a0)]!==0x1?'s':''));if(_0x4767ed[_0x199ff5(0x1a1)]||_0x4767ed['jsonl'])return await handleSDKOutput(_0x43be3e,_0x4767ed),0x0;return displayFieldsHumanReadable(_0x43be3e,_0xb58bde),0x0;}}
1
+ const a45_0x4757ce=a45_0x24d8;(function(_0x354fad,_0x3ac324){const _0x2c50e0=a45_0x24d8,_0x10f8b9=_0x354fad();while(!![]){try{const _0x139773=parseInt(_0x2c50e0(0x1da))/0x1*(parseInt(_0x2c50e0(0x1c8))/0x2)+parseInt(_0x2c50e0(0x1d4))/0x3+-parseInt(_0x2c50e0(0x1c9))/0x4*(parseInt(_0x2c50e0(0x1d3))/0x5)+parseInt(_0x2c50e0(0x1d7))/0x6+parseInt(_0x2c50e0(0x1c2))/0x7*(-parseInt(_0x2c50e0(0x1c4))/0x8)+parseInt(_0x2c50e0(0x1c1))/0x9+-parseInt(_0x2c50e0(0x1ce))/0xa*(parseInt(_0x2c50e0(0x1db))/0xb);if(_0x139773===_0x3ac324)break;else _0x10f8b9['push'](_0x10f8b9['shift']());}catch(_0x5a7da5){_0x10f8b9['push'](_0x10f8b9['shift']());}}}(a45_0x6b0a,0x8b63d));function a45_0x6b0a(){const _0x4c77a5=['verbose','143916fMmCKb','3174152PuepTg','site','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27...','parentSegment','10HRArok','name','Parent\x20segment:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','List\x20available\x20fields\x20for\x20segmentation','5FcKSuP','980457kQbsmc','Site:\x20','jsonl','3482310TbLScL','length','description','1ieBXDK','1923911tvypIK','segment:fields','error','Listing\x20fields\x20for\x20\x27','10201896ApCZVj','2006641ZGuGnG','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','16giJuGr','✔\x20Found\x20','segment'];a45_0x6b0a=function(){return _0x4c77a5;};return a45_0x6b0a();}function a45_0x24d8(_0x2afd4c,_0x449ebe){_0x2afd4c=_0x2afd4c-0x1be;const _0x6b0a12=a45_0x6b0a();let _0x24d836=_0x6b0a12[_0x2afd4c];return _0x24d836;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a45_0x4757ce(0x1cf)]=a45_0x4757ce(0x1be);[a45_0x4757ce(0x1d9)]=a45_0x4757ce(0x1d2);async['execute'](_0x307826){const _0x119e19=a45_0x4757ce,{options:_0x3c7fd5,args:_0x21461e,tdx:_0x3200}=_0x307826,_0x4e7b5b=_0x21461e[0x0]||_0x3c7fd5[_0x119e19(0x1cd)];if(!_0x4e7b5b)return console['error'](_0x119e19(0x1cb)),console['error'](_0x119e19(0x1c3)),console[_0x119e19(0x1bf)](_0x119e19(0x1d1)),0x1;_0x3c7fd5[_0x119e19(0x1c7)]&&(console[_0x119e19(0x1bf)](_0x119e19(0x1d5)+_0x3c7fd5[_0x119e19(0x1ca)]),console['error'](_0x119e19(0x1d0)+_0x4e7b5b));const _0x4e87d5=await withSpinner(_0x119e19(0x1c0)+_0x4e7b5b+_0x119e19(0x1cc),()=>_0x3200[_0x119e19(0x1c6)]['listFields'](_0x4e7b5b),{'verbose':_0x3c7fd5[_0x119e19(0x1c7)]}),_0x354089=_0x4e87d5['data'];console['error'](_0x119e19(0x1c5)+_0x354089[_0x119e19(0x1d8)]+'\x20field'+(_0x354089['length']!==0x1?'s':''));if(_0x3c7fd5['json']||_0x3c7fd5[_0x119e19(0x1d6)])return await handleSDKOutput(_0x354089,_0x3c7fd5),0x0;return displayFieldsHumanReadable(_0x354089,_0x4e7b5b),0x0;}}
@@ -1 +1 @@
1
- function a45_0x30f4(_0x33fb8c,_0x2db935){_0x33fb8c=_0x33fb8c-0x94;const _0x2f539c=a45_0x2f53();let _0x30f42f=_0x2f539c[_0x33fb8c];return _0x30f42f;}const a45_0x137b53=a45_0x30f4;(function(_0x5d25fb,_0x8e7506){const _0x2fc263=a45_0x30f4,_0x1cdd93=_0x5d25fb();while(!![]){try{const _0x239ef8=parseInt(_0x2fc263(0xdc))/0x1+-parseInt(_0x2fc263(0xc2))/0x2*(-parseInt(_0x2fc263(0xaa))/0x3)+parseInt(_0x2fc263(0x94))/0x4+-parseInt(_0x2fc263(0xcd))/0x5+parseInt(_0x2fc263(0xb0))/0x6+-parseInt(_0x2fc263(0xa6))/0x7+-parseInt(_0x2fc263(0xad))/0x8;if(_0x239ef8===_0x8e7506)break;else _0x1cdd93['push'](_0x1cdd93['shift']());}catch(_0x2e382f){_0x1cdd93['push'](_0x1cdd93['shift']());}}}(a45_0x2f53,0x6fe5b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import a45_0x27246b from'chalk';function a45_0x2f53(){const _0x59b4c9=['2333624zwNyCJ','\x20folder\x20\x27','\x20\x20•\x20','description','filter','segment:move','slot','Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','resolvePathToResource','\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501','explainAmbiguousName','some','Searching\x20folders\x20for\x20\x27','red','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a','parentSegment','folder','6054391PwzCSv','moveSegments','Target\x20folder:\x20','\x27\x20to\x20folder\x20\x27','321xhpRrn','map','segment','4323576xDuwyg','green','\x20\x20(id\x20','2868426wwStUJ','length','✔\x20Moved\x20segment\x20\x27','SEGMENT_NOT_FOUND','Searching\x20the\x20tree...','Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder','data','parentId','folderId','\x20→\x20','type','push','•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27','listRecursive','\x20segment','\x27\x20—\x20','\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','12142MgvxtB','Error:\x20\x27','path','set','includes','segmentFolderId','get','\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)','\x27...','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','Duplicate\x20segments\x20removed\x20(','3056775UxYFMu','cyan','test','Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).','resolveEntitiesInParent','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','error','execute','Examples:','code','yellow','join','Moving','has','toLowerCase','763972JuKpLI','verbose','Segments:\x20','forEach','ruleConditionCount','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','dryRun','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:'];a45_0x2f53=function(){return _0x59b4c9;};return a45_0x2f53();}export class SegmentMoveCommand extends BaseCommand{['name']=a45_0x137b53(0x99);[a45_0x137b53(0x97)]=a45_0x137b53(0xb5);async[a45_0x137b53(0xd4)](_0x1d1201){const _0x53fbe5=a45_0x137b53,{options:_0x26506d,args:_0x483e97,tdx:_0x100fed}=_0x1d1201,_0x44b05a=_0x483e97,_0x244472=_0x26506d[_0x53fbe5(0xa5)];if(_0x44b05a[_0x53fbe5(0xb1)]===0x0||!_0x244472)return console['error'](a45_0x27246b[_0x53fbe5(0xa1)]('Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a')),console[_0x53fbe5(0xd3)](_0x53fbe5(0xd2)),console[_0x53fbe5(0xd3)](_0x53fbe5(0xd5)),console['error'](_0x53fbe5(0xe1)),console['error'](_0x53fbe5(0x9d)),console[_0x53fbe5(0xd3)](_0x53fbe5(0xc9)),console[_0x53fbe5(0xd3)]('\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.'),0x1;_0x26506d[_0x53fbe5(0xdd)]&&(console[_0x53fbe5(0xd3)](_0x53fbe5(0xde)+_0x44b05a[_0x53fbe5(0xd8)](',\x20')),console[_0x53fbe5(0xd3)](_0x53fbe5(0xa8)+_0x244472));const _0x5200b4=[...new Set(_0x44b05a)];_0x5200b4[_0x53fbe5(0xb1)]<_0x44b05a[_0x53fbe5(0xb1)]&&console[_0x53fbe5(0xd3)](a45_0x27246b[_0x53fbe5(0xd7)](_0x53fbe5(0xcc)+_0x44b05a[_0x53fbe5(0xb1)]+_0x53fbe5(0xb9)+_0x5200b4[_0x53fbe5(0xb1)]+').'));const _0x5cdbee=/^\d+$/,_0x25836e=_0x26506d[_0x53fbe5(0xa4)],_0x210311=[..._0x5200b4,_0x244472][_0x53fbe5(0x9f)](_0x43cac9=>!_0x5cdbee[_0x53fbe5(0xcf)](_0x43cac9));if(_0x210311&&!_0x25836e)return console[_0x53fbe5(0xd3)](a45_0x27246b['red'](_0x53fbe5(0xa3))),console[_0x53fbe5(0xd3)](_0x53fbe5(0x9b)),console['error'](_0x53fbe5(0xc1)),console[_0x53fbe5(0xd3)](_0x53fbe5(0xa2)),0x1;const _0x4f4ab6=_0x5200b4[_0x53fbe5(0xb1)],_0x281681=_0x26506d[_0x53fbe5(0xe2)]===!![];let _0x3984c2;try{const _0x38e86d=await withSpinner((_0x281681?'Checking':_0x53fbe5(0xd9))+'\x20'+_0x4f4ab6+_0x53fbe5(0xbe)+(_0x4f4ab6===0x1?'':'s')+'\x20'+((_0x281681?'for\x20move\x20to':'to')+_0x53fbe5(0x95)+_0x244472+_0x53fbe5(0xca)),async()=>{const _0x3d3589=_0x53fbe5,_0x34c029=[];_0x5200b4[_0x3d3589(0xdf)]((_0x52835e,_0x38e78a)=>{const _0x5c8fe3=_0x3d3589;if(!_0x5cdbee['test'](_0x52835e))_0x34c029[_0x5c8fe3(0xbb)]({'name':_0x52835e,'expectType':_0x5c8fe3(0xac),'slot':_0x38e78a});});if(!_0x5cdbee[_0x3d3589(0xcf)](_0x244472))_0x34c029['push']({'name':_0x244472,'expectType':_0x3d3589(0xa5),'slot':-0x1});const _0x29b3f9=new Map();if(_0x34c029[_0x3d3589(0xb1)]>0x0){const _0x2322ca=await _0x100fed[_0x3d3589(0xac)][_0x3d3589(0xd1)](_0x25836e,_0x34c029[_0x3d3589(0xab)](({name:_0x5755f9,expectType:_0x268707})=>({'name':_0x5755f9,'expectType':_0x268707})));_0x2322ca[_0x3d3589(0xdf)]((_0x32ee93,_0x13535c)=>_0x29b3f9[_0x3d3589(0xc5)](_0x34c029[_0x13535c][_0x3d3589(0x9a)],_0x32ee93['id']));}const _0x20b0da=_0x5200b4[_0x3d3589(0xab)]((_0x179f57,_0xeed0ec)=>_0x5cdbee['test'](_0x179f57)?_0x179f57:_0x29b3f9['get'](_0xeed0ec)),_0x1cd461=_0x5cdbee[_0x3d3589(0xcf)](_0x244472)?_0x244472:_0x29b3f9[_0x3d3589(0xc8)](-0x1);return _0x100fed[_0x3d3589(0xac)][_0x3d3589(0xa7)](_0x20b0da,_0x1cd461,_0x281681);},{'verbose':_0x26506d['verbose']});_0x3984c2=_0x38e86d[_0x53fbe5(0xb6)];}catch(_0xd84471){if(_0xd84471 instanceof SDKError&&_0xd84471[_0x53fbe5(0xd6)]===ErrorCode[_0x53fbe5(0xb3)]&&_0x25836e)try{if(await this[_0x53fbe5(0x9e)](_0x100fed,_0x25836e,_0x5200b4,_0x26506d))return 0x1;}catch{}throw _0xd84471;}for(const _0x1a56e3 of _0x3984c2){const _0x32f4a9=_0x1a56e3[_0x53fbe5(0xe0)],_0xf597d1='rule\x20'+(_0x281681?_0x53fbe5(0xda):'preserved:')+'\x20'+_0x32f4a9+'\x20condition'+(_0x32f4a9===0x1?'':'s');console[_0x53fbe5(0xd3)](_0x281681?a45_0x27246b[_0x53fbe5(0xce)](_0x53fbe5(0xbc)+_0x1a56e3['id']+_0x53fbe5(0xa9)+_0x1a56e3[_0x53fbe5(0xc7)]+_0x53fbe5(0xbf)+_0xf597d1):a45_0x27246b[_0x53fbe5(0xae)](_0x53fbe5(0xb2)+_0x1a56e3['id']+_0x53fbe5(0xa9)+_0x1a56e3[_0x53fbe5(0xc7)]+_0x53fbe5(0xbf)+_0xf597d1+'\x20(verified\x20by\x20re-read)'));}if(_0x281681)console[_0x53fbe5(0xd3)](a45_0x27246b['cyan']('[dry-run]\x20No\x20changes\x20made.\x20'+_0x4f4ab6+'\x20segment(s)\x20would\x20be\x20moved.'));else _0x3984c2[_0x53fbe5(0xb1)]>0x1&&console['error'](a45_0x27246b[_0x53fbe5(0xae)]('✔\x20'+_0x3984c2[_0x53fbe5(0xb1)]+_0x53fbe5(0xcb)));return await handleSDKOutput(_0x3984c2,_0x26506d),0x0;}async[a45_0x137b53(0x9e)](_0x5d2667,_0x534901,_0x3e9867,_0x960bc8){const _0xb6c5ed=a45_0x137b53,_0x200f28=_0x3e9867[_0xb6c5ed(0x98)](_0x5a643c=>!/^\d+$/[_0xb6c5ed(0xcf)](_0x5a643c)&&!_0x5a643c[_0xb6c5ed(0xc6)]('/'));if(_0x200f28[_0xb6c5ed(0xb1)]===0x0)return![];const _0x53c13c=await withSpinner(_0xb6c5ed(0xa0)+_0x200f28[_0xb6c5ed(0xd8)]('\x27,\x20\x27')+_0xb6c5ed(0xca),()=>_0x5d2667[_0xb6c5ed(0xac)][_0xb6c5ed(0x9c)](_0x534901),{'verbose':_0x960bc8[_0xb6c5ed(0xdd)]}),_0xb4345e=(await withSpinner(_0xb6c5ed(0xb4),()=>_0x5d2667[_0xb6c5ed(0xac)][_0xb6c5ed(0xbd)](_0x53c13c['data'][_0xb6c5ed(0xb7)],_0x53c13c['data'][_0xb6c5ed(0xb8)],0x0,0xa),{'verbose':_0x960bc8[_0xb6c5ed(0xdd)]}))[_0xb6c5ed(0xb6)];let _0x1dd759=![];for(const _0x4f834a of _0x200f28){const _0x5b1a5a=searchTreeByName(_0xb4345e,_0x4f834a)['filter'](_0x27d906=>_0x27d906[_0xb6c5ed(0xba)]===_0xb6c5ed(0xac)&&_0x27d906['name']['toLowerCase']()===_0x4f834a[_0xb6c5ed(0xdb)]());if(_0x5b1a5a['length']>0x1){_0x1dd759=!![],console[_0xb6c5ed(0xd3)](a45_0x27246b[_0xb6c5ed(0xa1)](_0xb6c5ed(0xc3)+_0x4f834a+'\x27\x20matches\x20'+_0x5b1a5a[_0xb6c5ed(0xb1)]+_0xb6c5ed(0xc0)));for(const _0x3eb81b of _0x5b1a5a)console[_0xb6c5ed(0xd3)](_0xb6c5ed(0x96)+_0x3eb81b[_0xb6c5ed(0xc4)]+_0xb6c5ed(0xaf)+_0x3eb81b['id']+')');}else _0x5b1a5a[_0xb6c5ed(0xb1)]===0x1&&(_0x1dd759=!![],console[_0xb6c5ed(0xd3)](a45_0x27246b['red'](_0xb6c5ed(0xc3)+_0x4f834a+_0xb6c5ed(0xe3))),console['error']('\x20\x20'+_0x5b1a5a[0x0][_0xb6c5ed(0xc4)]+_0xb6c5ed(0xaf)+_0x5b1a5a[0x0]['id']+')'),console[_0xb6c5ed(0xd3)](_0xb6c5ed(0xd0)));}return _0x1dd759;}}
1
+ const a46_0x514e60=a46_0x47e5;(function(_0x50b60d,_0x25af86){const _0x43b4d4=a46_0x47e5,_0x314d2d=_0x50b60d();while(!![]){try{const _0xe53e77=-parseInt(_0x43b4d4(0x153))/0x1*(parseInt(_0x43b4d4(0x141))/0x2)+parseInt(_0x43b4d4(0x12c))/0x3*(parseInt(_0x43b4d4(0x129))/0x4)+parseInt(_0x43b4d4(0x126))/0x5*(parseInt(_0x43b4d4(0x142))/0x6)+parseInt(_0x43b4d4(0x151))/0x7*(parseInt(_0x43b4d4(0x127))/0x8)+parseInt(_0x43b4d4(0x131))/0x9*(parseInt(_0x43b4d4(0x166))/0xa)+parseInt(_0x43b4d4(0x13b))/0xb*(-parseInt(_0x43b4d4(0x11c))/0xc)+parseInt(_0x43b4d4(0x163))/0xd;if(_0xe53e77===_0x25af86)break;else _0x314d2d['push'](_0x314d2d['shift']());}catch(_0x117b20){_0x314d2d['push'](_0x314d2d['shift']());}}}(a46_0x2177,0xbabfc));function a46_0x2177(){const _0x5bf9c3=['parentId','\x20segment','5TXptEA','4327320eJbGuV','cyan','8VTgVMj','\x20→\x20','forEach','1367910hkAYsQ','Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a','join','\x20(verified\x20by\x20re-read)','Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','711vtCyMR','dryRun','SEGMENT_NOT_FOUND','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:','execute','slot','explainAmbiguousName','•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27','path','segment','1221pQqvRS','\x20folder\x20\x27','has','Searching\x20the\x20tree...','Searching\x20folders\x20for\x20\x27','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','192646hgtdcl','522666NuOpys','test','\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.','listRecursive','\x20\x20•\x20','includes','Moving','Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder','\x27\x20to\x20folder\x20\x27','Target\x20folder:\x20','description','\x27,\x20\x27','red','parentSegment','Duplicate\x20segments\x20removed\x20(','7JFKdbx','name','8TEWwQn','filter','preserved:','\x27\x20—\x20','error','toLowerCase','data','\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)','folder','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','[dry-run]\x20No\x20changes\x20made.\x20','\x27...','moveSegments','folderId','\x20condition','1137058sTEjoZ','✔\x20Moved\x20segment\x20\x27','map','12770SCIQXp','segment:move','Error:\x20\x27','push','\x20\x20(id\x20','length','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','20844ZtokNT','segmentFolderId','get','for\x20move\x20to','verbose','type','\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501','green'];a46_0x2177=function(){return _0x5bf9c3;};return a46_0x2177();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import a46_0x141047 from'chalk';function a46_0x47e5(_0x5ad709,_0x11844f){_0x5ad709=_0x5ad709-0x118;const _0x217716=a46_0x2177();let _0x47e5f2=_0x217716[_0x5ad709];return _0x47e5f2;}export class SegmentMoveCommand extends BaseCommand{['name']=a46_0x514e60(0x167);[a46_0x514e60(0x14c)]=a46_0x514e60(0x149);async[a46_0x514e60(0x135)](_0x48fb4b){const _0x1f79a2=a46_0x514e60,{options:_0x4a8476,args:_0x94c818,tdx:_0x42affd}=_0x48fb4b,_0x1bd0ab=_0x94c818,_0x1eb43e=_0x4a8476[_0x1f79a2(0x15b)];if(_0x1bd0ab[_0x1f79a2(0x11a)]===0x0||!_0x1eb43e)return console[_0x1f79a2(0x157)](a46_0x141047['red'](_0x1f79a2(0x12d))),console[_0x1f79a2(0x157)](_0x1f79a2(0x15d)),console[_0x1f79a2(0x157)]('Examples:'),console[_0x1f79a2(0x157)](_0x1f79a2(0x11b)),console[_0x1f79a2(0x157)](_0x1f79a2(0x122)),console['error'](_0x1f79a2(0x15a)),console['error'](_0x1f79a2(0x144)),0x1;_0x4a8476[_0x1f79a2(0x120)]&&(console[_0x1f79a2(0x157)]('Segments:\x20'+_0x1bd0ab[_0x1f79a2(0x12e)](',\x20')),console['error'](_0x1f79a2(0x14b)+_0x1eb43e));const _0x33b971=[...new Set(_0x1bd0ab)];_0x33b971['length']<_0x1bd0ab[_0x1f79a2(0x11a)]&&console[_0x1f79a2(0x157)](a46_0x141047['yellow'](_0x1f79a2(0x150)+_0x1bd0ab[_0x1f79a2(0x11a)]+_0x1f79a2(0x12a)+_0x33b971[_0x1f79a2(0x11a)]+').'));const _0x163190=/^\d+$/,_0x316c89=_0x4a8476[_0x1f79a2(0x14f)],_0xca93db=[..._0x33b971,_0x1eb43e]['some'](_0x3c452c=>!_0x163190[_0x1f79a2(0x143)](_0x3c452c));if(_0xca93db&&!_0x316c89)return console[_0x1f79a2(0x157)](a46_0x141047[_0x1f79a2(0x14e)]('Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a')),console[_0x1f79a2(0x157)](_0x1f79a2(0x130)),console[_0x1f79a2(0x157)](_0x1f79a2(0x140)),console[_0x1f79a2(0x157)](_0x1f79a2(0x15c)),0x1;const _0x27051e=_0x33b971['length'],_0x2fdb88=_0x4a8476[_0x1f79a2(0x132)]===!![];let _0x9b2c5f;try{const _0x875051=await withSpinner((_0x2fdb88?'Checking':_0x1f79a2(0x148))+'\x20'+_0x27051e+_0x1f79a2(0x125)+(_0x27051e===0x1?'':'s')+'\x20'+((_0x2fdb88?_0x1f79a2(0x11f):'to')+_0x1f79a2(0x13c)+_0x1eb43e+_0x1f79a2(0x15f)),async()=>{const _0x5af625=_0x1f79a2,_0x268678=[];_0x33b971[_0x5af625(0x12b)]((_0x5aa85f,_0x1339d4)=>{const _0x3c5a40=_0x5af625;if(!_0x163190[_0x3c5a40(0x143)](_0x5aa85f))_0x268678[_0x3c5a40(0x118)]({'name':_0x5aa85f,'expectType':'segment','slot':_0x1339d4});});if(!_0x163190[_0x5af625(0x143)](_0x1eb43e))_0x268678[_0x5af625(0x118)]({'name':_0x1eb43e,'expectType':'folder','slot':-0x1});const _0x6fbf89=new Map();if(_0x268678[_0x5af625(0x11a)]>0x0){const _0x247273=await _0x42affd[_0x5af625(0x13a)]['resolveEntitiesInParent'](_0x316c89,_0x268678[_0x5af625(0x165)](({name:_0x3eeedb,expectType:_0x26443b})=>({'name':_0x3eeedb,'expectType':_0x26443b})));_0x247273[_0x5af625(0x12b)]((_0x22d08f,_0x516b0d)=>_0x6fbf89['set'](_0x268678[_0x516b0d][_0x5af625(0x136)],_0x22d08f['id']));}const _0x1a4e1f=_0x33b971[_0x5af625(0x165)]((_0x2edbc9,_0x3b62c9)=>_0x163190['test'](_0x2edbc9)?_0x2edbc9:_0x6fbf89[_0x5af625(0x11e)](_0x3b62c9)),_0x44820f=_0x163190[_0x5af625(0x143)](_0x1eb43e)?_0x1eb43e:_0x6fbf89['get'](-0x1);return _0x42affd[_0x5af625(0x13a)][_0x5af625(0x160)](_0x1a4e1f,_0x44820f,_0x2fdb88);},{'verbose':_0x4a8476[_0x1f79a2(0x120)]});_0x9b2c5f=_0x875051['data'];}catch(_0xa6416){if(_0xa6416 instanceof SDKError&&_0xa6416['code']===ErrorCode[_0x1f79a2(0x133)]&&_0x316c89)try{if(await this['explainAmbiguousName'](_0x42affd,_0x316c89,_0x33b971,_0x4a8476))return 0x1;}catch{}throw _0xa6416;}for(const _0x22edd0 of _0x9b2c5f){const _0xc0eb0f=_0x22edd0['ruleConditionCount'],_0x32c0b6='rule\x20'+(_0x2fdb88?_0x1f79a2(0x13d):_0x1f79a2(0x155))+'\x20'+_0xc0eb0f+_0x1f79a2(0x162)+(_0xc0eb0f===0x1?'':'s');console['error'](_0x2fdb88?a46_0x141047[_0x1f79a2(0x128)](_0x1f79a2(0x138)+_0x22edd0['id']+_0x1f79a2(0x14a)+_0x22edd0['segmentFolderId']+_0x1f79a2(0x156)+_0x32c0b6):a46_0x141047[_0x1f79a2(0x123)](_0x1f79a2(0x164)+_0x22edd0['id']+'\x27\x20to\x20folder\x20\x27'+_0x22edd0[_0x1f79a2(0x11d)]+_0x1f79a2(0x156)+_0x32c0b6+_0x1f79a2(0x12f)));}if(_0x2fdb88)console['error'](a46_0x141047[_0x1f79a2(0x128)](_0x1f79a2(0x15e)+_0x27051e+'\x20segment(s)\x20would\x20be\x20moved.'));else _0x9b2c5f[_0x1f79a2(0x11a)]>0x1&&console[_0x1f79a2(0x157)](a46_0x141047[_0x1f79a2(0x123)]('✔\x20'+_0x9b2c5f[_0x1f79a2(0x11a)]+'\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact'));return await handleSDKOutput(_0x9b2c5f,_0x4a8476),0x0;}async[a46_0x514e60(0x137)](_0x3acadb,_0x36dbb3,_0x58ee77,_0x5cca3c){const _0x592d6d=a46_0x514e60,_0x5ee228=_0x58ee77[_0x592d6d(0x154)](_0x3e6ce3=>!/^\d+$/[_0x592d6d(0x143)](_0x3e6ce3)&&!_0x3e6ce3[_0x592d6d(0x147)]('/'));if(_0x5ee228[_0x592d6d(0x11a)]===0x0)return![];const _0x438e88=await withSpinner(_0x592d6d(0x13f)+_0x5ee228[_0x592d6d(0x12e)](_0x592d6d(0x14d))+_0x592d6d(0x15f),()=>_0x3acadb['segment']['resolvePathToResource'](_0x36dbb3),{'verbose':_0x5cca3c[_0x592d6d(0x120)]}),_0x3a9545=(await withSpinner(_0x592d6d(0x13e),()=>_0x3acadb['segment'][_0x592d6d(0x145)](_0x438e88[_0x592d6d(0x159)][_0x592d6d(0x124)],_0x438e88[_0x592d6d(0x159)][_0x592d6d(0x161)],0x0,0xa),{'verbose':_0x5cca3c[_0x592d6d(0x120)]}))[_0x592d6d(0x159)];let _0x53da3e=![];for(const _0x1ff699 of _0x5ee228){const _0x153a98=searchTreeByName(_0x3a9545,_0x1ff699)[_0x592d6d(0x154)](_0x28a662=>_0x28a662[_0x592d6d(0x121)]===_0x592d6d(0x13a)&&_0x28a662[_0x592d6d(0x152)][_0x592d6d(0x158)]()===_0x1ff699['toLowerCase']());if(_0x153a98[_0x592d6d(0x11a)]>0x1){_0x53da3e=!![],console[_0x592d6d(0x157)](a46_0x141047[_0x592d6d(0x14e)](_0x592d6d(0x168)+_0x1ff699+'\x27\x20matches\x20'+_0x153a98[_0x592d6d(0x11a)]+'\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:'));for(const _0x4ca2fa of _0x153a98)console[_0x592d6d(0x157)](_0x592d6d(0x146)+_0x4ca2fa[_0x592d6d(0x139)]+_0x592d6d(0x119)+_0x4ca2fa['id']+')');}else _0x153a98[_0x592d6d(0x11a)]===0x1&&(_0x53da3e=!![],console[_0x592d6d(0x157)](a46_0x141047[_0x592d6d(0x14e)]('Error:\x20\x27'+_0x1ff699+_0x592d6d(0x134))),console['error']('\x20\x20'+_0x153a98[0x0]['path']+_0x592d6d(0x119)+_0x153a98[0x0]['id']+')'),console[_0x592d6d(0x157)]('Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).'));}return _0x53da3e;}}
@@ -1 +1 @@
1
- const a46_0x395430=a46_0x56d4;function a46_0x56d4(_0x2747ee,_0x5eec81){_0x2747ee=_0x2747ee-0xd8;const _0x153d98=a46_0x153d();let _0x56d473=_0x153d98[_0x2747ee];return _0x56d473;}(function(_0x15480c,_0x16ed13){const _0x4241f4=a46_0x56d4,_0x42c03e=_0x15480c();while(!![]){try{const _0x248c36=-parseInt(_0x4241f4(0x11d))/0x1*(parseInt(_0x4241f4(0xf3))/0x2)+-parseInt(_0x4241f4(0x123))/0x3+-parseInt(_0x4241f4(0xe8))/0x4*(parseInt(_0x4241f4(0xed))/0x5)+-parseInt(_0x4241f4(0x126))/0x6+parseInt(_0x4241f4(0xf5))/0x7+parseInt(_0x4241f4(0x128))/0x8*(parseInt(_0x4241f4(0x11e))/0x9)+parseInt(_0x4241f4(0xe1))/0xa;if(_0x248c36===_0x16ed13)break;else _0x42c03e['push'](_0x42c03e['shift']());}catch(_0x53de3a){_0x42c03e['push'](_0x42c03e['shift']());}}}(a46_0x153d,0x9d864));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a46_0x153d(){const _0x3419e1=['yellow','Target\x20resource:\x20','Parent\x20segment:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aPull\x20summary\x20for\x20\x27','Error:\x20','Aborted.','\x20\x20🗺️\x20\x20','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','setPhase','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','description','length','site','-\x20no\x20files\x20written','segment:pull','activations','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20segments','relativePath','filter','error','verbose','journeys','isNew','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','segments','diff','helpText','843NFfJmk','282114eSmmjk','message','red','Write\x20','hasChanges','3570216khdVac','\x20new\x20files','parent_segment','5822904eISkPi','counts','112KncdTU','yes','dim','\x20files\x20to\x20','absolutePath','\x20files?','pullSegments','repeat','cwd','content','44363160bwcADw','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20activations','errorCode','\x20=\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','5564aZJAPF','\x20unchanged\x20files','Site:\x20','cyan','targetDir','4555wvsbuA','session','no_parent','utf-8','name','parentName','2922Wtlwls','✔\x20All\x20files\x20are\x20up\x20to\x20date','3006080ONKxrc','files','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pulling\x20segments\x20from\x20\x27','file','parentSegment','resourceName','✔\x20Pulled\x20','✔\x20Context\x20set:\x20'];a46_0x153d=function(){return _0x3419e1;};return a46_0x153d();}import a46_0x1d938c from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a46_0x1a6a59 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a46_0x395430(0xf1)]=a46_0x395430(0x10f);[a46_0x395430(0x10b)]=a46_0x395430(0x10a);async['execute'](_0x699754){const _0x5edc19=a46_0x395430,{options:_0x54586f,args:_0x47f709,tdx:_0x21a6f1}=_0x699754,_0x5db9a3=_0x54586f,_0x237f0d=await resolveTarget({'arg':_0x47f709[0x0],'contextParent':_0x54586f[_0x5edc19(0xfa)],'cwd':process[_0x5edc19(0xdf)]()});if(!isSuccessfulResolution(_0x237f0d))return _0x237f0d[_0x5edc19(0xe5)]===_0x5edc19(0xef)?(console[_0x5edc19(0x115)](a46_0x1d938c['yellow'](_0x5edc19(0x107))),console[_0x5edc19(0x115)](_0x5edc19(0x111)),console[_0x5edc19(0x115)](_0x5edc19(0xe3)),console[_0x5edc19(0x115)](_0x5edc19(0x108))):(console[_0x5edc19(0x115)](a46_0x1d938c[_0x5edc19(0x120)](_0x5edc19(0x103)+_0x237f0d[_0x5edc19(0x11f)]+'\x0a')),_0x237f0d[_0x5edc19(0x11c)]&&console[_0x5edc19(0x115)](a46_0x1d938c[_0x5edc19(0xeb)](_0x237f0d[_0x5edc19(0x11c)]))),0x1;const _0x2b227d=_0x237f0d[_0x5edc19(0xf2)],_0x222926=_0x237f0d[_0x5edc19(0xec)],_0x2b8e97=_0x237f0d[_0x5edc19(0xe2)]===_0x5edc19(0xf9)?_0x237f0d[_0x5edc19(0xfb)]:undefined;_0x5db9a3[_0x5edc19(0x116)]&&(console['error'](_0x5edc19(0xea)+_0x5db9a3[_0x5edc19(0x10d)]),console[_0x5edc19(0x115)](_0x5edc19(0x100)+_0x2b227d),_0x2b8e97&&console['error'](_0x5edc19(0xff)+_0x2b8e97));const _0x29cd3e=await withProgressSpinner(_0x5edc19(0xf8)+_0x2b227d+'\x27...',_0x140bd0=>_0x21a6f1['segment'][_0x5edc19(0xdd)](_0x2b227d,{'targetDir':_0x222926,'targetResourceName':_0x2b8e97,'verbose':_0x5db9a3['verbose'],'progress':{'update':_0x23d8b2=>{const _0x1b4434=_0x5edc19;_0x140bd0[_0x1b4434(0x109)](_0x23d8b2),_0x5db9a3[_0x1b4434(0x116)]&&console[_0x1b4434(0x115)]('\x20\x20'+_0x23d8b2);}}}),{'verbose':_0x5db9a3[_0x5edc19(0x116)]}),_0x508f7c=_0x29cd3e['data'];if(_0x508f7c[_0x5edc19(0x127)]['segments']===0x0&&_0x508f7c[_0x5edc19(0x127)]['journeys']===0x0)return console[_0x5edc19(0x115)](a46_0x1d938c[_0x5edc19(0xfe)](_0x5edc19(0x119)+_0x508f7c[_0x5edc19(0xf2)]+'\x27')),0x0;const _0xb1ced3=_0x508f7c[_0x5edc19(0xf6)][_0x5edc19(0x114)](_0x5d0d59=>_0x5d0d59['isNew']),_0x189492=_0x508f7c['files'][_0x5edc19(0x114)](_0x32b241=>!_0x32b241[_0x5edc19(0x118)]&&_0x32b241['hasChanges']),_0x3ce390=_0x508f7c[_0x5edc19(0xf6)]['filter'](_0x536a92=>!_0x536a92['isNew']&&!_0x536a92[_0x5edc19(0x122)]);console[_0x5edc19(0x115)](_0x5edc19(0x102)+_0x508f7c[_0x5edc19(0xf2)]+'\x27:'),console[_0x5edc19(0x115)]('\x20\x20🎯\x20'+a46_0x1d938c[_0x5edc19(0xeb)](_0x508f7c[_0x5edc19(0x127)][_0x5edc19(0x11a)]+_0x5edc19(0x112))+'\x20with\x20'+a46_0x1d938c[_0x5edc19(0xeb)](_0x508f7c[_0x5edc19(0x127)][_0x5edc19(0x110)]+_0x5edc19(0xe4)));if(_0x508f7c[_0x5edc19(0x127)][_0x5edc19(0x117)]>0x0){const _0x3662e5=_0x508f7c[_0x5edc19(0x127)]['journeyVersions']>_0x508f7c['counts'][_0x5edc19(0x117)]?'\x20('+_0x508f7c['counts']['journeyVersions']+'\x20versions)':'';console['error'](_0x5edc19(0x105)+a46_0x1d938c['cyan'](_0x508f7c[_0x5edc19(0x127)][_0x5edc19(0x117)]+'\x20journeys')+a46_0x1d938c[_0x5edc19(0xd9)](_0x3662e5));}console[_0x5edc19(0x115)]('\x20\x20'+a46_0x1d938c[_0x5edc19(0x106)]('+\x20'+_0xb1ced3[_0x5edc19(0x10c)]+_0x5edc19(0x124))),console['error']('\x20\x20'+a46_0x1d938c[_0x5edc19(0xfe)]('~\x20'+_0x189492[_0x5edc19(0x10c)]+'\x20changed\x20files')),console['error']('\x20\x20'+a46_0x1d938c[_0x5edc19(0xd9)]('=\x20'+_0x3ce390[_0x5edc19(0x10c)]+_0x5edc19(0xe9))),console[_0x5edc19(0x115)]('\x20\x20Target:\x20'+a46_0x1d938c[_0x5edc19(0xeb)](_0x508f7c[_0x5edc19(0xec)])+'\x0a');if(_0x189492[_0x5edc19(0x10c)]>0x0)for(const _0x59b8b6 of _0x189492){console[_0x5edc19(0x115)]('\x0aChanges\x20to\x20\x27'+_0x59b8b6[_0x5edc19(0x113)]+'\x27:'),console[_0x5edc19(0x115)]('─'[_0x5edc19(0xde)](0x3c)),console[_0x5edc19(0x115)](_0x59b8b6[_0x5edc19(0x11b)]),console[_0x5edc19(0x115)]('─'[_0x5edc19(0xde)](0x3c));}if(_0x5db9a3['dryRun'])return console['error'](a46_0x1d938c[_0x5edc19(0xfe)](_0x5edc19(0x101))),0x0;if(_0xb1ced3[_0x5edc19(0x10c)]===0x0&&_0x189492[_0x5edc19(0x10c)]===0x0)return console[_0x5edc19(0x115)](a46_0x1d938c[_0x5edc19(0x106)](_0x5edc19(0xf4))),saveSessionContext({'parent_segment':_0x508f7c[_0x5edc19(0xf2)]},_0x5db9a3['session']),console[_0x5edc19(0x115)](a46_0x1d938c['green'](_0x5edc19(0xfd)+a46_0x1d938c[_0x5edc19(0xd9)](_0x5edc19(0x125))+_0x5edc19(0xe6)+a46_0x1d938c[_0x5edc19(0xeb)](_0x508f7c[_0x5edc19(0xf2)]))),0x0;if(!_0x5db9a3[_0x5edc19(0xd8)]){if(!isInteractive())return console[_0x5edc19(0x115)](a46_0x1d938c[_0x5edc19(0x120)]('\x0aError:'),_0x5edc19(0xf7)),console[_0x5edc19(0x115)](a46_0x1d938c['dim'](_0x5edc19(0xe7))),0x1;const _0x7af07e=await confirmKey(_0x5edc19(0x121)+(_0xb1ced3['length']+_0x189492[_0x5edc19(0x10c)])+_0x5edc19(0xdc));if(!_0x7af07e)return console['error'](a46_0x1d938c[_0x5edc19(0xfe)](_0x5edc19(0x104)),_0x5edc19(0x10e)),0x1;}for(const _0xd23008 of _0x508f7c['files']){if(_0xd23008[_0x5edc19(0x118)]||_0xd23008['hasChanges']){const _0xd4b856=a46_0x1a6a59['dirname'](_0xd23008['absolutePath']);!existsSync(_0xd4b856)&&mkdirSync(_0xd4b856,{'recursive':!![]}),writeFileSync(_0xd23008[_0x5edc19(0xdb)],_0xd23008[_0x5edc19(0xe0)],_0x5edc19(0xf0));}}return console['error'](a46_0x1d938c[_0x5edc19(0x106)](_0x5edc19(0xfc)+(_0xb1ced3[_0x5edc19(0x10c)]+_0x189492[_0x5edc19(0x10c)])+_0x5edc19(0xda)+_0x508f7c[_0x5edc19(0xec)])),saveSessionContext({'parent_segment':_0x508f7c[_0x5edc19(0xf2)]},_0x5db9a3[_0x5edc19(0xee)]),console[_0x5edc19(0x115)](a46_0x1d938c['green']('✔\x20Context\x20set:\x20'+a46_0x1d938c['dim']('parent_segment')+_0x5edc19(0xe6)+a46_0x1d938c['cyan'](_0x508f7c['parentName']))),0x0;}}
1
+ const a47_0x4f11c7=a47_0x1dce;function a47_0x1dce(_0x9c9ff2,_0xb7ec7d){_0x9c9ff2=_0x9c9ff2-0x13d;const _0x20017d=a47_0x2001();let _0x1dce44=_0x20017d[_0x9c9ff2];return _0x1dce44;}(function(_0x300a75,_0x5f30ca){const _0x1118c0=a47_0x1dce,_0x317a18=_0x300a75();while(!![]){try{const _0x59f93e=parseInt(_0x1118c0(0x153))/0x1+-parseInt(_0x1118c0(0x179))/0x2+parseInt(_0x1118c0(0x156))/0x3+-parseInt(_0x1118c0(0x180))/0x4+-parseInt(_0x1118c0(0x171))/0x5+-parseInt(_0x1118c0(0x155))/0x6+parseInt(_0x1118c0(0x16e))/0x7*(parseInt(_0x1118c0(0x184))/0x8);if(_0x59f93e===_0x5f30ca)break;else _0x317a18['push'](_0x317a18['shift']());}catch(_0x19ae9f){_0x317a18['push'](_0x317a18['shift']());}}}(a47_0x2001,0x8e988));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a47_0x2001(){const _0x38ca77=['description','5204766qufKlu','2688057lutsub','\x20changed\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20files\x20to\x20','\x20files?','✔\x20Context\x20set:\x20','verbose','message','error','Site:\x20','dryRun','filter','\x20=\x20','\x20\x20🎯\x20','diff','\x20\x20🗺️\x20\x20','setPhase','\x20segments','\x0aError:','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20\x20Target:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aPull\x20summary\x20for\x20\x27','repeat','5353481KgVKWK','helpText','\x20journeys','2870255uTtzbz','site','\x27...','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parent_segment','\x20new\x20files','\x20activations','1014382xCTlPV','Write\x20','journeys','execute','targetDir','session','cyan','851976LRPgmB','Pulling\x20segments\x20from\x20\x27','absolutePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','16olABeF','✔\x20Pulled\x20','parentSegment','dim','\x0aChanges\x20to\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','name','red','hasChanges','counts','journeyVersions','length','type','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dirname','files','green','segment:pull','cwd','activations','data','\x20with\x20','no_parent','content','isNew','yellow','pullSegments','file','\x20unchanged\x20files','320184FGvlZt'];a47_0x2001=function(){return _0x38ca77;};return a47_0x2001();}import{saveSessionContext}from'../core/session.js';import a47_0x22d307 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a47_0x256d74 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a47_0x4f11c7(0x18a)]=a47_0x4f11c7(0x147);[a47_0x4f11c7(0x154)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a47_0x4f11c7(0x17c)](_0x138af6){const _0x6e8cc9=a47_0x4f11c7,{options:_0x263341,args:_0x33a513,tdx:_0x475789}=_0x138af6,_0x5d6fe1=_0x263341,_0x457f93=await resolveTarget({'arg':_0x33a513[0x0],'contextParent':_0x263341[_0x6e8cc9(0x186)],'cwd':process[_0x6e8cc9(0x148)]()});if(!isSuccessfulResolution(_0x457f93))return _0x457f93['errorCode']===_0x6e8cc9(0x14c)?(console[_0x6e8cc9(0x15e)](a47_0x22d307[_0x6e8cc9(0x14f)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x6e8cc9(0x15e)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x158)),console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x175))):(console[_0x6e8cc9(0x15e)](a47_0x22d307['red']('Error:\x20'+_0x457f93[_0x6e8cc9(0x15d)]+'\x0a')),_0x457f93[_0x6e8cc9(0x16f)]&&console['error'](a47_0x22d307[_0x6e8cc9(0x17f)](_0x457f93[_0x6e8cc9(0x16f)]))),0x1;const _0x137ac9=_0x457f93[_0x6e8cc9(0x174)],_0xf66c0e=_0x457f93[_0x6e8cc9(0x17d)],_0x1e70b4=_0x457f93[_0x6e8cc9(0x142)]===_0x6e8cc9(0x151)?_0x457f93['resourceName']:undefined;_0x5d6fe1[_0x6e8cc9(0x15c)]&&(console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x15f)+_0x5d6fe1[_0x6e8cc9(0x172)]),console[_0x6e8cc9(0x15e)]('Parent\x20segment:\x20'+_0x137ac9),_0x1e70b4&&console[_0x6e8cc9(0x15e)]('Target\x20resource:\x20'+_0x1e70b4));const _0x248bd7=await withProgressSpinner(_0x6e8cc9(0x181)+_0x137ac9+_0x6e8cc9(0x173),_0x60a0cb=>_0x475789['segment'][_0x6e8cc9(0x150)](_0x137ac9,{'targetDir':_0xf66c0e,'targetResourceName':_0x1e70b4,'verbose':_0x5d6fe1['verbose'],'progress':{'update':_0x103864=>{const _0x4f9e8c=_0x6e8cc9;_0x60a0cb[_0x4f9e8c(0x166)](_0x103864),_0x5d6fe1[_0x4f9e8c(0x15c)]&&console['error']('\x20\x20'+_0x103864);}}}),{'verbose':_0x5d6fe1[_0x6e8cc9(0x15c)]}),_0x49f35c=_0x248bd7[_0x6e8cc9(0x14a)];if(_0x49f35c[_0x6e8cc9(0x13f)]['segments']===0x0&&_0x49f35c[_0x6e8cc9(0x13f)][_0x6e8cc9(0x17b)]===0x0)return console[_0x6e8cc9(0x15e)](a47_0x22d307[_0x6e8cc9(0x14f)](_0x6e8cc9(0x169)+_0x49f35c[_0x6e8cc9(0x174)]+'\x27')),0x0;const _0x19f57f=_0x49f35c[_0x6e8cc9(0x145)][_0x6e8cc9(0x161)](_0x831000=>_0x831000[_0x6e8cc9(0x14e)]),_0x11212f=_0x49f35c[_0x6e8cc9(0x145)][_0x6e8cc9(0x161)](_0x105aa4=>!_0x105aa4['isNew']&&_0x105aa4['hasChanges']),_0x2110ac=_0x49f35c['files']['filter'](_0x1c6da9=>!_0x1c6da9[_0x6e8cc9(0x14e)]&&!_0x1c6da9[_0x6e8cc9(0x13e)]);console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x16c)+_0x49f35c['parentName']+'\x27:'),console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x163)+a47_0x22d307[_0x6e8cc9(0x17f)](_0x49f35c[_0x6e8cc9(0x13f)]['segments']+_0x6e8cc9(0x167))+_0x6e8cc9(0x14b)+a47_0x22d307[_0x6e8cc9(0x17f)](_0x49f35c[_0x6e8cc9(0x13f)][_0x6e8cc9(0x149)]+_0x6e8cc9(0x178)));if(_0x49f35c[_0x6e8cc9(0x13f)][_0x6e8cc9(0x17b)]>0x0){const _0x10ddf2=_0x49f35c[_0x6e8cc9(0x13f)][_0x6e8cc9(0x140)]>_0x49f35c[_0x6e8cc9(0x13f)][_0x6e8cc9(0x17b)]?'\x20('+_0x49f35c['counts'][_0x6e8cc9(0x140)]+'\x20versions)':'';console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x165)+a47_0x22d307[_0x6e8cc9(0x17f)](_0x49f35c[_0x6e8cc9(0x13f)]['journeys']+_0x6e8cc9(0x170))+a47_0x22d307[_0x6e8cc9(0x187)](_0x10ddf2));}console[_0x6e8cc9(0x15e)]('\x20\x20'+a47_0x22d307[_0x6e8cc9(0x146)]('+\x20'+_0x19f57f[_0x6e8cc9(0x141)]+_0x6e8cc9(0x177))),console['error']('\x20\x20'+a47_0x22d307[_0x6e8cc9(0x14f)]('~\x20'+_0x11212f[_0x6e8cc9(0x141)]+_0x6e8cc9(0x157))),console['error']('\x20\x20'+a47_0x22d307[_0x6e8cc9(0x187)]('=\x20'+_0x2110ac[_0x6e8cc9(0x141)]+_0x6e8cc9(0x152))),console['error'](_0x6e8cc9(0x16a)+a47_0x22d307['cyan'](_0x49f35c[_0x6e8cc9(0x17d)])+'\x0a');if(_0x11212f[_0x6e8cc9(0x141)]>0x0)for(const _0xd4dbbf of _0x11212f){console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x188)+_0xd4dbbf['relativePath']+'\x27:'),console[_0x6e8cc9(0x15e)]('─'[_0x6e8cc9(0x16d)](0x3c)),console[_0x6e8cc9(0x15e)](_0xd4dbbf[_0x6e8cc9(0x164)]),console[_0x6e8cc9(0x15e)]('─'['repeat'](0x3c));}if(_0x5d6fe1[_0x6e8cc9(0x160)])return console[_0x6e8cc9(0x15e)](a47_0x22d307['yellow'](_0x6e8cc9(0x183))),0x0;if(_0x19f57f[_0x6e8cc9(0x141)]===0x0&&_0x11212f[_0x6e8cc9(0x141)]===0x0)return console[_0x6e8cc9(0x15e)](a47_0x22d307[_0x6e8cc9(0x146)](_0x6e8cc9(0x189))),saveSessionContext({'parent_segment':_0x49f35c[_0x6e8cc9(0x174)]},_0x5d6fe1[_0x6e8cc9(0x17e)]),console['error'](a47_0x22d307['green'](_0x6e8cc9(0x15b)+a47_0x22d307[_0x6e8cc9(0x187)]('parent_segment')+_0x6e8cc9(0x162)+a47_0x22d307['cyan'](_0x49f35c[_0x6e8cc9(0x174)]))),0x0;if(!_0x5d6fe1['yes']){if(!isInteractive())return console[_0x6e8cc9(0x15e)](a47_0x22d307[_0x6e8cc9(0x13d)](_0x6e8cc9(0x168)),_0x6e8cc9(0x143)),console[_0x6e8cc9(0x15e)](a47_0x22d307['dim'](_0x6e8cc9(0x16b))),0x1;const _0x5f51f4=await confirmKey(_0x6e8cc9(0x17a)+(_0x19f57f['length']+_0x11212f['length'])+_0x6e8cc9(0x15a));if(!_0x5f51f4)return console['error'](a47_0x22d307[_0x6e8cc9(0x14f)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x41aa0f of _0x49f35c[_0x6e8cc9(0x145)]){if(_0x41aa0f['isNew']||_0x41aa0f[_0x6e8cc9(0x13e)]){const _0x79e110=a47_0x256d74[_0x6e8cc9(0x144)](_0x41aa0f['absolutePath']);!existsSync(_0x79e110)&&mkdirSync(_0x79e110,{'recursive':!![]}),writeFileSync(_0x41aa0f[_0x6e8cc9(0x182)],_0x41aa0f[_0x6e8cc9(0x14d)],'utf-8');}}return console['error'](a47_0x22d307[_0x6e8cc9(0x146)](_0x6e8cc9(0x185)+(_0x19f57f['length']+_0x11212f[_0x6e8cc9(0x141)])+_0x6e8cc9(0x159)+_0x49f35c['targetDir'])),saveSessionContext({'parent_segment':_0x49f35c[_0x6e8cc9(0x174)]},_0x5d6fe1[_0x6e8cc9(0x17e)]),console['error'](a47_0x22d307['green'](_0x6e8cc9(0x15b)+a47_0x22d307['dim'](_0x6e8cc9(0x176))+'\x20=\x20'+a47_0x22d307[_0x6e8cc9(0x17f)](_0x49f35c[_0x6e8cc9(0x174)]))),0x0;}}
@@ -1 +1 @@
1
- const a47_0x2652ae=a47_0xea6e;(function(_0x1cd4ba,_0x1b17a){const _0x38121c=a47_0xea6e,_0x269965=_0x1cd4ba();while(!![]){try{const _0x5686c5=-parseInt(_0x38121c(0x1b1))/0x1*(parseInt(_0x38121c(0x1d4))/0x2)+parseInt(_0x38121c(0x21c))/0x3*(parseInt(_0x38121c(0x1a1))/0x4)+parseInt(_0x38121c(0x21e))/0x5*(parseInt(_0x38121c(0x1c0))/0x6)+-parseInt(_0x38121c(0x22d))/0x7+-parseInt(_0x38121c(0x19b))/0x8*(parseInt(_0x38121c(0x1c7))/0x9)+parseInt(_0x38121c(0x227))/0xa+parseInt(_0x38121c(0x19e))/0xb;if(_0x5686c5===_0x1b17a)break;else _0x269965['push'](_0x269965['shift']());}catch(_0x566e1d){_0x269965['push'](_0x269965['shift']());}}}(a47_0x3d4f,0x8c047));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a47_0x864e50 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a47_0xea6e(_0x416310,_0x48e1f2){_0x416310=_0x416310-0x19b;const _0x3d4f90=a47_0x3d4f();let _0xea6e37=_0x3d4f90[_0x416310];return _0xea6e37;}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a47_0x3d4f(){const _0x3f0492=['journeys','\x20activations]','\x20\x20Source:\x20','12wSezEf','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','buildUserMaps','Folders\x20to\x20create:','new','add','createdAt','segment\x20or\x20journey','connection','existingSegment','user','name','.yml','created','errorCode','repeat','Error\x20parsing\x20YAML:\x20','push','filter','📁\x20','dryRun','versionNumber','.yaml','get','getOutputSchemaWithCache','unchanged','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parent_name','\x0a✔\x20Push\x20complete','Aborted.','length','No\x20','toDelete','activations','error','\x20created','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','cyan','all','\x20YAML\x20files\x20found','Changes\x20to\x20journey:','getJourney','journeysOnly','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','\x20\x20Journeys:\x20','existingJourney','type','Source\x20directory:\x20','results','deleted','listSegments','description','segmentFolderId','relationships','/sb/da/esr','green','isScoped','updatedAt','dim','Parent\x20segment:\x20','then','nameToId','attributes','resolveParentId','\x20\x20Segments:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20to\x20update','\x20\x20🗺️\x20\x20Journeys:','idToName','Delete\x20segment:','\x20deleted','verbose','849963ZMpNQR','\x0aError:','70kPNlvl','delete','data','\x20\x20📊\x20Segments:','yellow','blue','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','message','toUpdate','4221890vjClpX','state','parentName','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','segments','\x20updated','4410154SZeVdb','New\x20journey:','journey','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20changed','/j/da/je','red','getMetadataWithCache','Scoped\x20to\x20folder:\x20','segment:push','8SWyDwt','/app/ps/','Error:\x20Directory\x20not\x20found:\x20','8590703XcUehG','Fetching\x20existing\x20data...','set','12KajRMs','no_parent','parentSegment','updated','map','New\x20segment:','Site:\x20','Fetching\x20existing\x20activations...','\x20to\x20delete','\x20unchanged','changed','isNew','yamlConfig','\x20\x20\x20\x20','(Journey\x20will\x20be\x20deleted)','\x20new','118856HITnPP','\x20folders\x20to\x20create','journeyBundleName','setPhase','filePath','\x20\x20Activations:\x20','folderId','yes','diff','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','listJourneysWithDetailsFromParentSegment','file','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','folderPath','toCreate','339282POZlPl','targetDir','createdSegmentIds','journeyId','Push\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','scopedFolderPath','8353026FNrbrs','\x20changes?','Error:\x20','/e/','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','nameToType','segment','execute','site'];a47_0x3d4f=function(){return _0x3f0492;};return a47_0x3d4f();}export class SegmentPushCommand extends BaseCommand{[a47_0x2652ae(0x1df)]=a47_0x2652ae(0x236);[a47_0x2652ae(0x207)]=a47_0x2652ae(0x1ff);async[a47_0x2652ae(0x1cf)](_0x56cfa9){const _0x452f23=a47_0x2652ae,{options:_0x475126,args:_0x4c6d97,tdx:_0x25328a}=_0x56cfa9,_0x4da06f=_0x475126,_0x32b5ec=await resolveTarget({'arg':_0x4c6d97[0x0],'contextParent':_0x475126[_0x452f23(0x1a3)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x32b5ec))return _0x32b5ec[_0x452f23(0x1e2)]===_0x452f23(0x1a2)?(console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x222)](_0x452f23(0x1f8))),console[_0x452f23(0x1f6)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x452f23(0x1f6)](_0x452f23(0x1cc)),console[_0x452f23(0x1f6)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x1c9)+_0x32b5ec['message']+'\x0a')),_0x32b5ec['helpText']&&console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x1f9)](_0x32b5ec['helpText']))),0x1;if(_0x32b5ec[_0x452f23(0x202)]===_0x452f23(0x1ef))return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x19d)+_0x32b5ec[_0x452f23(0x1c1)]+'\x0a')),console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x1f9)](_0x452f23(0x215))),0x1;const _0xb734c6=_0x32b5ec[_0x452f23(0x229)],_0x865458=_0x32b5ec[_0x452f23(0x1c1)],_0x15d1ab=_0x32b5ec[_0x452f23(0x202)]===_0x452f23(0x1bc)?_0x32b5ec[_0x452f23(0x1b5)]:undefined,_0x3304b5=getScopedDetails(_0x32b5ec),_0x484dac=_0x3304b5?.[_0x452f23(0x20c)]??![],_0x55ce74=_0x3304b5?.[_0x452f23(0x1c6)]??'';if(!existsSync(_0x865458))return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x19d)+_0x865458+'\x0a')),console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x1f9)](_0x452f23(0x215))),0x1;_0x4da06f[_0x452f23(0x21b)]&&(console['error'](_0x452f23(0x1a7)+_0x4da06f[_0x452f23(0x1d0)]),console['error'](_0x452f23(0x20f)+_0xb734c6),console['error'](_0x452f23(0x203)+_0x865458),_0x484dac&&console[_0x452f23(0x1f6)](_0x452f23(0x235)+_0x55ce74));const _0x564df3=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xb734c6+'\x27...',()=>_0x25328a[_0x452f23(0x1ce)][_0x452f23(0x213)](_0xb734c6),{'verbose':_0x4da06f[_0x452f23(0x21b)]}),_0x3f9a71=_0x564df3[_0x452f23(0x220)],{parentSegmentResult:_0x3f1cdb,segmentsResult:_0x34641b,foldersResult:_0x6e1e5d,journeysWithDetailsResult:_0x5e8c76,userMaps:_0x4fc993}=await withSpinner(_0x452f23(0x19f),async()=>{const _0x42f949=_0x452f23,[_0x2bcbf3,_0x1fea15,_0x2bb5bc,_0x3a5ee5,_0x59eb6c]=await Promise[_0x42f949(0x1fa)]([_0x25328a[_0x42f949(0x1ce)]['getParent'](_0x3f9a71),_0x25328a[_0x42f949(0x1ce)][_0x42f949(0x206)](_0x3f9a71),_0x25328a[_0x42f949(0x1ce)]['listFolders'](_0x3f9a71),_0x25328a['journey'][_0x42f949(0x1bb)](_0x3f9a71,{'includeAllVersions':!![]}),_0x25328a[_0x42f949(0x1de)][_0x42f949(0x1d6)]()]);return{'parentSegmentResult':_0x2bcbf3,'segmentsResult':_0x1fea15,'foldersResult':_0x2bb5bc,'journeysWithDetailsResult':_0x3a5ee5,'userMaps':_0x59eb6c};},{'verbose':_0x4da06f['verbose']})[_0x452f23(0x210)](_0x476165=>_0x476165[_0x452f23(0x220)]),_0x39ab15=_0x3f1cdb,_0x2ffaf5=extractRootFolderId(_0x39ab15),_0x5b2e02=_0x34641b,_0x1a2404=_0x6e1e5d,{journeys:_0x1b0fb9,activationStepsById:_0x4fcc92}=_0x5e8c76,_0x1805ff=new Map(_0x1b0fb9[_0x452f23(0x1a5)](_0x635dbc=>[_0x635dbc['id'],_0x635dbc])),_0x129248=_0x1b0fb9[_0x452f23(0x1a5)](_0x2d3045=>({'id':_0x2d3045['id'],'name':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x1df)],'journeyBundleName':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x1b3)]||'','journeyBundleId':_0x2d3045[_0x452f23(0x212)]['journeyBundleId']||'','versionNumber':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x1e9)],'description':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x207)],'state':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x228)],'paused':_0x2d3045[_0x452f23(0x212)]['paused'],'audienceId':_0x2d3045[_0x452f23(0x212)]['audienceId'],'folderId':_0x2d3045[_0x452f23(0x209)]?.['parentFolder']?.['data']?.['id'],'createdAt':_0x2d3045['attributes'][_0x452f23(0x1da)],'updatedAt':_0x2d3045[_0x452f23(0x212)][_0x452f23(0x20d)]})),{emailToId:_0x562c00,idToEmail:_0x189ee2}=_0x4fc993,_0x3a4d64=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x1c1452=await _0x25328a['connection']['list']();return buildConnectionMaps(_0x1c1452);},{'verbose':_0x4da06f[_0x452f23(0x21b)]})['then'](_0x26feb4=>_0x26feb4[_0x452f23(0x220)]),_0x37a6b8=_0x3a4d64[_0x452f23(0x211)],_0x31257c=_0x3a4d64[_0x452f23(0x218)],_0x44263=_0x3a4d64[_0x452f23(0x1cd)],_0x2370e7={'emailToIdMap':_0x562c00,'connectionNameToIdMap':_0x37a6b8,'connectionNameToTypeMap':_0x44263,'getSchema':_0x7b48a3=>_0x25328a[_0x452f23(0x1dc)][_0x452f23(0x1ec)](_0x7b48a3),'getMetadata':_0x1a8fb6=>_0x25328a[_0x452f23(0x1dc)][_0x452f23(0x234)](_0x1a8fb6)};let {pathToId:_0x167a65,idToPath:_0x342dff}=buildFolderMaps(_0x1a2404);const _0x43f10b=buildSegmentLookupMap(_0x5b2e02,_0x342dff),_0x532707=buildSegmentNameToIdMap(_0x5b2e02),_0x1d6760=buildJourneyBundleLookupMap(_0x129248,_0x342dff);let _0x22ad01;if(_0x15d1ab){if(!_0x15d1ab['endsWith'](_0x452f23(0x1e0))&&!_0x15d1ab['endsWith'](_0x452f23(0x1ea)))return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x224)+_0x15d1ab+'\x0a')),0x1;_0x22ad01=[_0x15d1ab];}else _0x22ad01=findYamlFiles(_0x865458);if(_0x22ad01['length']===0x0)return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x230)+_0x865458+'\x0a')),console['error'](a47_0x864e50[_0x452f23(0x1f9)](_0x452f23(0x1cb))),0x1;let _0x21cd86,_0x8eeca4;try{const _0x5db837=parseAndClassifyYamlFiles(_0x22ad01,_0x865458,{'skipSegments':_0x4da06f['journeysOnly']});_0x21cd86=_0x5db837['segments'],_0x8eeca4=_0x5db837[_0x452f23(0x1d1)];const _0x192612=validateParsedFiles(_0x5db837,_0x865458);if(_0x192612[_0x452f23(0x1f2)]>0x0)return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)]('\x0aValidation\x20failed:')),console[_0x452f23(0x1f6)](formatValidationErrors(_0x192612)),console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x222)](_0x452f23(0x1bd))),0x1;}catch(_0x187f40){return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x1e4)+(_0x187f40 instanceof Error?_0x187f40[_0x452f23(0x225)]:_0x187f40))),0x1;}if(_0x21cd86[_0x452f23(0x1f2)]===0x0&&_0x8eeca4[_0x452f23(0x1f2)]===0x0){const _0xcd61fd=_0x4da06f[_0x452f23(0x1fe)]?_0x452f23(0x22f):_0x452f23(0x1db);return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x222)](_0x452f23(0x1f3)+_0xcd61fd+_0x452f23(0x1fb))),0x0;}const _0x57bf15=new Map();_0x5b2e02['length']>0x0&&!_0x4da06f[_0x452f23(0x1fe)]&&await withSpinner(_0x452f23(0x1a8),async()=>{await batchAsync(_0x5b2e02,async _0x28e148=>{const _0x1a493a=a47_0xea6e,_0x18c4e9=await _0x25328a['segment']['listActivations'](_0x3f9a71,_0x28e148['id']);_0x57bf15[_0x1a493a(0x1a0)](_0x28e148['id'],_0x18c4e9);});},{'verbose':_0x4da06f['verbose']});const {segmentFiles:_0x39ea67,foldersToCreate:_0x38a63c}=await prepareSegmentFiles(_0x21cd86,{'segmentByFolderAndName':_0x43f10b,'activationsBySegmentId':_0x57bf15,'folderPathToId':_0x167a65,'idToEmailMap':_0x189ee2,'connectionIdToNameMap':_0x31257c},_0x2370e7,_0x484dac,_0x55ce74),_0x49ce5d=_0x15d1ab?[]:findSegmentsToDelete(_0x5b2e02,_0x21cd86[_0x452f23(0x1a5)](({yamlConfig:_0xf8a24c,folderPath:_0x2a306a})=>({'yamlConfig':_0xf8a24c,'folderPath':resolveTDFolderPath(_0x2a306a,_0x484dac,_0x55ce74)})),_0x342dff,_0x55ce74,_0x484dac),{journeyFiles:_0x25bc55,foldersToCreate:_0x56a13b}=await withProgressSpinner('Preparing\x20journeys...',async _0xb57dcb=>prepareJourneyFiles(_0x8eeca4,{'fetchJourney':async _0x38a2a8=>_0x25328a[_0x452f23(0x22f)][_0x452f23(0x1fd)](_0x38a2a8[_0x452f23(0x1c3)]),'journeyBundlesByFolderAndName':_0x1d6760,'folderPathToId':_0x167a65,'idToEmailMap':_0x189ee2,'connectionIdToNameMap':_0x31257c,'existingSegments':_0x5b2e02,'parentId':_0x3f9a71,'deps':_0x25328a,'progress':{'update':_0x29a05d=>{const _0x38ab53=_0x452f23;_0xb57dcb[_0x38ab53(0x1b4)](_0x29a05d),_0x4da06f[_0x38ab53(0x21b)]&&console[_0x38ab53(0x1f6)]('\x20\x20'+_0x29a05d);}},'journeyById':_0x1805ff,'activationStepsById':_0x4fcc92},_0x484dac,_0x55ce74),{'verbose':_0x4da06f[_0x452f23(0x21b)]})['then'](_0x5b082d=>_0x5b082d[_0x452f23(0x220)]);for(const _0x5769e5 of _0x56a13b){_0x38a63c[_0x452f23(0x1d9)](_0x5769e5);}const _0xc0235c=_0x15d1ab?[]:findJourneysToDelete(_0x129248,_0x8eeca4[_0x452f23(0x1a5)](({yamlConfig:_0x40911b,folderPath:_0x53d20b})=>({'yamlConfig':_0x40911b,'folderPath':resolveTDFolderPath(_0x53d20b,_0x484dac,_0x55ce74)})),_0x342dff,_0x55ce74,_0x484dac),_0x2c3bff=calculatePushStats(_0x39ea67,_0x25bc55,_0x38a63c,_0x49ce5d,_0xc0235c,!!_0x4da06f[_0x452f23(0x21f)],!!_0x4da06f[_0x452f23(0x1fe)]),_0x39ab1e=_0x2c3bff[_0x452f23(0x22b)][_0x452f23(0x1d8)],_0x27a9c6=_0x2c3bff[_0x452f23(0x22b)]['changed'],_0x25387a=_0x2c3bff[_0x452f23(0x22b)][_0x452f23(0x1ed)],_0x10aef2=_0x2c3bff[_0x452f23(0x22b)][_0x452f23(0x1f4)],_0x5143c6=_0x2c3bff['folders'][_0x452f23(0x1bf)],_0x5cdd7a=_0x2c3bff['journeys'][_0x452f23(0x1d8)],_0x11635d=_0x2c3bff[_0x452f23(0x1d1)][_0x452f23(0x1ab)],_0x23b1b7=_0x2c3bff[_0x452f23(0x1d1)]['unchanged'],_0xc7f869=_0x2c3bff[_0x452f23(0x1d1)]['toDelete'],_0x208d82=_0x2c3bff['activations']['all'],_0x238e17=_0x2c3bff[_0x452f23(0x1f5)][_0x452f23(0x1bf)],_0x153fdd=_0x2c3bff[_0x452f23(0x1f5)][_0x452f23(0x226)],_0x39f893=_0x2c3bff[_0x452f23(0x1f5)]['toDelete'];console[_0x452f23(0x1f6)]('\x0aPush\x20summary\x20for\x20\x27'+_0xb734c6+'\x27:');_0x5143c6[_0x452f23(0x1f2)]>0x0&&console[_0x452f23(0x1f6)]('\x20\x20'+a47_0x864e50[_0x452f23(0x223)](_0x452f23(0x1e7)+_0x5143c6['length']+_0x452f23(0x1b2)));if(!_0x4da06f[_0x452f23(0x1fe)]){console[_0x452f23(0x1f6)](_0x452f23(0x221)),console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x20b)]('+\x20'+_0x39ab1e[_0x452f23(0x1f2)]+_0x452f23(0x1b0))),console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x222)]('~\x20'+_0x27a9c6[_0x452f23(0x1f2)]+_0x452f23(0x231)));if(_0x10aef2[_0x452f23(0x1f2)]>0x0)console[_0x452f23(0x1f6)]('\x20\x20\x20\x20'+a47_0x864e50[_0x452f23(0x233)]('-\x20'+_0x10aef2['length']+_0x452f23(0x1a9)));else _0x49ce5d['length']>0x0&&!_0x4da06f[_0x452f23(0x21f)]&&console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x20e)](_0x49ce5d[_0x452f23(0x1f2)]+_0x452f23(0x1ba)));console[_0x452f23(0x1f6)]('\x20\x20\x20\x20'+a47_0x864e50[_0x452f23(0x20e)]('=\x20'+_0x25387a[_0x452f23(0x1f2)]+_0x452f23(0x1aa)));}if(_0x25bc55[_0x452f23(0x1f2)]>0x0||_0xc0235c[_0x452f23(0x1f2)]>0x0){console[_0x452f23(0x1f6)](_0x452f23(0x217)),console['error'](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x20b)]('+\x20'+_0x5cdd7a[_0x452f23(0x1f2)]+'\x20new')),console[_0x452f23(0x1f6)]('\x20\x20\x20\x20'+a47_0x864e50[_0x452f23(0x222)]('~\x20'+_0x11635d[_0x452f23(0x1f2)]+_0x452f23(0x231)));if(_0xc7f869[_0x452f23(0x1f2)]>0x0)console['error'](_0x452f23(0x1ae)+a47_0x864e50['red']('-\x20'+_0xc7f869[_0x452f23(0x1f2)]+_0x452f23(0x1a9)));else _0xc0235c[_0x452f23(0x1f2)]>0x0&&!_0x4da06f[_0x452f23(0x21f)]&&console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x20e)](_0xc0235c[_0x452f23(0x1f2)]+_0x452f23(0x1ba)));console[_0x452f23(0x1f6)]('\x20\x20\x20\x20'+a47_0x864e50[_0x452f23(0x20e)]('=\x20'+_0x23b1b7[_0x452f23(0x1f2)]+'\x20unchanged'));}_0x208d82[_0x452f23(0x1f2)]>0x0&&!_0x4da06f['journeysOnly']&&(console[_0x452f23(0x1f6)](''),console[_0x452f23(0x1f6)]('\x20\x20Activations:'),_0x238e17[_0x452f23(0x1f2)]>0x0&&console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50['green']('+\x20'+_0x238e17[_0x452f23(0x1f2)]+'\x20to\x20create')),_0x153fdd[_0x452f23(0x1f2)]>0x0&&console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x222)]('~\x20'+_0x153fdd['length']+_0x452f23(0x216))),_0x39f893[_0x452f23(0x1f2)]>0x0&&console[_0x452f23(0x1f6)](_0x452f23(0x1ae)+a47_0x864e50[_0x452f23(0x233)]('-\x20'+_0x39f893[_0x452f23(0x1f2)]+_0x452f23(0x1a9))));console['error'](_0x452f23(0x1d3)+a47_0x864e50[_0x452f23(0x1f9)](_0x865458)+'\x0a');if(_0x5143c6[_0x452f23(0x1f2)]>0x0){console['error'](_0x452f23(0x1d7));for(const _0x5ab06c of _0x5143c6){console[_0x452f23(0x1f6)]('\x20\x20'+a47_0x864e50[_0x452f23(0x223)]('+')+'\x20'+_0x5ab06c);}console['error']('');}if(_0x39ab1e[_0x452f23(0x1f2)]>0x0&&!_0x4da06f[_0x452f23(0x1fe)])for(const _0x4fbb05 of _0x39ab1e){const _0x4f169b=_0x4fbb05[_0x452f23(0x1be)]?_0x4fbb05[_0x452f23(0x1be)]+'/'+_0x4fbb05['yamlConfig'][_0x452f23(0x1df)]:_0x4fbb05[_0x452f23(0x1ad)][_0x452f23(0x1df)],_0x3e868b=_0x4fbb05[_0x452f23(0x1ad)][_0x452f23(0x1f5)]?.[_0x452f23(0x1f2)]||0x0,_0x3c6c5b=_0x3e868b>0x0?a47_0x864e50['dim']('\x20['+_0x3e868b+_0x452f23(0x1d2)):'';console['error']('\x0a'+a47_0x864e50[_0x452f23(0x20b)](_0x452f23(0x1a6))+'\x20'+_0x4f169b+_0x3c6c5b),console['error']('─'[_0x452f23(0x1e3)](0x3c)),_0x4fbb05[_0x452f23(0x1b9)]&&console[_0x452f23(0x1f6)](_0x4fbb05[_0x452f23(0x1b9)]),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c));}if(_0x10aef2[_0x452f23(0x1f2)]>0x0&&!_0x4da06f[_0x452f23(0x1fe)])for(const _0x4f13e9 of _0x10aef2){const _0x3bba0d=_0x4f13e9[_0x452f23(0x208)]?_0x342dff['get'](_0x4f13e9[_0x452f23(0x208)]['toString']())||'':'',_0x2271a6=_0x3bba0d?_0x3bba0d+'/'+_0x4f13e9[_0x452f23(0x1df)]:_0x4f13e9[_0x452f23(0x1df)],_0x4b227c=_0x57bf15[_0x452f23(0x1eb)](_0x4f13e9['id'])||[],_0x53e946=_0x4b227c[_0x452f23(0x1f2)]>0x0?a47_0x864e50[_0x452f23(0x20e)]('\x20['+_0x4b227c[_0x452f23(0x1f2)]+_0x452f23(0x1d2)):'';console[_0x452f23(0x1f6)]('\x0a'+a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x219))+'\x20'+_0x2271a6+_0x53e946),console['error']('─'[_0x452f23(0x1e3)](0x3c));const _0x9bc2ba=segmentWithActivationsToYaml(_0x4f13e9,_0x4b227c,undefined,_0x189ee2,_0x31257c),_0x23afa4=segmentToYamlString(_0x9bc2ba),_0x5134c0=generateDiff(_0x23afa4,'');console['error'](formatDiffWithColors(_0x5134c0)),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c));}const _0x4fa6bf=_0x39ea67[_0x452f23(0x1e6)](_0xd488df=>!_0xd488df['isNew']&&_0xd488df[_0x452f23(0x1b9)]);if(_0x4fa6bf[_0x452f23(0x1f2)]>0x0&&!_0x4da06f[_0x452f23(0x1fe)])for(const _0x81a76a of _0x4fa6bf){const _0x1e17a0=_0x81a76a[_0x452f23(0x1be)]?_0x81a76a[_0x452f23(0x1be)]+'/'+_0x81a76a[_0x452f23(0x1ad)][_0x452f23(0x1df)]:_0x81a76a['yamlConfig'][_0x452f23(0x1df)];console[_0x452f23(0x1f6)]('\x0a'+a47_0x864e50[_0x452f23(0x222)]('Changes\x20to:')+'\x20'+_0x1e17a0),console[_0x452f23(0x1f6)]('─'['repeat'](0x3c)),console[_0x452f23(0x1f6)](_0x81a76a[_0x452f23(0x1b9)]),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c));}if(_0x5cdd7a[_0x452f23(0x1f2)]>0x0)for(const _0x1cc830 of _0x5cdd7a){const _0x425015=_0x1cc830[_0x452f23(0x1be)]?_0x1cc830[_0x452f23(0x1be)]+'/'+_0x1cc830[_0x452f23(0x1ad)][_0x452f23(0x1df)]:_0x1cc830[_0x452f23(0x1ad)][_0x452f23(0x1df)];console[_0x452f23(0x1f6)]('\x0a'+a47_0x864e50[_0x452f23(0x20b)](_0x452f23(0x22e))+'\x20'+_0x425015),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c)),_0x1cc830['diff']&&console[_0x452f23(0x1f6)](_0x1cc830['diff']),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c));}const _0x2a1bb0=_0x25bc55[_0x452f23(0x1e6)](_0x47de36=>!_0x47de36[_0x452f23(0x1ac)]&&_0x47de36[_0x452f23(0x1b9)]);if(_0x2a1bb0[_0x452f23(0x1f2)]>0x0)for(const _0x57938b of _0x2a1bb0){const _0x2d0f26=_0x57938b[_0x452f23(0x1be)]?_0x57938b[_0x452f23(0x1be)]+'/'+_0x57938b[_0x452f23(0x1ad)][_0x452f23(0x1df)]:_0x57938b['yamlConfig'][_0x452f23(0x1df)];console[_0x452f23(0x1f6)]('\x0a'+a47_0x864e50[_0x452f23(0x222)](_0x452f23(0x1fc))+'\x20'+_0x2d0f26),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c)),console[_0x452f23(0x1f6)](_0x57938b['diff']),console['error']('─'[_0x452f23(0x1e3)](0x3c));}if(_0xc7f869[_0x452f23(0x1f2)]>0x0)for(const _0x75ff5a of _0xc7f869){const _0x483861=_0x75ff5a[_0x452f23(0x1b7)]?_0x342dff[_0x452f23(0x1eb)](_0x75ff5a[_0x452f23(0x1b7)])||'':'',_0x19626c=_0x483861?_0x483861+'/'+_0x75ff5a[_0x452f23(0x1b3)]:_0x75ff5a[_0x452f23(0x1b3)];console[_0x452f23(0x1f6)]('\x0a'+a47_0x864e50[_0x452f23(0x233)]('Delete\x20journey:')+'\x20'+_0x19626c),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c)),console[_0x452f23(0x1f6)](a47_0x864e50['red'](_0x452f23(0x1af))),console[_0x452f23(0x1f6)]('─'[_0x452f23(0x1e3)](0x3c));}if(_0x4da06f[_0x452f23(0x1e8)])return console['error'](a47_0x864e50[_0x452f23(0x222)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x6ca18e=_0x4da06f['journeysOnly']?![]:_0x39ab1e[_0x452f23(0x1f2)]>0x0||_0x27a9c6[_0x452f23(0x1f2)]>0x0||_0x10aef2['length']>0x0,_0x34b914=_0x5cdd7a[_0x452f23(0x1f2)]>0x0||_0x11635d[_0x452f23(0x1f2)]>0x0||_0xc7f869[_0x452f23(0x1f2)]>0x0,_0x7f9f57=_0x4da06f['journeysOnly']?![]:_0x208d82['length']>0x0,_0x145eb4=_0x5143c6['length']>0x0;if(!_0x6ca18e&&!_0x34b914&&!_0x7f9f57&&!_0x145eb4){const _0x471a8f=_0x4da06f[_0x452f23(0x1fe)]?_0x452f23(0x1d5):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a47_0x864e50[_0x452f23(0x20b)](_0x471a8f));if(_0x15d1ab&&_0x25387a[_0x452f23(0x1f2)]===0x1){const _0x3f1ad0=_0x25387a[0x0];if(_0x3f1ad0[_0x452f23(0x1dd)]?.['id']){const _0x56c2ac=getConsoleNextUrl(_0x4da06f[_0x452f23(0x1d0)],_0x452f23(0x19c)+_0x3f9a71+'/e/'+_0x3f1ad0[_0x452f23(0x1dd)]['id']+_0x452f23(0x20a));console['error'](_0x452f23(0x22a)+a47_0x864e50['cyan'](_0x56c2ac));}}if(_0x15d1ab&&_0x23b1b7[_0x452f23(0x1f2)]===0x1){const _0x12c7ee=_0x23b1b7[0x0];if(_0x12c7ee[_0x452f23(0x201)]?.['id']){const _0x28ffb3=getConsoleNextUrl(_0x4da06f['site'],_0x452f23(0x19c)+_0x3f9a71+_0x452f23(0x1ca)+_0x12c7ee[_0x452f23(0x201)]['id']+'/j/da/je');console[_0x452f23(0x1f6)]('\x20\x20'+a47_0x864e50[_0x452f23(0x1f9)](_0x28ffb3));}}return 0x0;}const _0x5a046a=_0x4da06f[_0x452f23(0x1fe)]?_0x5cdd7a['length']+_0x11635d[_0x452f23(0x1f2)]+_0xc7f869[_0x452f23(0x1f2)]+_0x5143c6['length']:_0x39ab1e[_0x452f23(0x1f2)]+_0x27a9c6['length']+_0x10aef2['length']+_0x5cdd7a[_0x452f23(0x1f2)]+_0x11635d['length']+_0xc7f869['length']+_0x5143c6[_0x452f23(0x1f2)]+_0x208d82[_0x452f23(0x1f2)];if(!_0x4da06f[_0x452f23(0x1b8)]&&_0x5a046a>0x0){if(!isInteractive())return console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)](_0x452f23(0x21d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x452f23(0x1f6)](a47_0x864e50['dim'](_0x452f23(0x1ee))),0x1;const _0x14b300=await confirmKey(_0x452f23(0x1c4)+_0x5a046a+_0x452f23(0x1c8));if(!_0x14b300)return console[_0x452f23(0x1f6)](a47_0x864e50['yellow'](_0x452f23(0x1f1))),0x1;}const _0xbf98df={'withProgress':async(_0x4e1a33,_0x48166d)=>{const _0x560133=_0x452f23,_0x513580=await withSpinner(_0x4e1a33,_0x48166d,{'verbose':_0x4da06f[_0x560133(0x21b)]});return{'data':_0x513580[_0x560133(0x220)]};},'logInfo':_0x4ad993=>console['error'](a47_0x864e50[_0x452f23(0x223)]('✔\x20'+_0x4ad993)),'logSuccess':_0x474dc1=>console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x20b)]('✔\x20'+_0x474dc1)),'logWarning':_0x5a38bf=>console['error'](a47_0x864e50[_0x452f23(0x222)]('⚠\x20'+_0x5a38bf)),'logDeleted':_0x10a4b9=>console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x233)]('✔\x20'+_0x10a4b9))},_0x6d09d={'segment':_0x25328a['segment'],'journey':_0x25328a[_0x452f23(0x22f)],'user':_0x25328a[_0x452f23(0x1de)],'connection':_0x25328a[_0x452f23(0x1dc)]};_0x5143c6['length']>0x0&&(_0x167a65=await executePushFolders(_0x6d09d,_0x5143c6,_0x167a65,{'parentId':_0x3f9a71},_0xbf98df));const _0x10df20={'rootFolderId':_0x2ffaf5,'folderPathToId':_0x167a65,'folderIdToPath':_0x342dff,'segmentNameToId':_0x532707,'activationsBySegmentId':_0x57bf15,'emailToIdMap':_0x562c00,'idToEmailMap':_0x189ee2,'connectionNameToIdMap':_0x3a4d64[_0x452f23(0x211)],'connectionIdToNameMap':_0x3a4d64[_0x452f23(0x218)],'connectionNameToTypeMap':_0x44263},_0x3ad1c2=await executePushSegments(_0x6d09d,_0x4da06f[_0x452f23(0x1fe)]?[]:_0x39ea67,_0x10df20,{'parentId':_0x3f9a71},_0xbf98df),_0x1837d1=_0x3ad1c2['created'],_0x5e17f8=_0x3ad1c2[_0x452f23(0x1a4)],_0x71b9d2=_0x3ad1c2[_0x452f23(0x1f5)]['created'],_0x5733a1=_0x3ad1c2[_0x452f23(0x1f5)][_0x452f23(0x1a4)],_0x2d57e6=_0x3ad1c2[_0x452f23(0x1f5)][_0x452f23(0x205)];let _0x3eb6cd;if(_0x15d1ab&&_0x39ea67[_0x452f23(0x1f2)]===0x1){const _0x2ed397=_0x39ea67[0x0];_0x3eb6cd=_0x2ed397[_0x452f23(0x1dd)]?.['id']??_0x3ad1c2[_0x452f23(0x1c2)]['get'](_0x2ed397[_0x452f23(0x1ad)][_0x452f23(0x1df)]);}const _0xb867da=await executePushSegmentDeletions(_0x6d09d,_0x4da06f[_0x452f23(0x1fe)]?[]:_0x10aef2,_0xbf98df);let _0x336e6e=0x0,_0x5f13a5=0x0,_0xe2c6c6=0x0;const _0x57bef1=new Map(_0x532707);for(const [_0x21984e,_0x28a5bd]of _0x3ad1c2[_0x452f23(0x1c2)]){_0x57bef1[_0x452f23(0x1a0)](_0x21984e,_0x28a5bd);}if(_0x25bc55[_0x452f23(0x1f2)]>0x0){const _0x41da32={..._0x10df20,'segmentNameToId':_0x57bef1,'existingSegments':_0x5b2e02,'activationContext':_0x2370e7},_0x22020b=await executePushJourneys(_0x6d09d,_0x25bc55,_0x41da32,{'parentId':_0x3f9a71,'rootFolderId':_0x2ffaf5,'verbose':_0x4da06f[_0x452f23(0x21b)]},_0xbf98df);_0x336e6e=_0x22020b[_0x452f23(0x1e1)],_0x5f13a5=_0x22020b[_0x452f23(0x1a4)];if(_0x15d1ab&&_0x22020b['results'][_0x452f23(0x1f2)]===0x1){const _0x2d719c=_0x22020b[_0x452f23(0x204)][0x0];if(_0x2d719c[_0x452f23(0x1c3)]){const _0x21c9a9=getConsoleNextUrl(_0x4da06f['site'],_0x452f23(0x19c)+_0x3f9a71+'/e/'+_0x2d719c['journeyId']+_0x452f23(0x232));console['error']('\x20\x20'+a47_0x864e50[_0x452f23(0x1f9)](_0x21c9a9));}}}for(const _0x1c5566 of _0xc7f869){console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x222)](_0x452f23(0x1c5)+_0x1c5566[_0x452f23(0x1b3)])),_0xe2c6c6++;}const _0x2b94c2=[];if(_0x1837d1>0x0)_0x2b94c2[_0x452f23(0x1e5)](_0x1837d1+_0x452f23(0x1f7));if(_0x5e17f8>0x0)_0x2b94c2[_0x452f23(0x1e5)](_0x5e17f8+'\x20updated');if(_0xb867da>0x0)_0x2b94c2[_0x452f23(0x1e5)](_0xb867da+'\x20deleted');const _0x439e58=[];if(_0x336e6e>0x0)_0x439e58[_0x452f23(0x1e5)](_0x336e6e+'\x20created');if(_0x5f13a5>0x0)_0x439e58[_0x452f23(0x1e5)](_0x5f13a5+_0x452f23(0x22c));if(_0xe2c6c6>0x0)_0x439e58[_0x452f23(0x1e5)](_0xe2c6c6+'\x20deleted');const _0xd547a2=[];if(_0x71b9d2>0x0)_0xd547a2[_0x452f23(0x1e5)](_0x71b9d2+'\x20created');if(_0x5733a1>0x0)_0xd547a2[_0x452f23(0x1e5)](_0x5733a1+_0x452f23(0x22c));if(_0x2d57e6>0x0)_0xd547a2[_0x452f23(0x1e5)](_0x2d57e6+_0x452f23(0x21a));console[_0x452f23(0x1f6)](a47_0x864e50[_0x452f23(0x20b)](_0x452f23(0x1f0)));_0x2b94c2[_0x452f23(0x1f2)]>0x0&&!_0x4da06f[_0x452f23(0x1fe)]&&console['error'](_0x452f23(0x214)+_0x2b94c2['join'](',\x20'));_0x439e58[_0x452f23(0x1f2)]>0x0&&console[_0x452f23(0x1f6)](_0x452f23(0x200)+_0x439e58['join'](',\x20'));_0xd547a2['length']>0x0&&!_0x4da06f[_0x452f23(0x1fe)]&&console['error'](_0x452f23(0x1b6)+_0xd547a2['join'](',\x20'));if(_0x3eb6cd){const _0x3b0483=getConsoleNextUrl(_0x4da06f['site'],'/app/ps/'+_0x3f9a71+_0x452f23(0x1ca)+_0x3eb6cd+_0x452f23(0x20a));console[_0x452f23(0x1f6)](_0x452f23(0x22a)+a47_0x864e50[_0x452f23(0x1f9)](_0x3b0483));}return 0x0;}}
1
+ const a48_0x1609ad=a48_0x5d87;function a48_0x5d87(_0x569cb8,_0x13dfd5){_0x569cb8=_0x569cb8-0x1f0;const _0x44fc61=a48_0x44fc();let _0x5d87e5=_0x44fc61[_0x569cb8];return _0x5d87e5;}(function(_0xb0024a,_0x108ea8){const _0x2cb1bb=a48_0x5d87,_0x4a0b72=_0xb0024a();while(!![]){try{const _0x488d09=parseInt(_0x2cb1bb(0x201))/0x1*(-parseInt(_0x2cb1bb(0x276))/0x2)+parseInt(_0x2cb1bb(0x218))/0x3*(-parseInt(_0x2cb1bb(0x226))/0x4)+-parseInt(_0x2cb1bb(0x28b))/0x5+-parseInt(_0x2cb1bb(0x268))/0x6+parseInt(_0x2cb1bb(0x1f7))/0x7+parseInt(_0x2cb1bb(0x283))/0x8+parseInt(_0x2cb1bb(0x224))/0x9;if(_0x488d09===_0x108ea8)break;else _0x4a0b72['push'](_0x4a0b72['shift']());}catch(_0xf57467){_0x4a0b72['push'](_0x4a0b72['shift']());}}}(a48_0x44fc,0x8f0b0));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a48_0x38a609 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a48_0x44fc(){const _0x8948da=['yellow','attributes','toUpdate','join','.yml','Error:\x20Directory\x20not\x20found:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','12351168hUSnyl','segment\x20or\x20journey','4433916lcFgdV','Delete\x20journey:','Scoped\x20to\x20folder:\x20','existingJourney','targetDir','\x20changes?','nameToType','helpText','/app/ps/','get','📁\x20','updatedAt','unchanged','green','/sb/da/esr','verbose','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','all','getOutputSchemaWithCache','\x20\x20Segments:\x20','red','journeys','scopedFolderPath','error','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20','connection','createdSegmentIds','/j/da/je','folderPath','segmentFolderId','.yaml','segment','\x20\x20Journeys:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','type','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Preparing\x20journeys...','execute','then','folders','listFolders','\x20\x20Activations:','getJourney','paused','\x20folders\x20to\x20create','journeysOnly','Aborted.','\x0a✔\x20Push\x20complete','journeyId','Resolving\x20parent\x20segment\x20\x27','audienceId','Folders\x20to\x20create:','Error\x20parsing\x20YAML:\x20','data','\x20\x20📊\x20Segments:','Parent\x20segment:\x20','/e/','\x20\x20🗺️\x20\x20Journeys:','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Fetching\x20connections\x20for\x20name\x20resolution...','diff','parent_name','journey','push','2727648aCXSGl','changed','results','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Delete\x20segment:','\x27...','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','Changes\x20to\x20journey:','listJourneysWithDetailsFromParentSegment','new','getMetadataWithCache','getParent','idToName','filter','262NeQoXy','\x20activations]','Fetching\x20existing\x20activations...','description','journeyBundleId','\x20to\x20create','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','updated','site','segments','file','name','isNew','5211648ZfHeEk','journeyBundleName','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','deleted','yamlConfig','length','Fetching\x20existing\x20data...','errorCode','3077910iPEfVH','New\x20journey:','created','yes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','New\x20segment:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','listActivations','resolveParentId','\x20updated','6198640EYZbNp','\x20YAML\x20files\x20found','add','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','dim','existingSegment','\x20new','parentSegment','\x0aPush\x20summary\x20for\x20\x27','parentName','1105qOnunG','list','message','\x20unchanged','toDelete','dryRun','set','user','isScoped','\x20to\x20delete','buildUserMaps','\x20\x20\x20\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','filePath','toString','\x0aValidation\x20failed:','\x20changed','toCreate','repeat','delete','blue','no_parent','map','3xGkwaP','No\x20','activations','\x20deleted','\x20\x20Activations:\x20'];a48_0x44fc=function(){return _0x8948da;};return a48_0x44fc();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a48_0x1609ad(0x281)]='segment:push';[a48_0x1609ad(0x279)]=a48_0x1609ad(0x26e);async[a48_0x1609ad(0x24c)](_0x50ef36){const _0x3479f8=a48_0x1609ad,{options:_0xfa47b2,args:_0x554693,tdx:_0x2a6b6c}=_0x50ef36,_0x273058=_0xfa47b2,_0x2d5a44=await resolveTarget({'arg':_0x554693[0x0],'contextParent':_0xfa47b2[_0x3479f8(0x1fe)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2d5a44))return _0x2d5a44[_0x3479f8(0x28a)]===_0x3479f8(0x216)?(console['error'](a48_0x38a609['yellow'](_0x3479f8(0x1f0))),console[_0x3479f8(0x23d)](_0x3479f8(0x1f1)),console[_0x3479f8(0x23d)](_0x3479f8(0x27c)),console[_0x3479f8(0x23d)](_0x3479f8(0x262))):(console[_0x3479f8(0x23d)](a48_0x38a609['red'](_0x3479f8(0x23f)+_0x2d5a44['message']+'\x0a')),_0x2d5a44[_0x3479f8(0x22d)]&&console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x261)](_0x2d5a44[_0x3479f8(0x22d)]))),0x1;if(_0x2d5a44['type']===_0x3479f8(0x265))return console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x23a)](_0x3479f8(0x222)+_0x2d5a44[_0x3479f8(0x22a)]+'\x0a')),console['error'](a48_0x38a609[_0x3479f8(0x261)](_0x3479f8(0x285))),0x1;const _0x320cfb=_0x2d5a44[_0x3479f8(0x200)],_0x5826a9=_0x2d5a44[_0x3479f8(0x22a)],_0x684343=_0x2d5a44[_0x3479f8(0x249)]===_0x3479f8(0x280)?_0x2d5a44[_0x3479f8(0x20e)]:undefined,_0x2be775=getScopedDetails(_0x2d5a44),_0x3071cd=_0x2be775?.[_0x3479f8(0x209)]??![],_0x49fbec=_0x2be775?.[_0x3479f8(0x23c)]??'';if(!existsSync(_0x5826a9))return console[_0x3479f8(0x23d)](a48_0x38a609['red'](_0x3479f8(0x222)+_0x5826a9+'\x0a')),console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x261)](_0x3479f8(0x285))),0x1;_0x273058[_0x3479f8(0x235)]&&(console[_0x3479f8(0x23d)]('Site:\x20'+_0x273058[_0x3479f8(0x27e)]),console[_0x3479f8(0x23d)](_0x3479f8(0x25e)+_0x320cfb),console['error']('Source\x20directory:\x20'+_0x5826a9),_0x3071cd&&console[_0x3479f8(0x23d)](_0x3479f8(0x228)+_0x49fbec));const _0x14b2ae=await withSpinner(_0x3479f8(0x258)+_0x320cfb+_0x3479f8(0x26d),()=>_0x2a6b6c['segment'][_0x3479f8(0x1f5)](_0x320cfb),{'verbose':_0x273058[_0x3479f8(0x235)]}),_0x4282d6=_0x14b2ae[_0x3479f8(0x25c)],{parentSegmentResult:_0x38d6a1,segmentsResult:_0x416fac,foldersResult:_0x4ffa47,journeysWithDetailsResult:_0x15e9b1,userMaps:_0x5d4199}=await withSpinner(_0x3479f8(0x289),async()=>{const _0x709c8c=_0x3479f8,[_0x118ec6,_0x5cc0e2,_0x32c9a1,_0x371f9e,_0x15a2f0]=await Promise[_0x709c8c(0x237)]([_0x2a6b6c['segment'][_0x709c8c(0x273)](_0x4282d6),_0x2a6b6c['segment']['listSegments'](_0x4282d6),_0x2a6b6c[_0x709c8c(0x246)][_0x709c8c(0x24f)](_0x4282d6),_0x2a6b6c[_0x709c8c(0x266)][_0x709c8c(0x270)](_0x4282d6,{'includeAllVersions':!![]}),_0x2a6b6c[_0x709c8c(0x208)][_0x709c8c(0x20b)]()]);return{'parentSegmentResult':_0x118ec6,'segmentsResult':_0x5cc0e2,'foldersResult':_0x32c9a1,'journeysWithDetailsResult':_0x371f9e,'userMaps':_0x15a2f0};},{'verbose':_0x273058[_0x3479f8(0x235)]})[_0x3479f8(0x24d)](_0x3b91c2=>_0x3b91c2[_0x3479f8(0x25c)]),_0x4e60f0=_0x38d6a1,_0x59b1a3=extractRootFolderId(_0x4e60f0),_0x4db7d4=_0x416fac,_0xfa03d8=_0x4ffa47,{journeys:_0x1ea159,activationStepsById:_0x42d7c2}=_0x15e9b1,_0x276cc5=new Map(_0x1ea159[_0x3479f8(0x217)](_0x382d66=>[_0x382d66['id'],_0x382d66])),_0x9fd07=_0x1ea159[_0x3479f8(0x217)](_0x5cb629=>({'id':_0x5cb629['id'],'name':_0x5cb629[_0x3479f8(0x21e)][_0x3479f8(0x281)],'journeyBundleName':_0x5cb629['attributes']['journeyBundleName']||'','journeyBundleId':_0x5cb629[_0x3479f8(0x21e)][_0x3479f8(0x27a)]||'','versionNumber':_0x5cb629[_0x3479f8(0x21e)]['versionNumber'],'description':_0x5cb629['attributes']['description'],'state':_0x5cb629[_0x3479f8(0x21e)]['state'],'paused':_0x5cb629[_0x3479f8(0x21e)][_0x3479f8(0x252)],'audienceId':_0x5cb629[_0x3479f8(0x21e)][_0x3479f8(0x259)],'folderId':_0x5cb629['relationships']?.['parentFolder']?.[_0x3479f8(0x25c)]?.['id'],'createdAt':_0x5cb629['attributes']['createdAt'],'updatedAt':_0x5cb629[_0x3479f8(0x21e)][_0x3479f8(0x231)]})),{emailToId:_0x33e44d,idToEmail:_0x39245f}=_0x5d4199,_0xffa4e3=await withSpinner(_0x3479f8(0x263),async()=>{const _0x7f6b90=_0x3479f8,_0x2f07af=await _0x2a6b6c['connection'][_0x7f6b90(0x202)]();return buildConnectionMaps(_0x2f07af);},{'verbose':_0x273058[_0x3479f8(0x235)]})[_0x3479f8(0x24d)](_0x28b2b4=>_0x28b2b4[_0x3479f8(0x25c)]),_0x128dee=_0xffa4e3['nameToId'],_0x160cf2=_0xffa4e3[_0x3479f8(0x274)],_0x2e930b=_0xffa4e3[_0x3479f8(0x22c)],_0xeec34e={'emailToIdMap':_0x33e44d,'connectionNameToIdMap':_0x128dee,'connectionNameToTypeMap':_0x2e930b,'getSchema':_0x4a2169=>_0x2a6b6c['connection'][_0x3479f8(0x238)](_0x4a2169),'getMetadata':_0x5c9f76=>_0x2a6b6c[_0x3479f8(0x240)][_0x3479f8(0x272)](_0x5c9f76)};let {pathToId:_0x270ad0,idToPath:_0x31799f}=buildFolderMaps(_0xfa03d8);const _0x5a1495=buildSegmentLookupMap(_0x4db7d4,_0x31799f),_0x5b0b59=buildSegmentNameToIdMap(_0x4db7d4),_0x3a637c=buildJourneyBundleLookupMap(_0x9fd07,_0x31799f);let _0x31878d;if(_0x684343){if(!_0x684343['endsWith'](_0x3479f8(0x221))&&!_0x684343['endsWith'](_0x3479f8(0x245)))return console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x23a)](_0x3479f8(0x236)+_0x684343+'\x0a')),0x1;_0x31878d=[_0x684343];}else _0x31878d=findYamlFiles(_0x5826a9);if(_0x31878d[_0x3479f8(0x288)]===0x0)return console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x23a)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5826a9+'\x0a')),console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x261)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x1653d4,_0x283eba;try{const _0x3fc0c4=parseAndClassifyYamlFiles(_0x31878d,_0x5826a9,{'skipSegments':_0x273058['journeysOnly']});_0x1653d4=_0x3fc0c4[_0x3479f8(0x27f)],_0x283eba=_0x3fc0c4[_0x3479f8(0x23b)];const _0x28f8e4=validateParsedFiles(_0x3fc0c4,_0x5826a9);if(_0x28f8e4[_0x3479f8(0x288)]>0x0)return console['error'](a48_0x38a609[_0x3479f8(0x23a)](_0x3479f8(0x210))),console[_0x3479f8(0x23d)](formatValidationErrors(_0x28f8e4)),console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x21d)](_0x3479f8(0x248))),0x1;}catch(_0x3179a2){return console['error'](a48_0x38a609['red'](_0x3479f8(0x25b)+(_0x3179a2 instanceof Error?_0x3179a2[_0x3479f8(0x203)]:_0x3179a2))),0x1;}if(_0x1653d4[_0x3479f8(0x288)]===0x0&&_0x283eba[_0x3479f8(0x288)]===0x0){const _0x5d9880=_0x273058['journeysOnly']?_0x3479f8(0x266):_0x3479f8(0x225);return console[_0x3479f8(0x23d)](a48_0x38a609['yellow'](_0x3479f8(0x219)+_0x5d9880+_0x3479f8(0x1f8))),0x0;}const _0x256c3e=new Map();_0x4db7d4[_0x3479f8(0x288)]>0x0&&!_0x273058[_0x3479f8(0x254)]&&await withSpinner(_0x3479f8(0x278),async()=>{await batchAsync(_0x4db7d4,async _0xad8e19=>{const _0x54075e=a48_0x5d87,_0x1f2ef2=await _0x2a6b6c[_0x54075e(0x246)][_0x54075e(0x1f4)](_0x4282d6,_0xad8e19['id']);_0x256c3e[_0x54075e(0x207)](_0xad8e19['id'],_0x1f2ef2);});},{'verbose':_0x273058[_0x3479f8(0x235)]});const {segmentFiles:_0x1b21ed,foldersToCreate:_0x267bf8}=await prepareSegmentFiles(_0x1653d4,{'segmentByFolderAndName':_0x5a1495,'activationsBySegmentId':_0x256c3e,'folderPathToId':_0x270ad0,'idToEmailMap':_0x39245f,'connectionIdToNameMap':_0x160cf2},_0xeec34e,_0x3071cd,_0x49fbec),_0x4b16f2=_0x684343?[]:findSegmentsToDelete(_0x4db7d4,_0x1653d4[_0x3479f8(0x217)](({yamlConfig:_0x6f1b9d,folderPath:_0x307765})=>({'yamlConfig':_0x6f1b9d,'folderPath':resolveTDFolderPath(_0x307765,_0x3071cd,_0x49fbec)})),_0x31799f,_0x49fbec,_0x3071cd),{journeyFiles:_0x2c7499,foldersToCreate:_0x340eae}=await withProgressSpinner(_0x3479f8(0x24b),async _0x3150f4=>prepareJourneyFiles(_0x283eba,{'fetchJourney':async _0x1b193f=>_0x2a6b6c[_0x3479f8(0x266)][_0x3479f8(0x251)](_0x1b193f[_0x3479f8(0x257)]),'journeyBundlesByFolderAndName':_0x3a637c,'folderPathToId':_0x270ad0,'idToEmailMap':_0x39245f,'connectionIdToNameMap':_0x160cf2,'existingSegments':_0x4db7d4,'parentId':_0x4282d6,'deps':_0x2a6b6c,'progress':{'update':_0x5d6f3b=>{const _0x57fb08=_0x3479f8;_0x3150f4['setPhase'](_0x5d6f3b),_0x273058[_0x57fb08(0x235)]&&console['error']('\x20\x20'+_0x5d6f3b);}},'journeyById':_0x276cc5,'activationStepsById':_0x42d7c2},_0x3071cd,_0x49fbec),{'verbose':_0x273058[_0x3479f8(0x235)]})[_0x3479f8(0x24d)](_0x4fb7e2=>_0x4fb7e2['data']);for(const _0x59fb04 of _0x340eae){_0x267bf8[_0x3479f8(0x1f9)](_0x59fb04);}const _0x126960=_0x684343?[]:findJourneysToDelete(_0x9fd07,_0x283eba[_0x3479f8(0x217)](({yamlConfig:_0x1bf006,folderPath:_0x4f359b})=>({'yamlConfig':_0x1bf006,'folderPath':resolveTDFolderPath(_0x4f359b,_0x3071cd,_0x49fbec)})),_0x31799f,_0x49fbec,_0x3071cd),_0x238df1=calculatePushStats(_0x1b21ed,_0x2c7499,_0x267bf8,_0x4b16f2,_0x126960,!!_0x273058['delete'],!!_0x273058[_0x3479f8(0x254)]),_0x51a3d3=_0x238df1[_0x3479f8(0x27f)][_0x3479f8(0x271)],_0x3ea1e5=_0x238df1['segments'][_0x3479f8(0x269)],_0x2442a=_0x238df1[_0x3479f8(0x27f)][_0x3479f8(0x232)],_0x38e043=_0x238df1[_0x3479f8(0x27f)][_0x3479f8(0x205)],_0x1ebb4f=_0x238df1[_0x3479f8(0x24e)][_0x3479f8(0x212)],_0x290e4c=_0x238df1[_0x3479f8(0x23b)][_0x3479f8(0x271)],_0x182b08=_0x238df1[_0x3479f8(0x23b)][_0x3479f8(0x269)],_0xea6bb9=_0x238df1[_0x3479f8(0x23b)]['unchanged'],_0x49dbc1=_0x238df1[_0x3479f8(0x23b)][_0x3479f8(0x205)],_0x17d423=_0x238df1[_0x3479f8(0x21a)][_0x3479f8(0x237)],_0x372104=_0x238df1[_0x3479f8(0x21a)]['toCreate'],_0x360c24=_0x238df1['activations'][_0x3479f8(0x21f)],_0x229ab6=_0x238df1[_0x3479f8(0x21a)][_0x3479f8(0x205)];console[_0x3479f8(0x23d)](_0x3479f8(0x1ff)+_0x320cfb+'\x27:');_0x1ebb4f[_0x3479f8(0x288)]>0x0&&console['error']('\x20\x20'+a48_0x38a609[_0x3479f8(0x215)](_0x3479f8(0x230)+_0x1ebb4f[_0x3479f8(0x288)]+_0x3479f8(0x253)));if(!_0x273058[_0x3479f8(0x254)]){console[_0x3479f8(0x23d)](_0x3479f8(0x25d)),console['error'](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x233)]('+\x20'+_0x51a3d3[_0x3479f8(0x288)]+_0x3479f8(0x1fd))),console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x21d)]('~\x20'+_0x3ea1e5[_0x3479f8(0x288)]+_0x3479f8(0x211)));if(_0x38e043[_0x3479f8(0x288)]>0x0)console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x23a)]('-\x20'+_0x38e043[_0x3479f8(0x288)]+_0x3479f8(0x20a)));else _0x4b16f2[_0x3479f8(0x288)]>0x0&&!_0x273058[_0x3479f8(0x214)]&&console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x1fb)](_0x4b16f2[_0x3479f8(0x288)]+_0x3479f8(0x26b)));console['error'](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x1fb)]('=\x20'+_0x2442a[_0x3479f8(0x288)]+_0x3479f8(0x204)));}if(_0x2c7499[_0x3479f8(0x288)]>0x0||_0x126960[_0x3479f8(0x288)]>0x0){console['error'](_0x3479f8(0x260)),console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x233)]('+\x20'+_0x290e4c[_0x3479f8(0x288)]+_0x3479f8(0x1fd))),console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x21d)]('~\x20'+_0x182b08[_0x3479f8(0x288)]+_0x3479f8(0x211)));if(_0x49dbc1['length']>0x0)console[_0x3479f8(0x23d)]('\x20\x20\x20\x20'+a48_0x38a609['red']('-\x20'+_0x49dbc1[_0x3479f8(0x288)]+_0x3479f8(0x20a)));else _0x126960['length']>0x0&&!_0x273058[_0x3479f8(0x214)]&&console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x1fb)](_0x126960['length']+_0x3479f8(0x26b)));console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x1fb)]('=\x20'+_0xea6bb9[_0x3479f8(0x288)]+'\x20unchanged'));}_0x17d423[_0x3479f8(0x288)]>0x0&&!_0x273058['journeysOnly']&&(console[_0x3479f8(0x23d)](''),console['error'](_0x3479f8(0x250)),_0x372104[_0x3479f8(0x288)]>0x0&&console['error'](_0x3479f8(0x20c)+a48_0x38a609['green']('+\x20'+_0x372104[_0x3479f8(0x288)]+_0x3479f8(0x27b))),_0x360c24[_0x3479f8(0x288)]>0x0&&console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x21d)]('~\x20'+_0x360c24[_0x3479f8(0x288)]+'\x20to\x20update')),_0x229ab6[_0x3479f8(0x288)]>0x0&&console['error']('\x20\x20\x20\x20'+a48_0x38a609[_0x3479f8(0x23a)]('-\x20'+_0x229ab6[_0x3479f8(0x288)]+_0x3479f8(0x20a))));console[_0x3479f8(0x23d)]('\x20\x20Source:\x20'+a48_0x38a609[_0x3479f8(0x261)](_0x5826a9)+'\x0a');if(_0x1ebb4f[_0x3479f8(0x288)]>0x0){console[_0x3479f8(0x23d)](_0x3479f8(0x25a));for(const _0x394623 of _0x1ebb4f){console['error']('\x20\x20'+a48_0x38a609['blue']('+')+'\x20'+_0x394623);}console[_0x3479f8(0x23d)]('');}if(_0x51a3d3[_0x3479f8(0x288)]>0x0&&!_0x273058[_0x3479f8(0x254)])for(const _0x5dbaa8 of _0x51a3d3){const _0x24899e=_0x5dbaa8['folderPath']?_0x5dbaa8['folderPath']+'/'+_0x5dbaa8[_0x3479f8(0x287)][_0x3479f8(0x281)]:_0x5dbaa8['yamlConfig']['name'],_0xedbb9f=_0x5dbaa8[_0x3479f8(0x287)][_0x3479f8(0x21a)]?.[_0x3479f8(0x288)]||0x0,_0x24c0d9=_0xedbb9f>0x0?a48_0x38a609[_0x3479f8(0x1fb)]('\x20['+_0xedbb9f+_0x3479f8(0x277)):'';console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x233)](_0x3479f8(0x1f2))+'\x20'+_0x24899e+_0x24c0d9),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c)),_0x5dbaa8['diff']&&console[_0x3479f8(0x23d)](_0x5dbaa8[_0x3479f8(0x264)]),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));}if(_0x38e043[_0x3479f8(0x288)]>0x0&&!_0x273058['journeysOnly'])for(const _0x102560 of _0x38e043){const _0x588534=_0x102560['segmentFolderId']?_0x31799f['get'](_0x102560[_0x3479f8(0x244)][_0x3479f8(0x20f)]())||'':'',_0x42c351=_0x588534?_0x588534+'/'+_0x102560[_0x3479f8(0x281)]:_0x102560[_0x3479f8(0x281)],_0x47c2ac=_0x256c3e[_0x3479f8(0x22f)](_0x102560['id'])||[],_0x99e051=_0x47c2ac[_0x3479f8(0x288)]>0x0?a48_0x38a609[_0x3479f8(0x1fb)]('\x20['+_0x47c2ac['length']+_0x3479f8(0x277)):'';console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x23a)](_0x3479f8(0x26c))+'\x20'+_0x42c351+_0x99e051),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));const _0x1c3666=segmentWithActivationsToYaml(_0x102560,_0x47c2ac,undefined,_0x39245f,_0x160cf2),_0xd6e730=segmentToYamlString(_0x1c3666),_0x42c34d=generateDiff(_0xd6e730,'');console[_0x3479f8(0x23d)](formatDiffWithColors(_0x42c34d)),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));}const _0x19f9b3=_0x1b21ed[_0x3479f8(0x275)](_0x5ae17d=>!_0x5ae17d[_0x3479f8(0x282)]&&_0x5ae17d['diff']);if(_0x19f9b3[_0x3479f8(0x288)]>0x0&&!_0x273058['journeysOnly'])for(const _0x4e48e7 of _0x19f9b3){const _0x5beabf=_0x4e48e7[_0x3479f8(0x243)]?_0x4e48e7[_0x3479f8(0x243)]+'/'+_0x4e48e7[_0x3479f8(0x287)][_0x3479f8(0x281)]:_0x4e48e7[_0x3479f8(0x287)]['name'];console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x21d)]('Changes\x20to:')+'\x20'+_0x5beabf),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c)),console[_0x3479f8(0x23d)](_0x4e48e7[_0x3479f8(0x264)]),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));}if(_0x290e4c[_0x3479f8(0x288)]>0x0)for(const _0x7452d7 of _0x290e4c){const _0x59a5de=_0x7452d7[_0x3479f8(0x243)]?_0x7452d7[_0x3479f8(0x243)]+'/'+_0x7452d7[_0x3479f8(0x287)][_0x3479f8(0x281)]:_0x7452d7['yamlConfig'][_0x3479f8(0x281)];console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x233)](_0x3479f8(0x28c))+'\x20'+_0x59a5de),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c)),_0x7452d7[_0x3479f8(0x264)]&&console[_0x3479f8(0x23d)](_0x7452d7[_0x3479f8(0x264)]),console[_0x3479f8(0x23d)]('─'['repeat'](0x3c));}const _0x2a08ad=_0x2c7499[_0x3479f8(0x275)](_0x2b9ae9=>!_0x2b9ae9['isNew']&&_0x2b9ae9[_0x3479f8(0x264)]);if(_0x2a08ad[_0x3479f8(0x288)]>0x0)for(const _0x1d8869 of _0x2a08ad){const _0x50e41d=_0x1d8869[_0x3479f8(0x243)]?_0x1d8869[_0x3479f8(0x243)]+'/'+_0x1d8869['yamlConfig']['name']:_0x1d8869['yamlConfig'][_0x3479f8(0x281)];console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x21d)](_0x3479f8(0x26f))+'\x20'+_0x50e41d),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c)),console['error'](_0x1d8869[_0x3479f8(0x264)]),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));}if(_0x49dbc1[_0x3479f8(0x288)]>0x0)for(const _0x35c594 of _0x49dbc1){const _0x30c57e=_0x35c594['folderId']?_0x31799f['get'](_0x35c594['folderId'])||'':'',_0xb8cf46=_0x30c57e?_0x30c57e+'/'+_0x35c594['journeyBundleName']:_0x35c594[_0x3479f8(0x284)];console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x23a)](_0x3479f8(0x227))+'\x20'+_0xb8cf46),console[_0x3479f8(0x23d)]('─'['repeat'](0x3c)),console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x23a)]('(Journey\x20will\x20be\x20deleted)')),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));}if(_0x273058[_0x3479f8(0x206)])return console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x21d)](_0x3479f8(0x223))),0x0;const _0x586c3b=_0x273058['journeysOnly']?![]:_0x51a3d3['length']>0x0||_0x3ea1e5[_0x3479f8(0x288)]>0x0||_0x38e043['length']>0x0,_0x2d74c3=_0x290e4c['length']>0x0||_0x182b08[_0x3479f8(0x288)]>0x0||_0x49dbc1[_0x3479f8(0x288)]>0x0,_0x4b2bf7=_0x273058[_0x3479f8(0x254)]?![]:_0x17d423[_0x3479f8(0x288)]>0x0,_0x4381e5=_0x1ebb4f['length']>0x0;if(!_0x586c3b&&!_0x2d74c3&&!_0x4b2bf7&&!_0x4381e5){const _0x1d8108=_0x273058['journeysOnly']?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x3479f8(0x20d);console[_0x3479f8(0x23d)](a48_0x38a609['green'](_0x1d8108));if(_0x684343&&_0x2442a[_0x3479f8(0x288)]===0x1){const _0x415955=_0x2442a[0x0];if(_0x415955['existingSegment']?.['id']){const _0x483cdb=getConsoleNextUrl(_0x273058[_0x3479f8(0x27e)],_0x3479f8(0x22e)+_0x4282d6+_0x3479f8(0x25f)+_0x415955[_0x3479f8(0x1fc)]['id']+_0x3479f8(0x234));console[_0x3479f8(0x23d)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a48_0x38a609[_0x3479f8(0x261)](_0x483cdb));}}if(_0x684343&&_0xea6bb9[_0x3479f8(0x288)]===0x1){const _0x172673=_0xea6bb9[0x0];if(_0x172673['existingJourney']?.['id']){const _0x31e0fc=getConsoleNextUrl(_0x273058[_0x3479f8(0x27e)],_0x3479f8(0x22e)+_0x4282d6+'/e/'+_0x172673[_0x3479f8(0x229)]['id']+_0x3479f8(0x242));console[_0x3479f8(0x23d)]('\x20\x20'+a48_0x38a609['cyan'](_0x31e0fc));}}return 0x0;}const _0x34b0e4=_0x273058[_0x3479f8(0x254)]?_0x290e4c[_0x3479f8(0x288)]+_0x182b08[_0x3479f8(0x288)]+_0x49dbc1[_0x3479f8(0x288)]+_0x1ebb4f['length']:_0x51a3d3[_0x3479f8(0x288)]+_0x3ea1e5[_0x3479f8(0x288)]+_0x38e043[_0x3479f8(0x288)]+_0x290e4c['length']+_0x182b08['length']+_0x49dbc1[_0x3479f8(0x288)]+_0x1ebb4f['length']+_0x17d423[_0x3479f8(0x288)];if(!_0x273058[_0x3479f8(0x28e)]&&_0x34b0e4>0x0){if(!isInteractive())return console['error'](a48_0x38a609[_0x3479f8(0x23a)]('\x0aError:'),_0x3479f8(0x24a)),console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x1fb)](_0x3479f8(0x23e))),0x1;const _0x157d88=await confirmKey('Push\x20'+_0x34b0e4+_0x3479f8(0x22b));if(!_0x157d88)return console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x21d)](_0x3479f8(0x255))),0x1;}const _0x2dfd1a={'withProgress':async(_0x23b260,_0x252f5e)=>{const _0xaf183f=_0x3479f8,_0x579e2a=await withSpinner(_0x23b260,_0x252f5e,{'verbose':_0x273058[_0xaf183f(0x235)]});return{'data':_0x579e2a[_0xaf183f(0x25c)]};},'logInfo':_0xb16edb=>console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x215)]('✔\x20'+_0xb16edb)),'logSuccess':_0x5b9028=>console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x233)]('✔\x20'+_0x5b9028)),'logWarning':_0x3ec0e4=>console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x21d)]('⚠\x20'+_0x3ec0e4)),'logDeleted':_0x17c923=>console[_0x3479f8(0x23d)](a48_0x38a609['red']('✔\x20'+_0x17c923))},_0x188c9d={'segment':_0x2a6b6c['segment'],'journey':_0x2a6b6c[_0x3479f8(0x266)],'user':_0x2a6b6c['user'],'connection':_0x2a6b6c['connection']};_0x1ebb4f[_0x3479f8(0x288)]>0x0&&(_0x270ad0=await executePushFolders(_0x188c9d,_0x1ebb4f,_0x270ad0,{'parentId':_0x4282d6},_0x2dfd1a));const _0xd72fa4={'rootFolderId':_0x59b1a3,'folderPathToId':_0x270ad0,'folderIdToPath':_0x31799f,'segmentNameToId':_0x5b0b59,'activationsBySegmentId':_0x256c3e,'emailToIdMap':_0x33e44d,'idToEmailMap':_0x39245f,'connectionNameToIdMap':_0xffa4e3['nameToId'],'connectionIdToNameMap':_0xffa4e3[_0x3479f8(0x274)],'connectionNameToTypeMap':_0x2e930b},_0x363256=await executePushSegments(_0x188c9d,_0x273058[_0x3479f8(0x254)]?[]:_0x1b21ed,_0xd72fa4,{'parentId':_0x4282d6},_0x2dfd1a),_0x4ec0fb=_0x363256[_0x3479f8(0x28d)],_0xb50079=_0x363256['updated'],_0x1cef4c=_0x363256[_0x3479f8(0x21a)][_0x3479f8(0x28d)],_0x376dab=_0x363256[_0x3479f8(0x21a)][_0x3479f8(0x27d)],_0x4a6945=_0x363256[_0x3479f8(0x21a)][_0x3479f8(0x286)];let _0xd9d9b3;if(_0x684343&&_0x1b21ed[_0x3479f8(0x288)]===0x1){const _0x181b19=_0x1b21ed[0x0];_0xd9d9b3=_0x181b19['existingSegment']?.['id']??_0x363256[_0x3479f8(0x241)][_0x3479f8(0x22f)](_0x181b19['yamlConfig']['name']);}const _0x2cae69=await executePushSegmentDeletions(_0x188c9d,_0x273058[_0x3479f8(0x254)]?[]:_0x38e043,_0x2dfd1a);let _0x413303=0x0,_0x10e349=0x0,_0x55ddfa=0x0;const _0x1d38b7=new Map(_0x5b0b59);for(const [_0x46fa3a,_0x3aa98d]of _0x363256['createdSegmentIds']){_0x1d38b7['set'](_0x46fa3a,_0x3aa98d);}if(_0x2c7499[_0x3479f8(0x288)]>0x0){const _0x4866b2={..._0xd72fa4,'segmentNameToId':_0x1d38b7,'existingSegments':_0x4db7d4,'activationContext':_0xeec34e},_0x102a54=await executePushJourneys(_0x188c9d,_0x2c7499,_0x4866b2,{'parentId':_0x4282d6,'rootFolderId':_0x59b1a3,'verbose':_0x273058[_0x3479f8(0x235)]},_0x2dfd1a);_0x413303=_0x102a54[_0x3479f8(0x28d)],_0x10e349=_0x102a54[_0x3479f8(0x27d)];if(_0x684343&&_0x102a54[_0x3479f8(0x26a)][_0x3479f8(0x288)]===0x1){const _0x10711f=_0x102a54[_0x3479f8(0x26a)][0x0];if(_0x10711f[_0x3479f8(0x257)]){const _0x596803=getConsoleNextUrl(_0x273058['site'],'/app/ps/'+_0x4282d6+_0x3479f8(0x25f)+_0x10711f[_0x3479f8(0x257)]+_0x3479f8(0x242));console[_0x3479f8(0x23d)]('\x20\x20'+a48_0x38a609[_0x3479f8(0x261)](_0x596803));}}}for(const _0x294cc6 of _0x49dbc1){console['error'](a48_0x38a609[_0x3479f8(0x21d)](_0x3479f8(0x1f3)+_0x294cc6[_0x3479f8(0x284)])),_0x55ddfa++;}const _0x257af9=[];if(_0x4ec0fb>0x0)_0x257af9[_0x3479f8(0x267)](_0x4ec0fb+'\x20created');if(_0xb50079>0x0)_0x257af9[_0x3479f8(0x267)](_0xb50079+_0x3479f8(0x1f6));if(_0x2cae69>0x0)_0x257af9[_0x3479f8(0x267)](_0x2cae69+_0x3479f8(0x21b));const _0xf0873=[];if(_0x413303>0x0)_0xf0873[_0x3479f8(0x267)](_0x413303+'\x20created');if(_0x10e349>0x0)_0xf0873[_0x3479f8(0x267)](_0x10e349+_0x3479f8(0x1f6));if(_0x55ddfa>0x0)_0xf0873[_0x3479f8(0x267)](_0x55ddfa+'\x20deleted');const _0x39b536=[];if(_0x1cef4c>0x0)_0x39b536[_0x3479f8(0x267)](_0x1cef4c+'\x20created');if(_0x376dab>0x0)_0x39b536[_0x3479f8(0x267)](_0x376dab+_0x3479f8(0x1f6));if(_0x4a6945>0x0)_0x39b536[_0x3479f8(0x267)](_0x4a6945+_0x3479f8(0x21b));console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x233)](_0x3479f8(0x256)));_0x257af9['length']>0x0&&!_0x273058[_0x3479f8(0x254)]&&console[_0x3479f8(0x23d)](_0x3479f8(0x239)+_0x257af9['join'](',\x20'));_0xf0873['length']>0x0&&console['error'](_0x3479f8(0x247)+_0xf0873[_0x3479f8(0x220)](',\x20'));_0x39b536[_0x3479f8(0x288)]>0x0&&!_0x273058['journeysOnly']&&console[_0x3479f8(0x23d)](_0x3479f8(0x21c)+_0x39b536[_0x3479f8(0x220)](',\x20'));if(_0xd9d9b3){const _0x380636=getConsoleNextUrl(_0x273058['site'],_0x3479f8(0x22e)+_0x4282d6+_0x3479f8(0x25f)+_0xd9d9b3+_0x3479f8(0x234));console['error'](_0x3479f8(0x1fa)+a48_0x38a609[_0x3479f8(0x261)](_0x380636));}return 0x0;}}
@@ -1 +1 @@
1
- const a48_0x5c1445=a48_0x3584;(function(_0x23f279,_0x1fa967){const _0x2e1cb4=a48_0x3584,_0x351e52=_0x23f279();while(!![]){try{const _0x4887df=parseInt(_0x2e1cb4(0x204))/0x1*(-parseInt(_0x2e1cb4(0x1fd))/0x2)+parseInt(_0x2e1cb4(0x1ff))/0x3*(-parseInt(_0x2e1cb4(0x209))/0x4)+parseInt(_0x2e1cb4(0x1f6))/0x5*(parseInt(_0x2e1cb4(0x20d))/0x6)+-parseInt(_0x2e1cb4(0x21c))/0x7*(-parseInt(_0x2e1cb4(0x1f8))/0x8)+-parseInt(_0x2e1cb4(0x21a))/0x9*(parseInt(_0x2e1cb4(0x21f))/0xa)+-parseInt(_0x2e1cb4(0x211))/0xb*(-parseInt(_0x2e1cb4(0x1fe))/0xc)+parseInt(_0x2e1cb4(0x203))/0xd;if(_0x4887df===_0x1fa967)break;else _0x351e52['push'](_0x351e52['shift']());}catch(_0x1b2196){_0x351e52['push'](_0x351e52['shift']());}}}(a48_0x382d,0x7bc2a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a48_0x3584(_0x107521,_0x116f37){_0x107521=_0x107521-0x1f2;const _0x382d13=a48_0x382d();let _0x35843d=_0x382d13[_0x107521];return _0x35843d;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a48_0x13caa1 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a48_0x5c1445(0x212)]='segment:update';[a48_0x5c1445(0x210)]=a48_0x5c1445(0x202);async[a48_0x5c1445(0x1f4)](_0x1947f3){const _0x120326=a48_0x5c1445;console['error'](a48_0x13caa1[_0x120326(0x223)](_0x120326(0x208))),console[_0x120326(0x213)](a48_0x13caa1[_0x120326(0x223)](_0x120326(0x200)));const {options:_0x33f479,args:_0x512f97,tdx:_0x1bdbe4}=_0x1947f3,_0xdbe4cc=_0x33f479;if(_0x512f97['length']===0x0)return console[_0x120326(0x213)](_0x120326(0x1f2)),console['error'](_0x120326(0x1f7)),console['error']('Examples:'),console['error'](_0x120326(0x21e)),console[_0x120326(0x213)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1ca5fe=_0x512f97[0x0],_0x1920b9=_0x33f479[_0x120326(0x1fb)];let _0x5af734=_0x1ca5fe;_0x1920b9&&!_0x1ca5fe[_0x120326(0x217)]('/')&&(_0x5af734=_0x1920b9+'/'+_0x1ca5fe,_0xdbe4cc[_0x120326(0x218)]&&console['error'](_0x120326(0x206)+_0x5af734));const _0x576c9a=await withSpinner(_0x120326(0x20b)+_0x5af734+_0x120326(0x205),()=>_0x1bdbe4['segment'][_0x120326(0x224)](_0x5af734),{'verbose':_0xdbe4cc[_0x120326(0x218)]}),_0x196972=_0x576c9a['data'];_0xdbe4cc[_0x120326(0x218)]&&console[_0x120326(0x213)](_0x120326(0x20e)+_0x196972[_0x120326(0x1f3)]);if(_0x196972['type']!==_0x120326(0x1f5))return console['error']('Error:\x20Cannot\x20update\x20'+_0x196972[_0x120326(0x1f3)]+_0x120326(0x1f9)),console[_0x120326(0x213)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x196972['segmentId'])throw new SDKError(ErrorCode[_0x120326(0x21b)],_0x120326(0x207));const _0x149341=_0x196972[_0x120326(0x215)],_0xb7996b=_0x196972[_0x120326(0x221)];_0xdbe4cc[_0x120326(0x218)]&&(console[_0x120326(0x213)]('Parent\x20ID:\x20'+_0x149341),console[_0x120326(0x213)](_0x120326(0x214)+_0xb7996b));let _0x185c04;if(_0xdbe4cc['folder']){const _0x16be96=_0xdbe4cc[_0x120326(0x20a)],_0x3ffc0e=await withSpinner(_0x120326(0x1fc)+_0x16be96+_0x120326(0x205),()=>_0x1bdbe4[_0x120326(0x1f5)][_0x120326(0x20c)](_0x149341,_0x16be96),{'verbose':_0xdbe4cc[_0x120326(0x218)]});_0x185c04=parseInt(_0x3ffc0e[_0x120326(0x220)],0xa),_0xdbe4cc[_0x120326(0x218)]&&console[_0x120326(0x213)](_0x120326(0x1fa)+_0x185c04);}const _0x26143e=await loadJSONFromOptions(_0xdbe4cc['rule'],_0xdbe4cc[_0x120326(0x201)]),_0x2f9aef={'name':_0xdbe4cc['name'],'description':_0xdbe4cc['description'],'rule':_0x26143e,'kind':_0xdbe4cc['kind']!==undefined?parseInt(_0xdbe4cc[_0x120326(0x21d)],0xa):undefined,'segmentFolderId':_0x185c04},_0xbfa3ab=await withSpinner(_0x120326(0x225)+_0x196972[_0x120326(0x216)]+_0x120326(0x205),()=>_0x1bdbe4[_0x120326(0x1f5)][_0x120326(0x20f)](_0x149341,_0xb7996b,_0x2f9aef),{'verbose':_0xdbe4cc[_0x120326(0x218)]}),_0x41aae8=_0xbfa3ab['data'];return console[_0x120326(0x213)](_0x120326(0x219)+_0x41aae8[_0x120326(0x212)]+'\x27'),_0x5af734!==_0x1ca5fe&&console[_0x120326(0x213)](_0x120326(0x222)+_0x5af734),await handleSDKOutput([_0x41aae8],_0xdbe4cc),0x0;}}function a48_0x382d(){const _0x3efc6b=['name','error','Segment\x20ID:\x20','parentId','segmentName','includes','verbose','✔\x20Updated\x20segment\x20\x27','13761qTthHx','INTERNAL','23765KyfccF','kind','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','6550OipoYu','data','segmentId','\x20\x20\x20Path:\x20','yellow','resolvePathToResource','Updating\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','type','execute','segment','147570rXbvKB','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','400MAhFEk','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20folder\x20ID:\x20','segmentPath','Resolving\x20folder\x20\x27','10PMSGyH','8349612LdlXeH','201PXpiFl','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','ruleFile','Update\x20existing\x20child\x20segment','15584972lPnzAF','38139zFCtzr','\x27...','Resolved\x20relative\x20path\x20to:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','25332EuhLkk','folder','Resolving\x20path\x20\x27','resolveFolderId','12AYXXdk','Resolved\x20type:\x20','updateSegmentById','description','11LCxFHV'];a48_0x382d=function(){return _0x3efc6b;};return a48_0x382d();}
1
+ const a49_0x41d85b=a49_0x5d46;(function(_0x4dbdeb,_0x5a911b){const _0x258962=a49_0x5d46,_0x122857=_0x4dbdeb();while(!![]){try{const _0xb179e8=-parseInt(_0x258962(0x8f))/0x1+-parseInt(_0x258962(0x8b))/0x2+parseInt(_0x258962(0x82))/0x3+parseInt(_0x258962(0x6a))/0x4+-parseInt(_0x258962(0x76))/0x5*(parseInt(_0x258962(0x87))/0x6)+-parseInt(_0x258962(0x95))/0x7*(parseInt(_0x258962(0x90))/0x8)+parseInt(_0x258962(0x6c))/0x9;if(_0xb179e8===_0x5a911b)break;else _0x122857['push'](_0x122857['shift']());}catch(_0x9fc7bd){_0x122857['push'](_0x122857['shift']());}}}(a49_0x47c0,0xbd341));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a49_0x5d46(_0x4e20e7,_0x52ebd1){_0x4e20e7=_0x4e20e7-0x6a;const _0x47c09b=a49_0x47c0();let _0x5d469a=_0x47c09b[_0x4e20e7];return _0x5d469a;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a49_0x47c0(){const _0x23a8b9=['segmentId','ruleFile','\x27...','1880772yZtlMe','Error:\x20Cannot\x20update\x20','Examples:','segment:update','95756xHomnc','1396640TKKjIe','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Segment\x20ID:\x20','execute','35VbKztY','Updating\x20segment\x20\x27','1326844fKWsqz','kind','15444144SIOphz','Resolved\x20relative\x20path\x20to:\x20','\x20\x20\x20Path:\x20','Resolving\x20path\x20\x27','includes','folder','parentId','length','description','rule','10qilxOI','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20folder\x20\x27','Update\x20existing\x20child\x20segment','segment','✔\x20Updated\x20segment\x20\x27','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','data','name','Resolved\x20type:\x20','error','verbose','4229748lTawNq','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','updateSegmentById','type','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','2320872iHIzJa'];a49_0x47c0=function(){return _0x23a8b9;};return a49_0x47c0();}import a49_0x5228d6 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a49_0x41d85b(0x7e)]=a49_0x41d85b(0x8e);[a49_0x41d85b(0x74)]=a49_0x41d85b(0x79);async[a49_0x41d85b(0x94)](_0x5a4d5d){const _0x53e0fd=a49_0x41d85b;console[_0x53e0fd(0x80)](a49_0x5228d6['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x53e0fd(0x80)](a49_0x5228d6['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x5e6972,args:_0x43a3e7,tdx:_0x3b958f}=_0x5a4d5d,_0x2181a1=_0x5e6972;if(_0x43a3e7[_0x53e0fd(0x73)]===0x0)return console[_0x53e0fd(0x80)](_0x53e0fd(0x83)),console[_0x53e0fd(0x80)](_0x53e0fd(0x91)),console[_0x53e0fd(0x80)](_0x53e0fd(0x8d)),console[_0x53e0fd(0x80)](_0x53e0fd(0x86)),console[_0x53e0fd(0x80)](_0x53e0fd(0x92)),0x1;const _0xa2a14a=_0x43a3e7[0x0],_0x304902=_0x5e6972['segmentPath'];let _0x186f0f=_0xa2a14a;_0x304902&&!_0xa2a14a[_0x53e0fd(0x70)]('/')&&(_0x186f0f=_0x304902+'/'+_0xa2a14a,_0x2181a1['verbose']&&console[_0x53e0fd(0x80)](_0x53e0fd(0x6d)+_0x186f0f));const _0x5a91fd=await withSpinner(_0x53e0fd(0x6f)+_0x186f0f+'\x27...',()=>_0x3b958f['segment']['resolvePathToResource'](_0x186f0f),{'verbose':_0x2181a1['verbose']}),_0x869fde=_0x5a91fd[_0x53e0fd(0x7d)];_0x2181a1[_0x53e0fd(0x81)]&&console[_0x53e0fd(0x80)](_0x53e0fd(0x7f)+_0x869fde[_0x53e0fd(0x85)]);if(_0x869fde['type']!=='segment')return console[_0x53e0fd(0x80)](_0x53e0fd(0x8c)+_0x869fde[_0x53e0fd(0x85)]+_0x53e0fd(0x7c)),console[_0x53e0fd(0x80)](_0x53e0fd(0x77)),0x1;if(!_0x869fde[_0x53e0fd(0x88)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x46cf7d=_0x869fde[_0x53e0fd(0x72)],_0x4aa143=_0x869fde[_0x53e0fd(0x88)];_0x2181a1[_0x53e0fd(0x81)]&&(console[_0x53e0fd(0x80)]('Parent\x20ID:\x20'+_0x46cf7d),console['error'](_0x53e0fd(0x93)+_0x4aa143));let _0xc340c0;if(_0x2181a1[_0x53e0fd(0x71)]){const _0x173fda=_0x2181a1[_0x53e0fd(0x71)],_0x863423=await withSpinner(_0x53e0fd(0x78)+_0x173fda+_0x53e0fd(0x8a),()=>_0x3b958f[_0x53e0fd(0x7a)]['resolveFolderId'](_0x46cf7d,_0x173fda),{'verbose':_0x2181a1[_0x53e0fd(0x81)]});_0xc340c0=parseInt(_0x863423[_0x53e0fd(0x7d)],0xa),_0x2181a1['verbose']&&console[_0x53e0fd(0x80)]('Resolved\x20folder\x20ID:\x20'+_0xc340c0);}const _0x162168=await loadJSONFromOptions(_0x2181a1[_0x53e0fd(0x75)],_0x2181a1[_0x53e0fd(0x89)]),_0x51ecca={'name':_0x2181a1['name'],'description':_0x2181a1[_0x53e0fd(0x74)],'rule':_0x162168,'kind':_0x2181a1[_0x53e0fd(0x6b)]!==undefined?parseInt(_0x2181a1[_0x53e0fd(0x6b)],0xa):undefined,'segmentFolderId':_0xc340c0},_0x4169b0=await withSpinner(_0x53e0fd(0x96)+_0x869fde['segmentName']+_0x53e0fd(0x8a),()=>_0x3b958f[_0x53e0fd(0x7a)][_0x53e0fd(0x84)](_0x46cf7d,_0x4aa143,_0x51ecca),{'verbose':_0x2181a1[_0x53e0fd(0x81)]}),_0x3a1adf=_0x4169b0['data'];return console[_0x53e0fd(0x80)](_0x53e0fd(0x7b)+_0x3a1adf[_0x53e0fd(0x7e)]+'\x27'),_0x186f0f!==_0xa2a14a&&console[_0x53e0fd(0x80)](_0x53e0fd(0x6e)+_0x186f0f),await handleSDKOutput([_0x3a1adf],_0x2181a1),0x0;}}
@@ -1 +1 @@
1
- const a49_0x24b048=a49_0x516d;(function(_0x11833e,_0x25407c){const _0x4aa890=a49_0x516d,_0x249ed0=_0x11833e();while(!![]){try{const _0x2234fc=parseInt(_0x4aa890(0x1ec))/0x1+-parseInt(_0x4aa890(0x1e3))/0x2*(-parseInt(_0x4aa890(0x1fc))/0x3)+parseInt(_0x4aa890(0x1d2))/0x4*(-parseInt(_0x4aa890(0x1df))/0x5)+parseInt(_0x4aa890(0x1d7))/0x6+-parseInt(_0x4aa890(0x1ef))/0x7+-parseInt(_0x4aa890(0x1dd))/0x8+parseInt(_0x4aa890(0x1d0))/0x9;if(_0x2234fc===_0x25407c)break;else _0x249ed0['push'](_0x249ed0['shift']());}catch(_0x39e9bb){_0x249ed0['push'](_0x249ed0['shift']());}}}(a49_0x2a88,0xd67fd));function a49_0x516d(_0x4c6e54,_0x54878e){_0x4c6e54=_0x4c6e54-0x1cd;const _0x2a8883=a49_0x2a88();let _0x516db1=_0x2a8883[_0x4c6e54];return _0x516db1;}import{existsSync,statSync}from'fs';function a49_0x2a88(){const _0x4c48d4=['fullPath','execute','error','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','562197OfAIvw','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','✔\x20Context\x20set\x20to:\x20','1486359pWzTlf','isDirectory','red','Site:\x20','Target\x20path:\x20','dim','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','folderId','Examples:','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Folder\x20ID:\x20','slice','log','1137apllin','parentName','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','segment:use','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','verbose','type','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','\x27...','resolvePathToResource','5525793sChSnl','cyan','1473676ZMInUt','parentId','Resolved\x20path\x20type:\x20','name','site','7354086RVaZmI','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segmentPath','green','length','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','11502408FzKcYm','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','15JhJstF','segment','Use:\x20tdx\x20segment\x20use\x20','isAbsolute','6502kfBIYx','Resolving\x20path\x20\x27','folderPath','join','session'];a49_0x2a88=function(){return _0x4c48d4;};return a49_0x2a88();}import a49_0x9946cc from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a49_0x24b048(0x1d5)]=a49_0x24b048(0x1ff);['description']=a49_0x24b048(0x200);async[a49_0x24b048(0x1e9)](_0x4fb6be){const _0x40ab84=a49_0x24b048,{options:_0x206f21,args:_0x28643d,tdx:_0x15a8e0}=_0x4fb6be;if(_0x28643d[_0x40ab84(0x1db)]===0x0)return console[_0x40ab84(0x1ea)](a49_0x9946cc[_0x40ab84(0x1f1)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x40ab84(0x1ea)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0x40ab84(0x1f7)),console['error'](_0x40ab84(0x1ed)),console[_0x40ab84(0x1ea)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x40ab84(0x1ea)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x40ab84(0x1ea)](_0x40ab84(0x1fe)),0x1;const _0x1ec48b=_0x28643d[0x0],_0x1cb4ca=_0x206f21[_0x40ab84(0x1e7)];try{if(_0x1ec48b==='/')return saveSessionContext({'segment_path':undefined},_0x1cb4ca),console[_0x40ab84(0x1fb)](a49_0x9946cc['green'](_0x40ab84(0x1de))),0x0;if(existsSync(_0x1ec48b)&&statSync(_0x1ec48b)[_0x40ab84(0x1f0)]()){let _0x58b04c;try{_0x58b04c=findTdxConfig(_0x1ec48b);}catch{return console['error'](a49_0x9946cc[_0x40ab84(0x1f1)](_0x40ab84(0x203)+_0x1ec48b)),console['error'](a49_0x9946cc[_0x40ab84(0x1d1)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0xae59b6=_0x58b04c['config']['parent_segment'];return saveSessionContext({'segment_path':_0xae59b6,'parent_segment':_0xae59b6},_0x1cb4ca),console[_0x40ab84(0x1fb)](a49_0x9946cc['green'](_0x40ab84(0x1ee)+a49_0x9946cc[_0x40ab84(0x1d1)](_0xae59b6))),0x0;}const _0x1b6637=_0x206f21[_0x40ab84(0x1d9)];let _0xc287cd=_0x1ec48b;const _0x4a9824=parsePath(_0x1ec48b);if(!_0x4a9824[_0x40ab84(0x1e2)]){if(!_0x1b6637)return console[_0x40ab84(0x1ea)](a49_0x9946cc[_0x40ab84(0x1f1)](_0x40ab84(0x1f8))),console[_0x40ab84(0x1ea)](a49_0x9946cc[_0x40ab84(0x1d1)](_0x40ab84(0x1eb))),0x1;if(_0x1ec48b==='..'){const _0x28a309=_0x1b6637['split']('/')[_0x40ab84(0x1fa)](0x0,-0x1)[_0x40ab84(0x1e6)]('/');_0xc287cd=_0x28a309||'/';}else _0x1ec48b==='.'?_0xc287cd=_0x1b6637:_0xc287cd=_0x1b6637+'/'+_0x1ec48b;_0x206f21[_0x40ab84(0x201)]&&console[_0x40ab84(0x1ea)]('Resolved\x20relative\x20path\x20to:\x20'+_0xc287cd);}if(_0xc287cd==='/'||_0xc287cd==='')return saveSessionContext({'segment_path':undefined},_0x1cb4ca),console[_0x40ab84(0x1fb)](a49_0x9946cc[_0x40ab84(0x1da)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0xc287cd=normalizePath(_0xc287cd);const _0x32252a=parsePath(_0xc287cd)['segments'];if(_0x32252a[_0x40ab84(0x1db)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1cb4ca),console[_0x40ab84(0x1fb)](a49_0x9946cc['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x206f21[_0x40ab84(0x201)]&&(console[_0x40ab84(0x1ea)](_0x40ab84(0x1f2)+_0x206f21[_0x40ab84(0x1d6)]),console[_0x40ab84(0x1ea)](_0x40ab84(0x1f3)+_0xc287cd));const _0x1e655d=await withSpinner(_0x40ab84(0x1e4)+_0xc287cd+_0x40ab84(0x1ce),()=>_0x15a8e0[_0x40ab84(0x1e0)][_0x40ab84(0x1cf)](_0xc287cd),{'verbose':_0x206f21[_0x40ab84(0x201)]}),_0x89663a=_0x1e655d['data'];_0x206f21[_0x40ab84(0x201)]&&(console[_0x40ab84(0x1ea)](_0x40ab84(0x1d4)+_0x89663a['type']),console['error']('Parent\x20ID:\x20'+_0x89663a[_0x40ab84(0x1d3)]),_0x89663a[_0x40ab84(0x1f6)]&&console[_0x40ab84(0x1ea)](_0x40ab84(0x1f9)+_0x89663a['folderId']));if(_0x89663a[_0x40ab84(0x202)]===_0x40ab84(0x1e0))return console['error'](a49_0x9946cc['red'](_0x40ab84(0x1cd))),console[_0x40ab84(0x1ea)](_0x40ab84(0x1d8)),console[_0x40ab84(0x1ea)](a49_0x9946cc['cyan'](_0x40ab84(0x1e1)+_0x89663a[_0x40ab84(0x1fd)]+(_0x89663a[_0x40ab84(0x1e5)]?'/'+_0x89663a['folderPath'][_0x40ab84(0x1e6)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x89663a[_0x40ab84(0x1e8)],'parent_segment':_0x89663a[_0x40ab84(0x1fd)]},_0x1cb4ca),console['log'](a49_0x9946cc[_0x40ab84(0x1da)](_0x40ab84(0x1ee)+a49_0x9946cc[_0x40ab84(0x1d1)](_0x89663a[_0x40ab84(0x1e8)]))),_0x206f21[_0x40ab84(0x201)]&&(console[_0x40ab84(0x1ea)](a49_0x9946cc[_0x40ab84(0x1f4)](_0x40ab84(0x1f5))),console[_0x40ab84(0x1ea)](a49_0x9946cc[_0x40ab84(0x1f4)](_0x40ab84(0x1dc)))),0x0;}catch(_0x24e369){throw _0x24e369;}}}
1
+ function a50_0x28be(_0x46a583,_0x5541e5){_0x46a583=_0x46a583-0x1d9;const _0x424fcf=a50_0x424f();let _0x28becb=_0x424fcf[_0x46a583];return _0x28becb;}function a50_0x424f(){const _0x1ff4fe=['parentId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','slice','Use:\x20tdx\x20segment\x20use\x20','error','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','349608rfojVQ','folderId','1205cygrmx','cyan','parentName','1532kKHLng','name','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','496888nqSQbc','18AikPiz','description','763968KFjrlu','Folder\x20ID:\x20','green','Site:\x20','Target\x20path:\x20','length','segmentPath','4xpmKat','join','segment','session','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','201612jkXTPr','segment:use','resolvePathToResource','folderPath','isDirectory','213554yWrozh','verbose','execute','\x27...','945140umqEKA','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','fullPath','log','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Usage:\x20tdx\x20segment\x20use\x20<path>','parent_segment','isAbsolute','type','Parent\x20ID:\x20','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','site','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','red','✔\x20Context\x20set\x20to:\x20','dim','config','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'];a50_0x424f=function(){return _0x1ff4fe;};return a50_0x424f();}const a50_0x2d07b8=a50_0x28be;(function(_0x4be880,_0x1bc9be){const _0xd7b01b=a50_0x28be,_0x4bcf01=_0x4be880();while(!![]){try{const _0x355b3e=-parseInt(_0xd7b01b(0x1e7))/0x1+-parseInt(_0xd7b01b(0x1dd))/0x2*(parseInt(_0xd7b01b(0x1e2))/0x3)+-parseInt(_0xd7b01b(0x20a))/0x4*(-parseInt(_0xd7b01b(0x207))/0x5)+parseInt(_0xd7b01b(0x210))/0x6+parseInt(_0xd7b01b(0x205))/0x7+-parseInt(_0xd7b01b(0x20d))/0x8*(-parseInt(_0xd7b01b(0x20e))/0x9)+parseInt(_0xd7b01b(0x1eb))/0xa;if(_0x355b3e===_0x1bc9be)break;else _0x4bcf01['push'](_0x4bcf01['shift']());}catch(_0x111072){_0x4bcf01['push'](_0x4bcf01['shift']());}}}(a50_0x424f,0x2243d));import{existsSync,statSync}from'fs';import a50_0x1f4af2 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a50_0x2d07b8(0x20b)]=a50_0x2d07b8(0x1e3);[a50_0x2d07b8(0x20f)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a50_0x2d07b8(0x1e9)](_0x398931){const _0x1c84b1=a50_0x2d07b8,{options:_0x1e5933,args:_0x96f8e2,tdx:_0x3498a3}=_0x398931;if(_0x96f8e2[_0x1c84b1(0x1db)]===0x0)return console['error'](a50_0x1f4af2[_0x1c84b1(0x1f9)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x1c84b1(0x202)](_0x1c84b1(0x1f1)),console[_0x1c84b1(0x202)]('Examples:'),console[_0x1c84b1(0x202)](_0x1c84b1(0x1f8)),console[_0x1c84b1(0x202)](_0x1c84b1(0x1f0)),console[_0x1c84b1(0x202)](_0x1c84b1(0x203)),console['error'](_0x1c84b1(0x1e1)),0x1;const _0x37c66c=_0x96f8e2[0x0],_0x27f4db=_0x1e5933[_0x1c84b1(0x1e0)];try{if(_0x37c66c==='/')return saveSessionContext({'segment_path':undefined},_0x27f4db),console[_0x1c84b1(0x1ee)](a50_0x1f4af2['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x37c66c)&&statSync(_0x37c66c)[_0x1c84b1(0x1e6)]()){let _0x269ec7;try{_0x269ec7=findTdxConfig(_0x37c66c);}catch{return console[_0x1c84b1(0x202)](a50_0x1f4af2['red'](_0x1c84b1(0x1ec)+_0x37c66c)),console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x208)](_0x1c84b1(0x1ff))),0x1;}const _0x1bd854=_0x269ec7[_0x1c84b1(0x1fc)][_0x1c84b1(0x1f2)];return saveSessionContext({'segment_path':_0x1bd854,'parent_segment':_0x1bd854},_0x27f4db),console['log'](a50_0x1f4af2[_0x1c84b1(0x212)](_0x1c84b1(0x1fa)+a50_0x1f4af2[_0x1c84b1(0x208)](_0x1bd854))),0x0;}const _0x442f5f=_0x1e5933[_0x1c84b1(0x1dc)];let _0x604ac9=_0x37c66c;const _0x4986a0=parsePath(_0x37c66c);if(!_0x4986a0[_0x1c84b1(0x1f3)]){if(!_0x442f5f)return console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x1f9)](_0x1c84b1(0x1ef))),console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x208)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x37c66c==='..'){const _0x1e0c77=_0x442f5f['split']('/')[_0x1c84b1(0x200)](0x0,-0x1)[_0x1c84b1(0x1de)]('/');_0x604ac9=_0x1e0c77||'/';}else _0x37c66c==='.'?_0x604ac9=_0x442f5f:_0x604ac9=_0x442f5f+'/'+_0x37c66c;_0x1e5933[_0x1c84b1(0x1e8)]&&console[_0x1c84b1(0x202)]('Resolved\x20relative\x20path\x20to:\x20'+_0x604ac9);}if(_0x604ac9==='/'||_0x604ac9==='')return saveSessionContext({'segment_path':undefined},_0x27f4db),console['log'](a50_0x1f4af2[_0x1c84b1(0x212)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x604ac9=normalizePath(_0x604ac9);const _0x25e6b7=parsePath(_0x604ac9)['segments'];if(_0x25e6b7[_0x1c84b1(0x1db)]===0x0)return saveSessionContext({'segment_path':undefined},_0x27f4db),console[_0x1c84b1(0x1ee)](a50_0x1f4af2[_0x1c84b1(0x212)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x1e5933['verbose']&&(console['error'](_0x1c84b1(0x1d9)+_0x1e5933[_0x1c84b1(0x1f7)]),console[_0x1c84b1(0x202)](_0x1c84b1(0x1da)+_0x604ac9));const _0x2d9f5e=await withSpinner('Resolving\x20path\x20\x27'+_0x604ac9+_0x1c84b1(0x1ea),()=>_0x3498a3[_0x1c84b1(0x1df)][_0x1c84b1(0x1e4)](_0x604ac9),{'verbose':_0x1e5933[_0x1c84b1(0x1e8)]}),_0x2ffb8f=_0x2d9f5e['data'];_0x1e5933['verbose']&&(console[_0x1c84b1(0x202)]('Resolved\x20path\x20type:\x20'+_0x2ffb8f[_0x1c84b1(0x1f4)]),console[_0x1c84b1(0x202)](_0x1c84b1(0x1f5)+_0x2ffb8f[_0x1c84b1(0x1fe)]),_0x2ffb8f[_0x1c84b1(0x206)]&&console[_0x1c84b1(0x202)](_0x1c84b1(0x211)+_0x2ffb8f['folderId']));if(_0x2ffb8f[_0x1c84b1(0x1f4)]===_0x1c84b1(0x1df))return console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x1f9)](_0x1c84b1(0x1f6))),console['error'](_0x1c84b1(0x1fd)),console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x208)](_0x1c84b1(0x201)+_0x2ffb8f[_0x1c84b1(0x209)]+(_0x2ffb8f['folderPath']?'/'+_0x2ffb8f[_0x1c84b1(0x1e5)][_0x1c84b1(0x1de)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2ffb8f[_0x1c84b1(0x1ed)],'parent_segment':_0x2ffb8f[_0x1c84b1(0x209)]},_0x27f4db),console[_0x1c84b1(0x1ee)](a50_0x1f4af2[_0x1c84b1(0x212)](_0x1c84b1(0x1fa)+a50_0x1f4af2['cyan'](_0x2ffb8f[_0x1c84b1(0x1ed)]))),_0x1e5933[_0x1c84b1(0x1e8)]&&(console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x1fb)](_0x1c84b1(0x20c))),console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x1fb)](_0x1c84b1(0x204)))),0x0;}catch(_0x32b6eb){throw _0x32b6eb;}}}
@@ -1 +1 @@
1
- function a50_0x5be2(_0x29595a,_0x41ac97){_0x29595a=_0x29595a-0x1a1;const _0x4ede27=a50_0x4ede();let _0x5be289=_0x4ede27[_0x29595a];return _0x5be289;}const a50_0x1df10c=a50_0x5be2;(function(_0x4f7b3e,_0x422ac5){const _0x12fa72=a50_0x5be2,_0x128cb3=_0x4f7b3e();while(!![]){try{const _0x415321=-parseInt(_0x12fa72(0x1ca))/0x1*(-parseInt(_0x12fa72(0x1b2))/0x2)+parseInt(_0x12fa72(0x1bf))/0x3*(parseInt(_0x12fa72(0x1b6))/0x4)+parseInt(_0x12fa72(0x1d5))/0x5*(-parseInt(_0x12fa72(0x1bb))/0x6)+-parseInt(_0x12fa72(0x1b7))/0x7+parseInt(_0x12fa72(0x1b1))/0x8*(parseInt(_0x12fa72(0x1ae))/0x9)+parseInt(_0x12fa72(0x1d3))/0xa+-parseInt(_0x12fa72(0x1ba))/0xb*(parseInt(_0x12fa72(0x1bc))/0xc);if(_0x415321===_0x422ac5)break;else _0x128cb3['push'](_0x128cb3['shift']());}catch(_0x183c9f){_0x128cb3['push'](_0x128cb3['shift']());}}}(a50_0x4ede,0x63920));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a50_0x4ede(){const _0x223df2=['152VnZXen','Error:\x20','invalidCount','Error:\x20Directory\x20not\x20found:\x20','424324murPso','873306IjJdhM','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Validate\x20segment\x20and\x20journey\x20YAML\x20files','11NvRRGd','4404846pFWCIK','7298484jFPEep','✔\x20All\x20','log','15YalYLl','.yml','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','validCount','segment:validate','file','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','):\x20','Validation\x20failed:\x20','endsWith','2272fovrBX','errors','type','error','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','\x20valid','message','length','4481830JeUOLL','cyan','5CIOSnA','description','warningCount','\x20error(s)','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','hasErrors','warnings','valid','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errorCode','name','.yaml','green','verbose','\x20warning(s)\x20found','filePath','helpText','\x20file(s)\x20valid','3256587zuoPJc','execute','parentSegment','16AyWZaV'];a50_0x4ede=function(){return _0x223df2;};return a50_0x4ede();}import a50_0x1b5ebe from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a50_0x1df10c(0x1a6)]=a50_0x1df10c(0x1c3);[a50_0x1df10c(0x1d6)]=a50_0x1df10c(0x1b9);async[a50_0x1df10c(0x1af)](_0x4a7de1){const _0x5af4b4=a50_0x1df10c,{options:_0x2625db,args:_0x13b933}=_0x4a7de1,_0x413d43=_0x2625db,_0x21d1ae=await resolveTarget({'arg':_0x13b933[0x0],'contextParent':_0x2625db[_0x5af4b4(0x1b0)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x21d1ae))return _0x21d1ae[_0x5af4b4(0x1a5)]==='no_parent'?(console[_0x5af4b4(0x1cd)](a50_0x1b5ebe[_0x5af4b4(0x1cf)](_0x5af4b4(0x1a4))),console['error'](_0x5af4b4(0x1d9)),console[_0x5af4b4(0x1cd)](_0x5af4b4(0x1c6)),console['error'](_0x5af4b4(0x1b8))):(console[_0x5af4b4(0x1cd)](a50_0x1b5ebe[_0x5af4b4(0x1c5)](_0x5af4b4(0x1b3)+_0x21d1ae[_0x5af4b4(0x1d1)]+'\x0a')),_0x21d1ae[_0x5af4b4(0x1ac)]&&console[_0x5af4b4(0x1cd)](a50_0x1b5ebe[_0x5af4b4(0x1d4)](_0x21d1ae[_0x5af4b4(0x1ac)]))),0x1;const _0x20000d=_0x21d1ae['targetDir'],_0xf598b0=_0x21d1ae[_0x5af4b4(0x1cc)]===_0x5af4b4(0x1c4)?_0x21d1ae[_0x5af4b4(0x1ab)]:undefined;if(!_0xf598b0&&!existsSync(_0x20000d))return console[_0x5af4b4(0x1cd)](a50_0x1b5ebe[_0x5af4b4(0x1c5)](_0x5af4b4(0x1b5)+_0x20000d+'\x0a')),0x1;let _0x3e6b19;if(_0xf598b0){if(!_0xf598b0[_0x5af4b4(0x1c9)](_0x5af4b4(0x1c0))&&!_0xf598b0[_0x5af4b4(0x1c9)](_0x5af4b4(0x1a7)))return console['error'](a50_0x1b5ebe['red'](_0x5af4b4(0x1c1)+_0xf598b0+'\x0a')),0x1;_0x3e6b19=[_0xf598b0];}else _0x3e6b19=findYamlFiles(_0x20000d);if(_0x3e6b19['length']===0x0)return console[_0x5af4b4(0x1cd)](a50_0x1b5ebe['red'](_0x5af4b4(0x1ce)+_0x20000d+'\x0a')),0x1;const _0x4b0b10=validateYamlFiles(_0x3e6b19,_0x20000d),_0x35aebc=calculateSummary(_0x4b0b10);for(const _0x1fa69f of _0x4b0b10){if(!isValidationResult(_0x1fa69f))continue;const {relativePath:_0x2169ea,source:_0x2fccbc,result:_0x12066a,fileType:_0x16accc}=_0x1fa69f,_0x185ebb=_0x16accc;if(_0x12066a[_0x5af4b4(0x1a3)]&&_0x12066a[_0x5af4b4(0x1a2)][_0x5af4b4(0x1d2)]===0x0)_0x413d43[_0x5af4b4(0x1a9)]&&console[_0x5af4b4(0x1be)](a50_0x1b5ebe['green']('✔\x20'+_0x2169ea)+a50_0x1b5ebe['dim']('\x20('+_0x185ebb+')'));else _0x12066a[_0x5af4b4(0x1a3)]?(console[_0x5af4b4(0x1be)](a50_0x1b5ebe['yellow']('⚠\x20'+_0x2169ea)+a50_0x1b5ebe['dim']('\x20('+_0x185ebb+'):\x20'+_0x12066a[_0x5af4b4(0x1a2)][_0x5af4b4(0x1d2)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x12066a,_0x2fccbc,_0x2169ea))):(console[_0x5af4b4(0x1be)](a50_0x1b5ebe[_0x5af4b4(0x1c5)]('✖\x20'+_0x2169ea)+a50_0x1b5ebe['dim']('\x20('+_0x185ebb+_0x5af4b4(0x1c7)+_0x12066a[_0x5af4b4(0x1cb)][_0x5af4b4(0x1d2)]+_0x5af4b4(0x1d8))),console[_0x5af4b4(0x1be)](formatValidationResult(_0x12066a,_0x2fccbc,_0x2169ea)));}return console[_0x5af4b4(0x1be)](''),_0x35aebc[_0x5af4b4(0x1a1)]?(console[_0x5af4b4(0x1be)](a50_0x1b5ebe[_0x5af4b4(0x1c5)](_0x5af4b4(0x1c8)+_0x35aebc[_0x5af4b4(0x1b4)]+'\x20file(s)\x20with\x20errors,\x20'+_0x35aebc[_0x5af4b4(0x1c2)]+_0x5af4b4(0x1d0))),_0x35aebc[_0x5af4b4(0x1d7)]>0x0&&console[_0x5af4b4(0x1be)](a50_0x1b5ebe[_0x5af4b4(0x1cf)](_0x35aebc[_0x5af4b4(0x1d7)]+_0x5af4b4(0x1aa))),0x1):(console[_0x5af4b4(0x1be)](a50_0x1b5ebe[_0x5af4b4(0x1a8)](_0x5af4b4(0x1bd)+_0x35aebc[_0x5af4b4(0x1c2)]+_0x5af4b4(0x1ad))),_0x35aebc['warningCount']>0x0&&console[_0x5af4b4(0x1be)](a50_0x1b5ebe['yellow'](_0x35aebc[_0x5af4b4(0x1d7)]+_0x5af4b4(0x1aa))),0x0);}}
1
+ const a51_0x4d5725=a51_0x4c27;(function(_0x3ead1f,_0x2c35f6){const _0x1dcec9=a51_0x4c27,_0x417767=_0x3ead1f();while(!![]){try{const _0x355236=parseInt(_0x1dcec9(0xe7))/0x1+parseInt(_0x1dcec9(0xf2))/0x2+-parseInt(_0x1dcec9(0xfc))/0x3+-parseInt(_0x1dcec9(0xf7))/0x4*(parseInt(_0x1dcec9(0xde))/0x5)+parseInt(_0x1dcec9(0xf5))/0x6*(parseInt(_0x1dcec9(0xcd))/0x7)+parseInt(_0x1dcec9(0xe3))/0x8*(parseInt(_0x1dcec9(0xea))/0x9)+-parseInt(_0x1dcec9(0xec))/0xa;if(_0x355236===_0x2c35f6)break;else _0x417767['push'](_0x417767['shift']());}catch(_0x4f9bf4){_0x417767['push'](_0x417767['shift']());}}}(a51_0x50cd,0x1a8b2));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a51_0x50cd(){const _0x2804c7=['no_parent','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','201078oFampw','\x20file(s)\x20with\x20errors,\x20','green','513LHQXbs','errors','4070490ddGKOV','targetDir','validCount','):\x20','\x20valid','red','375310RREbTf','valid','name','78iNDBSL','Validation\x20failed:\x20','268vozgNd','type','log','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','description','72564iNgpzT','dim','57631GrQGYJ','yellow','error','Validate\x20segment\x20and\x20journey\x20YAML\x20files','\x20file(s)\x20valid','Error:\x20Directory\x20not\x20found:\x20','segment:validate','invalidCount','\x20warning(s)\x20found','.yaml','cyan','\x20error(s)','helpText','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','verbose','warningCount','10990GqCzSX','endsWith','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','Error:\x20','hasErrors','26872VhBfZU','\x20warning(s)'];a51_0x50cd=function(){return _0x2804c7;};return a51_0x50cd();}import a51_0x3c8dc0 from'chalk';function a51_0x4c27(_0x5157a7,_0x3ac3a9){_0x5157a7=_0x5157a7-0xcd;const _0x50cd25=a51_0x50cd();let _0x4c27a4=_0x50cd25[_0x5157a7];return _0x4c27a4;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a51_0x4d5725(0xf4)]=a51_0x4d5725(0xd3);[a51_0x4d5725(0xfb)]=a51_0x4d5725(0xd0);async['execute'](_0x2210ac){const _0xf148e3=a51_0x4d5725,{options:_0x51ba70,args:_0x567d76}=_0x2210ac,_0x3fb8e8=_0x51ba70,_0x48774b=await resolveTarget({'arg':_0x567d76[0x0],'contextParent':_0x51ba70['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x48774b))return _0x48774b['errorCode']===_0xf148e3(0xe5)?(console[_0xf148e3(0xcf)](a51_0x3c8dc0[_0xf148e3(0xce)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0xf148e3(0xcf)](_0xf148e3(0xe0)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console['error'](_0xf148e3(0xfa))):(console['error'](a51_0x3c8dc0['red'](_0xf148e3(0xe1)+_0x48774b['message']+'\x0a')),_0x48774b[_0xf148e3(0xd9)]&&console[_0xf148e3(0xcf)](a51_0x3c8dc0[_0xf148e3(0xd7)](_0x48774b[_0xf148e3(0xd9)]))),0x1;const _0x38fbc0=_0x48774b[_0xf148e3(0xed)],_0x54bba5=_0x48774b[_0xf148e3(0xf8)]==='file'?_0x48774b['filePath']:undefined;if(!_0x54bba5&&!existsSync(_0x38fbc0))return console[_0xf148e3(0xcf)](a51_0x3c8dc0['red'](_0xf148e3(0xd2)+_0x38fbc0+'\x0a')),0x1;let _0x7761f9;if(_0x54bba5){if(!_0x54bba5[_0xf148e3(0xdf)]('.yml')&&!_0x54bba5[_0xf148e3(0xdf)](_0xf148e3(0xd6)))return console[_0xf148e3(0xcf)](a51_0x3c8dc0[_0xf148e3(0xf1)](_0xf148e3(0xe6)+_0x54bba5+'\x0a')),0x1;_0x7761f9=[_0x54bba5];}else _0x7761f9=findYamlFiles(_0x38fbc0);if(_0x7761f9[_0xf148e3(0xdb)]===0x0)return console['error'](a51_0x3c8dc0[_0xf148e3(0xf1)](_0xf148e3(0xda)+_0x38fbc0+'\x0a')),0x1;const _0x390fd3=validateYamlFiles(_0x7761f9,_0x38fbc0),_0x1f8ffd=calculateSummary(_0x390fd3);for(const _0x1f2cdb of _0x390fd3){if(!isValidationResult(_0x1f2cdb))continue;const {relativePath:_0x2a2db0,source:_0x33b740,result:_0x2c6916,fileType:_0x214f2f}=_0x1f2cdb,_0x508f37=_0x214f2f;if(_0x2c6916[_0xf148e3(0xf3)]&&_0x2c6916['warnings'][_0xf148e3(0xdb)]===0x0)_0x3fb8e8[_0xf148e3(0xdc)]&&console['log'](a51_0x3c8dc0[_0xf148e3(0xe9)]('✔\x20'+_0x2a2db0)+a51_0x3c8dc0[_0xf148e3(0xfd)]('\x20('+_0x508f37+')'));else _0x2c6916[_0xf148e3(0xf3)]?(console[_0xf148e3(0xf9)](a51_0x3c8dc0[_0xf148e3(0xce)]('⚠\x20'+_0x2a2db0)+a51_0x3c8dc0[_0xf148e3(0xfd)]('\x20('+_0x508f37+_0xf148e3(0xef)+_0x2c6916['warnings']['length']+_0xf148e3(0xe4))),console['log'](formatValidationResult(_0x2c6916,_0x33b740,_0x2a2db0))):(console[_0xf148e3(0xf9)](a51_0x3c8dc0[_0xf148e3(0xf1)]('✖\x20'+_0x2a2db0)+a51_0x3c8dc0[_0xf148e3(0xfd)]('\x20('+_0x508f37+_0xf148e3(0xef)+_0x2c6916[_0xf148e3(0xeb)]['length']+_0xf148e3(0xd8))),console['log'](formatValidationResult(_0x2c6916,_0x33b740,_0x2a2db0)));}return console[_0xf148e3(0xf9)](''),_0x1f8ffd[_0xf148e3(0xe2)]?(console[_0xf148e3(0xf9)](a51_0x3c8dc0[_0xf148e3(0xf1)](_0xf148e3(0xf6)+_0x1f8ffd[_0xf148e3(0xd4)]+_0xf148e3(0xe8)+_0x1f8ffd[_0xf148e3(0xee)]+_0xf148e3(0xf0))),_0x1f8ffd[_0xf148e3(0xdd)]>0x0&&console['log'](a51_0x3c8dc0[_0xf148e3(0xce)](_0x1f8ffd[_0xf148e3(0xdd)]+'\x20warning(s)\x20found')),0x1):(console['log'](a51_0x3c8dc0['green']('✔\x20All\x20'+_0x1f8ffd[_0xf148e3(0xee)]+_0xf148e3(0xd1))),_0x1f8ffd[_0xf148e3(0xdd)]>0x0&&console['log'](a51_0x3c8dc0[_0xf148e3(0xce)](_0x1f8ffd[_0xf148e3(0xdd)]+_0xf148e3(0xd5))),0x0);}}
@@ -1 +1 @@
1
- const a51_0x6fdc85=a51_0x2713;(function(_0x532ff5,_0x43da90){const _0x4ec013=a51_0x2713,_0xde66ef=_0x532ff5();while(!![]){try{const _0x12c2a5=parseInt(_0x4ec013(0x1cd))/0x1*(parseInt(_0x4ec013(0x1f3))/0x2)+-parseInt(_0x4ec013(0x1ea))/0x3+parseInt(_0x4ec013(0x1f5))/0x4+-parseInt(_0x4ec013(0x1c1))/0x5+-parseInt(_0x4ec013(0x202))/0x6+-parseInt(_0x4ec013(0x1ed))/0x7+parseInt(_0x4ec013(0x1de))/0x8*(parseInt(_0x4ec013(0x1c7))/0x9);if(_0x12c2a5===_0x43da90)break;else _0xde66ef['push'](_0xde66ef['shift']());}catch(_0x5a31b2){_0xde66ef['push'](_0xde66ef['shift']());}}}(a51_0x1234,0xba246));function a51_0x1234(){const _0xd71afd=['error','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x20matching\x20\x27','jsonl',',\x20and\x20','segment','execute','Listing\x20folders,\x20segments,\x20and\x20journeys...','padEnd','\x27...','folderId','2380140pLKpYt','\x5c$&','folders','listUnified','✔\x20Built\x20tree\x20with\x20','Found\x20','message',']\x20matching\x20\x27','No\x20items\x20match\x20pattern:\x20','journey','Folder/pattern\x20arg:\x20','Resolving\x20parent\x20segment\x20\x27','\x20—\x20that\x27s\x20a\x20lot\x20to\x20eyeball.\x20Narrow\x20the\x20pattern\x20(add\x20more\x20of\x20the\x20name,\x20or\x20use\x20*\x20/\x20?),\x20or\x20use\x20--format\x20json\x20and\x20filter\x20with\x20jq/grep.','replace','Error:\x20No\x20parent\x20segment\x20context\x20set.','length','parentId','Building\x20hierarchy\x20tree...','maxDepth','\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.','\x20match','toLowerCase','map','6184960RipKZo','segments','size','List\x20folders\x20and\x20child\x20segments','localeCompare','data','18nSgbaI','/j/da','log','Recursive\x20mode:\x20enabled','json','listRecursive','4ZKMrgP','cause','type','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','listWithPattern','dim','listUnifiedWithJourneys','/e/','format','folder','test','Folder\x20ID:\x20','Searching\x20the\x20tree\x20for\x20names\x20matching\x20','No\x20folders\x20or\x20segments\x20match\x20','journeys','verbose','\x20\x20Cause:\x20','3355200EBRDVq','Error:\x20','...','Resolving\x20path\x20\x27','filter','site','journeyBundleName','sort','recursive','path','/app/ps/','includes','544722vBCUWv','(not\x20set)','name','5880266VVDGFZ','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','description','(id\x20','resolvePathToResource','searchByName','724874YpqIbD','children','4516736SoaAQn','\x20folder'];a51_0x1234=function(){return _0xd71afd;};return a51_0x1234();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a51_0x2713(_0x442e66,_0x56fbdd){_0x442e66=_0x442e66-0x1b4;const _0x1234bf=a51_0x1234();let _0x271382=_0x1234bf[_0x442e66];return _0x271382;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a51_0x183782 from'chalk';export class SegmentsCommand extends BaseCommand{[a51_0x6fdc85(0x1ec)]=a51_0x6fdc85(0x1c2);[a51_0x6fdc85(0x1ef)]=a51_0x6fdc85(0x1c4);async[a51_0x6fdc85(0x1fd)](_0xacf72b){const _0x469311=a51_0x6fdc85,{options:_0x2ab0cd,args:_0x34b664}=_0xacf72b,_0x506da2=_0x2ab0cd[_0x469311(0x1e6)],_0x7ee7fa=_0x34b664[0x0];try{const _0x5ab5f0=_0x2ab0cd['parentSegment'];_0x2ab0cd[_0x469311(0x1dc)]&&(console[_0x469311(0x1f7)]('Site:\x20'+_0x2ab0cd[_0x469311(0x1e3)]),console[_0x469311(0x1f7)]('Parent\x20segment\x20context:\x20'+(_0x5ab5f0||_0x469311(0x1eb))),_0x7ee7fa&&console[_0x469311(0x1f7)](_0x469311(0x1b4)+_0x7ee7fa),_0x506da2&&console['error'](_0x469311(0x1ca)));if(!_0x5ab5f0)return console[_0x469311(0x1f7)](_0x469311(0x1b8)),console[_0x469311(0x1f7)](''),console['error']('Set\x20a\x20parent\x20segment\x20context\x20first:'),console['error'](_0x469311(0x1d0)),console[_0x469311(0x1f7)](_0x469311(0x1f8)),console['error'](''),console[_0x469311(0x1f7)](_0x469311(0x1ee)),0x1;if(_0x7ee7fa&&_0x506da2)return await this[_0x469311(0x1f2)](_0xacf72b,_0x5ab5f0,_0x7ee7fa);const _0x4a155f=_0x7ee7fa&&(_0x7ee7fa['includes']('*')||_0x7ee7fa[_0x469311(0x1e9)]('?'));if(_0x4a155f)return await this[_0x469311(0x1d1)](_0xacf72b,_0x5ab5f0,_0x7ee7fa);const _0x2bb657=_0x7ee7fa?_0x5ab5f0+'/'+_0x7ee7fa:_0x5ab5f0;return _0x506da2?await this[_0x469311(0x1cc)](_0xacf72b,_0x2bb657):await this[_0x469311(0x205)](_0xacf72b,_0x2bb657);}catch(_0xf59061){if(_0xf59061 instanceof SDKError)return console[_0x469311(0x1f7)](_0x469311(0x1df)+_0xf59061[_0x469311(0x208)]),_0xf59061[_0x469311(0x1ce)]&&console['error'](_0x469311(0x1dd)+_0xf59061[_0x469311(0x1ce)]),0x1;throw _0xf59061;}}async[a51_0x6fdc85(0x1f2)](_0x57dc68,_0x2775a6,_0x3a4b46){const _0x1d3e94=a51_0x6fdc85,{options:_0x4f60c4,tdx:_0xaeb620}=_0x57dc68,_0x34e0ee='\x22'+_0x3a4b46+'\x22',_0x329414=await withSpinner(_0x1d3e94(0x1e1)+_0x2775a6+_0x1d3e94(0x200),()=>_0xaeb620[_0x1d3e94(0x1fc)]['resolvePathToResource'](_0x2775a6),{'verbose':_0x4f60c4['verbose']}),_0x559367=_0x329414['data'],_0x5373ee=_0x4f60c4[_0x1d3e94(0x1bc)]||0xa,_0x56970b=await withSpinner(_0x1d3e94(0x1d9)+_0x34e0ee+_0x1d3e94(0x1e0),()=>_0xaeb620['segment'][_0x1d3e94(0x1cc)](_0x559367[_0x1d3e94(0x1ba)],_0x559367[_0x1d3e94(0x201)],0x0,_0x5373ee),{'verbose':_0x4f60c4['verbose']}),_0xfc62cb=searchTreeByName(_0x56970b['data'],_0x3a4b46),_0x2be7a0=_0x522d65=>getConsoleNextUrl(_0x4f60c4[_0x1d3e94(0x1e3)],_0x1d3e94(0x1e8)+_0x559367[_0x1d3e94(0x1ba)]+_0x1d3e94(0x1d4)+_0x522d65),_0x531eee=[..._0xfc62cb][_0x1d3e94(0x1e5)]((_0x13e99a,_0x453932)=>_0x13e99a[_0x1d3e94(0x1e7)][_0x1d3e94(0x1c5)](_0x453932['path'])),_0xd0eeea=0x32,_0x343981=_0x1d3e94(0x207)+_0xfc62cb[_0x1d3e94(0x1b9)]+_0x1d3e94(0x1be)+(_0xfc62cb[_0x1d3e94(0x1b9)]!==0x1?'es':'');console[_0x1d3e94(0x1f7)](_0xfc62cb[_0x1d3e94(0x1b9)]>_0xd0eeea?'✔\x20'+_0x343981+_0x1d3e94(0x1b6):'✔\x20'+_0x343981);if(_0x4f60c4[_0x1d3e94(0x1d5)]==='json'||_0x4f60c4['format']===_0x1d3e94(0x1fa)){const _0x4751ca=_0x531eee['map'](_0x1d343c=>({..._0x1d343c,..._0x1d343c[_0x1d3e94(0x1cf)]===_0x1d3e94(0x1fc)?{'url':_0x2be7a0(_0x1d343c['id'])}:{}}));return await handleSDKOutput(_0x4751ca,_0x4f60c4),0x0;}if(_0xfc62cb[_0x1d3e94(0x1b9)]===0x0)return console[_0x1d3e94(0x1c9)](_0x1d3e94(0x1da)+_0x34e0ee),0x0;for(const _0x2dd5dc of _0x531eee){console['log'](_0x2dd5dc[_0x1d3e94(0x1cf)][_0x1d3e94(0x1ff)](0x8)+'\x20'+_0x2dd5dc[_0x1d3e94(0x1e7)]+'\x20\x20'+a51_0x183782[_0x1d3e94(0x1d2)](_0x1d3e94(0x1f0)+_0x2dd5dc['id']+')'));}const _0x3435c9=_0xfc62cb['filter'](_0x483ed0=>_0x483ed0[_0x1d3e94(0x1cf)]===_0x1d3e94(0x1fc)),_0x3f8cc6=new Set(_0x3435c9[_0x1d3e94(0x1c0)](_0x35bccf=>_0x35bccf[_0x1d3e94(0x1ec)][_0x1d3e94(0x1bf)]()))[_0x1d3e94(0x1c3)]===0x1;return _0x3435c9[_0x1d3e94(0x1b9)]>0x1&&_0x3f8cc6&&console['log'](a51_0x183782[_0x1d3e94(0x1d2)]('\x0a'+_0x3435c9[_0x1d3e94(0x1b9)]+_0x1d3e94(0x1bd))),0x0;}async['listWithPattern'](_0x3a9d81,_0x82c7cb,_0x4e2efc){const _0x710e65=a51_0x6fdc85,{options:_0x118fac,tdx:_0x3f86ed}=_0x3a9d81,_0x464747=await withSpinner(_0x710e65(0x1b5)+_0x82c7cb+_0x710e65(0x200),()=>_0x3f86ed[_0x710e65(0x1fc)]['resolvePathToResource'](_0x82c7cb),{'verbose':_0x118fac[_0x710e65(0x1dc)]}),_0xd6edb7=_0x464747[_0x710e65(0x1c6)],_0x1e850a=await withSpinner(_0x710e65(0x1fe),()=>_0x3f86ed[_0x710e65(0x1fc)][_0x710e65(0x1d3)](_0xd6edb7[_0x710e65(0x1ba)],_0xd6edb7[_0x710e65(0x201)]),{'verbose':_0x118fac['verbose']}),{folders:_0x488192,segments:_0x449170,journeys:_0x17fe39}=_0x1e850a[_0x710e65(0x1c6)],_0x1b901a=_0x4e2efc[_0x710e65(0x1b7)](/[.+^${}()|[\]\\]/g,_0x710e65(0x203))[_0x710e65(0x1b7)](/\*/g,'.*')[_0x710e65(0x1b7)](/\?/g,'.'),_0x256e4f=new RegExp('^'+_0x1b901a+'$','i'),_0x88a947=_0x488192['filter'](_0x3bad02=>_0x256e4f[_0x710e65(0x1d7)](_0x3bad02[_0x710e65(0x1ec)])),_0x278432=_0x449170[_0x710e65(0x1e2)](_0x18a554=>_0x256e4f[_0x710e65(0x1d7)](_0x18a554[_0x710e65(0x1ec)])),_0x41dd00=_0x17fe39[_0x710e65(0x1e2)](_0x1ed81c=>_0x256e4f[_0x710e65(0x1d7)](_0x1ed81c[_0x710e65(0x1e4)])),_0x366392=_0x88a947['length']+_0x278432[_0x710e65(0x1b9)]+_0x41dd00[_0x710e65(0x1b9)];console[_0x710e65(0x1f7)]('✔\x20Found\x20'+_0x88a947[_0x710e65(0x1b9)]+_0x710e65(0x1f6)+(_0x88a947[_0x710e65(0x1b9)]!==0x1?'s':'')+',\x20'+_0x278432['length']+'\x20segment'+(_0x278432[_0x710e65(0x1b9)]!==0x1?'s':'')+_0x710e65(0x1fb)+_0x41dd00[_0x710e65(0x1b9)]+'\x20journey'+(_0x41dd00['length']!==0x1?'s':'')+_0x710e65(0x1f9)+_0x4e2efc+'\x27');const _0x4a1ad5=_0x5aae67=>{const _0x39e294=_0x710e65;return getConsoleNextUrl(_0x118fac['site'],_0x39e294(0x1e8)+_0xd6edb7['parentId']+_0x39e294(0x1d4)+_0x5aae67);},_0x2a3c6f=_0x118fac[_0x710e65(0x1d5)]===_0x710e65(0x1cb)||_0x118fac[_0x710e65(0x1d5)]===_0x710e65(0x1fa);if(_0x2a3c6f){const _0x3218ca=[..._0x88a947[_0x710e65(0x1c0)](_0x30379f=>({..._0x30379f,'type':'folder'})),..._0x278432[_0x710e65(0x1c0)](_0x5b36a5=>({..._0x5b36a5,'type':_0x710e65(0x1fc),'url':_0x4a1ad5(_0x5b36a5['id'])})),..._0x41dd00[_0x710e65(0x1c0)](_0x35b9ae=>({..._0x35b9ae,'name':_0x35b9ae[_0x710e65(0x1e4)],'type':_0x710e65(0x20b)}))][_0x710e65(0x1e5)]((_0x4517c3,_0x548a03)=>_0x4517c3[_0x710e65(0x1ec)][_0x710e65(0x1c5)](_0x548a03[_0x710e65(0x1ec)]));await handleSDKOutput(_0x3218ca,_0x118fac);}else{if(_0x366392===0x0)console[_0x710e65(0x1c9)](_0x710e65(0x20a)+_0x4e2efc);else{console['log'](a51_0x183782[_0x710e65(0x1d2)]('['+_0x82c7cb+_0x710e65(0x209)+_0x4e2efc+'\x27'));const _0x58af14=formatFlatList(_0x88a947,_0x278432,{'showMetadata':!![],'getSegmentUrl':_0x4a1ad5},_0x41dd00);console[_0x710e65(0x1c9)](_0x58af14);}}return 0x0;}async[a51_0x6fdc85(0x205)](_0x285dbe,_0x3bed5e){const _0x13a941=a51_0x6fdc85,{options:_0x38e0f8,tdx:_0x2e1678}=_0x285dbe,_0x2f46ab=await withSpinner(_0x13a941(0x1e1)+_0x3bed5e+_0x13a941(0x200),()=>_0x2e1678[_0x13a941(0x1fc)][_0x13a941(0x1f1)](_0x3bed5e),{'verbose':_0x38e0f8[_0x13a941(0x1dc)]}),_0x19e7ef=_0x2f46ab[_0x13a941(0x1c6)];_0x38e0f8['verbose']&&(console[_0x13a941(0x1f7)]('Parent\x20ID:\x20'+_0x19e7ef[_0x13a941(0x1ba)]),_0x19e7ef[_0x13a941(0x201)]&&console[_0x13a941(0x1f7)](_0x13a941(0x1d8)+_0x19e7ef[_0x13a941(0x201)]));const _0x463e8d=await withSpinner(_0x13a941(0x1fe),()=>_0x2e1678[_0x13a941(0x1fc)]['listUnifiedWithJourneys'](_0x19e7ef['parentId'],_0x19e7ef[_0x13a941(0x201)]),{'verbose':_0x38e0f8[_0x13a941(0x1dc)]}),{folders:_0x1611f2,segments:_0x2a46a7,journeys:_0x2632c3}=_0x463e8d[_0x13a941(0x1c6)],_0xaa3c70=_0x1611f2['length']+_0x2a46a7['length']+_0x2632c3[_0x13a941(0x1b9)];console['error']('✔\x20Found\x20'+_0x1611f2['length']+_0x13a941(0x1f6)+(_0x1611f2[_0x13a941(0x1b9)]!==0x1?'s':'')+',\x20'+_0x2a46a7[_0x13a941(0x1b9)]+'\x20segment'+(_0x2a46a7[_0x13a941(0x1b9)]!==0x1?'s':'')+_0x13a941(0x1fb)+_0x2632c3[_0x13a941(0x1b9)]+'\x20journey'+(_0x2632c3['length']!==0x1?'s':''));const _0x140168=_0x51bb42=>{const _0x163407=_0x13a941;return getConsoleNextUrl(_0x38e0f8[_0x163407(0x1e3)],_0x163407(0x1e8)+_0x19e7ef[_0x163407(0x1ba)]+'/e/'+_0x51bb42);},_0x4f08b3=_0x16a8a3=>{const _0x539a72=_0x13a941;return getConsoleNextUrl(_0x38e0f8[_0x539a72(0x1e3)],_0x539a72(0x1e8)+_0x19e7ef[_0x539a72(0x1ba)]+_0x539a72(0x1d4)+_0x16a8a3+_0x539a72(0x1c8));},_0x1b118a=_0x38e0f8[_0x13a941(0x1d5)]===_0x13a941(0x1cb)||_0x38e0f8[_0x13a941(0x1d5)]==='jsonl';if(_0x1b118a){const _0x547534=[..._0x1611f2[_0x13a941(0x1c0)](_0x1ef8fb=>({..._0x1ef8fb,'type':_0x13a941(0x1d6)})),..._0x2a46a7[_0x13a941(0x1c0)](_0x467c44=>({..._0x467c44,'type':_0x13a941(0x1fc),'url':_0x140168(_0x467c44['id'])})),..._0x2632c3[_0x13a941(0x1c0)](_0x10a304=>({..._0x10a304,'name':_0x10a304[_0x13a941(0x1e4)],'type':_0x13a941(0x20b),'url':_0x4f08b3(_0x10a304['id'])}))][_0x13a941(0x1e5)]((_0xde0826,_0x34dd25)=>_0xde0826[_0x13a941(0x1ec)][_0x13a941(0x1c5)](_0x34dd25[_0x13a941(0x1ec)]));await handleSDKOutput(_0x547534,_0x38e0f8);}else{if(_0xaa3c70===0x0)console[_0x13a941(0x1c9)](a51_0x183782[_0x13a941(0x1d2)]('['+_0x3bed5e+']')),console[_0x13a941(0x1c9)]('(empty)');else{console[_0x13a941(0x1c9)](a51_0x183782['dim']('['+_0x3bed5e+']'));const _0x4e0597=formatFlatList(_0x1611f2,_0x2a46a7,{'showMetadata':!![],'getSegmentUrl':_0x140168,'getJourneyUrl':_0x4f08b3},_0x2632c3);console['log'](_0x4e0597);}}return 0x0;}async[a51_0x6fdc85(0x1cc)](_0x290a4e,_0x1b8f3e){const _0x4ef054=a51_0x6fdc85,{options:_0x3ce9ee,tdx:_0x123c0}=_0x290a4e,_0x269030=await withSpinner(_0x4ef054(0x1e1)+_0x1b8f3e+'\x27...',()=>_0x123c0[_0x4ef054(0x1fc)][_0x4ef054(0x1f1)](_0x1b8f3e),{'verbose':_0x3ce9ee['verbose']}),_0x3e310f=_0x269030[_0x4ef054(0x1c6)];_0x3ce9ee[_0x4ef054(0x1dc)]&&(console[_0x4ef054(0x1f7)]('Parent\x20ID:\x20'+_0x3e310f[_0x4ef054(0x1ba)]),_0x3e310f['folderId']&&console[_0x4ef054(0x1f7)](_0x4ef054(0x1d8)+_0x3e310f[_0x4ef054(0x201)]));const _0x4a098c=_0x3ce9ee['maxDepth']||0xa,_0x526ecd=await withSpinner(_0x4ef054(0x1bb),()=>_0x123c0[_0x4ef054(0x1fc)]['listRecursive'](_0x3e310f[_0x4ef054(0x1ba)],_0x3e310f[_0x4ef054(0x201)],0x0,_0x4a098c),{'verbose':_0x3ce9ee['verbose']}),_0x33be6e=_0x526ecd[_0x4ef054(0x1c6)],_0x3edce4=_0x531b5d=>{const _0x59dd6d=_0x4ef054;let _0x4ab398=0x0,_0x3ced55=0x0,_0x28996c=0x0;for(const _0xa9d63c of _0x531b5d){if(_0xa9d63c['type']===_0x59dd6d(0x1d6))_0x4ab398++;else{if(_0xa9d63c[_0x59dd6d(0x1cf)]===_0x59dd6d(0x1fc))_0x3ced55++;else{if(_0xa9d63c['type']==='journey')_0x28996c++;}}if(_0xa9d63c[_0x59dd6d(0x1f4)]){const _0x1a3f31=_0x3edce4(_0xa9d63c[_0x59dd6d(0x1f4)]);_0x4ab398+=_0x1a3f31[_0x59dd6d(0x204)],_0x3ced55+=_0x1a3f31[_0x59dd6d(0x1c2)],_0x28996c+=_0x1a3f31[_0x59dd6d(0x1db)];}}return{'folders':_0x4ab398,'segments':_0x3ced55,'journeys':_0x28996c};},_0x16cf64=_0x3edce4(_0x33be6e);console['error'](_0x4ef054(0x206)+_0x16cf64[_0x4ef054(0x204)]+_0x4ef054(0x1f6)+(_0x16cf64[_0x4ef054(0x204)]!==0x1?'s':'')+',\x20'+_0x16cf64[_0x4ef054(0x1c2)]+'\x20segment'+(_0x16cf64[_0x4ef054(0x1c2)]!==0x1?'s':'')+_0x4ef054(0x1fb)+_0x16cf64[_0x4ef054(0x1db)]+'\x20journey'+(_0x16cf64[_0x4ef054(0x1db)]!==0x1?'s':''));const _0x4dd06d=_0x39554b=>{const _0x3b89de=_0x4ef054;return getConsoleNextUrl(_0x3ce9ee[_0x3b89de(0x1e3)],_0x3b89de(0x1e8)+_0x3e310f[_0x3b89de(0x1ba)]+_0x3b89de(0x1d4)+_0x39554b);},_0x52881f=_0x16fc50=>{const _0x1de95d=_0x4ef054;return getConsoleNextUrl(_0x3ce9ee[_0x1de95d(0x1e3)],'/app/ps/'+_0x3e310f[_0x1de95d(0x1ba)]+_0x1de95d(0x1d4)+_0x16fc50+_0x1de95d(0x1c8));};if(_0x3ce9ee[_0x4ef054(0x1d5)]==='json'||_0x3ce9ee[_0x4ef054(0x1d5)]===_0x4ef054(0x1fa))await handleSDKOutput(_0x33be6e,_0x3ce9ee);else{console[_0x4ef054(0x1c9)](a51_0x183782[_0x4ef054(0x1d2)]('['+_0x1b8f3e+']'));const _0x3a9d47=formatTree(_0x33be6e,{'showMetadata':!![],'getSegmentUrl':_0x4dd06d,'getJourneyUrl':_0x52881f});console[_0x4ef054(0x1c9)](_0x3a9d47);}return 0x0;}}
1
+ function a52_0x584a(_0x176968,_0x8beb8d){_0x176968=_0x176968-0x1b5;const _0x21a63e=a52_0x21a6();let _0x584a9b=_0x21a63e[_0x176968];return _0x584a9b;}const a52_0x4d558d=a52_0x584a;(function(_0x891351,_0x1603ef){const _0x5413a6=a52_0x584a,_0x5501d6=_0x891351();while(!![]){try{const _0x1d63ca=parseInt(_0x5413a6(0x1ce))/0x1+-parseInt(_0x5413a6(0x1ea))/0x2+-parseInt(_0x5413a6(0x1bd))/0x3*(parseInt(_0x5413a6(0x1fb))/0x4)+-parseInt(_0x5413a6(0x1e3))/0x5+parseInt(_0x5413a6(0x1d5))/0x6*(parseInt(_0x5413a6(0x1fa))/0x7)+parseInt(_0x5413a6(0x1c0))/0x8+parseInt(_0x5413a6(0x203))/0x9;if(_0x1d63ca===_0x1603ef)break;else _0x5501d6['push'](_0x5501d6['shift']());}catch(_0x20039b){_0x5501d6['push'](_0x5501d6['shift']());}}}(a52_0x21a6,0x7338b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a52_0x3f0ca0 from'chalk';export class SegmentsCommand extends BaseCommand{[a52_0x4d558d(0x1c3)]=a52_0x4d558d(0x1d8);[a52_0x4d558d(0x1b7)]='List\x20folders\x20and\x20child\x20segments';async[a52_0x4d558d(0x1e0)](_0xfe132f){const _0xe82d97=a52_0x4d558d,{options:_0x50e56c,args:_0x462017}=_0xfe132f,_0x1cadeb=_0x50e56c[_0xe82d97(0x1b9)],_0x39a78a=_0x462017[0x0];try{const _0x54c646=_0x50e56c[_0xe82d97(0x1c4)];_0x50e56c[_0xe82d97(0x1b8)]&&(console['error'](_0xe82d97(0x1da)+_0x50e56c['site']),console[_0xe82d97(0x1f5)](_0xe82d97(0x1de)+(_0x54c646||_0xe82d97(0x1f6))),_0x39a78a&&console[_0xe82d97(0x1f5)]('Folder/pattern\x20arg:\x20'+_0x39a78a),_0x1cadeb&&console[_0xe82d97(0x1f5)](_0xe82d97(0x1d4)));if(!_0x54c646)return console[_0xe82d97(0x1f5)](_0xe82d97(0x1e8)),console['error'](''),console[_0xe82d97(0x1f5)](_0xe82d97(0x1d3)),console['error'](_0xe82d97(0x1be)),console[_0xe82d97(0x1f5)](_0xe82d97(0x1f3)),console[_0xe82d97(0x1f5)](''),console[_0xe82d97(0x1f5)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;if(_0x39a78a&&_0x1cadeb)return await this['searchByName'](_0xfe132f,_0x54c646,_0x39a78a);const _0x4fcdf9=_0x39a78a&&(_0x39a78a[_0xe82d97(0x20c)]('*')||_0x39a78a[_0xe82d97(0x20c)]('?'));if(_0x4fcdf9)return await this[_0xe82d97(0x1cd)](_0xfe132f,_0x54c646,_0x39a78a);const _0x5a6662=_0x39a78a?_0x54c646+'/'+_0x39a78a:_0x54c646;return _0x1cadeb?await this[_0xe82d97(0x1c2)](_0xfe132f,_0x5a6662):await this['listUnified'](_0xfe132f,_0x5a6662);}catch(_0x2a95c7){if(_0x2a95c7 instanceof SDKError)return console['error'](_0xe82d97(0x1d6)+_0x2a95c7[_0xe82d97(0x1b6)]),_0x2a95c7[_0xe82d97(0x1ec)]&&console[_0xe82d97(0x1f5)](_0xe82d97(0x200)+_0x2a95c7[_0xe82d97(0x1ec)]),0x1;throw _0x2a95c7;}}async[a52_0x4d558d(0x1d2)](_0x2c9852,_0x562679,_0x23db2d){const _0x577c9b=a52_0x4d558d,{options:_0x57f85c,tdx:_0x3dce4a}=_0x2c9852,_0x54922a='\x22'+_0x23db2d+'\x22',_0x3d7ce6=await withSpinner(_0x577c9b(0x1d9)+_0x562679+_0x577c9b(0x1bb),()=>_0x3dce4a[_0x577c9b(0x1f2)][_0x577c9b(0x1e6)](_0x562679),{'verbose':_0x57f85c['verbose']}),_0x28156b=_0x3d7ce6['data'],_0x36ac9b=_0x57f85c[_0x577c9b(0x1e5)]||0xa,_0x11bade=await withSpinner(_0x577c9b(0x1cc)+_0x54922a+_0x577c9b(0x1c6),()=>_0x3dce4a[_0x577c9b(0x1f2)][_0x577c9b(0x1c2)](_0x28156b[_0x577c9b(0x1f1)],_0x28156b[_0x577c9b(0x1e1)],0x0,_0x36ac9b),{'verbose':_0x57f85c['verbose']}),_0x4016d0=searchTreeByName(_0x11bade[_0x577c9b(0x1ff)],_0x23db2d),_0x53c6aa=_0x4bb9ef=>getConsoleNextUrl(_0x57f85c['site'],_0x577c9b(0x1f9)+_0x28156b['parentId']+_0x577c9b(0x206)+_0x4bb9ef),_0x282c57=[..._0x4016d0][_0x577c9b(0x20a)]((_0x3533a5,_0x74204f)=>_0x3533a5[_0x577c9b(0x1d0)][_0x577c9b(0x1c7)](_0x74204f[_0x577c9b(0x1d0)])),_0xf760e8=0x32,_0x51f7f5=_0x577c9b(0x1cb)+_0x4016d0['length']+_0x577c9b(0x1e9)+(_0x4016d0[_0x577c9b(0x209)]!==0x1?'es':'');console[_0x577c9b(0x1f5)](_0x4016d0[_0x577c9b(0x209)]>_0xf760e8?'✔\x20'+_0x51f7f5+_0x577c9b(0x1d7):'✔\x20'+_0x51f7f5);if(_0x57f85c[_0x577c9b(0x20d)]===_0x577c9b(0x1f4)||_0x57f85c[_0x577c9b(0x20d)]===_0x577c9b(0x1fc)){const _0x923f33=_0x282c57[_0x577c9b(0x202)](_0x475567=>({..._0x475567,..._0x475567[_0x577c9b(0x1c1)]===_0x577c9b(0x1f2)?{'url':_0x53c6aa(_0x475567['id'])}:{}}));return await handleSDKOutput(_0x923f33,_0x57f85c),0x0;}if(_0x4016d0['length']===0x0)return console[_0x577c9b(0x1e7)](_0x577c9b(0x1c9)+_0x54922a),0x0;for(const _0x342a03 of _0x282c57){console['log'](_0x342a03[_0x577c9b(0x1c1)][_0x577c9b(0x1dd)](0x8)+'\x20'+_0x342a03[_0x577c9b(0x1d0)]+'\x20\x20'+a52_0x3f0ca0['dim'](_0x577c9b(0x1eb)+_0x342a03['id']+')'));}const _0x151a0a=_0x4016d0[_0x577c9b(0x208)](_0x49db5b=>_0x49db5b[_0x577c9b(0x1c1)]===_0x577c9b(0x1f2)),_0x241fad=new Set(_0x151a0a[_0x577c9b(0x202)](_0x43b11c=>_0x43b11c['name'][_0x577c9b(0x20b)]()))[_0x577c9b(0x1e4)]===0x1;return _0x151a0a[_0x577c9b(0x209)]>0x1&&_0x241fad&&console[_0x577c9b(0x1e7)](a52_0x3f0ca0[_0x577c9b(0x1db)]('\x0a'+_0x151a0a['length']+'\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.')),0x0;}async['listWithPattern'](_0x1cd9a8,_0x390af1,_0x35f9fe){const _0x11cd8f=a52_0x4d558d,{options:_0x5815cb,tdx:_0x1b4398}=_0x1cd9a8,_0x3c0ba0=await withSpinner(_0x11cd8f(0x1f0)+_0x390af1+_0x11cd8f(0x1bb),()=>_0x1b4398['segment'][_0x11cd8f(0x1e6)](_0x390af1),{'verbose':_0x5815cb['verbose']}),_0xf4ac81=_0x3c0ba0[_0x11cd8f(0x1ff)],_0x285465=await withSpinner(_0x11cd8f(0x205),()=>_0x1b4398['segment']['listUnifiedWithJourneys'](_0xf4ac81[_0x11cd8f(0x1f1)],_0xf4ac81[_0x11cd8f(0x1e1)]),{'verbose':_0x5815cb[_0x11cd8f(0x1b8)]}),{folders:_0x5b6a17,segments:_0x31c319,journeys:_0xc12c61}=_0x285465[_0x11cd8f(0x1ff)],_0x422ab6=_0x35f9fe['replace'](/[.+^${}()|[\]\\]/g,_0x11cd8f(0x1bf))[_0x11cd8f(0x1f8)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x673797=new RegExp('^'+_0x422ab6+'$','i'),_0x53ae15=_0x5b6a17[_0x11cd8f(0x208)](_0x4bbbaa=>_0x673797[_0x11cd8f(0x1dc)](_0x4bbbaa[_0x11cd8f(0x1c3)])),_0x340c61=_0x31c319[_0x11cd8f(0x208)](_0x11b32b=>_0x673797[_0x11cd8f(0x1dc)](_0x11b32b[_0x11cd8f(0x1c3)])),_0xcb7454=_0xc12c61[_0x11cd8f(0x208)](_0x4390ef=>_0x673797[_0x11cd8f(0x1dc)](_0x4390ef[_0x11cd8f(0x1ef)])),_0x5f2cff=_0x53ae15['length']+_0x340c61[_0x11cd8f(0x209)]+_0xcb7454[_0x11cd8f(0x209)];console[_0x11cd8f(0x1f5)](_0x11cd8f(0x201)+_0x53ae15['length']+_0x11cd8f(0x1ca)+(_0x53ae15['length']!==0x1?'s':'')+',\x20'+_0x340c61[_0x11cd8f(0x209)]+_0x11cd8f(0x1b5)+(_0x340c61['length']!==0x1?'s':'')+_0x11cd8f(0x204)+_0xcb7454[_0x11cd8f(0x209)]+'\x20journey'+(_0xcb7454['length']!==0x1?'s':'')+_0x11cd8f(0x1ed)+_0x35f9fe+'\x27');const _0xa2b53d=_0x3fd957=>{const _0x308aee=_0x11cd8f;return getConsoleNextUrl(_0x5815cb['site'],_0x308aee(0x1f9)+_0xf4ac81[_0x308aee(0x1f1)]+'/e/'+_0x3fd957);},_0x5d96ad=_0x5815cb[_0x11cd8f(0x20d)]===_0x11cd8f(0x1f4)||_0x5815cb[_0x11cd8f(0x20d)]===_0x11cd8f(0x1fc);if(_0x5d96ad){const _0xfb5d5b=[..._0x53ae15[_0x11cd8f(0x202)](_0x1cb5d8=>({..._0x1cb5d8,'type':_0x11cd8f(0x20e)})),..._0x340c61['map'](_0x38e9cf=>({..._0x38e9cf,'type':_0x11cd8f(0x1f2),'url':_0xa2b53d(_0x38e9cf['id'])})),..._0xcb7454[_0x11cd8f(0x202)](_0x153fd4=>({..._0x153fd4,'name':_0x153fd4[_0x11cd8f(0x1ef)],'type':_0x11cd8f(0x1bc)}))][_0x11cd8f(0x20a)]((_0x149a58,_0x393a52)=>_0x149a58[_0x11cd8f(0x1c3)][_0x11cd8f(0x1c7)](_0x393a52[_0x11cd8f(0x1c3)]));await handleSDKOutput(_0xfb5d5b,_0x5815cb);}else{if(_0x5f2cff===0x0)console[_0x11cd8f(0x1e7)]('No\x20items\x20match\x20pattern:\x20'+_0x35f9fe);else{console[_0x11cd8f(0x1e7)](a52_0x3f0ca0['dim']('['+_0x390af1+_0x11cd8f(0x1df)+_0x35f9fe+'\x27'));const _0x56bad9=formatFlatList(_0x53ae15,_0x340c61,{'showMetadata':!![],'getSegmentUrl':_0xa2b53d},_0xcb7454);console[_0x11cd8f(0x1e7)](_0x56bad9);}}return 0x0;}async['listUnified'](_0x45bf98,_0x1cc3ab){const _0x30d6fc=a52_0x4d558d,{options:_0x3923cf,tdx:_0xf12caf}=_0x45bf98,_0x3c68b2=await withSpinner(_0x30d6fc(0x1d9)+_0x1cc3ab+'\x27...',()=>_0xf12caf[_0x30d6fc(0x1f2)][_0x30d6fc(0x1e6)](_0x1cc3ab),{'verbose':_0x3923cf[_0x30d6fc(0x1b8)]}),_0x5d4045=_0x3c68b2['data'];_0x3923cf[_0x30d6fc(0x1b8)]&&(console[_0x30d6fc(0x1f5)](_0x30d6fc(0x1f7)+_0x5d4045[_0x30d6fc(0x1f1)]),_0x5d4045[_0x30d6fc(0x1e1)]&&console[_0x30d6fc(0x1f5)](_0x30d6fc(0x1fd)+_0x5d4045[_0x30d6fc(0x1e1)]));const _0x22240a=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0xf12caf[_0x30d6fc(0x1f2)][_0x30d6fc(0x1fe)](_0x5d4045['parentId'],_0x5d4045[_0x30d6fc(0x1e1)]),{'verbose':_0x3923cf[_0x30d6fc(0x1b8)]}),{folders:_0x5089b6,segments:_0x217067,journeys:_0x1eda24}=_0x22240a['data'],_0x5bee65=_0x5089b6['length']+_0x217067[_0x30d6fc(0x209)]+_0x1eda24[_0x30d6fc(0x209)];console[_0x30d6fc(0x1f5)](_0x30d6fc(0x201)+_0x5089b6[_0x30d6fc(0x209)]+_0x30d6fc(0x1ca)+(_0x5089b6[_0x30d6fc(0x209)]!==0x1?'s':'')+',\x20'+_0x217067[_0x30d6fc(0x209)]+_0x30d6fc(0x1b5)+(_0x217067[_0x30d6fc(0x209)]!==0x1?'s':'')+_0x30d6fc(0x204)+_0x1eda24['length']+_0x30d6fc(0x1c8)+(_0x1eda24[_0x30d6fc(0x209)]!==0x1?'s':''));const _0x297ab6=_0x412c18=>{const _0x4fd5ca=_0x30d6fc;return getConsoleNextUrl(_0x3923cf[_0x4fd5ca(0x1c5)],_0x4fd5ca(0x1f9)+_0x5d4045[_0x4fd5ca(0x1f1)]+_0x4fd5ca(0x206)+_0x412c18);},_0x43f208=_0x1805df=>{const _0x412e47=_0x30d6fc;return getConsoleNextUrl(_0x3923cf[_0x412e47(0x1c5)],_0x412e47(0x1f9)+_0x5d4045[_0x412e47(0x1f1)]+_0x412e47(0x206)+_0x1805df+_0x412e47(0x1d1));},_0x298436=_0x3923cf['format']===_0x30d6fc(0x1f4)||_0x3923cf['format']===_0x30d6fc(0x1fc);if(_0x298436){const _0x4403f1=[..._0x5089b6[_0x30d6fc(0x202)](_0x3e139b=>({..._0x3e139b,'type':_0x30d6fc(0x20e)})),..._0x217067['map'](_0x3b87af=>({..._0x3b87af,'type':'segment','url':_0x297ab6(_0x3b87af['id'])})),..._0x1eda24[_0x30d6fc(0x202)](_0x2cb38d=>({..._0x2cb38d,'name':_0x2cb38d[_0x30d6fc(0x1ef)],'type':_0x30d6fc(0x1bc),'url':_0x43f208(_0x2cb38d['id'])}))]['sort']((_0xf543e2,_0x43d653)=>_0xf543e2[_0x30d6fc(0x1c3)][_0x30d6fc(0x1c7)](_0x43d653['name']));await handleSDKOutput(_0x4403f1,_0x3923cf);}else{if(_0x5bee65===0x0)console[_0x30d6fc(0x1e7)](a52_0x3f0ca0[_0x30d6fc(0x1db)]('['+_0x1cc3ab+']')),console[_0x30d6fc(0x1e7)](_0x30d6fc(0x1ba));else{console['log'](a52_0x3f0ca0[_0x30d6fc(0x1db)]('['+_0x1cc3ab+']'));const _0x3daa45=formatFlatList(_0x5089b6,_0x217067,{'showMetadata':!![],'getSegmentUrl':_0x297ab6,'getJourneyUrl':_0x43f208},_0x1eda24);console[_0x30d6fc(0x1e7)](_0x3daa45);}}return 0x0;}async[a52_0x4d558d(0x1c2)](_0x2b3ca6,_0x40ff39){const _0x32988b=a52_0x4d558d,{options:_0x237598,tdx:_0x10423e}=_0x2b3ca6,_0x27c131=await withSpinner(_0x32988b(0x1d9)+_0x40ff39+_0x32988b(0x1bb),()=>_0x10423e['segment'][_0x32988b(0x1e6)](_0x40ff39),{'verbose':_0x237598[_0x32988b(0x1b8)]}),_0x388989=_0x27c131['data'];_0x237598['verbose']&&(console[_0x32988b(0x1f5)](_0x32988b(0x1f7)+_0x388989[_0x32988b(0x1f1)]),_0x388989[_0x32988b(0x1e1)]&&console[_0x32988b(0x1f5)](_0x32988b(0x1fd)+_0x388989['folderId']));const _0x5755b0=_0x237598[_0x32988b(0x1e5)]||0xa,_0x43426a=await withSpinner(_0x32988b(0x1ee),()=>_0x10423e[_0x32988b(0x1f2)][_0x32988b(0x1c2)](_0x388989[_0x32988b(0x1f1)],_0x388989[_0x32988b(0x1e1)],0x0,_0x5755b0),{'verbose':_0x237598[_0x32988b(0x1b8)]}),_0x620045=_0x43426a[_0x32988b(0x1ff)],_0x223b46=_0x36c091=>{const _0xd855f4=_0x32988b;let _0x3ae58f=0x0,_0x1d15dc=0x0,_0x485098=0x0;for(const _0x55c01b of _0x36c091){if(_0x55c01b[_0xd855f4(0x1c1)]===_0xd855f4(0x20e))_0x3ae58f++;else{if(_0x55c01b[_0xd855f4(0x1c1)]===_0xd855f4(0x1f2))_0x1d15dc++;else{if(_0x55c01b[_0xd855f4(0x1c1)]==='journey')_0x485098++;}}if(_0x55c01b[_0xd855f4(0x1e2)]){const _0x1e35ed=_0x223b46(_0x55c01b[_0xd855f4(0x1e2)]);_0x3ae58f+=_0x1e35ed[_0xd855f4(0x207)],_0x1d15dc+=_0x1e35ed[_0xd855f4(0x1d8)],_0x485098+=_0x1e35ed[_0xd855f4(0x1cf)];}}return{'folders':_0x3ae58f,'segments':_0x1d15dc,'journeys':_0x485098};},_0x35dd22=_0x223b46(_0x620045);console['error']('✔\x20Built\x20tree\x20with\x20'+_0x35dd22['folders']+_0x32988b(0x1ca)+(_0x35dd22[_0x32988b(0x207)]!==0x1?'s':'')+',\x20'+_0x35dd22[_0x32988b(0x1d8)]+'\x20segment'+(_0x35dd22[_0x32988b(0x1d8)]!==0x1?'s':'')+_0x32988b(0x204)+_0x35dd22['journeys']+_0x32988b(0x1c8)+(_0x35dd22['journeys']!==0x1?'s':''));const _0x3fc2a7=_0x2fae23=>{const _0x17efd8=_0x32988b;return getConsoleNextUrl(_0x237598['site'],_0x17efd8(0x1f9)+_0x388989['parentId']+_0x17efd8(0x206)+_0x2fae23);},_0xf4866e=_0x3c3ffa=>{const _0x7a2f95=_0x32988b;return getConsoleNextUrl(_0x237598[_0x7a2f95(0x1c5)],_0x7a2f95(0x1f9)+_0x388989[_0x7a2f95(0x1f1)]+'/e/'+_0x3c3ffa+_0x7a2f95(0x1d1));};if(_0x237598[_0x32988b(0x20d)]==='json'||_0x237598[_0x32988b(0x20d)]===_0x32988b(0x1fc))await handleSDKOutput(_0x620045,_0x237598);else{console[_0x32988b(0x1e7)](a52_0x3f0ca0[_0x32988b(0x1db)]('['+_0x40ff39+']'));const _0x2d0556=formatTree(_0x620045,{'showMetadata':!![],'getSegmentUrl':_0x3fc2a7,'getJourneyUrl':_0xf4866e});console[_0x32988b(0x1e7)](_0x2d0556);}return 0x0;}}function a52_0x21a6(){const _0x38f041=['Found\x20','Searching\x20the\x20tree\x20for\x20names\x20matching\x20','listWithPattern','906145oEBVxA','journeys','path','/j/da','searchByName','Set\x20a\x20parent\x20segment\x20context\x20first:','Recursive\x20mode:\x20enabled','2756604tBAYeu','Error:\x20','\x20—\x20that\x27s\x20a\x20lot\x20to\x20eyeball.\x20Narrow\x20the\x20pattern\x20(add\x20more\x20of\x20the\x20name,\x20or\x20use\x20*\x20/\x20?),\x20or\x20use\x20--format\x20json\x20and\x20filter\x20with\x20jq/grep.','segments','Resolving\x20path\x20\x27','Site:\x20','dim','test','padEnd','Parent\x20segment\x20context:\x20',']\x20matching\x20\x27','execute','folderId','children','434595coUdSI','size','maxDepth','resolvePathToResource','log','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x20match','1857036VdAAZH','(id\x20','cause','\x20matching\x20\x27','Building\x20hierarchy\x20tree...','journeyBundleName','Resolving\x20parent\x20segment\x20\x27','parentId','segment','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','json','error','(not\x20set)','Parent\x20ID:\x20','replace','/app/ps/','7OcFipc','3577156rMDOIf','jsonl','Folder\x20ID:\x20','listUnifiedWithJourneys','data','\x20\x20Cause:\x20','✔\x20Found\x20','map','2242116AHUDOn',',\x20and\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','/e/','folders','filter','length','sort','toLowerCase','includes','format','folder','\x20segment','message','description','verbose','recursive','(empty)','\x27...','journey','3FIUUMI','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x5c$&','6135760tCBaiG','type','listRecursive','name','parentSegment','site','...','localeCompare','\x20journey','No\x20folders\x20or\x20segments\x20match\x20','\x20folder'];a52_0x21a6=function(){return _0x38f041;};return a52_0x21a6();}