@treasuredata/tdx 2026.8.6 → 2026.8.7

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 (291) 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.d.ts +2 -1
  19. package/dist/commands/codex-command.d.ts.map +1 -1
  20. package/dist/commands/codex-command.js +1 -1
  21. package/dist/commands/codex-command.js.map +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/delivery-command.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-campaign-pull-command.js +1 -1
  31. package/dist/commands/engage-campaign-push-command.js +1 -1
  32. package/dist/commands/engage-campaign-validate-command.js +1 -1
  33. package/dist/commands/engage-command.d.ts.map +1 -1
  34. package/dist/commands/engage-command.js +1 -1
  35. package/dist/commands/engage-command.js.map +1 -1
  36. package/dist/commands/engage-template-pull-command.js +1 -1
  37. package/dist/commands/engage-template-push-command.js +1 -1
  38. package/dist/commands/engage-template-validate-command.js +1 -1
  39. package/dist/commands/job-command.js +1 -1
  40. package/dist/commands/journey-command.js +1 -1
  41. package/dist/commands/journey-validate-command.js +1 -1
  42. package/dist/commands/llm-command.js +1 -1
  43. package/dist/commands/mcp-command.js +1 -1
  44. package/dist/commands/p13n-command.d.ts +16 -1
  45. package/dist/commands/p13n-command.d.ts.map +1 -1
  46. package/dist/commands/p13n-command.js +1 -1
  47. package/dist/commands/p13n-command.js.map +1 -1
  48. package/dist/commands/parent-segment-command.js +1 -1
  49. package/dist/commands/policy-command.js +1 -1
  50. package/dist/commands/profile-command.js +1 -1
  51. package/dist/commands/profiles-command.js +1 -1
  52. package/dist/commands/query-command.js +1 -1
  53. package/dist/commands/schedule-command.js +1 -1
  54. package/dist/commands/segment-command.js +1 -1
  55. package/dist/commands/segment-create-command.js +1 -1
  56. package/dist/commands/segment-fields-command.js +1 -1
  57. package/dist/commands/segment-move-command.js +1 -1
  58. package/dist/commands/segment-pull-command.js +1 -1
  59. package/dist/commands/segment-push-command.js +1 -1
  60. package/dist/commands/segment-update-command.js +1 -1
  61. package/dist/commands/segment-use-command.js +1 -1
  62. package/dist/commands/segment-validate-command.js +1 -1
  63. package/dist/commands/segments.js +1 -1
  64. package/dist/commands/show.js +1 -1
  65. package/dist/commands/status-command.js +1 -1
  66. package/dist/commands/table-deleted.js +1 -1
  67. package/dist/commands/tables.js +1 -1
  68. package/dist/commands/unset-command.d.ts +1 -0
  69. package/dist/commands/unset-command.d.ts.map +1 -1
  70. package/dist/commands/unset-command.js +1 -1
  71. package/dist/commands/unset-command.js.map +1 -1
  72. package/dist/commands/upgrade-command.js +1 -1
  73. package/dist/commands/use-command.d.ts +1 -0
  74. package/dist/commands/use-command.d.ts.map +1 -1
  75. package/dist/commands/use-command.js +1 -1
  76. package/dist/commands/use-command.js.map +1 -1
  77. package/dist/commands/user-command.js +1 -1
  78. package/dist/commands/work-command.js +1 -1
  79. package/dist/commands/workflow-command.js +1 -1
  80. package/dist/core/auth.js +1 -1
  81. package/dist/core/command-output.js +1 -1
  82. package/dist/core/config.js +1 -1
  83. package/dist/core/connection-cache.js +1 -1
  84. package/dist/core/constants.js +1 -1
  85. package/dist/core/credential-cache.js +1 -1
  86. package/dist/core/global-context.d.ts +1 -0
  87. package/dist/core/global-context.d.ts.map +1 -1
  88. package/dist/core/global-context.js +1 -1
  89. package/dist/core/global-context.js.map +1 -1
  90. package/dist/core/keychain.js +1 -1
  91. package/dist/core/oauth-keychain.js +1 -1
  92. package/dist/core/oauth.js +1 -1
  93. package/dist/core/profile.js +1 -1
  94. package/dist/core/project-config.js +1 -1
  95. package/dist/core/session.d.ts +2 -1
  96. package/dist/core/session.d.ts.map +1 -1
  97. package/dist/core/session.js +1 -1
  98. package/dist/core/session.js.map +1 -1
  99. package/dist/core/site-mismatch.js +1 -1
  100. package/dist/core/user-cache.js +1 -1
  101. package/dist/core/version.js +1 -1
  102. package/dist/index.js +1 -1
  103. package/dist/mcp/server.js +1 -1
  104. package/dist/mcp/tools/index.js +1 -1
  105. package/dist/mcp/tools/tdx-run.js +1 -1
  106. package/dist/mcp/tools/tdx-search.js +1 -1
  107. package/dist/mcp/tools/work-create-item.js +1 -1
  108. package/dist/mcp/utils.js +1 -1
  109. package/dist/proxy/claude-usage-tracker.js +1 -1
  110. package/dist/proxy/passthrough-server.js +1 -1
  111. package/dist/proxy/sse-usage-parser.js +1 -1
  112. package/dist/sdk/agent/agent-config.js +1 -1
  113. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  114. package/dist/sdk/agent/agent-yaml.js +1 -1
  115. package/dist/sdk/agent/test/evaluator.js +1 -1
  116. package/dist/sdk/agent/test/executor.js +1 -1
  117. package/dist/sdk/agent/test/index.js +1 -1
  118. package/dist/sdk/agent/test/output.js +1 -1
  119. package/dist/sdk/agent/test/parser.js +1 -1
  120. package/dist/sdk/agent/tool-target-registry.js +1 -1
  121. package/dist/sdk/api.js +1 -1
  122. package/dist/sdk/auth-token.js +1 -1
  123. package/dist/sdk/cas/cas-api-client.js +1 -1
  124. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  125. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  126. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  127. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  128. package/dist/sdk/cas/cas-segment-validator.js +1 -1
  129. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  130. package/dist/sdk/cas/index.js +1 -1
  131. package/dist/sdk/cas/pull-workflow.js +1 -1
  132. package/dist/sdk/cas/push-workflow.js +1 -1
  133. package/dist/sdk/cas/validate-files.js +1 -1
  134. package/dist/sdk/client/cdp-api-client.js +1 -1
  135. package/dist/sdk/client/delivery-api-client.js +1 -1
  136. package/dist/sdk/client/endpoints.js +1 -1
  137. package/dist/sdk/client/engage-api-client.d.ts +10 -2
  138. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  139. package/dist/sdk/client/engage-api-client.js +1 -1
  140. package/dist/sdk/client/engage-api-client.js.map +1 -1
  141. package/dist/sdk/client/http-client.js +1 -1
  142. package/dist/sdk/client/llm-api-client.js +1 -1
  143. package/dist/sdk/client/oauth-refresh.js +1 -1
  144. package/dist/sdk/client/p13n-studio-api-client.d.ts +65 -1
  145. package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -1
  146. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  147. package/dist/sdk/client/p13n-studio-api-client.js.map +1 -1
  148. package/dist/sdk/client/rate-limiter.js +1 -1
  149. package/dist/sdk/client/td-api-client.js +1 -1
  150. package/dist/sdk/client/trino-api-client.js +1 -1
  151. package/dist/sdk/client/workflow-client.js +1 -1
  152. package/dist/sdk/connection-validator.js +1 -1
  153. package/dist/sdk/connection.js +1 -1
  154. package/dist/sdk/delivery.js +1 -1
  155. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  156. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  157. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  158. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  159. package/dist/sdk/engage/campaign-pull.js +1 -1
  160. package/dist/sdk/engage/campaign-push.js +1 -1
  161. package/dist/sdk/engage/campaign-validator.js +1 -1
  162. package/dist/sdk/engage/campaign-yaml.js +1 -1
  163. package/dist/sdk/engage/template-pull.js +1 -1
  164. package/dist/sdk/engage/template-push.js +1 -1
  165. package/dist/sdk/engage/template-validator.js +1 -1
  166. package/dist/sdk/engage/template-yaml.js +1 -1
  167. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  168. package/dist/sdk/engage/types/campaign-def.js +1 -1
  169. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  170. package/dist/sdk/engage/types/template-schema.js +1 -1
  171. package/dist/sdk/engage.d.ts +7 -2
  172. package/dist/sdk/engage.d.ts.map +1 -1
  173. package/dist/sdk/engage.js +1 -1
  174. package/dist/sdk/engage.js.map +1 -1
  175. package/dist/sdk/errors.js +1 -1
  176. package/dist/sdk/index.d.ts +5 -1
  177. package/dist/sdk/index.d.ts.map +1 -1
  178. package/dist/sdk/index.js +1 -1
  179. package/dist/sdk/index.js.map +1 -1
  180. package/dist/sdk/io/index.js +1 -1
  181. package/dist/sdk/io/node-filesystem.js +1 -1
  182. package/dist/sdk/job.js +1 -1
  183. package/dist/sdk/journey.js +1 -1
  184. package/dist/sdk/llm/chat-cache.js +1 -1
  185. package/dist/sdk/llm/index.js +1 -1
  186. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  187. package/dist/sdk/llm/model-factors.js +1 -1
  188. package/dist/sdk/llm/user-settings.js +1 -1
  189. package/dist/sdk/p13n-studio.d.ts +148 -1
  190. package/dist/sdk/p13n-studio.d.ts.map +1 -1
  191. package/dist/sdk/p13n-studio.js +1 -1
  192. package/dist/sdk/p13n-studio.js.map +1 -1
  193. package/dist/sdk/personalization.js +1 -1
  194. package/dist/sdk/policy.js +1 -1
  195. package/dist/sdk/query/deleted-table-validation.js +1 -1
  196. package/dist/sdk/query/index.js +1 -1
  197. package/dist/sdk/query/sql-parser.js +1 -1
  198. package/dist/sdk/realtime.js +1 -1
  199. package/dist/sdk/schedule.js +1 -1
  200. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  201. package/dist/sdk/segment/fields-display.js +1 -1
  202. package/dist/sdk/segment/file-discovery.js +1 -1
  203. package/dist/sdk/segment/journey-utils.js +1 -1
  204. package/dist/sdk/segment/journey-validator.js +1 -1
  205. package/dist/sdk/segment/journey-yaml.js +1 -1
  206. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  207. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  208. package/dist/sdk/segment/pull-workflow.js +1 -1
  209. package/dist/sdk/segment/push-recovery.js +1 -1
  210. package/dist/sdk/segment/push-workflow.js +1 -1
  211. package/dist/sdk/segment/resolution-context.js +1 -1
  212. package/dist/sdk/segment/segment-path-parser.js +1 -1
  213. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  214. package/dist/sdk/segment/segment-validator.js +1 -1
  215. package/dist/sdk/segment/target-resolution.js +1 -1
  216. package/dist/sdk/segment/tdx-config.js +1 -1
  217. package/dist/sdk/segment/types/activation-schema.js +1 -1
  218. package/dist/sdk/segment/types/journey-def.js +1 -1
  219. package/dist/sdk/segment/types/journey-schema.js +1 -1
  220. package/dist/sdk/segment/types/segment-def.js +1 -1
  221. package/dist/sdk/segment/types/segment-schema.js +1 -1
  222. package/dist/sdk/segment/validate-files.js +1 -1
  223. package/dist/sdk/segment/yaml-validator.js +1 -1
  224. package/dist/sdk/segment.js +1 -1
  225. package/dist/sdk/types/engage.d.ts +41 -0
  226. package/dist/sdk/types/engage.d.ts.map +1 -1
  227. package/dist/sdk/types/index.d.ts +3 -2
  228. package/dist/sdk/types/index.d.ts.map +1 -1
  229. package/dist/sdk/types/index.js +1 -1
  230. package/dist/sdk/types/index.js.map +1 -1
  231. package/dist/sdk/types/p13n-studio.d.ts +73 -0
  232. package/dist/sdk/types/p13n-studio.d.ts.map +1 -1
  233. package/dist/sdk/types/progress.js +1 -1
  234. package/dist/sdk/types/workspace.js +1 -1
  235. package/dist/sdk/user.js +1 -1
  236. package/dist/sdk/util/format-detector.js +1 -1
  237. package/dist/sdk/util/formatters.js +1 -1
  238. package/dist/sdk/util/index.js +1 -1
  239. package/dist/sdk/util/paginate.js +1 -1
  240. package/dist/sdk/util/tree-formatter.js +1 -1
  241. package/dist/sdk/util/tree-search.js +1 -1
  242. package/dist/sdk/workflow/archive-validation.js +1 -1
  243. package/dist/sdk/workflow/clone-workflow.js +1 -1
  244. package/dist/sdk/workflow/index.js +1 -1
  245. package/dist/sdk/workflow/pull-workflow.js +1 -1
  246. package/dist/sdk/workflow/push-workflow.js +1 -1
  247. package/dist/sdk/workflow/task-graph.js +1 -1
  248. package/dist/sdk/workflow/tdx-config.js +1 -1
  249. package/dist/sdk/workflow/workflow-utils.js +1 -1
  250. package/dist/sdk/workspace/access-tracker.js +1 -1
  251. package/dist/sdk/workspace/frontmatter.js +1 -1
  252. package/dist/sdk/workspace/git.js +1 -1
  253. package/dist/sdk/workspace/index.js +1 -1
  254. package/dist/sdk/workspace/templates.js +1 -1
  255. package/dist/sdk/workspace/weekly.js +1 -1
  256. package/dist/sdk/workspace/wikilinks.js +1 -1
  257. package/dist/test-utils/command-runner.js +1 -1
  258. package/dist/test-utils/factories.js +1 -1
  259. package/dist/test-utils/fixtures.js +1 -1
  260. package/dist/test-utils/http-mock.js +1 -1
  261. package/dist/test-utils/index.js +1 -1
  262. package/dist/utils/async.js +1 -1
  263. package/dist/utils/claude-code-state.js +1 -1
  264. package/dist/utils/colors.js +1 -1
  265. package/dist/utils/diff.js +1 -1
  266. package/dist/utils/file-permissions.js +1 -1
  267. package/dist/utils/file-reader.js +1 -1
  268. package/dist/utils/github-releases.js +1 -1
  269. package/dist/utils/global-cache.js +1 -1
  270. package/dist/utils/json-loader.js +1 -1
  271. package/dist/utils/local-cache.js +1 -1
  272. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  273. package/dist/utils/logger/formatters/index.js +1 -1
  274. package/dist/utils/logger/handlers/console-handler.js +1 -1
  275. package/dist/utils/logger/handlers/file-handler.js +1 -1
  276. package/dist/utils/logger/handlers/index.js +1 -1
  277. package/dist/utils/logger/handlers/null-handler.js +1 -1
  278. package/dist/utils/logger/index.js +1 -1
  279. package/dist/utils/logger/logger.js +1 -1
  280. package/dist/utils/logger/types.js +1 -1
  281. package/dist/utils/option-validation.js +1 -1
  282. package/dist/utils/process.js +1 -1
  283. package/dist/utils/prompt.js +1 -1
  284. package/dist/utils/proxy-fetch.js +1 -1
  285. package/dist/utils/spinner.js +1 -1
  286. package/dist/utils/sse-parser.js +1 -1
  287. package/dist/utils/string-utils.js +1 -1
  288. package/dist/utils/table-ref-parser.js +1 -1
  289. package/dist/utils/tdx-logger.js +1 -1
  290. package/dist/utils/version-check.js +1 -1
  291. package/package.json +1 -1
@@ -1 +1 @@
1
- const a45_0x42bbdd=a45_0x26c3;(function(_0x16623d,_0x285316){const _0x4b0b61=a45_0x26c3,_0x5588a5=_0x16623d();while(!![]){try{const _0x2c60c2=-parseInt(_0x4b0b61(0xf5))/0x1*(-parseInt(_0x4b0b61(0xd4))/0x2)+parseInt(_0x4b0b61(0xe1))/0x3+-parseInt(_0x4b0b61(0xe0))/0x4+-parseInt(_0x4b0b61(0x105))/0x5*(parseInt(_0x4b0b61(0xda))/0x6)+parseInt(_0x4b0b61(0xd0))/0x7*(parseInt(_0x4b0b61(0xf8))/0x8)+-parseInt(_0x4b0b61(0x10f))/0x9*(-parseInt(_0x4b0b61(0x112))/0xa)+-parseInt(_0x4b0b61(0x119))/0xb;if(_0x2c60c2===_0x285316)break;else _0x5588a5['push'](_0x5588a5['shift']());}catch(_0x364df1){_0x5588a5['push'](_0x5588a5['shift']());}}}(a45_0x2f10,0x4f7a0));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';function a45_0x26c3(_0x346c7c,_0x2953d6){_0x346c7c=_0x346c7c-0xce;const _0x2f100e=a45_0x2f10();let _0x26c3c4=_0x2f100e[_0x346c7c];return _0x26c3c4;}function a45_0x2f10(){const _0x5722b6=['data','forEach','cyan','join','resolveEntitiesInParent','1715688rpyeQN','231426yRrkJq','dryRun','error','ruleConditionCount','path','segment:move','segment','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','some','segmentFolderId','filter','\x20segment(s)\x20would\x20be\x20moved.','\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:','preserved:','\x20\x20•\x20','\x20(verified\x20by\x20re-read)','type','folder','\x27\x20to\x20folder\x20\x27','20dxBopG','\x27\x20—\x20','\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)','64uGKNup','push','Duplicate\x20segments\x20removed\x20(','Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a','•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27','rule\x20','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','\x27...','folderId','\x20folder\x20\x27','\x20condition','Searching\x20folders\x20for\x20\x27','290WkrRpU','map','description','Segments:\x20','SEGMENT_NOT_FOUND','length','[dry-run]\x20No\x20changes\x20made.\x20','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','slot','\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.','819zwdcKP','Target\x20folder:\x20','explainAmbiguousName','56600rjgsJn','for\x20move\x20to','Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).','execute','parentId','Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a','get','1809170fDvtBK','Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','red','moveSegments','includes','verbose','parentSegment','\x20\x20(id\x20','Examples:','listRecursive','set','384587sSegtK','Searching\x20the\x20tree...','resolvePathToResource','✔\x20Moved\x20segment\x20\x27','36622rmfOCK','code','name','test','toLowerCase','\x20→\x20','49554ndLkGs'];a45_0x2f10=function(){return _0x5722b6;};return a45_0x2f10();}import a45_0x4bcd3f from'chalk';export class SegmentMoveCommand extends BaseCommand{[a45_0x42bbdd(0xd6)]=a45_0x42bbdd(0xe6);[a45_0x42bbdd(0x107)]='Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder';async[a45_0x42bbdd(0x115)](_0x4e1528){const _0x2f9b01=a45_0x42bbdd,{options:_0xab77cc,args:_0x5b8040,tdx:_0x38edc0}=_0x4e1528,_0x3a7d3a=_0x5b8040,_0x4e38de=_0xab77cc[_0x2f9b01(0xf3)];if(_0x3a7d3a[_0x2f9b01(0x10a)]===0x0||!_0x4e38de)return console['error'](a45_0x4bcd3f[_0x2f9b01(0x11b)](_0x2f9b01(0x117))),console[_0x2f9b01(0xe3)](_0x2f9b01(0x10c)),console[_0x2f9b01(0xe3)](_0x2f9b01(0x121)),console[_0x2f9b01(0xe3)](_0x2f9b01(0xfe)),console[_0x2f9b01(0xe3)]('\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501'),console[_0x2f9b01(0xe3)](_0x2f9b01(0xf7)),console[_0x2f9b01(0xe3)](_0x2f9b01(0x10e)),0x1;_0xab77cc[_0x2f9b01(0x11e)]&&(console['error'](_0x2f9b01(0x108)+_0x3a7d3a[_0x2f9b01(0xde)](',\x20')),console['error'](_0x2f9b01(0x110)+_0x4e38de));const _0x230778=[...new Set(_0x3a7d3a)];_0x230778[_0x2f9b01(0x10a)]<_0x3a7d3a[_0x2f9b01(0x10a)]&&console['error'](a45_0x4bcd3f['yellow'](_0x2f9b01(0xfa)+_0x3a7d3a['length']+_0x2f9b01(0xd9)+_0x230778[_0x2f9b01(0x10a)]+').'));const _0x50dd7d=/^\d+$/,_0x5ecbd8=_0xab77cc[_0x2f9b01(0x11f)],_0x509758=[..._0x230778,_0x4e38de][_0x2f9b01(0xea)](_0x41def5=>!_0x50dd7d[_0x2f9b01(0xd7)](_0x41def5));if(_0x509758&&!_0x5ecbd8)return console[_0x2f9b01(0xe3)](a45_0x4bcd3f[_0x2f9b01(0x11b)](_0x2f9b01(0xfb))),console[_0x2f9b01(0xe3)](_0x2f9b01(0x11a)),console[_0x2f9b01(0xe3)](_0x2f9b01(0xe9)),console[_0x2f9b01(0xe3)]('Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)'),0x1;const _0x5b5d44=_0x230778[_0x2f9b01(0x10a)],_0x3260ca=_0xab77cc[_0x2f9b01(0xe2)]===!![];let _0x2f0ba3;try{const _0x1002f1=await withSpinner((_0x3260ca?'Checking':'Moving')+'\x20'+_0x5b5d44+'\x20segment'+(_0x5b5d44===0x1?'':'s')+'\x20'+((_0x3260ca?_0x2f9b01(0x113):'to')+_0x2f9b01(0x102)+_0x4e38de+'\x27...'),async()=>{const _0x940a64=_0x2f9b01,_0x2c1a10=[];_0x230778[_0x940a64(0xdc)]((_0x1a694f,_0x3970aa)=>{const _0x202c91=_0x940a64;if(!_0x50dd7d[_0x202c91(0xd7)](_0x1a694f))_0x2c1a10['push']({'name':_0x1a694f,'expectType':_0x202c91(0xe7),'slot':_0x3970aa});});if(!_0x50dd7d['test'](_0x4e38de))_0x2c1a10[_0x940a64(0xf9)]({'name':_0x4e38de,'expectType':_0x940a64(0xf3),'slot':-0x1});const _0x4d0b35=new Map();if(_0x2c1a10[_0x940a64(0x10a)]>0x0){const _0x390f67=await _0x38edc0['segment'][_0x940a64(0xdf)](_0x5ecbd8,_0x2c1a10[_0x940a64(0x106)](({name:_0x3df38a,expectType:_0x51e1b7})=>({'name':_0x3df38a,'expectType':_0x51e1b7})));_0x390f67[_0x940a64(0xdc)]((_0x3b8449,_0x1c12df)=>_0x4d0b35[_0x940a64(0xcf)](_0x2c1a10[_0x1c12df][_0x940a64(0x10d)],_0x3b8449['id']));}const _0x2ebe74=_0x230778[_0x940a64(0x106)]((_0xc3d856,_0x2e2e20)=>_0x50dd7d[_0x940a64(0xd7)](_0xc3d856)?_0xc3d856:_0x4d0b35[_0x940a64(0x118)](_0x2e2e20)),_0x19ee8c=_0x50dd7d[_0x940a64(0xd7)](_0x4e38de)?_0x4e38de:_0x4d0b35['get'](-0x1);return _0x38edc0[_0x940a64(0xe7)][_0x940a64(0x11c)](_0x2ebe74,_0x19ee8c,_0x3260ca);},{'verbose':_0xab77cc[_0x2f9b01(0x11e)]});_0x2f0ba3=_0x1002f1[_0x2f9b01(0xdb)];}catch(_0x6b2dce){if(_0x6b2dce instanceof SDKError&&_0x6b2dce[_0x2f9b01(0xd5)]===ErrorCode[_0x2f9b01(0x109)]&&_0x5ecbd8)try{if(await this[_0x2f9b01(0x111)](_0x38edc0,_0x5ecbd8,_0x230778,_0xab77cc))return 0x1;}catch{}throw _0x6b2dce;}for(const _0x1a97e3 of _0x2f0ba3){const _0x2fc161=_0x1a97e3[_0x2f9b01(0xe4)],_0x5c30ae=_0x2f9b01(0xfd)+(_0x3260ca?'has':_0x2f9b01(0xef))+'\x20'+_0x2fc161+_0x2f9b01(0x103)+(_0x2fc161===0x1?'':'s');console[_0x2f9b01(0xe3)](_0x3260ca?a45_0x4bcd3f[_0x2f9b01(0xdd)](_0x2f9b01(0xfc)+_0x1a97e3['id']+'\x27\x20to\x20folder\x20\x27'+_0x1a97e3[_0x2f9b01(0xeb)]+_0x2f9b01(0xf6)+_0x5c30ae):a45_0x4bcd3f['green'](_0x2f9b01(0xd3)+_0x1a97e3['id']+_0x2f9b01(0xf4)+_0x1a97e3[_0x2f9b01(0xeb)]+_0x2f9b01(0xf6)+_0x5c30ae+_0x2f9b01(0xf1)));}if(_0x3260ca)console[_0x2f9b01(0xe3)](a45_0x4bcd3f[_0x2f9b01(0xdd)](_0x2f9b01(0x10b)+_0x5b5d44+_0x2f9b01(0xed)));else _0x2f0ba3[_0x2f9b01(0x10a)]>0x1&&console[_0x2f9b01(0xe3)](a45_0x4bcd3f['green']('✔\x20'+_0x2f0ba3[_0x2f9b01(0x10a)]+_0x2f9b01(0xff)));return await handleSDKOutput(_0x2f0ba3,_0xab77cc),0x0;}async[a45_0x42bbdd(0x111)](_0x169bd0,_0x5cc8e0,_0x308e71,_0x56ef99){const _0x2cd553=a45_0x42bbdd,_0xa81515=_0x308e71['filter'](_0x1ee104=>!/^\d+$/['test'](_0x1ee104)&&!_0x1ee104[_0x2cd553(0x11d)]('/'));if(_0xa81515['length']===0x0)return![];const _0x4475db=await withSpinner(_0x2cd553(0x104)+_0xa81515[_0x2cd553(0xde)]('\x27,\x20\x27')+_0x2cd553(0x100),()=>_0x169bd0[_0x2cd553(0xe7)][_0x2cd553(0xd2)](_0x5cc8e0),{'verbose':_0x56ef99[_0x2cd553(0x11e)]}),_0xa98f6e=(await withSpinner(_0x2cd553(0xd1),()=>_0x169bd0[_0x2cd553(0xe7)][_0x2cd553(0xce)](_0x4475db[_0x2cd553(0xdb)][_0x2cd553(0x116)],_0x4475db[_0x2cd553(0xdb)][_0x2cd553(0x101)],0x0,0xa),{'verbose':_0x56ef99[_0x2cd553(0x11e)]}))[_0x2cd553(0xdb)];let _0x3c85e8=![];for(const _0x245c06 of _0xa81515){const _0x2431d1=searchTreeByName(_0xa98f6e,_0x245c06)[_0x2cd553(0xec)](_0xea482c=>_0xea482c[_0x2cd553(0xf2)]===_0x2cd553(0xe7)&&_0xea482c[_0x2cd553(0xd6)][_0x2cd553(0xd8)]()===_0x245c06['toLowerCase']());if(_0x2431d1[_0x2cd553(0x10a)]>0x1){_0x3c85e8=!![],console[_0x2cd553(0xe3)](a45_0x4bcd3f[_0x2cd553(0x11b)]('Error:\x20\x27'+_0x245c06+'\x27\x20matches\x20'+_0x2431d1[_0x2cd553(0x10a)]+_0x2cd553(0xee)));for(const _0x442c62 of _0x2431d1)console[_0x2cd553(0xe3)](_0x2cd553(0xf0)+_0x442c62['path']+_0x2cd553(0x120)+_0x442c62['id']+')');}else _0x2431d1[_0x2cd553(0x10a)]===0x1&&(_0x3c85e8=!![],console[_0x2cd553(0xe3)](a45_0x4bcd3f[_0x2cd553(0x11b)]('Error:\x20\x27'+_0x245c06+_0x2cd553(0xe8))),console[_0x2cd553(0xe3)]('\x20\x20'+_0x2431d1[0x0][_0x2cd553(0xe5)]+'\x20\x20(id\x20'+_0x2431d1[0x0]['id']+')'),console[_0x2cd553(0xe3)](_0x2cd553(0x114)));}return _0x3c85e8;}}
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 +1 @@
1
- const a46_0x1fd78f=a46_0x5c9d;(function(_0x24ed2d,_0x15e16a){const _0x235af2=a46_0x5c9d,_0xaedc6c=_0x24ed2d();while(!![]){try{const _0x281505=-parseInt(_0x235af2(0x14f))/0x1*(parseInt(_0x235af2(0x14e))/0x2)+parseInt(_0x235af2(0x11a))/0x3+parseInt(_0x235af2(0x151))/0x4*(-parseInt(_0x235af2(0x146))/0x5)+-parseInt(_0x235af2(0x158))/0x6+-parseInt(_0x235af2(0x115))/0x7+-parseInt(_0x235af2(0x124))/0x8*(parseInt(_0x235af2(0x13d))/0x9)+parseInt(_0x235af2(0x122))/0xa*(parseInt(_0x235af2(0x12b))/0xb);if(_0x281505===_0x15e16a)break;else _0xaedc6c['push'](_0xaedc6c['shift']());}catch(_0x28ffd8){_0xaedc6c['push'](_0xaedc6c['shift']());}}}(a46_0xb9b2,0x1f230));function a46_0x5c9d(_0x13b9aa,_0x1f2571){_0x13b9aa=_0x13b9aa-0x112;const _0xb9b2d8=a46_0xb9b2();let _0x5c9d85=_0xb9b2d8[_0x13b9aa];return _0x5c9d85;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a46_0x48c3a0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a46_0x39e974 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a46_0xb9b2(){const _0x13375f=['journeyVersions','parent_segment','name','Aborted.','Error:\x20','message','994LzRdsq','55ydEDFd','helpText','92072vSSUyC','journeys','red','content','parentSegment','description','execute','1487544uWnhyx','length','\x20=\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','-\x20no\x20files\x20written','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dryRun','Site:\x20','verbose','dim','✔\x20Context\x20set:\x20','error','\x20unchanged\x20files','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','relativePath','Target\x20resource:\x20','cwd','type','462833KjJAvy','\x20new\x20files','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Parent\x20segment:\x20','\x20segments','713277ewXesp','session','segment:pull','hasChanges','file','green','targetDir','yellow','50FSOMKs','Write\x20','744HfNMhy','dirname','diff','\x20\x20🗺️\x20\x20','files','segment','pullSegments','1030997yzoFBD','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aPull\x20summary\x20for\x20\x27','filter','\x20files\x20to\x20','utf-8','cyan','\x20files?','\x20\x20🎯\x20','\x20journeys','repeat','errorCode','absolutePath','activations','isNew','resourceName','\x20activations','counts','2934cODsUT','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segments','data','site','\x20versions)','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','45WdSljz','parentName'];a46_0xb9b2=function(){return _0x13375f;};return a46_0xb9b2();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a46_0x1fd78f(0x14a)]=a46_0x1fd78f(0x11c);[a46_0x1fd78f(0x156)]=a46_0x1fd78f(0x15b);async[a46_0x1fd78f(0x157)](_0x15cbac){const _0x3ef8af=a46_0x1fd78f,{options:_0x114d3b,args:_0x2c1788,tdx:_0x46bfa9}=_0x15cbac,_0x17ad6c=_0x114d3b,_0x16cfdd=await resolveTarget({'arg':_0x2c1788[0x0],'contextParent':_0x114d3b[_0x3ef8af(0x155)],'cwd':process[_0x3ef8af(0x113)]()});if(!isSuccessfulResolution(_0x16cfdd))return _0x16cfdd[_0x3ef8af(0x136)]===_0x3ef8af(0x144)?(console['error'](a46_0x48c3a0['yellow'](_0x3ef8af(0x145))),console[_0x3ef8af(0x163)]('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['error'](_0x3ef8af(0x13e)),console[_0x3ef8af(0x163)](_0x3ef8af(0x13f))):(console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x153)](_0x3ef8af(0x14c)+_0x16cfdd[_0x3ef8af(0x14d)]+'\x0a')),_0x16cfdd[_0x3ef8af(0x150)]&&console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x131)](_0x16cfdd[_0x3ef8af(0x150)]))),0x1;const _0x4ace41=_0x16cfdd[_0x3ef8af(0x147)],_0x5179b0=_0x16cfdd['targetDir'],_0x288b42=_0x16cfdd[_0x3ef8af(0x114)]===_0x3ef8af(0x11e)?_0x16cfdd[_0x3ef8af(0x13a)]:undefined;_0x17ad6c[_0x3ef8af(0x160)]&&(console[_0x3ef8af(0x163)](_0x3ef8af(0x15f)+_0x17ad6c[_0x3ef8af(0x142)]),console[_0x3ef8af(0x163)](_0x3ef8af(0x118)+_0x4ace41),_0x288b42&&console[_0x3ef8af(0x163)](_0x3ef8af(0x112)+_0x288b42));const _0x194de0=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4ace41+'\x27...',_0x396c69=>_0x46bfa9[_0x3ef8af(0x129)][_0x3ef8af(0x12a)](_0x4ace41,{'targetDir':_0x5179b0,'targetResourceName':_0x288b42,'verbose':_0x17ad6c['verbose'],'progress':{'update':_0x19784e=>{const _0xf21c87=_0x3ef8af;_0x396c69['setPhase'](_0x19784e),_0x17ad6c['verbose']&&console[_0xf21c87(0x163)]('\x20\x20'+_0x19784e);}}}),{'verbose':_0x17ad6c['verbose']}),_0x3377cd=_0x194de0[_0x3ef8af(0x141)];if(_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x140)]===0x0&&_0x3377cd['counts'][_0x3ef8af(0x152)]===0x0)return console[_0x3ef8af(0x163)](a46_0x48c3a0['yellow'](_0x3ef8af(0x165)+_0x3377cd[_0x3ef8af(0x147)]+'\x27')),0x0;const _0x1ac417=_0x3377cd['files'][_0x3ef8af(0x12e)](_0x2f9577=>_0x2f9577[_0x3ef8af(0x139)]),_0x47bf52=_0x3377cd[_0x3ef8af(0x128)]['filter'](_0x62243=>!_0x62243[_0x3ef8af(0x139)]&&_0x62243[_0x3ef8af(0x11d)]),_0x485f99=_0x3377cd[_0x3ef8af(0x128)][_0x3ef8af(0x12e)](_0x2709ea=>!_0x2709ea['isNew']&&!_0x2709ea[_0x3ef8af(0x11d)]);console[_0x3ef8af(0x163)](_0x3ef8af(0x12d)+_0x3377cd[_0x3ef8af(0x147)]+'\x27:'),console[_0x3ef8af(0x163)](_0x3ef8af(0x133)+a46_0x48c3a0[_0x3ef8af(0x131)](_0x3377cd[_0x3ef8af(0x13c)]['segments']+_0x3ef8af(0x119))+'\x20with\x20'+a46_0x48c3a0['cyan'](_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x138)]+_0x3ef8af(0x13b)));if(_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x152)]>0x0){const _0x4e7df9=_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x148)]>_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x152)]?'\x20('+_0x3377cd[_0x3ef8af(0x13c)]['journeyVersions']+_0x3ef8af(0x143):'';console['error'](_0x3ef8af(0x127)+a46_0x48c3a0[_0x3ef8af(0x131)](_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x152)]+_0x3ef8af(0x134))+a46_0x48c3a0['dim'](_0x4e7df9));}console['error']('\x20\x20'+a46_0x48c3a0[_0x3ef8af(0x11f)]('+\x20'+_0x1ac417[_0x3ef8af(0x159)]+_0x3ef8af(0x116))),console['error']('\x20\x20'+a46_0x48c3a0[_0x3ef8af(0x121)]('~\x20'+_0x47bf52['length']+'\x20changed\x20files')),console[_0x3ef8af(0x163)]('\x20\x20'+a46_0x48c3a0[_0x3ef8af(0x161)]('=\x20'+_0x485f99['length']+_0x3ef8af(0x164))),console[_0x3ef8af(0x163)]('\x20\x20Target:\x20'+a46_0x48c3a0['cyan'](_0x3377cd['targetDir'])+'\x0a');if(_0x47bf52[_0x3ef8af(0x159)]>0x0)for(const _0x305915 of _0x47bf52){console[_0x3ef8af(0x163)]('\x0aChanges\x20to\x20\x27'+_0x305915[_0x3ef8af(0x167)]+'\x27:'),console['error']('─'[_0x3ef8af(0x135)](0x3c)),console[_0x3ef8af(0x163)](_0x305915[_0x3ef8af(0x126)]),console[_0x3ef8af(0x163)]('─'['repeat'](0x3c));}if(_0x17ad6c[_0x3ef8af(0x15e)])return console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x121)](_0x3ef8af(0x117))),0x0;if(_0x1ac417['length']===0x0&&_0x47bf52[_0x3ef8af(0x159)]===0x0)return console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x11f)](_0x3ef8af(0x166))),saveSessionContext({'parent_segment':_0x3377cd['parentName']},_0x17ad6c[_0x3ef8af(0x11b)]),console[_0x3ef8af(0x163)](a46_0x48c3a0['green'](_0x3ef8af(0x162)+a46_0x48c3a0[_0x3ef8af(0x161)](_0x3ef8af(0x149))+_0x3ef8af(0x15a)+a46_0x48c3a0['cyan'](_0x3377cd[_0x3ef8af(0x147)]))),0x0;if(!_0x17ad6c['yes']){if(!isInteractive())return console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x153)]('\x0aError:'),_0x3ef8af(0x12c)),console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x161)](_0x3ef8af(0x15d))),0x1;const _0x40e3f4=await confirmKey(_0x3ef8af(0x123)+(_0x1ac417['length']+_0x47bf52[_0x3ef8af(0x159)])+_0x3ef8af(0x132));if(!_0x40e3f4)return console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x121)](_0x3ef8af(0x14b)),_0x3ef8af(0x15c)),0x1;}for(const _0x506ab4 of _0x3377cd['files']){if(_0x506ab4[_0x3ef8af(0x139)]||_0x506ab4[_0x3ef8af(0x11d)]){const _0x5199a5=a46_0x39e974[_0x3ef8af(0x125)](_0x506ab4[_0x3ef8af(0x137)]);!existsSync(_0x5199a5)&&mkdirSync(_0x5199a5,{'recursive':!![]}),writeFileSync(_0x506ab4[_0x3ef8af(0x137)],_0x506ab4[_0x3ef8af(0x154)],_0x3ef8af(0x130));}}return console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x11f)]('✔\x20Pulled\x20'+(_0x1ac417['length']+_0x47bf52[_0x3ef8af(0x159)])+_0x3ef8af(0x12f)+_0x3377cd[_0x3ef8af(0x120)])),saveSessionContext({'parent_segment':_0x3377cd['parentName']},_0x17ad6c[_0x3ef8af(0x11b)]),console[_0x3ef8af(0x163)](a46_0x48c3a0['green'](_0x3ef8af(0x162)+a46_0x48c3a0[_0x3ef8af(0x161)](_0x3ef8af(0x149))+_0x3ef8af(0x15a)+a46_0x48c3a0[_0x3ef8af(0x131)](_0x3377cd[_0x3ef8af(0x147)]))),0x0;}}
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 +1 @@
1
- const a47_0x7226c3=a47_0x2dc0;(function(_0x37a19e,_0x54e9dc){const _0x557d69=a47_0x2dc0,_0x4ca8d2=_0x37a19e();while(!![]){try{const _0x2336b3=parseInt(_0x557d69(0x165))/0x1*(-parseInt(_0x557d69(0x177))/0x2)+parseInt(_0x557d69(0x102))/0x3*(parseInt(_0x557d69(0xfe))/0x4)+parseInt(_0x557d69(0x170))/0x5*(-parseInt(_0x557d69(0x17e))/0x6)+-parseInt(_0x557d69(0x113))/0x7+parseInt(_0x557d69(0x135))/0x8+-parseInt(_0x557d69(0x126))/0x9*(-parseInt(_0x557d69(0x10a))/0xa)+-parseInt(_0x557d69(0xfc))/0xb;if(_0x2336b3===_0x54e9dc)break;else _0x4ca8d2['push'](_0x4ca8d2['shift']());}catch(_0x2fc784){_0x4ca8d2['push'](_0x4ca8d2['shift']());}}}(a47_0x44bb,0xadf0c));function a47_0x44bb(){const _0x1ec6a8=['Fetching\x20existing\x20activations...','listJourneysWithDetailsFromParentSegment','.yaml','journeyBundleName','changed','folderId','Fetching\x20existing\x20data...','description','yamlConfig','diff','scopedFolderPath','segment','toDelete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','attributes','\x20to\x20delete','isNew','add','\x20\x20\x20\x20','\x20activations]','parentName','existingSegment','yellow','8430312LnmQpu','type','12YFtUBe','error','delete','journey','1031598HBZWHI','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/e/','endsWith','\x20YAML\x20files\x20found','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20folders\x20to\x20create','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)','10rKfYfG','verbose','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','/sb/da/esr','New\x20journey:','length','\x20changes?','No\x20','Site:\x20','3450559ChhzuQ','parent_name','Aborted.','Folders\x20to\x20create:','push','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x0a✔\x20Push\x20complete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Parent\x20segment:\x20','unchanged','helpText','createdAt','map','listSegments','journeysOnly','then','Error\x20parsing\x20YAML:\x20','connection','file','5983272jyKuxL','parentFolder','\x20\x20📊\x20Segments:','idToName','filter','buildUserMaps','get','\x20\x20Activations:','results','existingJourney','data','no_parent','getJourney','Push\x20','Scoped\x20to\x20folder:\x20','7409280veWqHx','deleted','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','paused','isScoped','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journeyId','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','site','/app/ps/','Changes\x20to\x20journey:','audienceId','yes','activations','versionNumber','\x20\x20Segments:\x20','getMetadataWithCache','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','New\x20segment:','dryRun','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','toCreate','folderPath','new','blue','all','set','journeyBundleId','\x20changed','name','\x20new','folders','nameToType','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0aPush\x20summary\x20for\x20\x27','Error:\x20','message','dim','\x20\x20Source:\x20','created','segments','updated','execute','join','\x20created','segment\x20or\x20journey','5eqNUAq','toUpdate','\x0aError:','\x20\x20Journeys:\x20','red','cyan','\x20deleted','user','repeat','journeys','nameToId','120lGODcR','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','state','getParent','createdSegmentIds','list','targetDir','118682GCZezo','parentSegment','\x20\x20🗺️\x20\x20Journeys:','\x20to\x20create','segment:push','listFolders','setPhase','88518gCGoQA','/j/da/je','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aValidation\x20failed:'];a47_0x44bb=function(){return _0x1ec6a8;};return a47_0x44bb();}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_0x3c0bcb 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 a47_0x2dc0(_0x2546b8,_0x426645){_0x2546b8=_0x2546b8-0xf2;const _0x44bb69=a47_0x44bb();let _0x2dc020=_0x44bb69[_0x2546b8];return _0x2dc020;}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{[a47_0x7226c3(0x154)]=a47_0x7226c3(0x17b);[a47_0x7226c3(0x189)]='Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments';async[a47_0x7226c3(0x161)](_0x22d5c1){const _0x52f567=a47_0x7226c3,{options:_0x3b6c92,args:_0x365a12,tdx:_0x312c60}=_0x22d5c1,_0x4bbee1=_0x3b6c92,_0x543771=await resolveTarget({'arg':_0x365a12[0x0],'contextParent':_0x3b6c92[_0x52f567(0x178)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x543771))return _0x543771['errorCode']===_0x52f567(0x131)?(console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x52f567(0x109)),console[_0x52f567(0xff)](_0x52f567(0x14a)),console['error'](_0x52f567(0xf2))):(console[_0x52f567(0xff)](a47_0x3c0bcb['red'](_0x52f567(0x15a)+_0x543771[_0x52f567(0x15b)]+'\x0a')),_0x543771[_0x52f567(0x11d)]&&console['error'](a47_0x3c0bcb['cyan'](_0x543771[_0x52f567(0x11d)]))),0x1;if(_0x543771[_0x52f567(0xfd)]===_0x52f567(0x114))return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)]('Error:\x20Directory\x20not\x20found:\x20'+_0x543771[_0x52f567(0x176)]+'\x0a')),console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x16a)](_0x52f567(0x13a))),0x1;const _0x1ab207=_0x543771[_0x52f567(0xf9)],_0x457eed=_0x543771['targetDir'],_0x464db7=_0x543771['type']===_0x52f567(0x125)?_0x543771['filePath']:undefined,_0x256ebd=getScopedDetails(_0x543771),_0x2a3033=_0x256ebd?.[_0x52f567(0x139)]??![],_0x299b84=_0x256ebd?.[_0x52f567(0x18c)]??'';if(!existsSync(_0x457eed))return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)]('Error:\x20Directory\x20not\x20found:\x20'+_0x457eed+'\x0a')),console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x16a)](_0x52f567(0x13a))),0x1;_0x4bbee1[_0x52f567(0x10b)]&&(console[_0x52f567(0xff)](_0x52f567(0x112)+_0x4bbee1[_0x52f567(0x13d)]),console[_0x52f567(0xff)](_0x52f567(0x11b)+_0x1ab207),console[_0x52f567(0xff)]('Source\x20directory:\x20'+_0x457eed),_0x2a3033&&console['error'](_0x52f567(0x134)+_0x299b84));const _0x4894ca=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1ab207+'\x27...',()=>_0x312c60['segment']['resolveParentId'](_0x1ab207),{'verbose':_0x4bbee1[_0x52f567(0x10b)]}),_0x5a9633=_0x4894ca['data'],{parentSegmentResult:_0x347610,segmentsResult:_0x465d2f,foldersResult:_0x2298c1,journeysWithDetailsResult:_0x37be0b,userMaps:_0x25bc3d}=await withSpinner(_0x52f567(0x188),async()=>{const _0x353f08=_0x52f567,[_0x162065,_0x1855d7,_0x20eff9,_0x45e8ad,_0x4e215f]=await Promise[_0x353f08(0x150)]([_0x312c60['segment'][_0x353f08(0x173)](_0x5a9633),_0x312c60[_0x353f08(0x18d)][_0x353f08(0x120)](_0x5a9633),_0x312c60['segment'][_0x353f08(0x17c)](_0x5a9633),_0x312c60[_0x353f08(0x101)][_0x353f08(0x183)](_0x5a9633,{'includeAllVersions':!![]}),_0x312c60[_0x353f08(0x16c)][_0x353f08(0x12b)]()]);return{'parentSegmentResult':_0x162065,'segmentsResult':_0x1855d7,'foldersResult':_0x20eff9,'journeysWithDetailsResult':_0x45e8ad,'userMaps':_0x4e215f};},{'verbose':_0x4bbee1[_0x52f567(0x10b)]})[_0x52f567(0x122)](_0x44a9c8=>_0x44a9c8[_0x52f567(0x130)]),_0x4f7e51=_0x347610,_0x3d3315=extractRootFolderId(_0x4f7e51),_0x3bb2a9=_0x465d2f,_0x468b5a=_0x2298c1,{journeys:_0x341990,activationStepsById:_0xecbd6b}=_0x37be0b,_0x551fc6=new Map(_0x341990[_0x52f567(0x11f)](_0x168dfc=>[_0x168dfc['id'],_0x168dfc])),_0x4c8f74=_0x341990[_0x52f567(0x11f)](_0x3028f0=>({'id':_0x3028f0['id'],'name':_0x3028f0['attributes'][_0x52f567(0x154)],'journeyBundleName':_0x3028f0[_0x52f567(0xf3)][_0x52f567(0x185)]||'','journeyBundleId':_0x3028f0['attributes'][_0x52f567(0x152)]||'','versionNumber':_0x3028f0[_0x52f567(0xf3)][_0x52f567(0x143)],'description':_0x3028f0[_0x52f567(0xf3)]['description'],'state':_0x3028f0['attributes'][_0x52f567(0x172)],'paused':_0x3028f0[_0x52f567(0xf3)][_0x52f567(0x138)],'audienceId':_0x3028f0[_0x52f567(0xf3)][_0x52f567(0x140)],'folderId':_0x3028f0['relationships']?.[_0x52f567(0x127)]?.[_0x52f567(0x130)]?.['id'],'createdAt':_0x3028f0[_0x52f567(0xf3)][_0x52f567(0x11e)],'updatedAt':_0x3028f0[_0x52f567(0xf3)]['updatedAt']})),{emailToId:_0x44131d,idToEmail:_0x5c8227}=_0x25bc3d,_0x5c2e5e=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x10f864=_0x52f567,_0xe652a0=await _0x312c60['connection'][_0x10f864(0x175)]();return buildConnectionMaps(_0xe652a0);},{'verbose':_0x4bbee1[_0x52f567(0x10b)]})[_0x52f567(0x122)](_0x40b491=>_0x40b491[_0x52f567(0x130)]),_0x20e730=_0x5c2e5e[_0x52f567(0x16f)],_0x2ac23f=_0x5c2e5e['idToName'],_0xb9eaf0=_0x5c2e5e[_0x52f567(0x157)],_0x5b03b4={'emailToIdMap':_0x44131d,'connectionNameToIdMap':_0x20e730,'connectionNameToTypeMap':_0xb9eaf0,'getSchema':_0x36381a=>_0x312c60[_0x52f567(0x124)]['getOutputSchemaWithCache'](_0x36381a),'getMetadata':_0x1f32ec=>_0x312c60['connection'][_0x52f567(0x145)](_0x1f32ec)};let {pathToId:_0x307917,idToPath:_0x7210d1}=buildFolderMaps(_0x468b5a);const _0x3cecf4=buildSegmentLookupMap(_0x3bb2a9,_0x7210d1),_0x2ad6a4=buildSegmentNameToIdMap(_0x3bb2a9),_0x9678a2=buildJourneyBundleLookupMap(_0x4c8f74,_0x7210d1);let _0x570cf4;if(_0x464db7){if(!_0x464db7[_0x52f567(0x105)]('.yml')&&!_0x464db7['endsWith'](_0x52f567(0x184)))return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)](_0x52f567(0x11a)+_0x464db7+'\x0a')),0x1;_0x570cf4=[_0x464db7];}else _0x570cf4=findYamlFiles(_0x457eed);if(_0x570cf4['length']===0x0)return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)](_0x52f567(0x118)+_0x457eed+'\x0a')),console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x16a)](_0x52f567(0x158))),0x1;let _0x4b2edf,_0x3498a5;try{const _0x1d77f4=parseAndClassifyYamlFiles(_0x570cf4,_0x457eed,{'skipSegments':_0x4bbee1[_0x52f567(0x121)]});_0x4b2edf=_0x1d77f4[_0x52f567(0x15f)],_0x3498a5=_0x1d77f4[_0x52f567(0x16e)];const _0xf647e7=validateParsedFiles(_0x1d77f4,_0x457eed);if(_0xf647e7[_0x52f567(0x10f)]>0x0)return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)](_0x52f567(0x181))),console['error'](formatValidationErrors(_0xf647e7)),console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x13c))),0x1;}catch(_0x1c78f0){return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)](_0x52f567(0x123)+(_0x1c78f0 instanceof Error?_0x1c78f0[_0x52f567(0x15b)]:_0x1c78f0))),0x1;}if(_0x4b2edf[_0x52f567(0x10f)]===0x0&&_0x3498a5[_0x52f567(0x10f)]===0x0){const _0x22041e=_0x4bbee1[_0x52f567(0x121)]?_0x52f567(0x101):_0x52f567(0x164);return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x111)+_0x22041e+_0x52f567(0x106))),0x0;}const _0x4e7eb2=new Map();_0x3bb2a9[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x121)]&&await withSpinner(_0x52f567(0x182),async()=>{await batchAsync(_0x3bb2a9,async _0x2139b8=>{const _0x15e589=a47_0x2dc0,_0x2d636d=await _0x312c60[_0x15e589(0x18d)]['listActivations'](_0x5a9633,_0x2139b8['id']);_0x4e7eb2[_0x15e589(0x151)](_0x2139b8['id'],_0x2d636d);});},{'verbose':_0x4bbee1[_0x52f567(0x10b)]});const {segmentFiles:_0x4e8f1b,foldersToCreate:_0x3a089d}=await prepareSegmentFiles(_0x4b2edf,{'segmentByFolderAndName':_0x3cecf4,'activationsBySegmentId':_0x4e7eb2,'folderPathToId':_0x307917,'idToEmailMap':_0x5c8227,'connectionIdToNameMap':_0x2ac23f},_0x5b03b4,_0x2a3033,_0x299b84),_0x5433ce=_0x464db7?[]:findSegmentsToDelete(_0x3bb2a9,_0x4b2edf[_0x52f567(0x11f)](({yamlConfig:_0x54415b,folderPath:_0x212f57})=>({'yamlConfig':_0x54415b,'folderPath':resolveTDFolderPath(_0x212f57,_0x2a3033,_0x299b84)})),_0x7210d1,_0x299b84,_0x2a3033),{journeyFiles:_0x4c1997,foldersToCreate:_0x496190}=await withProgressSpinner('Preparing\x20journeys...',async _0x1f3ffa=>prepareJourneyFiles(_0x3498a5,{'fetchJourney':async _0x2be486=>_0x312c60['journey'][_0x52f567(0x132)](_0x2be486[_0x52f567(0x13b)]),'journeyBundlesByFolderAndName':_0x9678a2,'folderPathToId':_0x307917,'idToEmailMap':_0x5c8227,'connectionIdToNameMap':_0x2ac23f,'existingSegments':_0x3bb2a9,'parentId':_0x5a9633,'deps':_0x312c60,'progress':{'update':_0xe152e2=>{const _0x45777d=_0x52f567;_0x1f3ffa[_0x45777d(0x17d)](_0xe152e2),_0x4bbee1[_0x45777d(0x10b)]&&console[_0x45777d(0xff)]('\x20\x20'+_0xe152e2);}},'journeyById':_0x551fc6,'activationStepsById':_0xecbd6b},_0x2a3033,_0x299b84),{'verbose':_0x4bbee1[_0x52f567(0x10b)]})[_0x52f567(0x122)](_0x5e4094=>_0x5e4094['data']);for(const _0x16df62 of _0x496190){_0x3a089d[_0x52f567(0xf6)](_0x16df62);}const _0x38447a=_0x464db7?[]:findJourneysToDelete(_0x4c8f74,_0x3498a5[_0x52f567(0x11f)](({yamlConfig:_0x1e974d,folderPath:_0x4c4f6b})=>({'yamlConfig':_0x1e974d,'folderPath':resolveTDFolderPath(_0x4c4f6b,_0x2a3033,_0x299b84)})),_0x7210d1,_0x299b84,_0x2a3033),_0x163943=calculatePushStats(_0x4e8f1b,_0x4c1997,_0x3a089d,_0x5433ce,_0x38447a,!!_0x4bbee1[_0x52f567(0x100)],!!_0x4bbee1[_0x52f567(0x121)]),_0x3cd1d2=_0x163943[_0x52f567(0x15f)]['new'],_0x316faa=_0x163943['segments'][_0x52f567(0x186)],_0x2b19d1=_0x163943[_0x52f567(0x15f)][_0x52f567(0x11c)],_0x2d23b1=_0x163943[_0x52f567(0x15f)][_0x52f567(0x18e)],_0x234a80=_0x163943[_0x52f567(0x156)][_0x52f567(0x14c)],_0x112aef=_0x163943['journeys'][_0x52f567(0x14e)],_0x105d12=_0x163943[_0x52f567(0x16e)][_0x52f567(0x186)],_0xe0b6a9=_0x163943['journeys'][_0x52f567(0x11c)],_0x155c96=_0x163943[_0x52f567(0x16e)][_0x52f567(0x18e)],_0xaa734b=_0x163943[_0x52f567(0x142)][_0x52f567(0x150)],_0x400d15=_0x163943['activations'][_0x52f567(0x14c)],_0x2e398a=_0x163943[_0x52f567(0x142)][_0x52f567(0x166)],_0x4eaf4a=_0x163943['activations'][_0x52f567(0x18e)];console[_0x52f567(0xff)](_0x52f567(0x159)+_0x1ab207+'\x27:');_0x234a80[_0x52f567(0x10f)]>0x0&&console['error']('\x20\x20'+a47_0x3c0bcb['blue']('📁\x20'+_0x234a80['length']+_0x52f567(0x108)));if(!_0x4bbee1[_0x52f567(0x121)]){console[_0x52f567(0xff)](_0x52f567(0x128)),console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb['green']('+\x20'+_0x3cd1d2['length']+_0x52f567(0x155))),console[_0x52f567(0xff)]('\x20\x20\x20\x20'+a47_0x3c0bcb[_0x52f567(0xfb)]('~\x20'+_0x316faa['length']+_0x52f567(0x153)));if(_0x2d23b1['length']>0x0)console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0x169)]('-\x20'+_0x2d23b1[_0x52f567(0x10f)]+'\x20to\x20delete'));else _0x5433ce[_0x52f567(0x10f)]>0x0&&!_0x4bbee1['delete']&&console['error'](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0x15c)](_0x5433ce[_0x52f567(0x10f)]+_0x52f567(0x107)));console['error'](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0x15c)]('=\x20'+_0x2b19d1[_0x52f567(0x10f)]+'\x20unchanged'));}if(_0x4c1997[_0x52f567(0x10f)]>0x0||_0x38447a[_0x52f567(0x10f)]>0x0){console['error'](_0x52f567(0x179)),console[_0x52f567(0xff)]('\x20\x20\x20\x20'+a47_0x3c0bcb['green']('+\x20'+_0x112aef[_0x52f567(0x10f)]+_0x52f567(0x155))),console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0xfb)]('~\x20'+_0x105d12[_0x52f567(0x10f)]+'\x20changed'));if(_0x155c96[_0x52f567(0x10f)]>0x0)console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0x169)]('-\x20'+_0x155c96[_0x52f567(0x10f)]+_0x52f567(0xf4)));else _0x38447a[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x100)]&&console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb['dim'](_0x38447a[_0x52f567(0x10f)]+_0x52f567(0x107)));console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb['dim']('=\x20'+_0xe0b6a9[_0x52f567(0x10f)]+'\x20unchanged'));}_0xaa734b[_0x52f567(0x10f)]>0x0&&!_0x4bbee1['journeysOnly']&&(console[_0x52f567(0xff)](''),console[_0x52f567(0xff)](_0x52f567(0x12d)),_0x400d15[_0x52f567(0x10f)]>0x0&&console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0x149)]('+\x20'+_0x400d15[_0x52f567(0x10f)]+_0x52f567(0x17a))),_0x2e398a['length']>0x0&&console[_0x52f567(0xff)]('\x20\x20\x20\x20'+a47_0x3c0bcb['yellow']('~\x20'+_0x2e398a[_0x52f567(0x10f)]+'\x20to\x20update')),_0x4eaf4a[_0x52f567(0x10f)]>0x0&&console['error'](_0x52f567(0xf7)+a47_0x3c0bcb['red']('-\x20'+_0x4eaf4a['length']+_0x52f567(0xf4))));console[_0x52f567(0xff)](_0x52f567(0x15d)+a47_0x3c0bcb['cyan'](_0x457eed)+'\x0a');if(_0x234a80[_0x52f567(0x10f)]>0x0){console[_0x52f567(0xff)](_0x52f567(0x116));for(const _0x1dd29e of _0x234a80){console['error']('\x20\x20'+a47_0x3c0bcb[_0x52f567(0x14f)]('+')+'\x20'+_0x1dd29e);}console[_0x52f567(0xff)]('');}if(_0x3cd1d2[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x121)])for(const _0x303f3b of _0x3cd1d2){const _0x3c2c90=_0x303f3b[_0x52f567(0x14d)]?_0x303f3b[_0x52f567(0x14d)]+'/'+_0x303f3b['yamlConfig']['name']:_0x303f3b[_0x52f567(0x18a)]['name'],_0x4523c7=_0x303f3b[_0x52f567(0x18a)][_0x52f567(0x142)]?.[_0x52f567(0x10f)]||0x0,_0x150f07=_0x4523c7>0x0?a47_0x3c0bcb[_0x52f567(0x15c)]('\x20['+_0x4523c7+_0x52f567(0xf8)):'';console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb['green'](_0x52f567(0x147))+'\x20'+_0x3c2c90+_0x150f07),console[_0x52f567(0xff)]('─'[_0x52f567(0x16d)](0x3c)),_0x303f3b[_0x52f567(0x18b)]&&console[_0x52f567(0xff)](_0x303f3b[_0x52f567(0x18b)]),console[_0x52f567(0xff)]('─'['repeat'](0x3c));}if(_0x2d23b1['length']>0x0&&!_0x4bbee1[_0x52f567(0x121)])for(const _0x51243b of _0x2d23b1){const _0x410157=_0x51243b['segmentFolderId']?_0x7210d1[_0x52f567(0x12c)](_0x51243b['segmentFolderId']['toString']())||'':'',_0x38fa00=_0x410157?_0x410157+'/'+_0x51243b[_0x52f567(0x154)]:_0x51243b['name'],_0x95c2bd=_0x4e7eb2[_0x52f567(0x12c)](_0x51243b['id'])||[],_0x2d3bca=_0x95c2bd['length']>0x0?a47_0x3c0bcb[_0x52f567(0x15c)]('\x20['+_0x95c2bd[_0x52f567(0x10f)]+_0x52f567(0xf8)):'';console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb[_0x52f567(0x169)]('Delete\x20segment:')+'\x20'+_0x38fa00+_0x2d3bca),console['error']('─'[_0x52f567(0x16d)](0x3c));const _0x85c50=segmentWithActivationsToYaml(_0x51243b,_0x95c2bd,undefined,_0x5c8227,_0x2ac23f),_0x3543a1=segmentToYamlString(_0x85c50),_0x737d81=generateDiff(_0x3543a1,'');console[_0x52f567(0xff)](formatDiffWithColors(_0x737d81)),console['error']('─'[_0x52f567(0x16d)](0x3c));}const _0x4efb53=_0x4e8f1b[_0x52f567(0x12a)](_0x1b023d=>!_0x1b023d['isNew']&&_0x1b023d[_0x52f567(0x18b)]);if(_0x4efb53[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x121)])for(const _0x504e92 of _0x4efb53){const _0x4febbb=_0x504e92['folderPath']?_0x504e92[_0x52f567(0x14d)]+'/'+_0x504e92[_0x52f567(0x18a)][_0x52f567(0x154)]:_0x504e92[_0x52f567(0x18a)][_0x52f567(0x154)];console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb[_0x52f567(0xfb)]('Changes\x20to:')+'\x20'+_0x4febbb),console[_0x52f567(0xff)]('─'[_0x52f567(0x16d)](0x3c)),console[_0x52f567(0xff)](_0x504e92[_0x52f567(0x18b)]),console['error']('─'['repeat'](0x3c));}if(_0x112aef[_0x52f567(0x10f)]>0x0)for(const _0x489115 of _0x112aef){const _0x4fa76f=_0x489115[_0x52f567(0x14d)]?_0x489115[_0x52f567(0x14d)]+'/'+_0x489115['yamlConfig']['name']:_0x489115['yamlConfig'][_0x52f567(0x154)];console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb['green'](_0x52f567(0x10e))+'\x20'+_0x4fa76f),console['error']('─'['repeat'](0x3c)),_0x489115[_0x52f567(0x18b)]&&console[_0x52f567(0xff)](_0x489115[_0x52f567(0x18b)]),console[_0x52f567(0xff)]('─'[_0x52f567(0x16d)](0x3c));}const _0x286f52=_0x4c1997[_0x52f567(0x12a)](_0x1876de=>!_0x1876de[_0x52f567(0xf5)]&&_0x1876de['diff']);if(_0x286f52[_0x52f567(0x10f)]>0x0)for(const _0x5d03f6 of _0x286f52){const _0x587d21=_0x5d03f6[_0x52f567(0x14d)]?_0x5d03f6['folderPath']+'/'+_0x5d03f6[_0x52f567(0x18a)][_0x52f567(0x154)]:_0x5d03f6[_0x52f567(0x18a)][_0x52f567(0x154)];console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x13f))+'\x20'+_0x587d21),console[_0x52f567(0xff)]('─'[_0x52f567(0x16d)](0x3c)),console[_0x52f567(0xff)](_0x5d03f6[_0x52f567(0x18b)]),console[_0x52f567(0xff)]('─'[_0x52f567(0x16d)](0x3c));}if(_0x155c96[_0x52f567(0x10f)]>0x0)for(const _0x458fda of _0x155c96){const _0x5eccdd=_0x458fda[_0x52f567(0x187)]?_0x7210d1['get'](_0x458fda['folderId'])||'':'',_0x3cd2a5=_0x5eccdd?_0x5eccdd+'/'+_0x458fda['journeyBundleName']:_0x458fda['journeyBundleName'];console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb[_0x52f567(0x169)]('Delete\x20journey:')+'\x20'+_0x3cd2a5),console['error']('─'['repeat'](0x3c)),console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)]('(Journey\x20will\x20be\x20deleted)')),console[_0x52f567(0xff)]('─'['repeat'](0x3c));}if(_0x4bbee1[_0x52f567(0x148)])return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x10c))),0x0;const _0x3d6580=_0x4bbee1['journeysOnly']?![]:_0x3cd1d2[_0x52f567(0x10f)]>0x0||_0x316faa['length']>0x0||_0x2d23b1['length']>0x0,_0x33151f=_0x112aef['length']>0x0||_0x105d12['length']>0x0||_0x155c96[_0x52f567(0x10f)]>0x0,_0x2dca23=_0x4bbee1[_0x52f567(0x121)]?![]:_0xaa734b[_0x52f567(0x10f)]>0x0,_0x1b536c=_0x234a80[_0x52f567(0x10f)]>0x0;if(!_0x3d6580&&!_0x33151f&&!_0x2dca23&&!_0x1b536c){const _0x134a2f=_0x4bbee1['journeysOnly']?_0x52f567(0x180):_0x52f567(0x146);console['error'](a47_0x3c0bcb['green'](_0x134a2f));if(_0x464db7&&_0x2b19d1[_0x52f567(0x10f)]===0x1){const _0x4ed5d3=_0x2b19d1[0x0];if(_0x4ed5d3['existingSegment']?.['id']){const _0x512857=getConsoleNextUrl(_0x4bbee1[_0x52f567(0x13d)],_0x52f567(0x13e)+_0x5a9633+_0x52f567(0x104)+_0x4ed5d3[_0x52f567(0xfa)]['id']+'/sb/da/esr');console[_0x52f567(0xff)](_0x52f567(0x137)+a47_0x3c0bcb[_0x52f567(0x16a)](_0x512857));}}if(_0x464db7&&_0xe0b6a9[_0x52f567(0x10f)]===0x1){const _0x340e81=_0xe0b6a9[0x0];if(_0x340e81[_0x52f567(0x12f)]?.['id']){const _0x4af24c=getConsoleNextUrl(_0x4bbee1[_0x52f567(0x13d)],'/app/ps/'+_0x5a9633+_0x52f567(0x104)+_0x340e81[_0x52f567(0x12f)]['id']+_0x52f567(0x17f));console['error']('\x20\x20'+a47_0x3c0bcb[_0x52f567(0x16a)](_0x4af24c));}}return 0x0;}const _0x450d4e=_0x4bbee1[_0x52f567(0x121)]?_0x112aef[_0x52f567(0x10f)]+_0x105d12['length']+_0x155c96[_0x52f567(0x10f)]+_0x234a80[_0x52f567(0x10f)]:_0x3cd1d2[_0x52f567(0x10f)]+_0x316faa['length']+_0x2d23b1[_0x52f567(0x10f)]+_0x112aef['length']+_0x105d12[_0x52f567(0x10f)]+_0x155c96[_0x52f567(0x10f)]+_0x234a80[_0x52f567(0x10f)]+_0xaa734b[_0x52f567(0x10f)];if(!_0x4bbee1[_0x52f567(0x141)]&&_0x450d4e>0x0){if(!isInteractive())return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)](_0x52f567(0x167)),_0x52f567(0x14b)),console['error'](a47_0x3c0bcb[_0x52f567(0x15c)](_0x52f567(0x103))),0x1;const _0x379472=await confirmKey(_0x52f567(0x133)+_0x450d4e+_0x52f567(0x110));if(!_0x379472)return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x115))),0x1;}const _0x1bf6c9={'withProgress':async(_0x3e2071,_0x463606)=>{const _0x426941=_0x52f567,_0x1ea6ae=await withSpinner(_0x3e2071,_0x463606,{'verbose':_0x4bbee1[_0x426941(0x10b)]});return{'data':_0x1ea6ae[_0x426941(0x130)]};},'logInfo':_0x48cb20=>console[_0x52f567(0xff)](a47_0x3c0bcb['blue']('✔\x20'+_0x48cb20)),'logSuccess':_0x153ba1=>console[_0x52f567(0xff)](a47_0x3c0bcb['green']('✔\x20'+_0x153ba1)),'logWarning':_0xd47a28=>console['error'](a47_0x3c0bcb[_0x52f567(0xfb)]('⚠\x20'+_0xd47a28)),'logDeleted':_0x31ffa4=>console[_0x52f567(0xff)](a47_0x3c0bcb['red']('✔\x20'+_0x31ffa4))},_0x17eb86={'segment':_0x312c60[_0x52f567(0x18d)],'journey':_0x312c60[_0x52f567(0x101)],'user':_0x312c60['user'],'connection':_0x312c60[_0x52f567(0x124)]};_0x234a80[_0x52f567(0x10f)]>0x0&&(_0x307917=await executePushFolders(_0x17eb86,_0x234a80,_0x307917,{'parentId':_0x5a9633},_0x1bf6c9));const _0x3a3e89={'rootFolderId':_0x3d3315,'folderPathToId':_0x307917,'folderIdToPath':_0x7210d1,'segmentNameToId':_0x2ad6a4,'activationsBySegmentId':_0x4e7eb2,'emailToIdMap':_0x44131d,'idToEmailMap':_0x5c8227,'connectionNameToIdMap':_0x5c2e5e['nameToId'],'connectionIdToNameMap':_0x5c2e5e[_0x52f567(0x129)],'connectionNameToTypeMap':_0xb9eaf0},_0x4b1333=await executePushSegments(_0x17eb86,_0x4bbee1[_0x52f567(0x121)]?[]:_0x4e8f1b,_0x3a3e89,{'parentId':_0x5a9633},_0x1bf6c9),_0x20cd59=_0x4b1333['created'],_0x212eda=_0x4b1333[_0x52f567(0x160)],_0xbbf30a=_0x4b1333['activations'][_0x52f567(0x15e)],_0x29e7b3=_0x4b1333['activations'][_0x52f567(0x160)],_0x187a6c=_0x4b1333[_0x52f567(0x142)][_0x52f567(0x136)];let _0xc8e9af;if(_0x464db7&&_0x4e8f1b[_0x52f567(0x10f)]===0x1){const _0x590471=_0x4e8f1b[0x0];_0xc8e9af=_0x590471['existingSegment']?.['id']??_0x4b1333['createdSegmentIds']['get'](_0x590471['yamlConfig'][_0x52f567(0x154)]);}const _0x52f082=await executePushSegmentDeletions(_0x17eb86,_0x4bbee1['journeysOnly']?[]:_0x2d23b1,_0x1bf6c9);let _0x58c7c8=0x0,_0x500e4b=0x0,_0x37fc96=0x0;const _0x52667b=new Map(_0x2ad6a4);for(const [_0x3eabc5,_0x2f5504]of _0x4b1333[_0x52f567(0x174)]){_0x52667b['set'](_0x3eabc5,_0x2f5504);}if(_0x4c1997[_0x52f567(0x10f)]>0x0){const _0x38b2f2={..._0x3a3e89,'segmentNameToId':_0x52667b,'existingSegments':_0x3bb2a9,'activationContext':_0x5b03b4},_0x287e4a=await executePushJourneys(_0x17eb86,_0x4c1997,_0x38b2f2,{'parentId':_0x5a9633,'rootFolderId':_0x3d3315,'verbose':_0x4bbee1[_0x52f567(0x10b)]},_0x1bf6c9);_0x58c7c8=_0x287e4a[_0x52f567(0x15e)],_0x500e4b=_0x287e4a['updated'];if(_0x464db7&&_0x287e4a[_0x52f567(0x12e)][_0x52f567(0x10f)]===0x1){const _0x62866a=_0x287e4a[_0x52f567(0x12e)][0x0];if(_0x62866a[_0x52f567(0x13b)]){const _0x470b59=getConsoleNextUrl(_0x4bbee1['site'],_0x52f567(0x13e)+_0x5a9633+_0x52f567(0x104)+_0x62866a['journeyId']+_0x52f567(0x17f));console[_0x52f567(0xff)]('\x20\x20'+a47_0x3c0bcb[_0x52f567(0x16a)](_0x470b59));}}}for(const _0x561074 of _0x155c96){console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x171)+_0x561074[_0x52f567(0x185)])),_0x37fc96++;}const _0x2ddb3a=[];if(_0x20cd59>0x0)_0x2ddb3a['push'](_0x20cd59+'\x20created');if(_0x212eda>0x0)_0x2ddb3a[_0x52f567(0x117)](_0x212eda+'\x20updated');if(_0x52f082>0x0)_0x2ddb3a[_0x52f567(0x117)](_0x52f082+_0x52f567(0x16b));const _0x5cd980=[];if(_0x58c7c8>0x0)_0x5cd980[_0x52f567(0x117)](_0x58c7c8+_0x52f567(0x163));if(_0x500e4b>0x0)_0x5cd980['push'](_0x500e4b+'\x20updated');if(_0x37fc96>0x0)_0x5cd980[_0x52f567(0x117)](_0x37fc96+_0x52f567(0x16b));const _0x108a46=[];if(_0xbbf30a>0x0)_0x108a46[_0x52f567(0x117)](_0xbbf30a+_0x52f567(0x163));if(_0x29e7b3>0x0)_0x108a46['push'](_0x29e7b3+'\x20updated');if(_0x187a6c>0x0)_0x108a46['push'](_0x187a6c+_0x52f567(0x16b));console['error'](a47_0x3c0bcb['green'](_0x52f567(0x119)));_0x2ddb3a[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x121)]&&console[_0x52f567(0xff)](_0x52f567(0x144)+_0x2ddb3a[_0x52f567(0x162)](',\x20'));_0x5cd980[_0x52f567(0x10f)]>0x0&&console[_0x52f567(0xff)](_0x52f567(0x168)+_0x5cd980[_0x52f567(0x162)](',\x20'));_0x108a46[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x121)]&&console[_0x52f567(0xff)]('\x20\x20Activations:\x20'+_0x108a46['join'](',\x20'));if(_0xc8e9af){const _0x1115cb=getConsoleNextUrl(_0x4bbee1[_0x52f567(0x13d)],_0x52f567(0x13e)+_0x5a9633+'/e/'+_0xc8e9af+_0x52f567(0x10d));console['error'](_0x52f567(0x137)+a47_0x3c0bcb[_0x52f567(0x16a)](_0x1115cb));}return 0x0;}}
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 +1 @@
1
- function a48_0x4109(){const _0x3ae26f=['segmentName','resolveFolderId','Resolving\x20folder\x20\x27','640DzCBRH','INTERNAL','3pLrJJJ','type','description','segmentId','715oZzZTz','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','1206692MAFRuM','260284bMkeLe','segment','5425632uVcRkE','1808pXknPn','Error:\x20Cannot\x20update\x20','yellow','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','error','name','data','Resolving\x20path\x20\x27','1970qqEwHS','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','kind','folder','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','\x27...','parentId','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','verbose','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','43841JUUfPy','segmentPath','Resolved\x20folder\x20ID:\x20','5167845nUwdzA','\x20\x20\x20Path:\x20','285700nAJQyp','Examples:','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','includes','updateSegmentById','Updating\x20segment\x20\x27'];a48_0x4109=function(){return _0x3ae26f;};return a48_0x4109();}function a48_0x50cf(_0x339ae0,_0x297ea7){_0x339ae0=_0x339ae0-0xa4;const _0x410953=a48_0x4109();let _0x50cf4f=_0x410953[_0x339ae0];return _0x50cf4f;}const a48_0x420180=a48_0x50cf;(function(_0x48cf4a,_0x3a8354){const _0x168bfc=a48_0x50cf,_0x59cf19=_0x48cf4a();while(!![]){try{const _0x33f235=parseInt(_0x168bfc(0xa7))/0x1+-parseInt(_0x168bfc(0xa6))/0x2*(parseInt(_0x168bfc(0xce))/0x3)+parseInt(_0x168bfc(0xaa))/0x4*(-parseInt(_0x168bfc(0xb3))/0x5)+-parseInt(_0x168bfc(0xa9))/0x6+-parseInt(_0x168bfc(0xbe))/0x7*(parseInt(_0x168bfc(0xcc))/0x8)+parseInt(_0x168bfc(0xc1))/0x9+-parseInt(_0x168bfc(0xc3))/0xa*(-parseInt(_0x168bfc(0xa4))/0xb);if(_0x33f235===_0x3a8354)break;else _0x59cf19['push'](_0x59cf19['shift']());}catch(_0x3faf23){_0x59cf19['push'](_0x59cf19['shift']());}}}(a48_0x4109,0x7b3d9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a48_0x3183ad from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';[a48_0x420180(0xd0)]='Update\x20existing\x20child\x20segment';async['execute'](_0x3f6f30){const _0x3043c4=a48_0x420180;console[_0x3043c4(0xaf)](a48_0x3183ad[_0x3043c4(0xac)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a48_0x3183ad['yellow'](_0x3043c4(0xbd)));const {options:_0x3cf53e,args:_0x2cc779,tdx:_0x425808}=_0x3f6f30,_0x307093=_0x3cf53e;if(_0x2cc779['length']===0x0)return console[_0x3043c4(0xaf)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x3043c4(0xaf)](_0x3043c4(0xc5)),console[_0x3043c4(0xaf)](_0x3043c4(0xc4)),console[_0x3043c4(0xaf)](_0x3043c4(0xbb)),console['error'](_0x3043c4(0xae)),0x1;const _0x27b0b4=_0x2cc779[0x0],_0x567137=_0x3cf53e[_0x3043c4(0xbf)];let _0x119c5d=_0x27b0b4;_0x567137&&!_0x27b0b4[_0x3043c4(0xc6)]('/')&&(_0x119c5d=_0x567137+'/'+_0x27b0b4,_0x307093[_0x3043c4(0xbc)]&&console[_0x3043c4(0xaf)](_0x3043c4(0xb8)+_0x119c5d));const _0x553981=await withSpinner(_0x3043c4(0xb2)+_0x119c5d+_0x3043c4(0xb9),()=>_0x425808[_0x3043c4(0xa8)][_0x3043c4(0xb7)](_0x119c5d),{'verbose':_0x307093['verbose']}),_0x1c49fe=_0x553981[_0x3043c4(0xb1)];_0x307093[_0x3043c4(0xbc)]&&console[_0x3043c4(0xaf)]('Resolved\x20type:\x20'+_0x1c49fe[_0x3043c4(0xcf)]);if(_0x1c49fe[_0x3043c4(0xcf)]!=='segment')return console[_0x3043c4(0xaf)](_0x3043c4(0xab)+_0x1c49fe[_0x3043c4(0xcf)]+_0x3043c4(0xa5)),console[_0x3043c4(0xaf)](_0x3043c4(0xb4)),0x1;if(!_0x1c49fe[_0x3043c4(0xd1)])throw new SDKError(ErrorCode[_0x3043c4(0xcd)],_0x3043c4(0xad));const _0x2db328=_0x1c49fe[_0x3043c4(0xba)],_0x3ed13d=_0x1c49fe[_0x3043c4(0xd1)];_0x307093[_0x3043c4(0xbc)]&&(console[_0x3043c4(0xaf)]('Parent\x20ID:\x20'+_0x2db328),console[_0x3043c4(0xaf)]('Segment\x20ID:\x20'+_0x3ed13d));let _0x441d34;if(_0x307093[_0x3043c4(0xb6)]){const _0x3efeb1=_0x307093[_0x3043c4(0xb6)],_0x124f98=await withSpinner(_0x3043c4(0xcb)+_0x3efeb1+_0x3043c4(0xb9),()=>_0x425808['segment'][_0x3043c4(0xca)](_0x2db328,_0x3efeb1),{'verbose':_0x307093['verbose']});_0x441d34=parseInt(_0x124f98[_0x3043c4(0xb1)],0xa),_0x307093[_0x3043c4(0xbc)]&&console[_0x3043c4(0xaf)](_0x3043c4(0xc0)+_0x441d34);}const _0x22bd14=await loadJSONFromOptions(_0x307093['rule'],_0x307093['ruleFile']),_0x2f68d4={'name':_0x307093['name'],'description':_0x307093['description'],'rule':_0x22bd14,'kind':_0x307093[_0x3043c4(0xb5)]!==undefined?parseInt(_0x307093[_0x3043c4(0xb5)],0xa):undefined,'segmentFolderId':_0x441d34},_0x23b589=await withSpinner(_0x3043c4(0xc8)+_0x1c49fe[_0x3043c4(0xc9)]+_0x3043c4(0xb9),()=>_0x425808[_0x3043c4(0xa8)][_0x3043c4(0xc7)](_0x2db328,_0x3ed13d,_0x2f68d4),{'verbose':_0x307093[_0x3043c4(0xbc)]}),_0x388cbc=_0x23b589['data'];return console[_0x3043c4(0xaf)]('✔\x20Updated\x20segment\x20\x27'+_0x388cbc[_0x3043c4(0xb0)]+'\x27'),_0x119c5d!==_0x27b0b4&&console[_0x3043c4(0xaf)](_0x3043c4(0xc2)+_0x119c5d),await handleSDKOutput([_0x388cbc],_0x307093),0x0;}}
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 +1 @@
1
- const a49_0x248271=a49_0x219e;(function(_0x25cd1e,_0x1d57d5){const _0x9a3e97=a49_0x219e,_0x445d13=_0x25cd1e();while(!![]){try{const _0xcd87f1=-parseInt(_0x9a3e97(0x13f))/0x1*(parseInt(_0x9a3e97(0x142))/0x2)+-parseInt(_0x9a3e97(0x144))/0x3+-parseInt(_0x9a3e97(0x13c))/0x4*(parseInt(_0x9a3e97(0x123))/0x5)+parseInt(_0x9a3e97(0x134))/0x6+-parseInt(_0x9a3e97(0x124))/0x7*(-parseInt(_0x9a3e97(0x132))/0x8)+parseInt(_0x9a3e97(0x11e))/0x9+parseInt(_0x9a3e97(0x120))/0xa;if(_0xcd87f1===_0x1d57d5)break;else _0x445d13['push'](_0x445d13['shift']());}catch(_0x4e295c){_0x445d13['push'](_0x445d13['shift']());}}}(a49_0x3086,0xcae4a));import{existsSync,statSync}from'fs';import a49_0x410188 from'chalk';function a49_0x219e(_0x266256,_0x326e7d){_0x266256=_0x266256-0x11d;const _0x30864f=a49_0x3086();let _0x219e3d=_0x30864f[_0x266256];return _0x219e3d;}function a49_0x3086(){const _0x38e5a9=['Examples:','length','parentId','dim','green','Folder\x20ID:\x20','Parent\x20ID:\x20','cyan','2368QIeSrs','Error:\x20Path\x20is\x20required\x0a','7855542UVErfg','segments','\x27...','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Usage:\x20tdx\x20segment\x20use\x20<path>','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Resolved\x20relative\x20path\x20to:\x20','fullPath','12DimOSp','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','segmentPath','18933yMJRaA','session','data','58jqToQF','error','1353315RklfTj','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','description','segment','Resolving\x20path\x20\x27','Target\x20path:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','type','verbose','Site:\x20','config','Resolved\x20path\x20type:\x20','execute','parentName','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','slice','4319073kbPpjh','✔\x20Context\x20set\x20to:\x20','10450430xSarBy','red','folderId','2092455iQCGgZ','5971xiykfA','name','site','resolvePathToResource','isDirectory','log'];a49_0x3086=function(){return _0x38e5a9;};return a49_0x3086();}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_0x248271(0x125)]='segment:use';[a49_0x248271(0x147)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a49_0x248271(0x151)](_0x998dd9){const _0x43d29d=a49_0x248271,{options:_0x1b0d03,args:_0x1f6c5b,tdx:_0x4e3718}=_0x998dd9;if(_0x1f6c5b[_0x43d29d(0x12b)]===0x0)return console[_0x43d29d(0x143)](a49_0x410188['red'](_0x43d29d(0x133))),console['error'](_0x43d29d(0x138)),console[_0x43d29d(0x143)](_0x43d29d(0x12a)),console[_0x43d29d(0x143)](_0x43d29d(0x13d)),console[_0x43d29d(0x143)](_0x43d29d(0x145)),console[_0x43d29d(0x143)](_0x43d29d(0x139)),console['error'](_0x43d29d(0x153)),0x1;const _0x5a8e6c=_0x1f6c5b[0x0],_0x49e3ca=_0x1b0d03[_0x43d29d(0x140)];try{if(_0x5a8e6c==='/')return saveSessionContext({'segment_path':undefined},_0x49e3ca),console['log'](a49_0x410188[_0x43d29d(0x12e)](_0x43d29d(0x14b))),0x0;if(existsSync(_0x5a8e6c)&&statSync(_0x5a8e6c)[_0x43d29d(0x128)]()){let _0x45c837;try{_0x45c837=findTdxConfig(_0x5a8e6c);}catch{return console['error'](a49_0x410188['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x5a8e6c)),console[_0x43d29d(0x143)](a49_0x410188[_0x43d29d(0x131)](_0x43d29d(0x146))),0x1;}const _0x11c9e5=_0x45c837[_0x43d29d(0x14f)]['parent_segment'];return saveSessionContext({'segment_path':_0x11c9e5,'parent_segment':_0x11c9e5},_0x49e3ca),console[_0x43d29d(0x129)](a49_0x410188[_0x43d29d(0x12e)](_0x43d29d(0x11f)+a49_0x410188[_0x43d29d(0x131)](_0x11c9e5))),0x0;}const _0x41f6f4=_0x1b0d03[_0x43d29d(0x13e)];let _0x100ce7=_0x5a8e6c;const _0x4f63fe=parsePath(_0x5a8e6c);if(!_0x4f63fe['isAbsolute']){if(!_0x41f6f4)return console[_0x43d29d(0x143)](a49_0x410188['red']('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x43d29d(0x143)](a49_0x410188[_0x43d29d(0x131)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x5a8e6c==='..'){const _0x5c364f=_0x41f6f4['split']('/')[_0x43d29d(0x11d)](0x0,-0x1)['join']('/');_0x100ce7=_0x5c364f||'/';}else _0x5a8e6c==='.'?_0x100ce7=_0x41f6f4:_0x100ce7=_0x41f6f4+'/'+_0x5a8e6c;_0x1b0d03[_0x43d29d(0x14d)]&&console[_0x43d29d(0x143)](_0x43d29d(0x13a)+_0x100ce7);}if(_0x100ce7==='/'||_0x100ce7==='')return saveSessionContext({'segment_path':undefined},_0x49e3ca),console[_0x43d29d(0x129)](a49_0x410188[_0x43d29d(0x12e)](_0x43d29d(0x14b))),0x0;_0x100ce7=normalizePath(_0x100ce7);const _0x1c5c39=parsePath(_0x100ce7)[_0x43d29d(0x135)];if(_0x1c5c39[_0x43d29d(0x12b)]===0x0)return saveSessionContext({'segment_path':undefined},_0x49e3ca),console[_0x43d29d(0x129)](a49_0x410188[_0x43d29d(0x12e)](_0x43d29d(0x14b))),0x0;_0x1b0d03['verbose']&&(console[_0x43d29d(0x143)](_0x43d29d(0x14e)+_0x1b0d03[_0x43d29d(0x126)]),console[_0x43d29d(0x143)](_0x43d29d(0x14a)+_0x100ce7));const _0x5e66da=await withSpinner(_0x43d29d(0x149)+_0x100ce7+_0x43d29d(0x136),()=>_0x4e3718[_0x43d29d(0x148)][_0x43d29d(0x127)](_0x100ce7),{'verbose':_0x1b0d03[_0x43d29d(0x14d)]}),_0x47fd00=_0x5e66da[_0x43d29d(0x141)];_0x1b0d03[_0x43d29d(0x14d)]&&(console[_0x43d29d(0x143)](_0x43d29d(0x150)+_0x47fd00[_0x43d29d(0x14c)]),console['error'](_0x43d29d(0x130)+_0x47fd00[_0x43d29d(0x12c)]),_0x47fd00[_0x43d29d(0x122)]&&console[_0x43d29d(0x143)](_0x43d29d(0x12f)+_0x47fd00[_0x43d29d(0x122)]));if(_0x47fd00[_0x43d29d(0x14c)]===_0x43d29d(0x148))return console[_0x43d29d(0x143)](a49_0x410188[_0x43d29d(0x121)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x43d29d(0x143)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x43d29d(0x143)](a49_0x410188[_0x43d29d(0x131)]('Use:\x20tdx\x20segment\x20use\x20'+_0x47fd00[_0x43d29d(0x152)]+(_0x47fd00['folderPath']?'/'+_0x47fd00['folderPath']['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x47fd00[_0x43d29d(0x13b)],'parent_segment':_0x47fd00['parentName']},_0x49e3ca),console[_0x43d29d(0x129)](a49_0x410188[_0x43d29d(0x12e)](_0x43d29d(0x11f)+a49_0x410188[_0x43d29d(0x131)](_0x47fd00[_0x43d29d(0x13b)]))),_0x1b0d03['verbose']&&(console['error'](a49_0x410188[_0x43d29d(0x12d)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x43d29d(0x143)](a49_0x410188[_0x43d29d(0x12d)](_0x43d29d(0x137)))),0x0;}catch(_0x3d5487){throw _0x3d5487;}}}
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 +1 @@
1
- function a50_0x2d48(_0x1063c2,_0x9ad822){_0x1063c2=_0x1063c2-0x129;const _0xb2f038=a50_0xb2f0();let _0x2d4878=_0xb2f038[_0x1063c2];return _0x2d4878;}const a50_0x6f7779=a50_0x2d48;(function(_0x12c9ea,_0x5b1946){const _0x4dae40=a50_0x2d48,_0x3fc91e=_0x12c9ea();while(!![]){try{const _0x4ff1f0=-parseInt(_0x4dae40(0x134))/0x1+-parseInt(_0x4dae40(0x13d))/0x2+-parseInt(_0x4dae40(0x13f))/0x3+parseInt(_0x4dae40(0x149))/0x4+-parseInt(_0x4dae40(0x139))/0x5+parseInt(_0x4dae40(0x138))/0x6*(-parseInt(_0x4dae40(0x14a))/0x7)+parseInt(_0x4dae40(0x15b))/0x8*(parseInt(_0x4dae40(0x12a))/0x9);if(_0x4ff1f0===_0x5b1946)break;else _0x3fc91e['push'](_0x3fc91e['shift']());}catch(_0x31e7a2){_0x3fc91e['push'](_0x3fc91e['shift']());}}}(a50_0xb2f0,0x810ff));import{BaseCommand}from'./command.js';function a50_0xb2f0(){const _0x1de86e=['invalidCount','hasErrors','verbose','file','\x20file(s)\x20valid','parentSegment','type','yellow','4114248zmRzjS','):\x20','errorCode','\x20error(s)','Validation\x20failed:\x20','36eKOiGi','cwd','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','length','✔\x20All\x20','\x20warning(s)','\x20warning(s)\x20found','red','green','description','358540vEsQry','\x20valid','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yaml','6ocxdQW','297425tyStnF','message','errors','filePath','1922508izAzKJ','helpText','1556664JQNAup','validCount','warnings','\x20file(s)\x20with\x20errors,\x20','no_parent','valid','dim','Validate\x20segment\x20and\x20journey\x20YAML\x20files','log','.yml','1724384rMgGEn','429898PjfOPQ','targetDir','cyan','segment:validate','Error:\x20Directory\x20not\x20found:\x20','warningCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','name','error'];a50_0xb2f0=function(){return _0x1de86e;};return a50_0xb2f0();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a50_0xdb39db 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_0x6f7779(0x151)]=a50_0x6f7779(0x14d);[a50_0x6f7779(0x133)]=a50_0x6f7779(0x146);async['execute'](_0x3075af){const _0x6769c=a50_0x6f7779,{options:_0x112f72,args:_0x4583a1}=_0x3075af,_0x5dbb96=_0x112f72,_0x4ebf3b=await resolveTarget({'arg':_0x4583a1[0x0],'contextParent':_0x112f72[_0x6769c(0x158)],'cwd':process[_0x6769c(0x12b)]()});if(!isSuccessfulResolution(_0x4ebf3b))return _0x4ebf3b[_0x6769c(0x15d)]===_0x6769c(0x143)?(console[_0x6769c(0x152)](a50_0xdb39db['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x6769c(0x152)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x6769c(0x152)]('\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[_0x6769c(0x152)](_0x6769c(0x150))):(console['error'](a50_0xdb39db[_0x6769c(0x131)]('Error:\x20'+_0x4ebf3b[_0x6769c(0x13a)]+'\x0a')),_0x4ebf3b[_0x6769c(0x13e)]&&console[_0x6769c(0x152)](a50_0xdb39db[_0x6769c(0x14c)](_0x4ebf3b[_0x6769c(0x13e)]))),0x1;const _0x4af0dd=_0x4ebf3b[_0x6769c(0x14b)],_0x424c30=_0x4ebf3b[_0x6769c(0x159)]===_0x6769c(0x156)?_0x4ebf3b[_0x6769c(0x13c)]:undefined;if(!_0x424c30&&!existsSync(_0x4af0dd))return console['error'](a50_0xdb39db[_0x6769c(0x131)](_0x6769c(0x14e)+_0x4af0dd+'\x0a')),0x1;let _0x3b4d06;if(_0x424c30){if(!_0x424c30['endsWith'](_0x6769c(0x148))&&!_0x424c30['endsWith'](_0x6769c(0x137)))return console[_0x6769c(0x152)](a50_0xdb39db[_0x6769c(0x131)](_0x6769c(0x12c)+_0x424c30+'\x0a')),0x1;_0x3b4d06=[_0x424c30];}else _0x3b4d06=findYamlFiles(_0x4af0dd);if(_0x3b4d06['length']===0x0)return console[_0x6769c(0x152)](a50_0xdb39db[_0x6769c(0x131)](_0x6769c(0x136)+_0x4af0dd+'\x0a')),0x1;const _0x10e9f6=validateYamlFiles(_0x3b4d06,_0x4af0dd),_0x4bb958=calculateSummary(_0x10e9f6);for(const _0x5b174f of _0x10e9f6){if(!isValidationResult(_0x5b174f))continue;const {relativePath:_0x37a79d,source:_0x225bb3,result:_0x10846b,fileType:_0x35c420}=_0x5b174f,_0x1c77fe=_0x35c420;if(_0x10846b['valid']&&_0x10846b[_0x6769c(0x141)][_0x6769c(0x12d)]===0x0)_0x5dbb96[_0x6769c(0x155)]&&console['log'](a50_0xdb39db[_0x6769c(0x132)]('✔\x20'+_0x37a79d)+a50_0xdb39db[_0x6769c(0x145)]('\x20('+_0x1c77fe+')'));else _0x10846b[_0x6769c(0x144)]?(console[_0x6769c(0x147)](a50_0xdb39db[_0x6769c(0x15a)]('⚠\x20'+_0x37a79d)+a50_0xdb39db[_0x6769c(0x145)]('\x20('+_0x1c77fe+_0x6769c(0x15c)+_0x10846b['warnings']['length']+_0x6769c(0x12f))),console[_0x6769c(0x147)](formatValidationResult(_0x10846b,_0x225bb3,_0x37a79d))):(console[_0x6769c(0x147)](a50_0xdb39db[_0x6769c(0x131)]('✖\x20'+_0x37a79d)+a50_0xdb39db[_0x6769c(0x145)]('\x20('+_0x1c77fe+_0x6769c(0x15c)+_0x10846b[_0x6769c(0x13b)]['length']+_0x6769c(0x15e))),console[_0x6769c(0x147)](formatValidationResult(_0x10846b,_0x225bb3,_0x37a79d)));}return console[_0x6769c(0x147)](''),_0x4bb958[_0x6769c(0x154)]?(console[_0x6769c(0x147)](a50_0xdb39db[_0x6769c(0x131)](_0x6769c(0x129)+_0x4bb958[_0x6769c(0x153)]+_0x6769c(0x142)+_0x4bb958[_0x6769c(0x140)]+_0x6769c(0x135))),_0x4bb958[_0x6769c(0x14f)]>0x0&&console['log'](a50_0xdb39db[_0x6769c(0x15a)](_0x4bb958[_0x6769c(0x14f)]+'\x20warning(s)\x20found')),0x1):(console['log'](a50_0xdb39db[_0x6769c(0x132)](_0x6769c(0x12e)+_0x4bb958[_0x6769c(0x140)]+_0x6769c(0x157))),_0x4bb958['warningCount']>0x0&&console[_0x6769c(0x147)](a50_0xdb39db[_0x6769c(0x15a)](_0x4bb958[_0x6769c(0x14f)]+_0x6769c(0x130))),0x0);}}
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 +1 @@
1
- const a51_0x59499d=a51_0x12c3;(function(_0x171c06,_0x423e2f){const _0x19d281=a51_0x12c3,_0x9f20e3=_0x171c06();while(!![]){try{const _0x3d7ff1=parseInt(_0x19d281(0x1c7))/0x1+parseInt(_0x19d281(0x1f2))/0x2*(-parseInt(_0x19d281(0x1c9))/0x3)+-parseInt(_0x19d281(0x1eb))/0x4*(-parseInt(_0x19d281(0x1d1))/0x5)+-parseInt(_0x19d281(0x1ba))/0x6*(-parseInt(_0x19d281(0x1bc))/0x7)+-parseInt(_0x19d281(0x1ef))/0x8+-parseInt(_0x19d281(0x1ff))/0x9+parseInt(_0x19d281(0x1bb))/0xa*(parseInt(_0x19d281(0x1c8))/0xb);if(_0x3d7ff1===_0x423e2f)break;else _0x9f20e3['push'](_0x9f20e3['shift']());}catch(_0x2fb4ab){_0x9f20e3['push'](_0x9f20e3['shift']());}}}(a51_0x2416,0xf0b8d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a51_0x12c3(_0x3fc61b,_0x498f46){_0x3fc61b=_0x3fc61b-0x1a9;const _0x241608=a51_0x2416();let _0x12c305=_0x241608[_0x3fc61b];return _0x12c305;}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 a51_0x3f6433 from'chalk';function a51_0x2416(){const _0x291e41=['folderId','Site:\x20','\x20folder','1295079LqHkTu','2343869veSIWb','5090937zzkKrl','dim','localeCompare','map','padEnd','journeyBundleName','Parent\x20ID:\x20','sort','5XLxRym','description',',\x20and\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x27...','path','listUnifiedWithJourneys','error','segments','message','folders','...','format','Set\x20a\x20parent\x20segment\x20context\x20first:','site','size','Found\x20','toLowerCase','searchByName','parentId','verbose','Building\x20hierarchy\x20tree...','Folder\x20ID:\x20','includes','folder','(empty)','1703816vvjCpQ','\x20segment','parentSegment','name','11530848RXKPCm','/e/','maxDepth','2tkpwFL','Error:\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','listWithPattern','cause','No\x20items\x20match\x20pattern:\x20','✔\x20Found\x20','execute','No\x20folders\x20or\x20segments\x20match\x20','Resolving\x20parent\x20segment\x20\x27','\x5c$&','replace','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','17712981GsdxYs','/app/ps/','Parent\x20segment\x20context:\x20','length','test','(id\x20','Resolving\x20path\x20\x27','List\x20folders\x20and\x20child\x20segments','filter','recursive','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','(not\x20set)','resolvePathToResource','\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.','segment','/j/da','listRecursive','journeys','data','Error:\x20No\x20parent\x20segment\x20context\x20set.','Recursive\x20mode:\x20enabled','1110BcUoUX','170DwUNmS','28343lejfYa','json','journey','log','\x20journey','type','jsonl','✔\x20Built\x20tree\x20with\x20'];a51_0x2416=function(){return _0x291e41;};return a51_0x2416();}export class SegmentsCommand extends BaseCommand{[a51_0x59499d(0x1ee)]='segments';[a51_0x59499d(0x1d2)]=a51_0x59499d(0x1ac);async[a51_0x59499d(0x1f9)](_0x95fb75){const _0x4398b8=a51_0x59499d,{options:_0x5b25cb,args:_0x33f015}=_0x95fb75,_0x2920ed=_0x5b25cb[_0x4398b8(0x1ae)],_0x4b99ef=_0x33f015[0x0];try{const _0x3bd16d=_0x5b25cb[_0x4398b8(0x1ed)];_0x5b25cb[_0x4398b8(0x1e5)]&&(console[_0x4398b8(0x1d8)](_0x4398b8(0x1c5)+_0x5b25cb['site']),console['error'](_0x4398b8(0x201)+(_0x3bd16d||_0x4398b8(0x1b0))),_0x4b99ef&&console[_0x4398b8(0x1d8)]('Folder/pattern\x20arg:\x20'+_0x4b99ef),_0x2920ed&&console[_0x4398b8(0x1d8)](_0x4398b8(0x1b9)));if(!_0x3bd16d)return console[_0x4398b8(0x1d8)](_0x4398b8(0x1b8)),console[_0x4398b8(0x1d8)](''),console['error'](_0x4398b8(0x1de)),console[_0x4398b8(0x1d8)](_0x4398b8(0x1fe)),console[_0x4398b8(0x1d8)](_0x4398b8(0x1f4)),console['error'](''),console['error'](_0x4398b8(0x1af)),0x1;if(_0x4b99ef&&_0x2920ed)return await this[_0x4398b8(0x1e3)](_0x95fb75,_0x3bd16d,_0x4b99ef);const _0x303221=_0x4b99ef&&(_0x4b99ef['includes']('*')||_0x4b99ef[_0x4398b8(0x1e8)]('?'));if(_0x303221)return await this[_0x4398b8(0x1f5)](_0x95fb75,_0x3bd16d,_0x4b99ef);const _0x5226f7=_0x4b99ef?_0x3bd16d+'/'+_0x4b99ef:_0x3bd16d;return _0x2920ed?await this[_0x4398b8(0x1b5)](_0x95fb75,_0x5226f7):await this['listUnified'](_0x95fb75,_0x5226f7);}catch(_0x749070){if(_0x749070 instanceof SDKError)return console[_0x4398b8(0x1d8)](_0x4398b8(0x1f3)+_0x749070[_0x4398b8(0x1da)]),_0x749070[_0x4398b8(0x1f6)]&&console['error']('\x20\x20Cause:\x20'+_0x749070['cause']),0x1;throw _0x749070;}}async[a51_0x59499d(0x1e3)](_0x47679e,_0x293a8c,_0x1c94be){const _0x54e7da=a51_0x59499d,{options:_0x5d371f,tdx:_0xec1188}=_0x47679e,_0x1b3dc4='\x22'+_0x1c94be+'\x22',_0x160f7c=await withSpinner(_0x54e7da(0x1ab)+_0x293a8c+_0x54e7da(0x1d5),()=>_0xec1188[_0x54e7da(0x1b3)][_0x54e7da(0x1b1)](_0x293a8c),{'verbose':_0x5d371f[_0x54e7da(0x1e5)]}),_0x3cee0f=_0x160f7c[_0x54e7da(0x1b7)],_0x50c01c=_0x5d371f[_0x54e7da(0x1f1)]||0xa,_0x16b738=await withSpinner('Searching\x20the\x20tree\x20for\x20names\x20matching\x20'+_0x1b3dc4+_0x54e7da(0x1dc),()=>_0xec1188[_0x54e7da(0x1b3)][_0x54e7da(0x1b5)](_0x3cee0f[_0x54e7da(0x1e4)],_0x3cee0f[_0x54e7da(0x1c4)],0x0,_0x50c01c),{'verbose':_0x5d371f[_0x54e7da(0x1e5)]}),_0x37443c=searchTreeByName(_0x16b738['data'],_0x1c94be),_0x499d73=_0x70fd0d=>getConsoleNextUrl(_0x5d371f[_0x54e7da(0x1df)],_0x54e7da(0x200)+_0x3cee0f[_0x54e7da(0x1e4)]+'/e/'+_0x70fd0d),_0x39df00=[..._0x37443c][_0x54e7da(0x1d0)]((_0x2d16e6,_0xd14bd0)=>_0x2d16e6[_0x54e7da(0x1d6)]['localeCompare'](_0xd14bd0[_0x54e7da(0x1d6)])),_0x4a01ab=0x32,_0x5571bd=_0x54e7da(0x1e1)+_0x37443c[_0x54e7da(0x202)]+'\x20match'+(_0x37443c[_0x54e7da(0x202)]!==0x1?'es':'');console[_0x54e7da(0x1d8)](_0x37443c[_0x54e7da(0x202)]>_0x4a01ab?'✔\x20'+_0x5571bd+'\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.':'✔\x20'+_0x5571bd);if(_0x5d371f['format']===_0x54e7da(0x1bd)||_0x5d371f[_0x54e7da(0x1dd)]===_0x54e7da(0x1c2)){const _0x31ca90=_0x39df00[_0x54e7da(0x1cc)](_0x157151=>({..._0x157151,..._0x157151[_0x54e7da(0x1c1)]===_0x54e7da(0x1b3)?{'url':_0x499d73(_0x157151['id'])}:{}}));return await handleSDKOutput(_0x31ca90,_0x5d371f),0x0;}if(_0x37443c[_0x54e7da(0x202)]===0x0)return console[_0x54e7da(0x1bf)](_0x54e7da(0x1fa)+_0x1b3dc4),0x0;for(const _0x128144 of _0x39df00){console[_0x54e7da(0x1bf)](_0x128144[_0x54e7da(0x1c1)][_0x54e7da(0x1cd)](0x8)+'\x20'+_0x128144[_0x54e7da(0x1d6)]+'\x20\x20'+a51_0x3f6433[_0x54e7da(0x1ca)](_0x54e7da(0x1aa)+_0x128144['id']+')'));}const _0x562126=_0x37443c[_0x54e7da(0x1ad)](_0x34a684=>_0x34a684[_0x54e7da(0x1c1)]==='segment'),_0x4601c7=new Set(_0x562126['map'](_0x3b126c=>_0x3b126c['name'][_0x54e7da(0x1e2)]()))[_0x54e7da(0x1e0)]===0x1;return _0x562126[_0x54e7da(0x202)]>0x1&&_0x4601c7&&console[_0x54e7da(0x1bf)](a51_0x3f6433[_0x54e7da(0x1ca)]('\x0a'+_0x562126[_0x54e7da(0x202)]+_0x54e7da(0x1b2))),0x0;}async['listWithPattern'](_0x338203,_0x527879,_0x564157){const _0x7d81f2=a51_0x59499d,{options:_0x4587c1,tdx:_0x142601}=_0x338203,_0x5e2920=await withSpinner(_0x7d81f2(0x1fb)+_0x527879+_0x7d81f2(0x1d5),()=>_0x142601['segment'][_0x7d81f2(0x1b1)](_0x527879),{'verbose':_0x4587c1[_0x7d81f2(0x1e5)]}),_0x1150e5=_0x5e2920[_0x7d81f2(0x1b7)],_0x456483=await withSpinner(_0x7d81f2(0x1d4),()=>_0x142601['segment']['listUnifiedWithJourneys'](_0x1150e5[_0x7d81f2(0x1e4)],_0x1150e5[_0x7d81f2(0x1c4)]),{'verbose':_0x4587c1[_0x7d81f2(0x1e5)]}),{folders:_0x2f86d6,segments:_0x2c0833,journeys:_0x1237d4}=_0x456483['data'],_0x49e97a=_0x564157['replace'](/[.+^${}()|[\]\\]/g,_0x7d81f2(0x1fc))[_0x7d81f2(0x1fd)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x282191=new RegExp('^'+_0x49e97a+'$','i'),_0x2598d4=_0x2f86d6[_0x7d81f2(0x1ad)](_0x3592ad=>_0x282191[_0x7d81f2(0x1a9)](_0x3592ad[_0x7d81f2(0x1ee)])),_0x55a7f2=_0x2c0833['filter'](_0x490ee9=>_0x282191[_0x7d81f2(0x1a9)](_0x490ee9[_0x7d81f2(0x1ee)])),_0x5aaac7=_0x1237d4[_0x7d81f2(0x1ad)](_0xe69285=>_0x282191[_0x7d81f2(0x1a9)](_0xe69285['journeyBundleName'])),_0x300bbd=_0x2598d4[_0x7d81f2(0x202)]+_0x55a7f2[_0x7d81f2(0x202)]+_0x5aaac7['length'];console[_0x7d81f2(0x1d8)](_0x7d81f2(0x1f8)+_0x2598d4[_0x7d81f2(0x202)]+_0x7d81f2(0x1c6)+(_0x2598d4[_0x7d81f2(0x202)]!==0x1?'s':'')+',\x20'+_0x55a7f2['length']+_0x7d81f2(0x1ec)+(_0x55a7f2['length']!==0x1?'s':'')+',\x20and\x20'+_0x5aaac7[_0x7d81f2(0x202)]+'\x20journey'+(_0x5aaac7[_0x7d81f2(0x202)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x564157+'\x27');const _0x1f870c=_0x4a2dbd=>{const _0x10727a=_0x7d81f2;return getConsoleNextUrl(_0x4587c1[_0x10727a(0x1df)],_0x10727a(0x200)+_0x1150e5['parentId']+_0x10727a(0x1f0)+_0x4a2dbd);},_0x3c8b39=_0x4587c1[_0x7d81f2(0x1dd)]==='json'||_0x4587c1[_0x7d81f2(0x1dd)]===_0x7d81f2(0x1c2);if(_0x3c8b39){const _0x5c2c89=[..._0x2598d4['map'](_0x2e45d4=>({..._0x2e45d4,'type':_0x7d81f2(0x1e9)})),..._0x55a7f2[_0x7d81f2(0x1cc)](_0x478d06=>({..._0x478d06,'type':_0x7d81f2(0x1b3),'url':_0x1f870c(_0x478d06['id'])})),..._0x5aaac7[_0x7d81f2(0x1cc)](_0x1bf08e=>({..._0x1bf08e,'name':_0x1bf08e[_0x7d81f2(0x1ce)],'type':_0x7d81f2(0x1be)}))][_0x7d81f2(0x1d0)]((_0xb99323,_0x4c8f08)=>_0xb99323['name'][_0x7d81f2(0x1cb)](_0x4c8f08[_0x7d81f2(0x1ee)]));await handleSDKOutput(_0x5c2c89,_0x4587c1);}else{if(_0x300bbd===0x0)console[_0x7d81f2(0x1bf)](_0x7d81f2(0x1f7)+_0x564157);else{console[_0x7d81f2(0x1bf)](a51_0x3f6433['dim']('['+_0x527879+']\x20matching\x20\x27'+_0x564157+'\x27'));const _0x3ee043=formatFlatList(_0x2598d4,_0x55a7f2,{'showMetadata':!![],'getSegmentUrl':_0x1f870c},_0x5aaac7);console[_0x7d81f2(0x1bf)](_0x3ee043);}}return 0x0;}async['listUnified'](_0x16f835,_0x35f80c){const _0x2708b2=a51_0x59499d,{options:_0x3f5b40,tdx:_0x53e578}=_0x16f835,_0x3cb9f1=await withSpinner(_0x2708b2(0x1ab)+_0x35f80c+'\x27...',()=>_0x53e578[_0x2708b2(0x1b3)][_0x2708b2(0x1b1)](_0x35f80c),{'verbose':_0x3f5b40[_0x2708b2(0x1e5)]}),_0x4b8e60=_0x3cb9f1[_0x2708b2(0x1b7)];_0x3f5b40[_0x2708b2(0x1e5)]&&(console[_0x2708b2(0x1d8)](_0x2708b2(0x1cf)+_0x4b8e60[_0x2708b2(0x1e4)]),_0x4b8e60[_0x2708b2(0x1c4)]&&console['error'](_0x2708b2(0x1e7)+_0x4b8e60['folderId']));const _0x3521fe=await withSpinner(_0x2708b2(0x1d4),()=>_0x53e578[_0x2708b2(0x1b3)][_0x2708b2(0x1d7)](_0x4b8e60[_0x2708b2(0x1e4)],_0x4b8e60['folderId']),{'verbose':_0x3f5b40[_0x2708b2(0x1e5)]}),{folders:_0x426393,segments:_0x5a1de9,journeys:_0x4c4cb4}=_0x3521fe[_0x2708b2(0x1b7)],_0x286617=_0x426393[_0x2708b2(0x202)]+_0x5a1de9[_0x2708b2(0x202)]+_0x4c4cb4[_0x2708b2(0x202)];console[_0x2708b2(0x1d8)](_0x2708b2(0x1f8)+_0x426393[_0x2708b2(0x202)]+'\x20folder'+(_0x426393[_0x2708b2(0x202)]!==0x1?'s':'')+',\x20'+_0x5a1de9['length']+_0x2708b2(0x1ec)+(_0x5a1de9[_0x2708b2(0x202)]!==0x1?'s':'')+_0x2708b2(0x1d3)+_0x4c4cb4[_0x2708b2(0x202)]+_0x2708b2(0x1c0)+(_0x4c4cb4['length']!==0x1?'s':''));const _0x44550c=_0x542d2f=>{const _0xe50c20=_0x2708b2;return getConsoleNextUrl(_0x3f5b40[_0xe50c20(0x1df)],_0xe50c20(0x200)+_0x4b8e60[_0xe50c20(0x1e4)]+_0xe50c20(0x1f0)+_0x542d2f);},_0x1a6eef=_0x313e97=>{const _0x30a5e0=_0x2708b2;return getConsoleNextUrl(_0x3f5b40[_0x30a5e0(0x1df)],_0x30a5e0(0x200)+_0x4b8e60[_0x30a5e0(0x1e4)]+'/e/'+_0x313e97+_0x30a5e0(0x1b4));},_0x350d6e=_0x3f5b40[_0x2708b2(0x1dd)]===_0x2708b2(0x1bd)||_0x3f5b40['format']===_0x2708b2(0x1c2);if(_0x350d6e){const _0x19fa65=[..._0x426393[_0x2708b2(0x1cc)](_0xb23dea=>({..._0xb23dea,'type':_0x2708b2(0x1e9)})),..._0x5a1de9[_0x2708b2(0x1cc)](_0x5bbb03=>({..._0x5bbb03,'type':_0x2708b2(0x1b3),'url':_0x44550c(_0x5bbb03['id'])})),..._0x4c4cb4[_0x2708b2(0x1cc)](_0x3f5e73=>({..._0x3f5e73,'name':_0x3f5e73['journeyBundleName'],'type':_0x2708b2(0x1be),'url':_0x1a6eef(_0x3f5e73['id'])}))][_0x2708b2(0x1d0)]((_0x47b3a6,_0x2cf8f9)=>_0x47b3a6['name'][_0x2708b2(0x1cb)](_0x2cf8f9[_0x2708b2(0x1ee)]));await handleSDKOutput(_0x19fa65,_0x3f5b40);}else{if(_0x286617===0x0)console[_0x2708b2(0x1bf)](a51_0x3f6433[_0x2708b2(0x1ca)]('['+_0x35f80c+']')),console[_0x2708b2(0x1bf)](_0x2708b2(0x1ea));else{console[_0x2708b2(0x1bf)](a51_0x3f6433[_0x2708b2(0x1ca)]('['+_0x35f80c+']'));const _0xb9f60c=formatFlatList(_0x426393,_0x5a1de9,{'showMetadata':!![],'getSegmentUrl':_0x44550c,'getJourneyUrl':_0x1a6eef},_0x4c4cb4);console[_0x2708b2(0x1bf)](_0xb9f60c);}}return 0x0;}async[a51_0x59499d(0x1b5)](_0x2d4066,_0x55be95){const _0x5cdcb7=a51_0x59499d,{options:_0x219cb8,tdx:_0x485b88}=_0x2d4066,_0x1dfb9a=await withSpinner(_0x5cdcb7(0x1ab)+_0x55be95+_0x5cdcb7(0x1d5),()=>_0x485b88[_0x5cdcb7(0x1b3)][_0x5cdcb7(0x1b1)](_0x55be95),{'verbose':_0x219cb8[_0x5cdcb7(0x1e5)]}),_0x139c7b=_0x1dfb9a[_0x5cdcb7(0x1b7)];_0x219cb8[_0x5cdcb7(0x1e5)]&&(console[_0x5cdcb7(0x1d8)]('Parent\x20ID:\x20'+_0x139c7b['parentId']),_0x139c7b[_0x5cdcb7(0x1c4)]&&console[_0x5cdcb7(0x1d8)](_0x5cdcb7(0x1e7)+_0x139c7b['folderId']));const _0xe70307=_0x219cb8[_0x5cdcb7(0x1f1)]||0xa,_0x344aee=await withSpinner(_0x5cdcb7(0x1e6),()=>_0x485b88[_0x5cdcb7(0x1b3)]['listRecursive'](_0x139c7b[_0x5cdcb7(0x1e4)],_0x139c7b[_0x5cdcb7(0x1c4)],0x0,_0xe70307),{'verbose':_0x219cb8[_0x5cdcb7(0x1e5)]}),_0x50b547=_0x344aee['data'],_0x593f97=_0x3ab504=>{const _0x2827b4=_0x5cdcb7;let _0x40ff79=0x0,_0x554f2e=0x0,_0x1a94ad=0x0;for(const _0x2ce3da of _0x3ab504){if(_0x2ce3da[_0x2827b4(0x1c1)]===_0x2827b4(0x1e9))_0x40ff79++;else{if(_0x2ce3da[_0x2827b4(0x1c1)]===_0x2827b4(0x1b3))_0x554f2e++;else{if(_0x2ce3da[_0x2827b4(0x1c1)]===_0x2827b4(0x1be))_0x1a94ad++;}}if(_0x2ce3da['children']){const _0x4d70af=_0x593f97(_0x2ce3da['children']);_0x40ff79+=_0x4d70af[_0x2827b4(0x1db)],_0x554f2e+=_0x4d70af[_0x2827b4(0x1d9)],_0x1a94ad+=_0x4d70af[_0x2827b4(0x1b6)];}}return{'folders':_0x40ff79,'segments':_0x554f2e,'journeys':_0x1a94ad};},_0x33c5dc=_0x593f97(_0x50b547);console[_0x5cdcb7(0x1d8)](_0x5cdcb7(0x1c3)+_0x33c5dc[_0x5cdcb7(0x1db)]+_0x5cdcb7(0x1c6)+(_0x33c5dc[_0x5cdcb7(0x1db)]!==0x1?'s':'')+',\x20'+_0x33c5dc[_0x5cdcb7(0x1d9)]+_0x5cdcb7(0x1ec)+(_0x33c5dc[_0x5cdcb7(0x1d9)]!==0x1?'s':'')+_0x5cdcb7(0x1d3)+_0x33c5dc[_0x5cdcb7(0x1b6)]+_0x5cdcb7(0x1c0)+(_0x33c5dc[_0x5cdcb7(0x1b6)]!==0x1?'s':''));const _0x1e208e=_0x1e9e29=>{const _0x39191a=_0x5cdcb7;return getConsoleNextUrl(_0x219cb8['site'],_0x39191a(0x200)+_0x139c7b['parentId']+'/e/'+_0x1e9e29);},_0x1354e5=_0x55193=>{const _0xfa8dd5=_0x5cdcb7;return getConsoleNextUrl(_0x219cb8['site'],_0xfa8dd5(0x200)+_0x139c7b[_0xfa8dd5(0x1e4)]+_0xfa8dd5(0x1f0)+_0x55193+_0xfa8dd5(0x1b4));};if(_0x219cb8[_0x5cdcb7(0x1dd)]===_0x5cdcb7(0x1bd)||_0x219cb8[_0x5cdcb7(0x1dd)]===_0x5cdcb7(0x1c2))await handleSDKOutput(_0x50b547,_0x219cb8);else{console[_0x5cdcb7(0x1bf)](a51_0x3f6433['dim']('['+_0x55be95+']'));const _0x5a7b60=formatTree(_0x50b547,{'showMetadata':!![],'getSegmentUrl':_0x1e208e,'getJourneyUrl':_0x1354e5});console['log'](_0x5a7b60);}return 0x0;}}
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;}}