@treasuredata/tdx 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/agent-command.js +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/context-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-proxy.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pull-command.js +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/context-signature.js +1 -1
  61. package/dist/proxy/conversation-utils.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/sdk/agent/agent-yaml.js +1 -1
  65. package/dist/sdk/api.js +1 -1
  66. package/dist/sdk/connection.js +1 -1
  67. package/dist/sdk/engage.js +1 -1
  68. package/dist/sdk/errors.js +1 -1
  69. package/dist/sdk/index.js +1 -1
  70. package/dist/sdk/job.js +1 -1
  71. package/dist/sdk/journey.js +1 -1
  72. package/dist/sdk/llm.d.ts +27 -20
  73. package/dist/sdk/llm.d.ts.map +1 -1
  74. package/dist/sdk/llm.js +1 -1
  75. package/dist/sdk/llm.js.map +1 -1
  76. package/dist/sdk/query.js +1 -1
  77. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  78. package/dist/sdk/segment/journey-yaml.js +1 -1
  79. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  80. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  81. package/dist/sdk/segment.js +1 -1
  82. package/dist/sdk/user.js +1 -1
  83. package/dist/sdk/workflow.js +1 -1
  84. package/dist/types/endpoints.js +1 -1
  85. package/dist/types/index.js +1 -1
  86. package/dist/utils/agent-config.js +1 -1
  87. package/dist/utils/agent-ref-parser.js +1 -1
  88. package/dist/utils/async.js +1 -1
  89. package/dist/utils/chat-cache.js +1 -1
  90. package/dist/utils/colors.js +1 -1
  91. package/dist/utils/command-output.js +1 -1
  92. package/dist/utils/constants.js +1 -1
  93. package/dist/utils/diff.js +1 -1
  94. package/dist/utils/fields-display.js +1 -1
  95. package/dist/utils/file-permissions.js +1 -1
  96. package/dist/utils/format-detector.js +1 -1
  97. package/dist/utils/formatters.js +1 -1
  98. package/dist/utils/journey-utils.js +1 -1
  99. package/dist/utils/json-loader.js +1 -1
  100. package/dist/utils/llm-backup-utils.js +1 -1
  101. package/dist/utils/model-aliases.js +1 -1
  102. package/dist/utils/model-factors.js +1 -1
  103. package/dist/utils/option-validation.js +1 -1
  104. package/dist/utils/port.js +1 -1
  105. package/dist/utils/process.js +1 -1
  106. package/dist/utils/prompt.js +1 -1
  107. package/dist/utils/segment-path-parser.js +1 -1
  108. package/dist/utils/segment-ref-parser.js +1 -1
  109. package/dist/utils/spinner.js +1 -1
  110. package/dist/utils/sql-parser.js +1 -1
  111. package/dist/utils/sse-parser.js +1 -1
  112. package/dist/utils/string-utils.js +1 -1
  113. package/dist/utils/table-ref-parser.js +1 -1
  114. package/dist/utils/tdx-config.js +1 -1
  115. package/dist/utils/tdx-logger.js +1 -1
  116. package/dist/utils/tree-formatter.js +1 -1
  117. package/dist/utils/version-check.js +1 -1
  118. package/dist/utils/workflow-utils.js +1 -1
  119. package/package.json +1 -1
@@ -1 +1 @@
1
- const a36_0x22d99d=a36_0x6dbb;(function(_0x1cfc3f,_0x57bfa5){const _0x3c1e84=a36_0x6dbb,_0x34f2f6=_0x1cfc3f();while(!![]){try{const _0x37d78c=-parseInt(_0x3c1e84(0x154))/0x1*(parseInt(_0x3c1e84(0x14c))/0x2)+parseInt(_0x3c1e84(0xe8))/0x3*(-parseInt(_0x3c1e84(0x100))/0x4)+-parseInt(_0x3c1e84(0x175))/0x5+parseInt(_0x3c1e84(0x144))/0x6+parseInt(_0x3c1e84(0x107))/0x7*(parseInt(_0x3c1e84(0x1da))/0x8)+parseInt(_0x3c1e84(0x199))/0x9+parseInt(_0x3c1e84(0x137))/0xa;if(_0x37d78c===_0x57bfa5)break;else _0x34f2f6['push'](_0x34f2f6['shift']());}catch(_0x4017cf){_0x34f2f6['push'](_0x34f2f6['shift']());}}}(a36_0x3765,0x47653));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../sdk/errors.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,yamlActivationToUpdateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x50afac,yamlToApi as a36_0x16c25f,toYamlString as a36_0x9eee8b,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a36_0x572dba from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a36_0x1f36c2 from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a36_0x34bb63 from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX=a36_0x22d99d(0x162);function createPendingSegmentId(_0xc5c63e){return''+PENDING_SEGMENT_PREFIX+_0xc5c63e+'__';}function isPendingSegmentId(_0x103207){const _0x4df96f=a36_0x22d99d;return _0x103207[_0x4df96f(0x16f)](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x541735){const _0x115258=a36_0x22d99d;return _0x541735[_0x115258(0x131)](/^__pending_(.+)__$/,'$1');}function a36_0x6dbb(_0x11cc66,_0x4a7acc){_0x11cc66=_0x11cc66-0xdf;const _0x376540=a36_0x3765();let _0x6dbb91=_0x376540[_0x11cc66];return _0x6dbb91;}function a36_0x3765(){const _0x369238=['setPhase','red','folderPath','Pushing\x20journeys...','then','flatMap','SEGMENT_UPDATE_ERROR','map','getActivation',')\x20with\x20journeyId:\x20','hasChanges','updated','resolveJourneyId','journey','stages','\x27\x20(internal:\x20','\x20\x20Journeys:\x20','all','\x20\x20Source:\x20','parent_segment','endsWith','parentFolderId','deleteSegment','\x20changed','rule','unchanged','buildNameToIdMap','Failed\x20to\x20','No\x20','journeyActivationStepId','269532GCvqMO','has','isNew','journey_entry_criteria_','yellow','kind','✔\x20Created\x20journey\x20\x27','filter','\x27\x20with\x20ID:\x20','dryRun','entries','existingSegment','INTERNAL','absolutePath','\x27\x20not\x20found\x20in\x20journey\x20\x27','delete','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20\x20🗺️\x20\x20Journeys:','find','\x20\x20Created\x20embedded\x20segment\x20\x27','ACTIVATION_UPDATE_ERROR','Creating\x20segment\x20\x27','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20folders\x20to\x20create','diff','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)','isDirectory','Site:\x20','\x27\x20from\x20file:\x20','.yml','\x20updated','Delete\x20segment:','segmentFolderId','journeyBundleName','join','\x20\x20✔\x20Updated\x20activation\x20\x27','config','buildIdToNameMap','\x20unchanged','activationActions','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','.yaml','resolveParentId','max','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','\x0a\x20\x20','\x20to\x20update','JOURNEY_UPDATE_ERROR','get','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Fetching\x20existing\x20folders...','action','add','listJourneysFromParentSegment','Parent\x20segment:\x20','\x20\x20Journey\x20API\x20request:\x20','journeys','\x27\x20v','getSegment','activations','\x20\x20Created\x20embedded\x20activation\x20\x27','execute','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','/app/ps/','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','16664AqnJcp','toString','Updating\x20segment\x20\x27','buildUserMaps','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','entry_criteria','push','\x20(referenced\x20in\x20journey\x20','Creating\x20folder\x20\x27','Entry\x20criteria:\x20','randomUUID','create','1599dyRhVC','\x0a✔\x20Push\x20complete','\x27:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','description','NOT_FOUND','Fetching\x20journey\x20\x27','keys','steps','\x20\x20✔\x20Created\x20activation\x20\x27','...','existingJourney','Push\x20','versionNumber','\x20journey\x20\x27','cyan','split','segment\x20or\x20journey','createFolder','\x20new','stringify','user','utf-8','created','4332eAyUSO','JOURNEY_SYNTAX_ERROR','getParent','\x20to\x20create','segmentId','size','state','217auUrLF','__pending_act_','SEGMENT_SYNTAX_ERROR','activationParams','toLowerCase','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Resolving\x20parent\x20segment\x20\x27','type','\x20\x20✔\x20Deleted\x20activation\x20\x27','green','Scoped\x20to\x20folder:\x20','configDir','createJourneySegment','yamlActivation','createSegment','Changes\x20to\x20journey:','✔\x20Updated\x20journey\x20\x27','Updating\x20activation\x20\x27','set','✔\x20Created\x20folder\x20\x27','\x20activations]','getJourney','Updating','dim','segment:push','resolve','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Deleting\x20segment\x20\x27','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','entry','folderId','blue','✔\x20Deleted\x20segment\x20\x27','journeyId','Activation\x20not\x20found:\x20','sort','Journey\x20\x27','length','\x20deleted','repeat','\x27...','Stage\x20\x27','replace','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','site','\x20segment\x20from\x20file:\x20','verbose','Delete\x20journey:','10263140SfsZEo','existingActivation',').\x20','New\x20segment:','Fetching\x20existing\x20journeys...','data','relationships','yes','/e/','Deleting\x20activation\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','DecisionPoint','\x20created','1470522ScihWO','\x20\x20Activations:','branches','\x20to\x20delete','ACTIVATION_SYNTAX_ERROR','entryCriteria','parentFolder','parentSegmentFolder','860578kUVjRR','listFolders','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','error','Changes\x20to:','\x20\x20📊\x20Segments:','attributes','\x20journey\x20from\x20file:\x20','1DpkZIg','connection','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20Activations:\x20','listActivations','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','cwd','values','yamlConfig','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','dirname','journeyStages','update','Segment\x20not\x20found:\x20','__pending_','relative','deleteActivation','\x27\x20details...','Activation','listSegments','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x20\x20\x20\x20','createActivation','parentSegment','\x20\x20Segments:\x20','segment','\x0aPush\x20summary\x20for\x20\x27','startsWith','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','slice','name','Fetching\x20parent\x20segment\x20details...','Aborted.','329795iJlQDO','journeysOnly','Error\x20parsing\x20','isFile','\x27\x20with\x20journeyId:\x20','Creating'];a36_0x3765=function(){return _0x369238;};return a36_0x3765();}const PENDING_ACTIVATION_PREFIX=a36_0x22d99d(0x108);function createPendingActivationId(_0x47ee45){return''+PENDING_ACTIVATION_PREFIX+_0x47ee45+'__';}function isPendingActivationId(_0x17a4bd){const _0x3e42f4=a36_0x22d99d;return _0x17a4bd[_0x3e42f4(0x16f)](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x466111){return _0x466111['replace'](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x327274){const _0x1b5a90=a36_0x22d99d;!_0x327274[_0x1b5a90(0xec)]&&(_0x327274['description']=''),!_0x327274[_0x1b5a90(0x106)]&&(_0x327274[_0x1b5a90(0x106)]='draft');}function tryFindTdxConfig(_0x213c0c){try{return findTdxConfig(_0x213c0c);}catch{return null;}}function resolveTDFolderPath(_0x4ec352,_0x460488,_0x5d41e5){if(!_0x460488)return _0x4ec352;return _0x4ec352?_0x5d41e5+'/'+_0x4ec352:_0x5d41e5;}export class SegmentPushCommand extends BaseCommand{[a36_0x22d99d(0x172)]=a36_0x22d99d(0x11f);[a36_0x22d99d(0xec)]=a36_0x22d99d(0x1af);async[a36_0x22d99d(0x1d6)](_0x51ef13){const _0x6547e4=a36_0x22d99d,{options:_0x4cebcb,args:_0x35ff6a,tdx:_0x474725}=_0x51ef13,_0x2fc5ee=_0x4cebcb,_0x480765=_0x4cebcb[_0x6547e4(0x16b)],_0x1e34d3=_0x35ff6a[0x0];let _0x335fe7,_0x3ad140,_0x51f055,_0x3fa3a4;if(_0x1e34d3){if(existsSync(_0x1e34d3)&&statSync(_0x1e34d3)[_0x6547e4(0x1b3)]()){const _0x10339b=tryFindTdxConfig(_0x1e34d3);if(_0x10339b)_0x335fe7=_0x10339b[_0x6547e4(0x1bd)][_0x6547e4(0x18e)],_0x3ad140=_0x1e34d3,_0x51f055=_0x10339b['configDir'];else return console[_0x6547e4(0x14f)](a36_0x572dba['red'](_0x6547e4(0x14e)+_0x1e34d3+'\x0a')),console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0xf7)](_0x6547e4(0xeb))),0x1;}else{if(existsSync(_0x1e34d3)&&statSync(_0x1e34d3)[_0x6547e4(0x178)]()){const _0x377c22=a36_0x1f36c2[_0x6547e4(0x15e)](_0x1e34d3),_0x9a9b84=tryFindTdxConfig(_0x377c22);if(_0x9a9b84)_0x335fe7=_0x9a9b84[_0x6547e4(0x1bd)]['parent_segment'],_0x51f055=_0x9a9b84['configDir'],_0x3ad140=_0x9a9b84[_0x6547e4(0x112)],_0x3fa3a4=a36_0x1f36c2[_0x6547e4(0x120)](_0x1e34d3);else return console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x17c)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x377c22+'\x0a')),console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0xf7)](_0x6547e4(0xeb))),0x1;}else _0x335fe7=_0x1e34d3;}}else{const _0x4c04f3=tryFindTdxConfig(process['cwd']());_0x4c04f3?(_0x335fe7=_0x4c04f3[_0x6547e4(0x1bd)][_0x6547e4(0x18e)],_0x3ad140=process[_0x6547e4(0x15a)](),_0x51f055=_0x4c04f3[_0x6547e4(0x112)]):_0x335fe7=_0x480765;}if(!_0x335fe7)return console['error'](a36_0x572dba['yellow'](_0x6547e4(0x1c1))),console[_0x6547e4(0x14f)](_0x6547e4(0x1b2)),console[_0x6547e4(0x14f)](_0x6547e4(0x156)),console[_0x6547e4(0x14f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file'),0x1;const _0x12beee=_0x3ad140||getSegmentRootDir(sanitizeFileName(_0x335fe7)),_0x26aff5=_0x51f055||_0x12beee,_0x2eff3c=a36_0x1f36c2[_0x6547e4(0x163)](_0x26aff5,_0x12beee),_0x23a0b6=_0x2eff3c!==''&&_0x2eff3c!=='.';if(!existsSync(_0x12beee))return console['error'](a36_0x572dba['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x12beee+'\x0a')),console[_0x6547e4(0x14f)](a36_0x572dba['cyan'](_0x6547e4(0xeb))),0x1;_0x2fc5ee[_0x6547e4(0x135)]&&(console['error'](_0x6547e4(0x1b4)+_0x2fc5ee[_0x6547e4(0x133)]),console[_0x6547e4(0x14f)](_0x6547e4(0x1cf)+_0x335fe7),console['error']('Source\x20directory:\x20'+_0x12beee),_0x23a0b6&&console['error'](_0x6547e4(0x111)+_0x2eff3c));const _0x13403d=await withSpinner(_0x6547e4(0x10d)+_0x335fe7+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x1c3)](_0x335fe7),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),_0x47019c=_0x13403d['data'],[_0x5cdcd6,_0x3c7f5b,_0xc3b205,_0x4b4e01,_0x134df6]=await Promise[_0x6547e4(0x18c)]([withSpinner(_0x6547e4(0x173),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x102)](_0x47019c),{'verbose':_0x2fc5ee['verbose']}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x474725['segment'][_0x6547e4(0x167)](_0x47019c),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),withSpinner(_0x6547e4(0x1cb),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x14d)](_0x47019c),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),withSpinner(_0x6547e4(0x13b),()=>_0x474725[_0x6547e4(0x188)][_0x6547e4(0x1ce)](_0x47019c),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x474725[_0x6547e4(0xfd)][_0x6547e4(0xdf)](),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]})[_0x6547e4(0x17f)](_0xb27053=>_0xb27053[_0x6547e4(0x13c)])]),_0x39dceb=_0x5cdcd6[_0x6547e4(0x13c)],_0x571556=_0x39dceb['relationships']?.[_0x6547e4(0x14b)]?.[_0x6547e4(0x13c)]?.['id']||_0x39dceb[_0x6547e4(0x13d)]?.[_0x6547e4(0x14a)]?.[_0x6547e4(0x13c)]?.['id'],_0x479e9a=_0x3c7f5b[_0x6547e4(0x13c)],_0x5747d5=_0xc3b205[_0x6547e4(0x13c)],_0x1d5441=_0x4b4e01[_0x6547e4(0x13c)],{emailToId:_0xbac001,idToEmail:_0x57ddbe}=_0x134df6,[_0x3f6048,_0x4d220e]=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0xf255ea=_0x6547e4,[_0x375be3,_0x19bbe6]=await Promise['all']([_0x474725[_0xf255ea(0x155)][_0xf255ea(0x195)](),_0x474725[_0xf255ea(0x155)][_0xf255ea(0x1be)]()]);return[_0x375be3,_0x19bbe6];},{'verbose':_0x2fc5ee['verbose']})['then'](_0xe6b395=>_0xe6b395[_0x6547e4(0x13c)]),_0x2a65df=buildFolderPathToIdMap(_0x5747d5),_0x1447b7=new Map();for(const [_0x15f0b5,_0x3facd0]of _0x2a65df[_0x6547e4(0x1a3)]()){_0x1447b7[_0x6547e4(0x119)](_0x3facd0,_0x15f0b5);}const _0x31e355=new Map();for(const _0x1390a8 of _0x479e9a){const _0x30aa9b=_0x1390a8[_0x6547e4(0x1b9)]?_0x1447b7[_0x6547e4(0x1c9)](_0x1390a8[_0x6547e4(0x1b9)][_0x6547e4(0x1db)]())||'':'',_0x99f1f7=_0x30aa9b+':'+_0x1390a8[_0x6547e4(0x172)];_0x31e355[_0x6547e4(0x119)](_0x99f1f7,_0x1390a8);}const _0x14d80c=new Map();for(const _0x4b907e of _0x479e9a){_0x14d80c['set'](_0x4b907e['name'],_0x4b907e['id']);}const _0x2369c0=new Map();for(const _0x1ff661 of _0x1d5441){const _0x449d35=_0x1ff661['folderId']?_0x1447b7[_0x6547e4(0x1c9)](_0x1ff661[_0x6547e4(0x125)])||'':'',_0x2bf117=_0x449d35+':'+_0x1ff661[_0x6547e4(0x1ba)];!_0x2369c0['has'](_0x2bf117)&&_0x2369c0['set'](_0x2bf117,[]),_0x2369c0['get'](_0x2bf117)[_0x6547e4(0xe2)](_0x1ff661);}for(const _0x106eb6 of _0x2369c0[_0x6547e4(0x15b)]()){_0x106eb6[_0x6547e4(0x12a)]((_0x54ab41,_0x45967f)=>(_0x54ab41[_0x6547e4(0xf5)]||0x0)-(_0x45967f['versionNumber']||0x0));}let _0x34a5e7;if(_0x3fa3a4){if(!_0x3fa3a4[_0x6547e4(0x18f)]('.yml')&&!_0x3fa3a4[_0x6547e4(0x18f)](_0x6547e4(0x1c2)))return console['error'](a36_0x572dba[_0x6547e4(0x17c)](_0x6547e4(0x141)+_0x3fa3a4+'\x0a')),0x1;_0x34a5e7=[_0x3fa3a4];}else _0x34a5e7=findYamlFiles(_0x12beee);if(_0x34a5e7['length']===0x0)return console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x17c)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x12beee+'\x0a')),console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0xf7)](_0x6547e4(0x1d7))),0x1;const _0xe2cf23=[],_0x3007de=[];for(const _0x1d703c of _0x34a5e7){const _0x5a1601=a36_0x1f36c2[_0x6547e4(0x163)](_0x12beee,a36_0x1f36c2[_0x6547e4(0x15e)](_0x1d703c)),_0x4fac6e=_0x5a1601==='.'?'':_0x5a1601,_0x1ce5ef=readFileSync(_0x1d703c,_0x6547e4(0xfe));try{const _0x39b328=a36_0x34bb63['parse'](_0x1ce5ef);if(isJourneyYaml(_0x39b328)){const _0x1b4746=a36_0x50afac(_0x1ce5ef);_0x3007de[_0x6547e4(0xe2)]({'yamlConfig':_0x1b4746,'folderPath':_0x4fac6e,'sourcePath':_0x1d703c});}else{if(!_0x2fc5ee[_0x6547e4(0x176)]){const _0x5ed6c2=parseSegmentYamlFile(_0x1ce5ef),_0x3e05fe=normalizeChildSegmentYaml(_0x5ed6c2);_0xe2cf23[_0x6547e4(0xe2)]({'yamlConfig':_0x3e05fe,'folderPath':_0x4fac6e,'sourcePath':_0x1d703c});}}}catch(_0x44e088){return console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x17c)](_0x6547e4(0x177)+_0x1d703c+':\x20'+(_0x44e088 instanceof Error?_0x44e088['message']:_0x44e088))),0x1;}}if(_0xe2cf23[_0x6547e4(0x12c)]===0x0&&_0x3007de[_0x6547e4(0x12c)]===0x0){const _0x58e753=_0x2fc5ee['journeysOnly']?_0x6547e4(0x188):_0x6547e4(0xf9);return console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x19d)](_0x6547e4(0x197)+_0x58e753+'\x20YAML\x20files\x20found')),0x0;}const _0x36b052=new Map();_0x479e9a[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x176)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x479e9a,async _0x46f89b=>{const _0x9aec13=a36_0x6dbb,_0x2c5189=await _0x474725['segment'][_0x9aec13(0x158)](_0x47019c,_0x46f89b['id']);_0x36b052[_0x9aec13(0x119)](_0x46f89b['id'],_0x2c5189);});},{'verbose':_0x2fc5ee[_0x6547e4(0x135)]});const _0x3db5f1=[],_0x57b92b=new Set();for(const {yamlConfig:_0x18df9f,folderPath:_0x5b70d8,sourcePath:_0xeea04d}of _0xe2cf23){const _0x460b2d=resolveTDFolderPath(_0x5b70d8,_0x23a0b6,_0x2eff3c),_0x59e967=_0x460b2d+':'+_0x18df9f['name'],_0x26e213=_0x31e355[_0x6547e4(0x1c9)](_0x59e967),_0x16007a=_0x26e213?_0x36b052[_0x6547e4(0x1c9)](_0x26e213['id'])||[]:[];if(_0x460b2d&&!_0x2a65df[_0x6547e4(0x19a)](_0x460b2d)){const _0x999d=_0x460b2d[_0x6547e4(0xf8)]('/');let _0x21431f='';for(const _0x252a42 of _0x999d){_0x21431f=_0x21431f?_0x21431f+'/'+_0x252a42:_0x252a42,!_0x2a65df['has'](_0x21431f)&&_0x57b92b[_0x6547e4(0x1cd)](_0x21431f);}}const _0x7faad4=calculateActivationActions(_0x18df9f[_0x6547e4(0x1d4)]||[],_0x16007a,_0x57ddbe,_0x4d220e),_0x59b215=segmentToYamlString(_0x18df9f);let _0x41edfc,_0x3f2995=![],_0x5cb653;if(_0x26e213){const _0x23fad7=segmentWithActivationsToYaml(_0x26e213,_0x16007a,undefined,_0x57ddbe,_0x4d220e),_0x584cfa=segmentToYamlString(_0x23fad7);_0x41edfc=generateDiff(_0x584cfa,_0x59b215),_0x3f2995=hasChanges(_0x41edfc),_0x3f2995&&(_0x5cb653=formatDiffWithColors(_0x41edfc));}else _0x41edfc=generateDiff('',_0x59b215),_0x5cb653=formatDiffWithColors(_0x41edfc);_0x3db5f1[_0x6547e4(0xe2)]({'relativePath':_0x18df9f['name'],'absolutePath':_0xeea04d,'yamlConfig':_0x18df9f,'folderPath':_0x460b2d,'existingSegment':_0x26e213,'existingActivations':_0x16007a,'isNew':!_0x26e213,'hasChanges':_0x3f2995,'diff':_0x5cb653,'activationActions':_0x7faad4});}let _0x3f5146=[];if(!_0x3fa3a4){const _0x436bba=new Set();for(const {yamlConfig:_0x346fe3,folderPath:_0x4d12cb}of _0xe2cf23){const _0x510551=resolveTDFolderPath(_0x4d12cb,_0x23a0b6,_0x2eff3c);_0x436bba['add'](_0x510551+':'+_0x346fe3['name']);}_0x3f5146=_0x479e9a['filter'](_0x329a79=>{const _0x3df210=_0x6547e4,_0xa52f1d=_0x329a79[_0x3df210(0x1b9)]?_0x1447b7['get'](_0x329a79[_0x3df210(0x1b9)][_0x3df210(0x1db)]())||'':'',_0x1e2828=_0xa52f1d+':'+_0x329a79[_0x3df210(0x172)];if(_0x436bba['has'](_0x1e2828))return![];if(_0x23a0b6)return _0xa52f1d===_0x2eff3c||_0xa52f1d[_0x3df210(0x16f)](_0x2eff3c+'/');return!![];});}const _0x616dc1=[];for(const {yamlConfig:_0x11b025,folderPath:_0x4e2100,sourcePath:_0x2a8910}of _0x3007de){const _0x24151a=resolveTDFolderPath(_0x4e2100,_0x23a0b6,_0x2eff3c),_0x256564=_0x24151a+':'+_0x11b025[_0x6547e4(0x172)],_0x4f2305=_0x2369c0[_0x6547e4(0x1c9)](_0x256564);let _0x341064,_0xebc707;if(_0x4f2305&&_0x4f2305[_0x6547e4(0x12c)]>0x0){const _0x22188e=new Set(),_0x29a61f=new Set(),_0xf1a6b3=new Map(),_0x499290=new Map(),_0x4ca24e=createJumpTargetCache(),_0x156b74=_0x52e7f2=>({'resolveSegment':async _0x1fec4f=>{const _0x3db1de=_0x6547e4,_0x4137f8=_0x499290[_0x3db1de(0x1c9)](_0x1fec4f);if(_0x4137f8!==undefined)return{'name':_0x4137f8,'isJourneyLocal':!![]};try{let _0x276575=_0x479e9a[_0x3db1de(0x1ab)](_0x57d79e=>_0x57d79e['id']===_0x1fec4f);!_0x276575&&(_0x276575=await _0x474725[_0x3db1de(0x16d)][_0x3db1de(0x1d3)](_0x47019c,_0x1fec4f));const _0x426e0e=generateJourneyLocalName(_0x276575[_0x3db1de(0x172)]),_0x383d96=_0x276575[_0x3db1de(0x19e)]===SEGMENT_KIND_JOURNEY&&_0x426e0e!==undefined;let _0x56c9c8=_0x276575['name'];if(_0x383d96&&_0x426e0e){let _0x19c12f=_0x426e0e,_0x2fb323=0x2;while(_0x22188e[_0x3db1de(0x19a)](_0x19c12f)){_0x19c12f=_0x426e0e+'_'+_0x2fb323,_0x2fb323++;}_0x22188e[_0x3db1de(0x1cd)](_0x19c12f),_0x56c9c8=_0x19c12f,_0x499290['set'](_0x1fec4f,_0x56c9c8);}let _0x1a7425;return _0x383d96&&_0x276575['rule']&&(_0x1a7425={'description':_0x276575[_0x3db1de(0xec)],'rule':apiRuleToYaml(_0x276575[_0x3db1de(0x193)])}),{'name':_0x56c9c8,'isJourneyLocal':_0x383d96,'definition':_0x1a7425};}catch{return{'name':_0x1fec4f,'isJourneyLocal':![]};}},'resolveActivation':async _0x106c87=>{const _0x443079=_0x6547e4,_0x5099bc=_0xf1a6b3['get'](_0x106c87);if(_0x5099bc!==undefined)return{'name':_0x5099bc,'isJourneyLocal':!![]};try{const _0x232c72=await _0x474725['journey'][_0x443079(0x183)](_0x52e7f2,_0x106c87),_0x18df1e=_0x232c72[_0x443079(0x152)][_0x443079(0x10a)][_0x443079(0x172)]||_0x106c87,_0x3d3867=sanitizeYamlKey(_0x18df1e)||'activation_'+_0x106c87;let _0x528d01=_0x3d3867,_0x55383a=0x2;while(_0x29a61f[_0x443079(0x19a)](_0x528d01)){_0x528d01=_0x3d3867+'_'+_0x55383a,_0x55383a++;}_0x29a61f[_0x443079(0x1cd)](_0x528d01),_0xf1a6b3[_0x443079(0x119)](_0x106c87,_0x528d01);const _0xdcb26f=journeyActivationStepToYaml(_0x232c72,_0x57ddbe,_0x4d220e);return{'name':_0x528d01,'isJourneyLocal':!![],'definition':_0xdcb26f};}catch{return{'name':_0x106c87,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xc33057,_0x1005b9)=>resolveJumpTarget(_0xc33057,_0x1005b9,_0x4ca24e,_0x4c4e67=>_0x474725[_0x6547e4(0x188)][_0x6547e4(0x11c)](_0x4c4e67))}),_0x3806bc=hasMultipleVersions(_0x11b025);if(_0x3806bc&&_0x4f2305[_0x6547e4(0x12c)]>0x1){const _0x2c8969=[];for(const _0x1b01a0 of _0x4f2305){const _0x429515=await withSpinner(_0x6547e4(0xee)+_0x11b025[_0x6547e4(0x172)]+_0x6547e4(0x1d2)+(_0x1b01a0['versionNumber']||0x1)+_0x6547e4(0xf2),()=>_0x474725[_0x6547e4(0x188)]['getJourney'](_0x1b01a0['id']),{'verbose':_0x2fc5ee['verbose']}),_0x48010e=_0x156b74(_0x1b01a0['id']),_0x45ac4c=await apiToYamlAsync(_0x429515[_0x6547e4(0x13c)],_0x48010e);_0x2c8969['push']({'item':_0x1b01a0,'yaml':_0x45ac4c});}_0xebc707=buildMergedJourneyYaml(_0x2c8969);const _0x55f5e4=Math[_0x6547e4(0x1c4)](..._0x2c8969[_0x6547e4(0x182)](_0x2ffc5=>_0x2ffc5['item'][_0x6547e4(0xf5)]||0x0)),_0x3ffa21=_0x4f2305[_0x6547e4(0x1ab)](_0x70b469=>(_0x70b469[_0x6547e4(0xf5)]||0x0)===_0x55f5e4);_0x3ffa21&&(_0x341064=await _0x474725[_0x6547e4(0x188)][_0x6547e4(0x11c)](_0x3ffa21['id']));}else{const _0xb839ac=_0x4f2305[_0x4f2305[_0x6547e4(0x12c)]-0x1],_0x330b25=await withSpinner(_0x6547e4(0xee)+_0x11b025[_0x6547e4(0x172)]+_0x6547e4(0x165),()=>_0x474725[_0x6547e4(0x188)][_0x6547e4(0x11c)](_0xb839ac['id']),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]});_0x341064=_0x330b25[_0x6547e4(0x13c)];const _0x238d59=_0x156b74(_0xb839ac['id']);_0xebc707=await apiToYamlAsync(_0x341064,_0x238d59);}}if(_0x24151a&&!_0x2a65df[_0x6547e4(0x19a)](_0x24151a)){const _0x4bb5ac=_0x24151a[_0x6547e4(0xf8)]('/');let _0x5aac31='';for(const _0x278f79 of _0x4bb5ac){_0x5aac31=_0x5aac31?_0x5aac31+'/'+_0x278f79:_0x278f79,!_0x2a65df['has'](_0x5aac31)&&_0x57b92b['add'](_0x5aac31);}}const _0x586c91=normalizeJourneyYaml(_0x11b025),_0x533114=a36_0x9eee8b(_0x586c91);let _0x53558a=![],_0x485ee2;if(_0xebc707){const _0x297760=normalizeJourneyYaml(_0xebc707),_0x278011=a36_0x9eee8b(_0x297760),_0x6165f0=generateDiff(_0x278011,_0x533114);_0x53558a=hasChanges(_0x6165f0),_0x53558a&&(_0x485ee2=formatDiffWithColors(_0x6165f0));}else{const _0x5a3c4f=generateDiff('',_0x533114);_0x485ee2=formatDiffWithColors(_0x5a3c4f);}_0x616dc1[_0x6547e4(0xe2)]({'relativePath':_0x11b025[_0x6547e4(0x172)],'absolutePath':_0x2a8910,'yamlConfig':_0x11b025,'folderPath':_0x24151a,'existingJourney':_0x341064,'isNew':!_0x341064,'hasChanges':_0x53558a,'diff':_0x485ee2});}let _0x34b20a=[];if(!_0x3fa3a4){const _0x3f6071=new Set();for(const {yamlConfig:_0x281cc2,folderPath:_0x210ceb}of _0x3007de){const _0x4374dd=resolveTDFolderPath(_0x210ceb,_0x23a0b6,_0x2eff3c);_0x3f6071[_0x6547e4(0x1cd)](_0x4374dd+':'+_0x281cc2[_0x6547e4(0x172)]);}_0x34b20a=_0x1d5441[_0x6547e4(0x1a0)](_0x4c4496=>{const _0x1694b4=_0x6547e4,_0x447931=_0x4c4496[_0x1694b4(0x125)]?_0x1447b7[_0x1694b4(0x1c9)](_0x4c4496[_0x1694b4(0x125)])||'':'',_0xb0d8f3=_0x447931+':'+_0x4c4496[_0x1694b4(0x1ba)];if(_0x3f6071[_0x1694b4(0x19a)](_0xb0d8f3))return![];if(_0x23a0b6)return _0x447931===_0x2eff3c||_0x447931['startsWith'](_0x2eff3c+'/');return!![];});}const _0x134bae=_0x3db5f1[_0x6547e4(0x1a0)](_0x502047=>_0x502047['isNew']),_0x232e6d=_0x3db5f1[_0x6547e4(0x1a0)](_0x502ac8=>!_0x502ac8[_0x6547e4(0x19b)]&&_0x502ac8[_0x6547e4(0x185)]),_0x2581ea=_0x3db5f1[_0x6547e4(0x1a0)](_0x389720=>!_0x389720['isNew']&&!_0x389720[_0x6547e4(0x185)]),_0x29a9dc=Array['from'](_0x57b92b)[_0x6547e4(0x12a)](),_0x52e9fa=_0x2fc5ee[_0x6547e4(0x1a8)]?_0x3f5146:[],_0x596d13=_0x2fc5ee[_0x6547e4(0x1a8)]?_0x34b20a:[],_0x9af884=_0x3db5f1[_0x6547e4(0x180)](_0x4f9b4c=>_0x4f9b4c[_0x6547e4(0x1c0)]),_0x294beb=_0x9af884['filter'](_0x1e2dac=>_0x1e2dac[_0x6547e4(0x10e)]===_0x6547e4(0xe7)),_0x52c504=_0x9af884[_0x6547e4(0x1a0)](_0x5316f7=>_0x5316f7['type']===_0x6547e4(0x160)),_0x1c8bb1=_0x9af884[_0x6547e4(0x1a0)](_0x17c5b3=>_0x17c5b3[_0x6547e4(0x10e)]==='delete'),_0x12a91c=_0x616dc1[_0x6547e4(0x1a0)](_0x2e3e54=>_0x2e3e54[_0x6547e4(0x19b)]),_0x576ac7=_0x616dc1[_0x6547e4(0x1a0)](_0x10286b=>!_0x10286b['isNew']&&_0x10286b['hasChanges']),_0x5d3dcc=_0x616dc1[_0x6547e4(0x1a0)](_0x184e72=>!_0x184e72[_0x6547e4(0x19b)]&&!_0x184e72[_0x6547e4(0x185)]);console[_0x6547e4(0x14f)](_0x6547e4(0x16e)+_0x335fe7+'\x27:');_0x29a9dc[_0x6547e4(0x12c)]>0x0&&console[_0x6547e4(0x14f)]('\x20\x20'+a36_0x572dba[_0x6547e4(0x126)]('📁\x20'+_0x29a9dc[_0x6547e4(0x12c)]+_0x6547e4(0x1b0)));if(!_0x2fc5ee[_0x6547e4(0x176)]){console[_0x6547e4(0x14f)](_0x6547e4(0x151)),console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x110)]('+\x20'+_0x134bae[_0x6547e4(0x12c)]+_0x6547e4(0xfb))),console['error'](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x19d)]('~\x20'+_0x232e6d[_0x6547e4(0x12c)]+_0x6547e4(0x192)));if(_0x52e9fa['length']>0x0)console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x17c)]('-\x20'+_0x52e9fa[_0x6547e4(0x12c)]+_0x6547e4(0x147)));else _0x3f5146[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x1a8)]&&console[_0x6547e4(0x14f)]('\x20\x20\x20\x20'+a36_0x572dba[_0x6547e4(0x11e)](_0x3f5146[_0x6547e4(0x12c)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x6547e4(0x14f)]('\x20\x20\x20\x20'+a36_0x572dba[_0x6547e4(0x11e)]('=\x20'+_0x2581ea[_0x6547e4(0x12c)]+_0x6547e4(0x1bf)));}if(_0x616dc1[_0x6547e4(0x12c)]>0x0||_0x34b20a[_0x6547e4(0x12c)]>0x0){console['error'](_0x6547e4(0x1aa)),console[_0x6547e4(0x14f)]('\x20\x20\x20\x20'+a36_0x572dba[_0x6547e4(0x110)]('+\x20'+_0x12a91c[_0x6547e4(0x12c)]+_0x6547e4(0xfb))),console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x19d)]('~\x20'+_0x576ac7[_0x6547e4(0x12c)]+'\x20changed'));if(_0x596d13[_0x6547e4(0x12c)]>0x0)console['error'](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x17c)]('-\x20'+_0x596d13[_0x6547e4(0x12c)]+_0x6547e4(0x147)));else _0x34b20a[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x1a8)]&&console[_0x6547e4(0x14f)]('\x20\x20\x20\x20'+a36_0x572dba['dim'](_0x34b20a['length']+_0x6547e4(0x10c)));console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x11e)]('=\x20'+_0x5d3dcc['length']+_0x6547e4(0x1bf)));}_0x9af884[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee['journeysOnly']&&(console[_0x6547e4(0x14f)](''),console[_0x6547e4(0x14f)](_0x6547e4(0x145)),_0x294beb['length']>0x0&&console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x110)]('+\x20'+_0x294beb['length']+_0x6547e4(0x103))),_0x52c504[_0x6547e4(0x12c)]>0x0&&console['error'](_0x6547e4(0x169)+a36_0x572dba['yellow']('~\x20'+_0x52c504[_0x6547e4(0x12c)]+_0x6547e4(0x1c7))),_0x1c8bb1[_0x6547e4(0x12c)]>0x0&&console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba['red']('-\x20'+_0x1c8bb1[_0x6547e4(0x12c)]+'\x20to\x20delete')));console[_0x6547e4(0x14f)](_0x6547e4(0x18d)+a36_0x572dba[_0x6547e4(0xf7)](_0x12beee)+'\x0a');if(_0x29a9dc['length']>0x0){console[_0x6547e4(0x14f)]('Folders\x20to\x20create:');for(const _0x44c6a7 of _0x29a9dc){console[_0x6547e4(0x14f)]('\x20\x20'+a36_0x572dba['blue']('+')+'\x20'+_0x44c6a7);}console[_0x6547e4(0x14f)]('');}if(_0x134bae['length']>0x0&&!_0x2fc5ee['journeysOnly'])for(const _0x4f0aa0 of _0x134bae){const _0xc24baf=_0x4f0aa0['folderPath']?_0x4f0aa0[_0x6547e4(0x17d)]+'/'+_0x4f0aa0['yamlConfig'][_0x6547e4(0x172)]:_0x4f0aa0[_0x6547e4(0x15c)]['name'],_0x747426=_0x4f0aa0[_0x6547e4(0x15c)][_0x6547e4(0x1d4)]?.[_0x6547e4(0x12c)]||0x0,_0x519186=_0x747426>0x0?a36_0x572dba[_0x6547e4(0x11e)]('\x20['+_0x747426+_0x6547e4(0x11b)):'';console[_0x6547e4(0x14f)]('\x0a'+a36_0x572dba[_0x6547e4(0x110)](_0x6547e4(0x13a))+'\x20'+_0xc24baf+_0x519186),console[_0x6547e4(0x14f)]('─'['repeat'](0x3c)),_0x4f0aa0[_0x6547e4(0x1b1)]&&console[_0x6547e4(0x14f)](_0x4f0aa0[_0x6547e4(0x1b1)]),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c));}if(_0x52e9fa[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x176)])for(const _0x3fb874 of _0x52e9fa){const _0x5f2c58=_0x3fb874[_0x6547e4(0x1b9)]?_0x1447b7['get'](_0x3fb874[_0x6547e4(0x1b9)][_0x6547e4(0x1db)]())||'':'',_0x32656d=_0x5f2c58?_0x5f2c58+'/'+_0x3fb874[_0x6547e4(0x172)]:_0x3fb874[_0x6547e4(0x172)],_0x310d79=_0x36b052[_0x6547e4(0x1c9)](_0x3fb874['id'])||[],_0x22d1b1=_0x310d79['length']>0x0?a36_0x572dba[_0x6547e4(0x11e)]('\x20['+_0x310d79[_0x6547e4(0x12c)]+_0x6547e4(0x11b)):'';console[_0x6547e4(0x14f)]('\x0a'+a36_0x572dba[_0x6547e4(0x17c)](_0x6547e4(0x1b8))+'\x20'+_0x32656d+_0x22d1b1),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c));const _0x2624f0=segmentWithActivationsToYaml(_0x3fb874,_0x310d79,undefined,_0x57ddbe,_0x4d220e),_0x145913=segmentToYamlString(_0x2624f0),_0x34f3ee=generateDiff(_0x145913,'');console[_0x6547e4(0x14f)](formatDiffWithColors(_0x34f3ee)),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c));}const _0x25ee43=_0x3db5f1[_0x6547e4(0x1a0)](_0x54259d=>!_0x54259d['isNew']&&_0x54259d['diff']);if(_0x25ee43[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x176)])for(const _0x4088f2 of _0x25ee43){const _0xd95f8=_0x4088f2[_0x6547e4(0x17d)]?_0x4088f2['folderPath']+'/'+_0x4088f2[_0x6547e4(0x15c)]['name']:_0x4088f2[_0x6547e4(0x15c)][_0x6547e4(0x172)];console['error']('\x0a'+a36_0x572dba[_0x6547e4(0x19d)](_0x6547e4(0x150))+'\x20'+_0xd95f8),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c)),console[_0x6547e4(0x14f)](_0x4088f2[_0x6547e4(0x1b1)]),console[_0x6547e4(0x14f)]('─'['repeat'](0x3c));}if(_0x12a91c[_0x6547e4(0x12c)]>0x0)for(const _0x115a4f of _0x12a91c){const _0x395687=_0x115a4f[_0x6547e4(0x17d)]?_0x115a4f[_0x6547e4(0x17d)]+'/'+_0x115a4f['yamlConfig'][_0x6547e4(0x172)]:_0x115a4f[_0x6547e4(0x15c)][_0x6547e4(0x172)];console['error']('\x0a'+a36_0x572dba[_0x6547e4(0x110)]('New\x20journey:')+'\x20'+_0x395687),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c)),_0x115a4f[_0x6547e4(0x1b1)]&&console[_0x6547e4(0x14f)](_0x115a4f[_0x6547e4(0x1b1)]),console[_0x6547e4(0x14f)]('─'['repeat'](0x3c));}const _0x429e0c=_0x616dc1['filter'](_0x46b498=>!_0x46b498[_0x6547e4(0x19b)]&&_0x46b498[_0x6547e4(0x1b1)]);if(_0x429e0c[_0x6547e4(0x12c)]>0x0)for(const _0xf8f547 of _0x429e0c){const _0x377121=_0xf8f547[_0x6547e4(0x17d)]?_0xf8f547[_0x6547e4(0x17d)]+'/'+_0xf8f547['yamlConfig'][_0x6547e4(0x172)]:_0xf8f547[_0x6547e4(0x15c)][_0x6547e4(0x172)];console[_0x6547e4(0x14f)]('\x0a'+a36_0x572dba[_0x6547e4(0x19d)](_0x6547e4(0x116))+'\x20'+_0x377121),console['error']('─'[_0x6547e4(0x12e)](0x3c)),console['error'](_0xf8f547[_0x6547e4(0x1b1)]),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c));}if(_0x596d13[_0x6547e4(0x12c)]>0x0)for(const _0x214b99 of _0x596d13){const _0x2548df=_0x214b99[_0x6547e4(0x125)]?_0x1447b7['get'](_0x214b99[_0x6547e4(0x125)])||'':'',_0xa83225=_0x2548df?_0x2548df+'/'+_0x214b99['journeyBundleName']:_0x214b99[_0x6547e4(0x1ba)];console[_0x6547e4(0x14f)]('\x0a'+a36_0x572dba[_0x6547e4(0x17c)](_0x6547e4(0x136))+'\x20'+_0xa83225),console['error']('─'[_0x6547e4(0x12e)](0x3c)),console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x17c)]('(Journey\x20will\x20be\x20deleted)')),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c));}if(_0x2fc5ee[_0x6547e4(0x1a2)])return console[_0x6547e4(0x14f)](a36_0x572dba['yellow'](_0x6547e4(0x1ca))),0x0;const _0x16b3cd=_0x2fc5ee[_0x6547e4(0x176)]?![]:_0x134bae[_0x6547e4(0x12c)]>0x0||_0x232e6d[_0x6547e4(0x12c)]>0x0||_0x52e9fa[_0x6547e4(0x12c)]>0x0,_0x57962d=_0x12a91c[_0x6547e4(0x12c)]>0x0||_0x576ac7['length']>0x0||_0x596d13[_0x6547e4(0x12c)]>0x0,_0x119526=_0x2fc5ee[_0x6547e4(0x176)]?![]:_0x9af884[_0x6547e4(0x12c)]>0x0,_0x545919=_0x29a9dc['length']>0x0;if(!_0x16b3cd&&!_0x57962d&&!_0x119526&&!_0x545919){const _0x5f22ce=_0x2fc5ee[_0x6547e4(0x176)]?_0x6547e4(0x121):_0x6547e4(0x170);console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x110)](_0x5f22ce));if(_0x3fa3a4&&_0x5d3dcc[_0x6547e4(0x12c)]===0x1){const _0x1acc21=_0x5d3dcc[0x0];if(_0x1acc21['existingJourney']?.['id']){const _0x91f15f=getConsoleNextUrl(_0x2fc5ee[_0x6547e4(0x133)],'/app/ps/'+_0x47019c+'/e/'+_0x1acc21[_0x6547e4(0xf3)]['id']+'/j/da/je');console[_0x6547e4(0x14f)]('\x20\x20'+a36_0x572dba[_0x6547e4(0xf7)](_0x91f15f));}}return 0x0;}const _0x9842e4=_0x2fc5ee['journeysOnly']?_0x12a91c['length']+_0x576ac7[_0x6547e4(0x12c)]+_0x596d13[_0x6547e4(0x12c)]+_0x29a9dc[_0x6547e4(0x12c)]:_0x134bae[_0x6547e4(0x12c)]+_0x232e6d[_0x6547e4(0x12c)]+_0x52e9fa[_0x6547e4(0x12c)]+_0x12a91c[_0x6547e4(0x12c)]+_0x576ac7[_0x6547e4(0x12c)]+_0x596d13['length']+_0x29a9dc[_0x6547e4(0x12c)]+_0x9af884[_0x6547e4(0x12c)];if(!_0x2fc5ee[_0x6547e4(0x13e)]&&_0x9842e4>0x0){const _0x41128f=await confirmKey(_0x6547e4(0xf4)+_0x9842e4+'\x20changes?');if(!_0x41128f)return console[_0x6547e4(0x14f)](_0x6547e4(0x174)),0x1;}for(const _0x472841 of _0x29a9dc){const _0x1c729d=_0x472841[_0x6547e4(0xf8)]('/'),_0x59c2d8=_0x1c729d[_0x1c729d[_0x6547e4(0x12c)]-0x1],_0x34db01=_0x1c729d[_0x6547e4(0x171)](0x0,-0x1)[_0x6547e4(0x1bb)]('/'),_0x5c83f4=_0x2a65df[_0x6547e4(0x1c9)](_0x34db01),_0x2c9581={'name':_0x59c2d8,'parentFolderId':_0x5c83f4},_0x29a4ff=await withSpinner(_0x6547e4(0xe4)+_0x472841+_0x6547e4(0x12f),()=>_0x474725['segment'][_0x6547e4(0xfa)](_0x47019c,_0x2c9581),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]});_0x2a65df[_0x6547e4(0x119)](_0x472841,_0x29a4ff['data']['id']),console['error'](a36_0x572dba[_0x6547e4(0x126)](_0x6547e4(0x11a)+_0x472841+'\x27'));}let _0x3e27cc=0x0,_0x3f9c86=0x0,_0x4fd6cc=0x0,_0x1651ec=0x0,_0x50e902=0x0,_0x467573=0x0;const _0x1a6bef=new Map();for(const _0x3b3eb8 of _0x2fc5ee['journeysOnly']?[]:_0x3db5f1){const _0x52139c=_0x3b3eb8[_0x6547e4(0x17d)]?_0x2a65df[_0x6547e4(0x1c9)](_0x3b3eb8[_0x6547e4(0x17d)]):undefined;let _0x31fc68;try{if(_0x3b3eb8[_0x6547e4(0x19b)]){const _0x6396fc=yamlToCreateRequest(_0x3b3eb8[_0x6547e4(0x15c)],_0x52139c),_0x4f0543=await withSpinner(_0x6547e4(0x1ae)+_0x3b3eb8['yamlConfig'][_0x6547e4(0x172)]+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x115)](_0x47019c,_0x6396fc),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]});_0x31fc68=_0x4f0543[_0x6547e4(0x13c)]['id'],_0x1a6bef[_0x6547e4(0x119)](_0x3b3eb8[_0x6547e4(0x15c)][_0x6547e4(0x172)],_0x31fc68),console['error'](a36_0x572dba[_0x6547e4(0x110)]('✔\x20Created\x20segment\x20\x27'+_0x3b3eb8['yamlConfig'][_0x6547e4(0x172)]+'\x27')),_0x3e27cc++;}else{if(_0x3b3eb8['hasChanges']){const _0x275187=yamlToUpdateRequest(_0x3b3eb8[_0x6547e4(0x15c)]);_0x52139c!==_0x3b3eb8[_0x6547e4(0x1a4)]?.[_0x6547e4(0x1b9)]&&(_0x275187[_0x6547e4(0x1b9)]=_0x52139c?parseInt(_0x52139c,0xa):undefined),await withSpinner(_0x6547e4(0x1dc)+_0x3b3eb8[_0x6547e4(0x15c)][_0x6547e4(0x172)]+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)]['updateSegmentById'](_0x47019c,_0x3b3eb8[_0x6547e4(0x1a4)]['id'],_0x275187),{'verbose':_0x2fc5ee['verbose']}),_0x31fc68=_0x3b3eb8[_0x6547e4(0x1a4)]['id'],console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x19d)]('✔\x20Updated\x20segment\x20\x27'+_0x3b3eb8['yamlConfig']['name']+'\x27')),_0x3f9c86++;}else _0x31fc68=_0x3b3eb8['existingSegment']['id'];}}catch(_0x913c49){const _0x23705e=isHttp400Error(_0x913c49),_0x5811b9=_0x23705e?ErrorCode[_0x6547e4(0x109)]:ErrorCode[_0x6547e4(0x181)],_0x29ec9d=getErrorMessage(_0x913c49);throw new SDKError(_0x5811b9,_0x6547e4(0x196)+(_0x3b3eb8['isNew']?'create':_0x6547e4(0x160))+_0x6547e4(0x134)+_0x3b3eb8[_0x6547e4(0x1a6)]+_0x6547e4(0x1c6)+_0x29ec9d,_0x913c49);}for(const _0x25b5f5 of _0x3b3eb8[_0x6547e4(0x1c0)]){try{if(_0x25b5f5['type']==='create'&&_0x25b5f5[_0x6547e4(0x114)]){const _0x4dcf1b=yamlActivationToCreateRequest(_0x25b5f5['yamlActivation'],_0xbac001,_0x3f6048);await withSpinner('Creating\x20activation\x20\x27'+_0x25b5f5[_0x6547e4(0x172)]+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x16a)](_0x47019c,_0x31fc68,_0x4dcf1b),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),console['error'](a36_0x572dba[_0x6547e4(0x110)](_0x6547e4(0xf1)+_0x25b5f5[_0x6547e4(0x172)]+'\x27')),_0x1651ec++;}else{if(_0x25b5f5[_0x6547e4(0x10e)]===_0x6547e4(0x160)&&_0x25b5f5[_0x6547e4(0x114)]&&_0x25b5f5[_0x6547e4(0x138)]){const _0x1fe48f=yamlActivationToUpdateRequest(_0x25b5f5['yamlActivation'],_0xbac001,_0x3f6048);await withSpinner(_0x6547e4(0x118)+_0x25b5f5[_0x6547e4(0x172)]+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)]['updateActivation'](_0x47019c,_0x31fc68,_0x25b5f5['existingActivation']['id'],_0x1fe48f),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),console['error'](a36_0x572dba['yellow'](_0x6547e4(0x1bc)+_0x25b5f5[_0x6547e4(0x172)]+'\x27')),_0x50e902++;}else _0x25b5f5[_0x6547e4(0x10e)]===_0x6547e4(0x1a8)&&_0x25b5f5['existingActivation']&&(await withSpinner(_0x6547e4(0x140)+_0x25b5f5[_0x6547e4(0x172)]+_0x6547e4(0x12f),()=>_0x474725['segment'][_0x6547e4(0x164)](_0x47019c,_0x31fc68,_0x25b5f5[_0x6547e4(0x138)]['id']),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),console['error'](a36_0x572dba[_0x6547e4(0x17c)](_0x6547e4(0x10f)+_0x25b5f5[_0x6547e4(0x172)]+'\x27')),_0x467573++);}}catch(_0x433553){const _0x1612fb=isHttp400Error(_0x433553),_0x5e9ef7=_0x1612fb?ErrorCode[_0x6547e4(0x148)]:ErrorCode[_0x6547e4(0x1ad)],_0x4651e0=getErrorMessage(_0x433553);throw new SDKError(_0x5e9ef7,_0x6547e4(0x196)+_0x25b5f5[_0x6547e4(0x10e)]+'\x20activation\x20\x27'+_0x25b5f5[_0x6547e4(0x172)]+_0x6547e4(0x1b5)+_0x3b3eb8[_0x6547e4(0x1a6)]+_0x6547e4(0x1c6)+_0x4651e0,_0x433553);}}}for(const _0x3f3566 of _0x2fc5ee['journeysOnly']?[]:_0x52e9fa){await withSpinner(_0x6547e4(0x122)+_0x3f3566['name']+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x191)](_0x3f3566['id']),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),console[_0x6547e4(0x14f)](a36_0x572dba['red'](_0x6547e4(0x127)+_0x3f3566['name']+'\x27')),_0x4fd6cc++;}let _0x5803e4=0x0,_0x151043=0x0,_0x3731a6=0x0;const _0x242b51=new Map(_0x14d80c);for(const _0x5ceb1 of _0x3db5f1){_0x5ceb1[_0x6547e4(0x19b)]&&_0x1a6bef['has'](_0x5ceb1[_0x6547e4(0x15c)][_0x6547e4(0x172)])&&_0x242b51[_0x6547e4(0x119)](_0x5ceb1[_0x6547e4(0x15c)][_0x6547e4(0x172)],_0x1a6bef[_0x6547e4(0x1c9)](_0x5ceb1['yamlConfig'][_0x6547e4(0x172)]));}if(_0x616dc1[_0x6547e4(0x12c)]>0x0){const _0x372889=await withQuerySpinner(_0x6547e4(0x17e),async _0x282b86=>{const _0x9888d=_0x6547e4,_0x58bc7e=[];let _0x4ab869=0x0;const _0x1984dd=0x5;for(let _0x120119=0x0;_0x120119<_0x616dc1[_0x9888d(0x12c)];_0x120119+=_0x1984dd){const _0x3af869=_0x616dc1[_0x9888d(0x171)](_0x120119,_0x120119+_0x1984dd),_0x118fe4=await Promise[_0x9888d(0x18c)](_0x3af869[_0x9888d(0x182)](async _0x328278=>{const _0x1d344f=_0x9888d;if(!_0x328278['isNew']&&!_0x328278[_0x1d344f(0x185)])return{'action':'unchanged','name':_0x328278[_0x1d344f(0x15c)][_0x1d344f(0x172)],'journeyId':_0x328278['existingJourney']?.['id']};const _0xc70838=_0x328278[_0x1d344f(0x17d)]?_0x2a65df[_0x1d344f(0x1c9)](_0x328278[_0x1d344f(0x17d)]):undefined,_0x2177e2=_0x328278[_0x1d344f(0x19b)]?_0x1d344f(0x17a):_0x1d344f(0x11d);_0x282b86[_0x1d344f(0x17b)](_0x2177e2+_0x1d344f(0xf6)+_0x328278[_0x1d344f(0x15c)]['name']+'\x27');const _0x567b49=new Map(),_0x1feca6=new Map(),_0x51d33c=new Map(),_0x42e6ff={'resolveSegmentId':async _0x57302c=>{const _0x1f3637=_0x1d344f,_0x1bee9e=_0x242b51['get'](_0x57302c);if(!_0x1bee9e)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1f3637(0x161)+_0x57302c+_0x1f3637(0xe3)+_0x328278['yamlConfig']['name']+')');return _0x1bee9e;},'resolveEmbeddedSegmentId':async(_0x330cc,_0x924aa1)=>{const _0x2acba3=_0x1d344f,_0x2fe9ad=_0x242b51[_0x2acba3(0x1c9)](_0x330cc);if(_0x2fe9ad)return _0x2fe9ad;const _0x429e7a=_0x479e9a[_0x2acba3(0x1ab)](_0x26dbb6=>_0x26dbb6[_0x2acba3(0x172)]===_0x330cc);if(_0x429e7a)return _0x242b51['set'](_0x330cc,_0x429e7a['id']),_0x429e7a['id'];if(_0x328278[_0x2acba3(0x19b)]){const _0x130888=_0x328278[_0x2acba3(0x15c)]['stages']||_0x328278[_0x2acba3(0x15c)][_0x2acba3(0x1d1)]?.[0x0]?.[_0x2acba3(0x189)]||[];let _0x30ac9d=_0x2acba3(0x124),_0xeeb676=_0x330cc;for(const _0x43353b of _0x130888){if(_0x43353b[_0x2acba3(0xe1)]?.['segment']===_0x330cc){_0x30ac9d=_0x43353b[_0x2acba3(0x172)],_0xeeb676=_0x43353b[_0x2acba3(0xe1)][_0x2acba3(0x172)]||_0x330cc;break;}}return _0x1feca6[_0x2acba3(0x119)](_0x330cc,{'definition':_0x924aa1,'stageName':_0x30ac9d,'criteriaName':_0xeeb676}),createPendingSegmentId(_0x330cc);}const _0x118738=_0x328278[_0x2acba3(0xf3)]?.['id'];if(!_0x118738)throw new SDKError(ErrorCode['INTERNAL'],_0x2acba3(0x168));const _0xd973ed=_0x2acba3(0x19c)+crypto[_0x2acba3(0xe6)]();try{const _0x10b653=await _0x474725[_0x2acba3(0x16d)][_0x2acba3(0x113)]({'name':_0xd973ed,'description':_0x924aa1[_0x2acba3(0xec)]||_0x2acba3(0xe5)+_0x330cc,'journeyId':_0x118738,'rule':yamlRuleToApi(_0x924aa1[_0x2acba3(0x193)],!![]),'countPopulation':!![],'parentFolderId':_0x571556||'','audienceId':_0x47019c});return _0x2fc5ee[_0x2acba3(0x135)]&&console[_0x2acba3(0x14f)]('\x20\x20Created\x20embedded\x20segment\x20\x27'+_0x330cc+'\x27\x20(internal:\x20'+_0xd973ed+')\x20with\x20ID:\x20'+_0x10b653),_0x242b51[_0x2acba3(0x119)](_0x330cc,_0x10b653),_0x10b653;}catch(_0x273c2f){throw new SDKError(ErrorCode[_0x2acba3(0x181)],_0x2acba3(0x1d9)+_0x330cc+_0x2acba3(0xea)+getErrorMessage(_0x273c2f),_0x273c2f);}},'resolveActivationId':async _0x4c784d=>{const _0x1a3111=_0x1d344f,_0x3397f2=_0x567b49[_0x1a3111(0x1c9)](_0x4c784d);if(_0x3397f2)return _0x3397f2;if(_0x328278[_0x1a3111(0xf3)]){const _0x2ad5ab=await _0x474725['journey'][_0x1a3111(0x158)](_0x328278['existingJourney']['id']),_0x5ca175=_0x2ad5ab[_0x1a3111(0x1ab)](_0x2de817=>_0x2de817[_0x1a3111(0x152)][_0x1a3111(0x10a)]?.['name']===_0x4c784d);if(_0x5ca175)return _0x567b49[_0x1a3111(0x119)](_0x4c784d,_0x5ca175['id']),_0x5ca175['id'];}throw new SDKError(ErrorCode[_0x1a3111(0xed)],_0x1a3111(0x129)+_0x4c784d+_0x1a3111(0xe3)+_0x328278[_0x1a3111(0x15c)][_0x1a3111(0x172)]+_0x1a3111(0x139)+_0x1a3111(0x159));},'resolveEmbeddedActivationId':async(_0x4bb13c,_0x2455c5)=>{const _0x233fcb=_0x1d344f,_0x3c0f65=_0x567b49['get'](_0x4bb13c);if(_0x3c0f65)return _0x3c0f65;if(_0x328278[_0x233fcb(0x19b)])return _0x51d33c[_0x233fcb(0x119)](_0x4bb13c,_0x2455c5),createPendingActivationId(_0x4bb13c);if(_0x328278['existingJourney']){const _0x236727=await _0x474725['journey'][_0x233fcb(0x158)](_0x328278['existingJourney']['id']),_0x1aec67=_0x236727[_0x233fcb(0x1ab)](_0x5b4475=>_0x5b4475[_0x233fcb(0x152)][_0x233fcb(0x10a)]?.[_0x233fcb(0x172)]===_0x2455c5[_0x233fcb(0x172)]);if(_0x1aec67)return _0x567b49[_0x233fcb(0x119)](_0x4bb13c,_0x1aec67['id']),_0x1aec67['id'];try{const _0x2216b1=yamlActivationToCreateRequest(_0x2455c5,_0xbac001,_0x3f6048),_0x286b68=await _0x474725[_0x233fcb(0x188)][_0x233fcb(0x16a)](_0x328278[_0x233fcb(0xf3)]['id'],_0x2216b1);return _0x2fc5ee[_0x233fcb(0x135)]&&console[_0x233fcb(0x14f)]('\x20\x20Created\x20embedded\x20activation\x20\x27'+_0x4bb13c+_0x233fcb(0x1a1)+_0x286b68['id']),_0x567b49[_0x233fcb(0x119)](_0x4bb13c,_0x286b68['id']),_0x286b68['id'];}catch(_0x3d2f24){throw new SDKError(ErrorCode[_0x233fcb(0x1c8)],_0x233fcb(0xe0)+_0x4bb13c+_0x233fcb(0xea)+getErrorMessage(_0x3d2f24),_0x3d2f24);}}throw new SDKError(ErrorCode[_0x233fcb(0x1a5)],_0x233fcb(0x15d));},'resolveJourneyId':async _0xa1b602=>{const _0x48c644=_0x1d344f;try{return await _0x474725[_0x48c644(0x188)][_0x48c644(0x187)](_0x47019c,_0xa1b602);}catch(_0x5384b4){throw new SDKError(ErrorCode['NOT_FOUND'],_0x48c644(0x12b)+_0xa1b602+_0x48c644(0x132)+_0x328278['yamlConfig'][_0x48c644(0x172)]+'\x27)',_0x5384b4);}},'resolveStageId':async(_0x5cd80d,_0x16e2f7)=>{const _0x141c36=_0x1d344f,_0x4e1638=await _0x474725['journey']['getJourney'](_0x5cd80d),_0x448282=_0x4e1638[_0x141c36(0x152)][_0x141c36(0x15f)][_0x141c36(0x1ab)](_0x2c9291=>_0x2c9291['name'][_0x141c36(0x10b)]()===_0x16e2f7[_0x141c36(0x10b)]());if(!_0x448282?.['id'])throw new SDKError(ErrorCode[_0x141c36(0xed)],_0x141c36(0x130)+_0x16e2f7+_0x141c36(0x1a7)+(_0x4e1638['attributes'][_0x141c36(0x1ba)]||_0x4e1638['attributes'][_0x141c36(0x172)])+'\x27');return _0x448282['id'];}};try{const _0x39a361=await a36_0x16c25f(_0x328278['yamlConfig'],_0x47019c,_0x42e6ff),_0x29d1d4=_0xc70838||_0x571556;_0x29d1d4&&(_0x39a361['relationships']={'parentFolder':{'data':{'id':_0x29d1d4,'type':'folder'}}});if(_0x328278[_0x1d344f(0x19b)]){if(_0x1feca6[_0x1d344f(0x105)]>0x0||_0x51d33c[_0x1d344f(0x105)]>0x0){const _0x26102f=JSON['parse'](JSON[_0x1d344f(0xfc)](_0x39a361));ensureJourneyDefaults(_0x26102f[_0x1d344f(0x152)]);for(const _0x4d7836 of _0x26102f[_0x1d344f(0x152)][_0x1d344f(0x15f)]){_0x4d7836['entryCriteria']?.[_0x1d344f(0x104)]&&isPendingSegmentId(_0x4d7836[_0x1d344f(0x149)][_0x1d344f(0x104)])&&delete _0x4d7836[_0x1d344f(0x149)];if(_0x4d7836[_0x1d344f(0xf0)])for(const _0x31f615 of Object[_0x1d344f(0xef)](_0x4d7836['steps'])){const _0x2b6161=_0x4d7836['steps'][_0x31f615];_0x2b6161[_0x1d344f(0x10e)]===_0x1d344f(0x166)&&_0x2b6161[_0x1d344f(0x198)]&&isPendingActivationId(_0x2b6161['journeyActivationStepId'])&&(_0x2b6161['journeyActivationStepId']='');if(_0x2b6161[_0x1d344f(0x10e)]===_0x1d344f(0x142)&&_0x2b6161[_0x1d344f(0x146)])for(const _0x4db3cc of _0x2b6161['branches']){_0x4db3cc[_0x1d344f(0x104)]&&isPendingSegmentId(_0x4db3cc[_0x1d344f(0x104)])&&(_0x4db3cc[_0x1d344f(0x104)]='');}}}_0x2fc5ee[_0x1d344f(0x135)]&&console[_0x1d344f(0x14f)]('\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20'+JSON[_0x1d344f(0xfc)](_0x26102f,null,0x2));const _0x24eb7a=await _0x474725['journey'][_0x1d344f(0xe7)](_0x26102f),_0x396b37=_0x24eb7a['id'],_0x14ad67=new Map();for(const _0x202f03 of _0x24eb7a[_0x1d344f(0x152)][_0x1d344f(0x15f)]){_0x14ad67[_0x1d344f(0x119)](_0x202f03[_0x1d344f(0x172)][_0x1d344f(0x10b)](),_0x202f03['id']);}const _0x4dadaf=new Map();for(const [_0x24bb8c,{definition:_0xbaf868,criteriaName:_0x2315d0}]of _0x1feca6){const _0x4b37bb=generateJourneyLocalName(_0x2315d0)||'journey_entry_criteria_'+crypto[_0x1d344f(0xe6)]();_0x2fc5ee['verbose']&&console['error'](_0x1d344f(0x1c5)+_0x24bb8c+_0x1d344f(0x18a)+_0x4b37bb+_0x1d344f(0x184)+_0x396b37);const _0x36c346=await _0x474725[_0x1d344f(0x16d)][_0x1d344f(0x113)]({'name':_0x4b37bb,'description':_0xbaf868[_0x1d344f(0xec)]||_0x1d344f(0xe5)+_0x24bb8c,'journeyId':_0x396b37,'rule':yamlRuleToApi(_0xbaf868[_0x1d344f(0x193)],!![]),'countPopulation':!![],'parentFolderId':_0x29d1d4||'','audienceId':_0x47019c});_0x4dadaf[_0x1d344f(0x119)](_0x24bb8c,_0x36c346),_0x242b51[_0x1d344f(0x119)](_0x24bb8c,_0x36c346),_0x2fc5ee[_0x1d344f(0x135)]&&console[_0x1d344f(0x14f)](_0x1d344f(0x1ac)+_0x24bb8c+_0x1d344f(0x1a1)+_0x36c346);}const _0x27ef75=new Map();for(const [_0x24815a,_0x1f6ae9]of _0x51d33c){_0x2fc5ee[_0x1d344f(0x135)]&&console[_0x1d344f(0x14f)](_0x1d344f(0x123)+_0x24815a+_0x1d344f(0x179)+_0x396b37);try{const _0x132f34=yamlActivationToCreateRequest(_0x1f6ae9,_0xbac001,_0x3f6048),_0x26b4b7=await _0x474725[_0x1d344f(0x188)][_0x1d344f(0x16a)](_0x396b37,_0x132f34);_0x27ef75[_0x1d344f(0x119)](_0x24815a,_0x26b4b7['id']),_0x567b49[_0x1d344f(0x119)](_0x24815a,_0x26b4b7['id']),_0x2fc5ee[_0x1d344f(0x135)]&&console[_0x1d344f(0x14f)](_0x1d344f(0x1d5)+_0x24815a+'\x27\x20with\x20ID:\x20'+_0x26b4b7['id']);}catch(_0x1f1e10){throw new SDKError(ErrorCode[_0x1d344f(0x1c8)],_0x1d344f(0xe0)+_0x24815a+_0x1d344f(0xea)+getErrorMessage(_0x1f1e10),_0x1f1e10);}}const _0x13355c=JSON['parse'](JSON[_0x1d344f(0xfc)](_0x39a361));_0x13355c['id']=_0x396b37,ensureJourneyDefaults(_0x13355c['attributes']);for(const _0x3b6e00 of _0x13355c[_0x1d344f(0x152)][_0x1d344f(0x15f)]){const _0x22e4c4=_0x14ad67[_0x1d344f(0x1c9)](_0x3b6e00[_0x1d344f(0x172)][_0x1d344f(0x10b)]());_0x22e4c4&&(_0x3b6e00['id']=_0x22e4c4);if(_0x3b6e00[_0x1d344f(0x149)]?.[_0x1d344f(0x104)]&&isPendingSegmentId(_0x3b6e00[_0x1d344f(0x149)][_0x1d344f(0x104)])){const _0x7c2865=extractPendingSegmentName(_0x3b6e00[_0x1d344f(0x149)][_0x1d344f(0x104)]),_0x1455b5=_0x4dadaf[_0x1d344f(0x1c9)](_0x7c2865);_0x1455b5&&(_0x3b6e00['entryCriteria'][_0x1d344f(0x104)]=_0x1455b5);}if(_0x3b6e00[_0x1d344f(0xf0)]){const _0xdf939f=_0x38f0d7=>_0x39a361['attributes'][_0x1d344f(0x15f)][_0x1d344f(0x1ab)](_0x4c6b73=>_0x4c6b73['name'][_0x1d344f(0x10b)]()===_0x3b6e00[_0x1d344f(0x172)][_0x1d344f(0x10b)]())?.[_0x1d344f(0xf0)]?.[_0x38f0d7];for(const _0x219db0 of Object[_0x1d344f(0xef)](_0x3b6e00[_0x1d344f(0xf0)])){const _0x2acc1c=_0x3b6e00[_0x1d344f(0xf0)][_0x219db0],_0x42cc5d=_0xdf939f(_0x219db0);if(_0x2acc1c[_0x1d344f(0x10e)]===_0x1d344f(0x166)&&_0x2acc1c['journeyActivationStepId']&&(isPendingActivationId(_0x2acc1c[_0x1d344f(0x198)])||_0x2acc1c['journeyActivationStepId']==='')){if(_0x42cc5d?.[_0x1d344f(0x198)]&&isPendingActivationId(_0x42cc5d[_0x1d344f(0x198)])){const _0x29b92d=extractPendingActivationName(_0x42cc5d[_0x1d344f(0x198)]),_0x326b29=_0x27ef75[_0x1d344f(0x1c9)](_0x29b92d);_0x326b29&&(_0x2acc1c[_0x1d344f(0x198)]=_0x326b29);}}if(_0x2acc1c[_0x1d344f(0x10e)]===_0x1d344f(0x142)&&_0x2acc1c[_0x1d344f(0x146)]&&_0x42cc5d?.[_0x1d344f(0x146)])for(let _0x3ea557=0x0;_0x3ea557<_0x2acc1c['branches'][_0x1d344f(0x12c)];_0x3ea557++){const _0x41428f=_0x2acc1c['branches'][_0x3ea557],_0x57ee62=_0x42cc5d[_0x1d344f(0x146)][_0x3ea557];if(_0x57ee62?.[_0x1d344f(0x104)]&&isPendingSegmentId(_0x57ee62['segmentId'])){const _0xd657fb=extractPendingSegmentName(_0x57ee62[_0x1d344f(0x104)]),_0x20efde=_0x4dadaf[_0x1d344f(0x1c9)](_0xd657fb);_0x20efde&&(_0x41428f[_0x1d344f(0x104)]=_0x20efde);}}}}}return _0x2fc5ee[_0x1d344f(0x135)]&&console[_0x1d344f(0x14f)]('\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20'+JSON[_0x1d344f(0xfc)](_0x13355c,null,0x2)),await _0x474725[_0x1d344f(0x188)][_0x1d344f(0x160)](_0x396b37,_0x13355c),{'action':_0x1d344f(0xff),'name':_0x328278[_0x1d344f(0x15c)][_0x1d344f(0x172)],'journeyId':_0x396b37};}else{ensureJourneyDefaults(_0x39a361[_0x1d344f(0x152)]);_0x2fc5ee[_0x1d344f(0x135)]&&console['error'](_0x1d344f(0x1d0)+JSON[_0x1d344f(0xfc)](_0x39a361,null,0x2));const _0x20e7ec=await _0x474725[_0x1d344f(0x188)][_0x1d344f(0xe7)](_0x39a361);return{'action':'created','name':_0x328278[_0x1d344f(0x15c)][_0x1d344f(0x172)],'journeyId':_0x20e7ec['id']};}}else{if(_0x328278[_0x1d344f(0x185)]&&_0x328278[_0x1d344f(0xf3)])return ensureJourneyDefaults(_0x39a361[_0x1d344f(0x152)]),await _0x474725['journey'][_0x1d344f(0x160)](_0x328278[_0x1d344f(0xf3)]['id'],_0x39a361),{'action':_0x1d344f(0x186),'name':_0x328278[_0x1d344f(0x15c)][_0x1d344f(0x172)],'journeyId':_0x328278[_0x1d344f(0xf3)]['id']};}return{'action':_0x1d344f(0x194),'name':_0x328278['yamlConfig'][_0x1d344f(0x172)],'journeyId':_0x328278[_0x1d344f(0xf3)]?.['id']};}catch(_0x92b1a6){const _0x3a0315=isHttp400Error(_0x92b1a6),_0x690e92=_0x3a0315?ErrorCode[_0x1d344f(0x101)]:ErrorCode[_0x1d344f(0x1c8)],_0x58d1a3=getErrorMessage(_0x92b1a6);throw new SDKError(_0x690e92,'Failed\x20to\x20'+(_0x328278[_0x1d344f(0x19b)]?'create':_0x1d344f(0x160))+_0x1d344f(0x153)+_0x328278[_0x1d344f(0x1a6)]+_0x1d344f(0x1c6)+_0x58d1a3,_0x92b1a6);}}));_0x58bc7e[_0x9888d(0xe2)](..._0x118fe4),_0x4ab869+=_0x3af869[_0x9888d(0x12c)],_0x282b86['setExtra']('('+_0x4ab869+'/'+_0x616dc1['length']+')');}return _0x58bc7e;},{'verbose':_0x2fc5ee[_0x6547e4(0x135)]});for(const _0x1230e1 of _0x372889[_0x6547e4(0x13c)]){if(_0x1230e1[_0x6547e4(0x1cc)]===_0x6547e4(0xff))console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x110)](_0x6547e4(0x19f)+_0x1230e1['name']+'\x27')),_0x5803e4++;else _0x1230e1[_0x6547e4(0x1cc)]===_0x6547e4(0x186)&&(console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x19d)](_0x6547e4(0x117)+_0x1230e1[_0x6547e4(0x172)]+'\x27')),_0x151043++);}if(_0x3fa3a4&&_0x372889[_0x6547e4(0x13c)]['length']===0x1){const _0x37bfcf=_0x372889[_0x6547e4(0x13c)][0x0];if(_0x37bfcf[_0x6547e4(0x128)]){const _0x379f5f=getConsoleNextUrl(_0x2fc5ee['site'],_0x6547e4(0x1d8)+_0x47019c+_0x6547e4(0x13f)+_0x37bfcf[_0x6547e4(0x128)]+'/j/da/je');console[_0x6547e4(0x14f)]('\x20\x20'+a36_0x572dba['cyan'](_0x379f5f));}}}for(const _0x2a8287 of _0x596d13){console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x19d)](_0x6547e4(0x1a9)+_0x2a8287[_0x6547e4(0x1ba)])),_0x3731a6++;}const _0x16e3a1=[];if(_0x3e27cc>0x0)_0x16e3a1[_0x6547e4(0xe2)](_0x3e27cc+_0x6547e4(0x143));if(_0x3f9c86>0x0)_0x16e3a1['push'](_0x3f9c86+_0x6547e4(0x1b7));if(_0x4fd6cc>0x0)_0x16e3a1[_0x6547e4(0xe2)](_0x4fd6cc+_0x6547e4(0x12d));const _0x114ead=[];if(_0x5803e4>0x0)_0x114ead[_0x6547e4(0xe2)](_0x5803e4+_0x6547e4(0x143));if(_0x151043>0x0)_0x114ead[_0x6547e4(0xe2)](_0x151043+_0x6547e4(0x1b7));if(_0x3731a6>0x0)_0x114ead[_0x6547e4(0xe2)](_0x3731a6+_0x6547e4(0x12d));const _0x23fd4a=[];if(_0x1651ec>0x0)_0x23fd4a[_0x6547e4(0xe2)](_0x1651ec+_0x6547e4(0x143));if(_0x50e902>0x0)_0x23fd4a['push'](_0x50e902+_0x6547e4(0x1b7));if(_0x467573>0x0)_0x23fd4a[_0x6547e4(0xe2)](_0x467573+_0x6547e4(0x12d));return console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x110)](_0x6547e4(0xe9))),_0x16e3a1[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x176)]&&console[_0x6547e4(0x14f)](_0x6547e4(0x16c)+_0x16e3a1[_0x6547e4(0x1bb)](',\x20')),_0x114ead[_0x6547e4(0x12c)]>0x0&&console[_0x6547e4(0x14f)](_0x6547e4(0x18b)+_0x114ead[_0x6547e4(0x1bb)](',\x20')),_0x23fd4a[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x176)]&&console[_0x6547e4(0x14f)](_0x6547e4(0x157)+_0x23fd4a['join'](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x1ea565){const _0x295756=a36_0x22d99d,_0x40d0b7=new Map(),_0x4f5926=new Map();for(const _0xce5c48 of _0x1ea565){_0x4f5926['set'](_0xce5c48['id'],_0xce5c48);}const _0x20757e=new Set();for(const _0x185fb0 of _0x1ea565){!_0x185fb0[_0x295756(0x190)]&&_0x20757e[_0x295756(0x1cd)](_0x185fb0['id']);}function _0x2d6d4f(_0x2e8b96){const _0x48c34d=_0x295756;if(_0x20757e['has'](_0x2e8b96['id']))return'';if(_0x2e8b96['parentFolderId']){const _0x59b152=_0x4f5926[_0x48c34d(0x1c9)](_0x2e8b96[_0x48c34d(0x190)]);if(_0x59b152){const _0x36d9c2=_0x2d6d4f(_0x59b152);return _0x36d9c2?_0x36d9c2+'/'+_0x2e8b96[_0x48c34d(0x172)]:_0x2e8b96['name'];}}return _0x2e8b96[_0x48c34d(0x172)];}for(const _0x18028a of _0x1ea565){const _0x40120b=_0x2d6d4f(_0x18028a);_0x40d0b7[_0x295756(0x119)](_0x40120b,_0x18028a['id']);}return _0x40d0b7;}function findYamlFiles(_0x50db7b){const _0x307ce9=[];function _0x31f2ba(_0x460db7){const _0x108a15=a36_0x6dbb,_0x4312e9=readdirSync(_0x460db7,{'withFileTypes':!![]});for(const _0x13c706 of _0x4312e9){const _0x4e159e=a36_0x1f36c2[_0x108a15(0x1bb)](_0x460db7,_0x13c706[_0x108a15(0x172)]);if(_0x13c706[_0x108a15(0x1b3)]())_0x31f2ba(_0x4e159e);else(_0x13c706[_0x108a15(0x172)]['endsWith'](_0x108a15(0x1b6))||_0x13c706[_0x108a15(0x172)]['endsWith'](_0x108a15(0x1c2)))&&_0x307ce9[_0x108a15(0xe2)](_0x4e159e);}}return _0x31f2ba(_0x50db7b),_0x307ce9;}function calculateActivationActions(_0x4e56ac,_0x2a8eac,_0x1da4e0,_0x1b8cef){const _0x1775a6=a36_0x22d99d,_0x3ed280=[],_0x5dabc6=new Map();for(const _0xb3208b of _0x2a8eac){_0x5dabc6[_0x1775a6(0x119)](_0xb3208b[_0x1775a6(0x172)],_0xb3208b);}const _0x1ec30b=new Map();for(const _0x584498 of _0x4e56ac){_0x1ec30b[_0x1775a6(0x119)](_0x584498[_0x1775a6(0x172)],_0x584498);}for(const _0x564b8a of _0x4e56ac){const _0x4d11cd=_0x5dabc6[_0x1775a6(0x1c9)](_0x564b8a[_0x1775a6(0x172)]);if(!_0x4d11cd)_0x3ed280[_0x1775a6(0xe2)]({'type':_0x1775a6(0xe7),'name':_0x564b8a[_0x1775a6(0x172)],'yamlActivation':_0x564b8a});else{const _0x323bb0=activationToYaml(_0x4d11cd,_0x1da4e0,_0x1b8cef),_0x55bfa7=a36_0x34bb63[_0x1775a6(0xfc)](_0x323bb0),_0x4f0a1a=a36_0x34bb63[_0x1775a6(0xfc)](_0x564b8a);_0x55bfa7!==_0x4f0a1a&&_0x3ed280[_0x1775a6(0xe2)]({'type':_0x1775a6(0x160),'name':_0x564b8a[_0x1775a6(0x172)],'yamlActivation':_0x564b8a,'existingActivation':_0x4d11cd});}}for(const _0x39a540 of _0x2a8eac){!_0x1ec30b[_0x1775a6(0x19a)](_0x39a540[_0x1775a6(0x172)])&&_0x3ed280[_0x1775a6(0xe2)]({'type':_0x1775a6(0x1a8),'name':_0x39a540[_0x1775a6(0x172)],'existingActivation':_0x39a540});}return _0x3ed280;}
1
+ const a36_0x59c5e1=a36_0x2d4a;(function(_0x485bd3,_0x6afa23){const _0x54ad50=a36_0x2d4a,_0x3748e3=_0x485bd3();while(!![]){try{const _0x3dea59=-parseInt(_0x54ad50(0x1f7))/0x1*(parseInt(_0x54ad50(0x1ff))/0x2)+parseInt(_0x54ad50(0x200))/0x3+-parseInt(_0x54ad50(0x1dd))/0x4*(-parseInt(_0x54ad50(0x174))/0x5)+parseInt(_0x54ad50(0x178))/0x6*(parseInt(_0x54ad50(0x221))/0x7)+parseInt(_0x54ad50(0x25c))/0x8*(parseInt(_0x54ad50(0x206))/0x9)+parseInt(_0x54ad50(0x1cc))/0xa*(parseInt(_0x54ad50(0x1ee))/0xb)+-parseInt(_0x54ad50(0x1fa))/0xc*(parseInt(_0x54ad50(0x186))/0xd);if(_0x3dea59===_0x6afa23)break;else _0x3748e3['push'](_0x3748e3['shift']());}catch(_0x2edb0a){_0x3748e3['push'](_0x3748e3['shift']());}}}(a36_0x3691,0xa97b2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../sdk/errors.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,yamlActivationToUpdateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x2e896f,yamlToApi as a36_0x18f4eb,toYamlString as a36_0x2783fc,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a36_0x54932d from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a36_0x475838 from'path';import{getConsoleNextUrl}from'../types/endpoints.js';function a36_0x2d4a(_0x33ab24,_0x201696){_0x33ab24=_0x33ab24-0x169;const _0x3691bc=a36_0x3691();let _0x2d4a1f=_0x3691bc[_0x33ab24];return _0x2d4a1f;}import*as a36_0x147f4c from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX='__pending_';function createPendingSegmentId(_0x5e5212){return''+PENDING_SEGMENT_PREFIX+_0x5e5212+'__';}function isPendingSegmentId(_0x30872e){return _0x30872e['startsWith'](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x3d8be3){return _0x3d8be3['replace'](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX=a36_0x59c5e1(0x257);function createPendingActivationId(_0x59c9b7){return''+PENDING_ACTIVATION_PREFIX+_0x59c9b7+'__';}function isPendingActivationId(_0x6b4358){const _0x530571=a36_0x59c5e1;return _0x6b4358[_0x530571(0x19c)](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x19ee40){const _0x1257d3=a36_0x59c5e1;return _0x19ee40[_0x1257d3(0x1d6)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x3b2f15){const _0x53017e=a36_0x59c5e1;!_0x3b2f15['description']&&(_0x3b2f15['description']=''),!_0x3b2f15[_0x53017e(0x1aa)]&&(_0x3b2f15[_0x53017e(0x1aa)]=_0x53017e(0x198));}function tryFindTdxConfig(_0x506458){try{return findTdxConfig(_0x506458);}catch{return null;}}function resolveTDFolderPath(_0x53f5ca,_0x597af2,_0x35abfc){if(!_0x597af2)return _0x53f5ca;return _0x53f5ca?_0x35abfc+'/'+_0x53f5ca:_0x35abfc;}function a36_0x3691(){const _0x3918b4=['toLowerCase','parse','8198508RCKOZn','name','\x20changed','existingSegment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','dirname','parent_segment','folderPath','Creating\x20folder\x20\x27','Deleting\x20segment\x20\x27','\x20journey\x20from\x20file:\x20','Updating','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Updating\x20activation\x20\x27','12116130yIajdy','Changes\x20to:','getJourney','get','buildUserMaps','Error\x20parsing\x20','resolve','\x20activation\x20\x27','Failed\x20to\x20','values','then','Parent\x20segment:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','entries','attributes','\x20created','\x20to\x20delete','all','draft','entry_criteria','deleteSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','startsWith','connection','\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20','config','Activation','repeat','push','New\x20segment:','absolutePath','SEGMENT_UPDATE_ERROR','delete','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','isFile','✔\x20Created\x20segment\x20\x27','state','\x27\x20details...','INTERNAL','listActivations','yamlActivation','join','map','versionNumber','\x20\x20✔\x20Updated\x20activation\x20\x27','(Journey\x20will\x20be\x20deleted)','length','\x20deleted','cwd','steps','\x20\x20Created\x20embedded\x20segment\x20\x27','relative','Segment\x20not\x20found:\x20','data','yes','/e/','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','existingJourney','site','\x27...','\x20\x20Activations:','ACTIVATION_SYNTAX_ERROR','blue','\x27:\x20','green','item','folderId','.yml','/j/da/je','\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20','180lhVFjD','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20new','Fetching\x20parent\x20segment\x20details...','configDir','diff','JOURNEY_SYNTAX_ERROR','setPhase','cyan','replace',')\x20with\x20ID:\x20','sort','Activation\x20not\x20found:\x20','\x20activations]',')\x20with\x20journeyId:\x20','Scoped\x20to\x20folder:\x20','4kIABuP','relationships','\x0aPush\x20summary\x20for\x20\x27','updated','journey','Folders\x20to\x20create:','SEGMENT_NOT_FOUND','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','activationActions','\x20\x20Journey\x20API\x20request:\x20','segment','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','listSegments','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','Creating\x20segment\x20\x27','Stage\x20\x27','609323qLSNAN','\x20unchanged','\x20\x20🗺️\x20\x20Journeys:','updateSegmentById','activations','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','DecisionPoint','✔\x20Deleted\x20segment\x20\x27','action','462594lPQzKp','parentSegment','verbose','48nhDMpd','slice','.yaml','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x27\x20v','4aiNxrC','1796772kJArmT','...','yamlConfig','existingActivation','entryCriteria','journeyBundleName','12159387ZvrihF','\x20journey\x20\x27','buildIdToNameMap','New\x20journey:','created','createJourneySegment','rule','Pushing\x20journeys...','isNew','journeysOnly','toString','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Fetching\x20existing\x20folders...','\x20segment\x20from\x20file:\x20','entry','createFolder','find','Push\x20','Fetching\x20existing\x20journeys...','listFolders','set','\x20\x20Segments:\x20','filter','keys','execute','has','error','7UFDNRv','\x27\x20with\x20ID:\x20','Source\x20directory:\x20','resolveJourneyId','red','create','setExtra','\x20\x20✔\x20Created\x20activation\x20\x27','\x20folders\x20to\x20create','ACTIVATION_UPDATE_ERROR','createActivation','isDirectory','Fetching\x20journey\x20\x27','Resolving\x20parent\x20segment\x20\x27','NOT_FOUND','Site:\x20','type','add','\x20\x20Created\x20embedded\x20activation\x20\x27',').\x20','parentFolderId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','journeyStages','\x20changes?','split','Delete\x20journey:','\x20to\x20create','branches','description','parentSegmentFolder','size','✔\x20Updated\x20journey\x20\x27','folder','\x20updated','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)','randomUUID','stringify','stages','dryRun','✔\x20Created\x20journey\x20\x27','journeyActivationStepId','update','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','SEGMENT_SYNTAX_ERROR','getActivation','\x20\x20\x20\x20','kind','journey_entry_criteria_','segmentId','📁\x20','\x0a✔\x20Push\x20complete','\x27\x20from\x20file:\x20','hasChanges','__pending_act_','Aborted.','\x27\x20not\x20found\x20in\x20journey\x20\x27','user','unchanged','8oCztjH','Entry\x20criteria:\x20','Changes\x20to\x20journey:','Fetching\x20existing\x20activations...','JOURNEY_UPDATE_ERROR','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','journeyId','\x20\x20Journeys:\x20','\x27\x20(internal:\x20','activationParams','Fetching\x20users\x20for\x20email\x20resolution...','flatMap','createSegment','dim','segmentFolderId','getParent','\x20\x20✔\x20Deleted\x20activation\x20\x27','✔\x20Created\x20folder\x20\x27','\x20YAML\x20files\x20found','5169815VllwdB','endsWith'];a36_0x3691=function(){return _0x3918b4;};return a36_0x3691();}export class SegmentPushCommand extends BaseCommand{[a36_0x59c5e1(0x179)]='segment:push';['description']=a36_0x59c5e1(0x237);async[a36_0x59c5e1(0x21e)](_0x322d10){const _0x25e0ba=a36_0x59c5e1,{options:_0x164202,args:_0x506602,tdx:_0x5793b9}=_0x322d10,_0x9a1cc5=_0x164202,_0x5092b0=_0x164202[_0x25e0ba(0x1f8)],_0x287eb2=_0x506602[0x0];let _0x1e93f0,_0x2c65d3,_0x4177a9,_0x24ed3e;if(_0x287eb2){if(existsSync(_0x287eb2)&&statSync(_0x287eb2)[_0x25e0ba(0x22c)]()){const _0x5b04e1=tryFindTdxConfig(_0x287eb2);if(_0x5b04e1)_0x1e93f0=_0x5b04e1[_0x25e0ba(0x19f)][_0x25e0ba(0x17e)],_0x2c65d3=_0x287eb2,_0x4177a9=_0x5b04e1[_0x25e0ba(0x1d1)];else return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x1fd)+_0x287eb2+'\x0a')),console[_0x25e0ba(0x220)](a36_0x54932d['cyan'](_0x25e0ba(0x236))),0x1;}else{if(existsSync(_0x287eb2)&&statSync(_0x287eb2)[_0x25e0ba(0x1a8)]()){const _0x2719cd=a36_0x475838['dirname'](_0x287eb2),_0xdccf5e=tryFindTdxConfig(_0x2719cd);if(_0xdccf5e)_0x1e93f0=_0xdccf5e[_0x25e0ba(0x19f)][_0x25e0ba(0x17e)],_0x4177a9=_0xdccf5e[_0x25e0ba(0x1d1)],_0x2c65d3=_0xdccf5e[_0x25e0ba(0x1d1)],_0x24ed3e=a36_0x475838[_0x25e0ba(0x18c)](_0x287eb2);else return console['error'](a36_0x54932d['red'](_0x25e0ba(0x1fd)+_0x2719cd+'\x0a')),console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1d5)](_0x25e0ba(0x236))),0x1;}else _0x1e93f0=_0x287eb2;}}else{const _0x48fcaa=tryFindTdxConfig(process[_0x25e0ba(0x1b6)]());_0x48fcaa?(_0x1e93f0=_0x48fcaa['config']['parent_segment'],_0x2c65d3=process['cwd'](),_0x4177a9=_0x48fcaa[_0x25e0ba(0x1d1)]):_0x1e93f0=_0x5092b0;}if(!_0x1e93f0)return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1cd)](_0x25e0ba(0x17c))),console[_0x25e0ba(0x220)](_0x25e0ba(0x244)),console[_0x25e0ba(0x220)](_0x25e0ba(0x1ce)),console[_0x25e0ba(0x220)](_0x25e0ba(0x184)),0x1;const _0x59c816=_0x2c65d3||getSegmentRootDir(sanitizeFileName(_0x1e93f0)),_0x4fcb86=_0x4177a9||_0x59c816,_0x1bda42=a36_0x475838['relative'](_0x4fcb86,_0x59c816),_0xab46ba=_0x1bda42!==''&&_0x1bda42!=='.';if(!existsSync(_0x59c816))return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)]('Error:\x20Directory\x20not\x20found:\x20'+_0x59c816+'\x0a')),console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1d5)](_0x25e0ba(0x236))),0x1;_0x9a1cc5['verbose']&&(console[_0x25e0ba(0x220)](_0x25e0ba(0x230)+_0x9a1cc5[_0x25e0ba(0x1c0)]),console[_0x25e0ba(0x220)](_0x25e0ba(0x191)+_0x1e93f0),console[_0x25e0ba(0x220)](_0x25e0ba(0x223)+_0x59c816),_0xab46ba&&console[_0x25e0ba(0x220)](_0x25e0ba(0x1dc)+_0x1bda42));const _0x598751=await withSpinner(_0x25e0ba(0x22e)+_0x1e93f0+_0x25e0ba(0x1c1),()=>_0x5793b9[_0x25e0ba(0x1e7)]['resolveParentId'](_0x1e93f0),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]}),_0x2d104e=_0x598751[_0x25e0ba(0x1bb)],[_0x2a80fa,_0x2c4945,_0x41105e,_0x282fd3,_0x1b40b1]=await Promise['all']([withSpinner(_0x25e0ba(0x1d0),()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x170)](_0x2d104e),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x1e9)](_0x2d104e),{'verbose':_0x9a1cc5['verbose']}),withSpinner(_0x25e0ba(0x212),()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x219)](_0x2d104e),{'verbose':_0x9a1cc5['verbose']}),withSpinner(_0x25e0ba(0x218),()=>_0x5793b9[_0x25e0ba(0x1e1)]['listJourneysFromParentSegment'](_0x2d104e),{'verbose':_0x9a1cc5['verbose']}),withSpinner(_0x25e0ba(0x16b),()=>_0x5793b9[_0x25e0ba(0x25a)][_0x25e0ba(0x18a)](),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]})[_0x25e0ba(0x190)](_0x171c0d=>_0x171c0d[_0x25e0ba(0x1bb)])]),_0x24c2fd=_0x2a80fa[_0x25e0ba(0x1bb)],_0x17d9ba=_0x24c2fd[_0x25e0ba(0x1de)]?.[_0x25e0ba(0x23f)]?.[_0x25e0ba(0x1bb)]?.['id']||_0x24c2fd[_0x25e0ba(0x1de)]?.['parentFolder']?.[_0x25e0ba(0x1bb)]?.['id'],_0xfee852=_0x2c4945[_0x25e0ba(0x1bb)],_0x3df1cf=_0x41105e[_0x25e0ba(0x1bb)],_0x5e662c=_0x282fd3[_0x25e0ba(0x1bb)],{emailToId:_0x1516f5,idToEmail:_0x464344}=_0x1b40b1,[_0x5b7934,_0x502bc7]=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x16fe6a=_0x25e0ba,[_0x3267ae,_0x56938c]=await Promise[_0x16fe6a(0x197)]([_0x5793b9[_0x16fe6a(0x19d)]['buildNameToIdMap'](),_0x5793b9[_0x16fe6a(0x19d)][_0x16fe6a(0x208)]()]);return[_0x3267ae,_0x56938c];},{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]})[_0x25e0ba(0x190)](_0x2cbe5e=>_0x2cbe5e['data']),_0x2ac595=buildFolderPathToIdMap(_0x3df1cf),_0x22d65e=new Map();for(const [_0xaad2c1,_0x121047]of _0x2ac595[_0x25e0ba(0x193)]()){_0x22d65e[_0x25e0ba(0x21a)](_0x121047,_0xaad2c1);}const _0x4e2e0d=new Map();for(const _0x583b74 of _0xfee852){const _0x451a57=_0x583b74[_0x25e0ba(0x16f)]?_0x22d65e['get'](_0x583b74[_0x25e0ba(0x16f)]['toString']())||'':'',_0x1c70b8=_0x451a57+':'+_0x583b74[_0x25e0ba(0x179)];_0x4e2e0d[_0x25e0ba(0x21a)](_0x1c70b8,_0x583b74);}const _0x10252d=new Map();for(const _0x5e0d40 of _0xfee852){_0x10252d['set'](_0x5e0d40[_0x25e0ba(0x179)],_0x5e0d40['id']);}const _0x2ae488=new Map();for(const _0x4c44e6 of _0x5e662c){const _0x398286=_0x4c44e6['folderId']?_0x22d65e[_0x25e0ba(0x189)](_0x4c44e6[_0x25e0ba(0x1c8)])||'':'',_0x11a443=_0x398286+':'+_0x4c44e6[_0x25e0ba(0x205)];!_0x2ae488[_0x25e0ba(0x21f)](_0x11a443)&&_0x2ae488[_0x25e0ba(0x21a)](_0x11a443,[]),_0x2ae488[_0x25e0ba(0x189)](_0x11a443)[_0x25e0ba(0x1a2)](_0x4c44e6);}for(const _0xc28d99 of _0x2ae488[_0x25e0ba(0x18f)]()){_0xc28d99[_0x25e0ba(0x1d8)]((_0x180c67,_0x239b01)=>(_0x180c67[_0x25e0ba(0x1b1)]||0x0)-(_0x239b01[_0x25e0ba(0x1b1)]||0x0));}let _0x4a9f97;if(_0x24ed3e){if(!_0x24ed3e[_0x25e0ba(0x175)](_0x25e0ba(0x1c9))&&!_0x24ed3e[_0x25e0ba(0x175)](_0x25e0ba(0x1fc)))return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x24c)+_0x24ed3e+'\x0a')),0x1;_0x4a9f97=[_0x24ed3e];}else _0x4a9f97=findYamlFiles(_0x59c816);if(_0x4a9f97[_0x25e0ba(0x1b4)]===0x0)return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x19b)+_0x59c816+'\x0a')),console['error'](a36_0x54932d[_0x25e0ba(0x1d5)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;const _0x100cfe=[],_0x135150=[];for(const _0x235229 of _0x4a9f97){const _0x20a6f9=a36_0x475838[_0x25e0ba(0x1b9)](_0x59c816,a36_0x475838[_0x25e0ba(0x17d)](_0x235229)),_0x548494=_0x20a6f9==='.'?'':_0x20a6f9,_0x3be0e3=readFileSync(_0x235229,'utf-8');try{const _0x59557c=a36_0x147f4c[_0x25e0ba(0x177)](_0x3be0e3);if(isJourneyYaml(_0x59557c)){const _0x41c08d=a36_0x2e896f(_0x3be0e3);_0x135150['push']({'yamlConfig':_0x41c08d,'folderPath':_0x548494,'sourcePath':_0x235229});}else{if(!_0x9a1cc5[_0x25e0ba(0x20f)]){const _0x5b5100=parseSegmentYamlFile(_0x3be0e3),_0x3adba9=normalizeChildSegmentYaml(_0x5b5100);_0x100cfe[_0x25e0ba(0x1a2)]({'yamlConfig':_0x3adba9,'folderPath':_0x548494,'sourcePath':_0x235229});}}}catch(_0x53bad7){return console[_0x25e0ba(0x220)](a36_0x54932d['red'](_0x25e0ba(0x18b)+_0x235229+':\x20'+(_0x53bad7 instanceof Error?_0x53bad7['message']:_0x53bad7))),0x1;}}if(_0x100cfe[_0x25e0ba(0x1b4)]===0x0&&_0x135150['length']===0x0){const _0x84df66=_0x9a1cc5[_0x25e0ba(0x20f)]?_0x25e0ba(0x1e1):'segment\x20or\x20journey';return console['error'](a36_0x54932d[_0x25e0ba(0x1cd)]('No\x20'+_0x84df66+_0x25e0ba(0x173))),0x0;}const _0x37b05f=new Map();_0xfee852[_0x25e0ba(0x1b4)]>0x0&&!_0x9a1cc5['journeysOnly']&&await withSpinner(_0x25e0ba(0x25f),async()=>{await batchAsync(_0xfee852,async _0x236395=>{const _0x205fbf=a36_0x2d4a,_0x57764f=await _0x5793b9['segment'][_0x205fbf(0x1ad)](_0x2d104e,_0x236395['id']);_0x37b05f['set'](_0x236395['id'],_0x57764f);});},{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]});const _0x91fd22=[],_0x3c7242=new Set();for(const {yamlConfig:_0x569e66,folderPath:_0x4408a0,sourcePath:_0x26638b}of _0x100cfe){const _0x10865e=resolveTDFolderPath(_0x4408a0,_0xab46ba,_0x1bda42),_0x161ef3=_0x10865e+':'+_0x569e66['name'],_0x22bed5=_0x4e2e0d[_0x25e0ba(0x189)](_0x161ef3),_0x46b872=_0x22bed5?_0x37b05f[_0x25e0ba(0x189)](_0x22bed5['id'])||[]:[];if(_0x10865e&&!_0x2ac595[_0x25e0ba(0x21f)](_0x10865e)){const _0x349f07=_0x10865e['split']('/');let _0x46f54f='';for(const _0x680b16 of _0x349f07){_0x46f54f=_0x46f54f?_0x46f54f+'/'+_0x680b16:_0x680b16,!_0x2ac595[_0x25e0ba(0x21f)](_0x46f54f)&&_0x3c7242[_0x25e0ba(0x232)](_0x46f54f);}}const _0x32875b=calculateActivationActions(_0x569e66['activations']||[],_0x46b872,_0x464344,_0x502bc7),_0x54fd56=segmentToYamlString(_0x569e66);let _0x494a18,_0x1d7af3=![],_0x3ab3ff;if(_0x22bed5){const _0x1bb1f7=segmentWithActivationsToYaml(_0x22bed5,_0x46b872,undefined,_0x464344,_0x502bc7),_0x3ec935=segmentToYamlString(_0x1bb1f7);_0x494a18=generateDiff(_0x3ec935,_0x54fd56),_0x1d7af3=hasChanges(_0x494a18),_0x1d7af3&&(_0x3ab3ff=formatDiffWithColors(_0x494a18));}else _0x494a18=generateDiff('',_0x54fd56),_0x3ab3ff=formatDiffWithColors(_0x494a18);_0x91fd22[_0x25e0ba(0x1a2)]({'relativePath':_0x569e66[_0x25e0ba(0x179)],'absolutePath':_0x26638b,'yamlConfig':_0x569e66,'folderPath':_0x10865e,'existingSegment':_0x22bed5,'existingActivations':_0x46b872,'isNew':!_0x22bed5,'hasChanges':_0x1d7af3,'diff':_0x3ab3ff,'activationActions':_0x32875b});}let _0x53a076=[];if(!_0x24ed3e){const _0x1a258f=new Set();for(const {yamlConfig:_0x2eb490,folderPath:_0x3d28bf}of _0x100cfe){const _0x4e660e=resolveTDFolderPath(_0x3d28bf,_0xab46ba,_0x1bda42);_0x1a258f[_0x25e0ba(0x232)](_0x4e660e+':'+_0x2eb490['name']);}_0x53a076=_0xfee852[_0x25e0ba(0x21c)](_0x577361=>{const _0x309c7b=_0x25e0ba,_0x1dcfbb=_0x577361[_0x309c7b(0x16f)]?_0x22d65e[_0x309c7b(0x189)](_0x577361[_0x309c7b(0x16f)]['toString']())||'':'',_0x21e981=_0x1dcfbb+':'+_0x577361[_0x309c7b(0x179)];if(_0x1a258f[_0x309c7b(0x21f)](_0x21e981))return![];if(_0xab46ba)return _0x1dcfbb===_0x1bda42||_0x1dcfbb[_0x309c7b(0x19c)](_0x1bda42+'/');return!![];});}const _0x4ecc55=[];for(const {yamlConfig:_0x35f5b8,folderPath:_0xbd7dc7,sourcePath:_0x1c6f5a}of _0x135150){const _0x1b0a45=resolveTDFolderPath(_0xbd7dc7,_0xab46ba,_0x1bda42),_0x1424c9=_0x1b0a45+':'+_0x35f5b8['name'],_0x1f4683=_0x2ae488[_0x25e0ba(0x189)](_0x1424c9);let _0x202410,_0x1d243c;if(_0x1f4683&&_0x1f4683[_0x25e0ba(0x1b4)]>0x0){const _0x168bd7=new Set(),_0x3e5fb6=new Set(),_0x2adf8a=new Map(),_0xc7e0f=new Map(),_0x15e76d=createJumpTargetCache(),_0x171688=_0x111f18=>({'resolveSegment':async _0xc10e90=>{const _0x305baf=_0x25e0ba,_0x419247=_0xc7e0f[_0x305baf(0x189)](_0xc10e90);if(_0x419247!==undefined)return{'name':_0x419247,'isJourneyLocal':!![]};try{let _0x1f5b7f=_0xfee852['find'](_0x47ccde=>_0x47ccde['id']===_0xc10e90);!_0x1f5b7f&&(_0x1f5b7f=await _0x5793b9[_0x305baf(0x1e7)]['getSegment'](_0x2d104e,_0xc10e90));const _0x23e7ad=generateJourneyLocalName(_0x1f5b7f[_0x305baf(0x179)]),_0x2ddcb9=_0x1f5b7f[_0x305baf(0x250)]===SEGMENT_KIND_JOURNEY&&_0x23e7ad!==undefined;let _0x4bc387=_0x1f5b7f[_0x305baf(0x179)];if(_0x2ddcb9&&_0x23e7ad){let _0x2b7759=_0x23e7ad,_0x2a5e97=0x2;while(_0x168bd7[_0x305baf(0x21f)](_0x2b7759)){_0x2b7759=_0x23e7ad+'_'+_0x2a5e97,_0x2a5e97++;}_0x168bd7[_0x305baf(0x232)](_0x2b7759),_0x4bc387=_0x2b7759,_0xc7e0f[_0x305baf(0x21a)](_0xc10e90,_0x4bc387);}let _0x4b7771;return _0x2ddcb9&&_0x1f5b7f[_0x305baf(0x20c)]&&(_0x4b7771={'description':_0x1f5b7f[_0x305baf(0x23e)],'rule':apiRuleToYaml(_0x1f5b7f[_0x305baf(0x20c)])}),{'name':_0x4bc387,'isJourneyLocal':_0x2ddcb9,'definition':_0x4b7771};}catch{return{'name':_0xc10e90,'isJourneyLocal':![]};}},'resolveActivation':async _0x2f24d7=>{const _0x8d0ffc=_0x25e0ba,_0x33982b=_0x2adf8a[_0x8d0ffc(0x189)](_0x2f24d7);if(_0x33982b!==undefined)return{'name':_0x33982b,'isJourneyLocal':!![]};try{const _0x419314=await _0x5793b9[_0x8d0ffc(0x1e1)][_0x8d0ffc(0x24e)](_0x111f18,_0x2f24d7),_0x3b007e=_0x419314['attributes'][_0x8d0ffc(0x16a)][_0x8d0ffc(0x179)]||_0x2f24d7,_0x2ac228=sanitizeYamlKey(_0x3b007e)||'activation_'+_0x2f24d7;let _0x4df006=_0x2ac228,_0x5418d0=0x2;while(_0x3e5fb6[_0x8d0ffc(0x21f)](_0x4df006)){_0x4df006=_0x2ac228+'_'+_0x5418d0,_0x5418d0++;}_0x3e5fb6[_0x8d0ffc(0x232)](_0x4df006),_0x2adf8a[_0x8d0ffc(0x21a)](_0x2f24d7,_0x4df006);const _0x2e4540=journeyActivationStepToYaml(_0x419314,_0x464344,_0x502bc7);return{'name':_0x4df006,'isJourneyLocal':!![],'definition':_0x2e4540};}catch{return{'name':_0x2f24d7,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x106561,_0x5c761d)=>resolveJumpTarget(_0x106561,_0x5c761d,_0x15e76d,_0x3ed9b0=>_0x5793b9[_0x25e0ba(0x1e1)]['getJourney'](_0x3ed9b0))}),_0x1a0560=hasMultipleVersions(_0x35f5b8);if(_0x1a0560&&_0x1f4683[_0x25e0ba(0x1b4)]>0x1){const _0x30930b=[];for(const _0x20ccaa of _0x1f4683){const _0x471142=await withSpinner(_0x25e0ba(0x22d)+_0x35f5b8['name']+_0x25e0ba(0x1fe)+(_0x20ccaa[_0x25e0ba(0x1b1)]||0x1)+_0x25e0ba(0x201),()=>_0x5793b9[_0x25e0ba(0x1e1)][_0x25e0ba(0x188)](_0x20ccaa['id']),{'verbose':_0x9a1cc5['verbose']}),_0x45881d=_0x171688(_0x20ccaa['id']),_0x473a02=await apiToYamlAsync(_0x471142[_0x25e0ba(0x1bb)],_0x45881d);_0x30930b['push']({'item':_0x20ccaa,'yaml':_0x473a02});}_0x1d243c=buildMergedJourneyYaml(_0x30930b);const _0x2f4bb2=Math['max'](..._0x30930b['map'](_0x3dd47d=>_0x3dd47d[_0x25e0ba(0x1c7)]['versionNumber']||0x0)),_0x36b179=_0x1f4683['find'](_0x42aa0c=>(_0x42aa0c[_0x25e0ba(0x1b1)]||0x0)===_0x2f4bb2);_0x36b179&&(_0x202410=await _0x5793b9[_0x25e0ba(0x1e1)][_0x25e0ba(0x188)](_0x36b179['id']));}else{const _0x2f16a1=_0x1f4683[_0x1f4683[_0x25e0ba(0x1b4)]-0x1],_0x12178e=await withSpinner('Fetching\x20journey\x20\x27'+_0x35f5b8['name']+_0x25e0ba(0x1ab),()=>_0x5793b9[_0x25e0ba(0x1e1)][_0x25e0ba(0x188)](_0x2f16a1['id']),{'verbose':_0x9a1cc5['verbose']});_0x202410=_0x12178e[_0x25e0ba(0x1bb)];const _0x335a8c=_0x171688(_0x2f16a1['id']);_0x1d243c=await apiToYamlAsync(_0x202410,_0x335a8c);}}if(_0x1b0a45&&!_0x2ac595[_0x25e0ba(0x21f)](_0x1b0a45)){const _0x5a58d2=_0x1b0a45[_0x25e0ba(0x23a)]('/');let _0x1f8a25='';for(const _0x92e134 of _0x5a58d2){_0x1f8a25=_0x1f8a25?_0x1f8a25+'/'+_0x92e134:_0x92e134,!_0x2ac595[_0x25e0ba(0x21f)](_0x1f8a25)&&_0x3c7242['add'](_0x1f8a25);}}const _0x3fe45a=normalizeJourneyYaml(_0x35f5b8),_0x496921=a36_0x2783fc(_0x3fe45a);let _0x34eb96=![],_0x3aecc8;if(_0x1d243c){const _0x256887=normalizeJourneyYaml(_0x1d243c),_0x475e80=a36_0x2783fc(_0x256887),_0x363ec1=generateDiff(_0x475e80,_0x496921);_0x34eb96=hasChanges(_0x363ec1),_0x34eb96&&(_0x3aecc8=formatDiffWithColors(_0x363ec1));}else{const _0x95c39e=generateDiff('',_0x496921);_0x3aecc8=formatDiffWithColors(_0x95c39e);}_0x4ecc55[_0x25e0ba(0x1a2)]({'relativePath':_0x35f5b8[_0x25e0ba(0x179)],'absolutePath':_0x1c6f5a,'yamlConfig':_0x35f5b8,'folderPath':_0x1b0a45,'existingJourney':_0x202410,'isNew':!_0x202410,'hasChanges':_0x34eb96,'diff':_0x3aecc8});}let _0x57fe6d=[];if(!_0x24ed3e){const _0x588e24=new Set();for(const {yamlConfig:_0x4f91fa,folderPath:_0x19ff17}of _0x135150){const _0x115948=resolveTDFolderPath(_0x19ff17,_0xab46ba,_0x1bda42);_0x588e24[_0x25e0ba(0x232)](_0x115948+':'+_0x4f91fa[_0x25e0ba(0x179)]);}_0x57fe6d=_0x5e662c['filter'](_0x44ab91=>{const _0x2fb96c=_0x25e0ba,_0x21d6ef=_0x44ab91[_0x2fb96c(0x1c8)]?_0x22d65e[_0x2fb96c(0x189)](_0x44ab91[_0x2fb96c(0x1c8)])||'':'',_0x382506=_0x21d6ef+':'+_0x44ab91['journeyBundleName'];if(_0x588e24[_0x2fb96c(0x21f)](_0x382506))return![];if(_0xab46ba)return _0x21d6ef===_0x1bda42||_0x21d6ef[_0x2fb96c(0x19c)](_0x1bda42+'/');return!![];});}const _0x108c12=_0x91fd22[_0x25e0ba(0x21c)](_0x3ba927=>_0x3ba927[_0x25e0ba(0x20e)]),_0x8331ab=_0x91fd22[_0x25e0ba(0x21c)](_0x498e61=>!_0x498e61[_0x25e0ba(0x20e)]&&_0x498e61[_0x25e0ba(0x256)]),_0x20207f=_0x91fd22['filter'](_0x98a95b=>!_0x98a95b['isNew']&&!_0x98a95b[_0x25e0ba(0x256)]),_0x3408d0=Array['from'](_0x3c7242)['sort'](),_0x304ea1=_0x9a1cc5['delete']?_0x53a076:[],_0x3e0feb=_0x9a1cc5[_0x25e0ba(0x1a6)]?_0x57fe6d:[],_0x1e2c1e=_0x91fd22[_0x25e0ba(0x16c)](_0x392df4=>_0x392df4[_0x25e0ba(0x1e5)]),_0x527a4e=_0x1e2c1e[_0x25e0ba(0x21c)](_0x12a771=>_0x12a771[_0x25e0ba(0x231)]==='create'),_0x384eb8=_0x1e2c1e['filter'](_0x3d1997=>_0x3d1997['type']===_0x25e0ba(0x24b)),_0x4e02d2=_0x1e2c1e[_0x25e0ba(0x21c)](_0x438fcc=>_0x438fcc[_0x25e0ba(0x231)]===_0x25e0ba(0x1a6)),_0x479e32=_0x4ecc55[_0x25e0ba(0x21c)](_0x2424c3=>_0x2424c3[_0x25e0ba(0x20e)]),_0x2ec4a2=_0x4ecc55[_0x25e0ba(0x21c)](_0x5ae894=>!_0x5ae894['isNew']&&_0x5ae894[_0x25e0ba(0x256)]),_0x13b708=_0x4ecc55[_0x25e0ba(0x21c)](_0x36d299=>!_0x36d299[_0x25e0ba(0x20e)]&&!_0x36d299[_0x25e0ba(0x256)]);console[_0x25e0ba(0x220)](_0x25e0ba(0x1df)+_0x1e93f0+'\x27:');_0x3408d0[_0x25e0ba(0x1b4)]>0x0&&console[_0x25e0ba(0x220)]('\x20\x20'+a36_0x54932d[_0x25e0ba(0x1c4)](_0x25e0ba(0x253)+_0x3408d0[_0x25e0ba(0x1b4)]+_0x25e0ba(0x229)));if(!_0x9a1cc5[_0x25e0ba(0x20f)]){console[_0x25e0ba(0x220)]('\x20\x20📊\x20Segments:'),console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x1c6)]('+\x20'+_0x108c12[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1cf))),console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d['yellow']('~\x20'+_0x8331ab[_0x25e0ba(0x1b4)]+_0x25e0ba(0x17a)));if(_0x304ea1['length']>0x0)console['error']('\x20\x20\x20\x20'+a36_0x54932d[_0x25e0ba(0x225)]('-\x20'+_0x304ea1[_0x25e0ba(0x1b4)]+_0x25e0ba(0x196)));else _0x53a076[_0x25e0ba(0x1b4)]>0x0&&!_0x9a1cc5[_0x25e0ba(0x1a6)]&&console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x16e)](_0x53a076[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1f3)));console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x16e)]('=\x20'+_0x20207f[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1ef)));}if(_0x4ecc55['length']>0x0||_0x57fe6d[_0x25e0ba(0x1b4)]>0x0){console[_0x25e0ba(0x220)](_0x25e0ba(0x1f0)),console['error']('\x20\x20\x20\x20'+a36_0x54932d[_0x25e0ba(0x1c6)]('+\x20'+_0x479e32[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1cf))),console[_0x25e0ba(0x220)]('\x20\x20\x20\x20'+a36_0x54932d[_0x25e0ba(0x1cd)]('~\x20'+_0x2ec4a2[_0x25e0ba(0x1b4)]+_0x25e0ba(0x17a)));if(_0x3e0feb[_0x25e0ba(0x1b4)]>0x0)console['error'](_0x25e0ba(0x24f)+a36_0x54932d['red']('-\x20'+_0x3e0feb[_0x25e0ba(0x1b4)]+_0x25e0ba(0x196)));else _0x57fe6d[_0x25e0ba(0x1b4)]>0x0&&!_0x9a1cc5[_0x25e0ba(0x1a6)]&&console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x16e)](_0x57fe6d[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1f3)));console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x16e)]('=\x20'+_0x13b708['length']+_0x25e0ba(0x1ef)));}_0x1e2c1e['length']>0x0&&!_0x9a1cc5[_0x25e0ba(0x20f)]&&(console[_0x25e0ba(0x220)](''),console[_0x25e0ba(0x220)](_0x25e0ba(0x1c2)),_0x527a4e['length']>0x0&&console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d['green']('+\x20'+_0x527a4e['length']+_0x25e0ba(0x23c))),_0x384eb8[_0x25e0ba(0x1b4)]>0x0&&console['error'](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x1cd)]('~\x20'+_0x384eb8[_0x25e0ba(0x1b4)]+'\x20to\x20update')),_0x4e02d2[_0x25e0ba(0x1b4)]>0x0&&console[_0x25e0ba(0x220)](_0x25e0ba(0x24f)+a36_0x54932d[_0x25e0ba(0x225)]('-\x20'+_0x4e02d2['length']+'\x20to\x20delete')));console[_0x25e0ba(0x220)]('\x20\x20Source:\x20'+a36_0x54932d[_0x25e0ba(0x1d5)](_0x59c816)+'\x0a');if(_0x3408d0['length']>0x0){console[_0x25e0ba(0x220)](_0x25e0ba(0x1e2));for(const _0x32f047 of _0x3408d0){console['error']('\x20\x20'+a36_0x54932d[_0x25e0ba(0x1c4)]('+')+'\x20'+_0x32f047);}console[_0x25e0ba(0x220)]('');}if(_0x108c12['length']>0x0&&!_0x9a1cc5[_0x25e0ba(0x20f)])for(const _0x2e76f6 of _0x108c12){const _0x43b797=_0x2e76f6[_0x25e0ba(0x17f)]?_0x2e76f6['folderPath']+'/'+_0x2e76f6[_0x25e0ba(0x202)]['name']:_0x2e76f6[_0x25e0ba(0x202)][_0x25e0ba(0x179)],_0x49b9e9=_0x2e76f6[_0x25e0ba(0x202)][_0x25e0ba(0x1f2)]?.[_0x25e0ba(0x1b4)]||0x0,_0x47fbfb=_0x49b9e9>0x0?a36_0x54932d[_0x25e0ba(0x16e)]('\x20['+_0x49b9e9+'\x20activations]'):'';console[_0x25e0ba(0x220)]('\x0a'+a36_0x54932d['green'](_0x25e0ba(0x1a3))+'\x20'+_0x43b797+_0x47fbfb),console['error']('─'[_0x25e0ba(0x1a1)](0x3c)),_0x2e76f6['diff']&&console['error'](_0x2e76f6[_0x25e0ba(0x1d2)]),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c));}if(_0x304ea1['length']>0x0&&!_0x9a1cc5['journeysOnly'])for(const _0x3ce9db of _0x304ea1){const _0xf6c53c=_0x3ce9db['segmentFolderId']?_0x22d65e[_0x25e0ba(0x189)](_0x3ce9db['segmentFolderId'][_0x25e0ba(0x210)]())||'':'',_0x1296d9=_0xf6c53c?_0xf6c53c+'/'+_0x3ce9db[_0x25e0ba(0x179)]:_0x3ce9db['name'],_0x534423=_0x37b05f[_0x25e0ba(0x189)](_0x3ce9db['id'])||[],_0x108187=_0x534423['length']>0x0?a36_0x54932d[_0x25e0ba(0x16e)]('\x20['+_0x534423[_0x25e0ba(0x1b4)]+_0x25e0ba(0x1da)):'';console[_0x25e0ba(0x220)]('\x0a'+a36_0x54932d[_0x25e0ba(0x225)]('Delete\x20segment:')+'\x20'+_0x1296d9+_0x108187),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c));const _0x3cac8d=segmentWithActivationsToYaml(_0x3ce9db,_0x534423,undefined,_0x464344,_0x502bc7),_0x1f568f=segmentToYamlString(_0x3cac8d),_0x6ea09a=generateDiff(_0x1f568f,'');console[_0x25e0ba(0x220)](formatDiffWithColors(_0x6ea09a)),console['error']('─'[_0x25e0ba(0x1a1)](0x3c));}const _0x27572f=_0x91fd22['filter'](_0x250c74=>!_0x250c74[_0x25e0ba(0x20e)]&&_0x250c74[_0x25e0ba(0x1d2)]);if(_0x27572f['length']>0x0&&!_0x9a1cc5[_0x25e0ba(0x20f)])for(const _0x2cfc8 of _0x27572f){const _0x214b51=_0x2cfc8[_0x25e0ba(0x17f)]?_0x2cfc8[_0x25e0ba(0x17f)]+'/'+_0x2cfc8['yamlConfig'][_0x25e0ba(0x179)]:_0x2cfc8['yamlConfig'][_0x25e0ba(0x179)];console[_0x25e0ba(0x220)]('\x0a'+a36_0x54932d['yellow'](_0x25e0ba(0x187))+'\x20'+_0x214b51),console['error']('─'[_0x25e0ba(0x1a1)](0x3c)),console['error'](_0x2cfc8[_0x25e0ba(0x1d2)]),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c));}if(_0x479e32[_0x25e0ba(0x1b4)]>0x0)for(const _0x4b016a of _0x479e32){const _0x563b02=_0x4b016a[_0x25e0ba(0x17f)]?_0x4b016a['folderPath']+'/'+_0x4b016a[_0x25e0ba(0x202)][_0x25e0ba(0x179)]:_0x4b016a[_0x25e0ba(0x202)][_0x25e0ba(0x179)];console[_0x25e0ba(0x220)]('\x0a'+a36_0x54932d[_0x25e0ba(0x1c6)](_0x25e0ba(0x209))+'\x20'+_0x563b02),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c)),_0x4b016a[_0x25e0ba(0x1d2)]&&console['error'](_0x4b016a[_0x25e0ba(0x1d2)]),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c));}const _0x3eede5=_0x4ecc55['filter'](_0x26cf81=>!_0x26cf81[_0x25e0ba(0x20e)]&&_0x26cf81[_0x25e0ba(0x1d2)]);if(_0x3eede5[_0x25e0ba(0x1b4)]>0x0)for(const _0x55cb7a of _0x3eede5){const _0x2f98cd=_0x55cb7a[_0x25e0ba(0x17f)]?_0x55cb7a[_0x25e0ba(0x17f)]+'/'+_0x55cb7a['yamlConfig']['name']:_0x55cb7a[_0x25e0ba(0x202)][_0x25e0ba(0x179)];console[_0x25e0ba(0x220)]('\x0a'+a36_0x54932d[_0x25e0ba(0x1cd)](_0x25e0ba(0x25e))+'\x20'+_0x2f98cd),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c)),console[_0x25e0ba(0x220)](_0x55cb7a[_0x25e0ba(0x1d2)]),console[_0x25e0ba(0x220)]('─'[_0x25e0ba(0x1a1)](0x3c));}if(_0x3e0feb[_0x25e0ba(0x1b4)]>0x0)for(const _0x2d25f1 of _0x3e0feb){const _0x5bb6b5=_0x2d25f1[_0x25e0ba(0x1c8)]?_0x22d65e[_0x25e0ba(0x189)](_0x2d25f1['folderId'])||'':'',_0x1e341d=_0x5bb6b5?_0x5bb6b5+'/'+_0x2d25f1[_0x25e0ba(0x205)]:_0x2d25f1[_0x25e0ba(0x205)];console['error']('\x0a'+a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x23b))+'\x20'+_0x1e341d),console['error']('─'[_0x25e0ba(0x1a1)](0x3c)),console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x1b3))),console[_0x25e0ba(0x220)]('─'['repeat'](0x3c));}if(_0x9a1cc5[_0x25e0ba(0x248)])return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1cd)](_0x25e0ba(0x192))),0x0;const _0x26197a=_0x9a1cc5[_0x25e0ba(0x20f)]?![]:_0x108c12[_0x25e0ba(0x1b4)]>0x0||_0x8331ab[_0x25e0ba(0x1b4)]>0x0||_0x304ea1[_0x25e0ba(0x1b4)]>0x0,_0x464dde=_0x479e32[_0x25e0ba(0x1b4)]>0x0||_0x2ec4a2[_0x25e0ba(0x1b4)]>0x0||_0x3e0feb[_0x25e0ba(0x1b4)]>0x0,_0x4ecced=_0x9a1cc5['journeysOnly']?![]:_0x1e2c1e[_0x25e0ba(0x1b4)]>0x0,_0x23efde=_0x3408d0[_0x25e0ba(0x1b4)]>0x0;if(!_0x26197a&&!_0x464dde&&!_0x4ecced&&!_0x23efde){const _0x2bf2d0=_0x9a1cc5[_0x25e0ba(0x20f)]?_0x25e0ba(0x261):_0x25e0ba(0x1ea);console['error'](a36_0x54932d[_0x25e0ba(0x1c6)](_0x2bf2d0));if(_0x24ed3e&&_0x13b708[_0x25e0ba(0x1b4)]===0x1){const _0x2e801d=_0x13b708[0x0];if(_0x2e801d[_0x25e0ba(0x1bf)]?.['id']){const _0x178da0=getConsoleNextUrl(_0x9a1cc5[_0x25e0ba(0x1c0)],'/app/ps/'+_0x2d104e+_0x25e0ba(0x1bd)+_0x2e801d[_0x25e0ba(0x1bf)]['id']+_0x25e0ba(0x1ca));console['error']('\x20\x20'+a36_0x54932d['cyan'](_0x178da0));}}return 0x0;}const _0x37929d=_0x9a1cc5[_0x25e0ba(0x20f)]?_0x479e32[_0x25e0ba(0x1b4)]+_0x2ec4a2['length']+_0x3e0feb['length']+_0x3408d0['length']:_0x108c12[_0x25e0ba(0x1b4)]+_0x8331ab[_0x25e0ba(0x1b4)]+_0x304ea1[_0x25e0ba(0x1b4)]+_0x479e32[_0x25e0ba(0x1b4)]+_0x2ec4a2[_0x25e0ba(0x1b4)]+_0x3e0feb[_0x25e0ba(0x1b4)]+_0x3408d0[_0x25e0ba(0x1b4)]+_0x1e2c1e['length'];if(!_0x9a1cc5[_0x25e0ba(0x1bc)]&&_0x37929d>0x0){const _0x2f0ab8=await confirmKey(_0x25e0ba(0x217)+_0x37929d+_0x25e0ba(0x239));if(!_0x2f0ab8)return console[_0x25e0ba(0x220)](_0x25e0ba(0x258)),0x1;}for(const _0x354e18 of _0x3408d0){const _0x44e9ad=_0x354e18['split']('/'),_0x6aeea1=_0x44e9ad[_0x44e9ad[_0x25e0ba(0x1b4)]-0x1],_0x31845d=_0x44e9ad[_0x25e0ba(0x1fb)](0x0,-0x1)[_0x25e0ba(0x1af)]('/'),_0x470acf=_0x2ac595['get'](_0x31845d),_0x304d26={'name':_0x6aeea1,'parentFolderId':_0x470acf},_0x267652=await withSpinner(_0x25e0ba(0x180)+_0x354e18+_0x25e0ba(0x1c1),()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x215)](_0x2d104e,_0x304d26),{'verbose':_0x9a1cc5['verbose']});_0x2ac595['set'](_0x354e18,_0x267652[_0x25e0ba(0x1bb)]['id']),console[_0x25e0ba(0x220)](a36_0x54932d['blue'](_0x25e0ba(0x172)+_0x354e18+'\x27'));}let _0x396bcc=0x0,_0x5e3f71=0x0,_0x4b3f14=0x0,_0x32af90=0x0,_0x343e01=0x0,_0x4fde80=0x0;const _0x170880=new Map();for(const _0x51a4ff of _0x9a1cc5[_0x25e0ba(0x20f)]?[]:_0x91fd22){const _0x488b04=_0x51a4ff[_0x25e0ba(0x17f)]?_0x2ac595[_0x25e0ba(0x189)](_0x51a4ff[_0x25e0ba(0x17f)]):undefined;let _0x207355;try{if(_0x51a4ff[_0x25e0ba(0x20e)]){const _0x3a5227=yamlToCreateRequest(_0x51a4ff['yamlConfig'],_0x488b04),_0x418026=await withSpinner(_0x25e0ba(0x1ec)+_0x51a4ff[_0x25e0ba(0x202)]['name']+_0x25e0ba(0x1c1),()=>_0x5793b9['segment'][_0x25e0ba(0x16d)](_0x2d104e,_0x3a5227),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]});_0x207355=_0x418026[_0x25e0ba(0x1bb)]['id'],_0x170880[_0x25e0ba(0x21a)](_0x51a4ff['yamlConfig'][_0x25e0ba(0x179)],_0x207355),console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1c6)](_0x25e0ba(0x1a9)+_0x51a4ff['yamlConfig'][_0x25e0ba(0x179)]+'\x27')),_0x396bcc++;}else{if(_0x51a4ff[_0x25e0ba(0x256)]){const _0x2798cb=yamlToUpdateRequest(_0x51a4ff['yamlConfig']);_0x488b04!==_0x51a4ff['existingSegment']?.[_0x25e0ba(0x16f)]&&(_0x2798cb[_0x25e0ba(0x16f)]=_0x488b04?parseInt(_0x488b04,0xa):undefined),await withSpinner('Updating\x20segment\x20\x27'+_0x51a4ff[_0x25e0ba(0x202)][_0x25e0ba(0x179)]+_0x25e0ba(0x1c1),()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x1f1)](_0x2d104e,_0x51a4ff[_0x25e0ba(0x17b)]['id'],_0x2798cb),{'verbose':_0x9a1cc5['verbose']}),_0x207355=_0x51a4ff[_0x25e0ba(0x17b)]['id'],console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1cd)]('✔\x20Updated\x20segment\x20\x27'+_0x51a4ff[_0x25e0ba(0x202)][_0x25e0ba(0x179)]+'\x27')),_0x5e3f71++;}else _0x207355=_0x51a4ff[_0x25e0ba(0x17b)]['id'];}}catch(_0x135110){const _0x37833f=isHttp400Error(_0x135110),_0x4880d2=_0x37833f?ErrorCode[_0x25e0ba(0x24d)]:ErrorCode[_0x25e0ba(0x1a5)],_0x2dec39=getErrorMessage(_0x135110);throw new SDKError(_0x4880d2,_0x25e0ba(0x18e)+(_0x51a4ff[_0x25e0ba(0x20e)]?_0x25e0ba(0x226):_0x25e0ba(0x24b))+_0x25e0ba(0x213)+_0x51a4ff[_0x25e0ba(0x1a4)]+'\x0a\x20\x20'+_0x2dec39,_0x135110);}for(const _0x98c0e8 of _0x51a4ff[_0x25e0ba(0x1e5)]){try{if(_0x98c0e8['type']===_0x25e0ba(0x226)&&_0x98c0e8[_0x25e0ba(0x1ae)]){const _0x284423=yamlActivationToCreateRequest(_0x98c0e8['yamlActivation'],_0x1516f5,_0x5b7934);await withSpinner('Creating\x20activation\x20\x27'+_0x98c0e8[_0x25e0ba(0x179)]+_0x25e0ba(0x1c1),()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x22b)](_0x2d104e,_0x207355,_0x284423),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]}),console[_0x25e0ba(0x220)](a36_0x54932d['green'](_0x25e0ba(0x228)+_0x98c0e8['name']+'\x27')),_0x32af90++;}else{if(_0x98c0e8[_0x25e0ba(0x231)]==='update'&&_0x98c0e8[_0x25e0ba(0x1ae)]&&_0x98c0e8['existingActivation']){const _0x4f9055=yamlActivationToUpdateRequest(_0x98c0e8[_0x25e0ba(0x1ae)],_0x1516f5,_0x5b7934);await withSpinner(_0x25e0ba(0x185)+_0x98c0e8[_0x25e0ba(0x179)]+_0x25e0ba(0x1c1),()=>_0x5793b9[_0x25e0ba(0x1e7)]['updateActivation'](_0x2d104e,_0x207355,_0x98c0e8[_0x25e0ba(0x203)]['id'],_0x4f9055),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]}),console['error'](a36_0x54932d['yellow'](_0x25e0ba(0x1b2)+_0x98c0e8[_0x25e0ba(0x179)]+'\x27')),_0x343e01++;}else _0x98c0e8[_0x25e0ba(0x231)]===_0x25e0ba(0x1a6)&&_0x98c0e8[_0x25e0ba(0x203)]&&(await withSpinner('Deleting\x20activation\x20\x27'+_0x98c0e8['name']+'\x27...',()=>_0x5793b9['segment']['deleteActivation'](_0x2d104e,_0x207355,_0x98c0e8['existingActivation']['id']),{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]}),console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x225)](_0x25e0ba(0x171)+_0x98c0e8[_0x25e0ba(0x179)]+'\x27')),_0x4fde80++);}}catch(_0x19e25d){const _0x26eda4=isHttp400Error(_0x19e25d),_0xdfd46e=_0x26eda4?ErrorCode[_0x25e0ba(0x1c3)]:ErrorCode[_0x25e0ba(0x22a)],_0x2bea05=getErrorMessage(_0x19e25d);throw new SDKError(_0xdfd46e,_0x25e0ba(0x18e)+_0x98c0e8[_0x25e0ba(0x231)]+_0x25e0ba(0x18d)+_0x98c0e8['name']+_0x25e0ba(0x255)+_0x51a4ff[_0x25e0ba(0x1a4)]+'\x0a\x20\x20'+_0x2bea05,_0x19e25d);}}}for(const _0x58fa97 of _0x9a1cc5[_0x25e0ba(0x20f)]?[]:_0x304ea1){await withSpinner(_0x25e0ba(0x181)+_0x58fa97[_0x25e0ba(0x179)]+'\x27...',()=>_0x5793b9[_0x25e0ba(0x1e7)][_0x25e0ba(0x19a)](_0x58fa97['id']),{'verbose':_0x9a1cc5['verbose']}),console[_0x25e0ba(0x220)](a36_0x54932d['red'](_0x25e0ba(0x1f5)+_0x58fa97[_0x25e0ba(0x179)]+'\x27')),_0x4b3f14++;}let _0x5495d0=0x0,_0x2af5da=0x0,_0x394fa4=0x0;const _0x427c03=new Map(_0x10252d);for(const _0x35bcae of _0x91fd22){_0x35bcae[_0x25e0ba(0x20e)]&&_0x170880[_0x25e0ba(0x21f)](_0x35bcae['yamlConfig'][_0x25e0ba(0x179)])&&_0x427c03['set'](_0x35bcae[_0x25e0ba(0x202)]['name'],_0x170880[_0x25e0ba(0x189)](_0x35bcae[_0x25e0ba(0x202)][_0x25e0ba(0x179)]));}if(_0x4ecc55[_0x25e0ba(0x1b4)]>0x0){const _0x4b53d5=await withQuerySpinner(_0x25e0ba(0x20d),async _0x42162c=>{const _0x42653d=_0x25e0ba,_0x58d8a6=[];let _0x3e5cd3=0x0;const _0x14bc96=0x5;for(let _0x28ea29=0x0;_0x28ea29<_0x4ecc55['length'];_0x28ea29+=_0x14bc96){const _0x566315=_0x4ecc55['slice'](_0x28ea29,_0x28ea29+_0x14bc96),_0x588d99=await Promise[_0x42653d(0x197)](_0x566315[_0x42653d(0x1b0)](async _0x588c1e=>{const _0x239b85=_0x42653d;if(!_0x588c1e[_0x239b85(0x20e)]&&!_0x588c1e[_0x239b85(0x256)])return{'action':_0x239b85(0x25b),'name':_0x588c1e[_0x239b85(0x202)][_0x239b85(0x179)],'journeyId':_0x588c1e[_0x239b85(0x1bf)]?.['id']};const _0x14fc5c=_0x588c1e[_0x239b85(0x17f)]?_0x2ac595[_0x239b85(0x189)](_0x588c1e['folderPath']):undefined,_0x1ff13d=_0x588c1e['isNew']?'Creating':_0x239b85(0x183);_0x42162c[_0x239b85(0x1d4)](_0x1ff13d+_0x239b85(0x207)+_0x588c1e[_0x239b85(0x202)][_0x239b85(0x179)]+'\x27');const _0x2246a6=new Map(),_0x4de172=new Map(),_0x50ba04=new Map(),_0x1e6f5d={'resolveSegmentId':async _0x4c94be=>{const _0x3f0b31=_0x239b85,_0x31f1c7=_0x427c03[_0x3f0b31(0x189)](_0x4c94be);if(!_0x31f1c7)throw new SDKError(ErrorCode[_0x3f0b31(0x1e3)],_0x3f0b31(0x1ba)+_0x4c94be+'\x20(referenced\x20in\x20journey\x20'+_0x588c1e[_0x3f0b31(0x202)][_0x3f0b31(0x179)]+')');return _0x31f1c7;},'resolveEmbeddedSegmentId':async(_0x47603a,_0x38570a)=>{const _0x233c3f=_0x239b85,_0x446a6a=_0x427c03[_0x233c3f(0x189)](_0x47603a);if(_0x446a6a)return _0x446a6a;const _0x5a72e7=_0xfee852[_0x233c3f(0x216)](_0x12add8=>_0x12add8[_0x233c3f(0x179)]===_0x47603a);if(_0x5a72e7)return _0x427c03[_0x233c3f(0x21a)](_0x47603a,_0x5a72e7['id']),_0x5a72e7['id'];if(_0x588c1e['isNew']){const _0x4e5d57=_0x588c1e[_0x233c3f(0x202)]['stages']||_0x588c1e['yamlConfig']['journeys']?.[0x0]?.[_0x233c3f(0x247)]||[];let _0x262988=_0x233c3f(0x214),_0x444684=_0x47603a;for(const _0x5e44ba of _0x4e5d57){if(_0x5e44ba[_0x233c3f(0x199)]?.[_0x233c3f(0x1e7)]===_0x47603a){_0x262988=_0x5e44ba[_0x233c3f(0x179)],_0x444684=_0x5e44ba[_0x233c3f(0x199)]['name']||_0x47603a;break;}}return _0x4de172[_0x233c3f(0x21a)](_0x47603a,{'definition':_0x38570a,'stageName':_0x262988,'criteriaName':_0x444684}),createPendingSegmentId(_0x47603a);}const _0x170af8=_0x588c1e[_0x233c3f(0x1bf)]?.['id'];if(!_0x170af8)throw new SDKError(ErrorCode[_0x233c3f(0x1ac)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x472bc4=_0x233c3f(0x251)+crypto[_0x233c3f(0x245)]();try{const _0x4a56e4=await _0x5793b9[_0x233c3f(0x1e7)][_0x233c3f(0x20b)]({'name':_0x472bc4,'description':_0x38570a[_0x233c3f(0x23e)]||_0x233c3f(0x25d)+_0x47603a,'journeyId':_0x170af8,'rule':yamlRuleToApi(_0x38570a[_0x233c3f(0x20c)],!![]),'countPopulation':!![],'parentFolderId':_0x17d9ba||'','audienceId':_0x2d104e});return _0x9a1cc5[_0x233c3f(0x1f9)]&&console[_0x233c3f(0x220)](_0x233c3f(0x1b8)+_0x47603a+_0x233c3f(0x169)+_0x472bc4+_0x233c3f(0x1d7)+_0x4a56e4),_0x427c03['set'](_0x47603a,_0x4a56e4),_0x4a56e4;}catch(_0x55e7d6){throw new SDKError(ErrorCode[_0x233c3f(0x1a5)],_0x233c3f(0x1eb)+_0x47603a+_0x233c3f(0x1c5)+getErrorMessage(_0x55e7d6),_0x55e7d6);}},'resolveActivationId':async _0x168e0c=>{const _0x17f557=_0x239b85,_0xa8be23=_0x2246a6[_0x17f557(0x189)](_0x168e0c);if(_0xa8be23)return _0xa8be23;if(_0x588c1e[_0x17f557(0x1bf)]){const _0x3286a9=await _0x5793b9['journey'][_0x17f557(0x1ad)](_0x588c1e[_0x17f557(0x1bf)]['id']),_0x20a25c=_0x3286a9['find'](_0x4997bb=>_0x4997bb[_0x17f557(0x194)][_0x17f557(0x16a)]?.[_0x17f557(0x179)]===_0x168e0c);if(_0x20a25c)return _0x2246a6[_0x17f557(0x21a)](_0x168e0c,_0x20a25c['id']),_0x20a25c['id'];}throw new SDKError(ErrorCode[_0x17f557(0x22f)],_0x17f557(0x1d9)+_0x168e0c+'\x20(referenced\x20in\x20journey\x20'+_0x588c1e[_0x17f557(0x202)]['name']+_0x17f557(0x234)+_0x17f557(0x211));},'resolveEmbeddedActivationId':async(_0x1ad973,_0x3464d4)=>{const _0x4f8aa3=_0x239b85,_0x25228a=_0x2246a6[_0x4f8aa3(0x189)](_0x1ad973);if(_0x25228a)return _0x25228a;if(_0x588c1e['isNew'])return _0x50ba04[_0x4f8aa3(0x21a)](_0x1ad973,_0x3464d4),createPendingActivationId(_0x1ad973);if(_0x588c1e['existingJourney']){const _0x2ecb8a=await _0x5793b9[_0x4f8aa3(0x1e1)]['listActivations'](_0x588c1e[_0x4f8aa3(0x1bf)]['id']),_0x374c77=_0x2ecb8a['find'](_0x241793=>_0x241793[_0x4f8aa3(0x194)]['activationParams']?.[_0x4f8aa3(0x179)]===_0x3464d4[_0x4f8aa3(0x179)]);if(_0x374c77)return _0x2246a6[_0x4f8aa3(0x21a)](_0x1ad973,_0x374c77['id']),_0x374c77['id'];try{const _0x2c37cb=yamlActivationToCreateRequest(_0x3464d4,_0x1516f5,_0x5b7934),_0x50b08f=await _0x5793b9[_0x4f8aa3(0x1e1)][_0x4f8aa3(0x22b)](_0x588c1e[_0x4f8aa3(0x1bf)]['id'],_0x2c37cb);return _0x9a1cc5['verbose']&&console['error'](_0x4f8aa3(0x233)+_0x1ad973+_0x4f8aa3(0x222)+_0x50b08f['id']),_0x2246a6[_0x4f8aa3(0x21a)](_0x1ad973,_0x50b08f['id']),_0x50b08f['id'];}catch(_0x5c58e4){throw new SDKError(ErrorCode[_0x4f8aa3(0x260)],'Failed\x20to\x20create\x20embedded\x20activation\x20\x27'+_0x1ad973+_0x4f8aa3(0x1c5)+getErrorMessage(_0x5c58e4),_0x5c58e4);}}throw new SDKError(ErrorCode[_0x4f8aa3(0x1ac)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x459bdc=>{const _0x3e3c04=_0x239b85;try{return await _0x5793b9[_0x3e3c04(0x1e1)][_0x3e3c04(0x224)](_0x2d104e,_0x459bdc);}catch(_0x1d0aa6){throw new SDKError(ErrorCode[_0x3e3c04(0x22f)],'Journey\x20\x27'+_0x459bdc+_0x3e3c04(0x1be)+_0x588c1e[_0x3e3c04(0x202)][_0x3e3c04(0x179)]+'\x27)',_0x1d0aa6);}},'resolveStageId':async(_0x32d0a8,_0x5e5fb7)=>{const _0x5a8ed9=_0x239b85,_0x2d92ca=await _0x5793b9[_0x5a8ed9(0x1e1)]['getJourney'](_0x32d0a8),_0x5df7d0=_0x2d92ca[_0x5a8ed9(0x194)][_0x5a8ed9(0x238)][_0x5a8ed9(0x216)](_0x3ad76a=>_0x3ad76a[_0x5a8ed9(0x179)][_0x5a8ed9(0x176)]()===_0x5e5fb7[_0x5a8ed9(0x176)]());if(!_0x5df7d0?.['id'])throw new SDKError(ErrorCode[_0x5a8ed9(0x22f)],_0x5a8ed9(0x1ed)+_0x5e5fb7+_0x5a8ed9(0x259)+(_0x2d92ca[_0x5a8ed9(0x194)]['journeyBundleName']||_0x2d92ca[_0x5a8ed9(0x194)][_0x5a8ed9(0x179)])+'\x27');return _0x5df7d0['id'];}};try{const _0x1a4548=await a36_0x18f4eb(_0x588c1e[_0x239b85(0x202)],_0x2d104e,_0x1e6f5d),_0x557596=_0x14fc5c||_0x17d9ba;_0x557596&&(_0x1a4548['relationships']={'parentFolder':{'data':{'id':_0x557596,'type':_0x239b85(0x242)}}});if(_0x588c1e[_0x239b85(0x20e)]){if(_0x4de172[_0x239b85(0x240)]>0x0||_0x50ba04['size']>0x0){const _0x2f69a8=JSON[_0x239b85(0x177)](JSON[_0x239b85(0x246)](_0x1a4548));ensureJourneyDefaults(_0x2f69a8[_0x239b85(0x194)]);for(const _0x5aaf8c of _0x2f69a8[_0x239b85(0x194)][_0x239b85(0x238)]){_0x5aaf8c[_0x239b85(0x204)]?.[_0x239b85(0x252)]&&isPendingSegmentId(_0x5aaf8c[_0x239b85(0x204)][_0x239b85(0x252)])&&delete _0x5aaf8c[_0x239b85(0x204)];if(_0x5aaf8c['steps'])for(const _0x199855 of Object[_0x239b85(0x21d)](_0x5aaf8c['steps'])){const _0xfdbf7e=_0x5aaf8c[_0x239b85(0x1b7)][_0x199855];_0xfdbf7e[_0x239b85(0x231)]===_0x239b85(0x1a0)&&_0xfdbf7e['journeyActivationStepId']&&isPendingActivationId(_0xfdbf7e[_0x239b85(0x24a)])&&(_0xfdbf7e[_0x239b85(0x24a)]='');if(_0xfdbf7e[_0x239b85(0x231)]===_0x239b85(0x1f4)&&_0xfdbf7e[_0x239b85(0x23d)])for(const _0x19499f of _0xfdbf7e[_0x239b85(0x23d)]){_0x19499f[_0x239b85(0x252)]&&isPendingSegmentId(_0x19499f[_0x239b85(0x252)])&&(_0x19499f['segmentId']='');}}}_0x9a1cc5[_0x239b85(0x1f9)]&&console[_0x239b85(0x220)](_0x239b85(0x1cb)+JSON['stringify'](_0x2f69a8,null,0x2));const _0x510261=await _0x5793b9[_0x239b85(0x1e1)][_0x239b85(0x226)](_0x2f69a8),_0x20f4f9=_0x510261['id'],_0x1d4560=new Map();for(const _0x3de940 of _0x510261[_0x239b85(0x194)][_0x239b85(0x238)]){_0x1d4560[_0x239b85(0x21a)](_0x3de940[_0x239b85(0x179)][_0x239b85(0x176)](),_0x3de940['id']);}const _0x19c074=new Map();for(const [_0x391ede,{definition:_0x1fb793,criteriaName:_0x83a3fb}]of _0x4de172){const _0x2ea868=generateJourneyLocalName(_0x83a3fb)||_0x239b85(0x251)+crypto[_0x239b85(0x245)]();_0x9a1cc5[_0x239b85(0x1f9)]&&console[_0x239b85(0x220)](_0x239b85(0x1e4)+_0x391ede+_0x239b85(0x169)+_0x2ea868+_0x239b85(0x1db)+_0x20f4f9);const _0x5157a3=await _0x5793b9['segment'][_0x239b85(0x20b)]({'name':_0x2ea868,'description':_0x1fb793['description']||_0x239b85(0x25d)+_0x391ede,'journeyId':_0x20f4f9,'rule':yamlRuleToApi(_0x1fb793[_0x239b85(0x20c)],!![]),'countPopulation':!![],'parentFolderId':_0x557596||'','audienceId':_0x2d104e});_0x19c074['set'](_0x391ede,_0x5157a3),_0x427c03['set'](_0x391ede,_0x5157a3),_0x9a1cc5[_0x239b85(0x1f9)]&&console[_0x239b85(0x220)](_0x239b85(0x1b8)+_0x391ede+_0x239b85(0x222)+_0x5157a3);}const _0x59200a=new Map();for(const [_0x3b49b9,_0x4d06d7]of _0x50ba04){_0x9a1cc5['verbose']&&console['error'](_0x239b85(0x1a7)+_0x3b49b9+'\x27\x20with\x20journeyId:\x20'+_0x20f4f9);try{const _0x227883=yamlActivationToCreateRequest(_0x4d06d7,_0x1516f5,_0x5b7934),_0x50d15f=await _0x5793b9[_0x239b85(0x1e1)][_0x239b85(0x22b)](_0x20f4f9,_0x227883);_0x59200a[_0x239b85(0x21a)](_0x3b49b9,_0x50d15f['id']),_0x2246a6[_0x239b85(0x21a)](_0x3b49b9,_0x50d15f['id']),_0x9a1cc5[_0x239b85(0x1f9)]&&console[_0x239b85(0x220)](_0x239b85(0x233)+_0x3b49b9+_0x239b85(0x222)+_0x50d15f['id']);}catch(_0x184a10){throw new SDKError(ErrorCode[_0x239b85(0x260)],_0x239b85(0x1e8)+_0x3b49b9+'\x27:\x20'+getErrorMessage(_0x184a10),_0x184a10);}}const _0x402fcd=JSON[_0x239b85(0x177)](JSON['stringify'](_0x1a4548));_0x402fcd['id']=_0x20f4f9,ensureJourneyDefaults(_0x402fcd[_0x239b85(0x194)]);for(const _0x55c41a of _0x402fcd[_0x239b85(0x194)][_0x239b85(0x238)]){const _0x35725d=_0x1d4560[_0x239b85(0x189)](_0x55c41a[_0x239b85(0x179)][_0x239b85(0x176)]());_0x35725d&&(_0x55c41a['id']=_0x35725d);if(_0x55c41a[_0x239b85(0x204)]?.[_0x239b85(0x252)]&&isPendingSegmentId(_0x55c41a['entryCriteria']['segmentId'])){const _0x485534=extractPendingSegmentName(_0x55c41a[_0x239b85(0x204)][_0x239b85(0x252)]),_0x4a42df=_0x19c074[_0x239b85(0x189)](_0x485534);_0x4a42df&&(_0x55c41a[_0x239b85(0x204)][_0x239b85(0x252)]=_0x4a42df);}if(_0x55c41a['steps']){const _0x38e388=_0x124748=>_0x1a4548[_0x239b85(0x194)][_0x239b85(0x238)]['find'](_0x58a66b=>_0x58a66b[_0x239b85(0x179)][_0x239b85(0x176)]()===_0x55c41a['name']['toLowerCase']())?.['steps']?.[_0x124748];for(const _0x32558f of Object[_0x239b85(0x21d)](_0x55c41a[_0x239b85(0x1b7)])){const _0x4d2878=_0x55c41a['steps'][_0x32558f],_0x48cbb8=_0x38e388(_0x32558f);if(_0x4d2878[_0x239b85(0x231)]===_0x239b85(0x1a0)&&_0x4d2878[_0x239b85(0x24a)]&&(isPendingActivationId(_0x4d2878[_0x239b85(0x24a)])||_0x4d2878['journeyActivationStepId']==='')){if(_0x48cbb8?.[_0x239b85(0x24a)]&&isPendingActivationId(_0x48cbb8[_0x239b85(0x24a)])){const _0x5221dd=extractPendingActivationName(_0x48cbb8[_0x239b85(0x24a)]),_0x2c6740=_0x59200a['get'](_0x5221dd);_0x2c6740&&(_0x4d2878[_0x239b85(0x24a)]=_0x2c6740);}}if(_0x4d2878['type']===_0x239b85(0x1f4)&&_0x4d2878['branches']&&_0x48cbb8?.[_0x239b85(0x23d)])for(let _0x29826b=0x0;_0x29826b<_0x4d2878[_0x239b85(0x23d)][_0x239b85(0x1b4)];_0x29826b++){const _0x58f753=_0x4d2878['branches'][_0x29826b],_0x369b97=_0x48cbb8[_0x239b85(0x23d)][_0x29826b];if(_0x369b97?.[_0x239b85(0x252)]&&isPendingSegmentId(_0x369b97[_0x239b85(0x252)])){const _0x586f91=extractPendingSegmentName(_0x369b97[_0x239b85(0x252)]),_0x259b8a=_0x19c074[_0x239b85(0x189)](_0x586f91);_0x259b8a&&(_0x58f753[_0x239b85(0x252)]=_0x259b8a);}}}}}return _0x9a1cc5[_0x239b85(0x1f9)]&&console['error'](_0x239b85(0x19e)+JSON[_0x239b85(0x246)](_0x402fcd,null,0x2)),await _0x5793b9[_0x239b85(0x1e1)][_0x239b85(0x24b)](_0x20f4f9,_0x402fcd),{'action':_0x239b85(0x20a),'name':_0x588c1e['yamlConfig'][_0x239b85(0x179)],'journeyId':_0x20f4f9};}else{ensureJourneyDefaults(_0x1a4548['attributes']);_0x9a1cc5[_0x239b85(0x1f9)]&&console['error'](_0x239b85(0x1e6)+JSON[_0x239b85(0x246)](_0x1a4548,null,0x2));const _0x5f54df=await _0x5793b9[_0x239b85(0x1e1)][_0x239b85(0x226)](_0x1a4548);return{'action':_0x239b85(0x20a),'name':_0x588c1e['yamlConfig'][_0x239b85(0x179)],'journeyId':_0x5f54df['id']};}}else{if(_0x588c1e[_0x239b85(0x256)]&&_0x588c1e['existingJourney'])return ensureJourneyDefaults(_0x1a4548[_0x239b85(0x194)]),await _0x5793b9[_0x239b85(0x1e1)]['update'](_0x588c1e['existingJourney']['id'],_0x1a4548),{'action':_0x239b85(0x1e0),'name':_0x588c1e[_0x239b85(0x202)]['name'],'journeyId':_0x588c1e['existingJourney']['id']};}return{'action':_0x239b85(0x25b),'name':_0x588c1e[_0x239b85(0x202)]['name'],'journeyId':_0x588c1e[_0x239b85(0x1bf)]?.['id']};}catch(_0x43d982){const _0x195724=isHttp400Error(_0x43d982),_0x425968=_0x195724?ErrorCode[_0x239b85(0x1d3)]:ErrorCode[_0x239b85(0x260)],_0x5a6b5f=getErrorMessage(_0x43d982);throw new SDKError(_0x425968,_0x239b85(0x18e)+(_0x588c1e[_0x239b85(0x20e)]?_0x239b85(0x226):_0x239b85(0x24b))+_0x239b85(0x182)+_0x588c1e[_0x239b85(0x1a4)]+'\x0a\x20\x20'+_0x5a6b5f,_0x43d982);}}));_0x58d8a6[_0x42653d(0x1a2)](..._0x588d99),_0x3e5cd3+=_0x566315[_0x42653d(0x1b4)],_0x42162c[_0x42653d(0x227)]('('+_0x3e5cd3+'/'+_0x4ecc55[_0x42653d(0x1b4)]+')');}return _0x58d8a6;},{'verbose':_0x9a1cc5[_0x25e0ba(0x1f9)]});for(const _0x2a27eb of _0x4b53d5[_0x25e0ba(0x1bb)]){if(_0x2a27eb[_0x25e0ba(0x1f6)]==='created')console['error'](a36_0x54932d[_0x25e0ba(0x1c6)](_0x25e0ba(0x249)+_0x2a27eb[_0x25e0ba(0x179)]+'\x27')),_0x5495d0++;else _0x2a27eb[_0x25e0ba(0x1f6)]==='updated'&&(console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1cd)](_0x25e0ba(0x241)+_0x2a27eb[_0x25e0ba(0x179)]+'\x27')),_0x2af5da++);}if(_0x24ed3e&&_0x4b53d5['data'][_0x25e0ba(0x1b4)]===0x1){const _0x33fd09=_0x4b53d5[_0x25e0ba(0x1bb)][0x0];if(_0x33fd09['journeyId']){const _0x250ebe=getConsoleNextUrl(_0x9a1cc5['site'],'/app/ps/'+_0x2d104e+_0x25e0ba(0x1bd)+_0x33fd09[_0x25e0ba(0x262)]+_0x25e0ba(0x1ca));console[_0x25e0ba(0x220)]('\x20\x20'+a36_0x54932d[_0x25e0ba(0x1d5)](_0x250ebe));}}}for(const _0x57761a of _0x3e0feb){console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1cd)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x57761a[_0x25e0ba(0x205)])),_0x394fa4++;}const _0x2f5cb5=[];if(_0x396bcc>0x0)_0x2f5cb5[_0x25e0ba(0x1a2)](_0x396bcc+_0x25e0ba(0x195));if(_0x5e3f71>0x0)_0x2f5cb5['push'](_0x5e3f71+_0x25e0ba(0x243));if(_0x4b3f14>0x0)_0x2f5cb5[_0x25e0ba(0x1a2)](_0x4b3f14+_0x25e0ba(0x1b5));const _0x9c7767=[];if(_0x5495d0>0x0)_0x9c7767[_0x25e0ba(0x1a2)](_0x5495d0+_0x25e0ba(0x195));if(_0x2af5da>0x0)_0x9c7767[_0x25e0ba(0x1a2)](_0x2af5da+_0x25e0ba(0x243));if(_0x394fa4>0x0)_0x9c7767['push'](_0x394fa4+_0x25e0ba(0x1b5));const _0x125c25=[];if(_0x32af90>0x0)_0x125c25[_0x25e0ba(0x1a2)](_0x32af90+_0x25e0ba(0x195));if(_0x343e01>0x0)_0x125c25[_0x25e0ba(0x1a2)](_0x343e01+_0x25e0ba(0x243));if(_0x4fde80>0x0)_0x125c25[_0x25e0ba(0x1a2)](_0x4fde80+'\x20deleted');return console[_0x25e0ba(0x220)](a36_0x54932d[_0x25e0ba(0x1c6)](_0x25e0ba(0x254))),_0x2f5cb5['length']>0x0&&!_0x9a1cc5[_0x25e0ba(0x20f)]&&console['error'](_0x25e0ba(0x21b)+_0x2f5cb5[_0x25e0ba(0x1af)](',\x20')),_0x9c7767[_0x25e0ba(0x1b4)]>0x0&&console[_0x25e0ba(0x220)](_0x25e0ba(0x263)+_0x9c7767['join'](',\x20')),_0x125c25[_0x25e0ba(0x1b4)]>0x0&&!_0x9a1cc5[_0x25e0ba(0x20f)]&&console[_0x25e0ba(0x220)]('\x20\x20Activations:\x20'+_0x125c25[_0x25e0ba(0x1af)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0xad195a){const _0x550775=a36_0x59c5e1,_0x5bf768=new Map(),_0x5b5192=new Map();for(const _0x34a354 of _0xad195a){_0x5b5192[_0x550775(0x21a)](_0x34a354['id'],_0x34a354);}const _0xfc537f=new Set();for(const _0x963a06 of _0xad195a){!_0x963a06[_0x550775(0x235)]&&_0xfc537f[_0x550775(0x232)](_0x963a06['id']);}function _0xc75d18(_0x12823b){const _0x5b1b0a=_0x550775;if(_0xfc537f[_0x5b1b0a(0x21f)](_0x12823b['id']))return'';if(_0x12823b[_0x5b1b0a(0x235)]){const _0x1e40d0=_0x5b5192[_0x5b1b0a(0x189)](_0x12823b['parentFolderId']);if(_0x1e40d0){const _0x1fe6cf=_0xc75d18(_0x1e40d0);return _0x1fe6cf?_0x1fe6cf+'/'+_0x12823b[_0x5b1b0a(0x179)]:_0x12823b[_0x5b1b0a(0x179)];}}return _0x12823b[_0x5b1b0a(0x179)];}for(const _0x188e44 of _0xad195a){const _0x44559d=_0xc75d18(_0x188e44);_0x5bf768['set'](_0x44559d,_0x188e44['id']);}return _0x5bf768;}function findYamlFiles(_0x2918e5){const _0xf57dc4=[];function _0x944a9c(_0x273dab){const _0x23aebd=a36_0x2d4a,_0x3b214c=readdirSync(_0x273dab,{'withFileTypes':!![]});for(const _0x568f60 of _0x3b214c){const _0x12944b=a36_0x475838[_0x23aebd(0x1af)](_0x273dab,_0x568f60[_0x23aebd(0x179)]);if(_0x568f60['isDirectory']())_0x944a9c(_0x12944b);else(_0x568f60[_0x23aebd(0x179)]['endsWith'](_0x23aebd(0x1c9))||_0x568f60[_0x23aebd(0x179)][_0x23aebd(0x175)](_0x23aebd(0x1fc)))&&_0xf57dc4[_0x23aebd(0x1a2)](_0x12944b);}}return _0x944a9c(_0x2918e5),_0xf57dc4;}function calculateActivationActions(_0x17674b,_0x5bba71,_0x57f11f,_0x1f4bb5){const _0x542d11=a36_0x59c5e1,_0x95a15f=[],_0x218fa1=new Map();for(const _0xb1abed of _0x5bba71){_0x218fa1[_0x542d11(0x21a)](_0xb1abed[_0x542d11(0x179)],_0xb1abed);}const _0x361b27=new Map();for(const _0x5821f8 of _0x17674b){_0x361b27[_0x542d11(0x21a)](_0x5821f8['name'],_0x5821f8);}for(const _0x36c200 of _0x17674b){const _0x44d174=_0x218fa1[_0x542d11(0x189)](_0x36c200[_0x542d11(0x179)]);if(!_0x44d174)_0x95a15f[_0x542d11(0x1a2)]({'type':_0x542d11(0x226),'name':_0x36c200[_0x542d11(0x179)],'yamlActivation':_0x36c200});else{const _0x12bfea=activationToYaml(_0x44d174,_0x57f11f,_0x1f4bb5),_0x39ba83=a36_0x147f4c['stringify'](_0x12bfea),_0x42d5e8=a36_0x147f4c[_0x542d11(0x246)](_0x36c200);_0x39ba83!==_0x42d5e8&&_0x95a15f[_0x542d11(0x1a2)]({'type':_0x542d11(0x24b),'name':_0x36c200[_0x542d11(0x179)],'yamlActivation':_0x36c200,'existingActivation':_0x44d174});}}for(const _0x5b475c of _0x5bba71){!_0x361b27[_0x542d11(0x21f)](_0x5b475c[_0x542d11(0x179)])&&_0x95a15f['push']({'type':'delete','name':_0x5b475c['name'],'existingActivation':_0x5b475c});}return _0x95a15f;}
@@ -1 +1 @@
1
- function a37_0xf4ec(_0x56d04c,_0x468b06){_0x56d04c=_0x56d04c-0xd9;const _0x461714=a37_0x4617();let _0xf4eca1=_0x461714[_0x56d04c];return _0xf4eca1;}const a37_0x1e12a5=a37_0xf4ec;(function(_0x5c5b3b,_0x543a80){const _0x3bae6e=a37_0xf4ec,_0x4185d5=_0x5c5b3b();while(!![]){try{const _0x11777f=-parseInt(_0x3bae6e(0xe2))/0x1+parseInt(_0x3bae6e(0xfc))/0x2+-parseInt(_0x3bae6e(0xdb))/0x3+parseInt(_0x3bae6e(0xf6))/0x4*(-parseInt(_0x3bae6e(0xf4))/0x5)+-parseInt(_0x3bae6e(0xee))/0x6*(parseInt(_0x3bae6e(0xe9))/0x7)+parseInt(_0x3bae6e(0xe3))/0x8*(parseInt(_0x3bae6e(0xf5))/0x9)+parseInt(_0x3bae6e(0xdd))/0xa;if(_0x11777f===_0x543a80)break;else _0x4185d5['push'](_0x4185d5['shift']());}catch(_0x531a20){_0x4185d5['push'](_0x4185d5['shift']());}}}(a37_0x4617,0x4f16a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a37_0x4617(){const _0x1ac9be=['7OIqcZG','Segment\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Updating\x20segment\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','2554008swgiHT','Resolved\x20folder\x20ID:\x20','data','updateSegmentById','description','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','50GHRZbU','36xGpdwG','9036mBCJpk','yellow','segment:update','kind','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segment','1131510koFTne','resolvePathToResource','name','\x27...','rule','segmentPath','INTERNAL','segmentName','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','folder','verbose','366156vWqaSG','segmentId','5350700ePISlt','error','Examples:','Resolving\x20folder\x20\x27','length','504677IcNSnG','596216Mlkcfo','resolveFolderId','execute','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','ruleFile','type'];a37_0x4617=function(){return _0x1ac9be;};return a37_0x4617();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a37_0x170c95 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a37_0x1e12a5(0xfe)]=a37_0x1e12a5(0xf8);[a37_0x1e12a5(0xf2)]='Update\x20existing\x20child\x20segment';async[a37_0x1e12a5(0xe5)](_0x38ce83){const _0x185092=a37_0x1e12a5;console['error'](a37_0x170c95[_0x185092(0xf7)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x185092(0xde)](a37_0x170c95[_0x185092(0xf7)](_0x185092(0xeb)));const {options:_0x55c2be,args:_0x5f9987,tdx:_0x59bc18}=_0x38ce83,_0x3f7786=_0x55c2be;if(_0x5f9987[_0x185092(0xe1)]===0x0)return console[_0x185092(0xde)](_0x185092(0xe6)),console[_0x185092(0xde)](_0x185092(0xfa)),console['error'](_0x185092(0xdf)),console[_0x185092(0xde)](_0x185092(0x105)),console[_0x185092(0xde)](_0x185092(0xed)),0x1;const _0xf2ef77=_0x5f9987[0x0],_0x9cfd1c=_0x55c2be[_0x185092(0x101)];let _0x5c6211=_0xf2ef77;_0x9cfd1c&&!_0xf2ef77['includes']('/')&&(_0x5c6211=_0x9cfd1c+'/'+_0xf2ef77,_0x3f7786[_0x185092(0xda)]&&console[_0x185092(0xde)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5c6211));const _0x3f937d=await withSpinner('Resolving\x20path\x20\x27'+_0x5c6211+_0x185092(0xff),()=>_0x59bc18[_0x185092(0xfb)][_0x185092(0xfd)](_0x5c6211),{'verbose':_0x3f7786['verbose']}),_0x10b8b9=_0x3f937d[_0x185092(0xf0)];_0x3f7786[_0x185092(0xda)]&&console[_0x185092(0xde)]('Resolved\x20type:\x20'+_0x10b8b9[_0x185092(0xe8)]);if(_0x10b8b9['type']!==_0x185092(0xfb))return console[_0x185092(0xde)]('Error:\x20Cannot\x20update\x20'+_0x10b8b9[_0x185092(0xe8)]+_0x185092(0xf3)),console[_0x185092(0xde)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x10b8b9[_0x185092(0xdc)])throw new SDKError(ErrorCode[_0x185092(0x102)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2b29b4=_0x10b8b9['parentId'],_0x4538e5=_0x10b8b9[_0x185092(0xdc)];_0x3f7786[_0x185092(0xda)]&&(console['error']('Parent\x20ID:\x20'+_0x2b29b4),console[_0x185092(0xde)](_0x185092(0xea)+_0x4538e5));let _0x18dfb9;if(_0x3f7786['folder']){const _0x5417e4=_0x3f7786[_0x185092(0xd9)],_0x18c53e=await withSpinner(_0x185092(0xe0)+_0x5417e4+_0x185092(0xff),()=>_0x59bc18[_0x185092(0xfb)][_0x185092(0xe4)](_0x2b29b4,_0x5417e4),{'verbose':_0x3f7786[_0x185092(0xda)]});_0x18dfb9=parseInt(_0x18c53e[_0x185092(0xf0)],0xa),_0x3f7786[_0x185092(0xda)]&&console[_0x185092(0xde)](_0x185092(0xef)+_0x18dfb9);}const _0x10c681=await loadJSONFromOptions(_0x3f7786[_0x185092(0x100)],_0x3f7786[_0x185092(0xe7)]),_0x290c2d={'name':_0x3f7786['name'],'description':_0x3f7786[_0x185092(0xf2)],'rule':_0x10c681,'kind':_0x3f7786[_0x185092(0xf9)]!==undefined?parseInt(_0x3f7786[_0x185092(0xf9)],0xa):undefined,'segmentFolderId':_0x18dfb9},_0x43f5ed=await withSpinner(_0x185092(0xec)+_0x10b8b9[_0x185092(0x103)]+'\x27...',()=>_0x59bc18[_0x185092(0xfb)][_0x185092(0xf1)](_0x2b29b4,_0x4538e5,_0x290c2d),{'verbose':_0x3f7786[_0x185092(0xda)]}),_0x2c3a37=_0x43f5ed[_0x185092(0xf0)];return console[_0x185092(0xde)]('✔\x20Updated\x20segment\x20\x27'+_0x2c3a37['name']+'\x27'),_0x5c6211!==_0xf2ef77&&console[_0x185092(0xde)](_0x185092(0x104)+_0x5c6211),await handleSDKOutput([_0x2c3a37],_0x3f7786),0x0;}}
1
+ const a37_0xa1831f=a37_0x42b8;(function(_0x3f4119,_0x5b3483){const _0x241665=a37_0x42b8,_0x5bab86=_0x3f4119();while(!![]){try{const _0x44c052=parseInt(_0x241665(0x20c))/0x1+-parseInt(_0x241665(0x202))/0x2+-parseInt(_0x241665(0x1f6))/0x3+-parseInt(_0x241665(0x1ff))/0x4+-parseInt(_0x241665(0x205))/0x5+-parseInt(_0x241665(0x212))/0x6*(-parseInt(_0x241665(0x1f4))/0x7)+parseInt(_0x241665(0x20b))/0x8*(parseInt(_0x241665(0x203))/0x9);if(_0x44c052===_0x5b3483)break;else _0x5bab86['push'](_0x5bab86['shift']());}catch(_0x3d68ae){_0x5bab86['push'](_0x5bab86['shift']());}}}(a37_0x393d,0x5418f));import{BaseCommand}from'./command.js';function a37_0x42b8(_0x4b5331,_0x29915e){_0x4b5331=_0x4b5331-0x1f2;const _0x393d3b=a37_0x393d();let _0x42b88f=_0x393d3b[_0x4b5331];return _0x42b88f;}import{handleSDKOutput}from'../utils/command-output.js';function a37_0x393d(){const _0x33e4ee=['error','Resolved\x20folder\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Examples:','rule','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','name','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Cannot\x20update\x20','includes','48524bGqovx','\x20\x20\x20Path:\x20','762036HTQFiQ','\x27...','Segment\x20ID:\x20','ruleFile','segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','INTERNAL','kind','type','513580nrSVeQ','folder','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','148174eIlAyA','63yNjqIZ','segmentName','1863505ifMRnP','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','yellow','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20path\x20\x27','1182536euFosW','41891SgrQEP','segmentId','✔\x20Updated\x20segment\x20\x27','description','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20relative\x20path\x20to:\x20','84xQbuCL','verbose','length'];a37_0x393d=function(){return _0x33e4ee;};return a37_0x393d();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a37_0x55be90 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a37_0xa1831f(0x21b)]='segment:update';[a37_0xa1831f(0x20f)]='Update\x20existing\x20child\x20segment';async['execute'](_0x39697d){const _0x2d5b49=a37_0xa1831f;console['error'](a37_0x55be90[_0x2d5b49(0x207)](_0x2d5b49(0x21a))),console[_0x2d5b49(0x215)](a37_0x55be90[_0x2d5b49(0x207)](_0x2d5b49(0x217)));const {options:_0x242027,args:_0x41c44c,tdx:_0x3b3369}=_0x39697d,_0x3af002=_0x242027;if(_0x41c44c[_0x2d5b49(0x214)]===0x0)return console[_0x2d5b49(0x215)](_0x2d5b49(0x209)),console[_0x2d5b49(0x215)](_0x2d5b49(0x201)),console[_0x2d5b49(0x215)](_0x2d5b49(0x218)),console[_0x2d5b49(0x215)](_0x2d5b49(0x206)),console[_0x2d5b49(0x215)](_0x2d5b49(0x1fb)),0x1;const _0xd1781e=_0x41c44c[0x0],_0x2755e7=_0x242027['segmentPath'];let _0x32349d=_0xd1781e;_0x2755e7&&!_0xd1781e[_0x2d5b49(0x1f3)]('/')&&(_0x32349d=_0x2755e7+'/'+_0xd1781e,_0x3af002[_0x2d5b49(0x213)]&&console[_0x2d5b49(0x215)](_0x2d5b49(0x211)+_0x32349d));const _0x147960=await withSpinner(_0x2d5b49(0x20a)+_0x32349d+'\x27...',()=>_0x3b3369['segment']['resolvePathToResource'](_0x32349d),{'verbose':_0x3af002[_0x2d5b49(0x213)]}),_0x594b33=_0x147960['data'];_0x3af002[_0x2d5b49(0x213)]&&console['error']('Resolved\x20type:\x20'+_0x594b33[_0x2d5b49(0x1fe)]);if(_0x594b33[_0x2d5b49(0x1fe)]!==_0x2d5b49(0x1fa))return console[_0x2d5b49(0x215)](_0x2d5b49(0x1f2)+_0x594b33[_0x2d5b49(0x1fe)]+_0x2d5b49(0x21c)),console['error'](_0x2d5b49(0x208)),0x1;if(!_0x594b33[_0x2d5b49(0x20d)])throw new SDKError(ErrorCode[_0x2d5b49(0x1fc)],_0x2d5b49(0x210));const _0x41f9be=_0x594b33['parentId'],_0x17bb87=_0x594b33[_0x2d5b49(0x20d)];_0x3af002['verbose']&&(console[_0x2d5b49(0x215)]('Parent\x20ID:\x20'+_0x41f9be),console[_0x2d5b49(0x215)](_0x2d5b49(0x1f8)+_0x17bb87));let _0x3089b2;if(_0x3af002[_0x2d5b49(0x200)]){const _0x4e5240=_0x3af002[_0x2d5b49(0x200)],_0x2a7955=await withSpinner('Resolving\x20folder\x20\x27'+_0x4e5240+_0x2d5b49(0x1f7),()=>_0x3b3369[_0x2d5b49(0x1fa)]['resolveFolderId'](_0x41f9be,_0x4e5240),{'verbose':_0x3af002[_0x2d5b49(0x213)]});_0x3089b2=parseInt(_0x2a7955['data'],0xa),_0x3af002['verbose']&&console[_0x2d5b49(0x215)](_0x2d5b49(0x216)+_0x3089b2);}const _0x321586=await loadJSONFromOptions(_0x3af002[_0x2d5b49(0x219)],_0x3af002[_0x2d5b49(0x1f9)]),_0x2e7b1a={'name':_0x3af002[_0x2d5b49(0x21b)],'description':_0x3af002['description'],'rule':_0x321586,'kind':_0x3af002[_0x2d5b49(0x1fd)]!==undefined?parseInt(_0x3af002['kind'],0xa):undefined,'segmentFolderId':_0x3089b2},_0x33734f=await withSpinner('Updating\x20segment\x20\x27'+_0x594b33[_0x2d5b49(0x204)]+_0x2d5b49(0x1f7),()=>_0x3b3369[_0x2d5b49(0x1fa)]['updateSegmentById'](_0x41f9be,_0x17bb87,_0x2e7b1a),{'verbose':_0x3af002[_0x2d5b49(0x213)]}),_0x54096c=_0x33734f['data'];return console[_0x2d5b49(0x215)](_0x2d5b49(0x20e)+_0x54096c[_0x2d5b49(0x21b)]+'\x27'),_0x32349d!==_0xd1781e&&console[_0x2d5b49(0x215)](_0x2d5b49(0x1f5)+_0x32349d),await handleSDKOutput([_0x54096c],_0x3af002),0x0;}}
@@ -1 +1 @@
1
- const a38_0x265aef=a38_0x5ea9;function a38_0x5ea9(_0xdfe84b,_0x526eb1){_0xdfe84b=_0xdfe84b-0x113;const _0x1fb4f7=a38_0x1fb4();let _0x5ea908=_0x1fb4f7[_0xdfe84b];return _0x5ea908;}(function(_0x2b789b,_0x4a2b24){const _0x52ba79=a38_0x5ea9,_0x5d6bcb=_0x2b789b();while(!![]){try{const _0xbe2f67=parseInt(_0x52ba79(0x119))/0x1*(parseInt(_0x52ba79(0x13f))/0x2)+parseInt(_0x52ba79(0x141))/0x3*(parseInt(_0x52ba79(0x11b))/0x4)+-parseInt(_0x52ba79(0x133))/0x5+parseInt(_0x52ba79(0x127))/0x6*(parseInt(_0x52ba79(0x12d))/0x7)+-parseInt(_0x52ba79(0x12f))/0x8*(parseInt(_0x52ba79(0x121))/0x9)+parseInt(_0x52ba79(0x12e))/0xa+-parseInt(_0x52ba79(0x118))/0xb;if(_0xbe2f67===_0x4a2b24)break;else _0x5d6bcb['push'](_0x5d6bcb['shift']());}catch(_0x443473){_0x5d6bcb['push'](_0x5d6bcb['shift']());}}}(a38_0x1fb4,0xb8d17));import{existsSync,statSync}from'fs';import a38_0x4a6e1b from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a38_0x1fb4(){const _0x1d0f1d=['Parent\x20ID:\x20','folderPath','parent_segment','site','42oSEXpv','6871500AWQIiZ','9904OIYKhJ','Site:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','resolvePathToResource','854340IVOXrs','error','verbose','config','red','segment','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','log','data','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','fullPath','15012XkKvqL','Folder\x20ID:\x20','956169CRgZSR','dim','execute','Examples:','type','slice','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','parentName','segmentPath','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','9530345FKcIKO','113rlSpMc','✔\x20Context\x20set\x20to:\x20','8gbnxGM','join','folderId','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Resolved\x20path\x20type:\x20','cyan','9117IQYpJN','length','green','name','isDirectory','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','875598pyGdav','segment:use'];a38_0x1fb4=function(){return _0x1d0f1d;};return a38_0x1fb4();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';import{findTdxConfig}from'../utils/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a38_0x265aef(0x124)]=a38_0x265aef(0x128);['description']=a38_0x265aef(0x114);async[a38_0x265aef(0x143)](_0x51a938){const _0x5728de=a38_0x265aef,{options:_0x5094d7,args:_0x4864f3,tdx:_0x5e533d}=_0x51a938;if(_0x4864f3['length']===0x0)return console[_0x5728de(0x134)](a38_0x4a6e1b[_0x5728de(0x137)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x5728de(0x134)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x5728de(0x134)](_0x5728de(0x144)),console[_0x5728de(0x134)](_0x5728de(0x139)),console[_0x5728de(0x134)](_0x5728de(0x13d)),console[_0x5728de(0x134)](_0x5728de(0x13c)),console[_0x5728de(0x134)](_0x5728de(0x117)),0x1;const _0x5ccfc2=_0x4864f3[0x0],_0x283525=_0x5094d7['session'];try{if(_0x5ccfc2==='/')return saveSessionContext({'segment_path':undefined},_0x283525),console[_0x5728de(0x13a)](a38_0x4a6e1b[_0x5728de(0x123)](_0x5728de(0x126))),0x0;if(existsSync(_0x5ccfc2)&&statSync(_0x5ccfc2)[_0x5728de(0x125)]()){let _0x52060b;try{_0x52060b=findTdxConfig(_0x5ccfc2);}catch{return console[_0x5728de(0x134)](a38_0x4a6e1b[_0x5728de(0x137)](_0x5728de(0x113)+_0x5ccfc2)),console[_0x5728de(0x134)](a38_0x4a6e1b['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x370bca=_0x52060b[_0x5728de(0x136)][_0x5728de(0x12b)];return saveSessionContext({'segment_path':_0x370bca,'parent_segment':_0x370bca},_0x283525),console[_0x5728de(0x13a)](a38_0x4a6e1b[_0x5728de(0x123)](_0x5728de(0x11a)+a38_0x4a6e1b['cyan'](_0x370bca))),0x0;}const _0x5dd9a3=_0x5094d7[_0x5728de(0x116)];let _0x22c306=_0x5ccfc2;const _0xc1ef4f=parsePath(_0x5ccfc2);if(!_0xc1ef4f['isAbsolute']){if(!_0x5dd9a3)return console['error'](a38_0x4a6e1b[_0x5728de(0x137)](_0x5728de(0x131))),console[_0x5728de(0x134)](a38_0x4a6e1b['cyan'](_0x5728de(0x11e))),0x1;if(_0x5ccfc2==='..'){const _0x15bfcf=_0x5dd9a3['split']('/')[_0x5728de(0x146)](0x0,-0x1)['join']('/');_0x22c306=_0x15bfcf||'/';}else _0x5ccfc2==='.'?_0x22c306=_0x5dd9a3:_0x22c306=_0x5dd9a3+'/'+_0x5ccfc2;_0x5094d7[_0x5728de(0x135)]&&console[_0x5728de(0x134)]('Resolved\x20relative\x20path\x20to:\x20'+_0x22c306);}if(_0x22c306==='/'||_0x22c306==='')return saveSessionContext({'segment_path':undefined},_0x283525),console[_0x5728de(0x13a)](a38_0x4a6e1b['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x22c306=normalizePath(_0x22c306);const _0x41a00b=parsePath(_0x22c306)['segments'];if(_0x41a00b[_0x5728de(0x122)]===0x0)return saveSessionContext({'segment_path':undefined},_0x283525),console[_0x5728de(0x13a)](a38_0x4a6e1b[_0x5728de(0x123)](_0x5728de(0x126))),0x0;_0x5094d7[_0x5728de(0x135)]&&(console[_0x5728de(0x134)](_0x5728de(0x130)+_0x5094d7[_0x5728de(0x12c)]),console[_0x5728de(0x134)]('Target\x20path:\x20'+_0x22c306));const _0x107840=await withSpinner('Resolving\x20path\x20\x27'+_0x22c306+'\x27...',()=>_0x5e533d[_0x5728de(0x138)][_0x5728de(0x132)](_0x22c306),{'verbose':_0x5094d7[_0x5728de(0x135)]}),_0x3e83f7=_0x107840[_0x5728de(0x13b)];_0x5094d7['verbose']&&(console[_0x5728de(0x134)](_0x5728de(0x11f)+_0x3e83f7['type']),console['error'](_0x5728de(0x129)+_0x3e83f7['parentId']),_0x3e83f7[_0x5728de(0x11d)]&&console[_0x5728de(0x134)](_0x5728de(0x140)+_0x3e83f7['folderId']));if(_0x3e83f7[_0x5728de(0x145)]==='segment')return console[_0x5728de(0x134)](a38_0x4a6e1b[_0x5728de(0x137)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x5728de(0x134)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x5728de(0x134)](a38_0x4a6e1b[_0x5728de(0x120)]('Use:\x20tdx\x20segment\x20use\x20'+_0x3e83f7[_0x5728de(0x115)]+(_0x3e83f7[_0x5728de(0x12a)]?'/'+_0x3e83f7[_0x5728de(0x12a)][_0x5728de(0x11c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3e83f7[_0x5728de(0x13e)],'parent_segment':_0x3e83f7[_0x5728de(0x115)]},_0x283525),console[_0x5728de(0x13a)](a38_0x4a6e1b[_0x5728de(0x123)](_0x5728de(0x11a)+a38_0x4a6e1b[_0x5728de(0x120)](_0x3e83f7['fullPath']))),_0x5094d7[_0x5728de(0x135)]&&(console[_0x5728de(0x134)](a38_0x4a6e1b['dim']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x5728de(0x134)](a38_0x4a6e1b[_0x5728de(0x142)](_0x5728de(0x147)))),0x0;}catch(_0x1d6459){throw _0x1d6459;}}}
1
+ function a38_0x4ef8(){const _0x4eab15=['folderId','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','red','parent_segment','Target\x20path:\x20','slice','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','2885800SdtOUh','dim','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','cyan','parentName','verbose','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','9LCrsgO','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','fullPath','config','error','Resolved\x20path\x20type:\x20','parentId','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','313389BGkgDY','data','green','segment:use','execute','1rAzcov','10301864ZqrbUI','Parent\x20ID:\x20','resolvePathToResource','segmentPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','segment','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Resolving\x20path\x20\x27','\x27...','Use:\x20tdx\x20segment\x20use\x20','Error:\x20Path\x20is\x20required\x0a','445838sLhFvh','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Site:\x20','log','Resolved\x20relative\x20path\x20to:\x20','✔\x20Context\x20set\x20to:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Usage:\x20tdx\x20segment\x20use\x20<path>','isAbsolute','Examples:','1572558jiLvjs','description','session','3240923MoQbel','split','length','type','segments','1444508jXylno'];a38_0x4ef8=function(){return _0x4eab15;};return a38_0x4ef8();}const a38_0x58a60c=a38_0x51e0;(function(_0x10d88b,_0x28b8bb){const _0x38f854=a38_0x51e0,_0x256e3c=_0x10d88b();while(!![]){try{const _0xb2a477=-parseInt(_0x38f854(0xfd))/0x1*(parseInt(_0x38f854(0x109))/0x2)+parseInt(_0x38f854(0xf8))/0x3+-parseInt(_0x38f854(0x11c))/0x4+-parseInt(_0x38f854(0x124))/0x5+-parseInt(_0x38f854(0x114))/0x6+parseInt(_0x38f854(0x117))/0x7+parseInt(_0x38f854(0xfe))/0x8*(parseInt(_0x38f854(0xef))/0x9);if(_0xb2a477===_0x28b8bb)break;else _0x256e3c['push'](_0x256e3c['shift']());}catch(_0x11bd91){_0x256e3c['push'](_0x256e3c['shift']());}}}(a38_0x4ef8,0x6970e));import{existsSync,statSync}from'fs';import a38_0x4ed56a from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';import{findTdxConfig}from'../utils/tdx-config.js';function a38_0x51e0(_0x1b838d,_0x55c977){_0x1b838d=_0x1b838d-0xea;const _0x4ef8aa=a38_0x4ef8();let _0x51e05e=_0x4ef8aa[_0x1b838d];return _0x51e05e;}export class SegmentUseCommand extends BaseCommand{['name']=a38_0x58a60c(0xfb);[a38_0x58a60c(0x115)]=a38_0x58a60c(0x102);async[a38_0x58a60c(0xfc)](_0x5c26f0){const _0x1c69d0=a38_0x58a60c,{options:_0x534131,args:_0x1b9b13,tdx:_0x4b015d}=_0x5c26f0;if(_0x1b9b13[_0x1c69d0(0x119)]===0x0)return console['error'](a38_0x4ed56a[_0x1c69d0(0x11f)](_0x1c69d0(0x108))),console['error'](_0x1c69d0(0x111)),console[_0x1c69d0(0xf4)](_0x1c69d0(0x113)),console[_0x1c69d0(0xf4)](_0x1c69d0(0x10a)),console[_0x1c69d0(0xf4)](_0x1c69d0(0xf1)),console[_0x1c69d0(0xf4)](_0x1c69d0(0xee)),console[_0x1c69d0(0xf4)](_0x1c69d0(0x123)),0x1;const _0x13da51=_0x1b9b13[0x0],_0x4997c4=_0x534131[_0x1c69d0(0x116)];try{if(_0x13da51==='/')return saveSessionContext({'segment_path':undefined},_0x4997c4),console[_0x1c69d0(0x10c)](a38_0x4ed56a[_0x1c69d0(0xfa)](_0x1c69d0(0xf7))),0x0;if(existsSync(_0x13da51)&&statSync(_0x13da51)['isDirectory']()){let _0x4633a4;try{_0x4633a4=findTdxConfig(_0x13da51);}catch{return console['error'](a38_0x4ed56a['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x13da51)),console['error'](a38_0x4ed56a[_0x1c69d0(0xeb)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x35e732=_0x4633a4[_0x1c69d0(0xf3)][_0x1c69d0(0x120)];return saveSessionContext({'segment_path':_0x35e732,'parent_segment':_0x35e732},_0x4997c4),console['log'](a38_0x4ed56a['green'](_0x1c69d0(0x10e)+a38_0x4ed56a[_0x1c69d0(0xeb)](_0x35e732))),0x0;}const _0x4847b0=_0x534131[_0x1c69d0(0x101)];let _0x7a8f52=_0x13da51;const _0x2b06ce=parsePath(_0x13da51);if(!_0x2b06ce[_0x1c69d0(0x112)]){if(!_0x4847b0)return console[_0x1c69d0(0xf4)](a38_0x4ed56a[_0x1c69d0(0x11f)](_0x1c69d0(0xea))),console[_0x1c69d0(0xf4)](a38_0x4ed56a[_0x1c69d0(0xeb)](_0x1c69d0(0x104))),0x1;if(_0x13da51==='..'){const _0x3ab331=_0x4847b0[_0x1c69d0(0x118)]('/')[_0x1c69d0(0x122)](0x0,-0x1)['join']('/');_0x7a8f52=_0x3ab331||'/';}else _0x13da51==='.'?_0x7a8f52=_0x4847b0:_0x7a8f52=_0x4847b0+'/'+_0x13da51;_0x534131[_0x1c69d0(0xed)]&&console[_0x1c69d0(0xf4)](_0x1c69d0(0x10d)+_0x7a8f52);}if(_0x7a8f52==='/'||_0x7a8f52==='')return saveSessionContext({'segment_path':undefined},_0x4997c4),console['log'](a38_0x4ed56a[_0x1c69d0(0xfa)](_0x1c69d0(0xf7))),0x0;_0x7a8f52=normalizePath(_0x7a8f52);const _0x5e0b6d=parsePath(_0x7a8f52)[_0x1c69d0(0x11b)];if(_0x5e0b6d[_0x1c69d0(0x119)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4997c4),console['log'](a38_0x4ed56a[_0x1c69d0(0xfa)](_0x1c69d0(0xf7))),0x0;_0x534131[_0x1c69d0(0xed)]&&(console['error'](_0x1c69d0(0x10b)+_0x534131['site']),console['error'](_0x1c69d0(0x121)+_0x7a8f52));const _0x313251=await withSpinner(_0x1c69d0(0x105)+_0x7a8f52+_0x1c69d0(0x106),()=>_0x4b015d[_0x1c69d0(0x103)][_0x1c69d0(0x100)](_0x7a8f52),{'verbose':_0x534131[_0x1c69d0(0xed)]}),_0x43c150=_0x313251[_0x1c69d0(0xf9)];_0x534131[_0x1c69d0(0xed)]&&(console['error'](_0x1c69d0(0xf5)+_0x43c150[_0x1c69d0(0x11a)]),console['error'](_0x1c69d0(0xff)+_0x43c150[_0x1c69d0(0xf6)]),_0x43c150[_0x1c69d0(0x11d)]&&console[_0x1c69d0(0xf4)](_0x1c69d0(0xf0)+_0x43c150['folderId']));if(_0x43c150[_0x1c69d0(0x11a)]===_0x1c69d0(0x103))return console[_0x1c69d0(0xf4)](a38_0x4ed56a[_0x1c69d0(0x11f)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x1c69d0(0xf4)](_0x1c69d0(0x110)),console['error'](a38_0x4ed56a[_0x1c69d0(0xeb)](_0x1c69d0(0x107)+_0x43c150[_0x1c69d0(0xec)]+(_0x43c150['folderPath']?'/'+_0x43c150['folderPath']['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x43c150[_0x1c69d0(0xf2)],'parent_segment':_0x43c150['parentName']},_0x4997c4),console[_0x1c69d0(0x10c)](a38_0x4ed56a[_0x1c69d0(0xfa)](_0x1c69d0(0x10e)+a38_0x4ed56a[_0x1c69d0(0xeb)](_0x43c150[_0x1c69d0(0xf2)]))),_0x534131[_0x1c69d0(0xed)]&&(console['error'](a38_0x4ed56a[_0x1c69d0(0x125)](_0x1c69d0(0x10f))),console[_0x1c69d0(0xf4)](a38_0x4ed56a[_0x1c69d0(0x125)](_0x1c69d0(0x11e)))),0x0;}catch(_0x3a7221){throw _0x3a7221;}}}
@@ -1 +1 @@
1
- function a39_0xfe8b(){const _0x1a022c=['\x20segment',',\x20and\x20','Parent\x20ID:\x20','recursive','replace','web','Site:\x20','66dSsacO','/app/ps/','/e/','execute','Recursive\x20mode:\x20enabled','segments','listUnified','jsonl','journeyBundleName','name','all','length','✔\x20Found\x20','listJourneysFromParentSegment','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.',']\x20matching\x20\x27','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','journey','658bJkfGz','description','708436pmOlPW','Listing\x20folders,\x20segments,\x20and\x20journeys...','filter','Building\x20hierarchy\x20tree...','site','Resolving\x20parent\x20segment\x20\x27','✔\x20Built\x20tree\x20with\x20','message','\x27...','211271TJgzcU','Folder\x20ID:\x20','List\x20folders\x20and\x20child\x20segments','map','listWithPattern','sort','241520mRZLgA','1164hTFaHc','\x20matching\x20\x27','cause','test','/j/da','folder','Error:\x20No\x20parent\x20segment\x20context\x20set.','75265qCARPW','Error:\x20','\x20journey','Set\x20a\x20parent\x20segment\x20context\x20first:','folderId','\x20top-level\x20items','No\x20items\x20match\x20pattern:\x20','1012887AsrJpK','\x20\x20Cause:\x20','28CGLKFM','format','localeCompare','\x20folder','(empty)','parentId','includes','\x5c$&','8371LVGiyU','error','resolvePathToResource','log','246XwVDXb','dim','10FMetjH','verbose','json','listRecursive','data','segment','Resolving\x20path\x20\x27'];a39_0xfe8b=function(){return _0x1a022c;};return a39_0xfe8b();}const a39_0x54b069=a39_0x4454;function a39_0x4454(_0x2da3b5,_0x4d78d3){_0x2da3b5=_0x2da3b5-0xcf;const _0xfe8b86=a39_0xfe8b();let _0x44543e=_0xfe8b86[_0x2da3b5];return _0x44543e;}(function(_0x1ecc19,_0x4e419f){const _0x2a316b=a39_0x4454,_0x253326=_0x1ecc19();while(!![]){try{const _0x2ea5c1=parseInt(_0x2a316b(0xf5))/0x1+-parseInt(_0x2a316b(0xea))/0x2*(parseInt(_0x2a316b(0x118))/0x3)+-parseInt(_0x2a316b(0xec))/0x4+parseInt(_0x2a316b(0x103))/0x5*(-parseInt(_0x2a316b(0xd8))/0x6)+-parseInt(_0x2a316b(0x10c))/0x7*(-parseInt(_0x2a316b(0xfb))/0x8)+-parseInt(_0x2a316b(0x10a))/0x9*(-parseInt(_0x2a316b(0x11a))/0xa)+parseInt(_0x2a316b(0x114))/0xb*(parseInt(_0x2a316b(0xfc))/0xc);if(_0x2ea5c1===_0x4e419f)break;else _0x253326['push'](_0x253326['shift']());}catch(_0x34f1e3){_0x253326['push'](_0x253326['shift']());}}}(a39_0xfe8b,0x244f1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{getConsoleNextUrl}from'../types/endpoints.js';import a39_0x197811 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a39_0x54b069(0xdd);[a39_0x54b069(0xeb)]=a39_0x54b069(0xf7);async[a39_0x54b069(0xdb)](_0x218b33){const _0x4d9630=a39_0x54b069,{options:_0x5ae2d5,args:_0x3fb802}=_0x218b33,_0x4ea016=_0x5ae2d5[_0x4d9630(0xd4)],_0x1b5226=_0x3fb802[0x0];try{const _0x20dad6=_0x5ae2d5['parentSegment'];_0x5ae2d5[_0x4d9630(0x11b)]&&(console['error'](_0x4d9630(0xd7)+_0x5ae2d5[_0x4d9630(0xf0)]),console[_0x4d9630(0x115)]('Parent\x20segment\x20context:\x20'+(_0x20dad6||'(not\x20set)')),_0x1b5226&&console[_0x4d9630(0x115)]('Folder/pattern\x20arg:\x20'+_0x1b5226),_0x4ea016&&console['error'](_0x4d9630(0xdc)));if(!_0x20dad6)return console[_0x4d9630(0x115)](_0x4d9630(0x102)),console[_0x4d9630(0x115)](''),console['error'](_0x4d9630(0x106)),console['error']('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console['error'](_0x4d9630(0xe8)),console[_0x4d9630(0x115)](''),console[_0x4d9630(0x115)](_0x4d9630(0xe6)),0x1;const _0x87e83f=_0x1b5226&&(_0x1b5226[_0x4d9630(0x112)]('*')||_0x1b5226[_0x4d9630(0x112)]('?'));if(_0x87e83f)return await this[_0x4d9630(0xf9)](_0x218b33,_0x20dad6,_0x1b5226);const _0x2074d=_0x1b5226?_0x20dad6+'/'+_0x1b5226:_0x20dad6;return _0x4ea016?await this['listRecursive'](_0x218b33,_0x2074d):await this[_0x4d9630(0xde)](_0x218b33,_0x2074d);}catch(_0x2f9c3b){if(_0x2f9c3b instanceof SDKError)return console['error'](_0x4d9630(0x104)+_0x2f9c3b[_0x4d9630(0xf3)]),_0x2f9c3b[_0x4d9630(0xfe)]&&console[_0x4d9630(0x115)](_0x4d9630(0x10b)+_0x2f9c3b[_0x4d9630(0xfe)]),0x1;throw _0x2f9c3b;}}async[a39_0x54b069(0xf9)](_0x2e31c4,_0x54d7e5,_0x23afa1){const _0x3cc7e1=a39_0x54b069,{options:_0x20ca0f,tdx:_0x15f94c}=_0x2e31c4,_0x55964c=_0x20ca0f['web'],_0x215f17=await withSpinner(_0x3cc7e1(0xf1)+_0x54d7e5+_0x3cc7e1(0xf4),()=>_0x15f94c[_0x3cc7e1(0xcf)][_0x3cc7e1(0x116)](_0x54d7e5),{'verbose':_0x20ca0f[_0x3cc7e1(0x11b)]}),_0x1558d9=_0x215f17[_0x3cc7e1(0x11e)],_0x5bb813=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>Promise[_0x3cc7e1(0xe2)]([_0x15f94c[_0x3cc7e1(0xcf)][_0x3cc7e1(0xde)](_0x1558d9[_0x3cc7e1(0x111)],_0x1558d9[_0x3cc7e1(0x107)]),_0x15f94c[_0x3cc7e1(0xe9)][_0x3cc7e1(0xe5)](_0x1558d9['parentId'])]),{'verbose':_0x20ca0f[_0x3cc7e1(0x11b)]}),[_0x20a0e7,_0x450158]=_0x5bb813[_0x3cc7e1(0x11e)],{folders:_0x41d592,segments:_0x5262a8}=_0x20a0e7,_0x205c0e=_0x23afa1[_0x3cc7e1(0xd5)](/[.+^${}()|[\]\\]/g,_0x3cc7e1(0x113))['replace'](/\*/g,'.*')[_0x3cc7e1(0xd5)](/\?/g,'.'),_0x8c4c3d=new RegExp('^'+_0x205c0e+'$','i'),_0x340468=_0x41d592[_0x3cc7e1(0xee)](_0x36e5da=>_0x8c4c3d[_0x3cc7e1(0xff)](_0x36e5da[_0x3cc7e1(0xe1)])),_0x2fdcdb=_0x5262a8[_0x3cc7e1(0xee)](_0x1e9666=>_0x8c4c3d[_0x3cc7e1(0xff)](_0x1e9666[_0x3cc7e1(0xe1)])),_0x4b3932=_0x450158[_0x3cc7e1(0xee)](_0x15e382=>_0x8c4c3d[_0x3cc7e1(0xff)](_0x15e382['journeyBundleName'])),_0x165eb8=_0x340468[_0x3cc7e1(0xe3)]+_0x2fdcdb[_0x3cc7e1(0xe3)]+_0x4b3932[_0x3cc7e1(0xe3)];console['error']('✔\x20Found\x20'+_0x340468[_0x3cc7e1(0xe3)]+_0x3cc7e1(0x10f)+(_0x340468[_0x3cc7e1(0xe3)]!==0x1?'s':'')+',\x20'+_0x2fdcdb[_0x3cc7e1(0xe3)]+_0x3cc7e1(0xd1)+(_0x2fdcdb[_0x3cc7e1(0xe3)]!==0x1?'s':'')+_0x3cc7e1(0xd2)+_0x4b3932[_0x3cc7e1(0xe3)]+_0x3cc7e1(0x105)+(_0x4b3932[_0x3cc7e1(0xe3)]!==0x1?'s':'')+_0x3cc7e1(0xfd)+_0x23afa1+'\x27');const _0x4c84d0=_0xc3fa32=>{const _0x50da2d=_0x3cc7e1;return getConsoleNextUrl(_0x20ca0f[_0x50da2d(0xf0)],_0x50da2d(0xd9)+_0x1558d9[_0x50da2d(0x111)]+_0x50da2d(0xda)+_0xc3fa32);},_0x290d55=_0x20ca0f[_0x3cc7e1(0x10d)]===_0x3cc7e1(0x11c)||_0x20ca0f[_0x3cc7e1(0x10d)]===_0x3cc7e1(0xdf);if(_0x290d55){const _0x203001=[..._0x340468[_0x3cc7e1(0xf8)](_0x546cea=>({..._0x546cea,'type':_0x3cc7e1(0x101)})),..._0x2fdcdb['map'](_0x35e336=>({..._0x35e336,'type':_0x3cc7e1(0xcf),'url':_0x4c84d0(_0x35e336['id'])})),..._0x4b3932['map'](_0x21d1be=>({..._0x21d1be,'name':_0x21d1be['journeyBundleName'],'type':_0x3cc7e1(0xe9)}))][_0x3cc7e1(0xfa)]((_0x421998,_0x1b5e21)=>_0x421998[_0x3cc7e1(0xe1)][_0x3cc7e1(0x10e)](_0x1b5e21[_0x3cc7e1(0xe1)]));await handleSDKOutput(_0x203001,_0x20ca0f);}else{if(_0x165eb8===0x0)console[_0x3cc7e1(0x117)](_0x3cc7e1(0x109)+_0x23afa1);else{console[_0x3cc7e1(0x117)](a39_0x197811[_0x3cc7e1(0x119)]('['+_0x54d7e5+_0x3cc7e1(0xe7)+_0x23afa1+'\x27'));const _0x44977a=formatFlatList(_0x340468,_0x2fdcdb,{'showMetadata':!![],'showUrl':_0x55964c,'getSegmentUrl':_0x4c84d0},_0x4b3932);console[_0x3cc7e1(0x117)](_0x44977a);}}return 0x0;}async[a39_0x54b069(0xde)](_0xb247d0,_0x34a519){const _0x54e021=a39_0x54b069,{options:_0x109057,tdx:_0x350d1e}=_0xb247d0,_0x45a6a2=_0x109057[_0x54e021(0xd6)],_0xda2479=await withSpinner(_0x54e021(0xd0)+_0x34a519+'\x27...',()=>_0x350d1e[_0x54e021(0xcf)][_0x54e021(0x116)](_0x34a519),{'verbose':_0x109057[_0x54e021(0x11b)]}),_0x27e5b1=_0xda2479['data'];_0x109057['verbose']&&(console[_0x54e021(0x115)](_0x54e021(0xd3)+_0x27e5b1['parentId']),_0x27e5b1[_0x54e021(0x107)]&&console[_0x54e021(0x115)](_0x54e021(0xf6)+_0x27e5b1[_0x54e021(0x107)]));const _0x43d826=await withSpinner(_0x54e021(0xed),()=>Promise[_0x54e021(0xe2)]([_0x350d1e[_0x54e021(0xcf)][_0x54e021(0xde)](_0x27e5b1[_0x54e021(0x111)],_0x27e5b1[_0x54e021(0x107)]),_0x350d1e['journey'][_0x54e021(0xe5)](_0x27e5b1['parentId'])]),{'verbose':_0x109057[_0x54e021(0x11b)]}),[_0x8a4ae9,_0x12cd63]=_0x43d826[_0x54e021(0x11e)],{folders:_0x2be11f,segments:_0x42dd36}=_0x8a4ae9,_0x674b11=_0x2be11f[_0x54e021(0xe3)]+_0x42dd36[_0x54e021(0xe3)]+_0x12cd63[_0x54e021(0xe3)];console[_0x54e021(0x115)](_0x54e021(0xe4)+_0x2be11f[_0x54e021(0xe3)]+_0x54e021(0x10f)+(_0x2be11f[_0x54e021(0xe3)]!==0x1?'s':'')+',\x20'+_0x42dd36[_0x54e021(0xe3)]+'\x20segment'+(_0x42dd36[_0x54e021(0xe3)]!==0x1?'s':'')+_0x54e021(0xd2)+_0x12cd63[_0x54e021(0xe3)]+_0x54e021(0x105)+(_0x12cd63['length']!==0x1?'s':''));const _0x257381=_0x145bbd=>{const _0x41c373=_0x54e021;return getConsoleNextUrl(_0x109057[_0x41c373(0xf0)],_0x41c373(0xd9)+_0x27e5b1[_0x41c373(0x111)]+_0x41c373(0xda)+_0x145bbd);},_0x1abd4f=_0x322ef9=>{const _0x9bb890=_0x54e021;return getConsoleNextUrl(_0x109057['site'],_0x9bb890(0xd9)+_0x27e5b1['parentId']+_0x9bb890(0xda)+_0x322ef9+_0x9bb890(0x100));},_0x26d590=_0x109057[_0x54e021(0x10d)]==='json'||_0x109057[_0x54e021(0x10d)]==='jsonl';if(_0x26d590){const _0x2d7d2b=[..._0x2be11f[_0x54e021(0xf8)](_0x3465f2=>({..._0x3465f2,'type':'folder'})),..._0x42dd36[_0x54e021(0xf8)](_0x48e03a=>({..._0x48e03a,'type':_0x54e021(0xcf),'url':_0x257381(_0x48e03a['id'])})),..._0x12cd63[_0x54e021(0xf8)](_0x2ee233=>({..._0x2ee233,'name':_0x2ee233[_0x54e021(0xe0)],'type':_0x54e021(0xe9),'url':_0x1abd4f(_0x2ee233['id'])}))][_0x54e021(0xfa)]((_0x7009da,_0x159707)=>_0x7009da[_0x54e021(0xe1)][_0x54e021(0x10e)](_0x159707['name']));await handleSDKOutput(_0x2d7d2b,_0x109057);}else{if(_0x674b11===0x0)console[_0x54e021(0x117)](a39_0x197811[_0x54e021(0x119)]('['+_0x34a519+']')),console[_0x54e021(0x117)](_0x54e021(0x110));else{console[_0x54e021(0x117)](a39_0x197811[_0x54e021(0x119)]('['+_0x34a519+']'));const _0x961207=formatFlatList(_0x2be11f,_0x42dd36,{'showMetadata':!![],'showUrl':_0x45a6a2,'getSegmentUrl':_0x257381,'getJourneyUrl':_0x1abd4f},_0x12cd63);console[_0x54e021(0x117)](_0x961207);}}return 0x0;}async['listRecursive'](_0x2d049c,_0x27720b){const _0x72b922=a39_0x54b069,{options:_0x3a362d,tdx:_0x32f1e7}=_0x2d049c,_0x9960e1=_0x3a362d[_0x72b922(0xd6)],_0x5efb3c=await withSpinner(_0x72b922(0xd0)+_0x27720b+_0x72b922(0xf4),()=>_0x32f1e7[_0x72b922(0xcf)][_0x72b922(0x116)](_0x27720b),{'verbose':_0x3a362d[_0x72b922(0x11b)]}),_0x220a8c=_0x5efb3c[_0x72b922(0x11e)];_0x3a362d[_0x72b922(0x11b)]&&(console[_0x72b922(0x115)](_0x72b922(0xd3)+_0x220a8c['parentId']),_0x220a8c[_0x72b922(0x107)]&&console[_0x72b922(0x115)](_0x72b922(0xf6)+_0x220a8c[_0x72b922(0x107)]));const _0x175f1d=_0x3a362d['maxDepth']||0xa,_0x4c7d1a=await withSpinner(_0x72b922(0xef),()=>_0x32f1e7[_0x72b922(0xcf)][_0x72b922(0x11d)](_0x220a8c['parentId'],_0x220a8c['folderId'],0x0,_0x175f1d),{'verbose':_0x3a362d[_0x72b922(0x11b)]}),_0x27e586=_0x4c7d1a[_0x72b922(0x11e)];console[_0x72b922(0x115)](_0x72b922(0xf2)+_0x27e586[_0x72b922(0xe3)]+_0x72b922(0x108));const _0x5bed69=_0x2b7d22=>{const _0x686cf2=_0x72b922;return getConsoleNextUrl(_0x3a362d[_0x686cf2(0xf0)],_0x686cf2(0xd9)+_0x220a8c['parentId']+_0x686cf2(0xda)+_0x2b7d22);};if(_0x3a362d[_0x72b922(0x10d)]===_0x72b922(0x11c)||_0x3a362d[_0x72b922(0x10d)]===_0x72b922(0xdf))await handleSDKOutput(_0x27e586,_0x3a362d);else{console[_0x72b922(0x117)](a39_0x197811[_0x72b922(0x119)]('['+_0x27720b+']'));const _0x3c6b62=formatTree(_0x27e586,{'showMetadata':!![],'showUrl':_0x9960e1,'getSegmentUrl':_0x5bed69});console[_0x72b922(0x117)](_0x3c6b62);}return 0x0;}}
1
+ const a39_0x697b5a=a39_0x44fc;(function(_0x2ea0ea,_0x378ffa){const _0xd5da7e=a39_0x44fc,_0x19591f=_0x2ea0ea();while(!![]){try{const _0x91c5e5=-parseInt(_0xd5da7e(0x152))/0x1*(-parseInt(_0xd5da7e(0x18e))/0x2)+-parseInt(_0xd5da7e(0x16d))/0x3+-parseInt(_0xd5da7e(0x163))/0x4+parseInt(_0xd5da7e(0x16f))/0x5+-parseInt(_0xd5da7e(0x194))/0x6+parseInt(_0xd5da7e(0x184))/0x7*(parseInt(_0xd5da7e(0x16a))/0x8)+-parseInt(_0xd5da7e(0x180))/0x9*(parseInt(_0xd5da7e(0x157))/0xa);if(_0x91c5e5===_0x378ffa)break;else _0x19591f['push'](_0x19591f['shift']());}catch(_0x2935ff){_0x19591f['push'](_0x19591f['shift']());}}}(a39_0x532f,0x916f3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a39_0x44fc(_0x1b5f95,_0x24753b){_0x1b5f95=_0x1b5f95-0x151;const _0x532f11=a39_0x532f();let _0x44fc6d=_0x532f11[_0x1b5f95];return _0x44fc6d;}import{getConsoleNextUrl}from'../types/endpoints.js';function a39_0x532f(){const _0x40b4eb=['log','8WSNJlh','/j/da','listUnified','2630955GdgFXq','resolvePathToResource','1759070eueZAP','includes','all','name','Folder\x20ID:\x20','dim','site','Resolving\x20parent\x20segment\x20\x27','journeyBundleName','listWithPattern','No\x20items\x20match\x20pattern:\x20','\x20folder','Listing\x20folders,\x20segments,\x20and\x20journeys...','message','parentId','(not\x20set)','map','7452981kSABXD','Site:\x20','/app/ps/','sort','7859285cdWdnM','(empty)','cause','Error:\x20','\x27...','format','Resolving\x20path\x20\x27','Folder/pattern\x20arg:\x20','List\x20folders\x20and\x20child\x20segments','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','65214TRyCqZ','filter','\x20top-level\x20items','\x20journey','verbose','folder','728208lDClJX','segments','\x20segment','\x5c$&','length','test','journey','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','replace','33EDtbLm','jsonl','data','\x20matching\x20\x27','Parent\x20ID:\x20','10TmaAnt','json','Set\x20a\x20parent\x20segment\x20context\x20first:','folderId',',\x20and\x20','segment','Building\x20hierarchy\x20tree...','listRecursive','listJourneysFromParentSegment',']\x20matching\x20\x27','maxDepth','error','513756ZNgDYi','recursive','execute','✔\x20Found\x20','web','/e/'];a39_0x532f=function(){return _0x40b4eb;};return a39_0x532f();}import a39_0x1bde1d from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a39_0x697b5a(0x195);['description']=a39_0x697b5a(0x18c);async[a39_0x697b5a(0x165)](_0xa5475c){const _0x1834dc=a39_0x697b5a,{options:_0x1992fd,args:_0x57780e}=_0xa5475c,_0x2f2fc9=_0x1992fd[_0x1834dc(0x164)],_0x1b0a34=_0x57780e[0x0];try{const _0x15e622=_0x1992fd['parentSegment'];_0x1992fd['verbose']&&(console['error'](_0x1834dc(0x181)+_0x1992fd['site']),console['error']('Parent\x20segment\x20context:\x20'+(_0x15e622||_0x1834dc(0x17e))),_0x1b0a34&&console[_0x1834dc(0x162)](_0x1834dc(0x18b)+_0x1b0a34),_0x2f2fc9&&console['error']('Recursive\x20mode:\x20enabled'));if(!_0x15e622)return console[_0x1834dc(0x162)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x1834dc(0x162)](_0x1834dc(0x159)),console[_0x1834dc(0x162)](_0x1834dc(0x19b)),console[_0x1834dc(0x162)](_0x1834dc(0x18d)),console['error'](''),console[_0x1834dc(0x162)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x33b7f3=_0x1b0a34&&(_0x1b0a34[_0x1834dc(0x170)]('*')||_0x1b0a34[_0x1834dc(0x170)]('?'));if(_0x33b7f3)return await this['listWithPattern'](_0xa5475c,_0x15e622,_0x1b0a34);const _0x2535af=_0x1b0a34?_0x15e622+'/'+_0x1b0a34:_0x15e622;return _0x2f2fc9?await this[_0x1834dc(0x15e)](_0xa5475c,_0x2535af):await this[_0x1834dc(0x16c)](_0xa5475c,_0x2535af);}catch(_0x5029b9){if(_0x5029b9 instanceof SDKError)return console['error'](_0x1834dc(0x187)+_0x5029b9[_0x1834dc(0x17c)]),_0x5029b9['cause']&&console[_0x1834dc(0x162)]('\x20\x20Cause:\x20'+_0x5029b9[_0x1834dc(0x186)]),0x1;throw _0x5029b9;}}async[a39_0x697b5a(0x178)](_0x1ce700,_0xe91400,_0x5259fa){const _0x4001e0=a39_0x697b5a,{options:_0x5a6e42,tdx:_0x4f5fb9}=_0x1ce700,_0x1916bc=_0x5a6e42[_0x4001e0(0x167)],_0x4c8fa9=await withSpinner(_0x4001e0(0x176)+_0xe91400+'\x27...',()=>_0x4f5fb9['segment'][_0x4001e0(0x16e)](_0xe91400),{'verbose':_0x5a6e42[_0x4001e0(0x192)]}),_0x3d164c=_0x4c8fa9[_0x4001e0(0x154)],_0x5458c6=await withSpinner(_0x4001e0(0x17b),()=>Promise[_0x4001e0(0x171)]([_0x4f5fb9[_0x4001e0(0x15c)][_0x4001e0(0x16c)](_0x3d164c[_0x4001e0(0x17d)],_0x3d164c[_0x4001e0(0x15a)]),_0x4f5fb9['journey'][_0x4001e0(0x15f)](_0x3d164c[_0x4001e0(0x17d)])]),{'verbose':_0x5a6e42[_0x4001e0(0x192)]}),[_0x1e0730,_0x6166f6]=_0x5458c6[_0x4001e0(0x154)],{folders:_0x3f01f2,segments:_0x23e937}=_0x1e0730,_0x237878=_0x5259fa[_0x4001e0(0x151)](/[.+^${}()|[\]\\]/g,_0x4001e0(0x197))[_0x4001e0(0x151)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x2aaaa5=new RegExp('^'+_0x237878+'$','i'),_0x10bfee=_0x3f01f2[_0x4001e0(0x18f)](_0x545b3b=>_0x2aaaa5[_0x4001e0(0x199)](_0x545b3b['name'])),_0x2a3d4d=_0x23e937[_0x4001e0(0x18f)](_0x36d29a=>_0x2aaaa5[_0x4001e0(0x199)](_0x36d29a[_0x4001e0(0x172)])),_0x5d0421=_0x6166f6[_0x4001e0(0x18f)](_0x5c3419=>_0x2aaaa5['test'](_0x5c3419['journeyBundleName'])),_0x296de0=_0x10bfee[_0x4001e0(0x198)]+_0x2a3d4d[_0x4001e0(0x198)]+_0x5d0421[_0x4001e0(0x198)];console[_0x4001e0(0x162)](_0x4001e0(0x166)+_0x10bfee['length']+_0x4001e0(0x17a)+(_0x10bfee[_0x4001e0(0x198)]!==0x1?'s':'')+',\x20'+_0x2a3d4d[_0x4001e0(0x198)]+'\x20segment'+(_0x2a3d4d[_0x4001e0(0x198)]!==0x1?'s':'')+_0x4001e0(0x15b)+_0x5d0421[_0x4001e0(0x198)]+_0x4001e0(0x191)+(_0x5d0421[_0x4001e0(0x198)]!==0x1?'s':'')+_0x4001e0(0x155)+_0x5259fa+'\x27');const _0x27293e=_0x166ead=>{const _0x528c3e=_0x4001e0;return getConsoleNextUrl(_0x5a6e42['site'],_0x528c3e(0x182)+_0x3d164c['parentId']+_0x528c3e(0x168)+_0x166ead);},_0x12108b=_0x5a6e42[_0x4001e0(0x189)]===_0x4001e0(0x158)||_0x5a6e42[_0x4001e0(0x189)]===_0x4001e0(0x153);if(_0x12108b){const _0x48a013=[..._0x10bfee[_0x4001e0(0x17f)](_0x481d3f=>({..._0x481d3f,'type':_0x4001e0(0x193)})),..._0x2a3d4d[_0x4001e0(0x17f)](_0x42d664=>({..._0x42d664,'type':_0x4001e0(0x15c),'url':_0x27293e(_0x42d664['id'])})),..._0x5d0421['map'](_0x448859=>({..._0x448859,'name':_0x448859[_0x4001e0(0x177)],'type':_0x4001e0(0x19a)}))][_0x4001e0(0x183)]((_0x5e518c,_0x4e5c3f)=>_0x5e518c['name']['localeCompare'](_0x4e5c3f['name']));await handleSDKOutput(_0x48a013,_0x5a6e42);}else{if(_0x296de0===0x0)console[_0x4001e0(0x169)](_0x4001e0(0x179)+_0x5259fa);else{console[_0x4001e0(0x169)](a39_0x1bde1d['dim']('['+_0xe91400+_0x4001e0(0x160)+_0x5259fa+'\x27'));const _0x593691=formatFlatList(_0x10bfee,_0x2a3d4d,{'showMetadata':!![],'showUrl':_0x1916bc,'getSegmentUrl':_0x27293e},_0x5d0421);console['log'](_0x593691);}}return 0x0;}async[a39_0x697b5a(0x16c)](_0x5d7ea3,_0x23b020){const _0xe21f83=a39_0x697b5a,{options:_0x66cc3c,tdx:_0x13f0ba}=_0x5d7ea3,_0x4f40ae=_0x66cc3c['web'],_0x56ffcd=await withSpinner(_0xe21f83(0x18a)+_0x23b020+_0xe21f83(0x188),()=>_0x13f0ba['segment'][_0xe21f83(0x16e)](_0x23b020),{'verbose':_0x66cc3c[_0xe21f83(0x192)]}),_0x2a4295=_0x56ffcd['data'];_0x66cc3c[_0xe21f83(0x192)]&&(console[_0xe21f83(0x162)](_0xe21f83(0x156)+_0x2a4295[_0xe21f83(0x17d)]),_0x2a4295[_0xe21f83(0x15a)]&&console[_0xe21f83(0x162)](_0xe21f83(0x173)+_0x2a4295['folderId']));const _0x5c139a=await withSpinner(_0xe21f83(0x17b),()=>Promise[_0xe21f83(0x171)]([_0x13f0ba[_0xe21f83(0x15c)]['listUnified'](_0x2a4295['parentId'],_0x2a4295[_0xe21f83(0x15a)]),_0x13f0ba[_0xe21f83(0x19a)][_0xe21f83(0x15f)](_0x2a4295[_0xe21f83(0x17d)])]),{'verbose':_0x66cc3c[_0xe21f83(0x192)]}),[_0x9c14d9,_0x19f538]=_0x5c139a[_0xe21f83(0x154)],{folders:_0x29c6fb,segments:_0x10a535}=_0x9c14d9,_0x17d84d=_0x29c6fb[_0xe21f83(0x198)]+_0x10a535[_0xe21f83(0x198)]+_0x19f538[_0xe21f83(0x198)];console[_0xe21f83(0x162)](_0xe21f83(0x166)+_0x29c6fb[_0xe21f83(0x198)]+_0xe21f83(0x17a)+(_0x29c6fb['length']!==0x1?'s':'')+',\x20'+_0x10a535[_0xe21f83(0x198)]+_0xe21f83(0x196)+(_0x10a535['length']!==0x1?'s':'')+_0xe21f83(0x15b)+_0x19f538[_0xe21f83(0x198)]+_0xe21f83(0x191)+(_0x19f538['length']!==0x1?'s':''));const _0x4318c9=_0x335f02=>{const _0x5ed7c5=_0xe21f83;return getConsoleNextUrl(_0x66cc3c[_0x5ed7c5(0x175)],_0x5ed7c5(0x182)+_0x2a4295[_0x5ed7c5(0x17d)]+_0x5ed7c5(0x168)+_0x335f02);},_0x29faf7=_0x43dea6=>{const _0x384d1b=_0xe21f83;return getConsoleNextUrl(_0x66cc3c[_0x384d1b(0x175)],'/app/ps/'+_0x2a4295[_0x384d1b(0x17d)]+'/e/'+_0x43dea6+_0x384d1b(0x16b));},_0x181466=_0x66cc3c['format']==='json'||_0x66cc3c[_0xe21f83(0x189)]===_0xe21f83(0x153);if(_0x181466){const _0x1d9949=[..._0x29c6fb['map'](_0x286d2f=>({..._0x286d2f,'type':_0xe21f83(0x193)})),..._0x10a535['map'](_0x5af922=>({..._0x5af922,'type':'segment','url':_0x4318c9(_0x5af922['id'])})),..._0x19f538[_0xe21f83(0x17f)](_0x303390=>({..._0x303390,'name':_0x303390[_0xe21f83(0x177)],'type':'journey','url':_0x29faf7(_0x303390['id'])}))]['sort']((_0x2a886f,_0x362a6b)=>_0x2a886f[_0xe21f83(0x172)]['localeCompare'](_0x362a6b['name']));await handleSDKOutput(_0x1d9949,_0x66cc3c);}else{if(_0x17d84d===0x0)console[_0xe21f83(0x169)](a39_0x1bde1d[_0xe21f83(0x174)]('['+_0x23b020+']')),console[_0xe21f83(0x169)](_0xe21f83(0x185));else{console[_0xe21f83(0x169)](a39_0x1bde1d[_0xe21f83(0x174)]('['+_0x23b020+']'));const _0x14d8ad=formatFlatList(_0x29c6fb,_0x10a535,{'showMetadata':!![],'showUrl':_0x4f40ae,'getSegmentUrl':_0x4318c9,'getJourneyUrl':_0x29faf7},_0x19f538);console[_0xe21f83(0x169)](_0x14d8ad);}}return 0x0;}async['listRecursive'](_0x5d7d18,_0xd5cd61){const _0x2a3f3d=a39_0x697b5a,{options:_0x58264d,tdx:_0x29cae5}=_0x5d7d18,_0x2da9c8=_0x58264d[_0x2a3f3d(0x167)],_0x4b9b64=await withSpinner(_0x2a3f3d(0x18a)+_0xd5cd61+'\x27...',()=>_0x29cae5[_0x2a3f3d(0x15c)][_0x2a3f3d(0x16e)](_0xd5cd61),{'verbose':_0x58264d[_0x2a3f3d(0x192)]}),_0x3e00e4=_0x4b9b64[_0x2a3f3d(0x154)];_0x58264d[_0x2a3f3d(0x192)]&&(console[_0x2a3f3d(0x162)](_0x2a3f3d(0x156)+_0x3e00e4[_0x2a3f3d(0x17d)]),_0x3e00e4[_0x2a3f3d(0x15a)]&&console['error']('Folder\x20ID:\x20'+_0x3e00e4[_0x2a3f3d(0x15a)]));const _0xa9cd42=_0x58264d[_0x2a3f3d(0x161)]||0xa,_0x18b113=await withSpinner(_0x2a3f3d(0x15d),()=>_0x29cae5['segment']['listRecursive'](_0x3e00e4['parentId'],_0x3e00e4[_0x2a3f3d(0x15a)],0x0,_0xa9cd42),{'verbose':_0x58264d[_0x2a3f3d(0x192)]}),_0x22ddb0=_0x18b113[_0x2a3f3d(0x154)];console[_0x2a3f3d(0x162)]('✔\x20Built\x20tree\x20with\x20'+_0x22ddb0['length']+_0x2a3f3d(0x190));const _0x39cc82=_0x4e09a6=>{const _0xa212c7=_0x2a3f3d;return getConsoleNextUrl(_0x58264d['site'],'/app/ps/'+_0x3e00e4['parentId']+_0xa212c7(0x168)+_0x4e09a6);};if(_0x58264d[_0x2a3f3d(0x189)]===_0x2a3f3d(0x158)||_0x58264d[_0x2a3f3d(0x189)]===_0x2a3f3d(0x153))await handleSDKOutput(_0x22ddb0,_0x58264d);else{console['log'](a39_0x1bde1d['dim']('['+_0xd5cd61+']'));const _0xe774df=formatTree(_0x22ddb0,{'showMetadata':!![],'showUrl':_0x2da9c8,'getSegmentUrl':_0x39cc82});console['log'](_0xe774df);}return 0x0;}}
@@ -1 +1 @@
1
- const a40_0x29b20c=a40_0x25be;(function(_0x59115d,_0x4fef3b){const _0xdbe4ad=a40_0x25be,_0xa365a0=_0x59115d();while(!![]){try{const _0x46a93d=-parseInt(_0xdbe4ad(0x177))/0x1*(-parseInt(_0xdbe4ad(0x181))/0x2)+-parseInt(_0xdbe4ad(0x172))/0x3*(-parseInt(_0xdbe4ad(0x195))/0x4)+parseInt(_0xdbe4ad(0x183))/0x5*(-parseInt(_0xdbe4ad(0x17e))/0x6)+-parseInt(_0xdbe4ad(0x193))/0x7+-parseInt(_0xdbe4ad(0x188))/0x8*(-parseInt(_0xdbe4ad(0x173))/0x9)+parseInt(_0xdbe4ad(0x18f))/0xa*(-parseInt(_0xdbe4ad(0x171))/0xb)+-parseInt(_0xdbe4ad(0x179))/0xc;if(_0x46a93d===_0x4fef3b)break;else _0xa365a0['push'](_0xa365a0['shift']());}catch(_0x2b97c1){_0xa365a0['push'](_0xa365a0['shift']());}}}(a40_0x5208,0x6d492));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a40_0x25be(_0x9723c4,_0x260bc0){_0x9723c4=_0x9723c4-0x16c;const _0x5208cb=a40_0x5208();let _0x25be92=_0x5208cb[_0x9723c4];return _0x25be92;}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a40_0x5208(){const _0x1aa589=['cause','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','1166546ozsmXJ','table','20yNVNhy','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Site:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','729248uQhHwR','length','verbose','limit','Error:\x20','execute','✔\x20Retrieved\x20','1060JNNEHP','Show\x20table\x20contents','Querying\x20','Limit:\x20','2081590bEvuXa','Usage:\x20tdx\x20show\x20<database.table>','74056EQFGtF','showTable','\x20from\x20','args','site','error','validate','query','catalog','19041rqEewd','114AkUYeS','81MNcEuh','show','database','\x20row','1gatZHa','...','9539652olAzrr','data','Table:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','message','575622BsQGoW'];a40_0x5208=function(){return _0x1aa589;};return a40_0x5208();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']=a40_0x29b20c(0x174);['description']=a40_0x29b20c(0x190);async[a40_0x29b20c(0x18d)](_0x5e1749){const _0x77d7d0=a40_0x29b20c;return this[_0x77d7d0(0x196)](_0x5e1749);}async[a40_0x29b20c(0x196)](_0xd458f8){const _0x41e0ed=a40_0x29b20c,{options:_0x1a0e5b,args:_0x4ad1d6,tdx:_0x248ca6}=_0xd458f8;let _0x1f63c6;try{_0x1f63c6=parseTableReference(_0x4ad1d6[0x0]);const _0x554706=_0x1a0e5b[_0x41e0ed(0x175)];!_0x1f63c6['database']&&_0x554706&&(_0x1f63c6[_0x41e0ed(0x175)]=_0x554706);const _0x58aacf=validateTableDescribeReference(_0x1f63c6);if(_0x58aacf)return console[_0x41e0ed(0x16d)](_0x41e0ed(0x18c)+_0x58aacf),console['error'](_0x41e0ed(0x194)),console['error'](_0x41e0ed(0x184)),console[_0x41e0ed(0x16d)](_0x41e0ed(0x187)),0x1;}catch(_0x240dce){return console['error']('Error:\x20'+_0x240dce[_0x41e0ed(0x17d)]),console[_0x41e0ed(0x16d)](_0x41e0ed(0x194)),console[_0x41e0ed(0x16d)](_0x41e0ed(0x184)),console[_0x41e0ed(0x16d)](_0x41e0ed(0x187)),0x1;}const _0x383304=_0x1f63c6[_0x41e0ed(0x170)],_0x266567=_0x1f63c6[_0x41e0ed(0x175)],_0x2b8804=_0x1f63c6[_0x41e0ed(0x182)],_0x12fd9a=resolveLimit(_0x1a0e5b[_0x41e0ed(0x18b)],DEFAULT_DISPLAY_LIMIT);try{_0x1a0e5b['verbose']&&(console[_0x41e0ed(0x16d)](_0x41e0ed(0x185)+_0x1a0e5b[_0x41e0ed(0x16c)]),_0x383304&&console[_0x41e0ed(0x16d)]('Catalog:\x20'+_0x383304),console[_0x41e0ed(0x16d)]('Database:\x20'+_0x266567),console[_0x41e0ed(0x16d)](_0x41e0ed(0x17b)+_0x2b8804),console[_0x41e0ed(0x16d)](_0x41e0ed(0x192)+_0x12fd9a));const _0x27f5e9=_0x383304?_0x383304+'.'+_0x266567+'.'+_0x2b8804:_0x266567+'.'+_0x2b8804,_0xc28a69=await withSpinner(_0x41e0ed(0x191)+_0x27f5e9+_0x41e0ed(0x178),()=>_0x248ca6[_0x41e0ed(0x16f)][_0x41e0ed(0x196)](_0x266567,_0x2b8804,_0x12fd9a,_0x383304),{'verbose':_0x1a0e5b[_0x41e0ed(0x18a)]}),_0x4aec15=_0xc28a69[_0x41e0ed(0x17a)],_0x1c8fd6=_0x4aec15[_0x41e0ed(0x17a)];return _0x1c8fd6[_0x41e0ed(0x189)]===0x0?console['error'](_0x41e0ed(0x186)):console[_0x41e0ed(0x16d)](_0x41e0ed(0x18e)+_0x1c8fd6['length']+_0x41e0ed(0x176)+(_0x1c8fd6[_0x41e0ed(0x189)]!==0x1?'s':'')+_0x41e0ed(0x197)+_0x27f5e9),await handleSDKOutput(_0x1c8fd6,_0x1a0e5b),0x0;}catch(_0x47a073){if(_0x47a073 instanceof SDKError)return console['error']('Error:\x20'+_0x47a073['message']),_0x47a073[_0x41e0ed(0x17f)]&&console[_0x41e0ed(0x16d)]('\x20\x20Cause:\x20'+_0x47a073[_0x41e0ed(0x17f)]),0x1;throw _0x47a073;}}[a40_0x29b20c(0x16e)](_0x5025ff){const _0x1ee8e1=a40_0x29b20c;if(_0x5025ff[_0x1ee8e1(0x198)]['length']===0x0)return _0x1ee8e1(0x180);if(_0x5025ff[_0x1ee8e1(0x198)][_0x1ee8e1(0x189)]>0x1)return _0x1ee8e1(0x17c);return undefined;}}
1
+ const a40_0x51286c=a40_0x1f1a;function a40_0x1f1a(_0x58d3ec,_0x183dda){_0x58d3ec=_0x58d3ec-0xc4;const _0x52b18e=a40_0x52b1();let _0x1f1a74=_0x52b18e[_0x58d3ec];return _0x1f1a74;}(function(_0x3c524d,_0x3bbc23){const _0x515a3e=a40_0x1f1a,_0x4f9e5a=_0x3c524d();while(!![]){try{const _0x1d7f40=parseInt(_0x515a3e(0xc6))/0x1*(parseInt(_0x515a3e(0xc9))/0x2)+-parseInt(_0x515a3e(0xda))/0x3+parseInt(_0x515a3e(0xd8))/0x4*(parseInt(_0x515a3e(0xe2))/0x5)+-parseInt(_0x515a3e(0xdc))/0x6+-parseInt(_0x515a3e(0xc4))/0x7+parseInt(_0x515a3e(0xcf))/0x8+parseInt(_0x515a3e(0xcc))/0x9;if(_0x1d7f40===_0x3bbc23)break;else _0x4f9e5a['push'](_0x4f9e5a['shift']());}catch(_0x4287dc){_0x4f9e5a['push'](_0x4f9e5a['shift']());}}}(a40_0x52b1,0x6c301));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a40_0x52b1(){const _0x3453dc=['query','error','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','2388610kWZeoG','validate','642927HUQBNd','table','showTable','2qmAKAK','Catalog:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','1535634QqUXly','database','...','6545880WZBgUI','catalog','message','verbose','args','cause','length','Site:\x20','\x20row','4TmyJqh','Database:\x20','2183760vViOpg','Table:\x20','1993938xoxbGv','data','site','Limit:\x20','Show\x20table\x20contents','Error:\x20','1064110zqMuiN','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','description','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','show'];a40_0x52b1=function(){return _0x3453dc;};return a40_0x52b1();}export class ShowCommand extends BaseCommand{['name']=a40_0x51286c(0xe6);[a40_0x51286c(0xe4)]=a40_0x51286c(0xe0);async['execute'](_0x1683f7){return this['showTable'](_0x1683f7);}async[a40_0x51286c(0xc8)](_0xd7915e){const _0x2b7180=a40_0x51286c,{options:_0x13c91b,args:_0x299001,tdx:_0x19fe2f}=_0xd7915e;let _0x4f5ea7;try{_0x4f5ea7=parseTableReference(_0x299001[0x0]);const _0x5db2e9=_0x13c91b['database'];!_0x4f5ea7[_0x2b7180(0xcd)]&&_0x5db2e9&&(_0x4f5ea7['database']=_0x5db2e9);const _0x1a504d=validateTableDescribeReference(_0x4f5ea7);if(_0x1a504d)return console['error']('Error:\x20'+_0x1a504d),console[_0x2b7180(0xe8)](_0x2b7180(0xe9)),console['error'](_0x2b7180(0xea)),console[_0x2b7180(0xe8)](_0x2b7180(0xe3)),0x1;}catch(_0x52e789){return console[_0x2b7180(0xe8)](_0x2b7180(0xe1)+_0x52e789[_0x2b7180(0xd1)]),console[_0x2b7180(0xe8)](_0x2b7180(0xe9)),console['error'](_0x2b7180(0xea)),console[_0x2b7180(0xe8)](_0x2b7180(0xe3)),0x1;}const _0x3b9cd5=_0x4f5ea7[_0x2b7180(0xd0)],_0x756f60=_0x4f5ea7[_0x2b7180(0xcd)],_0x45a547=_0x4f5ea7[_0x2b7180(0xc7)],_0x3c5d0e=resolveLimit(_0x13c91b['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x13c91b[_0x2b7180(0xd2)]&&(console[_0x2b7180(0xe8)](_0x2b7180(0xd6)+_0x13c91b[_0x2b7180(0xde)]),_0x3b9cd5&&console[_0x2b7180(0xe8)](_0x2b7180(0xca)+_0x3b9cd5),console[_0x2b7180(0xe8)](_0x2b7180(0xd9)+_0x756f60),console[_0x2b7180(0xe8)](_0x2b7180(0xdb)+_0x45a547),console['error'](_0x2b7180(0xdf)+_0x3c5d0e));const _0x3872f9=_0x3b9cd5?_0x3b9cd5+'.'+_0x756f60+'.'+_0x45a547:_0x756f60+'.'+_0x45a547,_0x2708fd=await withSpinner('Querying\x20'+_0x3872f9+_0x2b7180(0xce),()=>_0x19fe2f[_0x2b7180(0xe7)][_0x2b7180(0xc8)](_0x756f60,_0x45a547,_0x3c5d0e,_0x3b9cd5),{'verbose':_0x13c91b[_0x2b7180(0xd2)]}),_0x31f78c=_0x2708fd[_0x2b7180(0xdd)],_0x47da96=_0x31f78c['data'];return _0x47da96[_0x2b7180(0xd5)]===0x0?console['error']('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console['error']('✔\x20Retrieved\x20'+_0x47da96[_0x2b7180(0xd5)]+_0x2b7180(0xd7)+(_0x47da96[_0x2b7180(0xd5)]!==0x1?'s':'')+'\x20from\x20'+_0x3872f9),await handleSDKOutput(_0x47da96,_0x13c91b),0x0;}catch(_0x1b692d){if(_0x1b692d instanceof SDKError)return console[_0x2b7180(0xe8)](_0x2b7180(0xe1)+_0x1b692d[_0x2b7180(0xd1)]),_0x1b692d[_0x2b7180(0xd4)]&&console[_0x2b7180(0xe8)]('\x20\x20Cause:\x20'+_0x1b692d['cause']),0x1;throw _0x1b692d;}}[a40_0x51286c(0xc5)](_0x2286e3){const _0x2c66bb=a40_0x51286c;if(_0x2286e3[_0x2c66bb(0xd3)][_0x2c66bb(0xd5)]===0x0)return _0x2c66bb(0xe5);if(_0x2286e3[_0x2c66bb(0xd3)]['length']>0x1)return _0x2c66bb(0xcb);return undefined;}}
@@ -1 +1 @@
1
- const a41_0x4f6c87=a41_0x3136;(function(_0x41da83,_0x2af455){const _0x30f972=a41_0x3136,_0x22c205=_0x41da83();while(!![]){try{const _0x38c3a4=parseInt(_0x30f972(0x1a5))/0x1+parseInt(_0x30f972(0x196))/0x2*(parseInt(_0x30f972(0x18c))/0x3)+-parseInt(_0x30f972(0x180))/0x4*(-parseInt(_0x30f972(0x1a4))/0x5)+-parseInt(_0x30f972(0x18b))/0x6*(-parseInt(_0x30f972(0x1ab))/0x7)+-parseInt(_0x30f972(0x186))/0x8+-parseInt(_0x30f972(0x191))/0x9*(parseInt(_0x30f972(0x18f))/0xa)+parseInt(_0x30f972(0x181))/0xb*(-parseInt(_0x30f972(0x19a))/0xc);if(_0x38c3a4===_0x2af455)break;else _0x22c205['push'](_0x22c205['shift']());}catch(_0x1d8c5d){_0x22c205['push'](_0x22c205['shift']());}}}(a41_0x5ee9,0x19473));function a41_0x5ee9(){const _0x30b412=['validate','\x20table','49XlZfmG','\x27\x20is\x20ambiguous.','\x20\x20Cause:\x20','Database:\x20all','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Database:\x20','database','Error:\x20Pattern\x20\x27','error','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Error:\x20','270236hmJqxa','22jBsOkP','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','listTables','tables','✔\x20Found\x20','1024792SqhGwn','List\x20tables\x20in\x20a\x20database','\x27\x20across\x20all\x20databases.','limit','Listing\x20tables...','24474wiDysK','508035wBABec','Database\x20\x27','description','30bQXjxt','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','233217hjVmNh','\x20\x20Use:\x20tdx\x20tables\x20\x22','name','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','✖\x20No\x20tables\x20found','2BMWbNM','Site:\x20','Table\x20pattern:\x20','execute','618972yIhRWx','cause','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','message','includes','Note:\x20\x27','table','site','length','data','10dtomrO','79523IzEoxK','Or\x20use\x20--in\x20flag:','Database\x20pattern:\x20','verbose'];a41_0x5ee9=function(){return _0x30b412;};return a41_0x5ee9();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a41_0x3136(_0x5c9514,_0xab72b6){_0x5c9514=_0x5c9514-0x178;const _0x5ee91a=a41_0x5ee9();let _0x3136f8=_0x5ee91a[_0x5c9514];return _0x3136f8;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a41_0x4f6c87(0x193)]=a41_0x4f6c87(0x184);[a41_0x4f6c87(0x18e)]=a41_0x4f6c87(0x187);async[a41_0x4f6c87(0x199)](_0x532f9c){const _0x3b6b35=a41_0x4f6c87,{options:_0xc33f8f,args:_0x58faa2,tdx:_0x25a2d0}=_0x532f9c;let _0x164891;if(_0x58faa2[_0x3b6b35(0x1a2)]===0x0)_0x164891={'database':undefined,'table':undefined,'original':''};else{if(_0x58faa2[_0x3b6b35(0x1a2)]===0x1)try{_0x164891=parseTableReference(_0x58faa2[0x0]);if(_0x164891[_0x3b6b35(0x1a0)]&&!_0x164891[_0x3b6b35(0x17b)]&&!_0x164891['table']['includes']('*')&&!_0x164891[_0x3b6b35(0x1a0)][_0x3b6b35(0x19e)]('?'))return console[_0x3b6b35(0x17d)](_0x3b6b35(0x17c)+_0x58faa2[0x0]+_0x3b6b35(0x1ac)),console[_0x3b6b35(0x17d)](_0x3b6b35(0x182)+_0x164891[_0x3b6b35(0x1a0)]+'\x27?'),console['error'](_0x3b6b35(0x192)+_0x164891[_0x3b6b35(0x1a0)]+'.*\x22'),console['error'](_0x3b6b35(0x17e)+_0x164891[_0x3b6b35(0x1a0)]),console[_0x3b6b35(0x17d)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x164891['table']),console[_0x3b6b35(0x17d)](''),console['error'](_0x3b6b35(0x19f)+_0x58faa2[0x0]+_0x3b6b35(0x194)+_0x164891[_0x3b6b35(0x1a0)]+_0x3b6b35(0x188)),0x1;}catch(_0x61d7e9){return console['error']('Error:\x20'+_0x61d7e9[_0x3b6b35(0x19d)]),0x1;}else return console['error']('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x3b6b35(0x17d)](_0x3b6b35(0x19c)),console[_0x3b6b35(0x17d)](_0x3b6b35(0x190)),console[_0x3b6b35(0x17d)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x3b6b35(0x17d)](_0x3b6b35(0x179)),console[_0x3b6b35(0x17d)](_0x3b6b35(0x1a6)),console[_0x3b6b35(0x17d)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x1acf4=_0xc33f8f[_0x3b6b35(0x17b)];!_0x164891[_0x3b6b35(0x17b)]&&_0x1acf4&&(_0x164891[_0x3b6b35(0x17b)]=_0x1acf4);try{const _0x4cfe44=_0x359d58=>_0x359d58&&(_0x359d58[_0x3b6b35(0x19e)]('*')||_0x359d58[_0x3b6b35(0x19e)]('?')),_0x4ffe11=_0x4cfe44(_0x164891[_0x3b6b35(0x17b)]);_0xc33f8f[_0x3b6b35(0x1a8)]&&(console[_0x3b6b35(0x17d)](_0x3b6b35(0x197)+_0xc33f8f[_0x3b6b35(0x1a1)]),_0x164891['database']?_0x4ffe11?console[_0x3b6b35(0x17d)](_0x3b6b35(0x1a7)+_0x164891[_0x3b6b35(0x17b)]):console[_0x3b6b35(0x17d)](_0x3b6b35(0x17a)+_0x164891[_0x3b6b35(0x17b)]):console[_0x3b6b35(0x17d)](_0x3b6b35(0x178)),_0x164891[_0x3b6b35(0x1a0)]&&console['error'](_0x3b6b35(0x198)+_0x164891[_0x3b6b35(0x1a0)]));const _0x4b7442=_0x164891[_0x3b6b35(0x17b)]&&!_0x4ffe11?_0x164891['database']:undefined,_0x3a78fc=_0x4ffe11?_0x164891[_0x3b6b35(0x17b)]:undefined,_0x21e594=_0x164891[_0x3b6b35(0x1a0)],_0x20c306=resolveLimit(_0xc33f8f[_0x3b6b35(0x189)],DEFAULT_LISTING_LIMIT),_0x6a27fb=await withSpinner(_0x3b6b35(0x18a),()=>_0x25a2d0['query'][_0x3b6b35(0x183)](_0x4b7442,_0x21e594,_0x3a78fc,_0x20c306),{'verbose':_0xc33f8f[_0x3b6b35(0x1a8)]}),_0x441d7e=_0x6a27fb[_0x3b6b35(0x1a3)];if(_0x441d7e[_0x3b6b35(0x1a2)]===0x0&&_0x164891['database']&&!_0x4ffe11)return console[_0x3b6b35(0x17d)](_0x3b6b35(0x195)),console['error'](_0x3b6b35(0x18d)+_0x164891['database']+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console[_0x3b6b35(0x17d)](_0x3b6b35(0x185)+_0x441d7e[_0x3b6b35(0x1a2)]+_0x3b6b35(0x1aa)+(_0x441d7e[_0x3b6b35(0x1a2)]!==0x1?'s':'')),await handleSDKOutput(_0x441d7e,{..._0xc33f8f,'limit':_0x20c306}),0x0;}catch(_0x523846){if(_0x523846 instanceof SDKError)return console['error'](_0x3b6b35(0x17f)+_0x523846['message']),_0x523846[_0x3b6b35(0x19b)]&&console[_0x3b6b35(0x17d)](_0x3b6b35(0x1ad)+_0x523846[_0x3b6b35(0x19b)]),0x1;throw _0x523846;}}[a41_0x4f6c87(0x1a9)](_0x54851f){return undefined;}}
1
+ const a41_0x2f74cf=a41_0x13cc;(function(_0x4489b0,_0x1c18f8){const _0x47bc7a=a41_0x13cc,_0x2a9172=_0x4489b0();while(!![]){try{const _0x34c020=parseInt(_0x47bc7a(0xa9))/0x1*(-parseInt(_0x47bc7a(0xca))/0x2)+-parseInt(_0x47bc7a(0xa1))/0x3*(parseInt(_0x47bc7a(0xa8))/0x4)+parseInt(_0x47bc7a(0xc2))/0x5+parseInt(_0x47bc7a(0xc4))/0x6+parseInt(_0x47bc7a(0xb9))/0x7*(parseInt(_0x47bc7a(0xcb))/0x8)+parseInt(_0x47bc7a(0xb4))/0x9*(-parseInt(_0x47bc7a(0xcc))/0xa)+parseInt(_0x47bc7a(0xbf))/0xb*(parseInt(_0x47bc7a(0xb8))/0xc);if(_0x34c020===_0x1c18f8)break;else _0x2a9172['push'](_0x2a9172['shift']());}catch(_0x220374){_0x2a9172['push'](_0x2a9172['shift']());}}}(a41_0x41b8,0x90cf7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a41_0x41b8(){const _0x81db84=['\x27\x20is\x20ambiguous.','Error:\x20','listTables','256751pWBoEX','execute','Database:\x20','915350lTdbox','✖\x20No\x20tables\x20found','1924002HaqGqE','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Table\x20pattern:\x20','✔\x20Found\x20','Database\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','394oHRbaE','56632zTbXhe','70ggouIA','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Database\x20pattern:\x20','description','limit','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','message','table','.*\x22','15JCyLFT','validate','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','List\x20tables\x20in\x20a\x20database','name','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','647708pCEnCz','5307lItKFo','cause','length','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x27\x20across\x20all\x20databases.','data','includes','error','tables','Database:\x20all','database','732879UqRatB','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','site','verbose','816zkycEq','917EWaLIz','Or\x20use\x20--in\x20flag:','\x20table'];a41_0x41b8=function(){return _0x81db84;};return a41_0x41b8();}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a41_0x13cc(_0x3172ce,_0x1c5c9c){_0x3172ce=_0x3172ce-0x99;const _0x41b8c6=a41_0x41b8();let _0x13ccbe=_0x41b8c6[_0x3172ce];return _0x13ccbe;}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a41_0x2f74cf(0xa6)]=a41_0x2f74cf(0xb1);[a41_0x2f74cf(0x9b)]=a41_0x2f74cf(0xa5);async[a41_0x2f74cf(0xc0)](_0x33930c){const _0x504a01=a41_0x2f74cf,{options:_0x4e6647,args:_0x2a41d5,tdx:_0x29bd0b}=_0x33930c;let _0x2d6137;if(_0x2a41d5['length']===0x0)_0x2d6137={'database':undefined,'table':undefined,'original':''};else{if(_0x2a41d5['length']===0x1)try{_0x2d6137=parseTableReference(_0x2a41d5[0x0]);if(_0x2d6137[_0x504a01(0x9f)]&&!_0x2d6137[_0x504a01(0xb3)]&&!_0x2d6137[_0x504a01(0x9f)][_0x504a01(0xaf)]('*')&&!_0x2d6137[_0x504a01(0x9f)][_0x504a01(0xaf)]('?'))return console[_0x504a01(0xb0)]('Error:\x20Pattern\x20\x27'+_0x2a41d5[0x0]+_0x504a01(0xbc)),console[_0x504a01(0xb0)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x2d6137[_0x504a01(0x9f)]+'\x27?'),console[_0x504a01(0xb0)](_0x504a01(0xa4)+_0x2d6137[_0x504a01(0x9f)]+_0x504a01(0xa0)),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x2d6137[_0x504a01(0x9f)]),console[_0x504a01(0xb0)](_0x504a01(0xa3)+_0x2d6137['table']),console[_0x504a01(0xb0)](''),console[_0x504a01(0xb0)]('Note:\x20\x27'+_0x2a41d5[0x0]+_0x504a01(0xc5)+_0x2d6137['table']+_0x504a01(0xad)),0x1;}catch(_0x33ea90){return console[_0x504a01(0xb0)](_0x504a01(0xbd)+_0x33ea90[_0x504a01(0x9e)]),0x1;}else return console[_0x504a01(0xb0)](_0x504a01(0x9d)),console['error'](_0x504a01(0x99)),console[_0x504a01(0xb0)](_0x504a01(0xc9)),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x504a01(0xb0)](_0x504a01(0xb5)),console[_0x504a01(0xb0)](_0x504a01(0xba)),console[_0x504a01(0xb0)](_0x504a01(0xa7)),0x1;}const _0x20f104=_0x4e6647[_0x504a01(0xb3)];!_0x2d6137[_0x504a01(0xb3)]&&_0x20f104&&(_0x2d6137['database']=_0x20f104);try{const _0x575352=_0x1ba380=>_0x1ba380&&(_0x1ba380['includes']('*')||_0x1ba380[_0x504a01(0xaf)]('?')),_0x3183b0=_0x575352(_0x2d6137[_0x504a01(0xb3)]);_0x4e6647[_0x504a01(0xb7)]&&(console[_0x504a01(0xb0)]('Site:\x20'+_0x4e6647[_0x504a01(0xb6)]),_0x2d6137[_0x504a01(0xb3)]?_0x3183b0?console[_0x504a01(0xb0)](_0x504a01(0x9a)+_0x2d6137[_0x504a01(0xb3)]):console['error'](_0x504a01(0xc1)+_0x2d6137[_0x504a01(0xb3)]):console['error'](_0x504a01(0xb2)),_0x2d6137[_0x504a01(0x9f)]&&console['error'](_0x504a01(0xc6)+_0x2d6137[_0x504a01(0x9f)]));const _0x39575f=_0x2d6137[_0x504a01(0xb3)]&&!_0x3183b0?_0x2d6137[_0x504a01(0xb3)]:undefined,_0x2a1860=_0x3183b0?_0x2d6137[_0x504a01(0xb3)]:undefined,_0x19117b=_0x2d6137[_0x504a01(0x9f)],_0xa76d84=resolveLimit(_0x4e6647[_0x504a01(0x9c)],DEFAULT_LISTING_LIMIT),_0x2c2952=await withSpinner('Listing\x20tables...',()=>_0x29bd0b['query'][_0x504a01(0xbe)](_0x39575f,_0x19117b,_0x2a1860,_0xa76d84),{'verbose':_0x4e6647[_0x504a01(0xb7)]}),_0x2a52c8=_0x2c2952[_0x504a01(0xae)];if(_0x2a52c8[_0x504a01(0xab)]===0x0&&_0x2d6137[_0x504a01(0xb3)]&&!_0x3183b0)return console[_0x504a01(0xb0)](_0x504a01(0xc3)),console[_0x504a01(0xb0)](_0x504a01(0xc8)+_0x2d6137[_0x504a01(0xb3)]+_0x504a01(0xac)),0x1;return console['error'](_0x504a01(0xc7)+_0x2a52c8[_0x504a01(0xab)]+_0x504a01(0xbb)+(_0x2a52c8[_0x504a01(0xab)]!==0x1?'s':'')),await handleSDKOutput(_0x2a52c8,{..._0x4e6647,'limit':_0xa76d84}),0x0;}catch(_0xfecafa){if(_0xfecafa instanceof SDKError)return console[_0x504a01(0xb0)](_0x504a01(0xbd)+_0xfecafa['message']),_0xfecafa[_0x504a01(0xaa)]&&console[_0x504a01(0xb0)]('\x20\x20Cause:\x20'+_0xfecafa['cause']),0x1;throw _0xfecafa;}}[a41_0x2f74cf(0xa2)](_0x1cf1c4){return undefined;}}